typedef struct r_refdef_viewcache_s
{
+#ifdef VIEWCACHEDYNAMIC
// updated by gl_main_newmap()
int maxentities;
int world_numclusters;
unsigned char *world_surfacevisible;
// if true, the view is currently in a leaf without pvs data
qboolean world_novis;
+#else
+ unsigned char entityvisible[MAX_EDICTS+512+256];
+ unsigned char world_pvsbits[8192];
+ unsigned char world_leafvisible[65536];
+ unsigned char world_surfacevisible[262144];
+ qboolean world_novis;
+#endif
}
r_refdef_viewcache_t;
void R_Main_FreeViewCache(void)
{
+#ifdef VIEWCACHEDYNAMIC
if (r_refdef.viewcache.entityvisible)
Mem_Free(r_refdef.viewcache.entityvisible);
if (r_refdef.viewcache.world_pvsbits)
if (r_refdef.viewcache.world_surfacevisible)
Mem_Free(r_refdef.viewcache.world_surfacevisible);
memset(&r_refdef.viewcache, 0, sizeof(r_refdef.viewcache));
+#endif
}
void R_Main_AllocViewCache(void)
{
+#ifdef VIEWCACHEDYNAMIC
memset(&r_refdef.viewcache, 0, sizeof(r_refdef.viewcache));
r_refdef.viewcache.maxentities = r_refdef.scene.maxentities;
if (r_refdef.viewcache.maxentities)
r_refdef.viewcache.world_leafvisible = Mem_Alloc(r_main_mempool, r_refdef.viewcache.world_numleafs);
r_refdef.viewcache.world_surfacevisible = Mem_Alloc(r_main_mempool, r_refdef.viewcache.world_numsurfaces);
}
+#endif
}
void gl_main_start(void)