Skip to content

Commit

Permalink
Merge tag 'release-2.30.7' into webOS-2.30.x
Browse files Browse the repository at this point in the history
  • Loading branch information
mariotaku committed Oct 30, 2024
2 parents ea80a3a + 9519b99 commit 020aca7
Show file tree
Hide file tree
Showing 26 changed files with 142 additions and 68 deletions.
7 changes: 5 additions & 2 deletions 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 30)
set(SDL_MICRO_VERSION 6)
set(SDL_MICRO_VERSION 7)
set(SDL_VERSION "${SDL_MAJOR_VERSION}.${SDL_MINOR_VERSION}.${SDL_MICRO_VERSION}")

# Set defaults preventing destination file conflicts
Expand Down Expand Up @@ -3555,7 +3555,10 @@ if(SDL_TEST)
endif()

if(MSVC AND NOT SDL_LIBC)
set(targets SDL2)
set(targets )
if(TARGET SDL2)
list(APPEND targets SDL2)
endif()
if(TARGET SDL2-static)
list(APPEND targets SDL2-static)
endif()
Expand Down
2 changes: 1 addition & 1 deletion 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 = 30
MICRO_VERSION = 6
MICRO_VERSION = 7
VERSION = $(MAJOR_VERSION).$(MINOR_VERSION).$(MICRO_VERSION)
DESCRIPTION = Simple DirectMedia Layer 2

Expand Down
2 changes: 1 addition & 1 deletion 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 = 30
MICRO_VERSION = 6
MICRO_VERSION = 7
VERSION = $(MAJOR_VERSION).$(MINOR_VERSION).$(MICRO_VERSION)

