From 947e10311ee4c9d4793cdadc2779c11d0b4e14e9 Mon Sep 17 00:00:00 2001 From: squall-leonhart Date: Tue, 15 Sep 2009 09:21:37 +0000 Subject: [PATCH] working to fix the return to 5x and 6x windowed mode after esc full screen --- src/win32/Direct3D.cpp | 4 ++-- src/win32/MainWnd.cpp | 4 ++-- src/win32/MainWndFile.cpp | 4 ++-- src/win32/MainWndTools.cpp | 24 ++++++++++++------------ src/win32/OpenGL.cpp | 8 ++++---- src/win32/VBA.cpp | 18 +++++++++--------- 6 files changed, 31 insertions(+), 31 deletions(-) diff --git a/src/win32/Direct3D.cpp b/src/win32/Direct3D.cpp index de692bc2..c39ca3cd 100644 --- a/src/win32/Direct3D.cpp +++ b/src/win32/Direct3D.cpp @@ -531,7 +531,7 @@ void Direct3DDisplay::render() r.right = dpp.BackBufferWidth - 1; r.bottom = dpp.BackBufferHeight - 1; - if( theApp.showSpeed && ( theApp.videoOption > VIDEO_4X ) ) { + if( theApp.showSpeed && ( theApp.videoOption > VIDEO_6X ) ) { color = theApp.showSpeedTransparent ? D3DCOLOR_ARGB(0x7F, 0x00, 0x00, 0xFF) : D3DCOLOR_ARGB(0xFF, 0x00, 0x00, 0xFF); char buffer[30]; if( theApp.showSpeed == 1 ) { @@ -583,7 +583,7 @@ void Direct3DDisplay::resize( int w, int h ) if( (w != dpp.BackBufferWidth) || (h != dpp.BackBufferHeight) || - (theApp.videoOption > VIDEO_4X) ) { + (theApp.videoOption > VIDEO_6X) ) { resetDevice(); calculateDestRect(); } diff --git a/src/win32/MainWnd.cpp b/src/win32/MainWnd.cpp index eb3d4f82..d269fa27 100644 --- a/src/win32/MainWnd.cpp +++ b/src/win32/MainWnd.cpp @@ -775,7 +775,7 @@ void MainWnd::OnSize(UINT nType, int cx, int cy) theApp.paused = false; } } - if(theApp.videoOption <= VIDEO_4X) { + if(theApp.videoOption <= VIDEO_6X) { theApp.surfaceSizeX = cx; theApp.surfaceSizeY = cy; theApp.adjustDestRect(); @@ -1185,7 +1185,7 @@ void MainWnd::screenCapture(int captureNumber) void MainWnd::winMouseOn() { SetCursor(arrow); - if(theApp.videoOption > VIDEO_4X) { + if(theApp.videoOption > VIDEO_6X) { theApp.mouseCounter = 10; } else theApp.mouseCounter = 0; diff --git a/src/win32/MainWndFile.cpp b/src/win32/MainWndFile.cpp index f4833c00..dccc4fef 100644 --- a/src/win32/MainWndFile.cpp +++ b/src/win32/MainWndFile.cpp @@ -672,7 +672,7 @@ void MainWnd::OnUpdateFileRominformation(CCmdUI* pCmdUI) //OnFileToggleFullscreen void MainWnd::OnFileTogglemenu() { - if( theApp.videoOption <= VIDEO_4X ) { + if( theApp.videoOption <= VIDEO_6X ) { // switch to full screen toolsLoggingClose(); // close log dialog theApp.updateWindowSize( theApp.lastFullscreen ); @@ -685,7 +685,7 @@ void MainWnd::OnFileTogglemenu() void MainWnd::OnUpdateFileTogglemenu(CCmdUI* pCmdUI) { // HACK: when uncommented, Esc key will not be send to MainWnd - //pCmdUI->Enable(theApp.videoOption > VIDEO_4X); + //pCmdUI->Enable(theApp.videoOption > VIDEO_6X); } bool MainWnd::fileImportGSACodeFile(CString& fileName) diff --git a/src/win32/MainWndTools.cpp b/src/win32/MainWndTools.cpp index b9e5da9b..579191b9 100644 --- a/src/win32/MainWndTools.cpp +++ b/src/win32/MainWndTools.cpp @@ -55,7 +55,7 @@ void MainWnd::OnToolsDisassemble() void MainWnd::OnUpdateToolsDisassemble(CCmdUI* pCmdUI) { - pCmdUI->Enable(theApp.videoOption <= VIDEO_4X); + pCmdUI->Enable(theApp.videoOption <= VIDEO_6X); } void MainWnd::OnToolsLogging() @@ -65,7 +65,7 @@ void MainWnd::OnToolsLogging() void MainWnd::OnUpdateToolsLogging(CCmdUI* pCmdUI) { - pCmdUI->Enable(theApp.videoOption <= VIDEO_4X); + pCmdUI->Enable(theApp.videoOption <= VIDEO_6X); } void MainWnd::OnToolsIoviewer() @@ -77,7 +77,7 @@ void MainWnd::OnToolsIoviewer() void MainWnd::OnUpdateToolsIoviewer(CCmdUI* pCmdUI) { - pCmdUI->Enable(theApp.videoOption <= VIDEO_4X && theApp.cartridgeType == 0); + pCmdUI->Enable(theApp.videoOption <= VIDEO_6X && theApp.cartridgeType == 0); } void MainWnd::OnToolsMapview() @@ -95,7 +95,7 @@ void MainWnd::OnToolsMapview() void MainWnd::OnUpdateToolsMapview(CCmdUI* pCmdUI) { - pCmdUI->Enable(theApp.videoOption <= VIDEO_4X); + pCmdUI->Enable(theApp.videoOption <= VIDEO_6X); } void MainWnd::OnToolsMemoryviewer() @@ -113,7 +113,7 @@ void MainWnd::OnToolsMemoryviewer() void MainWnd::OnUpdateToolsMemoryviewer(CCmdUI* pCmdUI) { - pCmdUI->Enable(theApp.videoOption <= VIDEO_4X); + pCmdUI->Enable(theApp.videoOption <= VIDEO_6X); } void MainWnd::OnToolsOamviewer() @@ -131,7 +131,7 @@ void MainWnd::OnToolsOamviewer() void MainWnd::OnUpdateToolsOamviewer(CCmdUI* pCmdUI) { - pCmdUI->Enable(theApp.videoOption <= VIDEO_4X); + pCmdUI->Enable(theApp.videoOption <= VIDEO_6X); } void MainWnd::OnToolsPaletteview() @@ -149,7 +149,7 @@ void MainWnd::OnToolsPaletteview() void MainWnd::OnUpdateToolsPaletteview(CCmdUI* pCmdUI) { - pCmdUI->Enable(theApp.videoOption <= VIDEO_4X); + pCmdUI->Enable(theApp.videoOption <= VIDEO_6X); } void MainWnd::OnToolsTileviewer() @@ -167,7 +167,7 @@ void MainWnd::OnToolsTileviewer() void MainWnd::OnUpdateToolsTileviewer(CCmdUI* pCmdUI) { - pCmdUI->Enable(theApp.videoOption <= VIDEO_4X); + pCmdUI->Enable(theApp.videoOption <= VIDEO_6X); } void MainWnd::OnDebugNextframe() @@ -209,7 +209,7 @@ void MainWnd::OnToolsDebugGdb() void MainWnd::OnUpdateToolsDebugGdb(CCmdUI* pCmdUI) { - pCmdUI->Enable(theApp.videoOption <= VIDEO_4X && remoteSocket == -1); + pCmdUI->Enable(theApp.videoOption <= VIDEO_6X && remoteSocket == -1); } void MainWnd::OnToolsDebugLoadandwait() @@ -237,7 +237,7 @@ void MainWnd::OnToolsDebugLoadandwait() void MainWnd::OnUpdateToolsDebugLoadandwait(CCmdUI* pCmdUI) { - pCmdUI->Enable(theApp.videoOption <= VIDEO_4X && remoteSocket == -1); + pCmdUI->Enable(theApp.videoOption <= VIDEO_6X && remoteSocket == -1); } void MainWnd::OnToolsDebugBreak() @@ -254,7 +254,7 @@ void MainWnd::OnToolsDebugBreak() void MainWnd::OnUpdateToolsDebugBreak(CCmdUI* pCmdUI) { - pCmdUI->Enable(theApp.videoOption <= VIDEO_4X && remoteSocket != -1); + pCmdUI->Enable(theApp.videoOption <= VIDEO_6X && remoteSocket != -1); } void MainWnd::OnToolsDebugDisconnect() @@ -265,7 +265,7 @@ void MainWnd::OnToolsDebugDisconnect() void MainWnd::OnUpdateToolsDebugDisconnect(CCmdUI* pCmdUI) { - pCmdUI->Enable(theApp.videoOption <= VIDEO_4X && remoteSocket != -1); + pCmdUI->Enable(theApp.videoOption <= VIDEO_6X && remoteSocket != -1); } void MainWnd::OnOptionsSoundStartrecording() diff --git a/src/win32/OpenGL.cpp b/src/win32/OpenGL.cpp index e59f5b0b..e9eb17b3 100644 --- a/src/win32/OpenGL.cpp +++ b/src/win32/OpenGL.cpp @@ -272,12 +272,12 @@ bool OpenGLDisplay::initialize() DWORD style = WS_POPUP | WS_VISIBLE; DWORD styleEx = 0; - if( theApp.videoOption <= VIDEO_4X ) + if( theApp.videoOption <= VIDEO_6X ) style |= WS_OVERLAPPEDWINDOW; else styleEx = 0; - if( theApp.videoOption <= VIDEO_4X ) + if( theApp.videoOption <= VIDEO_6X ) AdjustWindowRectEx( &theApp.dest, style, TRUE, styleEx ); else AdjustWindowRectEx( &theApp.dest, style, FALSE, styleEx ); @@ -286,7 +286,7 @@ bool OpenGLDisplay::initialize() int winSizeY = theApp.dest.bottom - theApp.dest.top; int x = 0, y = 0; - if( theApp.videoOption <= VIDEO_4X ) { + if( theApp.videoOption <= VIDEO_6X ) { x = theApp.windowPositionX; y = theApp.windowPositionY; } else { @@ -420,7 +420,7 @@ void OpenGLDisplay::render() glEnd(); - if( theApp.showSpeed ) { // && ( theApp.videoOption > VIDEO_4X ) ) { + if( theApp.showSpeed ) { // && ( theApp.videoOption > VIDEO_6X ) ) { char buffer[30]; if( theApp.showSpeed == 1 ) { sprintf( buffer, "%3d%%", systemSpeed ); diff --git a/src/win32/VBA.cpp b/src/win32/VBA.cpp index bcd25aaa..df72dedc 100644 --- a/src/win32/VBA.cpp +++ b/src/win32/VBA.cpp @@ -543,7 +543,7 @@ void VBA::adjustDestRect() dest.right -= windowPositionX; } - if(videoOption > VIDEO_4X) { + if(videoOption > VIDEO_6X) { if(fullScreenStretch) { dest.top = 0; dest.left = 0; @@ -1027,7 +1027,7 @@ void systemShowSpeed(int speed) systemSpeed = speed; theApp.showRenderedFrames = theApp.renderedFrames; theApp.renderedFrames = 0; - if(theApp.videoOption <= VIDEO_4X && theApp.showSpeed) { + if(theApp.videoOption <= VIDEO_6X && theApp.showSpeed) { CString buffer; if(theApp.showSpeed == 1) buffer.Format(VBA_NAME_AND_SUBVERSION "-%3d%%", systemSpeed); @@ -1720,11 +1720,11 @@ void VBA::updateWindowSize(int value) if(((value >= VIDEO_320x240) && (videoOption != value)) || (videoOption >= VIDEO_320x240 && - value <= VIDEO_4X) || + value <= VIDEO_6X) || fsForceChange) { fsForceChange = false; changingVideoSize = true; - if( videoOption <= VIDEO_4X ) { + if( videoOption <= VIDEO_6X ) { lastWindowed = (VIDEO_SIZE)videoOption; // save for when leaving full screen } else { lastFullscreen = (VIDEO_SIZE)videoOption; // save for when using quick switch to fullscreen @@ -1847,7 +1847,7 @@ void VBA::updateWindowSize(int value) int winSizeX = sizeX; int winSizeY = sizeY; - if(videoOption <= VIDEO_4X) { + if(videoOption <= VIDEO_6X) { dest.left = 0; dest.top = 0; dest.right = surfaceSizeX; @@ -1983,13 +1983,13 @@ bool VBA::preInitialize() DWORD style = WS_POPUP | WS_VISIBLE; DWORD styleEx = 0; - if( videoOption <= VIDEO_4X ) { + if( videoOption <= VIDEO_6X ) { style |= WS_OVERLAPPEDWINDOW; } else { styleEx = 0; } - if( videoOption <= VIDEO_4X ) { + if( videoOption <= VIDEO_6X ) { AdjustWindowRectEx( &dest, style, TRUE, styleEx ); } else { AdjustWindowRectEx( &dest, style, FALSE, styleEx ); @@ -1998,14 +1998,14 @@ bool VBA::preInitialize() int winSizeX = dest.right-dest.left; int winSizeY = dest.bottom-dest.top; - if( videoOption > VIDEO_4X ) { + if( videoOption > VIDEO_6X ) { winSizeX = fsWidth; winSizeY = fsHeight; } int x = 0, y = 0; - if( videoOption <= VIDEO_4X ) { + if( videoOption <= VIDEO_6X ) { x = windowPositionX; y = windowPositionY; }