Skip to content

Commit 39142ac

Browse files
committed
Merge branch 'upstream'
2 parents bdbbc7d + 00a28b9 commit 39142ac

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

72 files changed

+483
-120
lines changed

Quake/snd_mem.c

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ along with this program; if not, write to the Free Software
1818
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
1919
2020
*/
21+
2122
// snd_mem.c: sound caching
2223

2324
#include "quakedef.h"
@@ -217,7 +218,7 @@ static void FindNextChunk (const char *name)
217218
}
218219
last_chunk = data_p + ((iff_chunk_len + 1) & ~1);
219220
data_p -= 8;
220-
if (!Q_strncmp((char *)data_p, name, 4))
221+
if (!strncmp((char *)data_p, name, 4))
221222
return;
222223
}
223224
}
@@ -268,7 +269,7 @@ wavinfo_t GetWavinfo (const char *name, byte *wav, int wavlength)
268269

269270
// find "RIFF" chunk
270271
FindChunk("RIFF");
271-
if (!(data_p && !Q_strncmp((char *)data_p + 8, "WAVE", 4)))
272+
if (!(data_p && !strncmp((char *)data_p + 8, "WAVE", 4)))
272273
{
273274
Con_Printf("%s missing RIFF/WAVE chunks\n", name);
274275
return info;
@@ -345,8 +346,14 @@ wavinfo_t GetWavinfo (const char *name, byte *wav, int wavlength)
345346
else
346347
info.samples = samples;
347348

349+
if (info.loopstart >= info.samples)
350+
{
351+
Con_Warning ("%s has loop start >= end\n", name);
352+
info.loopstart = -1;
353+
info.samples = samples;
354+
}
355+
348356
info.dataofs = data_p - wav;
349357

350358
return info;
351359
}
352-

Windows/SDL2/WhatsNew.txt

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,28 @@
11

22
This is a list of major changes in SDL's version history.
33

4+
---------------------------------------------------------------------------
5+
2.30.0:
6+
---------------------------------------------------------------------------
7+
8+
General:
9+
* Added support for 2 bits-per-pixel indexed surface formats
10+
* Added the function SDL_GameControllerGetSteamHandle() to get the Steam API handle for a controller, if available
11+
* Added the event SDL_CONTROLLERSTEAMHANDLEUPDATED which is sent when the Steam API handle for a controller changes. This could also change the name, VID, and PID of the controller.
12+
* Added the environment variable SDL_LOGGING to control default log output
13+
14+
macOS:
15+
* Added the hint SDL_HINT_JOYSTICK_IOKIT to control whether the IOKit controller driver should be used
16+
* Added the hint SDL_HINT_JOYSTICK_MFI to control whether the GCController controller driver should be used
17+
* Added the hint SDL_HINT_RENDER_METAL_PREFER_LOW_POWER_DEVICE to choose whether high or low power GPU should be used for rendering, in the case where there are multiple GPUs available
18+
19+
Xbox:
20+
* Added the function SDL_GDKGetDefaultUser()
21+
422
---------------------------------------------------------------------------
523
2.28.2:
624
---------------------------------------------------------------------------
25+
726
General:
827
* Added the hint SDL_HINT_JOYSTICK_WGI to control whether to use Windows.Gaming.Input for controllers
928

Windows/SDL2/bin/sdl2-config

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ while test $# -gt 0; do
4040
lib_suffix=$optarg
4141
;;
4242
--version)
43-
echo 2.28.4
43+
echo 2.30.4
4444
;;
4545
--cflags)
4646
echo -I${prefix}/include -Dmain=SDL_main