LIBHOME = .
Expand Down
4 changes: 2 additions & 2 deletions 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.30.6</string>
<string>2.30.7</string>
<key>CFBundleSignature</key>
<string>SDLX</string>
<key>CFBundleVersion</key>
<string>2.30.6</string>
<string>2.30.7</string>
</dict>
</plist>
12 changes: 6 additions & 6 deletions Xcode/SDL/SDL.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -9729,7 +9729,7 @@
DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
DEPLOYMENT_POSTPROCESSING = YES;
DYLIB_COMPATIBILITY_VERSION = 3001.0.0;
DYLIB_CURRENT_VERSION = 3001.6.0;
DYLIB_CURRENT_VERSION = 3001.7.0;
DYLIB_INSTALL_NAME_BASE = "@rpath";
ENABLE_STRICT_OBJC_MSGSEND = YES;
GCC_ALTIVEC_EXTENSIONS = YES;
Expand Down Expand Up @@ -9770,7 +9770,7 @@
isa = XCBuildConfiguration;
buildSettings = {
CLANG_LINK_OBJC_RUNTIME = NO;
MARKETING_VERSION = 2.30.6;
MARKETING_VERSION = 2.30.7;
OTHER_LDFLAGS = "-liconv";
};
name = Release;
Expand Down Expand Up @@ -9814,7 +9814,7 @@
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
DEBUG_INFORMATION_FORMAT = dwarf;
DYLIB_COMPATIBILITY_VERSION = 3001.0.0;
DYLIB_CURRENT_VERSION = 3001.6.0;
DYLIB_CURRENT_VERSION = 3001.7.0;
DYLIB_INSTALL_NAME_BASE = "@rpath";
ENABLE_STRICT_OBJC_MSGSEND = YES;
ENABLE_TESTABILITY = YES;
Expand Down Expand Up @@ -9856,7 +9856,7 @@
isa = XCBuildConfiguration;
buildSettings = {
CLANG_LINK_OBJC_RUNTIME = NO;
MARKETING_VERSION = 2.30.6;
MARKETING_VERSION = 2.30.7;
OTHER_LDFLAGS = "-liconv";
};
name = Debug;
Expand Down Expand Up @@ -10063,7 +10063,7 @@
DEFINES_MODULE = YES;
DEVELOPMENT_TEAM = "";
DYLIB_COMPATIBILITY_VERSION = 3001.0.0;
DYLIB_CURRENT_VERSION = 3001.6.0;
DYLIB_CURRENT_VERSION = 3001.7.0;
DYLIB_INSTALL_NAME_BASE = "@rpath";
GCC_C_LANGUAGE_STANDARD = gnu11;
GCC_DYNAMIC_NO_PIC = NO;
Expand Down Expand Up @@ -10115,7 +10115,7 @@
DEFINES_MODULE = YES;
DEVELOPMENT_TEAM = "";
DYLIB_COMPATIBILITY_VERSION = 3001.0.0;
DYLIB_CURRENT_VERSION = 3001.6.0;
DYLIB_CURRENT_VERSION = 3001.7.0;
DYLIB_INSTALL_NAME_BASE = "@rpath";
ENABLE_NS_ASSERTIONS = NO;
GCC_C_LANGUAGE_STANDARD = gnu11;
Expand Down
2 changes: 1 addition & 1 deletion Xcode/SDL/pkg-support/SDL.info
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
Title SDL 2.30.6
Title SDL 2.30.7
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 @@ -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 = 30;
private static final int SDL_MICRO_VERSION = 6;
private static final int SDL_MICRO_VERSION = 7;
/*
// Display InputType.SOURCE/CLASS of events and devices
//
Expand Down
2 changes: 1 addition & 1 deletion configure
Original file line number Diff line number Diff line change
Expand Up @@ -3508,7 +3508,7 @@ orig_CFLAGS="$CFLAGS"
# See docs/release_checklist.md
SDL_MAJOR_VERSION=2
SDL_MINOR_VERSION=30
SDL_MICRO_VERSION=6
SDL_MICRO_VERSION=7
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 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=30
SDL_MICRO_VERSION=6
SDL_MICRO_VERSION=7
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 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 30
#define SDL_PATCHLEVEL 6
#define SDL_PATCHLEVEL 7

/**
* Macro to determine SDL version program was compiled against.
Expand Down
3 changes: 2 additions & 1 deletion src/file/SDL_rwops.c
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@

#ifdef HAVE_STDIO_H
#include <stdio.h>
#include <errno.h>
#include <sys/stat.h>
#endif
#ifdef HAVE_LIMITS_H
Expand Down Expand Up @@ -632,7 +633,7 @@ SDL_RWops *SDL_RWFromFile(const char *file, const char *mode)
FILE *fp = fopen(file, mode);
#endif
if (!fp) {
SDL_SetError("Couldn't open %s", file);
SDL_SetError("Couldn't open %s: %s", file, strerror(errno));
} else if (!IsRegularFileOrPipe(fp)) {
fclose(fp);
fp = NULL;
Expand Down
1 change: 1 addition & 0 deletions src/joystick/SDL_joystick.c
Original file line number Diff line number Diff line change
Expand Up @@ -398,6 +398,7 @@ static Uint32 initial_wheel_devices[] = {
MAKE_VIDPID(0x2433, 0xf303), /* Asetek SimSports La Prima Wheelbase */
MAKE_VIDPID(0x2433, 0xf306), /* Asetek SimSports Tony Kannan Wheelbase */
MAKE_VIDPID(0x3416, 0x0301), /* Cammus C5 Wheelbase */
MAKE_VIDPID(0x3416, 0x0302), /* Cammus C12 Wheelbase */
MAKE_VIDPID(0x346e, 0x0000), /* Moza R16/R21 Wheelbase */
MAKE_VIDPID(0x346e, 0x0002), /* Moza R9 Wheelbase */
MAKE_VIDPID(0x346e, 0x0004), /* Moza R5 Wheelbase */
Expand Down
2 changes: 1 addition & 1 deletion src/joystick/controller_list.h
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ static const ControllerDescription_t arrControllers[] = {
{ MAKE_CONTROLLER_ID( 0x20d6, 0x576d ), k_eControllerType_PS3Controller, NULL }, // Power A PS3
{ MAKE_CONTROLLER_ID( 0x20d6, 0xca6d ), k_eControllerType_PS3Controller, NULL }, // From SDL
{ MAKE_CONTROLLER_ID( 0x2563, 0x0523 ), k_eControllerType_PS3Controller, NULL }, // Digiflip GP006
{ MAKE_CONTROLLER_ID( 0x2563, 0x0575 ), k_eControllerType_PS3Controller, NULL }, // From SDL
{ MAKE_CONTROLLER_ID( 0x2563, 0x0575 ), k_eControllerType_PS3Controller, "Retro-bit Controller" }, // SWITCH CO., LTD. Retro-bit Controller
{ MAKE_CONTROLLER_ID( 0x25f0, 0x83c3 ), k_eControllerType_PS3Controller, NULL }, // gioteck vx2
{ MAKE_CONTROLLER_ID( 0x25f0, 0xc121 ), k_eControllerType_PS3Controller, NULL }, //
{ MAKE_CONTROLLER_ID( 0x2c22, 0x2003 ), k_eControllerType_PS3Controller, NULL }, // Qanba Drone
Expand Down
43 changes: 35 additions & 8 deletions src/joystick/hidapi/SDL_hidapi_ps3.c
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@ typedef struct
SDL_HIDAPI_Device *device;
SDL_Joystick *joystick;
SDL_bool is_shanwan;
SDL_bool has_analog_buttons;
SDL_bool report_sensors;
SDL_bool effects_updated;
int player_index;
Expand Down Expand Up @@ -145,6 +146,7 @@ static SDL_bool HIDAPI_DriverPS3_InitDevice(SDL_HIDAPI_Device *device)
}
ctx->device = device;
ctx->is_shanwan = is_shanwan;
ctx->has_analog_buttons = SDL_TRUE;

