Skip to content

Commit

Permalink
Use latest resolution value for resolution hotkey OSD
Browse files Browse the repository at this point in the history
Because CPU thread config changed callbacks are no longer instant,
g_Config.iEFBScale doesn't yet contain the new value when the hotkey OSD
code tries to read it.

Should fix https://bugs.dolphin-emu.org/issues/13343.
  • Loading branch information
JosJuice committed Aug 27, 2023
1 parent 7ac0db7 commit 58f2472
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions Source/Core/DolphinQt/HotkeyScheduler.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -359,8 +359,8 @@ void HotkeyScheduler::Run()

// Graphics
const auto efb_scale = Config::Get(Config::GFX_EFB_SCALE);
auto ShowEFBScale = []() {
switch (Config::Get(Config::GFX_EFB_SCALE))
const auto ShowEFBScale = [](int new_efb_scale) {
switch (new_efb_scale)
{
case EFB_SCALE_AUTO_INTEGRAL:
OSD::AddMessage("Internal Resolution: Auto (integral)");
Expand All @@ -369,22 +369,22 @@ void HotkeyScheduler::Run()
OSD::AddMessage("Internal Resolution: Native");
break;
default:
OSD::AddMessage(fmt::format("Internal Resolution: {}x", g_Config.iEFBScale));
OSD::AddMessage(fmt::format("Internal Resolution: {}x", new_efb_scale));
break;
}
};

if (IsHotkey(HK_INCREASE_IR))
{
Config::SetCurrent(Config::GFX_EFB_SCALE, efb_scale + 1);
ShowEFBScale();
ShowEFBScale(efb_scale + 1);
}
if (IsHotkey(HK_DECREASE_IR))
{
if (efb_scale > EFB_SCALE_AUTO_INTEGRAL)
{
Config::SetCurrent(Config::GFX_EFB_SCALE, efb_scale - 1);
ShowEFBScale();
ShowEFBScale(efb_scale - 1);
}
}

Expand Down

0 comments on commit 58f2472

Please sign in to comment.