From 0ec558f99fc9f0e691603647440c9fa0cfbe5a24 Mon Sep 17 00:00:00 2001 From: rubidium Date: Mon, 19 Mar 2007 20:05:49 +0000 Subject: [PATCH] (svn r9348) [0.5] -Backport from trunk (r8974, r8994, r9074): - Fix: support compilation with the Vista Platform SDK (r8974) - Fix: resolution doubled in cfg file when fullscreen mode used (r8994) - Fix: win32 dedicated console now doesn't need an extra 'enter' to fully quit (r9074) --- stdafx.h | 9 +++++++++ video/dedicated_v.c | 4 +++- video/win32_v.c | 2 +- 3 files changed, 13 insertions(+), 2 deletions(-) diff --git a/stdafx.h b/stdafx.h index a2c3f5d604..16ac815287 100644 --- a/stdafx.h +++ b/stdafx.h @@ -99,6 +99,15 @@ // Stuff for MSVC #if defined(_MSC_VER) # pragma once +/* Define a win32 target platform, to override defaults of the SDK + * We need to define NTDDI version for Vista SDK, but win2k is minimum */ +# define NTDDI_VERSION NTDDI_WIN2K // Windows 2000 +# define _WIN32_WINNT 0x0500 // Windows 2000 + +# define _WIN32_WINDOWS 0x400 // Windows 95 +# define WINVER 0x0400 // Windows NT 4.0 / Windows 95 +# define _WIN32_IE_ 0x0401 // 4.01 (win98 and NT4SP5+) + # define WIN32_LEAN_AND_MEAN // Exclude rarely-used stuff from Windows headers # pragma warning(disable: 4244) // 'conversion' conversion from 'type1' to 'type2', possible loss of data # pragma warning(disable: 4761) // integral size mismatch in argument : conversion supplied diff --git a/video/dedicated_v.c b/video/dedicated_v.c index 968899c49e..a7c365be59 100644 --- a/video/dedicated_v.c +++ b/video/dedicated_v.c @@ -72,8 +72,10 @@ static char _win_console_thread_buffer[200]; /* Windows Console thread. Just loop and signal when input has been received */ static void WINAPI CheckForConsoleInput(void) { + 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); diff --git a/video/win32_v.c b/video/win32_v.c index 8c90d351ad..8d00774161 100644 --- a/video/win32_v.c +++ b/video/win32_v.c @@ -736,7 +736,7 @@ static void Win32GdiStop(void) DestroyWindow(_wnd.main_wnd); if (_wnd.fullscreen) ChangeDisplaySettings(NULL, 0); - if (_double_size) { + if (_wnd.double_size) { _cur_resolution[0] *= 2; _cur_resolution[1] *= 2; }