device->context = ctx;

Expand Down Expand Up @@ -247,7 +249,10 @@ static SDL_bool HIDAPI_DriverPS3_OpenJoystick(SDL_HIDAPI_Device *device, SDL_Joy

/* Initialize the joystick capabilities */
joystick->nbuttons = 15;
joystick->naxes = 16;
joystick->naxes = 6;
if (ctx->has_analog_buttons) {
joystick->naxes += 10;
}
joystick->epowerlevel = SDL_JOYSTICK_POWER_WIRED;

SDL_PrivateJoystickAddSensor(joystick, SDL_SENSOR_ACCEL, 100.0f);
Expand Down Expand Up @@ -432,7 +437,7 @@ static void HIDAPI_DriverPS3_HandleStatePacket(SDL_Joystick *joystick, SDL_Drive
SDL_PrivateJoystickAxis(joystick, SDL_CONTROLLER_AXIS_RIGHTY, axis);

/* Buttons are mapped as axes in the order they appear in the button enumeration */
{
if (ctx->has_analog_buttons) {
static int button_axis_offsets[] = {
24, /* SDL_CONTROLLER_BUTTON_A */
23, /* SDL_CONTROLLER_BUTTON_B */
Expand Down Expand Up @@ -617,6 +622,11 @@ static SDL_bool HIDAPI_DriverPS3ThirdParty_InitDevice(SDL_HIDAPI_Device *device)
return SDL_FALSE;
}
ctx->device = device;
if (device->vendor_id == USB_VENDOR_SWITCH && device->product_id == USB_PRODUCT_SWITCH_RETROBIT_CONTROLLER) {
ctx->has_analog_buttons = SDL_FALSE;
} else {
ctx->has_analog_buttons = SDL_TRUE;
}

device->context = ctx;

Expand Down Expand Up @@ -650,8 +660,17 @@ static SDL_bool HIDAPI_DriverPS3ThirdParty_OpenJoystick(SDL_HIDAPI_Device *devic

/* Initialize the joystick capabilities */
joystick->nbuttons = 15;
joystick->naxes = 16;
joystick->epowerlevel = SDL_JOYSTICK_POWER_WIRED;
joystick->naxes = 6;
if (ctx->has_analog_buttons) {
joystick->naxes += 10;
}

if (device->vendor_id == USB_VENDOR_SWITCH && device->product_id == USB_PRODUCT_SWITCH_RETROBIT_CONTROLLER) {
// This is a wireless controller using a USB dongle
joystick->epowerlevel = SDL_JOYSTICK_POWER_UNKNOWN;
} else {
joystick->epowerlevel = SDL_JOYSTICK_POWER_WIRED;
}

return SDL_TRUE;
}
Expand Down Expand Up @@ -762,7 +781,7 @@ static void HIDAPI_DriverPS3ThirdParty_HandleStatePacket18(SDL_Joystick *joystic
SDL_PrivateJoystickAxis(joystick, SDL_CONTROLLER_AXIS_RIGHTY, axis);

/* Buttons are mapped as axes in the order they appear in the button enumeration */
{
if (ctx->has_analog_buttons) {
static int button_axis_offsets[] = {
12, /* SDL_GAMEPAD_BUTTON_A */
11, /* SDL_GAMEPAD_BUTTON_B */
Expand Down Expand Up @@ -871,9 +890,17 @@ static void HIDAPI_DriverPS3ThirdParty_HandleStatePacket19(SDL_Joystick *joystic
}
}

axis = ((int)data[17] * 257) - 32768;
if (data[0] & 0x40) {
axis = 32767;
} else {
axis = ((int)data[17] * 257) - 32768;
}
SDL_PrivateJoystickAxis(joystick, SDL_CONTROLLER_AXIS_TRIGGERLEFT, axis);
axis = ((int)data[18] * 257) - 32768;
if (data[0] & 0x80) {
axis = 32767;
} else {
axis = ((int)data[18] * 257) - 32768;
}
SDL_PrivateJoystickAxis(joystick, SDL_CONTROLLER_AXIS_TRIGGERRIGHT, axis);
axis = ((int)data[3] * 257) - 32768;
SDL_PrivateJoystickAxis(joystick, SDL_CONTROLLER_AXIS_LEFTX, axis);
Expand All @@ -885,7 +912,7 @@ static void HIDAPI_DriverPS3ThirdParty_HandleStatePacket19(SDL_Joystick *joystic
SDL_PrivateJoystickAxis(joystick, SDL_CONTROLLER_AXIS_RIGHTY, axis);

/* Buttons are mapped as axes in the order they appear in the button enumeration */
{
if (ctx->has_analog_buttons) {
static int button_axis_offsets[] = {
13, /* SDL_CONTROLLER_BUTTON_A */
12, /* SDL_CONTROLLER_BUTTON_B */
Expand Down
2 changes: 2 additions & 0 deletions src/joystick/usb_ids.h
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@
#define USB_VENDOR_SONY 0x054c
#define USB_VENDOR_THRUSTMASTER 0x044f
#define USB_VENDOR_TURTLE_BEACH 0x10f5
#define USB_VENDOR_SWITCH 0x2563
#define USB_VENDOR_VALVE 0x28de
#define USB_VENDOR_ZEROPLUS 0x0c12

Expand Down Expand Up @@ -116,6 +117,7 @@
#define USB_PRODUCT_SONY_DS4_STRIKEPAD 0x05c5
#define USB_PRODUCT_SONY_DS5 0x0ce6
#define USB_PRODUCT_SONY_DS5_EDGE 0x0df2
#define USB_PRODUCT_SWITCH_RETROBIT_CONTROLLER 0x0575
#define USB_PRODUCT_THRUSTMASTER_ESWAPX_PRO 0xd012
#define USB_PRODUCT_TURTLE_BEACH_SERIES_X_REACT_R 0x7013
#define USB_PRODUCT_TURTLE_BEACH_SERIES_X_RECON 0x7009
Expand Down
9 changes: 9 additions & 0 deletions src/joystick/windows/SDL_rawinputjoystick.c
Original file line number Diff line number Diff line change
Expand Up @@ -1290,6 +1290,7 @@ static int RAWINPUT_JoystickOpen(SDL_Joystick *joystick, int device_index)
value_caps = SDL_stack_alloc(HIDP_VALUE_CAPS, caps.NumberInputValueCaps);
if (SDL_HidP_GetValueCaps(HidP_Input, value_caps, &caps.NumberInputValueCaps, ctx->preparsed_data) != HIDP_STATUS_SUCCESS) {
RAWINPUT_JoystickClose(joystick);
SDL_stack_free(button_caps);
return SDL_SetError("Couldn't get device value capabilities");
}

Expand Down Expand Up @@ -1318,6 +1319,8 @@ static int RAWINPUT_JoystickOpen(SDL_Joystick *joystick, int device_index)
ctx->button_indices = (USHORT *)SDL_malloc(joystick->nbuttons * sizeof(*ctx->button_indices));
if (!ctx->button_indices) {
RAWINPUT_JoystickClose(joystick);
SDL_stack_free(value_caps);
SDL_stack_free(button_caps);
return SDL_OutOfMemory();
}

Expand All @@ -1342,6 +1345,8 @@ static int RAWINPUT_JoystickOpen(SDL_Joystick *joystick, int device_index)
joystick->nbuttons += 1;
}

SDL_stack_free(button_caps);

for (i = 0; i < caps.NumberInputValueCaps; ++i) {
HIDP_VALUE_CAPS *cap = &value_caps[i];

Expand Down Expand Up @@ -1371,6 +1376,7 @@ static int RAWINPUT_JoystickOpen(SDL_Joystick *joystick, int device_index)
ctx->axis_indices = (USHORT *)SDL_malloc(joystick->naxes * sizeof(*ctx->axis_indices));
if (!ctx->axis_indices) {
RAWINPUT_JoystickClose(joystick);
SDL_stack_free(value_caps);
return SDL_OutOfMemory();
}

Expand Down Expand Up @@ -1404,6 +1410,7 @@ static int RAWINPUT_JoystickOpen(SDL_Joystick *joystick, int device_index)
ctx->hat_indices = (USHORT *)SDL_malloc(joystick->nhats * sizeof(*ctx->hat_indices));
if (!ctx->hat_indices) {
RAWINPUT_JoystickClose(joystick);
SDL_stack_free(value_caps);
return SDL_OutOfMemory();
}

Expand All @@ -1422,6 +1429,8 @@ static int RAWINPUT_JoystickOpen(SDL_Joystick *joystick, int device_index)
}
}

SDL_stack_free(value_caps);

joystick->epowerlevel = SDL_JOYSTICK_POWER_UNKNOWN;

return 0;
Expand Down
8 changes: 4 additions & 4 deletions 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,30,6,0
PRODUCTVERSION 2,30,6,0
FILEVERSION 2,30,7,0
PRODUCTVERSION 2,30,7,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, 30, 6, 0\0"
VALUE "FileVersion", "2, 30, 7, 0\0"
VALUE "InternalName", "SDL\0"
VALUE "LegalCopyright", "Copyright (C) 2024 Sam Lantinga\0"
VALUE "OriginalFilename", "SDL2.dll\0"
VALUE "ProductName", "Simple DirectMedia Layer\0"
VALUE "ProductVersion", "2, 30, 6, 0\0"
VALUE "ProductVersion", "2, 30, 7, 0\0"
END
END
BLOCK "VarFileInfo"
Expand Down
2 changes: 1 addition & 1 deletion src/sensor/android/SDL_androidsensor.c
Original file line number Diff line number Diff line change
Expand Up @@ -161,7 +161,7 @@ static void SDL_ANDROID_SensorUpdate(SDL_Sensor *sensor)
ASensorEvent event;
struct android_poll_source *source;

if (ALooper_pollAll(0, NULL, &events, (void **)&source) == LOOPER_ID_USER) {
if (ALooper_pollOnce(0, NULL, &events, (void **)&source) == LOOPER_ID_USER) {
SDL_zero(event);
while (ASensorEventQueue_getEvents(sensor->hwdata->eventqueue, &event, 1) > 0) {
SDL_PrivateSensorUpdate(sensor, 0, event.data, SDL_arraysize(event.data));
Expand Down
Loading

0 comments on commit 020aca7

Please sign in to comment.