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

[3.2] Add support for new SDL gamecontroller keywords. #45798

Merged
merged 1 commit into from
Feb 8, 2021

Conversation

madmiraal
Copy link
Contributor

3.2 version of #45797.

Note: This breaks compat, because it changes the value of JOY_BUTTON_MAX from 16 to 22. This, for example, will break Joypads Demo which uses it here.

The non-compat breaking alternative is to hardcode ignoring these new keywords as was done in #44062 with hint entries.

Personally, I think the benefit of providing support for these buttons outweighs the potential issues existing projects will have with dealing with the change in the enum reflecting the number of buttons supported.

@madmiraal madmiraal added this to the 3.2 milestone Feb 7, 2021
@madmiraal madmiraal requested a review from a team as a code owner February 7, 2021 17:50
@akien-mga
Copy link
Member

Note: This breaks compat, because it changes the value of JOY_BUTTON_MAX from 16 to 22. This, for example, will break Joypads Demo which uses it here.

I think it's OK to change the value if we're indeed adding support for more buttons, but I'm a bit wary about the impact this may have on GDNative compiled binaries? CC @vnen @BastiaanOlij

@BastiaanOlij
Copy link
Contributor

BastiaanOlij commented Feb 8, 2021

@akien-mga I don't think it will pose problems, GDNative doesn't interact directly with the structure but just with calls. It just won't know the max is increased unless you create a new api.json file but the calls to get the values will work just fine.

Note that in Godot 4 we've updated the maximum to 36, might want to do the same here instead of 22 if we're changing it anyway?

This will however break the joypad test app in our demo repo as it loops through all buttons and updates the UI but won't have 22 buttons to update. I think that demo should be made a little more resilient :) edit ah this was already noted in the OP :)

@akien-mga akien-mga merged commit e6101df into godotengine:3.2 Feb 8, 2021
@akien-mga
Copy link
Member

Thanks!

@madmiraal madmiraal deleted the add-new-sdl-keywords-3.2 branch February 8, 2021 16:14
@akien-mga akien-mga modified the milestones: 3.2, 3.3 Apr 20, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants