diff --git a/src/decomp/decomp.c b/src/decomp/decomp.c index 353bc248..611459da 100644 --- a/src/decomp/decomp.c +++ b/src/decomp/decomp.c @@ -564,6 +564,7 @@ void __cdecl Shell_Shutdown(void) if (g_ErrorMessage[0]) { MessageBoxA(NULL, g_ErrorMessage, NULL, MB_ICONWARNING); } + Text_Shutdown(); UI_Shutdown(); Config_Shutdown(); } @@ -572,7 +573,6 @@ int16_t __cdecl TitleSequence(void) { GF_N_LoadStrings(-1); - Text_Init(); TempVideoAdjust(1, 1.0); g_NoInputCounter = 0; diff --git a/src/game/shell.c b/src/game/shell.c index 1f6eeee4..7532d5dc 100644 --- a/src/game/shell.c +++ b/src/game/shell.c @@ -10,6 +10,7 @@ #include "game/input.h" #include "game/music.h" #include "game/sound.h" +#include "game/text.h" #include "global/funcs.h" #include "global/vars.h" @@ -31,7 +32,9 @@ BOOL __cdecl Shell_Main(void) GameString_Init(); EnumMap_Init(); Config_Init(); + Text_Init(); UI_Init(); + Console_Init(); Config_Read(); if (!S_InitialiseSystem()) { diff --git a/src/game/text.c b/src/game/text.c index 3dc37b4d..350dfd82 100644 --- a/src/game/text.c +++ b/src/game/text.c @@ -34,13 +34,10 @@ void __cdecl Text_Init(void) for (int32_t i = 0; i < MAX_TEXTSTRINGS; i++) { m_TextStrings[i].flags.all = 0; } +} - // TODO: move me outta here! - // instead Text_Init should be only called once per game launch, and - // everyone should clean up after themselves rather than creating dangling - // pointers. - Console_Shutdown(); - Console_Init(); +void Text_Shutdown(void) +{ } TEXTSTRING *__cdecl Text_Create( diff --git a/src/game/text.h b/src/game/text.h index 30954400..d9204340 100644 --- a/src/game/text.h +++ b/src/game/text.h @@ -6,6 +6,8 @@ #define TEXT_MAX_STRING_SIZE 64 void __cdecl Text_Init(void); +void Text_Shutdown(void); + TEXTSTRING *__cdecl Text_Create( int32_t x, int32_t y, int32_t z, const char *string); void __cdecl Text_ChangeText(TEXTSTRING *string, const char *text);