Commit Graph

4107 Commits

Author SHA1 Message Date
Gabriel Jacobo
bf23f88256 Fixes typo in EGL code (thanks jmcfarlane!) 2013-08-26 14:23:18 -03:00
Ryan C. Gordon
811051ecaa Removed obvious comment to trigger buildbot. 2013-08-25 21:28:03 -04:00
Edward Rudd
02e78e6604 reworked GetBasePath on OS X to use Contents/Resource by default if bundled, or exedir if not bundled.
- also adds OS X specific magic for bundled apps adding an Info.plist property of name SDL_FILESYSTEM_BASE_DIR_TYPE to the following values will change the bahaviour.
* bundle -- use the bundle directory e.g. "/Applications/MyGame/Blah.app/"
* parent -- use the bundle parent directory e.g. "/Applications/MyGame/"
* resource -- use the bundle resource directory (default) e.g. "/Applications/MyGame/Blah.app/Contents/Resources/"
2013-08-25 11:24:01 -04:00
Gabriel Jacobo
1960a11679 Fixes "error: conflicting types for 'GLintptr'" 2013-08-25 11:48:49 -03:00
Ryan C. Gordon
a9e59a9c1c Minor FreeBSD code cleanup. 2013-08-24 21:15:10 -04:00
Edward Rudd
0d9b3f9116 Fix #2062 Be more diligent about validating trailing "/" existence in HOME and XDG_DATA_HOME env vars 2013-08-24 09:05:18 -04:00
Ryan C. Gordon
dcf1507675 Patched to compile on Solaris. 2013-08-23 23:34:23 -04:00
Ryan C. Gordon
e489ba1b6f Patched to compile on FreeBSD. 2013-08-23 21:48:40 -04:00
Ryan C. Gordon
c25827b1f1 Add support for some BSDs and Solaris to SDL_GetBasePath(). 2013-08-23 21:38:54 -04:00
Gabriel Jacobo
3d70638fcf Fix warning in GL ES2 renderer 2013-08-22 17:26:22 -03:00
Ryan C. Gordon
4db9e1c7a1 XAudio2/DirectSound: Use the usual Windows string convert (thanks, Norfanin!). 2013-08-22 13:32:27 -04:00
Sam Lantinga
c6a11602a3 Fixed compiling on old versions of the DirectX SDK 2013-08-21 12:12:04 -07:00
Sam Lantinga
8685ca6cdd SDL
- detect that you tried to open a gamecontroller in xinput mode and failed, then re-get the mapping for the dinput variant you did open (and most likely now just fail the open)

CR: SamL
2013-08-21 10:32:04 -07:00
Sam Lantinga
a9be917e0f Fix SDL xinput code to work at all when xinput has devices at high indexes but no device connected at lower index, for instance 0->disconnected, 1->wireles, 2->wired. Previously the SDL code assumed the indexes were always used up in order which is not true at all and lead to a bunch of failure cases where controllers would go unrecognized.
This entire function is kind of a mess and more complicated than needed, but I don't want to refactor it too heavily tonight.  May look at improving how the indexes are assigned more significanly later.  The way it handles not finding a valid "gamepad" type device is also super broken, it leaves in place the xinput bindings but opens the controller with dinput and ends up with completely wrong mappings, not solving that now, but fixing the bug where we'd very frequently not find a controller due to gaps in assigned player numbers should mostly avoid it.
2013-08-21 10:31:44 -07:00
Sam Lantinga
113a00b54e Fixed crash if the IC isn't set up for some reason (bad X11 locale?) 2013-08-21 10:07:48 -07:00
Gabriel Jacobo
acff11318d Fix a couple of warnings 2013-08-21 10:34:32 -03:00
Gabriel Jacobo
49f7c02626 Patched to compile on Darwin 2013-08-21 10:27:39 -03:00
Gabriel Jacobo
bb01614557 More fixes for -Wdeclaration-after-statement 2013-08-21 10:13:12 -03:00
Gabriel Jacobo
bc514bada3 Fixes for -Wdeclaration-after-statement 2013-08-21 10:12:16 -03:00
Gabriel Jacobo
8515791f86 OCD fixes: Adds a space after /* (glory to regular expressions!) 2013-08-21 09:47:10 -03:00
Gabriel Jacobo
871473e032 OCD fixes: Adds a space before */ 2013-08-21 09:43:09 -03:00
Ryan C. Gordon
0382f2f764 Actually, this should be a memcpy().
We already know the exact length we just allocated, and we plan to append
 our own null terminator to the end of the copy, so this makes more sense.
