X-Git-Url: https://de.git.xonotic.org/?a=blobdiff_plain;f=tools%2Fquake3%2Fq3map2%2Flightmaps_ydnar.c;h=ea36b921f8bd6a41b75be713a64286de5ae7019c;hb=d930835fa0ffd32d2e6459e11e526ec0733745bc;hp=002db1da9c5e5f6b16f21870861d2c572bd37661;hpb=e744bb6dadcd57fff460b7e6409ecd61bfe272c7;p=xonotic%2Fnetradiant.git diff --git a/tools/quake3/q3map2/lightmaps_ydnar.c b/tools/quake3/q3map2/lightmaps_ydnar.c index 002db1da..ea36b921 100644 --- a/tools/quake3/q3map2/lightmaps_ydnar.c +++ b/tools/quake3/q3map2/lightmaps_ydnar.c @@ -693,16 +693,33 @@ qboolean AddSurfaceToRawLightmap( int num, rawLightmap_t *lm ){ } } - if ( sampleSize != lm->sampleSize && lmLimitSize == 0 ) { - Sys_FPrintf( SYS_VRB,"WARNING: surface at (%6.0f %6.0f %6.0f) (%6.0f %6.0f %6.0f) too large for desired samplesize/lightmapsize/lightmapscale combination, increased samplesize from %d to %d\n", - info->mins[0], - info->mins[1], - info->mins[2], - info->maxs[0], - info->maxs[1], - info->maxs[2], - lm->sampleSize, - (int) sampleSize ); + if ( sampleSize != lm->sampleSize && lmLimitSize == 0 ){ + if ( debugSampleSize == 1 || lm->customWidth > 128 ){ + Sys_FPrintf( SYS_VRB,"WARNING: surface at (%6.0f %6.0f %6.0f) (%6.0f %6.0f %6.0f) too large for desired samplesize/lightmapsize/lightmapscale combination, increased samplesize from %d to %d\n", + info->mins[0], + info->mins[1], + info->mins[2], + info->maxs[0], + info->maxs[1], + info->maxs[2], + lm->sampleSize, + (int) sampleSize ); + } + else if ( debugSampleSize == 0 ){ + Sys_FPrintf( SYS_VRB,"WARNING: surface at (%6.0f %6.0f %6.0f) (%6.0f %6.0f %6.0f) too large for desired samplesize/lightmapsize/lightmapscale combination, increased samplesize from %d to %d\n", + info->mins[0], + info->mins[1], + info->mins[2], + info->maxs[0], + info->maxs[1], + info->maxs[2], + lm->sampleSize, + (int) sampleSize ); + debugSampleSize--; + } + else{ + debugSampleSize--; + } } /* set actual sample size */ @@ -1201,6 +1218,10 @@ void SetupSurfaceLightmaps( void ){ FinishRawLightmap( lm ); } + if ( debugSampleSize < -1 ){ + Sys_FPrintf( SYS_VRB, "+%d similar occurrences;\t-debugSampleSize to show ones\n", -debugSampleSize - 1 ); + } + /* allocate vertex luxel storage */ for ( k = 0; k < MAX_LIGHTMAPS; k++ ) { @@ -2162,6 +2183,10 @@ static void FindOutLightmaps( rawLightmap_t *lm, qboolean fastAllocate ){ /* allocate LIGHTMAP_RESERVE_COUNT new output lightmaps */ numOutLightmaps += LIGHTMAP_RESERVE_COUNT; olm = safe_malloc( numOutLightmaps * sizeof( outLightmap_t ) ); + if ( !olm ){ + Error( "FindOutLightmaps: Failed to allocate memory.\n" ); + } + if ( outLightmaps != NULL && numOutLightmaps > LIGHTMAP_RESERVE_COUNT ) { memcpy( olm, outLightmaps, ( numOutLightmaps - LIGHTMAP_RESERVE_COUNT ) * sizeof( outLightmap_t ) ); free( outLightmaps );