if (cls.state == ca_dedicated)
return;
+ // don't connect to a server if we're benchmarking a demo
+ if (COM_CheckParm("-benchmark"))
+ return;
+
// clear menu's connect error message
M_Update_Return_Reason("");
cls.demonum = -1;
void CL_ClearTempEntities (void)
{
r_refdef.scene.numtempentities = 0;
+ // grow tempentities buffer on request
+ if (r_refdef.scene.expandtempentities)
+ {
+ Con_Printf("CL_NewTempEntity: grow maxtempentities from %i to %i\n", r_refdef.scene.maxtempentities, r_refdef.scene.maxtempentities * 2);
+ r_refdef.scene.maxtempentities *= 2;
+ r_refdef.scene.tempentities = (entity_render_t *)Mem_Realloc(cls.permanentmempool, r_refdef.scene.tempentities, sizeof(entity_render_t) * r_refdef.scene.maxtempentities);
+ r_refdef.scene.expandtempentities = false;
+ }
}
entity_render_t *CL_NewTempEntity(double shadertime)
if (r_refdef.scene.numentities >= r_refdef.scene.maxentities)
return NULL;
if (r_refdef.scene.numtempentities >= r_refdef.scene.maxtempentities)
+ {
+ r_refdef.scene.expandtempentities = true; // will be reallocated next frame since current frame may have pointers set already
return NULL;
+ }
render = &r_refdef.scene.tempentities[r_refdef.scene.numtempentities++];
memset (render, 0, sizeof(*render));
r_refdef.scene.entities[r_refdef.scene.numentities++] = render;
trace_t trace;
matrix4x4_t tempmatrix;
Matrix4x4_Transform(&e->render.matrix, muzzleflashorigin, v2);
- trace = CL_TraceLine(origin, v2, MOVE_NOMONSTERS, NULL, SUPERCONTENTS_SOLID | SUPERCONTENTS_SKY, true, false, NULL, false);
+ trace = CL_TraceLine(origin, v2, MOVE_NOMONSTERS, NULL, SUPERCONTENTS_SOLID | SUPERCONTENTS_SKY, true, false, NULL, false, false);
Matrix4x4_Normalize(&tempmatrix, &e->render.matrix);
Matrix4x4_SetOrigin(&tempmatrix, trace.endpos[0], trace.endpos[1], trace.endpos[2]);
Matrix4x4_Scale(&tempmatrix, 150, 1);
r_refdef.scene.numlights = 0;
r_refdef.view.matrix = identitymatrix;
r_refdef.view.quality = 1;
-
+
cl.num_brushmodel_entities = 0;
if (cls.state == ca_connected && cls.signon == SIGNONS)
*/
void CL_Init (void)
{
+
cls.levelmempool = Mem_AllocPool("client (per-level memory)", 0, NULL);
cls.permanentmempool = Mem_AllocPool("client (long term memory)", 0, NULL);
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 = MAX_TEMPENTITIES; // FIXME: make this grow
+ // max temp entities
+ r_refdef.scene.maxtempentities = MAX_TEMPENTITIES;
r_refdef.scene.tempentities = (entity_render_t *)Mem_Alloc(cls.permanentmempool, sizeof(entity_render_t) * r_refdef.scene.maxtempentities);
CL_InitInput ();