DXGL r638 - Code Review

Jump to navigation Jump to search
Repository:DXGL
Revision:r637‎ | r638 | r639 >
Date:19:14, 16 January 2016
Author:admin
Status:new
Tags:
Comment:
Properly resize window to not cut off the top of the display.
Modified paths:
  • /ddraw/glRenderer.cpp (modified) (history)

Diff [purge]

Index: ddraw/glRenderer.cpp
@@ -626,29 +626,29 @@
627627 ShowWindow(newwnd, SW_NORMAL);
628628 screenx = GetSystemMetrics(SM_CXSCREEN);
629629 screeny = GetSystemMetrics(SM_CYSCREEN);
630 - wndrect.right = width;
631 - wndrect.bottom = height;
 630+ wndrect.right = width + (screenx / 2) - (width / 2);
 631+ wndrect.bottom = height + (screeny / 2) - (height / 2);
632632 wndrect.left = (screenx / 2) - (width / 2);
633633 wndrect.top = (screeny / 2) - (height / 2);
634634 AdjustWindowRect(&wndrect, (winstyle | WS_OVERLAPPEDWINDOW) & ~(WS_THICKFRAME | WS_MAXIMIZEBOX), FALSE);
635 - SetWindowPos(newwnd, 0, wndrect.left, wndrect.top, wndrect.right,
636 - wndrect.bottom, SWP_ASYNCWINDOWPOS | SWP_NOACTIVATE | SWP_NOOWNERZORDER);
 635+ SetWindowPos(newwnd, 0, wndrect.left, wndrect.top, wndrect.right - wndrect.left,
 636+ wndrect.bottom - wndrect.top, SWP_ASYNCWINDOWPOS | SWP_NOACTIVATE | SWP_NOOWNERZORDER);
637637 break;
638638 case 3: // Windowed resizable
639639 winstyle = GetWindowLongPtrA(newwnd, GWL_STYLE);
640640 winstyleex = GetWindowLongPtrA(newwnd, GWL_EXSTYLE);
641641 SetWindowLongPtrA(newwnd, GWL_EXSTYLE, winstyleex | WS_EX_APPWINDOW);
642 - SetWindowLongPtrA(newwnd, GWL_STYLE, winstyle | WS_OVERLAPPEDWINDOW);
 642+ SetWindowLongPtrA(newwnd, GWL_STYLE, winstyle | WS_SYSMENU | WS_OVERLAPPEDWINDOW);
643643 ShowWindow(newwnd, SW_NORMAL);
644644 screenx = GetSystemMetrics(SM_CXSCREEN);
645645 screeny = GetSystemMetrics(SM_CYSCREEN);
646 - wndrect.right = width;
647 - wndrect.bottom = height;
 646+ wndrect.right = width + (screenx / 2) - (width / 2);
 647+ wndrect.bottom = height + (screeny / 2) - (height / 2);
648648 wndrect.left = (screenx / 2) - (width / 2);
649649 wndrect.top = (screeny / 2) - (height / 2);
650650 AdjustWindowRect(&wndrect, winstyle | WS_OVERLAPPEDWINDOW, FALSE);
651 - SetWindowPos(newwnd, 0, wndrect.left, wndrect.top, wndrect.right,
652 - wndrect.bottom, SWP_ASYNCWINDOWPOS | SWP_NOACTIVATE | SWP_NOOWNERZORDER);
 651+ SetWindowPos(newwnd, 0, wndrect.left, wndrect.top, wndrect.right - wndrect.left,
 652+ wndrect.bottom - wndrect.top, SWP_ASYNCWINDOWPOS | SWP_NOACTIVATE | SWP_NOOWNERZORDER);
653653 break;
654654 }
655655 }