Commit Graph

2579 Commits (a0934a23fd0c308a58ec0b7c908829980f34fb6b)

Author SHA1 Message Date
Sylvain Becker 97901b9f97 Fixed bug 4820 - SDL assumes RW_SEEK_SET == SEEK_SET 2019-10-10 17:21:46 +02:00
Ryan C. Gordon a747106c97 linux: If D-Bus isn't available on the system, don't keep trying to load it.
Fixes Bugzilla #4476.
2019-10-09 19:38:16 -04:00
Ryan C. Gordon cf092eca90 mouse: Save initial position yet even if xrel and yrel are 0.
The X11 target sets mouse->last_x and last_y in EnterNotify and then calls
SDL_SendMouseMotion(), which throws away the new position because it matches
the mouse->last_x and last_y we just set, meaning that if the pointer is
in the window when it created, SDL_GetMouseState() will report a position of
0,0 until a MotionNotify event (the pointer moves) arrives and corrects the
mouse state.

Mostly fixes Bugzilla #1612.
2019-10-09 13:42:13 -04:00
Ryan C. Gordon b38a5ba062 dynapi: Make gendynapi.pl work on older Perl releases. 2019-10-05 20:19:10 -04:00
David Ludwig c61ca915fb WinRT: fix a link-time error when building UWP + x64 2019-10-02 14:55:02 -04:00
Sam Lantinga 3b3dbb5adb Removed unused volume check interval 2019-10-01 08:50:04 -07:00
Sylvain Becker 7d47f526a7 SDL_LockTextureToSurface: robustness of locked region compared to texture size 2019-10-01 09:26:30 +02:00
Ozkan Sezer a664e95d65 dynapi: move new SDL_LockTextureToSurface addition to the end of file. 2019-10-01 00:05:50 +03:00
Sylvain Becker 1ae61f1009 Added a helper function SDL_LockTextureToSurface()
Similar to SDL_LockTexture(), except the locked area is exposed as a SDL surface.
2019-09-30 20:58:44 +02:00
Sam Lantinga 191fe25b1a Fixed rtkit feature guard 2019-09-27 15:21:31 -07:00
Sam Lantinga 84dc44e24d Fix the RealtimeKit dbus include guards
The SDL_USE_LIBDBUS define is set inside SDL_debug.h, therefore the
circular dependency made it impossible for this feature to be enabled.

Instead, guard SDL_dbus.h based on the autoconf variable HAVE_DBUS_DBUS_H

Additionally, fix one of the rtkit comments. CAP_SYS_NICE isn't required
to achieve high priority. But there is some scheduler config that rtkit
needs the app to setup.
2019-09-27 15:21:27 -07:00
Ryan C. Gordon 4001e6b351 stdlib: Patched to compile. 2019-09-26 13:44:49 -04:00
Ryan C. Gordon 987aa3113c stdlib: Try to coerce VS2019 to not replace some loops with memset() calls.
Fixes (?) Bugzilla #4759.
2019-09-26 12:55:05 -04:00
Ryan C. Gordon aef1ed4ac6 audio: Set (something close to) the correct silence value for U16 audio.
Partially fixes Bugzilla #4805.
2019-09-25 15:40:27 -04:00
Ryan C. Gordon 693755f0b2 coreaudio: Apple doesn't support U16 data, so convert in that case. 2019-09-25 15:07:07 -04:00
Brandon Schaefer ee6d504ae9 offscreen: Define missing define on a older EGL for an EXT function which it wont have 2019-09-24 17:49:53 -04:00
Brandon Schaefer 8a41948e7f offscreen: Avoid using EGLDeviceEXT as it causes issues with older platforms, which is just a void* 2019-09-24 17:27:51 -04:00
Brandon Schaefer 68985371a0 offscreen: Add new video driver backend Offscreen
The Offscreen video driver is intended to be used for headless rendering
  as well as allows for multiple GPUs to be used for headless rendering

Currently only supports EGL (OpenGL / ES) or Framebuffers
Adds a hint to specifiy which EGL device to use: SDL_HINT_EGL_DEVICE
Adds testoffscreen.c which can be used to test the backend out
Disabled by default for now
2019-09-24 16:36:48 -04:00
Jinke Fan abd1dd6617 Add Hygon Dhyana processor support
Background:
    Chengdu Haiguang IC Design Co., Ltd (Hygon) is a Joint Venture
    between AMD and Haiguang Information Technology Co.,Ltd., aims at
    providing high performance x86 processor for China server market.
    Its first generation processor codename is Dhyana, which
    originates from AMD technology and shares most of the
    architecture with AMD's family 17h, but with different CPU Vendor
    ID("HygonGenuine")/Family series number(Family 18h).

