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.
#include "common/cvar.h" #include "common/cvar.h"
#include "gl_export.h" #include "gl_export.h"
#include "wadfile.h" #include "wadfile.h"
#include "common/mod_local.h"
#if XASH_PSVITA #if XASH_PSVITA
int VGL_ShimInit( void ); int VGL_ShimInit( void );
@ -252,10 +253,8 @@ typedef struct
// cull info // cull info
vec3_t modelorg; // relative to viewpoint vec3_t modelorg; // relative to viewpoint
qboolean fCustomSkybox;
// get from engine // get from engine
struct world_static_s *world; world_static_t *world;
cl_entity_t *entities; cl_entity_t *entities;
movevars_t *movevars; movevars_t *movevars;
color24 *palette; color24 *palette;

4
ref/gl/gl_rsurf.c

@ -1300,7 +1300,7 @@ void R_DrawTextureChains( void )
RI.currententity = CL_GetEntityByIndex( 0 ); RI.currententity = CL_GetEntityByIndex( 0 );
RI.currentmodel = RI.currententity->model; 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 ); pglDisable( GL_TEXTURE_2D );
pglColor3f( 1.0f, 1.0f, 1.0f ); pglColor3f( 1.0f, 1.0f, 1.0f );
@ -1310,7 +1310,7 @@ void R_DrawTextureChains( void )
for( s = skychain; s != NULL; s = s->texturechain ) for( s = skychain; s != NULL; s = s->texturechain )
R_AddSkyBoxSurface( s ); 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 ); pglEnable( GL_TEXTURE_2D );
if( skychain ) if( skychain )

6
ref/gl/gl_warp.c

@ -332,7 +332,7 @@ void R_AddSkyBoxSurface( msurface_t *fa )
float *v; float *v;
int i; 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; glpoly_t *p = fa->polys;
@ -376,7 +376,7 @@ void R_UnloadSkybox( void )
tr.skyboxbasenum = SKYBOX_BASE_NUM; // set skybox base (to let some mods load hi-res skyboxes) tr.skyboxbasenum = SKYBOX_BASE_NUM; // set skybox base (to let some mods load hi-res skyboxes)
memset( tr.skyboxTextures, 0, sizeof( tr.skyboxTextures )); 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 )
if( i == 6 ) if( i == 6 )
{ {
tr.fCustomSkybox = true; SetBits( tr.world->flags, FWORLD_CUSTOM_SKYBOX );
gEngfuncs.Con_DPrintf( "done\n" ); gEngfuncs.Con_DPrintf( "done\n" );
return; // loaded return; // loaded
} }

Loading…
Cancel
Save