Clean up the mess around D_FlushCaches.

Create an R_ClearState and call that from the clients. It calls any
necessary functions itself.
This commit is contained in:
Bill Currie 2011-12-23 12:51:47 +09:00
parent 33c5320c0e
commit 53d89bf85a
9 changed files with 29 additions and 18 deletions

View file

@ -152,6 +152,7 @@ extern int r_viewsize;
void R_Init (void);
void R_Init_Cvars (void);
void R_InitEfrags (void);
void R_ClearState (void);
void R_InitSky (struct texture_s *mt); // called at level load
void R_Textures_Init (void);
void R_RenderView (void); // must set r_refdef first

View file

@ -947,3 +947,11 @@ R_RenderViewFishEye (void)
qfglMatrixMode (GL_MODELVIEW);
qfglCallList (fisheye_grid);
}
VISIBLE void
R_ClearState (void)
{
R_ClearEfrags ();
R_ClearDlights ();
R_ClearParticles ();
}

View file

@ -256,8 +256,3 @@ R_TimeRefresh_f (void)
time = stop - start;
Sys_MaskPrintf (SYS_DEV, "%f seconds (%f fps)\n", time, 128 / time);
}
VISIBLE void
D_FlushCaches (void)
{
}

View file

@ -1190,3 +1190,12 @@ void
gl_overbright_f (cvar_t *un)
{
}
VISIBLE void
R_ClearState (void)
{
D_FlushCaches ();
R_ClearEfrags ();
R_ClearDlights ();
R_ClearParticles ();
}

View file

@ -912,3 +912,12 @@ void
gl_overbright_f (cvar_t *un)
{
}
VISIBLE void
R_ClearState (void)
{
D_FlushCaches ();
R_ClearEfrags ();
R_ClearDlights ();
R_ClearParticles ();
}

View file

@ -216,9 +216,7 @@ CL_ClearState (void)
CL_ClearTEnts ();
R_ClearEfrags ();
R_ClearDlights ();
R_ClearParticles ();
R_ClearState ();
CL_ClearEnts ();
}

View file

@ -496,7 +496,6 @@ void
Host_ClearMemory (void)
{
Sys_MaskPrintf (SYS_DEV, "Clearing memory\n");
D_FlushCaches ();
Mod_ClearAll ();
if (host_hunklevel)
Hunk_FreeToLowMark (host_hunklevel);

View file

@ -131,11 +131,6 @@ CL_StopPlayback (void)
{
}
void
D_FlushCaches (void)
{
}
void
IN_ProcessEvents (void)
{

View file

@ -413,7 +413,6 @@ CL_ClearState (void)
CL_Init_Entity (&cl.viewent);
Sys_MaskPrintf (SYS_DEV, "Clearing memory\n");
D_FlushCaches ();
Mod_ClearAll ();
if (host_hunklevel) // FIXME: check this...
Hunk_FreeToLowMark (host_hunklevel);
@ -421,9 +420,7 @@ CL_ClearState (void)
CL_ClearEnts ();
CL_ClearTEnts ();
R_ClearEfrags ();
R_ClearDlights ();
R_ClearParticles ();
R_ClearState ();
SZ_Clear (&cls.netchan.message);