# HG changeset patch # User Edgar Simo # Date 1218017495 0 # Node ID 53dd30491c71db9c31ce9fa4b628b532337ff81b # Parent 9bad8efcb75e984fd1ebfebcd7c324a181a7ca6f Added SDL_HAPTIC_STATUS support to windows haptic port. diff -r 9bad8efcb75e -r 53dd30491c71 src/haptic/win32/SDL_syshaptic.c --- a/src/haptic/win32/SDL_syshaptic.c Wed Aug 06 09:55:51 2008 +0000 +++ b/src/haptic/win32/SDL_syshaptic.c Wed Aug 06 10:11:35 2008 +0000 @@ -465,6 +465,9 @@ haptic->supported |= SDL_HAPTIC_AUTOCENTER; } + /* Status is always supported. */ + haptic->supported |= SDL_HAPTIC_STATUS; + /* Check maximum effects. */ haptic->neffects = 128; /* TODO actually figure this out. */ haptic->nplaying = 128; @@ -1231,8 +1234,17 @@ int SDL_SYS_HapticGetEffectStatus(SDL_Haptic * haptic, struct haptic_effect * effect) { - SDL_SetError("Haptic: Status not supported."); - return -1; + HRESULT ret; + DWORD status; + + ret = IDirectInputEffect_GetEffectStatus(effect->hweffect->ref, &status); + if (FAILED(ret)) { + DI_SetError("Getting effect status",ret); + return -1; + } + + if (status == 0) return SDL_FALSE; + return SDL_TRUE; }