engine: client: like GoldSrc, expect UTF-8 encoded strings in pfnDrawString/pfnDrawStringReverse

This commit is contained in:
Alibek Omarov
2025-03-12 06:15:27 +03:00
parent 67f91fc100
commit 18d09d80cc

View File

@@ -3060,12 +3060,8 @@ pfnDrawString
*/
static int GAME_EXPORT pfnDrawString( int x, int y, const char *str, int r, int g, int b )
{
rgba_t color = { r, g, b, 255 };
int flags = FONT_DRAW_HUD | FONT_DRAW_NOLF;
if( hud_utf8.value )
SetBits( flags, FONT_DRAW_UTF8 );
const rgba_t color = { r, g, b, 255 };
int flags = FONT_DRAW_HUD | FONT_DRAW_NOLF | FONT_DRAW_UTF8;
return CL_DrawString( x, y, str, color, &cls.creditsFont, flags );
}
@@ -3077,13 +3073,10 @@ pfnDrawStringReverse
*/
static int GAME_EXPORT pfnDrawStringReverse( int x, int y, const char *str, int r, int g, int b )
{
rgba_t color = { r, g, b, 255 };
int flags = FONT_DRAW_HUD | FONT_DRAW_NOLF;
const rgba_t color = { r, g, b, 255 };
int flags = FONT_DRAW_HUD | FONT_DRAW_NOLF | FONT_DRAW_UTF8;
int width;
if( hud_utf8.value )
SetBits( flags, FONT_DRAW_UTF8 );
CL_DrawStringLen( &cls.creditsFont, str, &width, NULL, flags );
x -= width;