Updated SDL 1.2 with newest version from libsdl.org HG
This commit is contained in:
@@ -39,6 +39,10 @@
|
||||
/*@}*/
|
||||
|
||||
#ifndef SDL_BYTEORDER /* Not defined in SDL_config.h? */
|
||||
#ifdef __linux__
|
||||
#include <endian.h>
|
||||
#define SDL_BYTEORDER __BYTE_ORDER
|
||||
#else /* __linux __ */
|
||||
#if defined(__hppa__) || \
|
||||
defined(__m68k__) || defined(mc68000) || defined(_M_M68K) || \
|
||||
(defined(__MIPS__) && defined(__MISPEB__)) || \
|
||||
@@ -48,6 +52,7 @@
|
||||
#else
|
||||
#define SDL_BYTEORDER SDL_LIL_ENDIAN
|
||||
#endif
|
||||
#endif /* __linux __ */
|
||||
#endif /* !SDL_BYTEORDER */
|
||||
|
||||
|
||||
|
||||
@@ -258,9 +258,6 @@ extern DECLSPEC void SDLCALL SDL_qsort(void *base, size_t nmemb, size_t size,
|
||||
extern DECLSPEC void * SDLCALL SDL_memset(void *dst, int c, size_t len);
|
||||
#endif
|
||||
|
||||
#define SDL_zero(x) SDL_memset(&(x), 0, sizeof((x)))
|
||||
#define SDL_zerop(x) SDL_memset((x), 0, sizeof(*(x)))
|
||||
|
||||
#if defined(__GNUC__) && defined(i386)
|
||||
#define SDL_memset4(dst, val, len) \
|
||||
do { \
|
||||
|
||||
@@ -203,8 +203,9 @@ typedef struct SDL_SysWMinfo {
|
||||
/**
|
||||
* This function gives you custom hooks into the window manager information.
|
||||
* It fills the structure pointed to by 'info' with custom information and
|
||||
* returns 1 if the function is implemented. If it's not implemented, or
|
||||
* the version member of the 'info' structure is invalid, it returns 0.
|
||||
* returns 0 if the function is not implemented, 1 if the function is
|
||||
* implemented and no error occurred, and -1 if the version member of
|
||||
* the 'info' structure is not filled in or not supported.
|
||||
*
|
||||
* You typically use this function like this:
|
||||
* @code
|
||||
|
||||
@@ -43,7 +43,7 @@
|
||||
#ifndef DECLSPEC
|
||||
# if defined(__BEOS__) || defined(__HAIKU__)
|
||||
# if defined(__GNUC__)
|
||||
# define DECLSPEC __declspec(dllexport)
|
||||
# define DECLSPEC
|
||||
# else
|
||||
# define DECLSPEC __declspec(export)
|
||||
# endif
|
||||
|
||||
198
project/jni/sdl-1.2/sdl-1.2-android.diff
Normal file
198
project/jni/sdl-1.2/sdl-1.2-android.diff
Normal file
@@ -0,0 +1,198 @@
|
||||
Only in .: acinclude
|
||||
Only in /home/pelya/src/endless_space/SDL-android/project/jni/sdl-1.2: Android.mk
|
||||
Only in .: autogen.sh
|
||||
Only in .: Borland.html
|
||||
Only in .: Borland.zip
|
||||
Only in .: build-scripts
|
||||
Only in .: configure
|
||||
Only in .: configure.in
|
||||
Only in .: CWprojects.sea.bin
|
||||
Only in .: docs
|
||||
Only in .: docs.html
|
||||
Only in /home/pelya/src/endless_space/SDL-android/project/jni/sdl-1.2/include: SDL
|
||||
Only in /home/pelya/src/endless_space/SDL-android/project/jni/sdl-1.2/include: SDL_config_android.h
|
||||
diff -u -r ./include/SDL_config.h /home/pelya/src/endless_space/SDL-android/project/jni/sdl-1.2/include/SDL_config.h
|
||||
--- ./include/SDL_config.h 2009-10-19 14:51:07.000000000 +0300
|
||||
+++ /home/pelya/src/endless_space/SDL-android/project/jni/sdl-1.2/include/SDL_config.h 2010-05-18 13:09:18.000000000 +0300
|
||||
@@ -38,6 +38,8 @@
|
||||
#include "SDL_config_win32.h"
|
||||
#elif defined(__OS2__)
|
||||
#include "SDL_config_os2.h"
|
||||
+#elif defined(ANDROID)
|
||||
+#include "SDL_config_android.h"
|
||||
#else
|
||||
#include "SDL_config_minimal.h"
|
||||
#endif /* platform config */
|
||||
diff -u -r ./include/SDL_endian.h /home/pelya/src/endless_space/SDL-android/project/jni/sdl-1.2/include/SDL_endian.h
|
||||
diff -u -r ./include/SDL_main.h /home/pelya/src/endless_space/SDL-android/project/jni/sdl-1.2/include/SDL_main.h
|
||||
--- ./include/SDL_main.h 2009-10-13 02:07:19.000000000 +0300
|
||||
+++ /home/pelya/src/endless_space/SDL-android/project/jni/sdl-1.2/include/SDL_main.h 2010-07-26 12:49:30.000000000 +0300
|
||||
@@ -32,7 +32,7 @@
|
||||
#if defined(__WIN32__) || \
|
||||
(defined(__MWERKS__) && !defined(__BEOS__)) || \
|
||||
defined(__MACOS__) || defined(__MACOSX__) || \
|
||||
- defined(__SYMBIAN32__) || defined(QWS)
|
||||
+ defined(__SYMBIAN32__) || defined(QWS) || defined(ANDROID)
|
||||
|
||||
#ifdef __cplusplus
|
||||
#define C_LINKAGE "C"
|
||||
Only in /home/pelya/src/endless_space/SDL-android/project/jni/sdl-1.2/include: SDL_screenkeyboard.h
|
||||
diff -u -r ./include/SDL_stdinc.h /home/pelya/src/endless_space/SDL-android/project/jni/sdl-1.2/include/SDL_stdinc.h
|
||||
Only in .: Makefile.dc
|
||||
Only in .: Makefile.in
|
||||
Only in .: Makefile.minimal
|
||||
Only in .: MPWmake.sea.bin
|
||||
Only in .: README.AmigaOS
|
||||
Only in .: README.BeOS
|
||||
Only in .: README.CVS
|
||||
Only in .: README.DC
|
||||
Only in /home/pelya/src/endless_space/SDL-android/project/jni/sdl-1.2: README.HG
|
||||
Only in .: README.MacOS
|
||||
Only in .: README.MacOSX
|
||||
Only in .: README.MiNT
|
||||
Only in .: README.NanoX
|
||||
Only in .: README.NDS
|
||||
Only in .: README.OS2
|
||||
Only in .: README.PicoGUI
|
||||
Only in .: README.PS3
|
||||
Only in .: README.QNX
|
||||
Only in .: README.Qtopia
|
||||
Only in .: README.RISCOS
|
||||
Only in .: README.SVN
|
||||
Only in .: README.Symbian
|
||||
Only in .: README.Watcom
|
||||
Only in .: README.WinCE
|
||||
Only in .: README.wscons
|
||||
Only in .: sdl-1.2-android.diff
|
||||
Only in .: sdl-config.in
|
||||
Only in .: sdl.m4
|
||||
Only in .: sdl.pc.in
|
||||
Only in .: SDL.qpg.in
|
||||
Only in .: SDL.spec
|
||||
Only in .: SDL.spec.in
|
||||
diff -u -r ./src/audio/alsa/SDL_alsa_audio.c /home/pelya/src/endless_space/SDL-android/project/jni/sdl-1.2/src/audio/alsa/SDL_alsa_audio.c
|
||||
Only in /home/pelya/src/endless_space/SDL-android/project/jni/sdl-1.2/src/audio: android
|
||||
diff -u -r ./src/audio/mint/SDL_mintaudio_it.S /home/pelya/src/endless_space/SDL-android/project/jni/sdl-1.2/src/audio/mint/SDL_mintaudio_it.S
|
||||
diff -u -r ./src/audio/pulse/SDL_pulseaudio.c /home/pelya/src/endless_space/SDL-android/project/jni/sdl-1.2/src/audio/pulse/SDL_pulseaudio.c
|
||||
diff -u -r ./src/audio/pulse/SDL_pulseaudio.h /home/pelya/src/endless_space/SDL-android/project/jni/sdl-1.2/src/audio/pulse/SDL_pulseaudio.h
|
||||
diff -u -r ./src/audio/SDL_audio.c /home/pelya/src/endless_space/SDL-android/project/jni/sdl-1.2/src/audio/SDL_audio.c
|
||||
--- ./src/audio/SDL_audio.c 2009-10-13 13:25:35.000000000 +0300
|
||||
+++ /home/pelya/src/endless_space/SDL-android/project/jni/sdl-1.2/src/audio/SDL_audio.c 2010-07-15 18:26:48.000000000 +0300
|
||||
@@ -113,6 +113,9 @@
|
||||
#if SDL_AUDIO_DRIVER_EPOCAUDIO
|
||||
&EPOCAudio_bootstrap,
|
||||
#endif
|
||||
+#if SDL_AUDIO_DRIVER_ANDROID
|
||||
+ &ANDROIDAUD_bootstrap,
|
||||
+#endif
|
||||
NULL
|
||||
};
|
||||
SDL_AudioDevice *current_audio = NULL;
|
||||
diff -u -r ./src/audio/SDL_audio_c.h /home/pelya/src/endless_space/SDL-android/project/jni/sdl-1.2/src/audio/SDL_audio_c.h
|
||||
diff -u -r ./src/audio/SDL_mixer.c /home/pelya/src/endless_space/SDL-android/project/jni/sdl-1.2/src/audio/SDL_mixer.c
|
||||
diff -u -r ./src/audio/SDL_mixer_m68k.c /home/pelya/src/endless_space/SDL-android/project/jni/sdl-1.2/src/audio/SDL_mixer_m68k.c
|
||||
diff -u -r ./src/audio/SDL_sysaudio.h /home/pelya/src/endless_space/SDL-android/project/jni/sdl-1.2/src/audio/SDL_sysaudio.h
|
||||
--- ./src/audio/SDL_sysaudio.h 2009-10-13 02:07:14.000000000 +0300
|
||||
+++ /home/pelya/src/endless_space/SDL-android/project/jni/sdl-1.2/src/audio/SDL_sysaudio.h 2010-07-15 18:22:45.000000000 +0300
|
||||
@@ -177,6 +179,9 @@
|
||||
#if SDL_AUDIO_DRIVER_EPOCAUDIO
|
||||
extern AudioBootStrap EPOCAudio_bootstrap;
|
||||
#endif
|
||||
+#if SDL_AUDIO_DRIVER_ANDROID
|
||||
+extern AudioBootStrap ANDROIDAUD_bootstrap;
|
||||
+#endif
|
||||
|
||||
/* This is the current audio device */
|
||||
extern SDL_AudioDevice *current_audio;
|
||||
diff -u -r ./src/audio/windx5/directx.h /home/pelya/src/endless_space/SDL-android/project/jni/sdl-1.2/src/audio/windx5/directx.h
|
||||
diff -u -r ./src/cdrom/mint/SDL_syscdrom.c /home/pelya/src/endless_space/SDL-android/project/jni/sdl-1.2/src/cdrom/mint/SDL_syscdrom.c
|
||||
diff -u -r ./src/cpuinfo/SDL_cpuinfo.c /home/pelya/src/endless_space/SDL-android/project/jni/sdl-1.2/src/cpuinfo/SDL_cpuinfo.c
|
||||
diff -u -r ./src/joystick/bsd/SDL_sysjoystick.c /home/pelya/src/endless_space/SDL-android/project/jni/sdl-1.2/src/joystick/bsd/SDL_sysjoystick.c
|
||||
diff -u -r ./src/joystick/linux/SDL_sysjoystick.c /home/pelya/src/endless_space/SDL-android/project/jni/sdl-1.2/src/joystick/linux/SDL_sysjoystick.c
|
||||
Only in ./src/joystick: os2
|
||||
diff -u -r ./src/joystick/SDL_joystick.c /home/pelya/src/endless_space/SDL-android/project/jni/sdl-1.2/src/joystick/SDL_joystick.c
|
||||
diff -u -r ./src/stdlib/SDL_iconv.c /home/pelya/src/endless_space/SDL-android/project/jni/sdl-1.2/src/stdlib/SDL_iconv.c
|
||||
diff -u -r ./src/thread/win32/SDL_systhread.c /home/pelya/src/endless_space/SDL-android/project/jni/sdl-1.2/src/thread/win32/SDL_systhread.c
|
||||
diff -u -r ./src/timer/mint/SDL_vbltimer.S /home/pelya/src/endless_space/SDL-android/project/jni/sdl-1.2/src/timer/mint/SDL_vbltimer.S
|
||||
Only in /home/pelya/src/endless_space/SDL-android/project/jni/sdl-1.2/src/video: android
|
||||
diff -u -r ./src/video/ataricommon/SDL_ataric2p.S /home/pelya/src/endless_space/SDL-android/project/jni/sdl-1.2/src/video/ataricommon/SDL_ataric2p.S
|
||||
diff -u -r ./src/video/ataricommon/SDL_ikbdinterrupt.S /home/pelya/src/endless_space/SDL-android/project/jni/sdl-1.2/src/video/ataricommon/SDL_ikbdinterrupt.S
|
||||
diff -u -r ./src/video/ataricommon/SDL_xbiosinterrupt.S /home/pelya/src/endless_space/SDL-android/project/jni/sdl-1.2/src/video/ataricommon/SDL_xbiosinterrupt.S
|
||||
diff -u -r ./src/video/math_private.h /home/pelya/src/endless_space/SDL-android/project/jni/sdl-1.2/src/video/math_private.h
|
||||
diff -u -r ./src/video/quartz/SDL_QuartzGL.m /home/pelya/src/endless_space/SDL-android/project/jni/sdl-1.2/src/video/quartz/SDL_QuartzGL.m
|
||||
diff -u -r ./src/video/quartz/SDL_QuartzVideo.m /home/pelya/src/endless_space/SDL-android/project/jni/sdl-1.2/src/video/quartz/SDL_QuartzVideo.m
|
||||
diff -u -r ./src/video/quartz/SDL_QuartzWM.m /home/pelya/src/endless_space/SDL-android/project/jni/sdl-1.2/src/video/quartz/SDL_QuartzWM.m
|
||||
diff -u -r ./src/video/SDL_blit.c /home/pelya/src/endless_space/SDL-android/project/jni/sdl-1.2/src/video/SDL_blit.c
|
||||
--- ./src/video/SDL_blit.c 2009-10-13 02:07:15.000000000 +0300
|
||||
+++ /home/pelya/src/endless_space/SDL-android/project/jni/sdl-1.2/src/video/SDL_blit.c 2010-07-28 18:58:30.000000000 +0300
|
||||
@@ -26,6 +26,7 @@
|
||||
#include "SDL_blit.h"
|
||||
#include "SDL_RLEaccel_c.h"
|
||||
#include "SDL_pixels_c.h"
|
||||
+#include <android/log.h>
|
||||
|
||||
#if defined(__GNUC__) && (defined(__i386__) || defined(__x86_64__)) && SDL_ASSEMBLY_ROUTINES
|
||||
#define MMX_ASMBLIT
|
||||
@@ -242,6 +243,7 @@
|
||||
|
||||
/* Figure out if an accelerated hardware blit is possible */
|
||||
surface->flags &= ~SDL_HWACCEL;
|
||||
+ //__android_log_print(ANDROID_LOG_INFO, "libSDL", "SDL_CalculateBlit(): identity %d src hw %d dst hw %d video hw %d", (int)surface->map->identity, (int)(surface->flags & SDL_HWSURFACE), (int)(surface->map->dst->flags & SDL_HWSURFACE), (int)(current_video->info.blit_hw));
|
||||
if ( surface->map->identity ) {
|
||||
int hw_blit_ok;
|
||||
|
||||
diff -u -r ./src/video/SDL_pixels.c /home/pelya/src/endless_space/SDL-android/project/jni/sdl-1.2/src/video/SDL_pixels.c
|
||||
--- ./src/video/SDL_pixels.c 2009-10-13 02:07:15.000000000 +0300
|
||||
+++ /home/pelya/src/endless_space/SDL-android/project/jni/sdl-1.2/src/video/SDL_pixels.c 2010-10-18 12:26:43.000000000 +0300
|
||||
@@ -304,7 +304,12 @@
|
||||
default:
|
||||
break;
|
||||
}
|
||||
+
|
||||
+#ifdef ANDROID
|
||||
+ if( surface->format->BytesPerPixel != 2 ) /* Avoid extra memcpy() when updating GLES textures */
|
||||
+#endif
|
||||
pitch = (pitch + 3) & ~3; /* 4-byte aligning */
|
||||
+
|
||||
return(pitch);
|
||||
}
|
||||
/*
|
||||
diff -u -r ./src/video/SDL_sysvideo.h /home/pelya/src/endless_space/SDL-android/project/jni/sdl-1.2/src/video/SDL_sysvideo.h
|
||||
--- ./src/video/SDL_sysvideo.h 2009-10-13 02:07:15.000000000 +0300
|
||||
+++ /home/pelya/src/endless_space/SDL-android/project/jni/sdl-1.2/src/video/SDL_sysvideo.h 2010-07-15 18:26:06.000000000 +0300
|
||||
@@ -410,6 +410,9 @@
|
||||
#if SDL_VIDEO_DRIVER_CACA
|
||||
extern VideoBootStrap CACA_bootstrap;
|
||||
#endif
|
||||
+#if SDL_VIDEO_DRIVER_ANDROID
|
||||
+extern VideoBootStrap ANDROID_bootstrap;
|
||||
+#endif
|
||||
#if SDL_VIDEO_DRIVER_DUMMY
|
||||
extern VideoBootStrap DUMMY_bootstrap;
|
||||
#endif
|
||||
diff -u -r ./src/video/SDL_video.c /home/pelya/src/endless_space/SDL-android/project/jni/sdl-1.2/src/video/SDL_video.c
|
||||
--- ./src/video/SDL_video.c 2009-10-13 02:07:15.000000000 +0300
|
||||
+++ /home/pelya/src/endless_space/SDL-android/project/jni/sdl-1.2/src/video/SDL_video.c 2010-08-27 15:41:51.000000000 +0300
|
||||
@@ -126,6 +126,9 @@
|
||||
#if SDL_VIDEO_DRIVER_CACA
|
||||
&CACA_bootstrap,
|
||||
#endif
|
||||
+#if SDL_VIDEO_DRIVER_ANDROID
|
||||
+ &ANDROID_bootstrap,
|
||||
+#endif
|
||||
#if SDL_VIDEO_DRIVER_DUMMY
|
||||
&DUMMY_bootstrap,
|
||||
#endif
|
||||
diff -u -r ./src/video/wincommon/SDL_sysevents.c /home/pelya/src/endless_space/SDL-android/project/jni/sdl-1.2/src/video/wincommon/SDL_sysevents.c
|
||||
diff -u -r ./src/video/windib/SDL_dibevents.c /home/pelya/src/endless_space/SDL-android/project/jni/sdl-1.2/src/video/windib/SDL_dibevents.c
|
||||
diff -u -r ./src/video/windx5/directx.h /home/pelya/src/endless_space/SDL-android/project/jni/sdl-1.2/src/video/windx5/directx.h
|
||||
diff -u -r ./src/video/windx5/SDL_dx5events.c /home/pelya/src/endless_space/SDL-android/project/jni/sdl-1.2/src/video/windx5/SDL_dx5events.c
|
||||
diff -u -r ./src/video/windx5/SDL_dx5yuv.c /home/pelya/src/endless_space/SDL-android/project/jni/sdl-1.2/src/video/windx5/SDL_dx5yuv.c
|
||||
Only in .: symbian.zip
|
||||
Only in .: test
|
||||
Only in .: VisualCE.zip
|
||||
Only in .: VisualC.html
|
||||
Only in .: VisualC.zip
|
||||
Only in .: Watcom-OS2.zip
|
||||
Only in .: Watcom-Win32.zip
|
||||
Only in .: Xcode.tar.gz
|
||||
@@ -36,15 +36,15 @@
|
||||
|
||||
/* Available audio drivers */
|
||||
static AudioBootStrap *bootstrap[] = {
|
||||
#if SDL_AUDIO_DRIVER_BSD
|
||||
&BSD_AUDIO_bootstrap,
|
||||
#endif
|
||||
#if SDL_AUDIO_DRIVER_PULSE
|
||||
&PULSE_bootstrap,
|
||||
#endif
|
||||
#if SDL_AUDIO_DRIVER_ALSA
|
||||
&ALSA_bootstrap,
|
||||
#endif
|
||||
#if SDL_AUDIO_DRIVER_BSD
|
||||
&BSD_AUDIO_bootstrap,
|
||||
#endif
|
||||
#if SDL_AUDIO_DRIVER_OSS
|
||||
&DSP_bootstrap,
|
||||
&DMA_bootstrap,
|
||||
|
||||
@@ -2,10 +2,6 @@
|
||||
#ifndef _directx_h
|
||||
#define _directx_h
|
||||
|
||||
#ifdef __GNUC__
|
||||
#define NONAMELESSUNION
|
||||
#endif
|
||||
|
||||
/* Include all of the DirectX 5.0 headers and adds any necessary tweaks */
|
||||
|
||||
#define WIN32_LEAN_AND_MEAN
|
||||
|
||||
@@ -59,7 +59,7 @@
|
||||
#include <libusbhid.h>
|
||||
#endif
|
||||
|
||||
#ifdef __FREEBSD__
|
||||
#if defined(__FREEBSD__) || defined(__FreeBSD_kernel__)
|
||||
#ifndef __DragonFly__
|
||||
#include <osreldate.h>
|
||||
#endif
|
||||
@@ -78,7 +78,7 @@
|
||||
#define MAX_JOY_JOYS 2
|
||||
#define MAX_JOYS (MAX_UHID_JOYS + MAX_JOY_JOYS)
|
||||
|
||||
#if defined(__FREEBSD__) && (__FreeBSD_kernel_version > 800063)
|
||||
#if defined(__FREEBSD__) && (__FreeBSD_kernel_version > 800063) && false
|
||||
struct usb_ctl_report {
|
||||
int ucr_report;
|
||||
u_char ucr_data[1024]; /* filled data size will vary */
|
||||
@@ -148,7 +148,7 @@ static char *joydevnames[MAX_JOYS];
|
||||
static int report_alloc(struct report *, struct report_desc *, int);
|
||||
static void report_free(struct report *);
|
||||
|
||||
#if defined(USBHID_UCR_DATA) || (defined(__FREEBSD__) && (__FreeBSD_kernel_version > 800063))
|
||||
#if defined(USBHID_UCR_DATA) || (defined(__FREEBSD__) && (__FreeBSD_kernel_version > 800063)) || defined(__FreeBSD_kernel__)
|
||||
#define REP_BUF_DATA(rep) ((rep)->buf->ucr_data)
|
||||
#else
|
||||
#define REP_BUF_DATA(rep) ((rep)->buf->data)
|
||||
@@ -304,7 +304,7 @@ SDL_SYS_JoystickOpen(SDL_Joystick *joy)
|
||||
goto usberr;
|
||||
}
|
||||
rep = &hw->inreport;
|
||||
#if defined(__FREEBSD__) && (__FreeBSD_kernel_version > 800063)
|
||||
#if defined(__FREEBSD__) && (__FreeBSD_kernel_version > 800063) || defined(__FreeBSD_kernel__)
|
||||
rep->rid = hid_get_report_id(fd);
|
||||
if (rep->rid < 0) {
|
||||
#else
|
||||
@@ -321,7 +321,7 @@ SDL_SYS_JoystickOpen(SDL_Joystick *joy)
|
||||
goto usberr;
|
||||
}
|
||||
|
||||
#if defined(USBHID_NEW) || (defined(__FREEBSD__) && __FreeBSD_kernel_version >= 500111)
|
||||
#if defined(USBHID_NEW) || (defined(__FREEBSD__) && __FreeBSD_kernel_version >= 500111) || defined(__FreeBSD_kernel__)
|
||||
hdata = hid_start_parse(hw->repdesc, 1 << hid_input, rep->rid);
|
||||
#else
|
||||
hdata = hid_start_parse(hw->repdesc, 1 << hid_input);
|
||||
@@ -405,7 +405,7 @@ SDL_SYS_JoystickUpdate(SDL_Joystick *joy)
|
||||
int nbutton, naxe = -1;
|
||||
Sint32 v;
|
||||
|
||||
#if defined(__FREEBSD__) || SDL_JOYSTICK_USBHID_MACHINE_JOYSTICK_H
|
||||
#if defined(__FREEBSD__) || SDL_JOYSTICK_USBHID_MACHINE_JOYSTICK_H || defined(__FreeBSD_kernel__)
|
||||
struct joystick gameport;
|
||||
|
||||
if (joy->hwdata->type == BSDJOY_JOY) {
|
||||
@@ -460,7 +460,7 @@ SDL_SYS_JoystickUpdate(SDL_Joystick *joy)
|
||||
if (read(joy->hwdata->fd, REP_BUF_DATA(rep), rep->size) != rep->size) {
|
||||
return;
|
||||
}
|
||||
#if defined(USBHID_NEW) || (defined(__FREEBSD__) && __FreeBSD_kernel_version >= 500111)
|
||||
#if defined(USBHID_NEW) || (defined(__FREEBSD__) && __FreeBSD_kernel_version >= 500111) || defined(__FreeBSD_kernel__)
|
||||
hdata = hid_start_parse(joy->hwdata->repdesc, 1 << hid_input, rep->rid);
|
||||
#else
|
||||
hdata = hid_start_parse(joy->hwdata->repdesc, 1 << hid_input);
|
||||
|
||||
@@ -39,13 +39,15 @@ static SDL_Thread *SDL_AppThread = NULL;
|
||||
|
||||
static int StartBeApp(void *unused)
|
||||
{
|
||||
if(!be_app) {
|
||||
BApplication *App;
|
||||
|
||||
App = new BApplication("application/x-SDL-executable");
|
||||
|
||||
App->Run();
|
||||
delete App;
|
||||
return(0);
|
||||
}
|
||||
return(0);
|
||||
}
|
||||
|
||||
/* Initialize the Be Application, if it's not already started */
|
||||
@@ -86,7 +88,7 @@ int SDL_InitBeApp(void)
|
||||
++SDL_BeAppActive;
|
||||
|
||||
/* The app is running, and we're ready to go */
|
||||
return(0);
|
||||
return(0);
|
||||
}
|
||||
|
||||
/* Quit the Be Application, if there's nothing left to do */
|
||||
|
||||
@@ -78,7 +78,7 @@ static int generate_rowbytes(int src_w, int dst_w, int bpp)
|
||||
|
||||
int i;
|
||||
int pos, inc;
|
||||
unsigned char *eip;
|
||||
unsigned char *eip, *fence;
|
||||
unsigned char load, store;
|
||||
|
||||
/* See if we need to regenerate the copy buffer */
|
||||
@@ -115,14 +115,21 @@ static int generate_rowbytes(int src_w, int dst_w, int bpp)
|
||||
pos = 0x10000;
|
||||
inc = (src_w << 16) / dst_w;
|
||||
eip = copy_row;
|
||||
for ( i=0; i<dst_w; ++i ) {
|
||||
fence = copy_row+sizeof(copy_row)-2;
|
||||
for ( i=0; i<dst_w && eip < end; ++i ) {
|
||||
while ( pos >= 0x10000L ) {
|
||||
if ( eip == fence ) {
|
||||
return -1;
|
||||
}
|
||||
if ( bpp == 2 ) {
|
||||
*eip++ = PREFIX16;
|
||||
}
|
||||
*eip++ = load;
|
||||
pos -= 0x10000L;
|
||||
}
|
||||
if ( eip == fence ) {
|
||||
return -1;
|
||||
}
|
||||
if ( bpp == 2 ) {
|
||||
*eip++ = PREFIX16;
|
||||
}
|
||||
@@ -131,11 +138,6 @@ static int generate_rowbytes(int src_w, int dst_w, int bpp)
|
||||
}
|
||||
*eip++ = RETURN;
|
||||
|
||||
/* Verify that we didn't overflow (too late!!!) */
|
||||
if ( eip > (copy_row+sizeof(copy_row)) ) {
|
||||
SDL_SetError("Copy buffer overflow");
|
||||
return(-1);
|
||||
}
|
||||
#ifdef HAVE_MPROTECT
|
||||
/* Make the code executable but not writeable */
|
||||
if ( mprotect(copy_row, sizeof(copy_row), PROT_READ|PROT_EXEC) < 0 ) {
|
||||
|
||||
@@ -175,9 +175,9 @@ static SDL_VideoDevice *ANDROID_CreateDevice(int devindex)
|
||||
device->free = ANDROID_DeleteDevice;
|
||||
|
||||
// Stubs
|
||||
device->FreeWMCursor = ANDROID_FreeWMCursor;
|
||||
device->CreateWMCursor = ANDROID_CreateWMCursor;
|
||||
device->ShowWMCursor = ANDROID_ShowWMCursor;
|
||||
//device->FreeWMCursor = ANDROID_FreeWMCursor;
|
||||
//device->CreateWMCursor = ANDROID_CreateWMCursor;
|
||||
//device->ShowWMCursor = ANDROID_ShowWMCursor;
|
||||
//device->WarpWMCursor = ANDROID_WarpWMCursor;
|
||||
//device->MoveWMCursor = ANDROID_MoveWMCursor;
|
||||
|
||||
|
||||
@@ -57,7 +57,6 @@ static void BE_UnlockHWSurface(_THIS, SDL_Surface *surface);
|
||||
static void BE_FreeHWSurface(_THIS, SDL_Surface *surface);
|
||||
|
||||
static int BE_ToggleFullScreen(_THIS, int fullscreen);
|
||||
static SDL_Overlay *BE_CreateYUVOverlay(_THIS, int width, int height, Uint32 format, SDL_Surface *display);
|
||||
|
||||
/* OpenGL functions */
|
||||
#if SDL_VIDEO_OPENGL
|
||||
|
||||
@@ -62,7 +62,7 @@ struct private_yuvhwdata
|
||||
};
|
||||
|
||||
extern BBitmap * BE_GetOverlayBitmap(BRect bounds, color_space cs);
|
||||
SDL_Overlay* BE_CreateYUVOverlay(_THIS, int width, int height, Uint32 format, SDL_Surface* display);
|
||||
extern SDL_Overlay* BE_CreateYUVOverlay(_THIS, int width, int height, Uint32 format, SDL_Surface* display);
|
||||
extern int BE_LockYUVOverlay(_THIS, SDL_Overlay* overlay);
|
||||
extern void BE_UnlockYUVOverlay(_THIS, SDL_Overlay* overlay);
|
||||
extern int BE_DisplayYUVOverlay(_THIS, SDL_Overlay* overlay, SDL_Rect* src, SDL_Rect* dst);
|
||||
|
||||
@@ -67,25 +67,27 @@ void GEM_InitOSKeymap(_THIS)
|
||||
|
||||
void GEM_PumpEvents(_THIS)
|
||||
{
|
||||
short mousex, mousey, mouseb, dummy;
|
||||
short kstate, prevkc, prevks;
|
||||
short prevkc, prevks;
|
||||
static short maskmouseb=0;
|
||||
int i;
|
||||
SDL_keysym keysym;
|
||||
|
||||
SDL_memset(gem_currentkeyboard,0,sizeof(gem_currentkeyboard));
|
||||
prevkc = prevks = 0;
|
||||
|
||||
|
||||
for (;;)
|
||||
{
|
||||
int quit, resultat, event_mask, mouse_event;
|
||||
short buffer[8], kc;
|
||||
short x2,y2,w2,h2;
|
||||
short mousex, mousey, mouseb, dummy;
|
||||
short kstate;
|
||||
|
||||
quit =
|
||||
mouse_event =
|
||||
x2=y2=w2=h2 = 0;
|
||||
|
||||
event_mask = MU_MESAG|MU_TIMER|MU_KEYBD;
|
||||
event_mask = MU_MESAG|MU_TIMER|MU_KEYBD|MU_BUTTON;
|
||||
if (!GEM_fullscreen && (GEM_handle>=0)) {
|
||||
wind_get (GEM_handle, WF_WORKXYWH, &x2, &y2, &w2, &h2);
|
||||
event_mask |= MU_M1;
|
||||
@@ -95,12 +97,12 @@ void GEM_PumpEvents(_THIS)
|
||||
|
||||
resultat = evnt_multi(
|
||||
event_mask,
|
||||
0,0,0,
|
||||
0x101,7,maskmouseb,
|
||||
mouse_event,x2,y2,w2,h2,
|
||||
0,0,0,0,0,
|
||||
buffer,
|
||||
10,
|
||||
&dummy,&dummy,&dummy,&kstate,&kc,&dummy
|
||||
&mousex,&mousey,&mouseb,&kstate,&kc,&dummy
|
||||
);
|
||||
|
||||
/* Message event ? */
|
||||
@@ -127,15 +129,17 @@ void GEM_PumpEvents(_THIS)
|
||||
GEM_CheckMouseMode(this);
|
||||
}
|
||||
|
||||
/* Mouse button event ? */
|
||||
if (resultat & MU_BUTTON) {
|
||||
do_mouse(this, mousex, mousey, mouseb, kstate);
|
||||
maskmouseb = mouseb & 7;
|
||||
}
|
||||
|
||||
/* Timer event ? */
|
||||
if ((resultat & MU_TIMER) || quit)
|
||||
break;
|
||||
}
|
||||
|
||||
/* Update mouse */
|
||||
graf_mkstate(&mousex, &mousey, &mouseb, &kstate);
|
||||
do_mouse(this, mousex, mousey, mouseb, kstate);
|
||||
|
||||
/* Now generate keyboard events */
|
||||
for (i=0; i<ATARIBIOS_MAXKEYS; i++) {
|
||||
/* Key pressed ? */
|
||||
@@ -342,7 +346,7 @@ static void do_mouse(_THIS, short mx, short my, short mb, short ks)
|
||||
if (prevmouseb!=mb) {
|
||||
int i;
|
||||
|
||||
for (i=0;i<2;i++) {
|
||||
for (i=0;i<3;i++) {
|
||||
int curbutton, prevbutton;
|
||||
|
||||
curbutton = mb & (1<<i);
|
||||
|
||||
@@ -2,10 +2,6 @@
|
||||
#ifndef _directx_h
|
||||
#define _directx_h
|
||||
|
||||
#ifdef __GNUC__
|
||||
#define NONAMELESSUNION
|
||||
#endif
|
||||
|
||||
/* Include all of the DirectX 5.0 headers and adds any necessary tweaks */
|
||||
|
||||
#define WIN32_LEAN_AND_MEAN
|
||||
|
||||
@@ -441,8 +441,10 @@ printf("Mode: NotifyGrab\n");
|
||||
if ( xevent.xcrossing.mode == NotifyUngrab )
|
||||
printf("Mode: NotifyUngrab\n");
|
||||
#endif
|
||||
if ( xevent.xcrossing.detail != NotifyInferior ) {
|
||||
if ( this->input_grab == SDL_GRAB_OFF ) {
|
||||
if ( (xevent.xcrossing.mode != NotifyGrab) &&
|
||||
(xevent.xcrossing.mode != NotifyUngrab) &&
|
||||
(xevent.xcrossing.detail != NotifyInferior) ) {
|
||||
if ( this->input_grab == SDL_GRAB_OFF ) {
|
||||
posted = SDL_PrivateAppActive(0, SDL_APPMOUSEFOCUS);
|
||||
} else {
|
||||
posted = SDL_PrivateMouseMotion(0, 0,
|
||||
|
||||
@@ -512,27 +512,30 @@ int X11_GL_LoadLibrary(_THIS, const char* path)
|
||||
/* Unload the old driver and reset the pointers */
|
||||
X11_GL_UnloadLibrary(this);
|
||||
|
||||
/* Save the handle for X11_GL_GetProcAddress() */
|
||||
this->gl_config.dll_handle = handle;
|
||||
|
||||
/* Load new function pointers */
|
||||
this->gl_data->glXGetProcAddress =
|
||||
(void *(*)(const GLubyte *)) GL_LoadFunction(handle, "glXGetProcAddressARB");
|
||||
this->gl_data->glXChooseVisual =
|
||||
(XVisualInfo *(*)(Display *, int, int *)) GL_LoadFunction(handle, "glXChooseVisual");
|
||||
(XVisualInfo *(*)(Display *, int, int *)) X11_GL_GetProcAddress(this, "glXChooseVisual");
|
||||
this->gl_data->glXCreateContext =
|
||||
(GLXContext (*)(Display *, XVisualInfo *, GLXContext, int)) GL_LoadFunction(handle, "glXCreateContext");
|
||||
(GLXContext (*)(Display *, XVisualInfo *, GLXContext, int)) X11_GL_GetProcAddress(this, "glXCreateContext");
|
||||
this->gl_data->glXDestroyContext =
|
||||
(void (*)(Display *, GLXContext)) GL_LoadFunction(handle, "glXDestroyContext");
|
||||
(void (*)(Display *, GLXContext)) X11_GL_GetProcAddress(this, "glXDestroyContext");
|
||||
this->gl_data->glXMakeCurrent =
|
||||
(int (*)(Display *, GLXDrawable, GLXContext)) GL_LoadFunction(handle, "glXMakeCurrent");
|
||||
(int (*)(Display *, GLXDrawable, GLXContext)) X11_GL_GetProcAddress(this, "glXMakeCurrent");
|
||||
this->gl_data->glXSwapBuffers =
|
||||
(void (*)(Display *, GLXDrawable)) GL_LoadFunction(handle, "glXSwapBuffers");
|
||||
(void (*)(Display *, GLXDrawable)) X11_GL_GetProcAddress(this, "glXSwapBuffers");
|
||||
this->gl_data->glXGetConfig =
|
||||
(int (*)(Display *, XVisualInfo *, int, int *)) GL_LoadFunction(handle, "glXGetConfig");
|
||||
(int (*)(Display *, XVisualInfo *, int, int *)) X11_GL_GetProcAddress(this, "glXGetConfig");
|
||||
this->gl_data->glXQueryExtensionsString =
|
||||
(const char *(*)(Display *, int)) GL_LoadFunction(handle, "glXQueryExtensionsString");
|
||||
(const char *(*)(Display *, int)) X11_GL_GetProcAddress(this, "glXQueryExtensionsString");
|
||||
this->gl_data->glXSwapIntervalSGI =
|
||||
(int (*)(int)) GL_LoadFunction(handle, "glXSwapIntervalSGI");
|
||||
(int (*)(int)) X11_GL_GetProcAddress(this, "glXSwapIntervalSGI");
|
||||
this->gl_data->glXSwapIntervalMESA =
|
||||
(GLint (*)(unsigned)) GL_LoadFunction(handle, "glXSwapIntervalMESA");
|
||||
(GLint (*)(unsigned)) X11_GL_GetProcAddress(this, "glXSwapIntervalMESA");
|
||||
|
||||
if ( (this->gl_data->glXChooseVisual == NULL) ||
|
||||
(this->gl_data->glXCreateContext == NULL) ||
|
||||
@@ -541,11 +544,12 @@ int X11_GL_LoadLibrary(_THIS, const char* path)
|
||||
(this->gl_data->glXSwapBuffers == NULL) ||
|
||||
(this->gl_data->glXGetConfig == NULL) ||
|
||||
(this->gl_data->glXQueryExtensionsString == NULL)) {
|
||||
GL_UnloadObject(this->gl_config.dll_handle);
|
||||
this->gl_config.dll_handle = NULL;
|
||||
SDL_SetError("Could not retrieve OpenGL functions");
|
||||
return -1;
|
||||
}
|
||||
|
||||
this->gl_config.dll_handle = handle;
|
||||
this->gl_config.driver_loaded = 1;
|
||||
if ( path ) {
|
||||
SDL_strlcpy(this->gl_config.driver_path, path,
|
||||
@@ -558,13 +562,10 @@ int X11_GL_LoadLibrary(_THIS, const char* path)
|
||||
|
||||
void *X11_GL_GetProcAddress(_THIS, const char* proc)
|
||||
{
|
||||
void* handle;
|
||||
|
||||
handle = this->gl_config.dll_handle;
|
||||
if ( this->gl_data->glXGetProcAddress ) {
|
||||
return this->gl_data->glXGetProcAddress((const GLubyte *)proc);
|
||||
}
|
||||
return GL_LoadFunction(handle, proc);
|
||||
return GL_LoadFunction(this->gl_config.dll_handle, proc);
|
||||
}
|
||||
|
||||
#endif /* SDL_VIDEO_OPENGL_GLX */
|
||||
|
||||
@@ -230,6 +230,10 @@ void X11_CheckMouseModeNoLock(_THIS)
|
||||
char *env_override;
|
||||
int enable_relative = 1;
|
||||
|
||||
/* This happens when quiting after an xio error */
|
||||
if ( SDL_Display == NULL )
|
||||
return;
|
||||
|
||||
/* Allow the user to override the relative mouse mode.
|
||||
They almost never want to do this, as it seriously affects
|
||||
applications that rely on continuous relative mouse motion.
|
||||
|
||||
@@ -877,8 +877,7 @@ static void X11_SetSizeHints(_THIS, int w, int h, Uint32 flags)
|
||||
}
|
||||
/* Finally unset the transient hints if necessary */
|
||||
if ( ! set ) {
|
||||
/* NOTE: Does this work? */
|
||||
XSetTransientForHint(SDL_Display, WMwindow, None);
|
||||
XDeleteProperty(SDL_Display, WMwindow, XA_WM_TRANSIENT_FOR);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -329,7 +329,7 @@ SDL_GrabMode X11_GrabInputNoLock(_THIS, SDL_GrabMode mode)
|
||||
{
|
||||
int result;
|
||||
|
||||
if ( this->screen == NULL ) {
|
||||
if ( this->screen == NULL || SDL_Display == NULL ) {
|
||||
return(SDL_GRAB_OFF);
|
||||
}
|
||||
if ( ! SDL_Window ) {
|
||||
|
||||
Reference in New Issue
Block a user