From fdd3a44fa05cbc2a79ec6c02f56e70f8eda5d913 Mon Sep 17 00:00:00 2001 From: Alibek Omarov Date: Mon, 13 Apr 2026 13:40:18 +0500 Subject: [PATCH] ref: gl: remove unused isSkyVisible --- ref/gl/gl_local.h | 1 - ref/gl/gl_rmain.c | 3 --- ref/gl/gl_warp.c | 12 ++---------- 3 files changed, 2 insertions(+), 14 deletions(-) diff --git a/ref/gl/gl_local.h b/ref/gl/gl_local.h index de5d59f0..4c638a72 100644 --- a/ref/gl/gl_local.h +++ b/ref/gl/gl_local.h @@ -129,7 +129,6 @@ typedef struct int params; // rendering parameters qboolean drawWorld; // ignore world for drawing PlayerModel - qboolean isSkyVisible; // sky is visible qboolean onlyClientDraw; // disabled by client request qboolean drawOrtho; // draw world as orthogonal projection diff --git a/ref/gl/gl_rmain.c b/ref/gl/gl_rmain.c index 9a19de6f..2c290717 100644 --- a/ref/gl/gl_rmain.c +++ b/ref/gl/gl_rmain.c @@ -535,10 +535,7 @@ static void R_SetupFrame( void ) // current viewleaf if( RI.drawWorld ) - { - RI.isSkyVisible = false; // unknown at this moment R_FindViewLeaf(); - } } /* diff --git a/ref/gl/gl_warp.c b/ref/gl/gl_warp.c index b4eaad25..cfa78356 100644 --- a/ref/gl/gl_warp.c +++ b/ref/gl/gl_warp.c @@ -339,10 +339,6 @@ R_DrawSkybox */ void R_DrawSkyBox( void ) { - int i; - - RI.isSkyVisible = true; - // don't fogging skybox (this fix old Half-Life bug) if( !RI.fogSkybox ) R_AllowFog( false ); @@ -353,7 +349,7 @@ void R_DrawSkyBox( void ) pglDisable( GL_ALPHA_TEST ); pglTexEnvi( GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_REPLACE ); - for( i = 0; i < SKYBOX_MAX_SIDES; i++ ) + for( int i = 0; i < SKYBOX_MAX_SIDES; i++ ) { if( RI.skyMins[0][i] >= RI.skyMaxs[0][i] || RI.skyMins[1][i] >= RI.skyMaxs[1][i] ) continue; @@ -533,16 +529,12 @@ Quake-style clouds */ void R_DrawClouds( void ) { - int i; - - RI.isSkyVisible = true; - if( RI.fogEnabled ) pglFogf( GL_FOG_DENSITY, RI.fogDensity * 0.25f ); pglDepthFunc( GL_GEQUAL ); pglDepthMask( GL_FALSE ); - for( i = 0; i < SKYBOX_MAX_SIDES; i++ ) + for( int i = 0; i < SKYBOX_MAX_SIDES; i++ ) { if( RI.skyMins[0][i] >= RI.skyMaxs[0][i] || RI.skyMins[1][i] >= RI.skyMaxs[1][i] ) continue;