fix Sys_Error with jpeg screenshots, standardize console warning/error/notice colors

git-svn-id: https://svn.code.sf.net/p/fteqw/code/trunk@1984 fc73d0e0-1445-4013-8a0c-d673dee63da5
This commit is contained in:
TimeServ 2006-02-22 01:24:22 +00:00
parent 083ea9f7c7
commit df16aa1400
19 changed files with 59 additions and 58 deletions

View file

@ -1622,7 +1622,7 @@ void CL_Packet_f (void)
adr.address.ip[2] = cls.netchan.remote_address.address.ip[2];
adr.address.ip[3] = cls.netchan.remote_address.address.ip[3];
adr.port = cls.netchan.remote_address.port;
Con_Printf ("^b^1Server is broken. Trying to send to server instead.\n");
Con_Printf (S_WARNING "Server is broken. Trying to send to server instead.\n");
}
@ -2746,7 +2746,7 @@ void VARGS Host_EndGame (char *message, ...)
va_end (argptr);
Con_TPrintf (TL_NL);
Con_TPrintf (TL_LINEBREAK_EQUALS);
Con_TPrintf (TLC_CLIENTCON_ERROR_ENDGAME,string);
Con_TPrintf (TLC_CLIENTCON_ERROR_ENDGAME, S_ERROR, string);
Con_TPrintf (TL_LINEBREAK_EQUALS);
Con_TPrintf (TL_NL);
@ -2781,7 +2781,7 @@ void VARGS Host_Error (char *error, ...)
va_start (argptr,error);
_vsnprintf (string,sizeof(string)-1, error,argptr);
va_end (argptr);
Con_TPrintf (TLC_HOSTFATALERROR,string);
Con_TPrintf (TLC_HOSTFATALERROR, string);
CL_Disconnect ();
cls.demonum = -1;

View file

@ -1141,7 +1141,7 @@ void CL_ParseDownload (void)
if (!*cls.downloadname) //huh... that's not right...
{
Con_Printf("^1Warning^7: Server sending unknown file.\n");
Con_Printf(S_WARNING "Warning: Server sending unknown file.\n");
strcpy(cls.downloadname, "unknown.txt");
strcpy(cls.downloadtempname, "unknown.tmp");
}
@ -4560,7 +4560,7 @@ void CLNQ_ParseServerMessage (void)
if (cl.playernum[0] >= MAX_CLIENTS)
{
cl.playernum[0] = 32; //pretend it's an mvd (we have that spare slot)
Con_Printf("^1WARNING: Server put us in slot %i. We are not on the scoreboard.\n");
Con_Printf(S_WARNING "WARNING: Server put us in slot %i. We are not on the scoreboard.\n");
}
}
else

View file

@ -501,7 +501,7 @@ qboolean CIN_PlayCinematic (char *arg)
CIN_FinishCinematic ();
cin.cinematictime = 0; // done
Con_Printf("^1Cinematic %s not found.\n", name);
Con_Printf(S_WARNING "Cinematic %s not found.\n", name);
return true;
}

View file

