* Find the SDL_Sensor that owns this instance id */
| 284 | * Find the SDL_Sensor that owns this instance id |
| 285 | */ |
| 286 | SDL_Sensor * |
| 287 | SDL_SensorFromInstanceID(SDL_SensorID instance_id) |
| 288 | { |
| 289 | SDL_Sensor *sensor; |
| 290 | |
| 291 | SDL_LockSensors(); |
| 292 | for (sensor = SDL_sensors; sensor; sensor = sensor->next) { |
| 293 | if (sensor->instance_id == instance_id) { |
| 294 | break; |
| 295 | } |
| 296 | } |
| 297 | SDL_UnlockSensors(); |
| 298 | return sensor; |
| 299 | } |
| 300 | |
| 301 | /* |
| 302 | * Checks to make sure the sensor is valid. |