float f;
char mapSource[ 1024 ];
const char *value;
+ int lightmapMergeSize = 0;
/* note it */
else if( !strcmp( argv[ i ], "-nolightmapsearch" ) )
{
- noLightmapSearch = qtrue;
+ lightmapSearchBlockSize = 1;
Sys_Printf( "No lightmap searching - all lightmaps will be sequential\n" );
}
+ else if( !strcmp( argv[ i ], "-lightmapsearchpower" ) )
+ {
+ lightmapMergeSize = (game->lightmapSize << atoi(argv[i+1]));
+ ++i;
+ Sys_Printf( "Restricted lightmap searching enabled - optimize for lightmap merge power %d (size %d)\n", atoi(argv[i]), lightmapMergeSize );
+ }
+
+ else if( !strcmp( argv[ i ], "-lightmapsearchblocksize" ) )
+ {
+ lightmapSearchBlockSize = atoi(argv[i+1]);
+ ++i;
+ Sys_Printf( "Restricted lightmap searching enabled - block size set to %d\n", lightmapSearchBlockSize );
+ }
+
else if( !strcmp( argv[ i ], "-shade" ) )
{
shade = qtrue;
}
}
+
+ /* fix up lightmap search power */
+ if(lightmapMergeSize)
+ {
+ lightmapSearchBlockSize = (lightmapMergeSize / lmCustomSize) * (lightmapMergeSize / lmCustomSize);
+ if(lightmapSearchBlockSize < 1)
+ lightmapSearchBlockSize = 1;
+
+ Sys_Printf( "Restricted lightmap searching enabled - block size adjusted to %d\n", lightmapSearchBlockSize );
+ }
/* clean up map name */
strcpy( source, ExpandArg( argv[ i ] ) );
y = 0;
/* walk the list of lightmap pages */
- for( i = ((noLightmapSearch && numOutLightmaps >= LIGHTMAP_RESERVE_COUNT) ? (numOutLightmaps - LIGHTMAP_RESERVE_COUNT) : 0); i < numOutLightmaps; i++ )
+ if(lightmapSearchBlockSize <= 0)
+ i = 0;
+ else
+ i = ((numOutLightmaps - LIGHTMAP_RESERVE_COUNT) / lightmapSearchBlockSize) * lightmapSearchBlockSize;
+ for( ; i < numOutLightmaps; i++ )
{
/* get the output lightmap */
olm = &outLightmaps[ i ];
Q_EXTERN qboolean sunOnly Q_ASSIGN( qfalse );
Q_EXTERN int approximateTolerance Q_ASSIGN( 0 );
Q_EXTERN qboolean noCollapse Q_ASSIGN( qfalse );
-Q_EXTERN qboolean noLightmapSearch Q_ASSIGN( qfalse );
+Q_EXTERN int lightmapSearchBlockSize Q_ASSIGN( 0 );
Q_EXTERN qboolean exportLightmaps Q_ASSIGN( qfalse );
Q_EXTERN qboolean externalLightmaps Q_ASSIGN( qfalse );
Q_EXTERN int lmCustomSize Q_ASSIGN( LIGHTMAP_WIDTH );