@ -1057,7 +1057,8 @@ void screenshotJPEG(char *filename, qbyte *screendata, int screenwidth, int scre
{
FS_CreatePath (filename, FS_GAME);
if (!(outfile = FS_OpenVFS(filename, "wb", FS_GAMEONLY)))
Sys_Error ("Error opening %s", filename);
Con_Printf("Error opening %s\n", filename);
return;
}
cinfo.err = jpeg_std_error(&jerr.pub);

View file

@ -1039,7 +1039,7 @@ static void PF_R_SetViewFlag(progfuncs_t *prinst, struct globalvars_s *pr_global
break;
case VF_CARTESIAN_ANGLES:
Con_Printf("^1WARNING: CARTESIAN ANGLES ARE NOT YET SUPPORTED!\n");
Con_Printf(S_WARNING "WARNING: CARTESIAN ANGLES ARE NOT YET SUPPORTED!\n");
break;
case VF_VIEWPORT:

View file

@ -1889,22 +1889,18 @@ TRACE(("dbg: R_RestartRenderer_f\n"));
if (R_ApplyRenderer(&oldr))
{
TRACE(("dbg: R_RestartRenderer_f old restored\n"));
Con_Printf("^1Video mode switch failed. Old mode restored.\n"); //go back to the old mode, the new one failed.
Con_Printf(S_ERROR "Video mode switch failed. Old mode restored.\n"); //go back to the old mode, the new one failed.
}
else
{
Con_Printf("^1Trying default refresh rate\n");
Con_Printf(S_NOTICE "Trying default refresh rate\n");
newr.rate = 0;
if (!R_ApplyRenderer(&oldr))
{
if (R_ApplyRenderer(&newr))
{
TRACE(("dbg: R_RestartRenderer_f going to dedicated\n"));
Con_Printf("\n================================\n");
Con_Printf("^1Video mode switch failed. Old mode wasn't supported either. Console forced.\nChange vid_width, vid_height, vid_bpp, vid_displayfrequency to a compatable mode, and then use the setrenderer command.\n");
Con_Printf("================================\n\n");
Con_Printf(S_ERROR "Video mode switch failed. Old mode wasn't supported either. Console forced.\nChange vid_width, vid_height, vid_bpp, vid_displayfrequency to a compatable mode, and then use the setrenderer command.\n");
}
else
Sys_Error("Couldn't fall back to previous renderer\n");

View file

@ -364,9 +364,9 @@ void Validation_CheckIfResponse(char *text)
resp = Security_Verify_Response(f_query_client, crc);
if (resp && resp->size && *resp->buf)
Con_Printf("Authentication Successful.\n");
Con_Printf(S_NOTICE "Authentication Successful.\n");
else// if (!resp)
Con_Printf("^1^bAUTHENTICATION FAILED.\n");
Con_Printf(S_ERROR "AUTHENTICATION FAILED.\n");
/*
typedef signed_buffer_t *(*Security_Verify_Response_t) (int, unsigned char *);
// write request
@ -382,10 +382,10 @@ void Validation_CheckIfResponse(char *text)
if (auth_answer == SECURE_ANSWER_YES && auth_crc == user_crc)
{
Con_Printf("Authentication Successful.\n");
Con_Printf(S_NOTICE "Authentication Successful.\n");
}
else
Con_Printf("^1^bAUTHENTICATION FAILED.\n");
Con_Printf(S_ERROR "AUTHENTICATION FAILED.\n");
*/
}
}
@ -1006,10 +1006,10 @@ void Validation_CheckIfResponse(char *text)
if (auth_answer == SECURE_ANSWER_YES && auth_crc == user_crc)
{
Con_Printf("Authentication Successful.\n");
Con_Printf(S_NOTICE "Authentication Successful.\n");
}
else
Con_Printf("^1^bAUTHENTICATION FAILED.\n");
Con_Printf(S_ERROR "AUTHENTICATION FAILED.\n");
}
}

View file

@ -700,7 +700,7 @@ void Cmd_Alias_f (void)
s = Cbuf_GetNext(Cmd_ExecLevel);
if (!*s)
{
Con_Printf("^1WARNING: ^7Multiline alias was not terminated\n");
Con_Printf(S_WARNING "WARNING: Multiline alias was not terminated\n");
break;
}
while (*s <= ' ' && *s)

View file

@ -79,6 +79,10 @@ extern conchar_t q3codemasks[MAXQ3COLOURS];
#define S_COLOR_MAGENTA "^6"
#define S_COLOR_WHITE "^7"
#define S_WARNING "^&E0"
#define S_ERROR "^&C0"
#define S_NOTICE "^&-1"
#define CON_TEXTSIZE 16384
#define isextendedcode(x) ((x >= '0' && x <= '9') || (x >= 'A' && x <= 'F') || x == '-')

View file

@ -1570,7 +1570,7 @@ int COM_FOpenLocationFILE(flocation_t *loc, FILE **file)
int COM_FOpenFile(char *filename, FILE **file)
{
flocation_t loc;
Con_Printf("^1COM_FOpenFile is obsolete\n");
Con_Printf(S_ERROR "COM_FOpenFile is obsolete\n");
FS_FLocateFile(filename, FSLFRT_LENGTH, &loc);
com_filesize = -1;

View file

@ -1247,7 +1247,7 @@ void CMod_LoadTexInfo (lump_t *l) //yes I know these load from the same place
{
out->texture = Hunk_Alloc(sizeof(texture_t) + 16*16+8*8+4*4+2*2);
Con_Printf ("^2Couldn't load %s\n", name);
Con_Printf (S_WARNING "Couldn't load %s\n", name);
memcpy(out->texture, r_notexture_mip, sizeof(texture_t) + 16*16+8*8+4*4+2*2);
// out->texture = r_notexture_mip; // texture not found
// out->flags = 0;

View file

@ -988,7 +988,7 @@ int VARGS Plug_Net_SetTLSClient(void *offset, unsigned int mask, const long *arg
if (ret < 0)
{
Con_Printf ("^1*** TLS handshake failed\n");
Con_Printf (S_ERROR "*** TLS handshake failed\n");
gnutls_perror (ret);
stream->type = STREAM_SOCKET; //go back to regular socket

View file

@ -521,7 +521,7 @@ void Zone_Print_f(void)
{
if (sent[i] != sentinalkey)
{
Con_Printf("^1%i %i-%s\n", zone->size, i, (char *)(zone+1) + zone->size+ZONEDEBUG*2);
Con_Printf(S_ERROR "%i %i-%s\n", zone->size, i, (char *)(zone+1) + zone->size+ZONEDEBUG*2);
break;
}
}
@ -530,7 +530,7 @@ void Zone_Print_f(void)
{
if (sent[i] != sentinalkey)
{
Con_Printf("^1%i %i-%s\n", zone->size, i, (char *)(zone+1) + zone->size+ZONEDEBUG*2);
Con_Printf(S_ERROR "%i %i-%s\n", zone->size, i, (char *)(zone+1) + zone->size+ZONEDEBUG*2);
break;
}
}
@ -549,8 +549,8 @@ void Zone_Print_f(void)
overhead += sizeof(zone_t)+ZONEDEBUG*2;
#endif
}
Con_Printf("Zone:%i bytes in %i blocks\n", allocated, blocks);
Con_Printf("Overhead %i bytes\n", overhead);
Con_Printf(S_NOTICE "Zone:%i bytes in %i blocks\n", allocated, blocks);
Con_Printf(S_NOTICE "Overhead %i bytes\n", overhead);
}
#else

View file

@ -584,7 +584,7 @@ static void Shaderpass_Map ( shader_t *shader, shaderpass_t *pass, char **ptr )
if ( !pass->anim_frames[0] ) {
pass->anim_frames[0] = 0;//FIZME: r_notexture;
Con_DPrintf ( S_COLOR_YELLOW "Shader %s has a stage with no image: %s.\n", shader->name, token );
Con_DPrintf (S_WARNING "Shader %s has a stage with no image: %s.\n", shader->name, token );
}
}
}
@ -613,7 +613,7 @@ static void Shaderpass_AnimMap ( shader_t *shader, shaderpass_t *pass, char **pt
if ( !image ) {
pass->anim_frames[pass->anim_numframes++] = 0;//fizme: r_notexture;
Con_DPrintf ( S_COLOR_YELLOW "Shader %s has an animmap with no image: %s.\n", shader->name, token );
Con_DPrintf (S_WARNING "Shader %s has an animmap with no image: %s.\n", shader->name, token );
} else {
pass->anim_frames[pass->anim_numframes++] = image;
}
@ -637,7 +637,7 @@ static void Shaderpass_ClampMap ( shader_t *shader, shaderpass_t *pass, char **p
if ( !pass->anim_frames[0] ) {
pass->anim_frames[0] = 0;//fizme:r_notexture;
Con_DPrintf ( S_COLOR_YELLOW "Shader %s has a stage with no image: %s.\n", shader->name, token );
Con_DPrintf (S_WARNING "Shader %s has a stage with no image: %s.\n", shader->name, token );
}
}
@ -1768,7 +1768,7 @@ void Shader_DefaultBSP(char *shortname, shader_t *s)
pass->flush = R_RenderMeshGeneric;
if ( !pass->anim_frames[0] ) {
Con_DPrintf ( S_COLOR_YELLOW "Shader %s has a stage with no image: %s.\n", s->name, shortname );
Con_DPrintf (S_WARNING "Shader %s has a stage with no image: %s.\n", s->name, shortname );
pass->anim_frames[0] = 0;//fizme:r_notexture;
}
@ -1797,7 +1797,7 @@ void Shader_DefaultBSPVertex(char *shortname, shader_t *s)
pass->flush = R_RenderMeshGeneric;
if ( !pass->anim_frames[0] ) {
Con_DPrintf ( S_COLOR_YELLOW "Shader %s has a stage with no image: %s.\n", s->name, shortname );
Con_DPrintf (S_WARNING "Shader %s has a stage with no image: %s.\n", s->name, shortname );
pass->anim_frames[0] = 0;//fizme:r_notexture;
}
@ -1828,7 +1828,7 @@ void Shader_DefaultBSPFlare(char *shortname, shader_t *s)
pass->flush = R_RenderMeshGeneric;
if ( !pass->anim_frames[0] ) {
Con_DPrintf ( S_COLOR_YELLOW "Shader %s has a stage with no image: %s.\n", s->name, shortname );
Con_DPrintf (S_WARNING "Shader %s has a stage with no image: %s.\n", s->name, shortname );
pass->anim_frames[0] = 0;//fizme:r_notexture;
}
@ -1865,7 +1865,7 @@ void Shader_DefaultSkin(char *shortname, shader_t *s)
pass->flush = R_RenderMeshGeneric;
if (!pass->anim_frames[0])
{
Con_DPrintf ( S_COLOR_YELLOW "Shader %s has a stage with no image: %s.\n", s->name, shortname );
Con_DPrintf (S_WARNING "Shader %s has a stage with no image: %s.\n", s->name, shortname );
pass->anim_frames[0] = 0;//fizme:r_notexture;
}
}
@ -1887,7 +1887,7 @@ void Shader_DefaultSkin(char *shortname, shader_t *s)
pass->flush = R_RenderMeshGeneric;
if (!pass->anim_frames[0])
{
Con_DPrintf ( S_COLOR_YELLOW "Shader %s has a stage with no image: %s.\n", s->name, shortname );
Con_DPrintf (S_WARNING "Shader %s has a stage with no image: %s.\n", s->name, shortname );
pass->anim_frames[0] = 0;//fizme:r_notexture;
}
}
@ -1909,7 +1909,7 @@ void Shader_DefaultSkin(char *shortname, shader_t *s)
pass->flush = R_RenderMeshGeneric;
if (!pass->anim_frames[0])
{
Con_DPrintf ( S_COLOR_YELLOW "Shader %s has a stage with no image: %s.\n", s->name, shortname );
Con_DPrintf (S_WARNING "Shader %s has a stage with no image: %s.\n", s->name, shortname );
pass->anim_frames[0] = 0;//fizme:r_notexture;
}
}
@ -1931,7 +1931,7 @@ void Shader_DefaultSkin(char *shortname, shader_t *s)
pass->flush = R_RenderMeshGeneric;
if (!pass->anim_frames[0])
{
Con_DPrintf (S_COLOR_YELLOW "Shader %s has a stage with no image: %s.\n", s->name, shortname);
Con_DPrintf (S_WARNING "Shader %s has a stage with no image: %s.\n", s->name, shortname);
pass->anim_frames[0] = 0;//fizme:r_notexture;
}
}
@ -1962,7 +1962,7 @@ void Shader_DefaultSkinShell(char *shortname, shader_t *s)
pass->flush = R_RenderMeshGeneric;
if ( !pass->anim_frames[0] ) {
Con_DPrintf ( S_COLOR_YELLOW "Shader %s has a stage with no image: %s.\n", s->name, shortname );
Con_DPrintf (S_WARNING "Shader %s has a stage with no image: %s.\n", s->name, shortname );
pass->anim_frames[0] = 0;//fizme:r_notexture;
}
@ -2002,7 +2002,7 @@ void Shader_Default2D(char *shortname, shader_t *s)
pass->flush = R_RenderMeshGeneric;
if ( !pass->anim_frames[0] ) {
Con_DPrintf ( S_COLOR_YELLOW "Shader %s has a stage with no image: %s.\n", s->name, shortname );
Con_DPrintf (S_WARNING "Shader %s has a stage with no image: %s.\n", s->name, shortname );
pass->anim_frames[0] = 0;//fizme:r_notexture;
}

View file

@ -749,7 +749,7 @@ qboolean VID_AttachGL (rendererstate_t *info)
maindc = GetDC(mainwindow);
Con_Printf(S_COLOR_GREEN"OpenGL to Direct3D wrapper enabled\n"); //green to make it show.
Con_Printf(S_NOTICE "OpenGL to Direct3D wrapper enabled\n"); //green to make it show.
break;
}
#endif
@ -791,13 +791,13 @@ qboolean VID_AttachGL (rendererstate_t *info)
baseRC = qwglCreateContext( maindc );
if (!baseRC)
{
Con_SafePrintf(S_COLOR_RED"Could not initialize GL (wglCreateContext failed).\n\nMake sure you in are 65535 color mode, and try running -window.\n"); //green to make it show.
Con_SafePrintf(S_ERROR "Could not initialize GL (wglCreateContext failed).\n\nMake sure you in are 65535 color mode, and try running -window.\n"); //green to make it show.
return false;
}
TRACE(("dbg: VID_AttachGL: qwglMakeCurrent\n"));
if (!qwglMakeCurrent( maindc, baseRC ))
{
Con_SafePrintf(S_COLOR_RED"wglMakeCurrent failed\n"); //green to make it show.
Con_SafePrintf(S_ERROR "wglMakeCurrent failed\n"); //green to make it show.
return false;
}
@ -1459,7 +1459,7 @@ qboolean GLVID_Init (rendererstate_t *info, unsigned char *palette)
if (!RegisterClass (&wc) )
{
Con_Printf("^1Couldn't register window class\n");
Con_Printf(S_ERROR "Couldn't register window class\n");
return false;
}

