diff --git a/radiant/xywindow.cpp b/radiant/xywindow.cpp index dda0ec88..05cb99ff 100644 --- a/radiant/xywindow.cpp +++ b/radiant/xywindow.cpp @@ -2089,7 +2089,7 @@ void XYWnd::ProduceSplitLists(){ memset( &face,0,sizeof( face_t ) ); PlanePointsFromClipPoints( face.planepts, pBrush ); - // decide wether caulking should be applied on the splits + // decide whether caulking should be applied on the splits // FIXME: hack // 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 diff --git a/tools/quake3/q3map2/light_ydnar.c b/tools/quake3/q3map2/light_ydnar.c index e951771c..ec2524f1 100644 --- a/tools/quake3/q3map2/light_ydnar.c +++ b/tools/quake3/q3map2/light_ydnar.c @@ -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 ){ int i, *cluster, *cluster2; - float *origin, *origin2, *normal; //% , *normal2; - vec3_t originVecs[ 2 ]; //% , normalVecs[ 2 ]; - + float *origin, *origin2, *normal; + vec3_t originVecs[ 2 ]; /* calulate x vector */ if ( ( x < ( lm->sw - 1 ) && bx >= 0.0f ) || ( x == 0 && bx <= 0.0f ) ) { cluster = SUPER_CLUSTER( x, y ); origin = SUPER_ORIGIN( x, y ); - //% normal = SUPER_NORMAL( x, y ); cluster2 = SUPER_CLUSTER( 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 ) ) { cluster = SUPER_CLUSTER( 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 ); origin2 = SUPER_ORIGIN( x, y ); - //% normal2 = SUPER_NORMAL( x, y ); } else{ 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( normal2, normal, normalVecs[ 0 ] ); /* calulate y vector */ if ( ( y < ( lm->sh - 1 ) && bx >= 0.0f ) || ( y == 0 && bx <= 0.0f ) ) { cluster = SUPER_CLUSTER( x, y ); origin = SUPER_ORIGIN( x, y ); - //% normal = SUPER_NORMAL( x, y ); cluster2 = SUPER_CLUSTER( 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 ) ) { cluster = SUPER_CLUSTER( 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 ); origin2 = SUPER_ORIGIN( x, y ); - //% normal2 = SUPER_NORMAL( x, y ); } else{ 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( normal2, normal, normalVecs[ 1 ] ); /* calculate new origin */ - //% VectorMA( origin, bx, originVecs[ 0 ], sampleOrigin ); - //% VectorMA( sampleOrigin, by, originVecs[ 1 ], sampleOrigin ); for ( i = 0; i < 3; 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 */ - //% 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 ); VectorCopy( normal, sampleNormal );