From 545b78193454f54561c63658f9b7518dce42fbbd Mon Sep 17 00:00:00 2001 From: Alibek Omarov Date: Sun, 22 Apr 2018 14:01:22 +0300 Subject: [PATCH] Restore hud_utf8 --- engine/client/cl_game.c | 8 ++++---- engine/client/cl_main.c | 2 ++ engine/client/client.h | 1 + 3 files changed, 7 insertions(+), 4 deletions(-) diff --git a/engine/client/cl_game.c b/engine/client/cl_game.c index 8ac2e497..e47dadbe 100644 --- a/engine/client/cl_game.c +++ b/engine/client/cl_game.c @@ -1838,6 +1838,9 @@ static int pfnDrawCharacter( int x, int y, int number, int r, int g, int b ) if( !cls.creditsFont.valid ) return 0; + if( hud_utf8->value ) + number = Con_UtfProcessChar( number ); + number &= 255; if( number < 32 ) return 0; @@ -2879,11 +2882,8 @@ pfnVGUI2DrawCharacterAdditive */ static int GAME_EXPORT pfnVGUI2DrawCharacterAdditive( int x, int y, int ch, int r, int g, int b, unsigned int font ) { - /// TODO: fix UTF-8 -#if 0 - if( !hud_utf8->integer ) + if( !hud_utf8->value ) ch = Con_UtfProcessChar( ch ); -#endif return pfnDrawCharacter( x, y, ch, r, g, b ); } diff --git a/engine/client/cl_main.c b/engine/client/cl_main.c index acca76c4..b30c81f2 100644 --- a/engine/client/cl_main.c +++ b/engine/client/cl_main.c @@ -67,6 +67,7 @@ convar_t *cl_interp; convar_t *cl_dlmax; convar_t *cl_lw; convar_t *cl_charset; +convar_t *hud_utf8; // // userinfo @@ -2532,6 +2533,7 @@ void CL_InitLocal( void ) cl_interp = Cvar_Get( "ex_interp", "0.1", FCVAR_ARCHIVE, "Interpolate object positions starting this many seconds in past" ); cl_timeout = Cvar_Get( "cl_timeout", "60", 0, "connect timeout (in-seconds)" ); cl_charset = Cvar_Get( "cl_charset", "utf-8", FCVAR_ARCHIVE, "1-byte charset to use (iconv style)" ); + hud_utf8 = Cvar_Get( "hud_utf8", "0", FCVAR_ARCHIVE, "Use utf-8 encoding for hud text" ); rcon_client_password = Cvar_Get( "rcon_password", "", 0, "remote control client password" ); rcon_address = Cvar_Get( "rcon_address", "", 0, "remote control address" ); diff --git a/engine/client/client.h b/engine/client/client.h index 8ccee02f..783dba36 100644 --- a/engine/client/client.h +++ b/engine/client/client.h @@ -701,6 +701,7 @@ extern convar_t *cl_bmodelinterp; extern convar_t *cl_righthand; extern convar_t *cl_lw; // local weapons extern convar_t *cl_charset; +extern convar_t *hud_utf8; extern convar_t *cl_showevents; extern convar_t *scr_centertime; extern convar_t *scr_viewsize;