Commit graph

6283 commits

Author SHA1 Message Date
Sam Lantinga
79dab26796 Christoph Mallon: Use SDL_arraysize() 2013-08-29 08:26:55 -07:00
Sam Lantinga
8c2129f4b1 Christoph Mallon: Simplify assignment. 2013-08-29 08:26:24 -07:00
Sam Lantinga
aca1b3acc7 Christoph Mallon: Report an error, if creating the directories in SDL_GetPrefPath() failed. 2013-08-29 08:25:54 -07:00
Sam Lantinga
911e984c36 Christoph Mallon: Remove lone /* if */ comment. 2013-08-29 08:25:24 -07:00
Sam Lantinga
18517df9b2 Christoph Mallon: Simplify avoidance of duplicate / in SDL_GetPrefPath() 2013-08-29 08:24:43 -07:00
Ryan C. Gordon
44918e378d Change order we enumerate Windows joysticks.
Make it so XInput devices are listed before DirectInput devices, and that the XInput
 devices are sorted by userid in ascending numeric order (so device 0 comes first).
2013-08-28 22:09:17 -04:00
Ryan C. Gordon
e670fc63f1 Don't corrupt XInput device state during SDL_SYS_JoystickClose(). 2013-08-28 22:07:54 -04:00
Ryan C. Gordon
a2cce5ee08 Fix endlines for logging via OutputDebugString(). 2013-08-28 22:05:16 -04:00
Ryan C. Gordon
526597ad95 Make XInput joystick names match the numbers on the device.
(And how the Haptic code already names them.)
2013-08-28 17:17:21 -04:00
Ryan C. Gordon
cd94a10070 Fixed comment typo. 2013-08-28 17:12:07 -04:00
Ryan C. Gordon
6f21990987 Reworked XInput and DirectInput joystick code.
Now multiple XInput controllers map correctly to device indexes instead of grabbing
the first available userid, and are completely separated out from DirectInput.

Also, the hardcoded limitation on number of DirectInput devices is gone. I don't
expect there to really ever be more than eight joysticks plugged into a machine, but
it was a leftover limitation for a static array we didn't actually use anymore.

Fixes Bugzilla #1984. (etc?)

--HG--
extra : rebase_source : 103ce667c1cdd87a3691c9dd9eea2318bad908c8
2013-08-28 16:43:47 -04:00
Ryan C. Gordon
17c90f1186 Better XInput detection code for DirectInput device enumeration.
This code is way faster than the Wbem code, and less ugly.

--HG--
extra : rebase_source : cce46397251068b426e2ec267c15292aa0744386
2013-08-28 16:35:32 -04:00
Ryan C. Gordon
bbbade42fa Fixed testgamecontroller output to make sense.
--HG--
extra : rebase_source : 88c573edaf1da2153ada5b4f2c6893e91add2310
2013-08-28 00:07:02 -04:00
Gabriel Jacobo
777731aa02 [Linux] Test config script: Add the X11 library search path if it is not empty
If ac_x_libraries is empty it means that the library's found in the default path,
so we skip adding it to the XLIB variable as it screws up the search path.
2013-08-28 12:43:29 -03:00
Gabriel Jacobo
c80fc2858b Fixes test building 2013-08-28 10:41:25 -03:00
Gabriel Jacobo
4353b43e3f Fixes typo in EGL code (thanks jmcfarlane!) 2013-08-26 14:23:18 -03:00
Ryan C. Gordon
b61d361d2d Removed obvious comment to trigger buildbot. 2013-08-25 21:28:03 -04:00
Edward Rudd
7c3d505c9c reworked GetBasePath on OS X to use Contents/Resource by default if bundled, or exedir if not bundled.
- also adds OS X specific magic for bundled apps adding an Info.plist property of name SDL_FILESYSTEM_BASE_DIR_TYPE to the following values will change the bahaviour.
* bundle -- use the bundle directory e.g. "/Applications/MyGame/Blah.app/"
* parent -- use the bundle parent directory e.g. "/Applications/MyGame/"
* resource -- use the bundle resource directory (default) e.g. "/Applications/MyGame/Blah.app/Contents/Resources/"
2013-08-25 11:24:01 -04:00
Edward Rudd
2770375eb5 update xcode projects with filesystem API bits. (missing tests and missing from files from some targets) 2013-08-25 11:20:14 -04:00
Gabriel Jacobo
6dd2b54f38 Fixes "error: conflicting types for 'GLintptr'" 2013-08-25 11:48:49 -03:00
Ryan C. Gordon
1a56992a7d Minor FreeBSD code cleanup. 2013-08-24 21:15:10 -04:00
Edward Rudd
2bd35f683d make the examples in the doc comments match the actual output of the SDL_GetPrefPath function 2013-08-24 09:43:14 -04:00
Edward Rudd
455645d99a Fix #2062 Be more diligent about validating trailing "/" existence in HOME and XDG_DATA_HOME env vars
--HG--
extra : amend_source : f857f2c2d14cf1fca0d5a5f4ca95c8acef79797e
2013-08-24 09:05:18 -04:00
Ryan C. Gordon
e94b620dc6 Patched to compile on Solaris. 2013-08-23 23:34:23 -04:00
Ryan C. Gordon
327661011c Patched to compile on FreeBSD. 2013-08-23 21:48:40 -04:00
Ryan C. Gordon
b83dc371b8 Add support for some BSDs and Solaris to SDL_GetBasePath().
--HG--
extra : rebase_source : d2c9bc42ea618bcafdf8ec6c24d35d3123741fc6
2013-08-23 21:38:54 -04:00
Gabriel Jacobo
df31e201cb Fix warning in GL ES2 renderer 2013-08-22 17:26:22 -03:00
Gabriel Jacobo
65f76b93b9 Separate EGL / GL ES detection in CMake 2013-08-22 14:56:07 -03:00
Ryan C. Gordon
8f7192143e XAudio2/DirectSound: Use the usual Windows string convert (thanks, Norfanin!). 2013-08-22 13:32:27 -04:00
Ryan C. Gordon
20512dd292 Added SDL_VIDEO_OPENGL_ES2 to the SDL_config.h templates (Thanks, Kerim!). 2013-08-22 13:00:05 -04:00
Gabriel Jacobo
cd9a7c392c Fixes #2036 and #2038, bypass camera zoom and shutter keypresses on Android. 2013-08-22 10:22:22 -03:00
Sam Lantinga
34b9565f87 Fixed compiling on old versions of the DirectX SDK 2013-08-21 12:12:04 -07:00
Sam Lantinga
54d87dfc28 SDL
- detect that you tried to open a gamecontroller in xinput mode and failed, then re-get the mapping for the dinput variant you did open (and most likely now just fail the open)

