Commit Graph

5608 Commits

Author SHA1 Message Date
Ryan C. Gordon
16cdc59bab Make SDL_SetError and friends unconditionally return -1.
This lets us change things like this...

    if (Failed) {
        SDL_SetError("We failed");
        return -1;
    }

...into this...

    if (Failed) {
        return SDL_SetError("We failed");
    }


 Fixes Bugzilla #1778.
2013-03-31 12:48:50 -04:00
Ryan C. Gordon
171ad2ddcd Corrected function signature on SDL_strtod_inline() (thanks, Axel!).
Fixes Bugzilla #1774.
2013-03-29 21:29:57 -04:00
Ryan C. Gordon
879c663159 Haiku no longer #defines __BEOS__, so check for it too (thanks, Axel!).
Fixes Bugzilla #1773.
2013-03-29 21:25:02 -04:00
Ryan C. Gordon
2bcbb0d199 Patched test apps to compile with C89 compilers (thanks, Axel!).
Fixes Bugzilla #1772.
2013-03-29 21:21:48 -04:00
Ryan C. Gordon
cf94d2de94 Don't use __builtin_clz() on gcc2. (thanks, Axel!)
Fixes Bugzilla #1771.
2013-03-29 21:16:30 -04:00
Ryan C. Gordon
a9eb1f14ea Fixed compiler warnings with SDL_FORCE_INLINE on gcc2. (Thanks, Axel!)
Fixes Bugzilla #1770.
2013-03-29 21:13:16 -04:00
Sam Lantinga
85198ba1f3 The Haiku port is being actively maintained by Axel Dörfler 2013-03-26 22:26:07 -07:00
Sam Lantinga
af4d292e15 Fixed compiler error with Cygwin 2013-03-26 05:09:09 -07:00
Sam Lantinga
1297d17733 Fixed compiler warning with Cygwin 2013-03-26 05:08:57 -07:00
Sam Lantinga
dbb5bc19c3 SDL message box improvements from Dan Thompson 2013-03-26 04:57:29 -07:00
Sam Lantinga
5ffbff4132 Added support for the GameStop Gamepad 2013-03-25 12:04:16 -07:00
Sam Lantinga
77bba91132 Added GUIDs for Bluetooth devices, using the same algorithm as the Linux code.
Reformatted the code so it was easier to step through using gdb.
2013-03-25 11:38:30 -07:00
Sam Lantinga
0feed45f5c Make sure we bump the palette version when we modify it. 2013-03-24 10:37:16 -07:00
Sam Lantinga
4d92e1780f We're using the alpha component of the palette entries, let's name it appropriately. 2013-03-24 09:56:45 -07:00
Sam Lantinga
74fa44299d The palette unused value is treated as alpha and updated when setting the colorkey.
This fixes issues loading palettized images that have a colorkey with the same RGB values as another entry in the palette (e.g. bug 1746)
2013-03-24 09:51:01 -07:00
Sam Lantinga
ba643a7daa Updated the license listed in the header, fixing bug 1768 2013-03-23 13:03:36 -07:00
Sam Lantinga
dd7f59a25e Make SDL support the X11 clipboard TARGETS protocol, which advertises what formats text is available in from the application. This is necessary for many Linux programs to interact well with the clipboard. 2013-03-22 11:42:31 -07:00
Sam Lantinga
4ce5808f28 Removed old file from the Android build 2013-03-19 23:24:24 -07:00
Sam Lantinga
b1f7715713 Added missing files for the Android build 2013-03-19 23:07:49 -07:00
Sam Lantinga
91094c910e Fixed bug 1700 - Joysticks not supported in Android 2013-03-19 23:03:57 -07:00
Sam Lantinga
e25812727e Fixed bug 1759 - Updates to testjoystick.c
ny00

