Commit graph

3001 commits

Author SHA1 Message Date
Sam Lantinga
de0dbff224 Adam Strzelecki to SDL
Since current DirectFB implementation is incomplete for YUV surfaces (actually causes segmentation faults when trying Lock and use YUV planar textures) I decided to fix it a bit.
Here's a patch that should make DirectFB properly support YUV both packed and planar (3 planes).

(1) Removed SDL_BYTESPERPIXEL at all in favor of DFB_BYTES_PER_PIXEL(SDLToDFBPixelFormat(fmt)) which does return always proper BPP for YUVs too, coz SDL_BYTESPERPIXEL returns incorrect values for FOURCCs
(2) Fixed data->pixels allocation for planar YUVs in CreateTexture, it should allocate 150% more space
(3) Copy other planes for planar YUVs in UpdateTexture
(4) Moved checking if format is supported at all with DirectFB on CreateTexture at the beginning of the code

Waiting for comments,
--
Adam Strzelecki | nanoant.com

--HG--
extra : convert_revision : svn%3Ac70aab31-4412-0410-b14c-859654838e24/trunk%403959
2009-10-04 04:03:37 +00:00
Sam Lantinga
361d31ae06 Use gcc's built-in dependency generation, thanks to Adam Strzelecki
--HG--
extra : convert_revision : svn%3Ac70aab31-4412-0410-b14c-859654838e24/trunk%403958
2009-10-04 03:38:01 +00:00
Sam Lantinga
7f26231261 [SDL] Bad math in SDL_RenderCopy
Mason Wheeler to sdl

When I tried to render an image using something other than NULL for srcrect, it got horribly distorted.  I traced it down to the fact that the math in the rectangle adjustments performed just before the call to renderer->RenderCopy is written inside out.  It should look like this:

       if (dstrect->w != real_dstrect.w) {
           int deltax = (dstrect->x - real_dstrect.x);
           int deltaw = (dstrect->w - real_dstrect.w);
           real_srcrect.x += (deltax * real_srcrect.w) / dstrect->w;
           real_srcrect.w += (deltaw * real_srcrect.w) / dstrect->w;
       }
       if (dstrect->h != real_dstrect.h) {
           int deltay = (dstrect->y - real_dstrect.y);
           int deltah = (dstrect->h - real_dstrect.h);
           real_srcrect.y += (deltay * real_srcrect.h) / dstrect->h;
           real_srcrect.h += (deltah * real_srcrect.h) / dstrect->h;

--HG--
extra : convert_revision : svn%3Ac70aab31-4412-0410-b14c-859654838e24/trunk%403957
2009-10-03 16:23:16 +00:00
Sam Lantinga
b330607c4b You should check for the C compiler before you set CFLAGS. :)
--HG--
extra : convert_revision : svn%3Ac70aab31-4412-0410-b14c-859654838e24/trunk%403955
2009-10-02 13:50:36 +00:00
Sam Lantinga
7210963bc0 Eric Wing to Sam
Lots of fixes.
Fixed missing power management building.
Added template icons to the project templates.
DocSet stuff
Documentation fixes..

Fixed all the SDLtests. (Lots of tedious work.) It now depends on the static library target for convenience so I am not going to remove it from the SDL xcode project.

