Skip to content

Commit

Permalink
Update SDL2 to 2.28.5
Browse files Browse the repository at this point in the history
  • Loading branch information
slime73 committed Dec 2, 2023
1 parent 3b08388 commit 48811d0
Show file tree
Hide file tree
Showing 31 changed files with 265 additions and 84 deletions.
2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -173,7 +173,7 @@ set(MEGA_LIBVORBIS_VER "1.3.5")
set(MEGA_LIBTHEORA_VER "1.1.1")
set(MEGA_MPG123_VER "1.25.6")
set(MEGA_FREETYPE_VER "2.8.1")
set(MEGA_SDL2_VER "2.28.4")
set(MEGA_SDL2_VER "2.28.5")
set(MEGA_OPENAL_VER "1.19.1")
set(MEGA_MODPLUG_VER "0.8.8.4")

Expand Down
18 changes: 16 additions & 2 deletions libs/SDL2/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ endif()
# See docs/release_checklist.md
set(SDL_MAJOR_VERSION 2)
set(SDL_MINOR_VERSION 28)
set(SDL_MICRO_VERSION 4)
set(SDL_MICRO_VERSION 5)
set(SDL_VERSION "${SDL_MAJOR_VERSION}.${SDL_MINOR_VERSION}.${SDL_MICRO_VERSION}")

# Set defaults preventing destination file conflicts
Expand Down Expand Up @@ -3089,9 +3089,17 @@ else()
set(sdl_static_libname "SDL2")
endif()

set(prefix ${CMAKE_INSTALL_PREFIX})
# CMAKE_PREFIX_PATH and CMAKE_INSTALL_FULL_BINDIR can be a non-absolute path
# when a master-project does e.g. `set(CMAKE_INSTALL_PREFIX "libs/SDL2" CACHE PATH "prefix" FORCE)`.
if(NOT IS_ABSOLUTE "${CMAKE_INSTALL_PREFIX}")
set(CMAKE_INSTALL_PREFIX "${CMAKE_BINARY_DIR}/${CMAKE_INSTALL_PREFIX}")
endif()
if(NOT IS_ABSOLUTE "${CMAKE_INSTALL_FULL_BINDIR}")
set(CMAKE_INSTALL_FULL_BINDIR "${CMAKE_BINARY_DIR}/${CMAKE_INSTALL_FULL_BINDIR}")
endif()
file(RELATIVE_PATH bin_prefix_relpath "${CMAKE_INSTALL_FULL_BINDIR}" "${CMAKE_INSTALL_PREFIX}")

set(prefix ${CMAKE_INSTALL_PREFIX})
set(exec_prefix "\${prefix}")
set(libdir "\${exec_prefix}/${CMAKE_INSTALL_LIBDIR}")
set(bindir "\${exec_prefix}/${CMAKE_INSTALL_BINDIR}")
Expand Down Expand Up @@ -3335,6 +3343,12 @@ if(ANDROID)
endif()

if(APPLE)
cmake_push_check_state(RESET)
check_c_compiler_flag(-fobjc-arc COMPILER_SUPPORTS_FOBJC_ARC)
cmake_pop_check_state()
if(NOT COMPILER_SUPPORTS_FOBJC_ARC)
message(FATAL_ERROR "Compiler does not support -fobjc-arc: this is required on Apple platforms")
endif()
target_compile_options(sdl-build-options INTERFACE "-fobjc-arc")
endif()

Expand Down
2 changes: 1 addition & 1 deletion libs/SDL2/Makefile.os2
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
LIBNAME = SDL2
MAJOR_VERSION = 2
MINOR_VERSION = 28
MICRO_VERSION = 4
MICRO_VERSION = 5
VERSION = $(MAJOR_VERSION).$(MINOR_VERSION).$(MICRO_VERSION)
DESCRIPTION = Simple DirectMedia Layer 2

Expand Down
2 changes: 1 addition & 1 deletion libs/SDL2/Makefile.w32
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
LIBNAME = SDL2
MAJOR_VERSION = 2
MINOR_VERSION = 28
MICRO_VERSION = 4
MICRO_VERSION = 5
VERSION = $(MAJOR_VERSION).$(MINOR_VERSION).$(MICRO_VERSION)

