From cb0357e98c878551affc0ef50ed70ba8f6c361d4 Mon Sep 17 00:00:00 2001 From: ewasylishen Date: Mon, 25 May 2015 01:48:03 +0000 Subject: [PATCH] Make "exceeds standard limit of" messages only display when developer cvar is set, with a new Con_DWarning function. Have heard these are confusing players and mappers/modders; people assume there is an error or a limit in QS is exceeded, but the messages are only about exceeding the limits in vanilla WinQuake/GLQuake. git-svn-id: svn+ssh://svn.code.sf.net/p/quakespasm/code/trunk@1211 af15c1b1-3010-417e-b628-4374ebc0bcbd --- quakespasm/Quake/cl_main.c | 4 ++-- quakespasm/Quake/cl_parse.c | 6 +++--- quakespasm/Quake/console.c | 25 +++++++++++++++++++++++++ quakespasm/Quake/console.h | 1 + quakespasm/Quake/gl_model.c | 10 +++++----- quakespasm/Quake/gl_refrag.c | 2 +- quakespasm/Quake/host.c | 2 +- quakespasm/Quake/pr_cmds.c | 4 ++-- quakespasm/Quake/r_brush.c | 2 +- quakespasm/Quake/sv_main.c | 4 ++-- 10 files changed, 43 insertions(+), 17 deletions(-) diff --git a/quakespasm/Quake/cl_main.c b/quakespasm/Quake/cl_main.c index 1ded2501..b022f733 100644 --- a/quakespasm/Quake/cl_main.c +++ b/quakespasm/Quake/cl_main.c @@ -633,13 +633,13 @@ int CL_ReadFromServer (void) //visedicts if (cl_numvisedicts > 256 && dev_peakstats.visedicts <= 256) - Con_Warning ("%i visedicts exceeds standard limit of 256.\n", cl_numvisedicts); + Con_DWarning ("%i visedicts exceeds standard limit of 256.\n", cl_numvisedicts); dev_stats.visedicts = cl_numvisedicts; dev_peakstats.visedicts = q_max(cl_numvisedicts, dev_peakstats.visedicts); //temp entities if (num_temp_entities > 64 && dev_peakstats.tempents <= 64) - Con_Warning ("%i tempentities exceeds standard limit of 64.\n", num_temp_entities); + Con_DWarning ("%i tempentities exceeds standard limit of 64.\n", num_temp_entities); dev_stats.tempents = num_temp_entities; dev_peakstats.tempents = q_max(num_temp_entities, dev_peakstats.tempents); diff --git a/quakespasm/Quake/cl_parse.c b/quakespasm/Quake/cl_parse.c index ffcea5a5..9d556776 100644 --- a/quakespasm/Quake/cl_parse.c +++ b/quakespasm/Quake/cl_parse.c @@ -326,7 +326,7 @@ void CL_ParseServerInfo (void) //johnfitz -- check for excessive models if (nummodels >= 256) - Con_Warning ("%i models exceeds standard limit of 256.\n", nummodels); + Con_DWarning ("%i models exceeds standard limit of 256.\n", nummodels); //johnfitz // precache sounds @@ -346,7 +346,7 @@ void CL_ParseServerInfo (void) //johnfitz -- check for excessive sounds if (numsounds >= 256) - Con_Warning ("%i sounds exceeds standard limit of 256.\n", numsounds); + Con_DWarning ("%i sounds exceeds standard limit of 256.\n", numsounds); //johnfitz // @@ -1128,7 +1128,7 @@ void CL_ParseServerMessage (void) if (i == 2) { if (cl.num_statics > 128) - Con_Warning ("%i static entities exceeds standard limit of 128.\n", cl.num_statics); + Con_DWarning ("%i static entities exceeds standard limit of 128.\n", cl.num_statics); R_CheckEfrags (); } //johnfitz diff --git a/quakespasm/Quake/console.c b/quakespasm/Quake/console.c index cdd4edc2..2fec31bd 100644 --- a/quakespasm/Quake/console.c +++ b/quakespasm/Quake/console.c @@ -519,6 +519,31 @@ void Con_Printf (const char *fmt, ...) } } +/* +================ +Con_DWarning -- ericw + +same as Con_Warning, but only prints if "developer" cvar is set. +use for "exceeds standard limit of" messages, which are only relevant for developers +targetting vanilla engines +================ +*/ +void Con_DWarning (const char *fmt, ...) +{ + va_list argptr; + char msg[MAXPRINTMSG]; + + if (!developer.value) + return; // don't confuse non-developers with techie stuff... + + va_start (argptr, fmt); + q_vsnprintf (msg, sizeof(msg), fmt, argptr); + va_end (argptr); + + Con_SafePrintf ("\x02Warning: "); + Con_Printf ("%s", msg); +} + /* ================ Con_Warning -- johnfitz -- prints a warning to the console diff --git a/quakespasm/Quake/console.h b/quakespasm/Quake/console.h index 7442cd7c..e4298f73 100644 --- a/quakespasm/Quake/console.h +++ b/quakespasm/Quake/console.h @@ -40,6 +40,7 @@ void Con_CheckResize (void); void Con_Init (void); void Con_DrawConsole (int lines, qboolean drawinput); void Con_Printf (const char *fmt, ...) __attribute__((__format__(__printf__,1,2))); +void Con_DWarning (const char *fmt, ...) __attribute__((__format__(__printf__,1,2))); //ericw void Con_Warning (const char *fmt, ...) __attribute__((__format__(__printf__,1,2))); //johnfitz void Con_DPrintf (const char *fmt, ...) __attribute__((__format__(__printf__,1,2))); void Con_DPrintf2 (const char *fmt, ...) __attribute__((__format__(__printf__,1,2))); //johnfitz diff --git a/quakespasm/Quake/gl_model.c b/quakespasm/Quake/gl_model.c index d6dc5584..7d75c1e4 100644 --- a/quakespasm/Quake/gl_model.c +++ b/quakespasm/Quake/gl_model.c @@ -1122,7 +1122,7 @@ void Mod_LoadFaces (lump_t *l, qboolean bsp2) //johnfitz -- warn mappers about exceeding old limits if (count > 32767 && !bsp2) - Con_Warning ("%i faces exceeds standard limit of 32767.\n", count); + Con_DWarning ("%i faces exceeds standard limit of 32767.\n", count); //johnfitz loadmodel->surfaces = out; @@ -1240,7 +1240,7 @@ void Mod_LoadNodes_S (lump_t *l) //johnfitz -- warn mappers about exceeding old limits if (count > 32767) - Con_Warning ("%i nodes exceeds standard limit of 32767.\n", count); + Con_DWarning ("%i nodes exceeds standard limit of 32767.\n", count); //johnfitz loadmodel->nodes = out; @@ -1591,7 +1591,7 @@ void Mod_LoadClipnodes (lump_t *l, qboolean bsp2) //johnfitz -- warn about exceeding old limits if (count > 32767 && !bsp2) - Con_Warning ("%i clipnodes exceeds standard limit of 32767.\n", count); + Con_DWarning ("%i clipnodes exceeds standard limit of 32767.\n", count); //johnfitz loadmodel->clipnodes = out; @@ -1745,7 +1745,7 @@ void Mod_LoadMarksurfaces (lump_t *l, int bsp2) //johnfitz -- warn mappers about exceeding old limits if (count > 32767) - Con_Warning ("%i marksurfaces exceeds standard limit of 32767.\n", count); + Con_DWarning ("%i marksurfaces exceeds standard limit of 32767.\n", count); //johnfitz for (i=0 ; ivisleafs, MAX_MAP_LEAFS, loadmodel->name); if (out->visleafs > 8192) - Con_Warning ("%i visleafs exceeds standard limit of 8192.\n", out->visleafs); + Con_DWarning ("%i visleafs exceeds standard limit of 8192.\n", out->visleafs); //johnfitz } diff --git a/quakespasm/Quake/gl_refrag.c b/quakespasm/Quake/gl_refrag.c index 3dfe8da6..be038113 100644 --- a/quakespasm/Quake/gl_refrag.c +++ b/quakespasm/Quake/gl_refrag.c @@ -178,7 +178,7 @@ void R_CheckEfrags (void) ; if (count > 640 && dev_peakstats.efrags <= 640) - Con_Warning ("%i efrags exceeds standard limit of 640.\n", count); + Con_DWarning ("%i efrags exceeds standard limit of 640.\n", count); dev_stats.efrags = count; dev_peakstats.efrags = q_max(count, dev_peakstats.efrags); diff --git a/quakespasm/Quake/host.c b/quakespasm/Quake/host.c index a347cfab..8670e58b 100644 --- a/quakespasm/Quake/host.c +++ b/quakespasm/Quake/host.c @@ -654,7 +654,7 @@ void Host_ServerFrame (void) active++; } if (active > 600 && dev_peakstats.edicts <= 600) - Con_Warning ("%i edicts exceeds standard limit of 600.\n", active); + Con_DWarning ("%i edicts exceeds standard limit of 600.\n", active); dev_stats.edicts = active; dev_peakstats.edicts = q_max(active, dev_peakstats.edicts); } diff --git a/quakespasm/Quake/pr_cmds.c b/quakespasm/Quake/pr_cmds.c index eb29c9a5..910c9409 100644 --- a/quakespasm/Quake/pr_cmds.c +++ b/quakespasm/Quake/pr_cmds.c @@ -64,8 +64,8 @@ static char *PF_VarString (int first) return out; } } - if (s > 255 && developer.value) - Con_Warning("PF_VarString: %i characters exceeds standard limit of 255.\n", (int) s); + if (s > 255) + Con_DWarning("PF_VarString: %i characters exceeds standard limit of 255.\n", (int) s); return out; } diff --git a/quakespasm/Quake/r_brush.c b/quakespasm/Quake/r_brush.c index e84a44e3..c4d8daa1 100644 --- a/quakespasm/Quake/r_brush.c +++ b/quakespasm/Quake/r_brush.c @@ -947,7 +947,7 @@ void GL_BuildLightmaps (void) //johnfitz -- warn about exceeding old limits if (i >= 64) - Con_Warning ("%i lightmaps exceeds standard limit of 64.\n", i); + Con_DWarning ("%i lightmaps exceeds standard limit of 64.\n", i); //johnfitz } diff --git a/quakespasm/Quake/sv_main.c b/quakespasm/Quake/sv_main.c index 347d8004..b5d11aca 100644 --- a/quakespasm/Quake/sv_main.c +++ b/quakespasm/Quake/sv_main.c @@ -700,7 +700,7 @@ void SV_WriteEntitiesToClient (edict_t *clent, sizebuf_t *msg) //johnfitz -- devstats stats: if (msg->cursize > 1024 && dev_peakstats.packetsize <= 1024) - Con_Warning ("%i byte packet exceeds standard limit of 1024.\n", msg->cursize); + Con_DWarning ("%i byte packet exceeds standard limit of 1024.\n", msg->cursize); dev_stats.packetsize = msg->cursize; dev_peakstats.packetsize = q_max(msg->cursize, dev_peakstats.packetsize); //johnfitz @@ -1422,7 +1422,7 @@ void SV_SpawnServer (const char *server) //johnfitz -- warn if signon buffer larger than standard server can handle if (sv.signon.cursize > 8000-2) //max size that will fit into 8000-sized client->message buffer with 2 extra bytes on the end - Con_Warning ("%i byte signon buffer exceeds standard limit of 7998.\n", sv.signon.cursize); + Con_DWarning ("%i byte signon buffer exceeds standard limit of 7998.\n", sv.signon.cursize); //johnfitz // send serverinfo to all connected clients