diff options
Diffstat (limited to '')
| -rw-r--r-- | src/citra_qt/bootmanager.cpp | 10 |
1 files changed, 4 insertions, 6 deletions
diff --git a/src/citra_qt/bootmanager.cpp b/src/citra_qt/bootmanager.cpp index 30554890f..7107bfc60 100644 --- a/src/citra_qt/bootmanager.cpp +++ b/src/citra_qt/bootmanager.cpp | |||
| @@ -17,6 +17,7 @@ | |||
| 17 | #include "core/settings.h" | 17 | #include "core/settings.h" |
| 18 | #include "input_common/keyboard.h" | 18 | #include "input_common/keyboard.h" |
| 19 | #include "input_common/main.h" | 19 | #include "input_common/main.h" |
| 20 | #include "input_common/motion_emu.h" | ||
| 20 | #include "network/network.h" | 21 | #include "network/network.h" |
| 21 | 22 | ||
| 22 | EmuThread::EmuThread(GRenderWindow* render_window) | 23 | EmuThread::EmuThread(GRenderWindow* render_window) |
| @@ -201,7 +202,6 @@ qreal GRenderWindow::windowPixelRatio() { | |||
| 201 | } | 202 | } |
| 202 | 203 | ||
| 203 | void GRenderWindow::closeEvent(QCloseEvent* event) { | 204 | void GRenderWindow::closeEvent(QCloseEvent* event) { |
| 204 | motion_emu = nullptr; | ||
| 205 | emit Closed(); | 205 | emit Closed(); |
| 206 | QWidget::closeEvent(event); | 206 | QWidget::closeEvent(event); |
| 207 | } | 207 | } |
| @@ -221,7 +221,7 @@ void GRenderWindow::mousePressEvent(QMouseEvent* event) { | |||
| 221 | this->TouchPressed(static_cast<unsigned>(pos.x() * pixelRatio), | 221 | this->TouchPressed(static_cast<unsigned>(pos.x() * pixelRatio), |
| 222 | static_cast<unsigned>(pos.y() * pixelRatio)); | 222 | static_cast<unsigned>(pos.y() * pixelRatio)); |
| 223 | } else if (event->button() == Qt::RightButton) { | 223 | } else if (event->button() == Qt::RightButton) { |
| 224 | motion_emu->BeginTilt(pos.x(), pos.y()); | 224 | InputCommon::GetMotionEmu()->BeginTilt(pos.x(), pos.y()); |
| 225 | } | 225 | } |
| 226 | } | 226 | } |
| 227 | 227 | ||
| @@ -230,14 +230,14 @@ void GRenderWindow::mouseMoveEvent(QMouseEvent* event) { | |||
| 230 | qreal pixelRatio = windowPixelRatio(); | 230 | qreal pixelRatio = windowPixelRatio(); |
| 231 | this->TouchMoved(std::max(static_cast<unsigned>(pos.x() * pixelRatio), 0u), | 231 | this->TouchMoved(std::max(static_cast<unsigned>(pos.x() * pixelRatio), 0u), |
| 232 | std::max(static_cast<unsigned>(pos.y() * pixelRatio), 0u)); | 232 | std::max(static_cast<unsigned>(pos.y() * pixelRatio), 0u)); |
| 233 | motion_emu->Tilt(pos.x(), pos.y()); | 233 | InputCommon::GetMotionEmu()->Tilt(pos.x(), pos.y()); |
| 234 | } | 234 | } |
| 235 | 235 | ||
| 236 | void GRenderWindow::mouseReleaseEvent(QMouseEvent* event) { | 236 | void GRenderWindow::mouseReleaseEvent(QMouseEvent* event) { |
| 237 | if (event->button() == Qt::LeftButton) | 237 | if (event->button() == Qt::LeftButton) |
| 238 | this->TouchReleased(); | 238 | this->TouchReleased(); |
| 239 | else if (event->button() == Qt::RightButton) | 239 | else if (event->button() == Qt::RightButton) |
| 240 | motion_emu->EndTilt(); | 240 | InputCommon::GetMotionEmu()->EndTilt(); |
| 241 | } | 241 | } |
| 242 | 242 | ||
| 243 | void GRenderWindow::focusOutEvent(QFocusEvent* event) { | 243 | void GRenderWindow::focusOutEvent(QFocusEvent* event) { |
| @@ -290,13 +290,11 @@ void GRenderWindow::OnMinimalClientAreaChangeRequest( | |||
| 290 | } | 290 | } |
| 291 | 291 | ||
| 292 | void GRenderWindow::OnEmulationStarting(EmuThread* emu_thread) { | 292 | void GRenderWindow::OnEmulationStarting(EmuThread* emu_thread) { |
| 293 | motion_emu = std::make_unique<Motion::MotionEmu>(*this); | ||
| 294 | this->emu_thread = emu_thread; | 293 | this->emu_thread = emu_thread; |
| 295 | child->DisablePainting(); | 294 | child->DisablePainting(); |
| 296 | } | 295 | } |
| 297 | 296 | ||
| 298 | void GRenderWindow::OnEmulationStopping() { | 297 | void GRenderWindow::OnEmulationStopping() { |
| 299 | motion_emu = nullptr; | ||
| 300 | emu_thread = nullptr; | 298 | emu_thread = nullptr; |
| 301 | child->EnablePainting(); | 299 | child->EnablePainting(); |
| 302 | } | 300 | } |