Use nanosecond timestamp for sensors (thanks @1bsyl!)
This commit is contained in:
parent
34bb0735d8
commit
b6646f4de5
3 changed files with 3 additions and 3 deletions
|
@ -156,7 +156,7 @@ static void SDL_ANDROID_SensorUpdate(SDL_Sensor *sensor)
|
||||||
int events;
|
int events;
|
||||||
ASensorEvent event;
|
ASensorEvent event;
|
||||||
struct android_poll_source *source;
|
struct android_poll_source *source;
|
||||||
Uint64 timestamp = SDL_GetTicks();
|
Uint64 timestamp = SDL_GetTicksNS();
|
||||||
|
|
||||||
if (ALooper_pollAll(0, NULL, &events, (void **)&source) == LOOPER_ID_USER) {
|
if (ALooper_pollAll(0, NULL, &events, (void **)&source) == LOOPER_ID_USER) {
|
||||||
SDL_zero(event);
|
SDL_zero(event);
|
||||||
|
|
|
@ -137,7 +137,7 @@ static int SDL_COREMOTION_SensorOpen(SDL_Sensor *sensor, int device_index)
|
||||||
|
|
||||||
static void SDL_COREMOTION_SensorUpdate(SDL_Sensor *sensor)
|
static void SDL_COREMOTION_SensorUpdate(SDL_Sensor *sensor)
|
||||||
{
|
{
|
||||||
Uint64 timestamp = SDL_GetTicks();
|
Uint64 timestamp = SDL_GetTicksNS();
|
||||||
|
|
||||||
switch (sensor->type) {
|
switch (sensor->type) {
|
||||||
case SDL_SENSOR_ACCEL:
|
case SDL_SENSOR_ACCEL:
|
||||||
|
|
|
@ -143,7 +143,7 @@ static HRESULT STDMETHODCALLTYPE ISensorEventsVtbl_OnStateChanged(ISensorEvents
|
||||||
static HRESULT STDMETHODCALLTYPE ISensorEventsVtbl_OnDataUpdated(ISensorEvents *This, ISensor *pSensor, ISensorDataReport *pNewData)
|
static HRESULT STDMETHODCALLTYPE ISensorEventsVtbl_OnDataUpdated(ISensorEvents *This, ISensor *pSensor, ISensorDataReport *pNewData)
|
||||||
{
|
{
|
||||||
int i;
|
int i;
|
||||||
Uint64 timestamp = SDL_GetTicks();
|
Uint64 timestamp = SDL_GetTicksNS();
|
||||||
|
|
||||||
SDL_LockSensors();
|
SDL_LockSensors();
|
||||||
for (i = 0; i < SDL_num_sensors; ++i) {
|
for (i = 0; i < SDL_num_sensors; ++i) {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue