diff --git a/ref/gl/gl_local.h b/ref/gl/gl_local.h index 315312a2..8570bdbf 100644 --- a/ref/gl/gl_local.h +++ b/ref/gl/gl_local.h @@ -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 // 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; diff --git a/ref/gl/gl_rsurf.c b/ref/gl/gl_rsurf.c index 93cb5a35..e237c659 100644 --- a/ref/gl/gl_rsurf.c +++ b/ref/gl/gl_rsurf.c @@ -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 ) 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 ) diff --git a/ref/gl/gl_warp.c b/ref/gl/gl_warp.c index 62517cf1..30bdf06c 100644 --- a/ref/gl/gl_warp.c +++ b/ref/gl/gl_warp.c @@ -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 ) 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 ) if( i == 6 ) { - tr.fCustomSkybox = true; + SetBits( tr.world->flags, FWORLD_CUSTOM_SKYBOX ); gEngfuncs.Con_DPrintf( "done\n" ); return; // loaded }