23
23
#include "SDL_syshaptic.h"
24
24
#ifdef SDL_JOYSTICK_HIDAPI
25
25
#include "SDL_hidapihaptic.h"
26
- #endif //SDL_JOYSTICK_HIDAPI
26
+ #endif
27
27
#include "SDL_haptic_c.h"
28
28
#include "../joystick/SDL_joystick_c.h" // For SDL_IsJoystickValid
29
29
@@ -45,7 +45,7 @@ bool SDL_InitHaptics(void)
45
45
SDL_SYS_HapticQuit ();
46
46
return false;
47
47
}
48
- #endif //SDL_JOYSTICK_HIDAPI
48
+ #endif
49
49
50
50
return true;
51
51
}
@@ -232,9 +232,9 @@ bool SDL_IsJoystickHaptic(SDL_Joystick *joystick)
232
232
!SDL_IsGamepad (SDL_GetJoystickID (joystick ))) {
233
233
#ifdef SDL_JOYSTICK_HIDAPI
234
234
result = SDL_SYS_JoystickIsHaptic (joystick ) || SDL_HIDAPI_JoystickIsHaptic (joystick );
235
- #else //SDL_JOYSTICK_HIDAPI
235
+ #else
236
236
result = SDL_SYS_JoystickIsHaptic (joystick );
237
- #endif //SDL_JOYSTICK_HIDAPI
237
+ #endif
238
238
}
239
239
}
240
240
SDL_UnlockJoysticks ();
@@ -263,7 +263,7 @@ SDL_Haptic *SDL_OpenHapticFromJoystick(SDL_Joystick *joystick)
263
263
if (SDL_SYS_JoystickSameHaptic (hapticlist , joystick ) || SDL_HIDAPI_JoystickSameHaptic (hapticlist , joystick )) {
264
264
#else
265
265
if (SDL_SYS_JoystickSameHaptic (hapticlist , joystick )) {
266
- #endif //SDL_JOYSTICK_HIDAPI
266
+ #endif
267
267
haptic = hapticlist ;
268
268
++ haptic -> ref_count ;
269
269
SDL_UnlockJoysticks ();
@@ -292,7 +292,7 @@ SDL_Haptic *SDL_OpenHapticFromJoystick(SDL_Joystick *joystick)
292
292
return NULL ;
293
293
}
294
294
} else
295
- #endif //SDL_JOYSTICK_HIDAPI
295
+ #endif
296
296
if (!SDL_SYS_HapticOpenFromJoystick (haptic , joystick )) {
297
297
SDL_SetError ("Haptic: SDL_SYS_HapticOpenFromJoystick failed." );
298
298
SDL_free (haptic );
@@ -339,7 +339,7 @@ void SDL_CloseHaptic(SDL_Haptic *haptic)
339
339
if (SDL_HIDAPI_HapticIsHidapi (haptic )) {
340
340
SDL_HIDAPI_HapticClose (haptic );
341
341
} else
342
- #endif //SDL_JOYSTICK_HIDAPI
342
+ #endif
343
343
{
344
344
// Close it, properly removing effects if needed
345
345
for (i = 0 ; i < haptic -> neffects ; i ++ ) {
@@ -382,7 +382,7 @@ void SDL_QuitHaptics(void)
382
382
383
383
#ifdef SDL_JOYSTICK_HIDAPI
384
384
SDL_HIDAPI_HapticQuit ();
385
- #endif //SDL_JOYSTICK_HIDAPI
385
+ #endif
386
386
SDL_SYS_HapticQuit ();
387
387
}
388
388
@@ -449,7 +449,7 @@ int SDL_CreateHapticEffect(SDL_Haptic *haptic, const SDL_HapticEffect *effect)
449
449
if (SDL_HIDAPI_HapticIsHidapi (haptic )) {
450
450
return SDL_HIDAPI_HapticNewEffect (haptic , effect );
451
451
}
452
- #endif //SDL_JOYSTICK_HIDAPI
452
+ #endif
453
453
454
454
// See if there's a free slot
455
455
for (i = 0 ; i < haptic -> neffects ; i ++ ) {
@@ -487,7 +487,7 @@ bool SDL_UpdateHapticEffect(SDL_Haptic *haptic, int effect, const SDL_HapticEffe
487
487
if (SDL_HIDAPI_HapticIsHidapi (haptic )) {
488
488
return SDL_HIDAPI_HapticUpdateEffect (haptic , effect , data );
489
489
}
490
- #endif //SDL_JOYSTICK_HIDAPI
490
+ #endif
491
491
492
492
if (!ValidEffect (haptic , effect )) {
493
493
return false;
@@ -520,7 +520,7 @@ bool SDL_RunHapticEffect(SDL_Haptic *haptic, int effect, Uint32 iterations)
520
520
if (SDL_HIDAPI_HapticIsHidapi (haptic )) {
521
521
return SDL_HIDAPI_HapticRunEffect (haptic , effect , iterations );
522
522
}
523
- #endif //SDL_JOYSTICK_HIDAPI
523
+ #endif
524
524
525
525
if (!ValidEffect (haptic , effect )) {
526
526
return false;
@@ -542,7 +542,7 @@ bool SDL_StopHapticEffect(SDL_Haptic *haptic, int effect)
542
542
if (SDL_HIDAPI_HapticIsHidapi (haptic )) {
543
543
return SDL_HIDAPI_HapticStopEffect (haptic , effect );
544
544
}
545
- #endif //SDL_JOYSTICK_HIDAPI
545
+ #endif
546
546
547
547
if (!ValidEffect (haptic , effect )) {
548
548
return false;
@@ -565,7 +565,7 @@ void SDL_DestroyHapticEffect(SDL_Haptic *haptic, int effect)
565
565
SDL_HIDAPI_HapticDestroyEffect (haptic , effect );
566
566
return ;
567
567
}
568
- #endif //SDL_JOYSTICK_HIDAPI
568
+ #endif
569
569
570
570
if (!ValidEffect (haptic , effect )) {
571
571
return ;
@@ -587,7 +587,7 @@ bool SDL_GetHapticEffectStatus(SDL_Haptic *haptic, int effect)
587
587
if (SDL_HIDAPI_HapticIsHidapi (haptic )) {
588
588
return SDL_HIDAPI_HapticGetEffectStatus (haptic , effect );
589
589
}
590
- #endif //SDL_JOYSTICK_HIDAPI
590
+ #endif
591
591
592
592
if (!ValidEffect (haptic , effect )) {
593
593
return false;
@@ -639,7 +639,7 @@ bool SDL_SetHapticGain(SDL_Haptic *haptic, int gain)
639
639
if (SDL_HIDAPI_HapticIsHidapi (haptic )) {
640
640
return SDL_HIDAPI_HapticSetGain (haptic , real_gain );
641
641
}
642
- #endif //SDL_JOYSTICK_HIDAPI
642
+ #endif
643
643
644
644
return SDL_SYS_HapticSetGain (haptic , real_gain );
645
645
}
@@ -660,7 +660,7 @@ bool SDL_SetHapticAutocenter(SDL_Haptic *haptic, int autocenter)
660
660
if (SDL_HIDAPI_HapticIsHidapi (haptic )) {
661
661
return SDL_HIDAPI_HapticSetAutocenter (haptic , autocenter );
662
662
}
663
- #endif //SDL_JOYSTICK_HIDAPI
663
+ #endif
664
664
665
665
return SDL_SYS_HapticSetAutocenter (haptic , autocenter );
666
666
}
@@ -677,7 +677,7 @@ bool SDL_PauseHaptic(SDL_Haptic *haptic)
677
677
if (SDL_HIDAPI_HapticIsHidapi (haptic )) {
678
678
return SDL_HIDAPI_HapticPause (haptic );
679
679
}
680
- #endif //SDL_JOYSTICK_HIDAPI
680
+ #endif
681
681
682
682
return SDL_SYS_HapticPause (haptic );
683
683
}
@@ -694,7 +694,7 @@ bool SDL_ResumeHaptic(SDL_Haptic *haptic)
694
694
if (SDL_HIDAPI_HapticIsHidapi (haptic )) {
695
695
return SDL_HIDAPI_HapticResume (haptic );
696
696
}
697
- #endif //SDL_JOYSTICK_HIDAPI
697
+ #endif
698
698
699
699
return SDL_SYS_HapticResume (haptic );
700
700
}
@@ -707,7 +707,7 @@ bool SDL_StopHapticEffects(SDL_Haptic *haptic)
707
707
if (SDL_HIDAPI_HapticIsHidapi (haptic )) {
708
708
return SDL_HIDAPI_HapticStopAll (haptic );
709
709
}
710
- #endif //SDL_JOYSTICK_HIDAPI
710
+ #endif
711
711
712
712
return SDL_SYS_HapticStopAll (haptic );
713
713
}
0 commit comments