Commit Graph

6245 Commits

Author SHA1 Message Date
Sam Lantinga
7b71990fe2 Backed out changeset c8b16b3a3c9b 2013-07-07 14:08:07 -07:00
Sam Lantinga
889b6aadc4 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
35c747cd4d Added automated test to validate conversion between all supported formats. 2013-07-07 12:34:26 -07:00
Sam Lantinga
6403bbcc7e Added surface conversion support for ARGB2101010 formats 2013-07-07 12:34:21 -07:00
Sam Lantinga
08f84f6b06 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
0c64161715 Updated configure with the sndio audio backend 2013-07-07 10:15:10 -07:00
Philipp Wiesemann
6f27bb0714 Corrected name of constant in header file comment. 2013-07-07 16:15:21 +02:00
Philipp Wiesemann
1f5019fb44 Changed include directive to standard header. 2013-07-07 16:13:17 +02:00
Philipp Wiesemann
ac7859a2dc 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
6174013522 Added an SDL2 OpenBSD sndio(7) audio target. 2013-07-07 02:03:07 -04:00
Ryan C. Gordon
69f525600a Disk audio target was using this->hidden->mixlen before we set it. 2013-07-07 02:04:19 -04:00
Ryan C. Gordon
b4e38d394c Minor ALSA tweaks (include-once macro name, len for memset() more clear). 2013-07-07 02:03:50 -04:00
Sam Lantinga
580e8a54b0 Added 8-bit RGB source surface support to NtoN blitters 2013-07-06 21:17:09 -07:00
Sam Lantinga
caff7e8153 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
8425cf5d1a Fixed bug 1911 - enable HAVE_GCC_ATOMICS for android platform 2013-07-06 12:39:56 -07:00
David Gow
f5777f9c53 Remove full-desktop Xinerama mode when using XRandR 2013-06-25 21:36:36 +08:00
Sam Lantinga
e6a7f560a0 Make it possible to use SDL events separately from the video subsystem. 2013-07-06 12:28:57 -07:00
Sam Lantinga
c3b234be1b Updated the README to match the new website text 2013-07-06 11:56:04 -07:00
Gabriel Jacobo
fe40941788 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
1a101f252b Fixed SDL's implementation of isspace() to check form feed and vertical tab. 2013-07-06 16:05:09 +02:00
Philipp Wiesemann
6e19ab3aaf Added missing call to SDL_stack_free(). 2013-07-06 15:56:06 +02:00
Sam Lantinga
00b7934f8f 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
266b3c869f 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
4c4dbd43a4 Fixed mingw32 build 2013-07-06 00:15:01 -07:00
Sam Lantinga
719799241f Fixed build errors on Mac OS X 2013-07-06 00:06:44 -07:00
Sam Lantinga
69bede6d35 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
6aada55706 No, there's no reason not to use fprintf 2013-07-05 21:37:27 -07:00
Sam Lantinga
7ab71db55c Fixed detection of overlong sequences (thanks Tommy!) 2013-07-05 21:25:32 -07:00
Ryan C. Gordon
962e55a308 Patched to compile on pre-C99 compilers. 2013-07-05 01:31:02 -04:00
Ryan C. Gordon
81c892c83b 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
e749bdffe7 Fixed some __BEOS__ vs __HAIKU__ preprocessor tests (thanks, Axel!).
Fixes Bugzilla #1773.
2013-07-05 01:09:27 -04:00
Ryan C. Gordon
6ca14bb9d2 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
25283c7e99 Strip newlines from messages in SDL_Log*() before calling logging function. 2013-07-05 00:41:34 -04:00
Ryan C. Gordon
c5f0419216 Added a FIXME. 2013-07-05 00:41:01 -04:00
Ryan C. Gordon
79d7ea0d5d 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
Sam Lantinga
10f2d9ded3 Added SDL_HINT_JOYSTICK_ALLOW_BACKGROUND_EVENTS to the documentation for the joystick and game controller APIs 2013-07-03 12:31:40 -07:00
Edward Rudd
c4fe4c4f29 add in alt+enter keyboard shortcut to test common to toggle fullscreen desktop 2013-06-04 12:02:18 -04:00
Sam Lantinga
722a61f8df Fixed the logical size for rendering to texture, thanks to Mason Wheeler.
Mason Wheeler

The SDL_RenderGetLogicalSize function should always return the amount of pixels that are currently available for rendering to.  But after updating to the latest SDL2, I started getting crashes because it was returning (0,0) as the logical size!  After a bit of debugging, I tracked it down to the following code in SDL_SetRenderTarget:

    if (texture) {
        renderer->viewport.x = 0;
        renderer->viewport.y = 0;
        renderer->viewport.w = texture->w;
        renderer->viewport.h = texture->h;
        renderer->scale.x = 1.0f;
        renderer->scale.y = 1.0f;
        renderer->logical_w = 0;
        renderer->logical_h = 0;
    }

This is obviously wrong; 0 is never the correct value for a valid renderer.  Those last two lines should read:

        renderer->logical_w = texture->w;
        renderer->logical_h = texture->h;
2013-06-29 14:40:55 -07:00
Philipp Wiesemann
e8d807b810 Changed paths and name of header file in text of VisualC.html. 2013-06-29 22:08:38 +02:00
Sam Lantinga
95bb9a77c4 Only check for keyboard focus if the video subsystem was initialized.
Check the hint at initialization time, as an optimization.  This isn't something we expect the application to change at runtime, and if it is we should add an API for it.
2013-06-28 23:29:13 -07:00
Sam Lantinga
920ab7e6bf Removing old dangerous signal catching code.
* None of the supported platforms are hosed if the program crashes without cleaning up the graphics display connection.
* It's very likely to be unsafe to call SDL_Quit() at an arbitrary point from an arbitrary thread.
* Catching signals can prevent applications from getting correct stack traces from crashes.
2013-06-28 22:49:03 -07:00
Sam Lantinga
822fa46bfe Not using SDLmain on Windows is just fine, don't fail the initialization if the program implements WinMain() and then doesn't call SDL_SetMainReady().
This broke Steam's Big Picture game controller support.

I also added some more documentation so people know why main() is overridden on various platforms.
2013-06-28 22:44:49 -07:00
Sam Lantinga
c70478c904 Added testgamecontroller to the Visual Studio 2012 solution. 2013-06-28 22:42:10 -07:00
Sam Lantinga
cee64ab8c3 Merged 2013-06-28 20:46:11 -07:00
Sam Lantinga
d85c0e33ad Merged 2013-06-28 09:53:13 -07:00
Sam Lantinga
7e741d0e51 Updated the name of the copyright file 2013-06-28 09:52:36 -07:00
Sam Lantinga
33c5279a16 Merged 2013-06-27 17:53:05 -07:00
Sam Lantinga
53b5fbb4b3 Whoops, this controller had already been added. 2013-06-27 17:49:22 -07:00
Jørgen P. Tjernø
ac9d81df00 Remove / update references to 1.2. 2013-06-27 17:07:24 -07:00
Jørgen P. Tjernø
3a4917404d sdl - added comment with URL to windows scancode definition document 2013-06-27 17:07:18 -07:00