[renderer] Make R_RenderView private

This is actually a better solution to the renderer directly accessing
client code than provided by 7e078c7f9c.

Essentially, V_RenderView should not have been calling R_RenderView, and
CL_UpdateScreen should have been calling V_RenderView directly. The
issue was that the renderers expected the world entity model to be valid
at all times. Now, R_RenderView checks the world entity model's validity
and immediately bails if it is not, and R_ClearState (which is called
whenever the client disconnects and thus no longer has a world to
render) clears the world entity model. Thus R_RenderView can (and is)
now called unconditionally from within the renderer, simplifying
renderer-specific variants.
This commit is contained in:
Bill Currie 2021-12-02 18:30:57 +09:00
parent eb828007e9
commit 84a24dbb34
27 changed files with 42 additions and 55 deletions

View file

@ -1145,6 +1145,7 @@ CL_SetState (cactive_t state)
if (old_state == ca_active) {
// leaving active state
IN_ClearStates ();
CL_ClearState ();
// Auto demo recorder stops here
if (cl_autorecord->int_val && cls.demorecording)

View file

@ -187,5 +187,6 @@ CL_UpdateScreen (double realtime)
scr_funcs_normal[3] = r_funcs->SCR_DrawPause;
V_PrepBlend ();
SCR_UpdateScreen (realtime, V_RenderView, scr_funcs[index]);
V_RenderView ();
SCR_UpdateScreen (realtime, scr_funcs[index]);
}

View file

@ -760,8 +760,6 @@ V_RenderView (void)
} else {
V_CalcRefdef ();
}
r_funcs->R_RenderView ();
}
void