fix multiple bugs with the limit extension
git-svn-id: svn://svn.icculus.org/netradiant/trunk@191 61c419a2-8eb2-4b30-bcec-8cead039b335
This commit is contained in:
parent
72f386416f
commit
e7f13faa4b
|
|
@ -865,9 +865,9 @@ static int CompareSurfaceInfo( const void *a, const void *b )
|
|||
bInfo = &surfaceInfos[ *((int*) b) ];
|
||||
|
||||
/* model first */
|
||||
if( aInfo->model < bInfo->model )
|
||||
if( aInfo->modelindex < bInfo->modelindex )
|
||||
return 1;
|
||||
else if( aInfo->model > bInfo->model )
|
||||
else if( aInfo->modelindex > bInfo->modelindex )
|
||||
return -1;
|
||||
|
||||
/* then lightmap status */
|
||||
|
|
@ -997,7 +997,7 @@ void SetupSurfaceLightmaps( void )
|
|||
VectorClear( entityOrigin );
|
||||
|
||||
/* basic setup */
|
||||
info->model = model;
|
||||
info->modelindex = i;
|
||||
info->lm = NULL;
|
||||
info->plane = NULL;
|
||||
info->firstSurfaceCluster = numSurfaceClusters;
|
||||
|
|
|
|||
|
|
@ -1421,7 +1421,7 @@ rawGridPoint_t;
|
|||
|
||||
typedef struct surfaceInfo_s
|
||||
{
|
||||
bspModel_t *model;
|
||||
int modelindex;
|
||||
shaderInfo_t *si;
|
||||
rawLightmap_t *lm;
|
||||
int parentSurfaceNum, childSurfaceNum;
|
||||
|
|
@ -2328,7 +2328,7 @@ Q_EXTERN int* bspLeafSurfaces Q_ASSIGN(NULL);
|
|||
|
||||
Q_EXTERN int numBSPLeafBrushes Q_ASSIGN( 0 );
|
||||
Q_EXTERN int allocatedBSPLeafBrushes Q_ASSIGN( 0 );
|
||||
Q_EXTERN int* bspLeafBrushes Q_ASSIGN(0);
|
||||
Q_EXTERN int* bspLeafBrushes Q_ASSIGN(NULL);
|
||||
|
||||
Q_EXTERN int numBSPBrushes Q_ASSIGN( 0 );
|
||||
Q_EXTERN int allocatedBSPBrushes Q_ASSIGN( 0 );
|
||||
|
|
|
|||
|
|
@ -199,7 +199,7 @@ recursively emit the bsp nodes
|
|||
int EmitDrawNode_r( node_t *node )
|
||||
{
|
||||
bspNode_t *n;
|
||||
int i;
|
||||
int i, n0;
|
||||
|
||||
|
||||
/* check for leafnode */
|
||||
|
|
@ -211,7 +211,8 @@ int EmitDrawNode_r( node_t *node )
|
|||
|
||||
/* emit a node */
|
||||
AUTOEXPAND_BY_REALLOC_BSP(Nodes, 1024);
|
||||
n = &bspNodes[ numBSPNodes ];
|
||||
n0 = numBSPNodes;
|
||||
n = &bspNodes[ n0 ];
|
||||
numBSPNodes++;
|
||||
|
||||
VectorCopy (node->mins, n->mins);
|
||||
|
|
@ -235,6 +236,8 @@ int EmitDrawNode_r( node_t *node )
|
|||
{
|
||||
n->children[i] = numBSPNodes;
|
||||
EmitDrawNode_r (node->children[i]);
|
||||
// n may have become invalid here, so...
|
||||
n = &bspNodes[ n0 ];
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user