Merge remote-tracking branch 'mittorn/master'
Conflicts: cl_dll/hud_redraw.cpp
This commit is contained in:
commit
6e8cd666a1
@ -216,10 +216,10 @@ int CHud :: DrawHudString( int xpos, int ypos, int iMaxX, char *szIt, int r, int
|
||||
// draw the string until we hit the null character or a newline character
|
||||
for ( ; *szIt != 0 && *szIt != '\n'; szIt++ )
|
||||
{
|
||||
int next = xpos + gHUD.m_scrinfo.charWidths[ *szIt ]; // variable-width fonts look cool
|
||||
int next = xpos + gHUD.m_scrinfo.charWidths[ (unsigned char)*szIt ]; // variable-width fonts look cool
|
||||
if ( next > iMaxX )
|
||||
return xpos;
|
||||
|
||||
|
||||
if( *szIt == '\\' && *(szIt+1) != '\n' && *(szIt+1) != 0)
|
||||
{
|
||||
// an escape character
|
||||
@ -240,8 +240,8 @@ int CHud :: DrawHudString( int xpos, int ypos, int iMaxX, char *szIt, int r, int
|
||||
}
|
||||
continue;
|
||||
}
|
||||
TextMessageDrawChar( xpos, ypos, *szIt, r, g, b );
|
||||
xpos = next;
|
||||
|
||||
xpos += TextMessageDrawChar( xpos, ypos, *szIt, r, g, b );
|
||||
}
|
||||
|
||||
return xpos;
|
||||
@ -253,7 +253,7 @@ int CHud :: DrawHudStringLen( char *szIt )
|
||||
// draw the string until we hit the null character or a newline character
|
||||
for ( ; *szIt != 0 && *szIt != '\n'; szIt++ )
|
||||
{
|
||||
l += gHUD.m_scrinfo.charWidths[ *szIt ]; // variable-width fonts look cool
|
||||
l += gHUD.m_scrinfo.charWidths[ (unsigned char)*szIt ]; // variable-width fonts look cool
|
||||
}
|
||||
return l;
|
||||
}
|
||||
@ -268,13 +268,14 @@ int CHud :: DrawHudNumberString( int xpos, int ypos, int iMinX, int iNumber, int
|
||||
|
||||
// draws a string from right to left (right-aligned)
|
||||
int CHud :: DrawHudStringReverse( int xpos, int ypos, int iMinX, char *szString, int r, int g, int b, bool drawing )
|
||||
{
|
||||
{
|
||||
int first_xpos = xpos;
|
||||
|
||||
|
||||
// iterate throug the string in reverse
|
||||
for ( signed int i = strlen(szString); i >= 0; i-- )
|
||||
{
|
||||
int next = xpos - gHUD.m_scrinfo.charWidths[ szString[i] ]; // variable-width fonts look cool
|
||||
int next = xpos - gHUD.m_scrinfo.charWidths[ (unsigned char)szString[i] ]; // variable-width fonts look cool
|
||||
if ( next < iMinX )
|
||||
return xpos;
|
||||
xpos = next;
|
||||
|
Loading…
Reference in New Issue
Block a user