summaryrefslogtreecommitdiffstats
path: root/src/citra/emu_window/emu_window_sdl2.cpp
diff options
context:
space:
mode:
authorwwylele <wwylele@gmail.com>2017-08-06 23:04:06 +0200
committerwwylele <wwylele@gmail.com>2017-08-11 10:05:08 +0200
commit188194908c2785bd1e03485941b9148777cdddd7 (patch)
treeab6cd04195f5e18bd1e7dd21a7c2896066827a6f /src/citra/emu_window/emu_window_sdl2.cpp
parentHID: use MotionDevice for Accelerometer and Gyroscope (diff)
downloadyuzu-188194908c2785bd1e03485941b9148777cdddd7.tar
yuzu-188194908c2785bd1e03485941b9148777cdddd7.tar.gz
yuzu-188194908c2785bd1e03485941b9148777cdddd7.tar.bz2
yuzu-188194908c2785bd1e03485941b9148777cdddd7.tar.lz
yuzu-188194908c2785bd1e03485941b9148777cdddd7.tar.xz
yuzu-188194908c2785bd1e03485941b9148777cdddd7.tar.zst
yuzu-188194908c2785bd1e03485941b9148777cdddd7.zip
Diffstat (limited to '')
-rw-r--r--src/citra/emu_window/emu_window_sdl2.cpp10
1 files changed, 4 insertions, 6 deletions
diff --git a/src/citra/emu_window/emu_window_sdl2.cpp b/src/citra/emu_window/emu_window_sdl2.cpp
index b0f808399..25643715a 100644
--- a/src/citra/emu_window/emu_window_sdl2.cpp
+++ b/src/citra/emu_window/emu_window_sdl2.cpp
@@ -16,11 +16,12 @@
#include "core/settings.h"
#include "input_common/keyboard.h"
#include "input_common/main.h"
+#include "input_common/motion_emu.h"
#include "network/network.h"
void EmuWindow_SDL2::OnMouseMotion(s32 x, s32 y) {
TouchMoved((unsigned)std::max(x, 0), (unsigned)std::max(y, 0));
- motion_emu->Tilt(x, y);
+ InputCommon::GetMotionEmu()->Tilt(x, y);
}
void EmuWindow_SDL2::OnMouseButton(u32 button, u8 state, s32 x, s32 y) {
@@ -32,9 +33,9 @@ void EmuWindow_SDL2::OnMouseButton(u32 button, u8 state, s32 x, s32 y) {
}
} else if (button == SDL_BUTTON_RIGHT) {
if (state == SDL_PRESSED) {
- motion_emu->BeginTilt(x, y);
+ InputCommon::GetMotionEmu()->BeginTilt(x, y);
} else {
- motion_emu->EndTilt();
+ InputCommon::GetMotionEmu()->EndTilt();
}
}
}
@@ -61,8 +62,6 @@ EmuWindow_SDL2::EmuWindow_SDL2() {
InputCommon::Init();
Network::Init();
- motion_emu = std::make_unique<Motion::MotionEmu>(*this);
-
SDL_SetMainReady();
// Initialize the window
@@ -117,7 +116,6 @@ EmuWindow_SDL2::EmuWindow_SDL2() {
EmuWindow_SDL2::~EmuWindow_SDL2() {
SDL_GL_DeleteContext(gl_context);
SDL_Quit();
- motion_emu = nullptr;
Network::Shutdown();
InputCommon::Shutdown();