summaryrefslogtreecommitdiff
path: root/src/sys
diff options
context:
space:
mode:
authorZack Middleton <zturtleman@gmail.com>2013-01-10 15:06:59 -0600
committerTim Angus <tim@ngus.net>2013-01-12 21:36:00 +0000
commit2e6db2db1a74aa16098b60582fa3c6dfe5b2ec86 (patch)
treef448fb276b8ca03a02db12776cded128914aaf89 /src/sys
parentf315dcd03c7bca173bc78be8c6b558b9aa341673 (diff)
Fix win32 input left on buffer and overwritten
The input line on the console screen buffer was moved up a line and overwritten by CON_Print. Remove input line when console shutdown as well.
Diffstat (limited to 'src/sys')
-rw-r--r--src/sys/con_win32.c22
1 files changed, 22 insertions, 0 deletions
diff --git a/src/sys/con_win32.c b/src/sys/con_win32.c
index 51b9e373..37621210 100644
--- a/src/sys/con_win32.c
+++ b/src/sys/con_win32.c
@@ -224,11 +224,31 @@ static void CON_Show( void )
/*
==================
+CON_Hide
+==================
+*/
+static void CON_Hide( void )
+{
+ int realLen;
+
+ realLen = qconsole_linelen;
+
+ // remove input line from console output buffer
+ qconsole_linelen = 0;
+ CON_Show( );
+
+ qconsole_linelen = realLen;
+}
+
+
+/*
+==================
CON_Shutdown
==================
*/
void CON_Shutdown( void )
{
+ CON_Hide( );
SetConsoleMode( qconsole_hin, qconsole_orig_mode );
SetConsoleCursorInfo( qconsole_hout, &qconsole_orig_cursorinfo );
SetConsoleTextAttribute( qconsole_hout, qconsole_attrib );
@@ -459,6 +479,8 @@ CON_Print
*/
void CON_Print( const char *msg )
{
+ CON_Hide( );
+
CON_WindowsColorPrint( msg );
CON_Show( );