*/
-#define MAX_MAP_HULLS 16 // was 4
-#define MAX_MAP_LEAFS 65536 // was 8192
-
-// key / value pair sizes
-
-#define MAX_KEY 32
-#define MAX_VALUE 1024
+#define MAX_MAP_HULLS 16 // Q1BSP has 4, Hexen2 Q1BSP has 8, MCBSP has 16
//=============================================================================
#include "cdaudio.h"
#include "sound.h"
-#define MAXTRACKS 256
-
// Prototypes of the system dependent functions
extern void CDAudio_SysEject (void);
extern void CDAudio_SysCloseDoor (void);
static qboolean enabled = false;
static float cdvolume;
typedef char filename_t[MAX_QPATH];
+#ifdef MAXTRACKS
static filename_t remap[MAXTRACKS];
+#endif
static unsigned char maxTrack;
static int faketrack = -1;
if(strspn(trackname, "0123456789") == strlen(trackname))
{
track = (unsigned char) atoi(trackname);
+#ifdef MAXTRACKS
if(track > 0 && track < MAXTRACKS)
if(*remap[track])
{
}
}
}
+#endif
}
if(strspn(trackname, "0123456789") == strlen(trackname))
static void CD_f (void)
{
const char *command;
+#ifdef MAXTRACKS
int ret;
int n;
+#endif
command = Cmd_Argv (1);
{
enabled = true;
CDAudio_Stop();
+#ifdef MAXTRACKS
for (n = 0; n < MAXTRACKS; n++)
*remap[n] = 0; // empty string, that is, unremapped
+#endif
CDAudio_GetAudioDiskInfo();
return;
}
if (strcasecmp(command, "remap") == 0)
{
+#ifdef MAXTRACKS
ret = Cmd_Argc() - 2;
if (ret <= 0)
{
}
for (n = 1; n <= ret; n++)
strlcpy(remap[n], Cmd_Argv (n+1), sizeof(*remap));
+#endif
return;
}
int CDAudio_Init (void)
{
+#ifdef MAXTRACKS
int i;
+#endif
if (cls.state == ca_dedicated)
return -1;
CDAudio_SysInit();
+#ifdef MAXTRACKS
for (i = 0; i < MAXTRACKS; i++)
*remap[i] = 0;
+#endif
Cvar_RegisterVariable(&cdaudio);
Cvar_RegisterVariable(&cdaudioinitialized);
#define CL_DYNTEXTURE_H\r
\r
#define CLDYNTEXTUREPREFIX "_dynamic/"\r
-#define MAX_DYNAMIC_TEXTURE_COUNT 64\r
\r
// always path fully specified names to the dynamic texture functions! (ie. with the _dynamic/ prefix, etc.!)\r
\r
#include "cl_dyntexture.h"\r
\r
#define CLGECKOPREFIX CLDYNTEXTUREPREFIX "gecko/"\r
-#define MAX_GECKO_INSTANCES 16\r
\r
typedef enum clgecko_buttoneventtype_e {\r
CLG_BET_DOWN,\r
}
particleeffectinfo_t;
-#define MAX_PARTICLEEFFECTNAME 256
char particleeffectname[MAX_PARTICLEEFFECTNAME][64];
-#define MAX_PARTICLEEFFECTINFO 4096
particleeffectinfo_t particleeffectinfo[MAX_PARTICLEEFFECTINFO];
//static int explosparkramp[8] = {0x4b0700, 0x6f0f00, 0x931f07, 0xb7330f, 0xcf632b, 0xe3974f, 0xffe7b5, 0xffffff};
-#define MAX_PARTICLETEXTURES 1024
// particletexture_t is a rectangle in the particlefonttexture
typedef struct particletexture_s
{
#include "cl_dyntexture.h"
-#define MAXCLVIDEOS 64 + 1 // 1 video is reserved for the cinematic mode
// yields DYNAMIC_TEXTURE_PATH_PREFIX CLVIDEOPREFIX video name for a path
#define CLVIDEOPREFIX CLDYNTEXTUREPREFIX "video/"
#define CLTHRESHOLD 2.0
#include "matrixlib.h"
#include "snd_main.h"
-// LordHavoc: 256 dynamic lights
-#define MAX_DLIGHTS 256
-
-/// this is the maximum number of input packets that can be predicted
-#define CL_MAX_USERCMDS 128
-
// flags for rtlight rendering
#define LIGHTFLAG_NORMALMODE 1
#define LIGHTFLAG_REALTIMEMODE 2
// note: technically each framegroupblend can produce two of these, but that
// never happens in practice because no one blends between more than 2
// framegroups at once
-#define MAX_FRAMEBLENDS MAX_FRAMEGROUPBLENDS
+#define MAX_FRAMEBLENDS (MAX_FRAMEGROUPBLENDS * 2)
typedef struct frameblend_s
{
int subframe;
#define SIGNONS 4 // signon messages to receive before connected
-#define MAX_DEMOS 8
-#define MAX_DEMONAME 16
-
typedef enum cactive_e
{
ca_uninitialized, // during early startup
typedef struct r_refdef_viewcache_s
{
+ // updated by gl_main_newmap()
+ int maxentities;
+ int world_numclusters;
+ int world_numleafs;
+ int world_numsurfaces;
+
// these properties are generated by R_View_Update()
// which entities are currently visible for this viewpoint
// (the used range is 0...r_refdef.scene.numentities)
- unsigned char entityvisible[MAX_EDICTS];
+ unsigned char *entityvisible;
+
// flag arrays used for visibility checking on world model
// (all other entities have no per-surface/per-leaf visibility checks)
- // TODO: dynamic resize according to r_refdef.scene.worldmodel->brush.num_clusters
- unsigned char world_pvsbits[(32768+7)>>3]; // FIXME: buffer overflow on huge maps
- // TODO: dynamic resize according to r_refdef.scene.worldmodel->brush.num_leafs
- unsigned char world_leafvisible[32768]; // FIXME: buffer overflow on huge maps
- // TODO: dynamic resize according to r_refdef.scene.worldmodel->num_surfaces
- unsigned char world_surfacevisible[262144]; // FIXME: buffer overflow on huge maps
+ unsigned char *world_pvsbits;
+ unsigned char *world_leafvisible;
+ unsigned char *world_surfacevisible;
// if true, the view is currently in a leaf without pvs data
qboolean world_novis;
}
int numlights;
// intensities for light styles right now, controls rtlights
- float rtlightstylevalue[256]; // float fraction of base light value
+ float rtlightstylevalue[MAX_LIGHTSTYLES]; // float fraction of base light value
// 8.8bit fixed point intensities for light styles
// controls intensity lightmap layers
- unsigned short lightstylevalue[256]; // 8.8 fraction of base light value
+ unsigned short lightstylevalue[MAX_LIGHTSTYLES]; // 8.8 fraction of base light value
float ambient;
return;
}
- S_StartSound(32768 + PRVM_NUM_FOR_EDICT(entity), channel, S_FindName(sample), entity->fields.client->origin, volume, attenuation);
+ S_StartSound(MAX_EDICTS + PRVM_NUM_FOR_EDICT(entity), channel, S_FindName(sample), entity->fields.client->origin, volume, attenuation);
}
// #483 void(vector origin, string sample, float volume, float attenuation) pointsound
return;
}
- // Send World Entity as Entity to Play Sound (for CSQC, that is 32768)
- S_StartSound(32768, 0, S_FindName(sample), org, volume, attenuation);
+ // Send World Entity as Entity to Play Sound (for CSQC, that is MAX_EDICTS)
+ S_StartSound(MAX_EDICTS, 0, S_FindName(sample), org, volume, attenuation);
}
// #14 entity() spawn
#if 1
unsigned char *pvs;
#else
- static int fatpvsbytes;
- static unsigned char fatpvs[MAX_MAP_LEAFS/8];
+ int fatpvsbytes;
+ unsigned char fatpvs[MAX_MAP_LEAFS/8];
#endif
VM_SAFEPARMCOUNT(2, VM_SV_checkpvs);
#include "quakedef.h"
-#define MAX_ALIAS_NAME 32
-// this is the largest script file that can be executed in one step
-// LordHavoc: inreased this from 8192 to 32768
-// div0: increased this from 32k to 128k
-// div0: increased this from 128k to 640k which ought to be enough for anyone
-#define CMDBUFSIZE 655360
-// maximum number of parameters to a command
-#define MAX_ARGS 80
-// maximum tokenizable commandline length (counting NUL terminations)
-#define CMD_TOKENIZELENGTH (MAX_INPUTLINE + MAX_ARGS)
-
typedef struct cmdalias_s
{
struct cmdalias_s *next;
#ifndef COMMON_H
#define COMMON_H
-/// many buffers use this size
-#define MAX_INPUTLINE 16384
-
/// MSVC has a different name for several standard functions
#ifdef WIN32
float con_cursorspeed = 4;
-#define CON_TEXTSIZE 1048576
-#define CON_MAXLINES 16384
-
// lines up from bottom to display
int con_backscroll;
// FIXME consider attachments here!
- ed = PRVM_EDICT_NUM(entnum - 32768);
+ ed = PRVM_EDICT_NUM(entnum - MAX_EDICTS);
if(!ed->priv.required->free)
{
char *cvar_dummy_description = "custom cvar";
cvar_t *cvar_vars = NULL;
-cvar_t *cvar_hashtable[65536];
+cvar_t *cvar_hashtable[CVAR_HASHSIZE];
char *cvar_null_string = "";
/*
#define GL_BACKEND_H
// how many texture units to track state on (backendunits/backendimageunits/backendarrayunits are limited to this value)
-#define MAX_TEXTUREUNITS 64
+#define MAX_TEXTUREUNITS 16
#define POLYGONELEMENTS_MAXPOINTS 258
extern int polygonelement3i[(POLYGONELEMENTS_MAXPOINTS-2)*3];
/* Support Routines */
#define FONT_FILESIZE 13468
-#define MAX_CACHED_PICS 1024
-#define CACHEPICHASHSIZE 256
static cachepic_t *cachepichash[CACHEPICHASHSIZE];
static cachepic_t cachepics[MAX_CACHED_PICS];
static int numcachepics;
return skinframe;
}
+void R_Main_FreeViewCache(void)
+{
+ if (r_refdef.viewcache.entityvisible)
+ Mem_Free(r_refdef.viewcache.entityvisible);
+ if (r_refdef.viewcache.world_pvsbits)
+ Mem_Free(r_refdef.viewcache.world_pvsbits);
+ if (r_refdef.viewcache.world_leafvisible)
+ Mem_Free(r_refdef.viewcache.world_leafvisible);
+ if (r_refdef.viewcache.world_surfacevisible)
+ Mem_Free(r_refdef.viewcache.world_surfacevisible);
+ memset(&r_refdef.viewcache, 0, sizeof(r_refdef.viewcache));
+}
+
+void R_Main_AllocViewCache(void)
+{
+ 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.entityvisible = Mem_Alloc(r_main_mempool, r_refdef.viewcache.maxentities);
+ if (cl.worldmodel)
+ {
+ r_refdef.viewcache.world_numclusters = cl.worldmodel->brush.num_pvsclusters;
+ r_refdef.viewcache.world_numleafs = cl.worldmodel->brush.num_leafs;
+ r_refdef.viewcache.world_numsurfaces = cl.worldmodel->num_surfaces;
+ r_refdef.viewcache.world_pvsbits = Mem_Alloc(r_main_mempool, (r_refdef.viewcache.world_numclusters+7)>>3);
+ 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);
+ }
+}
+
void gl_main_start(void)
{
+ R_Main_AllocViewCache();
+
r_numqueries = 0;
r_maxqueries = 0;
memset(r_queries, 0, sizeof(r_queries));
extern rtexture_t *loadingscreentexture;
void gl_main_shutdown(void)
{
+ R_Main_FreeViewCache();
+
if (r_maxqueries)
qglDeleteQueriesARB(r_maxqueries, r_queries);
if (cl.worldmodel->brush.entities)
CL_ParseEntityLump(cl.worldmodel->brush.entities);
}
+ R_Main_FreeViewCache();
+ R_Main_AllocViewCache();
}
void GL_Main_Init(void)
#include "r_shadow.h"
#include "portals.h"
-#define MAX_LIGHTMAP_SIZE 256
-
cvar_t r_ambient = {0, "r_ambient", "0", "brightens map, value is 0-128"};
cvar_t r_lockpvs = {0, "r_lockpvs", "0", "disables pvs switching, allows you to walk around and inspect what is visible from a given location in the map (anything not visible from your current location will not be drawn)"};
cvar_t r_lockvisibility = {0, "r_lockvisibility", "0", "disables visibility updates, allows you to walk around and inspect what is visible from a given viewpoint in the map (anything offscreen at the moment this is enabled will not be drawn)"};
int history_line;
char history_savedline[MAX_INPUTLINE];
conbuffer_t history;
-#define HIST_TEXTSIZE 262144
-#define HIST_MAXLINES 4096
extern cvar_t con_textsize;
static int load_cursor; ///< 0 < load_cursor < MAX_SAVEGAMES
-#define MAX_SAVEGAMES 12
static char m_filenames[MAX_SAVEGAMES][SAVEGAME_COMMENT_LENGTH+1];
static int loadable[MAX_SAVEGAMES];
#define M_PROG_FILENAME "menu.dat"
#define M_NAME "menu"
-#define M_MAX_EDICTS 32768 // hopefully won't have to increase this again anytime soon...
enum m_state_e {
m_none,
tag_torso,
*/
memset(word, 0, sizeof(word));
- for (i = 0;i < MAX_SKINS && (data = text = (char *)FS_LoadFile(va("%s_%i.skin", loadmodel->name, i), tempmempool, true, NULL));i++)
+ for (i = 0;i < 256 && (data = text = (char *)FS_LoadFile(va("%s_%i.skin", loadmodel->name, i), tempmempool, true, NULL));i++)
{
// If it's the first file we parse
if (skinfile == NULL)
}
skinframe_t;
-#define MAX_SKINS 256
-
struct md3vertex_s;
struct trivertx_s;
typedef struct texvecvertex_s
#define MAX_NUM_ARGVS 50
+#ifdef DP_SMALLMEMORY
+#define MAX_INPUTLINE 1024
+#define CON_TEXTSIZE 16384
+#define CON_MAXLINES 256
+#define HIST_TEXTSIZE 2048
+#define HIST_MAXLINES 16
+#define MAX_ALIAS_NAME 32
+#define CMDBUFSIZE 8192
+#define MAX_ARGS 10
+
+#define NET_MAXMESSAGE 8192
+#define MAX_PACKETFRAGMENT 1024
+#define MAX_EDICTS 4096
+#define MAX_MODELS 1024
+#define MAX_SOUNDS 1024
+#define MAX_LIGHTSTYLES 64
+#define MAX_STYLESTRING 16
+#define MAX_SCOREBOARD 32
+#define MAX_SCOREBOARDNAME 64
+#define MAX_USERINFO_STRING 196
+#define MAX_SERVERINFO_STRING 512
+#define MAX_LOCALINFO_STRING 1 // not actually used by DP servers
+#define CL_MAX_USERCMDS 32
+#define CVAR_HASHSIZE 1024
+#define M_MAX_EDICTS 4096
+#define MAX_DEMOS 8
+#define MAX_DEMONAME 16
+#define MAX_SAVEGAMES 12
+#define SAVEGAME_COMMENT_LENGTH 39
+#define MAX_CLIENTNETWORKEYES 1
+
+#define MAX_WATERPLANES 2
+#define MAX_CUBEMAPS 64
+//#define MAX_EXPLOSIONS 64
+#define MAX_DLIGHTS 16
+#define MAX_CACHED_PICS 128 // this is 144 bytes each (or 152 on 64bit)
+#define CACHEPICHASHSIZE 256
+#define MAX_PARTICLEEFFECTNAME 64
+#define MAX_PARTICLEEFFECTINFO 256
+#define MAX_PARTICLETEXTURES 96
+#define MAXCLVIDEOS 1
+#define MAX_GECKO_INSTANCES 1
+#define MAX_DYNAMIC_TEXTURE_COUNT 2
+#define MAX_MAP_LEAFS 8192
+
+//#define MAXTRACKS 256
+#define MAX_DYNAMIC_CHANNELS 64
+#define MAX_CHANNELS 260
+#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 CON_MAXLINES 16384 ///< max scrollback buffer lines in console
+#define HIST_TEXTSIZE 262144 ///< max command history buffer characters in console
+#define HIST_MAXLINES 4096 ///< max command history buffer lines in console
+#define MAX_ALIAS_NAME 32
+#define CMDBUFSIZE 655360 ///< maximum script size that can be loaded by the exec command (8192 in Quake)
+#define MAX_ARGS 80 ///< maximum number of parameters to a console command or alias
+
+#define NET_MAXMESSAGE 65536 ///< max reliable packet size (sent as multiple fragments of MAX_PACKETFRAGMENT)
+#define MAX_PACKETFRAGMENT 1024 ///< max length of packet fragment
+#define MAX_EDICTS 32768 ///< max number of objects in game world at once (32768 protocol limit)
+#define MAX_MODELS 8192 ///< max number of models loaded at once (including during level transitions)
+#define MAX_SOUNDS 4096 ///< max number of sounds loaded at once
+#define MAX_LIGHTSTYLES 256 ///< max flickering light styles in level (note: affects savegame format)
+#define MAX_STYLESTRING 64 ///< max length of flicker pattern for light style
+#define MAX_SCOREBOARD 255 ///< max number of players in game at once (255 protocol limit)
+#define MAX_SCOREBOARDNAME 64 ///< max length of player name in game
+#define MAX_USERINFO_STRING 1280 ///< max length of infostring for PROTOCOL_QUAKEWORLD (196 in QuakeWorld)
+#define MAX_SERVERINFO_STRING 1280 ///< max length of server infostring for PROTOCOL_QUAKEWORLD (512 in QuakeWorld)
+#define MAX_LOCALINFO_STRING 32768 ///< max length of server-local infostring for PROTOCOL_QUAKEWORLD (32768 in QuakeWorld)
+#define CL_MAX_USERCMDS 128 ///< max number of predicted input packets in queue
+#define CVAR_HASHSIZE 65536 ///< number of hash buckets for accelerating cvar name lookups
+#define M_MAX_EDICTS 32768 ///< max objects in menu vm
+#define MAX_DEMOS 8 ///< max demos provided to demos command
+#define MAX_DEMONAME 16 ///< max demo name length for demos command
+#define MAX_SAVEGAMES 12 ///< max savegames listed in savegame menu
+#define SAVEGAME_COMMENT_LENGTH 39 ///< max comment length of savegame in menu
+#define MAX_CLIENTNETWORKEYES 1 ///< max number of locations that can be added to pvs when culling network entities
+
+#define MAX_WATERPLANES 16 ///< max number of water planes visible (each one causes additional view renders)
+#define MAX_CUBEMAPS 256 ///< max number of cubemap textures loaded for light filters
+#define MAX_EXPLOSIONS 64 ///< max number of explosion shell effects active at once (not particle related)
+#define MAX_DLIGHTS 256 ///< max number of dynamic lights (rocket flashes, etc) in scene at once
+#define MAX_CACHED_PICS 1024 ///< max number of 2D pics loaded at once
+#define CACHEPICHASHSIZE 256 ///< number of hash buckets for accelerating 2D pic name lookups
+#define MAX_PARTICLEEFFECTNAME 256 ///< maximum number of unique names of particle effects (for particleeffectnum)
+#define MAX_PARTICLEEFFECTINFO 4096 ///< maximum number of unique particle effects (each name may associate with several of these)
+#define MAX_PARTICLETEXTURES 1024 ///< maximum number of unique particle textures in the particle font
+#define MAXCLVIDEOS 65 ///< maximum number of video streams being played back at once (1 is reserved for the playvideo command)
+#define MAX_GECKO_INSTANCES 16 ///< maximum number of web browser textures active at once
+#define MAX_DYNAMIC_TEXTURE_COUNT 64 ///< maximum number of dynamic textures (web browsers, playvideo, etc)
+#define MAX_MAP_LEAFS 65536 ///< maximum number of BSP leafs in world (8192 in Quake)
+
+#define MAXTRACKS 256 ///< max CD track index
+// 0 to NUM_AMBIENTS - 1 = water, etc
+// NUM_AMBIENTS to NUM_AMBIENTS + MAX_DYNAMIC_CHANNELS - 1 = normal entity sounds
+// NUM_AMBIENTS + MAX_DYNAMIC_CHANNELS to total_channels = static sounds
+#define MAX_DYNAMIC_CHANNELS 512
+#define MAX_CHANNELS 1028
+#endif
-#define MAX_QPATH 128 ///< max length of a quake game pathname
-#define MAX_OSPATH 1024 ///< max length of a filesystem pathname
-#define ON_EPSILON 0.1 ///< point on plane side epsilon
+#define CMD_TOKENIZELENGTH (MAX_INPUTLINE + MAX_ARGS) ///< maximum tokenizable commandline length (counting trailing 0)
-#define MAX_PACKETFRAGMENT 1024 ///< max length of packet fragment
-#define NET_MAXMESSAGE 65536
-#define NET_MINRATE 1000 ///< limits "rate" and "sv_maxrate" cvars
-//
-// per-level limits
-//
-// LordHavoc: increased entity limit to 2048 from 600
-#define MAX_EDICTS 32768 // FIXME: ouch! ouch! ouch!
-#define MAX_LIGHTSTYLES 256 // LordHavoc: increased from 64, NOTE special consideration is needed in savegames!
-// LordHavoc: increased model and sound limits from 256 and 256 to 4096 and 4096 (and added protocol extensions accordingly to break the 256 barrier)
-// div0: increased model limit to 8192
-#define MAX_MODELS 8192
-#define MAX_SOUNDS 4096
+#define MAX_QPATH 128 ///< max length of a quake game pathname
+#ifdef PATH_MAX
+#define MAX_OSPATH PATH_MAX
+#elif MAX_PATH
+#define MAX_OSPATH MAX_PATH
+#else
+#define MAX_OSPATH 1024 ///< max length of a filesystem pathname
+#endif
-#define SAVEGAME_COMMENT_LENGTH 39
+#define ON_EPSILON 0.1 ///< point on plane side epsilon
-#define MAX_STYLESTRING 64
+#define NET_MINRATE 1000 ///< limits "rate" and "sv_maxrate" cvars
//
// stats are integers communicated to the client by the server
//===========================================
-// LordHavoc: increased player limit from 16 to 255
-#define MAX_SCOREBOARD 255
-// LordHavoc: increased name limit from 32 to 64 characters
-#define MAX_SCOREBOARDNAME 64
-// infostring sizes used by QuakeWorld support
-// was 196
-#define MAX_USERINFO_STRING 1280
-// was 512
-#define MAX_SERVERINFO_STRING 1280
-#define MAX_LOCALINFO_STRING 32768
-
#include "zone.h"
#include "fs.h"
#include "common.h"
#include "quakedef.h"
#include "cl_collision.h"
-#define MAX_EXPLOSIONS 64
+#ifdef MAX_EXPLOSIONS
#define EXPLOSIONGRID 8
#define EXPLOSIONVERTS ((EXPLOSIONGRID+1)*(EXPLOSIONGRID+1))
#define EXPLOSIONTRIS (EXPLOSIONGRID*EXPLOSIONGRID*2)
static rtexture_t *explosiontexturefog;
static rtexturepool_t *explosiontexturepool;
+#endif
cvar_t r_explosionclip = {CVAR_SAVE, "r_explosionclip", "1", "enables collision detection for explosion shell (so that it flattens against walls and floors)"};
+#ifdef MAX_EXPLOSIONS
static cvar_t r_drawexplosions = {0, "r_drawexplosions", "1", "enables rendering of explosion shells (see also cl_particles_explosions_shell)"};
static void r_explosion_start(void)
explosionnoiseindex[i] = (row % EXPLOSIONGRID) * EXPLOSIONGRID + (column % EXPLOSIONGRID);
return i;
}
+#endif
void R_Explosion_Init(void)
{
+#ifdef MAX_EXPLOSIONS
int i, x, y;
i = 0;
for (y = 0;y < EXPLOSIONGRID;y++)
}
}
+#endif
Cvar_RegisterVariable(&r_explosionclip);
+#ifdef MAX_EXPLOSIONS
Cvar_RegisterVariable(&r_drawexplosions);
R_RegisterModule("R_Explosions", r_explosion_start, r_explosion_shutdown, r_explosion_newmap);
+#endif
}
void R_NewExplosion(const vec3_t org)
{
+#ifdef MAX_EXPLOSIONS
int i, j;
float dist, n;
explosion_t *e;
break;
}
}
+#endif
}
+#ifdef MAX_EXPLOSIONS
static void R_DrawExplosion_TransparentCallback(const entity_render_t *ent, const rtlight_t *rtlight, int numsurfaces, int *surfacelist)
{
int surfacelistindex = 0;
}
}
}
+#endif
void R_DrawExplosions(void)
{
+#ifdef MAX_EXPLOSIONS
int i;
if (!r_drawexplosions.integer)
}
while (numexplosions > 0 && explosion[i-1].alpha <= 0)
numexplosions--;
+#endif
}
#include "quakedef.h"
-#define MAXRENDERMODULES 64
+#define MAXRENDERMODULES 20
typedef struct rendermodule_s
{
}
cubemapinfo_t;
-#define MAX_CUBEMAPS 256
static int numcubemaps;
static cubemapinfo_t cubemaps[MAX_CUBEMAPS];
rtexture_t *texture_reflection;
mplane_t plane;
int materialflags; // combined flags of all water surfaces on this plane
- unsigned char pvsbits[(32768+7)>>3]; // FIXME: buffer overflow on huge maps
+ unsigned char pvsbits[(MAX_MAP_LEAFS+7)>>3]; // FIXME: buffer overflow on huge maps
qboolean pvsvalid;
}
r_waterstate_waterplane_t;
-#define MAX_WATERPLANES 16
-
typedef struct r_waterstate_s
{
qboolean enabled;
}
server_connectfloodaddress_t;
-#define MAX_CLIENTNETWORKEYES 256
-
typedef struct server_s
{
/// false if only a net client
// update sound origin if we know about the entity
if (ch->entnum > 0 && cls.state == ca_connected && cl_gameplayfix_soundsmovewithentities.integer)
{
- if (ch->entnum >= 32768)
+ if (ch->entnum >= MAX_EDICTS)
{
//Con_Printf("-- entnum %i origin %f %f %f neworigin %f %f %f\n", ch->entnum, ch->origin[0], ch->origin[1], ch->origin[2], cl.entities[ch->entnum].state_current.origin[0], cl.entities[ch->entnum].state_current.origin[1], cl.entities[ch->entnum].state_current.origin[2]);
- if (ch->entnum > 32768)
+ if (ch->entnum > MAX_EDICTS)
if (!CL_VM_GetEntitySoundOrigin(ch->entnum, ch->origin))
- ch->entnum = 32768; // entity was removed, disown sound
+ ch->entnum = MAX_EDICTS; // entity was removed, disown sound
}
else if (cl.entities[ch->entnum].state_current.active)
{
mastervol *= snd_staticvolume.value;
else if(!(ch->flags & CHANNELFLAG_FULLVOLUME)) // same as SND_PaintChannel uses
{
- if(ch->entnum >= 32768)
+ if(ch->entnum >= MAX_EDICTS)
{
switch(ch->entchannel)
{
snd_fetcher_getfmt_t getfmt;
};
-// 0 to NUM_AMBIENTS - 1 = water, etc
-// NUM_AMBIENTS to NUM_AMBIENTS + MAX_DYNAMIC_CHANNELS - 1 = normal entity sounds
-// NUM_AMBIENTS + MAX_DYNAMIC_CHANNELS to total_channels = static sounds
-#define MAX_DYNAMIC_CHANNELS 512
-#define MAX_CHANNELS 1028
-
extern unsigned int total_channels;
extern channel_t channels[MAX_CHANNELS];
#if 1
unsigned char *pvs;
#else
- static int fatpvsbytes;
- static unsigned char fatpvs[MAX_MAP_LEAFS/8];
+ int fatpvsbytes;
+ unsigned char fatpvs[MAX_MAP_LEAFS/8];
#endif
VM_SAFEPARMCOUNT(2, VM_SV_checkpvs);