--HG--
extra : convert_revision : svn%3Ac70aab31-4412-0410-b14c-859654838e24/trunk%403952
2009-10-01 15:30:26 +00:00
Sam Lantinga
64da4d2ac8 Getting ready for a new drop from Eric, hopefully the last time I have to wipe this.
--HG--
extra : convert_revision : svn%3Ac70aab31-4412-0410-b14c-859654838e24/trunk%403951
2009-10-01 15:26:39 +00:00
Sam Lantinga
9cf9fe1010 Added missing templates
--HG--
extra : convert_revision : svn%3Ac70aab31-4412-0410-b14c-859654838e24/trunk%403942
2009-09-29 07:59:23 +00:00
Sam Lantinga
68b5d835c3 Reminder to investigate upgrading libtool to fix bug #499
--HG--
extra : convert_revision : svn%3Ac70aab31-4412-0410-b14c-859654838e24/trunk%403941
2009-09-29 06:33:33 +00:00
Sam Lantinga
ff4d85fc9e Better cross-platform macros for printing 32 and 64 bit values
--HG--
extra : convert_revision : svn%3Ac70aab31-4412-0410-b14c-859654838e24/trunk%403938
2009-09-29 01:19:14 +00:00
Sam Lantinga
efc7893227 Temporary band-aid for bug #575
It looks like newer kernels do the logical device mapping in the driver,
so this code crashes.  I don't have one of these nor do I have remote
access to debug this, so I'm disabling the logical mapping for now.

--HG--
extra : convert_revision : svn%3Ac70aab31-4412-0410-b14c-859654838e24/trunk%403937
2009-09-29 00:42:21 +00:00
Bob Pendleton
6e7a184bcf Ok, added long casts to get rid of compiler warnings.
--HG--
extra : convert_revision : svn%3Ac70aab31-4412-0410-b14c-859654838e24/trunk%403935
2009-09-28 18:44:26 +00:00
Sam Lantinga
eb162e1725 -0.5 is causing trouble according to comments in bug #783
--HG--
extra : convert_revision : svn%3Ac70aab31-4412-0410-b14c-859654838e24/trunk%403932
2009-09-28 15:32:58 +00:00
Sam Lantinga
06e83a3640 Added renderer information for dynamic OpenGL test
--HG--
extra : convert_revision : svn%3Ac70aab31-4412-0410-b14c-859654838e24/trunk%403931
2009-09-28 15:32:19 +00:00
Sam Lantinga
8349cf0831 Fixed bug #716
Armin Burgmeier      2009-03-15 04:35:45 PDT

When I hold a mouse button down on another (non-SDL) window, then move the
mouse over an SDL window and releasing the mouse button there, then the
application does not receive an SDL_ACTIVEEVENT with state SDL_APPMOUSEFOCUS
and gain 1.

Furthermore, SDL_GetAppState() reports the application not having mouse focus
until moving the mouse out of the window and back in again.

--HG--
extra : convert_revision : svn%3Ac70aab31-4412-0410-b14c-859654838e24/trunk%403927
2009-09-27 23:24:58 +00:00
Sam Lantinga
bb9b983417 Fixed 32-bit build
--HG--
extra : convert_revision : svn%3Ac70aab31-4412-0410-b14c-859654838e24/trunk%403916
2009-09-26 21:39:56 +00:00
Sam Lantinga
bda0828ef8 Fixed bug #797
Ryan C. Gordon      2009-09-19 08:25:21 PDT

This line in SDL_iconv_string (src/stdlib/SDL_iconv.c) ...

        if (!fromcode || !*fromcode) {
            tocode = "UTF-8";
        }

Is probably supposed to assign to "fromcode" and not "tocode".

--HG--
extra : convert_revision : svn%3Ac70aab31-4412-0410-b14c-859654838e24/trunk%403912
2009-09-26 10:36:55 +00:00
Sam Lantinga
a305eb8541 Fixed bug #777
Implemented SDL_GetPlatform()

--HG--
extra : convert_revision : svn%3Ac70aab31-4412-0410-b14c-859654838e24/trunk%403911
2009-09-26 10:32:14 +00:00
Sam Lantinga
1035ec66ff Fixed bug #766
Mason Wheeler      2009-07-06 14:29:47 PDT

This adds some missing error reporting for SDL_SelectRenderer, and cleans up the logic a little bit.

--HG--
extra : convert_revision : svn%3Ac70aab31-4412-0410-b14c-859654838e24/trunk%403910
2009-09-26 10:22:35 +00:00
Sam Lantinga
0990e2250c Fixed bug #765
Added SDL_SetError case for SDL_UNSUPPORTED

