mirror of
https://github.com/DrBeef/ioq3quest.git
synced 2024-11-26 22:11:18 +00:00
Make win32 console cursor visible
This commit is contained in:
parent
c1ddacf5be
commit
20cd170993
1 changed files with 7 additions and 11 deletions
|
@ -174,16 +174,13 @@ static void CON_Show( void )
|
|||
COORD writeSize = { MAX_EDIT_LINE, 1 };
|
||||
COORD writePos = { 0, 0 };
|
||||
SMALL_RECT writeArea = { 0, 0, 0, 0 };
|
||||
COORD cursorPos;
|
||||
int i;
|
||||
CHAR_INFO line[ MAX_EDIT_LINE ];
|
||||
WORD attrib;
|
||||
|
||||
GetConsoleScreenBufferInfo( qconsole_hout, &binfo );
|
||||
|
||||
// if we're in the middle of printf, don't bother writing the buffer
|
||||
if( binfo.dwCursorPosition.X != 0 )
|
||||
return;
|
||||
|
||||
writeArea.Left = 0;
|
||||
writeArea.Top = binfo.dwCursorPosition.Y;
|
||||
writeArea.Bottom = binfo.dwCursorPosition.Y;
|
||||
|
@ -219,6 +216,12 @@ static void CON_Show( void )
|
|||
WriteConsoleOutput( qconsole_hout, line, writeSize,
|
||||
writePos, &writeArea );
|
||||
}
|
||||
|
||||
// set curor position
|
||||
cursorPos.Y = binfo.dwCursorPosition.Y;
|
||||
cursorPos.X = qconsole_linelen > binfo.srWindow.Right ? binfo.srWindow.Right : qconsole_linelen;
|
||||
|
||||
SetConsoleCursorPosition( qconsole_hout, cursorPos );
|
||||
}
|
||||
|
||||
/*
|
||||
|
@ -262,7 +265,6 @@ CON_Init
|
|||
*/
|
||||
void CON_Init( void )
|
||||
{
|
||||
CONSOLE_CURSOR_INFO curs;
|
||||
CONSOLE_SCREEN_BUFFER_INFO info;
|
||||
int i;
|
||||
|
||||
|
@ -291,12 +293,6 @@ void CON_Init( void )
|
|||
|
||||
SetConsoleTitle(CLIENT_WINDOW_TITLE " Dedicated Server Console");
|
||||
|
||||
// make cursor invisible
|
||||
GetConsoleCursorInfo( qconsole_hout, &qconsole_orig_cursorinfo );
|
||||
curs.dwSize = 1;
|
||||
curs.bVisible = FALSE;
|
||||
SetConsoleCursorInfo( qconsole_hout, &curs );
|
||||
|
||||
// initialize history
|
||||
for( i = 0; i < QCONSOLE_HISTORY; i++ )
|
||||
qconsole_history[ i ][ 0 ] = '\0';
|
||||
|
|
Loading…
Reference in a new issue