|
|
@ -235,29 +235,35 @@ int CHud::DrawHudString( int xpos, int ypos, int iMaxX, const char *szIt, int r, |
|
|
|
|
|
|
|
|
|
|
|
int DrawUtfString( int xpos, int ypos, int iMaxX, const char *szIt, int r, int g, int b ) |
|
|
|
int DrawUtfString( int xpos, int ypos, int iMaxX, const char *szIt, int r, int g, int b ) |
|
|
|
{ |
|
|
|
{ |
|
|
|
// xash3d: reset unicode state
|
|
|
|
if (isXashFWGS()) |
|
|
|
gEngfuncs.pfnVGUI2DrawCharacterAdditive( 0, 0, 0, 0, 0, 0, 0 ); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// draw the string until we hit the null character or a newline character
|
|
|
|
|
|
|
|
for( ; *szIt != 0 && *szIt != '\n'; szIt++ ) |
|
|
|
|
|
|
|
{ |
|
|
|
{ |
|
|
|
int w = gHUD.m_scrinfo.charWidths['M']; |
|
|
|
// xash3d: reset unicode state
|
|
|
|
if( xpos + w > iMaxX ) |
|
|
|
gEngfuncs.pfnVGUI2DrawCharacterAdditive( 0, 0, 0, 0, 0, 0, 0 ); |
|
|
|
return xpos; |
|
|
|
|
|
|
|
if( ( *szIt == '^' ) && ( *( szIt + 1 ) >= '0') && ( *( szIt + 1 ) <= '7') ) |
|
|
|
// draw the string until we hit the null character or a newline character
|
|
|
|
|
|
|
|
for( ; *szIt != 0 && *szIt != '\n'; szIt++ ) |
|
|
|
{ |
|
|
|
{ |
|
|
|
szIt++; |
|
|
|
int w = gHUD.m_scrinfo.charWidths['M']; |
|
|
|
r = colors[*szIt - '0'][0]; |
|
|
|
if( xpos + w > iMaxX ) |
|
|
|
g = colors[*szIt - '0'][1]; |
|
|
|
|
|
|
|
b = colors[*szIt - '0'][2]; |
|
|
|
|
|
|
|
if( !*(++szIt) ) |
|
|
|
|
|
|
|
return xpos; |
|
|
|
return xpos; |
|
|
|
|
|
|
|
if( ( *szIt == '^' ) && ( *( szIt + 1 ) >= '0') && ( *( szIt + 1 ) <= '7') ) |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
szIt++; |
|
|
|
|
|
|
|
r = colors[*szIt - '0'][0]; |
|
|
|
|
|
|
|
g = colors[*szIt - '0'][1]; |
|
|
|
|
|
|
|
b = colors[*szIt - '0'][2]; |
|
|
|
|
|
|
|
if( !*(++szIt) ) |
|
|
|
|
|
|
|
return xpos; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
int c = (unsigned int)(unsigned char)*szIt; |
|
|
|
|
|
|
|
xpos += gEngfuncs.pfnVGUI2DrawCharacterAdditive( xpos, ypos, c, r, g, b, 0 ); |
|
|
|
} |
|
|
|
} |
|
|
|
int c = (unsigned int)(unsigned char)*szIt; |
|
|
|
return xpos; |
|
|
|
xpos += gEngfuncs.pfnVGUI2DrawCharacterAdditive( xpos, ypos, c, r, g, b, 0 ); |
|
|
|
} |
|
|
|
|
|
|
|
else |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
return gHUD.DrawHudString(xpos, ypos, iMaxX, szIt, r, g, b); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
return xpos; |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
int CHud::DrawHudStringLen( const char *szIt ) |
|
|
|
int CHud::DrawHudStringLen( const char *szIt ) |
|
|
|