Commit Graph

10682 Commits

Author SHA1 Message Date
Alex Szpakowski
1ff3dd4faa iOS: Implemented clipboard support. 2016-02-03 20:32:55 -04:00
Sam Lantinga
e6a54327c7 David Carlier implemented SDL_GetBasePath() for OpenBSD 2016-01-31 21:11:15 -08:00
Sam Lantinga
f630e1922b Return the full number of events from SDL_PeepEvents() if NULL is passed in with SDL_PEEKEVENT 2016-01-31 11:29:11 -08:00
Alex Szpakowski
03296fc36d x11: Fix AltGr generating an invalid keycode (bug #3244). Thanks Thomas! 2016-01-31 09:39:42 -04:00
Philipp Wiesemann
3759334d39 PSP: Removed inlined copy of SDL_CalculateAudioSpec()'s functionality. 2016-01-27 23:20:23 +01:00
Philipp Wiesemann
0a18d8218d Android: Fixed ignoring a return value while handling motion events.
This should not have caused problems yet because the return value was identical.
2016-01-26 22:20:05 +01:00
Sam Lantinga
090180b057 Fixed creating fullscreen windows on Steam Link 2016-01-22 13:12:16 -08:00
Sam Lantinga
27224491cb Expose the EGL display and window for Vivante SDL windows 2016-01-16 21:58:49 -08:00
Philipp Wiesemann
1785faee11 Fixed compile warnings about type conversion.
Found by buildbot.
2016-01-16 21:25:10 +01:00
Philipp Wiesemann
d880e95d7f Android: Fixed finishing Activity on some devices if right mouse button pressed.
Partially fixes Bugzilla #3227.
2016-01-13 19:31:03 +01:00
Philipp Wiesemann
cdd5322c71 Fixed two typos in documentation. 2016-01-12 22:23:53 +01:00
Philipp Wiesemann
3373b66792 Android: Added mouse initialization to reset state.
If the app is launched again then the shared object may be reused (on Android).
2016-01-12 22:23:00 +01:00
Philipp Wiesemann
c518619898 Android: Fixed a comment. 2016-01-12 22:22:24 +01:00
Philipp Wiesemann
7e691104db Android: Added mapping of mouse forward button and mouse back button. 2016-01-11 20:02:48 +01:00
Alex Szpakowski
e9af2aaad0 Removed dead code (caught by Clang's static analyzer). 2016-01-09 17:41:09 -04:00
Ryan C. Gordon
e616988fd6 CMake: only set "-O3 -g" defaults if CMAKE_BUILD_TYPE wasn't set at all. 2016-01-08 07:32:51 -05:00
Ryan C. Gordon
19ea7d41a4 Fixed buildbot's static analysis script to enable assertions.
This removes false positives. Apparently someone forced the default CMake
builds to use -O3, turning these off by default.  :/
2016-01-08 07:21:15 -05:00
Ryan C. Gordon
42c8c55ea2 x11: make last mouse coords sane upon window entry (thanks, Cengiz!).
(and thanks to Cengiz for many of the previous Unreal-related
patches! They were generically credited to Epic Games, but a large
amount of that work was his contribution.)

Fixes Bugzilla #3067.
2016-01-07 19:58:00 -05:00
Sam Lantinga
469ea3a75d Fixed --enable-new-dtags check with cmake 2016-01-07 17:21:50 -08:00
Sam Lantinga
e802ca177e Use --enable-new-dtags to set RUNPATH rather than RPATH so that LD_LIBRARY_PATH is not overridden by the application. 2016-01-07 16:42:30 -08:00
Ryan C. Gordon
7e3ed918dd Fixed NULL dereference on drop events with no window associated.
(such as when dropping a file onto an app's icon to launch.)

This bug caught by Clang's static analyzer.
2016-01-07 16:01:24 -05:00
Sam Lantinga
c809629b7b Updated debian packaging files 2016-01-07 12:01:51 -08:00
Ryan C. Gordon
f3c5e0378f Updated dynamic API table. 2016-01-07 14:51:22 -05:00
Ethan Lee
90917e91c8 SDL_RenderSetIntegerScale 2016-01-05 16:39:18 -05:00
Ryan C. Gordon
15cec4cfce Mac: Implemented SDL_GetDisplayDPI (thanks, Kirill!).
Fixes Bugzilla #3223.
2016-01-07 14:02:37 -05:00
Philipp Wiesemann
0bfcdcd7a0 Fixed compile warnings about uninitialized variables in test library.
Found by buildbot.
2016-01-06 22:39:29 +01:00
Philipp Wiesemann
327027d07d Fixed outdated information in a README for iOS.
Four of the listed programs do not exist anymore.
2016-01-06 22:39:04 +01:00
Philipp Wiesemann
f7aacf3f63 Fixed doxygen warnings. 2016-01-06 22:38:35 +01:00
Ryan C. Gordon
607ee48f9d CMake: Turned off Mac OS X rpath warning kludge.
Apparently CMake errors out if it doesn't know this policy, and we don't
otherwise require CMake 3.0 yet. Sigh.
2016-01-05 05:44:32 -05:00
Ryan C. Gordon
01a557d29b Patched to compile on iOS. 2016-01-05 05:38:55 -05:00
Ryan C. Gordon
de04391e1d Android: Fixed up drop events for new interface. 2016-01-05 05:31:33 -05:00
Ryan C. Gordon
5416373cf0 Patched to compile. 2016-01-05 05:22:35 -05:00
Ryan C. Gordon
0170123536 Use SDL's stdinc functions instead of C runtime calls. 2016-01-05 02:29:16 -05:00
Ryan C. Gordon
35626f1605 Added SDL_WINDOWEVENT_TAKE_FOCUS.
This is for corner cases where a multi-window app is activated and wants to
make a decision about where focus should go.

This patch came from Unreal Engine 4's fork of SDL, compliments of Epic Games.
2016-01-05 02:27:50 -05:00
Eric Wing
d292e394a6 merged SDL 2.0.4 rc2 2015-06-21 04:04:14 -07:00
Philipp Wiesemann
797a37d1b5 Added missing file and folder to the release archive. 2015-06-20 11:15:37 +02:00
Sam Lantinga
088cb64b25 Added the docs directory to the release archive 2015-06-20 00:25:28 -07:00
Sam Lantinga
4388c6e166 GCC is warning about global functions with the same name as variables in the code, when using -Wshadow.
This is a little ridiculous because we have no idea what functions a given platform will provide, so we'll disable -Wshadow for now.
2015-06-19 23:53:33 -07:00
Sam Lantinga
cfce458df8 Use CLOCK_MONOTONIC_RAW, if available, which is not subject to adjustment by NTP 2015-06-19 23:49:00 -07:00
Sam Lantinga
5ac1d2ab15 Android has clock_gettime() - thanks Michael Labbe! 2015-06-19 23:40:23 -07:00
Sam Lantinga
1838d55586 Cleaned up Xcode rules a little more 2015-06-19 23:32:37 -07:00
Sam Lantinga
bdd751991d Simplified Mercurial ignore rules for Xcode build products 2015-06-19 23:27:35 -07:00
Sam Lantinga
49733e3a0d Fixed bug 2538 - SDL_SetTextureAlphaMod does not work with SDL_FlipMode or rotation in the software renderer
Adam M.

When setting a texture alpha mod other than 255 and also specifying a flip mode in the software renderer, the rendering fails. When the texture has an alpha channel, it becomes invisible when flipped. When the texture does not have an alpha channel, it is flipped but the colors are wrong: the alpha mod makes the texture darker rather than more translucent.

0) Initialize a software renderer.
1) Load 16-bit 565 or 32-bit texture.
2) Set texture blend mode to BLEND.
3) Set texture alpha mod to 150.
4) Draw the texture flipped horizontally and/or vertically.
2015-06-19 23:22:53 -07:00
Sam Lantinga
4713d5b479 Fixed bug 1550 - SDL_RenderCopy/CopyEx in software should optionally render 8bit alpha
Adam M.

