engine: client: do not repeatedly check cl_charset value, use generic Con_UtfProcessChar

This commit is contained in:
Alibek Omarov 2024-05-15 05:01:42 +03:00
parent 24f4d410ce
commit 2e0fc3e4c1
2 changed files with 2 additions and 8 deletions

View File

@ -1055,10 +1055,7 @@ static qboolean OSK_KeyEvent( int key, int down )
break;
}
if( !Q_stricmp( cl_charset.string, "utf-8" ) )
ch = (unsigned char)osk.curbutton.val;
else
ch = Con_UtfProcessCharForce( (unsigned char)osk.curbutton.val );
ch = Con_UtfProcessChar((byte)osk.curbutton.val );
if( !ch )
break;

View File

@ -363,10 +363,7 @@ static void SDLash_InputEvent( SDL_TextInputEvent input )
{
int ch;
if( !Q_stricmp( cl_charset.string, "utf-8" ) )
ch = (unsigned char)*text;
else
ch = Con_UtfProcessCharForce( (unsigned char)*text );
ch = Con_UtfProcessChar((byte)*text );
if( !ch )
continue;