[ion] Haptics events don't depend on SCREEN_ONLY

This commit is contained in:
Émilie Feral
2020-09-22 17:26:52 +02:00
committed by EmilieNumworks
parent 979c227d54
commit 9786db308a

View File

@@ -5,12 +5,9 @@ namespace Ion {
namespace Simulator {
namespace Haptics {
#if !EPSILON_SDL_SCREEN_ONLY
static SDL_Haptic * sSDLHaptic = nullptr;
#endif
void init() {
#if !EPSILON_SDL_SCREEN_ONLY
if (SDL_Init(SDL_INIT_HAPTIC) == 0) {
sSDLHaptic = SDL_HapticOpen(0);
if (sSDLHaptic) {
@@ -19,23 +16,18 @@ void init() {
}
}
}
#endif
}
void shutdown() {
#if !EPSILON_SDL_SCREEN_ONLY
if (sSDLHaptic) {
SDL_HapticClose(sSDLHaptic);
}
#endif
}
void perform() {
#if !EPSILON_SDL_SCREEN_ONLY
if (sSDLHaptic) {
SDL_HapticRumblePlay(sSDLHaptic, 1.0, 40);
}
#endif
}