Commit graph

2208 commits

Author SHA1 Message Date
Sam Lantinga
34602312d2 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--
branch : SDL-1.2
extra : convert_revision : svn%3Ac70aab31-4412-0410-b14c-859654838e24/branches/SDL-1.2%403906
2009-09-26 10:05:07 +00:00
Sam Lantinga
269b8143af Fixed crash with right side up BMP files
--HG--
branch : SDL-1.2
extra : convert_revision : svn%3Ac70aab31-4412-0410-b14c-859654838e24/branches/SDL-1.2%403900
2009-09-26 06:01:27 +00:00
Sam Lantinga
5cbd26fcce Fixed bug #719
Mike Blaguszewski      2009-03-23 13:32:22 PDT

Patch to 1.2 HEAD that fixes the issue

Fixes bug in SDL 1.2.13 where clicking on an app's title bar to activate the
app, when cursor capturing is enabled, will cause the window to jump. This is
because SDL's handler for activate events calls a low-level Quartz function to
move the cursor. Calling this when the mouse is down in the title bar confuses
the WindowServer into thinking the title bar has been dragged. The patch defers
processing of activate events in this case.

The bottom line is that CGWarpMouseCursorPosition() is not safe to call when
the mouse in down in a window's title bar.

--HG--
branch : SDL-1.2
extra : convert_revision : svn%3Ac70aab31-4412-0410-b14c-859654838e24/branches/SDL-1.2%403890
2009-09-23 07:18:02 +00:00
Sam Lantinga
9dc2dc2f87 Fixed bug #732
If no -L is present in the library spec, try /usr/lib

--HG--
branch : SDL-1.2
extra : convert_revision : svn%3Ac70aab31-4412-0410-b14c-859654838e24/branches/SDL-1.2%403888
2009-09-23 07:07:44 +00:00
Sam Lantinga
909c0ec5a1 Fixed bug #803
Andrey      2009-09-21 19:14:43 PDT

gapi->hiresFix depends on the parameters GetSystemMetrics (SM_CXSCREEN) and
GetSystemMetrics (SM_CXSCREEN).
After the "Open GAPI display" they are changing.
Small patch fixed it.

--HG--
branch : SDL-1.2
extra : convert_revision : svn%3Ac70aab31-4412-0410-b14c-859654838e24/branches/SDL-1.2%403887
2009-09-23 07:01:50 +00:00
Sam Lantinga
b35b7e8cf4 Potentially fixed bug #774
There's a mismatch between ndev and MAX_INPUTS

--HG--
branch : SDL-1.2
extra : convert_revision : svn%3Ac70aab31-4412-0410-b14c-859654838e24/branches/SDL-1.2%403886
2009-09-23 06:57:12 +00:00
Sam Lantinga
b0c831ddc0 Fixed endianness issues with fullscreen mode
--HG--
branch : SDL-1.2
extra : convert_revision : svn%3Ac70aab31-4412-0410-b14c-859654838e24/branches/SDL-1.2%403885
2009-09-23 06:56:28 +00:00
Sam Lantinga
a0d5e9ed41 Possibly fixed bug #601, definitely fixed a potential issue with threads
stopping and starting in rapid succession.

--HG--
branch : SDL-1.2
extra : convert_revision : svn%3Ac70aab31-4412-0410-b14c-859654838e24/branches/SDL-1.2%403883
2009-09-23 06:35:28 +00:00
Sam Lantinga
f3ce6c992f Added some extra headers
--HG--
branch : SDL-1.2
extra : convert_revision : svn%3Ac70aab31-4412-0410-b14c-859654838e24/branches/SDL-1.2%403882
2009-09-23 05:16:54 +00:00
Sam Lantinga
468c6a921c Added cast macros so SDL_net will compile with SDL 1.2
--HG--
branch : SDL-1.2
extra : convert_revision : svn%3Ac70aab31-4412-0410-b14c-859654838e24/branches/SDL-1.2%403880
2009-09-22 04:35:46 +00:00
Sam Lantinga
ff18e5fe93 Fixed compile error on Win32
--HG--
branch : SDL-1.2
extra : convert_revision : svn%3Ac70aab31-4412-0410-b14c-859654838e24/branches/SDL-1.2%403878
2009-09-22 02:42:11 +00:00
Sam Lantinga
5d28997a82 Added missing newline
--HG--
branch : SDL-1.2
extra : convert_revision : svn%3Ac70aab31-4412-0410-b14c-859654838e24/branches/SDL-1.2%403877
2009-09-22 02:37:30 +00:00
Sam Lantinga
236e7ef7e7 Max correctly pointed out that this will cause unexpected change in application
behavior and conflict with binding ctrl-click in some existing applications.

