mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-07-24 06:39:46 -06:00
State: Avoid Global System Accessor
This commit is contained in:
@ -7,6 +7,7 @@
|
||||
#include "Core/Config/MainSettings.h"
|
||||
#include "Core/Core.h"
|
||||
#include "Core/State.h"
|
||||
#include "Core/System.h"
|
||||
#include "VideoCommon/Present.h"
|
||||
#include "VideoCommon/RenderBase.h"
|
||||
|
||||
@ -54,27 +55,27 @@
|
||||
|
||||
- (void)loadLastSaved
|
||||
{
|
||||
State::LoadLastSaved();
|
||||
State::LoadLastSaved(Core::System::GetInstance());
|
||||
}
|
||||
|
||||
- (void)undoLoadState
|
||||
{
|
||||
State::UndoLoadState();
|
||||
State::UndoLoadState(Core::System::GetInstance());
|
||||
}
|
||||
|
||||
- (void)undoSaveState
|
||||
{
|
||||
State::UndoSaveState();
|
||||
State::UndoSaveState(Core::System::GetInstance());
|
||||
}
|
||||
|
||||
- (void)loadState:(id)sender
|
||||
{
|
||||
State::Load([sender tag]);
|
||||
State::Load(Core::System::GetInstance(), [sender tag]);
|
||||
}
|
||||
|
||||
- (void)saveState:(id)sender
|
||||
{
|
||||
State::Save([sender tag]);
|
||||
State::Save(Core::System::GetInstance(), [sender tag]);
|
||||
}
|
||||
@end
|
||||
|
||||
|
@ -15,6 +15,7 @@ static constexpr auto X_None = None;
|
||||
#include "Core/Config/MainSettings.h"
|
||||
#include "Core/Core.h"
|
||||
#include "Core/State.h"
|
||||
#include "Core/System.h"
|
||||
|
||||
#include <climits>
|
||||
#include <cstdio>
|
||||
@ -224,20 +225,20 @@ void PlatformX11::ProcessEvents()
|
||||
{
|
||||
int slot_number = key - XK_F1 + 1;
|
||||
if (event.xkey.state & ShiftMask)
|
||||
State::Save(slot_number);
|
||||
State::Save(Core::System::GetInstance(), slot_number);
|
||||
else
|
||||
State::Load(slot_number);
|
||||
State::Load(Core::System::GetInstance(), slot_number);
|
||||
}
|
||||
else if (key == XK_F9)
|
||||
Core::SaveScreenShot();
|
||||
else if (key == XK_F11)
|
||||
State::LoadLastSaved();
|
||||
State::LoadLastSaved(Core::System::GetInstance());
|
||||
else if (key == XK_F12)
|
||||
{
|
||||
if (event.xkey.state & ShiftMask)
|
||||
State::UndoLoadState();
|
||||
State::UndoLoadState(Core::System::GetInstance());
|
||||
else
|
||||
State::UndoSaveState();
|
||||
State::UndoSaveState(Core::System::GetInstance());
|
||||
}
|
||||
break;
|
||||
case FocusIn:
|
||||
|
Reference in New Issue
Block a user