X-Git-Url: https://git.octo.it/?a=blobdiff_plain;f=src%2Fcontrol%2Fhaptic_manager.cpp;fp=src%2Fcontrol%2Fhaptic_manager.cpp;h=cda5782912c98175a90f6edd5c7cd95315fee4a8;hb=ede91db5aa7b350c80b931e29e0355f368ad2bb2;hp=826d3ffb34f5f2fdf9567368fbc4ac949968314a;hpb=f9cb55ad4e8ff6e6ec974f8aa1eb53c19c95c1b1;p=supertux.git diff --git a/src/control/haptic_manager.cpp b/src/control/haptic_manager.cpp index 826d3ffb3..cda578291 100644 --- a/src/control/haptic_manager.cpp +++ b/src/control/haptic_manager.cpp @@ -19,6 +19,7 @@ #include "control/haptic_manager.hpp" #include "util/log.hpp" +#if SDL_VERSION_ATLEAST(1,3,0) HapticManager::HapticManager () /* {{{ */ { int i; @@ -90,5 +91,20 @@ void HapticManager::playEffect (haptic_effect_t idx) { /* {{{ */ SDL_HapticRunEffect (_device, _effect_ids[idx], /* iterations = */ 1); } /* }}} void playEffect */ +#else /* if SDL < 1.3 */ +/* If the SDL version is too old, provide dummy methods that don't to anything. + * This avoid using defines all over the place. */ +HapticManager::HapticManager () { + log_debug << "Haptic manager: Disabled because SDL version is too old." << std::endl; +} + +void HapticManager::addJoystick (SDL_Joystick *j) { + /* do nothing. */ +} + +void HapticManager::playEffect (haptic_effect_t idx) { + /* do nothing. */ +} +#endif /* SDL < 1.3 */ /* vim: set sw=2 sts=2 et fdm=marker : */