Commit graph

7709 commits

Author SHA1 Message Date
Sam Lantinga
95e3af47d0 Fixed build for arm platforms 2014-07-11 22:14:14 -07:00
Sam Lantinga
4d8562f23f Fixed bug in AVX detection and added AVX2 detection 2014-07-11 22:02:50 -07:00
Sam Lantinga
9dcc87296e Clarified the documentation for SDL_FlushEvents() so people know it only affects currently queued events. 2014-07-09 01:34:40 -07:00
Ryan C. Gordon
85ada1aa3b The Gimp puts out a different bogus color mask for 32-bit .bmp files. :) 2014-07-09 00:09:57 -04:00
Ryan C. Gordon
afbab877a7 Make SDL_LoadBMP() work with 32-bit bitmaps from ImageMagick. 2014-07-09 00:01:34 -04:00
Ryan C. Gordon
7a3c39ff6e Comment update: SDL_INIT_NOPARACHUTE doesn't do anything as of 2.0.0.
--HG--
extra : rebase_source : d365c52afb7b7b1e0913b99aa23e94dddf0672a9
2014-07-08 16:17:06 -04:00
Sam Lantinga
7860e1d1e2 Skip JUNK chunks in wave files 2014-07-08 00:42:14 -07:00
Sam Lantinga
61b34b6728 Strip the binaries before signing them, in release configuration 2014-07-08 00:23:36 -07:00
Sam Lantinga
3cf1187208 Fixed supporting multiple frameworks 2014-07-07 23:48:21 -07:00
Sam Lantinga
37789c74f0 Fixed code signing release frameworks 2014-07-07 23:40:10 -07:00
Andreas Schiffler
2494eee648 Update audio testautomation: more coverage; added SDL_PauseAudio test /w callback coverage 2014-07-07 23:33:57 -07:00
Sam Lantinga
fd466cd42f Fixed bug 2421 - SDL_RenderCopyEx off by one when rotating by 90 and -90
chasesan

When using SDL_RenderCopyEx, I get a problem on some platforms where the output is offset by +/-1 on other platforms and not on others. I tried it with a center of both 0,0 (and offsetting by width/height) and NULL (for centered).

The rotation involved is 90, and/or -90 rotation. The rotation was a constant, no arithmetic was involved when inputting it into SDL_RenderCopyEx.

This occurred with 32x32, 24x24, and 16x16 texture sizes. I apologize that I don't have more precise information, as I received the information as a bug report myself. But I have tracked the problem down to here.

My program requires pixel perfect alignment on several different platforms, so this is something of a showstopper for me.

--

Sylvain

It appears the RenderCopyEx is done as expected,
this is the red rectangle which is not correctly positionned !

So, here's patch with a 0.5 float increment, like for opengles2, for DrawLines, and also Draw Points.
2014-07-07 23:26:34 -07:00
Sam Lantinga
4272137303 Updated configure after removing pthread spinlock support 2014-07-07 21:34:04 -07:00
Sam Lantinga
0fb3ac0853 Fixed bug 2618 - incomplete pthread-based lock support should be removed
binarycrusader

Since changeset 358696c354a8, SDL 2.0 has been broken on Solaris when compiling with the Solaris Studio compiler (which uses the pthread implementation of SDL_AtomicLock).

Notably, it gets stuck at the MemoryBarrierRelease in SDL_GetErrBuf:

6585 # 218
6586     if (!tls_errbuf && !tls_being_created) {
6587          SDL_AtomicLock_REAL ( & tls_lock );
6588         if (!tls_errbuf) {
6589             SDL_TLSID slot;
6590             tls_being_created = SDL_TRUE;
6591             slot =  SDL_TLSCreate_REAL ( );
6592             tls_being_created = SDL_FALSE;
6593              { SDL_SpinLock _tmp = 0 ; SDL_AtomicLock_REAL ( & _tmp ) ; SDL_AtomicUnlock_REAL ( & _tmp ) ; };
^^^ loops forever above
6594             tls_errbuf = slot;
6595         }
6596          SDL_AtomicUnlock_REAL ( & tls_lock );
6597     }


Running: testthread
(process id 28926)
^Cdbx: warning: Interrupt ignored but forwarded to child.
signal INT (Interrupt) in __nanosleep at 0xfe52a875
0xfe52a875: __nanosleep+0x0015: jae      __nanosleep+0x23   [ 0xfe52a883, .+0xe ]
Current function is SDL_Delay_REAL
  204           was_error = nanosleep(&tv, &elapsed);
(dbx) where
  [1] __nanosleep(0xfeffe848, 0xfeffe850, 0xfe75a5ac, 0xfe5169d8), at 0xfe52a875
  [2] nanosleep(0xfeffe848, 0xfeffe850), at 0xfe516a3b
