Commit Graph

2404 Commits

Author SHA1 Message Date
Sam Lantinga
cdc519267b nasm 2.09 compatibility
nasm-2.09 makes `elf' alias to `elf32', thus __OUTPUT_FORMAT__ macro
becomes `elf32' instead of `elf' (on x86). Unmatched macro value causes
omitting .note.GNU-stack marker and creates ELFs with executable stack.
This is unneeded and attracts security policies like SELinux.

--HG--
branch : SDL-1.2
2011-02-24 09:39:23 -08:00
Sam Lantinga
4d222ab45d Fixed bug #1090 (SDL_BlitCopyOverlap() assumes memcpy() operates in order)
The much more complete fix is in SDL 1.3, but this is a band-aid that will fix the bug for 1.2.

--HG--
branch : SDL-1.2
2011-02-17 02:31:50 -08:00
Sam Lantinga
6341d68347 Fixed bug #1121 (More than one device through SDL_JOYSTICK_DEVICE)
Chusslove Illich      2011-02-13 04:30:28 PST

Currently SDL_JOYSTICK_DEVICE environment variable can be used to add
exactly one topmost device. I think it would be nice if one could also set
several devices (e.g. a stick and a throttle) in this way, as a colon-
separated list. The attached patch implements this

--HG--
branch : SDL-1.2
2011-02-16 04:49:07 -08:00
Sam Lantinga
ffcdf2f90f Fixed compile error
--HG--
branch : SDL-1.2
2011-02-04 09:07:39 -08:00
Sam Lantinga
a03d783f83 Fixed bug #1111
kwm@rainbow-runner.nl      2011-01-30 06:28:27 PST

When building sdl 1.2.14 with the Clang compiler http://clang.llvm.org .
The build fails in src/video/mmx.h with the following error:

--------------------------------------------------
./src/video/SDL_RLEaccel.c:831:5: error: invalid operand for instruction
    CHOOSE_BLIT(RLECLIPBLIT, alpha, fmt);
    ^
./src/video/SDL_RLEaccel.c:831:17: note: instantiated from:
    CHOOSE_BLIT(RLECLIPBLIT, alpha, fmt);
                ^
./src/video/SDL_RLEaccel.c:831:5: note: instantiated from:
    CHOOSE_BLIT(RLECLIPBLIT, alpha, fmt);
    ^
./src/video/SDL_RLEaccel.c:647:23: note: instantiated from:
                                blitter(2, Uint8, ALPHA_BLIT16_565MMX); \
                                                  ^
./src/video/SDL_RLEaccel.c:282:4: note: instantiated from:
          movq_r2m(mm3, *dstp);                         \
          ^
In file included from ./src/video/SDL_RLEaccel.c:99:
./src/video/mmx.h:379:28: note: instantiated from:
#define movq_r2m(reg, var)      mmx_r2m(movq, reg, var)
                                ^
<scratch space>:192:1: note: instantiated from:
"movq"
^
<inline asm>:1:2: note: instantiated into assembly here
        movq %mm3, %dx
        ^
--------------------------------------------------

According to the clang developers this is a invalid inline assembly.
Using the attached patch from the last commit in the below bug report fixes the
compile.
More details from: http://llvm.org/bugs/show_bug.cgi?id=6730

--HG--
branch : SDL-1.2
2011-01-30 13:38:57 -08:00
Sam Lantinga
e5a771fcad Colin Leroy 2011-01-26 04:24:20 PST
the pthread implementation of SDL_SemWaitTimeout() uses busy waiting, while
pthread's sem_timedwait() does work. Attached are patches that make use of it

--HG--
branch : SDL-1.2
2011-01-27 00:33:26 -08:00
Sam Lantinga
2be7f1865b Ozkan Sezer to slouken
The attached small patch updates SDL's libtoolized files for
pe-x86_64 magic, ie win/x64.

--HG--
branch : SDL-1.2
2011-01-26 12:26:27 -08:00
Sam Lantinga
75d7d9364d Missed a small part of the patch
--HG--
branch : SDL-1.2
2011-01-24 14:34:58 -08:00
Sam Lantinga
2b8a7320bf Fixed bug #1080
Markus Rathgeb      2011-01-23 14:34:23 PST

With kernel 2.6.31 the struct input_absinfo defined in linux/input.h changed.
A field "__s32 resolution" was added at the end of the struct.

