mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-07-21 05:09:34 -06:00
Config: Port emulation speed setting to new config system.
This commit is contained in:
@ -459,26 +459,26 @@ void HotkeyScheduler::Run()
|
||||
Core::SetIsThrottlerTempDisabled(IsHotkey(HK_TOGGLE_THROTTLE, true));
|
||||
|
||||
auto ShowEmulationSpeed = []() {
|
||||
const float emulation_speed = Config::Get(Config::MAIN_EMULATION_SPEED);
|
||||
OSD::AddMessage(
|
||||
SConfig::GetInstance().m_EmulationSpeed <= 0 ?
|
||||
emulation_speed <= 0 ?
|
||||
"Speed Limit: Unlimited" :
|
||||
StringFromFormat("Speed Limit: %li%%",
|
||||
std::lround(SConfig::GetInstance().m_EmulationSpeed * 100.f)));
|
||||
StringFromFormat("Speed Limit: %li%%", std::lround(emulation_speed * 100.f)));
|
||||
};
|
||||
|
||||
if (IsHotkey(HK_DECREASE_EMULATION_SPEED))
|
||||
{
|
||||
auto speed = SConfig::GetInstance().m_EmulationSpeed - 0.1;
|
||||
auto speed = Config::Get(Config::MAIN_EMULATION_SPEED) - 0.1;
|
||||
speed = (speed <= 0 || (speed >= 0.95 && speed <= 1.05)) ? 1.0 : speed;
|
||||
SConfig::GetInstance().m_EmulationSpeed = speed;
|
||||
Config::SetCurrent(Config::MAIN_EMULATION_SPEED, speed);
|
||||
ShowEmulationSpeed();
|
||||
}
|
||||
|
||||
if (IsHotkey(HK_INCREASE_EMULATION_SPEED))
|
||||
{
|
||||
auto speed = SConfig::GetInstance().m_EmulationSpeed + 0.1;
|
||||
auto speed = Config::Get(Config::MAIN_EMULATION_SPEED) + 0.1;
|
||||
speed = (speed >= 0.95 && speed <= 1.05) ? 1.0 : speed;
|
||||
SConfig::GetInstance().m_EmulationSpeed = speed;
|
||||
Config::SetCurrent(Config::MAIN_EMULATION_SPEED, speed);
|
||||
ShowEmulationSpeed();
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user