Commit Graph

9225 Commits

Author SHA1 Message Date
Philipp Wiesemann
ded7e84edd Corrected header file guard comments. 2016-12-23 20:36:12 +01:00
Sam Lantinga
a252b4d73d Removed debug print statements 2016-12-23 02:23:44 -08:00
Sam Lantinga
46dd5015df Fixed compile errors on various platforms 2016-12-22 18:43:00 -07:00
Sam Lantinga
d016c5e57c Fixed issue where the throttle and other axes on racing wheels don't start at zero and show up as immediate input when the wheel is turned for the first time. Wait until they are actually moved before generating input from them. 2016-12-22 17:33:45 -08:00
Sam Lantinga
d4bf5754f1 Fixed bus error when converting 16-bit to float for non-integral-multiple sample rates 2016-12-19 11:15:53 -08:00
Ryan C. Gordon
b9d8e7cdfd audio: fixed one more incorrectly-hardcoded value in the resamplers. 2016-12-18 20:17:33 -05:00
Alex Szpakowski
7ad6cbc42a tvOS: Expose remote swipe gestures as arrow key presses (thanks oviano!) 2016-12-18 13:05:14 -04:00
Alex Szpakowski
2bfa2037ca iOS bug #3377: work around bugs in some third party iOS libraries (e.g. Google admob) where they assume the optional UIApplicationDelegate ‘window’ property always exists and will crash if it doesn’t. 2016-12-18 12:28:28 -04:00
Ryan C. Gordon
4405458835 audio: fixed arbitrary upsampling (thanks, Sylvain!).
This was a leftover of simplifying the resamplers down from autogenerated
code; I forgot to make something that the generator hardcoded into something
variable.

Fixes Bugzilla #3507.
2016-12-17 16:15:24 -05:00
Philipp Wiesemann
af39fc10d3 Fixed hotplug with more than one device in testjoystick program. 2016-12-16 22:58:32 +01:00
Philipp Wiesemann
7d96beee5e Fixed warning about unused variable in controllermap program. 2016-12-16 22:58:16 +01:00
Sam Lantinga
103da69c77 Fixed handling joysticks that send multiple events for a single control, e.g. both a button and axis event for a trigger.
Tested with the 8Bitdo NES30 Pro on Linux
2016-12-15 14:27:22 -08:00
Sam Lantinga
bfb613a4f0 Fixed crash if there are multiple joysticks closed during the joystick update loop 2016-12-14 06:25:09 -08:00
Ryan C. Gordon
331848b488 windows: add whitespace to fix macro preprocessing issue (thanks, Sven!).
Apparently without a space here, "fastbuild -cache" breaks.
2016-12-13 00:22:42 -05:00
Sam Lantinga
5d0f852a47 Fixed updated return value for SDL_GL_SwapWindow()
Ozkan Sezer

http://hg.libsdl.org/SDL/rev/00fe449fbefe seems to have
forgotten removing the return from SDL_dynapi_procs.h, and this patch
does that. Without it, MSVC warns:
c:\sdl2\src\dynapi\SDL_dynapi_procs.h(598) : warning C4098:
'SDL_GL_SwapWindow_DEFAULT' : 'void' function returning a value
c:\sdl2\src\dynapi\SDL_dynapi_procs.h(598) : warning C4098:
'SDL_GL_SwapWindow' : 'void' function returning a value
2016-12-12 09:19:48 -08:00
Sam Lantinga
42b51c05e9 Fixed edid parsing code for older gcc compilers
Ozkan Sezer

This adds the name 'ad' to two unnamed unions in edid.h
and adjusts edid-parse.c for it.  Nameless unions are not supported in
ancient gcc, which I happened to use on one of my ancient setups.
2016-12-12 09:18:42 -08:00
Sam Lantinga
23ab0d83a2 Fixed ABI, don't change the return type of SDL_GL_SwapWindow() 2016-12-11 12:01:44 -08:00
Sam Lantinga
bfe435201d Fixed creating a renderer on the dummy driver on Mac OS X 2016-12-11 12:01:01 -08:00
Sam Lantinga
9bf991ada9 Fixed crash when creating a dummy window on Mac OS X 2016-12-11 11:45:33 -08:00
David Ludwig
e48feb4c62 WinRT: build fixes
These fixes are lumped into two categories:

1. add new file, SDL_dataqueue.c, to UWP/WinRT build-inputs (via MSVC project
   files)

