Commit Graph

9332 Commits (56665e1d9de9a5062b1933f4d51266b47f809f2a)

Author SHA1 Message Date
Ryan C. Gordon 56665e1d9d cocoa: Try to use better system cursors.
These try to pull from the .pdf files that are installed with
macOS, which fit our needs better, and fall back to the most
reasonable defaults available from NSCursor if we can't load
them.

Since these are installed under /System, they should be sandbox
accessible, and if this totally fails, it should still go on,
albeit with a less good cursor.

Reference Issue #2123.
2022-05-17 12:51:08 -04:00
Ryan C. Gordon a12ffbd532 testcustomcursor: Log the current cursor type as it changes.
So you know what you're looking at.
2022-05-17 12:49:36 -04:00
Alex Szpakowski e9c7b5191c macOS: Fix reference counts of internal window data.
Fixes crashes when destroying or recreating a window (#5664).
2022-05-16 18:17:27 -07:00
Ozkan Sezer a48004952d disable dynapi for os/2, at least for now. (see bugs #5667 and #5669.) 2022-05-17 01:33:20 +03:00
Ozkan Sezer ec1a0f62dd SDL_malloc.c: workaround calling convention issues for real_xxx procs. 2022-05-17 01:33:02 +03:00
Sam Lantinga 1f2a241688 Add new virtual joysticks to the end of the list
This guarantees that the device index that's returned is stable, as long as no joystick hotplug events occur.
2022-05-16 09:02:35 -07:00
Sam Lantinga 3c3ccb1d48 Fixed crash if a virtual joystick was disconnected 2022-05-16 08:56:17 -07:00
Ryan C. Gordon 2317a96c8e
x11: Use XC_top_left_corner/XC_top_right_corner instead of XC_fleur.
On Gnome (and hopefully others!), this produces something that actually
matches SDL_SYSTEM_CURSOR_SIZENWSE/SDL_SYSTEM_CURSOR_SIZENESW. On
other desktop enviroments, it probably fits the spirit better than
XC_fleur in any case.

Reference Issue #2123.
2022-05-16 10:53:01 -04:00
Sam Lantinga 48b6cd8bc2 Fixed whitespace 2022-05-16 07:23:30 -07:00
Sam Lantinga f0bc5c9cbf Added effects support for virtual controllers 2022-05-16 07:21:28 -07:00
Sam Lantinga b3a18706ee Removed unused variables 2022-05-16 06:37:38 -07:00
Sam Lantinga 7e005bd843 Fixed mapping the paddle buttons with the virtual controller 2022-05-16 06:22:18 -07:00
Sam Lantinga e3fd8feae6 Fixed getting the controller index when specifying --virtual (thanks @zturtleman) 2022-05-16 06:17:23 -07:00
SDL Wiki Bot 5953422c09 Sync wiki -> header 2022-05-16 03:52:04 +00:00
Ryan C. Gordon e78a72ec38
fnsince.pl: Fix next version value to match new versioning scheme. 2022-05-15 23:50:41 -04:00
Sam Lantinga bfac54b59c Added the ability to specify which buttons and axes are present for virtual controllers 2022-05-15 20:34:44 -07:00
SDL Wiki Bot 49ca8bf520 Sync wiki -> header 2022-05-16 03:03:04 +00:00
Sam Lantinga 94eeb587c1 First pass at extending virtual controller functionality
Added the ability to specify a name and the product VID/PID for a virtual controller

Also added a test case to testgamecontroller, if you pass --virtual as a parameter
2022-05-15 20:01:12 -07:00
Sam Lantinga 7ad15c5b8f Added game controller support for virtual joysticks
Fixes https://github.com/libsdl-org/SDL/issues/5662
2022-05-15 09:35:52 -07:00
Sam Lantinga 996b3dc37a Fixed warning building with Visual Studio 2022-05-15 09:33:28 -07:00
Cameron Cawley e0f3da497f Remove unused SDL_ASSEMBLY_ROUTINES define 2022-05-12 14:37:00 +03:00
SDL Wiki Bot f93e810780 Sync wiki -> header 2022-05-12 07:39:04 +00:00
Sylvain 6b9884d40a
Fixed bug #4213 - update documentation to reflect SDL2 behavior of SDL_RenderGetLogicalSize 2022-05-12 09:36:49 +02:00
Ethan Lee e4bb3c8649 wayland: Fix build for configs without libdecor 2022-05-11 18:13:44 -04:00
Ethan Lee 6222bd3143
wayland: Don't create a new libdecor context if one already exists 2022-05-11 16:26:43 -04:00
Ethan Lee 6f88cbe4c9 wayland: Support xdg_decoration requesting client-side decorations.
Don't be fooled by the diff size - this ended up being a big refactor of the
shell surface management, masked only by some helper macros I wrote for the
popup support.

This change makes it so when xdg_decoration is supported, but CSD is requested,
the system bails on xdg support entirely and resets all the windows to use
libdecor instead. This transition isn't pretty, but once it's done it will be
smooth if decorations are an OS toggle since libdecor will take things from
there.

In hindsight, we really should have designed libdecor to be passed a toplevel,
having it manage that for us keeps causing major refactors for _every_ change.
2022-05-11 13:13:59 -07:00
Eddy Jansson d7866ffac8 assert: Check for integer overflow.
Move rendering of the assert message into a separate
function so we can remove the ugly loop construction.

Changes the logic such that allocation failure no longer
immediately returns SDL_ASSERTION_ABORT, instead we
fall back to the truncated message.

If an error is indicated from SDL_snprintf, then we do
abort with SDL_ASSERTION_ABORT.
2022-05-11 12:55:49 -07:00
Sam Lantinga 737b4fc32c Added -fobjc-arc to support automatic reference counting on macOS 2022-05-11 11:17:58 -07:00
Michael Fitzmayer 9b75fa0165
N-Gage port: add changes from code reviews, overall cleanup (#5618)
* Add changes from code review by @ccawley2011, #5597, overall cleanup

* Update N-Gage README, minor cleanup and rephrasing

* Call SDL_SetMainReady() before calling SDL_main, return SDL_main instead of main
2022-05-11 09:31:34 -07:00
Sam Lantinga 2c2cbbe664 Fixed function reference for SDL_SIMDGetAlignment() 2022-05-11 09:04:23 -07:00
Sam Lantinga 6da99d4a6c Don't use SDL_SIMDFree() if the pixels haven't been allocated with SDL_SIMDAlloc() 2022-05-11 08:40:17 -07:00
Cameron Cawley 2f924020e8 Add SDL_SCANCODE_CALL and SDL_SCANCODE_ENDCALL 2022-05-10 16:12:10 -07:00
Cameron Cawley 2bc373622b Add SDL_SCANCODE_SOFTLEFT and SDL_SCANCODE_SOFTRIGHT 2022-05-10 16:12:10 -07:00
Alex Szpakowski f871c178b9 macOS: remove dead code for supporting 10.6 at runtime. 2022-05-10 14:04:14 -07:00
Simon McVittie 8ab3ae98f0 stdinc: Add a comment to clarify why inline functions are needed here
Signed-off-by: Simon McVittie <smcv@collabora.com>
2022-05-10 06:50:54 -07:00
Eddy Jansson f7280dcebb log: Check for integer overflow. 2022-05-10 06:47:11 -07:00
Alex Szpakowski ec8fa57750 macOS: always use Objective-C ARC (automatic ref counting).
Change Cocoa SDL_VideoData and SDL_WindowData implementations from C structs to Objective-C objects, since bridging between C and ObjC is easier that way.
2022-05-09 21:53:40 -07:00
Alex Szpakowski d35c737f1c macOS: change min supported OS from 10.6 to 10.7. 2022-05-09 21:53:40 -07:00
Ozkan Sezer 6422a5d259 updated config.guess and config.sub from mainstream 2022-05-10 07:33:32 +03:00
Simon McVittie 2a7948016a cpuinfo: Check for overflow in SIMD allocation
If the size to be allocated is very large and untrusted, then adding
the padding etc. might be enough to cause unsigned overflow, after
which a very small amount of memory will be allocated.

Signed-off-by: Simon McVittie <smcv@collabora.com>
2022-05-09 21:31:39 -07:00
Simon McVittie cf1daafa3f cpuinfo: Set padding to 0 if none is needed
It'll be simpler to use overflow detection after this refactor.

Signed-off-by: Simon McVittie <smcv@collabora.com>
2022-05-09 21:31:39 -07:00
Simon McVittie d15f6e379c test: Add a unit test for overflow detection
Signed-off-by: Simon McVittie <smcv@collabora.com>
2022-05-09 21:31:39 -07:00
Simon McVittie f661654fad stdinc: Add overflow-checking add and multiply for size_t
This can be used to check whether untrusted sizes would cause overflow
when used to calculate how much memory is needed.

Signed-off-by: Simon McVittie <smcv@collabora.com>
2022-05-09 21:31:39 -07:00
Simon McVittie 6e6e425e23 workflows: Do the equivalent of Automake `make distcheck`
The official source code release isn't much use unless it contains
everything that users and downstream distributions need to do a
new build, so check that it does.

Signed-off-by: Simon McVittie <smcv@collabora.com>
2022-05-09 08:47:02 -07:00
Cameron Cawley c71ee68b8a Fix enabling tests on platforms without testnative support 2022-05-08 17:38:48 -07:00
Cameron Cawley 318b5577f9 Delete gcc-fat.sh 2022-05-08 17:38:22 -07:00
Cameron Cawley 9ef6885743 Fix MSVC ARM32 builds 2022-05-08 18:21:02 +03:00
Frank Richter b352b78345 Add 'static VCRT' cases to MSVC build matrix 2022-05-07 08:10:52 -07:00
Frank Richter 0e63b514d5 Don't define memcpy(), memset() when using static VC runtime.
The linker will complain about duplicated symbols otherwise
(see #3662, #5156).
2022-05-07 08:10:52 -07:00
Sam Lantinga 8cd908e0b9 Fixed building with Visual Studio 2013
Added SDL_vacopy.h since it needs to be included after Windows headers
2022-05-06 10:51:55 -07:00