]> git.xonotic.org Git - xonotic/darkplaces.git/commitdiff
mode "developer -1" that behaves like old "developer 0" (also suppresses logging...
authordivverent <divverent@d7cf8633-e32d-0410-b094-e92efae38249>
Sat, 24 Apr 2010 20:42:51 +0000 (20:42 +0000)
committerdivverent <divverent@d7cf8633-e32d-0410-b094-e92efae38249>
Sat, 24 Apr 2010 20:42:51 +0000 (20:42 +0000)
git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@10103 d7cf8633-e32d-0410-b094-e92efae38249

console.c
host.c
libcurl.c
prvm_cmds.c
prvm_edict.c
sv_main.c
sv_user.c
zone.c

index 455b6c330acd901cf76a466ea1d2b4e747400754..dd3137dd18aeaaaf0cf0ac06fee32603da44f532 100644 (file)
--- 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 58a212b36b70cb43a8cd4966594919ee84dd61c4..feafe69a7d3c63d167a8a526d8b2f0a0890f05e4 100644 (file)
--- 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)"};
index baa7f958d9e50be783684d89d6f302582741ee0e..0efac5e87591b8e026603700024dcccec3ea280a 100644 (file)
--- 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));
index 83eb617c73ac90abb894f94d638d3d23101514ae..f93133e6bfe06fd6a9aa957229315d23f09e7bce 100644 (file)
@@ -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
index 730a2a990793ce074c4b235d3b002d1f5a51c455..56a1e3f400219b15af2753006ade47e4f816b3a9 100644 (file)
@@ -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);
index fb0be74065f0260c084673b419664649fbc13eb5..40d7e6dde3027da56593fb8331873e83b6505dc9 100644 (file)
--- 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);
index 3f68714b15eab2cecf6277a7b437b8af3c79d4ff..fcfc4de2326cfc07a4db38b9c4782f5a973e57cc 100644 (file)
--- 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 e18c6ae5a955cb6eadc8ec1207e077017682fa87..ddc7d1003ba4cdb93f711d77c4f3401c1df9143e 100644 (file)
--- 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);