From 18d09d80ccb9256ef26382ec3216f2b8b24ade12 Mon Sep 17 00:00:00 2001 From: Alibek Omarov Date: Wed, 12 Mar 2025 06:15:27 +0300 Subject: [PATCH] engine: client: like GoldSrc, expect UTF-8 encoded strings in pfnDrawString/pfnDrawStringReverse --- engine/client/cl_game.c | 15 ++++----------- 1 file changed, 4 insertions(+), 11 deletions(-) diff --git a/engine/client/cl_game.c b/engine/client/cl_game.c index e3536813..d4256b53 100644 --- a/engine/client/cl_game.c +++ b/engine/client/cl_game.c @@ -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;