make ESC quit the game instead of toggling out of/into full screen mode (fixes issue 2246),

implement proper window handling (d3d/sw) which i believe fixes a hang that occurs when a game is stopped (plz test this :)) + some minor stuff

git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@5030 8ced0084-cf51-0410-be5f-012b33b47a6e
This commit is contained in:
luisr142004
2010-02-08 09:57:52 +00:00
parent 3915f0fbca
commit 3f90bb215c
6 changed files with 46 additions and 60 deletions

View File

@ -80,11 +80,11 @@ bool Exists(const char *filename)
// Returns true if filename is a directory
bool IsDirectory(const char *filename)
{
struct stat file_info;
struct stat64 file_info;
char *copy = StripTailDirSlashes(__strdup(filename));
int result = stat(copy, &file_info);
int result = stat64(copy, &file_info);
free(copy);
if (result < 0) {

View File

@ -30,7 +30,7 @@ SConfig::SConfig()
{
// Make sure we have log manager
LoadSettings();
//Mkae sure we load settings
//Make sure we load settings
LoadSettingsHLE();
}

View File

@ -148,7 +148,7 @@ CPanel::CPanel(
// Stop
case WM_USER_STOP:
main_frame->DoStop();
return 0;
break;
case WM_USER_CREATE:
// We don't have a local setting for bRenderToMain but we can detect it this way instead
@ -157,7 +157,7 @@ CPanel::CPanel(
main_frame->bRenderToMain = false;
else
main_frame->bRenderToMain = true;
return 0;
break;
case WIIMOTE_DISCONNECT:
if (SConfig::GetInstance().m_LocalCoreStartupParameter.bWii)
@ -183,13 +183,13 @@ CPanel::CPanel(
dlg->Destroy();
}
}
return 0;
}
break;
default:
// By default let wxWidgets do what it normally does with this event
return wxPanel::MSWWindowProc(nMsg, wParam, lParam);
}
// By default let wxWidgets do what it normally does with this event
return wxPanel::MSWWindowProc(nMsg, wParam, lParam);
return 0;
}
#endif
@ -730,13 +730,17 @@ void CFrame::OnGameListCtrl_ItemActivated(wxListEvent& WXUNUSED (event))
void CFrame::OnKeyDown(wxKeyEvent& event)
{
// Toggle fullscreen
if (event.GetKeyCode() == WXK_ESCAPE || (event.GetKeyCode() == WXK_RETURN && event.GetModifiers() == wxMOD_ALT))
if (event.GetKeyCode() == WXK_RETURN && event.GetModifiers() == wxMOD_ALT)
{
DoFullscreen(!IsFullScreen());
// We do that to avoid the event to be double processed (which would cause the window to be stuck in fullscreen)
event.StopPropagation();
}
else if(event.GetKeyCode() == WXK_ESCAPE)
{
main_frame->DoStop();
}
// event.Skip() allows the event to propagate to the gamelist for example
else if (! (Core::GetState() == Core::CORE_RUN && bRenderToMain && event.GetEventObject() == this))
event.Skip();
@ -927,7 +931,10 @@ void CFrame::DoFullscreen(bool bF)
}
#ifdef _WIN32
else // Post the message to the separate rendering window which will then handle it.
{
PostMessage((HWND)Core::GetWindowHandle(), WM_USER, TOGGLE_FULLSCREEN, 0);
BringWindowToTop((HWND)Core::GetWindowHandle());
}
#endif
}