mirror of
https://github.com/UberGames/ioef.git
synced 2025-01-31 13:00:46 +00:00
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:
parent
eb6b5e5eab
commit
c1ddacf5be
1 changed files with 22 additions and 0 deletions
|
@ -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
|
CON_Shutdown
|
||||||
|
@ -228,6 +247,7 @@ CON_Shutdown
|
||||||
*/
|
*/
|
||||||
void CON_Shutdown( void )
|
void CON_Shutdown( void )
|
||||||
{
|
{
|
||||||
|
CON_Hide( );
|
||||||
SetConsoleMode( qconsole_hin, qconsole_orig_mode );
|
SetConsoleMode( qconsole_hin, qconsole_orig_mode );
|
||||||
SetConsoleCursorInfo( qconsole_hout, &qconsole_orig_cursorinfo );
|
SetConsoleCursorInfo( qconsole_hout, &qconsole_orig_cursorinfo );
|
||||||
SetConsoleTextAttribute( qconsole_hout, qconsole_attrib );
|
SetConsoleTextAttribute( qconsole_hout, qconsole_attrib );
|
||||||
|
@ -458,6 +478,8 @@ CON_Print
|
||||||
*/
|
*/
|
||||||
void CON_Print( const char *msg )
|
void CON_Print( const char *msg )
|
||||||
{
|
{
|
||||||
|
CON_Hide( );
|
||||||
|
|
||||||
CON_WindowsColorPrint( msg );
|
CON_WindowsColorPrint( msg );
|
||||||
|
|
||||||
CON_Show( );
|
CON_Show( );
|
||||||
|
|
Loading…
Reference in a new issue