From eea7aa1d08b6185c780bf85edecd6835d99b884a Mon Sep 17 00:00:00 2001 From: spacy51 Date: Tue, 8 Apr 2008 19:19:42 +0000 Subject: [PATCH] FIXED: OpenGL had black border at top in fullscreen git-svn-id: https://svn.code.sf.net/p/vbam/code/trunk@478 a31d4220-a93d-0410-bf67-fe4944624d44 --- src/win32/VBA.cpp | 37 ++++++++++++++----------------------- src/win32/VBA.h | 1 - 2 files changed, 14 insertions(+), 24 deletions(-) diff --git a/src/win32/VBA.cpp b/src/win32/VBA.cpp index e99e71a8..63411ec1 100644 --- a/src/win32/VBA.cpp +++ b/src/win32/VBA.cpp @@ -250,7 +250,6 @@ VBA::VBA() showRenderedFrames = 0; screenMessage = false; screenMessageTime = 0; - menuToggle = true; display = NULL; menu = NULL; popup = NULL; @@ -602,27 +601,20 @@ void VBA::adjustDestRect() dest.right -= windowPositionX; } - int menuSkip = 0; - - if(videoOption >= VIDEO_320x240 && menuToggle) { - int m = GetSystemMetrics(SM_CYMENU); - menuSkip = m; - dest.bottom -=m; - } - if(videoOption > VIDEO_4X) { - int top = (fsHeight - surfaceSizeY) / 2; - int left = (fsWidth - surfaceSizeX) / 2; - dest.top += top; - dest.bottom += top; - dest.left += left; - dest.right += left; - if(fullScreenStretch) { - dest.top = 0+menuSkip; - dest.left = 0; - dest.right = fsWidth; - dest.bottom = fsHeight; - } + if(fullScreenStretch) { + dest.top = 0; + dest.left = 0; + dest.right = fsWidth; + dest.bottom = fsHeight; + } else { + int top = (fsHeight - surfaceSizeY) / 2; + int left = (fsWidth - surfaceSizeX) / 2; + dest.top += top; + dest.bottom += top; + dest.left += left; + dest.right += left; + } } } @@ -1926,7 +1918,6 @@ void VBA::updateWindowSize(int value) style |= WS_OVERLAPPEDWINDOW; - menuToggle = TRUE; AdjustWindowRectEx(&dest, style, TRUE, 0); //WS_EX_TOPMOST); winSizeX = dest.right-dest.left; @@ -1944,7 +1935,7 @@ void VBA::updateWindowSize(int value) info.cbSize = sizeof(MENUBARINFO); GetMenuBarInfo( theApp.m_pMainWnd->GetSafeHwnd(), OBJID_MENU, 0, &info ); int menuHeight = GetSystemMetrics(SM_CYMENU); // includes white line - if((info.rcBar.bottom - info.rcBar.top) > menuHeight) + if((info.rcBar.bottom - info.rcBar.top) > menuHeight) // check for double height menu { winSizeY += (info.rcBar.bottom - info.rcBar.top) - menuHeight + 1; m_pMainWnd->SetWindowPos( diff --git a/src/win32/VBA.h b/src/win32/VBA.h index fa5ac482..e95f0d06 100644 --- a/src/win32/VBA.h +++ b/src/win32/VBA.h @@ -112,7 +112,6 @@ class VBA : public CWinApp CString screenMessageBuffer; DWORD screenMessageTime; u8 *delta[257*244*4]; - bool menuToggle; IDisplay *display; IMAGE_TYPE cartridgeType; bool soundInitialized;