From 3e69c87aa6c9343a229a9ba15fc0dfa19388d0fd Mon Sep 17 00:00:00 2001 From: razor Date: Mon, 19 Feb 2024 11:49:43 +0800 Subject: [PATCH] render local entities as late as possible (#1200) this should defer an overflow of refents occurring that would result in e.g. map models disappearing (light poles on mp/ffa5) localents are a lower priority, we can afford to miss out on force push/grip effects in these cases (cherry picked from commit 2d618a5ca6dbe7c88ffaa29523665fb18cb23bf5) --- codemp/cgame/cg_view.c | 22 +++++++++++++--------- 1 file changed, 13 insertions(+), 9 deletions(-) diff --git a/codemp/cgame/cg_view.c b/codemp/cgame/cg_view.c index 2e9fbf7a07..8e497df60f 100644 --- a/codemp/cgame/cg_view.c +++ b/codemp/cgame/cg_view.c @@ -393,7 +393,7 @@ static void CG_CalcIdealThirdPersonViewLocation(void) newThirdPersonRange = thirdPersonRange * thirdPersonRange / 176; else newThirdPersonRange = thirdPersonRange * thirdPersonRange / cg_zoomFov.integer; - } + } else { if (cg_zoomFov.integer < 1) @@ -410,7 +410,7 @@ static void CG_CalcIdealThirdPersonViewLocation(void) } else { newThirdPersonRange = thirdPersonRange; } - } + } //JAPRO - Clientside - Allow for +zoom - End if (cg.snap && cg.snap->ps.m_iVehicleNum) @@ -1095,18 +1095,18 @@ static void CG_OffsetFirstPersonView( void ) { { if (!(cgs.jcinfo & JAPRO_CINFO_SCREENSHAKE)) { - } + } else if ( cg.damageTime ) { ratio = cg.time - cg.damageTime; - if ( ratio < DAMAGE_DEFLECT_TIME ) + if ( ratio < DAMAGE_DEFLECT_TIME ) { ratio /= DAMAGE_DEFLECT_TIME; angles[PITCH] += ratio * cg.v_dmg_pitch; angles[ROLL] += ratio * cg.v_dmg_roll; - } else + } else { ratio = 1.0 - ( ratio - DAMAGE_DEFLECT_TIME ) / DAMAGE_RETURN_TIME; - if ( ratio > 0 ) + if ( ratio > 0 ) { angles[PITCH] += ratio * cg.v_dmg_pitch; angles[ROLL] += ratio * cg.v_dmg_roll; @@ -1390,7 +1390,7 @@ static qboolean CG_CalcFov( void ) { fov_x = 176; else fov_x = cg_zoomFov.integer; - } + } else { if (cg_zoomFov.integer < 1) @@ -2536,7 +2536,7 @@ static QINLINE void CG_DoAsync( void ) { //Need to decouple frames from kick i guess. //If we are on kick 1, check to see if our cvar for it is above frames. If so , kick and increment kickcount. - + //Increment if (cg.numFKFrames > cg_fkDuration.integer) { trap->SendConsoleCommand("-moveup\n"); @@ -3044,7 +3044,6 @@ void CG_DrawActiveFrame( int serverTime, stereoFrame_t stereoView, qboolean demo if ( !cg.hyperspace ) { CG_AddPacketEntities(qfalse); // adter calcViewValues, so predicted player state is correct CG_AddMarks(); - CG_AddLocalEntities(); #if _NEWTRAILS if (cg.drawingStrafeTrails) { CG_AddAllStrafeTrails(); @@ -3064,6 +3063,11 @@ void CG_DrawActiveFrame( int serverTime, stereoFrame_t stereoView, qboolean demo if ( cg.testModelEntity.hModel ) { CG_AddTestModel(); } + + if ( !cg.hyperspace ) { + CG_AddLocalEntities(); + } + cg.refdef.time = cg.time; memcpy( cg.refdef.areamask, cg.snap->areamask, sizeof( cg.refdef.areamask ) );