From 4b642e822f04f831ceaa2d2bbae8e4d640263b7b Mon Sep 17 00:00:00 2001 From: Rudolf Polzer Date: Mon, 17 Oct 2011 06:53:42 +0200 Subject: [PATCH] totally unlimit entities --- tools/quake3/q3map2/bspfile_abstract.c | 3 +-- tools/quake3/q3map2/map.c | 3 +-- tools/quake3/q3map2/q3map2.h | 6 ++---- 3 files changed, 4 insertions(+), 8 deletions(-) diff --git a/tools/quake3/q3map2/bspfile_abstract.c b/tools/quake3/q3map2/bspfile_abstract.c index ef78160..084b859 100644 --- a/tools/quake3/q3map2/bspfile_abstract.c +++ b/tools/quake3/q3map2/bspfile_abstract.c @@ -545,8 +545,7 @@ qboolean ParseEntity( void ) return qfalse; if( strcmp( token, "{" ) ) Error( "ParseEntity: { not found" ); - if( numEntities == MAX_MAP_ENTITIES ) - Error( "numEntities == MAX_MAP_ENTITIES" ); + AUTOEXPAND_BY_REALLOC(entities, numEntities, allocatedEntities, 32); /* create new entity */ mapEnt = &entities[ numEntities ]; diff --git a/tools/quake3/q3map2/map.c b/tools/quake3/q3map2/map.c index 9534bdb..1289257 100644 --- a/tools/quake3/q3map2/map.c +++ b/tools/quake3/q3map2/map.c @@ -1603,8 +1603,7 @@ static qboolean ParseMapEntity( qboolean onlyLights, qboolean noCollapseGroups ) } /* range check */ - if( numEntities >= MAX_MAP_ENTITIES ) - Error( "numEntities == MAX_MAP_ENTITIES" ); + AUTOEXPAND_BY_REALLOC(entities, numEntities, allocatedEntities, 32); /* setup */ entitySourceBrushes = 0; diff --git a/tools/quake3/q3map2/q3map2.h b/tools/quake3/q3map2/q3map2.h index 6449446..e86575e 100644 --- a/tools/quake3/q3map2/q3map2.h +++ b/tools/quake3/q3map2/q3map2.h @@ -317,9 +317,6 @@ abstracted bsp file #define MAX_LIGHTMAP_SHADERS 256 /* ok to increase these at the expense of more memory */ -#define MAX_MAP_ENTITIES 0x8000 //% 0x800 /* ydnar */ -#define MAX_MAP_ENTSTRING 0x400000 //% 0x40000 /* ydnar */ - #define MAX_MAP_AREAS 0x100 /* MAX_MAP_AREA_BYTES in q_shared must match! */ #define MAX_MAP_FOGS 30 //& 0x100 /* RBSP (32 - world fog - goggles) */ #define MAX_MAP_LEAFS 0x20000 @@ -2449,7 +2446,8 @@ abstracted bsp globals Q_EXTERN int numEntities Q_ASSIGN( 0 ); Q_EXTERN int numBSPEntities Q_ASSIGN( 0 ); -Q_EXTERN entity_t entities[ MAX_MAP_ENTITIES ]; +Q_EXTERN int allocatedEntities Q_ASSIGN( 0 ); +Q_EXTERN entity_t* entities Q_ASSIGN(NULL); Q_EXTERN int numBSPModels Q_ASSIGN( 0 ); Q_EXTERN int allocatedBSPModels Q_ASSIGN( 0 ); -- 2.39.2