mirror of
https://github.com/OpenTTD/OpenTTD.git
synced 2025-03-09 15:41:15 +00:00
(svn r9074) -Codechange: win32 dedicated console now doesn't need an extra 'enter' to fully quit
This commit is contained in:
parent
f776f3beb1
commit
b52c4dea25
@ -76,8 +76,10 @@ static char _win_console_thread_buffer[200];
|
||||
/* Windows Console thread. Just loop and signal when input has been received */
|
||||
static void WINAPI CheckForConsoleInput()
|
||||
{
|
||||
DWORD nb;
|
||||
HANDLE hStdin = GetStdHandle(STD_INPUT_HANDLE);
|
||||
while (true) {
|
||||
fgets(_win_console_thread_buffer, lengthof(_win_console_thread_buffer), stdin);
|
||||
ReadFile(hStdin, _win_console_thread_buffer, lengthof(_win_console_thread_buffer), &nb, NULL);
|
||||
/* Signal input waiting that input is read and wait for it being handled
|
||||
* SignalObjectAndWait() should be used here, but it's unsupported in Win98< */
|
||||
SetEvent(_hInputReady);
|
||||
|
Loading…
Reference in New Issue
Block a user