From: havoc Date: Tue, 4 Mar 2014 23:21:13 +0000 (+0000) Subject: increase MAX_PARTICLEEFFECTNAME and MAX_PARTICLEEFFECTINFO limits X-Git-Tag: xonotic-v0.8.1~29^2~103 X-Git-Url: http://de.git.xonotic.org/?p=xonotic%2Fdarkplaces.git;a=commitdiff_plain;h=446a6bb71c7ac5f1d7fe4dc1f6b41d0f01f4a91a;hp=dd2a1456eec1f8bbf7a0cc99e13e941e2d179d15 increase MAX_PARTICLEEFFECTNAME and MAX_PARTICLEEFFECTINFO limits (formerly 256,4096 and now 4096,8192) git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@12055 d7cf8633-e32d-0410-b094-e92efae38249 --- diff --git a/cl_screen.c b/cl_screen.c index f476d3c0..17ad5a7f 100644 --- a/cl_screen.c +++ b/cl_screen.c @@ -108,6 +108,8 @@ cvar_t r_speeds_graph_x = {CVAR_SAVE, "r_speeds_graph_x", "0", "position of grap cvar_t r_speeds_graph_y = {CVAR_SAVE, "r_speeds_graph_y", "0", "position of graph"}; cvar_t r_speeds_graph_width = {CVAR_SAVE, "r_speeds_graph_width", "256", "size of graph"}; cvar_t r_speeds_graph_height = {CVAR_SAVE, "r_speeds_graph_height", "128", "size of graph"}; +cvar_t r_speeds_graph_maxtimedelta = {CVAR_SAVE, "r_speeds_graph_maxtimedelta", "16667", "maximum timedelta to display in the graph (this value will be the top line)"}; +cvar_t r_speeds_graph_maxdefault = {CVAR_SAVE, "r_speeds_graph_maxdefault", "100", "if the minimum and maximum observed values are closer than this, use this value as the graph range (keeps small numbers from being big graphs)"}; @@ -1095,7 +1097,7 @@ static void R_TimeReport_EndFrame(void) // if we currently have no graph data, reset the graph data entirely if (!cls.r_speeds_graph_data) for (i = 0;i < r_stat_count;i++) - cls.r_speeds_graph_datamin[i] = cls.r_speeds_graph_datamax[i] = r_refdef.stats[i]; + cls.r_speeds_graph_datamin[i] = cls.r_speeds_graph_datamax[i] = 0; if (cls.r_speeds_graph_length != r_speeds_graph_length.integer) { int i, stat, index, d, graph_length, *graph_data; @@ -1136,6 +1138,7 @@ static void R_TimeReport_EndFrame(void) int numlines; const int *data; float x, y, width, height, scalex, scaley; + int range_default = max(r_speeds_graph_maxdefault.integer, 1); int color, stat, stats, index, range_min, range_max; int graph_current, graph_length, *graph_data; int statindex[R_SPEEDS_GRAPH_COLORS]; @@ -1224,13 +1227,11 @@ static void R_TimeReport_EndFrame(void) continue; // prefer to graph stats with 0 base, but if they are // negative we have no choice - range_min = min(cls.r_speeds_graph_datamin[stat], 0); - range_max = cls.r_speeds_graph_datamax[stat]; + range_min = cls.r_speeds_graph_datamin[stat]; + range_max = max(cls.r_speeds_graph_datamax[stat], range_min + range_default); // some stats we specifically override the graph scale on if (stat == r_stat_timedelta) - range_max = 100000; - if (range_max == range_min) - range_max++; + range_max = r_speeds_graph_maxtimedelta.integer; scaley = height / (range_max - range_min); // generate lines (2 vertices each) // to deal with incomplete data we walk right to left @@ -1402,6 +1403,8 @@ void CL_Screen_Init(void) Cvar_RegisterVariable(&r_speeds_graph_y); Cvar_RegisterVariable(&r_speeds_graph_width); Cvar_RegisterVariable(&r_speeds_graph_height); + Cvar_RegisterVariable(&r_speeds_graph_maxtimedelta); + Cvar_RegisterVariable(&r_speeds_graph_maxdefault); // if we want no console, turn it off here too if (COM_CheckParm ("-noconsole")) diff --git a/quakedef.h b/quakedef.h index 61ab8491..5dd854a0 100644 --- a/quakedef.h +++ b/quakedef.h @@ -162,8 +162,8 @@ extern char engineversion[128]; #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_PARTICLEEFFECTNAME 4096 ///< maximum number of unique names of particle effects (for particleeffectnum) +#define MAX_PARTICLEEFFECTINFO 8192 ///< maximum number of unique particle effects (each name may associate with several of these) #define MAX_PARTICLETEXTURES 256 ///< 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_DYNAMIC_TEXTURE_COUNT 64 ///< maximum number of dynamic textures (web browsers, playvideo, etc) diff --git a/server.h b/server.h index e277e75e..ae32cb24 100644 --- a/server.h +++ b/server.h @@ -141,9 +141,8 @@ typedef struct server_s server_floodaddress_t connectfloodaddresses[MAX_CONNECTFLOODADDRESSES]; server_floodaddress_t getstatusfloodaddresses[MAX_GETSTATUSFLOODADDRESSES]; -#define SV_MAX_PARTICLEEFFECTNAME 256 qboolean particleeffectnamesloaded; - char particleeffectname[SV_MAX_PARTICLEEFFECTNAME][MAX_QPATH]; + char particleeffectname[MAX_PARTICLEEFFECTNAME][MAX_QPATH]; int writeentitiestoclient_stats_culled_pvs; int writeentitiestoclient_stats_culled_trace; diff --git a/sv_main.c b/sv_main.c index bb46182e..5fcbae2e 100644 --- a/sv_main.c +++ b/sv_main.c @@ -3011,7 +3011,7 @@ int SV_ParticleEffectIndex(const char *name) { if (argc == 2) { - for (effectnameindex = 1;effectnameindex < SV_MAX_PARTICLEEFFECTNAME;effectnameindex++) + for (effectnameindex = 1;effectnameindex < MAX_PARTICLEEFFECTNAME;effectnameindex++) { if (sv.particleeffectname[effectnameindex][0]) { @@ -3025,7 +3025,7 @@ int SV_ParticleEffectIndex(const char *name) } } // if we run out of names, abort - if (effectnameindex == SV_MAX_PARTICLEEFFECTNAME) + if (effectnameindex == MAX_PARTICLEEFFECTNAME) { Con_Printf("%s:%i: too many effects!\n", filename, linenumber); break; @@ -3037,7 +3037,7 @@ int SV_ParticleEffectIndex(const char *name) } } // search for the name - for (effectnameindex = 1;effectnameindex < SV_MAX_PARTICLEEFFECTNAME && sv.particleeffectname[effectnameindex][0];effectnameindex++) + for (effectnameindex = 1;effectnameindex < MAX_PARTICLEEFFECTNAME && sv.particleeffectname[effectnameindex][0];effectnameindex++) if (!strcmp(sv.particleeffectname[effectnameindex], name)) return effectnameindex; // return 0 if we couldn't find it