/* ===================== CL_ClearState Called before parsing a gamestate ===================== */ void CL_ClearState (void) { CL_ShutdownCGame(); S_StopAllSounds(); memset( &cl, 0, sizeof( cl ) ); }
/* ================= CL_Vid_Restart_f Restart the video subsystem ================= */ void CL_Vid_Restart_f( void ) { S_StopAllSounds(); // don't let them loop during the restart S_BeginRegistration(); // all sound handles are now invalid CL_ShutdownRef(); CL_ShutdownUI(); CL_ShutdownCGame(); //rww - sof2mp does this here, but it seems to cause problems in this codebase. // CM_ClearMap(); CL_InitRef(); cls.rendererStarted = qfalse; cls.uiStarted = qfalse; cls.cgameStarted = qfalse; cls.soundRegistered = qfalse; #ifdef _IMMERSION CL_ShutdownFF(); cls.forceStarted = qfalse; #endif // _IMMERSION #ifdef _XBOX vidRestartReloadMap = qtrue; #endif // unpause so the cgame definately gets a snapshot and renders a frame Cvar_Set( "cl_paused", "0" ); }
/* ================= CL_FlushMemory Called by CL_MapLoading, CL_Connect_f, and CL_ParseGamestate the only ways a client gets into a game Also called by Com_Error ================= */ void CL_FlushMemory( void ) { // clear sounds (moved higher up within this func to avoid the odd sound stutter) S_DisableSounds(); // unload the old VM CL_ShutdownCGame(); CL_ShutdownUI(); if ( re.Shutdown ) { re.Shutdown( qfalse ); // don't destroy window or context } //rwwFIXMEFIXME: The game server appears to continue running, so clearing common bsp data causes crashing and other bad things /* CM_ClearMap(); */ cls.soundRegistered = qfalse; cls.rendererStarted = qfalse; #ifdef _IMMERSION CL_ShutdownFF(); cls.forceStarted = qfalse; #endif // _IMMERSION }
void Hunk_Clear( void ) { #ifndef DEDICATED CL_ShutdownCGame(); CL_ShutdownUI(); #endif SV_ShutdownGameProgs(); #ifndef DEDICATED CIN_CloseAllVideos(); #endif hunk_tag = TAG_HUNK_MARK1; Z_TagFree(TAG_HUNK_MARK1); Z_TagFree(TAG_HUNK_MARK2); if ( re.HunkClearCrap ) { re.HunkClearCrap(); } // Com_Printf( "Hunk_Clear: reset the hunk ok\n" ); VM_Clear(); //See if any ghoul2 stuff was leaked, at this point it should be all cleaned up. #ifdef _FULL_G2_LEAK_CHECKING assert(g_Ghoul2Allocations == 0 && g_G2ClientAlloc == 0 && g_G2ServerAlloc == 0); if (g_Ghoul2Allocations) { Com_Printf("%i bytes leaked by ghoul2 routines (%i client, %i server)\n", g_Ghoul2Allocations, g_G2ClientAlloc, g_G2ServerAlloc); G2_DEBUG_ReportLeaks(); } #endif }
/* ===================== CL_ClearState Called before parsing a gamestate ===================== */ void CL_ClearState (void) { CL_ShutdownCGame(); S_StopAllSounds(); memset( &cl, 0, sizeof( cl ) ); if( vr_enabled->value) VR_ResetOrientation(); }
/* ================= CL_Vid_Restart_f Restart the video subsystem ================= */ void CL_Vid_Restart_f( void ) { S_StopAllSounds(); // don't let them loop during the restart S_BeginRegistration(); // all sound handles are now invalid CL_ShutdownRef(); CL_ShutdownUI(); CL_ShutdownCGame(); CL_InitRef(); cls.rendererStarted = qfalse; cls.uiStarted = qfalse; cls.cgameStarted = qfalse; cls.soundRegistered = qfalse; // unpause so the cgame definately gets a snapshot and renders a frame Cvar_Set( "cl_paused", "0" ); }
/* ================= CL_FlushMemory Called by CL_MapLoading, CL_Connect_f, and CL_ParseGamestate the only ways a client gets into a game Also called by Com_Error ================= */ void CL_FlushMemory( void ) { // clear sounds (moved higher up within this func to avoid the odd sound stutter) S_DisableSounds(); // unload the old VM CL_ShutdownCGame(); CL_ShutdownUI(); if ( re.Shutdown ) { re.Shutdown( qfalse ); // don't destroy window or context } cls.soundRegistered = qfalse; cls.rendererStarted = qfalse; }