@ -111,12 +111,12 @@ static int SDLash_JoyInit_Old( int numjoy )
@@ -111,12 +111,12 @@ static int SDLash_JoyInit_Old( int numjoy )
int num ;
int i ;
MsgDev ( D_INFO , " Joystick: SDL \n " ) ;
Con_Reportf ( " Joystick: SDL \n " ) ;
if ( SDL_WasInit ( SDL_INIT_JOYSTICK ) ! = SDL_INIT_JOYSTICK & &
SDL_InitSubSystem ( SDL_INIT_JOYSTICK ) )
{
MsgDev ( D_INFO , " Failed to initialize SDL Joysitck: %s \n " , SDL_GetError ( ) ) ;
Con_Reportf ( " Failed to initialize SDL Joysitck: %s \n " , SDL_GetError ( ) ) ;
return 0 ;
}
@ -128,27 +128,27 @@ static int SDLash_JoyInit_Old( int numjoy )
@@ -128,27 +128,27 @@ static int SDLash_JoyInit_Old( int numjoy )
num = SDL_NumJoysticks ( ) ;
if ( num > 0 )
MsgDev ( D_INFO , " %i joysticks found: \n " , num ) ;
Con_Reportf ( " %i joysticks found: \n " , num ) ;
else
{
MsgDev ( D_INFO , " No joystick found. \n " ) ;
Con_Reportf ( " No joystick found. \n " ) ;
return 0 ;
}
for ( i = 0 ; i < num ; i + + )
MsgDev ( D_INFO , " %i \t : %s \n " , i , SDL_JoystickNameForIndex ( i ) ) ;
Con_Reportf ( " %i \t : %s \n " , i , SDL_JoystickNameForIndex ( i ) ) ;
MsgDev ( D_INFO , " Pass +set joy_index N to command line, where N is number, to select active joystick \n " ) ;
Con_Reportf ( " Pass +set joy_index N to command line, where N is number, to select active joystick \n " ) ;
joy = SDL_JoystickOpen ( numjoy ) ;
if ( ! joy )
{
MsgDev ( D_INFO , " Failed to select joystick: %s \n " , SDL_GetError ( ) ) ;
Con_Reportf ( " Failed to select joystick: %s \n " , SDL_GetError ( ) ) ;
return 0 ;
}
MsgDev ( D_INFO , " Selected joystick: %s \n "
Con_Reportf ( " Selected joystick: %s \n "
" \t Axes: %i \n "
" \t Hats: %i \n "
" \t Buttons: %i \n "
@ -173,12 +173,12 @@ static int SDLash_JoyInit_New( int numjoy )
@@ -173,12 +173,12 @@ static int SDLash_JoyInit_New( int numjoy )
int temp , num ;
int i ;
MsgDev ( D_INFO , " Joystick: SDL GameController API \n " ) ;
Con_Reportf ( " Joystick: SDL GameController API \n " ) ;
if ( SDL_WasInit ( SDL_INIT_GAMECONTROLLER ) ! = SDL_INIT_GAMECONTROLLER & &
SDL_InitSubSystem ( SDL_INIT_GAMECONTROLLER ) )
{
MsgDev ( D_INFO , " Failed to initialize SDL GameController API: %s \n " , SDL_GetError ( ) ) ;
Con_Reportf ( " Failed to initialize SDL GameController API: %s \n " , SDL_GetError ( ) ) ;
return 0 ;
}
@ -200,28 +200,28 @@ static int SDLash_JoyInit_New( int numjoy )
@@ -200,28 +200,28 @@ static int SDLash_JoyInit_New( int numjoy )
}
if ( num > 0 )
MsgDev ( D_INFO , " %i joysticks found: \n " , num ) ;
Con_Reportf ( " %i joysticks found: \n " , num ) ;
else
{
MsgDev ( D_INFO , " No joystick found. \n " ) ;
Con_Reportf ( " No joystick found. \n " ) ;
return 0 ;
}
for ( i = 0 ; i < num ; i + + )
MsgDev ( D_INFO , " %i \t : %s \n " , i , SDL_GameControllerNameForIndex ( i ) ) ;
Con_Reportf ( " %i \t : %s \n " , i , SDL_GameControllerNameForIndex ( i ) ) ;
MsgDev ( D_INFO , " Pass +set joy_index N to command line, where N is number, to select active joystick \n " ) ;
Con_Reportf ( " Pass +set joy_index N to command line, where N is number, to select active joystick \n " ) ;
gamecontroller = SDL_GameControllerOpen ( numjoy ) ;
if ( ! gamecontroller )
{
MsgDev ( D_INFO , " Failed to select joystick: %s \n " , SDL_GetError ( ) ) ;
Con_Reportf ( " Failed to select joystick: %s \n " , SDL_GetError ( ) ) ;
return 0 ;
}
// was added in SDL2-2.0.6, allow build with earlier versions just in case
# if SDL_MAJOR_VERSION > 2 || SDL_MINOR_VERSION > 0 || SDL_PATCHLEVEL >= 6
MsgDev ( D_INFO , " Selected joystick: %s (%i:%i:%i) \n " ,
Con_Reportf ( " Selected joystick: %s (%i:%i:%i) \n " ,
SDL_GameControllerName ( gamecontroller ) ,
SDL_GameControllerGetVendor ( gamecontroller ) ,
SDL_GameControllerGetProduct ( gamecontroller ) ,