Commit Graph

6206 Commits

Author SHA1 Message Date
Sam Lantinga
2ca69c615c Fixed alpha blending for the MMX blit functions
I see the Remarks of function SDL_BlitSurface shows that "when SDL_BLENDMODE_BLEND, we have dstA = srcA + (dstA * (1-srcA))". however, I tested some pictures but the result implies "dstA=arcA" actually. I stepped into the source code, and found after I set SDL_BLENDMODE_BLEND for the source surface, the final blit function is BlitRGBtoRGBPixelAlphaMMX when I use SDL_BlitSurface on my computer. And I found these codes:

    else if (alpha == amask) {
    /* opaque alpha -- copy RGB, keep dst alpha */
    *dstp = (*srcp & chanmask) | (*dstp & ~chanmask);

The same code is used in BlitRGBtoRGBPixelAlphaMMX3DNOW and BlitRGBtoRGBPixelAlpha. So I think they still keep dst alpha.

Best regards,
Jianyu Guan
2013-08-16 06:59:19 -07:00
Andreas Schiffler
7582a71d05 Fix bug 2034: replace printf by SDL_Log in tests; update loopwave VS solution: copy missing dependency 2013-08-14 23:30:10 -07:00
Sam Lantinga
824cddc9fb Don't print "unrecognized key" message for an X11 keycode of 0. This can happen with composed characters. 2013-08-12 22:00:21 -07:00
Sam Lantinga
59a54f91ce Fixed the tag name for the SDL 2.0 release 2013-08-12 19:18:48 -07:00
Jørgen P. Tjernø
4a81e02ae5 Mac: Fix restoring of Cmd-H-hidden fullscreen desktop windows.
This should fix http://bugzilla.libsdl.org/show_bug.cgi?id=1996
2013-08-12 11:09:13 -07:00
Sam Lantinga
545680d691 Added Julian Winter to the credits for the SDL 2.0 website. 2013-08-12 08:45:37 -07:00
Sam Lantinga
016d47d2d7 Added tag release_2.0.0 for changeset d6a8fa507a45 2013-08-12 08:40:49 -07:00
Gabriel Jacobo
4c2136d6d2 Fixes #2022, do not resume on Android when surfaceChanged
If the app is in landscape mode and the user presses the power button, a pause
is followed immediately by a surfaceChanged event because the lock screen
is shown in portrait mode. This triggers a "false" resume.
So, we just pause and resume following the onWindowFocusChanged events.

Also, wait for SDL_APP_WILLENTERBACKGROUND and SDL_APP_DIDENTERBACKGROUND before
blocking the event pump.
2013-08-12 11:13:50 -03:00
Sam Lantinga
34710c77de Fixed bug 2027 - Full-screen appears to be broken - hang in SDL_DestroyWindow()
Rainer Deyke

I'm running Linux Mint 15 with the Cinnamon window manager.  SDL_DestroyWindow consistently locks up for me when the window if fullscreen.
2013-08-11 19:56:43 -07:00
Philipp Wiesemann
9c07454d41 Added missing call to SDL_stack_free().
On Windows this is needed because SDL_stack_alloc() wraps SDL_malloc().
2013-08-10 23:21:06 +02:00
Philipp Wiesemann
07d62e2d9c Removed SDL_HAPTIC_SQUARE from comments in header to prevent doxygen confusion. 2013-08-10 23:14:20 +02:00
Philipp Wiesemann
37516af4c1 Corrected comment in test program. 2013-08-10 23:07:28 +02:00
Sam Lantinga
ab4156e1ac Fixed bug 1925 - SDL_GetPerformanceFrequency returns incorrect value on iOS
PoopiSan

Currently on OSX and iOS simulator the values:
mach_base_info.denom = 1
mach_base_info.numer = 1

but on the real iOS device
mach_base_info.denom = 3
mach_base_info.numer = 125

The calculation is made using following formula
mach_base_info.denom / mach_base_info.numer * 1000000

but all values are int32 and the result is casted to int64.

This solves the problem:

return 1.0 * mach_base_info.denom / mach_base_info.numer * 1000000;
2013-08-10 11:19:30 -07:00
Sam Lantinga
3d37f9ab7b Fixed whitespace 2013-08-10 10:57:54 -07:00
Sam Lantinga
ea2abfa241 Fixed bug 2024 - Update OSX Joystick code to fully support Saitek p2500 gamepad
Patrick Maloney

Saitek p2500 (Cyborg Rumble Force Pad) has a D-pad, two analog sticks, and numerous buttons.  SDL 2.x on OSX detected everything except the right-side analog stick.  The right-side stick is considered a 'simulation device' with the axes mapped to throttle and rudder.

The patch adds support for throttle and rudder on the HID simulation page.
2013-08-10 10:55:12 -07:00
Sam Lantinga
53a86d45bd Check the return value of glGenTextures() 2013-08-10 10:49:26 -07:00
Ryan C. Gordon
03c58caaaa Haptic: Let XInput update effects while they're still running. 2013-08-10 13:46:19 -04:00
Ryan C. Gordon
7f43d9ff8b Removed no-longer-necessary comment. 2013-08-10 13:40:08 -04:00
Ryan C. Gordon
2fbbecf909 Replaced SDL_HAPTIC_SQUARE with SDL_HAPTIC_LEFTRIGHT.
We needed a bit, so we're hoping no one needs this effect, especially when
it's fairly close to SDL_HAPTIC_SINE, we hope.

SDL_HAPTIC_LEFTRIGHT maps to XInput's functionality, so this removes the SINE
code for the XInput driver to keep things clean.

This also makes the simplified Rumble API use SDL_HAPTIC_LEFTRIGHT if
SDL_HAPTIC_SINE isn't available, to keep XInput working.

When we break the ABI, and can extend the supported capabilities field from
a Uint16, we'll add SDL_HAPTIC_SQUARE back in.

This patch is based on work by Ethan Lee.
2013-08-10 13:38:09 -04:00
Ryan C. Gordon
67a0b6551b Fixed some typos in the headers. 2013-08-10 13:20:45 -04:00
Sam Lantinga
0663c26353 Added the Google Summer of Code students from 2010 2013-08-09 23:58:33 -07:00
Sam Lantinga
ed4c2a6946 Updated the credits for SDL 2.0. Thank you everyone! 2013-08-09 23:43:14 -07:00
Sam Lantinga
f19fef3eb6 Fixed bug 2007 - SDL_SetWindowMinimumSize() not implemented on X11 (thanks Rainer!) 2013-08-09 23:13:52 -07:00
Sam Lantinga
da8571affc Better wording suggested by the community 2013-08-09 21:09:49 -07:00
Andreas Schiffler
2bf318cac0 Update video_getSetWindowSize for windows 2013-08-08 22:10:00 -07:00
Andreas Schiffler
ea498a599d Fix Bug 2021: Win32: Stack overflow due to recursive SDL_LogOutput on SDL_LogError without console; fix off-by-one error in SDLtest test suite 2013-08-08 21:29:30 -07:00
Sam Lantinga
35d8faed5d Removed unneeded Android audio code 2013-08-08 21:16:29 -07:00
Gabriel Jacobo
d0ac9f02aa Start Android Audio Thread after audio buffer and AudioTrack are ready.
Also, it starts the Audio Thread from the native side, putting the code in line
with other backends.
2013-08-08 21:25:09 -03:00
Ryan C. Gordon
0e5d2125a5 SDL_RegisterEvents() now rejects requests for numevents <= 0. 2013-08-08 15:04:30 -07:00
Jørgen P. Tjernø
072168c65a Mac: Fix mouse tap on 10.5.
There's no Block support in the runtime on 10.5, so the old code
wouldn't work.
2013-08-08 13:29:44 -07:00
Ryan C. Gordon
3425e6a209 Backed out changeset 3f487d7d2d1d
This breaks applications.
2013-08-08 13:22:21 -07:00
Ryan C. Gordon
7bc19eeddf Send the SDL_QUIT when last window is destroyed, not during its close event. 2013-08-08 12:49:29 -07:00
Jørgen P. Tjernø
6cffb5553f Mac: Don't enable SDL_MAC_NO_SANDBOX by default.
To get this functionality, you need to use -DSDL_MAC_NO_SANDBOX=1 in
your CFLAGS.
2013-08-08 12:48:37 -07:00
Sam Lantinga
e66f593a02 Fixed crash if SDL_GetThreadName() is passed a NULL thread. 2013-08-08 12:21:26 -07:00
Sam Lantinga
c1a94e232c Fixed whitespace 2013-08-08 12:20:22 -07:00
Edward Rudd
ca4844e67e use @rpath for OS X Shared Library as well 2013-08-08 11:41:35 -04:00
Gabriel Jacobo
7da63a0c08 Add some protection against double init of the Android audio backend 2013-08-08 09:47:42 -03:00
Sam Lantinga
66d3386956 Fixed compile error 2013-08-08 02:34:21 -07:00
Sam Lantinga
dbc779cbcb Fixed bug 2009 - Creating texture from 32-bit surface with colorkey and per-surface alpha ignores the colorkey
To fix this we need to ignore the alpha channel in the colorkey comparison, which is the way colorkey comparisons are defined in SDL.

We also need to reset the alpha and color modulation when converting a surface.
2013-08-08 02:30:32 -07:00
Sam Lantinga
b4d6152c93 autogen.sh on development system 2013-08-08 01:59:36 -07:00
Sam Lantinga
aaa26e1f87 Updated README to match new website description 2013-08-08 01:59:19 -07:00
Sam Lantinga
f180aebaa0 Explicitly use the RTLD_LOCAL flag since that's the behavior we want.
The default on Linux is RTLD_LOCAL, the default on Mac OS X is RTLD_GLOBAL.
2013-08-07 17:26:28 -07:00
Sam Lantinga
d683eadde5 The return value of SDL_MostSignificantBitIndex32(0) is defined as -1. 2013-08-07 16:32:51 -07:00
Jørgen P. Tjernø
a861227272 Ensure that the right window is current in SDL_GL_SwapWindow. 2013-08-07 16:29:28 -07:00
Jørgen P. Tjernø
2be0b82864 Mac: Support for multiple contexts per SDL_Window. 2013-08-07 16:29:25 -07:00
Jørgen P. Tjernø
2d3e238096 Mac: Don't -[NSOpenGLContext update] on (potentially) the wrong thread.
If the user is using their context from a non-main thread, we could be
calling -[NSOpenGLContext update] on our thread, while they were
accessing it on their thread.

With this change, we schedule updates when the event comes in on the
main thread, and act on them when the user calls SDL_GL_MakeCurrent or
SDL_GL_SwapWindow.
2013-08-07 16:29:21 -07:00
Jørgen P. Tjernø
3c31b3003b Mac: Better mouse-grab if you define SDL_MAC_NO_SANDBOX.
This uses a better mouse grab if you define SDL_MAC_NO_SANDBOX. This
mouse grab uses CGEventTapCreate, which you cannot access if you have
sandboxing enabled.
2013-08-07 16:29:15 -07:00
Sam Lantinga
cef724151d Updated the name of the iOS platform 2013-08-07 14:00:41 -07:00
Ryan C. Gordon
61d2cff464 Whoops, forgot to commit this piece. 2013-08-07 12:17:33 -07:00
Ryan C. Gordon
a09638f0d7 SDL_Init() is now just a wrapper around SDL_InitSubSystem(). 2013-08-07 11:14:16 -07:00