=>[3] SDL_Delay_REAL(ms = 0), line 204 in "SDL_systimer.c"
  [4] SDL_AtomicLock_REAL(lock = 0xfeffe88c), line 104 in "SDL_spinlock.c"
  [5] SDL_GetErrBuf(), line 225 in "SDL_thread.c"
  [6] SDL_ClearError_REAL(), line 216 in "SDL_error.c"
  [7] SDL_InitSubSystem_REAL(flags = 0), line 116 in "SDL.c"
  [8] SDL_Init_REAL(flags = 0), line 244 in "SDL.c"
  [9] SDL_Init(a = 0), line 89 in "SDL_dynapi_procs.h"
  [10] main(argc = 1, argv = 0xfeffe948), line 65 in "testthread.c"

As far as I can tell, this is because pthread_spin_trylock() always returns EBUSY for this particular lock; since it works in other places, I'm suspicious.

Different Solaris Studio compiler versions seem to make no difference.

I've verified this is broken on Linux as well if SDL_spinlock.c is modified to use the pthread implementation.

This appears to be because pthread_spin_init() and pthread_spin_destroy() are not used with the locks as required.
2014-07-07 21:27:42 -07:00
Sam Lantinga
8e0c29b53a Fixed bug 2628 - invalidate surface->map in SDL_SurfacePalette()
Wei Mingzhi

surface->map should be invalidated in SDL_SetSurfacePalette(), otherwise the palette would not be effective when blitting to another non-8bit surface which we previously blitted to.
2014-07-07 21:21:05 -07:00
Andreas Schiffler
77c619573f Enable 2 disabled audio tests (since bug 1396 is fixed and they pass now) 2014-07-07 20:26:21 -07:00
Sam Lantinga
04529c4cba Hopefully fixed Cygwin build 2014-07-07 13:21:54 -07:00
Sam Lantinga
d32eb0d9e5 Removed useless assert 2014-07-07 13:19:53 -07:00
Sam Lantinga
bdb4ce60cd Fixed bug 2631 - Mac: minor code cleanup
Alex Szpakowski

Some minor changes to the Mac-specific backend code:

- Fixed up some code style issues (mostly brace style inconsistencies).

- Fixed a compiler warning in SDL_cocoaevents.m.

- Removed some useless code now that the 10.7 SDK is required to build SDL.

- Removed Gestalt(gestaltSystemVersion, ...) call and switched to NSAppKitVersionNumber for version checking code. Using Gestalt with gestaltSystemVersion will give 0x1090 in Mac OS 10.10+, and the whole Gestalt function was deprecated in Mac OS 10.8.
2014-07-07 12:48:25 -07:00
Sam Lantinga
22f2713245 SDL_SYS_IsXInputGamepad_DeviceIndex() is only available if SDL_JOYSTICK_XINPUT is true. 2014-07-07 11:44:14 -07:00
Sam Lantinga
81a400cd0c Fixed indentation for pnacl configuration 2014-07-07 11:13:19 -07:00
Sam Lantinga
ad1fe92296 Fixed compiler warnings on iOS 2014-07-07 11:00:25 -07:00
Sam Lantinga
11238fe16a Fixed bug 2626 - iOS: fix test and template Xcode projects and build scripts to link with CoreMotion
Alex Szpakowski

Now that SDL on iOS requires CoreMotion to be linked, some of the Xcode projects included with the SDL source (such as the iOS tests and the iOS app template) as well as the premake and automake scripts need to be updated.

I've attached a patch which does so. It also fixes the SDL Xcode project to build for 64-bit ARM as well as armv7 by default (or whatever the default ARM targets are for the Xcode version used), which is what the iOS app template expects.
2014-07-07 10:42:19 -07:00
Sam Lantinga
f6529a1ba6 Fixed compiler warning 2014-07-07 10:39:02 -07:00
Sam Lantinga
7f2953097b Fixed compiler warning on Mac OS X 2014-07-07 10:38:10 -07:00
Shawn Walker
f2c61cdaa5 2620 solaris port missing atomics if not using gcc 2014-07-05 16:11:23 -07:00
Sam Lantinga
1c1bac24fd Fixed bug 2629 - Mac: crash when calling SDL_DestroyWindow with an active OpenGL context
Alex Szpakowski

Since this commit https://hg.libsdl.org/SDL/rev/1519c462cee6 , calling SDL_DestroyWindow will crash the program if the window has an active OpenGL context.

This is because the Cocoa_DestroyWindow code sets the window's driverdata to NULL and then calls [context setWindow:NULL], which tries to access the window's driverdata, resulting in a null pointer dereference.

I have attached a patch which fixes the issue by moving the line which sets the driverdata to NULL to after the lines which call functions that use the driverdata pointer.
2014-07-07 10:33:32 -07:00
Alex Baines
96fb227092 Call dbus_shutdown to make valgrind happy. 2014-07-06 22:15:31 +01:00
Sam Lantinga
9d42bf534d Fixed mingw64 build and warnings 2014-07-07 10:26:28 -07:00
Andreas Schiffler
1c89d592b7 Fix option for forced run of disabled tests in test harness 2014-07-06 20:41:39 -07:00
Sam Lantinga
3144954845 Fixed haptic refcount bug (thanks David Ludwig!) 2014-07-04 17:20:22 -07:00
David Ludwig
ccd59359e6 Made the latest XInput + Haptic changes compile and run on WinRT
Notes:
- Support for the 'Guide' button does not seem to be possible, as
  XInputGetStateEx is not available on WinRT.
