mirror of
https://github.com/yuzu-mirror/yuzu.git
synced 2024-11-03 10:49:59 +00:00
citra_qt/main: make SPEED_LIMIT_STEP static constexpr
MSVC does not seem to like using constexpr values in a lambda that were declared outside of it. Previously on MSVC build the hotkeys to inc-/decrease the speed limit were not working correctly because in the lambda the SPEED_LIMIT_STEP had garbage values. After googling around a bit I found: https://github.com/codeplaysoftware/computecpp-sdk/issues/95 which seems to be a similar issue. Trying the suggested fix to make the variable static constexpr also fixes the bug here.
This commit is contained in:
parent
90c780e6f3
commit
71c30a0a89
1 changed files with 4 additions and 1 deletions
|
@ -561,7 +561,10 @@ void GMainWindow::InitializeHotkeys() {
|
|||
Settings::values.use_frame_limit = !Settings::values.use_frame_limit;
|
||||
UpdateStatusBar();
|
||||
});
|
||||
constexpr u16 SPEED_LIMIT_STEP = 5;
|
||||
// TODO: Remove this comment/static whenever the next major release of
|
||||
// MSVC occurs and we make it a requirement (see:
|
||||
// https://developercommunity.visualstudio.com/content/problem/93922/constexprs-are-trying-to-be-captured-in-lambda-fun.html)
|
||||
static constexpr u16 SPEED_LIMIT_STEP = 5;
|
||||
connect(hotkey_registry.GetHotkey("Main Window", "Increase Speed Limit", this),
|
||||
&QShortcut::activated, this, [&] {
|
||||
if (Settings::values.frame_limit < 9999 - SPEED_LIMIT_STEP) {
|
||||
|
|
Loading…
Reference in a new issue