Vendor dependencies for 0.3.0 release

This commit is contained in:
2025-09-27 10:29:08 -05:00
parent 0c8d39d483
commit 82ab7f317b
26803 changed files with 16134934 additions and 0 deletions

View File

@@ -0,0 +1,17 @@
Copyright (C) 1997-2022 Sam Lantinga <slouken@libsdl.org>
This software is provided 'as-is', without any express or implied
warranty. In no event will the authors be held liable for any damages
arising from the use of this software.
Permission is granted to anyone to use this software for any purpose,
including commercial applications, and to alter it and redistribute it
freely, subject to the following restrictions:
1. The origin of this software must not be misrepresented; you must not
claim that you wrote the original software. If you use this software
in a product, an acknowledgment in the product documentation would be
appreciated but is not required.
2. Altered source versions must be plainly marked as such, and must not be
misrepresented as being the original software.
3. This notice may not be removed or altered from any source distribution.

View File

@@ -0,0 +1,57 @@
# SDL_GameControllerDB
A community sourced database of game controller mappings to be used with SDL2 and SDL3 Game Controller functionality.
# Usage
Download gamecontrollerdb.txt, place it in your app's directory and load it.
SDL2:
```c
SDL_GameControllerAddMappingsFromFile("gamecontrollerdb.txt");
```
SDL3:
```c
SDL_AddGamepadMappingsFromFile("gamecontrollerdb.txt");
```
The database is compatible with SDL v2.0.10 and newer.
## Create New Mappings
A mapping looks like this:
```
030000004c050000c405000000010000,PS4 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,platform:Mac OS X,
```
It includes controller GUID (`030000004c050000c405000000010000`), a name (`PS4 Controller`), button / axis mappings (`leftshoulder:b4`) and a platform (`platform:Mac OS X`).
Please make sure to check that the name is a good description of the controller. If relevant, include the controller's name and model number.
## Mapping Guide
![SDL Game Controller Mapping Guide](mapping_guide.png)
## Mapping Tools
There are a few different tools that let you create mappings.
### [SDL2 Gamepad Tool](http://www.generalarcade.com/gamepadtool/)
Third party cross-platform tool with GUI (Windows, macOS and Linux)
#### Note: While convenient, this tool has fallen out of date as SDL has amended and added new features for gamepad support (see issue [#478](https://github.com/gabomdq/SDL_GameControllerDB/issues/476)). As such, maps authored with this tool require greater scrutiny to ensure they will not break support for explicit mappings the SDL project provides.
### [SDL2 Gamepad Mapper](https://gitlab.com/ryochan7/sdl2-gamepad-mapper/-/releases)
Open source GUI app for authoring mappings. Builds available for Windows and Linux.
### [SDL](https://github.com/libsdl-org/SDL/releases/latest)
[testcontroller (SDL3)](https://github.com/libsdl-org/SDL/blob/main/test/testcontroller.c) and [controllermap (SDL2)](https://github.com/libsdl-org/SDL/blob/SDL2/test/controllermap.c) utilities are the official tools to create these mappings on all SDL supported platforms (Windows, Mac, Linux, iOS, Android, etc).
### [Steam](http://store.steampowered.com)
In Steam's Big Picture mode, configure your gamepad. Then look in `[steam_installation_directory]/config/config.vdf` in your Steam installation directory for the `SDL_GamepadBind` entry. It is one of the last entries, it will look something like this:
```
"SDL_GamepadBind" "030000004c050000c405000000010000,PS4 Controller,platform:Windows,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,"
```
## Resources
* [SDL2](http://www.libsdl.org)
* [SDL_GameControllerAddMappingsFromFile](http://wiki.libsdl.org/SDL_GameControllerAddMappingsFromFile)

View File

@@ -0,0 +1,26 @@
# SPDX-License-Identifier: Zlib
import difflib
import sys
CROSS_PLATFORM=False
cdict = {}
for i, l in enumerate(open("gamecontrollerdb.txt")):
l = l.strip()
if l.startswith("#") or not l:
continue
c = l.split(",")
key = tuple([c[0]]+[ce for ce in c[1:] if "platform:" in ce])
if CROSS_PLATFORM:
key = c[0]
if key in cdict:
print("Duplicate:", c[1], "at line", i + 1)
out = list(difflib.unified_diff(cdict[key], sorted(c), n=0))[3:]
out = [o for o in out if not o.startswith("@@")]
print("\t", " ".join(out))
if not CROSS_PLATFORM:
sys.exit(1)
cdict[key] = sorted(c)

File diff suppressed because it is too large Load Diff

Binary file not shown.

After

Width:  |  Height:  |  Size: 17 KiB