2. implement a temporary, hack-fix for a build error in SDL_xinputjoystick.c.
   Win32's Raw Input APIs are, unfortunately, not available for use in UWP/WinRT
   APIs.  There does appear to be a replacement API, available in the
   Windows.Devices.HumanInterfaceDevice namespace.

   This fix should be sufficient to get SDL compiling again, without affecting
   Win32 builds, however using the UWP/WinRT API (in UWP/WinRT builds) would
   almost certainly be better (for UWP/WinRT builds).

   TODO: research Windows.Devices.HumanInterfaceDevice, and use that if and as
   appropriate.
2016-12-10 15:23:17 -05:00
Sam Lantinga
52391e28f8 PP_OK isn't available in the NaCl build environment on buildbot. It's defined as 0 2016-12-09 05:19:31 -08:00
Sam Lantinga
04c2e22b30 Fixed a bunch of SwapWindow calls that needed their return value updated 2016-12-09 05:12:27 -08:00
Sam Lantinga
85aea51fe1 Fixed X11 OpenGL ES build 2016-12-09 05:04:18 -08:00
Sam Lantinga
0f202d18b3 Fixed build for EGL platforms 2016-12-09 05:00:35 -08:00
Sam Lantinga
a55ef0239f Added support for the XiaoMi Game Controller 2016-12-09 04:57:54 -08:00
Sam Lantinga
800baf2915 Only print out the controller mappings if we're not going to test a controller 2016-12-09 04:17:10 -08:00
Sam Lantinga
b505909719 Fixed bug 3513 - SDL_GL_SwapWindow does not return error status
Return an error code from SDL_GL_SwapWindow(), like the other SDL APIs.
2016-12-09 01:47:43 -08:00
Sam Lantinga
a2c540e172 Fixed bug 3512 - Memory leak of SDL_Joystick axes_zero array
Benjamin Harris

Found with valgrind and confirmed in the 2.0.5 source code.
One-line fix in SDL_JoystickClose?
2016-12-09 01:29:52 -08:00
Sam Lantinga
4292a15aca Protect the game controller API the same way the joystick API is protected from multi-threaded access 2016-12-08 10:13:45 -08:00
Sam Lantinga
dac789f605 Added the guide button for the NVIDIA Shield Controller 2016-12-07 11:41:20 -08:00
Sam Lantinga
6fd7b13069 Removed unneeded warning when running from Visual Studio 2016-12-07 11:02:02 -08:00
Sam Lantinga
aeea47b9bd Added support for XBox One controllers on Mac OS X, using the driver at: https://github.com/360Controller/360Controller/releases 2016-12-06 14:22:28 -07:00
Ryan C. Gordon
de74e41109 xcode: Make sure SDL_dataqueue sources are included in all targets. 2016-12-06 13:33:02 -05:00
Ryan C. Gordon
1ddf1e6935 xcode: updated macOS and iOS project files with SDL_dataqueue sources. 2016-12-06 12:30:31 -05:00
Ryan C. Gordon
17856a8b9f audio: Fixed compiler warnings. 2016-12-06 12:23:17 -05:00
Ryan C. Gordon
43fa407edf Refactored the audio queueing code to a generic SDL_DataQueue interface.
This is not a public API (at the moment), but we will be needing this for
other internal things soon.
2016-12-06 02:23:54 -05:00
Ryan C. Gordon
1e16752241 Added SDL_VARIABLE_LENGTH_ARRAY so this #ifdef is localized to one place. 2016-12-06 02:20:58 -05:00
Sam Lantinga
23e29e1256 Fixed bug 3508 - variably modified ‘SDL_dummy_size’ at file scope in test/testatomic.c
Ciro Santilli

GCC 6, Ubuntu 16.10, cd test; ./configure; make

/bin/sh config.status Makefile
config.status: creating Makefile
gcc -o loopwave loopwave.c -g -O2 -D_REENTRANT -I/usr/include/SDL2 -DHAVE_OPENGLES2 -DHAVE_OPENGL -DHAVE_SDL_TTF -g -lSDL2_test -lSDL2
gcc -o testatomic testatomic.c -g -O2 -D_REENTRANT -I/usr/include/SDL2 -DHAVE_OPENGLES2 -DHAVE_OPENGL -DHAVE_SDL_TTF -g -lSDL2_test -lSDL2
In file included from /usr/include/SDL2/SDL_main.h:25:0,
                 from /usr/include/SDL2/SDL.h:32,
                 from testatomic.c:14:
