X-Git-Url: http://git.xonotic.org/?a=blobdiff_plain;ds=sidebyside;f=tools%2Fquake3%2Fq3map2%2Flightmaps_ydnar.c;h=fc8dcced9867d56966b946c462e07ef40640d313;hb=7278c27fcd9a243ab1216e06208f0c30446e0a4c;hp=c5633ae372d3f754eafc70c61ab4f0e0e6e8578c;hpb=84a1d9557fe79eafd5f3b3363c8725d55f3377a9;p=xonotic%2Fnetradiant.git diff --git a/tools/quake3/q3map2/lightmaps_ydnar.c b/tools/quake3/q3map2/lightmaps_ydnar.c index c5633ae3..fc8dcced 100644 --- a/tools/quake3/q3map2/lightmaps_ydnar.c +++ b/tools/quake3/q3map2/lightmaps_ydnar.c @@ -35,7 +35,7 @@ /* dependencies */ #include "q3map2.h" - +#include @@ -127,7 +127,7 @@ void ExportLightmaps( void ){ /* sanity check */ if ( bspLightBytes == NULL ) { - Sys_Printf( "WARNING: No BSP lightmap data\n" ); + Sys_FPrintf( SYS_WRN, "WARNING: No BSP lightmap data\n" ); return; } @@ -153,7 +153,7 @@ void ExportLightmaps( void ){ int ExportLightmapsMain( int argc, char **argv ){ /* arg checking */ - if ( argc < 1 ) { + if ( argc < 2 ) { Sys_Printf( "Usage: q3map -export [-v] \n" ); return 0; } @@ -188,7 +188,7 @@ int ImportLightmapsMain( int argc, char **argv ){ /* arg checking */ - if ( argc < 1 ) { + if ( argc < 2 ) { Sys_Printf( "Usage: q3map -import [-v] \n" ); return 0; } @@ -226,7 +226,7 @@ int ImportLightmapsMain( int argc, char **argv ){ buffer = NULL; len = vfsLoadFile( filename, (void*) &buffer, -1 ); if ( len < 0 ) { - Sys_Printf( "WARNING: Unable to load image %s\n", filename ); + Sys_FPrintf( SYS_WRN, "WARNING: Unable to load image %s\n", filename ); continue; } @@ -237,11 +237,11 @@ int ImportLightmapsMain( int argc, char **argv ){ /* sanity check it */ if ( pixels == NULL ) { - Sys_Printf( "WARNING: Unable to load image %s\n", filename ); + Sys_FPrintf( SYS_WRN, "WARNING: Unable to load image %s\n", filename ); continue; } if ( width != game->lightmapSize || height != game->lightmapSize ) { - Sys_Printf( "WARNING: Image %s is not the right size (%d, %d) != (%d, %d)\n", + Sys_FPrintf( SYS_WRN, "WARNING: Image %s is not the right size (%d, %d) != (%d, %d)\n", filename, width, height, game->lightmapSize, game->lightmapSize ); } @@ -752,7 +752,7 @@ qboolean AddSurfaceToRawLightmap( int num, rawLightmap_t *lm ){ /* check for bogus axis */ if ( faxis[ axisNum ] == 0.0f ) { - Sys_Printf( "WARNING: ProjectSurfaceLightmap: Chose a 0 valued axis\n" ); + Sys_FPrintf( SYS_WRN, "WARNING: ProjectSurfaceLightmap: Chose a 0 valued axis\n" ); lm->w = lm->h = 0; return qfalse; } @@ -890,7 +890,6 @@ static int CompareSurfaceInfo( const void *a, const void *b ){ return -1; } - /* then lightmap sample size */ if ( aInfo->sampleSize < bInfo->sampleSize ) { return 1; @@ -971,7 +970,7 @@ void SetupSurfaceLightmaps( void ){ superSample = 1; } else if ( superSample > 8 ) { - Sys_Printf( "WARNING: Insane supersampling amount (%d) detected.\n", superSample ); + Sys_FPrintf( SYS_WRN, "WARNING: Insane supersampling amount (%d) detected.\n", superSample ); superSample = 8; } @@ -2342,6 +2341,8 @@ static int CompareRawLightmap( const void *a, const void *b ){ return 0; } + + void FillOutLightmap( outLightmap_t *olm ){ int x, y; int ofs; @@ -2454,6 +2455,8 @@ void FillOutLightmap( outLightmap_t *olm ){ } } + + /* StoreSurfaceLightmaps() stores the surface lightmaps into the bsp as byte rgb triplets @@ -2477,8 +2480,8 @@ void StoreSurfaceLightmaps( qboolean fastAllocate ){ char dirname[ 1024 ], filename[ 1024 ]; shaderInfo_t *csi; char lightmapName[ 128 ]; - const char *rgbGenValues[ 256 ]; - const char *alphaGenValues[ 256 ]; + const char *rgbGenValues[ 256 ]; + const char *alphaGenValues[ 256 ]; /* note it */ @@ -2501,7 +2504,7 @@ void StoreSurfaceLightmaps( qboolean fastAllocate ){ ----------------------------------------------------------------- */ /* note it */ - Sys_Printf( "Subsampling..." ); + Sys_FPrintf( SYS_VRB, "Subsampling..." ); /* walk the list of raw lightmaps */ numUsed = 0; @@ -2969,7 +2972,7 @@ void StoreSurfaceLightmaps( qboolean fastAllocate ){ if ( noCollapse == qfalse && deluxemap == qfalse ) { /* note it */ - Sys_Printf( "collapsing..." ); + Sys_FPrintf( SYS_VRB, "collapsing..." ); /* set all twin refs to null */ for ( i = 0; i < numRawLightmaps; i++ ) @@ -3038,7 +3041,7 @@ void StoreSurfaceLightmaps( qboolean fastAllocate ){ ----------------------------------------------------------------- */ /* note it */ - Sys_Printf( "sorting..." ); + Sys_FPrintf( SYS_VRB, "sorting..." ); /* allocate a new sorted list */ if ( sortLightmaps == NULL ) { @@ -3055,7 +3058,7 @@ void StoreSurfaceLightmaps( qboolean fastAllocate ){ ----------------------------------------------------------------- */ /* note it */ - Sys_Printf( "allocating..." ); + Sys_FPrintf( SYS_VRB, "allocating..." ); /* kill all existing output lightmaps */ if ( outLightmaps != NULL ) { @@ -3108,7 +3111,7 @@ void StoreSurfaceLightmaps( qboolean fastAllocate ){ ----------------------------------------------------------------- */ /* note it */ - Sys_Printf( "storing..." ); + Sys_FPrintf( SYS_VRB, "storing..." ); /* count the bsp lightmaps and allocate space */ if ( bspLightBytes != NULL ) { @@ -3178,7 +3181,7 @@ void StoreSurfaceLightmaps( qboolean fastAllocate ){ } if ( numExtLightmaps > 0 ) { - Sys_Printf( "\n" ); + Sys_FPrintf( SYS_VRB, "\n" ); } /* delete unused external lightmaps */ @@ -3199,7 +3202,7 @@ void StoreSurfaceLightmaps( qboolean fastAllocate ){ ----------------------------------------------------------------- */ /* note it */ - Sys_Printf( "projecting..." ); + Sys_FPrintf( SYS_VRB, "projecting..." ); /* walk the list of surfaces */ for ( i = 0; i < numBSPDrawSurfaces; i++ ) @@ -3478,7 +3481,7 @@ void StoreSurfaceLightmaps( qboolean fastAllocate ){ } /* finish */ - Sys_Printf( "done.\n" ); + Sys_FPrintf( SYS_VRB, "done.\n" ); /* calc num stored */ numStored = numBSPLightBytes / 3;