There are three problems in the code that I see.
1. SW_RenderCopyEx enables a color key on surface_scaled even if the source surface didn't have a color key.
2. SW_RenderCopyEx doesn't copy blend mode, color mod, or alpha mod from src to surface_scaled.
3. When SDL_BlitScaled(src, srcrect, surface_scaled, &tmp_rect) is called, it blends the src pixels into surface_scaled instead of overwriting them (if src has blending, etc. enabled).

I've attached a patch that 1) fixes the three problems that I mentioned, 2) adds the requested performance improvement of using the regular blit function if no rotation or flipping is needed, 3) avoids cloning the source surface if no stretching is required, and simplifies the rotation code slightly.
2015-06-19 23:20:43 -07:00
Sam Lantinga
219c607c5f Fixed bug 3023 - setting a white and then non-white texture color mod breaks the texture with software renderer
Adam M.

Okay, here is the problem, I think.

During the first blit, RLEAlphaSurface is called to do RLE conversion of the RGBA source into a format allowing it "to be quickly alpha-blittable onto dest". Since the destination is the screen, it has no alpha channel. RLEAlphaSurface calls copy_opaque(dst, src + runstart, len, sf, df) (where copy_opaque is copy_32), which has this code:

SDL_RLEaccel.c:984:
  RGBA_FROM_8888(*src, sfmt, r, g, b, a);
  PIXEL_FROM_RGBA(*d, dfmt, r, g, b, a);

