From 21d035d4ccd1cbe2d50cfb6cf764bf4501081bcb Mon Sep 17 00:00:00 2001 From: TimeServ Date: Wed, 21 Sep 2005 01:13:11 +0000 Subject: [PATCH] dedicated console fix git-svn-id: https://svn.code.sf.net/p/fteqw/code/trunk@1346 fc73d0e0-1445-4013-8a0c-d673dee63da5 --- engine/client/console.c | 33 ++++++++++++++++++++------------- 1 file changed, 20 insertions(+), 13 deletions(-) diff --git a/engine/client/console.c b/engine/client/console.c index fded31bb..9acbe939 100644 --- a/engine/client/console.c +++ b/engine/client/console.c @@ -1134,27 +1134,34 @@ void Con_DrawNotify (void) con_notifylines = v; } -void Con_PrintToSys(void) //send all the stuff that was con_printed to sys_print. This is so that system consoles in windows can scroll up and have all the text. +//send all the stuff that was con_printed to sys_print. +//This is so that system consoles in windows can scroll up and have all the text. +void Con_PrintToSys(void) { - int line, row, x; + int line, row, x, spc, content; short *text; console_t *curcon = &con_main; + content = 0; row = curcon->current - curcon->totallines+1; - for (line = 0; line < curcon->totallines-1; line++, row++) //skip empty lines. + for (line = 0; line < curcon->totallines-1; line++, row++) { text = curcon->text + (row % curcon->totallines)*curcon->linewidth; + spc = 0; for (x = 0; x < curcon->linewidth; x++) - if (((qbyte)(text[x])&255) != ' ') - goto breakout; - } -breakout: - for (; line < curcon->totallines-1; line++, row++) - { - text = curcon->text + (row % curcon->totallines)*curcon->linewidth; - for (x = 0; x < curcon->linewidth; x++) - Sys_Printf("%c", (qbyte)text[x]&255); - Sys_Printf("\n"); + { + if (((qbyte)text[x]&255) == ' ') + spc++; // track spaces but don't print yet + else + { + content = 1; // start printing blank lines + for (; spc > 0; spc--) + Sys_Printf(" "); // print leading spaces + Sys_Printf("%c", (qbyte)text[x]&255); + } + } + if (content) + Sys_Printf("\n"); } }