fix compile warning

This commit is contained in:
Timothee Besset 2017-08-20 15:46:40 -05:00
parent 156fc19c13
commit 3a6c9d30ed
2 changed files with 9 additions and 20 deletions

View File

@ -2089,7 +2089,7 @@ void XYWnd::ProduceSplitLists(){
memset( &face,0,sizeof( face_t ) ); memset( &face,0,sizeof( face_t ) );
PlanePointsFromClipPoints( face.planepts, pBrush ); PlanePointsFromClipPoints( face.planepts, pBrush );
// decide wether caulking should be applied on the splits // decide whether caulking should be applied on the splits
// FIXME: hack // FIXME: hack
// this should take the first brush face, check shader for NODRAW, if it isn't nodraw then find the appropriate // this should take the first brush face, check shader for NODRAW, if it isn't nodraw then find the appropriate
// common/ shader to use, out of solid+nodraw, nonsolid+nodraw, water+nodraw, lava+nodraw, nonsolid+nodraw+trans, water+nodraw+trans, lava+nodraw+trans.. and fog.. etc // common/ shader to use, out of solid+nodraw, nonsolid+nodraw, water+nodraw, lava+nodraw, nonsolid+nodraw+trans, water+nodraw+trans, lava+nodraw+trans.. and fog.. etc

View File

@ -1591,61 +1591,54 @@ void DirtyRawLightmap( int rawLightmapNum ){
static qboolean SubmapRawLuxel( rawLightmap_t *lm, int x, int y, float bx, float by, int *sampleCluster, vec3_t sampleOrigin, vec3_t sampleNormal ){ static qboolean SubmapRawLuxel( rawLightmap_t *lm, int x, int y, float bx, float by, int *sampleCluster, vec3_t sampleOrigin, vec3_t sampleNormal ){
int i, *cluster, *cluster2; int i, *cluster, *cluster2;
float *origin, *origin2, *normal; //% , *normal2; float *origin, *origin2, *normal;
vec3_t originVecs[ 2 ]; //% , normalVecs[ 2 ]; vec3_t originVecs[ 2 ];
/* calulate x vector */ /* calulate x vector */
if ( ( x < ( lm->sw - 1 ) && bx >= 0.0f ) || ( x == 0 && bx <= 0.0f ) ) { if ( ( x < ( lm->sw - 1 ) && bx >= 0.0f ) || ( x == 0 && bx <= 0.0f ) ) {
cluster = SUPER_CLUSTER( x, y ); cluster = SUPER_CLUSTER( x, y );
origin = SUPER_ORIGIN( x, y ); origin = SUPER_ORIGIN( x, y );
//% normal = SUPER_NORMAL( x, y );
cluster2 = SUPER_CLUSTER( x + 1, y ); cluster2 = SUPER_CLUSTER( x + 1, y );
origin2 = *cluster2 < 0 ? SUPER_ORIGIN( x, y ) : SUPER_ORIGIN( x + 1, y ); origin2 = *cluster2 < 0 ? SUPER_ORIGIN( x, y ) : SUPER_ORIGIN( x + 1, y );
//% normal2 = *cluster2 < 0 ? SUPER_NORMAL( x, y ) : SUPER_NORMAL( x + 1, y );
} }
else if ( ( x > 0 && bx <= 0.0f ) || ( x == ( lm->sw - 1 ) && bx >= 0.0f ) ) { else if ( ( x > 0 && bx <= 0.0f ) || ( x == ( lm->sw - 1 ) && bx >= 0.0f ) ) {
cluster = SUPER_CLUSTER( x - 1, y ); cluster = SUPER_CLUSTER( x - 1, y );
origin = *cluster < 0 ? SUPER_ORIGIN( x, y ) : SUPER_ORIGIN( x - 1, y ); origin = *cluster < 0 ? SUPER_ORIGIN( x, y ) : SUPER_ORIGIN( x - 1, y );
//% normal = *cluster < 0 ? SUPER_NORMAL( x, y ) : SUPER_NORMAL( x - 1, y );
cluster2 = SUPER_CLUSTER( x, y ); cluster2 = SUPER_CLUSTER( x, y );
origin2 = SUPER_ORIGIN( x, y ); origin2 = SUPER_ORIGIN( x, y );
//% normal2 = SUPER_NORMAL( x, y );
} }
else{ else{
Sys_FPrintf( SYS_WRN, "WARNING: Spurious lightmap S vector\n" ); Sys_FPrintf( SYS_WRN, "WARNING: Spurious lightmap S vector\n" );
VectorClear( originVecs[0] );
origin = originVecs[0];
origin2 = originVecs[0];
} }
VectorSubtract( origin2, origin, originVecs[ 0 ] ); VectorSubtract( origin2, origin, originVecs[ 0 ] );
//% VectorSubtract( normal2, normal, normalVecs[ 0 ] );
/* calulate y vector */ /* calulate y vector */
if ( ( y < ( lm->sh - 1 ) && bx >= 0.0f ) || ( y == 0 && bx <= 0.0f ) ) { if ( ( y < ( lm->sh - 1 ) && bx >= 0.0f ) || ( y == 0 && bx <= 0.0f ) ) {
cluster = SUPER_CLUSTER( x, y ); cluster = SUPER_CLUSTER( x, y );
origin = SUPER_ORIGIN( x, y ); origin = SUPER_ORIGIN( x, y );
//% normal = SUPER_NORMAL( x, y );
cluster2 = SUPER_CLUSTER( x, y + 1 ); cluster2 = SUPER_CLUSTER( x, y + 1 );
origin2 = *cluster2 < 0 ? SUPER_ORIGIN( x, y ) : SUPER_ORIGIN( x, y + 1 ); origin2 = *cluster2 < 0 ? SUPER_ORIGIN( x, y ) : SUPER_ORIGIN( x, y + 1 );
//% normal2 = *cluster2 < 0 ? SUPER_NORMAL( x, y ) : SUPER_NORMAL( x, y + 1 );
} }
else if ( ( y > 0 && bx <= 0.0f ) || ( y == ( lm->sh - 1 ) && bx >= 0.0f ) ) { else if ( ( y > 0 && bx <= 0.0f ) || ( y == ( lm->sh - 1 ) && bx >= 0.0f ) ) {
cluster = SUPER_CLUSTER( x, y - 1 ); cluster = SUPER_CLUSTER( x, y - 1 );
origin = *cluster < 0 ? SUPER_ORIGIN( x, y ) : SUPER_ORIGIN( x, y - 1 ); origin = *cluster < 0 ? SUPER_ORIGIN( x, y ) : SUPER_ORIGIN( x, y - 1 );
//% normal = *cluster < 0 ? SUPER_NORMAL( x, y ) : SUPER_NORMAL( x, y - 1 );
cluster2 = SUPER_CLUSTER( x, y ); cluster2 = SUPER_CLUSTER( x, y );
origin2 = SUPER_ORIGIN( x, y ); origin2 = SUPER_ORIGIN( x, y );
//% normal2 = SUPER_NORMAL( x, y );
} }
else{ else{
Sys_FPrintf( SYS_WRN, "WARNING: Spurious lightmap T vector\n" ); Sys_FPrintf( SYS_WRN, "WARNING: Spurious lightmap T vector\n" );
VectorClear( originVecs[1] );
origin = originVecs[1];
origin2 = originVecs[1];
} }
VectorSubtract( origin2, origin, originVecs[ 1 ] ); VectorSubtract( origin2, origin, originVecs[ 1 ] );
//% VectorSubtract( normal2, normal, normalVecs[ 1 ] );
/* calculate new origin */ /* calculate new origin */
//% VectorMA( origin, bx, originVecs[ 0 ], sampleOrigin );
//% VectorMA( sampleOrigin, by, originVecs[ 1 ], sampleOrigin );
for ( i = 0; i < 3; i++ ) for ( i = 0; i < 3; i++ )
sampleOrigin[ i ] = sampleOrigin[ i ] + ( bx * originVecs[ 0 ][ i ] ) + ( by * originVecs[ 1 ][ i ] ); sampleOrigin[ i ] = sampleOrigin[ i ] + ( bx * originVecs[ 0 ][ i ] ) + ( by * originVecs[ 1 ][ i ] );
@ -1656,10 +1649,6 @@ static qboolean SubmapRawLuxel( rawLightmap_t *lm, int x, int y, float bx, float
} }
/* calculate new normal */ /* calculate new normal */
//% VectorMA( normal, bx, normalVecs[ 0 ], sampleNormal );
//% VectorMA( sampleNormal, by, normalVecs[ 1 ], sampleNormal );
//% if( VectorNormalize( sampleNormal, sampleNormal ) <= 0.0f )
//% return qfalse;
normal = SUPER_NORMAL( x, y ); normal = SUPER_NORMAL( x, y );
VectorCopy( normal, sampleNormal ); VectorCopy( normal, sampleNormal );