diff --git a/android/README.md b/android/README.md index 2d45386..42ae824 100644 --- a/android/README.md +++ b/android/README.md @@ -36,13 +36,12 @@ cd xsystem35-sdl2/android ## How to use 1. Create a ZIP file containing all the game files (`*.ALD`) and [configuration files](https://haniwa.technology/games/preparing-a-game-directory.html), and transfer it to your device. 2. When you start the app, a file chooser opens. Select the zip file. -3. The game starts. +3. The game starts. Two-finger touch is treated as a right click. 4. Game data persists in the app's internal storage. Use the device's Settings app if you want to clear it (eg. before installing another game). Note that this Android port is still in early development; see below. ## TODO -- Right-click emulation - Save / Load support - Better launcher - MP3 / MIDI BGM support (currently only ogg is supported) diff --git a/src/sdl_event.c b/src/sdl_event.c index b85bd03..a5521fb 100644 --- a/src/sdl_event.c +++ b/src/sdl_event.c @@ -162,7 +162,7 @@ static void sdl_getEvent(void) { break; case SDL_FINGERDOWN: - if (SDL_GetNumTouchFingers(SDL_GetTouchDevice(0)) >= 2) { + if (SDL_GetNumTouchFingers(e.tfinger.touchId) >= 2) { mouseb &= ~(1 << SDL_BUTTON_LEFT); mouseb |= 1 << SDL_BUTTON_RIGHT; RawKeyInfo[mouse_to_rawkey(SDL_BUTTON_LEFT)] = FALSE; @@ -176,7 +176,7 @@ static void sdl_getEvent(void) { break; case SDL_FINGERUP: - if (SDL_GetNumTouchFingers(SDL_GetTouchDevice(0)) == 0) { + if (SDL_GetNumTouchFingers(e.tfinger.touchId) == 0) { mouseb &= ~(1 << SDL_BUTTON_LEFT | 1 << SDL_BUTTON_RIGHT); RawKeyInfo[mouse_to_rawkey(SDL_BUTTON_LEFT)] = FALSE; RawKeyInfo[mouse_to_rawkey(SDL_BUTTON_RIGHT)] = FALSE;