Related Hygon kernel patch can be found on:
http://lkml.kernel.org/r/5ce86123a7b9dad925ac583d88d2f921040e859b.1538583282.git.puwen@hygon.cn

Best regards.
2019-05-15 19:54:36 +08:00
Sam Lantinga 3fe2d8368c Updated SDL development builds to version 2.0.11 2019-09-22 10:37:16 -07:00
Sam Lantinga cbde0ffa3d The PS4 is ignoring the volume values in the report, so we don't need to fill them in. 2019-09-19 16:50:49 -07:00
Sylvain Becker 79e388bfd8 Fixed bug 4798 - PNG w/transparency breaks in SDL 2.0.10 but works in SDL 2.0.9 2019-09-10 17:12:34 +02:00
Sam Lantinga 791df27a30 Fixed compiler warning on Android 2019-09-09 13:50:46 -07:00
Sam Lantinga 715e070d29 SDL_blit_N.c: Correct vec_perm() application on little-endian 64-bit PowerPC
The LE transformation for vec_perm has an implicit assumption that the
permutation is being used to reorder vector elements (in this case 4-byte
integer word elements), not to reorder bytes within those elements.  Although
this is legal behavior, it is not anticipated by the transformation performed
by the compilers.

This causes pygame-1.9.1 test failure on PPC64LE because blitted pixmaps are
corrupted there due to how SDL uses vec_perm().

From RedHat / Fedora: https://bugzilla.redhat.com/show_bug.cgi?id=1392465
Original patch was provided by: Menanteau Guy <menantea@linux.vnet.ibm.com>
2019-09-06 08:50:19 -07:00
Conn O'Griofa 2d37d29183 KMSDRM_GLES_SwapWindow: fix non-vsync case
If KMSDRM_drmModeSetCrtc is called when the swap interval is
set to 0, the driver behaves as though vertical sync is engaged by
limiting framerate to the refresh rate, but performance is much worse
than with vertical sync enabled.

Resolve this issue by ensuring that the Crtc is only set up once,
and KMSDRM_drmModePageFlip is called, albeit without any followup
queueing or waiting for flips.
2019-09-06 08:44:46 -07:00
Sam Lantinga aaec90e5c5 Fixed bug 4789 - Linux accelerometers no longer available as joysticks
Daniel Drake

A long time ago, it was possible to play neverball on Linux using the accelerometer found in HP laptops.

The kernel exposes the accelerometer as a joystick (/dev/input/jsX) as well as an evdev device (/dev/input/eventX). I guess it worked fine when SDL was using the js interface, but then stopped working here: http://hg.libsdl.org/SDL/rev/fdaeea9e7567

Looking at current code which uses udev to discover joysticks, it looks for the udev tag ID_INPUT_JOYSTICK.

However udev's internal input_id logic specifically tags accelerometers as ID_INPUT_ACCELEROMETER and nothing else.

This looks like a good fit for SDL_HINT_ACCELEROMETER_AS_JOYSTICK.
2019-09-06 08:42:54 -07:00
Ozkan Sezer 8a394209c4 SDL_windowsevents.c: remove isVistaOrNewer (not used since 8cb1dc50bb28) 2019-09-05 20:47:20 +03:00
Sylvain Becker bf2f4703f2 SDL_windowsmessagebox.c: remove unused variable 2019-09-05 10:49:53 +02:00
Sylvain Becker 1b5e3c19a2 SDL_bmp.c: remove unused variable warnings 2019-09-05 10:08:47 +02:00
Sam Lantinga e5580e18ba x11: add a hint to force the VisualID used when creating a window. 2019-09-04 09:27:58 -07:00
Sam Lantinga 892c8d5058 Fixed bug 4536 - Heap-Buffer Overflow in SDL_GetRGB pertaining to SDL_pixels.c
Ozkan Sezer

As for the issue: This bmp reports bpp=0, therefore SDL_CalculatePitch()
returns pitch==0, which is then fed to SDL_malloc() (which is malloc())
and malloc(0) returns _something_ which is not NULL but not someting
that we expect..  Then testsprite.c:LoadSprite() accesses the pixels
as *(Uint8*)pixels which valrind reports as:

==15533== Invalid read of size 1
==15533==    at 0x8048C08: LoadSprite (testsprite.c:45)
==15533==    by 0x80492FC: main (testsprite.c:224)
==15533==  Address 0x449e588 is 0 bytes after a block of size 0 alloc'd
==15533==    at 0x40072B2: malloc (vg_replace_malloc.c:270)
==15533==    by 0x4045719: SDL_CreateRGBSurface (SDL_surface.c:126)
==15533==    by 0x40403C1: SDL_LoadBMP_RW (SDL_bmp.c:237)
==15533==    by 0x8048BB2: LoadSprite (testsprite.c:36)
==15533==    by 0x80492FC: main (testsprite.c:224)

Besides, valrind also reports this:
==15533== Conditional jump or move depends on uninitialised value(s)
==15533==    at 0x40403F3: SDL_LoadBMP_RW (SDL_bmp.c:247)
==15533==    by 0x8048BB2: LoadSprite (testsprite.c:36)
==15533==    by 0x80492FC: main (testsprite.c:224)


Easy/quick solution would be early-rejecting a bmp with 0 bpp from SDL_bmp.c:SDL_LoadBMP_RW()
2019-09-03 11:55:20 -07:00
Ozkan Sezer b21338eb54 SDL_bmp.c: restore most of the original formatting. 2019-09-02 12:35:00 +03:00
Ryan C. Gordon 847bd8d983 direct3d: Be more aggressive about resetting state when textures go away.
Fixes Bugzilla #4768.
2019-09-02 00:11:58 -04:00
Ryan C. Gordon a3804ba1da d3d11: Fixed VB state, avoiding unnecessary recreation (Thanks, Alex!).
Fixes Bugzilla #4779.
2019-09-01 22:41:44 -04:00
Sylvain Becker 6c295129ba LoadBMP: fix some warnings 2019-08-31 22:58:11 +02:00
Sylvain Becker 830979c555 LoadBMP: use code from SDL_image which allows loading compressed BMP files 2019-08-31 22:52:15 +02:00
Sam Lantinga cc64b369fb Allow mouse messages from Wacom pens, e.g. right click pen buttons, etc. 2019-08-30 15:32:15 -07:00
Sam Lantinga afb9ff9507 Fixed bug where the Steam overlay would generate an event and stop input processing for the frame. 2019-08-30 08:03:19 -07:00
Ozkan Sezer 9c8e403f6b use 'U' suffix on constants instead of (unsigned int) cast. 2019-08-30 11:35:20 +03:00
Sylvain Becker d52080c0ab Android: minor warning 2019-08-30 09:00:06 +02:00
Sylvain Becker 70dc8d1648 Android: fix corresponding warnings 2019-08-30 08:55:20 +02:00
Sam Lantinga 13c4d5e7e3 Fixed Windows relative mouse coordinates when capturing the mouse over RDP 2019-08-26 17:43:01 -07:00
Alex Szpakowski 0c26373842 gl/gles/gles2 render: fix SDL_RenderClear being affected by the clip rect in some situations. 2019-08-26 18:49:04 -03:00
Sam Lantinga ce3b16fc9e Fixed bug 4475 - add Gasia Co. Ltd PS(R) Gamepad support
Frank

This gamepad/controller is sold in Germany https://www.amazon.de/gp/product/B01AQTPSA6/ref=ppx_yo_dt_b_asin_title_o03__o00_s00 but isn't supported right now. It identifies as "Gasia Co. Ltd PS(R) Gamepad"
2019-08-26 10:08:25 -07:00
Ozkan Sezer 1e47790c8d RPI_FreeCursor: set global_cursor to NULL to prevent double-free (bug 4769) 2019-08-26 18:41:40 +03:00
Sylvain Becker 2cb26188e1 Fixed bug 1663 - SDL_EventState(SDL_DOLLARGESTURE,SDL_IGNORE) etc. has no effect 2019-08-24 20:40:37 +02:00
Sam Lantinga 455944c870 Fixed whitespace 2019-08-22 16:12:16 -07:00
Sam Lantinga b521df66c3 [SDL][IOS] Audio fix - applies stream to sound data when resampling or reformatting is required. 2019-08-22 16:09:42 -07:00
Sam Lantinga 5c15e81cfb Prevent the SPEEDLINK COMPETITION PRO joystick from switching into Android controller mode when enumerated over HID on Windows 10. 2019-08-22 15:58:00 -07:00
Alex Szpakowski dd29abb478 macOS: Use the proper type (NSSize instead of CGSize) for the bounds of metal views. 2019-08-22 19:23:52 -03:00