A minor patch is attached, with the following few changes to testjoystick.c:
- Unused constant definitions have been removed.
- Output for all analog axes is drawn, even when there is an odd number of axes. (I have a controller with 5 analog axes.)
- Buttons are now drawn on two rows, so there's room for more. In fact, it has been used for testing a proposed joystick patch for Android, where large button ID numbers have been involved (20 and up). For more details see http://bugzilla.libsdl.org/show_bug.cgi?id=1700.
- A few adaptations have been done for the Android platform, assuming joystick support is ever applied to it. One of them is that the very first joystick (in the enumeration of all joysticks) is opened for testing, if there is any.
- It is now possible to quit from the calibration by pressing on a mouse button, tapping on a touchscreen or pressing/tapping on the "Back" button of an Android device. Technically, a press on a key identified by key code SDLK_AC_BACK results in that.
2013-03-19 22:25:02 -07:00
Sam Lantinga
94d02e4b14 Fixed bug 1760 - Update README.android about local.properties
ny00

At the moment, the README.android file mentions this as one step in building an app:

"
5. Edit <project>/local.properties to point to the Android SDK directory
"

However, the local.properties file has recently been removed from the repository, so an update is desired. For instance:

"
5. Create <project>/local.properties and use that to point to the Android SDK directory, by writing a line with the following form:
sdk.dir=/Users/slouken/android-sdk-macosx
2013-03-19 22:15:07 -07:00
Sam Lantinga
20218f7e77 Fixed bug 1764 - Integer Precision Loss During Compilation
Phil Sampson

/Library/Frameworks/SDL2.framework/Headers/SDL_stdinc.h:345:28: Implicit conversion loses integer precision: 'size_t' (aka 'unsigned long') to 'unsigned int'
2013-03-19 22:02:34 -07:00
Sam Lantinga
4b50e8b609 Fixed bug 1763 - Constify SDL_UpdateWindowSurfaceRects()
Ryan C. Gordon

With this function...
   SDL_UpdateWindowSurfaceRects(SDL_Window * window, SDL_Rect * rects, int numrects);
...is there any reason rects isn't "const SDL_Rect *" ?
2013-03-19 21:53:33 -07:00
Sam Lantinga
30d3910d8b Removed unused window size constants 2013-03-17 09:47:25 -07:00
Sam Lantinga
96627b3e6b The platform define for the PSP is __PSP__ 2013-03-17 09:45:40 -07:00
Sam Lantinga
f0af9a3e70 Removed Nintendo DS support since nobody has volunteered to maintain it for over a year. 2013-03-17 09:44:58 -07:00
Sam Lantinga
a3010e26c9 We have a new platform, yay! 2013-03-17 09:21:08 -07:00
Captain Lex
a18bccd5f3 Add PSP support 2013-03-17 20:07:02 +08:00
Sam Lantinga
562dfede27 Fixed more const issues with C++ 2013-03-16 11:00:04 -07:00
Sam Lantinga
a0e7b130e5 Fixed XIM crash when locale is set to something not supported by X11. 2013-03-15 11:59:16 -07:00
Sam Lantinga
561c6ca3d6 Fixed const correctness issue with C++, and fixed building SDL_memcpy4 with 32-bit gcc. 2013-03-15 11:56:28 -07:00
Sam Lantinga
ad801e12f4 Clarified inline function documentation, removed obsolete Metrowerks compiler directive. 2013-03-14 23:10:51 -07:00
Ryan C. Gordon
28a15d3609 Replace all the "static __inline__" functions with SDL_FORCE_INLINE. 2013-03-15 01:09:19 -04:00
Ryan C. Gordon
1fa34e72be Improvements to stdlib.
All SDL_* functions are always available as real symbols, so you can always
link against them as a stable ABI. By default, however, all the things that
might have dithered down to macros in your application are now force-inlined,
to give you the same effect as before and theoretically better performance,
but still solve the classic macro problems.

Elsewhere, we provide real functions for these things that simply wrap the
inline functions, in case one needs to have a real function available.

