Commit graph

5169 commits

Author SHA1 Message Date
Philipp Wiesemann
c2c68ea945 Removed unnecessary NULL check. 2014-10-29 22:41:01 +01:00
Philipp Wiesemann
6c207f2522 Updated gamecontroller database sorting script to work with Python 3. 2014-10-29 20:35:21 +01:00
Philipp Wiesemann
290396bf46 Fixed SDL_AddHintCallback() crashing if no more memory available.
The return value of SDL_malloc() was not checked and NULL therefore not handled.
Also added setting of error message for the other SDL_malloc() in this function.
2014-10-29 20:29:32 +01:00
Philipp Wiesemann
0f7e05d107 Fixed bug 2647 - Memory leak in SDL_AddHintCallback function - SDL_hints.c
Nitz

Variable entry going out of scope leaks the storage it points to, at:

        /* Need to add a hint entry for this watcher */
        hint = (SDL_Hint *)SDL_malloc(sizeof(*hint));
        if (!hint) {
            return;
        }

Patch is attached.
2014-10-29 20:20:47 +01:00
Philipp Wiesemann
76173b195e Added handling of NULL as input for SDL_GameControllerAddMapping(). 2014-10-26 23:28:45 +01:00
Philipp Wiesemann
bbbe3edca1 Fixed SDL_GameControllerMappingForGUID() crashing if no more memory available.
The return value of SDL_malloc() was not checked and NULL therefore not handled.
NULL returned by SDL_GameControllerMapping()/SDL_GameControllerMappingForGUID()
now either means "no mapping" (as before) or "no memory" (just crashed before).
2014-10-26 23:22:53 +01:00
Philipp Wiesemann
8869fe78be Added handling of NULL as input for SDL_GameControllerMapping().
For consistency with the similar functions getting SDL_GameController as input.
Also NULL is no SDL_GameController and therefore can not have a mapping anyway.
2014-10-26 17:53:16 +01:00
Philipp Wiesemann
81958288cc Removed two wrong documentation comments from gamecontroller source.
No replacement because correct documentation is already in SDL_gamecontroller.h.
2014-10-26 17:46:11 +01:00
Philipp Wiesemann
788b558bc8 Fixed wording in SDL_GameControllerAddMappingsFromRW() error message. 2014-10-26 17:44:00 +01:00
David Ludwig
a2d97fa398 WinRT: more keyboard code cleanups
- made keycode listings a bit easier to read
- listed VK_ keycode names, where appropriate
- removed a few pieces of dead + commented-out code
- applied a common 'WINRT_' prefix to internal function names
2014-10-26 12:33:10 -04:00
David Ludwig
896dd09b7e WinRT: Fixed bug whereby key-detection code could call SDL_Log 2014-10-25 08:54:23 -04:00
David Ludwig
f10f7bb06e WinRT: fallback to scancode key detection, if VirtualKey/VK detection fails 2014-10-25 08:50:41 -04:00
David Ludwig
21e4c95f1b WinRT: more keyboard code cleanups
- use SDL_arraysize where appropriate
- made long lines of debug-logging code span multiple lines, for easier reading
2014-10-25 08:43:51 -04:00
David Ludwig
19d42e504c WinRT: Fixed bug whereby a right-shift key might get reported as left-shift 2014-10-24 22:09:47 -04:00
David Ludwig
4cf559817c WinRT: minor keyboard code cleanup
An internally-used hash table was replaced with a plain switch statement.
2014-10-24 21:25:21 -04:00
Philipp Wiesemann
f268bb07a9 Added new key codes from Android 4.4 (API 20) and 5.0 (API 21). 2014-10-24 19:50:29 +02:00
Brandon Schaefer
03baaacff1 Remove unused variable. 2014-10-24 06:52:54 -07:00
Brandon Schaefer
a511d312f9 Merge patch for bug 2750. Thanks Sylvain! 2014-10-24 06:50:09 -07:00
Philipp Wiesemann
69e989c667 Fixed setting of screen saver state crashing on some version of Android.
Setting Window flags seems to affect Views and must be handled on UI thread.
2014-10-20 22:19:09 +02:00
Gabriel Jacobo
0ec4fc6589 Bug 2739 - [Android] No support for SDL_DisableScreenSaver by Martin Gerhardy 2014-10-20 10:10:39 -03:00
Philipp Wiesemann
a32480ef1f Fixed bug 2476 - Allow custom main() arguments
rettichschnidi

