Commit Graph

14729 Commits (945162c6d90ea8c76ae5dd994413c4ec7b73d6d8)

Author SHA1 Message Date
Ozkan Sezer f464eb2c54 SDL_hidapi.c: change 'use_libusb_whitelist_default' into a macro.
Avoids 'initializer element is not constant' error from older compilers.
2023-08-14 17:01:24 +03:00
Anonymous Maarten 6607a3cfac Disable cache in python http server
Co-authored-by: Érico Porto <ericoporto2008@gmail.com>
2023-08-14 03:50:06 +02:00
Ethan Lee 181d5d285a hidapi: Enable libusb support by default.
Now that we have a whitelisting system for libusb devices, it should be safe to support it whenever it's available.
2023-08-13 14:16:11 -07:00
Ethan Lee f0f15e365d hidapi: Use a whitelist for libusb when other backends are available 2023-08-13 14:16:11 -07:00
capehill c3f7a7dc46 Convert audio using SDL_AUDIO_F32SYS format instead of SDL_AUDIO_F32
This fixes audio playback noise on big endian systems
as SDL_AUDIO_F32 means SDL_AUDIO_F32LSB.
2023-08-13 14:08:18 -07:00
Vlad-Stefan Harbuz 796713b9d5 xxd.py: always write \n line endings
Previously, `open()` was used with the default option of `newline=None`,
which means that “any '\n' characters written are translated to the
system default line separator”. Now, `xxd.py` always writes `\n` line
endings. This eliminates the need for the .gitattributes file.
2023-08-13 13:51:31 -07:00
David CARLIER 723bcd0a8b SDL_TriggerBreakppoint for riscv arch (both 32/64) version.
`ebreak` acts like int3 for x86, giving control of running process to debuggers.
2023-08-13 11:36:49 -04:00
Anonymous Maarten ec0042081e Add .gitattributes file
On Windows, cmake/xxd.py generates text files with \r\n eol.
Because the in-repo files were stored with \n, and git considered
them as binary files, they were always considered out of date.

An alternative fix could be to let xxd.py generate binary files with \n.
But a .gitattributes file should also avoid people accidentally
converting line endings.
2023-08-12 17:37:52 +02:00
Anonymous Maarten a5d9db0cd0 cmake: build tests for UWP 2023-08-12 17:37:52 +02:00
Anonymous Maarten b7889a7389 winrt: use windowsio in non-libc mode
CMake's SDL_build_config.h force disables HAVE_STDIO_H when buiding
winrt in non-libc mode.

Becase CreateFileEx is not available in UWP mode, use CreateFile2
instead.
2023-08-12 17:37:52 +02:00
Anonymous Maarten ea8757a748 Make testaudiostreamdynamicresample compatible with emscripten 2023-08-12 17:37:20 +02:00
Anonymous Maarten 1a7a74fb2e cmake: build emscripten tests as html page 2023-08-12 17:37:20 +02:00
Anonymous Maarten 64d570f027 Add minimal http server for emscripten test apps 2023-08-12 17:37:20 +02:00
Anonymous Maarten 8e898c4a21 SDL_test does not parse --samples argument 2023-08-12 17:37:20 +02:00
Ryan C. Gordon 91cd5478be
audio: Fix resampler overflowing input buffer.
This usually manifests as a clicking sound, because it often produces
a value outside the range -1.0f to 1.0f based on whatever random data
is past the buffer, which later stages of audio conversion will clamp
to a maximum value for the audio format. Since this tends to be a single
bad sample generated at the end of the resampled buffer, it sounds like
a repeating click in streamed data.

I'd like a more efficient means to clamp this value to not overflow the
buffer, but this puts out the immediate fire.
2023-08-12 00:57:35 -04:00
Ryan C. Gordon f290c85b22
testaudiocapture: Make sure we convert captured audio to output format.
Fixes #8114.
2023-08-11 16:52:23 -04:00
Ryan C. Gordon b75c751dfc
rwlock: Make generic implmentations work on single-threaded platforms.
Fixes #8101.
2023-08-11 15:03:32 -04:00
Sam Lantinga 80850af7ce The controller update complete events are no longer disabled by default 2023-08-10 17:45:00 -07:00
Sam Lantinga 3f486224a9 Fixed refresh rate calculation for KMSDRM 2023-08-10 15:39:38 -07:00
Anonymous Maarten 342ec51131 Fix overflow when doing SDL_sscanf("%hd", ...)
An overflow occured in the stdlib_sscanf test, when using msys2 clang32 toolchain.
2023-08-10 15:06:42 -07:00
Sam Lantinga 9129e1d557 Fixed crash when setting the default cursor twice
This happens in the KMSDRM driver, once after video init, setting a blank default cursor, and once when creating a window when the KMSDRM mouse is initialized.

