mirror of
https://github.com/YGGverse/xash3d-fwgs.git
synced 2025-01-30 08:44:31 +00:00
engine: client: console: fix NXPrintf newlines, small refactoring
This commit is contained in:
parent
21b9f07323
commit
e481c86ba2
@ -1732,30 +1732,37 @@ Custom debug messages
|
|||||||
*/
|
*/
|
||||||
int Con_DrawDebugLines( void )
|
int Con_DrawDebugLines( void )
|
||||||
{
|
{
|
||||||
|
notify_t *notify = con.notify;
|
||||||
int i, count = 0;
|
int i, count = 0;
|
||||||
int defaultX;
|
int defaultX;
|
||||||
int y = 20;
|
int y = 20;
|
||||||
|
int fontTall;
|
||||||
|
|
||||||
|
if( !con.curFont || !con.curFont->valid )
|
||||||
|
return 0;
|
||||||
|
|
||||||
defaultX = refState.width / 4;
|
defaultX = refState.width / 4;
|
||||||
|
fontTall = con.curFont->charHeight + 1;
|
||||||
|
|
||||||
for( i = 0; i < MAX_DBG_NOTIFY; i++ )
|
for( i = 0; i < ARRAYSIZE( con.notify ); i++, notify++ )
|
||||||
{
|
{
|
||||||
if( host.realtime < con.notify[i].expire && con.notify[i].key_dest == cls.key_dest )
|
int x, len;
|
||||||
{
|
|
||||||
int x, len;
|
|
||||||
int fontTall = 0;
|
|
||||||
|
|
||||||
Con_DrawStringLen( con.notify[i].szNotify, &len, &fontTall );
|
if( host.realtime > notify->expire )
|
||||||
x = refState.width - Q_max( defaultX, len ) - 10;
|
continue;
|
||||||
fontTall += 1;
|
|
||||||
|
|
||||||
if( y + fontTall > refState.height - 20 )
|
if( notify->key_dest != cls.key_dest )
|
||||||
return count;
|
continue;
|
||||||
|
|
||||||
count++;
|
Con_DrawStringLen( notify->szNotify, &len, NULL );
|
||||||
y = 20 + fontTall * i;
|
x = refState.width - Q_max( defaultX, len ) - 10;
|
||||||
Con_DrawString( x, y, con.notify[i].szNotify, con.notify[i].color );
|
|
||||||
}
|
if( y + fontTall > refState.height - 20 )
|
||||||
|
return count;
|
||||||
|
|
||||||
|
count++;
|
||||||
|
y += fontTall;
|
||||||
|
CL_DrawString( x, y, notify->szNotify, notify->color, con.curFont, FONT_DRAW_UTF8 | FONT_DRAW_NOLF );
|
||||||
}
|
}
|
||||||
|
|
||||||
return count;
|
return count;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user