--HG--
extra : convert_revision : svn%3Ac70aab31-4412-0410-b14c-859654838e24/trunk%403909
2009-09-26 10:19:19 +00:00
Sam Lantinga
ac573d8522 Fixed bug #764
Added better error checking from Mason Wheeler

--HG--
extra : convert_revision : svn%3Ac70aab31-4412-0410-b14c-859654838e24/trunk%403908
2009-09-26 10:17:49 +00:00
Sam Lantinga
ba8fff9ab2 Fixed bug #761
Mason Wheeler      2009-07-05 09:28:33 PDT

This patch fixes two issues with SDL_CreateTextureFromSurface.

1.  If no renderer is available, the function will return 0 without calling
SDL_SetError. (It does this in other places as well, but it appears that in
these cases, SDL_SetError was already called by a previous function call.)
2.  Removal of a dead code block that checks for an impossible return value.

--HG--
extra : convert_revision : svn%3Ac70aab31-4412-0410-b14c-859654838e24/trunk%403907
2009-09-26 10:13:44 +00:00
Sam Lantinga
b42df3ec21 Fixed bug #734
Nicholas Phillips      2009-04-26 21:34:05 PDT

I am using x64 Linux (using Intel Core 2 DUO), and I have noticed that there is
an error in SDL_cpuinfo.c, function CPU_getCPUIDFeaturesExt for my platform.

--HG--
extra : convert_revision : svn%3Ac70aab31-4412-0410-b14c-859654838e24/trunk%403905
2009-09-26 10:04:38 +00:00
Sam Lantinga
55214000e1 Fixed bug #705
Sami N      2009-02-21 11:15:39 PST

Patches two tests that had broken format strings in their *printf()'s.

--HG--
extra : convert_revision : svn%3Ac70aab31-4412-0410-b14c-859654838e24/trunk%403904
2009-09-26 09:57:32 +00:00
Sam Lantinga
b827e9297f Fixed bug #705
Sami N      2009-02-21 11:15:39 PST

Patches two tests that had broken format strings in their *printf()'s.

--HG--
extra : convert_revision : svn%3Ac70aab31-4412-0410-b14c-859654838e24/trunk%403903
2009-09-26 09:56:26 +00:00
Sam Lantinga
3a86a4e6b6 Fixed bug #704
Dennis      2009-02-20 15:36:49 PST

When trying to run a parallel build, gcc will not be able to find SDL_revision.h

--HG--
extra : convert_revision : svn%3Ac70aab31-4412-0410-b14c-859654838e24/trunk%403902
2009-09-26 09:44:52 +00:00
Sam Lantinga
940b0ede17 Fixed crash with right side up BMP files
--HG--
extra : convert_revision : svn%3Ac70aab31-4412-0410-b14c-859654838e24/trunk%403901
2009-09-26 06:21:36 +00:00
Sam Lantinga
910fc5ed91 Eric Wing to Sam
I refactored how the shell script code-gen phases were setup in the Xcode project.
I also removed the SDLmain files from the project templates.

--HG--
extra : convert_revision : svn%3Ac70aab31-4412-0410-b14c-859654838e24/trunk%403899
2009-09-26 03:58:35 +00:00
Bob Pendleton
39fbfe62c6 fixed a spelling error in the documentation.
--HG--
extra : convert_revision : svn%3Ac70aab31-4412-0410-b14c-859654838e24/trunk%403898
2009-09-25 19:26:21 +00:00
Bob Pendleton
8f9b7ab9c7 Changed to include SDL_atomic.c in the windows version of SDL 1.3
--HG--
extra : convert_revision : svn%3Ac70aab31-4412-0410-b14c-859654838e24/trunk%403897
2009-09-25 19:20:25 +00:00
Bob Pendleton
6e96a9947b This version actaully should work on Windows.
--HG--
extra : convert_revision : svn%3Ac70aab31-4412-0410-b14c-859654838e24/trunk%403896
2009-09-25 19:17:16 +00:00
Sam Lantinga
9705e19c57 More TODO!
--HG--
extra : convert_revision : svn%3Ac70aab31-4412-0410-b14c-859654838e24/trunk%403895
2009-09-24 15:20:11 +00:00
Sam Lantinga
353fa3e13e Eric Wing to Sam
Removed the SDLMain lines from the packaging scripts.