Windows/SDL2/include/SDL.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/*
22
Simple DirectMedia Layer
3-
Copyright (C) 1997-2023 Sam Lantinga <slouken@libsdl.org>
3+
Copyright (C) 1997-2024 Sam Lantinga <slouken@libsdl.org>
44
55
This software is provided 'as-is', without any express or implied
66
warranty. In no event will the authors be held liable for any damages

Windows/SDL2/include/SDL_assert.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/*
22
Simple DirectMedia Layer
3-
Copyright (C) 1997-2023 Sam Lantinga <slouken@libsdl.org>
3+
Copyright (C) 1997-2024 Sam Lantinga <slouken@libsdl.org>
44
55
This software is provided 'as-is', without any express or implied
66
warranty. In no event will the authors be held liable for any damages

Windows/SDL2/include/SDL_atomic.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/*
22
Simple DirectMedia Layer
3-
Copyright (C) 1997-2023 Sam Lantinga <slouken@libsdl.org>
3+
Copyright (C) 1997-2024 Sam Lantinga <slouken@libsdl.org>
44
55
This software is provided 'as-is', without any express or implied
66
warranty. In no event will the authors be held liable for any damages
@@ -209,7 +209,7 @@ typedef void (*SDL_KernelMemoryBarrierFunc)();
209209
#if defined(__ARM_ARCH_7__) || defined(__ARM_ARCH_7A__) || defined(__ARM_ARCH_7EM__) || defined(__ARM_ARCH_7R__) || defined(__ARM_ARCH_7M__) || defined(__ARM_ARCH_7S__) || defined(__ARM_ARCH_8A__)
210210
#define SDL_MemoryBarrierRelease() __asm__ __volatile__ ("dmb ish" : : : "memory")
211211
#define SDL_MemoryBarrierAcquire() __asm__ __volatile__ ("dmb ish" : : : "memory")
212-
#elif defined(__ARM_ARCH_6__) || defined(__ARM_ARCH_6J__) || defined(__ARM_ARCH_6K__) || defined(__ARM_ARCH_6T2__) || defined(__ARM_ARCH_6Z__) || defined(__ARM_ARCH_6ZK__) || defined(__ARM_ARCH_5TE__)
212+
#elif defined(__ARM_ARCH_6__) || defined(__ARM_ARCH_6J__) || defined(__ARM_ARCH_6K__) || defined(__ARM_ARCH_6T2__) || defined(__ARM_ARCH_6Z__) || defined(__ARM_ARCH_6ZK__)
213213
#ifdef __thumb__
214214
/* The mcr instruction isn't available in thumb mode, use real functions */
215215
#define SDL_MEMORY_BARRIER_USES_FUNCTION

Windows/SDL2/include/SDL_audio.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/*
22
Simple DirectMedia Layer
3-
Copyright (C) 1997-2023 Sam Lantinga <slouken@libsdl.org>
3+
Copyright (C) 1997-2024 Sam Lantinga <slouken@libsdl.org>
44
55
This software is provided 'as-is', without any express or implied
66
warranty. In no event will the authors be held liable for any damages

Windows/SDL2/include/SDL_bits.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/*
22
Simple DirectMedia Layer
3-
Copyright (C) 1997-2023 Sam Lantinga <slouken@libsdl.org>
3+
Copyright (C) 1997-2024 Sam Lantinga <slouken@libsdl.org>
44
55
This software is provided 'as-is', without any express or implied
66
warranty. In no event will the authors be held liable for any damages

Windows/SDL2/include/SDL_blendmode.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/*
22
Simple DirectMedia Layer
3-
Copyright (C) 1997-2023 Sam Lantinga <slouken@libsdl.org>
3+
Copyright (C) 1997-2024 Sam Lantinga <slouken@libsdl.org>
44
55
This software is provided 'as-is', without any express or implied
66
warranty. In no event will the authors be held liable for any damages
@@ -65,8 +65,8 @@ typedef enum
6565
typedef enum
6666
{
6767
SDL_BLENDOPERATION_ADD = 0x1, /**< dst + src: supported by all renderers */
68-
SDL_BLENDOPERATION_SUBTRACT = 0x2, /**< dst - src : supported by D3D9, D3D11, OpenGL, OpenGLES */
69-
SDL_BLENDOPERATION_REV_SUBTRACT = 0x3, /**< src - dst : supported by D3D9, D3D11, OpenGL, OpenGLES */
68+
SDL_BLENDOPERATION_SUBTRACT = 0x2, /**< src - dst : supported by D3D9, D3D11, OpenGL, OpenGLES */
69+
SDL_BLENDOPERATION_REV_SUBTRACT = 0x3, /**< dst - src : supported by D3D9, D3D11, OpenGL, OpenGLES */
7070
SDL_BLENDOPERATION_MINIMUM = 0x4, /**< min(dst, src) : supported by D3D9, D3D11 */
7171
SDL_BLENDOPERATION_MAXIMUM = 0x5 /**< max(dst, src) : supported by D3D9, D3D11 */
7272
} SDL_BlendOperation;

