summaryrefslogtreecommitdiff
path: root/src/core/frontend/emu_window.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/core/frontend/emu_window.cpp')
-rw-r--r--src/core/frontend/emu_window.cpp14
1 files changed, 7 insertions, 7 deletions
diff --git a/src/core/frontend/emu_window.cpp b/src/core/frontend/emu_window.cpp
index 474de9206..f2f719cb9 100644
--- a/src/core/frontend/emu_window.cpp
+++ b/src/core/frontend/emu_window.cpp
@@ -60,13 +60,13 @@ EmuWindow::~EmuWindow() {
60 * @param framebuffer_y Framebuffer y-coordinate to check 60 * @param framebuffer_y Framebuffer y-coordinate to check
61 * @return True if the coordinates are within the touchpad, otherwise false 61 * @return True if the coordinates are within the touchpad, otherwise false
62 */ 62 */
63static bool IsWithinTouchscreen(const Layout::FramebufferLayout& layout, unsigned framebuffer_x, 63static bool IsWithinTouchscreen(const Layout::FramebufferLayout& layout, u32 framebuffer_x,
64 unsigned framebuffer_y) { 64 u32 framebuffer_y) {
65 return (framebuffer_y >= layout.screen.top && framebuffer_y < layout.screen.bottom && 65 return (framebuffer_y >= layout.screen.top && framebuffer_y < layout.screen.bottom &&
66 framebuffer_x >= layout.screen.left && framebuffer_x < layout.screen.right); 66 framebuffer_x >= layout.screen.left && framebuffer_x < layout.screen.right);
67} 67}
68 68
69std::tuple<unsigned, unsigned> EmuWindow::ClipToTouchScreen(unsigned new_x, unsigned new_y) const { 69std::tuple<u32, u32> EmuWindow::ClipToTouchScreen(u32 new_x, u32 new_y) const {
70 new_x = std::max(new_x, framebuffer_layout.screen.left); 70 new_x = std::max(new_x, framebuffer_layout.screen.left);
71 new_x = std::min(new_x, framebuffer_layout.screen.right - 1); 71 new_x = std::min(new_x, framebuffer_layout.screen.right - 1);
72 72
@@ -76,7 +76,7 @@ std::tuple<unsigned, unsigned> EmuWindow::ClipToTouchScreen(unsigned new_x, unsi
76 return std::make_tuple(new_x, new_y); 76 return std::make_tuple(new_x, new_y);
77} 77}
78 78
79void EmuWindow::TouchPressed(unsigned framebuffer_x, unsigned framebuffer_y, std::size_t id) { 79void EmuWindow::TouchPressed(u32 framebuffer_x, u32 framebuffer_y, size_t id) {
80 if (!IsWithinTouchscreen(framebuffer_layout, framebuffer_x, framebuffer_y)) { 80 if (!IsWithinTouchscreen(framebuffer_layout, framebuffer_x, framebuffer_y)) {
81 return; 81 return;
82 } 82 }
@@ -95,7 +95,7 @@ void EmuWindow::TouchPressed(unsigned framebuffer_x, unsigned framebuffer_y, std
95 touch_state->status[id] = std::make_tuple(x, y, true); 95 touch_state->status[id] = std::make_tuple(x, y, true);
96} 96}
97 97
98void EmuWindow::TouchReleased(std::size_t id) { 98void EmuWindow::TouchReleased(size_t id) {
99 if (id >= touch_state->status.size()) { 99 if (id >= touch_state->status.size()) {
100 return; 100 return;
101 } 101 }
@@ -103,7 +103,7 @@ void EmuWindow::TouchReleased(std::size_t id) {
103 touch_state->status[id] = std::make_tuple(0.0f, 0.0f, false); 103 touch_state->status[id] = std::make_tuple(0.0f, 0.0f, false);
104} 104}
105 105
106void EmuWindow::TouchMoved(unsigned framebuffer_x, unsigned framebuffer_y, std::size_t id) { 106void EmuWindow::TouchMoved(u32 framebuffer_x, u32 framebuffer_y, size_t id) {
107 if (id >= touch_state->status.size()) { 107 if (id >= touch_state->status.size()) {
108 return; 108 return;
109 } 109 }
@@ -116,7 +116,7 @@ void EmuWindow::TouchMoved(unsigned framebuffer_x, unsigned framebuffer_y, std::
116 TouchPressed(framebuffer_x, framebuffer_y, id); 116 TouchPressed(framebuffer_x, framebuffer_y, id);
117} 117}
118 118
119void EmuWindow::UpdateCurrentFramebufferLayout(unsigned width, unsigned height) { 119void EmuWindow::UpdateCurrentFramebufferLayout(u32 width, u32 height) {
120 NotifyFramebufferLayoutChanged(Layout::DefaultFrameLayout(width, height)); 120 NotifyFramebufferLayoutChanged(Layout::DefaultFrameLayout(width, height));
121} 121}
122 122