mirror of
https://github.com/FWGS/xash3d-fwgs
synced 2024-11-25 03:11:06 +01:00
engine: make pfnDrawString & pfnDrawStringReverse return width
This commit is contained in:
parent
89baa633c8
commit
3a55b9cd67
@ -2929,15 +2929,16 @@ pfnDrawString
|
||||
*/
|
||||
static int GAME_EXPORT pfnDrawString( int x, int y, const char *str, int r, int g, int b )
|
||||
{
|
||||
int iWidth = 0;
|
||||
Con_UtfProcessChar(0);
|
||||
|
||||
// draw the string until we hit the null character or a newline character
|
||||
for ( ; *str != 0 && *str != '\n'; str++ )
|
||||
{
|
||||
x += pfnVGUI2DrawCharacterAdditive( x, y, (unsigned char)*str, r, g, b, 0 );
|
||||
iWidth += pfnVGUI2DrawCharacterAdditive( x + iWidth, y, (unsigned char)*str, r, g, b, 0 );
|
||||
}
|
||||
|
||||
return x;
|
||||
return iWidth;
|
||||
}
|
||||
|
||||
/*
|
||||
@ -2952,8 +2953,7 @@ static int GAME_EXPORT pfnDrawStringReverse( int x, int y, const char *str, int
|
||||
char *szIt;
|
||||
for( szIt = (char*)str; *szIt != 0; szIt++ )
|
||||
x -= clgame.scrInfo.charWidths[ (unsigned char) *szIt ];
|
||||
pfnDrawString( x, y, str, r, g, b );
|
||||
return x;
|
||||
return pfnDrawString( x, y, str, r, g, b );
|
||||
}
|
||||
|
||||
/*
|
||||
|
Loading…
Reference in New Issue
Block a user