On the first line, it reads the source pixel 0xFFFFFFFF. The second line drops the alpha value (because dfmt for the screen has no alpha channel) and writes 0x00FFFFFF. Later, when the RLE conversion is being undone, uncopy_32 is called, which has the following code:

SDL_RLEaccel.c:1001:
  Uint32 pixel = *s++;
  RGB_FROM_PIXEL(pixel, sfmt, r, g, b);
  a = pixel >> 24;
  PIXEL_FROM_RGBA(*dst, dfmt, r, g, b, a);

However, the the alpha channel has already been dropped by copy_opaque (= copy_32), so pixel = 0x00FFFFFF and 'a' becomes 0. Thus, all opaque pixels lose their alpha channel when being unRLE'd. (I don't know what happens to pixels with alpha from 1-254, but they should be checked too.)

So, that seems to be the problem, but I'm not sure what the solution should be. Since opaque pixels have alpha == 255, I'm thinking to create another uncopy function for opaque pixels that simply uses 255 for alpha.

However, there may be other problems here. For translucent pixels, uncopy_32 assumes the alpha channel is stored in the upper 8 bits, but copy_32 doesn't store it there. Instead, it stores it in whatever location is appropriate for the destination surface. Isn't one of their behaviors incorrect, given the other? I'm not sure which to change, however.

For translucent pixels, it seems that the blit function uses do_blend, which is the BLIT_TRANSL_888 macro, which also assumes alpha is in top 8 bits. It has the comment "we have made sure the alpha is stored in the top 8 bits...", but it seems that's not true (copy_32 doesn't make sure the alpha goes there).

Perhaps the correct fix is to make copy_32 put the alpha there, but then that seems to require that RLE conversion be limited to destination surfaces that don't use the upper 8 bits. However, looking further, it seems that has already been done: if (masksum != 0x00ffffff) return -1; /* requires unused high byte */
2015-06-19 23:12:13 -07:00
Sam Lantinga
3ceb72380e [mq]: 3027_rleperf.diff 2015-06-19 22:12:47 -07:00
Philipp Wiesemann
e73004f16a Added more entries and brackets to WhatsNew.txt for 2.0.4. 2015-06-19 21:17:00 +02:00
Ryan C. Gordon
0c02fa5348 CMake fixes for MingW (thanks, Ozkan!).
- ignore DXSDK_DIR for mingw environment
- use dxerr8 instead of dxerr for mingw.

Partially fixes Bugzilla #3016.
2015-06-18 22:34:39 -04:00
Alex Szpakowski
af195b705e Updated WhatsNew.txt's 2.0.4 list to include a more detailed set of changes for iOS, and added a couple missing items to the OS X and Windows sections. 2015-06-18 12:20:46 -03:00
Ryan C. Gordon
d6b1d573d6 Moving some whitespace around to test something on the Mercurial server. 2015-06-18 00:44:57 -04:00