Commit graph

1558 commits

Author SHA1 Message Date
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
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
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
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
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
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
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
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
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
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
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
0df68f95cb Made NAS target dynamic, so you can safely include it in shipping binaries.
--HG--
branch : SDL-1.2
extra : convert_revision : svn%3Ac70aab31-4412-0410-b14c-859654838e24/branches/SDL-1.2%403800
2009-09-13 22:19:56 +00:00
Ryan C. Gordon
dfa102877a Put some extra parentheses around some logic, to clarify order of operations.
Fixes Bugzilla #740.

--HG--
branch : SDL-1.2
extra : convert_revision : svn%3Ac70aab31-4412-0410-b14c-859654838e24/branches/SDL-1.2%403799
2009-09-12 19:41:54 +00:00
Ryan C. Gordon
a787ace055 Fixed CD-ROM code to work with Mac OS X 10.6 SDK and 64-bit targets.
--HG--
branch : SDL-1.2
extra : convert_revision : svn%3Ac70aab31-4412-0410-b14c-859654838e24/branches/SDL-1.2%403798
2009-09-12 15:06:16 +00:00
Ryan C. Gordon
ea2239b3e6 Fixed CoreAudio to compile with Mac OS X 10.6 SDK and 64-bit targets.
--HG--
branch : SDL-1.2
extra : convert_revision : svn%3Ac70aab31-4412-0410-b14c-859654838e24/branches/SDL-1.2%403797
2009-09-12 15:04:32 +00:00
Ryan C. Gordon
39abd7a238 Updated some URLs in the comments.
--HG--
branch : SDL-1.2
extra : convert_revision : svn%3Ac70aab31-4412-0410-b14c-859654838e24/branches/SDL-1.2%403796
2009-09-12 14:05:39 +00:00
Ryan C. Gordon
ec866d8b96 Fixed compiler warning on 64-bit systems (but this is still broken, really).
--HG--
branch : SDL-1.2
extra : convert_revision : svn%3Ac70aab31-4412-0410-b14c-859654838e24/branches/SDL-1.2%403795
2009-09-12 13:16:33 +00:00
Ryan C. Gordon
4f6a3faff5 Fixed compiler warnings on Mac OS X 10.6 SDK.
--HG--
branch : SDL-1.2
extra : convert_revision : svn%3Ac70aab31-4412-0410-b14c-859654838e24/branches/SDL-1.2%403794
2009-09-12 13:15:27 +00:00
Ryan C. Gordon
0e083b2a15 Patched X11 code to compile on Mac OS X 10.6 SDK.
--HG--
branch : SDL-1.2
extra : convert_revision : svn%3Ac70aab31-4412-0410-b14c-859654838e24/branches/SDL-1.2%403791
2009-09-12 06:25:36 +00:00
Sam Lantinga
e0fc48cf28 Fixed type size for test_bit()
--HG--
branch : SDL-1.2
extra : convert_revision : svn%3Ac70aab31-4412-0410-b14c-859654838e24/branches/SDL-1.2%403732
2009-08-02 20:45:40 +00:00
Ryan C. Gordon
7d38d7ef76 Patch from Fedora project to fix crashes with SDL_HasSSE() on amd64.
Fixes Bugzilla #760. (...and bugzilla.redhat.com #487720).

--HG--
branch : SDL-1.2
extra : convert_revision : svn%3Ac70aab31-4412-0410-b14c-859654838e24/branches/SDL-1.2%403683
2009-07-01 19:06:31 +00:00
Sam Lantinga
a220b6ab6c Date: Fri, 24 Apr 2009 17:47:07 +0200
From: Stefan Klug
Subject: Re: [SDL] SVN doesn't compile for wince

the patch applied for Revision 4483 was seemingly not checked for side
effects.
It broke the WinCE build.
The attached patch should fix these problems. I'm not using SDL 1.2 on
CE anymore, and therefore haven't tested the patch... but at least it
compiles ;-)

Regards Stefan

--HG--
branch : SDL-1.2
extra : convert_revision : svn%3Ac70aab31-4412-0410-b14c-859654838e24/branches/SDL-1.2%403602
2009-05-07 12:40:16 +00:00
Sam Lantinga
aaf1b51fe0 Fixed dynamic loading on Windows CE
--HG--
branch : SDL-1.2
extra : convert_revision : svn%3Ac70aab31-4412-0410-b14c-859654838e24/branches/SDL-1.2%403599
2009-05-07 12:03:51 +00:00
Patrice Mandin
881a4d0755 Disable debug code
--HG--
branch : SDL-1.2
extra : convert_revision : svn%3Ac70aab31-4412-0410-b14c-859654838e24/branches/SDL-1.2%403587
2009-04-27 10:33:21 +00:00
Patrice Mandin
9943e1dd38 Enable Xbios audio for Magic
--HG--
branch : SDL-1.2
extra : convert_revision : svn%3Ac70aab31-4412-0410-b14c-859654838e24/branches/SDL-1.2%403585
2009-04-26 07:14:29 +00:00
Patrice Mandin
5a62fe69b5 Add Teamtap autodetection, to avoid generating ghost events if it is not present
--HG--
branch : SDL-1.2
extra : convert_revision : svn%3Ac70aab31-4412-0410-b14c-859654838e24/branches/SDL-1.2%403584
2009-04-24 19:04:02 +00:00
Sam Lantinga
df5650a8ad Fixed bug #421
Comment #3 From  esigra@gmail.com   2008-04-09 11:46:46   (-) [reply] -------

