diff --git a/bin_win32/SDL2.dll b/bin_win32/SDL2.dll index 105074ea..c21f747c 100755 Binary files a/bin_win32/SDL2.dll and b/bin_win32/SDL2.dll differ diff --git a/source/include/SDL.h b/source/include/SDL.h old mode 100644 new mode 100755 diff --git a/source/include/SDL_assert.h b/source/include/SDL_assert.h old mode 100644 new mode 100755 diff --git a/source/include/SDL_atomic.h b/source/include/SDL_atomic.h old mode 100644 new mode 100755 diff --git a/source/include/SDL_audio.h b/source/include/SDL_audio.h old mode 100644 new mode 100755 index 53277cb7..f119c2b2 --- a/source/include/SDL_audio.h +++ b/source/include/SDL_audio.h @@ -164,6 +164,15 @@ typedef void (SDLCALL * SDL_AudioCallback) (void *userdata, Uint8 * stream, /** * The calculated values in this structure are calculated by SDL_OpenAudio(). + * + * For multi-channel audio, the default SDL channel mapping is: + * 2: FL FR (stereo) + * 3: FL FR LFE (2.1 surround) + * 4: FL FR BL BR (quad) + * 5: FL FR FC BL BR (quad + center) + * 6: FL FR FC LFE SL SR (5.1 surround - last two can also be BL BR) + * 7: FL FR FC LFE BC SL SR (6.1 surround) + * 8: FL FR FC LFE BL BR SL SR (7.1 surround) */ typedef struct SDL_AudioSpec { @@ -477,6 +486,132 @@ extern DECLSPEC int SDLCALL SDL_BuildAudioCVT(SDL_AudioCVT * cvt, */ extern DECLSPEC int SDLCALL SDL_ConvertAudio(SDL_AudioCVT * cvt); +/* SDL_AudioStream is a new audio conversion interface. + The benefits vs SDL_AudioCVT: + - it can handle resampling data in chunks without generating + artifacts, when it doesn't have the complete buffer available. + - it can handle incoming data in any variable size. + - You push data as you have it, and pull it when you need it + */ +/* this is opaque to the outside world. */ +struct _SDL_AudioStream; +typedef struct _SDL_AudioStream SDL_AudioStream; + +/** + * Create a new audio stream + * + * \param src_format The format of the source audio + * \param src_channels The number of channels of the source audio + * \param src_rate The sampling rate of the source audio + * \param dst_format The format of the desired audio output + * \param dst_channels The number of channels of the desired audio output + * \param dst_rate The sampling rate of the desired audio output + * \return 0 on success, or -1 on error. + * + * \sa SDL_AudioStreamPut + * \sa SDL_AudioStreamGet + * \sa SDL_AudioStreamAvailable + * \sa SDL_AudioStreamFlush + * \sa SDL_AudioStreamClear + * \sa SDL_FreeAudioStream + */ +extern DECLSPEC SDL_AudioStream * SDLCALL SDL_NewAudioStream(const SDL_AudioFormat src_format, + const Uint8 src_channels, + const int src_rate, + const SDL_AudioFormat dst_format, + const Uint8 dst_channels, + const int dst_rate); + +/** + * Add data to be converted/resampled to the stream + * + * \param stream The stream the audio data is being added to + * \param buf A pointer to the audio data to add + * \param int The number of bytes to write to the stream + * \return 0 on success, or -1 on error. + * + * \sa SDL_NewAudioStream + * \sa SDL_AudioStreamGet + * \sa SDL_AudioStreamAvailable + * \sa SDL_AudioStreamFlush + * \sa SDL_AudioStreamClear + * \sa SDL_FreeAudioStream + */ +extern DECLSPEC int SDLCALL SDL_AudioStreamPut(SDL_AudioStream *stream, const void *buf, int len); + +/** + * Get converted/resampled data from the stream + * + * \param stream The stream the audio is being requested from + * \param buf A buffer to fill with audio data + * \param len The maximum number of bytes to fill + * \return The number of bytes read from the stream, or -1 on error + * + * \sa SDL_NewAudioStream + * \sa SDL_AudioStreamPut + * \sa SDL_AudioStreamAvailable + * \sa SDL_AudioStreamFlush + * \sa SDL_AudioStreamClear + * \sa SDL_FreeAudioStream + */ +extern DECLSPEC int SDLCALL SDL_AudioStreamGet(SDL_AudioStream *stream, void *buf, int len); + +/** + * Get the number of converted/resampled bytes available. The stream may be + * buffering data behind the scenes until it has enough to resample + * correctly, so this number might be lower than what you expect, or even + * be zero. Add more data or flush the stream if you need the data now. + * + * \sa SDL_NewAudioStream + * \sa SDL_AudioStreamPut + * \sa SDL_AudioStreamGet + * \sa SDL_AudioStreamFlush + * \sa SDL_AudioStreamClear + * \sa SDL_FreeAudioStream + */ +extern DECLSPEC int SDLCALL SDL_AudioStreamAvailable(SDL_AudioStream *stream); + +/** + * Tell the stream that you're done sending data, and anything being buffered + * should be converted/resampled and made available immediately. + * + * It is legal to add more data to a stream after flushing, but there will + * be audio gaps in the output. Generally this is intended to signal the + * end of input, so the complete output becomes available. + * + * \sa SDL_NewAudioStream + * \sa SDL_AudioStreamPut + * \sa SDL_AudioStreamGet + * \sa SDL_AudioStreamAvailable + * \sa SDL_AudioStreamClear + * \sa SDL_FreeAudioStream + */ +extern DECLSPEC int SDLCALL SDL_AudioStreamFlush(SDL_AudioStream *stream); + +/** + * Clear any pending data in the stream without converting it + * + * \sa SDL_NewAudioStream + * \sa SDL_AudioStreamPut + * \sa SDL_AudioStreamGet + * \sa SDL_AudioStreamAvailable + * \sa SDL_AudioStreamFlush + * \sa SDL_FreeAudioStream + */ +extern DECLSPEC void SDLCALL SDL_AudioStreamClear(SDL_AudioStream *stream); + +/** + * Free an audio stream + * + * \sa SDL_NewAudioStream + * \sa SDL_AudioStreamPut + * \sa SDL_AudioStreamGet + * \sa SDL_AudioStreamAvailable + * \sa SDL_AudioStreamFlush + * \sa SDL_AudioStreamClear + */ +extern DECLSPEC void SDLCALL SDL_FreeAudioStream(SDL_AudioStream *stream); + #define SDL_MIX_MAXVOLUME 128 /** * This takes two audio buffers of the playing audio format and mixes @@ -532,7 +667,7 @@ extern DECLSPEC void SDLCALL SDL_MixAudioFormat(Uint8 * dst, * \param dev The device ID to which we will queue audio. * \param data The data to queue to the device for later playback. * \param len The number of bytes (not samples!) to which (data) points. - * \return zero on success, -1 on error. + * \return 0 on success, or -1 on error. * * \sa SDL_GetQueuedAudioSize * \sa SDL_ClearQueuedAudio diff --git a/source/include/SDL_bits.h b/source/include/SDL_bits.h old mode 100644 new mode 100755 diff --git a/source/include/SDL_blendmode.h b/source/include/SDL_blendmode.h old mode 100644 new mode 100755 diff --git a/source/include/SDL_clipboard.h b/source/include/SDL_clipboard.h old mode 100644 new mode 100755 diff --git a/source/include/SDL_config.h b/source/include/SDL_config.h old mode 100644 new mode 100755 diff --git a/source/include/SDL_config_windows.h b/source/include/SDL_config_windows.h old mode 100644 new mode 100755 diff --git a/source/include/SDL_copying.h b/source/include/SDL_copying.h old mode 100644 new mode 100755 diff --git a/source/include/SDL_cpuinfo.h b/source/include/SDL_cpuinfo.h old mode 100644 new mode 100755 diff --git a/source/include/SDL_endian.h b/source/include/SDL_endian.h old mode 100644 new mode 100755 diff --git a/source/include/SDL_error.h b/source/include/SDL_error.h old mode 100644 new mode 100755 diff --git a/source/include/SDL_events.h b/source/include/SDL_events.h old mode 100644 new mode 100755 diff --git a/source/include/SDL_filesystem.h b/source/include/SDL_filesystem.h old mode 100644 new mode 100755 diff --git a/source/include/SDL_gamecontroller.h b/source/include/SDL_gamecontroller.h old mode 100644 new mode 100755 diff --git a/source/include/SDL_gesture.h b/source/include/SDL_gesture.h old mode 100644 new mode 100755 diff --git a/source/include/SDL_haptic.h b/source/include/SDL_haptic.h old mode 100644 new mode 100755 diff --git a/source/include/SDL_hints.h b/source/include/SDL_hints.h old mode 100644 new mode 100755 diff --git a/source/include/SDL_joystick.h b/source/include/SDL_joystick.h old mode 100644 new mode 100755 index 698b09c1..f598dc82 --- a/source/include/SDL_joystick.h +++ b/source/include/SDL_joystick.h @@ -106,6 +106,20 @@ typedef enum } SDL_JoystickPowerLevel; /* Function prototypes */ + +/** + * Locking for multi-threaded access to the joystick API + * + * If you are using the joystick API or handling events from multiple threads + * you should use these locking functions to protect access to the joysticks. + * + * In particular, you are guaranteed that the joystick list won't change, so + * the API functions that take a joystick index will be valid, and joystick + * and game controller events will not be delivered. + */ +extern DECLSPEC void SDLCALL SDL_LockJoysticks(void); +extern DECLSPEC void SDLCALL SDL_UnlockJoysticks(void); + /** * Count the number of joysticks attached to the system right now */ diff --git a/source/include/SDL_keyboard.h b/source/include/SDL_keyboard.h old mode 100644 new mode 100755 diff --git a/source/include/SDL_keycode.h b/source/include/SDL_keycode.h old mode 100644 new mode 100755 diff --git a/source/include/SDL_loadso.h b/source/include/SDL_loadso.h old mode 100644 new mode 100755 diff --git a/source/include/SDL_log.h b/source/include/SDL_log.h old mode 100644 new mode 100755 diff --git a/source/include/SDL_main.h b/source/include/SDL_main.h old mode 100644 new mode 100755 diff --git a/source/include/SDL_messagebox.h b/source/include/SDL_messagebox.h old mode 100644 new mode 100755 diff --git a/source/include/SDL_mouse.h b/source/include/SDL_mouse.h old mode 100644 new mode 100755 diff --git a/source/include/SDL_mutex.h b/source/include/SDL_mutex.h old mode 100644 new mode 100755 diff --git a/source/include/SDL_name.h b/source/include/SDL_name.h old mode 100644 new mode 100755 diff --git a/source/include/SDL_opengl.h b/source/include/SDL_opengl.h old mode 100644 new mode 100755 diff --git a/source/include/SDL_pixels.h b/source/include/SDL_pixels.h old mode 100644 new mode 100755 diff --git a/source/include/SDL_platform.h b/source/include/SDL_platform.h old mode 100644 new mode 100755 diff --git a/source/include/SDL_power.h b/source/include/SDL_power.h old mode 100644 new mode 100755 diff --git a/source/include/SDL_quit.h b/source/include/SDL_quit.h old mode 100644 new mode 100755 diff --git a/source/include/SDL_rect.h b/source/include/SDL_rect.h old mode 100644 new mode 100755 diff --git a/source/include/SDL_render.h b/source/include/SDL_render.h old mode 100644 new mode 100755 diff --git a/source/include/SDL_revision.h b/source/include/SDL_revision.h old mode 100644 new mode 100755 index 98fd5afc..9376093e --- a/source/include/SDL_revision.h +++ b/source/include/SDL_revision.h @@ -1,2 +1,2 @@ -#define SDL_REVISION "hg-11524:8df7a59b5528" -#define SDL_REVISION_NUMBER 11524 +#define SDL_REVISION "hg-11645:2088cd828335" +#define SDL_REVISION_NUMBER 11645 diff --git a/source/include/SDL_rwops.h b/source/include/SDL_rwops.h old mode 100644 new mode 100755 diff --git a/source/include/SDL_scancode.h b/source/include/SDL_scancode.h old mode 100644 new mode 100755 diff --git a/source/include/SDL_shape.h b/source/include/SDL_shape.h old mode 100644 new mode 100755 diff --git a/source/include/SDL_stdinc.h b/source/include/SDL_stdinc.h old mode 100644 new mode 100755 index 546544f1..72402299 --- a/source/include/SDL_stdinc.h +++ b/source/include/SDL_stdinc.h @@ -146,35 +146,51 @@ typedef enum /** * \brief A signed 8-bit integer type. */ +#define SDL_MAX_SINT8 ((Sint8)0x7F) /* 127 */ +#define SDL_MIN_SINT8 ((Sint8)(~0x7F)) /* -128 */ typedef int8_t Sint8; /** * \brief An unsigned 8-bit integer type. */ +#define SDL_MAX_UINT8 ((Uint8)0xFF) /* 255 */ +#define SDL_MIN_UINT8 ((Uint8)0x00) /* 0 */ typedef uint8_t Uint8; /** * \brief A signed 16-bit integer type. */ +#define SDL_MAX_SINT16 ((Sint16)0x7FFF) /* 32767 */ +#define SDL_MIN_SINT16 ((Sint16)(~0x7FFF)) /* -32768 */ typedef int16_t Sint16; /** * \brief An unsigned 16-bit integer type. */ +#define SDL_MAX_UINT16 ((Uint16)0xFFFF) /* 65535 */ +#define SDL_MIN_UINT16 ((Uint16)0x0000) /* 0 */ typedef uint16_t Uint16; /** * \brief A signed 32-bit integer type. */ +#define SDL_MAX_SINT32 ((Sint32)0x7FFFFFFF) /* 2147483647 */ +#define SDL_MIN_SINT32 ((Sint32)(~0x7FFFFFFF)) /* -2147483648 */ typedef int32_t Sint32; /** * \brief An unsigned 32-bit integer type. */ +#define SDL_MAX_UINT32 ((Uint32)0xFFFFFFFFu) /* 4294967295 */ +#define SDL_MIN_UINT32 ((Uint32)0x00000000) /* 0 */ typedef uint32_t Uint32; /** * \brief A signed 64-bit integer type. */ +#define SDL_MAX_SINT64 ((Sint64)0x7FFFFFFFFFFFFFFFll) /* 9223372036854775807 */ +#define SDL_MIN_SINT64 ((Sint64)(~0x7FFFFFFFFFFFFFFFll)) /* -9223372036854775808 */ typedef int64_t Sint64; /** * \brief An unsigned 64-bit integer type. */ +#define SDL_MAX_UINT64 ((Uint64)0xFFFFFFFFFFFFFFFFull) /* 18446744073709551615 */ +#define SDL_MIN_UINT64 ((Uint64)(0x0000000000000000ull)) /* 0 */ typedef uint64_t Uint64; /* @} *//* Basic data types */ @@ -347,6 +363,37 @@ extern DECLSPEC void *SDLCALL SDL_calloc(size_t nmemb, size_t size); extern DECLSPEC void *SDLCALL SDL_realloc(void *mem, size_t size); extern DECLSPEC void SDLCALL SDL_free(void *mem); +typedef void *(SDLCALL *SDL_malloc_func)(size_t size); +typedef void *(SDLCALL *SDL_calloc_func)(size_t nmemb, size_t size); +typedef void *(SDLCALL *SDL_realloc_func)(void *mem, size_t size); +typedef void (SDLCALL *SDL_free_func)(void *mem); + +/** + * \brief Get the current set of SDL memory functions + */ +extern DECLSPEC void SDLCALL SDL_GetMemoryFunctions(SDL_malloc_func *malloc_func, + SDL_calloc_func *calloc_func, + SDL_realloc_func *realloc_func, + SDL_free_func *free_func); + +/** + * \brief Replace SDL's memory allocation functions with a custom set + * + * \note If you are replacing SDL's memory functions, you should call + * SDL_GetNumAllocations() and be very careful if it returns non-zero. + * That means that your free function will be called with memory + * allocated by the previous memory allocation functions. + */ +extern DECLSPEC int SDLCALL SDL_SetMemoryFunctions(SDL_malloc_func malloc_func, + SDL_calloc_func calloc_func, + SDL_realloc_func realloc_func, + SDL_free_func free_func); + +/** + * \brief Get the number of outstanding (unfreed) allocations + */ +extern DECLSPEC int SDLCALL SDL_GetNumAllocations(void); + extern DECLSPEC char *SDLCALL SDL_getenv(const char *name); extern DECLSPEC int SDLCALL SDL_setenv(const char *name, const char *value, int overwrite); diff --git a/source/include/SDL_surface.h b/source/include/SDL_surface.h old mode 100644 new mode 100755 diff --git a/source/include/SDL_system.h b/source/include/SDL_system.h old mode 100644 new mode 100755 diff --git a/source/include/SDL_syswm.h b/source/include/SDL_syswm.h old mode 100644 new mode 100755 diff --git a/source/include/SDL_thread.h b/source/include/SDL_thread.h old mode 100644 new mode 100755 index cf1ce492..d0f6575c --- a/source/include/SDL_thread.h +++ b/source/include/SDL_thread.h @@ -90,14 +90,11 @@ typedef int (SDLCALL * SDL_ThreadFunction) (void *data); * library! */ #define SDL_PASSED_BEGINTHREAD_ENDTHREAD -#include /* This has _beginthread() and _endthread() defined! */ +#include /* _beginthreadex() and _endthreadex() */ -typedef uintptr_t(__cdecl * pfnSDL_CurrentBeginThread) (void *, unsigned, - unsigned (__stdcall * - func) (void - *), - void *arg, unsigned, - unsigned *threadID); +typedef uintptr_t(__cdecl * pfnSDL_CurrentBeginThread) + (void *, unsigned, unsigned (__stdcall *func)(void *), + void * /*arg*/, unsigned, unsigned * /* threadID */); typedef void (__cdecl * pfnSDL_CurrentEndThread) (unsigned code); /** @@ -124,7 +121,11 @@ SDL_CreateThread(SDL_ThreadFunction fn, const char *name, void *data, * into a dll with Watcom's runtime statically linked. */ #define SDL_PASSED_BEGINTHREAD_ENDTHREAD +#ifndef __EMX__ #include +#else +#include +#endif typedef int (*pfnSDL_CurrentBeginThread)(void (*func)(void *), void *, unsigned, void * /*arg*/); typedef void (*pfnSDL_CurrentEndThread)(void); extern DECLSPEC SDL_Thread *SDLCALL diff --git a/source/include/SDL_timer.h b/source/include/SDL_timer.h old mode 100644 new mode 100755 diff --git a/source/include/SDL_touch.h b/source/include/SDL_touch.h old mode 100644 new mode 100755 diff --git a/source/include/SDL_types.h b/source/include/SDL_types.h old mode 100644 new mode 100755 diff --git a/source/include/SDL_version.h b/source/include/SDL_version.h old mode 100644 new mode 100755 index 8471b654..5b4c4024 --- a/source/include/SDL_version.h +++ b/source/include/SDL_version.h @@ -59,7 +59,7 @@ typedef struct SDL_version */ #define SDL_MAJOR_VERSION 2 #define SDL_MINOR_VERSION 0 -#define SDL_PATCHLEVEL 6 +#define SDL_PATCHLEVEL 7 /** * \brief Macro to determine SDL version program was compiled against. diff --git a/source/include/SDL_video.h b/source/include/SDL_video.h old mode 100644 new mode 100755 diff --git a/source/include/SDL_vulkan.h b/source/include/SDL_vulkan.h old mode 100644 new mode 100755 diff --git a/source/include/begin_code.h b/source/include/begin_code.h old mode 100644 new mode 100755 diff --git a/source/include/close_code.h b/source/include/close_code.h old mode 100644 new mode 100755 diff --git a/source/lib/SDL2.lib b/source/lib/SDL2.lib index 7ba4be0d..a36fab5a 100755 Binary files a/source/lib/SDL2.lib and b/source/lib/SDL2.lib differ diff --git a/source/lib/SDL2main.lib b/source/lib/SDL2main.lib index 85426d9e..2080d5db 100755 Binary files a/source/lib/SDL2main.lib and b/source/lib/SDL2main.lib differ diff --git a/source/xcode/Frameworks/SDL2.framework/Versions/A/Headers/SDL_audio.h b/source/xcode/Frameworks/SDL2.framework/Versions/A/Headers/SDL_audio.h index 53277cb7..f119c2b2 100644 --- a/source/xcode/Frameworks/SDL2.framework/Versions/A/Headers/SDL_audio.h +++ b/source/xcode/Frameworks/SDL2.framework/Versions/A/Headers/SDL_audio.h @@ -164,6 +164,15 @@ typedef void (SDLCALL * SDL_AudioCallback) (void *userdata, Uint8 * stream, /** * The calculated values in this structure are calculated by SDL_OpenAudio(). + * + * For multi-channel audio, the default SDL channel mapping is: + * 2: FL FR (stereo) + * 3: FL FR LFE (2.1 surround) + * 4: FL FR BL BR (quad) + * 5: FL FR FC BL BR (quad + center) + * 6: FL FR FC LFE SL SR (5.1 surround - last two can also be BL BR) + * 7: FL FR FC LFE BC SL SR (6.1 surround) + * 8: FL FR FC LFE BL BR SL SR (7.1 surround) */ typedef struct SDL_AudioSpec { @@ -477,6 +486,132 @@ extern DECLSPEC int SDLCALL SDL_BuildAudioCVT(SDL_AudioCVT * cvt, */ extern DECLSPEC int SDLCALL SDL_ConvertAudio(SDL_AudioCVT * cvt); +/* SDL_AudioStream is a new audio conversion interface. + The benefits vs SDL_AudioCVT: + - it can handle resampling data in chunks without generating + artifacts, when it doesn't have the complete buffer available. + - it can handle incoming data in any variable size. + - You push data as you have it, and pull it when you need it + */ +/* this is opaque to the outside world. */ +struct _SDL_AudioStream; +typedef struct _SDL_AudioStream SDL_AudioStream; + +/** + * Create a new audio stream + * + * \param src_format The format of the source audio + * \param src_channels The number of channels of the source audio + * \param src_rate The sampling rate of the source audio + * \param dst_format The format of the desired audio output + * \param dst_channels The number of channels of the desired audio output + * \param dst_rate The sampling rate of the desired audio output + * \return 0 on success, or -1 on error. + * + * \sa SDL_AudioStreamPut + * \sa SDL_AudioStreamGet + * \sa SDL_AudioStreamAvailable + * \sa SDL_AudioStreamFlush + * \sa SDL_AudioStreamClear + * \sa SDL_FreeAudioStream + */ +extern DECLSPEC SDL_AudioStream * SDLCALL SDL_NewAudioStream(const SDL_AudioFormat src_format, + const Uint8 src_channels, + const int src_rate, + const SDL_AudioFormat dst_format, + const Uint8 dst_channels, + const int dst_rate); + +/** + * Add data to be converted/resampled to the stream + * + * \param stream The stream the audio data is being added to + * \param buf A pointer to the audio data to add + * \param int The number of bytes to write to the stream + * \return 0 on success, or -1 on error. + * + * \sa SDL_NewAudioStream + * \sa SDL_AudioStreamGet + * \sa SDL_AudioStreamAvailable + * \sa SDL_AudioStreamFlush + * \sa SDL_AudioStreamClear + * \sa SDL_FreeAudioStream + */ +extern DECLSPEC int SDLCALL SDL_AudioStreamPut(SDL_AudioStream *stream, const void *buf, int len); + +/** + * Get converted/resampled data from the stream + * + * \param stream The stream the audio is being requested from + * \param buf A buffer to fill with audio data + * \param len The maximum number of bytes to fill + * \return The number of bytes read from the stream, or -1 on error + * + * \sa SDL_NewAudioStream + * \sa SDL_AudioStreamPut + * \sa SDL_AudioStreamAvailable + * \sa SDL_AudioStreamFlush + * \sa SDL_AudioStreamClear + * \sa SDL_FreeAudioStream + */ +extern DECLSPEC int SDLCALL SDL_AudioStreamGet(SDL_AudioStream *stream, void *buf, int len); + +/** + * Get the number of converted/resampled bytes available. The stream may be + * buffering data behind the scenes until it has enough to resample + * correctly, so this number might be lower than what you expect, or even + * be zero. Add more data or flush the stream if you need the data now. + * + * \sa SDL_NewAudioStream + * \sa SDL_AudioStreamPut + * \sa SDL_AudioStreamGet + * \sa SDL_AudioStreamFlush + * \sa SDL_AudioStreamClear + * \sa SDL_FreeAudioStream + */ +extern DECLSPEC int SDLCALL SDL_AudioStreamAvailable(SDL_AudioStream *stream); + +/** + * Tell the stream that you're done sending data, and anything being buffered + * should be converted/resampled and made available immediately. + * + * It is legal to add more data to a stream after flushing, but there will + * be audio gaps in the output. Generally this is intended to signal the + * end of input, so the complete output becomes available. + * + * \sa SDL_NewAudioStream + * \sa SDL_AudioStreamPut + * \sa SDL_AudioStreamGet + * \sa SDL_AudioStreamAvailable + * \sa SDL_AudioStreamClear + * \sa SDL_FreeAudioStream + */ +extern DECLSPEC int SDLCALL SDL_AudioStreamFlush(SDL_AudioStream *stream); + +/** + * Clear any pending data in the stream without converting it + * + * \sa SDL_NewAudioStream + * \sa SDL_AudioStreamPut + * \sa SDL_AudioStreamGet + * \sa SDL_AudioStreamAvailable + * \sa SDL_AudioStreamFlush + * \sa SDL_FreeAudioStream + */ +extern DECLSPEC void SDLCALL SDL_AudioStreamClear(SDL_AudioStream *stream); + +/** + * Free an audio stream + * + * \sa SDL_NewAudioStream + * \sa SDL_AudioStreamPut + * \sa SDL_AudioStreamGet + * \sa SDL_AudioStreamAvailable + * \sa SDL_AudioStreamFlush + * \sa SDL_AudioStreamClear + */ +extern DECLSPEC void SDLCALL SDL_FreeAudioStream(SDL_AudioStream *stream); + #define SDL_MIX_MAXVOLUME 128 /** * This takes two audio buffers of the playing audio format and mixes @@ -532,7 +667,7 @@ extern DECLSPEC void SDLCALL SDL_MixAudioFormat(Uint8 * dst, * \param dev The device ID to which we will queue audio. * \param data The data to queue to the device for later playback. * \param len The number of bytes (not samples!) to which (data) points. - * \return zero on success, -1 on error. + * \return 0 on success, or -1 on error. * * \sa SDL_GetQueuedAudioSize * \sa SDL_ClearQueuedAudio diff --git a/source/xcode/Frameworks/SDL2.framework/Versions/A/Headers/SDL_config_macosx.h b/source/xcode/Frameworks/SDL2.framework/Versions/A/Headers/SDL_config_macosx.h index 67f879a4..f7550789 100644 --- a/source/xcode/Frameworks/SDL2.framework/Versions/A/Headers/SDL_config_macosx.h +++ b/source/xcode/Frameworks/SDL2.framework/Versions/A/Headers/SDL_config_macosx.h @@ -49,6 +49,7 @@ #define HAVE_STDIO_H 1 #define HAVE_STRING_H 1 #define HAVE_SYS_TYPES_H 1 +#define HAVE_LIBUNWIND_H 1 /* C library functions */ #define HAVE_MALLOC 1 @@ -70,7 +71,6 @@ #define HAVE_STRLEN 1 #define HAVE_STRLCPY 1 #define HAVE_STRLCAT 1 -#define HAVE_STRDUP 1 #define HAVE_STRCHR 1 #define HAVE_STRRCHR 1 #define HAVE_STRSTR 1 diff --git a/source/xcode/Frameworks/SDL2.framework/Versions/A/Headers/SDL_joystick.h b/source/xcode/Frameworks/SDL2.framework/Versions/A/Headers/SDL_joystick.h index 698b09c1..f598dc82 100644 --- a/source/xcode/Frameworks/SDL2.framework/Versions/A/Headers/SDL_joystick.h +++ b/source/xcode/Frameworks/SDL2.framework/Versions/A/Headers/SDL_joystick.h @@ -106,6 +106,20 @@ typedef enum } SDL_JoystickPowerLevel; /* Function prototypes */ + +/** + * Locking for multi-threaded access to the joystick API + * + * If you are using the joystick API or handling events from multiple threads + * you should use these locking functions to protect access to the joysticks. + * + * In particular, you are guaranteed that the joystick list won't change, so + * the API functions that take a joystick index will be valid, and joystick + * and game controller events will not be delivered. + */ +extern DECLSPEC void SDLCALL SDL_LockJoysticks(void); +extern DECLSPEC void SDLCALL SDL_UnlockJoysticks(void); + /** * Count the number of joysticks attached to the system right now */ diff --git a/source/xcode/Frameworks/SDL2.framework/Versions/A/Headers/SDL_revision.h b/source/xcode/Frameworks/SDL2.framework/Versions/A/Headers/SDL_revision.h index 98fd5afc..9376093e 100644 --- a/source/xcode/Frameworks/SDL2.framework/Versions/A/Headers/SDL_revision.h +++ b/source/xcode/Frameworks/SDL2.framework/Versions/A/Headers/SDL_revision.h @@ -1,2 +1,2 @@ -#define SDL_REVISION "hg-11524:8df7a59b5528" -#define SDL_REVISION_NUMBER 11524 +#define SDL_REVISION "hg-11645:2088cd828335" +#define SDL_REVISION_NUMBER 11645 diff --git a/source/xcode/Frameworks/SDL2.framework/Versions/A/Headers/SDL_stdinc.h b/source/xcode/Frameworks/SDL2.framework/Versions/A/Headers/SDL_stdinc.h index 546544f1..72402299 100644 --- a/source/xcode/Frameworks/SDL2.framework/Versions/A/Headers/SDL_stdinc.h +++ b/source/xcode/Frameworks/SDL2.framework/Versions/A/Headers/SDL_stdinc.h @@ -146,35 +146,51 @@ typedef enum /** * \brief A signed 8-bit integer type. */ +#define SDL_MAX_SINT8 ((Sint8)0x7F) /* 127 */ +#define SDL_MIN_SINT8 ((Sint8)(~0x7F)) /* -128 */ typedef int8_t Sint8; /** * \brief An unsigned 8-bit integer type. */ +#define SDL_MAX_UINT8 ((Uint8)0xFF) /* 255 */ +#define SDL_MIN_UINT8 ((Uint8)0x00) /* 0 */ typedef uint8_t Uint8; /** * \brief A signed 16-bit integer type. */ +#define SDL_MAX_SINT16 ((Sint16)0x7FFF) /* 32767 */ +#define SDL_MIN_SINT16 ((Sint16)(~0x7FFF)) /* -32768 */ typedef int16_t Sint16; /** * \brief An unsigned 16-bit integer type. */ +#define SDL_MAX_UINT16 ((Uint16)0xFFFF) /* 65535 */ +#define SDL_MIN_UINT16 ((Uint16)0x0000) /* 0 */ typedef uint16_t Uint16; /** * \brief A signed 32-bit integer type. */ +#define SDL_MAX_SINT32 ((Sint32)0x7FFFFFFF) /* 2147483647 */ +#define SDL_MIN_SINT32 ((Sint32)(~0x7FFFFFFF)) /* -2147483648 */ typedef int32_t Sint32; /** * \brief An unsigned 32-bit integer type. */ +#define SDL_MAX_UINT32 ((Uint32)0xFFFFFFFFu) /* 4294967295 */ +#define SDL_MIN_UINT32 ((Uint32)0x00000000) /* 0 */ typedef uint32_t Uint32; /** * \brief A signed 64-bit integer type. */ +#define SDL_MAX_SINT64 ((Sint64)0x7FFFFFFFFFFFFFFFll) /* 9223372036854775807 */ +#define SDL_MIN_SINT64 ((Sint64)(~0x7FFFFFFFFFFFFFFFll)) /* -9223372036854775808 */ typedef int64_t Sint64; /** * \brief An unsigned 64-bit integer type. */ +#define SDL_MAX_UINT64 ((Uint64)0xFFFFFFFFFFFFFFFFull) /* 18446744073709551615 */ +#define SDL_MIN_UINT64 ((Uint64)(0x0000000000000000ull)) /* 0 */ typedef uint64_t Uint64; /* @} *//* Basic data types */ @@ -347,6 +363,37 @@ extern DECLSPEC void *SDLCALL SDL_calloc(size_t nmemb, size_t size); extern DECLSPEC void *SDLCALL SDL_realloc(void *mem, size_t size); extern DECLSPEC void SDLCALL SDL_free(void *mem); +typedef void *(SDLCALL *SDL_malloc_func)(size_t size); +typedef void *(SDLCALL *SDL_calloc_func)(size_t nmemb, size_t size); +typedef void *(SDLCALL *SDL_realloc_func)(void *mem, size_t size); +typedef void (SDLCALL *SDL_free_func)(void *mem); + +/** + * \brief Get the current set of SDL memory functions + */ +extern DECLSPEC void SDLCALL SDL_GetMemoryFunctions(SDL_malloc_func *malloc_func, + SDL_calloc_func *calloc_func, + SDL_realloc_func *realloc_func, + SDL_free_func *free_func); + +/** + * \brief Replace SDL's memory allocation functions with a custom set + * + * \note If you are replacing SDL's memory functions, you should call + * SDL_GetNumAllocations() and be very careful if it returns non-zero. + * That means that your free function will be called with memory + * allocated by the previous memory allocation functions. + */ +extern DECLSPEC int SDLCALL SDL_SetMemoryFunctions(SDL_malloc_func malloc_func, + SDL_calloc_func calloc_func, + SDL_realloc_func realloc_func, + SDL_free_func free_func); + +/** + * \brief Get the number of outstanding (unfreed) allocations + */ +extern DECLSPEC int SDLCALL SDL_GetNumAllocations(void); + extern DECLSPEC char *SDLCALL SDL_getenv(const char *name); extern DECLSPEC int SDLCALL SDL_setenv(const char *name, const char *value, int overwrite); diff --git a/source/xcode/Frameworks/SDL2.framework/Versions/A/Headers/SDL_thread.h b/source/xcode/Frameworks/SDL2.framework/Versions/A/Headers/SDL_thread.h index cf1ce492..d0f6575c 100644 --- a/source/xcode/Frameworks/SDL2.framework/Versions/A/Headers/SDL_thread.h +++ b/source/xcode/Frameworks/SDL2.framework/Versions/A/Headers/SDL_thread.h @@ -90,14 +90,11 @@ typedef int (SDLCALL * SDL_ThreadFunction) (void *data); * library! */ #define SDL_PASSED_BEGINTHREAD_ENDTHREAD -#include /* This has _beginthread() and _endthread() defined! */ +#include /* _beginthreadex() and _endthreadex() */ -typedef uintptr_t(__cdecl * pfnSDL_CurrentBeginThread) (void *, unsigned, - unsigned (__stdcall * - func) (void - *), - void *arg, unsigned, - unsigned *threadID); +typedef uintptr_t(__cdecl * pfnSDL_CurrentBeginThread) + (void *, unsigned, unsigned (__stdcall *func)(void *), + void * /*arg*/, unsigned, unsigned * /* threadID */); typedef void (__cdecl * pfnSDL_CurrentEndThread) (unsigned code); /** @@ -124,7 +121,11 @@ SDL_CreateThread(SDL_ThreadFunction fn, const char *name, void *data, * into a dll with Watcom's runtime statically linked. */ #define SDL_PASSED_BEGINTHREAD_ENDTHREAD +#ifndef __EMX__ #include +#else +#include +#endif typedef int (*pfnSDL_CurrentBeginThread)(void (*func)(void *), void *, unsigned, void * /*arg*/); typedef void (*pfnSDL_CurrentEndThread)(void); extern DECLSPEC SDL_Thread *SDLCALL diff --git a/source/xcode/Frameworks/SDL2.framework/Versions/A/Headers/SDL_version.h b/source/xcode/Frameworks/SDL2.framework/Versions/A/Headers/SDL_version.h index 8471b654..5b4c4024 100644 --- a/source/xcode/Frameworks/SDL2.framework/Versions/A/Headers/SDL_version.h +++ b/source/xcode/Frameworks/SDL2.framework/Versions/A/Headers/SDL_version.h @@ -59,7 +59,7 @@ typedef struct SDL_version */ #define SDL_MAJOR_VERSION 2 #define SDL_MINOR_VERSION 0 -#define SDL_PATCHLEVEL 6 +#define SDL_PATCHLEVEL 7 /** * \brief Macro to determine SDL version program was compiled against. diff --git a/source/xcode/Frameworks/SDL2.framework/Versions/A/Resources/Info.plist b/source/xcode/Frameworks/SDL2.framework/Versions/A/Resources/Info.plist index f9ed12c9..7d5af646 100644 --- a/source/xcode/Frameworks/SDL2.framework/Versions/A/Resources/Info.plist +++ b/source/xcode/Frameworks/SDL2.framework/Versions/A/Resources/Info.plist @@ -19,7 +19,7 @@ CFBundlePackageType FMWK CFBundleShortVersionString - 2.0.6 + 2.0.7 CFBundleSignature SDLX CFBundleSupportedPlatforms @@ -27,7 +27,7 @@ MacOSX CFBundleVersion - 2.0.6 + 2.0.7 DTCompiler com.apple.compilers.llvm.clang.1_0 DTPlatformBuild diff --git a/source/xcode/Frameworks/SDL2.framework/Versions/A/SDL2 b/source/xcode/Frameworks/SDL2.framework/Versions/A/SDL2 index 48e50685..2d7fc18b 100755 Binary files a/source/xcode/Frameworks/SDL2.framework/Versions/A/SDL2 and b/source/xcode/Frameworks/SDL2.framework/Versions/A/SDL2 differ diff --git a/source/xcode/Frameworks/SDL2.framework/Versions/A/_CodeSignature/CodeResources b/source/xcode/Frameworks/SDL2.framework/Versions/A/_CodeSignature/CodeResources index fe10d137..b626d870 100644 --- a/source/xcode/Frameworks/SDL2.framework/Versions/A/_CodeSignature/CodeResources +++ b/source/xcode/Frameworks/SDL2.framework/Versions/A/_CodeSignature/CodeResources @@ -6,7 +6,7 @@ Resources/Info.plist - VaXddiO8J1b5OV+/kZkzIuGENSU= + Bz86YsPyxZtz6JXNXguaJ5+jA4Y= files2 @@ -48,11 +48,11 @@ hash - fmrO/8lbCI+ScQHx2pL/f14UhOg= + 4Ahrh1xoqUwV4RQJl4sKUkSGuJI= hash2 - LXXLsMnfoZoc5m28m5jE3qtOZPCAJ4ZZUXpBZTHSl+M= + D6FpiCOLws6dzCOMr9/kN9gpfSTyIbKuZ9uHDsquV8Y= Headers/SDL_bits.h @@ -103,11 +103,11 @@ hash - ELZxMcqZjpm9zqIdeOt4SQQ8TN4= + DuowtYhAyXNt3MqlaZQPxDqYIYk= hash2 - G1Ib4WkNTlRWrLXvyK3k4Oqn1K7GTRvwyvcpoqzNJPU= + KoqtqTwbdFaSlp4dyZ4ohg/FEmq1Spjn7E9RH/i42CE= Headers/SDL_copying.h @@ -224,11 +224,11 @@ hash - FtdqhVVMbdnN1QUPI0i+a+GE9Js= + vDuAMGdmdMxeURRcKDNdREGOtpg= hash2 - +4CBGQe/qSrDVvxgTXsoYGRLFyoYA30089POv1jZ6wQ= + 4x4LTuCLFiBmBuolQ6QuLkoZY5a3y2VOU0V8IZAmI94= Headers/SDL_keyboard.h @@ -488,11 +488,11 @@ hash - 8srL9t7Sh8uQJNCXFFWCrPV/8HQ= + JiwcmPZwrc8sMFZCEFNsIoFStP4= hash2 - Yu2GXUeQTynxp/QVlAPIXk4K9MmH5CikA/UUiMReUIU= + D+julfUHNTNm0egebydA46uGliazWGhNqk+6oihpaFE= Headers/SDL_rwops.h @@ -532,11 +532,11 @@ hash - uKNURXAB+uLGAnkKfpD3TD5ljeI= + 9In2yKPK9KcDc2qYC2dWGSwQe2M= hash2 - 01Ou5kB/G6pTGATrGZz9sOtguq5xE9idOjkvbzVBQe4= + rY36PbCJYSpEQjYPyQiQ/UaxbDkQh/oE0g3tHtQnx9o= Headers/SDL_surface.h @@ -576,11 +576,11 @@ hash - TNyfJrd9eOetV+W4QpHcGotU3uE= + 5ZBMRbeze0GZ3wgSL+YBH2EJe2s= hash2 - iE5ctctn27+yWC82dkAj2ocXmYz/NcFB2vEKsclgbhs= + uqhzYZnfCjHXNyYyFJlKGEUvHWTTm+OWSKbDOk24VZA= Headers/SDL_timer.h @@ -620,11 +620,11 @@ hash - 1HxwpKfmE3aVFYhl8LhSztk8UE4= + LJN1tLNZeNGq6cOQo20Kh3AHL8A= hash2 - gawHCsnw8aPEkLE+soYZ4vseqValCrUnutzjhP+G2G4= + 6XCO1GhNFyWU1aS238Y3NzboAgDQCGUO+tRKaCvtIkc= Headers/SDL_video.h @@ -675,11 +675,11 @@ hash - VaXddiO8J1b5OV+/kZkzIuGENSU= + Bz86YsPyxZtz6JXNXguaJ5+jA4Y= hash2 - SgMohxWyHMfM9wwwqw1hvcBAFHNTF9b7/fl/EFhCQcU= + 3VI647gf464YDVl5wdSH3Uwt7gze1hMFZRwBYkYu3IM=