[renderer] Don't try to draw a nonexistent view model

Doing so doesn't end well (segfault). This is a bit of a hack until I
come up with a design for configurable scene rendering.
This commit is contained in:
Bill Currie 2022-04-26 07:22:45 +09:00
parent a9b8241a74
commit 5703df00fd
4 changed files with 12 additions and 4 deletions

View file

@ -278,7 +278,9 @@ gl_R_RenderView (void)
gl_R_DrawWorld ();
S_ExtraUpdate (); // don't let sound get messed up if going slow
gl_R_RenderDlights ();
R_DrawViewModel ();
if (vr_data.view_model) {
R_DrawViewModel ();
}
gl_Fog_DisableGFog ();
}

View file

@ -142,7 +142,9 @@ glsl_R_RenderView (void)
R_SetupView ();
glsl_R_DrawWorld ();
glsl_R_DrawSky ();
R_DrawViewModel ();
if (vr_data.view_model) {
R_DrawViewModel ();
}
}
static void

View file

@ -589,7 +589,9 @@ R_RenderView_ (void)
R_EdgeDrawing (r_ent_queue);
R_DrawViewModel ();
if (vr_data.view_model) {
R_DrawViewModel ();
}
if (r_aliasstats)
R_PrintAliasStats ();

View file

@ -122,7 +122,9 @@ Vulkan_RenderView (qfv_renderframe_t *rFrame)
Vulkan_DrawWorld (rFrame);
Vulkan_DrawSky (rFrame);
Vulkan_DrawViewModel (ctx);
if (vr_data.view_model) {
Vulkan_DrawViewModel (ctx);
}
Vulkan_DrawWaterSurfaces (rFrame);
Vulkan_Bsp_Flush (ctx);
}