--HG--
extra : convert_revision : svn%3Ac70aab31-4412-0410-b14c-859654838e24/trunk%403894
2009-09-24 14:43:03 +00:00
Sam Lantinga
e5ae941a74 Updated Xcode project from Eric Wing
--HG--
extra : convert_revision : svn%3Ac70aab31-4412-0410-b14c-859654838e24/trunk%403893
2009-09-24 07:13:02 +00:00
Sam Lantinga
4fc2b759c2 Getting ready for a new Xcode project from Eric Wing
--HG--
extra : convert_revision : svn%3Ac70aab31-4412-0410-b14c-859654838e24/trunk%403892
2009-09-24 07:12:05 +00:00
Sam Lantinga
8c7dddc113 Fixed bug #732
If no -L is present in the library spec, try /usr/lib

--HG--
extra : convert_revision : svn%3Ac70aab31-4412-0410-b14c-859654838e24/trunk%403889
2009-09-23 07:10:45 +00:00
Sam Lantinga
46669bc45a Possibly fixed bug #601, definitely fixed a potential issue with threads
stopping and starting in rapid succession.

--HG--
extra : convert_revision : svn%3Ac70aab31-4412-0410-b14c-859654838e24/trunk%403884
2009-09-23 06:37:27 +00:00
Bob Pendleton
eb32c5737d int testmmousetable.c the arguments to main() are not compatible with what is required in SDL_main.h
Cleaned up testatomic.c to use the same syntax as every other test program.

--HG--
extra : convert_revision : svn%3Ac70aab31-4412-0410-b14c-859654838e24/trunk%403881
2009-09-23 02:52:11 +00:00
Sam Lantinga
a78ed924f8 Whoops, this breaks building on Mac OS X 10.4
--HG--
extra : convert_revision : svn%3Ac70aab31-4412-0410-b14c-859654838e24/trunk%403874
2009-09-22 02:20:56 +00:00
Bob Pendleton
ad397223a2 oops
--HG--
extra : convert_revision : svn%3Ac70aab31-4412-0410-b14c-859654838e24/trunk%403873
2009-09-21 22:25:14 +00:00
Bob Pendleton
9b197b5dd0 Should now compile on 32 bit linux and 64 bit linux
--HG--
extra : convert_revision : svn%3Ac70aab31-4412-0410-b14c-859654838e24/trunk%403872
2009-09-21 22:23:41 +00:00
Sam Lantinga
36ff6e0aff Whoops, need both the header and the library!
--HG--
extra : convert_revision : svn%3Ac70aab31-4412-0410-b14c-859654838e24/trunk%403867
2009-09-21 11:31:28 +00:00
Sam Lantinga
642078cce6 Fixed bug #714
fuzzyTew@gmail.com      2009-03-14 15:18:45 PDT

patch to change HAVE_ICONV to HAVE_ICONV_H

There are two separate iconv checks in configure -- one for the header file and
one for the library.  include/SDL_stdinc.h uses the library define to see
whether or not it should reference the types defined in the header, which
naturally breaks if the library exists and the header does not.

--HG--
extra : convert_revision : svn%3Ac70aab31-4412-0410-b14c-859654838e24/trunk%403863
2009-09-21 11:04:01 +00:00
Sam Lantinga
59bb46e70d Fixed bug #674
Matej     2009-01-08 09:25:34 PST

Hello,
I maintain a cross-platform project that uses SDL.
One of the users who runs OSX has told me that he has problems with linking to
SDL due to missing -framework option.
I think that the problem is because of this:
'sdl-config --libs' outputs '-L/opt/local/lib -lSDLmain -lSDL
-Wl,-framework,Cocoa'
All the options are passed to the linker except the last one. I think that the
good output should be just:
'-L/opt/local/lib -lSDLmain -lSDL -framework Cocoa'
since those options (--libs) are passed to the linker, so the '-Wl' option is
redundant and possibly harmful in this very case
I use autotools with libtool to do the build...
Regards,
Matej

