Skip to content

Commit

Permalink
Better way of updating menus on UMD switching calls
Browse files Browse the repository at this point in the history
  • Loading branch information
hrydgard committed Jan 29, 2017
1 parent d344f30 commit 03b607f
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 13 deletions.
16 changes: 4 additions & 12 deletions Core/HLE/sceUmd.cpp
Expand Up @@ -23,6 +23,7 @@
#include "Core/Loaders.h"
#include "Core/MemMap.h"
#include "Core/System.h"
#include "Core/Host.h"
#include "Core/CoreTiming.h"
#include "Core/Reporting.h"
#include "Core/MIPS/MIPS.h"
Expand All @@ -38,9 +39,6 @@
#include "Core/FileSystems/MetaFileSystem.h"
#include "Core/FileSystems/ISOFileSystem.h"
#include "Core/FileSystems/VirtualDiscFileSystem.h"
#ifdef USING_WIN_UI
#include "Windows/MainWindowMenu.h"
#endif

const u64 MICRO_DELAY_ACTIVATE = 4000;

Expand Down Expand Up @@ -102,10 +100,8 @@ void __UmdDoState(PointerWrap &p)

if (s > 1) {
p.Do(UMDReplacePermit);
#ifdef USING_WIN_UI
if (UMDReplacePermit)
MainWindowMenu:MainWindow::_ChangeMenu();
#endif
host->UpdateUI();
}
if (s > 2) {
p.Do(umdInsertChangeEvent);
Expand Down Expand Up @@ -539,19 +535,15 @@ static u32 sceUmdReplaceProhibit()
{
UMDReplacePermit = false;
DEBUG_LOG(SCEIO,"sceUmdReplaceProhibit()");
#ifdef USING_WIN_UI
MainWindowMenu:MainWindow::_ChangeMenu();
#endif
host->UpdateUI();
return 0;
}

static u32 sceUmdReplacePermit()
{
UMDReplacePermit = true;
DEBUG_LOG(SCEIO,"sceUmdReplacePermit()");
#ifdef USING_WIN_UI
MainWindowMenu:MainWindow::_ChangeMenu();
#endif
host->UpdateUI();
return 0;
}

Expand Down
1 change: 1 addition & 0 deletions Windows/MainWindow.cpp
Expand Up @@ -858,6 +858,7 @@ namespace MainWindow
break;

case WM_USER_UPDATE_UI:
// This also calls ChangeMenu
TranslateMenus(hwndMain, menu);
break;

Expand Down
2 changes: 1 addition & 1 deletion Windows/MainWindowMenu.cpp
Expand Up @@ -1259,7 +1259,7 @@ namespace MainWindow {
return FALSE;
}

void _ChangeMenu() {
void ChangeMenu() {
SetIngameMenuItemStates(GetMenu(GetHWND()), UISTATE_INGAME);
}
}

0 comments on commit 03b607f

Please sign in to comment.