From e52133ea5d0ff80bc7d13485fbaa54020cd8e948 Mon Sep 17 00:00:00 2001 From: myT <> Date: Wed, 27 Sep 2023 14:51:38 +0200 Subject: [PATCH] no longer drawing the scene when in hyperspace --- code/renderer/grp_world.cpp | 2 +- code/renderer/tr_cmds.cpp | 3 +++ code/renderer/tr_local.h | 1 + 3 files changed, 5 insertions(+), 1 deletion(-) diff --git a/code/renderer/grp_world.cpp b/code/renderer/grp_world.cpp index 8668e4a..490204c 100644 --- a/code/renderer/grp_world.cpp +++ b/code/renderer/grp_world.cpp @@ -1045,7 +1045,7 @@ void World::DrawSceneView(const drawSceneViewCommand_t& cmd) CmdClearColorTarget(grp.renderTarget, cmd.clearColor, &rect); } - if(cmd.numDrawSurfs <= 0) + if(cmd.numDrawSurfs <= 0 || !cmd.shouldDrawScene) { return; } diff --git a/code/renderer/tr_cmds.cpp b/code/renderer/tr_cmds.cpp index 7b62cb5..6fd5724 100644 --- a/code/renderer/tr_cmds.cpp +++ b/code/renderer/tr_cmds.cpp @@ -198,6 +198,7 @@ void R_AddDrawSurfCmd( drawSurf_t* drawSurfs, int numDrawSurfs, int numTranspSur Q_assert( cmd ); qbool shouldClearColor = qfalse; + qbool shouldDrawScene = qtrue; vec4_t clearColor = { 0.0f, 0.0f, 0.0f, 1.0f }; if ( tr.refdef.rdflags & RDF_HYPERSPACE ) { const float c = RB_HyperspaceColor(); @@ -205,6 +206,7 @@ void R_AddDrawSurfCmd( drawSurf_t* drawSurfs, int numDrawSurfs, int numTranspSur clearColor[1] = c; clearColor[2] = c; shouldClearColor = qtrue; + shouldDrawScene = qfalse; } else if ( r_fastsky->integer && !(tr.refdef.rdflags & RDF_NOWORLDMODEL) ) { shouldClearColor = qtrue; } else if ( r_clear->integer ) { @@ -220,6 +222,7 @@ void R_AddDrawSurfCmd( drawSurf_t* drawSurfs, int numDrawSurfs, int numTranspSur cmd->refdef = tr.refdef; cmd->viewParms = tr.viewParms; cmd->shouldClearColor = shouldClearColor; + cmd->shouldDrawScene = shouldDrawScene; Vector4Copy( clearColor, cmd->clearColor ); } diff --git a/code/renderer/tr_local.h b/code/renderer/tr_local.h index ae5b44b..c3819a9 100644 --- a/code/renderer/tr_local.h +++ b/code/renderer/tr_local.h @@ -1491,6 +1491,7 @@ struct drawSceneViewCommand_t : renderCommandBase_t { int numTranspSurfs; drawSurf_t* drawSurfs; qbool shouldClearColor; + qbool shouldDrawScene; vec4_t clearColor; };