Windows/SDL2/include/SDL_clipboard.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/*
22
Simple DirectMedia Layer
3-
Copyright (C) 1997-2023 Sam Lantinga <slouken@libsdl.org>
3+
Copyright (C) 1997-2024 Sam Lantinga <slouken@libsdl.org>
44
55
This software is provided 'as-is', without any express or implied
66
warranty. In no event will the authors be held liable for any damages

Windows/SDL2/include/SDL_config.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/*
22
Simple DirectMedia Layer
3-
Copyright (C) 1997-2023 Sam Lantinga <slouken@libsdl.org>
3+
Copyright (C) 1997-2024 Sam Lantinga <slouken@libsdl.org>
44
55
This software is provided 'as-is', without any express or implied
66
warranty. In no event will the authors be held liable for any damages

Windows/SDL2/include/SDL_config_windows.h

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/*
22
Simple DirectMedia Layer
3-
Copyright (C) 1997-2023 Sam Lantinga <slouken@libsdl.org>
3+
Copyright (C) 1997-2024 Sam Lantinga <slouken@libsdl.org>
44
55
This software is provided 'as-is', without any express or implied
66
warranty. In no event will the authors be held liable for any damages
@@ -99,9 +99,11 @@ typedef unsigned int uintptr_t;
9999
#define HAVE_D3D11_H 1
100100
#define HAVE_ROAPI_H 1
101101
#endif
102-
#if defined(WDK_NTDDI_VERSION) && WDK_NTDDI_VERSION > 0x0A000008 /* 10.0.19041.0 */
102+
#if defined(__has_include)
103+
#if __has_include(<d3d12.h>) && __has_include(<d3d12sdklayers.h>)
103104
#define HAVE_D3D12_H 1
104105
#endif
106+
#endif
105107
#if defined(_WIN32_MAXVER) && _WIN32_MAXVER >= 0x0603 /* Windows 8.1 SDK */
106108
#define HAVE_SHELLSCALINGAPI_H 1
107109
#endif

Windows/SDL2/include/SDL_cpuinfo.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/*
22
Simple DirectMedia Layer
3-
Copyright (C) 1997-2023 Sam Lantinga <slouken@libsdl.org>
3+
Copyright (C) 1997-2024 Sam Lantinga <slouken@libsdl.org>
44
55
This software is provided 'as-is', without any express or implied
66
warranty. In no event will the authors be held liable for any damages

Windows/SDL2/include/SDL_egl.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/*
22
Simple DirectMedia Layer
3-
Copyright (C) 1997-2023 Sam Lantinga <slouken@libsdl.org>
3+
Copyright (C) 1997-2024 Sam Lantinga <slouken@libsdl.org>
44
55
This software is provided 'as-is', without any express or implied
66
warranty. In no event will the authors be held liable for any damages

Windows/SDL2/include/SDL_endian.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/*
22
Simple DirectMedia Layer
3-
Copyright (C) 1997-2023 Sam Lantinga <slouken@libsdl.org>
3+
Copyright (C) 1997-2024 Sam Lantinga <slouken@libsdl.org>
44
55
This software is provided 'as-is', without any express or implied
66
warranty. In no event will the authors be held liable for any damages

Windows/SDL2/include/SDL_error.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/*
22
Simple DirectMedia Layer
3-
Copyright (C) 1997-2023 Sam Lantinga <slouken@libsdl.org>
3+
Copyright (C) 1997-2024 Sam Lantinga <slouken@libsdl.org>
44
55
This software is provided 'as-is', without any express or implied
66
warranty. In no event will the authors be held liable for any damages

Windows/SDL2/include/SDL_events.h

Lines changed: 4 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/*
22
Simple DirectMedia Layer
3-
Copyright (C) 1997-2023 Sam Lantinga <slouken@libsdl.org>
3+
Copyright (C) 1997-2024 Sam Lantinga <slouken@libsdl.org>
44
55
This software is provided 'as-is', without any express or implied
66
warranty. In no event will the authors be held liable for any damages
@@ -131,6 +131,8 @@ typedef enum
131131
SDL_CONTROLLERTOUCHPADMOTION, /**< Game controller touchpad finger was moved */
132132
SDL_CONTROLLERTOUCHPADUP, /**< Game controller touchpad finger was lifted */
133133
SDL_CONTROLLERSENSORUPDATE, /**< Game controller sensor was updated */
134+
SDL_CONTROLLERUPDATECOMPLETE_RESERVED_FOR_SDL3,
135+
SDL_CONTROLLERSTEAMHANDLEUPDATED, /**< Game controller Steam handle has changed */
134136

135137
/* Touch events */
136138
SDL_FINGERDOWN = 0x700,
@@ -446,7 +448,7 @@ typedef struct SDL_ControllerButtonEvent
446448
*/
447449
typedef struct SDL_ControllerDeviceEvent
448450
{
449-
Uint32 type; /**< ::SDL_CONTROLLERDEVICEADDED, ::SDL_CONTROLLERDEVICEREMOVED, or ::SDL_CONTROLLERDEVICEREMAPPED */
451+
Uint32 type; /**< ::SDL_CONTROLLERDEVICEADDED, ::SDL_CONTROLLERDEVICEREMOVED, ::SDL_CONTROLLERDEVICEREMAPPED, or ::SDL_CONTROLLERSTEAMHANDLEUPDATED */
450452
Uint32 timestamp; /**< In milliseconds, populated using SDL_GetTicks() */
451453
Sint32 which; /**< The joystick device index for the ADDED event, instance id for the REMOVED or REMAPPED event */
452454
} SDL_ControllerDeviceEvent;
@@ -580,15 +582,6 @@ typedef struct SDL_QuitEvent
580582
Uint32 timestamp; /**< In milliseconds, populated using SDL_GetTicks() */
581583
} SDL_QuitEvent;
582584

583-
/**
584-
* \brief OS Specific event
585-
*/
586-
typedef struct SDL_OSEvent
587-
{
588-
Uint32 type; /**< ::SDL_QUIT */
589-
Uint32 timestamp; /**< In milliseconds, populated using SDL_GetTicks() */
590-
} SDL_OSEvent;
591-
592585
/**
593586
* \brief A user-defined event type (event.user.*)
594587
*/

Windows/SDL2/include/SDL_filesystem.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/*
22
Simple DirectMedia Layer
3-
Copyright (C) 1997-2023 Sam Lantinga <slouken@libsdl.org>
3+
Copyright (C) 1997-2024 Sam Lantinga <slouken@libsdl.org>
44
55
This software is provided 'as-is', without any express or implied
66
warranty. In no event will the authors be held liable for any damages
@@ -64,7 +64,7 @@ extern "C" {
6464
* directory of the application as it is uncommon to store resources outside
6565
* the executable. As such it is not a writable directory.
6666
*
67-
* The returned path is guaranteed to end with a path separator ('\' on
67+
* The returned path is guaranteed to end with a path separator ('\\' on
6868
* Windows, '/' on most other platforms).
6969
*
7070
* The pointer returned is owned by the caller. Please call SDL_free() on the
@@ -120,7 +120,7 @@ extern DECLSPEC char *SDLCALL SDL_GetBasePath(void);
120120
* - ...only use letters, numbers, and spaces. Avoid punctuation like "Game
121121
* Name 2: Bad Guy's Revenge!" ... "Game Name 2" is sufficient.
122122
*
123-
* The returned path is guaranteed to end with a path separator ('\' on
123+
* The returned path is guaranteed to end with a path separator ('\\' on
124124
* Windows, '/' on most other platforms).
125125
*
126126
* The pointer returned is owned by the caller. Please call SDL_free() on the

Windows/SDL2/include/SDL_gamecontroller.h

Lines changed: 27 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/*
22
Simple DirectMedia Layer
3-
Copyright (C) 1997-2023 Sam Lantinga <slouken@libsdl.org>
3+
Copyright (C) 1997-2024 Sam Lantinga <slouken@libsdl.org>
44
55
This software is provided 'as-is', without any express or implied
66
warranty. In no event will the authors be held liable for any damages
@@ -73,7 +73,8 @@ typedef enum
7373
SDL_CONTROLLER_TYPE_NVIDIA_SHIELD,
7474
SDL_CONTROLLER_TYPE_NINTENDO_SWITCH_JOYCON_LEFT,
7575
SDL_CONTROLLER_TYPE_NINTENDO_SWITCH_JOYCON_RIGHT,
76-
SDL_CONTROLLER_TYPE_NINTENDO_SWITCH_JOYCON_PAIR
76+
SDL_CONTROLLER_TYPE_NINTENDO_SWITCH_JOYCON_PAIR,
77+
SDL_CONTROLLER_TYPE_MAX
7778
} SDL_GameControllerType;
7879

7980
typedef enum
@@ -523,6 +524,20 @@ extern DECLSPEC Uint16 SDLCALL SDL_GameControllerGetFirmwareVersion(SDL_GameCont
523524
*/
524525
extern DECLSPEC const char * SDLCALL SDL_GameControllerGetSerial(SDL_GameController *gamecontroller);
525526

527+
/**
528+
* Get the Steam Input handle of an opened controller, if available.
529+
*
530+
* Returns an InputHandle_t for the controller that can be used with Steam Input API:
531+
* https://partner.steamgames.com/doc/api/ISteamInput
532+
*
533+
* \param gamecontroller the game controller object to query.
534+
* \returns the gamepad handle, or 0 if unavailable.
535+
*
536+
* \since This function is available since SDL 2.30.0.
537+
*/
538+
extern DECLSPEC Uint64 SDLCALL SDL_GameControllerGetSteamHandle(SDL_GameController *gamecontroller);
539+
540+
526541
/**
527542
* Check if a controller has been opened and is currently connected.
528543
*
@@ -598,7 +613,9 @@ extern DECLSPEC void SDLCALL SDL_GameControllerUpdate(void);
598613
* and are centered within ~8000 of zero, though advanced UI will allow users to set
599614
* or autodetect the dead zone, which varies between controllers.
600615
*
601-
* Trigger axis values range from 0 to SDL_JOYSTICK_AXIS_MAX.
616+
* Trigger axis values range from 0 (released) to SDL_JOYSTICK_AXIS_MAX
617+
* (fully pressed) when reported by SDL_GameControllerGetAxis(). Note that this is not the
618+
* same range that will be reported by the lower-level SDL_GetJoystickAxis().
602619
*/
603620
typedef enum
604621
{
@@ -687,8 +704,13 @@ SDL_GameControllerHasAxis(SDL_GameController *gamecontroller, SDL_GameController
687704
*
688705
* The axis indices start at index 0.
689706
*
690-
* The state is a value ranging from -32768 to 32767. Triggers, however, range
691-
* from 0 to 32767 (they never return a negative value).
707+
* For thumbsticks, the state is a value ranging from -32768 (up/left)
708+
* to 32767 (down/right).
709+
*
710+
* Triggers range from 0 when released to 32767 when fully pressed, and
711+
* never return a negative value. Note that this differs from the value
712+
* reported by the lower-level SDL_GetJoystickAxis(), which normally uses
713+
* the full range.
692714
*
693715
* \param gamecontroller a game controller
694716
* \param axis an axis index (one of the SDL_GameControllerAxis values)

Windows/SDL2/include/SDL_gesture.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/*
22
Simple DirectMedia Layer
3-
Copyright (C) 1997-2023 Sam Lantinga <slouken@libsdl.org>
3+
Copyright (C) 1997-2024 Sam Lantinga <slouken@libsdl.org>
44
55
This software is provided 'as-is', without any express or implied
66
warranty. In no event will the authors be held liable for any damages

Windows/SDL2/include/SDL_guid.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/*
22
Simple DirectMedia Layer
3-
Copyright (C) 1997-2023 Sam Lantinga <slouken@libsdl.org>
3+
Copyright (C) 1997-2024 Sam Lantinga <slouken@libsdl.org>
44
55
This software is provided 'as-is', without any express or implied
66
warranty. In no event will the authors be held liable for any damages

Windows/SDL2/include/SDL_haptic.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/*
22
Simple DirectMedia Layer
3-
Copyright (C) 1997-2023 Sam Lantinga <slouken@libsdl.org>
3+
Copyright (C) 1997-2024 Sam Lantinga <slouken@libsdl.org>
44
55
This software is provided 'as-is', without any express or implied
66
warranty. In no event will the authors be held liable for any damages

Windows/SDL2/include/SDL_hidapi.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/*
22
Simple DirectMedia Layer
3-
Copyright (C) 1997-2023 Sam Lantinga <slouken@libsdl.org>
3+
Copyright (C) 1997-2024 Sam Lantinga <slouken@libsdl.org>
44
55
This software is provided 'as-is', without any express or implied
66
warranty. In no event will the authors be held liable for any damages

0 commit comments

Comments
 (0)