Also fixed a memory leak freeing the default cursor at shutdown
2023-08-10 12:13:40 -07:00
Sam Lantinga 8e99a4f4f5 Undo variable rename 2023-08-10 11:45:20 -07:00
Sam Lantinga be67f0de10 Fixed crashes related to the default cursor on WinRT and KMSDRM
Fixes https://github.com/libsdl-org/SDL/issues/8104
2023-08-10 11:40:36 -07:00
Mathieu Eyraud 94b3f78c44 Fix out of bound read of 'has_hat' array 2023-08-10 08:25:01 -07:00
Sam Lantinga 94f48f19b0 Use more specific build destinations when creating an xcframework 2023-08-10 01:52:10 -07:00
Sam Lantinga dabd45997e Back out change supporting multiple names for binding elements
testcontroller expects to be able to call SDL_GetGamepadStringForButton() and find that name in the binding string

We can revisit this later if it becomes important to use new names in bindings. @smcv
2023-08-09 11:25:37 -07:00
Simon McVittie efe15588d5 Relabel back paddles as left or right
The sequence order of the four paddles is not obvious, with SDL and Xbox
controllers swapping the order of P2 and P3 relative to each other.
If we group them into left and right, then it becomes more obvious.

Signed-off-by: Simon McVittie <smcv@collabora.com>
2023-08-09 11:03:30 -07:00
Anonymous Maarten be884f0c95 ci: disable visionos.yml by renaming the file 2023-08-09 19:17:20 +02:00
Anonymous Maarten ac094d00f5 ci: add workflow_dispatch event to visionos workflow 2023-08-09 18:59:10 +02:00
Simon McVittie 9be9e2292b build: Consistently use pathlib APIs in cmake/xxd.py
The ability to pass a pathlib.Path to open() was new in Python 3.6,
and the oldest branch of the Steam Runtime only has Python 3.5 available.
Even without considering retrocomputing, using the Path.open method is
more consistent with how we read the input 2 lines earlier.

Signed-off-by: Simon McVittie <smcv@collabora.com>
2023-08-09 15:44:05 +02:00
Sam Lantinga a9f6950657 Fixed deadlock shutting down Android sensors 2023-08-08 23:01:55 -07:00
Sam Lantinga d9f09e77f2 Actually make the sensors magical! 2023-08-08 22:34:41 -07:00
Ravbug 690eae7d22 Implement visionOS support 2023-08-08 22:25:04 -07:00
Sam Lantinga e385d6da0a Fixed build warning 2023-08-08 22:20:49 -07:00
Sam Lantinga 6b93e788fa Improved sensor thread-safety
This fixes an issue where the main thread would hang indefinitely when polling events if sensors were initialized and shutdown on another thread.
2023-08-08 22:09:47 -07:00
Sam Lantinga 4ee0e5a984 Fixed thread-safety warnings 2023-08-08 22:09:47 -07:00
Sam Lantinga 12deed91f8 Added information on how to enable thread-safety analysis 2023-08-08 22:09:46 -07:00
Ryan C. Gordon 5735d2b03b coreaudio: Fixed assertion when device fails/quits mid-iteration.
Fixes #8094.
2023-08-08 23:57:42 -04:00
Ryan C. Gordon 1022fd6e04
testaudio: the test framework opens an audio device at startup; close it.
Not opening a device at all would be more desirable, though.
2023-08-08 21:42:48 -04:00
Ryan C. Gordon 0714da37a4
audio: Fix audio stream callback calculations when future buffer has space.
We were subtracting backwards.  :/
2023-08-08 21:42:48 -04:00
Anonymous Maarten 917e036f6f MSVC has __declspec(deprecated) 2023-08-09 02:54:18 +02:00
Sam Lantinga 279ff8909f Changed example code to avoid potential divide by zero 2023-08-08 16:52:09 -07:00
Sam Lantinga 8a1afc9b10 Fixed Android not sending controller event timestamps 2023-08-08 09:47:49 -07:00
Sam Lantinga 463c456b98 Fill the correct member with the joystick ID in SDL_EVENT_JOYSTICK_UPDATE_COMPLETE 2023-08-08 09:47:49 -07:00
Simon McVittie 55cf1abaa6 test: Don't flag testsurround as suitable for non-interactive use
According to #8088 it has no value as an automated test, and by
default it takes long enough to hit the default test timeout.

Resolves: #8088
Signed-off-by: Simon McVittie <smcv@collabora.com>
2023-08-08 08:45:57 -07:00
Sam Lantinga a2d594269c Fixed pixel format compatibility with SDL2 2023-08-07 22:45:21 -07:00
Sam Lantinga 79a190aa23 Fixed setting invalid bpp for FOURCC formats in SDL_GetMasksForPixelFormatEnum() 2023-08-07 22:20:40 -07:00
SDL Wiki Bot 8fdebdd3e0 Sync SDL3 wiki -> header 2023-08-08 03:37:14 +00:00
Sam Lantinga b903ccf945 SDL_rwops read/write functions return size_t again
The current status is stored in the SDL_rwops 'status' field to be able to determine whether a 0 return value is caused by end of file, an error, or a non-blocking source not being ready.

The functions to read sized datatypes now return SDL_bool so you can detect read errors.

Fixes https://github.com/libsdl-org/SDL/issues/6729
2023-08-07 20:36:21 -07:00
Brick c03f5b4b69 Fixed rounding up in SDL_PrintFloat
This wasn't caught by the 9.9999999 case, because that value is actually just equal to 10.0
2023-08-07 14:15:19 -07:00