]> git.rm.cloudns.org Git - xonotic/darkplaces.git/commitdiff
add -maxtempents switch to increase starting 256/4000 tempentities limit.
authorvortex <vortex@d7cf8633-e32d-0410-b094-e92efae38249>
Sat, 19 Mar 2011 17:37:07 +0000 (17:37 +0000)
committervortex <vortex@d7cf8633-e32d-0410-b094-e92efae38249>
Sat, 19 Mar 2011 17:37:07 +0000 (17:37 +0000)
git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@10933 d7cf8633-e32d-0410-b094-e92efae38249

cl_main.c

index 0963ce99472df0b2a3a549853465e5a9f846f503..cc3315f2c9414f2b77a50626244cac16da3d352a 100644 (file)
--- a/cl_main.c
+++ b/cl_main.c
@@ -2361,6 +2361,8 @@ CL_Init
 */
 void CL_Init (void)
 {
+       int i;
+
        cls.levelmempool = Mem_AllocPool("client (per-level memory)", 0, NULL);
        cls.permanentmempool = Mem_AllocPool("client (long term memory)", 0, NULL);
 
@@ -2369,7 +2371,13 @@ void CL_Init (void)
        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
+       // FIXME: make this grow
+       i = COM_CheckParm("-maxtempents");
+       if (i)
+               r_refdef.scene.maxtempentities = atof(com_argv[i + 1]);
+       else
+               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 ();