Log

Author Commit Date CI Message
Sam Lantinga 3df77ced 2017-01-06T00:40:22 Just roll back the entire portion of the commit from a8253d439914 which caused bug 3544 until we figure out what the right static analysis fix is.
Ryan C. Gordon 748f4605 2017-01-06T03:38:14 audio: Add an assert to make sure non-streaming audio uses good buffer sizes.
Sam Lantinga 356c2ead 2017-01-06T00:32:06 Fixed bug 3544 - Memory freeing bug in SDL_DestroyRenderer/SDL_DestroyTexture felix Here's a snippet of SDL_DestroyRenderer from hg revision 10746:7540ff5d0e0e: SDL_Texture *texture = NULL; SDL_Texture *nexttexture = NULL; /* ... */ for (texture = renderer->textures; texture; texture = nexttexture) { nexttexture = texture->next; SDL_DestroyTexture(texture); } SDL_DestroyTexture removes the texture from the linked list pointed to by the renderer and ends up calling SDL_DestroyTextureInternal, which contains this: if (texture->native) { SDL_DestroyTexture(texture->native); } If it happens that texture->native is an alias of nexttexture two stack frames up, SDL_DestroyRenderer will end up trying to destroy an already freed texture. I've had this very situation happen in dosemu2. Bug introduced in revision 10650:a8253d439914, which has a somewhat ironic description of "Fixed all known static analysis bugs"...
Ryan C. Gordon 345c5989 2017-01-06T03:15:27 haiku: Patched to compile.
Sam Lantinga 3443dc19 2017-01-05T23:53:46 Don't do any audio conversion if none is necessary
Sam Lantinga 41be9756 2017-01-05T23:26:13 Fixed bug 3546 - SDL_EVDEV_is_console() uses type of wrong size when calling ioctl Rob When calling ioctl(fd, KDGKBTYPE, &type) in SDL_EVDEV_is_console(), we declare type as an 'int'. This should be a 'char'. The subsequent syscall, and kernel code, only writes the lower byte of the word. See: http://lxr.free-electrons.com/source/drivers/tty/vt/vt_ioctl.c?v=4.4#L399 ucval = KB_101; ret = put_user(ucval, (char __user *)arg); I've observed intermittent behavior related to this, and I can force an error condition by using an int initialized to 0xFFFFFFFF. The resulting ioctl will set type to 0XFFFFFF02, and the conditional return in SDL_EVDEV_is_console() will fail. Recommend changing to char, or masking off unused bits.
Ryan C. Gordon b3e8db80 2017-01-06T01:07:34 audio: rename fake_stream to work_buffer. It's more than an alternative for when the OS can't provide a DMA buffer, now.
Ryan C. Gordon 992124d4 2017-01-06T01:02:58 audio: Fixed SDL_AudioStreamGet() function parameters. There was a draft of this where it did audio conversion into the final buffer, if there was enough room available past what you asked for, but that interface got removed, so the parameters didn't make sense (and we were using the wrong one in any case, too!).
Ryan C. Gordon 99fc1ef9 2017-01-06T00:56:29 naclaudio: Untested attempt to migrate to SDL_AudioStream.
Ryan C. Gordon 115d0ce7 2017-01-06T00:50:01 haikuaudio: Untested attempt to get this working with SDL_AudioStream.
Ryan C. Gordon 1a90c72d 2017-01-06T00:49:35 emscriptenaudio: don't get stuck in infinite loop if SDL_AudioStreamPut fails.
Ryan C. Gordon f07a1a5a 2017-01-05T21:31:02 emscriptenaudio: Reworked to use SDL_AudioStream.
Ryan C. Gordon 3761b5f6 2017-01-05T20:11:19 Fixed a few compiler warnings.
Ryan C. Gordon 4aa9e369 2017-01-05T19:45:57 Patched to compile on some compilers.
Ryan C. Gordon 52130bde 2017-01-05T19:30:45 diskaudio: Use SDL_Log, not fprintf.
Ryan C. Gordon 30178a9b 2017-01-05T19:29:38 audio: Added SDL_AudioStream. Non-power-of-two resampling now works!
Ryan C. Gordon f12ab8f2 2017-01-05T19:12:20 audio: More effort to improve and simplify audio resamplers.
Sam Lantinga d024c724 2017-01-05T08:16:39 Fixed signedness issue when blitting on a big endian platform, as reported by capehill For example, if sR is 0 and dR is 255, we will get -255*sA casted to an unsigned value. Basically results are quite large numbers instead of the expected 0-255 range.
Sam Lantinga e6e6613c 2017-01-05T02:53:29 Fixed build warning on Haiku
Sam Lantinga 4938c505 2017-01-04T10:28:07 Added SDL_JoystickGetAxisInitialState() to get a joystick axis' initial value. This is useful for controller mapping programs to determine an axis' zero state
Sam Lantinga 99e10ef5 2017-01-04T07:06:48 Assume D-pad or thumbstick style axes are centered at 0
Ryan C. Gordon 9d042052 2017-01-04T09:33:47 x11: deal with xrandr display size in millimeters being zero. Xquartz on macOS reports a zero size, which leads to a division by zero here.
Sam Lantinga 26f84d74 2017-01-04T06:21:17 Added mappings for several GameCube and SNES controllers
Sam Lantinga d2a01b6e 2017-01-04T06:19:56 Added the NEXT SNES Controller to the list of zero-centered joysticks
Sam Lantinga c7780497 2017-01-04T05:56:47 Increased joystick jitter tolerance for PS3 controllers
Sam Lantinga 1ddff75c 2017-01-04T05:09:02 Some controllers have trouble getting out to 20000
Sam Lantinga 082132a7 2017-01-03T23:39:28 Fixed binding the D-pad on some Super NES style controllers Fixed a case where partial trigger pull could be bound to another button There is a fundamental problem not resolved by this commit: Some controllers have axes (triggers, pedals, etc.) that don't start at zero, but we're guaranteed that if we get a value that it's correct. For these controllers, the current code works, where we take the first value we get and use that as the zero point and generate axis motion starting from that point on. Other controllers have digital axes (D-pad) that assume a zero starting point, and the first value we get is the min or max axis value when the D-pad is moved. For these controllers, the current code thinks that the zero point is the axis value after the D-pad motion and this doesn't work. My hypothesis is that the first class of devices is more common and that we should solve for that, and add an exception to SDL_JoystickAxesCenteredAtZero() as needed for the second class of devices.
Sam Lantinga d3591800 2017-01-03T00:44:05 Fixed bug 3519 - SDL_GetDisplayMode fails to report mode.format when using Wayland backend Ryan C. Gordon Kristian says you can't do it with Wayland, and that going forward, it'll just handle whatever you throw at it anyhow. https://twitter.com/hoegsberg/status/816148272402165761 So I say we mark it SDL_PIXELFORMAT_RGB888, which is what my X11 display currently reports, and leave it at that.
Sam Lantinga 18d9b23c 2017-01-02T10:30:32 Fixed bug 3539 - SDL2, missing MIR LDFLAGS Gianfranco Hello, this is the failure I got https://launchpadlibrarian.net/300679206/buildlog_ubuntu-zesty-amd64.libsdl2_2.0.5+dfsg1-2ubuntu1_BUILDING.txt.gz LTLINK build/libSDL2.la build/.libs/SDL_mirvideo.o: In function `MIR_InitDisplayFromOutput': ././src/video/mir/SDL_mirvideo.c:258: undefined reference to `mir_output_get_current_mode' collect2: error: ld returned 1 exit status
Sam Lantinga 67ed8943 2017-01-01T19:10:36 Fixed bug 3529 - SDL_EGL_UnloadLibrary is not called at all on SDL_Quit kaisyu In case of OpenGLES, the sequences of loading and unloading driver library should be like that: SDL_Init ... SDL_GL_LoadLibrary SDL_EGL_LoadLibrary ... SDL_Quit ... SDL_GL_UnloadLibrary SDL_EGL_UnloadLibrary ... However, according to my test results, the varible '_this->gl_config.driver_loaded' does not allow 'SDL_GL_UnloadLibrary' to call 'SDL_EGL_UnloadLibrary'.
Sam Lantinga 0badbdde 2017-01-01T18:47:29 Run sed in binary mode so we don't have to worry about fixing line endings
Sam Lantinga 9e6d729e 2017-01-01T18:36:35 Fixed typo in copyright update script
Sam Lantinga 45b774e3 2017-01-01T18:33:28 Updated copyright for 2017
Sam Lantinga 0f586d58 2017-01-01T18:32:57 Convert some files back into DOS line endings after updating copyright
Sam Lantinga 49225f5f 2016-12-31T18:11:19 We don't currently support blitting to < 8 bpp surfaces, return an error instead of corrupting memory in that case.
Sam Lantinga 2ba66d05 2016-12-31T16:21:55 Fixed bug 3535 - Misplaced comment #if/#endif closure comment Coriiander This notice is about a misplaced comment. Often times when we use an #if #endif sequence, the #endif is followed by a comment to indicate what #if statement it belonged to. The SDL_xaudio2.c file contains a misplaced comment, as follows (I stripped the other comments): #ifdef __GNUC__ # define SDL_XAUDIO2_HAS_SDK 1 #elif defined(__WINRT__) # define SDL_XAUDIO2_HAS_SDK #include "SDL_xaudio2.h" #else #if 0 #include <dxsdkver.h> #if (!defined(_DXSDK_BUILD_MAJOR) || (_DXSDK_BUILD_MAJOR < 1284)) # pragma message("Your DirectX SDK is too old. Disabling XAudio2 support.") #else # define SDL_XAUDIO2_HAS_SDK 1 #endif #endif #endif /* 0 */ That final /* 0 */ should be moved one line up. Like this (I tabbed it out for you to make it more clear):
Sam Lantinga 880842cf 2016-12-31T16:14:51 Fixed bug 3531 - internal SDL_vsnprintf implementation access memory outside given buffer ranges Tristan The internal SDL_vsnprintf implementation accesses memory outside buffer. The bug existed also inside the format (%) processing, which was fixed with Bug 3441. But there is still an invalid access, if we do not have any format inside the source string and the destination string is shorter than the format string. You can use any string for this test, as long it is longer than the buffer. Example: va_list argList; char buffer[4]; SDL_vsnprintf(buffer, sizeof(buffer), "Testing", argList); The bug is located on the 'else' branch of the format char test: while (*fmt) { if (*fmt == '%') { ... } else { if (left > 1) { *text = *fmt; --left; } ++fmt; ++text; } } if (left > 0) { *text = '\0'; } As you can see that text is always incremented, even when left is already one. When then on the last lines, *text is assigned the NULL char, the pointer is located outside bounds.
Sam Lantinga 7f2068da 2016-12-31T10:30:07 Fixed bug 3541 - DisplayIndex out of bounds in SDL_SetWindowPosition Intellectual Kitty In SDL_video.c, on line #1756, in SDL_SetWindowPosition (from today's distribution, 12-31-2016, https://hg.libsdl.org/SDL/shortlog/bf19e0c84483): if (displayIndex > _this->num_displays) { should be: if (displayIndex >= _this->num_displays) {
Philipp Wiesemann e61daa72 2016-12-30T19:57:50 Fixed warning and missing animation delay in testoverlay2 program.
David Ludwig 0cfa0aa1 2016-12-29T11:49:18 improved SDL_GetError() output generated by EGL code This change attempts to report the EGL error codes generated by SDL's calls into EGL, along with the name of the EGL function that failed.
Philipp Wiesemann c2b90f2d 2016-12-28T20:11:29 Fixed compiling of testgamecontroller program with C++.
Philipp Wiesemann de79828b 2016-12-28T20:11:12 Fixed warning about unused variable in controllermap program.
Philipp Wiesemann af263798 2016-12-28T20:10:48 Fixed crash if allocating memory for game controller failed.
Ryan C. Gordon 2e2572a4 2016-12-27T23:48:43 Added SDL_ReserveSpaceInDataQueue() to make space without copying data.
Sam Lantinga 8000e6d9 2016-12-27T09:59:36 Added documentation for the game controller axis values
Sam Lantinga 21cb42d7 2016-12-27T09:51:58 Make sure we go all the way back (within the XBox controller dead zone) to prevent accidentally binding axes inverted
Sam Lantinga cb8685c0 2016-12-27T02:04:38 Fixed comment style
Sam Lantinga 6d7da088 2016-12-27T01:39:07 Split controller axes into positive and negative sides so each can be bound independently. Using this a D-Pad can be mapped to a thumbstick and vice versa. Also added support for inverted axes, improving trigger binding support
Ryan C. Gordon 7c316366 2016-12-26T23:02:14 x11: Don't loop forever if the X server refuses a pointer grab.
Ryan C. Gordon 76f2ae3c 2016-12-26T22:58:58 Don't use pushd/popd in autogen.sh; Ubuntu's /bin/sh doesn't support it.
Sam Lantinga b4e069e7 2016-12-26T02:12:21 Fixed bug 3517 - Compiler warnings with gcc -Wstrict-prototypes felix Compiling even a simple SDL2 'hello world' program with gcc -Wstrict-prototypes (GCC 6.2.1) results in warnings like: /usr/include/SDL2/SDL_gamecontroller.h:143:1: attention : function declaration isn't a prototype [-Wstrict-prototypes] extern DECLSPEC int SDLCALL SDL_GameControllerNumMappings(); ^~~~~~ It seems there is a missing 'void' between the parentheses.
Sam Lantinga 9492492d 2016-12-26T01:56:52 Fixed bug 3516 - fix build on illumos Sylvain trivial patch to fix the build on illumos -Werror=declaration-after-statement https://gist.github.com/wiedi/15b71456667f7aa2a7f8815663723bb3
Alex Szpakowski fd85f574 2016-12-23T22:49:37 Mac: back out commit 3e9b2ae41adf. It causes significant overhead on many GPUs.
Alex Szpakowski d719374c 2016-12-23T22:08:18 Mac: Fix over-saturated colors on P3 displays (e.g. the 2016 MBPs).
Philipp Wiesemann 3e928451 2016-12-23T20:36:24 Windows: Fixed compile error.
Philipp Wiesemann 7c60a638 2016-12-23T20:36:12 Corrected header file guard comments.
Sam Lantinga 4fc0fe1f 2016-12-23T02:23:44 Removed debug print statements
Sam Lantinga ad26769c 2016-12-22T18:43:00 Fixed compile errors on various platforms
Sam Lantinga ca019dad 2016-12-22T17:33:45 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.
Sam Lantinga b2f6c4c1 2016-12-19T11:15:53 Fixed bus error when converting 16-bit to float for non-integral-multiple sample rates
Ryan C. Gordon 366c77a9 2016-12-18T20:17:33 audio: fixed one more incorrectly-hardcoded value in the resamplers.
Alex Szpakowski eda74fda 2016-12-18T13:05:14 tvOS: Expose remote swipe gestures as arrow key presses (thanks oviano!)
Alex Szpakowski 787a54c8 2016-12-18T12:28:28 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.
Ryan C. Gordon f956df23 2016-12-17T16:15:24 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.
Philipp Wiesemann b515b34d 2016-12-16T22:58:32 Fixed hotplug with more than one device in testjoystick program.
Philipp Wiesemann 0a3f9d0c 2016-12-16T22:58:16 Fixed warning about unused variable in controllermap program.
Sam Lantinga 0c5e7a10 2016-12-15T14:27:22 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
Sam Lantinga b4ea63ec 2016-12-14T06:25:09 Fixed crash if there are multiple joysticks closed during the joystick update loop
Ryan C. Gordon f50a0400 2016-12-13T00:22:42 windows: add whitespace to fix macro preprocessing issue (thanks, Sven!). Apparently without a space here, "fastbuild -cache" breaks.
Sam Lantinga 85d8a79f 2016-12-12T09:19:48 Fixed updated return value for SDL_GL_SwapWindow() Ozkan Sezer http://hg.libsdl.org/SDL/rev/464a2676d8ab 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
Sam Lantinga e81bf12b 2016-12-12T09:18:42 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.
Sam Lantinga 8414c3d4 2016-12-11T12:01:44 Fixed ABI, don't change the return type of SDL_GL_SwapWindow()
Sam Lantinga 6211668e 2016-12-11T12:01:01 Fixed creating a renderer on the dummy driver on Mac OS X
Sam Lantinga cb5a0b0f 2016-12-11T11:45:33 Fixed crash when creating a dummy window on Mac OS X
David Ludwig d6bcec8f 2016-12-10T15:23:17 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.
Sam Lantinga 454d9cb9 2016-12-09T05:19:31 PP_OK isn't available in the NaCl build environment on buildbot. It's defined as 0
Sam Lantinga 97d05b0d 2016-12-09T05:12:27 Fixed a bunch of SwapWindow calls that needed their return value updated
Sam Lantinga 7a39681e 2016-12-09T05:04:18 Fixed X11 OpenGL ES build
Sam Lantinga fed8cbcd 2016-12-09T05:00:35 Fixed build for EGL platforms
Sam Lantinga b936a4c3 2016-12-09T04:57:54 Added support for the XiaoMi Game Controller
Sam Lantinga 70aa2a57 2016-12-09T04:17:10 Only print out the controller mappings if we're not going to test a controller
Sam Lantinga 524bf3c2 2016-12-09T01:47:43 Fixed bug 3513 - SDL_GL_SwapWindow does not return error status Return an error code from SDL_GL_SwapWindow(), like the other SDL APIs.
Sam Lantinga 3b18c796 2016-12-09T01:29:52 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?
Sam Lantinga a5250171 2016-12-08T10:13:45 Protect the game controller API the same way the joystick API is protected from multi-threaded access
Sam Lantinga 1b08f0c1 2016-12-07T11:41:20 Added the guide button for the NVIDIA Shield Controller
Sam Lantinga 91491824 2016-12-07T11:02:02 Removed unneeded warning when running from Visual Studio
Sam Lantinga acabb5d5 2016-12-06T14:22:28 Added support for XBox One controllers on Mac OS X, using the driver at: https://github.com/360Controller/360Controller/releases
Ryan C. Gordon 09ed5cc0 2016-12-06T13:33:02 xcode: Make sure SDL_dataqueue sources are included in all targets.
Ryan C. Gordon 6cb2f5bb 2016-12-06T12:30:31 xcode: updated macOS and iOS project files with SDL_dataqueue sources.
Ryan C. Gordon c0231875 2016-12-06T12:23:17 audio: Fixed compiler warnings.
Sam Lantinga 68d7be39 2016-12-06T00:40:09 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.
Ryan C. Gordon a0e003ee 2016-12-06T02:23:54 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.
Ryan C. Gordon 8b960d4e 2016-12-06T02:20:58 Added SDL_VARIABLE_LENGTH_ARRAY so this #ifdef is localized to one place.
Sam Lantinga af7f30de 2016-12-05T21:28:27 Fixed SDL always being built because of missing headers in the project.
Sam Lantinga 54188c8b 2016-12-03T09:59:43 Fixed crash at startup
Sam Lantinga 264138cc 2016-12-03T08:39:21 Added support for the Hori Fighting Commander 4
Sam Lantinga e7efcfba 2016-12-03T00:40:13 Added Linux mapping for the DragonRise Inc. Generic USB Joystick
Sam Lantinga 16074e67 2016-12-02T22:18:05 Fixed compile warning on Visual Studio
Sam Lantinga 4eda58ba 2016-12-02T21:01:13 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.
Sam Lantinga 26f05ecb 2016-12-02T02:25:12 Fixed missing prototypes on Android, patch from Sylvain