DXGL r788 - Code Review

Jump to navigation Jump to search
Repository:DXGL
Revision:r787‎ | r788 | r789 >
Date:02:09, 2 March 2018
Author:admin
Status:new
Tags:
Comment:
Anchor top left of window when window position is set to remembered.
Modified paths:
  • /ddraw/glRenderer.cpp (modified) (history)

Diff [purge]

Index: ddraw/glRenderer.cpp
@@ -2099,7 +2099,7 @@
21002100 {
21012101 RECT r;
21022102 ZeroMemory(&r, sizeof(RECT));
2103 - BOOL ret = AdjustWindowRectEx(lpRect, dwStyle, bMenu, dwExStyle);
 2103+ BOOL ret = AdjustWindowRectEx(&r, dwStyle, bMenu, dwExStyle);
21042104 if (!ret) return ret;
21052105 else
21062106 {
@@ -2177,8 +2177,8 @@
21782178 wndrect.left = (screenx / 2) - (width / 2);
21792179 wndrect.top = (screeny / 2) - (height / 2);
21802180 }
2181 - wndrect.right = width + (screenx / 2) - (width / 2);
2182 - wndrect.bottom = height + (screeny / 2) - (height / 2);
 2181+ wndrect.right = wndrect.left + width;
 2182+ wndrect.bottom = wndrect.top + height;
21832183 dxglcfg.WindowX = wndrect.left;
21842184 dxglcfg.WindowY = wndrect.top;
21852185 dxglcfg.WindowWidth = wndrect.right - wndrect.left;
@@ -2210,8 +2210,8 @@
22112211 wndrect.left = (screenx / 2) - (width / 2);
22122212 wndrect.top = (screeny / 2) - (height / 2);
22132213 }
2214 - wndrect.right = width + (screenx / 2) - (width / 2);
2215 - wndrect.bottom = height + (screeny / 2) - (height / 2);
 2214+ wndrect.right = wndrect.left + width;
 2215+ wndrect.bottom = wndrect.top + height;
22162216 dxglcfg.WindowX = wndrect.left;
22172217 dxglcfg.WindowY = wndrect.top;
22182218 dxglcfg.WindowWidth = wndrect.right - wndrect.left;
@@ -2237,8 +2237,8 @@
22382238 wndrect.left = (screenx / 2) - (width / 2);
22392239 wndrect.top = (screeny / 2) - (height / 2);
22402240 }
2241 - wndrect.right = width + (screenx / 2) - (width / 2);
2242 - wndrect.bottom = height + (screeny / 2) - (height / 2);
 2241+ wndrect.right = wndrect.left + width;
 2242+ wndrect.bottom = wndrect.top + height;
22432243 dxglcfg.WindowX = wndrect.left;
22442244 dxglcfg.WindowY = wndrect.top;
22452245 dxglcfg.WindowWidth = wndrect.right - wndrect.left;