--HG--
extra : convert_revision : svn%3Ac70aab31-4412-0410-b14c-859654838e24/trunk%403862
2009-09-21 10:23:19 +00:00
Sam Lantinga
bfb982d926 Fixed bug #615
Scott McCreary      2008-08-21 10:48:14 PDT

This patch adds support for Haiku.
http://ports.haiku-files.org/browser/haikuports/trunk/media-libs/libsdl/SDL-1.2.13-haiku.diff
Haiku is an open-source recreation of BeOS.  It has better POSIX compliance
than beOS did, and other improved features, which in some cases causes us to
have to "undo" previous BeOS workarounds.
Here's our port log entry for it, showing the steps to force the changes into
configure and Makefile:
http://ports.haiku-files.org/wiki/media-libs/libsdl/1.2.13/1
Note that this was only tried on 1.2.13 stable so far.
Haiku is using a newer config.guess / config.sub that doesn't yet seem to be in
the released libtool, so we are having to copy it in for now.
http://haiku-files.org/files/optional-packages/

--HG--
extra : convert_revision : svn%3Ac70aab31-4412-0410-b14c-859654838e24/trunk%403855
2009-09-21 09:21:00 +00:00
Sam Lantinga
54ecbe7b60 Added reminder to look into 2D vblank synchronization
--HG--
extra : convert_revision : svn%3Ac70aab31-4412-0410-b14c-859654838e24/trunk%403853
2009-09-21 09:16:35 +00:00
Sam Lantinga
ba55ec5f01 Oh yeah, we have GLX support too.
--HG--
extra : convert_revision : svn%3Ac70aab31-4412-0410-b14c-859654838e24/trunk%403852
2009-09-21 09:02:05 +00:00
Sam Lantinga
d2a37d9894 Fixed bug #577
Pierre Phaneuf      2008-05-01 10:29:16 PDT

SDL_VIDEO_DRIVER_X11 is not defined in SDL_config_macosx.h

There's a number of SDL_VIDEO_DRIVER_xxx defined in SDL_config_macosx.h, but
not that one, even though it is actually present.

--HG--
extra : convert_revision : svn%3Ac70aab31-4412-0410-b14c-859654838e24/trunk%403850
2009-09-21 08:40:04 +00:00
Sam Lantinga
457c590993 Fixed bug #591
Wade Berrier      2008-05-28 11:09:42 PDT

configure.in will enable dynamic loading by default for modules, but some of
the checks only check /lib, /usr/lib, /usr/local/lib, etc...

It needs to also account for systems using /lib64, /usr/lib64, and
/usr/local/lib64.

For example, openSUSE x86_64 distro uses these style paths.  Otherwise, i586
gets dynamically loaded, but x86_64 doesn't.

--HG--
extra : convert_revision : svn%3Ac70aab31-4412-0410-b14c-859654838e24/trunk%403847
2009-09-21 08:31:02 +00:00
Sam Lantinga
be2cfc6afd Fixed bug #570
SDL_SemWaitTimeout in src/thread/generic/SDL_syssem.c line 179 (SVN trunk):

--sem->count;

should be

if (retval == 0) {
    --sem->count;
}

Without this, sem->count will underflow on timeout effectively breaking the
semaphore. It appears that the implementation has been wrong since the initial
revision.

--HG--
extra : convert_revision : svn%3Ac70aab31-4412-0410-b14c-859654838e24/trunk%403844
2009-09-21 07:35:06 +00:00
Sam Lantinga
d4c2904707 Fixed build on Mac OS X 10.4
--HG--
extra : convert_revision : svn%3Ac70aab31-4412-0410-b14c-859654838e24/trunk%403837
2009-09-21 05:24:54 +00:00