Also: this exposed bugs: SDL_abs() does something different if you had the
macro vs the libc function, SDL_memcpy() returns a void* in the function
but not the macro, etc.
2013-03-15 01:01:20 -04:00
Ryan C. Gordon
fae7c9cf7d Added an SDL_FORCE_INLINE macro. 2013-03-15 01:02:30 -04:00
Sam Lantinga
1ae77e62ff XDnD implementation from Davey Taylor, need some cleanup 2013-03-13 21:41:43 -07:00
Andreas Schiffler
1c0ee42f39 Reformat SDL_VS2010.sln so WindowsExplorer VS type detection works again 2013-03-13 09:14:45 -07:00
Andreas Schiffler
157d9c6b00 Fix bug 122 - SDL_RWops bug fixes: set RWops.type field, add input validation, add test coverage 2013-03-13 08:35:03 -07:00
Jørgen P. Tjernø
961a96e526 Missing comma in one gamepad mapping. 2013-03-12 18:28:40 -07:00
Jørgen P. Tjernø
06837bd3e2 Add GameController mappings for popular controllers.
This adds mappings for:
  - Another type of wired X360 controller
  - A wireless X360 controller
  - Logitech F710 (XInput and DInput modes)
  - Logitech F310 (XInput mode)
  - Logitech Cordless RumblePad 2
2013-03-12 18:28:36 -07:00
Andreas Schiffler
c6e3903e5b Fix bug 1560 - SDL_RWFromConstMem write operation returns -1 but should return 0. 2013-03-12 09:10:37 -07:00
Sam Lantinga
ec5037edc4 Fixed bug 1751 - Direcftb renderer viewport behaviour differs from API description.
tomaszewski.p

According to API description:
SDL_RenderSetViewport - Use this function to set the drawing area for rendering on the current target.

DirectFB renderer in DirectFB_UpdateViewport function just sets clip on surface, instead of moving drawing area.

Attached patch uses set clip rectangle to move {x,y} coordinates during draw and blit operations to be compatible with API description.
2013-03-10 21:10:10 -07:00
Andreas Schiffler
e7e059a046 Fix bug 1574 - updaterev.sh fails when path contains spaces 2013-03-10 16:28:20 -07:00
Ryan C. Gordon
9e68949422 Patched to compile on Visual Studio. 2013-03-10 13:36:20 -04:00
Ryan C. Gordon
f60a2ba87b Fixed compiler warning. 2013-03-10 13:31:55 -04:00
Ryan C. Gordon
53bbcc2816 Attempt to get XInput haptics building on Cygwin (or rather, avoid building). 2013-03-10 13:28:39 -04:00
Ryan C. Gordon
e097576967 First shot at Windows XInput haptics. 2013-03-10 13:05:47 -04:00
Sam Lantinga
ea2a3073da Fixed bug 1750 - Directfb renderer does not support SDL_RENDERER_TARGETTEXTURE
tomaszewski.p

DirectFB renderer does not support SDL_RENDERER_TARGETTEXTURE what makes it incompatible with GL or GLES(2) renderers.

Attached patched:
- adds support for SDL_RENDERER_TARGETTEXTURE,
- DirectFB RenderCopy converts destination rectangle from floats to ints,
- fixes whitespaces to be the same in whole file.
2013-03-10 09:09:31 -07:00
Sam Lantinga
d4dbbfe4e2 Fixed bug 1749 - SDL_GL_CreateContext() causes fatal X11 protocol errors that should just be caught instead
Lee Salzman

When using SDL_GL_CreateContext() to create a >= 3.0 version or core/forward-compatible context, internally glXCreateContextAttribsARB is used. Mesa in particular seems to be having trouble with this call and returning all sorts of errors, so it is dangerous to poll for the highest GL version by using calls to SDL_GL_CreateContext unless you are sure, a priori, that the call will suceed, defeating the point of its use.

X11 protocol errors are of the following form, with varying details depending on user, but the cause is always SDL_GL_CreateContext as above...

X Error of failed request:  GLXBadFBConfig
  Major opcode of failed request:  153 (GLX)
  Minor opcode of failed request:  34 ()
  Serial number of failed request:  215
  Current serial number in output stream:  221

These sorts of errors can be temporarily filtered out by setting an X11 error handler to catch and ignore them, which is safe with respect to SDL_GL_CreateContext behavior because this function is allowed to return NULL to indicate failure.

A patch is attached to do this temporary filtering/catching of errors generated by trying to use glXCreateContextAttribs and friends...
2013-03-10 09:07:23 -07:00