]> git.rm.cloudns.org Git - xonotic/darkplaces.git/commitdiff
Remove Con_Warnf and Errorf. Use macros to change color and identify the message
authorcloudwalk <cloudwalk@d7cf8633-e32d-0410-b094-e92efae38249>
Sat, 27 Jun 2020 04:29:43 +0000 (04:29 +0000)
committercloudwalk <cloudwalk@d7cf8633-e32d-0410-b094-e92efae38249>
Sat, 27 Jun 2020 04:29:43 +0000 (04:29 +0000)
git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@12744 d7cf8633-e32d-0410-b094-e92efae38249

36 files changed:
cap_avi.c
cl_demo.c
cl_main.c
cl_parse.c
cl_screen.c
cl_video.c
cl_video_libavw.c
clvm_cmds.c
cmd.c
console.c
console.h
csprogs.c
fs.c
ft2.c
gl_backend.c
gl_draw.c
gl_rmain.c
host.c
image_png.c
lhnet.c
model_brush.c
model_sprite.c
netconn.c
protocol.c
prvm_cmds.c
r_sky.c
snd_sdl.c
sv_demo.c
sv_save.c
sys_linux.c
sys_sdl.c
sys_shared.c
sys_win.c
vid_sdl.c
wad.c
world.c

index 063ee097eaae8e3b46357a4e8f49f3569c557ac3..029e4e19cc3a3fa3a0390766ae472dbdc3d37018 100644 (file)
--- a/cap_avi.c
+++ b/cap_avi.c
@@ -147,7 +147,7 @@ static void SCR_CaptureVideo_RIFF_Pop(void)
                if(sizehint != -1)
                {
                        int i;
-                       Con_Warnf("WARNING: invalid size hint %d when writing video data (actual size: %d)\n", (int) sizehint, x);
+                       Con_Printf(CON_WARN "WARNING: invalid size hint %d when writing video data (actual size: %d)\n", (int) sizehint, x);
                        for(i = 0; i <= format->riffstacklevel; ++i)
                        {
                                Con_Printf("  RIFF level %d = %s\n", i, format->riffstackfourcc[i]);
index 1d14f718c1bfc11c981ed0ddc25b3ea24a268b11..e3e2eecb28c84136a17228e895e5e6b24d38ff9d 100644 (file)
--- a/cl_demo.c
+++ b/cl_demo.c
@@ -389,7 +389,7 @@ void CL_Record_f(cmd_state_t *cmd)
        cls.demofile = FS_OpenRealFile(name, "wb", false);
        if (!cls.demofile)
        {
-               Con_Error("ERROR: couldn't open.\n");
+               Con_Print(CON_ERROR "ERROR: couldn't open.\n");
                return;
        }
        strlcpy(cls.demoname, name, sizeof(cls.demoname));
@@ -429,7 +429,7 @@ void CL_PlayDemo_f(cmd_state_t *cmd)
        f = FS_OpenVirtualFile(name, false);
        if (!f)
        {
-               Con_Errorf("ERROR: couldn't open %s.\n", name);
+               Con_Printf(CON_ERROR "ERROR: couldn't open %s.\n", name);
                cls.demonum = -1;               // stop demo loop
                return;
        }
index 77467bfbce3285e5a0d9651cb5ea99360ed29398..1f079bb7b5fd1621abcf534a2b6d6511940e9afa 100644 (file)
--- a/cl_main.c
+++ b/cl_main.c
@@ -2268,7 +2268,7 @@ static void CL_Locs_Save_f(cmd_state_t *cmd)
                        if (VectorCompare(loc->mins, loc->maxs))
                                break;
                if (loc)
-                       Con_Warnf("Warning: writing loc file containing a mixture of qizmo-style points and proquake-style boxes may not work in qizmo or proquake!\n");
+                       Con_Printf(CON_WARN "Warning: writing loc file containing a mixture of qizmo-style points and proquake-style boxes may not work in qizmo or proquake!\n");
        }
        for (loc = cl.locnodes;loc;loc = loc->next)
        {
index d3b0ea8a6ba37a6f9b24bd4eb08b261cc2084342..0ecfb69301d24188bad84db91ff9861f7c468ac9 100644 (file)
@@ -1948,7 +1948,7 @@ static void CL_ParseServerInfo (void)
                                cls.demo_lastcsprogscrc = -1;
                        }
                        else
-                               Con_Error ("ERROR: couldn't open.\n");
+                               Con_Print(CON_ERROR "ERROR: couldn't open.\n");
                }
        }
        cl.islocalgame = NetConn_IsLocalGame();
