|
@@ -34,11 +34,6 @@
|
|
|
#define SDL_GAMEINPUT_DEFAULT false
|
|
#define SDL_GAMEINPUT_DEFAULT false
|
|
|
#endif
|
|
#endif
|
|
|
|
|
|
|
|
-// Enable sensor support in GameInput 2.0, once we have a device that can be used for testing
|
|
|
|
|
-#if GAMEINPUT_API_VERSION >= 2
|
|
|
|
|
-//#define GAMEINPUT_SENSOR_SUPPORT
|
|
|
|
|
-#endif
|
|
|
|
|
-
|
|
|
|
|
enum
|
|
enum
|
|
|
{
|
|
{
|
|
|
SDL_GAMEPAD_BUTTON_GAMEINPUT_SHARE = 11
|
|
SDL_GAMEPAD_BUTTON_GAMEINPUT_SHARE = 11
|
|
@@ -647,17 +642,17 @@ static bool GAMEINPUT_JoystickOpen(SDL_Joystick *joystick, int device_index)
|
|
|
SDL_SetBooleanProperty(SDL_GetJoystickProperties(joystick), SDL_PROP_JOYSTICK_CAP_TRIGGER_RUMBLE_BOOLEAN, true);
|
|
SDL_SetBooleanProperty(SDL_GetJoystickProperties(joystick), SDL_PROP_JOYSTICK_CAP_TRIGGER_RUMBLE_BOOLEAN, true);
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
-#ifdef GAMEINPUT_SENSOR_SUPPORT
|
|
|
|
|
|
|
+#if GAMEINPUT_API_VERSION >= 3
|
|
|
if (info->supportedInput & GameInputKindSensors) {
|
|
if (info->supportedInput & GameInputKindSensors) {
|
|
|
- // FIXME: What's the sensor update rate?
|
|
|
|
|
if (info->sensorsInfo->supportedSensors & GameInputSensorsGyrometer) {
|
|
if (info->sensorsInfo->supportedSensors & GameInputSensorsGyrometer) {
|
|
|
- SDL_PrivateJoystickAddSensor(joystick, SDL_SENSOR_GYRO, 250.0f);
|
|
|
|
|
|
|
+ SDL_PrivateJoystickAddSensor(joystick, SDL_SENSOR_GYRO, 60.0f);
|
|
|
}
|
|
}
|
|
|
if (info->sensorsInfo->supportedSensors & GameInputSensorsAccelerometer) {
|
|
if (info->sensorsInfo->supportedSensors & GameInputSensorsAccelerometer) {
|
|
|
- SDL_PrivateJoystickAddSensor(joystick, SDL_SENSOR_ACCEL, 250.0f);
|
|
|
|
|
|
|
+ SDL_PrivateJoystickAddSensor(joystick, SDL_SENSOR_ACCEL, 60.0f);
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
-#endif
|
|
|
|
|
|
|
+#endif // GAMEINPUT_API_VERSION >= 3
|
|
|
|
|
+
|
|
|
return true;
|
|
return true;
|
|
|
}
|
|
}
|
|
|
|
|
|
|
@@ -901,7 +896,7 @@ static void GAMEINPUT_JoystickUpdate(SDL_Joystick *joystick)
|
|
|
GAMEINPUT_ControllerUpdate(joystick, reading, timestamp);
|
|
GAMEINPUT_ControllerUpdate(joystick, reading, timestamp);
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
-#ifdef GAMEINPUT_SENSOR_SUPPORT
|
|
|
|
|
|
|
+#if GAMEINPUT_API_VERSION >= 3
|
|
|
if (hwdata->report_sensors) {
|
|
if (hwdata->report_sensors) {
|
|
|
GameInputSensorsState sensor_state;
|
|
GameInputSensorsState sensor_state;
|
|
|
|
|
|
|
@@ -924,7 +919,7 @@ static void GAMEINPUT_JoystickUpdate(SDL_Joystick *joystick)
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
-#endif // GAMEINPUT_SENSOR_SUPPORT
|
|
|
|
|
|
|
+#endif // GAMEINPUT_API_VERSION >= 3
|
|
|
|
|
|
|
|
reading->Release();
|
|
reading->Release();
|
|
|
|
|
|