- c_dispatch header cleanup and splitting of gamestate into a separate header, to avoid polluting low level code with game specific headers.

This commit is contained in:
Christoph Oelckers 2020-04-11 18:05:13 +02:00
parent b7ff7302e5
commit 31fbff85f4
7 changed files with 39 additions and 38 deletions

View file

@ -39,6 +39,12 @@ extern "C" int myvsnprintf(char* buffer, size_t count, const char* format, va_li
#define TEXTCOLOR_SAPPHIRE "\034Y"
#define TEXTCOLOR_TEAL "\034Z"
#define TEXTCOLOR_NORMAL "\034-"
#define TEXTCOLOR_BOLD "\034+"
#define TEXTCOLOR_CHAT "\034*"
#define TEXTCOLOR_TEAMCHAT "\034!"
// game print flags
enum
{

View file

@ -40,22 +40,20 @@
#include <ctype.h>
#include "templates.h"
#include "doomtype.h"
#include "cmdlib.h"
#include "c_console.h"
#include "c_dispatch.h"
#include "m_argv.h"
#include "g_game.h"
#include "d_player.h"
#include "gamestate.h"
#include "configfile.h"
#include "v_text.h"
#include "printf.h"
#include "c_cvars.h"
#include "c_buttons.h"
// Todo: Get rid of
#include "d_net.h"
#include "d_main.h"
#include "serializer.h"
#include "menu/menu.h"
#include "vm.h"
#include "g_levellocals.h"
#include "c_buttons.h"
// MACROS ------------------------------------------------------------------
@ -1089,7 +1087,7 @@ bool C_ExecFile (const char *file)
exec->ExecCommands();
if (exec->Pullins.Size() > 0)
{
Printf(TEXTCOLOR_BOLD "Notice: Pullin files were ignored.\n");
Printf(TEXTCOLOR_RED "Notice: Pullin files were ignored.\n");
}
delete exec;
}

View file

@ -56,6 +56,7 @@ struct FExecList
};
extern bool ParsingKeyConf, UnsafeExecutionContext;
extern FString StoredWarp; // [RH] +warp at the command line
extern bool CheckCheatmode (bool printmsg = true);

View file

@ -64,8 +64,6 @@ extern FString startmap; // [RH] Actual map name now
extern bool autostart;
extern FString StoredWarp; // [RH] +warp at the command line
// Selected by user.
EXTERN_CVAR (Int, gameskill);
extern int NextSkill; // [RH] Skill to use at next level load

View file

@ -32,28 +32,8 @@ struct event_t;
#include "dobjgc.h"
#include "name.h"
#include "gamestate.h"
// 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_FORCEWIPE = -1,
GS_FORCEWIPEFADE = -2,
GS_FORCEWIPEBURN = -3,
GS_FORCEWIPEMELT = -4
};
extern gamestate_t gamestate;
// wipegamestate can be set to -1
// to force a wipe on the next draw

View file

@ -46,11 +46,6 @@ struct FBrokenLines
#define TEXTCOLOR_ESCAPE '\034'
#define TEXTCOLOR_ESCAPESTR "\034"
#define TEXTCOLOR_NORMAL "\034-"
#define TEXTCOLOR_BOLD "\034+"
#define TEXTCOLOR_CHAT "\034*"
#define TEXTCOLOR_TEAMCHAT "\034!"
TArray<FBrokenLines> V_BreakLines (FFont *font, int maxwidth, const uint8_t *str, bool preservecolor = false);
inline TArray<FBrokenLines> V_BreakLines (FFont *font, int maxwidth, const char *str, bool preservecolor = false)

23
src/gamestate.h Normal file
View file

@ -0,0 +1,23 @@
#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_FORCEWIPE = -1,
GS_FORCEWIPEFADE = -2,
GS_FORCEWIPEBURN = -3,
GS_FORCEWIPEMELT = -4
};
extern gamestate_t gamestate;