Commit Graph

11804 Commits

Author SHA1 Message Date
Sam Lantinga
0b19bdcd31 Fixed compiler warning 2020-01-29 20:09:16 -08:00
Sam Lantinga
7bcfb1bcfb Added SDL_hidapi_steam.c to the iOS and tvOS dylib build targets 2020-01-29 20:09:14 -08:00
Sam Lantinga
6e060358b8 There are lots of unused macros in the Steam controller code 2020-01-29 20:09:12 -08:00
Sam Lantinga
5c64f44a9f Added support for the Steam Controller on mobile devices 2020-01-29 20:09:11 -08:00
Sam Lantinga
4946ec1ef4 Miscellaneous pending fixes 2020-01-29 20:09:08 -08:00
Sam Lantinga
706579f0c6 Fixed member order to make more sense 2020-01-28 21:41:13 -08:00
Sam Lantinga
e24a78ff3d Fixed wired PS4 controller support on Android 2020-01-28 17:11:17 -08:00
Ryan C. Gordon
2e0e4c66d3 x11: Use XSync when changing window position instead of XFlush.
Attempt to fix regression in Bugzilla #4646.
2020-01-28 13:51:24 -05:00
Ryan C. Gordon
a928dfb170 cocoa: Fix command line apps' menu bar not working on macOS Catalina.
Fixes Bugzilla #4937.
2020-01-27 17:15:12 -05:00
Ryan C. Gordon
895dbc38e2 darwin: Don't pass NULL device refs to IOHIDDeviceGetValue().
Possibly fixes Bugzilla #4961.
2020-01-27 15:44:48 -05:00
Ryan C. Gordon
c85a100cd1 video: Added a hint to override the display's usable bounds. 2020-01-27 10:58:30 -05:00
Sam Lantinga
e332b6d728 Fixed bug 4898 - No rumble because of integer overflow in SDL_JoystickRumble
meyraud705

Switch hidapi and xinput also need to check for overflow, attached a patch for them.
2020-01-26 12:48:35 -08:00
Sam Lantinga
653bb0c793 Don't enumerate devices we can't open 2020-01-26 12:40:32 -08:00
Sam Lantinga
ee44fcea94 Fixed disabling the Xbox 360 wireless HIDAPI driver 2020-01-26 10:32:39 -08:00
Sam Lantinga
80279fb512 Always release devices in onPause in case we're going to be force stopped, and for consistency with interacting with other activities that might use the controller 2020-01-26 00:37:48 -08:00
Sam Lantinga
4addbff471 Fixed compiler warnings 2020-01-23 22:24:24 -08:00
Sam Lantinga
3e419c8c9f Fixed mapping for both versions of the Xbox One Elite Series 2 controller firmware connecting over Bluetooth 2020-01-23 12:53:43 -08:00
Sam Lantinga
c972e7c75e Added mapping for the Xbox One controller connected via the wireless dongle using xow 2020-01-23 12:53:41 -08:00
Sam Lantinga
3d12f83be5 Turn off rumble on drivers which don't respect the replay.length value 2020-01-23 12:53:39 -08:00
Sam Lantinga
dbd5926a65 SDL_LEAN_AND_MEAN defaults off 2020-01-23 01:03:23 -08:00
Sam Lantinga
698cde1a8b Added a single SDL_LEAN_AND_MEAN define to turn on minimal SDL builds
Protected more code with #ifdefs to reduce the size of minimal shared library builds
2020-01-23 01:00:52 -08:00
Sam Lantinga
7389baad7b Fixed compile warning 2020-01-23 00:32:34 -08:00
Sam Lantinga
a58e34f4f6 Added support for the paddles on the Xbox One Elite Series 1 controller 2020-01-22 11:28:35 -08:00
Sylvain Becker
0f4b8e30b8 Documentation of the footprint #defines 2020-01-22 15:23:44 +01:00
Ryan C. Gordon
52fbd467f2 audio: Fixed a '//' style comment. 2020-01-21 17:40:16 -05:00
Ryan C. Gordon
c8b33b868e audio: Calculate a legitimate SDL_AudioSpec::silence in SDL_LoadWAV_RW(). 2020-01-21 15:49:37 -05:00
Sylvain Becker
4d9985406a Add #define SDL_HAVE_BLIT_N_RGB565 to compile out RGB565 LUT 2020-01-21 22:06:09 +01:00
Sylvain Becker
a992fe0007 A few #defines to reduce SDL2 footprint.
Only applied when library is statically linked
2020-01-21 21:33:40 +01:00
Sam Lantinga
2c2b61b9b3 The Xbox One 0x01 initialization packet is an ack packet 2020-01-20 13:53:40 -08:00
Sam Lantinga
9ad48f2b2d Refactored code so SDL_GetJoystickGameControllerType() is called less during controller detection 2020-01-19 11:43:36 -08:00
Sam Lantinga
da8e6b1cb5 Added missing file from previous commit 2020-01-18 11:21:42 -08:00
Sam Lantinga
e33ebdcc6a Added support for detecting previously unknown Xbox 360 and Xbox One controllers using the HIDAPI driver with libusb and Android 2020-01-18 11:21:14 -08:00
Sam Lantinga
39e4249b8c There are multiple bindings for XBox One controller model 1708, depending on firmware revision 2020-01-17 11:09:57 -08:00
Sam Lantinga
055acce4b2 Added support for the NACON GC-400ES 2020-01-17 11:07:19 -08:00
Sam Lantinga
e82dc25ab8 On Mac OSX there are spurious hat events at program start, so skip these 2020-01-17 11:06:02 -08:00
Sam Lantinga
eda9d8fb85 Reattach the kernel driver after closing USB controllers 2020-01-17 10:43:14 -08:00
Sylvain Becker
df66a2ce78 Android: prevents rare crashes when app goes to background or ends.
Make sure the thread is actually paused, and context backep-up, before
SurfaceView is destroyed (eg surfaceDestroyed() actually returns).

Add a timeout when surfaceDestroyed() is called, and check 'backup_done' variable.

It prevents crashes like:

  #00  pc 000000000000c0d0  /system/lib64/libutils.so (android::RefBase::incStrong(void const*) const+8)
  #01  pc 000000000000c7f4  /vendor/lib64/egl/eglSubDriverAndroid.so (EglAndroidWindowSurface::UpdateBufferList(ANativeWindowBuffer*)+284)
  #02  pc 000000000000c390  /vendor/lib64/egl/eglSubDriverAndroid.so (EglAndroidWindowSurface::DequeueBuffer()+240)
  #03  pc 000000000000bb10  /vendor/lib64/egl/eglSubDriverAndroid.so (EglAndroidWindowSurface::GetBuffer(EglSubResource*, EglMemoryDesc*)+64)
  #04  pc 000000000032732c  /vendor/lib64/egl/libGLESv2_adreno.so (EglWindowSurface::UpdateResource(EsxContext*)+116)
  #05  pc 0000000000326dd0  /vendor/lib64/egl/libGLESv2_adreno.so (EglWindowSurface::GetResource(EsxContext*, EsxResource**, EsxResource**, int)+56)
  #06  pc 00000000002ae484  /vendor/lib64/egl/libGLESv2_adreno.so (EsxContext::AcquireBackBuffer(int)+364)
  #07  pc 0000000000249680  /vendor/lib64/egl/libGLESv2_adreno.so (EsxContext::Clear(unsigned int, unsigned int, unsigned int, EsxClearValues*)+1800)
  #08  pc 00000000002cb52c  /vendor/lib64/egl/libGLESv2_adreno.so (EsxGlApiParamValidate::GlClear(EsxDispatch*, unsigned int)+132)
2020-01-17 12:41:54 +01:00
Sylvain Becker
6d7a79d8a9 Fixed bug 4246 - Android: orientation between portrait<->landscape doesn't work
Improve handling of landscape/portrait orientation. Promote to SCREEN_ORIENTATION_SENSOR_* when needed.
Android window can be somehow resizable.
If SDL_WINDOW_RESIZABLE is set, window size change is allowed, for instance when orientation changes (provided the hint allows it).
2020-01-17 12:04:18 +01:00
Sam Lantinga
89be0e49c6 Updated copyright date for 2020 2020-01-16 20:49:25 -08:00
Sam Lantinga
51433db9c9 Fixed bug 4929 - Software renderer produces bugs when optimizations are turned on with Visual C++ 2019
Konrad

I took the liberty of rewriting this function a bit as it seemed to be unnecessary extended with ifs regarding flags (we can check everything in one pass which seem to be the thing which confuses Visual C++ 2019 as well).

Also, I have made CPU features an int instead of uint because if we check it against flags which are all ints it might as well just be int (no signed/unsigned bitwise comparison).
2020-01-16 15:54:20 -08:00
Sam Lantinga
fe8f1dcbd9 Added support for the paddles on the Xbox One Elite Series 2 controller 2020-01-16 15:32:41 -08:00
Sam Lantinga
78a346cc42 Improved Xbox One controller initialization 2020-01-16 15:32:39 -08:00
Sam Lantinga
42d4027b9b Fixed bug 4903 - Lack of color multiply with alpha (SDL_BLENDMODE_MOD + SDL_BLENDMODE_BLEND) blending mode for all renderers
Konrad

This kind of blending is rather quite useful and in my opinion should be available for all renderers. I do need it myself, but since I didn't want to use a custom blending mode which is supported only by certain renderers (e.g. not in software which is quite important for me) I did write implementation of SDL_BLENDMODE_MUL for all renderers altogether.

SDL_BLENDMODE_MUL implements following equation:

dstRGB = (srcRGB * dstRGB) + (dstRGB * (1-srcA))
dstA = (srcA * dstA) + (dstA * (1-srcA))

Background:

https://i.imgur.com/UsYhydP.png

Blended texture:

https://i.imgur.com/0juXQcV.png

Result for SDL_BLENDMODE_MOD:

https://i.imgur.com/wgNSgUl.png

Result for SDL_BLENDMODE_MUL:

https://i.imgur.com/Veokzim.png

I think I did cover all possibilities within included patch, but I didn't write any tests for SDL_BLENDMODE_MUL, so it would be lovely if someone could do it.
2020-01-16 08:52:59 -08:00
Sam Lantinga
6248869d6a Improved Xbox One controller initialization sequence
This sequence works across Microsoft, PowerA, PDP, and HORI controllers.
The newer Microsoft XBox firmware requires synchronizing the rumble sequence number, when SDL sees it after the initial connect
The Razer Wildcat controller requires waiting for init responses before continuing the initialization sequence.
The PDP Battlefield 1 controller takes over a second to be ready for initialization, and if initialization is attempted before then, it will fail.
2020-01-15 22:18:31 -08:00
Sam Lantinga
a967b42dc5 Added support for the HORI Fighting Commander 2020-01-15 22:18:29 -08:00
Sam Lantinga
b2edc88e6b Added D-PAD bindings for the Linux Steam Controller 2020-01-13 22:05:58 -08:00
Sam Lantinga
1b2a08e3d0 Fixed compiler warning 2020-01-13 22:05:56 -08:00
Sam Lantinga
e2f6c2b4ea Fixed deadlock in HIDAPI joystick system 2020-01-13 22:05:54 -08:00
Sam Lantinga
83f1dfbc7e Free the joystick player index when the joystick is removed 2020-01-13 15:35:54 -08:00
Sam Lantinga
10e1e104f3 Added support for claiming individiual interfaces on USB devices on Android
This is needed for supporting multiple wireless Xbox 360 controllers
2020-01-13 15:35:52 -08:00