--HG--
branch : SDL-1.2
extra : convert_revision : svn%3Ac70aab31-4412-0410-b14c-859654838e24/branches/SDL-1.2%403876
2009-09-22 02:25:59 +00:00
Sam Lantinga
6e84a21e3f Whoops, this breaks building on Mac OS X 10.4
--HG--
branch : SDL-1.2
extra : convert_revision : svn%3Ac70aab31-4412-0410-b14c-859654838e24/branches/SDL-1.2%403875
2009-09-22 02:22:14 +00:00
Sam Lantinga
45c45e3e94 Added header guards for SDLMain.h
--HG--
branch : SDL-1.2
extra : convert_revision : svn%3Ac70aab31-4412-0410-b14c-859654838e24/branches/SDL-1.2%403871
2009-09-21 12:04:11 +00:00
Sam Lantinga
112e0b2ce0 Fix for expression error by Torsten Giebl - Thanks! :)
--HG--
branch : SDL-1.2
extra : convert_revision : svn%3Ac70aab31-4412-0410-b14c-859654838e24/branches/SDL-1.2%403870
2009-09-21 11:48:03 +00:00
Sam Lantinga
5556bfb188 Fixed bug #638
Philipp Nordhus      2008-11-05 13:56:33 PST

The Linux version of SDL_SYS_JoystickQuit() tries to free an invalid pointer
when the number of joysticks was reduced since the last call.

Reproduce: Connect two joysticks, call SDL_Init() and SDL_Quit(), then
disconnect one joystick and call the functions again.

--HG--
branch : SDL-1.2
extra : convert_revision : svn%3Ac70aab31-4412-0410-b14c-859654838e24/branches/SDL-1.2%403869
2009-09-21 11:34:50 +00:00
Sam Lantinga
214b2485e0 Fixed bug #637
Switched right click emulation to be Ctrl-click, which matches Mac OS X

--HG--
branch : SDL-1.2
extra : convert_revision : svn%3Ac70aab31-4412-0410-b14c-859654838e24/branches/SDL-1.2%403868
2009-09-21 11:32:58 +00:00
Sam Lantinga
73915a0350 Whoops, need both the header and the library!
--HG--
branch : SDL-1.2
extra : convert_revision : svn%3Ac70aab31-4412-0410-b14c-859654838e24/branches/SDL-1.2%403866
2009-09-21 11:30:54 +00:00
Sam Lantinga
38e90ccb74 Fixed bug #727
Lorenzo Desole      2009-04-19 07:36:10 PDT

I am one of the developers of a multimedia application (My Media System MMS),
which uses SDL.

MMS is normally running in fullscreen mode but it switches it off before
launching external applications (mplayer, xine, etc.).

The problem with fullscreen is that when the latter is switched off either via
SDL_WM_ToggleFullScreen() or SDL_SetVideoMode(), SDL compares the current
screen sizes with the ones saved when the video system was initted, and if they
don't match, it calls XF86VidModeSwitchToMode() to switch to the old modeline.

This makes it impossible for external programs and for MMS itself to use RandR
to change the screen size, because next time fullscreen mode is turned off, it
bombs out with the following error:

X Error of failed request:  BadValue (integer parameter out of range for
operation)
Major opcode of failed request:  136 (XFree86-VidModeExtension)
Minor opcode of failed request:  10 (XF86VidModeSwitchToMode)
[...]

Obviously this happens only if the new screen resolution is smaller than the
original one and XF86VidModeSwitchToMode() can't succeed.

I couldn't find any way to inform SDL that the screen resolution it uses as
reference is no longer valid.

This can be fixed by adding "save_mode(this)" to
./src/video/x11/SDL_x11modes.c, API X11_EnterFullScreen(_THIS), like this:

