mirror of
https://github.com/shadps4-emu/shadPS4.git
synced 2026-04-03 03:18:09 -06:00
46 lines
1.2 KiB
C++
46 lines
1.2 KiB
C++
// SPDX-FileCopyrightText: Copyright 2025-2026 shadLauncher4 Project
|
|
// SPDX-License-Identifier: GPL-2.0-or-later
|
|
|
|
#include "emulator_state.h"
|
|
|
|
std::shared_ptr<EmulatorState> EmulatorState::s_instance = nullptr;
|
|
std::mutex EmulatorState::s_mutex;
|
|
|
|
EmulatorState::EmulatorState() {}
|
|
|
|
EmulatorState::~EmulatorState() {}
|
|
|
|
std::shared_ptr<EmulatorState> EmulatorState::GetInstance() {
|
|
std::lock_guard<std::mutex> lock(s_mutex);
|
|
if (!s_instance)
|
|
s_instance = std::make_shared<EmulatorState>();
|
|
return s_instance;
|
|
}
|
|
|
|
void EmulatorState::SetInstance(std::shared_ptr<EmulatorState> instance) {
|
|
std::lock_guard<std::mutex> lock(s_mutex);
|
|
s_instance = instance;
|
|
}
|
|
|
|
bool EmulatorState::IsGameRunning() const {
|
|
return m_running;
|
|
}
|
|
void EmulatorState::SetGameRunning(bool running) {
|
|
m_running = running;
|
|
}
|
|
|
|
bool EmulatorState::IsAutoPatchesLoadEnabled() const {
|
|
return m_load_patches_auto;
|
|
}
|
|
void EmulatorState::SetAutoPatchesLoadEnabled(bool enable) {
|
|
m_load_patches_auto = enable;
|
|
}
|
|
|
|
bool EmulatorState::IsGameSpecifigConfigUsed() const {
|
|
return m_game_specific_config_used;
|
|
}
|
|
|
|
void EmulatorState::SetGameSpecifigConfigUsed(bool used) {
|
|
m_game_specific_config_used = used;
|
|
}
|