Move vid callback access into vid

The plan is to move the callbacks into a "private" struct.
This commit is contained in:
Bill Currie 2019-07-08 12:46:22 +09:00
parent 6137795682
commit 3e1520c246
7 changed files with 24 additions and 6 deletions

View file

@ -88,5 +88,6 @@ void VID_Init_Cvars (void);
void VID_Init (byte *palette, byte *colormap);
void VID_Shutdown (void);
void VID_SetCaption (const char *text);
void VID_ClearMemory (void);
#endif // __vid_h_

View file

@ -305,3 +305,10 @@ VID_InitBuffers (void)
if (viddef.init_caches)
viddef.init_caches (viddef.surfcache, cachesize);
}
void
VID_ClearMemory (void)
{
if (viddef.flush_caches)
viddef.flush_caches ();
}

View file

@ -287,6 +287,7 @@ struct cbuf_s;
void CL_Init (struct cbuf_s *cbuf);
void CL_InitCvars (void);
void CL_Shutdown (void);
void CL_ClearMemory (void);
void CL_EstablishConnection (const char *host);
void CL_Signon1 (void);

View file

@ -130,6 +130,14 @@ CL_Shutdown (void)
VID_Shutdown ();
}
void
CL_ClearMemory (void)
{
VID_ClearMemory ();
if (r_data)
r_data->force_fullscreen = 0;
}
void
CL_InitCvars (void)
{

View file

@ -495,8 +495,7 @@ void
Host_ClearMemory (void)
{
Sys_MaskPrintf (SYS_DEV, "Clearing memory\n");
if (viddef.flush_caches)
viddef.flush_caches ();
CL_ClearMemory ();
Mod_ClearAll ();
if (host_hunklevel)
Hunk_FreeToLowMark (host_hunklevel);
@ -504,8 +503,6 @@ Host_ClearMemory (void)
cls.signon = 0;
memset (&sv, 0, sizeof (sv));
memset (&cl, 0, sizeof (cl));
if (r_data)
r_data->force_fullscreen = 0;
}
/*

View file

@ -68,6 +68,11 @@ CL_UpdateScreen (double realtime)
{
}
void
CL_ClearMemory (void)
{
}
void
CL_Cmd_ForwardToServer (void)
{

View file

@ -412,8 +412,7 @@ CL_ClearState (void)
CL_Init_Entity (&cl.viewent);
Sys_MaskPrintf (SYS_DEV, "Clearing memory\n");
if (viddef.flush_caches)
viddef.flush_caches ();
VID_ClearMemory ();
Mod_ClearAll ();
if (host_hunklevel) // FIXME: check this...
Hunk_FreeToLowMark (host_hunklevel);