Because the macro EVIOCGABS(abs) is using the struct input_absinfo, it would be
better (IMHO) to change the declaration of variable values to
"int values[sizeof(struct input_absinfo) / sizeof(int)];" or using "struct
input_absinfo" directly.

--HG--
branch : SDL-1.2
2011-01-24 14:31:32 -08:00
Sam Lantinga
af5e892e35 Michael Bicha to Sam
I came across further issues with SDL 1.2.14 on win32 in combination
with touch screens.

When you touched the screen older SDLs reported
SDL_MOUSEMOTION to the touch position
SDL_MOUSEBUTTONDOWN at the touch position

1.2.14 reports
SDL_MOUSEBUTTONDOWN at the last mouse position before the touch
and then a
SDL_MOUSEMOTION to the touch position

I found that to fix it in the file SDL_sysevents.c i had to put back the
following lines from 1.2.12 to get it working correctly again:
               if ( mouse_relative ) {
               /*    RJR: March 28, 2000
                   report internal mouse position if in relative mode */
                   x = 0; y = 0;
               } else {
                   x = (Sint16)LOWORD(lParam);
                   y = (Sint16)HIWORD(lParam);
#ifdef _WIN32_WCE
                   if (SDL_VideoSurface)
                       GapiTransform(this->hidden->userOrientation,
this->hidden->hiresFix, &x, &y);
#endif
               }
               posted = SDL_PrivateMouseButton(
                           state, button, x, y);

where there was only
               posted = SDL_PrivateMouseButton(
                           state, button, 0, 0);
in 1.2.14 (appx. line 484)

please feel free to put that change into any SDL lib you like in any way
you like and thanks for your great work !

--HG--
branch : SDL-1.2
2011-01-23 21:02:02 -08:00
Sam Lantinga
d4ac198b04 Patch from Haiku's Google Code-In student Daniel Marth, fixes an off-by-one issue in bwindow.
--HG--
branch : SDL-1.2
2010-12-03 16:55:25 -08:00
Sam Lantinga
59a374b27d This patch fixes a dllexport directive warning on Haiku
Scott McCreary
HaikuPorts

--HG--
branch : SDL-1.2
2010-09-19 08:56:53 -07:00
Sam Lantinga
27aa45979d Here's the patch we use when building SDL-1.2.14 and 1.2-hg on Haiku,
it only affects Haiku specific files so should be ok to apply in hg.

-Scott McCreary
HaikuPorts

--HG--
branch : SDL-1.2
2010-09-18 17:16:36 -07:00
Patrice Mandin
d532e5b2cd Use proper GEM API to handle mouse button events
--HG--
branch : SDL-1.2
2010-07-09 17:19:18 +02:00
Sam Lantinga
6e895b65ed Finally fixed bug 894 without breaking bug 716. Yay! :)
--HG--
branch : SDL-1.2
2010-07-20 00:01:26 -07:00
Sam Lantinga
1884f9add8 Fixed bug 1015
Don't set the WM_TRANSIENT_FOR property to an invalid value - delete it instead.

--HG--
branch : SDL-1.2
2010-07-18 11:37:12 -07:00
Sam Lantinga
049d2f44c7 RedHat patch: SDL-1.2.14-xio_error-rh603984.patch
--HG--
branch : SDL-1.2
2010-07-18 11:24:37 -07:00
Sam Lantinga
b07d8de729 RedHat patch: SDL-1.2.14-byteorder.patch
--HG--
branch : SDL-1.2
2010-07-18 11:22:47 -07:00
Sam Lantinga
7a99d1b90b RedHat patch: SDL-1.2.14-audiodriver.patch
--HG--
branch : SDL-1.2
2010-07-18 11:12:27 -07:00
Sam Lantinga
017012df21 Fixed bug 1006
Get the GLX functions with glXGetProcAddress() when available.

--HG--
branch : SDL-1.2
2010-07-18 11:11:37 -07:00
Sam Lantinga
edd35e7af0 Fixed bug 993
GCC supports unnamed unions now. :)

--HG--
branch : SDL-1.2
2010-07-18 10:51:25 -07:00
Sam Lantinga
50ac26967d Fixed bug 957
Fixed the documentation for SDL_GetWMInfo()

--HG--
branch : SDL-1.2
2010-07-18 10:39:24 -07:00
Sam Lantinga
9658a578d6 Better fix for bug 936
--HG--
branch : SDL-1.2
2010-07-18 10:28:57 -07:00
Sam Lantinga
b55d270161 Fixed bug 936
Make sure that eip doesn't overflow the copy buffer beforehand. :)

