if(sizehint != -1)
{
int i;
- Con_Printf("WARNING: invalid size hint %d when writing video data (actual size: %d)\n", (int) sizehint, x);
+ Con_Warnf("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]);
cls.demofile = FS_OpenRealFile(name, "wb", false);
if (!cls.demofile)
{
- Con_Print("ERROR: couldn't open.\n");
+ Con_Error("ERROR: couldn't open.\n");
return;
}
strlcpy(cls.demoname, name, sizeof(cls.demoname));
f = FS_OpenVirtualFile(name, false);
if (!f)
{
- Con_Printf("ERROR: couldn't open %s.\n", name);
+ Con_Errorf("ERROR: couldn't open %s.\n", name);
cls.demonum = -1; // stop demo loop
return;
}
if (VectorCompare(loc->mins, loc->maxs))
break;
if (loc)
- Con_Printf("Warning: writing loc file containing a mixture of qizmo-style points and proquake-style boxes may not work in qizmo or proquake!\n");
+ 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");
}
for (loc = cl.locnodes;loc;loc = loc->next)
{
cls.demo_lastcsprogscrc = -1;
}
else
- Con_Print ("ERROR: couldn't open.\n");
+ Con_Error ("ERROR: couldn't open.\n");
}
}
cl.islocalgame = NetConn_IsLocalGame();
Con_Printf("Wrote %s\n", filename);
else
{
- Con_Printf("Unable to write %s\n", filename);
+ Con_Errorf("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))
if (video->stream)
return true;
- Con_Printf("unable to open \"%s\", error: %s\n", video->filename, errorstring);
+ Con_Errorf("unable to open \"%s\", error: %s\n", video->filename, errorstring);
return false;
}
// check limits
if (video->subtitles == CLVIDEO_MAX_SUBTITLES)
{
- Con_Printf("WARNING: CLVIDEO_MAX_SUBTITLES = %i reached when reading subtitles from '%s'\n", CLVIDEO_MAX_SUBTITLES, subtitlesfile);
+ Con_Warnf("WARNING: CLVIDEO_MAX_SUBTITLES = %i reached when reading subtitles from '%s'\n", CLVIDEO_MAX_SUBTITLES, subtitlesfile);
break;
}
// add a sub
video = FindUnusedVid();
if( !video ) {
- Con_Printf( "CL_OpenVideo: unable to open video \"%s\" - video limit reached\n", filename );
+ Con_Errorf( "CL_OpenVideo: unable to open video \"%s\" - video limit reached\n", filename );
return NULL;
}
video = OpenVideo( video, filename, name, owner, subtitlesfile );
// got error or file end
errorcode = qLibAvW_StreamGetError(s->stream);
if (errorcode)
- Con_Printf("LibAvW: %s\n", qLibAvW_ErrorString(errorcode));
+ Con_Errorf("LibAvW: %s\n", qLibAvW_ErrorString(errorcode));
return 1;
}
pixel_format = LIBAVW_PIXEL_FORMAT_BGR;
else
{
- Con_Printf("LibAvW: cannot determine pixel format for bpp %i\n", bytesperpixel);
+ Con_Errorf("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_Printf("LibAvW: %s\n", qLibAvW_ErrorString(qLibAvW_StreamGetError(s->stream)));
+ Con_Errorf("LibAvW: %s\n", qLibAvW_ErrorString(qLibAvW_StreamGetError(s->stream)));
return 0;
}
static void libavw_message(int level, const char *message)
{
if (level == LIBAVW_PRINT_WARNING)
- Con_Printf("LibAvcodec warning: %s\n", message);
+ Con_Warnf("LibAvcodec warning: %s\n", message);
else if (level == LIBAVW_PRINT_ERROR)
- Con_Printf("LibAvcodec error: %s\n", message);
+ Con_Errorf("LibAvcodec error: %s\n", message);
else if (level == LIBAVW_PRINT_FATAL)
- Con_Printf("LibAvcodec fatal error: %s\n", message);
+ Con_Errorf("LibAvcodec fatal error: %s\n", message);
else
- Con_Printf("LibAvcodec panic: %s\n", message);
+ Con_Errorf("LibAvcodec panic: %s\n", message);
}
static qboolean LibAvW_OpenLibrary(void)
// initialize libav wrapper
if ((errorcode = qLibAvW_Init(&libavw_message)))
{
- Con_Printf("LibAvW failed to initialize: %s\n", qLibAvW_ErrorString(errorcode));
+ Con_Errorf("LibAvW failed to initialize: %s\n", qLibAvW_ErrorString(errorcode));
Sys_UnloadLibrary(&libavw_dll);
}
static void VM_CL_effect (prvm_prog_t *prog)
{
#if 1
- Con_Printf("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_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
#else
vec3_t org;
VM_SAFEPARMCOUNT(5, VM_CL_effect);
// better than CRASHING on overlong input lines that may SOMEHOW enter the buffer
if(i >= MAX_INPUTLINE)
{
- Con_Printf("Warning: console input buffer had an overlong line. Ignored.\n");
+ Con_Warnf("Warning: console input buffer had an overlong line. Ignored.\n");
line[0] = 0;
}
else
{
// empty cvar name?
if(alias)
- Con_Printf("Warning: Could not expand $ in alias %s\n", alias->name);
+ Con_Warnf("Warning: Could not expand $ in alias %s\n", alias->name);
else
- Con_Printf("Warning: Could not expand $\n");
+ Con_Warnf("Warning: Could not expand $\n");
return "$";
}
if(required)
{
if(alias)
- Con_Printf("Error: Could not expand $%s in alias %s\n", varname, alias->name);
+ Con_Errorf("Error: Could not expand $%s in alias %s\n", varname, alias->name);
else
- Con_Printf("Error: Could not expand $%s\n", varname);
+ Con_Errorf("Error: Could not expand $%s\n", varname);
return NULL;
}
else if(optional)
else
{
if(alias)
- Con_Printf("Warning: Could not expand $%s in alias %s\n", varname, alias->name);
+ Con_Warnf("Warning: Could not expand $%s in alias %s\n", varname, alias->name);
else
- Con_Printf("Warning: Could not expand $%s\n", varname);
+ Con_Warnf("Warning: Could not expand $%s\n", varname);
dpsnprintf(varval, sizeof(varval), "$%s", varname);
return varval;
}
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);
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
/// 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);
{
if (cls.demoplayback)
{
- Con_Printf("^1Warning: 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_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);
// Mem_Free(csprogsdata);
// return;
// We WANT to continue here, and play the demo with different csprogs!
else
{
Mem_Free(csprogsdata);
- Con_Printf("^1Your %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_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);
CL_Disconnect();
return;
}
if (requiredcrc >= 0)
{
if (cls.demoplayback)
- Con_Printf("CL_VM_Init: demo requires CSQC, but \"%s\" wasn't found\n", csqc_progname.string);
+ Con_Errorf("CL_VM_Init: demo requires CSQC, but \"%s\" wasn't found\n", csqc_progname.string);
else
- Con_Printf("CL_VM_Init: server requires CSQC, but \"%s\" wasn't found\n", csqc_progname.string);
+ Con_Errorf("CL_VM_Init: server requires CSQC, but \"%s\" wasn't found\n", csqc_progname.string);
CL_Disconnect();
}
return;
if (!prog->loaded)
{
- Host_Error("CSQC %s ^2failed to load\n", csprogsfn);
+ Host_Error("CSQC %s failed to load\n", csprogsfn);
if(!sv.active)
CL_Disconnect();
Mem_Free(csprogsdata);
}
else
{
- Con_Printf("unable to load pak \"%s\"\n", pakfile);
+ Con_Errorf("unable to load pak \"%s\"\n", pakfile);
return false;
}
}
p = FS_CheckGameDir(gamedirname1);
if(!p || p == fs_checkgamedir_missing)
- Con_Printf("WARNING: base gamedir %s%s/ not found!\n", fs_basedir, gamedirname1);
+ Con_Warnf("WARNING: base gamedir %s%s/ not found!\n", fs_basedir, gamedirname1);
if(gamedirname2)
{
p = FS_CheckGameDir(gamedirname2);
if(!p || p == fs_checkgamedir_missing)
- Con_Printf("WARNING: base gamedir %s%s/ not found!\n", fs_basedir, gamedirname2);
+ Con_Warnf("WARNING: base gamedir %s%s/ not found!\n", fs_basedir, gamedirname2);
}
// -game <gamedir>
if(!p)
Sys_Error("Nasty -game name rejected: %s", com_argv[i]);
if(p == fs_checkgamedir_missing)
- Con_Printf("WARNING: -game %s%s/ not found!\n", fs_basedir, com_argv[i]);
+ Con_Warnf("WARNING: -game %s%s/ not found!\n", fs_basedir, com_argv[i]);
// add the gamedir to the list of active gamedirs
strlcpy (fs_gamedirs[fs_numgamedirs], com_argv[i], sizeof(fs_gamedirs[fs_numgamedirs]));
fs_numgamedirs++;
opt = O_CREAT | O_APPEND;
break;
default:
- Con_Printf ("FS_SysOpen(%s, %s): invalid mode\n", filepath, mode);
+ Con_Errorf ("FS_SysOpen(%s, %s): invalid mode\n", filepath, mode);
return FILEDESC_INVALID;
}
for (ind = 1; mode[ind] != '\0'; ind++)
dolock = true;
break;
default:
- Con_Printf ("FS_SysOpen(%s, %s): unknown character in mode (%c)\n",
+ Con_Errorf ("FS_SysOpen(%s, %s): unknown character in mode (%c)\n",
filepath, mode, mode[ind]);
}
}
// No Zlib DLL = no compressed files
if (!zlib_dll && (pfile->flags & PACKFILE_FLAG_DEFLATED))
{
- Con_Printf("WARNING: can't open the compressed file %s\n"
+ Con_Warnf("WARNING: can't open the compressed file %s\n"
"You need the Zlib DLL to use compressed files\n",
pfile->name);
return NULL;
{
if (FILEDESC_SEEK (file->handle, file->buff_ind - file->buff_len, SEEK_CUR) == -1)
{
- Con_Printf("WARNING: could not seek in %s.\n", file->filename);
+ Con_Warnf("WARNING: could not seek in %s.\n", file->filename);
}
}
if (qFT_Init_FreeType(&font_ft2lib))
{
- Con_Print("ERROR: Failed to initialize the FreeType2 library!\n");
+ Con_Error("ERROR: Failed to initialize the FreeType2 library!\n");
Font_CloseLibrary();
return;
}
font_mempool = Mem_AllocPool("FONT", 0, NULL);
if (!font_mempool)
{
- Con_Print("ERROR: Failed to allocate FONT memory pool!\n");
+ Con_Error("ERROR: Failed to allocate FONT memory pool!\n");
Font_CloseLibrary();
return;
}
break;
if (! (fb = Font_Alloc()) )
{
- Con_Printf("Failed to allocate font for fallback %i of font %s\n", i, name);
+ Con_Errorf("Failed to allocate font for fallback %i of font %s\n", i, name);
break;
}
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_Printf("Failed to load font %s for fallback %i of font %s\n", dpfnt->fallbacks[i], i, name);
+ Con_Errorf("Failed to load font %s for fallback %i of font %s\n", dpfnt->fallbacks[i], i, name);
Mem_Free(fb);
continue;
}
}
if (!count)
{
- Con_Printf("Failed to allocate font for fallback %i of font %s\n", i, name);
+ Con_Errorf("Failed to allocate font for fallback %i of font %s\n", i, name);
Font_UnloadFont(fb);
Mem_Free(fb);
break;
{
if (!r_font_disable_freetype.integer)
{
- Con_Printf("WARNING: can't open load font %s\n"
+ Con_Warnf("WARNING: can't open load font %s\n"
"You need the FreeType2 DLL to load font files\n",
name);
}
namelen = strlen(name);
if (namelen + 5 > sizeof(filename))
{
- Con_Printf("WARNING: too long font name. Cannot load this.\n");
+ Con_Warnf("WARNING: too long font name. Cannot load this.\n");
return false;
}
status = qFT_New_Memory_Face(font_ft2lib, (FT_Bytes)data, datasize, _face, (FT_Face*)&font->face);
if (status && _face != 0)
{
- Con_Printf("Failed to load face %i of %s. Falling back to face 0\n", _face, name);
+ Con_Errorf("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_Printf("ERROR: can't create face for %s\n"
+ Con_Errorf("ERROR: can't create face for %s\n"
"Error %i\n", // TODO: error strings
name, status);
Font_UnloadFont(font);
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_Printf("Failed to add attachment %u to %s\n", (unsigned)i, font->name);
+ Con_Errorf("Failed to add attachment %u to %s\n", (unsigned)i, font->name);
}
strlcpy(font->name, name, sizeof(font->name));
temp.intSize = -1; // negative value: LoadMap must search now :)
if (!Font_LoadMap(font, &temp, 0, &fmap))
{
- Con_Printf("ERROR: can't load the first character map for %s\n"
+ Con_Errorf("ERROR: can't load the first character map for %s\n"
"This is fatal\n",
font->name);
Font_UnloadFont(font);
if (!Font_SetSize(font, fmap->intSize, fmap->intSize))
{
// this deserves an error message
- Con_Printf("Failed to get kerning for %s\n", font->name);
+ Con_Errorf("Failed to get kerning for %s\n", font->name);
return false;
}
ul = qFT_Get_Char_Index((FT_Face)font->face, left);
{
if (!Font_SetSize(font, intSize, intSize))
{
- Con_Printf("ERROR: can't set size for font %s: %f ((%f))\n", font->name, size, intSize);
+ Con_Errorf("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_Printf("ERROR: no appropriate size found for font %s: %f\n", font->name, size);
+ Con_Errorf("ERROR: no appropriate size found for font %s: %f\n", font->name, size);
return -1;
}
--intSize;
if (!font->image_font && !Font_SetSize(font, mapstart->intSize, mapstart->intSize))
{
- Con_Printf("ERROR: can't set sizes for font %s: %f\n", font->name, mapstart->size);
+ Con_Errorf("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_Printf("ERROR: Out of memory when loading fontmap for %s\n", font->name);
+ Con_Errorf("ERROR: Out of memory when loading fontmap for %s\n", font->name);
return false;
}
data = (unsigned char *)Mem_Alloc(font_mempool, (FONT_CHAR_LINES * map->glyphSize) * pitch);
if (!data)
{
- Con_Printf("ERROR: Failed to allocate memory for font %s size %g\n", font->name, map->size);
+ Con_Errorf("ERROR: Failed to allocate memory for font %s size %g\n", font->name, map->size);
Mem_Free(map);
return false;
}
h = bmp->rows;
if (w > (map->glyphSize - gpad_l - gpad_r) || h > (map->glyphSize - gpad_t - gpad_b)) {
- Con_Printf("WARNING: Glyph %lu is too big in font %s, size %g: %i x %i\n", ch, font->name, map->size, w, h);
+ Con_Warnf("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)
if (developer_font.integer)
Con_DPrintf("glyphinfo: Pixel Mode: Unknown: %i\n", bmp->pixel_mode);
Mem_Free(data);
- Con_Printf("ERROR: Unrecognized pixel mode for font %s size %f: %i\n", font->name, mapstart->size, bmp->pixel_mode);
+ Con_Errorf("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)
// otherwise we retry to load it every single frame where ft2 rendering is used
// this would be bad...
// only `data' must be freed
- Con_Printf("ERROR: Failed to generate texture for font %s size %f map %lu\n",
+ Con_Errorf("ERROR: Failed to generate texture for font %s size %f map %lu\n",
font->name, mapstart->size, mapidx);
return false;
}
R_Mesh_SetRenderTargets(0, NULL, NULL, NULL, NULL, NULL);
if (gl_printcheckerror.integer && !gl_paranoid.integer)
{
- Con_Printf("WARNING: gl_printcheckerror is on but gl_paranoid is off, turning it on...\n");
+ Con_Warnf("WARNING: gl_printcheckerror is on but gl_paranoid is off, turning it on...\n");
Cvar_SetValueQuick(&gl_paranoid, 1);
}
}
if (sizes == MAX_FONT_SIZES)
{
- Con_Printf("Warning: specified more than %i different font sizes, exceding ones are ignored\n", MAX_FONT_SIZES);
+ Con_Warnf("Warning: specified more than %i different font sizes, exceding ones are ignored\n", MAX_FONT_SIZES);
sizes = -1;
continue;
}
Con_Printf("%s written\n", modeinfo[mode].filename);
}
else
- Con_Printf("failed to write to %s\n", modeinfo[mode].filename);
+ Con_Errorf("failed to write to %s\n", modeinfo[mode].filename);
}
}
}
dpvsnprintf (hosterrorstring1,sizeof(hosterrorstring1),error,argptr);
va_end (argptr);
- Con_Printf("Host_Error: %s\n", hosterrorstring1);
+ Con_Errorf("Host_Error: %s\n", hosterrorstring1);
// LadyHavoc: if crashing very early, or currently shutting down, do
// Sys_Error instead
f = FS_OpenRealFile(file, "wb", false);
if (!f)
{
- Con_Printf("Couldn't write %s.\n", file);
+ Con_Errorf("Couldn't write %s.\n", file);
return;
}
{
// warn if it's significant
if (deltacleantime < -0.01)
- Con_Printf("Host_Mingled: time stepped backwards (went from %f to %f, difference %f)\n", olddirtytime, dirtytime, deltacleantime);
+ Con_Warnf("Host_Mingled: time stepped backwards (went from %f to %f, difference %f)\n", olddirtytime, dirtytime, deltacleantime);
deltacleantime = 0;
}
else if (deltacleantime >= 1800)
{
- Con_Printf("Host_Mingled: time stepped forward (went from %f to %f, difference %f)\n", olddirtytime, dirtytime, deltacleantime);
+ Con_Warnf("Host_Mingled: time stepped forward (went from %f to %f, difference %f)\n", olddirtytime, dirtytime, deltacleantime);
deltacleantime = 0;
}
realtime += deltacleantime;
{
if(locksession.integer == 2)
{
- Con_Printf("WARNING: session lock %s could not be acquired. Please run with -sessionid and an unique session name. Continuing anyway.\n", p);
+ Con_Warnf("WARNING: session lock %s could not be acquired. Please run with -sessionid and an unique session name. Continuing anyway.\n", p);
}
else
{
}
}
else
- Con_Print("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_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)
{
if (COM_ParseToken_Simple(&t, false, false, true))
k |= atoi(com_token);
if (!BufStr_FindCreateReplace(prog, i, k, "string"))
- Con_Printf("failed to create stringbuffer %i\n", i);
+ Con_Errorf("failed to create stringbuffer %i\n", i);
}
else
Con_Printf("unsupported stringbuffer index %i \"%s\"\n", i, com_token);
Con_Printf("unexpected end of line when parsing sv.bufstr (expected strindex)\n");
}
else
- Con_Printf("failed to create stringbuffer %i \"%s\"\n", i, com_token);
+ Con_Errorf("failed to create stringbuffer %i \"%s\"\n", i, com_token);
}
}
// skip any trailing text or unrecognized commands
static void PNG_error_fn(void *png, const char *message)
{
- Con_Printf("PNG_LoadImage: error: %s\n", message);
+ Con_Errorf("PNG_LoadImage: error: %s\n", message);
}
static void PNG_warning_fn(void *png, const char *message)
{
- Con_Printf("PNG_LoadImage: warning: %s\n", message);
+ Con_Warnf("PNG_LoadImage: warning: %s\n", message);
}
unsigned char *PNG_LoadImage_BGRA (const unsigned char *raw, int filesize, int *miplevel)
int rfc1149only = 0;
int rfc1149enabled = 0;
if(setsockopt(lhnetsocket->inetsocket, SOL_RFC1149, RFC1149_1149ONLY, &rfc1149only))
- Con_Printf("LHNET_OpenSocket_Connectionless: warning: setsockopt(RFC1149_1149ONLY) returned error: %s\n", LHNETPRIVATE_StrError());
+ Con_Errorf("LHNET_OpenSocket_Connectionless: warning: setsockopt(RFC1149_1149ONLY) returned error: %s\n", LHNETPRIVATE_StrError());
if(setsockopt(lhnetsocket->inetsocket, SOL_RFC1149, RFC1149_ENABLED, &rfc1149enabled))
- Con_Printf("LHNET_OpenSocket_Connectionless: warning: setsockopt(RFC1149_ENABLED) returned error: %s\n", LHNETPRIVATE_StrError());
+ Con_Errorf("LHNET_OpenSocket_Connectionless: warning: setsockopt(RFC1149_ENABLED) returned error: %s\n", LHNETPRIVATE_StrError());
}
#endif
if (nodeportal->numpoints < 3)
{
- Con_Print("Mod_Q1BSP_RecursiveNodePortals: WARNING: new portal was clipped away\n");
+ Con_Warn("Mod_Q1BSP_RecursiveNodePortals: WARNING: new portal was clipped away\n");
nodeportal->numpoints = 0;
}
else if (nodeportal->numpoints >= MAX_PORTALPOINTS)
{
- Con_Print("Mod_Q1BSP_RecursiveNodePortals: WARNING: new portal has too many points\n");
+ Con_Warn("Mod_Q1BSP_RecursiveNodePortals: WARNING: new portal has too many points\n");
nodeportal->numpoints = 0;
}
else
{
// LadyHavoc: empty submodel(lacrima.bsp has such a glitch)
- Con_Printf("warning: empty submodel *%i in %s\n", i+1, loadmodel->name);
+ Con_Warnf("warning: empty submodel *%i in %s\n", i+1, loadmodel->name);
}
//mod->brushq1.num_visleafs = bm->visleafs;
}
else
{
- Con_Printf("warning: empty submodel *%i in %s\n", i+1, loadmodel->name);
+ Con_Warnf("warning: empty submodel *%i in %s\n", i+1, loadmodel->name);
}
//mod->brushq1.num_visleafs = bm->visleafs;
}
if(xtess == -1)
{
- Con_Printf("ERROR: patch %d isn't preprocessed?!?\n", i);
+ Con_Errorf("ERROR: patch %d isn't preprocessed?!?\n", i);
xtess = ytess = cxtess = cytess = 0;
}
invalidelements++;
if (invalidelements)
{
- Con_Printf("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_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);
for (j = 0;j < out->num_triangles * 3;j++)
{
Con_Printf(" %i", (loadmodel->surfmesh.data_element3i + 3 * out->num_firsttriangle)[j] - out->num_firstvertex);
{
if (l->filelen < count * (int)sizeof(*in))
{
- Con_Printf("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_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]);
return; // ignore the grid if we cannot understand it
}
if (l->filelen != count * (int)sizeof(*in))
- Con_Printf("Mod_Q3BSP_LoadLightGrid: Warning: calculated lightgrid size %i bytes does not match lump size %i\n", (int)(count * sizeof(*in)), l->filelen);
+ Con_Warnf("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;
pinframe = &pinqsprite->frames[i];
if (!(skinframe = R_SkinFrame_LoadExternal(pinframe->name, texflags, false, false)))
{
- Con_Printf("Mod_IDS2_Load: failed to load %s", pinframe->name);
+ Con_Errorf("Mod_IDS2_Load: failed to load %s", pinframe->name);
skinframe = R_SkinFrame_LoadMissing();
}
Mod_SpriteSetupTexture(&loadmodel->data_textures[i], skinframe, fullbright, false);
else
{
LHNETADDRESS_ToString(&address, addressstring2, sizeof(addressstring2), true);
- Con_Printf("Client failed to open a socket on address %s\n", addressstring2);
+ Con_Errorf("Client failed to open a socket on address %s\n", addressstring2);
}
}
else
- Con_Printf("Client unable to parse address %s\n", addressstring);
+ Con_Errorf("Client unable to parse address %s\n", addressstring);
}
void NetConn_OpenClientPorts(void)
else
{
LHNETADDRESS_ToString(&address, addressstring2, sizeof(addressstring2), true);
- Con_Printf("Server failed to open socket on address %s\n", addressstring2);
+ Con_Errorf("Server failed to open socket on address %s\n", addressstring2);
}
}
else
{
- Con_Printf("Server unable to parse address %s\n", addressstring);
+ Con_Errorf("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;
}
long t1, t2;
if (!password[0]) {
- Con_Print("^4LOGIC ERROR: RCon_Authenticate should never call the comparator with an empty password. Please report.\n");
+ Con_Error("LOGIC ERROR: RCon_Authenticate should never call the comparator with an empty password. Please report.\n");
return false;
}
int i;
if (!password[0]) {
- Con_Print("^4LOGIC ERROR: RCon_Authenticate should never call the comparator with an empty password. Please report.\n");
+ Con_Error("LOGIC ERROR: RCon_Authenticate should never call the comparator with an empty password. Please report.\n");
return false;
}
static qboolean plaintext_matching(lhnetaddress_t *peeraddress, const char *password, const char *hash, const char *s, int slen)
{
if (!password[0]) {
- Con_Print("^4LOGIC ERROR: RCon_Authenticate should never call the comparator with an empty password. Please report.\n");
+ Con_Error("LOGIC ERROR: RCon_Authenticate should never call the comparator with an empty password. Please report.\n");
return false;
}
{
int i, ret, clientnum, best;
double besttime;
- char *string, response[1400], addressstring2[128];
+ char *string, response[2800], addressstring2[128];
static char stringbuf[16384]; // server only
qboolean islocal = (LHNETADDRESS_GetAddressType(peeraddress) == LHNETADDRESSTYPE_LOOP);
char senddata[NET_HEADERSIZE+NET_MAXMESSAGE+CRYPTO_HEADERSIZE];
}
if (!masterquerycount)
{
- Con_Print("Unable to query master servers, no suitable network sockets active.\n");
+ Con_Error("Unable to query master servers, no suitable network sockets active.\n");
M_Update_Return_Reason("No network");
}
}
Cvar_SetQuick(&net_address, com_argv[i + 1]);
}
else
- Con_Printf("-ip option used, but unable to parse the address \"%s\"\n", com_argv[i + 1]);
+ Con_Errorf("-ip option used, but unable to parse the address \"%s\"\n", com_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 < com_argc)
Cvar_SetValueQuick(&sv_netport, i);
}
else
- Con_Printf("-port option used, but %i is not a valid port number\n", i);
+ Con_Errorf("-port option used, but %i is not a valid port number\n", i);
}
cl_numsockets = 0;
sv_numsockets = 0;
/// qc-defined short status string
char qcstatus[128];
/// frags/ping/name list (if they fit in the packet)
- char players[1400];
+ char players[2800];
/// max client number
int maxplayers;
/// number of currently connected players (including bots)
if (newnum != oldnum && !delta && !invalid)
{
cl.qw_validsequence = 0;
- Con_Printf("WARNING: U_REMOVE %i on full update\n", newnum);
+ Con_Warnf("WARNING: U_REMOVE %i on full update\n", newnum);
}
}
else
dpvsnprintf(msg,sizeof(msg),fmt,argptr);
va_end(argptr);
- Con_Print(msg);
+ Con_Warn(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 != realtime) // NOTE: this compares to the time, just in case if PRVM_PrintState causes a Host_Error and keeps recursive set
char string[VM_STRINGTEMP_LENGTH];
VM_VarString(prog, 0, string, sizeof(string));
- Con_Printf("======%s ERROR in %s:\n%s\n", prog->name, PRVM_GetString(prog, prog->xfunction->s_name), string);
+ Con_Errorf("======%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);
char string[VM_STRINGTEMP_LENGTH];
VM_VarString(prog, 0, string, sizeof(string));
- Con_Printf("======OBJECT ERROR======\n"); // , prog->name, PRVM_GetString(prog->xfunction->s_name), string); // or include them? FIXME
+ Con_Errorf("======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_Printf("%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_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_Print("skybox disabled\n");
}
else
- Con_Printf("failed to load skybox %s\n", Cmd_Argv(cmd, 1));
+ Con_Errorf("failed to load skybox %s\n", Cmd_Argv(cmd, 1));
break;
default:
Con_Print("usage: loadsky skyname\n");
if ((audio_device = SDL_OpenAudioDevice(NULL, 0, &wantspec, &obtainspec, SDL_AUDIO_ALLOW_FREQUENCY_CHANGE | SDL_AUDIO_ALLOW_CHANNELS_CHANGE)) == 0)
{
- Con_Printf( "Failed to open the audio device! (%s)\n", SDL_GetError() );
+ Con_Errorf( "Failed to open the audio device! (%s)\n", SDL_GetError() );
return false;
}
client->sv_demo_file = FS_OpenRealFile(name, "wb", false);
if(!client->sv_demo_file)
{
- Con_Print("ERROR: couldn't open.\n");
+ Con_Error("ERROR: couldn't open.\n");
return;
}
dpvsnprintf (string, sizeof (string), error, argptr);
va_end (argptr);
- Con_Printf ("Engine Error: %s\n", string);
+ Con_Errorf ("Engine Error: %s\n", string);
Host_Shutdown ();
exit (1);
dpvsnprintf (string, sizeof (string), error, argptr);
va_end (argptr);
- Con_Printf ("Engine Error: %s\n", string);
+ Con_Errorf ("Engine Error: %s\n", string);
#ifdef WIN32
MessageBox(NULL, string, "Engine Error", MB_OK | MB_SETFOREGROUND | MB_ICONSTOP);
return;
Con_DPrintf("Process is becoming 'nice'...\n");
if(setpriority(PRIO_PROCESS, 0, 19))
- Con_Printf("Failed to raise nice level to %d\n", 19);
+ Con_Errorf("Failed to raise nice level to %d\n", 19);
isnice = true;
}
void Sys_MakeProcessMean (void)
return;
Con_DPrintf("Process is becoming 'mean'...\n");
if(setpriority(PRIO_PROCESS, 0, nicelevel))
- Con_Printf("Failed to lower nice level to %d\n", nicelevel);
+ Con_Errorf("Failed to lower nice level to %d\n", nicelevel);
isnice = false;
}
#else
dpvsnprintf (text, sizeof (text), error, argptr);
va_end (argptr);
- Con_Printf ("Engine Error: %s\n", text);
+ Con_Errorf ("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)
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_Printf("Failed to init SDL joystick subsystem: %s\n", SDL_GetError());
+ Con_Errorf("Failed to init SDL joystick subsystem: %s\n", SDL_GetError());
vid_isfullscreen = false;
}
}
else
{
- Con_Printf("Joystick %i failed (SDL_JoystickOpen(%i) returned: %s)\n", index, sdlindex, SDL_GetError());
+ Con_Errorf("Joystick %i failed (SDL_JoystickOpen(%i) returned: %s)\n", index, sdlindex, SDL_GetError());
sdlindex = -1;
}
}
drivername = com_argv[i + 1];
if (SDL_GL_LoadLibrary(drivername) < 0)
{
- Con_Printf("Unable to load GL driver \"%s\": %s\n", drivername, SDL_GetError());
+ Con_Errorf("Unable to load GL driver \"%s\": %s\n", drivername, SDL_GetError());
return false;
}
#endif
window = SDL_CreateWindow(gamename, xPos, yPos, mode->width, mode->height, windowflags);
if (window == NULL)
{
- Con_Printf("Failed to set video mode to %ix%i: %s\n", mode->width, mode->height, SDL_GetError());
+ Con_Errorf("Failed to set video mode to %ix%i: %s\n", mode->width, mode->height, SDL_GetError());
VID_Shutdown();
return false;
}
context = SDL_GL_CreateContext(window);
if (context == NULL)
{
- Con_Printf("Failed to initialize OpenGL context: %s\n", SDL_GetError());
+ Con_Errorf("Failed to initialize OpenGL context: %s\n", SDL_GetError());
VID_Shutdown();
return false;
}
if (!file)
{
if (complain)
- Con_Printf("W_LoadTextureWadFile: couldn't find %s\n", filename);
+ Con_Errorf("W_LoadTextureWadFile: couldn't find %s\n", filename);
return;
}
if (FS_Read(file, &header, sizeof(wadinfo_t)) != sizeof(wadinfo_t))
- {Con_Print("W_LoadTextureWadFile: unable to read wad header\n");FS_Close(file);file = NULL;return;}
+ {Con_Error("W_LoadTextureWadFile: unable to read wad header\n");FS_Close(file);file = NULL;return;}
if(memcmp(header.identification, "WAD3", 4))
- {Con_Printf("W_LoadTextureWadFile: Wad file %s doesn't have WAD3 id\n",filename);FS_Close(file);file = NULL;return;}
+ {Con_Errorf("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_Printf("W_LoadTextureWadFile: invalid number of lumps (%i)\n", numlumps);FS_Close(file);file = NULL;return;}
+ {Con_Errorf("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_Print("W_LoadTextureWadFile: unable to seek to lump table\n");FS_Close(file);file = NULL;return;}
+ {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);
if (!w->lumps)
{
- Con_Print("W_LoadTextureWadFile: unable to allocate temporary memory for lump table\n");
+ Con_Error("W_LoadTextureWadFile: unable to allocate temporary memory for lump table\n");
FS_Close(w->file);
w->file = NULL;
w->numlumps = 0;
if (FS_Read(file, w->lumps, sizeof(lumpinfo_t) * w->numlumps) != (fs_offset_t)sizeof(lumpinfo_t) * numlumps)
{
- Con_Print("W_LoadTextureWadFile: unable to read lump table\n");
+ Con_Error("W_LoadTextureWadFile: unable to read lump table\n");
FS_Close(w->file);
w->file = NULL;
w->numlumps = 0;
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_Printf("WARNING: Polygon %d is not defined counterclockwise\n", i);
+ Con_Warnf("WARNING: Polygon %d is not defined counterclockwise\n", i);
if (planesData[(i*4)+3] < 0)
- Con_Printf("WARNING: Plane %d does not contain the origin\n", i);
+ Con_Warnf("WARNING: Plane %d does not contain the origin\n", i);
polygons += (*polygons + 1);
}
// create geom