Commit graph

83 commits

Author SHA1 Message Date
Philipp Wiesemann
a4432d3cdf Corrected confusing indentation in C source file. 2013-04-29 23:50:27 +02:00
Jørgen P. Tjernø
e4b6ac8025 Fix overflow in recent gamecontroller trigger change. 2013-04-19 16:02:16 -07:00
Jørgen P. Tjernø
12a26f7c35 Make gamecontroller triggers have values in 0 - 32767.
This changes the old behavior of having values in the -32768 - 32767
range, like regular joystick axis. Now "button as axis" triggers (like
on Logitech controllers) and regular axis triggers (like on Xbox
controllers) have the same resting value, 0.
2013-04-19 10:51:21 -07:00
Jørgen P. Tjernø
cbd1884115 Add 3 Logitech gamecontroller mappings for Mac OS X. 2013-04-03 16:48:20 -07:00
Jørgen P. Tjernø
4926901d46 Add new controller mappings for Windows. 2013-04-02 18:09:30 -07:00
Ryan C. Gordon
4f438b70a2 Make SDL_SetError and friends unconditionally return -1.
This lets us change things like this...

    if (Failed) {
        SDL_SetError("We failed");
        return -1;
    }

...into this...

    if (Failed) {
        return SDL_SetError("We failed");
    }


 Fixes Bugzilla #1778.
2013-03-31 12:48:50 -04:00
Sam Lantinga
aff63d09c2 Added support for the GameStop Gamepad 2013-03-25 12:04:16 -07:00
Jørgen P. Tjernø
ae480eecfd Missing comma in one gamepad mapping. 2013-03-12 18:28:40 -07:00
Jørgen P. Tjernø
fc436807a8 Add GameController mappings for popular controllers.
This adds mappings for:
  - Another type of wired X360 controller
  - A wireless X360 controller
  - Logitech F710 (XInput and DInput modes)
  - Logitech F310 (XInput mode)
  - Logitech Cordless RumblePad 2
2013-03-12 18:28:36 -07:00
Sam Lantinga
7f2340dc6a Don't re-read the hints when opening the game controller. Instead use SDL_GameControllerAddMapping() to add hints after initialization. 2013-03-08 10:09:51 -08:00
Sam Lantinga
0707530b35 Load the game controller mapping hint when opening a game controller. 2013-03-07 15:37:08 -08:00
Sam Lantinga
1dec4dd800 Fixed read after free bug in the game controller. 2013-03-07 15:17:06 -08:00
Edward Rudd
5fd98b3297 add new gamecontroller APIs
- add mappings after init (or even before w/o using the hint)
- get string for axis
- get string for button
- get mapping string for controller or for GUID
- new event to notify when a controller is remapped. (e.g. mapping was changed via the AddMapping method)
2013-03-05 17:59:36 -05:00
Sam Lantinga
2204530a1b Fixed gcc pedantic warnings in public headers 2013-02-26 20:41:28 -08:00
Ryan C. Gordon
ad1d82cf83 Added SDL_GameControllerUpdate(). 2013-02-25 01:51:21 -05:00
Ryan C. Gordon
a5862a96a3 Changed the game controller enum types to match SDL naming conventions. 2013-02-25 00:56:21 -05:00
Ryan C. Gordon
3d19f803d8 Added PS3 game controller config for Linux. 2013-02-25 00:45:25 -05:00
Ryan C. Gordon
6c4a53f561 Fixed a minor typo. 2013-02-24 22:56:35 -05:00
Ryan C. Gordon
2452978990 Added an X360 game controller config for Linux. 2013-02-24 22:56:24 -05:00
Sam Lantinga
95dcfa4c28 Happy New Year! 2013-02-15 08:47:44 -08:00
Jørgen P. Tjernø
e34e953eba Check bounds in SDL_IsGameController. Switch two functions to SDL_bool.
Switches SDL_GameControllerGetAttached and SDL_IsGameController to
       return SDL_bool, instead of int.
2013-02-12 17:07:21 -08:00
Sam Lantinga
b836001559 Hopefully fixed the last of the C variable declaration problems which caused compile failures with Visual Studio. 2013-02-11 18:28:05 -08:00
Sam Lantinga
57163e457f Fixed C variable declarations 2013-02-11 18:13:52 -08:00
Sam Lantinga
e2aa9f0afb Fixed compiler warning (and undefined behavior) in game controller event filter. 2013-02-11 17:25:58 -08:00
Sam Lantinga
b73214bd02 tree 97aca305664b
parent 6a9ca692cd65
author Edward Rudd <urkle@outoforder.cc> 1358030048 18000
committer Edward Rudd <urkle@outoforder.cc> 1358030048 18000
revision 6822
branch default

rework and fix handling of hat to button mappings

- doesn't assume it's always mapped to dpad
- properly handles multiple hats (up to 4)
- properly handles multiple presses (e.g. up and right)
- properly handles multiple gamepads
2013-02-11 11:21:54 -08:00
Sam Lantinga
290c391df5 tree 0c86a223596d
parent 44e12dd8ee8e
author Edward Rudd <urkle@outoforder.cc> 1358030047 18000
committer Edward Rudd <urkle@outoforder.cc> 1358030047 18000
revision 6821
branch default

Fix a bad mapping from "axis" to "button"
2013-02-11 11:21:19 -08:00
Sam Lantinga
65399f4c26 tree 8cbca1e6b293
parent 7ddddb71cec9
author Edward Rudd <urkle@outoforder.cc> 1358030045 18000
committer Edward Rudd <urkle@outoforder.cc> 1358030045 18000
revision 6820
branch default

Consolidate iterating the SupportedControllers array

also fix memory leak when controller mapping not found
2013-02-11 11:20:49 -08:00
Sam Lantinga
4cec546dca Fixed crash when the game controller mapping hint is set - the hint was duplicated and not null terminated. 2013-01-25 14:25:19 -08:00
Sam Lantinga
89ef9e3168 Changes from Alfred:
- rename JoystickGUID -> SDL_JoystickGUID
- change SDL_JoystickGetGUIDString to take the string as an arg, rather than doing a malloc
2012-12-11 11:54:32 -08:00
Sam Lantinga
b165aa8c74 Fixed compiler warnings 2012-11-27 01:07:44 -08:00
Sam Lantinga
cf0dfcbaa4 Fixed unused variable warning 2012-11-26 23:53:18 -08:00
Sam Lantinga
86e0e26475 The XInput code is only available in the DirectInput joystick driver. 2012-11-26 23:50:12 -08:00
Sam Lantinga
34b88dfaae Added hotplug joystick support and simplified game controller API, courtesy of Alfred Reynolds 2012-11-26 16:37:54 -08:00