From d70b5d66b8030e78abe8129b274a0779dd9aae43 Mon Sep 17 00:00:00 2001 From: bones_was_here Date: Thu, 1 Feb 2024 20:05:07 +1000 Subject: [PATCH] render: merge R_View_UpdateWithScissor() and R_View_Update() Signed-off-by: bones_was_here --- gl_rmain.c | 26 ++++++-------------------- 1 file changed, 6 insertions(+), 20 deletions(-) diff --git a/gl_rmain.c b/gl_rmain.c index cc0895cd..9571d048 100644 --- a/gl_rmain.c +++ b/gl_rmain.c @@ -4379,7 +4379,7 @@ static void R_View_SetFrustum(const int *scissor) //PlaneClassify(&frustum[4]); } -static void R_View_UpdateWithScissor(const int *myscissor) +static void R_View_Update(const int *myscissor) { R_Main_ResizeViewCache(); R_View_SetFrustum(myscissor); @@ -4387,14 +4387,6 @@ static void R_View_UpdateWithScissor(const int *myscissor) R_View_UpdateEntityVisible(); } -static void R_View_Update(void) -{ - R_Main_ResizeViewCache(); - R_View_SetFrustum(NULL); - R_View_WorldVisibility(!r_refdef.view.usevieworiginculling); - R_View_UpdateEntityVisible(); -} - float viewscalefpsadjusted = 1.0f; void R_SetupView(qbool allowwaterclippingplane, int viewfbo, rtexture_t *viewdepthtexture, rtexture_t *viewcolortexture, int viewx, int viewy, int viewwidth, int viewheight) @@ -4867,10 +4859,7 @@ static void R_Water_ProcessPlanes(int fbo, rtexture_t *depthtexture, rtexture_t GL_ScissorTest(false); R_ClearScreen(r_refdef.fogenabled); GL_ScissorTest(true); - if(r_water_scissormode.integer & 2) - R_View_UpdateWithScissor(myscissor); - else - R_View_Update(); + R_View_Update(r_water_scissormode.integer & 2 ? myscissor : NULL); R_AnimCache_CacheVisibleEntities(); if(r_water_scissormode.integer & 1) GL_Scissor(myscissor[0], myscissor[1], myscissor[2], myscissor[3]); @@ -4935,10 +4924,7 @@ static void R_Water_ProcessPlanes(int fbo, rtexture_t *depthtexture, rtexture_t GL_ScissorTest(false); R_ClearScreen(r_refdef.fogenabled); GL_ScissorTest(true); - if(r_water_scissormode.integer & 2) - R_View_UpdateWithScissor(myscissor); - else - R_View_Update(); + R_View_Update(r_water_scissormode.integer & 2 ? myscissor : NULL); R_AnimCache_CacheVisibleEntities(); if(r_water_scissormode.integer & 1) GL_Scissor(myscissor[0], myscissor[1], myscissor[2], myscissor[3]); @@ -4999,7 +4985,7 @@ static void R_Water_ProcessPlanes(int fbo, rtexture_t *depthtexture, rtexture_t GL_ScissorTest(false); R_ClearScreen(r_refdef.fogenabled); GL_ScissorTest(true); - R_View_Update(); + R_View_Update(NULL); R_AnimCache_CacheVisibleEntities(); R_RenderScene(rt->fbo, rt->depthtexture, rt->colortexture[0], 0, 0, rt->texturewidth, rt->textureheight); @@ -5011,7 +4997,7 @@ static void R_Water_ProcessPlanes(int fbo, rtexture_t *depthtexture, rtexture_t r_fb.water.renderingscene = false; r_refdef.view = originalview; R_ResetViewRendering3D(fbo, depthtexture, colortexture, viewx, viewy, viewwidth, viewheight); - R_View_Update(); + R_View_Update(NULL); R_AnimCache_CacheVisibleEntities(); goto finish; error: @@ -5782,7 +5768,7 @@ void R_RenderView(int fbo, rtexture_t *depthtexture, rtexture_t *colortexture, i r_refdef.view.showdebug = true; - R_View_Update(); + R_View_Update(NULL); if (r_timereport_active) R_TimeReport("visibility"); -- 2.39.2