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

Xinput controller support prototype #118

Draft
wants to merge 14 commits into
base: master
Choose a base branch
from

Conversation

fritzw
Copy link

@fritzw fritzw commented Mar 27, 2024

This PR is not ready for merging. It is a working prototype for #115 that should serve as a basis for discussion and that
should be reviewed by more experienced Clock engine developers. Since this is the first time I looked at the engine code (and the first time I played Clonk after about 20 years :D ), I probably got some things wrong.

A couple of things to note when reviewing:

  • I have put some thought how the old and new gamepad code might be combined, but I've skipped that for this prototype. The current version just replaces the legacy C4GamePadCon and gamepad functionality completely because it was quicker to do. Non-Xinput gamepads will not work with this version, unless a compatibility layer is used, and if they do, buttons likely won't match.
  • Keyboard input should work as before, judging from my quick tests.
  • The gamepad settings screen is currently broken and changes have to be made directly in C4Config.cpp or in the registry/config file. A new config screen would be needed that shows an image of a standard Xinput controller, where the user can click its buttons (or press a button) and then select the corresponding command from a predefined list.
  • I have not tested network play, and I suspect that the added COM_Jump and the changes in menu command handling in particular might break things in the network code. Any guidance would be appreciated, but for my use case (playing locally with my daughter) it is currently not that important.

PS: The icon set is my own design and I dedicate it to the public domain / CC0.

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.

1 participant