]> git.xonotic.org Git - xonotic/netradiant.git/commitdiff
do not REPEATEDLY blow up _skybox surfaces
authorRudolf Polzer <divverent@alientrap.org>
Sun, 8 Aug 2010 18:56:47 +0000 (20:56 +0200)
committerRudolf Polzer <divverent@alientrap.org>
Sun, 8 Aug 2010 18:56:47 +0000 (20:56 +0200)
tools/quake3/q3map2/surface.c

index 7f511b93e4f382e22ed7ce5a0180c0ee02d78017..ce7e93d1e4ae920afd5e6b255415cb161f1dfee5 100644 (file)
@@ -3448,6 +3448,7 @@ void FilterDrawsurfsIntoTree( entity_t *e, tree_t *tree )
        vec3_t                          origin, mins, maxs;
        int                                     refs;
        int                                     numSurfs, numRefs, numSkyboxSurfaces;
+       qboolean        sb;
        
        
        /* note it */
@@ -3466,15 +3467,18 @@ void FilterDrawsurfsIntoTree( entity_t *e, tree_t *tree )
                
                /* get shader */
                si = ds->shaderInfo;
-               
+
                /* ydnar: skybox surfaces are special */
                if( ds->skybox )
                {
                        refs = AddReferenceToTree_r( ds, tree->headnode, qtrue );
                        ds->skybox = qfalse;
+                       sb = qtrue;
                }
                else
                {
+                       sb = qfalse;
+
                        /* refs initially zero */
                        refs = 0;
                        
@@ -3594,6 +3598,11 @@ void FilterDrawsurfsIntoTree( entity_t *e, tree_t *tree )
                                refs = 0;
                                break;
                }
+
+               /* maybe surface got marked as skybox again */
+               /* if we keep that flag, it will get scaled up AGAIN */
+               if(sb)
+                       ds->skybox = qfalse;
                
                /* tot up the references */
                if( refs > 0 )