Core::SetState: Avoid Global System Accessor

This commit is contained in:
mitaclaw
2024-05-03 20:49:48 -07:00
parent c23562b7b5
commit 0b04975c26
7 changed files with 20 additions and 21 deletions

View File

@ -825,7 +825,7 @@ void MainWindow::Play(const std::optional<std::string>& savestate_path)
// Otherwise, prompt for a new game.
if (Core::GetState(Core::System::GetInstance()) == Core::State::Paused)
{
Core::SetState(Core::State::Running);
Core::SetState(Core::System::GetInstance(), Core::State::Running);
}
else
{
@ -853,7 +853,7 @@ void MainWindow::Play(const std::optional<std::string>& savestate_path)
void MainWindow::Pause()
{
Core::SetState(Core::State::Paused);
Core::SetState(Core::System::GetInstance(), Core::State::Paused);
}
void MainWindow::TogglePause()
@ -932,7 +932,7 @@ bool MainWindow::RequestStop()
bool pause = !Settings::Instance().GetNetPlayClient();
if (pause)
Core::SetState(Core::State::Paused);
Core::SetState(Core::System::GetInstance(), Core::State::Paused);
if (rendered_widget_was_active)
{
@ -962,7 +962,7 @@ bool MainWindow::RequestStop()
m_render_widget->SetWaitingForMessageBox(false);
if (pause)
Core::SetState(state);
Core::SetState(Core::System::GetInstance(), state);
return false;
}
@ -984,7 +984,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::System::GetInstance()) == Core::State::Paused)
Core::SetState(Core::State::Running);
Core::SetState(Core::System::GetInstance(), Core::State::Running);
// Tell NetPlay about the power event
if (NetPlay::IsNetPlayRunning())