qboolean AddSurfaceToRawLightmap( int num, rawLightmap_t *lm )
{
bspDrawSurface_t *ds, *ds2;
- surfaceInfo_t *info, *info2;
+ surfaceInfo_t *info;
int num2, n, i, axisNum;
float s, t, d, len, sampleSize;
- vec3_t mins, maxs, origin, faxis, size, exactSize, delta, normalized, vecs[ 2 ];
+ vec3_t mins, maxs, origin, faxis, size, delta, normalized, vecs[ 2 ];
vec4_t plane;
bspDrawVert_t *verts;
/* round to the lightmap resolution */
for( i = 0; i < 3; i++ )
{
- exactSize[ i ] = lm->maxs[ i ] - lm->mins[ i ];
mins[ i ] = sampleSize * floor( lm->mins[ i ] / sampleSize );
maxs[ i ] = sampleSize * ceil( lm->maxs[ i ] / sampleSize );
size[ i ] = (maxs[ i ] - mins[ i ]) / sampleSize + 1.0f;
/* get surface */
num2 = lightSurfaces[ lm->firstLightSurface + n ];
ds2 = &bspDrawSurfaces[ num2 ];
- info2 = &surfaceInfos[ num2 ];
verts = &yDrawVerts[ ds2->firstVert ];
/* set the lightmap texture coordinates in yDrawVerts in [0, superSample * lm->customWidth] space */
/* get first drawsurface */
num2 = lightSurfaces[ lm->firstLightSurface ];
ds2 = &bspDrawSurfaces[ num2 ];
- info2 = &surfaceInfos[ num2 ];
verts = &yDrawVerts[ ds2->firstVert ];
/* calculate lightmap origin */
int i, j, k, s,num, num2;
bspModel_t *model;
bspLeaf_t *leaf;
- bspDrawSurface_t *ds, *ds2;
+ bspDrawSurface_t *ds;
surfaceInfo_t *info, *info2;
rawLightmap_t *lm;
qboolean added;
{
/* get info and attempt early out */
num2 = sortSurfaces[ j ];
- ds2 = &bspDrawSurfaces[ num2 ];
info2 = &surfaceInfos[ num2 ];
if( info2->hasLightmap == qfalse || info2->lm != NULL )
continue;
numStitched, numCandidates, numLuxels, f, fOld, start;
rawLightmap_t *lm, *a, *b, *c[ MAX_STITCH_CANDIDATES ];
float *luxel, *luxel2, *origin, *origin2, *normal, *normal2,
- sampleSize, average[ 3 ], totalColor, ootc, *luxels[ MAX_STITCH_LUXELS ];
+ sampleSize, average[ 3 ], totalColor, ootc;
/* disabled for now */
/* add luxel */
//% VectorSet( luxel2, 255, 0, 255 );
- luxels[ numLuxels++ ] = luxel2;
VectorAdd( average, luxel2, average );
totalColor += luxel2[ 3 ];
}
#define LIGHTMAP_RESERVE_COUNT 1
static void FindOutLightmaps( rawLightmap_t *lm )
{
- int i, j, k, lightmapNum, xMax, yMax, x, y, sx, sy, ox, oy, offset;
+ int i, j, k, lightmapNum, xMax, yMax, x = -1, y = -1, sx, sy, ox, oy, offset;
outLightmap_t *olm;
surfaceInfo_t *info;
float *luxel, *deluxel;