--HG--
branch : SDL-1.2
2010-07-18 10:08:06 -07:00
Sam Lantinga
a977e65fde Debian patch: 215_kfreebsd_gnu.diff
--HG--
branch : SDL-1.2
2010-07-18 08:12:48 -07:00
Sam Lantinga
19520ddca8 Debian patch: 012_nasm_include.diff
--HG--
branch : SDL-1.2
2010-07-18 07:55:34 -07:00
Sam Lantinga
27aaae96df Debian patch: 011_no_yasm.diff
--HG--
branch : SDL-1.2
2010-07-18 07:54:00 -07:00
Ryan C. Gordon
1daff39d16 SDL-1.2: Quartz fullscreen video contentRect was used uninitialized.
--HG--
branch : SDL-1.2
2010-04-25 20:16:38 -04:00
Sam Lantinga
a487ef0eac Fixed bug 978
Yann Leprince      2010-03-31 11:07:53 PDT

Please add a #serial line as below to sdl.m4 and increase the serial number
with each revision of this file. This allows using aclocal --install, thereby
enabling automatic updating of sdl.m4 in SDL-based packages that distribute it.

# serial 1

The complete documentation and rationale for #serial can be found in the
Automake documentation:
<http://www.gnu.org/software/automake/manual/html_node/Serials.html>.

--HG--
branch : SDL-1.2
2010-04-23 02:19:19 -07:00
Sam Lantinga
187b226293 esigra 2010-04-17 03:53:57 PDT
If this header file is supposed to be includable from C++ code, the code should
of course use one of the SDL_*_cast macros from SDL_stdinc.h.

--HG--
branch : SDL-1.2
2010-04-23 02:14:06 -07:00
Sam Lantinga
439d5513cf Fixed bug 944
Tatu Kilappa      2010-02-11 12:13:20 PST

When compiling with -Wconversion, gcc complains about a cast in SDL_endian.h
that might change the result as we are casting from an int into an Uint16. This
is of course not visible unless we are on a non-x86 platform where the
assembler is not available.

While it's not really an error, the warning is really annoying. To fix, change
SDL_endian.h line 87 to:

  return(Uint16)((x<<8)|(x>>8));

Thank you.

--HG--
branch : SDL-1.2
2010-04-13 21:46:10 -07:00
Sam Lantinga
ff222d5115 CVS is so last decade...
--HG--
branch : SDL-1.2
2010-04-13 21:24:55 -07:00
Sam Lantinga
eae15b1ad8 Fixed bug #943
Ozkan Sezer      2010-02-06 12:31:06 PST

Hi:

Here are some small fixes for compiling SDL against mingw-w64.
(see http://mingw-w64.sourceforge.net/ .  Despite the name, it
supports both win32 and win64.)  Two patches, one for SDL-1.2
and one for SDL-1.3 attached.

src/audio/windx5/directx.h and src/video/windx5/directx.h (both
SDL-1.2 and SDL-1.3.)  I get compilation errors about some union
not having a member named u1 and alike, because of other system
headers being included before this one and them already defining
DUMMYUNIONNAME and stuff. This header probably assumes that those
stuff are defined in windef.h, but mingw-w64 headers define them
in _mingw.h. Easily fixed by moving NONAMELESSUNION definition to
the top of the file.  SDL_dx5yuv.c (SDL-1.2-only) also needs to
include the header before SDL_video.h to avoid the same problem.

src/thread/win32/SDL_systhread.c (both SDL-1.2 and SDL-1.3.) :
The __GNUC__ case for pfnSDL_CurrentBeginThread is 32-bit centric
because _beginthreadex returns uintptr_t, not unsigned long which
is 32 bits in win64. Changing the return type to uintptr_t fixes
it.

Hope these are useful. Thanks.

--HG--
branch : SDL-1.2
2010-03-10 15:04:13 +00:00
Ryan C. Gordon
d047b08e55 Replaced README.SVN with Mercurial information, for 1.2 branch.
--HG--
branch : SDL-1.2
2010-02-28 23:45:02 -08:00
Ryan C. Gordon
412da7f928 Added .hgignore file for 1.2 branch.
--HG--
branch : SDL-1.2
2010-02-28 02:19:04 -05:00
Ryan C. Gordon
bc3d64a52a Readded Xcode.tar.gz to the Mercurial repository.
(This was stripped from previous revisions to make the repo smaller.)