index 312c68e2f56b8cb6403b585b59aa58bfb1864caa..01a6fbdd1c27091dd95a747fc04c875abdc608fb 100644 (file)
@@ -1489,7 +1489,7 @@ void SCR_ScreenShot_f(cmd_state_t *cmd)
                Con_Printf("Wrote %s\n", filename);
        else
        {
-               Con_Errorf("Unable to write %s\n", filename);
+               Con_Printf(CON_ERROR "Unable to write %s\n", filename);
                if(jpeg || png)
                {
                        if(SCR_ScreenShot (filename, buffer1, buffer2, 0, 0, vid.width, vid.height, false, false, false, false, false, true, scr_screenshot_alpha.integer != 0))
index 286f0d9f8e2fc7c0c392736d15d8df85847fc214..dd29ee7d9b2a95176c61daa3b054feffabd79aff 100644 (file)
@@ -64,7 +64,7 @@ static qboolean OpenStream( clvideo_t * video )
        if (video->stream)
                return true;
 
-       Con_Errorf("unable to open \"%s\", error: %s\n", video->filename, errorstring);
+       Con_Printf(CON_ERROR "unable to open \"%s\", error: %s\n", video->filename, errorstring);
        return false;
 }
 
@@ -178,7 +178,7 @@ static void LoadSubtitles( clvideo_t *video, const char *subtitlesfile )
                // check limits
                if (video->subtitles == CLVIDEO_MAX_SUBTITLES)
                {
-                       Con_Warnf("WARNING: CLVIDEO_MAX_SUBTITLES = %i reached when reading subtitles from '%s'\n", CLVIDEO_MAX_SUBTITLES, subtitlesfile);
+                       Con_Printf(CON_WARN "WARNING: CLVIDEO_MAX_SUBTITLES = %i reached when reading subtitles from '%s'\n", CLVIDEO_MAX_SUBTITLES, subtitlesfile);
                        break;  
                }
                // add a sub
@@ -253,7 +253,7 @@ clvideo_t* CL_OpenVideo( const char *filename, const char *name, int owner, cons
 
        video = FindUnusedVid();
        if( !video ) {
-               Con_Errorf( "CL_OpenVideo: unable to open video \"%s\" - video limit reached\n", filename );
+               Con_Printf(CON_ERROR "CL_OpenVideo: unable to open video \"%s\" - video limit reached\n", filename );
                return NULL;
        }
        video = OpenVideo( video, filename, name, owner, subtitlesfile );
index 7fa50d81c0c25cf5844417f21fa0293bb45e4422..422af8a9bd2a3f663700eeb1637d0c78438097cd 100644 (file)
@@ -175,7 +175,7 @@ static int libavw_decodeframe(void *stream, void *imagedata, unsigned int Rmask,
                // got error or file end
                errorcode = qLibAvW_StreamGetError(s->stream);
                if (errorcode)
-                       Con_Errorf("LibAvW: %s\n", qLibAvW_ErrorString(errorcode));
+                       Con_Printf(CON_ERROR "LibAvW: %s\n", qLibAvW_ErrorString(errorcode));
                return 1;
        }
 
@@ -186,11 +186,11 @@ static int libavw_decodeframe(void *stream, void *imagedata, unsigned int Rmask,
                pixel_format = LIBAVW_PIXEL_FORMAT_BGR;
        else
        {
-               Con_Errorf("LibAvW: cannot determine pixel format for bpp %i\n", bytesperpixel);
+               Con_Printf(CON_ERROR "LibAvW: cannot determine pixel format for bpp %i\n", bytesperpixel);
                return 1;
        }
        if (!qLibAvW_PlayGetFrameImage(s->stream, pixel_format, imagedata, s->info_imagewidth, s->info_imageheight, min(9, max(0, cl_video_libavw_scaler.integer))))
-               Con_Errorf("LibAvW: %s\n", qLibAvW_ErrorString(qLibAvW_StreamGetError(s->stream)));
+               Con_Printf(CON_ERROR "LibAvW: %s\n", qLibAvW_ErrorString(qLibAvW_StreamGetError(s->stream)));
        return 0;
 }
 
@@ -343,13 +343,13 @@ static void *LibAvW_OpenVideo(clvideo_t *video, char *filename, const char **err
 static void libavw_message(int level, const char *message)
 {
        if (level == LIBAVW_PRINT_WARNING)
-               Con_Warnf("LibAvcodec warning: %s\n", message);
+               Con_Printf(CON_WARN "LibAvcodec warning: %s\n", message);
        else if (level == LIBAVW_PRINT_ERROR)
-               Con_Errorf("LibAvcodec error: %s\n", message);
+               Con_Printf(CON_ERROR "LibAvcodec error: %s\n", message);
        else if (level == LIBAVW_PRINT_FATAL)
-               Con_Errorf("LibAvcodec fatal error: %s\n", message);
+               Con_Printf(CON_ERROR "LibAvcodec fatal error: %s\n", message);
        else
-               Con_Errorf("LibAvcodec panic: %s\n", message);
+               Con_Printf(CON_ERROR "LibAvcodec panic: %s\n", message);
 }
 
 static qboolean LibAvW_OpenLibrary(void)
@@ -368,7 +368,7 @@ static qboolean LibAvW_OpenLibrary(void)
        // initialize libav wrapper
        if ((errorcode = qLibAvW_Init(&libavw_message)))
        {
-               Con_Errorf("LibAvW failed to initialize: %s\n", qLibAvW_ErrorString(errorcode));
+               Con_Printf(CON_ERROR "LibAvW failed to initialize: %s\n", qLibAvW_ErrorString(errorcode));
                Sys_UnloadLibrary(&libavw_dll);
        }
 
index 727af941ea3134f821d8d661ebf4a5276c78b730..dd8842df4189357f5103610f0935c1132361473a 100644 (file)
@@ -1872,7 +1872,7 @@ static void VM_CL_copyentity (prvm_prog_t *prog)
 static void VM_CL_effect (prvm_prog_t *prog)
 {
 #if 1
-       Con_Warnf("WARNING: VM_CL_effect not implemented\n"); // FIXME: this needs to take modelname not modelindex, the csqc defs has it as string and so it shall be
+       Con_Printf(CON_WARN "WARNING: VM_CL_effect not implemented\n"); // FIXME: this needs to take modelname not modelindex, the csqc defs has it as string and so it shall be
 #else
        vec3_t org;
        VM_SAFEPARMCOUNT(5, VM_CL_effect);
diff --git a/cmd.c b/cmd.c
index ea0b608eecfab77ade1a7bca311d3ce0ca4e85dc..64a90e26b008a509cb6927c4fa3d079e10514fbc 100644 (file)
--- a/cmd.c
+++ b/cmd.c
@@ -325,7 +325,7 @@ void Cbuf_Execute (cmd_state_t *cmd)
                // better than CRASHING on overlong input lines that may SOMEHOW enter the buffer
                if(i >= MAX_INPUTLINE)
                {
-                       Con_Warnf("Warning: console input buffer had an overlong line. Ignored.\n");
+                       Con_Printf(CON_WARN "Warning: console input buffer had an overlong line. Ignored.\n");
                        line[0] = 0;
                }
                else
@@ -1126,9 +1126,9 @@ static const char *Cmd_GetCvarValue(cmd_state_t *cmd, const char *var, size_t va
        {
                // empty cvar name?
                if(alias)
-                       Con_Warnf("Warning: Could not expand $ in alias %s\n", alias->name);
+                       Con_Printf(CON_WARN "Warning: Could not expand $ in alias %s\n", alias->name);
                else
-                       Con_Warnf("Warning: Could not expand $\n");
+                       Con_Printf(CON_WARN "Warning: Could not expand $\n");
                return "$";
        }
 
@@ -1174,9 +1174,9 @@ static const char *Cmd_GetCvarValue(cmd_state_t *cmd, const char *var, size_t va
                if(required)
                {
                        if(alias)
-                               Con_Errorf("Error: Could not expand $%s in alias %s\n", varname, alias->name);
+                               Con_Printf(CON_ERROR "Error: Could not expand $%s in alias %s\n", varname, alias->name);
                        else
-                               Con_Errorf("Error: Could not expand $%s\n", varname);
+                               Con_Printf(CON_ERROR "Error: Could not expand $%s\n", varname);
                        return NULL;
                }
                else if(optional)
@@ -1186,9 +1186,9 @@ static const char *Cmd_GetCvarValue(cmd_state_t *cmd, const char *var, size_t va
                else
                {
                        if(alias)
-                               Con_Warnf("Warning: Could not expand $%s in alias %s\n", varname, alias->name);
+                               Con_Printf(CON_WARN "Warning: Could not expand $%s in alias %s\n", varname, alias->name);
                        else
-                               Con_Warnf("Warning: Could not expand $%s\n", varname);
+                               Con_Printf(CON_WARN "Warning: Could not expand $%s\n", varname);
                        dpsnprintf(varval, sizeof(varval), "$%s", varname);
                        return varval;
                }
index 95aaa5a17365239e09cdeab0cc70fa2bc3079595..5bbf112cf1f9b03dda66377204fa0543b1cec4db 100644 (file)
--- a/console.c
+++ b/console.c
@@ -809,7 +809,7 @@ static void Con_ConDump_f(cmd_state_t *cmd)
        file = FS_OpenRealFile(Cmd_Argv(cmd, 1), "w", false);
        if (!file)
        {
-               Con_Errorf("condump: unable to write file \"%s\"\n", Cmd_Argv(cmd, 1));
+               Con_Printf(CON_ERROR "condump: unable to write file \"%s\"\n", Cmd_Argv(cmd, 1));
                return;
        }
        if (con_mutex) Thread_LockMutex(con_mutex);
@@ -1452,61 +1452,6 @@ void Con_Printf(const char *fmt, ...)
        Con_MaskPrint(CON_MASK_PRINT, msg);
 }
 
-/*
-================
-Con_Warn
-================
-*/
-void Con_Warn(const char *msg)
-{
-       Con_Printf("^3%s",msg);
-}
-
-/*
-================
-Con_Warnf
-================
-*/
-void Con_Warnf(const char *fmt, ...)
-{
-       va_list argptr;
-       char msg[MAX_INPUTLINE];
-
-       va_start(argptr,fmt);
-       dpvsnprintf(msg,sizeof(msg),fmt,argptr);
-       va_end(argptr);
-
-       Con_Printf("^3%s",msg);
-}
-
-/*
-================
-Con_Error
-================
-*/
-void Con_Error(const char *msg)
-{
-       Con_Printf("^1%s",msg);
-}
-
-/*
-================
-Con_Errorf
-================
-*/
-void Con_Errorf(const char *fmt, ...)
-{
-       va_list argptr;
-       char msg[MAX_INPUTLINE];
-
-       va_start(argptr,fmt);
-       dpvsnprintf(msg,sizeof(msg),fmt,argptr);
-       va_end(argptr);
-
-       Con_Printf("^1%s",msg);
-
-}
-
 /*
 ================
 Con_DPrint
index 8d1a64a5823c80c8b26b176a0a972c366be36c70..033c2754e254aa530382621dcf813bf2fab92ed3 100644 (file)
--- a/console.h
+++ b/console.h
@@ -51,14 +51,6 @@ void Con_Print(const char *txt);
 /// Prints to all appropriate console targets.
 void Con_Printf(const char *fmt, ...) DP_FUNC_PRINTF(1);
 
-/// Prints warnings
-void Con_Warn(const char *msg);
-void Con_Warnf(const char *fmt, ...);
-
-/// Prints errors
-void Con_Error(const char *msg);
-void Con_Errorf(const char *fmt, ...);
-
 /// A Con_Print that only shows up if the "developer" cvar is set.
 void Con_DPrint(const char *msg);
 
@@ -97,6 +89,9 @@ void Log_DestBuffer_Flush (void); ///< call this once per frame to send out repl
 void Log_Printf(const char *logfilename, const char *fmt, ...) DP_FUNC_PRINTF(2);
 //@}
 
+#define CON_WARN "^3"
+#define CON_ERROR "^1"
+
 // CON_MASK_PRINT is the default (Con_Print/Con_Printf)
 // CON_MASK_DEVELOPER is used by Con_DPrint/Con_DPrintf
 #define CON_MASK_HIDENOTIFY 128
index 23135e0bf983c4d119c29cc066deec23d2f18332..07087c9761ac0bf48dfe584f902d90d4e959d12a 100644 (file)
--- a/csprogs.c
+++ b/csprogs.c
@@ -1033,7 +1033,7 @@ void CL_VM_Init (void)
                {
                        if (cls.demoplayback)
                        {
-                               Con_Warnf("Warning: Your %s is not the same version as the demo was recorded with (CRC/size are %i/%i but should be %i/%i)\n", csqc_progname.string, csprogsdatacrc, (int)csprogsdatasize, requiredcrc, requiredsize);
+                               Con_Printf(CON_WARN "Warning: Your %s is not the same version as the demo was recorded with (CRC/size are %i/%i but should be %i/%i)\n", csqc_progname.string, csprogsdatacrc, (int)csprogsdatasize, requiredcrc, requiredsize);
                                // Mem_Free(csprogsdata);
                                // return;
                                // We WANT to continue here, and play the demo with different csprogs!
@@ -1042,7 +1042,7 @@ void CL_VM_Init (void)
                        else
                        {
                                Mem_Free(csprogsdata);
-                               Con_Errorf("Your %s is not the same version as the server (CRC is %i/%i but should be %i/%i)\n", csqc_progname.string, csprogsdatacrc, (int)csprogsdatasize, requiredcrc, requiredsize);
+                               Con_Printf(CON_ERROR "Your %s is not the same version as the server (CRC is %i/%i but should be %i/%i)\n", csqc_progname.string, csprogsdatacrc, (int)csprogsdatasize, requiredcrc, requiredsize);
                                CL_Disconnect();
                                return;
                        }
@@ -1053,9 +1053,9 @@ void CL_VM_Init (void)
                if (requiredcrc >= 0)
                {
                        if (cls.demoplayback)
-                               Con_Errorf("CL_VM_Init: demo requires CSQC, but \"%s\" wasn't found\n", csqc_progname.string);
+                               Con_Printf(CON_ERROR "CL_VM_Init: demo requires CSQC, but \"%s\" wasn't found\n", csqc_progname.string);
                        else
-                               Con_Errorf("CL_VM_Init: server requires CSQC, but \"%s\" wasn't found\n", csqc_progname.string);
+                               Con_Printf(CON_ERROR "CL_VM_Init: server requires CSQC, but \"%s\" wasn't found\n", csqc_progname.string);
                        CL_Disconnect();
                }
                return;
diff --git a/fs.c b/fs.c
index 34ed652524c4e788fb4850cc0e50ff989579c076..a5130fbb3a29761d6fdf9eec2e336f352bd4bbe8 100644 (file)
--- a/fs.c
+++ b/fs.c
@@ -1212,7 +1212,7 @@ static qboolean FS_AddPack_Fullpath(const char *pakfile, const char *shortname,
        }
        else
        {
-               Con_Errorf("unable to load pak \"%s\"\n", pakfile);
+               Con_Printf(CON_ERROR "unable to load pak \"%s\"\n", pakfile);
                return false;
        }
 }
@@ -2101,13 +2101,13 @@ static void FS_Init_Dir (void)
 
        p = FS_CheckGameDir(gamedirname1);
        if(!p || p == fs_checkgamedir_missing)
-               Con_Warnf("WARNING: base gamedir %s%s/ not found!\n", fs_basedir, gamedirname1);
+               Con_Printf(CON_WARN "WARNING: base gamedir %s%s/ not found!\n", fs_basedir, gamedirname1);
 
        if(gamedirname2)
        {
                p = FS_CheckGameDir(gamedirname2);
                if(!p || p == fs_checkgamedir_missing)
-                       Con_Warnf("WARNING: base gamedir %s%s/ not found!\n", fs_basedir, gamedirname2);
+                       Con_Printf(CON_WARN "WARNING: base gamedir %s%s/ not found!\n", fs_basedir, gamedirname2);
        }
 
        // -game <gamedir>
@@ -2124,7 +2124,7 @@ static void FS_Init_Dir (void)
                        if(!p)
                                Sys_Error("Nasty -game name rejected: %s", sys.argv[i]);
                        if(p == fs_checkgamedir_missing)
-                               Con_Warnf("WARNING: -game %s%s/ not found!\n", fs_basedir, sys.argv[i]);
+                               Con_Printf(CON_WARN "WARNING: -game %s%s/ not found!\n", fs_basedir, sys.argv[i]);
                        // add the gamedir to the list of active gamedirs
                        strlcpy (fs_gamedirs[fs_numgamedirs], sys.argv[i], sizeof(fs_gamedirs[fs_numgamedirs]));
                        fs_numgamedirs++;
@@ -2250,7 +2250,7 @@ static filedesc_t FS_SysOpenFiledesc(const char *filepath, const char *mode, qbo
                        opt = O_CREAT | O_APPEND;
                        break;
                default:
-                       Con_Errorf ("FS_SysOpen(%s, %s): invalid mode\n", filepath, mode);
+                       Con_Printf(CON_ERROR "FS_SysOpen(%s, %s): invalid mode\n", filepath, mode);
                        return FILEDESC_INVALID;
        }
        for (ind = 1; mode[ind] != '\0'; ind++)
@@ -2267,7 +2267,7 @@ static filedesc_t FS_SysOpenFiledesc(const char *filepath, const char *mode, qbo
                                dolock = true;
                                break;
                        default:
-                               Con_Errorf ("FS_SysOpen(%s, %s): unknown character in mode (%c)\n",
+                               Con_Printf(CON_ERROR "FS_SysOpen(%s, %s): unknown character in mode (%c)\n",
                                                        filepath, mode, mode[ind]);
                }
        }
@@ -2377,7 +2377,7 @@ static qfile_t *FS_OpenPackedFile (pack_t* pack, int pack_ind)
        // No Zlib DLL = no compressed files
        if (!zlib_dll && (pfile->flags & PACKFILE_FLAG_DEFLATED))
        {
-               Con_Warnf("WARNING: can't open the compressed file %s\n"
+               Con_Printf(CON_WARN "WARNING: can't open the compressed file %s\n"
                                        "You need the Zlib DLL to use compressed files\n",
                                        pfile->name);
                return NULL;
@@ -2849,7 +2849,7 @@ fs_offset_t FS_Write (qfile_t* file, const void* data, size_t datasize)
        {
                if (FILEDESC_SEEK (file->handle, file->buff_ind - file->buff_len, SEEK_CUR) == -1)
                {
-                       Con_Warnf("WARNING: could not seek in %s.\n", file->filename);
+                       Con_Printf(CON_WARN "WARNING: could not seek in %s.\n", file->filename);
                }
        }
 
diff --git a/ft2.c b/ft2.c
index 906ad70ceae4e7d49c486ab5c62fbe752e6ed3ca..d4f9e07ac27bb24d764d933e14712ce159376ab2 100644 (file)
--- a/ft2.c
+++ b/ft2.c
@@ -388,7 +388,7 @@ void font_start(void)
 
        if (qFT_Init_FreeType(&font_ft2lib))
        {
-               Con_Error("ERROR: Failed to initialize the FreeType2 library!\n");
+               Con_Print(CON_ERROR "ERROR: Failed to initialize the FreeType2 library!\n");
                Font_CloseLibrary();
                return;
        }
@@ -396,7 +396,7 @@ void font_start(void)
        font_mempool = Mem_AllocPool("FONT", 0, NULL);
        if (!font_mempool)
        {
-               Con_Error("ERROR: Failed to allocate FONT memory pool!\n");
+               Con_Print(CON_ERROR "ERROR: Failed to allocate FONT memory pool!\n");
                Font_CloseLibrary();
                return;
        }
@@ -543,7 +543,7 @@ qboolean Font_LoadFont(const char *name, dp_font_t *dpfnt)
                        break;
                if (! (fb = Font_Alloc()) )
                {
-                       Con_Errorf("Failed to allocate font for fallback %i of font %s\n", i, name);
+                       Con_Printf(CON_ERROR "Failed to allocate font for fallback %i of font %s\n", i, name);
                        break;
                }
 
@@ -553,7 +553,7 @@ qboolean Font_LoadFont(const char *name, dp_font_t *dpfnt)
                        if(!FS_FileExists(va(vabuf, sizeof(vabuf), "%s.png", dpfnt->fallbacks[i])))
                        if(!FS_FileExists(va(vabuf, sizeof(vabuf), "%s.jpg", dpfnt->fallbacks[i])))
                        if(!FS_FileExists(va(vabuf, sizeof(vabuf), "%s.pcx", dpfnt->fallbacks[i])))
-                               Con_Errorf("Failed to load font %s for fallback %i of font %s\n", dpfnt->fallbacks[i], i, name);
+                               Con_Printf(CON_ERROR "Failed to load font %s for fallback %i of font %s\n", dpfnt->fallbacks[i], i, name);
                        Mem_Free(fb);
                        continue;
                }
@@ -565,7 +565,7 @@ qboolean Font_LoadFont(const char *name, dp_font_t *dpfnt)
                }
                if (!count)
                {
-                       Con_Errorf("Failed to allocate font for fallback %i of font %s\n", i, name);
+                       Con_Printf(CON_ERROR "Failed to allocate font for fallback %i of font %s\n", i, name);
                        Font_UnloadFont(fb);
                        Mem_Free(fb);
                        break;
@@ -619,7 +619,7 @@ static qboolean Font_LoadFile(const char *name, int _face, ft2_settings_t *setti
        {
                if (!r_font_disable_freetype.integer)
                {
-                       Con_Warnf("WARNING: can't open load font %s\n"
+                       Con_Printf(CON_WARN "WARNING: can't open load font %s\n"
                                   "You need the FreeType2 DLL to load font files\n",
                                   name);
                }
@@ -631,7 +631,7 @@ static qboolean Font_LoadFile(const char *name, int _face, ft2_settings_t *setti
        namelen = strlen(name);
        if (namelen + 5 > sizeof(filename))
        {
-               Con_Warnf("WARNING: too long font name. Cannot load this.\n");
+               Con_Printf(CON_WARN "WARNING: too long font name. Cannot load this.\n");
                return false;
        }
 
@@ -677,14 +677,14 @@ static qboolean Font_LoadFile(const char *name, int _face, ft2_settings_t *setti
        status = qFT_New_Memory_Face(font_ft2lib, (FT_Bytes)data, datasize, _face, (FT_Face*)&font->face);
        if (status && _face != 0)
        {
-               Con_Errorf("Failed to load face %i of %s. Falling back to face 0\n", _face, name);
+               Con_Printf(CON_ERROR "Failed to load face %i of %s. Falling back to face 0\n", _face, name);
                _face = 0;
                status = qFT_New_Memory_Face(font_ft2lib, (FT_Bytes)data, datasize, _face, (FT_Face*)&font->face);
        }
        font->data = data;
        if (status)
        {
-               Con_Errorf("ERROR: can't create face for %s\n"
+               Con_Printf(CON_ERROR "ERROR: can't create face for %s\n"
                           "Error %i\n", // TODO: error strings
                           name, status);
                Font_UnloadFont(font);
@@ -700,7 +700,7 @@ static qboolean Font_LoadFile(const char *name, int _face, ft2_settings_t *setti
                args.memory_base = (const FT_Byte*)font->attachments[i].data;
                args.memory_size = font->attachments[i].size;
                if (qFT_Attach_Stream((FT_Face)font->face, &args))
-                       Con_Errorf("Failed to add attachment %u to %s\n", (unsigned)i, font->name);
+                       Con_Printf(CON_ERROR "Failed to add attachment %u to %s\n", (unsigned)i, font->name);
        }
 
        strlcpy(font->name, name, sizeof(font->name));
@@ -935,7 +935,7 @@ static qboolean Font_LoadSize(ft2_font_t *font, float size, qboolean check_only)
        temp.intSize = -1; // negative value: LoadMap must search now :)
        if (!Font_LoadMap(font, &temp, 0, &fmap))
        {
-               Con_Errorf("ERROR: can't load the first character map for %s\n"
+               Con_Printf(CON_ERROR "ERROR: can't load the first character map for %s\n"
                           "This is fatal\n",
                           font->name);
                Font_UnloadFont(font);
@@ -1103,7 +1103,7 @@ qboolean Font_GetKerningForMap(ft2_font_t *font, int map_index, float w, float h
                if (!Font_SetSize(font, fmap->intSize, fmap->intSize))
                {
                        // this deserves an error message
-                       Con_Errorf("Failed to get kerning for %s\n", font->name);
+                       Con_Printf(CON_ERROR "Failed to get kerning for %s\n", font->name);
                        return false;
                }
                ul = qFT_Get_Char_Index((FT_Face)font->face, left);
@@ -1186,14 +1186,14 @@ static float Font_SearchSize(ft2_font_t *font, FT_Face fontface, float size)
        {
                if (!Font_SetSize(font, intSize, intSize))
                {
-                       Con_Errorf("ERROR: can't set size for font %s: %f ((%f))\n", font->name, size, intSize);
+                       Con_Printf(CON_ERROR "ERROR: can't set size for font %s: %f ((%f))\n", font->name, size, intSize);
                        return -1;
                }
                if ((fontface->size->metrics.height>>6) <= size)
                        return intSize;
                if (intSize < 2)
                {
-                       Con_Errorf("ERROR: no appropriate size found for font %s: %f\n", font->name, size);
+                       Con_Printf(CON_ERROR "ERROR: no appropriate size found for font %s: %f\n", font->name, size);
                        return -1;
                }
                --intSize;
@@ -1304,14 +1304,14 @@ static qboolean Font_LoadMap(ft2_font_t *font, ft2_font_map_t *mapstart, Uchar _
 
        if (!font->image_font && !Font_SetSize(font, mapstart->intSize, mapstart->intSize))
        {
-               Con_Errorf("ERROR: can't set sizes for font %s: %f\n", font->name, mapstart->size);
+               Con_Printf(CON_ERROR "ERROR: can't set sizes for font %s: %f\n", font->name, mapstart->size);
                return false;
        }
 
        map = (ft2_font_map_t *)Mem_Alloc(font_mempool, sizeof(ft2_font_map_t));
        if (!map)
        {
-               Con_Errorf("ERROR: Out of memory when loading fontmap for %s\n", font->name);
+               Con_Printf(CON_ERROR "ERROR: Out of memory when loading fontmap for %s\n", font->name);
                return false;
        }
 
@@ -1345,7 +1345,7 @@ static qboolean Font_LoadMap(ft2_font_t *font, ft2_font_map_t *mapstart, Uchar _
        data = (unsigned char *)Mem_Alloc(font_mempool, (FONT_CHAR_LINES * map->glyphSize) * pitch);
        if (!data)
        {
-               Con_Errorf("ERROR: Failed to allocate memory for font %s size %g\n", font->name, map->size);
+               Con_Printf(CON_ERROR "ERROR: Failed to allocate memory for font %s size %g\n", font->name, map->size);
                Mem_Free(map);
                return false;
        }
@@ -1461,7 +1461,7 @@ static qboolean Font_LoadMap(ft2_font_t *font, ft2_font_map_t *mapstart, Uchar _
                h = bmp->rows;
 
                if (w > (map->glyphSize - gpad_l - gpad_r) || h > (map->glyphSize - gpad_t - gpad_b)) {
-                       Con_Warnf("WARNING: Glyph %lu is too big in font %s, size %g: %i x %i\n", ch, font->name, map->size, w, h);
+                       Con_Printf(CON_WARN "WARNING: Glyph %lu is too big in font %s, size %g: %i x %i\n", ch, font->name, map->size, w, h);
                        if (w > map->glyphSize)
                                w = map->glyphSize - gpad_l - gpad_r;
                        if (h > map->glyphSize)
@@ -1492,7 +1492,7 @@ static qboolean Font_LoadMap(ft2_font_t *font, ft2_font_map_t *mapstart, Uchar _
                                if (developer_font.integer)
                                        Con_DPrintf("glyphinfo:   Pixel Mode: Unknown: %i\n", bmp->pixel_mode);
                                Mem_Free(data);
-                               Con_Errorf("ERROR: Unrecognized pixel mode for font %s size %f: %i\n", font->name, mapstart->size, bmp->pixel_mode);
+                               Con_Printf(CON_ERROR "ERROR: Unrecognized pixel mode for font %s size %f: %i\n", font->name, mapstart->size, bmp->pixel_mode);
                                return false;
                        }
                        for (y = 0; y < h; ++y)
@@ -1650,7 +1650,7 @@ static qboolean Font_LoadMap(ft2_font_t *font, ft2_font_map_t *mapstart, Uchar _
                // otherwise we retry to load it every single frame where ft2 rendering is used
                // this would be bad...
                // only `data' must be freed
-               Con_Errorf("ERROR: Failed to generate texture for font %s size %f map %lu\n",
+               Con_Printf(CON_ERROR "ERROR: Failed to generate texture for font %s size %f map %lu\n",
                           font->name, mapstart->size, mapidx);
                return false;
        }
index abc7f794ebf2d8610c1bbb5956b02939558d684a..b16916a75ebad77541af5abcee776e24ba239ec9 100644 (file)
@@ -1551,7 +1551,7 @@ void R_Mesh_Start(void)
        R_Mesh_SetRenderTargets(0, NULL, NULL, NULL, NULL, NULL);
        if (gl_printcheckerror.integer && !gl_paranoid.integer)
        {
-               Con_Warnf("WARNING: gl_printcheckerror is on but gl_paranoid is off, turning it on...\n");
+               Con_Printf(CON_WARN "WARNING: gl_printcheckerror is on but gl_paranoid is off, turning it on...\n");
                Cvar_SetValueQuick(&gl_paranoid, 1);
        }
 }
index 8b800c2a98b828d6ad9c1183923d7390f064431e..ac5c98b9dc376130797727009fe34996b6113ecb 100644 (file)
--- a/gl_draw.c
+++ b/gl_draw.c
@@ -670,7 +670,7 @@ static void LoadFont_f(cmd_state_t *cmd)
 
                                if (sizes == MAX_FONT_SIZES)
                                {
-                                       Con_Warnf("Warning: specified more than %i different font sizes, exceding ones are ignored\n", MAX_FONT_SIZES);
+                                       Con_Printf(CON_WARN "Warning: specified more than %i different font sizes, exceding ones are ignored\n", MAX_FONT_SIZES);
                                        sizes = -1;
                                        continue;
                                }
index b36f2466c2df10fe57636ee10a13f6ea1500885c..0a0f1b365a21b1cf73a018ea1c33c654d2a1c850 100644 (file)
@@ -1469,7 +1469,7 @@ static void R_GLSL_DumpShader_f(cmd_state_t *cmd)
                                Con_Printf("%s written\n", modeinfo[mode].filename);
                        }
                        else
-                               Con_Errorf("failed to write to %s\n", modeinfo[mode].filename);
+                               Con_Printf(CON_ERROR "failed to write to %s\n", modeinfo[mode].filename);
                }
        }
 }
diff --git a/host.c b/host.c
index 51f3bd3236b93c25fa33ddb671b181b798bf7d69..bd8439433b8f7c3e91ceebaa3058813acc68da70 100644 (file)
--- a/host.c
+++ b/host.c
@@ -118,7 +118,7 @@ void Host_Error (const char *error, ...)
        dpvsnprintf (hosterrorstring1,sizeof(hosterrorstring1),error,argptr);
        va_end (argptr);
 
-       Con_Errorf("Host_Error: %s\n", hosterrorstring1);
+       Con_Printf(CON_ERROR "Host_Error: %s\n", hosterrorstring1);
 
        // LadyHavoc: if crashing very early, or currently shutting down, do
        // Sys_Error instead
@@ -296,7 +296,7 @@ static void Host_SaveConfig_to(const char *file)
                f = FS_OpenRealFile(file, "wb", false);
                if (!f)
                {
-                       Con_Errorf("Couldn't write %s.\n", file);
+                       Con_Printf(CON_ERROR "Couldn't write %s.\n", file);
                        return;
                }
 
@@ -430,12 +430,12 @@ void Host_Main(void)
                {
                        // warn if it's significant
                        if (time < -0.01)
-                               Con_Warnf("Host_Mingled: time stepped backwards (went from %f to %f, difference %f)\n", oldtime, newtime, time);
+                               Con_Printf(CON_WARN "Host_Mingled: time stepped backwards (went from %f to %f, difference %f)\n", oldtime, newtime, time);
                        time = 0;
                }
                else if (time >= 1800)
                {
-                       Con_Warnf("Host_Mingled: time stepped forward (went from %f to %f, difference %f)\n", oldtime, newtime, time);
+                       Con_Printf(CON_WARN "Host_Mingled: time stepped forward (went from %f to %f, difference %f)\n", oldtime, newtime, time);
                        time = 0;
                }
                host.realtime += time;
@@ -871,7 +871,7 @@ void Host_LockSession(void)
                {
                        if(locksession.integer == 2)
                        {
-                               Con_Warnf("WARNING: session lock %s could not be acquired. Please run with -sessionid and an unique session name. Continuing anyway.\n", p);
+                               Con_Printf(CON_WARN "WARNING: session lock %s could not be acquired. Please run with -sessionid and an unique session name. Continuing anyway.\n", p);
                        }
                        else
                        {
index 967d6f732fe83015488f16ff35bc69decf7e1952..da327de29c22f2361be6ad2afad5cef70b002130 100644 (file)
@@ -283,12 +283,12 @@ static void PNG_fFlushData(void *png)
 
 static void PNG_error_fn(void *png, const char *message)
 {
-       Con_Errorf("PNG_LoadImage: error: %s\n", message);
+       Con_Printf(CON_ERROR "PNG_LoadImage: error: %s\n", message);
 }
 
 static void PNG_warning_fn(void *png, const char *message)
 {
-       Con_Warnf("PNG_LoadImage: warning: %s\n", message);
+       Con_Printf(CON_WARN "PNG_LoadImage: warning: %s\n", message);
 }
 
 unsigned char *PNG_LoadImage_BGRA (const unsigned char *raw, int filesize, int *miplevel)
diff --git a/lhnet.c b/lhnet.c
index 21087857a3b1fc56bbc2bcf0dece868ec09f2e19..71b9cef5d5e26cca3ed7e1a4260c42b0be2e24a5 100644 (file)
--- a/lhnet.c
+++ b/lhnet.c
@@ -969,9 +969,9 @@ lhnetsocket_t *LHNET_OpenSocket_Connectionless(lhnetaddress_t *address)
                                                                int rfc1149only = 0;
                                                                int rfc1149enabled = 0;
                                                                if(setsockopt(lhnetsocket->inetsocket, SOL_RFC1149, RFC1149_1149ONLY, &rfc1149only))
-                                                                       Con_Errorf("LHNET_OpenSocket_Connectionless: warning: setsockopt(RFC1149_1149ONLY) returned error: %s\n", LHNETPRIVATE_StrError());
+                                                                       Con_Printf(CON_ERROR "LHNET_OpenSocket_Connectionless: warning: setsockopt(RFC1149_1149ONLY) returned error: %s\n", LHNETPRIVATE_StrError());
                                                                if(setsockopt(lhnetsocket->inetsocket, SOL_RFC1149, RFC1149_ENABLED, &rfc1149enabled))
-                                                                       Con_Errorf("LHNET_OpenSocket_Connectionless: warning: setsockopt(RFC1149_ENABLED) returned error: %s\n", LHNETPRIVATE_StrError());
+                                                                       Con_Printf(CON_ERROR "LHNET_OpenSocket_Connectionless: warning: setsockopt(RFC1149_ENABLED) returned error: %s\n", LHNETPRIVATE_StrError());
                                                        }
 #endif
 
index 8fb07d0064e3705e474835865601c3259a08dbe6..c7f66b60757bce69cb7ad83d58ef782011ca99a7 100644 (file)
@@ -3649,12 +3649,12 @@ static void Mod_Q1BSP_RecursiveNodePortals(mnode_t *node)
 
        if (nodeportal->numpoints < 3)
        {
-               Con_Warn("Mod_Q1BSP_RecursiveNodePortals: WARNING: new portal was clipped away\n");
+               Con_Print(CON_WARN "Mod_Q1BSP_RecursiveNodePortals: WARNING: new portal was clipped away\n");
                nodeportal->numpoints = 0;
        }
        else if (nodeportal->numpoints >= MAX_PORTALPOINTS)
        {
-               Con_Warn("Mod_Q1BSP_RecursiveNodePortals: WARNING: new portal has too many points\n");
+               Con_Print(CON_WARN "Mod_Q1BSP_RecursiveNodePortals: WARNING: new portal has too many points\n");
                nodeportal->numpoints = 0;
        }
 
@@ -4174,7 +4174,7 @@ void Mod_Q1BSP_Load(dp_model_t *mod, void *buffer, void *bufferend)
                else
                {
                        // LadyHavoc: empty submodel(lacrima.bsp has such a glitch)
-                       Con_Warnf("warning: empty submodel *%i in %s\n", i+1, loadmodel->name);
+                       Con_Printf(CON_WARN "warning: empty submodel *%i in %s\n", i+1, loadmodel->name);
                }
                //mod->brushq1.num_visleafs = bm->visleafs;
 
@@ -5150,7 +5150,7 @@ static void Mod_Q2BSP_Load(dp_model_t *mod, void *buffer, void *bufferend)
                }
                else
                {
-                       Con_Warnf("warning: empty submodel *%i in %s\n", i+1, loadmodel->name);
+                       Con_Printf(CON_WARN "warning: empty submodel *%i in %s\n", i+1, loadmodel->name);
                }
                //mod->brushq1.num_visleafs = bm->visleafs;
 
@@ -6123,7 +6123,7 @@ static void Mod_Q3BSP_LoadFaces(lump_t *l)
                                }
                        if(xtess == -1)
                        {
-                               Con_Errorf("ERROR: patch %d isn't preprocessed?!?\n", i);
+                               Con_Printf(CON_ERROR "ERROR: patch %d isn't preprocessed?!?\n", i);
                                xtess = ytess = cxtess = cytess = 0;
                        }
 
@@ -6183,7 +6183,7 @@ static void Mod_Q3BSP_LoadFaces(lump_t *l)
                                invalidelements++;
                if (invalidelements)
                {
-                       Con_Warnf("Mod_Q3BSP_LoadFaces: Warning: face #%i has %i invalid elements, type = %i, texture->name = \"%s\", texture->surfaceflags = %i, firstvertex = %i, numvertices = %i, firstelement = %i, numelements = %i, elements list:\n", i, invalidelements, type, out->texture->name, out->texture->surfaceflags, firstvertex, out->num_vertices, firstelement, out->num_triangles * 3);
+                       Con_Printf(CON_WARN "Mod_Q3BSP_LoadFaces: Warning: face #%i has %i invalid elements, type = %i, texture->name = \"%s\", texture->surfaceflags = %i, firstvertex = %i, numvertices = %i, firstelement = %i, numelements = %i, elements list:\n", i, invalidelements, type, out->texture->name, out->texture->surfaceflags, firstvertex, out->num_vertices, firstelement, out->num_triangles * 3);
                        for (j = 0;j < out->num_triangles * 3;j++)
                        {
                                Con_Printf(" %i", (loadmodel->surfmesh.data_element3i + 3 * out->num_firsttriangle)[j] - out->num_firstvertex);
@@ -6500,11 +6500,11 @@ static void Mod_Q3BSP_LoadLightGrid(lump_t *l)
        {
                if (l->filelen < count * (int)sizeof(*in))
                {
-                       Con_Errorf("Mod_Q3BSP_LoadLightGrid: invalid lightgrid lump size %i bytes, should be %i bytes (%ix%ix%i)", l->filelen, (int)(count * sizeof(*in)), loadmodel->brushq3.num_lightgrid_isize[0], loadmodel->brushq3.num_lightgrid_isize[1], loadmodel->brushq3.num_lightgrid_isize[2]);
+                       Con_Printf(CON_ERROR "Mod_Q3BSP_LoadLightGrid: invalid lightgrid lump size %i bytes, should be %i bytes (%ix%ix%i)", l->filelen, (int)(count * sizeof(*in)), loadmodel->brushq3.num_lightgrid_isize[0], loadmodel->brushq3.num_lightgrid_isize[1], loadmodel->brushq3.num_lightgrid_isize[2]);
                        return; // ignore the grid if we cannot understand it
                }
                if (l->filelen != count * (int)sizeof(*in))
-                       Con_Warnf("Mod_Q3BSP_LoadLightGrid: Warning: calculated lightgrid size %i bytes does not match lump size %i\n", (int)(count * sizeof(*in)), l->filelen);
+                       Con_Printf(CON_WARN "Mod_Q3BSP_LoadLightGrid: Warning: calculated lightgrid size %i bytes does not match lump size %i\n", (int)(count * sizeof(*in)), l->filelen);
                out = (q3dlightgrid_t *)Mem_Alloc(loadmodel->mempool, count * sizeof(*out));
                loadmodel->brushq3.data_lightgrid = out;
                loadmodel->brushq3.num_lightgrid = count;
index abf00190bbf9471c9091b78d7025d1634dd585d7..acfac9f5a27cf8c8fd820a9989bd713e01070503 100644 (file)
@@ -462,7 +462,7 @@ void Mod_IDS2_Load(dp_model_t *mod, void *buffer, void *bufferend)
                        pinframe = &pinqsprite->frames[i];
                        if (!(skinframe = R_SkinFrame_LoadExternal(pinframe->name, texflags, false, false)))
                        {
-                               Con_Errorf("Mod_IDS2_Load: failed to load %s", pinframe->name);
+                               Con_Printf(CON_ERROR "Mod_IDS2_Load: failed to load %s", pinframe->name);
                                skinframe = R_SkinFrame_LoadMissing();
                        }
                        Mod_SpriteSetupTexture(&loadmodel->data_textures[i], skinframe, fullbright, false);
index a5235afa5600d6c7200b688d457bff59feed72c6..71c1a1e6a790a19842e76aaef5566ea4997e1858 100755 (executable)
--- a/netconn.c
+++ b/netconn.c
@@ -970,11 +970,11 @@ static void NetConn_OpenClientPort(const char *addressstring, lhnetaddresstype_t
                else
                {
                        LHNETADDRESS_ToString(&address, addressstring2, sizeof(addressstring2), true);
-                       Con_Errorf("Client failed to open a socket on address %s\n", addressstring2);
+                       Con_Printf(CON_ERROR "Client failed to open a socket on address %s\n", addressstring2);
                }
        }
        else
-               Con_Errorf("Client unable to parse address %s\n", addressstring);
+               Con_Printf(CON_ERROR "Client unable to parse address %s\n", addressstring);
 }
 
 void NetConn_OpenClientPorts(void)
@@ -1034,12 +1034,12 @@ static qboolean NetConn_OpenServerPort(const char *addressstring, lhnetaddressty
                        else
                        {
                                LHNETADDRESS_ToString(&address, addressstring2, sizeof(addressstring2), true);
-                               Con_Errorf("Server failed to open socket on address %s\n", addressstring2);
+                               Con_Printf(CON_ERROR "Server failed to open socket on address %s\n", addressstring2);
                        }
                }
                else
                {
-                       Con_Errorf("Server unable to parse address %s\n", addressstring);
+                       Con_Printf(CON_ERROR "Server unable to parse address %s\n", addressstring);
                        // if it cant parse one address, it wont be able to parse another for sure
                        return false;
                }
@@ -2740,7 +2740,7 @@ static qboolean hmac_mdfour_time_matching(lhnetaddress_t *peeraddress, const cha
        long t1, t2;
 
        if (!password[0]) {
-               Con_Error("LOGIC ERROR: RCon_Authenticate should never call the comparator with an empty password. Please report.\n");
+               Con_Print(CON_ERROR "LOGIC ERROR: RCon_Authenticate should never call the comparator with an empty password. Please report.\n");
                return false;
        }
 
@@ -2761,7 +2761,7 @@ static qboolean hmac_mdfour_challenge_matching(lhnetaddress_t *peeraddress, cons
        int i;
 
        if (!password[0]) {
-               Con_Error("LOGIC ERROR: RCon_Authenticate should never call the comparator with an empty password. Please report.\n");
+               Con_Print(CON_ERROR "LOGIC ERROR: RCon_Authenticate should never call the comparator with an empty password. Please report.\n");
                return false;
        }
 
@@ -2792,7 +2792,7 @@ static qboolean hmac_mdfour_challenge_matching(lhnetaddress_t *peeraddress, cons
 static qboolean plaintext_matching(lhnetaddress_t *peeraddress, const char *password, const char *hash, const char *s, int slen)
 {
        if (!password[0]) {
-               Con_Error("LOGIC ERROR: RCon_Authenticate should never call the comparator with an empty password. Please report.\n");
+               Con_Print(CON_ERROR "LOGIC ERROR: RCon_Authenticate should never call the comparator with an empty password. Please report.\n");
                return false;
        }
 
@@ -3757,7 +3757,7 @@ void NetConn_QueryMasters(qboolean querydp, qboolean queryqw)
        }
        if (!masterquerycount)
        {
-               Con_Error("Unable to query master servers, no suitable network sockets active.\n");
+               Con_Print(CON_ERROR "Unable to query master servers, no suitable network sockets active.\n");
                M_Update_Return_Reason("No network");
        }
 }
@@ -3930,7 +3930,7 @@ void NetConn_Init(void)
                        Cvar_SetQuick(&net_address, sys.argv[i + 1]);
                }
                else
-                       Con_Errorf("-ip option used, but unable to parse the address \"%s\"\n", sys.argv[i + 1]);
+                       Con_Printf(CON_ERROR "-ip option used, but unable to parse the address \"%s\"\n", sys.argv[i + 1]);
        }
 // COMMANDLINEOPTION: Server: -port <portnumber> sets the port to use for a server (default 26000, the same port as QUAKE itself), useful if you host multiple servers on your machine
        if (((i = COM_CheckParm("-port")) || (i = COM_CheckParm("-ipport")) || (i = COM_CheckParm("-udpport"))) && i + 1 < sys.argc)
@@ -3942,7 +3942,7 @@ void NetConn_Init(void)
                        Cvar_SetValueQuick(&sv_netport, i);
                }
                else
-                       Con_Errorf("-port option used, but %i is not a valid port number\n", i);
+                       Con_Printf(CON_ERROR "-port option used, but %i is not a valid port number\n", i);
        }
        cl_numsockets = 0;
        sv_numsockets = 0;
index 0fa00971e62fec834a8c28914ecbfceb85f13f54..073828ee21f9768383d75f99e12e66d733fafa19 100644 (file)
@@ -3366,7 +3366,7 @@ void EntityFrameQW_CL_ReadFrame(qboolean delta)
                        if (newnum != oldnum && !delta && !invalid)
                        {
                                cl.qw_validsequence = 0;
-                               Con_Warnf("WARNING: U_REMOVE %i on full update\n", newnum);
+                               Con_Printf(CON_WARN "WARNING: U_REMOVE %i on full update\n", newnum);
                        }
                }
                else
index 81898814220ea84544a34924fb3505d86734c26b..65fc3a181d0e2b0fc121c566637b856897be8ccc 100644 (file)
@@ -32,7 +32,7 @@ void VM_Warning(prvm_prog_t *prog, const char *fmt, ...)
        dpvsnprintf(msg,sizeof(msg),fmt,argptr);
        va_end(argptr);
 
-       Con_Warn(msg);
+       Con_Printf(CON_WARN "%s", msg);
 
        // TODO: either add a cvar/cmd to control the state dumping or replace some of the calls with Con_Printf [9/13/2006 Black]
        if(prvm_backtraceforwarnings.integer && recursive != host.realtime) // NOTE: this compares to the time, just in case if PRVM_PrintState causes a Host_Error and keeps recursive set
@@ -331,7 +331,7 @@ void VM_error(prvm_prog_t *prog)
        char string[VM_STRINGTEMP_LENGTH];
 
        VM_VarString(prog, 0, string, sizeof(string));
-       Con_Errorf("======%s ERROR in %s:\n%s\n", prog->name, PRVM_GetString(prog, prog->xfunction->s_name), string);
+       Con_Printf(CON_ERROR "======%s ERROR in %s:\n%s\n", prog->name, PRVM_GetString(prog, prog->xfunction->s_name), string);
        ed = PRVM_PROG_TO_EDICT(PRVM_allglobaledict(self));
        PRVM_ED_Print(prog, ed, NULL);
 
@@ -354,11 +354,11 @@ void VM_objerror(prvm_prog_t *prog)
        char string[VM_STRINGTEMP_LENGTH];
 
        VM_VarString(prog, 0, string, sizeof(string));
-       Con_Errorf("======OBJECT ERROR======\n"); // , prog->name, PRVM_GetString(prog->xfunction->s_name), string); // or include them? FIXME
+       Con_Printf(CON_ERROR "======OBJECT ERROR======\n"); // , prog->name, PRVM_GetString(prog->xfunction->s_name), string); // or include them? FIXME
        ed = PRVM_PROG_TO_EDICT(PRVM_allglobaledict(self));
        PRVM_ED_Print(prog, ed, NULL);
        PRVM_ED_Free (prog, ed);
-       Con_Errorf("%s OBJECT ERROR in %s:\n%s\nTip: read above for entity information\n", prog->name, PRVM_GetString(prog, prog->xfunction->s_name), string);
+       Con_Printf(CON_ERROR "%s OBJECT ERROR in %s:\n%s\nTip: read above for entity information\n", prog->name, PRVM_GetString(prog, prog->xfunction->s_name), string);
 }
 
 /*
diff --git a/r_sky.c b/r_sky.c
index 38a974f498e0adb714f9e4ebc2058ea8d836742a..43d60a372dac24bcd7707944716f5ef8c059999a 100644 (file)
--- a/r_sky.c
+++ b/r_sky.c
@@ -182,7 +182,7 @@ static void LoadSky_f(cmd_state_t *cmd)
                                Con_Print("skybox disabled\n");
                }
                else
-                       Con_Errorf("failed to load skybox %s\n", Cmd_Argv(cmd, 1));
+                       Con_Printf(CON_ERROR "failed to load skybox %s\n", Cmd_Argv(cmd, 1));
                break;
        default:
                Con_Print("usage: loadsky skyname\n");
index 98169a0672d9423e7fff5ffd856dc8566e5ef15a..68c84cdbe116fbd1195573b36f5f34c14caeeb57 100644 (file)
--- a/snd_sdl.c
+++ b/snd_sdl.c
@@ -138,7 +138,7 @@ qboolean SndSys_Init (snd_format_t* fmt)
 
        if ((audio_device = SDL_OpenAudioDevice(NULL, 0, &wantspec, &obtainspec, SDL_AUDIO_ALLOW_FREQUENCY_CHANGE | SDL_AUDIO_ALLOW_CHANNELS_CHANGE)) == 0)
        {
-               Con_Errorf( "Failed to open the audio device! (%s)\n", SDL_GetError() );
+               Con_Printf(CON_ERROR "Failed to open the audio device! (%s)\n", SDL_GetError() );
                return false;
        }
 
index a1bc51d50fc81d6acf8835c7eb7f51813a022a82..ad3e509f23460d9241bd98c59099d56ba834c2c0 100644 (file)
--- a/sv_demo.c
+++ b/sv_demo.c
@@ -22,7 +22,7 @@ void SV_StartDemoRecording(client_t *client, const char *filename, int forcetrac
        client->sv_demo_file = FS_OpenRealFile(name, "wb", false);
        if(!client->sv_demo_file)
        {
-               Con_Error("ERROR: couldn't open.\n");
+               Con_Print(CON_ERROR "ERROR: couldn't open.\n");
                return;
        }
 
index f7f26d69728f9ee173e9714c96f83cde3a366ec0..b32cd9c6f5574f686bf834785a1e3ccdf73ad4b8 100644 (file)
--- a/sv_save.c
+++ b/sv_save.c
@@ -211,7 +211,7 @@ void SV_Savegame_f(cmd_state_t *cmd)
                }
        }
        else
-               Con_Warn("Warning: saving a multiplayer game may have strange results when restored (to properly resume, all players must join in the same player slots and then the game can be reloaded).\n");
+               Con_Print(CON_WARN "Warning: saving a multiplayer game may have strange results when restored (to properly resume, all players must join in the same player slots and then the game can be reloaded).\n");
 
        if (Cmd_Argc(cmd) != 2)
        {
@@ -518,7 +518,7 @@ void SV_Loadgame_f(cmd_state_t *cmd)
                                                        if (COM_ParseToken_Simple(&t, false, false, true))
                                                                k |= atoi(com_token);
                                                        if (!BufStr_FindCreateReplace(prog, i, k, "string"))
-                                                               Con_Errorf("failed to create stringbuffer %i\n", i);
+                                                               Con_Printf(CON_ERROR "failed to create stringbuffer %i\n", i);
                                                }
                                                else
                                                        Con_Printf("unsupported stringbuffer index %i \"%s\"\n", i, com_token);
@@ -548,7 +548,7 @@ void SV_Loadgame_f(cmd_state_t *cmd)
                                                                Con_Printf("unexpected end of line when parsing sv.bufstr (expected strindex)\n");
                                                }
                                                else
-                                                       Con_Errorf("failed to create stringbuffer %i \"%s\"\n", i, com_token);
+                                                       Con_Printf(CON_ERROR "failed to create stringbuffer %i \"%s\"\n", i, com_token);
                                        }
                                }       
                                // skip any trailing text or unrecognized commands
index a61b79e7bc4c6daf6de7672b8d002b35363b4d54..127f2bf36c8afc86cf81dfbf5adb1ededfa8111a 100644 (file)
@@ -41,7 +41,7 @@ void Sys_Error (const char *error, ...)
        dpvsnprintf (string, sizeof (string), error, argptr);
        va_end (argptr);
 
-       Con_Errorf ("Engine Error: %s\n", string);
+       Con_Printf(CON_ERROR "Engine Error: %s\n", string);
 
        Host_Shutdown ();
        exit (1);
index 9a91c15536cd306582fb511081e0f44697fa3d19..06d72ae921fc4af8be1f1186ef501a28144d046b 100644 (file)
--- a/sys_sdl.c
+++ b/sys_sdl.c
@@ -62,7 +62,7 @@ void Sys_Error (const char *error, ...)
        dpvsnprintf (string, sizeof (string), error, argptr);
        va_end (argptr);
 
-       Con_Errorf ("Engine Error: %s\n", string);
+       Con_Printf(CON_ERROR "Engine Error: %s\n", string);
        
        if(!nocrashdialog)
                SDL_ShowSimpleMessageBox(SDL_MESSAGEBOX_ERROR, "Engine Error", string, NULL);
index 84e210aa433c3a7690264aad022dce4787c575a0..d6081605f701b596ac716b65750cd70d1afc74f9 100644 (file)
@@ -635,7 +635,7 @@ void Sys_MakeProcessNice (void)
                return;
        Con_DPrintf("Process is becoming 'nice'...\n");
        if(setpriority(PRIO_PROCESS, 0, 19))
-               Con_Errorf("Failed to raise nice level to %d\n", 19);
+               Con_Printf(CON_ERROR "Failed to raise nice level to %d\n", 19);
        sys.isnice = true;
 }
 void Sys_MakeProcessMean (void)
@@ -646,7 +646,7 @@ void Sys_MakeProcessMean (void)
                return;
        Con_DPrintf("Process is becoming 'mean'...\n");
        if(setpriority(PRIO_PROCESS, 0, sys.nicelevel))
-               Con_Errorf("Failed to lower nice level to %d\n", sys.nicelevel);
+               Con_Printf(CON_ERROR "Failed to lower nice level to %d\n", sys.nicelevel);
        sys.isnice = false;
 }
 #else
index aa04130add342067e35a0ec043d8e30d96d0099a..de8e266a61460a2c8cf2413bafe51d6c2a32dab1 100644 (file)
--- a/sys_win.c
+++ b/sys_win.c
@@ -65,7 +65,7 @@ void Sys_Error (const char *error, ...)
        dpvsnprintf (text, sizeof (text), error, argptr);
        va_end (argptr);
 
-       Con_Errorf ("Engine Error: %s\n", text);
+       Con_Printf(CON_ERROR "Engine Error: %s\n", text);
 
        // close video so the message box is visible, unless we already tried that
        if (!in_sys_error0 && cls.state != ca_dedicated)
index 4179d640f606f930a7d3d766fd136802cd4c27c3..b88e6ecb5a8afb55741a0529e9738d7d648027d5 100644 (file)
--- a/vid_sdl.c
+++ b/vid_sdl.c
@@ -1338,7 +1338,7 @@ void VID_Init (void)
                Sys_Error ("Failed to init SDL video subsystem: %s", SDL_GetError());
        vid_sdl_initjoysticksystem = SDL_InitSubSystem(SDL_INIT_JOYSTICK) >= 0;
        if (!vid_sdl_initjoysticksystem)
-               Con_Errorf("Failed to init SDL joystick subsystem: %s\n", SDL_GetError());
+               Con_Printf(CON_ERROR "Failed to init SDL joystick subsystem: %s\n", SDL_GetError());
        vid_isfullscreen = false;
 }
 
@@ -1392,7 +1392,7 @@ void VID_EnableJoystick(qboolean enable)
                        }
                        else
                        {
-                               Con_Errorf("Joystick %i failed (SDL_JoystickOpen(%i) returned: %s)\n", index, sdlindex, SDL_GetError());
+                               Con_Printf(CON_ERROR "Joystick %i failed (SDL_JoystickOpen(%i) returned: %s)\n", index, sdlindex, SDL_GetError());
                                sdlindex = -1;
                        }
                }
@@ -1498,7 +1498,7 @@ static qboolean VID_InitModeGL(viddef_mode_t *mode)
                drivername = sys.argv[i + 1];
        if (SDL_GL_LoadLibrary(drivername) < 0)
        {
-               Con_Errorf("Unable to load GL driver \"%s\": %s\n", drivername, SDL_GetError());
+               Con_Printf(CON_ERROR "Unable to load GL driver \"%s\": %s\n", drivername, SDL_GetError());
                return false;
        }
 #endif
@@ -1578,7 +1578,7 @@ static qboolean VID_InitModeGL(viddef_mode_t *mode)
        window = SDL_CreateWindow(gamename, xPos, yPos, mode->width, mode->height, windowflags);
        if (window == NULL)
        {
-               Con_Errorf("Failed to set video mode to %ix%i: %s\n", mode->width, mode->height, SDL_GetError());
+               Con_Printf(CON_ERROR "Failed to set video mode to %ix%i: %s\n", mode->width, mode->height, SDL_GetError());
                VID_Shutdown();
                return false;
        }
@@ -1586,7 +1586,7 @@ static qboolean VID_InitModeGL(viddef_mode_t *mode)
        context = SDL_GL_CreateContext(window);
        if (context == NULL)
        {
-               Con_Errorf("Failed to initialize OpenGL context: %s\n", SDL_GetError());
+               Con_Printf(CON_ERROR "Failed to initialize OpenGL context: %s\n", SDL_GetError());
                VID_Shutdown();
                return false;
        }
diff --git a/wad.c b/wad.c
index b05227512b855dd606e5e9853a084a35700c174d..55da49963bd731d96f612fa426a0173e5c7f2cbf 100644 (file)
--- a/wad.c
+++ b/wad.c
@@ -174,22 +174,22 @@ void W_LoadTextureWadFile (char *filename, int complain)
        if (!file)
        {
                if (complain)
-                       Con_Errorf("W_LoadTextureWadFile: couldn't find %s\n", filename);
+                       Con_Printf(CON_ERROR "W_LoadTextureWadFile: couldn't find %s\n", filename);
                return;
        }
 
        if (FS_Read(file, &header, sizeof(wadinfo_t)) != sizeof(wadinfo_t))
-       {Con_Error("W_LoadTextureWadFile: unable to read wad header\n");FS_Close(file);file = NULL;return;}
+       {Con_Print(CON_ERROR "W_LoadTextureWadFile: unable to read wad header\n");FS_Close(file);file = NULL;return;}
 
        if(memcmp(header.identification, "WAD3", 4))
-       {Con_Errorf("W_LoadTextureWadFile: Wad file %s doesn't have WAD3 id\n",filename);FS_Close(file);file = NULL;return;}
+       {Con_Printf(CON_ERROR "W_LoadTextureWadFile: Wad file %s doesn't have WAD3 id\n",filename);FS_Close(file);file = NULL;return;}
 
        numlumps = LittleLong(header.numlumps);
        if (numlumps < 1 || numlumps > 65536)
-       {Con_Errorf("W_LoadTextureWadFile: invalid number of lumps (%i)\n", numlumps);FS_Close(file);file = NULL;return;}
+       {Con_Printf(CON_ERROR "W_LoadTextureWadFile: invalid number of lumps (%i)\n", numlumps);FS_Close(file);file = NULL;return;}
        infotableofs = LittleLong(header.infotableofs);
        if (FS_Seek (file, infotableofs, SEEK_SET))
-       {Con_Error("W_LoadTextureWadFile: unable to seek to lump table\n");FS_Close(file);file = NULL;return;}
+       {Con_Print(CON_ERROR "W_LoadTextureWadFile: unable to seek to lump table\n");FS_Close(file);file = NULL;return;}
 
        if (!wad.hlwads.mempool)
                Mem_ExpandableArray_NewArray(&wad.hlwads, cls.permanentmempool, sizeof(mwad_t), 16);
@@ -200,7 +200,7 @@ void W_LoadTextureWadFile (char *filename, int complain)
 
        if (!w->lumps)
        {
-               Con_Error("W_LoadTextureWadFile: unable to allocate temporary memory for lump table\n");
+               Con_Print(CON_ERROR "W_LoadTextureWadFile: unable to allocate temporary memory for lump table\n");
                FS_Close(w->file);
                w->file = NULL;
                w->numlumps = 0;
@@ -209,7 +209,7 @@ void W_LoadTextureWadFile (char *filename, int complain)
 
        if (FS_Read(file, w->lumps, sizeof(lumpinfo_t) * w->numlumps) != (fs_offset_t)sizeof(lumpinfo_t) * numlumps)
        {
-               Con_Error("W_LoadTextureWadFile: unable to read lump table\n");
+               Con_Print(CON_ERROR "W_LoadTextureWadFile: unable to read lump table\n");
                FS_Close(w->file);
                w->file = NULL;
                w->numlumps = 0;
diff --git a/world.c b/world.c
index fe3e0b60b7dc7731e79f25bc5cc4f87e2704f5b7..e460ed6f622bf3bce28f754adeae4839d0f2f0ea 100644 (file)
--- a/world.c
+++ b/world.c
@@ -2479,9 +2479,9 @@ static void World_Physics_Frame_BodyFromEntity(world_t *world, prvm_edict_t *ed)
                                                pointsData[(polygons[1]*3)+2]*pointsData[(polygons[2]*3)+1]*pointsData[(polygons[3]*3)+0] -
                                                pointsData[(polygons[1]*3)+1]*pointsData[(polygons[2]*3)+0]*pointsData[(polygons[3]*3)+2] -
                                                pointsData[(polygons[1]*3)+0]*pointsData[(polygons[2]*3)+2]*pointsData[(polygons[3]*3)+1]) < 0)
-                                               Con_Warnf("WARNING: Polygon %d is not defined counterclockwise\n", i);
+                                               Con_Printf(CON_WARN "WARNING: Polygon %d is not defined counterclockwise\n", i);
                                        if (planesData[(i*4)+3] < 0)
-                                               Con_Warnf("WARNING: Plane %d does not contain the origin\n", i);
+                                               Con_Printf(CON_WARN "WARNING: Plane %d does not contain the origin\n", i);
                                        polygons += (*polygons + 1);
                                }
                                // create geom