summaryrefslogtreecommitdiff
path: root/src/citra_qt
diff options
context:
space:
mode:
Diffstat (limited to 'src/citra_qt')
-rw-r--r--src/citra_qt/bootmanager.cpp10
-rw-r--r--src/citra_qt/bootmanager.h4
-rw-r--r--src/citra_qt/configuration/config.cpp6
3 files changed, 10 insertions, 10 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
22EmuThread::EmuThread(GRenderWindow* render_window) 23EmuThread::EmuThread(GRenderWindow* render_window)
@@ -201,7 +202,6 @@ qreal GRenderWindow::windowPixelRatio() {
201} 202}
202 203
203void GRenderWindow::closeEvent(QCloseEvent* event) { 204void 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
236void GRenderWindow::mouseReleaseEvent(QMouseEvent* event) { 236void 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
243void GRenderWindow::focusOutEvent(QFocusEvent* event) { 243void GRenderWindow::focusOutEvent(QFocusEvent* event) {
@@ -290,13 +290,11 @@ void GRenderWindow::OnMinimalClientAreaChangeRequest(
290} 290}
291 291
292void GRenderWindow::OnEmulationStarting(EmuThread* emu_thread) { 292void 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
298void GRenderWindow::OnEmulationStopping() { 297void GRenderWindow::OnEmulationStopping() {
299 motion_emu = nullptr;
300 emu_thread = nullptr; 298 emu_thread = nullptr;
301 child->EnablePainting(); 299 child->EnablePainting();
302} 300}
diff --git a/src/citra_qt/bootmanager.h b/src/citra_qt/bootmanager.h
index 4b3a3b3cc..6974edcbb 100644
--- a/src/citra_qt/bootmanager.h
+++ b/src/citra_qt/bootmanager.h
@@ -12,7 +12,6 @@
12#include "common/thread.h" 12#include "common/thread.h"
13#include "core/core.h" 13#include "core/core.h"
14#include "core/frontend/emu_window.h" 14#include "core/frontend/emu_window.h"
15#include "core/frontend/motion_emu.h"
16 15
17class QKeyEvent; 16class QKeyEvent;
18class QScreen; 17class QScreen;
@@ -158,9 +157,6 @@ private:
158 157
159 EmuThread* emu_thread; 158 EmuThread* emu_thread;
160 159
161 /// Motion sensors emulation
162 std::unique_ptr<Motion::MotionEmu> motion_emu;
163
164protected: 160protected:
165 void showEvent(QShowEvent* event) override; 161 void showEvent(QShowEvent* event) override;
166}; 162};
diff --git a/src/citra_qt/configuration/config.cpp b/src/citra_qt/configuration/config.cpp
index 75abb4ce6..6e42db007 100644
--- a/src/citra_qt/configuration/config.cpp
+++ b/src/citra_qt/configuration/config.cpp
@@ -57,6 +57,11 @@ void Config::ReadValues() {
57 Settings::values.analogs[i] = default_param; 57 Settings::values.analogs[i] = default_param;
58 } 58 }
59 59
60 Settings::values.motion_device =
61 qt_config->value("motion_device", "engine:motion_emu,update_period:100,sensitivity:0.01")
62 .toString()
63 .toStdString();
64
60 qt_config->endGroup(); 65 qt_config->endGroup();
61 66
62 qt_config->beginGroup("Core"); 67 qt_config->beginGroup("Core");
@@ -203,6 +208,7 @@ void Config::SaveValues() {
203 qt_config->setValue(QString::fromStdString(Settings::NativeAnalog::mapping[i]), 208 qt_config->setValue(QString::fromStdString(Settings::NativeAnalog::mapping[i]),
204 QString::fromStdString(Settings::values.analogs[i])); 209 QString::fromStdString(Settings::values.analogs[i]));
205 } 210 }
211 qt_config->setValue("motion_device", QString::fromStdString(Settings::values.motion_device));
206 qt_config->endGroup(); 212 qt_config->endGroup();
207 213
208 qt_config->beginGroup("Core"); 214 qt_config->beginGroup("Core");