2013-08-20 23:20:32 -04:00
Ryan C. Gordon
66098d3179 Patched to compile on iOS. 2013-08-20 21:21:57 -04:00
Ryan C. Gordon
14cd2136c6 More Haiku fixes. 2013-08-20 20:39:22 -04:00
Ryan C. Gordon
f73a517eb4 Fixed compiler warning. 2013-08-20 20:31:57 -04:00
Ryan C. Gordon
9588bae18a More Windows fixes for filesystem code. 2013-08-20 20:29:30 -04:00
Ryan C. Gordon
27f294dbb5 Patched new filesystem code to compile. 2013-08-20 20:15:15 -04:00
Ryan C. Gordon
8fe1cf47f2 Added SDL_GetBasePath() and SDL_GetPrefPath() in new filesystem module. 2013-08-20 19:57:11 -04:00
Gabriel Jacobo
f93c78450b More non C89 compliant comments 2013-08-20 20:34:40 -03:00
Gabriel Jacobo
d239c42447 Fixes a few non C89 compliant comments 2013-08-20 19:49:24 -03:00
Ryan C. Gordon
4806b2259c Added some FIXMEs for later. 2013-08-20 12:43:06 -04:00
Gabriel Jacobo
84f07d804a Fixes bug #2037, common EGL code for Android and X11 2013-08-19 16:29:46 -03:00
Ryan C. Gordon
ae735be7ec Fixed leaking of pixel shader object in D3D renderer (thanks, Peter!).
Fixes Bugzilla #2047.
2013-08-19 11:02:44 -04:00
Sam Lantinga
4a4a243e8d Fixed Haiku build (thanks Alexander!) 2013-08-18 22:05:53 -07:00
Ryan C. Gordon
a2907d64fc Patched to compile with Visual Studio. 2013-08-17 20:46:34 -04:00
Sam Lantinga
aaeb2536aa Fixed Windows build 2013-08-17 17:14:15 -07:00
Sam Lantinga
ec0aa51cec Fixed for consistency with the other platforms 2013-08-17 17:04:14 -07:00
Edward Rudd
3f7516d961 auto init the ticks if the GetTicks and the like methods are called before SDL_Init().. This prevents annoying game bugs such as caching SDL_GetPerformanceFrequency in a static initializer 2013-08-17 18:07:29 -04:00
Sam Lantinga
997833aa8a Do full state initialization in D3D_Reset(), this fixes blend mode issues when resizing the window on Windows 8. 2013-08-17 09:54:30 -07:00
Sam Lantinga
b5015cf0a2 Fixed windows build 2013-08-16 17:50:44 -07:00
Sam Lantinga
0545c919a3 The keyboard text events should be sent after the key down events 2013-08-16 15:38:06 -07:00
Sam Lantinga
97c745d442 Fixed bug 1876 - SDL_TEXTINPUT only returns '?' (0x3F) in event.text.text with Khmer language input
Andreas

The issue comes down to this line on MSDN:
"TranslateMessage produces WM_CHAR messages only for keys that are mapped to ASCII characters by the keyboard driver."

"WM_KEYDOWN and WM_KEYUP combinations produce a WM_CHAR or WM_DEADCHAR message. WM_SYSKEYDOWN and WM_SYSKEYUP combinations produce a WM_SYSCHAR or WM_SYSDEADCHAR message."
Except for WM_CHAR, none of these messages are used in SDL. Hence TranslateMessage should be dropped entirely and proper handling be included in the WM_KEYDOWN event.
Currently TranslateMessage is called for every message even if it must not be called in certain cases (like "An application should not call TranslateMessage if the TranslateAccelerator function returns a nonzero value.").

WM_CHAR message handling should remain for external processes posting these messages - additionally, WM_UNICHAR should be added.

I made a patch for src/video/windows/SDL_windowsevents.c that seems to work fine. It doesn't solve the "missing" composition for Khmer, but at least input for languages that cannot be mapped to ASCII characters (and for which IME is not used) will now work on Windows.
2013-08-16 15:35:10 -07:00
Gabriel Jacobo
973b6fec27 Android quirk:Some devices don't report GL_OES_framebuffer_object but support it 2013-08-16 14:38:04 -03:00
Ryan C. Gordon
6d08ab8e93 Patched to compile. 2013-08-16 12:51:29 -04:00
Gabriel Jacobo
6af114230c [Bug 2042] OpenGL ES renderer tries to load OES functions unconditionally
Also, fail more gracefully when creating texture to avoid double free errors.
2013-08-16 13:37:27 -03:00
Sam Lantinga
116208a01f Fixed alpha composition when destination alpha is transparent.
Jianyu Guan

I found I make a big mistake that when dstA==0, I just simply let *dstp=*srcp and forgot to make dstRGB = srcRGB*srcA.

The if consition "(*dstp & amask) == 0" in BlitRGBtoRGBPixelAlphaMMX and BlitRGBtoRGBPixelAlphaMMX3dNow should be removed.
2013-08-16 09:20:33 -07:00
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
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
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
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