X-Git-Url: http://de.git.xonotic.org/?a=blobdiff_plain;f=console.c;h=ea394a1888e07c508aa8f4fe2ccfef7ef87496f8;hb=8e3274ed87c256d3122f56a5275180ef08439b2a;hp=a2f850c0b0877a76f94b55b86d25b8353f93bbb8;hpb=6f10cbc0e758254cc200332fd61f96d7cc972a48;p=xonotic%2Fdarkplaces.git diff --git a/console.c b/console.c index a2f850c0..ea394a18 100644 --- a/console.c +++ b/console.c @@ -807,7 +807,7 @@ static void Con_ConDump_f(cmd_state_t *cmd) file = FS_OpenRealFile(Cmd_Argv(cmd, 1), "w", false); if (!file) { - Con_Printf("condump: unable to write file \"%s\"\n", Cmd_Argv(cmd, 1)); + Con_Errorf("condump: unable to write file \"%s\"\n", Cmd_Argv(cmd, 1)); return; } if (con_mutex) Thread_LockMutex(con_mutex); @@ -1458,6 +1458,61 @@ 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 @@ -1956,6 +2011,7 @@ void Con_DrawConsole (int lines) int mask_must = 0; int mask_mustnot = (developer.integer>0) ? 0 : CON_MASK_DEVELOPER; cachepic_t *conbackpic; + unsigned int conbackflags; if (lines <= 0) return; @@ -1975,7 +2031,10 @@ void Con_DrawConsole (int lines) { sx = scr_conscroll_x.value; sy = scr_conscroll_y.value; - conbackpic = scr_conbrightness.value >= 0.01f ? Draw_CachePic_Flags("gfx/conback", (sx != 0 || sy != 0) ? CACHEPICFLAG_NOCLAMP : 0) : NULL; + conbackflags = CACHEPICFLAG_FAILONMISSING; // So console is readable when game content is missing + if (sx != 0 || sy != 0) + conbackflags &= CACHEPICFLAG_NOCLAMP; + conbackpic = scr_conbrightness.value >= 0.01f ? Draw_CachePic_Flags("gfx/conback", conbackflags) : NULL; sx *= realtime; sy *= realtime; sx -= floor(sx); sy -= floor(sy); if (Draw_IsPicLoaded(conbackpic))