Commit graph

5960 commits

Author SHA1 Message Date
Sam Lantinga
bfcb08d569 Implemented an API for thread-local storage: SDL_TLSCreate(), SDL_TLSSet(), SDL_TLSGet() 2013-07-10 02:32:04 -07:00
Jørgen P. Tjernø
ab91b4ce14 SDL_GL_MakeCurrent: Only no-op redundant calls on *same* thread.
This ensures that we only no-op redundant calls if they're made on the
same thread as the last MakeCurrent with those arguments. This should
maek SDL behave better with multithreaded environments.
2013-07-09 12:58:54 -07:00
Jørgen P. Tjernø
ea36ba4f4e Mac: Remove dead FULLSCREEN_TOGGLEABLE code.
This code was written almost 2 years ago, and the flag hasn't been
changed since. Cleaning up the code by removing the conditional blocks,
so that they behave the same way they have for the past two years.

FULLSCREEN_TOGGLEABLE used to cause us to use
-[NSOpenGLContext setFullScreen] and a pixel format with
NSOpenGLPFAFullScreen.
2013-07-09 12:57:12 -07:00
Gabriel Jacobo
4601ab6894 Removing video/uikit/*.c from configure's iOS sources
Unexplicable computer sciences phenomenon: Instead of returning an empty set,
*.c in an folder with no .c files produces the "*.c" string to be added as
a source. I'm sorry future generations, we are doing the best we can :)
2013-07-09 13:54:29 -03:00
Ryan C. Gordon
2740a12ae3 Backout hg changset 898992405fa7; lots of things still use SDL_types.h. :/
Will remove this again at some point in the future, though.
2013-07-09 11:57:32 -04:00
Sam Lantinga
9c43b29ef9 Made the SDL_memset4() comment even clearer so we don't accidentally replace it with memset() in the future. 2013-07-09 08:01:40 -07:00
Sam Lantinga
98053e8a85 Backed out commit 898992405fa7 because memset() does a byte fill and SDL_memset4() does a uint32 fill and this change breaks SDL_FillRect() 2013-07-09 07:13:58 -07:00
Gabriel Jacobo
b2d7f92773 Adds Input Focus handling on Android to improve pausing/resuming behavior
Ref: http://android-developers.blogspot.com/2011/11/making-android-games-that-play-nice.html
2013-07-09 10:25:16 -03:00
Ryan C. Gordon
7afed3e5ae Removed deprecated SDL_types.h header.
Fixes Bugzilla #1945.
2013-07-08 23:37:00 -04:00
Ryan C. Gordon
287d2529bd Replaced SDL_memset4() implementation with a call to SDL_memset().
The implementation was slower than the C runtime on Mac OS X, Linux, and
 Windows...quite a bit slower when using the C fallback instead of the inline
 asm, too.

Fixes Bugzilla #1755.
2013-07-08 23:22:36 -04:00
Edward Rudd
6f3b5c3641 change fsaa argument for testgl to accept a # of samples for FSAA 2013-07-08 17:51:17 -04:00
Ryan C. Gordon
40e8b24572 Disable OSS and BSD audio targets on OpenBSD.
--HG--
extra : rebase_source : f724ffb3927c2331c888eba6f55b71d114269bf4
2013-07-08 13:26:59 -04:00
Sam Lantinga
c6348f33e7 Make sure that srcdir has a full pathname so source indexing works. 2013-07-08 09:21:54 -07:00
Sam Lantinga
435103b3d9 Fixed bug 1943 - Wrong handling of legacy 32bpp BMP files
Kang Seonghoon

While BMP format supports alpha channel, it is enabled only when the header is at least 56 bytes long (BITMAPV3INFOHEADER and later). For very common 40-byte-long header (BITMAPINFOHEADER) 32bpp format should be interpreted as BGRX format, but currently SDL interprets them as BGRA format and causes a significant compatibility problem as many 32bpp files use a padding byte of 0 ("transparent" in BGRA interpretation).

---

I fixed this by checking to see if the alpha channel is all 0, and if so, setting it opaque.
2013-07-07 18:23:04 -07:00
Ryan C. Gordon
0ed61eba4b sndio dynamic loading fix. 2013-07-07 20:06:08 -04:00
Sam Lantinga
6255f7f9a8 Backed out changeset c8b16b3a3c9b 2013-07-07 14:08:07 -07:00
Sam Lantinga
274d4eeec2 Fixed bug 1943 - Wrong handling of legacy 32bpp BMP files
Kang Seonghoon

While BMP format supports alpha channel, it is enabled only when the header is at least 56 bytes long (BITMAPV3INFOHEADER and later). For very common 40-byte-long header (BITMAPINFOHEADER) 32bpp format should be interpreted as BGRX format, but currently SDL interprets them as BGRA format and causes a significant compatibility problem as many 32bpp files use a padding byte of 0 ("transparent" in BGRA interpretation).
2013-07-07 12:53:21 -07:00
Sam Lantinga
30553ceb5b Added automated test to validate conversion between all supported formats. 2013-07-07 12:34:26 -07:00
Sam Lantinga
235df7949e Added surface conversion support for ARGB2101010 formats 2013-07-07 12:34:21 -07:00
Sam Lantinga
becaf62d10 Fixed converting ARGB2101010 surfaces to 8-bit surfaces
It's not like this is very useful, but it fixes a crash in this case.
2013-07-07 10:31:01 -07:00
Sam Lantinga
4fed764ac6 Updated configure with the sndio audio backend 2013-07-07 10:15:10 -07:00
Philipp Wiesemann
764d957232 Corrected name of constant in header file comment. 2013-07-07 16:15:21 +02:00
Philipp Wiesemann
c8c3817b12 Changed include directive to standard header. 2013-07-07 16:13:17 +02:00
Philipp Wiesemann
0586d55560 Fixed SDL_RWread() returning -1 as unsigned instead of 0 if error on Android.
Found by Cppcheck (pointed out check of unsigned < 0 which was left in place).
2013-07-07 16:11:29 +02:00
Ryan C. Gordon
bbe065f50f Added an SDL2 OpenBSD sndio(7) audio target.
--HG--
extra : rebase_source : 5ad387265cff73c1635ca4f2c3635848ba722614
2013-07-07 02:03:07 -04:00
Ryan C. Gordon
fdca15860f Disk audio target was using this->hidden->mixlen before we set it.
--HG--
extra : rebase_source : 0ca3a2c97a59010e12df6a144757b6cadb4232c5
2013-07-07 02:04:19 -04:00
Ryan C. Gordon
13b57b17fd Minor ALSA tweaks (include-once macro name, len for memset() more clear).
--HG--
extra : rebase_source : 44c8b456ce5867d127b8e307c7854d1bab882a50
2013-07-07 02:03:50 -04:00
Sam Lantinga
c9acdd87a7 Added 8-bit RGB source surface support to NtoN blitters 2013-07-06 21:17:09 -07:00
Sam Lantinga
185f93a7a9 Fixed bug 1923 - Crash with SDL_SetColorKey
Sylvain

1/ Load an Image XPM with IMG_ReadXPMFromArray()
2/ Try to set a ColorKey on it.

I notice that :
- the SDL_Surface that is created from XPM has a palette !
- the colorkey is a RBG.

it crashes (SIGSEGV) inside the SDL_SetColorKey function:
"surface->format->palette->colors[surface->map->info.colorkey].a"
2013-07-06 20:29:40 -07:00
Sam Lantinga
91452f6355 Fixed bug 1911 - enable HAVE_GCC_ATOMICS for android platform 2013-07-06 12:39:56 -07:00
David Gow
4921d1b526 Remove full-desktop Xinerama mode when using XRandR 2013-06-25 21:36:36 +08:00
Sam Lantinga
156a8638f0 Make it possible to use SDL events separately from the video subsystem. 2013-07-06 12:28:57 -07:00
Sam Lantinga
4b0d90ff15 Updated the README to match the new website text 2013-07-06 11:56:04 -07:00
Gabriel Jacobo
4dbe83c72a Fixes Bug 1896 - Android app is running while the screen is locked
Original patch by ny00@outlook.com
2013-07-06 15:22:49 -03:00
Philipp Wiesemann
6aa8bc33bd Fixed SDL's implementation of isspace() to check form feed and vertical tab. 2013-07-06 16:05:09 +02:00
Philipp Wiesemann
a9558933a9 Added missing call to SDL_stack_free(). 2013-07-06 15:56:06 +02:00
Sam Lantinga
2015d5faa6 Fixed potential problem with postFinishLaunch being overridden by the application.
Vittorio Giovara

I find that the calling point in SDL_uikitappdelegate.m is dangerous as the -(void) postFinishLaunch method can be overridden when subclassing.
Could this be moved in inside the init or in the didFinishLaunchingWithOptions method which are always called even when subclassed?
2013-07-06 00:32:20 -07:00
Sam Lantinga
cbc0db6e72 Fixed bug 1936 - Broken URL in generic SDL_syscond.c
cp.ml.x.dev

A comment in 'src/thread/generic/SDL_syscond.c' references the URL 'http://www-classic.be.com/aboutbe/benewsletter/volume_III/Issue40.html', which cannot be resolved anymore. An alternative would be 'http://web.archive.org/web/20010914175514/http://www-classic.be.com/aboutbe/benewsletter/volume_III/Issue40.html#Workshop'.
2013-07-06 00:28:54 -07:00
Sam Lantinga
8ad9316ca3 Fixed mingw32 build 2013-07-06 00:15:01 -07:00
Sam Lantinga
ed07a40c62 Fixed build errors on Mac OS X 2013-07-06 00:06:44 -07:00
Sam Lantinga
cfd541e89c Removed the inline functions from SDL_stdinc.h
Having the SDL functions inline is causing build issues, and in the case of malloc(), etc. causing malloc/free mismatches, if the application build environment differs from the SDL build environment.

In the interest of safety and consistency, the functions will always be in the SDL library and will only be redirected to the C library there, if they are available.

See the following threads on the SDL mailing list for the gruesome details:
* SDL_stdinc.h inlines problematic when application not compiled in exact same feature environment
* Error compiling program against SDL2 with -std=c++11 g++ flag
2013-07-05 23:57:19 -07:00
Sam Lantinga
3a78485f2d No, there's no reason not to use fprintf 2013-07-05 21:37:27 -07:00
Sam Lantinga
f004771cf2 Fixed detection of overlong sequences (thanks Tommy!) 2013-07-05 21:25:32 -07:00
Ryan C. Gordon
0634073030 Patched to compile on pre-C99 compilers. 2013-07-05 01:31:02 -04:00
Ryan C. Gordon
65a277c322 Don't set the same GL context twice on Mac OS X (thanks, Alex!).
Fixes Bugzilla #1939.
2013-07-05 01:18:18 -04:00
Ryan C. Gordon
32e16f45fa Fixed some __BEOS__ vs __HAIKU__ preprocessor tests (thanks, Axel!).
Fixes Bugzilla #1773.
2013-07-05 01:09:27 -04:00
Ryan C. Gordon
522eeaf814 Don't crash if SDL_AudioQuit() is called twice in a row.
Fixes Bugzilla #1396.
2013-07-05 00:54:00 -04:00
Ryan C. Gordon
292c6c09ee Strip newlines from messages in SDL_Log*() before calling logging function. 2013-07-05 00:41:34 -04:00
Ryan C. Gordon
47a2869b0d Added a FIXME. 2013-07-05 00:41:01 -04:00
Ryan C. Gordon
0ea9cabb50 Don't close already-closed audio devices during SDL_Quit().
Otherwise, we spam a bunch of unnecessary SDL_SetError() calls.

Fixes Bugzilla #1791.
2013-07-05 00:30:23 -04:00