diff --git a/engine/client/cl_font.c b/engine/client/cl_font.c index 64d857e0..f3f2935e 100644 --- a/engine/client/cl_font.c +++ b/engine/client/cl_font.c @@ -213,6 +213,10 @@ int CL_DrawString( float x, float y, const char *s, rgba_t color, cl_font_t *fon draw_len = 0; y += font->charHeight; } + + if( FBitSet( flags, FONT_DRAW_RESETCOLORONLF )) + Vector4Copy( color, current_color ); + continue; } if( IsColorString( s )) @@ -275,6 +279,7 @@ void CL_DrawStringLen( cl_font_t *font, const char *s, int *width, int *height, if( height ) *height += font->charHeight; } + continue; } if( IsColorString( s )) diff --git a/engine/client/cl_scrn.c b/engine/client/cl_scrn.c index db343ce4..f476b162 100644 --- a/engine/client/cl_scrn.c +++ b/engine/client/cl_scrn.c @@ -150,8 +150,7 @@ same as r_speeds but for network channel void SCR_NetSpeeds( void ) { static char msg[MAX_SYSPATH]; - int x, y, height; - char *p, *start, *end; + int x, y; float time = cl.mtime[0]; static int min_svfps = 100; static int max_svfps = 0; @@ -201,7 +200,7 @@ void SCR_NetSpeeds( void ) y = 384; MakeRGBA( color, 255, 255, 255, 255 ); - CL_DrawString( x, y, msg, color, font, 0 ); + CL_DrawString( x, y, msg, color, font, FONT_DRAW_RESETCOLORONLF ); } /* @@ -218,8 +217,7 @@ void SCR_RSpeeds( void ) if( ref.dllFuncs.R_SpeedsMessage( msg, sizeof( msg ))) { - int x, y, height; - char *p, *start, *end; + int x, y; rgba_t color; cl_font_t *font = Con_GetCurFont(); @@ -227,7 +225,7 @@ void SCR_RSpeeds( void ) y = 64; MakeRGBA( color, 255, 255, 255, 255 ); - CL_DrawString( x, y, msg, color, font, 0 ); + CL_DrawString( x, y, msg, color, font, FONT_DRAW_RESETCOLORONLF ); } } diff --git a/engine/client/client.h b/engine/client/client.h index 8c324c1c..d4e40441 100644 --- a/engine/client/client.h +++ b/engine/client/client.h @@ -326,6 +326,7 @@ typedef struct #define FONT_DRAW_FORCECOL BIT( 2 ) // ignore colorcodes #define FONT_DRAW_NORENDERMODE BIT( 3 ) // ignore font's default rendermode #define FONT_DRAW_NOLF BIT( 4 ) // ignore \n +#define FONT_DRAW_RESETCOLORONLF BIT( 5 ) // yet another flag to simulate consecutive Con_DrawString calls... typedef struct {