working to fix the return to 5x and 6x windowed mode after esc full screen

This commit is contained in:
squall-leonhart 2009-09-15 09:21:37 +00:00
parent 8af8f4dffa
commit 947e10311e
6 changed files with 31 additions and 31 deletions

View File

@ -531,7 +531,7 @@ void Direct3DDisplay::render()
r.right = dpp.BackBufferWidth - 1; r.right = dpp.BackBufferWidth - 1;
r.bottom = dpp.BackBufferHeight - 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); color = theApp.showSpeedTransparent ? D3DCOLOR_ARGB(0x7F, 0x00, 0x00, 0xFF) : D3DCOLOR_ARGB(0xFF, 0x00, 0x00, 0xFF);
char buffer[30]; char buffer[30];
if( theApp.showSpeed == 1 ) { if( theApp.showSpeed == 1 ) {
@ -583,7 +583,7 @@ void Direct3DDisplay::resize( int w, int h )
if( (w != dpp.BackBufferWidth) || if( (w != dpp.BackBufferWidth) ||
(h != dpp.BackBufferHeight) || (h != dpp.BackBufferHeight) ||
(theApp.videoOption > VIDEO_4X) ) { (theApp.videoOption > VIDEO_6X) ) {
resetDevice(); resetDevice();
calculateDestRect(); calculateDestRect();
} }

View File

@ -775,7 +775,7 @@ void MainWnd::OnSize(UINT nType, int cx, int cy)
theApp.paused = false; theApp.paused = false;
} }
} }
if(theApp.videoOption <= VIDEO_4X) { if(theApp.videoOption <= VIDEO_6X) {
theApp.surfaceSizeX = cx; theApp.surfaceSizeX = cx;
theApp.surfaceSizeY = cy; theApp.surfaceSizeY = cy;
theApp.adjustDestRect(); theApp.adjustDestRect();
@ -1185,7 +1185,7 @@ void MainWnd::screenCapture(int captureNumber)
void MainWnd::winMouseOn() void MainWnd::winMouseOn()
{ {
SetCursor(arrow); SetCursor(arrow);
if(theApp.videoOption > VIDEO_4X) { if(theApp.videoOption > VIDEO_6X) {
theApp.mouseCounter = 10; theApp.mouseCounter = 10;
} else } else
theApp.mouseCounter = 0; theApp.mouseCounter = 0;

View File

@ -672,7 +672,7 @@ void MainWnd::OnUpdateFileRominformation(CCmdUI* pCmdUI)
//OnFileToggleFullscreen //OnFileToggleFullscreen
void MainWnd::OnFileTogglemenu() void MainWnd::OnFileTogglemenu()
{ {
if( theApp.videoOption <= VIDEO_4X ) { if( theApp.videoOption <= VIDEO_6X ) {
// switch to full screen // switch to full screen
toolsLoggingClose(); // close log dialog toolsLoggingClose(); // close log dialog
theApp.updateWindowSize( theApp.lastFullscreen ); theApp.updateWindowSize( theApp.lastFullscreen );
@ -685,7 +685,7 @@ void MainWnd::OnFileTogglemenu()
void MainWnd::OnUpdateFileTogglemenu(CCmdUI* pCmdUI) void MainWnd::OnUpdateFileTogglemenu(CCmdUI* pCmdUI)
{ {
// HACK: when uncommented, Esc key will not be send to MainWnd // 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) bool MainWnd::fileImportGSACodeFile(CString& fileName)

View File

@ -55,7 +55,7 @@ void MainWnd::OnToolsDisassemble()
void MainWnd::OnUpdateToolsDisassemble(CCmdUI* pCmdUI) void MainWnd::OnUpdateToolsDisassemble(CCmdUI* pCmdUI)
{ {
pCmdUI->Enable(theApp.videoOption <= VIDEO_4X); pCmdUI->Enable(theApp.videoOption <= VIDEO_6X);
} }
void MainWnd::OnToolsLogging() void MainWnd::OnToolsLogging()
@ -65,7 +65,7 @@ void MainWnd::OnToolsLogging()
void MainWnd::OnUpdateToolsLogging(CCmdUI* pCmdUI) void MainWnd::OnUpdateToolsLogging(CCmdUI* pCmdUI)
{ {
pCmdUI->Enable(theApp.videoOption <= VIDEO_4X); pCmdUI->Enable(theApp.videoOption <= VIDEO_6X);
} }
void MainWnd::OnToolsIoviewer() void MainWnd::OnToolsIoviewer()
@ -77,7 +77,7 @@ void MainWnd::OnToolsIoviewer()
void MainWnd::OnUpdateToolsIoviewer(CCmdUI* pCmdUI) 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() void MainWnd::OnToolsMapview()
@ -95,7 +95,7 @@ void MainWnd::OnToolsMapview()
void MainWnd::OnUpdateToolsMapview(CCmdUI* pCmdUI) void MainWnd::OnUpdateToolsMapview(CCmdUI* pCmdUI)
{ {
pCmdUI->Enable(theApp.videoOption <= VIDEO_4X); pCmdUI->Enable(theApp.videoOption <= VIDEO_6X);
} }
void MainWnd::OnToolsMemoryviewer() void MainWnd::OnToolsMemoryviewer()
@ -113,7 +113,7 @@ void MainWnd::OnToolsMemoryviewer()
void MainWnd::OnUpdateToolsMemoryviewer(CCmdUI* pCmdUI) void MainWnd::OnUpdateToolsMemoryviewer(CCmdUI* pCmdUI)
{ {
pCmdUI->Enable(theApp.videoOption <= VIDEO_4X); pCmdUI->Enable(theApp.videoOption <= VIDEO_6X);
} }
void MainWnd::OnToolsOamviewer() void MainWnd::OnToolsOamviewer()
@ -131,7 +131,7 @@ void MainWnd::OnToolsOamviewer()
void MainWnd::OnUpdateToolsOamviewer(CCmdUI* pCmdUI) void MainWnd::OnUpdateToolsOamviewer(CCmdUI* pCmdUI)
{ {
pCmdUI->Enable(theApp.videoOption <= VIDEO_4X); pCmdUI->Enable(theApp.videoOption <= VIDEO_6X);
} }
void MainWnd::OnToolsPaletteview() void MainWnd::OnToolsPaletteview()
@ -149,7 +149,7 @@ void MainWnd::OnToolsPaletteview()
void MainWnd::OnUpdateToolsPaletteview(CCmdUI* pCmdUI) void MainWnd::OnUpdateToolsPaletteview(CCmdUI* pCmdUI)
{ {
pCmdUI->Enable(theApp.videoOption <= VIDEO_4X); pCmdUI->Enable(theApp.videoOption <= VIDEO_6X);
} }
void MainWnd::OnToolsTileviewer() void MainWnd::OnToolsTileviewer()
@ -167,7 +167,7 @@ void MainWnd::OnToolsTileviewer()
void MainWnd::OnUpdateToolsTileviewer(CCmdUI* pCmdUI) void MainWnd::OnUpdateToolsTileviewer(CCmdUI* pCmdUI)
{ {
pCmdUI->Enable(theApp.videoOption <= VIDEO_4X); pCmdUI->Enable(theApp.videoOption <= VIDEO_6X);
} }
void MainWnd::OnDebugNextframe() void MainWnd::OnDebugNextframe()
@ -209,7 +209,7 @@ void MainWnd::OnToolsDebugGdb()
void MainWnd::OnUpdateToolsDebugGdb(CCmdUI* pCmdUI) void MainWnd::OnUpdateToolsDebugGdb(CCmdUI* pCmdUI)
{ {
pCmdUI->Enable(theApp.videoOption <= VIDEO_4X && remoteSocket == -1); pCmdUI->Enable(theApp.videoOption <= VIDEO_6X && remoteSocket == -1);
} }
void MainWnd::OnToolsDebugLoadandwait() void MainWnd::OnToolsDebugLoadandwait()
@ -237,7 +237,7 @@ void MainWnd::OnToolsDebugLoadandwait()
void MainWnd::OnUpdateToolsDebugLoadandwait(CCmdUI* pCmdUI) void MainWnd::OnUpdateToolsDebugLoadandwait(CCmdUI* pCmdUI)
{ {
pCmdUI->Enable(theApp.videoOption <= VIDEO_4X && remoteSocket == -1); pCmdUI->Enable(theApp.videoOption <= VIDEO_6X && remoteSocket == -1);
} }
void MainWnd::OnToolsDebugBreak() void MainWnd::OnToolsDebugBreak()
@ -254,7 +254,7 @@ void MainWnd::OnToolsDebugBreak()
void MainWnd::OnUpdateToolsDebugBreak(CCmdUI* pCmdUI) void MainWnd::OnUpdateToolsDebugBreak(CCmdUI* pCmdUI)
{ {
pCmdUI->Enable(theApp.videoOption <= VIDEO_4X && remoteSocket != -1); pCmdUI->Enable(theApp.videoOption <= VIDEO_6X && remoteSocket != -1);
} }
void MainWnd::OnToolsDebugDisconnect() void MainWnd::OnToolsDebugDisconnect()
@ -265,7 +265,7 @@ void MainWnd::OnToolsDebugDisconnect()
void MainWnd::OnUpdateToolsDebugDisconnect(CCmdUI* pCmdUI) void MainWnd::OnUpdateToolsDebugDisconnect(CCmdUI* pCmdUI)
{ {
pCmdUI->Enable(theApp.videoOption <= VIDEO_4X && remoteSocket != -1); pCmdUI->Enable(theApp.videoOption <= VIDEO_6X && remoteSocket != -1);
} }
void MainWnd::OnOptionsSoundStartrecording() void MainWnd::OnOptionsSoundStartrecording()

View File

@ -272,12 +272,12 @@ bool OpenGLDisplay::initialize()
DWORD style = WS_POPUP | WS_VISIBLE; DWORD style = WS_POPUP | WS_VISIBLE;
DWORD styleEx = 0; DWORD styleEx = 0;
if( theApp.videoOption <= VIDEO_4X ) if( theApp.videoOption <= VIDEO_6X )
style |= WS_OVERLAPPEDWINDOW; style |= WS_OVERLAPPEDWINDOW;
else else
styleEx = 0; styleEx = 0;
if( theApp.videoOption <= VIDEO_4X ) if( theApp.videoOption <= VIDEO_6X )
AdjustWindowRectEx( &theApp.dest, style, TRUE, styleEx ); AdjustWindowRectEx( &theApp.dest, style, TRUE, styleEx );
else else
AdjustWindowRectEx( &theApp.dest, style, FALSE, styleEx ); AdjustWindowRectEx( &theApp.dest, style, FALSE, styleEx );
@ -286,7 +286,7 @@ bool OpenGLDisplay::initialize()
int winSizeY = theApp.dest.bottom - theApp.dest.top; int winSizeY = theApp.dest.bottom - theApp.dest.top;
int x = 0, y = 0; int x = 0, y = 0;
if( theApp.videoOption <= VIDEO_4X ) { if( theApp.videoOption <= VIDEO_6X ) {
x = theApp.windowPositionX; x = theApp.windowPositionX;
y = theApp.windowPositionY; y = theApp.windowPositionY;
} else { } else {
@ -420,7 +420,7 @@ void OpenGLDisplay::render()
glEnd(); glEnd();
if( theApp.showSpeed ) { // && ( theApp.videoOption > VIDEO_4X ) ) { if( theApp.showSpeed ) { // && ( theApp.videoOption > VIDEO_6X ) ) {
char buffer[30]; char buffer[30];
if( theApp.showSpeed == 1 ) { if( theApp.showSpeed == 1 ) {
sprintf( buffer, "%3d%%", systemSpeed ); sprintf( buffer, "%3d%%", systemSpeed );

View File

@ -543,7 +543,7 @@ void VBA::adjustDestRect()
dest.right -= windowPositionX; dest.right -= windowPositionX;
} }
if(videoOption > VIDEO_4X) { if(videoOption > VIDEO_6X) {
if(fullScreenStretch) { if(fullScreenStretch) {
dest.top = 0; dest.top = 0;
dest.left = 0; dest.left = 0;
@ -1027,7 +1027,7 @@ void systemShowSpeed(int speed)
systemSpeed = speed; systemSpeed = speed;
theApp.showRenderedFrames = theApp.renderedFrames; theApp.showRenderedFrames = theApp.renderedFrames;
theApp.renderedFrames = 0; theApp.renderedFrames = 0;
if(theApp.videoOption <= VIDEO_4X && theApp.showSpeed) { if(theApp.videoOption <= VIDEO_6X && theApp.showSpeed) {
CString buffer; CString buffer;
if(theApp.showSpeed == 1) if(theApp.showSpeed == 1)
buffer.Format(VBA_NAME_AND_SUBVERSION "-%3d%%", systemSpeed); buffer.Format(VBA_NAME_AND_SUBVERSION "-%3d%%", systemSpeed);
@ -1720,11 +1720,11 @@ void VBA::updateWindowSize(int value)
if(((value >= VIDEO_320x240) && if(((value >= VIDEO_320x240) &&
(videoOption != value)) || (videoOption != value)) ||
(videoOption >= VIDEO_320x240 && (videoOption >= VIDEO_320x240 &&
value <= VIDEO_4X) || value <= VIDEO_6X) ||
fsForceChange) { fsForceChange) {
fsForceChange = false; fsForceChange = false;
changingVideoSize = true; changingVideoSize = true;
if( videoOption <= VIDEO_4X ) { if( videoOption <= VIDEO_6X ) {
lastWindowed = (VIDEO_SIZE)videoOption; // save for when leaving full screen lastWindowed = (VIDEO_SIZE)videoOption; // save for when leaving full screen
} else { } else {
lastFullscreen = (VIDEO_SIZE)videoOption; // save for when using quick switch to fullscreen 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 winSizeX = sizeX;
int winSizeY = sizeY; int winSizeY = sizeY;
if(videoOption <= VIDEO_4X) { if(videoOption <= VIDEO_6X) {
dest.left = 0; dest.left = 0;
dest.top = 0; dest.top = 0;
dest.right = surfaceSizeX; dest.right = surfaceSizeX;
@ -1983,13 +1983,13 @@ bool VBA::preInitialize()
DWORD style = WS_POPUP | WS_VISIBLE; DWORD style = WS_POPUP | WS_VISIBLE;
DWORD styleEx = 0; DWORD styleEx = 0;
if( videoOption <= VIDEO_4X ) { if( videoOption <= VIDEO_6X ) {
style |= WS_OVERLAPPEDWINDOW; style |= WS_OVERLAPPEDWINDOW;
} else { } else {
styleEx = 0; styleEx = 0;
} }
if( videoOption <= VIDEO_4X ) { if( videoOption <= VIDEO_6X ) {
AdjustWindowRectEx( &dest, style, TRUE, styleEx ); AdjustWindowRectEx( &dest, style, TRUE, styleEx );
} else { } else {
AdjustWindowRectEx( &dest, style, FALSE, styleEx ); AdjustWindowRectEx( &dest, style, FALSE, styleEx );
@ -1998,14 +1998,14 @@ bool VBA::preInitialize()
int winSizeX = dest.right-dest.left; int winSizeX = dest.right-dest.left;
int winSizeY = dest.bottom-dest.top; int winSizeY = dest.bottom-dest.top;
if( videoOption > VIDEO_4X ) { if( videoOption > VIDEO_6X ) {
winSizeX = fsWidth; winSizeX = fsWidth;
winSizeY = fsHeight; winSizeY = fsHeight;
} }
int x = 0, y = 0; int x = 0, y = 0;
if( videoOption <= VIDEO_4X ) { if( videoOption <= VIDEO_6X ) {
x = windowPositionX; x = windowPositionX;
y = windowPositionY; y = windowPositionY;
} }