diff --git a/engine/client/cl_game.c b/engine/client/cl_game.c index 641e79b3..7ff21b4c 100644 --- a/engine/client/cl_game.c +++ b/engine/client/cl_game.c @@ -2294,7 +2294,6 @@ pfnSetTraceHull */ void CL_SetTraceHull( int hull ) { - clgame.old_trace_hull = clgame.pmove->usehull; clgame.pmove->usehull = bound( 0, hull, 3 ); } @@ -2309,7 +2308,6 @@ void CL_PlayerTrace( float *start, float *end, int traceFlags, int ignore_pe, pm { if( !tr ) return; *tr = PM_PlayerTraceExt( clgame.pmove, start, end, traceFlags, clgame.pmove->numphysent, clgame.pmove->physents, ignore_pe, NULL ); - clgame.pmove->usehull = clgame.old_trace_hull; // restore old trace hull } /* @@ -2322,7 +2320,6 @@ void CL_PlayerTraceExt( float *start, float *end, int traceFlags, int (*pfnIgnor { if( !tr ) return; *tr = PM_PlayerTraceExt( clgame.pmove, start, end, traceFlags, clgame.pmove->numphysent, clgame.pmove->physents, -1, pfnIgnore ); - clgame.pmove->usehull = clgame.old_trace_hull; // restore old trace hull } /* @@ -3081,7 +3078,7 @@ void TriBrightness( float brightness ) rgba[1] = clgame.ds.triColor[1] * brightness; rgba[2] = clgame.ds.triColor[2] * brightness; - pglColor3ub( rgba[0], rgba[1], rgba[2] ); + pglColor4ub( rgba[0], rgba[1], rgba[2], clgame.ds.triColor[3] ); } /* diff --git a/engine/client/client.h b/engine/client/client.h index 072f1821..6dd6a9b2 100644 --- a/engine/client/client.h +++ b/engine/client/client.h @@ -369,7 +369,6 @@ typedef struct movevars_t oldmovevars; playermove_t *pmove; // pmove state - int old_trace_hull; // used by PM_Push\Pop state qboolean pushed; // used by PM_Push\Pop state int oldviscount; // used by PM_Push\Pop state int oldphyscount; // used by PM_Push\Pop state diff --git a/engine/client/gl_rmain.c b/engine/client/gl_rmain.c index b8bd4c21..5767226e 100644 --- a/engine/client/gl_rmain.c +++ b/engine/client/gl_rmain.c @@ -1424,7 +1424,7 @@ static int GL_RenderGetParm( int parm, int arg ) ASSERT( arg >= 0 && arg < MAX_LIGHTMAPS ); return tr.lightmapTextures[arg]; case PARM_SKY_SPHERE: - return world.sky_sphere; + return world.sky_sphere && !world.custom_skybox; case PARM_WORLD_VERSION: if( cls.state != ca_active ) return bmodel_version; diff --git a/engine/client/gl_rsurf.c b/engine/client/gl_rsurf.c index a9c8531a..736f0b8e 100644 --- a/engine/client/gl_rsurf.c +++ b/engine/client/gl_rsurf.c @@ -1243,7 +1243,7 @@ void R_DrawTextureChains( void ) RI.currententity = clgame.entities; RI.currentmodel = RI.currententity->model; - if( world.sky_sphere ) + if( world.sky_sphere && !world.custom_skybox ) { pglDisable( GL_TEXTURE_2D ); pglColor3f( 1.0f, 1.0f, 1.0f ); @@ -1253,7 +1253,7 @@ void R_DrawTextureChains( void ) for( s = skychain; s != NULL; s = s->texturechain ) R_AddSkyBoxSurface( s ); - if( world.sky_sphere ) + if( world.sky_sphere && !world.custom_skybox ) { pglEnable( GL_TEXTURE_2D ); diff --git a/engine/client/gl_studio.c b/engine/client/gl_studio.c index 9f66fae3..818380f1 100644 --- a/engine/client/gl_studio.c +++ b/engine/client/gl_studio.c @@ -2574,6 +2574,7 @@ static void R_StudioSetupRenderer( int rendermode ) pglDepthMask( GL_TRUE ); pglAlphaFunc( GL_GREATER, 0.0f ); + pglShadeModel( GL_SMOOTH ); if( g_iBackFaceCull ) GL_FrontFace( true ); diff --git a/engine/client/gl_warp.c b/engine/client/gl_warp.c index 5212eb9d..df9395b5 100644 --- a/engine/client/gl_warp.c +++ b/engine/client/gl_warp.c @@ -20,7 +20,7 @@ GNU General Public License for more details. #include "wadfile.h" #define SKYCLOUDS_QUALITY 12 -#define MAX_CLIP_VERTS 64 // skybox clip vertices +#define MAX_CLIP_VERTS 128 // skybox clip vertices #define TURBSCALE ( 256.0f / ( M_PI2 )) static const char* r_skyBoxSuffix[6] = { "rt", "bk", "lf", "ft", "up", "dn" }; static const int r_skyTexOrder[6] = { 0, 2, 1, 3, 4, 5 }; @@ -320,7 +320,7 @@ void R_AddSkyBoxSurface( msurface_t *fa ) } } - if( world.sky_sphere && fa->polys ) + if( world.sky_sphere && fa->polys && !world.custom_skybox ) { glpoly_t *p = fa->polys; @@ -364,6 +364,7 @@ void R_UnloadSkybox( void ) tr.skyboxbasenum = 5800; // set skybox base (to let some mods load hi-res skyboxes) Q_memset( tr.skyboxTextures, 0, sizeof( tr.skyboxTextures )); + world.custom_skybox = false; } /* @@ -465,7 +466,11 @@ void R_SetupSky( const char *skyboxname ) if( !tr.skyboxTextures[i] ) break; } - if( i == 6 ) return; // loaded + if( i == 6 ) + { + world.custom_skybox = true; + return; // loaded + } // clear previous and try again R_UnloadSkybox(); @@ -476,7 +481,12 @@ void R_SetupSky( const char *skyboxname ) tr.skyboxTextures[i] = GL_LoadTexture( sidename, NULL, 0, TF_CLAMP|TF_SKY, NULL ); if( !tr.skyboxTextures[i] ) break; } - if( i == 6 ) return; // loaded + + if( i == 6 ) + { + world.custom_skybox = true; + return; // loaded + } // completely couldn't load skybox (probably never happens) MsgDev( D_ERROR, "R_SetupSky: couldn't load skybox '%s'\n", skyboxname ); diff --git a/engine/common/mod_local.h b/engine/common/mod_local.h index 16adb12e..518052ff 100644 --- a/engine/common/mod_local.h +++ b/engine/common/mod_local.h @@ -80,6 +80,7 @@ typedef struct qboolean loading; // true if worldmodel is loading qboolean sky_sphere; // true when quake sky-sphere is used qboolean has_mirrors; // one or more brush models contain reflective textures + qboolean custom_skybox; // if sky_sphere is active and custom skybox set int lm_sample_size; // defaulting to 16 (BSP31 uses 8) int block_size; // lightmap blocksize color24 *deluxedata; // deluxemap data pointer diff --git a/engine/common/model.c b/engine/common/model.c index 82329113..32cbfd46 100644 --- a/engine/common/model.c +++ b/engine/common/model.c @@ -671,6 +671,7 @@ static void Mod_LoadTextures( const dlump_t *l ) GL_FreeTexture( tr.alphaskyTexture ); tr.solidskyTexture = tr.alphaskyTexture = 0; world.texdatasize = l->filelen; + world.custom_skybox = false; world.has_mirrors = false; world.sky_sphere = false; }