diff options
| author | SND\MaddTheSane_cp <SND\MaddTheSane_cp@e17a0e51-4ae3-4d35-97c3-1a29b211df97> | 2014-04-08 02:33:19 +0000 |
|---|---|---|
| committer | SND\MaddTheSane_cp <SND\MaddTheSane_cp@e17a0e51-4ae3-4d35-97c3-1a29b211df97> | 2014-04-08 02:33:19 +0000 |
| commit | c875a3566e340e366553beb2dcd6b2bcf4d5ab18 (patch) | |
| tree | 97dcfbe538af5f282135a27cf889ed32b1d9d54d /plugins/dfinput/pad.h | |
| parent | 0d4ea9238b154a30e8713c7d00d7b6d1b0050d5c (diff) | |
| download | pcsxr-c875a3566e340e366553beb2dcd6b2bcf4d5ab18.tar.gz | |
DFInput: Implement SDL2 GameController support.
This change allows the user to use SDL2’s GameController API instead of the Joystick API.
The Game Controller API maps the buttons similar to an Xbox 360 controller, so some tricky mapping needed to be done.
Note that it currently only supports OS X.
git-svn-id: https://pcsxr.svn.codeplex.com/svn/pcsxr@89828 e17a0e51-4ae3-4d35-97c3-1a29b211df97
Diffstat (limited to 'plugins/dfinput/pad.h')
| -rwxr-xr-x | plugins/dfinput/pad.h | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/plugins/dfinput/pad.h b/plugins/dfinput/pad.h index 205bae41..eb9217fa 100755 --- a/plugins/dfinput/pad.h +++ b/plugins/dfinput/pad.h @@ -38,6 +38,7 @@ extern "C" { #include <SDL_joystick.h> #if SDL_VERSION_ATLEAST(2,0,0) #include <SDL_haptic.h> +#include <SDL_gamecontroller.h> #endif #ifdef _MACOSX @@ -147,12 +148,19 @@ typedef struct tagKeyDef { enum { ANALOG_XP = 0, ANALOG_XM, ANALOG_YP, ANALOG_YM }; +#if SDL_VERSION_ATLEAST(2,0,0) +SDL_GameControllerButton controllerMap[DKEY_TOTAL]; +#endif + typedef struct tagPadDef { int8_t DevNum; uint16_t Type; uint8_t VisualVibration; KEYDEF KeyDef[DKEY_TOTAL]; KEYDEF AnalogDef[ANALOG_TOTAL][4]; +#if SDL_VERSION_ATLEAST(2,0,0) + int8_t UseSDL2; +#endif } PADDEF; typedef struct tagEmuDef { @@ -188,7 +196,8 @@ typedef struct tagPadState { uint8_t Vib0, Vib1; volatile uint8_t VibF[2]; #if SDL_VERSION_ATLEAST(2,0,0) - SDL_Haptic *haptic; + SDL_Haptic *haptic; + SDL_GameController *GCDev; #else #ifdef __linux__ int VibrateDev; |
