Commit Graph

11851 Commits

Author SHA1 Message Date
Ozkan Sezer fd08ca3823 SDL_rwops.c (SDL_IsRegularFile): fix WinRT build failure due to S_ISREG
(cherry picked from commit fcd1c155cc)
2024-01-28 02:21:01 +03:00
Ozkan Sezer 3bf60755cb SDL_RWFromFile, stdio: reject if the file is not a regular file.
Fixes https://github.com/libsdl-org/SDL/issues/8935
(cherry picked from commit 230ae797a7)
2024-01-28 01:45:10 +03:00
Sam Lantinga aac7d1c2ae Report out of memory instead of crashing in SDL_LoadFile_RW()
Fixes https://github.com/libsdl-org/SDL/issues/8935

(cherry picked from commit 5297596132)
2024-01-27 12:17:04 -08:00
Sam Lantinga 55caed2011 Fixed N3DS build
(cherry picked from commit 332213163c)
2024-01-27 11:56:51 -08:00
Sam Lantinga 53058af284 Enable text input on video initialization without popping up an on-screen keyboard
Fixes https://github.com/libsdl-org/SDL/issues/8561

(cherry picked from commit 4ff3b28273)
2024-01-27 11:54:50 -08:00
Ryan C. Gordon ad1a11164c
wasapi: Clamp device->spec.samples to the hardware buffer size.
Reference Issue #8924.
2024-01-26 13:58:38 -05:00
Ryan C. Gordon 5f6a4fe643
blendmode: Corrected docs for `SDL_BLENDOPERATION_[REV_]SUBTRACT`.
They were documented backwards.

Fixes #8910.

(cherry picked from commit ecbbef8b8d)
2024-01-25 17:49:55 -05:00
Sam Lantinga c85ea238ca Improved timing accuracy of SDL_WaitEventTimeout() on Windows
We don't need to use the hack of setting a timer and waiting for a timer message, MsgWaitForMultipleObjects() will allow us to wait for input directly with a timeout.

Before this change, sleeping for 20 ms would actually sleep for around 30 ms, with this change the sleep time is pretty accurate at 20-21 ms.

(cherry picked from commit 2670eb44af)
(cherry picked from commit 08caafe2f1)
2024-01-25 06:37:34 -08:00
Ningyuan Li 5c0b2d04f4 mayflash adapter PS4 support
(cherry picked from commit d6ebbc2fa4)
(cherry picked from commit 138fe3d43d)
2024-01-24 19:26:44 -08:00
Sam Lantinga 76e64053c3 Make sure we include the matching copy of vk_video headers
(cherry picked from commit 1ac9602909)
(cherry picked from commit b16ef14c7c)
2024-01-24 09:42:22 -08:00
Sam Lantinga ddfa59a52b Update to the latest version of the Khronos headers
(cherry picked from commit fc74bf8455)
(cherry picked from commit 0f5a815657)
2024-01-24 09:42:22 -08:00
Sam Lantinga e3fb974fc7 Fixed ambiguity between std::byte and byte in rpcndr.h
Fixes https://github.com/libsdl-org/SDL/issues/8911

(cherry picked from commit a71f99c71f)
(cherry picked from commit 9196584773)
2024-01-23 09:05:29 -08:00
Ozkan Sezer 9120fbd501 make video/pandora to actually compile somehow.
no one ever maintained it for years..
(cherry picked from commit 48b62e2e57)
2024-01-23 17:50:20 +03:00
Ozkan Sezer 52181848da fixes after ShowMessageBox changes:
- SDL_video.c (SDL_ShowMessageBox): remove C99'ism.
- SDL_os2video.c (OS2DIVE_bootstrap): add OS2_ShowMessageBox
- SDL_os2video.c (OS2VMAN_bootstrap): add OS2_ShowMessageBox
- SDL_DirectFB_video.c (DirectFB_bootstrap): NULL ShowMessageBox
- SDL_naclvideo.c (NACL_bootstrap): NULL ShowMessageBox
(cherry picked from commit 9e352e61db)
2024-01-23 04:12:32 +03:00
Ryan C. Gordon 10cbe04fc5
SDL_ShowMessageBox: Remove `#ifdef`s and respect SDL_VIDEO_DRIVER hint.
Fixes #8892.

