Added a dummy sensor driver

This commit is contained in:
Sam Lantinga
2018-08-21 13:29:21 -07:00
parent 7c3040e08a
commit 3e5dbc694a
21 changed files with 296 additions and 31 deletions

View File

@@ -33,12 +33,12 @@
#endif
static SDL_SensorDriver *SDL_sensor_drivers[] = {
#if 0 //defined(__IPHONEOS__) || defined(__TVOS__)
&SDL_IOS_SensorDriver,
#endif
#ifdef SDL_SENSOR_ANDROID
&SDL_ANDROID_SensorDriver,
#endif
#if defined(SDL_SENSOR_DUMMY) || defined(SDL_SENSOR_DISABLED)
&SDL_DUMMY_SensorDriver
#endif
};
static SDL_Sensor *SDL_sensors = NULL;
static SDL_bool SDL_updating_sensor = SDL_FALSE;
@@ -78,11 +78,6 @@ SDL_SensorInit(void)
}
#endif /* !SDL_EVENTS_DISABLED */
if (SDL_arraysize(SDL_sensor_drivers) == 0) {
/* What should we return here? We'll just return 0 with no sensors for now. */
status = 0;
}
status = -1;
for (i = 0; i < SDL_arraysize(SDL_sensor_drivers); ++i) {
if (SDL_sensor_drivers[i]->Init() >= 0) {