Compare commits
10
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
6510d6ccbf | ||
|
|
b0b50da4b6 | ||
|
|
8b7a088efc | ||
|
|
7fc5edab8e | ||
|
|
24ccde693e | ||
|
|
f46ef5d76d | ||
|
|
5696677558 | ||
|
|
093307f1f4 | ||
|
|
f54014e173 | ||
|
|
64ad33884d |
No files matched your search
+5
-3
@@ -89,7 +89,7 @@ endif()
|
|||||||
# See docs/release_checklist.md
|
# See docs/release_checklist.md
|
||||||
set(SDL_MAJOR_VERSION 2)
|
set(SDL_MAJOR_VERSION 2)
|
||||||
set(SDL_MINOR_VERSION 32)
|
set(SDL_MINOR_VERSION 32)
|
||||||
set(SDL_MICRO_VERSION 4)
|
set(SDL_MICRO_VERSION 6)
|
||||||
set(SDL_VERSION "${SDL_MAJOR_VERSION}.${SDL_MINOR_VERSION}.${SDL_MICRO_VERSION}")
|
set(SDL_VERSION "${SDL_MAJOR_VERSION}.${SDL_MINOR_VERSION}.${SDL_MICRO_VERSION}")
|
||||||
|
|
||||||
# Set defaults preventing destination file conflicts
|
# Set defaults preventing destination file conflicts
|
||||||
@@ -1829,8 +1829,10 @@ elseif(WINDOWS)
|
|||||||
set(HAVE_DIRECTX TRUE)
|
set(HAVE_DIRECTX TRUE)
|
||||||
if(NOT MINGW AND NOT USE_WINSDK_DIRECTX)
|
if(NOT MINGW AND NOT USE_WINSDK_DIRECTX)
|
||||||
# TODO: change $ENV{DXSDL_DIR} to get the path from the include checks
|
# TODO: change $ENV{DXSDL_DIR} to get the path from the include checks
|
||||||
target_link_directories(sdl-build-options INTERFACE "$$ENV{DXSDK_DIR}\\lib\\${PROCESSOR_ARCH}")
|
file(TO_CMAKE_PATH "$ENV{DXSDK_DIR}\\lib\\${PROCESSOR_ARCH}" SDL2_TMP_DXSDK_LIB_DIR)
|
||||||
target_include_directories(sdl-build-options INTERFACE "$ENV{DXSDK_DIR}\\Include")
|
target_link_directories(sdl-build-options INTERFACE "${SDL2_TMP_DXSDK_LIB_DIR}")
|
||||||
|
file(TO_CMAKE_PATH "$ENV{DXSDK_DIR}\\Include" SDL2_TMP_DXSDK_INCLUDE_DIR)
|
||||||
|
target_include_directories(sdl-build-options INTERFACE "${SDL2_TMP_DXSDK_INCLUDE_DIR}")
|
||||||
endif()
|
endif()
|
||||||
endif()
|
endif()
|
||||||
set(CMAKE_REQUIRED_FLAGS ${ORIG_CMAKE_REQUIRED_FLAGS})
|
set(CMAKE_REQUIRED_FLAGS ${ORIG_CMAKE_REQUIRED_FLAGS})
|
||||||
|
|||||||
+1
-1
@@ -15,7 +15,7 @@
|
|||||||
LIBNAME = SDL2
|
LIBNAME = SDL2
|
||||||
MAJOR_VERSION = 2
|
MAJOR_VERSION = 2
|
||||||
MINOR_VERSION = 32
|
MINOR_VERSION = 32
|
||||||
MICRO_VERSION = 4
|
MICRO_VERSION = 6
|
||||||
VERSION = $(MAJOR_VERSION).$(MINOR_VERSION).$(MICRO_VERSION)
|
VERSION = $(MAJOR_VERSION).$(MINOR_VERSION).$(MICRO_VERSION)
|
||||||
DESCRIPTION = Simple DirectMedia Layer 2
|
DESCRIPTION = Simple DirectMedia Layer 2
|
||||||
|
|
||||||
|
|||||||
+1
-1
@@ -6,7 +6,7 @@
|
|||||||
LIBNAME = SDL2
|
LIBNAME = SDL2
|
||||||
MAJOR_VERSION = 2
|
MAJOR_VERSION = 2
|
||||||
MINOR_VERSION = 32
|
MINOR_VERSION = 32
|
||||||
MICRO_VERSION = 4
|
MICRO_VERSION = 6
|
||||||
VERSION = $(MAJOR_VERSION).$(MINOR_VERSION).$(MICRO_VERSION)
|
VERSION = $(MAJOR_VERSION).$(MINOR_VERSION).$(MICRO_VERSION)
|
||||||
|
|
||||||
LIBHOME = .
|
LIBHOME = .
|
||||||
|
|||||||
@@ -19,10 +19,10 @@
|
|||||||
<key>CFBundlePackageType</key>
|
<key>CFBundlePackageType</key>
|
||||||
<string>FMWK</string>
|
<string>FMWK</string>
|
||||||
<key>CFBundleShortVersionString</key>
|
<key>CFBundleShortVersionString</key>
|
||||||
<string>2.32.4</string>
|
<string>2.32.6</string>
|
||||||
<key>CFBundleSignature</key>
|
<key>CFBundleSignature</key>
|
||||||
<string>SDLX</string>
|
<string>SDLX</string>
|
||||||
<key>CFBundleVersion</key>
|
<key>CFBundleVersion</key>
|
||||||
<string>2.32.4</string>
|
<string>2.32.6</string>
|
||||||
</dict>
|
</dict>
|
||||||
</plist>
|
</plist>
|
||||||
@@ -9729,7 +9729,7 @@
|
|||||||
DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
|
DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
|
||||||
DEPLOYMENT_POSTPROCESSING = YES;
|
DEPLOYMENT_POSTPROCESSING = YES;
|
||||||
DYLIB_COMPATIBILITY_VERSION = 3201.0.0;
|
DYLIB_COMPATIBILITY_VERSION = 3201.0.0;
|
||||||
DYLIB_CURRENT_VERSION = 3201.4.0;
|
DYLIB_CURRENT_VERSION = 3201.6.0;
|
||||||
DYLIB_INSTALL_NAME_BASE = "@rpath";
|
DYLIB_INSTALL_NAME_BASE = "@rpath";
|
||||||
ENABLE_STRICT_OBJC_MSGSEND = YES;
|
ENABLE_STRICT_OBJC_MSGSEND = YES;
|
||||||
GCC_ALTIVEC_EXTENSIONS = YES;
|
GCC_ALTIVEC_EXTENSIONS = YES;
|
||||||
@@ -9770,7 +9770,7 @@
|
|||||||
isa = XCBuildConfiguration;
|
isa = XCBuildConfiguration;
|
||||||
buildSettings = {
|
buildSettings = {
|
||||||
CLANG_LINK_OBJC_RUNTIME = NO;
|
CLANG_LINK_OBJC_RUNTIME = NO;
|
||||||
MARKETING_VERSION = 2.32.4;
|
MARKETING_VERSION = 2.32.6;
|
||||||
OTHER_LDFLAGS = "-liconv";
|
OTHER_LDFLAGS = "-liconv";
|
||||||
};
|
};
|
||||||
name = Release;
|
name = Release;
|
||||||
@@ -9814,7 +9814,7 @@
|
|||||||
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
|
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
|
||||||
DEBUG_INFORMATION_FORMAT = dwarf;
|
DEBUG_INFORMATION_FORMAT = dwarf;
|
||||||
DYLIB_COMPATIBILITY_VERSION = 3201.0.0;
|
DYLIB_COMPATIBILITY_VERSION = 3201.0.0;
|
||||||
DYLIB_CURRENT_VERSION = 3201.4.0;
|
DYLIB_CURRENT_VERSION = 3201.6.0;
|
||||||
DYLIB_INSTALL_NAME_BASE = "@rpath";
|
DYLIB_INSTALL_NAME_BASE = "@rpath";
|
||||||
ENABLE_STRICT_OBJC_MSGSEND = YES;
|
ENABLE_STRICT_OBJC_MSGSEND = YES;
|
||||||
ENABLE_TESTABILITY = YES;
|
ENABLE_TESTABILITY = YES;
|
||||||
@@ -9856,7 +9856,7 @@
|
|||||||
isa = XCBuildConfiguration;
|
isa = XCBuildConfiguration;
|
||||||
buildSettings = {
|
buildSettings = {
|
||||||
CLANG_LINK_OBJC_RUNTIME = NO;
|
CLANG_LINK_OBJC_RUNTIME = NO;
|
||||||
MARKETING_VERSION = 2.32.4;
|
MARKETING_VERSION = 2.32.6;
|
||||||
OTHER_LDFLAGS = "-liconv";
|
OTHER_LDFLAGS = "-liconv";
|
||||||
};
|
};
|
||||||
name = Debug;
|
name = Debug;
|
||||||
@@ -10063,7 +10063,7 @@
|
|||||||
DEFINES_MODULE = YES;
|
DEFINES_MODULE = YES;
|
||||||
DEVELOPMENT_TEAM = "";
|
DEVELOPMENT_TEAM = "";
|
||||||
DYLIB_COMPATIBILITY_VERSION = 3201.0.0;
|
DYLIB_COMPATIBILITY_VERSION = 3201.0.0;
|
||||||
DYLIB_CURRENT_VERSION = 3201.4.0;
|
DYLIB_CURRENT_VERSION = 3201.6.0;
|
||||||
DYLIB_INSTALL_NAME_BASE = "@rpath";
|
DYLIB_INSTALL_NAME_BASE = "@rpath";
|
||||||
GCC_C_LANGUAGE_STANDARD = gnu11;
|
GCC_C_LANGUAGE_STANDARD = gnu11;
|
||||||
GCC_DYNAMIC_NO_PIC = NO;
|
GCC_DYNAMIC_NO_PIC = NO;
|
||||||
@@ -10115,7 +10115,7 @@
|
|||||||
DEFINES_MODULE = YES;
|
DEFINES_MODULE = YES;
|
||||||
DEVELOPMENT_TEAM = "";
|
DEVELOPMENT_TEAM = "";
|
||||||
DYLIB_COMPATIBILITY_VERSION = 3201.0.0;
|
DYLIB_COMPATIBILITY_VERSION = 3201.0.0;
|
||||||
DYLIB_CURRENT_VERSION = 3201.4.0;
|
DYLIB_CURRENT_VERSION = 3201.6.0;
|
||||||
DYLIB_INSTALL_NAME_BASE = "@rpath";
|
DYLIB_INSTALL_NAME_BASE = "@rpath";
|
||||||
ENABLE_NS_ASSERTIONS = NO;
|
ENABLE_NS_ASSERTIONS = NO;
|
||||||
GCC_C_LANGUAGE_STANDARD = gnu11;
|
GCC_C_LANGUAGE_STANDARD = gnu11;
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
Title SDL 2.32.4
|
Title SDL 2.32.6
|
||||||
Version 1
|
Version 1
|
||||||
Description SDL Library for Mac OS X (http://www.libsdl.org)
|
Description SDL Library for Mac OS X (http://www.libsdl.org)
|
||||||
DefaultLocation /Library/Frameworks
|
DefaultLocation /Library/Frameworks
|
||||||
|
|||||||
@@ -61,7 +61,7 @@ public class SDLActivity extends Activity implements View.OnSystemUiVisibilityCh
|
|||||||
private static final String TAG = "SDL";
|
private static final String TAG = "SDL";
|
||||||
private static final int SDL_MAJOR_VERSION = 2;
|
private static final int SDL_MAJOR_VERSION = 2;
|
||||||
private static final int SDL_MINOR_VERSION = 32;
|
private static final int SDL_MINOR_VERSION = 32;
|
||||||
private static final int SDL_MICRO_VERSION = 4;
|
private static final int SDL_MICRO_VERSION = 6;
|
||||||
/*
|
/*
|
||||||
// Display InputType.SOURCE/CLASS of events and devices
|
// Display InputType.SOURCE/CLASS of events and devices
|
||||||
//
|
//
|
||||||
|
|||||||
@@ -3516,7 +3516,7 @@ orig_CFLAGS="$CFLAGS"
|
|||||||
# See docs/release_checklist.md
|
# See docs/release_checklist.md
|
||||||
SDL_MAJOR_VERSION=2
|
SDL_MAJOR_VERSION=2
|
||||||
SDL_MINOR_VERSION=32
|
SDL_MINOR_VERSION=32
|
||||||
SDL_MICRO_VERSION=4
|
SDL_MICRO_VERSION=6
|
||||||
SDL_VERSION=$SDL_MAJOR_VERSION.$SDL_MINOR_VERSION.$SDL_MICRO_VERSION
|
SDL_VERSION=$SDL_MAJOR_VERSION.$SDL_MINOR_VERSION.$SDL_MICRO_VERSION
|
||||||
|
|
||||||
SDL_BINARY_AGE=`expr $SDL_MINOR_VERSION \* 100 + $SDL_MICRO_VERSION`
|
SDL_BINARY_AGE=`expr $SDL_MINOR_VERSION \* 100 + $SDL_MICRO_VERSION`
|
||||||
|
|||||||
+1
-1
@@ -13,7 +13,7 @@ dnl Set various version strings - taken gratefully from the GTk sources
|
|||||||
# See docs/release_checklist.md
|
# See docs/release_checklist.md
|
||||||
SDL_MAJOR_VERSION=2
|
SDL_MAJOR_VERSION=2
|
||||||
SDL_MINOR_VERSION=32
|
SDL_MINOR_VERSION=32
|
||||||
SDL_MICRO_VERSION=4
|
SDL_MICRO_VERSION=6
|
||||||
SDL_VERSION=$SDL_MAJOR_VERSION.$SDL_MINOR_VERSION.$SDL_MICRO_VERSION
|
SDL_VERSION=$SDL_MAJOR_VERSION.$SDL_MINOR_VERSION.$SDL_MICRO_VERSION
|
||||||
|
|
||||||
SDL_BINARY_AGE=`expr $SDL_MINOR_VERSION \* 100 + $SDL_MICRO_VERSION`
|
SDL_BINARY_AGE=`expr $SDL_MINOR_VERSION \* 100 + $SDL_MICRO_VERSION`
|
||||||
|
|||||||
@@ -115,7 +115,8 @@ _m_prefetch(void *__P)
|
|||||||
#include <lasxintrin.h>
|
#include <lasxintrin.h>
|
||||||
#define __LASX__
|
#define __LASX__
|
||||||
#endif
|
#endif
|
||||||
#if defined(HAVE_IMMINTRIN_H) && !defined(SDL_DISABLE_IMMINTRIN_H)
|
#if defined(HAVE_IMMINTRIN_H) && !defined(SDL_DISABLE_IMMINTRIN_H) && \
|
||||||
|
(defined(__x86_64__) || defined(_M_X64) || defined(__i386__) || defined(_M_IX86))
|
||||||
#include <immintrin.h>
|
#include <immintrin.h>
|
||||||
#else
|
#else
|
||||||
#if defined(__MMX__) && !defined(SDL_DISABLE_MMINTRIN_H)
|
#if defined(__MMX__) && !defined(SDL_DISABLE_MMINTRIN_H)
|
||||||
|
|||||||
@@ -808,8 +808,8 @@ extern DECLSPEC int SDLCALL SDL_FillRects
|
|||||||
*
|
*
|
||||||
* This assumes that the source and destination rectangles are the same size.
|
* This assumes that the source and destination rectangles are the same size.
|
||||||
* If either `srcrect` or `dstrect` are NULL, the entire surface (`src` or
|
* If either `srcrect` or `dstrect` are NULL, the entire surface (`src` or
|
||||||
* `dst`) is copied. The final blit rectangles are saved in `srcrect` and
|
* `dst`) is copied. The final blit rectangle is saved in `dstrect` after
|
||||||
* `dstrect` after all clipping is performed.
|
* all clipping is performed.
|
||||||
*
|
*
|
||||||
* The blit function should not be called on a locked surface.
|
* The blit function should not be called on a locked surface.
|
||||||
*
|
*
|
||||||
|
|||||||
@@ -58,7 +58,7 @@ typedef struct SDL_version
|
|||||||
*/
|
*/
|
||||||
#define SDL_MAJOR_VERSION 2
|
#define SDL_MAJOR_VERSION 2
|
||||||
#define SDL_MINOR_VERSION 32
|
#define SDL_MINOR_VERSION 32
|
||||||
#define SDL_PATCHLEVEL 4
|
#define SDL_PATCHLEVEL 6
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Macro to determine SDL version program was compiled against.
|
* Macro to determine SDL version program was compiled against.
|
||||||
|
|||||||
@@ -1318,7 +1318,7 @@ Uint8 SDL_EventState(Uint32 type, int state)
|
|||||||
Uint8 lo = (type & 0xff);
|
Uint8 lo = (type & 0xff);
|
||||||
|
|
||||||
if (SDL_disabled_events[hi] &&
|
if (SDL_disabled_events[hi] &&
|
||||||
(SDL_disabled_events[hi]->bits[lo / 32] & (1 << (lo & 31)))) {
|
(SDL_disabled_events[hi]->bits[lo / 32] & (1U << (lo & 31)))) {
|
||||||
current_state = SDL_DISABLE;
|
current_state = SDL_DISABLE;
|
||||||
} else {
|
} else {
|
||||||
current_state = SDL_ENABLE;
|
current_state = SDL_ENABLE;
|
||||||
@@ -1332,11 +1332,11 @@ Uint8 SDL_EventState(Uint32 type, int state)
|
|||||||
}
|
}
|
||||||
/* Out of memory, nothing we can do... */
|
/* Out of memory, nothing we can do... */
|
||||||
if (SDL_disabled_events[hi]) {
|
if (SDL_disabled_events[hi]) {
|
||||||
SDL_disabled_events[hi]->bits[lo / 32] |= (1 << (lo & 31));
|
SDL_disabled_events[hi]->bits[lo / 32] |= (1U << (lo & 31));
|
||||||
SDL_FlushEvent(type);
|
SDL_FlushEvent(type);
|
||||||
}
|
}
|
||||||
} else { // state == SDL_ENABLE
|
} else { // state == SDL_ENABLE
|
||||||
SDL_disabled_events[hi]->bits[lo / 32] &= ~(1 << (lo & 31));
|
SDL_disabled_events[hi]->bits[lo / 32] &= ~(1U << (lo & 31));
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifndef SDL_JOYSTICK_DISABLED
|
#ifndef SDL_JOYSTICK_DISABLED
|
||||||
|
|||||||
@@ -79,7 +79,7 @@ case $host in
|
|||||||
backend="mac"
|
backend="mac"
|
||||||
os="darwin"
|
os="darwin"
|
||||||
threads="pthreads"
|
threads="pthreads"
|
||||||
LIBS="${LIBS} -framework IOKit -framework CoreFoundation -framework AppKit"
|
LIBS="${LIBS} -framework IOKit -framework CoreFoundation"
|
||||||
;;
|
;;
|
||||||
*-freebsd*)
|
*-freebsd*)
|
||||||
AC_MSG_RESULT([ (FreeBSD back-end)])
|
AC_MSG_RESULT([ (FreeBSD back-end)])
|
||||||
|
|||||||
@@ -14,7 +14,7 @@ COBJS=hid.o
|
|||||||
CPPOBJS=../hidtest/hidtest.o
|
CPPOBJS=../hidtest/hidtest.o
|
||||||
OBJS=$(COBJS) $(CPPOBJS)
|
OBJS=$(COBJS) $(CPPOBJS)
|
||||||
CFLAGS+=-I../hidapi -Wall -g -c
|
CFLAGS+=-I../hidapi -Wall -g -c
|
||||||
LIBS=-framework IOKit -framework CoreFoundation -framework AppKit
|
LIBS=-framework IOKit -framework CoreFoundation
|
||||||
|
|
||||||
|
|
||||||
hidtest: $(OBJS)
|
hidtest: $(OBJS)
|
||||||
|
|||||||
+7
-17
@@ -37,9 +37,6 @@
|
|||||||
|
|
||||||
#define VALVE_USB_VID 0x28DE
|
#define VALVE_USB_VID 0x28DE
|
||||||
|
|
||||||
/* As defined in AppKit.h, but we don't need the entire AppKit for a single constant. */
|
|
||||||
extern const double NSAppKitVersionNumber;
|
|
||||||
|
|
||||||
/* Barrier implementation because Mac OSX doesn't have pthread_barrier.
|
/* Barrier implementation because Mac OSX doesn't have pthread_barrier.
|
||||||
It also doesn't have clock_gettime(). So much for POSIX and SUSv2.
|
It also doesn't have clock_gettime(). So much for POSIX and SUSv2.
|
||||||
This implementation came from Brent Priddy and was posted on
|
This implementation came from Brent Priddy and was posted on
|
||||||
@@ -134,7 +131,6 @@ struct hid_device_list_node
|
|||||||
};
|
};
|
||||||
|
|
||||||
static IOHIDManagerRef hid_mgr = 0x0;
|
static IOHIDManagerRef hid_mgr = 0x0;
|
||||||
static int is_macos_10_10_or_greater = 0;
|
|
||||||
static struct hid_device_list_node *device_list = 0x0;
|
static struct hid_device_list_node *device_list = 0x0;
|
||||||
|
|
||||||
static hid_device *new_hid_device(void)
|
static hid_device *new_hid_device(void)
|
||||||
@@ -489,7 +485,6 @@ static int init_hid_manager(void)
|
|||||||
int HID_API_EXPORT hid_init(void)
|
int HID_API_EXPORT hid_init(void)
|
||||||
{
|
{
|
||||||
if (!hid_mgr) {
|
if (!hid_mgr) {
|
||||||
is_macos_10_10_or_greater = (NSAppKitVersionNumber >= 1343); /* NSAppKitVersionNumber10_10 */
|
|
||||||
return init_hid_manager();
|
return init_hid_manager();
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1140,13 +1135,14 @@ int HID_API_EXPORT hid_get_feature_report(hid_device *dev, unsigned char *data,
|
|||||||
|
|
||||||
void HID_API_EXPORT hid_close(hid_device *dev)
|
void HID_API_EXPORT hid_close(hid_device *dev)
|
||||||
{
|
{
|
||||||
|
int disconnected;
|
||||||
|
|
||||||
if (!dev)
|
if (!dev)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
/* Disconnect the report callback before close.
|
/* Disconnect the report callback before close. */
|
||||||
See comment below.
|
disconnected = dev->disconnected;
|
||||||
*/
|
if (!disconnected) {
|
||||||
if (is_macos_10_10_or_greater || !dev->disconnected) {
|
|
||||||
IOHIDDeviceRegisterInputReportCallback(
|
IOHIDDeviceRegisterInputReportCallback(
|
||||||
dev->device_handle, dev->input_report_buf, dev->max_input_report_len,
|
dev->device_handle, dev->input_report_buf, dev->max_input_report_len,
|
||||||
NULL, dev);
|
NULL, dev);
|
||||||
@@ -1169,14 +1165,8 @@ void HID_API_EXPORT hid_close(hid_device *dev)
|
|||||||
|
|
||||||
/* Close the OS handle to the device, but only if it's not
|
/* Close the OS handle to the device, but only if it's not
|
||||||
been unplugged. If it's been unplugged, then calling
|
been unplugged. If it's been unplugged, then calling
|
||||||
IOHIDDeviceClose() will crash.
|
IOHIDDeviceClose() will crash. */
|
||||||
|
if (!disconnected) {
|
||||||
UPD: The crash part was true in/until some version of macOS.
|
|
||||||
Starting with macOS 10.15, there is an opposite effect in some environments:
|
|
||||||
crash happenes if IOHIDDeviceClose() is not called.
|
|
||||||
Not leaking a resource in all tested environments.
|
|
||||||
*/
|
|
||||||
if (is_macos_10_10_or_greater || !dev->disconnected) {
|
|
||||||
IOHIDDeviceClose(dev->device_handle, kIOHIDOptionsTypeNone);
|
IOHIDDeviceClose(dev->device_handle, kIOHIDOptionsTypeNone);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -817,6 +817,8 @@ static SDL_bool LoadStickCalibration(SDL_DriverSwitch_Context *ctx)
|
|||||||
SwitchSubcommandInputPacket_t *factory_reply = NULL;
|
SwitchSubcommandInputPacket_t *factory_reply = NULL;
|
||||||
SwitchSPIOpData_t readUserParams;
|
SwitchSPIOpData_t readUserParams;
|
||||||
SwitchSPIOpData_t readFactoryParams;
|
SwitchSPIOpData_t readFactoryParams;
|
||||||
|
const int MAX_ATTEMPTS = 3;
|
||||||
|
int attempt;
|
||||||
|
|
||||||
/* Read User Calibration Info */
|
/* Read User Calibration Info */
|
||||||
readUserParams.unAddress = k_unSPIStickUserCalibrationStartOffset;
|
readUserParams.unAddress = k_unSPIStickUserCalibrationStartOffset;
|
||||||
@@ -829,10 +831,21 @@ static SDL_bool LoadStickCalibration(SDL_DriverSwitch_Context *ctx)
|
|||||||
readFactoryParams.unAddress = k_unSPIStickFactoryCalibrationStartOffset;
|
readFactoryParams.unAddress = k_unSPIStickFactoryCalibrationStartOffset;
|
||||||
readFactoryParams.ucLength = k_unSPIStickFactoryCalibrationLength;
|
readFactoryParams.ucLength = k_unSPIStickFactoryCalibrationLength;
|
||||||
|
|
||||||
|
for (attempt = 0; ; ++attempt) {
|
||||||
if (!WriteSubcommand(ctx, k_eSwitchSubcommandIDs_SPIFlashRead, (uint8_t *)&readFactoryParams, sizeof(readFactoryParams), &factory_reply)) {
|
if (!WriteSubcommand(ctx, k_eSwitchSubcommandIDs_SPIFlashRead, (uint8_t *)&readFactoryParams, sizeof(readFactoryParams), &factory_reply)) {
|
||||||
return SDL_FALSE;
|
return SDL_FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (factory_reply->stickFactoryCalibration.opData.unAddress == k_unSPIStickFactoryCalibrationStartOffset) {
|
||||||
|
/* We successfully read the calibration data */
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (attempt == MAX_ATTEMPTS) {
|
||||||
|
return SDL_FALSE;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/* Automatically select the user calibration if magic bytes are set */
|
/* Automatically select the user calibration if magic bytes are set */
|
||||||
if (user_reply && user_reply->stickUserCalibration.rgucLeftMagic[0] == 0xB2 && user_reply->stickUserCalibration.rgucLeftMagic[1] == 0xA1) {
|
if (user_reply && user_reply->stickUserCalibration.rgucLeftMagic[0] == 0xB2 && user_reply->stickUserCalibration.rgucLeftMagic[1] == 0xA1) {
|
||||||
pLeftStickCal = user_reply->stickUserCalibration.rgucLeftCalibration;
|
pLeftStickCal = user_reply->stickUserCalibration.rgucLeftCalibration;
|
||||||
@@ -1426,6 +1439,10 @@ static SDL_bool HIDAPI_DriverSwitch_OpenJoystick(SDL_HIDAPI_Device *device, SDL_
|
|||||||
ctx->m_bSyncWrite = SDL_TRUE;
|
ctx->m_bSyncWrite = SDL_TRUE;
|
||||||
|
|
||||||
if (!ctx->m_bInputOnly) {
|
if (!ctx->m_bInputOnly) {
|
||||||
|
#ifdef SDL_PLATFORM_MACOS
|
||||||
|
// Wait for the OS to finish its handshake with the controller
|
||||||
|
SDL_Delay(250);
|
||||||
|
#endif
|
||||||
GetInitialInputMode(ctx);
|
GetInitialInputMode(ctx);
|
||||||
ctx->m_nCurrentInputMode = ctx->m_nInitialInputMode;
|
ctx->m_nCurrentInputMode = ctx->m_nInitialInputMode;
|
||||||
|
|
||||||
|
|||||||
@@ -9,8 +9,8 @@ LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US
|
|||||||
//
|
//
|
||||||
|
|
||||||
VS_VERSION_INFO VERSIONINFO
|
VS_VERSION_INFO VERSIONINFO
|
||||||
FILEVERSION 2,32,4,0
|
FILEVERSION 2,32,6,0
|
||||||
PRODUCTVERSION 2,32,4,0
|
PRODUCTVERSION 2,32,6,0
|
||||||
FILEFLAGSMASK 0x3fL
|
FILEFLAGSMASK 0x3fL
|
||||||
FILEFLAGS 0x0L
|
FILEFLAGS 0x0L
|
||||||
FILEOS 0x40004L
|
FILEOS 0x40004L
|
||||||
@@ -23,12 +23,12 @@ BEGIN
|
|||||||
BEGIN
|
BEGIN
|
||||||
VALUE "CompanyName", "\0"
|
VALUE "CompanyName", "\0"
|
||||||
VALUE "FileDescription", "SDL\0"
|
VALUE "FileDescription", "SDL\0"
|
||||||
VALUE "FileVersion", "2, 32, 4, 0\0"
|
VALUE "FileVersion", "2, 32, 6, 0\0"
|
||||||
VALUE "InternalName", "SDL\0"
|
VALUE "InternalName", "SDL\0"
|
||||||
VALUE "LegalCopyright", "Copyright (C) 2025 Sam Lantinga\0"
|
VALUE "LegalCopyright", "Copyright (C) 2025 Sam Lantinga\0"
|
||||||
VALUE "OriginalFilename", "SDL2.dll\0"
|
VALUE "OriginalFilename", "SDL2.dll\0"
|
||||||
VALUE "ProductName", "Simple DirectMedia Layer\0"
|
VALUE "ProductName", "Simple DirectMedia Layer\0"
|
||||||
VALUE "ProductVersion", "2, 32, 4, 0\0"
|
VALUE "ProductVersion", "2, 32, 6, 0\0"
|
||||||
END
|
END
|
||||||
END
|
END
|
||||||
BLOCK "VarFileInfo"
|
BLOCK "VarFileInfo"
|
||||||
|
|||||||
@@ -975,8 +975,8 @@ static int SetDrawState(GLES2_RenderData *data, const SDL_RenderCommand *cmd, co
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (texture) {
|
if (texture) {
|
||||||
SDL_Vertex *verts = (SDL_Vertex *)(((Uint8 *)vertices) + cmd->data.draw.first);
|
uintptr_t base = (uintptr_t)vertices + cmd->data.draw.first; // address of first vertex, or base offset when using VBOs.
|
||||||
data->glVertexAttribPointer(GLES2_ATTRIBUTE_TEXCOORD, 2, GL_FLOAT, GL_FALSE, stride, (const GLvoid *)&verts->tex_coord);
|
data->glVertexAttribPointer(GLES2_ATTRIBUTE_TEXCOORD, 2, GL_FLOAT, GL_FALSE, stride, (const GLvoid *)(base + offsetof(SDL_Vertex, tex_coord)));
|
||||||
}
|
}
|
||||||
|
|
||||||
if (GLES2_SelectProgram(data, imgsrc, texture ? texture->w : 0, texture ? texture->h : 0) < 0) {
|
if (GLES2_SelectProgram(data, imgsrc, texture ? texture->w : 0, texture ? texture->h : 0) < 0) {
|
||||||
@@ -1009,9 +1009,9 @@ static int SetDrawState(GLES2_RenderData *data, const SDL_RenderCommand *cmd, co
|
|||||||
|
|
||||||
/* all drawing commands use this */
|
/* all drawing commands use this */
|
||||||
{
|
{
|
||||||
SDL_VertexSolid *verts = (SDL_VertexSolid *)(((Uint8 *)vertices) + cmd->data.draw.first);
|
uintptr_t base = (uintptr_t)vertices + cmd->data.draw.first; // address of first vertex, or base offset when using VBOs.
|
||||||
data->glVertexAttribPointer(GLES2_ATTRIBUTE_POSITION, 2, GL_FLOAT, GL_FALSE, stride, (const GLvoid *)&verts->position);
|
data->glVertexAttribPointer(GLES2_ATTRIBUTE_POSITION, 2, GL_FLOAT, GL_FALSE, stride, (const GLvoid *)(base + offsetof(SDL_VertexSolid, position)));
|
||||||
data->glVertexAttribPointer(GLES2_ATTRIBUTE_COLOR, 4, GL_UNSIGNED_BYTE, GL_TRUE /* Normalized */, stride, (const GLvoid *)&verts->color);
|
data->glVertexAttribPointer(GLES2_ATTRIBUTE_COLOR, 4, GL_UNSIGNED_BYTE, GL_TRUE /* Normalized */, stride, (const GLvoid *)(base + offsetof(SDL_VertexSolid, color)));
|
||||||
}
|
}
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
@@ -1200,7 +1200,8 @@ static int GLES2_RunCommandQueue(SDL_Renderer *renderer, SDL_RenderCommand *cmd,
|
|||||||
if (data->current_vertex_buffer >= SDL_arraysize(data->vertex_buffers)) {
|
if (data->current_vertex_buffer >= SDL_arraysize(data->vertex_buffers)) {
|
||||||
data->current_vertex_buffer = 0;
|
data->current_vertex_buffer = 0;
|
||||||
}
|
}
|
||||||
vertices = NULL; /* attrib pointers will be offsets into the VBO. */
|
// attrib pointers will be offsets into the VBO.
|
||||||
|
vertices = (void *)(uintptr_t)0; // must be the exact value 0, not NULL (the representation of NULL is not guaranteed to be 0).
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
while (cmd) {
|
while (cmd) {
|
||||||
|
|||||||
Reference in new issue
Block a user