CL_ParseStatic: move static entities to the hunk and remove MAX_STATIC_ENTITIES
tutorial from MH: http://forums.insideqc.com/viewtopic.php?t=1928
This commit is contained in:
parent
df624cbbb8
commit
ee81dd1741
|
@ -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];
|
||||
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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];
|
||||
|
|
Loading…
Reference in New Issue