diff options
author | belugas <belugas@openttd.org> | 2008-01-01 14:20:48 +0000 |
---|---|---|
committer | belugas <belugas@openttd.org> | 2008-01-01 14:20:48 +0000 |
commit | 3dd61f423ad6c79f319388625f2223d0e46a2f16 (patch) | |
tree | 4649001ed8ff619fb2275a558ad17a1e8a942a9c /src/video/win32_v.cpp | |
parent | a8611311ac842618f0be9e20b8339e7adbf86738 (diff) | |
download | openttd-3dd61f423ad6c79f319388625f2223d0e46a2f16.tar.xz |
(svn r11734) -Change: Allow ToggleFullScreen to return the result of the operation' attempt. Previously, only visual clues were available.
-Fix[FS#1519]: When you can not use this resolution at full screen, now you'll know that it failed.
As for the reason it did not work, each computer/OS has its reason.
Diffstat (limited to 'src/video/win32_v.cpp')
-rw-r--r-- | src/video/win32_v.cpp | 15 |
1 files changed, 7 insertions, 8 deletions
diff --git a/src/video/win32_v.cpp b/src/video/win32_v.cpp index 5fb4a4c60..ceac2b3b6 100644 --- a/src/video/win32_v.cpp +++ b/src/video/win32_v.cpp @@ -210,7 +210,7 @@ static void CALLBACK TrackMouseTimerProc(HWND hwnd, UINT msg, UINT event, DWORD } } -static void MakeWindow(bool full_screen) +static bool MakeWindow(bool full_screen) { _fullscreen = full_screen; @@ -242,8 +242,8 @@ static void MakeWindow(bool full_screen) settings.dmDisplayFrequency = _display_hz; if (ChangeDisplaySettings(&settings, CDS_FULLSCREEN) != DISP_CHANGE_SUCCESSFUL) { - MakeWindow(false); - return; + MakeWindow(false); // don't care about the result + return false; // the request failed } } else if (_wnd.fullscreen) { // restore display? @@ -291,6 +291,7 @@ static void MakeWindow(bool full_screen) } } GameSizeChanged(); // invalidate all windows, force redraw + return true; // the request succedded } static LRESULT CALLBACK WndProcGdi(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam) @@ -895,12 +896,10 @@ bool VideoDriver_Win32::ChangeResolution(int w, int h) _wnd.width = _wnd.width_org = w; _wnd.height = _wnd.height_org = h; - MakeWindow(_fullscreen); // _wnd.fullscreen screws up ingame resolution switching - - return true; + return MakeWindow(_fullscreen); // _wnd.fullscreen screws up ingame resolution switching } -void VideoDriver_Win32::ToggleFullscreen(bool full_screen) +bool VideoDriver_Win32::ToggleFullscreen(bool full_screen) { - MakeWindow(full_screen); + return MakeWindow(full_screen); } |