do not REPEATEDLY blow up _skybox surfaces

This commit is contained in:
Rudolf Polzer 2010-08-08 20:56:47 +02:00
parent 2ddfb486e9
commit bb104da06f

View File

@ -3448,6 +3448,7 @@ void FilterDrawsurfsIntoTree( entity_t *e, tree_t *tree )
vec3_t origin, mins, maxs; vec3_t origin, mins, maxs;
int refs; int refs;
int numSurfs, numRefs, numSkyboxSurfaces; int numSurfs, numRefs, numSkyboxSurfaces;
qboolean sb;
/* note it */ /* note it */
@ -3472,9 +3473,12 @@ void FilterDrawsurfsIntoTree( entity_t *e, tree_t *tree )
{ {
refs = AddReferenceToTree_r( ds, tree->headnode, qtrue ); refs = AddReferenceToTree_r( ds, tree->headnode, qtrue );
ds->skybox = qfalse; ds->skybox = qfalse;
sb = qtrue;
} }
else else
{ {
sb = qfalse;
/* refs initially zero */ /* refs initially zero */
refs = 0; refs = 0;
@ -3595,6 +3599,11 @@ void FilterDrawsurfsIntoTree( entity_t *e, tree_t *tree )
break; 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 */ /* tot up the references */
if( refs > 0 ) if( refs > 0 )
{ {