Mercurial > hg > openttd
changeset 6265:e889bf1ee106 draft
(svn r9074) -Codechange: win32 dedicated console now doesn't need an extra 'enter' to fully quit
author | glx <glx@openttd.org> |
---|---|
date | Fri, 09 Mar 2007 00:15:43 +0000 |
parents | 37ecb2d0cdfb |
children | 5ff75337492b |
files | src/video/dedicated_v.cpp |
diffstat | 1 files changed, 3 insertions(+), 1 deletions(-) [+] |
line wrap: on
line diff
--- a/src/video/dedicated_v.cpp +++ b/src/video/dedicated_v.cpp @@ -76,8 +76,10 @@ /* 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);