mirror of
https://github.com/YGGverse/hlsdk-portable.git
synced 2025-01-25 22:24:16 +00:00
Allow hud messages or arbitrary length
This commit is contained in:
parent
ea6fa67c87
commit
f2f83cd035
@ -240,7 +240,7 @@ void CHudMessage::MessageDrawScan( client_textmessage_t *pMessage, float time )
|
|||||||
{
|
{
|
||||||
int i, j, length, width;
|
int i, j, length, width;
|
||||||
const char *pText;
|
const char *pText;
|
||||||
unsigned char line[80];
|
const char *pLineStart;
|
||||||
|
|
||||||
pText = pMessage->pMessage;
|
pText = pMessage->pMessage;
|
||||||
// Count lines
|
// Count lines
|
||||||
@ -278,25 +278,21 @@ void CHudMessage::MessageDrawScan( client_textmessage_t *pMessage, float time )
|
|||||||
{
|
{
|
||||||
m_parms.lineLength = 0;
|
m_parms.lineLength = 0;
|
||||||
m_parms.width = 0;
|
m_parms.width = 0;
|
||||||
|
pLineStart = pText;
|
||||||
while( *pText && *pText != '\n' )
|
while( *pText && *pText != '\n' )
|
||||||
{
|
{
|
||||||
unsigned char c = *pText;
|
unsigned char c = *pText;
|
||||||
if (m_parms.lineLength < sizeof(line)-1)
|
m_parms.width += gHUD.m_scrinfo.charWidths[c];
|
||||||
{
|
m_parms.lineLength++;
|
||||||
line[m_parms.lineLength] = c;
|
|
||||||
m_parms.width += gHUD.m_scrinfo.charWidths[c];
|
|
||||||
m_parms.lineLength++;
|
|
||||||
}
|
|
||||||
pText++;
|
pText++;
|
||||||
}
|
}
|
||||||
pText++; // Skip LF
|
pText++; // Skip LF
|
||||||
line[m_parms.lineLength] = 0;
|
|
||||||
|
|
||||||
m_parms.x = XPosition( pMessage->x, m_parms.width, m_parms.totalWidth );
|
m_parms.x = XPosition( pMessage->x, m_parms.width, m_parms.totalWidth );
|
||||||
|
|
||||||
for( j = 0; j < m_parms.lineLength; j++ )
|
for( j = 0; j < m_parms.lineLength; j++ )
|
||||||
{
|
{
|
||||||
m_parms.text = line[j];
|
m_parms.text = pLineStart[j];
|
||||||
int next = m_parms.x + gHUD.m_scrinfo.charWidths[m_parms.text];
|
int next = m_parms.x + gHUD.m_scrinfo.charWidths[m_parms.text];
|
||||||
MessageScanNextChar();
|
MessageScanNextChar();
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user