]> git.xonotic.org Git - xonotic/netradiant.git/blobdiff - tools/quake3/q3map2/writebsp.c
Merge commit '4f80165b29510dac0d86a230993a04717143e542' into master-merge
[xonotic/netradiant.git] / tools / quake3 / q3map2 / writebsp.c
index cc1b352ddc10e7f1d6e0916b7e9e789ce8de54ff..3e043a40f192e47da6911d31743276cc633e6474 100644 (file)
@@ -114,15 +114,20 @@ int EmitShader( const char *shader, int *contentFlags, int *surfaceFlags ){
                /* if not Smokin'Guns like tex file */
                if ( !game->texFile )
                {
-                       /* ydnar: handle custom surface/content flags */
-                       if ( surfaceFlags != NULL && bspShaders[ i ].surfaceFlags != *surfaceFlags ) {
-                               continue;
-                       }
-                       if ( contentFlags != NULL && bspShaders[ i ].contentFlags != *contentFlags ) {
-                               continue;
+               /* ydnar: handle custom surface/content flags */
+               if ( surfaceFlags != NULL && bspShaders[ i ].surfaceFlags != *surfaceFlags ) {
+                       continue;
+               }
+               if ( contentFlags != NULL && bspShaders[ i ].contentFlags != *contentFlags ) {
+                       continue;
+               }
+               }
+               if ( !doingBSP ){
+                       si = ShaderInfoForShader( shader );
+                       if ( si->remapShader && si->remapShader[ 0 ] ) {
+                               shader = si->remapShader;
                        }
                }
-
                /* compare name */
                if ( !Q_stricmp( shader, bspShaders[ i ].shader ) ) {
                        return i;
@@ -150,13 +155,13 @@ int EmitShader( const char *shader, int *contentFlags, int *surfaceFlags ){
        /* if not Smokin'Guns like tex file */
        if ( !game->texFile )
        {
-               /* handle custom content/surface flags */
-               if ( surfaceFlags != NULL ) {
-                       bspShaders[ i ].surfaceFlags = *surfaceFlags;
-               }
-               if ( contentFlags != NULL ) {
-                       bspShaders[ i ].contentFlags = *contentFlags;
-               }
+       /* handle custom content/surface flags */
+       if ( surfaceFlags != NULL ) {
+               bspShaders[ i ].surfaceFlags = *surfaceFlags;
+       }
+       if ( contentFlags != NULL ) {
+               bspShaders[ i ].contentFlags = *contentFlags;
+       }
        }
 
        /* recursively emit any damage shaders */