int X11_EnterFullScreen(_THIS)
{
    int okay;
+    save_mode(this);

I can't rule out possible side effects, but I don't see any.

While I admit this is a minor issue for the general users, it is a major
showstopper for our program where the ability to change screen resolution and
refresh rate according to the movie being played, is very important.

Thanks in advance.

--HG--
branch : SDL-1.2
extra : convert_revision : svn%3Ac70aab31-4412-0410-b14c-859654838e24/branches/SDL-1.2%403865
2009-09-21 11:14:36 +00:00
Sam Lantinga
014b779cb6 Fixed bug #714
fuzzyTew@gmail.com      2009-03-14 15:18:45 PDT

Created an attachment (id=305) [details]
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--
branch : SDL-1.2
extra : convert_revision : svn%3Ac70aab31-4412-0410-b14c-859654838e24/branches/SDL-1.2%403864
2009-09-21 11:04:32 +00:00
Sam Lantinga
f85df3b69e 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--
branch : SDL-1.2
extra : convert_revision : svn%3Ac70aab31-4412-0410-b14c-859654838e24/branches/SDL-1.2%403861
2009-09-21 10:23:07 +00:00
Sam Lantinga
954609b91e Fixed bug #795
Andrey      2009-09-14 21:16:53 PDT

WinCE GetCursorPos fixed

I'm using iPAQ HP rx5919, with Windows Mobile 5.
And I also use mingw32ce 0.59.1 toolchain.
I fixed this, see attachment patch.

--HG--
branch : SDL-1.2
extra : convert_revision : svn%3Ac70aab31-4412-0410-b14c-859654838e24/branches/SDL-1.2%403860
2009-09-21 09:58:43 +00:00
Sam Lantinga
73eadb4777 Fixed bug #695
Nomad      2009-02-08 10:34:43 PST

The 2nd init is good.
The problem is in "SDL_dibevents.c"
in DIB_CreateWindow()

in SVN:
{
    char *windowid = SDL_getenv("SDL_WINDOWID");

    SDL_RegisterApp(NULL, 0, 0);

    ... using of data to which windowid is points

problem:
    SDL_RegisterApp() may call SDL_getenv() and windowid will point to some
wrong string

solve:
    char *windowid;

    SDL_RegisterApp(NULL, 0, 0);

    windowid = SDL_getenv("SDL_WINDOWID");

--HG--
branch : SDL-1.2
extra : convert_revision : svn%3Ac70aab31-4412-0410-b14c-859654838e24/branches/SDL-1.2%403859
2009-09-21 09:54:33 +00:00
Sam Lantinga
88928312fa Fixed bug #778
Derek Weitzel      2009-08-11 12:17:09 PDT

Window Manager: xorg-x11-twm-1.0.1-3.1

Running through Xdmx.  The same application could expand to the full screen
using GLUT (freeglut).

Overview:
While running on a very high resolution display, discovered the maximium width
of the window is 4096.

--HG--
branch : SDL-1.2
extra : convert_revision : svn%3Ac70aab31-4412-0410-b14c-859654838e24/branches/SDL-1.2%403858
2009-09-21 09:47:53 +00:00
Sam Lantinga
1106b669a6 Fixed bug #706
Ken Bull      2009-02-25 13:22:02 PST

Adds Doxygen support for all headers (except config and boilerplate headers) in
the include folder for SDL-1.2 revision 4446.

While in general SDL is quite thoroughly commented, none of these comments are
correctly formatted for Doxygen and are generally inconsistent in their
formatting.

--HG--
branch : SDL-1.2
extra : convert_revision : svn%3Ac70aab31-4412-0410-b14c-859654838e24/branches/SDL-1.2%403857
2009-09-21 09:38:10 +00:00
Sam Lantinga
2e1e7fc4fc Fixed bug #698
Hans de Goede      2009-02-13 01:10:52 PST

Since the new "glitch free" version of pulseaudio (used in Fedora 10 amongst
others), the sound of SDL using apps (like a simple playmus call) has been
crackling.

While looking in to fixing this I noticed that the current pulseaudio code in
SDL uses pa_simple. However pa_simple uses a thread to pump pulseaudio events
and ipc, given that SDL already has its own thread for audio handling this is
clearly suboptimal, leading to unnecessary context switching IPC, etc. Also
pa_simple does not allow one to implement the WaitAudio() callback for SDL
audiodrivers properly.

Given that my work is mostly a rewrite (although some original pieces remain)
I'm attaching the new .c and .h file, as that is easier to review then the huge
diff.

Let me know if you also want the diff.

This new version has the following features:
-no longer use an additional thread next to the SDL sound thread
-do not crackle with glitch free audio
-when used with a newer pulse, which does glitch free audio, the total latency
is
 the same as with the alsa driver
-proper WaitAudio() implementation, saving another mixlen worth of latency
-adds a WaitDone() implementation

This patch has been written in consultancy with Lennart Poetering (the
pulseaudio author) and has been reviewed by him for correct use of the pa API.

--HG--
branch : SDL-1.2
extra : convert_revision : svn%3Ac70aab31-4412-0410-b14c-859654838e24/branches/SDL-1.2%403856
2009-09-21 09:27:08 +00:00
Sam Lantinga
e867c836fa 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--
branch : SDL-1.2
extra : convert_revision : svn%3Ac70aab31-4412-0410-b14c-859654838e24/branches/SDL-1.2%403854
2009-09-21 09:18:42 +00:00
Sam Lantinga
2f54acf3be Oh yeah, we have GLX support too.
--HG--
branch : SDL-1.2
extra : convert_revision : svn%3Ac70aab31-4412-0410-b14c-859654838e24/branches/SDL-1.2%403851
2009-09-21 08:58:51 +00:00
Sam Lantinga
88ce20e695 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--
branch : SDL-1.2
extra : convert_revision : svn%3Ac70aab31-4412-0410-b14c-859654838e24/branches/SDL-1.2%403849
2009-09-21 08:39:52 +00:00
Sam Lantinga
594827156d 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--
branch : SDL-1.2
extra : convert_revision : svn%3Ac70aab31-4412-0410-b14c-859654838e24/branches/SDL-1.2%403848
2009-09-21 08:31:15 +00:00
Sam Lantinga
69789889a7 Fixed bug #572
Please merge this patch for the PA driver in SDL.

http://0pointer.de/public/sdl-pulse-rework.patch

This patch:
- fixes buffering (i.e. reduces number of "fragments" to 2, doesn't defer
filling up of the buffer until the entire buffer ran completely empty.)
- drops $PASERVER and $PADEVICE env var support, since this is a duplication of
$PULSE_SERVER and $PULSE_SINK which the PA libs honor anyway.

This fixes the sound issues in all games I tested.

--HG--
branch : SDL-1.2
extra : convert_revision : svn%3Ac70aab31-4412-0410-b14c-859654838e24/branches/SDL-1.2%403846
2009-09-21 08:03:00 +00:00
Sam Lantinga
6bae66b557 Fixed bug #571.. I think. :)
It certainly can't hurt!

--HG--
branch : SDL-1.2
extra : convert_revision : svn%3Ac70aab31-4412-0410-b14c-859654838e24/branches/SDL-1.2%403845
2009-09-21 07:59:44 +00:00
Sam Lantinga
6a11032c87 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--
branch : SDL-1.2
extra : convert_revision : svn%3Ac70aab31-4412-0410-b14c-859654838e24/branches/SDL-1.2%403843
2009-09-21 07:32:26 +00:00
Sam Lantinga
a9c2258117 Updated the version to 1.2.14 for the next release.
--HG--
branch : SDL-1.2
extra : convert_revision : svn%3Ac70aab31-4412-0410-b14c-859654838e24/branches/SDL-1.2%403842
2009-09-21 07:28:03 +00:00
Sam Lantinga
b0f6c3e99b Fixed bug #562
this patch by Diego Pettenò <flameeyes@gentoo.org> for SDL-1.2:

The attached patch applies over latest ~arch SDL version, and allows to use the
xinerama support to launch an application full screened on the head "0".

The SDL_VIDEO_FULLSCREEN_HEAD environment variable sets the head on which the
full screen will be displayed, but if you set it to 0, the code simply ignores
it as unset. My patch changes the unset value to -1, so that the 0 value can be
used correctly. Without this, trying to get fullscreen on head 0 would get the
same result than not having xinerama enabled at all.

http://sources.gentoo.org/media-libs/libsdl/files/libsdl-1.2.11-xinerama-head-0.patch

SDL-1.3 doesnt seem to have any code like this, but it's still good for SDL-1.2

--HG--
branch : SDL-1.2
extra : convert_revision : svn%3Ac70aab31-4412-0410-b14c-859654838e24/branches/SDL-1.2%403841
2009-09-21 07:20:51 +00:00
Sam Lantinga
7b806a14f0 The sound manager code is outdated and should only be used on Mac OS 9 now.
--HG--
branch : SDL-1.2
extra : convert_revision : svn%3Ac70aab31-4412-0410-b14c-859654838e24/branches/SDL-1.2%403840
2009-09-21 07:03:29 +00:00
Ryan C. Gordon
79e2c42e21 Use correct value when calculating audio conversion length.
Fixes Bugzilla #477.

--HG--
branch : SDL-1.2
extra : convert_revision : svn%3Ac70aab31-4412-0410-b14c-859654838e24/branches/SDL-1.2%403839
2009-09-21 06:18:52 +00:00
Ryan C. Gordon
b5dc26cf71 1.2 Quartz video: Ripped out QuickDraw and QuickTime.
Now we use the software path for YUV, and CoreGraphics for 2D stuff.

There are several other 10.6 fixes in here, too...now we can build a 64-bit
SDL for Snow Leopard!

--HG--
branch : SDL-1.2
extra : convert_revision : svn%3Ac70aab31-4412-0410-b14c-859654838e24/branches/SDL-1.2%403838
2009-09-21 06:08:23 +00:00
Ryan C. Gordon
ddb6f9bd6d Patched to compile on Mac OS X <= 10.4 SDKs.
--HG--
branch : SDL-1.2
extra : convert_revision : svn%3Ac70aab31-4412-0410-b14c-859654838e24/branches/SDL-1.2%403836
2009-09-21 04:34:22 +00:00
Patrice Mandin
4ba3f48db5 Make the list NULL terminated.
--HG--
branch : SDL-1.2
extra : convert_revision : svn%3Ac70aab31-4412-0410-b14c-859654838e24/branches/SDL-1.2%403833
2009-09-20 18:14:35 +00:00
Patrice Mandin
4c2eb9da70 Forgot to allocate memory for native video mode data.
--HG--
branch : SDL-1.2
extra : convert_revision : svn%3Ac70aab31-4412-0410-b14c-859654838e24/branches/SDL-1.2%403832
2009-09-20 18:05:52 +00:00
Patrice Mandin
90c7bf5459 Oops, need to compile first, before commit.
--HG--
branch : SDL-1.2
extra : convert_revision : svn%3Ac70aab31-4412-0410-b14c-859654838e24/branches/SDL-1.2%403831
2009-09-20 12:48:51 +00:00
Patrice Mandin
8e0b16286d Set video mode, allocate buffers, and enable new Milan video xbios support, need a tester now :).
--HG--
branch : SDL-1.2
extra : convert_revision : svn%3Ac70aab31-4412-0410-b14c-859654838e24/branches/SDL-1.2%403830
2009-09-20 12:46:46 +00:00
Patrice Mandin
8eeb1d6d6e Define flags for double line and c2p operations. More Milan video work.
--HG--
branch : SDL-1.2
extra : convert_revision : svn%3Ac70aab31-4412-0410-b14c-859654838e24/branches/SDL-1.2%403829
2009-09-20 12:08:51 +00:00
Patrice Mandin
266ad8cf88 Use loop to allocate needed buffers, instead of code duplication. Add missing header.
--HG--
branch : SDL-1.2
extra : convert_revision : svn%3Ac70aab31-4412-0410-b14c-859654838e24/branches/SDL-1.2%403826
2009-09-19 21:58:59 +00:00
Patrice Mandin
1fda3574b9 Enumerates custom modes
--HG--
branch : SDL-1.2
extra : convert_revision : svn%3Ac70aab31-4412-0410-b14c-859654838e24/branches/SDL-1.2%403824
2009-09-19 13:31:41 +00:00
Patrice Mandin
76e370437b Start Milan video support
--HG--
branch : SDL-1.2
extra : convert_revision : svn%3Ac70aab31-4412-0410-b14c-859654838e24/branches/SDL-1.2%403822
2009-09-19 13:21:05 +00:00
Patrice Mandin
ccc4e6507a Preliminary work to support the Milan video bios, that will gives access to 24 or 32 bpp modes. I used the svga driver as model to dynamically build video modes list.
--HG--
branch : SDL-1.2
extra : convert_revision : svn%3Ac70aab31-4412-0410-b14c-859654838e24/branches/SDL-1.2%403820
2009-09-19 12:46:00 +00:00
Ryan C. Gordon
1aeda60ecc GCC 3.03 support on OS/2.
Fixes Bugzilla #588.

--HG--
branch : SDL-1.2
extra : convert_revision : svn%3Ac70aab31-4412-0410-b14c-859654838e24/branches/SDL-1.2%403801
2009-09-14 00:08:12 +00:00