|
|
@ -22,7 +22,7 @@ |
|
|
#ifdef HAVE_LIBUSB
|
|
|
#ifdef HAVE_LIBUSB
|
|
|
#include "input_common/drivers/gc_adapter.h"
|
|
|
#include "input_common/drivers/gc_adapter.h"
|
|
|
#endif
|
|
|
#endif
|
|
|
#ifdef HAVE_SDL2
|
|
|
|
|
|
|
|
|
#ifdef HAVE_SDL3
|
|
|
#include "input_common/drivers/joycon.h"
|
|
|
#include "input_common/drivers/joycon.h"
|
|
|
#include "input_common/drivers/sdl_driver.h"
|
|
|
#include "input_common/drivers/sdl_driver.h"
|
|
|
#endif
|
|
|
#endif
|
|
|
@ -87,7 +87,7 @@ struct InputSubsystem::Impl { |
|
|
#endif
|
|
|
#endif
|
|
|
RegisterEngine("virtual_amiibo", virtual_amiibo); |
|
|
RegisterEngine("virtual_amiibo", virtual_amiibo); |
|
|
RegisterEngine("virtual_gamepad", virtual_gamepad); |
|
|
RegisterEngine("virtual_gamepad", virtual_gamepad); |
|
|
#ifdef HAVE_SDL2
|
|
|
|
|
|
|
|
|
#ifdef HAVE_SDL3
|
|
|
RegisterEngine("sdl", sdl); |
|
|
RegisterEngine("sdl", sdl); |
|
|
RegisterEngine("joycon", joycon); |
|
|
RegisterEngine("joycon", joycon); |
|
|
#endif
|
|
|
#endif
|
|
|
@ -121,7 +121,7 @@ struct InputSubsystem::Impl { |
|
|
#endif
|
|
|
#endif
|
|
|
UnregisterEngine(virtual_amiibo); |
|
|
UnregisterEngine(virtual_amiibo); |
|
|
UnregisterEngine(virtual_gamepad); |
|
|
UnregisterEngine(virtual_gamepad); |
|
|
#ifdef HAVE_SDL2
|
|
|
|
|
|
|
|
|
#ifdef HAVE_SDL3
|
|
|
UnregisterEngine(sdl); |
|
|
UnregisterEngine(sdl); |
|
|
UnregisterEngine(joycon); |
|
|
UnregisterEngine(joycon); |
|
|
#endif
|
|
|
#endif
|
|
|
@ -151,7 +151,7 @@ struct InputSubsystem::Impl { |
|
|
#endif
|
|
|
#endif
|
|
|
auto udp_devices = udp_client->GetInputDevices(); |
|
|
auto udp_devices = udp_client->GetInputDevices(); |
|
|
devices.insert(devices.end(), udp_devices.begin(), udp_devices.end()); |
|
|
devices.insert(devices.end(), udp_devices.begin(), udp_devices.end()); |
|
|
#ifdef HAVE_SDL2
|
|
|
|
|
|
|
|
|
#ifdef HAVE_SDL3
|
|
|
auto joycon_devices = joycon->GetInputDevices(); |
|
|
auto joycon_devices = joycon->GetInputDevices(); |
|
|
devices.insert(devices.end(), joycon_devices.begin(), joycon_devices.end()); |
|
|
devices.insert(devices.end(), joycon_devices.begin(), joycon_devices.end()); |
|
|
auto sdl_devices = sdl->GetInputDevices(); |
|
|
auto sdl_devices = sdl->GetInputDevices(); |
|
|
@ -186,7 +186,7 @@ struct InputSubsystem::Impl { |
|
|
if (engine == udp_client->GetEngineName()) { |
|
|
if (engine == udp_client->GetEngineName()) { |
|
|
return udp_client; |
|
|
return udp_client; |
|
|
} |
|
|
} |
|
|
#ifdef HAVE_SDL2
|
|
|
|
|
|
|
|
|
#ifdef HAVE_SDL3
|
|
|
if (engine == sdl->GetEngineName()) { |
|
|
if (engine == sdl->GetEngineName()) { |
|
|
return sdl; |
|
|
return sdl; |
|
|
} |
|
|
} |
|
|
@ -277,7 +277,7 @@ struct InputSubsystem::Impl { |
|
|
if (engine == virtual_gamepad->GetEngineName()) { |
|
|
if (engine == virtual_gamepad->GetEngineName()) { |
|
|
return true; |
|
|
return true; |
|
|
} |
|
|
} |
|
|
#ifdef HAVE_SDL2
|
|
|
|
|
|
|
|
|
#ifdef HAVE_SDL3
|
|
|
if (engine == sdl->GetEngineName()) { |
|
|
if (engine == sdl->GetEngineName()) { |
|
|
return true; |
|
|
return true; |
|
|
} |
|
|
} |
|
|
@ -298,7 +298,7 @@ struct InputSubsystem::Impl { |
|
|
gcadapter->BeginConfiguration(); |
|
|
gcadapter->BeginConfiguration(); |
|
|
#endif
|
|
|
#endif
|
|
|
udp_client->BeginConfiguration(); |
|
|
udp_client->BeginConfiguration(); |
|
|
#ifdef HAVE_SDL2
|
|
|
|
|
|
|
|
|
#ifdef HAVE_SDL3
|
|
|
sdl->BeginConfiguration(); |
|
|
sdl->BeginConfiguration(); |
|
|
joycon->BeginConfiguration(); |
|
|
joycon->BeginConfiguration(); |
|
|
#endif
|
|
|
#endif
|
|
|
@ -314,7 +314,7 @@ struct InputSubsystem::Impl { |
|
|
gcadapter->EndConfiguration(); |
|
|
gcadapter->EndConfiguration(); |
|
|
#endif
|
|
|
#endif
|
|
|
udp_client->EndConfiguration(); |
|
|
udp_client->EndConfiguration(); |
|
|
#ifdef HAVE_SDL2
|
|
|
|
|
|
|
|
|
#ifdef HAVE_SDL3
|
|
|
sdl->EndConfiguration(); |
|
|
sdl->EndConfiguration(); |
|
|
joycon->EndConfiguration(); |
|
|
joycon->EndConfiguration(); |
|
|
#endif
|
|
|
#endif
|
|
|
@ -322,7 +322,7 @@ struct InputSubsystem::Impl { |
|
|
|
|
|
|
|
|
void PumpEvents() const { |
|
|
void PumpEvents() const { |
|
|
update_engine->PumpEvents(); |
|
|
update_engine->PumpEvents(); |
|
|
#ifdef HAVE_SDL2
|
|
|
|
|
|
|
|
|
#ifdef HAVE_SDL3
|
|
|
sdl->PumpEvents(); |
|
|
sdl->PumpEvents(); |
|
|
#endif
|
|
|
#endif
|
|
|
} |
|
|
} |
|
|
@ -347,7 +347,7 @@ struct InputSubsystem::Impl { |
|
|
std::shared_ptr<GCAdapter> gcadapter; |
|
|
std::shared_ptr<GCAdapter> gcadapter; |
|
|
#endif
|
|
|
#endif
|
|
|
|
|
|
|
|
|
#ifdef HAVE_SDL2
|
|
|
|
|
|
|
|
|
#ifdef HAVE_SDL3
|
|
|
std::shared_ptr<SDLDriver> sdl; |
|
|
std::shared_ptr<SDLDriver> sdl; |
|
|
std::shared_ptr<Joycons> joycon; |
|
|
std::shared_ptr<Joycons> joycon; |
|
|
#endif
|
|
|
#endif
|
|
|
|