- copied the restart cleanup code into its own function

This commit is contained in:
Christoph Oelckers 2019-10-01 00:30:44 +02:00
parent 282047e67c
commit 42a54ef545

View file

@ -134,6 +134,7 @@ void D_AddWildFile (TArray<FString> &wadfiles, const char *pattern);
void D_LoadWadSettings ();
void ParseGLDefs();
void DrawFullscreenSubtitle(const char *text);
void D_Cleanup();
// PRIVATE FUNCTION PROTOTYPES ---------------------------------------------
@ -2745,6 +2746,21 @@ void D_DoomMain (void)
// Clean up after a restart
//
D_Cleanup();
gamestate = GS_STARTUP;
}
while (1);
}
//==========================================================================
//
// clean up the resources
//
//==========================================================================
void D_Cleanup()
{
// Music and sound should be stopped first
S_StopMusic(true);
S_StopAllChannels ();
@ -2806,10 +2822,6 @@ void D_DoomMain (void)
restart++;
PClass::bShutdown = false;
PClass::bVMOperational = false;
gamestate = GS_STARTUP;
}
while (1);
}
//==========================================================================