mirror of
https://github.com/bearstonem/openmohaa-vr.git
synced 2026-10-18 01:00:20 +02:00
Compare commits
406
Commits
dev
...
vr-quest3-0.2.0
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
aaf287d1fb | ||
|
|
d9968210aa | ||
|
|
bd72599ab7 | ||
|
|
e6a7c76f84 | ||
|
|
bec1f4a8d5 | ||
|
|
6f443949ae | ||
|
|
7bb71e7550 | ||
|
|
711cad20e6 | ||
|
|
15471f7578 | ||
|
|
74dc964962 | ||
|
|
b51ed2e430 | ||
|
|
aa2fbeaf94 | ||
|
|
e45388bd01 | ||
|
|
dcd85654a4 | ||
|
|
214933c5fe | ||
|
|
fb2855f664 | ||
|
|
649f8f682d | ||
|
|
7ce4e07352 | ||
|
|
43e29a300a | ||
|
|
f52d6e5163 | ||
|
|
4f5b54c74c | ||
|
|
48b5876e3f | ||
|
|
bd480975a3 | ||
|
|
6e86e55c08 | ||
|
|
013b2f5bbf | ||
|
|
ce91fd1bf7 | ||
|
|
db8dfae0bd | ||
|
|
046e2dd9a6 | ||
|
|
411c3d9bc2 | ||
|
|
862d36a9ba | ||
|
|
11b1597f14 | ||
|
|
5e7e907792 | ||
|
|
e967529ec6 | ||
|
|
5267bc66c0 | ||
|
|
a3e3d04a5a | ||
|
|
b49e34a9ed | ||
|
|
27011bd3eb | ||
|
|
1249e897c6 | ||
|
|
6e369175be | ||
|
|
17771047c5 | ||
|
|
d9960e1857 | ||
|
|
a8a1314c2d | ||
|
|
aae8dff0f2 | ||
|
|
d2d52a5af4 | ||
|
|
6f34f4524c | ||
|
|
633221c57d | ||
|
|
7f794abbb4 | ||
|
|
7872929f32 | ||
|
|
393b0e3e3d | ||
|
|
5aff8d336a | ||
|
|
eea9112be9 | ||
|
|
f3ca623053 | ||
|
|
6517d02dfe | ||
|
|
a2f3401959 | ||
|
|
667c50f9b2 | ||
|
|
bcf1c4a4ea | ||
|
|
7831195b98 | ||
|
|
44ce0595c2 | ||
|
|
2a105f52a3 | ||
|
|
067302c108 | ||
|
|
614f424105 | ||
|
|
b1a45c0546 | ||
|
|
8b9881736c | ||
|
|
21a6e07180 | ||
|
|
a21732ce3e | ||
|
|
46aa4ebed1 | ||
|
|
5ebf885a19 | ||
|
|
8c31216b59 | ||
|
|
d50de3f00a | ||
|
|
969311274f | ||
|
|
919206af63 | ||
|
|
dd1e7469ab | ||
|
|
42a9d00bbf | ||
|
|
b1d81e4e92 | ||
|
|
94d10d08d5 | ||
|
|
842f120b43 | ||
|
|
f812e784e0 | ||
|
|
25b336eb58 | ||
|
|
ab43a0def6 | ||
|
|
87dd1f650e | ||
|
|
68cca1c58b | ||
|
|
7edc1028bd | ||
|
|
903c4a290e | ||
|
|
e7c192fbf2 | ||
|
|
8cbaff38b5 | ||
|
|
e7bd3c22c4 | ||
|
|
3f83b4b36a | ||
|
|
97da1c58d1 | ||
|
|
cbbf307fd0 | ||
|
|
c98165ea5f | ||
|
|
0c5f7db70d | ||
|
|
dfd9bd230c | ||
|
|
41a4ba9036 | ||
|
|
230fcb7ff6 | ||
|
|
bd8a07cd4e | ||
|
|
69d2236d8b | ||
|
|
729e72ae40 | ||
|
|
b5c25001e9 | ||
|
|
8779f00195 | ||
|
|
7b357cdfa9 | ||
|
|
3e4b989a13 | ||
|
|
b64ba58654 | ||
|
|
5b663c9699 | ||
|
|
5e3944d530 | ||
|
|
8a8d0d3a63 | ||
|
|
b8a20d9ab9 | ||
|
|
489bd9385c | ||
|
|
02de33a5c8 | ||
|
|
f53dc80d7c | ||
|
|
6e6ccd8f05 | ||
|
|
d77873ccf7 | ||
|
|
1b33f499e7 | ||
|
|
887b649bb5 | ||
|
|
dda5b11cbc | ||
|
|
9ec545aae6 | ||
|
|
497b0df699 | ||
|
|
0d271fe180 | ||
|
|
879e2397ce | ||
|
|
b19a3406fb | ||
|
|
a09132b9fd | ||
|
|
2970ab1d02 | ||
|
|
e1f49207d2 | ||
|
|
cb39fe5709 | ||
|
|
55443336d8 | ||
|
|
951b4b33b9 | ||
|
|
2681659329 | ||
|
|
3cda08bec4 | ||
|
|
098843cd0a | ||
|
|
3af8c64bfc | ||
|
|
a4c70670df | ||
|
|
f74343b183 | ||
|
|
12202e2d98 | ||
|
|
54c98c5e38 | ||
|
|
be4e3fd7ac | ||
|
|
46798d46dc | ||
|
|
b019c1811c | ||
|
|
55a990efa6 | ||
|
|
97ae04eff3 | ||
|
|
9fd2fb13f1 | ||
|
|
e3a873b4aa | ||
|
|
f8876404c2 | ||
|
|
3e16d8a2ff | ||
|
|
82be5b03bd | ||
|
|
f648db6b52 | ||
|
|
277717120d | ||
|
|
9db02300dc | ||
|
|
c46b6cddfe | ||
|
|
942ae5c038 | ||
|
|
42fa1fb87d | ||
|
|
5604a1f7f8 | ||
|
|
ac993b45b9 | ||
|
|
701964b8c2 | ||
|
|
9168f32cdb | ||
|
|
042108d12c | ||
|
|
634a2371e6 | ||
|
|
f4a21b73a4 | ||
|
|
3c3683536b | ||
|
|
2fececd62f | ||
|
|
68383565f2 | ||
|
|
51f2ed1cba | ||
|
|
f723cbf01d | ||
|
|
9a22cc94b2 | ||
|
|
7ee122f0b2 | ||
|
|
8169bd01a8 | ||
|
|
351a5fa644 | ||
|
|
e48baf19a9 | ||
|
|
9077a8c0ee | ||
|
|
52146bee45 | ||
|
|
63a1679bf6 | ||
|
|
b1a18b66a8 | ||
|
|
e39f9dc6e5 | ||
|
|
a767599893 | ||
|
|
777a9f2405 | ||
|
|
3b1d1699c7 | ||
|
|
59f2aea41d | ||
|
|
26508d26f0 | ||
|
|
8df4c82855 | ||
|
|
80732c6256 | ||
|
|
f666681035 | ||
|
|
c2d5f203b8 | ||
|
|
ec1ab7f327 | ||
|
|
7584af9774 | ||
|
|
8af5d9179d | ||
|
|
af660acc40 | ||
|
|
561ee6648a | ||
|
|
e7c66cfb77 | ||
|
|
2e58621210 | ||
|
|
4a839f5b41 | ||
|
|
a43ed409cf | ||
|
|
d82f0258a0 | ||
|
|
a16db487e8 | ||
|
|
1fd5c7319d | ||
|
|
b44252b989 | ||
|
|
35f74db1d3 | ||
|
|
b839d55a07 | ||
|
|
5df5735965 | ||
|
|
4373b3d976 | ||
|
|
7e1de3e0cc | ||
|
|
61cf668c68 | ||
|
|
cca1f28ce6 | ||
|
|
f5861f5329 | ||
|
|
fbe9cfb445 | ||
|
|
3f090ff1ec | ||
|
|
06b1c0e879 | ||
|
|
94328af9b1 | ||
|
|
21d6401da7 | ||
|
|
f2c31e956e | ||
|
|
c1c230f04c | ||
|
|
8eb3f66b45 | ||
|
|
548f07cc5a | ||
|
|
cf523bd4cd | ||
|
|
6737aaf017 | ||
|
|
800e82327b | ||
|
|
b06857d077 | ||
|
|
0487696dc3 | ||
|
|
c7e2431e15 | ||
|
|
6eae2c9841 | ||
|
|
e75b535c82 | ||
|
|
ba4cf34530 | ||
|
|
2c9e500570 | ||
|
|
941f2de533 | ||
|
|
b64a3765e5 | ||
|
|
b5a0006724 | ||
|
|
105202e0b1 | ||
|
|
cbb43b702e | ||
|
|
53bd800669 | ||
|
|
e4ec343a80 | ||
|
|
353ae6a12f | ||
|
|
28274e9422 | ||
|
|
bc5217915c | ||
|
|
dc50137f66 | ||
|
|
bba5213d38 | ||
|
|
69864db4e7 | ||
|
|
a40b9104b6 | ||
|
|
457c2f0a43 | ||
|
|
fb741a9a0b | ||
|
|
3886afec57 | ||
|
|
fcc84bae6e | ||
|
|
edb2419c98 | ||
|
|
b89bd34b4c | ||
|
|
10e6221e35 | ||
|
|
feaf3fe8d0 | ||
|
|
3039da305a | ||
|
|
69a63629e4 | ||
|
|
a64007cb23 | ||
|
|
8041939976 | ||
|
|
d757609842 | ||
|
|
acd3757f7e | ||
|
|
4429d22f11 | ||
|
|
f84e881b9a | ||
|
|
1e68f67743 | ||
|
|
a07e642820 | ||
|
|
1c27f3edd1 | ||
|
|
6bff3a0731 | ||
|
|
5c9eb7c858 | ||
|
|
46f668ee12 | ||
|
|
e115d142b4 | ||
|
|
309f21e172 | ||
|
|
25705763e5 | ||
|
|
48febb1247 | ||
|
|
28e6ea159c | ||
|
|
05e086e015 | ||
|
|
ddfada66c4 | ||
|
|
c9e145a4ff | ||
|
|
c84b93fb77 | ||
|
|
cf0970069b | ||
|
|
5a6ff0443a | ||
|
|
c0a6788f3e | ||
|
|
87bbb3e1d4 | ||
|
|
5a430cfd4f | ||
|
|
f974c36c6d | ||
|
|
e6eb3aa0a1 | ||
|
|
c8c9ae2468 | ||
|
|
cca7f9d20f | ||
|
|
f992185398 | ||
|
|
ce9cbdc19c | ||
|
|
9808cf8d01 | ||
|
|
f8a9a66247 | ||
|
|
bef56ad16d | ||
|
|
b495ac8324 | ||
|
|
031eb7ac2a | ||
|
|
aabb2c7d03 | ||
|
|
ce9199ea1e | ||
|
|
d610d6f45f | ||
|
|
ed6f279785 | ||
|
|
9f1749ef65 | ||
|
|
fbedcd1928 | ||
|
|
258c5f53f9 | ||
|
|
6e57eb7d00 | ||
|
|
cd4d396d30 | ||
|
|
b5dc39e953 | ||
|
|
749ff62cac | ||
|
|
c2519c86e6 | ||
|
|
6e04025971 | ||
|
|
ab70d70357 | ||
|
|
45e1daf65a | ||
|
|
c93d0f6975 | ||
|
|
e299031470 | ||
|
|
eb6b6173ee | ||
|
|
01562e5d83 | ||
|
|
d7a2e5bc65 | ||
|
|
ac67939b76 | ||
|
|
378938ae39 | ||
|
|
93d487a0d6 | ||
|
|
4b61caf47a | ||
|
|
4268269eaa | ||
|
|
1582325a72 | ||
|
|
aee897f52a | ||
|
|
6bcfe1788d | ||
|
|
b038d5ca03 | ||
|
|
4ef547cd86 | ||
|
|
0fdf19a3d4 | ||
|
|
bb9189f219 | ||
|
|
f72cc9da77 | ||
|
|
f75892cd26 | ||
|
|
8dbae6247c | ||
|
|
f72e10a297 | ||
|
|
3c92f1e13a | ||
|
|
ced7e21fd3 | ||
|
|
e68101abaa | ||
|
|
ecf70528a7 | ||
|
|
e0a748a2e7 | ||
|
|
5136eb3856 | ||
|
|
fabc7c7c74 | ||
|
|
f885408059 | ||
|
|
a2b891acd9 | ||
|
|
f529358357 | ||
|
|
270a7663c2 | ||
|
|
2adabc7468 | ||
|
|
80b2e89dcc | ||
|
|
654ab91efb | ||
|
|
555caa10f3 | ||
|
|
0c5cfb7a37 | ||
|
|
31e6830aee | ||
|
|
3a7105246d | ||
|
|
740c47fa6d | ||
|
|
a824d9e912 | ||
|
|
be3d9892e4 | ||
|
|
95474c92b3 | ||
|
|
480a377292 | ||
|
|
8ce3866e70 | ||
|
|
f5b01e7137 | ||
|
|
425885bf61 | ||
|
|
2eb190fe97 | ||
|
|
282110239e | ||
|
|
4170feddca | ||
|
|
833b660c68 | ||
|
|
edd58f2042 | ||
|
|
f7c77ce804 | ||
|
|
5da907484a | ||
|
|
f502f6a3c6 | ||
|
|
0da5496d28 | ||
|
|
e9bc305a26 | ||
|
|
4cd6a51869 | ||
|
|
3cd01b77d1 | ||
|
|
f3b66de7e3 | ||
|
|
d3ca24d27a | ||
|
|
70c12a1639 | ||
|
|
b68c2920ab | ||
|
|
59329b4fb3 | ||
|
|
4083d1123f | ||
|
|
fa047b7bf9 | ||
|
|
659939352a | ||
|
|
e556f58cc4 | ||
|
|
a72bc153db | ||
|
|
e47790cd54 | ||
|
|
8708953e96 | ||
|
|
b0ca50c4c5 | ||
|
|
1be22e9343 | ||
|
|
fabd2fd848 | ||
|
|
6d2d6e1429 | ||
|
|
df165d162d | ||
|
|
88e41fd6e5 | ||
|
|
790e4286db | ||
|
|
e6e260933a | ||
|
|
a3c10c4fae | ||
|
|
076099d0ed | ||
|
|
4d168a2e20 | ||
|
|
c0ac03afde | ||
|
|
6adeca6196 | ||
|
|
84b1d3e8d1 | ||
|
|
de65af5a43 | ||
|
|
a9b8c44206 | ||
|
|
c9f13f182c | ||
|
|
d1bfeeadbf | ||
|
|
95a7169d21 | ||
|
|
5b57949bc9 | ||
|
|
7e6ea644ba | ||
|
|
8e905c8617 | ||
|
|
0bd1159607 | ||
|
|
838f84b9f3 | ||
|
|
ee5a6b5a47 | ||
|
|
a3f520de8c | ||
|
|
57abfa297b | ||
|
|
11ba758ca3 | ||
|
|
a35008dfca | ||
|
|
83a32c2635 | ||
|
|
8336e48566 | ||
|
|
3e842ffe40 | ||
|
|
c9fcd723db | ||
|
|
175beea77e | ||
|
|
fda7cc0c6e | ||
|
|
7fc2e36bcb | ||
|
|
d00ccb5d5b | ||
|
|
0966021099 | ||
|
|
ed3af6dbf5 |
No files matched your search
@@ -22,6 +22,7 @@ jobs:
|
||||
# Initially create a release with 1 job
|
||||
# so multiple files can be uploaded at the same time afterwards
|
||||
create-release:
|
||||
if: github.event_name != 'pull_request' && github.ref_name == 'main'
|
||||
runs-on: ubuntu-24.04
|
||||
environment: 'testing'
|
||||
needs: [build-all]
|
||||
@@ -67,7 +68,7 @@ jobs:
|
||||
|
||||
- name: Zip
|
||||
working-directory: '${{github.workspace}}/${{matrix.target_os}}'
|
||||
run: zip -r "../${{env.RELEASE_NAME}}.zip" ./
|
||||
run: zip -9 -r "../${{env.RELEASE_NAME}}.zip" ./
|
||||
|
||||
- name: Release
|
||||
uses: softprops/action-gh-release@v2.3.2
|
||||
|
||||
@@ -15,7 +15,7 @@ jobs:
|
||||
steps:
|
||||
- name: Get and install Doxygen
|
||||
run: |
|
||||
wget https://github.com/doxygen/doxygen/releases/download/Release_1_13_2/doxygen-1.13.2.linux.bin.tar.gz -O doxygen.tar.gz
|
||||
wget https://github.com/doxygen/doxygen/releases/download/Release_1_16_1/doxygen-1.16.1.linux.bin.tar.gz -O doxygen.tar.gz
|
||||
tar xzf doxygen.tar.gz
|
||||
cd doxygen-*
|
||||
sudo cp bin/doxygen /usr/local/bin/
|
||||
|
||||
@@ -41,6 +41,7 @@ jobs:
|
||||
wolfssl-version: 'v5.7.6-stable'
|
||||
curl-version: '8_12_1'
|
||||
openal-soft-branch: '1.24.3'
|
||||
sdl2-branch: 'release-2.32.8'
|
||||
|
||||
steps:
|
||||
###
|
||||
@@ -78,15 +79,31 @@ jobs:
|
||||
# SDL
|
||||
###
|
||||
|
||||
# Setup SDL
|
||||
- name: Set up SDL
|
||||
id: sdl
|
||||
uses: libsdl-org/setup-sdl@main
|
||||
# Cache SDL
|
||||
- name: Cache SDL2
|
||||
id: cache-sdl2
|
||||
uses: actions/cache@v4
|
||||
with:
|
||||
version: 2-latest
|
||||
build-type: Release
|
||||
# Workaround for when changing the runner OS version
|
||||
cmake-arguments: "-DCACHE_OS_VERSION=Ubuntu_22.04"
|
||||
path: 'thirdparties/SDL2/install'
|
||||
key: ${{ runner.os }}-${{ matrix.architecture.name }}-sdl2-${{ env.sdl2-branch }}-v1
|
||||
|
||||
# SDL2 setup
|
||||
- name: Checkout SDL2
|
||||
if: steps.cache-sdl2.outputs.cache-hit != 'true'
|
||||
uses: actions/checkout@v4
|
||||
with:
|
||||
repository: 'libsdl-org/SDL'
|
||||
path: 'thirdparties/SDL2'
|
||||
ref: '${{ env.sdl2-branch }}'
|
||||
|
||||
- name: Configure and install SDL2
|
||||
if: steps.cache-sdl2.outputs.cache-hit != 'true'
|
||||
working-directory: ${{github.workspace}}/thirdparties/SDL2
|
||||
run: |
|
||||
cmake -B ./build \
|
||||
-DCMAKE_INSTALL_PREFIX='${{github.workspace}}/thirdparties/SDL2/install'
|
||||
cmake --build ./build --config Release --parallel
|
||||
cmake --install ./build --config Release
|
||||
|
||||
###
|
||||
# OpenAL
|
||||
@@ -197,9 +214,13 @@ jobs:
|
||||
run: |
|
||||
echo "CMAKE_PARAM=--log-level=VERBOSE \
|
||||
-DCMAKE_INSTALL_PREFIX='${{github.workspace}}/install' \
|
||||
-DUSE_INTERNAL_SDL=OFF \
|
||||
-DSDL2_DIR='${{github.workspace}}/thirdparties/SDL2/install/lib/cmake/SDL2' \
|
||||
-DOPENAL_LIBRARY='${{github.workspace}}/thirdparties/soft-oal' \
|
||||
-DOPENAL_INCLUDE_DIR='${{github.workspace}}/thirdparties/soft-oal/install/include' \
|
||||
-DCURL_ROOT='${{github.workspace}}/thirdparties/curl/install' \
|
||||
-DUSE_RENDERER_DLOPEN=OFF \
|
||||
-DBUILD_RENDERER_GL2=OFF \
|
||||
-DGIT_REVISION_BUILD_NUMBER=${{ github.run_number }} \
|
||||
-DPRODUCT_VERSION_STAGE='${{ env.RELEASE_STAGE }}'" >> $GITHUB_ENV
|
||||
|
||||
@@ -220,7 +241,7 @@ jobs:
|
||||
cmake --install ${{github.workspace}}/build --config ${{env.BUILD_TYPE}}
|
||||
# Copy libraries
|
||||
mkdir ${{github.workspace}}/package
|
||||
cp -l ${{steps.sdl.outputs.prefix}}/lib/libSDL2-2.0.so.0 '${{github.workspace}}/package/'
|
||||
cp -l ${{github.workspace}}/thirdparties/SDL2/install/lib/libSDL2-2.0.so.0 '${{github.workspace}}/package/'
|
||||
cp -l ${{github.workspace}}/thirdparties/soft-oal/install/lib/libopenal.so.1 '${{github.workspace}}/package/'
|
||||
cp -l ${{github.workspace}}/thirdparties/curl/install/lib*/libcurl.so.4 '${{github.workspace}}/package/'
|
||||
if [ -d ${{github.workspace}}/install/bin ]; then cp -r ${{github.workspace}}/install/bin/openmohaa/. '${{github.workspace}}/package'; fi
|
||||
@@ -234,5 +255,6 @@ jobs:
|
||||
with:
|
||||
name: out-linux-${{matrix.architecture.name}}
|
||||
if-no-files-found: error
|
||||
compression-level: 9
|
||||
path:
|
||||
${{github.workspace}}/package
|
||||
@@ -38,6 +38,7 @@ jobs:
|
||||
openal-soft-branch: '1.24.3'
|
||||
wolfssl-version: 'v5.7.6-stable'
|
||||
curl-version: '8_12_1'
|
||||
sdl2-branch: 'release-2.32.8'
|
||||
|
||||
steps:
|
||||
###
|
||||
@@ -46,7 +47,9 @@ jobs:
|
||||
|
||||
- name: Install required packages
|
||||
run: |
|
||||
brew install git flex bison ninja cmake llvm perl
|
||||
brew install flex bison llvm
|
||||
# Those packages are already installed
|
||||
#brew install git ninja cmake perl
|
||||
|
||||
- name: Settings
|
||||
working-directory: ${{github.workspace}}
|
||||
@@ -60,15 +63,32 @@ jobs:
|
||||
# SDL
|
||||
###
|
||||
|
||||
# Setup SDL
|
||||
- name: Set up SDL
|
||||
id: sdl
|
||||
uses: libsdl-org/setup-sdl@main
|
||||
# Cache SDL
|
||||
- name: Cache SDL2
|
||||
id: cache-sdl2
|
||||
uses: actions/cache@v4
|
||||
with:
|
||||
version: 2-latest
|
||||
build-type: Release
|
||||
cmake-arguments: "-DCMAKE_OSX_ARCHITECTURES='${{ matrix.architecture.build_name }}'
|
||||
-DCMAKE_VERBOSE_MAKEFILE=on"
|
||||
path: 'thirdparties/SDL2/install'
|
||||
key: ${{ runner.os }}-${{ matrix.architecture.name }}-sdl2-${{ env.sdl2-branch }}-v1
|
||||
|
||||
# SDL2 setup
|
||||
- name: Checkout SDL2
|
||||
if: steps.cache-sdl2.outputs.cache-hit != 'true'
|
||||
uses: actions/checkout@v4
|
||||
with:
|
||||
repository: 'libsdl-org/SDL'
|
||||
path: 'thirdparties/SDL2'
|
||||
ref: '${{ env.sdl2-branch }}'
|
||||
|
||||
- name: Configure and install SDL2
|
||||
if: steps.cache-sdl2.outputs.cache-hit != 'true'
|
||||
working-directory: ${{github.workspace}}/thirdparties/SDL2
|
||||
run: |
|
||||
cmake -B ./build \
|
||||
-DCMAKE_INSTALL_PREFIX='${{github.workspace}}/thirdparties/SDL2/install' \
|
||||
-DCMAKE_OSX_ARCHITECTURES='${{ matrix.architecture.build_name }}'
|
||||
cmake --build ./build --config Release --parallel
|
||||
cmake --install ./build --config Release
|
||||
|
||||
###
|
||||
# OpenAL
|
||||
@@ -190,9 +210,14 @@ jobs:
|
||||
-DCMAKE_INSTALL_PREFIX='${{github.workspace}}/install' \
|
||||
-DCMAKE_VERBOSE_MAKEFILE=on \
|
||||
-DCMAKE_OSX_ARCHITECTURES='${{ matrix.architecture.build_name }}' \
|
||||
-DUSE_INTERNAL_SDL=OFF \
|
||||
-DSDL2_DIR='${{github.workspace}}/thirdparties/SDL2/install/lib/cmake/SDL2' \
|
||||
-DOPENAL_LIBRARY='${{github.workspace}}/thirdparties/soft-oal/install' \
|
||||
-DOPENAL_INCLUDE_DIR='${{github.workspace}}/thirdparties/soft-oal/install/include/AL' \
|
||||
-DCURL_ROOT='${{github.workspace}}/thirdparties/curl/install' \
|
||||
-DUSE_RENDERER_DLOPEN=OFF \
|
||||
-DBUILD_RENDERER_GL2=OFF \
|
||||
-DBUILD_MACOS_APP=OFF \
|
||||
-DGIT_REVISION_BUILD_NUMBER=${{ github.run_number }} \
|
||||
-DPRODUCT_VERSION_STAGE='${{ env.RELEASE_STAGE }}'" >> $GITHUB_ENV
|
||||
|
||||
@@ -213,7 +238,7 @@ jobs:
|
||||
cmake --install ${{github.workspace}}/build --config ${{env.BUILD_TYPE}}
|
||||
# Create hard-link and copy symbolic links
|
||||
mkdir ${{github.workspace}}/package
|
||||
cp -l ${{steps.sdl.outputs.prefix}}/lib/libSDL2-2.0.0.dylib '${{github.workspace}}/package/'
|
||||
cp -l ${{github.workspace}}/thirdparties/SDL2/install/lib/libSDL2-2.0.0.dylib '${{github.workspace}}/package/'
|
||||
cp -l ${{github.workspace}}/thirdparties/soft-oal/install/lib/libopenal.1.dylib '${{github.workspace}}/package/'
|
||||
cp -l ${{github.workspace}}/thirdparties/curl/install/lib*/libcurl.4.dylib '${{github.workspace}}/package/'
|
||||
if [ -d ${{github.workspace}}/install/bin ]; then cp -r ${{github.workspace}}/install/bin/openmohaa/. '${{github.workspace}}/package'; fi
|
||||
@@ -227,5 +252,6 @@ jobs:
|
||||
with:
|
||||
name: out-macos-${{matrix.architecture.name}}
|
||||
if-no-files-found: error
|
||||
compression-level: 9
|
||||
path:
|
||||
${{github.workspace}}/package
|
||||
@@ -36,6 +36,7 @@ jobs:
|
||||
wolfssl-version: 'v5.7.6-stable'
|
||||
curl-version: '8_12_1'
|
||||
openal-soft-branch: '1.24.3'
|
||||
sdl2-branch: 'release-2.32.8'
|
||||
|
||||
steps:
|
||||
###
|
||||
@@ -47,7 +48,7 @@ jobs:
|
||||
uses: actions/cache@v4
|
||||
with:
|
||||
path: 'thirdparties/winflexbison-install'
|
||||
key: ${{ runner.os }}-${{ matrix.architecture.name }}-flexbison-${{ env.flexbison-branch }}-v1
|
||||
key: ${{ runner.os }}-${{ matrix.architecture.name }}-flexbison-${{ env.flexbison-branch }}-v2
|
||||
|
||||
- name: Install Flex/Bison
|
||||
if: steps.cache-flexbison.outputs.cache-hit != 'true'
|
||||
@@ -55,7 +56,7 @@ jobs:
|
||||
run: |
|
||||
mkdir thirdparties && cd thirdparties
|
||||
git clone --depth 1 --single-branch --branch ${{ env.flexbison-branch }} https://github.com/lexxmark/winflexbison.git
|
||||
cmake -B winflexbison-build -DCMAKE_INSTALL_PREFIX='${{github.workspace}}/thirdparties/winflexbison-install' ./winflexbison
|
||||
cmake -B winflexbison-build -DCMAKE_INSTALL_PREFIX='${{github.workspace}}/thirdparties/winflexbison-install' -DCMAKE_POLICY_VERSION_MINIMUM="3.5" ./winflexbison
|
||||
cmake --build winflexbison-build --config Release --parallel
|
||||
cmake --install winflexbison-build --config Release
|
||||
|
||||
@@ -99,19 +100,40 @@ jobs:
|
||||
run: |
|
||||
$env:PATH += ";C:\Packages\ninja;C:\Packages\jom;"
|
||||
echo "PATH=$($env:PATH)" >> $env:GITHUB_ENV
|
||||
if ("${{ matrix.architecture.config }}" -ieq "ARM64") {
|
||||
# Workaround against linking errors related to interlocked functions
|
||||
echo "CFLAGS=/forceInterlockedFunctions-" >> $env:GITHUB_ENV
|
||||
}
|
||||
|
||||
###
|
||||
# SDL
|
||||
###
|
||||
|
||||
# Setup SDL
|
||||
- name: Set up SDL
|
||||
id: sdl
|
||||
uses: libsdl-org/setup-sdl@main
|
||||
# Cache SDL
|
||||
- name: Cache SDL2
|
||||
id: cache-sdl2
|
||||
uses: actions/cache@v4
|
||||
with:
|
||||
version: 2-latest
|
||||
build-type: Release
|
||||
cmake-arguments: ""
|
||||
path: 'thirdparties/SDL2/install'
|
||||
key: ${{ runner.os }}-${{ matrix.architecture.name }}-sdl2-${{ env.sdl2-branch }}-v1
|
||||
|
||||
# SDL2 setup
|
||||
- name: Checkout SDL2
|
||||
if: steps.cache-sdl2.outputs.cache-hit != 'true'
|
||||
uses: actions/checkout@v4
|
||||
with:
|
||||
repository: 'libsdl-org/SDL'
|
||||
path: 'thirdparties/SDL2'
|
||||
ref: '${{ env.sdl2-branch }}'
|
||||
|
||||
- name: Configure and install SDL2
|
||||
if: steps.cache-sdl2.outputs.cache-hit != 'true'
|
||||
working-directory: ${{github.workspace}}/thirdparties/SDL2
|
||||
run: |
|
||||
cmake -B ./build `
|
||||
-DCMAKE_INSTALL_PREFIX='${{github.workspace}}/thirdparties/SDL2/install'
|
||||
cmake --build ./build --config Release --parallel
|
||||
cmake --install ./build --config Release
|
||||
|
||||
###
|
||||
# OpenAL
|
||||
@@ -204,10 +226,14 @@ jobs:
|
||||
-DCMAKE_INTERPROCEDURAL_OPTIMIZATION=true `
|
||||
-DGIT_REVISION_BUILD_NUMBER=${{ github.run_number }} `
|
||||
-DBISON_EXECUTABLE='${{github.workspace}}/thirdparties/winflexbison-install/win_bison.exe' `
|
||||
-DUSE_INTERNAL_SDL=OFF `
|
||||
-DSDL2_DIR='${{github.workspace}}/thirdparties/SDL2/install/cmake' `
|
||||
-DOPENAL_LIBRARY='${{github.workspace}}/thirdparties/soft-oal' `
|
||||
-DOPENAL_INCLUDE_DIR='${{github.workspace}}/thirdparties/soft-oal/install/include' `
|
||||
-DOPENAL_INCLUDE_DIR='${{github.workspace}}/thirdparties/soft-oal/install/include/AL' `
|
||||
-DCURL_ROOT='${{github.workspace}}/thirdparties/curl/install' `
|
||||
-DFLEX_EXECUTABLE='${{github.workspace}}/thirdparties/winflexbison-install/win_flex.exe' `
|
||||
-DUSE_RENDERER_DLOPEN=OFF `
|
||||
-DBUILD_RENDERER_GL2=OFF `
|
||||
-DPRODUCT_VERSION_STAGE='${{ env.RELEASE_STAGE }}'".Replace("`r", "").Replace("`n", "") >> $env:GITHUB_ENV
|
||||
|
||||
- name: Configure CMake
|
||||
@@ -226,7 +252,7 @@ jobs:
|
||||
run: |
|
||||
cmake --install ${{github.workspace}}/build --config ${{env.BUILD_TYPE}}
|
||||
New-Item -ItemType Directory '${{github.workspace}}/package'
|
||||
Copy-Item '${{steps.sdl.outputs.prefix}}/bin/*.dll' -Destination '${{github.workspace}}/package'
|
||||
Copy-Item '${{github.workspace}}/thirdparties/SDL2/install/bin/*.dll' -Destination '${{github.workspace}}/package'
|
||||
Copy-Item '${{github.workspace}}/thirdparties/soft-oal/install/bin/*.dll' -Destination '${{github.workspace}}/package'
|
||||
Copy-Item '${{github.workspace}}/thirdparties/curl/install/bin/*.dll' -Destination '${{github.workspace}}/package'
|
||||
if (Test-Path ${{github.workspace}}/install/bin) { Copy-Item '${{github.workspace}}/install/bin/*' -Include '*.dll','*.exe','*.pdb' -Destination '${{github.workspace}}/package' }
|
||||
@@ -246,6 +272,7 @@ jobs:
|
||||
with:
|
||||
name: out-windows-${{matrix.architecture.name}}
|
||||
if-no-files-found: error
|
||||
compression-level: 9
|
||||
path: |
|
||||
${{github.workspace}}/package
|
||||
!${{github.workspace}}/package/**/*.pdb
|
||||
@@ -254,6 +281,7 @@ jobs:
|
||||
with:
|
||||
name: out-windows-${{matrix.architecture.name}}-pdb
|
||||
if-no-files-found: error
|
||||
compression-level: 9
|
||||
path: |
|
||||
${{github.workspace}}/package
|
||||
|
||||
|
||||
@@ -69,7 +69,7 @@ jobs:
|
||||
|
||||
- name: Zip
|
||||
working-directory: '${{github.workspace}}/${{matrix.target_os}}'
|
||||
run: zip -r "../${{ env.RELEASE_NAME }}.zip" ./
|
||||
run: zip -9 -r "../${{ env.RELEASE_NAME }}.zip" ./
|
||||
|
||||
- name: Release
|
||||
uses: softprops/action-gh-release@v2.3.2
|
||||
|
||||
@@ -34,7 +34,9 @@ jobs:
|
||||
echo "CC=clang" >> $GITHUB_ENV
|
||||
echo "CXX=clang++" >> $GITHUB_ENV
|
||||
echo "CMAKE_PARAM=--log-level=VERBOSE \
|
||||
-DCMAKE_INSTALL_PREFIX='${{github.workspace}}/install'" >> $GITHUB_ENV
|
||||
-DCMAKE_INSTALL_PREFIX='${{github.workspace}}/install'" \
|
||||
-DUSE_RENDERER_DLOPEN=OFF \
|
||||
-DBUILD_RENDERER_GL2=OFF >> $GITHUB_ENV
|
||||
|
||||
- name: Configure CMake
|
||||
working-directory: ${{github.workspace}}
|
||||
|
||||
+9
-9
@@ -1,7 +1,6 @@
|
||||
build
|
||||
mohaa-re
|
||||
out
|
||||
Makefile.local
|
||||
build*
|
||||
!/misc/android/build.gradle
|
||||
!/misc/android/app/build.gradle
|
||||
*.swp
|
||||
*tags
|
||||
*~
|
||||
@@ -17,7 +16,6 @@ Makefile.local
|
||||
.DS_Store
|
||||
.LSOverride
|
||||
Icon?
|
||||
make-macosx-values.local
|
||||
|
||||
# Xcode
|
||||
####################
|
||||
@@ -44,8 +42,10 @@ profile
|
||||
*.sdf
|
||||
*.opensdf
|
||||
*.suo
|
||||
/.vs
|
||||
|
||||
.vs
|
||||
code_unfinished/*
|
||||
thirdparties/
|
||||
code/parser/generated/*
|
||||
out
|
||||
|
||||
# Flex and Bison
|
||||
####################
|
||||
/code/parser/generated
|
||||
+929
@@ -0,0 +1,929 @@
|
||||
# Changelog
|
||||
|
||||
All notable changes to this project will be documented in this file.
|
||||
|
||||
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/),
|
||||
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
||||
|
||||
## [Unreleased]
|
||||
|
||||
### Added
|
||||
|
||||
#### Server
|
||||
|
||||
- Feature to name bots (most requested bot feature). See the [bot documentation](https://github.com/openmoh/openmohaa/blob/main/docs/markdown/03-configuration/01-configuration.md#bots). This may change in the future.
|
||||
- More settings for bots. See the [documentation](https://github.com/openmoh/openmohaa/blob/main/docs/markdown/03-configuration/03-configuration-bots.md) for settings.
|
||||
- Reason will be sent to clients getting kicked automatically by the game for teamkill or inactivity.
|
||||
- Reflective team damage feature. See the [documentation](https://github.com/openmoh/openmohaa/blob/main/docs/markdown/03-configuration/02-configuration-server.md#g_teamdamage) for settings and explanations.
|
||||
- Store the map file name in the `mapfilename` variable.
|
||||
|
||||
##### Scripting
|
||||
|
||||
- Add a third optional parameter for `removeclass` to specify if it should include subclasses (defaults to true).
|
||||
- The owner of a projectile is now accessible from scripts.
|
||||
|
||||
#### General
|
||||
|
||||
- Add the bot count (if there are any) in the server browser. This will only work for servers running at least the version **0.83.0** of OpenMoHAA. The bot count will also show on the [333networks](https://master.333networks.com/) master server website.
|
||||
|
||||
#### Client
|
||||
|
||||
- Add support for one-shot animated shaders in the UI (#838) (not supported in the original game).
|
||||
|
||||
#### Platform
|
||||
|
||||
- Allow separation of config, data, and state directories within the home path (XDG directory support) (#588).
|
||||
|
||||
### Changed
|
||||
|
||||
- Older saves are incompatible due to changes from commit 5df5735965298b26b9bd4b90034843c743ff7158.
|
||||
|
||||
#### Server
|
||||
|
||||
- Prevent dropping the binoculars (this change was introduced in Spearhead v2.11).
|
||||
- Servers now read and write into a configuration file `omconfig_server.cfg`, separate from the client configuration for convenience.
|
||||
|
||||
### Fixed
|
||||
|
||||
#### General
|
||||
|
||||
- Fix network profiling connectionless packet improperly counted.
|
||||
- Fix Spearhead getting medals from Allied Assault when the config file doesn't exist (also occurs in the original game) (#818).
|
||||
|
||||
#### Server
|
||||
|
||||
- Allow `g_teamkillkick` to be set to 0. Players would get kicked when this variable was set to 0 (also occurs in the original game).
|
||||
- Allow spectators and dead players to vote (#843).
|
||||
- Fix a bug where players who switched to spectator mode immediately after dying would have 0 health and drop DM items (also occurs in the original game).
|
||||
- Fix a crash that occurs when the server receives a gamespy cdkey authorize request.
|
||||
- Fix a crash that could occur when starting a `jvbot` game.
|
||||
- Fix a possible crash caused by scripts using `angles_pointat` (also occurs in the original game).
|
||||
- Fix a rare glitch causing the player to be teleported to (0,0,0) and stuck (also occurs in the original game).
|
||||
- Fix Actors not doing anything without client #0 (also occurs in the original game).
|
||||
- Fix Actors squad formation.
|
||||
- Fix an issue where clients could crash because of too many models being loaded from the server.
|
||||
- Fix bad animation blending with portable turret.
|
||||
- Fix bots being counted for voting.
|
||||
- Fix death animation movement for bots.
|
||||
- Fix holstered weapon attachment position (#847).
|
||||
- Fix improper weapon falling rotation.
|
||||
- Fix mismatched animation issues between the original clients and the server (#842).
|
||||
- Fix players not having binoculars on Allied Assault.
|
||||
- Fix players temporarily losing user input control on ARM-based OpenMoHAA servers when a message contained a special ASCII character.
|
||||
- Fix some death animations flickering for original clients playing on an OpenMoHAA servers (#857).
|
||||
- Fix some RCON programs not working with `dumpuser`.
|
||||
- Fix the carryable turret disappearing when being dropped (#812).
|
||||
- Fix the round limit being always `15` on Tug-of-War.
|
||||
- Fix votes being messed up after calling a vote the second time during the match.
|
||||
- Fix `wait` command not working on dedicated server binaries. Further commands would not be able to be executed (also occurs in the original game).
|
||||
- Fix weapon select mod not working (#849).
|
||||
- Fix wrong portable turret placement.
|
||||
- Large vote configurations will no longer cause clients to disconnect (also occurs in the original game) (#858).
|
||||
- The gamespy port `net_gamespy_port` now reflects the real port being used by the server (the issue also occurs in the original game).
|
||||
- The player would spawn with no weapons on single-player when `sv_maxbots` was set (#783).
|
||||
|
||||
#### Clients
|
||||
|
||||
- Fix a crash caused when firing bullets to specific entities with no surface type (#831).
|
||||
- Fix entities not being able to emit a light when attached to another entity (also occurs on the original Allied Assault but was fixed since Spearhead 2.0) (#824).
|
||||
- Fix mapinfo (.min) files never being saved, resulting in the loading bar never showing on some maps (#832).
|
||||
- Fix not being able to view sniper zoom when spectating.
|
||||
- Fix sky being partially culled out on some single-player maps (#817).
|
||||
- Fix the issue where the network would no longer work after hosting a multiplayer game on Allied Assault using the client.
|
||||
- Fix wrong alignment for UI elements using `centery` (#848).
|
||||
|
||||
### Changed
|
||||
|
||||
#### Server
|
||||
|
||||
- Free-For-All is now the default gametype on dedicated servers (`g_gametype 1`) when unspecified, rather than single-player (the issue also occurs in the original game).
|
||||
- Freezeplayer now freezes player animation/state, because frozen players would still emit footsteps sound when frozen.
|
||||
- Nocliping when dead no longer makes the player animation sketchy.
|
||||
|
||||
#### Clients
|
||||
|
||||
- Slightly increase the brightness of red/green chat messages.
|
||||
|
||||
#### Misc
|
||||
|
||||
- Completely refactor CMake build system (from [ioquake3's](<https://github.com/ioquake/ioq3>) new CMake build system).
|
||||
|
||||
## [0.82.1] - 2025-08-05
|
||||
|
||||
### Fixed
|
||||
|
||||
#### Crashes
|
||||
|
||||
- Fix a crash that would occur when loading custom maps in some map packs (due to a UI incorrectly declaring a widget: loadingbar, twice) (#764)
|
||||
- Fix an issue where the server could crash MOHAA base (1.11) clients in certain situations (#778)
|
||||
- The game no longer terminate with error `FS_ReadFile with empty name`. (#772)
|
||||
|
||||
#### Drawing & rendering
|
||||
|
||||
- Fix force model always using an allied skin for dead bodies.
|
||||
- Fix HUD being shown during briefings (#767)
|
||||
- Fix in-game mouse cursor disappearing on some platforms (#765)
|
||||
- Set a more distant fog for d-day by default (`set g_ddayfog 0`). This fixes an issue with sky artifacts in m3l1a. (#770)
|
||||
|
||||
#### Multiplayer
|
||||
|
||||
- Fix frequent telefrags on servers with a lot of players, like 25 players.
|
||||
- Fix taunts being played as team rather than global (#775)
|
||||
|
||||
#### Miscellaneous
|
||||
|
||||
- Update third-party libraries like jpeg and zlib.
|
||||
|
||||
## [0.82.0] - 2025-08-05
|
||||
|
||||
### Added
|
||||
|
||||
#### General
|
||||
|
||||
- Commands `add`, `subtract`, `scale`, `append` and `bitset`. `bitset`, which comes from mohaab, is particulary useful to set flags for flag-based variables like `dmflags`.
|
||||
- Logfile timestamping. It's enabled by default with the `com_logfile_timestamps` cvar. The current time is displayed at the beginning of each log entry.
|
||||
- Setup files (.msi packages) are now distributed for Windows.
|
||||
- Update check. The game will verify the latest version in the background (by querying the latest GitHub release of the repository) and print a
|
||||
- Add the **Instant Action** feature from Breakthrough. This feature, although only usable through the Breakthrough UI, allows anyone to quickly find and join popular low-ping multiplayer servers.
|
||||
|
||||
#### Multiplayer
|
||||
|
||||
- Add `(all)` prefix in text message when a player is talking to all
|
||||
- A message will be printed into console/log when a client changes their name.
|
||||
- In Spearhead and Breakthrough, axis players can now select the kar98 sniper by choosing a german panzer skin (this was one of the feature of Daven's patch).
|
||||
- The client number and their IP address will be printed next to each action (text message, joined the game...)
|
||||
|
||||
##### Bots
|
||||
|
||||
- [Recast Navigation](https://recastnav.com/) is now used by default to generate the navigation for bots. It's all automatic and works out of the box for any level, there is no need for `mp-navigation.pk3`. It provides a better and more accurate ways for bots to navigate through the maps.
|
||||
- Bots can now take path that requires jumping, falling or climbing ladders.
|
||||
- Bots will now try to get around small obstacles in front of them.
|
||||
|
||||
*Note: bigger obstacles are minimally supported, but may cause some issues in some area, like the West axis spawn in Omaha Beach.*
|
||||
|
||||
It takes less than 2 seconds to generate the navigation mesh on large maps like Berlin and Druckkammern.
|
||||
|
||||
If you have issues, executing `set g_navigation_legacy 1` command and then reloading the map will fallback to the basic pathnode-based navigation system.
|
||||
|
||||
### Fixed
|
||||
|
||||
#### Audio
|
||||
|
||||
- Updated OpenAL to version 1.24.3
|
||||
- The sound quality has improved a little bit, the new version of OpenAL uses another sound resampler by default.
|
||||
- Fix enhanced audio spatialization being forcefully enabled when it shouldn't for audio devices detected as headphones that aren't headphones.
|
||||
|
||||
#### General
|
||||
|
||||
- Fix `LOCALIZATION ERROR` spam.
|
||||
- Fix an infinite loop that would occur during name sanitization.
|
||||
- Fix a crash that would occur when using special menus (like admin menus).
|
||||
- Fix memory leaks after the process has been running for a long time.
|
||||
- Fix player name being cutoff at the first negative character
|
||||
- Fix player being able to shoot bullets from under the LOD terrain (also occurs on the original game)
|
||||
- Fix the `version` string, ensuring most software such as HLSW and mods work as intended depending on the target game version.
|
||||
|
||||
#### Client
|
||||
|
||||
- Fix bullet impacts having multiple effects sometimes.
|
||||
- Fix cinematic not stopping on map change.
|
||||
- Fix delayed SFX (such as smoke sound) being played on unrelated entities
|
||||
- Fix `Illegible server message` error when firing some type of bullets on Spearhead and Breakthrough.
|
||||
- Fix lean angle slightly not matching the original game.
|
||||
- Fix localization issues.
|
||||
- Fix Waffen skins not being usable on servers
|
||||
- Player models (selected skins) will be reset to their default value in-game if it doesn't exist, and force models will not work if the model doesn't exist on the server.
|
||||
- Reallow client `name` to be changed by the server. Names are often changed by administrators to fix duplicate names.
|
||||
|
||||
#### Multiplayer
|
||||
|
||||
- Correctly print the text of instant messages in the console/logfile.
|
||||
- Fix AllocEdict when some Breakthrough maps are started in multiplayer mode (for co-op).
|
||||
- Fix a crash related to spawnpoints.
|
||||
- Fix a crash that would occur when playing a sound with subtitle without player #0.
|
||||
- Fix a crash that occured when a player reconnects to the same slot (after timing out) and then displays the scoreboard
|
||||
- Fix an issue preventing spawning next to spawn points with an offset. This lead to frequent telefrags with lot of players.
|
||||
- Fix a crash that would occur when the player sets a first-person model as a skin, causing an infinite state loop (also occurs in the original game).
|
||||
- Fix clients joining during intermission and having a corrupt `Time` value in the scoreboard (also occurs in the original game).
|
||||
- Fix fog sometimes not updating on maps such as Gewitter.
|
||||
- Fix incorrect number of wins shown for allies and axis in the scoreboard.
|
||||
- Fix spawnpoints metrics.
|
||||
- Fix missing player starts on some maps.
|
||||
- Fix players temporarily having the name of another player when rejoining after losing connection (also occurs in original game)
|
||||
- Fix projectiles with no owner getting removed when a player joins a team (also occurs in Spearhead and Breakthrough)
|
||||
- Fix score not being able to have negative values in the result returned by the `status` server command.
|
||||
- Fix scores being incorrectly sorted in round-based matches (they must be sorted by total kills).
|
||||
- Fix some issues with laser mods, like the `Freeze-Tag` mode where the laser would not trace from the player sight.
|
||||
- Fix `sv_precache` being ignored.
|
||||
- Fix the issue where the text message gets empty when exceeding character limit.
|
||||
- Fix the round ending incorrectly in mods like beach soccer.
|
||||
- Fix weapon being dropped sometimes when switching weapons too fast (also occurs in original game)
|
||||
- Increase text message character limit to 400 characters (taking the name of the player into account).
|
||||
|
||||
#### Game module
|
||||
|
||||
- Bazooka was never showing as the preferred weapon in singleplayer.
|
||||
- Fix AI not shooting when squadmates are next to eachother in Spearhead and Breakthrough (also occurs in original game).
|
||||
- Fix AI not moving to specific location when ordered.
|
||||
- Fix AI misbehaving when curious.
|
||||
- Fix AI moving too fast on Allied Assault.
|
||||
- Fix AI having a notepad.
|
||||
- Fix ammo type not properly localized.
|
||||
- Fix an infinite loop that would occur on some maps when a vehicle start driving to a path.
|
||||
- Fix an issue where legs animations (like idle pistol stand) would not loop.
|
||||
- Fix an undefined behavior issue in some mods that could lead to infinite loop, like, `while (self.variable)` (where `self` is `NULL`).
|
||||
- Fix a crash (MAX_GAMESTATE_CHARS) and a memory leak in long matches after many models are loaded. This would occur mostly in ToW maps during long matches, or in maps spawning many `Actor`.
|
||||
- Fix a crash related to VehicleTurretGun having no vehicle owner (also occurs in original mohaab).
|
||||
- Fix a crash that would occur when a turret shoots projectiles.
|
||||
- Fix a crash when a player quits the server while in a vehicle (also occurs in original game).
|
||||
- Fix damage blend not working in Spearhead and Breakthrough.
|
||||
- Fix leaning not making a difference when trying to use.
|
||||
- Fix mods like Elgbot server-side not working properly.
|
||||
- Fix inconsistent cross-blending of torso animations.
|
||||
- Fix "silent walk", where rapidly switching weapons would prevent emitting footstep sounds (also occurs in original game).
|
||||
- Fix weapon banning not working properly when banning rifles.
|
||||
|
||||
#### Rendering
|
||||
|
||||
- Fix a crash that would occur when there are insufficient triangles for LOD terrain tessellation (also occurs in original game).
|
||||
- Fix a possible crash when loading a map with lightmaps and then loading a map that has no lightmaps.
|
||||
- Fix a rare crash that would occur when toggling the scoreboard (also occurs in original game, but was fixed in Breakthrough 2.30).
|
||||
- Fix blurry text.
|
||||
- Fix disconnected water lakes
|
||||
- Fix console prompt being hidden when there are too many characters
|
||||
- Fix line breaks occurring mid-word
|
||||
- Fix long messages being cut off in the console
|
||||
- Fix omaha beach shorelines being incorrectly rendered
|
||||
- Fix the server list being requested twice on Allied Assault when browsing internet servers.
|
||||
|
||||
#### Server
|
||||
|
||||
- Fix `CM_AdjustAreaPortalState` error
|
||||
- Fix clients rejected for too low/high ping not being able to reconnect again.
|
||||
- Fix some programs (like gamedig) not being able to retrieve gamespy data from the server.
|
||||
- Fix some programs not being able to retrieve the complete list of players
|
||||
- Fix `SV_FindIndex: overflow` errors that would occur more often than the original game during long matches.
|
||||
- Fix server crashing all clients under rare occasions.
|
||||
|
||||
### Changed
|
||||
|
||||
- Removed the architecture suffix from executables. They're now simply named `openmohaa` and `omohaaded`, for multiple reasons:
|
||||
- Avoids conflicts with shipped third-party DLLs (like SDL, OpenAL) which have no suffix.
|
||||
- Easier to build an installer and document.
|
||||
- Makes launchers and automation scripts simpler (universal name for executable files).
|
||||
- The architecture is already indicated in the archive name, on startup and in the `version` variable.*
|
||||
|
||||
- Older saves are incompatible due to changes from commit 4e8ddf3c358baef7cbfe2c8ff66c2426338cd2c7.
|
||||
|
||||
#### Client
|
||||
|
||||
- A random number is now added for the default name, like `UnnamedSoldier#1234`, or `*** Blank Name #1234 ***`.
|
||||
|
||||
#### Multiplayer
|
||||
|
||||
- All player models inside the `models/player/` folder will be cached in multiplayer. This avoids short lags/hitches when a player spawns with an un-cached model.
|
||||
|
||||
##### Master server
|
||||
|
||||
- Updated the master server to use [333networks](https://333networks.com/).
|
||||
- Add support for multiple master servers. The server browser queries them all at once, and servers send updates to each. They are powered by the **333networks** community, managed independently. Even if one master goes down, others are used, ensuring constant availability of multiplayer.
|
||||
- Iccups will occur less when fetching the server list if the network is really slow, or if the master server is unreachable.
|
||||
|
||||
#### Rendering
|
||||
|
||||
- On windowed mode, the hardware cursor is now used to navigate in the UI. This quickly allow users to get out of the window when bringing the console or the main menu up, instead of doing ALT+TAB.
|
||||
|
||||
#### Server
|
||||
|
||||
- The server is now showing the project version number in the server list.
|
||||
|
||||
## [0.81.1] - 2025-01-04
|
||||
|
||||
### Fixed
|
||||
|
||||
- Fix the text of pulldown elements being invisible on some menus
|
||||
- Fix the server not taking the client rate into account and transmitting network fragments too fast, this may be the reason why some clients were unable to connect
|
||||
|
||||
## [0.81.0] - 2025-01-02
|
||||
|
||||
### Added
|
||||
|
||||
#### Audio
|
||||
|
||||
- Add support for IMA-ADPCM Wave sound files (4-bit compressed sound). Sounds such as sea waves (in the d-day landing mission) and subpen are now played accordingly
|
||||
|
||||
#### Client
|
||||
|
||||
- Add support for smaller lightmaps (BSP files having `_sml` suffix). Smaller lightmaps are enabled at startup when the texture detail is set to `Low` and if the map supports it (single-player levels of Spearhead and Breakthrough), useful for old low-end hardware.
|
||||
- Add a new variable to customize the FOV client-side `cg_fov` (defaults to 80), the FOV is no longer an ephemeral server-side setting.
|
||||
- The FOV is automatically adjusted depending on the aspect ratio
|
||||
|
||||
#### UI
|
||||
|
||||
- Automatically scale UI and HUD for resolutions above 1920x1080 (support for 2K and above). UI and HUD elements no longer look tiny on 4K resolutions
|
||||
|
||||
### Fixed
|
||||
|
||||
- The OpenAL library has been updated to version [1.24.1](https://github.com/kcat/openal-soft/releases/tag/1.24.1).
|
||||
|
||||
#### Client
|
||||
|
||||
- Fix the client getting stuck in the loading screen when disconnected due to an error
|
||||
- Fix the client loading the map twice when the server restarts and change map immediately
|
||||
- Fix the first person model not matching the player model
|
||||
|
||||
#### General
|
||||
|
||||
- Fix letters with diacritic not being parsed nor displayed correctly in Spearhead and Breakthrough.
|
||||
- Fix a crash that would occur on some custom maps with a lot of grid patches (increased `MAX_PATCH_PLANES`).
|
||||
- Fix a rare crash that would occur when rendering static models under certain configurations.
|
||||
- Fix a stack overflow crash that would occur with a name of more than 30 characters.
|
||||
|
||||
#### AI
|
||||
|
||||
- Fix singleplayer AI not aiming at the enemy while taking cover
|
||||
- Fix singleplayer AI not dropping weapons if forcedropweapon is set on the sentient and weapon drops are disabled in the level (should be better for Breakthrough single-player maps)
|
||||
- Fix a random crash that would occur when using multiplayer bots
|
||||
- Improved multiplayer bot logic
|
||||
- Fix the match not ending after the clock reached 0:00 in round-based games
|
||||
|
||||
#### Game
|
||||
|
||||
- Fix doors closing immediately when blocked (this bug also occurs in the original game)
|
||||
- Fix smoke grenades not reapparing when loading from save
|
||||
- Fix vehicle tank tandem causing a crash when a single turret was attached
|
||||
- Make players non-solid when they're a passenger in a vehicle (fixes players getting hit/damaged by the moving vehicle)
|
||||
- Prevent the player from going out of the maximum world bounds in noclip mode (as in mohaas/mohaab)
|
||||
- Prevent the player from shooting silently by firing and dropping the weapon at the exact same time (this is trick is possible in the original game)
|
||||
- When a door is blocked (voluntarily by a player or not), it will now try to open again in the other direction, to make the door not impossible to open (this is also an issue in the original game)
|
||||
|
||||
#### Multiplayer
|
||||
|
||||
- Fix game messages not having a newline
|
||||
- Fix letters with accents not displaying in the chat box
|
||||
- Fix a bug that would make the player die or spawn with no inventory. This occurs when getting killed and respawning immediately (this bug also occurs in the original game)
|
||||
- Fix an issue where remote clients would lose track of other clients team that have changed their name
|
||||
- Fix players getting the score from previous maps if they reconnect at the right moment (this bug also occurs in the original game)
|
||||
- Fix players deaths (or total kills) being added twice in round-based matches
|
||||
- Fix spawn metrics being terrible in FFA (like players respawning right behind other players)
|
||||
- Fix teamkill kick not displayed in Spearhead and Breakthrough
|
||||
|
||||
#### Server
|
||||
|
||||
- Fix the result of the `status` command which prevented tools like `Advanced Security` from getting IP addresses (note: `Advanced Security` doesn't support IPv6 addresses)
|
||||
- Fix an issue where connecting clients would disconnect with the error `tried to parse cg message without cgame loaded`. This issue occurs in original 1.11, but was fixed in original 2.0 (Spearhead and Breakthrough)
|
||||
|
||||
#### UI
|
||||
|
||||
- Fix an issue when resizing an in-game window, the window would stop being resized when the mouse was rapidly moving
|
||||
- Fix huddraw elements being wrongly positioned on wide screen when elements have virtualscale enabled
|
||||
- Fix pulldown menus being improperly focused and activated at the same time
|
||||
- Fix the crosshair being too small or hidden when a lower `Texture Detail` value (`r_picmip`) is set
|
||||
- Properly handle long strings in the chat message box and in the game message box
|
||||
|
||||
### Changed
|
||||
|
||||
#### General
|
||||
|
||||
- Don't execute newconfig.cfg anymore as it overrides graphical settings.
|
||||
- Some errors that show in console will only print in developer mode now (`developer` set to 1), as those are not relevant for the end-user.
|
||||
- The `unnamedsoldier.cfg` configuration file will be used as a template for creating the `omconfig.cfg` configuration file if the latter doesn't exist
|
||||
|
||||
## [0.80.0] - 2024-11-24
|
||||
|
||||
### Added
|
||||
|
||||
#### Audio
|
||||
|
||||
- Add "tmvolume", so single-player scripts can adjust the music volume.
|
||||
|
||||
#### Client
|
||||
|
||||
- Add fuse stopwatch (Medal of Honor: Spearhead and Breakthrough feature).
|
||||
- Add testemitter support for creating emitters.
|
||||
- Briefings videos are now played in mohaas/mohaab.
|
||||
- The game intro is now played when the game starts.
|
||||
|
||||
#### Game module
|
||||
|
||||
- Add a server feature to tweak in-game text messages and instant messages.
|
||||
- Add a server feature to prevent unbalancing teams.
|
||||
- Add Breakthrough liberation instant messages.
|
||||
|
||||
#### Rendering
|
||||
|
||||
- Add dynamic light support for terrains
|
||||
- Add lighting for smoke FX
|
||||
- Add support for sunflares and lensflares
|
||||
- Improved the overall lighting. Objects should now be lit correctly (some issues could still occur)
|
||||
- JPEG screenshots are now supported using the `screenshotJPEG` command
|
||||
|
||||
### Fixed
|
||||
|
||||
#### Audio
|
||||
|
||||
- Ambient sounds should now play correctly on all maps.
|
||||
- Fix a crash when the sound quality was set to a value lower to `High` (which means 44 kHz).
|
||||
- Fix an occurence where some sounds would loop forever. This would occur mostly when loading a saved game.
|
||||
- Fix background ambient sounds being muted when restarting after the intermission (this is a bug in the original game).
|
||||
- The ambient sound is now completely reset on each map, which means ambient sounds from previous maps won't be heard (this is a bug in the original game).
|
||||
|
||||
#### Client
|
||||
|
||||
- Better FX
|
||||
- Fix a rare crash that would occur when loading a map.
|
||||
- Fix an issue where delayed effects wouldn't spawn, like the K5 cannon in MOH: Breakthrough, e3l3.
|
||||
- Fix animations issue when the player dies (weird shaking, etc).
|
||||
- Fix barrel water/oil leaks not showing.
|
||||
- Fix bullet holes disappearing on doors.
|
||||
- Fix emitters leaking, this would cause a massive lag in a server with a lot of players.
|
||||
- Fix issues with shaky animation in a multiplayer game, like when dying, the animation would repeat and look buggy.
|
||||
- Fix the client not being able to play on standalone non-dedicated MOH: Breakthrough servers (which would prevent awesome LAN sessions).
|
||||
- Fix the quick message mode window being shown as a full chat window.
|
||||
- In mohaas/mohaab mode, team radar icon should now blink when the teammate is talking.
|
||||
- It's now possible to navigate and play voices from the in-game voice menu.
|
||||
|
||||
#### Filesystem
|
||||
|
||||
- Fix pk3 ordering: for example, files starting with `zzzzz_name` must take precedence over `zz_name`. This should fix the issue where some mods would unexpectedly take precedence over other mods
|
||||
|
||||
#### General
|
||||
|
||||
- Fix a crash that could occur when no valid animation exist for a model.
|
||||
- Fix long subtitles not being displayed.
|
||||
- Lowered log verbosity to avoid spamming console with useless stuff. Set `developer` to 1 for more verbosity.
|
||||
- Missing animations are no longer missing.
|
||||
|
||||
#### Rendering
|
||||
|
||||
- Dynamic lights are now rendered properly and they no longer cause rendering artifacts all over the place
|
||||
- Fix a crash that would occur in terrain code on some platforms
|
||||
- Fix static models being incorrectly culled/hidden
|
||||
- Fix water and oceans being strangely deformed
|
||||
- Improved the overall lighting. Objects should now be lit correctly (some issues could still occur)
|
||||
- Sky seams and similar graphical artifacts should no longer be seen on most configurations
|
||||
|
||||
#### Server
|
||||
|
||||
- Don't send pak names to clients if download (`sv_allowDownload`) is disabled
|
||||
- Fix animations not playing (like in e2l1) when they are played while the server is starting
|
||||
- Fix an hang (infinite loop) that would occur when sv_fps is above 1000 (this bug also occurs in the original game)
|
||||
- Fix entities being sent through skyportals
|
||||
- Fix `status` returning too long columns for some programs
|
||||
- Fix velocity being incorrect on ARM systems due to a signed integer overflow
|
||||
- Reject demo clients on full servers
|
||||
- Reject non-Breakthrough clients when targeting Breakthrough
|
||||
|
||||
#### UI
|
||||
|
||||
- Fix a bug where the game would get stuck in the loading screen if the loading screen doesn't have a "continue" button
|
||||
- Fix bugs in the UI map rotation list when adding/applying
|
||||
- Improved in-game Notepad support
|
||||
- The UI should no longer lock up when refreshing/canceling the server list (this bug also occurs in the original game)
|
||||
|
||||
### Changed
|
||||
|
||||
#### Client
|
||||
|
||||
- As a protection, stufftext commands (commands that the server want clients to execute) are now filtered out, only some stufftext commands are allowed to prevent any alteration from a remote server.
|
||||
- Animations now play smoothly, a lower timescale won't result in a poorly laggy animation anymore (this is an issue in the original game).
|
||||
|
||||
#### Game
|
||||
|
||||
- Don't allow lean in single-player in the base game.
|
||||
- Don't count telefrags as teamkills (this is an issue in the original game).
|
||||
- Fix a bug where the map would not end when the remaining time left reached 0:00 and the fraglimit was set
|
||||
- Fix a crash that would occur when loading a saved game
|
||||
- Fix a memory leak issue that can be seen after a long play time, some of the memory leaks also occur in the original game
|
||||
- Fix AI animations
|
||||
- Fix AI incorrectly holding a turret too far away
|
||||
- Fix AI moving incorrectly after loading from save
|
||||
- Fix AI not turning away from walls
|
||||
- Fix AI not being able to see through a window frame
|
||||
- Fix AI running too slowly, and a rare occurence where AIs would get stuck when going down the stairs
|
||||
- Fix an issue where bullets would not hit anything behind triggers in Allied Assault, like in m2l3 from inside the vent
|
||||
- Fix an issue where the player would be invulnerable when using heavy weapons, like the Granatwerfer
|
||||
- Fix an issue where some AIs would not have a speech animation when speaking
|
||||
- Fix barrel jittering
|
||||
- Fix errors related to the script lexer & grammar
|
||||
- Fix Flak88 and Nebelwerfer destroyed models in Spearhead and Breakthrough
|
||||
- Fix jeep vehicle position on m3l2
|
||||
- Fix ladder positioning (the issue would only occur on 64-bit systems)
|
||||
- Fix player position on a vehicle turret gun (like the AA gun, or the Granatwerfer)
|
||||
- Fix sentients still dropping their weapons even if the level has disabled weapon drops
|
||||
- Fix some rare mods not loading properly due to an error in the script lexer
|
||||
- Fix some script models not having any animation after loading from save
|
||||
- Fix the barrel jittering
|
||||
- Fix the roof top door on e1l3 (with Gino Corelli) opening when closing the handle (due to an incorrect returned result of a script command)
|
||||
- Fix vehicle turret gun not making any sounds
|
||||
- Fix vehicle turret gun being out of sync with the vehicle after loading from save (this issue also occurs in the original game)
|
||||
- Fix weapon pickups where picking up a weapon with only 1 ammo remaining (like a grenade) would not pick the ammo up (this is a bug in the original game)
|
||||
- Fix weapprev/weappnext/weapdrop switching to inventory item like binoculars
|
||||
- Navigation fixes
|
||||
|
||||
#### Server
|
||||
|
||||
- Clients who are not sent to others (invisible + not sent to snapshots) won't be able to use anything like doors, and won't be able to send instant/voice messages
|
||||
|
||||
## [0.70.0] - 2024-09-02
|
||||
|
||||
### Added
|
||||
|
||||
#### Binaries
|
||||
|
||||
- This new version ships with binaries for PowerPC, PowerPC64 and PowerPC64 Little-Endian. Currently experimental and the client may not work correctly.
|
||||
- For linux binaries, AARCH64 was renamed to ARM64
|
||||
|
||||
#### General
|
||||
|
||||
- Add a default idle animation for TIKI files not having any animation
|
||||
|
||||
#### Rendering
|
||||
|
||||
- Add support for DDS textures
|
||||
- Add morphs: dynamic facial expressions for characters
|
||||
- Implemented sky portal
|
||||
|
||||
#### Sound
|
||||
|
||||
- Add OpenAL support:
|
||||
- Ambient sound (soundtrack)
|
||||
- HRTF can be used on OpenAL by setting the speaker type to `Headphones`
|
||||
- Loopsounds
|
||||
- Music support (triggered music)
|
||||
- Proper sound entity spatialization
|
||||
- Streamed sounds - audio files (such as music) are streamed from disk without them being entirely loaded in memory
|
||||
- Volume/Pitch variation
|
||||
|
||||
#### UI
|
||||
|
||||
- Add in-game Notepad (thanks to @pryon)
|
||||
- Add screenshots for saved games
|
||||
|
||||
### Fixed
|
||||
|
||||
#### General
|
||||
|
||||
- Animation fixes
|
||||
- Fix a crash related to localization (due to some strings containing a backtick)
|
||||
- Fix some models having surfaces without a shader
|
||||
- Fix entity collision
|
||||
- Fix bad terrain/patch collision with grenades
|
||||
- Fix improper collision on fences - it's now possible to target flak88 behind barbwires with binoculars
|
||||
- Fix load/save game crashes
|
||||
- Networking fixes
|
||||
- Improved support for big-endian architectures (like PowerPC 32/64 bits and ARM in big-endian mode)
|
||||
|
||||
#### Client
|
||||
|
||||
- Fix entities being incorrectly attached sometimes
|
||||
|
||||
##### CGame module
|
||||
|
||||
- Bullet hit effects like snow, water and glass are fixed, as well as bullet tracers and flesh impacts
|
||||
- Corrected Gewehrgranate viewmodel animations
|
||||
- Fix occasional crashes due to volumetric smoke
|
||||
- Fix marks not showing on entities like doors
|
||||
- Invisible models fix
|
||||
- Rain/snow should now be properly working
|
||||
- Various fixes for special FX
|
||||
|
||||
#### Server
|
||||
|
||||
- Fix configstrings overflow on big maps, like t1l2 on MOH: Spearhead
|
||||
|
||||
##### Game module
|
||||
|
||||
- Door fixes, like door opening in the wrong direction
|
||||
- Physics fixes, like grenade bouncing
|
||||
- Fix AIs: they're less dumb than on previous versions
|
||||
- Fix the artillery system (ProjectileGenerator) - fixes for t2l3, t2l4...
|
||||
- Fix game loading/saving having wrong datas
|
||||
- Fix the scoreboard on FFA and for spectators
|
||||
- Fix the script engine - all scripts must be working now
|
||||
- Fix an issue with spawnpoints where the player wouldn't spawn at the correct spot
|
||||
- The mine detector correctly detect mines, in single-player
|
||||
- The mission date (such as "JUNE 6, 1944") is now displayed
|
||||
- The vehicle system is now fully working properly: no more vehicles getting stuck
|
||||
- Singleplayer maps are all completable now (although some rare bugs may occur)
|
||||
|
||||
#### Rendering
|
||||
|
||||
- Fix crashes related to terrain
|
||||
- Fix crashes related to `vid_restart` and `snd_restart`
|
||||
- Fix strange lighting when `Full entity lighting` is disabled
|
||||
- Lighting related fixes
|
||||
- Most shaders should correctly load
|
||||
|
||||
#### UI
|
||||
|
||||
- Fix crashes related to UI
|
||||
- Fix `vid_restart` breaking the UI
|
||||
- Fix the multiplayer map picker displaying the same maps twice
|
||||
- Player model picker should now be displaying characters properly
|
||||
- Properly show the "disconnected" menu when the client get disconnected from a server
|
||||
|
||||
## [0.61.0] - 2024-01-08
|
||||
|
||||
### Added
|
||||
|
||||
#### Game Module
|
||||
|
||||
- Landmines are now fully working (a **Medal of Honor: Allied Assault Breakthrough** feature)
|
||||
- Script command documentation can now be exported properly using `dumpallclasses` command
|
||||
|
||||
#### Client
|
||||
|
||||
- Add single-player map list and multiplayer map list
|
||||
- Add map rotation list for multiplayer
|
||||
- Add player model selection list
|
||||
- Add LAN game searcher
|
||||
- Add subtitles, centerprint, and locationprint
|
||||
- Add the miniconsole
|
||||
- Binds can now be set
|
||||
|
||||
### Fixed
|
||||
|
||||
#### Game module
|
||||
|
||||
- Crash fixes
|
||||
- Fix callvote with invalid strings
|
||||
- Fix grenade crash
|
||||
- Fix weapons being attached to the wrong player's hand under some circumstances
|
||||
- Players should now get the correct loadout in multiplayer
|
||||
- `sv_fps` with a value higher than 20 shouldn't cause issues anymore with animations
|
||||
|
||||
#### Client
|
||||
|
||||
- 3D player models are now shown in the main menu screen
|
||||
- Configstring can now be handled in multiple chunks
|
||||
- Fix mohaas server version mismatch in the server list when using mohaab target game
|
||||
- Fix vote menu not working
|
||||
- Fix UI sounds not working
|
||||
- Fix locationprint and centerprint not working
|
||||
|
||||
## [0.60.2] - 2023-11-29
|
||||
|
||||
### Fixed
|
||||
|
||||
#### Game Module
|
||||
- Fix pain animations
|
||||
- Fix portable turret animations
|
||||
- Fix game crashing when saving and/or loading from save
|
||||
|
||||
#### ClientGame Module
|
||||
- Fix for the client game module not hiding the stats screen
|
||||
|
||||
#### Server
|
||||
- Fix level file archive
|
||||
|
||||
## [0.60.1] - 2023-11-15
|
||||
|
||||
### Changed
|
||||
|
||||
- The carryable turret (packed MG42 turret) can now be placed
|
||||
|
||||
### Fixed
|
||||
|
||||
- Fix bullet tracers, they should now be working correctly
|
||||
- Fix a bug where player could get stuck in turret mode after the turret was removed
|
||||
|
||||
## [0.60.0] - 2023-11-15
|
||||
|
||||
### Added
|
||||
|
||||
- Add non-pvs feature (hide players from other clients who cannot see them)
|
||||
- Add more SH and BT features
|
||||
- Add ioq3 server features
|
||||
- Mostly implemented AI Actor (still buggy)
|
||||
- Implemented Vehicle and TurretGun from BT 2.40
|
||||
- Implemented voting system
|
||||
|
||||
### Changed
|
||||
|
||||
- Configs are now stored in the homepath
|
||||
- Binaries are now stored in the root folder (no need to replace existing MOH binaries anymore)
|
||||
- Crashes fixes
|
||||
- Rendering fixes, client fixes, game fixes and script engine fixes
|
||||
|
||||
## [0.58.1] - 2023-08-21
|
||||
|
||||
### Fixed
|
||||
|
||||
- Fix demo recordings not working with different protocols
|
||||
- Publish `sv_fps` in server info variables
|
||||
|
||||
## [0.58.0] - 2023-08-20
|
||||
|
||||
### Added
|
||||
|
||||
- Multiplayer bot support
|
||||
- Server browser
|
||||
|
||||
#### Spearhead and Breakthrough features
|
||||
|
||||
- Animated farplanes
|
||||
- Bullets through wood/metal
|
||||
- Smokes
|
||||
- Sprint
|
||||
- Compass radar (icon of teammates on the compass)
|
||||
- Landmines
|
||||
- Tug-of-War and Liberation game types
|
||||
- ...
|
||||
|
||||
### Fixed
|
||||
|
||||
- Fix bugs, and crashes
|
||||
- Fix training map not working
|
||||
- The script engine should now be fully compatible with mohaa scripts
|
||||
|
||||
## [0.57.0] - 2023-07-25
|
||||
|
||||
### Added
|
||||
|
||||
#### Renderer
|
||||
|
||||
- Sphere lights for entities
|
||||
- Light grid entity lighting
|
||||
- Light grid support from Spearhead and Breakthrough
|
||||
|
||||
#### Game
|
||||
|
||||
- Allow/disallow leaning while moving (Spearhead and Breakthrough)
|
||||
|
||||
## [0.56.0] - 2023-07-23
|
||||
|
||||
### Added
|
||||
|
||||
- Add bullets, bullet trails, emitters, explosions, marks, model attachment, special effects, viewmodel anim
|
||||
- Add fog, font, dynamic lights, shader fade, sprite, trees
|
||||
|
||||
### Changed
|
||||
|
||||
- Use a single executable to play on mohaa, moh_spearhead or moh_breakthrough servers, by starting openmohaa with `+set com_target_game x` commandline (check README)
|
||||
|
||||
### Fixed
|
||||
|
||||
- Fix disconnect menu not working
|
||||
- Fix compass not working
|
||||
- Fix crashes
|
||||
|
||||
## [0.55.3] - 2023-06-27
|
||||
|
||||
## [0.55.2] - 2023-06-27
|
||||
|
||||
### Added
|
||||
|
||||
- Add Breakthrough-compatible executable
|
||||
|
||||
## [0.55.1] - 2023-06-24
|
||||
|
||||
## [0.54.0] - 2023-05-30
|
||||
|
||||
### Added
|
||||
|
||||
- ioquake3 backport
|
||||
- SDL2 support, which means input, rendering and sound improvements
|
||||
- Better console support (using OS console host, rather than a custom Windows 95 console)
|
||||
- Rendering improvement: sprite support, light glow support (light coronas), more shaders support, minor fixes, and beam fixes
|
||||
- Sound improvement: MP3 support + better sound/format support
|
||||
- Client game: better emitter support, scoreboard fixes, kar98 overlay fix
|
||||
- Networking improvement
|
||||
- UI improvement: using Spearhead/Breakthrough gmbox/dmbox placement
|
||||
|
||||
### Fixed
|
||||
|
||||
- Fix compass scale
|
||||
|
||||
## [0.53.2] - 2023-05-23
|
||||
|
||||
### Added
|
||||
|
||||
- ARM support
|
||||
- DDS texture support
|
||||
- Death messages on Spearhead/Breakthrough
|
||||
|
||||
### Fixed
|
||||
|
||||
- More SH/BT fixes
|
||||
- Networking fixes
|
||||
- UI/HUD fixes
|
||||
- Weapon binding fixes
|
||||
|
||||
## [0.53.1] - 2023-05-22
|
||||
|
||||
### Fixed
|
||||
|
||||
- Crashes fixes
|
||||
- Minor fixes
|
||||
- Rendering fixes (especially for menus in SH/BT)
|
||||
- Scoreboard fixes for SH/BT
|
||||
|
||||
## [0.53.0] - 2023-05-21
|
||||
|
||||
### Added
|
||||
|
||||
- Add support for Spearhead (TA/Team Assault) and Breakthrough (TT/Team Tactics) server/client
|
||||
|
||||
### Fixed
|
||||
|
||||
- Bug fixes
|
||||
|
||||
## [0.52.0] - 2023-05-21
|
||||
|
||||
### Changed
|
||||
|
||||
- Use semantic version number
|
||||
|
||||
### Fixed
|
||||
|
||||
- Rendering fixes
|
||||
- UI fixes
|
||||
|
||||
## [0.51a] - 2023-05-20
|
||||
|
||||
### Fixed
|
||||
|
||||
- Crash fixes
|
||||
- Lighting tweaks
|
||||
- Performance fixes
|
||||
|
||||
## [0.51] - 2023-05-20
|
||||
|
||||
### Added
|
||||
|
||||
- Loading screens
|
||||
- Scoreboard
|
||||
- Weapon buttons
|
||||
|
||||
## [0.50a] - 2023-05-19
|
||||
|
||||
### Added
|
||||
|
||||
- Fog support
|
||||
|
||||
### Fixed
|
||||
|
||||
- Fix static model
|
||||
|
||||
## [0.50] - 2023-05-18
|
||||
|
||||
### Added
|
||||
|
||||
- Almost full LOD terrain support
|
||||
- Basic sound implementation
|
||||
- Better multi-texture support
|
||||
|
||||
## [0.49f] - 2023-05-18
|
||||
|
||||
### Added
|
||||
|
||||
- Client binaries
|
||||
|
||||
## [0.49e] - 2023-02-05
|
||||
|
||||
## [0.49d] - 2023-02-05
|
||||
|
||||
## [0.49c] - 2023-02-03
|
||||
|
||||
## [0.49b] - 2023-01-30
|
||||
|
||||
## [0.49] - 2023-01-29
|
||||
|
||||
### Added
|
||||
|
||||
- This is the first public release on GitHub with CMake support. Dedicated-only binaries.
|
||||
|
||||
[unreleased]: https://github.com/openmoh/openmohaa/compare/v0.82.1...HEAD
|
||||
[0.82.1]: https://github.com/openmoh/openmohaa/compare/v0.82.0...v0.82.1
|
||||
[0.82.0]: https://github.com/openmoh/openmohaa/compare/v0.81.1...v0.82.0
|
||||
[0.81.1]: https://github.com/openmoh/openmohaa/compare/v0.81.0...v0.81.1
|
||||
[0.81.0]: https://github.com/openmoh/openmohaa/compare/v0.80.0...v0.81.0
|
||||
[0.80.0]: https://github.com/openmoh/openmohaa/compare/v0.70.0...v0.80.0
|
||||
[0.70.0]: https://github.com/openmoh/openmohaa/compare/v0.61.0...v0.70.0
|
||||
[0.61.0]: https://github.com/openmoh/openmohaa/compare/v0.60.2...v0.61.0
|
||||
[0.60.2]: https://github.com/openmoh/openmohaa/compare/v0.60.1...v0.60.2
|
||||
[0.60.1]: https://github.com/openmoh/openmohaa/compare/v0.60.0...v0.60.1
|
||||
[0.60.0]: https://github.com/openmoh/openmohaa/compare/v0.58.0...v0.60.0
|
||||
[0.58.1]: https://github.com/openmoh/openmohaa/compare/v0.58.0...v0.58.1
|
||||
[0.58.0]: https://github.com/openmoh/openmohaa/compare/v0.57.0...v0.58.0
|
||||
[0.57.0]: https://github.com/openmoh/openmohaa/compare/v0.56.0...v0.57.0
|
||||
[0.56.0]: https://github.com/openmoh/openmohaa/compare/v0.55.3...v0.56.0
|
||||
[0.55.3]: https://github.com/openmoh/openmohaa/compare/v0.55.2...v0.55.3
|
||||
[0.55.2]: https://github.com/openmoh/openmohaa/compare/v0.55.1...v0.55.2
|
||||
[0.55.1]: https://github.com/openmoh/openmohaa/compare/v0.54.0...v0.55.1
|
||||
[0.54.0]: https://github.com/openmoh/openmohaa/compare/v0.53.2...v0.54.0
|
||||
[0.53.2]: https://github.com/openmoh/openmohaa/compare/v0.53.1...v0.53.2
|
||||
[0.53.1]: https://github.com/openmoh/openmohaa/compare/v0.53.0...v0.53.1
|
||||
[0.53.0]: https://github.com/openmoh/openmohaa/compare/v0.52.0...v0.53.0
|
||||
[0.52.0]: https://github.com/openmoh/openmohaa/compare/0.51a...v0.52.0
|
||||
[0.51a]: https://github.com/openmoh/openmohaa/compare/0.51...0.51a
|
||||
[0.51]: https://github.com/openmoh/openmohaa/compare/0.50a...0.51
|
||||
[0.50a]: https://github.com/openmoh/openmohaa/compare/0.50...0.50a
|
||||
[0.50]: https://github.com/openmoh/openmohaa/compare/0.49f...0.50
|
||||
[0.49f]: https://github.com/openmoh/openmohaa/compare/0.49e...0.49f
|
||||
[0.49e]: https://github.com/openmoh/openmohaa/compare/0.49d...0.49e
|
||||
[0.49d]: https://github.com/openmoh/openmohaa/compare/0.49c...0.49d
|
||||
[0.49c]: https://github.com/openmoh/openmohaa/compare/0.49b...0.49c
|
||||
[0.49b]: https://github.com/openmoh/openmohaa/compare/0.49...0.49b
|
||||
[0.49]: https://github.com/openmoh/openmohaa/releases/tag/0.49
|
||||
+73
-232
@@ -1,250 +1,91 @@
|
||||
cmake_minimum_required(VERSION 3.12)
|
||||
project(openmohaa)
|
||||
cmake_minimum_required(VERSION 3.25)
|
||||
|
||||
include(misc/cmake/TargetArch.cmake)
|
||||
|
||||
target_architecture(TARGET_ARCH)
|
||||
list(LENGTH TARGET_ARCH TARGET_ARCH_COUNT)
|
||||
|
||||
set(USE_INTERNAL_LIBS ON)
|
||||
if(USE_SYSTEM_LIBS)
|
||||
set(USE_INTERNAL_LIBS OFF)
|
||||
if(POLICY CMP0177)
|
||||
# Policy CMP0177: install() DESTINATION paths are normalized
|
||||
# Introduced in CMake 3.31
|
||||
cmake_policy(SET CMP0177 NEW)
|
||||
endif()
|
||||
|
||||
option(USE_INTERNAL_JPEG "If set, use bundled libjpeg." ${USE_INTERNAL_LIBS})
|
||||
option(USE_INTERNAL_MAD "If set, use bundled libmad." ${USE_INTERNAL_LIBS})
|
||||
option(USE_INTERNAL_ZLIB "If set, use bundled zlib." ${USE_INTERNAL_LIBS})
|
||||
option(USE_RENDERER_DLOPEN "Whether to compile the renderer as separate pluggable modules" OFF)
|
||||
list(APPEND CMAKE_MODULE_PATH ${CMAKE_SOURCE_DIR}/cmake)
|
||||
include(identity)
|
||||
|
||||
if(TARGET_GAME_TYPE)
|
||||
message(SEND_ERROR "TARGET_GAME_TYPE is now unsupported, it is now done at runtime.")
|
||||
project(${PROJECT_NAME} VERSION ${PROJECT_VERSION} LANGUAGES C CXX)
|
||||
|
||||
option(BUILD_SERVER "Build dedicated server" ON)
|
||||
option(BUILD_CLIENT "Build client" ON)
|
||||
option(BUILD_RENDERER_GL1 "Build GL1 renderer" ON)
|
||||
# The original fixed function renderer needs a translation layer to reach
|
||||
# OpenGL ES; see cmake/libraries/gl4es.cmake for why it is worth having.
|
||||
option(USE_GL4ES "Translate the GL1 renderer's fixed function calls to OpenGL ES" ${ANDROID})
|
||||
option(BUILD_RENDERER_GL2 "Build GL2 renderer" OFF)
|
||||
option(BUILD_GAME_LIBRARIES "Build game module libraries" ON)
|
||||
option(BUILD_GAME_QVMS "Build game module qvms" ON)
|
||||
option(BUILD_STANDALONE "Build binaries for standalone games" OFF)
|
||||
|
||||
option(USE_RENDERER_DLOPEN "Dynamically load the renderer(s)" ON)
|
||||
option(USE_OPENAL "OpenAL audio" ON)
|
||||
option(USE_OPENXR "OpenXR stereo rendering and tracking" OFF)
|
||||
option(USE_OPENAL_DLOPEN "Dynamically load OpenAL" ON)
|
||||
option(USE_HTTP "HTTP download support" ON)
|
||||
option(USE_CODEC_VORBIS "Ogg Vorbis support" ON)
|
||||
option(USE_CODEC_OPUS "Ogg Opus support" ON)
|
||||
option(USE_CODEC_MAD "MP3 support" ON)
|
||||
option(USE_VOIP "Voice chat" OFF)
|
||||
option(USE_MUMBLE "Mumble support" OFF)
|
||||
option(USE_FREETYPE "Freetype font rendering" OFF)
|
||||
|
||||
option(USE_INTERNAL_LIBS "Use internally packaged libraries" ON)
|
||||
option(USE_INTERNAL_SDL "Use internal SDL binary (if available)" ${USE_INTERNAL_LIBS})
|
||||
option(USE_INTERNAL_ZLIB "Use internal copy of zlib" ${USE_INTERNAL_LIBS})
|
||||
option(USE_INTERNAL_JPEG "Use internal copy of libjpeg" ${USE_INTERNAL_LIBS})
|
||||
option(USE_INTERNAL_OGG "Use internal copy of ogg" ${USE_INTERNAL_LIBS})
|
||||
option(USE_INTERNAL_VORBIS "Use internal copy of vorbis" ${USE_INTERNAL_LIBS})
|
||||
option(USE_INTERNAL_OPUS "Use internal copy of opus" ${USE_INTERNAL_LIBS})
|
||||
option(USE_INTERNAL_MAD "Use internal copy of libmad" ${USE_INTERNAL_LIBS})
|
||||
|
||||
# Release build by default, set externally if you want something else
|
||||
if(NOT CMAKE_CONFIGURATION_TYPES AND NOT CMAKE_BUILD_TYPE)
|
||||
set(CMAKE_BUILD_TYPE Release)
|
||||
endif()
|
||||
|
||||
set(TARGET_BASE_GAME "./")
|
||||
set(CMAKE_DEBUG_POSTFIX "-dbg")
|
||||
|
||||
#
|
||||
# Microsoft compiler specific parameters
|
||||
#
|
||||
if(MSVC)
|
||||
add_definitions(-D_CRT_SECURE_NO_WARNINGS -D_CRT_NONSTDC_NO_DEPRECATE)
|
||||
# Treat no return type as error
|
||||
add_compile_options(/we4715)
|
||||
# Try to enable LTO by default
|
||||
include(CheckIPOSupported)
|
||||
check_ipo_supported(RESULT IPO_SUPPORTED)
|
||||
if(IPO_SUPPORTED)
|
||||
set(CMAKE_INTERPROCEDURAL_OPTIMIZATION TRUE)
|
||||
set(CMAKE_INTERPROCEDURAL_OPTIMIZATION_DEBUG FALSE)
|
||||
endif()
|
||||
|
||||
#
|
||||
# Clang and GCC specific parameters
|
||||
#
|
||||
if(CMAKE_C_COMPILER_ID MATCHES "Clang" OR CMAKE_CXX_COMPILER_ID MATCHES "Clang" OR CMAKE_C_COMPILER_ID STREQUAL "GNU" OR CMAKE_CXX_COMPILER_ID STREQUAL "GNU")
|
||||
add_compile_options(-Wno-comment)
|
||||
# Treat no return type as error
|
||||
add_compile_options(-Werror=return-type)
|
||||
endif()
|
||||
set(CMAKE_C_STANDARD 17)
|
||||
set(CMAKE_C_STANDARD_REQUIRED ON)
|
||||
set(CMAKE_CXX_STANDARD 17)
|
||||
set(CMAKE_CXX_STANDARD_REQUIRED ON)
|
||||
set(CMAKE_SHARED_LIBRARY_PREFIX "")
|
||||
|
||||
#
|
||||
# Clang specific parameters
|
||||
#
|
||||
if(CMAKE_CXX_COMPILER_ID STREQUAL "Clang")
|
||||
# Ignore warnings for code like 'assert("Assert string")'
|
||||
add_compile_options(-Wno-pointer-bool-conversion)
|
||||
endif()
|
||||
set(SOURCE_DIR ${CMAKE_SOURCE_DIR}/code)
|
||||
|
||||
#
|
||||
# GCC specific parameters
|
||||
#
|
||||
if (CMAKE_CXX_COMPILER_ID STREQUAL "GNU")
|
||||
# Add this option on gcc to prevent functions from having the STB_GNU_UNIQUE binding
|
||||
# Otherwise, it would prevent libraries from being unloaded
|
||||
# which will cause undefined behavior and crashes due to memory corruption
|
||||
add_compile_options(-fno-gnu-unique)
|
||||
endif()
|
||||
|
||||
if(DEBUG_MEMORY)
|
||||
add_definitions(-D_DEBUG_MEM)
|
||||
endif()
|
||||
|
||||
message(STATUS "Architecture detected: ${TARGET_ARCH}")
|
||||
|
||||
set(TARGET_BIN_SUFFIX "")
|
||||
|
||||
if(WIN32)
|
||||
set(TARGET_PLATFORM_PREFIX "")
|
||||
message(STATUS "Using Win32 naming convention")
|
||||
elseif(UNIX)
|
||||
set(TARGET_PLATFORM_PREFIX "")
|
||||
message(STATUS "Using Unix naming convention")
|
||||
else()
|
||||
set(TARGET_PLATFORM_PREFIX "")
|
||||
endif()
|
||||
|
||||
if(CMAKE_BUILD_TYPE MATCHES Debug)
|
||||
add_compile_definitions(_DEBUG)
|
||||
|
||||
# NOTE: The following may mess up function importation
|
||||
#if(UNIX)
|
||||
# # Enable all exports so all functions name can be seen during executable crash
|
||||
# set(CMAKE_ENABLE_EXPORTS ON)
|
||||
# message(STATUS "Enabling exports on Unix for backtrace")
|
||||
#endif()
|
||||
else()
|
||||
# Non-debug builds
|
||||
add_compile_definitions(NDEBUG)
|
||||
endif()
|
||||
|
||||
if(APPLE)
|
||||
# macOS doesn't search the executable path by default
|
||||
# so, locate libraries like SDL in the executable path
|
||||
set(CMAKE_INSTALL_RPATH "@executable_path")
|
||||
set(CMAKE_BUILD_WITH_INSTALL_RPATH ON)
|
||||
|
||||
if(CMAKE_C_COMPILER_ID MATCHES "Clang" OR CMAKE_C_COMPILER_ID STREQUAL "GNU")
|
||||
# Set the visibility to hidden on macOS to prevent shared libraries from
|
||||
# using functions in the executable
|
||||
# it's ok to hide them because the backtrace on macOS will still print the name of the functions
|
||||
add_compile_options(-fvisibility=hidden)
|
||||
endif()
|
||||
endif()
|
||||
|
||||
#
|
||||
# Setup the installation directory
|
||||
#
|
||||
if(WIN32)
|
||||
# By default, both DLLs and EXEs are in the same directory
|
||||
set(CMAKE_DEFAULT_INSTALL_RUNTIME_DIR bin)
|
||||
set(BIN_INSTALL_SUBDIR ".")
|
||||
set(LIB_INSTALL_SUBDIR ".")
|
||||
else()
|
||||
# Unix
|
||||
set(CMAKE_DEFAULT_INSTALL_RUNTIME_DIR lib${CMAKE_LIB_SUFFIX})
|
||||
set(BIN_INSTALL_SUBDIR ${CMAKE_PROJECT_NAME})
|
||||
set(LIB_INSTALL_SUBDIR ${CMAKE_PROJECT_NAME})
|
||||
endif()
|
||||
|
||||
# By default, put both binaries and shared libraries in the same directory
|
||||
# the game uses internal shared libraries that must be in the same folder as the binaries
|
||||
set(CMAKE_INSTALL_BINDIR ${CMAKE_DEFAULT_INSTALL_RUNTIME_DIR} CACHE PATH "Binary dir")
|
||||
set(CMAKE_INSTALL_LIBDIR ${CMAKE_INSTALL_BINDIR} CACHE PATH "Library dir")
|
||||
include(GNUInstallDirs)
|
||||
# Enable unit testing
|
||||
include(CTest)
|
||||
|
||||
#
|
||||
# Common stuff
|
||||
#
|
||||
add_subdirectory("code/qcommon")
|
||||
add_subdirectory("code/gamespy")
|
||||
|
||||
#
|
||||
# Application
|
||||
#
|
||||
add_subdirectory("code/sys")
|
||||
|
||||
##
|
||||
## Server app
|
||||
##
|
||||
add_subdirectory("code/server")
|
||||
|
||||
add_executable(omohaaded "code/null/null_client.c" "code/null/null_input.c" "code/null/null_snddma.c")
|
||||
target_compile_definitions(omohaaded PRIVATE APP_MODULE DEDICATED)
|
||||
target_compile_features(omohaaded PUBLIC cxx_nullptr)
|
||||
target_compile_features(omohaaded PUBLIC c_variadic_macros)
|
||||
target_link_libraries(omohaaded PRIVATE omohserver)
|
||||
target_link_libraries(omohaaded PRIVATE syslib)
|
||||
target_link_libraries(omohaaded PRIVATE qcommon qcommon_standalone)
|
||||
|
||||
# Add the gamespy dependency
|
||||
target_include_directories(omohaaded PUBLIC "code/qcommon" "code/script" "code/gamespy" "code/server")
|
||||
set_target_properties(omohaaded PROPERTIES OUTPUT_NAME "omohaaded${TARGET_BIN_SUFFIX}")
|
||||
set_target_properties(omohaaded PROPERTIES DEBUG_POSTFIX ${CMAKE_DEBUG_POSTFIX})
|
||||
|
||||
INSTALL(TARGETS omohaaded DESTINATION ${CMAKE_INSTALL_BINDIR}/${BIN_INSTALL_SUBDIR})
|
||||
|
||||
if (MSVC)
|
||||
target_link_options(omohaaded PRIVATE "/MANIFEST:NO")
|
||||
INSTALL(FILES $<TARGET_PDB_FILE:omohaaded> DESTINATION ${CMAKE_INSTALL_BINDIR}/${BIN_INSTALL_SUBDIR} OPTIONAL)
|
||||
if(DEFINED ENV{SOURCE_DATE_EPOCH})
|
||||
string(TIMESTAMP PRODUCT_DATE "%b %d %Y" UTC)
|
||||
add_compile_definitions(PRODUCT_DATE="${PRODUCT_DATE}")
|
||||
endif()
|
||||
|
||||
if (NOT BUILD_NO_CLIENT)
|
||||
##
|
||||
## Client app
|
||||
##
|
||||
option(NO_MODERN_DMA "Use older sound-system" FALSE)
|
||||
include(compilers/all)
|
||||
include(platforms/all)
|
||||
include(libraries/all)
|
||||
include(deploy/all)
|
||||
|
||||
add_subdirectory("code/client")
|
||||
add_subdirectory("code/renderercommon")
|
||||
add_subdirectory("code/sdl")
|
||||
include(version)
|
||||
|
||||
add_executable(openmohaa "misc/dummy.c")
|
||||
target_link_libraries(openmohaa PRIVATE syslib)
|
||||
target_link_libraries(openmohaa PRIVATE omohserver)
|
||||
target_link_libraries(openmohaa PRIVATE omohclient)
|
||||
target_link_libraries(openmohaa PRIVATE omohrenderer)
|
||||
target_link_libraries(openmohaa PRIVATE qcommon qcommon_standalone)
|
||||
include(server)
|
||||
include(renderer_gl1)
|
||||
include(renderer_gl2)
|
||||
include(client)
|
||||
include(basegame)
|
||||
#include(missionpack)
|
||||
include(launcher)
|
||||
|
||||
# Add the gamespy dependency
|
||||
target_include_directories(openmohaa PUBLIC "code/qcommon" "code/script" "code/gamespy" "code/server" "code/client" "code/uilib")
|
||||
set_target_properties(openmohaa PROPERTIES OUTPUT_NAME "openmohaa${TARGET_BIN_SUFFIX}")
|
||||
set_target_properties(openmohaa PROPERTIES DEBUG_POSTFIX ${CMAKE_DEBUG_POSTFIX})
|
||||
|
||||
if(USE_INTERNAL_JPEG)
|
||||
target_include_directories(openmohaa PUBLIC "code/jpeg-8c")
|
||||
target_link_libraries(openmohaa PRIVATE jpeg8)
|
||||
else()
|
||||
find_package(JPEG REQUIRED)
|
||||
target_include_directories(openmohaa PUBLIC ${JPEG_INCLUDE_DIRS})
|
||||
target_link_libraries(openmohaa PRIVATE ${JPEG_LIBRARIES})
|
||||
endif()
|
||||
|
||||
INSTALL(TARGETS openmohaa DESTINATION ${CMAKE_INSTALL_BINDIR}/${BIN_INSTALL_SUBDIR})
|
||||
|
||||
if (MSVC)
|
||||
target_link_options(openmohaa PRIVATE "/MANIFEST:NO")
|
||||
INSTALL(FILES $<TARGET_PDB_FILE:openmohaa> DESTINATION ${CMAKE_INSTALL_BINDIR}/${BIN_INSTALL_SUBDIR} OPTIONAL)
|
||||
endif()
|
||||
|
||||
if(UNIX AND NOT APPLE)
|
||||
# Configure the .desktop entries with the arch suffix
|
||||
configure_file(
|
||||
misc/linux/org.openmoh.openmohaa.desktop.in
|
||||
${CMAKE_BINARY_DIR}/misc/linux/org.openmoh.openmohaa.desktop
|
||||
@ONLY
|
||||
)
|
||||
configure_file(
|
||||
misc/linux/org.openmoh.openmohaab.desktop.in
|
||||
${CMAKE_BINARY_DIR}/misc/linux/org.openmoh.openmohaab.desktop
|
||||
@ONLY
|
||||
)
|
||||
configure_file(
|
||||
misc/linux/org.openmoh.openmohaas.desktop.in
|
||||
${CMAKE_BINARY_DIR}/misc/linux/org.openmoh.openmohaas.desktop
|
||||
@ONLY
|
||||
)
|
||||
|
||||
# Install .desktop entries
|
||||
install(FILES ${CMAKE_BINARY_DIR}/misc/linux/org.openmoh.openmohaa.desktop DESTINATION ${CMAKE_INSTALL_DATADIR}/applications)
|
||||
install(FILES ${CMAKE_BINARY_DIR}/misc/linux/org.openmoh.openmohaab.desktop DESTINATION ${CMAKE_INSTALL_DATADIR}/applications)
|
||||
install(FILES ${CMAKE_BINARY_DIR}/misc/linux/org.openmoh.openmohaas.desktop DESTINATION ${CMAKE_INSTALL_DATADIR}/applications)
|
||||
|
||||
install(FILES misc/linux/org.openmoh.openmohaa.metainfo.xml DESTINATION ${CMAKE_INSTALL_DATADIR}/metainfo)
|
||||
|
||||
install(FILES misc/openmohaa.svg DESTINATION ${CMAKE_INSTALL_DATADIR}/icons/hicolor/symbolic/apps/ RENAME org.openmoh.openmohaa.svg)
|
||||
endif()
|
||||
endif()
|
||||
|
||||
#
|
||||
# Launcher
|
||||
#
|
||||
add_subdirectory(code/Launcher)
|
||||
|
||||
#
|
||||
# uninstall target
|
||||
#
|
||||
if(NOT TARGET uninstall)
|
||||
configure_file(
|
||||
"${CMAKE_CURRENT_SOURCE_DIR}/cmake_uninstall.cmake.in"
|
||||
"${CMAKE_CURRENT_BINARY_DIR}/cmake_uninstall.cmake"
|
||||
IMMEDIATE @ONLY)
|
||||
|
||||
add_custom_target(uninstall
|
||||
COMMAND ${CMAKE_COMMAND} -P ${CMAKE_CURRENT_BINARY_DIR}/cmake_uninstall.cmake)
|
||||
endif()
|
||||
include(post_configure)
|
||||
#include(installer)
|
||||
+191
@@ -0,0 +1,191 @@
|
||||
# Contributing guidelines
|
||||
|
||||
Whether you're reporting issues or coding, follow the guidelines below to help keep the project consistent and maintainable.
|
||||
|
||||
All contributions, including **issues**, **discussions**, **code comments**, **commit messages**, and **documentation**, must be written in *English*. This ensures clarity and consistency for all contributors.
|
||||
|
||||
There are many ways to contribute. Contributions are welcome in the following areas:
|
||||
- Fixing [bugs and crashes](#issues).
|
||||
- Documentation improvements
|
||||
- Performance improvements
|
||||
- Testing
|
||||
- Helping users (issues, discussions)
|
||||
- Suggesting enhancements (via issues only)
|
||||
|
||||
New features are designed and implemented by maintainers, so the project's direction and maintenance burden stay consistent.
|
||||
|
||||
If you want to propose a new feature, please open an issue first.
|
||||
|
||||
Do not start implementing a new feature before getting approval. Pull requests that introduce unapproved features may be closed without review.
|
||||
|
||||
---
|
||||
|
||||
## Issues
|
||||
|
||||
Before opening a new issue:
|
||||
1. Make sure you're running the [latest development version](https://github.com/openmoh/openmohaa/releases/tag/dev).
|
||||
2. Check if the issue already exists.
|
||||
|
||||
When filing an issue, include as much detail as possible, this helps reproducing and fixing the problem effectively:
|
||||
- Clear description of the bug.
|
||||
- Steps to reproduce.
|
||||
- Log file (`qconsole.log`) and crash output if applicable:
|
||||
- Attach the relevant log file.
|
||||
- For crashes, paste the console output that includes the backtrace.
|
||||
- Operating System and version. Example: `Debian 13`.
|
||||
- Full game version. Example: `0.70.0-alpha+0.0b1a20dcf win_msvc64-x86_64-debug`. The version is obtained at the start of the log file, or by executing the `version` command in console.
|
||||
|
||||
## Usage of generative AI / Large language models
|
||||
|
||||
### Policy
|
||||
|
||||
This project requires that all contributions be human-authored.
|
||||
|
||||
Do not submit any code, documentation, issues, pull requests, commit messages or comments that are generated using AI or similar assistive tools (such as Microsoft Copilot, Anthropic Claude, ChatGPT...).
|
||||
|
||||
- **No AI-derived patches**. If the change was proposed by an AI, it must not be ported over "by hand". If the idea came from AI, treat is as untrusted and do your own independent implementation.
|
||||
- **No AI-assisted refactors**. Mass rewrites, LLM-based formatting, or modernization are not accepted.
|
||||
- **Enforcement**. Maintainers may request clarification. PRs suspected of AI involvement may be rejected or reverted, and may lead to a ban.
|
||||
|
||||
#### Acceptable uses
|
||||
|
||||
- **Non-generative tools** are allowed: static analyzers, formatters, linters, sanitizers, fuzzers and IDE features are fine as long they do not generate code.
|
||||
- **Translation tools** to help communicating between people.
|
||||
|
||||
### Reasoning
|
||||
|
||||
This policy exists due to:
|
||||
- **Copyright and licensing risk**. The origin of the outputs may be unclear as these tools plagiarize the original sources without permission.
|
||||
- **Security and authenticity**. AI produces plausible code but may often look wrong. This could work, but would turn into undefined behavior, vulnerabilities, or time spent in a debugger.
|
||||
- **Maintability**. Changes must be explainable and reviewable. Humans can explain tradeoffs they consciously accepted. Generated code can't. If you can't explain why a specific line exists, it shouldn't be proposed at all.
|
||||
- **Respect for maintainers**. Submitting contributions generated by these tools waste maintainers resources to review them.
|
||||
|
||||
### Responsibility
|
||||
|
||||
When submitting, you agree that:
|
||||
|
||||
- The submission **complies with this policy**. Changes must be able to be explained and justified during review.
|
||||
- The submission **can be declined** if it is **suspected to use AI** or is raising reviewability concerns.
|
||||
|
||||
## Coding
|
||||
|
||||
### Compatibility
|
||||
|
||||
All changes must stay retro-compatible with the original game:
|
||||
- Assets must be loaded correctly.
|
||||
- Changes related to networking must be compatible with existing MOHAA clients and servers, these changes must not cause an error/disconnect.
|
||||
- Scripts/mods must remain functional.
|
||||
- The singleplayer campaign must be fully playable.
|
||||
|
||||
### Coding style & Guidelines
|
||||
|
||||
- Match the existing code style in any files you modify.
|
||||
- Avoid personal tags or author comments (.e.g., `// @Name: note`). Git already tracks authorship.
|
||||
- Ensure the code builds successfully using CI.
|
||||
- Use **camelCase** notation for all variables, and **PascalCase** notation for functions. Even if some existing code doesn't.
|
||||
- Format code using `clang-format`.
|
||||
- In VSCode from the command palette: **Format document**
|
||||
|
||||
### Event declaration
|
||||
|
||||
When declaring a new Event, use the following structure:
|
||||
```cpp
|
||||
Event EV_YourEventName // Pascal Case naming convention
|
||||
(
|
||||
"name", // Each parameter on a new line
|
||||
flags,
|
||||
"format specifiers...",
|
||||
"argument names...",
|
||||
"description"
|
||||
);
|
||||
```
|
||||
|
||||
### Code annotations
|
||||
|
||||
When modifying existing code from the original game or adding new classes, annotate your changes using one of the following patterns:
|
||||
|
||||
#### Additions
|
||||
|
||||
```cpp
|
||||
// Added in OPM
|
||||
// Description
|
||||
```
|
||||
|
||||
#### Changes
|
||||
|
||||
```cpp
|
||||
// Changed in OPM
|
||||
// Description
|
||||
```
|
||||
|
||||
#### Fixes
|
||||
|
||||
```cpp
|
||||
// Fixed in OPM
|
||||
// Description
|
||||
```
|
||||
|
||||
#### Removal
|
||||
|
||||
```cpp
|
||||
// Removed in OPM
|
||||
// Description
|
||||
```
|
||||
|
||||
If referencing a specific game version, replace OPM with that version number. Example:
|
||||
```cpp
|
||||
// Added in 2.11
|
||||
// Make sure to clean turret stuff up
|
||||
// when the player is deleted
|
||||
```
|
||||
Known versions are `1.00`, `1.10`, `1.11`, `2.0`, `2.1`, `2.11`, `2.15`, `2.30`, `2.40`.
|
||||
|
||||
You can also group multiple related functions like this:
|
||||
```cpp
|
||||
// Added in OPM
|
||||
//====
|
||||
void Function1();
|
||||
void Function2();
|
||||
void Function3();
|
||||
//====
|
||||
```
|
||||
|
||||
For new source files, include the annotation after the license notice.
|
||||
|
||||
### Source files
|
||||
|
||||
- Always put the license notice as the header of the file (template [here](docs/markdown/05-contributing/01-license-header.md)).
|
||||
- Only `#include` what's necessary.
|
||||
- Each source file should contain related classes and functions.
|
||||
|
||||
---
|
||||
|
||||
## Pull Requests
|
||||
|
||||
Pull Requests are the preferred way of submitting code changes.
|
||||
|
||||
### Before you start
|
||||
|
||||
1. **Discuss major changes first**: open an issue or discuss about it.
|
||||
2. **Create a branch** based on the `main` branch (you shouldn't commit directly on `main`)
|
||||
3. **Keep PRs as small as possible and focused**: One clear purpose per PR.
|
||||
|
||||
### Submitting a PR
|
||||
|
||||
- Target the correct branch (usually `main`).
|
||||
- Add a short and clear description of what you changed and why.
|
||||
- Reference matching issues (e.g. `Fixes #123`).
|
||||
- Make sure your code builds and passes tests.
|
||||
- Test locally to ensure your changes don't break functionality or compatibility.
|
||||
|
||||
### Reviews
|
||||
|
||||
- Maintainers may ask for tweaks or commit changes directly to your PR, that's normal.
|
||||
- Stay polite and technical.
|
||||
- Once approved, your changes will be merged.
|
||||
|
||||
### Additional Notes
|
||||
|
||||
- Contributions follow the same license as the project.
|
||||
- Keep things consistent with existing code and docs.
|
||||
- If you're unsure about anything, you can discuss it on Discord via [this link](https://discord.gg/NYtH58R).
|
||||
File diff suppressed because it is too large.
Load diff
@@ -45,10 +45,11 @@ If you encounter a bug or a problem, you can do one of the following:
|
||||
- 📖 [Documentation](https://openmoh.github.io/openmohaa)
|
||||
- ⚙️ [Game settings & configuration](docs/markdown/03-configuration/01-configuration.md)
|
||||
- 📝 [Code & Scripting reference](docs/markdown/04-coding/02-coding.md)
|
||||
- 📜 [Contributing guidelines](CONTRIBUTING.md)
|
||||
|
||||
## Current state
|
||||
|
||||
- 🧰 [Feature list](docs/markdown/01-intro/04-features.md)
|
||||
- 🧰 [List of differences](docs/markdown/01-intro/04-differences.md)
|
||||
|
||||
### Single-player
|
||||
|
||||
@@ -101,7 +102,7 @@ The following third party tools and libraries are used by the project
|
||||
## Resources
|
||||
|
||||
- 🔗 [GitHub Repository](https://github.com/openmoh/openmohaa/)
|
||||
- 🌐 [MOHAAAA Amalgamated Allied Assault Alliance](https://mohaaaa.co.uk/AAAAMOHAA/index.php)
|
||||
- 🌐 [MOH-DB](https://www.moh-db.com/)
|
||||
- 🕹️ [333networks](https://333networks.com/)
|
||||
- 📂 [ModDB](https://www.moddb.com/games/medal-of-honor-allied-assault)
|
||||
- 📂 [GameBanana](https://gamebanana.com/games/720)
|
||||
|
||||
+249
@@ -0,0 +1,249 @@
|
||||
# OpenMoHAA on Quest 3 — porting plan
|
||||
|
||||
Getting Medal of Honor: Allied Assault running natively on a Meta Quest 3 in
|
||||
VR, by way of an Android port first.
|
||||
|
||||
Written after surveying the tree at `a2f34019`, and carrying the lessons from
|
||||
a completed Quest 3 VR port of Homeworld (1999) — the mistakes noted at the
|
||||
end are ones already made once and worth not repeating.
|
||||
|
||||
---
|
||||
|
||||
## 1. What we are starting from
|
||||
|
||||
| | |
|
||||
|---|---|
|
||||
| Lineage | ioquake3-derived (`renderergl1`/`renderergl2`, `qcommon`, `botlib`, QVM options) |
|
||||
| Build | CMake ≥ 3.25, modular per-directory `CMakeLists.txt` |
|
||||
| Platform layer | **SDL2** (`code/sdl/`: glimp, input, sound, gamma, mouse) |
|
||||
| Renderers | `renderergl1` (fixed function), `renderergl2` (GLSL) |
|
||||
| Game logic | C++ (`fgame`, `cgame`, `uilib`, `skeletor`, `tiki`) — not Q3-style QVM gameplay |
|
||||
| Android support | **none whatsoever** |
|
||||
| Game data | Retail MOH:AA required (GOG recommended); a demo exists |
|
||||
|
||||
### The finding that shapes everything
|
||||
|
||||
**`renderergl2` already speaks OpenGL ES.** This is inherited from upstream
|
||||
ioquake3 and is in far better shape than expected:
|
||||
|
||||
- `qglesMajorVersion` / `qglesMinorVersion` are real runtime variables
|
||||
(`code/renderercommon/qgl.h`), with a `QGLES_VERSION_ATLEAST` macro
|
||||
- `tr_glsl.c` emits `#version 300 es` when ES 3 is present, `#version 100`
|
||||
for ES 2, and injects `precision mediump float` / `precision mediump
|
||||
sampler2DShadow`
|
||||
- `tr_extensions.c` branches on `qglesMajorVersion` when probing extensions
|
||||
- `sdl_glimp.c` has an **`r_preferOpenGLES` cvar** and will request
|
||||
`SDL_GL_CONTEXT_PROFILE_ES` contexts
|
||||
|
||||
This is the single biggest difference from the Homeworld port, where the
|
||||
engine only spoke fixed-function GL 1.x and needed **gl4es** (a GL-over-GLES2
|
||||
translation layer) underneath everything — which then dictated every later
|
||||
constraint. Here the plan is to drive `renderergl2` at GLES 3 directly, so:
|
||||
|
||||
- no translation layer, no gl4es quirks
|
||||
- real shaders, so normal mapping and post-processing stay on the table
|
||||
- FBOs are already first class (`tr_fbo.c`), which matters enormously for
|
||||
stereo rendering — Homeworld's port never got this and it blocked MSAA
|
||||
|
||||
**`renderergl1` should be considered out of scope.** It is fixed-function and
|
||||
would need the same emulation layer we are avoiding. Build only `renderergl2`
|
||||
(`-DBUILD_RENDERER_GL1=OFF -DBUILD_RENDERER_GL2=ON`).
|
||||
|
||||
---
|
||||
|
||||
## 2. Phase 1 — build for Android
|
||||
|
||||
Goal: an APK that launches, logs, and reaches the main menu. No VR yet.
|
||||
|
||||
1. **Toolchain.** CMake has first-class NDK support via
|
||||
`android.toolchain.cmake`; unlike Homeworld's hand-written meson cross
|
||||
file, this is a supported path. Target `arm64-v8a`, `android-29` or later
|
||||
(Quest 3 is Android 12).
|
||||
2. **SDL2 for Android.** Build SDL2 for `arm64-v8a` and use the stock
|
||||
`org.libsdl.app.SDLActivity` to load the engine as `libmain.so`. The
|
||||
existing `code/sdl/*` should mostly work unchanged — this is the same
|
||||
arrangement the Homeworld port used successfully.
|
||||
3. **Prune the dependency surface.** Decide early, since each is a
|
||||
cross-compile:
|
||||
- `USE_OPENAL` — Quest wants low-latency audio; OpenAL Soft builds for
|
||||
Android, but SDL audio may be simpler for a first pass
|
||||
- `USE_CURL` / `USE_HTTP` — off initially, it is only for downloads
|
||||
- `USE_CODEC_VORBIS` / `OPUS` / `MAD` — MOH:AA music needs at least one;
|
||||
check what the retail data actually ships
|
||||
- `BUILD_SERVER` — off for the client APK
|
||||
4. **Game modules.** `BUILD_GAME_LIBRARIES` vs `BUILD_GAME_QVMS`. Native
|
||||
`.so` modules via `dlopen` work on Android, but Android's linker
|
||||
namespaces are fussy about paths — consider **static linking the game
|
||||
modules into the main binary** for the first port and revisiting later.
|
||||
5. **Filesystem.** Point the base path at the app's external files directory
|
||||
(`SDL_AndroidGetExternalStoragePath()`), and `chdir()` there early —
|
||||
exactly what the Homeworld port does. The user side-loads `main/pak*.pk3`
|
||||
into it.
|
||||
6. **Force the ES path.** Set `r_preferOpenGLES 1` and confirm
|
||||
`qglesMajorVersion` comes back as 3. This is the moment of truth for the
|
||||
whole approach and should be validated before anything else is built on
|
||||
top.
|
||||
|
||||
**Exit criteria:** APK boots, logs to `logcat`, reaches the main menu with
|
||||
retail data side-loaded, renders through `renderergl2` on a GLES 3 context.
|
||||
|
||||
---
|
||||
|
||||
## 3. Phase 2 — playable flat on the headset
|
||||
|
||||
Goal: the game is genuinely playable as a 2D panel app before VR is attempted.
|
||||
This is deliberately a separate milestone; debugging engine problems is far
|
||||
easier without a stereo compositor in the way.
|
||||
|
||||
- **Input:** Quest Touch controllers appear to SDL as a game controller.
|
||||
Map to the existing `sdl_input.c` joystick path first; a bespoke mapping
|
||||
comes later with VR.
|
||||
- **Performance baseline:** measure frame time with the flat renderer before
|
||||
stereo triples the cost. Establish what the Quest 3 GPU actually delivers on
|
||||
a large MOH:AA map — this number decides how ambitious VR can be.
|
||||
- **Config and saves:** confirm they write to the external files dir, and that
|
||||
the directory is app-owned (see the ownership trap in §6).
|
||||
- **Audio:** verify no dropouts; Android audio callbacks are less forgiving
|
||||
than desktop.
|
||||
|
||||
**Exit criteria:** a mission is completable, flat, on the headset, at a stable
|
||||
frame rate.
|
||||
|
||||
---
|
||||
|
||||
## 4. Phase 3 — stereo via OpenXR
|
||||
|
||||
Goal: the world renders in tracked stereo at 72 fps.
|
||||
|
||||
1. **Session and swapchains.** Link the Khronos `openxr_loader` for Android,
|
||||
create an instance with `XR_KHR_opengl_es_enable`, and drive
|
||||
`xrWaitFrame` / `xrBeginFrame` / `xrEndFrame` from the engine's frame loop.
|
||||
2. **Two eye passes into FBOs.** `renderergl2` already renders into
|
||||
framebuffer objects (`tr_fbo.c`), so each eye can target an OpenXR
|
||||
swapchain image directly. **This is the piece the Homeworld port never
|
||||
built**, and its absence there blocked MSAA and forced awkward blits — do
|
||||
it properly from the start here.
|
||||
3. **View and projection from OpenXR.** Replace the engine's projection setup
|
||||
with the per-eye FOV and pose from `xrLocateViews`. In id Tech the camera
|
||||
comes from `refdef` — feed eye offsets in there rather than hacking the
|
||||
projection matrix downstream.
|
||||
4. **Do not render the world three times.** The Homeworld port ended up with a
|
||||
mono pass plus two eye passes because the 2D UI and camera capture were
|
||||
entangled with the main view. Design the frame as *exactly two* eye passes
|
||||
from day one; anything needing a flat image should read from an eye buffer
|
||||
or render separately.
|
||||
5. **The 2D UI.** MOH:AA's HUD and menus draw in screen space. Two options,
|
||||
probably both eventually: render them to a texture and present as an
|
||||
OpenXR quad layer (crisp, comfortable, good for menus), or project them
|
||||
into the world (better for the in-game HUD).
|
||||
|
||||
**Exit criteria:** stereo world, correct scale and IPD, head tracking with no
|
||||
mismatch, stable 72 fps, menus readable.
|
||||
|
||||
---
|
||||
|
||||
## 5. Phase 4 — VR interaction design
|
||||
|
||||
This is the largest and least mechanical phase, and it is where an FPS differs
|
||||
completely from the RTS port. A wrong choice here causes motion sickness
|
||||
rather than a bug report.
|
||||
|
||||
**Locomotion — the central question.**
|
||||
- Smooth locomotion with comfort options (vignette, snap turn) is the
|
||||
expected default for a shooter, but MOH:AA's level design assumes a fast,
|
||||
free-running player
|
||||
- Teleport is comfortable but destroys the pacing of firefights
|
||||
- Likely: smooth movement, snap *and* smooth turn as options, adjustable
|
||||
vignette. Make all of it a cvar so it can be tuned on device.
|
||||
|
||||
**Weapon handling.**
|
||||
- Aim from the controller, not the head — this is non-negotiable for an FPS
|
||||
- Two-handed hold for rifles is a large fidelity win and a large amount of
|
||||
work; consider one-handed first
|
||||
- Iron sights become genuinely physical: the sight has to line up with the eye
|
||||
- Reloading: gesture vs button. Button first.
|
||||
|
||||
**The player body and camera.**
|
||||
- MOH:AA moves the view for scripted sequences, cutscenes, ladder climbs and
|
||||
death animations. **Any engine-driven camera motion is a nausea risk in
|
||||
VR** and every instance needs auditing. This is likely the single largest
|
||||
source of unpleasant surprises.
|
||||
- Player height: real standing height vs the engine's fixed viewheight
|
||||
- Crouch: physical vs button, ideally both
|
||||
|
||||
**HUD.**
|
||||
- Screen-locked HUD elements are uncomfortable in VR
|
||||
- Ammo and health on the weapon or wrist, as the Homeworld port did with
|
||||
wrist cards — that worked well and is worth reusing
|
||||
- Objectives and subtitles on a comfortable head-relative panel
|
||||
|
||||
**Exit criteria:** a mission playable end to end, comfortably, by someone who
|
||||
is not the developer.
|
||||
|
||||
---
|
||||
|
||||
## 6. Traps carried from the Homeworld Quest port
|
||||
|
||||
Hard-won, all of them cost hours:
|
||||
|
||||
- **Never `adb shell am start` to launch after deploying.** It intermittently
|
||||
strands the headset in Meta's loading environment. Install, then launch from
|
||||
inside the headset.
|
||||
- **`adb push` cannot create directories inside an app's data folder**, and
|
||||
`chmod` must come *after* pushing or adb fails with `remote fchown failed`.
|
||||
- **A directory created by `adb shell mkdir` is mode 2770 owned by `shell`**,
|
||||
which the app cannot even traverse into — it fails *silently*. `chmod 775`
|
||||
afterwards. Files pushed by adb are 644 and world-readable, which is why
|
||||
data files work while directories do not.
|
||||
- **Verify your logging works before relying on it.** A crash handler that has
|
||||
been silently displaced reports nothing, and is indistinguishable from a
|
||||
crash that never happened. Add a startup self-test that exercises the same
|
||||
path.
|
||||
- **`tombstoned` may not write backtraces to logcat.** When it does not,
|
||||
`dumpsys activity exit-info` still reports the signal, and an in-process
|
||||
handler using `_Unwind_Backtrace` + `dladdr` can report the stack itself —
|
||||
but it needs a real `sigaltstack`, or a stack overflow silences it.
|
||||
- **Only one process may hold an OpenXR session.** If the previous run has not
|
||||
fully exited, the new one falls back to flat mono rendering with no error.
|
||||
- **The headset must be awake** or the session never reaches
|
||||
`XR_SESSION_STATE_FOCUSED` and the launch appears to hang.
|
||||
- **Wireless adb ports change** every time debugging is toggled, and mDNS can
|
||||
advertise a dead one.
|
||||
|
||||
---
|
||||
|
||||
## 7. Open questions to settle early
|
||||
|
||||
1. **Does `renderergl2` actually initialise on a Quest GLES 3 context?**
|
||||
Everything above rests on this. Validate in Phase 1 before building more.
|
||||
2. **What frame budget does a real MOH:AA map leave?** id Tech 3 maps are
|
||||
light by modern standards, but MOH:AA's are large and the Quest 3 must
|
||||
render everything twice at 72 fps.
|
||||
3. **Game modules: static or `dlopen`?** Decide before the build is shaped
|
||||
around either.
|
||||
4. **How much engine-driven camera movement is there?** Grep for view
|
||||
overrides early; it drives the Phase 4 comfort work and may be the deciding
|
||||
factor in how pleasant this is to play.
|
||||
5. **Which MOH:AA data edition to target first?** GOG is recommended by the
|
||||
project and is the easiest for testers to obtain legally.
|
||||
6. **Licensing.** OpenMoHAA is GPL; no game assets may be redistributed. Same
|
||||
posture as the Homeworld port: the user supplies their own `pak` files.
|
||||
|
||||
---
|
||||
|
||||
## 8. Suggested order of work
|
||||
|
||||
```
|
||||
1 Android build of the dedicated server or a headless client (proves the toolchain)
|
||||
2 Full client APK, GLES 3 context, main menu (proves the renderer)
|
||||
3 Side-load retail data, reach gameplay, flat (proves the filesystem)
|
||||
4 Controller input, playable flat (baseline + perf numbers)
|
||||
5 OpenXR session, one eye, correct pose (proves the XR path)
|
||||
6 Two eye FBOs, correct IPD and projection (stereo)
|
||||
7 UI as quad layers (menus usable)
|
||||
8 Locomotion and weapon handling (VR design begins)
|
||||
9 Comfort pass, camera audit, HUD (the long tail)
|
||||
```
|
||||
|
||||
Steps 1–3 are mechanical and mostly build engineering. Step 5 onward is where
|
||||
the interesting decisions live.
|
||||
@@ -0,0 +1,410 @@
|
||||
# OpenMoHAA on Quest 3 — where the port stands
|
||||
|
||||
Companion to `VR_PORT_PLAN.md`, which is the original survey and plan, and to
|
||||
`VR_RENDERER_HANDOFF.md`, which covers the move to the fixed function renderer.
|
||||
This records what has actually been built, what was learned that contradicts the
|
||||
plan, and what to do next.
|
||||
|
||||
Branch `vr-quest3`. The historical status below records previously committed work.
|
||||
|
||||
### Quest release 0.2.0 — October 14, 2026
|
||||
|
||||
The Android package uses version code 2 and version name `0.83.0-vr0.2.0`.
|
||||
The supplied `autoexec.cfg` starts at the normal menu, with cheats, automatic
|
||||
weapon grants, test-map loading, and diagnostic traces disabled. Replace the
|
||||
external config when upgrading: reinstalling the APK preserves the old one.
|
||||
Keep `r_worldDlights 0` until the lighting defect is resolved; that workaround
|
||||
is supplied by the config, not by the APK's defaults. This remains a prerelease,
|
||||
and the September review changes still need headset validation.
|
||||
|
||||
### Code review update — September 29, 2026
|
||||
|
||||
These fixes remove the unconditional GPU wait after each eye;
|
||||
`vr_traceGpu 1` restores that wait only for diagnostics. Normal submission flushes
|
||||
commands and discards the eye's transient depth/stencil buffers. Swapchain timeouts
|
||||
now retain the acquired image for retry, and stereo submission requires both eyes.
|
||||
World/HUD timing now charges the first 2D transition's world flush to the world,
|
||||
and backend timing accumulates all command batches in an eye.
|
||||
|
||||
The review also fixes desktop HUD suppression, objective initialization, HUD
|
||||
resource resets, health colors, weapon-wheel placement, stereo text lifetimes,
|
||||
font shader passes, and sprite culling and upright sprite disappearance when
|
||||
looking vertically. CMake now tracks additions to the client-game source list.
|
||||
No headset was connected for this review: the measured frame rates and visual
|
||||
observations below predate these changes. Device validation is still needed.
|
||||
The existing font-atlas texture issue and dynamic-light darkening remain
|
||||
unresolved; `r_worldDlights 0` in `autoexec.cfg` remains the lighting workaround.
|
||||
|
||||
**On any problem this port is trying to solve, read RTCWQuest first.** It is
|
||||
cloned at `/home/berkybear/RTCWQuest`, clean at `4c714b9`, and it is finished.
|
||||
That is a standing instruction, not a suggestion; ignoring it has cost more time
|
||||
here than any single bug. It is also not always live code — read what is *called*,
|
||||
not what is present.
|
||||
|
||||
The reusable form of everything below is in `QUEST_PORTING_GUIDE.md`, which is
|
||||
written for the next port rather than this one.
|
||||
|
||||
---
|
||||
|
||||
## 1. What works
|
||||
|
||||
The game runs on a Meta Quest 3 in stereo VR at **90 fps**: 6DoF head tracking,
|
||||
stick locomotion, snap turning, menus on a panel fixed in the room, the weapon in
|
||||
the player's hand aimed by the controller, and a hand on each controller. A
|
||||
mission can be started and played.
|
||||
|
||||
| Phase | State |
|
||||
|---|---|
|
||||
| **1 — Android build** | Done. APK builds, boots, logs to logcat. |
|
||||
| **2 — Playable flat** | Skipped deliberately; went straight to VR at the user's direction. |
|
||||
| **3 — OpenXR stereo** | Done. 90 fps, 4–6 ms per eye in the back end. |
|
||||
| **4 — VR interaction** | Locomotion, snap turn, menu pointer, controller aim, weapon in hand, hands on both controllers. HUD and per-weapon alignment outstanding. |
|
||||
|
||||
Confirmed on the device, in order of when each stopped being a question:
|
||||
|
||||
- the world renders — terrain, BSP, models, textures, lightmaps, fog, sky
|
||||
- 90 fps at 4–6 ms per eye, against rend2's 50–60 (`VR_RENDERER_HANDOFF.md` §2)
|
||||
- `XR_FB_display_refresh_rate` works; the display runs at 90 Hz
|
||||
- colour is correct, and therefore darker than it was — see §2
|
||||
- the start map loads straight into the world without touching a menu
|
||||
- both controllers track 1:1, with no drift on head rotation and no lag on a
|
||||
snap turn
|
||||
- both hands are anchored on their own bones and sit upright at the right size
|
||||
|
||||
### Build
|
||||
|
||||
renderergl1 on gl4es is the default on Android; renderergl2 is still reachable
|
||||
with `-DBUILD_RENDERER_GL1=OFF -DBUILD_RENDERER_GL2=ON -DUSE_GL4ES=OFF`.
|
||||
|
||||
```sh
|
||||
cmake -B build-gl1 -G Ninja \
|
||||
-DCMAKE_TOOLCHAIN_FILE=$ANDROID_NDK_HOME/build/cmake/android.toolchain.cmake \
|
||||
-DANDROID_ABI=arm64-v8a -DANDROID_PLATFORM=android-29 -DANDROID_STL=c++_shared \
|
||||
-DCMAKE_BUILD_TYPE=Release -DBUILD_SERVER=OFF
|
||||
cmake --build build-gl1 -j$(nproc)
|
||||
|
||||
cd misc/android && gradle assembleDebug -PnativeLibsDir=../../build-gl1/apk-libs
|
||||
cd ../.. && adb install -r misc/android/app/build/outputs/apk/debug/app-debug.apk
|
||||
adb push misc/android/autoexec.cfg \
|
||||
/sdcard/Android/data/org.openmoh.openmohaa/files/main/autoexec.cfg
|
||||
adb shell am force-stop org.openmoh.openmohaa
|
||||
```
|
||||
|
||||
SDL2, OpenAL Soft, gl4es and the Khronos OpenXR loader are all fetched and built
|
||||
from source; `-DSDL2_SOURCE_PATH=` and friends point at local trees instead. Full
|
||||
instructions and the deployment traps are in
|
||||
`docs/markdown/04-coding/03-android.md`.
|
||||
|
||||
**`adb install -r` does not kill the running process**, so force-stop after
|
||||
installing or the next launch resumes the old build. **Check the APK is newer
|
||||
than the `.so`** — gradle will report success while packaging the previous
|
||||
library. **Never `adb shell am start`**; launch from inside the headset.
|
||||
|
||||
### Game data
|
||||
|
||||
Lives in `/sdcard/Android/data/org.openmoh.openmohaa/files/main/`. Currently
|
||||
populated from a GOG War Chest install.
|
||||
|
||||
**Never create `main/save` or `main/configs` with `adb`.** A directory made by
|
||||
`adb shell mkdir` belongs to `shell`, and no chmod makes it app-writable — the
|
||||
app is `other` there. MOH:AA autosaves on mission start and treats the failure
|
||||
as fatal, so the symptom is a black screen after New Game with
|
||||
`FS_CreatePath: failed to create path` in the log. Let the engine create them.
|
||||
|
||||
### Device configuration
|
||||
|
||||
`misc/android/autoexec.cfg`, deployed next to the game data, not in the APK. It
|
||||
is the only way to set a cvar on a device with no console: exec'd after
|
||||
`omconfig.cfg`, before `R_Init`, so it beats both the stored config and the
|
||||
renderer's own defaults. It cannot reach `VR_TuningCvar` cvars, which force their
|
||||
value at every start.
|
||||
|
||||
The test harness in it ships **off**, so the game starts at its own menu. Filling
|
||||
in `cheats 1`, `vr_testStart "give all"` and `vr_startMap "m4l1"` drops straight
|
||||
into The Bocage with every weapon, which is how the hands were tuned; the values
|
||||
and the reasoning for that map are kept in the comments beside them.
|
||||
|
||||
Nothing the game needs to be correct is only in this file. It is a tuning and
|
||||
testing knob — the defaults compiled into the build are the values measured on
|
||||
device, so an APK installed without it still behaves.
|
||||
|
||||
---
|
||||
|
||||
## 2. Where the plan was wrong
|
||||
|
||||
Worth reading before trusting `VR_PORT_PLAN.md` on these points.
|
||||
|
||||
**"Drive `renderergl2` at GLES 3 directly; `renderergl1` is out of scope" — the
|
||||
opposite happened, and it was the single largest win.** rend2 ran at 10–15 fps
|
||||
against a 90 Hz display: 50–60 ms of *CPU* per eye in the back end binding GLSL
|
||||
programs, while the GPU finished in 3 ms. None of what that buys is visible on
|
||||
art with no normal or specular maps. The port now runs renderergl1 — the plain
|
||||
Quake 3 forward renderer — on gl4es, at 4–6 ms per eye. The whole of
|
||||
`VR_RENDERER_HANDOFF.md` is about that swap and the gl4es boundary it dragged in.
|
||||
|
||||
**"`renderergl2` already speaks OpenGL ES" — nearly, but it could not start.**
|
||||
`QGL_1_1_PROCS` carried five entry points that exist in no version of GLES, and
|
||||
the ES 3.0 context was only requested under `#ifdef __EMSCRIPTEN__`. Both fixed
|
||||
in `f3ca6230`; both would have broken any GLES target.
|
||||
|
||||
**"FBOs are already first class" — they were switched off on GLES**, and are
|
||||
deliberately left off on Android (`r_ext_framebuffer_object 0`): in VR each eye is
|
||||
already a swapchain image, so routing through `tr.renderFbo` first costs a second
|
||||
full-resolution pass and resolve per eye for nothing.
|
||||
|
||||
**"SDL audio may be simpler for a first pass" — there is no SDL audio path.**
|
||||
`snd_local_new.h` hardcodes `#define SOUND_DRIVER OPENAL`, and `USE_OPENAL=OFF`
|
||||
does not compile. OpenAL Soft is built from source on its OpenSL ES backend.
|
||||
|
||||
**"Game modules: static or dlopen?" — static is not an option.** `cgame` and
|
||||
`fgame` both compile `q_shared`, `q_math` and the script system, so linking them
|
||||
into one binary collides. They ship as `libgame.so` / `libcgame.so`.
|
||||
|
||||
**Quest 3 is Android 14 / API 34**, not 12.
|
||||
|
||||
**Do not set the render resolution through cvars.** `r_mode` is `CVAR_LATCH` *and*
|
||||
registered by the renderer itself, so nothing the client sets beforehand can win.
|
||||
The renderer asks the client instead, via `refimport_t::GetVRRenderResolution`.
|
||||
|
||||
**The world is 52.5 units to the metre, not 32.** MOHAA's art is authored at 16
|
||||
units per foot — its tik files say so where they convert from centimetres
|
||||
(`models/weapons/bar.tik`: *"16/30.5 since world is in 16 units per foot"*), and
|
||||
`MAXS_Z 94` / `DEFAULT_VIEWHEIGHT 82` agree at 1.79 m standing. `vr_worldscale`
|
||||
was 32 for months, which is the id Tech number for a game built in inches and
|
||||
simply the wrong engine's. Everything measured in metres was 1.64× too small, and
|
||||
it presented as *the hand models being too large* rather than as a scale error,
|
||||
because a correctly sized model drawn too close is the only clue and the world
|
||||
gives you nothing to compare against.
|
||||
|
||||
---
|
||||
|
||||
## 3. How the VR layer is put together
|
||||
|
||||
`code/vr/vr_openxr.c`, plus `vr_common.h` as the engine-facing API.
|
||||
|
||||
**The session binds to SDL's existing EGL context**, made current against a 16×16
|
||||
pbuffer because SDL unbinds it and reports success when there is no window
|
||||
surface (`VR_RENDERER_HANDOFF.md` §5.6). One GL context in the process.
|
||||
|
||||
**Eyes are rendered by substituting the renderer's idea of the screen.**
|
||||
`re.SetDefaultFramebuffer` points the renderer at the eye's swapchain image, so
|
||||
the entire render path lands in the headset without knowing. Exactly two eye
|
||||
passes per frame; deliberately no third mono pass.
|
||||
|
||||
**The session is torn down and rebuilt around renderer restarts**, and
|
||||
window-resize restarts are declined outright under VR — one of those was
|
||||
destroying the context five seconds into every run and was the black menu.
|
||||
|
||||
**Flat content goes on a quad layer** fixed in the room, drawn into one
|
||||
persistent buffer and blitted into the swapchain image, because a swapchain
|
||||
rotates through three images and the 2D path expects last frame's content to
|
||||
still be there.
|
||||
|
||||
**Colour: the swapchains are `GL_SRGB8_ALPHA8` *and* sRGB write conversion is
|
||||
disabled** via `GL_EXT_sRGB_write_control`. The format alone is half the fix and
|
||||
looks like the whole of it — ES 3.0 converts on write into an sRGB attachment and
|
||||
core ES has no switch to stop it, so the engine's already display-referred colour
|
||||
was encoded a second time. It read as flat lighting. The corrected picture is
|
||||
considerably darker, and that is correct.
|
||||
|
||||
**Orientation travels as axes, never Euler angles**, and position is measured
|
||||
from where the head was when tracking started with the starting heading
|
||||
subtracted.
|
||||
|
||||
**Head pose is applied in `RE_RenderScene`**, so it follows every camera the game
|
||||
has — the player's, cutscenes, ladders, death animations.
|
||||
|
||||
### Placing things in the world, which is not obvious
|
||||
|
||||
`cg.refdef.vieworg` **is not the camera.** `R_VRComposeView` adds the head's play
|
||||
space offset to it, rotated into the body's frame, after cgame is finished:
|
||||
|
||||
```c
|
||||
bodyAngles = (0, viewYaw - baseYaw, 0);
|
||||
fd->vieworg += vrView.origin[i] * bodyAxis[i];
|
||||
```
|
||||
|
||||
Anything anchored on `vieworg` alone is displaced by exactly that offset, which
|
||||
drifts as the head turns and does not survive a snap turn. So both hands are
|
||||
reported measured from the **tracking origin** — the frame `VR_PoseToView` puts
|
||||
the eyes in — and composed the same way the renderer composes the camera.
|
||||
|
||||
RTCWQuest reaches the same place by the other road: a head-relative offset,
|
||||
rotated by `viewangles[YAW] - hmdorientation[YAW]` in `convertFromVR`, with its
|
||||
height replaced by the `-64 + hmdposition[1] * worldScale` rebase. Either works.
|
||||
**Half of each does not**: a head-relative offset composed as play space leaves
|
||||
the hand at `vieworg + R*(hand - head)` while the camera is at `vieworg + R*head`,
|
||||
so the head's motion is counted twice and every hand movement is amplified. That
|
||||
is written up in `vr_common.h` above both accessors.
|
||||
|
||||
### Weapon and hands
|
||||
|
||||
**Aim comes from the controller, the camera stays on the head.**
|
||||
`Weapon::GetMuzzlePosition` takes the controller's pitch and the yaw the hand
|
||||
leads the head by, added to the view yaw the game already has — the controller's
|
||||
absolute yaw is meaningless, since the player can snap turn and the play space
|
||||
has an arbitrary forward. The angles reach `fgame` through `gameImport_t`, which
|
||||
a dedicated server answers false for.
|
||||
|
||||
**The hands are separate surfaces on the first person model** — `triggerhand`,
|
||||
`lefthand`, `garandhand`, `viewsleeves` on `USarmyplyr.skd` — so a hand per
|
||||
controller needs no mesh work. The weapon hand's copy drops the left hand surface
|
||||
and a second copy carries only that. `viewsleeves` is one mesh across both
|
||||
forearms and cannot be split without re-authoring, so it stays with the weapon
|
||||
hand.
|
||||
|
||||
**Each copy is anchored on a tag, not on the model origin**, by inverting the
|
||||
composition `Entity::GetTagPositionAndOrientation` uses. The off hand anchors on
|
||||
`Bip01 L Hand` and the weapon hand on `tag_weapon_right`, since what is held
|
||||
there is the gun and the controller is its grip. Every candidate is measured and
|
||||
logged rather than trusted — `tag_weapon_left` was assumed to be an unused slot
|
||||
at the origin and is a real anchor 23.5 units out.
|
||||
|
||||
What is left after the frame and the anchor are right is the wrist bones' own
|
||||
rotation convention, which is a constant: both hands need a roll of 180 in
|
||||
`vr_weaponAdjust` / `vr_offHandAdjust`. That is the compiled default for both,
|
||||
not something the config has to supply — the two hands are mirrored and were
|
||||
still measured to want the same number, which is why they stay two cvars.
|
||||
|
||||
**Two handed hold**: off hand grip with the hands close together points the
|
||||
weapon along the line between them, roll halved. **Reload** is a tap of the
|
||||
weapon hand's grip. **Weapon switching** is the dominant thumbstick up and down,
|
||||
gated on the sideways component and edge triggered.
|
||||
|
||||
### Debugging
|
||||
|
||||
```
|
||||
vr_traceTracking 1 raw headset pose, tracking origin, world scale
|
||||
r_vrTrace 1 the composed camera the renderer actually uses
|
||||
vr_traceFrame 1 the per frame timing split (on by default; noisy)
|
||||
vr_captureEye 1 writes the eye buffer to main/vrshotN.tga
|
||||
```
|
||||
|
||||
**Start the logcat capture before handing the headset over.** The buffer is
|
||||
shared with a shell that prints every five seconds, so a once-only startup line
|
||||
is gone within a minute or two — that has cost two round trips:
|
||||
|
||||
```sh
|
||||
adb logcat -c && adb logcat -s openmohaa:V > run.log &
|
||||
```
|
||||
|
||||
The crash handler (`code/sys/new/sys_android_new.c`) reports the faulting address
|
||||
and the `pc`/`lr` via `sigaction` + `SA_SIGINFO` on a private `sigaltstack`.
|
||||
`_Unwind_Backtrace` cannot walk out of the kernel's signal trampoline, so before
|
||||
that every crash reported four frames of the handler and nothing else.
|
||||
|
||||
---
|
||||
|
||||
## 4. Known problems
|
||||
|
||||
**A muzzle flash makes the ground darker, so the world's dynamic lighting is
|
||||
off.** `r_worldDlights 0` in `autoexec.cfg`. Firing multiplies roughly a sixth
|
||||
of the screen down by about 4× for as long as the trigger is held — the ground
|
||||
plane, with hard polygon edges. Unsolved after seven wrong theories; every
|
||||
component of the dynamic lightmap path measures correct end to end, and yet
|
||||
switching the path off makes the symptom stop. Losing flashes lighting the
|
||||
scenery is the smaller loss. The measurements, what is ruled out and where to
|
||||
resume are in `docs/markdown/04-coding/05-dlights.md`.
|
||||
|
||||
The lesson worth carrying beyond this bug: **difference the frames first.**
|
||||
Pulling a capture, extracting every frame and differencing a flash frame against
|
||||
its neighbour gave the cadence, the 4× ratio and the affected geometry in one
|
||||
step, after six rounds of reading the renderer had given nothing. Also, never
|
||||
record video and read the log in the same run — the Quest's recorder floods
|
||||
logcat and evicts everything.
|
||||
|
||||
**It does not hold 90 Hz while moving.** `vr_resolutionScale` is now 1, so the
|
||||
eyes render at the full 1680×1760, and the frame budget is spent:
|
||||
|
||||
| | fps | eye pass |
|
||||
|---|---|---|
|
||||
| standing at spawn | 90.0 | 8–9 ms |
|
||||
| moving in the Bocage | 77–85 | 11–12 ms |
|
||||
|
||||
The display period is 11.1 ms, so while moving most frames overshoot it and the
|
||||
compositor reprojects them. **Kept deliberately** — it plays well, the picture is
|
||||
much sharper, and the reprojection is not felt. But it is a known trade rather
|
||||
than headroom, and `vr_resolutionScale` is the first thing to give back if
|
||||
something later needs the time.
|
||||
|
||||
**There is no budget for MSAA.** It is wired up and switched off (`vr_samples 0`)
|
||||
and it resolves in tile memory on Adreno so it is nearly free on the GPU — but
|
||||
the GPU is not the constraint, and there is nothing spare on the CPU side. This
|
||||
stays off until the frame split below is trustworthy.
|
||||
|
||||
**The frame split cannot be taken at face value.** It reports `world 1ms` against
|
||||
`hud 5ms`, which is not credible for a full world render. `Set2DWindow` begins
|
||||
with `R_IssuePendingRenderCommands()`, so the world's deferred draw calls are
|
||||
attributed to the first 2D call that forces them out — the trap in
|
||||
`QUEST_PORTING_GUIDE.md` §7.1. The one trustworthy figure is `gpuwait`, still
|
||||
**3 ms**: the GPU finishes early and waits, exactly as it did under rend2, so
|
||||
whatever the 11 ms is, it is CPU issuing draw calls and not fill rate.
|
||||
|
||||
**Fixing that attribution is the prerequisite to spending any budget**, because
|
||||
right now nobody can say where half the frame goes.
|
||||
|
||||
**The HUD is still screen space during gameplay**, with the same non-convergence
|
||||
the menus had before the quad layer.
|
||||
|
||||
**Per-weapon alignment is one global setting.** `vr_weaponAdjust` is shared
|
||||
across every weapon, but a Garand, a Colt and a bazooka will not want the same
|
||||
grip offset — the reference keeps `vr_weapon_adjustment_<id>` per weapon. The
|
||||
Bocage hands over a Colt and a Garand at spawn, plus `give all`, which is the
|
||||
place to find out how far apart they need to be.
|
||||
|
||||
**Not confirmed on the device**, and each is only known to compile:
|
||||
|
||||
- the two handed hold and the reload gesture
|
||||
- off hand steering — it was mirrored, and the corrected sign has not been tried
|
||||
- whether the pistol's `lefthand` surface looks right; only the Garand's
|
||||
`garandhand` has been seen
|
||||
|
||||
**Some foliage still rotates with head movement.** `AutospriteDeform` and the
|
||||
`SPRITE_PARALLEL` paths now face the viewer's position rather than the view
|
||||
plane, which fixed the near foliage and the imposters behind it. At least one
|
||||
more path does the same thing. `Autosprite2Deform` was left alone on purpose.
|
||||
|
||||
**A recurring SIGSEGV in the Adreno driver** (`gsl_memory_alloc_pure_64`, fault
|
||||
address `0x90`) on a secondary thread at every launch. It **predates all VR
|
||||
work** — it was in the flat builds too — and the process survives it every time.
|
||||
Establish which faults are background noise before bisecting anything.
|
||||
|
||||
---
|
||||
|
||||
## 5. What to do next
|
||||
|
||||
1. **Fix the frame split**, so `world` and `hud` mean what they say. Half the
|
||||
frame is currently attributed to a flush rather than to the work that caused
|
||||
it, and every performance decision after this one depends on knowing where
|
||||
the 11 ms actually goes. The GPU idling at 3 ms says there is something real
|
||||
to find.
|
||||
2. **Then decide about MSAA**, and about whether the CPU cost can come down far
|
||||
enough to hold 90 Hz at full resolution rather than reprojecting to it.
|
||||
3. **Confirm the unconfirmed** — the two handed hold, the reload tap, off hand
|
||||
steering. All three are one session on the device with the harness already in
|
||||
place.
|
||||
4. **Per-weapon alignment.** Build the per-weapon table once the numbers for two
|
||||
or three weapons are known.
|
||||
5. **The HUD.** Wrist or weapon mounted readouts; `VR_WristPanelEnabled` already
|
||||
exists and is off.
|
||||
6. Remaining foliage paths, and the Adreno fault.
|
||||
|
||||
### Reference
|
||||
|
||||
Team Beef's RTCWQuest, `/home/berkybear/RTCWQuest`, clean at `4c714b9`.
|
||||
`Projects/Android/jni/RTCWVR/`: `TBXR_Common.c` is their OpenXR layer,
|
||||
`VrInputDefault.c` the movement and weapon handling, `VrInputWeaponAlign.c` the
|
||||
per-weapon calibration. `rtcw/src/cgame/cg_weapons.c` has
|
||||
`CG_CalculateVRWeaponPosition` and the offhand equivalents;
|
||||
`rtcw/src/renderer/tr_scene.c` has `convertFromVR`, which is the frame conversion
|
||||
this port arrives at from the other direction.
|
||||
|
||||
Ideas there worth having and not yet taken: **a projection layer and a quad layer
|
||||
in the same frame** (`TBXR_Common.c:1576`), which is how a pointer ray and
|
||||
controller models get drawn on a menu-only frame; and **scope zoom by narrowing
|
||||
the composition layer's FOV** (`TBXR_Common.c:1557`) rather than touching the
|
||||
projection matrix, which applies directly to the sniper scopes and binoculars.
|
||||
|
||||
Not there, so do not go looking: no foveation, no space warp, no performance
|
||||
level hints. `XR_FB_display_refresh_rate` is vestigial in their tree — the
|
||||
working implementation here is original.
|
||||
@@ -0,0 +1,546 @@
|
||||
# Swapping the renderer — where this stands and what to do next
|
||||
|
||||
Companion to `VR_PORT_STATUS.md`. That file describes the VR layer; this one is
|
||||
about the move from `renderergl2` to `renderergl1` on gl4es.
|
||||
|
||||
Branch `vr-quest3`.
|
||||
|
||||
---
|
||||
|
||||
## 0. Status at a glance
|
||||
|
||||
**Working, on the device, with nothing overridden:** renderergl1 on gl4es, the
|
||||
OpenXR session, both eyes and the flat panel, the menus, cutscenes, controllers
|
||||
and pointer beam, **and the world** - terrain, BSP geometry, static models,
|
||||
textures, lightmaps, fog and sky. **89-90 fps at 6 ms per eye**, against rend2's
|
||||
50-60 ms. That is the number this whole swap existed to get.
|
||||
|
||||
Three bugs were behind the black screen, and each is recorded in section 8 with
|
||||
what proved it:
|
||||
|
||||
1. A window-resize `vid_restart` tearing down the GL context and the OpenXR
|
||||
session five seconds into every run. That was the black menu.
|
||||
2. `RB_SurfaceFace` writing 32-bit indices through a 16-bit array. That was the
|
||||
world smeared into streaks.
|
||||
3. **gl4es's cached cull face drifting from the driver's**, so the engine's
|
||||
`glCullFace(GL_FRONT)` was dropped as redundant every frame while the
|
||||
hardware culled `GL_BACK` - exactly the faces Quake keeps. That was the
|
||||
invisible world.
|
||||
|
||||
**The single most important lesson is section 9.** Everything the engine could
|
||||
be asked about itself said the renderer was correct, because under gl4es the
|
||||
engine is largely asking gl4es to repeat the engine's own values back.
|
||||
|
||||
---
|
||||
|
||||
## 1. The reference implementation — read this before solving anything
|
||||
|
||||
**Team Beef's RTCWQuest is cloned at `/home/berkybear/RTCWQuest`**, clean at
|
||||
`4c714b9`.
|
||||
|
||||
Same Quake 3 engine lineage, same genre, same headset, same gl4es — and unlike
|
||||
this port, it is finished. **Go to it first for any problem this port is trying
|
||||
to solve.** That is a standing instruction, not a suggestion. In this session it
|
||||
was violated repeatedly and cost most of the elapsed time: the answer to the
|
||||
single biggest blocker (section 5.8) was sitting in their `Android.mk` the whole
|
||||
time.
|
||||
|
||||
| Path (under `Projects/Android/jni/`) | What |
|
||||
|---|---|
|
||||
| `RTCWVR/TBXR_Common.c` | their OpenXR layer: session, swapchains, composition layers, frame submit |
|
||||
| `RTCWVR/VrInputDefault.c` | movement, gestures, weapon handling |
|
||||
| `RTCWVR/VrInputWeaponAlign.c` | per-weapon aim calibration |
|
||||
| `RTCWVR/VrClientInfo.h` | their whole VR state struct |
|
||||
| `rtcw/src/renderer/` | the fixed function renderer with their GLES changes (`#ifdef HAVE_GLES`) |
|
||||
| `SupportLibs/gl4es/Android.mk` | **the gl4es build flags. These matter. See 5.8.** |
|
||||
|
||||
### Already extracted — do not re-derive
|
||||
|
||||
**Aiming** (`rtcw/src/game/g_weapon.c:1904`). Shot direction is computed in the
|
||||
*game*, where the trace is fired:
|
||||
|
||||
```c
|
||||
VectorCopy(gVR->weaponangles, viewang);
|
||||
viewang[YAW] = ent->client->ps.viewangles[YAW]
|
||||
+ (gVR->weaponangles[YAW] - gVR->hmdorientation[YAW]);
|
||||
```
|
||||
|
||||
Pitch and roll come straight from the controller; yaw is the view yaw plus how
|
||||
far the controller leads the head. The controller's absolute yaw is meaningless.
|
||||
The camera stays on the head; only the trace moves to the hand.
|
||||
|
||||
**6DoF** (`rtcw/src/client/cl_input.c:847`). Head position delta is fed into the
|
||||
usercmd as movement. Already ported here.
|
||||
|
||||
**The HUD.** No wrist panel. Screen space, in the eye buffers, re-centred on
|
||||
each eye's off-centre frustum, given stereo parallax, scaled in from the edges.
|
||||
|
||||
**Hands.** No controller models. Their existing view-model hand, moved to the
|
||||
controller's real-world offset from the head.
|
||||
|
||||
**Ladders.** Nothing at all — RTCW's are contents-based so it works for free.
|
||||
**Does not transfer**: MOH:AA is entity-based with a view clamp in
|
||||
`PmoveAdjustViewAngleSettings_OnLadder`.
|
||||
|
||||
**Not there, so do not go looking**: no foveation, no space warp, no performance
|
||||
level hints. `XR_FB_display_refresh_rate` is vestigial in their tree.
|
||||
|
||||
---
|
||||
|
||||
## 2. Why the renderer was swapped
|
||||
|
||||
renderergl2 ran at **10–15 fps against a 90 Hz display**. Taken apart on the
|
||||
device:
|
||||
|
||||
| Phase | Cost |
|
||||
|---|---|
|
||||
| `xrWaitFrame` | 0 ms |
|
||||
| Building the 3D scene | 2–3 ms |
|
||||
| **Issuing the scene to GL** | **50–60 ms, per eye** |
|
||||
| GPU, measured with `glFinish` | **3 ms** |
|
||||
|
||||
The GPU finishes in 3 ms and waits. Rendering at 36% of the pixels bought only
|
||||
23% back, so it is not fill rate. It is CPU in the back end issuing draw calls:
|
||||
rend2 puts every surface through a GLSL program with dozens of uniforms, 139
|
||||
`GLSL_BindProgram`/`GLSL_SetUniform` call sites in the surface path, once per
|
||||
surface per eye.
|
||||
|
||||
None of what that buys is visible here — this art has no normal or specular
|
||||
maps. RTCWQuest's renderer contains no GLSL at all: the original Quake 3 forward
|
||||
renderer on gl4es. That is the stack being copied.
|
||||
|
||||
---
|
||||
|
||||
## 3. Measurement traps in the *old* renderer investigation
|
||||
|
||||
Kept because they are still true of the code.
|
||||
|
||||
**`backEnd.pc.msec` is assigned, not accumulated** (`tr_backend.c`). Later empty
|
||||
flushes overwrite the scene's real number with 0.
|
||||
|
||||
**`Set2DWindow` begins with `R_IssuePendingRenderCommands()`**. The 3D scene is
|
||||
*built* during the world pass but only *executed* when something forces a flush,
|
||||
and the first thing that does is the HUD. The whole frame's rendering therefore
|
||||
appears to any timer to be HUD cost.
|
||||
|
||||
**`tr.frontEndMsec` only covers `RE_RenderScene`**, not the cgame work around it.
|
||||
|
||||
---
|
||||
|
||||
## 4. Build
|
||||
|
||||
```sh
|
||||
cmake -B build-gl1 -G Ninja \
|
||||
-DCMAKE_TOOLCHAIN_FILE=$ANDROID_NDK_HOME/build/cmake/android.toolchain.cmake \
|
||||
-DANDROID_ABI=arm64-v8a -DANDROID_PLATFORM=android-29 -DANDROID_STL=c++_shared \
|
||||
-DCMAKE_BUILD_TYPE=Release -DBUILD_SERVER=OFF
|
||||
cmake --build build-gl1 -j$(nproc)
|
||||
|
||||
cd misc/android && gradle assembleDebug -PnativeLibsDir=../../build-gl1/apk-libs
|
||||
cd ../.. && adb install -r misc/android/app/build/outputs/apk/debug/app-debug.apk
|
||||
```
|
||||
|
||||
renderergl1 + gl4es is the default on Android. renderergl2 is still reachable
|
||||
with `-DBUILD_RENDERER_GL1=OFF -DBUILD_RENDERER_GL2=ON -DUSE_GL4ES=OFF` and
|
||||
still builds.
|
||||
|
||||
---
|
||||
|
||||
## 5. What was wrong, and what fixing it required
|
||||
|
||||
All committed. Each of these was a hard blocker in its own right.
|
||||
|
||||
### 5.1 renderergl1 had never compiled
|
||||
|
||||
`cmake/platforms/android.cmake` held `set(BUILD_RENDERER_GL1 OFF CACHE INTERNAL "")`.
|
||||
**`CACHE INTERNAL` implies `FORCE`**, so the `-D` on the command line was
|
||||
overwritten on every configure. The cache read `BUILD_RENDERER_GL1:INTERNAL=OFF`
|
||||
and `build.ninja` never mentioned renderergl1. A previous handoff claimed this
|
||||
renderer "compiles clean"; it had never been compiled at all. **Check the cache,
|
||||
not the command line.**
|
||||
|
||||
### 5.2 gl4es was building into the source tree, under a name Android cannot load
|
||||
|
||||
gl4es's own CMakeLists sets `CMAKE_LIBRARY_OUTPUT_DIRECTORY` to
|
||||
`${CMAKE_SOURCE_DIR}/lib`, which under FetchContent is *this* project's source
|
||||
root. It also forces the suffix `.so.1`. Android has no versioned sonames and
|
||||
the package manager extracts only `lib*.so`. Redirected into the build tree as
|
||||
`libgl4es.so` and staged with the other APK libraries.
|
||||
|
||||
### 5.3 The renderer's GL entry points must come from gl4es
|
||||
|
||||
renderergl1 does not call GL by name. `qgl_linked.h` is dead code that nothing
|
||||
includes; `renderercommon/qgl.h` declares every entry point as a **function
|
||||
pointer** filled by `GLimp_GetProcAddresses` from `SDL_GL_GetProcAddress`.
|
||||
|
||||
On **EGL 1.5, which the Quest is**, `SDL_EGL_GetProcAddress` tries
|
||||
`eglGetProcAddress` *before* the library it loaded. The driver answers for every
|
||||
name OpenGL 1.x and ES have in common — `glEnable`, `glBindTexture`,
|
||||
`glDrawArrays`, `glTexImage2D`, ~80 more — so only desktop-only names
|
||||
(`glBegin`, `glMatrixMode`) would reach gl4es. The renderer now resolves through
|
||||
`GLimp_GetProcAddress`, straight to the gl4es handle.
|
||||
|
||||
The **extension string** has the same problem: `SDL_GL_ExtensionSupported` reads
|
||||
the driver's ES list, which names none of the desktop extensions the renderer
|
||||
asks after, so `GL_ARB_multitexture` read as absent and the renderer would have
|
||||
dropped to one texture unit.
|
||||
|
||||
### 5.4 The fixed function path asked for a context that does not exist
|
||||
|
||||
`GLimp_SetMode`'s `fixedFunction` branch offered exactly one context: **desktop
|
||||
OpenGL 1.1**. There is no such thing on Android; window creation failed and
|
||||
R_Init gave up with `Couldn't get a visual`. renderergl2 never met this because
|
||||
it takes the other branch.
|
||||
|
||||
Under `USE_GL4ES` that branch now asks for **ES 3.0 then ES 2.0**. The renderer
|
||||
is never told: it reads its version through gl4es, which reports desktop GL
|
||||
(`2.1 gl4es wrapper 1.1.6`), and takes the desktop fixed function path on the
|
||||
strength of it. ES underneath, desktop GL above — the whole point of the layer.
|
||||
|
||||
### 5.5 gl4es answers `glGetString` from constants
|
||||
|
||||
`GL_VERSION`, `GL_VENDOR` and `GL_RENDERER` come out of gl4es's own globals
|
||||
without the driver being asked. The engine's only check that a context is live is
|
||||
`GL_VERSION` coming back non-NULL, so under gl4es that check passes
|
||||
unconditionally and a context created but never bound sails through `R_Init`.
|
||||
`GLimp_SetMode` now asks SDL directly instead.
|
||||
|
||||
### 5.6 SDL unbinds the context and reports success
|
||||
|
||||
`SDL_EGL_MakeCurrent`, handed no surface and without `gl_allow_no_surface`:
|
||||
|
||||
```c
|
||||
if (!egl_context || (!egl_surface && !_this->gl_allow_no_surface)) {
|
||||
eglMakeCurrent(display, EGL_NO_SURFACE, EGL_NO_SURFACE, EGL_NO_CONTEXT);
|
||||
}
|
||||
return 0; /* success, either way */
|
||||
```
|
||||
|
||||
In a headset there is no window being presented, so that surface never arrives.
|
||||
SDL then records the context as current, and SDL and EGL disagree permanently.
|
||||
Asking SDL to bind it again does nothing — `SDL_GL_MakeCurrent` sees its own
|
||||
bookkeeping agree and returns early with `/* We're already current. */`.
|
||||
|
||||
RTCWQuest never meets this because it never depends on a window surface: it makes
|
||||
its context current against a **16×16 pbuffer** (`TBXR_Common.c`,
|
||||
`egl->TinySurface`). Same here, with the context SDL already made. The pbuffer
|
||||
outlives the session deliberately and is released in `VR_Shutdown`.
|
||||
|
||||
### 5.7 gl4es must own the `GL_FRAMEBUFFER` binding — and only that
|
||||
|
||||
gl4es keeps its own table of framebuffers it created and **renders from that,
|
||||
not from the driver's binding**:
|
||||
|
||||
```c
|
||||
gles_glBindFramebuffer(GL_FRAMEBUFFER, current_fb->id ? current_fb->id : mainfbo_fbo);
|
||||
```
|
||||
|
||||
A framebuffer from the driver's `glGenFramebuffers` is not in that table, so
|
||||
`gl4es_glBindFramebuffer` raises `GL_INVALID_VALUE`, **returns without binding**,
|
||||
and leaves `current_fb` at zero. Measured directly:
|
||||
|
||||
```
|
||||
fbo: gl4es says 0, driver says 10 | driver viewport 756 -71 403 1126
|
||||
```
|
||||
|
||||
Zero in this process is the 16×16 pbuffer, and the viewport lies entirely outside
|
||||
it — so geometry landed in nothing, with no error raised anywhere.
|
||||
|
||||
The VR layer now has gl4es generate, bind and delete these. **Three things must
|
||||
stay with the driver:**
|
||||
|
||||
- the **swapchain texture attachment** — gl4es cannot attach a texture the
|
||||
OpenXR runtime created. RTCWQuest hits this and documents it at
|
||||
`TBXR_Common.c:290`, describing our exact symptom: *"the engine then renders
|
||||
into nothing -> black eye buffer"*. (They must bypass gl4es explicitly because
|
||||
ndk-build puts gl4es first in their link order; ours is already native because
|
||||
`libGLESv3` precedes `libgl4es` in `DT_NEEDED`.)
|
||||
- the **blit's `GL_READ_FRAMEBUFFER` / `GL_DRAW_FRAMEBUFFER` bindings** — gl4es
|
||||
takes `GL_READ_FRAMEBUFFER` as a note to itself and `return`s without binding
|
||||
(`framebuffers.c:238`). Routing the blit through it silently empties the blit
|
||||
and **kills the cutscenes**. This was done once by accident with an
|
||||
over-broad macro; do not repeat it.
|
||||
- `glFramebufferTexture2D`, per the first point.
|
||||
|
||||
`RE_SetDefaultFramebuffer` in renderergl1 binds **nothing**. It exists only to
|
||||
flush: gl4es batches geometry and issues it lazily, so work built for one target
|
||||
would otherwise arrive in whichever is bound when it finally goes out. The VR
|
||||
layer calls it *before* its own bind for that reason.
|
||||
|
||||
### 5.8 gl4es must be built the way the reference builds it
|
||||
|
||||
**This was the largest single blocker and it is the thing to remember.**
|
||||
|
||||
With CMake's own flags, gl4es **rendered no geometry whatsoever** while clearing
|
||||
the same framebuffer perfectly. Measured, in the same buffer microseconds apart:
|
||||
|
||||
```
|
||||
gl4es draw test: 144 red (clear), 0 green (drawn), 0 other
|
||||
```
|
||||
|
||||
Matching RTCWQuest's `Android.mk` fixed it outright, with no engine-side change:
|
||||
|
||||
```
|
||||
gl4es draw test: 108 red (clear), 36 green (drawn), 0 other
|
||||
```
|
||||
|
||||
(36/144 is exactly the quarter the test quad covers.)
|
||||
|
||||
Their flags, now in `cmake/libraries/gl4es.cmake`:
|
||||
|
||||
```
|
||||
-DBCMHOST -DNOX11 -DNO_GBM -DDEFAULT_ES=2 -DNO_INIT_CONSTRUCTOR
|
||||
-O3 -fcommon -fvisibility=hidden -funwind-tables
|
||||
```
|
||||
|
||||
**`ANDROID` is deliberately not among them.** gl4es's own CMakeLists adds
|
||||
`-DANDROID` whenever the NDK toolchain is in use, and ndk-build never does — so
|
||||
the reference has only ever been exercised without it. It is not cosmetic: it
|
||||
selects different code in the loader, in glx, and in `hardext`, which is where
|
||||
gl4es compiles a probe shader (`testGLSL`) to decide what its fixed function
|
||||
pipeline may emit. It comes from `add_definitions()`, a **directory** property,
|
||||
so it must be removed at the directory it was set on — overriding it on the
|
||||
target does not work.
|
||||
|
||||
**Still to do: bisect which flag actually mattered.** `-DANDROID` is the strong
|
||||
suspicion. This is currently convergence on a known-good configuration, not a
|
||||
diagnosis.
|
||||
|
||||
---
|
||||
|
||||
## 6. The trap that cost this session, in bold
|
||||
|
||||
**Every engine-side experiment run before 5.8 was worthless, because gl4es could
|
||||
not draw anything at all.**
|
||||
|
||||
Under that broken gl4es, *any* test that ends "and nothing was drawn" returns the
|
||||
same answer regardless of what it is testing. On the strength of such results
|
||||
this session wrongly concluded, and acted on:
|
||||
|
||||
- that 32-bit indices were the problem (changed to 16-bit — see 8.1)
|
||||
- that the `glDrawElements` client-array path was broken (switched to
|
||||
`qglArrayElement`; no change)
|
||||
- that compiled vertex arrays were broken (disabled them — see 8.2)
|
||||
- that `glDrawBuffer(GL_BACK)` on an FBO was discarding everything (stubbed it —
|
||||
see 8.3)
|
||||
- that immediate mode worked while arrays did not, and later that *neither*
|
||||
worked — two contradictory conclusions, both from invalid data
|
||||
|
||||
**Before believing any negative rendering result, prove the renderer can draw at
|
||||
all.** The cheapest possible check, and the one that finally cracked this:
|
||||
ask gl4es for a `glClear` and then a flat untextured quad into the same buffer,
|
||||
and read the pixels back. A clear needs no shaders; a draw needs the whole
|
||||
pipeline. If the clear lands and the draw does not, stop looking at the engine.
|
||||
|
||||
A second, dumber version of the same mistake: a probe gated on
|
||||
`primitives == 2` silently stopped running when a separate change flipped
|
||||
`primitives` to 1, and two rounds of "nothing drawn" results were actually
|
||||
"the probe never executed". **Verify instrumentation still fires after changing
|
||||
anything it depends on.**
|
||||
|
||||
---
|
||||
|
||||
## 7. What is now positively proven working
|
||||
|
||||
Measured on the device, after 5.8. Do not re-investigate these.
|
||||
|
||||
- The OpenXR session, both eye swapchains and the flat quad layer. 90 fps.
|
||||
- The panel framebuffer is real, complete (`GL_FRAMEBUFFER_COMPLETE`), writable
|
||||
and composited — a clear to blue showed as blue in the headset.
|
||||
- gl4es reaches that framebuffer: a clear to red showed as red.
|
||||
- gl4es renders geometry: a flat quad rendered, verified by pixel readback.
|
||||
- ~~**The engine's own geometry renders** — with a flat-red override, the intro
|
||||
logo screen before the cutscene appeared red in the headset.~~ **Weaker than
|
||||
it reads.** The override had disabled the colour array, and the route it went
|
||||
down was `qglArrayElement`, not `glDrawElements`. It proves one array reaches
|
||||
gl4es on one route, not that the renderer's geometry path works. See 8.1.
|
||||
- Cutscenes render (immediate mode, `RE_StretchRaw`).
|
||||
- Controllers and the pointer beam render (VR layer's own GLES).
|
||||
- Both layers agree on the framebuffer: `gl4es says 10, driver says 10`.
|
||||
- The 2D setup is correct: viewport `0 0 1008 1056`, ortho `0 1008 1056 0`,
|
||||
full scissor, `vrView.active` false during menus (so the HUD convergence code
|
||||
in `R_VRAdjust2DOrtho` is *not* involved in the menu at all).
|
||||
- The geometry submitted for menu widgets is correct: 4 verts, 6 strip indices,
|
||||
sensible coordinates, identity modelview, a correct ortho matching the
|
||||
widget's own viewport, `glGetError() == 0` on every draw.
|
||||
|
||||
---
|
||||
|
||||
## 8. Fixed this session
|
||||
|
||||
**8.1 The menu was a renderer restart.** `sdl_input.c`'s `SDL_WINDOWEVENT_RESIZED`
|
||||
handler compares the window against `cls.glconfig.vidWidth/Height`, which in VR
|
||||
is the *eye buffer*, never the Android surface. It can never match, so it set
|
||||
`r_customwidth`/`r_customheight`/`r_mode -1` and scheduled a `vid_restart` about
|
||||
five seconds in - cvars the renderer then ignores, because the VR resolution
|
||||
comes from `GetVRRenderResolution`. The restart destroyed and rebuilt the GL
|
||||
context and the OpenXR session under a running frame loop, and section 5.7's
|
||||
framebuffer agreement did not survive it. Measured: the menu drew a full
|
||||
`256/256` panel samples right up to `CL_Vid_Restart_f` and nothing ever after.
|
||||
Window-resize restarts are now declined under `VR_Enabled()`.
|
||||
|
||||
`VR_PORT_STATUS.md` called this restart "harmless ... but wasteful". It was the
|
||||
entire bug.
|
||||
|
||||
**8.2 `RB_SurfaceFace` wrote 32-bit indices into a 16-bit array.** It declared
|
||||
`unsigned *tessIndexes` and assigned `tess.indexes` to it - which is
|
||||
`glIndex_t *`, i.e. `unsigned short *` under gl4es (9.1). Every index went in
|
||||
four bytes apart in a two-byte array, so half the slots held the zero high
|
||||
halves of their neighbours and every triangle picked up whatever vertex that
|
||||
landed on. That was the stretched, smeared world that dragged its textures with
|
||||
it. Models never come through this function, which is why they were perfect
|
||||
throughout.
|
||||
|
||||
`ProjectDlightTexture`'s `unsigned hitIndexes[SHADER_MAX_INDEXES]`, passed
|
||||
straight to `R_DrawElements`, had the same fault. Both fixed; a full rebuild now
|
||||
reports no index-type mismatches in the renderer.
|
||||
|
||||
**The compiler had been saying so all along**, under sixty-odd other warnings:
|
||||
|
||||
```
|
||||
tr_surface.c:401: warning: incompatible pointer types assigning to 'unsigned int *'
|
||||
from 'glIndex_t *' (aka 'unsigned short *')
|
||||
```
|
||||
|
||||
This is the cost of 9.1 that nobody checked for: changing `glIndex_t` is not
|
||||
local to the draw call, and the only thing that finds the other users is the
|
||||
warning log. **Read it after touching that typedef.**
|
||||
|
||||
**8.3 The frame budget, which is what the swap was for.** In-game, on the
|
||||
device: **90 fps at 4 ms per eye**, against rend2's 50-60 ms (section 2). That
|
||||
question is answered and `vr_resolutionScale` can go back to 1.
|
||||
|
||||
**8.4 Smaller, all real.** renderergl1's `R_SetupFrustum` culled against the
|
||||
game's symmetric fov rather than the runtime's asymmetric per-eye frustum
|
||||
(renderergl2 does not have this bug - its `R_SetupFrustum` takes the projection
|
||||
edges). Every `glViewport`, `glEnable/glDisable`, `glDepthMask`, `glDepthFunc`,
|
||||
`glBlendFunc`, `glColorMask`, `glCullFace` and `glScissor` in the VR layer now
|
||||
goes through gl4es, because gl4es caches all of them and silently drops the
|
||||
engine's next request for a value its stale copy already claims. `GfxInfo_f`
|
||||
printed a different draw route than `R_DrawElements` actually took.
|
||||
|
||||
---
|
||||
|
||||
## 9. Ask the driver, not gl4es
|
||||
|
||||
**Written up properly in `docs/markdown/04-coding/04-gl4es.md`.** That file is
|
||||
the reference; this section is the short form.
|
||||
|
||||
**gl4es answers state queries from its own tables.** `glGetIntegerv` for
|
||||
`GL_CULL_FACE_MODE`, `GL_FRONT_FACE` and `GL_MODELVIEW_MATRIX` all come out of
|
||||
`glstate`, not the driver (`src/gl/getter.c:636-902`) - the same way `glGetString`
|
||||
comes from constants (5.5). So reading state back through `qgl` and comparing it
|
||||
against the engine compares the engine with gl4es's copy of the engine. It
|
||||
agrees by construction and proves nothing.
|
||||
|
||||
Two measurements in this session did exactly that and were reported as findings:
|
||||
"the matrices are identical, `maxdiff 0.000`" and "GL and the engine agree on
|
||||
culling". Both were vacuous. The second was actively harmful - the driver was
|
||||
culling `GL_BACK` while gl4es reported the `GL_FRONT` the engine had asked for,
|
||||
and that *was* the bug being hunted.
|
||||
|
||||
**gl4es also drops calls its cache judges redundant** - `glCullFace`
|
||||
(`face.c:14`), `glDepthMask`, `glDepthFunc`, `glBlendFunc`, `glColorMask`,
|
||||
`glScissor`, `glViewport`. Once its copy drifts, the engine can never correct it:
|
||||
it asks for the right value, gl4es compares against the wrong copy, and the
|
||||
driver never hears. Nothing raises an error and nothing looks wrong from inside.
|
||||
|
||||
**So: resolve `glGetIntegerv`/`glIsEnabled` out of `libGLESv3` and ask the
|
||||
hardware.** A temporary `r_traceSurf` probe did this, printing both answers
|
||||
side by side; it has since been removed, but the technique is
|
||||
what cracked the cull bug in one run after many that measured nothing.
|
||||
|
||||
The same applies to setting state, which is what `GL_Cull` now does: name a
|
||||
throwaway value first so the real one cannot match a stale cache.
|
||||
|
||||
### 9.1 Probes must be shown to reach the thing they measure
|
||||
|
||||
Three probes in this session had blind spots exactly where the fault was, and
|
||||
each produced a confident wrong conclusion:
|
||||
|
||||
- the panel readback counted samples brighter than 8 against a buffer that is
|
||||
never cleared, so "nothing drawn" and "drawn black" were the same number;
|
||||
- `r_flatColor` did not apply to multitextured surfaces, so it covered models
|
||||
only - every "the world is not drawing" reading from it was about geometry
|
||||
that was never in question;
|
||||
- the flat-red override restored its state inside `if (primitives == 2)`, a
|
||||
branch that was never taken, so it corrupted the renderer it was measuring.
|
||||
|
||||
**Before believing a negative result, prove the probe reached the surfaces in
|
||||
question.** This is section 6's lesson in a second form and it cost more here
|
||||
than the bugs did.
|
||||
|
||||
### 9.2 Single runs are not evidence
|
||||
|
||||
The same configuration produced different results on different runs more than
|
||||
once, and a bisect was built on top of that before it was noticed. Repeat a
|
||||
result before building on it, and never change code and configuration in the
|
||||
same step - doing so destroyed the only known-good baseline and cost several
|
||||
round trips to rebuild.
|
||||
|
||||
## 10. Working notes
|
||||
|
||||
**The device configuration lives at `misc/android/autoexec.cfg`.** It holds the
|
||||
nothing load bearing any more - the overrides it used to carry went with the
|
||||
bugs they worked around. It is not part of the APK; deploy it next to the game
|
||||
data:
|
||||
|
||||
```sh
|
||||
adb push misc/android/autoexec.cfg \
|
||||
/sdcard/Android/data/org.openmoh.openmohaa/files/main/autoexec.cfg
|
||||
adb shell am force-stop org.openmoh.openmohaa
|
||||
```
|
||||
|
||||
**`autoexec.cfg` is the only way to set a cvar on this device.** There is no
|
||||
console in a headset. It is exec'd by `Com_ExecuteCfg` after `omconfig.cfg`,
|
||||
cannot be loaded out of a pk3 (`FS_FOpenFileRead`'s `isLocalConfig`), and lands
|
||||
*before* `R_Init` - so the renderer's `Cvar_Get` finds each cvar already present
|
||||
and keeps this value instead of its own default. That covers `CVAR_LATCH` and
|
||||
`CVAR_ARCHIVE` cvars too. It cannot reach `VR_TuningCvar` cvars, which force
|
||||
their value at every start, and `CVAR_CHEAT` cvars get reset on map load.
|
||||
|
||||
**Set every knob explicitly, never by omission.** A value left out is whatever
|
||||
`omconfig.cfg` last archived. `cg_shadows` cost a whole round trip that way: it
|
||||
was already 0 in the stored config, so the run that was supposed to test
|
||||
disabling shadows tested nothing at all. **Read the stored config before
|
||||
believing a negative result** - `adb pull .../files/main/configs/omconfig.cfg`.
|
||||
|
||||
**`adb install -r` does not kill a running process.** The old code keeps running
|
||||
and the next launch resumes it, so a run can silently test the previous build.
|
||||
Always `adb shell am force-stop org.openmoh.openmohaa` after installing.
|
||||
|
||||
**Pull captures individually, not the directory.** `adb pull .../files/main/`
|
||||
drags 1.6 GB of pk3s. `adb pull .../main/vrshot0.tga` is what you want.
|
||||
|
||||
**Device.** `adb connect 192.168.1.92:43105`. It sleeps and the connection dies;
|
||||
`adb disconnect` then `adb connect`. **Launch from inside the headset** — never
|
||||
`adb shell am start`.
|
||||
|
||||
A logcat wrapper that survives the sleep/wake cycle is worth keeping around; the
|
||||
connection drops constantly and a plain `adb logcat` dies with it.
|
||||
|
||||
**Archived cvars beat a changed default.** The config is exec'd before `VR_Init`,
|
||||
so `Cvar_Get` finds the cvar already there and keeps the old value. `VR_TuningCvar`
|
||||
in `vr_openxr.c` exists for this: it registers unarchived and forces the default
|
||||
every start. There is no console in a headset to correct a stale value with.
|
||||
|
||||
**There is no console in a headset.** Every question has to be answered by
|
||||
something written to logcat, or by something visible enough to describe. Prefer
|
||||
pixel readbacks logged as numbers over anything that has to be seen — asking
|
||||
someone to catch a one-frame flash is a bad test, and was one here.
|
||||
|
||||
**Settled, so not re-investigated:**
|
||||
|
||||
- `XR_FB_display_refresh_rate` works; the display runs at 90 Hz. Ask for it from
|
||||
the frame loop with the two-call enumeration, not at `xrBeginSession`.
|
||||
- MSAA via `GL_EXT_multisampled_render_to_texture` works and is off
|
||||
(`vr_samples 0`).
|
||||
- `vr_resolutionScale` is at **0.6** and should go back to 1 once the picture is
|
||||
up — fill rate was never the problem.
|
||||
- A recurring `Fatal signal 11` at address `0x90` on a secondary thread at every
|
||||
launch **predates all VR work** and the process survives it every time.
|
||||
|
||||
**Once the menu draws**, the number this whole swap was for is still unmeasured:
|
||||
renderergl1's back-end cost per eye against rend2's 50–60 ms. Section 2 is the
|
||||
baseline to beat. The instrumentation for splitting a VR frame into
|
||||
wait/scene/issue/gpu is described in `VR_PORT_STATUS.md`.
|
||||
@@ -0,0 +1,34 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
|
||||
<plist version="1.0">
|
||||
<dict>
|
||||
<key>CFBundleDevelopmentRegion</key>
|
||||
<string>en</string>
|
||||
<key>CFBundleExecutable</key>
|
||||
<string>@MACOS_APP_EXECUTABLE_NAME@</string>
|
||||
<key>CFBundleIconFile</key>
|
||||
<string>@MACOS_APP_ICON_FILE@</string>
|
||||
<key>CFBundleIdentifier</key>
|
||||
<string>@MACOS_APP_GUI_IDENTIFIER@</string>
|
||||
<key>CFBundleInfoDictionaryVersion</key>
|
||||
<string>6.0</string>
|
||||
<key>CFBundleName</key>
|
||||
<string>@MACOS_APP_BUNDLE_NAME@</string>
|
||||
<key>CFBundlePackageType</key>
|
||||
<string>APPL</string>
|
||||
<key>CFBundleShortVersionString</key>
|
||||
<string>@MACOS_APP_SHORT_VERSION_STRING@</string>
|
||||
<key>CFBundleVersion</key>
|
||||
<string>@MACOS_APP_BUNDLE_VERSION@</string>
|
||||
<key>NSHumanReadableCopyright</key>
|
||||
<string>@MACOS_APP_COPYRIGHT@</string>
|
||||
<key>NSPrincipalClass</key>
|
||||
<string>NSApplication</string>
|
||||
<key>LSMinimumSystemVersion</key>
|
||||
<string>@MACOS_APP_DEPLOYMENT_TARGET@</string>
|
||||
<key>LSApplicationCategoryType</key>
|
||||
<string>public.app-category.games</string>
|
||||
|
||||
@MACOS_APP_PLIST_URL_TYPES@
|
||||
</dict>
|
||||
</plist>
|
||||
@@ -0,0 +1,117 @@
|
||||
if(NOT BUILD_GAME_LIBRARIES AND NOT BUILD_GAME_QVMS)
|
||||
return()
|
||||
endif()
|
||||
|
||||
include(utils/set_output_dirs)
|
||||
include(shared_script)
|
||||
|
||||
file(GLOB_RECURSE BG_SOURCES
|
||||
${SOURCE_DIR}/fgame/bg_misc.cpp
|
||||
${SOURCE_DIR}/fgame/bg_pmove.cpp
|
||||
${SOURCE_DIR}/fgame/bg_slidemove.cpp
|
||||
${SOURCE_DIR}/fgame/bg_voteoptions.cpp
|
||||
)
|
||||
|
||||
file(GLOB_RECURSE CGAME_SOURCES CONFIGURE_DEPENDS
|
||||
${SOURCE_DIR}/cgame/*.c ${SOURCE_DIR}/cgame/*.cpp
|
||||
)
|
||||
|
||||
set(CGAME_BINARY_SOURCES)
|
||||
set(CGAME_QVM_SOURCES)
|
||||
|
||||
file(GLOB_RECURSE GAME_SOURCES
|
||||
${SOURCE_DIR}/fgame/*.c ${SOURCE_DIR}/fgame/*.cpp
|
||||
${SOURCE_DIR}/script/*.c ${SOURCE_DIR}/script/*.cpp
|
||||
${SOURCE_DIR}/parser/parsetree.cpp
|
||||
)
|
||||
|
||||
# Compile lexer and grammar files
|
||||
|
||||
if (FLEX_FOUND)
|
||||
flex_target(fgame-lexer ${CMAKE_SOURCE_DIR}/code/parser/lex_source.txt ${CMAKE_SOURCE_DIR}/code/parser/generated/yyLexer.cpp DEFINES_FILE ${CMAKE_SOURCE_DIR}/code/parser/generated/yyLexer.h COMPILE_FLAGS "-Cem --nounistd")
|
||||
endif()
|
||||
|
||||
if (BISON_FOUND)
|
||||
bison_target(fgame-parser ${CMAKE_SOURCE_DIR}/code/parser/bison_source.txt ${CMAKE_SOURCE_DIR}/code/parser/generated/yyParser.cpp)
|
||||
endif()
|
||||
|
||||
file(MAKE_DIRECTORY "${CMAKE_SOURCE_DIR}/code/parser/generated")
|
||||
|
||||
list(APPEND GAME_SOURCES
|
||||
${BISON_fgame-parser_OUTPUTS}
|
||||
${FLEX_fgame-lexer_OUTPUTS}
|
||||
)
|
||||
|
||||
set(GAME_BINARY_SOURCES)
|
||||
set(GAME_QVM_SOURCES)
|
||||
|
||||
set(UI_SOURCES)
|
||||
|
||||
set(UI_BINARY_SOURCES)
|
||||
set(UI_QVM_SOURCES)
|
||||
|
||||
set(GAME_MODULE_SHARED_SOURCES
|
||||
${SOURCE_DIR}/qcommon/q_math.c
|
||||
${SOURCE_DIR}/qcommon/q_shared.c
|
||||
${SCRIPT_SYSTEM_SOURCES}
|
||||
)
|
||||
|
||||
set(CGAME_SOURCES_BASEGAME ${CGAME_SOURCES} ${GAME_MODULE_SHARED_SOURCES})
|
||||
set(GAME_SOURCES_BASEGAME ${GAME_SOURCES} ${GAME_MODULE_SHARED_SOURCES})
|
||||
set(UI_SOURCES_BASEGAME ${UI_SOURCES} ${GAME_MODULE_SHARED_SOURCES})
|
||||
|
||||
if(BUILD_GAME_LIBRARIES)
|
||||
set(CGAME_MODULE_BINARY ${CGAME_MODULE})
|
||||
set(GAME_MODULE_BINARY ${GAME_MODULE})
|
||||
set(UI_MODULE_BINARY ${UI_MODULE})
|
||||
|
||||
if (BASEGAME)
|
||||
set(CGAME_MODULE_BINARY_BASEGAME ${CGAME_MODULE_BINARY}_${BASEGAME})
|
||||
set(GAME_MODULE_BINARY_BASEGAME ${GAME_MODULE_BINARY}_${BASEGAME})
|
||||
set(UI_MODULE_BINARY_BASEGAME ${UI_MODULE_BINARY}_${BASEGAME})
|
||||
else()
|
||||
set(CGAME_MODULE_BINARY_BASEGAME ${CGAME_MODULE_BINARY})
|
||||
set(GAME_MODULE_BINARY_BASEGAME ${GAME_MODULE_BINARY})
|
||||
set(UI_MODULE_BINARY_BASEGAME ${UI_MODULE_BINARY})
|
||||
endif()
|
||||
|
||||
add_library( ${CGAME_MODULE_BINARY_BASEGAME} SHARED ${CGAME_SOURCES_BASEGAME} ${BG_SOURCES} ${CGAME_BINARY_SOURCES})
|
||||
target_compile_definitions( ${CGAME_MODULE_BINARY_BASEGAME} PRIVATE CGAME_DLL)
|
||||
target_link_libraries( ${CGAME_MODULE_BINARY_BASEGAME} PRIVATE ${COMMON_LIBRARIES})
|
||||
set_target_properties( ${CGAME_MODULE_BINARY_BASEGAME} PROPERTIES OUTPUT_NAME ${CGAME_MODULE_BINARY})
|
||||
set_output_dirs( ${CGAME_MODULE_BINARY_BASEGAME} SUBDIRECTORY ${BASEGAME})
|
||||
|
||||
if(ANDROID)
|
||||
# Shipped in the APK, so it needs the prefix to be extracted at all
|
||||
# (see DLL_PREFIX in q_platform.h)
|
||||
set_target_properties( ${CGAME_MODULE_BINARY_BASEGAME} PROPERTIES PREFIX ${ANDROID_APK_LIBRARY_PREFIX})
|
||||
endif()
|
||||
|
||||
INSTALL(TARGETS ${CGAME_MODULE_BINARY_BASEGAME} DESTINATION ${INSTALL_LIBDIR_FULL})
|
||||
|
||||
if(MSVC)
|
||||
INSTALL(FILES $<TARGET_PDB_FILE:${CGAME_MODULE_BINARY_BASEGAME}> DESTINATION ${INSTALL_LIBDIR_FULL} OPTIONAL)
|
||||
endif()
|
||||
|
||||
add_library( ${GAME_MODULE_BINARY_BASEGAME} SHARED ${GAME_SOURCES_BASEGAME} ${BG_SOURCES} ${GAME_BINARY_SOURCES})
|
||||
target_compile_definitions( ${GAME_MODULE_BINARY_BASEGAME} PRIVATE GAME_DLL WITH_SCRIPT_ENGINE ARCHIVE_SUPPORTED)
|
||||
target_link_libraries( ${GAME_MODULE_BINARY_BASEGAME} PRIVATE RecastNavigation::Detour RecastNavigation::DetourCrowd RecastNavigation::Recast)
|
||||
target_link_libraries( ${GAME_MODULE_BINARY_BASEGAME} PRIVATE ${COMMON_LIBRARIES})
|
||||
set_target_properties( ${GAME_MODULE_BINARY_BASEGAME} PROPERTIES OUTPUT_NAME ${GAME_MODULE_BINARY})
|
||||
set_output_dirs( ${GAME_MODULE_BINARY_BASEGAME} SUBDIRECTORY ${BASEGAME})
|
||||
|
||||
if(ANDROID)
|
||||
set_target_properties( ${GAME_MODULE_BINARY_BASEGAME} PROPERTIES PREFIX ${ANDROID_APK_LIBRARY_PREFIX})
|
||||
endif()
|
||||
|
||||
INSTALL(TARGETS ${GAME_MODULE_BINARY_BASEGAME} DESTINATION ${INSTALL_LIBDIR_FULL})
|
||||
|
||||
if(MSVC)
|
||||
INSTALL(FILES $<TARGET_PDB_FILE:${GAME_MODULE_BINARY_BASEGAME}> DESTINATION ${INSTALL_LIBDIR_FULL} OPTIONAL)
|
||||
endif()
|
||||
|
||||
#add_library( ${UI_MODULE_BINARY_BASEGAME} SHARED ${UI_SOURCES_BASEGAME} ${UI_BINARY_SOURCES})
|
||||
#target_compile_definitions( ${UI_MODULE_BINARY_BASEGAME} PRIVATE UI)
|
||||
#set_target_properties( ${UI_MODULE_BINARY_BASEGAME} PROPERTIES OUTPUT_NAME ${UI_MODULE_BINARY})
|
||||
#set_output_dirs( ${UI_MODULE_BINARY_BASEGAME} SUBDIRECTORY ${BASEGAME})
|
||||
endif()
|
||||
@@ -0,0 +1,157 @@
|
||||
if(NOT BUILD_CLIENT)
|
||||
return()
|
||||
endif()
|
||||
|
||||
include(utils/add_git_dependency)
|
||||
include(utils/set_output_dirs)
|
||||
include(shared_sources)
|
||||
include(shared_script)
|
||||
|
||||
include(renderer_common)
|
||||
|
||||
set(CLIENT_SOURCES
|
||||
${SOURCE_DIR}/client/cl_avi.cpp
|
||||
${SOURCE_DIR}/client/cl_cgame.cpp
|
||||
${SOURCE_DIR}/client/cl_cin.cpp
|
||||
${SOURCE_DIR}/client/cl_consolecmds.cpp
|
||||
${SOURCE_DIR}/client/cl_curl.c
|
||||
${SOURCE_DIR}/client/cl_input.cpp
|
||||
${SOURCE_DIR}/client/cl_instantAction.cpp
|
||||
${SOURCE_DIR}/client/cl_inv.cpp
|
||||
${SOURCE_DIR}/client/cl_invrender.cpp
|
||||
${SOURCE_DIR}/client/cl_keys.cpp
|
||||
${SOURCE_DIR}/client/cl_main.cpp
|
||||
${SOURCE_DIR}/client/cl_net_chan.cpp
|
||||
${SOURCE_DIR}/client/cl_parse.cpp
|
||||
${SOURCE_DIR}/client/cl_scrn.cpp
|
||||
${SOURCE_DIR}/client/cl_ui.cpp
|
||||
${SOURCE_DIR}/client/cl_uibind.cpp
|
||||
${SOURCE_DIR}/client/cl_uidmbox.cpp
|
||||
${SOURCE_DIR}/client/cl_uifilepicker.cpp
|
||||
${SOURCE_DIR}/client/cl_uigamespy.cpp
|
||||
${SOURCE_DIR}/client/cl_uigmbox.cpp
|
||||
${SOURCE_DIR}/client/cl_uilangame.cpp
|
||||
${SOURCE_DIR}/client/cl_uiloadsave.cpp
|
||||
${SOURCE_DIR}/client/cl_uimaprotationsetup.cpp
|
||||
${SOURCE_DIR}/client/cl_uimaprunner.cpp
|
||||
${SOURCE_DIR}/client/cl_uiminicon.cpp
|
||||
${SOURCE_DIR}/client/cl_uimpmappicker.cpp
|
||||
${SOURCE_DIR}/client/cl_uiplayermodelpicker.cpp
|
||||
${SOURCE_DIR}/client/cl_uiradar.cpp
|
||||
${SOURCE_DIR}/client/cl_uiserverlist.cpp
|
||||
${SOURCE_DIR}/client/cl_uisoundpicker.cpp
|
||||
${SOURCE_DIR}/client/cl_uistd.cpp
|
||||
${SOURCE_DIR}/client/cl_uiview3d.cpp
|
||||
${SOURCE_DIR}/client/qal.c
|
||||
${SOURCE_DIR}/client/snd_codec_mp3.c
|
||||
${SOURCE_DIR}/client/snd_codec_ogg.c
|
||||
${SOURCE_DIR}/client/snd_codec_opus.c
|
||||
${SOURCE_DIR}/client/snd_codec_wav.c
|
||||
${SOURCE_DIR}/client/snd_codec.c
|
||||
${SOURCE_DIR}/client/snd_dma_new.cpp
|
||||
${SOURCE_DIR}/client/snd_info.cpp
|
||||
${SOURCE_DIR}/client/snd_mem_new.cpp
|
||||
${SOURCE_DIR}/client/snd_miles_new.cpp
|
||||
${SOURCE_DIR}/client/snd_openal_new.cpp
|
||||
${SOURCE_DIR}/client/usignal.cpp
|
||||
${SOURCE_DIR}/sdl/sdl_input.c
|
||||
${SOURCE_DIR}/sdl/sdl_mouse.c
|
||||
${CLIENT_PLATFORM_SOURCES}
|
||||
)
|
||||
|
||||
# Gamespy
|
||||
list(APPEND CLIENT_SOURCES
|
||||
${SOURCE_DIR}/gamespy/cl_gamespy.c
|
||||
)
|
||||
|
||||
file(GLOB_RECURSE UI_SOURCES "${SOURCE_DIR}/uilib/*.c" "${SOURCE_DIR}/uilib/*.cpp")
|
||||
|
||||
add_git_dependency(${SOURCE_DIR}/client/cl_console.c)
|
||||
|
||||
set(CLIENT_BINARY ${CLIENT_NAME})
|
||||
|
||||
list(APPEND CLIENT_DEFINITIONS BOTLIB)
|
||||
list(APPEND CLIENT_DEFINITIONS APP_MODULE)
|
||||
|
||||
if(BUILD_STANDALONE)
|
||||
list(APPEND CLIENT_DEFINITIONS STANDALONE)
|
||||
endif()
|
||||
|
||||
if(USE_RENDERER_DLOPEN)
|
||||
list(APPEND CLIENT_DEFINITIONS USE_RENDERER_DLOPEN)
|
||||
endif()
|
||||
|
||||
if(USE_HTTP)
|
||||
list(APPEND CLIENT_DEFINITIONS USE_HTTP)
|
||||
endif()
|
||||
|
||||
if(USE_VOIP)
|
||||
list(APPEND CLIENT_DEFINITIONS USE_VOIP)
|
||||
endif()
|
||||
|
||||
if(USE_MUMBLE)
|
||||
list(APPEND CLIENT_DEFINITIONS USE_MUMBLE)
|
||||
list(APPEND CLIENT_LIBRARY_SOURCES ${SOURCE_DIR}/client/libmumblelink.c)
|
||||
endif()
|
||||
|
||||
list(APPEND CLIENT_BINARY_SOURCES
|
||||
${SERVER_SOURCES}
|
||||
${CLIENT_SOURCES}
|
||||
${UI_SOURCES}
|
||||
${COMMON_SOURCES}
|
||||
${SCRIPT_SYSTEM_SOURCES}
|
||||
${BOTLIB_SOURCES}
|
||||
${SYSTEM_SOURCES}
|
||||
${ASM_SOURCES}
|
||||
${CLIENT_LIBRARY_SOURCES})
|
||||
|
||||
if(ANDROID)
|
||||
# SDLActivity dlopen()s the engine and calls SDL_main, so the client is a
|
||||
# shared library rather than an executable. It also has to carry the lib
|
||||
# prefix: the package manager only extracts lib*.so out of an APK.
|
||||
add_library(${CLIENT_BINARY} SHARED ${CLIENT_BINARY_SOURCES})
|
||||
set_target_properties(${CLIENT_BINARY} PROPERTIES PREFIX ${ANDROID_APK_LIBRARY_PREFIX})
|
||||
else()
|
||||
add_executable(${CLIENT_BINARY} ${CLIENT_EXECUTABLE_OPTIONS} ${CLIENT_BINARY_SOURCES})
|
||||
endif()
|
||||
|
||||
target_include_directories( ${CLIENT_BINARY} PRIVATE ${CLIENT_INCLUDE_DIRS})
|
||||
target_include_directories( ${CLIENT_BINARY} PRIVATE ${SOURCE_DIR}/client)
|
||||
target_compile_definitions( ${CLIENT_BINARY} PRIVATE ${CLIENT_DEFINITIONS})
|
||||
target_compile_options( ${CLIENT_BINARY} PRIVATE ${CLIENT_COMPILE_OPTIONS})
|
||||
target_link_libraries( ${CLIENT_BINARY} PRIVATE ${COMMON_LIBRARIES} ${CLIENT_LIBRARIES})
|
||||
target_link_options( ${CLIENT_BINARY} PRIVATE ${CLIENT_LINK_OPTIONS})
|
||||
|
||||
set_output_dirs(${CLIENT_BINARY})
|
||||
|
||||
if(NOT USE_RENDERER_DLOPEN)
|
||||
target_sources(${CLIENT_BINARY} PRIVATE
|
||||
# These are never simultaneously populated
|
||||
${RENDERER_GL1_BINARY_SOURCES}
|
||||
${RENDERER_GL2_BINARY_SOURCES})
|
||||
|
||||
target_include_directories( ${CLIENT_BINARY} PRIVATE ${RENDERER_INCLUDE_DIRS})
|
||||
target_compile_definitions( ${CLIENT_BINARY} PRIVATE ${RENDERER_DEFINITIONS})
|
||||
target_compile_options( ${CLIENT_BINARY} PRIVATE ${RENDERER_COMPILE_OPTIONS})
|
||||
target_link_libraries( ${CLIENT_BINARY} PRIVATE ${RENDERER_LIBRARIES})
|
||||
endif()
|
||||
|
||||
foreach(LIBRARY IN LISTS CLIENT_DEPLOY_LIBRARIES)
|
||||
add_custom_command(TARGET ${CLIENT_BINARY} POST_BUILD
|
||||
COMMAND ${CMAKE_COMMAND} -E copy
|
||||
${LIBRARY}
|
||||
$<TARGET_FILE_DIR:${CLIENT_BINARY}>)
|
||||
|
||||
install(FILES ${LIBRARY} DESTINATION
|
||||
# install() requires a relative path hence:
|
||||
$<PATH:RELATIVE_PATH,$<TARGET_FILE_DIR:${CLIENT_BINARY}>,${CMAKE_BINARY_DIR}/$<CONFIG>>)
|
||||
endforeach()
|
||||
|
||||
set_target_properties(${CLIENT_BINARY} PROPERTIES DEBUG_POSTFIX ${CMAKE_DEBUG_POSTFIX})
|
||||
|
||||
INSTALL(TARGETS ${CLIENT_BINARY} DESTINATION ${INSTALL_BINDIR_FULL})
|
||||
|
||||
if (MSVC)
|
||||
target_link_options(${CLIENT_BINARY} PRIVATE "/MANIFEST:NO")
|
||||
INSTALL(FILES $<TARGET_PDB_FILE:${CLIENT_BINARY}> DESTINATION ${INSTALL_BINDIR_FULL} OPTIONAL)
|
||||
endif()
|
||||
@@ -0,0 +1,21 @@
|
||||
include(compilers/appleclang)
|
||||
include(compilers/clang)
|
||||
include(compilers/gcc)
|
||||
include(compilers/gnu)
|
||||
include(compilers/msvc)
|
||||
|
||||
set(CMAKE_DEBUG_POSTFIX "-dbg")
|
||||
|
||||
if(CMAKE_BUILD_TYPE MATCHES Debug)
|
||||
add_compile_definitions(_DEBUG)
|
||||
|
||||
# NOTE: The following may mess up function importation
|
||||
#if(UNIX)
|
||||
# # Enable all exports so all functions name can be seen during executable crash
|
||||
# set(CMAKE_ENABLE_EXPORTS ON)
|
||||
# message(STATUS "Enabling exports on Unix for backtrace")
|
||||
#endif()
|
||||
else()
|
||||
# Non-debug builds
|
||||
add_compile_definitions(NDEBUG)
|
||||
endif()
|
||||
@@ -0,0 +1,15 @@
|
||||
# Apple Clang compiler specific settings
|
||||
|
||||
if(NOT CMAKE_C_COMPILER_ID STREQUAL "AppleClang")
|
||||
return()
|
||||
endif()
|
||||
|
||||
set(CMAKE_INSTALL_RPATH "@executable_path")
|
||||
set(CMAKE_BUILD_WITH_INSTALL_RPATH ON)
|
||||
|
||||
if(CMAKE_C_COMPILER_ID MATCHES "Clang" OR CMAKE_C_COMPILER_ID STREQUAL "GNU")
|
||||
# Set the visibility to hidden on macOS to prevent shared libraries from
|
||||
# using functions in the executable
|
||||
# it's ok to hide them because the backtrace on macOS will still print the name of the functions
|
||||
add_compile_options(-fvisibility=hidden)
|
||||
endif()
|
||||
@@ -0,0 +1,8 @@
|
||||
# Clang compiler specific settings
|
||||
|
||||
if(NOT CMAKE_C_COMPILER_ID STREQUAL "Clang")
|
||||
return()
|
||||
endif()
|
||||
|
||||
# Ignore warnings for code like 'assert("Assert string")'
|
||||
add_compile_options(-Wno-pointer-bool-conversion)
|
||||
@@ -0,0 +1,10 @@
|
||||
# GCC compiler specific settings
|
||||
|
||||
if(NOT CMAKE_C_COMPILER_ID STREQUAL "GNU")
|
||||
return()
|
||||
endif()
|
||||
|
||||
# Add this option on gcc to prevent functions from having the STB_GNU_UNIQUE binding
|
||||
# Otherwise, it would prevent libraries from being unloaded
|
||||
# which will cause undefined behavior and crashes due to memory corruption
|
||||
add_compile_options(-fno-gnu-unique)
|
||||
@@ -0,0 +1,51 @@
|
||||
# GNU style (GCC/Clang) compiler specific settings
|
||||
|
||||
if(NOT CMAKE_C_COMPILER_ID STREQUAL "GNU" AND NOT CMAKE_C_COMPILER_ID MATCHES "^(Apple)?Clang$")
|
||||
return()
|
||||
endif()
|
||||
|
||||
enable_language(ASM)
|
||||
|
||||
set(ASM_SOURCES
|
||||
${SOURCE_DIR}/asm/ftola.c
|
||||
${SOURCE_DIR}/asm/snapvector.c
|
||||
)
|
||||
|
||||
add_compile_options(-Wall -Wimplicit -Wshadow
|
||||
-Wstrict-prototypes -Wformat=2 -Wformat-security
|
||||
-Wstrict-aliasing=2 -Wmissing-format-attribute
|
||||
-Wdisabled-optimization -Werror-implicit-function-declaration)
|
||||
|
||||
add_compile_options(-Wno-format-zero-length -Wno-format-nonliteral)
|
||||
|
||||
# There are lots of instances of union based aliasing in the code
|
||||
# that rely on the compiler not optimising them away, so disable it
|
||||
add_compile_options(-fno-strict-aliasing)
|
||||
|
||||
# This is necessary to hide all symbols unless explicitly exported
|
||||
# via the Q_EXPORT macro
|
||||
#add_compile_options(-fvisibility=hidden)
|
||||
|
||||
add_compile_options(-Wno-comment)
|
||||
# Treat no return type as error
|
||||
add_compile_options(-Werror=return-type)
|
||||
|
||||
set(ASM_SOURCES)
|
||||
|
||||
execute_process(COMMAND ${CMAKE_C_COMPILER} -v
|
||||
OUTPUT_VARIABLE COMPILER_OUTPUT
|
||||
ERROR_VARIABLE COMPILER_OUTPUT
|
||||
OUTPUT_STRIP_TRAILING_WHITESPACE)
|
||||
|
||||
list(APPEND CLIENT_LIBRARIES m)
|
||||
list(APPEND SERVER_LIBRARIES m)
|
||||
|
||||
if(COMPILER_OUTPUT MATCHES "musl|freebsd|openbsd|netbsd")
|
||||
list(APPEND CLIENT_LIBRARIES execinfo)
|
||||
list(APPEND SERVER_LIBRARIES execinfo)
|
||||
elseif (NOT APPLE AND NOT ANDROID)
|
||||
# For when using GLIBC versions older than 2.34
|
||||
# (bionic has no librt; the same symbols live in libc)
|
||||
list(APPEND CLIENT_LIBRARIES rt)
|
||||
list(APPEND SERVER_LIBRARIES rt)
|
||||
endif()
|
||||
@@ -0,0 +1,55 @@
|
||||
# MSVC compiler specific settings
|
||||
|
||||
if(NOT CMAKE_C_COMPILER_ID STREQUAL "MSVC")
|
||||
return()
|
||||
endif()
|
||||
|
||||
include(utils/arch)
|
||||
|
||||
#enable_language(ASM_MASM)
|
||||
|
||||
set(ASM_SOURCES
|
||||
${SOURCE_DIR}/asm/snapvector.asm
|
||||
${SOURCE_DIR}/asm/ftola.asm
|
||||
)
|
||||
|
||||
if(ARCH MATCHES "x86_64")
|
||||
list(APPEND ASM_SOURCES ${SOURCE_DIR}/asm/vm_x86_64.asm)
|
||||
set_source_files_properties(
|
||||
${ASM_SOURCES}
|
||||
PROPERTIES COMPILE_DEFINITIONS "idx64")
|
||||
endif()
|
||||
|
||||
# Baseline warnings
|
||||
add_compile_options("$<$<COMPILE_LANGUAGE:C>:/W4>")
|
||||
|
||||
# C4267: 'var' : conversion from 'size_t' to 'type', possible loss of data
|
||||
# There are way too many of these to realistically deal with them
|
||||
add_compile_options("$<$<COMPILE_LANGUAGE:C>:/wd4267>")
|
||||
|
||||
# C4206: nonstandard extension used: translation unit is empty
|
||||
add_compile_options("$<$<COMPILE_LANGUAGE:C>:/wd4206>")
|
||||
|
||||
# C4324: 'struct': structure was padded due to alignment specifier
|
||||
add_compile_options("$<$<COMPILE_LANGUAGE:C>:/wd4324>")
|
||||
|
||||
# C4200: nonstandard extension used: zero-sized array in struct/union
|
||||
add_compile_options("$<$<COMPILE_LANGUAGE:C>:/wd4200>")
|
||||
|
||||
# MSVC doesn't understand __inline__, which libjpeg uses
|
||||
add_compile_definitions(__inline__=inline)
|
||||
|
||||
# It's unlikely that we'll move to the _s variants, so stop the warning
|
||||
add_compile_definitions(_CRT_SECURE_NO_WARNINGS)
|
||||
|
||||
# The sockets platform abstraction layer necessarily uses deprecated APIs
|
||||
add_compile_definitions(_WINSOCK_DEPRECATED_NO_WARNINGS)
|
||||
|
||||
#
|
||||
# Microsoft compiler specific parameters
|
||||
#
|
||||
add_compile_definitions(_CRT_SECURE_NO_WARNINGS)
|
||||
add_compile_definitions(_CRT_NONSTDC_NO_DEPRECATE)
|
||||
|
||||
# Treat no return type as error
|
||||
add_compile_options(/we4715)
|
||||
@@ -0,0 +1 @@
|
||||
include(deploy/unix)
|
||||
@@ -0,0 +1,28 @@
|
||||
|
||||
if(NOT APPLE AND NOT ANDROID)
|
||||
# Configure the .desktop entries with the arch suffix
|
||||
configure_file(
|
||||
misc/linux/org.openmoh.openmohaa.desktop.in
|
||||
${CMAKE_BINARY_DIR}/misc/linux/org.openmoh.openmohaa.desktop
|
||||
@ONLY
|
||||
)
|
||||
configure_file(
|
||||
misc/linux/org.openmoh.openmohaab.desktop.in
|
||||
${CMAKE_BINARY_DIR}/misc/linux/org.openmoh.openmohaab.desktop
|
||||
@ONLY
|
||||
)
|
||||
configure_file(
|
||||
misc/linux/org.openmoh.openmohaas.desktop.in
|
||||
${CMAKE_BINARY_DIR}/misc/linux/org.openmoh.openmohaas.desktop
|
||||
@ONLY
|
||||
)
|
||||
|
||||
# Install .desktop entries
|
||||
install(FILES ${CMAKE_BINARY_DIR}/misc/linux/org.openmoh.openmohaa.desktop DESTINATION ${INSTALL_DATADIR_FULL}/applications)
|
||||
install(FILES ${CMAKE_BINARY_DIR}/misc/linux/org.openmoh.openmohaab.desktop DESTINATION ${INSTALL_DATADIR_FULL}/applications)
|
||||
install(FILES ${CMAKE_BINARY_DIR}/misc/linux/org.openmoh.openmohaas.desktop DESTINATION ${INSTALL_DATADIR_FULL}/applications)
|
||||
|
||||
install(FILES misc/linux/org.openmoh.openmohaa.metainfo.xml DESTINATION ${INSTALL_DATADIR_FULL}/metainfo)
|
||||
|
||||
install(FILES misc/openmohaa.svg DESTINATION ${INSTALL_DATADIR_FULL}/icons/hicolor/symbolic/apps/ RENAME org.openmoh.openmohaa.svg)
|
||||
endif()
|
||||
@@ -0,0 +1,9 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN"
|
||||
"http://www.apple.com/DTDs/PropertyList-1.0.dtd">
|
||||
<plist version="1.0">
|
||||
<dict>
|
||||
<key>com.apple.security.cs.allow-unsigned-executable-memory</key>
|
||||
<true/>
|
||||
</dict>
|
||||
</plist>
|
||||
@@ -0,0 +1,62 @@
|
||||
include_directories(${SOURCE_DIR}/gamespy/common)
|
||||
include_directories(${SOURCE_DIR}/gamespy/gcdkey)
|
||||
|
||||
file(GLOB SRCS_common
|
||||
${SOURCE_DIR}/gamespy/common/*.c
|
||||
${SOURCE_DIR}/gamespy/darray.c
|
||||
${SOURCE_DIR}/gamespy/gserver.c
|
||||
${SOURCE_DIR}/gamespy/gserverlist.c
|
||||
${SOURCE_DIR}/gamespy/hashtable.c
|
||||
${SOURCE_DIR}/gamespy/md5c.c
|
||||
${SOURCE_DIR}/gamespy/gutil.c
|
||||
)
|
||||
|
||||
file(GLOB SRCS_gcdkey
|
||||
${SOURCE_DIR}/gamespy/gcdkey/*.c
|
||||
)
|
||||
|
||||
file(GLOB SRCS_natneg
|
||||
${SOURCE_DIR}/gamespy/natneg/*.c
|
||||
)
|
||||
|
||||
file(GLOB SRCS_qr2
|
||||
${SOURCE_DIR}/gamespy/qr2/*.c
|
||||
)
|
||||
|
||||
add_library(gcd_common STATIC ${SRCS_common})
|
||||
add_library(gcd_key STATIC ${SRCS_gcdkey})
|
||||
add_library(gcd_natneg STATIC ${SRCS_natneg})
|
||||
add_library(gcd_qr2 STATIC ${SRCS_qr2})
|
||||
add_library(gcd INTERFACE)
|
||||
|
||||
set_property(TARGET gcd_common gcd_key PROPERTY POSITION_INDEPENDENT_CODE ON)
|
||||
|
||||
if(UNIX)
|
||||
add_definitions(-D_LINUX=1)
|
||||
endif()
|
||||
|
||||
set(DEPENDENT_LIBS
|
||||
gcd_key
|
||||
# gcd_gp
|
||||
# gcd_gstats
|
||||
gcd_natneg
|
||||
# gcd_pinger
|
||||
# gcd_pt
|
||||
gcd_qr2
|
||||
# gcd_sake
|
||||
# gcd_sc
|
||||
# gcd_serverbrowsing
|
||||
# gcd_webservices
|
||||
)
|
||||
|
||||
target_link_libraries(gcd INTERFACE ${DEPENDENT_LIBS})
|
||||
|
||||
foreach(LIB ${DEPENDENT_LIBS})
|
||||
target_link_libraries(${LIB} PUBLIC gcd_common)
|
||||
endforeach()
|
||||
|
||||
target_link_libraries(gcd_key PRIVATE gcd_qr2)
|
||||
target_link_libraries(gcd_qr2 PRIVATE gcd_natneg)
|
||||
|
||||
list(APPEND CLIENT_LIBRARIES gcd)
|
||||
list(APPEND SERVER_LIBRARIES gcd)
|
||||
@@ -0,0 +1,21 @@
|
||||
set(PROJECT_NAME openmohaa)
|
||||
set(PROJECT_VERSION 0.83.0)
|
||||
|
||||
set(SERVER_NAME omohaaded)
|
||||
set(CLIENT_NAME openmohaa)
|
||||
|
||||
set(BASEGAME)
|
||||
|
||||
set(CGAME_MODULE cgame)
|
||||
set(GAME_MODULE game)
|
||||
set(UI_MODULE ui)
|
||||
|
||||
set(WINDOWS_ICON_PATH ${CMAKE_SOURCE_DIR}/misc/windows/openmohaa.ico)
|
||||
|
||||
set(MACOS_ICON_PATH ${CMAKE_SOURCE_DIR}/misc/macos/openmohaa.icns)
|
||||
set(MACOS_BUNDLE_ID org.openmohaa.${CLIENT_NAME})
|
||||
|
||||
set(COPYRIGHT "OpenMoHAA Copyright © 2025 OpenMoHAA Team, Inc. All rights reserved.")
|
||||
|
||||
set(CONTACT_EMAIL "")
|
||||
set(PROTOCOL_HANDLER_SCHEME openmohaa)
|
||||
@@ -0,0 +1,30 @@
|
||||
get_directory_property(INSTALL_TARGETS DIRECTORY
|
||||
${CMAKE_SOURCE_DIR} BUILDSYSTEM_TARGETS)
|
||||
|
||||
# Iterate over all the targets that have an INSTALL_DESTINATION
|
||||
# property (set by set_output_dirs) and call install() on them
|
||||
foreach(TARGET IN LISTS INSTALL_TARGETS)
|
||||
get_target_property(DESTINATION ${TARGET} INSTALL_DESTINATION)
|
||||
if(NOT DESTINATION)
|
||||
continue()
|
||||
endif()
|
||||
|
||||
install(TARGETS ${TARGET}
|
||||
RUNTIME DESTINATION ${DESTINATION}
|
||||
LIBRARY DESTINATION ${DESTINATION}
|
||||
BUNDLE DESTINATION ${DESTINATION}
|
||||
ARCHIVE EXCLUDE_FROM_ALL)
|
||||
endforeach()
|
||||
|
||||
if(NOT CPACK_GENERATOR)
|
||||
return()
|
||||
endif()
|
||||
|
||||
set(CPACK_PACKAGE_NAME ${PROJECT_NAME})
|
||||
set(CPACK_PACKAGE_INSTALL_DIRECTORY ${PROJECT_NAME})
|
||||
set(CPACK_PACKAGE_EXECUTABLES ${CLIENT_NAME} ${PROJECT_NAME})
|
||||
set(CPACK_PACKAGE_FILE_NAME ${PROJECT_NAME}-${PRODUCT_VERSION})
|
||||
set(CPACK_PACKAGE_CONTACT ${CONTACT_EMAIL})
|
||||
set(CPACK_RESOURCE_FILE_LICENSE ${CMAKE_SOURCE_DIR}/COPYING.txt)
|
||||
|
||||
include(CPack)
|
||||
@@ -1,32 +1,34 @@
|
||||
cmake_minimum_required(VERSION 3.12)
|
||||
if(ANDROID)
|
||||
# The launcher picks a game binary to exec; on Android the activity is
|
||||
# the entry point instead.
|
||||
return()
|
||||
endif()
|
||||
|
||||
project(Launcher)
|
||||
|
||||
set(LAUNCHER_SOURCES "${CMAKE_SOURCE_DIR}/code/Launcher/launch_main.cpp")
|
||||
set(LAUNCHER_SOURCES "${SOURCE_DIR}/Launcher/launch_main.cpp")
|
||||
|
||||
if (WIN32)
|
||||
set(LAUNCHER_SOURCES ${LAUNCHER_SOURCES}
|
||||
"${CMAKE_SOURCE_DIR}/code/Launcher/launch_win32.cpp"
|
||||
"${CMAKE_SOURCE_DIR}/code/sys/win_resource.rc")
|
||||
list(APPEND LAUNCHER_SOURCES
|
||||
${SOURCE_DIR}/Launcher/launch_win32.cpp
|
||||
${SOURCE_DIR}/sys/win_resource.rc
|
||||
)
|
||||
else()
|
||||
set(LAUNCHER_SOURCES ${LAUNCHER_SOURCES}
|
||||
"${CMAKE_SOURCE_DIR}/code/Launcher/launch_linux.cpp")
|
||||
list(APPEND LAUNCHER_SOURCES
|
||||
${SOURCE_DIR}/Launcher/launch_linux.cpp
|
||||
)
|
||||
endif()
|
||||
|
||||
function (create_launcher name type)
|
||||
if (NOT BUILD_NO_CLIENT)
|
||||
if (BUILD_CLIENT)
|
||||
add_executable(openmohaa_launcher_${name} ${LAUNCHER_SOURCES})
|
||||
target_include_directories(openmohaa_launcher_${name} PUBLIC "../qcommon")
|
||||
target_compile_definitions(openmohaa_launcher_${name} PRIVATE NO_RC_MANIFEST=1 TARGET_GAME=${type})
|
||||
target_compile_features(openmohaa_launcher_${name} PRIVATE cxx_std_17)
|
||||
set_target_properties(openmohaa_launcher_${name} PROPERTIES OUTPUT_NAME "launch_openmohaa_${name}${TARGET_BIN_SUFFIX}")
|
||||
set_target_properties(openmohaa_launcher_${name} PROPERTIES DEBUG_POSTFIX ${CMAKE_DEBUG_POSTFIX})
|
||||
|
||||
INSTALL(TARGETS openmohaa_launcher_${name} DESTINATION ${CMAKE_INSTALL_BINDIR}/${BIN_INSTALL_SUBDIR})
|
||||
INSTALL(TARGETS openmohaa_launcher_${name} DESTINATION ${INSTALL_BINDIR_FULL})
|
||||
endif()
|
||||
|
||||
#add_executable(omohaaded_launcher_${name} ${LAUNCHER_SOURCES})
|
||||
#target_include_directories(omohaaded_launcher_${name} PUBLIC "../qcommon")
|
||||
#target_compile_definitions(omohaaded_launcher_${name} PRIVATE NO_RC_MANIFEST=1 TARGET_GAME=${type} DEDICATED=1)
|
||||
#target_compile_features(omohaaded_launcher_${name} PRIVATE cxx_std_17)
|
||||
#set_target_properties(omohaaded_launcher_${name} PROPERTIES OUTPUT_NAME "launch_omohaaded_${name}${TARGET_BIN_SUFFIX}")
|
||||
@@ -0,0 +1,14 @@
|
||||
include(libraries/curl)
|
||||
include(libraries/freetype)
|
||||
include(libraries/jpeg)
|
||||
include(libraries/ogg)
|
||||
include(libraries/opus)
|
||||
include(libraries/openal)
|
||||
include(libraries/openxr)
|
||||
include(libraries/gl4es)
|
||||
include(libraries/sdl)
|
||||
include(libraries/vorbis)
|
||||
include(libraries/zlib)
|
||||
include(libraries/libmad)
|
||||
include(libraries/flex_bison)
|
||||
include(libraries/recastnavigation)
|
||||
@@ -0,0 +1,19 @@
|
||||
if(NOT USE_HTTP)
|
||||
return()
|
||||
endif()
|
||||
|
||||
set(INTERNAL_CURL_DIR ${SOURCE_DIR}/thirdparty/curl-8.15.0/include)
|
||||
|
||||
find_package(CURL QUIET)
|
||||
|
||||
if(NOT CURL_FOUND)
|
||||
set(CURL_DEFINITIONS USE_INTERNAL_CURL_HEADERS)
|
||||
set(CURL_INCLUDE_DIRS ${INTERNAL_CURL_DIR})
|
||||
endif()
|
||||
|
||||
list(APPEND CLIENT_DEFINITIONS ${CURL_DEFINITIONS})
|
||||
list(APPEND CLIENT_INCLUDE_DIRS ${CURL_INCLUDE_DIRS})
|
||||
|
||||
# For some functions like update checker
|
||||
list(APPEND SERVER_DEFINITIONS ${CURL_DEFINITIONS})
|
||||
list(APPEND SERVER_INCLUDE_DIRS ${CURL_INCLUDE_DIRS})
|
||||
@@ -0,0 +1,18 @@
|
||||
#
|
||||
# Workaround to get a recent version Flex and Bison executables in MacOS
|
||||
# as Bison 2.3 shipped with MacOS doesn't work
|
||||
#
|
||||
if (CMAKE_HOST_SYSTEM_NAME MATCHES "Darwin")
|
||||
execute_process(COMMAND brew --prefix bison RESULT_VARIABLE APP_RESULT OUTPUT_VARIABLE APP_PREFIX OUTPUT_STRIP_TRAILING_WHITESPACE)
|
||||
if (APP_RESULT EQUAL 0 AND EXISTS "${APP_PREFIX}")
|
||||
set(BISON_EXECUTABLE "${APP_PREFIX}/bin/bison")
|
||||
endif()
|
||||
|
||||
execute_process(COMMAND brew --prefix flex RESULT_VARIABLE APP_RESULT OUTPUT_VARIABLE APP_PREFIX OUTPUT_STRIP_TRAILING_WHITESPACE)
|
||||
if (APP_RESULT EQUAL 0 AND EXISTS "${APP_PREFIX}")
|
||||
set(FLEX_EXECUTABLE "${APP_PREFIX}/bin/flex")
|
||||
endif()
|
||||
endif()
|
||||
|
||||
find_package(BISON 3 REQUIRED)
|
||||
find_package(FLEX REQUIRED)
|
||||
@@ -0,0 +1,12 @@
|
||||
if(NOT USE_FREETYPE)
|
||||
return()
|
||||
endif()
|
||||
|
||||
if(NOT BUILD_RENDERER_GL1 AND NOT BUILD_RENDERER_GL2)
|
||||
return()
|
||||
endif()
|
||||
|
||||
find_package(Freetype REQUIRED)
|
||||
|
||||
list(APPEND RENDERER_INCLUDE_DIRS ${FREETYPE_INCLUDE_DIRS})
|
||||
list(APPEND RENDERER_LIBRARIES ${FREETYPE_LIBRARIES})
|
||||
@@ -0,0 +1,125 @@
|
||||
if(NOT ANDROID OR NOT BUILD_CLIENT OR NOT USE_GL4ES)
|
||||
return()
|
||||
endif()
|
||||
|
||||
# gl4es translates the fixed function OpenGL the original renderer speaks into
|
||||
# the OpenGL ES the device actually has.
|
||||
#
|
||||
# This is here because renderergl1 is the renderer this game's art was authored
|
||||
# for. renderergl2 is the rend2 rewrite: every surface goes through a GLSL
|
||||
# program with dozens of uniforms set on it, once per surface per eye, and the
|
||||
# frame timing found tens of milliseconds of CPU going into that while the GPU
|
||||
# finished in three. None of what it buys is visible on content that has no
|
||||
# normal or specular maps for it to read - so it costs the frame and returns a
|
||||
# picture further from the original than the plain path gives.
|
||||
#
|
||||
# The alternative was to port renderergl1's fixed function calls to ES by hand.
|
||||
# That is the same work gl4es already does, more thoroughly, and it is the same
|
||||
# choice RTCWQuest made for the same reason.
|
||||
|
||||
include(FetchContent)
|
||||
|
||||
set(GL4ES_VERSION 1.1.6)
|
||||
|
||||
set(GL4ES_SOURCE_PATH "" CACHE PATH
|
||||
"Existing gl4es source tree to build against; downloaded if empty")
|
||||
|
||||
if(GL4ES_SOURCE_PATH)
|
||||
FetchContent_Declare(gl4es SOURCE_DIR ${GL4ES_SOURCE_PATH})
|
||||
else()
|
||||
FetchContent_Declare(gl4es
|
||||
GIT_REPOSITORY https://github.com/ptitSeb/gl4es.git
|
||||
GIT_TAG v${GL4ES_VERSION}
|
||||
GIT_SHALLOW TRUE)
|
||||
endif()
|
||||
|
||||
# No X11 and no GBM on Android, and ES 2 as the backend. NO_INIT_CONSTRUCTOR
|
||||
# keeps it from initialising itself behind the engine's back: the context is
|
||||
# created by SDL and handed to OpenXR, and gl4es has to attach to that one
|
||||
# rather than make its own. These are the flags RTCWQuest ships.
|
||||
set(NOX11 ON CACHE BOOL "" FORCE)
|
||||
set(GBM OFF CACHE BOOL "" FORCE)
|
||||
set(STATICLIB OFF CACHE BOOL "" FORCE)
|
||||
|
||||
FetchContent_MakeAvailable(gl4es)
|
||||
|
||||
# The target is called GL, because that is what gl4es presents itself as - it
|
||||
# takes over the OpenGL entry points the renderer calls. Named back to gl4es on
|
||||
# disk so the APK does not ship something calling itself libGL.so, which is a
|
||||
# name the platform has its own ideas about.
|
||||
if(NOT TARGET GL)
|
||||
message(FATAL_ERROR
|
||||
"gl4es did not declare its GL target; nothing would translate the GL1 "
|
||||
"renderer's calls. Configure with -DUSE_GL4ES=OFF to build without it.")
|
||||
endif()
|
||||
|
||||
# Built the way RTCWQuest builds it, because that combination is known to render
|
||||
# on this device and this one does not.
|
||||
#
|
||||
# Their Android.mk (SupportLibs/gl4es/Android.mk) compiles with exactly:
|
||||
#
|
||||
# -DBCMHOST -DNOX11 -DNO_GBM -DDEFAULT_ES=2 -DNO_INIT_CONSTRUCTOR
|
||||
# -O3 -fcommon -fvisibility=hidden -funwind-tables
|
||||
#
|
||||
# Two differences from what CMake produces on its own are worth naming.
|
||||
#
|
||||
# ANDROID is *not* among them. gl4es's own CMakeLists adds it whenever it is
|
||||
# built with the NDK toolchain, and it is not a harmless label: it selects
|
||||
# different code in the loader, in glx, and in hardext - which is where gl4es
|
||||
# compiles a probe shader to decide what its whole fixed function pipeline is
|
||||
# allowed to emit. ndk-build never defines it, so the reference has been
|
||||
# exercised without it and this has not.
|
||||
#
|
||||
# BCMHOST is the Raspberry Pi switch, which looks wrong on a Quest and is
|
||||
# carried anyway, because everything it gates is additionally guarded by
|
||||
# !defined(ANDROID). Matching the reference matters more here than tidiness.
|
||||
#
|
||||
# add_definitions() in gl4es's CMakeLists is a directory property, so the
|
||||
# ANDROID it adds has to be removed at the directory it was set on rather than
|
||||
# overridden on the target.
|
||||
foreach(GL4ES_DIR ${gl4es_SOURCE_DIR} ${gl4es_SOURCE_DIR}/src)
|
||||
set_property(DIRECTORY ${GL4ES_DIR} PROPERTY COMPILE_DEFINITIONS
|
||||
BCMHOST
|
||||
NOX11
|
||||
NO_GBM
|
||||
DEFAULT_ES=2
|
||||
NO_INIT_CONSTRUCTOR)
|
||||
endforeach()
|
||||
|
||||
target_compile_options(GL PRIVATE
|
||||
-O3
|
||||
# gl4es is old C that expects tentative definitions to be merged. Clang has
|
||||
# defaulted to -fno-common since 15; the NDK here is newer than that and the
|
||||
# reference build is not.
|
||||
-fcommon
|
||||
-fvisibility=hidden
|
||||
-funwind-tables)
|
||||
|
||||
# What their LOCAL_LDLIBS names. gl4es dlopen()s the driver itself, so these are
|
||||
# not needed to resolve anything; they are here so the library is built against
|
||||
# the same set the reference links.
|
||||
target_link_libraries(GL PRIVATE EGL GLESv3 dl log)
|
||||
|
||||
set_target_properties(GL PROPERTIES
|
||||
# Shipped inside the APK, so it needs the prefix the top level CMakeLists
|
||||
# cleared for the engine's own libraries.
|
||||
OUTPUT_NAME gl4es
|
||||
PREFIX ${ANDROID_APK_LIBRARY_PREFIX}
|
||||
|
||||
# gl4es builds itself as libGL.so.1 in the manner of a system OpenGL
|
||||
# (src/CMakeLists.txt forces the suffix). Android has no versioned sonames:
|
||||
# the package manager only extracts lib*.so out of an APK, and the linker
|
||||
# would not load the result if it did. Back to a plain suffix.
|
||||
SUFFIX ".so"
|
||||
|
||||
# gl4es's own CMakeLists points CMAKE_LIBRARY_OUTPUT_DIRECTORY at
|
||||
# ${CMAKE_SOURCE_DIR}/lib, and under FetchContent that is *this* project's
|
||||
# source root - so without this the artifact is written into the engine's
|
||||
# source tree, where nobody thinks to look for it and git has to ignore it.
|
||||
LIBRARY_OUTPUT_DIRECTORY ${gl4es_BINARY_DIR}/lib)
|
||||
|
||||
# The renderer includes <GL/gl.h>, which on Android only exists because gl4es
|
||||
# provides it.
|
||||
list(APPEND RENDERER_INCLUDE_DIRS ${gl4es_SOURCE_DIR}/include)
|
||||
list(APPEND RENDERER_LIBRARIES GL)
|
||||
list(APPEND RENDERER_DEFINITIONS USE_GL4ES)
|
||||
@@ -0,0 +1,22 @@
|
||||
if(NOT BUILD_RENDERER_GL1 AND NOT BUILD_RENDERER_GL2)
|
||||
return()
|
||||
endif()
|
||||
|
||||
include(utils/disable_warnings)
|
||||
include(utils/find_include_dirs)
|
||||
|
||||
set(INTERNAL_JPEG_DIR ${SOURCE_DIR}/thirdparty/jpeg-9f)
|
||||
|
||||
if(USE_INTERNAL_JPEG)
|
||||
file(GLOB_RECURSE JPEG_SOURCES ${INTERNAL_JPEG_DIR}/j*.c)
|
||||
disable_warnings(${JPEG_SOURCES})
|
||||
find_include_dirs(JPEG_INCLUDE_DIRS ${INTERNAL_JPEG_DIR})
|
||||
set(JPEG_DEFINITIONS USE_INTERNAL_JPEG)
|
||||
list(APPEND RENDERER_LIBRARY_SOURCES ${JPEG_SOURCES})
|
||||
else()
|
||||
find_package(JPEG REQUIRED)
|
||||
endif()
|
||||
|
||||
list(APPEND RENDERER_LIBRARIES ${JPEG_LIBRARIES})
|
||||
list(APPEND RENDERER_INCLUDE_DIRS ${JPEG_INCLUDE_DIRS})
|
||||
list(APPEND RENDERER_DEFINITIONS ${JPEG_DEFINTIONS})
|
||||
@@ -0,0 +1,33 @@
|
||||
if(NOT USE_CODEC_MAD)
|
||||
return()
|
||||
endif()
|
||||
|
||||
if(NOT BUILD_CLIENT)
|
||||
return()
|
||||
endif()
|
||||
|
||||
set(OLD_VALUE ${BUILD_SHARED_LIBS})
|
||||
set(BUILD_SHARED_LIBS OFF CACHE BOOL "" FORCE)
|
||||
|
||||
if(USE_INTERNAL_MAD)
|
||||
add_subdirectory("${SOURCE_DIR}/thirdparty/libmad" "./libmad" EXCLUDE_FROM_ALL)
|
||||
|
||||
list(APPEND CLIENT_LIBRARIES mad)
|
||||
else()
|
||||
include(FindPackageHandleStandardArgs)
|
||||
find_path(LIBMAD_INCLUDE_DIRS mad.h)
|
||||
find_library(LIBMAD_LIBRARIES mad)
|
||||
find_package_handle_standard_args(
|
||||
LibMad
|
||||
DEFAULT_MSG
|
||||
LIBMAD_LIBRARIES
|
||||
LIBMAD_INCLUDE_DIRS
|
||||
)
|
||||
|
||||
list(APPEND CLIENT_INCLUDE_DIRS ${LIBMAD_INCLUDE_DIRS})
|
||||
list(APPEND CLIENT_LIBRARIES ${LIBMAD_LIBRARIES})
|
||||
endif()
|
||||
|
||||
set(BUILD_SHARED_LIBS ${OLD_VALUE} CACHE BOOL "" FORCE)
|
||||
|
||||
list(APPEND CLIENT_DEFINITIONS USE_CODEC_MAD=1)
|
||||
@@ -0,0 +1,25 @@
|
||||
if(NOT USE_CODEC_VORBIS)
|
||||
return()
|
||||
endif()
|
||||
|
||||
if(NOT BUILD_CLIENT)
|
||||
return()
|
||||
endif()
|
||||
|
||||
include(utils/disable_warnings)
|
||||
|
||||
set(INTERNAL_OGG_DIR ${SOURCE_DIR}/thirdparty/libogg-1.3.6)
|
||||
|
||||
if(USE_INTERNAL_OGG)
|
||||
file(GLOB_RECURSE OGG_SOURCES ${INTERNAL_OGG_DIR}/*.c)
|
||||
disable_warnings(${OGG_SOURCES})
|
||||
set(OGG_INCLUDE_DIRS ${INTERNAL_OGG_DIR}/include)
|
||||
list(APPEND CLIENT_LIBRARY_SOURCES ${OGG_SOURCES})
|
||||
else()
|
||||
find_package(PkgConfig REQUIRED)
|
||||
pkg_check_modules(OGG REQUIRED ogg)
|
||||
endif()
|
||||
|
||||
list(APPEND CLIENT_LIBRARIES ${OGG_LIBRARIES})
|
||||
list(APPEND CLIENT_INCLUDE_DIRS ${OGG_INCLUDE_DIRS})
|
||||
list(APPEND CLIENT_DEFINITIONS ${OGG_DEFINITIONS})
|
||||
@@ -0,0 +1,69 @@
|
||||
if(NOT USE_OPENAL)
|
||||
return()
|
||||
endif()
|
||||
|
||||
if(NOT BUILD_CLIENT)
|
||||
return()
|
||||
endif()
|
||||
|
||||
set(INTERNAL_OPENAL_VERSION 1.24.3)
|
||||
set(INTERNAL_OPENAL_DIR ${SOURCE_DIR}/thirdparty/openal-soft-${INTERNAL_OPENAL_VERSION})
|
||||
|
||||
if(ANDROID)
|
||||
# There is no system OpenAL on Android, and OpenAL is not optional here:
|
||||
# it is the engine's only sound driver (see SOUND_DRIVER in
|
||||
# snd_local_new.h). Build OpenAL Soft from source; its OpenSL ES backend is
|
||||
# what actually reaches the headset.
|
||||
include(FetchContent)
|
||||
|
||||
set(OPENAL_SOURCE_PATH "" CACHE PATH
|
||||
"Existing OpenAL Soft source tree to build against; downloaded if empty")
|
||||
|
||||
if(OPENAL_SOURCE_PATH)
|
||||
FetchContent_Declare(OpenAL SOURCE_DIR ${OPENAL_SOURCE_PATH})
|
||||
else()
|
||||
FetchContent_Declare(OpenAL
|
||||
URL https://github.com/kcat/openal-soft/archive/refs/tags/${INTERNAL_OPENAL_VERSION}.tar.gz
|
||||
URL_HASH SHA256=7e1fecdeb45e7f78722b776c5cf30bd33934b961d7fd2a11e0494e064cc631ce)
|
||||
endif()
|
||||
|
||||
set(ALSOFT_EXAMPLES OFF CACHE BOOL "" FORCE)
|
||||
set(ALSOFT_UTILS OFF CACHE BOOL "" FORCE)
|
||||
set(ALSOFT_TESTS OFF CACHE BOOL "" FORCE)
|
||||
set(ALSOFT_INSTALL OFF CACHE BOOL "" FORCE)
|
||||
set(ALSOFT_INSTALL_CONFIG OFF CACHE BOOL "" FORCE)
|
||||
set(ALSOFT_INSTALL_HRTF_DATA OFF CACHE BOOL "" FORCE)
|
||||
set(ALSOFT_INSTALL_AMBDEC_PRESETS OFF CACHE BOOL "" FORCE)
|
||||
set(ALSOFT_INSTALL_EXAMPLES OFF CACHE BOOL "" FORCE)
|
||||
set(ALSOFT_INSTALL_UTILS OFF CACHE BOOL "" FORCE)
|
||||
|
||||
FetchContent_MakeAvailable(OpenAL)
|
||||
|
||||
# See the same note in sdl.cmake: the cleared prefix is inherited from the
|
||||
# top level and has to be put back for anything shipped inside the APK.
|
||||
set_target_properties(OpenAL PROPERTIES PREFIX ${ANDROID_APK_LIBRARY_PREFIX})
|
||||
|
||||
# OpenAL::OpenAL carries its own include directory, so <AL/al.h> resolves
|
||||
# without the vendored copy.
|
||||
list(APPEND CLIENT_DEFINITIONS USE_OPENAL)
|
||||
list(APPEND CLIENT_LIBRARIES OpenAL::OpenAL)
|
||||
return()
|
||||
endif()
|
||||
|
||||
find_package(OpenAL QUIET)
|
||||
|
||||
if(NOT OpenAL_FOUND)
|
||||
set(OPENAL_DEFINITIONS USE_INTERNAL_OPENAL_HEADERS)
|
||||
set(OPENAL_INCLUDE_DIR ${INTERNAL_OPENAL_DIR}/include)
|
||||
set(OPENAL_LIBRARY openal)
|
||||
endif()
|
||||
|
||||
list(APPEND CLIENT_DEFINITIONS ${OPENAL_DEFINITIONS} USE_OPENAL)
|
||||
list(APPEND CLIENT_INCLUDE_DIRS ${OPENAL_INCLUDE_DIR})
|
||||
|
||||
if(USE_OPENAL_DLOPEN)
|
||||
list(APPEND CLIENT_DEFINITIONS USE_OPENAL_DLOPEN)
|
||||
else()
|
||||
find_package(Threads REQUIRED)
|
||||
list(APPEND CLIENT_LIBRARIES Threads::Threads ${OPENAL_LIBRARY})
|
||||
endif()
|
||||
@@ -0,0 +1,46 @@
|
||||
if(NOT USE_OPENXR OR NOT BUILD_CLIENT)
|
||||
return()
|
||||
endif()
|
||||
|
||||
# The Khronos loader is the vendor-neutral one: it finds whatever runtime the
|
||||
# device provides (Meta, Pico, SteamVR) rather than binding us to a vendor SDK.
|
||||
include(FetchContent)
|
||||
|
||||
set(OPENXR_VERSION 1.1.43)
|
||||
|
||||
set(OPENXR_SOURCE_PATH "" CACHE PATH
|
||||
"Existing OpenXR-SDK source tree to build against; downloaded if empty")
|
||||
|
||||
if(OPENXR_SOURCE_PATH)
|
||||
FetchContent_Declare(OpenXR SOURCE_DIR ${OPENXR_SOURCE_PATH})
|
||||
else()
|
||||
FetchContent_Declare(OpenXR
|
||||
URL https://github.com/KhronosGroup/OpenXR-SDK/archive/refs/tags/release-${OPENXR_VERSION}.tar.gz
|
||||
URL_HASH SHA256=fd0834e4bc75c935248d82ac044f472ab3af4d8ff3b191a3ccace3436975a4cf)
|
||||
endif()
|
||||
|
||||
set(BUILD_TESTS OFF CACHE BOOL "" FORCE)
|
||||
set(BUILD_API_LAYERS OFF CACHE BOOL "" FORCE)
|
||||
set(BUILD_LOADER ON CACHE BOOL "" FORCE)
|
||||
set(DYNAMIC_LOADER ON CACHE BOOL "" FORCE)
|
||||
|
||||
FetchContent_MakeAvailable(OpenXR)
|
||||
|
||||
if(ANDROID)
|
||||
# Shipped in the APK, so it needs the prefix the top level CMakeLists cleared
|
||||
set_target_properties(openxr_loader PROPERTIES PREFIX ${ANDROID_APK_LIBRARY_PREFIX})
|
||||
endif()
|
||||
|
||||
list(APPEND CLIENT_DEFINITIONS USE_OPENXR)
|
||||
list(APPEND CLIENT_LIBRARIES OpenXR::openxr_loader)
|
||||
list(APPEND CLIENT_LIBRARY_SOURCES ${SOURCE_DIR}/vr/vr_openxr.c)
|
||||
|
||||
if(ANDROID)
|
||||
# The VR layer owns the eye framebuffers and hands the session its EGL
|
||||
# context, so unlike the renderer it calls GL and EGL directly rather than
|
||||
# through SDL's loader.
|
||||
list(APPEND CLIENT_LIBRARIES EGL GLESv3)
|
||||
endif()
|
||||
|
||||
# The renderer needs to know which framebuffer to draw an eye into
|
||||
list(APPEND RENDERER_DEFINITIONS USE_OPENXR)
|
||||
@@ -0,0 +1,31 @@
|
||||
if(NOT USE_CODEC_OPUS)
|
||||
return()
|
||||
endif()
|
||||
|
||||
if(NOT BUILD_CLIENT)
|
||||
return()
|
||||
endif()
|
||||
|
||||
include(utils/disable_warnings)
|
||||
include(utils/find_include_dirs)
|
||||
|
||||
set(INTERNAL_OPUS_DIR ${SOURCE_DIR}/thirdparty/opus-1.5.2)
|
||||
set(INTERNAL_OPUSFILE_DIR ${SOURCE_DIR}/thirdparty/opusfile-0.12)
|
||||
|
||||
if(USE_INTERNAL_OPUS)
|
||||
file(GLOB_RECURSE OPUS_SOURCES ${INTERNAL_OPUS_DIR}/*.c)
|
||||
file(GLOB_RECURSE OPUSFILE_SOURCES ${INTERNAL_OPUSFILE_DIR}/*.c)
|
||||
disable_warnings(${OPUS_SOURCES} ${OPUSFILE_SOURCES})
|
||||
find_include_dirs(OPUS_INCLUDE_DIRS ${INTERNAL_OPUS_DIR})
|
||||
find_include_dirs(OPUSFILE_INCLUDE_DIRS ${INTERNAL_OPUSFILE_DIR})
|
||||
set(OPUS_DEFINITIONS OPUS_BUILD HAVE_LRINTF FLOATING_POINT FLOAT_APPROX USE_ALLOCA)
|
||||
list(APPEND CLIENT_LIBRARY_SOURCES ${OPUS_SOURCES} ${OPUSFILE_SOURCES})
|
||||
else()
|
||||
find_package(PkgConfig REQUIRED)
|
||||
pkg_check_modules(OPUS REQUIRED opus)
|
||||
pkg_check_modules(OPUSFILE REQUIRED opusfile)
|
||||
endif()
|
||||
|
||||
list(APPEND CLIENT_LIBRARIES ${OPUS_LIBRARIES} ${OPUSFILE_LIBRARIES})
|
||||
list(APPEND CLIENT_INCLUDE_DIRS ${OPUS_INCLUDE_DIRS} ${OPUSFILE_INCLUDE_DIRS})
|
||||
list(APPEND CLIENT_DEFINITIONS USE_CODEC_OPUS ${OPUS_DEFINITIONS} ${OPUSFILE_DEFINITIONS})
|
||||
@@ -0,0 +1,9 @@
|
||||
# Recast navigation
|
||||
add_subdirectory(${SOURCE_DIR}/thirdparty/recastnavigation/Detour recastnav_detour)
|
||||
add_subdirectory(${SOURCE_DIR}/thirdparty/recastnavigation/DetourCrowd recastnav_crowd)
|
||||
add_subdirectory(${SOURCE_DIR}/thirdparty/recastnavigation/Recast recacstnav_recast)
|
||||
# Enable position independant code on recast navigation libraries.
|
||||
# Otherwise linking will fail relocating some functions on Linux
|
||||
set_property(TARGET Detour DetourCrowd Recast PROPERTY POSITION_INDEPENDENT_CODE ON)
|
||||
|
||||
set_target_properties(Detour DetourCrowd Recast PROPERTIES LINKER_LANGUAGE CXX)
|
||||
@@ -0,0 +1,105 @@
|
||||
if(NOT BUILD_CLIENT)
|
||||
return()
|
||||
endif()
|
||||
|
||||
if(EMSCRIPTEN)
|
||||
# Emscripten provides its own self contained SDL setup
|
||||
list(APPEND CLIENT_COMPILE_OPTIONS -sUSE_SDL=2)
|
||||
list(APPEND CLIENT_LINK_OPTIONS -sUSE_SDL=2)
|
||||
return()
|
||||
endif()
|
||||
|
||||
set(INTERNAL_SDL_VERSION 2.32.8)
|
||||
set(INTERNAL_SDL_DIR ${SOURCE_DIR}/thirdparty/SDL2-${INTERNAL_SDL_VERSION})
|
||||
|
||||
include(utils/arch)
|
||||
|
||||
if(ANDROID)
|
||||
# There is no prebuilt SDL for Android, so it is built from source next to
|
||||
# the engine. The same tree also carries the org.libsdl.app Java classes
|
||||
# the APK needs, so the unpacked source is worth keeping hold of.
|
||||
include(FetchContent)
|
||||
|
||||
set(SDL2_SOURCE_PATH "" CACHE PATH
|
||||
"Existing SDL2 source tree to build against; downloaded if empty")
|
||||
|
||||
if(SDL2_SOURCE_PATH)
|
||||
FetchContent_Declare(SDL2 SOURCE_DIR ${SDL2_SOURCE_PATH})
|
||||
else()
|
||||
FetchContent_Declare(SDL2
|
||||
URL https://github.com/libsdl-org/SDL/releases/download/release-${INTERNAL_SDL_VERSION}/SDL2-${INTERNAL_SDL_VERSION}.tar.gz
|
||||
URL_HASH SHA256=0ca83e9c9b31e18288c7ec811108e58bac1f1bb5ec6577ad386830eac51c787e)
|
||||
endif()
|
||||
|
||||
# SDLActivity loads libSDL2.so from the APK by name, so it has to be shared.
|
||||
set(SDL_SHARED ON CACHE BOOL "" FORCE)
|
||||
set(SDL_STATIC OFF CACHE BOOL "" FORCE)
|
||||
set(SDL_TEST OFF CACHE BOOL "" FORCE)
|
||||
set(SDL2_DISABLE_INSTALL ON CACHE BOOL "" FORCE)
|
||||
set(SDL2_DISABLE_UNINSTALL ON CACHE BOOL "" FORCE)
|
||||
|
||||
FetchContent_MakeAvailable(SDL2)
|
||||
|
||||
# The top level CMakeLists clears the shared library prefix, which the
|
||||
# fetched project inherits. Put it back, or the APK ships an SDL2.so the
|
||||
# package manager will not extract and SDLActivity cannot load.
|
||||
set_target_properties(SDL2 PROPERTIES PREFIX ${ANDROID_APK_LIBRARY_PREFIX})
|
||||
|
||||
# Where the APK build picks up SDLActivity and friends
|
||||
set(SDL2_JAVA_DIR ${sdl2_SOURCE_DIR}/android-project/app/src/main/java
|
||||
CACHE INTERNAL "")
|
||||
|
||||
list(APPEND CLIENT_LIBRARIES SDL2::SDL2)
|
||||
list(APPEND RENDERER_LIBRARIES SDL2::SDL2)
|
||||
return()
|
||||
endif()
|
||||
|
||||
if(WIN32 OR APPLE)
|
||||
# On Windows and macOS we have internal SDL binaries we can use
|
||||
set(HAVE_INTERNAL_SDL true)
|
||||
endif()
|
||||
|
||||
if(USE_INTERNAL_SDL AND HAVE_INTERNAL_SDL)
|
||||
set(SDL2_INCLUDE_DIRS ${INTERNAL_SDL_DIR}/include)
|
||||
list(APPEND CLIENT_DEFINITIONS USE_INTERNAL_SDL_HEADERS)
|
||||
list(APPEND RENDERER_DEFINITIONS USE_INTERNAL_SDL_HEADERS)
|
||||
|
||||
if(WIN32)
|
||||
if(ARCH STREQUAL "x86_64")
|
||||
set(LIB_DIR ${SOURCE_DIR}/thirdparty/libs/win64)
|
||||
elseif(ARCH STREQUAL "x86")
|
||||
set(LIB_DIR ${SOURCE_DIR}/thirdparty/libs/win32)
|
||||
else()
|
||||
message(FATAL_ERROR "Unknown ARCH")
|
||||
endif()
|
||||
|
||||
if(MINGW)
|
||||
set(SDL2_LIBRARIES
|
||||
${LIB_DIR}/libSDL2main.a
|
||||
${LIB_DIR}/libSDL2.dll.a)
|
||||
elseif(MSVC)
|
||||
set(SDL2_LIBRARIES
|
||||
${LIB_DIR}/SDL2main.lib
|
||||
${LIB_DIR}/SDL2.lib)
|
||||
endif()
|
||||
|
||||
list(APPEND CLIENT_DEPLOY_LIBRARIES ${LIB_DIR}/SDL2.dll)
|
||||
elseif(APPLE)
|
||||
set(SDL2_LIBRARIES
|
||||
${SOURCE_DIR}/thirdparty/libs/macos/libSDL2main.a
|
||||
${SOURCE_DIR}/thirdparty/libs/macos/libSDL2-2.0.0.dylib)
|
||||
list(APPEND CLIENT_DEPLOY_LIBRARIES
|
||||
${SOURCE_DIR}/thirdparty/libs/macos/libSDL2-2.0.0.dylib)
|
||||
else()
|
||||
message(FATAL_ERROR "HAVE_INTERNAL_SDL set incorrectly; file a bug")
|
||||
endif()
|
||||
else()
|
||||
find_package(SDL2 REQUIRED)
|
||||
endif()
|
||||
|
||||
list(APPEND CLIENT_LIBRARIES ${SDL2_LIBRARIES})
|
||||
list(APPEND CLIENT_INCLUDE_DIRS ${SDL2_INCLUDE_DIRS})
|
||||
list(APPEND CLIENT_COMPILE_OPTIONS ${SDL2_CFLAGS_OTHER})
|
||||
list(APPEND RENDERER_LIBRARIES ${SDL2_LIBRARIES})
|
||||
list(APPEND RENDERER_INCLUDE_DIRS ${SDL2_INCLUDE_DIRS})
|
||||
list(APPEND RENDERER_COMPILE_OPTIONS ${SDL2_CFLAGS_OTHER})
|
||||
@@ -0,0 +1,26 @@
|
||||
if(NOT USE_CODEC_VORBIS)
|
||||
return()
|
||||
endif()
|
||||
|
||||
if(NOT BUILD_CLIENT)
|
||||
return()
|
||||
endif()
|
||||
|
||||
include(utils/disable_warnings)
|
||||
|
||||
set(INTERNAL_VORBIS_DIR ${SOURCE_DIR}/thirdparty/libvorbis-1.3.7)
|
||||
|
||||
if(USE_INTERNAL_VORBIS)
|
||||
file(GLOB_RECURSE VORBIS_SOURCES ${INTERNAL_VORBIS_DIR}/*.c)
|
||||
disable_warnings(${VORBIS_SOURCES})
|
||||
set(VORBIS_INCLUDE_DIRS ${INTERNAL_VORBIS_DIR}/include ${INTERNAL_VORBIS_DIR}/lib)
|
||||
list(APPEND CLIENT_LIBRARY_SOURCES ${VORBIS_SOURCES})
|
||||
else()
|
||||
find_package(PkgConfig REQUIRED)
|
||||
pkg_check_modules(VORBIS REQUIRED vorbis)
|
||||
pkg_check_modules(VORBISFILE REQUIRED vorbisfile)
|
||||
endif()
|
||||
|
||||
list(APPEND CLIENT_LIBRARIES ${VORBIS_LIBRARIES} ${VORBISFILE_LIBRARIES})
|
||||
list(APPEND CLIENT_INCLUDE_DIRS ${VORBIS_INCLUDE_DIRS} ${VORBISFILE_INCLUDE_DIRS})
|
||||
list(APPEND CLIENT_DEFINITIONS USE_CODEC_VORBIS ${VORBIS_DEFINITIONS} ${VORBISFILE_DEFINITIONS})
|
||||
@@ -0,0 +1,22 @@
|
||||
include(utils/disable_warnings)
|
||||
include(utils/find_include_dirs)
|
||||
|
||||
set(INTERNAL_ZLIB_DIR ${SOURCE_DIR}/thirdparty/zlib-1.3.1)
|
||||
|
||||
if(USE_INTERNAL_ZLIB)
|
||||
file(GLOB_RECURSE ZLIB_SOURCES ${INTERNAL_ZLIB_DIR}/*.c)
|
||||
disable_warnings(${ZLIB_SOURCES})
|
||||
find_include_dirs(ZLIB_INCLUDE_DIRS ${INTERNAL_ZLIB_DIR})
|
||||
set(ZLIB_DEFINITIONS NO_GZIP)
|
||||
list(APPEND SERVER_LIBRARY_SOURCES ${ZLIB_SOURCES})
|
||||
list(APPEND CLIENT_LIBRARY_SOURCES ${ZLIB_SOURCES})
|
||||
else()
|
||||
find_package(ZLIB REQUIRED)
|
||||
endif()
|
||||
|
||||
list(APPEND SERVER_LIBRARIES ${ZLIB_LIBRARIES})
|
||||
list(APPEND SERVER_INCLUDE_DIRS ${ZLIB_INCLUDE_DIRS})
|
||||
list(APPEND SERVER_DEFINITIONS ${ZLIB_DEFINITIONS})
|
||||
list(APPEND CLIENT_LIBRARIES ${ZLIB_LIBRARIES})
|
||||
list(APPEND CLIENT_INCLUDE_DIRS ${ZLIB_INCLUDE_DIRS})
|
||||
list(APPEND CLIENT_DEFINITIONS ${ZLIB_DEFINITIONS})
|
||||
@@ -0,0 +1,75 @@
|
||||
if(NOT BUILD_GAME_LIBRARIES AND NOT BUILD_GAME_QVMS)
|
||||
return()
|
||||
endif()
|
||||
|
||||
include(utils/qvm_tools)
|
||||
include(utils/set_output_dirs)
|
||||
|
||||
set(MPCGAME_SOURCES
|
||||
${SOURCE_DIR}/cgame/cg_newdraw.c
|
||||
${SOURCE_DIR}/ui/ui_shared.c
|
||||
)
|
||||
|
||||
set(MPUI_SOURCES
|
||||
${SOURCE_DIR}/ui/ui_main.c
|
||||
${SOURCE_DIR}/ui/ui_atoms.c
|
||||
${SOURCE_DIR}/ui/ui_gameinfo.c
|
||||
${SOURCE_DIR}/ui/ui_players.c
|
||||
${SOURCE_DIR}/ui/ui_shared.c
|
||||
${SOURCE_DIR}/game/bg_misc.c
|
||||
${SOURCE_DIR}/game/bg_lib.c
|
||||
)
|
||||
|
||||
set(MISSIONPACK "missionpack")
|
||||
|
||||
set(CGAME_SOURCES_MISSIONPACK ${CGAME_SOURCES} ${MPCGAME_SOURCES} ${GAME_MODULE_SHARED_SOURCES})
|
||||
set(GAME_SOURCES_MISSIONPACK ${GAME_SOURCES} ${GAME_MODULE_SHARED_SOURCES})
|
||||
set(UI_SOURCES_MISSIONPACK ${MPUI_SOURCES} ${GAME_MODULE_SHARED_SOURCES})
|
||||
|
||||
if(BUILD_GAME_LIBRARIES)
|
||||
set(CGAME_MODULE_BINARY_MISSIONPACK ${CGAME_MODULE_BINARY}_${MISSIONPACK})
|
||||
set(GAME_MODULE_BINARY_MISSIONPACK ${GAME_MODULE_BINARY}_${MISSIONPACK})
|
||||
set(UI_MODULE_BINARY_MISSIONPACK ${UI_MODULE_BINARY}_${MISSIONPACK})
|
||||
|
||||
add_library( ${CGAME_MODULE_BINARY_MISSIONPACK} SHARED ${CGAME_SOURCES_MISSIONPACK} ${CGAME_BINARY_SOURCES})
|
||||
target_compile_definitions( ${CGAME_MODULE_BINARY_MISSIONPACK} PRIVATE CGAME MISSIONPACK)
|
||||
target_link_libraries( ${CGAME_MODULE_BINARY_MISSIONPACK} PRIVATE ${COMMON_LIBRARIES})
|
||||
set_target_properties( ${CGAME_MODULE_BINARY_MISSIONPACK} PROPERTIES OUTPUT_NAME ${CGAME_MODULE_BINARY})
|
||||
set_output_dirs( ${CGAME_MODULE_BINARY_MISSIONPACK} SUBDIRECTORY ${MISSIONPACK})
|
||||
|
||||
add_library( ${GAME_MODULE_BINARY_MISSIONPACK} SHARED ${GAME_SOURCES_MISSIONPACK} ${GAME_BINARY_SOURCES})
|
||||
target_compile_definitions( ${GAME_MODULE_BINARY_MISSIONPACK} PRIVATE QAGAME MISSIONPACK)
|
||||
target_link_libraries( ${GAME_MODULE_BINARY_MISSIONPACK} PRIVATE ${COMMON_LIBRARIES})
|
||||
set_target_properties( ${GAME_MODULE_BINARY_MISSIONPACK} PROPERTIES OUTPUT_NAME ${GAME_MODULE_BINARY})
|
||||
set_output_dirs( ${GAME_MODULE_BINARY_MISSIONPACK} SUBDIRECTORY ${MISSIONPACK})
|
||||
|
||||
add_library( ${UI_MODULE_BINARY_MISSIONPACK} SHARED ${UI_SOURCES_MISSIONPACK} ${UI_BINARY_SOURCES})
|
||||
target_compile_definitions( ${UI_MODULE_BINARY_MISSIONPACK} PRIVATE UI MISSIONPACK)
|
||||
target_link_libraries( ${UI_MODULE_BINARY_MISSIONPACK} PRIVATE ${COMMON_LIBRARIES})
|
||||
set_target_properties( ${UI_MODULE_BINARY_MISSIONPACK} PROPERTIES OUTPUT_NAME ${UI_MODULE_BINARY})
|
||||
set_output_dirs( ${UI_MODULE_BINARY_MISSIONPACK} SUBDIRECTORY ${MISSIONPACK})
|
||||
endif()
|
||||
|
||||
if(BUILD_GAME_QVMS)
|
||||
set(CGAME_MODULE_QVM_MISSIONPACK ${CGAME_MODULE}qvm_${MISSIONPACK})
|
||||
set(GAME_MODULE_QVM_MISSIONPACK ${GAME_MODULE}qvm_${MISSIONPACK})
|
||||
set(UI_MODULE_QVM_MISSIONPACK ${UI_MODULE}qvm_${MISSIONPACK})
|
||||
|
||||
add_qvm(${CGAME_MODULE_QVM_MISSIONPACK}
|
||||
DEFINITIONS CGAME MISSIONPACK
|
||||
OUTPUT_NAME ${CGAME_MODULE}
|
||||
OUTPUT_DIRECTORY ${MISSIONPACK}/vm
|
||||
SOURCES ${CGAME_SOURCES_MISSIONPACK} ${CGAME_QVM_SOURCES})
|
||||
|
||||
add_qvm(${GAME_MODULE_QVM_MISSIONPACK}
|
||||
DEFINITIONS QAGAME MISSIONPACK
|
||||
OUTPUT_NAME ${GAME_MODULE}
|
||||
OUTPUT_DIRECTORY ${MISSIONPACK}/vm
|
||||
SOURCES ${GAME_SOURCES_MISSIONPACK} ${GAME_QVM_SOURCES})
|
||||
|
||||
add_qvm(${UI_MODULE_QVM_MISSIONPACK}
|
||||
DEFINITIONS UI MISSIONPACK
|
||||
OUTPUT_NAME ${UI_MODULE}
|
||||
OUTPUT_DIRECTORY ${MISSIONPACK}/vm
|
||||
SOURCES ${UI_SOURCES_MISSIONPACK} ${UI_QVM_SOURCES})
|
||||
endif()
|
||||
@@ -0,0 +1,21 @@
|
||||
include(platforms/android)
|
||||
include(platforms/emscripten)
|
||||
include(platforms/linux)
|
||||
include(platforms/macos)
|
||||
include(platforms/unix)
|
||||
include(platforms/windows)
|
||||
|
||||
if(DEBUG_MEMORY)
|
||||
add_definitions(-D_DEBUG_MEM)
|
||||
endif()
|
||||
|
||||
# By default, put both binaries and shared libraries in the same directory
|
||||
# the game uses internal shared libraries that must be in the same folder as the binaries
|
||||
set(CMAKE_INSTALL_BINDIR ${CMAKE_DEFAULT_INSTALL_RUNTIME_DIR} CACHE PATH "Binary dir")
|
||||
set(CMAKE_INSTALL_LIBDIR ${CMAKE_INSTALL_BINDIR} CACHE PATH "Library dir")
|
||||
|
||||
include(GNUInstallDirs)
|
||||
|
||||
cmake_path(SET INSTALL_BINDIR_FULL NORMALIZE "${CMAKE_INSTALL_BINDIR}/${BIN_INSTALL_SUBDIR}")
|
||||
cmake_path(SET INSTALL_LIBDIR_FULL NORMALIZE "${CMAKE_INSTALL_LIBDIR}/${LIB_INSTALL_SUBDIR}")
|
||||
cmake_path(SET INSTALL_DATADIR_FULL NORMALIZE "${CMAKE_INSTALL_DATADIR}")
|
||||
@@ -0,0 +1,95 @@
|
||||
# Android specific settings.
|
||||
#
|
||||
# Configured with the NDK's android.toolchain.cmake, e.g.
|
||||
#
|
||||
# cmake -B build-android \
|
||||
# -DCMAKE_TOOLCHAIN_FILE=$ANDROID_NDK_HOME/build/cmake/android.toolchain.cmake \
|
||||
# -DANDROID_ABI=arm64-v8a -DANDROID_PLATFORM=android-29
|
||||
#
|
||||
# Nothing here is Quest specific; a phone build works the same way.
|
||||
|
||||
if(NOT ANDROID)
|
||||
return()
|
||||
endif()
|
||||
|
||||
# The renderer choice is left to the top level options, which default to
|
||||
# renderergl1. That is the fixed function renderer this game's art was authored
|
||||
# for, and USE_GL4ES puts the translation layer underneath it that lets it reach
|
||||
# OpenGL ES; see cmake/libraries/gl4es.cmake for why it is worth the layer.
|
||||
#
|
||||
# renderergl2 speaks GLES natively and was the first thing to run here, but it
|
||||
# spends tens of milliseconds of CPU per eye binding GLSL programs for lighting
|
||||
# this content has no maps to feed. It is still reachable with
|
||||
#
|
||||
# -DBUILD_RENDERER_GL1=OFF -DBUILD_RENDERER_GL2=ON -DUSE_GL4ES=OFF
|
||||
#
|
||||
# Nothing may be forced into the cache here: these are declared with option(),
|
||||
# so a `set(... CACHE INTERNAL "")` implies FORCE and would silently overwrite
|
||||
# whatever was asked for on the command line.
|
||||
|
||||
# Android's linker namespaces are particular about where a dlopen'd library
|
||||
# may live. Link the renderer into the client rather than fight them.
|
||||
set(USE_RENDERER_DLOPEN OFF CACHE INTERNAL "")
|
||||
set(USE_OPENAL_DLOPEN OFF CACHE INTERNAL "")
|
||||
|
||||
# The QVM toolchain is not part of an Android build.
|
||||
set(BUILD_GAME_QVMS OFF CACHE INTERNAL "")
|
||||
|
||||
# Only for downloading content off a server; not needed to get the game up.
|
||||
set(USE_HTTP OFF CACHE INTERNAL "")
|
||||
|
||||
# The whole point of the Android build here is the headset.
|
||||
set(USE_OPENXR ON CACHE INTERNAL "")
|
||||
|
||||
# There is no bundled SDL binary for Android; it is built from source.
|
||||
set(USE_INTERNAL_SDL OFF CACHE INTERNAL "")
|
||||
|
||||
# No shell to attach a console to, and no desktop to install into.
|
||||
set(CMAKE_INSTALL_PREFIX ${CMAKE_BINARY_DIR}/install CACHE PATH "" FORCE)
|
||||
|
||||
# Everything the engine prints ends up in logcat.
|
||||
list(APPEND COMMON_LIBRARIES log)
|
||||
|
||||
# Android extracts only lib*.so out of an APK, so everything shipped inside one
|
||||
# needs the prefix - but the top level CMakeLists clears it for the whole
|
||||
# project. Targets bound for the APK opt back in individually with this.
|
||||
set(ANDROID_APK_LIBRARY_PREFIX "lib")
|
||||
|
||||
# Gradle wants every native library for an ABI in one directory, so gather
|
||||
# them there once everything has been declared.
|
||||
list(APPEND POST_CONFIGURE_FUNCTIONS android_stage_apk_libraries)
|
||||
|
||||
function(android_stage_apk_libraries)
|
||||
set(APK_LIB_DIR ${CMAKE_BINARY_DIR}/apk-libs/${ANDROID_ABI})
|
||||
|
||||
# Several of our libraries use the STL, so it is the shared one and has to
|
||||
# be shipped alongside them.
|
||||
set(APK_LIBRARIES ${CMAKE_SYSROOT}/usr/lib/${CMAKE_LIBRARY_ARCHITECTURE}/libc++_shared.so)
|
||||
set(APK_TARGETS)
|
||||
|
||||
foreach(APK_TARGET IN ITEMS ${CLIENT_NAME} SDL2 OpenAL openxr_loader GL ${CGAME_MODULE} ${GAME_MODULE})
|
||||
if(TARGET ${APK_TARGET})
|
||||
list(APPEND APK_TARGETS ${APK_TARGET})
|
||||
list(APPEND APK_LIBRARIES $<TARGET_FILE:${APK_TARGET}>)
|
||||
endif()
|
||||
endforeach()
|
||||
|
||||
if(NOT APK_TARGETS)
|
||||
return()
|
||||
endif()
|
||||
|
||||
add_custom_target(apk-libs ALL
|
||||
COMMAND ${CMAKE_COMMAND} -E make_directory ${APK_LIB_DIR}
|
||||
COMMAND ${CMAKE_COMMAND} -E copy_if_different ${APK_LIBRARIES} ${APK_LIB_DIR}
|
||||
COMMENT "Staging APK libraries in ${APK_LIB_DIR}"
|
||||
VERBATIM)
|
||||
|
||||
add_dependencies(apk-libs ${APK_TARGETS})
|
||||
|
||||
# The APK needs the org.libsdl.app Java classes belonging to the very SDL
|
||||
# the engine was linked against, so the gradle build reads the path from
|
||||
# here rather than guessing.
|
||||
file(WRITE ${CMAKE_BINARY_DIR}/android-build.properties
|
||||
"# Written by the CMake build; consumed by misc/android\n"
|
||||
"sdlJavaDir=${SDL2_JAVA_DIR}\n")
|
||||
endfunction()
|
||||
@@ -0,0 +1,51 @@
|
||||
# Emscripten specific settings
|
||||
|
||||
if(NOT EMSCRIPTEN)
|
||||
return()
|
||||
endif()
|
||||
|
||||
set(CMAKE_EXECUTABLE_SUFFIX ".js")
|
||||
set(CMAKE_SHARED_LIBRARY_SUFFIX ".wasm")
|
||||
|
||||
# Disable options that don't make sense for emscripten
|
||||
set(BUILD_SERVER OFF CACHE INTERNAL "")
|
||||
set(BUILD_RENDERER_GL1 OFF CACHE INTERNAL "")
|
||||
set(USE_RENDERER_DLOPEN OFF CACHE INTERNAL "")
|
||||
set(USE_OPENAL_DLOPEN OFF CACHE INTERNAL "")
|
||||
set(BUILD_GAME_LIBRARIES OFF CACHE INTERNAL "")
|
||||
set(USE_HTTP OFF CACHE INTERNAL "")
|
||||
|
||||
# Disable LTO since the libraries Emscripten provides aren't LTO enabled
|
||||
set(CMAKE_INTERPROCEDURAL_OPTIMIZATION FALSE)
|
||||
|
||||
list(APPEND CLIENT_LINK_OPTIONS
|
||||
-sTOTAL_MEMORY=256MB
|
||||
-sSTACK_SIZE=5MB
|
||||
-sMIN_WEBGL_VERSION=1
|
||||
-sMAX_WEBGL_VERSION=2
|
||||
-sEXPORTED_RUNTIME_METHODS=FS,addRunDependency,removeRunDependency
|
||||
-sEXIT_RUNTIME=1
|
||||
-sEXPORT_ES6
|
||||
-sEXPORT_NAME=${CLIENT_NAME}
|
||||
)
|
||||
|
||||
option(EMSCRIPTEN_PRELOAD_FILE "Preload game files into .data file" OFF)
|
||||
|
||||
if(EMSCRIPTEN_PRELOAD_FILE)
|
||||
if(NOT EXISTS "${CMAKE_SOURCE_DIR}/${BASEGAME}")
|
||||
message(FATAL_ERROR "No files in '${BASEGAME}' directory for emscripten to preload.")
|
||||
endif()
|
||||
list(APPEND CLIENT_LINK_OPTIONS --preload-file "${BASEGAME}")
|
||||
endif()
|
||||
|
||||
list(APPEND POST_CONFIGURE_FUNCTIONS deploy_shell_files)
|
||||
|
||||
function(deploy_shell_files)
|
||||
configure_file(${SOURCE_DIR}/web/client.html.in
|
||||
${CMAKE_BINARY_DIR}/${CMAKE_BUILD_TYPE}/${CLIENT_NAME}.html @ONLY)
|
||||
|
||||
if(NOT EMSCRIPTEN_PRELOAD_FILE)
|
||||
configure_file(${SOURCE_DIR}/web/client-config.json
|
||||
${CMAKE_BINARY_DIR}/${CMAKE_BUILD_TYPE}/${CLIENT_NAME}-config.json COPYONLY)
|
||||
endif()
|
||||
endfunction()
|
||||
@@ -0,0 +1,15 @@
|
||||
# Linux-like specific settings, i.e. including FreeBSD etc.
|
||||
|
||||
if(NOT UNIX OR APPLE OR ANDROID)
|
||||
return()
|
||||
endif()
|
||||
|
||||
list(APPEND CLIENT_DEFINITIONS USE_ICON)
|
||||
list(APPEND RENDERER_DEFINITIONS USE_ICON)
|
||||
|
||||
if(CMAKE_INSTALL_PREFIX_INITIALIZED_TO_DEFAULT)
|
||||
set_property(CACHE CMAKE_INSTALL_PREFIX PROPERTY VALUE /opt/mohaa)
|
||||
endif()
|
||||
|
||||
set(CPACK_GENERATOR "DEB")
|
||||
set(CPACK_PACKAGING_INSTALL_PREFIX ${CMAKE_INSTALL_PREFIX})
|
||||
@@ -0,0 +1,118 @@
|
||||
# macOS specific settings
|
||||
|
||||
if(NOT APPLE)
|
||||
return()
|
||||
endif()
|
||||
|
||||
option(BUILD_MACOS_APP "Deploy as a macOS .app" ON)
|
||||
|
||||
enable_language(OBJC)
|
||||
|
||||
list(APPEND SYSTEM_PLATFORM_SOURCES ${SOURCE_DIR}/sys/sys_osx.m)
|
||||
|
||||
list(APPEND COMMON_LIBRARIES "-framework Cocoa")
|
||||
list(APPEND CLIENT_LIBRARIES "-framework IOKit")
|
||||
list(APPEND RENDERER_LIBRARIES "-framework OpenGL")
|
||||
|
||||
set(CMAKE_OSX_DEPLOYMENT_TARGET 11.0)
|
||||
set(CMAKE_OSX_ARCHITECTURES arm64;x86_64)
|
||||
|
||||
if(BUILD_MACOS_APP)
|
||||
set(CLIENT_EXECUTABLE_OPTIONS MACOSX_BUNDLE)
|
||||
list(APPEND POST_CONFIGURE_FUNCTIONS finish_macos_app)
|
||||
endif()
|
||||
|
||||
function(finish_macos_app)
|
||||
get_filename_component(MACOS_ICON_FILE ${MACOS_ICON_PATH} NAME)
|
||||
|
||||
set(MACOS_APP_BUNDLE_NAME ${CLIENT_NAME})
|
||||
set(MACOS_APP_EXECUTABLE_NAME ${CLIENT_BINARY})
|
||||
set(MACOS_APP_GUI_IDENTIFIER ${MACOS_BUNDLE_ID})
|
||||
set(MACOS_APP_ICON_FILE ${MACOS_ICON_FILE})
|
||||
set(MACOS_APP_SHORT_VERSION_STRING ${PRODUCT_VERSION})
|
||||
set(MACOS_APP_BUNDLE_VERSION ${PRODUCT_VERSION})
|
||||
set(MACOS_APP_DEPLOYMENT_TARGET ${CMAKE_OSX_DEPLOYMENT_TARGET})
|
||||
set(MACOS_APP_COPYRIGHT ${COPYRIGHT})
|
||||
|
||||
if(PROTOCOL_HANDLER_SCHEME)
|
||||
set(MACOS_APP_PLIST_URL_TYPES
|
||||
"<key>CFBundleURLTypes</key>
|
||||
<array>
|
||||
<dict>
|
||||
<key>CFBundleURLName</key>
|
||||
<string>${MACOS_APP_BUNDLE_NAME}</string>
|
||||
<key>CFBundleURLSchemes</key>
|
||||
<array>
|
||||
<string>${PROTOCOL_HANDLER_SCHEME}</string>
|
||||
</array>
|
||||
</dict>
|
||||
</array>")
|
||||
else()
|
||||
set(MACOS_APP_PLIST_URL_TYPES "")
|
||||
endif()
|
||||
|
||||
configure_file(${CMAKE_SOURCE_DIR}/cmake/Info.plist.in
|
||||
${CMAKE_BINARY_DIR}/Info.plist @ONLY)
|
||||
|
||||
set_target_properties(${CLIENT_BINARY} PROPERTIES
|
||||
MACOSX_BUNDLE_INFO_PLIST ${CMAKE_BINARY_DIR}/Info.plist)
|
||||
|
||||
set(RESOURCES_DIR $<TARGET_FILE_DIR:${CLIENT_BINARY}>/../Resources)
|
||||
add_custom_command(TARGET ${CLIENT_BINARY} POST_BUILD
|
||||
COMMAND ${CMAKE_COMMAND} -E make_directory ${RESOURCES_DIR}
|
||||
COMMAND ${CMAKE_COMMAND} -E copy ${MACOS_ICON_PATH} ${RESOURCES_DIR})
|
||||
|
||||
if(USE_RENDERER_DLOPEN)
|
||||
set(MACOS_APP_BINARY_DIR ${CLIENT_BINARY}.app/Contents/MacOS)
|
||||
|
||||
if(BUILD_RENDERER_GL1)
|
||||
set_output_dirs(${RENDERER_GL1_BINARY} SUBDIRECTORY ${MACOS_APP_BINARY_DIR})
|
||||
add_dependencies(${CLIENT_BINARY} ${RENDERER_GL1_BINARY})
|
||||
endif()
|
||||
|
||||
if(BUILD_RENDERER_GL2)
|
||||
set_output_dirs(${RENDERER_GL2_BINARY} SUBDIRECTORY ${MACOS_APP_BINARY_DIR})
|
||||
add_dependencies(${CLIENT_BINARY} ${RENDERER_GL2_BINARY})
|
||||
endif()
|
||||
endif()
|
||||
endfunction()
|
||||
|
||||
if(NOT "$ENV{APPLE_CERTIFICATE_ID}" STREQUAL "")
|
||||
list(APPEND POST_CONFIGURE_FUNCTIONS codesign)
|
||||
|
||||
function(codesign)
|
||||
set(DEV_ID "Developer ID Application")
|
||||
|
||||
get_directory_property(INSTALL_TARGETS DIRECTORY
|
||||
${CMAKE_SOURCE_DIR} BUILDSYSTEM_TARGETS)
|
||||
|
||||
# Code sign everything that will be installed
|
||||
foreach(TARGET IN LISTS INSTALL_TARGETS)
|
||||
get_target_property(DESTINATION ${TARGET} INSTALL_DESTINATION)
|
||||
if(NOT DESTINATION)
|
||||
continue()
|
||||
endif()
|
||||
|
||||
add_custom_command(TARGET ${TARGET} POST_BUILD
|
||||
COMMAND codesign --force --deep --options runtime
|
||||
--entitlements ${CMAKE_SOURCE_DIR}/cmake/entitlements.plist
|
||||
--sign "$ENV{APPLE_CERTIFICATE_ID}"
|
||||
"$<TARGET_FILE:${TARGET}>"
|
||||
COMMENT "Code Signing for macOS: $<TARGET_FILE_BASE_NAME:${TARGET}>")
|
||||
endforeach()
|
||||
endfunction()
|
||||
endif()
|
||||
|
||||
set(CPACK_GENERATOR "DragNDrop")
|
||||
|
||||
set(CPACK_DMG_VOLUME_NAME "${PROJECT_NAME} Installer")
|
||||
set(CPACK_DMG_BACKGROUND_IMAGE "${CMAKE_SOURCE_DIR}/misc/macos/macos-dmg-background.png")
|
||||
set(CPACK_DMG_SUBDIRECTORY "${CLIENT_NAME}")
|
||||
|
||||
configure_file(
|
||||
"${CMAKE_SOURCE_DIR}/misc/macos/macos-dmg-setup.applescript.in"
|
||||
"${CMAKE_BINARY_DIR}/macos-dmg-setup.applescript"
|
||||
@ONLY
|
||||
)
|
||||
|
||||
set(CPACK_DMG_DS_STORE_SETUP_SCRIPT "${CMAKE_BINARY_DIR}/macos-dmg-setup.applescript")
|
||||
@@ -0,0 +1,42 @@
|
||||
# Unix specific settings (this includes macOS and emscripten)
|
||||
|
||||
if(NOT UNIX)
|
||||
return()
|
||||
endif()
|
||||
|
||||
list(APPEND SYSTEM_PLATFORM_SOURCES ${SOURCE_DIR}/sys/sys_unix.c)
|
||||
|
||||
if(ANDROID)
|
||||
# No tty; the console goes to logcat
|
||||
list(APPEND SYSTEM_PLATFORM_SOURCES ${SOURCE_DIR}/sys/con_android.c)
|
||||
elseif(EMSCRIPTEN)
|
||||
list(APPEND SYSTEM_PLATFORM_SOURCES ${SOURCE_DIR}/sys/con_passive.c)
|
||||
else()
|
||||
list(APPEND SYSTEM_PLATFORM_SOURCES ${SOURCE_DIR}/sys/con_tty.c)
|
||||
endif()
|
||||
|
||||
#if(USE_HTTP)
|
||||
# list(APPEND CLIENT_PLATFORM_SOURCES ${SOURCE_DIR}/client/cl_http_curl.c)
|
||||
#endif()
|
||||
|
||||
list(APPEND COMMON_LIBRARIES
|
||||
${CMAKE_DL_LIBS} # Dynamic loader
|
||||
m # Math library
|
||||
)
|
||||
|
||||
if(ANDROID)
|
||||
# bionic has no <execinfo.h>, so the backtrace is walked differently
|
||||
list(APPEND SYSTEM_PLATFORM_SOURCES ${SOURCE_DIR}/sys/new/sys_android_new.c)
|
||||
else()
|
||||
list(APPEND SYSTEM_PLATFORM_SOURCES ${SOURCE_DIR}/sys/new/sys_unix_new.c)
|
||||
endif()
|
||||
|
||||
find_package(Threads)
|
||||
list(APPEND COMMON_LIBRARIES ${CMAKE_DL_LIBS} ${CMAKE_THREAD_LIBS_INIT})
|
||||
|
||||
#
|
||||
# Setup the installation directory
|
||||
#
|
||||
set(CMAKE_DEFAULT_INSTALL_RUNTIME_DIR lib${CMAKE_LIB_SUFFIX})
|
||||
set(BIN_INSTALL_SUBDIR ${CMAKE_PROJECT_NAME})
|
||||
set(LIB_INSTALL_SUBDIR ${CMAKE_PROJECT_NAME})
|
||||
@@ -0,0 +1,73 @@
|
||||
# Windows specific settings
|
||||
|
||||
if(NOT WIN32)
|
||||
return()
|
||||
endif()
|
||||
|
||||
list(APPEND SYSTEM_PLATFORM_SOURCES
|
||||
${SOURCE_DIR}/sys/sys_win32.c
|
||||
${SOURCE_DIR}/sys/win_resource.rc
|
||||
)
|
||||
|
||||
list(APPEND CLIENT_PLATFORM_SOURCES ${SOURCE_DIR}/sys/con_passive.c)
|
||||
list(APPEND SERVER_PLATFORM_SOURCES ${SOURCE_DIR}/sys/con_win32.c)
|
||||
|
||||
|
||||
#if(USE_HTTP)
|
||||
# list(APPEND CLIENT_PLATFORM_SOURCES ${SOURCE_DIR}/client/cl_http_windows.c)
|
||||
# list(APPEND CLIENT_LIBRARIES wininet)
|
||||
#endif()
|
||||
|
||||
list(APPEND COMMON_LIBRARIES
|
||||
ws2_32 # Windows Sockets 2
|
||||
winmm # timeBeginPeriod/timeEndPeriod
|
||||
psapi # EnumProcesses
|
||||
)
|
||||
|
||||
if(MINGW)
|
||||
list(APPEND COMMON_LIBRARIES mingw32)
|
||||
endif()
|
||||
|
||||
list(APPEND CLIENT_DEFINITIONS USE_ICON)
|
||||
|
||||
set_source_files_properties(${SOURCE_DIR}/sys/win_resource.rc
|
||||
PROPERTIES COMPILE_DEFINITIONS WINDOWS_ICON_PATH=${WINDOWS_ICON_PATH})
|
||||
|
||||
if(MSVC)
|
||||
# We have our own manifest, disable auto creation
|
||||
list(APPEND SERVER_LINK_OPTIONS "/MANIFEST:NO")
|
||||
list(APPEND CLIENT_LINK_OPTIONS "/MANIFEST:NO")
|
||||
endif()
|
||||
|
||||
set(CLIENT_EXECUTABLE_OPTIONS WIN32)
|
||||
|
||||
# It's only necessary to set this on Windows; elsewhere
|
||||
# CMAKE_EXECUTABLE_SUFFIX will be empty anyway, or we want
|
||||
# HOST_EXECUTABLE_SUFFIX to be empty for other reasons
|
||||
set(HOST_EXECUTABLE_SUFFIX ${CMAKE_EXECUTABLE_SUFFIX})
|
||||
|
||||
set(CPACK_GENERATOR NSIS)
|
||||
set(CPACK_NSIS_MUI_ICON ${WINDOWS_ICON_PATH})
|
||||
set(CPACK_NSIS_EXECUTABLES_DIRECTORY .)
|
||||
|
||||
#
|
||||
# non-ioq3
|
||||
#
|
||||
|
||||
if(CMAKE_BUILD_TYPE MATCHES Debug|RelWithDebInfo)
|
||||
# Enable the console in debug builds
|
||||
list(REMOVE_ITEM CLIENT_PLATFORM_SOURCES ${SOURCE_DIR}/sys/con_passive.c)
|
||||
list(APPEND CLIENT_PLATFORM_SOURCES ${SOURCE_DIR}/sys/con_win32.c)
|
||||
set(CLIENT_EXECUTABLE_OPTIONS)
|
||||
endif()
|
||||
|
||||
list(APPEND SYSTEM_PLATFORM_SOURCES ${SOURCE_DIR}/sys/new/sys_win32_new.c)
|
||||
list(APPEND COMMON_LIBRARIES dbghelp)
|
||||
|
||||
#
|
||||
# Setup the installation directory
|
||||
#
|
||||
# By default, both DLLs and EXEs are in the same directory
|
||||
set(CMAKE_DEFAULT_INSTALL_RUNTIME_DIR bin)
|
||||
set(BIN_INSTALL_SUBDIR ".")
|
||||
set(LIB_INSTALL_SUBDIR ".")
|
||||
@@ -0,0 +1,3 @@
|
||||
foreach(POST_CONFIGURE_FUNCTION IN LISTS POST_CONFIGURE_FUNCTIONS)
|
||||
cmake_language(CALL ${POST_CONFIGURE_FUNCTION})
|
||||
endforeach()
|
||||
@@ -28,4 +28,8 @@ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
#define GIT_REVISION_DATE_TIME "${GIT_REVISION_DATE_TIME}"
|
||||
#define GIT_REVISION_DATE "${GIT_REVISION_DATE}"
|
||||
#define GIT_REVISION_BUILD_NUMBER ${GIT_REVISION_BUILD_NUMBER}
|
||||
|
||||
#define PRODUCT_VERSION_MAJOR ${PROJECT_VERSION_MAJOR}
|
||||
#define PRODUCT_VERSION_MINOR ${PROJECT_VERSION_MINOR}
|
||||
#define PRODUCT_VERSION_PATCH ${PROJECT_VERSION_PATCH}
|
||||
#define PRODUCT_VERSION_STAGE "${PRODUCT_VERSION_STAGE}"
|
||||
@@ -0,0 +1,42 @@
|
||||
include_guard(GLOBAL)
|
||||
|
||||
set(RENDERER_COMMON_SOURCES
|
||||
${SOURCE_DIR}/renderercommon/tr_font.c
|
||||
${SOURCE_DIR}/renderercommon/tr_image_bmp.c
|
||||
${SOURCE_DIR}/renderercommon/tr_image_jpg.c
|
||||
${SOURCE_DIR}/renderercommon/tr_image_pcx.c
|
||||
${SOURCE_DIR}/renderercommon/tr_image_png.c
|
||||
${SOURCE_DIR}/renderercommon/tr_image_pvr.c
|
||||
${SOURCE_DIR}/renderercommon/tr_image_tga.c
|
||||
${SOURCE_DIR}/renderercommon/tr_noise.c
|
||||
${SOURCE_DIR}/renderercommon/puff.c
|
||||
${SOURCE_DIR}/tiki/tiki_mesh.cpp
|
||||
)
|
||||
|
||||
set(SDL_RENDERER_SOURCES
|
||||
${SOURCE_DIR}/sdl/sdl_gamma.c
|
||||
${SOURCE_DIR}/sdl/sdl_glimp.c
|
||||
)
|
||||
|
||||
set(DYNAMIC_RENDERER_SOURCES
|
||||
${SOURCE_DIR}/renderercommon/tr_subs.c
|
||||
${SOURCE_DIR}/qcommon/q_shared.c
|
||||
${SOURCE_DIR}/qcommon/q_math.c
|
||||
${SOURCE_DIR}/corepp/str.cpp
|
||||
)
|
||||
|
||||
if(USE_FREETYPE)
|
||||
list(APPEND RENDERER_DEFINITIONS BUILD_FREETYPE)
|
||||
endif()
|
||||
|
||||
if(USE_RENDERER_DLOPEN)
|
||||
list(APPEND RENDERER_DEFINITIONS USE_RENDERER_DLOPEN)
|
||||
list(APPEND RENDERER_DEFINITIONS REF_DLL=1)
|
||||
elseif(BUILD_RENDERER_GL1 AND BUILD_RENDERER_GL2)
|
||||
message(FATAL_ERROR "Multiple static renderers enabled; choose one")
|
||||
elseif(NOT BUILD_RENDERER_GL1 AND NOT BUILD_RENDERER_GL2)
|
||||
message(FATAL_ERROR "Zero static renderers enabled; choose one")
|
||||
endif()
|
||||
|
||||
list(APPEND RENDERER_LIBRARIES ${COMMON_LIBRARIES})
|
||||
|
||||
@@ -0,0 +1,71 @@
|
||||
if(NOT BUILD_CLIENT OR NOT BUILD_RENDERER_GL1)
|
||||
return()
|
||||
endif()
|
||||
|
||||
include(utils/set_output_dirs)
|
||||
include(renderer_common)
|
||||
|
||||
set(RENDERER_GL1_SOURCES
|
||||
${SOURCE_DIR}/renderergl1/tr_backend.c
|
||||
${SOURCE_DIR}/renderergl1/tr_bsp.c
|
||||
${SOURCE_DIR}/renderergl1/tr_cmds.c
|
||||
${SOURCE_DIR}/renderergl1/tr_curve.c
|
||||
${SOURCE_DIR}/renderergl1/tr_draw.c
|
||||
${SOURCE_DIR}/renderergl1/tr_flares.c
|
||||
${SOURCE_DIR}/renderergl1/tr_font.cpp
|
||||
${SOURCE_DIR}/renderergl1/tr_ghost.cpp
|
||||
${SOURCE_DIR}/renderergl1/tr_image.c
|
||||
${SOURCE_DIR}/renderergl1/tr_init.c
|
||||
${SOURCE_DIR}/renderergl1/tr_light.c
|
||||
${SOURCE_DIR}/renderergl1/tr_main.c
|
||||
${SOURCE_DIR}/renderergl1/tr_marks_permanent.c
|
||||
${SOURCE_DIR}/renderergl1/tr_marks.c
|
||||
${SOURCE_DIR}/renderergl1/tr_model.cpp
|
||||
${SOURCE_DIR}/renderergl1/tr_scene.c
|
||||
${SOURCE_DIR}/renderergl1/tr_shade_calc.c
|
||||
${SOURCE_DIR}/renderergl1/tr_shade.c
|
||||
${SOURCE_DIR}/renderergl1/tr_shader.c
|
||||
${SOURCE_DIR}/renderergl1/tr_shadows.c
|
||||
${SOURCE_DIR}/renderergl1/tr_sky_portal.cpp
|
||||
${SOURCE_DIR}/renderergl1/tr_sky.c
|
||||
${SOURCE_DIR}/renderergl1/tr_sphere_shade.cpp
|
||||
${SOURCE_DIR}/renderergl1/tr_sprite.c
|
||||
${SOURCE_DIR}/renderergl1/tr_staticmodels.cpp
|
||||
${SOURCE_DIR}/renderergl1/tr_sun_flare.cpp
|
||||
${SOURCE_DIR}/renderergl1/tr_surface.c
|
||||
${SOURCE_DIR}/renderergl1/tr_swipe.cpp
|
||||
${SOURCE_DIR}/renderergl1/tr_terrain.c
|
||||
${SOURCE_DIR}/renderergl1/tr_util.cpp
|
||||
${SOURCE_DIR}/renderergl1/tr_vis.cpp
|
||||
${SOURCE_DIR}/renderergl1/tr_vr.c
|
||||
${SOURCE_DIR}/renderergl1/tr_world.c
|
||||
)
|
||||
|
||||
set(RENDERER_GL1_BASENAME renderer_opengl1)
|
||||
set(RENDERER_GL1_BINARY ${RENDERER_GL1_BASENAME})
|
||||
|
||||
list(APPEND RENDERER_GL1_BINARY_SOURCES
|
||||
${RENDERER_COMMON_SOURCES}
|
||||
${RENDERER_GL1_SOURCES}
|
||||
${SDL_RENDERER_SOURCES}
|
||||
${RENDERER_LIBRARY_SOURCES})
|
||||
|
||||
if(USE_RENDERER_DLOPEN)
|
||||
list(APPEND RENDERER_GL1_BINARY_SOURCES ${DYNAMIC_RENDERER_SOURCES})
|
||||
|
||||
add_library(${RENDERER_GL1_BINARY} SHARED ${RENDERER_GL1_BINARY_SOURCES})
|
||||
|
||||
target_link_libraries( ${RENDERER_GL1_BINARY} PRIVATE ${RENDERER_LIBRARIES})
|
||||
target_include_directories( ${RENDERER_GL1_BINARY} PRIVATE ${RENDERER_INCLUDE_DIRS})
|
||||
target_compile_definitions( ${RENDERER_GL1_BINARY} PRIVATE ${RENDERER_DEFINITIONS})
|
||||
target_compile_options( ${RENDERER_GL1_BINARY} PRIVATE ${RENDERER_COMPILE_OPTIONS})
|
||||
target_link_options( ${RENDERER_GL1_BINARY} PRIVATE ${RENDERER_LINK_OPTIONS})
|
||||
|
||||
set_output_dirs(${RENDERER_GL1_BINARY})
|
||||
|
||||
INSTALL(TARGETS ${RENDERER_GL1_BINARY} DESTINATION ${INSTALL_LIBDIR_FULL})
|
||||
|
||||
if(MSVC)
|
||||
INSTALL(FILES $<TARGET_PDB_FILE:${RENDERER_GL1_BINARY}> DESTINATION ${INSTALL_LIBDIR_FULL} OPTIONAL)
|
||||
endif()
|
||||
endif()
|
||||
@@ -0,0 +1,106 @@
|
||||
if(NOT BUILD_CLIENT OR NOT BUILD_RENDERER_GL2)
|
||||
return()
|
||||
endif()
|
||||
|
||||
include(utils/set_output_dirs)
|
||||
include(renderer_common)
|
||||
|
||||
set(RENDERER_GL2_SOURCES
|
||||
${SOURCE_DIR}/renderergl2/tr_animation.c
|
||||
${SOURCE_DIR}/renderergl2/tr_backend.c
|
||||
${SOURCE_DIR}/renderergl2/tr_bsp.c
|
||||
${SOURCE_DIR}/renderergl2/tr_cmds.c
|
||||
${SOURCE_DIR}/renderergl2/tr_curve.c
|
||||
${SOURCE_DIR}/renderergl2/tr_draw.c
|
||||
${SOURCE_DIR}/renderergl2/tr_dsa.c
|
||||
${SOURCE_DIR}/renderergl2/tr_extramath.c
|
||||
${SOURCE_DIR}/renderergl2/tr_extensions.c
|
||||
${SOURCE_DIR}/renderergl2/tr_fbo.c
|
||||
${SOURCE_DIR}/renderergl2/tr_flares.c
|
||||
${SOURCE_DIR}/renderergl2/tr_font.cpp
|
||||
${SOURCE_DIR}/renderergl2/tr_ghost.cpp
|
||||
${SOURCE_DIR}/renderergl2/tr_glsl.c
|
||||
${SOURCE_DIR}/renderergl2/tr_image.c
|
||||
${SOURCE_DIR}/renderergl2/tr_image_dds.c
|
||||
${SOURCE_DIR}/renderergl2/tr_init.c
|
||||
${SOURCE_DIR}/renderergl2/tr_light.c
|
||||
${SOURCE_DIR}/renderergl2/tr_main.c
|
||||
${SOURCE_DIR}/renderergl2/tr_marks_permanent.c
|
||||
${SOURCE_DIR}/renderergl2/tr_marks.c
|
||||
${SOURCE_DIR}/renderergl2/tr_mesh.c
|
||||
${SOURCE_DIR}/renderergl2/tr_model_iqm.c
|
||||
${SOURCE_DIR}/renderergl2/tr_model.cpp
|
||||
${SOURCE_DIR}/renderergl2/tr_postprocess.c
|
||||
${SOURCE_DIR}/renderergl2/tr_scene.c
|
||||
${SOURCE_DIR}/renderergl2/tr_shade_calc.c
|
||||
${SOURCE_DIR}/renderergl2/tr_shade.c
|
||||
${SOURCE_DIR}/renderergl2/tr_shader.c
|
||||
${SOURCE_DIR}/renderergl2/tr_shadows.c
|
||||
${SOURCE_DIR}/renderergl2/tr_sky_portal.cpp
|
||||
${SOURCE_DIR}/renderergl2/tr_sky.c
|
||||
${SOURCE_DIR}/renderergl2/tr_sphere_shade.cpp
|
||||
${SOURCE_DIR}/renderergl2/tr_sprite.c
|
||||
${SOURCE_DIR}/renderergl2/tr_staticmodels.cpp
|
||||
${SOURCE_DIR}/renderergl2/tr_sun_flare.cpp
|
||||
${SOURCE_DIR}/renderergl2/tr_surface.c
|
||||
${SOURCE_DIR}/renderergl2/tr_swipe.cpp
|
||||
${SOURCE_DIR}/renderergl2/tr_terrain.c
|
||||
${SOURCE_DIR}/renderergl2/tr_util.cpp
|
||||
${SOURCE_DIR}/renderergl2/tr_vbo.c
|
||||
${SOURCE_DIR}/renderergl2/tr_vis.cpp
|
||||
${SOURCE_DIR}/renderergl2/tr_world.c
|
||||
)
|
||||
|
||||
file(GLOB RENDERER_GL2_SHADER_SOURCES ${SOURCE_DIR}/renderergl2/glsl/*.glsl)
|
||||
|
||||
set(SHADERS_DIR ${CMAKE_BINARY_DIR}/shaders.dir)
|
||||
file(MAKE_DIRECTORY ${SHADERS_DIR})
|
||||
|
||||
foreach(SHADER_FILE IN LISTS RENDERER_GL2_SHADER_SOURCES)
|
||||
get_filename_component(SHADER_NAME ${SHADER_FILE} NAME_WE)
|
||||
set(SHADER_C_FILE ${SHADERS_DIR}/${SHADER_NAME}.c)
|
||||
|
||||
string(REPLACE "${CMAKE_BINARY_DIR}/" "" SHADER_C_FILE_COMMENT ${SHADER_C_FILE})
|
||||
|
||||
add_custom_command(
|
||||
OUTPUT ${SHADER_C_FILE}
|
||||
COMMAND ${CMAKE_COMMAND}
|
||||
-DINPUT_FILE=${SHADER_FILE}
|
||||
-DOUTPUT_FILE=${SHADER_C_FILE}
|
||||
-DSHADER_NAME=${SHADER_NAME}
|
||||
-P ${CMAKE_SOURCE_DIR}/cmake/utils/stringify_shader.cmake
|
||||
DEPENDS ${SHADER_FILE}
|
||||
COMMENT "Stringify shader ${SHADER_C_FILE_COMMENT}")
|
||||
|
||||
list(APPEND RENDERER_GL2_SHADER_C_SOURCES ${SHADER_C_FILE})
|
||||
endforeach()
|
||||
|
||||
set(RENDERER_GL2_BASENAME renderer_opengl2)
|
||||
set(RENDERER_GL2_BINARY ${RENDERER_GL2_BASENAME})
|
||||
|
||||
list(APPEND RENDERER_GL2_BINARY_SOURCES
|
||||
${RENDERER_COMMON_SOURCES}
|
||||
${RENDERER_GL2_SOURCES}
|
||||
${RENDERER_GL2_SHADER_C_SOURCES}
|
||||
${SDL_RENDERER_SOURCES}
|
||||
${RENDERER_LIBRARY_SOURCES})
|
||||
|
||||
if(USE_RENDERER_DLOPEN)
|
||||
list(APPEND RENDERER_GL2_BINARY_SOURCES ${DYNAMIC_RENDERER_SOURCES})
|
||||
|
||||
add_library(${RENDERER_GL2_BINARY} SHARED ${RENDERER_GL2_BINARY_SOURCES})
|
||||
|
||||
target_link_libraries( ${RENDERER_GL2_BINARY} PRIVATE ${RENDERER_LIBRARIES})
|
||||
target_include_directories( ${RENDERER_GL2_BINARY} PRIVATE ${RENDERER_INCLUDE_DIRS})
|
||||
target_compile_definitions( ${RENDERER_GL2_BINARY} PRIVATE ${RENDERER_DEFINITIONS})
|
||||
target_compile_options( ${RENDERER_GL2_BINARY} PRIVATE ${RENDERER_COMPILE_OPTIONS})
|
||||
target_link_options( ${RENDERER_GL2_BINARY} PRIVATE ${RENDERER_LINK_OPTIONS})
|
||||
|
||||
set_output_dirs(${RENDERER_GL2_BINARY})
|
||||
|
||||
INSTALL(TARGETS ${RENDERER_GL2_BINARY} DESTINATION ${INSTALL_LIBDIR_FULL})
|
||||
|
||||
if(MSVC)
|
||||
INSTALL(FILES $<TARGET_PDB_FILE:${RENDERER_GL2_BINARY}> DESTINATION ${INSTALL_LIBDIR_FULL} OPTIONAL)
|
||||
endif()
|
||||
endif()
|
||||
@@ -0,0 +1,66 @@
|
||||
|
||||
if(NOT BUILD_SERVER)
|
||||
return()
|
||||
endif()
|
||||
|
||||
include(utils/set_output_dirs)
|
||||
include(shared_sources)
|
||||
include(shared_script)
|
||||
|
||||
set(NULL_SOURCES
|
||||
${SOURCE_DIR}/null/null_client.c
|
||||
${SOURCE_DIR}/null/null_input.c
|
||||
${SOURCE_DIR}/null/null_snddma.c
|
||||
)
|
||||
|
||||
set(SERVER_BINARY ${SERVER_NAME})
|
||||
|
||||
list(APPEND SERVER_DEFINITIONS DEDICATED)
|
||||
list(APPEND SERVER_DEFINITIONS BOTLIB)
|
||||
list(APPEND SERVER_DEFINITIONS APP_MODULE)
|
||||
|
||||
if(BUILD_STANDALONE)
|
||||
list(APPEND SERVER_DEFINITIONS STANDALONE)
|
||||
endif()
|
||||
|
||||
if(USE_VOIP)
|
||||
list(APPEND SERVER_DEFINITIONS USE_VOIP)
|
||||
endif()
|
||||
|
||||
if(USE_HTTP)
|
||||
list(APPEND SERVER_DEFINITIONS USE_HTTP)
|
||||
endif()
|
||||
|
||||
list(APPEND SERVER_BINARY_SOURCES
|
||||
${SERVER_SOURCES}
|
||||
${NULL_SOURCES}
|
||||
${COMMON_SOURCES}
|
||||
${SCRIPT_SYSTEM_SOURCES}
|
||||
${BOTLIB_SOURCES}
|
||||
${SYSTEM_SOURCES}
|
||||
${ASM_SOURCES}
|
||||
${SERVER_PLATFORM_SOURCES}
|
||||
${SERVER_LIBRARY_SOURCES})
|
||||
|
||||
add_executable(${SERVER_BINARY} ${SERVER_EXECUTABLE_OPTIONS} ${SERVER_BINARY_SOURCES})
|
||||
|
||||
target_include_directories( ${SERVER_BINARY} PRIVATE ${SERVER_INCLUDE_DIRS})
|
||||
target_compile_definitions( ${SERVER_BINARY} PRIVATE ${SERVER_DEFINITIONS})
|
||||
target_compile_options( ${SERVER_BINARY} PRIVATE ${SERVER_COMPILE_OPTIONS})
|
||||
target_link_libraries( ${SERVER_BINARY} PRIVATE ${COMMON_LIBRARIES} ${SERVER_LIBRARIES})
|
||||
target_link_options( ${SERVER_BINARY} PRIVATE ${SERVER_LINK_OPTIONS})
|
||||
|
||||
set_output_dirs(${SERVER_BINARY})
|
||||
|
||||
if(POST_SERVER_CONFIGURE_FUNCTION)
|
||||
cmake_language(CALL ${POST_SERVER_CONFIGURE_FUNCTION})
|
||||
endif()
|
||||
|
||||
set_target_properties(${SERVER_BINARY} PROPERTIES DEBUG_POSTFIX ${CMAKE_DEBUG_POSTFIX})
|
||||
|
||||
INSTALL(TARGETS ${SERVER_BINARY} DESTINATION ${INSTALL_BINDIR_FULL})
|
||||
|
||||
if (MSVC)
|
||||
target_link_options(${SERVER_BINARY} PRIVATE "/MANIFEST:NO")
|
||||
INSTALL(FILES $<TARGET_PDB_FILE:${SERVER_BINARY}> DESTINATION ${INSTALL_BINDIR_FULL} OPTIONAL)
|
||||
endif()
|
||||
@@ -0,0 +1,17 @@
|
||||
include_guard(GLOBAL)
|
||||
|
||||
set(SCRIPT_SYSTEM_SOURCES
|
||||
${SOURCE_DIR}/corepp/class.cpp
|
||||
${SOURCE_DIR}/corepp/con_set.cpp
|
||||
${SOURCE_DIR}/corepp/con_timer.cpp
|
||||
${SOURCE_DIR}/corepp/delegate.cpp
|
||||
${SOURCE_DIR}/corepp/lightclass.cpp
|
||||
${SOURCE_DIR}/corepp/listener.cpp
|
||||
${SOURCE_DIR}/corepp/lz77.cpp
|
||||
${SOURCE_DIR}/corepp/mem_blockalloc.cpp
|
||||
${SOURCE_DIR}/corepp/mem_tempalloc.cpp
|
||||
${SOURCE_DIR}/corepp/script.cpp
|
||||
${SOURCE_DIR}/corepp/str.cpp
|
||||
${SOURCE_DIR}/script/scriptexception.cpp
|
||||
${SOURCE_DIR}/script/scriptvariable.cpp
|
||||
)
|
||||
@@ -0,0 +1,106 @@
|
||||
include_guard(GLOBAL)
|
||||
|
||||
include(utils/add_git_dependency)
|
||||
include(utils/disable_warnings)
|
||||
include(gamespy)
|
||||
|
||||
set(COMMON_SOURCES
|
||||
${SOURCE_DIR}/qcommon/alias.c
|
||||
${SOURCE_DIR}/qcommon/bg_compat.cpp
|
||||
${SOURCE_DIR}/qcommon/cm_fencemask.c
|
||||
${SOURCE_DIR}/qcommon/cm_load.c
|
||||
${SOURCE_DIR}/qcommon/cm_patch.c
|
||||
${SOURCE_DIR}/qcommon/cm_polylib.c
|
||||
${SOURCE_DIR}/qcommon/cm_terrain.c
|
||||
${SOURCE_DIR}/qcommon/cm_test.c
|
||||
${SOURCE_DIR}/qcommon/cm_trace.c
|
||||
${SOURCE_DIR}/qcommon/cm_trace_lbd.cpp
|
||||
${SOURCE_DIR}/qcommon/cm_trace_obfuscation.cpp
|
||||
${SOURCE_DIR}/qcommon/cmd.c
|
||||
${SOURCE_DIR}/qcommon/common.c
|
||||
${SOURCE_DIR}/qcommon/crc.c
|
||||
${SOURCE_DIR}/qcommon/cvar.c
|
||||
${SOURCE_DIR}/qcommon/files.cpp
|
||||
${SOURCE_DIR}/qcommon/ioapi.c
|
||||
${SOURCE_DIR}/qcommon/huffman.cpp
|
||||
${SOURCE_DIR}/qcommon/md4.c
|
||||
${SOURCE_DIR}/qcommon/md5.c
|
||||
${SOURCE_DIR}/qcommon/memory.c
|
||||
${SOURCE_DIR}/qcommon/msg.cpp
|
||||
${SOURCE_DIR}/qcommon/net_chan.c
|
||||
${SOURCE_DIR}/qcommon/net_ip.c
|
||||
${SOURCE_DIR}/qcommon/q_math.c
|
||||
${SOURCE_DIR}/qcommon/q_shared.c
|
||||
${SOURCE_DIR}/qcommon/unzip.c
|
||||
${SOURCE_DIR}/gamespy/q_gamespy.c
|
||||
)
|
||||
|
||||
disable_warnings(
|
||||
${SOURCE_DIR}/qcommon/unzip.c
|
||||
${SOURCE_DIR}/qcommon/ioapi.c
|
||||
)
|
||||
|
||||
add_git_dependency(${SOURCE_DIR}/qcommon/common.c)
|
||||
|
||||
set(SYSTEM_SOURCES
|
||||
${SOURCE_DIR}/sys/con_log.c
|
||||
${SOURCE_DIR}/sys/sys_autoupdater.c
|
||||
${SOURCE_DIR}/sys/sys_main.c
|
||||
${SYSTEM_PLATFORM_SOURCES}
|
||||
)
|
||||
|
||||
set(SERVER_SOURCES
|
||||
${SOURCE_DIR}/server/sv_client.c
|
||||
${SOURCE_DIR}/server/sv_ccmds.c
|
||||
${SOURCE_DIR}/server/sv_game.c
|
||||
${SOURCE_DIR}/server/sv_init.c
|
||||
${SOURCE_DIR}/server/sv_main.c
|
||||
${SOURCE_DIR}/server/sv_net_chan.c
|
||||
${SOURCE_DIR}/server/sv_snapshot.c
|
||||
${SOURCE_DIR}/server/sv_snd.c
|
||||
${SOURCE_DIR}/server/sv_world.c
|
||||
)
|
||||
|
||||
list(APPEND SYSTEM_SOURCES
|
||||
${SOURCE_DIR}/sys/new/sys_main_new.c
|
||||
${SOURCE_DIR}/sys/win_bounds.cpp
|
||||
${SOURCE_DIR}/sys/win_localization.cpp
|
||||
${SOURCE_DIR}/sys/sys_curl.c
|
||||
${SOURCE_DIR}/sys/sys_update_checker.cpp
|
||||
)
|
||||
|
||||
# Append TIKI sources
|
||||
|
||||
list(APPEND COMMON_SOURCES
|
||||
${SOURCE_DIR}/skeletor/bonetable.cpp
|
||||
${SOURCE_DIR}/skeletor/skeletor_imports.cpp
|
||||
${SOURCE_DIR}/skeletor/skeletor_loadanimation.cpp
|
||||
${SOURCE_DIR}/skeletor/skeletor_model_files.cpp
|
||||
${SOURCE_DIR}/skeletor/skeletor_utilities.cpp
|
||||
${SOURCE_DIR}/skeletor/skeletor.cpp
|
||||
${SOURCE_DIR}/skeletor/skeletorbones.cpp
|
||||
${SOURCE_DIR}/skeletor/tokenizer.cpp
|
||||
${SOURCE_DIR}/tiki/tiki_anim.cpp
|
||||
${SOURCE_DIR}/tiki/tiki_cache.cpp
|
||||
${SOURCE_DIR}/tiki/tiki_commands.cpp
|
||||
${SOURCE_DIR}/tiki/tiki_files.cpp
|
||||
${SOURCE_DIR}/tiki/tiki_frame.cpp
|
||||
${SOURCE_DIR}/tiki/tiki_imports.cpp
|
||||
${SOURCE_DIR}/tiki/tiki_parse.cpp
|
||||
${SOURCE_DIR}/tiki/tiki_skel.cpp
|
||||
${SOURCE_DIR}/tiki/tiki_surface.cpp
|
||||
${SOURCE_DIR}/tiki/tiki_tag.cpp
|
||||
${SOURCE_DIR}/tiki/tiki_utility.cpp
|
||||
${SOURCE_DIR}/corepp/tiki_main.cpp
|
||||
${SOURCE_DIR}/corepp/tiki_script.cpp
|
||||
)
|
||||
|
||||
# Gamespy
|
||||
|
||||
list(APPEND SERVER_SOURCES
|
||||
${SOURCE_DIR}/gamespy/sv_gamespy.c
|
||||
${SOURCE_DIR}/gamespy/sv_gqueryreporting.c
|
||||
)
|
||||
|
||||
include_directories(${SOURCE_DIR}/qcommon)
|
||||
include_directories(${SOURCE_DIR}/script)
|
||||
@@ -0,0 +1,3 @@
|
||||
enable_testing()
|
||||
|
||||
include(tests/lz77)
|
||||
@@ -0,0 +1,14 @@
|
||||
#
|
||||
# Unit tests
|
||||
#
|
||||
|
||||
add_executable(test_lz77
|
||||
${SOURCE_DIR}/corepp/tests/test_lz77.cpp
|
||||
${SOURCE_DIR}/corepp/lz77.cpp
|
||||
${SOURCE_DIR}/qcommon/q_shared.c
|
||||
${SOURCE_DIR}/qcommon/common_light.c
|
||||
)
|
||||
|
||||
target_link_libraries(test_lz77 INTERFACE testing)
|
||||
add_test(NAME test_lz77 COMMAND test_lz77)
|
||||
set_tests_properties(test_lz77 PROPERTIES TIMEOUT 15)
|
||||
@@ -0,0 +1,93 @@
|
||||
cmake_minimum_required(VERSION ${CMAKE_MINIMUM_REQUIRED_VERSION})
|
||||
project(qvm_tools LANGUAGES C)
|
||||
|
||||
include(utils/set_output_dirs)
|
||||
|
||||
set(Q3ASM_SOURCES
|
||||
${SOURCE_DIR}/tools/asm/q3asm.c
|
||||
${SOURCE_DIR}/tools/asm/cmdlib.c
|
||||
)
|
||||
|
||||
set(Q3LCC_SOURCES
|
||||
${SOURCE_DIR}/tools/lcc/etc/lcc.c
|
||||
${SOURCE_DIR}/tools/lcc/etc/bytecode.c
|
||||
)
|
||||
|
||||
set(Q3RCC_SOURCES
|
||||
${SOURCE_DIR}/tools/lcc/src/alloc.c
|
||||
${SOURCE_DIR}/tools/lcc/src/bind.c
|
||||
${SOURCE_DIR}/tools/lcc/src/bytecode.c
|
||||
${SOURCE_DIR}/tools/lcc/src/dag.c
|
||||
${SOURCE_DIR}/tools/lcc/src/decl.c
|
||||
${SOURCE_DIR}/tools/lcc/src/enode.c
|
||||
${SOURCE_DIR}/tools/lcc/src/error.c
|
||||
${SOURCE_DIR}/tools/lcc/src/event.c
|
||||
${SOURCE_DIR}/tools/lcc/src/expr.c
|
||||
${SOURCE_DIR}/tools/lcc/src/gen.c
|
||||
${SOURCE_DIR}/tools/lcc/src/init.c
|
||||
${SOURCE_DIR}/tools/lcc/src/inits.c
|
||||
${SOURCE_DIR}/tools/lcc/src/input.c
|
||||
${SOURCE_DIR}/tools/lcc/src/lex.c
|
||||
${SOURCE_DIR}/tools/lcc/src/list.c
|
||||
${SOURCE_DIR}/tools/lcc/src/main.c
|
||||
${SOURCE_DIR}/tools/lcc/src/null.c
|
||||
${SOURCE_DIR}/tools/lcc/src/output.c
|
||||
${SOURCE_DIR}/tools/lcc/src/prof.c
|
||||
${SOURCE_DIR}/tools/lcc/src/profio.c
|
||||
${SOURCE_DIR}/tools/lcc/src/simp.c
|
||||
${SOURCE_DIR}/tools/lcc/src/stmt.c
|
||||
${SOURCE_DIR}/tools/lcc/src/string.c
|
||||
${SOURCE_DIR}/tools/lcc/src/sym.c
|
||||
${SOURCE_DIR}/tools/lcc/src/symbolic.c
|
||||
${SOURCE_DIR}/tools/lcc/src/trace.c
|
||||
${SOURCE_DIR}/tools/lcc/src/tree.c
|
||||
${SOURCE_DIR}/tools/lcc/src/types.c
|
||||
)
|
||||
|
||||
set(Q3RCC_DAGCHECK_SOURCE ${SOURCE_DIR}/tools/lcc/src/dagcheck.md)
|
||||
|
||||
set(Q3CPP_SOURCES
|
||||
${SOURCE_DIR}/tools/lcc/cpp/cpp.c
|
||||
${SOURCE_DIR}/tools/lcc/cpp/lex.c
|
||||
${SOURCE_DIR}/tools/lcc/cpp/nlist.c
|
||||
${SOURCE_DIR}/tools/lcc/cpp/tokens.c
|
||||
${SOURCE_DIR}/tools/lcc/cpp/macro.c
|
||||
${SOURCE_DIR}/tools/lcc/cpp/eval.c
|
||||
${SOURCE_DIR}/tools/lcc/cpp/include.c
|
||||
${SOURCE_DIR}/tools/lcc/cpp/hideset.c
|
||||
${SOURCE_DIR}/tools/lcc/cpp/getopt.c
|
||||
${SOURCE_DIR}/tools/lcc/cpp/unix.c
|
||||
)
|
||||
|
||||
set(LBURG_SOURCES
|
||||
${SOURCE_DIR}/tools/lcc/lburg/lburg.c
|
||||
${SOURCE_DIR}/tools/lcc/lburg/gram.c
|
||||
)
|
||||
|
||||
add_executable(q3asm ${Q3ASM_SOURCES})
|
||||
set_output_dirs(q3asm)
|
||||
add_executable(q3lcc ${Q3LCC_SOURCES})
|
||||
set_output_dirs(q3lcc)
|
||||
add_dependencies(q3lcc q3rcc q3cpp)
|
||||
|
||||
if(CMAKE_C_COMPILER_ID STREQUAL "GNU" OR CMAKE_C_COMPILER_ID MATCHES "^(Apple)?Clang$")
|
||||
add_compile_options(-fno-strict-aliasing -Wno-unused-result
|
||||
-Wno-pointer-to-int-cast -Wno-int-to-pointer-cast)
|
||||
elseif(CMAKE_C_COMPILER_ID STREQUAL "MSVC")
|
||||
add_compile_options(/wd4311 /wd4312)
|
||||
endif()
|
||||
|
||||
add_executable(lburg ${LBURG_SOURCES})
|
||||
set_output_dirs(lburg)
|
||||
set(DAGCHECK_C ${CMAKE_BINARY_DIR}/dagcheck.c)
|
||||
add_custom_command(
|
||||
OUTPUT ${DAGCHECK_C}
|
||||
COMMAND lburg ${Q3RCC_DAGCHECK_SOURCE} ${DAGCHECK_C}
|
||||
DEPENDS lburg ${Q3RCC_DAGCHECK_SOURCE})
|
||||
|
||||
add_executable(q3rcc ${Q3RCC_SOURCES} ${DAGCHECK_C})
|
||||
set_output_dirs(q3rcc)
|
||||
target_include_directories(q3rcc PRIVATE ${SOURCE_DIR}/tools/lcc/src)
|
||||
|
||||
add_executable(q3cpp ${Q3CPP_SOURCES})
|
||||
set_output_dirs(q3cpp)
|
||||
@@ -0,0 +1,38 @@
|
||||
include_guard(GLOBAL)
|
||||
|
||||
function(add_git_dependency SOURCE_FILE)
|
||||
set(GIT_DIR ${CMAKE_SOURCE_DIR}/.git)
|
||||
if(NOT EXISTS ${GIT_DIR})
|
||||
return()
|
||||
endif()
|
||||
|
||||
# If we're a submodule, .git won't be a directory
|
||||
if(NOT IS_DIRECTORY ${GIT_DIR})
|
||||
file(READ ${GIT_DIR} GIT_FILE_CONTENT)
|
||||
string(REGEX MATCH "gitdir: (.+)" MATCHED_PATH ${GIT_FILE_CONTENT})
|
||||
if(NOT MATCHED_PATH)
|
||||
return()
|
||||
endif()
|
||||
|
||||
string(STRIP ${CMAKE_MATCH_1} GIT_DIR)
|
||||
endif()
|
||||
|
||||
set(GIT_FILES)
|
||||
list(APPEND GIT_FILES ${GIT_DIR}/HEAD)
|
||||
list(APPEND GIT_FILES ${GIT_DIR}/packed-refs)
|
||||
|
||||
file(READ ${GIT_DIR}/HEAD GIT_HEAD)
|
||||
string(REGEX MATCH "^ref: (.+)$" HAVE_REF ${GIT_HEAD})
|
||||
if(HAVE_REF)
|
||||
set(GIT_REF_PATH ${CMAKE_MATCH_1})
|
||||
string(STRIP ${GIT_REF_PATH} GIT_REF_PATH)
|
||||
list(APPEND GIT_FILES ${GIT_DIR}/${GIT_REF_PATH})
|
||||
endif()
|
||||
|
||||
foreach(GIT_FILE IN LISTS GIT_FILES)
|
||||
if(EXISTS ${GIT_FILE})
|
||||
set_source_files_properties(${SOURCE_FILE}
|
||||
PROPERTIES OBJECT_DEPENDS ${GIT_FILE})
|
||||
endif()
|
||||
endforeach()
|
||||
endfunction()
|
||||
@@ -0,0 +1,20 @@
|
||||
include_guard(GLOBAL)
|
||||
|
||||
set(DETECT_ARCH_C ${CMAKE_BINARY_DIR}/detect_arch.c)
|
||||
|
||||
file(WRITE ${DETECT_ARCH_C}
|
||||
"#include \"${SOURCE_DIR}/qcommon/q_platform.h\"
|
||||
#pragma message(\"@\" ARCH_STRING \"@\")
|
||||
int main(void) { return 0; }
|
||||
")
|
||||
|
||||
try_compile(COMPILE_SUCCESS
|
||||
SOURCES ${DETECT_ARCH_C}
|
||||
OUTPUT_VARIABLE COMPILE_OUTPUT)
|
||||
|
||||
string(REGEX MATCH "^[^\@]+@([a-zA-Z0-9_]+)@.*$" HAVE_MATCH ${COMPILE_OUTPUT})
|
||||
set(ARCH ${CMAKE_MATCH_1})
|
||||
|
||||
if(NOT COMPILE_SUCCESS OR NOT HAVE_MATCH OR NOT ARCH)
|
||||
message(FATAL_ERROR "Architecture detection failed: ${COMPILE_OUTPUT}")
|
||||
endif()
|
||||
@@ -0,0 +1,17 @@
|
||||
include_guard(GLOBAL)
|
||||
|
||||
function(disable_warnings)
|
||||
set(SOURCES ${ARGN})
|
||||
|
||||
foreach(FILE IN LISTS SOURCES)
|
||||
if(MSVC)
|
||||
# Annoyingly if you disable all warnings (/w) in combination with enabling
|
||||
# some warnings, which we and/or CMake inevitably do, this causes a
|
||||
# meta-warning D9025, so instead we have to individually disable them:
|
||||
set_source_files_properties(${FILE} PROPERTIES COMPILE_FLAGS
|
||||
"/wd4131 /wd4245 /wd4100 /wd4127 /wd4244 /wd4310 /wd4457 /wd4456 /wd4701 /wd4305 /wd4189 /wd4232")
|
||||
else()
|
||||
set_source_files_properties(${FILE} PROPERTIES COMPILE_FLAGS -w)
|
||||
endif()
|
||||
endforeach()
|
||||
endfunction()
|
||||
@@ -0,0 +1,15 @@
|
||||
include_guard(GLOBAL)
|
||||
|
||||
function(find_include_dirs OUT_VAR LIBRARY_DIR)
|
||||
# Recursively find directories that contain .h files under LIBRARY_DIR
|
||||
file(GLOB_RECURSE HEADER_FILES ${LIBRARY_DIR}/*.h)
|
||||
set(INCLUDE_DIRS "")
|
||||
foreach(HEADER_FILE IN LISTS HEADER_FILES)
|
||||
get_filename_component(HEADER_DIR ${HEADER_FILE} DIRECTORY)
|
||||
list(APPEND INCLUDE_DIRS ${HEADER_DIR})
|
||||
endforeach()
|
||||
|
||||
list(REMOVE_DUPLICATES INCLUDE_DIRS)
|
||||
|
||||
set(${OUT_VAR} ${INCLUDE_DIRS} PARENT_SCOPE)
|
||||
endfunction()
|
||||
@@ -0,0 +1,91 @@
|
||||
include_guard(GLOBAL)
|
||||
|
||||
if(NOT BUILD_GAME_QVMS)
|
||||
return()
|
||||
endif()
|
||||
|
||||
include(ExternalProject)
|
||||
|
||||
set(TOOLS_DIR ${CMAKE_BINARY_DIR}/tools)
|
||||
|
||||
if(CMAKE_BUILD_TYPE)
|
||||
set(BUILD_TYPE_ARG -DCMAKE_BUILD_TYPE=${CMAKE_BUILD_TYPE})
|
||||
endif()
|
||||
|
||||
set(Q3RCC ${TOOLS_DIR}/$<CONFIG>/q3rcc${HOST_EXECUTABLE_SUFFIX})
|
||||
set(Q3CPP ${TOOLS_DIR}/$<CONFIG>/q3cpp${HOST_EXECUTABLE_SUFFIX})
|
||||
set(Q3LCC ${TOOLS_DIR}/$<CONFIG>/q3lcc${HOST_EXECUTABLE_SUFFIX})
|
||||
set(Q3ASM ${TOOLS_DIR}/$<CONFIG>/q3asm${HOST_EXECUTABLE_SUFFIX})
|
||||
|
||||
ExternalProject_Add(qvm_tools
|
||||
SOURCE_DIR ${CMAKE_SOURCE_DIR}/cmake/tools
|
||||
BINARY_DIR ${TOOLS_DIR}
|
||||
CMAKE_ARGS
|
||||
-DSOURCE_DIR=${SOURCE_DIR}
|
||||
-DCMAKE_MODULE_PATH=${CMAKE_MODULE_PATH}
|
||||
-DCMAKE_MINIMUM_REQUIRED_VERSION=${CMAKE_MINIMUM_REQUIRED_VERSION}
|
||||
${BUILD_TYPE_ARG}
|
||||
BUILD_ALWAYS TRUE
|
||||
BUILD_BYPRODUCTS ${Q3RCC} ${Q3CPP} ${Q3LCC} ${Q3ASM}
|
||||
INSTALL_COMMAND "")
|
||||
|
||||
function(add_qvm MODULE_NAME)
|
||||
list(REMOVE_AT ARGV 0)
|
||||
cmake_parse_arguments(ARG "" "" "DEFINITIONS;OUTPUT_NAME;OUTPUT_DIRECTORY;SOURCES" ${ARGV})
|
||||
|
||||
set(QVM_OUTPUT_DIR ${CMAKE_BINARY_DIR}/$<CONFIG>)
|
||||
if(ARG_OUTPUT_DIRECTORY)
|
||||
set(QVM_OUTPUT_DIR ${QVM_OUTPUT_DIR}/${ARG_OUTPUT_DIRECTORY})
|
||||
endif()
|
||||
add_custom_command(
|
||||
OUTPUT ${QVM_OUTPUT_DIR}
|
||||
COMMAND ${CMAKE_COMMAND} -E make_directory ${QVM_OUTPUT_DIR})
|
||||
|
||||
if(ARG_OUTPUT_NAME)
|
||||
set(QVM_FILE ${QVM_OUTPUT_DIR}/${ARG_OUTPUT_NAME}.qvm)
|
||||
else()
|
||||
set(QVM_FILE ${QVM_OUTPUT_DIR}/${MODULE_NAME}.qvm)
|
||||
endif()
|
||||
|
||||
set(QVM_ASM_DIR ${CMAKE_BINARY_DIR}/qvm.dir/${MODULE_NAME})
|
||||
file(MAKE_DIRECTORY ${QVM_ASM_DIR})
|
||||
|
||||
set(LCC_FLAGS "")
|
||||
foreach(DEFINITION IN LISTS ARG_DEFINITIONS)
|
||||
list(APPEND LCC_FLAGS "-D${DEFINITION}")
|
||||
endforeach()
|
||||
|
||||
set(ASM_FILES "")
|
||||
foreach(SOURCE ${ARG_SOURCES})
|
||||
if(${SOURCE} MATCHES "\\.asm$")
|
||||
list(APPEND ASM_FILES ${SOURCE})
|
||||
continue()
|
||||
endif()
|
||||
|
||||
get_filename_component(BASE_FILE ${SOURCE} NAME_WE)
|
||||
set(ASM_FILE ${QVM_ASM_DIR}/${BASE_FILE}.asm)
|
||||
string(REPLACE "${CMAKE_BINARY_DIR}/" "" ASM_FILE_COMMENT ${ASM_FILE})
|
||||
|
||||
add_custom_command(
|
||||
OUTPUT ${ASM_FILE}
|
||||
COMMAND ${Q3LCC} ${LCC_FLAGS} -o ${ASM_FILE} ${SOURCE}
|
||||
DEPENDS ${SOURCE} qvm_tools ${Q3RCC} ${Q3CPP} ${Q3LCC}
|
||||
COMMENT "Building C object ${ASM_FILE_COMMENT}")
|
||||
|
||||
list(APPEND ASM_FILES ${ASM_FILE})
|
||||
endforeach()
|
||||
|
||||
string(REPLACE "${CMAKE_BINARY_DIR}/" "" QVM_FILE_COMMENT ${QVM_FILE})
|
||||
add_custom_command(
|
||||
OUTPUT ${QVM_FILE}
|
||||
COMMAND ${Q3ASM} -o ${QVM_FILE} ${ASM_FILES}
|
||||
DEPENDS ${ASM_FILES} qvm_tools ${Q3ASM}
|
||||
COMMENT "Linking C QVM library ${QVM_FILE_COMMENT}")
|
||||
|
||||
string(REGEX REPLACE "[^A-Za-z0-9]" "_" TARGET_NAME ${MODULE_NAME})
|
||||
add_custom_target(${TARGET_NAME} ALL DEPENDS ${QVM_FILE})
|
||||
|
||||
if(ARG_OUTPUT_DIRECTORY)
|
||||
install(FILES ${QVM_FILE} DESTINATION ${ARG_OUTPUT_DIRECTORY})
|
||||
endif()
|
||||
endfunction()
|
||||
@@ -0,0 +1,26 @@
|
||||
include_guard(GLOBAL)
|
||||
|
||||
function(set_output_dirs TARGET)
|
||||
list(REMOVE_AT ARGV 0)
|
||||
cmake_parse_arguments(ARG "" "" "SUBDIRECTORY" ${ARGV})
|
||||
|
||||
if(CMAKE_CONFIGURATION_TYPES) # Multi-config
|
||||
set(CONFIGS ${CMAKE_CONFIGURATION_TYPES})
|
||||
else() # Single-config
|
||||
set(CONFIGS ${CMAKE_BUILD_TYPE})
|
||||
endif()
|
||||
|
||||
foreach(CONFIG ${CONFIGS})
|
||||
string(TOUPPER ${CONFIG} CONFIG_UPPER)
|
||||
|
||||
set(OUT_DIR ${CMAKE_BINARY_DIR}/${CONFIG}/${ARG_SUBDIRECTORY})
|
||||
|
||||
set_target_properties(${TARGET} PROPERTIES
|
||||
LIBRARY_OUTPUT_DIRECTORY_${CONFIG_UPPER} ${OUT_DIR}
|
||||
RUNTIME_OUTPUT_DIRECTORY_${CONFIG_UPPER} ${OUT_DIR}
|
||||
ARCHIVE_OUTPUT_DIRECTORY_${CONFIG_UPPER} ${OUT_DIR})
|
||||
endforeach()
|
||||
|
||||
set_target_properties(${TARGET} PROPERTIES
|
||||
INSTALL_DESTINATION ./${ARG_SUBDIRECTORY})
|
||||
endfunction()
|
||||
@@ -0,0 +1,13 @@
|
||||
# Convert a shader file to a compilable C file
|
||||
|
||||
# INPUT_FILE, OUTPUT_FILE, SHADER_NAME must be set via -D
|
||||
|
||||
file(READ ${INPUT_FILE} CONTENTS)
|
||||
|
||||
string(REPLACE "\\" "\\\\" CONTENTS "${CONTENTS}") # Escape backslashes
|
||||
string(REPLACE "\"" "\\\"" CONTENTS "${CONTENTS}") # Escape double quotes
|
||||
string(REPLACE "\n" "\\n\"\n\"" CONTENTS "${CONTENTS}") # Escape newlines
|
||||
|
||||
set(OUTPUT_CONTENT "const char *fallbackShader_${SHADER_NAME} =\n\"${CONTENTS}\";\n")
|
||||
|
||||
file(WRITE ${OUTPUT_FILE} "${OUTPUT_CONTENT}")
|
||||
@@ -1,5 +1,3 @@
|
||||
add_library(qcommon_version INTERFACE)
|
||||
|
||||
execute_process(
|
||||
COMMAND git rev-parse --is-inside-work-tree
|
||||
WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
|
||||
@@ -64,5 +62,8 @@ message(VERBOSE "Git revision date: ${GIT_REVISION_DATE}")
|
||||
message(VERBOSE "Git revision build: ${GIT_REVISION_BUILD_NUMBER}")
|
||||
message(VERBOSE "Stage: ${PRODUCT_VERSION_STAGE}")
|
||||
|
||||
configure_file("q_version.generated.h.in" "generated/q_version.generated.h")
|
||||
target_include_directories(qcommon_version INTERFACE "${CMAKE_CURRENT_BINARY_DIR}/generated")
|
||||
configure_file("cmake/q_version.generated.h.in" "${CMAKE_CURRENT_BINARY_DIR}/generated/q_version.generated.h")
|
||||
|
||||
list(APPEND CLIENT_INCLUDE_DIRS "${CMAKE_CURRENT_BINARY_DIR}/generated")
|
||||
list(APPEND SERVER_INCLUDE_DIRS "${CMAKE_CURRENT_BINARY_DIR}/generated")
|
||||
list(APPEND RENDERER_INCLUDE_DIRS "${CMAKE_CURRENT_BINARY_DIR}/generated")
|
||||
@@ -1,5 +0,0 @@
|
||||
This file identifies the version of the AL headers in this directory. If you
|
||||
change or update the AL headers in any way, please make sure you also update
|
||||
this file.
|
||||
|
||||
openal-soft-1.15.1
|
||||
@@ -22,7 +22,7 @@ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
|
||||
// launch.h: Base interface for starting programs
|
||||
|
||||
#include "q_platform.h"
|
||||
#include "../qcommon/q_platform.h"
|
||||
|
||||
#include <filesystem>
|
||||
#include <string>
|
||||
|
||||
@@ -1,232 +0,0 @@
|
||||
/*
|
||||
Simple DirectMedia Layer
|
||||
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.
|
||||
*/
|
||||
|
||||
/**
|
||||
* \file SDL.h
|
||||
*
|
||||
* Main include header for the SDL library
|
||||
*/
|
||||
|
||||
|
||||
#ifndef SDL_h_
|
||||
#define SDL_h_
|
||||
|
||||
#include "SDL_main.h"
|
||||
#include "SDL_stdinc.h"
|
||||
#include "SDL_assert.h"
|
||||
#include "SDL_atomic.h"
|
||||
#include "SDL_audio.h"
|
||||
#include "SDL_clipboard.h"
|
||||
#include "SDL_cpuinfo.h"
|
||||
#include "SDL_endian.h"
|
||||
#include "SDL_error.h"
|
||||
#include "SDL_events.h"
|
||||
#include "SDL_filesystem.h"
|
||||
#include "SDL_gamecontroller.h"
|
||||
#include "SDL_haptic.h"
|
||||
#include "SDL_hidapi.h"
|
||||
#include "SDL_hints.h"
|
||||
#include "SDL_joystick.h"
|
||||
#include "SDL_loadso.h"
|
||||
#include "SDL_log.h"
|
||||
#include "SDL_messagebox.h"
|
||||
#include "SDL_metal.h"
|
||||
#include "SDL_mutex.h"
|
||||
#include "SDL_power.h"
|
||||
#include "SDL_render.h"
|
||||
#include "SDL_rwops.h"
|
||||
#include "SDL_sensor.h"
|
||||
#include "SDL_shape.h"
|
||||
#include "SDL_system.h"
|
||||
#include "SDL_thread.h"
|
||||
#include "SDL_timer.h"
|
||||
#include "SDL_version.h"
|
||||
#include "SDL_video.h"
|
||||
#include "SDL_locale.h"
|
||||
#include "SDL_misc.h"
|
||||
|
||||
#include "begin_code.h"
|
||||
/* Set up for C function definitions, even when using C++ */
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
/* As of version 0.5, SDL is loaded dynamically into the application */
|
||||
|
||||
/**
|
||||
* \name SDL_INIT_*
|
||||
*
|
||||
* These are the flags which may be passed to SDL_Init(). You should
|
||||
* specify the subsystems which you will be using in your application.
|
||||
*/
|
||||
/* @{ */
|
||||
#define SDL_INIT_TIMER 0x00000001u
|
||||
#define SDL_INIT_AUDIO 0x00000010u
|
||||
#define SDL_INIT_VIDEO 0x00000020u /**< SDL_INIT_VIDEO implies SDL_INIT_EVENTS */
|
||||
#define SDL_INIT_JOYSTICK 0x00000200u /**< SDL_INIT_JOYSTICK implies SDL_INIT_EVENTS */
|
||||
#define SDL_INIT_HAPTIC 0x00001000u
|
||||
#define SDL_INIT_GAMECONTROLLER 0x00002000u /**< SDL_INIT_GAMECONTROLLER implies SDL_INIT_JOYSTICK */
|
||||
#define SDL_INIT_EVENTS 0x00004000u
|
||||
#define SDL_INIT_SENSOR 0x00008000u
|
||||
#define SDL_INIT_NOPARACHUTE 0x00100000u /**< compatibility; this flag is ignored. */
|
||||
#define SDL_INIT_EVERYTHING ( \
|
||||
SDL_INIT_TIMER | SDL_INIT_AUDIO | SDL_INIT_VIDEO | SDL_INIT_EVENTS | \
|
||||
SDL_INIT_JOYSTICK | SDL_INIT_HAPTIC | SDL_INIT_GAMECONTROLLER | SDL_INIT_SENSOR \
|
||||
)
|
||||
/* @} */
|
||||
|
||||
/**
|
||||
* Initialize the SDL library.
|
||||
*
|
||||
* SDL_Init() simply forwards to calling SDL_InitSubSystem(). Therefore, the
|
||||
* two may be used interchangeably. Though for readability of your code
|
||||
* SDL_InitSubSystem() might be preferred.
|
||||
*
|
||||
* The file I/O (for example: SDL_RWFromFile) and threading (SDL_CreateThread)
|
||||
* subsystems are initialized by default. Message boxes
|
||||
* (SDL_ShowSimpleMessageBox) also attempt to work without initializing the
|
||||
* video subsystem, in hopes of being useful in showing an error dialog when
|
||||
* SDL_Init fails. You must specifically initialize other subsystems if you
|
||||
* use them in your application.
|
||||
*
|
||||
* Logging (such as SDL_Log) works without initialization, too.
|
||||
*
|
||||
* `flags` may be any of the following OR'd together:
|
||||
*
|
||||
* - `SDL_INIT_TIMER`: timer subsystem
|
||||
* - `SDL_INIT_AUDIO`: audio subsystem
|
||||
* - `SDL_INIT_VIDEO`: video subsystem; automatically initializes the events
|
||||
* subsystem
|
||||
* - `SDL_INIT_JOYSTICK`: joystick subsystem; automatically initializes the
|
||||
* events subsystem
|
||||
* - `SDL_INIT_HAPTIC`: haptic (force feedback) subsystem
|
||||
* - `SDL_INIT_GAMECONTROLLER`: controller subsystem; automatically
|
||||
* initializes the joystick subsystem
|
||||
* - `SDL_INIT_EVENTS`: events subsystem
|
||||
* - `SDL_INIT_EVERYTHING`: all of the above subsystems
|
||||
* - `SDL_INIT_NOPARACHUTE`: compatibility; this flag is ignored
|
||||
*
|
||||
* Subsystem initialization is ref-counted, you must call SDL_QuitSubSystem()
|
||||
* for each SDL_InitSubSystem() to correctly shutdown a subsystem manually (or
|
||||
* call SDL_Quit() to force shutdown). If a subsystem is already loaded then
|
||||
* this call will increase the ref-count and return.
|
||||
*
|
||||
* \param flags subsystem initialization flags
|
||||
* \returns 0 on success or a negative error code on failure; call
|
||||
* SDL_GetError() for more information.
|
||||
*
|
||||
* \since This function is available since SDL 2.0.0.
|
||||
*
|
||||
* \sa SDL_InitSubSystem
|
||||
* \sa SDL_Quit
|
||||
* \sa SDL_SetMainReady
|
||||
* \sa SDL_WasInit
|
||||
*/
|
||||
extern DECLSPEC int SDLCALL SDL_Init(Uint32 flags);
|
||||
|
||||
/**
|
||||
* Compatibility function to initialize the SDL library.
|
||||
*
|
||||
* In SDL2, this function and SDL_Init() are interchangeable.
|
||||
*
|
||||
* \param flags any of the flags used by SDL_Init(); see SDL_Init for details.
|
||||
* \returns 0 on success or a negative error code on failure; call
|
||||
* SDL_GetError() for more information.
|
||||
*
|
||||
* \since This function is available since SDL 2.0.0.
|
||||
*
|
||||
* \sa SDL_Init
|
||||
* \sa SDL_Quit
|
||||
* \sa SDL_QuitSubSystem
|
||||
*/
|
||||
extern DECLSPEC int SDLCALL SDL_InitSubSystem(Uint32 flags);
|
||||
|
||||
/**
|
||||
* Shut down specific SDL subsystems.
|
||||
*
|
||||
* If you start a subsystem using a call to that subsystem's init function
|
||||
* (for example SDL_VideoInit()) instead of SDL_Init() or SDL_InitSubSystem(),
|
||||
* SDL_QuitSubSystem() and SDL_WasInit() will not work. You will need to use
|
||||
* that subsystem's quit function (SDL_VideoQuit()) directly instead. But
|
||||
* generally, you should not be using those functions directly anyhow; use
|
||||
* SDL_Init() instead.
|
||||
*
|
||||
* You still need to call SDL_Quit() even if you close all open subsystems
|
||||
* with SDL_QuitSubSystem().
|
||||
*
|
||||
* \param flags any of the flags used by SDL_Init(); see SDL_Init for details.
|
||||
*
|
||||
* \since This function is available since SDL 2.0.0.
|
||||
*
|
||||
* \sa SDL_InitSubSystem
|
||||
* \sa SDL_Quit
|
||||
*/
|
||||
extern DECLSPEC void SDLCALL SDL_QuitSubSystem(Uint32 flags);
|
||||
|
||||
/**
|
||||
* Get a mask of the specified subsystems which are currently initialized.
|
||||
*
|
||||
* \param flags any of the flags used by SDL_Init(); see SDL_Init for details.
|
||||
* \returns a mask of all initialized subsystems if `flags` is 0, otherwise it
|
||||
* returns the initialization status of the specified subsystems.
|
||||
*
|
||||
* The return value does not include SDL_INIT_NOPARACHUTE.
|
||||
*
|
||||
* \since This function is available since SDL 2.0.0.
|
||||
*
|
||||
* \sa SDL_Init
|
||||
* \sa SDL_InitSubSystem
|
||||
*/
|
||||
extern DECLSPEC Uint32 SDLCALL SDL_WasInit(Uint32 flags);
|
||||
|
||||
/**
|
||||
* Clean up all initialized subsystems.
|
||||
*
|
||||
* You should call this function even if you have already shutdown each
|
||||
* initialized subsystem with SDL_QuitSubSystem(). It is safe to call this
|
||||
* function even in the case of errors in initialization.
|
||||
*
|
||||
* If you start a subsystem using a call to that subsystem's init function
|
||||
* (for example SDL_VideoInit()) instead of SDL_Init() or SDL_InitSubSystem(),
|
||||
* then you must use that subsystem's quit function (SDL_VideoQuit()) to shut
|
||||
* it down before calling SDL_Quit(). But generally, you should not be using
|
||||
* those functions directly anyhow; use SDL_Init() instead.
|
||||
*
|
||||
* You can use this function with atexit() to ensure that it is run when your
|
||||
* application is shutdown, but it is not wise to do this from a library or
|
||||
* other dynamically loaded code.
|
||||
*
|
||||
* \since This function is available since SDL 2.0.0.
|
||||
*
|
||||
* \sa SDL_Init
|
||||
* \sa SDL_QuitSubSystem
|
||||
*/
|
||||
extern DECLSPEC void SDLCALL SDL_Quit(void);
|
||||
|
||||
/* Ends C function definitions when using C++ */
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
#include "close_code.h"
|
||||
|
||||
#endif /* SDL_h_ */
|
||||
|
||||
/* vi: set ts=4 sw=4 expandtab: */
|
||||
@@ -1,324 +0,0 @@
|
||||
/*
|
||||
Simple DirectMedia Layer
|
||||
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.
|
||||
*/
|
||||
|
||||
#ifndef SDL_assert_h_
|
||||
#define SDL_assert_h_
|
||||
|
||||
#include "SDL_config.h"
|
||||
|
||||
#include "begin_code.h"
|
||||
/* Set up for C function definitions, even when using C++ */
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
#ifndef SDL_ASSERT_LEVEL
|
||||
#ifdef SDL_DEFAULT_ASSERT_LEVEL
|
||||
#define SDL_ASSERT_LEVEL SDL_DEFAULT_ASSERT_LEVEL
|
||||
#elif defined(_DEBUG) || defined(DEBUG) || \
|
||||
(defined(__GNUC__) && !defined(__OPTIMIZE__))
|
||||
#define SDL_ASSERT_LEVEL 2
|
||||
#else
|
||||
#define SDL_ASSERT_LEVEL 1
|
||||
#endif
|
||||
#endif /* SDL_ASSERT_LEVEL */
|
||||
|
||||
/*
|
||||
These are macros and not first class functions so that the debugger breaks
|
||||
on the assertion line and not in some random guts of SDL, and so each
|
||||
assert can have unique static variables associated with it.
|
||||
*/
|
||||
|
||||
#if defined(_MSC_VER)
|
||||
/* Don't include intrin.h here because it contains C++ code */
|
||||
extern void __cdecl __debugbreak(void);
|
||||
#define SDL_TriggerBreakpoint() __debugbreak()
|
||||
#elif ( (!defined(__NACL__)) && ((defined(__GNUC__) || defined(__clang__)) && (defined(__i386__) || defined(__x86_64__))) )
|
||||
#define SDL_TriggerBreakpoint() __asm__ __volatile__ ( "int $3\n\t" )
|
||||
#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" )
|
||||
#elif defined(__APPLE__) && defined(__arm__)
|
||||
#define SDL_TriggerBreakpoint() __asm__ __volatile__ ( "bkpt #22\n\t" )
|
||||
#elif defined(__386__) && defined(__WATCOMC__)
|
||||
#define SDL_TriggerBreakpoint() { _asm { int 0x03 } }
|
||||
#elif defined(HAVE_SIGNAL_H) && !defined(__WATCOMC__)
|
||||
#include <signal.h>
|
||||
#define SDL_TriggerBreakpoint() raise(SIGTRAP)
|
||||
#else
|
||||
/* How do we trigger breakpoints on this platform? */
|
||||
#define SDL_TriggerBreakpoint()
|
||||
#endif
|
||||
|
||||
#if defined(__STDC_VERSION__) && (__STDC_VERSION__ >= 199901L) /* C99 supports __func__ as a standard. */
|
||||
# define SDL_FUNCTION __func__
|
||||
#elif ((__GNUC__ >= 2) || defined(_MSC_VER) || defined (__WATCOMC__))
|
||||
# define SDL_FUNCTION __FUNCTION__
|
||||
#else
|
||||
# define SDL_FUNCTION "???"
|
||||
#endif
|
||||
#define SDL_FILE __FILE__
|
||||
#define SDL_LINE __LINE__
|
||||
|
||||
/*
|
||||
sizeof (x) makes the compiler still parse the expression even without
|
||||
assertions enabled, so the code is always checked at compile time, but
|
||||
doesn't actually generate code for it, so there are no side effects or
|
||||
expensive checks at run time, just the constant size of what x WOULD be,
|
||||
which presumably gets optimized out as unused.
|
||||
This also solves the problem of...
|
||||
|
||||
int somevalue = blah();
|
||||
SDL_assert(somevalue == 1);
|
||||
|
||||
...which would cause compiles to complain that somevalue is unused if we
|
||||
disable assertions.
|
||||
*/
|
||||
|
||||
/* "while (0,0)" fools Microsoft's compiler's /W4 warning level into thinking
|
||||
this condition isn't constant. And looks like an owl's face! */
|
||||
#ifdef _MSC_VER /* stupid /W4 warnings. */
|
||||
#define SDL_NULL_WHILE_LOOP_CONDITION (0,0)
|
||||
#else
|
||||
#define SDL_NULL_WHILE_LOOP_CONDITION (0)
|
||||
#endif
|
||||
|
||||
#define SDL_disabled_assert(condition) \
|
||||
do { (void) sizeof ((condition)); } while (SDL_NULL_WHILE_LOOP_CONDITION)
|
||||
|
||||
typedef enum
|
||||
{
|
||||
SDL_ASSERTION_RETRY, /**< Retry the assert immediately. */
|
||||
SDL_ASSERTION_BREAK, /**< Make the debugger trigger a breakpoint. */
|
||||
SDL_ASSERTION_ABORT, /**< Terminate the program. */
|
||||
SDL_ASSERTION_IGNORE, /**< Ignore the assert. */
|
||||
SDL_ASSERTION_ALWAYS_IGNORE /**< Ignore the assert from now on. */
|
||||
} SDL_AssertState;
|
||||
|
||||
typedef struct SDL_AssertData
|
||||
{
|
||||
int always_ignore;
|
||||
unsigned int trigger_count;
|
||||
const char *condition;
|
||||
const char *filename;
|
||||
int linenum;
|
||||
const char *function;
|
||||
const struct SDL_AssertData *next;
|
||||
} SDL_AssertData;
|
||||
|
||||
#if (SDL_ASSERT_LEVEL > 0)
|
||||
|
||||
/* Never call this directly. Use the SDL_assert* macros. */
|
||||
extern DECLSPEC SDL_AssertState SDLCALL SDL_ReportAssertion(SDL_AssertData *,
|
||||
const char *,
|
||||
const char *, int)
|
||||
#if defined(__clang__)
|
||||
#if __has_feature(attribute_analyzer_noreturn)
|
||||
/* this tells Clang's static analysis that we're a custom assert function,
|
||||
and that the analyzer should assume the condition was always true past this
|
||||
SDL_assert test. */
|
||||
__attribute__((analyzer_noreturn))
|
||||
#endif
|
||||
#endif
|
||||
;
|
||||
|
||||
/* the do {} while(0) avoids dangling else problems:
|
||||
if (x) SDL_assert(y); else blah();
|
||||
... without the do/while, the "else" could attach to this macro's "if".
|
||||
We try to handle just the minimum we need here in a macro...the loop,
|
||||
the static vars, and break points. The heavy lifting is handled in
|
||||
SDL_ReportAssertion(), in SDL_assert.c.
|
||||
*/
|
||||
#define SDL_enabled_assert(condition) \
|
||||
do { \
|
||||
while ( !(condition) ) { \
|
||||
static struct SDL_AssertData sdl_assert_data = { \
|
||||
0, 0, #condition, 0, 0, 0, 0 \
|
||||
}; \
|
||||
const SDL_AssertState sdl_assert_state = SDL_ReportAssertion(&sdl_assert_data, SDL_FUNCTION, SDL_FILE, SDL_LINE); \
|
||||
if (sdl_assert_state == SDL_ASSERTION_RETRY) { \
|
||||
continue; /* go again. */ \
|
||||
} else if (sdl_assert_state == SDL_ASSERTION_BREAK) { \
|
||||
SDL_TriggerBreakpoint(); \
|
||||
} \
|
||||
break; /* not retrying. */ \
|
||||
} \
|
||||
} while (SDL_NULL_WHILE_LOOP_CONDITION)
|
||||
|
||||
#endif /* enabled assertions support code */
|
||||
|
||||
/* Enable various levels of assertions. */
|
||||
#if SDL_ASSERT_LEVEL == 0 /* assertions disabled */
|
||||
# define SDL_assert(condition) SDL_disabled_assert(condition)
|
||||
# define SDL_assert_release(condition) SDL_disabled_assert(condition)
|
||||
# define SDL_assert_paranoid(condition) SDL_disabled_assert(condition)
|
||||
#elif SDL_ASSERT_LEVEL == 1 /* release settings. */
|
||||
# define SDL_assert(condition) SDL_disabled_assert(condition)
|
||||
# define SDL_assert_release(condition) SDL_enabled_assert(condition)
|
||||
# define SDL_assert_paranoid(condition) SDL_disabled_assert(condition)
|
||||
#elif SDL_ASSERT_LEVEL == 2 /* normal settings. */
|
||||
# define SDL_assert(condition) SDL_enabled_assert(condition)
|
||||
# define SDL_assert_release(condition) SDL_enabled_assert(condition)
|
||||
# define SDL_assert_paranoid(condition) SDL_disabled_assert(condition)
|
||||
#elif SDL_ASSERT_LEVEL == 3 /* paranoid settings. */
|
||||
# define SDL_assert(condition) SDL_enabled_assert(condition)
|
||||
# define SDL_assert_release(condition) SDL_enabled_assert(condition)
|
||||
# define SDL_assert_paranoid(condition) SDL_enabled_assert(condition)
|
||||
#else
|
||||
# error Unknown assertion level.
|
||||
#endif
|
||||
|
||||
/* this assertion is never disabled at any level. */
|
||||
#define SDL_assert_always(condition) SDL_enabled_assert(condition)
|
||||
|
||||
|
||||
/**
|
||||
* A callback that fires when an SDL assertion fails.
|
||||
*
|
||||
* \param data a pointer to the SDL_AssertData structure corresponding to the
|
||||
* current assertion
|
||||
* \param userdata what was passed as `userdata` to SDL_SetAssertionHandler()
|
||||
* \returns an SDL_AssertState value indicating how to handle the failure.
|
||||
*/
|
||||
typedef SDL_AssertState (SDLCALL *SDL_AssertionHandler)(
|
||||
const SDL_AssertData* data, void* userdata);
|
||||
|
||||
/**
|
||||
* Set an application-defined assertion handler.
|
||||
*
|
||||
* This function allows an application to show its own assertion UI and/or
|
||||
* force the response to an assertion failure. If the application doesn't
|
||||
* provide this, SDL will try to do the right thing, popping up a
|
||||
* system-specific GUI dialog, and probably minimizing any fullscreen windows.
|
||||
*
|
||||
* This callback may fire from any thread, but it runs wrapped in a mutex, so
|
||||
* it will only fire from one thread at a time.
|
||||
*
|
||||
* This callback is NOT reset to SDL's internal handler upon SDL_Quit()!
|
||||
*
|
||||
* \param handler the SDL_AssertionHandler function to call when an assertion
|
||||
* fails or NULL for the default handler
|
||||
* \param userdata a pointer that is passed to `handler`
|
||||
*
|
||||
* \since This function is available since SDL 2.0.0.
|
||||
*
|
||||
* \sa SDL_GetAssertionHandler
|
||||
*/
|
||||
extern DECLSPEC void SDLCALL SDL_SetAssertionHandler(
|
||||
SDL_AssertionHandler handler,
|
||||
void *userdata);
|
||||
|
||||
/**
|
||||
* Get the default assertion handler.
|
||||
*
|
||||
* This returns the function pointer that is called by default when an
|
||||
* assertion is triggered. This is an internal function provided by SDL, that
|
||||
* is used for assertions when SDL_SetAssertionHandler() hasn't been used to
|
||||
* provide a different function.
|
||||
*
|
||||
* \returns the default SDL_AssertionHandler that is called when an assert
|
||||
* triggers.
|
||||
*
|
||||
* \since This function is available since SDL 2.0.2.
|
||||
*
|
||||
* \sa SDL_GetAssertionHandler
|
||||
*/
|
||||
extern DECLSPEC SDL_AssertionHandler SDLCALL SDL_GetDefaultAssertionHandler(void);
|
||||
|
||||
/**
|
||||
* Get the current assertion handler.
|
||||
*
|
||||
* This returns the function pointer that is called when an assertion is
|
||||
* triggered. This is either the value last passed to
|
||||
* SDL_SetAssertionHandler(), or if no application-specified function is set,
|
||||
* is equivalent to calling SDL_GetDefaultAssertionHandler().
|
||||
*
|
||||
* The parameter `puserdata` is a pointer to a void*, which will store the
|
||||
* "userdata" pointer that was passed to SDL_SetAssertionHandler(). This value
|
||||
* will always be NULL for the default handler. If you don't care about this
|
||||
* data, it is safe to pass a NULL pointer to this function to ignore it.
|
||||
*
|
||||
* \param puserdata pointer which is filled with the "userdata" pointer that
|
||||
* was passed to SDL_SetAssertionHandler()
|
||||
* \returns the SDL_AssertionHandler that is called when an assert triggers.
|
||||
*
|
||||
* \since This function is available since SDL 2.0.2.
|
||||
*
|
||||
* \sa SDL_SetAssertionHandler
|
||||
*/
|
||||
extern DECLSPEC SDL_AssertionHandler SDLCALL SDL_GetAssertionHandler(void **puserdata);
|
||||
|
||||
/**
|
||||
* Get a list of all assertion failures.
|
||||
*
|
||||
* This function gets all assertions triggered since the last call to
|
||||
* SDL_ResetAssertionReport(), or the start of the program.
|
||||
*
|
||||
* The proper way to examine this data looks something like this:
|
||||
*
|
||||
* ```c
|
||||
* const SDL_AssertData *item = SDL_GetAssertionReport();
|
||||
* while (item) {
|
||||
* printf("'%s', %s (%s:%d), triggered %u times, always ignore: %s.\\n",
|
||||
* item->condition, item->function, item->filename,
|
||||
* item->linenum, item->trigger_count,
|
||||
* item->always_ignore ? "yes" : "no");
|
||||
* item = item->next;
|
||||
* }
|
||||
* ```
|
||||
*
|
||||
* \returns a list of all failed assertions or NULL if the list is empty. This
|
||||
* memory should not be modified or freed by the application.
|
||||
*
|
||||
* \since This function is available since SDL 2.0.0.
|
||||
*
|
||||
* \sa SDL_ResetAssertionReport
|
||||
*/
|
||||
extern DECLSPEC const SDL_AssertData * SDLCALL SDL_GetAssertionReport(void);
|
||||
|
||||
/**
|
||||
* Clear the list of all assertion failures.
|
||||
*
|
||||
* This function will clear the list of all assertions triggered up to that
|
||||
* point. Immediately following this call, SDL_GetAssertionReport will return
|
||||
* no items. In addition, any previously-triggered assertions will be reset to
|
||||
* a trigger_count of zero, and their always_ignore state will be false.
|
||||
*
|
||||
* \since This function is available since SDL 2.0.0.
|
||||
*
|
||||
* \sa SDL_GetAssertionReport
|
||||
*/
|
||||
extern DECLSPEC void SDLCALL SDL_ResetAssertionReport(void);
|
||||
|
||||
|
||||
/* these had wrong naming conventions until 2.0.4. Please update your app! */
|
||||
#define SDL_assert_state SDL_AssertState
|
||||
#define SDL_assert_data SDL_AssertData
|
||||
|
||||
|
||||
/* Ends C function definitions when using C++ */
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
#include "close_code.h"
|
||||
|
||||
#endif /* SDL_assert_h_ */
|
||||
|
||||
/* vi: set ts=4 sw=4 expandtab: */
|
||||
@@ -1,395 +0,0 @@
|
||||
/*
|
||||
Simple DirectMedia Layer
|
||||
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.
|
||||
*/
|
||||
|
||||
/**
|
||||
* \file SDL_atomic.h
|
||||
*
|
||||
* Atomic operations.
|
||||
*
|
||||
* IMPORTANT:
|
||||
* If you are not an expert in concurrent lockless programming, you should
|
||||
* only be using the atomic lock and reference counting functions in this
|
||||
* file. In all other cases you should be protecting your data structures
|
||||
* with full mutexes.
|
||||
*
|
||||
* The list of "safe" functions to use are:
|
||||
* SDL_AtomicLock()
|
||||
* SDL_AtomicUnlock()
|
||||
* SDL_AtomicIncRef()
|
||||
* SDL_AtomicDecRef()
|
||||
*
|
||||
* Seriously, here be dragons!
|
||||
* ^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
*
|
||||
* You can find out a little more about lockless programming and the
|
||||
* subtle issues that can arise here:
|
||||
* http://msdn.microsoft.com/en-us/library/ee418650%28v=vs.85%29.aspx
|
||||
*
|
||||
* There's also lots of good information here:
|
||||
* http://www.1024cores.net/home/lock-free-algorithms
|
||||
* http://preshing.com/
|
||||
*
|
||||
* These operations may or may not actually be implemented using
|
||||
* processor specific atomic operations. When possible they are
|
||||
* implemented as true processor specific atomic operations. When that
|
||||
* is not possible the are implemented using locks that *do* use the
|
||||
* available atomic operations.
|
||||
*
|
||||
* All of the atomic operations that modify memory are full memory barriers.
|
||||
*/
|
||||
|
||||
#ifndef SDL_atomic_h_
|
||||
#define SDL_atomic_h_
|
||||
|
||||
#include "SDL_stdinc.h"
|
||||
#include "SDL_platform.h"
|
||||
|
||||
#include "begin_code.h"
|
||||
|
||||
/* Set up for C function definitions, even when using C++ */
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
/**
|
||||
* \name SDL AtomicLock
|
||||
*
|
||||
* The atomic locks are efficient spinlocks using CPU instructions,
|
||||
* but are vulnerable to starvation and can spin forever if a thread
|
||||
* holding a lock has been terminated. For this reason you should
|
||||
* minimize the code executed inside an atomic lock and never do
|
||||
* expensive things like API or system calls while holding them.
|
||||
*
|
||||
* The atomic locks are not safe to lock recursively.
|
||||
*
|
||||
* Porting Note:
|
||||
* The spin lock functions and type are required and can not be
|
||||
* emulated because they are used in the atomic emulation code.
|
||||
*/
|
||||
/* @{ */
|
||||
|
||||
typedef int SDL_SpinLock;
|
||||
|
||||
/**
|
||||
* Try to lock a spin lock by setting it to a non-zero value.
|
||||
*
|
||||
* ***Please note that spinlocks are dangerous if you don't know what you're
|
||||
* doing. Please be careful using any sort of spinlock!***
|
||||
*
|
||||
* \param lock a pointer to a lock variable
|
||||
* \returns SDL_TRUE if the lock succeeded, SDL_FALSE if the lock is already
|
||||
* held.
|
||||
*
|
||||
* \since This function is available since SDL 2.0.0.
|
||||
*
|
||||
* \sa SDL_AtomicLock
|
||||
* \sa SDL_AtomicUnlock
|
||||
*/
|
||||
extern DECLSPEC SDL_bool SDLCALL SDL_AtomicTryLock(SDL_SpinLock *lock);
|
||||
|
||||
/**
|
||||
* Lock a spin lock by setting it to a non-zero value.
|
||||
*
|
||||
* ***Please note that spinlocks are dangerous if you don't know what you're
|
||||
* doing. Please be careful using any sort of spinlock!***
|
||||
*
|
||||
* \param lock a pointer to a lock variable
|
||||
*
|
||||
* \since This function is available since SDL 2.0.0.
|
||||
*
|
||||
* \sa SDL_AtomicTryLock
|
||||
* \sa SDL_AtomicUnlock
|
||||
*/
|
||||
extern DECLSPEC void SDLCALL SDL_AtomicLock(SDL_SpinLock *lock);
|
||||
|
||||
/**
|
||||
* Unlock a spin lock by setting it to 0.
|
||||
*
|
||||
* Always returns immediately.
|
||||
*
|
||||
* ***Please note that spinlocks are dangerous if you don't know what you're
|
||||
* doing. Please be careful using any sort of spinlock!***
|
||||
*
|
||||
* \param lock a pointer to a lock variable
|
||||
*
|
||||
* \since This function is available since SDL 2.0.0.
|
||||
*
|
||||
* \sa SDL_AtomicLock
|
||||
* \sa SDL_AtomicTryLock
|
||||
*/
|
||||
extern DECLSPEC void SDLCALL SDL_AtomicUnlock(SDL_SpinLock *lock);
|
||||
|
||||
/* @} *//* SDL AtomicLock */
|
||||
|
||||
|
||||
/**
|
||||
* The compiler barrier prevents the compiler from reordering
|
||||
* reads and writes to globally visible variables across the call.
|
||||
*/
|
||||
#if defined(_MSC_VER) && (_MSC_VER > 1200) && !defined(__clang__)
|
||||
void _ReadWriteBarrier(void);
|
||||
#pragma intrinsic(_ReadWriteBarrier)
|
||||
#define SDL_CompilerBarrier() _ReadWriteBarrier()
|
||||
#elif (defined(__GNUC__) && !defined(__EMSCRIPTEN__)) || (defined(__SUNPRO_C) && (__SUNPRO_C >= 0x5120))
|
||||
/* This is correct for all CPUs when using GCC or Solaris Studio 12.1+. */
|
||||
#define SDL_CompilerBarrier() __asm__ __volatile__ ("" : : : "memory")
|
||||
#elif defined(__WATCOMC__)
|
||||
extern __inline void SDL_CompilerBarrier(void);
|
||||
#pragma aux SDL_CompilerBarrier = "" parm [] modify exact [];
|
||||
#else
|
||||
#define SDL_CompilerBarrier() \
|
||||
{ SDL_SpinLock _tmp = 0; SDL_AtomicLock(&_tmp); SDL_AtomicUnlock(&_tmp); }
|
||||
#endif
|
||||
|
||||
/**
|
||||
* Memory barriers are designed to prevent reads and writes from being
|
||||
* reordered by the compiler and being seen out of order on multi-core CPUs.
|
||||
*
|
||||
* A typical pattern would be for thread A to write some data and a flag, and
|
||||
* for thread B to read the flag and get the data. In this case you would
|
||||
* insert a release barrier between writing the data and the flag,
|
||||
* guaranteeing that the data write completes no later than the flag is
|
||||
* written, and you would insert an acquire barrier between reading the flag
|
||||
* and reading the data, to ensure that all the reads associated with the flag
|
||||
* have completed.
|
||||
*
|
||||
* In this pattern you should always see a release barrier paired with an
|
||||
* acquire barrier and you should gate the data reads/writes with a single
|
||||
* flag variable.
|
||||
*
|
||||
* For more information on these semantics, take a look at the blog post:
|
||||
* http://preshing.com/20120913/acquire-and-release-semantics
|
||||
*
|
||||
* \since This function is available since SDL 2.0.6.
|
||||
*/
|
||||
extern DECLSPEC void SDLCALL SDL_MemoryBarrierReleaseFunction(void);
|
||||
extern DECLSPEC void SDLCALL SDL_MemoryBarrierAcquireFunction(void);
|
||||
|
||||
#if defined(__GNUC__) && (defined(__powerpc__) || defined(__ppc__))
|
||||
#define SDL_MemoryBarrierRelease() __asm__ __volatile__ ("lwsync" : : : "memory")
|
||||
#define SDL_MemoryBarrierAcquire() __asm__ __volatile__ ("lwsync" : : : "memory")
|
||||
#elif defined(__GNUC__) && defined(__aarch64__)
|
||||
#define SDL_MemoryBarrierRelease() __asm__ __volatile__ ("dmb ish" : : : "memory")
|
||||
#define SDL_MemoryBarrierAcquire() __asm__ __volatile__ ("dmb ish" : : : "memory")
|
||||
#elif defined(__GNUC__) && defined(__arm__)
|
||||
#if 0 /* defined(__LINUX__) || defined(__ANDROID__) */
|
||||
/* Information from:
|
||||
https://chromium.googlesource.com/chromium/chromium/+/trunk/base/atomicops_internals_arm_gcc.h#19
|
||||
|
||||
The Linux kernel provides a helper function which provides the right code for a memory barrier,
|
||||
hard-coded at address 0xffff0fa0
|
||||
*/
|
||||
typedef void (*SDL_KernelMemoryBarrierFunc)();
|
||||
#define SDL_MemoryBarrierRelease() ((SDL_KernelMemoryBarrierFunc)0xffff0fa0)()
|
||||
#define SDL_MemoryBarrierAcquire() ((SDL_KernelMemoryBarrierFunc)0xffff0fa0)()
|
||||
#elif 0 /* defined(__QNXNTO__) */
|
||||
#include <sys/cpuinline.h>
|
||||
|
||||
#define SDL_MemoryBarrierRelease() __cpu_membarrier()
|
||||
#define SDL_MemoryBarrierAcquire() __cpu_membarrier()
|
||||
#else
|
||||
#if defined(__ARM_ARCH_7__) || defined(__ARM_ARCH_7A__) || defined(__ARM_ARCH_7EM__) || defined(__ARM_ARCH_7R__) || defined(__ARM_ARCH_7M__) || defined(__ARM_ARCH_7S__) || defined(__ARM_ARCH_8A__)
|
||||
#define SDL_MemoryBarrierRelease() __asm__ __volatile__ ("dmb ish" : : : "memory")
|
||||
#define SDL_MemoryBarrierAcquire() __asm__ __volatile__ ("dmb ish" : : : "memory")
|
||||
#elif defined(__ARM_ARCH_6__) || defined(__ARM_ARCH_6J__) || defined(__ARM_ARCH_6K__) || defined(__ARM_ARCH_6T2__) || defined(__ARM_ARCH_6Z__) || defined(__ARM_ARCH_6ZK__) || defined(__ARM_ARCH_5TE__)
|
||||
#ifdef __thumb__
|
||||
/* The mcr instruction isn't available in thumb mode, use real functions */
|
||||
#define SDL_MEMORY_BARRIER_USES_FUNCTION
|
||||
#define SDL_MemoryBarrierRelease() SDL_MemoryBarrierReleaseFunction()
|
||||
#define SDL_MemoryBarrierAcquire() SDL_MemoryBarrierAcquireFunction()
|
||||
#else
|
||||
#define SDL_MemoryBarrierRelease() __asm__ __volatile__ ("mcr p15, 0, %0, c7, c10, 5" : : "r"(0) : "memory")
|
||||
#define SDL_MemoryBarrierAcquire() __asm__ __volatile__ ("mcr p15, 0, %0, c7, c10, 5" : : "r"(0) : "memory")
|
||||
#endif /* __thumb__ */
|
||||
#else
|
||||
#define SDL_MemoryBarrierRelease() __asm__ __volatile__ ("" : : : "memory")
|
||||
#define SDL_MemoryBarrierAcquire() __asm__ __volatile__ ("" : : : "memory")
|
||||
#endif /* __LINUX__ || __ANDROID__ */
|
||||
#endif /* __GNUC__ && __arm__ */
|
||||
#else
|
||||
#if (defined(__SUNPRO_C) && (__SUNPRO_C >= 0x5120))
|
||||
/* This is correct for all CPUs on Solaris when using Solaris Studio 12.1+. */
|
||||
#include <mbarrier.h>
|
||||
#define SDL_MemoryBarrierRelease() __machine_rel_barrier()
|
||||
#define SDL_MemoryBarrierAcquire() __machine_acq_barrier()
|
||||
#else
|
||||
/* This is correct for the x86 and x64 CPUs, and we'll expand this over time. */
|
||||
#define SDL_MemoryBarrierRelease() SDL_CompilerBarrier()
|
||||
#define SDL_MemoryBarrierAcquire() SDL_CompilerBarrier()
|
||||
#endif
|
||||
#endif
|
||||
|
||||
/**
|
||||
* \brief A type representing an atomic integer value. It is a struct
|
||||
* so people don't accidentally use numeric operations on it.
|
||||
*/
|
||||
typedef struct { int value; } SDL_atomic_t;
|
||||
|
||||
/**
|
||||
* Set an atomic variable to a new value if it is currently an old value.
|
||||
*
|
||||
* ***Note: If you don't know what this function is for, you shouldn't use
|
||||
* it!***
|
||||
*
|
||||
* \param a a pointer to an SDL_atomic_t variable to be modified
|
||||
* \param oldval the old value
|
||||
* \param newval the new value
|
||||
* \returns SDL_TRUE if the atomic variable was set, SDL_FALSE otherwise.
|
||||
*
|
||||
* \since This function is available since SDL 2.0.0.
|
||||
*
|
||||
* \sa SDL_AtomicCASPtr
|
||||
* \sa SDL_AtomicGet
|
||||
* \sa SDL_AtomicSet
|
||||
*/
|
||||
extern DECLSPEC SDL_bool SDLCALL SDL_AtomicCAS(SDL_atomic_t *a, int oldval, int newval);
|
||||
|
||||
/**
|
||||
* Set an atomic variable to a value.
|
||||
*
|
||||
* This function also acts as a full memory barrier.
|
||||
*
|
||||
* ***Note: If you don't know what this function is for, you shouldn't use
|
||||
* it!***
|
||||
*
|
||||
* \param a a pointer to an SDL_atomic_t variable to be modified
|
||||
* \param v the desired value
|
||||
* \returns the previous value of the atomic variable.
|
||||
*
|
||||
* \since This function is available since SDL 2.0.2.
|
||||
*
|
||||
* \sa SDL_AtomicGet
|
||||
*/
|
||||
extern DECLSPEC int SDLCALL SDL_AtomicSet(SDL_atomic_t *a, int v);
|
||||
|
||||
/**
|
||||
* Get the value of an atomic variable.
|
||||
*
|
||||
* ***Note: If you don't know what this function is for, you shouldn't use
|
||||
* it!***
|
||||
*
|
||||
* \param a a pointer to an SDL_atomic_t variable
|
||||
* \returns the current value of an atomic variable.
|
||||
*
|
||||
* \since This function is available since SDL 2.0.2.
|
||||
*
|
||||
* \sa SDL_AtomicSet
|
||||
*/
|
||||
extern DECLSPEC int SDLCALL SDL_AtomicGet(SDL_atomic_t *a);
|
||||
|
||||
/**
|
||||
* Add to an atomic variable.
|
||||
*
|
||||
* This function also acts as a full memory barrier.
|
||||
*
|
||||
* ***Note: If you don't know what this function is for, you shouldn't use
|
||||
* it!***
|
||||
*
|
||||
* \param a a pointer to an SDL_atomic_t variable to be modified
|
||||
* \param v the desired value to add
|
||||
* \returns the previous value of the atomic variable.
|
||||
*
|
||||
* \since This function is available since SDL 2.0.2.
|
||||
*
|
||||
* \sa SDL_AtomicDecRef
|
||||
* \sa SDL_AtomicIncRef
|
||||
*/
|
||||
extern DECLSPEC int SDLCALL SDL_AtomicAdd(SDL_atomic_t *a, int v);
|
||||
|
||||
/**
|
||||
* \brief Increment an atomic variable used as a reference count.
|
||||
*/
|
||||
#ifndef SDL_AtomicIncRef
|
||||
#define SDL_AtomicIncRef(a) SDL_AtomicAdd(a, 1)
|
||||
#endif
|
||||
|
||||
/**
|
||||
* \brief Decrement an atomic variable used as a reference count.
|
||||
*
|
||||
* \return SDL_TRUE if the variable reached zero after decrementing,
|
||||
* SDL_FALSE otherwise
|
||||
*/
|
||||
#ifndef SDL_AtomicDecRef
|
||||
#define SDL_AtomicDecRef(a) (SDL_AtomicAdd(a, -1) == 1)
|
||||
#endif
|
||||
|
||||
/**
|
||||
* Set a pointer to a new value if it is currently an old value.
|
||||
*
|
||||
* ***Note: If you don't know what this function is for, you shouldn't use
|
||||
* it!***
|
||||
*
|
||||
* \param a a pointer to a pointer
|
||||
* \param oldval the old pointer value
|
||||
* \param newval the new pointer value
|
||||
* \returns SDL_TRUE if the pointer was set, SDL_FALSE otherwise.
|
||||
*
|
||||
* \since This function is available since SDL 2.0.0.
|
||||
*
|
||||
* \sa SDL_AtomicCAS
|
||||
* \sa SDL_AtomicGetPtr
|
||||
* \sa SDL_AtomicSetPtr
|
||||
*/
|
||||
extern DECLSPEC SDL_bool SDLCALL SDL_AtomicCASPtr(void **a, void *oldval, void *newval);
|
||||
|
||||
/**
|
||||
* Set a pointer to a value atomically.
|
||||
*
|
||||
* ***Note: If you don't know what this function is for, you shouldn't use
|
||||
* it!***
|
||||
*
|
||||
* \param a a pointer to a pointer
|
||||
* \param v the desired pointer value
|
||||
* \returns the previous value of the pointer.
|
||||
*
|
||||
* \since This function is available since SDL 2.0.2.
|
||||
*
|
||||
* \sa SDL_AtomicCASPtr
|
||||
* \sa SDL_AtomicGetPtr
|
||||
*/
|
||||
extern DECLSPEC void* SDLCALL SDL_AtomicSetPtr(void **a, void* v);
|
||||
|
||||
/**
|
||||
* Get the value of a pointer atomically.
|
||||
*
|
||||
* ***Note: If you don't know what this function is for, you shouldn't use
|
||||
* it!***
|
||||
*
|
||||
* \param a a pointer to a pointer
|
||||
* \returns the current value of a pointer.
|
||||
*
|
||||
* \since This function is available since SDL 2.0.2.
|
||||
*
|
||||
* \sa SDL_AtomicCASPtr
|
||||
* \sa SDL_AtomicSetPtr
|
||||
*/
|
||||
extern DECLSPEC void* SDLCALL SDL_AtomicGetPtr(void **a);
|
||||
|
||||
/* Ends C function definitions when using C++ */
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#include "close_code.h"
|
||||
|
||||
#endif /* SDL_atomic_h_ */
|
||||
|
||||
/* vi: set ts=4 sw=4 expandtab: */
|
||||
File diff suppressed because it is too large.
Load diff
@@ -1,94 +0,0 @@
|
||||
/*
|
||||
Simple DirectMedia Layer
|
||||
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.
|
||||
*/
|
||||
|
||||
/**
|
||||
* \file SDL_clipboard.h
|
||||
*
|
||||
* Include file for SDL clipboard handling
|
||||
*/
|
||||
|
||||
#ifndef SDL_clipboard_h_
|
||||
#define SDL_clipboard_h_
|
||||
|
||||
#include "SDL_stdinc.h"
|
||||
|
||||
#include "begin_code.h"
|
||||
/* Set up for C function definitions, even when using C++ */
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
/* Function prototypes */
|
||||
|
||||
/**
|
||||
* Put UTF-8 text into the clipboard.
|
||||
*
|
||||
* \param text the text to store in the clipboard
|
||||
* \returns 0 on success or a negative error code on failure; call
|
||||
* SDL_GetError() for more information.
|
||||
*
|
||||
* \since This function is available since SDL 2.0.0.
|
||||
*
|
||||
* \sa SDL_GetClipboardText
|
||||
* \sa SDL_HasClipboardText
|
||||
*/
|
||||
extern DECLSPEC int SDLCALL SDL_SetClipboardText(const char *text);
|
||||
|
||||
/**
|
||||
* Get UTF-8 text from the clipboard, which must be freed with SDL_free().
|
||||
*
|
||||
* This functions returns empty string if there was not enough memory left for
|
||||
* a copy of the clipboard's content.
|
||||
*
|
||||
* \returns the clipboard text on success or an empty string on failure; call
|
||||
* SDL_GetError() for more information. Caller must call SDL_free()
|
||||
* on the returned pointer when done with it (even if there was an
|
||||
* error).
|
||||
*
|
||||
* \since This function is available since SDL 2.0.0.
|
||||
*
|
||||
* \sa SDL_HasClipboardText
|
||||
* \sa SDL_SetClipboardText
|
||||
*/
|
||||
extern DECLSPEC char * SDLCALL SDL_GetClipboardText(void);
|
||||
|
||||
/**
|
||||
* Query whether the clipboard exists and contains a non-empty text string.
|
||||
*
|
||||
* \returns SDL_TRUE if the clipboard has text, or SDL_FALSE if it does not.
|
||||
*
|
||||
* \since This function is available since SDL 2.0.0.
|
||||
*
|
||||
* \sa SDL_GetClipboardText
|
||||
* \sa SDL_SetClipboardText
|
||||
*/
|
||||
extern DECLSPEC SDL_bool SDLCALL SDL_HasClipboardText(void);
|
||||
|
||||
|
||||
/* Ends C function definitions when using C++ */
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
#include "close_code.h"
|
||||
|
||||
#endif /* SDL_clipboard_h_ */
|
||||
|
||||
/* vi: set ts=4 sw=4 expandtab: */
|
||||
@@ -1,55 +0,0 @@
|
||||
/*
|
||||
Simple DirectMedia Layer
|
||||
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.
|
||||
*/
|
||||
|
||||
#ifndef SDL_config_h_
|
||||
#define SDL_config_h_
|
||||
|
||||
#include "SDL_platform.h"
|
||||
|
||||
/**
|
||||
* \file SDL_config.h
|
||||
*/
|
||||
|
||||
/* Add any platform that doesn't build using the configure system. */
|
||||
#if defined(__WIN32__)
|
||||
#include "SDL_config_windows.h"
|
||||
#elif defined(__WINRT__)
|
||||
#include "SDL_config_winrt.h"
|
||||
#elif defined(__MACOSX__)
|
||||
#include "SDL_config_macosx.h"
|
||||
#elif defined(__IPHONEOS__)
|
||||
#include "SDL_config_iphoneos.h"
|
||||
#elif defined(__ANDROID__)
|
||||
#include "SDL_config_android.h"
|
||||
#elif defined(__OS2__)
|
||||
#include "SDL_config_os2.h"
|
||||
#elif defined(__EMSCRIPTEN__)
|
||||
#include "SDL_config_emscripten.h"
|
||||
#else
|
||||
/* This is a minimal configuration just to get SDL running on new platforms. */
|
||||
#include "SDL_config_minimal.h"
|
||||
#endif /* platform config */
|
||||
|
||||
#ifdef USING_GENERATED_CONFIG_H
|
||||
#error Wrong SDL_config.h, check your include path?
|
||||
#endif
|
||||
|
||||
#endif /* SDL_config_h_ */
|
||||
@@ -1,585 +0,0 @@
|
||||
/*
|
||||
Simple DirectMedia Layer
|
||||
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.
|
||||
*/
|
||||
|
||||
#ifndef SDL_config_h_
|
||||
#define SDL_config_h_
|
||||
|
||||
/**
|
||||
* \file SDL_config.h.in
|
||||
*
|
||||
* This is a set of defines to configure the SDL features
|
||||
*/
|
||||
|
||||
/* General platform specific identifiers */
|
||||
#include "SDL_platform.h"
|
||||
|
||||
/* C language features */
|
||||
#cmakedefine const @HAVE_CONST@
|
||||
#cmakedefine inline @HAVE_INLINE@
|
||||
#cmakedefine volatile @HAVE_VOLATILE@
|
||||
|
||||
/* C datatypes */
|
||||
/* Define SIZEOF_VOIDP for 64/32 architectures */
|
||||
#if defined(__LP64__) || defined(_LP64) || defined(_WIN64)
|
||||
#define SIZEOF_VOIDP 8
|
||||
#else
|
||||
#define SIZEOF_VOIDP 4
|
||||
#endif
|
||||
|
||||
#cmakedefine HAVE_GCC_ATOMICS @HAVE_GCC_ATOMICS@
|
||||
#cmakedefine HAVE_GCC_SYNC_LOCK_TEST_AND_SET @HAVE_GCC_SYNC_LOCK_TEST_AND_SET@
|
||||
|
||||
/* Comment this if you want to build without any C library requirements */
|
||||
#cmakedefine HAVE_LIBC 1
|
||||
#if HAVE_LIBC
|
||||
|
||||
/* Useful headers */
|
||||
#cmakedefine STDC_HEADERS 1
|
||||
#cmakedefine HAVE_ALLOCA_H 1
|
||||
#cmakedefine HAVE_CTYPE_H 1
|
||||
#cmakedefine HAVE_FLOAT_H 1
|
||||
#cmakedefine HAVE_ICONV_H 1
|
||||
#cmakedefine HAVE_INTTYPES_H 1
|
||||
#cmakedefine HAVE_LIMITS_H 1
|
||||
#cmakedefine HAVE_MALLOC_H 1
|
||||
#cmakedefine HAVE_MATH_H 1
|
||||
#cmakedefine HAVE_MEMORY_H 1
|
||||
#cmakedefine HAVE_SIGNAL_H 1
|
||||
#cmakedefine HAVE_STDARG_H 1
|
||||
#cmakedefine HAVE_STDINT_H 1
|
||||
#cmakedefine HAVE_STDIO_H 1
|
||||
#cmakedefine HAVE_STDLIB_H 1
|
||||
#cmakedefine HAVE_STRINGS_H 1
|
||||
#cmakedefine HAVE_STRING_H 1
|
||||
#cmakedefine HAVE_SYS_TYPES_H 1
|
||||
#cmakedefine HAVE_WCHAR_H 1
|
||||
#cmakedefine HAVE_PTHREAD_NP_H 1
|
||||
#cmakedefine HAVE_LIBUNWIND_H 1
|
||||
|
||||
/* C library functions */
|
||||
#cmakedefine HAVE_DLOPEN 1
|
||||
#cmakedefine HAVE_MALLOC 1
|
||||
#cmakedefine HAVE_CALLOC 1
|
||||
#cmakedefine HAVE_REALLOC 1
|
||||
#cmakedefine HAVE_FREE 1
|
||||
#cmakedefine HAVE_ALLOCA 1
|
||||
#ifndef __WIN32__ /* Don't use C runtime versions of these on Windows */
|
||||
#cmakedefine HAVE_GETENV 1
|
||||
#cmakedefine HAVE_SETENV 1
|
||||
#cmakedefine HAVE_PUTENV 1
|
||||
#cmakedefine HAVE_UNSETENV 1
|
||||
#endif
|
||||
#cmakedefine HAVE_QSORT 1
|
||||
#cmakedefine HAVE_ABS 1
|
||||
#cmakedefine HAVE_BCOPY 1
|
||||
#cmakedefine HAVE_MEMSET 1
|
||||
#cmakedefine HAVE_MEMCPY 1
|
||||
#cmakedefine HAVE_MEMMOVE 1
|
||||
#cmakedefine HAVE_MEMCMP 1
|
||||
#cmakedefine HAVE_WCSLEN 1
|
||||
#cmakedefine HAVE_WCSLCPY 1
|
||||
#cmakedefine HAVE_WCSLCAT 1
|
||||
#cmakedefine HAVE__WCSDUP 1
|
||||
#cmakedefine HAVE_WCSDUP 1
|
||||
#cmakedefine HAVE_WCSSTR 1
|
||||
#cmakedefine HAVE_WCSCMP 1
|
||||
#cmakedefine HAVE_WCSNCMP 1
|
||||
#cmakedefine HAVE_WCSCASECMP 1
|
||||
#cmakedefine HAVE__WCSICMP 1
|
||||
#cmakedefine HAVE_WCSNCASECMP 1
|
||||
#cmakedefine HAVE__WCSNICMP 1
|
||||
#cmakedefine HAVE_STRLEN 1
|
||||
#cmakedefine HAVE_STRLCPY 1
|
||||
#cmakedefine HAVE_STRLCAT 1
|
||||
#cmakedefine HAVE__STRREV 1
|
||||
#cmakedefine HAVE__STRUPR 1
|
||||
#cmakedefine HAVE__STRLWR 1
|
||||
#cmakedefine HAVE_INDEX 1
|
||||
#cmakedefine HAVE_RINDEX 1
|
||||
#cmakedefine HAVE_STRCHR 1
|
||||
#cmakedefine HAVE_STRRCHR 1
|
||||
#cmakedefine HAVE_STRSTR 1
|
||||
#cmakedefine HAVE_STRTOK_R 1
|
||||
#cmakedefine HAVE_ITOA 1
|
||||
#cmakedefine HAVE__LTOA 1
|
||||
#cmakedefine HAVE__UITOA 1
|
||||
#cmakedefine HAVE__ULTOA 1
|
||||
#cmakedefine HAVE_STRTOL 1
|
||||
#cmakedefine HAVE_STRTOUL 1
|
||||
#cmakedefine HAVE__I64TOA 1
|
||||
#cmakedefine HAVE__UI64TOA 1
|
||||
#cmakedefine HAVE_STRTOLL 1
|
||||
#cmakedefine HAVE_STRTOULL 1
|
||||
#cmakedefine HAVE_STRTOD 1
|
||||
#cmakedefine HAVE_ATOI 1
|
||||
#cmakedefine HAVE_ATOF 1
|
||||
#cmakedefine HAVE_STRCMP 1
|
||||
#cmakedefine HAVE_STRNCMP 1
|
||||
#cmakedefine HAVE__STRICMP 1
|
||||
#cmakedefine HAVE_STRCASECMP 1
|
||||
#cmakedefine HAVE__STRNICMP 1
|
||||
#cmakedefine HAVE_STRNCASECMP 1
|
||||
#cmakedefine HAVE_SSCANF 1
|
||||
#cmakedefine HAVE_VSSCANF 1
|
||||
#cmakedefine HAVE_VSNPRINTF 1
|
||||
#cmakedefine HAVE_M_PI 1
|
||||
#cmakedefine HAVE_ACOS 1
|
||||
#cmakedefine HAVE_ACOSF 1
|
||||
#cmakedefine HAVE_ASIN 1
|
||||
#cmakedefine HAVE_ASINF 1
|
||||
#cmakedefine HAVE_ATAN 1
|
||||
#cmakedefine HAVE_ATANF 1
|
||||
#cmakedefine HAVE_ATAN2 1
|
||||
#cmakedefine HAVE_ATAN2F 1
|
||||
#cmakedefine HAVE_CEIL 1
|
||||
#cmakedefine HAVE_CEILF 1
|
||||
#cmakedefine HAVE_COPYSIGN 1
|
||||
#cmakedefine HAVE_COPYSIGNF 1
|
||||
#cmakedefine HAVE_COS 1
|
||||
#cmakedefine HAVE_COSF 1
|
||||
#cmakedefine HAVE_EXP 1
|
||||
#cmakedefine HAVE_EXPF 1
|
||||
#cmakedefine HAVE_FABS 1
|
||||
#cmakedefine HAVE_FABSF 1
|
||||
#cmakedefine HAVE_FLOOR 1
|
||||
#cmakedefine HAVE_FLOORF 1
|
||||
#cmakedefine HAVE_FMOD 1
|
||||
#cmakedefine HAVE_FMODF 1
|
||||
#cmakedefine HAVE_LOG 1
|
||||
#cmakedefine HAVE_LOGF 1
|
||||
#cmakedefine HAVE_LOG10 1
|
||||
#cmakedefine HAVE_LOG10F 1
|
||||
#cmakedefine HAVE_LROUND 1
|
||||
#cmakedefine HAVE_LROUNDF 1
|
||||
#cmakedefine HAVE_POW 1
|
||||
#cmakedefine HAVE_POWF 1
|
||||
#cmakedefine HAVE_ROUND 1
|
||||
#cmakedefine HAVE_ROUNDF 1
|
||||
#cmakedefine HAVE_SCALBN 1
|
||||
#cmakedefine HAVE_SCALBNF 1
|
||||
#cmakedefine HAVE_SIN 1
|
||||
#cmakedefine HAVE_SINF 1
|
||||
#cmakedefine HAVE_SQRT 1
|
||||
#cmakedefine HAVE_SQRTF 1
|
||||
#cmakedefine HAVE_TAN 1
|
||||
#cmakedefine HAVE_TANF 1
|
||||
#cmakedefine HAVE_TRUNC 1
|
||||
#cmakedefine HAVE_TRUNCF 1
|
||||
#cmakedefine HAVE_FOPEN64 1
|
||||
#cmakedefine HAVE_FSEEKO 1
|
||||
#cmakedefine HAVE_FSEEKO64 1
|
||||
#cmakedefine HAVE_SIGACTION 1
|
||||
#cmakedefine HAVE_SA_SIGACTION 1
|
||||
#cmakedefine HAVE_SETJMP 1
|
||||
#cmakedefine HAVE_NANOSLEEP 1
|
||||
#cmakedefine HAVE_SYSCONF 1
|
||||
#cmakedefine HAVE_SYSCTLBYNAME 1
|
||||
#cmakedefine HAVE_CLOCK_GETTIME 1
|
||||
#cmakedefine HAVE_GETPAGESIZE 1
|
||||
#cmakedefine HAVE_MPROTECT 1
|
||||
#cmakedefine HAVE_ICONV 1
|
||||
#cmakedefine HAVE_PTHREAD_SETNAME_NP 1
|
||||
#cmakedefine HAVE_PTHREAD_SET_NAME_NP 1
|
||||
#cmakedefine HAVE_SEM_TIMEDWAIT 1
|
||||
#cmakedefine HAVE_GETAUXVAL 1
|
||||
#cmakedefine HAVE_ELF_AUX_INFO 1
|
||||
#cmakedefine HAVE_POLL 1
|
||||
#cmakedefine HAVE__EXIT 1
|
||||
|
||||
#elif defined(__WIN32__)
|
||||
#cmakedefine HAVE_STDARG_H 1
|
||||
#cmakedefine HAVE_STDDEF_H 1
|
||||
#cmakedefine HAVE_FLOAT_H 1
|
||||
|
||||
#else
|
||||
/* We may need some replacement for stdarg.h here */
|
||||
#include <stdarg.h>
|
||||
#endif /* HAVE_LIBC */
|
||||
|
||||
#cmakedefine HAVE_ALTIVEC_H 1
|
||||
#cmakedefine HAVE_DBUS_DBUS_H 1
|
||||
#cmakedefine HAVE_FCITX 1
|
||||
#cmakedefine HAVE_IBUS_IBUS_H 1
|
||||
#cmakedefine HAVE_SYS_INOTIFY_H 1
|
||||
#cmakedefine HAVE_INOTIFY_INIT 1
|
||||
#cmakedefine HAVE_INOTIFY_INIT1 1
|
||||
#cmakedefine HAVE_INOTIFY 1
|
||||
#cmakedefine HAVE_O_CLOEXEC 1
|
||||
|
||||
/* Apple platforms might be building universal binaries, where Intel builds
|
||||
can use immintrin.h but other architectures can't. */
|
||||
#ifdef __APPLE__
|
||||
# if defined(__has_include) && (defined(__i386__) || defined(__x86_64))
|
||||
# if __has_include(<immintrin.h>)
|
||||
# define HAVE_IMMINTRIN_H 1
|
||||
# endif
|
||||
# endif
|
||||
#else /* non-Apple platforms can use the normal CMake check for this. */
|
||||
#cmakedefine HAVE_IMMINTRIN_H 1
|
||||
#endif
|
||||
|
||||
#cmakedefine HAVE_LIBUDEV_H 1
|
||||
#cmakedefine HAVE_LIBSAMPLERATE_H 1
|
||||
#cmakedefine HAVE_LIBDECOR_H 1
|
||||
|
||||
#cmakedefine HAVE_D3D_H @HAVE_D3D_H@
|
||||
#cmakedefine HAVE_D3D11_H @HAVE_D3D11_H@
|
||||
#cmakedefine HAVE_DDRAW_H @HAVE_DDRAW_H@
|
||||
#cmakedefine HAVE_DSOUND_H @HAVE_DSOUND_H@
|
||||
#cmakedefine HAVE_DINPUT_H @HAVE_DINPUT_H@
|
||||
#cmakedefine HAVE_XINPUT_H @HAVE_XINPUT_H@
|
||||
#cmakedefine HAVE_WINDOWS_GAMING_INPUT_H @HAVE_WINDOWS_GAMING_INPUT_H@
|
||||
#cmakedefine HAVE_DXGI_H @HAVE_DXGI_H@
|
||||
|
||||
#cmakedefine HAVE_MMDEVICEAPI_H @HAVE_MMDEVICEAPI_H@
|
||||
#cmakedefine HAVE_AUDIOCLIENT_H @HAVE_AUDIOCLIENT_H@
|
||||
#cmakedefine HAVE_TPCSHRD_H @HAVE_TPCSHRD_H@
|
||||
#cmakedefine HAVE_SENSORSAPI_H @HAVE_SENSORSAPI_H@
|
||||
#cmakedefine HAVE_ROAPI_H @HAVE_ROAPI_H@
|
||||
|
||||
#cmakedefine HAVE_XINPUT_GAMEPAD_EX @HAVE_XINPUT_GAMEPAD_EX@
|
||||
#cmakedefine HAVE_XINPUT_STATE_EX @HAVE_XINPUT_STATE_EX@
|
||||
|
||||
/* SDL internal assertion support */
|
||||
#cmakedefine SDL_DEFAULT_ASSERT_LEVEL @SDL_DEFAULT_ASSERT_LEVEL@
|
||||
|
||||
/* Allow disabling of core subsystems */
|
||||
#cmakedefine SDL_ATOMIC_DISABLED @SDL_ATOMIC_DISABLED@
|
||||
#cmakedefine SDL_AUDIO_DISABLED @SDL_AUDIO_DISABLED@
|
||||
#cmakedefine SDL_CPUINFO_DISABLED @SDL_CPUINFO_DISABLED@
|
||||
#cmakedefine SDL_EVENTS_DISABLED @SDL_EVENTS_DISABLED@
|
||||
#cmakedefine SDL_FILE_DISABLED @SDL_FILE_DISABLED@
|
||||
#cmakedefine SDL_JOYSTICK_DISABLED @SDL_JOYSTICK_DISABLED@
|
||||
#cmakedefine SDL_HAPTIC_DISABLED @SDL_HAPTIC_DISABLED@
|
||||
#cmakedefine SDL_HIDAPI_DISABLED @SDL_HIDAPI_DISABLED@
|
||||
#cmakedefine SDL_SENSOR_DISABLED @SDL_SENSOR_DISABLED@
|
||||
#cmakedefine SDL_LOADSO_DISABLED @SDL_LOADSO_DISABLED@
|
||||
#cmakedefine SDL_RENDER_DISABLED @SDL_RENDER_DISABLED@
|
||||
#cmakedefine SDL_THREADS_DISABLED @SDL_THREADS_DISABLED@
|
||||
#cmakedefine SDL_TIMERS_DISABLED @SDL_TIMERS_DISABLED@
|
||||
#cmakedefine SDL_VIDEO_DISABLED @SDL_VIDEO_DISABLED@
|
||||
#cmakedefine SDL_POWER_DISABLED @SDL_POWER_DISABLED@
|
||||
#cmakedefine SDL_FILESYSTEM_DISABLED @SDL_FILESYSTEM_DISABLED@
|
||||
#cmakedefine SDL_LOCALE_DISABLED @SDL_LOCALE_DISABLED@
|
||||
#cmakedefine SDL_MISC_DISABLED @SDL_MISC_DISABLED@
|
||||
|
||||
/* Enable various audio drivers */
|
||||
#cmakedefine SDL_AUDIO_DRIVER_ALSA @SDL_AUDIO_DRIVER_ALSA@
|
||||
#cmakedefine SDL_AUDIO_DRIVER_ALSA_DYNAMIC @SDL_AUDIO_DRIVER_ALSA_DYNAMIC@
|
||||
#cmakedefine SDL_AUDIO_DRIVER_ANDROID @SDL_AUDIO_DRIVER_ANDROID@
|
||||
#cmakedefine SDL_AUDIO_DRIVER_OPENSLES @SDL_AUDIO_DRIVER_OPENSLES@
|
||||
#cmakedefine SDL_AUDIO_DRIVER_AAUDIO @SDL_AUDIO_DRIVER_AAUDIO@
|
||||
#cmakedefine SDL_AUDIO_DRIVER_ARTS @SDL_AUDIO_DRIVER_ARTS@
|
||||
#cmakedefine SDL_AUDIO_DRIVER_ARTS_DYNAMIC @SDL_AUDIO_DRIVER_ARTS_DYNAMIC@
|
||||
#cmakedefine SDL_AUDIO_DRIVER_COREAUDIO @SDL_AUDIO_DRIVER_COREAUDIO@
|
||||
#cmakedefine SDL_AUDIO_DRIVER_DISK @SDL_AUDIO_DRIVER_DISK@
|
||||
#cmakedefine SDL_AUDIO_DRIVER_DSOUND @SDL_AUDIO_DRIVER_DSOUND@
|
||||
#cmakedefine SDL_AUDIO_DRIVER_DUMMY @SDL_AUDIO_DRIVER_DUMMY@
|
||||
#cmakedefine SDL_AUDIO_DRIVER_EMSCRIPTEN @SDL_AUDIO_DRIVER_EMSCRIPTEN@
|
||||
#cmakedefine SDL_AUDIO_DRIVER_ESD @SDL_AUDIO_DRIVER_ESD@
|
||||
#cmakedefine SDL_AUDIO_DRIVER_ESD_DYNAMIC @SDL_AUDIO_DRIVER_ESD_DYNAMIC@
|
||||
#cmakedefine SDL_AUDIO_DRIVER_FUSIONSOUND @SDL_AUDIO_DRIVER_FUSIONSOUND@
|
||||
#cmakedefine SDL_AUDIO_DRIVER_FUSIONSOUND_DYNAMIC @SDL_AUDIO_DRIVER_FUSIONSOUND_DYNAMIC@
|
||||
#cmakedefine SDL_AUDIO_DRIVER_HAIKU @SDL_AUDIO_DRIVER_HAIKU@
|
||||
#cmakedefine SDL_AUDIO_DRIVER_JACK @SDL_AUDIO_DRIVER_JACK@
|
||||
#cmakedefine SDL_AUDIO_DRIVER_JACK_DYNAMIC @SDL_AUDIO_DRIVER_JACK_DYNAMIC@
|
||||
#cmakedefine SDL_AUDIO_DRIVER_NAS @SDL_AUDIO_DRIVER_NAS@
|
||||
#cmakedefine SDL_AUDIO_DRIVER_NAS_DYNAMIC @SDL_AUDIO_DRIVER_NAS_DYNAMIC@
|
||||
#cmakedefine SDL_AUDIO_DRIVER_NETBSD @SDL_AUDIO_DRIVER_NETBSD@
|
||||
#cmakedefine SDL_AUDIO_DRIVER_OSS @SDL_AUDIO_DRIVER_OSS@
|
||||
#cmakedefine SDL_AUDIO_DRIVER_OSS_SOUNDCARD_H @SDL_AUDIO_DRIVER_OSS_SOUNDCARD_H@
|
||||
#cmakedefine SDL_AUDIO_DRIVER_PAUDIO @SDL_AUDIO_DRIVER_PAUDIO@
|
||||
#cmakedefine SDL_AUDIO_DRIVER_PIPEWIRE @SDL_AUDIO_DRIVER_PIPEWIRE@
|
||||
#cmakedefine SDL_AUDIO_DRIVER_PIPEWIRE_DYNAMIC @SDL_AUDIO_DRIVER_PIPEWIRE_DYNAMIC@
|
||||
#cmakedefine SDL_AUDIO_DRIVER_PULSEAUDIO @SDL_AUDIO_DRIVER_PULSEAUDIO@
|
||||
#cmakedefine SDL_AUDIO_DRIVER_PULSEAUDIO_DYNAMIC @SDL_AUDIO_DRIVER_PULSEAUDIO_DYNAMIC@
|
||||
#cmakedefine SDL_AUDIO_DRIVER_QSA @SDL_AUDIO_DRIVER_QSA@
|
||||
#cmakedefine SDL_AUDIO_DRIVER_SNDIO @SDL_AUDIO_DRIVER_SNDIO@
|
||||
#cmakedefine SDL_AUDIO_DRIVER_SNDIO_DYNAMIC @SDL_AUDIO_DRIVER_SNDIO_DYNAMIC@
|
||||
#cmakedefine SDL_AUDIO_DRIVER_SUNAUDIO @SDL_AUDIO_DRIVER_SUNAUDIO@
|
||||
#cmakedefine SDL_AUDIO_DRIVER_WASAPI @SDL_AUDIO_DRIVER_WASAPI@
|
||||
#cmakedefine SDL_AUDIO_DRIVER_WINMM @SDL_AUDIO_DRIVER_WINMM@
|
||||
#cmakedefine SDL_AUDIO_DRIVER_OS2 @SDL_AUDIO_DRIVER_OS2@
|
||||
#cmakedefine SDL_AUDIO_DRIVER_VITA @SDL_AUDIO_DRIVER_VITA@
|
||||
#cmakedefine SDL_AUDIO_DRIVER_PSP @SDL_AUDIO_DRIVER_PSP@
|
||||
|
||||
/* Enable various input drivers */
|
||||
#cmakedefine SDL_INPUT_LINUXEV @SDL_INPUT_LINUXEV@
|
||||
#cmakedefine SDL_INPUT_LINUXKD @SDL_INPUT_LINUXKD@
|
||||
#cmakedefine SDL_INPUT_FBSDKBIO @SDL_INPUT_FBSDKBIO@
|
||||
#cmakedefine SDL_JOYSTICK_ANDROID @SDL_JOYSTICK_ANDROID@
|
||||
#cmakedefine SDL_JOYSTICK_HAIKU @SDL_JOYSTICK_HAIKU@
|
||||
#cmakedefine SDL_JOYSTICK_WGI @SDL_JOYSTICK_WGI@
|
||||
#cmakedefine SDL_JOYSTICK_DINPUT @SDL_JOYSTICK_DINPUT@
|
||||
#cmakedefine SDL_JOYSTICK_XINPUT @SDL_JOYSTICK_XINPUT@
|
||||
#cmakedefine SDL_JOYSTICK_DUMMY @SDL_JOYSTICK_DUMMY@
|
||||
#cmakedefine SDL_JOYSTICK_IOKIT @SDL_JOYSTICK_IOKIT@
|
||||
#cmakedefine SDL_JOYSTICK_MFI @SDL_JOYSTICK_MFI@
|
||||
#cmakedefine SDL_JOYSTICK_LINUX @SDL_JOYSTICK_LINUX@
|
||||
#cmakedefine SDL_JOYSTICK_OS2 @SDL_JOYSTICK_OS2@
|
||||
#cmakedefine SDL_JOYSTICK_USBHID @SDL_JOYSTICK_USBHID@
|
||||
#cmakedefine SDL_HAVE_MACHINE_JOYSTICK_H @SDL_HAVE_MACHINE_JOYSTICK_H@
|
||||
#cmakedefine SDL_JOYSTICK_HIDAPI @SDL_JOYSTICK_HIDAPI@
|
||||
#cmakedefine SDL_JOYSTICK_RAWINPUT @SDL_JOYSTICK_RAWINPUT@
|
||||
#cmakedefine SDL_JOYSTICK_EMSCRIPTEN @SDL_JOYSTICK_EMSCRIPTEN@
|
||||
#cmakedefine SDL_JOYSTICK_VIRTUAL @SDL_JOYSTICK_VIRTUAL@
|
||||
#cmakedefine SDL_JOYSTICK_VITA @SDL_JOYSTICK_VITA@
|
||||
#cmakedefine SDL_JOYSTICK_PSP @SDL_JOYSTICK_PSP@
|
||||
#cmakedefine SDL_HAPTIC_DUMMY @SDL_HAPTIC_DUMMY@
|
||||
#cmakedefine SDL_HAPTIC_LINUX @SDL_HAPTIC_LINUX@
|
||||
#cmakedefine SDL_HAPTIC_IOKIT @SDL_HAPTIC_IOKIT@
|
||||
#cmakedefine SDL_HAPTIC_DINPUT @SDL_HAPTIC_DINPUT@
|
||||
#cmakedefine SDL_HAPTIC_XINPUT @SDL_HAPTIC_XINPUT@
|
||||
#cmakedefine SDL_HAPTIC_ANDROID @SDL_HAPTIC_ANDROID@
|
||||
#cmakedefine SDL_LIBUSB_DYNAMIC @SDL_LIBUSB_DYNAMIC@
|
||||
|
||||
/* Enable various sensor drivers */
|
||||
#cmakedefine SDL_SENSOR_ANDROID @SDL_SENSOR_ANDROID@
|
||||
#cmakedefine SDL_SENSOR_COREMOTION @SDL_SENSOR_COREMOTION@
|
||||
#cmakedefine SDL_SENSOR_WINDOWS @SDL_SENSOR_WINDOWS@
|
||||
#cmakedefine SDL_SENSOR_DUMMY @SDL_SENSOR_DUMMY@
|
||||
#cmakedefine SDL_SENSOR_VITA @SDL_SENSOR_VITA@
|
||||
|
||||
/* Enable various shared object loading systems */
|
||||
#cmakedefine SDL_LOADSO_DLOPEN @SDL_LOADSO_DLOPEN@
|
||||
#cmakedefine SDL_LOADSO_DUMMY @SDL_LOADSO_DUMMY@
|
||||
#cmakedefine SDL_LOADSO_LDG @SDL_LOADSO_LDG@
|
||||
#cmakedefine SDL_LOADSO_WINDOWS @SDL_LOADSO_WINDOWS@
|
||||
#cmakedefine SDL_LOADSO_OS2 @SDL_LOADSO_OS2@
|
||||
|
||||
/* Enable various threading systems */
|
||||
#cmakedefine SDL_THREAD_GENERIC_COND_SUFFIX @SDL_THREAD_GENERIC_COND_SUFFIX@
|
||||
#cmakedefine SDL_THREAD_PTHREAD @SDL_THREAD_PTHREAD@
|
||||
#cmakedefine SDL_THREAD_PTHREAD_RECURSIVE_MUTEX @SDL_THREAD_PTHREAD_RECURSIVE_MUTEX@
|
||||
#cmakedefine SDL_THREAD_PTHREAD_RECURSIVE_MUTEX_NP @SDL_THREAD_PTHREAD_RECURSIVE_MUTEX_NP@
|
||||
#cmakedefine SDL_THREAD_WINDOWS @SDL_THREAD_WINDOWS@
|
||||
#cmakedefine SDL_THREAD_OS2 @SDL_THREAD_OS2@
|
||||
#cmakedefine SDL_THREAD_VITA @SDL_THREAD_VITA@
|
||||
#cmakedefine SDL_THREAD_PSP @SDL_THREAD_PSP@
|
||||
|
||||
/* Enable various timer systems */
|
||||
#cmakedefine SDL_TIMER_HAIKU @SDL_TIMER_HAIKU@
|
||||
#cmakedefine SDL_TIMER_DUMMY @SDL_TIMER_DUMMY@
|
||||
#cmakedefine SDL_TIMER_UNIX @SDL_TIMER_UNIX@
|
||||
#cmakedefine SDL_TIMER_WINDOWS @SDL_TIMER_WINDOWS@
|
||||
#cmakedefine SDL_TIMER_OS2 @SDL_TIMER_OS2@
|
||||
#cmakedefine SDL_TIMER_VITA @SDL_TIMER_VITA@
|
||||
#cmakedefine SDL_TIMER_PSP @SDL_TIMER_PSP@
|
||||
|
||||
/* Enable various video drivers */
|
||||
#cmakedefine SDL_VIDEO_DRIVER_ANDROID @SDL_VIDEO_DRIVER_ANDROID@
|
||||
#cmakedefine SDL_VIDEO_DRIVER_EMSCRIPTEN @SDL_VIDEO_DRIVER_EMSCRIPTEN@
|
||||
#cmakedefine SDL_VIDEO_DRIVER_HAIKU @SDL_VIDEO_DRIVER_HAIKU@
|
||||
#cmakedefine SDL_VIDEO_DRIVER_COCOA @SDL_VIDEO_DRIVER_COCOA@
|
||||
#cmakedefine SDL_VIDEO_DRIVER_UIKIT @SDL_VIDEO_DRIVER_UIKIT@
|
||||
#cmakedefine SDL_VIDEO_DRIVER_DIRECTFB @SDL_VIDEO_DRIVER_DIRECTFB@
|
||||
#cmakedefine SDL_VIDEO_DRIVER_DIRECTFB_DYNAMIC @SDL_VIDEO_DRIVER_DIRECTFB_DYNAMIC@
|
||||
#cmakedefine SDL_VIDEO_DRIVER_DUMMY @SDL_VIDEO_DRIVER_DUMMY@
|
||||
#cmakedefine SDL_VIDEO_DRIVER_OFFSCREEN @SDL_VIDEO_DRIVER_OFFSCREEN@
|
||||
#cmakedefine SDL_VIDEO_DRIVER_WINDOWS @SDL_VIDEO_DRIVER_WINDOWS@
|
||||
#cmakedefine SDL_VIDEO_DRIVER_WINRT @SDL_VIDEO_DRIVER_WINRT@
|
||||
#cmakedefine SDL_VIDEO_DRIVER_WAYLAND @SDL_VIDEO_DRIVER_WAYLAND@
|
||||
#cmakedefine SDL_VIDEO_DRIVER_RPI @SDL_VIDEO_DRIVER_RPI@
|
||||
#cmakedefine SDL_VIDEO_DRIVER_VIVANTE @SDL_VIDEO_DRIVER_VIVANTE@
|
||||
#cmakedefine SDL_VIDEO_DRIVER_VIVANTE_VDK @SDL_VIDEO_DRIVER_VIVANTE_VDK@
|
||||
#cmakedefine SDL_VIDEO_DRIVER_OS2 @SDL_VIDEO_DRIVER_OS2@
|
||||
#cmakedefine SDL_VIDEO_DRIVER_QNX @SDL_VIDEO_DRIVER_QNX@
|
||||
#cmakedefine SDL_VIDEO_DRIVER_RISCOS @SDL_VIDEO_DRIVER_RISCOS@
|
||||
#cmakedefine SDL_VIDEO_DRIVER_PSP @SDL_VIDEO_DRIVER_PSP@
|
||||
|
||||
#cmakedefine SDL_VIDEO_DRIVER_KMSDRM @SDL_VIDEO_DRIVER_KMSDRM@
|
||||
#cmakedefine SDL_VIDEO_DRIVER_KMSDRM_DYNAMIC @SDL_VIDEO_DRIVER_KMSDRM_DYNAMIC@
|
||||
#cmakedefine SDL_VIDEO_DRIVER_KMSDRM_DYNAMIC_GBM @SDL_VIDEO_DRIVER_KMSDRM_DYNAMIC_GBM@
|
||||
|
||||
#cmakedefine SDL_VIDEO_DRIVER_WAYLAND_QT_TOUCH @SDL_VIDEO_DRIVER_WAYLAND_QT_TOUCH@
|
||||
#cmakedefine SDL_VIDEO_DRIVER_WAYLAND_DYNAMIC @SDL_VIDEO_DRIVER_WAYLAND_DYNAMIC@
|
||||
#cmakedefine SDL_VIDEO_DRIVER_WAYLAND_DYNAMIC_EGL @SDL_VIDEO_DRIVER_WAYLAND_DYNAMIC_EGL@
|
||||
#cmakedefine SDL_VIDEO_DRIVER_WAYLAND_DYNAMIC_CURSOR @SDL_VIDEO_DRIVER_WAYLAND_DYNAMIC_CURSOR@
|
||||
#cmakedefine SDL_VIDEO_DRIVER_WAYLAND_DYNAMIC_XKBCOMMON @SDL_VIDEO_DRIVER_WAYLAND_DYNAMIC_XKBCOMMON@
|
||||
#cmakedefine SDL_VIDEO_DRIVER_WAYLAND_DYNAMIC_LIBDECOR @SDL_VIDEO_DRIVER_WAYLAND_DYNAMIC_LIBDECOR@
|
||||
|
||||
#cmakedefine SDL_VIDEO_DRIVER_X11 @SDL_VIDEO_DRIVER_X11@
|
||||
#cmakedefine SDL_VIDEO_DRIVER_X11_DYNAMIC @SDL_VIDEO_DRIVER_X11_DYNAMIC@
|
||||
#cmakedefine SDL_VIDEO_DRIVER_X11_DYNAMIC_XEXT @SDL_VIDEO_DRIVER_X11_DYNAMIC_XEXT@
|
||||
#cmakedefine SDL_VIDEO_DRIVER_X11_DYNAMIC_XCURSOR @SDL_VIDEO_DRIVER_X11_DYNAMIC_XCURSOR@
|
||||
#cmakedefine SDL_VIDEO_DRIVER_X11_DYNAMIC_XINERAMA @SDL_VIDEO_DRIVER_X11_DYNAMIC_XINERAMA@
|
||||
#cmakedefine SDL_VIDEO_DRIVER_X11_DYNAMIC_XINPUT2 @SDL_VIDEO_DRIVER_X11_DYNAMIC_XINPUT2@
|
||||
#cmakedefine SDL_VIDEO_DRIVER_X11_DYNAMIC_XFIXES @SDL_VIDEO_DRIVER_X11_DYNAMIC_XFIXES@
|
||||
#cmakedefine SDL_VIDEO_DRIVER_X11_DYNAMIC_XRANDR @SDL_VIDEO_DRIVER_X11_DYNAMIC_XRANDR@
|
||||
#cmakedefine SDL_VIDEO_DRIVER_X11_DYNAMIC_XSS @SDL_VIDEO_DRIVER_X11_DYNAMIC_XSS@
|
||||
#cmakedefine SDL_VIDEO_DRIVER_X11_DYNAMIC_XVIDMODE @SDL_VIDEO_DRIVER_X11_DYNAMIC_XVIDMODE@
|
||||
#cmakedefine SDL_VIDEO_DRIVER_X11_XCURSOR @SDL_VIDEO_DRIVER_X11_XCURSOR@
|
||||
#cmakedefine SDL_VIDEO_DRIVER_X11_XDBE @SDL_VIDEO_DRIVER_X11_XDBE@
|
||||
#cmakedefine SDL_VIDEO_DRIVER_X11_XINERAMA @SDL_VIDEO_DRIVER_X11_XINERAMA@
|
||||
#cmakedefine SDL_VIDEO_DRIVER_X11_XINPUT2 @SDL_VIDEO_DRIVER_X11_XINPUT2@
|
||||
#cmakedefine SDL_VIDEO_DRIVER_X11_XINPUT2_SUPPORTS_MULTITOUCH @SDL_VIDEO_DRIVER_X11_XINPUT2_SUPPORTS_MULTITOUCH@
|
||||
#cmakedefine SDL_VIDEO_DRIVER_X11_XFIXES @SDL_VIDEO_DRIVER_X11_XFIXES@
|
||||
#cmakedefine SDL_VIDEO_DRIVER_X11_XRANDR @SDL_VIDEO_DRIVER_X11_XRANDR@
|
||||
#cmakedefine SDL_VIDEO_DRIVER_X11_XSCRNSAVER @SDL_VIDEO_DRIVER_X11_XSCRNSAVER@
|
||||
#cmakedefine SDL_VIDEO_DRIVER_X11_XSHAPE @SDL_VIDEO_DRIVER_X11_XSHAPE@
|
||||
#cmakedefine SDL_VIDEO_DRIVER_X11_XVIDMODE @SDL_VIDEO_DRIVER_X11_XVIDMODE@
|
||||
#cmakedefine SDL_VIDEO_DRIVER_X11_SUPPORTS_GENERIC_EVENTS @SDL_VIDEO_DRIVER_X11_SUPPORTS_GENERIC_EVENTS@
|
||||
#cmakedefine SDL_VIDEO_DRIVER_X11_HAS_XKBKEYCODETOKEYSYM @SDL_VIDEO_DRIVER_X11_HAS_XKBKEYCODETOKEYSYM@
|
||||
#cmakedefine SDL_VIDEO_DRIVER_VITA @SDL_VIDEO_DRIVER_VITA@
|
||||
|
||||
#cmakedefine SDL_VIDEO_RENDER_D3D @SDL_VIDEO_RENDER_D3D@
|
||||
#cmakedefine SDL_VIDEO_RENDER_D3D11 @SDL_VIDEO_RENDER_D3D11@
|
||||
#cmakedefine SDL_VIDEO_RENDER_OGL @SDL_VIDEO_RENDER_OGL@
|
||||
#cmakedefine SDL_VIDEO_RENDER_OGL_ES @SDL_VIDEO_RENDER_OGL_ES@
|
||||
#cmakedefine SDL_VIDEO_RENDER_OGL_ES2 @SDL_VIDEO_RENDER_OGL_ES2@
|
||||
#cmakedefine SDL_VIDEO_RENDER_DIRECTFB @SDL_VIDEO_RENDER_DIRECTFB@
|
||||
#cmakedefine SDL_VIDEO_RENDER_METAL @SDL_VIDEO_RENDER_METAL@
|
||||
#cmakedefine SDL_VIDEO_RENDER_VITA_GXM @SDL_VIDEO_RENDER_VITA_GXM@
|
||||
#cmakedefine SDL_VIDEO_RENDER_PSP @SDL_VIDEO_RENDER_PSP@
|
||||
|
||||
/* Enable OpenGL support */
|
||||
#cmakedefine SDL_VIDEO_OPENGL @SDL_VIDEO_OPENGL@
|
||||
#cmakedefine SDL_VIDEO_OPENGL_ES @SDL_VIDEO_OPENGL_ES@
|
||||
#cmakedefine SDL_VIDEO_OPENGL_ES2 @SDL_VIDEO_OPENGL_ES2@
|
||||
#cmakedefine SDL_VIDEO_OPENGL_BGL @SDL_VIDEO_OPENGL_BGL@
|
||||
#cmakedefine SDL_VIDEO_OPENGL_CGL @SDL_VIDEO_OPENGL_CGL@
|
||||
#cmakedefine SDL_VIDEO_OPENGL_GLX @SDL_VIDEO_OPENGL_GLX@
|
||||
#cmakedefine SDL_VIDEO_OPENGL_WGL @SDL_VIDEO_OPENGL_WGL@
|
||||
#cmakedefine SDL_VIDEO_OPENGL_EGL @SDL_VIDEO_OPENGL_EGL@
|
||||
#cmakedefine SDL_VIDEO_OPENGL_OSMESA @SDL_VIDEO_OPENGL_OSMESA@
|
||||
#cmakedefine SDL_VIDEO_OPENGL_OSMESA_DYNAMIC @SDL_VIDEO_OPENGL_OSMESA_DYNAMIC@
|
||||
|
||||
/* Enable Vulkan support */
|
||||
#cmakedefine SDL_VIDEO_VULKAN @SDL_VIDEO_VULKAN@
|
||||
|
||||
/* Enable Metal support */
|
||||
#cmakedefine SDL_VIDEO_METAL @SDL_VIDEO_METAL@
|
||||
|
||||
/* Enable system power support */
|
||||
#cmakedefine SDL_POWER_ANDROID @SDL_POWER_ANDROID@
|
||||
#cmakedefine SDL_POWER_LINUX @SDL_POWER_LINUX@
|
||||
#cmakedefine SDL_POWER_WINDOWS @SDL_POWER_WINDOWS@
|
||||
#cmakedefine SDL_POWER_WINRT @SDL_POWER_WINRT@
|
||||
#cmakedefine SDL_POWER_MACOSX @SDL_POWER_MACOSX@
|
||||
#cmakedefine SDL_POWER_UIKIT @SDL_POWER_UIKIT@
|
||||
#cmakedefine SDL_POWER_HAIKU @SDL_POWER_HAIKU@
|
||||
#cmakedefine SDL_POWER_EMSCRIPTEN @SDL_POWER_EMSCRIPTEN@
|
||||
#cmakedefine SDL_POWER_HARDWIRED @SDL_POWER_HARDWIRED@
|
||||
#cmakedefine SDL_POWER_VITA @SDL_POWER_VITA@
|
||||
#cmakedefine SDL_POWER_PSP @SDL_POWER_PSP@
|
||||
|
||||
/* Enable system filesystem support */
|
||||
#cmakedefine SDL_FILESYSTEM_ANDROID @SDL_FILESYSTEM_ANDROID@
|
||||
#cmakedefine SDL_FILESYSTEM_HAIKU @SDL_FILESYSTEM_HAIKU@
|
||||
#cmakedefine SDL_FILESYSTEM_COCOA @SDL_FILESYSTEM_COCOA@
|
||||
#cmakedefine SDL_FILESYSTEM_DUMMY @SDL_FILESYSTEM_DUMMY@
|
||||
#cmakedefine SDL_FILESYSTEM_RISCOS @SDL_FILESYSTEM_RISCOS@
|
||||
#cmakedefine SDL_FILESYSTEM_UNIX @SDL_FILESYSTEM_UNIX@
|
||||
#cmakedefine SDL_FILESYSTEM_WINDOWS @SDL_FILESYSTEM_WINDOWS@
|
||||
#cmakedefine SDL_FILESYSTEM_EMSCRIPTEN @SDL_FILESYSTEM_EMSCRIPTEN@
|
||||
#cmakedefine SDL_FILESYSTEM_OS2 @SDL_FILESYSTEM_OS2@
|
||||
#cmakedefine SDL_FILESYSTEM_VITA @SDL_FILESYSTEM_VITA@
|
||||
#cmakedefine SDL_FILESYSTEM_PSP @SDL_FILESYSTEM_PSP@
|
||||
|
||||
/* Enable misc subsystem */
|
||||
#cmakedefine SDL_MISC_DUMMY @SDL_MISC_DUMMY@
|
||||
|
||||
/* Enable locale subsystem */
|
||||
#cmakedefine SDL_LOCALE_DUMMY @SDL_LOCALE_DUMMY@
|
||||
|
||||
/* Enable assembly routines */
|
||||
#cmakedefine SDL_ASSEMBLY_ROUTINES @SDL_ASSEMBLY_ROUTINES@
|
||||
#cmakedefine SDL_ALTIVEC_BLITTERS @SDL_ALTIVEC_BLITTERS@
|
||||
#cmakedefine SDL_ARM_SIMD_BLITTERS @SDL_ARM_SIMD_BLITTERS@
|
||||
#cmakedefine SDL_ARM_NEON_BLITTERS @SDL_ARM_NEON_BLITTERS@
|
||||
|
||||
/* Whether SDL_DYNAMIC_API needs dlopen */
|
||||
#cmakedefine DYNAPI_NEEDS_DLOPEN @DYNAPI_NEEDS_DLOPEN@
|
||||
|
||||
/* Enable dynamic libsamplerate support */
|
||||
#cmakedefine SDL_LIBSAMPLERATE_DYNAMIC @SDL_LIBSAMPLERATE_DYNAMIC@
|
||||
|
||||
/* Enable ime support */
|
||||
#cmakedefine SDL_USE_IME @SDL_USE_IME@
|
||||
|
||||
/* Platform specific definitions */
|
||||
#cmakedefine SDL_IPHONE_KEYBOARD @SDL_IPHONE_KEYBOARD@
|
||||
#cmakedefine SDL_IPHONE_LAUNCHSCREEN @SDL_IPHONE_LAUNCHSCREEN@
|
||||
|
||||
#cmakedefine SDL_VIDEO_VITA_PIB @SDL_VIDEO_VITA_PIB@
|
||||
#cmakedefine SDL_VIDEO_VITA_PVR @SDL_VIDEO_VITA_PVR@
|
||||
#cmakedefine SDL_VIDEO_VITA_PVR_OGL @SDL_VIDEO_VITA_PVR_OGL@
|
||||
|
||||
#if !defined(__WIN32__) && !defined(__WINRT__)
|
||||
# if !defined(_STDINT_H_) && !defined(_STDINT_H) && !defined(HAVE_STDINT_H) && !defined(_HAVE_STDINT_H)
|
||||
typedef unsigned int size_t;
|
||||
typedef signed char int8_t;
|
||||
typedef unsigned char uint8_t;
|
||||
typedef signed short int16_t;
|
||||
typedef unsigned short uint16_t;
|
||||
typedef signed int int32_t;
|
||||
typedef unsigned int uint32_t;
|
||||
typedef signed long long int64_t;
|
||||
typedef unsigned long long uint64_t;
|
||||
typedef unsigned long uintptr_t;
|
||||
# endif /* if (stdint.h isn't available) */
|
||||
#else /* __WIN32__ */
|
||||
# if !defined(_STDINT_H_) && !defined(HAVE_STDINT_H) && !defined(_HAVE_STDINT_H)
|
||||
# if defined(__GNUC__) || defined(__DMC__) || defined(__WATCOMC__) || defined(__BORLANDC__) || defined(__CODEGEARC__)
|
||||
#define HAVE_STDINT_H 1
|
||||
# elif defined(_MSC_VER)
|
||||
typedef signed __int8 int8_t;
|
||||
typedef unsigned __int8 uint8_t;
|
||||
typedef signed __int16 int16_t;
|
||||
typedef unsigned __int16 uint16_t;
|
||||
typedef signed __int32 int32_t;
|
||||
typedef unsigned __int32 uint32_t;
|
||||
typedef signed __int64 int64_t;
|
||||
typedef unsigned __int64 uint64_t;
|
||||
# ifndef _UINTPTR_T_DEFINED
|
||||
# ifdef _WIN64
|
||||
typedef unsigned __int64 uintptr_t;
|
||||
# else
|
||||
typedef unsigned int uintptr_t;
|
||||
# endif
|
||||
#define _UINTPTR_T_DEFINED
|
||||
# endif
|
||||
/* Older Visual C++ headers don't have the Win64-compatible typedefs... */
|
||||
# if ((_MSC_VER <= 1200) && (!defined(DWORD_PTR)))
|
||||
#define DWORD_PTR DWORD
|
||||
# endif
|
||||
# if ((_MSC_VER <= 1200) && (!defined(LONG_PTR)))
|
||||
#define LONG_PTR LONG
|
||||
# endif
|
||||
# else /* !__GNUC__ && !_MSC_VER */
|
||||
typedef signed char int8_t;
|
||||
typedef unsigned char uint8_t;
|
||||
typedef signed short int16_t;
|
||||
typedef unsigned short uint16_t;
|
||||
typedef signed int int32_t;
|
||||
typedef unsigned int uint32_t;
|
||||
typedef signed long long int64_t;
|
||||
typedef unsigned long long uint64_t;
|
||||
# ifndef _SIZE_T_DEFINED_
|
||||
#define _SIZE_T_DEFINED_
|
||||
typedef unsigned int size_t;
|
||||
# endif
|
||||
typedef unsigned int uintptr_t;
|
||||
# endif /* __GNUC__ || _MSC_VER */
|
||||
# endif /* !_STDINT_H_ && !HAVE_STDINT_H */
|
||||
#endif /* __WIN32__ */
|
||||
|
||||
#endif /* SDL_config_h_ */
|
||||
@@ -1,491 +0,0 @@
|
||||
/*
|
||||
Simple DirectMedia Layer
|
||||
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.
|
||||
*/
|
||||
|
||||
#ifndef SDL_config_h_
|
||||
#define SDL_config_h_
|
||||
|
||||
/**
|
||||
* \file SDL_config.h.in
|
||||
*
|
||||
* This is a set of defines to configure the SDL features
|
||||
*/
|
||||
|
||||
/* General platform specific identifiers */
|
||||
#include "SDL_platform.h"
|
||||
|
||||
/* Make sure that this isn't included by Visual C++ */
|
||||
#ifdef _MSC_VER
|
||||
#error You should run git checkout -f include/SDL_config.h
|
||||
#endif
|
||||
|
||||
/* C language features */
|
||||
#undef const
|
||||
#undef inline
|
||||
#undef volatile
|
||||
|
||||
/* C datatypes */
|
||||
#if defined(__LP64__) || defined(_LP64) || defined(_WIN64)
|
||||
#define SIZEOF_VOIDP 8
|
||||
#else
|
||||
#define SIZEOF_VOIDP 4
|
||||
#endif
|
||||
|
||||
#undef HAVE_GCC_ATOMICS
|
||||
#undef HAVE_GCC_SYNC_LOCK_TEST_AND_SET
|
||||
|
||||
/* Comment this if you want to build without any C library requirements */
|
||||
#undef HAVE_LIBC
|
||||
#if HAVE_LIBC
|
||||
|
||||
/* Useful headers */
|
||||
#undef STDC_HEADERS
|
||||
#undef HAVE_ALLOCA_H
|
||||
#undef HAVE_CTYPE_H
|
||||
#undef HAVE_FLOAT_H
|
||||
#undef HAVE_ICONV_H
|
||||
#undef HAVE_INTTYPES_H
|
||||
#undef HAVE_LIMITS_H
|
||||
#undef HAVE_MALLOC_H
|
||||
#undef HAVE_MATH_H
|
||||
#undef HAVE_MEMORY_H
|
||||
#undef HAVE_SIGNAL_H
|
||||
#undef HAVE_STDARG_H
|
||||
#undef HAVE_STDINT_H
|
||||
#undef HAVE_STDIO_H
|
||||
#undef HAVE_STDLIB_H
|
||||
#undef HAVE_STRINGS_H
|
||||
#undef HAVE_STRING_H
|
||||
#undef HAVE_SYS_TYPES_H
|
||||
#undef HAVE_WCHAR_H
|
||||
#undef HAVE_PTHREAD_NP_H
|
||||
#undef HAVE_LIBUNWIND_H
|
||||
|
||||
/* C library functions */
|
||||
#undef HAVE_DLOPEN
|
||||
#undef HAVE_MALLOC
|
||||
#undef HAVE_CALLOC
|
||||
#undef HAVE_REALLOC
|
||||
#undef HAVE_FREE
|
||||
#undef HAVE_ALLOCA
|
||||
#ifndef __WIN32__ /* Don't use C runtime versions of these on Windows */
|
||||
#undef HAVE_GETENV
|
||||
#undef HAVE_SETENV
|
||||
#undef HAVE_PUTENV
|
||||
#undef HAVE_UNSETENV
|
||||
#endif
|
||||
#undef HAVE_QSORT
|
||||
#undef HAVE_ABS
|
||||
#undef HAVE_BCOPY
|
||||
#undef HAVE_MEMSET
|
||||
#undef HAVE_MEMCPY
|
||||
#undef HAVE_MEMMOVE
|
||||
#undef HAVE_MEMCMP
|
||||
#undef HAVE_WCSLEN
|
||||
#undef HAVE_WCSLCPY
|
||||
#undef HAVE_WCSLCAT
|
||||
#undef HAVE__WCSDUP
|
||||
#undef HAVE_WCSDUP
|
||||
#undef HAVE_WCSSTR
|
||||
#undef HAVE_WCSCMP
|
||||
#undef HAVE_WCSNCMP
|
||||
#undef HAVE_WCSCASECMP
|
||||
#undef HAVE__WCSICMP
|
||||
#undef HAVE_WCSNCASECMP
|
||||
#undef HAVE__WCSNICMP
|
||||
#undef HAVE_STRLEN
|
||||
#undef HAVE_STRLCPY
|
||||
#undef HAVE_STRLCAT
|
||||
#undef HAVE__STRREV
|
||||
#undef HAVE__STRUPR
|
||||
#undef HAVE__STRLWR
|
||||
#undef HAVE_INDEX
|
||||
#undef HAVE_RINDEX
|
||||
#undef HAVE_STRCHR
|
||||
#undef HAVE_STRRCHR
|
||||
#undef HAVE_STRSTR
|
||||
#undef HAVE_STRTOK_R
|
||||
#undef HAVE_ITOA
|
||||
#undef HAVE__LTOA
|
||||
#undef HAVE__UITOA
|
||||
#undef HAVE__ULTOA
|
||||
#undef HAVE_STRTOL
|
||||
#undef HAVE_STRTOUL
|
||||
#undef HAVE__I64TOA
|
||||
#undef HAVE__UI64TOA
|
||||
#undef HAVE_STRTOLL
|
||||
#undef HAVE_STRTOULL
|
||||
#undef HAVE_STRTOD
|
||||
#undef HAVE_ATOI
|
||||
#undef HAVE_ATOF
|
||||
#undef HAVE_STRCMP
|
||||
#undef HAVE_STRNCMP
|
||||
#undef HAVE__STRICMP
|
||||
#undef HAVE_STRCASECMP
|
||||
#undef HAVE__STRNICMP
|
||||
#undef HAVE_STRNCASECMP
|
||||
#undef HAVE_SSCANF
|
||||
#undef HAVE_VSSCANF
|
||||
#undef HAVE_SNPRINTF
|
||||
#undef HAVE_VSNPRINTF
|
||||
#undef HAVE_M_PI
|
||||
#undef HAVE_ACOS
|
||||
#undef HAVE_ACOSF
|
||||
#undef HAVE_ASIN
|
||||
#undef HAVE_ASINF
|
||||
#undef HAVE_ATAN
|
||||
#undef HAVE_ATANF
|
||||
#undef HAVE_ATAN2
|
||||
#undef HAVE_ATAN2F
|
||||
#undef HAVE_CEIL
|
||||
#undef HAVE_CEILF
|
||||
#undef HAVE_COPYSIGN
|
||||
#undef HAVE_COPYSIGNF
|
||||
#undef HAVE_COS
|
||||
#undef HAVE_COSF
|
||||
#undef HAVE_EXP
|
||||
#undef HAVE_EXPF
|
||||
#undef HAVE_FABS
|
||||
#undef HAVE_FABSF
|
||||
#undef HAVE_FLOOR
|
||||
#undef HAVE_FLOORF
|
||||
#undef HAVE_FMOD
|
||||
#undef HAVE_FMODF
|
||||
#undef HAVE_LOG
|
||||
#undef HAVE_LOGF
|
||||
#undef HAVE_LOG10
|
||||
#undef HAVE_LOG10F
|
||||
#undef HAVE_LROUND
|
||||
#undef HAVE_LROUNDF
|
||||
#undef HAVE_POW
|
||||
#undef HAVE_POWF
|
||||
#undef HAVE_ROUND
|
||||
#undef HAVE_ROUNDF
|
||||
#undef HAVE_SCALBN
|
||||
#undef HAVE_SCALBNF
|
||||
#undef HAVE_SIN
|
||||
#undef HAVE_SINF
|
||||
#undef HAVE_SQRT
|
||||
#undef HAVE_SQRTF
|
||||
#undef HAVE_TAN
|
||||
#undef HAVE_TANF
|
||||
#undef HAVE_TRUNC
|
||||
#undef HAVE_TRUNCF
|
||||
#undef HAVE_FOPEN64
|
||||
#undef HAVE_FSEEKO
|
||||
#undef HAVE_FSEEKO64
|
||||
#undef HAVE_SIGACTION
|
||||
#undef HAVE_SA_SIGACTION
|
||||
#undef HAVE_SETJMP
|
||||
#undef HAVE_NANOSLEEP
|
||||
#undef HAVE_SYSCONF
|
||||
#undef HAVE_SYSCTLBYNAME
|
||||
#undef HAVE_CLOCK_GETTIME
|
||||
#undef HAVE_GETPAGESIZE
|
||||
#undef HAVE_MPROTECT
|
||||
#undef HAVE_ICONV
|
||||
#undef HAVE_PTHREAD_SETNAME_NP
|
||||
#undef HAVE_PTHREAD_SET_NAME_NP
|
||||
#undef HAVE_SEM_TIMEDWAIT
|
||||
#undef HAVE_GETAUXVAL
|
||||
#undef HAVE_ELF_AUX_INFO
|
||||
#undef HAVE_POLL
|
||||
#undef HAVE__EXIT
|
||||
|
||||
#else
|
||||
#define HAVE_STDARG_H 1
|
||||
#define HAVE_STDDEF_H 1
|
||||
#define HAVE_STDINT_H 1
|
||||
#endif /* HAVE_LIBC */
|
||||
|
||||
#undef HAVE_O_CLOEXEC
|
||||
#undef HAVE_ALTIVEC_H
|
||||
#undef HAVE_DBUS_DBUS_H
|
||||
#undef HAVE_FCITX
|
||||
#undef HAVE_SYS_INOTIFY_H
|
||||
#undef HAVE_INOTIFY_INIT
|
||||
#undef HAVE_INOTIFY_INIT1
|
||||
#undef HAVE_INOTIFY
|
||||
#undef HAVE_IBUS_IBUS_H
|
||||
#undef HAVE_IMMINTRIN_H
|
||||
#undef HAVE_LIBUDEV_H
|
||||
#undef HAVE_LIBSAMPLERATE_H
|
||||
#undef HAVE_LIBDECOR_H
|
||||
|
||||
#undef HAVE_DDRAW_H
|
||||
#undef HAVE_DINPUT_H
|
||||
#undef HAVE_DSOUND_H
|
||||
#undef HAVE_DXGI_H
|
||||
#undef HAVE_WINDOWS_GAMING_INPUT_H
|
||||
#undef HAVE_XINPUT_H
|
||||
#undef HAVE_XINPUT_GAMEPAD_EX
|
||||
#undef HAVE_XINPUT_STATE_EX
|
||||
|
||||
#undef HAVE_MMDEVICEAPI_H
|
||||
#undef HAVE_AUDIOCLIENT_H
|
||||
#undef HAVE_TPCSHRD_H
|
||||
#undef HAVE_SENSORSAPI_H
|
||||
#undef HAVE_ROAPI_H
|
||||
|
||||
/* SDL internal assertion support */
|
||||
#undef SDL_DEFAULT_ASSERT_LEVEL
|
||||
|
||||
/* Allow disabling of core subsystems */
|
||||
#undef SDL_ATOMIC_DISABLED
|
||||
#undef SDL_AUDIO_DISABLED
|
||||
#undef SDL_CPUINFO_DISABLED
|
||||
#undef SDL_EVENTS_DISABLED
|
||||
#undef SDL_FILE_DISABLED
|
||||
#undef SDL_JOYSTICK_DISABLED
|
||||
#undef SDL_HAPTIC_DISABLED
|
||||
#undef SDL_HIDAPI_DISABLED
|
||||
#undef SDL_SENSOR_DISABLED
|
||||
#undef SDL_LOADSO_DISABLED
|
||||
#undef SDL_RENDER_DISABLED
|
||||
#undef SDL_THREADS_DISABLED
|
||||
#undef SDL_TIMERS_DISABLED
|
||||
#undef SDL_VIDEO_DISABLED
|
||||
#undef SDL_POWER_DISABLED
|
||||
#undef SDL_FILESYSTEM_DISABLED
|
||||
#undef SDL_LOCALE_DISABLED
|
||||
#undef SDL_MISC_DISABLED
|
||||
|
||||
/* Enable various audio drivers */
|
||||
#undef SDL_AUDIO_DRIVER_AAUDIO
|
||||
#undef SDL_AUDIO_DRIVER_ALSA
|
||||
#undef SDL_AUDIO_DRIVER_ALSA_DYNAMIC
|
||||
#undef SDL_AUDIO_DRIVER_ANDROID
|
||||
#undef SDL_AUDIO_DRIVER_ARTS
|
||||
#undef SDL_AUDIO_DRIVER_ARTS_DYNAMIC
|
||||
#undef SDL_AUDIO_DRIVER_COREAUDIO
|
||||
#undef SDL_AUDIO_DRIVER_DISK
|
||||
#undef SDL_AUDIO_DRIVER_DSOUND
|
||||
#undef SDL_AUDIO_DRIVER_DUMMY
|
||||
#undef SDL_AUDIO_DRIVER_EMSCRIPTEN
|
||||
#undef SDL_AUDIO_DRIVER_ESD
|
||||
#undef SDL_AUDIO_DRIVER_ESD_DYNAMIC
|
||||
#undef SDL_AUDIO_DRIVER_FUSIONSOUND
|
||||
#undef SDL_AUDIO_DRIVER_FUSIONSOUND_DYNAMIC
|
||||
#undef SDL_AUDIO_DRIVER_HAIKU
|
||||
#undef SDL_AUDIO_DRIVER_JACK
|
||||
#undef SDL_AUDIO_DRIVER_JACK_DYNAMIC
|
||||
#undef SDL_AUDIO_DRIVER_NACL
|
||||
#undef SDL_AUDIO_DRIVER_NAS
|
||||
#undef SDL_AUDIO_DRIVER_NAS_DYNAMIC
|
||||
#undef SDL_AUDIO_DRIVER_NETBSD
|
||||
#undef SDL_AUDIO_DRIVER_OPENSLES
|
||||
#undef SDL_AUDIO_DRIVER_OSS
|
||||
#undef SDL_AUDIO_DRIVER_OSS_SOUNDCARD_H
|
||||
#undef SDL_AUDIO_DRIVER_PAUDIO
|
||||
#undef SDL_AUDIO_DRIVER_PIPEWIRE
|
||||
#undef SDL_AUDIO_DRIVER_PIPEWIRE_DYNAMIC
|
||||
#undef SDL_AUDIO_DRIVER_PULSEAUDIO
|
||||
#undef SDL_AUDIO_DRIVER_PULSEAUDIO_DYNAMIC
|
||||
#undef SDL_AUDIO_DRIVER_QSA
|
||||
#undef SDL_AUDIO_DRIVER_SNDIO
|
||||
#undef SDL_AUDIO_DRIVER_SNDIO_DYNAMIC
|
||||
#undef SDL_AUDIO_DRIVER_SUNAUDIO
|
||||
#undef SDL_AUDIO_DRIVER_WASAPI
|
||||
#undef SDL_AUDIO_DRIVER_WINMM
|
||||
#undef SDL_AUDIO_DRIVER_OS2
|
||||
|
||||
/* Enable various input drivers */
|
||||
#undef SDL_INPUT_LINUXEV
|
||||
#undef SDL_INPUT_FBSDKBIO
|
||||
#undef SDL_INPUT_LINUXKD
|
||||
#undef SDL_INPUT_WSCONS
|
||||
#undef SDL_JOYSTICK_HAIKU
|
||||
#undef SDL_JOYSTICK_DINPUT
|
||||
#undef SDL_JOYSTICK_WGI
|
||||
#undef SDL_JOYSTICK_XINPUT
|
||||
#undef SDL_JOYSTICK_DUMMY
|
||||
#undef SDL_JOYSTICK_IOKIT
|
||||
#undef SDL_JOYSTICK_MFI
|
||||
#undef SDL_JOYSTICK_LINUX
|
||||
#undef SDL_JOYSTICK_ANDROID
|
||||
#undef SDL_JOYSTICK_OS2
|
||||
#undef SDL_JOYSTICK_USBHID
|
||||
#undef SDL_HAVE_MACHINE_JOYSTICK_H
|
||||
#undef SDL_JOYSTICK_HIDAPI
|
||||
#undef SDL_JOYSTICK_RAWINPUT
|
||||
#undef SDL_JOYSTICK_EMSCRIPTEN
|
||||
#undef SDL_JOYSTICK_VIRTUAL
|
||||
#undef SDL_HAPTIC_DUMMY
|
||||
#undef SDL_HAPTIC_ANDROID
|
||||
#undef SDL_HAPTIC_LINUX
|
||||
#undef SDL_HAPTIC_IOKIT
|
||||
#undef SDL_HAPTIC_DINPUT
|
||||
#undef SDL_HAPTIC_XINPUT
|
||||
|
||||
/* Enable various sensor drivers */
|
||||
#undef SDL_SENSOR_ANDROID
|
||||
#undef SDL_SENSOR_COREMOTION
|
||||
#undef SDL_SENSOR_WINDOWS
|
||||
#undef SDL_SENSOR_DUMMY
|
||||
|
||||
/* Enable various shared object loading systems */
|
||||
#undef SDL_LOADSO_DLOPEN
|
||||
#undef SDL_LOADSO_DUMMY
|
||||
#undef SDL_LOADSO_LDG
|
||||
#undef SDL_LOADSO_WINDOWS
|
||||
#undef SDL_LOADSO_OS2
|
||||
|
||||
/* Enable various threading systems */
|
||||
#undef SDL_THREAD_GENERIC_COND_SUFFIX
|
||||
#undef SDL_THREAD_PTHREAD
|
||||
#undef SDL_THREAD_PTHREAD_RECURSIVE_MUTEX
|
||||
#undef SDL_THREAD_PTHREAD_RECURSIVE_MUTEX_NP
|
||||
#undef SDL_THREAD_WINDOWS
|
||||
#undef SDL_THREAD_OS2
|
||||
|
||||
/* Enable various timer systems */
|
||||
#undef SDL_TIMER_HAIKU
|
||||
#undef SDL_TIMER_DUMMY
|
||||
#undef SDL_TIMER_UNIX
|
||||
#undef SDL_TIMER_WINDOWS
|
||||
#undef SDL_TIMER_OS2
|
||||
|
||||
/* Enable various video drivers */
|
||||
#undef SDL_VIDEO_DRIVER_HAIKU
|
||||
#undef SDL_VIDEO_DRIVER_COCOA
|
||||
#undef SDL_VIDEO_DRIVER_DIRECTFB
|
||||
#undef SDL_VIDEO_DRIVER_DIRECTFB_DYNAMIC
|
||||
#undef SDL_VIDEO_DRIVER_DUMMY
|
||||
#undef SDL_VIDEO_DRIVER_WINDOWS
|
||||
#undef SDL_VIDEO_DRIVER_WAYLAND
|
||||
#undef SDL_VIDEO_DRIVER_WAYLAND_QT_TOUCH
|
||||
#undef SDL_VIDEO_DRIVER_WAYLAND_DYNAMIC
|
||||
#undef SDL_VIDEO_DRIVER_WAYLAND_DYNAMIC_EGL
|
||||
#undef SDL_VIDEO_DRIVER_WAYLAND_DYNAMIC_CURSOR
|
||||
#undef SDL_VIDEO_DRIVER_WAYLAND_DYNAMIC_XKBCOMMON
|
||||
#undef SDL_VIDEO_DRIVER_WAYLAND_DYNAMIC_LIBDECOR
|
||||
#undef SDL_VIDEO_DRIVER_X11
|
||||
#undef SDL_VIDEO_DRIVER_RPI
|
||||
#undef SDL_VIDEO_DRIVER_KMSDRM
|
||||
#undef SDL_VIDEO_DRIVER_KMSDRM_DYNAMIC
|
||||
#undef SDL_VIDEO_DRIVER_KMSDRM_DYNAMIC_GBM
|
||||
#undef SDL_VIDEO_DRIVER_ANDROID
|
||||
#undef SDL_VIDEO_DRIVER_EMSCRIPTEN
|
||||
#undef SDL_VIDEO_DRIVER_OFFSCREEN
|
||||
#undef SDL_VIDEO_DRIVER_X11_DYNAMIC
|
||||
#undef SDL_VIDEO_DRIVER_X11_DYNAMIC_XEXT
|
||||
#undef SDL_VIDEO_DRIVER_X11_DYNAMIC_XCURSOR
|
||||
#undef SDL_VIDEO_DRIVER_X11_DYNAMIC_XINERAMA
|
||||
#undef SDL_VIDEO_DRIVER_X11_DYNAMIC_XINPUT2
|
||||
#undef SDL_VIDEO_DRIVER_X11_DYNAMIC_XFIXES
|
||||
#undef SDL_VIDEO_DRIVER_X11_DYNAMIC_XRANDR
|
||||
#undef SDL_VIDEO_DRIVER_X11_DYNAMIC_XSS
|
||||
#undef SDL_VIDEO_DRIVER_X11_DYNAMIC_XVIDMODE
|
||||
#undef SDL_VIDEO_DRIVER_X11_XCURSOR
|
||||
#undef SDL_VIDEO_DRIVER_X11_XDBE
|
||||
#undef SDL_VIDEO_DRIVER_X11_XINERAMA
|
||||
#undef SDL_VIDEO_DRIVER_X11_XINPUT2
|
||||
#undef SDL_VIDEO_DRIVER_X11_XINPUT2_SUPPORTS_MULTITOUCH
|
||||
#undef SDL_VIDEO_DRIVER_X11_XFIXES
|
||||
#undef SDL_VIDEO_DRIVER_X11_XRANDR
|
||||
#undef SDL_VIDEO_DRIVER_X11_XSCRNSAVER
|
||||
#undef SDL_VIDEO_DRIVER_X11_XSHAPE
|
||||
#undef SDL_VIDEO_DRIVER_X11_XVIDMODE
|
||||
#undef SDL_VIDEO_DRIVER_X11_SUPPORTS_GENERIC_EVENTS
|
||||
#undef SDL_VIDEO_DRIVER_X11_HAS_XKBKEYCODETOKEYSYM
|
||||
#undef SDL_VIDEO_DRIVER_NACL
|
||||
#undef SDL_VIDEO_DRIVER_VIVANTE
|
||||
#undef SDL_VIDEO_DRIVER_VIVANTE_VDK
|
||||
#undef SDL_VIDEO_DRIVER_OS2
|
||||
#undef SDL_VIDEO_DRIVER_QNX
|
||||
#undef SDL_VIDEO_DRIVER_RISCOS
|
||||
|
||||
#undef SDL_VIDEO_RENDER_D3D
|
||||
#undef SDL_VIDEO_RENDER_D3D11
|
||||
#undef SDL_VIDEO_RENDER_OGL
|
||||
#undef SDL_VIDEO_RENDER_OGL_ES
|
||||
#undef SDL_VIDEO_RENDER_OGL_ES2
|
||||
#undef SDL_VIDEO_RENDER_DIRECTFB
|
||||
#undef SDL_VIDEO_RENDER_METAL
|
||||
|
||||
/* Enable OpenGL support */
|
||||
#undef SDL_VIDEO_OPENGL
|
||||
#undef SDL_VIDEO_OPENGL_ES
|
||||
#undef SDL_VIDEO_OPENGL_ES2
|
||||
#undef SDL_VIDEO_OPENGL_BGL
|
||||
#undef SDL_VIDEO_OPENGL_CGL
|
||||
#undef SDL_VIDEO_OPENGL_EGL
|
||||
#undef SDL_VIDEO_OPENGL_GLX
|
||||
#undef SDL_VIDEO_OPENGL_WGL
|
||||
#undef SDL_VIDEO_OPENGL_OSMESA
|
||||
#undef SDL_VIDEO_OPENGL_OSMESA_DYNAMIC
|
||||
|
||||
/* Enable Vulkan support */
|
||||
#undef SDL_VIDEO_VULKAN
|
||||
|
||||
/* Enable Metal support */
|
||||
#undef SDL_VIDEO_METAL
|
||||
|
||||
/* Enable system power support */
|
||||
#undef SDL_POWER_LINUX
|
||||
#undef SDL_POWER_WINDOWS
|
||||
#undef SDL_POWER_MACOSX
|
||||
#undef SDL_POWER_HAIKU
|
||||
#undef SDL_POWER_ANDROID
|
||||
#undef SDL_POWER_EMSCRIPTEN
|
||||
#undef SDL_POWER_HARDWIRED
|
||||
|
||||
/* Enable system filesystem support */
|
||||
#undef SDL_FILESYSTEM_ANDROID
|
||||
#undef SDL_FILESYSTEM_HAIKU
|
||||
#undef SDL_FILESYSTEM_COCOA
|
||||
#undef SDL_FILESYSTEM_DUMMY
|
||||
#undef SDL_FILESYSTEM_RISCOS
|
||||
#undef SDL_FILESYSTEM_UNIX
|
||||
#undef SDL_FILESYSTEM_WINDOWS
|
||||
#undef SDL_FILESYSTEM_NACL
|
||||
#undef SDL_FILESYSTEM_EMSCRIPTEN
|
||||
#undef SDL_FILESYSTEM_OS2
|
||||
#undef SDL_FILESYSTEM_VITA
|
||||
#undef SDL_FILESYSTEM_PSP
|
||||
|
||||
/* Enable misc subsystem */
|
||||
#undef SDL_MISC_DUMMY
|
||||
|
||||
/* Enable locale subsystem */
|
||||
#undef SDL_LOCALE_DUMMY
|
||||
|
||||
/* Enable assembly routines */
|
||||
#undef SDL_ASSEMBLY_ROUTINES
|
||||
#undef SDL_ALTIVEC_BLITTERS
|
||||
#undef SDL_ARM_SIMD_BLITTERS
|
||||
#undef SDL_ARM_NEON_BLITTERS
|
||||
|
||||
/* Whether SDL_DYNAMIC_API needs dlopen() */
|
||||
#undef DYNAPI_NEEDS_DLOPEN
|
||||
|
||||
/* Enable ime support */
|
||||
#undef SDL_USE_IME
|
||||
|
||||
/* Enable dynamic udev support */
|
||||
#undef SDL_UDEV_DYNAMIC
|
||||
|
||||
/* Enable dynamic libusb support */
|
||||
#undef SDL_LIBUSB_DYNAMIC
|
||||
|
||||
/* Enable dynamic libsamplerate support */
|
||||
#undef SDL_LIBSAMPLERATE_DYNAMIC
|
||||
|
||||
#endif /* SDL_config_h_ */
|
||||
@@ -1,192 +0,0 @@
|
||||
/*
|
||||
Simple DirectMedia Layer
|
||||
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.
|
||||
*/
|
||||
|
||||
#ifndef SDL_config_android_h_
|
||||
#define SDL_config_android_h_
|
||||
#define SDL_config_h_
|
||||
|
||||
#include "SDL_platform.h"
|
||||
|
||||
/**
|
||||
* \file SDL_config_android.h
|
||||
*
|
||||
* This is a configuration that can be used to build SDL for Android
|
||||
*/
|
||||
|
||||
#include <stdarg.h>
|
||||
|
||||
#define HAVE_GCC_ATOMICS 1
|
||||
|
||||
#define STDC_HEADERS 1
|
||||
#define HAVE_ALLOCA_H 1
|
||||
#define HAVE_CTYPE_H 1
|
||||
#define HAVE_INTTYPES_H 1
|
||||
#define HAVE_LIMITS_H 1
|
||||
#define HAVE_MATH_H 1
|
||||
#define HAVE_SIGNAL_H 1
|
||||
#define HAVE_STDINT_H 1
|
||||
#define HAVE_STDIO_H 1
|
||||
#define HAVE_STRING_H 1
|
||||
#define HAVE_SYS_TYPES_H 1
|
||||
|
||||
/* C library functions */
|
||||
#define HAVE_DLOPEN 1
|
||||
#define HAVE_MALLOC 1
|
||||
#define HAVE_CALLOC 1
|
||||
#define HAVE_REALLOC 1
|
||||
#define HAVE_FREE 1
|
||||
#define HAVE_ALLOCA 1
|
||||
#define HAVE_GETENV 1
|
||||
#define HAVE_SETENV 1
|
||||
#define HAVE_PUTENV 1
|
||||
#define HAVE_SETENV 1
|
||||
#define HAVE_UNSETENV 1
|
||||
#define HAVE_QSORT 1
|
||||
#define HAVE_ABS 1
|
||||
#define HAVE_BCOPY 1
|
||||
#define HAVE_MEMSET 1
|
||||
#define HAVE_MEMCPY 1
|
||||
#define HAVE_MEMMOVE 1
|
||||
#define HAVE_MEMCMP 1
|
||||
#define HAVE_STRLEN 1
|
||||
#define HAVE_STRLCPY 1
|
||||
#define HAVE_STRLCAT 1
|
||||
#define HAVE_STRCHR 1
|
||||
#define HAVE_STRRCHR 1
|
||||
#define HAVE_STRSTR 1
|
||||
#define HAVE_STRTOK_R 1
|
||||
#define HAVE_STRTOL 1
|
||||
#define HAVE_STRTOUL 1
|
||||
#define HAVE_STRTOLL 1
|
||||
#define HAVE_STRTOULL 1
|
||||
#define HAVE_STRTOD 1
|
||||
#define HAVE_ATOI 1
|
||||
#define HAVE_ATOF 1
|
||||
#define HAVE_STRCMP 1
|
||||
#define HAVE_STRNCMP 1
|
||||
#define HAVE_STRCASECMP 1
|
||||
#define HAVE_STRNCASECMP 1
|
||||
#define HAVE_VSSCANF 1
|
||||
#define HAVE_VSNPRINTF 1
|
||||
#define HAVE_ACOS 1
|
||||
#define HAVE_ACOSF 1
|
||||
#define HAVE_ASIN 1
|
||||
#define HAVE_ASINF 1
|
||||
#define HAVE_ATAN 1
|
||||
#define HAVE_ATANF 1
|
||||
#define HAVE_ATAN2 1
|
||||
#define HAVE_ATAN2F 1
|
||||
#define HAVE_CEIL 1
|
||||
#define HAVE_CEILF 1
|
||||
#define HAVE_COPYSIGN 1
|
||||
#define HAVE_COPYSIGNF 1
|
||||
#define HAVE_COS 1
|
||||
#define HAVE_COSF 1
|
||||
#define HAVE_EXP 1
|
||||
#define HAVE_EXPF 1
|
||||
#define HAVE_FABS 1
|
||||
#define HAVE_FABSF 1
|
||||
#define HAVE_FLOOR 1
|
||||
#define HAVE_FLOORF 1
|
||||
#define HAVE_FMOD 1
|
||||
#define HAVE_FMODF 1
|
||||
#define HAVE_LOG 1
|
||||
#define HAVE_LOGF 1
|
||||
#define HAVE_LOG10 1
|
||||
#define HAVE_LOG10F 1
|
||||
#define HAVE_LROUND 1
|
||||
#define HAVE_LROUNDF 1
|
||||
#define HAVE_POW 1
|
||||
#define HAVE_POWF 1
|
||||
#define HAVE_ROUND 1
|
||||
#define HAVE_ROUNDF 1
|
||||
#define HAVE_SCALBN 1
|
||||
#define HAVE_SCALBNF 1
|
||||
#define HAVE_SIN 1
|
||||
#define HAVE_SINF 1
|
||||
#define HAVE_SQRT 1
|
||||
#define HAVE_SQRTF 1
|
||||
#define HAVE_TAN 1
|
||||
#define HAVE_TANF 1
|
||||
#define HAVE_TRUNC 1
|
||||
#define HAVE_TRUNCF 1
|
||||
#define HAVE_SIGACTION 1
|
||||
#define HAVE_SETJMP 1
|
||||
#define HAVE_NANOSLEEP 1
|
||||
#define HAVE_SYSCONF 1
|
||||
#define HAVE_CLOCK_GETTIME 1
|
||||
|
||||
#ifdef __LP64__
|
||||
#define SIZEOF_VOIDP 8
|
||||
#else
|
||||
#define SIZEOF_VOIDP 4
|
||||
#endif
|
||||
|
||||
/* Enable various audio drivers */
|
||||
#define SDL_AUDIO_DRIVER_ANDROID 1
|
||||
#define SDL_AUDIO_DRIVER_OPENSLES 1
|
||||
#define SDL_AUDIO_DRIVER_AAUDIO 1
|
||||
#define SDL_AUDIO_DRIVER_DUMMY 1
|
||||
|
||||
/* Enable various input drivers */
|
||||
#define SDL_JOYSTICK_ANDROID 1
|
||||
#define SDL_JOYSTICK_HIDAPI 1
|
||||
#define SDL_JOYSTICK_VIRTUAL 1
|
||||
#define SDL_HAPTIC_ANDROID 1
|
||||
|
||||
/* Enable sensor driver */
|
||||
#define SDL_SENSOR_ANDROID 1
|
||||
|
||||
/* Enable various shared object loading systems */
|
||||
#define SDL_LOADSO_DLOPEN 1
|
||||
|
||||
/* Enable various threading systems */
|
||||
#define SDL_THREAD_PTHREAD 1
|
||||
#define SDL_THREAD_PTHREAD_RECURSIVE_MUTEX 1
|
||||
|
||||
/* Enable various timer systems */
|
||||
#define SDL_TIMER_UNIX 1
|
||||
|
||||
/* Enable various video drivers */
|
||||
#define SDL_VIDEO_DRIVER_ANDROID 1
|
||||
|
||||
/* Enable OpenGL ES */
|
||||
#define SDL_VIDEO_OPENGL_ES 1
|
||||
#define SDL_VIDEO_OPENGL_ES2 1
|
||||
#define SDL_VIDEO_OPENGL_EGL 1
|
||||
#define SDL_VIDEO_RENDER_OGL_ES 1
|
||||
#define SDL_VIDEO_RENDER_OGL_ES2 1
|
||||
|
||||
/* Enable Vulkan support */
|
||||
/* Android does not support Vulkan in native code using the "armeabi" ABI. */
|
||||
#if defined(__ARM_ARCH) && __ARM_ARCH < 7
|
||||
#define SDL_VIDEO_VULKAN 0
|
||||
#else
|
||||
#define SDL_VIDEO_VULKAN 1
|
||||
#endif
|
||||
|
||||
/* Enable system power support */
|
||||
#define SDL_POWER_ANDROID 1
|
||||
|
||||
/* Enable the filesystem driver */
|
||||
#define SDL_FILESYSTEM_ANDROID 1
|
||||
|
||||
#endif /* SDL_config_android_h_ */
|
||||
@@ -1,217 +0,0 @@
|
||||
/*
|
||||
Simple DirectMedia Layer
|
||||
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.
|
||||
*/
|
||||
|
||||
#ifndef _SDL_config_emscripten_h_
|
||||
#define _SDL_config_emscripten_h_
|
||||
|
||||
#include "SDL_platform.h"
|
||||
|
||||
/**
|
||||
* \file SDL_config_emscripten.h
|
||||
*
|
||||
* This is a configuration that can be used to build SDL for Emscripten.
|
||||
*/
|
||||
|
||||
#ifdef __LP64__
|
||||
#define SIZEOF_VOIDP 8
|
||||
#else
|
||||
#define SIZEOF_VOIDP 4
|
||||
#endif
|
||||
#define HAVE_GCC_ATOMICS 1
|
||||
|
||||
/* Useful headers */
|
||||
#define STDC_HEADERS 1
|
||||
#define HAVE_ALLOCA_H 1
|
||||
#define HAVE_CTYPE_H 1
|
||||
#define HAVE_ICONV_H 1
|
||||
#define HAVE_INTTYPES_H 1
|
||||
#define HAVE_LIMITS_H 1
|
||||
#define HAVE_MALLOC_H 1
|
||||
#define HAVE_MATH_H 1
|
||||
#define HAVE_MEMORY_H 1
|
||||
#define HAVE_SIGNAL_H 1
|
||||
#define HAVE_STDARG_H 1
|
||||
#define HAVE_STDINT_H 1
|
||||
#define HAVE_STDIO_H 1
|
||||
#define HAVE_STDLIB_H 1
|
||||
#define HAVE_STRINGS_H 1
|
||||
#define HAVE_STRING_H 1
|
||||
#define HAVE_SYS_TYPES_H 1
|
||||
#define HAVE_WCHAR_H 1
|
||||
|
||||
/* C library functions */
|
||||
#define HAVE_DLOPEN 1
|
||||
#define HAVE_MALLOC 1
|
||||
#define HAVE_CALLOC 1
|
||||
#define HAVE_REALLOC 1
|
||||
#define HAVE_FREE 1
|
||||
#define HAVE_ALLOCA 1
|
||||
#define HAVE_GETENV 1
|
||||
#define HAVE_SETENV 1
|
||||
#define HAVE_PUTENV 1
|
||||
#define HAVE_UNSETENV 1
|
||||
#define HAVE_QSORT 1
|
||||
#define HAVE_ABS 1
|
||||
#define HAVE_BCOPY 1
|
||||
#define HAVE_MEMSET 1
|
||||
#define HAVE_MEMCPY 1
|
||||
#define HAVE_MEMMOVE 1
|
||||
#define HAVE_MEMCMP 1
|
||||
#define HAVE_WCSLEN 1
|
||||
#define HAVE_WCSDUP 1
|
||||
#define HAVE_WCSSTR 1
|
||||
#define HAVE_WCSCMP 1
|
||||
#define HAVE_WCSNCMP 1
|
||||
#define HAVE_WCSCASECMP 1
|
||||
#define HAVE_WCSNCASECMP 1
|
||||
#define HAVE_STRLEN 1
|
||||
#define HAVE_STRLCPY 1
|
||||
#define HAVE_STRLCAT 1
|
||||
#define HAVE_STRCHR 1
|
||||
#define HAVE_STRRCHR 1
|
||||
#define HAVE_STRSTR 1
|
||||
#define HAVE_STRTOK_R 1
|
||||
#define HAVE_STRTOL 1
|
||||
#define HAVE_STRTOUL 1
|
||||
#define HAVE_STRTOLL 1
|
||||
#define HAVE_STRTOULL 1
|
||||
#define HAVE_STRTOD 1
|
||||
#define HAVE_ATOI 1
|
||||
#define HAVE_ATOF 1
|
||||
#define HAVE_STRCMP 1
|
||||
#define HAVE_STRNCMP 1
|
||||
#define HAVE_STRCASECMP 1
|
||||
#define HAVE_STRNCASECMP 1
|
||||
#define HAVE_SSCANF 1
|
||||
#define HAVE_VSSCANF 1
|
||||
#define HAVE_VSNPRINTF 1
|
||||
#define HAVE_M_PI 1
|
||||
#define HAVE_ACOS 1
|
||||
#define HAVE_ACOSF 1
|
||||
#define HAVE_ASIN 1
|
||||
#define HAVE_ASINF 1
|
||||
#define HAVE_ATAN 1
|
||||
#define HAVE_ATANF 1
|
||||
#define HAVE_ATAN2 1
|
||||
#define HAVE_ATAN2F 1
|
||||
#define HAVE_CEIL 1
|
||||
#define HAVE_CEILF 1
|
||||
#define HAVE_COPYSIGN 1
|
||||
#define HAVE_COPYSIGNF 1
|
||||
#define HAVE_COS 1
|
||||
#define HAVE_COSF 1
|
||||
#define HAVE_EXP 1
|
||||
#define HAVE_EXPF 1
|
||||
#define HAVE_FABS 1
|
||||
#define HAVE_FABSF 1
|
||||
#define HAVE_FLOOR 1
|
||||
#define HAVE_FLOORF 1
|
||||
#define HAVE_FMOD 1
|
||||
#define HAVE_FMODF 1
|
||||
#define HAVE_LOG 1
|
||||
#define HAVE_LOGF 1
|
||||
#define HAVE_LOG10 1
|
||||
#define HAVE_LOG10F 1
|
||||
#define HAVE_LROUND 1
|
||||
#define HAVE_LROUNDF 1
|
||||
#define HAVE_POW 1
|
||||
#define HAVE_POWF 1
|
||||
#define HAVE_ROUND 1
|
||||
#define HAVE_ROUNDF 1
|
||||
#define HAVE_SCALBN 1
|
||||
#define HAVE_SCALBNF 1
|
||||
#define HAVE_SIN 1
|
||||
#define HAVE_SINF 1
|
||||
#define HAVE_SQRT 1
|
||||
#define HAVE_SQRTF 1
|
||||
#define HAVE_TAN 1
|
||||
#define HAVE_TANF 1
|
||||
#define HAVE_TRUNC 1
|
||||
#define HAVE_TRUNCF 1
|
||||
#define HAVE_FSEEKO 1
|
||||
#define HAVE_FSEEKO64 1
|
||||
#define HAVE_SIGACTION 1
|
||||
#define HAVE_SA_SIGACTION 1
|
||||
#define HAVE_SETJMP 1
|
||||
#define HAVE_NANOSLEEP 1
|
||||
#define HAVE_SYSCONF 1
|
||||
#define HAVE_CLOCK_GETTIME 1
|
||||
/* #undef HAVE_GETPAGESIZE */
|
||||
#define HAVE_MPROTECT 1
|
||||
#define HAVE_ICONV 1
|
||||
|
||||
/* SDL internal assertion support */
|
||||
/* #undef SDL_DEFAULT_ASSERT_LEVEL */
|
||||
|
||||
#define SDL_CPUINFO_DISABLED 1
|
||||
#define SDL_HAPTIC_DISABLED 1
|
||||
#define SDL_HIDAPI_DISABLED 1
|
||||
#ifndef __EMSCRIPTEN_PTHREADS__
|
||||
#define SDL_THREADS_DISABLED 1
|
||||
#endif
|
||||
|
||||
/* Enable various audio drivers */
|
||||
#define SDL_AUDIO_DRIVER_DISK 1
|
||||
#define SDL_AUDIO_DRIVER_DUMMY 1
|
||||
#define SDL_AUDIO_DRIVER_EMSCRIPTEN 1
|
||||
|
||||
/* Enable various input drivers */
|
||||
#define SDL_JOYSTICK_EMSCRIPTEN 1
|
||||
|
||||
/* Enable various sensor drivers */
|
||||
#define SDL_SENSOR_DUMMY 1
|
||||
|
||||
/* Enable various shared object loading systems */
|
||||
#define SDL_LOADSO_DLOPEN 1
|
||||
|
||||
/* Enable various threading systems */
|
||||
#ifdef __EMSCRIPTEN_PTHREADS__
|
||||
#define SDL_THREAD_PTHREAD 1
|
||||
#define SDL_THREAD_PTHREAD_RECURSIVE_MUTEX 1
|
||||
#endif
|
||||
|
||||
/* Enable various timer systems */
|
||||
#define SDL_TIMER_UNIX 1
|
||||
|
||||
/* Enable various video drivers */
|
||||
#define SDL_VIDEO_DRIVER_EMSCRIPTEN 1
|
||||
|
||||
#define SDL_VIDEO_RENDER_OGL_ES2 1
|
||||
|
||||
/* Enable OpenGL support */
|
||||
/* #undef SDL_VIDEO_OPENGL */
|
||||
/* #undef SDL_VIDEO_OPENGL_ES */
|
||||
#define SDL_VIDEO_OPENGL_ES2 1
|
||||
/* #undef SDL_VIDEO_OPENGL_BGL */
|
||||
/* #undef SDL_VIDEO_OPENGL_CGL */
|
||||
/* #undef SDL_VIDEO_OPENGL_GLX */
|
||||
/* #undef SDL_VIDEO_OPENGL_WGL */
|
||||
#define SDL_VIDEO_OPENGL_EGL 1
|
||||
/* #undef SDL_VIDEO_OPENGL_OSMESA */
|
||||
/* #undef SDL_VIDEO_OPENGL_OSMESA_DYNAMIC */
|
||||
|
||||
/* Enable system power support */
|
||||
#define SDL_POWER_EMSCRIPTEN 1
|
||||
|
||||
/* Enable system filesystem support */
|
||||
#define SDL_FILESYSTEM_EMSCRIPTEN 1
|
||||
|
||||
#endif /* _SDL_config_emscripten_h_ */
|
||||
@@ -1,215 +0,0 @@
|
||||
/*
|
||||
Simple DirectMedia Layer
|
||||
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.
|
||||
*/
|
||||
|
||||
#ifndef SDL_config_iphoneos_h_
|
||||
#define SDL_config_iphoneos_h_
|
||||
#define SDL_config_h_
|
||||
|
||||
#include "SDL_platform.h"
|
||||
|
||||
#ifdef __LP64__
|
||||
#define SIZEOF_VOIDP 8
|
||||
#else
|
||||
#define SIZEOF_VOIDP 4
|
||||
#endif
|
||||
|
||||
#define HAVE_GCC_ATOMICS 1
|
||||
|
||||
#define STDC_HEADERS 1
|
||||
#define HAVE_ALLOCA_H 1
|
||||
#define HAVE_CTYPE_H 1
|
||||
#define HAVE_INTTYPES_H 1
|
||||
#define HAVE_LIMITS_H 1
|
||||
#define HAVE_MATH_H 1
|
||||
#define HAVE_SIGNAL_H 1
|
||||
#define HAVE_STDINT_H 1
|
||||
#define HAVE_STDIO_H 1
|
||||
#define HAVE_STRING_H 1
|
||||
#define HAVE_SYS_TYPES_H 1
|
||||
/* The libunwind functions are only available on x86 */
|
||||
/* #undef HAVE_LIBUNWIND_H */
|
||||
|
||||
/* C library functions */
|
||||
#define HAVE_DLOPEN 1
|
||||
#define HAVE_MALLOC 1
|
||||
#define HAVE_CALLOC 1
|
||||
#define HAVE_REALLOC 1
|
||||
#define HAVE_FREE 1
|
||||
#define HAVE_ALLOCA 1
|
||||
#define HAVE_GETENV 1
|
||||
#define HAVE_SETENV 1
|
||||
#define HAVE_PUTENV 1
|
||||
#define HAVE_SETENV 1
|
||||
#define HAVE_UNSETENV 1
|
||||
#define HAVE_QSORT 1
|
||||
#define HAVE_ABS 1
|
||||
#define HAVE_BCOPY 1
|
||||
#define HAVE_MEMSET 1
|
||||
#define HAVE_MEMCPY 1
|
||||
#define HAVE_MEMMOVE 1
|
||||
#define HAVE_MEMCMP 1
|
||||
#define HAVE_STRLEN 1
|
||||
#define HAVE_STRLCPY 1
|
||||
#define HAVE_STRLCAT 1
|
||||
#define HAVE_STRCHR 1
|
||||
#define HAVE_STRRCHR 1
|
||||
#define HAVE_STRSTR 1
|
||||
#define HAVE_STRTOK_R 1
|
||||
#define HAVE_STRTOL 1
|
||||
#define HAVE_STRTOUL 1
|
||||
#define HAVE_STRTOLL 1
|
||||
#define HAVE_STRTOULL 1
|
||||
#define HAVE_STRTOD 1
|
||||
#define HAVE_ATOI 1
|
||||
#define HAVE_ATOF 1
|
||||
#define HAVE_STRCMP 1
|
||||
#define HAVE_STRNCMP 1
|
||||
#define HAVE_STRCASECMP 1
|
||||
#define HAVE_STRNCASECMP 1
|
||||
#define HAVE_VSSCANF 1
|
||||
#define HAVE_VSNPRINTF 1
|
||||
#define HAVE_M_PI 1
|
||||
#define HAVE_ACOS 1
|
||||
#define HAVE_ACOSF 1
|
||||
#define HAVE_ASIN 1
|
||||
#define HAVE_ASINF 1
|
||||
#define HAVE_ATAN 1
|
||||
#define HAVE_ATANF 1
|
||||
#define HAVE_ATAN2 1
|
||||
#define HAVE_ATAN2F 1
|
||||
#define HAVE_CEIL 1
|
||||
#define HAVE_CEILF 1
|
||||
#define HAVE_COPYSIGN 1
|
||||
#define HAVE_COPYSIGNF 1
|
||||
#define HAVE_COS 1
|
||||
#define HAVE_COSF 1
|
||||
#define HAVE_EXP 1
|
||||
#define HAVE_EXPF 1
|
||||
#define HAVE_FABS 1
|
||||
#define HAVE_FABSF 1
|
||||
#define HAVE_FLOOR 1
|
||||
#define HAVE_FLOORF 1
|
||||
#define HAVE_FMOD 1
|
||||
#define HAVE_FMODF 1
|
||||
#define HAVE_LOG 1
|
||||
#define HAVE_LOGF 1
|
||||
#define HAVE_LOG10 1
|
||||
#define HAVE_LOG10F 1
|
||||
#define HAVE_LROUND 1
|
||||
#define HAVE_LROUNDF 1
|
||||
#define HAVE_POW 1
|
||||
#define HAVE_POWF 1
|
||||
#define HAVE_ROUND 1
|
||||
#define HAVE_ROUNDF 1
|
||||
#define HAVE_SCALBN 1
|
||||
#define HAVE_SCALBNF 1
|
||||
#define HAVE_SIN 1
|
||||
#define HAVE_SINF 1
|
||||
#define HAVE_SQRT 1
|
||||
#define HAVE_SQRTF 1
|
||||
#define HAVE_TAN 1
|
||||
#define HAVE_TANF 1
|
||||
#define HAVE_TRUNC 1
|
||||
#define HAVE_TRUNCF 1
|
||||
#define HAVE_SIGACTION 1
|
||||
#define HAVE_SETJMP 1
|
||||
#define HAVE_NANOSLEEP 1
|
||||
#define HAVE_SYSCONF 1
|
||||
#define HAVE_SYSCTLBYNAME 1
|
||||
#define HAVE_O_CLOEXEC 1
|
||||
|
||||
/* enable iPhone version of Core Audio driver */
|
||||
#define SDL_AUDIO_DRIVER_COREAUDIO 1
|
||||
/* Enable the dummy audio driver (src/audio/dummy/\*.c) */
|
||||
#define SDL_AUDIO_DRIVER_DUMMY 1
|
||||
|
||||
/* Enable the stub haptic driver (src/haptic/dummy/\*.c) */
|
||||
#define SDL_HAPTIC_DUMMY 1
|
||||
|
||||
/* Enable joystick support */
|
||||
/* Only enable HIDAPI support if you want to support Steam Controllers on iOS and tvOS */
|
||||
/*#define SDL_JOYSTICK_HIDAPI 1*/
|
||||
#define SDL_JOYSTICK_MFI 1
|
||||
#define SDL_JOYSTICK_VIRTUAL 1
|
||||
|
||||
#ifdef __TVOS__
|
||||
#define SDL_SENSOR_DUMMY 1
|
||||
#else
|
||||
/* Enable the CoreMotion sensor driver */
|
||||
#define SDL_SENSOR_COREMOTION 1
|
||||
#endif
|
||||
|
||||
/* Enable Unix style SO loading */
|
||||
#define SDL_LOADSO_DLOPEN 1
|
||||
|
||||
/* Enable various threading systems */
|
||||
#define SDL_THREAD_PTHREAD 1
|
||||
#define SDL_THREAD_PTHREAD_RECURSIVE_MUTEX 1
|
||||
|
||||
/* Enable various timer systems */
|
||||
#define SDL_TIMER_UNIX 1
|
||||
|
||||
/* Supported video drivers */
|
||||
#define SDL_VIDEO_DRIVER_UIKIT 1
|
||||
#define SDL_VIDEO_DRIVER_DUMMY 1
|
||||
|
||||
/* Enable OpenGL ES */
|
||||
#if !TARGET_OS_MACCATALYST
|
||||
#define SDL_VIDEO_OPENGL_ES2 1
|
||||
#define SDL_VIDEO_OPENGL_ES 1
|
||||
#define SDL_VIDEO_RENDER_OGL_ES 1
|
||||
#define SDL_VIDEO_RENDER_OGL_ES2 1
|
||||
#endif
|
||||
|
||||
/* Metal supported on 64-bit devices running iOS 8.0 and tvOS 9.0 and newer
|
||||
Also supported in simulator from iOS 13.0 and tvOS 13.0
|
||||
*/
|
||||
#if (TARGET_OS_SIMULATOR && ((__IPHONE_OS_VERSION_MIN_REQUIRED >= 130000) || (__TV_OS_VERSION_MIN_REQUIRED >= 130000))) || (!TARGET_CPU_ARM && ((__IPHONE_OS_VERSION_MIN_REQUIRED >= 80000) || (__TV_OS_VERSION_MIN_REQUIRED >= 90000)))
|
||||
#define SDL_PLATFORM_SUPPORTS_METAL 1
|
||||
#else
|
||||
#define SDL_PLATFORM_SUPPORTS_METAL 0
|
||||
#endif
|
||||
|
||||
#if SDL_PLATFORM_SUPPORTS_METAL
|
||||
#define SDL_VIDEO_RENDER_METAL 1
|
||||
#endif
|
||||
|
||||
#if SDL_PLATFORM_SUPPORTS_METAL
|
||||
#define SDL_VIDEO_VULKAN 1
|
||||
#endif
|
||||
|
||||
#if SDL_PLATFORM_SUPPORTS_METAL
|
||||
#define SDL_VIDEO_METAL 1
|
||||
#endif
|
||||
|
||||
/* Enable system power support */
|
||||
#define SDL_POWER_UIKIT 1
|
||||
|
||||
/* enable iPhone keyboard support */
|
||||
#define SDL_IPHONE_KEYBOARD 1
|
||||
|
||||
/* enable iOS extended launch screen */
|
||||
#define SDL_IPHONE_LAUNCHSCREEN 1
|
||||
|
||||
/* enable filesystem support */
|
||||
#define SDL_FILESYSTEM_COCOA 1
|
||||
|
||||
#endif /* SDL_config_iphoneos_h_ */
|
||||
@@ -1,280 +0,0 @@
|
||||
/*
|
||||
Simple DirectMedia Layer
|
||||
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.
|
||||
*/
|
||||
|
||||
#ifndef SDL_config_macosx_h_
|
||||
#define SDL_config_macosx_h_
|
||||
#define SDL_config_h_
|
||||
|
||||
#include "SDL_platform.h"
|
||||
|
||||
/* This gets us MAC_OS_X_VERSION_MIN_REQUIRED... */
|
||||
#include <AvailabilityMacros.h>
|
||||
|
||||
/* This is a set of defines to configure the SDL features */
|
||||
|
||||
#ifdef __LP64__
|
||||
#define SIZEOF_VOIDP 8
|
||||
#else
|
||||
#define SIZEOF_VOIDP 4
|
||||
#endif
|
||||
|
||||
/* Useful headers */
|
||||
#define STDC_HEADERS 1
|
||||
#define HAVE_ALLOCA_H 1
|
||||
#define HAVE_CTYPE_H 1
|
||||
#define HAVE_FLOAT_H 1
|
||||
#define HAVE_INTTYPES_H 1
|
||||
#define HAVE_LIMITS_H 1
|
||||
#define HAVE_MATH_H 1
|
||||
#define HAVE_SIGNAL_H 1
|
||||
#define HAVE_STDINT_H 1
|
||||
#define HAVE_STDIO_H 1
|
||||
#define HAVE_STRING_H 1
|
||||
#define HAVE_SYS_TYPES_H 1
|
||||
#define HAVE_LIBUNWIND_H 1
|
||||
|
||||
/* C library functions */
|
||||
#define HAVE_DLOPEN 1
|
||||
#define HAVE_MALLOC 1
|
||||
#define HAVE_CALLOC 1
|
||||
#define HAVE_REALLOC 1
|
||||
#define HAVE_FREE 1
|
||||
#define HAVE_ALLOCA 1
|
||||
#define HAVE_GETENV 1
|
||||
#define HAVE_SETENV 1
|
||||
#define HAVE_PUTENV 1
|
||||
#define HAVE_UNSETENV 1
|
||||
#define HAVE_QSORT 1
|
||||
#define HAVE_ABS 1
|
||||
#define HAVE_BCOPY 1
|
||||
#define HAVE_MEMSET 1
|
||||
#define HAVE_MEMCPY 1
|
||||
#define HAVE_MEMMOVE 1
|
||||
#define HAVE_MEMCMP 1
|
||||
#define HAVE_STRLEN 1
|
||||
#define HAVE_STRLCPY 1
|
||||
#define HAVE_STRLCAT 1
|
||||
#define HAVE_STRCHR 1
|
||||
#define HAVE_STRRCHR 1
|
||||
#define HAVE_STRSTR 1
|
||||
#define HAVE_STRTOK_R 1
|
||||
#define HAVE_STRTOL 1
|
||||
#define HAVE_STRTOUL 1
|
||||
#define HAVE_STRTOLL 1
|
||||
#define HAVE_STRTOULL 1
|
||||
#define HAVE_STRTOD 1
|
||||
#define HAVE_ATOI 1
|
||||
#define HAVE_ATOF 1
|
||||
#define HAVE_STRCMP 1
|
||||
#define HAVE_STRNCMP 1
|
||||
#define HAVE_STRCASECMP 1
|
||||
#define HAVE_STRNCASECMP 1
|
||||
#define HAVE_VSSCANF 1
|
||||
#define HAVE_VSNPRINTF 1
|
||||
#define HAVE_M_PI 1
|
||||
#define HAVE_ACOS 1
|
||||
#define HAVE_ACOSF 1
|
||||
#define HAVE_ASIN 1
|
||||
#define HAVE_ASINF 1
|
||||
#define HAVE_ATAN 1
|
||||
#define HAVE_ATANF 1
|
||||
#define HAVE_ATAN2 1
|
||||
#define HAVE_ATAN2F 1
|
||||
#define HAVE_CEIL 1
|
||||
#define HAVE_CEILF 1
|
||||
#define HAVE_COPYSIGN 1
|
||||
#define HAVE_COPYSIGNF 1
|
||||
#define HAVE_COS 1
|
||||
#define HAVE_COSF 1
|
||||
#define HAVE_EXP 1
|
||||
#define HAVE_EXPF 1
|
||||
#define HAVE_FABS 1
|
||||
#define HAVE_FABSF 1
|
||||
#define HAVE_FLOOR 1
|
||||
#define HAVE_FLOORF 1
|
||||
#define HAVE_FMOD 1
|
||||
#define HAVE_FMODF 1
|
||||
#define HAVE_LOG 1
|
||||
#define HAVE_LOGF 1
|
||||
#define HAVE_LOG10 1
|
||||
#define HAVE_LOG10F 1
|
||||
#define HAVE_LROUND 1
|
||||
#define HAVE_LROUNDF 1
|
||||
#define HAVE_POW 1
|
||||
#define HAVE_POWF 1
|
||||
#define HAVE_ROUND 1
|
||||
#define HAVE_ROUNDF 1
|
||||
#define HAVE_SCALBN 1
|
||||
#define HAVE_SCALBNF 1
|
||||
#define HAVE_SIN 1
|
||||
#define HAVE_SINF 1
|
||||
#define HAVE_SQRT 1
|
||||
#define HAVE_SQRTF 1
|
||||
#define HAVE_TAN 1
|
||||
#define HAVE_TANF 1
|
||||
#define HAVE_TRUNC 1
|
||||
#define HAVE_TRUNCF 1
|
||||
#define HAVE_SIGACTION 1
|
||||
#define HAVE_SETJMP 1
|
||||
#define HAVE_NANOSLEEP 1
|
||||
#define HAVE_SYSCONF 1
|
||||
#define HAVE_SYSCTLBYNAME 1
|
||||
|
||||
#if defined(__has_include) && (defined(__i386__) || defined(__x86_64))
|
||||
# if __has_include(<immintrin.h>)
|
||||
# define HAVE_IMMINTRIN_H 1
|
||||
# endif
|
||||
#endif
|
||||
|
||||
#if (MAC_OS_X_VERSION_MAX_ALLOWED >= 1070)
|
||||
#define HAVE_O_CLOEXEC 1
|
||||
#endif
|
||||
|
||||
#define HAVE_GCC_ATOMICS 1
|
||||
|
||||
/* Enable various audio drivers */
|
||||
#define SDL_AUDIO_DRIVER_COREAUDIO 1
|
||||
#define SDL_AUDIO_DRIVER_DISK 1
|
||||
#define SDL_AUDIO_DRIVER_DUMMY 1
|
||||
|
||||
/* Enable various input drivers */
|
||||
#define SDL_JOYSTICK_HIDAPI 1
|
||||
#define SDL_JOYSTICK_IOKIT 1
|
||||
#define SDL_JOYSTICK_VIRTUAL 1
|
||||
#define SDL_HAPTIC_IOKIT 1
|
||||
|
||||
/* The MFI controller support requires ARC Objective C runtime */
|
||||
#if MAC_OS_X_VERSION_MIN_REQUIRED >= 1080 && !defined(__i386__)
|
||||
#define SDL_JOYSTICK_MFI 1
|
||||
#endif
|
||||
|
||||
/* Enable the dummy sensor driver */
|
||||
#define SDL_SENSOR_DUMMY 1
|
||||
|
||||
/* Enable various shared object loading systems */
|
||||
#define SDL_LOADSO_DLOPEN 1
|
||||
|
||||
/* Enable various threading systems */
|
||||
#define SDL_THREAD_PTHREAD 1
|
||||
#define SDL_THREAD_PTHREAD_RECURSIVE_MUTEX 1
|
||||
|
||||
/* Enable various timer systems */
|
||||
#define SDL_TIMER_UNIX 1
|
||||
|
||||
/* Enable various video drivers */
|
||||
#define SDL_VIDEO_DRIVER_COCOA 1
|
||||
#define SDL_VIDEO_DRIVER_DUMMY 1
|
||||
#undef SDL_VIDEO_DRIVER_X11
|
||||
#define SDL_VIDEO_DRIVER_X11_DYNAMIC "/opt/X11/lib/libX11.6.dylib"
|
||||
#define SDL_VIDEO_DRIVER_X11_DYNAMIC_XEXT "/opt/X11/lib/libXext.6.dylib"
|
||||
#define SDL_VIDEO_DRIVER_X11_DYNAMIC_XINERAMA "/opt/X11/lib/libXinerama.1.dylib"
|
||||
#define SDL_VIDEO_DRIVER_X11_DYNAMIC_XINPUT2 "/opt/X11/lib/libXi.6.dylib"
|
||||
#define SDL_VIDEO_DRIVER_X11_DYNAMIC_XRANDR "/opt/X11/lib/libXrandr.2.dylib"
|
||||
#define SDL_VIDEO_DRIVER_X11_DYNAMIC_XSS "/opt/X11/lib/libXss.1.dylib"
|
||||
#define SDL_VIDEO_DRIVER_X11_DYNAMIC_XVIDMODE "/opt/X11/lib/libXxf86vm.1.dylib"
|
||||
#define SDL_VIDEO_DRIVER_X11_XDBE 1
|
||||
#define SDL_VIDEO_DRIVER_X11_XINERAMA 1
|
||||
#define SDL_VIDEO_DRIVER_X11_XRANDR 1
|
||||
#define SDL_VIDEO_DRIVER_X11_XSCRNSAVER 1
|
||||
#define SDL_VIDEO_DRIVER_X11_XSHAPE 1
|
||||
#define SDL_VIDEO_DRIVER_X11_XVIDMODE 1
|
||||
#define SDL_VIDEO_DRIVER_X11_HAS_XKBKEYCODETOKEYSYM 1
|
||||
|
||||
#ifdef MAC_OS_X_VERSION_10_8
|
||||
/*
|
||||
* No matter the versions targeted, this is the 10.8 or later SDK, so you have
|
||||
* to use the external Xquartz, which is a more modern Xlib. Previous SDKs
|
||||
* used an older Xlib.
|
||||
*/
|
||||
#define SDL_VIDEO_DRIVER_X11_XINPUT2 1
|
||||
#define SDL_VIDEO_DRIVER_X11_SUPPORTS_GENERIC_EVENTS 1
|
||||
#endif
|
||||
|
||||
#ifndef SDL_VIDEO_RENDER_OGL
|
||||
#define SDL_VIDEO_RENDER_OGL 1
|
||||
#endif
|
||||
|
||||
#ifndef SDL_VIDEO_RENDER_OGL_ES2
|
||||
#define SDL_VIDEO_RENDER_OGL_ES2 1
|
||||
#endif
|
||||
|
||||
/* Metal only supported on 64-bit architectures with 10.11+ */
|
||||
#if TARGET_RT_64_BIT && (MAC_OS_X_VERSION_MAX_ALLOWED >= 101100)
|
||||
#define SDL_PLATFORM_SUPPORTS_METAL 1
|
||||
#else
|
||||
#define SDL_PLATFORM_SUPPORTS_METAL 0
|
||||
#endif
|
||||
|
||||
#ifndef SDL_VIDEO_RENDER_METAL
|
||||
#if SDL_PLATFORM_SUPPORTS_METAL
|
||||
#define SDL_VIDEO_RENDER_METAL 1
|
||||
#else
|
||||
#define SDL_VIDEO_RENDER_METAL 0
|
||||
#endif
|
||||
#endif
|
||||
|
||||
/* Enable OpenGL support */
|
||||
#ifndef SDL_VIDEO_OPENGL
|
||||
#define SDL_VIDEO_OPENGL 1
|
||||
#endif
|
||||
#ifndef SDL_VIDEO_OPENGL_ES2
|
||||
#define SDL_VIDEO_OPENGL_ES2 1
|
||||
#endif
|
||||
#ifndef SDL_VIDEO_OPENGL_EGL
|
||||
#define SDL_VIDEO_OPENGL_EGL 1
|
||||
#endif
|
||||
#ifndef SDL_VIDEO_OPENGL_CGL
|
||||
#define SDL_VIDEO_OPENGL_CGL 1
|
||||
#endif
|
||||
#ifndef SDL_VIDEO_OPENGL_GLX
|
||||
#define SDL_VIDEO_OPENGL_GLX 1
|
||||
#endif
|
||||
|
||||
/* Enable Vulkan and Metal support */
|
||||
#ifndef SDL_VIDEO_VULKAN
|
||||
#if SDL_PLATFORM_SUPPORTS_METAL
|
||||
#define SDL_VIDEO_VULKAN 1
|
||||
#else
|
||||
#define SDL_VIDEO_VULKAN 0
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#ifndef SDL_VIDEO_METAL
|
||||
#if SDL_PLATFORM_SUPPORTS_METAL
|
||||
#define SDL_VIDEO_METAL 1
|
||||
#else
|
||||
#define SDL_VIDEO_METAL 0
|
||||
#endif
|
||||
#endif
|
||||
|
||||
/* Enable system power support */
|
||||
#define SDL_POWER_MACOSX 1
|
||||
|
||||
/* enable filesystem support */
|
||||
#define SDL_FILESYSTEM_COCOA 1
|
||||
|
||||
/* Enable assembly routines */
|
||||
#define SDL_ASSEMBLY_ROUTINES 1
|
||||
#ifdef __ppc__
|
||||
#define SDL_ALTIVEC_BLITTERS 1
|
||||
#endif
|
||||
|
||||
#endif /* SDL_config_macosx_h_ */
|
||||
@@ -1,205 +0,0 @@
|
||||
/*
|
||||
Simple DirectMedia Layer
|
||||
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.
|
||||
*/
|
||||
|
||||
#ifndef SDL_config_os2_h_
|
||||
#define SDL_config_os2_h_
|
||||
#define SDL_config_h_
|
||||
|
||||
#include "SDL_platform.h"
|
||||
|
||||
#define SIZEOF_VOIDP 4
|
||||
|
||||
#define SDL_AUDIO_DRIVER_DUMMY 1
|
||||
#define SDL_AUDIO_DRIVER_DISK 1
|
||||
#define SDL_AUDIO_DRIVER_OS2 1
|
||||
|
||||
#define SDL_POWER_DISABLED 1
|
||||
#define SDL_HAPTIC_DISABLED 1
|
||||
|
||||
#define SDL_SENSOR_DUMMY 1
|
||||
#define SDL_VIDEO_DRIVER_DUMMY 1
|
||||
#define SDL_VIDEO_DRIVER_OS2 1
|
||||
#define SDL_JOYSTICK_OS2 1
|
||||
#ifndef HAVE_LIBUSB_H /* see Makefile */
|
||||
#define SDL_HIDAPI_DISABLED 1
|
||||
/*#undef SDL_JOYSTICK_HIDAPI */
|
||||
#else
|
||||
#define SDL_JOYSTICK_HIDAPI 1
|
||||
/* dynamically loaded libusb-1.0 dll: */
|
||||
#define SDL_LIBUSB_DYNAMIC "usb100.dll"
|
||||
#endif
|
||||
/*#undef SDL_JOYSTICK_VIRTUAL */
|
||||
|
||||
/* Enable OpenGL support */
|
||||
/* #undef SDL_VIDEO_OPENGL */
|
||||
|
||||
#define SDL_THREAD_OS2 1
|
||||
#define SDL_LOADSO_OS2 1
|
||||
#define SDL_TIMER_OS2 1
|
||||
#define SDL_FILESYSTEM_OS2 1
|
||||
|
||||
/* Enable assembly routines */
|
||||
#define SDL_ASSEMBLY_ROUTINES 1
|
||||
|
||||
/* use libsamplerate for audio rate conversion. */
|
||||
/*#define HAVE_LIBSAMPLERATE_H 1 */
|
||||
|
||||
/* Enable dynamic libsamplerate support */
|
||||
#define SDL_LIBSAMPLERATE_DYNAMIC "SAMPRATE.DLL"
|
||||
|
||||
#define HAVE_LIBC 1
|
||||
|
||||
#define HAVE_STDARG_H 1
|
||||
#define HAVE_STDDEF_H 1
|
||||
#define HAVE_STDINT_H 1
|
||||
|
||||
#define HAVE_SYS_TYPES_H 1
|
||||
#define HAVE_STDIO_H 1
|
||||
#define STDC_HEADERS 1
|
||||
#define HAVE_STDLIB_H 1
|
||||
#define HAVE_MALLOC_H 1
|
||||
#define HAVE_MEMORY_H 1
|
||||
#define HAVE_STRING_H 1
|
||||
#define HAVE_STRINGS_H 1
|
||||
#define HAVE_WCHAR_H 1
|
||||
#define HAVE_INTTYPES_H 1
|
||||
#define HAVE_LIMITS_H 1
|
||||
#define HAVE_CTYPE_H 1
|
||||
#define HAVE_MATH_H 1
|
||||
#define HAVE_FLOAT_H 1
|
||||
#define HAVE_SIGNAL_H 1
|
||||
|
||||
#if 0 /* see Makefile */
|
||||
#define HAVE_ICONV 1
|
||||
#define HAVE_ICONV_H 1
|
||||
#endif
|
||||
|
||||
/* #undef HAVE_DLOPEN */
|
||||
#define HAVE_MALLOC 1
|
||||
#define HAVE_CALLOC 1
|
||||
#define HAVE_REALLOC 1
|
||||
#define HAVE_FREE 1
|
||||
#if defined(__WATCOMC__)
|
||||
#define HAVE__FSEEKI64 1
|
||||
#define HAVE__FTELLI64 1
|
||||
#endif
|
||||
#define HAVE_ALLOCA 1
|
||||
#define HAVE_GETENV 1
|
||||
#define HAVE_SETENV 1
|
||||
#define HAVE_PUTENV 1
|
||||
#define HAVE_QSORT 1
|
||||
#define HAVE_ABS 1
|
||||
#define HAVE_BCOPY 1
|
||||
#define HAVE_MEMSET 1
|
||||
#define HAVE_MEMCPY 1
|
||||
#define HAVE_MEMMOVE 1
|
||||
#define HAVE_MEMCMP 1
|
||||
#define HAVE_WCSLEN 1
|
||||
#define HAVE_WCSLCPY 1
|
||||
#define HAVE_WCSLCAT 1
|
||||
#define HAVE_WCSCMP 1
|
||||
#define HAVE__WCSICMP 1
|
||||
#define HAVE__WCSNICMP 1
|
||||
#define HAVE_WCSLEN 1
|
||||
#define HAVE_WCSLCPY 1
|
||||
#define HAVE_WCSLCAT 1
|
||||
/* #undef HAVE_WCSDUP */
|
||||
#define HAVE__WCSDUP 1
|
||||
#define HAVE_WCSSTR 1
|
||||
#define HAVE_WCSCMP 1
|
||||
#define HAVE_WCSNCMP 1
|
||||
#define HAVE_STRLEN 1
|
||||
#define HAVE_STRLCPY 1
|
||||
#define HAVE_STRLCAT 1
|
||||
#define HAVE__STRREV 1
|
||||
#define HAVE__STRUPR 1
|
||||
#define HAVE__STRLWR 1
|
||||
/* #undef HAVE_INDEX */
|
||||
/* #undef HAVE_RINDEX */
|
||||
#define HAVE_STRCHR 1
|
||||
#define HAVE_STRRCHR 1
|
||||
#define HAVE_STRSTR 1
|
||||
/* #undef HAVE_STRTOK_R */
|
||||
#define HAVE_ITOA 1
|
||||
#define HAVE__LTOA 1
|
||||
#define HAVE__ULTOA 1
|
||||
#define HAVE_STRTOL 1
|
||||
#define HAVE_STRTOUL 1
|
||||
#define HAVE__I64TOA 1
|
||||
#define HAVE__UI64TOA 1
|
||||
#define HAVE_STRTOLL 1
|
||||
#define HAVE_STRTOULL 1
|
||||
#define HAVE_STRTOD 1
|
||||
#define HAVE_ATOI 1
|
||||
#define HAVE_ATOF 1
|
||||
#define HAVE_STRCMP 1
|
||||
#define HAVE_STRNCMP 1
|
||||
#define HAVE_STRICMP 1
|
||||
#define HAVE_STRCASECMP 1
|
||||
#define HAVE_STRNCASECMP 1
|
||||
#define HAVE_SSCANF 1
|
||||
#define HAVE_VSSCANF 1
|
||||
#define HAVE_SNPRINTF 1
|
||||
#define HAVE_VSNPRINTF 1
|
||||
#define HAVE_SETJMP 1
|
||||
#define HAVE_ACOS 1
|
||||
/* #undef HAVE_ACOSF */
|
||||
#define HAVE_ASIN 1
|
||||
/* #undef HAVE_ASINF */
|
||||
#define HAVE_ATAN 1
|
||||
#define HAVE_ATAN2 1
|
||||
/* #undef HAVE_ATAN2F */
|
||||
#define HAVE_CEIL 1
|
||||
/* #undef HAVE_CEILF */
|
||||
/* #undef HAVE_COPYSIGN */
|
||||
/* #undef HAVE_COPYSIGNF */
|
||||
#define HAVE_COS 1
|
||||
/* #undef HAVE_COSF */
|
||||
#define HAVE_EXP 1
|
||||
/* #undef HAVE_EXPF */
|
||||
#define HAVE_FABS 1
|
||||
/* #undef HAVE_FABSF */
|
||||
#define HAVE_FLOOR 1
|
||||
/* #undef HAVE_FLOORF */
|
||||
#define HAVE_FMOD 1
|
||||
/* #undef HAVE_FMODF */
|
||||
#define HAVE_LOG 1
|
||||
/* #undef HAVE_LOGF */
|
||||
#define HAVE_LOG10 1
|
||||
/* #undef HAVE_LOG10F */
|
||||
#define HAVE_POW 1
|
||||
/* #undef HAVE_POWF */
|
||||
#define HAVE_SIN 1
|
||||
/* #undef HAVE_SINF */
|
||||
/* #undef HAVE_SCALBN */
|
||||
/* #undef HAVE_SCALBNF */
|
||||
#define HAVE_SQRT 1
|
||||
/* #undef HAVE_SQRTF */
|
||||
#define HAVE_TAN 1
|
||||
/* #undef HAVE_TANF */
|
||||
/* #undef HAVE_TRUNC */
|
||||
/* #undef HAVE_TRUNCF */
|
||||
/* #undef HAVE_LROUND */
|
||||
/* #undef HAVE_LROUNDF */
|
||||
/* #undef HAVE_ROUND */
|
||||
/* #undef HAVE_ROUNDF */
|
||||
|
||||
#endif /* SDL_config_os2_h_ */
|
||||
@@ -1,140 +0,0 @@
|
||||
/*
|
||||
Simple DirectMedia Layer
|
||||
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.
|
||||
*/
|
||||
|
||||
#ifndef SDL_config_pandora_h_
|
||||
#define SDL_config_pandora_h_
|
||||
#define SDL_config_h_
|
||||
|
||||
/* This is a set of defines to configure the SDL features */
|
||||
|
||||
/* General platform specific identifiers */
|
||||
#include "SDL_platform.h"
|
||||
|
||||
#ifdef __LP64__
|
||||
#define SIZEOF_VOIDP 8
|
||||
#else
|
||||
#define SIZEOF_VOIDP 4
|
||||
#endif
|
||||
|
||||
#define SDL_BYTEORDER 1234
|
||||
|
||||
#define STDC_HEADERS 1
|
||||
#define HAVE_ALLOCA_H 1
|
||||
#define HAVE_CTYPE_H 1
|
||||
#define HAVE_ICONV_H 1
|
||||
#define HAVE_INTTYPES_H 1
|
||||
#define HAVE_LIMITS_H 1
|
||||
#define HAVE_MALLOC_H 1
|
||||
#define HAVE_MATH_H 1
|
||||
#define HAVE_MEMORY_H 1
|
||||
#define HAVE_SIGNAL_H 1
|
||||
#define HAVE_STDARG_H 1
|
||||
#define HAVE_STDINT_H 1
|
||||
#define HAVE_STDIO_H 1
|
||||
#define HAVE_STDLIB_H 1
|
||||
#define HAVE_STRINGS_H 1
|
||||
#define HAVE_STRING_H 1
|
||||
#define HAVE_SYS_TYPES_H 1
|
||||
|
||||
#define HAVE_DLOPEN 1
|
||||
#define HAVE_MALLOC 1
|
||||
#define HAVE_CALLOC 1
|
||||
#define HAVE_REALLOC 1
|
||||
#define HAVE_FREE 1
|
||||
#define HAVE_ALLOCA 1
|
||||
#define HAVE_GETENV 1
|
||||
#define HAVE_SETENV 1
|
||||
#define HAVE_PUTENV 1
|
||||
#define HAVE_UNSETENV 1
|
||||
#define HAVE_QSORT 1
|
||||
#define HAVE_ABS 1
|
||||
#define HAVE_BCOPY 1
|
||||
#define HAVE_MEMSET 1
|
||||
#define HAVE_MEMCPY 1
|
||||
#define HAVE_MEMMOVE 1
|
||||
#define HAVE_STRLEN 1
|
||||
#define HAVE_STRCHR 1
|
||||
#define HAVE_STRRCHR 1
|
||||
#define HAVE_STRSTR 1
|
||||
#define HAVE_STRTOL 1
|
||||
#define HAVE_STRTOUL 1
|
||||
#define HAVE_STRTOLL 1
|
||||
#define HAVE_STRTOULL 1
|
||||
#define HAVE_ATOI 1
|
||||
#define HAVE_ATOF 1
|
||||
#define HAVE_STRCMP 1
|
||||
#define HAVE_STRNCMP 1
|
||||
#define HAVE_STRCASECMP 1
|
||||
#define HAVE_STRNCASECMP 1
|
||||
#define HAVE_VSSCANF 1
|
||||
#define HAVE_VSNPRINTF 1
|
||||
#define HAVE_M_PI 1
|
||||
#define HAVE_CEIL 1
|
||||
#define HAVE_COPYSIGN 1
|
||||
#define HAVE_COS 1
|
||||
#define HAVE_COSF 1
|
||||
#define HAVE_EXP 1
|
||||
#define HAVE_FABS 1
|
||||
#define HAVE_FLOOR 1
|
||||
#define HAVE_LOG 1
|
||||
#define HAVE_LOG10 1
|
||||
#define HAVE_LROUND 1
|
||||
#define HAVE_LROUNDF 1
|
||||
#define HAVE_ROUND 1
|
||||
#define HAVE_ROUNDF 1
|
||||
#define HAVE_SCALBN 1
|
||||
#define HAVE_SIN 1
|
||||
#define HAVE_SINF 1
|
||||
#define HAVE_SQRT 1
|
||||
#define HAVE_SQRTF 1
|
||||
#define HAVE_TAN 1
|
||||
#define HAVE_TANF 1
|
||||
#define HAVE_TRUNC 1
|
||||
#define HAVE_TRUNCF 1
|
||||
#define HAVE_SIGACTION 1
|
||||
#define HAVE_SETJMP 1
|
||||
#define HAVE_NANOSLEEP 1
|
||||
|
||||
#define SDL_AUDIO_DRIVER_DUMMY 1
|
||||
#define SDL_AUDIO_DRIVER_OSS 1
|
||||
|
||||
#define SDL_INPUT_LINUXEV 1
|
||||
#define SDL_JOYSTICK_LINUX 1
|
||||
#define SDL_JOYSTICK_VIRTUAL 1
|
||||
#define SDL_HAPTIC_LINUX 1
|
||||
|
||||
#define SDL_SENSOR_DUMMY 1
|
||||
|
||||
#define SDL_LOADSO_DLOPEN 1
|
||||
|
||||
#define SDL_THREAD_PTHREAD 1
|
||||
#define SDL_THREAD_PTHREAD_RECURSIVE_MUTEX_NP 1
|
||||
|
||||
#define SDL_TIMER_UNIX 1
|
||||
#define SDL_FILESYSTEM_UNIX 1
|
||||
|
||||
#define SDL_VIDEO_DRIVER_DUMMY 1
|
||||
#define SDL_VIDEO_DRIVER_X11 1
|
||||
#define SDL_VIDEO_DRIVER_PANDORA 1
|
||||
#define SDL_VIDEO_RENDER_OGL_ES 1
|
||||
#define SDL_VIDEO_OPENGL_ES 1
|
||||
|
||||
#endif /* SDL_config_pandora_h_ */
|
||||
@@ -1,310 +0,0 @@
|
||||
/*
|
||||
Simple DirectMedia Layer
|
||||
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.
|
||||
*/
|
||||
|
||||
#ifndef SDL_config_windows_h_
|
||||
#define SDL_config_windows_h_
|
||||
#define SDL_config_h_
|
||||
|
||||
#include "SDL_platform.h"
|
||||
|
||||
/* winsdkver.h defines _WIN32_MAXVER for SDK version detection. It is present since at least the Windows 7 SDK,
|
||||
* but out of caution we'll only use it if the compiler supports __has_include() to confirm its presence.
|
||||
* If your compiler doesn't support __has_include() but you have winsdkver.h, define HAVE_WINSDKVER_H. */
|
||||
#if !defined(HAVE_WINSDKVER_H) && defined(__has_include)
|
||||
#if __has_include(<winsdkver.h>)
|
||||
#define HAVE_WINSDKVER_H 1
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#ifdef HAVE_WINSDKVER_H
|
||||
#include <winsdkver.h>
|
||||
#endif
|
||||
|
||||
/* This is a set of defines to configure the SDL features */
|
||||
|
||||
#if !defined(_STDINT_H_) && (!defined(HAVE_STDINT_H) || !_HAVE_STDINT_H)
|
||||
#if defined(__GNUC__) || defined(__DMC__) || defined(__WATCOMC__) || defined(__clang__) || defined(__BORLANDC__) || defined(__CODEGEARC__)
|
||||
#define HAVE_STDINT_H 1
|
||||
#elif defined(_MSC_VER)
|
||||
typedef signed __int8 int8_t;
|
||||
typedef unsigned __int8 uint8_t;
|
||||
typedef signed __int16 int16_t;
|
||||
typedef unsigned __int16 uint16_t;
|
||||
typedef signed __int32 int32_t;
|
||||
typedef unsigned __int32 uint32_t;
|
||||
typedef signed __int64 int64_t;
|
||||
typedef unsigned __int64 uint64_t;
|
||||
#ifndef _UINTPTR_T_DEFINED
|
||||
#ifdef _WIN64
|
||||
typedef unsigned __int64 uintptr_t;
|
||||
#else
|
||||
typedef unsigned int uintptr_t;
|
||||
#endif
|
||||
#define _UINTPTR_T_DEFINED
|
||||
#endif
|
||||
/* Older Visual C++ headers don't have the Win64-compatible typedefs... */
|
||||
#if ((_MSC_VER <= 1200) && (!defined(DWORD_PTR)))
|
||||
#define DWORD_PTR DWORD
|
||||
#endif
|
||||
#if ((_MSC_VER <= 1200) && (!defined(LONG_PTR)))
|
||||
#define LONG_PTR LONG
|
||||
#endif
|
||||
#else /* !__GNUC__ && !_MSC_VER */
|
||||
typedef signed char int8_t;
|
||||
typedef unsigned char uint8_t;
|
||||
typedef signed short int16_t;
|
||||
typedef unsigned short uint16_t;
|
||||
typedef signed int int32_t;
|
||||
typedef unsigned int uint32_t;
|
||||
typedef signed long long int64_t;
|
||||
typedef unsigned long long uint64_t;
|
||||
#ifndef _SIZE_T_DEFINED_
|
||||
#define _SIZE_T_DEFINED_
|
||||
typedef unsigned int size_t;
|
||||
#endif
|
||||
typedef unsigned int uintptr_t;
|
||||
#endif /* __GNUC__ || _MSC_VER */
|
||||
#endif /* !_STDINT_H_ && !HAVE_STDINT_H */
|
||||
|
||||
#ifdef _WIN64
|
||||
# define SIZEOF_VOIDP 8
|
||||
#else
|
||||
# define SIZEOF_VOIDP 4
|
||||
#endif
|
||||
|
||||
#ifdef __clang__
|
||||
# define HAVE_GCC_ATOMICS 1
|
||||
#endif
|
||||
|
||||
#define HAVE_DDRAW_H 1
|
||||
#define HAVE_DINPUT_H 1
|
||||
#define HAVE_DSOUND_H 1
|
||||
#define HAVE_DXGI_H 1
|
||||
#define HAVE_XINPUT_H 1
|
||||
#if defined(_WIN32_MAXVER) && _WIN32_MAXVER >= 0x0A00 /* Windows 10 SDK */
|
||||
#define HAVE_WINDOWS_GAMING_INPUT_H 1
|
||||
#endif
|
||||
#if defined(_WIN32_MAXVER) && _WIN32_MAXVER >= 0x0602 /* Windows 8 SDK */
|
||||
#define HAVE_D3D11_H 1
|
||||
#define HAVE_ROAPI_H 1
|
||||
#endif
|
||||
#define HAVE_MMDEVICEAPI_H 1
|
||||
#define HAVE_AUDIOCLIENT_H 1
|
||||
#define HAVE_TPCSHRD_H 1
|
||||
#define HAVE_SENSORSAPI_H 1
|
||||
#if (defined(_M_IX86) || defined(_M_X64) || defined(_M_AMD64)) && (defined(_MSC_VER) && _MSC_VER >= 1600)
|
||||
#define HAVE_IMMINTRIN_H 1
|
||||
#elif defined(__has_include) && (defined(__i386__) || defined(__x86_64))
|
||||
# if __has_include(<immintrin.h>)
|
||||
# define HAVE_IMMINTRIN_H 1
|
||||
# endif
|
||||
#endif
|
||||
|
||||
/* This is disabled by default to avoid C runtime dependencies and manifest requirements */
|
||||
#ifdef HAVE_LIBC
|
||||
/* Useful headers */
|
||||
#define STDC_HEADERS 1
|
||||
#define HAVE_CTYPE_H 1
|
||||
#define HAVE_FLOAT_H 1
|
||||
#define HAVE_LIMITS_H 1
|
||||
#define HAVE_MATH_H 1
|
||||
#define HAVE_SIGNAL_H 1
|
||||
#define HAVE_STDIO_H 1
|
||||
#define HAVE_STRING_H 1
|
||||
|
||||
/* C library functions */
|
||||
#define HAVE_MALLOC 1
|
||||
#define HAVE_CALLOC 1
|
||||
#define HAVE_REALLOC 1
|
||||
#define HAVE_FREE 1
|
||||
#define HAVE_ALLOCA 1
|
||||
#define HAVE_QSORT 1
|
||||
#define HAVE_ABS 1
|
||||
#define HAVE_MEMSET 1
|
||||
#define HAVE_MEMCPY 1
|
||||
#define HAVE_MEMMOVE 1
|
||||
#define HAVE_MEMCMP 1
|
||||
#define HAVE_STRLEN 1
|
||||
#define HAVE__STRREV 1
|
||||
/* These functions have security warnings, so we won't use them */
|
||||
/* #undef HAVE__STRUPR */
|
||||
/* #undef HAVE__STRLWR */
|
||||
#define HAVE_STRCHR 1
|
||||
#define HAVE_STRRCHR 1
|
||||
#define HAVE_STRSTR 1
|
||||
/* #undef HAVE_STRTOK_R */
|
||||
/* These functions have security warnings, so we won't use them */
|
||||
/* #undef HAVE__LTOA */
|
||||
/* #undef HAVE__ULTOA */
|
||||
#define HAVE_STRTOL 1
|
||||
#define HAVE_STRTOUL 1
|
||||
#define HAVE_STRTOD 1
|
||||
#define HAVE_ATOI 1
|
||||
#define HAVE_ATOF 1
|
||||
#define HAVE_STRCMP 1
|
||||
#define HAVE_STRNCMP 1
|
||||
#define HAVE__STRICMP 1
|
||||
#define HAVE__STRNICMP 1
|
||||
#define HAVE__WCSICMP 1
|
||||
#define HAVE__WCSNICMP 1
|
||||
#define HAVE__WCSDUP 1
|
||||
#define HAVE_ACOS 1
|
||||
#define HAVE_ACOSF 1
|
||||
#define HAVE_ASIN 1
|
||||
#define HAVE_ASINF 1
|
||||
#define HAVE_ATAN 1
|
||||
#define HAVE_ATANF 1
|
||||
#define HAVE_ATAN2 1
|
||||
#define HAVE_ATAN2F 1
|
||||
#define HAVE_CEILF 1
|
||||
#define HAVE__COPYSIGN 1
|
||||
#define HAVE_COS 1
|
||||
#define HAVE_COSF 1
|
||||
#define HAVE_EXP 1
|
||||
#define HAVE_EXPF 1
|
||||
#define HAVE_FABS 1
|
||||
#define HAVE_FABSF 1
|
||||
#define HAVE_FLOOR 1
|
||||
#define HAVE_FLOORF 1
|
||||
#define HAVE_FMOD 1
|
||||
#define HAVE_FMODF 1
|
||||
#define HAVE_LOG 1
|
||||
#define HAVE_LOGF 1
|
||||
#define HAVE_LOG10 1
|
||||
#define HAVE_LOG10F 1
|
||||
#define HAVE_POW 1
|
||||
#define HAVE_POWF 1
|
||||
#define HAVE_SIN 1
|
||||
#define HAVE_SINF 1
|
||||
#define HAVE_SQRT 1
|
||||
#define HAVE_SQRTF 1
|
||||
#define HAVE_TAN 1
|
||||
#define HAVE_TANF 1
|
||||
#if defined(_MSC_VER)
|
||||
/* These functions were added with the VC++ 2013 C runtime library */
|
||||
#if _MSC_VER >= 1800
|
||||
#define HAVE_STRTOLL 1
|
||||
#define HAVE_STRTOULL 1
|
||||
#define HAVE_VSSCANF 1
|
||||
#define HAVE_LROUND 1
|
||||
#define HAVE_LROUNDF 1
|
||||
#define HAVE_ROUND 1
|
||||
#define HAVE_ROUNDF 1
|
||||
#define HAVE_SCALBN 1
|
||||
#define HAVE_SCALBNF 1
|
||||
#define HAVE_TRUNC 1
|
||||
#define HAVE_TRUNCF 1
|
||||
#endif
|
||||
/* This function is available with at least the VC++ 2008 C runtime library */
|
||||
#if _MSC_VER >= 1400
|
||||
#define HAVE__FSEEKI64 1
|
||||
#endif
|
||||
#endif
|
||||
#if !defined(_MSC_VER) || defined(_USE_MATH_DEFINES)
|
||||
#define HAVE_M_PI 1
|
||||
#endif
|
||||
#else
|
||||
#define HAVE_STDARG_H 1
|
||||
#define HAVE_STDDEF_H 1
|
||||
#endif
|
||||
|
||||
/* Enable various audio drivers */
|
||||
#define SDL_AUDIO_DRIVER_WASAPI 1
|
||||
#define SDL_AUDIO_DRIVER_DSOUND 1
|
||||
#define SDL_AUDIO_DRIVER_WINMM 1
|
||||
#define SDL_AUDIO_DRIVER_DISK 1
|
||||
#define SDL_AUDIO_DRIVER_DUMMY 1
|
||||
|
||||
/* Enable various input drivers */
|
||||
#define SDL_JOYSTICK_DINPUT 1
|
||||
#define SDL_JOYSTICK_HIDAPI 1
|
||||
#ifndef __WINRT__
|
||||
#define SDL_JOYSTICK_RAWINPUT 1
|
||||
#endif
|
||||
#define SDL_JOYSTICK_VIRTUAL 1
|
||||
#ifdef HAVE_WINDOWS_GAMING_INPUT_H
|
||||
#define SDL_JOYSTICK_WGI 1
|
||||
#endif
|
||||
#define SDL_JOYSTICK_XINPUT 1
|
||||
#define SDL_HAPTIC_DINPUT 1
|
||||
#define SDL_HAPTIC_XINPUT 1
|
||||
|
||||
/* Enable the sensor driver */
|
||||
#define SDL_SENSOR_WINDOWS 1
|
||||
|
||||
/* Enable various shared object loading systems */
|
||||
#define SDL_LOADSO_WINDOWS 1
|
||||
|
||||
/* Enable various threading systems */
|
||||
#define SDL_THREAD_GENERIC_COND_SUFFIX 1
|
||||
#define SDL_THREAD_WINDOWS 1
|
||||
|
||||
/* Enable various timer systems */
|
||||
#define SDL_TIMER_WINDOWS 1
|
||||
|
||||
/* Enable various video drivers */
|
||||
#define SDL_VIDEO_DRIVER_DUMMY 1
|
||||
#define SDL_VIDEO_DRIVER_WINDOWS 1
|
||||
|
||||
#ifndef SDL_VIDEO_RENDER_D3D
|
||||
#define SDL_VIDEO_RENDER_D3D 1
|
||||
#endif
|
||||
#if !defined(SDL_VIDEO_RENDER_D3D11) && defined(HAVE_D3D11_H)
|
||||
#define SDL_VIDEO_RENDER_D3D11 1
|
||||
#endif
|
||||
|
||||
/* Enable OpenGL support */
|
||||
#ifndef SDL_VIDEO_OPENGL
|
||||
#define SDL_VIDEO_OPENGL 1
|
||||
#endif
|
||||
#ifndef SDL_VIDEO_OPENGL_WGL
|
||||
#define SDL_VIDEO_OPENGL_WGL 1
|
||||
#endif
|
||||
#ifndef SDL_VIDEO_RENDER_OGL
|
||||
#define SDL_VIDEO_RENDER_OGL 1
|
||||
#endif
|
||||
#ifndef SDL_VIDEO_RENDER_OGL_ES2
|
||||
#define SDL_VIDEO_RENDER_OGL_ES2 1
|
||||
#endif
|
||||
#ifndef SDL_VIDEO_OPENGL_ES2
|
||||
#define SDL_VIDEO_OPENGL_ES2 1
|
||||
#endif
|
||||
#ifndef SDL_VIDEO_OPENGL_EGL
|
||||
#define SDL_VIDEO_OPENGL_EGL 1
|
||||
#endif
|
||||
|
||||
/* Enable Vulkan support */
|
||||
#define SDL_VIDEO_VULKAN 1
|
||||
|
||||
/* Enable system power support */
|
||||
#define SDL_POWER_WINDOWS 1
|
||||
|
||||
/* Enable filesystem support */
|
||||
#define SDL_FILESYSTEM_WINDOWS 1
|
||||
|
||||
/* Enable assembly routines (Win64 doesn't have inline asm) */
|
||||
#ifndef _WIN64
|
||||
#define SDL_ASSEMBLY_ROUTINES 1
|
||||
#endif
|
||||
|
||||
#endif /* SDL_config_windows_h_ */
|
||||
|
||||
/* vi: set ts=4 sw=4 expandtab: */
|
||||
@@ -1,264 +0,0 @@
|
||||
/*
|
||||
Simple DirectMedia Layer
|
||||
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.
|
||||
*/
|
||||
|
||||
#ifndef SDL_config_winrt_h_
|
||||
#define SDL_config_winrt_h_
|
||||
#define SDL_config_h_
|
||||
|
||||
#include "SDL_platform.h"
|
||||
|
||||
/* Make sure the Windows SDK's NTDDI_VERSION macro gets defined. This is used
|
||||
by SDL to determine which version of the Windows SDK is being used.
|
||||
*/
|
||||
#include <sdkddkver.h>
|
||||
|
||||
/* Define possibly-undefined NTDDI values (used when compiling SDL against
|
||||
older versions of the Windows SDK.
|
||||
*/
|
||||
#ifndef NTDDI_WINBLUE
|
||||
#define NTDDI_WINBLUE 0x06030000
|
||||
#endif
|
||||
#ifndef NTDDI_WIN10
|
||||
#define NTDDI_WIN10 0x0A000000
|
||||
#endif
|
||||
|
||||
/* This is a set of defines to configure the SDL features */
|
||||
|
||||
#if !defined(_STDINT_H_) && (!defined(HAVE_STDINT_H) || !_HAVE_STDINT_H)
|
||||
#if defined(__GNUC__) || defined(__DMC__) || defined(__WATCOMC__)
|
||||
#define HAVE_STDINT_H 1
|
||||
#elif defined(_MSC_VER)
|
||||
typedef signed __int8 int8_t;
|
||||
typedef unsigned __int8 uint8_t;
|
||||
typedef signed __int16 int16_t;
|
||||
typedef unsigned __int16 uint16_t;
|
||||
typedef signed __int32 int32_t;
|
||||
typedef unsigned __int32 uint32_t;
|
||||
typedef signed __int64 int64_t;
|
||||
typedef unsigned __int64 uint64_t;
|
||||
#ifndef _UINTPTR_T_DEFINED
|
||||
#ifdef _WIN64
|
||||
typedef unsigned __int64 uintptr_t;
|
||||
#else
|
||||
typedef unsigned int uintptr_t;
|
||||
#endif
|
||||
#define _UINTPTR_T_DEFINED
|
||||
#endif
|
||||
/* Older Visual C++ headers don't have the Win64-compatible typedefs... */
|
||||
#if ((_MSC_VER <= 1200) && (!defined(DWORD_PTR)))
|
||||
#define DWORD_PTR DWORD
|
||||
#endif
|
||||
#if ((_MSC_VER <= 1200) && (!defined(LONG_PTR)))
|
||||
#define LONG_PTR LONG
|
||||
#endif
|
||||
#else /* !__GNUC__ && !_MSC_VER */
|
||||
typedef signed char int8_t;
|
||||
typedef unsigned char uint8_t;
|
||||
typedef signed short int16_t;
|
||||
typedef unsigned short uint16_t;
|
||||
typedef signed int int32_t;
|
||||
typedef unsigned int uint32_t;
|
||||
typedef signed long long int64_t;
|
||||
typedef unsigned long long uint64_t;
|
||||
#ifndef _SIZE_T_DEFINED_
|
||||
#define _SIZE_T_DEFINED_
|
||||
typedef unsigned int size_t;
|
||||
#endif
|
||||
typedef unsigned int uintptr_t;
|
||||
#endif /* __GNUC__ || _MSC_VER */
|
||||
#endif /* !_STDINT_H_ && !HAVE_STDINT_H */
|
||||
|
||||
#ifdef _WIN64
|
||||
# define SIZEOF_VOIDP 8
|
||||
#else
|
||||
# define SIZEOF_VOIDP 4
|
||||
#endif
|
||||
|
||||
#ifdef __clang__
|
||||
# define HAVE_GCC_ATOMICS 1
|
||||
#endif
|
||||
|
||||
/* Useful headers */
|
||||
#define HAVE_DXGI_H 1
|
||||
#if WINAPI_FAMILY != WINAPI_FAMILY_PHONE_APP
|
||||
#define HAVE_XINPUT_H 1
|
||||
#endif
|
||||
|
||||
#define HAVE_MMDEVICEAPI_H 1
|
||||
#define HAVE_AUDIOCLIENT_H 1
|
||||
#define HAVE_TPCSHRD_H 1
|
||||
|
||||
#define HAVE_LIBC 1
|
||||
#define STDC_HEADERS 1
|
||||
#define HAVE_CTYPE_H 1
|
||||
#define HAVE_FLOAT_H 1
|
||||
#define HAVE_LIMITS_H 1
|
||||
#define HAVE_MATH_H 1
|
||||
#define HAVE_SIGNAL_H 1
|
||||
#define HAVE_STDIO_H 1
|
||||
#define HAVE_STRING_H 1
|
||||
|
||||
/* C library functions */
|
||||
#define HAVE_MALLOC 1
|
||||
#define HAVE_CALLOC 1
|
||||
#define HAVE_REALLOC 1
|
||||
#define HAVE_FREE 1
|
||||
#define HAVE_ALLOCA 1
|
||||
#define HAVE_QSORT 1
|
||||
#define HAVE_ABS 1
|
||||
#define HAVE_MEMSET 1
|
||||
#define HAVE_MEMCPY 1
|
||||
#define HAVE_MEMMOVE 1
|
||||
#define HAVE_MEMCMP 1
|
||||
#define HAVE_STRLEN 1
|
||||
#define HAVE__STRREV 1
|
||||
#define HAVE__STRUPR 1
|
||||
#define HAVE_STRCHR 1
|
||||
#define HAVE_STRRCHR 1
|
||||
#define HAVE_STRSTR 1
|
||||
#define HAVE_STRTOL 1
|
||||
#define HAVE_STRTOUL 1
|
||||
/* #undef HAVE_STRTOLL */
|
||||
/* #undef HAVE_STRTOULL */
|
||||
#define HAVE_STRTOD 1
|
||||
#define HAVE_ATOI 1
|
||||
#define HAVE_ATOF 1
|
||||
#define HAVE_STRCMP 1
|
||||
#define HAVE_STRNCMP 1
|
||||
#define HAVE__STRICMP 1
|
||||
#define HAVE__STRNICMP 1
|
||||
#define HAVE_VSNPRINTF 1
|
||||
/* TODO, WinRT: consider using ??_s versions of the following */
|
||||
/* #undef HAVE__STRLWR */
|
||||
/* #undef HAVE_ITOA */
|
||||
/* #undef HAVE__LTOA */
|
||||
/* #undef HAVE__ULTOA */
|
||||
/* #undef HAVE_SSCANF */
|
||||
#define HAVE_M_PI 1
|
||||
#define HAVE_ACOS 1
|
||||
#define HAVE_ACOSF 1
|
||||
#define HAVE_ASIN 1
|
||||
#define HAVE_ASINF 1
|
||||
#define HAVE_ATAN 1
|
||||
#define HAVE_ATANF 1
|
||||
#define HAVE_ATAN2 1
|
||||
#define HAVE_ATAN2F 1
|
||||
#define HAVE_CEIL 1
|
||||
#define HAVE_CEILF 1
|
||||
#define HAVE__COPYSIGN 1
|
||||
#define HAVE_COS 1
|
||||
#define HAVE_COSF 1
|
||||
#define HAVE_EXP 1
|
||||
#define HAVE_EXPF 1
|
||||
#define HAVE_FABS 1
|
||||
#define HAVE_FABSF 1
|
||||
#define HAVE_FLOOR 1
|
||||
#define HAVE_FLOORF 1
|
||||
#define HAVE_FMOD 1
|
||||
#define HAVE_FMODF 1
|
||||
#define HAVE_LOG 1
|
||||
#define HAVE_LOGF 1
|
||||
#define HAVE_LOG10 1
|
||||
#define HAVE_LOG10F 1
|
||||
#define HAVE_LROUND 1
|
||||
#define HAVE_LROUNDF 1
|
||||
#define HAVE_POW 1
|
||||
#define HAVE_POWF 1
|
||||
#define HAVE_ROUND 1
|
||||
#define HAVE_ROUNDF 1
|
||||
#define HAVE__SCALB 1
|
||||
#define HAVE_SIN 1
|
||||
#define HAVE_SINF 1
|
||||
#define HAVE_SQRT 1
|
||||
#define HAVE_SQRTF 1
|
||||
#define HAVE_TAN 1
|
||||
#define HAVE_TANF 1
|
||||
#define HAVE_TRUNC 1
|
||||
#define HAVE_TRUNCF 1
|
||||
#define HAVE__FSEEKI64 1
|
||||
|
||||
#define HAVE_ROAPI_H 1
|
||||
|
||||
/* Enable various audio drivers */
|
||||
#define SDL_AUDIO_DRIVER_WASAPI 1
|
||||
#define SDL_AUDIO_DRIVER_DISK 1
|
||||
#define SDL_AUDIO_DRIVER_DUMMY 1
|
||||
|
||||
/* Enable various input drivers */
|
||||
#if WINAPI_FAMILY == WINAPI_FAMILY_PHONE_APP
|
||||
#define SDL_JOYSTICK_DISABLED 1
|
||||
#define SDL_HAPTIC_DISABLED 1
|
||||
#else
|
||||
#define SDL_JOYSTICK_VIRTUAL 1
|
||||
#if (NTDDI_VERSION >= NTDDI_WIN10)
|
||||
#define SDL_JOYSTICK_WGI 1
|
||||
#define SDL_HAPTIC_DISABLED 1
|
||||
#else
|
||||
#define SDL_JOYSTICK_XINPUT 1
|
||||
#define SDL_HAPTIC_XINPUT 1
|
||||
#endif /* WIN10 */
|
||||
#endif
|
||||
|
||||
/* WinRT doesn't have HIDAPI available */
|
||||
#define SDL_HIDAPI_DISABLED 1
|
||||
|
||||
/* Enable the dummy sensor driver */
|
||||
#define SDL_SENSOR_DUMMY 1
|
||||
|
||||
/* Enable various shared object loading systems */
|
||||
#define SDL_LOADSO_WINDOWS 1
|
||||
|
||||
/* Enable various threading systems */
|
||||
#if (NTDDI_VERSION >= NTDDI_WINBLUE)
|
||||
#define SDL_THREAD_GENERIC_COND_SUFFIX 1
|
||||
#define SDL_THREAD_WINDOWS 1
|
||||
#else
|
||||
/* WinRT on Windows 8.0 and Windows Phone 8.0 don't support CreateThread() */
|
||||
#define SDL_THREAD_STDCPP 1
|
||||
#endif
|
||||
|
||||
/* Enable various timer systems */
|
||||
#define SDL_TIMER_WINDOWS 1
|
||||
|
||||
/* Enable various video drivers */
|
||||
#define SDL_VIDEO_DRIVER_WINRT 1
|
||||
#define SDL_VIDEO_DRIVER_DUMMY 1
|
||||
|
||||
/* Enable OpenGL ES 2.0 (via a modified ANGLE library) */
|
||||
#define SDL_VIDEO_OPENGL_ES2 1
|
||||
#define SDL_VIDEO_OPENGL_EGL 1
|
||||
|
||||
/* Enable appropriate renderer(s) */
|
||||
#define SDL_VIDEO_RENDER_D3D11 1
|
||||
|
||||
#if SDL_VIDEO_OPENGL_ES2
|
||||
#define SDL_VIDEO_RENDER_OGL_ES2 1
|
||||
#endif
|
||||
|
||||
/* Enable system power support */
|
||||
#define SDL_POWER_WINRT 1
|
||||
|
||||
/* Enable assembly routines (Win64 doesn't have inline asm) */
|
||||
#ifndef _WIN64
|
||||
#define SDL_ASSEMBLY_ROUTINES 1
|
||||
#endif
|
||||
|
||||
#endif /* SDL_config_winrt_h_ */
|
||||
@@ -1,559 +0,0 @@
|
||||
/*
|
||||
Simple DirectMedia Layer
|
||||
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.
|
||||
*/
|
||||
|
||||
/**
|
||||
* \file SDL_cpuinfo.h
|
||||
*
|
||||
* CPU feature detection for SDL.
|
||||
*/
|
||||
|
||||
#ifndef SDL_cpuinfo_h_
|
||||
#define SDL_cpuinfo_h_
|
||||
|
||||
#include "SDL_stdinc.h"
|
||||
|
||||
/* Need to do this here because intrin.h has C++ code in it */
|
||||
/* Visual Studio 2005 has a bug where intrin.h conflicts with winnt.h */
|
||||
#if defined(_MSC_VER) && (_MSC_VER >= 1500) && (defined(_M_IX86) || defined(_M_X64))
|
||||
#ifdef __clang__
|
||||
/* As of Clang 11, '_m_prefetchw' is conflicting with the winnt.h's version,
|
||||
so we define the needed '_m_prefetch' here as a pseudo-header, until the issue is fixed. */
|
||||
|
||||
#ifndef __PRFCHWINTRIN_H
|
||||
#define __PRFCHWINTRIN_H
|
||||
|
||||
static __inline__ void __attribute__((__always_inline__, __nodebug__))
|
||||
_m_prefetch(void *__P)
|
||||
{
|
||||
__builtin_prefetch (__P, 0, 3 /* _MM_HINT_T0 */);
|
||||
}
|
||||
|
||||
#endif /* __PRFCHWINTRIN_H */
|
||||
#endif /* __clang__ */
|
||||
#include <intrin.h>
|
||||
#ifndef _WIN64
|
||||
#ifndef __MMX__
|
||||
#define __MMX__
|
||||
#endif
|
||||
#ifndef __3dNOW__
|
||||
#define __3dNOW__
|
||||
#endif
|
||||
#endif
|
||||
#ifndef __SSE__
|
||||
#define __SSE__
|
||||
#endif
|
||||
#ifndef __SSE2__
|
||||
#define __SSE2__
|
||||
#endif
|
||||
#ifndef __SSE3__
|
||||
#define __SSE3__
|
||||
#endif
|
||||
#elif defined(__MINGW64_VERSION_MAJOR)
|
||||
#include <intrin.h>
|
||||
#if !defined(SDL_DISABLE_ARM_NEON_H) && defined(__ARM_NEON)
|
||||
# include <arm_neon.h>
|
||||
#endif
|
||||
#else
|
||||
/* altivec.h redefining bool causes a number of problems, see bugs 3993 and 4392, so you need to explicitly define SDL_ENABLE_ALTIVEC_H to have it included. */
|
||||
#if defined(HAVE_ALTIVEC_H) && defined(__ALTIVEC__) && !defined(__APPLE_ALTIVEC__) && defined(SDL_ENABLE_ALTIVEC_H)
|
||||
#include <altivec.h>
|
||||
#endif
|
||||
#if !defined(SDL_DISABLE_ARM_NEON_H)
|
||||
# if defined(__ARM_NEON)
|
||||
# include <arm_neon.h>
|
||||
# elif defined(__WINDOWS__) || defined(__WINRT__)
|
||||
/* Visual Studio doesn't define __ARM_ARCH, but _M_ARM (if set, always 7), and _M_ARM64 (if set, always 1). */
|
||||
# if defined(_M_ARM)
|
||||
# include <armintr.h>
|
||||
# include <arm_neon.h>
|
||||
# define __ARM_NEON 1 /* Set __ARM_NEON so that it can be used elsewhere, at compile time */
|
||||
# endif
|
||||
# if defined (_M_ARM64)
|
||||
# include <arm64intr.h>
|
||||
# include <arm64_neon.h>
|
||||
# define __ARM_NEON 1 /* Set __ARM_NEON so that it can be used elsewhere, at compile time */
|
||||
# endif
|
||||
# endif
|
||||
#endif
|
||||
#endif /* compiler version */
|
||||
|
||||
#if defined(__3dNOW__) && !defined(SDL_DISABLE_MM3DNOW_H)
|
||||
#include <mm3dnow.h>
|
||||
#endif
|
||||
#if defined(HAVE_IMMINTRIN_H) && !defined(SDL_DISABLE_IMMINTRIN_H)
|
||||
#include <immintrin.h>
|
||||
#else
|
||||
#if defined(__MMX__) && !defined(SDL_DISABLE_MMINTRIN_H)
|
||||
#include <mmintrin.h>
|
||||
#endif
|
||||
#if defined(__SSE__) && !defined(SDL_DISABLE_XMMINTRIN_H)
|
||||
#include <xmmintrin.h>
|
||||
#endif
|
||||
#if defined(__SSE2__) && !defined(SDL_DISABLE_EMMINTRIN_H)
|
||||
#include <emmintrin.h>
|
||||
#endif
|
||||
#if defined(__SSE3__) && !defined(SDL_DISABLE_PMMINTRIN_H)
|
||||
#include <pmmintrin.h>
|
||||
#endif
|
||||
#endif /* HAVE_IMMINTRIN_H */
|
||||
|
||||
#include "begin_code.h"
|
||||
/* Set up for C function definitions, even when using C++ */
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
/* This is a guess for the cacheline size used for padding.
|
||||
* Most x86 processors have a 64 byte cache line.
|
||||
* The 64-bit PowerPC processors have a 128 byte cache line.
|
||||
* We'll use the larger value to be generally safe.
|
||||
*/
|
||||
#define SDL_CACHELINE_SIZE 128
|
||||
|
||||
/**
|
||||
* Get the number of CPU cores available.
|
||||
*
|
||||
* \returns the total number of logical CPU cores. On CPUs that include
|
||||
* technologies such as hyperthreading, the number of logical cores
|
||||
* may be more than the number of physical cores.
|
||||
*
|
||||
* \since This function is available since SDL 2.0.0.
|
||||
*/
|
||||
extern DECLSPEC int SDLCALL SDL_GetCPUCount(void);
|
||||
|
||||
/**
|
||||
* Determine the L1 cache line size of the CPU.
|
||||
*
|
||||
* This is useful for determining multi-threaded structure padding or SIMD
|
||||
* prefetch sizes.
|
||||
*
|
||||
* \returns the L1 cache line size of the CPU, in bytes.
|
||||
*
|
||||
* \since This function is available since SDL 2.0.0.
|
||||
*/
|
||||
extern DECLSPEC int SDLCALL SDL_GetCPUCacheLineSize(void);
|
||||
|
||||
/**
|
||||
* Determine whether the CPU has the RDTSC instruction.
|
||||
*
|
||||
* This always returns false on CPUs that aren't using Intel instruction sets.
|
||||
*
|
||||
* \returns SDL_TRUE if the CPU has the RDTSC instruction or SDL_FALSE if not.
|
||||
*
|
||||
* \since This function is available since SDL 2.0.0.
|
||||
*
|
||||
* \sa SDL_Has3DNow
|
||||
* \sa SDL_HasAltiVec
|
||||
* \sa SDL_HasAVX
|
||||
* \sa SDL_HasAVX2
|
||||
* \sa SDL_HasMMX
|
||||
* \sa SDL_HasSSE
|
||||
* \sa SDL_HasSSE2
|
||||
* \sa SDL_HasSSE3
|
||||
* \sa SDL_HasSSE41
|
||||
* \sa SDL_HasSSE42
|
||||
*/
|
||||
extern DECLSPEC SDL_bool SDLCALL SDL_HasRDTSC(void);
|
||||
|
||||
/**
|
||||
* Determine whether the CPU has AltiVec features.
|
||||
*
|
||||
* This always returns false on CPUs that aren't using PowerPC instruction
|
||||
* sets.
|
||||
*
|
||||
* \returns SDL_TRUE if the CPU has AltiVec features or SDL_FALSE if not.
|
||||
*
|
||||
* \since This function is available since SDL 2.0.0.
|
||||
*
|
||||
* \sa SDL_Has3DNow
|
||||
* \sa SDL_HasAVX
|
||||
* \sa SDL_HasAVX2
|
||||
* \sa SDL_HasMMX
|
||||
* \sa SDL_HasRDTSC
|
||||
* \sa SDL_HasSSE
|
||||
* \sa SDL_HasSSE2
|
||||
* \sa SDL_HasSSE3
|
||||
* \sa SDL_HasSSE41
|
||||
* \sa SDL_HasSSE42
|
||||
*/
|
||||
extern DECLSPEC SDL_bool SDLCALL SDL_HasAltiVec(void);
|
||||
|
||||
/**
|
||||
* Determine whether the CPU has MMX features.
|
||||
*
|
||||
* This always returns false on CPUs that aren't using Intel instruction sets.
|
||||
*
|
||||
* \returns SDL_TRUE if the CPU has MMX features or SDL_FALSE if not.
|
||||
*
|
||||
* \since This function is available since SDL 2.0.0.
|
||||
*
|
||||
* \sa SDL_Has3DNow
|
||||
* \sa SDL_HasAltiVec
|
||||
* \sa SDL_HasAVX
|
||||
* \sa SDL_HasAVX2
|
||||
* \sa SDL_HasRDTSC
|
||||
* \sa SDL_HasSSE
|
||||
* \sa SDL_HasSSE2
|
||||
* \sa SDL_HasSSE3
|
||||
* \sa SDL_HasSSE41
|
||||
* \sa SDL_HasSSE42
|
||||
*/
|
||||
extern DECLSPEC SDL_bool SDLCALL SDL_HasMMX(void);
|
||||
|
||||
/**
|
||||
* Determine whether the CPU has 3DNow! features.
|
||||
*
|
||||
* This always returns false on CPUs that aren't using AMD instruction sets.
|
||||
*
|
||||
* \returns SDL_TRUE if the CPU has 3DNow! features or SDL_FALSE if not.
|
||||
*
|
||||
* \since This function is available since SDL 2.0.0.
|
||||
*
|
||||
* \sa SDL_HasAltiVec
|
||||
* \sa SDL_HasAVX
|
||||
* \sa SDL_HasAVX2
|
||||
* \sa SDL_HasMMX
|
||||
* \sa SDL_HasRDTSC
|
||||
* \sa SDL_HasSSE
|
||||
* \sa SDL_HasSSE2
|
||||
* \sa SDL_HasSSE3
|
||||
* \sa SDL_HasSSE41
|
||||
* \sa SDL_HasSSE42
|
||||
*/
|
||||
extern DECLSPEC SDL_bool SDLCALL SDL_Has3DNow(void);
|
||||
|
||||
/**
|
||||
* Determine whether the CPU has SSE features.
|
||||
*
|
||||
* This always returns false on CPUs that aren't using Intel instruction sets.
|
||||
*
|
||||
* \returns SDL_TRUE if the CPU has SSE features or SDL_FALSE if not.
|
||||
*
|
||||
* \since This function is available since SDL 2.0.0.
|
||||
*
|
||||
* \sa SDL_Has3DNow
|
||||
* \sa SDL_HasAltiVec
|
||||
* \sa SDL_HasAVX
|
||||
* \sa SDL_HasAVX2
|
||||
* \sa SDL_HasMMX
|
||||
* \sa SDL_HasRDTSC
|
||||
* \sa SDL_HasSSE2
|
||||
* \sa SDL_HasSSE3
|
||||
* \sa SDL_HasSSE41
|
||||
* \sa SDL_HasSSE42
|
||||
*/
|
||||
extern DECLSPEC SDL_bool SDLCALL SDL_HasSSE(void);
|
||||
|
||||
/**
|
||||
* Determine whether the CPU has SSE2 features.
|
||||
*
|
||||
* This always returns false on CPUs that aren't using Intel instruction sets.
|
||||
*
|
||||
* \returns SDL_TRUE if the CPU has SSE2 features or SDL_FALSE if not.
|
||||
*
|
||||
* \since This function is available since SDL 2.0.0.
|
||||
*
|
||||
* \sa SDL_Has3DNow
|
||||
* \sa SDL_HasAltiVec
|
||||
* \sa SDL_HasAVX
|
||||
* \sa SDL_HasAVX2
|
||||
* \sa SDL_HasMMX
|
||||
* \sa SDL_HasRDTSC
|
||||
* \sa SDL_HasSSE
|
||||
* \sa SDL_HasSSE3
|
||||
* \sa SDL_HasSSE41
|
||||
* \sa SDL_HasSSE42
|
||||
*/
|
||||
extern DECLSPEC SDL_bool SDLCALL SDL_HasSSE2(void);
|
||||
|
||||
/**
|
||||
* Determine whether the CPU has SSE3 features.
|
||||
*
|
||||
* This always returns false on CPUs that aren't using Intel instruction sets.
|
||||
*
|
||||
* \returns SDL_TRUE if the CPU has SSE3 features or SDL_FALSE if not.
|
||||
*
|
||||
* \since This function is available since SDL 2.0.0.
|
||||
*
|
||||
* \sa SDL_Has3DNow
|
||||
* \sa SDL_HasAltiVec
|
||||
* \sa SDL_HasAVX
|
||||
* \sa SDL_HasAVX2
|
||||
* \sa SDL_HasMMX
|
||||
* \sa SDL_HasRDTSC
|
||||
* \sa SDL_HasSSE
|
||||
* \sa SDL_HasSSE2
|
||||
* \sa SDL_HasSSE41
|
||||
* \sa SDL_HasSSE42
|
||||
*/
|
||||
extern DECLSPEC SDL_bool SDLCALL SDL_HasSSE3(void);
|
||||
|
||||
/**
|
||||
* Determine whether the CPU has SSE4.1 features.
|
||||
*
|
||||
* This always returns false on CPUs that aren't using Intel instruction sets.
|
||||
*
|
||||
* \returns SDL_TRUE if the CPU has SSE4.1 features or SDL_FALSE if not.
|
||||
*
|
||||
* \since This function is available since SDL 2.0.0.
|
||||
*
|
||||
* \sa SDL_Has3DNow
|
||||
* \sa SDL_HasAltiVec
|
||||
* \sa SDL_HasAVX
|
||||
* \sa SDL_HasAVX2
|
||||
* \sa SDL_HasMMX
|
||||
* \sa SDL_HasRDTSC
|
||||
* \sa SDL_HasSSE
|
||||
* \sa SDL_HasSSE2
|
||||
* \sa SDL_HasSSE3
|
||||
* \sa SDL_HasSSE42
|
||||
*/
|
||||
extern DECLSPEC SDL_bool SDLCALL SDL_HasSSE41(void);
|
||||
|
||||
/**
|
||||
* Determine whether the CPU has SSE4.2 features.
|
||||
*
|
||||
* This always returns false on CPUs that aren't using Intel instruction sets.
|
||||
*
|
||||
* \returns SDL_TRUE if the CPU has SSE4.2 features or SDL_FALSE if not.
|
||||
*
|
||||
* \since This function is available since SDL 2.0.0.
|
||||
*
|
||||
* \sa SDL_Has3DNow
|
||||
* \sa SDL_HasAltiVec
|
||||
* \sa SDL_HasAVX
|
||||
* \sa SDL_HasAVX2
|
||||
* \sa SDL_HasMMX
|
||||
* \sa SDL_HasRDTSC
|
||||
* \sa SDL_HasSSE
|
||||
* \sa SDL_HasSSE2
|
||||
* \sa SDL_HasSSE3
|
||||
* \sa SDL_HasSSE41
|
||||
*/
|
||||
extern DECLSPEC SDL_bool SDLCALL SDL_HasSSE42(void);
|
||||
|
||||
/**
|
||||
* Determine whether the CPU has AVX features.
|
||||
*
|
||||
* This always returns false on CPUs that aren't using Intel instruction sets.
|
||||
*
|
||||
* \returns SDL_TRUE if the CPU has AVX features or SDL_FALSE if not.
|
||||
*
|
||||
* \since This function is available since SDL 2.0.2.
|
||||
*
|
||||
* \sa SDL_Has3DNow
|
||||
* \sa SDL_HasAltiVec
|
||||
* \sa SDL_HasAVX2
|
||||
* \sa SDL_HasMMX
|
||||
* \sa SDL_HasRDTSC
|
||||
* \sa SDL_HasSSE
|
||||
* \sa SDL_HasSSE2
|
||||
* \sa SDL_HasSSE3
|
||||
* \sa SDL_HasSSE41
|
||||
* \sa SDL_HasSSE42
|
||||
*/
|
||||
extern DECLSPEC SDL_bool SDLCALL SDL_HasAVX(void);
|
||||
|
||||
/**
|
||||
* Determine whether the CPU has AVX2 features.
|
||||
*
|
||||
* This always returns false on CPUs that aren't using Intel instruction sets.
|
||||
*
|
||||
* \returns SDL_TRUE if the CPU has AVX2 features or SDL_FALSE if not.
|
||||
*
|
||||
* \since This function is available since SDL 2.0.4.
|
||||
*
|
||||
* \sa SDL_Has3DNow
|
||||
* \sa SDL_HasAltiVec
|
||||
* \sa SDL_HasAVX
|
||||
* \sa SDL_HasMMX
|
||||
* \sa SDL_HasRDTSC
|
||||
* \sa SDL_HasSSE
|
||||
* \sa SDL_HasSSE2
|
||||
* \sa SDL_HasSSE3
|
||||
* \sa SDL_HasSSE41
|
||||
* \sa SDL_HasSSE42
|
||||
*/
|
||||
extern DECLSPEC SDL_bool SDLCALL SDL_HasAVX2(void);
|
||||
|
||||
/**
|
||||
* Determine whether the CPU has AVX-512F (foundation) features.
|
||||
*
|
||||
* This always returns false on CPUs that aren't using Intel instruction sets.
|
||||
*
|
||||
* \returns SDL_TRUE if the CPU has AVX-512F features or SDL_FALSE if not.
|
||||
*
|
||||
* \since This function is available since SDL 2.0.9.
|
||||
*
|
||||
* \sa SDL_HasAVX
|
||||
*/
|
||||
extern DECLSPEC SDL_bool SDLCALL SDL_HasAVX512F(void);
|
||||
|
||||
/**
|
||||
* Determine whether the CPU has ARM SIMD (ARMv6) features.
|
||||
*
|
||||
* This is different from ARM NEON, which is a different instruction set.
|
||||
*
|
||||
* This always returns false on CPUs that aren't using ARM instruction sets.
|
||||
*
|
||||
* \returns SDL_TRUE if the CPU has ARM SIMD features or SDL_FALSE if not.
|
||||
*
|
||||
* \since This function is available since SDL 2.0.12.
|
||||
*
|
||||
* \sa SDL_HasNEON
|
||||
*/
|
||||
extern DECLSPEC SDL_bool SDLCALL SDL_HasARMSIMD(void);
|
||||
|
||||
/**
|
||||
* Determine whether the CPU has NEON (ARM SIMD) features.
|
||||
*
|
||||
* This always returns false on CPUs that aren't using ARM instruction sets.
|
||||
*
|
||||
* \returns SDL_TRUE if the CPU has ARM NEON features or SDL_FALSE if not.
|
||||
*
|
||||
* \since This function is available since SDL 2.0.6.
|
||||
*/
|
||||
extern DECLSPEC SDL_bool SDLCALL SDL_HasNEON(void);
|
||||
|
||||
/**
|
||||
* Get the amount of RAM configured in the system.
|
||||
*
|
||||
* \returns the amount of RAM configured in the system in MB.
|
||||
*
|
||||
* \since This function is available since SDL 2.0.1.
|
||||
*/
|
||||
extern DECLSPEC int SDLCALL SDL_GetSystemRAM(void);
|
||||
|
||||
/**
|
||||
* Report the alignment this system needs for SIMD allocations.
|
||||
*
|
||||
* This will return the minimum number of bytes to which a pointer must be
|
||||
* aligned to be compatible with SIMD instructions on the current machine. For
|
||||
* example, if the machine supports SSE only, it will return 16, but if it
|
||||
* supports AVX-512F, it'll return 64 (etc). This only reports values for
|
||||
* instruction sets SDL knows about, so if your SDL build doesn't have
|
||||
* SDL_HasAVX512F(), then it might return 16 for the SSE support it sees and
|
||||
* not 64 for the AVX-512 instructions that exist but SDL doesn't know about.
|
||||
* Plan accordingly.
|
||||
*
|
||||
* \returns the alignment in bytes needed for available, known SIMD
|
||||
* instructions.
|
||||
*
|
||||
* \since This function is available since SDL 2.0.10.
|
||||
*/
|
||||
extern DECLSPEC size_t SDLCALL SDL_SIMDGetAlignment(void);
|
||||
|
||||
/**
|
||||
* Allocate memory in a SIMD-friendly way.
|
||||
*
|
||||
* This will allocate a block of memory that is suitable for use with SIMD
|
||||
* instructions. Specifically, it will be properly aligned and padded for the
|
||||
* system's supported vector instructions.
|
||||
*
|
||||
* The memory returned will be padded such that it is safe to read or write an
|
||||
* incomplete vector at the end of the memory block. This can be useful so you
|
||||
* don't have to drop back to a scalar fallback at the end of your SIMD
|
||||
* processing loop to deal with the final elements without overflowing the
|
||||
* allocated buffer.
|
||||
*
|
||||
* You must free this memory with SDL_FreeSIMD(), not free() or SDL_free() or
|
||||
* delete[], etc.
|
||||
*
|
||||
* Note that SDL will only deal with SIMD instruction sets it is aware of; for
|
||||
* example, SDL 2.0.8 knows that SSE wants 16-byte vectors (SDL_HasSSE()), and
|
||||
* AVX2 wants 32 bytes (SDL_HasAVX2()), but doesn't know that AVX-512 wants
|
||||
* 64. To be clear: if you can't decide to use an instruction set with an
|
||||
* SDL_Has*() function, don't use that instruction set with memory allocated
|
||||
* through here.
|
||||
*
|
||||
* SDL_AllocSIMD(0) will return a non-NULL pointer, assuming the system isn't
|
||||
* out of memory, but you are not allowed to dereference it (because you only
|
||||
* own zero bytes of that buffer).
|
||||
*
|
||||
* \param len The length, in bytes, of the block to allocate. The actual
|
||||
* allocated block might be larger due to padding, etc.
|
||||
* \returns a pointer to the newly-allocated block, NULL if out of memory.
|
||||
*
|
||||
* \since This function is available since SDL 2.0.10.
|
||||
*
|
||||
* \sa SDL_SIMDAlignment
|
||||
* \sa SDL_SIMDRealloc
|
||||
* \sa SDL_SIMDFree
|
||||
*/
|
||||
extern DECLSPEC void * SDLCALL SDL_SIMDAlloc(const size_t len);
|
||||
|
||||
/**
|
||||
* Reallocate memory obtained from SDL_SIMDAlloc
|
||||
*
|
||||
* It is not valid to use this function on a pointer from anything but
|
||||
* SDL_SIMDAlloc(). It can't be used on pointers from malloc, realloc,
|
||||
* SDL_malloc, memalign, new[], etc.
|
||||
*
|
||||
* \param mem The pointer obtained from SDL_SIMDAlloc. This function also
|
||||
* accepts NULL, at which point this function is the same as
|
||||
* calling SDL_SIMDAlloc with a NULL pointer.
|
||||
* \param len The length, in bytes, of the block to allocated. The actual
|
||||
* allocated block might be larger due to padding, etc. Passing 0
|
||||
* will return a non-NULL pointer, assuming the system isn't out of
|
||||
* memory.
|
||||
* \returns a pointer to the newly-reallocated block, NULL if out of memory.
|
||||
*
|
||||
* \since This function is available since SDL 2.0.14.
|
||||
*
|
||||
* \sa SDL_SIMDAlignment
|
||||
* \sa SDL_SIMDAlloc
|
||||
* \sa SDL_SIMDFree
|
||||
*/
|
||||
extern DECLSPEC void * SDLCALL SDL_SIMDRealloc(void *mem, const size_t len);
|
||||
|
||||
/**
|
||||
* Deallocate memory obtained from SDL_SIMDAlloc
|
||||
*
|
||||
* It is not valid to use this function on a pointer from anything but
|
||||
* SDL_SIMDAlloc() or SDL_SIMDRealloc(). It can't be used on pointers from
|
||||
* malloc, realloc, SDL_malloc, memalign, new[], etc.
|
||||
*
|
||||
* However, SDL_SIMDFree(NULL) is a legal no-op.
|
||||
*
|
||||
* The memory pointed to by `ptr` is no longer valid for access upon return,
|
||||
* and may be returned to the system or reused by a future allocation. The
|
||||
* pointer passed to this function is no longer safe to dereference once this
|
||||
* function returns, and should be discarded.
|
||||
*
|
||||
* \param ptr The pointer, returned from SDL_SIMDAlloc or SDL_SIMDRealloc, to
|
||||
* deallocate. NULL is a legal no-op.
|
||||
*
|
||||
* \since This function is available since SDL 2.0.10.
|
||||
*
|
||||
* \sa SDL_SIMDAlloc
|
||||
* \sa SDL_SIMDRealloc
|
||||
*/
|
||||
extern DECLSPEC void SDLCALL SDL_SIMDFree(void *ptr);
|
||||
|
||||
/* Ends C function definitions when using C++ */
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
#include "close_code.h"
|
||||
|
||||
#endif /* SDL_cpuinfo_h_ */
|
||||
|
||||
/* vi: set ts=4 sw=4 expandtab: */
|
||||
@@ -1,326 +0,0 @@
|
||||
/*
|
||||
Simple DirectMedia Layer
|
||||
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.
|
||||
*/
|
||||
|
||||
/**
|
||||
* \file SDL_endian.h
|
||||
*
|
||||
* Functions for reading and writing endian-specific values
|
||||
*/
|
||||
|
||||
#ifndef SDL_endian_h_
|
||||
#define SDL_endian_h_
|
||||
|
||||
#include "SDL_stdinc.h"
|
||||
|
||||
#if defined(_MSC_VER) && (_MSC_VER >= 1400)
|
||||
/* As of Clang 11, '_m_prefetchw' is conflicting with the winnt.h's version,
|
||||
so we define the needed '_m_prefetch' here as a pseudo-header, until the issue is fixed. */
|
||||
#ifdef __clang__
|
||||
#ifndef __PRFCHWINTRIN_H
|
||||
#define __PRFCHWINTRIN_H
|
||||
static __inline__ void __attribute__((__always_inline__, __nodebug__))
|
||||
_m_prefetch(void *__P)
|
||||
{
|
||||
__builtin_prefetch (__P, 0, 3 /* _MM_HINT_T0 */);
|
||||
}
|
||||
#endif /* __PRFCHWINTRIN_H */
|
||||
#endif /* __clang__ */
|
||||
|
||||
#include <intrin.h>
|
||||
#endif
|
||||
|
||||
/**
|
||||
* \name The two types of endianness
|
||||
*/
|
||||
/* @{ */
|
||||
#define SDL_LIL_ENDIAN 1234
|
||||
#define SDL_BIG_ENDIAN 4321
|
||||
/* @} */
|
||||
|
||||
#ifndef SDL_BYTEORDER /* Not defined in SDL_config.h? */
|
||||
#ifdef __linux__
|
||||
#include <endian.h>
|
||||
#define SDL_BYTEORDER __BYTE_ORDER
|
||||
#elif defined(__OpenBSD__)
|
||||
#include <endian.h>
|
||||
#define SDL_BYTEORDER BYTE_ORDER
|
||||
#elif defined(__FreeBSD__) || defined(__NetBSD__)
|
||||
#include <sys/endian.h>
|
||||
#define SDL_BYTEORDER BYTE_ORDER
|
||||
/* predefs from newer gcc and clang versions: */
|
||||
#elif defined(__ORDER_LITTLE_ENDIAN__) && defined(__ORDER_BIG_ENDIAN__) && defined(__BYTE_ORDER__)
|
||||
#if (__BYTE_ORDER__ == __ORDER_LITTLE_ENDIAN__)
|
||||
#define SDL_BYTEORDER SDL_LIL_ENDIAN
|
||||
#elif (__BYTE_ORDER__ == __ORDER_BIG_ENDIAN__)
|
||||
#define SDL_BYTEORDER SDL_BIG_ENDIAN
|
||||
#else
|
||||
#error Unsupported endianness
|
||||
#endif /**/
|
||||
#else
|
||||
#if defined(__hppa__) || \
|
||||
defined(__m68k__) || defined(mc68000) || defined(_M_M68K) || \
|
||||
(defined(__MIPS__) && defined(__MIPSEB__)) || \
|
||||
defined(__ppc__) || defined(__POWERPC__) || defined(_M_PPC) || \
|
||||
defined(__sparc__)
|
||||
#define SDL_BYTEORDER SDL_BIG_ENDIAN
|
||||
#else
|
||||
#define SDL_BYTEORDER SDL_LIL_ENDIAN
|
||||
#endif
|
||||
#endif /* __linux__ */
|
||||
#endif /* !SDL_BYTEORDER */
|
||||
|
||||
|
||||
#include "begin_code.h"
|
||||
/* Set up for C function definitions, even when using C++ */
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
/**
|
||||
* \file SDL_endian.h
|
||||
*/
|
||||
|
||||
/* various modern compilers may have builtin swap */
|
||||
#if defined(__GNUC__) || defined(__clang__)
|
||||
# define HAS_BUILTIN_BSWAP16 (_SDL_HAS_BUILTIN(__builtin_bswap16)) || \
|
||||
(__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 8))
|
||||
# define HAS_BUILTIN_BSWAP32 (_SDL_HAS_BUILTIN(__builtin_bswap32)) || \
|
||||
(__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 3))
|
||||
# define HAS_BUILTIN_BSWAP64 (_SDL_HAS_BUILTIN(__builtin_bswap64)) || \
|
||||
(__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 3))
|
||||
|
||||
/* this one is broken */
|
||||
# define HAS_BROKEN_BSWAP (__GNUC__ == 2 && __GNUC_MINOR__ <= 95)
|
||||
#else
|
||||
# define HAS_BUILTIN_BSWAP16 0
|
||||
# define HAS_BUILTIN_BSWAP32 0
|
||||
# define HAS_BUILTIN_BSWAP64 0
|
||||
# define HAS_BROKEN_BSWAP 0
|
||||
#endif
|
||||
|
||||
#if HAS_BUILTIN_BSWAP16
|
||||
#define SDL_Swap16(x) __builtin_bswap16(x)
|
||||
#elif defined(_MSC_VER) && (_MSC_VER >= 1400)
|
||||
#pragma intrinsic(_byteswap_ushort)
|
||||
#define SDL_Swap16(x) _byteswap_ushort(x)
|
||||
#elif defined(__i386__) && !HAS_BROKEN_BSWAP
|
||||
SDL_FORCE_INLINE Uint16
|
||||
SDL_Swap16(Uint16 x)
|
||||
{
|
||||
__asm__("xchgb %b0,%h0": "=q"(x):"0"(x));
|
||||
return x;
|
||||
}
|
||||
#elif defined(__x86_64__)
|
||||
SDL_FORCE_INLINE Uint16
|
||||
SDL_Swap16(Uint16 x)
|
||||
{
|
||||
__asm__("xchgb %b0,%h0": "=Q"(x):"0"(x));
|
||||
return x;
|
||||
}
|
||||
#elif (defined(__powerpc__) || defined(__ppc__))
|
||||
SDL_FORCE_INLINE Uint16
|
||||
SDL_Swap16(Uint16 x)
|
||||
{
|
||||
int result;
|
||||
|
||||
__asm__("rlwimi %0,%2,8,16,23": "=&r"(result):"0"(x >> 8), "r"(x));
|
||||
return (Uint16)result;
|
||||
}
|
||||
#elif (defined(__m68k__) && !defined(__mcoldfire__))
|
||||
SDL_FORCE_INLINE Uint16
|
||||
SDL_Swap16(Uint16 x)
|
||||
{
|
||||
__asm__("rorw #8,%0": "=d"(x): "0"(x):"cc");
|
||||
return x;
|
||||
}
|
||||
#elif defined(__WATCOMC__) && defined(__386__)
|
||||
extern __inline Uint16 SDL_Swap16(Uint16);
|
||||
#pragma aux SDL_Swap16 = \
|
||||
"xchg al, ah" \
|
||||
parm [ax] \
|
||||
modify [ax];
|
||||
#else
|
||||
SDL_FORCE_INLINE Uint16
|
||||
SDL_Swap16(Uint16 x)
|
||||
{
|
||||
return SDL_static_cast(Uint16, ((x << 8) | (x >> 8)));
|
||||
}
|
||||
#endif
|
||||
|
||||
#if HAS_BUILTIN_BSWAP32
|
||||
#define SDL_Swap32(x) __builtin_bswap32(x)
|
||||
#elif defined(_MSC_VER) && (_MSC_VER >= 1400)
|
||||
#pragma intrinsic(_byteswap_ulong)
|
||||
#define SDL_Swap32(x) _byteswap_ulong(x)
|
||||
#elif defined(__i386__) && !HAS_BROKEN_BSWAP
|
||||
SDL_FORCE_INLINE Uint32
|
||||
SDL_Swap32(Uint32 x)
|
||||
{
|
||||
__asm__("bswap %0": "=r"(x):"0"(x));
|
||||
return x;
|
||||
}
|
||||
#elif defined(__x86_64__)
|
||||
SDL_FORCE_INLINE Uint32
|
||||
SDL_Swap32(Uint32 x)
|
||||
{
|
||||
__asm__("bswapl %0": "=r"(x):"0"(x));
|
||||
return x;
|
||||
}
|
||||
#elif (defined(__powerpc__) || defined(__ppc__))
|
||||
SDL_FORCE_INLINE Uint32
|
||||
SDL_Swap32(Uint32 x)
|
||||
{
|
||||
Uint32 result;
|
||||
|
||||
__asm__("rlwimi %0,%2,24,16,23": "=&r"(result): "0" (x>>24), "r"(x));
|
||||
__asm__("rlwimi %0,%2,8,8,15" : "=&r"(result): "0" (result), "r"(x));
|
||||
__asm__("rlwimi %0,%2,24,0,7" : "=&r"(result): "0" (result), "r"(x));
|
||||
return result;
|
||||
}
|
||||
#elif (defined(__m68k__) && !defined(__mcoldfire__))
|
||||
SDL_FORCE_INLINE Uint32
|
||||
SDL_Swap32(Uint32 x)
|
||||
{
|
||||
__asm__("rorw #8,%0\n\tswap %0\n\trorw #8,%0": "=d"(x): "0"(x):"cc");
|
||||
return x;
|
||||
}
|
||||
#elif defined(__WATCOMC__) && defined(__386__)
|
||||
extern __inline Uint32 SDL_Swap32(Uint32);
|
||||
#pragma aux SDL_Swap32 = \
|
||||
"bswap eax" \
|
||||
parm [eax] \
|
||||
modify [eax];
|
||||
#else
|
||||
SDL_FORCE_INLINE Uint32
|
||||
SDL_Swap32(Uint32 x)
|
||||
{
|
||||
return SDL_static_cast(Uint32, ((x << 24) | ((x << 8) & 0x00FF0000) |
|
||||
((x >> 8) & 0x0000FF00) | (x >> 24)));
|
||||
}
|
||||
#endif
|
||||
|
||||
#if HAS_BUILTIN_BSWAP64
|
||||
#define SDL_Swap64(x) __builtin_bswap64(x)
|
||||
#elif defined(_MSC_VER) && (_MSC_VER >= 1400)
|
||||
#pragma intrinsic(_byteswap_uint64)
|
||||
#define SDL_Swap64(x) _byteswap_uint64(x)
|
||||
#elif defined(__i386__) && !HAS_BROKEN_BSWAP
|
||||
SDL_FORCE_INLINE Uint64
|
||||
SDL_Swap64(Uint64 x)
|
||||
{
|
||||
union {
|
||||
struct {
|
||||
Uint32 a, b;
|
||||
} s;
|
||||
Uint64 u;
|
||||
} v;
|
||||
v.u = x;
|
||||
__asm__("bswapl %0 ; bswapl %1 ; xchgl %0,%1"
|
||||
: "=r"(v.s.a), "=r"(v.s.b)
|
||||
: "0" (v.s.a), "1"(v.s.b));
|
||||
return v.u;
|
||||
}
|
||||
#elif defined(__x86_64__)
|
||||
SDL_FORCE_INLINE Uint64
|
||||
SDL_Swap64(Uint64 x)
|
||||
{
|
||||
__asm__("bswapq %0": "=r"(x):"0"(x));
|
||||
return x;
|
||||
}
|
||||
#elif defined(__WATCOMC__) && defined(__386__)
|
||||
extern __inline Uint64 SDL_Swap64(Uint64);
|
||||
#pragma aux SDL_Swap64 = \
|
||||
"bswap eax" \
|
||||
"bswap edx" \
|
||||
"xchg eax,edx" \
|
||||
parm [eax edx] \
|
||||
modify [eax edx];
|
||||
#else
|
||||
SDL_FORCE_INLINE Uint64
|
||||
SDL_Swap64(Uint64 x)
|
||||
{
|
||||
Uint32 hi, lo;
|
||||
|
||||
/* Separate into high and low 32-bit values and swap them */
|
||||
lo = SDL_static_cast(Uint32, x & 0xFFFFFFFF);
|
||||
x >>= 32;
|
||||
hi = SDL_static_cast(Uint32, x & 0xFFFFFFFF);
|
||||
x = SDL_Swap32(lo);
|
||||
x <<= 32;
|
||||
x |= SDL_Swap32(hi);
|
||||
return (x);
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
SDL_FORCE_INLINE float
|
||||
SDL_SwapFloat(float x)
|
||||
{
|
||||
union {
|
||||
float f;
|
||||
Uint32 ui32;
|
||||
} swapper;
|
||||
swapper.f = x;
|
||||
swapper.ui32 = SDL_Swap32(swapper.ui32);
|
||||
return swapper.f;
|
||||
}
|
||||
|
||||
/* remove extra macros */
|
||||
#undef HAS_BROKEN_BSWAP
|
||||
#undef HAS_BUILTIN_BSWAP16
|
||||
#undef HAS_BUILTIN_BSWAP32
|
||||
#undef HAS_BUILTIN_BSWAP64
|
||||
|
||||
/**
|
||||
* \name Swap to native
|
||||
* Byteswap item from the specified endianness to the native endianness.
|
||||
*/
|
||||
/* @{ */
|
||||
#if SDL_BYTEORDER == SDL_LIL_ENDIAN
|
||||
#define SDL_SwapLE16(X) (X)
|
||||
#define SDL_SwapLE32(X) (X)
|
||||
#define SDL_SwapLE64(X) (X)
|
||||
#define SDL_SwapFloatLE(X) (X)
|
||||
#define SDL_SwapBE16(X) SDL_Swap16(X)
|
||||
#define SDL_SwapBE32(X) SDL_Swap32(X)
|
||||
#define SDL_SwapBE64(X) SDL_Swap64(X)
|
||||
#define SDL_SwapFloatBE(X) SDL_SwapFloat(X)
|
||||
#else
|
||||
#define SDL_SwapLE16(X) SDL_Swap16(X)
|
||||
#define SDL_SwapLE32(X) SDL_Swap32(X)
|
||||
#define SDL_SwapLE64(X) SDL_Swap64(X)
|
||||
#define SDL_SwapFloatLE(X) SDL_SwapFloat(X)
|
||||
#define SDL_SwapBE16(X) (X)
|
||||
#define SDL_SwapBE32(X) (X)
|
||||
#define SDL_SwapBE64(X) (X)
|
||||
#define SDL_SwapFloatBE(X) (X)
|
||||
#endif
|
||||
/* @} *//* Swap to native */
|
||||
|
||||
/* Ends C function definitions when using C++ */
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
#include "close_code.h"
|
||||
|
||||
#endif /* SDL_endian_h_ */
|
||||
|
||||
/* vi: set ts=4 sw=4 expandtab: */
|
||||
File diff suppressed because it is too large.
Load diff
@@ -1,145 +0,0 @@
|
||||
/*
|
||||
Simple DirectMedia Layer
|
||||
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.
|
||||
*/
|
||||
|
||||
/**
|
||||
* \file SDL_filesystem.h
|
||||
*
|
||||
* \brief Include file for filesystem SDL API functions
|
||||
*/
|
||||
|
||||
#ifndef SDL_filesystem_h_
|
||||
#define SDL_filesystem_h_
|
||||
|
||||
#include "SDL_stdinc.h"
|
||||
|
||||
#include "begin_code.h"
|
||||
|
||||
/* Set up for C function definitions, even when using C++ */
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
/**
|
||||
* Get the directory where the application was run from.
|
||||
*
|
||||
* This is not necessarily a fast call, so you should call this once near
|
||||
* startup and save the string if you need it.
|
||||
*
|
||||
* **Mac OS X and iOS Specific Functionality**: If the application is in a
|
||||
* ".app" bundle, this function returns the Resource directory (e.g.
|
||||
* MyApp.app/Contents/Resources/). This behaviour can be overridden by adding
|
||||
* a property to the Info.plist file. Adding a string key with the name
|
||||
* SDL_FILESYSTEM_BASE_DIR_TYPE with a supported value will change the
|
||||
* behaviour.
|
||||
*
|
||||
* Supported values for the SDL_FILESYSTEM_BASE_DIR_TYPE property (Given an
|
||||
* application in /Applications/SDLApp/MyApp.app):
|
||||
*
|
||||
* - `resource`: bundle resource directory (the default). For example:
|
||||
* `/Applications/SDLApp/MyApp.app/Contents/Resources`
|
||||
* - `bundle`: the Bundle directory. For example:
|
||||
* `/Applications/SDLApp/MyApp.app/`
|
||||
* - `parent`: the containing directory of the bundle. For example:
|
||||
* `/Applications/SDLApp/`
|
||||
*
|
||||
* The returned path is guaranteed to end with a path separator ('\' on
|
||||
* Windows, '/' on most other platforms).
|
||||
*
|
||||
* The pointer returned is owned by the caller. Please call SDL_free() on the
|
||||
* pointer when done with it.
|
||||
*
|
||||
* \returns an absolute path in UTF-8 encoding to the application data
|
||||
* directory. NULL will be returned on error or when the platform
|
||||
* doesn't implement this functionality, call SDL_GetError() for more
|
||||
* information.
|
||||
*
|
||||
* \since This function is available since SDL 2.0.1.
|
||||
*
|
||||
* \sa SDL_GetPrefPath
|
||||
*/
|
||||
extern DECLSPEC char *SDLCALL SDL_GetBasePath(void);
|
||||
|
||||
/**
|
||||
* Get the user-and-app-specific path where files can be written.
|
||||
*
|
||||
* Get the "pref dir". This is meant to be where users can write personal
|
||||
* files (preferences and save games, etc) that are specific to your
|
||||
* application. This directory is unique per user, per application.
|
||||
*
|
||||
* This function will decide the appropriate location in the native
|
||||
* filesystem, create the directory if necessary, and return a string of the
|
||||
* absolute path to the directory in UTF-8 encoding.
|
||||
*
|
||||
* On Windows, the string might look like:
|
||||
*
|
||||
* `C:\\Users\\bob\\AppData\\Roaming\\My Company\\My Program Name\\`
|
||||
*
|
||||
* On Linux, the string might look like"
|
||||
*
|
||||
* `/home/bob/.local/share/My Program Name/`
|
||||
*
|
||||
* On Mac OS X, the string might look like:
|
||||
*
|
||||
* `/Users/bob/Library/Application Support/My Program Name/`
|
||||
*
|
||||
* You should assume the path returned by this function is the only safe place
|
||||
* to write files (and that SDL_GetBasePath(), while it might be writable, or
|
||||
* even the parent of the returned path, isn't where you should be writing
|
||||
* things).
|
||||
*
|
||||
* Both the org and app strings may become part of a directory name, so please
|
||||
* follow these rules:
|
||||
*
|
||||
* - Try to use the same org string (_including case-sensitivity_) for all
|
||||
* your applications that use this function.
|
||||
* - Always use a unique app string for each one, and make sure it never
|
||||
* changes for an app once you've decided on it.
|
||||
* - Unicode characters are legal, as long as it's UTF-8 encoded, but...
|
||||
* - ...only use letters, numbers, and spaces. Avoid punctuation like "Game
|
||||
* Name 2: Bad Guy's Revenge!" ... "Game Name 2" is sufficient.
|
||||
*
|
||||
* The returned path is guaranteed to end with a path separator ('\' on
|
||||
* Windows, '/' on most other platforms).
|
||||
*
|
||||
* The pointer returned is owned by the caller. Please call SDL_free() on the
|
||||
* pointer when done with it.
|
||||
*
|
||||
* \param org the name of your organization
|
||||
* \param app the name of your application
|
||||
* \returns a UTF-8 string of the user directory in platform-dependent
|
||||
* notation. NULL if there's a problem (creating directory failed,
|
||||
* etc.).
|
||||
*
|
||||
* \since This function is available since SDL 2.0.1.
|
||||
*
|
||||
* \sa SDL_GetBasePath
|
||||
*/
|
||||
extern DECLSPEC char *SDLCALL SDL_GetPrefPath(const char *org, const char *app);
|
||||
|
||||
/* Ends C function definitions when using C++ */
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
#include "close_code.h"
|
||||
|
||||
#endif /* SDL_filesystem_h_ */
|
||||
|
||||
/* vi: set ts=4 sw=4 expandtab: */
|
||||
File diff suppressed because it is too large.
Load diff
@@ -1,451 +0,0 @@
|
||||
/*
|
||||
Simple DirectMedia Layer
|
||||
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.
|
||||
*/
|
||||
|
||||
/**
|
||||
* \file SDL_hidapi.h
|
||||
*
|
||||
* Header file for SDL HIDAPI functions.
|
||||
*
|
||||
* This is an adaptation of the original HIDAPI interface by Alan Ott,
|
||||
* and includes source code licensed under the following BSD license:
|
||||
*
|
||||
Copyright (c) 2010, Alan Ott, Signal 11 Software
|
||||
All rights reserved.
|
||||
|
||||
Redistribution and use in source and binary forms, with or without
|
||||
modification, are permitted provided that the following conditions are met:
|
||||
|
||||
* Redistributions of source code must retain the above copyright notice,
|
||||
this list of conditions and the following disclaimer.
|
||||
* Redistributions in binary form must reproduce the above copyright
|
||||
notice, this list of conditions and the following disclaimer in the
|
||||
documentation and/or other materials provided with the distribution.
|
||||
* Neither the name of Signal 11 Software nor the names of its
|
||||
contributors may be used to endorse or promote products derived from
|
||||
this software without specific prior written permission.
|
||||
|
||||
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
|
||||
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||
ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
|
||||
LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
|
||||
CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
|
||||
SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
|
||||
INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
|
||||
CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
|
||||
ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
||||
POSSIBILITY OF SUCH DAMAGE.
|
||||
*
|
||||
* If you would like a version of SDL without this code, you can build SDL
|
||||
* with SDL_HIDAPI_DISABLED defined to 1. You might want to do this for example
|
||||
* on iOS or tvOS to avoid a dependency on the CoreBluetooth framework.
|
||||
*/
|
||||
|
||||
#ifndef SDL_hidapi_h_
|
||||
#define SDL_hidapi_h_
|
||||
|
||||
#include "SDL_stdinc.h"
|
||||
|
||||
#include "begin_code.h"
|
||||
/* Set up for C function definitions, even when using C++ */
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
/**
|
||||
* \brief A handle representing an open HID device
|
||||
*/
|
||||
struct SDL_hid_device_;
|
||||
typedef struct SDL_hid_device_ SDL_hid_device; /**< opaque hidapi structure */
|
||||
|
||||
/** hidapi info structure */
|
||||
/**
|
||||
* \brief Information about a connected HID device
|
||||
*/
|
||||
typedef struct SDL_hid_device_info
|
||||
{
|
||||
/** Platform-specific device path */
|
||||
char *path;
|
||||
/** Device Vendor ID */
|
||||
unsigned short vendor_id;
|
||||
/** Device Product ID */
|
||||
unsigned short product_id;
|
||||
/** Serial Number */
|
||||
wchar_t *serial_number;
|
||||
/** Device Release Number in binary-coded decimal,
|
||||
also known as Device Version Number */
|
||||
unsigned short release_number;
|
||||
/** Manufacturer String */
|
||||
wchar_t *manufacturer_string;
|
||||
/** Product string */
|
||||
wchar_t *product_string;
|
||||
/** Usage Page for this Device/Interface
|
||||
(Windows/Mac only). */
|
||||
unsigned short usage_page;
|
||||
/** Usage for this Device/Interface
|
||||
(Windows/Mac only).*/
|
||||
unsigned short usage;
|
||||
/** The USB interface which this logical device
|
||||
represents.
|
||||
|
||||
* Valid on both Linux implementations in all cases.
|
||||
* Valid on the Windows implementation only if the device
|
||||
contains more than one interface. */
|
||||
int interface_number;
|
||||
|
||||
/** Additional information about the USB interface.
|
||||
Valid on libusb and Android implementations. */
|
||||
int interface_class;
|
||||
int interface_subclass;
|
||||
int interface_protocol;
|
||||
|
||||
/** Pointer to the next device */
|
||||
struct SDL_hid_device_info *next;
|
||||
} SDL_hid_device_info;
|
||||
|
||||
|
||||
/**
|
||||
* Initialize the HIDAPI library.
|
||||
*
|
||||
* This function initializes the HIDAPI library. Calling it is not strictly
|
||||
* necessary, as it will be called automatically by SDL_hid_enumerate() and
|
||||
* any of the SDL_hid_open_*() functions if it is needed. This function should
|
||||
* be called at the beginning of execution however, if there is a chance of
|
||||
* HIDAPI handles being opened by different threads simultaneously.
|
||||
*
|
||||
* Each call to this function should have a matching call to SDL_hid_exit()
|
||||
*
|
||||
* \returns 0 on success and -1 on error.
|
||||
*
|
||||
* \since This function is available since SDL 2.0.18.
|
||||
*
|
||||
* \sa SDL_hid_exit
|
||||
*/
|
||||
extern DECLSPEC int SDLCALL SDL_hid_init(void);
|
||||
|
||||
/**
|
||||
* Finalize the HIDAPI library.
|
||||
*
|
||||
* This function frees all of the static data associated with HIDAPI. It
|
||||
* should be called at the end of execution to avoid memory leaks.
|
||||
*
|
||||
* \returns 0 on success and -1 on error.
|
||||
*
|
||||
* \since This function is available since SDL 2.0.18.
|
||||
*
|
||||
* \sa SDL_hid_init
|
||||
*/
|
||||
extern DECLSPEC int SDLCALL SDL_hid_exit(void);
|
||||
|
||||
/**
|
||||
* Check to see if devices may have been added or removed.
|
||||
*
|
||||
* Enumerating the HID devices is an expensive operation, so you can call this
|
||||
* to see if there have been any system device changes since the last call to
|
||||
* this function. A change in the counter returned doesn't necessarily mean
|
||||
* that anything has changed, but you can call SDL_hid_enumerate() to get an
|
||||
* updated device list.
|
||||
*
|
||||
* Calling this function for the first time may cause a thread or other system
|
||||
* resource to be allocated to track device change notifications.
|
||||
*
|
||||
* \returns a change counter that is incremented with each potential device
|
||||
* change, or 0 if device change detection isn't available.
|
||||
*
|
||||
* \since This function is available since SDL 2.0.18.
|
||||
*
|
||||
* \sa SDL_hid_enumerate
|
||||
*/
|
||||
extern DECLSPEC Uint32 SDLCALL SDL_hid_device_change_count(void);
|
||||
|
||||
/**
|
||||
* Enumerate the HID Devices.
|
||||
*
|
||||
* This function returns a linked list of all the HID devices attached to the
|
||||
* system which match vendor_id and product_id. If `vendor_id` is set to 0
|
||||
* then any vendor matches. If `product_id` is set to 0 then any product
|
||||
* matches. If `vendor_id` and `product_id` are both set to 0, then all HID
|
||||
* devices will be returned.
|
||||
*
|
||||
* \param vendor_id The Vendor ID (VID) of the types of device to open.
|
||||
* \param product_id The Product ID (PID) of the types of device to open.
|
||||
* \returns a pointer to a linked list of type SDL_hid_device_info, containing
|
||||
* information about the HID devices attached to the system, or NULL
|
||||
* in the case of failure. Free this linked list by calling
|
||||
* SDL_hid_free_enumeration().
|
||||
*
|
||||
* \since This function is available since SDL 2.0.18.
|
||||
*
|
||||
* \sa SDL_hid_device_change_count
|
||||
*/
|
||||
extern DECLSPEC SDL_hid_device_info * SDLCALL SDL_hid_enumerate(unsigned short vendor_id, unsigned short product_id);
|
||||
|
||||
/**
|
||||
* Free an enumeration Linked List
|
||||
*
|
||||
* This function frees a linked list created by SDL_hid_enumerate().
|
||||
*
|
||||
* \param devs Pointer to a list of struct_device returned from
|
||||
* SDL_hid_enumerate().
|
||||
*
|
||||
* \since This function is available since SDL 2.0.18.
|
||||
*/
|
||||
extern DECLSPEC void SDLCALL SDL_hid_free_enumeration(SDL_hid_device_info *devs);
|
||||
|
||||
/**
|
||||
* Open a HID device using a Vendor ID (VID), Product ID (PID) and optionally
|
||||
* a serial number.
|
||||
*
|
||||
* If `serial_number` is NULL, the first device with the specified VID and PID
|
||||
* is opened.
|
||||
*
|
||||
* \param vendor_id The Vendor ID (VID) of the device to open.
|
||||
* \param product_id The Product ID (PID) of the device to open.
|
||||
* \param serial_number The Serial Number of the device to open (Optionally
|
||||
* NULL).
|
||||
* \returns a pointer to a SDL_hid_device object on success or NULL on
|
||||
* failure.
|
||||
*
|
||||
* \since This function is available since SDL 2.0.18.
|
||||
*/
|
||||
extern DECLSPEC SDL_hid_device * SDLCALL SDL_hid_open(unsigned short vendor_id, unsigned short product_id, const wchar_t *serial_number);
|
||||
|
||||
/**
|
||||
* Open a HID device by its path name.
|
||||
*
|
||||
* The path name be determined by calling SDL_hid_enumerate(), or a
|
||||
* platform-specific path name can be used (eg: /dev/hidraw0 on Linux).
|
||||
*
|
||||
* \param path The path name of the device to open
|
||||
* \returns a pointer to a SDL_hid_device object on success or NULL on
|
||||
* failure.
|
||||
*
|
||||
* \since This function is available since SDL 2.0.18.
|
||||
*/
|
||||
extern DECLSPEC SDL_hid_device * SDLCALL SDL_hid_open_path(const char *path, int bExclusive /* = false */);
|
||||
|
||||
/**
|
||||
* Write an Output report to a HID device.
|
||||
*
|
||||
* The first byte of `data` must contain the Report ID. For devices which only
|
||||
* support a single report, this must be set to 0x0. The remaining bytes
|
||||
* contain the report data. Since the Report ID is mandatory, calls to
|
||||
* SDL_hid_write() will always contain one more byte than the report contains.
|
||||
* For example, if a hid report is 16 bytes long, 17 bytes must be passed to
|
||||
* SDL_hid_write(), the Report ID (or 0x0, for devices with a single report),
|
||||
* followed by the report data (16 bytes). In this example, the length passed
|
||||
* in would be 17.
|
||||
*
|
||||
* SDL_hid_write() will send the data on the first OUT endpoint, if one
|
||||
* exists. If it does not, it will send the data through the Control Endpoint
|
||||
* (Endpoint 0).
|
||||
*
|
||||
* \param dev A device handle returned from SDL_hid_open().
|
||||
* \param data The data to send, including the report number as the first
|
||||
* byte.
|
||||
* \param length The length in bytes of the data to send.
|
||||
* \returns the actual number of bytes written and -1 on error.
|
||||
*
|
||||
* \since This function is available since SDL 2.0.18.
|
||||
*/
|
||||
extern DECLSPEC int SDLCALL SDL_hid_write(SDL_hid_device *dev, const unsigned char *data, size_t length);
|
||||
|
||||
/**
|
||||
* Read an Input report from a HID device with timeout.
|
||||
*
|
||||
* Input reports are returned to the host through the INTERRUPT IN endpoint.
|
||||
* The first byte will contain the Report number if the device uses numbered
|
||||
* reports.
|
||||
*
|
||||
* \param dev A device handle returned from SDL_hid_open().
|
||||
* \param data A buffer to put the read data into.
|
||||
* \param length The number of bytes to read. For devices with multiple
|
||||
* reports, make sure to read an extra byte for the report
|
||||
* number.
|
||||
* \param milliseconds timeout in milliseconds or -1 for blocking wait.
|
||||
* \returns the actual number of bytes read and -1 on error. If no packet was
|
||||
* available to be read within the timeout period, this function
|
||||
* returns 0.
|
||||
*
|
||||
* \since This function is available since SDL 2.0.18.
|
||||
*/
|
||||
extern DECLSPEC int SDLCALL SDL_hid_read_timeout(SDL_hid_device *dev, unsigned char *data, size_t length, int milliseconds);
|
||||
|
||||
/**
|
||||
* Read an Input report from a HID device.
|
||||
*
|
||||
* Input reports are returned to the host through the INTERRUPT IN endpoint.
|
||||
* The first byte will contain the Report number if the device uses numbered
|
||||
* reports.
|
||||
*
|
||||
* \param dev A device handle returned from SDL_hid_open().
|
||||
* \param data A buffer to put the read data into.
|
||||
* \param length The number of bytes to read. For devices with multiple
|
||||
* reports, make sure to read an extra byte for the report
|
||||
* number.
|
||||
* \returns the actual number of bytes read and -1 on error. If no packet was
|
||||
* available to be read and the handle is in non-blocking mode, this
|
||||
* function returns 0.
|
||||
*
|
||||
* \since This function is available since SDL 2.0.18.
|
||||
*/
|
||||
extern DECLSPEC int SDLCALL SDL_hid_read(SDL_hid_device *dev, unsigned char *data, size_t length);
|
||||
|
||||
/**
|
||||
* Set the device handle to be non-blocking.
|
||||
*
|
||||
* In non-blocking mode calls to SDL_hid_read() will return immediately with a
|
||||
* value of 0 if there is no data to be read. In blocking mode, SDL_hid_read()
|
||||
* will wait (block) until there is data to read before returning.
|
||||
*
|
||||
* Nonblocking can be turned on and off at any time.
|
||||
*
|
||||
* \param dev A device handle returned from SDL_hid_open().
|
||||
* \param nonblock enable or not the nonblocking reads - 1 to enable
|
||||
* nonblocking - 0 to disable nonblocking.
|
||||
* \returns 0 on success and -1 on error.
|
||||
*
|
||||
* \since This function is available since SDL 2.0.18.
|
||||
*/
|
||||
extern DECLSPEC int SDLCALL SDL_hid_set_nonblocking(SDL_hid_device *dev, int nonblock);
|
||||
|
||||
/**
|
||||
* Send a Feature report to the device.
|
||||
*
|
||||
* Feature reports are sent over the Control endpoint as a Set_Report
|
||||
* transfer. The first byte of `data` must contain the Report ID. For devices
|
||||
* which only support a single report, this must be set to 0x0. The remaining
|
||||
* bytes contain the report data. Since the Report ID is mandatory, calls to
|
||||
* SDL_hid_send_feature_report() will always contain one more byte than the
|
||||
* report contains. For example, if a hid report is 16 bytes long, 17 bytes
|
||||
* must be passed to SDL_hid_send_feature_report(): the Report ID (or 0x0, for
|
||||
* devices which do not use numbered reports), followed by the report data (16
|
||||
* bytes). In this example, the length passed in would be 17.
|
||||
*
|
||||
* \param dev A device handle returned from SDL_hid_open().
|
||||
* \param data The data to send, including the report number as the first
|
||||
* byte.
|
||||
* \param length The length in bytes of the data to send, including the report
|
||||
* number.
|
||||
* \returns the actual number of bytes written and -1 on error.
|
||||
*
|
||||
* \since This function is available since SDL 2.0.18.
|
||||
*/
|
||||
extern DECLSPEC int SDLCALL SDL_hid_send_feature_report(SDL_hid_device *dev, const unsigned char *data, size_t length);
|
||||
|
||||
/**
|
||||
* Get a feature report from a HID device.
|
||||
*
|
||||
* Set the first byte of `data` to the Report ID of the report to be read.
|
||||
* Make sure to allow space for this extra byte in `data`. Upon return, the
|
||||
* first byte will still contain the Report ID, and the report data will start
|
||||
* in data[1].
|
||||
*
|
||||
* \param dev A device handle returned from SDL_hid_open().
|
||||
* \param data A buffer to put the read data into, including the Report ID.
|
||||
* Set the first byte of `data` to the Report ID of the report to
|
||||
* be read, or set it to zero if your device does not use numbered
|
||||
* reports.
|
||||
* \param length The number of bytes to read, including an extra byte for the
|
||||
* report ID. The buffer can be longer than the actual report.
|
||||
* \returns the number of bytes read plus one for the report ID (which is
|
||||
* still in the first byte), or -1 on error.
|
||||
*
|
||||
* \since This function is available since SDL 2.0.18.
|
||||
*/
|
||||
extern DECLSPEC int SDLCALL SDL_hid_get_feature_report(SDL_hid_device *dev, unsigned char *data, size_t length);
|
||||
|
||||
/**
|
||||
* Close a HID device.
|
||||
*
|
||||
* \param dev A device handle returned from SDL_hid_open().
|
||||
*
|
||||
* \since This function is available since SDL 2.0.18.
|
||||
*/
|
||||
extern DECLSPEC void SDLCALL SDL_hid_close(SDL_hid_device *dev);
|
||||
|
||||
/**
|
||||
* Get The Manufacturer String from a HID device.
|
||||
*
|
||||
* \param dev A device handle returned from SDL_hid_open().
|
||||
* \param string A wide string buffer to put the data into.
|
||||
* \param maxlen The length of the buffer in multiples of wchar_t.
|
||||
* \returns 0 on success and -1 on error.
|
||||
*
|
||||
* \since This function is available since SDL 2.0.18.
|
||||
*/
|
||||
extern DECLSPEC int SDLCALL SDL_hid_get_manufacturer_string(SDL_hid_device *dev, wchar_t *string, size_t maxlen);
|
||||
|
||||
/**
|
||||
* Get The Product String from a HID device.
|
||||
*
|
||||
* \param dev A device handle returned from SDL_hid_open().
|
||||
* \param string A wide string buffer to put the data into.
|
||||
* \param maxlen The length of the buffer in multiples of wchar_t.
|
||||
* \returns 0 on success and -1 on error.
|
||||
*
|
||||
* \since This function is available since SDL 2.0.18.
|
||||
*/
|
||||
extern DECLSPEC int SDLCALL SDL_hid_get_product_string(SDL_hid_device *dev, wchar_t *string, size_t maxlen);
|
||||
|
||||
/**
|
||||
* Get The Serial Number String from a HID device.
|
||||
*
|
||||
* \param dev A device handle returned from SDL_hid_open().
|
||||
* \param string A wide string buffer to put the data into.
|
||||
* \param maxlen The length of the buffer in multiples of wchar_t.
|
||||
* \returns 0 on success and -1 on error.
|
||||
*
|
||||
* \since This function is available since SDL 2.0.18.
|
||||
*/
|
||||
extern DECLSPEC int SDLCALL SDL_hid_get_serial_number_string(SDL_hid_device *dev, wchar_t *string, size_t maxlen);
|
||||
|
||||
/**
|
||||
* Get a string from a HID device, based on its string index.
|
||||
*
|
||||
* \param dev A device handle returned from SDL_hid_open().
|
||||
* \param string_index The index of the string to get.
|
||||
* \param string A wide string buffer to put the data into.
|
||||
* \param maxlen The length of the buffer in multiples of wchar_t.
|
||||
* \returns 0 on success and -1 on error.
|
||||
*
|
||||
* \since This function is available since SDL 2.0.18.
|
||||
*/
|
||||
extern DECLSPEC int SDLCALL SDL_hid_get_indexed_string(SDL_hid_device *dev, int string_index, wchar_t *string, size_t maxlen);
|
||||
|
||||
/**
|
||||
* Start or stop a BLE scan on iOS and tvOS to pair Steam Controllers
|
||||
*
|
||||
* \param active SDL_TRUE to start the scan, SDL_FALSE to stop the scan
|
||||
*
|
||||
* \since This function is available since SDL 2.0.18.
|
||||
*/
|
||||
extern DECLSPEC void SDLCALL SDL_hid_ble_scan(SDL_bool active);
|
||||
|
||||
/* Ends C function definitions when using C++ */
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
#include "close_code.h"
|
||||
|
||||
#endif /* SDL_hidapi_h_ */
|
||||
|
||||
/* vi: set sts=4 ts=4 sw=4 expandtab: */
|
||||
File diff suppressed because it is too large.
Load diff
@@ -1,946 +0,0 @@
|
||||
/*
|
||||
Simple DirectMedia Layer
|
||||
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.
|
||||
*/
|
||||
|
||||
/**
|
||||
* \file SDL_joystick.h
|
||||
*
|
||||
* Include file for SDL joystick event handling
|
||||
*
|
||||
* The term "device_index" identifies currently plugged in joystick devices between 0 and SDL_NumJoysticks(), with the exact joystick
|
||||
* behind a device_index changing as joysticks are plugged and unplugged.
|
||||
*
|
||||
* The term "instance_id" is the current instantiation of a joystick device in the system, if the joystick is removed and then re-inserted
|
||||
* then it will get a new instance_id, instance_id's are monotonically increasing identifiers of a joystick plugged in.
|
||||
*
|
||||
* The term "player_index" is the number assigned to a player on a specific
|
||||
* controller. For XInput controllers this returns the XInput user index.
|
||||
* Many joysticks will not be able to supply this information.
|
||||
*
|
||||
* The term JoystickGUID is a stable 128-bit identifier for a joystick device that does not change over time, it identifies class of
|
||||
* the device (a X360 wired controller for example). This identifier is platform dependent.
|
||||
*/
|
||||
|
||||
#ifndef SDL_joystick_h_
|
||||
#define SDL_joystick_h_
|
||||
|
||||
#include "SDL_stdinc.h"
|
||||
#include "SDL_error.h"
|
||||
|
||||
#include "begin_code.h"
|
||||
/* Set up for C function definitions, even when using C++ */
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
/**
|
||||
* \file SDL_joystick.h
|
||||
*
|
||||
* In order to use these functions, SDL_Init() must have been called
|
||||
* with the ::SDL_INIT_JOYSTICK flag. This causes SDL to scan the system
|
||||
* for joysticks, and load appropriate drivers.
|
||||
*
|
||||
* If you would like to receive joystick updates while the application
|
||||
* is in the background, you should set the following hint before calling
|
||||
* SDL_Init(): SDL_HINT_JOYSTICK_ALLOW_BACKGROUND_EVENTS
|
||||
*/
|
||||
|
||||
/**
|
||||
* The joystick structure used to identify an SDL joystick
|
||||
*/
|
||||
struct _SDL_Joystick;
|
||||
typedef struct _SDL_Joystick SDL_Joystick;
|
||||
|
||||
/* A structure that encodes the stable unique id for a joystick device */
|
||||
typedef struct {
|
||||
Uint8 data[16];
|
||||
} SDL_JoystickGUID;
|
||||
|
||||
/**
|
||||
* This is a unique ID for a joystick for the time it is connected to the system,
|
||||
* and is never reused for the lifetime of the application. If the joystick is
|
||||
* disconnected and reconnected, it will get a new ID.
|
||||
*
|
||||
* The ID value starts at 0 and increments from there. The value -1 is an invalid ID.
|
||||
*/
|
||||
typedef Sint32 SDL_JoystickID;
|
||||
|
||||
typedef enum
|
||||
{
|
||||
SDL_JOYSTICK_TYPE_UNKNOWN,
|
||||
SDL_JOYSTICK_TYPE_GAMECONTROLLER,
|
||||
SDL_JOYSTICK_TYPE_WHEEL,
|
||||
SDL_JOYSTICK_TYPE_ARCADE_STICK,
|
||||
SDL_JOYSTICK_TYPE_FLIGHT_STICK,
|
||||
SDL_JOYSTICK_TYPE_DANCE_PAD,
|
||||
SDL_JOYSTICK_TYPE_GUITAR,
|
||||
SDL_JOYSTICK_TYPE_DRUM_KIT,
|
||||
SDL_JOYSTICK_TYPE_ARCADE_PAD,
|
||||
SDL_JOYSTICK_TYPE_THROTTLE
|
||||
} SDL_JoystickType;
|
||||
|
||||
typedef enum
|
||||
{
|
||||
SDL_JOYSTICK_POWER_UNKNOWN = -1,
|
||||
SDL_JOYSTICK_POWER_EMPTY, /* <= 5% */
|
||||
SDL_JOYSTICK_POWER_LOW, /* <= 20% */
|
||||
SDL_JOYSTICK_POWER_MEDIUM, /* <= 70% */
|
||||
SDL_JOYSTICK_POWER_FULL, /* <= 100% */
|
||||
SDL_JOYSTICK_POWER_WIRED,
|
||||
SDL_JOYSTICK_POWER_MAX
|
||||
} SDL_JoystickPowerLevel;
|
||||
|
||||
/* Set max recognized G-force from accelerometer
|
||||
See src/joystick/uikit/SDL_sysjoystick.m for notes on why this is needed
|
||||
*/
|
||||
#define SDL_IPHONE_MAX_GFORCE 5.0
|
||||
|
||||
|
||||
/* Function prototypes */
|
||||
|
||||
/**
|
||||
* Locking for multi-threaded access to the joystick API
|
||||
*
|
||||
* If you are using the joystick API or handling events from multiple threads
|
||||
* you should use these locking functions to protect access to the joysticks.
|
||||
*
|
||||
* In particular, you are guaranteed that the joystick list won't change, so
|
||||
* the API functions that take a joystick index will be valid, and joystick
|
||||
* and game controller events will not be delivered.
|
||||
*
|
||||
* \since This function is available since SDL 2.0.7.
|
||||
*/
|
||||
extern DECLSPEC void SDLCALL SDL_LockJoysticks(void);
|
||||
|
||||
|
||||
/**
|
||||
* Unlocking for multi-threaded access to the joystick API
|
||||
*
|
||||
* If you are using the joystick API or handling events from multiple threads
|
||||
* you should use these locking functions to protect access to the joysticks.
|
||||
*
|
||||
* In particular, you are guaranteed that the joystick list won't change, so
|
||||
* the API functions that take a joystick index will be valid, and joystick
|
||||
* and game controller events will not be delivered.
|
||||
*
|
||||
* \since This function is available since SDL 2.0.7.
|
||||
*/
|
||||
extern DECLSPEC void SDLCALL SDL_UnlockJoysticks(void);
|
||||
|
||||
/**
|
||||
* Count the number of joysticks attached to the system.
|
||||
*
|
||||
* \returns the number of attached joysticks on success or a negative error
|
||||
* code on failure; call SDL_GetError() for more information.
|
||||
*
|
||||
* \since This function is available since SDL 2.0.0.
|
||||
*
|
||||
* \sa SDL_JoystickName
|
||||
* \sa SDL_JoystickOpen
|
||||
*/
|
||||
extern DECLSPEC int SDLCALL SDL_NumJoysticks(void);
|
||||
|
||||
/**
|
||||
* Get the implementation dependent name of a joystick.
|
||||
*
|
||||
* This can be called before any joysticks are opened.
|
||||
*
|
||||
* \param device_index the index of the joystick to query (the N'th joystick
|
||||
* on the system)
|
||||
* \returns the name of the selected joystick. If no name can be found, this
|
||||
* function returns NULL; call SDL_GetError() for more information.
|
||||
*
|
||||
* \since This function is available since SDL 2.0.0.
|
||||
*
|
||||
* \sa SDL_JoystickName
|
||||
* \sa SDL_JoystickOpen
|
||||
*/
|
||||
extern DECLSPEC const char *SDLCALL SDL_JoystickNameForIndex(int device_index);
|
||||
|
||||
/**
|
||||
* Get the player index of a joystick, or -1 if it's not available This can be
|
||||
* called before any joysticks are opened.
|
||||
*
|
||||
* \since This function is available since SDL 2.0.9.
|
||||
*/
|
||||
extern DECLSPEC int SDLCALL SDL_JoystickGetDevicePlayerIndex(int device_index);
|
||||
|
||||
/**
|
||||
* Get the implementation-dependent GUID for the joystick at a given device
|
||||
* index.
|
||||
*
|
||||
* This function can be called before any joysticks are opened.
|
||||
*
|
||||
* \param device_index the index of the joystick to query (the N'th joystick
|
||||
* on the system
|
||||
* \returns the GUID of the selected joystick. If called on an invalid index,
|
||||
* this function returns a zero GUID
|
||||
*
|
||||
* \since This function is available since SDL 2.0.0.
|
||||
*
|
||||
* \sa SDL_JoystickGetGUID
|
||||
* \sa SDL_JoystickGetGUIDString
|
||||
*/
|
||||
extern DECLSPEC SDL_JoystickGUID SDLCALL SDL_JoystickGetDeviceGUID(int device_index);
|
||||
|
||||
/**
|
||||
* Get the USB vendor ID of a joystick, if available.
|
||||
*
|
||||
* This can be called before any joysticks are opened. If the vendor ID isn't
|
||||
* available this function returns 0.
|
||||
*
|
||||
* \param device_index the index of the joystick to query (the N'th joystick
|
||||
* on the system
|
||||
* \returns the USB vendor ID of the selected joystick. If called on an
|
||||
* invalid index, this function returns zero
|
||||
*
|
||||
* \since This function is available since SDL 2.0.6.
|
||||
*/
|
||||
extern DECLSPEC Uint16 SDLCALL SDL_JoystickGetDeviceVendor(int device_index);
|
||||
|
||||
/**
|
||||
* Get the USB product ID of a joystick, if available.
|
||||
*
|
||||
* This can be called before any joysticks are opened. If the product ID isn't
|
||||
* available this function returns 0.
|
||||
*
|
||||
* \param device_index the index of the joystick to query (the N'th joystick
|
||||
* on the system
|
||||
* \returns the USB product ID of the selected joystick. If called on an
|
||||
* invalid index, this function returns zero
|
||||
*
|
||||
* \since This function is available since SDL 2.0.6.
|
||||
*/
|
||||
extern DECLSPEC Uint16 SDLCALL SDL_JoystickGetDeviceProduct(int device_index);
|
||||
|
||||
/**
|
||||
* Get the product version of a joystick, if available.
|
||||
*
|
||||
* This can be called before any joysticks are opened. If the product version
|
||||
* isn't available this function returns 0.
|
||||
*
|
||||
* \param device_index the index of the joystick to query (the N'th joystick
|
||||
* on the system
|
||||
* \returns the product version of the selected joystick. If called on an
|
||||
* invalid index, this function returns zero
|
||||
*
|
||||
* \since This function is available since SDL 2.0.6.
|
||||
*/
|
||||
extern DECLSPEC Uint16 SDLCALL SDL_JoystickGetDeviceProductVersion(int device_index);
|
||||
|
||||
/**
|
||||
* Get the type of a joystick, if available.
|
||||
*
|
||||
* This can be called before any joysticks are opened.
|
||||
*
|
||||
* \param device_index the index of the joystick to query (the N'th joystick
|
||||
* on the system
|
||||
* \returns the SDL_JoystickType of the selected joystick. If called on an
|
||||
* invalid index, this function returns `SDL_JOYSTICK_TYPE_UNKNOWN`
|
||||
*
|
||||
* \since This function is available since SDL 2.0.6.
|
||||
*/
|
||||
extern DECLSPEC SDL_JoystickType SDLCALL SDL_JoystickGetDeviceType(int device_index);
|
||||
|
||||
/**
|
||||
* Get the instance ID of a joystick.
|
||||
*
|
||||
* This can be called before any joysticks are opened. If the index is out of
|
||||
* range, this function will return -1.
|
||||
*
|
||||
* \param device_index the index of the joystick to query (the N'th joystick
|
||||
* on the system
|
||||
* \returns the instance id of the selected joystick. If called on an invalid
|
||||
* index, this function returns zero
|
||||
*
|
||||
* \since This function is available since SDL 2.0.6.
|
||||
*/
|
||||
extern DECLSPEC SDL_JoystickID SDLCALL SDL_JoystickGetDeviceInstanceID(int device_index);
|
||||
|
||||
/**
|
||||
* Open a joystick for use.
|
||||
*
|
||||
* The `device_index` argument refers to the N'th joystick presently
|
||||
* recognized by SDL on the system. It is **NOT** the same as the instance ID
|
||||
* used to identify the joystick in future events. See
|
||||
* SDL_JoystickInstanceID() for more details about instance IDs.
|
||||
*
|
||||
* The joystick subsystem must be initialized before a joystick can be opened
|
||||
* for use.
|
||||
*
|
||||
* \param device_index the index of the joystick to query
|
||||
* \returns a joystick identifier or NULL if an error occurred; call
|
||||
* SDL_GetError() for more information.
|
||||
*
|
||||
* \since This function is available since SDL 2.0.0.
|
||||
*
|
||||
* \sa SDL_JoystickClose
|
||||
* \sa SDL_JoystickInstanceID
|
||||
*/
|
||||
extern DECLSPEC SDL_Joystick *SDLCALL SDL_JoystickOpen(int device_index);
|
||||
|
||||
/**
|
||||
* Get the SDL_Joystick associated with an instance id.
|
||||
*
|
||||
* \param instance_id the instance id to get the SDL_Joystick for
|
||||
* \returns an SDL_Joystick on success or NULL on failure; call SDL_GetError()
|
||||
* for more information.
|
||||
*
|
||||
* \since This function is available since SDL 2.0.4.
|
||||
*/
|
||||
extern DECLSPEC SDL_Joystick *SDLCALL SDL_JoystickFromInstanceID(SDL_JoystickID instance_id);
|
||||
|
||||
/**
|
||||
* Get the SDL_Joystick associated with a player index.
|
||||
*
|
||||
* \param player_index the player index to get the SDL_Joystick for
|
||||
* \returns an SDL_Joystick on success or NULL on failure; call SDL_GetError()
|
||||
* for more information.
|
||||
*
|
||||
* \since This function is available since SDL 2.0.12.
|
||||
*/
|
||||
extern DECLSPEC SDL_Joystick *SDLCALL SDL_JoystickFromPlayerIndex(int player_index);
|
||||
|
||||
/**
|
||||
* Attach a new virtual joystick.
|
||||
*
|
||||
* \returns the joystick's device index, or -1 if an error occurred.
|
||||
*
|
||||
* \since This function is available since SDL 2.0.14.
|
||||
*/
|
||||
extern DECLSPEC int SDLCALL SDL_JoystickAttachVirtual(SDL_JoystickType type,
|
||||
int naxes,
|
||||
int nbuttons,
|
||||
int nhats);
|
||||
|
||||
/**
|
||||
* Detach a virtual joystick.
|
||||
*
|
||||
* \param device_index a value previously returned from
|
||||
* SDL_JoystickAttachVirtual()
|
||||
* \returns 0 on success, or -1 if an error occurred.
|
||||
*
|
||||
* \since This function is available since SDL 2.0.14.
|
||||
*/
|
||||
extern DECLSPEC int SDLCALL SDL_JoystickDetachVirtual(int device_index);
|
||||
|
||||
/**
|
||||
* Query whether or not the joystick at a given device index is virtual.
|
||||
*
|
||||
* \param device_index a joystick device index.
|
||||
* \returns SDL_TRUE if the joystick is virtual, SDL_FALSE otherwise.
|
||||
*
|
||||
* \since This function is available since SDL 2.0.14.
|
||||
*/
|
||||
extern DECLSPEC SDL_bool SDLCALL SDL_JoystickIsVirtual(int device_index);
|
||||
|
||||
/**
|
||||
* Set values on an opened, virtual-joystick's axis.
|
||||
*
|
||||
* Please note that values set here will not be applied until the next call to
|
||||
* SDL_JoystickUpdate, which can either be called directly, or can be called
|
||||
* indirectly through various other SDL APIs, including, but not limited to
|
||||
* the following: SDL_PollEvent, SDL_PumpEvents, SDL_WaitEventTimeout,
|
||||
* SDL_WaitEvent.
|
||||
*
|
||||
* \param joystick the virtual joystick on which to set state.
|
||||
* \param axis the specific axis on the virtual joystick to set.
|
||||
* \param value the new value for the specified axis.
|
||||
* \returns 0 on success, -1 on error.
|
||||
*
|
||||
* \since This function is available since SDL 2.0.14.
|
||||
*/
|
||||
extern DECLSPEC int SDLCALL SDL_JoystickSetVirtualAxis(SDL_Joystick *joystick, int axis, Sint16 value);
|
||||
|
||||
/**
|
||||
* Set values on an opened, virtual-joystick's button.
|
||||
*
|
||||
* Please note that values set here will not be applied until the next call to
|
||||
* SDL_JoystickUpdate, which can either be called directly, or can be called
|
||||
* indirectly through various other SDL APIs, including, but not limited to
|
||||
* the following: SDL_PollEvent, SDL_PumpEvents, SDL_WaitEventTimeout,
|
||||
* SDL_WaitEvent.
|
||||
*
|
||||
* \param joystick the virtual joystick on which to set state.
|
||||
* \param button the specific button on the virtual joystick to set.
|
||||
* \param value the new value for the specified button.
|
||||
* \returns 0 on success, -1 on error.
|
||||
*
|
||||
* \since This function is available since SDL 2.0.14.
|
||||
*/
|
||||
extern DECLSPEC int SDLCALL SDL_JoystickSetVirtualButton(SDL_Joystick *joystick, int button, Uint8 value);
|
||||
|
||||
/**
|
||||
* Set values on an opened, virtual-joystick's hat.
|
||||
*
|
||||
* Please note that values set here will not be applied until the next call to
|
||||
* SDL_JoystickUpdate, which can either be called directly, or can be called
|
||||
* indirectly through various other SDL APIs, including, but not limited to
|
||||
* the following: SDL_PollEvent, SDL_PumpEvents, SDL_WaitEventTimeout,
|
||||
* SDL_WaitEvent.
|
||||
*
|
||||
* \param joystick the virtual joystick on which to set state.
|
||||
* \param hat the specific hat on the virtual joystick to set.
|
||||
* \param value the new value for the specified hat.
|
||||
* \returns 0 on success, -1 on error.
|
||||
*
|
||||
* \since This function is available since SDL 2.0.14.
|
||||
*/
|
||||
extern DECLSPEC int SDLCALL SDL_JoystickSetVirtualHat(SDL_Joystick *joystick, int hat, Uint8 value);
|
||||
|
||||
/**
|
||||
* Get the implementation dependent name of a joystick.
|
||||
*
|
||||
* \param joystick the SDL_Joystick obtained from SDL_JoystickOpen()
|
||||
* \returns the name of the selected joystick. If no name can be found, this
|
||||
* function returns NULL; call SDL_GetError() for more information.
|
||||
*
|
||||
* \since This function is available since SDL 2.0.0.
|
||||
*
|
||||
* \sa SDL_JoystickNameForIndex
|
||||
* \sa SDL_JoystickOpen
|
||||
*/
|
||||
extern DECLSPEC const char *SDLCALL SDL_JoystickName(SDL_Joystick *joystick);
|
||||
|
||||
/**
|
||||
* Get the player index of an opened joystick.
|
||||
*
|
||||
* For XInput controllers this returns the XInput user index. Many joysticks
|
||||
* will not be able to supply this information.
|
||||
*
|
||||
* \param joystick the SDL_Joystick obtained from SDL_JoystickOpen()
|
||||
* \returns the player index, or -1 if it's not available.
|
||||
*
|
||||
* \since This function is available since SDL 2.0.9.
|
||||
*/
|
||||
extern DECLSPEC int SDLCALL SDL_JoystickGetPlayerIndex(SDL_Joystick *joystick);
|
||||
|
||||
/**
|
||||
* Set the player index of an opened joystick.
|
||||
*
|
||||
* \param joystick the SDL_Joystick obtained from SDL_JoystickOpen()
|
||||
* \param player_index the player index to set.
|
||||
*
|
||||
* \since This function is available since SDL 2.0.12.
|
||||
*/
|
||||
extern DECLSPEC void SDLCALL SDL_JoystickSetPlayerIndex(SDL_Joystick *joystick, int player_index);
|
||||
|
||||
/**
|
||||
* Get the implementation-dependent GUID for the joystick.
|
||||
*
|
||||
* This function requires an open joystick.
|
||||
*
|
||||
* \param joystick the SDL_Joystick obtained from SDL_JoystickOpen()
|
||||
* \returns the GUID of the given joystick. If called on an invalid index,
|
||||
* this function returns a zero GUID; call SDL_GetError() for more
|
||||
* information.
|
||||
*
|
||||
* \since This function is available since SDL 2.0.0.
|
||||
*
|
||||
* \sa SDL_JoystickGetDeviceGUID
|
||||
* \sa SDL_JoystickGetGUIDString
|
||||
*/
|
||||
extern DECLSPEC SDL_JoystickGUID SDLCALL SDL_JoystickGetGUID(SDL_Joystick *joystick);
|
||||
|
||||
/**
|
||||
* Get the USB vendor ID of an opened joystick, if available.
|
||||
*
|
||||
* If the vendor ID isn't available this function returns 0.
|
||||
*
|
||||
* \param joystick the SDL_Joystick obtained from SDL_JoystickOpen()
|
||||
* \returns the USB vendor ID of the selected joystick, or 0 if unavailable.
|
||||
*
|
||||
* \since This function is available since SDL 2.0.6.
|
||||
*/
|
||||
extern DECLSPEC Uint16 SDLCALL SDL_JoystickGetVendor(SDL_Joystick *joystick);
|
||||
|
||||
/**
|
||||
* Get the USB product ID of an opened joystick, if available.
|
||||
*
|
||||
* If the product ID isn't available this function returns 0.
|
||||
*
|
||||
* \param joystick the SDL_Joystick obtained from SDL_JoystickOpen()
|
||||
* \returns the USB product ID of the selected joystick, or 0 if unavailable.
|
||||
*
|
||||
* \since This function is available since SDL 2.0.6.
|
||||
*/
|
||||
extern DECLSPEC Uint16 SDLCALL SDL_JoystickGetProduct(SDL_Joystick *joystick);
|
||||
|
||||
/**
|
||||
* Get the product version of an opened joystick, if available.
|
||||
*
|
||||
* If the product version isn't available this function returns 0.
|
||||
*
|
||||
* \param joystick the SDL_Joystick obtained from SDL_JoystickOpen()
|
||||
* \returns the product version of the selected joystick, or 0 if unavailable.
|
||||
*
|
||||
* \since This function is available since SDL 2.0.6.
|
||||
*/
|
||||
extern DECLSPEC Uint16 SDLCALL SDL_JoystickGetProductVersion(SDL_Joystick *joystick);
|
||||
|
||||
/**
|
||||
* Get the serial number of an opened joystick, if available.
|
||||
*
|
||||
* Returns the serial number of the joystick, or NULL if it is not available.
|
||||
*
|
||||
* \param joystick the SDL_Joystick obtained from SDL_JoystickOpen()
|
||||
* \returns the serial number of the selected joystick, or NULL if
|
||||
* unavailable.
|
||||
*
|
||||
* \since This function is available since SDL 2.0.14.
|
||||
*/
|
||||
extern DECLSPEC const char * SDLCALL SDL_JoystickGetSerial(SDL_Joystick *joystick);
|
||||
|
||||
/**
|
||||
* Get the type of an opened joystick.
|
||||
*
|
||||
* \param joystick the SDL_Joystick obtained from SDL_JoystickOpen()
|
||||
* \returns the SDL_JoystickType of the selected joystick.
|
||||
*
|
||||
* \since This function is available since SDL 2.0.6.
|
||||
*/
|
||||
extern DECLSPEC SDL_JoystickType SDLCALL SDL_JoystickGetType(SDL_Joystick *joystick);
|
||||
|
||||
/**
|
||||
* Get an ASCII string representation for a given SDL_JoystickGUID.
|
||||
*
|
||||
* You should supply at least 33 bytes for pszGUID.
|
||||
*
|
||||
* \param guid the SDL_JoystickGUID you wish to convert to string
|
||||
* \param pszGUID buffer in which to write the ASCII string
|
||||
* \param cbGUID the size of pszGUID
|
||||
*
|
||||
* \since This function is available since SDL 2.0.0.
|
||||
*
|
||||
* \sa SDL_JoystickGetDeviceGUID
|
||||
* \sa SDL_JoystickGetGUID
|
||||
* \sa SDL_JoystickGetGUIDFromString
|
||||
*/
|
||||
extern DECLSPEC void SDLCALL SDL_JoystickGetGUIDString(SDL_JoystickGUID guid, char *pszGUID, int cbGUID);
|
||||
|
||||
/**
|
||||
* Convert a GUID string into a SDL_JoystickGUID structure.
|
||||
*
|
||||
* Performs no error checking. If this function is given a string containing
|
||||
* an invalid GUID, the function will silently succeed, but the GUID generated
|
||||
* will not be useful.
|
||||
*
|
||||
* \param pchGUID string containing an ASCII representation of a GUID
|
||||
* \returns a SDL_JoystickGUID structure.
|
||||
*
|
||||
* \since This function is available since SDL 2.0.0.
|
||||
*
|
||||
* \sa SDL_JoystickGetGUIDString
|
||||
*/
|
||||
extern DECLSPEC SDL_JoystickGUID SDLCALL SDL_JoystickGetGUIDFromString(const char *pchGUID);
|
||||
|
||||
/**
|
||||
* Get the status of a specified joystick.
|
||||
*
|
||||
* \param joystick the joystick to query
|
||||
* \returns SDL_TRUE if the joystick has been opened, SDL_FALSE if it has not;
|
||||
* call SDL_GetError() for more information.
|
||||
*
|
||||
* \since This function is available since SDL 2.0.0.
|
||||
*
|
||||
* \sa SDL_JoystickClose
|
||||
* \sa SDL_JoystickOpen
|
||||
*/
|
||||
extern DECLSPEC SDL_bool SDLCALL SDL_JoystickGetAttached(SDL_Joystick *joystick);
|
||||
|
||||
/**
|
||||
* Get the instance ID of an opened joystick.
|
||||
*
|
||||
* \param joystick an SDL_Joystick structure containing joystick information
|
||||
* \returns the instance ID of the specified joystick on success or a negative
|
||||
* error code on failure; call SDL_GetError() for more information.
|
||||
*
|
||||
* \since This function is available since SDL 2.0.0.
|
||||
*
|
||||
* \sa SDL_JoystickOpen
|
||||
*/
|
||||
extern DECLSPEC SDL_JoystickID SDLCALL SDL_JoystickInstanceID(SDL_Joystick *joystick);
|
||||
|
||||
/**
|
||||
* Get the number of general axis controls on a joystick.
|
||||
*
|
||||
* Often, the directional pad on a game controller will either look like 4
|
||||
* separate buttons or a POV hat, and not axes, but all of this is up to the
|
||||
* device and platform.
|
||||
*
|
||||
* \param joystick an SDL_Joystick structure containing joystick information
|
||||
* \returns the number of axis controls/number of axes on success or a
|
||||
* negative error code on failure; call SDL_GetError() for more
|
||||
* information.
|
||||
*
|
||||
* \since This function is available since SDL 2.0.0.
|
||||
*
|
||||
* \sa SDL_JoystickGetAxis
|
||||
* \sa SDL_JoystickOpen
|
||||
*/
|
||||
extern DECLSPEC int SDLCALL SDL_JoystickNumAxes(SDL_Joystick *joystick);
|
||||
|
||||
/**
|
||||
* Get the number of trackballs on a joystick.
|
||||
*
|
||||
* Joystick trackballs have only relative motion events associated with them
|
||||
* and their state cannot be polled.
|
||||
*
|
||||
* Most joysticks do not have trackballs.
|
||||
*
|
||||
* \param joystick an SDL_Joystick structure containing joystick information
|
||||
* \returns the number of trackballs on success or a negative error code on
|
||||
* failure; call SDL_GetError() for more information.
|
||||
*
|
||||
* \since This function is available since SDL 2.0.0.
|
||||
*
|
||||
* \sa SDL_JoystickGetBall
|
||||
*/
|
||||
extern DECLSPEC int SDLCALL SDL_JoystickNumBalls(SDL_Joystick *joystick);
|
||||
|
||||
/**
|
||||
* Get the number of POV hats on a joystick.
|
||||
*
|
||||
* \param joystick an SDL_Joystick structure containing joystick information
|
||||
* \returns the number of POV hats on success or a negative error code on
|
||||
* failure; call SDL_GetError() for more information.
|
||||
*
|
||||
* \since This function is available since SDL 2.0.0.
|
||||
*
|
||||
* \sa SDL_JoystickGetHat
|
||||
* \sa SDL_JoystickOpen
|
||||
*/
|
||||
extern DECLSPEC int SDLCALL SDL_JoystickNumHats(SDL_Joystick *joystick);
|
||||
|
||||
/**
|
||||
* Get the number of buttons on a joystick.
|
||||
*
|
||||
* \param joystick an SDL_Joystick structure containing joystick information
|
||||
* \returns the number of buttons on success or a negative error code on
|
||||
* failure; call SDL_GetError() for more information.
|
||||
*
|
||||
* \since This function is available since SDL 2.0.0.
|
||||
*
|
||||
* \sa SDL_JoystickGetButton
|
||||
* \sa SDL_JoystickOpen
|
||||
*/
|
||||
extern DECLSPEC int SDLCALL SDL_JoystickNumButtons(SDL_Joystick *joystick);
|
||||
|
||||
/**
|
||||
* Update the current state of the open joysticks.
|
||||
*
|
||||
* This is called automatically by the event loop if any joystick events are
|
||||
* enabled.
|
||||
*
|
||||
* \since This function is available since SDL 2.0.0.
|
||||
*
|
||||
* \sa SDL_JoystickEventState
|
||||
*/
|
||||
extern DECLSPEC void SDLCALL SDL_JoystickUpdate(void);
|
||||
|
||||
/**
|
||||
* Enable/disable joystick event polling.
|
||||
*
|
||||
* If joystick events are disabled, you must call SDL_JoystickUpdate()
|
||||
* yourself and manually check the state of the joystick when you want
|
||||
* joystick information.
|
||||
*
|
||||
* It is recommended that you leave joystick event handling enabled.
|
||||
*
|
||||
* **WARNING**: Calling this function may delete all events currently in SDL's
|
||||
* event queue.
|
||||
*
|
||||
* \param state can be one of `SDL_QUERY`, `SDL_IGNORE`, or `SDL_ENABLE`
|
||||
* \returns 1 if enabled, 0 if disabled, or a negative error code on failure;
|
||||
* call SDL_GetError() for more information.
|
||||
*
|
||||
* If `state` is `SDL_QUERY` then the current state is returned,
|
||||
* otherwise the new processing state is returned.
|
||||
*
|
||||
* \since This function is available since SDL 2.0.0.
|
||||
*
|
||||
* \sa SDL_GameControllerEventState
|
||||
*/
|
||||
extern DECLSPEC int SDLCALL SDL_JoystickEventState(int state);
|
||||
|
||||
#define SDL_JOYSTICK_AXIS_MAX 32767
|
||||
#define SDL_JOYSTICK_AXIS_MIN -32768
|
||||
|
||||
/**
|
||||
* Get the current state of an axis control on a joystick.
|
||||
*
|
||||
* SDL makes no promises about what part of the joystick any given axis refers
|
||||
* to. Your game should have some sort of configuration UI to let users
|
||||
* specify what each axis should be bound to. Alternately, SDL's higher-level
|
||||
* Game Controller API makes a great effort to apply order to this lower-level
|
||||
* interface, so you know that a specific axis is the "left thumb stick," etc.
|
||||
*
|
||||
* The value returned by SDL_JoystickGetAxis() is a signed integer (-32768 to
|
||||
* 32767) representing the current position of the axis. It may be necessary
|
||||
* to impose certain tolerances on these values to account for jitter.
|
||||
*
|
||||
* \param joystick an SDL_Joystick structure containing joystick information
|
||||
* \param axis the axis to query; the axis indices start at index 0
|
||||
* \returns a 16-bit signed integer representing the current position of the
|
||||
* axis or 0 on failure; call SDL_GetError() for more information.
|
||||
*
|
||||
* \since This function is available since SDL 2.0.0.
|
||||
*
|
||||
* \sa SDL_JoystickNumAxes
|
||||
*/
|
||||
extern DECLSPEC Sint16 SDLCALL SDL_JoystickGetAxis(SDL_Joystick *joystick,
|
||||
int axis);
|
||||
|
||||
/**
|
||||
* Get the initial state of an axis control on a joystick.
|
||||
*
|
||||
* The state is a value ranging from -32768 to 32767.
|
||||
*
|
||||
* The axis indices start at index 0.
|
||||
*
|
||||
* \param joystick an SDL_Joystick structure containing joystick information
|
||||
* \param axis the axis to query; the axis indices start at index 0
|
||||
* \param state Upon return, the initial value is supplied here.
|
||||
* \return SDL_TRUE if this axis has any initial value, or SDL_FALSE if not.
|
||||
*
|
||||
* \since This function is available since SDL 2.0.6.
|
||||
*/
|
||||
extern DECLSPEC SDL_bool SDLCALL SDL_JoystickGetAxisInitialState(SDL_Joystick *joystick,
|
||||
int axis, Sint16 *state);
|
||||
|
||||
/**
|
||||
* \name Hat positions
|
||||
*/
|
||||
/* @{ */
|
||||
#define SDL_HAT_CENTERED 0x00
|
||||
#define SDL_HAT_UP 0x01
|
||||
#define SDL_HAT_RIGHT 0x02
|
||||
#define SDL_HAT_DOWN 0x04
|
||||
#define SDL_HAT_LEFT 0x08
|
||||
#define SDL_HAT_RIGHTUP (SDL_HAT_RIGHT|SDL_HAT_UP)
|
||||
#define SDL_HAT_RIGHTDOWN (SDL_HAT_RIGHT|SDL_HAT_DOWN)
|
||||
#define SDL_HAT_LEFTUP (SDL_HAT_LEFT|SDL_HAT_UP)
|
||||
#define SDL_HAT_LEFTDOWN (SDL_HAT_LEFT|SDL_HAT_DOWN)
|
||||
/* @} */
|
||||
|
||||
/**
|
||||
* Get the current state of a POV hat on a joystick.
|
||||
*
|
||||
* The returned value will be one of the following positions:
|
||||
*
|
||||
* - `SDL_HAT_CENTERED`
|
||||
* - `SDL_HAT_UP`
|
||||
* - `SDL_HAT_RIGHT`
|
||||
* - `SDL_HAT_DOWN`
|
||||
* - `SDL_HAT_LEFT`
|
||||
* - `SDL_HAT_RIGHTUP`
|
||||
* - `SDL_HAT_RIGHTDOWN`
|
||||
* - `SDL_HAT_LEFTUP`
|
||||
* - `SDL_HAT_LEFTDOWN`
|
||||
*
|
||||
* \param joystick an SDL_Joystick structure containing joystick information
|
||||
* \param hat the hat index to get the state from; indices start at index 0
|
||||
* \returns the current hat position.
|
||||
*
|
||||
* \since This function is available since SDL 2.0.0.
|
||||
*
|
||||
* \sa SDL_JoystickNumHats
|
||||
*/
|
||||
extern DECLSPEC Uint8 SDLCALL SDL_JoystickGetHat(SDL_Joystick *joystick,
|
||||
int hat);
|
||||
|
||||
/**
|
||||
* Get the ball axis change since the last poll.
|
||||
*
|
||||
* Trackballs can only return relative motion since the last call to
|
||||
* SDL_JoystickGetBall(), these motion deltas are placed into `dx` and `dy`.
|
||||
*
|
||||
* Most joysticks do not have trackballs.
|
||||
*
|
||||
* \param joystick the SDL_Joystick to query
|
||||
* \param ball the ball index to query; ball indices start at index 0
|
||||
* \param dx stores the difference in the x axis position since the last poll
|
||||
* \param dy stores the difference in the y axis position since the last poll
|
||||
* \returns 0 on success or a negative error code on failure; call
|
||||
* SDL_GetError() for more information.
|
||||
*
|
||||
* \since This function is available since SDL 2.0.0.
|
||||
*
|
||||
* \sa SDL_JoystickNumBalls
|
||||
*/
|
||||
extern DECLSPEC int SDLCALL SDL_JoystickGetBall(SDL_Joystick *joystick,
|
||||
int ball, int *dx, int *dy);
|
||||
|
||||
/**
|
||||
* Get the current state of a button on a joystick.
|
||||
*
|
||||
* \param joystick an SDL_Joystick structure containing joystick information
|
||||
* \param button the button index to get the state from; indices start at
|
||||
* index 0
|
||||
* \returns 1 if the specified button is pressed, 0 otherwise.
|
||||
*
|
||||
* \since This function is available since SDL 2.0.0.
|
||||
*
|
||||
* \sa SDL_JoystickNumButtons
|
||||
*/
|
||||
extern DECLSPEC Uint8 SDLCALL SDL_JoystickGetButton(SDL_Joystick *joystick,
|
||||
int button);
|
||||
|
||||
/**
|
||||
* Start a rumble effect.
|
||||
*
|
||||
* Each call to this function cancels any previous rumble effect, and calling
|
||||
* it with 0 intensity stops any rumbling.
|
||||
*
|
||||
* \param joystick The joystick to vibrate
|
||||
* \param low_frequency_rumble The intensity of the low frequency (left)
|
||||
* rumble motor, from 0 to 0xFFFF
|
||||
* \param high_frequency_rumble The intensity of the high frequency (right)
|
||||
* rumble motor, from 0 to 0xFFFF
|
||||
* \param duration_ms The duration of the rumble effect, in milliseconds
|
||||
* \returns 0, or -1 if rumble isn't supported on this joystick
|
||||
*
|
||||
* \since This function is available since SDL 2.0.9.
|
||||
*
|
||||
* \sa SDL_JoystickHasRumble
|
||||
*/
|
||||
extern DECLSPEC int SDLCALL SDL_JoystickRumble(SDL_Joystick *joystick, Uint16 low_frequency_rumble, Uint16 high_frequency_rumble, Uint32 duration_ms);
|
||||
|
||||
/**
|
||||
* Start a rumble effect in the joystick's triggers
|
||||
*
|
||||
* Each call to this function cancels any previous trigger rumble effect, and
|
||||
* calling it with 0 intensity stops any rumbling.
|
||||
*
|
||||
* Note that this is rumbling of the _triggers_ and not the game controller as
|
||||
* a whole. This is currently only supported on Xbox One controllers. If you
|
||||
* want the (more common) whole-controller rumble, use SDL_JoystickRumble()
|
||||
* instead.
|
||||
*
|
||||
* \param joystick The joystick to vibrate
|
||||
* \param left_rumble The intensity of the left trigger rumble motor, from 0
|
||||
* to 0xFFFF
|
||||
* \param right_rumble The intensity of the right trigger rumble motor, from 0
|
||||
* to 0xFFFF
|
||||
* \param duration_ms The duration of the rumble effect, in milliseconds
|
||||
* \returns 0, or -1 if trigger rumble isn't supported on this joystick
|
||||
*
|
||||
* \since This function is available since SDL 2.0.14.
|
||||
*
|
||||
* \sa SDL_JoystickHasRumbleTriggers
|
||||
*/
|
||||
extern DECLSPEC int SDLCALL SDL_JoystickRumbleTriggers(SDL_Joystick *joystick, Uint16 left_rumble, Uint16 right_rumble, Uint32 duration_ms);
|
||||
|
||||
/**
|
||||
* Query whether a joystick has an LED.
|
||||
*
|
||||
* An example of a joystick LED is the light on the back of a PlayStation 4's
|
||||
* DualShock 4 controller.
|
||||
*
|
||||
* \param joystick The joystick to query
|
||||
* \return SDL_TRUE if the joystick has a modifiable LED, SDL_FALSE otherwise.
|
||||
*
|
||||
* \since This function is available since SDL 2.0.14.
|
||||
*/
|
||||
extern DECLSPEC SDL_bool SDLCALL SDL_JoystickHasLED(SDL_Joystick *joystick);
|
||||
|
||||
/**
|
||||
* Query whether a joystick has rumble support.
|
||||
*
|
||||
* \param joystick The joystick to query
|
||||
* \return SDL_TRUE if the joystick has rumble, SDL_FALSE otherwise.
|
||||
*
|
||||
* \since This function is available since SDL 2.0.18.
|
||||
*
|
||||
* \sa SDL_JoystickRumble
|
||||
*/
|
||||
extern DECLSPEC SDL_bool SDLCALL SDL_JoystickHasRumble(SDL_Joystick *joystick);
|
||||
|
||||
/**
|
||||
* Query whether a joystick has rumble support on triggers.
|
||||
*
|
||||
* \param joystick The joystick to query
|
||||
* \return SDL_TRUE if the joystick has trigger rumble, SDL_FALSE otherwise.
|
||||
*
|
||||
* \since This function is available since SDL 2.0.18.
|
||||
*
|
||||
* \sa SDL_JoystickRumbleTriggers
|
||||
*/
|
||||
extern DECLSPEC SDL_bool SDLCALL SDL_JoystickHasRumbleTriggers(SDL_Joystick *joystick);
|
||||
|
||||
/**
|
||||
* Update a joystick's LED color.
|
||||
*
|
||||
* An example of a joystick LED is the light on the back of a PlayStation 4's
|
||||
* DualShock 4 controller.
|
||||
*
|
||||
* \param joystick The joystick to update
|
||||
* \param red The intensity of the red LED
|
||||
* \param green The intensity of the green LED
|
||||
* \param blue The intensity of the blue LED
|
||||
* \returns 0 on success, -1 if this joystick does not have a modifiable LED
|
||||
*
|
||||
* \since This function is available since SDL 2.0.14.
|
||||
*/
|
||||
extern DECLSPEC int SDLCALL SDL_JoystickSetLED(SDL_Joystick *joystick, Uint8 red, Uint8 green, Uint8 blue);
|
||||
|
||||
/**
|
||||
* Send a joystick specific effect packet
|
||||
*
|
||||
* \param joystick The joystick to affect
|
||||
* \param data The data to send to the joystick
|
||||
* \param size The size of the data to send to the joystick
|
||||
* \returns 0, or -1 if this joystick or driver doesn't support effect packets
|
||||
*
|
||||
* \since This function is available since SDL 2.0.16.
|
||||
*/
|
||||
extern DECLSPEC int SDLCALL SDL_JoystickSendEffect(SDL_Joystick *joystick, const void *data, int size);
|
||||
|
||||
/**
|
||||
* Close a joystick previously opened with SDL_JoystickOpen().
|
||||
*
|
||||
* \param joystick The joystick device to close
|
||||
*
|
||||
* \since This function is available since SDL 2.0.0.
|
||||
*
|
||||
* \sa SDL_JoystickOpen
|
||||
*/
|
||||
extern DECLSPEC void SDLCALL SDL_JoystickClose(SDL_Joystick *joystick);
|
||||
|
||||
/**
|
||||
* Get the battery level of a joystick as SDL_JoystickPowerLevel.
|
||||
*
|
||||
* \param joystick the SDL_Joystick to query
|
||||
* \returns the current battery level as SDL_JoystickPowerLevel on success or
|
||||
* `SDL_JOYSTICK_POWER_UNKNOWN` if it is unknown
|
||||
*
|
||||
* \since This function is available since SDL 2.0.4.
|
||||
*/
|
||||
extern DECLSPEC SDL_JoystickPowerLevel SDLCALL SDL_JoystickCurrentPowerLevel(SDL_Joystick *joystick);
|
||||
|
||||
/* Ends C function definitions when using C++ */
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
#include "close_code.h"
|
||||
|
||||
#endif /* SDL_joystick_h_ */
|
||||
|
||||
/* vi: set ts=4 sw=4 expandtab: */
|
||||
Loaded 100 of 1697 files, more files were not shown because too many files have changed in this diff.
Show more
Reference in new issue
Block a user