I would like to pass custom arguments from my Java code (subclass of SDLActivity) to the native SDL2 binary.
2014-10-17 23:36:45 +02:00
Philipp Wiesemann
3c95d5a482 Fixed typo in source comment. 2014-10-17 23:26:02 +02:00
Sam Lantinga
fd375409e7 Added a platform cleanup function for the Vivante video driver 2014-10-16 09:54:13 -07:00
Gabriel Jacobo
c1953dac90 [udev] Fixes #2654, ID_INPUT_KEY devices are ignored.
Also added some references to udev code where these flags are set.
2014-10-16 09:41:42 -03:00
Gabriel Jacobo
215d8fc793 [X11] Obey DISPLAY environment variable when selecting screen (Steaphan Greene)
Discussed in bug #2192, tested with Xvfb in dual head configuration.
2014-10-15 18:33:43 -03:00
David Ludwig
bfadd3090b WinRT build fix 2014-10-15 15:50:35 -04:00
Sam Lantinga
ab1bbeb596 Expanded the iMX6 video driver into a general Vivante video driver that works across multiple SoCs 2014-10-15 09:18:17 -07:00
Sam Lantinga
a2319e58ba Better error reporting for video drivers with less than full functionality. 2014-10-15 09:14:09 -07:00
Sam Lantinga
ee23cd28c7 Fixed bug where EGL function pointers wouldn't get saved in optimized gcc builds 2014-10-15 09:13:36 -07:00
Sam Lantinga
d207ba1ee6 Fixed spurious SDL error on shutdown if mouse capture isn't supported 2014-10-15 09:11:15 -07:00
Sam Lantinga
9bf16b9b1a Fixed input device detection on systems that aren't running the udev daemon 2014-10-15 09:10:50 -07:00
Sam Lantinga
e1350b2302 Fixed crash if the event subsystem didn't initialize properly 2014-10-15 09:09:57 -07:00
David Ludwig
d3886466c4 WinRT: fixed bug whereby offscreen-rendered content could get improperly rotated
Attributes on the host device's rotation were getting applied to offscreen
textures in an invalid manner.  This was causing some apps to look different,
depending on how the device was rotated.

--HG--
extra : rebase_source : 6c4e6b4b6386c34677532d2744d4e351ae6e9be0
2014-10-14 09:53:46 -04:00
Sam Lantinga
e3348efdf0 Fixed log typo 2014-10-13 14:10:41 -07:00
Sam Lantinga
c6db261ed3 Minor cleanups 2014-10-13 10:46:27 -07:00
Gabriel Jacobo
49225a66cf [Android] Better fix for #2480, pause/resume audio 2014-09-18 11:03:34 -03:00
Ryan C. Gordon
5ac5bdcea5 Haptic: Deal with negative periodic magnitudes (thanks, Elias!).
A negative periodic magnitude doesn't exist in Windows' and MacOS' FF APIs

The periodic magnitude parameter of the SDL Haptic API is based on the Linux
 FF API, so it means they are not directly compatible:
    'dwMagnitude' is a 'DWORD', which is unsigned.

Fixes Bugzilla #2701.

--HG--
extra : amend_source : eb0b85870149936fd451ddb0662841112ff93d07
2014-09-17 14:49:36 -04:00
Gabriel Jacobo
8a4dc0573c [Android] Fixes #2480, music does not pause when process backgrounded
This modifies SDL_PauseAudio behavior to pause all audio devices instead of
just the default one (required on Android, at least for testmultiaudio on my
Nexus 4 which reported 2 audio devices).
It also changes SDL_PauseAudioDevice to retain the device lock from pause until
resume in order to save battery in mobile devices.
2014-09-17 11:41:12 -03:00
Ryo Munakata
18edcb1582 video: waylandmouse: handle mmap error properly
Signed-off-by: Ryo Munakata <ryomnktml@gmail.com>
2014-09-09 17:26:16 +09:00
Sam Lantinga
56f86cc81f Fixed bug 2415 - Message Boxes aren't implemented on Android
Philipp Wiesemann

I attached a patch for an incomplete implementation of the messagebox parts.

It was not tested on lots of devices yet and features a very fragile workaround to block the calling SDL thread while the dialog is handled on Android's UI thread. Although it works for testmessage.c I assume there are lot of situations were it may fail (standby, device rotation and other changes). Also not all flags and colors are implemented.

On the other hand most uses of the messagebox are to show an error on start and fragility (or working at all) may not matter there.
2014-09-13 02:15:18 -07:00
Sam Lantinga
f464f677f2 Fixed using uninitialized display data in iMX6 initialization 2014-09-12 15:09:33 -07:00
Pierre-Loup A. Griffais
d74afdb47b [X11] Reconcile logical keyboard state with physical state on FocusIn
since the window system doesn't do it for us like other platforms.

This prevents sticky keys and missed keys when going in and out
of focus, for example Alt would appear to stick if switching away
from an SDL app with Alt-Tab and had to be pressed again.

CR: Sam
2014-09-11 19:24:42 -07:00
Sam Lantinga
6ed37a2783 DSCAPS_GL was added for DirectFB 1.6 2014-09-10 14:05:27 -07:00
Sam Lantinga
c3bcad21c9 Report the correct desktop video mode on the iMX6 2014-09-10 08:59:19 -07:00
mastermind
97fde15915 Freescale i.MX6 video driver
---
 CMakeLists.txt                  |   2 +
 cmake/sdlchecks.cmake           |  20 +++
 configure                       |  51 +++++++
 configure.in                    |  28 ++++
 include/SDL_config.h.cmake      |   1 +
 include/SDL_config.h.in         |   1 +
 src/video/SDL_sysvideo.h        |   3 +
 src/video/SDL_video.c           |   3 +
 src/video/mx6/SDL_mx6events.c   |  45 ++++++
 src/video/mx6/SDL_mx6events_c.h |  31 +++++
 src/video/mx6/SDL_mx6opengles.c | 211 ++++++++++++++++++++++++++++
 src/video/mx6/SDL_mx6opengles.h |  68 +++++++++
 src/video/mx6/SDL_mx6video.c    | 301 ++++++++++++++++++++++++++++++++++++++++
 src/video/mx6/SDL_mx6video.h    |  78 +++++++++++
 14 files changed, 843 insertions(+)
 create mode 100644 src/video/mx6/SDL_mx6events.c
 create mode 100644 src/video/mx6/SDL_mx6events_c.h
 create mode 100644 src/video/mx6/SDL_mx6opengles.c
 create mode 100644 src/video/mx6/SDL_mx6opengles.h
 create mode 100644 src/video/mx6/SDL_mx6video.c
 create mode 100644 src/video/mx6/SDL_mx6video.h
2014-09-10 08:54:01 -07:00
Ryan C. Gordon
4428368af2 Deal with various .bmp file format variants in SDL_LoadBMP_RW().
This helps when modern versions of The Gimp (and lots of other things)
produces a 32-bit bitmap with an alpha channel, or anything with "BI_BITFIELDS"
format, since that data is now embedded in the bitmap info header instead of
directly following it and we would accidentally skip over embedded versions of
it.

Fixes Bugzilla #2714.
2014-09-08 01:36:22 -04:00
Jørgen Tjernø
9f3d577a93 Fix non-power-of-two shaped windows.
This fixes a bug where SDL_SetWindowShape would render artifacts if the image
was not a power of two image, due to rounding of width / 2.
2014-09-02 14:14:23 -07:00
Sam Lantinga
98e9c13a13 Updated version to 2.0.4 2014-09-02 06:55:47 -07:00
Ryan C. Gordon
3e754ff61f Mac: Don't add the same joystick twice if IOKit reports a duplicate device.
Fixes Bugzilla #2704.
2014-08-31 11:21:10 -04:00
Sam Lantinga
f7cbb0d535 Fixed memory leak getting the X11 window title 2014-08-25 10:55:54 -07:00