Commit Graph

11533 Commits

Author SHA1 Message Date
Sam Lantinga
15ead9a40d Updated to version 2.28.5 for release release-2.28.5 2023-11-02 10:00:33 -07:00
Sam Lantinga
7ebfaa0ea2 Check to make sure the Windows joystick device has buttons and axes
This reverts commit e5a15f94e2.

It turns out removing this check allows mice like the ROG PUGIO II to show up as game controllers. We need to find a different way to differentiate between gaming mice and pedals.

Since these mice show up as controllers, and potentially causing games to use them instead of real controllers, we'll go ahead revert this change for now.

Reopens https://github.com/libsdl-org/SDL/issues/8227

(cherry picked from commit ad0af48883)
(cherry picked from commit 20ecd2afcb)
2023-11-02 08:45:00 -07:00
Anonymous Maarten
5f4ddebf76 cmake: reset check state before testing -fobjc-arc
(cherry picked from commit 517db6d887)
2023-10-30 21:13:42 +01:00
Anonymous Maarten
0f8858cf2d cmake: check -fobjc-arc compiler flag on Apple platforms
(cherry picked from commit 20630b2e6c)
2023-10-30 19:57:02 +01:00
Anonymous Maarten
98abc15769 cmake: file(RELATIVE_PATH) needs 2 absolute paths
(cherry picked from commit 7774de0fe3)
2023-10-30 19:47:21 +01:00
Frank Praznik
746d74b140 wayland: Sanity check pointers and protocols before confining
(cherry picked from commit 875e45e70b)
(cherry picked from commit 60e8ff16dc)
2023-10-29 14:32:02 -04:00
Frank Praznik
7d9595b14f wayland: Check the relative pointer handle before destroying
If the relative protocol is unsupported, this will always be null and the destroy function won't be called.

(cherry picked from commit 0e87b71d08)
(cherry picked from commit 19c3e125ba)
2023-10-29 14:31:46 -04:00
Sam Lantinga
63d259edf0 Fixed making the EGL context current when resuming on Android
Make sure that we don't have the context cached as current on the current thread.

(cherry picked from commit 8b6da3c701)
(cherry picked from commit 832afa81a1)
2023-10-26 17:09:34 -07:00
Ozkan Sezer
fcd0c9843e CI: change FreeBSD CI runner to cross-platform-actions. 2023-10-26 01:03:56 +03:00
Sam Lantinga
74b3959e04 Added support for the HP HyperX Clutch Gladiate controller
(cherry picked from commit f52b330ed8)
(cherry picked from commit 1db0bd3fc0)
2023-10-25 09:02:04 -07:00
Sam Lantinga
a5df48514e Added support for "%[]" sscanf syntax
Fixes https://github.com/libsdl-org/SDL/issues/8423

(cherry picked from commit 39a961ba41)
(cherry picked from commit 4194a902e8)
2023-10-24 17:34:39 -07:00
Sam Lantinga
78d5fbf398 SDL_IsJoystickProductWheel() returns SDL_TRUE for Asetek wheelbases (thanks @IOBYTE!)
(cherry picked from commit e07f6c0a17)
(cherry picked from commit d47c286b12)
2023-10-23 10:44:44 -07:00
Sam Lantinga
5d66429cc3 Add missing error reporting in Android_JNI_FileOpen()
Fixes https://github.com/libsdl-org/SDL/issues/8427

(cherry picked from commit a844d90942)
(cherry picked from commit 259009a7ea)
2023-10-23 08:28:57 -07:00
Sam Lantinga
2ca041d294 Revert "Check to make sure the Windows joystick device has buttons and axes"
This reverts commit 642504bc59.

We have SDL_HINT_JOYSTICK_ROG_CHAKRAM to ignore or allow the ROG Chakram X mouse to be used as a joystick.

Fixes https://github.com/libsdl-org/SDL/issues/8227

(cherry picked from commit e5a15f94e2)
(cherry picked from commit e3e41b69a1)
2023-10-22 09:24:44 -07:00
Cameron Gutman
b3f19b14d7 Check for device disconnection in HIDAPI_JoystickOpen()
HIDAPI joystick drivers may call HIDAPI_JoystickDisconnected() in their
UpdateDevice() function during HIDAPI_JoystickOpen(). If they do this
today, the opened joystick will end up partially initialized (no name,
path, mapping GUID, etc.) because HIDAPI_GetDeviceByIndex() will no
longer be able to find the SDL_HIDAPI_Device for the removed joystick.

Worse still, joystick->hwdata->device becomes a dangling freed pointer
the next time HIDAPI_UpdateDeviceList() is called. This leads to a UAF
when the application or SDL calls SDL_JoystickClose() on this joystick.

Fix all this by checking if the device no longer has any associated
joysticks after calling UpdateDevice() and failing the open call if so.

(cherry picked from commit 435e7ce663)
(cherry picked from commit 4aab2342e9)
2023-10-17 20:40:35 -07:00
Sylvain
a85cf62c12 Fix sdltest_randomAsciiStringWithMaximumLength() where it requests a string a size 0
seen with: ./testautomation --seed MILAFAP2AKVP3V4G --filter sdltest_randomAsciiStringWithMaximumLength
2023-10-13 20:24:48 +02:00
Ryan C. Gordon
5be746acbc x11: Properly check for XInput2 support before using it.
This specifically fixes a crash in X11_WarpMouseInternal if XInput2 was
missing at runtime, but also cleans up a few other existing checks.

Fixes #8378.

(cherry picked from commit 82f54af617)
(cherry picked from commit 2849ca404e)
2023-10-11 01:11:01 -04:00
Anonymous Maarten
2abefb1c16 ci: stop FreeBSD job after 30 minutes
(cherry picked from commit aee4862958)
2023-10-11 00:23:41 +02:00
Ozkan Sezer
6fc17b0e2b artsaudio: revert bad arts_init return code check from commit ce5da5d. 2023-10-10 10:40:00 +03:00
Frank Praznik
1f7ec57d3b wayland: Unref the libdecor window when hiding
Hiding the decorations while not unreferencing the frame was a workaround for an internal libdecor use-after-free bug that was fixed some time ago. Revert to unreferencing the window when hiding to ensure that it is properly destroyed.

Reverts dd2e318
2023-10-05 20:26:29 +02:00
Anonymous Maarten
36eb4845b5 triangle: don't read destination pixel when you're going to discard it anyways 2023-10-05 15:00:06 +02:00
Anonymous Maarten
d5ba5bb05f blit_slow: don't read destination pixel when you're going to discard it anyways
(cherry picked from commit 4cd0c13823)
(cherry picked from commit 2d5c05a69c)
2023-10-04 19:43:03 -07:00
Sam Lantinga
cc016b0046 Updated to version 2.28.4 for release release-2.28.4 2023-10-01 12:05:05 -07:00
Anonymous Maarten
8c3fd5aec2 snd_pcm_plugin_flush was removed in QNX 7.1 and later
Co-authored-by: elahav <elahav@users.noreply.github.com>
2023-09-30 16:53:53 +02:00
Anonymous Maarten
24d145f4b6 cmake: add qnx support
Co-authored-by: elahav <elahav@users.noreply.github.com>
2023-09-30 16:53:53 +02:00
Anonymous Maarten
145ad48c0e Allow the use of posix_spawn() instead of vfork/execlp()
Backport of #7041

Co-authored-by: elahav <elahav@users.noreply.github.com>
2023-09-30 16:53:53 +02:00
Simon McVittie
fd495bb57c SDLTest_CompareSurfaces: Decode pixels correctly on big-endian platforms
Previously, if acting on a surface with less than 32 bits per pixel,
this code was placing the pixel value from the surface in the first
few bytes of the Uint32 to be decoded, and unrelated data from a
subsequent pixel in the remaining bytes.

Because SDL_GetRGBA takes the bits to be decoded from the
least-significant bits of the given value, ignoring the higher-order
bits if any, this happened to be correct on little-endian platforms,
where the first few bytes store the least-significant bits of an
integer.

However, it was incorrect on big-endian, where the first few bytes are
the most-significant bits of an integer.

The previous implementation also assumed that unaligned access to a
32-bit quantity is possible, which is not the case on all CPUs (but
happens to be true on x86).

These issues were not discovered until now because
SDLTest_CompareSurfaces() is only used in testautomation, which until
recently was not being run routinely at build-time, because it contained
other assumptions that can fail in an autobuilder or CI environment.

Resolves: https://github.com/libsdl-org/SDL/issues/8315
Signed-off-by: Simon McVittie <smcv@collabora.com>
(cherry picked from commit d95d2d7051)
(cherry picked from commit 6b5eadb10f)
2023-09-29 06:57:07 -07:00
Sam Lantinga
d58fa94ee9 SDL_iconv_string() defaults to UTF-8
Fixes https://github.com/libsdl-org/SDL/issues/8287

(cherry picked from commit 1375d2049d)
(cherry picked from commit 9772d0512c)
2023-09-24 17:28:23 -07:00
Sam Lantinga
d691010686 Check for NULL before dereferencing newly allocated memory
Fixes https://github.com/libsdl-org/SDL/issues/8289

(cherry picked from commit 70a1bc6973)
(cherry picked from commit 27f2df2292)
2023-09-24 17:19:03 -07:00
Ryan C. Gordon
b93a8a86ab emscripten: Restore compatibility with existing emsdk releases.
(cherry picked from commit 5008521538)
2023-09-20 14:37:56 -04:00
Jaswant Panchumarti
536f625bde Use EM_ASM_PTR when the return value is a pointer
- closes https://github.com/libsdl-org/SDL/issues/8241

(cherry picked from commit 953b55dd6d)
2023-09-20 14:37:24 -04:00
Ozkan Sezer
1e18dc594e update config.guess and config.sub from mainstream 2023-09-20 14:50:56 +03:00
Sam Lantinga
cc4973ea45 Fixed sensor timestamp units for third-party PS5 controllers
(cherry picked from commit a72dfa6a5f)
(cherry picked from commit 37dee79b74)
2023-09-18 13:00:50 -07:00
Sam Lantinga
8114bd9108 Fixed error: array subscript 2 is above array bounds of ‘const Uint8[2]’
Smart compilers don't like dereferencing off the end of arrays

(cherry picked from commit f6756047a4)
(cherry picked from commit 62e7049a4f)
2023-09-18 12:20:36 -07:00
Sam Lantinga
495fca1517 Fixed sensor timestamp calculation for third-party PS5 controllers
(cherry picked from commit 7059a55ccc)
(cherry picked from commit fff3c2573a)
2023-09-18 11:59:00 -07:00
Sam Clegg
7d80e20883 emscripten: Add JS library dependencies using EM_JS_DEPS macro
See https://github.com/emscripten-core/emscripten/pull/19780

(cherry picked from commit 042243471f)
2023-09-15 15:29:47 -07:00
Guldoman
f3847c157a x11: Always update clipboard owner
This allows utilities like clipboard managers to keep track of the
changes.

(cherry picked from commit 65aaf3a9ab)
(cherry picked from commit 70a2ac2f1c)
2023-09-15 05:23:21 -07:00
Max Bachmann
b576e29d9b detect fanatec steering wheels
(cherry picked from commit fd1c54a004)
(cherry picked from commit a8b9414697)
2023-09-12 15:36:41 -07:00
Anonymous Maarten
c7ad8e5431 cmake: make sure SDL_GetPrefPath is run before testfilesystem
60 seconds timeout ought to be sufficient.
2023-09-10 15:34:29 +02:00
Anonymous Maarten
9c8ee3a154 ci: run tests in parallel 2023-09-10 15:34:29 +02:00
Simon McVittie
d710e0be27 render: Enable clipping for zero-sized rectangles
Battle for Wesnoth apparently relies on being able to disable rendering
of UI elements by setting the clip rectangle to be empty.

Resolves: https://github.com/libsdl-org/SDL/issues/6896
Fixes: 00f05dcf "render: only enable clipping when the rectangle is valid"
Signed-off-by: Simon McVittie <smcv@collabora.com>
(cherry picked from commit 8ad043fc38)
2023-09-09 11:14:25 -07:00
Anonymous Maarten
b8d1f852db cmake: use MSVC_RUNTIME_LIBRARY to force MT 2023-09-09 19:17:36 +02:00
Makarenko Oleg
e9ab663c43 Detect Simagic wheel bases as wheels (#8198)
Simagic DirectDrive wheel bases have the same vendor + product id's

(cherry picked from commit a2c1984d37)
(cherry picked from commit 1d495351a0)
2023-09-04 12:12:37 -07:00
Oleg
c8d1de1a9b Detect Logitech G923 Playstation as wheel
G923 have two different versions - Xbox version is already present in the wheel list, but not the PS version.

(cherry picked from commit 266b91d2fd)
(cherry picked from commit 365a36386a)
2023-09-04 11:06:06 -07:00
Oleg
bf8c9cd6bf Detect Logitech PRO Racing Wheel for Xbox (PC mode) as wheel
Logitech PRO Racing Wheel have two different versions - for Playstation and Xbox. Vendor + Product ID for Playstation version already present in SDL sources, but not an Xbox version

(cherry picked from commit cde67ea49a)
(cherry picked from commit 242b25aba4)
2023-09-04 11:02:09 -07:00
Sam Lantinga
8a5ba43d00 Updated to version 2.28.3 for release release-2.28.3 2023-09-01 11:22:07 -07:00
Jeremy Demeule
c25a49c406 metal: Add hint to select low power device instead of the default one (#8182)
On some system like MacBook Pro Intel with AMD card, asking for the default device will always return the AMD GPU.
This is not an issue for 99% of the case when the renderer context is here to provide the maximum performance level like for game.
However, for video application using GPU for 1 quad and 1 texture, using the discrete GPU for that lead to an important power consumption (4 to 8W), heat increase, and fan noise.
With this patch, I successfully amend ffplay to only use the integrated GPU (i.e. the Intel one), instead of the discrete GPU (i.e. the AMD one).

(cherry picked from commit aa7ba62978)
2023-08-31 01:55:40 -07:00
Anonymous Maarten
d46fdfa3ee wayland: add SDL_VIDEO_DRIVER_WAYLAND_DYNAMIC_EGL 2023-08-30 23:03:29 +02:00
Anonymous Maarten
787d339282 wayland: don't define SDL_VIDEO_DRIVER_WAYLAND_DYNAMIC_* macro's
They mess with #ifdef conditional in headers.
2023-08-30 22:46:53 +02:00
Sam Lantinga
874f6feab4 Fixed the report format for the Razer Wolverine V2 Pro
(cherry picked from commit 69aec8c915)
(cherry picked from commit 6ff48dddcb)
2023-08-24 11:39:15 -07:00