-// clear other arrays
- memset(cl_entities, 0, sizeof(cl_entities));
- memset(cl_lightstyle, 0, sizeof(cl_lightstyle));
- memset(cl_temp_entities, 0, sizeof(cl_temp_entities));
- memset(cl_beams, 0, sizeof(cl_beams));
- memset(cl_dlights, 0, sizeof(cl_dlights));
- memset(cl_effect, 0, sizeof(cl_effect));
+ cl_num_entities = 0;
+ cl_num_static_entities = 0;
+ cl_num_temp_entities = 0;
+ cl_num_brushmodel_entities = 0;
+
+ // tweak these if the game runs out
+ cl_max_entities = MAX_EDICTS;
+ cl_max_static_entities = 256;
+ cl_max_temp_entities = 512;
+ cl_max_effects = 256;
+ cl_max_beams = 24;
+ cl_max_dlights = MAX_DLIGHTS;
+ cl_max_lightstyle = MAX_LIGHTSTYLES;
+ cl_max_brushmodel_entities = MAX_EDICTS;
+
+ cl_entities = Mem_Alloc(cl_entities_mempool, cl_max_entities * sizeof(entity_t));
+ cl_static_entities = Mem_Alloc(cl_entities_mempool, cl_max_static_entities * sizeof(entity_t));
+ cl_temp_entities = Mem_Alloc(cl_entities_mempool, cl_max_temp_entities * sizeof(entity_t));
+ cl_effects = Mem_Alloc(cl_entities_mempool, cl_max_effects * sizeof(cl_effect_t));
+ cl_beams = Mem_Alloc(cl_entities_mempool, cl_max_beams * sizeof(beam_t));
+ cl_dlights = Mem_Alloc(cl_entities_mempool, cl_max_dlights * sizeof(dlight_t));
+ cl_lightstyle = Mem_Alloc(cl_entities_mempool, cl_max_lightstyle * sizeof(lightstyle_t));
+ cl_brushmodel_entities = Mem_Alloc(cl_entities_mempool, cl_max_brushmodel_entities * sizeof(entity_render_t *));
+