engine: client: font: add special flag to ignore linefeeds when drawing strings

This commit is contained in:
Alibek Omarov 2023-02-04 20:53:52 +03:00
parent 82b6da493a
commit d14e486721
2 changed files with 7 additions and 2 deletions

View File

@ -207,8 +207,12 @@ int CL_DrawString( float x, float y, const char *s, rgba_t color, cl_font_t *fon
if( !*s )
break;
draw_len = 0;
y += font->charHeight;
// some client functions ignore newlines
if( !FBitSet( flags, FONT_DRAW_NOLF ))
{
draw_len = 0;
y += font->charHeight;
}
}
if( IsColorString( s ))

View File

@ -325,6 +325,7 @@ typedef struct
#define FONT_DRAW_UTF8 BIT( 1 ) // call UtfProcessChar
#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
typedef struct
{