CR: SamL
2013-08-21 10:32:04 -07:00
Sam Lantinga
8ddc481d35 Fix SDL xinput code to work at all when xinput has devices at high indexes but no device connected at lower index, for instance 0->disconnected, 1->wireles, 2->wired. Previously the SDL code assumed the indexes were always used up in order which is not true at all and lead to a bunch of failure cases where controllers would go unrecognized.
This entire function is kind of a mess and more complicated than needed, but I don't want to refactor it too heavily tonight.  May look at improving how the indexes are assigned more significanly later.  The way it handles not finding a valid "gamepad" type device is also super broken, it leaves in place the xinput bindings but opens the controller with dinput and ends up with completely wrong mappings, not solving that now, but fixing the bug where we'd very frequently not find a controller due to gaps in assigned player numbers should mostly avoid it.
2013-08-21 10:31:44 -07:00
Sam Lantinga
1afef302ac Fixed crash if the IC isn't set up for some reason (bad X11 locale?) 2013-08-21 10:07:48 -07:00
Gabriel Jacobo
332278ee6f Fix a couple of warnings 2013-08-21 10:34:32 -03:00
Gabriel Jacobo
3557ef7451 Patched to compile on Darwin 2013-08-21 10:27:39 -03:00
Gabriel Jacobo
91d5b012ad More fixes for -Wdeclaration-after-statement 2013-08-21 10:13:12 -03:00
Gabriel Jacobo
ac6a540788 Fixes for -Wdeclaration-after-statement 2013-08-21 10:12:16 -03:00
Gabriel Jacobo
298ce1c1a7 OCD fixes: Adds a space after /* (glory to regular expressions!) 2013-08-21 09:47:10 -03:00
Gabriel Jacobo
271e0d67c4 OCD fixes: Adds a space before */ 2013-08-21 09:43:09 -03:00
Ryan C. Gordon
0f758bdbfd Actually, this should be a memcpy().
We already know the exact length we just allocated, and we plan to append
 our own null terminator to the end of the copy, so this makes more sense.
2013-08-20 23:20:32 -04:00
Ryan C. Gordon
a03a7f7745 Added filesystem code to Mac and iOS Xcode projects. 2013-08-20 21:29:40 -04:00
Ryan C. Gordon
0d45b5b986 Patched to compile on iOS. 2013-08-20 21:21:57 -04:00
Ryan C. Gordon
aa07924132 More Haiku fixes. 2013-08-20 20:39:22 -04:00
Ryan C. Gordon
26992a5a9f Fixed compiler warning. 2013-08-20 20:31:57 -04:00
Ryan C. Gordon
56176b1b4b More Windows fixes for filesystem code. 2013-08-20 20:29:30 -04:00
Ryan C. Gordon
8fe6c7fae6 Regenerate configure script. 2013-08-20 20:27:42 -04:00
Ryan C. Gordon
708d2720cd Corrected Haiku build. 2013-08-20 20:16:15 -04:00
Ryan C. Gordon
4fef316c65 Patched new filesystem code to compile. 2013-08-20 20:15:15 -04:00