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
This commit is contained in:
Daniel Gibson 2021-06-12 05:29:20 +02:00
parent 1a6998781b
commit dcb933efb5

View file

@ -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;