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.
This commit is contained in:
Zack Middleton 2013-01-10 15:06:59 -06:00
parent eb6b5e5eab
commit c1ddacf5be

View file

@ -221,6 +221,25 @@ 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
@ -228,6 +247,7 @@ 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 );
@ -458,6 +478,8 @@ CON_Print
*/
void CON_Print( const char *msg )
{
CON_Hide( );
CON_WindowsColorPrint( msg );
CON_Show( );