LIBHOME = .
Expand Down
2 changes: 1 addition & 1 deletion libs/SDL2/SDL2.spec
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Summary: Simple DirectMedia Layer
Name: SDL2
Version: 2.28.4
Version: 2.28.5
Release: 2
Source: http://www.libsdl.org/release/%{name}-%{version}.tar.gz
URL: http://www.libsdl.org/
Expand Down
2 changes: 1 addition & 1 deletion libs/SDL2/VERSION.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
release-2.28.4-0-gcc016b004
release-2.28.5-0-g15ead9a40
4 changes: 2 additions & 2 deletions libs/SDL2/Xcode/SDL/Info-Framework.plist
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,10 @@
<key>CFBundlePackageType</key>
<string>FMWK</string>
<key>CFBundleShortVersionString</key>
<string>2.28.4</string>
<string>2.28.5</string>
<key>CFBundleSignature</key>
<string>SDLX</string>
<key>CFBundleVersion</key>
<string>2.28.4</string>
<string>2.28.5</string>
</dict>
</plist>
12 changes: 6 additions & 6 deletions libs/SDL2/Xcode/SDL/SDL.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -9529,7 +9529,7 @@
DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
DEPLOYMENT_POSTPROCESSING = YES;
DYLIB_COMPATIBILITY_VERSION = 2801.0.0;
DYLIB_CURRENT_VERSION = 2801.4.0;
DYLIB_CURRENT_VERSION = 2801.5.0;
DYLIB_INSTALL_NAME_BASE = "@rpath";
ENABLE_STRICT_OBJC_MSGSEND = YES;
GCC_ALTIVEC_EXTENSIONS = YES;
Expand Down Expand Up @@ -9570,7 +9570,7 @@
isa = XCBuildConfiguration;
buildSettings = {
CLANG_LINK_OBJC_RUNTIME = NO;
MARKETING_VERSION = 2.28.4;
MARKETING_VERSION = 2.28.5;
OTHER_LDFLAGS = "-liconv";
};
name = Release;
Expand Down Expand Up @@ -9614,7 +9614,7 @@
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
DEBUG_INFORMATION_FORMAT = dwarf;
DYLIB_COMPATIBILITY_VERSION = 2801.0.0;
DYLIB_CURRENT_VERSION = 2801.4.0;
DYLIB_CURRENT_VERSION = 2801.5.0;
DYLIB_INSTALL_NAME_BASE = "@rpath";
ENABLE_STRICT_OBJC_MSGSEND = YES;
ENABLE_TESTABILITY = YES;
Expand Down Expand Up @@ -9656,7 +9656,7 @@
isa = XCBuildConfiguration;
buildSettings = {
CLANG_LINK_OBJC_RUNTIME = NO;
MARKETING_VERSION = 2.28.4;
MARKETING_VERSION = 2.28.5;
OTHER_LDFLAGS = "-liconv";
};
name = Debug;
Expand Down Expand Up @@ -9863,7 +9863,7 @@
DEFINES_MODULE = YES;
DEVELOPMENT_TEAM = "";
DYLIB_COMPATIBILITY_VERSION = 2801.0.0;
DYLIB_CURRENT_VERSION = 2801.4.0;
DYLIB_CURRENT_VERSION = 2801.5.0;
DYLIB_INSTALL_NAME_BASE = "@rpath";
GCC_C_LANGUAGE_STANDARD = gnu11;
GCC_DYNAMIC_NO_PIC = NO;
Expand Down Expand Up @@ -9915,7 +9915,7 @@
DEFINES_MODULE = YES;
DEVELOPMENT_TEAM = "";
DYLIB_COMPATIBILITY_VERSION = 2801.0.0;
DYLIB_CURRENT_VERSION = 2801.4.0;
DYLIB_CURRENT_VERSION = 2801.5.0;
DYLIB_INSTALL_NAME_BASE = "@rpath";
ENABLE_NS_ASSERTIONS = NO;
GCC_C_LANGUAGE_STANDARD = gnu11;
Expand Down
2 changes: 1 addition & 1 deletion libs/SDL2/Xcode/SDL/pkg-support/SDL.info
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
Title SDL 2.28.4
Title SDL 2.28.5
Version 1
Description SDL Library for Mac OS X (http://www.libsdl.org)
DefaultLocation /Library/Frameworks
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -273,6 +273,7 @@ private boolean isXboxOneController(UsbDevice usbDevice, UsbInterface usbInterfa
final int XB1_IFACE_SUBCLASS = 71;
final int XB1_IFACE_PROTOCOL = 208;
final int[] SUPPORTED_VENDORS = {
0x03f0, // HP
0x044f, // Thrustmaster
0x045e, // Microsoft
0x0738, // Mad Catz
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ public class SDLActivity extends Activity implements View.OnSystemUiVisibilityCh
private static final String TAG = "SDL";
private static final int SDL_MAJOR_VERSION = 2;
private static final int SDL_MINOR_VERSION = 28;
private static final int SDL_MICRO_VERSION = 4;
private static final int SDL_MICRO_VERSION = 5;
/*
// Display InputType.SOURCE/CLASS of events and devices
//
Expand Down
2 changes: 1 addition & 1 deletion libs/SDL2/configure
Original file line number Diff line number Diff line change
Expand Up @@ -3507,7 +3507,7 @@ orig_CFLAGS="$CFLAGS"
# See docs/release_checklist.md
SDL_MAJOR_VERSION=2
SDL_MINOR_VERSION=28
SDL_MICRO_VERSION=4
SDL_MICRO_VERSION=5
SDL_VERSION=$SDL_MAJOR_VERSION.$SDL_MINOR_VERSION.$SDL_MICRO_VERSION

SDL_BINARY_AGE=`expr $SDL_MINOR_VERSION \* 100 + $SDL_MICRO_VERSION`
Expand Down
2 changes: 1 addition & 1 deletion libs/SDL2/configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ dnl Set various version strings - taken gratefully from the GTk sources
# See docs/release_checklist.md
SDL_MAJOR_VERSION=2
SDL_MINOR_VERSION=28
SDL_MICRO_VERSION=4
SDL_MICRO_VERSION=5
SDL_VERSION=$SDL_MAJOR_VERSION.$SDL_MINOR_VERSION.$SDL_MICRO_VERSION

SDL_BINARY_AGE=`expr $SDL_MINOR_VERSION \* 100 + $SDL_MICRO_VERSION`
Expand Down
4 changes: 2 additions & 2 deletions libs/SDL2/include/SDL_revision.h
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/* Generated by updaterev.sh, do not edit */
#ifdef SDL_VENDOR_INFO
#define SDL_REVISION "SDL-release-2.28.4-0-gcc016b004 (" SDL_VENDOR_INFO ")"
#define SDL_REVISION "SDL-release-2.28.5-0-g15ead9a40 (" SDL_VENDOR_INFO ")"
#else
#define SDL_REVISION "SDL-release-2.28.4-0-gcc016b004"
#define SDL_REVISION "SDL-release-2.28.5-0-g15ead9a40"
#endif
#define SDL_REVISION_NUMBER 0
2 changes: 1 addition & 1 deletion libs/SDL2/include/SDL_version.h
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ typedef struct SDL_version
*/
#define SDL_MAJOR_VERSION 2
#define SDL_MINOR_VERSION 28
#define SDL_PATCHLEVEL 4
#define SDL_PATCHLEVEL 5

/**
* Macro to determine SDL version program was compiled against.
Expand Down
4 changes: 2 additions & 2 deletions libs/SDL2/src/audio/arts/SDL_artsaudio.c
Original file line number Diff line number Diff line change
Expand Up @@ -300,12 +300,12 @@ static void ARTS_Deinitialize(void)
}


static SDL_bool ARTS_Init(SDL_AudioDriverImpl * impl)
static SDL_bool ARTS_Init(SDL_AudioDriverImpl *impl)
{
if (LoadARTSLibrary() < 0) {
return SDL_FALSE;
} else {
if (SDL_NAME(arts_init) () != NULL) {
if (SDL_NAME(arts_init) () != 0) {
UnloadARTSLibrary();
SDL_SetError("ARTS: arts_init failed (no audio server?)");
return SDL_FALSE;
Expand Down
4 changes: 2 additions & 2 deletions libs/SDL2/src/core/android/SDL_android.c
Original file line number Diff line number Diff line change
Expand Up @@ -1939,12 +1939,12 @@ int Android_JNI_FileOpen(SDL_RWops *ctx,
}

if (asset_manager == NULL) {
return -1;
return SDL_SetError("Couldn't create asset manager");
}

asset = AAssetManager_open(asset_manager, fileName, AASSET_MODE_UNKNOWN);
if (asset == NULL) {
return -1;
return SDL_SetError("Couldn't open asset '%s'", fileName);
}

ctx->hidden.androidio.asset = (void *)asset;
Expand Down
1 change: 1 addition & 0 deletions libs/SDL2/src/hidapi/libusb/hid.c
Original file line number Diff line number Diff line change
Expand Up @@ -711,6 +711,7 @@ static int is_xboxone(unsigned short vendor_id, const struct libusb_interface_de
static const int XB1_IFACE_SUBCLASS = 71;
static const int XB1_IFACE_PROTOCOL = 208;
static const int SUPPORTED_VENDORS[] = {
0x03f0, /* HP */
0x044f, /* Thrustmaster */
0x045e, /* Microsoft */
0x0738, /* Mad Catz */
Expand Down
4 changes: 4 additions & 0 deletions libs/SDL2/src/joystick/SDL_joystick.c
Original file line number Diff line number Diff line change
Expand Up @@ -2507,6 +2507,10 @@ static SDL_bool SDL_IsJoystickProductWheel(Uint32 vidpid)
MAKE_VIDPID(0x0eb7, 0x038e), /* Fanatec ClubSport Wheel Base V1 */
MAKE_VIDPID(0x0eb7, 0x0e03), /* Fanatec CSL Elite Wheel Base */
MAKE_VIDPID(0x11ff, 0x0511), /* DragonRise Inc. Wired Wheel (initial mode) (also known as PXN V900 (PS3), Superdrive SV-750, or a Genesis Seaborg 400) */
MAKE_VIDPID(0x2433, 0xf300), /* Asetek SimSports Invicta Wheelbase */
MAKE_VIDPID(0x2433, 0xf301), /* Asetek SimSports Forte Wheelbase */
MAKE_VIDPID(0x2433, 0xf303), /* Asetek SimSports La Prima Wheelbase */
MAKE_VIDPID(0x2433, 0xf306), /* Asetek SimSports Tony Kannan Wheelbase */
};
int i;

Expand Down
1 change: 1 addition & 0 deletions libs/SDL2/src/joystick/controller_list.h
Original file line number Diff line number Diff line change
Expand Up @@ -294,6 +294,7 @@ static const ControllerDescription_t arrControllers[] = {
{ MAKE_CONTROLLER_ID( 0x24c6, 0xfafd ), k_eControllerType_XBox360Controller, NULL }, // Afterglow Gamepad 3
{ MAKE_CONTROLLER_ID( 0x24c6, 0xfafe ), k_eControllerType_XBox360Controller, NULL }, // Rock Candy Gamepad for Xbox 360

{ MAKE_CONTROLLER_ID( 0x03f0, 0x0495 ), k_eControllerType_XBoxOneController, NULL }, // HP HyperX Clutch Gladiate
{ MAKE_CONTROLLER_ID( 0x044f, 0xd012 ), k_eControllerType_XBoxOneController, NULL }, // ThrustMaster eSwap PRO Controller Xbox
{ MAKE_CONTROLLER_ID( 0x045e, 0x02d1 ), k_eControllerType_XBoxOneController, "Xbox One Controller" }, // Microsoft X-Box One pad
{ MAKE_CONTROLLER_ID( 0x045e, 0x02dd ), k_eControllerType_XBoxOneController, "Xbox One Controller" }, // Microsoft X-Box One pad (Firmware 2015)
Expand Down
7 changes: 7 additions & 0 deletions libs/SDL2/src/joystick/hidapi/SDL_hidapijoystick.c
Original file line number Diff line number Diff line change
Expand Up @@ -265,6 +265,7 @@ static SDL_GameControllerType SDL_GetJoystickGameControllerProtocol(const char *
interface_protocol == XBONE_IFACE_PROTOCOL) {

static const int SUPPORTED_VENDORS[] = {
0x03f0, /* HP */
0x044f, /* Thrustmaster */
0x045e, /* Microsoft */
0x0738, /* Mad Catz */
Expand Down Expand Up @@ -1436,6 +1437,12 @@ static int HIDAPI_JoystickOpen(SDL_Joystick *joystick, int device_index)
device->updating = SDL_FALSE;
SDL_UnlockMutex(device->dev_lock);

/* UpdateDevice() may have called HIDAPI_JoystickDisconnected() if the device went away */
if (device->num_joysticks == 0) {
SDL_free(hwdata);
return SDL_SetError("HIDAPI device disconnected while opening");
}

if (!device->driver->OpenJoystick(device, joystick)) {
/* The open failed, mark this device as disconnected and update devices */
HIDAPI_JoystickDisconnected(device, joystickID);
Expand Down
8 changes: 4 additions & 4 deletions libs/SDL2/src/main/windows/version.rc
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@ LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US
//

VS_VERSION_INFO VERSIONINFO
FILEVERSION 2,28,4,0
PRODUCTVERSION 2,28,4,0
FILEVERSION 2,28,5,0
PRODUCTVERSION 2,28,5,0
FILEFLAGSMASK 0x3fL
FILEFLAGS 0x0L
FILEOS 0x40004L
Expand All @@ -23,12 +23,12 @@ BEGIN
BEGIN
VALUE "CompanyName", "\0"
VALUE "FileDescription", "SDL\0"
VALUE "FileVersion", "2, 28, 4, 0\0"
VALUE "FileVersion", "2, 28, 5, 0\0"
VALUE "InternalName", "SDL\0"
VALUE "LegalCopyright", "Copyright (C) 2023 Sam Lantinga\0"
VALUE "OriginalFilename", "SDL2.dll\0"
VALUE "ProductName", "Simple DirectMedia Layer\0"
VALUE "ProductVersion", "2, 28, 4, 0\0"
VALUE "ProductVersion", "2, 28, 5, 0\0"
END
END
BLOCK "VarFileInfo"
Expand Down
21 changes: 13 additions & 8 deletions libs/SDL2/src/render/software/SDL_triangle.c
Original file line number Diff line number Diff line change
Expand Up @@ -789,15 +789,20 @@ static void SDL_BlitTriangle_Slow(SDL_BlitInfo *info,
continue;
}
}
if (FORMAT_HAS_ALPHA(dstfmt_val)) {
DISEMBLE_RGBA(dst, dstbpp, dst_fmt, dstpixel, dstR, dstG, dstB, dstA);
} else if (FORMAT_HAS_NO_ALPHA(dstfmt_val)) {
DISEMBLE_RGB(dst, dstbpp, dst_fmt, dstpixel, dstR, dstG, dstB);
dstA = 0xFF;
if ((flags & (SDL_COPY_BLEND | SDL_COPY_ADD | SDL_COPY_MOD | SDL_COPY_MUL))) {
if (FORMAT_HAS_ALPHA(dstfmt_val)) {
DISEMBLE_RGBA(dst, dstbpp, dst_fmt, dstpixel, dstR, dstG, dstB, dstA);
} else if (FORMAT_HAS_NO_ALPHA(dstfmt_val)) {
DISEMBLE_RGB(dst, dstbpp, dst_fmt, dstpixel, dstR, dstG, dstB);
dstA = 0xFF;
} else {
/* SDL_PIXELFORMAT_ARGB2101010 */
dstpixel = *((Uint32 *) (dst));
RGBA_FROM_ARGB2101010(dstpixel, dstR, dstG, dstB, dstA);
}
} else {
/* SDL_PIXELFORMAT_ARGB2101010 */
dstpixel = *((Uint32 *)(dst));
RGBA_FROM_ARGB2101010(dstpixel, dstR, dstG, dstB, dstA);
/* don't care */
dstR = dstG = dstB = dstA = 0;
}

if (!is_uniform) {
Expand Down
Loading

0 comments on commit 48811d0

Please sign in to comment.