Browse Source

engine: client: console: fix NXPrintf newlines, small refactoring

pull/2/head
Alibek Omarov 2 years ago
parent
commit
e481c86ba2
  1. 25
      engine/client/console.c

25
engine/client/console.c

@ -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 )
continue;
if( notify->key_dest != cls.key_dest )
continue;
Con_DrawStringLen( notify->szNotify, &len, NULL );
x = refState.width - Q_max( defaultX, len ) - 10; x = refState.width - Q_max( defaultX, len ) - 10;
fontTall += 1;
if( y + fontTall > refState.height - 20 ) if( y + fontTall > refState.height - 20 )
return count; return count;
count++; count++;
y = 20 + fontTall * i; y += fontTall;
Con_DrawString( x, y, con.notify[i].szNotify, con.notify[i].color ); CL_DrawString( x, y, notify->szNotify, notify->color, con.curFont, FONT_DRAW_UTF8 | FONT_DRAW_NOLF );
}
} }
return count; return count;

Loading…
Cancel
Save