]> de.git.xonotic.org Git - xonotic/netradiant.git/blobdiff - tools/quake3/q3map2/vis.c
q3map2: make Smokin'Guns code not requiring a rebuild
[xonotic/netradiant.git] / tools / quake3 / q3map2 / vis.c
index 66a46addaf038e58c8c1ce1520505da7a6b4dbc1..7623590b53086fe4ba2b4655520f28cf3b746f44 100644 (file)
@@ -1181,13 +1181,15 @@ int VisMain( int argc, char **argv ){
        Sys_Printf( "Loading %s\n", source );
        LoadBSPFile( source );
 
-#ifdef SMOKINGUNS
-       StripExtension (source);
-       strcat (source, ".tex");
-       LoadSurfaceFlags(source);
-       StripExtension (source);
-       strcat (source, ".bsp");
-#endif
+       if ( game->texFile )
+       {
+               // smokinguns-like tex file
+               StripExtension( source );
+               strcat( source, ".tex" );
+               LoadSurfaceFlags( source );
+               StripExtension( source );
+               strcat( source, ".bsp" );
+       }
 
        /* load the portal file */
        if (!portalFilePath[0]) {
@@ -1231,11 +1233,13 @@ int VisMain( int argc, char **argv ){
                remove( portalFilePath );
        }
 
-#ifdef SMOKINGUNS
-       StripExtension (source);
-       WriteTexFile(source);
-       DefaultExtension (source, ".bsp");
-#endif
+       if ( game->texFile )
+       {
+               // smokinguns-like tex file
+               StripExtension( source );
+               WriteTexFile( source );
+               DefaultExtension( source, ".bsp" );
+       }
 
        /* write the bsp file */
        Sys_Printf( "Writing %s\n", source );