summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorZack Middleton <zturtleman@gmail.com>2013-01-10 16:29:54 -0600
committerTim Angus <tim@ngus.net>2013-01-12 21:36:00 +0000
commit92a85a7a0f3f695fb40bfc0a36d97b20029aa42a (patch)
treec819f0b7d0cf381dd244b752e609baada4879a38
parentc1de301e8b90c1765c0c111ba59277a199097977 (diff)
Fix win32 console partial print being overwritten
-rw-r--r--src/sys/con_win32.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/sys/con_win32.c b/src/sys/con_win32.c
index 0306c6bf..0564c351 100644
--- a/src/sys/con_win32.c
+++ b/src/sys/con_win32.c
@@ -43,6 +43,7 @@ static int qconsole_history_oldest = 0;
// current edit buffer
static char qconsole_line[ MAX_EDIT_LINE ];
static int qconsole_linelen = 0;
+static qboolean qconsole_drawinput = qtrue;
static HANDLE qconsole_hout;
static HANDLE qconsole_hin;
@@ -182,6 +183,10 @@ static void CON_Show( void )
GetConsoleScreenBufferInfo( qconsole_hout, &binfo );
+ // if we're in the middle of printf, don't bother writing the buffer
+ if( !qconsole_drawinput )
+ return;
+
writeArea.Left = 0;
writeArea.Top = binfo.dwCursorPosition.Y;
writeArea.Bottom = binfo.dwCursorPosition.Y;
@@ -425,6 +430,8 @@ void CON_WindowsColorPrint( const char *msg )
while( *msg )
{
+ qconsole_drawinput = ( *msg == '\n' );
+
if( Q_IsColorString( msg ) || *msg == '\n' )
{
// First empty the buffer