--HG--
branch : SDL-1.2
2010-02-28 00:31:38 -05:00
Ryan C. Gordon
22cd9e3e14 Fixed channel swizzling for ALSA target with 6-channel output.
Fixes Bugzilla #942.

--HG--
branch : SDL-1.2
2010-02-12 16:59:34 +00:00
Ryan C. Gordon
393fd240ce Fixed uninitialized variable in FreeBSD joystick.
Patch by Marcus von Appen.

--HG--
branch : SDL-1.2
2010-02-05 19:20:49 +00:00
Ryan C. Gordon
30d034e824 PulseAudio: get the window title for the context name if it wasn't set already.
Will still fall back to get_progname() if it can't figure out the title.

--HG--
branch : SDL-1.2
2010-01-24 20:08:14 +00:00
Ryan C. Gordon
6acf686dc0 Patched to compile on Visual C++.
--HG--
branch : SDL-1.2
2010-01-24 17:54:57 +00:00
Ryan C. Gordon
2463df2be0 1.2: let PulseAudio hook into SDL_WM_SetCaption().
This lets Pulse's system-wide list of currently playing sources have accurate
names for SDL applications.

DO NOT MERGE WITH 1.3...we'll design a more formal API there.

--HG--
branch : SDL-1.2
2010-01-24 08:35:09 +00:00
Ryan C. Gordon
cc4e49e187 Reverted accidental commit.
--HG--
branch : SDL-1.2
2010-01-17 05:19:32 +00:00
Ryan C. Gordon
8bac2a4e77 1.2 pulseaudio: make some function pointers static.
--HG--
branch : SDL-1.2
2010-01-17 05:17:59 +00:00
Ryan C. Gordon
8148e9def0 Call SDL_OutOfMemory() if SDL_malloc() fails.
--HG--
branch : SDL-1.2
2010-01-06 06:41:41 +00:00
Sam Lantinga
fb5a13f95e Merged SDL 1.3 revision 5424, fixing a crash in the joystick code on recent kernels.
--HG--
branch : SDL-1.2
2009-12-17 14:33:00 +00:00
Sam Lantinga
8cd32e9284 Fixed bug #901
Tim Angus      2009-12-11 11:45:46 PST

Disable mouse event generation when state is not SDL_APPMOUSEFOCUS

If a Windows SDL application is minimised by using alt-tab, SDL_APPMOUSEFOCUS
is lost as part of the minimisation. Unfortunately, the directx driver doesn't
pay any attention to this state when generating mouse button events, so
clicking on the Desktop can cause mouse clicks in the SDL application, while
it's still minimised. The attached patch fixes this. It looks much more
complicated than it actually is due to indentation; here it is ignoring
whitespace:

tma@abraxas:~/sources/SDL-1.2-svn$ svn diff -x -b
Index: src/video/windx5/SDL_dx5events.c
===================================================================
--- src/video/windx5/SDL_dx5events.c    (revision 5376)
+++ src/video/windx5/SDL_dx5events.c    (working copy)
@@ -374,10 +374,9 @@
     if ( !(SDL_GetAppState() & SDL_APPMOUSEFOCUS) ) {
         mouse_lost = 1;
         ClipCursor(NULL);
-    }
-
+    } else {
     /* If the mouse was lost, regain some sense of mouse state */
-    if ( mouse_lost && (SDL_GetAppState() & SDL_APPMOUSEFOCUS) ) {
+        if ( mouse_lost ) {
         POINT mouse_pos;
         Uint8 old_state;
         Uint8 new_state;
@@ -548,6 +547,7 @@
     if ( xrel || yrel ) {
         post_mouse_motion(1, xrel, yrel);
     }
+    }
 }

 /* The main Win32 event handler */

--HG--
branch : SDL-1.2
2009-12-14 22:41:31 +00:00
Sam Lantinga
5f00bddd50 Fixed bug #898
Jeremiah Morris      2009-12-09 16:07:17 PST

No-op GlobalToLocal translations in fullscreen mode

On my MacBook Pro running 10.6, I noticed a small upward bias on mouse movement
in a fullscreen SDL application. The app uses WarpCursor and GetMouseState in a
loop to measure relative movement. I tracked it down to NSWindow's
convertBaseToScreen: routine, which added a 2-pixel offset on the Y coordinate
instead of the expected (+0,+0) translation.

In fullscreen mode, QZ_PrivateWarpCursor() does not translate the desired
position through QZ_PrivateGlobalToLocal() before passing it to the Core
Graphics system. However, QZ_GetMouseLocation() does call the reverse
QZ_PrivateLocalToGlobal() even in fullscreen mode. This asymmetry caused
problems each time the mouse was moved.

--HG--
branch : SDL-1.2
2009-12-11 15:31:37 +00:00
Sam Lantinga
82c1fc4441 Fixed bug #849 some more:
Tim Angus      2009-11-26 14:41:04 PST

Fix to the cursor not being responsive when the app doesn't have
SDL_APPINPUTFOCUS

The problems with the directx driver are similar to the ones I introduced in
the windib driver with r4478. Basically if the application did not have focus,
the mouse position is not updated. It's not really that the mouse cursor was
invisible, it's that it is stuck underneath another window where you can't see
it. This behaviour predates my r4478 changes and is the reason I unwittingly
broke the windib driver as I had been replicating the way the directx driver
deals with focus. Prior to r4478 the directx driver could not be used in
windowed mode, so the broken focusing would not have actually been observable.

Anyway, the attached patch makes the directx driver behaves like the windib
driver in terms of focus.

Time for 1.2.15? ;)

