From ee81dd1741d3efb30215591f433d0e762dc2cab9 Mon Sep 17 00:00:00 2001 From: Eric Wasylishen Date: Fri, 31 Mar 2017 12:52:33 -0600 Subject: [PATCH] CL_ParseStatic: move static entities to the hunk and remove MAX_STATIC_ENTITIES tutorial from MH: http://forums.insideqc.com/viewtopic.php?t=1928 --- quakespasm/Quake/cl_main.c | 1 - quakespasm/Quake/cl_parse.c | 11 ++++------- quakespasm/Quake/client.h | 2 -- 3 files changed, 4 insertions(+), 10 deletions(-) diff --git a/quakespasm/Quake/cl_main.c b/quakespasm/Quake/cl_main.c index 30c8718d..57fb098b 100644 --- a/quakespasm/Quake/cl_main.c +++ b/quakespasm/Quake/cl_main.c @@ -52,7 +52,6 @@ client_static_t cls; client_state_t cl; // FIXME: put these on hunk? efrag_t cl_efrags[MAX_EFRAGS]; -entity_t cl_static_entities[MAX_STATIC_ENTITIES]; lightstyle_t cl_lightstyle[MAX_LIGHTSTYLES]; dlight_t cl_dlights[MAX_DLIGHTS]; diff --git a/quakespasm/Quake/cl_parse.c b/quakespasm/Quake/cl_parse.c index 75bacdaf..21afbd44 100644 --- a/quakespasm/Quake/cl_parse.c +++ b/quakespasm/Quake/cl_parse.c @@ -874,13 +874,10 @@ CL_ParseStatic void CL_ParseStatic (int version) //johnfitz -- added a parameter { entity_t *ent; - int i; - i = cl.num_statics; - if (i >= MAX_STATIC_ENTITIES) - Host_Error ("Too many static entities"); - - ent = &cl_static_entities[i]; + // mh - extended static entities begin + ent = (entity_t *) Hunk_Alloc (sizeof (entity_t)); + // mh - extended static entities end cl.num_statics++; CL_ParseBaseline (ent, version); //johnfitz -- added second parameter @@ -1144,7 +1141,7 @@ void CL_ParseServerMessage (void) if (i == 2) { if (cl.num_statics > 128) - Con_DWarning ("%i static entities exceeds standard limit of 128 (max = %d).\n", cl.num_statics, MAX_STATIC_ENTITIES); + Con_DWarning ("%i static entities exceeds standard limit of 128.\n", cl.num_statics); R_CheckEfrags (); } //johnfitz diff --git a/quakespasm/Quake/client.h b/quakespasm/Quake/client.h index 3939061f..72d9a175 100644 --- a/quakespasm/Quake/client.h +++ b/quakespasm/Quake/client.h @@ -265,14 +265,12 @@ extern cvar_t m_side; #define MAX_TEMP_ENTITIES 256 //johnfitz -- was 64 -#define MAX_STATIC_ENTITIES 4096 //ericw -- was 512 //johnfitz -- was 128 #define MAX_VISEDICTS 4096 // larger, now we support BSP2 extern client_state_t cl; // FIXME, allocate dynamically extern efrag_t cl_efrags[MAX_EFRAGS]; -extern entity_t cl_static_entities[MAX_STATIC_ENTITIES]; extern lightstyle_t cl_lightstyle[MAX_LIGHTSTYLES]; extern dlight_t cl_dlights[MAX_DLIGHTS]; extern entity_t cl_temp_entities[MAX_TEMP_ENTITIES];