summaryrefslogtreecommitdiff
path: root/Source/Core/DolphinQt/MainWindow.cpp
diff options
context:
space:
mode:
authorAdmiral H. Curtiss <pikachu025@gmail.com>2024-04-09 04:14:39 +0200
committerGitHub <noreply@github.com>2024-04-09 04:14:39 +0200
commit629935ef1164103982f29a129ee6e007eb55e322 (patch)
tree72308538d75942206b415a0b9fc50b4cc7d09533 /Source/Core/DolphinQt/MainWindow.cpp
parentdb0cd82326a13febb1104efbfd9af9ad5ac2c494 (diff)
parenteb92d6f0a8c930692de64bd41c5ddee403771023 (diff)
Merge pull request #12669 from mitaclaw/core-global-system-3
Core::GetState: Avoid Global System Accessor
Diffstat (limited to 'Source/Core/DolphinQt/MainWindow.cpp')
-rw-r--r--Source/Core/DolphinQt/MainWindow.cpp18
1 files changed, 9 insertions, 9 deletions
diff --git a/Source/Core/DolphinQt/MainWindow.cpp b/Source/Core/DolphinQt/MainWindow.cpp
index a7e9d5ce61..aacf4f933b 100644
--- a/Source/Core/DolphinQt/MainWindow.cpp
+++ b/Source/Core/DolphinQt/MainWindow.cpp
@@ -499,7 +499,7 @@ void MainWindow::CreateComponents()
connect(m_breakpoint_widget, &BreakpointWidget::BreakpointsChanged, m_memory_widget,
&MemoryWidget::Update);
connect(m_breakpoint_widget, &BreakpointWidget::ShowCode, [this](u32 address) {
- if (Core::GetState() == Core::State::Paused)
+ if (Core::GetState(Core::System::GetInstance()) == Core::State::Paused)
m_code_widget->SetAddress(address, CodeViewWidget::SetAddressUpdate::WithDetailedUpdate);
});
connect(m_breakpoint_widget, &BreakpointWidget::ShowMemory, m_memory_widget,
@@ -823,7 +823,7 @@ void MainWindow::Play(const std::optional<std::string>& savestate_path)
// Otherwise, play the default game.
// Otherwise, play the last played game, if there is one.
// Otherwise, prompt for a new game.
- if (Core::GetState() == Core::State::Paused)
+ if (Core::GetState(Core::System::GetInstance()) == Core::State::Paused)
{
Core::SetState(Core::State::Running);
}
@@ -858,7 +858,7 @@ void MainWindow::Pause()
void MainWindow::TogglePause()
{
- if (Core::GetState() == Core::State::Paused)
+ if (Core::GetState(Core::System::GetInstance()) == Core::State::Paused)
{
Play();
}
@@ -926,7 +926,7 @@ bool MainWindow::RequestStop()
Common::ScopeGuard confirm_lock([this] { m_stop_confirm_showing = false; });
- const Core::State state = Core::GetState();
+ const Core::State state = Core::GetState(Core::System::GetInstance());
// Only pause the game, if NetPlay is not running
bool pause = !Settings::Instance().GetNetPlayClient();
@@ -983,7 +983,7 @@ bool MainWindow::RequestStop()
// Unpause because gracefully shutting down needs the game to actually request a shutdown.
// TODO: Do not unpause in debug mode to allow debugging until the complete shutdown.
- if (Core::GetState() == Core::State::Paused)
+ if (Core::GetState(Core::System::GetInstance()) == Core::State::Paused)
Core::SetState(Core::State::Running);
// Tell NetPlay about the power event
@@ -1017,7 +1017,7 @@ void MainWindow::Reset()
void MainWindow::FrameAdvance()
{
- Core::DoFrameStep();
+ Core::DoFrameStep(Core::System::GetInstance());
}
void MainWindow::FullScreen()
@@ -1108,7 +1108,7 @@ void MainWindow::StartGame(std::unique_ptr<BootParameters>&& parameters)
}
// If we're running, only start a new game once we've stopped the last.
- if (Core::GetState() != Core::State::Uninitialized)
+ if (Core::GetState(Core::System::GetInstance()) != Core::State::Uninitialized)
{
if (!RequestStop())
return;
@@ -1660,8 +1660,8 @@ void MainWindow::NetPlayQuit()
void MainWindow::UpdateScreenSaverInhibition()
{
- const bool inhibit =
- Config::Get(Config::MAIN_DISABLE_SCREENSAVER) && (Core::GetState() == Core::State::Running);
+ const bool inhibit = Config::Get(Config::MAIN_DISABLE_SCREENSAVER) &&
+ (Core::GetState(Core::System::GetInstance()) == Core::State::Running);
if (inhibit == m_is_screensaver_inhibited)
return;