-
Notifications
You must be signed in to change notification settings - Fork 52
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
This required fixing an issuew with SDL sensor events using a removed API.
- Loading branch information
Showing
5 changed files
with
51 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
Backport ALooper_poolAll fix. | ||
|
||
From: Tom Rothamel <[email protected]> | ||
|
||
From https://github.com/libsdl-org/SDL/pull/9807 | ||
--- | ||
src/sensor/android/SDL_androidsensor.c | 17 ++++++++++++----- | ||
1 file changed, 12 insertions(+), 5 deletions(-) | ||
|
||
diff --git a/src/sensor/android/SDL_androidsensor.c b/src/sensor/android/SDL_androidsensor.c | ||
index e6cfc23..d4179bf 100644 | ||
--- a/src/sensor/android/SDL_androidsensor.c | ||
+++ b/src/sensor/android/SDL_androidsensor.c | ||
@@ -163,7 +163,7 @@ SDL_ANDROID_SensorOpen(SDL_Sensor *sensor, int device_index) | ||
sensor->hwdata = hwdata; | ||
return 0; | ||
} | ||
- | ||
+ | ||
static void | ||
SDL_ANDROID_SensorUpdate(SDL_Sensor *sensor) | ||
{ | ||
@@ -171,10 +171,17 @@ SDL_ANDROID_SensorUpdate(SDL_Sensor *sensor) | ||
ASensorEvent event; | ||
struct android_poll_source* source; | ||
|
||
- if (ALooper_pollAll(0, NULL, &events, (void**)&source) == LOOPER_ID_USER) { | ||
- SDL_zero(event); | ||
- while (ASensorEventQueue_getEvents(sensor->hwdata->eventqueue, &event, 1) > 0) { | ||
- SDL_PrivateSensorUpdate(sensor, event.data, SDL_arraysize(event.data)); | ||
+ while (1) { | ||
+ int result = ALooper_pollOnce(0, NULL, &events, (void**)&source); | ||
+ if (result == LOOPER_ID_USER) { | ||
+ SDL_zero(event); | ||
+ while (ASensorEventQueue_getEvents(sensor->hwdata->eventqueue, &event, 1) > 0) { | ||
+ SDL_PrivateSensorUpdate(sensor, event.data, SDL_arraysize(event.data)); | ||
+ } | ||
+ } | ||
+ | ||
+ if (result <0) { | ||
+ break; | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,10 @@ | ||
old/ | ||
|
||
android-ndk-r25c-linux.zip | ||
android-ndk-r27c-linux.zip | ||
CubismSdkForNative-4-r.6.2.zip | ||
iPhoneOS14.0.sdk.tar.gz | ||
iPhoneSimulator14.0.sdk.tar.gz | ||
llvm-mingw-20220906-ucrt-ubuntu-18.04-x86_64.tar.xz | ||
llvm-mingw-* | ||
MacOSX10.10.sdk.tar.bz2 | ||
MacOSX12.3.sdk.tar.bz2 | ||
steamworks_sdk_160.zip |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters