Commit graph

11305 commits

Author SHA1 Message Date
Jeremy Rand 5e74365e55 SDL_blit_N.c: Move ppc64le swizzle outside of loop
An in-place swizzle mutation was erroneously inside of a loop, which
caused each consecutive 4-pixel vector to alternate between correct and
incorrect endianness.

The bug was introduced in 715e070d29.

Thanks to RobbieAB for reporting the bug.

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

(cherry picked from commit 9142292f4ad6d9bc8a2bc7c874e2fde54befeb9b)
2023-05-06 08:39:59 -07:00
Loc(Elliot) 3e64fec9f4 Fix bug memory acess
Bitmap is not initialized before use, that cause segmentation fault on function use it. Fix by allocate memory before use.
2023-05-04 07:01:25 -07:00
Sam Lantinga 707e9397ca Removed memset_pattern4() from SDL headers
This requires including string.h, which isn't always done, so this commit simplifies dependencies on macOS

Fixes https://github.com/libsdl-org/SDL/issues/3657
2023-04-30 21:38:29 -07:00
Sam Lantinga f72213c4ac By default, OpenBSD uses Linux controller mappings
Fixes https://github.com/libsdl-org/SDL/issues/7609

(cherry picked from commit 255c3b7c82968def667da860cbda01f267b4edf1)
2023-04-29 17:10:46 -07:00
Frank Praznik 132b88749c wayland: Destroy proxy wrappers and callbacks before event queues
Destroy any proxy wrappers and callbacks before the associated event queues to silence libwayland warnings about destroying the queues while proxies are still attached.
2023-04-27 13:08:59 -04:00
Linus Probert 8b39eb9b1f wayland: Fixes a memory leak wheere primary selection isn't freed
(cherry picked from commit 43f65a6ef08a502485c6107b255a9b22c890acd5)
2023-04-24 12:00:16 -07:00
Ozkan Sezer 0f2322acfc hidapi/mac: replace sprintf uses with snprintf.
Reference issues:
-  https://github.com/libusb/hidapi/pull/509
-  https://github.com/libusb/hidapi/pull/511

(cherry picked from commit ae9119c36bdcf2214d83c6d35c436d22b5fd03cb)
2023-04-24 10:46:49 -07:00
Ozkan Sezer 5f344c17c2 hidapi/mac: import mainstream commit c1b9d2ad
c1b9d2ad98
Properly handle the close of run loop on macOS
(https://github.com/libusb/hidapi/pull/522)
- as per documentation `kCFRunLoopRunStopped` should be handled once the runloop is closed via `CFRunLoopStop`;
- if it is not handled - a race condition/crash may happen on the latest macOS when a device gets disconnected while being open;

(cherry picked from commit 62d1a2c836c6176a6c76d54229eafa7d011bb9fb)
2023-04-24 10:46:49 -07:00
Mingjie Shen a688ecd6fa
Check return value of SDL_malloc()
(cherry picked from commit a4604cb0d616db97921a2674a63b45f3fdfb81bc)
2023-04-23 12:28:54 -04:00
Sam Lantinga 120bc77e91 Report PS3 accelerometer values in m/s2 instead of Gs
(cherry picked from commit 0467301baf57389d96fafbe169fb07f4c10169bc)
2023-04-19 13:12:38 -07:00
Anonymous Maarten 535ec1a921 cmake: allow users of sdl2-config.cmake to not add -mwindows to the link options 2023-04-18 14:10:12 -04:00
Sam Lantinga 7ec9a4385a More defensive coding against dangling device pointers
(cherry picked from commit acadb6f873acaa0de094ad10a88f877d540ce0ec)
2023-04-06 13:21:44 -07:00
Sam Lantinga 6d7269815b Clarified the expected sensor value when a game controller is at rest
(cherry picked from commit 1a20ccb2897fc9b12ad5242f9128cb6bb60368b1)
2023-04-06 09:55:43 -07:00
Sam Lantinga cb0cf14155 The latest Armor-X Pro firmware update fixes the sign on the Z axis of the sensors
(cherry picked from commit 558bbbb07ae0afa0108c1560915351cfa13442b7)
2023-04-06 09:55:39 -07:00
Cyril Dubet 7914234b26 Fix key code names for ISO keyboard layouts
(cherry picked from commit 60dcaff7eb25a01c9c87a5fed335b29a5625b95b)
2023-04-05 17:03:42 -07:00
Sam Lantinga 51dcc3bb0b The macOS minimum deployment target is now 10.11
Xcode 14.3 does not allow targeting 10.9, the minimum recommended version is 10.13 and the minimum possible version is 10.11.

(cherry picked from commit 73b2faea4e39aa27b4142f9d4d39f5807a3b3688)
2023-04-05 11:40:50 -07:00
Sam Lantinga f6363fde9a Fixed crash if joystick->hwdata != NULL && device->driver == NULL
This should never happen, but we're seeing it in the wild, so make sure that we can never call into a NULL device driver.

(cherry picked from commit e13b74ccf0b20a20bd4baf1617bdc4f84c13feb7)
2023-04-05 11:24:55 -07:00
Ozkan Sezer f633915443 fix build after commit 22685556e5. 2023-04-05 02:10:56 +03:00
Sam Lantinga 57043825ba Fixed crash if dbus can't be initialized
(cherry picked from commit cf2c6fa58dea02edb870cff7090fd69f3dfbd081)
2023-04-04 12:35:30 -07:00
Sam Lantinga 22685556e5 Don't probe for PlayStation controllers when we already know the controller type
Fixes https://github.com/libsdl-org/SDL/issues/7556

(cherry picked from commit 655a07bdd88d6bd19fe97c3abd39a2e2eef252ec)
2023-04-04 12:35:20 -07:00
Sam Lantinga f444eac557 Fixed analog triggers on the DualSense controller
(cherry picked from commit a67d41050164e447048fa55179cc31b23be9d9b7)
2023-04-04 12:35:20 -07:00
Jerome Duval eb0d214c17 Haiku: use a BLooper for events.
only create a BApplication when it doesn't already exist.
2023-03-30 10:20:11 -07:00
Frank Praznik 55f74c3285 x11: Don't allow the changing of certain scancodes
The X11 driver uses scancodes derived from keysyms to map the scancodes for extended keys to the physical keyboard, however, this can be incorrect when using certain XKB options (e.g. caps:swapescape), which changes the keysyms emitted by certain keys, but does not imply that their scancodes or positions should be altered. Mark selected scancodes as being non-remappable so that their scancodes aren't changed by toggling XKB mapping options.
2023-03-30 11:20:28 -04:00
Wohlstand 2aeac8de51 include: Fixed a C++-style single line comment.
78725dc0cd
2023-03-29 21:43:15 +00:00
Stephen Kitt 6d01ffcd94 Split up CFLAGS construction so it can be overridden
CFLAGS currently takes care of two aspects of the build: optimisation
and debug symbols on one hand, the include path on the other. The
former should be overridable by users, the latter shouldn't.

This patch moves the include path flag to CPPFLAGS, which is
appropriate for pre-processor directives. This leaves CFLAGS with only
overridable flags.

Based on a patch by Roflcopter4:
https://github.com/joncampbell123/dosbox-x/pull/3850

Signed-off-by: Stephen Kitt <steve@sk2.org>
2023-03-29 07:26:34 -07:00
Sam Lantinga c2ee45f5ff The Xinmotek Controller is used in multiple products with different mappings
The mapping included here is for the Ultimate Atari Fight Stick

(cherry picked from commit f1099f8e70a1284c2ee3031f2ea0cfc84f22110c)
2023-03-28 15:16:07 -07:00
Sam Lantinga 0bf63175ab Fixed gyro values for the Armor-X Pro controller
(cherry picked from commit 8df7b4d8539338121b1e34e29f331b28f1f4ff05)
2023-03-28 14:44:59 -07:00
Sam Lantinga d043c8535b Fixed the accelerometer and gyro axes for the Armor-X Pro controller
(cherry picked from commit 37517557ae076cd94acd9ca3b739e1f32c150a43)
2023-03-28 12:29:33 -07:00
Anonymous Maarten d2a2787783 Fix remaining -Wimplicit-fallthrough warnings 2023-03-28 19:24:33 +02:00
Anonymous Maarten 85fecbb10b video: fix warnings about unused variables when building without duff's loop
(cherry picked from commit 0c3777d5661dd0bf60ba3db634f79c2121371092)
2023-03-28 10:21:36 -07:00
Anonymous Maarten ec3e333fb8 testautomation_audio: fix -Wimplicit-fallthrough warning
(cherry picked from commit 11c70406c322b5686f35349acc9659c4d8d5a8f7)
2023-03-28 10:21:36 -07:00
Anonymous Maarten 1402d13556 video/blit: fix -Wimplicit-fallthrough warnings
(cherry picked from commit f7961b7c9ad598b031cd033f19e93c6d882e8e41)
2023-03-28 10:21:35 -07:00
Anonymous Maarten 03c239ded9 testsurround: fix channel names
Used table in include/SDL3/SDL_audio.h as reference.

(cherry picked from commit e1b8a032391f4b24453d5bcbe725a35b3894ea5d)
2023-03-28 10:21:35 -07:00
Sylvain 16c9bad786 Safety fix: clear "_this->wakeup_window" when destroying the window
(cherry picked from commit c838ccf0e3a330ebbcf433698b8f5370c6fa80d6)
2023-03-28 08:29:24 -07:00
Sylvain 6574e5eb57 Safety fix: clear "_this->current_glwin" when destroying the window
(cherry picked from commit 0c048d98af449f1bc540e256c90eb792f1effff4)
2023-03-28 08:29:23 -07:00
Sylvain 4fa21ee5ed
Fixed bug #7515 - Window still grabbed after destroying 2023-03-28 09:43:34 +02:00
Sam Lantinga 8bfbda1eab Fixed the accelerometer sensitivity for the Armor-X Pro controller
(cherry picked from commit 8029a767eef4147c07cde965bd5a2d2e11e237ee)
2023-03-27 14:33:59 -07:00
Sam Lantinga 93c289b475 Increased precision for PS4 sensor data conversion
(cherry picked from commit 3340864786314d77e04a0dd2bf1ebffbc43bfc31)
2023-03-27 14:33:56 -07:00
Pierre Wendling ed5a343d25 SDL_hidapi_steam.c: Fix compilation under c2x.
When N2935 is implemented, the enum breaks compilation. Use a #define of
the SDL booleans instead.

(cherry picked from commit 975039ce0d3587c42e11f2922240957fc8f74166)
2023-03-27 09:02:46 -07:00
Pierre Wendling 0081174689 Fix clang-tidy error on LLVM 16.
Starting LLVM 16, clang-diagnostic-implicit-function-declaration is
treated as an error.
(cherry picked from commit ea093378a29b786edbaa265045638f66d7f83d8b)
2023-03-27 12:51:21 +03:00
Anonymous Maarten cd64e0b6e3 SDL_blit_copy: Don't call potentially FPU using SDL_memcpy in SDL_memcpyMMX 2023-03-27 06:13:28 +00:00
Anonymous Maarten 51c10bef0b cmake: disable warnings in libm + warning about EMMS instruction
SDL_BlitCopyMMX ends with _mm_empty(), so the MMX state should be emptied.

(_mm_empty is the intrinsic function for emms)
2023-03-27 06:13:28 +00:00
Anonymous Maarten d1dc195208 Implement _intel_fast_(memcpy|memset)
The classic Intel compiler generates calls to these functions when
building the SDL library with SDL_LIBC=OFF.
2023-03-27 06:13:28 +00:00
Anonymous Maarten 5e5b029d6c cmake: add /Q_no-use-libirc flag when building a no-libc library
The new Intel LLVM library needs this because when building SDL2
in release mode.
2023-03-27 06:13:28 +00:00
Anonymous Maarten b58285b7ed ci: test with (old) Intel compiler + (new) oneAPI compiler 2023-03-27 06:13:28 +00:00
Anonymous Maarten e5ebbdafd4 cmake: add support for building with Intel C compiler 2023-03-27 06:13:28 +00:00
Anonymous Maarten 977781d3f4 testautomation_math: avoid equality tests with INFINITY
Fixes this warning:
 warning: comparison with infinity always evaluates to false in fast floating point modes [-Wtautological-constant-compare]
2023-03-27 06:13:28 +00:00
Anonymous Maarten 984af1a725 cmake: new LLVM based Intel compiler does not recognize MSVC's /MP 2023-03-27 06:13:28 +00:00
Anonymous Maarten 5aa76de35f cpuinfo: use __cpuidex instead of __cpuid
The classic Intel Compiler does not clear the ecx register prior
to executing the cpuid opcode.
2023-03-27 06:13:28 +00:00
Anonymous Maarten 1158cff9ea cmake: increase threshold for stack probes
The /Gs argument controls the number of bytes that local variables
can occupy before a stack probe is initiated.
By setting it to a huge value, no calls to __chkstk are inserted.

This change is needed for the classic Intel C compiler to build SDL
with -DSDL_LIBC=OFF.
2023-03-27 06:13:28 +00:00