Fixed bug #13493: Assertion failure at SDL_AddTouch with Android API 28

Java touch id should be -1 because it's reserved for internal SDL
synthetic events.
It should also not be 0, because this is SDL invalid value.
This commit is contained in:
Sylvain authored and Sylvain Becker committed 2025-08-12 18:34:42 +02:00
1 parent 6e422e5ff2
commit 970c0bfe96
3 files changed
+23 -6

No files matched your search

+2 -1
View File
@@ -1080,7 +1080,8 @@ JNIEXPORT void JNICALL SDL_JAVA_INTERFACE(nativeAddTouch)(
{
const char *utfname = (*env)->GetStringUTFChars(env, name, NULL);
SDL_AddTouch((SDL_TouchID)touchId, SDL_TOUCH_DEVICE_DIRECT, utfname);
SDL_AddTouch(Android_ConvertJavaTouchID(touchId),
SDL_TOUCH_DEVICE_DIRECT, utfname);
(*env)->ReleaseStringUTFChars(env, name, utfname);
}