/usr/include/SDL2/SDL_stdinc.h:261:20: error: variably modified ‘SDL_dummy_size’ at file scope
        typedef int SDL_dummy_ ## name[(x) * 2 - 1]
                    ^
testatomic.c:106:1: note: in expansion of macro ‘SDL_COMPILE_TIME_ASSERT’
 SDL_COMPILE_TIME_ASSERT(size, CountTo>0); /* check for rollover */
 ^~~~~~~~~~~~~~~~~~~~~~~
Makefile:114: recipe for target 'testatomic' failed
make: *** [testatomic] Error 1

If I remove the line SDL_COMPILE_TIME_ASSERT(size, CountTo>0); /* check for rollover */ it works, lazy to figure out the best way to do this.
2016-12-06 00:40:09 -08:00
Sam Lantinga
ae4a9149ca Fixed SDL always being built because of missing headers in the project. 2016-12-05 21:28:27 -08:00
Sam Lantinga
060892468b Added support for the Hori Fighting Commander 4 2016-12-03 08:39:21 -08:00
Sam Lantinga
2777f7e462 Fixed crash at startup 2016-12-03 09:59:43 -08:00
Sam Lantinga
57c990a8c9 Added Linux mapping for the DragonRise Inc. Generic USB Joystick 2016-12-03 00:40:13 -08:00
Sam Lantinga
9caf6185ea Fixed compile warning on Visual Studio 2016-12-02 22:18:05 -08:00
Sam Lantinga
7bd32ecc46 Added SDL_HINT_MOUSE_NORMAL_SPEED_SCALE and SDL_HINT_MOUSE_RELATIVE_SPEED_SCALE to scale the speed of the mouse.
This currently doesn't affect absolute motion, which would need to be implemented on each windowing system so the cursor matches the reported mouse coordinates.
2016-12-02 21:01:13 -08:00
Sam Lantinga
f0ca0a5183 Fixed missing prototypes on Android, patch from Sylvain 2016-12-02 02:25:12 -08:00
Sam Lantinga
d0ad2d6288 Fixed bug 3305 - Fixed TextInput status when the keyboard was dismissed with the dismiss key on the iPad
Diego

I was previously unaware that rotating the device to a different orientation when the keyboard is shown causes a keyboardWillHide followed by a keyboardWillShow notification. The previous patch would then mistakenly StopTextInput when rotating. This patch fixes that by checking if the device is rotating before stopping text input.
2016-12-02 02:21:35 -08:00
Sam Lantinga
44e8419b93 Added Linux controller mapping for the Nostromo n45 Dual Analog Gamepad 2016-12-01 07:31:08 -08:00
Sam Lantinga
cd3f06dbbd Fixed bug 3503 - osx builds don't run on 10.6 as of rev. 10651
Ozkan Sezer

With rev. 10651, i.e. http://hg.libsdl.org/SDL/rev/f0065b8e6541 ,
SDL2 - OS X builds fail to run on 10.6 (my setup: i686 / 10.6.8)
because the symbol _IOPMAssertionCreateWithDescription is missing.
The SDK listing it for 10.7+ does seem correct.  Reverting r10651
and rebuilding makes it to function again.
2016-12-01 11:52:47 -08:00
Sam Lantinga
5a3f134b94 Fixed bug 3340 - SDL_BlitScaled causes access violation in some cases.
Simon Hug

The SDL_BlitScaled function runs into an access violation for specific blit coordinates and surface sizes. The attached testcase blits a 800x600 surface to a 1280x720 surface at the coordinates -640,-345 scaled to 1280x720. The blit function that moves the data then runs over and reads after the pixel data from the src surface causing an access violation.

I can't say where exactly it goes wrong, but I think it could have something to do with the rounding in SDL_UpperBlitScaled. final_src.y is 288 and final_src.h is 313. Together that's 601, which I believe is one too much, but I just don't know the code enough to make sure that's the problem.

Sylvain

I think this patch fix the issue, but maybe it's worth re-writing "SDL_UpperBlitScaled" using SDL_FRect.
2016-11-30 22:06:05 -08:00
Sam Lantinga
e1b2dba100 Fixed the controller mappings for the OUYA controller 2016-11-30 12:58:03 -08:00