Compare commits
20
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
8a5ba43d00 | ||
|
|
c25a49c406 | ||
|
|
d46fdfa3ee | ||
|
|
787d339282 | ||
|
|
874f6feab4 | ||
|
|
1df4dce78f | ||
|
|
cc58a09c09 | ||
|
|
ae72cd57b5 | ||
|
|
8f858d7908 | ||
|
|
5bfdb6e02f | ||
|
|
739d3ec189 | ||
|
|
2319b2635b | ||
|
|
bda161d22b | ||
|
|
dbfd47e77d | ||
|
|
dbb6cd02aa | ||
|
|
841263c9d6 | ||
|
|
2ccb311cb7 | ||
|
|
e0a345702d | ||
|
|
9fba36511f | ||
|
|
45fb778fe5 |
No files matched your search
@@ -1,4 +1,4 @@
|
|||||||
cmake_minimum_required(VERSION 3.0)
|
cmake_minimum_required(VERSION 3.0...3.5)
|
||||||
project(ci_utils C CXX)
|
project(ci_utils C CXX)
|
||||||
|
|
||||||
set(txt "CC=${CMAKE_C_COMPILER}
|
set(txt "CC=${CMAKE_C_COMPILER}
|
||||||
|
|||||||
@@ -34,7 +34,7 @@ jobs:
|
|||||||
os.makedirs(builddir)
|
os.makedirs(builddir)
|
||||||
with open(f"{ builddir }/CMakeLists.txt", "w") as f:
|
with open(f"{ builddir }/CMakeLists.txt", "w") as f:
|
||||||
f.write(textwrap.dedent(f"""\
|
f.write(textwrap.dedent(f"""\
|
||||||
cmake_minimum_required(VERSION 3.0)
|
cmake_minimum_required(VERSION 3.0...3.5)
|
||||||
project(sdl_user)
|
project(sdl_user)
|
||||||
add_subdirectory("{ srcdir }" SDL)
|
add_subdirectory("{ srcdir }" SDL)
|
||||||
"""))
|
"""))
|
||||||
|
|||||||
+2
-2
@@ -84,7 +84,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 28)
|
set(SDL_MINOR_VERSION 28)
|
||||||
set(SDL_MICRO_VERSION 2)
|
set(SDL_MICRO_VERSION 3)
|
||||||
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
|
||||||
@@ -3182,7 +3182,7 @@ if (SDL_ASAN)
|
|||||||
endif()
|
endif()
|
||||||
|
|
||||||
if(SDL_CCACHE AND NOT CMAKE_VERSION VERSION_LESS 3.4)
|
if(SDL_CCACHE AND NOT CMAKE_VERSION VERSION_LESS 3.4)
|
||||||
cmake_minimum_required(VERSION 3.4)
|
cmake_minimum_required(VERSION 3.4...3.5)
|
||||||
find_program(CCACHE_BINARY ccache)
|
find_program(CCACHE_BINARY ccache)
|
||||||
if(CCACHE_BINARY)
|
if(CCACHE_BINARY)
|
||||||
set(CMAKE_C_COMPILER_LAUNCHER ${CCACHE_BINARY})
|
set(CMAKE_C_COMPILER_LAUNCHER ${CCACHE_BINARY})
|
||||||
|
|||||||
+1
-1
@@ -15,7 +15,7 @@
|
|||||||
LIBNAME = SDL2
|
LIBNAME = SDL2
|
||||||
MAJOR_VERSION = 2
|
MAJOR_VERSION = 2
|
||||||
MINOR_VERSION = 28
|
MINOR_VERSION = 28
|
||||||
MICRO_VERSION = 2
|
MICRO_VERSION = 3
|
||||||
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 = 28
|
MINOR_VERSION = 28
|
||||||
MICRO_VERSION = 2
|
MICRO_VERSION = 3
|
||||||
VERSION = $(MAJOR_VERSION).$(MINOR_VERSION).$(MICRO_VERSION)
|
VERSION = $(MAJOR_VERSION).$(MINOR_VERSION).$(MICRO_VERSION)
|
||||||
|
|
||||||
LIBHOME = .
|
LIBHOME = .
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
# SDL2 CMake configuration file:
|
# SDL2 CMake configuration file:
|
||||||
# This file is meant to be placed in a cmake subfolder of SDL2-devel-2.x.y-VC
|
# This file is meant to be placed in a cmake subfolder of SDL2-devel-2.x.y-VC
|
||||||
|
|
||||||
cmake_minimum_required(VERSION 3.0)
|
cmake_minimum_required(VERSION 3.0...3.5)
|
||||||
|
|
||||||
include(FeatureSummary)
|
include(FeatureSummary)
|
||||||
set_package_properties(SDL2 PROPERTIES
|
set_package_properties(SDL2 PROPERTIES
|
||||||
|
|||||||
@@ -19,10 +19,10 @@
|
|||||||
<key>CFBundlePackageType</key>
|
<key>CFBundlePackageType</key>
|
||||||
<string>FMWK</string>
|
<string>FMWK</string>
|
||||||
<key>CFBundleShortVersionString</key>
|
<key>CFBundleShortVersionString</key>
|
||||||
<string>2.28.2</string>
|
<string>2.28.3</string>
|
||||||
<key>CFBundleSignature</key>
|
<key>CFBundleSignature</key>
|
||||||
<string>SDLX</string>
|
<string>SDLX</string>
|
||||||
<key>CFBundleVersion</key>
|
<key>CFBundleVersion</key>
|
||||||
<string>2.28.2</string>
|
<string>2.28.3</string>
|
||||||
</dict>
|
</dict>
|
||||||
</plist>
|
</plist>
|
||||||
@@ -9529,7 +9529,7 @@
|
|||||||
DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
|
DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
|
||||||
DEPLOYMENT_POSTPROCESSING = YES;
|
DEPLOYMENT_POSTPROCESSING = YES;
|
||||||
DYLIB_COMPATIBILITY_VERSION = 2801.0.0;
|
DYLIB_COMPATIBILITY_VERSION = 2801.0.0;
|
||||||
DYLIB_CURRENT_VERSION = 2801.2.0;
|
DYLIB_CURRENT_VERSION = 2801.3.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;
|
||||||
@@ -9570,7 +9570,7 @@
|
|||||||
isa = XCBuildConfiguration;
|
isa = XCBuildConfiguration;
|
||||||
buildSettings = {
|
buildSettings = {
|
||||||
CLANG_LINK_OBJC_RUNTIME = NO;
|
CLANG_LINK_OBJC_RUNTIME = NO;
|
||||||
MARKETING_VERSION = 2.28.2;
|
MARKETING_VERSION = 2.28.3;
|
||||||
OTHER_LDFLAGS = "-liconv";
|
OTHER_LDFLAGS = "-liconv";
|
||||||
};
|
};
|
||||||
name = Release;
|
name = Release;
|
||||||
@@ -9614,7 +9614,7 @@
|
|||||||
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
|
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
|
||||||
DEBUG_INFORMATION_FORMAT = dwarf;
|
DEBUG_INFORMATION_FORMAT = dwarf;
|
||||||
DYLIB_COMPATIBILITY_VERSION = 2801.0.0;
|
DYLIB_COMPATIBILITY_VERSION = 2801.0.0;
|
||||||
DYLIB_CURRENT_VERSION = 2801.2.0;
|
DYLIB_CURRENT_VERSION = 2801.3.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;
|
||||||
@@ -9656,7 +9656,7 @@
|
|||||||
isa = XCBuildConfiguration;
|
isa = XCBuildConfiguration;
|
||||||
buildSettings = {
|
buildSettings = {
|
||||||
CLANG_LINK_OBJC_RUNTIME = NO;
|
CLANG_LINK_OBJC_RUNTIME = NO;
|
||||||
MARKETING_VERSION = 2.28.2;
|
MARKETING_VERSION = 2.28.3;
|
||||||
OTHER_LDFLAGS = "-liconv";
|
OTHER_LDFLAGS = "-liconv";
|
||||||
};
|
};
|
||||||
name = Debug;
|
name = Debug;
|
||||||
@@ -9863,7 +9863,7 @@
|
|||||||
DEFINES_MODULE = YES;
|
DEFINES_MODULE = YES;
|
||||||
DEVELOPMENT_TEAM = "";
|
DEVELOPMENT_TEAM = "";
|
||||||
DYLIB_COMPATIBILITY_VERSION = 2801.0.0;
|
DYLIB_COMPATIBILITY_VERSION = 2801.0.0;
|
||||||
DYLIB_CURRENT_VERSION = 2801.2.0;
|
DYLIB_CURRENT_VERSION = 2801.3.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;
|
||||||
@@ -9915,7 +9915,7 @@
|
|||||||
DEFINES_MODULE = YES;
|
DEFINES_MODULE = YES;
|
||||||
DEVELOPMENT_TEAM = "";
|
DEVELOPMENT_TEAM = "";
|
||||||
DYLIB_COMPATIBILITY_VERSION = 2801.0.0;
|
DYLIB_COMPATIBILITY_VERSION = 2801.0.0;
|
||||||
DYLIB_CURRENT_VERSION = 2801.2.0;
|
DYLIB_CURRENT_VERSION = 2801.3.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.28.2
|
Title SDL 2.28.3
|
||||||
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
|
||||||
|
|||||||
@@ -8,22 +8,22 @@ else {
|
|||||||
}
|
}
|
||||||
|
|
||||||
android {
|
android {
|
||||||
compileSdkVersion 31
|
|
||||||
defaultConfig {
|
|
||||||
if (buildAsApplication) {
|
if (buildAsApplication) {
|
||||||
applicationId "org.libsdl.app"
|
namespace "org.libsdl.app"
|
||||||
}
|
}
|
||||||
minSdkVersion 16
|
compileSdkVersion 34
|
||||||
targetSdkVersion 31
|
defaultConfig {
|
||||||
|
minSdkVersion 19
|
||||||
|
targetSdkVersion 34
|
||||||
versionCode 1
|
versionCode 1
|
||||||
versionName "1.0"
|
versionName "1.0"
|
||||||
externalNativeBuild {
|
externalNativeBuild {
|
||||||
ndkBuild {
|
ndkBuild {
|
||||||
arguments "APP_PLATFORM=android-16"
|
arguments "APP_PLATFORM=android-19"
|
||||||
abiFilters 'armeabi-v7a', 'arm64-v8a', 'x86', 'x86_64'
|
abiFilters 'armeabi-v7a', 'arm64-v8a', 'x86', 'x86_64'
|
||||||
}
|
}
|
||||||
// cmake {
|
// cmake {
|
||||||
// arguments "-DANDROID_APP_PLATFORM=android-16", "-DANDROID_STL=c++_static"
|
// arguments "-DANDROID_APP_PLATFORM=android-19", "-DANDROID_STL=c++_static"
|
||||||
// // abiFilters 'armeabi-v7a', 'arm64-v8a', 'x86', 'x86_64'
|
// // abiFilters 'armeabi-v7a', 'arm64-v8a', 'x86', 'x86_64'
|
||||||
// abiFilters 'arm64-v8a'
|
// abiFilters 'arm64-v8a'
|
||||||
// }
|
// }
|
||||||
@@ -53,7 +53,7 @@ android {
|
|||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
lintOptions {
|
lint {
|
||||||
abortOnError false
|
abortOnError false
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -3,7 +3,6 @@
|
|||||||
com.gamemaker.game
|
com.gamemaker.game
|
||||||
-->
|
-->
|
||||||
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
|
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
package="org.libsdl.app"
|
|
||||||
android:versionCode="1"
|
android:versionCode="1"
|
||||||
android:versionName="1.0"
|
android:versionName="1.0"
|
||||||
android:installLocation="auto">
|
android:installLocation="auto">
|
||||||
|
|||||||
@@ -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 = 28;
|
private static final int SDL_MINOR_VERSION = 28;
|
||||||
private static final int SDL_MICRO_VERSION = 2;
|
private static final int SDL_MICRO_VERSION = 3;
|
||||||
/*
|
/*
|
||||||
// Display InputType.SOURCE/CLASS of events and devices
|
// Display InputType.SOURCE/CLASS of events and devices
|
||||||
//
|
//
|
||||||
@@ -1345,7 +1345,20 @@ public class SDLActivity extends Activity implements View.OnSystemUiVisibilityCh
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if ((source & InputDevice.SOURCE_KEYBOARD) == InputDevice.SOURCE_KEYBOARD) {
|
if ((source & InputDevice.SOURCE_MOUSE) == InputDevice.SOURCE_MOUSE) {
|
||||||
|
// on some devices key events are sent for mouse BUTTON_BACK/FORWARD presses
|
||||||
|
// they are ignored here because sending them as mouse input to SDL is messy
|
||||||
|
if ((keyCode == KeyEvent.KEYCODE_BACK) || (keyCode == KeyEvent.KEYCODE_FORWARD)) {
|
||||||
|
switch (event.getAction()) {
|
||||||
|
case KeyEvent.ACTION_DOWN:
|
||||||
|
case KeyEvent.ACTION_UP:
|
||||||
|
// mark the event as handled or it will be handled by system
|
||||||
|
// handling KEYCODE_BACK by system will call onBackPressed()
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if (event.getAction() == KeyEvent.ACTION_DOWN) {
|
if (event.getAction() == KeyEvent.ACTION_DOWN) {
|
||||||
if (isTextInputEvent(event)) {
|
if (isTextInputEvent(event)) {
|
||||||
if (ic != null) {
|
if (ic != null) {
|
||||||
@@ -1360,21 +1373,6 @@ public class SDLActivity extends Activity implements View.OnSystemUiVisibilityCh
|
|||||||
onNativeKeyUp(keyCode);
|
onNativeKeyUp(keyCode);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
if ((source & InputDevice.SOURCE_MOUSE) == InputDevice.SOURCE_MOUSE) {
|
|
||||||
// on some devices key events are sent for mouse BUTTON_BACK/FORWARD presses
|
|
||||||
// they are ignored here because sending them as mouse input to SDL is messy
|
|
||||||
if ((keyCode == KeyEvent.KEYCODE_BACK) || (keyCode == KeyEvent.KEYCODE_FORWARD)) {
|
|
||||||
switch (event.getAction()) {
|
|
||||||
case KeyEvent.ACTION_DOWN:
|
|
||||||
case KeyEvent.ACTION_UP:
|
|
||||||
// mark the event as handled or it will be handled by system
|
|
||||||
// handling KEYCODE_BACK by system will call onBackPressed()
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -6,7 +6,7 @@ buildscript {
|
|||||||
google()
|
google()
|
||||||
}
|
}
|
||||||
dependencies {
|
dependencies {
|
||||||
classpath 'com.android.tools.build:gradle:7.0.3'
|
classpath 'com.android.tools.build:gradle:8.1.1'
|
||||||
|
|
||||||
// NOTE: Do not place your application dependencies here; they belong
|
// NOTE: Do not place your application dependencies here; they belong
|
||||||
// in the individual module build.gradle files
|
// in the individual module build.gradle files
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
#Thu Nov 11 18:20:34 PST 2021
|
#Thu Nov 11 18:20:34 PST 2021
|
||||||
distributionBase=GRADLE_USER_HOME
|
distributionBase=GRADLE_USER_HOME
|
||||||
distributionUrl=https\://services.gradle.org/distributions/gradle-7.3-bin.zip
|
distributionUrl=https\://services.gradle.org/distributions/gradle-8.1.1-bin.zip
|
||||||
distributionPath=wrapper/dists
|
distributionPath=wrapper/dists
|
||||||
zipStorePath=wrapper/dists
|
zipStorePath=wrapper/dists
|
||||||
zipStoreBase=GRADLE_USER_HOME
|
zipStoreBase=GRADLE_USER_HOME
|
||||||
Vendored
+47
-12
@@ -1,10 +1,10 @@
|
|||||||
#! /bin/sh
|
#! /bin/sh
|
||||||
# Attempt to guess a canonical system name.
|
# Attempt to guess a canonical system name.
|
||||||
# Copyright 1992-2022 Free Software Foundation, Inc.
|
# Copyright 1992-2023 Free Software Foundation, Inc.
|
||||||
|
|
||||||
# shellcheck disable=SC2006,SC2268 # see below for rationale
|
# shellcheck disable=SC2006,SC2268 # see below for rationale
|
||||||
|
|
||||||
timestamp='2022-05-25'
|
timestamp='2023-07-20'
|
||||||
|
|
||||||
# This file is free software; you can redistribute it and/or modify it
|
# This file is free software; you can redistribute it and/or modify it
|
||||||
# under the terms of the GNU General Public License as published by
|
# under the terms of the GNU General Public License as published by
|
||||||
@@ -47,7 +47,7 @@ me=`echo "$0" | sed -e 's,.*/,,'`
|
|||||||
usage="\
|
usage="\
|
||||||
Usage: $0 [OPTION]
|
Usage: $0 [OPTION]
|
||||||
|
|
||||||
Output the configuration name of the system \`$me' is run on.
|
Output the configuration name of the system '$me' is run on.
|
||||||
|
|
||||||
Options:
|
Options:
|
||||||
-h, --help print this help, then exit
|
-h, --help print this help, then exit
|
||||||
@@ -60,13 +60,13 @@ version="\
|
|||||||
GNU config.guess ($timestamp)
|
GNU config.guess ($timestamp)
|
||||||
|
|
||||||
Originally written by Per Bothner.
|
Originally written by Per Bothner.
|
||||||
Copyright 1992-2022 Free Software Foundation, Inc.
|
Copyright 1992-2023 Free Software Foundation, Inc.
|
||||||
|
|
||||||
This is free software; see the source for copying conditions. There is NO
|
This is free software; see the source for copying conditions. There is NO
|
||||||
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE."
|
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE."
|
||||||
|
|
||||||
help="
|
help="
|
||||||
Try \`$me --help' for more information."
|
Try '$me --help' for more information."
|
||||||
|
|
||||||
# Parse command line
|
# Parse command line
|
||||||
while test $# -gt 0 ; do
|
while test $# -gt 0 ; do
|
||||||
@@ -102,8 +102,8 @@ GUESS=
|
|||||||
# temporary files to be created and, as you can see below, it is a
|
# temporary files to be created and, as you can see below, it is a
|
||||||
# headache to deal with in a portable fashion.
|
# headache to deal with in a portable fashion.
|
||||||
|
|
||||||
# Historically, `CC_FOR_BUILD' used to be named `HOST_CC'. We still
|
# Historically, 'CC_FOR_BUILD' used to be named 'HOST_CC'. We still
|
||||||
# use `HOST_CC' if defined, but it is deprecated.
|
# use 'HOST_CC' if defined, but it is deprecated.
|
||||||
|
|
||||||
# Portable tmp directory creation inspired by the Autoconf team.
|
# Portable tmp directory creation inspired by the Autoconf team.
|
||||||
|
|
||||||
@@ -459,7 +459,7 @@ case $UNAME_MACHINE:$UNAME_SYSTEM:$UNAME_RELEASE:$UNAME_VERSION in
|
|||||||
UNAME_RELEASE=`uname -v`
|
UNAME_RELEASE=`uname -v`
|
||||||
;;
|
;;
|
||||||
esac
|
esac
|
||||||
# Japanese Language versions have a version number like `4.1.3-JL'.
|
# Japanese Language versions have a version number like '4.1.3-JL'.
|
||||||
SUN_REL=`echo "$UNAME_RELEASE" | sed -e 's/-/_/'`
|
SUN_REL=`echo "$UNAME_RELEASE" | sed -e 's/-/_/'`
|
||||||
GUESS=sparc-sun-sunos$SUN_REL
|
GUESS=sparc-sun-sunos$SUN_REL
|
||||||
;;
|
;;
|
||||||
@@ -966,11 +966,37 @@ EOF
|
|||||||
GNU_REL=`echo "$UNAME_RELEASE" | sed -e 's/[-(].*//'`
|
GNU_REL=`echo "$UNAME_RELEASE" | sed -e 's/[-(].*//'`
|
||||||
GUESS=$UNAME_MACHINE-unknown-$GNU_SYS$GNU_REL-$LIBC
|
GUESS=$UNAME_MACHINE-unknown-$GNU_SYS$GNU_REL-$LIBC
|
||||||
;;
|
;;
|
||||||
|
x86_64:[Mm]anagarm:*:*|i?86:[Mm]anagarm:*:*)
|
||||||
|
GUESS="$UNAME_MACHINE-pc-managarm-mlibc"
|
||||||
|
;;
|
||||||
|
*:[Mm]anagarm:*:*)
|
||||||
|
GUESS="$UNAME_MACHINE-unknown-managarm-mlibc"
|
||||||
|
;;
|
||||||
*:Minix:*:*)
|
*:Minix:*:*)
|
||||||
GUESS=$UNAME_MACHINE-unknown-minix
|
GUESS=$UNAME_MACHINE-unknown-minix
|
||||||
;;
|
;;
|
||||||
aarch64:Linux:*:*)
|
aarch64:Linux:*:*)
|
||||||
GUESS=$UNAME_MACHINE-unknown-linux-$LIBC
|
set_cc_for_build
|
||||||
|
CPU=$UNAME_MACHINE
|
||||||
|
LIBCABI=$LIBC
|
||||||
|
if test "$CC_FOR_BUILD" != no_compiler_found; then
|
||||||
|
ABI=64
|
||||||
|
sed 's/^ //' << EOF > "$dummy.c"
|
||||||
|
#ifdef __ARM_EABI__
|
||||||
|
#ifdef __ARM_PCS_VFP
|
||||||
|
ABI=eabihf
|
||||||
|
#else
|
||||||
|
ABI=eabi
|
||||||
|
#endif
|
||||||
|
#endif
|
||||||
|
EOF
|
||||||
|
cc_set_abi=`$CC_FOR_BUILD -E "$dummy.c" 2>/dev/null | grep '^ABI' | sed 's, ,,g'`
|
||||||
|
eval "$cc_set_abi"
|
||||||
|
case $ABI in
|
||||||
|
eabi | eabihf) CPU=armv8l; LIBCABI=$LIBC$ABI ;;
|
||||||
|
esac
|
||||||
|
fi
|
||||||
|
GUESS=$CPU-unknown-linux-$LIBCABI
|
||||||
;;
|
;;
|
||||||
aarch64_be:Linux:*:*)
|
aarch64_be:Linux:*:*)
|
||||||
UNAME_MACHINE=aarch64_be
|
UNAME_MACHINE=aarch64_be
|
||||||
@@ -1036,7 +1062,16 @@ EOF
|
|||||||
k1om:Linux:*:*)
|
k1om:Linux:*:*)
|
||||||
GUESS=$UNAME_MACHINE-unknown-linux-$LIBC
|
GUESS=$UNAME_MACHINE-unknown-linux-$LIBC
|
||||||
;;
|
;;
|
||||||
loongarch32:Linux:*:* | loongarch64:Linux:*:* | loongarchx32:Linux:*:*)
|
kvx:Linux:*:*)
|
||||||
|
GUESS=$UNAME_MACHINE-unknown-linux-$LIBC
|
||||||
|
;;
|
||||||
|
kvx:cos:*:*)
|
||||||
|
GUESS=$UNAME_MACHINE-unknown-cos
|
||||||
|
;;
|
||||||
|
kvx:mbr:*:*)
|
||||||
|
GUESS=$UNAME_MACHINE-unknown-mbr
|
||||||
|
;;
|
||||||
|
loongarch32:Linux:*:* | loongarch64:Linux:*:*)
|
||||||
GUESS=$UNAME_MACHINE-unknown-linux-$LIBC
|
GUESS=$UNAME_MACHINE-unknown-linux-$LIBC
|
||||||
;;
|
;;
|
||||||
m32r*:Linux:*:*)
|
m32r*:Linux:*:*)
|
||||||
@@ -1191,7 +1226,7 @@ EOF
|
|||||||
GUESS=$UNAME_MACHINE-pc-sysv4.2uw$UNAME_VERSION
|
GUESS=$UNAME_MACHINE-pc-sysv4.2uw$UNAME_VERSION
|
||||||
;;
|
;;
|
||||||
i*86:OS/2:*:*)
|
i*86:OS/2:*:*)
|
||||||
# If we were able to find `uname', then EMX Unix compatibility
|
# If we were able to find 'uname', then EMX Unix compatibility
|
||||||
# is probably installed.
|
# is probably installed.
|
||||||
GUESS=$UNAME_MACHINE-pc-os2-emx
|
GUESS=$UNAME_MACHINE-pc-os2-emx
|
||||||
;;
|
;;
|
||||||
@@ -1332,7 +1367,7 @@ EOF
|
|||||||
GUESS=ns32k-sni-sysv
|
GUESS=ns32k-sni-sysv
|
||||||
fi
|
fi
|
||||||
;;
|
;;
|
||||||
PENTIUM:*:4.0*:*) # Unisys `ClearPath HMP IX 4000' SVR4/MP effort
|
PENTIUM:*:4.0*:*) # Unisys 'ClearPath HMP IX 4000' SVR4/MP effort
|
||||||
# says <Richard.M.Bartel@ccMail.Census.GOV>
|
# says <Richard.M.Bartel@ccMail.Census.GOV>
|
||||||
GUESS=i586-unisys-sysv4
|
GUESS=i586-unisys-sysv4
|
||||||
;;
|
;;
|
||||||
|
|||||||
Vendored
+46
-41
@@ -1,10 +1,10 @@
|
|||||||
#! /bin/sh
|
#! /bin/sh
|
||||||
# Configuration validation subroutine script.
|
# Configuration validation subroutine script.
|
||||||
# Copyright 1992-2022 Free Software Foundation, Inc.
|
# Copyright 1992-2023 Free Software Foundation, Inc.
|
||||||
|
|
||||||
# shellcheck disable=SC2006,SC2268 # see below for rationale
|
# shellcheck disable=SC2006,SC2268 # see below for rationale
|
||||||
|
|
||||||
timestamp='2022-01-03'
|
timestamp='2023-07-31'
|
||||||
|
|
||||||
# This file is free software; you can redistribute it and/or modify it
|
# This file is free software; you can redistribute it and/or modify it
|
||||||
# under the terms of the GNU General Public License as published by
|
# under the terms of the GNU General Public License as published by
|
||||||
@@ -76,13 +76,13 @@ Report bugs and patches to <config-patches@gnu.org>."
|
|||||||
version="\
|
version="\
|
||||||
GNU config.sub ($timestamp)
|
GNU config.sub ($timestamp)
|
||||||
|
|
||||||
Copyright 1992-2022 Free Software Foundation, Inc.
|
Copyright 1992-2023 Free Software Foundation, Inc.
|
||||||
|
|
||||||
This is free software; see the source for copying conditions. There is NO
|
This is free software; see the source for copying conditions. There is NO
|
||||||
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE."
|
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE."
|
||||||
|
|
||||||
help="
|
help="
|
||||||
Try \`$me --help' for more information."
|
Try '$me --help' for more information."
|
||||||
|
|
||||||
# Parse command line
|
# Parse command line
|
||||||
while test $# -gt 0 ; do
|
while test $# -gt 0 ; do
|
||||||
@@ -130,7 +130,7 @@ IFS=$saved_IFS
|
|||||||
# Separate into logical components for further validation
|
# Separate into logical components for further validation
|
||||||
case $1 in
|
case $1 in
|
||||||
*-*-*-*-*)
|
*-*-*-*-*)
|
||||||
echo Invalid configuration \`"$1"\': more than four components >&2
|
echo "Invalid configuration '$1': more than four components" >&2
|
||||||
exit 1
|
exit 1
|
||||||
;;
|
;;
|
||||||
*-*-*-*)
|
*-*-*-*)
|
||||||
@@ -145,7 +145,8 @@ case $1 in
|
|||||||
nto-qnx* | linux-* | uclinux-uclibc* \
|
nto-qnx* | linux-* | uclinux-uclibc* \
|
||||||
| uclinux-gnu* | kfreebsd*-gnu* | knetbsd*-gnu* | netbsd*-gnu* \
|
| uclinux-gnu* | kfreebsd*-gnu* | knetbsd*-gnu* | netbsd*-gnu* \
|
||||||
| netbsd*-eabi* | kopensolaris*-gnu* | cloudabi*-eabi* \
|
| netbsd*-eabi* | kopensolaris*-gnu* | cloudabi*-eabi* \
|
||||||
| storm-chaos* | os2-emx* | rtmk-nova*)
|
| storm-chaos* | os2-emx* | rtmk-nova* | managarm-* \
|
||||||
|
| windows-* )
|
||||||
basic_machine=$field1
|
basic_machine=$field1
|
||||||
basic_os=$maybe_os
|
basic_os=$maybe_os
|
||||||
;;
|
;;
|
||||||
@@ -943,7 +944,7 @@ $basic_machine
|
|||||||
EOF
|
EOF
|
||||||
IFS=$saved_IFS
|
IFS=$saved_IFS
|
||||||
;;
|
;;
|
||||||
# We use `pc' rather than `unknown'
|
# We use 'pc' rather than 'unknown'
|
||||||
# because (1) that's what they normally are, and
|
# because (1) that's what they normally are, and
|
||||||
# (2) the word "unknown" tends to confuse beginning users.
|
# (2) the word "unknown" tends to confuse beginning users.
|
||||||
i*86 | x86_64)
|
i*86 | x86_64)
|
||||||
@@ -1205,39 +1206,16 @@ case $cpu-$vendor in
|
|||||||
| i370 | i*86 | i860 | i960 | ia16 | ia64 \
|
| i370 | i*86 | i860 | i960 | ia16 | ia64 \
|
||||||
| ip2k | iq2000 \
|
| ip2k | iq2000 \
|
||||||
| k1om \
|
| k1om \
|
||||||
|
| kvx \
|
||||||
| le32 | le64 \
|
| le32 | le64 \
|
||||||
| lm32 \
|
| lm32 \
|
||||||
| loongarch32 | loongarch64 | loongarchx32 \
|
| loongarch32 | loongarch64 \
|
||||||
| m32c | m32r | m32rle \
|
| m32c | m32r | m32rle \
|
||||||
| m5200 | m68000 | m680[012346]0 | m68360 | m683?2 | m68k \
|
| m5200 | m68000 | m680[012346]0 | m68360 | m683?2 | m68k \
|
||||||
| m6811 | m68hc11 | m6812 | m68hc12 | m68hcs12x \
|
| m6811 | m68hc11 | m6812 | m68hc12 | m68hcs12x \
|
||||||
| m88110 | m88k | maxq | mb | mcore | mep | metag \
|
| m88110 | m88k | maxq | mb | mcore | mep | metag \
|
||||||
| microblaze | microblazeel \
|
| microblaze | microblazeel \
|
||||||
| mips | mipsbe | mipseb | mipsel | mipsle \
|
| mips* \
|
||||||
| mips16 \
|
|
||||||
| mips64 | mips64eb | mips64el \
|
|
||||||
| mips64octeon | mips64octeonel \
|
|
||||||
| mips64orion | mips64orionel \
|
|
||||||
| mips64r5900 | mips64r5900el \
|
|
||||||
| mips64vr | mips64vrel \
|
|
||||||
| mips64vr4100 | mips64vr4100el \
|
|
||||||
| mips64vr4300 | mips64vr4300el \
|
|
||||||
| mips64vr5000 | mips64vr5000el \
|
|
||||||
| mips64vr5900 | mips64vr5900el \
|
|
||||||
| mipsisa32 | mipsisa32el \
|
|
||||||
| mipsisa32r2 | mipsisa32r2el \
|
|
||||||
| mipsisa32r3 | mipsisa32r3el \
|
|
||||||
| mipsisa32r5 | mipsisa32r5el \
|
|
||||||
| mipsisa32r6 | mipsisa32r6el \
|
|
||||||
| mipsisa64 | mipsisa64el \
|
|
||||||
| mipsisa64r2 | mipsisa64r2el \
|
|
||||||
| mipsisa64r3 | mipsisa64r3el \
|
|
||||||
| mipsisa64r5 | mipsisa64r5el \
|
|
||||||
| mipsisa64r6 | mipsisa64r6el \
|
|
||||||
| mipsisa64sb1 | mipsisa64sb1el \
|
|
||||||
| mipsisa64sr71k | mipsisa64sr71kel \
|
|
||||||
| mipsr5900 | mipsr5900el \
|
|
||||||
| mipstx39 | mipstx39el \
|
|
||||||
| mmix \
|
| mmix \
|
||||||
| mn10200 | mn10300 \
|
| mn10200 | mn10300 \
|
||||||
| moxie \
|
| moxie \
|
||||||
@@ -1285,7 +1263,7 @@ case $cpu-$vendor in
|
|||||||
;;
|
;;
|
||||||
|
|
||||||
*)
|
*)
|
||||||
echo Invalid configuration \`"$1"\': machine \`"$cpu-$vendor"\' not recognized 1>&2
|
echo "Invalid configuration '$1': machine '$cpu-$vendor' not recognized" 1>&2
|
||||||
exit 1
|
exit 1
|
||||||
;;
|
;;
|
||||||
esac
|
esac
|
||||||
@@ -1341,6 +1319,10 @@ EOF
|
|||||||
kernel=linux
|
kernel=linux
|
||||||
os=`echo "$basic_os" | sed -e 's|linux|gnu|'`
|
os=`echo "$basic_os" | sed -e 's|linux|gnu|'`
|
||||||
;;
|
;;
|
||||||
|
managarm*)
|
||||||
|
kernel=managarm
|
||||||
|
os=`echo "$basic_os" | sed -e 's|managarm|mlibc|'`
|
||||||
|
;;
|
||||||
*)
|
*)
|
||||||
kernel=
|
kernel=
|
||||||
os=$basic_os
|
os=$basic_os
|
||||||
@@ -1728,7 +1710,7 @@ case $os in
|
|||||||
| hpux* | unos* | osf* | luna* | dgux* | auroraux* | solaris* \
|
| hpux* | unos* | osf* | luna* | dgux* | auroraux* | solaris* \
|
||||||
| sym* | plan9* | psp* | sim* | xray* | os68k* | v88r* \
|
| sym* | plan9* | psp* | sim* | xray* | os68k* | v88r* \
|
||||||
| hiux* | abug | nacl* | netware* | windows* \
|
| hiux* | abug | nacl* | netware* | windows* \
|
||||||
| os9* | macos* | osx* | ios* \
|
| os9* | macos* | osx* | ios* | tvos* | watchos* \
|
||||||
| mpw* | magic* | mmixware* | mon960* | lnews* \
|
| mpw* | magic* | mmixware* | mon960* | lnews* \
|
||||||
| amigaos* | amigados* | msdos* | newsos* | unicos* | aof* \
|
| amigaos* | amigados* | msdos* | newsos* | unicos* | aof* \
|
||||||
| aos* | aros* | cloudabi* | sortix* | twizzler* \
|
| aos* | aros* | cloudabi* | sortix* | twizzler* \
|
||||||
@@ -1754,7 +1736,7 @@ case $os in
|
|||||||
| onefs* | tirtos* | phoenix* | fuchsia* | redox* | bme* \
|
| onefs* | tirtos* | phoenix* | fuchsia* | redox* | bme* \
|
||||||
| midnightbsd* | amdhsa* | unleashed* | emscripten* | wasi* \
|
| midnightbsd* | amdhsa* | unleashed* | emscripten* | wasi* \
|
||||||
| nsk* | powerunix* | genode* | zvmoe* | qnx* | emx* | zephyr* \
|
| nsk* | powerunix* | genode* | zvmoe* | qnx* | emx* | zephyr* \
|
||||||
| fiwix* )
|
| fiwix* | mlibc* | cos* | mbr* )
|
||||||
;;
|
;;
|
||||||
# This one is extra strict with allowed versions
|
# This one is extra strict with allowed versions
|
||||||
sco3.2v2 | sco3.2v[4-9]* | sco5v6*)
|
sco3.2v2 | sco3.2v[4-9]* | sco5v6*)
|
||||||
@@ -1762,8 +1744,11 @@ case $os in
|
|||||||
;;
|
;;
|
||||||
none)
|
none)
|
||||||
;;
|
;;
|
||||||
|
kernel* | msvc* )
|
||||||
|
# Restricted further below
|
||||||
|
;;
|
||||||
*)
|
*)
|
||||||
echo Invalid configuration \`"$1"\': OS \`"$os"\' not recognized 1>&2
|
echo "Invalid configuration '$1': OS '$os' not recognized" 1>&2
|
||||||
exit 1
|
exit 1
|
||||||
;;
|
;;
|
||||||
esac
|
esac
|
||||||
@@ -1772,14 +1757,30 @@ esac
|
|||||||
# (given a valid OS), if there is a kernel.
|
# (given a valid OS), if there is a kernel.
|
||||||
case $kernel-$os in
|
case $kernel-$os in
|
||||||
linux-gnu* | linux-dietlibc* | linux-android* | linux-newlib* \
|
linux-gnu* | linux-dietlibc* | linux-android* | linux-newlib* \
|
||||||
| linux-musl* | linux-relibc* | linux-uclibc* )
|
| linux-musl* | linux-relibc* | linux-uclibc* | linux-mlibc* )
|
||||||
;;
|
;;
|
||||||
uclinux-uclibc* )
|
uclinux-uclibc* )
|
||||||
;;
|
;;
|
||||||
-dietlibc* | -newlib* | -musl* | -relibc* | -uclibc* )
|
managarm-mlibc* | managarm-kernel* )
|
||||||
|
;;
|
||||||
|
windows*-gnu* | windows*-msvc*)
|
||||||
|
;;
|
||||||
|
-dietlibc* | -newlib* | -musl* | -relibc* | -uclibc* | -mlibc* )
|
||||||
# These are just libc implementations, not actual OSes, and thus
|
# These are just libc implementations, not actual OSes, and thus
|
||||||
# require a kernel.
|
# require a kernel.
|
||||||
echo "Invalid configuration \`$1': libc \`$os' needs explicit kernel." 1>&2
|
echo "Invalid configuration '$1': libc '$os' needs explicit kernel." 1>&2
|
||||||
|
exit 1
|
||||||
|
;;
|
||||||
|
-kernel* )
|
||||||
|
echo "Invalid configuration '$1': '$os' needs explicit kernel." 1>&2
|
||||||
|
exit 1
|
||||||
|
;;
|
||||||
|
*-kernel* )
|
||||||
|
echo "Invalid configuration '$1': '$kernel' does not support '$os'." 1>&2
|
||||||
|
exit 1
|
||||||
|
;;
|
||||||
|
*-msvc* )
|
||||||
|
echo "Invalid configuration '$1': '$os' needs 'windows'." 1>&2
|
||||||
exit 1
|
exit 1
|
||||||
;;
|
;;
|
||||||
kfreebsd*-gnu* | kopensolaris*-gnu*)
|
kfreebsd*-gnu* | kopensolaris*-gnu*)
|
||||||
@@ -1792,11 +1793,15 @@ case $kernel-$os in
|
|||||||
;;
|
;;
|
||||||
*-eabi* | *-gnueabi*)
|
*-eabi* | *-gnueabi*)
|
||||||
;;
|
;;
|
||||||
|
none-coff* | none-elf*)
|
||||||
|
# None (no kernel, i.e. freestanding / bare metal),
|
||||||
|
# can be paired with an output format "OS"
|
||||||
|
;;
|
||||||
-*)
|
-*)
|
||||||
# Blank kernel with real OS is always fine.
|
# Blank kernel with real OS is always fine.
|
||||||
;;
|
;;
|
||||||
*-*)
|
*-*)
|
||||||
echo "Invalid configuration \`$1': Kernel \`$kernel' not known to work with OS \`$os'." 1>&2
|
echo "Invalid configuration '$1': Kernel '$kernel' not known to work with OS '$os'." 1>&2
|
||||||
exit 1
|
exit 1
|
||||||
;;
|
;;
|
||||||
esac
|
esac
|
||||||
|
|||||||
@@ -3507,7 +3507,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=28
|
SDL_MINOR_VERSION=28
|
||||||
SDL_MICRO_VERSION=2
|
SDL_MICRO_VERSION=3
|
||||||
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=28
|
SDL_MINOR_VERSION=28
|
||||||
SDL_MICRO_VERSION=2
|
SDL_MICRO_VERSION=3
|
||||||
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`
|
||||||
|
|||||||
@@ -13,13 +13,13 @@ supported, but you can use the "android-project-ant" directory as a template.
|
|||||||
Requirements
|
Requirements
|
||||||
================================================================================
|
================================================================================
|
||||||
|
|
||||||
Android SDK (version 31 or later)
|
Android SDK (version 34 or later)
|
||||||
https://developer.android.com/sdk/index.html
|
https://developer.android.com/sdk/index.html
|
||||||
|
|
||||||
Android NDK r15c or later
|
Android NDK r15c or later
|
||||||
https://developer.android.com/tools/sdk/ndk/index.html
|
https://developer.android.com/tools/sdk/ndk/index.html
|
||||||
|
|
||||||
Minimum API level supported by SDL: 16 (Android 4.1)
|
Minimum API level supported by SDL: 19 (Android 4.4)
|
||||||
|
|
||||||
|
|
||||||
How the port works
|
How the port works
|
||||||
@@ -431,13 +431,13 @@ The Tegra Graphics Debugger is available from NVidia here:
|
|||||||
https://developer.nvidia.com/tegra-graphics-debugger
|
https://developer.nvidia.com/tegra-graphics-debugger
|
||||||
|
|
||||||
|
|
||||||
Why is API level 16 the minimum required?
|
Why is API level 19 the minimum required?
|
||||||
================================================================================
|
================================================================================
|
||||||
|
|
||||||
The latest NDK toolchain doesn't support targeting earlier than API level 16.
|
The latest NDK toolchain doesn't support targeting earlier than API level 19.
|
||||||
As of this writing, according to https://developer.android.com/about/dashboards/index.html
|
As of this writing, according to https://www.composables.com/tools/distribution-chart
|
||||||
about 99% of the Android devices accessing Google Play support API level 16 or
|
about 99.7% of the Android devices accessing Google Play support API level 19 or
|
||||||
higher (January 2018).
|
higher (August 2023).
|
||||||
|
|
||||||
|
|
||||||
A note regarding the use of the "dirty rectangles" rendering technique
|
A note regarding the use of the "dirty rectangles" rendering technique
|
||||||
|
|||||||
@@ -48,7 +48,7 @@ SDL can be included in your project in 2 major ways:
|
|||||||
The following CMake script supports both, depending on the value of `MYGAME_VENDORED`.
|
The following CMake script supports both, depending on the value of `MYGAME_VENDORED`.
|
||||||
|
|
||||||
```cmake
|
```cmake
|
||||||
cmake_minimum_required(VERSION 3.0)
|
cmake_minimum_required(VERSION 3.5)
|
||||||
project(mygame)
|
project(mygame)
|
||||||
|
|
||||||
# Create an option to switch between a system sdl library and a vendored sdl library
|
# Create an option to switch between a system sdl library and a vendored sdl library
|
||||||
|
|||||||
@@ -55,6 +55,8 @@ assert can have unique static variables associated with it.
|
|||||||
#define SDL_TriggerBreakpoint() __builtin_debugtrap()
|
#define SDL_TriggerBreakpoint() __builtin_debugtrap()
|
||||||
#elif ( (!defined(__NACL__)) && ((defined(__GNUC__) || defined(__clang__)) && (defined(__i386__) || defined(__x86_64__))) )
|
#elif ( (!defined(__NACL__)) && ((defined(__GNUC__) || defined(__clang__)) && (defined(__i386__) || defined(__x86_64__))) )
|
||||||
#define SDL_TriggerBreakpoint() __asm__ __volatile__ ( "int $3\n\t" )
|
#define SDL_TriggerBreakpoint() __asm__ __volatile__ ( "int $3\n\t" )
|
||||||
|
#elif (defined(__GNUC__) || defined(__clang__)) && defined(__riscv)
|
||||||
|
#define SDL_TriggerBreakpoint() __asm__ __volatile__ ( "ebreak\n\t" )
|
||||||
#elif ( defined(__APPLE__) && (defined(__arm64__) || defined(__aarch64__)) ) /* this might work on other ARM targets, but this is a known quantity... */
|
#elif ( defined(__APPLE__) && (defined(__arm64__) || defined(__aarch64__)) ) /* this might work on other ARM targets, but this is a known quantity... */
|
||||||
#define SDL_TriggerBreakpoint() __asm__ __volatile__ ( "brk #22\n\t" )
|
#define SDL_TriggerBreakpoint() __asm__ __volatile__ ( "brk #22\n\t" )
|
||||||
#elif defined(__APPLE__) && defined(__arm__)
|
#elif defined(__APPLE__) && defined(__arm__)
|
||||||
|
|||||||
@@ -1474,6 +1474,17 @@ extern "C" {
|
|||||||
*/
|
*/
|
||||||
#define SDL_HINT_RENDER_VSYNC "SDL_RENDER_VSYNC"
|
#define SDL_HINT_RENDER_VSYNC "SDL_RENDER_VSYNC"
|
||||||
|
|
||||||
|
/**
|
||||||
|
* \brief A variable controlling whether the Metal render driver select low power device over default one
|
||||||
|
*
|
||||||
|
* This variable can be set to the following values:
|
||||||
|
* "0" - Use the prefered OS device
|
||||||
|
* "1" - Select a low power one
|
||||||
|
*
|
||||||
|
* By default the prefered OS device is used.
|
||||||
|
*/
|
||||||
|
#define SDL_HINT_RENDER_METAL_PREFER_LOW_POWER_DEVICE "SDL_RENDER_METAL_PREFER_LOW_POWER_DEVICE"
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* \brief A variable controlling if VSYNC is automatically disable if doesn't reach the enough FPS
|
* \brief A variable controlling if VSYNC is automatically disable if doesn't reach the enough FPS
|
||||||
*
|
*
|
||||||
|
|||||||
@@ -1890,7 +1890,7 @@ extern DECLSPEC void *SDLCALL SDL_RenderGetMetalLayer(SDL_Renderer * renderer);
|
|||||||
* Note that as of SDL 2.0.18, this will return NULL if Metal refuses to give
|
* Note that as of SDL 2.0.18, this will return NULL if Metal refuses to give
|
||||||
* SDL a drawable to render to, which might happen if the window is
|
* SDL a drawable to render to, which might happen if the window is
|
||||||
* hidden/minimized/offscreen. This doesn't apply to command encoders for
|
* hidden/minimized/offscreen. This doesn't apply to command encoders for
|
||||||
* render targets, just the window's backbacker. Check your return values!
|
* render targets, just the window's backbuffer. Check your return values!
|
||||||
*
|
*
|
||||||
* \param renderer The renderer to query
|
* \param renderer The renderer to query
|
||||||
* \returns an `id<MTLRenderCommandEncoder>` on success, or NULL if the
|
* \returns an `id<MTLRenderCommandEncoder>` on success, or NULL if the
|
||||||
|
|||||||
@@ -59,7 +59,7 @@ typedef struct SDL_version
|
|||||||
*/
|
*/
|
||||||
#define SDL_MAJOR_VERSION 2
|
#define SDL_MAJOR_VERSION 2
|
||||||
#define SDL_MINOR_VERSION 28
|
#define SDL_MINOR_VERSION 28
|
||||||
#define SDL_PATCHLEVEL 2
|
#define SDL_PATCHLEVEL 3
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Macro to determine SDL version program was compiled against.
|
* Macro to determine SDL version program was compiled against.
|
||||||
|
|||||||
@@ -884,9 +884,9 @@ int HID_API_EXPORT hid_get_feature_report(hid_device *dev, unsigned char *data,
|
|||||||
unsigned char report = data[0];
|
unsigned char report = data[0];
|
||||||
|
|
||||||
res = ioctl(dev->device_handle, HIDIOCGFEATURE(length), data);
|
res = ioctl(dev->device_handle, HIDIOCGFEATURE(length), data);
|
||||||
if (res < 0)
|
if (res < 0) {
|
||||||
perror("ioctl (GFEATURE)");
|
/* perror("ioctl (GFEATURE)"); */
|
||||||
else if (dev->needs_ble_hack) {
|
} else if (dev->needs_ble_hack) {
|
||||||
/* Versions of BlueZ before 5.56 don't include the report in the data,
|
/* Versions of BlueZ before 5.56 don't include the report in the data,
|
||||||
* and versions of BlueZ >= 5.56 include 2 copies of the report.
|
* and versions of BlueZ >= 5.56 include 2 copies of the report.
|
||||||
* We'll fix it so that there is a single copy of the report in both cases
|
* We'll fix it so that there is a single copy of the report in both cases
|
||||||
|
|||||||
@@ -134,9 +134,7 @@ static const char *s_ControllerMappings[] = {
|
|||||||
"03000000b80500000610000000000000,Elecom Gamepad,a:b2,b:b3,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b0,y:b1,",
|
"03000000b80500000610000000000000,Elecom Gamepad,a:b2,b:b3,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b0,y:b1,",
|
||||||
"03000000852100000201000000000000,FF-GP1,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b0,y:b3,",
|
"03000000852100000201000000000000,FF-GP1,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b0,y:b3,",
|
||||||
"030000000d0f00002700000000000000,FIGHTING STICK V3,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,lefttrigger:b6,rightshoulder:b5,righttrigger:b7,start:b9,x:b0,y:b3,",
|
"030000000d0f00002700000000000000,FIGHTING STICK V3,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,lefttrigger:b6,rightshoulder:b5,righttrigger:b7,start:b9,x:b0,y:b3,",
|
||||||
"03000000151900004000000000000000,Flydigi Vader 2,a:b27,b:b26,back:b19,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b6,leftshoulder:b23,leftstick:b17,lefttrigger:b21,leftx:a0,lefty:a1,misc1:b15,paddle1:b11,paddle2:b10,paddle3:b13,paddle4:b12,rightshoulder:b22,rightstick:b16,righttrigger:b20,rightx:a3,righty:a4,start:b18,x:b25,y:b24,", /* Bluetooth */
|
"03000000790000000600000000000000,G-Shark GS-GP702,crc:8e4f,a:b2,b:b1,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b3,y:b0,",
|
||||||
"03000000b40400001124000000000000,Flydigi Vader 2,a:b0,b:b1,back:b10,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b6,leftstick:b12,lefttrigger:b8,leftx:a0,lefty:a1,misc1:b14,paddle1:b4,paddle2:b5,paddle3:b16,paddle4:b17,rightshoulder:b7,rightstick:b13,righttrigger:b9,rightx:a3,righty:a4,start:b11,x:b2,y:b3,", /* Dongle */
|
|
||||||
"03000000b40400001224000000000000,Flydigi Vader 2,a:b0,b:b1,back:b10,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b6,leftstick:b12,lefttrigger:b8,leftx:a0,lefty:a1,misc1:b2,paddle1:b16,paddle2:b17,paddle3:b14,paddle4:b15,rightshoulder:b7,rightstick:b13,righttrigger:b9,rightx:a3,righty:a4,start:b11,x:b3,y:b4,", /* Wired */
|
|
||||||
"030000008f0e00000d31000000000000,GAMEPAD 3 TURBO,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b0,y:b3,",
|
"030000008f0e00000d31000000000000,GAMEPAD 3 TURBO,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b0,y:b3,",
|
||||||
"03000000300f00000b01000000000000,GGE909 Recoil Pad,a:b2,b:b1,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a3,righty:a2,start:b9,x:b3,y:b0,",
|
"03000000300f00000b01000000000000,GGE909 Recoil Pad,a:b2,b:b1,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a3,righty:a2,start:b9,x:b3,y:b0,",
|
||||||
"03000000790000002201000000000000,Game Controller for PC,a:b2,b:b1,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b3,y:b0,",
|
"03000000790000002201000000000000,Game Controller for PC,a:b2,b:b1,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b3,y:b0,",
|
||||||
@@ -416,9 +414,6 @@ static const char *s_ControllerMappings[] = {
|
|||||||
"03000000a306000022f6000001030000,Cyborg V.3 Rumble Pad,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:b10,lefttrigger:+a3,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:-a3,rightx:a2,righty:a4,start:b9,x:b0,y:b3,",
|
"03000000a306000022f6000001030000,Cyborg V.3 Rumble Pad,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:b10,lefttrigger:+a3,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:-a3,rightx:a2,righty:a4,start:b9,x:b0,y:b3,",
|
||||||
"030000000d0f00008400000000010000,Fighting Commander,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:b10,lefttrigger:a3,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:a4,rightx:a2,righty:a5,start:b9,x:b0,y:b3,",
|
"030000000d0f00008400000000010000,Fighting Commander,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:b10,lefttrigger:a3,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:a4,rightx:a2,righty:a5,start:b9,x:b0,y:b3,",
|
||||||
"030000000d0f00008500000000010000,Fighting Commander,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b0,y:b3,",
|
"030000000d0f00008500000000010000,Fighting Commander,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b0,y:b3,",
|
||||||
"03000000151900004000000001000000,Flydigi Vader 2,a:b14,b:b15,back:b10,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b21,leftshoulder:b6,leftstick:b12,lefttrigger:a5,leftx:a0,lefty:a1,paddle1:b2,paddle2:b5,paddle3:b16,paddle4:b17,rightshoulder:b7,rightstick:b13,righttrigger:a4,rightx:a2,righty:a3,start:b11,x:b0,y:b1,", /* Bluetooth */
|
|
||||||
"03000000b40400001124000001040000,Flydigi Vader 2,a:b0,b:b1,back:b10,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b6,leftstick:b12,lefttrigger:a5,leftx:a0,lefty:a1,misc1:b14,paddle1:b2,paddle2:b5,paddle3:b16,paddle4:b17,rightshoulder:b7,rightstick:b13,righttrigger:a4,rightx:a2,righty:a3,start:b11,x:b3,y:b4,", /* Dongle */
|
|
||||||
"03000000b40400001224000003030000,Flydigi Vader 2,a:b0,b:b1,back:b10,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b6,leftstick:b12,lefttrigger:a5,leftx:a0,lefty:a1,misc1:b2,paddle1:b16,paddle2:b17,paddle3:b14,paddle4:b15,rightshoulder:b7,rightstick:b13,righttrigger:a4,rightx:a2,righty:a3,start:b11,x:b3,y:b4,", /* Wired */
|
|
||||||
"03000000ac0500001a06000002020000,GameSir-T3 2.02,a:b0,b:b1,back:b10,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b15,leftshoulder:b6,leftstick:b13,lefttrigger:a5,leftx:a0,lefty:a1,rightshoulder:b7,rightstick:b14,righttrigger:a4,rightx:a2,righty:a3,start:b11,x:b3,y:b4,",
|
"03000000ac0500001a06000002020000,GameSir-T3 2.02,a:b0,b:b1,back:b10,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b15,leftshoulder:b6,leftstick:b13,lefttrigger:a5,leftx:a0,lefty:a1,rightshoulder:b7,rightstick:b14,righttrigger:a4,rightx:a2,righty:a3,start:b11,x:b3,y:b4,",
|
||||||
"0500000047532047616d657061640000,GameStop Gamepad,a:b0,b:b1,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b2,y:b3,",
|
"0500000047532047616d657061640000,GameStop Gamepad,a:b0,b:b1,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b2,y:b3,",
|
||||||
"03000000c01100000140000000010000,GameStop PS4 Fun Controller,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:b10,lefttrigger:a3,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:a4,rightx:a2,righty:a5,start:b9,x:b0,y:b3,",
|
"03000000c01100000140000000010000,GameStop PS4 Fun Controller,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:b10,lefttrigger:a3,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:a4,rightx:a2,righty:a5,start:b9,x:b0,y:b3,",
|
||||||
@@ -610,9 +605,6 @@ static const char *s_ControllerMappings[] = {
|
|||||||
"050000004c050000f20d000000010000,DualSense Edge Wireless Controller,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:b10,lefttrigger:a3,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:a4,rightx:a2,righty:a5,start:b9,x:b0,y:b3,",
|
"050000004c050000f20d000000010000,DualSense Edge Wireless Controller,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:b10,lefttrigger:a3,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:a4,rightx:a2,righty:a5,start:b9,x:b0,y:b3,",
|
||||||
"030000006f0e00003001000001010000,EA Sports PS3 Controller,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b0,y:b3,",
|
"030000006f0e00003001000001010000,EA Sports PS3 Controller,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b0,y:b3,",
|
||||||
"03000000790000001100000010010000,Elecom Gamepad,crc:e86c,a:b2,b:b3,back:b6,dpdown:+a1,dpleft:-a0,dpright:+a0,dpup:-a1,leftshoulder:b4,rightshoulder:b5,start:b7,x:b0,y:b1,",
|
"03000000790000001100000010010000,Elecom Gamepad,crc:e86c,a:b2,b:b3,back:b6,dpdown:+a1,dpleft:-a0,dpright:+a0,dpup:-a1,leftshoulder:b4,rightshoulder:b5,start:b7,x:b0,y:b1,",
|
||||||
"03000000b40400001124000011010000,Flydigi Vader 2,a:b0,b:b1,back:b10,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b6,leftstick:b12,lefttrigger:a5,leftx:a0,lefty:a1,misc1:b14,paddle1:b2,paddle2:b5,paddle3:b16,paddle4:b17,rightshoulder:b7,rightstick:b13,righttrigger:a4,rightx:a2,righty:a3,start:b11,x:b3,y:b4,", /* Dongle */
|
|
||||||
"03000000b40400001224000011010000,Flydigi Vader 2,a:b0,b:b1,back:b10,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b6,leftstick:b12,lefttrigger:a5,leftx:a0,lefty:a1,misc1:b2,paddle1:b16,paddle2:b17,paddle3:b14,paddle4:b15,rightshoulder:b7,rightstick:b13,righttrigger:a4,rightx:a2,righty:a3,start:b11,x:b3,y:b4,", /* Wired */
|
|
||||||
"05000000151900004000000001000000,Flydigi Vader 2,a:b0,b:b1,back:b10,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b21,leftshoulder:b6,leftstick:b12,lefttrigger:a5,leftx:a0,lefty:a1,misc1:b14,paddle1:b2,paddle2:b5,paddle3:b16,paddle4:b17,rightshoulder:b7,rightstick:b13,righttrigger:a4,rightx:a2,righty:a3,start:b11,x:b3,y:b4,", /* Bluetooth */
|
|
||||||
"0300000079000000d418000000010000,GPD Win 2 Controller,a:b0,b:b1,back:b6,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b8,leftshoulder:b4,leftstick:b9,lefttrigger:a2,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b10,righttrigger:a5,rightx:a3,righty:a4,start:b7,x:b2,y:b3,",
|
"0300000079000000d418000000010000,GPD Win 2 Controller,a:b0,b:b1,back:b6,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b8,leftshoulder:b4,leftstick:b9,lefttrigger:a2,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b10,righttrigger:a5,rightx:a3,righty:a4,start:b7,x:b2,y:b3,",
|
||||||
"0500000047532067616d657061640000,GS Gamepad,a:b0,b:b1,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b8,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b2,y:b3,",
|
"0500000047532067616d657061640000,GS Gamepad,a:b0,b:b1,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b8,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b2,y:b3,",
|
||||||
"03000000341a000005f7000010010000,GameCube {HuiJia USB box},a:b1,b:b2,dpdown:b14,dpleft:b15,dpright:b13,dpup:b12,lefttrigger:a3,leftx:a0,lefty:a1,rightshoulder:b7,righttrigger:a4,rightx:a5,righty:a2,start:b9,x:b0,y:b3,",
|
"03000000341a000005f7000010010000,GameCube {HuiJia USB box},a:b1,b:b2,dpdown:b14,dpleft:b15,dpright:b13,dpup:b12,lefttrigger:a3,leftx:a0,lefty:a1,rightshoulder:b7,righttrigger:a4,rightx:a5,righty:a2,start:b9,x:b0,y:b3,",
|
||||||
@@ -910,7 +902,6 @@ static const char *s_ControllerMappings[] = {
|
|||||||
"05000000c82d000018900000ffff0f00,8BitDo Zero 2,a:b1,b:b0,back:b4,leftshoulder:b9,leftx:a0,lefty:a1,rightshoulder:b10,start:b6,x:b3,y:b2,hint:!SDL_GAMECONTROLLER_USE_BUTTON_LABELS:=1,",
|
"05000000c82d000018900000ffff0f00,8BitDo Zero 2,a:b1,b:b0,back:b4,leftshoulder:b9,leftx:a0,lefty:a1,rightshoulder:b10,start:b6,x:b3,y:b2,hint:!SDL_GAMECONTROLLER_USE_BUTTON_LABELS:=1,",
|
||||||
"05000000c82d000030320000ffff0f00,8BitDo Zero 2,a:b0,b:b1,back:b4,leftshoulder:b9,leftx:a0,lefty:a1,rightshoulder:b10,start:b6,x:b2,y:b3,hint:SDL_GAMECONTROLLER_USE_BUTTON_LABELS:=1,",
|
"05000000c82d000030320000ffff0f00,8BitDo Zero 2,a:b0,b:b1,back:b4,leftshoulder:b9,leftx:a0,lefty:a1,rightshoulder:b10,start:b6,x:b2,y:b3,hint:SDL_GAMECONTROLLER_USE_BUTTON_LABELS:=1,",
|
||||||
"05000000c82d000030320000ffff0f00,8BitDo Zero 2,a:b1,b:b0,back:b4,leftshoulder:b9,leftx:a0,lefty:a1,rightshoulder:b10,start:b6,x:b3,y:b2,hint:!SDL_GAMECONTROLLER_USE_BUTTON_LABELS:=1,",
|
"05000000c82d000030320000ffff0f00,8BitDo Zero 2,a:b1,b:b0,back:b4,leftshoulder:b9,leftx:a0,lefty:a1,rightshoulder:b10,start:b6,x:b3,y:b2,hint:!SDL_GAMECONTROLLER_USE_BUTTON_LABELS:=1,",
|
||||||
"05000000b404000011240000dfff3f00,Flydigi Vader 2,a:b0,b:b1,back:b4,dpdown:b12,dpleft:b13,dpright:b14,dpup:b11,leftshoulder:b9,leftstick:b7,lefttrigger:a4,leftx:a0,lefty:a1,paddle1:b17,paddle2:b18,rightshoulder:b10,rightstick:b8,righttrigger:a5,rightx:a2,righty:a3,start:b6,x:b2,y:b3,",
|
|
||||||
"05000000d6020000e5890000dfff3f80,GPD XD Plus,a:b0,b:b1,back:b4,dpdown:b12,dpleft:b13,dpright:b14,dpup:b11,leftshoulder:b9,leftstick:b7,lefttrigger:a2,leftx:a0,lefty:a1,rightshoulder:b10,rightstick:b8,righttrigger:a3,rightx:a4,righty:a5,start:b6,x:b2,y:b3,",
|
"05000000d6020000e5890000dfff3f80,GPD XD Plus,a:b0,b:b1,back:b4,dpdown:b12,dpleft:b13,dpright:b14,dpup:b11,leftshoulder:b9,leftstick:b7,lefttrigger:a2,leftx:a0,lefty:a1,rightshoulder:b10,rightstick:b8,righttrigger:a3,rightx:a4,righty:a5,start:b6,x:b2,y:b3,",
|
||||||
"0500000031366332860c44aadfff0f00,GS Gamepad,a:b0,b:b1,back:b4,dpdown:b12,dpleft:b13,dpright:b14,dpup:b11,leftshoulder:b9,leftstick:b7,lefttrigger:b15,leftx:a0,lefty:a1,rightshoulder:b10,rightstick:b8,righttrigger:b16,rightx:a2,righty:a3,start:b6,x:b2,y:b3,",
|
"0500000031366332860c44aadfff0f00,GS Gamepad,a:b0,b:b1,back:b4,dpdown:b12,dpleft:b13,dpright:b14,dpup:b11,leftshoulder:b9,leftstick:b7,lefttrigger:b15,leftx:a0,lefty:a1,rightshoulder:b10,rightstick:b8,righttrigger:b16,rightx:a2,righty:a3,start:b6,x:b2,y:b3,",
|
||||||
"05000000bc20000000550000ffff3f00,GameSir G3w,a:b0,b:b1,back:b4,dpdown:b12,dpleft:b13,dpright:b14,dpup:b11,leftshoulder:b9,leftstick:b7,lefttrigger:a5,leftx:a0,lefty:a1,rightshoulder:b10,rightstick:b8,righttrigger:a4,rightx:a2,righty:a3,start:b6,x:b2,y:b3,",
|
"05000000bc20000000550000ffff3f00,GameSir G3w,a:b0,b:b1,back:b4,dpdown:b12,dpleft:b13,dpright:b14,dpup:b11,leftshoulder:b9,leftstick:b7,lefttrigger:a5,leftx:a0,lefty:a1,rightshoulder:b10,rightstick:b8,righttrigger:a4,rightx:a2,righty:a3,start:b6,x:b2,y:b3,",
|
||||||
|
|||||||
@@ -486,6 +486,7 @@ static SDL_bool HIDAPI_DriverPS5_InitDevice(SDL_HIDAPI_Device *device)
|
|||||||
/* The Razer Wolverine V2 Pro doesn't respond to the detection protocol, but has a touchpad and sensors, but no vibration */
|
/* The Razer Wolverine V2 Pro doesn't respond to the detection protocol, but has a touchpad and sensors, but no vibration */
|
||||||
ctx->sensors_supported = SDL_TRUE;
|
ctx->sensors_supported = SDL_TRUE;
|
||||||
ctx->touchpad_supported = SDL_TRUE;
|
ctx->touchpad_supported = SDL_TRUE;
|
||||||
|
ctx->use_alternate_report = SDL_TRUE;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
ctx->effects_supported = (ctx->lightbar_supported || ctx->vibration_supported || ctx->playerled_supported);
|
ctx->effects_supported = (ctx->lightbar_supported || ctx->vibration_supported || ctx->playerled_supported);
|
||||||
|
|||||||
@@ -1041,7 +1041,7 @@ static void ConfigJoystick(SDL_Joystick *joystick, int fd)
|
|||||||
}
|
}
|
||||||
for (i = 0; i < ABS_MAX; ++i) {
|
for (i = 0; i < ABS_MAX; ++i) {
|
||||||
/* Skip digital hats */
|
/* Skip digital hats */
|
||||||
if (joystick->hwdata->has_hat[(i - ABS_HAT0X) / 2]) {
|
if (i >= ABS_HAT0X && i <= ABS_HAT3Y && joystick->hwdata->has_hat[(i - ABS_HAT0X) / 2]) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
if (test_bit(i, absbit)) {
|
if (test_bit(i, absbit)) {
|
||||||
|
|||||||
+154
-120
@@ -174,27 +174,33 @@ static int OS2_JoystickInit(void)
|
|||||||
struct _joycfg joycfg; /* Joy Configuration from envvar */
|
struct _joycfg joycfg; /* Joy Configuration from envvar */
|
||||||
|
|
||||||
/* Open GAME$ port */
|
/* Open GAME$ port */
|
||||||
if (joyPortOpen(&hJoyPort) < 0) return 0; /* Cannot open... report no joystick */
|
if (joyPortOpen(&hJoyPort) < 0) {
|
||||||
|
return 0; /* Cannot open... report no joystick */
|
||||||
|
}
|
||||||
/* Get Max Number of Devices */
|
/* Get Max Number of Devices */
|
||||||
ulDataLen = sizeof(stGameParms);
|
ulDataLen = sizeof(stGameParms);
|
||||||
rc = DosDevIOCtl(hJoyPort, IOCTL_CAT_USER, GAME_GET_PARMS,
|
rc = DosDevIOCtl(hJoyPort, IOCTL_CAT_USER, GAME_GET_PARMS,
|
||||||
NULL, 0, NULL, &stGameParms, ulDataLen, &ulDataLen); /* Ask device info */
|
NULL, 0, NULL, &stGameParms, ulDataLen, &ulDataLen); /* Ask device info */
|
||||||
if (rc != 0)
|
if (rc != 0) {
|
||||||
{
|
|
||||||
joyPortClose(&hJoyPort);
|
joyPortClose(&hJoyPort);
|
||||||
return SDL_SetError("Could not read joystick port.");
|
return SDL_SetError("Could not read joystick port.");
|
||||||
}
|
}
|
||||||
maxdevs = 0;
|
maxdevs = 0;
|
||||||
if (stGameParms.useA != 0) maxdevs++;
|
if (stGameParms.useA != 0) {
|
||||||
if (stGameParms.useB != 0) maxdevs++;
|
maxdevs++;
|
||||||
if (maxdevs > MAX_JOYSTICKS) maxdevs = MAX_JOYSTICKS;
|
}
|
||||||
|
if (stGameParms.useB != 0) {
|
||||||
|
maxdevs++;
|
||||||
|
}
|
||||||
|
if (maxdevs > MAX_JOYSTICKS) {
|
||||||
|
maxdevs = MAX_JOYSTICKS;
|
||||||
|
}
|
||||||
|
|
||||||
/* Defines min/max axes values (callibration) */
|
/* Defines min/max axes values (callibration) */
|
||||||
ulDataLen = sizeof(stGameCalib);
|
ulDataLen = sizeof(stGameCalib);
|
||||||
rc = DosDevIOCtl(hJoyPort, IOCTL_CAT_USER, GAME_GET_CALIB,
|
rc = DosDevIOCtl(hJoyPort, IOCTL_CAT_USER, GAME_GET_CALIB,
|
||||||
NULL, 0, NULL, &stGameCalib, ulDataLen, &ulDataLen);
|
NULL, 0, NULL, &stGameCalib, ulDataLen, &ulDataLen);
|
||||||
if (rc != 0)
|
if (rc != 0) {
|
||||||
{
|
|
||||||
joyPortClose(&hJoyPort);
|
joyPortClose(&hJoyPort);
|
||||||
return SDL_SetError("Could not read callibration data.");
|
return SDL_SetError("Could not read callibration data.");
|
||||||
}
|
}
|
||||||
@@ -205,34 +211,35 @@ static int OS2_JoystickInit(void)
|
|||||||
ulDataLen = sizeof(ucNewJoystickMask);
|
ulDataLen = sizeof(ucNewJoystickMask);
|
||||||
rc = DosDevIOCtl(hJoyPort, IOCTL_CAT_USER, GAME_PORT_RESET,
|
rc = DosDevIOCtl(hJoyPort, IOCTL_CAT_USER, GAME_PORT_RESET,
|
||||||
&ucNewJoystickMask, ulDataLen, &ulDataLen, NULL, 0, NULL);
|
&ucNewJoystickMask, ulDataLen, &ulDataLen, NULL, 0, NULL);
|
||||||
if (rc == 0)
|
if (rc == 0) {
|
||||||
{
|
|
||||||
ulDataLen = sizeof(stJoyStatus);
|
ulDataLen = sizeof(stJoyStatus);
|
||||||
rc = DosDevIOCtl(hJoyPort, IOCTL_CAT_USER, GAME_PORT_GET,
|
rc = DosDevIOCtl(hJoyPort, IOCTL_CAT_USER, GAME_PORT_GET,
|
||||||
NULL, 0, NULL, &stJoyStatus, ulDataLen, &ulDataLen);
|
NULL, 0, NULL, &stJoyStatus, ulDataLen, &ulDataLen);
|
||||||
if (rc != 0)
|
if (rc != 0) {
|
||||||
{
|
|
||||||
joyPortClose(&hJoyPort);
|
joyPortClose(&hJoyPort);
|
||||||
return SDL_SetError("Could not call joystick port.");
|
return SDL_SetError("Could not call joystick port.");
|
||||||
}
|
}
|
||||||
ulLastTick = stJoyStatus.ulJs_Ticks;
|
ulLastTick = stJoyStatus.ulJs_Ticks;
|
||||||
while (stJoyStatus.ulJs_Ticks == ulLastTick)
|
while (stJoyStatus.ulJs_Ticks == ulLastTick) {
|
||||||
{
|
|
||||||
rc = DosDevIOCtl(hJoyPort, IOCTL_CAT_USER, GAME_PORT_GET,
|
rc = DosDevIOCtl(hJoyPort, IOCTL_CAT_USER, GAME_PORT_GET,
|
||||||
NULL, 0, NULL, &stJoyStatus, ulDataLen, &ulDataLen);
|
NULL, 0, NULL, &stJoyStatus, ulDataLen, &ulDataLen);
|
||||||
}
|
}
|
||||||
if ((stJoyStatus.ucJs_JoyStickMask & 0x03) > 0) numdevs++;
|
if ((stJoyStatus.ucJs_JoyStickMask & 0x03) > 0) {
|
||||||
if (((stJoyStatus.ucJs_JoyStickMask >> 2) & 0x03) > 0) numdevs++;
|
numdevs++;
|
||||||
|
}
|
||||||
|
if (((stJoyStatus.ucJs_JoyStickMask >> 2) & 0x03) > 0) {
|
||||||
|
numdevs++;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (numdevs > maxdevs) numdevs = maxdevs;
|
if (numdevs > maxdevs) {
|
||||||
|
numdevs = maxdevs;
|
||||||
|
}
|
||||||
|
|
||||||
/* If *any* joystick was detected... Let's configure SDL for them */
|
/* If *any* joystick was detected... Let's configure SDL for them */
|
||||||
if (numdevs > 0)
|
if (numdevs > 0) {
|
||||||
{
|
|
||||||
/* Verify if it is a "user defined" joystick */
|
/* Verify if it is a "user defined" joystick */
|
||||||
if (joyGetEnv(&joycfg))
|
if (joyGetEnv(&joycfg)) {
|
||||||
{
|
|
||||||
GAME_3POS_STRUCT * axis[4];
|
GAME_3POS_STRUCT * axis[4];
|
||||||
axis[0] = &stGameCalib.Ax;
|
axis[0] = &stGameCalib.Ax;
|
||||||
axis[1] = &stGameCalib.Ay;
|
axis[1] = &stGameCalib.Ay;
|
||||||
@@ -246,44 +253,59 @@ static int OS2_JoystickInit(void)
|
|||||||
SYS_JoyData[0].id = 0;
|
SYS_JoyData[0].id = 0;
|
||||||
|
|
||||||
/* Define Number of Axes... up to 4 */
|
/* Define Number of Axes... up to 4 */
|
||||||
if (joycfg.axes>MAX_AXES) joycfg.axes = MAX_AXES;
|
if (joycfg.axes>MAX_AXES) {
|
||||||
|
joycfg.axes = MAX_AXES;
|
||||||
|
}
|
||||||
SYS_JoyData[0].axes = joycfg.axes;
|
SYS_JoyData[0].axes = joycfg.axes;
|
||||||
|
|
||||||
/* Define number of buttons... 8 if 2 axes, 6 if 3 axes and 4 if 4 axes */
|
/* Define number of buttons... 8 if 2 axes, 6 if 3 axes and 4 if 4 axes */
|
||||||
maxbut = MAX_BUTTONS;
|
maxbut = MAX_BUTTONS;
|
||||||
if (joycfg.axes>2) maxbut -= ((joycfg.axes - 2)<<1); /* MAX_BUTTONS - 2*(axes-2) */
|
if (joycfg.axes > 2) {
|
||||||
if (joycfg.buttons > maxbut) joycfg.buttons = maxbut;
|
maxbut -= ((joycfg.axes - 2) << 1); /* MAX_BUTTONS - 2*(axes-2) */
|
||||||
|
}
|
||||||
|
if (joycfg.buttons > maxbut) {
|
||||||
|
joycfg.buttons = maxbut;
|
||||||
|
}
|
||||||
SYS_JoyData[0].buttons = joycfg.buttons;
|
SYS_JoyData[0].buttons = joycfg.buttons;
|
||||||
|
|
||||||
/* Define number of hats */
|
/* Define number of hats */
|
||||||
if (joycfg.hats > MAX_HATS) joycfg.hats = MAX_HATS;
|
if (joycfg.hats > MAX_HATS) {
|
||||||
|
joycfg.hats = MAX_HATS;
|
||||||
|
}
|
||||||
SYS_JoyData[0].hats = joycfg.hats;
|
SYS_JoyData[0].hats = joycfg.hats;
|
||||||
|
|
||||||
/* Define number of balls */
|
/* Define number of balls */
|
||||||
if (joycfg.balls > MAX_BALLS) joycfg.balls = MAX_BALLS;
|
if (joycfg.balls > MAX_BALLS) {
|
||||||
|
joycfg.balls = MAX_BALLS;
|
||||||
|
}
|
||||||
SYS_JoyData[0].balls = joycfg.balls;
|
SYS_JoyData[0].balls = joycfg.balls;
|
||||||
|
|
||||||
/* Initialize Axes Callibration Values */
|
/* Initialize Axes Callibration Values */
|
||||||
for (i=0; i<joycfg.axes; i++)
|
for (i = 0; i < joycfg.axes; i++) {
|
||||||
{
|
|
||||||
SYS_JoyData[0].axes_min[i] = axis[i]->lower;
|
SYS_JoyData[0].axes_min[i] = axis[i]->lower;
|
||||||
SYS_JoyData[0].axes_med[i] = axis[i]->centre;
|
SYS_JoyData[0].axes_med[i] = axis[i]->centre;
|
||||||
SYS_JoyData[0].axes_max[i] = axis[i]->upper;
|
SYS_JoyData[0].axes_max[i] = axis[i]->upper;
|
||||||
}
|
}
|
||||||
/* Initialize Buttons 5 to 8 structures */
|
/* Initialize Buttons 5 to 8 structures */
|
||||||
if (joycfg.buttons>=5) SYS_JoyData[0].buttoncalc[0] = ((axis[2]->lower+axis[3]->centre)>>1);
|
if (joycfg.buttons >=5 ) {
|
||||||
if (joycfg.buttons>=6) SYS_JoyData[0].buttoncalc[1] = ((axis[3]->lower+axis[3]->centre)>>1);
|
SYS_JoyData[0].buttoncalc[0] = ((axis[2]->lower + axis[3]->centre) >> 1);
|
||||||
if (joycfg.buttons>=7) SYS_JoyData[0].buttoncalc[2] = ((axis[2]->upper+axis[3]->centre)>>1);
|
}
|
||||||
if (joycfg.buttons>=8) SYS_JoyData[0].buttoncalc[3] = ((axis[3]->upper+axis[3]->centre)>>1);
|
if (joycfg.buttons >=6 ) {
|
||||||
|
SYS_JoyData[0].buttoncalc[1] = ((axis[3]->lower + axis[3]->centre) >> 1);
|
||||||
|
}
|
||||||
|
if (joycfg.buttons >=7 ) {
|
||||||
|
SYS_JoyData[0].buttoncalc[2] = ((axis[2]->upper + axis[3]->centre) >> 1);
|
||||||
|
}
|
||||||
|
if (joycfg.buttons >=8 ) {
|
||||||
|
SYS_JoyData[0].buttoncalc[3] = ((axis[3]->upper + axis[3]->centre) >> 1);
|
||||||
|
}
|
||||||
/* Intialize Joystick Name */
|
/* Intialize Joystick Name */
|
||||||
SDL_strlcpy (SYS_JoyData[0].szDeviceName,joycfg.name, SDL_arraysize(SYS_JoyData[0].szDeviceName));
|
SDL_strlcpy (SYS_JoyData[0].szDeviceName,joycfg.name, SDL_arraysize(SYS_JoyData[0].szDeviceName));
|
||||||
}
|
}
|
||||||
/* Default Init ... autoconfig */
|
/* Default Init ... autoconfig */
|
||||||
else
|
else {
|
||||||
{
|
|
||||||
/* if two devices were detected... configure as Joy1 4 axis and Joy2 2 axis */
|
/* if two devices were detected... configure as Joy1 4 axis and Joy2 2 axis */
|
||||||
if (numdevs == 2)
|
if (numdevs == 2) {
|
||||||
{
|
|
||||||
/* Define Device 0 as 4 axes, 4 buttons */
|
/* Define Device 0 as 4 axes, 4 buttons */
|
||||||
SYS_JoyData[0].id = 0;
|
SYS_JoyData[0].id = 0;
|
||||||
SYS_JoyData[0].axes = 4;
|
SYS_JoyData[0].axes = 4;
|
||||||
@@ -316,11 +338,9 @@ static int OS2_JoystickInit(void)
|
|||||||
SYS_JoyData[1].axes_max[1] = stGameCalib.By.upper;
|
SYS_JoyData[1].axes_max[1] = stGameCalib.By.upper;
|
||||||
}
|
}
|
||||||
/* One joystick only? */
|
/* One joystick only? */
|
||||||
else
|
else {
|
||||||
{
|
|
||||||
/* If it is joystick A... */
|
/* If it is joystick A... */
|
||||||
if ((stJoyStatus.ucJs_JoyStickMask & 0x03) > 0)
|
if ((stJoyStatus.ucJs_JoyStickMask & 0x03) > 0) {
|
||||||
{
|
|
||||||
/* Define Device 0 as 2 axes, 4 buttons */
|
/* Define Device 0 as 2 axes, 4 buttons */
|
||||||
SYS_JoyData[0].id = 0;
|
SYS_JoyData[0].id = 0;
|
||||||
SYS_JoyData[0].axes = 2;
|
SYS_JoyData[0].axes = 2;
|
||||||
@@ -335,8 +355,7 @@ static int OS2_JoystickInit(void)
|
|||||||
SYS_JoyData[0].axes_max[1] = stGameCalib.Ay.upper;
|
SYS_JoyData[0].axes_max[1] = stGameCalib.Ay.upper;
|
||||||
}
|
}
|
||||||
/* If not, it is joystick B */
|
/* If not, it is joystick B */
|
||||||
else
|
else {
|
||||||
{
|
|
||||||
/* Define Device 1 as 2 axes, 2 buttons */
|
/* Define Device 1 as 2 axes, 2 buttons */
|
||||||
SYS_JoyData[0].id = 1;
|
SYS_JoyData[0].id = 1;
|
||||||
SYS_JoyData[0].axes = 2;
|
SYS_JoyData[0].axes = 2;
|
||||||
@@ -353,16 +372,17 @@ static int OS2_JoystickInit(void)
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* Hack to define Joystick Port Names */
|
/* Hack to define Joystick Port Names */
|
||||||
if (numdevs > maxdevs) numdevs = maxdevs;
|
if (numdevs > maxdevs) {
|
||||||
|
numdevs = maxdevs;
|
||||||
|
}
|
||||||
|
|
||||||
for (i = 0; i < numdevs; i++)
|
for (i = 0; i < numdevs; i++) {
|
||||||
{
|
SDL_snprintf(SYS_JoyData[i].szDeviceName, SDL_arraysize(SYS_JoyData[i].szDeviceName),
|
||||||
SDL_snprintf(SYS_JoyData[i].szDeviceName,
|
|
||||||
SDL_arraysize(SYS_JoyData[i].szDeviceName),
|
|
||||||
"Default Joystick %c", 'A'+SYS_JoyData[i].id);
|
"Default Joystick %c", 'A'+SYS_JoyData[i].id);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Return the number of devices found */
|
/* Return the number of devices found */
|
||||||
numjoysticks = numdevs;
|
numjoysticks = numdevs;
|
||||||
return numdevs;
|
return numdevs;
|
||||||
@@ -422,8 +442,7 @@ static int OS2_JoystickOpen(SDL_Joystick *joystick, int device_index)
|
|||||||
|
|
||||||
/* allocate memory for system specific hardware data */
|
/* allocate memory for system specific hardware data */
|
||||||
joystick->hwdata = (struct joystick_hwdata *) SDL_calloc(1, sizeof(*joystick->hwdata));
|
joystick->hwdata = (struct joystick_hwdata *) SDL_calloc(1, sizeof(*joystick->hwdata));
|
||||||
if (!joystick->hwdata)
|
if (!joystick->hwdata) {
|
||||||
{
|
|
||||||
return SDL_OutOfMemory();
|
return SDL_OutOfMemory();
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -433,16 +452,12 @@ static int OS2_JoystickOpen(SDL_Joystick *joystick, int device_index)
|
|||||||
|
|
||||||
/* Define offsets and scales for all axes */
|
/* Define offsets and scales for all axes */
|
||||||
joystick->hwdata->id = SYS_JoyData[index].id;
|
joystick->hwdata->id = SYS_JoyData[index].id;
|
||||||
for (i = 0; i < MAX_AXES; ++i)
|
for (i = 0; i < MAX_AXES; ++i) {
|
||||||
{
|
if ((i < 2) || i < SYS_JoyData[index].axes) {
|
||||||
if ((i < 2) || i < SYS_JoyData[index].axes)
|
|
||||||
{
|
|
||||||
joystick->hwdata->transaxes[i].offset = ((SDL_JOYSTICK_AXIS_MAX + SDL_JOYSTICK_AXIS_MIN)>>1) - SYS_JoyData[index].axes_med[i];
|
joystick->hwdata->transaxes[i].offset = ((SDL_JOYSTICK_AXIS_MAX + SDL_JOYSTICK_AXIS_MIN)>>1) - SYS_JoyData[index].axes_med[i];
|
||||||
joystick->hwdata->transaxes[i].scale1 = (float)SDL_abs((SDL_JOYSTICK_AXIS_MIN/SYS_JoyData[index].axes_min[i]));
|
joystick->hwdata->transaxes[i].scale1 = (float)SDL_abs((SDL_JOYSTICK_AXIS_MIN/SYS_JoyData[index].axes_min[i]));
|
||||||
joystick->hwdata->transaxes[i].scale2 = (float)SDL_abs((SDL_JOYSTICK_AXIS_MAX/SYS_JoyData[index].axes_max[i]));
|
joystick->hwdata->transaxes[i].scale2 = (float)SDL_abs((SDL_JOYSTICK_AXIS_MAX/SYS_JoyData[index].axes_max[i]));
|
||||||
}
|
} else {
|
||||||
else
|
|
||||||
{
|
|
||||||
joystick->hwdata->transaxes[i].offset = 0;
|
joystick->hwdata->transaxes[i].offset = 0;
|
||||||
joystick->hwdata->transaxes[i].scale1 = 1.0f; /* Just in case */
|
joystick->hwdata->transaxes[i].scale1 = 1.0f; /* Just in case */
|
||||||
joystick->hwdata->transaxes[i].scale2 = 1.0f; /* Just in case */
|
joystick->hwdata->transaxes[i].scale2 = 1.0f; /* Just in case */
|
||||||
@@ -514,8 +529,7 @@ static void OS2_JoystickUpdate(SDL_Joystick *joystick)
|
|||||||
ulDataLen = sizeof(stGameStatus);
|
ulDataLen = sizeof(stGameStatus);
|
||||||
rc = DosDevIOCtl(hJoyPort, IOCTL_CAT_USER, GAME_GET_STATUS,
|
rc = DosDevIOCtl(hJoyPort, IOCTL_CAT_USER, GAME_GET_STATUS,
|
||||||
NULL, 0, NULL, &stGameStatus, ulDataLen, &ulDataLen);
|
NULL, 0, NULL, &stGameStatus, ulDataLen, &ulDataLen);
|
||||||
if (rc != 0)
|
if (rc != 0) {
|
||||||
{
|
|
||||||
SDL_SetError("Could not read joystick status.");
|
SDL_SetError("Could not read joystick status.");
|
||||||
return; /* Could not read data */
|
return; /* Could not read data */
|
||||||
}
|
}
|
||||||
@@ -525,18 +539,22 @@ static void OS2_JoystickUpdate(SDL_Joystick *joystick)
|
|||||||
|
|
||||||
/* joystick motion events */
|
/* joystick motion events */
|
||||||
|
|
||||||
if (SYS_JoyData[index].id == 0)
|
if (SYS_JoyData[index].id == 0) {
|
||||||
{
|
|
||||||
pos[0] = stGameStatus.curdata.A.x;
|
pos[0] = stGameStatus.curdata.A.x;
|
||||||
pos[1] = stGameStatus.curdata.A.y;
|
pos[1] = stGameStatus.curdata.A.y;
|
||||||
if (SYS_JoyData[index].axes >= 3) pos[2] = stGameStatus.curdata.B.x;
|
if (SYS_JoyData[index].axes >= 3) {
|
||||||
else pos[2] = 0;
|
pos[2] = stGameStatus.curdata.B.x;
|
||||||
if (SYS_JoyData[index].axes >= 4) pos[3] = stGameStatus.curdata.B.y;
|
} else {
|
||||||
else pos[3] = 0;
|
pos[2] = 0;
|
||||||
|
}
|
||||||
|
if (SYS_JoyData[index].axes >= 4) {
|
||||||
|
pos[3] = stGameStatus.curdata.B.y;
|
||||||
|
} else {
|
||||||
|
pos[3] = 0;
|
||||||
|
}
|
||||||
/* OS/2 basic drivers do not support more than 4 axes joysticks */
|
/* OS/2 basic drivers do not support more than 4 axes joysticks */
|
||||||
}
|
}
|
||||||
else if (SYS_JoyData[index].id == 1)
|
else if (SYS_JoyData[index].id == 1) {
|
||||||
{
|
|
||||||
pos[0] = stGameStatus.curdata.B.x;
|
pos[0] = stGameStatus.curdata.B.x;
|
||||||
pos[1] = stGameStatus.curdata.B.y;
|
pos[1] = stGameStatus.curdata.B.y;
|
||||||
pos[2] = 0;
|
pos[2] = 0;
|
||||||
@@ -545,41 +563,42 @@ static void OS2_JoystickUpdate(SDL_Joystick *joystick)
|
|||||||
|
|
||||||
/* Corrects the movements using the callibration */
|
/* Corrects the movements using the callibration */
|
||||||
transaxes = joystick->hwdata->transaxes;
|
transaxes = joystick->hwdata->transaxes;
|
||||||
for (i = 0; i < joystick->naxes; i++)
|
for (i = 0; i < joystick->naxes; i++) {
|
||||||
{
|
|
||||||
value = pos[i] + transaxes[i].offset;
|
value = pos[i] + transaxes[i].offset;
|
||||||
if (value < 0)
|
if (value < 0) {
|
||||||
{
|
|
||||||
value *= transaxes[i].scale1;
|
value *= transaxes[i].scale1;
|
||||||
if (value > 0) value = SDL_JOYSTICK_AXIS_MIN;
|
if (value > 0) {
|
||||||
|
value = SDL_JOYSTICK_AXIS_MIN;
|
||||||
}
|
}
|
||||||
else
|
} else {
|
||||||
{
|
|
||||||
value *= transaxes[i].scale2;
|
value *= transaxes[i].scale2;
|
||||||
if (value < 0) value = SDL_JOYSTICK_AXIS_MAX;
|
if (value < 0) {
|
||||||
|
value = SDL_JOYSTICK_AXIS_MAX;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
SDL_PrivateJoystickAxis(joystick, (Uint8)i, (Sint16)value);
|
SDL_PrivateJoystickAxis(joystick, (Uint8)i, (Sint16)value);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* joystick button A to D events */
|
/* joystick button A to D events */
|
||||||
if (SYS_JoyData[index].id == 1) corr = 2;
|
if (SYS_JoyData[index].id == 1) {
|
||||||
else corr = 0;
|
corr = 2;
|
||||||
|
} else {
|
||||||
|
corr = 0;
|
||||||
|
}
|
||||||
normbut = 4; /* Number of normal buttons */
|
normbut = 4; /* Number of normal buttons */
|
||||||
if (joystick->nbuttons < normbut) normbut = joystick->nbuttons;
|
if (joystick->nbuttons < normbut) {
|
||||||
for (i = corr; (i-corr) < normbut; ++i)
|
normbut = joystick->nbuttons;
|
||||||
{
|
}
|
||||||
|
for (i = corr; (i-corr) < normbut; ++i) {
|
||||||
/*
|
/*
|
||||||
Button A: 1110 0000
|
Button A: 1110 0000
|
||||||
Button B: 1101 0000
|
Button B: 1101 0000
|
||||||
Button C: 1011 0000
|
Button C: 1011 0000
|
||||||
Button D: 0111 0000
|
Button D: 0111 0000
|
||||||
*/
|
*/
|
||||||
if ((~stGameStatus.curdata.butMask)>>4 & JOY_BUTTON_FLAG(i))
|
if ((~stGameStatus.curdata.butMask)>>4 & JOY_BUTTON_FLAG(i)) {
|
||||||
{
|
|
||||||
SDL_PrivateJoystickButton(joystick, (Uint8)(i-corr), SDL_PRESSED);
|
SDL_PrivateJoystickButton(joystick, (Uint8)(i-corr), SDL_PRESSED);
|
||||||
}
|
} else {
|
||||||
else
|
|
||||||
{
|
|
||||||
SDL_PrivateJoystickButton(joystick, (Uint8)(i-corr), SDL_RELEASED);
|
SDL_PrivateJoystickButton(joystick, (Uint8)(i-corr), SDL_RELEASED);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -591,25 +610,33 @@ static void OS2_JoystickUpdate(SDL_Joystick *joystick)
|
|||||||
Button G: Axis 2 X Right
|
Button G: Axis 2 X Right
|
||||||
Button H: Axis 2 Y Down
|
Button H: Axis 2 Y Down
|
||||||
*/
|
*/
|
||||||
if (joystick->nbuttons >= 5)
|
if (joystick->nbuttons >= 5) {
|
||||||
{
|
if (stGameStatus.curdata.B.x < SYS_JoyData[index].buttoncalc[0]) {
|
||||||
if (stGameStatus.curdata.B.x < SYS_JoyData[index].buttoncalc[0]) SDL_PrivateJoystickButton(joystick, (Uint8)4, SDL_PRESSED);
|
SDL_PrivateJoystickButton(joystick, (Uint8)4, SDL_PRESSED);
|
||||||
else SDL_PrivateJoystickButton(joystick, (Uint8)4, SDL_RELEASED);
|
} else {
|
||||||
|
SDL_PrivateJoystickButton(joystick, (Uint8)4, SDL_RELEASED);
|
||||||
}
|
}
|
||||||
if (joystick->nbuttons >= 6)
|
|
||||||
{
|
|
||||||
if (stGameStatus.curdata.B.y < SYS_JoyData[index].buttoncalc[1]) SDL_PrivateJoystickButton(joystick, (Uint8)5, SDL_PRESSED);
|
|
||||||
else SDL_PrivateJoystickButton(joystick, (Uint8)5, SDL_RELEASED);
|
|
||||||
}
|
}
|
||||||
if (joystick->nbuttons >= 7)
|
if (joystick->nbuttons >= 6) {
|
||||||
{
|
if (stGameStatus.curdata.B.y < SYS_JoyData[index].buttoncalc[1]) {
|
||||||
if (stGameStatus.curdata.B.x > SYS_JoyData[index].buttoncalc[2]) SDL_PrivateJoystickButton(joystick, (Uint8)6, SDL_PRESSED);
|
SDL_PrivateJoystickButton(joystick, (Uint8)5, SDL_PRESSED);
|
||||||
else SDL_PrivateJoystickButton(joystick, (Uint8)6, SDL_RELEASED);
|
} else {
|
||||||
|
SDL_PrivateJoystickButton(joystick, (Uint8)5, SDL_RELEASED);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (joystick->nbuttons >= 7) {
|
||||||
|
if (stGameStatus.curdata.B.x > SYS_JoyData[index].buttoncalc[2]) {
|
||||||
|
SDL_PrivateJoystickButton(joystick, (Uint8)6, SDL_PRESSED);
|
||||||
|
} else {
|
||||||
|
SDL_PrivateJoystickButton(joystick, (Uint8)6, SDL_RELEASED);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (joystick->nbuttons >= 8) {
|
||||||
|
if (stGameStatus.curdata.B.y > SYS_JoyData[index].buttoncalc[3]) {
|
||||||
|
SDL_PrivateJoystickButton(joystick, (Uint8)7, SDL_PRESSED);
|
||||||
|
} else {
|
||||||
|
SDL_PrivateJoystickButton(joystick, (Uint8)7, SDL_RELEASED);
|
||||||
}
|
}
|
||||||
if (joystick->nbuttons >= 8)
|
|
||||||
{
|
|
||||||
if (stGameStatus.curdata.B.y > SYS_JoyData[index].buttoncalc[3]) SDL_PrivateJoystickButton(joystick, (Uint8)7, SDL_PRESSED);
|
|
||||||
else SDL_PrivateJoystickButton(joystick, (Uint8)7, SDL_RELEASED);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/* joystick hat events */
|
/* joystick hat events */
|
||||||
@@ -656,13 +683,14 @@ static int joyPortOpen(HFILE * hGame)
|
|||||||
ULONG ulDataLen; /* Size of version data */
|
ULONG ulDataLen; /* Size of version data */
|
||||||
|
|
||||||
/* Verifies if joyport is not already open... */
|
/* Verifies if joyport is not already open... */
|
||||||
if (*hGame != NULLHANDLE) return 0;
|
if (*hGame != NULLHANDLE) {
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
/* Open GAME$ for read */
|
/* Open GAME$ for read */
|
||||||
rc = DosOpen("GAME$ ", hGame, &ulAction, 0, FILE_READONLY,
|
rc = DosOpen("GAME$ ", hGame, &ulAction, 0, FILE_READONLY,
|
||||||
FILE_OPEN, OPEN_ACCESS_READONLY | OPEN_SHARE_DENYNONE, NULL);
|
FILE_OPEN, OPEN_ACCESS_READONLY | OPEN_SHARE_DENYNONE, NULL);
|
||||||
if (rc != 0)
|
if (rc != 0) {
|
||||||
{
|
|
||||||
return SDL_SetError("Could not open Joystick Port.");
|
return SDL_SetError("Could not open Joystick Port.");
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -671,16 +699,15 @@ static int joyPortOpen(HFILE * hGame)
|
|||||||
ulDataLen = sizeof(ulVersion);
|
ulDataLen = sizeof(ulVersion);
|
||||||
rc = DosDevIOCtl(*hGame, IOCTL_CAT_USER, GAME_GET_VERSION,
|
rc = DosDevIOCtl(*hGame, IOCTL_CAT_USER, GAME_GET_VERSION,
|
||||||
NULL, 0, NULL, &ulVersion, ulDataLen, &ulDataLen);
|
NULL, 0, NULL, &ulVersion, ulDataLen, &ulDataLen);
|
||||||
if (rc != 0)
|
if (rc != 0) {
|
||||||
{
|
|
||||||
joyPortClose(hGame);
|
joyPortClose(hGame);
|
||||||
return SDL_SetError("Could not get Joystick Driver version.");
|
return SDL_SetError("Could not get Joystick Driver version.");
|
||||||
}
|
}
|
||||||
if (ulVersion < 0x20)
|
if (ulVersion < 0x20) {
|
||||||
{
|
|
||||||
joyPortClose(hGame);
|
joyPortClose(hGame);
|
||||||
return SDL_SetError("Driver too old. At least IBM driver version 2.0 required.");
|
return SDL_SetError("Driver too old. At least IBM driver version 2.0 required.");
|
||||||
}
|
}
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -689,7 +716,9 @@ static int joyPortOpen(HFILE * hGame)
|
|||||||
/****************************/
|
/****************************/
|
||||||
static void joyPortClose(HFILE * hGame)
|
static void joyPortClose(HFILE * hGame)
|
||||||
{
|
{
|
||||||
if (*hGame != NULLHANDLE) DosClose(*hGame);
|
if (*hGame != NULLHANDLE) {
|
||||||
|
DosClose(*hGame);
|
||||||
|
}
|
||||||
*hGame = NULLHANDLE;
|
*hGame = NULLHANDLE;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -726,24 +755,33 @@ static int joyGetEnv(struct _joycfg * joydata)
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* Now get the number of axes */
|
/* Now get the number of axes */
|
||||||
while (*joyenv == ' ' && *joyenv != 0) joyenv++; /* jump spaces... */
|
while (*joyenv == ' ' && *joyenv != 0) {
|
||||||
|
joyenv++; /* jump spaces... */
|
||||||
|
}
|
||||||
joyenv += joyGetData(joyenv,tempnumber,' ',sizeof(tempnumber));
|
joyenv += joyGetData(joyenv,tempnumber,' ',sizeof(tempnumber));
|
||||||
joydata->axes = SDL_atoi(tempnumber);
|
joydata->axes = SDL_atoi(tempnumber);
|
||||||
|
|
||||||
/* Now get the number of buttons */
|
/* Now get the number of buttons */
|
||||||
while (*joyenv == ' ' && *joyenv != 0) joyenv++; /* jump spaces... */
|
while (*joyenv == ' ' && *joyenv != 0) {
|
||||||
|
joyenv++; /* jump spaces... */
|
||||||
|
}
|
||||||
joyenv += joyGetData(joyenv,tempnumber,' ',sizeof(tempnumber));
|
joyenv += joyGetData(joyenv,tempnumber,' ',sizeof(tempnumber));
|
||||||
joydata->buttons = SDL_atoi(tempnumber);
|
joydata->buttons = SDL_atoi(tempnumber);
|
||||||
|
|
||||||
/* Now get the number of hats */
|
/* Now get the number of hats */
|
||||||
while (*joyenv == ' ' && *joyenv != 0) joyenv++; /* jump spaces... */
|
while (*joyenv == ' ' && *joyenv != 0) {
|
||||||
|
joyenv++; /* jump spaces... */
|
||||||
|
}
|
||||||
joyenv += joyGetData(joyenv,tempnumber,' ',sizeof(tempnumber));
|
joyenv += joyGetData(joyenv,tempnumber,' ',sizeof(tempnumber));
|
||||||
joydata->hats = SDL_atoi(tempnumber);
|
joydata->hats = SDL_atoi(tempnumber);
|
||||||
|
|
||||||
/* Now get the number of balls */
|
/* Now get the number of balls */
|
||||||
while (*joyenv==' ' && *joyenv != 0) joyenv++; /* jump spaces... */
|
while (*joyenv==' ' && *joyenv != 0) {
|
||||||
|
joyenv++; /* jump spaces... */
|
||||||
|
}
|
||||||
joyenv += joyGetData(joyenv,tempnumber,' ',sizeof(tempnumber));
|
joyenv += joyGetData(joyenv,tempnumber,' ',sizeof(tempnumber));
|
||||||
joydata->balls = SDL_atoi(tempnumber);
|
joydata->balls = SDL_atoi(tempnumber);
|
||||||
|
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -757,18 +795,15 @@ static int joyGetData(const char *joyenv, char *name, char stopchar, size_t maxc
|
|||||||
int chcnt = 0; /* Count how many characters where copied */
|
int chcnt = 0; /* Count how many characters where copied */
|
||||||
|
|
||||||
nameptr = name;
|
nameptr = name;
|
||||||
while (*joyenv!=stopchar && *joyenv!=0)
|
while (*joyenv!=stopchar && *joyenv != 0) {
|
||||||
{
|
if (nameptr < (name + (maxchars-1))) {
|
||||||
if (nameptr < (name + (maxchars-1)))
|
|
||||||
{
|
|
||||||
*nameptr = *joyenv; /* Only copy if smaller than maximum */
|
*nameptr = *joyenv; /* Only copy if smaller than maximum */
|
||||||
nameptr++;
|
nameptr++;
|
||||||
}
|
}
|
||||||
chcnt++;
|
chcnt++;
|
||||||
joyenv++;
|
joyenv++;
|
||||||
}
|
}
|
||||||
if (*joyenv == stopchar)
|
if (*joyenv == stopchar) {
|
||||||
{
|
|
||||||
joyenv++; /* Jump stopchar */
|
joyenv++; /* Jump stopchar */
|
||||||
chcnt++;
|
chcnt++;
|
||||||
}
|
}
|
||||||
@@ -776,8 +811,7 @@ static int joyGetData(const char *joyenv, char *name, char stopchar, size_t maxc
|
|||||||
return chcnt;
|
return chcnt;
|
||||||
}
|
}
|
||||||
|
|
||||||
SDL_JoystickDriver SDL_OS2_JoystickDriver =
|
SDL_JoystickDriver SDL_OS2_JoystickDriver = {
|
||||||
{
|
|
||||||
OS2_JoystickInit,
|
OS2_JoystickInit,
|
||||||
OS2_NumJoysticks,
|
OS2_NumJoysticks,
|
||||||
OS2_JoystickDetect,
|
OS2_JoystickDetect,
|
||||||
|
|||||||
@@ -22,6 +22,7 @@ standard_guid_pattern = re.compile(r'^([0-9a-fA-F]{4})([0-9a-fA-F]{2})([0-9a-fA-
|
|||||||
invalid_controllers = (
|
invalid_controllers = (
|
||||||
('0079', '0006', '0000'), # DragonRise Inc. Generic USB Joystick
|
('0079', '0006', '0000'), # DragonRise Inc. Generic USB Joystick
|
||||||
('0079', '0006', '6120'), # DragonRise Inc. Generic USB Joystick
|
('0079', '0006', '6120'), # DragonRise Inc. Generic USB Joystick
|
||||||
|
('04b4', '2412', 'c529'), # Flydigi Vader 2, Vader 2 Pro, Apex 2, Apex 3
|
||||||
('16c0', '05e1', '0000'), # Xinmotek Controller
|
('16c0', '05e1', '0000'), # Xinmotek Controller
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|||||||
@@ -9,8 +9,8 @@ LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US
|
|||||||
//
|
//
|
||||||
|
|
||||||
VS_VERSION_INFO VERSIONINFO
|
VS_VERSION_INFO VERSIONINFO
|
||||||
FILEVERSION 2,28,2,0
|
FILEVERSION 2,28,3,0
|
||||||
PRODUCTVERSION 2,28,2,0
|
PRODUCTVERSION 2,28,3,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, 28, 2, 0\0"
|
VALUE "FileVersion", "2, 28, 3, 0\0"
|
||||||
VALUE "InternalName", "SDL\0"
|
VALUE "InternalName", "SDL\0"
|
||||||
VALUE "LegalCopyright", "Copyright (C) 2023 Sam Lantinga\0"
|
VALUE "LegalCopyright", "Copyright (C) 2023 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, 28, 2, 0\0"
|
VALUE "ProductVersion", "2, 28, 3, 0\0"
|
||||||
END
|
END
|
||||||
END
|
END
|
||||||
BLOCK "VarFileInfo"
|
BLOCK "VarFileInfo"
|
||||||
|
|||||||
@@ -1654,8 +1654,22 @@ static SDL_Renderer *METAL_CreateRenderer(SDL_Window * window, Uint32 flags)
|
|||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
// !!! FIXME: MTLCopyAllDevices() can find other GPUs on macOS...
|
#ifdef __MACOSX__
|
||||||
|
if (SDL_GetHintBoolean(SDL_HINT_RENDER_METAL_PREFER_LOW_POWER_DEVICE, SDL_TRUE)) {
|
||||||
|
NSArray<id<MTLDevice>> *devices = MTLCopyAllDevices();
|
||||||
|
|
||||||
|
for (id<MTLDevice> device in devices) {
|
||||||
|
if (device.isLowPower) {
|
||||||
|
mtldevice = device;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
|
if (mtldevice == nil) {
|
||||||
mtldevice = MTLCreateSystemDefaultDevice();
|
mtldevice = MTLCreateSystemDefaultDevice();
|
||||||
|
}
|
||||||
|
|
||||||
if (mtldevice == nil) {
|
if (mtldevice == nil) {
|
||||||
SDL_free(renderer);
|
SDL_free(renderer);
|
||||||
|
|||||||
@@ -1190,7 +1190,9 @@ int SDL_vsscanf(const char *text, const char *fmt, va_list ap)
|
|||||||
suppress = SDL_TRUE;
|
suppress = SDL_TRUE;
|
||||||
break;
|
break;
|
||||||
case 'h':
|
case 'h':
|
||||||
if (inttype > DO_SHORT) {
|
if (inttype == DO_INT) {
|
||||||
|
inttype = DO_SHORT;
|
||||||
|
} else if (inttype > DO_SHORT) {
|
||||||
++inttype;
|
++inttype;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|||||||
@@ -37,34 +37,30 @@ typedef struct
|
|||||||
const char *libname;
|
const char *libname;
|
||||||
} waylanddynlib;
|
} waylanddynlib;
|
||||||
|
|
||||||
#ifndef SDL_VIDEO_DRIVER_WAYLAND_DYNAMIC_EGL
|
|
||||||
#define SDL_VIDEO_DRIVER_WAYLAND_DYNAMIC_EGL NULL
|
|
||||||
#endif
|
|
||||||
#ifndef SDL_VIDEO_DRIVER_WAYLAND_DYNAMIC_CURSOR
|
|
||||||
#define SDL_VIDEO_DRIVER_WAYLAND_DYNAMIC_CURSOR NULL
|
|
||||||
#endif
|
|
||||||
#ifndef SDL_VIDEO_DRIVER_WAYLAND_DYNAMIC_XKBCOMMON
|
|
||||||
#define SDL_VIDEO_DRIVER_WAYLAND_DYNAMIC_XKBCOMMON NULL
|
|
||||||
#endif
|
|
||||||
#ifndef SDL_VIDEO_DRIVER_WAYLAND_DYNAMIC_LIBDECOR
|
|
||||||
#define SDL_VIDEO_DRIVER_WAYLAND_DYNAMIC_LIBDECOR NULL
|
|
||||||
#endif
|
|
||||||
|
|
||||||
static waylanddynlib waylandlibs[] = {
|
static waylanddynlib waylandlibs[] = {
|
||||||
{ NULL, SDL_VIDEO_DRIVER_WAYLAND_DYNAMIC },
|
{ NULL, SDL_VIDEO_DRIVER_WAYLAND_DYNAMIC },
|
||||||
|
#ifdef SDL_VIDEO_DRIVER_WAYLAND_DYNAMIC_EGL
|
||||||
{ NULL, SDL_VIDEO_DRIVER_WAYLAND_DYNAMIC_EGL },
|
{ NULL, SDL_VIDEO_DRIVER_WAYLAND_DYNAMIC_EGL },
|
||||||
|
#endif
|
||||||
|
#ifdef SDL_VIDEO_DRIVER_WAYLAND_DYNAMIC_CURSOR
|
||||||
{ NULL, SDL_VIDEO_DRIVER_WAYLAND_DYNAMIC_CURSOR },
|
{ NULL, SDL_VIDEO_DRIVER_WAYLAND_DYNAMIC_CURSOR },
|
||||||
|
#endif
|
||||||
|
#ifdef SDL_VIDEO_DRIVER_WAYLAND_DYNAMIC_XKBCOMMON
|
||||||
{ NULL, SDL_VIDEO_DRIVER_WAYLAND_DYNAMIC_XKBCOMMON },
|
{ NULL, SDL_VIDEO_DRIVER_WAYLAND_DYNAMIC_XKBCOMMON },
|
||||||
{ NULL, SDL_VIDEO_DRIVER_WAYLAND_DYNAMIC_LIBDECOR }
|
#endif
|
||||||
|
#ifdef SDL_VIDEO_DRIVER_WAYLAND_DYNAMIC_LIBDECOR
|
||||||
|
{ NULL, SDL_VIDEO_DRIVER_WAYLAND_DYNAMIC_LIBDECOR },
|
||||||
|
#endif
|
||||||
|
{ NULL, NULL }
|
||||||
};
|
};
|
||||||
|
|
||||||
static void *WAYLAND_GetSym(const char *fnname, int *pHasModule, SDL_bool required)
|
static void *WAYLAND_GetSym(const char *fnname, int *pHasModule, SDL_bool required)
|
||||||
{
|
{
|
||||||
int i;
|
|
||||||
void *fn = NULL;
|
void *fn = NULL;
|
||||||
for (i = 0; i < SDL_TABLESIZE(waylandlibs); i++) {
|
waylanddynlib *dynlib;
|
||||||
if (waylandlibs[i].lib != NULL) {
|
for (dynlib = waylandlibs; dynlib->libname; dynlib++) {
|
||||||
fn = SDL_LoadFunction(waylandlibs[i].lib, fnname);
|
if (dynlib->lib != NULL) {
|
||||||
|
fn = SDL_LoadFunction(dynlib->lib, fnname);
|
||||||
if (fn != NULL) {
|
if (fn != NULL) {
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
@@ -72,10 +68,11 @@ static void *WAYLAND_GetSym(const char *fnname, int *pHasModule, SDL_bool requir
|
|||||||
}
|
}
|
||||||
|
|
||||||
#if DEBUG_DYNAMIC_WAYLAND
|
#if DEBUG_DYNAMIC_WAYLAND
|
||||||
if (fn != NULL)
|
if (fn != NULL) {
|
||||||
SDL_Log("WAYLAND: Found '%s' in %s (%p)\n", fnname, waylandlibs[i].libname, fn);
|
SDL_Log("WAYLAND: Found '%s' in %s (%p)\n", fnname, dynlib->libname, fn);
|
||||||
else
|
} else {
|
||||||
SDL_Log("WAYLAND: Symbol '%s' NOT FOUND!\n", fnname);
|
SDL_Log("WAYLAND: Symbol '%s' NOT FOUND!\n", fnname);
|
||||||
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
if (fn == NULL && required) {
|
if (fn == NULL && required) {
|
||||||
|
|||||||
+1
-1
@@ -1,4 +1,4 @@
|
|||||||
cmake_minimum_required(VERSION 3.0)
|
cmake_minimum_required(VERSION 3.0...3.5)
|
||||||
project(SDL2_test)
|
project(SDL2_test)
|
||||||
|
|
||||||
include(CheckCCompilerFlag)
|
include(CheckCCompilerFlag)
|
||||||
|
|||||||
@@ -102,8 +102,8 @@ const char *_nonRGBPixelFormatsVerbose[] = {
|
|||||||
/* Definition of some invalid formats for negative tests */
|
/* Definition of some invalid formats for negative tests */
|
||||||
const int _numInvalidPixelFormats = 2;
|
const int _numInvalidPixelFormats = 2;
|
||||||
Uint32 _invalidPixelFormats[] = {
|
Uint32 _invalidPixelFormats[] = {
|
||||||
0xfffffffe,
|
SDL_DEFINE_PIXELFORMAT(SDL_PIXELTYPE_PACKED32, SDL_PACKEDORDER_ABGR, SDL_PACKEDLAYOUT_1010102 + 1, 32, 4),
|
||||||
0xffffffff
|
SDL_DEFINE_PIXELFORMAT(SDL_PIXELTYPE_PACKED32, SDL_PACKEDORDER_ABGR, SDL_PACKEDLAYOUT_1010102 + 2, 32, 4)
|
||||||
};
|
};
|
||||||
const char *_invalidPixelFormatsVerbose[] = {
|
const char *_invalidPixelFormatsVerbose[] = {
|
||||||
"SDL_PIXELFORMAT_UNKNOWN",
|
"SDL_PIXELFORMAT_UNKNOWN",
|
||||||
@@ -121,7 +121,6 @@ const char *_invalidPixelFormatsVerbose[] = {
|
|||||||
int pixels_allocFreeFormat(void *arg)
|
int pixels_allocFreeFormat(void *arg)
|
||||||
{
|
{
|
||||||
const char *unknownFormat = "SDL_PIXELFORMAT_UNKNOWN";
|
const char *unknownFormat = "SDL_PIXELFORMAT_UNKNOWN";
|
||||||
const char *expectedError = "Parameter 'format' is invalid";
|
|
||||||
const char *error;
|
const char *error;
|
||||||
int i;
|
int i;
|
||||||
Uint32 format;
|
Uint32 format;
|
||||||
@@ -172,6 +171,7 @@ int pixels_allocFreeFormat(void *arg)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#if 0 /* This succeeds for SDL3, but we don't expect SDL2 applications to call SDL_AllocFormat() for FOURCC formats directly */
|
||||||
/* Non-RGB formats */
|
/* Non-RGB formats */
|
||||||
for (i = 0; i < _numNonRGBPixelFormats; i++) {
|
for (i = 0; i < _numNonRGBPixelFormats; i++) {
|
||||||
format = _nonRGBPixelFormats[i];
|
format = _nonRGBPixelFormats[i];
|
||||||
@@ -182,6 +182,7 @@ int pixels_allocFreeFormat(void *arg)
|
|||||||
SDLTest_AssertPass("Call to SDL_AllocFormat()");
|
SDLTest_AssertPass("Call to SDL_AllocFormat()");
|
||||||
SDLTest_AssertCheck(result == NULL, "Verify result is NULL");
|
SDLTest_AssertCheck(result == NULL, "Verify result is NULL");
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
/* Negative cases */
|
/* Negative cases */
|
||||||
|
|
||||||
@@ -196,23 +197,6 @@ int pixels_allocFreeFormat(void *arg)
|
|||||||
error = SDL_GetError();
|
error = SDL_GetError();
|
||||||
SDLTest_AssertPass("Call to SDL_GetError()");
|
SDLTest_AssertPass("Call to SDL_GetError()");
|
||||||
SDLTest_AssertCheck(error != NULL, "Validate that error message was not NULL");
|
SDLTest_AssertCheck(error != NULL, "Validate that error message was not NULL");
|
||||||
if (error != NULL) {
|
|
||||||
SDLTest_AssertCheck(SDL_strcmp(error, expectedError) == 0,
|
|
||||||
"Validate error message, expected: '%s', got: '%s'", expectedError, error);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/* Invalid free pointer */
|
|
||||||
SDL_ClearError();
|
|
||||||
SDLTest_AssertPass("Call to SDL_ClearError()");
|
|
||||||
SDL_FreeFormat(NULL);
|
|
||||||
SDLTest_AssertPass("Call to SDL_FreeFormat(NULL)");
|
|
||||||
error = SDL_GetError();
|
|
||||||
SDLTest_AssertPass("Call to SDL_GetError()");
|
|
||||||
SDLTest_AssertCheck(error != NULL, "Validate that error message was not NULL");
|
|
||||||
if (error != NULL) {
|
|
||||||
SDLTest_AssertCheck(SDL_strcmp(error, expectedError) == 0,
|
|
||||||
"Validate error message, expected: '%s', got: '%s'", expectedError, error);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return TEST_COMPLETED;
|
return TEST_COMPLETED;
|
||||||
@@ -310,7 +294,6 @@ int pixels_getPixelFormatName(void *arg)
|
|||||||
int pixels_allocFreePalette(void *arg)
|
int pixels_allocFreePalette(void *arg)
|
||||||
{
|
{
|
||||||
const char *expectedError1 = "Parameter 'ncolors' is invalid";
|
const char *expectedError1 = "Parameter 'ncolors' is invalid";
|
||||||
const char *expectedError2 = "Parameter 'palette' is invalid";
|
|
||||||
const char *error;
|
const char *error;
|
||||||
int variation;
|
int variation;
|
||||||
int i;
|
int i;
|
||||||
@@ -375,19 +358,6 @@ int pixels_allocFreePalette(void *arg)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Invalid free pointer */
|
|
||||||
SDL_ClearError();
|
|
||||||
SDLTest_AssertPass("Call to SDL_ClearError()");
|
|
||||||
SDL_FreePalette(NULL);
|
|
||||||
SDLTest_AssertPass("Call to SDL_FreePalette(NULL)");
|
|
||||||
error = SDL_GetError();
|
|
||||||
SDLTest_AssertPass("Call to SDL_GetError()");
|
|
||||||
SDLTest_AssertCheck(error != NULL, "Validate that error message was not NULL");
|
|
||||||
if (error != NULL) {
|
|
||||||
SDLTest_AssertCheck(SDL_strcmp(error, expectedError2) == 0,
|
|
||||||
"Validate error message, expected: '%s', got: '%s'", expectedError2, error);
|
|
||||||
}
|
|
||||||
|
|
||||||
return TEST_COMPLETED;
|
return TEST_COMPLETED;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in new issue
Block a user