Browse Source

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

pull/2/head
Alibek Omarov 1 year ago
parent
commit
d14e486721
  1. 8
      engine/client/cl_font.c
  2. 1
      engine/client/client.h

8
engine/client/cl_font.c

@ -207,8 +207,12 @@ int CL_DrawString( float x, float y, const char *s, rgba_t color, cl_font_t *fon @@ -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 ))

1
engine/client/client.h

@ -325,6 +325,7 @@ typedef struct @@ -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
{

Loading…
Cancel
Save