summaryrefslogtreecommitdiffstats
path: root/src/core/frontend/emu_window.cpp
diff options
context:
space:
mode:
authorbunnei <bunneidev@gmail.com>2019-04-01 20:36:24 +0200
committerGitHub <noreply@github.com>2019-04-01 20:36:24 +0200
commite0eee250bb4d70f4fc4973f08649636faf9808cf (patch)
treeeaf2aabd5471c13fe89ac5f7da247b3bf1248e83 /src/core/frontend/emu_window.cpp
parentMerge pull request #2304 from lioncash/memsize (diff)
parentgeneral: Use deducation guides for std::lock_guard and std::unique_lock (diff)
downloadyuzu-e0eee250bb4d70f4fc4973f08649636faf9808cf.tar
yuzu-e0eee250bb4d70f4fc4973f08649636faf9808cf.tar.gz
yuzu-e0eee250bb4d70f4fc4973f08649636faf9808cf.tar.bz2
yuzu-e0eee250bb4d70f4fc4973f08649636faf9808cf.tar.lz
yuzu-e0eee250bb4d70f4fc4973f08649636faf9808cf.tar.xz
yuzu-e0eee250bb4d70f4fc4973f08649636faf9808cf.tar.zst
yuzu-e0eee250bb4d70f4fc4973f08649636faf9808cf.zip
Diffstat (limited to 'src/core/frontend/emu_window.cpp')
-rw-r--r--src/core/frontend/emu_window.cpp6
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:
explicit Device(std::weak_ptr<TouchState>&& touch_state) : touch_state(touch_state) {}
std::tuple<float, float, bool> GetStatus() const override {
if (auto state = touch_state.lock()) {
- std::lock_guard<std::mutex> guard(state->mutex);
+ std::lock_guard guard{state->mutex};
return std::make_tuple(state->touch_x, state->touch_y, state->touch_pressed);
}
return std::make_tuple(0.0f, 0.0f, false);
@@ -81,7 +81,7 @@ void EmuWindow::TouchPressed(unsigned framebuffer_x, unsigned framebuffer_y) {
if (!IsWithinTouchscreen(framebuffer_layout, framebuffer_x, framebuffer_y))
return;
- std::lock_guard<std::mutex> guard(touch_state->mutex);
+ std::lock_guard guard{touch_state->mutex};
touch_state->touch_x = static_cast<float>(framebuffer_x - framebuffer_layout.screen.left) /
(framebuffer_layout.screen.right - framebuffer_layout.screen.left);
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) {
}
void EmuWindow::TouchReleased() {
- std::lock_guard<std::mutex> guard(touch_state->mutex);
+ std::lock_guard guard{touch_state->mutex};
touch_state->touch_pressed = false;
touch_state->touch_x = 0;
touch_state->touch_y = 0;