diff --git a/alienblaster/project/jni/sdl/include/SDL_atomic.h b/alienblaster/project/jni/sdl/include/SDL_atomic.h index cd620c314..e3711433f 100644 --- a/alienblaster/project/jni/sdl/include/SDL_atomic.h +++ b/alienblaster/project/jni/sdl/include/SDL_atomic.h @@ -118,7 +118,7 @@ extern DECLSPEC Uint32 SDLCALL SDL_AtomicFetchThenIncrement32(volatile Uint32 * * * \return The value before it was decremented. * - * \param ptr Address of the value to fetch and drement + * \param ptr Address of the value to fetch and decrement */ extern DECLSPEC Uint32 SDLCALL SDL_AtomicFetchThenDecrement32(volatile Uint32 * ptr); diff --git a/alienblaster/project/jni/sdl/include/SDL_compat.h b/alienblaster/project/jni/sdl/include/SDL_compat.h index 3b7a7acf7..1af228ac5 100644 --- a/alienblaster/project/jni/sdl/include/SDL_compat.h +++ b/alienblaster/project/jni/sdl/include/SDL_compat.h @@ -324,6 +324,7 @@ extern DECLSPEC int SDLCALL SDL_EnableUNICODE(int enable); #define SDL_RenderPoint SDL_RenderDrawPoint #define SDL_RenderLine SDL_RenderDrawLine #define SDL_RenderFill(X) (X) ? SDL_RenderFillRect(X) : SDL_RenderClear() +#define SDL_KillThread(X) extern DECLSPEC int SDLCALL SDL_putenv(const char *variable); diff --git a/alienblaster/project/jni/sdl/include/SDL_config_pandora.h b/alienblaster/project/jni/sdl/include/SDL_config_pandora.h index 227831e63..fbdec93e1 100644 --- a/alienblaster/project/jni/sdl/include/SDL_config_pandora.h +++ b/alienblaster/project/jni/sdl/include/SDL_config_pandora.h @@ -28,6 +28,12 @@ /* General platform specific identifiers */ #include "SDL_platform.h" +#ifdef __LP64__ +#define SIZEOF_VOIDP 8 +#else +#define SIZEOF_VOIDP 4 +#endif + #define SDL_HAS_64BIT_TYPE 1 #define SDL_BYTEORDER 1234 diff --git a/alienblaster/project/jni/sdl/include/SDL_mutex.h b/alienblaster/project/jni/sdl/include/SDL_mutex.h index dcafbb7e2..e066f944b 100644 --- a/alienblaster/project/jni/sdl/include/SDL_mutex.h +++ b/alienblaster/project/jni/sdl/include/SDL_mutex.h @@ -194,7 +194,7 @@ extern DECLSPEC int SDLCALL SDL_CondBroadcast(SDL_cond * cond); * * \return 0 when it is signaled, or -1 on error. */ -extern DECLSPEC int SDLCALL SDL_CondWait(SDL_cond * cond, SDL_mutex * mut); +extern DECLSPEC int SDLCALL SDL_CondWait(SDL_cond * cond, SDL_mutex * mutex); /** * Waits for at most \c ms milliseconds, and returns 0 if the condition diff --git a/alienblaster/project/jni/sdl/include/SDL_revision.h b/alienblaster/project/jni/sdl/include/SDL_revision.h index 3af3861e3..20ca5cbfd 100644 --- a/alienblaster/project/jni/sdl/include/SDL_revision.h +++ b/alienblaster/project/jni/sdl/include/SDL_revision.h @@ -1 +1 @@ -#define SDL_REVISION "hg-4467:0baef09fe702" +#define SDL_REVISION "hg-4485:82d661ea0d5a" diff --git a/alienblaster/project/jni/sdl/include/SDL_thread.h b/alienblaster/project/jni/sdl/include/SDL_thread.h index fc3d36d75..cca172dee 100644 --- a/alienblaster/project/jni/sdl/include/SDL_thread.h +++ b/alienblaster/project/jni/sdl/include/SDL_thread.h @@ -149,16 +149,6 @@ extern DECLSPEC SDL_threadID SDLCALL SDL_GetThreadID(SDL_Thread * thread); */ extern DECLSPEC void SDLCALL SDL_WaitThread(SDL_Thread * thread, int *status); -/** - * \deprecated This function is here for binary compatibility with legacy apps, - * but in SDL 1.3 and later, it's a no-op. - * - * You cannot forcibly kill a thread in a safe manner on many platforms. You - * should instead find a way to alert your thread that it is time to terminate, - * and then have it gracefully exit on its own. Do not ever call this function! - */ -extern DECLSPEC void SDLCALL SDL_KillThread(SDL_Thread * thread); - /* Ends C function definitions when using C++ */ #ifdef __cplusplus diff --git a/alienblaster/project/jni/sdl/src/SDL.c b/alienblaster/project/jni/sdl/src/SDL.c index 52f141578..49620a8e1 100644 --- a/alienblaster/project/jni/sdl/src/SDL.c +++ b/alienblaster/project/jni/sdl/src/SDL.c @@ -25,21 +25,15 @@ #include "SDL.h" #include "SDL_fatal.h" -#include "SDL_assert.h" +#include "SDL_assert_c.h" +#include "haptic/SDL_haptic_c.h" +#include "joystick/SDL_joystick_c.h" #if !SDL_VIDEO_DISABLED #include "video/SDL_leaks.h" #endif /* Initialization/Cleanup routines */ -#if !SDL_JOYSTICK_DISABLED -extern int SDL_JoystickInit(void); -extern void SDL_JoystickQuit(void); -#endif -#if !SDL_HAPTIC_DISABLED -extern int SDL_HapticInit(void); -extern int SDL_HapticQuit(void); -#endif #if !SDL_TIMERS_DISABLED extern void SDL_StartTicks(void); extern int SDL_TimerInit(void); @@ -50,8 +44,6 @@ extern int SDL_HelperWindowCreate(void); extern int SDL_HelperWindowDestroy(void); #endif -extern int SDL_AssertionsInit(void); -extern void SDL_AssertionsQuit(void); /* The initialized subsystems */ static Uint32 SDL_initialized = 0; diff --git a/alienblaster/project/jni/sdl/src/SDL_assert.c b/alienblaster/project/jni/sdl/src/SDL_assert.c index 34cf45868..0c433d80a 100644 --- a/alienblaster/project/jni/sdl/src/SDL_assert.c +++ b/alienblaster/project/jni/sdl/src/SDL_assert.c @@ -22,6 +22,7 @@ #include "SDL.h" #include "SDL_assert.h" +#include "SDL_assert_c.h" #include "video/SDL_sysvideo.h" #ifdef _WINDOWS diff --git a/alienblaster/project/jni/sdl/src/SDL_assert_c.h b/alienblaster/project/jni/sdl/src/SDL_assert_c.h new file mode 100644 index 000000000..eb14cfbe0 --- /dev/null +++ b/alienblaster/project/jni/sdl/src/SDL_assert_c.h @@ -0,0 +1,26 @@ +/* + SDL - Simple DirectMedia Layer + Copyright (C) 1997-2010 Sam Lantinga + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this library; if not, write to the Free Software + Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + + Sam Lantinga + slouken@libsdl.org +*/ + +extern int SDL_AssertionsInit(void); +extern void SDL_AssertionsQuit(void); + +/* vi: set ts=4 sw=4 expandtab: */ diff --git a/alienblaster/project/jni/sdl/src/SDL_compat.c b/alienblaster/project/jni/sdl/src/SDL_compat.c index 0c094e8a7..bb8e46ba8 100644 --- a/alienblaster/project/jni/sdl/src/SDL_compat.c +++ b/alienblaster/project/jni/sdl/src/SDL_compat.c @@ -417,7 +417,7 @@ SetupScreenSaver(int flags) } } -int +static int SDL_ResizeVideoMode(int width, int height, int bpp, Uint32 flags) { int w, h; @@ -1750,7 +1750,6 @@ SDL_EnableUNICODE(int enable) return previous; } - int SDL_putenv(const char *_var) { diff --git a/alienblaster/project/jni/sdl/src/SDL_error.c b/alienblaster/project/jni/sdl/src/SDL_error.c index 12ae27fe2..86ac39fd9 100644 --- a/alienblaster/project/jni/sdl/src/SDL_error.c +++ b/alienblaster/project/jni/sdl/src/SDL_error.c @@ -123,7 +123,7 @@ SDL_SetError(const char *fmt, ...) /* This function has a bit more overhead than most error functions so that it supports internationalization and thread-safe errors. */ -char * +static char * SDL_GetErrorMsg(char *errstr, unsigned int maxlen) { SDL_error *error; diff --git a/alienblaster/project/jni/sdl/src/SDL_error_c.h b/alienblaster/project/jni/sdl/src/SDL_error_c.h index bdb59517a..54501f5fa 100644 --- a/alienblaster/project/jni/sdl/src/SDL_error_c.h +++ b/alienblaster/project/jni/sdl/src/SDL_error_c.h @@ -58,4 +58,5 @@ typedef struct SDL_error } SDL_error; #endif /* _SDL_error_c_h */ + /* vi: set ts=4 sw=4 expandtab: */ diff --git a/alienblaster/project/jni/sdl/src/audio/SDL_audio.c b/alienblaster/project/jni/sdl/src/audio/SDL_audio.c index 6ce18145c..606db26a7 100644 --- a/alienblaster/project/jni/sdl/src/audio/SDL_audio.c +++ b/alienblaster/project/jni/sdl/src/audio/SDL_audio.c @@ -261,7 +261,7 @@ finalize_audio_entry_points(void) /* Streaming functions (for when the input and output buffer sizes are different) */ /* Write [length] bytes from buf into the streamer */ -void +static void SDL_StreamWrite(SDL_AudioStreamer * stream, Uint8 * buf, int length) { int i; @@ -273,7 +273,7 @@ SDL_StreamWrite(SDL_AudioStreamer * stream, Uint8 * buf, int length) } /* Read [length] bytes out of the streamer into buf */ -void +static void SDL_StreamRead(SDL_AudioStreamer * stream, Uint8 * buf, int length) { int i; @@ -284,14 +284,14 @@ SDL_StreamRead(SDL_AudioStreamer * stream, Uint8 * buf, int length) } } -int +static int SDL_StreamLength(SDL_AudioStreamer * stream) { return (stream->write_pos - stream->read_pos) % stream->max_len; } /* Initialize the stream by allocating the buffer and setting the read/write heads to the beginning */ -int +static int SDL_StreamInit(SDL_AudioStreamer * stream, int max_len, Uint8 silence) { /* First try to allocate the buffer */ @@ -311,7 +311,7 @@ SDL_StreamInit(SDL_AudioStreamer * stream, int max_len, Uint8 silence) } /* Deinitialize the stream simply by freeing the buffer */ -void +static void SDL_StreamDeinit(SDL_AudioStreamer * stream) { if (stream->buffer != NULL) { diff --git a/alienblaster/project/jni/sdl/src/cpuinfo/SDL_cpuinfo.c b/alienblaster/project/jni/sdl/src/cpuinfo/SDL_cpuinfo.c index f631e4faf..7fa382818 100644 --- a/alienblaster/project/jni/sdl/src/cpuinfo/SDL_cpuinfo.c +++ b/alienblaster/project/jni/sdl/src/cpuinfo/SDL_cpuinfo.c @@ -335,7 +335,7 @@ SDL_GetCPUCount() } /* Oh, such a sweet sweet trick, just not very useful. :) */ -const char * +static const char * SDL_GetCPUType() { static char SDL_CPUType[48]; diff --git a/alienblaster/project/jni/sdl/src/events/SDL_mouse.c b/alienblaster/project/jni/sdl/src/events/SDL_mouse.c index e8a9ccd75..87e47479b 100644 --- a/alienblaster/project/jni/sdl/src/events/SDL_mouse.c +++ b/alienblaster/project/jni/sdl/src/events/SDL_mouse.c @@ -112,7 +112,7 @@ SDL_SetMouseFocus(SDL_Window * window) } int -SDL_SendMouseMotion(int relative, int x, int y) +SDL_SendMouseMotion(SDL_Window * window, int relative, int x, int y) { SDL_Mouse *mouse = &SDL_mouse; int posted; @@ -120,6 +120,10 @@ SDL_SendMouseMotion(int relative, int x, int y) int yrel; int x_max = 0, y_max = 0; + if (window) { + SDL_SetMouseFocus(window); + } + /* the relative motion is calculated regarding the system cursor last position */ if (relative) { xrel = x; @@ -194,12 +198,16 @@ SDL_SendMouseMotion(int relative, int x, int y) } int -SDL_SendMouseButton(Uint8 state, Uint8 button) +SDL_SendMouseButton(SDL_Window * window, Uint8 state, Uint8 button) { SDL_Mouse *mouse = &SDL_mouse; int posted; Uint32 type; + if (window) { + SDL_SetMouseFocus(window); + } + /* Figure out which event to perform */ switch (state) { case SDL_PRESSED: @@ -239,11 +247,15 @@ SDL_SendMouseButton(Uint8 state, Uint8 button) } int -SDL_SendMouseWheel(int x, int y) +SDL_SendMouseWheel(SDL_Window * window, int x, int y) { SDL_Mouse *mouse = &SDL_mouse; int posted; + if (window) { + SDL_SetMouseFocus(window); + } + if (!x && !y) { return 0; } @@ -304,8 +316,7 @@ SDL_WarpMouseInWindow(SDL_Window * window, int x, int y) if (mouse->WarpMouse) { mouse->WarpMouse(mouse, window, x, y); } else { - SDL_SetMouseFocus(window); - SDL_SendMouseMotion(0, x, y); + SDL_SendMouseMotion(window, 0, x, y); } } diff --git a/alienblaster/project/jni/sdl/src/events/SDL_mouse_c.h b/alienblaster/project/jni/sdl/src/events/SDL_mouse_c.h index 284468fa9..0f0f6de54 100644 --- a/alienblaster/project/jni/sdl/src/events/SDL_mouse_c.h +++ b/alienblaster/project/jni/sdl/src/events/SDL_mouse_c.h @@ -40,13 +40,13 @@ extern void SDL_ResetMouse(void); extern void SDL_SetMouseFocus(SDL_Window * window); /* Send a mouse motion event */ -extern int SDL_SendMouseMotion(int relative, int x, int y); +extern int SDL_SendMouseMotion(SDL_Window * window, int relative, int x, int y); /* Send a mouse button event */ -extern int SDL_SendMouseButton(Uint8 state, Uint8 button); +extern int SDL_SendMouseButton(SDL_Window * window, Uint8 state, Uint8 button); /* Send a mouse wheel event */ -extern int SDL_SendMouseWheel(int x, int y); +extern int SDL_SendMouseWheel(SDL_Window * window, int x, int y); /* Shutdown the mouse subsystem */ extern void SDL_MouseQuit(void); diff --git a/alienblaster/project/jni/sdl/src/file/cocoa/SDL_rwopsbundlesupport.m b/alienblaster/project/jni/sdl/src/file/cocoa/SDL_rwopsbundlesupport.m index d9ce0210a..39b4c0e9c 100644 --- a/alienblaster/project/jni/sdl/src/file/cocoa/SDL_rwopsbundlesupport.m +++ b/alienblaster/project/jni/sdl/src/file/cocoa/SDL_rwopsbundlesupport.m @@ -1,6 +1,8 @@ #ifdef __APPLE__ #import +#include "SDL_rwopsbundlesupport.h" + /* For proper OS X applications, the resources are contained inside the application bundle. So the strategy is to first check the application bundle for the file, then fallback to the current working directory. Note: One additional corner-case is if the resource is in a framework's resource bundle instead of the app. diff --git a/alienblaster/project/jni/sdl/src/haptic/SDL_haptic.c b/alienblaster/project/jni/sdl/src/haptic/SDL_haptic.c index 2ac4a12b6..af8c39a77 100644 --- a/alienblaster/project/jni/sdl/src/haptic/SDL_haptic.c +++ b/alienblaster/project/jni/sdl/src/haptic/SDL_haptic.c @@ -22,6 +22,7 @@ #include "SDL_config.h" #include "SDL_syshaptic.h" +#include "SDL_haptic_c.h" #include "../joystick/SDL_joystick_c.h" /* For SDL_PrivateJoystickValid */ diff --git a/alienblaster/project/jni/sdl/src/haptic/SDL_haptic_c.h b/alienblaster/project/jni/sdl/src/haptic/SDL_haptic_c.h new file mode 100644 index 000000000..4144a0fbc --- /dev/null +++ b/alienblaster/project/jni/sdl/src/haptic/SDL_haptic_c.h @@ -0,0 +1,26 @@ +/* + SDL - Simple DirectMedia Layer + Copyright (C) 1997-2010 Sam Lantinga + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this library; if not, write to the Free Software + Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + + Sam Lantinga + slouken@libsdl.org +*/ + +extern int SDL_HapticInit(void); +extern void SDL_HapticQuit(void); + +/* vi: set ts=4 sw=4 expandtab: */ diff --git a/alienblaster/project/jni/sdl/src/joystick/SDL_joystick_c.h b/alienblaster/project/jni/sdl/src/joystick/SDL_joystick_c.h index a384b3b8e..e0f8529e2 100644 --- a/alienblaster/project/jni/sdl/src/joystick/SDL_joystick_c.h +++ b/alienblaster/project/jni/sdl/src/joystick/SDL_joystick_c.h @@ -27,6 +27,10 @@ /* The number of available joysticks on the system */ extern Uint8 SDL_numjoysticks; +/* Initialization and shutdown functions */ +extern int SDL_JoystickInit(void); +extern void SDL_JoystickQuit(void); + /* Internal event queueing functions */ extern int SDL_PrivateJoystickAxis(SDL_Joystick * joystick, Uint8 axis, Sint16 value); diff --git a/alienblaster/project/jni/sdl/src/main/dummy/SDL_dummy_main.c b/alienblaster/project/jni/sdl/src/main/dummy/SDL_dummy_main.c index e7c2bb6c9..e5a1351f1 100644 --- a/alienblaster/project/jni/sdl/src/main/dummy/SDL_dummy_main.c +++ b/alienblaster/project/jni/sdl/src/main/dummy/SDL_dummy_main.c @@ -12,7 +12,10 @@ main(int argc, char *argv[]) #else /* Nothing to do on this platform */ int -SDL_main_stub_symbol() +SDL_main_stub_symbol(void); + +int +SDL_main_stub_symbol(void) { return 0; } diff --git a/alienblaster/project/jni/sdl/src/thread/SDL_thread.c b/alienblaster/project/jni/sdl/src/thread/SDL_thread.c index 08181cac9..71a660e83 100644 --- a/alienblaster/project/jni/sdl/src/thread/SDL_thread.c +++ b/alienblaster/project/jni/sdl/src/thread/SDL_thread.c @@ -38,7 +38,7 @@ static int SDL_numthreads = 0; static SDL_Thread **SDL_Threads = NULL; static SDL_mutex *thread_lock = NULL; -int +static int SDL_ThreadsInit(void) { int retval; @@ -56,7 +56,7 @@ SDL_ThreadsInit(void) clean up threads here. If any threads are still running after this call, they will no longer have access to any per-thread data. */ -void +static void SDL_ThreadsQuit(void) { SDL_mutex *mutex; @@ -305,10 +305,4 @@ SDL_GetThreadID(SDL_Thread * thread) return id; } -void -SDL_KillThread(SDL_Thread * thread) -{ - /* This is a no-op in SDL 1.3 and later. */ -} - /* vi: set ts=4 sw=4 expandtab: */ diff --git a/alienblaster/project/jni/sdl/src/thread/win32/SDL_syssem.c b/alienblaster/project/jni/sdl/src/thread/win32/SDL_syssem.c index 67551e128..4fcb8c6e1 100644 --- a/alienblaster/project/jni/sdl/src/thread/win32/SDL_syssem.c +++ b/alienblaster/project/jni/sdl/src/thread/win32/SDL_syssem.c @@ -39,7 +39,7 @@ struct SDL_semaphore #else HANDLE id; #endif - Uint32 volatile count; + LONG volatile count; }; @@ -143,7 +143,7 @@ SDL_SemValue(SDL_sem * sem) SDL_SetError("Passed a NULL sem"); return 0; } - return sem->count; + return (Uint32)sem->count; } int diff --git a/alienblaster/project/jni/sdl/src/video/SDL_blit_slow.c b/alienblaster/project/jni/sdl/src/video/SDL_blit_slow.c index 4e270e15f..d9b43fd23 100644 --- a/alienblaster/project/jni/sdl/src/video/SDL_blit_slow.c +++ b/alienblaster/project/jni/sdl/src/video/SDL_blit_slow.c @@ -23,6 +23,7 @@ #include "SDL_video.h" #include "SDL_blit.h" +#include "SDL_blit_slow.h" /* The ONE TRUE BLITTER * This puppy has to handle all the unoptimized cases - yes, it's slow. diff --git a/alienblaster/project/jni/sdl/src/video/SDL_renderer_sw.c b/alienblaster/project/jni/sdl/src/video/SDL_renderer_sw.c index fcc902b0a..a9911f35d 100644 --- a/alienblaster/project/jni/sdl/src/video/SDL_renderer_sw.c +++ b/alienblaster/project/jni/sdl/src/video/SDL_renderer_sw.c @@ -26,6 +26,7 @@ #include "SDL_pixels_c.h" #include "SDL_rect_c.h" #include "SDL_yuv_sw_c.h" +#include "SDL_renderer_sw.h" /* SDL surface based renderer implementation */ diff --git a/alienblaster/project/jni/sdl/src/video/SDL_stretch.c b/alienblaster/project/jni/sdl/src/video/SDL_stretch.c index b0ad3a991..818d0dedc 100644 --- a/alienblaster/project/jni/sdl/src/video/SDL_stretch.c +++ b/alienblaster/project/jni/sdl/src/video/SDL_stretch.c @@ -151,7 +151,7 @@ generate_rowbytes(int src_w, int dst_w, int bpp) #endif /* USE_ASM_STRETCH */ #define DEFINE_COPY_ROW(name, type) \ -void name(type *src, int src_w, type *dst, int dst_w) \ +static void name(type *src, int src_w, type *dst, int dst_w) \ { \ int i; \ int pos, inc; \ @@ -175,7 +175,7 @@ DEFINE_COPY_ROW(copy_row4, Uint32) /* *INDENT-ON* */ /* The ASM code doesn't handle 24-bpp stretch blits */ -void +static void copy_row3(Uint8 * src, int src_w, Uint8 * dst, int dst_w) { int i; diff --git a/alienblaster/project/jni/sdl/src/video/SDL_sysvideo.h b/alienblaster/project/jni/sdl/src/video/SDL_sysvideo.h index e6f0291dd..121f413de 100644 --- a/alienblaster/project/jni/sdl/src/video/SDL_sysvideo.h +++ b/alienblaster/project/jni/sdl/src/video/SDL_sysvideo.h @@ -423,7 +423,7 @@ extern VideoBootStrap PND_bootstrap; #define SDL_CurrentDisplay (&_this->displays[_this->current_display]) #define SDL_CurrentRenderer (SDL_CurrentDisplay->current_renderer) -extern SDL_VideoDevice *SDL_GetVideoDevice(); +extern SDL_VideoDevice *SDL_GetVideoDevice(void); extern int SDL_AddBasicVideoDisplay(const SDL_DisplayMode * desktop_mode); extern int SDL_AddVideoDisplay(const SDL_VideoDisplay * display); extern SDL_bool SDL_AddDisplayMode(SDL_VideoDisplay *display, const SDL_DisplayMode * mode); diff --git a/alienblaster/project/jni/sdl/src/video/SDL_video.c b/alienblaster/project/jni/sdl/src/video/SDL_video.c index 39ccd7b29..0b85cb81e 100644 --- a/alienblaster/project/jni/sdl/src/video/SDL_video.c +++ b/alienblaster/project/jni/sdl/src/video/SDL_video.c @@ -307,7 +307,7 @@ SDL_GetCurrentVideoDriver() } SDL_VideoDevice * -SDL_GetVideoDevice() +SDL_GetVideoDevice(void) { return _this; } @@ -720,16 +720,6 @@ SDL_SetDisplayModeForDisplay(SDL_VideoDisplay * display, const SDL_DisplayMode * return 0; } -int -SDL_SetDisplayMode(const SDL_DisplayMode * mode) -{ - if (!_this) { - SDL_UninitializedVideo(); - return -1; - } - return SDL_SetDisplayModeForDisplay(SDL_CurrentDisplay, mode); -} - int SDL_SetWindowDisplayMode(SDL_Window * window, const SDL_DisplayMode * mode) { diff --git a/alienblaster/project/jni/sdl/src/video/cocoa/SDL_cocoamouse.m b/alienblaster/project/jni/sdl/src/video/cocoa/SDL_cocoamouse.m index 02ad198b4..e3d70bfac 100644 --- a/alienblaster/project/jni/sdl/src/video/cocoa/SDL_cocoamouse.m +++ b/alienblaster/project/jni/sdl/src/video/cocoa/SDL_cocoamouse.m @@ -52,6 +52,7 @@ Cocoa_HandleMouseEvent(_THIS, NSEvent *event) int i; NSPoint point = { 0, 0 }; SDL_Window *window; + SDL_Window *focus = SDL_GetMouseFocus(); /* See if there are any fullscreen windows that might handle this event */ window = NULL; @@ -66,19 +67,18 @@ Cocoa_HandleMouseEvent(_THIS, NSEvent *event) point = [NSEvent mouseLocation]; point.x = point.x - bounds.x; point.y = CGDisplayPixelsHigh(kCGDirectMainDisplay) - point.y - bounds.y; - if ((point.x >= 0 && point.x < candidate->w) || + if ((point.x >= 0 && point.x < candidate->w) && (point.y >= 0 && point.y < candidate->h)) { /* This is it! */ window = candidate; break; + } else if (candidate == focus) { + SDL_SetMouseFocus(NULL); } } } - /* Set the focus appropriately */ - SDL_SetMouseFocus(window); - - if (window) { + if (!window) { return; } @@ -86,18 +86,18 @@ Cocoa_HandleMouseEvent(_THIS, NSEvent *event) case NSLeftMouseDown: case NSOtherMouseDown: case NSRightMouseDown: - SDL_SendMouseButton(SDL_PRESSED, ConvertMouseButtonToSDL([event buttonNumber])); + SDL_SendMouseButton(window, SDL_PRESSED, ConvertMouseButtonToSDL([event buttonNumber])); break; case NSLeftMouseUp: case NSOtherMouseUp: case NSRightMouseUp: - SDL_SendMouseButton(SDL_RELEASED, ConvertMouseButtonToSDL([event buttonNumber])); + SDL_SendMouseButton(window, SDL_RELEASED, ConvertMouseButtonToSDL([event buttonNumber])); break; case NSLeftMouseDragged: case NSRightMouseDragged: case NSOtherMouseDragged: /* usually middle mouse dragged */ case NSMouseMoved: - SDL_SendMouseMotion(0, (int)point.x, (int)point.y); + SDL_SendMouseMotion(window, 0, (int)point.x, (int)point.y); break; default: /* just to avoid compiler warnings */ break; diff --git a/alienblaster/project/jni/sdl/src/video/cocoa/SDL_cocoawindow.m b/alienblaster/project/jni/sdl/src/video/cocoa/SDL_cocoawindow.m index 1f3fc515e..be4045c89 100644 --- a/alienblaster/project/jni/sdl/src/video/cocoa/SDL_cocoawindow.m +++ b/alienblaster/project/jni/sdl/src/video/cocoa/SDL_cocoawindow.m @@ -171,7 +171,7 @@ static __inline__ void ConvertNSRect(NSRect *r) button = [theEvent buttonNumber]; break; } - SDL_SendMouseButton(SDL_PRESSED, button); + SDL_SendMouseButton(_data->window, SDL_PRESSED, button); } - (void)rightMouseDown:(NSEvent *)theEvent @@ -202,7 +202,7 @@ static __inline__ void ConvertNSRect(NSRect *r) button = [theEvent buttonNumber]; break; } - SDL_SendMouseButton(SDL_RELEASED, button); + SDL_SendMouseButton(_data->window, SDL_RELEASED, button); } - (void)rightMouseUp:(NSEvent *)theEvent @@ -228,8 +228,7 @@ static __inline__ void ConvertNSRect(NSRect *r) SDL_SetMouseFocus(NULL); } } else { - SDL_SetMouseFocus(_data->window); - SDL_SendMouseMotion(0, (int)point.x, (int)point.y); + SDL_SendMouseMotion(window, 0, (int)point.x, (int)point.y); } } @@ -250,7 +249,20 @@ static __inline__ void ConvertNSRect(NSRect *r) - (void)scrollWheel:(NSEvent *)theEvent { - SDL_SendMouseWheel((int)([theEvent deltaX]+0.9f), (int)([theEvent deltaY]+0.9f)); + float x = [theEvent deltaX]; + float y = [theEvent deltaY]; + + if (x > 0) { + x += 0.9f; + } else if (x < 0) { + x -= 0.9f; + } + if (y > 0) { + y += 0.9f; + } else if (y < 0) { + y -= 0.9f; + } + SDL_SendMouseWheel(_data->window, (int)x, (int)y); } @end diff --git a/alienblaster/project/jni/sdl/src/video/pandora/SDL_pandora.h b/alienblaster/project/jni/sdl/src/video/pandora/SDL_pandora.h index 759fc39e4..8597baa07 100644 --- a/alienblaster/project/jni/sdl/src/video/pandora/SDL_pandora.h +++ b/alienblaster/project/jni/sdl/src/video/pandora/SDL_pandora.h @@ -68,8 +68,8 @@ typedef struct SDL_WindowData /* Display and window functions */ int PND_videoinit(_THIS); void PND_videoquit(_THIS); -void PND_getdisplaymodes(_THIS); -int PND_setdisplaymode(_THIS, SDL_DisplayMode * mode); +void PND_getdisplaymodes(_THIS, SDL_VideoDisplay * display); +int PND_setdisplaymode(_THIS, SDL_VideoDisplay * display, SDL_DisplayMode * mode); int PND_setdisplaypalette(_THIS, SDL_Palette * palette); int PND_getdisplaypalette(_THIS, SDL_Palette * palette); int PND_setdisplaygammaramp(_THIS, Uint16 * ramp); diff --git a/alienblaster/project/jni/sdl/src/video/uikit/jumphack.c b/alienblaster/project/jni/sdl/src/video/uikit/jumphack.c index 103c4e97a..982ddda3e 100644 --- a/alienblaster/project/jni/sdl/src/video/uikit/jumphack.c +++ b/alienblaster/project/jni/sdl/src/video/uikit/jumphack.c @@ -13,7 +13,7 @@ jmp_buf env; /* returns the jump environment for setting / getting purposes */ jmp_buf * -jump_env() +jump_env(void) { return &env; } diff --git a/alienblaster/project/jni/sdl/src/video/uikit/jumphack.h b/alienblaster/project/jni/sdl/src/video/uikit/jumphack.h index d2b7ceb0d..b517e6355 100644 --- a/alienblaster/project/jni/sdl/src/video/uikit/jumphack.h +++ b/alienblaster/project/jni/sdl/src/video/uikit/jumphack.h @@ -11,6 +11,6 @@ /* see SDL_uikitevents.m for more info */ -extern jmp_buf *jump_env(); +extern jmp_buf *jump_env(void); #endif diff --git a/alienblaster/project/jni/sdl/src/video/win32/SDL_win32events.c b/alienblaster/project/jni/sdl/src/video/win32/SDL_win32events.c index ed025a254..1ea7e6c10 100644 --- a/alienblaster/project/jni/sdl/src/video/win32/SDL_win32events.c +++ b/alienblaster/project/jni/sdl/src/video/win32/SDL_win32events.c @@ -176,23 +176,21 @@ WIN_WindowProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam) returnCode = 0; break; - case WM_MOUSEMOVE: - SDL_SendMouseMotion(0, LOWORD(lParam), HIWORD(lParam)); + case WM_MOUSEMOVE: + SDL_SendMouseMotion(data->window, 0, LOWORD(lParam), HIWORD(lParam)); break; case WM_LBUTTONDOWN: - SDL_SendMouseButton(SDL_PRESSED, SDL_BUTTON_LEFT); + SDL_SendMouseButton(data->window, SDL_PRESSED, SDL_BUTTON_LEFT); break; case WM_LBUTTONUP: - SDL_SendMouseButton(SDL_RELEASED, SDL_BUTTON_LEFT); + SDL_SendMouseButton(data->window, SDL_RELEASED, SDL_BUTTON_LEFT); break; case WM_MOUSELEAVE: - { - if (SDL_GetMouseFocus() == data->window) { - SDL_SetMouseFocus(NULL); - } + if (SDL_GetMouseFocus() == data->window) { + SDL_SetMouseFocus(NULL); } returnCode = 0; break; diff --git a/alienblaster/project/jni/sdl/src/video/x11/SDL_x11events.c b/alienblaster/project/jni/sdl/src/video/x11/SDL_x11events.c index 6b7003994..147dc626d 100644 --- a/alienblaster/project/jni/sdl/src/video/x11/SDL_x11events.c +++ b/alienblaster/project/jni/sdl/src/video/x11/SDL_x11events.c @@ -272,17 +272,17 @@ X11_DispatchEvent(_THIS) #ifdef DEBUG_MOTION printf("X11 motion: %d,%d\n", xevent.xmotion.x, xevent.xmotion.y); #endif - SDL_SendMouseMotion(0, xevent.xmotion.x, xevent.xmotion.y); + SDL_SendMouseMotion(data->window, 0, xevent.xmotion.x, xevent.xmotion.y); } break; case ButtonPress:{ - SDL_SendMouseButton(SDL_PRESSED, xevent.xbutton.button); + SDL_SendMouseButton(data->window, SDL_PRESSED, xevent.xbutton.button); } break; case ButtonRelease:{ - SDL_SendMouseButton(SDL_RELEASED, xevent.xbutton.button); + SDL_SendMouseButton(data->window, SDL_RELEASED, xevent.xbutton.button); } break; @@ -296,7 +296,7 @@ X11_DispatchEvent(_THIS) } /* Ack! XPending() actually performs a blocking read if no events available */ -int +static int X11_Pending(Display * display) { /* Flush the display connection and look to see if events are queued */ diff --git a/alienblaster/project/jni/sdl/src/video/x11/SDL_x11render.c b/alienblaster/project/jni/sdl/src/video/x11/SDL_x11render.c index dcc26c1dc..a1027f925 100644 --- a/alienblaster/project/jni/sdl/src/video/x11/SDL_x11render.c +++ b/alienblaster/project/jni/sdl/src/video/x11/SDL_x11render.c @@ -26,6 +26,7 @@ #include /* For INT_MIN and INT_MAX */ #include "SDL_x11video.h" +#include "SDL_x11render.h" #include "../SDL_rect_c.h" #include "../SDL_pixels_c.h" #include "../SDL_yuv_sw_c.h" diff --git a/alienblaster/project/jni/sdl/src/video/x11/SDL_x11video.c b/alienblaster/project/jni/sdl/src/video/x11/SDL_x11video.c index 2494bce39..86a9e7db9 100644 --- a/alienblaster/project/jni/sdl/src/video/x11/SDL_x11video.c +++ b/alienblaster/project/jni/sdl/src/video/x11/SDL_x11video.c @@ -292,7 +292,7 @@ X11_VideoQuit(_THIS) } SDL_bool -X11_UseDirectColorVisuals() +X11_UseDirectColorVisuals(void) { /* Once we implement DirectColor colormaps and gamma ramp support... return SDL_getenv("SDL_VIDEO_X11_NODIRECTCOLOR") ? SDL_FALSE : SDL_TRUE; diff --git a/alienblaster/project/jni/sdl/src/video/x11/SDL_x11video.h b/alienblaster/project/jni/sdl/src/video/x11/SDL_x11video.h index 9989911c9..a550f8485 100644 --- a/alienblaster/project/jni/sdl/src/video/x11/SDL_x11video.h +++ b/alienblaster/project/jni/sdl/src/video/x11/SDL_x11video.h @@ -71,7 +71,7 @@ typedef struct SDL_VideoData SDL_scancode key_layout[256]; } SDL_VideoData; -extern SDL_bool X11_UseDirectColorVisuals(); +extern SDL_bool X11_UseDirectColorVisuals(void); #endif /* _SDL_x11video_h */