Commit graph

11849 commits

Author SHA1 Message Date
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 52975961326797558d1c66a02cb32870ff7be6d4)
2024-01-27 12:17:04 -08:00
Sam Lantinga 55caed2011 Fixed N3DS build
(cherry picked from commit 332213163c395bb73ac3969d0a66ee19be1d90ff)
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 4ff3b28273a9b64892620435231539a1d2c98301)
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 ecbbef8b8df954da96829c06bac4ad208f83dddd)
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 2670eb44afec9311ee8fbec447703c427db1e1c8)
(cherry picked from commit 08caafe2f1044ae9baaf77507bba24c29adf551f)
2024-01-25 06:37:34 -08:00
Ningyuan Li 5c0b2d04f4 mayflash adapter PS4 support
(cherry picked from commit d6ebbc2fa4abdbe0bd53d0ce8804a492ecb042b9)
(cherry picked from commit 138fe3d43d4ee760cb2afc4f4d767abf20ca8e75)
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 1ac960290920d424b7d2016a29f137b0b85ae2a6)
(cherry picked from commit b16ef14c7c935d3d39b7c925d5266b5193d343c4)
2024-01-24 09:42:22 -08:00
Sam Lantinga ddfa59a52b Update to the latest version of the Khronos headers
(cherry picked from commit fc74bf8455fe30fd577783ce67376f18ca3b488c)
(cherry picked from commit 0f5a815657c858822e9f7f66dc2d5a997635b94e)
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 a71f99c71f785e88db0b48599bb52ebe76e2b78e)
(cherry picked from commit 9196584773219f43d0294623322ffe2af358690e)
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 48b62e2e57e3eea2b84ed3147f5ea9223a8f63bd)
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 9e352e61db6836e85e24e9f2497dee5a62d8e212)
2024-01-23 04:12:32 +03:00
Ryan C. Gordon 10cbe04fc5
SDL_ShowMessageBox: Remove #ifdefs and respect SDL_VIDEO_DRIVER hint.
Fixes #8892.

(cherry picked from commit c5c0b2cb3447a9aecbb7c47622baa945ab43227b)
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 1e016fd5eaa3b78248fc9e14a5958c0a884b76b8)
2024-01-22 18:28:10 -05:00
Ozkan Sezer 4a4f289adc testhaptic.c: include stdlib.h for exit()
(cherry picked from commit aaf426e280f8bbfbae3111fd5d8b6d68fbcf6404)
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 a8eeb181b68b2ee214e9c5f239278147ae0f5fbc)
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 eebd5d18a2af0f3505791d7d40c2ec2bb5c08bb6)
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 f45761908aa88c61cf7f2b7cb2e663abee06eed0)
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 3ccfd361cb4ff081f7696e5fbc4174f5d4aa1ca1)
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 2cd583ee13ec4660d7fbe6e6d8293744d3343071)
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 7b02d328fa691a18583fdc762541c7fb8c1ba09b)
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 a73132177d3311e70196f8de4e8a2e3b0b70cbcf)
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 09ba55b462b826070482a586b72906fae4a66b32)
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
Sylvain Becker bb969ac747 Fixed bug #7614: Segmentation Fault in SDL_BlitSurface (#7808)
Update SDL_BlitSurface to use Intersect functions

(cherry picked from commit 3639743d8909406557663af0854dc7bd97956b24)
2024-01-19 08:53:16 -08:00
Sam Lantinga 87b5bb5840 Fixed potential overflow in software triangle rendering
(cherry picked from commit bd5d4d61edc95f1f003ec91597418fc416ff8315)
2024-01-19 08:33:39 -08:00