/* return to sender */
return 1;
}
- else{
+ else {
Error( "Light of undefined type!" );
}
does what it says...
*/
-void LightWorld( const char *BSPFilePath, qboolean fastAllocate ){
+void LightWorld( const char *BSPFilePath, qboolean fastLightmapSearch ){
vec3_t color;
float f;
int b, bt;
if ( VectorLength( color ) == 0.0f ) {
VectorSet( color, 1.0, 1.0, 1.0 );
}
+
if ( colorsRGB ) {
color[0] = Image_LinearFloatFromsRGBFloat( color[0] );
color[1] = Image_LinearFloatFromsRGBFloat( color[1] );
while ( bounce > 0 )
{
/* store off the bsp between bounces */
- StoreSurfaceLightmaps( fastAllocate );
+ StoreSurfaceLightmaps( fastLightmapSearch );
UnparseEntities();
Sys_Printf( "Writing %s\n", BSPFilePath );
WriteBSPFile( BSPFilePath );
SetupEnvelopes( qfalse, fastbounce );
if ( numLights == 0 ) {
Sys_Printf( "No diffuse light to calculate, ending radiosity.\n" );
- break;
+ return;
}
/* add to lightgrid */
bounce--;
b++;
}
+ /* ydnar: store off lightmaps */
+ StoreSurfaceLightmaps( fastLightmapSearch );
+}
+
+
+
+/*
+ LoadSurfaceFlags()
+ added by spoon to get back the changed surfaceflags
+ from tex file
+*/
+
+void LoadSurfaceFlags( char *filename ) {
+ int i;
+
+ for( i = 0; i < numBSPShaders; i++ ) {
+ shaderInfo_t *si;
+
+ si = ShaderInfoForShader( bspShaders[i].shader );
+
+ bspShaders[ i ].surfaceFlags = si->surfaceFlags;
+ }
}
const char *value;
int lightmapMergeSize = 0;
qboolean lightSamplesInsist = qfalse;
- qboolean fastAllocate = qfalse;
-
+ qboolean fastLightmapSearch = qfalse;
/* note it */
Sys_Printf( "--- Light ---\n" );
}
i++;
}
+
else if ( !strcmp( argv[ i ], "-deluxe" ) || !strcmp( argv[ i ], "-deluxemap" ) ) {
deluxemap = qtrue;
Sys_Printf( "Generating deluxemaps for average light direction\n" );
Sys_Printf( "Faster mode enabled\n" );
}
- else if ( !strcmp( argv[ i ], "-fastallocate" ) ) {
- fastAllocate = qtrue;
- Sys_Printf( "Fast allocation mode enabled\n" );
+ else if ( !strcmp( argv[ i ], "-fastlightmapsearch" ) || !strcmp( argv[ i ], "-fastallocate") ) {
+ fastLightmapSearch = qtrue;
+
+ if ( !strcmp( argv[ i ], "-fastallocate" ) ) {
+ Sys_Printf( "The -fastallocate argument is deprecated, use \"-fastlightmapsearch\" instead\n" );
+ }
+ else {
+ Sys_Printf( "Fast lightmap search enabled\n" );
+ }
}
else if ( !strcmp( argv[ i ], "-fastgrid" ) ) {
loMem = qtrue;
Sys_Printf( "Enabling low-memory (potentially slower) lighting mode\n" );
}
+ else if ( !strcmp( argv[ i ], "-lightsubdiv" ) ) {
+ defaultLightSubdivide = atoi( argv[ i + 1 ] );
+ if ( defaultLightSubdivide < 1 ) {
+ defaultLightSubdivide = 1;
+ }
+ i++;
+ Sys_Printf( "Default light subdivision set to %d\n", defaultLightSubdivide );
+ }
else if ( !strcmp( argv[ i ], "-lightanglehl" ) ) {
if ( ( atoi( argv[ i + 1 ] ) != 0 ) != lightAngleHL ) {
lightAngleHL = ( atoi( argv[ i + 1 ] ) != 0 );
Sys_Printf( "Disabling half lambert light angle attenuation\n" );
}
}
+ i++;
}
else if ( !strcmp( argv[ i ], "-nostyle" ) || !strcmp( argv[ i ], "-nostyles" ) ) {
noStyles = qtrue;
/* unhandled args */
else
{
- Sys_Printf( "WARNING: Unknown argument \"%s\"\n", argv[ i ] );
+ Sys_FPrintf( SYS_WRN, "WARNING: Unknown argument \"%s\"\n", argv[ i ] );
}
}
SetupTraceNodes();
/* light the world */
- LightWorld( BSPFilePath, fastAllocate );
-
- /* ydnar: store off lightmaps */
- StoreSurfaceLightmaps( fastAllocate );
+ LightWorld( BSPFilePath, fastLightmapSearch );
/* write out the bsp */
UnparseEntities();