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

fix: Remove hardcoded values for Gamepad class #555

Merged
merged 1 commit into from
Oct 10, 2022
Merged

Conversation

pktiuk
Copy link
Member

@pktiuk pktiuk commented Oct 10, 2022

It caused showing too many unused buttons for gamepads

Discovered thank to comment: #307 (comment) pointing at 21 unused buttons on gamepad

@pktiuk
Copy link
Member Author

pktiuk commented Oct 10, 2022

@Ryochan7
Do you recall why you hardcoded this value in a56e131#diff-253855c34594bb55bf610813b99ac04aacad337e782425fd1be36d97c71fd234?
It was a really big commit, so I assume, that it was a minor mistake.

@pktiuk
Copy link
Member Author

pktiuk commented Oct 10, 2022

There is similar situation with getNumberRawAxes and getNumberRawHats

@Ryochan7
Copy link
Contributor

SDL_CONTROLLER_BUTTON_MAX corresponded to the number of buttons that were exposed for a device via the SDL GameController API. I'm not sure about now but that number was fixed while I was still working on Antimicro. Normal joystick device handling uses the appropriate SDL calls to obtain the number of buttons and axes for an input device.

@pktiuk
Copy link
Member Author

pktiuk commented Oct 10, 2022

Thank you for quick response :)

It caused showing wrong numbers of elements of gamepad and rendering too many unused buttons.
@pktiuk pktiuk changed the title fix: Remove hardcoded number of Gamepad buttons fix: Remove hardcoded values for Gamepad class Oct 10, 2022
@pktiuk pktiuk merged commit 35c0089 into master Oct 10, 2022
@pktiuk pktiuk deleted the gamepad_button_number branch October 10, 2022 17:38
@pktiuk
Copy link
Member Author

pktiuk commented Oct 24, 2022

This fix caused: #579
To be reverted.
It seems that SDL sometimes returns wrong number of buttons.

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.

2 participants