mirror of
https://github.com/fabiangreffrath/woof.git
synced 2025-09-22 11:22:18 -04:00
strip leading newlines from warnings and take care they always get their own line (#1205)
* strip leading newlines from warnings * warnings always get their own new line * all prios but VB_INFO should start on their own line * remove some more leading newlines * finish progress line in R_InitTranMap()
This commit is contained in:
parent
b048001622
commit
7dd0e39ee3
@ -119,6 +119,8 @@ void I_InitPrintf(void)
|
|||||||
I_AtExit(I_ShutdownPrintf, true);
|
I_AtExit(I_ShutdownPrintf, true);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static boolean whole_line = true;
|
||||||
|
|
||||||
void I_Printf(verbosity_t prio, const char *msg, ...)
|
void I_Printf(verbosity_t prio, const char *msg, ...)
|
||||||
{
|
{
|
||||||
FILE *stream = stdout;
|
FILE *stream = stdout;
|
||||||
@ -161,6 +163,10 @@ void I_Printf(verbosity_t prio, const char *msg, ...)
|
|||||||
color_suffix = "\033[0m"; // [FG] reset
|
color_suffix = "\033[0m"; // [FG] reset
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// [FG] warnings always get their own new line
|
||||||
|
if (!whole_line && prio != VB_INFO)
|
||||||
|
fprintf(stream, "%s", "\n");
|
||||||
|
|
||||||
if (color_prefix)
|
if (color_prefix)
|
||||||
fprintf(stream, "%s", color_prefix);
|
fprintf(stream, "%s", color_prefix);
|
||||||
|
|
||||||
@ -173,11 +179,22 @@ void I_Printf(verbosity_t prio, const char *msg, ...)
|
|||||||
|
|
||||||
// [FG] no newline if format string has trailing space
|
// [FG] no newline if format string has trailing space
|
||||||
if (msglen && msg[msglen - 1] != ' ')
|
if (msglen && msg[msglen - 1] != ' ')
|
||||||
|
{
|
||||||
fprintf(stream, "%s", "\n");
|
fprintf(stream, "%s", "\n");
|
||||||
|
whole_line = true;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
whole_line = false;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void I_PutChar(verbosity_t prio, int c)
|
void I_PutChar(verbosity_t prio, int c)
|
||||||
{
|
{
|
||||||
if (prio <= verbosity)
|
if (prio <= verbosity)
|
||||||
|
{
|
||||||
putchar(c);
|
putchar(c);
|
||||||
|
|
||||||
|
whole_line = (c == '\n');
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
@ -789,11 +789,11 @@ void NET_LANQuery(void)
|
|||||||
{
|
{
|
||||||
if (NET_StartLANQuery())
|
if (NET_StartLANQuery())
|
||||||
{
|
{
|
||||||
I_Printf(VB_INFO, "\nSearching for servers on local LAN ...");
|
I_Printf(VB_INFO, "Searching for servers on local LAN ...");
|
||||||
|
|
||||||
NET_Query_QueryLoop(NET_QueryPrintCallback, NULL);
|
NET_Query_QueryLoop(NET_QueryPrintCallback, NULL);
|
||||||
|
|
||||||
I_Printf(VB_INFO, "\n%i server(s) found.", GetNumResponses());
|
I_Printf(VB_INFO, "%i server(s) found.", GetNumResponses());
|
||||||
FreeTargets();
|
FreeTargets();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -802,11 +802,11 @@ void NET_MasterQuery(void)
|
|||||||
{
|
{
|
||||||
if (NET_StartMasterQuery())
|
if (NET_StartMasterQuery())
|
||||||
{
|
{
|
||||||
I_Printf(VB_INFO, "\nSearching for servers on Internet ...");
|
I_Printf(VB_INFO, "Searching for servers on Internet ...");
|
||||||
|
|
||||||
NET_Query_QueryLoop(NET_QueryPrintCallback, NULL);
|
NET_Query_QueryLoop(NET_QueryPrintCallback, NULL);
|
||||||
|
|
||||||
I_Printf(VB_INFO, "\n%i server(s) found.", GetNumResponses());
|
I_Printf(VB_INFO, "%i server(s) found.", GetNumResponses());
|
||||||
FreeTargets();
|
FreeTargets();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -829,7 +829,7 @@ void NET_QueryAddress(const char *addr_str)
|
|||||||
|
|
||||||
target = GetTargetForAddr(addr, true);
|
target = GetTargetForAddr(addr, true);
|
||||||
|
|
||||||
I_Printf(VB_INFO, "\nQuerying '%s'...", addr_str);
|
I_Printf(VB_INFO, "Querying '%s'...", addr_str);
|
||||||
|
|
||||||
// Run query loop.
|
// Run query loop.
|
||||||
|
|
||||||
|
15
src/r_data.c
15
src/r_data.c
@ -395,7 +395,7 @@ static void R_GenerateLookup(int texnum, int *const errors)
|
|||||||
if (badcol)
|
if (badcol)
|
||||||
{
|
{
|
||||||
badcol = 0;
|
badcol = 0;
|
||||||
I_Printf(VB_DEBUG, "\nWarning: Texture %8.8s "
|
I_Printf(VB_DEBUG, "Warning: Texture %8.8s "
|
||||||
"(height %d) has bad column(s)"
|
"(height %d) has bad column(s)"
|
||||||
" starting at x = %d.",
|
" starting at x = %d.",
|
||||||
texture->name, texture->height, x);
|
texture->name, texture->height, x);
|
||||||
@ -426,7 +426,7 @@ static void R_GenerateLookup(int texnum, int *const errors)
|
|||||||
// if (devparm)
|
// if (devparm)
|
||||||
{
|
{
|
||||||
// killough 8/8/98
|
// killough 8/8/98
|
||||||
I_Printf(VB_DEBUG, "\nR_GenerateLookup:"
|
I_Printf(VB_DEBUG, "R_GenerateLookup:"
|
||||||
" Column %d is without a patch in texture %.8s",
|
" Column %d is without a patch in texture %.8s",
|
||||||
x, texture->name);
|
x, texture->name);
|
||||||
// ++*errors;
|
// ++*errors;
|
||||||
@ -462,7 +462,7 @@ static void R_GenerateLookup(int texnum, int *const errors)
|
|||||||
|
|
||||||
if (err) // killough 10/98: non-verbose output
|
if (err) // killough 10/98: non-verbose output
|
||||||
{
|
{
|
||||||
I_Printf(VB_WARNING, "\nR_GenerateLookup: Column without a patch in texture %.8s",
|
I_Printf(VB_WARNING, "R_GenerateLookup: Column without a patch in texture %.8s",
|
||||||
texture->name);
|
texture->name);
|
||||||
++*errors;
|
++*errors;
|
||||||
}
|
}
|
||||||
@ -554,12 +554,12 @@ void R_InitTextures (void)
|
|||||||
patchlookup[i] = (W_CheckNumForName)(name, ns_sprites);
|
patchlookup[i] = (W_CheckNumForName)(name, ns_sprites);
|
||||||
|
|
||||||
if (patchlookup[i] == -1)
|
if (patchlookup[i] == -1)
|
||||||
I_Printf(VB_DEBUG, "\nWarning: patch %.8s, index %d does not exist",name,i);
|
I_Printf(VB_DEBUG, "Warning: patch %.8s, index %d does not exist",name,i);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (patchlookup[i] != -1 && !R_IsPatchLump(patchlookup[i]))
|
if (patchlookup[i] != -1 && !R_IsPatchLump(patchlookup[i]))
|
||||||
{
|
{
|
||||||
I_Printf(VB_WARNING, "\nR_InitTextures: patch %.8s, index %d is invalid", name, i);
|
I_Printf(VB_WARNING, "R_InitTextures: patch %.8s, index %d is invalid", name, i);
|
||||||
patchlookup[i] = (W_CheckNumForName)("TNT1A0", ns_sprites);
|
patchlookup[i] = (W_CheckNumForName)("TNT1A0", ns_sprites);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -681,7 +681,7 @@ void R_InitTextures (void)
|
|||||||
}
|
}
|
||||||
if (patch->patch == -1)
|
if (patch->patch == -1)
|
||||||
{ // killough 8/8/98
|
{ // killough 8/8/98
|
||||||
I_Printf(VB_WARNING, "\nR_InitTextures: Missing patch %d in texture %.8s",
|
I_Printf(VB_WARNING, "R_InitTextures: Missing patch %d in texture %.8s",
|
||||||
SHORT(mpatch->patch), texture->name); // killough 4/17/98
|
SHORT(mpatch->patch), texture->name); // killough 4/17/98
|
||||||
// [FG] treat missing patches as non-fatal, substitute dummy patch
|
// [FG] treat missing patches as non-fatal, substitute dummy patch
|
||||||
// ++errors;
|
// ++errors;
|
||||||
@ -958,6 +958,9 @@ void R_InitTranMap(int progress)
|
|||||||
while (--color >= 0);
|
while (--color >= 0);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
// [FG] finish progress line
|
||||||
|
if (progress)
|
||||||
|
I_PutChar(VB_INFO, '\n');
|
||||||
}
|
}
|
||||||
if (cachefp && !force_rebuild) // write out the cached translucency map
|
if (cachefp && !force_rebuild) // write out the cached translucency map
|
||||||
{
|
{
|
||||||
|
Loading…
x
Reference in New Issue
Block a user