summary |
shortlog |
log |
commit | commitdiff |
tree
raw |
patch |
inline | side by side (from parent 1:
dd2a145)
(formerly 256,4096 and now 4096,8192)
git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@12055
d7cf8633-e32d-0410-b094-
e92efae38249
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_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)"};
// 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++)
// 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;
if (cls.r_speeds_graph_length != r_speeds_graph_length.integer)
{
int i, stat, index, d, graph_length, *graph_data;
int numlines;
const int *data;
float x, y, width, height, scalex, scaley;
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];
int color, stat, stats, index, range_min, range_max;
int graph_current, graph_length, *graph_data;
int statindex[R_SPEEDS_GRAPH_COLORS];
continue;
// prefer to graph stats with 0 base, but if they are
// negative we have no choice
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)
// 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
scaley = height / (range_max - range_min);
// generate lines (2 vertices each)
// to deal with incomplete data we walk right to left
Cvar_RegisterVariable(&r_speeds_graph_y);
Cvar_RegisterVariable(&r_speeds_graph_width);
Cvar_RegisterVariable(&r_speeds_graph_height);
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"))
// if we want no console, turn it off here too
if (COM_CheckParm ("-noconsole"))
#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_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)
#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)
server_floodaddress_t connectfloodaddresses[MAX_CONNECTFLOODADDRESSES];
server_floodaddress_t getstatusfloodaddresses[MAX_GETSTATUSFLOODADDRESSES];
server_floodaddress_t connectfloodaddresses[MAX_CONNECTFLOODADDRESSES];
server_floodaddress_t getstatusfloodaddresses[MAX_GETSTATUSFLOODADDRESSES];
-#define SV_MAX_PARTICLEEFFECTNAME 256
qboolean particleeffectnamesloaded;
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;
int writeentitiestoclient_stats_culled_pvs;
int writeentitiestoclient_stats_culled_trace;
- for (effectnameindex = 1;effectnameindex < SV_MAX_PARTICLEEFFECTNAME;effectnameindex++)
+ for (effectnameindex = 1;effectnameindex < MAX_PARTICLEEFFECTNAME;effectnameindex++)
{
if (sv.particleeffectname[effectnameindex][0])
{
{
if (sv.particleeffectname[effectnameindex][0])
{
}
}
// if we run out of names, abort
}
}
// 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;
{
Con_Printf("%s:%i: too many effects!\n", filename, linenumber);
break;
}
}
// search for the 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
if (!strcmp(sv.particleeffectname[effectnameindex], name))
return effectnameindex;
// return 0 if we couldn't find it