diff options
Diffstat (limited to 'src/input_common/main.cpp')
| -rw-r--r-- | src/input_common/main.cpp | 26 |
1 files changed, 23 insertions, 3 deletions
diff --git a/src/input_common/main.cpp b/src/input_common/main.cpp index 21834fb6b..75a57b9fc 100644 --- a/src/input_common/main.cpp +++ b/src/input_common/main.cpp | |||
| @@ -1,10 +1,10 @@ | |||
| 1 | // Copyright 2017 Citra Emulator Project | 1 | // SPDX-FileCopyrightText: 2017 Citra Emulator Project |
| 2 | // Licensed under GPLv2 or any later version | 2 | // SPDX-License-Identifier: GPL-2.0-or-later |
| 3 | // Refer to the license.txt file included. | ||
| 4 | 3 | ||
| 5 | #include <memory> | 4 | #include <memory> |
| 6 | #include "common/input.h" | 5 | #include "common/input.h" |
| 7 | #include "common/param_package.h" | 6 | #include "common/param_package.h" |
| 7 | #include "input_common/drivers/camera.h" | ||
| 8 | #include "input_common/drivers/gc_adapter.h" | 8 | #include "input_common/drivers/gc_adapter.h" |
| 9 | #include "input_common/drivers/keyboard.h" | 9 | #include "input_common/drivers/keyboard.h" |
| 10 | #include "input_common/drivers/mouse.h" | 10 | #include "input_common/drivers/mouse.h" |
| @@ -78,6 +78,15 @@ struct InputSubsystem::Impl { | |||
| 78 | Common::Input::RegisterFactory<Common::Input::OutputDevice>(tas_input->GetEngineName(), | 78 | Common::Input::RegisterFactory<Common::Input::OutputDevice>(tas_input->GetEngineName(), |
| 79 | tas_output_factory); | 79 | tas_output_factory); |
| 80 | 80 | ||
| 81 | camera = std::make_shared<Camera>("camera"); | ||
| 82 | camera->SetMappingCallback(mapping_callback); | ||
| 83 | camera_input_factory = std::make_shared<InputFactory>(camera); | ||
| 84 | camera_output_factory = std::make_shared<OutputFactory>(camera); | ||
| 85 | Common::Input::RegisterFactory<Common::Input::InputDevice>(camera->GetEngineName(), | ||
| 86 | camera_input_factory); | ||
| 87 | Common::Input::RegisterFactory<Common::Input::OutputDevice>(camera->GetEngineName(), | ||
| 88 | camera_output_factory); | ||
| 89 | |||
| 81 | #ifdef HAVE_SDL2 | 90 | #ifdef HAVE_SDL2 |
| 82 | sdl = std::make_shared<SDLDriver>("sdl"); | 91 | sdl = std::make_shared<SDLDriver>("sdl"); |
| 83 | sdl->SetMappingCallback(mapping_callback); | 92 | sdl->SetMappingCallback(mapping_callback); |
| @@ -317,6 +326,7 @@ struct InputSubsystem::Impl { | |||
| 317 | std::shared_ptr<TouchScreen> touch_screen; | 326 | std::shared_ptr<TouchScreen> touch_screen; |
| 318 | std::shared_ptr<TasInput::Tas> tas_input; | 327 | std::shared_ptr<TasInput::Tas> tas_input; |
| 319 | std::shared_ptr<CemuhookUDP::UDPClient> udp_client; | 328 | std::shared_ptr<CemuhookUDP::UDPClient> udp_client; |
| 329 | std::shared_ptr<Camera> camera; | ||
| 320 | 330 | ||
| 321 | std::shared_ptr<InputFactory> keyboard_factory; | 331 | std::shared_ptr<InputFactory> keyboard_factory; |
| 322 | std::shared_ptr<InputFactory> mouse_factory; | 332 | std::shared_ptr<InputFactory> mouse_factory; |
| @@ -324,12 +334,14 @@ struct InputSubsystem::Impl { | |||
| 324 | std::shared_ptr<InputFactory> touch_screen_factory; | 334 | std::shared_ptr<InputFactory> touch_screen_factory; |
| 325 | std::shared_ptr<InputFactory> udp_client_input_factory; | 335 | std::shared_ptr<InputFactory> udp_client_input_factory; |
| 326 | std::shared_ptr<InputFactory> tas_input_factory; | 336 | std::shared_ptr<InputFactory> tas_input_factory; |
| 337 | std::shared_ptr<InputFactory> camera_input_factory; | ||
| 327 | 338 | ||
| 328 | std::shared_ptr<OutputFactory> keyboard_output_factory; | 339 | std::shared_ptr<OutputFactory> keyboard_output_factory; |
| 329 | std::shared_ptr<OutputFactory> mouse_output_factory; | 340 | std::shared_ptr<OutputFactory> mouse_output_factory; |
| 330 | std::shared_ptr<OutputFactory> gcadapter_output_factory; | 341 | std::shared_ptr<OutputFactory> gcadapter_output_factory; |
| 331 | std::shared_ptr<OutputFactory> udp_client_output_factory; | 342 | std::shared_ptr<OutputFactory> udp_client_output_factory; |
| 332 | std::shared_ptr<OutputFactory> tas_output_factory; | 343 | std::shared_ptr<OutputFactory> tas_output_factory; |
| 344 | std::shared_ptr<OutputFactory> camera_output_factory; | ||
| 333 | 345 | ||
| 334 | #ifdef HAVE_SDL2 | 346 | #ifdef HAVE_SDL2 |
| 335 | std::shared_ptr<SDLDriver> sdl; | 347 | std::shared_ptr<SDLDriver> sdl; |
| @@ -382,6 +394,14 @@ const TasInput::Tas* InputSubsystem::GetTas() const { | |||
| 382 | return impl->tas_input.get(); | 394 | return impl->tas_input.get(); |
| 383 | } | 395 | } |
| 384 | 396 | ||
| 397 | Camera* InputSubsystem::GetCamera() { | ||
| 398 | return impl->camera.get(); | ||
| 399 | } | ||
| 400 | |||
| 401 | const Camera* InputSubsystem::GetCamera() const { | ||
| 402 | return impl->camera.get(); | ||
| 403 | } | ||
| 404 | |||
| 385 | std::vector<Common::ParamPackage> InputSubsystem::GetInputDevices() const { | 405 | std::vector<Common::ParamPackage> InputSubsystem::GetInputDevices() const { |
| 386 | return impl->GetInputDevices(); | 406 | return impl->GetInputDevices(); |
| 387 | } | 407 | } |