- route all accesses to gameaction from the backend through the sysCallbacks.

gameactions are frontend specific so this needs to be decoupled.
This commit is contained in:
Christoph Oelckers 2021-05-22 12:58:07 +02:00
commit 9898ee542c
6 changed files with 39 additions and 29 deletions

View file

@ -50,6 +50,7 @@
#include "c_dispatch.h"
#include "s_music.h"
#include "m_argv.h"
#include "i_interface.h"
CVAR(Bool, inter_subtitles, false, CVAR_ARCHIVE | CVAR_GLOBALCONFIG);
@ -316,7 +317,7 @@ bool StartCutscene(CutsceneDef& cs, int flags, const CompletionFunc& completion_
}
if (flags & SJ_DELAY) intermissiondelay = 10; // need to wait a bit at the start to let the timer catch up.
else intermissiondelay = 0;
gameaction = (flags & SJ_BLOCKUI) ? ga_intro : ga_intermission;
if (sysCallbacks.StartCutscene) sysCallbacks.StartCutscene(flags & SJ_BLOCKUI);
}
catch (...)
{

View file

@ -0,0 +1,29 @@
#pragma once
// The current state of the game: whether we are
// playing, gazing at the intermission screen,
// the game final animation, or a demo.
enum gamestate_t : int
{
GS_LEVEL,
GS_INTERMISSION,
GS_FINALE,
GS_DEMOSCREEN,
GS_FULLCONSOLE, // [RH] Fullscreen console
GS_HIDECONSOLE, // [RH] The menu just did something that should hide fs console
GS_STARTUP, // [RH] Console is fullscreen, and game is just starting
GS_TITLELEVEL, // [RH] A combination of GS_LEVEL and GS_DEMOSCREEN
GS_INTRO,
GS_CUTSCENE,
GS_MENUSCREEN = GS_DEMOSCREEN,
GS_FORCEWIPE = -1,
GS_FORCEWIPEFADE = -2,
GS_FORCEWIPEBURN = -3,
GS_FORCEWIPEMELT = -4
};
extern gamestate_t gamestate;
extern int intermissiondelay;

View file

@ -34,6 +34,7 @@ struct SystemCallbacks
void (*FontCharCreated)(FGameTexture* base, FGameTexture* untranslated);
void (*ToggleFullConsole)();
void (*StartCutscene)(bool blockui);
};
extern SystemCallbacks sysCallbacks;