View file

@ -584,7 +584,7 @@ static void Triangulate_AddLine(int v1, int v2) //order makes a difference
{ //close up
if (polyregions[endof].numverts+1 >= MAX_POLYVERTS)
{
Con_Printf("^1WARNING: Map region is too large.\n");
Con_Printf(S_WARNING "WARNING: Map region is too large.\n");
return;
}
polyregions[endof].vertex[polyregions[endof].numverts] = v2;
@ -594,7 +594,7 @@ static void Triangulate_AddLine(int v1, int v2) //order makes a difference
{
if (polyregions[endof].numverts+polyregions[beginingof].numverts >= MAX_POLYVERTS)
{
Con_Printf("^1WARNING: Map region is too large.\n");
Con_Printf(S_WARNING "WARNING: Map region is too large.\n");
return;
}
memcpy(polyregions[endof].vertex + polyregions[endof].numverts,
@ -608,7 +608,7 @@ static void Triangulate_AddLine(int v1, int v2) //order makes a difference
{ //insert into
if (polyregions[beginingof].numverts+1 >= MAX_POLYVERTS)
{
Con_Printf("^1WARNING: Map region is too large.\n");
Con_Printf(S_WARNING "WARNING: Map region is too large.\n");
return;
}
@ -622,7 +622,7 @@ static void Triangulate_AddLine(int v1, int v2) //order makes a difference
{ //stick outselves on the end
if (polyregions[endof].numverts+1 >= MAX_POLYVERTS)
{
Con_Printf("^1WARNING: Map region is too large.\n");
Con_Printf(S_WARNING "WARNING: Map region is too large.\n");
return;
}
polyregions[endof].vertex[polyregions[endof].numverts] = v2;
@ -635,7 +635,7 @@ static void Triangulate_AddLine(int v1, int v2) //order makes a difference
freer = regions++;
if (regions > MAX_REGIONS)
{
Con_Printf("^1WARNING: Too many regions. Sector is too chaotic/complicated.\n");
Con_Printf(S_WARNING "WARNING: Too many regions. Sector is too chaotic/complicated.\n");
freer = 0;
regions = 1;
}
@ -704,7 +704,7 @@ static unsigned short *Triangulate_Finish(int *numtris, unsigned short *old, int
{ //build a triangle fan.
if (numindexes+3 > MAX_POLYVERTS)
{
Con_Printf("^1WARNING: Sector is too big for triangulation\n");
Con_Printf(S_WARNING "WARNING: Sector is too big for triangulation\n");
break;
}
v3 = polyregions[r].vertex[v];
@ -724,7 +724,7 @@ static unsigned short *Triangulate_Finish(int *numtris, unsigned short *old, int
f++;
if (f >= 1000)
{ //infinate loop - shouldn't happen. must have got the angle stuff wrong.
Con_Printf("^1WARNING: Failed to triangulate polygon\n");
Con_Printf(S_WARNING "WARNING: Failed to triangulate polygon\n");
break;
}
continue;
@ -746,7 +746,7 @@ static unsigned short *Triangulate_Finish(int *numtris, unsigned short *old, int
if (!numindexes)
{
Con_Printf("^1Warning: Sector is empty\n");
Con_Printf(S_WARNING "Warning: Sector is empty\n");
*numtris = 0;
regions = 0;
@ -1255,7 +1255,7 @@ static void MoveWorld(void)
return; //doesn't need adjusting, live with it.
if (max[0]-min[0]>=8192 || max[1]-min[1]>=8192)
Con_Printf("^1Warning: Map is too large for the network protocol\n");
Con_Printf(S_WARNING "Warning: Map is too large for the network protocol\n");
Con_Printf("Adjusting map\n");

View file

@ -315,7 +315,7 @@ iwboolean FTP_ClientConnThink (FTPclientconn_t *con) //true to kill con
line++;
if (*con->server)
IWebDPrintf("^2FTP: %s\n", COM_TrimString(msg));
IWebDPrintf("FTP: %s\n", COM_TrimString(msg));
if (*msg < '0' || *msg > '9') //make sure it starts with number
continue;
@ -618,7 +618,7 @@ usepasv:
continue;
}
if (ret != 221)
Con_Printf("^1FTP: %i %s\n", ret, msg);
Con_Printf(S_ERROR "FTP: %i %s\n", ret, msg);
return true;
}

View file

@ -351,7 +351,7 @@ void VARGS IWebWarnPrintf(char *fmt, ...)
_vsnprintf (msg,sizeof(msg)-10, fmt,argptr); //catch any nasty bugs... (this is hopefully impossible)
va_end (argptr);
Con_Printf("^1%s", msg);
Con_Printf(S_WARNING "%s", msg);
}
void IWebInit(void)

View file

@ -2848,7 +2848,7 @@ void SVQ3_ParseClientMessage(client_t *client)
if (msg_readcount != net_message.cursize)
{
Con_Printf( S_COLOR_YELLOW"WARNING: Junk at end of packet for client %s\n", client->name );
Con_Printf(S_WARNING "WARNING: Junk at end of packet for client %s\n", client->name );
}
};
void SVQ3_HandleClient(void)