This bug also needs to be fixed for SDL_GetRGB and SDL_GetRGBA (those should
not change the format of the surface either). Until this is fixed, I still need
to const_cast the format parameter in calls to those functions.

--HG--
branch : SDL-1.2
extra : convert_revision : svn%3Ac70aab31-4412-0410-b14c-859654838e24/branches/SDL-1.2%403581
2009-04-13 09:03:35 +00:00
Sam Lantinga
3b082cfe3a Fixed bug #675
Description From  maf6@cornell.edu   2009-01-10 14:07:52   (-) [reply]

Assuming the SDL project doesn't just want to pick these up from dinput8.lib or
whatever instead, the definitions in SDL_dx5video.c should be:

const DIDATAFORMAT c_dfDIKeyboard = { sizeof(DIDATAFORMAT),
sizeof(DIOBJECTDATAFORMAT), 0x00000002, 256, 256, KBD_fmt };
const DIDATAFORMAT c_dfDIMouse = { sizeof(DIDATAFORMAT),
sizeof(DIOBJECTDATAFORMAT), 0x00000002, 16, 7, PTR_fmt };
const DIDATAFORMAT c_dfDIJoystick = { sizeof(DIDATAFORMAT),
sizeof(DIOBJECTDATAFORMAT), 0x00000001, 80, 44, JOY_fmt };

This way the call to IDirectInputDevice2_SetDataFormat in SDL_dx5events.c will
succeed on x64.

--HG--
branch : SDL-1.2
extra : convert_revision : svn%3Ac70aab31-4412-0410-b14c-859654838e24/branches/SDL-1.2%403580
2009-04-13 08:49:41 +00:00
Sam Lantinga
86701def0d Fixed bug #619
Description From  Tim Angus   2008-08-31 03:38:36   (-) [reply]

When pressing "system keys" e.g. ALT+F4 etc., the default for the windib driver
is to ignore them completely, whereas with the directx driver they're handled
(badly as it turns out).

As the windib driver is the default, I assume its behaviour is considered
correct, so the following patch makes the directx driver the same in this
regard.

--HG--
branch : SDL-1.2
extra : convert_revision : svn%3Ac70aab31-4412-0410-b14c-859654838e24/branches/SDL-1.2%403579
2009-04-13 08:44:48 +00:00
Sam Lantinga
0cc0d8eb60 Fixed bug #618
Description From  Tim Angus   2008-08-30 12:23:56   (-) [reply]

As we all know SDL 1.2 doesn't handle dead keys well since one key press
potentially equals two (or more) characters. For example, on many layouts,
keying <backquote>,<space> results in <no character>,<backquote><space>. Since
the unicode member of the SDL_keysym struct only has room for one character,
only one can be returned.

On Linux, the first character is returned. On Windows however, unless the exact
number of characters generated by the keypress is 1, nothing is returned. The
following patch addresses this inconsistency.

Updated patch which includes a further fix to the handling of the numpad when
numlock is on. This further fix is courtesy Amanieu d'Antras.

--HG--
branch : SDL-1.2
extra : convert_revision : svn%3Ac70aab31-4412-0410-b14c-859654838e24/branches/SDL-1.2%403578
2009-04-13 08:42:09 +00:00
Sam Lantinga
2ff43fab29 Fixed bug #611
Comment #22 From  Tim Angus   2009-04-02 08:45:52   (-) [reply] -------

First of all, thanks for committing this. Unfortunately it seems the patch has
only partially applied to wincommon/SDL_sysevents.c and currently a clean SDL
1.2 checkout doesn't build. The new patch here
(http://bugzilla.libsdl.org/attachment.cgi?id=316) fixes this.

--HG--
branch : SDL-1.2
extra : convert_revision : svn%3Ac70aab31-4412-0410-b14c-859654838e24/branches/SDL-1.2%403577
2009-04-13 08:38:04 +00:00
Sam Lantinga
9b8a930448 Fixed bug #526
Comment #1 From  Simon Howard   2009-03-20 16:50:56

Hi,

I'm the author of Chocolate Doom, one of the other source ports that James
mentioned.  This is a patch against the current SVN version of SDL 1.2 that
fixes the bug.  It has been tested and hopefully should be obviously correct
from examining the changes. I'll give a brief explanation.

When the palette is set with SDL_SetPalette, the IDirectDrawPalette_SetEntries
DirectX function is invoked. However, when this happens, a WM_PALETTECHANGED
message is sent to the window.

A WM_PALETTECHANGED message can also be received if the palette is changed for
some other reason, like if the system palette is changed.  Therefore, the
palette change handler (DX5_PaletteChanged) has code to deal with this case.
It distinguishes "expected" palette changes (set with SDL_SetPalette) from
"unexpected" palette changes using the colorchange_expected variable, which is
set before calling IDirectDrawPalette_SetEntries.  However, the code to set
this variable is missing in the fullscreen code path.  By setting this
variable, the palette change is handled properly and the freezes go away.

--HG--
branch : SDL-1.2
extra : convert_revision : svn%3Ac70aab31-4412-0410-b14c-859654838e24/branches/SDL-1.2%403576
2009-04-13 00:53:12 +00:00