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.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();
}

View File

@ -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;

View File

@ -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)

View File

@ -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()

View File

@ -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 );

View File

@ -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;
}