From 9ba7cc88d947d13d2c8143ce0e198508b00fa870 Mon Sep 17 00:00:00 2001 From: Alibek Omarov Date: Wed, 12 Mar 2025 07:18:47 +0300 Subject: [PATCH] engine: client: move Con_UtfProcessChar to cl_gameui. It is now deprecated --- engine/client/cl_gameui.c | 13 ++++++++++++- engine/client/client.h | 1 - engine/client/console.c | 9 --------- 3 files changed, 12 insertions(+), 11 deletions(-) diff --git a/engine/client/cl_gameui.c b/engine/client/cl_gameui.c index b39ee040..03647c8e 100644 --- a/engine/client/cl_gameui.c +++ b/engine/client/cl_gameui.c @@ -1324,10 +1324,21 @@ static int pfnIsCvarReadOnly( const char *name ) return FBitSet( cv->flags, FCVAR_READ_ONLY ) ? 1 : 0; } +static int GAME_EXPORT pfnUtfProcessChar( int in ) +{ + // compatibility export, deprecated, do not use + + if( !cls.accept_utf8 ) // incoming character is not a UTF-8 sequence + return in; + + // otherwise, decode it and convert to selected codepage + return Con_UtfProcessCharForce( in ); +} + static ui_extendedfuncs_t gExtendedfuncs = { pfnEnableTextInput, - Con_UtfProcessChar, + pfnUtfProcessChar, Con_UtfMoveLeft, Con_UtfMoveRight, pfnGetRenderers, diff --git a/engine/client/client.h b/engine/client/client.h index 75c03d04..f4ad674b 100644 --- a/engine/client/client.h +++ b/engine/client/client.h @@ -1106,7 +1106,6 @@ void Con_DrawDebug( void ); void Con_RunConsole( void ); void Con_DrawConsole( void ); void Con_DrawVersion( void ); -int Con_UtfProcessChar( int in ); int Con_UtfProcessCharForce( int in ); int Con_UtfMoveLeft( char *str, int pos ); int Con_UtfMoveRight( char *str, int pos, int length ); diff --git a/engine/client/console.c b/engine/client/console.c index c3a25684..519a8345 100644 --- a/engine/client/console.c +++ b/engine/client/console.c @@ -632,15 +632,6 @@ int Con_UtfProcessCharForce( int in ) return '?'; // not implemented yet } -int GAME_EXPORT Con_UtfProcessChar( int in ) -{ - if( !cls.accept_utf8 ) // incoming character is not a UTF-8 sequence - return in; - - // otherwise, decode it and convert to selected codepage - return Con_UtfProcessCharForce( in ); -} - /* ================= Con_UtfMoveLeft