State: Avoid Global System Accessor

This commit is contained in:
mitaclaw
2024-03-01 10:41:48 -08:00
parent 5a81916ee9
commit 0d4cb5ddc7
10 changed files with 81 additions and 75 deletions

View File

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

View File

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