Browse Source

ref: gl: restore usage of FWORLD_CUSTOM_SKYBOX flag, do direct checks instead of PARM check, remove unused tr.fCustomSkybox

pull/2/head
Alibek Omarov 6 months ago
parent
commit
0132eb6e44
  1. 5
      ref/gl/gl_local.h
  2. 4
      ref/gl/gl_rsurf.c
  3. 6
      ref/gl/gl_warp.c

5
ref/gl/gl_local.h

@ -34,6 +34,7 @@ GNU General Public License for more details. @@ -34,6 +34,7 @@ GNU General Public License for more details.
#include "common/cvar.h"
#include "gl_export.h"
#include "wadfile.h"
#include "common/mod_local.h"
#if XASH_PSVITA
int VGL_ShimInit( void );
@ -252,10 +253,8 @@ typedef struct @@ -252,10 +253,8 @@ typedef struct
// cull info
vec3_t modelorg; // relative to viewpoint
qboolean fCustomSkybox;
// get from engine
struct world_static_s *world;
world_static_t *world;
cl_entity_t *entities;
movevars_t *movevars;
color24 *palette;

4
ref/gl/gl_rsurf.c

@ -1300,7 +1300,7 @@ void R_DrawTextureChains( void ) @@ -1300,7 +1300,7 @@ void R_DrawTextureChains( void )
RI.currententity = CL_GetEntityByIndex( 0 );
RI.currentmodel = RI.currententity->model;
if( ENGINE_GET_PARM( PARM_SKY_SPHERE ) )
if( FBitSet( tr.world->flags, FWORLD_SKYSPHERE ) && !FBitSet( tr.world->flags, FWORLD_CUSTOM_SKYBOX ))
{
pglDisable( GL_TEXTURE_2D );
pglColor3f( 1.0f, 1.0f, 1.0f );
@ -1310,7 +1310,7 @@ void R_DrawTextureChains( void ) @@ -1310,7 +1310,7 @@ void R_DrawTextureChains( void )
for( s = skychain; s != NULL; s = s->texturechain )
R_AddSkyBoxSurface( s );
if( ENGINE_GET_PARM( PARM_SKY_SPHERE ) )
if( FBitSet( tr.world->flags, FWORLD_SKYSPHERE ) && !FBitSet( tr.world->flags, FWORLD_CUSTOM_SKYBOX ))
{
pglEnable( GL_TEXTURE_2D );
if( skychain )

6
ref/gl/gl_warp.c

@ -332,7 +332,7 @@ void R_AddSkyBoxSurface( msurface_t *fa ) @@ -332,7 +332,7 @@ void R_AddSkyBoxSurface( msurface_t *fa )
float *v;
int i;
if( ENGINE_GET_PARM( PARM_SKY_SPHERE ) && fa->polys && !tr.fCustomSkybox )
if( FBitSet( tr.world->flags, FWORLD_SKYSPHERE ) && fa->polys && !FBitSet( tr.world->flags, FWORLD_CUSTOM_SKYBOX ))
{
glpoly_t *p = fa->polys;
@ -376,7 +376,7 @@ void R_UnloadSkybox( void ) @@ -376,7 +376,7 @@ void R_UnloadSkybox( void )
tr.skyboxbasenum = SKYBOX_BASE_NUM; // set skybox base (to let some mods load hi-res skyboxes)
memset( tr.skyboxTextures, 0, sizeof( tr.skyboxTextures ));
tr.fCustomSkybox = false;
ClearBits( tr.world->flags, FWORLD_CUSTOM_SKYBOX );
}
/*
@ -478,7 +478,7 @@ void R_SetupSky( const char *skyboxname ) @@ -478,7 +478,7 @@ void R_SetupSky( const char *skyboxname )
if( i == 6 )
{
tr.fCustomSkybox = true;
SetBits( tr.world->flags, FWORLD_CUSTOM_SKYBOX );
gEngfuncs.Con_DPrintf( "done\n" );
return; // loaded
}

Loading…
Cancel
Save