Index: ddraw/glRenderer.cpp |
— | — | @@ -1804,6 +1804,22 @@ |
1805 | 1805 | WaitForSingleObject(This->busy,INFINITE);
|
1806 | 1806 | }
|
1807 | 1807 |
|
| 1808 | +__inline BOOL UnadjustWindowRectEx(LPRECT lpRect, DWORD dwStyle, BOOL bMenu, DWORD dwExStyle)
|
| 1809 | +{
|
| 1810 | + RECT r;
|
| 1811 | + ZeroMemory(&r, sizeof(RECT));
|
| 1812 | + BOOL ret = AdjustWindowRectEx(&r, dwStyle, bMenu, dwExStyle);
|
| 1813 | + if (!ret) return ret;
|
| 1814 | + else
|
| 1815 | + {
|
| 1816 | + lpRect->left -= r.left;
|
| 1817 | + lpRect->top -= r.top;
|
| 1818 | + lpRect->right -= r.right;
|
| 1819 | + lpRect->bottom -= r.bottom;
|
| 1820 | + return ret;
|
| 1821 | + }
|
| 1822 | +}
|
| 1823 | +
|
1808 | 1824 | /**
|
1809 | 1825 | * Deletes a glRenderer object
|
1810 | 1826 | * @param This
|
— | — | @@ -1811,11 +1827,27 @@ |
1812 | 1828 | */
|
1813 | 1829 | void glRenderer_Delete(glRenderer *This)
|
1814 | 1830 | {
|
| 1831 | + BOOL hasmenu;
|
| 1832 | + RECT wndrect;
|
| 1833 | + LONG_PTR winstyle, winstyleex;
|
1815 | 1834 | switch (dxglcfg.fullmode)
|
1816 | 1835 | {
|
1817 | 1836 | case 2:
|
1818 | 1837 | case 3:
|
1819 | 1838 | case 4:
|
| 1839 | + GetWindowRect(This->hWnd, &wndrect);
|
| 1840 | + if (dxglcfg.fullmode != 4)
|
| 1841 | + {
|
| 1842 | + winstyle = GetWindowLongPtrA(This->hWnd, GWL_STYLE);
|
| 1843 | + winstyleex = GetWindowLongPtrA(This->hWnd, GWL_EXSTYLE);
|
| 1844 | + if (GetMenu(This->hWnd)) hasmenu = TRUE;
|
| 1845 | + else hasmenu = FALSE;
|
| 1846 | + UnadjustWindowRectEx(&wndrect, winstyle, hasmenu, winstyleex);
|
| 1847 | + }
|
| 1848 | + dxglcfg.WindowX = wndrect.left;
|
| 1849 | + dxglcfg.WindowY = wndrect.top;
|
| 1850 | + dxglcfg.WindowWidth = wndrect.right - wndrect.left;
|
| 1851 | + dxglcfg.WindowHeight = wndrect.bottom - wndrect.top;
|
1820 | 1852 | SaveWindowSettings(&dxglcfg);
|
1821 | 1853 | break;
|
1822 | 1854 | default:
|
— | — | @@ -2095,22 +2127,6 @@ |
2096 | 2128 | LeaveCriticalSection(&This->cs);
|
2097 | 2129 | }
|
2098 | 2130 |
|
2099 | | -__inline BOOL UnadjustWindowRectEx(LPRECT lpRect, DWORD dwStyle, BOOL bMenu, DWORD dwExStyle)
|
2100 | | -{
|
2101 | | - RECT r;
|
2102 | | - ZeroMemory(&r, sizeof(RECT));
|
2103 | | - BOOL ret = AdjustWindowRectEx(&r, dwStyle, bMenu, dwExStyle);
|
2104 | | - if (!ret) return ret;
|
2105 | | - else
|
2106 | | - {
|
2107 | | - lpRect->left -= r.left;
|
2108 | | - lpRect->top -= r.top;
|
2109 | | - lpRect->right -= r.right;
|
2110 | | - lpRect->bottom -= r.bottom;
|
2111 | | - return ret;
|
2112 | | - }
|
2113 | | -}
|
2114 | | -
|
2115 | 2131 | /**
|
2116 | 2132 | * Changes the window used for rendering.
|
2117 | 2133 | * @param This
|
— | — | @@ -2205,13 +2221,19 @@ |
2206 | 2222 | }
|
2207 | 2223 | else
|
2208 | 2224 | {
|
| 2225 | + if (dxglcfg.NoResizeWindow) break;
|
2209 | 2226 | screenx = GetSystemMetrics(SM_CXSCREEN);
|
2210 | 2227 | screeny = GetSystemMetrics(SM_CYSCREEN);
|
2211 | 2228 | wndrect.left = (screenx / 2) - (width / 2);
|
2212 | 2229 | wndrect.top = (screeny / 2) - (height / 2);
|
2213 | 2230 | }
|
2214 | | - wndrect.right = wndrect.left + width;
|
2215 | | - wndrect.bottom = wndrect.top + height;
|
| 2231 | + if (!dxglcfg.NoResizeWindow)
|
| 2232 | + {
|
| 2233 | + wndrect.right = wndrect.left + width;
|
| 2234 | + wndrect.bottom = wndrect.top + height;
|
| 2235 | + }
|
| 2236 | + else glDirectDraw7_SetWindowSize(This->ddInterface, wndrect.right - wndrect.left,
|
| 2237 | + wndrect.bottom - wndrect.top);
|
2216 | 2238 | dxglcfg.WindowX = wndrect.left;
|
2217 | 2239 | dxglcfg.WindowY = wndrect.top;
|
2218 | 2240 | dxglcfg.WindowWidth = wndrect.right - wndrect.left;
|