Commit Graph

9340 Commits

Author SHA1 Message Date
Simon McVittie 4cb57bf199 .editorconfig: Automatically configure multiple text editors
See editorconfig.org for details of the format, which is understood by
multiple text editors, either directly or via plugins.

This is not comprehensive, but should cover most of the SDL codebase.
Please extend as needed.

Signed-off-by: Simon McVittie <smcv@collabora.com>
2022-05-18 10:21:42 -07:00
Sam Lantinga 06aca7edaa Fixed warping back into the window when gaining focus with warp relative mode enabled 2022-05-18 10:10:51 -07:00
Sam Lantinga 0ffd985972 Check to see if the file exists in the base path before returning it 2022-05-18 10:10:51 -07:00
pionere c4cf63f812 improve test-configuration
- testkeys 'NEEDS_DISPLAY'
- 'disable' relevant tests in case DUMMY audio/video is disabled
2022-05-18 09:06:56 -07:00
Sam Lantinga b44241ab2f Don't send mouse events when warping in relative mode
This fixes games which set relative mode and then did mouse warping at the same time

Reference https://github.com/libsdl-org/SDL/issues/5609
2022-05-18 08:56:09 -07:00
pionere ea15253220 fix GetNearbyFilename
- fix memory leak due to variable 'base'
- fix usage of uninitialized variable (path)
2022-05-18 08:30:34 -07:00
Ivan Epifanov 8c5bda6acd Vita: remove Vita-specific RWOps code 2022-05-18 08:29:25 -07:00
Sam Lantinga aa6ea607d9 Fixed whitespace
Whitespace inconsistencies reported in https://github.com/libsdl-org/SDL/pull/5673
2022-05-18 06:58:14 -07:00
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