25 Oct 2016

This commit is contained in:
g-cont 2016-10-25 00:00:00 +03:00 committed by Alibek Omarov
parent a951cf6f46
commit b193257fbd
8 changed files with 21 additions and 12 deletions

View File

@ -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] );
}
/*

View File

@ -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

View File

@ -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;

View File

@ -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 );

View File

@ -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 );

View File

@ -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 );

View File

@ -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

View File

@ -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;
}