mirror of
https://github.com/libsdl-org/SDL.git
synced 2025-10-04 17:06:25 +00:00
Re-add SDL_HAPTIC_SQUARE for SDL 3.0
Fixes https://github.com/libsdl-org/SDL/issues/8753 Closes https://github.com/libsdl-org/SDL/pull/8831 Closes https://github.com/libsdl-org/SDL/pull/8783
This commit is contained in:
@@ -100,8 +100,7 @@ static int EV_IsHaptic(int fd)
|
||||
/* Convert supported features to SDL_HAPTIC platform-neutral features. */
|
||||
EV_TEST(FF_CONSTANT, SDL_HAPTIC_CONSTANT);
|
||||
EV_TEST(FF_SINE, SDL_HAPTIC_SINE);
|
||||
/* !!! FIXME: put this back when we have more bits in 2.1 */
|
||||
/* EV_TEST(FF_SQUARE, SDL_HAPTIC_SQUARE); */
|
||||
EV_TEST(FF_SQUARE, SDL_HAPTIC_SQUARE);
|
||||
EV_TEST(FF_TRIANGLE, SDL_HAPTIC_TRIANGLE);
|
||||
EV_TEST(FF_SAW_UP, SDL_HAPTIC_SAWTOOTHUP);
|
||||
EV_TEST(FF_SAW_DOWN, SDL_HAPTIC_SAWTOOTHDOWN);
|
||||
@@ -761,8 +760,7 @@ static int SDL_SYS_ToFFEffect(struct ff_effect *dest, SDL_HapticEffect *src)
|
||||
break;
|
||||
|
||||
case SDL_HAPTIC_SINE:
|
||||
/* !!! FIXME: put this back when we have more bits in 2.1 */
|
||||
/* case SDL_HAPTIC_SQUARE: */
|
||||
case SDL_HAPTIC_SQUARE:
|
||||
case SDL_HAPTIC_TRIANGLE:
|
||||
case SDL_HAPTIC_SAWTOOTHUP:
|
||||
case SDL_HAPTIC_SAWTOOTHDOWN:
|
||||
@@ -785,9 +783,8 @@ static int SDL_SYS_ToFFEffect(struct ff_effect *dest, SDL_HapticEffect *src)
|
||||
/* Periodic */
|
||||
if (periodic->type == SDL_HAPTIC_SINE) {
|
||||
dest->u.periodic.waveform = FF_SINE;
|
||||
/* !!! FIXME: put this back when we have more bits in 2.1 */
|
||||
/* else if (periodic->type == SDL_HAPTIC_SQUARE)
|
||||
dest->u.periodic.waveform = FF_SQUARE; */
|
||||
} else if (periodic->type == SDL_HAPTIC_SQUARE) {
|
||||
dest->u.periodic.waveform = FF_SQUARE;
|
||||
} else if (periodic->type == SDL_HAPTIC_TRIANGLE) {
|
||||
dest->u.periodic.waveform = FF_TRIANGLE;
|
||||
} else if (periodic->type == SDL_HAPTIC_SAWTOOTHUP) {
|
||||
|
Reference in New Issue
Block a user