summaryrefslogtreecommitdiff
path: root/video
diff options
context:
space:
mode:
authorDarkvater <darkvater@openttd.org>2006-11-05 01:13:08 +0000
committerDarkvater <darkvater@openttd.org>2006-11-05 01:13:08 +0000
commit96f40aacb428eb1410c21e59e10609c42cb60a43 (patch)
tree313c60419999ff58230d4ba5f13b1d91cf2ec617 /video
parent20da2356a90babcba73d507b6229a1f0cbbc4316 (diff)
downloadopenttd-96f40aacb428eb1410c21e59e10609c42cb60a43.tar.xz
(svn r7061) -[win32] Feature: Remember the window size between restarts when quit in fullscreen mode.
Diffstat (limited to 'video')
-rw-r--r--video/win32_v.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/video/win32_v.c b/video/win32_v.c
index 9d0cc5247..c38c6b54c 100644
--- a/video/win32_v.c
+++ b/video/win32_v.c
@@ -34,6 +34,7 @@ bool _double_size;
bool _window_maximize;
uint _display_hz;
uint _fullscreen_bpp;
+static uint16 _bck_resolution[2];
static void MakePalette(void)
{
@@ -257,6 +258,13 @@ static LRESULT CALLBACK WndProcGdi(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lP
HandleExitGameRequest();
return 0;
+ case WM_DESTROY:
+ if (_window_maximize) {
+ _cur_resolution[0] = _bck_resolution[0];
+ _cur_resolution[1] = _bck_resolution[1];
+ }
+ return 0;
+
case WM_LBUTTONDOWN:
SetCapture(hwnd);
_left_button_down = true;
@@ -392,6 +400,10 @@ static LRESULT CALLBACK WndProcGdi(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lP
/* Set maximized flag when we maximize (obviously), but also when we
* switched to fullscreen from a maximized state */
_window_maximize = (wParam == SIZE_MAXIMIZED || (_window_maximize && _fullscreen));
+ if (_window_maximize) {
+ _bck_resolution[0] = _cur_resolution[0];
+ _bck_resolution[1] = _cur_resolution[1];
+ }
ClientSizeChanged(LOWORD(lParam), HIWORD(lParam));
}
return 0;