The XInput code is only available in the DirectInput joystick driver.
authorSam Lantinga
Mon, 26 Nov 2012 23:50:12 -0800
changeset 670191160c9b35da
parent 6700 c8f3d3f0251e
child 6702 3262d73b843b
The XInput code is only available in the DirectInput joystick driver.
src/joystick/SDL_gamecontroller.c
src/joystick/SDL_sysjoystick.h
     1.1 --- a/src/joystick/SDL_gamecontroller.c	Mon Nov 26 23:41:50 2012 -0800
     1.2 +++ b/src/joystick/SDL_gamecontroller.c	Mon Nov 26 23:50:12 2012 -0800
     1.3 @@ -81,7 +81,7 @@
     1.4  /* default mappings we support */
     1.5  const char *s_ControllerMappings [] =
     1.6  {
     1.7 -#ifdef __WIN32__
     1.8 +#ifdef SDL_JOYSTICK_DINPUT
     1.9  	"xinput,X360 Controller,a:b10,b:b11,y:b13,x:b12,start:b4,guide:b14,back:b5,dpup:b0,dpleft:b2,dpdown:b1,dpright:b3,leftshoulder:b8,rightshoulder:b9,leftstick:b6,rightstick:b7,leftx:a0,lefty:a1,rightx:a2,righty:a3,lefttrigger:a4,righttrigger:a5",
    1.10  	"341a3608000000000000504944564944,Afterglow PS3 Controller,a:b1,b:b2,y:b3,x:b0,start:b9,guide:b12,back:b8,dpup:h0.1,dpleft:h0.8,dpdown:h0.4,dpright:h0.2,leftshoulder:b4,rightshoulder:b5,leftstick:b10,rightstick:b11,leftx:a0,lefty:a1,rightx:a2,righty:a3,lefttrigger:b6,righttrigger:b7",
    1.11  	"88880803000000000000504944564944,PS3,a:b2,b:b1,x:b0,y:b3,start:b11,back:b8,leftstick:b9,rightstick:b10,leftshoulder:b4,rightshoulder:b5,dpup:h0.1,dpleft:h0.4,dpdown:h0.8,dpright:h0.2,leftx:a0,lefty:a1,rightx:a3,righty:a4,lefttrigger:b6,righttrigger:b7,guide:b12",
    1.12 @@ -235,7 +235,7 @@
    1.13   */
    1.14  ControllerMapping_t *SDL_PrivateGetControllerMapping(int device_index)
    1.15  {
    1.16 -#ifdef __WIN32__
    1.17 +#ifdef SDL_JOYSTICK_DINPUT
    1.18  	if ( SDL_SYS_IsXInputDeviceIndex(device_index) && s_pXInputMapping )
    1.19  	{
    1.20  		return s_pXInputMapping;
    1.21 @@ -576,7 +576,7 @@
    1.22  		pchMapping = SDL_PrivateGetControllerMappingFromMappingString( pMappingString );
    1.23  		if ( pchGUID && pchName )
    1.24  		{
    1.25 -#ifdef __WIN32__
    1.26 +#ifdef SDL_JOYSTICK_DINPUT
    1.27  			if ( !SDL_strcasecmp( pchGUID, "xinput" ) )
    1.28  			{
    1.29  				s_pXInputMapping = pControllerMapping;
    1.30 @@ -628,7 +628,7 @@
    1.31  
    1.32  				if ( pchGUID && pchName )
    1.33  				{
    1.34 -#ifdef __WIN32__
    1.35 +#ifdef SDL_JOYSTICK_DINPUT
    1.36  					if ( !SDL_strcasecmp( pchGUID, "xinput" ) )
    1.37  					{
    1.38  						s_pXInputMapping = pControllerMapping;
     2.1 --- a/src/joystick/SDL_sysjoystick.h	Mon Nov 26 23:41:50 2012 -0800
     2.2 +++ b/src/joystick/SDL_sysjoystick.h	Mon Nov 26 23:50:12 2012 -0800
     2.3 @@ -113,7 +113,7 @@
     2.4   */
     2.5  extern JoystickGUID SDL_SYS_PrivateJoystickGetGUID(SDL_Joystick * joystick);
     2.6  
     2.7 -#ifdef __WIN32__
     2.8 +#ifdef SDL_JOYSTICK_DINPUT
     2.9  /* Function to get the current instance id of the joystick located at device_index */
    2.10  extern int SDL_SYS_IsXInputDeviceIndex( int device_index );
    2.11  #endif