diff options
| author | 2019-02-16 17:05:27 +0100 | |
|---|---|---|
| committer | 2019-03-02 17:43:19 +0100 | |
| commit | 71c30a0a896fdf03c0d78f49b76d7cdb49cf544e (patch) | |
| tree | eed24ccb5ca2c73cc22fac036eef3ea281036048 | |
| parent | Merge pull request #2139 from degasus/dma_pusher (diff) | |
| download | yuzu-71c30a0a896fdf03c0d78f49b76d7cdb49cf544e.tar.gz yuzu-71c30a0a896fdf03c0d78f49b76d7cdb49cf544e.tar.xz yuzu-71c30a0a896fdf03c0d78f49b76d7cdb49cf544e.zip | |
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.
| -rw-r--r-- | src/yuzu/main.cpp | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/src/yuzu/main.cpp b/src/yuzu/main.cpp index 1d460c189..5ab7896d4 100644 --- a/src/yuzu/main.cpp +++ b/src/yuzu/main.cpp | |||
| @@ -561,7 +561,10 @@ void GMainWindow::InitializeHotkeys() { | |||
| 561 | Settings::values.use_frame_limit = !Settings::values.use_frame_limit; | 561 | Settings::values.use_frame_limit = !Settings::values.use_frame_limit; |
| 562 | UpdateStatusBar(); | 562 | UpdateStatusBar(); |
| 563 | }); | 563 | }); |
| 564 | constexpr u16 SPEED_LIMIT_STEP = 5; | 564 | // TODO: Remove this comment/static whenever the next major release of |
| 565 | // MSVC occurs and we make it a requirement (see: | ||
| 566 | // https://developercommunity.visualstudio.com/content/problem/93922/constexprs-are-trying-to-be-captured-in-lambda-fun.html) | ||
| 567 | static constexpr u16 SPEED_LIMIT_STEP = 5; | ||
| 565 | connect(hotkey_registry.GetHotkey("Main Window", "Increase Speed Limit", this), | 568 | connect(hotkey_registry.GetHotkey("Main Window", "Increase Speed Limit", this), |
| 566 | &QShortcut::activated, this, [&] { | 569 | &QShortcut::activated, this, [&] { |
| 567 | if (Settings::values.frame_limit < 9999 - SPEED_LIMIT_STEP) { | 570 | if (Settings::values.frame_limit < 9999 - SPEED_LIMIT_STEP) { |