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://svn.code.sf.net/p/quakespasm/code/trunk/quakespasm@1211 af15c1b1-3010-417e-b628-4374ebc0bcbd
This commit is contained in:
Eric Wasylishen 2015-05-25 01:48:03 +00:00
parent 95e0be7afe
commit 1f3c1a711a
10 changed files with 43 additions and 17 deletions

View file

@ -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);

View file

@ -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

View file

@ -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

View file

@ -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

View file

@ -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 ; i<count ; i++)
@ -1880,7 +1880,7 @@ void Mod_LoadSubmodels (lump_t *l)
Sys_Error ("Mod_LoadSubmodels: too many visleafs (%d, max = %d) in %s", out->visleafs, 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
}

View file

@ -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);

View file

@ -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);
}

View file

@ -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;
}

View file

@ -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
}

View file

@ -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