diff options
Diffstat (limited to 'src/input_common/main.cpp')
| -rw-r--r-- | src/input_common/main.cpp | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/src/input_common/main.cpp b/src/input_common/main.cpp index 8e66c1b15..9e028da89 100644 --- a/src/input_common/main.cpp +++ b/src/input_common/main.cpp | |||
| @@ -9,6 +9,7 @@ | |||
| 9 | #include "input_common/keyboard.h" | 9 | #include "input_common/keyboard.h" |
| 10 | #include "input_common/main.h" | 10 | #include "input_common/main.h" |
| 11 | #include "input_common/motion_emu.h" | 11 | #include "input_common/motion_emu.h" |
| 12 | #include "input_common/udp/udp.h" | ||
| 12 | #ifdef HAVE_SDL2 | 13 | #ifdef HAVE_SDL2 |
| 13 | #include "input_common/sdl/sdl.h" | 14 | #include "input_common/sdl/sdl.h" |
| 14 | #endif | 15 | #endif |
| @@ -18,6 +19,7 @@ namespace InputCommon { | |||
| 18 | static std::shared_ptr<Keyboard> keyboard; | 19 | static std::shared_ptr<Keyboard> keyboard; |
| 19 | static std::shared_ptr<MotionEmu> motion_emu; | 20 | static std::shared_ptr<MotionEmu> motion_emu; |
| 20 | static std::unique_ptr<SDL::State> sdl; | 21 | static std::unique_ptr<SDL::State> sdl; |
| 22 | static std::unique_ptr<CemuhookUDP::State> udp; | ||
| 21 | 23 | ||
| 22 | void Init() { | 24 | void Init() { |
| 23 | keyboard = std::make_shared<Keyboard>(); | 25 | keyboard = std::make_shared<Keyboard>(); |
| @@ -28,6 +30,8 @@ void Init() { | |||
| 28 | Input::RegisterFactory<Input::MotionDevice>("motion_emu", motion_emu); | 30 | Input::RegisterFactory<Input::MotionDevice>("motion_emu", motion_emu); |
| 29 | 31 | ||
| 30 | sdl = SDL::Init(); | 32 | sdl = SDL::Init(); |
| 33 | |||
| 34 | udp = CemuhookUDP::Init(); | ||
| 31 | } | 35 | } |
| 32 | 36 | ||
| 33 | void Shutdown() { | 37 | void Shutdown() { |
| @@ -72,11 +76,13 @@ std::string GenerateAnalogParamFromKeys(int key_up, int key_down, int key_left, | |||
| 72 | namespace Polling { | 76 | namespace Polling { |
| 73 | 77 | ||
| 74 | std::vector<std::unique_ptr<DevicePoller>> GetPollers(DeviceType type) { | 78 | std::vector<std::unique_ptr<DevicePoller>> GetPollers(DeviceType type) { |
| 79 | std::vector<std::unique_ptr<DevicePoller>> pollers; | ||
| 80 | |||
| 75 | #ifdef HAVE_SDL2 | 81 | #ifdef HAVE_SDL2 |
| 76 | return sdl->GetPollers(type); | 82 | pollers = sdl->GetPollers(type); |
| 77 | #else | ||
| 78 | return {}; | ||
| 79 | #endif | 83 | #endif |
| 84 | |||
| 85 | return pollers; | ||
| 80 | } | 86 | } |
| 81 | 87 | ||
| 82 | } // namespace Polling | 88 | } // namespace Polling |