- Haptic support appears to be working on WinRT now!
- SDL/WinRT does not allow calls to LoadLibrary or LoadLibraryEx.  The calls
  to those were removed by this change, but only when compiling for WinRT.
  Non-WinRT Windows will continue to detect and load XInput via LoadLibrary and
  GetProcAddress calls.
2014-07-04 18:20:23 -04:00
Sam Lantinga
9cdeec59f3 Split the XInput and DirectInput code so Windows RT can use the existing XInput support.
--HG--
rename : src/audio/directsound/directx.h => src/core/windows/SDL_directx.h
rename : src/haptic/windows/SDL_syshaptic.c => src/haptic/windows/SDL_windowshaptic.c
rename : src/haptic/windows/SDL_syshaptic_c.h => src/haptic/windows/SDL_windowshaptic_c.h
rename : src/joystick/windows/SDL_dxjoystick.c => src/joystick/windows/SDL_dinputjoystick.c
rename : src/joystick/windows/SDL_dxjoystick_c.h => src/joystick/windows/SDL_dinputjoystick_c.h
rename : src/joystick/windows/SDL_dxjoystick_c.h => src/joystick/windows/SDL_windowsjoystick_c.h
2014-07-03 15:39:55 -07:00
Gabriel Jacobo
8540c8da93 Maybe fixes bug #2291 (red tinted screen on some Samsung Android devices)
Then again, maybe not!
2014-07-03 17:36:08 -03:00
Alfred Reynolds
f5af065da8 add a comment to SDL_InitSubSystem explaining its refcounting behavior 2014-07-03 10:22:26 -07:00
Alfred Reynolds
156e48e6bf The YUV offset is 16 / 255, not 16 / 256 2014-07-03 10:22:12 -07:00
Jørgen P. Tjernø
5844991980 Apply WIN32_LEAN_AND_MEAN redefine fix to SDL_syswm.h too.
This is related to 7a261af2d612, which fixes bug 2508.
2014-06-30 17:22:08 -07:00
Sam Lantinga
7c20f292af Fixed null terminating the X11 error string 2014-06-28 19:51:26 -07:00
Gabriel Jacobo
f544f6f62e Better fix to support EGL_KHR_create_context and not fail to build on Android
...or Raspberry Pi (EGL < 1.4 systems)
2014-06-28 13:05:16 -03:00
Gabriel Jacobo
8ad09ac95d Another fix to prevent dereferencing a null window pointer in SDL_mouse.c 2014-06-28 12:50:17 -03:00
Gabriel Jacobo
33076a0b17 Disable desktop OpenGL for EGL under Android 2014-06-28 12:48:29 -03:00
Gabriel Jacobo
5db7fa40b5 Fixes #2611 #2610, Touch events cause crash on Android, thanks Alvin & Sylvain
This bug was introduced on this rev: https://hg.libsdl.org/SDL/rev/dc80dc0bd22e
2014-06-28 12:36:44 -03:00
Knut Andre Tidemann
c44787ba7b SDL_egl: allow creation of versioned OpenGL contexts with EGL_KHR_create_context
If the EGL extension EGL_KHR_create_context is available, we can use it to
set the core/compatability profile and the minimum OpenGL version.

Use this if it is available to get the context requested by the GL attributes.
2014-06-28 12:17:29 -03:00
Sam Lantinga
e11bc486e4 Fixed compiler warning on Android 2014-06-26 12:42:15 -07:00
Sam Lantinga
eaea0767d0 Updated the template project for iOS, thanks to Davide Coppola 2014-06-25 21:40:56 -07:00
Sam Lantinga
7db8668ef4 Fixed YUV texture update with a subrect in OpenGL ES 2.0 - thanks Sylvain! 2014-06-25 21:06:47 -07:00
David Ludwig
1ca360079d WinRT: Fixed game controller axis mappings
SDL/WinRT currently uses a separate XInput backend from SDL/Win32, as WinRT
has no support for DirectInput.  This change makes SDL/WinRT's XInput
code snag some recently-changed bits from the Win32-specific,
DirectInput + XInput backend, in order to get the SDL_GameController API
working again on WinRT, insofar that axes map to the correct parts.

TODO:
 - test all buttons, making sure WinRT maps buttons the same way that Win32 does
 - consider making the Win32 and WinRT codebases share more stuff, minus
   the sort of duplication happening via this change.  Maybe simulate, or
   stub-out, DirectInput calls when on WinRT?
2014-06-25 22:38:40 -04:00
David Ludwig
ca9eaef087 WinRT build fix 2014-06-25 22:03:05 -04:00
Ryan C. Gordon
f8662b2863 Patched to compile on Windows. 2014-06-25 17:24:06 -04:00
Ryan C. Gordon
2e7d8cfb48 Whoops, lost this in the merge. 2014-06-25 17:20:22 -04:00