// tweak these if the game runs out
cl.max_csqcrenderentities = 0;
- cl.max_entities = 256;
- cl.max_static_entities = 256;
- cl.max_effects = 256;
- cl.max_beams = 256;
+ cl.max_entities = MAX_ENITIES_INITIAL;
+ cl.max_static_entities = MAX_STATICENTITIES;
+ cl.max_effects = MAX_EFFECTS;
+ cl.max_beams = MAX_BEAMS;
cl.max_dlights = MAX_DLIGHTS;
cl.max_lightstyle = MAX_LIGHTSTYLES;
cl.max_brushmodel_entities = MAX_EDICTS;
- cl.max_particles = 8192; // grows dynamically
- cl.max_decals = 2048; // grows dynamically
+ cl.max_particles = MAX_PARTICLES_INITIAL; // grows dynamically
+ cl.max_decals = MAX_DECALS_INITIAL; // grows dynamically
cl.max_showlmps = 0;
cl.num_dlights = 0;
r_refdef.scene.maxentities = MAX_EDICTS + 256 + 512;
r_refdef.scene.entities = (entity_render_t **)Mem_Alloc(cls.permanentmempool, sizeof(entity_render_t *) * r_refdef.scene.maxentities);
- r_refdef.scene.maxtempentities = 4096; // FIXME: make this grow
+ r_refdef.scene.maxtempentities = MAX_TEMPENTITIES; // FIXME: make this grow
r_refdef.scene.tempentities = (entity_render_t *)Mem_Alloc(cls.permanentmempool, sizeof(entity_render_t) * r_refdef.scene.maxtempentities);
CL_InitInput ();
#include "image.h"
#include "r_shadow.h"
-#define ABSOLUTE_MAX_PARTICLES 1<<24 // upper limit on cl.max_particles
-#define ABSOLUTE_MAX_DECALS 1<<24 // upper limit on cl.max_decals
-
// must match ptype_t values
particletype_t particletype[pt_total] =
{
while (cl.num_decals > 0 && cl.decals[cl.num_decals - 1].typeindex == 0)
cl.num_decals--;
- if (cl.num_decals == cl.max_decals && cl.max_decals < ABSOLUTE_MAX_DECALS)
+ if (cl.num_decals == cl.max_decals && cl.max_decals < MAX_DECALS)
{
decal_t *olddecals = cl.decals;
- cl.max_decals = min(cl.max_decals * 2, ABSOLUTE_MAX_DECALS);
+ cl.max_decals = min(cl.max_decals * 2, MAX_DECALS);
cl.decals = (decal_t *) Mem_Alloc(cls.levelmempool, cl.max_decals * sizeof(decal_t));
memcpy(cl.decals, olddecals, cl.num_decals * sizeof(decal_t));
Mem_Free(olddecals);
while (cl.num_particles > 0 && cl.particles[cl.num_particles - 1].typeindex == 0)
cl.num_particles--;
- if (cl.num_particles == cl.max_particles && cl.max_particles < ABSOLUTE_MAX_PARTICLES)
+ if (cl.num_particles == cl.max_particles && cl.max_particles < MAX_PARTICLES)
{
particle_t *oldparticles = cl.particles;
- cl.max_particles = min(cl.max_particles * 2, ABSOLUTE_MAX_PARTICLES);
+ cl.max_particles = min(cl.max_particles * 2, MAX_PARTICLES);
cl.particles = (particle_t *) Mem_Alloc(cls.levelmempool, cl.max_particles * sizeof(particle_t));
memcpy(cl.particles, oldparticles, cl.num_particles * sizeof(particle_t));
Mem_Free(oldparticles);
#define MAX_DECALSYSTEM_QUEUE 64
#define PAINTBUFFER_SIZE 512
#define MAX_BINDMAPS 8
+#define MAX_PARTICLES_INITIAL 32768
+#define MAX_PARTICLES 32768
+#define MAX_DECALS_INITIAL 1024
+#define MAX_DECALS 1024
+#define MAX_ENITIES_INITIAL 256
+#define MAX_STATICENTITIES 256
+#define MAX_EFFECTS 16
+#define MAX_BEAMS 16
+#define MAX_TEMPENTITIES 256
#else
#define MAX_INPUTLINE 16384 ///< maximum length of console commandline, QuakeC strings, and many other text processing buffers
#define CON_TEXTSIZE 1048576 ///< max scrollback buffer characters in console
#define MAX_DECALSYSTEM_QUEUE 1024
#define PAINTBUFFER_SIZE 2048
#define MAX_BINDMAPS 8
+#define MAX_PARTICLES_INITIAL 8192 ///< initial allocation for cl.particles
+#define MAX_PARTICLES 1048576 ///< upper limit on cl.particles size
+#define MAX_DECALS_INITIAL 8192 ///< initial allocation for cl.decals
+#define MAX_DECALS 1048576 ///< upper limit on cl.decals size
+#define MAX_ENITIES_INITIAL 256 ///< initial size of cl.entities
+#define MAX_STATICENTITIES 256 ///< limit on size of cl.static_entities
+#define MAX_EFFECTS 256 ///< limit on size of cl.effects
+#define MAX_BEAMS 256 ///< limit on size of cl.beams
+#define MAX_TEMPENTITIES 4096 ///< max number of temporary models visible per frame (certain sprite effects, certain types of CSQC entities also use this)
#endif