mirror of
https://github.com/FWGS/xash3d-fwgs.git
synced 2026-08-05 03:24:56 +08:00
engine: client: handle hud_utf8 in client.dll's draw character functions, rather than in engine's CL_DrawCharacter
This commit is contained in:
@@ -1997,7 +1997,13 @@ static int GAME_EXPORT pfnDrawCharacter( int x, int y, int number, int r, int g,
|
||||
int flags = FONT_DRAW_HUD;
|
||||
|
||||
if( hud_utf8.value )
|
||||
flags |= FONT_DRAW_UTF8;
|
||||
{
|
||||
static utfstate_t utfstate;
|
||||
number = Q_DecodeUTF8( &utfstate, number );
|
||||
|
||||
if( !number )
|
||||
return 0;
|
||||
}
|
||||
|
||||
return CL_DrawCharacter( x, y, number, color, &cls.creditsFont, flags );
|
||||
}
|
||||
|
||||
@@ -19,6 +19,7 @@ GNU General Public License for more details.
|
||||
#include "library.h"
|
||||
#include "input.h"
|
||||
#include "platform/platform.h"
|
||||
#include "utflib.h"
|
||||
|
||||
static CVAR_DEFINE_AUTO( vibration_length, "1.0", FCVAR_ARCHIVE | FCVAR_PRIVILEGED, "vibration length" );
|
||||
static CVAR_DEFINE_AUTO( vibration_enable, "1", FCVAR_ARCHIVE | FCVAR_PRIVILEGED, "enable vibration" );
|
||||
@@ -58,7 +59,13 @@ static int pfnDrawScaledCharacter( int x, int y, int number, int r, int g, int b
|
||||
int flags = FONT_DRAW_HUD;
|
||||
|
||||
if( hud_utf8.value )
|
||||
SetBits( flags, FONT_DRAW_UTF8 );
|
||||
{
|
||||
static utfstate_t utfstate;
|
||||
number = Q_DecodeUTF8( &utfstate, number );
|
||||
|
||||
if( !number )
|
||||
return 0;
|
||||
}
|
||||
|
||||
if( fabs( g_font_scale - scale ) > 0.1f ||
|
||||
g_scaled_font.hFontTexture != cls.creditsFont.hFontTexture )
|
||||
|
||||
Reference in New Issue
Block a user