#define MAX_MAP_VISIBILITY (VIS_HEADER_SIZE + MAX_MAP_VISCLUSTERS * (((MAX_MAP_VISCLUSTERS + 63) & ~63) >> 3))
#define MAX_MAP_DRAW_SURFS 0x20000
-#define MAX_MAP_DRAW_INDEXES 0x80000
#define MAX_MAP_ADVERTISEMENTS 30
Q_EXTERN byte bspVisBytes[ MAX_MAP_VISIBILITY ];
Q_EXTERN int numBSPDrawVerts Q_ASSIGN( 0 );
-Q_EXTERN bspDrawVert_t *bspDrawVerts Q_ASSIGN( NULL );
+Q_EXTERN bspDrawVert_t *bspDrawVerts Q_ASSIGN( NULL );
Q_EXTERN int numBSPDrawIndexes Q_ASSIGN( 0 );
-Q_EXTERN int bspDrawIndexes[ MAX_MAP_DRAW_INDEXES ];
+Q_EXTERN int allocatedBSPDrawIndexes Q_ASSIGN( 0 );
+Q_EXTERN int *bspDrawIndexes Q_ASSIGN(NULL);
Q_EXTERN int numBSPDrawSurfaces Q_ASSIGN( 0 );
Q_EXTERN bspDrawSurface_t *bspDrawSurfaces Q_ASSIGN( NULL );
/* copy new unique indexes */
for( i = 0; i < ds->numIndexes; i++ )
{
- if( numBSPDrawIndexes == MAX_MAP_DRAW_INDEXES )
- Error( "MAX_MAP_DRAW_INDEXES" );
+ AUTOEXPAND_BY_REALLOC_BSP(DrawIndexes, 1024);
bspDrawIndexes[ numBSPDrawIndexes ] = ds->indexes[ i ];
/* validate the index */