diff --git a/quakespasm/MacOSX/SDL2.framework/Versions/A/Headers/SDL_config_android.h b/quakespasm/MacOSX/SDL2.framework/Versions/A/Headers/SDL_config_android.h index 8f534860..9cb70bfe 100644 --- a/quakespasm/MacOSX/SDL2.framework/Versions/A/Headers/SDL_config_android.h +++ b/quakespasm/MacOSX/SDL2.framework/Versions/A/Headers/SDL_config_android.h @@ -71,6 +71,7 @@ #define HAVE_STRCHR 1 #define HAVE_STRRCHR 1 #define HAVE_STRSTR 1 +#define HAVE_STRTOK_R 1 #define HAVE_STRTOL 1 #define HAVE_STRTOUL 1 #define HAVE_STRTOLL 1 diff --git a/quakespasm/MacOSX/SDL2.framework/Versions/A/Headers/SDL_config_iphoneos.h b/quakespasm/MacOSX/SDL2.framework/Versions/A/Headers/SDL_config_iphoneos.h index 8137085e..edfc03e2 100644 --- a/quakespasm/MacOSX/SDL2.framework/Versions/A/Headers/SDL_config_iphoneos.h +++ b/quakespasm/MacOSX/SDL2.framework/Versions/A/Headers/SDL_config_iphoneos.h @@ -71,6 +71,7 @@ #define HAVE_STRCHR 1 #define HAVE_STRRCHR 1 #define HAVE_STRSTR 1 +#define HAVE_STRTOK_R 1 #define HAVE_STRTOL 1 #define HAVE_STRTOUL 1 #define HAVE_STRTOLL 1 diff --git a/quakespasm/MacOSX/SDL2.framework/Versions/A/Headers/SDL_config_macosx.h b/quakespasm/MacOSX/SDL2.framework/Versions/A/Headers/SDL_config_macosx.h index 2035f2d0..22287dfc 100644 --- a/quakespasm/MacOSX/SDL2.framework/Versions/A/Headers/SDL_config_macosx.h +++ b/quakespasm/MacOSX/SDL2.framework/Versions/A/Headers/SDL_config_macosx.h @@ -74,6 +74,7 @@ #define HAVE_STRCHR 1 #define HAVE_STRRCHR 1 #define HAVE_STRSTR 1 +#define HAVE_STRTOK_R 1 #define HAVE_STRTOL 1 #define HAVE_STRTOUL 1 #define HAVE_STRTOLL 1 diff --git a/quakespasm/MacOSX/SDL2.framework/Versions/A/Headers/SDL_config_os2.h b/quakespasm/MacOSX/SDL2.framework/Versions/A/Headers/SDL_config_os2.h index bc75b3a7..f03ca4a5 100644 --- a/quakespasm/MacOSX/SDL2.framework/Versions/A/Headers/SDL_config_os2.h +++ b/quakespasm/MacOSX/SDL2.framework/Versions/A/Headers/SDL_config_os2.h @@ -110,6 +110,7 @@ #define HAVE_STRCHR 1 #define HAVE_STRRCHR 1 #define HAVE_STRSTR 1 +/* #undef HAVE_STRTOK_R */ #define HAVE_ITOA 1 #define HAVE__LTOA 1 #define HAVE__ULTOA 1 @@ -122,12 +123,21 @@ #define HAVE_STRTOD 1 #define HAVE_ATOI 1 #define HAVE_ATOF 1 +#define HAVE_WCSLEN 1 +#define HAVE_WCSLCPY 1 +#define HAVE_WCSLCAT 1 +/* #define HAVE_WCSDUP 1 */ +/* #define wcsdup _wcsdup */ +#define HAVE_WCSSTR 1 +#define HAVE_WCSCMP 1 +#define HAVE_WCSNCMP 1 #define HAVE_STRCMP 1 #define HAVE_STRNCMP 1 #define HAVE_STRICMP 1 #define HAVE_STRCASECMP 1 #define HAVE_STRNCASECMP 1 -#define HAVE_SSCANF 1 +#define HAVE_SSCANF 1 +#define HAVE_VSSCANF 1 #define HAVE_SNPRINTF 1 #define HAVE_VSNPRINTF 1 #define HAVE_SETJMP 1 diff --git a/quakespasm/MacOSX/SDL2.framework/Versions/A/Headers/SDL_config_windows.h b/quakespasm/MacOSX/SDL2.framework/Versions/A/Headers/SDL_config_windows.h index cae9902d..c66d8754 100644 --- a/quakespasm/MacOSX/SDL2.framework/Versions/A/Headers/SDL_config_windows.h +++ b/quakespasm/MacOSX/SDL2.framework/Versions/A/Headers/SDL_config_windows.h @@ -117,6 +117,10 @@ typedef unsigned int uintptr_t; #define HAVE_STRCHR 1 #define HAVE_STRRCHR 1 #define HAVE_STRSTR 1 +/* #undef HAVE_STRTOK_R */ +#if defined(_MSC_VER) +#define HAVE_STRTOK_S 1 +#endif /* These functions have security warnings, so we won't use them */ /* #undef HAVE__LTOA */ /* #undef HAVE__ULTOA */ diff --git a/quakespasm/MacOSX/SDL2.framework/Versions/A/Headers/SDL_config_winrt.h b/quakespasm/MacOSX/SDL2.framework/Versions/A/Headers/SDL_config_winrt.h index 8eeeb512..cb85b234 100644 --- a/quakespasm/MacOSX/SDL2.framework/Versions/A/Headers/SDL_config_winrt.h +++ b/quakespasm/MacOSX/SDL2.framework/Versions/A/Headers/SDL_config_winrt.h @@ -130,6 +130,7 @@ typedef unsigned int uintptr_t; #define HAVE_STRCHR 1 #define HAVE_STRRCHR 1 #define HAVE_STRSTR 1 +#define HAVE_STRTOK_S 1 //#define HAVE_ITOA 1 // TODO, WinRT: consider using _itoa_s instead //#define HAVE__LTOA 1 // TODO, WinRT: consider using _ltoa_s instead //#define HAVE__ULTOA 1 // TODO, WinRT: consider using _ultoa_s instead diff --git a/quakespasm/MacOSX/SDL2.framework/Versions/A/Headers/SDL_config_wiz.h b/quakespasm/MacOSX/SDL2.framework/Versions/A/Headers/SDL_config_wiz.h index c5eb9b34..724c55fc 100644 --- a/quakespasm/MacOSX/SDL2.framework/Versions/A/Headers/SDL_config_wiz.h +++ b/quakespasm/MacOSX/SDL2.framework/Versions/A/Headers/SDL_config_wiz.h @@ -67,6 +67,7 @@ #define HAVE_STRCHR 1 #define HAVE_STRRCHR 1 #define HAVE_STRSTR 1 +#define HAVE_STRTOK_R 1 #define HAVE_STRTOL 1 #define HAVE_STRTOUL 1 #define HAVE_STRTOLL 1 diff --git a/quakespasm/MacOSX/SDL2.framework/Versions/A/Headers/SDL_gamecontroller.h b/quakespasm/MacOSX/SDL2.framework/Versions/A/Headers/SDL_gamecontroller.h index ebde3871..5ee8e8e9 100644 --- a/quakespasm/MacOSX/SDL2.framework/Versions/A/Headers/SDL_gamecontroller.h +++ b/quakespasm/MacOSX/SDL2.framework/Versions/A/Headers/SDL_gamecontroller.h @@ -57,6 +57,15 @@ extern "C" { struct _SDL_GameController; typedef struct _SDL_GameController SDL_GameController; +typedef enum +{ + SDL_CONTROLLER_TYPE_UNKNOWN = 0, + SDL_CONTROLLER_TYPE_XBOX360, + SDL_CONTROLLER_TYPE_XBOXONE, + SDL_CONTROLLER_TYPE_PS3, + SDL_CONTROLLER_TYPE_PS4, + SDL_CONTROLLER_TYPE_NINTENDO_SWITCH_PRO +} SDL_GameControllerType; typedef enum { @@ -175,6 +184,12 @@ extern DECLSPEC SDL_bool SDLCALL SDL_IsGameController(int joystick_index); */ extern DECLSPEC const char *SDLCALL SDL_GameControllerNameForIndex(int joystick_index); +/** + * Get the type of a game controller. + * This can be called before any controllers are opened. + */ +extern DECLSPEC SDL_GameControllerType SDLCALL SDL_GameControllerTypeForIndex(int joystick_index); + /** * Get the mapping of a game controller. * This can be called before any controllers are opened. @@ -199,11 +214,21 @@ extern DECLSPEC SDL_GameController *SDLCALL SDL_GameControllerOpen(int joystick_ */ extern DECLSPEC SDL_GameController *SDLCALL SDL_GameControllerFromInstanceID(SDL_JoystickID joyid); +/** + * Return the SDL_GameController associated with a player index. + */ +extern DECLSPEC SDL_GameController *SDLCALL SDL_GameControllerFromPlayerIndex(int player_index); + /** * Return the name for this currently opened controller */ extern DECLSPEC const char *SDLCALL SDL_GameControllerName(SDL_GameController *gamecontroller); +/** + * Return the type of this currently opened controller + */ +extern DECLSPEC SDL_GameControllerType SDLCALL SDL_GameControllerGetType(SDL_GameController *gamecontroller); + /** * Get the player index of an opened game controller, or -1 if it's not available * @@ -211,6 +236,11 @@ extern DECLSPEC const char *SDLCALL SDL_GameControllerName(SDL_GameController *g */ extern DECLSPEC int SDLCALL SDL_GameControllerGetPlayerIndex(SDL_GameController *gamecontroller); +/** + * Set the player index of an opened game controller + */ +extern DECLSPEC void SDLCALL SDL_GameControllerSetPlayerIndex(SDL_GameController *gamecontroller, int player_index); + /** * Get the USB vendor ID of an opened controller, if available. * If the vendor ID isn't available this function returns 0. diff --git a/quakespasm/MacOSX/SDL2.framework/Versions/A/Headers/SDL_hints.h b/quakespasm/MacOSX/SDL2.framework/Versions/A/Headers/SDL_hints.h index 7703095c..d36815b9 100644 --- a/quakespasm/MacOSX/SDL2.framework/Versions/A/Headers/SDL_hints.h +++ b/quakespasm/MacOSX/SDL2.framework/Versions/A/Headers/SDL_hints.h @@ -164,6 +164,21 @@ extern "C" { */ #define SDL_HINT_VIDEO_ALLOW_SCREENSAVER "SDL_VIDEO_ALLOW_SCREENSAVER" +/** + * \brief A variable controlling whether the graphics context is externally managed. + * + * This variable can be set to the following values: + * "0" - SDL will manage graphics contexts that are attached to windows. + * "1" - Disable graphics context management on windows. + * + * By default SDL will manage OpenGL contexts in certain situations. For example, on Android the + * context will be automatically saved and restored when pausing the application. Additionally, some + * platforms will assume usage of OpenGL if Vulkan isn't used. Setting this to "1" will prevent this + * behavior, which is desireable when the application manages the graphics context, such as + * an externally managed OpenGL context or attaching a Vulkan surface to the window. + */ +#define SDL_HINT_VIDEO_EXTERNAL_CONTEXT "SDL_VIDEO_EXTERNAL_CONTEXT" + /** * \brief A variable controlling whether the X11 VidMode extension should be used. * @@ -507,7 +522,7 @@ extern "C" { * "0" - Report the face buttons by position, as though they were on an Xbox controller. * "1" - Report the face buttons by label instead of position * - * The default value is "0". This hint may be set at any time. + * The default value is "1". This hint may be set at any time. */ #define SDL_HINT_GAMECONTROLLER_USE_BUTTON_LABELS "SDL_GAMECONTROLLER_USE_BUTTON_LABELS" @@ -594,6 +609,17 @@ extern "C" { */ #define SDL_HINT_JOYSTICK_HIDAPI_XBOX "SDL_JOYSTICK_HIDAPI_XBOX" +/** + * \brief A variable controlling whether the HIDAPI driver for Nintendo GameCube controllers should be used. + * + * This variable can be set to the following values: + * "0" - HIDAPI driver is not used + * "1" - HIDAPI driver is used + * + * The default is the value of SDL_HINT_JOYSTICK_HIDAPI + */ +#define SDL_HINT_JOYSTICK_HIDAPI_GAMECUBE "SDL_JOYSTICK_HIDAPI_GAMECUBE" + /** * \brief A variable that controls whether Steam Controllers should be exposed using the SDL joystick and game controller APIs * diff --git a/quakespasm/MacOSX/SDL2.framework/Versions/A/Headers/SDL_joystick.h b/quakespasm/MacOSX/SDL2.framework/Versions/A/Headers/SDL_joystick.h index 3a4c5d17..3c099dec 100644 --- a/quakespasm/MacOSX/SDL2.framework/Versions/A/Headers/SDL_joystick.h +++ b/quakespasm/MacOSX/SDL2.framework/Versions/A/Headers/SDL_joystick.h @@ -192,7 +192,12 @@ extern DECLSPEC SDL_Joystick *SDLCALL SDL_JoystickOpen(int device_index); /** * Return the SDL_Joystick associated with an instance id. */ -extern DECLSPEC SDL_Joystick *SDLCALL SDL_JoystickFromInstanceID(SDL_JoystickID joyid); +extern DECLSPEC SDL_Joystick *SDLCALL SDL_JoystickFromInstanceID(SDL_JoystickID instance_id); + +/** + * Return the SDL_Joystick associated with a player index. + */ +extern DECLSPEC SDL_Joystick *SDLCALL SDL_JoystickFromPlayerIndex(int player_index); /** * Return the name for this currently opened joystick. @@ -207,6 +212,11 @@ extern DECLSPEC const char *SDLCALL SDL_JoystickName(SDL_Joystick * joystick); */ extern DECLSPEC int SDLCALL SDL_JoystickGetPlayerIndex(SDL_Joystick * joystick); +/** + * Set the player index of an opened joystick + */ +extern DECLSPEC void SDLCALL SDL_JoystickSetPlayerIndex(SDL_Joystick * joystick, int player_index); + /** * Return the GUID for this opened joystick */ diff --git a/quakespasm/MacOSX/SDL2.framework/Versions/A/Headers/SDL_pixels.h b/quakespasm/MacOSX/SDL2.framework/Versions/A/Headers/SDL_pixels.h index 2e2b05c7..753f617a 100644 --- a/quakespasm/MacOSX/SDL2.framework/Versions/A/Headers/SDL_pixels.h +++ b/quakespasm/MacOSX/SDL2.framework/Versions/A/Headers/SDL_pixels.h @@ -191,6 +191,9 @@ typedef enum SDL_PIXELFORMAT_RGB444 = SDL_DEFINE_PIXELFORMAT(SDL_PIXELTYPE_PACKED16, SDL_PACKEDORDER_XRGB, SDL_PACKEDLAYOUT_4444, 12, 2), + SDL_PIXELFORMAT_BGR444 = + SDL_DEFINE_PIXELFORMAT(SDL_PIXELTYPE_PACKED16, SDL_PACKEDORDER_XBGR, + SDL_PACKEDLAYOUT_4444, 12, 2), SDL_PIXELFORMAT_RGB555 = SDL_DEFINE_PIXELFORMAT(SDL_PIXELTYPE_PACKED16, SDL_PACKEDORDER_XRGB, SDL_PACKEDLAYOUT_1555, 15, 2), diff --git a/quakespasm/MacOSX/SDL2.framework/Versions/A/Headers/SDL_render.h b/quakespasm/MacOSX/SDL2.framework/Versions/A/Headers/SDL_render.h index c2a995af..f98c1843 100644 --- a/quakespasm/MacOSX/SDL2.framework/Versions/A/Headers/SDL_render.h +++ b/quakespasm/MacOSX/SDL2.framework/Versions/A/Headers/SDL_render.h @@ -85,6 +85,16 @@ typedef struct SDL_RendererInfo int max_texture_height; /**< The maximum texture height */ } SDL_RendererInfo; +/** + * \brief The scaling mode for a texture. + */ +typedef enum +{ + SDL_ScaleModeNearest, /**< nearest pixel sampling */ + SDL_ScaleModeLinear, /**< linear filtering */ + SDL_ScaleModeBest /**< anisotropic filtering */ +} SDL_ScaleMode; + /** * \brief The access pattern allowed for a texture. */ @@ -366,6 +376,35 @@ extern DECLSPEC int SDLCALL SDL_SetTextureBlendMode(SDL_Texture * texture, extern DECLSPEC int SDLCALL SDL_GetTextureBlendMode(SDL_Texture * texture, SDL_BlendMode *blendMode); +/** + * \brief Set the scale mode used for texture scale operations. + * + * \param texture The texture to update. + * \param scaleMode ::SDL_ScaleMode to use for texture scaling. + * + * \return 0 on success, or -1 if the texture is not valid. + * + * \note If the scale mode is not supported, the closest supported mode is + * chosen. + * + * \sa SDL_GetTextureScaleMode() + */ +extern DECLSPEC int SDLCALL SDL_SetTextureScaleMode(SDL_Texture * texture, + SDL_ScaleMode scaleMode); + +/** + * \brief Get the scale mode used for texture scale operations. + * + * \param texture The texture to query. + * \param scaleMode A pointer filled in with the current scale mode. + * + * \return 0 on success, or -1 if the texture is not valid. + * + * \sa SDL_SetTextureScaleMode() + */ +extern DECLSPEC int SDLCALL SDL_GetTextureScaleMode(SDL_Texture * texture, + SDL_ScaleMode *scaleMode); + /** * \brief Update the given texture rectangle with new pixel data. * diff --git a/quakespasm/MacOSX/SDL2.framework/Versions/A/Headers/SDL_revision.h b/quakespasm/MacOSX/SDL2.framework/Versions/A/Headers/SDL_revision.h index 4b9565d3..6996d603 100644 --- a/quakespasm/MacOSX/SDL2.framework/Versions/A/Headers/SDL_revision.h +++ b/quakespasm/MacOSX/SDL2.framework/Versions/A/Headers/SDL_revision.h @@ -1,2 +1,2 @@ -#define SDL_REVISION "hg-13229:0b98870c7f72" -#define SDL_REVISION_NUMBER 13229 +#define SDL_REVISION "hg-13387:8a12cc1abc9e" +#define SDL_REVISION_NUMBER 13387 diff --git a/quakespasm/MacOSX/SDL2.framework/Versions/A/Headers/SDL_stdinc.h b/quakespasm/MacOSX/SDL2.framework/Versions/A/Headers/SDL_stdinc.h index a95700af..014675b7 100644 --- a/quakespasm/MacOSX/SDL2.framework/Versions/A/Headers/SDL_stdinc.h +++ b/quakespasm/MacOSX/SDL2.framework/Versions/A/Headers/SDL_stdinc.h @@ -453,11 +453,14 @@ extern DECLSPEC void *SDLCALL SDL_memcpy(SDL_OUT_BYTECAP(len) void *dst, SDL_IN_ extern DECLSPEC void *SDLCALL SDL_memmove(SDL_OUT_BYTECAP(len) void *dst, SDL_IN_BYTECAP(len) const void *src, size_t len); extern DECLSPEC int SDLCALL SDL_memcmp(const void *s1, const void *s2, size_t len); -extern DECLSPEC wchar_t *SDLCALL SDL_wcsdup(const wchar_t *wstr); extern DECLSPEC size_t SDLCALL SDL_wcslen(const wchar_t *wstr); extern DECLSPEC size_t SDLCALL SDL_wcslcpy(SDL_OUT_Z_CAP(maxlen) wchar_t *dst, const wchar_t *src, size_t maxlen); extern DECLSPEC size_t SDLCALL SDL_wcslcat(SDL_INOUT_Z_CAP(maxlen) wchar_t *dst, const wchar_t *src, size_t maxlen); +extern DECLSPEC wchar_t *SDLCALL SDL_wcsdup(const wchar_t *wstr); +extern DECLSPEC wchar_t *SDLCALL SDL_wcsstr(const wchar_t *haystack, const wchar_t *needle); + extern DECLSPEC int SDLCALL SDL_wcscmp(const wchar_t *str1, const wchar_t *str2); +extern DECLSPEC int SDLCALL SDL_wcsncmp(const wchar_t *str1, const wchar_t *str2, size_t maxlen); extern DECLSPEC size_t SDLCALL SDL_strlen(const char *str); extern DECLSPEC size_t SDLCALL SDL_strlcpy(SDL_OUT_Z_CAP(maxlen) char *dst, const char *src, size_t maxlen); @@ -470,6 +473,7 @@ extern DECLSPEC char *SDLCALL SDL_strlwr(char *str); extern DECLSPEC char *SDLCALL SDL_strchr(const char *str, int c); extern DECLSPEC char *SDLCALL SDL_strrchr(const char *str, int c); extern DECLSPEC char *SDLCALL SDL_strstr(const char *haystack, const char *needle); +extern DECLSPEC char *SDLCALL SDL_strtokr(char *s1, const char *s2, char **saveptr); extern DECLSPEC size_t SDLCALL SDL_utf8strlen(const char *str); extern DECLSPEC char *SDLCALL SDL_itoa(int value, char *str, int radix); @@ -584,6 +588,7 @@ extern DECLSPEC char *SDLCALL SDL_iconv_string(const char *tocode, #define SDL_strchr strchr #define SDL_strrchr strrchr #define SDL_strstr strstr +#define SDL_strtokr strtok_r #define SDL_strcmp strcmp #define SDL_strncmp strncmp #define SDL_strcasecmp strcasecmp diff --git a/quakespasm/MacOSX/SDL2.framework/Versions/A/Headers/SDL_syswm.h b/quakespasm/MacOSX/SDL2.framework/Versions/A/Headers/SDL_syswm.h index 1469b235..c8236513 100644 --- a/quakespasm/MacOSX/SDL2.framework/Versions/A/Headers/SDL_syswm.h +++ b/quakespasm/MacOSX/SDL2.framework/Versions/A/Headers/SDL_syswm.h @@ -132,7 +132,8 @@ typedef enum SDL_SYSWM_WINRT, SDL_SYSWM_ANDROID, SDL_SYSWM_VIVANTE, - SDL_SYSWM_OS2 + SDL_SYSWM_OS2, + SDL_SYSWM_HAIKU } SDL_SYSWM_TYPE; /** diff --git a/quakespasm/MacOSX/SDL2.framework/Versions/A/SDL2 b/quakespasm/MacOSX/SDL2.framework/Versions/A/SDL2 index 326c1a44..b7080fd6 100755 Binary files a/quakespasm/MacOSX/SDL2.framework/Versions/A/SDL2 and b/quakespasm/MacOSX/SDL2.framework/Versions/A/SDL2 differ diff --git a/quakespasm/MacOSX/codecs/include/mpg123.h b/quakespasm/MacOSX/codecs/include/mpg123.h index 15019b8c..f5c5b66d 100644 --- a/quakespasm/MacOSX/codecs/include/mpg123.h +++ b/quakespasm/MacOSX/codecs/include/mpg123.h @@ -12,7 +12,7 @@ /* A macro to check at compile time which set of API functions to expect. This should be incremented at least each time a new symbol is added to the header. */ -#define MPG123_API_VERSION 41 +#define MPG123_API_VERSION 42 /* These aren't actually in use... seems to work without using libtool. */ #ifdef BUILD_MPG123_DLL @@ -86,6 +86,7 @@ typedef ptrdiff_t ssize_t; #define mpg123_set_index MPG123_LARGENAME(mpg123_set_index) #define mpg123_position MPG123_LARGENAME(mpg123_position) #define mpg123_length MPG123_LARGENAME(mpg123_length) +#define mpg123_framelength MPG123_LARGENAME(mpg123_framelength) #define mpg123_set_filesize MPG123_LARGENAME(mpg123_set_filesize) #define mpg123_replace_reader MPG123_LARGENAME(mpg123_replace_reader) #define mpg123_replace_reader_handle MPG123_LARGENAME(mpg123_replace_reader_handle) @@ -684,6 +685,7 @@ MPG123_EXPORT int mpg123_set_index(mpg123_handle *mh, off_t *offsets, off_t step /** Get information about current and remaining frames/seconds. * WARNING: This function is there because of special usage by standalone mpg123 and may be removed in the final version of libmpg123! + * broken for various cases (p.ex. 24 bit output). Do never use. * You provide an offset (in frames) from now and a number of output bytes * served by libmpg123 but not yet played. You get the projected current frame * and seconds, as well as the remaining frames/seconds. This does _not_ care @@ -812,6 +814,10 @@ MPG123_EXPORT size_t mpg123_safe_buffer(void); */ MPG123_EXPORT int mpg123_scan(mpg123_handle *mh); +/** Return, if possible, the full (expected) length of current track in frames. + * \return length >= 0 or MPG123_ERR if there is no length guess possible. */ +MPG123_EXPORT off_t mpg123_framelength(mpg123_handle *mh); + /** Return, if possible, the full (expected) length of current track in samples. * \return length >= 0 or MPG123_ERR if there is no length guess possible. */ MPG123_EXPORT off_t mpg123_length(mpg123_handle *mh); diff --git a/quakespasm/MacOSX/codecs/lib/libmpg123.dylib b/quakespasm/MacOSX/codecs/lib/libmpg123.dylib index c6f0b282..951f8460 100755 Binary files a/quakespasm/MacOSX/codecs/lib/libmpg123.dylib and b/quakespasm/MacOSX/codecs/lib/libmpg123.dylib differ diff --git a/quakespasm/Quake/gl_model.c b/quakespasm/Quake/gl_model.c index a6b532db..1635d0bf 100644 --- a/quakespasm/Quake/gl_model.c +++ b/quakespasm/Quake/gl_model.c @@ -1309,8 +1309,8 @@ void CalcSurfaceExtents (msurface_t *s) int bmins[2], bmaxs[2]; int maxextent, lmscale; - mins[0] = mins[1] = 999999; - maxs[0] = maxs[1] = -999999; // FIXME: change these two to FLT_MAX/-FLT_MAX + mins[0] = mins[1] = FLT_MAX; + maxs[0] = maxs[1] = -FLT_MAX; tex = s->texinfo; @@ -1427,8 +1427,8 @@ void Mod_CalcSurfaceBounds (msurface_t *s) int i, e; mvertex_t *v; - s->mins[0] = s->mins[1] = s->mins[2] = 9999; - s->maxs[0] = s->maxs[1] = s->maxs[2] = -9999; + s->mins[0] = s->mins[1] = s->mins[2] = FLT_MAX; + s->maxs[0] = s->maxs[1] = s->maxs[2] = -FLT_MAX; for (i=0 ; inumedges ; i++) { @@ -2672,6 +2672,9 @@ static void * Mod_LoadAliasFrame (void * pin, maliasframedesc_t *frame, int pvty int i; daliasframe_t *pdaliasframe; + if (posenum >= MAXALIASFRAMES) + Sys_Error ("posenum >= MAXALIASFRAMES"); + pdaliasframe = (daliasframe_t *)pin; strcpy (frame->name, pdaliasframe->name); @@ -2735,6 +2738,8 @@ static void *Mod_LoadAliasGroup (void * pin, maliasframedesc_t *frame, int pvty for (i=0 ; i= MAXALIASFRAMES) Sys_Error ("posenum >= MAXALIASFRAMES"); + poseverts_mdl[posenum] = (trivertx_t *)((daliasframe_t *)ptemp + 1); posenum++; @@ -2984,8 +2989,8 @@ void Mod_CalcAliasBounds (aliashdr_t *a) //clear out all data for (i=0; i<3;i++) { - loadmodel->mins[i] = loadmodel->ymins[i] = loadmodel->rmins[i] = 999999; - loadmodel->maxs[i] = loadmodel->ymaxs[i] = loadmodel->rmaxs[i] = -999999; + loadmodel->mins[i] = loadmodel->ymins[i] = loadmodel->rmins[i] = FLT_MAX; + loadmodel->maxs[i] = loadmodel->ymaxs[i] = loadmodel->rmaxs[i] = -FLT_MAX; } radius = yawradius = 0; diff --git a/quakespasm/Quake/gl_sky.c b/quakespasm/Quake/gl_sky.c index 3f461f3f..dabf0f5e 100644 --- a/quakespasm/Quake/gl_sky.c +++ b/quakespasm/Quake/gl_sky.c @@ -40,7 +40,7 @@ qboolean skyroom_enabled; vec4_t skyroom_origin; vec4_t skyroom_orientation; -char skybox_name[32] = ""; //name of current skybox, or "" if no skybox +char skybox_name[1024]; //name of current skybox, or "" if no skybox gltexture_t *skybox_textures[6]; gltexture_t *solidskytexture, *alphaskytexture; @@ -226,7 +226,7 @@ void Sky_LoadSkyBox (const char *name) return; } - strcpy(skybox_name, name); + q_strlcpy(skybox_name, name, sizeof(skybox_name)); } /* @@ -396,6 +396,7 @@ void Sky_Init (void) Cmd_AddCommand ("sky",Sky_SkyCommand_f); Cmd_AddCommand ("skyroom",Sky_SkyRoomCommand_f); + skybox_name[0] = 0; for (i=0; i<6; i++) skybox_textures[i] = NULL; } @@ -1065,8 +1066,8 @@ void Sky_DrawSky (void) // for (i=0 ; i<6 ; i++) { - skymins[0][i] = skymins[1][i] = 9999; - skymaxs[0][i] = skymaxs[1][i] = -9999; + skymins[0][i] = skymins[1][i] = FLT_MAX; + skymaxs[0][i] = skymaxs[1][i] = -FLT_MAX; } // diff --git a/quakespasm/Quake/gl_warp.c b/quakespasm/Quake/gl_warp.c index 0214531f..c2faa938 100644 --- a/quakespasm/Quake/gl_warp.c +++ b/quakespasm/Quake/gl_warp.c @@ -56,8 +56,8 @@ void BoundPoly (int numverts, float *verts, vec3_t mins, vec3_t maxs) int i, j; float *v; - mins[0] = mins[1] = mins[2] = 999999999; - maxs[0] = maxs[1] = maxs[2] = -999999999; + mins[0] = mins[1] = mins[2] = FLT_MAX; + maxs[0] = maxs[1] = maxs[2] = -FLT_MAX; v = verts; for (i=0 ; i #include #include +#include /*==========================================================================*/ @@ -79,13 +80,11 @@ #define Q_MAXSHORT ((short)0x7fff) #define Q_MAXINT ((int)0x7fffffff) #define Q_MAXLONG ((int)0x7fffffff) -#define Q_MAXFLOAT ((int)0x7fffffff) #define Q_MINCHAR ((char)0x80) #define Q_MINSHORT ((short)0x8000) #define Q_MININT ((int)0x80000000) #define Q_MINLONG ((int)0x80000000) -#define Q_MINFLOAT ((int)0x7fffffff) /* Make sure the types really have the right * sizes: These macros are from SDL headers. diff --git a/quakespasm/Quake/snd_mp3tag.c b/quakespasm/Quake/snd_mp3tag.c index 3d9bd0b5..d778d10a 100644 --- a/quakespasm/Quake/snd_mp3tag.c +++ b/quakespasm/Quake/snd_mp3tag.c @@ -1,5 +1,5 @@ /* MP3 TAGS STUFF -- put together using public specs. - * Copyright (C) 2018-2019 O.Sezer + * Copyright (C) 2018-2019 O. Sezer * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -23,14 +23,14 @@ #include "snd_codec.h" #include "q_ctype.h" -static inline qboolean tag_is_id3v1(const unsigned char *data, size_t length) { +static inline qboolean is_id3v1(const unsigned char *data, long length) { /* http://id3.org/ID3v1 : 3 bytes "TAG" identifier and 125 bytes tag data */ - if (length < 3 || memcmp(data,"TAG",3) != 0) { + if (length < 128 || memcmp(data,"TAG",3) != 0) { return false; } return true; } -static inline qboolean tag_is_id3v2(const unsigned char *data, size_t length) { +static qboolean is_id3v2(const unsigned char *data, size_t length) { /* ID3v2 header is 10 bytes: http://id3.org/id3v2.4.0-structure */ /* bytes 0-2: "ID3" identifier */ if (length < 10 || memcmp(data,"ID3",3) != 0) { @@ -48,7 +48,7 @@ static inline qboolean tag_is_id3v2(const unsigned char *data, size_t length) { } return true; } -static inline long get_id3v2_len(const unsigned char *data, long length) { +static long get_id3v2_len(const unsigned char *data, long length) { /* size is a 'synchsafe' integer (see above) */ long size = (long)((data[6]<<21) + (data[7]<<14) + (data[8]<<7) + data[9]); size += 10; /* header size */ @@ -64,7 +64,7 @@ static inline long get_id3v2_len(const unsigned char *data, long length) { } return size; } -static inline qboolean tag_is_apetag(const unsigned char *data, size_t length) { +static qboolean is_apetag(const unsigned char *data, size_t length) { /* http://wiki.hydrogenaud.io/index.php?title=APEv2_specification * Header/footer is 32 bytes: bytes 0-7 ident, bytes 8-11 version, * bytes 12-17 size. bytes 24-31 are reserved: must be all zeroes. */ @@ -83,7 +83,7 @@ static inline qboolean tag_is_apetag(const unsigned char *data, size_t length) { } return true; } -static inline long get_ape_len(const unsigned char *data) { +static long get_ape_len(const unsigned char *data) { unsigned int flags, version; long size = (long)((data[15]<<24) | (data[14]<<16) | (data[13]<<8) | data[12]); version = (unsigned)((data[11]<<24) | (data[10]<<16) | (data[9]<<8) | data[8]); @@ -91,7 +91,7 @@ static inline long get_ape_len(const unsigned char *data) { if (version == 2000U && (flags & (1U<<31))) size += 32; /* header present. */ return size; } -static inline int is_lyrics3tag(const unsigned char *data, size_t length) { +static inline int is_lyrics3tag(const unsigned char *data, long length) { /* http://id3.org/Lyrics3 * http://id3.org/Lyrics3v2 */ if (length < 15) return 0; @@ -99,7 +99,7 @@ static inline int is_lyrics3tag(const unsigned char *data, size_t length) { if (memcmp(data+6,"LYRICSEND",9) == 0) return 1; /* v1 */ return 0; } -static inline long get_lyrics3v1_len(snd_stream_t *stream) { +static long get_lyrics3v1_len(snd_stream_t *stream) { const char *p; long i, len; char buf[5104]; /* needs manual search: http://id3.org/Lyrics3 */ @@ -115,19 +115,19 @@ static inline long get_lyrics3v1_len(snd_stream_t *stream) { if (i < 0) return -1; return len - (long)(p - buf) + 9 /* footer */; } -static inline long get_lyrics3v2_len(const unsigned char *data, size_t length) { +static inline long get_lyrics3v2_len(const unsigned char *data, long length) { /* 6 bytes before the end marker is size in decimal format - * does not include the 9 bytes end marker and size field. */ if (length != 6) return 0; return strtol((const char *)data, NULL, 10) + 15; } -static inline qboolean verify_lyrics3v2(const unsigned char *data, size_t length) { +static inline qboolean verify_lyrics3v2(const unsigned char *data, long length) { if (length < 11) return false; if (memcmp(data,"LYRICSBEGIN",11) == 0) return true; return false; } #define MMTAG_PARANOID -static inline qboolean is_musicmatch(const unsigned char *data, long length) { +static qboolean is_musicmatch(const unsigned char *data, long length) { /* From docs/musicmatch.txt in id3lib: https://sourceforge.net/projects/id3lib/ Overall tag structure: @@ -170,7 +170,7 @@ static inline qboolean is_musicmatch(const unsigned char *data, long length) { #endif return true; } -static inline long get_musicmatch_len(snd_stream_t *stream) { +static long get_musicmatch_len(snd_stream_t *stream) { const int metasizes[4] = { 7868, 7936, 8004, 8132 }; const unsigned char syncstr[10] = {'1','8','2','7','3','6','4','5',0,0}; unsigned char buf[256]; @@ -237,20 +237,113 @@ static inline long get_musicmatch_len(snd_stream_t *stream) { return len + 256; /* header is present. */ } +static int probe_id3v1(snd_stream_t *stream, unsigned char *buf, int atend) { + if (stream->fh.length >= 128) { + FS_fseek(&stream->fh, -128, SEEK_END); + if (FS_fread(buf, 1, 128, &stream->fh) != 128) + return -1; + if (is_id3v1(buf, 128)) { + if (!atend) { /* possible false positive? */ + if (is_musicmatch(buf + 128 - 48, 48) || + is_apetag (buf + 128 - 32, 32) || + is_lyrics3tag(buf + 128 - 15, 15)) { + return 0; + } + } + stream->fh.length -= 128; + Con_DPrintf("MP3: skipped %ld bytes ID3v1 tag\n", 128L); + return 1; + /* FIXME: handle possible double-ID3v1 tags? */ + } + } + return 0; +} +static int probe_mmtag(snd_stream_t *stream, unsigned char *buf) { + long len; + if (stream->fh.length >= 68) { + FS_fseek(&stream->fh, -48, SEEK_END); + if (FS_fread(buf, 1, 48, &stream->fh) != 48) + return -1; + if (is_musicmatch(buf, 48)) { + len = get_musicmatch_len(stream); + if (len < 0) return -1; + if (len >= stream->fh.length) return -1; + stream->fh.length -= len; + Con_DPrintf("MP3: skipped %ld bytes MusicMatch tag\n", len); + return 1; + } + } + return 0; +} +static int probe_apetag(snd_stream_t *stream, unsigned char *buf) { + long len; + if (stream->fh.length >= 32) { + FS_fseek(&stream->fh, -32, SEEK_END); + if (FS_fread(buf, 1, 32, &stream->fh) != 32) + return -1; + if (is_apetag(buf, 32)) { + len = get_ape_len(buf); + if (len >= stream->fh.length) return -1; + stream->fh.length -= len; + Con_DPrintf("MP3: skipped %ld bytes APE tag\n", len); + return 1; + } + } + return 0; +} +static int probe_lyrics3(snd_stream_t *stream, unsigned char *buf) { + long len; + if (stream->fh.length >= 15) { + FS_fseek(&stream->fh, -15, SEEK_END); + if (FS_fread(buf, 1, 15, &stream->fh) != 15) + return -1; + len = is_lyrics3tag(buf, 15); + if (len == 2) { + len = get_lyrics3v2_len(buf, 6); + if (len >= stream->fh.length) return -1; + if (len < 15) return -1; + FS_fseek(&stream->fh, -len, SEEK_END); + if (FS_fread(buf, 1, 11, &stream->fh) != 11) + return -1; + if (!verify_lyrics3v2(buf, 11)) return -1; + stream->fh.length -= len; + Con_DPrintf("MP3: skipped %ld bytes Lyrics3 tag\n", len); + return 1; + } + else if (len == 1) { + len = get_lyrics3v1_len(stream); + if (len < 0) return -1; + stream->fh.length -= len; + Con_DPrintf("MP3: skipped %ld bytes Lyrics3 tag\n", len); + return 1; + } + } + return 0; +} + int mp3_skiptags(snd_stream_t *stream) { unsigned char buf[128]; long len; size_t readsize; + int c_id3, c_ape, c_lyr, c_mm; int rc = -1; /* failsafe */ long oldlength = stream->fh.length; long oldstart = stream->fh.start; + /* MP3 standard has no metadata format, so everyone invented + * their own thing, even with extensions, until ID3v2 became + * dominant: Hence the impossible mess here. + * + * Note: I don't yet care about freaky broken mp3 files with + * double tags. -- O.S. + */ + readsize = FS_fread(buf, 1, 128, &stream->fh); if (!readsize || FS_ferror(&stream->fh)) goto fail; /* ID3v2 tag is at the start */ - if (tag_is_id3v2(buf, readsize)) { + if (is_id3v2(buf, readsize)) { len = get_id3v2_len(buf, (long)readsize); if (len >= stream->fh.length) goto fail; stream->fh.start += len; @@ -259,7 +352,7 @@ int mp3_skiptags(snd_stream_t *stream) } /* APE tag _might_ be at the start (discouraged * but not forbidden, either.) read the header. */ - else if (tag_is_apetag(buf, readsize)) { + else if (is_apetag(buf, readsize)) { len = get_ape_len(buf); if (len >= stream->fh.length) goto fail; stream->fh.start += len; @@ -267,71 +360,38 @@ int mp3_skiptags(snd_stream_t *stream) Con_DPrintf("MP3: skipped %ld bytes APE tag\n", len); } + /* it's not impossible that _old_ MusicMatch tag + * placing itself after ID3v1. */ + if ((c_mm = probe_mmtag(stream, buf)) < 0) { + goto fail; + } /* ID3v1 tag is at the end */ - if (stream->fh.length >= 128) { - FS_fseek(&stream->fh, -128, SEEK_END); - readsize = FS_fread(buf, 1, 128, &stream->fh); - if (readsize != 128) goto fail; - if (tag_is_id3v1(buf, 128)) { - stream->fh.length -= 128; - Con_DPrintf("MP3: skipped %ld bytes ID3v1 tag\n", 128L); - /* FIXME: handle possible double-ID3v1 tags? */ - } + if ((c_id3 = probe_id3v1(stream, buf, !c_mm)) < 0) { + goto fail; } - - /* do we know whether ape or lyrics3 is the first? - * well, we don't: we need to handle that later... */ - - /* check for the _old_ MusicMatch tag at end. */ - if (stream->fh.length >= 68) { - FS_fseek(&stream->fh, -48, SEEK_END); - readsize = FS_fread(buf, 1, 48, &stream->fh); - if (readsize != 48) goto fail; - if (is_musicmatch(buf, 48)) { - len = get_musicmatch_len(stream); - if (len < 0) goto fail; - if (len >= stream->fh.length) goto fail; - stream->fh.length -= len; - Con_DPrintf("MP3: skipped %ld bytes MusicMatch tag\n", len); + /* we do not know the order of ape or lyrics3 + * or musicmatch tags, hence the loop here.. */ + c_ape = 0; + c_lyr = 0; + for (;;) { + if (!c_lyr) { + /* care about mp3s with double Lyrics3 tags? */ + if ((c_lyr = probe_lyrics3(stream, buf)) < 0) + goto fail; + if (c_lyr) continue; } - } - - /* APE tag may be at the end: read the footer */ - if (stream->fh.length >= 32) { - FS_fseek(&stream->fh, -32, SEEK_END); - readsize = FS_fread(buf, 1, 32, &stream->fh); - if (readsize != 32) goto fail; - if (tag_is_apetag(buf, 32)) { - len = get_ape_len(buf); - if (len >= stream->fh.length) goto fail; - stream->fh.length -= len; - Con_DPrintf("MP3: skipped %ld bytes APE tag\n", len); + if (!c_mm) { + if ((c_mm = probe_mmtag(stream, buf)) < 0) + goto fail; + if (c_mm) continue; } - } - - if (stream->fh.length >= 15) { - FS_fseek(&stream->fh, -15, SEEK_END); - readsize = FS_fread(buf, 1, 15, &stream->fh); - if (readsize != 15) goto fail; - len = is_lyrics3tag(buf, 15); - if (len == 2) { - len = get_lyrics3v2_len(buf, 6); - if (len >= stream->fh.length) goto fail; - if (len < 15) goto fail; - FS_fseek(&stream->fh, -len, SEEK_END); - readsize = FS_fread(buf, 1, 11, &stream->fh); - if (readsize != 11) goto fail; - if (!verify_lyrics3v2(buf, 11)) goto fail; - stream->fh.length -= len; - Con_DPrintf("MP3: skipped %ld bytes Lyrics3 tag\n", len); + if (!c_ape) { + if ((c_ape = probe_apetag(stream, buf)) < 0) + goto fail; + if (c_ape) continue; } - else if (len == 1) { - len = get_lyrics3v1_len(stream); - if (len < 0) goto fail; - stream->fh.length -= len; - Con_DPrintf("MP3: skipped %ld bytes Lyrics3 tag\n", len); - } - } + break; + } /* for (;;) */ rc = (stream->fh.length > 0)? 0 : -1; fail: @@ -342,5 +402,4 @@ int mp3_skiptags(snd_stream_t *stream) FS_rewind(&stream->fh); return rc; } - #endif /* USE_CODEC_MP3 */ diff --git a/quakespasm/Windows/SDL2/include/SDL_config_android.h b/quakespasm/Windows/SDL2/include/SDL_config_android.h index 8f534860..9cb70bfe 100644 --- a/quakespasm/Windows/SDL2/include/SDL_config_android.h +++ b/quakespasm/Windows/SDL2/include/SDL_config_android.h @@ -71,6 +71,7 @@ #define HAVE_STRCHR 1 #define HAVE_STRRCHR 1 #define HAVE_STRSTR 1 +#define HAVE_STRTOK_R 1 #define HAVE_STRTOL 1 #define HAVE_STRTOUL 1 #define HAVE_STRTOLL 1 diff --git a/quakespasm/Windows/SDL2/include/SDL_config_iphoneos.h b/quakespasm/Windows/SDL2/include/SDL_config_iphoneos.h index 8137085e..edfc03e2 100644 --- a/quakespasm/Windows/SDL2/include/SDL_config_iphoneos.h +++ b/quakespasm/Windows/SDL2/include/SDL_config_iphoneos.h @@ -71,6 +71,7 @@ #define HAVE_STRCHR 1 #define HAVE_STRRCHR 1 #define HAVE_STRSTR 1 +#define HAVE_STRTOK_R 1 #define HAVE_STRTOL 1 #define HAVE_STRTOUL 1 #define HAVE_STRTOLL 1 diff --git a/quakespasm/Windows/SDL2/include/SDL_config_macosx.h b/quakespasm/Windows/SDL2/include/SDL_config_macosx.h index 2035f2d0..22287dfc 100644 --- a/quakespasm/Windows/SDL2/include/SDL_config_macosx.h +++ b/quakespasm/Windows/SDL2/include/SDL_config_macosx.h @@ -74,6 +74,7 @@ #define HAVE_STRCHR 1 #define HAVE_STRRCHR 1 #define HAVE_STRSTR 1 +#define HAVE_STRTOK_R 1 #define HAVE_STRTOL 1 #define HAVE_STRTOUL 1 #define HAVE_STRTOLL 1 diff --git a/quakespasm/Windows/SDL2/include/SDL_config_os2.h b/quakespasm/Windows/SDL2/include/SDL_config_os2.h index bc75b3a7..f03ca4a5 100644 --- a/quakespasm/Windows/SDL2/include/SDL_config_os2.h +++ b/quakespasm/Windows/SDL2/include/SDL_config_os2.h @@ -110,6 +110,7 @@ #define HAVE_STRCHR 1 #define HAVE_STRRCHR 1 #define HAVE_STRSTR 1 +/* #undef HAVE_STRTOK_R */ #define HAVE_ITOA 1 #define HAVE__LTOA 1 #define HAVE__ULTOA 1 @@ -122,12 +123,21 @@ #define HAVE_STRTOD 1 #define HAVE_ATOI 1 #define HAVE_ATOF 1 +#define HAVE_WCSLEN 1 +#define HAVE_WCSLCPY 1 +#define HAVE_WCSLCAT 1 +/* #define HAVE_WCSDUP 1 */ +/* #define wcsdup _wcsdup */ +#define HAVE_WCSSTR 1 +#define HAVE_WCSCMP 1 +#define HAVE_WCSNCMP 1 #define HAVE_STRCMP 1 #define HAVE_STRNCMP 1 #define HAVE_STRICMP 1 #define HAVE_STRCASECMP 1 #define HAVE_STRNCASECMP 1 -#define HAVE_SSCANF 1 +#define HAVE_SSCANF 1 +#define HAVE_VSSCANF 1 #define HAVE_SNPRINTF 1 #define HAVE_VSNPRINTF 1 #define HAVE_SETJMP 1 diff --git a/quakespasm/Windows/SDL2/include/SDL_config_windows.h b/quakespasm/Windows/SDL2/include/SDL_config_windows.h index cae9902d..c66d8754 100644 --- a/quakespasm/Windows/SDL2/include/SDL_config_windows.h +++ b/quakespasm/Windows/SDL2/include/SDL_config_windows.h @@ -117,6 +117,10 @@ typedef unsigned int uintptr_t; #define HAVE_STRCHR 1 #define HAVE_STRRCHR 1 #define HAVE_STRSTR 1 +/* #undef HAVE_STRTOK_R */ +#if defined(_MSC_VER) +#define HAVE_STRTOK_S 1 +#endif /* These functions have security warnings, so we won't use them */ /* #undef HAVE__LTOA */ /* #undef HAVE__ULTOA */ diff --git a/quakespasm/Windows/SDL2/include/SDL_config_winrt.h b/quakespasm/Windows/SDL2/include/SDL_config_winrt.h index 8eeeb512..cb85b234 100644 --- a/quakespasm/Windows/SDL2/include/SDL_config_winrt.h +++ b/quakespasm/Windows/SDL2/include/SDL_config_winrt.h @@ -130,6 +130,7 @@ typedef unsigned int uintptr_t; #define HAVE_STRCHR 1 #define HAVE_STRRCHR 1 #define HAVE_STRSTR 1 +#define HAVE_STRTOK_S 1 //#define HAVE_ITOA 1 // TODO, WinRT: consider using _itoa_s instead //#define HAVE__LTOA 1 // TODO, WinRT: consider using _ltoa_s instead //#define HAVE__ULTOA 1 // TODO, WinRT: consider using _ultoa_s instead diff --git a/quakespasm/Windows/SDL2/include/SDL_config_wiz.h b/quakespasm/Windows/SDL2/include/SDL_config_wiz.h index c5eb9b34..724c55fc 100644 --- a/quakespasm/Windows/SDL2/include/SDL_config_wiz.h +++ b/quakespasm/Windows/SDL2/include/SDL_config_wiz.h @@ -67,6 +67,7 @@ #define HAVE_STRCHR 1 #define HAVE_STRRCHR 1 #define HAVE_STRSTR 1 +#define HAVE_STRTOK_R 1 #define HAVE_STRTOL 1 #define HAVE_STRTOUL 1 #define HAVE_STRTOLL 1 diff --git a/quakespasm/Windows/SDL2/include/SDL_gamecontroller.h b/quakespasm/Windows/SDL2/include/SDL_gamecontroller.h index ebde3871..5ee8e8e9 100644 --- a/quakespasm/Windows/SDL2/include/SDL_gamecontroller.h +++ b/quakespasm/Windows/SDL2/include/SDL_gamecontroller.h @@ -57,6 +57,15 @@ extern "C" { struct _SDL_GameController; typedef struct _SDL_GameController SDL_GameController; +typedef enum +{ + SDL_CONTROLLER_TYPE_UNKNOWN = 0, + SDL_CONTROLLER_TYPE_XBOX360, + SDL_CONTROLLER_TYPE_XBOXONE, + SDL_CONTROLLER_TYPE_PS3, + SDL_CONTROLLER_TYPE_PS4, + SDL_CONTROLLER_TYPE_NINTENDO_SWITCH_PRO +} SDL_GameControllerType; typedef enum { @@ -175,6 +184,12 @@ extern DECLSPEC SDL_bool SDLCALL SDL_IsGameController(int joystick_index); */ extern DECLSPEC const char *SDLCALL SDL_GameControllerNameForIndex(int joystick_index); +/** + * Get the type of a game controller. + * This can be called before any controllers are opened. + */ +extern DECLSPEC SDL_GameControllerType SDLCALL SDL_GameControllerTypeForIndex(int joystick_index); + /** * Get the mapping of a game controller. * This can be called before any controllers are opened. @@ -199,11 +214,21 @@ extern DECLSPEC SDL_GameController *SDLCALL SDL_GameControllerOpen(int joystick_ */ extern DECLSPEC SDL_GameController *SDLCALL SDL_GameControllerFromInstanceID(SDL_JoystickID joyid); +/** + * Return the SDL_GameController associated with a player index. + */ +extern DECLSPEC SDL_GameController *SDLCALL SDL_GameControllerFromPlayerIndex(int player_index); + /** * Return the name for this currently opened controller */ extern DECLSPEC const char *SDLCALL SDL_GameControllerName(SDL_GameController *gamecontroller); +/** + * Return the type of this currently opened controller + */ +extern DECLSPEC SDL_GameControllerType SDLCALL SDL_GameControllerGetType(SDL_GameController *gamecontroller); + /** * Get the player index of an opened game controller, or -1 if it's not available * @@ -211,6 +236,11 @@ extern DECLSPEC const char *SDLCALL SDL_GameControllerName(SDL_GameController *g */ extern DECLSPEC int SDLCALL SDL_GameControllerGetPlayerIndex(SDL_GameController *gamecontroller); +/** + * Set the player index of an opened game controller + */ +extern DECLSPEC void SDLCALL SDL_GameControllerSetPlayerIndex(SDL_GameController *gamecontroller, int player_index); + /** * Get the USB vendor ID of an opened controller, if available. * If the vendor ID isn't available this function returns 0. diff --git a/quakespasm/Windows/SDL2/include/SDL_hints.h b/quakespasm/Windows/SDL2/include/SDL_hints.h index 7703095c..d36815b9 100644 --- a/quakespasm/Windows/SDL2/include/SDL_hints.h +++ b/quakespasm/Windows/SDL2/include/SDL_hints.h @@ -164,6 +164,21 @@ extern "C" { */ #define SDL_HINT_VIDEO_ALLOW_SCREENSAVER "SDL_VIDEO_ALLOW_SCREENSAVER" +/** + * \brief A variable controlling whether the graphics context is externally managed. + * + * This variable can be set to the following values: + * "0" - SDL will manage graphics contexts that are attached to windows. + * "1" - Disable graphics context management on windows. + * + * By default SDL will manage OpenGL contexts in certain situations. For example, on Android the + * context will be automatically saved and restored when pausing the application. Additionally, some + * platforms will assume usage of OpenGL if Vulkan isn't used. Setting this to "1" will prevent this + * behavior, which is desireable when the application manages the graphics context, such as + * an externally managed OpenGL context or attaching a Vulkan surface to the window. + */ +#define SDL_HINT_VIDEO_EXTERNAL_CONTEXT "SDL_VIDEO_EXTERNAL_CONTEXT" + /** * \brief A variable controlling whether the X11 VidMode extension should be used. * @@ -507,7 +522,7 @@ extern "C" { * "0" - Report the face buttons by position, as though they were on an Xbox controller. * "1" - Report the face buttons by label instead of position * - * The default value is "0". This hint may be set at any time. + * The default value is "1". This hint may be set at any time. */ #define SDL_HINT_GAMECONTROLLER_USE_BUTTON_LABELS "SDL_GAMECONTROLLER_USE_BUTTON_LABELS" @@ -594,6 +609,17 @@ extern "C" { */ #define SDL_HINT_JOYSTICK_HIDAPI_XBOX "SDL_JOYSTICK_HIDAPI_XBOX" +/** + * \brief A variable controlling whether the HIDAPI driver for Nintendo GameCube controllers should be used. + * + * This variable can be set to the following values: + * "0" - HIDAPI driver is not used + * "1" - HIDAPI driver is used + * + * The default is the value of SDL_HINT_JOYSTICK_HIDAPI + */ +#define SDL_HINT_JOYSTICK_HIDAPI_GAMECUBE "SDL_JOYSTICK_HIDAPI_GAMECUBE" + /** * \brief A variable that controls whether Steam Controllers should be exposed using the SDL joystick and game controller APIs * diff --git a/quakespasm/Windows/SDL2/include/SDL_joystick.h b/quakespasm/Windows/SDL2/include/SDL_joystick.h index 3a4c5d17..3c099dec 100644 --- a/quakespasm/Windows/SDL2/include/SDL_joystick.h +++ b/quakespasm/Windows/SDL2/include/SDL_joystick.h @@ -192,7 +192,12 @@ extern DECLSPEC SDL_Joystick *SDLCALL SDL_JoystickOpen(int device_index); /** * Return the SDL_Joystick associated with an instance id. */ -extern DECLSPEC SDL_Joystick *SDLCALL SDL_JoystickFromInstanceID(SDL_JoystickID joyid); +extern DECLSPEC SDL_Joystick *SDLCALL SDL_JoystickFromInstanceID(SDL_JoystickID instance_id); + +/** + * Return the SDL_Joystick associated with a player index. + */ +extern DECLSPEC SDL_Joystick *SDLCALL SDL_JoystickFromPlayerIndex(int player_index); /** * Return the name for this currently opened joystick. @@ -207,6 +212,11 @@ extern DECLSPEC const char *SDLCALL SDL_JoystickName(SDL_Joystick * joystick); */ extern DECLSPEC int SDLCALL SDL_JoystickGetPlayerIndex(SDL_Joystick * joystick); +/** + * Set the player index of an opened joystick + */ +extern DECLSPEC void SDLCALL SDL_JoystickSetPlayerIndex(SDL_Joystick * joystick, int player_index); + /** * Return the GUID for this opened joystick */ diff --git a/quakespasm/Windows/SDL2/include/SDL_pixels.h b/quakespasm/Windows/SDL2/include/SDL_pixels.h index 2e2b05c7..753f617a 100644 --- a/quakespasm/Windows/SDL2/include/SDL_pixels.h +++ b/quakespasm/Windows/SDL2/include/SDL_pixels.h @@ -191,6 +191,9 @@ typedef enum SDL_PIXELFORMAT_RGB444 = SDL_DEFINE_PIXELFORMAT(SDL_PIXELTYPE_PACKED16, SDL_PACKEDORDER_XRGB, SDL_PACKEDLAYOUT_4444, 12, 2), + SDL_PIXELFORMAT_BGR444 = + SDL_DEFINE_PIXELFORMAT(SDL_PIXELTYPE_PACKED16, SDL_PACKEDORDER_XBGR, + SDL_PACKEDLAYOUT_4444, 12, 2), SDL_PIXELFORMAT_RGB555 = SDL_DEFINE_PIXELFORMAT(SDL_PIXELTYPE_PACKED16, SDL_PACKEDORDER_XRGB, SDL_PACKEDLAYOUT_1555, 15, 2), diff --git a/quakespasm/Windows/SDL2/include/SDL_render.h b/quakespasm/Windows/SDL2/include/SDL_render.h index c2a995af..f98c1843 100644 --- a/quakespasm/Windows/SDL2/include/SDL_render.h +++ b/quakespasm/Windows/SDL2/include/SDL_render.h @@ -85,6 +85,16 @@ typedef struct SDL_RendererInfo int max_texture_height; /**< The maximum texture height */ } SDL_RendererInfo; +/** + * \brief The scaling mode for a texture. + */ +typedef enum +{ + SDL_ScaleModeNearest, /**< nearest pixel sampling */ + SDL_ScaleModeLinear, /**< linear filtering */ + SDL_ScaleModeBest /**< anisotropic filtering */ +} SDL_ScaleMode; + /** * \brief The access pattern allowed for a texture. */ @@ -366,6 +376,35 @@ extern DECLSPEC int SDLCALL SDL_SetTextureBlendMode(SDL_Texture * texture, extern DECLSPEC int SDLCALL SDL_GetTextureBlendMode(SDL_Texture * texture, SDL_BlendMode *blendMode); +/** + * \brief Set the scale mode used for texture scale operations. + * + * \param texture The texture to update. + * \param scaleMode ::SDL_ScaleMode to use for texture scaling. + * + * \return 0 on success, or -1 if the texture is not valid. + * + * \note If the scale mode is not supported, the closest supported mode is + * chosen. + * + * \sa SDL_GetTextureScaleMode() + */ +extern DECLSPEC int SDLCALL SDL_SetTextureScaleMode(SDL_Texture * texture, + SDL_ScaleMode scaleMode); + +/** + * \brief Get the scale mode used for texture scale operations. + * + * \param texture The texture to query. + * \param scaleMode A pointer filled in with the current scale mode. + * + * \return 0 on success, or -1 if the texture is not valid. + * + * \sa SDL_SetTextureScaleMode() + */ +extern DECLSPEC int SDLCALL SDL_GetTextureScaleMode(SDL_Texture * texture, + SDL_ScaleMode *scaleMode); + /** * \brief Update the given texture rectangle with new pixel data. * diff --git a/quakespasm/Windows/SDL2/include/SDL_revision.h b/quakespasm/Windows/SDL2/include/SDL_revision.h index 4b9565d3..6996d603 100644 --- a/quakespasm/Windows/SDL2/include/SDL_revision.h +++ b/quakespasm/Windows/SDL2/include/SDL_revision.h @@ -1,2 +1,2 @@ -#define SDL_REVISION "hg-13229:0b98870c7f72" -#define SDL_REVISION_NUMBER 13229 +#define SDL_REVISION "hg-13387:8a12cc1abc9e" +#define SDL_REVISION_NUMBER 13387 diff --git a/quakespasm/Windows/SDL2/include/SDL_stdinc.h b/quakespasm/Windows/SDL2/include/SDL_stdinc.h index a95700af..014675b7 100644 --- a/quakespasm/Windows/SDL2/include/SDL_stdinc.h +++ b/quakespasm/Windows/SDL2/include/SDL_stdinc.h @@ -453,11 +453,14 @@ extern DECLSPEC void *SDLCALL SDL_memcpy(SDL_OUT_BYTECAP(len) void *dst, SDL_IN_ extern DECLSPEC void *SDLCALL SDL_memmove(SDL_OUT_BYTECAP(len) void *dst, SDL_IN_BYTECAP(len) const void *src, size_t len); extern DECLSPEC int SDLCALL SDL_memcmp(const void *s1, const void *s2, size_t len); -extern DECLSPEC wchar_t *SDLCALL SDL_wcsdup(const wchar_t *wstr); extern DECLSPEC size_t SDLCALL SDL_wcslen(const wchar_t *wstr); extern DECLSPEC size_t SDLCALL SDL_wcslcpy(SDL_OUT_Z_CAP(maxlen) wchar_t *dst, const wchar_t *src, size_t maxlen); extern DECLSPEC size_t SDLCALL SDL_wcslcat(SDL_INOUT_Z_CAP(maxlen) wchar_t *dst, const wchar_t *src, size_t maxlen); +extern DECLSPEC wchar_t *SDLCALL SDL_wcsdup(const wchar_t *wstr); +extern DECLSPEC wchar_t *SDLCALL SDL_wcsstr(const wchar_t *haystack, const wchar_t *needle); + extern DECLSPEC int SDLCALL SDL_wcscmp(const wchar_t *str1, const wchar_t *str2); +extern DECLSPEC int SDLCALL SDL_wcsncmp(const wchar_t *str1, const wchar_t *str2, size_t maxlen); extern DECLSPEC size_t SDLCALL SDL_strlen(const char *str); extern DECLSPEC size_t SDLCALL SDL_strlcpy(SDL_OUT_Z_CAP(maxlen) char *dst, const char *src, size_t maxlen); @@ -470,6 +473,7 @@ extern DECLSPEC char *SDLCALL SDL_strlwr(char *str); extern DECLSPEC char *SDLCALL SDL_strchr(const char *str, int c); extern DECLSPEC char *SDLCALL SDL_strrchr(const char *str, int c); extern DECLSPEC char *SDLCALL SDL_strstr(const char *haystack, const char *needle); +extern DECLSPEC char *SDLCALL SDL_strtokr(char *s1, const char *s2, char **saveptr); extern DECLSPEC size_t SDLCALL SDL_utf8strlen(const char *str); extern DECLSPEC char *SDLCALL SDL_itoa(int value, char *str, int radix); @@ -584,6 +588,7 @@ extern DECLSPEC char *SDLCALL SDL_iconv_string(const char *tocode, #define SDL_strchr strchr #define SDL_strrchr strrchr #define SDL_strstr strstr +#define SDL_strtokr strtok_r #define SDL_strcmp strcmp #define SDL_strncmp strncmp #define SDL_strcasecmp strcasecmp diff --git a/quakespasm/Windows/SDL2/include/SDL_syswm.h b/quakespasm/Windows/SDL2/include/SDL_syswm.h index 1469b235..c8236513 100644 --- a/quakespasm/Windows/SDL2/include/SDL_syswm.h +++ b/quakespasm/Windows/SDL2/include/SDL_syswm.h @@ -132,7 +132,8 @@ typedef enum SDL_SYSWM_WINRT, SDL_SYSWM_ANDROID, SDL_SYSWM_VIVANTE, - SDL_SYSWM_OS2 + SDL_SYSWM_OS2, + SDL_SYSWM_HAIKU } SDL_SYSWM_TYPE; /** diff --git a/quakespasm/Windows/SDL2/lib/SDL2.dll b/quakespasm/Windows/SDL2/lib/SDL2.dll index 01402939..be564f68 100644 Binary files a/quakespasm/Windows/SDL2/lib/SDL2.dll and b/quakespasm/Windows/SDL2/lib/SDL2.dll differ diff --git a/quakespasm/Windows/SDL2/lib/SDL2.lib b/quakespasm/Windows/SDL2/lib/SDL2.lib index f84235e2..81328beb 100644 Binary files a/quakespasm/Windows/SDL2/lib/SDL2.lib and b/quakespasm/Windows/SDL2/lib/SDL2.lib differ diff --git a/quakespasm/Windows/SDL2/lib/SDL2main.lib b/quakespasm/Windows/SDL2/lib/SDL2main.lib index 1f12123f..60b24acd 100644 Binary files a/quakespasm/Windows/SDL2/lib/SDL2main.lib and b/quakespasm/Windows/SDL2/lib/SDL2main.lib differ diff --git a/quakespasm/Windows/SDL2/lib/libSDL2.dll.a b/quakespasm/Windows/SDL2/lib/libSDL2.dll.a index d12ccb46..eedefe06 100644 Binary files a/quakespasm/Windows/SDL2/lib/libSDL2.dll.a and b/quakespasm/Windows/SDL2/lib/libSDL2.dll.a differ diff --git a/quakespasm/Windows/SDL2/lib/libSDL2main.a b/quakespasm/Windows/SDL2/lib/libSDL2main.a index b3a3e8ed..9ff7a6d0 100644 Binary files a/quakespasm/Windows/SDL2/lib/libSDL2main.a and b/quakespasm/Windows/SDL2/lib/libSDL2main.a differ diff --git a/quakespasm/Windows/SDL2/lib64/SDL2.dll b/quakespasm/Windows/SDL2/lib64/SDL2.dll index af10a3a4..36cf97f9 100644 Binary files a/quakespasm/Windows/SDL2/lib64/SDL2.dll and b/quakespasm/Windows/SDL2/lib64/SDL2.dll differ diff --git a/quakespasm/Windows/SDL2/lib64/SDL2.lib b/quakespasm/Windows/SDL2/lib64/SDL2.lib index a7fa31b3..1317f4cc 100644 Binary files a/quakespasm/Windows/SDL2/lib64/SDL2.lib and b/quakespasm/Windows/SDL2/lib64/SDL2.lib differ diff --git a/quakespasm/Windows/SDL2/lib64/SDL2main.lib b/quakespasm/Windows/SDL2/lib64/SDL2main.lib index 41b49589..4e72c408 100644 Binary files a/quakespasm/Windows/SDL2/lib64/SDL2main.lib and b/quakespasm/Windows/SDL2/lib64/SDL2main.lib differ diff --git a/quakespasm/Windows/SDL2/lib64/libSDL2.dll.a b/quakespasm/Windows/SDL2/lib64/libSDL2.dll.a index f9164371..edeeef6a 100644 Binary files a/quakespasm/Windows/SDL2/lib64/libSDL2.dll.a and b/quakespasm/Windows/SDL2/lib64/libSDL2.dll.a differ diff --git a/quakespasm/Windows/SDL2/lib64/libSDL2main.a b/quakespasm/Windows/SDL2/lib64/libSDL2main.a index 5a9e00c1..4c28ea1c 100644 Binary files a/quakespasm/Windows/SDL2/lib64/libSDL2main.a and b/quakespasm/Windows/SDL2/lib64/libSDL2main.a differ diff --git a/quakespasm/Windows/SDL2/watcom/SDL2.def b/quakespasm/Windows/SDL2/watcom/SDL2.def index 23b13bc3..7e449894 100644 --- a/quakespasm/Windows/SDL2/watcom/SDL2.def +++ b/quakespasm/Windows/SDL2/watcom/SDL2.def @@ -116,6 +116,7 @@ SDL_GameControllerAddMappingsFromRW SDL_GameControllerClose SDL_GameControllerEventState SDL_GameControllerFromInstanceID +SDL_GameControllerFromPlayerIndex SDL_GameControllerGetAttached SDL_GameControllerGetAxis SDL_GameControllerGetAxisFromString @@ -129,6 +130,7 @@ SDL_GameControllerGetProduct SDL_GameControllerGetProductVersion SDL_GameControllerGetStringForAxis SDL_GameControllerGetStringForButton +SDL_GameControllerGetType SDL_GameControllerGetVendor SDL_GameControllerMapping SDL_GameControllerMappingForDeviceIndex @@ -139,6 +141,8 @@ SDL_GameControllerNameForIndex SDL_GameControllerNumMappings SDL_GameControllerOpen SDL_GameControllerRumble +SDL_GameControllerSetPlayerIndex +SDL_GameControllerTypeForIndex SDL_GameControllerUpdate SDL_GetAssertionHandler SDL_GetAssertionReport @@ -221,6 +225,7 @@ SDL_GetSystemRAM SDL_GetTextureAlphaMod SDL_GetTextureBlendMode SDL_GetTextureColorMod +SDL_GetTextureScaleMode SDL_GetThreadID SDL_GetThreadName SDL_GetTicks @@ -312,6 +317,7 @@ SDL_JoystickClose SDL_JoystickCurrentPowerLevel SDL_JoystickEventState SDL_JoystickFromInstanceID +SDL_JoystickFromPlayerIndex SDL_JoystickGetAttached SDL_JoystickGetAxis SDL_JoystickGetAxisInitialState @@ -343,6 +349,7 @@ SDL_JoystickNumButtons SDL_JoystickNumHats SDL_JoystickOpen SDL_JoystickRumble +SDL_JoystickSetPlayerIndex SDL_JoystickUpdate SDL_LoadBMP_RW SDL_LoadDollarTemplates @@ -519,6 +526,7 @@ SDL_SetTextInputRect SDL_SetTextureAlphaMod SDL_SetTextureBlendMode SDL_SetTextureColorMod +SDL_SetTextureScaleMode SDL_SetThreadPriority SDL_SetWindowBordered SDL_SetWindowBrightness @@ -662,6 +670,7 @@ SDL_strrchr SDL_strrev SDL_strstr SDL_strtod +SDL_strtokr SDL_strtol SDL_strtoll SDL_strtoul @@ -683,3 +692,5 @@ SDL_wcsdup SDL_wcslcat SDL_wcslcpy SDL_wcslen +SDL_wcsncmp +SDL_wcsstr diff --git a/quakespasm/Windows/SDL2/watcom/SDL2.exp b/quakespasm/Windows/SDL2/watcom/SDL2.exp index 56bda350..648b8612 100644 --- a/quakespasm/Windows/SDL2/watcom/SDL2.exp +++ b/quakespasm/Windows/SDL2/watcom/SDL2.exp @@ -113,6 +113,7 @@ ++'_SDL_GameControllerClose'.'SDL2.DLL'..'SDL_GameControllerClose' ++'_SDL_GameControllerEventState'.'SDL2.DLL'..'SDL_GameControllerEventState' ++'_SDL_GameControllerFromInstanceID'.'SDL2.DLL'..'SDL_GameControllerFromInstanceID' +++'_SDL_GameControllerFromPlayerIndex'.'SDL2.DLL'..'SDL_GameControllerFromPlayerIndex' ++'_SDL_GameControllerGetAttached'.'SDL2.DLL'..'SDL_GameControllerGetAttached' ++'_SDL_GameControllerGetAxis'.'SDL2.DLL'..'SDL_GameControllerGetAxis' ++'_SDL_GameControllerGetAxisFromString'.'SDL2.DLL'..'SDL_GameControllerGetAxisFromString' @@ -126,6 +127,7 @@ ++'_SDL_GameControllerGetProductVersion'.'SDL2.DLL'..'SDL_GameControllerGetProductVersion' ++'_SDL_GameControllerGetStringForAxis'.'SDL2.DLL'..'SDL_GameControllerGetStringForAxis' ++'_SDL_GameControllerGetStringForButton'.'SDL2.DLL'..'SDL_GameControllerGetStringForButton' +++'_SDL_GameControllerGetType'.'SDL2.DLL'..'SDL_GameControllerGetType' ++'_SDL_GameControllerGetVendor'.'SDL2.DLL'..'SDL_GameControllerGetVendor' ++'_SDL_GameControllerMapping'.'SDL2.DLL'..'SDL_GameControllerMapping' ++'_SDL_GameControllerMappingForDeviceIndex'.'SDL2.DLL'..'SDL_GameControllerMappingForDeviceIndex' @@ -136,6 +138,8 @@ ++'_SDL_GameControllerNumMappings'.'SDL2.DLL'..'SDL_GameControllerNumMappings' ++'_SDL_GameControllerOpen'.'SDL2.DLL'..'SDL_GameControllerOpen' ++'_SDL_GameControllerRumble'.'SDL2.DLL'..'SDL_GameControllerRumble' +++'_SDL_GameControllerSetPlayerIndex'.'SDL2.DLL'..'SDL_GameControllerSetPlayerIndex' +++'_SDL_GameControllerTypeForIndex'.'SDL2.DLL'..'SDL_GameControllerTypeForIndex' ++'_SDL_GameControllerUpdate'.'SDL2.DLL'..'SDL_GameControllerUpdate' ++'_SDL_GetAssertionHandler'.'SDL2.DLL'..'SDL_GetAssertionHandler' ++'_SDL_GetAssertionReport'.'SDL2.DLL'..'SDL_GetAssertionReport' @@ -218,6 +222,7 @@ ++'_SDL_GetTextureAlphaMod'.'SDL2.DLL'..'SDL_GetTextureAlphaMod' ++'_SDL_GetTextureBlendMode'.'SDL2.DLL'..'SDL_GetTextureBlendMode' ++'_SDL_GetTextureColorMod'.'SDL2.DLL'..'SDL_GetTextureColorMod' +++'_SDL_GetTextureScaleMode'.'SDL2.DLL'..'SDL_GetTextureScaleMode' ++'_SDL_GetThreadID'.'SDL2.DLL'..'SDL_GetThreadID' ++'_SDL_GetThreadName'.'SDL2.DLL'..'SDL_GetThreadName' ++'_SDL_GetTicks'.'SDL2.DLL'..'SDL_GetTicks' @@ -309,6 +314,7 @@ ++'_SDL_JoystickCurrentPowerLevel'.'SDL2.DLL'..'SDL_JoystickCurrentPowerLevel' ++'_SDL_JoystickEventState'.'SDL2.DLL'..'SDL_JoystickEventState' ++'_SDL_JoystickFromInstanceID'.'SDL2.DLL'..'SDL_JoystickFromInstanceID' +++'_SDL_JoystickFromPlayerIndex'.'SDL2.DLL'..'SDL_JoystickFromPlayerIndex' ++'_SDL_JoystickGetAttached'.'SDL2.DLL'..'SDL_JoystickGetAttached' ++'_SDL_JoystickGetAxis'.'SDL2.DLL'..'SDL_JoystickGetAxis' ++'_SDL_JoystickGetAxisInitialState'.'SDL2.DLL'..'SDL_JoystickGetAxisInitialState' @@ -340,6 +346,7 @@ ++'_SDL_JoystickNumHats'.'SDL2.DLL'..'SDL_JoystickNumHats' ++'_SDL_JoystickOpen'.'SDL2.DLL'..'SDL_JoystickOpen' ++'_SDL_JoystickRumble'.'SDL2.DLL'..'SDL_JoystickRumble' +++'_SDL_JoystickSetPlayerIndex'.'SDL2.DLL'..'SDL_JoystickSetPlayerIndex' ++'_SDL_JoystickUpdate'.'SDL2.DLL'..'SDL_JoystickUpdate' ++'_SDL_LoadBMP_RW'.'SDL2.DLL'..'SDL_LoadBMP_RW' ++'_SDL_LoadDollarTemplates'.'SDL2.DLL'..'SDL_LoadDollarTemplates' @@ -516,6 +523,7 @@ ++'_SDL_SetTextureAlphaMod'.'SDL2.DLL'..'SDL_SetTextureAlphaMod' ++'_SDL_SetTextureBlendMode'.'SDL2.DLL'..'SDL_SetTextureBlendMode' ++'_SDL_SetTextureColorMod'.'SDL2.DLL'..'SDL_SetTextureColorMod' +++'_SDL_SetTextureScaleMode'.'SDL2.DLL'..'SDL_SetTextureScaleMode' ++'_SDL_SetThreadPriority'.'SDL2.DLL'..'SDL_SetThreadPriority' ++'_SDL_SetWindowBordered'.'SDL2.DLL'..'SDL_SetWindowBordered' ++'_SDL_SetWindowBrightness'.'SDL2.DLL'..'SDL_SetWindowBrightness' @@ -659,6 +667,7 @@ ++'_SDL_strrev'.'SDL2.DLL'..'SDL_strrev' ++'_SDL_strstr'.'SDL2.DLL'..'SDL_strstr' ++'_SDL_strtod'.'SDL2.DLL'..'SDL_strtod' +++'_SDL_strtokr'.'SDL2.DLL'..'SDL_strtokr' ++'_SDL_strtol'.'SDL2.DLL'..'SDL_strtol' ++'_SDL_strtoll'.'SDL2.DLL'..'SDL_strtoll' ++'_SDL_strtoul'.'SDL2.DLL'..'SDL_strtoul' @@ -680,3 +689,5 @@ ++'_SDL_wcslcat'.'SDL2.DLL'..'SDL_wcslcat' ++'_SDL_wcslcpy'.'SDL2.DLL'..'SDL_wcslcpy' ++'_SDL_wcslen'.'SDL2.DLL'..'SDL_wcslen' +++'_SDL_wcsncmp'.'SDL2.DLL'..'SDL_wcsncmp' +++'_SDL_wcsstr'.'SDL2.DLL'..'SDL_wcsstr' diff --git a/quakespasm/Windows/SDL2/watcom/SDL2.lib b/quakespasm/Windows/SDL2/watcom/SDL2.lib index 8a886578..df572140 100644 Binary files a/quakespasm/Windows/SDL2/watcom/SDL2.lib and b/quakespasm/Windows/SDL2/watcom/SDL2.lib differ diff --git a/quakespasm/Windows/codecs/include/mpg123.h b/quakespasm/Windows/codecs/include/mpg123.h index 15019b8c..f5c5b66d 100644 --- a/quakespasm/Windows/codecs/include/mpg123.h +++ b/quakespasm/Windows/codecs/include/mpg123.h @@ -12,7 +12,7 @@ /* A macro to check at compile time which set of API functions to expect. This should be incremented at least each time a new symbol is added to the header. */ -#define MPG123_API_VERSION 41 +#define MPG123_API_VERSION 42 /* These aren't actually in use... seems to work without using libtool. */ #ifdef BUILD_MPG123_DLL @@ -86,6 +86,7 @@ typedef ptrdiff_t ssize_t; #define mpg123_set_index MPG123_LARGENAME(mpg123_set_index) #define mpg123_position MPG123_LARGENAME(mpg123_position) #define mpg123_length MPG123_LARGENAME(mpg123_length) +#define mpg123_framelength MPG123_LARGENAME(mpg123_framelength) #define mpg123_set_filesize MPG123_LARGENAME(mpg123_set_filesize) #define mpg123_replace_reader MPG123_LARGENAME(mpg123_replace_reader) #define mpg123_replace_reader_handle MPG123_LARGENAME(mpg123_replace_reader_handle) @@ -684,6 +685,7 @@ MPG123_EXPORT int mpg123_set_index(mpg123_handle *mh, off_t *offsets, off_t step /** Get information about current and remaining frames/seconds. * WARNING: This function is there because of special usage by standalone mpg123 and may be removed in the final version of libmpg123! + * broken for various cases (p.ex. 24 bit output). Do never use. * You provide an offset (in frames) from now and a number of output bytes * served by libmpg123 but not yet played. You get the projected current frame * and seconds, as well as the remaining frames/seconds. This does _not_ care @@ -812,6 +814,10 @@ MPG123_EXPORT size_t mpg123_safe_buffer(void); */ MPG123_EXPORT int mpg123_scan(mpg123_handle *mh); +/** Return, if possible, the full (expected) length of current track in frames. + * \return length >= 0 or MPG123_ERR if there is no length guess possible. */ +MPG123_EXPORT off_t mpg123_framelength(mpg123_handle *mh); + /** Return, if possible, the full (expected) length of current track in samples. * \return length >= 0 or MPG123_ERR if there is no length guess possible. */ MPG123_EXPORT off_t mpg123_length(mpg123_handle *mh); diff --git a/quakespasm/Windows/codecs/x64/libmpg123-0.dll b/quakespasm/Windows/codecs/x64/libmpg123-0.dll index 545e52d0..0498ec54 100644 Binary files a/quakespasm/Windows/codecs/x64/libmpg123-0.dll and b/quakespasm/Windows/codecs/x64/libmpg123-0.dll differ diff --git a/quakespasm/Windows/codecs/x64/libmpg123.dll.a b/quakespasm/Windows/codecs/x64/libmpg123.dll.a index efd074c3..29692bb7 100644 Binary files a/quakespasm/Windows/codecs/x64/libmpg123.dll.a and b/quakespasm/Windows/codecs/x64/libmpg123.dll.a differ diff --git a/quakespasm/Windows/codecs/x64/libmpg123.lib b/quakespasm/Windows/codecs/x64/libmpg123.lib index fc5a1091..afff4eaa 100644 Binary files a/quakespasm/Windows/codecs/x64/libmpg123.lib and b/quakespasm/Windows/codecs/x64/libmpg123.lib differ diff --git a/quakespasm/Windows/codecs/x86-watcom/mpg123.lib b/quakespasm/Windows/codecs/x86-watcom/mpg123.lib index aabb04da..d93d265a 100644 Binary files a/quakespasm/Windows/codecs/x86-watcom/mpg123.lib and b/quakespasm/Windows/codecs/x86-watcom/mpg123.lib differ diff --git a/quakespasm/Windows/codecs/x86/libmpg123-0.dll b/quakespasm/Windows/codecs/x86/libmpg123-0.dll index bbfefc46..c0bbca24 100644 Binary files a/quakespasm/Windows/codecs/x86/libmpg123-0.dll and b/quakespasm/Windows/codecs/x86/libmpg123-0.dll differ diff --git a/quakespasm/Windows/codecs/x86/libmpg123.dll.a b/quakespasm/Windows/codecs/x86/libmpg123.dll.a index 0107a7fd..240e82bb 100644 Binary files a/quakespasm/Windows/codecs/x86/libmpg123.dll.a and b/quakespasm/Windows/codecs/x86/libmpg123.dll.a differ diff --git a/quakespasm/Windows/codecs/x86/libmpg123.lib b/quakespasm/Windows/codecs/x86/libmpg123.lib index 576870ce..7e308308 100644 Binary files a/quakespasm/Windows/codecs/x86/libmpg123.lib and b/quakespasm/Windows/codecs/x86/libmpg123.lib differ