]> git.xonotic.org Git - xonotic/netradiant.git/commitdiff
Merge commit '4f80165b29510dac0d86a230993a04717143e542' into master-merge
authorThomas Debesse <dev@illwieckz.net>
Mon, 20 Jun 2022 02:24:45 +0000 (04:24 +0200)
committerThomas Debesse <dev@illwieckz.net>
Mon, 20 Jun 2022 02:24:45 +0000 (04:24 +0200)
1  2 
radiant/renderstate.cpp
tools/quake3/q3map2/bsp.c
tools/quake3/q3map2/bspfile_abstract.c
tools/quake3/q3map2/light.c
tools/quake3/q3map2/q3map2.h
tools/quake3/q3map2/writebsp.c

Simple merge
index fcc2454f6cb6604079ceec480ad9a2dab6af13cc,c1d99060e3035d51a25eee6353011b40a6da5922..a5032b7bef670c07528f8a6a78ec301d27e4e41f
@@@ -716,8 -712,10 +716,9 @@@ int BSPMain( int argc, char **argv )
        /* note it */
        Sys_Printf( "--- BSP ---\n" );
  
+       doingBSP = qtrue;
        SetDrawSurfacesBuffer();
 -      mapDrawSurfs = safe_malloc( sizeof( mapDrawSurface_t ) * MAX_MAP_DRAW_SURFS );
 -      memset( mapDrawSurfs, 0, sizeof( mapDrawSurface_t ) * MAX_MAP_DRAW_SURFS );
 +      mapDrawSurfs = safe_malloc0( sizeof( mapDrawSurface_t ) * MAX_MAP_DRAW_SURFS );
        numMapDrawSurfs = 0;
  
        tempSource[ 0 ] = '\0';
Simple merge
Simple merge
index cc1b352ddc10e7f1d6e0916b7e9e789ce8de54ff,c3262a04fb2129994f944f3209126923edec0fdf..3e043a40f192e47da6911d31743276cc633e6474
@@@ -111,18 -56,19 +111,23 @@@ int EmitShader( const char *shader, in
        /* try to find an existing shader */
        for ( i = 0; i < numBSPShaders; i++ )
        {
 -                      /* ydnar: handle custom surface/content flags */
 +              /* 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;
        numBSPShaders++;
        strcpy( bspShaders[ i ].shader, shader );
        bspShaders[ i ].surfaceFlags = si->surfaceFlags;
 +
 +      if ( game->texFile )
 +      {
 +              /* Smokin'Guns like tex file */
 +              bspShaders[ i ].surfaceFlags |= GetSurfaceParm(si->shader);
 +      }
 +
        bspShaders[ i ].contentFlags = si->contentFlags;
  
-               /* handle custom content/surface flags */
-               if ( surfaceFlags != NULL ) {
-                       bspShaders[ i ].surfaceFlags = *surfaceFlags;
-               }
-               if ( contentFlags != NULL ) {
-                       bspShaders[ i ].contentFlags = *contentFlags;
-               }
 +      /* 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;
+       }
 +      }
  
        /* recursively emit any damage shaders */
        if ( si->damageShader != NULL && si->damageShader[ 0 ] != '\0' ) {