- /* process arguments */
- for( i = 1; i < (argc - 1); i++ )
- {
- if( !strcmp( argv[ i ], "-size" ) )
- {
- minimap.width = minimap.height = atoi(argv[i + 1]);
- i++;
- Sys_Printf( "Image size set to %i\n", minimap.width );
- }
- else if( !strcmp( argv[ i ], "-sharpen" ) )
- {
- minimapSharpen = atof(argv[i + 1]);
- i++;
- Sys_Printf( "Sharpening coefficient set to %f\n", minimapSharpen );
- }
- else if( !strcmp( argv[ i ], "-samples" ) )
- {
- minimap.samples = atoi(argv[i + 1]);
- i++;
- Sys_Printf( "Samples set to %i\n", minimap.samples );
- if(minimap.sample_offsets)
- free(minimap.sample_offsets);
- minimap.sample_offsets = malloc(2 * sizeof(*minimap.sample_offsets) * minimap.samples);
- MiniMapMakeSampleOffsets();
- }
- else if( !strcmp( argv[ i ], "-random" ) )
- {
- minimap.samples = atoi(argv[i + 1]);
- i++;
- Sys_Printf( "Random samples set to %i\n", minimap.samples );
- if(minimap.sample_offsets)
- free(minimap.sample_offsets);
- minimap.sample_offsets = NULL;
- }
- else if( !strcmp( argv[ i ], "-border" ) )
- {
- border = atof(argv[i + 1]);
- i++;
- Sys_Printf( "Border set to %f\n", border );
- }
- else if( !strcmp( argv[ i ], "-keepaspect" ) )
- {
- keepaspect = qtrue;
- Sys_Printf( "Keeping aspect ratio by letterboxing\n", border );
- }
- else if( !strcmp( argv[ i ], "-nokeepaspect" ) )
- {
- keepaspect = qfalse;
- Sys_Printf( "Not keeping aspect ratio\n", border );
- }
- else if( !strcmp( argv[ i ], "-o" ) )
- {
- strcpy(minimapFilename, argv[i + 1]);
- i++;
- Sys_Printf( "Output file name set to %s\n", minimapFilename );
- }
- else if( !strcmp( argv[ i ], "-minmax" ) && i < (argc - 7) )
- {
- mins[0] = atof(argv[i + 1]);
- mins[1] = atof(argv[i + 2]);
- mins[2] = atof(argv[i + 3]);
- maxs[0] = atof(argv[i + 4]);
- maxs[1] = atof(argv[i + 5]);
- maxs[2] = atof(argv[i + 6]);
- i += 6;
- Sys_Printf( "Map mins/maxs overridden\n" );
- }
- else if( !strcmp( argv[ i ], "-gray" ) )
- {
- mode = MINIMAP_MODE_GRAY;
- Sys_Printf( "Writing as white-on-black image\n" );
- }
- else if( !strcmp( argv[ i ], "-black" ) )
- {
- mode = MINIMAP_MODE_BLACK;
- Sys_Printf( "Writing as black alpha image\n" );
- }
- else if( !strcmp( argv[ i ], "-white" ) )
- {
- mode = MINIMAP_MODE_WHITE;
- Sys_Printf( "Writing as white alpha image\n" );
- }
- else if( !strcmp( argv[ i ], "-boost" ) )
- {
- minimap.boost = atof(argv[i + 1]);
- i++;
- Sys_Printf( "Contrast boost set to %f\n", minimap.boost );
- }
+ /* copy map name */
+ strcpy( base, source );
+ StripExtension( base );
+
+ /* extract map name */
+ len = strlen( base ) - 1;
+ while ( len > 0 && base[ len ] != '/' && base[ len ] != '\\' )
+ len--;
+ strcpy( nameOFmap, &base[ len + 1 ] );
+
+
+ qboolean dsSHs[512] = {qfalse};
+
+ for ( i = 0; i < numBSPDrawSurfaces; i++ ){
+ /* can't exclude nodraw patches here (they want shaders :0!) */
+ //if ( !( bspDrawSurfaces[i].surfaceType == 2 && bspDrawSurfaces[i].numIndexes == 0 ) ) dsSHs[bspDrawSurfaces[i].shaderNum] = qtrue;
+ dsSHs[bspDrawSurfaces[i].shaderNum] = qtrue;
+ //Sys_Printf( "%s\n", bspShaders[bspDrawSurfaces[i].shaderNum].shader );