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

Improve gamepad support #17

Merged
merged 17 commits into from
Mar 21, 2016
Merged

Commits on Feb 13, 2016

  1. Re-enable gamepad controls

    lluchs committed Feb 13, 2016
    Configuration menu
    Copy the full SHA
    9c84072 View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    bd3f020 View commit details
    Browse the repository at this point in the history
  3. Update key code strings for game controllers

    With the SDL_GameController interface, buttons and axes have actual
    names we can refer to. This also allows for advanced mappings using both
    sticks (this probably needs script changes) as well as the triggers.
    lluchs committed Feb 13, 2016
    Configuration menu
    Copy the full SHA
    937ddaf View commit details
    Browse the repository at this point in the history

Commits on Feb 21, 2016

  1. Implement "gamepad stick moved" events for analog input

    Analog moved events are only sent once per control frame.
    lluchs committed Feb 21, 2016
    Configuration menu
    Copy the full SHA
    8dd1450 View commit details
    Browse the repository at this point in the history
  2. Fix openclonk-server build

    SDL usage is masked with HAVE_SDL checks so it should work without SDL,
    but SDL has to be linked when it's available.
    lluchs committed Feb 21, 2016
    Configuration menu
    Copy the full SHA
    1147d1a View commit details
    Browse the repository at this point in the history
  3. Make GetPlayerControlState() query the current controller state

    To keep compatibility with scripts which expect only binary buttons,
    this adds a third parameter to the function which enables the new
    functionality.
    
    Bonus /script to test the controller stick x axis:
    
        Schedule(GetCursor(), "Message(\"%d / %d\", GetPlayerControlState(0, CON_Left, true), GetPlayerControlState(0, CON_Right, true))", 10, 100000000)
    
    Note that the values will be inconsistent if multiple analog sticks are
    bound to the same control, as values from one stick will overwrite those
    from the other one. This can happen even if you move only one stick.
    lluchs committed Feb 21, 2016
    Configuration menu
    Copy the full SHA
    985f1b9 View commit details
    Browse the repository at this point in the history
  4. Update main menu GUI gamepad control bindings

    It is now possible to control all GUI menus using the left stick or the
    dpad, along with the A and B buttons on the controller.
    
    This also doubles the button emulation dead zone to make navigating the
    menus with the stick easier.
    lluchs committed Feb 21, 2016
    Configuration menu
    Copy the full SHA
    24622f3 View commit details
    Browse the repository at this point in the history
  5. Make controller button strings nicer

    This also removes the controller id from the control definitions,
    instead defaulting to 0. This doesn't change anything for now as we only
    had definitions for controller 0 anyways.
    lluchs committed Feb 21, 2016
    Configuration menu
    Copy the full SHA
    aa42d1d View commit details
    Browse the repository at this point in the history
  6. Remove unused and unimplemented gamepad functions

     - GamePadControl::AnyButtonDown
     - GamePadOpener::SetGamePad
    lluchs committed Feb 21, 2016
    Configuration menu
    Copy the full SHA
    046cacc View commit details
    Browse the repository at this point in the history
  7. Implement controller rumbling

    New script functions:
     - PlayRumble(int plr, int strength, int length)
     - StopRumble(int plr)
    lluchs committed Feb 21, 2016
    Configuration menu
    Copy the full SHA
    7155ff9 View commit details
    Browse the repository at this point in the history
  8. Configuration menu
    Copy the full SHA
    9e9505f View commit details
    Browse the repository at this point in the history
  9. Use icons for all controller buttons

    The icons currently only show Xbox 360 controller labeling. The icon set
    also includes icons for PlayStation controllers, so we could extend this
    in the future.
    lluchs committed Feb 21, 2016
    Configuration menu
    Copy the full SHA
    9f69c65 View commit details
    Browse the repository at this point in the history
  10. Remove gamepad ids from key codes

    We want one gamepad key mapping to work with multiple gamepads, so
    including the id there doesn't make sense.
    
    Additionally, the gamepad id may change during the game (controller
    hot-plugging).
    lluchs committed Feb 21, 2016
    Configuration menu
    Copy the full SHA
    9e0143b View commit details
    Browse the repository at this point in the history

Commits on Feb 23, 2016

  1. Make C4GamePadControl manage all controllers

    The available gamepads are distributed automatically among players.
    
    This also implements controller hot-plugging: It is possible to start a
    game without a controller and plug it in later, and to reconnect a
    controller after plugging it out.
    lluchs committed Feb 23, 2016
    Configuration menu
    Copy the full SHA
    8811356 View commit details
    Browse the repository at this point in the history
  2. Fix gamepads only working after game start

    This affected all platforms other than SDL.
    lluchs committed Feb 23, 2016
    Configuration menu
    Copy the full SHA
    e52bf69 View commit details
    Browse the repository at this point in the history

Commits on Feb 26, 2016

  1. Configuration menu
    Copy the full SHA
    2d47470 View commit details
    Browse the repository at this point in the history

Commits on Mar 6, 2016

  1. Make Windows build great again!

    ckanibal committed Mar 6, 2016
    Configuration menu
    Copy the full SHA
    8f31ae2 View commit details
    Browse the repository at this point in the history