Merge remote-tracking branch 'origin/friendly_window_title'

This commit is contained in:
Rachael Alexanderson 2017-11-24 14:41:25 -05:00
commit 6d43c5cdc6
4 changed files with 84 additions and 3 deletions

View file

@ -128,6 +128,7 @@ void DrawHUD();
// EXTERNAL FUNCTION PROTOTYPES --------------------------------------------
extern void I_SetWindowTitle(const char* caption);
extern void ReadStatistics();
extern void M_RestoreMode ();
extern void M_SetDefaultMode ();
@ -164,6 +165,7 @@ EXTERN_CVAR (Bool, lookstrafe)
EXTERN_CVAR (Int, screenblocks)
EXTERN_CVAR (Bool, sv_cheats)
EXTERN_CVAR (Bool, sv_unlimited_pickup)
EXTERN_CVAR (Bool, I_FriendlyWindowTitle)
extern int testingmode;
extern bool setmodeneeded;
@ -2742,6 +2744,9 @@ void D_DoomMain (void)
setmodeneeded = false; // This may be set to true here, but isn't needed for a restart
}
if (I_FriendlyWindowTitle)
I_SetWindowTitle(DoomStartupInfo.Name.GetChars());
D_DoomLoop (); // this only returns if a 'restart' CCMD is given.
//
// Clean up after a restart
@ -2777,6 +2782,10 @@ void D_DoomMain (void)
FS_Close(); // destroy the global FraggleScript.
DeinitMenus();
// delete DoomStartupInfo data
DoomStartupInfo.Name = (const char*)0;
DoomStartupInfo.BkColor = DoomStartupInfo.FgColor = DoomStartupInfo.Type = 0;
GC::FullGC(); // clean up before taking down the object list.
// Delete the reference to the VM functions here which were deleted and will be recreated after the restart.
@ -2896,3 +2905,12 @@ DEFINE_FIELD_X(InputEventData, event_t, data2)
DEFINE_FIELD_X(InputEventData, event_t, data3)
DEFINE_FIELD_X(InputEventData, event_t, x)
DEFINE_FIELD_X(InputEventData, event_t, y)
CUSTOM_CVAR(Bool, I_FriendlyWindowTitle, true, CVAR_GLOBALCONFIG|CVAR_ARCHIVE|CVAR_NOINITCALL)
{
if (self)
I_SetWindowTitle(DoomStartupInfo.Name.GetChars());
else
I_SetWindowTitle(NULL);
}