DXGL r787 - Code Review

Jump to navigation Jump to search
Repository:DXGL
Revision:r786‎ | r787 | r788 >
Date:23:38, 1 March 2018
Author:admin
Status:new
Tags:
Comment:
Remember window size after changing display mode in forced-window mode.
Modified paths:
  • /ddraw/glRenderer.cpp (modified) (history)

Diff [purge]

Index: ddraw/glRenderer.cpp
@@ -2179,6 +2179,10 @@
21802180 }
21812181 wndrect.right = width + (screenx / 2) - (width / 2);
21822182 wndrect.bottom = height + (screeny / 2) - (height / 2);
 2183+ dxglcfg.WindowX = wndrect.left;
 2184+ dxglcfg.WindowY = wndrect.top;
 2185+ dxglcfg.WindowWidth = wndrect.right - wndrect.left;
 2186+ dxglcfg.WindowHeight = wndrect.bottom - wndrect.top;
21832187 AdjustWindowRectEx(&wndrect, (winstyle | WS_OVERLAPPEDWINDOW) & ~(WS_THICKFRAME | WS_MAXIMIZEBOX), FALSE,
21842188 (winstyleex | WS_EX_APPWINDOW));
21852189 SetWindowPos(newwnd, 0, wndrect.left, wndrect.top, wndrect.right - wndrect.left,
@@ -2208,6 +2212,10 @@
22092213 }
22102214 wndrect.right = width + (screenx / 2) - (width / 2);
22112215 wndrect.bottom = height + (screeny / 2) - (height / 2);
 2216+ dxglcfg.WindowX = wndrect.left;
 2217+ dxglcfg.WindowY = wndrect.top;
 2218+ dxglcfg.WindowWidth = wndrect.right - wndrect.left;
 2219+ dxglcfg.WindowHeight = wndrect.bottom - wndrect.top;
22122220 AdjustWindowRectEx(&wndrect, winstyle | WS_OVERLAPPEDWINDOW, FALSE, (winstyleex | WS_EX_APPWINDOW));
22132221 SetWindowPos(newwnd, 0, wndrect.left, wndrect.top, wndrect.right - wndrect.left,
22142222 wndrect.bottom - wndrect.top, SWP_ASYNCWINDOWPOS | SWP_NOACTIVATE | SWP_NOOWNERZORDER);
@@ -2231,6 +2239,10 @@
22322240 }
22332241 wndrect.right = width + (screenx / 2) - (width / 2);
22342242 wndrect.bottom = height + (screeny / 2) - (height / 2);
 2243+ dxglcfg.WindowX = wndrect.left;
 2244+ dxglcfg.WindowY = wndrect.top;
 2245+ dxglcfg.WindowWidth = wndrect.right - wndrect.left;
 2246+ dxglcfg.WindowHeight = wndrect.bottom - wndrect.top;
22352247 SetWindowPos(newwnd, 0, wndrect.left, wndrect.top, wndrect.right - wndrect.left,
22362248 wndrect.bottom - wndrect.top, SWP_ASYNCWINDOWPOS | SWP_NOACTIVATE | SWP_NOOWNERZORDER);
22372249 SaveWindowSettings(&dxglcfg);