Skip to content

Commit 8e09c70

Browse files
committed
Merge tag 'release-2.30.12'
2 parents a13d7e8 + 8236e01 commit 8e09c70

File tree

25 files changed

+171
-39
lines changed

25 files changed

+171
-39
lines changed

android-project/app/src/main/java/org/libsdl/app/SDLActivity.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ public class SDLActivity extends Activity implements View.OnSystemUiVisibilityCh
6161
private static final String TAG = "SDL";
6262
private static final int SDL_MAJOR_VERSION = 2;
6363
private static final int SDL_MINOR_VERSION = 30;
64-
private static final int SDL_MICRO_VERSION = 11;
64+
private static final int SDL_MICRO_VERSION = 12;
6565
/*
6666
// Display InputType.SOURCE/CLASS of events and devices
6767
//

build.zig

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -158,7 +158,7 @@ pub fn build(b: *std.Build) void {
158158
.style = .{ .cmake = b.path("include/SDL_revision.h.cmake") },
159159
.include_path = "SDL_revision.h",
160160
}, .{
161-
.SDL_REVISION = "SDL-2.30.11",
161+
.SDL_REVISION = "SDL-2.30.12",
162162
.SDL_VENDOR_INFO = "allyourcodebase.com",
163163
});
164164
lib.addConfigHeader(revision_header);

build.zig.zon

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
.{
22
.name = "SDL",
33
.minimum_zig_version = "0.12.0",
4-
.version = "2.30.11",
4+
.version = "2.30.12",
55
.dependencies = .{},
66
.paths = .{
77
"LICENSE.txt",

include/SDL_version.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ typedef struct SDL_version
5959
*/
6060
#define SDL_MAJOR_VERSION 2
6161
#define SDL_MINOR_VERSION 30
62-
#define SDL_PATCHLEVEL 11
62+
#define SDL_PATCHLEVEL 12
6363

6464
/**
6565
* Macro to determine SDL version program was compiled against.

src/audio/coreaudio/SDL_coreaudio.m

Lines changed: 28 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -673,7 +673,21 @@ static OSStatus default_device_changed(AudioObjectID inObjectID, UInt32 inNumber
673673
#if DEBUG_COREAUDIO
674674
printf("COREAUDIO: default device changed for SDL audio device %p!\n", this);
675675
#endif
676-
SDL_AtomicSet(&this->hidden->device_change_flag, 1); /* let the audioqueue thread pick up on this when safe to do so. */
676+
677+
/* due to a bug (?) in CoreAudio, this seems able to fire for a device pointer that's already closed, so check our list to make sure
678+
the pointer is still valid before touching it. https://github.com/libsdl-org/SDL/issues/10432 */
679+
if (open_devices) {
680+
int i;
681+
for (i = 0; i < num_open_devices; i++) {
682+
SDL_AudioDevice *device = open_devices[i];
683+
if (device == this) {
684+
if (this->hidden) {
685+
SDL_AtomicSet(&this->hidden->device_change_flag, 1); /* let the audioqueue thread pick up on this when safe to do so. */
686+
}
687+
return noErr;
688+
}
689+
}
690+
}
677691
return noErr;
678692
}
679693
#endif
@@ -880,14 +894,25 @@ static int prepare_audioqueue(_THIS)
880894
// L R C LFE Ls Rs
881895
layout.mChannelLayoutTag = kAudioChannelLayoutTag_DVD_12;
882896
break;
897+
#if (defined(__IPHONE_OS_VERSION_MAX_ALLOWED) && __IPHONE_OS_VERSION_MAX_ALLOWED >= 130000) || \
898+
(defined(MAC_OS_X_VERSION_MAX_ALLOWED) && MAC_OS_X_VERSION_MAX_ALLOWED >= 101500)
883899
case 7:
884900
// L R C LFE Cs Ls Rs
885-
layout.mChannelLayoutTag = kAudioChannelLayoutTag_WAVE_6_1;
901+
if (@available(macOS 10.15, iOS 13, *)) {
902+
layout.mChannelLayoutTag = kAudioChannelLayoutTag_WAVE_6_1;
903+
} else {
904+
return SDL_SetError("Unsupported audio channels");
905+
}
886906
break;
887907
case 8:
888908
// L R C LFE Rls Rrs Ls Rs
889-
layout.mChannelLayoutTag = kAudioChannelLayoutTag_WAVE_7_1;
909+
if (@available(macOS 10.15, iOS 13, *)) {
910+
layout.mChannelLayoutTag = kAudioChannelLayoutTag_WAVE_7_1;
911+
} else {
912+
return SDL_SetError("Unsupported audio channels");
913+
}
890914
break;
915+
#endif
891916
default:
892917
return SDL_SetError("Unsupported audio channels");
893918
}

src/events/SDL_mouse.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -122,13 +122,13 @@ static void SDLCALL SDL_VitaTouchMouseDeviceChanged(void *userdata, const char *
122122
switch (*hint) {
123123
default:
124124
case '0':
125-
mouse->vita_touch_mouse_device = 0;
125+
mouse->vita_touch_mouse_device = 1;
126126
break;
127127
case '1':
128-
mouse->vita_touch_mouse_device = 1;
128+
mouse->vita_touch_mouse_device = 2;
129129
break;
130130
case '2':
131-
mouse->vita_touch_mouse_device = 2;
131+
mouse->vita_touch_mouse_device = 3;
132132
break;
133133
}
134134
}

src/events/SDL_touch.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -252,7 +252,7 @@ int SDL_SendTouch(SDL_TouchID id, SDL_FingerID fingerid, SDL_Window *window,
252252
/* SDL_HINT_VITA_TOUCH_MOUSE_DEVICE: controlling which touchpad should generate synthetic mouse events, PSVita-only */
253253
{
254254
#if defined(__vita__)
255-
if (mouse->touch_mouse_events && ((mouse->vita_touch_mouse_device == id) || (mouse->vita_touch_mouse_device == 2))) {
255+
if (mouse->touch_mouse_events && ((mouse->vita_touch_mouse_device == id) || (mouse->vita_touch_mouse_device == 3))) {
256256
#else
257257
if (mouse->touch_mouse_events) {
258258
#endif

src/file/SDL_rwops.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -533,7 +533,7 @@ static SDL_bool IsRegularFileOrPipe(FILE *f)
533533
!((st.st_mode & _S_IFMT) == _S_IFREG || (st.st_mode & _S_IFMT) == _S_IFIFO)) {
534534
return SDL_FALSE;
535535
}
536-
#else
536+
#elif !defined __EMSCRIPTEN__
537537
struct stat st;
538538
if (fstat(fileno(f), &st) < 0 || !(S_ISREG(st.st_mode) || S_ISFIFO(st.st_mode))) {
539539
return SDL_FALSE;

src/haptic/linux/SDL_syshaptic.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -878,7 +878,7 @@ static int SDL_SYS_ToFFEffect(struct ff_effect *dest, SDL_HapticEffect *src)
878878

879879
/* Header */
880880
dest->type = FF_RUMBLE;
881-
dest->direction = 0;
881+
dest->direction = 0x4000;
882882

883883
/* Replay */
884884
dest->replay.length = (leftright->length == SDL_HAPTIC_INFINITY) ? 0 : CLAMP(leftright->length);

src/joystick/SDL_gamecontroller.c

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2126,6 +2126,18 @@ SDL_bool SDL_ShouldIgnoreGameController(const char *name, SDL_JoystickGUID guid)
21262126

21272127
SDL_GetJoystickGUIDInfo(guid, &vendor, &product, &version, NULL);
21282128

2129+
#ifdef __WIN32__
2130+
if (SDL_GetHintBoolean("SDL_GAMECONTROLLER_ALLOW_STEAM_VIRTUAL_GAMEPAD", SDL_FALSE) &&
2131+
SDL_GetHintBoolean("STEAM_COMPAT_PROTON", SDL_FALSE)) {
2132+
/* We are launched by Steam and running under Proton
2133+
* We can't tell whether this controller is a Steam Virtual Gamepad,
2134+
* so assume that Proton is doing the appropriate filtering of controllers
2135+
* and anything we see here is fine to use.
2136+
*/
2137+
return SDL_FALSE;
2138+
}
2139+
#endif // __WIN32__
2140+
21292141
if (SDL_IsJoystickSteamVirtualGamepad(vendor, product, version)) {
21302142
return !SDL_GetHintBoolean("SDL_GAMECONTROLLER_ALLOW_STEAM_VIRTUAL_GAMEPAD", SDL_FALSE);
21312143
}

0 commit comments

Comments
 (0)