diff options
| author | 2017-08-19 23:43:01 -0600 | |
|---|---|---|
| committer | 2017-08-19 23:43:01 -0600 | |
| commit | bbfa9d0635ce4b9226bed02ea1b6e8ddbb7e8a56 (patch) | |
| tree | 5bfecf66096077d72346da902a9646314cb60631 /src/citra/emu_window/emu_window_sdl2.cpp | |
| parent | Merge pull request #2871 from wwylele/sw-spotlight (diff) | |
| parent | HID: fix a comment and a warning (diff) | |
| download | yuzu-bbfa9d0635ce4b9226bed02ea1b6e8ddbb7e8a56.tar.gz yuzu-bbfa9d0635ce4b9226bed02ea1b6e8ddbb7e8a56.tar.xz yuzu-bbfa9d0635ce4b9226bed02ea1b6e8ddbb7e8a56.zip | |
Merge pull request #2861 from wwylele/motion-refactor
Refactor MotionEmu into a InputDevice
Diffstat (limited to 'src/citra/emu_window/emu_window_sdl2.cpp')
| -rw-r--r-- | src/citra/emu_window/emu_window_sdl2.cpp | 10 |
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 @@ | |||
| 16 | #include "core/settings.h" | 16 | #include "core/settings.h" |
| 17 | #include "input_common/keyboard.h" | 17 | #include "input_common/keyboard.h" |
| 18 | #include "input_common/main.h" | 18 | #include "input_common/main.h" |
| 19 | #include "input_common/motion_emu.h" | ||
| 19 | #include "network/network.h" | 20 | #include "network/network.h" |
| 20 | 21 | ||
| 21 | void EmuWindow_SDL2::OnMouseMotion(s32 x, s32 y) { | 22 | void EmuWindow_SDL2::OnMouseMotion(s32 x, s32 y) { |
| 22 | TouchMoved((unsigned)std::max(x, 0), (unsigned)std::max(y, 0)); | 23 | TouchMoved((unsigned)std::max(x, 0), (unsigned)std::max(y, 0)); |
| 23 | motion_emu->Tilt(x, y); | 24 | InputCommon::GetMotionEmu()->Tilt(x, y); |
| 24 | } | 25 | } |
| 25 | 26 | ||
| 26 | void EmuWindow_SDL2::OnMouseButton(u32 button, u8 state, s32 x, s32 y) { | 27 | 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) { | |||
| 32 | } | 33 | } |
| 33 | } else if (button == SDL_BUTTON_RIGHT) { | 34 | } else if (button == SDL_BUTTON_RIGHT) { |
| 34 | if (state == SDL_PRESSED) { | 35 | if (state == SDL_PRESSED) { |
| 35 | motion_emu->BeginTilt(x, y); | 36 | InputCommon::GetMotionEmu()->BeginTilt(x, y); |
| 36 | } else { | 37 | } else { |
| 37 | motion_emu->EndTilt(); | 38 | InputCommon::GetMotionEmu()->EndTilt(); |
| 38 | } | 39 | } |
| 39 | } | 40 | } |
| 40 | } | 41 | } |
| @@ -61,8 +62,6 @@ EmuWindow_SDL2::EmuWindow_SDL2() { | |||
| 61 | InputCommon::Init(); | 62 | InputCommon::Init(); |
| 62 | Network::Init(); | 63 | Network::Init(); |
| 63 | 64 | ||
| 64 | motion_emu = std::make_unique<Motion::MotionEmu>(*this); | ||
| 65 | |||
| 66 | SDL_SetMainReady(); | 65 | SDL_SetMainReady(); |
| 67 | 66 | ||
| 68 | // Initialize the window | 67 | // Initialize the window |
| @@ -117,7 +116,6 @@ EmuWindow_SDL2::EmuWindow_SDL2() { | |||
| 117 | EmuWindow_SDL2::~EmuWindow_SDL2() { | 116 | EmuWindow_SDL2::~EmuWindow_SDL2() { |
| 118 | SDL_GL_DeleteContext(gl_context); | 117 | SDL_GL_DeleteContext(gl_context); |
| 119 | SDL_Quit(); | 118 | SDL_Quit(); |
| 120 | motion_emu = nullptr; | ||
| 121 | 119 | ||
| 122 | Network::Shutdown(); | 120 | Network::Shutdown(); |
| 123 | InputCommon::Shutdown(); | 121 | InputCommon::Shutdown(); |