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

Disable SDL2 conversion of touch->mouse and mouse->touch on all platforms not just iOS/Android #176

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

hippydave
Copy link

By default, SDL2 simulates mouse events from real touch input, and simulates touch events from real mouse input. This project doesn't require either of those, because it handles both touch and mouse inputs itself.

The existing code specifically disables both these simulation features when the platform is iOS, and also when the platform is Android. This likely covers most touchscreen gadgets being used, but when run on a different platform with a touchscreen (in my case, a Nintendo Switch running Linux), the touchscreen events are duplicated as simulated mouse events, leading to the mouse cursor jumping after a movement is finished, as I created an issue about.

I'm happy to be corrected if I'm wrong, but I can't see any downside to disabling these SDL2 features for all platforms, simulation of touch or mouse never being required because the game handles both. Let me know if anything needs improving, ty.

src/movie_lib.cc Outdated
@@ -99,7 +99,7 @@ static void _nfPkDecomp(unsigned char* buf, unsigned char* a2, int a3, int a4, i

static constexpr uint16_t loadUInt16LE(const uint8_t* b);
static constexpr uint32_t loadUInt32LE(const uint8_t* b);
static uint8_t getOffset(uint16_t v);
static int getOffset(uint16_t v);
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The change in this file seems to be related to the #188.

Copy link
Author

@hippydave hippydave Jun 2, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, I didn't realise that pushing an unrelated commit (for fixing the movies) on my fork's main branch would add it to this pull request. I should undo that.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants