Commit Graph

11278 Commits

Author SHA1 Message Date
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
Anonymous Maarten
ae3a34a388 byteswap: Don't use intrinsic byteswap functions with Intel C compiler
It reroutes intrinsic _byteswap_u(short|long|int64) call to libc function.
2023-03-27 06:13:28 +00:00
Frank Praznik
c0824cd49a events: Increase the size of the name buffer when logging events
Event names have grown in length and are occasionally truncated when being logged (e.g. SDL_EVENT_WINDOW_PIXEL_SIZE_CHA). Increase the event name buffer size to handle the longer names.

(cherry picked from commit 203a2a76fc0af2094de84d75dbf959c7db73fe72)
2023-03-26 22:01:17 -07:00
capehill
6ed29f47c9 testgles2_sdf: Call correct function to get shader info log
(cherry picked from commit b8c88cc58423b7e654b18fdaf1aab5a343114586)
2023-03-26 22:00:41 -07:00
Karl Hedberg
9ed1b778ed Made the Android documentation more clear and understandable (#7535)
(cherry picked from commit 11142ec2562cc3cce1ea2e09e9758d8b6cfc07bb)
2023-03-25 15:11:51 -07:00
Bartłomiej Dach
b970dd1beb Android: Fix mismatching JNI method signature
Another regression from commit dca3fd8307,
which was a backport of commit de3909a190f6e1a3f11776ce42927f99b0381675
from SDL3 to SDL2. This time the regression is much less apparent,
however, due to two reasons:

- It only appears when the SDL project is ran on an actual device
  due to magic stringage.

- More importantly, the regression was partially hidden due to
  the nature of de3909a190f6e1a3f11776ce42927f99b0381675.

  The commit which was backported added a single `I` to the JNI method
  signature in `SDL_android.c`, representing the added `int axis_mask`
  parameter. The parameter was added to both SDL2 and SDL3.

  However, notably, that `I` was added *after* commit
  fcafe40948fe308cc9552df5a3d625ee2725de5a, which removed the
  `int nballs` parameter from the joystick API, but only from the SDL3
  branch.

  Therefore, in totality, what should really have been a merge conflict,
  was obscured by the fact that the SDL3 branch ended up having
  a net-identical JNI signature to the SDL2 branch, due to having
  one bool param removed and one added - while, in fact, the SDL2 branch
  needed one bool param added and none removed.
2023-03-25 15:08:33 -07:00
Bartłomiej Dach
576df87240 Android: Fix missing type in SDLControllerManager
The missing type in question is causing compilation failures.
The error was introduced in dca3fd8307,
which was a backport of commit de3909a190f6e1a3f11776ce42927f99b0381675
from SDL3 to SDL2.

Because `int nballs` was removed as a parameter from the controller
API in SDL3 in revision fcafe40948fe308cc9552df5a3d625ee2725de5a,
this change is only applicable to the SDL2 branch.
2023-03-25 15:08:33 -07:00
Sylvain
2dddaa7dc9 backport x11/sdl2 fixes
4b1378f

X11: fix size/position (test video_setWindowCenteredOnDisplay)

this fix x11 backend to correctly pass video_setWindowCenteredOnDisplay()

    get border values early (eg status bar)
    wait for size/position change to get valid values

d4d26e0

testautomation_video: if SDL_SetWindowSize/Position isn't honored, we should check there is an event
x11: send the events if various occasions
2023-03-25 10:27:17 +01:00
Ozkan Sezer
45a6ad8e57 wikiheaders.pl: make it work with older perl versions, e.g. 5.10. 2023-03-24 11:56:40 +03:00
Sam Lantinga
b57a6a1adf Added gamepad mapping for Flydigi Vader 2 with the latest firmware (6.0.4.9)
(cherry picked from commit ed0937598e0a637a1033c90a1b31886537bb288c)
2023-03-18 11:36:50 -07:00
Ivan Mogilko
d78072fcd4 Fixed SDL_RenderSetVSync does not update flags if simulated vsync is on
This lets the user to correctly detect current vsync state by reading SDL_RendererInfo.
Also fixes SetVSync's return value check (it may be positive for error too).
2023-03-17 14:55:04 -07:00
Ryan C. Gordon
446e0943da wasapi: Force WIN_CoInitialize duing device open.
Otherwise this won't work if you open a device on a background thread.

Fixes #7478.
2023-03-17 08:44:19 -07:00
Sylvain
23bce27b26 Change SDL_BLENDMODE_MUL for gl renderers
Add FIXME for PSP and DirectFB
2023-03-16 20:27:09 +01:00
Sylvain
c078dfcf6b Refresh generation of SDL_blit_auto.c after simplifying sdlgenblit.pl 2023-03-16 20:27:09 +01:00
Sylvain
18c4db678b Simplify SDL_BLENDMODE_MUL in sdlgenblit.pl 2023-03-16 20:27:09 +01:00
Sylvain
7d26ba754a Simplify SDL_BLENDMODE_MUL 2023-03-16 20:27:09 +01:00
Sylvain
bd70ce7f94 Refresh generation of SDL_blit_auto.c 2023-03-16 20:27:09 +01:00
Anonymous Maarten
ce4c54e2b2 cmake: get_filename_component(EXT) retturns extension including leading dot 2023-03-15 14:55:56 +01:00
Sam Lantinga
57ae9f466d Ignore the PS4 packet CRC if it's not being set correctly
This fixes handling the 8BitDo SN30 Pro with the 2.00 firmware in PS4 mode

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

(cherry picked from commit 3951cae4a56fddcb42ce4141a6518c97fa9125cd)
2023-03-13 20:00:19 -07:00
Rudolf Polzer
dca3fd8307 Android: indicate gamepaddb entries where axis order changed.
Axis order was changed in 6f1f586086a18ab32ddccc05e4616aac02774a1b to improve
default mappings.

(cherry picked from commit de3909a190f6e1a3f11776ce42927f99b0381675)
2023-03-11 13:01:50 -08:00
Sam Lantinga
ab1670386f Added support for the trigger buttons on the Victrix Pro FS for PS5
(cherry picked from commit 8d7e61ea42364c256b76e7f6f2b6d6f90742bcb7)
2023-03-10 15:46:22 -08:00
Sam Lantinga
76e9d64b36 Removed space between sizeof and parentheses 2023-03-10 08:13:51 -08:00
Sam Lantinga
e9f9cb29fc Fixed build warning on Android
(cherry picked from commit 2af6f4a3e4f0a82ccbb7ce142c914b5aa5df2000)
2023-03-10 08:12:28 -08:00
Stephen Kitt
3e1d7e6a14 Specify bash for androidbuildlibs.sh
This script relies on string indexes in parameter expansions, which
aren't suppored by /bin/sh (e.g. dash).

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

Signed-off-by: Stephen Kitt <steve@sk2.org>
(cherry picked from commit bbfd5b3fb2eed8f95919febf3bc0fec4bc605cbe)
2023-03-10 07:38:28 -08:00
Qrox
ef347776c2 Uses integer arithmetics in SDL_ResampleAudio
- Avoids precision loss caused by large floating point numbers.
- Adds unit test to test the signal-to-noise ratio and maximum error of resampler.
- Code cleanup

(cherry-picked from commit 20e17559e545c5d3cfe86c1c4772365e70090779)
2023-03-10 18:37:00 +03:00
Ozkan Sezer
5e35309913 fix bad merge of sizeof style patch 2023-03-10 08:32:24 +03:00
Sam Lantinga
71dc7169d9 Added header for SDL_Delay() 2023-03-09 17:18:40 -08:00
Sam Lantinga
1e6ffc6294 Removed a duplicate delay accidentally added during code refactor
(cherry picked from commit 926db1bd544364a9e4ab61e60bcfbe75e05adf56)
2023-03-09 16:13:19 -08:00