I've added an additional change of moving the calls to WIN_GrabInput that are
made on WM_ACTIVATE messages so that they only occur when the state is
SDL_APPINPUTFOCUS. When a fullscreen application is minimised using alt-tab, it
still receives WM_ACTIVATE messages when other applications are selected. If
WIN_GrabInput is called when the SDL application doesn't have input focus, bad
things happen; it shouldn't be being called at all.

I've also added a line to make sure that SDL_APPMOUSEFOCUS state is dropped
when the application is minimised following an alt-tab.

--HG--
branch : SDL-1.2
2009-12-11 15:24:53 +00:00
Sam Lantinga
acf88cb34d Fixed bug #895
Markus Rothe      2009-12-07 09:32:46 PST

Check if libspe2 is available

Building on PowerPC64 results in:

[...]
In file included from ./src/video/ps3/SDL_ps3events_c.h:33,
                 from ./src/video/ps3/SDL_ps3video.c:32:
./src/video/ps3/SDL_ps3video.h:34:21: error: libspe2.h: No such file or
directory
In file included from ./src/video/ps3/SDL_ps3events_c.h:33,
                 from ./src/video/ps3/SDL_ps3video.c:32:
./src/video/ps3/SDL_ps3video.h:75: error: expected specifier-qualifier-list
before 'spe_context_ptr_t'
./src/video/ps3/SDL_ps3video.c:78: error: expected '=', ',', ';', 'asm' or
'__attribute__' before 'fb_writer_spu'
./src/video/ps3/SDL_ps3video.c: In function 'PS3_VideoInit':
./src/video/ps3/SDL_ps3video.c:167: error: 'spu_data_t' has no member named
'program'
./src/video/ps3/SDL_ps3video.c:167: error: 'fb_writer_spu' undeclared (first
use in this function)
[...]

The problem is that the ps3 video driver is being build regardless if libspe2
is installed or not. The attached patch fixes this problem.

[ Note: The other headers that are being checked for are coming from the linux
headers package on powerpc64. As a result these are also available if you're on
a generic powerpc64 machine and not a PS3 only. ]

--HG--
branch : SDL-1.2
2009-12-11 15:14:13 +00:00
Sam Lantinga
b489f0fe79 Fixed bug #899
Jeremiah Morris      2009-12-09 16:23:50 PST

Re-enable mouseLocation workaround on 10.4, 10.5

OS X systems before 10.6 have a bug with [NSEvent mouseLocation] if the screen
resolution changes. SDL_QuartzVideo.m contains a workaround for this bug, but
it was placed inside an #ifdef in revision 4762. The comment reads, "I'm
gambling they fixed this by 10.4."

After seeing this bug on several Tiger and Leopard systems (both PPC and
Intel), I can confirm that it's not fixed until 10.6. The workaround doesn't
compile for x86_64/10.6, so I can understand why it was segregated, but it
needs to remain in place for the i386 and ppc versions. The workaround causes
no problems under 10.6, even though it's not necessary there.

Patch is attached with one method of keeping the workaround active on the
systems that need it.

--HG--
branch : SDL-1.2
2009-12-11 15:11:49 +00:00