(cherry picked from commit c5c0b2cb34)
2024-01-22 19:46:23 -05:00
Ryan C. Gordon 8367b00e8c aaudio: Set low-latency audio mode.
Note that apparently this has caused some weird-sounding audio
on some Android devices, so we might wrap this in a hint later,
or try to check for specific devices.

Fixes #8888.

(cherry picked from commit 1e016fd5ea)
2024-01-22 18:28:10 -05:00
Ozkan Sezer 4a4f289adc testhaptic.c: include stdlib.h for exit()
(cherry picked from commit aaf426e280)
2024-01-23 01:20:40 +03:00
Frank Praznik 467f1d52e4 wayland: Always create the backing input store, even if there is no seat
Fixes a crash if no seat was available at initialization, but still allows for one to still be created later if an input device is added.

Manual backport of 84e47b4

(cherry picked from commit a8eeb181b6)
2024-01-22 13:02:58 -05:00
Sam Lantinga ef7261bc41 Updated to version 2.29.2 for RC build 2024-01-22 08:43:05 -08:00
Sam Lantinga 12bab1c981 Fixed warning C4244: '=': conversion from 'Sint64' to 'int', possible loss of data 2024-01-22 08:39:22 -08:00
pionere 61821bd876 fix audio conversion from S16 to F32 using SSE2 2024-01-22 10:45:58 -05:00
Simon McVittie 0f9422a6a5 linux: Handle upower's UP_DEVICE_STATE_PENDING_CHARGE, PENDING_DISCHARGE
On my laptop, the battery is configured to stop charging at around 80%
most of the time, to increase the overall useful lifetime of the battery.
When in that state, upower reports UP_DEVICE_STATE_PENDING_CHARGE
(numeric value 5), which SDL previously mapped to SDL_POWERSTATE_UNKNOWN.
This made the platform_testGetPowerInfo automated test fail, because
it assumes that SDL_POWERSTATE_UNKNOWN means no battery is connected,
and does not expect to see a percentage.

Map UP_DEVICE_STATE_PENDING_CHARGE (5) to SDL_POWERSTATE_CHARGED, which
seems close enough.

Also map UP_DEVICE_STATE_PENDING_DISCHARGE (6) to
SDL_POWERSTATE_ON_BATTERY, which matches how at least GNOME presents it.

Signed-off-by: Simon McVittie <smcv@collabora.com>
(cherry picked from commit eebd5d18a2)
2024-01-22 06:34:12 -08:00
Simon McVittie 55ba686530 test: Run testautomation under Autotools too, not just CMake
The CMake build system runs this since #8313, so we already have to make
sure it doesn't regress.

Signed-off-by: Simon McVittie <smcv@collabora.com>
2024-01-22 06:33:27 -08:00
Simon McVittie 4cb43db1a9 test: Don't distinguish between different categories of tests
It's reasonable to assume that any of them might need a display and an
audio backend. We run them with SDL_VIDEODRIVER and SDL_AUDIODRIVER
set to dummy anyway.

Signed-off-by: Simon McVittie <smcv@collabora.com>
2024-01-22 06:33:27 -08:00
Sylvain 237535b23a
Fixed bug #8897 - SDL_BlitSurface segfault when dest_rect is null 2024-01-22 09:22:41 +01:00
yuanhecai ed5d3d9f82 Fix compilation on loongarch 2024-01-21 19:27:59 -08:00
Frank Praznik f569cc56a9 tests: Fix automated audio tests on Windows and Linux
If a specific audio driver was requested for testing, don't loop over all drivers in the init, open/close, and pause/unpause tests.

Additionally, drivers can fail if attempting to open an audio device when no underlying output is present, which is a valid case if the system has no audio hardware available. Check for the presence of audio output devices before attempting to open them.

Fixes automated tests with various drivers on Windows and Linux.
2024-01-21 23:44:53 +01:00
Frank Praznik 06dd70bc8b video: Use string comparison instead of #ifdefs for driver detection
The dummy driver can be in use on these platforms, so check the actual driver name string.

Fixes the automated video tests with the dummy driver on Win32.
2024-01-21 23:44:53 +01:00
Anonymous Maarten a420eb79bb cmake: run testautomation with CTest on ci 2024-01-21 23:44:53 +01:00
Anonymous Maarten 41fc398114 Move check for SDL_Delay upper bounds to testtimer
(cherry picked from commit f45761908a)
2024-01-21 23:44:53 +01:00
Anonymous Maarten 1737340978 Use helper_ddtod function to compare atan2 infinity cases
This fixes a test failure when building on mingw32 in Release mode.
2024-01-21 23:44:53 +01:00
Anonymous Maarten 69a6efcd1b Avoid using higher precision floating point numbers by using it in a function 2024-01-21 23:44:53 +01:00
Anonymous Maarten fbee0b86bf video: verify SDL_GetNumVideoDisplays is succesful 2024-01-21 23:44:53 +01:00
Anonymous Maarten 880c69392a testautomation_math: do relative comparison + more precise correct trigonometric values 2024-01-21 23:44:53 +01:00
Anonymous Maarten 811adaa342 Only test error message when using specific video drivers
The dummy driver does not sen an error message when passing
a NULL rect argument to SDL_SetTextInputRect.
2024-01-21 23:44:53 +01:00
Sylvain 5368f45567 Remove one test that contains call of SDL_Quit() / SDL_Init() because it
conficts with the initializaion of test common.
(before it used SDL_VideoInit SDL_VideoQuit which weren't perturbated by SDL_Quit())
2024-01-21 23:44:53 +01:00
Sylvain 3d5679bb8e Fix video_getSetWindowPosition() that fail when checking events,
because testautomation_events.c() didn't finish to poll all events before

(cherry picked from commit 3ccfd361cb)
2024-01-21 23:44:53 +01:00
Sam Lantinga e3203278f4 Updated tests so they'll pass if we enable the C runtime in SDL2.dll
This isn't needed here, but will be necessary for sdl2-compat
2024-01-21 11:23:50 -08:00
Ethan Lee b5aec14d43 gdk: Backport SDL3 MR #8844
Co-authored-by: chalonverse <sanjay12@gmail.com>
2024-01-21 13:55:17 -05:00
Ozkan Sezer 8eb2ec6a8d watcom makefiles: remove yuv_rgb_lsx.c from sources 2024-01-21 11:56:20 +03:00
Sam Lantinga 83f3045ee8 Revert "updated WhatsNew.txt"
This reverts commit c3a3f18076.
2024-01-20 05:28:05 -08:00
Sylvain f1bc5f305c
Prevent asan warning on qsort():
'src/stdlib/SDL_qsort.c:27:5: runtime error: null pointer passed as argument 1, which is declared to never be null`

(cherry picked from commit 2cd583ee13)
2024-01-20 11:26:37 +01:00
Ozkan Sezer c3a3f18076 updated WhatsNew.txt 2024-01-20 11:51:00 +03:00
Sylvain 5d6eb4a5a5
Fixed overflow in SDL_SoftStretch() (see #8878)
(cherry picked from commit 7b02d328fa)
2024-01-20 06:39:21 +01:00
Sam Lantinga cfc22ac7d7 Added patch notes for the SDL 2.30.0 release 2024-01-19 20:11:07 -08:00
Sam Lantinga b4f99deb9e Updated to version 2.29.1 for RC build 2024-01-19 19:58:24 -08:00
Ryan C. Gordon 1e13aa2c98
androidaudio: same fix as AAudio for pausing thread when backgrounding app.
Reference Issue #8748.
2024-01-19 22:15:27 -05:00
Sam Lantinga 109bb2f17e Make sure the render target isn't bound as a resource
Fixes https://github.com/libsdl-org/SDL/issues/3380

(cherry picked from commit a73132177d)
2024-01-19 15:18:14 -08:00
Sam Lantinga f7ab765b84 Fixed crash scaling very large surfaces
Fixes https://github.com/libsdl-org/SDL/issues/8878

(cherry picked from commit 09ba55b462)
2024-01-19 13:06:57 -08:00
Ryan C. Gordon 910e040e9e
aaudio: Block the audio device thread when in the background.
Fixes #8748.
2024-01-19 15:10:43 -05:00