Commit graph

22 commits

Author SHA1 Message Date
Philipp Wiesemann
2a8a7f92b7 Fixed empty parameter list in signatures of internal functions. 2016-11-16 22:08:51 +01:00
Sam Lantinga
f98a06ec45 Added SDL_PrivateJoystickAdded() and SDL_PrivateJoystickRemoved()
Updated the removal code to iterate over all joystick add messages instead of just the first one.
2016-08-26 12:18:08 -07:00
Philipp Wiesemann
7d1e740ea2 Emscripten: Fixed crash if closing removed joystick (thanks, Sylvain!). 2016-08-25 22:31:44 +02:00
Philipp Wiesemann
7cc86e8e8d Emscripten: Fixed opening previously closed joystick. 2016-08-17 21:04:50 +02:00
Sam Lantinga
7ee8dda270 Updated copyright to 2016 2016-01-02 10:10:34 -08:00
Philipp Wiesemann
0c6558d987 Emscripten: Changed return -1 after SDL_SetError() to return SDL_SetError(). 2015-08-09 20:00:51 +02:00
Philipp Wiesemann
3f92e7f9b6 Emscripten: Added missing error messages for audio and joystick init failures. 2015-08-05 21:04:10 +02:00
Sam Lantinga
56b58afdbe Updated the copyright year to 2015 2015-05-26 06:27:46 -07:00
Philipp Wiesemann
fc24a2d81e Fixed typo in internal joystick documentation comments. 2015-04-15 21:29:55 +02:00
Philipp Wiesemann
bb9dd1ec0c Emscripten: Simplified implementation of joystick update function.
The function was implemented using four loops but only needed two.
2015-04-15 21:27:10 +02:00
Ryan C. Gordon
3ff618a9c7 Cleanups in the joystick code.
Removed some redundant state and other confusions.

Fixes Bugzilla #2738.

--HG--
extra : rebase_source : 35dd561553379e00eb8d169ce12ecc99393b2f84
2015-03-24 13:52:01 -04:00
Philipp Wiesemann
bde0ce0969 Updated internal documentation comments. 2015-03-11 21:14:21 +01:00
Philipp Wiesemann
e4f4a0e0af Emscripten: Fixed out of range joystick device index after joystick disconnect.
After disconnecting a joystick the remaining kept their original device index.
This was not correct because the device index must be a number between 0 and
SDL_NumJoysticks(). It was fixed with ideas from SDL's joystick implementation
for Android. Some range checks were removed as the caller already checks them.
2015-02-22 23:21:32 +01:00
Philipp Wiesemann
eb9d379503 Emscripten: Fixed sending button and motion events for not opened joysticks.
SDL_SYS_JoystickUpdate() was implemented incorrectly. For every call to it all
attached joysticks were checked. But actually only the given SDL_Joystick should
be checked then. This allowed sending broken events for attached but not opened
joysticks. It also checked the opened joysticks more often than actually needed.
2015-02-22 21:00:35 +01:00
Philipp Wiesemann
1a2231c115 Emscripten: Fixed receiving joystick events after failed init or subsystem quit.
The callbacks used to receive the HTML events were not removed if the joystick
subsystem initialization failed or if the joystick subsystem was quit. Also, the
already connected joysticks were not deleted if the initialization failed later.
2015-02-18 21:34:07 +01:00
Philipp Wiesemann
6c134a60d0 Emscripten: Removed unused internal function. 2015-02-15 21:47:10 +01:00
Philipp Wiesemann
34e9ba9c45 Emscripten: Changed return type of callback implementations from int to EM_BOOL.
The prototypes are declared with EM_BOOL (which is currently an int) in html5.h.
2015-02-15 21:44:36 +01:00
Philipp Wiesemann
e18cf07b3a Emscripten: Fixed sending SDL_JOYDEVICEADDED events with an index out of range.
SDL_JOYDEVICEADDED events must contain the device index which is a value between
0 and the number of connected joysticks. The old implementation included a value
based on the instance id instead. It worked in some cases because the values are
similar initially. But after disconnecting joysticks this is no more the case
and the always increasing instance id becomes larger than number of joysticks.
2015-02-14 15:22:04 +01:00
Philipp Wiesemann
3c70a54e6d Emscripten: Deactivated and corrected debug log messages on joystick events. 2015-02-14 15:16:41 +01:00
Ryan C. Gordon
0bdc0eedb8 Cleaned up some compiler warnings. 2014-12-26 23:16:54 -05:00
Philipp Wiesemann
86eaa23de4 Fixed compile warnings about unused variables.
Found by buildbot.
2014-12-25 22:03:07 +01:00
Ryan C. Gordon
de88474dda Initial merge of Emscripten port!
With this commit, you can compile SDL2 with Emscripten
( http://emscripten.org/ ), and make your SDL-based C/C++ program
into a web app.

This port was due to the efforts of several people, including: Charlie Birks,
Sathyanarayanan Gunasekaran, Jukka Jylänki, Alon Zakai, Edward Rudd,
Bruce Mitchener, and Martin Gerhardy. (Thanks, everyone!)

--HG--
extra : rebase_source : 97af74c8a5121e926ebe89f123536b5dd6681695
2014-12-18 00:19:52 -05:00