From: divverent Date: Sat, 24 Apr 2010 20:42:51 +0000 (+0000) Subject: mode "developer -1" that behaves like old "developer 0" (also suppresses logging... X-Git-Tag: xonotic-v0.1.0preview~230^2~374 X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=016c63753d2811583fa86cfcee0a58cb7c57392b;p=xonotic%2Fdarkplaces.git mode "developer -1" that behaves like old "developer 0" (also suppresses logging and buffering the messages) git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@10103 d7cf8633-e32d-0410-b094-e92efae38249 --- diff --git a/console.c b/console.c index 455b6c33..dd3137dd 100644 --- a/console.c +++ b/console.c @@ -1325,6 +1325,9 @@ Con_DPrint */ void Con_DPrint(const char *msg) { + if(developer.integer < 0) // at 0, we still add to the buffer but hide + return; + Con_MaskPrint(CON_MASK_DEVELOPER, msg); } @@ -1338,6 +1341,9 @@ void Con_DPrintf(const char *fmt, ...) va_list argptr; char msg[MAX_INPUTLINE]; + if(developer.integer < 0) // at 0, we still add to the buffer but hide + return; + va_start(argptr,fmt); dpvsnprintf(msg,sizeof(msg),fmt,argptr); va_end(argptr); @@ -1768,7 +1774,7 @@ The typing input line at the bottom should only be drawn if typing is allowed void Con_DrawConsole (int lines) { int mask_must = 0; - int mask_mustnot = developer.integer ? 0 : CON_MASK_DEVELOPER; + int mask_mustnot = (developer.integer>0) ? 0 : CON_MASK_DEVELOPER; cachepic_t *conbackpic; if (lines <= 0) diff --git a/host.c b/host.c index 58a212b3..feafe69a 100644 --- a/host.c +++ b/host.c @@ -72,7 +72,7 @@ cvar_t cl_maxfps = {CVAR_SAVE, "cl_maxfps", "0", "maximum fps cap, 0 = unlimited cvar_t cl_maxfps_alwayssleep = {0, "cl_maxfps_alwayssleep","1", "gives up some processing time to other applications each frame, value in milliseconds, disabled if cl_maxfps is 0"}; cvar_t cl_maxidlefps = {CVAR_SAVE, "cl_maxidlefps", "20", "maximum fps cap when the game is not the active window (makes cpu time available to other programs"}; -cvar_t developer = {CVAR_SAVE, "developer","0", "prints debugging messages and information (recommended for all developers and level designers)"}; +cvar_t developer = {CVAR_SAVE, "developer","0", "shows debugging messages and information (recommended for all developers and level designers); the value -1 also suppresses buffering and logging these messages"}; cvar_t developer_extra = {0, "developer_extra", "0", "prints additional debugging messages, often very verbose!"}; cvar_t developer_insane = {0, "developer_insane", "0", "prints huge streams of information about internal workings, entire contents of files being read/written, etc. Not recommended!"}; cvar_t developer_loadfile = {0, "developer_loadfile","0", "prints name and size of every file loaded via the FS_LoadFile function (which is almost everything)"}; diff --git a/libcurl.c b/libcurl.c index baa7f958..0efac5e8 100644 --- a/libcurl.c +++ b/libcurl.c @@ -1311,7 +1311,7 @@ Curl_downloadinfo_t *Curl_GetDownloadInfo(int *nDownloads, const char **addition for(di = downloads; di; di = di->next) { // do not show infobars for background downloads - if(!developer.integer) + if(developer.integer <= 0) if(di->buffer) continue; strlcpy(downinfo[i].filename, di->filename, sizeof(downinfo[i].filename)); diff --git a/prvm_cmds.c b/prvm_cmds.c index 83eb617c..f93133e6 100644 --- a/prvm_cmds.c +++ b/prvm_cmds.c @@ -973,12 +973,12 @@ void VM_remove (void) ed = PRVM_G_EDICT(OFS_PARM0); if( PRVM_NUM_FOR_EDICT(ed) <= prog->reserved_edicts ) { - if (developer.integer) + if (developer.integer > 0) VM_Warning( "VM_remove: tried to remove the null entity or a reserved entity!\n" ); } else if( ed->priv.required->free ) { - if (developer.integer) + if (developer.integer > 0) VM_Warning( "VM_remove: tried to remove an already freed entity!\n" ); } else diff --git a/prvm_edict.c b/prvm_edict.c index 730a2a99..56a1e3f4 100644 --- a/prvm_edict.c +++ b/prvm_edict.c @@ -1486,7 +1486,7 @@ void PRVM_ED_LoadFromFile (const char *data) } else { - if (developer.integer) // don't confuse non-developers with errors + if (developer.integer > 0) // don't confuse non-developers with errors { Con_Print("No spawn function for:\n"); PRVM_ED_Print(ent, NULL); diff --git a/sv_main.c b/sv_main.c index fb0be740..40d7e6dd 100644 --- a/sv_main.c +++ b/sv_main.c @@ -3090,7 +3090,7 @@ void SV_SpawnServer (const char *server) // free q3 shaders so that any newly downloaded shaders will be active Mod_FreeQ3Shaders(); - worldmodel = Mod_ForName(modelname, false, developer.integer != 0, NULL); + worldmodel = Mod_ForName(modelname, false, developer.integer > 0, NULL); if (!worldmodel || !worldmodel->TraceBox) { Con_Printf("Couldn't load map %s\n", modelname); diff --git a/sv_user.c b/sv_user.c index 3f68714b..fcfc4de2 100644 --- a/sv_user.c +++ b/sv_user.c @@ -877,7 +877,7 @@ void SV_ReadClientMessage(void) clc_stringcmd_invalid: Con_Printf("Received invalid stringcmd from %s\n", host_client->name); - if(developer.integer) + if(developer.integer > 0) Com_HexDumpToConsole((unsigned char *) s, strlen(s)); break; diff --git a/zone.c b/zone.c index e18c6ae5..ddc7d100 100644 --- a/zone.c +++ b/zone.c @@ -329,7 +329,7 @@ void *_Mem_Alloc(mempool_t *pool, void *olddata, size_t size, size_t alignment, Sys_Error("Mem_Alloc: pool == NULL (alloc at %s:%i)", filename, fileline); if (developer_memory.integer) Con_DPrintf("Mem_Alloc: pool %s, file %s:%i, size %i bytes\n", pool->name, filename, fileline, (int)size); - //if (developer.integer && developer_memorydebug.integer) + //if (developer.integer > 0 && developer_memorydebug.integer) // _Mem_CheckSentinelsGlobal(filename, fileline); pool->totalsize += size; realsize = alignment + sizeof(memheader_t) + size + sizeof(sentinel2);