(svn r7061) -[win32] Feature: Remember the window size between restarts when quit in fullscreen mode.
authorDarkvater
Sun, 05 Nov 2006 01:13:08 +0000
changeset 5020 a679bc02c88d
parent 5019 1e16d845265a
child 5021 711e711f6b9a
(svn r7061) -[win32] Feature: Remember the window size between restarts when quit in fullscreen mode.
video/win32_v.c
--- a/video/win32_v.c	Sun Nov 05 01:09:57 2006 +0000
+++ b/video/win32_v.c	Sun Nov 05 01:13:08 2006 +0000
@@ -34,6 +34,7 @@
 bool _window_maximize;
 uint _display_hz;
 uint _fullscreen_bpp;
+static uint16 _bck_resolution[2];
 
 static void MakePalette(void)
 {
@@ -257,6 +258,13 @@
 			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 @@
 				/* 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;