Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ANDROID: Add touch 3D mode to 2D backend #3628

Merged
merged 8 commits into from Jan 2, 2022

Conversation

@lephilousophe
Copy link
Member

@lephilousophe lephilousophe commented Dec 25, 2021

These changes allow:

  • use of touch 3D mode emulating a D-Pad to be used in 2D games
  • the user to switch mode at will

To make this happen, a change in OpenGL backend is necessary to allow drawing of clipped textures.
The interface of Android 3D backend textures has been slightly reworked to avoid exposing internal functions.
Finally, the image used to draw the touch controls has been converted to PNG and the Android runtime is used to load it instead of doing it using our code. This make loading the PNG not depending on PNG support in ScummVM code.

@antoniou79
Copy link
Contributor

@antoniou79 antoniou79 commented Dec 27, 2021

Looks good to me.
Tested with Grim Fandango, TLJ , Myst 3 and LBA (not 3d), Secret of Monkey Island on Android arm64-v8a (Android 10) and on an arm-v7a (Android 4.4.4). It works ok.
Some issues to consider or fix later on (not merge stoppers):

  • on LBA switching to the joystick control mode, the overlay icons lack transparency. Maybe this has to do with LBA being a non-3d engine?
  • Would it make sense to have the overlay icons as SVG?

@lephilousophe
Copy link
Member Author

@lephilousophe lephilousophe commented Jan 1, 2022

  • on LBA switching to the joystick control mode, the overlay icons lack transparency. Maybe this has to do with LBA being a non-3d engine?

I have seen this bug too and was wondering why.
I finally found the reason: the blend mode had to be configured.
For this, I need to make the back buffer object accessible to android graphics backend.

@lephilousophe lephilousophe merged commit 92dd9c0 into scummvm:master Jan 2, 2022
7 of 8 checks passed
@lephilousophe lephilousophe deleted the android-touch branch Jan 2, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants