Compare commits
18
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
9519b9916c | ||
|
|
00494df2f1 | ||
|
|
948196448f | ||
|
|
7ca3d26e7a | ||
|
|
f79d28085d | ||
|
|
74a005f73f | ||
|
|
6f7aa1e755 | ||
|
|
847a6cce96 | ||
|
|
95aed34a69 | ||
|
|
21e0382edd | ||
|
|
0cdfdb9970 | ||
|
|
f75b0aa814 | ||
|
|
403f87340f | ||
|
|
07cfc34a2e | ||
|
|
4222cebef6 | ||
|
|
1e2aa2363b | ||
|
|
0b25cd2196 | ||
|
|
b7457ff61b |
No files matched your search
+5
-2
@@ -87,7 +87,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 30)
|
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(SDL_VERSION "${SDL_MAJOR_VERSION}.${SDL_MINOR_VERSION}.${SDL_MICRO_VERSION}")
|
||||||
|
|
||||||
# Set defaults preventing destination file conflicts
|
# Set defaults preventing destination file conflicts
|
||||||
@@ -3520,7 +3520,10 @@ if(SDL_TEST)
|
|||||||
endif()
|
endif()
|
||||||
|
|
||||||
if(MSVC AND NOT SDL_LIBC)
|
if(MSVC AND NOT SDL_LIBC)
|
||||||
set(targets SDL2)
|
set(targets )
|
||||||
|
if(TARGET SDL2)
|
||||||
|
list(APPEND targets SDL2)
|
||||||
|
endif()
|
||||||
if(TARGET SDL2-static)
|
if(TARGET SDL2-static)
|
||||||
list(APPEND targets SDL2-static)
|
list(APPEND targets SDL2-static)
|
||||||
endif()
|
endif()
|
||||||
|
|||||||
+1
-1
@@ -15,7 +15,7 @@
|
|||||||
LIBNAME = SDL2
|
LIBNAME = SDL2
|
||||||
MAJOR_VERSION = 2
|
MAJOR_VERSION = 2
|
||||||
MINOR_VERSION = 30
|
MINOR_VERSION = 30
|
||||||
MICRO_VERSION = 6
|
MICRO_VERSION = 7
|
||||||
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 = 30
|
MINOR_VERSION = 30
|
||||||
MICRO_VERSION = 6
|
MICRO_VERSION = 7
|
||||||
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.30.6</string>
|
<string>2.30.7</string>
|
||||||
<key>CFBundleSignature</key>
|
<key>CFBundleSignature</key>
|
||||||
<string>SDLX</string>
|
<string>SDLX</string>
|
||||||
<key>CFBundleVersion</key>
|
<key>CFBundleVersion</key>
|
||||||
<string>2.30.6</string>
|
<string>2.30.7</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 = 3001.0.0;
|
DYLIB_COMPATIBILITY_VERSION = 3001.0.0;
|
||||||
DYLIB_CURRENT_VERSION = 3001.6.0;
|
DYLIB_CURRENT_VERSION = 3001.7.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.30.6;
|
MARKETING_VERSION = 2.30.7;
|
||||||
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 = 3001.0.0;
|
DYLIB_COMPATIBILITY_VERSION = 3001.0.0;
|
||||||
DYLIB_CURRENT_VERSION = 3001.6.0;
|
DYLIB_CURRENT_VERSION = 3001.7.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.30.6;
|
MARKETING_VERSION = 2.30.7;
|
||||||
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 = 3001.0.0;
|
DYLIB_COMPATIBILITY_VERSION = 3001.0.0;
|
||||||
DYLIB_CURRENT_VERSION = 3001.6.0;
|
DYLIB_CURRENT_VERSION = 3001.7.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 = 3001.0.0;
|
DYLIB_COMPATIBILITY_VERSION = 3001.0.0;
|
||||||
DYLIB_CURRENT_VERSION = 3001.6.0;
|
DYLIB_CURRENT_VERSION = 3001.7.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.30.6
|
Title SDL 2.30.7
|
||||||
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 = 30;
|
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
|
// Display InputType.SOURCE/CLASS of events and devices
|
||||||
//
|
//
|
||||||
|
|||||||
@@ -3508,7 +3508,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=30
|
SDL_MINOR_VERSION=30
|
||||||
SDL_MICRO_VERSION=6
|
SDL_MICRO_VERSION=7
|
||||||
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=30
|
SDL_MINOR_VERSION=30
|
||||||
SDL_MICRO_VERSION=6
|
SDL_MICRO_VERSION=7
|
||||||
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`
|
||||||
|
|||||||
@@ -59,7 +59,7 @@ typedef struct SDL_version
|
|||||||
*/
|
*/
|
||||||
#define SDL_MAJOR_VERSION 2
|
#define SDL_MAJOR_VERSION 2
|
||||||
#define SDL_MINOR_VERSION 30
|
#define SDL_MINOR_VERSION 30
|
||||||
#define SDL_PATCHLEVEL 6
|
#define SDL_PATCHLEVEL 7
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Macro to determine SDL version program was compiled against.
|
* Macro to determine SDL version program was compiled against.
|
||||||
|
|||||||
@@ -36,6 +36,7 @@
|
|||||||
|
|
||||||
#ifdef HAVE_STDIO_H
|
#ifdef HAVE_STDIO_H
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
|
#include <errno.h>
|
||||||
#include <sys/stat.h>
|
#include <sys/stat.h>
|
||||||
#endif
|
#endif
|
||||||
#ifdef HAVE_LIMITS_H
|
#ifdef HAVE_LIMITS_H
|
||||||
@@ -632,7 +633,7 @@ SDL_RWops *SDL_RWFromFile(const char *file, const char *mode)
|
|||||||
FILE *fp = fopen(file, mode);
|
FILE *fp = fopen(file, mode);
|
||||||
#endif
|
#endif
|
||||||
if (!fp) {
|
if (!fp) {
|
||||||
SDL_SetError("Couldn't open %s", file);
|
SDL_SetError("Couldn't open %s: %s", file, strerror(errno));
|
||||||
} else if (!IsRegularFileOrPipe(fp)) {
|
} else if (!IsRegularFileOrPipe(fp)) {
|
||||||
fclose(fp);
|
fclose(fp);
|
||||||
fp = NULL;
|
fp = NULL;
|
||||||
|
|||||||
@@ -395,6 +395,7 @@ static Uint32 initial_wheel_devices[] = {
|
|||||||
MAKE_VIDPID(0x2433, 0xf303), /* Asetek SimSports La Prima Wheelbase */
|
MAKE_VIDPID(0x2433, 0xf303), /* Asetek SimSports La Prima Wheelbase */
|
||||||
MAKE_VIDPID(0x2433, 0xf306), /* Asetek SimSports Tony Kannan Wheelbase */
|
MAKE_VIDPID(0x2433, 0xf306), /* Asetek SimSports Tony Kannan Wheelbase */
|
||||||
MAKE_VIDPID(0x3416, 0x0301), /* Cammus C5 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, 0x0000), /* Moza R16/R21 Wheelbase */
|
||||||
MAKE_VIDPID(0x346e, 0x0002), /* Moza R9 Wheelbase */
|
MAKE_VIDPID(0x346e, 0x0002), /* Moza R9 Wheelbase */
|
||||||
MAKE_VIDPID(0x346e, 0x0004), /* Moza R5 Wheelbase */
|
MAKE_VIDPID(0x346e, 0x0004), /* Moza R5 Wheelbase */
|
||||||
|
|||||||
@@ -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, 0x576d ), k_eControllerType_PS3Controller, NULL }, // Power A PS3
|
||||||
{ MAKE_CONTROLLER_ID( 0x20d6, 0xca6d ), k_eControllerType_PS3Controller, NULL }, // From SDL
|
{ 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, 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, 0x83c3 ), k_eControllerType_PS3Controller, NULL }, // gioteck vx2
|
||||||
{ MAKE_CONTROLLER_ID( 0x25f0, 0xc121 ), k_eControllerType_PS3Controller, NULL }, //
|
{ MAKE_CONTROLLER_ID( 0x25f0, 0xc121 ), k_eControllerType_PS3Controller, NULL }, //
|
||||||
{ MAKE_CONTROLLER_ID( 0x2c22, 0x2003 ), k_eControllerType_PS3Controller, NULL }, // Qanba Drone
|
{ MAKE_CONTROLLER_ID( 0x2c22, 0x2003 ), k_eControllerType_PS3Controller, NULL }, // Qanba Drone
|
||||||
|
|||||||
@@ -50,6 +50,7 @@ typedef struct
|
|||||||
SDL_HIDAPI_Device *device;
|
SDL_HIDAPI_Device *device;
|
||||||
SDL_Joystick *joystick;
|
SDL_Joystick *joystick;
|
||||||
SDL_bool is_shanwan;
|
SDL_bool is_shanwan;
|
||||||
|
SDL_bool has_analog_buttons;
|
||||||
SDL_bool report_sensors;
|
SDL_bool report_sensors;
|
||||||
SDL_bool effects_updated;
|
SDL_bool effects_updated;
|
||||||
int player_index;
|
int player_index;
|
||||||
@@ -145,6 +146,7 @@ static SDL_bool HIDAPI_DriverPS3_InitDevice(SDL_HIDAPI_Device *device)
|
|||||||
}
|
}
|
||||||
ctx->device = device;
|
ctx->device = device;
|
||||||
ctx->is_shanwan = is_shanwan;
|
ctx->is_shanwan = is_shanwan;
|
||||||
|
ctx->has_analog_buttons = SDL_TRUE;
|
||||||
|
|
||||||
device->context = ctx;
|
device->context = ctx;
|
||||||
|
|
||||||
@@ -247,7 +249,10 @@ static SDL_bool HIDAPI_DriverPS3_OpenJoystick(SDL_HIDAPI_Device *device, SDL_Joy
|
|||||||
|
|
||||||
/* Initialize the joystick capabilities */
|
/* Initialize the joystick capabilities */
|
||||||
joystick->nbuttons = 15;
|
joystick->nbuttons = 15;
|
||||||
joystick->naxes = 16;
|
joystick->naxes = 6;
|
||||||
|
if (ctx->has_analog_buttons) {
|
||||||
|
joystick->naxes += 10;
|
||||||
|
}
|
||||||
joystick->epowerlevel = SDL_JOYSTICK_POWER_WIRED;
|
joystick->epowerlevel = SDL_JOYSTICK_POWER_WIRED;
|
||||||
|
|
||||||
SDL_PrivateJoystickAddSensor(joystick, SDL_SENSOR_ACCEL, 100.0f);
|
SDL_PrivateJoystickAddSensor(joystick, SDL_SENSOR_ACCEL, 100.0f);
|
||||||
@@ -432,7 +437,7 @@ static void HIDAPI_DriverPS3_HandleStatePacket(SDL_Joystick *joystick, SDL_Drive
|
|||||||
SDL_PrivateJoystickAxis(joystick, SDL_CONTROLLER_AXIS_RIGHTY, axis);
|
SDL_PrivateJoystickAxis(joystick, SDL_CONTROLLER_AXIS_RIGHTY, axis);
|
||||||
|
|
||||||
/* Buttons are mapped as axes in the order they appear in the button enumeration */
|
/* Buttons are mapped as axes in the order they appear in the button enumeration */
|
||||||
{
|
if (ctx->has_analog_buttons) {
|
||||||
static int button_axis_offsets[] = {
|
static int button_axis_offsets[] = {
|
||||||
24, /* SDL_CONTROLLER_BUTTON_A */
|
24, /* SDL_CONTROLLER_BUTTON_A */
|
||||||
23, /* SDL_CONTROLLER_BUTTON_B */
|
23, /* SDL_CONTROLLER_BUTTON_B */
|
||||||
@@ -617,6 +622,11 @@ static SDL_bool HIDAPI_DriverPS3ThirdParty_InitDevice(SDL_HIDAPI_Device *device)
|
|||||||
return SDL_FALSE;
|
return SDL_FALSE;
|
||||||
}
|
}
|
||||||
ctx->device = device;
|
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;
|
device->context = ctx;
|
||||||
|
|
||||||
@@ -650,8 +660,17 @@ static SDL_bool HIDAPI_DriverPS3ThirdParty_OpenJoystick(SDL_HIDAPI_Device *devic
|
|||||||
|
|
||||||
/* Initialize the joystick capabilities */
|
/* Initialize the joystick capabilities */
|
||||||
joystick->nbuttons = 15;
|
joystick->nbuttons = 15;
|
||||||
joystick->naxes = 16;
|
joystick->naxes = 6;
|
||||||
joystick->epowerlevel = SDL_JOYSTICK_POWER_WIRED;
|
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;
|
return SDL_TRUE;
|
||||||
}
|
}
|
||||||
@@ -762,7 +781,7 @@ static void HIDAPI_DriverPS3ThirdParty_HandleStatePacket18(SDL_Joystick *joystic
|
|||||||
SDL_PrivateJoystickAxis(joystick, SDL_CONTROLLER_AXIS_RIGHTY, axis);
|
SDL_PrivateJoystickAxis(joystick, SDL_CONTROLLER_AXIS_RIGHTY, axis);
|
||||||
|
|
||||||
/* Buttons are mapped as axes in the order they appear in the button enumeration */
|
/* Buttons are mapped as axes in the order they appear in the button enumeration */
|
||||||
{
|
if (ctx->has_analog_buttons) {
|
||||||
static int button_axis_offsets[] = {
|
static int button_axis_offsets[] = {
|
||||||
12, /* SDL_GAMEPAD_BUTTON_A */
|
12, /* SDL_GAMEPAD_BUTTON_A */
|
||||||
11, /* SDL_GAMEPAD_BUTTON_B */
|
11, /* SDL_GAMEPAD_BUTTON_B */
|
||||||
@@ -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);
|
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);
|
SDL_PrivateJoystickAxis(joystick, SDL_CONTROLLER_AXIS_TRIGGERRIGHT, axis);
|
||||||
axis = ((int)data[3] * 257) - 32768;
|
axis = ((int)data[3] * 257) - 32768;
|
||||||
SDL_PrivateJoystickAxis(joystick, SDL_CONTROLLER_AXIS_LEFTX, axis);
|
SDL_PrivateJoystickAxis(joystick, SDL_CONTROLLER_AXIS_LEFTX, axis);
|
||||||
@@ -885,7 +912,7 @@ static void HIDAPI_DriverPS3ThirdParty_HandleStatePacket19(SDL_Joystick *joystic
|
|||||||
SDL_PrivateJoystickAxis(joystick, SDL_CONTROLLER_AXIS_RIGHTY, axis);
|
SDL_PrivateJoystickAxis(joystick, SDL_CONTROLLER_AXIS_RIGHTY, axis);
|
||||||
|
|
||||||
/* Buttons are mapped as axes in the order they appear in the button enumeration */
|
/* Buttons are mapped as axes in the order they appear in the button enumeration */
|
||||||
{
|
if (ctx->has_analog_buttons) {
|
||||||
static int button_axis_offsets[] = {
|
static int button_axis_offsets[] = {
|
||||||
13, /* SDL_CONTROLLER_BUTTON_A */
|
13, /* SDL_CONTROLLER_BUTTON_A */
|
||||||
12, /* SDL_CONTROLLER_BUTTON_B */
|
12, /* SDL_CONTROLLER_BUTTON_B */
|
||||||
|
|||||||
@@ -54,6 +54,7 @@
|
|||||||
#define USB_VENDOR_SONY 0x054c
|
#define USB_VENDOR_SONY 0x054c
|
||||||
#define USB_VENDOR_THRUSTMASTER 0x044f
|
#define USB_VENDOR_THRUSTMASTER 0x044f
|
||||||
#define USB_VENDOR_TURTLE_BEACH 0x10f5
|
#define USB_VENDOR_TURTLE_BEACH 0x10f5
|
||||||
|
#define USB_VENDOR_SWITCH 0x2563
|
||||||
#define USB_VENDOR_VALVE 0x28de
|
#define USB_VENDOR_VALVE 0x28de
|
||||||
#define USB_VENDOR_ZEROPLUS 0x0c12
|
#define USB_VENDOR_ZEROPLUS 0x0c12
|
||||||
|
|
||||||
@@ -116,6 +117,7 @@
|
|||||||
#define USB_PRODUCT_SONY_DS4_STRIKEPAD 0x05c5
|
#define USB_PRODUCT_SONY_DS4_STRIKEPAD 0x05c5
|
||||||
#define USB_PRODUCT_SONY_DS5 0x0ce6
|
#define USB_PRODUCT_SONY_DS5 0x0ce6
|
||||||
#define USB_PRODUCT_SONY_DS5_EDGE 0x0df2
|
#define USB_PRODUCT_SONY_DS5_EDGE 0x0df2
|
||||||
|
#define USB_PRODUCT_SWITCH_RETROBIT_CONTROLLER 0x0575
|
||||||
#define USB_PRODUCT_THRUSTMASTER_ESWAPX_PRO 0xd012
|
#define USB_PRODUCT_THRUSTMASTER_ESWAPX_PRO 0xd012
|
||||||
#define USB_PRODUCT_TURTLE_BEACH_SERIES_X_REACT_R 0x7013
|
#define USB_PRODUCT_TURTLE_BEACH_SERIES_X_REACT_R 0x7013
|
||||||
#define USB_PRODUCT_TURTLE_BEACH_SERIES_X_RECON 0x7009
|
#define USB_PRODUCT_TURTLE_BEACH_SERIES_X_RECON 0x7009
|
||||||
|
|||||||
@@ -1290,6 +1290,7 @@ static int RAWINPUT_JoystickOpen(SDL_Joystick *joystick, int device_index)
|
|||||||
value_caps = SDL_stack_alloc(HIDP_VALUE_CAPS, caps.NumberInputValueCaps);
|
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) {
|
if (SDL_HidP_GetValueCaps(HidP_Input, value_caps, &caps.NumberInputValueCaps, ctx->preparsed_data) != HIDP_STATUS_SUCCESS) {
|
||||||
RAWINPUT_JoystickClose(joystick);
|
RAWINPUT_JoystickClose(joystick);
|
||||||
|
SDL_stack_free(button_caps);
|
||||||
return SDL_SetError("Couldn't get device value capabilities");
|
return SDL_SetError("Couldn't get device value capabilities");
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -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));
|
ctx->button_indices = (USHORT *)SDL_malloc(joystick->nbuttons * sizeof(*ctx->button_indices));
|
||||||
if (!ctx->button_indices) {
|
if (!ctx->button_indices) {
|
||||||
RAWINPUT_JoystickClose(joystick);
|
RAWINPUT_JoystickClose(joystick);
|
||||||
|
SDL_stack_free(value_caps);
|
||||||
|
SDL_stack_free(button_caps);
|
||||||
return SDL_OutOfMemory();
|
return SDL_OutOfMemory();
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1342,6 +1345,8 @@ static int RAWINPUT_JoystickOpen(SDL_Joystick *joystick, int device_index)
|
|||||||
joystick->nbuttons += 1;
|
joystick->nbuttons += 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
SDL_stack_free(button_caps);
|
||||||
|
|
||||||
for (i = 0; i < caps.NumberInputValueCaps; ++i) {
|
for (i = 0; i < caps.NumberInputValueCaps; ++i) {
|
||||||
HIDP_VALUE_CAPS *cap = &value_caps[i];
|
HIDP_VALUE_CAPS *cap = &value_caps[i];
|
||||||
|
|
||||||
@@ -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));
|
ctx->axis_indices = (USHORT *)SDL_malloc(joystick->naxes * sizeof(*ctx->axis_indices));
|
||||||
if (!ctx->axis_indices) {
|
if (!ctx->axis_indices) {
|
||||||
RAWINPUT_JoystickClose(joystick);
|
RAWINPUT_JoystickClose(joystick);
|
||||||
|
SDL_stack_free(value_caps);
|
||||||
return SDL_OutOfMemory();
|
return SDL_OutOfMemory();
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -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));
|
ctx->hat_indices = (USHORT *)SDL_malloc(joystick->nhats * sizeof(*ctx->hat_indices));
|
||||||
if (!ctx->hat_indices) {
|
if (!ctx->hat_indices) {
|
||||||
RAWINPUT_JoystickClose(joystick);
|
RAWINPUT_JoystickClose(joystick);
|
||||||
|
SDL_stack_free(value_caps);
|
||||||
return SDL_OutOfMemory();
|
return SDL_OutOfMemory();
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -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;
|
joystick->epowerlevel = SDL_JOYSTICK_POWER_UNKNOWN;
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
|
|||||||
@@ -9,8 +9,8 @@ LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US
|
|||||||
//
|
//
|
||||||
|
|
||||||
VS_VERSION_INFO VERSIONINFO
|
VS_VERSION_INFO VERSIONINFO
|
||||||
FILEVERSION 2,30,6,0
|
FILEVERSION 2,30,7,0
|
||||||
PRODUCTVERSION 2,30,6,0
|
PRODUCTVERSION 2,30,7,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, 30, 6, 0\0"
|
VALUE "FileVersion", "2, 30, 7, 0\0"
|
||||||
VALUE "InternalName", "SDL\0"
|
VALUE "InternalName", "SDL\0"
|
||||||
VALUE "LegalCopyright", "Copyright (C) 2024 Sam Lantinga\0"
|
VALUE "LegalCopyright", "Copyright (C) 2024 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, 30, 6, 0\0"
|
VALUE "ProductVersion", "2, 30, 7, 0\0"
|
||||||
END
|
END
|
||||||
END
|
END
|
||||||
BLOCK "VarFileInfo"
|
BLOCK "VarFileInfo"
|
||||||
|
|||||||
@@ -161,7 +161,7 @@ static void SDL_ANDROID_SensorUpdate(SDL_Sensor *sensor)
|
|||||||
ASensorEvent event;
|
ASensorEvent event;
|
||||||
struct android_poll_source *source;
|
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);
|
SDL_zero(event);
|
||||||
while (ASensorEventQueue_getEvents(sensor->hwdata->eventqueue, &event, 1) > 0) {
|
while (ASensorEventQueue_getEvents(sensor->hwdata->eventqueue, &event, 1) > 0) {
|
||||||
SDL_PrivateSensorUpdate(sensor, 0, event.data, SDL_arraysize(event.data));
|
SDL_PrivateSensorUpdate(sensor, 0, event.data, SDL_arraysize(event.data));
|
||||||
|
|||||||
+17
-9
@@ -1529,7 +1529,7 @@ typedef enum
|
|||||||
|
|
||||||
typedef struct
|
typedef struct
|
||||||
{
|
{
|
||||||
SDL_bool left_justify; /* for now: ignored. */
|
SDL_bool left_justify;
|
||||||
SDL_bool force_sign;
|
SDL_bool force_sign;
|
||||||
SDL_bool force_type; /* for now: used only by float printer, ignored otherwise. */
|
SDL_bool force_type; /* for now: used only by float printer, ignored otherwise. */
|
||||||
SDL_bool pad_zeroes;
|
SDL_bool pad_zeroes;
|
||||||
@@ -1541,6 +1541,9 @@ typedef struct
|
|||||||
|
|
||||||
static size_t SDL_PrintString(char *text, size_t maxlen, SDL_FormatInfo *info, const char *string)
|
static size_t SDL_PrintString(char *text, size_t maxlen, SDL_FormatInfo *info, const char *string)
|
||||||
{
|
{
|
||||||
|
const char fill = (info && info->pad_zeroes) ? '0' : ' ';
|
||||||
|
size_t width = 0;
|
||||||
|
size_t filllen = 0;
|
||||||
size_t length = 0;
|
size_t length = 0;
|
||||||
size_t slen, sz;
|
size_t slen, sz;
|
||||||
|
|
||||||
@@ -1550,24 +1553,29 @@ static size_t SDL_PrintString(char *text, size_t maxlen, SDL_FormatInfo *info, c
|
|||||||
|
|
||||||
sz = SDL_strlen(string);
|
sz = SDL_strlen(string);
|
||||||
if (info && info->width > 0 && (size_t)info->width > sz) {
|
if (info && info->width > 0 && (size_t)info->width > sz) {
|
||||||
const char fill = info->pad_zeroes ? '0' : ' ';
|
width = info->width - sz;
|
||||||
size_t width = info->width - sz;
|
|
||||||
size_t filllen;
|
|
||||||
|
|
||||||
if (info->precision >= 0 && (size_t)info->precision < sz) {
|
if (info->precision >= 0 && (size_t)info->precision < sz) {
|
||||||
width += sz - (size_t)info->precision;
|
width += sz - (size_t)info->precision;
|
||||||
}
|
}
|
||||||
|
|
||||||
filllen = SDL_min(width, maxlen);
|
filllen = SDL_min(width, maxlen);
|
||||||
SDL_memset(text, fill, filllen);
|
if (!info->left_justify) {
|
||||||
text += filllen;
|
SDL_memset(text, fill, filllen);
|
||||||
maxlen -= filllen;
|
text += filllen;
|
||||||
length += width;
|
maxlen -= filllen;
|
||||||
|
length += width;
|
||||||
|
filllen = 0;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
SDL_strlcpy(text, string, maxlen);
|
SDL_strlcpy(text, string, maxlen);
|
||||||
length += sz;
|
length += sz;
|
||||||
|
|
||||||
|
if (filllen > 0) {
|
||||||
|
SDL_memset(text + sz, fill, filllen);
|
||||||
|
length += width;
|
||||||
|
}
|
||||||
|
|
||||||
if (info) {
|
if (info) {
|
||||||
if (info->precision >= 0 && (size_t)info->precision < sz) {
|
if (info->precision >= 0 && (size_t)info->precision < sz) {
|
||||||
slen = (size_t)info->precision;
|
slen = (size_t)info->precision;
|
||||||
|
|||||||
@@ -3303,6 +3303,9 @@ void SDL_DestroyWindow(SDL_Window *window)
|
|||||||
if (SDL_GetKeyboardFocus() == window) {
|
if (SDL_GetKeyboardFocus() == window) {
|
||||||
SDL_SetKeyboardFocus(NULL);
|
SDL_SetKeyboardFocus(NULL);
|
||||||
}
|
}
|
||||||
|
if ((window->flags & SDL_WINDOW_MOUSE_CAPTURE)) {
|
||||||
|
SDL_UpdateMouseCapture(SDL_TRUE);
|
||||||
|
}
|
||||||
if (SDL_GetMouseFocus() == window) {
|
if (SDL_GetMouseFocus() == window) {
|
||||||
SDL_SetMouseFocus(NULL);
|
SDL_SetMouseFocus(NULL);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -194,7 +194,7 @@ int KMSDRM_GLES_SwapWindow(_THIS, SDL_Window *window)
|
|||||||
we have waited here, there won't be a pending pageflip so the
|
we have waited here, there won't be a pending pageflip so the
|
||||||
WaitPageflip at the beginning of this function will be a no-op.
|
WaitPageflip at the beginning of this function will be a no-op.
|
||||||
Just leave it here and don't worry.
|
Just leave it here and don't worry.
|
||||||
Run your SDL2 program with "SDL_KMSDRM_DOUBLE_BUFFER=1 <program_name>"
|
Run your SDL2 program with "SDL_VIDEO_DOUBLE_BUFFER=1 <program_name>"
|
||||||
to enable this. */
|
to enable this. */
|
||||||
if (windata->double_buffer) {
|
if (windata->double_buffer) {
|
||||||
if (!KMSDRM_WaitPageflip(_this, windata)) {
|
if (!KMSDRM_WaitPageflip(_this, windata)) {
|
||||||
|
|||||||
@@ -97,7 +97,7 @@ static int get_driindex(void)
|
|||||||
|
|
||||||
SDL_strlcpy(device + kmsdrm_dri_pathsize, kmsdrm_dri_devname,
|
SDL_strlcpy(device + kmsdrm_dri_pathsize, kmsdrm_dri_devname,
|
||||||
sizeof(device) - kmsdrm_dri_devnamesize);
|
sizeof(device) - kmsdrm_dri_devnamesize);
|
||||||
while((res = readdir(folder)) != NULL) {
|
while((res = readdir(folder)) != NULL && available < 0) {
|
||||||
if (SDL_memcmp(res->d_name, kmsdrm_dri_devname,
|
if (SDL_memcmp(res->d_name, kmsdrm_dri_devname,
|
||||||
kmsdrm_dri_devnamesize) == 0) {
|
kmsdrm_dri_devnamesize) == 0) {
|
||||||
SDL_strlcpy(device + kmsdrm_dri_pathsize + kmsdrm_dri_devnamesize,
|
SDL_strlcpy(device + kmsdrm_dri_pathsize + kmsdrm_dri_devnamesize,
|
||||||
@@ -123,7 +123,7 @@ static int get_driindex(void)
|
|||||||
resources->count_encoders > 0 &&
|
resources->count_encoders > 0 &&
|
||||||
resources->count_crtcs > 0) {
|
resources->count_crtcs > 0) {
|
||||||
available = -ENOENT;
|
available = -ENOENT;
|
||||||
for (i = 0; i < resources->count_connectors; i++) {
|
for (i = 0; i < resources->count_connectors && available < 0; i++) {
|
||||||
drmModeConnector *conn =
|
drmModeConnector *conn =
|
||||||
KMSDRM_drmModeGetConnector(
|
KMSDRM_drmModeGetConnector(
|
||||||
drm_fd, resources->connectors[i]);
|
drm_fd, resources->connectors[i]);
|
||||||
@@ -134,20 +134,21 @@ static int get_driindex(void)
|
|||||||
|
|
||||||
if (conn->connection == DRM_MODE_CONNECTED &&
|
if (conn->connection == DRM_MODE_CONNECTED &&
|
||||||
conn->count_modes) {
|
conn->count_modes) {
|
||||||
|
SDL_bool access_denied = SDL_FALSE;
|
||||||
if (SDL_GetHintBoolean(
|
if (SDL_GetHintBoolean(
|
||||||
SDL_HINT_KMSDRM_REQUIRE_DRM_MASTER,
|
SDL_HINT_KMSDRM_REQUIRE_DRM_MASTER,
|
||||||
SDL_TRUE)) {
|
SDL_TRUE)) {
|
||||||
/* Skip this device if we can't obtain
|
/* Skip this device if we can't obtain
|
||||||
* DRM master */
|
* DRM master */
|
||||||
KMSDRM_drmSetMaster(drm_fd);
|
KMSDRM_drmSetMaster(drm_fd);
|
||||||
if (KMSDRM_drmAuthMagic(drm_fd, 0) ==
|
if (KMSDRM_drmAuthMagic(drm_fd, 0) == -EACCES) {
|
||||||
-EACCES) {
|
access_denied = SDL_TRUE;
|
||||||
continue;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
available = devindex;
|
if (!access_denied) {
|
||||||
break;
|
available = devindex;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
KMSDRM_drmModeFreeConnector(conn);
|
KMSDRM_drmModeFreeConnector(conn);
|
||||||
@@ -158,11 +159,10 @@ static int get_driindex(void)
|
|||||||
SDL_KMSDRM_UnloadSymbols();
|
SDL_KMSDRM_UnloadSymbols();
|
||||||
}
|
}
|
||||||
close(drm_fd);
|
close(drm_fd);
|
||||||
|
} else {
|
||||||
|
SDL_LogDebug(SDL_LOG_CATEGORY_VIDEO,
|
||||||
|
"Failed to open KMSDRM device %s, errno: %d\n", device, errno);
|
||||||
}
|
}
|
||||||
|
|
||||||
SDL_LogDebug(SDL_LOG_CATEGORY_VIDEO,
|
|
||||||
"Failed to open KMSDRM device %s, errno: %d\n", device,
|
|
||||||
errno);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -380,15 +380,9 @@ KMSDRM_FBInfo *KMSDRM_FBFromBO(_THIS, struct gbm_bo *bo)
|
|||||||
ret = KMSDRM_drmModeAddFB2WithModifiers(viddata->drm_fd, w, h, format, handles, strides, offsets, modifiers, &fb_info->fb_id, flags);
|
ret = KMSDRM_drmModeAddFB2WithModifiers(viddata->drm_fd, w, h, format, handles, strides, offsets, modifiers, &fb_info->fb_id, flags);
|
||||||
|
|
||||||
if (ret) {
|
if (ret) {
|
||||||
handles[0] = KMSDRM_gbm_bo_get_handle(bo).u32;
|
|
||||||
strides[0] = KMSDRM_gbm_bo_get_stride(bo);
|
strides[0] = KMSDRM_gbm_bo_get_stride(bo);
|
||||||
offsets[0] = 0;
|
handles[0] = KMSDRM_gbm_bo_get_handle(bo).u32;
|
||||||
for (int i = 1; i<4; i++) {
|
ret = KMSDRM_drmModeAddFB(viddata->drm_fd, w, h, 24, 32, strides[0], handles[0], &fb_info->fb_id);
|
||||||
handles[i] = 0;
|
|
||||||
strides[i] = 0;
|
|
||||||
offsets[i] = 0;
|
|
||||||
}
|
|
||||||
ret = KMSDRM_drmModeAddFB2(viddata->drm_fd, w, h, format, handles, strides, offsets, &fb_info->fb_id, 0);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (ret) {
|
if (ret) {
|
||||||
@@ -1478,6 +1472,12 @@ int KMSDRM_CreateWindow(_THIS, SDL_Window *window)
|
|||||||
windata->viddata = viddata;
|
windata->viddata = viddata;
|
||||||
window->driverdata = windata;
|
window->driverdata = windata;
|
||||||
|
|
||||||
|
/* Do we want a double buffering scheme to get low video lag? */
|
||||||
|
windata->double_buffer = SDL_FALSE;
|
||||||
|
if (SDL_GetHintBoolean(SDL_HINT_VIDEO_DOUBLE_BUFFER, SDL_FALSE)) {
|
||||||
|
windata->double_buffer = SDL_TRUE;
|
||||||
|
}
|
||||||
|
|
||||||
if (!is_vulkan && !vulkan_mode) { /* NON-Vulkan block. */
|
if (!is_vulkan && !vulkan_mode) { /* NON-Vulkan block. */
|
||||||
|
|
||||||
/* Maybe you didn't ask for an OPENGL window, but that's what you will get.
|
/* Maybe you didn't ask for an OPENGL window, but that's what you will get.
|
||||||
@@ -1583,7 +1583,12 @@ int KMSDRM_CreateWindow(_THIS, SDL_Window *window)
|
|||||||
SDL_SetKeyboardFocus(window);
|
SDL_SetKeyboardFocus(window);
|
||||||
|
|
||||||
/* Tell the app that the window has moved to top-left. */
|
/* Tell the app that the window has moved to top-left. */
|
||||||
SDL_SendWindowEvent(window, SDL_WINDOWEVENT_MOVED, 0, 0);
|
{
|
||||||
|
SDL_Rect display_bounds;
|
||||||
|
SDL_zero(display_bounds);
|
||||||
|
SDL_GetDisplayBounds(SDL_GetWindowDisplayIndex(window), &display_bounds);
|
||||||
|
SDL_SendWindowEvent(window, SDL_WINDOWEVENT_MOVED, display_bounds.x, display_bounds.y);
|
||||||
|
}
|
||||||
|
|
||||||
/* Allocated windata will be freed in KMSDRM_DestroyWindow,
|
/* Allocated windata will be freed in KMSDRM_DestroyWindow,
|
||||||
and KMSDRM_DestroyWindow() will be called by SDL_CreateWindow()
|
and KMSDRM_DestroyWindow() will be called by SDL_CreateWindow()
|
||||||
|
|||||||
@@ -70,8 +70,8 @@ void VITA_InitTouch(void)
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Support passing both front and back touch devices in events
|
// Support passing both front and back touch devices in events
|
||||||
SDL_AddTouch((SDL_TouchID)0, SDL_TOUCH_DEVICE_DIRECT, "Front");
|
SDL_AddTouch((SDL_TouchID)1, SDL_TOUCH_DEVICE_DIRECT, "Front");
|
||||||
SDL_AddTouch((SDL_TouchID)1, SDL_TOUCH_DEVICE_INDIRECT_ABSOLUTE, "Back");
|
SDL_AddTouch((SDL_TouchID)2, SDL_TOUCH_DEVICE_INDIRECT_ABSOLUTE, "Back");
|
||||||
}
|
}
|
||||||
|
|
||||||
void VITA_QuitTouch(void)
|
void VITA_QuitTouch(void)
|
||||||
|
|||||||
@@ -595,6 +595,7 @@ static void Wayland_WarpMouse(SDL_Window *window, int x, int y)
|
|||||||
Wayland_input_lock_pointer(input);
|
Wayland_input_lock_pointer(input);
|
||||||
input->relative_mode_override = SDL_TRUE;
|
input->relative_mode_override = SDL_TRUE;
|
||||||
}
|
}
|
||||||
|
SDL_SendMouseMotion(window, 0, 0, x, y);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -30,6 +30,7 @@
|
|||||||
|
|
||||||
/* FIXME: Find a better place to put this... */
|
/* FIXME: Find a better place to put this... */
|
||||||
static Cursor x11_empty_cursor = None;
|
static Cursor x11_empty_cursor = None;
|
||||||
|
static SDL_bool x11_cursor_visible = SDL_TRUE;
|
||||||
|
|
||||||
static Display *GetDisplay(void)
|
static Display *GetDisplay(void)
|
||||||
{
|
{
|
||||||
@@ -298,6 +299,8 @@ static int X11_ShowCursor(SDL_Cursor *cursor)
|
|||||||
Display *display = GetDisplay();
|
Display *display = GetDisplay();
|
||||||
SDL_Window *window;
|
SDL_Window *window;
|
||||||
|
|
||||||
|
x11_cursor_visible = !!cursor;
|
||||||
|
|
||||||
for (window = video->windows; window; window = window->next) {
|
for (window = video->windows; window; window = window->next) {
|
||||||
SDL_WindowData *data = (SDL_WindowData *)window->driverdata;
|
SDL_WindowData *data = (SDL_WindowData *)window->driverdata;
|
||||||
if (data) {
|
if (data) {
|
||||||
@@ -317,12 +320,13 @@ static void WarpMouseInternal(Window xwindow, const int x, const int y)
|
|||||||
{
|
{
|
||||||
SDL_VideoData *videodata = (SDL_VideoData *)SDL_GetVideoDevice()->driverdata;
|
SDL_VideoData *videodata = (SDL_VideoData *)SDL_GetVideoDevice()->driverdata;
|
||||||
Display *display = videodata->display;
|
Display *display = videodata->display;
|
||||||
SDL_Mouse *mouse = SDL_GetMouse();
|
#ifdef SDL_VIDEO_DRIVER_X11_XINPUT2
|
||||||
int deviceid = 0;
|
int deviceid = 0;
|
||||||
|
#endif
|
||||||
SDL_bool warp_hack = SDL_FALSE;
|
SDL_bool warp_hack = SDL_FALSE;
|
||||||
|
|
||||||
/* XWayland will only warp the cursor if it is hidden, so this workaround is required. */
|
/* XWayland will only warp the cursor if it is hidden, so this workaround is required. */
|
||||||
if (videodata->is_xwayland && mouse && mouse->cursor_shown) {
|
if (videodata->is_xwayland && x11_cursor_visible) {
|
||||||
warp_hack = SDL_TRUE;
|
warp_hack = SDL_TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -490,5 +494,3 @@ void X11_QuitMouse(_THIS)
|
|||||||
}
|
}
|
||||||
|
|
||||||
#endif /* SDL_VIDEO_DRIVER_X11 */
|
#endif /* SDL_VIDEO_DRIVER_X11 */
|
||||||
|
|
||||||
/* vi: set ts=4 sw=4 expandtab: */
|
|
||||||
@@ -62,6 +62,18 @@ int stdlib_snprintf(void *arg)
|
|||||||
SDLTest_AssertCheck(SDL_strcmp(text, expected) == 0, "Check text, expected: %s, got: %s", expected, text);
|
SDLTest_AssertCheck(SDL_strcmp(text, expected) == 0, "Check text, expected: %s, got: %s", expected, text);
|
||||||
SDLTest_AssertCheck(result == SDL_strlen(text), "Check result value, expected: %d, got: %d", (int)SDL_strlen(text), result);
|
SDLTest_AssertCheck(result == SDL_strlen(text), "Check result value, expected: %d, got: %d", (int)SDL_strlen(text), result);
|
||||||
|
|
||||||
|
result = SDL_snprintf(text, sizeof(text), "%10sA", "foo");
|
||||||
|
expected = " fooA";
|
||||||
|
SDLTest_AssertPass("Call to SDL_snprintf(\"%%10sA\", \"foo\")");
|
||||||
|
SDLTest_AssertCheck(SDL_strcmp(text, expected) == 0, "Check text, expected: %s, got: %s", expected, text);
|
||||||
|
SDLTest_AssertCheck(result == SDL_strlen(text), "Check result value, expected: %d, got: %d", (int)SDL_strlen(text), result);
|
||||||
|
|
||||||
|
result = SDL_snprintf(text, sizeof(text), "%-10sA", "foo");
|
||||||
|
expected = "foo A";
|
||||||
|
SDLTest_AssertPass("Call to SDL_snprintf(\"%%-10sA\", \"foo\")");
|
||||||
|
SDLTest_AssertCheck(SDL_strcmp(text, expected) == 0, "Check text, expected: %s, got: %s", expected, text);
|
||||||
|
SDLTest_AssertCheck(result == SDL_strlen(text), "Check result value, expected: %d, got: %d", (int)SDL_strlen(text), result);
|
||||||
|
|
||||||
result = SDL_snprintf(text, sizeof(text), "%S", L"foo");
|
result = SDL_snprintf(text, sizeof(text), "%S", L"foo");
|
||||||
expected = "foo";
|
expected = "foo";
|
||||||
SDLTest_AssertPass("Call to SDL_snprintf(\"%%S\", \"foo\")");
|
SDLTest_AssertPass("Call to SDL_snprintf(\"%%S\", \"foo\")");
|
||||||
|
|||||||
Reference in new issue
Block a user