diff options
| author | 2019-04-01 14:36:24 -0400 | |
|---|---|---|
| committer | 2019-04-01 14:36:24 -0400 | |
| commit | e0eee250bb4d70f4fc4973f08649636faf9808cf (patch) | |
| tree | eaf2aabd5471c13fe89ac5f7da247b3bf1248e83 /src/core/frontend/emu_window.cpp | |
| parent | Merge pull request #2304 from lioncash/memsize (diff) | |
| parent | general: Use deducation guides for std::lock_guard and std::unique_lock (diff) | |
| download | yuzu-e0eee250bb4d70f4fc4973f08649636faf9808cf.tar.gz yuzu-e0eee250bb4d70f4fc4973f08649636faf9808cf.tar.xz yuzu-e0eee250bb4d70f4fc4973f08649636faf9808cf.zip | |
Merge pull request #2312 from lioncash/locks
general: Use deducation guides for std::lock_guard and std::unique_lock
Diffstat (limited to 'src/core/frontend/emu_window.cpp')
| -rw-r--r-- | src/core/frontend/emu_window.cpp | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/core/frontend/emu_window.cpp b/src/core/frontend/emu_window.cpp index e29afd630..1320bbe77 100644 --- a/src/core/frontend/emu_window.cpp +++ b/src/core/frontend/emu_window.cpp | |||
| @@ -30,7 +30,7 @@ private: | |||
| 30 | explicit Device(std::weak_ptr<TouchState>&& touch_state) : touch_state(touch_state) {} | 30 | explicit Device(std::weak_ptr<TouchState>&& touch_state) : touch_state(touch_state) {} |
| 31 | std::tuple<float, float, bool> GetStatus() const override { | 31 | std::tuple<float, float, bool> GetStatus() const override { |
| 32 | if (auto state = touch_state.lock()) { | 32 | if (auto state = touch_state.lock()) { |
| 33 | std::lock_guard<std::mutex> guard(state->mutex); | 33 | std::lock_guard guard{state->mutex}; |
| 34 | return std::make_tuple(state->touch_x, state->touch_y, state->touch_pressed); | 34 | return std::make_tuple(state->touch_x, state->touch_y, state->touch_pressed); |
| 35 | } | 35 | } |
| 36 | return std::make_tuple(0.0f, 0.0f, false); | 36 | return std::make_tuple(0.0f, 0.0f, false); |
| @@ -81,7 +81,7 @@ void EmuWindow::TouchPressed(unsigned framebuffer_x, unsigned framebuffer_y) { | |||
| 81 | if (!IsWithinTouchscreen(framebuffer_layout, framebuffer_x, framebuffer_y)) | 81 | if (!IsWithinTouchscreen(framebuffer_layout, framebuffer_x, framebuffer_y)) |
| 82 | return; | 82 | return; |
| 83 | 83 | ||
| 84 | std::lock_guard<std::mutex> guard(touch_state->mutex); | 84 | std::lock_guard guard{touch_state->mutex}; |
| 85 | touch_state->touch_x = static_cast<float>(framebuffer_x - framebuffer_layout.screen.left) / | 85 | touch_state->touch_x = static_cast<float>(framebuffer_x - framebuffer_layout.screen.left) / |
| 86 | (framebuffer_layout.screen.right - framebuffer_layout.screen.left); | 86 | (framebuffer_layout.screen.right - framebuffer_layout.screen.left); |
| 87 | touch_state->touch_y = static_cast<float>(framebuffer_y - framebuffer_layout.screen.top) / | 87 | touch_state->touch_y = static_cast<float>(framebuffer_y - framebuffer_layout.screen.top) / |
| @@ -91,7 +91,7 @@ void EmuWindow::TouchPressed(unsigned framebuffer_x, unsigned framebuffer_y) { | |||
| 91 | } | 91 | } |
| 92 | 92 | ||
| 93 | void EmuWindow::TouchReleased() { | 93 | void EmuWindow::TouchReleased() { |
| 94 | std::lock_guard<std::mutex> guard(touch_state->mutex); | 94 | std::lock_guard guard{touch_state->mutex}; |
| 95 | touch_state->touch_pressed = false; | 95 | touch_state->touch_pressed = false; |
| 96 | touch_state->touch_x = 0; | 96 | touch_state->touch_x = 0; |
| 97 | touch_state->touch_y = 0; | 97 | touch_state->touch_y = 0; |