From dcb933efb57ecd8adebbee03ef557ab5f7a61bc5 Mon Sep 17 00:00:00 2001 From: Daniel Gibson Date: Sat, 12 Jun 2021 05:29:20 +0200 Subject: [PATCH] Fix rendering HUD with r_lockSurfaces 1 only override cmd->viewDef in RB_DrawView() if we're drawing the primary view (which for several calculations before actual drawing was set to the saved/locked render view) Note that r_lockSurfaces is more useful with r_useScissor 0 (otherwise there's black bars over the screen when moving) and r_shadows 0 (otherwise areas that weren't visible when locking are black because the lights there are skipped) remaining bug: gui surfaces move around the screen when looking around --- neo/renderer/tr_render.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/neo/renderer/tr_render.cpp b/neo/renderer/tr_render.cpp index 90d74531..9882d621 100644 --- a/neo/renderer/tr_render.cpp +++ b/neo/renderer/tr_render.cpp @@ -856,7 +856,11 @@ void RB_DrawView( const void *data ) { cmd = (const drawSurfsCommand_t *)data; - if(r_lockSurfaces.GetBool()) { + // with r_lockSurfaces enabled, we set the locked render view + // for the primary viewDef for all the "what should be drawn" calculations. + // now it must be reverted to the real render view so the scene gets rendered + // from the actual current players point of view + if(r_lockSurfaces.GetBool() && tr.primaryView == cmd->viewDef) { //viewDef = &tr.lockSurfacesRealViewDef; //const viewDef_t origParms = *backEnd.viewDef; viewDef_t* parms = cmd->viewDef;