[Project64] Add OnEndEmulation to handle ID_FILE_ENDEMULATION

This commit is contained in:
zilmar 2016-09-17 16:33:05 +10:00
parent eb0335bc1e
commit b8bd3b1556
2 changed files with 24 additions and 20 deletions

View File

@ -166,12 +166,7 @@ void CMainMenu::OnOpenRom(HWND hWnd)
}
}
bool CMainMenu::ProcessMessage(HWND hWnd, DWORD /*FromAccelerator*/, DWORD MenuID)
{
switch (MenuID)
{
case ID_FILE_OPEN_ROM: OnOpenRom(hWnd); break;
case ID_FILE_ROM_INFO:
void CMainMenu::OnRomInfo(HWND hWnd)
{
if (g_Rom)
{
@ -179,7 +174,24 @@ bool CMainMenu::ProcessMessage(HWND hWnd, DWORD /*FromAccelerator*/, DWORD MenuI
Info.DisplayInformation(hWnd);
}
}
break;
void CMainMenu::OnEndEmulation(void)
{
CGuard Guard(m_CS);
WriteTrace(TraceUserInterface, TraceDebug, "ID_FILE_ENDEMULATION");
if (g_BaseSystem)
{
g_BaseSystem->CloseCpu();
}
m_Gui->SaveWindowLoc();
}
bool CMainMenu::ProcessMessage(HWND hWnd, DWORD /*FromAccelerator*/, DWORD MenuID)
{
switch (MenuID)
{
case ID_FILE_OPEN_ROM: OnOpenRom(hWnd); break;
case ID_FILE_ROM_INFO: OnRomInfo(hWnd); break;
case ID_FILE_STARTEMULATION:
m_Gui->SaveWindowLoc();
//Now we have created again, we can start up emulation
@ -192,17 +204,7 @@ bool CMainMenu::ProcessMessage(HWND hWnd, DWORD /*FromAccelerator*/, DWORD MenuI
g_Notify->BreakPoint(__FILE__, __LINE__);
}
break;
case ID_FILE_ENDEMULATION:
{
CGuard Guard(m_CS);
WriteTrace(TraceUserInterface, TraceDebug, "ID_FILE_ENDEMULATION");
if (g_BaseSystem)
{
g_BaseSystem->CloseCpu();
}
m_Gui->SaveWindowLoc();
}
break;
case ID_FILE_ENDEMULATION: OnEndEmulation(); break;
case ID_FILE_ROMDIRECTORY:
WriteTrace(TraceUserInterface, TraceDebug, "ID_FILE_ROMDIRECTORY 1");
m_Gui->SelectRomDir();

View File

@ -74,6 +74,8 @@ private:
CMainMenu& operator=(const CMainMenu&); // Disable assignment
void OnOpenRom(HWND hWnd);
void OnRomInfo(HWND hWnd);
void OnEndEmulation(void);
void FillOutMenu(HMENU hMenu);
std::wstring GetSaveSlotString(int Slot);
stdstr GetFileLastMod(const CPath & FileName);