mirror of
https://github.com/bearstonem/openmohaa-vr.git
synced 2026-10-17 22:00:21 +02:00
Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
edb1950a76 | ||
|
|
b5821e9bbd | ||
|
|
3f44dcf301 | ||
|
|
77ed007086 | ||
|
|
ba3ebed1c9 | ||
|
|
4e8ddf3c35 | ||
|
|
850b6de927 | ||
|
|
e45ab50367 | ||
|
|
567ec755b1 | ||
|
|
beec594ea4 | ||
|
|
f59f1df9b6 | ||
|
|
0dabcc776f | ||
|
|
17ab3d1114 | ||
|
|
ba42479dbc | ||
|
|
4e9640c433 | ||
|
|
4b95809397 | ||
|
|
bd93897286 | ||
|
|
68ddfb69fc | ||
|
|
ae28b03e02 | ||
|
|
e0e1f42acc | ||
|
|
46fbb6e8b3 | ||
|
|
65601eeb48 | ||
|
|
8b75c6639b | ||
|
|
8d431681bd | ||
|
|
a9f0fe7800 | ||
|
|
34a812d462 | ||
|
|
e098f52b84 | ||
|
|
8c03001cbb | ||
|
|
e243d24839 | ||
|
|
5108c800b6 | ||
|
|
4b4644547a | ||
|
|
be43b164b8 | ||
|
|
bf95447483 | ||
|
|
854d24138e | ||
|
|
9c81b4d475 | ||
|
|
f7a5f85a75 | ||
|
|
92fafe195c | ||
|
|
a1bd17d360 | ||
|
|
cd984ccce1 | ||
|
|
d180f36370 | ||
|
|
40fb8de556 | ||
|
|
d567ef9793 | ||
|
|
f6cc732886 | ||
|
|
01f08958f0 | ||
|
|
1c5a33f82a | ||
|
|
71d8685fe3 | ||
|
|
45488c2362 | ||
|
|
73e1b47c77 | ||
|
|
7a3920bfb9 | ||
|
|
301625d3cd | ||
|
|
45c112a463 | ||
|
|
89a748673c | ||
|
|
6220ecb80c | ||
|
|
5de6180106 | ||
|
|
807359c662 | ||
|
|
0cba64ea7e | ||
|
|
a459ad27d9 | ||
|
|
5ed828e49b | ||
|
|
c59be4be1e | ||
|
|
7e2f4e0023 | ||
|
|
37af1bbe7b | ||
|
|
dc85a1e13a | ||
|
|
c23b116f11 | ||
|
|
76c9e3a30a | ||
|
|
116b84312a | ||
|
|
8c2f5184c1 | ||
|
|
e74651f548 | ||
|
|
377dfb618b | ||
|
|
e5f645ec0c | ||
|
|
7fe8a90e8a | ||
|
|
70a9a61f93 | ||
|
|
d87b97256b | ||
|
|
6e64526167 | ||
|
|
9b563eef75 | ||
|
|
b98dcd8a53 | ||
|
|
ccb4b801bf | ||
|
|
a5f7d9596a | ||
|
|
4ea06f6eb2 | ||
|
|
e1923b58f6 | ||
|
|
df294ff155 | ||
|
|
e43ade976b | ||
|
|
774c9d1853 | ||
|
|
be6d2a05d2 | ||
|
|
78565fbd3c | ||
|
|
a3662d01ba | ||
|
|
970dfcf1d8 | ||
|
|
5a563b3cf0 | ||
|
|
ca9455bea1 | ||
|
|
77bcd6d258 | ||
|
|
8c7cbfaa48 | ||
|
|
7fdc863175 | ||
|
|
ba3e68adc5 | ||
|
|
c350b7e9c4 | ||
|
|
dad49e46ed | ||
|
|
a0481b86f1 | ||
|
|
1dc0dcc3cd | ||
|
|
9ec3c68d64 | ||
|
|
50fdc70025 | ||
|
|
5ab30b97d7 | ||
|
|
099a67f1fd | ||
|
|
56db5a1845 | ||
|
|
e152eba8fc | ||
|
|
9663b38c62 | ||
|
|
3d1741ec20 | ||
|
|
64cbcd023e | ||
|
|
33cfc2cbf8 | ||
|
|
4b486e4a90 | ||
|
|
b4c96cc543 | ||
|
|
1e27efd7af | ||
|
|
12d5849e25 | ||
|
|
663a7bb39e | ||
|
|
2cf8c7d62e | ||
|
|
34c80df5ae | ||
|
|
62a52c8974 | ||
|
|
971f0c9347 | ||
|
|
f4b41df38e | ||
|
|
6af295ebcb | ||
|
|
d7ed1c8530 | ||
|
|
ea8ee67784 | ||
|
|
2c0e913e86 | ||
|
|
17fa5af480 | ||
|
|
850a17807c | ||
|
|
c2ed93e92b | ||
|
|
c144c345c5 | ||
|
|
a20a1facb0 | ||
|
|
45205c1906 | ||
|
|
13762a05b8 | ||
|
|
2c42499788 | ||
|
|
b0c111170e | ||
|
|
08b15c4fe6 | ||
|
|
94cfcfe5e2 | ||
|
|
cf06a395de | ||
|
|
023770f63e | ||
|
|
95dff2536b | ||
|
|
7ce1eda3a7 | ||
|
|
96e4b26635 | ||
|
|
525f75a1a7 | ||
|
|
9200b37610 | ||
|
|
44d745d534 | ||
|
|
ee287ce00b | ||
|
|
e259d62e18 | ||
|
|
2514aed55c | ||
|
|
3c4f361c7a | ||
|
|
a4391bc320 | ||
|
|
80ae850063 | ||
|
|
bf4d973097 | ||
|
|
8bbebe9dea | ||
|
|
0eca5c56ac | ||
|
|
fa18824a8a | ||
|
|
ffcec02aa6 | ||
|
|
312dd2f4a6 | ||
|
|
7e52f74d2a | ||
|
|
1241818d5e | ||
|
|
d474791e1d | ||
|
|
bdf92ffb06 | ||
|
|
85f8f581bc | ||
|
|
76c11e3c97 | ||
|
|
02c2579366 | ||
|
|
6c5f95c6bf | ||
|
|
424243e500 | ||
|
|
b725c92922 | ||
|
|
1bcf6f73a4 | ||
|
|
483b49f5ee | ||
|
|
d790fa398f | ||
|
|
23e7df2796 | ||
|
|
ba502a9d39 | ||
|
|
3ce9621715 | ||
|
|
7806da0448 | ||
|
|
d533bc450f | ||
|
|
b91c3dab2d | ||
|
|
b0a541226e | ||
|
|
dbfb911826 | ||
|
|
fc33dfe656 | ||
|
|
ab48b8232b | ||
|
|
8ab12b29a6 | ||
|
|
035f7b2605 | ||
|
|
7081a56113 | ||
|
|
da9979f887 | ||
|
|
e6c53e77b7 | ||
|
|
0ea834788e | ||
|
|
c13e977291 | ||
|
|
d3dc939a14 | ||
|
|
fd00346eee | ||
|
|
a04ad5c689 | ||
|
|
484b13ba41 | ||
|
|
e1b949d958 | ||
|
|
af0829a7a2 | ||
|
|
34585da510 | ||
|
|
8f7a754d58 | ||
|
|
d93ba45515 | ||
|
|
314b47d8e6 | ||
|
|
5f88448bf6 | ||
|
|
6fb09175d0 | ||
|
|
7dd3ed4553 | ||
|
|
c5a921ae76 | ||
|
|
7e8936667f | ||
|
|
6329deef54 | ||
|
|
ce4794e0b2 | ||
|
|
3cfda459a8 | ||
|
|
6641100cbd | ||
|
|
962ae8a013 | ||
|
|
ead8087cff | ||
|
|
9af1bbe286 | ||
|
|
4827e0788c | ||
|
|
c8dfecf79c | ||
|
|
6285a33ee5 | ||
|
|
2ab7252beb | ||
|
|
d1c1f284ab | ||
|
|
ddcdf73c30 | ||
|
|
6ab939fbe0 | ||
|
|
1d7d7deaed | ||
|
|
c2e775666a | ||
|
|
d358e4274c | ||
|
|
ca8efa52c4 | ||
|
|
eeb82630c4 | ||
|
|
831695f288 | ||
|
|
e10fa5050a | ||
|
|
46ead9fa53 | ||
|
|
8e02230827 | ||
|
|
a924fc252b | ||
|
|
7cf24cb080 | ||
|
|
45518150e6 | ||
|
|
c734109321 | ||
|
|
0f38783f0d | ||
|
|
cd6378316f | ||
|
|
3098f5a097 | ||
|
|
b014a975a4 | ||
|
|
cce81cabff | ||
|
|
08a985d183 | ||
|
|
816126b13a | ||
|
|
f2a6278daa | ||
|
|
c1efc0e066 | ||
|
|
236897cfcc | ||
|
|
73b4569c07 | ||
|
|
25de66ed80 | ||
|
|
a2bbf6cff8 | ||
|
|
01367d0731 | ||
|
|
fedc993e57 | ||
|
|
b597240cfd | ||
|
|
127c9fe8f4 | ||
|
|
ffc35fb5ab | ||
|
|
aa7639485e | ||
|
|
a4267d4f77 | ||
|
|
12880db557 | ||
|
|
881d7f2f51 | ||
|
|
93335978ea | ||
|
|
64f62583ce | ||
|
|
5530d3051b | ||
|
|
42326ec708 | ||
|
|
aa54e3c673 | ||
|
|
5ce7f4faa5 | ||
|
|
6d20a438db | ||
|
|
7f662a93df | ||
|
|
1758a0cd2e | ||
|
|
9b003b5428 | ||
|
|
db7fdd57e4 | ||
|
|
689da52ddf | ||
|
|
2a1e2d7d6c | ||
|
|
cf8af91516 | ||
|
|
c9ff941600 | ||
|
|
d389f89c49 | ||
|
|
e05114806a | ||
|
|
3074494131 | ||
|
|
a9e161181c | ||
|
|
f9db0ab8f9 | ||
|
|
94cc77b848 | ||
|
|
f16bec1e0a | ||
|
|
e2c24abf62 | ||
|
|
50e3aa1f61 | ||
|
|
3c15588292 | ||
|
|
fdab158290 | ||
|
|
921726e0b8 | ||
|
|
b5e49df180 | ||
|
|
49fd4acef8 | ||
|
|
73aa377264 | ||
|
|
74e909d17f | ||
|
|
4b3c150004 | ||
|
|
5ee7948071 | ||
|
|
f653317e5b | ||
|
|
de43299841 | ||
|
|
e6f5d76abe | ||
|
|
fecd1eb505 | ||
|
|
9536a8ec64 | ||
|
|
06a12246f5 | ||
|
|
456b660b2a | ||
|
|
5b81f6a977 | ||
|
|
c854df8ffa | ||
|
|
22a34d8d68 | ||
|
|
0f8969e076 | ||
|
|
f164e889cc | ||
|
|
1e2a331518 | ||
|
|
158ff62aaa | ||
|
|
79af8a46d1 | ||
|
|
200bf3229c | ||
|
|
e0b7d4cc60 | ||
|
|
4fe11b5ea9 | ||
|
|
0b590ab147 | ||
|
|
7a20bb4deb | ||
|
|
c87c242098 | ||
|
|
eb92182230 | ||
|
|
5b9efaa2a0 | ||
|
|
58f7e6f1fe | ||
|
|
9538dcb6e7 | ||
|
|
0080f55ef8 | ||
|
|
aac91e8763 | ||
|
|
5c0adf9a28 | ||
|
|
9963a99868 | ||
|
|
515a531abf | ||
|
|
d3d16ab7b6 | ||
|
|
d08027360f | ||
|
|
70f6ede7b8 | ||
|
|
c1c70a53be | ||
|
|
f89bfba5dc | ||
|
|
c1a66bf9e7 | ||
|
|
e98c725043 | ||
|
|
ad527a7033 | ||
|
|
59706d4698 | ||
|
|
7addef4f5f | ||
|
|
08d0a378f8 | ||
|
|
01381ed084 | ||
|
|
2c72908f76 | ||
|
|
32ba71693c | ||
|
|
7fff3192a6 | ||
|
|
83aa818c00 | ||
|
|
56d61bdef3 | ||
|
|
ebd86b32bd | ||
|
|
08c718d232 | ||
|
|
512831dea9 | ||
|
|
a36bbb0cda | ||
|
|
8a9e0f0b01 | ||
|
|
076fd69131 | ||
|
|
587f7f544e | ||
|
|
178c486b83 | ||
|
|
ad1748b8be | ||
|
|
004f88dae9 | ||
|
|
97fe824b80 | ||
|
|
758176dd32 | ||
|
|
854c1980cc | ||
|
|
840002b63a | ||
|
|
47a447dbb0 | ||
|
|
a1d47cf64a | ||
|
|
a5bb4c1874 | ||
|
|
22b593215f | ||
|
|
68181acec7 | ||
|
|
3af35fa610 | ||
|
|
2c12d4f2de | ||
|
|
bbac9c559c | ||
|
|
03eaa62902 | ||
|
|
dcca5ed469 | ||
|
|
2aa46f5a52 | ||
|
|
ff3c27ab20 | ||
|
|
833408c663 | ||
|
|
38d9f98221 | ||
|
|
ac4b4266b4 | ||
|
|
b90bbd9dcf | ||
|
|
e8f69e197c | ||
|
|
9922a7095b | ||
|
|
3c836144e2 | ||
|
|
8c4a593fb0 | ||
|
|
0e282833e6 | ||
|
|
54753caf94 | ||
|
|
fcba3bed95 | ||
|
|
d348ac66de | ||
|
|
fd4f5e7d51 | ||
|
|
c77fcd2cbc | ||
|
|
ee385abfef | ||
|
|
49335ba8a8 | ||
|
|
8ac186ce17 | ||
|
|
ca2322a4da | ||
|
|
a1e7afac76 | ||
|
|
2f75092d8b | ||
|
|
6f9e710ec9 | ||
|
|
0b12d160bb | ||
|
|
330b45a1ed | ||
|
|
5f0a0d0363 | ||
|
|
ad01c2d966 | ||
|
|
fb5ed82401 | ||
|
|
eaa7f10b36 | ||
|
|
f2c8dbe57a | ||
|
|
447b0459aa | ||
|
|
e31c64e42e | ||
|
|
32411b2a90 | ||
|
|
32f850556e | ||
|
|
fd94f53e25 | ||
|
|
4aa7e06a56 | ||
|
|
033b76af14 | ||
|
|
e37a5f4d06 | ||
|
|
58e12e0141 | ||
|
|
147678b0f0 | ||
|
|
e6cbd00871 | ||
|
|
1eb7458af9 | ||
|
|
38cf5b82b2 | ||
|
|
a5c59c4b77 | ||
|
|
d190cc6e40 | ||
|
|
8234ce1e5f | ||
|
|
e962e4e1f5 | ||
|
|
ee970a3fce | ||
|
|
9242faaa49 | ||
|
|
b813f7ee56 | ||
|
|
7f64ef05d5 | ||
|
|
9cb593c9e4 | ||
|
|
cfb343d262 | ||
|
|
9c811c2318 | ||
|
|
7b97ad6e2f | ||
|
|
fdea2a2e92 | ||
|
|
aa0085b57d | ||
|
|
3fa489c0f9 | ||
|
|
fbee409f47 | ||
|
|
7a8aa4eb84 | ||
|
|
d4bbaa41c3 | ||
|
|
bb23fe159f | ||
|
|
b1a02389f6 | ||
|
|
f10ddcaa17 | ||
|
|
77f0ce0673 | ||
|
|
7fc486757d | ||
|
|
dfc3fdb88b | ||
|
|
3769bd2a68 | ||
|
|
80d1b3b204 | ||
|
|
e66fd28831 | ||
|
|
1cabf5c31e | ||
|
|
8341f8cb6a | ||
|
|
1fc36fce9b | ||
|
|
33dbb07559 | ||
|
|
e510c50a24 | ||
|
|
c345035e12 | ||
|
|
9bb4789b32 | ||
|
|
7e26814cfa | ||
|
|
33855cfbee | ||
|
|
98bb3e0366 | ||
|
|
52744fb784 | ||
|
|
08e5208835 | ||
|
|
187079842f | ||
|
|
ef2c5d2df6 | ||
|
|
92a0a9c197 | ||
|
|
90e46f535c | ||
|
|
02fc573e31 | ||
|
|
b8c7223da7 | ||
|
|
7b53e25dd5 | ||
|
|
f8f9d2f65c | ||
|
|
19e12701f3 | ||
|
|
24c7311162 | ||
|
|
599914934c | ||
|
|
8fdc66d138 | ||
|
|
83caae7586 | ||
|
|
1f599e62c6 | ||
|
|
4e174fd5bf | ||
|
|
edf3560dd5 | ||
|
|
7452bf39fb | ||
|
|
c2bac6d1ef | ||
|
|
47cd8ccfc8 | ||
|
|
ec6cab28a5 | ||
|
|
45de1067bd | ||
|
|
7ab04b0bcb | ||
|
|
1a71d44b43 | ||
|
|
1ea273fba0 | ||
|
|
591be6c2fd | ||
|
|
6b02457190 | ||
|
|
87e5b6d41e | ||
|
|
7f0c506fea | ||
|
|
539c2df378 | ||
|
|
4399e2ab31 | ||
|
|
210eeff481 | ||
|
|
95e72dd339 | ||
|
|
a6d9369204 | ||
|
|
ab80045329 | ||
|
|
94aaeac194 | ||
|
|
4bec5cef01 | ||
|
|
1500d213e7 | ||
|
|
2dbe61789d | ||
|
|
3f9bed938e | ||
|
|
619d27da81 | ||
|
|
bfd0f6e744 | ||
|
|
6d71cabbda | ||
|
|
317664f88c | ||
|
|
e7cddd47a5 | ||
|
|
393dfae33e | ||
|
|
c69ea0e4d8 | ||
|
|
59fdcf0ae9 | ||
|
|
f22ea9eb21 | ||
|
|
752588ffcd | ||
|
|
a0f6d7d361 | ||
|
|
1b5232c2d0 | ||
|
|
089e68e85e | ||
|
|
a9ec7cff4f | ||
|
|
63c2b3642c | ||
|
|
5e04124211 | ||
|
|
bbfd4ac280 | ||
|
|
28fd0ba201 | ||
|
|
305c026f4e | ||
|
|
b836042a02 | ||
|
|
ec95b6bfbe | ||
|
|
6049ecfc6e | ||
|
|
6a31381c8e | ||
|
|
7f8bcf8075 | ||
|
|
b84a47ad3f | ||
|
|
f91d0c1693 | ||
|
|
cd65424b00 | ||
|
|
944e0f24ae | ||
|
|
d396a45e64 | ||
|
|
c0d5ebaaf3 | ||
|
|
c3b42cc297 | ||
|
|
4f32d436bb | ||
|
|
4268a875fa | ||
|
|
2ec2ef8bbf | ||
|
|
7ba29029e1 | ||
|
|
bbdbe62930 | ||
|
|
b95241dcfe | ||
|
|
8cc1cd6f2c | ||
|
|
f7947b3fe3 | ||
|
|
4c06dd7107 | ||
|
|
d6db83805d | ||
|
|
25f4d0199d | ||
|
|
3bcd5cf308 | ||
|
|
ce38cf9040 | ||
|
|
adc2704da0 | ||
|
|
f999d87f68 | ||
|
|
7f8446ab82 | ||
|
|
4d2b61a766 | ||
|
|
1f3661238a | ||
|
|
5f236d4d42 | ||
|
|
8fb3856ea6 | ||
|
|
418985f90b | ||
|
|
2c738fa28e | ||
|
|
8a8ac2e3d1 | ||
|
|
cf65fd890d | ||
|
|
6a86fc8067 | ||
|
|
528039f80b | ||
|
|
b5875ae890 | ||
|
|
8801834804 | ||
|
|
a14a2c9684 | ||
|
|
269e73168e | ||
|
|
19eec6305b | ||
|
|
9930d50f99 | ||
|
|
9427137dbd | ||
|
|
c10fd17d19 | ||
|
|
3c26b98b65 | ||
|
|
6e357459e6 | ||
|
|
fe42511c54 | ||
|
|
32f507ce15 |
No files matched your search
@@ -1,4 +1,4 @@
|
||||
name: Build branch
|
||||
name: "Builds"
|
||||
|
||||
on:
|
||||
push:
|
||||
@@ -10,8 +10,67 @@ concurrency:
|
||||
group: ${{ github.workflow }}-${{ github.ref }}
|
||||
cancel-in-progress: true
|
||||
|
||||
permissions:
|
||||
contents: write
|
||||
|
||||
jobs:
|
||||
build-all:
|
||||
uses: ./.github/workflows/shared-build.yml
|
||||
with:
|
||||
environment: "testing"
|
||||
environment: 'testing'
|
||||
|
||||
# Initially create a release with 1 job
|
||||
# so multiple files can be uploaded at the same time afterwards
|
||||
create-release:
|
||||
runs-on: ubuntu-24.04
|
||||
environment: 'testing'
|
||||
needs: [build-all]
|
||||
|
||||
steps:
|
||||
- name: Release
|
||||
uses: softprops/action-gh-release@v2.3.2
|
||||
with:
|
||||
prerelease: true
|
||||
name: '${{github.ref_name}}-${{github.sha}}'
|
||||
tag_name: 'dev'
|
||||
|
||||
deploy-release:
|
||||
if: github.event_name != 'pull_request' && github.ref_name == 'main'
|
||||
strategy:
|
||||
matrix:
|
||||
target_os: [
|
||||
'linux-amd64',
|
||||
'linux-i686',
|
||||
'linux-arm64',
|
||||
'linux-armhf',
|
||||
'linux-powerpc',
|
||||
'linux-ppc64',
|
||||
'linux-ppc64el',
|
||||
'windows-x64-pdb',
|
||||
'windows-x86-pdb',
|
||||
'windows-arm64-pdb',
|
||||
'macos-multiarch-arm64-x86_64',
|
||||
]
|
||||
|
||||
runs-on: ubuntu-24.04
|
||||
environment: 'testing'
|
||||
needs: [create-release]
|
||||
|
||||
env:
|
||||
RELEASE_NAME: ${{github.event.repository.name}}-dev-${{matrix.target_os}}
|
||||
|
||||
steps:
|
||||
- uses: actions/download-artifact@v4
|
||||
with:
|
||||
name: 'out-${{matrix.target_os}}'
|
||||
path: ${{github.workspace}}/${{matrix.target_os}}
|
||||
|
||||
- name: Zip
|
||||
working-directory: '${{github.workspace}}/${{matrix.target_os}}'
|
||||
run: zip -r "../${{env.RELEASE_NAME}}.zip" ./
|
||||
|
||||
- name: Release
|
||||
uses: softprops/action-gh-release@v2.3.2
|
||||
with:
|
||||
tag_name: 'dev'
|
||||
files: ${{github.workspace}}/${{env.RELEASE_NAME}}.zip
|
||||
@@ -0,0 +1,60 @@
|
||||
name: "Generate Documentation"
|
||||
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- 'main'
|
||||
|
||||
concurrency:
|
||||
group: ${{ github.workflow }}-${{ github.ref }}
|
||||
cancel-in-progress: true
|
||||
|
||||
jobs:
|
||||
build:
|
||||
runs-on: ubuntu-latest
|
||||
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
|
||||
tar xzf doxygen.tar.gz
|
||||
cd doxygen-*
|
||||
sudo cp bin/doxygen /usr/local/bin/
|
||||
|
||||
- name: Checkout repository
|
||||
uses: actions/checkout@v4
|
||||
with:
|
||||
path: 'source'
|
||||
|
||||
- name: Generate Documentation (Doxygen)
|
||||
working-directory: ${{github.workspace}}/source
|
||||
run: |
|
||||
version_file=$(cat code/qcommon/q_version.h)
|
||||
PRODUCT_VERSION_MAJOR=$(echo "$version_file" | grep -E "define[ \t]+PRODUCT_VERSION_MAJOR" | awk -F'[ \t]+' '{print $3""}' | tr -d '\r\n')
|
||||
PRODUCT_VERSION_MINOR=$(echo "$version_file" | grep -E "define[ \t]+PRODUCT_VERSION_MINOR" | awk -F'[ \t]+' '{print $3""}' | tr -d '\r\n')
|
||||
PRODUCT_VERSION_PATCH=$(echo "$version_file" | grep -E "define[ \t]+PRODUCT_VERSION_PATCH" | awk -F'[ \t]+' '{print $3""}' | tr -d '\r\n')
|
||||
export PROJECT_VERSION_NUMBER="$PRODUCT_VERSION_MAJOR.$PRODUCT_VERSION_MINOR.$PRODUCT_VERSION_PATCH"
|
||||
doxygen docs/Doxyfile
|
||||
|
||||
- name: Upload static files as artifact
|
||||
uses: actions/upload-pages-artifact@v3
|
||||
with:
|
||||
path: ${{github.workspace}}/source/docs/doxygen/html
|
||||
|
||||
deploy:
|
||||
environment:
|
||||
name: github-pages
|
||||
url: ${{ steps.deployment.outputs.page_url }}
|
||||
|
||||
runs-on: ubuntu-latest
|
||||
needs: build
|
||||
|
||||
# Permissions for deploying the page
|
||||
permissions:
|
||||
pages: write
|
||||
id-token: write
|
||||
|
||||
steps:
|
||||
- name: Deploy to GitHub Pages
|
||||
id: deployment
|
||||
uses: actions/deploy-pages@v4
|
||||
|
||||
@@ -47,6 +47,12 @@ jobs:
|
||||
- name: Checkout repository
|
||||
uses: actions/checkout@v4
|
||||
|
||||
- uses: awalsh128/cache-apt-pkgs-action@latest
|
||||
name: Install required packages
|
||||
with:
|
||||
packages: libopenal-dev libpulse-dev portaudio19-dev libasound2-dev libjack-dev libpipewire-0.3-dev qtbase5-dev libdbus-1-dev
|
||||
version: "0.1"
|
||||
|
||||
# Setup SDL
|
||||
- name: Set up SDL
|
||||
id: sdl
|
||||
|
||||
@@ -0,0 +1,238 @@
|
||||
##########################
|
||||
#
|
||||
# Linux
|
||||
# Ubuntu 22.04
|
||||
#
|
||||
# Using this version instead of 24.04 to use a lower GLIBC version (2.34).
|
||||
# ARM is used for more efficiency, and x64 is used for legacy architectures like PowerPC.
|
||||
##########################
|
||||
name: "Linux Builds"
|
||||
|
||||
on:
|
||||
workflow_call:
|
||||
inputs:
|
||||
environment:
|
||||
required: true
|
||||
type: string
|
||||
|
||||
env:
|
||||
# Customize the CMake build type here (Release, Debug, RelWithDebInfo, etc.)
|
||||
BUILD_TYPE: RelWithDebInfo
|
||||
RELEASE_STAGE: ${{ vars.RELEASE_STAGE || 'unstable' }}
|
||||
|
||||
jobs:
|
||||
build:
|
||||
strategy:
|
||||
matrix:
|
||||
architecture: [
|
||||
{name: 'amd64', os: "ubuntu-22.04-arm", package: 'x86-64-linux-gnu', triple: 'x86_64-linux-gnu', arch_option: 'linux-x86_64'},
|
||||
{name: 'i686', os: "ubuntu-22.04-arm", package: 'i686-linux-gnu', triple: 'i686-linux-gnu', arch_option: 'linux-x86'},
|
||||
{name: 'arm64', os: "ubuntu-22.04-arm", package: 'aarch64-linux-gnu', triple: 'aarch64-linux-gnu', arch_option: 'linux-aarch64'},
|
||||
{name: 'armhf', os: "ubuntu-22.04-arm", package: 'arm-linux-gnueabihf', triple: 'arm-linux-gnueabihf', arch_option: 'linux-armv4'},
|
||||
{name: 'powerpc', os: "ubuntu-22.04", package: 'powerpc-linux-gnu', triple: 'powerpc-linux-gnu', arch_option: 'linux-ppc'},
|
||||
{name: 'ppc64', os: "ubuntu-22.04", package: 'powerpc64-linux-gnu', triple: 'powerpc64-linux-gnu', arch_option: 'linux-ppc64'},
|
||||
{name: 'ppc64el', os: "ubuntu-22.04-arm", package: 'powerpc64le-linux-gnu', triple: 'powerpc64le-linux-gnu', arch_option: 'linux-ppc64le'}
|
||||
]
|
||||
|
||||
name: "Building for platform linux-${{matrix.architecture.name}}"
|
||||
runs-on: ${{ matrix.architecture.os }}
|
||||
environment: ${{ inputs.environment }}
|
||||
env:
|
||||
wolfssl-version: 'v5.7.6-stable'
|
||||
curl-version: '8_12_1'
|
||||
openal-soft-branch: '1.24.3'
|
||||
|
||||
steps:
|
||||
###
|
||||
# Packages
|
||||
###
|
||||
|
||||
- uses: awalsh128/cache-apt-pkgs-action@latest
|
||||
name: Install required packages
|
||||
with:
|
||||
packages: flex bison ninja-build cmake clang libpulse-dev portaudio19-dev libasound2-dev libjack-dev libpipewire-0.3-dev qtbase5-dev libdbus-1-dev
|
||||
version: "${{ runner.os }}-${{ runner.arch }}-v1"
|
||||
|
||||
- name: Settings
|
||||
working-directory: ${{github.workspace}}
|
||||
run: |
|
||||
echo "HOST_TRIPLE=$(gcc -dumpmachine)" >> $GITHUB_ENV
|
||||
|
||||
- uses: awalsh128/cache-apt-pkgs-action@latest
|
||||
name: Install required cross-platform packages (${{ matrix.architecture.package }})
|
||||
if: env.HOST_TRIPLE != matrix.architecture.triple
|
||||
with:
|
||||
packages: gcc-12-${{ matrix.architecture.package }} g++-12-${{ matrix.architecture.package }}
|
||||
version: "${{ runner.os }}-${{ runner.arch }}-v1"
|
||||
|
||||
- name: Settings
|
||||
working-directory: ${{github.workspace}}
|
||||
run: |
|
||||
echo "CMAKE_GENERATOR=Ninja Multi-Config" >> $GITHUB_ENV
|
||||
echo "CC=clang" >> $GITHUB_ENV
|
||||
echo "CXX=clang++" >> $GITHUB_ENV
|
||||
echo "CFLAGS='--target=${{ matrix.architecture.triple }}'" >> $GITHUB_ENV
|
||||
echo "CXXFLAGS='--target=${{ matrix.architecture.triple }}'" >> $GITHUB_ENV
|
||||
|
||||
###
|
||||
# SDL
|
||||
###
|
||||
|
||||
# Setup SDL
|
||||
- name: Set up SDL
|
||||
id: sdl
|
||||
uses: libsdl-org/setup-sdl@main
|
||||
with:
|
||||
version: 2-latest
|
||||
build-type: Release
|
||||
# Workaround for when changing the runner OS version
|
||||
cmake-arguments: "-DCACHE_OS_VERSION=Ubuntu_22.04"
|
||||
|
||||
###
|
||||
# OpenAL
|
||||
###
|
||||
- name: Cache OpenAL
|
||||
id: cache-openal-soft
|
||||
uses: actions/cache@v4
|
||||
with:
|
||||
path: 'thirdparties/soft-oal/install'
|
||||
key: ${{ runner.os }}-${{ matrix.architecture.name }}-openal-soft-${{ env.openal-soft-branch }}-v1
|
||||
|
||||
# soft-oal setup
|
||||
- name: Checkout soft-oal
|
||||
if: steps.cache-openal-soft.outputs.cache-hit != 'true'
|
||||
uses: actions/checkout@v4
|
||||
with:
|
||||
repository: 'kcat/openal-soft'
|
||||
path: 'thirdparties/soft-oal'
|
||||
ref: '${{ env.openal-soft-branch }}'
|
||||
|
||||
- name: Configure and install soft-oal
|
||||
if: steps.cache-openal-soft.outputs.cache-hit != 'true'
|
||||
working-directory: ${{github.workspace}}/thirdparties/soft-oal
|
||||
run: |
|
||||
cmake -B ./build \
|
||||
-DALSOFT_UTILS=OFF \
|
||||
-DCMAKE_INSTALL_PREFIX='${{github.workspace}}/thirdparties/soft-oal/install'
|
||||
cmake --build ./build --config Release --parallel
|
||||
cmake --install ./build --config Release
|
||||
|
||||
###
|
||||
# WolfSSL
|
||||
###
|
||||
- name: Cache WolfSSL
|
||||
id: cache-wolfssl
|
||||
uses: actions/cache@v4
|
||||
with:
|
||||
path: 'thirdparties/wolfssl/install'
|
||||
key: ${{ runner.os }}-${{ matrix.architecture.name }}-wolfssl-${{ env.wolfssl-version }}-v1
|
||||
|
||||
# WolfSSL setup
|
||||
- name: Checkout WolfSSL
|
||||
if: steps.cache-wolfssl.outputs.cache-hit != 'true'
|
||||
uses: actions/checkout@v4
|
||||
with:
|
||||
repository: 'wolfssl/wolfssl'
|
||||
path: 'thirdparties/wolfssl'
|
||||
ref: '${{ env.wolfssl-version }}'
|
||||
|
||||
# WolfSSL build
|
||||
- name: Configure and install wolfssl
|
||||
if: steps.cache-wolfssl.outputs.cache-hit != 'true'
|
||||
working-directory: ${{github.workspace}}/thirdparties/wolfssl
|
||||
run: |
|
||||
cmake -B ./build \
|
||||
-DCMAKE_INSTALL_PREFIX='${{github.workspace}}/thirdparties/wolfssl/install' \
|
||||
-DCMAKE_C_FLAGS="$CFLAGS -fPIC" \
|
||||
-DCMAKE_CXX_FLAGS="$CFLAGS -fPIC" \
|
||||
-DBUILD_SHARED_LIBS=OFF -DWOLFSSL_OPENSSLEXTRA=ON -DWOLFSSL_ASM=OFF -DWOLFSSL_EXAMPLES=OFF -DWOLFSSL_CURL=ON
|
||||
cmake --build ./build --config Release --parallel
|
||||
cmake --install ./build --config Release
|
||||
|
||||
###
|
||||
# cURL
|
||||
###
|
||||
- name: Cache cURL
|
||||
id: cache-curl
|
||||
uses: actions/cache@v4
|
||||
with:
|
||||
path: 'thirdparties/curl/install'
|
||||
key: ${{ runner.os }}-${{ matrix.architecture.name }}-curl-${{ env.curl-version }}-v1
|
||||
|
||||
# cURL setup
|
||||
- name: Checkout cURL
|
||||
if: steps.cache-curl.outputs.cache-hit != 'true'
|
||||
uses: actions/checkout@v4
|
||||
with:
|
||||
repository: 'curl/curl'
|
||||
path: 'thirdparties/curl'
|
||||
ref: 'curl-${{ env.curl-version }}'
|
||||
|
||||
# cURL build
|
||||
- name: Configure and install curl
|
||||
if: steps.cache-curl.outputs.cache-hit != 'true'
|
||||
working-directory: ${{github.workspace}}/thirdparties/curl
|
||||
run: |
|
||||
cmake -B ./build \
|
||||
-DCMAKE_INSTALL_PREFIX='${{github.workspace}}/thirdparties/curl/install' \
|
||||
-DCURL_USE_LIBPSL=OFF \
|
||||
-DCURL_USE_WOLFSSL=ON \
|
||||
-DCURL_ZLIB="" \
|
||||
-DCURL_BROTLI="" \
|
||||
-DCURL_ZSTD="" \
|
||||
-DCMAKE_SHARED_LINKER_FLAGS="-lm" \
|
||||
-DWolfSSL_ROOT='${{github.workspace}}/thirdparties/wolfssl/install'
|
||||
cmake --build ./build --config Release --parallel
|
||||
cmake --install ./build --config Release
|
||||
|
||||
###
|
||||
# Project
|
||||
###
|
||||
|
||||
- uses: actions/checkout@v4
|
||||
with:
|
||||
path: 'source'
|
||||
|
||||
- name: CMake Settings
|
||||
run: |
|
||||
echo "CMAKE_PARAM=--log-level=VERBOSE \
|
||||
-DCMAKE_INSTALL_PREFIX='${{github.workspace}}/install' \
|
||||
-DOPENAL_LIBRARY='${{github.workspace}}/thirdparties/soft-oal' \
|
||||
-DOPENAL_INCLUDE_DIR='${{github.workspace}}/thirdparties/soft-oal/install/include' \
|
||||
-DCURL_ROOT='${{github.workspace}}/thirdparties/curl/install' \
|
||||
-DGIT_REVISION_BUILD_NUMBER=${{ github.run_number }} \
|
||||
-DPRODUCT_VERSION_STAGE='${{ env.RELEASE_STAGE }}'" >> $GITHUB_ENV
|
||||
|
||||
- name: Configure CMake
|
||||
working-directory: ${{github.workspace}}
|
||||
run: |
|
||||
cmake -B ./build ${{ env.CMAKE_PARAM }} ./source
|
||||
|
||||
- name: Build
|
||||
working-directory: ${{github.workspace}}
|
||||
run: |
|
||||
cmake --build ${{github.workspace}}/build --config ${{env.BUILD_TYPE}} --parallel
|
||||
|
||||
- name: Install
|
||||
working-directory: ${{github.workspace}}
|
||||
# Install to the directory defined in CMAKE_INSTALL_PREFIX
|
||||
run: |
|
||||
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/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
|
||||
if [ -d ${{github.workspace}}/install/lib ]; then cp -r ${{github.workspace}}/install/lib/openmohaa/. '${{github.workspace}}/package'; fi
|
||||
|
||||
###
|
||||
# Artifacts
|
||||
###
|
||||
|
||||
- uses: actions/upload-artifact@v4
|
||||
with:
|
||||
name: out-linux-${{matrix.architecture.name}}
|
||||
if-no-files-found: error
|
||||
path:
|
||||
${{github.workspace}}/package
|
||||
@@ -0,0 +1,231 @@
|
||||
##########################
|
||||
#
|
||||
# Apple macOS
|
||||
# macOS 15
|
||||
#
|
||||
# This version is used as the OS, as it's faster than other versions.
|
||||
##########################
|
||||
name: "macOS Builds"
|
||||
|
||||
on:
|
||||
workflow_call:
|
||||
inputs:
|
||||
environment:
|
||||
required: true
|
||||
type: string
|
||||
|
||||
env:
|
||||
# Customize the CMake build type here (Release, Debug, RelWithDebInfo, etc.)
|
||||
BUILD_TYPE: RelWithDebInfo
|
||||
RELEASE_STAGE: ${{ vars.RELEASE_STAGE || 'unstable' }}
|
||||
|
||||
jobs:
|
||||
build:
|
||||
strategy:
|
||||
matrix:
|
||||
architecture: [
|
||||
#{name: 'x86_64', triple: 'x86_64-apple-macos10.8'},
|
||||
#{name: 'arm64', triple: 'arm64-apple-macos11'}
|
||||
#{name: 'x86_64', build_name: 'x86_64'},
|
||||
#{name: 'arm64', build_name: 'arm64'},
|
||||
# Compile into an universal binary
|
||||
{name: 'multiarch-arm64-x86_64', build_name: 'arm64;x86_64' }
|
||||
]
|
||||
|
||||
name: "Building for platform macos-${{matrix.architecture.name}}"
|
||||
runs-on: "macos-15"
|
||||
env:
|
||||
openal-soft-branch: '1.24.3'
|
||||
wolfssl-version: 'v5.7.6-stable'
|
||||
curl-version: '8_12_1'
|
||||
|
||||
steps:
|
||||
###
|
||||
# Packages
|
||||
###
|
||||
|
||||
- name: Install required packages
|
||||
run: |
|
||||
brew install git flex bison ninja cmake llvm perl
|
||||
|
||||
- name: Settings
|
||||
working-directory: ${{github.workspace}}
|
||||
run: |
|
||||
echo "CMAKE_GENERATOR=Ninja Multi-Config" >> $GITHUB_ENV
|
||||
echo "CC=clang" >> $GITHUB_ENV
|
||||
echo "CXX=clang++" >> $GITHUB_ENV
|
||||
echo "MACOSX_DEPLOYMENT_TARGET=10.15" >> $GITHUB_ENV
|
||||
|
||||
###
|
||||
# SDL
|
||||
###
|
||||
|
||||
# Setup SDL
|
||||
- name: Set up SDL
|
||||
id: sdl
|
||||
uses: libsdl-org/setup-sdl@main
|
||||
with:
|
||||
version: 2-latest
|
||||
build-type: Release
|
||||
cmake-arguments: "-DCMAKE_OSX_ARCHITECTURES='${{ matrix.architecture.build_name }}'
|
||||
-DCMAKE_VERBOSE_MAKEFILE=on"
|
||||
|
||||
###
|
||||
# OpenAL
|
||||
###
|
||||
- name: Cache OpenAL
|
||||
id: cache-openal-soft
|
||||
uses: actions/cache@v4
|
||||
with:
|
||||
path: 'thirdparties/soft-oal/install'
|
||||
key: ${{ runner.os }}-${{ matrix.architecture.name }}-openal-soft-${{ env.openal-soft-branch }}-v1
|
||||
|
||||
# soft-oal setup
|
||||
# Use GCC instead of Clang because of missing SSE intrinsics
|
||||
# It also doesn't enable altivec support on PowerPC by default
|
||||
- name: Checkout soft-oal
|
||||
if: steps.cache-openal-soft.outputs.cache-hit != 'true'
|
||||
uses: actions/checkout@v4
|
||||
with:
|
||||
repository: 'kcat/openal-soft'
|
||||
path: 'thirdparties/soft-oal'
|
||||
ref: '${{ env.openal-soft-branch }}'
|
||||
|
||||
# soft-oal build
|
||||
- name: Configure and install soft-oal
|
||||
if: steps.cache-openal-soft.outputs.cache-hit != 'true'
|
||||
working-directory: ${{github.workspace}}/thirdparties/soft-oal
|
||||
run: |
|
||||
cmake -B ./build \
|
||||
-DCMAKE_INSTALL_PREFIX='${{github.workspace}}/thirdparties/soft-oal/install' \
|
||||
-DCMAKE_OSX_ARCHITECTURES='${{ matrix.architecture.build_name }}' \
|
||||
-DCMAKE_VERBOSE_MAKEFILE=on
|
||||
cmake --build ./build --config Release --parallel
|
||||
cmake --install ./build --config Release
|
||||
|
||||
###
|
||||
# WolfSSL
|
||||
###
|
||||
# FIXME: Figure out how to compile WolfSSL cross-architecture
|
||||
#
|
||||
# - name: Cache WolfSSL
|
||||
# id: cache-wolfssl
|
||||
# uses: actions/cache@v4
|
||||
# with:
|
||||
# path: 'thirdparties/wolfssl_install'
|
||||
# key: ${{ runner.os }}-${{ matrix.architecture.name }}-wolfssl-${{ env.wolfssl-version }}-v1
|
||||
#
|
||||
# # WolfSSL setup
|
||||
# - name: Checkout WolfSSL
|
||||
# if: steps.cache-wolfssl.outputs.cache-hit != 'true'
|
||||
# uses: actions/checkout@v4
|
||||
# with:
|
||||
# repository: 'wolfssl/wolfssl'
|
||||
# path: 'thirdparties/wolfssl'
|
||||
# ref: '${{ env.wolfssl-version }}'
|
||||
#
|
||||
# # WolfSSL build
|
||||
# - name: Configure and install wolfssl
|
||||
# if: steps.cache-wolfssl.outputs.cache-hit != 'true'
|
||||
# working-directory: ${{github.workspace}}/thirdparties/wolfssl
|
||||
# run: |
|
||||
# cmake -B ./build \
|
||||
# -DCMAKE_INSTALL_PREFIX='${{github.workspace}}/thirdparties/wolfssl_install' \
|
||||
# -DCMAKE_OSX_ARCHITECTURES='${{ matrix.architecture.build_name }}' \
|
||||
# -DBUILD_SHARED_LIBS=OFF -DWOLFSSL_OPENSSLEXTRA=ON -DWOLFSSL_ASM=OFF -DWOLFSSL_EXAMPLES=OFF -DWOLFSSL_CURL=ON
|
||||
# cmake --build ./build --config Release --parallel
|
||||
# cmake --install ./build --config Release
|
||||
|
||||
###
|
||||
# cURL
|
||||
###
|
||||
- name: Cache cURL
|
||||
id: cache-curl
|
||||
uses: actions/cache@v4
|
||||
with:
|
||||
path: 'thirdparties/curl/install'
|
||||
key: ${{ runner.os }}-${{ matrix.architecture.name }}-curl-${{ env.curl-version }}-v1
|
||||
|
||||
# cURL setup
|
||||
- name: Checkout cURL
|
||||
if: steps.cache-curl.outputs.cache-hit != 'true'
|
||||
uses: actions/checkout@v4
|
||||
with:
|
||||
repository: 'curl/curl'
|
||||
path: 'thirdparties/curl'
|
||||
ref: 'curl-${{ env.curl-version }}'
|
||||
|
||||
# cURL build
|
||||
- name: Configure and install curl
|
||||
if: steps.cache-curl.outputs.cache-hit != 'true'
|
||||
working-directory: ${{github.workspace}}/thirdparties/curl
|
||||
run: |
|
||||
cmake -B ./build \
|
||||
-DCMAKE_INSTALL_PREFIX='${{github.workspace}}/thirdparties/curl/install' \
|
||||
-DCMAKE_OSX_ARCHITECTURES='${{ matrix.architecture.build_name }}' \
|
||||
-DCURL_USE_LIBPSL=OFF \
|
||||
-DCURL_USE_WOLFSSL=OFF \
|
||||
-DCURL_USE_LIBSSH2=OFF \
|
||||
-DUSE_LIBIDN2=OFF \
|
||||
-DUSE_NGHTTP2=OFF \
|
||||
-DCURL_ENABLE_SSL=OFF \
|
||||
-DCURL_ZLIB="" \
|
||||
-DCURL_BROTLI="" \
|
||||
-DCURL_ZSTD="" \
|
||||
-DWolfSSL_ROOT='${{github.workspace}}/thirdparties/wolfssl_install'
|
||||
cmake --build ./build --config Release --parallel
|
||||
cmake --install ./build --config Release
|
||||
|
||||
###
|
||||
# Project
|
||||
###
|
||||
|
||||
- uses: actions/checkout@v4
|
||||
with:
|
||||
path: 'source'
|
||||
|
||||
- name: CMake Settings
|
||||
run: |
|
||||
echo "CMAKE_PARAM=--log-level=VERBOSE \
|
||||
-DCMAKE_INSTALL_PREFIX='${{github.workspace}}/install' \
|
||||
-DCMAKE_VERBOSE_MAKEFILE=on \
|
||||
-DCMAKE_OSX_ARCHITECTURES='${{ matrix.architecture.build_name }}' \
|
||||
-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' \
|
||||
-DGIT_REVISION_BUILD_NUMBER=${{ github.run_number }} \
|
||||
-DPRODUCT_VERSION_STAGE='${{ env.RELEASE_STAGE }}'" >> $GITHUB_ENV
|
||||
|
||||
- name: Configure CMake
|
||||
working-directory: ${{github.workspace}}
|
||||
run: |
|
||||
cmake -B ./build ${{ env.CMAKE_PARAM }} ./source
|
||||
|
||||
- name: Build
|
||||
working-directory: ${{github.workspace}}
|
||||
run: |
|
||||
cmake --build ${{github.workspace}}/build --config ${{env.BUILD_TYPE}} --parallel
|
||||
|
||||
- name: Install
|
||||
working-directory: ${{github.workspace}}
|
||||
# Install to the directory defined in CMAKE_INSTALL_PREFIX
|
||||
run: |
|
||||
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/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
|
||||
if [ -d ${{github.workspace}}/install/lib ]; then cp -r ${{github.workspace}}/install/lib/openmohaa/. '${{github.workspace}}/package'; fi
|
||||
|
||||
###
|
||||
# Artifacts
|
||||
###
|
||||
|
||||
- uses: actions/upload-artifact@v4
|
||||
with:
|
||||
name: out-macos-${{matrix.architecture.name}}
|
||||
if-no-files-found: error
|
||||
path:
|
||||
${{github.workspace}}/package
|
||||
@@ -0,0 +1,266 @@
|
||||
##########################
|
||||
#
|
||||
# Microsoft Windows
|
||||
# Windows Server 2025
|
||||
#
|
||||
##########################
|
||||
name: "Windows Builds"
|
||||
|
||||
on:
|
||||
workflow_call:
|
||||
inputs:
|
||||
environment:
|
||||
required: true
|
||||
type: string
|
||||
|
||||
env:
|
||||
# Customize the CMake build type here (Release, Debug, RelWithDebInfo, etc.)
|
||||
BUILD_TYPE: RelWithDebInfo
|
||||
RELEASE_STAGE: ${{ vars.RELEASE_STAGE || 'unstable' }}
|
||||
|
||||
jobs:
|
||||
build:
|
||||
strategy:
|
||||
matrix:
|
||||
architecture: [
|
||||
{name: 'x64', os: 'windows-2025', config: 'x64', toolset: 'x64', arch_option: 'VC-WIN64A' },
|
||||
{name: 'x86', os: 'windows-2025', config: 'Win32', toolset: 'x64_x86', arch_option: 'VC-WIN32' },
|
||||
{name: 'arm64', os: 'windows-11-arm', config: 'ARM64', toolset: 'x64_arm64', arch_option: 'VC-WIN64-ARM' }
|
||||
]
|
||||
|
||||
name: "Building for platform windows-${{matrix.architecture.name}}"
|
||||
runs-on: ${{ matrix.architecture.os }}
|
||||
environment: ${{ inputs.environment }}
|
||||
env:
|
||||
flexbison-branch: 'v2.5.25'
|
||||
wolfssl-version: 'v5.7.6-stable'
|
||||
curl-version: '8_12_1'
|
||||
openal-soft-branch: '1.24.3'
|
||||
|
||||
steps:
|
||||
###
|
||||
# Packages
|
||||
###
|
||||
|
||||
- name: Cache Flex/Bison
|
||||
id: cache-flexbison
|
||||
uses: actions/cache@v4
|
||||
with:
|
||||
path: 'thirdparties/winflexbison-install'
|
||||
key: ${{ runner.os }}-${{ matrix.architecture.name }}-flexbison-${{ env.flexbison-branch }}-v1
|
||||
|
||||
- name: Install Flex/Bison
|
||||
if: steps.cache-flexbison.outputs.cache-hit != 'true'
|
||||
working-directory: ${{github.workspace}}
|
||||
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 --build winflexbison-build --config Release --parallel
|
||||
cmake --install winflexbison-build --config Release
|
||||
|
||||
- name: Settings
|
||||
working-directory: ${{github.workspace}}
|
||||
run: |
|
||||
echo "CMAKE_GENERATOR=Ninja Multi-Config" >> $env:GITHUB_ENV
|
||||
echo "CC=cl.exe" >> $env:GITHUB_ENV
|
||||
echo "CXX=cl.exe" >> $env:GITHUB_ENV
|
||||
pushd "$($env:PROGRAMFILES)\Microsoft Visual Studio\*\*\VC\Auxiliary\Build"
|
||||
cmd /c "vcvarsall.bat ${{ matrix.architecture.toolset }} & set" | ForEach-Object {
|
||||
if ($_ -match "=") {
|
||||
# Split into key=value
|
||||
$var = $_.split("=", 2);
|
||||
echo "$($var[0])=$($var[1])" >> $env:GITHUB_ENV
|
||||
}
|
||||
}
|
||||
popd
|
||||
|
||||
- name: Cache Required Packages
|
||||
id: cache-required-packages
|
||||
uses: actions/cache@v4
|
||||
with:
|
||||
path: 'C:\Packages'
|
||||
key: ${{ runner.os }}-${{ matrix.architecture.name }}-required-packages-v1
|
||||
|
||||
- name: Install required packages
|
||||
if: steps.cache-required-packages.outputs.cache-hit != 'true'
|
||||
run: |
|
||||
$DownloadPath="$($env:USERPROFILE)\Downloads"
|
||||
if ("${{ matrix.architecture.config }}" -ieq "ARM64") {
|
||||
Invoke-WebRequest "https://github.com/ninja-build/ninja/releases/download/v1.12.1/ninja-winarm64.zip" -OutFile "$DownloadPath\ninja-win.zip"
|
||||
} else {
|
||||
Invoke-WebRequest "https://github.com/ninja-build/ninja/releases/download/v1.12.1/ninja-win.zip" -OutFile "$DownloadPath\ninja-win.zip"
|
||||
}
|
||||
Expand-Archive -Path "$DownloadPath\ninja-win.zip" -DestinationPath "C:\Packages\ninja"
|
||||
Invoke-WebRequest "https://download.qt.io/official_releases/jom/jom.zip" -OutFile "$DownloadPath\jom.zip"
|
||||
Expand-Archive -Path "$DownloadPath\jom.zip" -DestinationPath "C:\Packages\jom"
|
||||
|
||||
- name: Setup required packages path
|
||||
run: |
|
||||
$env:PATH += ";C:\Packages\ninja;C:\Packages\jom;"
|
||||
echo "PATH=$($env:PATH)" >> $env:GITHUB_ENV
|
||||
|
||||
###
|
||||
# SDL
|
||||
###
|
||||
|
||||
# Setup SDL
|
||||
- name: Set up SDL
|
||||
id: sdl
|
||||
uses: libsdl-org/setup-sdl@main
|
||||
with:
|
||||
version: 2-latest
|
||||
build-type: Release
|
||||
cmake-arguments: ""
|
||||
|
||||
###
|
||||
# OpenAL
|
||||
###
|
||||
- name: Cache OpenAL
|
||||
id: cache-openal-soft
|
||||
uses: actions/cache@v4
|
||||
with:
|
||||
path: 'thirdparties/soft-oal/install'
|
||||
key: ${{ runner.os }}-${{ matrix.architecture.name }}-openal-soft-${{ env.openal-soft-branch }}-v1
|
||||
|
||||
# soft-oal setup
|
||||
- name: Checkout soft-oal
|
||||
if: steps.cache-openal-soft.outputs.cache-hit != 'true'
|
||||
uses: actions/checkout@v4
|
||||
with:
|
||||
repository: 'kcat/openal-soft'
|
||||
path: 'thirdparties/soft-oal'
|
||||
ref: '${{ env.openal-soft-branch }}'
|
||||
|
||||
# soft-oal build
|
||||
# Statically link the CRT runtime into OAL as a workaround to prevent crashes
|
||||
- name: Configure and install soft-oal
|
||||
if: steps.cache-openal-soft.outputs.cache-hit != 'true'
|
||||
working-directory: ${{github.workspace}}/thirdparties/soft-oal
|
||||
run: |
|
||||
cmake -B ./build `
|
||||
-DCMAKE_INSTALL_PREFIX='${{github.workspace}}/thirdparties/soft-oal/install' `
|
||||
-DALSOFT_BUILD_ROUTER=OFF `
|
||||
-DALSOFT_REQUIRE_WINMM=ON `
|
||||
-DALSOFT_REQUIRE_DSOUND=ON `
|
||||
-DALSOFT_REQUIRE_WASAPI=ON `
|
||||
-DCMAKE_C_FLAGS_RELEASE="/MT /O2 /Ob2 /DNDEBUG" `
|
||||
-DCMAKE_CXX_FLAGS_RELEASE="/MT /O2 /Ob2 /DNDEBUG" `
|
||||
-DCMAKE_C_FLAGS_MINSIZEREL="/MT /O2 /Ob2 /DNDEBUG" `
|
||||
-DCMAKE_CXX_FLAGS_MINSIZEREL="/MT /O1 /Ob1 /DNDEBUG" `
|
||||
-DCMAKE_C_FLAGS_RELWITHDEBINFO="/MT /Zi /O2 /Ob1 /DNDEBUG" `
|
||||
-DCMAKE_CXX_FLAGS_RELWITHDEBINFO="/MT /Zi /O2 /Ob1 /DNDEBUG"
|
||||
cmake --build ./build --config Release --parallel
|
||||
cmake --install ./build --config Release
|
||||
# Unfortunately soft-oal produces a binary called OpenAL32 even in 64-bit
|
||||
if (("x64", "ARM64") -icontains "${{ matrix.architecture.config }}") { Rename-Item -Path '.\install\bin\OpenAL32.dll' -NewName 'OpenAL64.dll' }
|
||||
|
||||
###
|
||||
# cURL
|
||||
#
|
||||
# Uses Schannel as SSL backend, native CAs are used
|
||||
###
|
||||
- name: Cache cURL
|
||||
id: cache-curl
|
||||
uses: actions/cache@v4
|
||||
with:
|
||||
path: 'thirdparties/curl/install'
|
||||
key: ${{ runner.os }}-${{ matrix.architecture.name }}-curl-${{ env.curl-version }}-v1
|
||||
|
||||
# cURL setup
|
||||
- name: Checkout cURL
|
||||
if: steps.cache-curl.outputs.cache-hit != 'true'
|
||||
uses: actions/checkout@v4
|
||||
with:
|
||||
repository: 'curl/curl'
|
||||
path: 'thirdparties/curl'
|
||||
ref: 'curl-${{ env.curl-version }}'
|
||||
|
||||
# cURL build
|
||||
- name: Configure and install curl
|
||||
if: steps.cache-curl.outputs.cache-hit != 'true'
|
||||
working-directory: ${{github.workspace}}/thirdparties/curl
|
||||
run: |
|
||||
cmake -B ./build `
|
||||
-DCMAKE_INSTALL_PREFIX='${{github.workspace}}/thirdparties/curl/install' `
|
||||
-DCURL_USE_LIBPSL=OFF `
|
||||
-DCURL_USE_SCHANNEL=ON
|
||||
cmake --build ./build --config Release --parallel
|
||||
cmake --install ./build --config Release
|
||||
|
||||
###
|
||||
# Project
|
||||
###
|
||||
|
||||
- uses: actions/checkout@v4
|
||||
with:
|
||||
path: 'source'
|
||||
|
||||
- name: CMake Settings
|
||||
run: |
|
||||
echo "CMAKE_PARAM= `
|
||||
--log-level=VERBOSE `
|
||||
-DCMAKE_INSTALL_PREFIX='${{github.workspace}}/install' `
|
||||
-DCMAKE_INTERPROCEDURAL_OPTIMIZATION=true `
|
||||
-DGIT_REVISION_BUILD_NUMBER=${{ github.run_number }} `
|
||||
-DBISON_EXECUTABLE='${{github.workspace}}/thirdparties/winflexbison-install/win_bison.exe' `
|
||||
-DOPENAL_LIBRARY='${{github.workspace}}/thirdparties/soft-oal' `
|
||||
-DOPENAL_INCLUDE_DIR='${{github.workspace}}/thirdparties/soft-oal/install/include' `
|
||||
-DCURL_ROOT='${{github.workspace}}/thirdparties/curl/install' `
|
||||
-DFLEX_EXECUTABLE='${{github.workspace}}/thirdparties/winflexbison-install/win_flex.exe' `
|
||||
-DPRODUCT_VERSION_STAGE='${{ env.RELEASE_STAGE }}'".Replace("`r", "").Replace("`n", "") >> $env:GITHUB_ENV
|
||||
|
||||
- name: Configure CMake
|
||||
working-directory: ${{github.workspace}}
|
||||
run: |
|
||||
cmake -B ./build ${{ env.CMAKE_PARAM }} ./source
|
||||
|
||||
- name: Build
|
||||
working-directory: ${{github.workspace}}
|
||||
run: |
|
||||
cmake --build ${{github.workspace}}/build --config ${{env.BUILD_TYPE}} --parallel
|
||||
|
||||
- name: Install
|
||||
working-directory: ${{github.workspace}}
|
||||
# Install to the directory defined in CMAKE_INSTALL_PREFIX
|
||||
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/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' }
|
||||
if (Test-Path ${{github.workspace}}/install/lib) { Copy-Item '${{github.workspace}}/install/lib/*' -Include '*.dll','*.exe','*.pdb' -Destination '${{github.workspace}}/package' }
|
||||
|
||||
- name: Generate setup files
|
||||
working-directory: ${{github.workspace}}
|
||||
run: |
|
||||
Copy-Item -Path '${{github.workspace}}/package' -Destination 'source/misc/setup/windows/app/files' -Recurse
|
||||
dotnet build -p Platform=${{matrix.architecture.config}} -c Release -o out source/misc/setup/windows/app
|
||||
|
||||
###
|
||||
# Artifact
|
||||
###
|
||||
|
||||
- uses: actions/upload-artifact@v4
|
||||
with:
|
||||
name: out-windows-${{matrix.architecture.name}}
|
||||
if-no-files-found: error
|
||||
path: |
|
||||
${{github.workspace}}/package
|
||||
!${{github.workspace}}/package/**/*.pdb
|
||||
|
||||
- uses: actions/upload-artifact@v4
|
||||
with:
|
||||
name: out-windows-${{matrix.architecture.name}}-pdb
|
||||
if-no-files-found: error
|
||||
path: |
|
||||
${{github.workspace}}/package
|
||||
|
||||
- uses: actions/upload-artifact@v4
|
||||
with:
|
||||
name: out-windows-${{matrix.architecture.name}}-installer
|
||||
if-no-files-found: error
|
||||
path: |
|
||||
${{github.workspace}}/out/en-us/Setup.msi
|
||||
${{github.workspace}}/out/en-us/Setup.wixpdb
|
||||
@@ -7,468 +7,18 @@ on:
|
||||
required: true
|
||||
type: string
|
||||
|
||||
env:
|
||||
# Customize the CMake build type here (Release, Debug, RelWithDebInfo, etc.)
|
||||
BUILD_TYPE: RelWithDebInfo
|
||||
RELEASE_STAGE: ${{ vars.RELEASE_STAGE || 'unstable' }}
|
||||
|
||||
jobs:
|
||||
##########################
|
||||
#
|
||||
# Linux
|
||||
# Ubuntu 22.04
|
||||
#
|
||||
# Using this version instead of 24.04 to use a lower GLIBC version (2.34)
|
||||
##########################
|
||||
build-platform-linux:
|
||||
strategy:
|
||||
matrix:
|
||||
architecture: [
|
||||
{name: 'amd64', triple: 'x86_64-linux-gnu'},
|
||||
{name: 'i686', triple: 'i686-linux-gnu'},
|
||||
{name: 'arm64', triple: 'aarch64-linux-gnu'},
|
||||
{name: 'armhf', triple: 'arm-linux-gnueabihf'},
|
||||
{name: 'powerpc', triple: 'powerpc-linux-gnu'},
|
||||
{name: 'ppc64', triple: 'powerpc64-linux-gnu'},
|
||||
{name: 'ppc64el', triple: 'powerpc64le-linux-gnu'}
|
||||
]
|
||||
uses: ./.github/workflows/shared-build-linux.yml
|
||||
with:
|
||||
environment: ${{inputs.environment}}
|
||||
|
||||
name: "Building for platform linux-${{matrix.architecture.name}}"
|
||||
runs-on: "ubuntu-22.04"
|
||||
environment: ${{ inputs.environment }}
|
||||
|
||||
steps:
|
||||
###
|
||||
# Packages
|
||||
###
|
||||
|
||||
- uses: awalsh128/cache-apt-pkgs-action@latest
|
||||
name: Install required packages
|
||||
with:
|
||||
packages: flex bison ninja-build cmake clang libpulse-dev portaudio19-dev libasound2-dev libjack-dev libpipewire-0.3-dev qtbase5-dev libdbus-1-dev
|
||||
version: "0.1"
|
||||
|
||||
- uses: awalsh128/cache-apt-pkgs-action@latest
|
||||
name: Install required cross-platform packages (${{ matrix.architecture.triple }})
|
||||
if: matrix.architecture.name != 'amd64'
|
||||
with:
|
||||
packages: gcc-12-${{ matrix.architecture.triple }} g++-12-${{ matrix.architecture.triple }}
|
||||
version: "0.1"
|
||||
|
||||
- name: Settings
|
||||
working-directory: ${{github.workspace}}
|
||||
run: |
|
||||
echo "CMAKE_GENERATOR=Ninja Multi-Config" >> $GITHUB_ENV
|
||||
echo "CC=clang" >> $GITHUB_ENV
|
||||
echo "CXX=clang++" >> $GITHUB_ENV
|
||||
echo "CFLAGS='--target=${{ matrix.architecture.triple }}'" >> $GITHUB_ENV
|
||||
echo "CXXFLAGS='--target=${{ matrix.architecture.triple }}'" >> $GITHUB_ENV
|
||||
|
||||
###
|
||||
# SDL
|
||||
###
|
||||
|
||||
# Setup SDL
|
||||
- name: Set up SDL
|
||||
id: sdl
|
||||
uses: libsdl-org/setup-sdl@main
|
||||
with:
|
||||
version: 2-latest
|
||||
build-type: Release
|
||||
# Workaround for when changing the runner OS version
|
||||
cmake-arguments: "-DCACHE_OS_VERSION=Ubuntu_22.04"
|
||||
|
||||
###
|
||||
# OpenAL
|
||||
###
|
||||
|
||||
# soft-oal setup
|
||||
- name: Checkout soft-oal
|
||||
uses: actions/checkout@v4
|
||||
with:
|
||||
repository: 'kcat/openal-soft'
|
||||
path: 'thirdparties/soft-oal'
|
||||
ref: '1.24.1'
|
||||
|
||||
- name: Configure and install soft-oal
|
||||
working-directory: ${{github.workspace}}/thirdparties/soft-oal
|
||||
run: |
|
||||
cmake -B ./build \
|
||||
-DCMAKE_INSTALL_PREFIX='${{github.workspace}}/thirdparties/soft-oal/install'
|
||||
cmake --build ./build --config Release --parallel
|
||||
cmake --install ./build --config Release
|
||||
|
||||
###
|
||||
# Project
|
||||
###
|
||||
|
||||
- uses: actions/checkout@v4
|
||||
with:
|
||||
path: 'source'
|
||||
|
||||
- name: CMake Settings
|
||||
run: |
|
||||
echo "CMAKE_PARAM=--log-level=VERBOSE \
|
||||
-DCMAKE_INSTALL_PREFIX='${{github.workspace}}/install' \
|
||||
-DOPENAL_LIBRARY='${{github.workspace}}/thirdparties/soft-oal' \
|
||||
-DOPENAL_INCLUDE_DIR='${{github.workspace}}/thirdparties/soft-oal/include' \
|
||||
-DGIT_REVISION_BUILD_NUMBER=${{ github.run_number }} \
|
||||
-DPRODUCT_VERSION_STAGE='${{ env.RELEASE_STAGE }}'" >> $GITHUB_ENV
|
||||
|
||||
- name: Configure CMake
|
||||
working-directory: ${{github.workspace}}
|
||||
run: |
|
||||
cmake -B ./build ${{ env.CMAKE_PARAM }} ./source
|
||||
|
||||
- name: Build
|
||||
working-directory: ${{github.workspace}}
|
||||
run: |
|
||||
cmake --build ${{github.workspace}}/build --config ${{env.BUILD_TYPE}} --parallel
|
||||
|
||||
- name: Test
|
||||
working-directory: ${{github.workspace}}
|
||||
# Execute tests defined by the CMake configuration.
|
||||
# See https://cmake.org/cmake/help/latest/manual/ctest.1.html for more detail
|
||||
run: |
|
||||
cd "${{github.workspace}}/build"
|
||||
ctest -C ${{env.BUILD_TYPE}}
|
||||
|
||||
- name: Install
|
||||
working-directory: ${{github.workspace}}
|
||||
# Install to the directory defined in CMAKE_INSTALL_PREFIX
|
||||
run: |
|
||||
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/soft-oal/install/lib/libopenal.so.1 '${{github.workspace}}/package/'
|
||||
if [ -d ${{github.workspace}}/install/bin ]; then cp -r ${{github.workspace}}/install/bin/openmohaa/. '${{github.workspace}}/package'; fi
|
||||
if [ -d ${{github.workspace}}/install/lib ]; then cp -r ${{github.workspace}}/install/lib/openmohaa/. '${{github.workspace}}/package'; fi
|
||||
|
||||
###
|
||||
# Artifacts
|
||||
###
|
||||
|
||||
- uses: actions/upload-artifact@v4
|
||||
with:
|
||||
name: out-linux-${{matrix.architecture.name}}
|
||||
if-no-files-found: error
|
||||
path:
|
||||
${{github.workspace}}/package
|
||||
|
||||
##########################
|
||||
#
|
||||
# Microsoft Windows
|
||||
# Windows Server 2022
|
||||
#
|
||||
##########################
|
||||
build-platform-windows:
|
||||
strategy:
|
||||
matrix:
|
||||
architecture: [
|
||||
{name: 'x64', config: 'x64', toolset: 'x64' },
|
||||
{name: 'x86', config: 'Win32', toolset: 'x64_x86' },
|
||||
{name: 'arm64', config: 'ARM64', toolset: 'x64_arm64' }
|
||||
]
|
||||
uses: ./.github/workflows/shared-build-windows.yml
|
||||
with:
|
||||
environment: ${{inputs.environment}}
|
||||
|
||||
name: "Building for platform windows-${{matrix.architecture.name}}"
|
||||
runs-on: "windows-2022"
|
||||
environment: ${{ inputs.environment }}
|
||||
|
||||
steps:
|
||||
###
|
||||
# Packages
|
||||
###
|
||||
|
||||
#
|
||||
# Commented out for now, chocolatey servers started complaining about too many requests
|
||||
#
|
||||
#- name: Install required packages
|
||||
# run: |
|
||||
# choco install -y ninja
|
||||
|
||||
- name: Install required packages
|
||||
run: |
|
||||
$DownloadPath="$($env:USERPROFILE)\Downloads"
|
||||
Invoke-WebRequest "https://github.com/ninja-build/ninja/releases/download/v1.12.1/ninja-win.zip" -OutFile "$DownloadPath\ninja-win.zip"
|
||||
Expand-Archive -Path "$DownloadPath\ninja-win.zip" -DestinationPath "$($env:PROGRAMFILES)\ninja"
|
||||
echo "$($env:PROGRAMFILES)\ninja" >> $GITHUB_PATH
|
||||
|
||||
- name: Install Flex/Bison
|
||||
working-directory: ${{github.workspace}}
|
||||
run: |
|
||||
mkdir thirdparties && cd thirdparties
|
||||
git clone --depth 1 --single-branch --branch v2.5.25 https://github.com/lexxmark/winflexbison.git
|
||||
cmake -B winflexbison-build -DCMAKE_INSTALL_PREFIX='${{github.workspace}}/thirdparties/winflexbison-install' ./winflexbison
|
||||
cmake --build winflexbison-build --config Release --parallel
|
||||
cmake --install winflexbison-build --config Release
|
||||
|
||||
- name: Settings
|
||||
working-directory: ${{github.workspace}}
|
||||
run: |
|
||||
echo "CMAKE_GENERATOR=Ninja Multi-Config" >> $env:GITHUB_ENV
|
||||
echo "CC=cl.exe" >> $env:GITHUB_ENV
|
||||
echo "CXX=cl.exe" >> $env:GITHUB_ENV
|
||||
pushd "$($env:PROGRAMFILES)\Microsoft Visual Studio\*\*\VC\Auxiliary\Build"
|
||||
cmd /c "vcvarsall.bat ${{ matrix.architecture.toolset }} & set" | ForEach-Object {
|
||||
if ($_ -match "=") {
|
||||
# Split into key=value
|
||||
$var = $_.split("=", 2);
|
||||
echo "$($var[0])=$($var[1])" >> $env:GITHUB_ENV
|
||||
}
|
||||
}
|
||||
popd
|
||||
|
||||
###
|
||||
# SDL
|
||||
###
|
||||
|
||||
# Setup SDL
|
||||
- name: Set up SDL
|
||||
id: sdl
|
||||
uses: libsdl-org/setup-sdl@main
|
||||
with:
|
||||
version: 2-latest
|
||||
build-type: Release
|
||||
cmake-arguments: ""
|
||||
|
||||
###
|
||||
# OpenAL
|
||||
###
|
||||
|
||||
# soft-oal setup
|
||||
- name: Checkout soft-oal
|
||||
uses: actions/checkout@v4
|
||||
with:
|
||||
repository: 'kcat/openal-soft'
|
||||
path: 'thirdparties/soft-oal'
|
||||
ref: '1.24.1'
|
||||
|
||||
# soft-oal build
|
||||
# Statically link the CRT runtime into OAL as a workaround to prevent crashes
|
||||
- name: Configure and install soft-oal
|
||||
working-directory: ${{github.workspace}}/thirdparties/soft-oal
|
||||
run: |
|
||||
cmake -B ./build `
|
||||
-DCMAKE_INSTALL_PREFIX='${{github.workspace}}/thirdparties/soft-oal/install' `
|
||||
-DALSOFT_BUILD_ROUTER=OFF `
|
||||
-DALSOFT_REQUIRE_WINMM=ON `
|
||||
-DALSOFT_REQUIRE_DSOUND=ON `
|
||||
-DALSOFT_REQUIRE_WASAPI=ON `
|
||||
-DCMAKE_C_FLAGS_RELEASE="/MT /O2 /Ob2 /DNDEBUG" `
|
||||
-DCMAKE_CXX_FLAGS_RELEASE="/MT /O2 /Ob2 /DNDEBUG" `
|
||||
-DCMAKE_C_FLAGS_MINSIZEREL="/MT /O2 /Ob2 /DNDEBUG" `
|
||||
-DCMAKE_CXX_FLAGS_MINSIZEREL="/MT /O1 /Ob1 /DNDEBUG" `
|
||||
-DCMAKE_C_FLAGS_RELWITHDEBINFO="/MT /Zi /O2 /Ob1 /DNDEBUG" `
|
||||
-DCMAKE_CXX_FLAGS_RELWITHDEBINFO="/MT /Zi /O2 /Ob1 /DNDEBUG"
|
||||
cmake --build ./build --config Release --parallel
|
||||
cmake --install ./build --config Release
|
||||
# Unfortunately soft-oal produces a binary called OpenAL32 even in 64-bit
|
||||
if (("x64", "ARM64") -icontains "${{ matrix.architecture.config }}") { Rename-Item -Path '.\install\bin\OpenAL32.dll' -NewName 'OpenAL64.dll' }
|
||||
|
||||
###
|
||||
# Project
|
||||
###
|
||||
|
||||
- uses: actions/checkout@v4
|
||||
with:
|
||||
path: 'source'
|
||||
|
||||
- name: CMake Settings
|
||||
run: |
|
||||
echo "CMAKE_PARAM= `
|
||||
--log-level=VERBOSE `
|
||||
-DCMAKE_INSTALL_PREFIX='${{github.workspace}}/install' `
|
||||
-DGIT_REVISION_BUILD_NUMBER=${{ github.run_number }} `
|
||||
-DBISON_EXECUTABLE='${{github.workspace}}/thirdparties/winflexbison-install/win_bison.exe' `
|
||||
-DOPENAL_LIBRARY='${{github.workspace}}/thirdparties/soft-oal' `
|
||||
-DOPENAL_INCLUDE_DIR='${{github.workspace}}/thirdparties/soft-oal/include' `
|
||||
-DFLEX_EXECUTABLE='${{github.workspace}}/thirdparties/winflexbison-install/win_flex.exe' `
|
||||
-DPRODUCT_VERSION_STAGE='${{ env.RELEASE_STAGE }}'".Replace("`r", "").Replace("`n", "") >> $env:GITHUB_ENV
|
||||
|
||||
- name: Configure CMake
|
||||
working-directory: ${{github.workspace}}
|
||||
run: |
|
||||
cmake -B ./build ${{ env.CMAKE_PARAM }} ./source
|
||||
|
||||
- name: Build
|
||||
working-directory: ${{github.workspace}}
|
||||
run: |
|
||||
cmake --build ${{github.workspace}}/build --config ${{env.BUILD_TYPE}} --parallel
|
||||
|
||||
- name: Test
|
||||
working-directory: ${{github.workspace}}
|
||||
# Execute tests defined by the CMake configuration.
|
||||
# See https://cmake.org/cmake/help/latest/manual/ctest.1.html for more detail
|
||||
run: |
|
||||
cd "${{github.workspace}}/build"
|
||||
ctest -C ${{env.BUILD_TYPE}}
|
||||
|
||||
- name: Install
|
||||
working-directory: ${{github.workspace}}
|
||||
# Install to the directory defined in CMAKE_INSTALL_PREFIX
|
||||
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/soft-oal/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' }
|
||||
if (Test-Path ${{github.workspace}}/install/lib) { Copy-Item '${{github.workspace}}/install/lib/*' -Include '*.dll','*.exe','*.pdb' -Destination '${{github.workspace}}/package' }
|
||||
|
||||
###
|
||||
# Artifact
|
||||
###
|
||||
|
||||
- uses: actions/upload-artifact@v4
|
||||
with:
|
||||
name: out-windows-${{matrix.architecture.name}}
|
||||
if-no-files-found: error
|
||||
path: |
|
||||
${{github.workspace}}/package
|
||||
!${{github.workspace}}/package/**/*.pdb
|
||||
|
||||
- uses: actions/upload-artifact@v4
|
||||
with:
|
||||
name: out-windows-${{matrix.architecture.name}}-pdb
|
||||
if-no-files-found: error
|
||||
path: |
|
||||
${{github.workspace}}/package
|
||||
|
||||
##########################
|
||||
#
|
||||
# Apple macOS
|
||||
# macOS 14
|
||||
#
|
||||
# This version is used as the OS, as older versions are slower.
|
||||
##########################
|
||||
build-platform-macos:
|
||||
strategy:
|
||||
matrix:
|
||||
architecture: [
|
||||
#{name: 'x86_64', triple: 'x86_64-apple-macos10.8'},
|
||||
#{name: 'arm64', triple: 'arm64-apple-macos11'}
|
||||
#{name: 'x86_64', build_name: 'x86_64'},
|
||||
#{name: 'arm64', build_name: 'arm64'},
|
||||
# Compile into an universal binary
|
||||
{name: 'multiarch(arm64-x86_64)', build_name: 'arm64;x86_64' }
|
||||
]
|
||||
|
||||
name: "Building for platform macos-${{matrix.architecture.name}}"
|
||||
runs-on: "macos-15"
|
||||
environment: ${{inputs.environment}}
|
||||
|
||||
steps:
|
||||
###
|
||||
# Packages
|
||||
###
|
||||
|
||||
# Install required packages
|
||||
# Paths on x86_64 and ARM64 are different for homebrew
|
||||
- name: Install required packages
|
||||
run: |
|
||||
brew update && brew install git flex bison ninja cmake llvm ninja
|
||||
|
||||
- name: Settings
|
||||
working-directory: ${{github.workspace}}
|
||||
run: |
|
||||
echo "CMAKE_GENERATOR=Ninja Multi-Config" >> $GITHUB_ENV
|
||||
echo "CC=clang" >> $GITHUB_ENV
|
||||
echo "CXX=clang++" >> $GITHUB_ENV
|
||||
echo "MACOSX_DEPLOYMENT_TARGET=10.15" >> $GITHUB_ENV
|
||||
|
||||
###
|
||||
# SDL
|
||||
###
|
||||
|
||||
# Setup SDL
|
||||
- name: Set up SDL
|
||||
id: sdl
|
||||
uses: libsdl-org/setup-sdl@main
|
||||
with:
|
||||
version: 2-latest
|
||||
build-type: Release
|
||||
cmake-arguments: "-DCMAKE_OSX_ARCHITECTURES='${{ matrix.architecture.build_name }}'
|
||||
-DCMAKE_VERBOSE_MAKEFILE=on"
|
||||
###
|
||||
# OpenAL
|
||||
###
|
||||
|
||||
# soft-oal setup
|
||||
# Use GCC instead of Clang because of missing SSE intrinsics
|
||||
# It also doesn't enable altivec support on PowerPC by default
|
||||
- name: Checkout soft-oal
|
||||
uses: actions/checkout@v4
|
||||
with:
|
||||
repository: 'kcat/openal-soft'
|
||||
path: 'thirdparties/soft-oal'
|
||||
ref: '1.24.1'
|
||||
|
||||
- name: Configure and install soft-oal
|
||||
working-directory: ${{github.workspace}}/thirdparties/soft-oal
|
||||
run: |
|
||||
cmake -B ./build \
|
||||
-DCMAKE_INSTALL_PREFIX='${{github.workspace}}/thirdparties/soft-oal/install' \
|
||||
-DCMAKE_OSX_ARCHITECTURES='${{ matrix.architecture.build_name }}' \
|
||||
-DCMAKE_VERBOSE_MAKEFILE=on
|
||||
cmake --build ./build --config Release --parallel
|
||||
cmake --install ./build --config Release
|
||||
|
||||
###
|
||||
# Project
|
||||
###
|
||||
|
||||
- uses: actions/checkout@v4
|
||||
with:
|
||||
path: 'source'
|
||||
|
||||
- name: CMake Settings
|
||||
run: |
|
||||
echo "CMAKE_PARAM=--log-level=VERBOSE \
|
||||
-DCMAKE_INSTALL_PREFIX='${{github.workspace}}/install' \
|
||||
-DCMAKE_VERBOSE_MAKEFILE=on \
|
||||
-DCMAKE_OSX_ARCHITECTURES='${{ matrix.architecture.build_name }}' \
|
||||
-DOPENAL_LIBRARY='${{github.workspace}}/thirdparties/soft-oal/install' \
|
||||
-DOPENAL_INCLUDE_DIR='${{github.workspace}}/thirdparties/soft-oal/install/include/AL' \
|
||||
-DGIT_REVISION_BUILD_NUMBER=${{ github.run_number }} \
|
||||
-DPRODUCT_VERSION_STAGE='${{ env.RELEASE_STAGE }}'" >> $GITHUB_ENV
|
||||
|
||||
- name: Configure CMake
|
||||
working-directory: ${{github.workspace}}
|
||||
run: |
|
||||
cmake -B ./build ${{ env.CMAKE_PARAM }} ./source
|
||||
|
||||
- name: Build
|
||||
working-directory: ${{github.workspace}}
|
||||
run: |
|
||||
cmake --build ${{github.workspace}}/build --config ${{env.BUILD_TYPE}} --parallel
|
||||
|
||||
- name: Test
|
||||
working-directory: ${{github.workspace}}
|
||||
# Execute tests defined by the CMake configuration.
|
||||
# See https://cmake.org/cmake/help/latest/manual/ctest.1.html for more detail
|
||||
run: |
|
||||
cd "${{github.workspace}}/build"
|
||||
ctest -C ${{env.BUILD_TYPE}}
|
||||
|
||||
- name: Install
|
||||
working-directory: ${{github.workspace}}
|
||||
# Install to the directory defined in CMAKE_INSTALL_PREFIX
|
||||
run: |
|
||||
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/soft-oal/install/lib/libopenal.1.dylib '${{github.workspace}}/package/'
|
||||
if [ -d ${{github.workspace}}/install/bin ]; then cp -r ${{github.workspace}}/install/bin/openmohaa/. '${{github.workspace}}/package'; fi
|
||||
if [ -d ${{github.workspace}}/install/lib ]; then cp -r ${{github.workspace}}/install/lib/openmohaa/. '${{github.workspace}}/package'; fi
|
||||
|
||||
###
|
||||
# Artifacts
|
||||
###
|
||||
|
||||
- uses: actions/upload-artifact@v4
|
||||
with:
|
||||
name: out-macos-${{matrix.architecture.name}}
|
||||
if-no-files-found: error
|
||||
path:
|
||||
${{github.workspace}}/package
|
||||
uses: ./.github/workflows/shared-build-macos.yml
|
||||
with:
|
||||
environment: ${{inputs.environment}}
|
||||
@@ -1,4 +1,4 @@
|
||||
name: Publish artifacts
|
||||
name: "Publish Release"
|
||||
|
||||
on:
|
||||
push:
|
||||
@@ -18,11 +18,22 @@ jobs:
|
||||
with:
|
||||
environment: "release"
|
||||
|
||||
deploy_all:
|
||||
# Initially create a release with 1 job
|
||||
# so multiple files can be uploaded at the same time afterwards
|
||||
create-release:
|
||||
runs-on: ubuntu-24.04
|
||||
environment: 'release'
|
||||
needs: [build-all]
|
||||
|
||||
steps:
|
||||
- name: Release
|
||||
uses: softprops/action-gh-release@v2.3.2
|
||||
with:
|
||||
name: '${{github.ref_name}}-${{env.RELEASE_STAGE}}'
|
||||
prerelease: ${{env.RELEASE_IS_PRERELEASE}}
|
||||
|
||||
deploy-all:
|
||||
strategy:
|
||||
# Set the maximum number of parallel jobs to 1, to avoid a race-condition
|
||||
# while creating a new release
|
||||
max-parallel: 1
|
||||
matrix:
|
||||
target_os: [
|
||||
'linux-amd64',
|
||||
@@ -40,12 +51,12 @@ jobs:
|
||||
'windows-arm64-pdb',
|
||||
#'macos-x86_64',
|
||||
#'macos-arm64',
|
||||
'macos-multiarch(arm64-x86_64)',
|
||||
'macos-multiarch-arm64-x86_64',
|
||||
]
|
||||
|
||||
runs-on: ubuntu-24.04
|
||||
environment: "release"
|
||||
needs: [build-all]
|
||||
environment: 'release'
|
||||
needs: [create-release]
|
||||
|
||||
env:
|
||||
RELEASE_NAME: ${{ github.event.repository.name }}-${{github.ref_name}}-${{matrix.target_os}}
|
||||
@@ -61,8 +72,38 @@ jobs:
|
||||
run: zip -r "../${{ env.RELEASE_NAME }}.zip" ./
|
||||
|
||||
- name: Release
|
||||
uses: softprops/action-gh-release@v2
|
||||
uses: softprops/action-gh-release@v2.3.2
|
||||
with:
|
||||
name: '${{github.ref_name}}-${{env.RELEASE_STAGE}}'
|
||||
prerelease: ${{env.RELEASE_IS_PRERELEASE}}
|
||||
files: ${{github.workspace}}/${{ env.RELEASE_NAME }}.zip
|
||||
|
||||
deploy_installer_windows:
|
||||
strategy:
|
||||
matrix:
|
||||
target_os: [
|
||||
'windows-x64',
|
||||
'windows-x86',
|
||||
'windows-arm64',
|
||||
]
|
||||
|
||||
runs-on: ubuntu-24.04
|
||||
environment: "release"
|
||||
needs: [create-release]
|
||||
|
||||
env:
|
||||
RELEASE_NAME: ${{ github.event.repository.name }}-${{github.ref_name}}-${{matrix.target_os}}
|
||||
|
||||
steps:
|
||||
- uses: actions/download-artifact@v4
|
||||
with:
|
||||
name: 'out-${{matrix.target_os}}-installer'
|
||||
path: ${{github.workspace}}/${{matrix.target_os}}
|
||||
|
||||
- name: Setup
|
||||
working-directory: '${{github.workspace}}/${{matrix.target_os}}'
|
||||
run:
|
||||
cp Setup.msi ../${{ env.RELEASE_NAME }}.msi
|
||||
|
||||
- name: Release
|
||||
uses: softprops/action-gh-release@v2.3.2
|
||||
with:
|
||||
files: ${{github.workspace}}/${{ env.RELEASE_NAME }}.msi
|
||||
@@ -0,0 +1,53 @@
|
||||
name: "Unit Tests"
|
||||
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- '**'
|
||||
pull_request:
|
||||
|
||||
concurrency:
|
||||
group: ${{ github.workflow }}-${{ github.ref }}
|
||||
cancel-in-progress: true
|
||||
|
||||
jobs:
|
||||
build:
|
||||
name: "Running unit tests"
|
||||
runs-on: ubuntu-latest
|
||||
environment: "testing"
|
||||
|
||||
steps:
|
||||
- uses: awalsh128/cache-apt-pkgs-action@latest
|
||||
name: Install required packages
|
||||
with:
|
||||
packages: flex bison ninja-build cmake clang libsdl2-dev libopenal-dev
|
||||
version: "${{ runner.os }}-${{ runner.arch }}-unittest-v1"
|
||||
|
||||
- uses: actions/checkout@v4
|
||||
with:
|
||||
path: 'source'
|
||||
|
||||
- name: Settings
|
||||
working-directory: ${{github.workspace}}
|
||||
run: |
|
||||
echo "CMAKE_GENERATOR=Ninja Multi-Config" >> $GITHUB_ENV
|
||||
echo "CC=clang" >> $GITHUB_ENV
|
||||
echo "CXX=clang++" >> $GITHUB_ENV
|
||||
echo "CMAKE_PARAM=--log-level=VERBOSE \
|
||||
-DCMAKE_INSTALL_PREFIX='${{github.workspace}}/install'" >> $GITHUB_ENV
|
||||
|
||||
- name: Configure CMake
|
||||
working-directory: ${{github.workspace}}
|
||||
run: |
|
||||
cmake -B ./build ${{ env.CMAKE_PARAM }} ./source
|
||||
|
||||
- name: Build
|
||||
working-directory: ${{github.workspace}}
|
||||
run: |
|
||||
cmake --build ${{github.workspace}}/build --config Debug --parallel
|
||||
|
||||
- name: Test
|
||||
working-directory: ${{github.workspace}}
|
||||
run: |
|
||||
cd "${{github.workspace}}/build"
|
||||
ctest -C Debug --output-on-failure
|
||||
+3
-25
@@ -15,7 +15,6 @@ 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)
|
||||
option(TARGET_LOCAL_SYSTEM "Indicate that the project will be compiled and installed for the local system" OFF)
|
||||
|
||||
if(TARGET_GAME_TYPE)
|
||||
message(SEND_ERROR "TARGET_GAME_TYPE is now unsupported, it is now done at runtime.")
|
||||
@@ -64,27 +63,9 @@ if(DEBUG_MEMORY)
|
||||
add_definitions(-D_DEBUG_MEM)
|
||||
endif()
|
||||
|
||||
if("${TARGET_ARCH}" STREQUAL "i386")
|
||||
set(TARGET_ARCH_SUFFIX "x86")
|
||||
else()
|
||||
set(TARGET_ARCH_SUFFIX ${TARGET_ARCH})
|
||||
endif()
|
||||
|
||||
message(STATUS "Architecture detected: ${TARGET_ARCH}")
|
||||
|
||||
if(TARGET_LOCAL_SYSTEM)
|
||||
add_definitions(-DTARGET_LOCAL_SYSTEM)
|
||||
# As it targets the local system, no need to know about the architecture used
|
||||
set(TARGET_BIN_SUFFIX "")
|
||||
message(STATUS "Binary suffix will not be used as the local system is the target")
|
||||
elseif(${TARGET_ARCH_COUNT} GREATER 1)
|
||||
add_definitions(-DTARGET_MULTIPLE_ARCHITECTURES)
|
||||
set(TARGET_BIN_SUFFIX ".multiarch")
|
||||
message(STATUS "Multiple architectures were specified, suffix set to 'multiarch'.")
|
||||
else()
|
||||
set(TARGET_BIN_SUFFIX ".${TARGET_ARCH}")
|
||||
message(STATUS "Binary suffix set to '${TARGET_ARCH_SUFFIX}'.")
|
||||
endif()
|
||||
set(TARGET_BIN_SUFFIX "")
|
||||
|
||||
if(WIN32)
|
||||
set(TARGET_PLATFORM_PREFIX "")
|
||||
@@ -144,6 +125,8 @@ endif()
|
||||
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
|
||||
@@ -220,11 +203,6 @@ if (NOT BUILD_NO_CLIENT)
|
||||
endif()
|
||||
|
||||
if(UNIX AND NOT APPLE)
|
||||
#
|
||||
# Desktop entries installation on Unix
|
||||
#
|
||||
set(TARGET_ARCH ${TARGET_BIN_SUFFIX})
|
||||
|
||||
# Configure the .desktop entries with the arch suffix
|
||||
configure_file(
|
||||
misc/linux/org.openmoh.openmohaa.desktop.in
|
||||
|
||||
@@ -8,87 +8,101 @@
|
||||
|
||||

|
||||
|
||||
## Intro
|
||||
## What is OpenMoHAA?
|
||||
|
||||
The main goal of OpenMoHAA is to ensure the future and continuity of **Medal of Honor: Allied Assault** (including Spearhead and Breakthrough expansions) on all platforms/architectures by providing new patches/features. Thanks to the ioquake3 project and the F.A.K.K SDK, OpenMoHAA has already reached more than half of its goal: an open-source version of MoH:AA (based on version 2.40) that is fully compatible with both the original game and expansions, in terms of network protocol, assets, and scripts. OpenMoHAA is compatible with both MOH:AA servers and clients (Spearhead and Breakthrough included).
|
||||
OpenMoHAA is an open-source project aimed at preserving and enhancing **Medal of Honor: Allied Assault** (including Spearhead and Breakthrough expansions) by providing more features and bugfixes, across modern platforms and architectures.
|
||||
|
||||
Powered by [ioquake3](https://github.com/ioquake/ioq3) and the [F.A.K.K SDK](https://code.idtech.space/ritual/fakk2-sdk), OpenMoHAA provides:
|
||||
- Full compatibility with the original game: assets, scripts and multiplayer
|
||||
- Better support for modern systems
|
||||
- Cross-platform support (Linux, Windows, macOS)
|
||||
- Support for both single-player and multiplayer modes
|
||||
- Includes all fixes from Spearhead 2.15 and Breakthrough 2.40b
|
||||
- More fixes and features, such as bots and a ban system
|
||||
|
||||
*OpenMoHAA is an independent project and is not affiliated with or endorsed by Electronic Arts.*
|
||||
|
||||
## Getting started
|
||||
|
||||
- [Downloading and installing OpenMoHAA](docs/getting_started_installation.md)
|
||||
- [Running OpenMoHAA and using expansion assets](docs/getting_started_running.md)
|
||||
- [Dedicated server configuration](docs/configuration/server.md)
|
||||
- 📦 [Installing OpenMoHAA](docs/markdown/01-intro/01-installation.md)
|
||||
- ▶️ [How to play: Launching the game, expansions & file locations](docs/markdown/02-running/01-running.md)
|
||||
- ❓ [FAQ & Troubleshooting](docs/markdown/02-running/03-faq.md)
|
||||
- 🌐 [Setting up a game server](docs/markdown/02-running/02-running-server.md)
|
||||
|
||||
## Reporting Issues
|
||||
|
||||
> [!NOTE]
|
||||
> OpenMoHAA hasn't hit version 1.0.0 yet. Think of it like a beta build from the golden age of LAN parties. Features are being added, bugs are getting squashed, and more things are being tweaked. Things might change, break, or get even better over time.
|
||||
>
|
||||
> If that sounds like your kind of mission, gear up, frag some bots, and help level up OpenMoHAA!
|
||||
|
||||
If you encounter a bug or a problem, you can do one of the following:
|
||||
- Submit an [issue](https://github.com/openmoh/openmohaa/issues) on GitHub (use the template).
|
||||
- Join the [OpenMoHAA Discord](https://discord.gg/NYtH58R) for a quick help.
|
||||
|
||||
## Additional documentation
|
||||
|
||||
- 📖 [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)
|
||||
|
||||
## Current state
|
||||
|
||||
- 🧰 [Feature list](docs/markdown/01-intro/04-features.md)
|
||||
|
||||
### Single-player
|
||||
|
||||
The entire single-player campaign should work (Allied Assault, Spearhead and Breakthrough). If you encounter any bug, please create a new [GitHub issue](https://github.com/openmoh/openmohaa/issues) describing them.
|
||||
|
||||
### Multiplayer
|
||||
|
||||
The Multiplayer part is almost fully stable, all game modes including `Tug-of-War` from Medal of Honor: Spearhead, and `Liberation` from Medal of Honor: Breakthrough are implemented and are working as intended. Mods like `Freeze-Tag` are working as well.
|
||||
- Almost fully stable
|
||||
- All official game modes are supported, including those from Spearhead and Breakthrough:
|
||||
- Free-For-All
|
||||
- Team-Deathmatch
|
||||
- Round-based match
|
||||
- Objective match
|
||||
- Tug-of-War (Spearhead)
|
||||
- Liberation (Breakthrough)
|
||||
- Popular mods like **Freeze-Tag** are supported
|
||||
- Built-in bots for offline practice and for testing
|
||||
- 🔧 [Setting up bots](docs/markdown/02-running/01-running.md#Playing-with-bots)
|
||||
|
||||
OpenMoHAA can be used to [host](docs/getting_started_installation.md#server) a mohaa/mohaas/mohaab server and players can use OpenMoHAA to [play](docs/getting_started_installation.md#client) on any server. If some bugs/strange behavior occurs, the best way to report them is by [creating a new issue](https://github.com/openmoh/openmohaa/issues) on the [OpenMoHAA GitHub](https://github.com/openmoh/openmohaa) project with the steps to reproduce (with eventually the problematic mods).
|
||||
|
||||
One of the big multiplayer features are bots. They were introduced for testing and for entertainment purposes so players can have fun alone. See [Configuring bots](docs/configuration/server.md#bots) in the dedicated server configuration documentation to set them up.
|
||||
|
||||
## Features
|
||||
|
||||
- [List of new features](docs/features.md)
|
||||
- [Scripting commands](https://htmlpreview.github.io/?https://github.com/openmoh/openmohaa/blob/main/docs/features_g_allclasses.html)
|
||||
|
||||
## Compiling
|
||||
|
||||
- See [Compiling OpenMoHAA](docs/compiling.md)
|
||||
You can host your own [OpenMoHAA server](docs/markdown/02-running/02-running-server.md#) or join others using OpenMoHAA.
|
||||
|
||||
## Screenshots
|
||||
|
||||
| | |
|
||||
|-----------------------------------------------------------------------------------|----------------------------------------------------------------------------|
|
||||
|  |  |
|
||||
|  |  |
|
||||
|  |  |
|
||||
|  |  |
|
||||
|  |  |
|
||||
|  |  |
|
||||
|
||||
*More screenshots [here](docs/images)*
|
||||
*More screenshots [here](docs/assets/images)*
|
||||
|
||||
## Third party
|
||||
## Development & Compiling
|
||||
|
||||
### SDL
|
||||
- 💻 [Building from source](docs/markdown/04-coding/01-compiling.md)
|
||||
|
||||
http://www.libsdl.org/
|
||||
## Third party librairies
|
||||
|
||||
### OpenAL
|
||||
The following third party tools and libraries are used by the project
|
||||
|
||||
https://www.openal.org/
|
||||
- [Flex](https://github.com/westes/flex)
|
||||
- [Bison](https://savannah.gnu.org/projects/bison/)
|
||||
- [SDL](http://www.libsdl.org/)
|
||||
- [OpenAL](https://www.openal.org/)
|
||||
- [LibMAD](http://www.underbit.com/products/mad/)
|
||||
- [cURL](https://curl.se/)
|
||||
- [Libogg](https://github.com/gcp/libogg)
|
||||
- [Libvorbis](https://xiph.org/vorbis/)
|
||||
- [Libopus](https://opus-codec.org/)
|
||||
|
||||
### LibMAD
|
||||
## Resources
|
||||
|
||||
http://www.underbit.com/products/mad/
|
||||
|
||||
### cURL
|
||||
|
||||
https://curl.se/
|
||||
|
||||
### Libogg
|
||||
|
||||
https://github.com/gcp/libogg
|
||||
|
||||
### Libvorbis
|
||||
|
||||
https://xiph.org/vorbis/
|
||||
|
||||
### Libopus
|
||||
|
||||
https://opus-codec.org/
|
||||
|
||||
## Communities
|
||||
|
||||
### URLs
|
||||
|
||||
- https://github.com/openmoh/openmohaa/
|
||||
- https://mohaaaa.co.uk/AAAAMOHAA/index.php
|
||||
- https://x-null.net/
|
||||
|
||||
### Discord
|
||||
|
||||
[](https://discord.gg/NYtH58R)
|
||||
- 🔗 [GitHub Repository](https://github.com/openmoh/openmohaa/)
|
||||
- 🌐 [MOHAAAA Amalgamated Allied Assault Alliance](https://mohaaaa.co.uk/AAAAMOHAA/index.php)
|
||||
- 🕹️ [333networks](https://333networks.com/)
|
||||
- 📂 [ModDB](https://www.moddb.com/games/medal-of-honor-allied-assault)
|
||||
- 📂 [GameBanana](https://gamebanana.com/games/720)
|
||||
- 💬 [Join us on Discord](https://discord.gg/NYtH58R)
|
||||
+303
-252
@@ -1,8 +1,40 @@
|
||||
#ifndef AL_AL_H
|
||||
#define AL_AL_H
|
||||
|
||||
#if defined(__cplusplus)
|
||||
/* NOLINTBEGIN */
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
|
||||
#ifdef _MSVC_LANG
|
||||
#define AL_CPLUSPLUS _MSVC_LANG
|
||||
#else
|
||||
#define AL_CPLUSPLUS __cplusplus
|
||||
#endif
|
||||
|
||||
#ifndef AL_DISABLE_NOEXCEPT
|
||||
#if AL_CPLUSPLUS >= 201103L
|
||||
#define AL_API_NOEXCEPT noexcept
|
||||
#else
|
||||
#define AL_API_NOEXCEPT
|
||||
#endif
|
||||
#if AL_CPLUSPLUS >= 201703L
|
||||
#define AL_API_NOEXCEPT17 noexcept
|
||||
#else
|
||||
#define AL_API_NOEXCEPT17
|
||||
#endif
|
||||
|
||||
#else /* AL_DISABLE_NOEXCEPT */
|
||||
|
||||
#define AL_API_NOEXCEPT
|
||||
#define AL_API_NOEXCEPT17
|
||||
#endif
|
||||
|
||||
#undef AL_CPLUSPLUS
|
||||
|
||||
#else /* __cplusplus */
|
||||
|
||||
#define AL_API_NOEXCEPT
|
||||
#define AL_API_NOEXCEPT17
|
||||
#endif
|
||||
|
||||
#ifndef AL_API
|
||||
@@ -15,14 +47,14 @@ extern "C" {
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#if defined(_WIN32)
|
||||
#ifdef _WIN32
|
||||
#define AL_APIENTRY __cdecl
|
||||
#else
|
||||
#define AL_APIENTRY
|
||||
#endif
|
||||
|
||||
|
||||
/** Deprecated macro. */
|
||||
/* Deprecated macros. */
|
||||
#define OPENAL
|
||||
#define ALAPI AL_API
|
||||
#define ALAPIENTRY AL_APIENTRY
|
||||
@@ -30,7 +62,7 @@ extern "C" {
|
||||
#define AL_ILLEGAL_ENUM AL_INVALID_ENUM
|
||||
#define AL_ILLEGAL_COMMAND AL_INVALID_OPERATION
|
||||
|
||||
/** Supported AL version. */
|
||||
/* Supported AL versions. */
|
||||
#define AL_VERSION_1_0
|
||||
#define AL_VERSION_1_1
|
||||
|
||||
@@ -40,43 +72,43 @@ typedef char ALboolean;
|
||||
/** character */
|
||||
typedef char ALchar;
|
||||
|
||||
/** signed 8-bit 2's complement integer */
|
||||
/** signed 8-bit integer */
|
||||
typedef signed char ALbyte;
|
||||
|
||||
/** unsigned 8-bit integer */
|
||||
typedef unsigned char ALubyte;
|
||||
|
||||
/** signed 16-bit 2's complement integer */
|
||||
/** signed 16-bit integer */
|
||||
typedef short ALshort;
|
||||
|
||||
/** unsigned 16-bit integer */
|
||||
typedef unsigned short ALushort;
|
||||
|
||||
/** signed 32-bit 2's complement integer */
|
||||
/** signed 32-bit integer */
|
||||
typedef int ALint;
|
||||
|
||||
/** unsigned 32-bit integer */
|
||||
typedef unsigned int ALuint;
|
||||
|
||||
/** non-negative 32-bit binary integer size */
|
||||
/** non-negative 32-bit integer size */
|
||||
typedef int ALsizei;
|
||||
|
||||
/** enumerated 32-bit value */
|
||||
/** 32-bit enumeration value */
|
||||
typedef int ALenum;
|
||||
|
||||
/** 32-bit IEEE754 floating-point */
|
||||
/** 32-bit IEEE-754 floating-point */
|
||||
typedef float ALfloat;
|
||||
|
||||
/** 64-bit IEEE754 floating-point */
|
||||
/** 64-bit IEEE-754 floating-point */
|
||||
typedef double ALdouble;
|
||||
|
||||
/** void type (for opaque pointers only) */
|
||||
/** void type (opaque pointers only) */
|
||||
typedef void ALvoid;
|
||||
|
||||
|
||||
/* Enumerant values begin at column 50. No tabs. */
|
||||
/* Enumeration values begin at column 50. Do not use tabs. */
|
||||
|
||||
/** "no distance model" or "no buffer" */
|
||||
/** No distance model or no buffer */
|
||||
#define AL_NONE 0
|
||||
|
||||
/** Boolean False. */
|
||||
@@ -89,10 +121,10 @@ typedef void ALvoid;
|
||||
/**
|
||||
* Relative source.
|
||||
* Type: ALboolean
|
||||
* Range: [AL_TRUE, AL_FALSE]
|
||||
* Range: [AL_FALSE, AL_TRUE]
|
||||
* Default: AL_FALSE
|
||||
*
|
||||
* Specifies if the Source has relative coordinates.
|
||||
* Specifies if the source uses relative coordinates.
|
||||
*/
|
||||
#define AL_SOURCE_RELATIVE 0x202
|
||||
|
||||
@@ -103,7 +135,8 @@ typedef void ALvoid;
|
||||
* Range: [0 - 360]
|
||||
* Default: 360
|
||||
*
|
||||
* The angle covered by the inner cone, where the source will not attenuate.
|
||||
* The angle covered by the inner cone, the area within which the source will
|
||||
* not be attenuated by direction.
|
||||
*/
|
||||
#define AL_CONE_INNER_ANGLE 0x1001
|
||||
|
||||
@@ -112,8 +145,8 @@ typedef void ALvoid;
|
||||
* Range: [0 - 360]
|
||||
* Default: 360
|
||||
*
|
||||
* The angle covered by the outer cone, where the source will be fully
|
||||
* attenuated.
|
||||
* The angle covered by the outer cone, the area outside of which the source
|
||||
* will be fully attenuated by direction.
|
||||
*/
|
||||
#define AL_CONE_OUTER_ANGLE 0x1002
|
||||
|
||||
@@ -123,7 +156,7 @@ typedef void ALvoid;
|
||||
* Range: [0.5 - 2.0]
|
||||
* Default: 1.0
|
||||
*
|
||||
* A multiplier for the frequency (sample rate) of the source's buffer.
|
||||
* A multiplier for the sample rate of the source's buffer.
|
||||
*/
|
||||
#define AL_PITCH 0x1003
|
||||
|
||||
@@ -134,12 +167,12 @@ typedef void ALvoid;
|
||||
*
|
||||
* The source or listener location in three dimensional space.
|
||||
*
|
||||
* OpenAL, like OpenGL, uses a right handed coordinate system, where in a
|
||||
* frontal default view X (thumb) points right, Y points up (index finger), and
|
||||
* Z points towards the viewer/camera (middle finger).
|
||||
* OpenAL uses a right handed coordinate system, like OpenGL, where with a
|
||||
* default view, X points right (thumb), Y points up (index finger), and Z
|
||||
* points towards the viewer/camera (middle finger).
|
||||
*
|
||||
* To switch from a left handed coordinate system, flip the sign on the Z
|
||||
* coordinate.
|
||||
* To change from or to a left handed coordinate system, negate the Z
|
||||
* component.
|
||||
*/
|
||||
#define AL_POSITION 0x1004
|
||||
|
||||
@@ -148,8 +181,11 @@ typedef void ALvoid;
|
||||
* Type: ALfloat[3], ALint[3]
|
||||
* Default: {0, 0, 0}
|
||||
*
|
||||
* Specifies the current direction in local space.
|
||||
* A zero-length vector specifies an omni-directional source (cone is ignored).
|
||||
* Specifies the current direction in local space. A zero-length vector
|
||||
* specifies an omni-directional source (cone is ignored).
|
||||
*
|
||||
* To change from or to a left handed coordinate system, negate the Z
|
||||
* component.
|
||||
*/
|
||||
#define AL_DIRECTION 0x1005
|
||||
|
||||
@@ -158,26 +194,30 @@ typedef void ALvoid;
|
||||
* Type: ALfloat[3], ALint[3]
|
||||
* Default: {0, 0, 0}
|
||||
*
|
||||
* Specifies the current velocity in local space.
|
||||
* Specifies the current velocity, relative to the position.
|
||||
*
|
||||
* To change from or to a left handed coordinate system, negate the Z
|
||||
* component.
|
||||
*/
|
||||
#define AL_VELOCITY 0x1006
|
||||
|
||||
/**
|
||||
* Source looping.
|
||||
* Type: ALboolean
|
||||
* Range: [AL_TRUE, AL_FALSE]
|
||||
* Range: [AL_FALSE, AL_TRUE]
|
||||
* Default: AL_FALSE
|
||||
*
|
||||
* Specifies whether source is looping.
|
||||
* Specifies whether source playback loops.
|
||||
*/
|
||||
#define AL_LOOPING 0x1007
|
||||
|
||||
/**
|
||||
* Source buffer.
|
||||
* Type: ALuint
|
||||
* Range: any valid Buffer.
|
||||
* Type: ALuint
|
||||
* Range: any valid Buffer ID
|
||||
* Default: AL_NONE
|
||||
*
|
||||
* Specifies the buffer to provide sound samples.
|
||||
* Specifies the buffer to provide sound samples for a source.
|
||||
*/
|
||||
#define AL_BUFFER 0x1009
|
||||
|
||||
@@ -186,12 +226,12 @@ typedef void ALvoid;
|
||||
* Type: ALfloat
|
||||
* Range: [0.0 - ]
|
||||
*
|
||||
* A value of 1.0 means unattenuated. Each division by 2 equals an attenuation
|
||||
* of about -6dB. Each multiplicaton by 2 equals an amplification of about
|
||||
* +6dB.
|
||||
* For sources, an initial linear gain value (before attenuation is applied).
|
||||
* For the listener, an output linear gain adjustment.
|
||||
*
|
||||
* A value of 0.0 is meaningless with respect to a logarithmic scale; it is
|
||||
* silent.
|
||||
* A value of 1.0 means unattenuated. Each division by 2 equals an attenuation
|
||||
* of about -6dB. Each multiplication by 2 equals an amplification of about
|
||||
* +6dB.
|
||||
*/
|
||||
#define AL_GAIN 0x100A
|
||||
|
||||
@@ -200,8 +240,8 @@ typedef void ALvoid;
|
||||
* Type: ALfloat
|
||||
* Range: [0.0 - 1.0]
|
||||
*
|
||||
* The minimum gain allowed for a source, after distance and cone attenation is
|
||||
* applied (if applicable).
|
||||
* The minimum gain allowed for a source, after distance and cone attenuation
|
||||
* are applied (if applicable).
|
||||
*/
|
||||
#define AL_MIN_GAIN 0x100D
|
||||
|
||||
@@ -210,31 +250,33 @@ typedef void ALvoid;
|
||||
* Type: ALfloat
|
||||
* Range: [0.0 - 1.0]
|
||||
*
|
||||
* The maximum gain allowed for a source, after distance and cone attenation is
|
||||
* applied (if applicable).
|
||||
* The maximum gain allowed for a source, after distance and cone attenuation
|
||||
* are applied (if applicable).
|
||||
*/
|
||||
#define AL_MAX_GAIN 0x100E
|
||||
|
||||
/**
|
||||
* Listener orientation.
|
||||
* Type: ALfloat[6]
|
||||
* Type: ALfloat[6]
|
||||
* Default: {0.0, 0.0, -1.0, 0.0, 1.0, 0.0}
|
||||
*
|
||||
* Effectively two three dimensional vectors. The first vector is the front (or
|
||||
* "at") and the second is the top (or "up").
|
||||
* "at") and the second is the top (or "up"). Both vectors are relative to the
|
||||
* listener position.
|
||||
*
|
||||
* Both vectors are in local space.
|
||||
* To change from or to a left handed coordinate system, negate the Z
|
||||
* component of both vectors.
|
||||
*/
|
||||
#define AL_ORIENTATION 0x100F
|
||||
|
||||
/**
|
||||
* Source state (query only).
|
||||
* Type: ALint
|
||||
* Type: ALenum
|
||||
* Range: [AL_INITIAL, AL_PLAYING, AL_PAUSED, AL_STOPPED]
|
||||
*/
|
||||
#define AL_SOURCE_STATE 0x1010
|
||||
|
||||
/** Source state value. */
|
||||
/* Source state values. */
|
||||
#define AL_INITIAL 0x1011
|
||||
#define AL_PLAYING 0x1012
|
||||
#define AL_PAUSED 0x1013
|
||||
@@ -267,9 +309,9 @@ typedef void ALvoid;
|
||||
* Range: [0.0 - ]
|
||||
* Default: 1.0
|
||||
*
|
||||
* The distance in units that no attenuation occurs.
|
||||
* The distance in units that no distance attenuation occurs.
|
||||
*
|
||||
* At 0.0, no distance attenuation ever occurs on non-linear attenuation models.
|
||||
* At 0.0, no distance attenuation occurs with non-linear attenuation models.
|
||||
*/
|
||||
#define AL_REFERENCE_DISTANCE 0x1020
|
||||
|
||||
@@ -292,7 +334,7 @@ typedef void ALvoid;
|
||||
* Default: 0.0
|
||||
*
|
||||
* The gain attenuation applied when the listener is outside of the source's
|
||||
* outer cone.
|
||||
* outer cone angle.
|
||||
*/
|
||||
#define AL_CONE_OUTER_GAIN 0x1022
|
||||
|
||||
@@ -300,7 +342,7 @@ typedef void ALvoid;
|
||||
* Source maximum distance.
|
||||
* Type: ALfloat
|
||||
* Range: [0.0 - ]
|
||||
* Default: +inf
|
||||
* Default: FLT_MAX
|
||||
*
|
||||
* The distance above which the source is not attenuated any further with a
|
||||
* clamped distance model, or where attenuation reaches 0.0 gain for linear
|
||||
@@ -308,16 +350,16 @@ typedef void ALvoid;
|
||||
*/
|
||||
#define AL_MAX_DISTANCE 0x1023
|
||||
|
||||
/** Source buffer position, in seconds */
|
||||
/** Source buffer offset, in seconds */
|
||||
#define AL_SEC_OFFSET 0x1024
|
||||
/** Source buffer position, in sample frames */
|
||||
/** Source buffer offset, in sample frames */
|
||||
#define AL_SAMPLE_OFFSET 0x1025
|
||||
/** Source buffer position, in bytes */
|
||||
/** Source buffer offset, in bytes */
|
||||
#define AL_BYTE_OFFSET 0x1026
|
||||
|
||||
/**
|
||||
* Source type (query only).
|
||||
* Type: ALint
|
||||
* Type: ALenum
|
||||
* Range: [AL_STATIC, AL_STREAMING, AL_UNDETERMINED]
|
||||
*
|
||||
* A Source is Static if a Buffer has been attached using AL_BUFFER.
|
||||
@@ -330,31 +372,30 @@ typedef void ALvoid;
|
||||
*/
|
||||
#define AL_SOURCE_TYPE 0x1027
|
||||
|
||||
/** Source type value. */
|
||||
/* Source type values. */
|
||||
#define AL_STATIC 0x1028
|
||||
#define AL_STREAMING 0x1029
|
||||
#define AL_UNDETERMINED 0x1030
|
||||
|
||||
/** Buffer format specifier. */
|
||||
/** Unsigned 8-bit mono buffer format. */
|
||||
#define AL_FORMAT_MONO8 0x1100
|
||||
/** Signed 16-bit mono buffer format. */
|
||||
#define AL_FORMAT_MONO16 0x1101
|
||||
/** Unsigned 8-bit stereo buffer format. */
|
||||
#define AL_FORMAT_STEREO8 0x1102
|
||||
/** Signed 16-bit stereo buffer format. */
|
||||
#define AL_FORMAT_STEREO16 0x1103
|
||||
|
||||
/** Buffer frequency (query only). */
|
||||
/** Buffer frequency/sample rate (query only). */
|
||||
#define AL_FREQUENCY 0x2001
|
||||
/** Buffer bits per sample (query only). */
|
||||
#define AL_BITS 0x2002
|
||||
/** Buffer channel count (query only). */
|
||||
#define AL_CHANNELS 0x2003
|
||||
/** Buffer data size (query only). */
|
||||
/** Buffer data size in bytes (query only). */
|
||||
#define AL_SIZE 0x2004
|
||||
|
||||
/**
|
||||
* Buffer state.
|
||||
*
|
||||
* Not for public use.
|
||||
*/
|
||||
/* Buffer state. Not for public use. */
|
||||
#define AL_UNUSED 0x2010
|
||||
#define AL_PENDING 0x2011
|
||||
#define AL_PROCESSED 0x2012
|
||||
@@ -363,32 +404,31 @@ typedef void ALvoid;
|
||||
/** No error. */
|
||||
#define AL_NO_ERROR 0
|
||||
|
||||
/** Invalid name paramater passed to AL call. */
|
||||
/** Invalid name (ID) passed to an AL call. */
|
||||
#define AL_INVALID_NAME 0xA001
|
||||
|
||||
/** Invalid enum parameter passed to AL call. */
|
||||
/** Invalid enumeration passed to AL call. */
|
||||
#define AL_INVALID_ENUM 0xA002
|
||||
|
||||
/** Invalid value parameter passed to AL call. */
|
||||
/** Invalid value passed to AL call. */
|
||||
#define AL_INVALID_VALUE 0xA003
|
||||
|
||||
/** Illegal AL call. */
|
||||
#define AL_INVALID_OPERATION 0xA004
|
||||
|
||||
/** Not enough memory. */
|
||||
/** Not enough memory to execute the AL call. */
|
||||
#define AL_OUT_OF_MEMORY 0xA005
|
||||
|
||||
|
||||
/** Context string: Vendor ID. */
|
||||
/** Context string: Vendor name. */
|
||||
#define AL_VENDOR 0xB001
|
||||
/** Context string: Version. */
|
||||
#define AL_VERSION 0xB002
|
||||
/** Context string: Renderer ID. */
|
||||
/** Context string: Renderer name. */
|
||||
#define AL_RENDERER 0xB003
|
||||
/** Context string: Space-separated extension list. */
|
||||
#define AL_EXTENSIONS 0xB004
|
||||
|
||||
|
||||
/**
|
||||
* Doppler scale.
|
||||
* Type: ALfloat
|
||||
@@ -398,7 +438,6 @@ typedef void ALvoid;
|
||||
* Scale for source and listener velocities.
|
||||
*/
|
||||
#define AL_DOPPLER_FACTOR 0xC000
|
||||
AL_API void AL_APIENTRY alDopplerFactor(ALfloat value);
|
||||
|
||||
/**
|
||||
* Doppler velocity (deprecated).
|
||||
@@ -406,7 +445,6 @@ AL_API void AL_APIENTRY alDopplerFactor(ALfloat value);
|
||||
* A multiplier applied to the Speed of Sound.
|
||||
*/
|
||||
#define AL_DOPPLER_VELOCITY 0xC001
|
||||
AL_API void AL_APIENTRY alDopplerVelocity(ALfloat value);
|
||||
|
||||
/**
|
||||
* Speed of Sound, in units per second.
|
||||
@@ -415,14 +453,13 @@ AL_API void AL_APIENTRY alDopplerVelocity(ALfloat value);
|
||||
* Default: 343.3
|
||||
*
|
||||
* The speed at which sound waves are assumed to travel, when calculating the
|
||||
* doppler effect.
|
||||
* doppler effect from source and listener velocities.
|
||||
*/
|
||||
#define AL_SPEED_OF_SOUND 0xC003
|
||||
AL_API void AL_APIENTRY alSpeedOfSound(ALfloat value);
|
||||
|
||||
/**
|
||||
* Distance attenuation model.
|
||||
* Type: ALint
|
||||
* Type: ALenum
|
||||
* Range: [AL_NONE, AL_INVERSE_DISTANCE, AL_INVERSE_DISTANCE_CLAMPED,
|
||||
* AL_LINEAR_DISTANCE, AL_LINEAR_DISTANCE_CLAMPED,
|
||||
* AL_EXPONENT_DISTANCE, AL_EXPONENT_DISTANCE_CLAMPED]
|
||||
@@ -439,9 +476,8 @@ AL_API void AL_APIENTRY alSpeedOfSound(ALfloat value);
|
||||
* distance calculated is clamped between the reference and max distances.
|
||||
*/
|
||||
#define AL_DISTANCE_MODEL 0xD000
|
||||
AL_API void AL_APIENTRY alDistanceModel(ALenum distanceModel);
|
||||
|
||||
/** Distance model value. */
|
||||
/* Distance model values. */
|
||||
#define AL_INVERSE_DISTANCE 0xD001
|
||||
#define AL_INVERSE_DISTANCE_CLAMPED 0xD002
|
||||
#define AL_LINEAR_DISTANCE 0xD003
|
||||
@@ -449,208 +485,223 @@ AL_API void AL_APIENTRY alDistanceModel(ALenum distanceModel);
|
||||
#define AL_EXPONENT_DISTANCE 0xD005
|
||||
#define AL_EXPONENT_DISTANCE_CLAMPED 0xD006
|
||||
|
||||
/** Renderer State management. */
|
||||
AL_API void AL_APIENTRY alEnable(ALenum capability);
|
||||
AL_API void AL_APIENTRY alDisable(ALenum capability);
|
||||
AL_API ALboolean AL_APIENTRY alIsEnabled(ALenum capability);
|
||||
#ifndef AL_NO_PROTOTYPES
|
||||
/* Renderer State management. */
|
||||
AL_API void AL_APIENTRY alEnable(ALenum capability) AL_API_NOEXCEPT;
|
||||
AL_API void AL_APIENTRY alDisable(ALenum capability) AL_API_NOEXCEPT;
|
||||
AL_API ALboolean AL_APIENTRY alIsEnabled(ALenum capability) AL_API_NOEXCEPT;
|
||||
|
||||
/** State retrieval. */
|
||||
AL_API const ALchar* AL_APIENTRY alGetString(ALenum param);
|
||||
AL_API void AL_APIENTRY alGetBooleanv(ALenum param, ALboolean *values);
|
||||
AL_API void AL_APIENTRY alGetIntegerv(ALenum param, ALint *values);
|
||||
AL_API void AL_APIENTRY alGetFloatv(ALenum param, ALfloat *values);
|
||||
AL_API void AL_APIENTRY alGetDoublev(ALenum param, ALdouble *values);
|
||||
AL_API ALboolean AL_APIENTRY alGetBoolean(ALenum param);
|
||||
AL_API ALint AL_APIENTRY alGetInteger(ALenum param);
|
||||
AL_API ALfloat AL_APIENTRY alGetFloat(ALenum param);
|
||||
AL_API ALdouble AL_APIENTRY alGetDouble(ALenum param);
|
||||
/* Context state setting. */
|
||||
AL_API void AL_APIENTRY alDopplerFactor(ALfloat value) AL_API_NOEXCEPT;
|
||||
AL_API void AL_APIENTRY alDopplerVelocity(ALfloat value) AL_API_NOEXCEPT;
|
||||
AL_API void AL_APIENTRY alSpeedOfSound(ALfloat value) AL_API_NOEXCEPT;
|
||||
AL_API void AL_APIENTRY alDistanceModel(ALenum distanceModel) AL_API_NOEXCEPT;
|
||||
|
||||
/* Context state retrieval. */
|
||||
AL_API const ALchar* AL_APIENTRY alGetString(ALenum param) AL_API_NOEXCEPT;
|
||||
AL_API void AL_APIENTRY alGetBooleanv(ALenum param, ALboolean *values) AL_API_NOEXCEPT;
|
||||
AL_API void AL_APIENTRY alGetIntegerv(ALenum param, ALint *values) AL_API_NOEXCEPT;
|
||||
AL_API void AL_APIENTRY alGetFloatv(ALenum param, ALfloat *values) AL_API_NOEXCEPT;
|
||||
AL_API void AL_APIENTRY alGetDoublev(ALenum param, ALdouble *values) AL_API_NOEXCEPT;
|
||||
AL_API ALboolean AL_APIENTRY alGetBoolean(ALenum param) AL_API_NOEXCEPT;
|
||||
AL_API ALint AL_APIENTRY alGetInteger(ALenum param) AL_API_NOEXCEPT;
|
||||
AL_API ALfloat AL_APIENTRY alGetFloat(ALenum param) AL_API_NOEXCEPT;
|
||||
AL_API ALdouble AL_APIENTRY alGetDouble(ALenum param) AL_API_NOEXCEPT;
|
||||
|
||||
/**
|
||||
* Error retrieval.
|
||||
*
|
||||
* Obtain the first error generated in the AL context since the last check.
|
||||
* Obtain the first error generated in the AL context since the last call to
|
||||
* this function.
|
||||
*/
|
||||
AL_API ALenum AL_APIENTRY alGetError(void);
|
||||
AL_API ALenum AL_APIENTRY alGetError(void) AL_API_NOEXCEPT;
|
||||
|
||||
/** Query for the presence of an extension on the AL context. */
|
||||
AL_API ALboolean AL_APIENTRY alIsExtensionPresent(const ALchar *extname) AL_API_NOEXCEPT;
|
||||
/**
|
||||
* Extension support.
|
||||
*
|
||||
* Query for the presence of an extension, and obtain any appropriate function
|
||||
* pointers and enum values.
|
||||
* Retrieve the address of a function. The returned function may be context-
|
||||
* specific.
|
||||
*/
|
||||
AL_API ALboolean AL_APIENTRY alIsExtensionPresent(const ALchar *extname);
|
||||
AL_API void* AL_APIENTRY alGetProcAddress(const ALchar *fname);
|
||||
AL_API ALenum AL_APIENTRY alGetEnumValue(const ALchar *ename);
|
||||
AL_API void* AL_APIENTRY alGetProcAddress(const ALchar *fname) AL_API_NOEXCEPT;
|
||||
/**
|
||||
* Retrieve the value of an enum. The returned value may be context-specific.
|
||||
*/
|
||||
AL_API ALenum AL_APIENTRY alGetEnumValue(const ALchar *ename) AL_API_NOEXCEPT;
|
||||
|
||||
|
||||
/** Set Listener parameters */
|
||||
AL_API void AL_APIENTRY alListenerf(ALenum param, ALfloat value);
|
||||
AL_API void AL_APIENTRY alListener3f(ALenum param, ALfloat value1, ALfloat value2, ALfloat value3);
|
||||
AL_API void AL_APIENTRY alListenerfv(ALenum param, const ALfloat *values);
|
||||
AL_API void AL_APIENTRY alListeneri(ALenum param, ALint value);
|
||||
AL_API void AL_APIENTRY alListener3i(ALenum param, ALint value1, ALint value2, ALint value3);
|
||||
AL_API void AL_APIENTRY alListeneriv(ALenum param, const ALint *values);
|
||||
/* Set listener parameters. */
|
||||
AL_API void AL_APIENTRY alListenerf(ALenum param, ALfloat value) AL_API_NOEXCEPT;
|
||||
AL_API void AL_APIENTRY alListener3f(ALenum param, ALfloat value1, ALfloat value2, ALfloat value3) AL_API_NOEXCEPT;
|
||||
AL_API void AL_APIENTRY alListenerfv(ALenum param, const ALfloat *values) AL_API_NOEXCEPT;
|
||||
AL_API void AL_APIENTRY alListeneri(ALenum param, ALint value) AL_API_NOEXCEPT;
|
||||
AL_API void AL_APIENTRY alListener3i(ALenum param, ALint value1, ALint value2, ALint value3) AL_API_NOEXCEPT;
|
||||
AL_API void AL_APIENTRY alListeneriv(ALenum param, const ALint *values) AL_API_NOEXCEPT;
|
||||
|
||||
/** Get Listener parameters */
|
||||
AL_API void AL_APIENTRY alGetListenerf(ALenum param, ALfloat *value);
|
||||
AL_API void AL_APIENTRY alGetListener3f(ALenum param, ALfloat *value1, ALfloat *value2, ALfloat *value3);
|
||||
AL_API void AL_APIENTRY alGetListenerfv(ALenum param, ALfloat *values);
|
||||
AL_API void AL_APIENTRY alGetListeneri(ALenum param, ALint *value);
|
||||
AL_API void AL_APIENTRY alGetListener3i(ALenum param, ALint *value1, ALint *value2, ALint *value3);
|
||||
AL_API void AL_APIENTRY alGetListeneriv(ALenum param, ALint *values);
|
||||
/* Get listener parameters. */
|
||||
AL_API void AL_APIENTRY alGetListenerf(ALenum param, ALfloat *value) AL_API_NOEXCEPT;
|
||||
AL_API void AL_APIENTRY alGetListener3f(ALenum param, ALfloat *value1, ALfloat *value2, ALfloat *value3) AL_API_NOEXCEPT;
|
||||
AL_API void AL_APIENTRY alGetListenerfv(ALenum param, ALfloat *values) AL_API_NOEXCEPT;
|
||||
AL_API void AL_APIENTRY alGetListeneri(ALenum param, ALint *value) AL_API_NOEXCEPT;
|
||||
AL_API void AL_APIENTRY alGetListener3i(ALenum param, ALint *value1, ALint *value2, ALint *value3) AL_API_NOEXCEPT;
|
||||
AL_API void AL_APIENTRY alGetListeneriv(ALenum param, ALint *values) AL_API_NOEXCEPT;
|
||||
|
||||
|
||||
/** Create Source objects. */
|
||||
AL_API void AL_APIENTRY alGenSources(ALsizei n, ALuint *sources);
|
||||
/** Delete Source objects. */
|
||||
AL_API void AL_APIENTRY alDeleteSources(ALsizei n, const ALuint *sources);
|
||||
/** Verify a handle is a valid Source. */
|
||||
AL_API ALboolean AL_APIENTRY alIsSource(ALuint source);
|
||||
/** Create source objects. */
|
||||
AL_API void AL_APIENTRY alGenSources(ALsizei n, ALuint *sources) AL_API_NOEXCEPT;
|
||||
/** Delete source objects. */
|
||||
AL_API void AL_APIENTRY alDeleteSources(ALsizei n, const ALuint *sources) AL_API_NOEXCEPT;
|
||||
/** Verify an ID is for a valid source. */
|
||||
AL_API ALboolean AL_APIENTRY alIsSource(ALuint source) AL_API_NOEXCEPT;
|
||||
|
||||
/** Set Source parameters. */
|
||||
AL_API void AL_APIENTRY alSourcef(ALuint source, ALenum param, ALfloat value);
|
||||
AL_API void AL_APIENTRY alSource3f(ALuint source, ALenum param, ALfloat value1, ALfloat value2, ALfloat value3);
|
||||
AL_API void AL_APIENTRY alSourcefv(ALuint source, ALenum param, const ALfloat *values);
|
||||
AL_API void AL_APIENTRY alSourcei(ALuint source, ALenum param, ALint value);
|
||||
AL_API void AL_APIENTRY alSource3i(ALuint source, ALenum param, ALint value1, ALint value2, ALint value3);
|
||||
AL_API void AL_APIENTRY alSourceiv(ALuint source, ALenum param, const ALint *values);
|
||||
/* Set source parameters. */
|
||||
AL_API void AL_APIENTRY alSourcef(ALuint source, ALenum param, ALfloat value) AL_API_NOEXCEPT;
|
||||
AL_API void AL_APIENTRY alSource3f(ALuint source, ALenum param, ALfloat value1, ALfloat value2, ALfloat value3) AL_API_NOEXCEPT;
|
||||
AL_API void AL_APIENTRY alSourcefv(ALuint source, ALenum param, const ALfloat *values) AL_API_NOEXCEPT;
|
||||
AL_API void AL_APIENTRY alSourcei(ALuint source, ALenum param, ALint value) AL_API_NOEXCEPT;
|
||||
AL_API void AL_APIENTRY alSource3i(ALuint source, ALenum param, ALint value1, ALint value2, ALint value3) AL_API_NOEXCEPT;
|
||||
AL_API void AL_APIENTRY alSourceiv(ALuint source, ALenum param, const ALint *values) AL_API_NOEXCEPT;
|
||||
|
||||
/** Get Source parameters. */
|
||||
AL_API void AL_APIENTRY alGetSourcef(ALuint source, ALenum param, ALfloat *value);
|
||||
AL_API void AL_APIENTRY alGetSource3f(ALuint source, ALenum param, ALfloat *value1, ALfloat *value2, ALfloat *value3);
|
||||
AL_API void AL_APIENTRY alGetSourcefv(ALuint source, ALenum param, ALfloat *values);
|
||||
AL_API void AL_APIENTRY alGetSourcei(ALuint source, ALenum param, ALint *value);
|
||||
AL_API void AL_APIENTRY alGetSource3i(ALuint source, ALenum param, ALint *value1, ALint *value2, ALint *value3);
|
||||
AL_API void AL_APIENTRY alGetSourceiv(ALuint source, ALenum param, ALint *values);
|
||||
/* Get source parameters. */
|
||||
AL_API void AL_APIENTRY alGetSourcef(ALuint source, ALenum param, ALfloat *value) AL_API_NOEXCEPT;
|
||||
AL_API void AL_APIENTRY alGetSource3f(ALuint source, ALenum param, ALfloat *value1, ALfloat *value2, ALfloat *value3) AL_API_NOEXCEPT;
|
||||
AL_API void AL_APIENTRY alGetSourcefv(ALuint source, ALenum param, ALfloat *values) AL_API_NOEXCEPT;
|
||||
AL_API void AL_APIENTRY alGetSourcei(ALuint source, ALenum param, ALint *value) AL_API_NOEXCEPT;
|
||||
AL_API void AL_APIENTRY alGetSource3i(ALuint source, ALenum param, ALint *value1, ALint *value2, ALint *value3) AL_API_NOEXCEPT;
|
||||
AL_API void AL_APIENTRY alGetSourceiv(ALuint source, ALenum param, ALint *values) AL_API_NOEXCEPT;
|
||||
|
||||
|
||||
/** Play, replay, or resume (if paused) a list of Sources */
|
||||
AL_API void AL_APIENTRY alSourcePlayv(ALsizei n, const ALuint *sources);
|
||||
/** Stop a list of Sources */
|
||||
AL_API void AL_APIENTRY alSourceStopv(ALsizei n, const ALuint *sources);
|
||||
/** Rewind a list of Sources */
|
||||
AL_API void AL_APIENTRY alSourceRewindv(ALsizei n, const ALuint *sources);
|
||||
/** Pause a list of Sources */
|
||||
AL_API void AL_APIENTRY alSourcePausev(ALsizei n, const ALuint *sources);
|
||||
/** Play, restart, or resume a source, setting its state to AL_PLAYING. */
|
||||
AL_API void AL_APIENTRY alSourcePlay(ALuint source) AL_API_NOEXCEPT;
|
||||
/** Stop a source, setting its state to AL_STOPPED if playing or paused. */
|
||||
AL_API void AL_APIENTRY alSourceStop(ALuint source) AL_API_NOEXCEPT;
|
||||
/** Rewind a source, setting its state to AL_INITIAL. */
|
||||
AL_API void AL_APIENTRY alSourceRewind(ALuint source) AL_API_NOEXCEPT;
|
||||
/** Pause a source, setting its state to AL_PAUSED if playing. */
|
||||
AL_API void AL_APIENTRY alSourcePause(ALuint source) AL_API_NOEXCEPT;
|
||||
|
||||
/** Play, replay, or resume a Source */
|
||||
AL_API void AL_APIENTRY alSourcePlay(ALuint source);
|
||||
/** Stop a Source */
|
||||
AL_API void AL_APIENTRY alSourceStop(ALuint source);
|
||||
/** Rewind a Source (set playback postiton to beginning) */
|
||||
AL_API void AL_APIENTRY alSourceRewind(ALuint source);
|
||||
/** Pause a Source */
|
||||
AL_API void AL_APIENTRY alSourcePause(ALuint source);
|
||||
/** Play, restart, or resume a list of sources atomically. */
|
||||
AL_API void AL_APIENTRY alSourcePlayv(ALsizei n, const ALuint *sources) AL_API_NOEXCEPT;
|
||||
/** Stop a list of sources atomically. */
|
||||
AL_API void AL_APIENTRY alSourceStopv(ALsizei n, const ALuint *sources) AL_API_NOEXCEPT;
|
||||
/** Rewind a list of sources atomically. */
|
||||
AL_API void AL_APIENTRY alSourceRewindv(ALsizei n, const ALuint *sources) AL_API_NOEXCEPT;
|
||||
/** Pause a list of sources atomically. */
|
||||
AL_API void AL_APIENTRY alSourcePausev(ALsizei n, const ALuint *sources) AL_API_NOEXCEPT;
|
||||
|
||||
/** Queue buffers onto a source */
|
||||
AL_API void AL_APIENTRY alSourceQueueBuffers(ALuint source, ALsizei nb, const ALuint *buffers);
|
||||
AL_API void AL_APIENTRY alSourceQueueBuffers(ALuint source, ALsizei nb, const ALuint *buffers) AL_API_NOEXCEPT;
|
||||
/** Unqueue processed buffers from a source */
|
||||
AL_API void AL_APIENTRY alSourceUnqueueBuffers(ALuint source, ALsizei nb, ALuint *buffers);
|
||||
AL_API void AL_APIENTRY alSourceUnqueueBuffers(ALuint source, ALsizei nb, ALuint *buffers) AL_API_NOEXCEPT;
|
||||
|
||||
|
||||
/** Create Buffer objects */
|
||||
AL_API void AL_APIENTRY alGenBuffers(ALsizei n, ALuint *buffers);
|
||||
/** Delete Buffer objects */
|
||||
AL_API void AL_APIENTRY alDeleteBuffers(ALsizei n, const ALuint *buffers);
|
||||
/** Verify a handle is a valid Buffer */
|
||||
AL_API ALboolean AL_APIENTRY alIsBuffer(ALuint buffer);
|
||||
/** Create buffer objects */
|
||||
AL_API void AL_APIENTRY alGenBuffers(ALsizei n, ALuint *buffers) AL_API_NOEXCEPT;
|
||||
/** Delete buffer objects */
|
||||
AL_API void AL_APIENTRY alDeleteBuffers(ALsizei n, const ALuint *buffers) AL_API_NOEXCEPT;
|
||||
/** Verify an ID is a valid buffer (including the NULL buffer) */
|
||||
AL_API ALboolean AL_APIENTRY alIsBuffer(ALuint buffer) AL_API_NOEXCEPT;
|
||||
|
||||
/** Specifies the data to be copied into a buffer */
|
||||
AL_API void AL_APIENTRY alBufferData(ALuint buffer, ALenum format, const ALvoid *data, ALsizei size, ALsizei freq);
|
||||
/**
|
||||
* Copies data into the buffer, interpreting it using the specified format and
|
||||
* samplerate.
|
||||
*/
|
||||
AL_API void AL_APIENTRY alBufferData(ALuint buffer, ALenum format, const ALvoid *data, ALsizei size, ALsizei samplerate) AL_API_NOEXCEPT;
|
||||
|
||||
/** Set Buffer parameters, */
|
||||
AL_API void AL_APIENTRY alBufferf(ALuint buffer, ALenum param, ALfloat value);
|
||||
AL_API void AL_APIENTRY alBuffer3f(ALuint buffer, ALenum param, ALfloat value1, ALfloat value2, ALfloat value3);
|
||||
AL_API void AL_APIENTRY alBufferfv(ALuint buffer, ALenum param, const ALfloat *values);
|
||||
AL_API void AL_APIENTRY alBufferi(ALuint buffer, ALenum param, ALint value);
|
||||
AL_API void AL_APIENTRY alBuffer3i(ALuint buffer, ALenum param, ALint value1, ALint value2, ALint value3);
|
||||
AL_API void AL_APIENTRY alBufferiv(ALuint buffer, ALenum param, const ALint *values);
|
||||
/* Set buffer parameters. */
|
||||
AL_API void AL_APIENTRY alBufferf(ALuint buffer, ALenum param, ALfloat value) AL_API_NOEXCEPT;
|
||||
AL_API void AL_APIENTRY alBuffer3f(ALuint buffer, ALenum param, ALfloat value1, ALfloat value2, ALfloat value3) AL_API_NOEXCEPT;
|
||||
AL_API void AL_APIENTRY alBufferfv(ALuint buffer, ALenum param, const ALfloat *values) AL_API_NOEXCEPT;
|
||||
AL_API void AL_APIENTRY alBufferi(ALuint buffer, ALenum param, ALint value) AL_API_NOEXCEPT;
|
||||
AL_API void AL_APIENTRY alBuffer3i(ALuint buffer, ALenum param, ALint value1, ALint value2, ALint value3) AL_API_NOEXCEPT;
|
||||
AL_API void AL_APIENTRY alBufferiv(ALuint buffer, ALenum param, const ALint *values) AL_API_NOEXCEPT;
|
||||
|
||||
/** Get Buffer parameters. */
|
||||
AL_API void AL_APIENTRY alGetBufferf(ALuint buffer, ALenum param, ALfloat *value);
|
||||
AL_API void AL_APIENTRY alGetBuffer3f(ALuint buffer, ALenum param, ALfloat *value1, ALfloat *value2, ALfloat *value3);
|
||||
AL_API void AL_APIENTRY alGetBufferfv(ALuint buffer, ALenum param, ALfloat *values);
|
||||
AL_API void AL_APIENTRY alGetBufferi(ALuint buffer, ALenum param, ALint *value);
|
||||
AL_API void AL_APIENTRY alGetBuffer3i(ALuint buffer, ALenum param, ALint *value1, ALint *value2, ALint *value3);
|
||||
AL_API void AL_APIENTRY alGetBufferiv(ALuint buffer, ALenum param, ALint *values);
|
||||
/* Get buffer parameters. */
|
||||
AL_API void AL_APIENTRY alGetBufferf(ALuint buffer, ALenum param, ALfloat *value) AL_API_NOEXCEPT;
|
||||
AL_API void AL_APIENTRY alGetBuffer3f(ALuint buffer, ALenum param, ALfloat *value1, ALfloat *value2, ALfloat *value3) AL_API_NOEXCEPT;
|
||||
AL_API void AL_APIENTRY alGetBufferfv(ALuint buffer, ALenum param, ALfloat *values) AL_API_NOEXCEPT;
|
||||
AL_API void AL_APIENTRY alGetBufferi(ALuint buffer, ALenum param, ALint *value) AL_API_NOEXCEPT;
|
||||
AL_API void AL_APIENTRY alGetBuffer3i(ALuint buffer, ALenum param, ALint *value1, ALint *value2, ALint *value3) AL_API_NOEXCEPT;
|
||||
AL_API void AL_APIENTRY alGetBufferiv(ALuint buffer, ALenum param, ALint *values) AL_API_NOEXCEPT;
|
||||
#endif /* AL_NO_PROTOTYPES */
|
||||
|
||||
/** Pointer-to-function type, useful for dynamically getting AL entry points. */
|
||||
typedef void (AL_APIENTRY *LPALENABLE)(ALenum capability);
|
||||
typedef void (AL_APIENTRY *LPALDISABLE)(ALenum capability);
|
||||
typedef ALboolean (AL_APIENTRY *LPALISENABLED)(ALenum capability);
|
||||
typedef const ALchar* (AL_APIENTRY *LPALGETSTRING)(ALenum param);
|
||||
typedef void (AL_APIENTRY *LPALGETBOOLEANV)(ALenum param, ALboolean *values);
|
||||
typedef void (AL_APIENTRY *LPALGETINTEGERV)(ALenum param, ALint *values);
|
||||
typedef void (AL_APIENTRY *LPALGETFLOATV)(ALenum param, ALfloat *values);
|
||||
typedef void (AL_APIENTRY *LPALGETDOUBLEV)(ALenum param, ALdouble *values);
|
||||
typedef ALboolean (AL_APIENTRY *LPALGETBOOLEAN)(ALenum param);
|
||||
typedef ALint (AL_APIENTRY *LPALGETINTEGER)(ALenum param);
|
||||
typedef ALfloat (AL_APIENTRY *LPALGETFLOAT)(ALenum param);
|
||||
typedef ALdouble (AL_APIENTRY *LPALGETDOUBLE)(ALenum param);
|
||||
typedef ALenum (AL_APIENTRY *LPALGETERROR)(void);
|
||||
typedef ALboolean (AL_APIENTRY *LPALISEXTENSIONPRESENT)(const ALchar *extname);
|
||||
typedef void* (AL_APIENTRY *LPALGETPROCADDRESS)(const ALchar *fname);
|
||||
typedef ALenum (AL_APIENTRY *LPALGETENUMVALUE)(const ALchar *ename);
|
||||
typedef void (AL_APIENTRY *LPALLISTENERF)(ALenum param, ALfloat value);
|
||||
typedef void (AL_APIENTRY *LPALLISTENER3F)(ALenum param, ALfloat value1, ALfloat value2, ALfloat value3);
|
||||
typedef void (AL_APIENTRY *LPALLISTENERFV)(ALenum param, const ALfloat *values);
|
||||
typedef void (AL_APIENTRY *LPALLISTENERI)(ALenum param, ALint value);
|
||||
typedef void (AL_APIENTRY *LPALLISTENER3I)(ALenum param, ALint value1, ALint value2, ALint value3);
|
||||
typedef void (AL_APIENTRY *LPALLISTENERIV)(ALenum param, const ALint *values);
|
||||
typedef void (AL_APIENTRY *LPALGETLISTENERF)(ALenum param, ALfloat *value);
|
||||
typedef void (AL_APIENTRY *LPALGETLISTENER3F)(ALenum param, ALfloat *value1, ALfloat *value2, ALfloat *value3);
|
||||
typedef void (AL_APIENTRY *LPALGETLISTENERFV)(ALenum param, ALfloat *values);
|
||||
typedef void (AL_APIENTRY *LPALGETLISTENERI)(ALenum param, ALint *value);
|
||||
typedef void (AL_APIENTRY *LPALGETLISTENER3I)(ALenum param, ALint *value1, ALint *value2, ALint *value3);
|
||||
typedef void (AL_APIENTRY *LPALGETLISTENERIV)(ALenum param, ALint *values);
|
||||
typedef void (AL_APIENTRY *LPALGENSOURCES)(ALsizei n, ALuint *sources);
|
||||
typedef void (AL_APIENTRY *LPALDELETESOURCES)(ALsizei n, const ALuint *sources);
|
||||
typedef ALboolean (AL_APIENTRY *LPALISSOURCE)(ALuint source);
|
||||
typedef void (AL_APIENTRY *LPALSOURCEF)(ALuint source, ALenum param, ALfloat value);
|
||||
typedef void (AL_APIENTRY *LPALSOURCE3F)(ALuint source, ALenum param, ALfloat value1, ALfloat value2, ALfloat value3);
|
||||
typedef void (AL_APIENTRY *LPALSOURCEFV)(ALuint source, ALenum param, const ALfloat *values);
|
||||
typedef void (AL_APIENTRY *LPALSOURCEI)(ALuint source, ALenum param, ALint value);
|
||||
typedef void (AL_APIENTRY *LPALSOURCE3I)(ALuint source, ALenum param, ALint value1, ALint value2, ALint value3);
|
||||
typedef void (AL_APIENTRY *LPALSOURCEIV)(ALuint source, ALenum param, const ALint *values);
|
||||
typedef void (AL_APIENTRY *LPALGETSOURCEF)(ALuint source, ALenum param, ALfloat *value);
|
||||
typedef void (AL_APIENTRY *LPALGETSOURCE3F)(ALuint source, ALenum param, ALfloat *value1, ALfloat *value2, ALfloat *value3);
|
||||
typedef void (AL_APIENTRY *LPALGETSOURCEFV)(ALuint source, ALenum param, ALfloat *values);
|
||||
typedef void (AL_APIENTRY *LPALGETSOURCEI)(ALuint source, ALenum param, ALint *value);
|
||||
typedef void (AL_APIENTRY *LPALGETSOURCE3I)(ALuint source, ALenum param, ALint *value1, ALint *value2, ALint *value3);
|
||||
typedef void (AL_APIENTRY *LPALGETSOURCEIV)(ALuint source, ALenum param, ALint *values);
|
||||
typedef void (AL_APIENTRY *LPALSOURCEPLAYV)(ALsizei n, const ALuint *sources);
|
||||
typedef void (AL_APIENTRY *LPALSOURCESTOPV)(ALsizei n, const ALuint *sources);
|
||||
typedef void (AL_APIENTRY *LPALSOURCEREWINDV)(ALsizei n, const ALuint *sources);
|
||||
typedef void (AL_APIENTRY *LPALSOURCEPAUSEV)(ALsizei n, const ALuint *sources);
|
||||
typedef void (AL_APIENTRY *LPALSOURCEPLAY)(ALuint source);
|
||||
typedef void (AL_APIENTRY *LPALSOURCESTOP)(ALuint source);
|
||||
typedef void (AL_APIENTRY *LPALSOURCEREWIND)(ALuint source);
|
||||
typedef void (AL_APIENTRY *LPALSOURCEPAUSE)(ALuint source);
|
||||
typedef void (AL_APIENTRY *LPALSOURCEQUEUEBUFFERS)(ALuint source, ALsizei nb, const ALuint *buffers);
|
||||
typedef void (AL_APIENTRY *LPALSOURCEUNQUEUEBUFFERS)(ALuint source, ALsizei nb, ALuint *buffers);
|
||||
typedef void (AL_APIENTRY *LPALGENBUFFERS)(ALsizei n, ALuint *buffers);
|
||||
typedef void (AL_APIENTRY *LPALDELETEBUFFERS)(ALsizei n, const ALuint *buffers);
|
||||
typedef ALboolean (AL_APIENTRY *LPALISBUFFER)(ALuint buffer);
|
||||
typedef void (AL_APIENTRY *LPALBUFFERDATA)(ALuint buffer, ALenum format, const ALvoid *data, ALsizei size, ALsizei freq);
|
||||
typedef void (AL_APIENTRY *LPALBUFFERF)(ALuint buffer, ALenum param, ALfloat value);
|
||||
typedef void (AL_APIENTRY *LPALBUFFER3F)(ALuint buffer, ALenum param, ALfloat value1, ALfloat value2, ALfloat value3);
|
||||
typedef void (AL_APIENTRY *LPALBUFFERFV)(ALuint buffer, ALenum param, const ALfloat *values);
|
||||
typedef void (AL_APIENTRY *LPALBUFFERI)(ALuint buffer, ALenum param, ALint value);
|
||||
typedef void (AL_APIENTRY *LPALBUFFER3I)(ALuint buffer, ALenum param, ALint value1, ALint value2, ALint value3);
|
||||
typedef void (AL_APIENTRY *LPALBUFFERIV)(ALuint buffer, ALenum param, const ALint *values);
|
||||
typedef void (AL_APIENTRY *LPALGETBUFFERF)(ALuint buffer, ALenum param, ALfloat *value);
|
||||
typedef void (AL_APIENTRY *LPALGETBUFFER3F)(ALuint buffer, ALenum param, ALfloat *value1, ALfloat *value2, ALfloat *value3);
|
||||
typedef void (AL_APIENTRY *LPALGETBUFFERFV)(ALuint buffer, ALenum param, ALfloat *values);
|
||||
typedef void (AL_APIENTRY *LPALGETBUFFERI)(ALuint buffer, ALenum param, ALint *value);
|
||||
typedef void (AL_APIENTRY *LPALGETBUFFER3I)(ALuint buffer, ALenum param, ALint *value1, ALint *value2, ALint *value3);
|
||||
typedef void (AL_APIENTRY *LPALGETBUFFERIV)(ALuint buffer, ALenum param, ALint *values);
|
||||
typedef void (AL_APIENTRY *LPALDOPPLERFACTOR)(ALfloat value);
|
||||
typedef void (AL_APIENTRY *LPALDOPPLERVELOCITY)(ALfloat value);
|
||||
typedef void (AL_APIENTRY *LPALSPEEDOFSOUND)(ALfloat value);
|
||||
typedef void (AL_APIENTRY *LPALDISTANCEMODEL)(ALenum distanceModel);
|
||||
/* Pointer-to-function types, useful for storing dynamically loaded AL entry
|
||||
* points.
|
||||
*/
|
||||
typedef void (AL_APIENTRY *LPALENABLE)(ALenum capability) AL_API_NOEXCEPT17;
|
||||
typedef void (AL_APIENTRY *LPALDISABLE)(ALenum capability) AL_API_NOEXCEPT17;
|
||||
typedef ALboolean (AL_APIENTRY *LPALISENABLED)(ALenum capability) AL_API_NOEXCEPT17;
|
||||
typedef const ALchar* (AL_APIENTRY *LPALGETSTRING)(ALenum param) AL_API_NOEXCEPT17;
|
||||
typedef void (AL_APIENTRY *LPALGETBOOLEANV)(ALenum param, ALboolean *values) AL_API_NOEXCEPT17;
|
||||
typedef void (AL_APIENTRY *LPALGETINTEGERV)(ALenum param, ALint *values) AL_API_NOEXCEPT17;
|
||||
typedef void (AL_APIENTRY *LPALGETFLOATV)(ALenum param, ALfloat *values) AL_API_NOEXCEPT17;
|
||||
typedef void (AL_APIENTRY *LPALGETDOUBLEV)(ALenum param, ALdouble *values) AL_API_NOEXCEPT17;
|
||||
typedef ALboolean (AL_APIENTRY *LPALGETBOOLEAN)(ALenum param) AL_API_NOEXCEPT17;
|
||||
typedef ALint (AL_APIENTRY *LPALGETINTEGER)(ALenum param) AL_API_NOEXCEPT17;
|
||||
typedef ALfloat (AL_APIENTRY *LPALGETFLOAT)(ALenum param) AL_API_NOEXCEPT17;
|
||||
typedef ALdouble (AL_APIENTRY *LPALGETDOUBLE)(ALenum param) AL_API_NOEXCEPT17;
|
||||
typedef ALenum (AL_APIENTRY *LPALGETERROR)(void) AL_API_NOEXCEPT17;
|
||||
typedef ALboolean (AL_APIENTRY *LPALISEXTENSIONPRESENT)(const ALchar *extname) AL_API_NOEXCEPT17;
|
||||
typedef void* (AL_APIENTRY *LPALGETPROCADDRESS)(const ALchar *fname) AL_API_NOEXCEPT17;
|
||||
typedef ALenum (AL_APIENTRY *LPALGETENUMVALUE)(const ALchar *ename) AL_API_NOEXCEPT17;
|
||||
typedef void (AL_APIENTRY *LPALLISTENERF)(ALenum param, ALfloat value) AL_API_NOEXCEPT17;
|
||||
typedef void (AL_APIENTRY *LPALLISTENER3F)(ALenum param, ALfloat value1, ALfloat value2, ALfloat value3) AL_API_NOEXCEPT17;
|
||||
typedef void (AL_APIENTRY *LPALLISTENERFV)(ALenum param, const ALfloat *values) AL_API_NOEXCEPT17;
|
||||
typedef void (AL_APIENTRY *LPALLISTENERI)(ALenum param, ALint value) AL_API_NOEXCEPT17;
|
||||
typedef void (AL_APIENTRY *LPALLISTENER3I)(ALenum param, ALint value1, ALint value2, ALint value3) AL_API_NOEXCEPT17;
|
||||
typedef void (AL_APIENTRY *LPALLISTENERIV)(ALenum param, const ALint *values) AL_API_NOEXCEPT17;
|
||||
typedef void (AL_APIENTRY *LPALGETLISTENERF)(ALenum param, ALfloat *value) AL_API_NOEXCEPT17;
|
||||
typedef void (AL_APIENTRY *LPALGETLISTENER3F)(ALenum param, ALfloat *value1, ALfloat *value2, ALfloat *value3) AL_API_NOEXCEPT17;
|
||||
typedef void (AL_APIENTRY *LPALGETLISTENERFV)(ALenum param, ALfloat *values) AL_API_NOEXCEPT17;
|
||||
typedef void (AL_APIENTRY *LPALGETLISTENERI)(ALenum param, ALint *value) AL_API_NOEXCEPT17;
|
||||
typedef void (AL_APIENTRY *LPALGETLISTENER3I)(ALenum param, ALint *value1, ALint *value2, ALint *value3) AL_API_NOEXCEPT17;
|
||||
typedef void (AL_APIENTRY *LPALGETLISTENERIV)(ALenum param, ALint *values) AL_API_NOEXCEPT17;
|
||||
typedef void (AL_APIENTRY *LPALGENSOURCES)(ALsizei n, ALuint *sources) AL_API_NOEXCEPT17;
|
||||
typedef void (AL_APIENTRY *LPALDELETESOURCES)(ALsizei n, const ALuint *sources) AL_API_NOEXCEPT17;
|
||||
typedef ALboolean (AL_APIENTRY *LPALISSOURCE)(ALuint source) AL_API_NOEXCEPT17;
|
||||
typedef void (AL_APIENTRY *LPALSOURCEF)(ALuint source, ALenum param, ALfloat value) AL_API_NOEXCEPT17;
|
||||
typedef void (AL_APIENTRY *LPALSOURCE3F)(ALuint source, ALenum param, ALfloat value1, ALfloat value2, ALfloat value3) AL_API_NOEXCEPT17;
|
||||
typedef void (AL_APIENTRY *LPALSOURCEFV)(ALuint source, ALenum param, const ALfloat *values) AL_API_NOEXCEPT17;
|
||||
typedef void (AL_APIENTRY *LPALSOURCEI)(ALuint source, ALenum param, ALint value) AL_API_NOEXCEPT17;
|
||||
typedef void (AL_APIENTRY *LPALSOURCE3I)(ALuint source, ALenum param, ALint value1, ALint value2, ALint value3) AL_API_NOEXCEPT17;
|
||||
typedef void (AL_APIENTRY *LPALSOURCEIV)(ALuint source, ALenum param, const ALint *values) AL_API_NOEXCEPT17;
|
||||
typedef void (AL_APIENTRY *LPALGETSOURCEF)(ALuint source, ALenum param, ALfloat *value) AL_API_NOEXCEPT17;
|
||||
typedef void (AL_APIENTRY *LPALGETSOURCE3F)(ALuint source, ALenum param, ALfloat *value1, ALfloat *value2, ALfloat *value3) AL_API_NOEXCEPT17;
|
||||
typedef void (AL_APIENTRY *LPALGETSOURCEFV)(ALuint source, ALenum param, ALfloat *values) AL_API_NOEXCEPT17;
|
||||
typedef void (AL_APIENTRY *LPALGETSOURCEI)(ALuint source, ALenum param, ALint *value) AL_API_NOEXCEPT17;
|
||||
typedef void (AL_APIENTRY *LPALGETSOURCE3I)(ALuint source, ALenum param, ALint *value1, ALint *value2, ALint *value3) AL_API_NOEXCEPT17;
|
||||
typedef void (AL_APIENTRY *LPALGETSOURCEIV)(ALuint source, ALenum param, ALint *values) AL_API_NOEXCEPT17;
|
||||
typedef void (AL_APIENTRY *LPALSOURCEPLAYV)(ALsizei n, const ALuint *sources) AL_API_NOEXCEPT17;
|
||||
typedef void (AL_APIENTRY *LPALSOURCESTOPV)(ALsizei n, const ALuint *sources) AL_API_NOEXCEPT17;
|
||||
typedef void (AL_APIENTRY *LPALSOURCEREWINDV)(ALsizei n, const ALuint *sources) AL_API_NOEXCEPT17;
|
||||
typedef void (AL_APIENTRY *LPALSOURCEPAUSEV)(ALsizei n, const ALuint *sources) AL_API_NOEXCEPT17;
|
||||
typedef void (AL_APIENTRY *LPALSOURCEPLAY)(ALuint source) AL_API_NOEXCEPT17;
|
||||
typedef void (AL_APIENTRY *LPALSOURCESTOP)(ALuint source) AL_API_NOEXCEPT17;
|
||||
typedef void (AL_APIENTRY *LPALSOURCEREWIND)(ALuint source) AL_API_NOEXCEPT17;
|
||||
typedef void (AL_APIENTRY *LPALSOURCEPAUSE)(ALuint source) AL_API_NOEXCEPT17;
|
||||
typedef void (AL_APIENTRY *LPALSOURCEQUEUEBUFFERS)(ALuint source, ALsizei nb, const ALuint *buffers) AL_API_NOEXCEPT17;
|
||||
typedef void (AL_APIENTRY *LPALSOURCEUNQUEUEBUFFERS)(ALuint source, ALsizei nb, ALuint *buffers) AL_API_NOEXCEPT17;
|
||||
typedef void (AL_APIENTRY *LPALGENBUFFERS)(ALsizei n, ALuint *buffers) AL_API_NOEXCEPT17;
|
||||
typedef void (AL_APIENTRY *LPALDELETEBUFFERS)(ALsizei n, const ALuint *buffers) AL_API_NOEXCEPT17;
|
||||
typedef ALboolean (AL_APIENTRY *LPALISBUFFER)(ALuint buffer) AL_API_NOEXCEPT17;
|
||||
typedef void (AL_APIENTRY *LPALBUFFERDATA)(ALuint buffer, ALenum format, const ALvoid *data, ALsizei size, ALsizei samplerate) AL_API_NOEXCEPT17;
|
||||
typedef void (AL_APIENTRY *LPALBUFFERF)(ALuint buffer, ALenum param, ALfloat value) AL_API_NOEXCEPT17;
|
||||
typedef void (AL_APIENTRY *LPALBUFFER3F)(ALuint buffer, ALenum param, ALfloat value1, ALfloat value2, ALfloat value3) AL_API_NOEXCEPT17;
|
||||
typedef void (AL_APIENTRY *LPALBUFFERFV)(ALuint buffer, ALenum param, const ALfloat *values) AL_API_NOEXCEPT17;
|
||||
typedef void (AL_APIENTRY *LPALBUFFERI)(ALuint buffer, ALenum param, ALint value) AL_API_NOEXCEPT17;
|
||||
typedef void (AL_APIENTRY *LPALBUFFER3I)(ALuint buffer, ALenum param, ALint value1, ALint value2, ALint value3) AL_API_NOEXCEPT17;
|
||||
typedef void (AL_APIENTRY *LPALBUFFERIV)(ALuint buffer, ALenum param, const ALint *values) AL_API_NOEXCEPT17;
|
||||
typedef void (AL_APIENTRY *LPALGETBUFFERF)(ALuint buffer, ALenum param, ALfloat *value) AL_API_NOEXCEPT17;
|
||||
typedef void (AL_APIENTRY *LPALGETBUFFER3F)(ALuint buffer, ALenum param, ALfloat *value1, ALfloat *value2, ALfloat *value3) AL_API_NOEXCEPT17;
|
||||
typedef void (AL_APIENTRY *LPALGETBUFFERFV)(ALuint buffer, ALenum param, ALfloat *values) AL_API_NOEXCEPT17;
|
||||
typedef void (AL_APIENTRY *LPALGETBUFFERI)(ALuint buffer, ALenum param, ALint *value) AL_API_NOEXCEPT17;
|
||||
typedef void (AL_APIENTRY *LPALGETBUFFER3I)(ALuint buffer, ALenum param, ALint *value1, ALint *value2, ALint *value3) AL_API_NOEXCEPT17;
|
||||
typedef void (AL_APIENTRY *LPALGETBUFFERIV)(ALuint buffer, ALenum param, ALint *values) AL_API_NOEXCEPT17;
|
||||
typedef void (AL_APIENTRY *LPALDOPPLERFACTOR)(ALfloat value) AL_API_NOEXCEPT17;
|
||||
typedef void (AL_APIENTRY *LPALDOPPLERVELOCITY)(ALfloat value) AL_API_NOEXCEPT17;
|
||||
typedef void (AL_APIENTRY *LPALSPEEDOFSOUND)(ALfloat value) AL_API_NOEXCEPT17;
|
||||
typedef void (AL_APIENTRY *LPALDISTANCEMODEL)(ALenum distanceModel) AL_API_NOEXCEPT17;
|
||||
|
||||
#if defined(__cplusplus)
|
||||
#ifdef __cplusplus
|
||||
} /* extern "C" */
|
||||
#endif
|
||||
/* NOLINTEND */
|
||||
|
||||
#endif /* AL_AL_H */
|
||||
+150
-80
@@ -1,8 +1,40 @@
|
||||
#ifndef AL_ALC_H
|
||||
#define AL_ALC_H
|
||||
|
||||
#if defined(__cplusplus)
|
||||
/* NOLINTBEGIN */
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
|
||||
#ifdef _MSVC_LANG
|
||||
#define ALC_CPLUSPLUS _MSVC_LANG
|
||||
#else
|
||||
#define ALC_CPLUSPLUS __cplusplus
|
||||
#endif
|
||||
|
||||
#ifndef AL_DISABLE_NOEXCEPT
|
||||
#if ALC_CPLUSPLUS >= 201103L
|
||||
#define ALC_API_NOEXCEPT noexcept
|
||||
#else
|
||||
#define ALC_API_NOEXCEPT
|
||||
#endif
|
||||
#if ALC_CPLUSPLUS >= 201703L
|
||||
#define ALC_API_NOEXCEPT17 noexcept
|
||||
#else
|
||||
#define ALC_API_NOEXCEPT17
|
||||
#endif
|
||||
|
||||
#else /* AL_DISABLE_NOEXCEPT */
|
||||
|
||||
#define ALC_API_NOEXCEPT
|
||||
#define ALC_API_NOEXCEPT17
|
||||
#endif
|
||||
|
||||
#undef ALC_CPLUSPLUS
|
||||
|
||||
#else /* __cplusplus */
|
||||
|
||||
#define ALC_API_NOEXCEPT
|
||||
#define ALC_API_NOEXCEPT17
|
||||
#endif
|
||||
|
||||
#ifndef ALC_API
|
||||
@@ -15,14 +47,14 @@ extern "C" {
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#if defined(_WIN32)
|
||||
#ifdef _WIN32
|
||||
#define ALC_APIENTRY __cdecl
|
||||
#else
|
||||
#define ALC_APIENTRY
|
||||
#endif
|
||||
|
||||
|
||||
/** Deprecated macro. */
|
||||
/* Deprecated macros. */
|
||||
#define ALCAPI ALC_API
|
||||
#define ALCAPIENTRY ALC_APIENTRY
|
||||
#define ALC_INVALID 0
|
||||
@@ -31,9 +63,9 @@ extern "C" {
|
||||
#define ALC_VERSION_0_1 1
|
||||
|
||||
/** Opaque device handle */
|
||||
typedef struct ALCdevice_struct ALCdevice;
|
||||
typedef struct ALCdevice ALCdevice;
|
||||
/** Opaque context handle */
|
||||
typedef struct ALCcontext_struct ALCcontext;
|
||||
typedef struct ALCcontext ALCcontext;
|
||||
|
||||
/** 8-bit boolean */
|
||||
typedef char ALCboolean;
|
||||
@@ -41,41 +73,41 @@ typedef char ALCboolean;
|
||||
/** character */
|
||||
typedef char ALCchar;
|
||||
|
||||
/** signed 8-bit 2's complement integer */
|
||||
/** signed 8-bit integer */
|
||||
typedef signed char ALCbyte;
|
||||
|
||||
/** unsigned 8-bit integer */
|
||||
typedef unsigned char ALCubyte;
|
||||
|
||||
/** signed 16-bit 2's complement integer */
|
||||
/** signed 16-bit integer */
|
||||
typedef short ALCshort;
|
||||
|
||||
/** unsigned 16-bit integer */
|
||||
typedef unsigned short ALCushort;
|
||||
|
||||
/** signed 32-bit 2's complement integer */
|
||||
/** signed 32-bit integer */
|
||||
typedef int ALCint;
|
||||
|
||||
/** unsigned 32-bit integer */
|
||||
typedef unsigned int ALCuint;
|
||||
|
||||
/** non-negative 32-bit binary integer size */
|
||||
/** non-negative 32-bit integer size */
|
||||
typedef int ALCsizei;
|
||||
|
||||
/** enumerated 32-bit value */
|
||||
/** 32-bit enumeration value */
|
||||
typedef int ALCenum;
|
||||
|
||||
/** 32-bit IEEE754 floating-point */
|
||||
/** 32-bit IEEE-754 floating-point */
|
||||
typedef float ALCfloat;
|
||||
|
||||
/** 64-bit IEEE754 floating-point */
|
||||
/** 64-bit IEEE-754 floating-point */
|
||||
typedef double ALCdouble;
|
||||
|
||||
/** void type (for opaque pointers only) */
|
||||
typedef void ALCvoid;
|
||||
|
||||
|
||||
/* Enumerant values begin at column 50. No tabs. */
|
||||
/* Enumeration values begin at column 50. Do not use tabs. */
|
||||
|
||||
/** Boolean False. */
|
||||
#define ALC_FALSE 0
|
||||
@@ -89,7 +121,7 @@ typedef void ALCvoid;
|
||||
/** Context attribute: <int> Hz. */
|
||||
#define ALC_REFRESH 0x1008
|
||||
|
||||
/** Context attribute: AL_TRUE or AL_FALSE. */
|
||||
/** Context attribute: AL_TRUE or AL_FALSE synchronous context? */
|
||||
#define ALC_SYNC 0x1009
|
||||
|
||||
/** Context attribute: <int> requested Mono (3D) Sources. */
|
||||
@@ -107,30 +139,32 @@ typedef void ALCvoid;
|
||||
/** Invalid context handle. */
|
||||
#define ALC_INVALID_CONTEXT 0xA002
|
||||
|
||||
/** Invalid enum parameter passed to an ALC call. */
|
||||
/** Invalid enumeration passed to an ALC call. */
|
||||
#define ALC_INVALID_ENUM 0xA003
|
||||
|
||||
/** Invalid value parameter passed to an ALC call. */
|
||||
/** Invalid value passed to an ALC call. */
|
||||
#define ALC_INVALID_VALUE 0xA004
|
||||
|
||||
/** Out of memory. */
|
||||
#define ALC_OUT_OF_MEMORY 0xA005
|
||||
|
||||
|
||||
/** Runtime ALC version. */
|
||||
/** Runtime ALC major version. */
|
||||
#define ALC_MAJOR_VERSION 0x1000
|
||||
/** Runtime ALC minor version. */
|
||||
#define ALC_MINOR_VERSION 0x1001
|
||||
|
||||
/** Context attribute list properties. */
|
||||
/** Context attribute list size. */
|
||||
#define ALC_ATTRIBUTES_SIZE 0x1002
|
||||
/** Context attribute list properties. */
|
||||
#define ALC_ALL_ATTRIBUTES 0x1003
|
||||
|
||||
/** String for the default device specifier. */
|
||||
#define ALC_DEFAULT_DEVICE_SPECIFIER 0x1004
|
||||
/**
|
||||
* String for the given device's specifier.
|
||||
* Device specifier string.
|
||||
*
|
||||
* If device handle is NULL, it is instead a null-char separated list of
|
||||
* If device handle is NULL, it is instead a null-character separated list of
|
||||
* strings of known device specifiers (list ends with an empty string).
|
||||
*/
|
||||
#define ALC_DEVICE_SPECIFIER 0x1005
|
||||
@@ -141,9 +175,9 @@ typedef void ALCvoid;
|
||||
/** Capture extension */
|
||||
#define ALC_EXT_CAPTURE 1
|
||||
/**
|
||||
* String for the given capture device's specifier.
|
||||
* Capture device specifier string.
|
||||
*
|
||||
* If device handle is NULL, it is instead a null-char separated list of
|
||||
* If device handle is NULL, it is instead a null-character separated list of
|
||||
* strings of known capture device specifiers (list ends with an empty string).
|
||||
*/
|
||||
#define ALC_CAPTURE_DEVICE_SPECIFIER 0x310
|
||||
@@ -158,80 +192,116 @@ typedef void ALCvoid;
|
||||
/** String for the default extended device specifier. */
|
||||
#define ALC_DEFAULT_ALL_DEVICES_SPECIFIER 0x1012
|
||||
/**
|
||||
* String for the given extended device's specifier.
|
||||
* Device's extended specifier string.
|
||||
*
|
||||
* If device handle is NULL, it is instead a null-char separated list of
|
||||
* If device handle is NULL, it is instead a null-character separated list of
|
||||
* strings of known extended device specifiers (list ends with an empty string).
|
||||
*/
|
||||
#define ALC_ALL_DEVICES_SPECIFIER 0x1013
|
||||
|
||||
|
||||
/** Context management. */
|
||||
ALC_API ALCcontext* ALC_APIENTRY alcCreateContext(ALCdevice *device, const ALCint* attrlist);
|
||||
ALC_API ALCboolean ALC_APIENTRY alcMakeContextCurrent(ALCcontext *context);
|
||||
ALC_API void ALC_APIENTRY alcProcessContext(ALCcontext *context);
|
||||
ALC_API void ALC_APIENTRY alcSuspendContext(ALCcontext *context);
|
||||
ALC_API void ALC_APIENTRY alcDestroyContext(ALCcontext *context);
|
||||
ALC_API ALCcontext* ALC_APIENTRY alcGetCurrentContext(void);
|
||||
ALC_API ALCdevice* ALC_APIENTRY alcGetContextsDevice(ALCcontext *context);
|
||||
#ifndef ALC_NO_PROTOTYPES
|
||||
/* Context management. */
|
||||
|
||||
/** Device management. */
|
||||
ALC_API ALCdevice* ALC_APIENTRY alcOpenDevice(const ALCchar *devicename);
|
||||
ALC_API ALCboolean ALC_APIENTRY alcCloseDevice(ALCdevice *device);
|
||||
/** Create and attach a context to the given device. */
|
||||
ALC_API ALCcontext* ALC_APIENTRY alcCreateContext(ALCdevice *device, const ALCint *attrlist) ALC_API_NOEXCEPT;
|
||||
/**
|
||||
* Makes the given context the active process-wide context. Passing NULL clears
|
||||
* the active context.
|
||||
*/
|
||||
ALC_API ALCboolean ALC_APIENTRY alcMakeContextCurrent(ALCcontext *context) ALC_API_NOEXCEPT;
|
||||
/** Resumes processing updates for the given context. */
|
||||
ALC_API void ALC_APIENTRY alcProcessContext(ALCcontext *context) ALC_API_NOEXCEPT;
|
||||
/** Suspends updates for the given context. */
|
||||
ALC_API void ALC_APIENTRY alcSuspendContext(ALCcontext *context) ALC_API_NOEXCEPT;
|
||||
/** Remove a context from its device and destroys it. */
|
||||
ALC_API void ALC_APIENTRY alcDestroyContext(ALCcontext *context) ALC_API_NOEXCEPT;
|
||||
/** Returns the currently active context. */
|
||||
ALC_API ALCcontext* ALC_APIENTRY alcGetCurrentContext(void) ALC_API_NOEXCEPT;
|
||||
/** Returns the device that a particular context is attached to. */
|
||||
ALC_API ALCdevice* ALC_APIENTRY alcGetContextsDevice(ALCcontext *context) ALC_API_NOEXCEPT;
|
||||
|
||||
/* Device management. */
|
||||
|
||||
/** Opens the named playback device. */
|
||||
ALC_API ALCdevice* ALC_APIENTRY alcOpenDevice(const ALCchar *devicename) ALC_API_NOEXCEPT;
|
||||
/** Closes the given playback device. */
|
||||
ALC_API ALCboolean ALC_APIENTRY alcCloseDevice(ALCdevice *device) ALC_API_NOEXCEPT;
|
||||
|
||||
/* Error support. */
|
||||
|
||||
/** Obtain the most recent Device error. */
|
||||
ALC_API ALCenum ALC_APIENTRY alcGetError(ALCdevice *device) ALC_API_NOEXCEPT;
|
||||
|
||||
/* Extension support. */
|
||||
|
||||
/**
|
||||
* Error support.
|
||||
*
|
||||
* Obtain the most recent Device error.
|
||||
* Query for the presence of an extension on the device. Pass a NULL device to
|
||||
* query a device-inspecific extension.
|
||||
*/
|
||||
ALC_API ALCenum ALC_APIENTRY alcGetError(ALCdevice *device);
|
||||
ALC_API ALCboolean ALC_APIENTRY alcIsExtensionPresent(ALCdevice *device, const ALCchar *extname) ALC_API_NOEXCEPT;
|
||||
/**
|
||||
* Retrieve the address of a function. Given a non-NULL device, the returned
|
||||
* function may be device-specific.
|
||||
*/
|
||||
ALC_API ALCvoid* ALC_APIENTRY alcGetProcAddress(ALCdevice *device, const ALCchar *funcname) ALC_API_NOEXCEPT;
|
||||
/**
|
||||
* Retrieve the value of an enum. Given a non-NULL device, the returned value
|
||||
* may be device-specific.
|
||||
*/
|
||||
ALC_API ALCenum ALC_APIENTRY alcGetEnumValue(ALCdevice *device, const ALCchar *enumname) ALC_API_NOEXCEPT;
|
||||
|
||||
/* Query functions. */
|
||||
|
||||
/** Returns information about the device, and error strings. */
|
||||
ALC_API const ALCchar* ALC_APIENTRY alcGetString(ALCdevice *device, ALCenum param) ALC_API_NOEXCEPT;
|
||||
/** Returns information about the device and the version of OpenAL. */
|
||||
ALC_API void ALC_APIENTRY alcGetIntegerv(ALCdevice *device, ALCenum param, ALCsizei size, ALCint *values) ALC_API_NOEXCEPT;
|
||||
|
||||
/* Capture functions. */
|
||||
|
||||
/**
|
||||
* Extension support.
|
||||
*
|
||||
* Query for the presence of an extension, and obtain any appropriate
|
||||
* function pointers and enum values.
|
||||
* Opens the named capture device with the given frequency, format, and buffer
|
||||
* size.
|
||||
*/
|
||||
ALC_API ALCboolean ALC_APIENTRY alcIsExtensionPresent(ALCdevice *device, const ALCchar *extname);
|
||||
ALC_API void* ALC_APIENTRY alcGetProcAddress(ALCdevice *device, const ALCchar *funcname);
|
||||
ALC_API ALCenum ALC_APIENTRY alcGetEnumValue(ALCdevice *device, const ALCchar *enumname);
|
||||
ALC_API ALCdevice* ALC_APIENTRY alcCaptureOpenDevice(const ALCchar *devicename, ALCuint frequency, ALCenum format, ALCsizei buffersize) ALC_API_NOEXCEPT;
|
||||
/** Closes the given capture device. */
|
||||
ALC_API ALCboolean ALC_APIENTRY alcCaptureCloseDevice(ALCdevice *device) ALC_API_NOEXCEPT;
|
||||
/** Starts capturing samples into the device buffer. */
|
||||
ALC_API void ALC_APIENTRY alcCaptureStart(ALCdevice *device) ALC_API_NOEXCEPT;
|
||||
/** Stops capturing samples. Samples in the device buffer remain available. */
|
||||
ALC_API void ALC_APIENTRY alcCaptureStop(ALCdevice *device) ALC_API_NOEXCEPT;
|
||||
/** Reads samples from the device buffer. */
|
||||
ALC_API void ALC_APIENTRY alcCaptureSamples(ALCdevice *device, ALCvoid *buffer, ALCsizei samples) ALC_API_NOEXCEPT;
|
||||
#endif /* ALC_NO_PROTOTYPES */
|
||||
|
||||
/** Query function. */
|
||||
ALC_API const ALCchar* ALC_APIENTRY alcGetString(ALCdevice *device, ALCenum param);
|
||||
ALC_API void ALC_APIENTRY alcGetIntegerv(ALCdevice *device, ALCenum param, ALCsizei size, ALCint *values);
|
||||
/* Pointer-to-function types, useful for storing dynamically loaded ALC entry
|
||||
* points.
|
||||
*/
|
||||
typedef ALCcontext* (ALC_APIENTRY *LPALCCREATECONTEXT)(ALCdevice *device, const ALCint *attrlist) ALC_API_NOEXCEPT17;
|
||||
typedef ALCboolean (ALC_APIENTRY *LPALCMAKECONTEXTCURRENT)(ALCcontext *context) ALC_API_NOEXCEPT17;
|
||||
typedef void (ALC_APIENTRY *LPALCPROCESSCONTEXT)(ALCcontext *context) ALC_API_NOEXCEPT17;
|
||||
typedef void (ALC_APIENTRY *LPALCSUSPENDCONTEXT)(ALCcontext *context) ALC_API_NOEXCEPT17;
|
||||
typedef void (ALC_APIENTRY *LPALCDESTROYCONTEXT)(ALCcontext *context) ALC_API_NOEXCEPT17;
|
||||
typedef ALCcontext* (ALC_APIENTRY *LPALCGETCURRENTCONTEXT)(void) ALC_API_NOEXCEPT17;
|
||||
typedef ALCdevice* (ALC_APIENTRY *LPALCGETCONTEXTSDEVICE)(ALCcontext *context) ALC_API_NOEXCEPT17;
|
||||
typedef ALCdevice* (ALC_APIENTRY *LPALCOPENDEVICE)(const ALCchar *devicename) ALC_API_NOEXCEPT17;
|
||||
typedef ALCboolean (ALC_APIENTRY *LPALCCLOSEDEVICE)(ALCdevice *device) ALC_API_NOEXCEPT17;
|
||||
typedef ALCenum (ALC_APIENTRY *LPALCGETERROR)(ALCdevice *device) ALC_API_NOEXCEPT17;
|
||||
typedef ALCboolean (ALC_APIENTRY *LPALCISEXTENSIONPRESENT)(ALCdevice *device, const ALCchar *extname) ALC_API_NOEXCEPT17;
|
||||
typedef ALCvoid* (ALC_APIENTRY *LPALCGETPROCADDRESS)(ALCdevice *device, const ALCchar *funcname) ALC_API_NOEXCEPT17;
|
||||
typedef ALCenum (ALC_APIENTRY *LPALCGETENUMVALUE)(ALCdevice *device, const ALCchar *enumname) ALC_API_NOEXCEPT17;
|
||||
typedef const ALCchar* (ALC_APIENTRY *LPALCGETSTRING)(ALCdevice *device, ALCenum param) ALC_API_NOEXCEPT17;
|
||||
typedef void (ALC_APIENTRY *LPALCGETINTEGERV)(ALCdevice *device, ALCenum param, ALCsizei size, ALCint *values) ALC_API_NOEXCEPT17;
|
||||
typedef ALCdevice* (ALC_APIENTRY *LPALCCAPTUREOPENDEVICE)(const ALCchar *devicename, ALCuint frequency, ALCenum format, ALCsizei buffersize) ALC_API_NOEXCEPT17;
|
||||
typedef ALCboolean (ALC_APIENTRY *LPALCCAPTURECLOSEDEVICE)(ALCdevice *device) ALC_API_NOEXCEPT17;
|
||||
typedef void (ALC_APIENTRY *LPALCCAPTURESTART)(ALCdevice *device) ALC_API_NOEXCEPT17;
|
||||
typedef void (ALC_APIENTRY *LPALCCAPTURESTOP)(ALCdevice *device) ALC_API_NOEXCEPT17;
|
||||
typedef void (ALC_APIENTRY *LPALCCAPTURESAMPLES)(ALCdevice *device, ALCvoid *buffer, ALCsizei samples) ALC_API_NOEXCEPT17;
|
||||
|
||||
/** Capture function. */
|
||||
ALC_API ALCdevice* ALC_APIENTRY alcCaptureOpenDevice(const ALCchar *devicename, ALCuint frequency, ALCenum format, ALCsizei buffersize);
|
||||
ALC_API ALCboolean ALC_APIENTRY alcCaptureCloseDevice(ALCdevice *device);
|
||||
ALC_API void ALC_APIENTRY alcCaptureStart(ALCdevice *device);
|
||||
ALC_API void ALC_APIENTRY alcCaptureStop(ALCdevice *device);
|
||||
ALC_API void ALC_APIENTRY alcCaptureSamples(ALCdevice *device, ALCvoid *buffer, ALCsizei samples);
|
||||
|
||||
/** Pointer-to-function type, useful for dynamically getting ALC entry points. */
|
||||
typedef ALCcontext* (ALC_APIENTRY *LPALCCREATECONTEXT)(ALCdevice *device, const ALCint *attrlist);
|
||||
typedef ALCboolean (ALC_APIENTRY *LPALCMAKECONTEXTCURRENT)(ALCcontext *context);
|
||||
typedef void (ALC_APIENTRY *LPALCPROCESSCONTEXT)(ALCcontext *context);
|
||||
typedef void (ALC_APIENTRY *LPALCSUSPENDCONTEXT)(ALCcontext *context);
|
||||
typedef void (ALC_APIENTRY *LPALCDESTROYCONTEXT)(ALCcontext *context);
|
||||
typedef ALCcontext* (ALC_APIENTRY *LPALCGETCURRENTCONTEXT)(void);
|
||||
typedef ALCdevice* (ALC_APIENTRY *LPALCGETCONTEXTSDEVICE)(ALCcontext *context);
|
||||
typedef ALCdevice* (ALC_APIENTRY *LPALCOPENDEVICE)(const ALCchar *devicename);
|
||||
typedef ALCboolean (ALC_APIENTRY *LPALCCLOSEDEVICE)(ALCdevice *device);
|
||||
typedef ALCenum (ALC_APIENTRY *LPALCGETERROR)(ALCdevice *device);
|
||||
typedef ALCboolean (ALC_APIENTRY *LPALCISEXTENSIONPRESENT)(ALCdevice *device, const ALCchar *extname);
|
||||
typedef void* (ALC_APIENTRY *LPALCGETPROCADDRESS)(ALCdevice *device, const ALCchar *funcname);
|
||||
typedef ALCenum (ALC_APIENTRY *LPALCGETENUMVALUE)(ALCdevice *device, const ALCchar *enumname);
|
||||
typedef const ALCchar* (ALC_APIENTRY *LPALCGETSTRING)(ALCdevice *device, ALCenum param);
|
||||
typedef void (ALC_APIENTRY *LPALCGETINTEGERV)(ALCdevice *device, ALCenum param, ALCsizei size, ALCint *values);
|
||||
typedef ALCdevice* (ALC_APIENTRY *LPALCCAPTUREOPENDEVICE)(const ALCchar *devicename, ALCuint frequency, ALCenum format, ALCsizei buffersize);
|
||||
typedef ALCboolean (ALC_APIENTRY *LPALCCAPTURECLOSEDEVICE)(ALCdevice *device);
|
||||
typedef void (ALC_APIENTRY *LPALCCAPTURESTART)(ALCdevice *device);
|
||||
typedef void (ALC_APIENTRY *LPALCCAPTURESTOP)(ALCdevice *device);
|
||||
typedef void (ALC_APIENTRY *LPALCCAPTURESAMPLES)(ALCdevice *device, ALCvoid *buffer, ALCsizei samples);
|
||||
|
||||
#if defined(__cplusplus)
|
||||
}
|
||||
#ifdef __cplusplus
|
||||
} /* extern "C" */
|
||||
#endif
|
||||
/* NOLINTEND */
|
||||
|
||||
#endif /* AL_ALC_H */
|
||||
+817
-80
@@ -1,38 +1,22 @@
|
||||
/**
|
||||
* OpenAL cross platform audio library
|
||||
* Copyright (C) 2008 by authors.
|
||||
* This library is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU Library General Public
|
||||
* License as published by the Free Software Foundation; either
|
||||
* version 2 of the License, or (at your option) any later version.
|
||||
*
|
||||
* This library is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
* Library General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Library General Public
|
||||
* License along with this library; if not, write to the
|
||||
* Free Software Foundation, Inc., 59 Temple Place - Suite 330,
|
||||
* Boston, MA 02111-1307, USA.
|
||||
* Or go to http://www.gnu.org/copyleft/lgpl.html
|
||||
*/
|
||||
|
||||
#ifndef AL_ALEXT_H
|
||||
#define AL_ALEXT_H
|
||||
|
||||
/* NOLINTBEGIN */
|
||||
#include <stddef.h>
|
||||
/* Define int64_t and uint64_t types */
|
||||
#if defined(__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
|
||||
#include <inttypes.h>
|
||||
#elif defined(_WIN32) && defined(__GNUC__)
|
||||
/* Define int64 and uint64 types */
|
||||
#if (defined(__STDC_VERSION__) && __STDC_VERSION__ >= 199901L) || \
|
||||
(defined(__cplusplus) && __cplusplus >= 201103L)
|
||||
#include <stdint.h>
|
||||
typedef int64_t _alsoft_int64_t;
|
||||
typedef uint64_t _alsoft_uint64_t;
|
||||
#elif defined(_WIN32)
|
||||
typedef __int64 int64_t;
|
||||
typedef unsigned __int64 uint64_t;
|
||||
typedef __int64 _alsoft_int64_t;
|
||||
typedef unsigned __int64 _alsoft_uint64_t;
|
||||
#else
|
||||
/* Fallback if nothing above works */
|
||||
#include <inttypes.h>
|
||||
#include <stdint.h>
|
||||
typedef int64_t _alsoft_int64_t;
|
||||
typedef uint64_t _alsoft_uint64_t;
|
||||
#endif
|
||||
|
||||
#include "alc.h"
|
||||
@@ -42,6 +26,8 @@ typedef unsigned __int64 uint64_t;
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
struct _GUID;
|
||||
|
||||
#ifndef AL_LOKI_IMA_ADPCM_format
|
||||
#define AL_LOKI_IMA_ADPCM_format 1
|
||||
#define AL_FORMAT_IMA_ADPCM_MONO16_EXT 0x10000
|
||||
@@ -97,6 +83,31 @@ extern "C" {
|
||||
|
||||
#ifndef AL_EXT_MCFORMATS
|
||||
#define AL_EXT_MCFORMATS 1
|
||||
/* Provides support for surround sound buffer formats with 8, 16, and 32-bit
|
||||
* samples.
|
||||
*
|
||||
* QUAD8: Unsigned 8-bit, Quadraphonic (Front Left, Front Right, Rear Left,
|
||||
* Rear Right).
|
||||
* QUAD16: Signed 16-bit, Quadraphonic.
|
||||
* QUAD32: 32-bit float, Quadraphonic.
|
||||
* REAR8: Unsigned 8-bit, Rear Stereo (Rear Left, Rear Right).
|
||||
* REAR16: Signed 16-bit, Rear Stereo.
|
||||
* REAR32: 32-bit float, Rear Stereo.
|
||||
* 51CHN8: Unsigned 8-bit, 5.1 Surround (Front Left, Front Right, Front Center,
|
||||
* LFE, Side Left, Side Right). Note that some audio systems may label
|
||||
* 5.1's Side channels as Rear or Surround; they are equivalent for the
|
||||
* purposes of this extension.
|
||||
* 51CHN16: Signed 16-bit, 5.1 Surround.
|
||||
* 51CHN32: 32-bit float, 5.1 Surround.
|
||||
* 61CHN8: Unsigned 8-bit, 6.1 Surround (Front Left, Front Right, Front Center,
|
||||
* LFE, Rear Center, Side Left, Side Right).
|
||||
* 61CHN16: Signed 16-bit, 6.1 Surround.
|
||||
* 61CHN32: 32-bit float, 6.1 Surround.
|
||||
* 71CHN8: Unsigned 8-bit, 7.1 Surround (Front Left, Front Right, Front Center,
|
||||
* LFE, Rear Left, Rear Right, Side Left, Side Right).
|
||||
* 71CHN16: Signed 16-bit, 7.1 Surround.
|
||||
* 71CHN32: 32-bit float, 7.1 Surround.
|
||||
*/
|
||||
#define AL_FORMAT_QUAD8 0x1204
|
||||
#define AL_FORMAT_QUAD16 0x1205
|
||||
#define AL_FORMAT_QUAD32 0x1206
|
||||
@@ -133,9 +144,9 @@ extern "C" {
|
||||
|
||||
#ifndef AL_EXT_STATIC_BUFFER
|
||||
#define AL_EXT_STATIC_BUFFER 1
|
||||
typedef ALvoid (AL_APIENTRY*PFNALBUFFERDATASTATICPROC)(const ALint,ALenum,ALvoid*,ALsizei,ALsizei);
|
||||
typedef void (AL_APIENTRY*PFNALBUFFERDATASTATICPROC)(const ALuint,ALenum,ALvoid*,ALsizei,ALsizei) AL_API_NOEXCEPT17;
|
||||
#ifdef AL_ALEXT_PROTOTYPES
|
||||
AL_API ALvoid AL_APIENTRY alBufferDataStatic(const ALint buffer, ALenum format, ALvoid *data, ALsizei len, ALsizei freq);
|
||||
void AL_APIENTRY alBufferDataStatic(const ALuint buffer, ALenum format, ALvoid *data, ALsizei size, ALsizei freq) AL_API_NOEXCEPT;
|
||||
#endif
|
||||
#endif
|
||||
|
||||
@@ -151,11 +162,11 @@ AL_API ALvoid AL_APIENTRY alBufferDataStatic(const ALint buffer, ALenum format,
|
||||
|
||||
#ifndef ALC_EXT_thread_local_context
|
||||
#define ALC_EXT_thread_local_context 1
|
||||
typedef ALCboolean (ALC_APIENTRY*PFNALCSETTHREADCONTEXTPROC)(ALCcontext *context);
|
||||
typedef ALCcontext* (ALC_APIENTRY*PFNALCGETTHREADCONTEXTPROC)(void);
|
||||
typedef ALCboolean (ALC_APIENTRY*PFNALCSETTHREADCONTEXTPROC)(ALCcontext *context) ALC_API_NOEXCEPT17;
|
||||
typedef ALCcontext* (ALC_APIENTRY*PFNALCGETTHREADCONTEXTPROC)(void) ALC_API_NOEXCEPT17;
|
||||
#ifdef AL_ALEXT_PROTOTYPES
|
||||
ALC_API ALCboolean ALC_APIENTRY alcSetThreadContext(ALCcontext *context);
|
||||
ALC_API ALCcontext* ALC_APIENTRY alcGetThreadContext(void);
|
||||
ALC_API ALCboolean ALC_APIENTRY alcSetThreadContext(ALCcontext *context) ALC_API_NOEXCEPT;
|
||||
ALC_API ALCcontext* ALC_APIENTRY alcGetThreadContext(void) ALC_API_NOEXCEPT;
|
||||
#endif
|
||||
#endif
|
||||
|
||||
@@ -168,9 +179,9 @@ ALC_API ALCcontext* ALC_APIENTRY alcGetThreadContext(void);
|
||||
#define AL_SOFT_buffer_sub_data 1
|
||||
#define AL_BYTE_RW_OFFSETS_SOFT 0x1031
|
||||
#define AL_SAMPLE_RW_OFFSETS_SOFT 0x1032
|
||||
typedef ALvoid (AL_APIENTRY*PFNALBUFFERSUBDATASOFTPROC)(ALuint,ALenum,const ALvoid*,ALsizei,ALsizei);
|
||||
typedef void (AL_APIENTRY*PFNALBUFFERSUBDATASOFTPROC)(ALuint,ALenum,const ALvoid*,ALsizei,ALsizei) AL_API_NOEXCEPT17;
|
||||
#ifdef AL_ALEXT_PROTOTYPES
|
||||
AL_API ALvoid AL_APIENTRY alBufferSubDataSOFT(ALuint buffer,ALenum format,const ALvoid *data,ALsizei offset,ALsizei length);
|
||||
AL_API void AL_APIENTRY alBufferSubDataSOFT(ALuint buffer,ALenum format,const ALvoid *data,ALsizei offset,ALsizei length) AL_API_NOEXCEPT;
|
||||
#endif
|
||||
#endif
|
||||
|
||||
@@ -187,12 +198,12 @@ AL_API ALvoid AL_APIENTRY alBufferSubDataSOFT(ALuint buffer,ALenum format,const
|
||||
#define AL_FOLDBACK_EVENT_STOP 0x4113
|
||||
#define AL_FOLDBACK_MODE_MONO 0x4101
|
||||
#define AL_FOLDBACK_MODE_STEREO 0x4102
|
||||
typedef void (AL_APIENTRY*LPALFOLDBACKCALLBACK)(ALenum,ALsizei);
|
||||
typedef void (AL_APIENTRY*LPALREQUESTFOLDBACKSTART)(ALenum,ALsizei,ALsizei,ALfloat*,LPALFOLDBACKCALLBACK);
|
||||
typedef void (AL_APIENTRY*LPALREQUESTFOLDBACKSTOP)(void);
|
||||
typedef void (AL_APIENTRY*LPALFOLDBACKCALLBACK)(ALenum,ALsizei) AL_API_NOEXCEPT17;
|
||||
typedef void (AL_APIENTRY*LPALREQUESTFOLDBACKSTART)(ALenum,ALsizei,ALsizei,ALfloat*,LPALFOLDBACKCALLBACK) AL_API_NOEXCEPT17;
|
||||
typedef void (AL_APIENTRY*LPALREQUESTFOLDBACKSTOP)(void) AL_API_NOEXCEPT17;
|
||||
#ifdef AL_ALEXT_PROTOTYPES
|
||||
AL_API void AL_APIENTRY alRequestFoldbackStart(ALenum mode,ALsizei count,ALsizei length,ALfloat *mem,LPALFOLDBACKCALLBACK callback);
|
||||
AL_API void AL_APIENTRY alRequestFoldbackStop(void);
|
||||
AL_API void AL_APIENTRY alRequestFoldbackStart(ALenum mode,ALsizei count,ALsizei length,ALfloat *mem,LPALFOLDBACKCALLBACK callback) AL_API_NOEXCEPT;
|
||||
AL_API void AL_APIENTRY alRequestFoldbackStop(void) AL_API_NOEXCEPT;
|
||||
#endif
|
||||
#endif
|
||||
|
||||
@@ -255,15 +266,15 @@ AL_API void AL_APIENTRY alRequestFoldbackStop(void);
|
||||
#define AL_SAMPLE_LENGTH_SOFT 0x200A
|
||||
#define AL_SEC_LENGTH_SOFT 0x200B
|
||||
|
||||
typedef void (AL_APIENTRY*LPALBUFFERSAMPLESSOFT)(ALuint,ALuint,ALenum,ALsizei,ALenum,ALenum,const ALvoid*);
|
||||
typedef void (AL_APIENTRY*LPALBUFFERSUBSAMPLESSOFT)(ALuint,ALsizei,ALsizei,ALenum,ALenum,const ALvoid*);
|
||||
typedef void (AL_APIENTRY*LPALGETBUFFERSAMPLESSOFT)(ALuint,ALsizei,ALsizei,ALenum,ALenum,ALvoid*);
|
||||
typedef ALboolean (AL_APIENTRY*LPALISBUFFERFORMATSUPPORTEDSOFT)(ALenum);
|
||||
typedef void (AL_APIENTRY*LPALBUFFERSAMPLESSOFT)(ALuint,ALuint,ALenum,ALsizei,ALenum,ALenum,const ALvoid*) AL_API_NOEXCEPT17;
|
||||
typedef void (AL_APIENTRY*LPALBUFFERSUBSAMPLESSOFT)(ALuint,ALsizei,ALsizei,ALenum,ALenum,const ALvoid*) AL_API_NOEXCEPT17;
|
||||
typedef void (AL_APIENTRY*LPALGETBUFFERSAMPLESSOFT)(ALuint,ALsizei,ALsizei,ALenum,ALenum,ALvoid*) AL_API_NOEXCEPT17;
|
||||
typedef ALboolean (AL_APIENTRY*LPALISBUFFERFORMATSUPPORTEDSOFT)(ALenum) AL_API_NOEXCEPT17;
|
||||
#ifdef AL_ALEXT_PROTOTYPES
|
||||
AL_API void AL_APIENTRY alBufferSamplesSOFT(ALuint buffer, ALuint samplerate, ALenum internalformat, ALsizei samples, ALenum channels, ALenum type, const ALvoid *data);
|
||||
AL_API void AL_APIENTRY alBufferSubSamplesSOFT(ALuint buffer, ALsizei offset, ALsizei samples, ALenum channels, ALenum type, const ALvoid *data);
|
||||
AL_API void AL_APIENTRY alGetBufferSamplesSOFT(ALuint buffer, ALsizei offset, ALsizei samples, ALenum channels, ALenum type, ALvoid *data);
|
||||
AL_API ALboolean AL_APIENTRY alIsBufferFormatSupportedSOFT(ALenum format);
|
||||
AL_API void AL_APIENTRY alBufferSamplesSOFT(ALuint buffer, ALuint samplerate, ALenum internalformat, ALsizei samples, ALenum channels, ALenum type, const ALvoid *data) AL_API_NOEXCEPT;
|
||||
AL_API void AL_APIENTRY alBufferSubSamplesSOFT(ALuint buffer, ALsizei offset, ALsizei samples, ALenum channels, ALenum type, const ALvoid *data) AL_API_NOEXCEPT;
|
||||
AL_API void AL_APIENTRY alGetBufferSamplesSOFT(ALuint buffer, ALsizei offset, ALsizei samples, ALenum channels, ALenum type, ALvoid *data) AL_API_NOEXCEPT;
|
||||
AL_API ALboolean AL_APIENTRY alIsBufferFormatSupportedSOFT(ALenum format) AL_API_NOEXCEPT;
|
||||
#endif
|
||||
#endif
|
||||
|
||||
@@ -294,13 +305,13 @@ AL_API ALboolean AL_APIENTRY alIsBufferFormatSupportedSOFT(ALenum format);
|
||||
#define ALC_6POINT1_SOFT 0x1505
|
||||
#define ALC_7POINT1_SOFT 0x1506
|
||||
|
||||
typedef ALCdevice* (ALC_APIENTRY*LPALCLOOPBACKOPENDEVICESOFT)(const ALCchar*);
|
||||
typedef ALCboolean (ALC_APIENTRY*LPALCISRENDERFORMATSUPPORTEDSOFT)(ALCdevice*,ALCsizei,ALCenum,ALCenum);
|
||||
typedef void (ALC_APIENTRY*LPALCRENDERSAMPLESSOFT)(ALCdevice*,ALCvoid*,ALCsizei);
|
||||
typedef ALCdevice* (ALC_APIENTRY*LPALCLOOPBACKOPENDEVICESOFT)(const ALCchar*) ALC_API_NOEXCEPT17;
|
||||
typedef ALCboolean (ALC_APIENTRY*LPALCISRENDERFORMATSUPPORTEDSOFT)(ALCdevice*,ALCsizei,ALCenum,ALCenum) ALC_API_NOEXCEPT17;
|
||||
typedef void (ALC_APIENTRY*LPALCRENDERSAMPLESSOFT)(ALCdevice*,ALCvoid*,ALCsizei) ALC_API_NOEXCEPT17;
|
||||
#ifdef AL_ALEXT_PROTOTYPES
|
||||
ALC_API ALCdevice* ALC_APIENTRY alcLoopbackOpenDeviceSOFT(const ALCchar *deviceName);
|
||||
ALC_API ALCboolean ALC_APIENTRY alcIsRenderFormatSupportedSOFT(ALCdevice *device, ALCsizei freq, ALCenum channels, ALCenum type);
|
||||
ALC_API void ALC_APIENTRY alcRenderSamplesSOFT(ALCdevice *device, ALCvoid *buffer, ALCsizei samples);
|
||||
ALC_API ALCdevice* ALC_APIENTRY alcLoopbackOpenDeviceSOFT(const ALCchar *deviceName) AL_API_NOEXCEPT;
|
||||
ALC_API ALCboolean ALC_APIENTRY alcIsRenderFormatSupportedSOFT(ALCdevice *device, ALCsizei freq, ALCenum channels, ALCenum type) AL_API_NOEXCEPT;
|
||||
ALC_API void ALC_APIENTRY alcRenderSamplesSOFT(ALCdevice *device, ALCvoid *buffer, ALCsizei samples) AL_API_NOEXCEPT;
|
||||
#endif
|
||||
#endif
|
||||
|
||||
@@ -318,38 +329,764 @@ ALC_API void ALC_APIENTRY alcRenderSamplesSOFT(ALCdevice *device, ALCvoid *buffe
|
||||
#define AL_SOFT_source_latency 1
|
||||
#define AL_SAMPLE_OFFSET_LATENCY_SOFT 0x1200
|
||||
#define AL_SEC_OFFSET_LATENCY_SOFT 0x1201
|
||||
typedef int64_t ALint64SOFT;
|
||||
typedef uint64_t ALuint64SOFT;
|
||||
typedef void (AL_APIENTRY*LPALSOURCEDSOFT)(ALuint,ALenum,ALdouble);
|
||||
typedef void (AL_APIENTRY*LPALSOURCE3DSOFT)(ALuint,ALenum,ALdouble,ALdouble,ALdouble);
|
||||
typedef void (AL_APIENTRY*LPALSOURCEDVSOFT)(ALuint,ALenum,const ALdouble*);
|
||||
typedef void (AL_APIENTRY*LPALGETSOURCEDSOFT)(ALuint,ALenum,ALdouble*);
|
||||
typedef void (AL_APIENTRY*LPALGETSOURCE3DSOFT)(ALuint,ALenum,ALdouble*,ALdouble*,ALdouble*);
|
||||
typedef void (AL_APIENTRY*LPALGETSOURCEDVSOFT)(ALuint,ALenum,ALdouble*);
|
||||
typedef void (AL_APIENTRY*LPALSOURCEI64SOFT)(ALuint,ALenum,ALint64SOFT);
|
||||
typedef void (AL_APIENTRY*LPALSOURCE3I64SOFT)(ALuint,ALenum,ALint64SOFT,ALint64SOFT,ALint64SOFT);
|
||||
typedef void (AL_APIENTRY*LPALSOURCEI64VSOFT)(ALuint,ALenum,const ALint64SOFT*);
|
||||
typedef void (AL_APIENTRY*LPALGETSOURCEI64SOFT)(ALuint,ALenum,ALint64SOFT*);
|
||||
typedef void (AL_APIENTRY*LPALGETSOURCE3I64SOFT)(ALuint,ALenum,ALint64SOFT*,ALint64SOFT*,ALint64SOFT*);
|
||||
typedef void (AL_APIENTRY*LPALGETSOURCEI64VSOFT)(ALuint,ALenum,ALint64SOFT*);
|
||||
typedef _alsoft_int64_t ALint64SOFT;
|
||||
typedef _alsoft_uint64_t ALuint64SOFT;
|
||||
typedef void (AL_APIENTRY*LPALSOURCEDSOFT)(ALuint,ALenum,ALdouble) AL_API_NOEXCEPT17;
|
||||
typedef void (AL_APIENTRY*LPALSOURCE3DSOFT)(ALuint,ALenum,ALdouble,ALdouble,ALdouble) AL_API_NOEXCEPT17;
|
||||
typedef void (AL_APIENTRY*LPALSOURCEDVSOFT)(ALuint,ALenum,const ALdouble*) AL_API_NOEXCEPT17;
|
||||
typedef void (AL_APIENTRY*LPALGETSOURCEDSOFT)(ALuint,ALenum,ALdouble*) AL_API_NOEXCEPT17;
|
||||
typedef void (AL_APIENTRY*LPALGETSOURCE3DSOFT)(ALuint,ALenum,ALdouble*,ALdouble*,ALdouble*) AL_API_NOEXCEPT17;
|
||||
typedef void (AL_APIENTRY*LPALGETSOURCEDVSOFT)(ALuint,ALenum,ALdouble*) AL_API_NOEXCEPT17;
|
||||
typedef void (AL_APIENTRY*LPALSOURCEI64SOFT)(ALuint,ALenum,ALint64SOFT) AL_API_NOEXCEPT17;
|
||||
typedef void (AL_APIENTRY*LPALSOURCE3I64SOFT)(ALuint,ALenum,ALint64SOFT,ALint64SOFT,ALint64SOFT) AL_API_NOEXCEPT17;
|
||||
typedef void (AL_APIENTRY*LPALSOURCEI64VSOFT)(ALuint,ALenum,const ALint64SOFT*) AL_API_NOEXCEPT17;
|
||||
typedef void (AL_APIENTRY*LPALGETSOURCEI64SOFT)(ALuint,ALenum,ALint64SOFT*) AL_API_NOEXCEPT17;
|
||||
typedef void (AL_APIENTRY*LPALGETSOURCE3I64SOFT)(ALuint,ALenum,ALint64SOFT*,ALint64SOFT*,ALint64SOFT*) AL_API_NOEXCEPT17;
|
||||
typedef void (AL_APIENTRY*LPALGETSOURCEI64VSOFT)(ALuint,ALenum,ALint64SOFT*) AL_API_NOEXCEPT17;
|
||||
#ifdef AL_ALEXT_PROTOTYPES
|
||||
AL_API void AL_APIENTRY alSourcedSOFT(ALuint source, ALenum param, ALdouble value);
|
||||
AL_API void AL_APIENTRY alSource3dSOFT(ALuint source, ALenum param, ALdouble value1, ALdouble value2, ALdouble value3);
|
||||
AL_API void AL_APIENTRY alSourcedvSOFT(ALuint source, ALenum param, const ALdouble *values);
|
||||
AL_API void AL_APIENTRY alGetSourcedSOFT(ALuint source, ALenum param, ALdouble *value);
|
||||
AL_API void AL_APIENTRY alGetSource3dSOFT(ALuint source, ALenum param, ALdouble *value1, ALdouble *value2, ALdouble *value3);
|
||||
AL_API void AL_APIENTRY alGetSourcedvSOFT(ALuint source, ALenum param, ALdouble *values);
|
||||
AL_API void AL_APIENTRY alSourcei64SOFT(ALuint source, ALenum param, ALint64SOFT value);
|
||||
AL_API void AL_APIENTRY alSource3i64SOFT(ALuint source, ALenum param, ALint64SOFT value1, ALint64SOFT value2, ALint64SOFT value3);
|
||||
AL_API void AL_APIENTRY alSourcei64vSOFT(ALuint source, ALenum param, const ALint64SOFT *values);
|
||||
AL_API void AL_APIENTRY alGetSourcei64SOFT(ALuint source, ALenum param, ALint64SOFT *value);
|
||||
AL_API void AL_APIENTRY alGetSource3i64SOFT(ALuint source, ALenum param, ALint64SOFT *value1, ALint64SOFT *value2, ALint64SOFT *value3);
|
||||
AL_API void AL_APIENTRY alGetSourcei64vSOFT(ALuint source, ALenum param, ALint64SOFT *values);
|
||||
AL_API void AL_APIENTRY alSourcedSOFT(ALuint source, ALenum param, ALdouble value) AL_API_NOEXCEPT;
|
||||
AL_API void AL_APIENTRY alSource3dSOFT(ALuint source, ALenum param, ALdouble value1, ALdouble value2, ALdouble value3) AL_API_NOEXCEPT;
|
||||
AL_API void AL_APIENTRY alSourcedvSOFT(ALuint source, ALenum param, const ALdouble *values) AL_API_NOEXCEPT;
|
||||
AL_API void AL_APIENTRY alGetSourcedSOFT(ALuint source, ALenum param, ALdouble *value) AL_API_NOEXCEPT;
|
||||
AL_API void AL_APIENTRY alGetSource3dSOFT(ALuint source, ALenum param, ALdouble *value1, ALdouble *value2, ALdouble *value3) AL_API_NOEXCEPT;
|
||||
AL_API void AL_APIENTRY alGetSourcedvSOFT(ALuint source, ALenum param, ALdouble *values) AL_API_NOEXCEPT;
|
||||
AL_API void AL_APIENTRY alSourcei64SOFT(ALuint source, ALenum param, ALint64SOFT value) AL_API_NOEXCEPT;
|
||||
AL_API void AL_APIENTRY alSource3i64SOFT(ALuint source, ALenum param, ALint64SOFT value1, ALint64SOFT value2, ALint64SOFT value3) AL_API_NOEXCEPT;
|
||||
AL_API void AL_APIENTRY alSourcei64vSOFT(ALuint source, ALenum param, const ALint64SOFT *values) AL_API_NOEXCEPT;
|
||||
AL_API void AL_APIENTRY alGetSourcei64SOFT(ALuint source, ALenum param, ALint64SOFT *value) AL_API_NOEXCEPT;
|
||||
AL_API void AL_APIENTRY alGetSource3i64SOFT(ALuint source, ALenum param, ALint64SOFT *value1, ALint64SOFT *value2, ALint64SOFT *value3) AL_API_NOEXCEPT;
|
||||
AL_API void AL_APIENTRY alGetSourcei64vSOFT(ALuint source, ALenum param, ALint64SOFT *values) AL_API_NOEXCEPT;
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#ifndef ALC_EXT_DEFAULT_FILTER_ORDER
|
||||
#define ALC_EXT_DEFAULT_FILTER_ORDER 1
|
||||
#define ALC_DEFAULT_FILTER_ORDER 0x1100
|
||||
#endif
|
||||
|
||||
#ifndef AL_SOFT_deferred_updates
|
||||
#define AL_SOFT_deferred_updates 1
|
||||
#define AL_DEFERRED_UPDATES_SOFT 0xC002
|
||||
typedef void (AL_APIENTRY*LPALDEFERUPDATESSOFT)(void) AL_API_NOEXCEPT17;
|
||||
typedef void (AL_APIENTRY*LPALPROCESSUPDATESSOFT)(void) AL_API_NOEXCEPT17;
|
||||
#ifdef AL_ALEXT_PROTOTYPES
|
||||
AL_API void AL_APIENTRY alDeferUpdatesSOFT(void) AL_API_NOEXCEPT;
|
||||
AL_API void AL_APIENTRY alProcessUpdatesSOFT(void) AL_API_NOEXCEPT;
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#ifndef AL_SOFT_block_alignment
|
||||
#define AL_SOFT_block_alignment 1
|
||||
#define AL_UNPACK_BLOCK_ALIGNMENT_SOFT 0x200C
|
||||
#define AL_PACK_BLOCK_ALIGNMENT_SOFT 0x200D
|
||||
#endif
|
||||
|
||||
#ifndef AL_SOFT_MSADPCM
|
||||
#define AL_SOFT_MSADPCM 1
|
||||
#define AL_FORMAT_MONO_MSADPCM_SOFT 0x1302
|
||||
#define AL_FORMAT_STEREO_MSADPCM_SOFT 0x1303
|
||||
#endif
|
||||
|
||||
#ifndef AL_SOFT_source_length
|
||||
#define AL_SOFT_source_length 1
|
||||
/*#define AL_BYTE_LENGTH_SOFT 0x2009*/
|
||||
/*#define AL_SAMPLE_LENGTH_SOFT 0x200A*/
|
||||
/*#define AL_SEC_LENGTH_SOFT 0x200B*/
|
||||
#endif
|
||||
|
||||
#ifndef AL_SOFT_buffer_length_query
|
||||
#define AL_SOFT_buffer_length_query 1
|
||||
/*#define AL_BYTE_LENGTH_SOFT 0x2009*/
|
||||
/*#define AL_SAMPLE_LENGTH_SOFT 0x200A*/
|
||||
/*#define AL_SEC_LENGTH_SOFT 0x200B*/
|
||||
#endif
|
||||
|
||||
#ifndef ALC_SOFT_pause_device
|
||||
#define ALC_SOFT_pause_device 1
|
||||
typedef void (ALC_APIENTRY*LPALCDEVICEPAUSESOFT)(ALCdevice *device) ALC_API_NOEXCEPT17;
|
||||
typedef void (ALC_APIENTRY*LPALCDEVICERESUMESOFT)(ALCdevice *device) ALC_API_NOEXCEPT17;
|
||||
#ifdef AL_ALEXT_PROTOTYPES
|
||||
ALC_API void ALC_APIENTRY alcDevicePauseSOFT(ALCdevice *device) ALC_API_NOEXCEPT;
|
||||
ALC_API void ALC_APIENTRY alcDeviceResumeSOFT(ALCdevice *device) ALC_API_NOEXCEPT;
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#ifndef AL_EXT_BFORMAT
|
||||
#define AL_EXT_BFORMAT 1
|
||||
/* Provides support for B-Format ambisonic buffers (first-order, FuMa scaling
|
||||
* and layout).
|
||||
*
|
||||
* BFORMAT2D_8: Unsigned 8-bit, 3-channel non-periphonic (WXY).
|
||||
* BFORMAT2D_16: Signed 16-bit, 3-channel non-periphonic (WXY).
|
||||
* BFORMAT2D_FLOAT32: 32-bit float, 3-channel non-periphonic (WXY).
|
||||
* BFORMAT3D_8: Unsigned 8-bit, 4-channel periphonic (WXYZ).
|
||||
* BFORMAT3D_16: Signed 16-bit, 4-channel periphonic (WXYZ).
|
||||
* BFORMAT3D_FLOAT32: 32-bit float, 4-channel periphonic (WXYZ).
|
||||
*/
|
||||
#define AL_FORMAT_BFORMAT2D_8 0x20021
|
||||
#define AL_FORMAT_BFORMAT2D_16 0x20022
|
||||
#define AL_FORMAT_BFORMAT2D_FLOAT32 0x20023
|
||||
#define AL_FORMAT_BFORMAT3D_8 0x20031
|
||||
#define AL_FORMAT_BFORMAT3D_16 0x20032
|
||||
#define AL_FORMAT_BFORMAT3D_FLOAT32 0x20033
|
||||
#endif
|
||||
|
||||
#ifndef AL_EXT_MULAW_BFORMAT
|
||||
#define AL_EXT_MULAW_BFORMAT 1
|
||||
#define AL_FORMAT_BFORMAT2D_MULAW 0x10031
|
||||
#define AL_FORMAT_BFORMAT3D_MULAW 0x10032
|
||||
#endif
|
||||
|
||||
#ifndef ALC_SOFT_HRTF
|
||||
#define ALC_SOFT_HRTF 1
|
||||
#define ALC_HRTF_SOFT 0x1992
|
||||
#define ALC_DONT_CARE_SOFT 0x0002
|
||||
#define ALC_HRTF_STATUS_SOFT 0x1993
|
||||
#define ALC_HRTF_DISABLED_SOFT 0x0000
|
||||
#define ALC_HRTF_ENABLED_SOFT 0x0001
|
||||
#define ALC_HRTF_DENIED_SOFT 0x0002
|
||||
#define ALC_HRTF_REQUIRED_SOFT 0x0003
|
||||
#define ALC_HRTF_HEADPHONES_DETECTED_SOFT 0x0004
|
||||
#define ALC_HRTF_UNSUPPORTED_FORMAT_SOFT 0x0005
|
||||
#define ALC_NUM_HRTF_SPECIFIERS_SOFT 0x1994
|
||||
#define ALC_HRTF_SPECIFIER_SOFT 0x1995
|
||||
#define ALC_HRTF_ID_SOFT 0x1996
|
||||
typedef const ALCchar* (ALC_APIENTRY*LPALCGETSTRINGISOFT)(ALCdevice *device, ALCenum paramName, ALCsizei index) ALC_API_NOEXCEPT17;
|
||||
typedef ALCboolean (ALC_APIENTRY*LPALCRESETDEVICESOFT)(ALCdevice *device, const ALCint *attribs) ALC_API_NOEXCEPT17;
|
||||
#ifdef AL_ALEXT_PROTOTYPES
|
||||
ALC_API const ALCchar* ALC_APIENTRY alcGetStringiSOFT(ALCdevice *device, ALCenum paramName, ALCsizei index) ALC_API_NOEXCEPT;
|
||||
ALC_API ALCboolean ALC_APIENTRY alcResetDeviceSOFT(ALCdevice *device, const ALCint *attribs) ALC_API_NOEXCEPT;
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#ifndef AL_SOFT_gain_clamp_ex
|
||||
#define AL_SOFT_gain_clamp_ex 1
|
||||
#define AL_GAIN_LIMIT_SOFT 0x200E
|
||||
#endif
|
||||
|
||||
#ifndef AL_SOFT_source_resampler
|
||||
#define AL_SOFT_source_resampler
|
||||
#define AL_NUM_RESAMPLERS_SOFT 0x1210
|
||||
#define AL_DEFAULT_RESAMPLER_SOFT 0x1211
|
||||
#define AL_SOURCE_RESAMPLER_SOFT 0x1212
|
||||
#define AL_RESAMPLER_NAME_SOFT 0x1213
|
||||
typedef const ALchar* (AL_APIENTRY*LPALGETSTRINGISOFT)(ALenum pname, ALsizei index) AL_API_NOEXCEPT17;
|
||||
#ifdef AL_ALEXT_PROTOTYPES
|
||||
AL_API const ALchar* AL_APIENTRY alGetStringiSOFT(ALenum pname, ALsizei index) AL_API_NOEXCEPT;
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#ifndef AL_SOFT_source_spatialize
|
||||
#define AL_SOFT_source_spatialize
|
||||
#define AL_SOURCE_SPATIALIZE_SOFT 0x1214
|
||||
#define AL_AUTO_SOFT 0x0002
|
||||
#endif
|
||||
|
||||
#ifndef ALC_SOFT_output_limiter
|
||||
#define ALC_SOFT_output_limiter
|
||||
#define ALC_OUTPUT_LIMITER_SOFT 0x199A
|
||||
#endif
|
||||
|
||||
#ifndef ALC_SOFT_device_clock
|
||||
#define ALC_SOFT_device_clock 1
|
||||
typedef _alsoft_int64_t ALCint64SOFT;
|
||||
typedef _alsoft_uint64_t ALCuint64SOFT;
|
||||
#define ALC_DEVICE_CLOCK_SOFT 0x1600
|
||||
#define ALC_DEVICE_LATENCY_SOFT 0x1601
|
||||
#define ALC_DEVICE_CLOCK_LATENCY_SOFT 0x1602
|
||||
#define AL_SAMPLE_OFFSET_CLOCK_SOFT 0x1202
|
||||
#define AL_SEC_OFFSET_CLOCK_SOFT 0x1203
|
||||
typedef void (ALC_APIENTRY*LPALCGETINTEGER64VSOFT)(ALCdevice *device, ALCenum pname, ALsizei size, ALCint64SOFT *values) ALC_API_NOEXCEPT17;
|
||||
#ifdef AL_ALEXT_PROTOTYPES
|
||||
ALC_API void ALC_APIENTRY alcGetInteger64vSOFT(ALCdevice *device, ALCenum pname, ALsizei size, ALCint64SOFT *values) ALC_API_NOEXCEPT;
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#ifndef AL_SOFT_direct_channels_remix
|
||||
#define AL_SOFT_direct_channels_remix 1
|
||||
#define AL_DROP_UNMATCHED_SOFT 0x0001
|
||||
#define AL_REMIX_UNMATCHED_SOFT 0x0002
|
||||
#endif
|
||||
|
||||
#ifndef AL_SOFT_bformat_ex
|
||||
#define AL_SOFT_bformat_ex 1
|
||||
#define AL_AMBISONIC_LAYOUT_SOFT 0x1997
|
||||
#define AL_AMBISONIC_SCALING_SOFT 0x1998
|
||||
|
||||
/* Ambisonic layouts */
|
||||
#define AL_FUMA_SOFT 0x0000
|
||||
#define AL_ACN_SOFT 0x0001
|
||||
|
||||
/* Ambisonic scalings (normalization) */
|
||||
/*#define AL_FUMA_SOFT*/
|
||||
#define AL_SN3D_SOFT 0x0001
|
||||
#define AL_N3D_SOFT 0x0002
|
||||
#endif
|
||||
|
||||
#ifndef ALC_SOFT_loopback_bformat
|
||||
#define ALC_SOFT_loopback_bformat 1
|
||||
#define ALC_AMBISONIC_LAYOUT_SOFT 0x1997
|
||||
#define ALC_AMBISONIC_SCALING_SOFT 0x1998
|
||||
#define ALC_AMBISONIC_ORDER_SOFT 0x1999
|
||||
#define ALC_MAX_AMBISONIC_ORDER_SOFT 0x199B
|
||||
|
||||
#define ALC_BFORMAT3D_SOFT 0x1507
|
||||
|
||||
/* Ambisonic layouts */
|
||||
#define ALC_FUMA_SOFT 0x0000
|
||||
#define ALC_ACN_SOFT 0x0001
|
||||
|
||||
/* Ambisonic scalings (normalization) */
|
||||
/*#define ALC_FUMA_SOFT*/
|
||||
#define ALC_SN3D_SOFT 0x0001
|
||||
#define ALC_N3D_SOFT 0x0002
|
||||
#endif
|
||||
|
||||
#ifndef AL_SOFT_effect_target
|
||||
#define AL_SOFT_effect_target
|
||||
#define AL_EFFECTSLOT_TARGET_SOFT 0x199C
|
||||
#endif
|
||||
|
||||
#ifndef AL_SOFT_events
|
||||
#define AL_SOFT_events 1
|
||||
#define AL_EVENT_CALLBACK_FUNCTION_SOFT 0x19A2
|
||||
#define AL_EVENT_CALLBACK_USER_PARAM_SOFT 0x19A3
|
||||
#define AL_EVENT_TYPE_BUFFER_COMPLETED_SOFT 0x19A4
|
||||
#define AL_EVENT_TYPE_SOURCE_STATE_CHANGED_SOFT 0x19A5
|
||||
#define AL_EVENT_TYPE_DISCONNECTED_SOFT 0x19A6
|
||||
typedef void (AL_APIENTRY*ALEVENTPROCSOFT)(ALenum eventType, ALuint object, ALuint param,
|
||||
ALsizei length, const ALchar *message, void *userParam) AL_API_NOEXCEPT17;
|
||||
typedef void (AL_APIENTRY*LPALEVENTCONTROLSOFT)(ALsizei count, const ALenum *types, ALboolean enable) AL_API_NOEXCEPT17;
|
||||
typedef void (AL_APIENTRY*LPALEVENTCALLBACKSOFT)(ALEVENTPROCSOFT callback, void *userParam) AL_API_NOEXCEPT17;
|
||||
typedef void* (AL_APIENTRY*LPALGETPOINTERSOFT)(ALenum pname) AL_API_NOEXCEPT17;
|
||||
typedef void (AL_APIENTRY*LPALGETPOINTERVSOFT)(ALenum pname, void **values) AL_API_NOEXCEPT17;
|
||||
#ifdef AL_ALEXT_PROTOTYPES
|
||||
AL_API void AL_APIENTRY alEventControlSOFT(ALsizei count, const ALenum *types, ALboolean enable) AL_API_NOEXCEPT;
|
||||
AL_API void AL_APIENTRY alEventCallbackSOFT(ALEVENTPROCSOFT callback, void *userParam) AL_API_NOEXCEPT;
|
||||
AL_API void* AL_APIENTRY alGetPointerSOFT(ALenum pname) AL_API_NOEXCEPT;
|
||||
AL_API void AL_APIENTRY alGetPointervSOFT(ALenum pname, void **values) AL_API_NOEXCEPT;
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#ifndef ALC_SOFT_reopen_device
|
||||
#define ALC_SOFT_reopen_device
|
||||
typedef ALCboolean (ALC_APIENTRY*LPALCREOPENDEVICESOFT)(ALCdevice *device,
|
||||
const ALCchar *deviceName, const ALCint *attribs) ALC_API_NOEXCEPT17;
|
||||
#ifdef AL_ALEXT_PROTOTYPES
|
||||
ALCboolean ALC_APIENTRY alcReopenDeviceSOFT(ALCdevice *device, const ALCchar *deviceName,
|
||||
const ALCint *attribs) ALC_API_NOEXCEPT;
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#ifndef AL_SOFT_callback_buffer
|
||||
#define AL_SOFT_callback_buffer
|
||||
#define AL_BUFFER_CALLBACK_FUNCTION_SOFT 0x19A0
|
||||
#define AL_BUFFER_CALLBACK_USER_PARAM_SOFT 0x19A1
|
||||
typedef ALsizei (AL_APIENTRY*ALBUFFERCALLBACKTYPESOFT)(ALvoid *userptr, ALvoid *sampledata, ALsizei numbytes) AL_API_NOEXCEPT17;
|
||||
typedef void (AL_APIENTRY*LPALBUFFERCALLBACKSOFT)(ALuint buffer, ALenum format, ALsizei freq, ALBUFFERCALLBACKTYPESOFT callback, ALvoid *userptr) AL_API_NOEXCEPT17;
|
||||
typedef void (AL_APIENTRY*LPALGETBUFFERPTRSOFT)(ALuint buffer, ALenum param, ALvoid **value) AL_API_NOEXCEPT17;
|
||||
typedef void (AL_APIENTRY*LPALGETBUFFER3PTRSOFT)(ALuint buffer, ALenum param, ALvoid **value1, ALvoid **value2, ALvoid **value3) AL_API_NOEXCEPT17;
|
||||
typedef void (AL_APIENTRY*LPALGETBUFFERPTRVSOFT)(ALuint buffer, ALenum param, ALvoid **values) AL_API_NOEXCEPT17;
|
||||
#ifdef AL_ALEXT_PROTOTYPES
|
||||
AL_API void AL_APIENTRY alBufferCallbackSOFT(ALuint buffer, ALenum format, ALsizei freq, ALBUFFERCALLBACKTYPESOFT callback, ALvoid *userptr) AL_API_NOEXCEPT;
|
||||
AL_API void AL_APIENTRY alGetBufferPtrSOFT(ALuint buffer, ALenum param, ALvoid **ptr) AL_API_NOEXCEPT;
|
||||
AL_API void AL_APIENTRY alGetBuffer3PtrSOFT(ALuint buffer, ALenum param, ALvoid **ptr0, ALvoid **ptr1, ALvoid **ptr2) AL_API_NOEXCEPT;
|
||||
AL_API void AL_APIENTRY alGetBufferPtrvSOFT(ALuint buffer, ALenum param, ALvoid **ptr) AL_API_NOEXCEPT;
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#ifndef AL_SOFT_UHJ
|
||||
#define AL_SOFT_UHJ
|
||||
#define AL_FORMAT_UHJ2CHN8_SOFT 0x19A2
|
||||
#define AL_FORMAT_UHJ2CHN16_SOFT 0x19A3
|
||||
#define AL_FORMAT_UHJ2CHN_FLOAT32_SOFT 0x19A4
|
||||
#define AL_FORMAT_UHJ3CHN8_SOFT 0x19A5
|
||||
#define AL_FORMAT_UHJ3CHN16_SOFT 0x19A6
|
||||
#define AL_FORMAT_UHJ3CHN_FLOAT32_SOFT 0x19A7
|
||||
#define AL_FORMAT_UHJ4CHN8_SOFT 0x19A8
|
||||
#define AL_FORMAT_UHJ4CHN16_SOFT 0x19A9
|
||||
#define AL_FORMAT_UHJ4CHN_FLOAT32_SOFT 0x19AA
|
||||
|
||||
#define AL_STEREO_MODE_SOFT 0x19B0
|
||||
#define AL_NORMAL_SOFT 0x0000
|
||||
#define AL_SUPER_STEREO_SOFT 0x0001
|
||||
#define AL_SUPER_STEREO_WIDTH_SOFT 0x19B1
|
||||
#endif
|
||||
|
||||
#ifndef AL_SOFT_UHJ_ex
|
||||
#define AL_SOFT_UHJ_ex
|
||||
#define AL_FORMAT_UHJ2CHN_MULAW_SOFT 0x19B3
|
||||
#define AL_FORMAT_UHJ2CHN_ALAW_SOFT 0x19B4
|
||||
#define AL_FORMAT_UHJ2CHN_IMA4_SOFT 0x19B5
|
||||
#define AL_FORMAT_UHJ2CHN_MSADPCM_SOFT 0x19B6
|
||||
#define AL_FORMAT_UHJ3CHN_MULAW_SOFT 0x19B7
|
||||
#define AL_FORMAT_UHJ3CHN_ALAW_SOFT 0x19B8
|
||||
#define AL_FORMAT_UHJ4CHN_MULAW_SOFT 0x19B9
|
||||
#define AL_FORMAT_UHJ4CHN_ALAW_SOFT 0x19BA
|
||||
#endif
|
||||
|
||||
#ifndef ALC_SOFT_output_mode
|
||||
#define ALC_SOFT_output_mode
|
||||
#define ALC_OUTPUT_MODE_SOFT 0x19AC
|
||||
#define ALC_ANY_SOFT 0x19AD
|
||||
/*#define ALC_MONO_SOFT 0x1500*/
|
||||
/*#define ALC_STEREO_SOFT 0x1501*/
|
||||
#define ALC_STEREO_BASIC_SOFT 0x19AE
|
||||
#define ALC_STEREO_UHJ_SOFT 0x19AF
|
||||
#define ALC_STEREO_HRTF_SOFT 0x19B2
|
||||
/*#define ALC_QUAD_SOFT 0x1503*/
|
||||
#define ALC_SURROUND_5_1_SOFT 0x1504
|
||||
#define ALC_SURROUND_6_1_SOFT 0x1505
|
||||
#define ALC_SURROUND_7_1_SOFT 0x1506
|
||||
#endif
|
||||
|
||||
#ifndef AL_SOFT_source_start_delay
|
||||
#define AL_SOFT_source_start_delay
|
||||
typedef void (AL_APIENTRY*LPALSOURCEPLAYATTIMESOFT)(ALuint source, ALint64SOFT start_time) AL_API_NOEXCEPT17;
|
||||
typedef void (AL_APIENTRY*LPALSOURCEPLAYATTIMEVSOFT)(ALsizei n, const ALuint *sources, ALint64SOFT start_time) AL_API_NOEXCEPT17;
|
||||
#ifdef AL_ALEXT_PROTOTYPES
|
||||
void AL_APIENTRY alSourcePlayAtTimeSOFT(ALuint source, ALint64SOFT start_time) AL_API_NOEXCEPT;
|
||||
void AL_APIENTRY alSourcePlayAtTimevSOFT(ALsizei n, const ALuint *sources, ALint64SOFT start_time) AL_API_NOEXCEPT;
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#ifndef ALC_EXT_debug
|
||||
#define ALC_EXT_debug
|
||||
#define ALC_CONTEXT_FLAGS_EXT 0x19CF
|
||||
#define ALC_CONTEXT_DEBUG_BIT_EXT 0x0001
|
||||
#endif
|
||||
|
||||
#ifndef AL_EXT_debug
|
||||
#define AL_EXT_debug
|
||||
#define AL_DONT_CARE_EXT 0x0002
|
||||
#define AL_DEBUG_OUTPUT_EXT 0x19B2
|
||||
#define AL_DEBUG_CALLBACK_FUNCTION_EXT 0x19B3
|
||||
#define AL_DEBUG_CALLBACK_USER_PARAM_EXT 0x19B4
|
||||
#define AL_DEBUG_SOURCE_API_EXT 0x19B5
|
||||
#define AL_DEBUG_SOURCE_AUDIO_SYSTEM_EXT 0x19B6
|
||||
#define AL_DEBUG_SOURCE_THIRD_PARTY_EXT 0x19B7
|
||||
#define AL_DEBUG_SOURCE_APPLICATION_EXT 0x19B8
|
||||
#define AL_DEBUG_SOURCE_OTHER_EXT 0x19B9
|
||||
#define AL_DEBUG_TYPE_ERROR_EXT 0x19BA
|
||||
#define AL_DEBUG_TYPE_DEPRECATED_BEHAVIOR_EXT 0x19BB
|
||||
#define AL_DEBUG_TYPE_UNDEFINED_BEHAVIOR_EXT 0x19BC
|
||||
#define AL_DEBUG_TYPE_PORTABILITY_EXT 0x19BD
|
||||
#define AL_DEBUG_TYPE_PERFORMANCE_EXT 0x19BE
|
||||
#define AL_DEBUG_TYPE_MARKER_EXT 0x19BF
|
||||
#define AL_DEBUG_TYPE_PUSH_GROUP_EXT 0x19C0
|
||||
#define AL_DEBUG_TYPE_POP_GROUP_EXT 0x19C1
|
||||
#define AL_DEBUG_TYPE_OTHER_EXT 0x19C2
|
||||
#define AL_DEBUG_SEVERITY_HIGH_EXT 0x19C3
|
||||
#define AL_DEBUG_SEVERITY_MEDIUM_EXT 0x19C4
|
||||
#define AL_DEBUG_SEVERITY_LOW_EXT 0x19C5
|
||||
#define AL_DEBUG_SEVERITY_NOTIFICATION_EXT 0x19C6
|
||||
#define AL_DEBUG_LOGGED_MESSAGES_EXT 0x19C7
|
||||
#define AL_DEBUG_NEXT_LOGGED_MESSAGE_LENGTH_EXT 0x19C8
|
||||
#define AL_MAX_DEBUG_MESSAGE_LENGTH_EXT 0x19C9
|
||||
#define AL_MAX_DEBUG_LOGGED_MESSAGES_EXT 0x19CA
|
||||
#define AL_MAX_DEBUG_GROUP_STACK_DEPTH_EXT 0x19CB
|
||||
#define AL_MAX_LABEL_LENGTH_EXT 0x19CC
|
||||
#define AL_STACK_OVERFLOW_EXT 0x19CD
|
||||
#define AL_STACK_UNDERFLOW_EXT 0x19CE
|
||||
#define AL_CONTEXT_FLAGS_EXT 0x19CF
|
||||
#define AL_BUFFER_EXT 0x1009 /* Same as AL_BUFFER */
|
||||
#define AL_SOURCE_EXT 0x19D0
|
||||
#define AL_FILTER_EXT 0x19D1
|
||||
#define AL_EFFECT_EXT 0x19D2
|
||||
#define AL_AUXILIARY_EFFECT_SLOT_EXT 0x19D3
|
||||
|
||||
typedef void (AL_APIENTRY*ALDEBUGPROCEXT)(ALenum source, ALenum type, ALuint id, ALenum severity, ALsizei length, const ALchar *message, void *userParam) AL_API_NOEXCEPT17;
|
||||
typedef void (AL_APIENTRY*LPALDEBUGMESSAGECALLBACKEXT)(ALDEBUGPROCEXT callback, void *userParam) AL_API_NOEXCEPT17;
|
||||
typedef void (AL_APIENTRY*LPALDEBUGMESSAGEINSERTEXT)(ALenum source, ALenum type, ALuint id, ALenum severity, ALsizei length, const ALchar *message) AL_API_NOEXCEPT17;
|
||||
typedef void (AL_APIENTRY*LPALDEBUGMESSAGECONTROLEXT)(ALenum source, ALenum type, ALenum severity, ALsizei count, const ALuint *ids, ALboolean enable) AL_API_NOEXCEPT17;
|
||||
typedef void (AL_APIENTRY*LPALPUSHDEBUGGROUPEXT)(ALenum source, ALuint id, ALsizei length, const ALchar *message) AL_API_NOEXCEPT17;
|
||||
typedef void (AL_APIENTRY*LPALPOPDEBUGGROUPEXT)(void) AL_API_NOEXCEPT17;
|
||||
typedef ALuint (AL_APIENTRY*LPALGETDEBUGMESSAGELOGEXT)(ALuint count, ALsizei logBufSize, ALenum *sources, ALenum *types, ALuint *ids, ALenum *severities, ALsizei *lengths, ALchar *logBuf) AL_API_NOEXCEPT17;
|
||||
typedef void (AL_APIENTRY*LPALOBJECTLABELEXT)(ALenum identifier, ALuint name, ALsizei length, const ALchar *label) AL_API_NOEXCEPT17;
|
||||
typedef void (AL_APIENTRY*LPALGETOBJECTLABELEXT)(ALenum identifier, ALuint name, ALsizei bufSize, ALsizei *length, ALchar *label) AL_API_NOEXCEPT17;
|
||||
typedef void* (AL_APIENTRY*LPALGETPOINTEREXT)(ALenum pname) AL_API_NOEXCEPT17;
|
||||
typedef void (AL_APIENTRY*LPALGETPOINTERVEXT)(ALenum pname, void **values) AL_API_NOEXCEPT17;
|
||||
#ifdef AL_ALEXT_PROTOTYPES
|
||||
void AL_APIENTRY alDebugMessageCallbackEXT(ALDEBUGPROCEXT callback, void *userParam) AL_API_NOEXCEPT;
|
||||
void AL_APIENTRY alDebugMessageInsertEXT(ALenum source, ALenum type, ALuint id, ALenum severity, ALsizei length, const ALchar *message) AL_API_NOEXCEPT;
|
||||
void AL_APIENTRY alDebugMessageControlEXT(ALenum source, ALenum type, ALenum severity, ALsizei count, const ALuint *ids, ALboolean enable) AL_API_NOEXCEPT;
|
||||
void AL_APIENTRY alPushDebugGroupEXT(ALenum source, ALuint id, ALsizei length, const ALchar *message) AL_API_NOEXCEPT;
|
||||
void AL_APIENTRY alPopDebugGroupEXT(void) AL_API_NOEXCEPT;
|
||||
ALuint AL_APIENTRY alGetDebugMessageLogEXT(ALuint count, ALsizei logBufSize, ALenum *sources, ALenum *types, ALuint *ids, ALenum *severities, ALsizei *lengths, ALchar *logBuf) AL_API_NOEXCEPT;
|
||||
void AL_APIENTRY alObjectLabelEXT(ALenum identifier, ALuint name, ALsizei length, const ALchar *label) AL_API_NOEXCEPT;
|
||||
void AL_APIENTRY alGetObjectLabelEXT(ALenum identifier, ALuint name, ALsizei bufSize, ALsizei *length, ALchar *label) AL_API_NOEXCEPT;
|
||||
void* AL_APIENTRY alGetPointerEXT(ALenum pname) AL_API_NOEXCEPT;
|
||||
void AL_APIENTRY alGetPointervEXT(ALenum pname, void **values) AL_API_NOEXCEPT;
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#ifndef ALC_SOFT_system_events
|
||||
#define ALC_SOFT_system_events
|
||||
#define ALC_PLAYBACK_DEVICE_SOFT 0x19D4
|
||||
#define ALC_CAPTURE_DEVICE_SOFT 0x19D5
|
||||
#define ALC_EVENT_TYPE_DEFAULT_DEVICE_CHANGED_SOFT 0x19D6
|
||||
#define ALC_EVENT_TYPE_DEVICE_ADDED_SOFT 0x19D7
|
||||
#define ALC_EVENT_TYPE_DEVICE_REMOVED_SOFT 0x19D8
|
||||
#define ALC_EVENT_SUPPORTED_SOFT 0x19D9
|
||||
#define ALC_EVENT_NOT_SUPPORTED_SOFT 0x19DA
|
||||
typedef void (ALC_APIENTRY*ALCEVENTPROCTYPESOFT)(ALCenum eventType, ALCenum deviceType,
|
||||
ALCdevice *device, ALCsizei length, const ALCchar *message, void *userParam) ALC_API_NOEXCEPT17;
|
||||
typedef ALCenum (ALC_APIENTRY*LPALCEVENTISSUPPORTEDSOFT)(ALCenum eventType, ALCenum deviceType) ALC_API_NOEXCEPT17;
|
||||
typedef ALCboolean (ALC_APIENTRY*LPALCEVENTCONTROLSOFT)(ALCsizei count, const ALCenum *events, ALCboolean enable) ALC_API_NOEXCEPT17;
|
||||
typedef void (ALC_APIENTRY*LPALCEVENTCALLBACKSOFT)(ALCEVENTPROCTYPESOFT callback, void *userParam) ALC_API_NOEXCEPT17;
|
||||
#ifdef AL_ALEXT_PROTOTYPES
|
||||
ALCenum ALC_APIENTRY alcEventIsSupportedSOFT(ALCenum eventType, ALCenum deviceType) ALC_API_NOEXCEPT;
|
||||
ALCboolean ALC_APIENTRY alcEventControlSOFT(ALCsizei count, const ALCenum *events, ALCboolean enable) ALC_API_NOEXCEPT;
|
||||
void ALC_APIENTRY alcEventCallbackSOFT(ALCEVENTPROCTYPESOFT callback, void *userParam) ALC_API_NOEXCEPT;
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#ifndef AL_EXT_direct_context
|
||||
#define AL_EXT_direct_context
|
||||
typedef ALCvoid* (ALC_APIENTRY *LPALCGETPROCADDRESS2)(ALCdevice *device, const ALCchar *funcname) AL_API_NOEXCEPT17;
|
||||
|
||||
typedef void (AL_APIENTRY *LPALENABLEDIRECT)(ALCcontext *context, ALenum capability) AL_API_NOEXCEPT17;
|
||||
typedef void (AL_APIENTRY *LPALDISABLEDIRECT)(ALCcontext *context, ALenum capability) AL_API_NOEXCEPT17;
|
||||
typedef ALboolean (AL_APIENTRY *LPALISENABLEDDIRECT)(ALCcontext *context, ALenum capability) AL_API_NOEXCEPT17;
|
||||
typedef void (AL_APIENTRY *LPALDOPPLERFACTORDIRECT)(ALCcontext *context, ALfloat value) AL_API_NOEXCEPT17;
|
||||
typedef void (AL_APIENTRY *LPALSPEEDOFSOUNDDIRECT)(ALCcontext *context, ALfloat value) AL_API_NOEXCEPT17;
|
||||
typedef void (AL_APIENTRY *LPALDISTANCEMODELDIRECT)(ALCcontext *context, ALenum distanceModel) AL_API_NOEXCEPT17;
|
||||
typedef const ALchar* (AL_APIENTRY *LPALGETSTRINGDIRECT)(ALCcontext *context, ALenum param) AL_API_NOEXCEPT17;
|
||||
typedef void (AL_APIENTRY *LPALGETBOOLEANVDIRECT)(ALCcontext *context, ALenum param, ALboolean *values) AL_API_NOEXCEPT17;
|
||||
typedef void (AL_APIENTRY *LPALGETINTEGERVDIRECT)(ALCcontext *context, ALenum param, ALint *values) AL_API_NOEXCEPT17;
|
||||
typedef void (AL_APIENTRY *LPALGETFLOATVDIRECT)(ALCcontext *context, ALenum param, ALfloat *values) AL_API_NOEXCEPT17;
|
||||
typedef void (AL_APIENTRY *LPALGETDOUBLEVDIRECT)(ALCcontext *context, ALenum param, ALdouble *values) AL_API_NOEXCEPT17;
|
||||
typedef ALboolean (AL_APIENTRY *LPALGETBOOLEANDIRECT)(ALCcontext *context, ALenum param) AL_API_NOEXCEPT17;
|
||||
typedef ALint (AL_APIENTRY *LPALGETINTEGERDIRECT)(ALCcontext *context, ALenum param) AL_API_NOEXCEPT17;
|
||||
typedef ALfloat (AL_APIENTRY *LPALGETFLOATDIRECT)(ALCcontext *context, ALenum param) AL_API_NOEXCEPT17;
|
||||
typedef ALdouble (AL_APIENTRY *LPALGETDOUBLEDIRECT)(ALCcontext *context, ALenum param) AL_API_NOEXCEPT17;
|
||||
typedef ALenum (AL_APIENTRY *LPALGETERRORDIRECT)(ALCcontext *context) AL_API_NOEXCEPT17;
|
||||
typedef ALboolean (AL_APIENTRY *LPALISEXTENSIONPRESENTDIRECT)(ALCcontext *context, const ALchar *extname) AL_API_NOEXCEPT17;
|
||||
typedef void* (AL_APIENTRY *LPALGETPROCADDRESSDIRECT)(ALCcontext *context, const ALchar *fname) AL_API_NOEXCEPT17;
|
||||
typedef ALenum (AL_APIENTRY *LPALGETENUMVALUEDIRECT)(ALCcontext *context, const ALchar *ename) AL_API_NOEXCEPT17;
|
||||
typedef void (AL_APIENTRY *LPALLISTENERFDIRECT)(ALCcontext *context, ALenum param, ALfloat value) AL_API_NOEXCEPT17;
|
||||
typedef void (AL_APIENTRY *LPALLISTENER3FDIRECT)(ALCcontext *context, ALenum param, ALfloat value1, ALfloat value2, ALfloat value3) AL_API_NOEXCEPT17;
|
||||
typedef void (AL_APIENTRY *LPALLISTENERFVDIRECT)(ALCcontext *context, ALenum param, const ALfloat *values) AL_API_NOEXCEPT17;
|
||||
typedef void (AL_APIENTRY *LPALLISTENERIDIRECT)(ALCcontext *context, ALenum param, ALint value) AL_API_NOEXCEPT17;
|
||||
typedef void (AL_APIENTRY *LPALLISTENER3IDIRECT)(ALCcontext *context, ALenum param, ALint value1, ALint value2, ALint value3) AL_API_NOEXCEPT17;
|
||||
typedef void (AL_APIENTRY *LPALLISTENERIVDIRECT)(ALCcontext *context, ALenum param, const ALint *values) AL_API_NOEXCEPT17;
|
||||
typedef void (AL_APIENTRY *LPALGETLISTENERFDIRECT)(ALCcontext *context, ALenum param, ALfloat *value) AL_API_NOEXCEPT17;
|
||||
typedef void (AL_APIENTRY *LPALGETLISTENER3FDIRECT)(ALCcontext *context, ALenum param, ALfloat *value1, ALfloat *value2, ALfloat *value3) AL_API_NOEXCEPT17;
|
||||
typedef void (AL_APIENTRY *LPALGETLISTENERFVDIRECT)(ALCcontext *context, ALenum param, ALfloat *values) AL_API_NOEXCEPT17;
|
||||
typedef void (AL_APIENTRY *LPALGETLISTENERIDIRECT)(ALCcontext *context, ALenum param, ALint *value) AL_API_NOEXCEPT17;
|
||||
typedef void (AL_APIENTRY *LPALGETLISTENER3IDIRECT)(ALCcontext *context, ALenum param, ALint *value1, ALint *value2, ALint *value3) AL_API_NOEXCEPT17;
|
||||
typedef void (AL_APIENTRY *LPALGETLISTENERIVDIRECT)(ALCcontext *context, ALenum param, ALint *values) AL_API_NOEXCEPT17;
|
||||
typedef void (AL_APIENTRY *LPALGENSOURCESDIRECT)(ALCcontext *context, ALsizei n, ALuint *sources) AL_API_NOEXCEPT17;
|
||||
typedef void (AL_APIENTRY *LPALDELETESOURCESDIRECT)(ALCcontext *context, ALsizei n, const ALuint *sources) AL_API_NOEXCEPT17;
|
||||
typedef ALboolean (AL_APIENTRY *LPALISSOURCEDIRECT)(ALCcontext *context, ALuint source) AL_API_NOEXCEPT17;
|
||||
typedef void (AL_APIENTRY *LPALSOURCEFDIRECT)(ALCcontext *context, ALuint source, ALenum param, ALfloat value) AL_API_NOEXCEPT17;
|
||||
typedef void (AL_APIENTRY *LPALSOURCE3FDIRECT)(ALCcontext *context, ALuint source, ALenum param, ALfloat value1, ALfloat value2, ALfloat value3) AL_API_NOEXCEPT17;
|
||||
typedef void (AL_APIENTRY *LPALSOURCEFVDIRECT)(ALCcontext *context, ALuint source, ALenum param, const ALfloat *values) AL_API_NOEXCEPT17;
|
||||
typedef void (AL_APIENTRY *LPALSOURCEIDIRECT)(ALCcontext *context, ALuint source, ALenum param, ALint value) AL_API_NOEXCEPT17;
|
||||
typedef void (AL_APIENTRY *LPALSOURCE3IDIRECT)(ALCcontext *context, ALuint source, ALenum param, ALint value1, ALint value2, ALint value3) AL_API_NOEXCEPT17;
|
||||
typedef void (AL_APIENTRY *LPALSOURCEIVDIRECT)(ALCcontext *context, ALuint source, ALenum param, const ALint *values) AL_API_NOEXCEPT17;
|
||||
typedef void (AL_APIENTRY *LPALGETSOURCEFDIRECT)(ALCcontext *context, ALuint source, ALenum param, ALfloat *value) AL_API_NOEXCEPT17;
|
||||
typedef void (AL_APIENTRY *LPALGETSOURCE3FDIRECT)(ALCcontext *context, ALuint source, ALenum param, ALfloat *value1, ALfloat *value2, ALfloat *value3) AL_API_NOEXCEPT17;
|
||||
typedef void (AL_APIENTRY *LPALGETSOURCEFVDIRECT)(ALCcontext *context, ALuint source, ALenum param, ALfloat *values) AL_API_NOEXCEPT17;
|
||||
typedef void (AL_APIENTRY *LPALGETSOURCEIDIRECT)(ALCcontext *context, ALuint source, ALenum param, ALint *value) AL_API_NOEXCEPT17;
|
||||
typedef void (AL_APIENTRY *LPALGETSOURCE3IDIRECT)(ALCcontext *context, ALuint source, ALenum param, ALint *value1, ALint *value2, ALint *value3) AL_API_NOEXCEPT17;
|
||||
typedef void (AL_APIENTRY *LPALGETSOURCEIVDIRECT)(ALCcontext *context, ALuint source, ALenum param, ALint *values) AL_API_NOEXCEPT17;
|
||||
typedef void (AL_APIENTRY *LPALSOURCEPLAYDIRECT)(ALCcontext *context, ALuint source) AL_API_NOEXCEPT17;
|
||||
typedef void (AL_APIENTRY *LPALSOURCESTOPDIRECT)(ALCcontext *context, ALuint source) AL_API_NOEXCEPT17;
|
||||
typedef void (AL_APIENTRY *LPALSOURCEREWINDDIRECT)(ALCcontext *context, ALuint source) AL_API_NOEXCEPT17;
|
||||
typedef void (AL_APIENTRY *LPALSOURCEPAUSEDIRECT)(ALCcontext *context, ALuint source) AL_API_NOEXCEPT17;
|
||||
typedef void (AL_APIENTRY *LPALSOURCEPLAYVDIRECT)(ALCcontext *context, ALsizei n, const ALuint *sources) AL_API_NOEXCEPT17;
|
||||
typedef void (AL_APIENTRY *LPALSOURCESTOPVDIRECT)(ALCcontext *context, ALsizei n, const ALuint *sources) AL_API_NOEXCEPT17;
|
||||
typedef void (AL_APIENTRY *LPALSOURCEREWINDVDIRECT)(ALCcontext *context, ALsizei n, const ALuint *sources) AL_API_NOEXCEPT17;
|
||||
typedef void (AL_APIENTRY *LPALSOURCEPAUSEVDIRECT)(ALCcontext *context, ALsizei n, const ALuint *sources) AL_API_NOEXCEPT17;
|
||||
typedef void (AL_APIENTRY *LPALSOURCEQUEUEBUFFERSDIRECT)(ALCcontext *context, ALuint source, ALsizei nb, const ALuint *buffers) AL_API_NOEXCEPT17;
|
||||
typedef void (AL_APIENTRY *LPALSOURCEUNQUEUEBUFFERSDIRECT)(ALCcontext *context, ALuint source, ALsizei nb, ALuint *buffers) AL_API_NOEXCEPT17;
|
||||
typedef void (AL_APIENTRY *LPALGENBUFFERSDIRECT)(ALCcontext *context, ALsizei n, ALuint *buffers) AL_API_NOEXCEPT17;
|
||||
typedef void (AL_APIENTRY *LPALDELETEBUFFERSDIRECT)(ALCcontext *context, ALsizei n, const ALuint *buffers) AL_API_NOEXCEPT17;
|
||||
typedef ALboolean (AL_APIENTRY *LPALISBUFFERDIRECT)(ALCcontext *context, ALuint buffer) AL_API_NOEXCEPT17;
|
||||
typedef void (AL_APIENTRY *LPALBUFFERDATADIRECT)(ALCcontext *context, ALuint buffer, ALenum format, const ALvoid *data, ALsizei size, ALsizei samplerate) AL_API_NOEXCEPT17;
|
||||
typedef void (AL_APIENTRY *LPALBUFFERFDIRECT)(ALCcontext *context, ALuint buffer, ALenum param, ALfloat value) AL_API_NOEXCEPT17;
|
||||
typedef void (AL_APIENTRY *LPALBUFFER3FDIRECT)(ALCcontext *context, ALuint buffer, ALenum param, ALfloat value1, ALfloat value2, ALfloat value3) AL_API_NOEXCEPT17;
|
||||
typedef void (AL_APIENTRY *LPALBUFFERFVDIRECT)(ALCcontext *context, ALuint buffer, ALenum param, const ALfloat *values) AL_API_NOEXCEPT17;
|
||||
typedef void (AL_APIENTRY *LPALBUFFERIDIRECT)(ALCcontext *context, ALuint buffer, ALenum param, ALint value) AL_API_NOEXCEPT17;
|
||||
typedef void (AL_APIENTRY *LPALBUFFER3IDIRECT)(ALCcontext *context, ALuint buffer, ALenum param, ALint value1, ALint value2, ALint value3) AL_API_NOEXCEPT17;
|
||||
typedef void (AL_APIENTRY *LPALBUFFERIVDIRECT)(ALCcontext *context, ALuint buffer, ALenum param, const ALint *values) AL_API_NOEXCEPT17;
|
||||
typedef void (AL_APIENTRY *LPALGETBUFFERFDIRECT)(ALCcontext *context, ALuint buffer, ALenum param, ALfloat *value) AL_API_NOEXCEPT17;
|
||||
typedef void (AL_APIENTRY *LPALGETBUFFER3FDIRECT)(ALCcontext *context, ALuint buffer, ALenum param, ALfloat *value1, ALfloat *value2, ALfloat *value3) AL_API_NOEXCEPT17;
|
||||
typedef void (AL_APIENTRY *LPALGETBUFFERFVDIRECT)(ALCcontext *context, ALuint buffer, ALenum param, ALfloat *values) AL_API_NOEXCEPT17;
|
||||
typedef void (AL_APIENTRY *LPALGETBUFFERIDIRECT)(ALCcontext *context, ALuint buffer, ALenum param, ALint *value) AL_API_NOEXCEPT17;
|
||||
typedef void (AL_APIENTRY *LPALGETBUFFER3IDIRECT)(ALCcontext *context, ALuint buffer, ALenum param, ALint *value1, ALint *value2, ALint *value3) AL_API_NOEXCEPT17;
|
||||
typedef void (AL_APIENTRY *LPALGETBUFFERIVDIRECT)(ALCcontext *context, ALuint buffer, ALenum param, ALint *values) AL_API_NOEXCEPT17;
|
||||
/* ALC_EXT_EFX */
|
||||
typedef void (AL_APIENTRY *LPALGENEFFECTSDIRECT)(ALCcontext *context, ALsizei n, ALuint *effects) AL_API_NOEXCEPT17;
|
||||
typedef void (AL_APIENTRY *LPALDELETEEFFECTSDIRECT)(ALCcontext *context, ALsizei n, const ALuint *effects) AL_API_NOEXCEPT17;
|
||||
typedef ALboolean (AL_APIENTRY *LPALISEFFECTDIRECT)(ALCcontext *context, ALuint effect) AL_API_NOEXCEPT17;
|
||||
typedef void (AL_APIENTRY *LPALEFFECTIDIRECT)(ALCcontext *context, ALuint effect, ALenum param, ALint value) AL_API_NOEXCEPT17;
|
||||
typedef void (AL_APIENTRY *LPALEFFECTIVDIRECT)(ALCcontext *context, ALuint effect, ALenum param, const ALint *values) AL_API_NOEXCEPT17;
|
||||
typedef void (AL_APIENTRY *LPALEFFECTFDIRECT)(ALCcontext *context, ALuint effect, ALenum param, ALfloat value) AL_API_NOEXCEPT17;
|
||||
typedef void (AL_APIENTRY *LPALEFFECTFVDIRECT)(ALCcontext *context, ALuint effect, ALenum param, const ALfloat *values) AL_API_NOEXCEPT17;
|
||||
typedef void (AL_APIENTRY *LPALGETEFFECTIDIRECT)(ALCcontext *context, ALuint effect, ALenum param, ALint *value) AL_API_NOEXCEPT17;
|
||||
typedef void (AL_APIENTRY *LPALGETEFFECTIVDIRECT)(ALCcontext *context, ALuint effect, ALenum param, ALint *values) AL_API_NOEXCEPT17;
|
||||
typedef void (AL_APIENTRY *LPALGETEFFECTFDIRECT)(ALCcontext *context, ALuint effect, ALenum param, ALfloat *value) AL_API_NOEXCEPT17;
|
||||
typedef void (AL_APIENTRY *LPALGETEFFECTFVDIRECT)(ALCcontext *context, ALuint effect, ALenum param, ALfloat *values) AL_API_NOEXCEPT17;
|
||||
typedef void (AL_APIENTRY *LPALGENFILTERSDIRECT)(ALCcontext *context, ALsizei n, ALuint *filters) AL_API_NOEXCEPT17;
|
||||
typedef void (AL_APIENTRY *LPALDELETEFILTERSDIRECT)(ALCcontext *context, ALsizei n, const ALuint *filters) AL_API_NOEXCEPT17;
|
||||
typedef ALboolean (AL_APIENTRY *LPALISFILTERDIRECT)(ALCcontext *context, ALuint filter) AL_API_NOEXCEPT17;
|
||||
typedef void (AL_APIENTRY *LPALFILTERIDIRECT)(ALCcontext *context, ALuint filter, ALenum param, ALint value) AL_API_NOEXCEPT17;
|
||||
typedef void (AL_APIENTRY *LPALFILTERIVDIRECT)(ALCcontext *context, ALuint filter, ALenum param, const ALint *values) AL_API_NOEXCEPT17;
|
||||
typedef void (AL_APIENTRY *LPALFILTERFDIRECT)(ALCcontext *context, ALuint filter, ALenum param, ALfloat value) AL_API_NOEXCEPT17;
|
||||
typedef void (AL_APIENTRY *LPALFILTERFVDIRECT)(ALCcontext *context, ALuint filter, ALenum param, const ALfloat *values) AL_API_NOEXCEPT17;
|
||||
typedef void (AL_APIENTRY *LPALGETFILTERIDIRECT)(ALCcontext *context, ALuint filter, ALenum param, ALint *value) AL_API_NOEXCEPT17;
|
||||
typedef void (AL_APIENTRY *LPALGETFILTERIVDIRECT)(ALCcontext *context, ALuint filter, ALenum param, ALint *values) AL_API_NOEXCEPT17;
|
||||
typedef void (AL_APIENTRY *LPALGETFILTERFDIRECT)(ALCcontext *context, ALuint filter, ALenum param, ALfloat *value) AL_API_NOEXCEPT17;
|
||||
typedef void (AL_APIENTRY *LPALGETFILTERFVDIRECT)(ALCcontext *context, ALuint filter, ALenum param, ALfloat *values) AL_API_NOEXCEPT17;
|
||||
typedef void (AL_APIENTRY *LPALGENAUXILIARYEFFECTSLOTSDIRECT)(ALCcontext *context, ALsizei n, ALuint *effectslots) AL_API_NOEXCEPT17;
|
||||
typedef void (AL_APIENTRY *LPALDELETEAUXILIARYEFFECTSLOTSDIRECT)(ALCcontext *context, ALsizei n, const ALuint *effectslots) AL_API_NOEXCEPT17;
|
||||
typedef ALboolean (AL_APIENTRY *LPALISAUXILIARYEFFECTSLOTDIRECT)(ALCcontext *context, ALuint effectslot) AL_API_NOEXCEPT17;
|
||||
typedef void (AL_APIENTRY *LPALAUXILIARYEFFECTSLOTIDIRECT)(ALCcontext *context, ALuint effectslot, ALenum param, ALint value) AL_API_NOEXCEPT17;
|
||||
typedef void (AL_APIENTRY *LPALAUXILIARYEFFECTSLOTIVDIRECT)(ALCcontext *context, ALuint effectslot, ALenum param, const ALint *values) AL_API_NOEXCEPT17;
|
||||
typedef void (AL_APIENTRY *LPALAUXILIARYEFFECTSLOTFDIRECT)(ALCcontext *context, ALuint effectslot, ALenum param, ALfloat value) AL_API_NOEXCEPT17;
|
||||
typedef void (AL_APIENTRY *LPALAUXILIARYEFFECTSLOTFVDIRECT)(ALCcontext *context, ALuint effectslot, ALenum param, const ALfloat *values) AL_API_NOEXCEPT17;
|
||||
typedef void (AL_APIENTRY *LPALGETAUXILIARYEFFECTSLOTIDIRECT)(ALCcontext *context, ALuint effectslot, ALenum param, ALint *value) AL_API_NOEXCEPT17;
|
||||
typedef void (AL_APIENTRY *LPALGETAUXILIARYEFFECTSLOTIVDIRECT)(ALCcontext *context, ALuint effectslot, ALenum param, ALint *values) AL_API_NOEXCEPT17;
|
||||
typedef void (AL_APIENTRY *LPALGETAUXILIARYEFFECTSLOTFDIRECT)(ALCcontext *context, ALuint effectslot, ALenum param, ALfloat *value) AL_API_NOEXCEPT17;
|
||||
typedef void (AL_APIENTRY *LPALGETAUXILIARYEFFECTSLOTFVDIRECT)(ALCcontext *context, ALuint effectslot, ALenum param, ALfloat *values) AL_API_NOEXCEPT17;
|
||||
/* AL_EXT_BUFFER_DATA_STATIC */
|
||||
typedef void (AL_APIENTRY *LPALBUFFERDATASTATICDIRECT)(ALCcontext *context, ALuint buffer, ALenum format, ALvoid *data, ALsizei size, ALsizei freq) AL_API_NOEXCEPT17;
|
||||
/* AL_EXT_debug */
|
||||
typedef void (AL_APIENTRY*LPALDEBUGMESSAGECALLBACKDIRECTEXT)(ALCcontext *context, ALDEBUGPROCEXT callback, void *userParam) AL_API_NOEXCEPT17;
|
||||
typedef void (AL_APIENTRY*LPALDEBUGMESSAGEINSERTDIRECTEXT)(ALCcontext *context, ALenum source, ALenum type, ALuint id, ALenum severity, ALsizei length, const ALchar *message) AL_API_NOEXCEPT17;
|
||||
typedef void (AL_APIENTRY*LPALDEBUGMESSAGECONTROLDIRECTEXT)(ALCcontext *context, ALenum source, ALenum type, ALenum severity, ALsizei count, const ALuint *ids, ALboolean enable) AL_API_NOEXCEPT17;
|
||||
typedef void (AL_APIENTRY*LPALPUSHDEBUGGROUPDIRECTEXT)(ALCcontext *context, ALenum source, ALuint id, ALsizei length, const ALchar *message) AL_API_NOEXCEPT17;
|
||||
typedef void (AL_APIENTRY*LPALPOPDEBUGGROUPDIRECTEXT)(ALCcontext *context) AL_API_NOEXCEPT17;
|
||||
typedef ALuint (AL_APIENTRY*LPALGETDEBUGMESSAGELOGDIRECTEXT)(ALCcontext *context, ALuint count, ALsizei logBufSize, ALenum *sources, ALenum *types, ALuint *ids, ALenum *severities, ALsizei *lengths, ALchar *logBuf) AL_API_NOEXCEPT17;
|
||||
typedef void (AL_APIENTRY*LPALOBJECTLABELDIRECTEXT)(ALCcontext *context, ALenum identifier, ALuint name, ALsizei length, const ALchar *label) AL_API_NOEXCEPT17;
|
||||
typedef void (AL_APIENTRY*LPALGETOBJECTLABELDIRECTEXT)(ALCcontext *context, ALenum identifier, ALuint name, ALsizei bufSize, ALsizei *length, ALchar *label) AL_API_NOEXCEPT17;
|
||||
typedef void* (AL_APIENTRY*LPALGETPOINTERDIRECTEXT)(ALCcontext *context, ALenum pname) AL_API_NOEXCEPT17;
|
||||
typedef void (AL_APIENTRY*LPALGETPOINTERVDIRECTEXT)(ALCcontext *context, ALenum pname, void **values) AL_API_NOEXCEPT17;
|
||||
/* AL_EXT_FOLDBACK */
|
||||
typedef void (AL_APIENTRY *LPALREQUESTFOLDBACKSTARTDIRECT)(ALCcontext *context, ALenum mode, ALsizei count, ALsizei length, ALfloat *mem, LPALFOLDBACKCALLBACK callback) AL_API_NOEXCEPT17;
|
||||
typedef void (AL_APIENTRY *LPALREQUESTFOLDBACKSTOPDIRECT)(ALCcontext *context) AL_API_NOEXCEPT17;
|
||||
/* AL_SOFT_buffer_sub_data */
|
||||
typedef void (AL_APIENTRY *LPALBUFFERSUBDATADIRECTSOFT)(ALCcontext *context, ALuint buffer, ALenum format, const ALvoid *data, ALsizei offset, ALsizei length) AL_API_NOEXCEPT17;
|
||||
/* AL_SOFT_source_latency */
|
||||
typedef void (AL_APIENTRY *LPALSOURCEDDIRECTSOFT)(ALCcontext*,ALuint,ALenum,ALdouble) AL_API_NOEXCEPT17;
|
||||
typedef void (AL_APIENTRY *LPALSOURCE3DDIRECTSOFT)(ALCcontext*,ALuint,ALenum,ALdouble,ALdouble,ALdouble) AL_API_NOEXCEPT17;
|
||||
typedef void (AL_APIENTRY *LPALSOURCEDVDIRECTSOFT)(ALCcontext*,ALuint,ALenum,const ALdouble*) AL_API_NOEXCEPT17;
|
||||
typedef void (AL_APIENTRY *LPALGETSOURCEDDIRECTSOFT)(ALCcontext*,ALuint,ALenum,ALdouble*) AL_API_NOEXCEPT17;
|
||||
typedef void (AL_APIENTRY *LPALGETSOURCE3DDIRECTSOFT)(ALCcontext*,ALuint,ALenum,ALdouble*,ALdouble*,ALdouble*) AL_API_NOEXCEPT17;
|
||||
typedef void (AL_APIENTRY *LPALGETSOURCEDVDIRECTSOFT)(ALCcontext*,ALuint,ALenum,ALdouble*) AL_API_NOEXCEPT17;
|
||||
typedef void (AL_APIENTRY *LPALSOURCEI64DIRECTSOFT)(ALCcontext*,ALuint,ALenum,ALint64SOFT) AL_API_NOEXCEPT17;
|
||||
typedef void (AL_APIENTRY *LPALSOURCE3I64DIRECTSOFT)(ALCcontext*,ALuint,ALenum,ALint64SOFT,ALint64SOFT,ALint64SOFT) AL_API_NOEXCEPT17;
|
||||
typedef void (AL_APIENTRY *LPALSOURCEI64VDIRECTSOFT)(ALCcontext*,ALuint,ALenum,const ALint64SOFT*) AL_API_NOEXCEPT17;
|
||||
typedef void (AL_APIENTRY *LPALGETSOURCEI64DIRECTSOFT)(ALCcontext*,ALuint,ALenum,ALint64SOFT*) AL_API_NOEXCEPT17;
|
||||
typedef void (AL_APIENTRY *LPALGETSOURCE3I64DIRECTSOFT)(ALCcontext*,ALuint,ALenum,ALint64SOFT*,ALint64SOFT*,ALint64SOFT*) AL_API_NOEXCEPT17;
|
||||
typedef void (AL_APIENTRY *LPALGETSOURCEI64VDIRECTSOFT)(ALCcontext*,ALuint,ALenum,ALint64SOFT*) AL_API_NOEXCEPT17;
|
||||
/* AL_SOFT_deferred_updates */
|
||||
typedef void (AL_APIENTRY *LPALDEFERUPDATESDIRECTSOFT)(ALCcontext *context) AL_API_NOEXCEPT17;
|
||||
typedef void (AL_APIENTRY *LPALPROCESSUPDATESDIRECTSOFT)(ALCcontext *context) AL_API_NOEXCEPT17;
|
||||
/* AL_SOFT_source_resampler */
|
||||
typedef const ALchar* (AL_APIENTRY *LPALGETSTRINGIDIRECTSOFT)(ALCcontext *context, ALenum pname, ALsizei index) AL_API_NOEXCEPT17;
|
||||
/* AL_SOFT_events */
|
||||
typedef void (AL_APIENTRY *LPALEVENTCONTROLDIRECTSOFT)(ALCcontext *context, ALsizei count, const ALenum *types, ALboolean enable) AL_API_NOEXCEPT17;
|
||||
typedef void (AL_APIENTRY *LPALEVENTCALLBACKDIRECTSOFT)(ALCcontext *context, ALEVENTPROCSOFT callback, void *userParam) AL_API_NOEXCEPT17;
|
||||
typedef void* (AL_APIENTRY *LPALGETPOINTERDIRECTSOFT)(ALCcontext *context, ALenum pname) AL_API_NOEXCEPT17;
|
||||
typedef void (AL_APIENTRY *LPALGETPOINTERVDIRECTSOFT)(ALCcontext *context, ALenum pname, void **values) AL_API_NOEXCEPT17;
|
||||
/* AL_SOFT_callback_buffer */
|
||||
typedef void (AL_APIENTRY *LPALBUFFERCALLBACKDIRECTSOFT)(ALCcontext *context, ALuint buffer, ALenum format, ALsizei freq, ALBUFFERCALLBACKTYPESOFT callback, ALvoid *userptr) AL_API_NOEXCEPT17;
|
||||
typedef void (AL_APIENTRY *LPALGETBUFFERPTRDIRECTSOFT)(ALCcontext *context, ALuint buffer, ALenum param, ALvoid **value) AL_API_NOEXCEPT17;
|
||||
typedef void (AL_APIENTRY *LPALGETBUFFER3PTRDIRECTSOFT)(ALCcontext *context, ALuint buffer, ALenum param, ALvoid **value1, ALvoid **value2, ALvoid **value3) AL_API_NOEXCEPT17;
|
||||
typedef void (AL_APIENTRY *LPALGETBUFFERPTRVDIRECTSOFT)(ALCcontext *context, ALuint buffer, ALenum param, ALvoid **values) AL_API_NOEXCEPT17;
|
||||
/* AL_SOFT_source_start_delay */
|
||||
typedef void (AL_APIENTRY *LPALSOURCEPLAYATTIMEDIRECTSOFT)(ALCcontext *context, ALuint source, ALint64SOFT start_time) AL_API_NOEXCEPT17;
|
||||
typedef void (AL_APIENTRY *LPALSOURCEPLAYATTIMEVDIRECTSOFT)(ALCcontext *context, ALsizei n, const ALuint *sources, ALint64SOFT start_time) AL_API_NOEXCEPT17;
|
||||
/* EAX */
|
||||
typedef ALenum (AL_APIENTRY *LPEAXSETDIRECT)(ALCcontext *context, const struct _GUID *property_set_id, ALuint property_id, ALuint source_id, ALvoid *value, ALuint value_size) AL_API_NOEXCEPT17;
|
||||
typedef ALenum (AL_APIENTRY *LPEAXGETDIRECT)(ALCcontext *context, const struct _GUID *property_set_id, ALuint property_id, ALuint source_id, ALvoid *value, ALuint value_size) AL_API_NOEXCEPT17;
|
||||
typedef ALboolean (AL_APIENTRY *LPEAXSETBUFFERMODEDIRECT)(ALCcontext *context, ALsizei n, const ALuint *buffers, ALint value) AL_API_NOEXCEPT17;
|
||||
typedef ALenum (AL_APIENTRY *LPEAXGETBUFFERMODEDIRECT)(ALCcontext *context, ALuint buffer, ALint *pReserved) AL_API_NOEXCEPT17;
|
||||
#ifdef AL_ALEXT_PROTOTYPES
|
||||
ALCvoid* ALC_APIENTRY alcGetProcAddress2(ALCdevice *device, const ALCchar *funcName) AL_API_NOEXCEPT;
|
||||
|
||||
void AL_APIENTRY alEnableDirect(ALCcontext *context, ALenum capability) AL_API_NOEXCEPT;
|
||||
void AL_APIENTRY alDisableDirect(ALCcontext *context, ALenum capability) AL_API_NOEXCEPT;
|
||||
ALboolean AL_APIENTRY alIsEnabledDirect(ALCcontext *context, ALenum capability) AL_API_NOEXCEPT;
|
||||
|
||||
void AL_APIENTRY alDopplerFactorDirect(ALCcontext *context, ALfloat value) AL_API_NOEXCEPT;
|
||||
void AL_APIENTRY alSpeedOfSoundDirect(ALCcontext *context, ALfloat value) AL_API_NOEXCEPT;
|
||||
void AL_APIENTRY alDistanceModelDirect(ALCcontext *context, ALenum distanceModel) AL_API_NOEXCEPT;
|
||||
|
||||
const ALchar* AL_APIENTRY alGetStringDirect(ALCcontext *context, ALenum param) AL_API_NOEXCEPT;
|
||||
void AL_APIENTRY alGetBooleanvDirect(ALCcontext *context, ALenum param, ALboolean *values) AL_API_NOEXCEPT;
|
||||
void AL_APIENTRY alGetIntegervDirect(ALCcontext *context, ALenum param, ALint *values) AL_API_NOEXCEPT;
|
||||
void AL_APIENTRY alGetFloatvDirect(ALCcontext *context, ALenum param, ALfloat *values) AL_API_NOEXCEPT;
|
||||
void AL_APIENTRY alGetDoublevDirect(ALCcontext *context, ALenum param, ALdouble *values) AL_API_NOEXCEPT;
|
||||
ALboolean AL_APIENTRY alGetBooleanDirect(ALCcontext *context, ALenum param) AL_API_NOEXCEPT;
|
||||
ALint AL_APIENTRY alGetIntegerDirect(ALCcontext *context, ALenum param) AL_API_NOEXCEPT;
|
||||
ALfloat AL_APIENTRY alGetFloatDirect(ALCcontext *context, ALenum param) AL_API_NOEXCEPT;
|
||||
ALdouble AL_APIENTRY alGetDoubleDirect(ALCcontext *context, ALenum param) AL_API_NOEXCEPT;
|
||||
|
||||
ALenum AL_APIENTRY alGetErrorDirect(ALCcontext *context) AL_API_NOEXCEPT;
|
||||
ALboolean AL_APIENTRY alIsExtensionPresentDirect(ALCcontext *context, const ALchar *extname) AL_API_NOEXCEPT;
|
||||
void* AL_APIENTRY alGetProcAddressDirect(ALCcontext *context, const ALchar *fname) AL_API_NOEXCEPT;
|
||||
ALenum AL_APIENTRY alGetEnumValueDirect(ALCcontext *context, const ALchar *ename) AL_API_NOEXCEPT;
|
||||
|
||||
void AL_APIENTRY alListenerfDirect(ALCcontext *context, ALenum param, ALfloat value) AL_API_NOEXCEPT;
|
||||
void AL_APIENTRY alListener3fDirect(ALCcontext *context, ALenum param, ALfloat value1, ALfloat value2, ALfloat value3) AL_API_NOEXCEPT;
|
||||
void AL_APIENTRY alListenerfvDirect(ALCcontext *context, ALenum param, const ALfloat *values) AL_API_NOEXCEPT;
|
||||
void AL_APIENTRY alListeneriDirect(ALCcontext *context, ALenum param, ALint value) AL_API_NOEXCEPT;
|
||||
void AL_APIENTRY alListener3iDirect(ALCcontext *context, ALenum param, ALint value1, ALint value2, ALint value3) AL_API_NOEXCEPT;
|
||||
void AL_APIENTRY alListenerivDirect(ALCcontext *context, ALenum param, const ALint *values) AL_API_NOEXCEPT;
|
||||
void AL_APIENTRY alGetListenerfDirect(ALCcontext *context, ALenum param, ALfloat *value) AL_API_NOEXCEPT;
|
||||
void AL_APIENTRY alGetListener3fDirect(ALCcontext *context, ALenum param, ALfloat *value1, ALfloat *value2, ALfloat *value3) AL_API_NOEXCEPT;
|
||||
void AL_APIENTRY alGetListenerfvDirect(ALCcontext *context, ALenum param, ALfloat *values) AL_API_NOEXCEPT;
|
||||
void AL_APIENTRY alGetListeneriDirect(ALCcontext *context, ALenum param, ALint *value) AL_API_NOEXCEPT;
|
||||
void AL_APIENTRY alGetListener3iDirect(ALCcontext *context, ALenum param, ALint *value1, ALint *value2, ALint *value3) AL_API_NOEXCEPT;
|
||||
void AL_APIENTRY alGetListenerivDirect(ALCcontext *context, ALenum param, ALint *values) AL_API_NOEXCEPT;
|
||||
|
||||
void AL_APIENTRY alGenSourcesDirect(ALCcontext *context, ALsizei n, ALuint *sources) AL_API_NOEXCEPT;
|
||||
void AL_APIENTRY alDeleteSourcesDirect(ALCcontext *context, ALsizei n, const ALuint *sources) AL_API_NOEXCEPT;
|
||||
ALboolean AL_APIENTRY alIsSourceDirect(ALCcontext *context, ALuint source) AL_API_NOEXCEPT;
|
||||
void AL_APIENTRY alSourcefDirect(ALCcontext *context, ALuint source, ALenum param, ALfloat value) AL_API_NOEXCEPT;
|
||||
void AL_APIENTRY alSource3fDirect(ALCcontext *context, ALuint source, ALenum param, ALfloat value1, ALfloat value2, ALfloat value3) AL_API_NOEXCEPT;
|
||||
void AL_APIENTRY alSourcefvDirect(ALCcontext *context, ALuint source, ALenum param, const ALfloat *values) AL_API_NOEXCEPT;
|
||||
void AL_APIENTRY alSourceiDirect(ALCcontext *context, ALuint source, ALenum param, ALint value) AL_API_NOEXCEPT;
|
||||
void AL_APIENTRY alSource3iDirect(ALCcontext *context, ALuint source, ALenum param, ALint value1, ALint value2, ALint value3) AL_API_NOEXCEPT;
|
||||
void AL_APIENTRY alSourceivDirect(ALCcontext *context, ALuint source, ALenum param, const ALint *values) AL_API_NOEXCEPT;
|
||||
void AL_APIENTRY alGetSourcefDirect(ALCcontext *context, ALuint source, ALenum param, ALfloat *value) AL_API_NOEXCEPT;
|
||||
void AL_APIENTRY alGetSource3fDirect(ALCcontext *context, ALuint source, ALenum param, ALfloat *value1, ALfloat *value2, ALfloat *value3) AL_API_NOEXCEPT;
|
||||
void AL_APIENTRY alGetSourcefvDirect(ALCcontext *context, ALuint source, ALenum param, ALfloat *values) AL_API_NOEXCEPT;
|
||||
void AL_APIENTRY alGetSourceiDirect(ALCcontext *context, ALuint source, ALenum param, ALint *value) AL_API_NOEXCEPT;
|
||||
void AL_APIENTRY alGetSource3iDirect(ALCcontext *context, ALuint source, ALenum param, ALint *value1, ALint *value2, ALint *value3) AL_API_NOEXCEPT;
|
||||
void AL_APIENTRY alGetSourceivDirect(ALCcontext *context, ALuint source, ALenum param, ALint *values) AL_API_NOEXCEPT;
|
||||
void AL_APIENTRY alSourcePlayDirect(ALCcontext *context, ALuint source) AL_API_NOEXCEPT;
|
||||
void AL_APIENTRY alSourceStopDirect(ALCcontext *context, ALuint source) AL_API_NOEXCEPT;
|
||||
void AL_APIENTRY alSourceRewindDirect(ALCcontext *context, ALuint source) AL_API_NOEXCEPT;
|
||||
void AL_APIENTRY alSourcePauseDirect(ALCcontext *context, ALuint source) AL_API_NOEXCEPT;
|
||||
void AL_APIENTRY alSourcePlayvDirect(ALCcontext *context, ALsizei n, const ALuint *sources) AL_API_NOEXCEPT;
|
||||
void AL_APIENTRY alSourceStopvDirect(ALCcontext *context, ALsizei n, const ALuint *sources) AL_API_NOEXCEPT;
|
||||
void AL_APIENTRY alSourceRewindvDirect(ALCcontext *context, ALsizei n, const ALuint *sources) AL_API_NOEXCEPT;
|
||||
void AL_APIENTRY alSourcePausevDirect(ALCcontext *context, ALsizei n, const ALuint *sources) AL_API_NOEXCEPT;
|
||||
void AL_APIENTRY alSourceQueueBuffersDirect(ALCcontext *context, ALuint source, ALsizei nb, const ALuint *buffers) AL_API_NOEXCEPT;
|
||||
void AL_APIENTRY alSourceUnqueueBuffersDirect(ALCcontext *context, ALuint source, ALsizei nb, ALuint *buffers) AL_API_NOEXCEPT;
|
||||
|
||||
void AL_APIENTRY alGenBuffersDirect(ALCcontext *context, ALsizei n, ALuint *buffers) AL_API_NOEXCEPT;
|
||||
void AL_APIENTRY alDeleteBuffersDirect(ALCcontext *context, ALsizei n, const ALuint *buffers) AL_API_NOEXCEPT;
|
||||
ALboolean AL_APIENTRY alIsBufferDirect(ALCcontext *context, ALuint buffer) AL_API_NOEXCEPT;
|
||||
void AL_APIENTRY alBufferDataDirect(ALCcontext *context, ALuint buffer, ALenum format, const ALvoid *data, ALsizei size, ALsizei samplerate) AL_API_NOEXCEPT;
|
||||
void AL_APIENTRY alBufferfDirect(ALCcontext *context, ALuint buffer, ALenum param, ALfloat value) AL_API_NOEXCEPT;
|
||||
void AL_APIENTRY alBuffer3fDirect(ALCcontext *context, ALuint buffer, ALenum param, ALfloat value1, ALfloat value2, ALfloat value3) AL_API_NOEXCEPT;
|
||||
void AL_APIENTRY alBufferfvDirect(ALCcontext *context, ALuint buffer, ALenum param, const ALfloat *values) AL_API_NOEXCEPT;
|
||||
void AL_APIENTRY alBufferiDirect(ALCcontext *context, ALuint buffer, ALenum param, ALint value) AL_API_NOEXCEPT;
|
||||
void AL_APIENTRY alBuffer3iDirect(ALCcontext *context, ALuint buffer, ALenum param, ALint value1, ALint value2, ALint value3) AL_API_NOEXCEPT;
|
||||
void AL_APIENTRY alBufferivDirect(ALCcontext *context, ALuint buffer, ALenum param, const ALint *values) AL_API_NOEXCEPT;
|
||||
void AL_APIENTRY alGetBufferfDirect(ALCcontext *context, ALuint buffer, ALenum param, ALfloat *value) AL_API_NOEXCEPT;
|
||||
void AL_APIENTRY alGetBuffer3fDirect(ALCcontext *context, ALuint buffer, ALenum param, ALfloat *value1, ALfloat *value2, ALfloat *value3) AL_API_NOEXCEPT;
|
||||
void AL_APIENTRY alGetBufferfvDirect(ALCcontext *context, ALuint buffer, ALenum param, ALfloat *values) AL_API_NOEXCEPT;
|
||||
void AL_APIENTRY alGetBufferiDirect(ALCcontext *context, ALuint buffer, ALenum param, ALint *value) AL_API_NOEXCEPT;
|
||||
void AL_APIENTRY alGetBuffer3iDirect(ALCcontext *context, ALuint buffer, ALenum param, ALint *value1, ALint *value2, ALint *value3) AL_API_NOEXCEPT;
|
||||
void AL_APIENTRY alGetBufferivDirect(ALCcontext *context, ALuint buffer, ALenum param, ALint *values) AL_API_NOEXCEPT;
|
||||
|
||||
void AL_APIENTRY alGenEffectsDirect(ALCcontext *context, ALsizei n, ALuint *effects) AL_API_NOEXCEPT;
|
||||
void AL_APIENTRY alDeleteEffectsDirect(ALCcontext *context, ALsizei n, const ALuint *effects) AL_API_NOEXCEPT;
|
||||
ALboolean AL_APIENTRY alIsEffectDirect(ALCcontext *context, ALuint effect) AL_API_NOEXCEPT;
|
||||
void AL_APIENTRY alEffectiDirect(ALCcontext *context, ALuint effect, ALenum param, ALint iValue) AL_API_NOEXCEPT;
|
||||
void AL_APIENTRY alEffectivDirect(ALCcontext *context, ALuint effect, ALenum param, const ALint *piValues) AL_API_NOEXCEPT;
|
||||
void AL_APIENTRY alEffectfDirect(ALCcontext *context, ALuint effect, ALenum param, ALfloat flValue) AL_API_NOEXCEPT;
|
||||
void AL_APIENTRY alEffectfvDirect(ALCcontext *context, ALuint effect, ALenum param, const ALfloat *pflValues) AL_API_NOEXCEPT;
|
||||
void AL_APIENTRY alGetEffectiDirect(ALCcontext *context, ALuint effect, ALenum param, ALint *piValue) AL_API_NOEXCEPT;
|
||||
void AL_APIENTRY alGetEffectivDirect(ALCcontext *context, ALuint effect, ALenum param, ALint *piValues) AL_API_NOEXCEPT;
|
||||
void AL_APIENTRY alGetEffectfDirect(ALCcontext *context, ALuint effect, ALenum param, ALfloat *pflValue) AL_API_NOEXCEPT;
|
||||
void AL_APIENTRY alGetEffectfvDirect(ALCcontext *context, ALuint effect, ALenum param, ALfloat *pflValues) AL_API_NOEXCEPT;
|
||||
|
||||
void AL_APIENTRY alGenFiltersDirect(ALCcontext *context, ALsizei n, ALuint *filters) AL_API_NOEXCEPT;
|
||||
void AL_APIENTRY alDeleteFiltersDirect(ALCcontext *context, ALsizei n, const ALuint *filters) AL_API_NOEXCEPT;
|
||||
ALboolean AL_APIENTRY alIsFilterDirect(ALCcontext *context, ALuint filter) AL_API_NOEXCEPT;
|
||||
void AL_APIENTRY alFilteriDirect(ALCcontext *context, ALuint filter, ALenum param, ALint iValue) AL_API_NOEXCEPT;
|
||||
void AL_APIENTRY alFilterivDirect(ALCcontext *context, ALuint filter, ALenum param, const ALint *piValues) AL_API_NOEXCEPT;
|
||||
void AL_APIENTRY alFilterfDirect(ALCcontext *context, ALuint filter, ALenum param, ALfloat flValue) AL_API_NOEXCEPT;
|
||||
void AL_APIENTRY alFilterfvDirect(ALCcontext *context, ALuint filter, ALenum param, const ALfloat *pflValues) AL_API_NOEXCEPT;
|
||||
void AL_APIENTRY alGetFilteriDirect(ALCcontext *context, ALuint filter, ALenum param, ALint *piValue) AL_API_NOEXCEPT;
|
||||
void AL_APIENTRY alGetFilterivDirect(ALCcontext *context, ALuint filter, ALenum param, ALint *piValues) AL_API_NOEXCEPT;
|
||||
void AL_APIENTRY alGetFilterfDirect(ALCcontext *context, ALuint filter, ALenum param, ALfloat *pflValue) AL_API_NOEXCEPT;
|
||||
void AL_APIENTRY alGetFilterfvDirect(ALCcontext *context, ALuint filter, ALenum param, ALfloat *pflValues) AL_API_NOEXCEPT;
|
||||
|
||||
void AL_APIENTRY alGenAuxiliaryEffectSlotsDirect(ALCcontext *context, ALsizei n, ALuint *effectslots) AL_API_NOEXCEPT;
|
||||
void AL_APIENTRY alDeleteAuxiliaryEffectSlotsDirect(ALCcontext *context, ALsizei n, const ALuint *effectslots) AL_API_NOEXCEPT;
|
||||
ALboolean AL_APIENTRY alIsAuxiliaryEffectSlotDirect(ALCcontext *context, ALuint effectslot) AL_API_NOEXCEPT;
|
||||
void AL_APIENTRY alAuxiliaryEffectSlotiDirect(ALCcontext *context, ALuint effectslot, ALenum param, ALint iValue) AL_API_NOEXCEPT;
|
||||
void AL_APIENTRY alAuxiliaryEffectSlotivDirect(ALCcontext *context, ALuint effectslot, ALenum param, const ALint *piValues) AL_API_NOEXCEPT;
|
||||
void AL_APIENTRY alAuxiliaryEffectSlotfDirect(ALCcontext *context, ALuint effectslot, ALenum param, ALfloat flValue) AL_API_NOEXCEPT;
|
||||
void AL_APIENTRY alAuxiliaryEffectSlotfvDirect(ALCcontext *context, ALuint effectslot, ALenum param, const ALfloat *pflValues) AL_API_NOEXCEPT;
|
||||
void AL_APIENTRY alGetAuxiliaryEffectSlotiDirect(ALCcontext *context, ALuint effectslot, ALenum param, ALint *piValue) AL_API_NOEXCEPT;
|
||||
void AL_APIENTRY alGetAuxiliaryEffectSlotivDirect(ALCcontext *context, ALuint effectslot, ALenum param, ALint *piValues) AL_API_NOEXCEPT;
|
||||
void AL_APIENTRY alGetAuxiliaryEffectSlotfDirect(ALCcontext *context, ALuint effectslot, ALenum param, ALfloat *pflValue) AL_API_NOEXCEPT;
|
||||
void AL_APIENTRY alGetAuxiliaryEffectSlotfvDirect(ALCcontext *context, ALuint effectslot, ALenum param, ALfloat *pflValues) AL_API_NOEXCEPT;
|
||||
|
||||
void AL_APIENTRY alBufferDataStaticDirect(ALCcontext *context, ALuint buffer, ALenum format, ALvoid *data, ALsizei size, ALsizei freq) AL_API_NOEXCEPT;
|
||||
|
||||
void AL_APIENTRY alDebugMessageCallbackDirectEXT(ALCcontext *context, ALDEBUGPROCEXT callback, void *userParam) AL_API_NOEXCEPT;
|
||||
void AL_APIENTRY alDebugMessageInsertDirectEXT(ALCcontext *context, ALenum source, ALenum type, ALuint id, ALenum severity, ALsizei length, const ALchar *message) AL_API_NOEXCEPT;
|
||||
void AL_APIENTRY alDebugMessageControlDirectEXT(ALCcontext *context, ALenum source, ALenum type, ALenum severity, ALsizei count, const ALuint *ids, ALboolean enable) AL_API_NOEXCEPT;
|
||||
void AL_APIENTRY alPushDebugGroupDirectEXT(ALCcontext *context, ALenum source, ALuint id, ALsizei length, const ALchar *message) AL_API_NOEXCEPT;
|
||||
void AL_APIENTRY alPopDebugGroupDirectEXT(ALCcontext *context) AL_API_NOEXCEPT;
|
||||
ALuint AL_APIENTRY alGetDebugMessageLogDirectEXT(ALCcontext *context, ALuint count, ALsizei logBufSize, ALenum *sources, ALenum *types, ALuint *ids, ALenum *severities, ALsizei *lengths, ALchar *logBuf) AL_API_NOEXCEPT;
|
||||
void AL_APIENTRY alObjectLabelDirectEXT(ALCcontext *context, ALenum identifier, ALuint name, ALsizei length, const ALchar *label) AL_API_NOEXCEPT;
|
||||
void AL_APIENTRY alGetObjectLabelDirectEXT(ALCcontext *context, ALenum identifier, ALuint name, ALsizei bufSize, ALsizei *length, ALchar *label) AL_API_NOEXCEPT;
|
||||
void* AL_APIENTRY alGetPointerDirectEXT(ALCcontext *context, ALenum pname) AL_API_NOEXCEPT;
|
||||
void AL_APIENTRY alGetPointervDirectEXT(ALCcontext *context, ALenum pname, void **values) AL_API_NOEXCEPT;
|
||||
|
||||
void AL_APIENTRY alRequestFoldbackStartDirect(ALCcontext *context, ALenum mode, ALsizei count, ALsizei length, ALfloat *mem, LPALFOLDBACKCALLBACK callback) AL_API_NOEXCEPT;
|
||||
void AL_APIENTRY alRequestFoldbackStopDirect(ALCcontext *context) AL_API_NOEXCEPT;
|
||||
|
||||
void AL_APIENTRY alBufferSubDataDirectSOFT(ALCcontext *context, ALuint buffer, ALenum format, const ALvoid *data, ALsizei offset, ALsizei length) AL_API_NOEXCEPT;
|
||||
|
||||
void AL_APIENTRY alSourcedDirectSOFT(ALCcontext *context, ALuint source, ALenum param, ALdouble value) AL_API_NOEXCEPT;
|
||||
void AL_APIENTRY alSource3dDirectSOFT(ALCcontext *context, ALuint source, ALenum param, ALdouble value1, ALdouble value2, ALdouble value3) AL_API_NOEXCEPT;
|
||||
void AL_APIENTRY alSourcedvDirectSOFT(ALCcontext *context, ALuint source, ALenum param, const ALdouble *values) AL_API_NOEXCEPT;
|
||||
void AL_APIENTRY alGetSourcedDirectSOFT(ALCcontext *context, ALuint source, ALenum param, ALdouble *value) AL_API_NOEXCEPT;
|
||||
void AL_APIENTRY alGetSource3dDirectSOFT(ALCcontext *context, ALuint source, ALenum param, ALdouble *value1, ALdouble *value2, ALdouble *value3) AL_API_NOEXCEPT;
|
||||
void AL_APIENTRY alGetSourcedvDirectSOFT(ALCcontext *context, ALuint source, ALenum param, ALdouble *values) AL_API_NOEXCEPT;
|
||||
void AL_APIENTRY alSourcei64DirectSOFT(ALCcontext *context, ALuint source, ALenum param, ALint64SOFT value) AL_API_NOEXCEPT;
|
||||
void AL_APIENTRY alSource3i64DirectSOFT(ALCcontext *context, ALuint source, ALenum param, ALint64SOFT value1, ALint64SOFT value2, ALint64SOFT value3) AL_API_NOEXCEPT;
|
||||
void AL_APIENTRY alSourcei64vDirectSOFT(ALCcontext *context, ALuint source, ALenum param, const ALint64SOFT *values) AL_API_NOEXCEPT;
|
||||
void AL_APIENTRY alGetSourcei64DirectSOFT(ALCcontext *context, ALuint source, ALenum param, ALint64SOFT *value) AL_API_NOEXCEPT;
|
||||
void AL_APIENTRY alGetSource3i64DirectSOFT(ALCcontext *context, ALuint source, ALenum param, ALint64SOFT *value1, ALint64SOFT *value2, ALint64SOFT *value3) AL_API_NOEXCEPT;
|
||||
void AL_APIENTRY alGetSourcei64vDirectSOFT(ALCcontext *context, ALuint source, ALenum param, ALint64SOFT *values) AL_API_NOEXCEPT;
|
||||
|
||||
void AL_APIENTRY alDeferUpdatesDirectSOFT(ALCcontext *context) AL_API_NOEXCEPT;
|
||||
void AL_APIENTRY alProcessUpdatesDirectSOFT(ALCcontext *context) AL_API_NOEXCEPT;
|
||||
|
||||
const ALchar* AL_APIENTRY alGetStringiDirectSOFT(ALCcontext *context, ALenum pname, ALsizei index) AL_API_NOEXCEPT;
|
||||
|
||||
void AL_APIENTRY alEventControlDirectSOFT(ALCcontext *context, ALsizei count, const ALenum *types, ALboolean enable) AL_API_NOEXCEPT;
|
||||
void AL_APIENTRY alEventCallbackDirectSOFT(ALCcontext *context, ALEVENTPROCSOFT callback, void *userParam) AL_API_NOEXCEPT;
|
||||
void* AL_APIENTRY alGetPointerDirectSOFT(ALCcontext *context, ALenum pname) AL_API_NOEXCEPT;
|
||||
void AL_APIENTRY alGetPointervDirectSOFT(ALCcontext *context, ALenum pname, void **values) AL_API_NOEXCEPT;
|
||||
|
||||
void AL_APIENTRY alBufferCallbackDirectSOFT(ALCcontext *context, ALuint buffer, ALenum format, ALsizei freq, ALBUFFERCALLBACKTYPESOFT callback, ALvoid *userptr) AL_API_NOEXCEPT;
|
||||
void AL_APIENTRY alGetBufferPtrDirectSOFT(ALCcontext *context, ALuint buffer, ALenum param, ALvoid **ptr) AL_API_NOEXCEPT;
|
||||
void AL_APIENTRY alGetBuffer3PtrDirectSOFT(ALCcontext *context, ALuint buffer, ALenum param, ALvoid **ptr0, ALvoid **ptr1, ALvoid **ptr2) AL_API_NOEXCEPT;
|
||||
void AL_APIENTRY alGetBufferPtrvDirectSOFT(ALCcontext *context, ALuint buffer, ALenum param, ALvoid **ptr) AL_API_NOEXCEPT;
|
||||
|
||||
void AL_APIENTRY alSourcePlayAtTimeDirectSOFT(ALCcontext *context, ALuint source, ALint64SOFT start_time) AL_API_NOEXCEPT;
|
||||
void AL_APIENTRY alSourcePlayAtTimevDirectSOFT(ALCcontext *context, ALsizei n, const ALuint *sources, ALint64SOFT start_time) AL_API_NOEXCEPT;
|
||||
|
||||
ALenum AL_APIENTRY EAXSetDirect(ALCcontext *context, const struct _GUID *property_set_id, ALuint property_id, ALuint source_id, ALvoid *value, ALuint value_size) AL_API_NOEXCEPT;
|
||||
ALenum AL_APIENTRY EAXGetDirect(ALCcontext *context, const struct _GUID *property_set_id, ALuint property_id, ALuint source_id, ALvoid *value, ALuint value_size) AL_API_NOEXCEPT;
|
||||
ALboolean AL_APIENTRY EAXSetBufferModeDirect(ALCcontext *context, ALsizei n, const ALuint *buffers, ALint value) AL_API_NOEXCEPT;
|
||||
ALenum AL_APIENTRY EAXGetBufferModeDirect(ALCcontext *context, ALuint buffer, ALint *pReserved) AL_API_NOEXCEPT;
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#ifndef AL_SOFT_bformat_hoa
|
||||
#define AL_SOFT_bformat_hoa
|
||||
#define AL_UNPACK_AMBISONIC_ORDER_SOFT 0x199D
|
||||
#endif
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
/* NOLINTEND */
|
||||
|
||||
#endif
|
||||
@@ -2,6 +2,7 @@
|
||||
|
||||
#ifndef EFX_PRESETS_H
|
||||
#define EFX_PRESETS_H
|
||||
/* NOLINTBEGIN */
|
||||
|
||||
#ifndef EFXEAXREVERBPROPERTIES_DEFINED
|
||||
#define EFXEAXREVERBPROPERTIES_DEFINED
|
||||
@@ -345,7 +346,7 @@ typedef struct {
|
||||
/* Driving Presets */
|
||||
|
||||
#define EFX_REVERB_PRESET_DRIVING_COMMENTATOR \
|
||||
{ 1.0000f, 0.0000f, 3.1623f, 0.5623f, 0.5012f, 2.4200f, 0.8800f, 0.6800f, 0.1995f, 0.0930f, { 0.0000f, 0.0000f, 0.0000f }, 0.2512f, 0.0170f, { 0.0000f, 0.0000f, 0.0000f }, 0.2500f, 1.0000f, 0.2500f, 0.0000f, 0.9886f, 5000.0000f, 250.0000f, 0.0000f, 0x1 }
|
||||
{ 1.0000f, 0.0000f, 0.3162f, 0.5623f, 0.5012f, 2.4200f, 0.8800f, 0.6800f, 0.1995f, 0.0930f, { 0.0000f, 0.0000f, 0.0000f }, 0.2512f, 0.0170f, { 0.0000f, 0.0000f, 0.0000f }, 0.2500f, 1.0000f, 0.2500f, 0.0000f, 0.9886f, 5000.0000f, 250.0000f, 0.0000f, 0x1 }
|
||||
|
||||
#define EFX_REVERB_PRESET_DRIVING_PITGARAGE \
|
||||
{ 0.4287f, 0.5900f, 0.3162f, 0.7079f, 0.5623f, 1.7200f, 0.9300f, 0.8700f, 0.5623f, 0.0000f, { 0.0000f, 0.0000f, 0.0000f }, 1.2589f, 0.0160f, { 0.0000f, 0.0000f, 0.0000f }, 0.2500f, 0.1100f, 0.2500f, 0.0000f, 0.9943f, 5000.0000f, 250.0000f, 0.0000f, 0x0 }
|
||||
@@ -399,4 +400,5 @@ typedef struct {
|
||||
#define EFX_REVERB_PRESET_SMALLWATERROOM \
|
||||
{ 1.0000f, 0.7000f, 0.3162f, 0.4477f, 1.0000f, 1.5100f, 1.2500f, 1.1400f, 0.8913f, 0.0200f, { 0.0000f, 0.0000f, 0.0000f }, 1.4125f, 0.0300f, { 0.0000f, 0.0000f, 0.0000f }, 0.1790f, 0.1500f, 0.8950f, 0.1900f, 0.9920f, 5000.0000f, 250.0000f, 0.0000f, 0x0 }
|
||||
|
||||
/* NOLINTEND */
|
||||
#endif /* EFX_PRESETS_H */
|
||||
+69
-66
@@ -1,6 +1,8 @@
|
||||
#ifndef AL_EFX_H
|
||||
#define AL_EFX_H
|
||||
|
||||
/* NOLINTBEGIN */
|
||||
#include <float.h>
|
||||
|
||||
#include "alc.h"
|
||||
#include "al.h"
|
||||
@@ -203,80 +205,80 @@ extern "C" {
|
||||
|
||||
|
||||
/* Effect object function types. */
|
||||
typedef void (AL_APIENTRY *LPALGENEFFECTS)(ALsizei, ALuint*);
|
||||
typedef void (AL_APIENTRY *LPALDELETEEFFECTS)(ALsizei, const ALuint*);
|
||||
typedef ALboolean (AL_APIENTRY *LPALISEFFECT)(ALuint);
|
||||
typedef void (AL_APIENTRY *LPALEFFECTI)(ALuint, ALenum, ALint);
|
||||
typedef void (AL_APIENTRY *LPALEFFECTIV)(ALuint, ALenum, const ALint*);
|
||||
typedef void (AL_APIENTRY *LPALEFFECTF)(ALuint, ALenum, ALfloat);
|
||||
typedef void (AL_APIENTRY *LPALEFFECTFV)(ALuint, ALenum, const ALfloat*);
|
||||
typedef void (AL_APIENTRY *LPALGETEFFECTI)(ALuint, ALenum, ALint*);
|
||||
typedef void (AL_APIENTRY *LPALGETEFFECTIV)(ALuint, ALenum, ALint*);
|
||||
typedef void (AL_APIENTRY *LPALGETEFFECTF)(ALuint, ALenum, ALfloat*);
|
||||
typedef void (AL_APIENTRY *LPALGETEFFECTFV)(ALuint, ALenum, ALfloat*);
|
||||
typedef void (AL_APIENTRY *LPALGENEFFECTS)(ALsizei, ALuint*) AL_API_NOEXCEPT17;
|
||||
typedef void (AL_APIENTRY *LPALDELETEEFFECTS)(ALsizei, const ALuint*) AL_API_NOEXCEPT17;
|
||||
typedef ALboolean (AL_APIENTRY *LPALISEFFECT)(ALuint) AL_API_NOEXCEPT17;
|
||||
typedef void (AL_APIENTRY *LPALEFFECTI)(ALuint, ALenum, ALint) AL_API_NOEXCEPT17;
|
||||
typedef void (AL_APIENTRY *LPALEFFECTIV)(ALuint, ALenum, const ALint*) AL_API_NOEXCEPT17;
|
||||
typedef void (AL_APIENTRY *LPALEFFECTF)(ALuint, ALenum, ALfloat) AL_API_NOEXCEPT17;
|
||||
typedef void (AL_APIENTRY *LPALEFFECTFV)(ALuint, ALenum, const ALfloat*) AL_API_NOEXCEPT17;
|
||||
typedef void (AL_APIENTRY *LPALGETEFFECTI)(ALuint, ALenum, ALint*) AL_API_NOEXCEPT17;
|
||||
typedef void (AL_APIENTRY *LPALGETEFFECTIV)(ALuint, ALenum, ALint*) AL_API_NOEXCEPT17;
|
||||
typedef void (AL_APIENTRY *LPALGETEFFECTF)(ALuint, ALenum, ALfloat*) AL_API_NOEXCEPT17;
|
||||
typedef void (AL_APIENTRY *LPALGETEFFECTFV)(ALuint, ALenum, ALfloat*) AL_API_NOEXCEPT17;
|
||||
|
||||
/* Filter object function types. */
|
||||
typedef void (AL_APIENTRY *LPALGENFILTERS)(ALsizei, ALuint*);
|
||||
typedef void (AL_APIENTRY *LPALDELETEFILTERS)(ALsizei, const ALuint*);
|
||||
typedef ALboolean (AL_APIENTRY *LPALISFILTER)(ALuint);
|
||||
typedef void (AL_APIENTRY *LPALFILTERI)(ALuint, ALenum, ALint);
|
||||
typedef void (AL_APIENTRY *LPALFILTERIV)(ALuint, ALenum, const ALint*);
|
||||
typedef void (AL_APIENTRY *LPALFILTERF)(ALuint, ALenum, ALfloat);
|
||||
typedef void (AL_APIENTRY *LPALFILTERFV)(ALuint, ALenum, const ALfloat*);
|
||||
typedef void (AL_APIENTRY *LPALGETFILTERI)(ALuint, ALenum, ALint*);
|
||||
typedef void (AL_APIENTRY *LPALGETFILTERIV)(ALuint, ALenum, ALint*);
|
||||
typedef void (AL_APIENTRY *LPALGETFILTERF)(ALuint, ALenum, ALfloat*);
|
||||
typedef void (AL_APIENTRY *LPALGETFILTERFV)(ALuint, ALenum, ALfloat*);
|
||||
typedef void (AL_APIENTRY *LPALGENFILTERS)(ALsizei, ALuint*) AL_API_NOEXCEPT17;
|
||||
typedef void (AL_APIENTRY *LPALDELETEFILTERS)(ALsizei, const ALuint*) AL_API_NOEXCEPT17;
|
||||
typedef ALboolean (AL_APIENTRY *LPALISFILTER)(ALuint) AL_API_NOEXCEPT17;
|
||||
typedef void (AL_APIENTRY *LPALFILTERI)(ALuint, ALenum, ALint) AL_API_NOEXCEPT17;
|
||||
typedef void (AL_APIENTRY *LPALFILTERIV)(ALuint, ALenum, const ALint*) AL_API_NOEXCEPT17;
|
||||
typedef void (AL_APIENTRY *LPALFILTERF)(ALuint, ALenum, ALfloat) AL_API_NOEXCEPT17;
|
||||
typedef void (AL_APIENTRY *LPALFILTERFV)(ALuint, ALenum, const ALfloat*) AL_API_NOEXCEPT17;
|
||||
typedef void (AL_APIENTRY *LPALGETFILTERI)(ALuint, ALenum, ALint*) AL_API_NOEXCEPT17;
|
||||
typedef void (AL_APIENTRY *LPALGETFILTERIV)(ALuint, ALenum, ALint*) AL_API_NOEXCEPT17;
|
||||
typedef void (AL_APIENTRY *LPALGETFILTERF)(ALuint, ALenum, ALfloat*) AL_API_NOEXCEPT17;
|
||||
typedef void (AL_APIENTRY *LPALGETFILTERFV)(ALuint, ALenum, ALfloat*) AL_API_NOEXCEPT17;
|
||||
|
||||
/* Auxiliary Effect Slot object function types. */
|
||||
typedef void (AL_APIENTRY *LPALGENAUXILIARYEFFECTSLOTS)(ALsizei, ALuint*);
|
||||
typedef void (AL_APIENTRY *LPALDELETEAUXILIARYEFFECTSLOTS)(ALsizei, const ALuint*);
|
||||
typedef ALboolean (AL_APIENTRY *LPALISAUXILIARYEFFECTSLOT)(ALuint);
|
||||
typedef void (AL_APIENTRY *LPALAUXILIARYEFFECTSLOTI)(ALuint, ALenum, ALint);
|
||||
typedef void (AL_APIENTRY *LPALAUXILIARYEFFECTSLOTIV)(ALuint, ALenum, const ALint*);
|
||||
typedef void (AL_APIENTRY *LPALAUXILIARYEFFECTSLOTF)(ALuint, ALenum, ALfloat);
|
||||
typedef void (AL_APIENTRY *LPALAUXILIARYEFFECTSLOTFV)(ALuint, ALenum, const ALfloat*);
|
||||
typedef void (AL_APIENTRY *LPALGETAUXILIARYEFFECTSLOTI)(ALuint, ALenum, ALint*);
|
||||
typedef void (AL_APIENTRY *LPALGETAUXILIARYEFFECTSLOTIV)(ALuint, ALenum, ALint*);
|
||||
typedef void (AL_APIENTRY *LPALGETAUXILIARYEFFECTSLOTF)(ALuint, ALenum, ALfloat*);
|
||||
typedef void (AL_APIENTRY *LPALGETAUXILIARYEFFECTSLOTFV)(ALuint, ALenum, ALfloat*);
|
||||
typedef void (AL_APIENTRY *LPALGENAUXILIARYEFFECTSLOTS)(ALsizei, ALuint*) AL_API_NOEXCEPT17;
|
||||
typedef void (AL_APIENTRY *LPALDELETEAUXILIARYEFFECTSLOTS)(ALsizei, const ALuint*) AL_API_NOEXCEPT17;
|
||||
typedef ALboolean (AL_APIENTRY *LPALISAUXILIARYEFFECTSLOT)(ALuint) AL_API_NOEXCEPT17;
|
||||
typedef void (AL_APIENTRY *LPALAUXILIARYEFFECTSLOTI)(ALuint, ALenum, ALint) AL_API_NOEXCEPT17;
|
||||
typedef void (AL_APIENTRY *LPALAUXILIARYEFFECTSLOTIV)(ALuint, ALenum, const ALint*) AL_API_NOEXCEPT17;
|
||||
typedef void (AL_APIENTRY *LPALAUXILIARYEFFECTSLOTF)(ALuint, ALenum, ALfloat) AL_API_NOEXCEPT17;
|
||||
typedef void (AL_APIENTRY *LPALAUXILIARYEFFECTSLOTFV)(ALuint, ALenum, const ALfloat*) AL_API_NOEXCEPT17;
|
||||
typedef void (AL_APIENTRY *LPALGETAUXILIARYEFFECTSLOTI)(ALuint, ALenum, ALint*) AL_API_NOEXCEPT17;
|
||||
typedef void (AL_APIENTRY *LPALGETAUXILIARYEFFECTSLOTIV)(ALuint, ALenum, ALint*) AL_API_NOEXCEPT17;
|
||||
typedef void (AL_APIENTRY *LPALGETAUXILIARYEFFECTSLOTF)(ALuint, ALenum, ALfloat*) AL_API_NOEXCEPT17;
|
||||
typedef void (AL_APIENTRY *LPALGETAUXILIARYEFFECTSLOTFV)(ALuint, ALenum, ALfloat*) AL_API_NOEXCEPT17;
|
||||
|
||||
#ifdef AL_ALEXT_PROTOTYPES
|
||||
AL_API ALvoid AL_APIENTRY alGenEffects(ALsizei n, ALuint *effects);
|
||||
AL_API ALvoid AL_APIENTRY alDeleteEffects(ALsizei n, const ALuint *effects);
|
||||
AL_API ALboolean AL_APIENTRY alIsEffect(ALuint effect);
|
||||
AL_API ALvoid AL_APIENTRY alEffecti(ALuint effect, ALenum param, ALint iValue);
|
||||
AL_API ALvoid AL_APIENTRY alEffectiv(ALuint effect, ALenum param, const ALint *piValues);
|
||||
AL_API ALvoid AL_APIENTRY alEffectf(ALuint effect, ALenum param, ALfloat flValue);
|
||||
AL_API ALvoid AL_APIENTRY alEffectfv(ALuint effect, ALenum param, const ALfloat *pflValues);
|
||||
AL_API ALvoid AL_APIENTRY alGetEffecti(ALuint effect, ALenum param, ALint *piValue);
|
||||
AL_API ALvoid AL_APIENTRY alGetEffectiv(ALuint effect, ALenum param, ALint *piValues);
|
||||
AL_API ALvoid AL_APIENTRY alGetEffectf(ALuint effect, ALenum param, ALfloat *pflValue);
|
||||
AL_API ALvoid AL_APIENTRY alGetEffectfv(ALuint effect, ALenum param, ALfloat *pflValues);
|
||||
AL_API void AL_APIENTRY alGenEffects(ALsizei n, ALuint *effects) AL_API_NOEXCEPT;
|
||||
AL_API void AL_APIENTRY alDeleteEffects(ALsizei n, const ALuint *effects) AL_API_NOEXCEPT;
|
||||
AL_API ALboolean AL_APIENTRY alIsEffect(ALuint effect) AL_API_NOEXCEPT;
|
||||
AL_API void AL_APIENTRY alEffecti(ALuint effect, ALenum param, ALint iValue) AL_API_NOEXCEPT;
|
||||
AL_API void AL_APIENTRY alEffectiv(ALuint effect, ALenum param, const ALint *piValues) AL_API_NOEXCEPT;
|
||||
AL_API void AL_APIENTRY alEffectf(ALuint effect, ALenum param, ALfloat flValue) AL_API_NOEXCEPT;
|
||||
AL_API void AL_APIENTRY alEffectfv(ALuint effect, ALenum param, const ALfloat *pflValues) AL_API_NOEXCEPT;
|
||||
AL_API void AL_APIENTRY alGetEffecti(ALuint effect, ALenum param, ALint *piValue) AL_API_NOEXCEPT;
|
||||
AL_API void AL_APIENTRY alGetEffectiv(ALuint effect, ALenum param, ALint *piValues) AL_API_NOEXCEPT;
|
||||
AL_API void AL_APIENTRY alGetEffectf(ALuint effect, ALenum param, ALfloat *pflValue) AL_API_NOEXCEPT;
|
||||
AL_API void AL_APIENTRY alGetEffectfv(ALuint effect, ALenum param, ALfloat *pflValues) AL_API_NOEXCEPT;
|
||||
|
||||
AL_API ALvoid AL_APIENTRY alGenFilters(ALsizei n, ALuint *filters);
|
||||
AL_API ALvoid AL_APIENTRY alDeleteFilters(ALsizei n, const ALuint *filters);
|
||||
AL_API ALboolean AL_APIENTRY alIsFilter(ALuint filter);
|
||||
AL_API ALvoid AL_APIENTRY alFilteri(ALuint filter, ALenum param, ALint iValue);
|
||||
AL_API ALvoid AL_APIENTRY alFilteriv(ALuint filter, ALenum param, const ALint *piValues);
|
||||
AL_API ALvoid AL_APIENTRY alFilterf(ALuint filter, ALenum param, ALfloat flValue);
|
||||
AL_API ALvoid AL_APIENTRY alFilterfv(ALuint filter, ALenum param, const ALfloat *pflValues);
|
||||
AL_API ALvoid AL_APIENTRY alGetFilteri(ALuint filter, ALenum param, ALint *piValue);
|
||||
AL_API ALvoid AL_APIENTRY alGetFilteriv(ALuint filter, ALenum param, ALint *piValues);
|
||||
AL_API ALvoid AL_APIENTRY alGetFilterf(ALuint filter, ALenum param, ALfloat *pflValue);
|
||||
AL_API ALvoid AL_APIENTRY alGetFilterfv(ALuint filter, ALenum param, ALfloat *pflValues);
|
||||
AL_API void AL_APIENTRY alGenFilters(ALsizei n, ALuint *filters) AL_API_NOEXCEPT;
|
||||
AL_API void AL_APIENTRY alDeleteFilters(ALsizei n, const ALuint *filters) AL_API_NOEXCEPT;
|
||||
AL_API ALboolean AL_APIENTRY alIsFilter(ALuint filter) AL_API_NOEXCEPT;
|
||||
AL_API void AL_APIENTRY alFilteri(ALuint filter, ALenum param, ALint iValue) AL_API_NOEXCEPT;
|
||||
AL_API void AL_APIENTRY alFilteriv(ALuint filter, ALenum param, const ALint *piValues) AL_API_NOEXCEPT;
|
||||
AL_API void AL_APIENTRY alFilterf(ALuint filter, ALenum param, ALfloat flValue) AL_API_NOEXCEPT;
|
||||
AL_API void AL_APIENTRY alFilterfv(ALuint filter, ALenum param, const ALfloat *pflValues) AL_API_NOEXCEPT;
|
||||
AL_API void AL_APIENTRY alGetFilteri(ALuint filter, ALenum param, ALint *piValue) AL_API_NOEXCEPT;
|
||||
AL_API void AL_APIENTRY alGetFilteriv(ALuint filter, ALenum param, ALint *piValues) AL_API_NOEXCEPT;
|
||||
AL_API void AL_APIENTRY alGetFilterf(ALuint filter, ALenum param, ALfloat *pflValue) AL_API_NOEXCEPT;
|
||||
AL_API void AL_APIENTRY alGetFilterfv(ALuint filter, ALenum param, ALfloat *pflValues) AL_API_NOEXCEPT;
|
||||
|
||||
AL_API ALvoid AL_APIENTRY alGenAuxiliaryEffectSlots(ALsizei n, ALuint *effectslots);
|
||||
AL_API ALvoid AL_APIENTRY alDeleteAuxiliaryEffectSlots(ALsizei n, const ALuint *effectslots);
|
||||
AL_API ALboolean AL_APIENTRY alIsAuxiliaryEffectSlot(ALuint effectslot);
|
||||
AL_API ALvoid AL_APIENTRY alAuxiliaryEffectSloti(ALuint effectslot, ALenum param, ALint iValue);
|
||||
AL_API ALvoid AL_APIENTRY alAuxiliaryEffectSlotiv(ALuint effectslot, ALenum param, const ALint *piValues);
|
||||
AL_API ALvoid AL_APIENTRY alAuxiliaryEffectSlotf(ALuint effectslot, ALenum param, ALfloat flValue);
|
||||
AL_API ALvoid AL_APIENTRY alAuxiliaryEffectSlotfv(ALuint effectslot, ALenum param, const ALfloat *pflValues);
|
||||
AL_API ALvoid AL_APIENTRY alGetAuxiliaryEffectSloti(ALuint effectslot, ALenum param, ALint *piValue);
|
||||
AL_API ALvoid AL_APIENTRY alGetAuxiliaryEffectSlotiv(ALuint effectslot, ALenum param, ALint *piValues);
|
||||
AL_API ALvoid AL_APIENTRY alGetAuxiliaryEffectSlotf(ALuint effectslot, ALenum param, ALfloat *pflValue);
|
||||
AL_API ALvoid AL_APIENTRY alGetAuxiliaryEffectSlotfv(ALuint effectslot, ALenum param, ALfloat *pflValues);
|
||||
AL_API void AL_APIENTRY alGenAuxiliaryEffectSlots(ALsizei n, ALuint *effectslots) AL_API_NOEXCEPT;
|
||||
AL_API void AL_APIENTRY alDeleteAuxiliaryEffectSlots(ALsizei n, const ALuint *effectslots) AL_API_NOEXCEPT;
|
||||
AL_API ALboolean AL_APIENTRY alIsAuxiliaryEffectSlot(ALuint effectslot) AL_API_NOEXCEPT;
|
||||
AL_API void AL_APIENTRY alAuxiliaryEffectSloti(ALuint effectslot, ALenum param, ALint iValue) AL_API_NOEXCEPT;
|
||||
AL_API void AL_APIENTRY alAuxiliaryEffectSlotiv(ALuint effectslot, ALenum param, const ALint *piValues) AL_API_NOEXCEPT;
|
||||
AL_API void AL_APIENTRY alAuxiliaryEffectSlotf(ALuint effectslot, ALenum param, ALfloat flValue) AL_API_NOEXCEPT;
|
||||
AL_API void AL_APIENTRY alAuxiliaryEffectSlotfv(ALuint effectslot, ALenum param, const ALfloat *pflValues) AL_API_NOEXCEPT;
|
||||
AL_API void AL_APIENTRY alGetAuxiliaryEffectSloti(ALuint effectslot, ALenum param, ALint *piValue) AL_API_NOEXCEPT;
|
||||
AL_API void AL_APIENTRY alGetAuxiliaryEffectSlotiv(ALuint effectslot, ALenum param, ALint *piValues) AL_API_NOEXCEPT;
|
||||
AL_API void AL_APIENTRY alGetAuxiliaryEffectSlotf(ALuint effectslot, ALenum param, ALfloat *pflValue) AL_API_NOEXCEPT;
|
||||
AL_API void AL_APIENTRY alGetAuxiliaryEffectSlotfv(ALuint effectslot, ALenum param, ALfloat *pflValues) AL_API_NOEXCEPT;
|
||||
#endif
|
||||
|
||||
/* Filter ranges and defaults. */
|
||||
@@ -757,5 +759,6 @@ AL_API ALvoid AL_APIENTRY alGetAuxiliaryEffectSlotfv(ALuint effectslot, ALenum p
|
||||
#ifdef __cplusplus
|
||||
} /* extern "C" */
|
||||
#endif
|
||||
/* NOLINTEND */
|
||||
|
||||
#endif /* AL_EFX_H */
|
||||
@@ -20,6 +20,7 @@ function (create_launcher name type)
|
||||
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})
|
||||
endif()
|
||||
@@ -29,6 +30,7 @@ function (create_launcher name type)
|
||||
#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}")
|
||||
#set_target_properties(omohaaded_launcher_${name} PROPERTIES DEBUG_POSTFIX ${CMAKE_DEBUG_POSTFIX})
|
||||
#
|
||||
#INSTALL(TARGETS omohaaded_launcher_${name} DESTINATION ${CMAKE_INSTALL_BINDIR}/${PROJECT_INSTALL_SUBDIR})
|
||||
endfunction()
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
/*
|
||||
===========================================================================
|
||||
Copyright (C) 2024 the OpenMoHAA team
|
||||
Copyright (C) 2025 the OpenMoHAA team
|
||||
|
||||
This file is part of OpenMoHAA source code.
|
||||
|
||||
@@ -29,4 +29,4 @@ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
#include <vector>
|
||||
|
||||
std::filesystem::path GetProgramLocation();
|
||||
void LaunchProgram(const std::filesystem::path& path, const std::vector<std::string>& argumentList);
|
||||
void LaunchProgram(const std::filesystem::path& path, const std::vector<std::string>& argumentList);
|
||||
@@ -1,6 +1,6 @@
|
||||
/*
|
||||
===========================================================================
|
||||
Copyright (C) 2024 the OpenMoHAA team
|
||||
Copyright (C) 2025 the OpenMoHAA team
|
||||
|
||||
This file is part of OpenMoHAA source code.
|
||||
|
||||
@@ -32,11 +32,11 @@ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
#include <string>
|
||||
#include <iostream>
|
||||
|
||||
extern "C" char** environ;
|
||||
extern "C" char **environ;
|
||||
|
||||
std::filesystem::path GetProgramLocation()
|
||||
{
|
||||
char path[FILENAME_MAX];
|
||||
char path[FILENAME_MAX];
|
||||
ssize_t count = readlink("/proc/self/exe", path, FILENAME_MAX);
|
||||
|
||||
return std::filesystem::path(std::string(path, (count > 0) ? count : 0)).parent_path();
|
||||
@@ -44,17 +44,17 @@ std::filesystem::path GetProgramLocation()
|
||||
|
||||
void LaunchProgram(const std::filesystem::path& path, const std::vector<std::string>& argumentList)
|
||||
{
|
||||
pid_t pid;
|
||||
pid_t pid;
|
||||
std::string pathString = path.string();
|
||||
size_t argCount = argumentList.size();
|
||||
char** argv;
|
||||
int status;
|
||||
size_t argCount = argumentList.size();
|
||||
char **argv;
|
||||
int status;
|
||||
|
||||
argv = new char*[argCount + 2];
|
||||
argv[0] = (char*)pathString.c_str();
|
||||
argv = new char *[argCount + 2];
|
||||
argv[0] = (char *)pathString.c_str();
|
||||
|
||||
for (size_t i = 0; i < argCount; i++) {
|
||||
argv[i + 1] = (char*)argumentList[i].c_str();
|
||||
argv[i + 1] = (char *)argumentList[i].c_str();
|
||||
}
|
||||
argv[argCount + 1] = NULL;
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
/*
|
||||
===========================================================================
|
||||
Copyright (C) 2024 the OpenMoHAA team
|
||||
Copyright (C) 2025 the OpenMoHAA team
|
||||
|
||||
This file is part of OpenMoHAA source code.
|
||||
|
||||
@@ -28,19 +28,15 @@ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
#include <string>
|
||||
#include <vector>
|
||||
|
||||
const char* targetGameList[] =
|
||||
{
|
||||
"Base",
|
||||
"Spearhead",
|
||||
"Breakthrough"
|
||||
};
|
||||
const char *targetGameList[] = {"Base", "Spearhead", "Breakthrough"};
|
||||
|
||||
int main(int argc, const char* argv[]) {
|
||||
int main(int argc, const char *argv[])
|
||||
{
|
||||
std::vector<std::string> argumentList;
|
||||
#if !defined(DEDICATED) || !DEDICATED
|
||||
const char* programName = "openmohaa" ARCH_SUFFIX DLL_SUFFIX EXE_EXT;
|
||||
const char *programName = "openmohaa" DLL_SUFFIX EXE_EXT;
|
||||
#else
|
||||
const char* programName = "omohaaded" ARCH_SUFFIX DLL_SUFFIX EXE_EXT;
|
||||
const char *programName = "omohaaded" DLL_SUFFIX EXE_EXT;
|
||||
#endif
|
||||
|
||||
argumentList.push_back("+set");
|
||||
@@ -56,7 +52,7 @@ int main(int argc, const char* argv[]) {
|
||||
std::cout << "Expected program name: " << programName << std::endl;
|
||||
|
||||
const std::filesystem::path programLocation = GetProgramLocation();
|
||||
const std::filesystem::path programPath = programLocation / programName;
|
||||
const std::filesystem::path programPath = programLocation / programName;
|
||||
|
||||
std::cout << "Program location: " << programLocation << std::endl;
|
||||
std::cout << "Expected path: " << programPath << std::endl;
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
/*
|
||||
===========================================================================
|
||||
Copyright (C) 2024 the OpenMoHAA team
|
||||
Copyright (C) 2025 the OpenMoHAA team
|
||||
|
||||
This file is part of OpenMoHAA source code.
|
||||
|
||||
@@ -30,7 +30,7 @@ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
|
||||
std::filesystem::path GetProgramLocation()
|
||||
{
|
||||
wchar_t path[FILENAME_MAX] = { 0 };
|
||||
wchar_t path[FILENAME_MAX] = {0};
|
||||
GetModuleFileNameW(nullptr, path, FILENAME_MAX);
|
||||
|
||||
return std::filesystem::path(path).parent_path();
|
||||
@@ -39,11 +39,11 @@ std::filesystem::path GetProgramLocation()
|
||||
void LaunchProgram(const std::filesystem::path& path, const std::vector<std::string>& argumentList)
|
||||
{
|
||||
PROCESS_INFORMATION processInfo;
|
||||
STARTUPINFOW startupInfo;
|
||||
BOOL returnValue;
|
||||
std::wstring osCommandLine;
|
||||
std::wstring commandLine;
|
||||
size_t argCount = argumentList.size();
|
||||
STARTUPINFOW startupInfo;
|
||||
BOOL returnValue;
|
||||
std::wstring osCommandLine;
|
||||
std::wstring commandLine;
|
||||
size_t argCount = argumentList.size();
|
||||
|
||||
memset(&processInfo, 0, sizeof(processInfo));
|
||||
memset(&startupInfo, 0, sizeof(startupInfo));
|
||||
@@ -58,7 +58,7 @@ void LaunchProgram(const std::filesystem::path& path, const std::vector<std::str
|
||||
}
|
||||
}
|
||||
|
||||
osCommandLine = path.wstring();
|
||||
osCommandLine = L"\"" + path.wstring() + L"\"";
|
||||
osCommandLine += L" ";
|
||||
osCommandLine += commandLine;
|
||||
|
||||
|
||||
@@ -5072,6 +5072,10 @@ void ClientGameCommandManager::RemoveClientEntity(int number, dtiki_t *tiki, cen
|
||||
if (p && p->cgd.flags & T_ASSIGNED_NUMBER) {
|
||||
m_command_time_manager.RemoveEntity(number);
|
||||
}
|
||||
|
||||
// Fixed in OPM
|
||||
// Also make sure to remove all pending events for that entity
|
||||
RemovePendingEventsForEntity(number);
|
||||
}
|
||||
|
||||
bool ClientGameCommandManager::GetTagPositionAndOrientation(int tagnum, orientation_t *new_or)
|
||||
@@ -5135,6 +5139,10 @@ void ClientGameCommandManager::RestartAllEmitters(void)
|
||||
void CG_RestartCommandManager()
|
||||
{
|
||||
commandManager.FreeAllTempModels();
|
||||
|
||||
// Added in OPM
|
||||
// Clean up all effect events when the server restarts
|
||||
commandManager.ResetPendingEvents();
|
||||
}
|
||||
|
||||
//=================
|
||||
@@ -6386,3 +6394,41 @@ void commandtime_t::ArchiveToMemory(MemArchiver& archiver)
|
||||
archiver.ArchiveInteger(&command_number);
|
||||
archiver.ArchiveTime(&last_command_time);
|
||||
}
|
||||
|
||||
void ClientGameCommandManager::ResetPendingEvents()
|
||||
{
|
||||
EffectsEventQueueNode *event, *tmp;
|
||||
|
||||
event = EffectsEventQueue.next;
|
||||
while (event != &EffectsEventQueue) {
|
||||
tmp = event->next;
|
||||
|
||||
delete event->event;
|
||||
delete event;
|
||||
|
||||
event = tmp;
|
||||
}
|
||||
|
||||
LL_Reset(&EffectsEventQueue, next, prev);
|
||||
}
|
||||
|
||||
void ClientGameCommandManager::RemovePendingEventsForEntity(int number)
|
||||
{
|
||||
EffectsEventQueueNode *event, *tmp;
|
||||
|
||||
event = EffectsEventQueue.next;
|
||||
while (event != &EffectsEventQueue) {
|
||||
if (event->entity_num != number) {
|
||||
event = event->next;
|
||||
continue;
|
||||
}
|
||||
|
||||
tmp = event->next;
|
||||
LL_Remove(event, next, prev);
|
||||
|
||||
delete event->event;
|
||||
delete event;
|
||||
|
||||
event = tmp;
|
||||
}
|
||||
}
|
||||
@@ -895,8 +895,8 @@ private:
|
||||
void FreeTempModel(ctempmodel_t *le);
|
||||
void AnimateTempModel(ctempmodel_t *ent, Vector origin, refEntity_t *newEnt);
|
||||
void OtherTempModelEffects(ctempmodel_t *p, Vector origin, refEntity_t *newEnt);
|
||||
qboolean IsBlockCommand(const str &name);
|
||||
void SetBaseAndAmplitude(Event *ev, Vector &base, Vector &litude);
|
||||
qboolean IsBlockCommand(const str& name);
|
||||
void SetBaseAndAmplitude(Event *ev, Vector& base, Vector& amplitude);
|
||||
|
||||
// Beam stuff
|
||||
void SetSubdivisions(Event *ev);
|
||||
@@ -969,6 +969,9 @@ public:
|
||||
void ProcessPendingEventsForEntity();
|
||||
qboolean PostEventForEntity(Event *ev, float fWait);
|
||||
qboolean SelectProcessEvent(Event *ev);
|
||||
// Added in OPM
|
||||
void ResetPendingEvents();
|
||||
void RemovePendingEventsForEntity(int number);
|
||||
|
||||
void TestEffectEndFunc();
|
||||
void AddVSSSources();
|
||||
|
||||
+139
-72
@@ -1,6 +1,6 @@
|
||||
/*
|
||||
===========================================================================
|
||||
Copyright (C) 2023 the OpenMoHAA team
|
||||
Copyright (C) 2025 the OpenMoHAA team
|
||||
|
||||
This file is part of OpenMoHAA source code.
|
||||
|
||||
@@ -577,9 +577,9 @@ void CG_RefreshHudDrawElements()
|
||||
|
||||
void CG_HudDrawElements()
|
||||
{
|
||||
int i;
|
||||
float fX, fY;
|
||||
float fWidth, fHeight;
|
||||
int i;
|
||||
float fX, fY;
|
||||
float fWidth, fHeight;
|
||||
vec2_t virtualScale;
|
||||
|
||||
if (!cg_huddraw_force->integer && !cg_hud->integer) {
|
||||
@@ -638,20 +638,13 @@ void CG_HudDrawElements()
|
||||
|
||||
cgi.R_SetColor(cgi.HudDrawElements[i].vColor);
|
||||
if (cgi.HudDrawElements[i].string[0]) {
|
||||
fontheader_t* pFont = cgi.HudDrawElements[i].pFont;
|
||||
fontheader_t *pFont = cgi.HudDrawElements[i].pFont;
|
||||
if (!pFont) {
|
||||
pFont = cgs.media.hudDrawFont;
|
||||
}
|
||||
|
||||
if (cgi.HudDrawElements[i].bVirtualScreen) {
|
||||
cgi.R_DrawString(
|
||||
pFont,
|
||||
cgi.LV_ConvertString(cgi.HudDrawElements[i].string),
|
||||
fX,
|
||||
fY,
|
||||
-1,
|
||||
virtualScale
|
||||
);
|
||||
cgi.R_DrawString(pFont, cgi.LV_ConvertString(cgi.HudDrawElements[i].string), fX, fY, -1, virtualScale);
|
||||
} else {
|
||||
cgi.R_DrawString(
|
||||
pFont,
|
||||
@@ -700,8 +693,8 @@ void CG_DrawObjectives()
|
||||
int i;
|
||||
int iCurrentObjective;
|
||||
float fTimeDelta;
|
||||
const char *pszLocalizedText;
|
||||
const char *pszLine;
|
||||
const char *pszLocalizedText;
|
||||
const char *pszLine;
|
||||
|
||||
iTotalNumLines = 0;
|
||||
for (i = CS_OBJECTIVES; i < CS_OBJECTIVES + MAX_OBJECTIVES; ++i) {
|
||||
@@ -732,9 +725,9 @@ void CG_DrawObjectives()
|
||||
}
|
||||
|
||||
iNumObjectives++;
|
||||
iNumLines[i] = 0;
|
||||
iNumLines[i] = 0;
|
||||
pszLocalizedText = cgi.LV_ConvertString(cg.Objectives[i].text);
|
||||
|
||||
|
||||
for (pszLine = strchr(pszLocalizedText, '\n'); pszLine; pszLine = strchr(pszLine + 1, '\n')) {
|
||||
iNumLines[i]++;
|
||||
}
|
||||
@@ -750,7 +743,17 @@ void CG_DrawObjectives()
|
||||
vColor[0] = 0.2f;
|
||||
vColor[3] = cg.ObjectivesCurrentAlpha * 0.75;
|
||||
cgi.R_SetColor(vColor);
|
||||
cgi.R_DrawStretchPic(fX, fY, 450.0 * cgs.uiHiResScale[0], fWidth * cgs.uiHiResScale[1], 0.0, 0.0, 1.0, 1.0, cgs.media.objectivesBackShader);
|
||||
cgi.R_DrawStretchPic(
|
||||
fX,
|
||||
fY,
|
||||
450.0 * cgs.uiHiResScale[0],
|
||||
fWidth * cgs.uiHiResScale[1],
|
||||
0.0,
|
||||
0.0,
|
||||
1.0,
|
||||
1.0,
|
||||
cgs.media.objectivesBackShader
|
||||
);
|
||||
|
||||
fX = 30.0;
|
||||
fY = fObjectivesTop + 10;
|
||||
@@ -759,15 +762,29 @@ void CG_DrawObjectives()
|
||||
vColor[2] = 1.0;
|
||||
vColor[3] = cg.ObjectivesCurrentAlpha;
|
||||
cgi.R_SetColor(vColor);
|
||||
cgi.R_DrawString(cgs.media.objectiveFont, cgi.LV_ConvertString("Mission Objectives:"), fX, fY / cgs.uiHiResScale[1], -1, cgs.uiHiResScale);
|
||||
cgi.R_DrawString(
|
||||
cgs.media.objectiveFont,
|
||||
cgi.LV_ConvertString("Mission Objectives:"),
|
||||
fX,
|
||||
fY / cgs.uiHiResScale[1],
|
||||
-1,
|
||||
cgs.uiHiResScale
|
||||
);
|
||||
fY = fY + 5.0;
|
||||
|
||||
cgi.R_DrawString(cgs.media.objectiveFont, "_______________________________________________________", fX, fY / cgs.uiHiResScale[1], -1, cgs.uiHiResScale);
|
||||
cgi.R_DrawString(
|
||||
cgs.media.objectiveFont,
|
||||
"_______________________________________________________",
|
||||
fX,
|
||||
fY / cgs.uiHiResScale[1],
|
||||
-1,
|
||||
cgs.uiHiResScale
|
||||
);
|
||||
fHeight = fObjectivesTop + 35 * cgs.uiHiResScale[1];
|
||||
|
||||
for (i = 0; i < MAX_OBJECTIVES; ++i) {
|
||||
qhandle_t hBoxShader;
|
||||
|
||||
|
||||
if ((cg.Objectives[i].flags == OBJ_FLAG_NONE) || (cg.Objectives[i].flags & OBJ_FLAG_HIDDEN)) {
|
||||
continue;
|
||||
}
|
||||
@@ -905,12 +922,28 @@ void CG_DrawPlayerEntInfo()
|
||||
|
||||
if (handle) {
|
||||
cgi.R_SetColor(0);
|
||||
cgi.R_DrawStretchPic(fX, fY, 16.0 * cgs.uiHiResScale[0], 16.0 * cgs.uiHiResScale[1], 0.0, 0.0, 1.0, 1.0, handle);
|
||||
cgi.R_DrawStretchPic(
|
||||
fX, fY, 16.0 * cgs.uiHiResScale[0], 16.0 * cgs.uiHiResScale[1], 0.0, 0.0, 1.0, 1.0, handle
|
||||
);
|
||||
}
|
||||
|
||||
cgi.R_SetColor(color);
|
||||
cgi.R_DrawString(cgs.media.hudDrawFont, (char *)pszName, fX / cgs.uiHiResScale[0] + 24.0, fY / cgs.uiHiResScale[1], -1, cgs.uiHiResScale);
|
||||
cgi.R_DrawString(cgs.media.hudDrawFont, va("%i", cg.snap->ps.stats[STAT_INFOCLIENT_HEALTH]), fX / cgs.uiHiResScale[0] + 24.0, fY / cgs.uiHiResScale[1] + 20.0, -1, cgs.uiHiResScale);
|
||||
cgi.R_DrawString(
|
||||
cgs.media.hudDrawFont,
|
||||
(char *)pszName,
|
||||
fX / cgs.uiHiResScale[0] + 24.0,
|
||||
fY / cgs.uiHiResScale[1],
|
||||
-1,
|
||||
cgs.uiHiResScale
|
||||
);
|
||||
cgi.R_DrawString(
|
||||
cgs.media.hudDrawFont,
|
||||
va("%i", cg.snap->ps.stats[STAT_INFOCLIENT_HEALTH]),
|
||||
fX / cgs.uiHiResScale[0] + 24.0,
|
||||
fY / cgs.uiHiResScale[1] + 20.0,
|
||||
-1,
|
||||
cgs.uiHiResScale
|
||||
);
|
||||
}
|
||||
|
||||
void CG_UpdateAttackerDisplay()
|
||||
@@ -981,12 +1014,14 @@ void CG_UpdateAttackerDisplay()
|
||||
}
|
||||
|
||||
cgi.R_SetColor(color);
|
||||
cgi.R_DrawString(cgs.media.attackerFont, pszName, fX / cgs.uiHiResScale[0] + 32.0, fY / cgs.uiHiResScale[1], -1, cgs.uiHiResScale);
|
||||
cgi.R_DrawString(
|
||||
cgs.media.attackerFont, pszName, fX / cgs.uiHiResScale[0] + 32.0, fY / cgs.uiHiResScale[1], -1, cgs.uiHiResScale
|
||||
);
|
||||
}
|
||||
|
||||
void CG_UpdateCountdown()
|
||||
{
|
||||
const char* message = "";
|
||||
const char *message = "";
|
||||
|
||||
if (!cg.snap) {
|
||||
return;
|
||||
@@ -998,7 +1033,7 @@ void CG_UpdateCountdown()
|
||||
iSecondsLeft = (cgs.matchEndTime - cg.time) / 1000;
|
||||
if (iSecondsLeft >= 0) {
|
||||
iMinutesLeft = iSecondsLeft / 60;
|
||||
message = va("%s %2i:%02i", cgi.LV_ConvertString("Time Left:"), iMinutesLeft, iSecondsLeft % 60);
|
||||
message = va("%s %2i:%02i", cgi.LV_ConvertString("Time Left:"), iMinutesLeft, iSecondsLeft % 60);
|
||||
} else if (!cgs.matchEndTime) {
|
||||
message = "";
|
||||
}
|
||||
@@ -1012,7 +1047,8 @@ void CG_UpdateCountdown()
|
||||
}
|
||||
}
|
||||
|
||||
static void CG_RemoveStopwatch() {
|
||||
static void CG_RemoveStopwatch()
|
||||
{
|
||||
cgi.Cmd_Execute(EXEC_NOW, "ui_removehud hud_stopwatch\n");
|
||||
cgi.Cmd_Execute(EXEC_NOW, "ui_removehud hud_fuse\n");
|
||||
cgi.Cmd_Execute(EXEC_NOW, "ui_removehud hud_fuse_wet\n");
|
||||
@@ -1095,7 +1131,9 @@ void CG_DrawInstantMessageMenu()
|
||||
x = 8.0;
|
||||
y = ((float)cgs.glconfig.vidHeight - h) * 0.5;
|
||||
cgi.R_SetColor(0);
|
||||
cgi.R_DrawStretchPic(x * cgs.uiHiResScale[0], y, w * cgs.uiHiResScale[0], h * cgs.uiHiResScale[1], 0.0, 0.0, 1.0, 1.0, handle);
|
||||
cgi.R_DrawStretchPic(
|
||||
x * cgs.uiHiResScale[0], y, w * cgs.uiHiResScale[0], h * cgs.uiHiResScale[1], 0.0, 0.0, 1.0, 1.0, handle
|
||||
);
|
||||
}
|
||||
|
||||
void CG_DrawSpectatorView_ver_15()
|
||||
@@ -1118,10 +1156,14 @@ void CG_DrawSpectatorView_ver_15()
|
||||
if (!bOnTeam) {
|
||||
cgi.Key_GetKeysForCommand("+attackprimary", &iKey1, &iKey2);
|
||||
pszString = cgi.LV_ConvertString(va("Press Fire(%s) to join the battle!", cgi.Key_KeynumToBindString(iKey1)));
|
||||
fX = (float)(cgs.glconfig.vidWidth - cgi.UI_FontStringWidth(cgs.media.attackerFont, pszString, -1)) * 0.5;
|
||||
fY = cgs.glconfig.vidHeight - 64.0;
|
||||
fX = (float)(cgs.glconfig.vidWidth
|
||||
- cgi.UI_FontStringWidth(cgs.media.attackerFont, pszString, -1) * cgs.uiHiResScale[0])
|
||||
* 0.5;
|
||||
fY = cgs.glconfig.vidHeight - 64.0 * cgs.uiHiResScale[1];
|
||||
cgi.R_SetColor(NULL);
|
||||
cgi.R_DrawString(cgs.media.attackerFont, pszString, fX / cgs.uiHiResScale[0], fY / cgs.uiHiResScale[1], -1, cgs.uiHiResScale);
|
||||
cgi.R_DrawString(
|
||||
cgs.media.attackerFont, pszString, fX / cgs.uiHiResScale[0], fY / cgs.uiHiResScale[1], -1, cgs.uiHiResScale
|
||||
);
|
||||
}
|
||||
|
||||
if (cg.predicted_player_state.pm_flags & PMF_CAMERA_VIEW) {
|
||||
@@ -1134,10 +1176,14 @@ void CG_DrawSpectatorView_ver_15()
|
||||
cgi.Key_KeynumToBindString(iKey1b))
|
||||
);
|
||||
|
||||
fX = (float)(cgs.glconfig.vidWidth - cgi.UI_FontStringWidth(cgs.media.attackerFont, pszString, -1)) * 0.5;
|
||||
fY = (float)cgs.glconfig.vidHeight - 40.0;
|
||||
fX = (float)(cgs.glconfig.vidWidth
|
||||
- cgi.UI_FontStringWidth(cgs.media.attackerFont, pszString, -1) * cgs.uiHiResScale[0])
|
||||
* 0.5;
|
||||
fY = (float)cgs.glconfig.vidHeight - 40.0 * cgs.uiHiResScale[1];
|
||||
cgi.R_SetColor(0);
|
||||
cgi.R_DrawString(cgs.media.attackerFont, pszString, fX / cgs.uiHiResScale[0], fY / cgs.uiHiResScale[1], -1, cgs.uiHiResScale);
|
||||
cgi.R_DrawString(
|
||||
cgs.media.attackerFont, pszString, fX / cgs.uiHiResScale[0], fY / cgs.uiHiResScale[1], -1, cgs.uiHiResScale
|
||||
);
|
||||
}
|
||||
|
||||
if (!bOnTeam && (cg.predicted_player_state.pm_flags & PMF_CAMERA_VIEW)) {
|
||||
@@ -1145,10 +1191,14 @@ void CG_DrawSpectatorView_ver_15()
|
||||
pszString =
|
||||
cgi.LV_ConvertString(va("Press Use(%s) to enter free spectate mode.", cgi.Key_KeynumToBindString(iKey1)));
|
||||
|
||||
fX = (float)(cgs.glconfig.vidWidth - cgi.UI_FontStringWidth(cgs.media.attackerFont, pszString, -1)) * 0.5;
|
||||
fY = (float)cgs.glconfig.vidHeight - 24.0;
|
||||
fX = (float)(cgs.glconfig.vidWidth
|
||||
- cgi.UI_FontStringWidth(cgs.media.attackerFont, pszString, -1) * cgs.uiHiResScale[0])
|
||||
* 0.5;
|
||||
fY = (float)cgs.glconfig.vidHeight - 24.0 * cgs.uiHiResScale[1];
|
||||
cgi.R_SetColor(0);
|
||||
cgi.R_DrawString(cgs.media.attackerFont, pszString, fX / cgs.uiHiResScale[0], fY / cgs.uiHiResScale[1], -1, cgs.uiHiResScale);
|
||||
cgi.R_DrawString(
|
||||
cgs.media.attackerFont, pszString, fX / cgs.uiHiResScale[0], fY / cgs.uiHiResScale[1], -1, cgs.uiHiResScale
|
||||
);
|
||||
}
|
||||
|
||||
if (!(cg.predicted_player_state.pm_flags & PMF_CAMERA_VIEW)) {
|
||||
@@ -1158,20 +1208,27 @@ void CG_DrawSpectatorView_ver_15()
|
||||
va("Press Use(%s) to enter player following spectate mode.", cgi.Key_KeynumToBindString(iKey1))
|
||||
);
|
||||
|
||||
fX = (float)(cgs.glconfig.vidWidth - cgi.UI_FontStringWidth(cgs.media.attackerFont, pszString, -1)) * 0.5;
|
||||
fY = (float)cgs.glconfig.vidHeight - 24.0;
|
||||
fX = (float)(cgs.glconfig.vidWidth
|
||||
- cgi.UI_FontStringWidth(cgs.media.attackerFont, pszString, -1) * cgs.uiHiResScale[0])
|
||||
* 0.5;
|
||||
fY = (float)cgs.glconfig.vidHeight - 24.0 * cgs.uiHiResScale[1];
|
||||
cgi.R_SetColor(0);
|
||||
cgi.R_DrawString(cgs.media.attackerFont, pszString, fX / cgs.uiHiResScale[0], fY / cgs.uiHiResScale[1], -1, cgs.uiHiResScale);
|
||||
cgi.R_DrawString(
|
||||
cgs.media.attackerFont, pszString, fX / cgs.uiHiResScale[0], fY / cgs.uiHiResScale[1], -1, cgs.uiHiResScale
|
||||
);
|
||||
}
|
||||
|
||||
if ((cg.predicted_player_state.pm_flags & PMF_CAMERA_VIEW) != 0 && cg.snap && cg.snap->ps.stats[STAT_INFOCLIENT] != -1) {
|
||||
if ((cg.predicted_player_state.pm_flags & PMF_CAMERA_VIEW) != 0 && cg.snap
|
||||
&& cg.snap->ps.stats[STAT_INFOCLIENT] != -1) {
|
||||
int iClientNum;
|
||||
qhandle_t hShader;
|
||||
vec4_t color;
|
||||
char buf[128];
|
||||
|
||||
iClientNum = cg.snap->ps.stats[STAT_INFOCLIENT];
|
||||
Com_sprintf(buf, sizeof(buf), "%s : %i", cg.clientinfo[iClientNum].name, cg.snap->ps.stats[STAT_INFOCLIENT_HEALTH]);
|
||||
Com_sprintf(
|
||||
buf, sizeof(buf), "%s : %i", cg.clientinfo[iClientNum].name, cg.snap->ps.stats[STAT_INFOCLIENT_HEALTH]
|
||||
);
|
||||
|
||||
hShader = 0;
|
||||
color[0] = 0.5;
|
||||
@@ -1179,10 +1236,14 @@ void CG_DrawSpectatorView_ver_15()
|
||||
color[2] = 0.5;
|
||||
color[3] = 1.0;
|
||||
|
||||
fX = (float)(cgs.glconfig.vidWidth - cgi.UI_FontStringWidth(cgs.media.attackerFont, pszString, -1) - 16) * 0.5;
|
||||
fY = (float)cgs.glconfig.vidHeight - 80.0;
|
||||
fX = (float)(cgs.glconfig.vidWidth
|
||||
- (cgi.UI_FontStringWidth(cgs.media.attackerFont, pszString, -1) - 16) * cgs.uiHiResScale[0])
|
||||
* 0.5;
|
||||
fY = (float)cgs.glconfig.vidHeight - 80.0 * cgs.uiHiResScale[1];
|
||||
cgi.R_SetColor(color);
|
||||
cgi.R_DrawString(cgs.media.attackerFont, buf, fX / cgs.uiHiResScale[0], fY / cgs.uiHiResScale[1], -1, cgs.uiHiResScale);
|
||||
cgi.R_DrawString(
|
||||
cgs.media.attackerFont, buf, fX / cgs.uiHiResScale[0], fY / cgs.uiHiResScale[1], -1, cgs.uiHiResScale
|
||||
);
|
||||
|
||||
if (cg.clientinfo[iClientNum].team == TEAM_ALLIES) {
|
||||
hShader = cgi.R_RegisterShader("textures/hud/allies");
|
||||
@@ -1234,10 +1295,14 @@ void CG_DrawSpectatorView_ver_6()
|
||||
pszString = cgi.LV_ConvertString(va("Press Use(%s) to follow a player.", cgi.Key_KeynumToBindString(iKey1)));
|
||||
}
|
||||
|
||||
fX = (float)(cgs.glconfig.vidWidth - cgi.UI_FontStringWidth(cgs.media.attackerFont, pszString, -1)) * 0.5;
|
||||
fY = (float)cgs.glconfig.vidHeight - 40.0;
|
||||
fX = (float)(cgs.glconfig.vidWidth
|
||||
- cgi.UI_FontStringWidth(cgs.media.attackerFont, pszString, -1) * cgs.uiHiResScale[0])
|
||||
* 0.5;
|
||||
fY = (float)cgs.glconfig.vidHeight - 40.0 * cgs.uiHiResScale[1];
|
||||
cgi.R_SetColor(0);
|
||||
cgi.R_DrawString(cgs.media.attackerFont, pszString, fX / cgs.uiHiResScale[0], fY / cgs.uiHiResScale[1], -1, cgs.uiHiResScale);
|
||||
cgi.R_DrawString(
|
||||
cgs.media.attackerFont, pszString, fX / cgs.uiHiResScale[0], fY / cgs.uiHiResScale[1], -1, cgs.uiHiResScale
|
||||
);
|
||||
|
||||
if (!bOnTeam && (cg.predicted_player_state.pm_flags & PMF_CAMERA_VIEW)) {
|
||||
cgi.Key_GetKeysForCommand("+moveup", &iKey1, &iKey2);
|
||||
@@ -1248,10 +1313,14 @@ void CG_DrawSpectatorView_ver_6()
|
||||
cgi.Key_KeynumToBindString(iKey1b))
|
||||
);
|
||||
|
||||
fX = (float)(cgs.glconfig.vidWidth - cgi.UI_FontStringWidth(cgs.media.attackerFont, pszString, -1)) * 0.5;
|
||||
fY = (float)cgs.glconfig.vidHeight - 24.0;
|
||||
fX = (float)(cgs.glconfig.vidWidth
|
||||
- cgi.UI_FontStringWidth(cgs.media.attackerFont, pszString, -1) * cgs.uiHiResScale[0])
|
||||
* 0.5;
|
||||
fY = (float)cgs.glconfig.vidHeight - 24.0 * cgs.uiHiResScale[1];
|
||||
cgi.R_SetColor(0);
|
||||
cgi.R_DrawString(cgs.media.attackerFont, pszString, fX / cgs.uiHiResScale[0], fY / cgs.uiHiResScale[1], -1, cgs.uiHiResScale);
|
||||
cgi.R_DrawString(
|
||||
cgs.media.attackerFont, pszString, fX / cgs.uiHiResScale[0], fY / cgs.uiHiResScale[1], -1, cgs.uiHiResScale
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1351,17 +1420,7 @@ void CG_DrawCrosshair()
|
||||
y = (cgs.glconfig.vidHeight - height) * 0.5f;
|
||||
|
||||
cgi.R_SetColor(NULL);
|
||||
cgi.R_DrawStretchPic(
|
||||
x,
|
||||
y,
|
||||
width * cgs.uiHiResScale[0],
|
||||
height * cgs.uiHiResScale[1],
|
||||
0,
|
||||
0,
|
||||
1,
|
||||
1,
|
||||
shader
|
||||
);
|
||||
cgi.R_DrawStretchPic(x, y, width * cgs.uiHiResScale[0], height * cgs.uiHiResScale[1], 0, 0, 1, 1, shader);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1392,15 +1451,17 @@ void CG_DrawVote()
|
||||
percentNo = cgs.numVotesNo * 100 / (cgs.numUndecidedVotes + cgs.numVotesNo + cgs.numVotesYes);
|
||||
percentUndecided = cgs.numUndecidedVotes * 100 / (cgs.numUndecidedVotes + cgs.numVotesNo + cgs.numVotesYes);
|
||||
|
||||
x = 8;
|
||||
y = (cgs.glconfig.vidHeight > 480) ? (cgs.glconfig.vidHeight * 0.725f) : (cgs.glconfig.vidHeight * 0.75f);
|
||||
x = 8 * cgs.uiHiResScale[0];
|
||||
y = ((cgs.glconfig.vidHeight > 480) ? (cgs.glconfig.vidHeight * 0.725f) : (cgs.glconfig.vidHeight * 0.75f));
|
||||
|
||||
cgi.R_SetColor(NULL);
|
||||
|
||||
text = va("%s: %s", cgi.LV_ConvertString("Vote Running"), cgs.voteString);
|
||||
cgi.R_DrawString(cgs.media.attackerFont, text, x, y, -1, cgs.uiHiResScale);
|
||||
cgi.R_DrawString(
|
||||
cgs.media.attackerFont, text, x / cgs.uiHiResScale[0], y / cgs.uiHiResScale[1], -1, cgs.uiHiResScale
|
||||
);
|
||||
|
||||
y += 12;
|
||||
y += 12 * cgs.uiHiResScale[1];
|
||||
|
||||
text =
|
||||
va("%s: %isec %s: %i%% %s: %i%% %s: %i%%",
|
||||
@@ -1412,7 +1473,9 @@ void CG_DrawVote()
|
||||
percentNo,
|
||||
cgi.LV_ConvertString("Undecided"),
|
||||
percentUndecided);
|
||||
cgi.R_DrawString(cgs.media.attackerFont, text, x, y, -1, cgs.uiHiResScale);
|
||||
cgi.R_DrawString(
|
||||
cgs.media.attackerFont, text, x / cgs.uiHiResScale[0], y / cgs.uiHiResScale[1], -1, cgs.uiHiResScale
|
||||
);
|
||||
|
||||
if (cg.snap && !cg.snap->ps.voted) {
|
||||
col[0] = 0.5;
|
||||
@@ -1421,15 +1484,19 @@ void CG_DrawVote()
|
||||
col[3] = 1.0;
|
||||
cgi.R_SetColor(col);
|
||||
|
||||
y += 12;
|
||||
y += 12 * cgs.uiHiResScale[1];
|
||||
|
||||
text = cgi.LV_ConvertString("Vote now, it's your patriotic duty!");
|
||||
cgi.R_DrawString(cgs.media.attackerFont, text, x, y, -1, cgs.uiHiResScale);
|
||||
cgi.R_DrawString(
|
||||
cgs.media.attackerFont, text, x / cgs.uiHiResScale[0], y / cgs.uiHiResScale[1], -1, cgs.uiHiResScale
|
||||
);
|
||||
|
||||
y += 12;
|
||||
y += 12 * cgs.uiHiResScale[1];
|
||||
|
||||
text = cgi.LV_ConvertString("To vote Yes, press F1. To vote No, press F2.");
|
||||
cgi.R_DrawString(cgs.media.attackerFont, text, x, y, -1, cgs.uiHiResScale);
|
||||
cgi.R_DrawString(
|
||||
cgs.media.attackerFont, text, x / cgs.uiHiResScale[0], y / cgs.uiHiResScale[1], -1, cgs.uiHiResScale
|
||||
);
|
||||
cgi.R_SetColor(NULL);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -270,6 +270,8 @@ extern "C" {
|
||||
qhandle_t hAlliedPlayerModelHandle;
|
||||
dtiki_t *pAxisPlayerModel;
|
||||
qhandle_t hAxisPlayerModelHandle;
|
||||
qboolean serverAlliedModelValid;
|
||||
qboolean serverAxisModelValid;
|
||||
|
||||
// view eyes
|
||||
vec3_t vOffsetViewAngles;
|
||||
@@ -510,6 +512,7 @@ extern "C" {
|
||||
// Added in OPM
|
||||
//
|
||||
extern cvar_t *cg_fov;
|
||||
extern cvar_t *cg_cheats;
|
||||
|
||||
//
|
||||
// cg_main.c
|
||||
@@ -530,6 +533,9 @@ extern "C" {
|
||||
//
|
||||
// cg_modelanim.cpp
|
||||
//
|
||||
void CG_ProcessPlayerModel();
|
||||
void CG_ServerModelLoaded(const char* name, qhandle_t handle);
|
||||
void CG_ServerModelUnloaded(qhandle_t handle);
|
||||
void CG_ModelAnim(centity_t *cent, qboolean bDoShaderTime);
|
||||
void CG_AttachEntity(
|
||||
refEntity_t *entity, refEntity_t *parent, dtiki_t *tiki, int tagnum, qboolean use_angles, vec3_t attach_offset
|
||||
|
||||
+11
-2
@@ -116,6 +116,7 @@ cvar_t *ui_timemessage;
|
||||
// Added in OPM
|
||||
//
|
||||
cvar_t *cg_fov;
|
||||
cvar_t *cg_cheats;
|
||||
|
||||
/*
|
||||
=================
|
||||
@@ -214,6 +215,7 @@ void CG_RegisterCvars(void)
|
||||
//
|
||||
|
||||
cg_fov = cgi.Cvar_Get("cg_fov", "80", CVAR_ARCHIVE);
|
||||
cg_cheats = cgi.Cvar_Get("cheats", "0", CVAR_USERINFO | CVAR_SERVERINFO | CVAR_LATCH);
|
||||
}
|
||||
/*
|
||||
===============
|
||||
@@ -365,13 +367,20 @@ void CG_ProcessConfigString(int num, qboolean modelOnly)
|
||||
if (tiki) {
|
||||
CG_ProcessCacheInitCommands(tiki);
|
||||
}
|
||||
|
||||
CG_ServerModelLoaded(str, hModel);
|
||||
} else {
|
||||
// clear out the model
|
||||
if (hOldModel && CG_IsHandleUnique(hOldModel)) {
|
||||
// Handle uniqueness added in OPM
|
||||
if (hOldModel) {
|
||||
assert(CG_IsHandleUnique(hOldModel));
|
||||
cgi.R_UnregisterServerModel(hOldModel);
|
||||
}
|
||||
|
||||
cgs.model_draw[num - CS_MODELS] = 0;
|
||||
|
||||
if (!str || !str[0]) {
|
||||
CG_ServerModelUnloaded(hOldModel);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
+291
-78
@@ -1,6 +1,6 @@
|
||||
/*
|
||||
===========================================================================
|
||||
Copyright (C) 2023 the OpenMoHAA team
|
||||
Copyright (C) 2025 the OpenMoHAA team
|
||||
|
||||
This file is part of OpenMoHAA source code.
|
||||
|
||||
@@ -26,6 +26,33 @@ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
#include "cg_local.h"
|
||||
#include "tiki.h"
|
||||
|
||||
static qboolean cg_forceModelAllowed = qfalse;
|
||||
|
||||
/*
|
||||
===============
|
||||
CG_GetPlayerModelTiki
|
||||
===============
|
||||
*/
|
||||
const char *CG_GetPlayerModelTiki(const char *modelName)
|
||||
{
|
||||
return va("models/player/%s.tik", modelName);
|
||||
}
|
||||
|
||||
/*
|
||||
===============
|
||||
CG_GetPlayerLocalModelTiki
|
||||
===============
|
||||
*/
|
||||
const char *CG_GetPlayerLocalModelTiki(const char *modelName)
|
||||
{
|
||||
return va("models/player/%s_fps.tik", modelName);
|
||||
}
|
||||
|
||||
/*
|
||||
===============
|
||||
CG_PlayerTeamIcon
|
||||
===============
|
||||
*/
|
||||
void CG_PlayerTeamIcon(refEntity_t *pModel, entityState_t *pPlayerState)
|
||||
{
|
||||
qboolean bInArtillery, bInTeam, bSpecialIcon;
|
||||
@@ -187,13 +214,13 @@ CG_InterpolateAnimParms
|
||||
Interpolate between current and next entity
|
||||
===============
|
||||
*/
|
||||
void CG_InterpolateAnimParms(entityState_t* state, entityState_t* sNext, refEntity_t* model)
|
||||
void CG_InterpolateAnimParms(entityState_t *state, entityState_t *sNext, refEntity_t *model)
|
||||
{
|
||||
static cvar_t *vmEntity = NULL;
|
||||
int i;
|
||||
float t;
|
||||
float animLength;
|
||||
float t1, t2;
|
||||
int i;
|
||||
float t;
|
||||
float animLength;
|
||||
float t1, t2;
|
||||
|
||||
if (!vmEntity) {
|
||||
vmEntity = cgi.Cvar_Get("viewmodelanim", "1", 0);
|
||||
@@ -202,7 +229,7 @@ void CG_InterpolateAnimParms(entityState_t* state, entityState_t* sNext, refEnti
|
||||
if (sNext && sNext->usageIndex == state->usageIndex) {
|
||||
t1 = cg.time - cg.snap->serverTime;
|
||||
t2 = cg.nextSnap->serverTime - cg.snap->serverTime;
|
||||
t = t1 / t2;
|
||||
t = t1 / t2;
|
||||
|
||||
model->actionWeight = (sNext->actionWeight - state->actionWeight) * t + state->actionWeight;
|
||||
|
||||
@@ -214,7 +241,8 @@ void CG_InterpolateAnimParms(entityState_t* state, entityState_t* sNext, refEnti
|
||||
(sNext->frameInfo[i].weight - state->frameInfo[i].weight) * t + state->frameInfo[i].weight;
|
||||
|
||||
if (sNext->frameInfo[i].time >= state->frameInfo[i].time) {
|
||||
model->frameInfo[i].time = (sNext->frameInfo[i].time - state->frameInfo[i].time) * t + state->frameInfo[i].time;
|
||||
model->frameInfo[i].time =
|
||||
(sNext->frameInfo[i].time - state->frameInfo[i].time) * t + state->frameInfo[i].time;
|
||||
} else {
|
||||
animLength = cgi.Anim_Time(model->tiki, sNext->frameInfo[i].index);
|
||||
if (!animLength) {
|
||||
@@ -298,20 +326,20 @@ CG_CastFootShadow
|
||||
Cast complex foot shadow using lights
|
||||
===============
|
||||
*/
|
||||
void CG_CastFootShadow(const vec_t* vLightPos, vec_t* vLightIntensity, int iTag, refEntity_t* model)
|
||||
void CG_CastFootShadow(const vec_t *vLightPos, vec_t *vLightIntensity, int iTag, refEntity_t *model)
|
||||
{
|
||||
int i;
|
||||
float fAlpha;
|
||||
float fLength;
|
||||
float fWidth;
|
||||
float fAlphaOfs;
|
||||
float fOfs;
|
||||
float fPitchCos;
|
||||
vec3_t vPos;
|
||||
vec3_t vEnd;
|
||||
vec3_t vDelta;
|
||||
vec3_t vLightAngles;
|
||||
trace_t trace;
|
||||
int i;
|
||||
float fAlpha;
|
||||
float fLength;
|
||||
float fWidth;
|
||||
float fAlphaOfs;
|
||||
float fOfs;
|
||||
float fPitchCos;
|
||||
vec3_t vPos;
|
||||
vec3_t vEnd;
|
||||
vec3_t vDelta;
|
||||
vec3_t vLightAngles;
|
||||
trace_t trace;
|
||||
orientation_t oFoot;
|
||||
|
||||
VectorCopy(model->origin, vPos);
|
||||
@@ -321,8 +349,7 @@ void CG_CastFootShadow(const vec_t* vLightPos, vec_t* vLightIntensity, int iTag,
|
||||
VectorMA(vPos, vEnd[i], model->axis[i], vPos);
|
||||
}
|
||||
|
||||
if (cg_shadowdebug->integer)
|
||||
{
|
||||
if (cg_shadowdebug->integer) {
|
||||
vec3_t vDir;
|
||||
|
||||
//
|
||||
@@ -373,12 +400,11 @@ void CG_CastFootShadow(const vec_t* vLightPos, vec_t* vLightIntensity, int iTag,
|
||||
}
|
||||
|
||||
fLength = fPitchCos * fPitchCos * 32.0 + fPitchCos * 8.0 + 10.0;
|
||||
fOfs = 0.5 - (-4.1 / tan(DEG2RAD(vLightAngles[0])) + 4.0 - fLength) / fLength * 0.5;
|
||||
fOfs = 0.5 - (-4.1 / tan(DEG2RAD(vLightAngles[0])) + 4.0 - fLength) / fLength * 0.5;
|
||||
VectorMA(vPos, -96.0, vDelta, vEnd);
|
||||
CG_Trace(&trace, vPos, vec3_origin, vec3_origin, vEnd, 0, MASK_FOOTSHADOW, qfalse, qtrue, "CG_CastFootShadow");
|
||||
|
||||
if (cg_shadowdebug->integer)
|
||||
{
|
||||
|
||||
if (cg_shadowdebug->integer) {
|
||||
cgi.R_DebugLine(vPos, vLightPos, 0.75, 0.75, 0.5, 1.0);
|
||||
cgi.R_DebugLine(vPos, vEnd, 1.0, 1.0, 1.0, 1.0);
|
||||
}
|
||||
@@ -392,7 +418,7 @@ void CG_CastFootShadow(const vec_t* vLightPos, vec_t* vLightIntensity, int iTag,
|
||||
trace.fraction = 0;
|
||||
}
|
||||
|
||||
fWidth = 10.f - (1.f - trace.fraction) * 6.f;
|
||||
fWidth = 10.f - (1.f - trace.fraction) * 6.f;
|
||||
fAlphaOfs = (1.f - trace.fraction) * fAlpha;
|
||||
|
||||
fAlpha = Q_max(vLightIntensity[0], Q_max(vLightIntensity[1], vLightIntensity[2]));
|
||||
@@ -445,13 +471,21 @@ CG_CastSimpleFeetShadow
|
||||
Cast basic feet shadow
|
||||
===============
|
||||
*/
|
||||
void CG_CastSimpleFeetShadow(const trace_t* pTrace, float fWidth, float fAlpha, int iRightTag, int iLeftTag, const dtiki_t* tiki, refEntity_t* model)
|
||||
void CG_CastSimpleFeetShadow(
|
||||
const trace_t *pTrace,
|
||||
float fWidth,
|
||||
float fAlpha,
|
||||
int iRightTag,
|
||||
int iLeftTag,
|
||||
const dtiki_t *tiki,
|
||||
refEntity_t *model
|
||||
)
|
||||
{
|
||||
int i;
|
||||
float fShadowYaw;
|
||||
float fLength;
|
||||
vec3_t vPos, vRightPos, vLeftPos;
|
||||
vec3_t vDelta;
|
||||
int i;
|
||||
float fShadowYaw;
|
||||
float fLength;
|
||||
vec3_t vPos, vRightPos, vLeftPos;
|
||||
vec3_t vDelta;
|
||||
orientation_t oFoot;
|
||||
|
||||
//
|
||||
@@ -485,7 +519,7 @@ void CG_CastSimpleFeetShadow(const trace_t* pTrace, float fWidth, float fAlpha,
|
||||
|
||||
// get the facing yaw
|
||||
fShadowYaw = vectoyaw(vDelta);
|
||||
fLength = VectorNormalize(vDelta) * 0.5 + 12;
|
||||
fLength = VectorNormalize(vDelta) * 0.5 + 12;
|
||||
if (fLength < fWidth * 0.7) {
|
||||
fLength = fWidth * 0.7;
|
||||
}
|
||||
@@ -550,15 +584,13 @@ qboolean CG_EntityShadow(centity_t *cent, refEntity_t *model)
|
||||
}
|
||||
|
||||
if (iTagR != -1) {
|
||||
int iNumLights, iCurrLight;
|
||||
int iNumLights, iCurrLight;
|
||||
vec3_t avLightPos[16], avLightIntensity[16];
|
||||
|
||||
iNumLights = Q_clamp(cg_shadowscount->integer, 1, 8);
|
||||
iNumLights = cgi.R_GatherLightSources(model->origin, avLightPos, avLightIntensity, iNumLights);
|
||||
if (iNumLights)
|
||||
{
|
||||
for (iCurrLight = 0; iCurrLight < iNumLights; iCurrLight++)
|
||||
{
|
||||
if (iNumLights) {
|
||||
for (iCurrLight = 0; iCurrLight < iNumLights; iCurrLight++) {
|
||||
CG_CastFootShadow(avLightPos[iCurrLight], avLightIntensity[iCurrLight], iTagL, model);
|
||||
CG_CastFootShadow(avLightPos[iCurrLight], avLightIntensity[iCurrLight], iTagR, model);
|
||||
}
|
||||
@@ -725,6 +757,11 @@ void CG_AttachEntity(
|
||||
VectorAdd(entity->origin, vOrigin, entity->lightingOrigin);
|
||||
}
|
||||
|
||||
/*
|
||||
===============
|
||||
CG_AttachEyeEntity
|
||||
===============
|
||||
*/
|
||||
void CG_AttachEyeEntity(
|
||||
refEntity_t *entity, refEntity_t *parent, dtiki_t *tiki, int tagnum, qboolean use_angles, vec_t *attach_offset
|
||||
)
|
||||
@@ -737,8 +774,7 @@ void CG_AttachEyeEntity(
|
||||
AnglesToAxis(cg.refdefViewAngles, entity->axis);
|
||||
}
|
||||
|
||||
if (attach_offset[0] || attach_offset[1] || attach_offset[2])
|
||||
{
|
||||
if (attach_offset[0] || attach_offset[1] || attach_offset[2]) {
|
||||
for (i = 0; i < 3; i++) {
|
||||
VectorMA(entity->origin, attach_offset[i], entity->axis[i], entity->origin);
|
||||
}
|
||||
@@ -750,56 +786,219 @@ void CG_AttachEyeEntity(
|
||||
VectorCopy(parent->lightingOrigin, entity->lightingOrigin);
|
||||
}
|
||||
|
||||
/*
|
||||
===============
|
||||
CG_IsValidServerModel
|
||||
===============
|
||||
*/
|
||||
qboolean CG_IsValidServerModel(const char *modelpath)
|
||||
{
|
||||
const char *str;
|
||||
int i;
|
||||
|
||||
for (i = 1; i < MAX_MODELS; i++) {
|
||||
str = CG_ConfigString(CS_MODELS + i);
|
||||
if (!Q_stricmp(str, modelpath)) {
|
||||
return qtrue;
|
||||
}
|
||||
}
|
||||
|
||||
return qfalse;
|
||||
}
|
||||
|
||||
/*
|
||||
===============
|
||||
CG_CheckValidModels
|
||||
|
||||
This verifies the allied player model and the german player model:
|
||||
- If they don't exist on the client, reset to the default allied player model
|
||||
- If they don't exist on the server, don't allow forceModel so the client explicitly know the skin isn't supported
|
||||
===============
|
||||
*/
|
||||
void CG_CheckValidModels()
|
||||
{
|
||||
const char *modelpath;
|
||||
qboolean isDirty = qfalse;
|
||||
|
||||
if (dm_playermodel->modified) {
|
||||
// Check for allied model
|
||||
modelpath = va("models/player/%s.tik", dm_playermodel->string);
|
||||
if (!cgi.R_RegisterModel(modelpath)) {
|
||||
cgi.Printf(
|
||||
"Allied model '%s' is invalid, resetting to '%s'\n", dm_playermodel->string, dm_playermodel->resetString
|
||||
);
|
||||
|
||||
cgi.Cvar_Set("dm_playermodel", dm_playermodel->resetString);
|
||||
modelpath = va("models/player/%s.tik", dm_playermodel->string);
|
||||
}
|
||||
|
||||
cg.serverAlliedModelValid = CG_IsValidServerModel(modelpath);
|
||||
}
|
||||
|
||||
if (dm_playergermanmodel->modified) {
|
||||
// Check for axis model
|
||||
modelpath = va("models/player/%s.tik", dm_playergermanmodel->string);
|
||||
if (!cgi.R_RegisterModel(modelpath)) {
|
||||
cgi.Printf(
|
||||
"Allied model '%s' is invalid, resetting to '%s'\n",
|
||||
dm_playergermanmodel->string,
|
||||
dm_playergermanmodel->resetString
|
||||
);
|
||||
|
||||
cgi.Cvar_Set("dm_playergermanmodel", dm_playergermanmodel->resetString);
|
||||
modelpath = va("models/player/%s.tik", dm_playergermanmodel->string);
|
||||
}
|
||||
|
||||
cg.serverAxisModelValid = CG_IsValidServerModel(modelpath);
|
||||
}
|
||||
|
||||
if (dm_playermodel->modified || dm_playergermanmodel->modified) {
|
||||
cg_forceModelAllowed = cg.serverAlliedModelValid && cg.serverAxisModelValid;
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
===============
|
||||
CG_ServerModelLoaded
|
||||
===============
|
||||
*/
|
||||
void CG_ServerModelLoaded(const char *name, qhandle_t handle)
|
||||
{
|
||||
if (!Q_stricmpn(name, "models/player/", 14) && (!cg.serverAlliedModelValid || !cg.serverAxisModelValid)) {
|
||||
char modelName[MAX_QPATH];
|
||||
COM_StripExtension(name + 14, modelName, sizeof(modelName));
|
||||
|
||||
//
|
||||
// The player model has been loaded on the server
|
||||
// so try again parsing
|
||||
//
|
||||
if (!Q_stricmp(modelName, dm_playermodel->string)) {
|
||||
dm_playermodel->modified = qtrue;
|
||||
}
|
||||
if (!Q_stricmp(modelName, dm_playergermanmodel->string)) {
|
||||
dm_playergermanmodel->modified = qtrue;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
===============
|
||||
CG_ServerModelUnloaded
|
||||
===============
|
||||
*/
|
||||
void CG_ServerModelUnloaded(qhandle_t handle)
|
||||
{
|
||||
#if 0
|
||||
if (cg.serverAlliedModelValid && handle == cg.hAlliedPlayerModelHandle) {
|
||||
dm_playermodel->modified = qtrue;
|
||||
}
|
||||
if (cg.serverAxisModelValid && handle == cg.hAxisPlayerModelHandle) {
|
||||
dm_playergermanmodel->modified = qtrue;
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
/*
|
||||
===============
|
||||
CG_UpdateForceModels
|
||||
===============
|
||||
*/
|
||||
void CG_UpdateForceModels()
|
||||
{
|
||||
qhandle_t hModel;
|
||||
char* pszAlliesPartial;
|
||||
char* pszAxisPartial;
|
||||
char szAlliesModel[256];
|
||||
char szAxisModel[256];
|
||||
char *pszAlliesPartial;
|
||||
char *pszAxisPartial;
|
||||
char szAlliesModel[256];
|
||||
char szAxisModel[256];
|
||||
qboolean isDirty;
|
||||
|
||||
if (cg.pAlliedPlayerModel && cg.pAxisPlayerModel && !dm_playermodel->modified && !dm_playergermanmodel->modified) {
|
||||
isDirty = dm_playermodel->modified || dm_playergermanmodel->modified || cg_forceModel->modified;
|
||||
|
||||
if (!cg_forceModelAllowed) {
|
||||
if (isDirty) {
|
||||
cgi.Printf(
|
||||
"One or more of the selected players model don't exist on the server or are not loaded, using the "
|
||||
"default skin\n"
|
||||
);
|
||||
}
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
if (cg.pAlliedPlayerModel && cg.pAxisPlayerModel && !isDirty) {
|
||||
return;
|
||||
}
|
||||
|
||||
pszAlliesPartial = dm_playermodel->string;
|
||||
pszAxisPartial = dm_playergermanmodel->string;
|
||||
pszAxisPartial = dm_playergermanmodel->string;
|
||||
|
||||
Com_sprintf(szAlliesModel, sizeof(szAlliesModel), "models/player/%s.tik", pszAlliesPartial);
|
||||
Com_sprintf(szAxisModel, sizeof(szAxisModel), "models/player/%s.tik", pszAxisPartial);
|
||||
hModel = cgi.R_RegisterModel(szAlliesModel);
|
||||
if (!hModel) hModel = cgi.R_RegisterModel("models/player/american_army.tik");
|
||||
|
||||
hModel = cg.serverAlliedModelValid ? cgi.R_RegisterModel(szAlliesModel) : 0;
|
||||
if (!hModel) {
|
||||
Com_sprintf(szAlliesModel, sizeof(szAlliesModel), "models/player/%s.tik", dm_playermodel->resetString);
|
||||
hModel = cgi.R_RegisterModel(szAlliesModel);
|
||||
}
|
||||
|
||||
if (hModel) {
|
||||
cg.hAlliedPlayerModelHandle = hModel;
|
||||
cg.pAlliedPlayerModel = cgi.R_Model_GetHandle(hModel);
|
||||
cg.pAlliedPlayerModel = cgi.R_Model_GetHandle(hModel);
|
||||
if (!cg.pAlliedPlayerModel) {
|
||||
cg.hAlliedPlayerModelHandle = 0;
|
||||
}
|
||||
} else {
|
||||
cg.hAlliedPlayerModelHandle = 0;
|
||||
cg.pAlliedPlayerModel = 0;
|
||||
cg.pAlliedPlayerModel = NULL;
|
||||
}
|
||||
|
||||
hModel = cgi.R_RegisterModel(szAxisModel);
|
||||
if (!hModel) hModel = cgi.R_RegisterModel("models/player/german_wehrmacht_soldier.tik");
|
||||
hModel = cg.serverAxisModelValid ? cgi.R_RegisterModel(szAxisModel) : 0;
|
||||
if (!hModel) {
|
||||
Com_sprintf(szAxisModel, sizeof(szAxisModel), "models/player/%s.tik", dm_playergermanmodel->resetString);
|
||||
hModel = cgi.R_RegisterModel(szAxisModel);
|
||||
}
|
||||
|
||||
if (hModel) {
|
||||
cg.hAxisPlayerModelHandle = hModel;
|
||||
cg.pAxisPlayerModel = cgi.R_Model_GetHandle(hModel);
|
||||
cg.pAxisPlayerModel = cgi.R_Model_GetHandle(hModel);
|
||||
if (!cg.pAxisPlayerModel) {
|
||||
cg.hAxisPlayerModelHandle = 0;
|
||||
}
|
||||
} else {
|
||||
cg.hAxisPlayerModelHandle = 0;
|
||||
cg.pAxisPlayerModel = 0;
|
||||
cg.pAxisPlayerModel = 0;
|
||||
}
|
||||
|
||||
// Clear modified flag
|
||||
dm_playermodel->modified = qfalse;
|
||||
dm_playergermanmodel->modified = qfalse;
|
||||
//dm_playermodel->modified = qfalse;
|
||||
//dm_playergermanmodel->modified = qfalse;
|
||||
}
|
||||
|
||||
/*
|
||||
===============
|
||||
CG_ProcessPlayerModel
|
||||
|
||||
Checks player models, and update force models
|
||||
===============
|
||||
*/
|
||||
void CG_ProcessPlayerModel()
|
||||
{
|
||||
CG_CheckValidModels();
|
||||
if (cg_forceModel->integer) {
|
||||
CG_UpdateForceModels();
|
||||
}
|
||||
|
||||
// Clear modified flag
|
||||
dm_playermodel->modified = qfalse;
|
||||
dm_playergermanmodel->modified = qfalse;
|
||||
cg_forceModel->modified = qfalse;
|
||||
}
|
||||
|
||||
/*
|
||||
===============
|
||||
CG_ModelAnim
|
||||
===============
|
||||
*/
|
||||
void CG_ModelAnim(centity_t *cent, qboolean bDoShaderTime)
|
||||
{
|
||||
entityState_t *s1;
|
||||
@@ -809,11 +1008,17 @@ void CG_ModelAnim(centity_t *cent, qboolean bDoShaderTime)
|
||||
vec3_t vMins, vMaxs, vTmp;
|
||||
const char *szTagName;
|
||||
int iAnimFlags;
|
||||
qboolean bThirdPerson = qfalse;
|
||||
|
||||
s1 = ¢->currentState;
|
||||
|
||||
if ((cg.snap->ps.pm_flags & PMF_INTERMISSION) && s1->number == cg.snap->ps.clientNum && !cg_3rd_person->integer) {
|
||||
// don't render if in intermission and the client is self without 3rd person
|
||||
bThirdPerson |= cg_3rd_person->integer ? qtrue : qfalse;
|
||||
// Fixed in OPM
|
||||
// Draw world model body when in camera
|
||||
bThirdPerson |= (cg.snap->ps.pm_flags & PMF_CAMERA_VIEW && !(cg.snap->ps.pm_flags & PMF_TURRET));
|
||||
|
||||
if ((cg.snap->ps.pm_flags & PMF_INTERMISSION) && s1->number == cg.snap->ps.clientNum && !bThirdPerson) {
|
||||
// Don't render the first-person model during intermission
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -876,7 +1081,7 @@ void CG_ModelAnim(centity_t *cent, qboolean bDoShaderTime)
|
||||
model.radius = VectorLength(vTmp) * 0.5;
|
||||
|
||||
if (s1->number == cg.snap->ps.clientNum) {
|
||||
if (!cg_3rd_person->integer) {
|
||||
if (!bThirdPerson) {
|
||||
PmoveAdjustAngleSettings_Client(
|
||||
cg.refdefViewAngles, cent->lerpAngles, &cg.predicted_player_state, ¢->currentState
|
||||
);
|
||||
@@ -940,8 +1145,8 @@ void CG_ModelAnim(centity_t *cent, qboolean bDoShaderTime)
|
||||
model.tiki = cgi.R_Model_GetHandle(cgs.model_draw[s1->modelindex]);
|
||||
|
||||
if (s1->number != cg.snap->ps.clientNum && (s1->eType == ET_PLAYER || (s1->eFlags & EF_DEAD))) {
|
||||
if (cg_forceModel->integer) {
|
||||
CG_UpdateForceModels();
|
||||
if (cg_forceModel->integer && cg_forceModelAllowed) {
|
||||
//CG_UpdateForceModels();
|
||||
|
||||
if (s1->eFlags & EF_AXIS) {
|
||||
model.hModel = cg.hAxisPlayerModelHandle;
|
||||
@@ -965,9 +1170,9 @@ void CG_ModelAnim(centity_t *cent, qboolean bDoShaderTime)
|
||||
if (!model.hModel || !model.tiki) {
|
||||
// Use a model in case it still doesn't exist
|
||||
if (s1->eFlags & EF_AXIS) {
|
||||
model.hModel = cgi.R_RegisterModel("models/player/german_wehrmacht_soldier.tik");
|
||||
model.hModel = cgi.R_RegisterModel(CG_GetPlayerModelTiki(dm_playergermanmodel->resetString));
|
||||
} else {
|
||||
model.hModel = cgi.R_RegisterModel("models/player/american_army.tik");
|
||||
model.hModel = cgi.R_RegisterModel(CG_GetPlayerModelTiki(dm_playermodel->resetString));
|
||||
}
|
||||
model.tiki = cgi.R_Model_GetHandle(model.hModel);
|
||||
model.hOldModel = cgs.model_draw[s1->modelindex];
|
||||
@@ -1002,13 +1207,21 @@ void CG_ModelAnim(centity_t *cent, qboolean bDoShaderTime)
|
||||
return;
|
||||
}
|
||||
|
||||
if (s1->parent != cg.snap->ps.clientNum || cg_3rd_person->integer) {
|
||||
if (s1->parent != cg.snap->ps.clientNum || bThirdPerson) {
|
||||
// attach the model to the world model
|
||||
if (parent->hOldModel) {
|
||||
tiki = cgi.R_Model_GetHandle(parent->hOldModel);
|
||||
|
||||
// Fixed in OPM
|
||||
// Added checks to make sure the old model's tiki is valid
|
||||
if (parent->hOldModel && (tiki = cgi.R_Model_GetHandle(parent->hOldModel))) {
|
||||
szTagName = cgi.Tag_NameForNum(tiki, s1->tag_num & TAG_MASK);
|
||||
tiki = cgi.R_Model_GetHandle(parent->hModel);
|
||||
iTagNum = cgi.Tag_NumForName(tiki, szTagName);
|
||||
// Fixed in OPM
|
||||
// Added checks to make sure the tag name is valid
|
||||
if (szTagName) {
|
||||
tiki = cgi.R_Model_GetHandle(parent->hModel);
|
||||
iTagNum = cgi.Tag_NumForName(tiki, szTagName);
|
||||
} else {
|
||||
iTagNum = 0;
|
||||
}
|
||||
} else {
|
||||
tiki = cgi.R_Model_GetHandle(parent->hModel);
|
||||
iTagNum = s1->tag_num;
|
||||
@@ -1076,8 +1289,8 @@ void CG_ModelAnim(centity_t *cent, qboolean bDoShaderTime)
|
||||
// set surfaces
|
||||
memcpy(model.surfaces, s1->surfaces, MAX_MODEL_SURFACES);
|
||||
|
||||
if (!(s1->renderfx & RF_VIEWMODEL) && s1->parent != ENTITYNUM_NONE && s1->parent == cg.snap->ps.clientNum
|
||||
&& ((!cg_drawviewmodel->integer && !cg_3rd_person->integer) || cg.snap->ps.stats[STAT_INZOOM])) {
|
||||
if (!(s1->renderfx & RF_ALWAYSDRAW) && s1->parent != ENTITYNUM_NONE && s1->parent == cg.snap->ps.clientNum
|
||||
&& ((!cg_drawviewmodel->integer && !bThirdPerson) || cg.snap->ps.stats[STAT_INZOOM])) {
|
||||
// hide all surfaces while zooming or if the viewmodel shouldn't be shown
|
||||
for (i = 0; i < MAX_MODEL_SURFACES; i++) {
|
||||
model.surfaces[i] |= MDL_SURFACE_NODRAW;
|
||||
@@ -1162,7 +1375,7 @@ void CG_ModelAnim(centity_t *cent, qboolean bDoShaderTime)
|
||||
}
|
||||
|
||||
if (s1->number == cg.snap->ps.clientNum) {
|
||||
if ((!cg.bFPSModelLastFrame && !cg_3rd_person->integer) || (cg.bFPSModelLastFrame && cg_3rd_person->integer)) {
|
||||
if ((!cg.bFPSModelLastFrame && !bThirdPerson) || (cg.bFPSModelLastFrame && bThirdPerson)) {
|
||||
// reset the animations when toggling 3rd person
|
||||
for (i = 0; i < MAX_FRAMEINFOS; i++) {
|
||||
cent->animLast[i] = -1;
|
||||
@@ -1171,7 +1384,7 @@ void CG_ModelAnim(centity_t *cent, qboolean bDoShaderTime)
|
||||
cent->animLastWeight = 0;
|
||||
cent->usageIndexLast = 0;
|
||||
|
||||
cg.bFPSModelLastFrame = !cg_3rd_person->integer;
|
||||
cg.bFPSModelLastFrame = !bThirdPerson;
|
||||
}
|
||||
|
||||
// player footsteps, walking/falling
|
||||
@@ -1188,7 +1401,7 @@ void CG_ModelAnim(centity_t *cent, qboolean bDoShaderTime)
|
||||
}
|
||||
}
|
||||
|
||||
if (!cg_3rd_person->integer) {
|
||||
if (!bThirdPerson) {
|
||||
// first person view
|
||||
|
||||
if (!(cg.predicted_player_state.pm_flags & PMF_CAMERA_VIEW)
|
||||
@@ -1213,9 +1426,9 @@ void CG_ModelAnim(centity_t *cent, qboolean bDoShaderTime)
|
||||
}
|
||||
} else {
|
||||
if (cg.snap->ps.stats[STAT_TEAM] == TEAM_AXIS) {
|
||||
hModel = cgi.R_RegisterModel("models/player/german_wehrmacht_soldier_fps.tik");
|
||||
hModel = cgi.R_RegisterModel(CG_GetPlayerLocalModelTiki(dm_playergermanmodel->resetString));
|
||||
} else {
|
||||
hModel = cgi.R_RegisterModel("models/player/american_army_fps.tik");
|
||||
hModel = cgi.R_RegisterModel(CG_GetPlayerLocalModelTiki(dm_playermodel->resetString));
|
||||
}
|
||||
|
||||
if (hModel) {
|
||||
@@ -1337,7 +1550,7 @@ void CG_ModelAnim(centity_t *cent, qboolean bDoShaderTime)
|
||||
if (!((cent->animLastWeight >> i) & 1) || model.frameInfo[i].index != cent->animLast[i]) {
|
||||
CG_ProcessEntityCommands(TIKI_FRAME_ENTRY, model.frameInfo[i].index, s1->number, &model, cent);
|
||||
if (cent->animLastTimes[i] == -1) {
|
||||
cent->animLast[i] = model.frameInfo[i].index;
|
||||
cent->animLast[i] = model.frameInfo[i].index;
|
||||
cent->animLastTimes[i] = model.frameInfo[i].time;
|
||||
} else {
|
||||
cent->animLastTimes[i] = 0;
|
||||
|
||||
+31
-17
@@ -102,26 +102,29 @@ void CG_Rain(centity_t *cent)
|
||||
|
||||
cgi.R_ModelBounds(cgs.inlineDrawModel[cent->currentState.modelindex], mins, maxs);
|
||||
|
||||
// Fixed in 2.0
|
||||
// Use cg.refdef.vieworg instead of cg.snap.ps.origin
|
||||
|
||||
vOmins[0] = mins[0] + cent->lerpOrigin[0];
|
||||
if (vOmins[0] < cg.snap->ps.origin[0] - cg.rain.min_dist) {
|
||||
vOmins[0] = cg.snap->ps.origin[0] - cg.rain.min_dist;
|
||||
if (vOmins[0] < cg.refdef.vieworg[0] - cg.rain.min_dist) {
|
||||
vOmins[0] = cg.refdef.vieworg[0] - cg.rain.min_dist;
|
||||
}
|
||||
|
||||
vOmins[1] = mins[1] + cent->lerpOrigin[1];
|
||||
if (vOmins[1] < cg.snap->ps.origin[1] - cg.rain.min_dist) {
|
||||
vOmins[1] = cg.snap->ps.origin[1] - cg.rain.min_dist;
|
||||
if (vOmins[1] < cg.refdef.vieworg[1] - cg.rain.min_dist) {
|
||||
vOmins[1] = cg.refdef.vieworg[1] - cg.rain.min_dist;
|
||||
}
|
||||
|
||||
vOmins[2] = mins[2] + cent->lerpOrigin[2];
|
||||
|
||||
vOmaxs[0] = maxs[0] + cent->lerpOrigin[0];
|
||||
if (vOmaxs[0] > cg.rain.min_dist + cg.snap->ps.origin[0]) {
|
||||
vOmaxs[0] = cg.rain.min_dist + cg.snap->ps.origin[0];
|
||||
if (vOmaxs[0] > cg.refdef.vieworg[0] + cg.rain.min_dist) {
|
||||
vOmaxs[0] = cg.refdef.vieworg[0] + cg.rain.min_dist;
|
||||
}
|
||||
|
||||
vOmaxs[1] = maxs[1] + cent->lerpOrigin[1];
|
||||
if (vOmaxs[1] > cg.rain.min_dist + cg.snap->ps.origin[1]) {
|
||||
vOmaxs[1] = cg.rain.min_dist + cg.snap->ps.origin[1];
|
||||
if (vOmaxs[1] > cg.refdef.vieworg[1] + cg.rain.min_dist) {
|
||||
vOmaxs[1] = cg.refdef.vieworg[1] + cg.rain.min_dist;
|
||||
}
|
||||
|
||||
vOmaxs[2] = maxs[2] + cent->lerpOrigin[2];
|
||||
@@ -168,26 +171,37 @@ void CG_Rain(centity_t *cent)
|
||||
}
|
||||
|
||||
for (i = 0; i < iNumSpawn; ++i) {
|
||||
iLife = (int)(vOe[2] / ((float)(iRandom % cg.rain.speed_vary) + cg.rain.speed) * 1000.0);
|
||||
vStart[0] = (float)(iRandom % (int)(vOe[0] + 1.0)) + vOmins[0];
|
||||
iRandom = ((214013 * iRandom + 2531011) >> 16) & 0x7FFF;
|
||||
vStart[1] = (float)(iRandom % (int)(vOe[1] + 1.0)) + vOmins[1];
|
||||
vStart[2] = vOmaxs[2];
|
||||
iRandom = ((214013 * iRandom + 2531011) >> 16) & 0x7FFF;
|
||||
// Fixed in 2.0
|
||||
// Use random height instead of the max height to avoid waiting for it to fall down
|
||||
vStart[2] = (float)(iRandom % (int)(vOe[2] + 1.0)) + vOmins[2];
|
||||
|
||||
if (cg.snap) {
|
||||
vLength[0] = cg.snap->ps.origin[0] - vStart[0];
|
||||
vLength[1] = cg.snap->ps.origin[1] - vStart[1];
|
||||
vLength[2] = 0.0;
|
||||
if (cg.rain.min_dist * cg.rain.min_dist < VectorLengthSquared(vLength)) {
|
||||
continue;
|
||||
}
|
||||
VectorSubtract(cg.refdef.vieworg, vStart, vLength);
|
||||
vLength[2] = 0;
|
||||
|
||||
if (VectorLengthSquared(vLength) > Square(cg.rain.min_dist)) {
|
||||
continue;
|
||||
}
|
||||
|
||||
iRandom = ((214013 * iRandom + 2531011) >> 16) & 0x7FFF;
|
||||
|
||||
vEnd[0] = (float)(iRandom % cg.rain.slant) + vStart[0] + vss_wind_x->value;
|
||||
iRandom = ((214013 * iRandom + 2531011) >> 16) & 0x7FFF;
|
||||
vEnd[1] = (float)(iRandom % cg.rain.slant) + vStart[1] + vss_wind_y->value;
|
||||
vEnd[2] = vOmins[2];
|
||||
|
||||
// Fixed in 2.0
|
||||
// Use individual particle's origin to determine the life rather than the bounding box
|
||||
iLife = (int)((vStart[2] - vOmins[2]) / ((float)(iRandom % cg.rain.speed_vary) + cg.rain.speed) * 1000.0);
|
||||
if (iLife > 10000) {
|
||||
// Fixed in 2.0
|
||||
// Rain particles must not last longer than 10 seconds
|
||||
iLife = 10000;
|
||||
}
|
||||
|
||||
CG_CreateBeam(
|
||||
vStart,
|
||||
vec_zero,
|
||||
|
||||
+89
-60
@@ -85,7 +85,12 @@ void CG_MakeBulletHoleSound(const vec3_t i_vPos, const vec3_t i_vNorm, int iLarg
|
||||
iSurfType = SURF_PUDDLE;
|
||||
}
|
||||
|
||||
if (trace.fraction == 1.0f || trace.startsolid || (trace.surfaceFlags & SURF_SKY)) {
|
||||
if (trace.fraction == 1) {
|
||||
// no reason to make a sound if it nothing was hit
|
||||
return;
|
||||
}
|
||||
|
||||
if ((trace.surfaceFlags & SURF_SKY) || !CG_CheckMakeMarkOnEntity(trace.entityNum)) {
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -253,7 +258,12 @@ CG_MakeBulletHole(const vec3_t i_vPos, const vec3_t i_vNorm, int iLarge, trace_t
|
||||
iSurfType = SURF_PUDDLE;
|
||||
}
|
||||
|
||||
if (trace.fraction == 1.0f || trace.startsolid || (trace.surfaceFlags & SURF_SKY)) {
|
||||
if (trace.fraction == 1.0f || trace.startsolid) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (trace.surfaceFlags & SURF_SKY) {
|
||||
// ignore sky surfaces
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -460,35 +470,36 @@ static void CG_MakeBulletTracerInternal(
|
||||
float alpha
|
||||
)
|
||||
{
|
||||
vec3_t vPos;
|
||||
int iBullet;
|
||||
int iContinueCount;
|
||||
int iDist;
|
||||
int iHeadDist;
|
||||
int iTravelDist;
|
||||
float fLen, fDist;
|
||||
trace_t trace;
|
||||
qboolean bStartInWater, bInWater;
|
||||
qboolean bBulletDone;
|
||||
qboolean bMadeTracer;
|
||||
vec3_t vDir;
|
||||
vec3_t vTrailStart;
|
||||
vec3_t vTraceStart;
|
||||
vec3_t vTraceEnd;
|
||||
vec3_t vTmp;
|
||||
int iNumImpacts;
|
||||
trace_t tImpacts[128];
|
||||
float fImpSndDistRA;
|
||||
static float fImpSndDistLA;
|
||||
float fImpSndDistRB;
|
||||
float fImpSndDistLB;
|
||||
int iImpSndIndexRA;
|
||||
int iImpSndIndexRB;
|
||||
int iImpSndIndexLB;
|
||||
float fVolume;
|
||||
float fPitch;
|
||||
float fZingDistA, fZingDistB, fZingDistC;
|
||||
vec3_t vZingPosA, vZingPosB, vZingPosC;
|
||||
vec3_t vPos;
|
||||
int iBullet;
|
||||
int iContinueCount;
|
||||
int iDist;
|
||||
int iHeadDist;
|
||||
int iTravelDist;
|
||||
float fLen, fDist;
|
||||
trace_t trace;
|
||||
qboolean bStartInWater, bInWater;
|
||||
qboolean bBulletDone;
|
||||
qboolean bMadeTracer;
|
||||
vec3_t vDir;
|
||||
vec3_t vTrailStart;
|
||||
vec3_t vTraceStart;
|
||||
vec3_t vTraceEnd;
|
||||
vec3_t vTmp;
|
||||
int iNumImpacts;
|
||||
trace_t tImpacts[128];
|
||||
float fImpSndDistRA;
|
||||
float fImpSndDistLA;
|
||||
float fImpSndDistRB;
|
||||
float fImpSndDistLB;
|
||||
int iImpSndIndexRA;
|
||||
int iImpSndIndexLA;
|
||||
int iImpSndIndexRB;
|
||||
int iImpSndIndexLB;
|
||||
float fVolume;
|
||||
float fPitch;
|
||||
float fZingDistA, fZingDistB, fZingDistC;
|
||||
vec3_t vZingPosA, vZingPosB, vZingPosC;
|
||||
|
||||
fZingDistB = 9999.0;
|
||||
fZingDistA = 9999.0;
|
||||
@@ -584,7 +595,8 @@ static void CG_MakeBulletTracerInternal(
|
||||
|| (trace.contents & CONTENTS_WATER))
|
||||
&& iContinueCount < 5) {
|
||||
if (bInWater) {
|
||||
VectorSubtract(trace.endpos, vDir, vTmp);
|
||||
VectorMA(trace.endpos, -1.0, vDir, vTmp);
|
||||
|
||||
if (!(trace.contents & CONTENTS_FLUID) && !(trace.surfaceFlags & SURF_PUDDLE)
|
||||
&& !(cgi.CM_PointContents(vTmp, 0) & CONTENTS_FLUID)) {
|
||||
CG_MakeBubbleTrail(vTrailStart, trace.endpos, iLarge, alpha);
|
||||
@@ -596,8 +608,7 @@ static void CG_MakeBulletTracerInternal(
|
||||
bInWater = qtrue;
|
||||
}
|
||||
|
||||
VectorAdd(vDir, vDir, vTraceStart);
|
||||
VectorAdd(vTraceStart, vTraceStart, trace.endpos);
|
||||
VectorMA(trace.endpos, 2.0, vDir, vTraceStart);
|
||||
|
||||
iContinueCount++;
|
||||
} else {
|
||||
@@ -659,46 +670,46 @@ static void CG_MakeBulletTracerInternal(
|
||||
if (iNumImpacts > 2) {
|
||||
fImpSndDistRA = 9999.0f;
|
||||
fImpSndDistRB = 9999.0f;
|
||||
iImpSndIndexRA = 0;
|
||||
iImpSndIndexRB = 0;
|
||||
fImpSndDistLA = 9999.0f;
|
||||
fImpSndDistLB = 9999.0f;
|
||||
iImpSndIndexRA = 0;
|
||||
iImpSndIndexLA = 0;
|
||||
iImpSndIndexRB = 0;
|
||||
iImpSndIndexLB = 0;
|
||||
|
||||
for (iBullet = 0; iBullet < iNumImpacts; iBullet++) {
|
||||
CG_MakeBulletHole(
|
||||
tImpacts[iImpSndIndexLB].endpos,
|
||||
tImpacts[iImpSndIndexLB].plane.normal,
|
||||
iLarge,
|
||||
&tImpacts[iImpSndIndexLB],
|
||||
qfalse
|
||||
tImpacts[iBullet].endpos, tImpacts[iBullet].plane.normal, iLarge, &tImpacts[iBullet], qfalse
|
||||
);
|
||||
|
||||
VectorSubtract(tImpacts[iImpSndIndexLB].endpos, cg.SoundOrg, vTmp);
|
||||
VectorSubtract(tImpacts[iBullet].endpos, cg.SoundOrg, vTmp);
|
||||
iHeadDist = VectorLength(vTmp);
|
||||
|
||||
if (DotProduct(vTmp, cg.SoundAxis[1]) <= 0.f) {
|
||||
if (iHeadDist < 9999.0f || iHeadDist < fImpSndDistLB) {
|
||||
if (iHeadDist < 9999.0f) {
|
||||
fImpSndDistRA = iHeadDist;
|
||||
fImpSndDistLB = 9999.0;
|
||||
if (iHeadDist < fImpSndDistLA || iHeadDist < fImpSndDistLB) {
|
||||
if (iHeadDist < fImpSndDistLA) {
|
||||
iImpSndIndexLB = iImpSndIndexLA;
|
||||
fImpSndDistLB = fImpSndDistLA;
|
||||
iImpSndIndexRA = iBullet;
|
||||
fImpSndDistRA = iHeadDist;
|
||||
} else if (iHeadDist < fImpSndDistLB) {
|
||||
fImpSndDistLB = iHeadDist;
|
||||
iImpSndIndexLB = iBullet;
|
||||
fImpSndDistLB = iHeadDist;
|
||||
}
|
||||
}
|
||||
} else {
|
||||
if (iHeadDist < fImpSndDistRA || iHeadDist < fImpSndDistRB) {
|
||||
if (iHeadDist < fImpSndDistRA) {
|
||||
iImpSndIndexRB = iImpSndIndexRA;
|
||||
fImpSndDistRB = fImpSndDistRA;
|
||||
iImpSndIndexRA = iBullet;
|
||||
fImpSndDistRA = iHeadDist;
|
||||
} else if (iHeadDist < fImpSndDistRB) {
|
||||
fImpSndDistRB = iHeadDist;
|
||||
iImpSndIndexRB = iBullet;
|
||||
fImpSndDistRB = iHeadDist;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
iImpSndIndexLB++;
|
||||
}
|
||||
|
||||
if (fImpSndDistRA < 9999.0f) {
|
||||
@@ -718,6 +729,24 @@ static void CG_MakeBulletTracerInternal(
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
if (fImpSndDistLA < 9999.0f) {
|
||||
CG_MakeBulletHoleSound(
|
||||
tImpacts[iImpSndIndexLA].endpos,
|
||||
tImpacts[iImpSndIndexLA].plane.normal,
|
||||
iLarge,
|
||||
&tImpacts[iImpSndIndexLA]
|
||||
);
|
||||
|
||||
if (fImpSndDistLB < 9999.0f) {
|
||||
CG_MakeBulletHoleSound(
|
||||
tImpacts[iImpSndIndexLB].endpos,
|
||||
tImpacts[iImpSndIndexLB].plane.normal,
|
||||
iLarge,
|
||||
&tImpacts[iImpSndIndexLB]
|
||||
);
|
||||
}
|
||||
}
|
||||
} else {
|
||||
for (iBullet = 0; iBullet < iNumImpacts; iBullet++) {
|
||||
CG_MakeBulletHole(
|
||||
@@ -1559,7 +1588,7 @@ void CG_ParseCGMessage_ver_15()
|
||||
vEndArray[0][0] = cgi.MSG_ReadCoord();
|
||||
vEndArray[0][1] = cgi.MSG_ReadCoord();
|
||||
vEndArray[0][2] = cgi.MSG_ReadCoord();
|
||||
iLarge = cgi.MSG_ReadBits(1);
|
||||
iLarge = cgi.MSG_ReadBits(2);
|
||||
|
||||
if (cgi.MSG_ReadBits(1)) {
|
||||
int iAlpha = cgi.MSG_ReadBits(10);
|
||||
@@ -1638,8 +1667,8 @@ void CG_ParseCGMessage_ver_15()
|
||||
CG_HudDrawFont(iInfo);
|
||||
break;
|
||||
|
||||
case CGM_NOTIFY_KILL:
|
||||
case CGM_NOTIFY_HIT:
|
||||
case CGM_NOTIFY_KILL:
|
||||
if (cg.snap) {
|
||||
const char *soundName;
|
||||
int iOldEnt;
|
||||
@@ -1647,12 +1676,11 @@ void CG_ParseCGMessage_ver_15()
|
||||
iOldEnt = current_entity_number;
|
||||
|
||||
current_entity_number = cg.snap->ps.clientNum;
|
||||
if (iType == CGM_NOTIFY_HIT) {
|
||||
soundName = "dm_kill_notify";
|
||||
if (iType == CGM_NOTIFY_KILL) {
|
||||
commandManager.PlaySound("dm_kill_notify", NULL, CHAN_LOCAL, 2.0, -1, -1, 1);
|
||||
} else {
|
||||
soundName = "dm_hit_notify";
|
||||
commandManager.PlaySound("dm_hit_notify", NULL, CHAN_LOCAL, 2.0, -1, -1, 1);
|
||||
}
|
||||
commandManager.PlaySound(soundName, NULL, CHAN_LOCAL, 2.0, -1, -1, 1);
|
||||
|
||||
current_entity_number = iOldEnt;
|
||||
}
|
||||
@@ -1660,18 +1688,19 @@ void CG_ParseCGMessage_ver_15()
|
||||
|
||||
case CGM_VOICE_CHAT:
|
||||
{
|
||||
qboolean bLocal;
|
||||
int iOldEnt;
|
||||
|
||||
vStart[0] = cgi.MSG_ReadCoord();
|
||||
vStart[1] = cgi.MSG_ReadCoord();
|
||||
vStart[2] = cgi.MSG_ReadCoord();
|
||||
iLarge = cgi.MSG_ReadBits(1);
|
||||
bLocal = cgi.MSG_ReadBits(1);
|
||||
iInfo = cgi.MSG_ReadBits(6);
|
||||
szTmp = cgi.MSG_ReadString();
|
||||
|
||||
iOldEnt = current_entity_number;
|
||||
|
||||
if (iLarge) {
|
||||
if (bLocal) {
|
||||
current_entity_number = iInfo;
|
||||
|
||||
commandManager.PlaySound(szTmp, vStart, CHAN_AUTO, -1, -1, -1, 0);
|
||||
@@ -2029,15 +2058,15 @@ void CG_ParseCGMessage_ver_6()
|
||||
CG_HudDrawFont(iInfo);
|
||||
break;
|
||||
|
||||
case CGM6_NOTIFY_KILL:
|
||||
case CGM6_NOTIFY_HIT:
|
||||
case CGM6_NOTIFY_KILL:
|
||||
if (cg.snap) {
|
||||
int iOldEnt;
|
||||
|
||||
iOldEnt = current_entity_number;
|
||||
|
||||
current_entity_number = cg.snap->ps.clientNum;
|
||||
if (iType == CGM6_NOTIFY_HIT) {
|
||||
if (iType == CGM6_NOTIFY_KILL) {
|
||||
commandManager.PlaySound("dm_kill_notify", NULL, CHAN_LOCAL, 2.0, -1, -1, 1);
|
||||
} else {
|
||||
commandManager.PlaySound("dm_hit_notify", NULL, CHAN_LOCAL, 2.0, -1, -1, 1);
|
||||
|
||||
@@ -122,6 +122,7 @@ functions exported to the main executable
|
||||
cvar_t *(*Cvar_Get)(const char *var_name, const char *value, int flags);
|
||||
cvar_t *(*Cvar_Find)(const char *var_name);
|
||||
void (*Cvar_Set)(const char *var_name, const char *value);
|
||||
void (*Cvar_CheckRange)(cvar_t* var, float min, float max, qboolean integral);
|
||||
|
||||
// ClientCommand and ConsoleCommand parameter access
|
||||
int (*Argc)(void);
|
||||
|
||||
+2
-237
@@ -26,8 +26,7 @@ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
|
||||
#include "cg_local.h"
|
||||
#include "../fgame/bg_voteoptions.h"
|
||||
|
||||
static qboolean CG_IsStatementFiltered(char *cmd);
|
||||
#include "cg_servercmds_filter.h"
|
||||
|
||||
/*
|
||||
================
|
||||
@@ -375,7 +374,7 @@ static void CG_ServerCommand(qboolean modelOnly)
|
||||
|
||||
if (!strcmp(cmd, "stufftext")) {
|
||||
char *cmd = cgi.Argv(1);
|
||||
if (CG_IsStatementFiltered(cmd)) {
|
||||
if (!CG_IsStatementAllowed(cmd)) {
|
||||
// Added in OPM
|
||||
// Don't execute filtered commands
|
||||
return;
|
||||
@@ -458,237 +457,3 @@ void CG_ExecuteNewServerCommands(int latestSequence, qboolean differentServer)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//
|
||||
// List of client variables allowed to be changed by the server
|
||||
//
|
||||
static const char *whiteListedVariables[] = {
|
||||
"r_fastsky", // some mods set this variable to make the sky uniform
|
||||
"ui_hud",
|
||||
"subtitle0",
|
||||
"subtitle1",
|
||||
"subtitle2",
|
||||
"subtitle3"
|
||||
};
|
||||
|
||||
//
|
||||
// List of client variables allowed to be changed by the server
|
||||
//
|
||||
static const char *whiteListedLocalServerVariables[] = {"ui_hidemouse", "ui_showmouse", "cg_marks_add"};
|
||||
|
||||
//
|
||||
// List of commands allowed to be executed by the server
|
||||
//
|
||||
static const char *whiteListedCommands[] = {
|
||||
"primarydmweapon",
|
||||
"pushmenu",
|
||||
"pushmenu_teamselect",
|
||||
"pushmenu_weaponselect",
|
||||
"popmenu",
|
||||
"wait",
|
||||
"globalwidgetcommand", // used for mods adding custom HUDs
|
||||
"ui_addhud",
|
||||
"ui_removehud",
|
||||
"tmstart",
|
||||
"tmstartloop",
|
||||
"tmstop",
|
||||
"tmvolume",
|
||||
"`stufftext",
|
||||
"+moveup", // workaround for mods that want to prevent inactivity when handling the spectate
|
||||
"-moveup",
|
||||
"screenshot",
|
||||
"screenshotJPEG",
|
||||
"levelshot"
|
||||
};
|
||||
|
||||
//
|
||||
// List of commands allowed to be executed by the server
|
||||
//
|
||||
static const char *whiteListedLocalServerCommands[] = {
|
||||
"spmap", // Used by briefings
|
||||
"map",
|
||||
"disconnect",
|
||||
"cinematic",
|
||||
"showmenu",
|
||||
"hidemenu"
|
||||
};
|
||||
|
||||
/*
|
||||
====================
|
||||
CG_IsVariableFiltered
|
||||
|
||||
Returns whether or not the variable should be filtered
|
||||
====================
|
||||
*/
|
||||
static qboolean CG_IsVariableFiltered(const char *name)
|
||||
{
|
||||
cvar_t *var;
|
||||
size_t i;
|
||||
|
||||
for (i = 0; i < ARRAY_LEN(whiteListedVariables); i++) {
|
||||
if (!Q_stricmp(name, whiteListedVariables[i])) {
|
||||
return qfalse;
|
||||
}
|
||||
}
|
||||
|
||||
if (cgs.localServer) {
|
||||
for (i = 0; i < ARRAY_LEN(whiteListedLocalServerVariables); i++) {
|
||||
if (!Q_stricmp(name, whiteListedLocalServerVariables[i])) {
|
||||
return qfalse;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Filtered
|
||||
return qtrue;
|
||||
}
|
||||
|
||||
/*
|
||||
====================
|
||||
CG_IsSetVariableFiltered
|
||||
|
||||
Returns whether or not the variable should be filtered
|
||||
====================
|
||||
*/
|
||||
static qboolean CG_IsSetVariableFiltered(const char *name, char type)
|
||||
{
|
||||
cvar_t *var;
|
||||
|
||||
if (!CG_IsVariableFiltered(name)) {
|
||||
return qfalse;
|
||||
}
|
||||
|
||||
if (type != 'u' && type != 's') {
|
||||
// Don't allow custom info variables to avoid flooding
|
||||
// the client with many serverinfo and userinfo variables
|
||||
|
||||
var = cgi.Cvar_Find(name);
|
||||
if (!var) {
|
||||
// Allow as it doesn't exist
|
||||
return qfalse;
|
||||
}
|
||||
|
||||
if (var->flags & CVAR_USER_CREATED) {
|
||||
// Allow, it's user-created, wouldn't cause issues
|
||||
return qfalse;
|
||||
}
|
||||
}
|
||||
|
||||
// Filtered
|
||||
return qtrue;
|
||||
}
|
||||
|
||||
/*
|
||||
====================
|
||||
CG_IsCommandFiltered
|
||||
|
||||
Returns whether or not the variable should be filtered
|
||||
====================
|
||||
*/
|
||||
static qboolean CG_IsCommandFiltered(const char *name)
|
||||
{
|
||||
size_t i;
|
||||
|
||||
for (i = 0; i < ARRAY_LEN(whiteListedCommands); i++) {
|
||||
if (!Q_stricmp(name, whiteListedCommands[i])) {
|
||||
return qfalse;
|
||||
}
|
||||
}
|
||||
|
||||
if (cgs.localServer) {
|
||||
// Allow more commands when the client is hosting the server
|
||||
// Mostly used on single-player mode, like when briefings switch to the next map
|
||||
for (i = 0; i < ARRAY_LEN(whiteListedLocalServerCommands); i++) {
|
||||
if (!Q_stricmp(name, whiteListedLocalServerCommands[i])) {
|
||||
return qfalse;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//
|
||||
// Test variables
|
||||
//
|
||||
return CG_IsVariableFiltered(name);
|
||||
}
|
||||
|
||||
/*
|
||||
====================
|
||||
RemoveEndToken
|
||||
====================
|
||||
*/
|
||||
static qboolean RemoveEndToken(char* com_token) {
|
||||
char* p;
|
||||
|
||||
for (p = com_token; p[0]; p++) {
|
||||
if (*p == ';') {
|
||||
*p = 0;
|
||||
return qtrue;
|
||||
}
|
||||
}
|
||||
|
||||
return qfalse;
|
||||
}
|
||||
|
||||
/*
|
||||
====================
|
||||
CG_IsStatementFiltered
|
||||
|
||||
Returns whether or not the statement is filtered
|
||||
====================
|
||||
*/
|
||||
static qboolean CG_IsStatementFiltered(char *cmd)
|
||||
{
|
||||
char* parsed;
|
||||
char* p;
|
||||
char com_token[256];
|
||||
qboolean bNextStatement = qfalse;
|
||||
|
||||
parsed = cmd;
|
||||
|
||||
for (Q_strncpyz(com_token, COM_ParseExt(&parsed, qtrue), sizeof(com_token)); com_token[0]; Q_strncpyz(com_token, COM_ParseExt(&parsed, qtrue), sizeof(com_token))) {
|
||||
bNextStatement = RemoveEndToken(com_token);
|
||||
|
||||
if (com_token[0] == ';') {
|
||||
continue;
|
||||
}
|
||||
|
||||
if (!Q_stricmp(com_token, "set") || !Q_stricmp(com_token, "setu") || !Q_stricmp(com_token, "seta")
|
||||
|| !Q_stricmp(com_token, "sets")) {
|
||||
char type = com_token[3];
|
||||
|
||||
//
|
||||
// variable
|
||||
//
|
||||
Q_strncpyz(com_token, COM_ParseExt(&parsed, qfalse), sizeof(com_token));
|
||||
bNextStatement |= RemoveEndToken(com_token);
|
||||
if (com_token[0] == ';') {
|
||||
continue;
|
||||
}
|
||||
|
||||
if (CG_IsSetVariableFiltered(com_token, type)) {
|
||||
return qtrue;
|
||||
}
|
||||
} else {
|
||||
//
|
||||
// normal command
|
||||
//
|
||||
if (CG_IsCommandFiltered(com_token)) {
|
||||
return qtrue;
|
||||
}
|
||||
}
|
||||
|
||||
if (!bNextStatement) {
|
||||
// Skip up to the next statement
|
||||
while (parsed && parsed[0]) {
|
||||
char c = parsed[0];
|
||||
|
||||
parsed++;
|
||||
if (c == '\n' || c == ';') {
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return qfalse;
|
||||
}
|
||||
@@ -0,0 +1,302 @@
|
||||
/*
|
||||
===========================================================================
|
||||
Copyright (C) 2025 the OpenMoHAA team
|
||||
|
||||
This file is part of OpenMoHAA source code.
|
||||
|
||||
OpenMoHAA source code is free software; you can redistribute it
|
||||
and/or modify it under the terms of the GNU General Public License as
|
||||
published by the Free Software Foundation; either version 2 of the License,
|
||||
or (at your option) any later version.
|
||||
|
||||
OpenMoHAA source code is distributed in the hope that it will be
|
||||
useful, but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with OpenMoHAA source code; if not, write to the Free Software
|
||||
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
===========================================================================
|
||||
*/
|
||||
|
||||
// DESCRIPTION:
|
||||
// cg_servercmds_filter.c -- filtered server commands
|
||||
|
||||
#include "cg_local.h"
|
||||
#include "cg_servercmds_filter.h"
|
||||
|
||||
//
|
||||
// List of variables allowed to be changed by the server
|
||||
//
|
||||
static const char *whiteListedVariables[] = {
|
||||
// some mods set this variable to make the sky uniform
|
||||
"r_fastsky",
|
||||
|
||||
"ui_hud",
|
||||
"subtitle0",
|
||||
"subtitle1",
|
||||
"subtitle2",
|
||||
"subtitle3",
|
||||
"name",
|
||||
|
||||
// for 3rd person server
|
||||
"cg_3rd_person",
|
||||
"cg_cameraverticaldisplacement"
|
||||
};
|
||||
|
||||
//
|
||||
// List of variables allowed to be changed by the server
|
||||
//
|
||||
static const char *whiteListedLocalServerVariables[] = {"ui_hidemouse", "ui_showmouse", "cg_marks_add"};
|
||||
|
||||
//
|
||||
// List of commands allowed to be executed by the server
|
||||
//
|
||||
static const char *whiteListedCommands[] = {
|
||||
//
|
||||
// HUD
|
||||
//==========
|
||||
"pushmenu",
|
||||
"pushmenu_teamselect",
|
||||
"pushmenu_weaponselect",
|
||||
"popmenu",
|
||||
"globalwidgetcommand", // used for mods adding custom HUDs
|
||||
"ui_addhud",
|
||||
"ui_removehud",
|
||||
"echo", // to print stuff client-side
|
||||
|
||||
//
|
||||
// Sounds
|
||||
//==========
|
||||
"tmstart",
|
||||
"tmstartloop",
|
||||
"tmstop",
|
||||
"tmvolume",
|
||||
"play",
|
||||
"playmp3",
|
||||
"stopmp3",
|
||||
|
||||
//
|
||||
// Misc
|
||||
//==========
|
||||
"primarydmweapon",
|
||||
"wait",
|
||||
"+moveup", // workaround for mods that want to prevent inactivity when handling the spectate
|
||||
"-moveup",
|
||||
"screenshot",
|
||||
"screenshotJPEG",
|
||||
"levelshot",
|
||||
"`stufftext" // Stufftext detection from Reborn, the player gets kicked without it
|
||||
};
|
||||
|
||||
//
|
||||
// List of commands allowed to be executed locally
|
||||
// (when the client also runs the server)
|
||||
//
|
||||
static const char *whiteListedLocalServerCommands[] = {
|
||||
// Used by briefings
|
||||
"spmap",
|
||||
"map",
|
||||
"disconnect",
|
||||
|
||||
"cinematic",
|
||||
"showmenu",
|
||||
"hidemenu"
|
||||
};
|
||||
|
||||
/*
|
||||
====================
|
||||
CG_IsVariableAllowed
|
||||
|
||||
Returns whether or not the variable should be filtered
|
||||
====================
|
||||
*/
|
||||
static qboolean CG_IsVariableAllowed(const char *name)
|
||||
{
|
||||
size_t i;
|
||||
|
||||
for (i = 0; i < ARRAY_LEN(whiteListedVariables); i++) {
|
||||
if (!Q_stricmp(name, whiteListedVariables[i])) {
|
||||
return qtrue;
|
||||
}
|
||||
}
|
||||
|
||||
if (cgs.localServer) {
|
||||
for (i = 0; i < ARRAY_LEN(whiteListedLocalServerVariables); i++) {
|
||||
if (!Q_stricmp(name, whiteListedLocalServerVariables[i])) {
|
||||
return qtrue;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Filtered
|
||||
return qfalse;
|
||||
}
|
||||
|
||||
/*
|
||||
====================
|
||||
CG_IsSetVariableFiltered
|
||||
|
||||
Returns whether or not the variable should be filtered
|
||||
====================
|
||||
*/
|
||||
static qboolean CG_IsSetVariableAllowed(const char *name, char type)
|
||||
{
|
||||
cvar_t *var;
|
||||
|
||||
if (CG_IsVariableAllowed(name)) {
|
||||
return qtrue;
|
||||
}
|
||||
|
||||
if (type != 'a' && type != 's') {
|
||||
// Only allow ephemeral or userinfo variables
|
||||
|
||||
var = cgi.Cvar_Find(name);
|
||||
if (!var) {
|
||||
// Allow as it doesn't exist
|
||||
return qtrue;
|
||||
}
|
||||
|
||||
if (var->flags & CVAR_USER_CREATED) {
|
||||
// Allow, it's user-created, wouldn't cause issues
|
||||
return qtrue;
|
||||
}
|
||||
}
|
||||
|
||||
// Filtered
|
||||
return qfalse;
|
||||
}
|
||||
|
||||
/*
|
||||
====================
|
||||
CG_IsCommandAllowed
|
||||
|
||||
Returns whether or not the variable should be filtered
|
||||
====================
|
||||
*/
|
||||
static qboolean CG_IsCommandAllowed(const char *name)
|
||||
{
|
||||
size_t i;
|
||||
cvar_t *var;
|
||||
|
||||
for (i = 0; i < ARRAY_LEN(whiteListedCommands); i++) {
|
||||
if (!Q_stricmp(name, whiteListedCommands[i])) {
|
||||
return qtrue;
|
||||
}
|
||||
}
|
||||
|
||||
if (cgs.localServer) {
|
||||
// Allow more commands when the client is hosting the server
|
||||
// Mostly used on single-player mode, like when briefings switch to the next map
|
||||
for (i = 0; i < ARRAY_LEN(whiteListedLocalServerCommands); i++) {
|
||||
if (!Q_stricmp(name, whiteListedLocalServerCommands[i])) {
|
||||
return qtrue;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//
|
||||
// Test variables
|
||||
//
|
||||
if (CG_IsVariableAllowed(name)) {
|
||||
return qtrue;
|
||||
}
|
||||
|
||||
var = cgi.Cvar_Find(name);
|
||||
if (var && (var->flags & CVAR_USER_CREATED)) {
|
||||
// Allow, it's user-created, wouldn't cause issues
|
||||
return qtrue;
|
||||
}
|
||||
|
||||
return qfalse;
|
||||
}
|
||||
|
||||
/*
|
||||
====================
|
||||
RemoveEndToken
|
||||
====================
|
||||
*/
|
||||
static qboolean RemoveEndToken(char *com_token)
|
||||
{
|
||||
char *p;
|
||||
|
||||
for (p = com_token; p[0]; p++) {
|
||||
if (*p == ';') {
|
||||
*p = 0;
|
||||
return qtrue;
|
||||
}
|
||||
}
|
||||
|
||||
return qfalse;
|
||||
}
|
||||
|
||||
/*
|
||||
====================
|
||||
CG_IsStatementAllowed
|
||||
|
||||
Returns whether or not the statement is filtered
|
||||
====================
|
||||
*/
|
||||
qboolean CG_IsStatementAllowed(char *cmd)
|
||||
{
|
||||
char *parsed;
|
||||
char com_token[256];
|
||||
qboolean bNextStatement = qfalse;
|
||||
|
||||
parsed = cmd;
|
||||
|
||||
for (Q_strncpyz(com_token, COM_ParseExt(&parsed, qtrue), sizeof(com_token)); com_token[0];
|
||||
Q_strncpyz(com_token, COM_ParseExt(&parsed, qtrue), sizeof(com_token))) {
|
||||
bNextStatement = RemoveEndToken(com_token);
|
||||
|
||||
if (com_token[0] == ';') {
|
||||
continue;
|
||||
}
|
||||
|
||||
if (!Q_stricmp(com_token, "set") || !Q_stricmp(com_token, "setu") || !Q_stricmp(com_token, "seta")
|
||||
|| !Q_stricmp(com_token, "sets") || !Q_stricmp(com_token, "append")) {
|
||||
char type;
|
||||
|
||||
if (Q_stricmp(com_token, "append")) {
|
||||
type = com_token[3];
|
||||
} else {
|
||||
type = 0;
|
||||
}
|
||||
|
||||
//
|
||||
// variable
|
||||
//
|
||||
Q_strncpyz(com_token, COM_ParseExt(&parsed, qfalse), sizeof(com_token));
|
||||
bNextStatement |= RemoveEndToken(com_token);
|
||||
if (com_token[0] == ';') {
|
||||
continue;
|
||||
}
|
||||
|
||||
if (!CG_IsSetVariableAllowed(com_token, type)) {
|
||||
return qfalse;
|
||||
}
|
||||
} else {
|
||||
//
|
||||
// normal command
|
||||
//
|
||||
if (!CG_IsCommandAllowed(com_token)) {
|
||||
return qfalse;
|
||||
}
|
||||
}
|
||||
|
||||
if (!bNextStatement) {
|
||||
// Skip up to the next statement
|
||||
while (parsed && parsed[0]) {
|
||||
char c = parsed[0];
|
||||
|
||||
parsed++;
|
||||
if (c == '\n' || c == ';') {
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return qtrue;
|
||||
}
|
||||
@@ -0,0 +1,45 @@
|
||||
/*
|
||||
===========================================================================
|
||||
Copyright (C) 2025 the OpenMoHAA team
|
||||
|
||||
This file is part of OpenMoHAA source code.
|
||||
|
||||
OpenMoHAA source code is free software; you can redistribute it
|
||||
and/or modify it under the terms of the GNU General Public License as
|
||||
published by the Free Software Foundation; either version 2 of the License,
|
||||
or (at your option) any later version.
|
||||
|
||||
OpenMoHAA source code is distributed in the hope that it will be
|
||||
useful, but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with OpenMoHAA source code; if not, write to the Free Software
|
||||
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
===========================================================================
|
||||
*/
|
||||
|
||||
// DESCRIPTION:
|
||||
// cg_servercmds_filter.h -- filtered server commands
|
||||
|
||||
#pragma once
|
||||
|
||||
#include "cg_local.h"
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
/**
|
||||
* Determines whether or not the full statement is allowed.
|
||||
* The statement will be allowed if conditions are met:
|
||||
* - Contains a whitelisted command
|
||||
* - Trying to set a whitelisted variable
|
||||
* - Trying to set variable that doesn't exist (user created variables)
|
||||
*/
|
||||
qboolean CG_IsStatementAllowed(char *cmd);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
@@ -131,10 +131,10 @@ void ClientGameCommandManager::FreeAllTempModels(void)
|
||||
//===============
|
||||
void ClientGameCommandManager::FreeSomeTempModels(void)
|
||||
{
|
||||
ctempmodel_t* model;
|
||||
int count = 0;
|
||||
unsigned int i;
|
||||
unsigned int numToFree;
|
||||
ctempmodel_t *model;
|
||||
int count = 0;
|
||||
unsigned int i;
|
||||
unsigned int numToFree;
|
||||
|
||||
if (!m_free_tempmodels) {
|
||||
return;
|
||||
@@ -159,10 +159,10 @@ void ClientGameCommandManager::FreeSomeTempModels(void)
|
||||
//===============
|
||||
// FreeSpawnthing
|
||||
//===============
|
||||
void ClientGameCommandManager::FreeSpawnthing(spawnthing_t* sp)
|
||||
void ClientGameCommandManager::FreeSpawnthing(spawnthing_t *sp)
|
||||
{
|
||||
ctempmodel_t* model;
|
||||
ctempmodel_t* prev;
|
||||
ctempmodel_t *model;
|
||||
ctempmodel_t *prev;
|
||||
|
||||
if (sp->numtempmodels) {
|
||||
for (model = m_active_tempmodels.prev; model != &m_active_tempmodels; model = prev) {
|
||||
@@ -199,7 +199,7 @@ void ClientGameCommandManager::ResetTempModels(void)
|
||||
}
|
||||
|
||||
static int lastTempModelFrameTime = 0;
|
||||
int next_tempmodel_warning = 0;
|
||||
int next_tempmodel_warning = 0;
|
||||
|
||||
void CG_ResetTempModels(void)
|
||||
{
|
||||
@@ -228,11 +228,16 @@ void ClientGameCommandManager::InitializeTempModels(void)
|
||||
|
||||
void ClientGameCommandManager::InitializeTempModelCvars(void)
|
||||
{
|
||||
cg_showtempmodels = cgi.Cvar_Get("cg_showtempmodels", "0", 0);
|
||||
cg_detail = cgi.Cvar_Get("detail", "1", CVAR_ARCHIVE);
|
||||
cg_effectdetail = cgi.Cvar_Get("cg_effectdetail", "0.2", CVAR_ARCHIVE);
|
||||
cg_showtempmodels = cgi.Cvar_Get("cg_showtempmodels", "0", 0);
|
||||
cg_detail = cgi.Cvar_Get("detail", "1", CVAR_ARCHIVE);
|
||||
|
||||
cg_effectdetail = cgi.Cvar_Get("cg_effectdetail", "0.2", CVAR_ARCHIVE);
|
||||
cgi.Cvar_CheckRange(cg_effectdetail, 0.2, 1.0, qfalse);
|
||||
|
||||
cg_effect_physicsrate = cgi.Cvar_Get("cg_effect_physicsrate", "10", CVAR_ARCHIVE);
|
||||
cg_max_tempmodels = cgi.Cvar_Get("cg_max_tempmodels", "1100", CVAR_ARCHIVE);
|
||||
cgi.Cvar_CheckRange(cg_max_tempmodels, 200, MAX_TEMPMODELS, qtrue);
|
||||
|
||||
cg_reserve_tempmodels = cgi.Cvar_Get("cg_reserve_tempmodels", "200", CVAR_ARCHIVE);
|
||||
|
||||
if (cg_max_tempmodels->integer > MAX_TEMPMODELS) {
|
||||
@@ -253,9 +258,9 @@ void ClientGameCommandManager::InitializeTempModelCvars(void)
|
||||
//===============
|
||||
void ClientGameCommandManager::AnimateTempModel(ctempmodel_t *p, Vector origin, refEntity_t *newEnt)
|
||||
{
|
||||
int numframes;
|
||||
int deltatime;
|
||||
int frametime;
|
||||
int numframes;
|
||||
int deltatime;
|
||||
int frametime;
|
||||
float prev;
|
||||
|
||||
// This code is for animating tempmodels that are spawned from the client
|
||||
@@ -491,16 +496,16 @@ void ClientGameCommandManager::OtherTempModelEffects(ctempmodel_t *p, Vector ori
|
||||
if (p->number != -1) {
|
||||
refEntity_t *old_entity;
|
||||
dtiki_t *old_tiki;
|
||||
int oldnum;
|
||||
float oldscale;
|
||||
int oldnum;
|
||||
float oldscale;
|
||||
|
||||
// Set the axis
|
||||
AnglesToAxis(p->cgd.angles, axis);
|
||||
|
||||
old_entity = current_entity;
|
||||
old_tiki = current_tiki;
|
||||
oldnum = current_entity_number;
|
||||
oldscale = current_scale;
|
||||
old_tiki = current_tiki;
|
||||
oldnum = current_entity_number;
|
||||
oldscale = current_scale;
|
||||
|
||||
current_scale = newEnt->scale;
|
||||
current_entity = newEnt;
|
||||
@@ -525,7 +530,7 @@ void ClientGameCommandManager::OtherTempModelEffects(ctempmodel_t *p, Vector ori
|
||||
|
||||
if (p->cgd.flags2 & T2_ALIGNSTRETCH) {
|
||||
Vector vDelta;
|
||||
float fScale;
|
||||
float fScale;
|
||||
|
||||
vDelta = p->cgd.origin - p->cgd.oldorigin;
|
||||
fScale = vDelta.length() * p->cgd.scale2;
|
||||
@@ -562,8 +567,8 @@ qboolean ClientGameCommandManager::TempModelPhysics(ctempmodel_t *p, float ftime
|
||||
|
||||
// If linked to the parent or hardlinked, get the parent's origin
|
||||
if ((p->cgd.flags & (T_PARENTLINK | T_HARDLINK)) && (p->cgd.parent != ENTITYNUM_NONE)) {
|
||||
centity_t* pc;
|
||||
refEntity_t* e;
|
||||
centity_t *pc;
|
||||
refEntity_t *e;
|
||||
|
||||
pc = &cg_entities[p->cgd.parent];
|
||||
if (!pc->currentValid) {
|
||||
@@ -577,8 +582,7 @@ qboolean ClientGameCommandManager::TempModelPhysics(ctempmodel_t *p, float ftime
|
||||
|
||||
parentOrigin = e->origin;
|
||||
vectoangles(e->axis[0], parentAngles);
|
||||
}
|
||||
else if (p->cgd.flags & T_SWARM) {
|
||||
} else if (p->cgd.flags & T_SWARM) {
|
||||
p->cgd.parentOrigin = p->cgd.velocity + p->cgd.accel * ftime * scale;
|
||||
}
|
||||
|
||||
@@ -891,10 +895,11 @@ void ClientGameCommandManager::AddTempModels(void)
|
||||
refEntity_t *old_ent;
|
||||
|
||||
// To counteract cg.time going backwards
|
||||
if (lastTempModelFrameTime && ((cg.time < lastTempModelFrameTime) || (cg.time - lastTempModelFrameTime > TOO_MUCH_TIME_PASSED))) {
|
||||
if (lastTempModelFrameTime
|
||||
&& ((cg.time < lastTempModelFrameTime) || (cg.time - lastTempModelFrameTime > TOO_MUCH_TIME_PASSED))) {
|
||||
p = m_active_tempmodels.prev;
|
||||
for (; p != &m_active_tempmodels; p = next) {
|
||||
next = p->prev;
|
||||
next = p->prev;
|
||||
p->lastPhysicsTime = cg.time;
|
||||
}
|
||||
lastTempModelFrameTime = cg.time;
|
||||
@@ -994,7 +999,7 @@ void ClientGameCommandManager::AddTempModels(void)
|
||||
// Run physics if the lastEnt is not valid to get a valid lerp
|
||||
if (!p->lastEntValid) {
|
||||
float t;
|
||||
t = physics_rate / 1000.0f;
|
||||
t = physics_rate / 1000.0f;
|
||||
|
||||
ret = TempModelPhysics(p, t, scale);
|
||||
if (!ret) {
|
||||
@@ -1180,7 +1185,7 @@ void ClientGameCommandManager::SpawnTempModel(int mcount)
|
||||
if (m_spawnthing->cgd.flags & T_WAVE) {
|
||||
p->m_spawnthing = m_spawnthing;
|
||||
m_spawnthing->numtempmodels++;
|
||||
start = Vector(0, 0, 0);
|
||||
start = Vector(0, 0, 0);
|
||||
} else {
|
||||
p->m_spawnthing = NULL;
|
||||
start = m_spawnthing->cgd.origin;
|
||||
@@ -1205,7 +1210,7 @@ void ClientGameCommandManager::SpawnTempModel(int mcount)
|
||||
Vector dst;
|
||||
// Create a circular shaped burst around the up vector
|
||||
float angle;
|
||||
|
||||
|
||||
if (mcount == 1) {
|
||||
angle = random() * 360;
|
||||
} else {
|
||||
|
||||
+20
-1
@@ -290,7 +290,13 @@ void CG_OffsetFirstPersonView(refEntity_t *pREnt, qboolean bUseWorldPosition)
|
||||
VectorMA(origin, oHead.origin[i], mat[i], origin);
|
||||
}
|
||||
|
||||
cg.refdefViewAngles[2] += cg.predicted_player_state.fLeanAngle * 0.3;
|
||||
if (cg_target_game >= TG_MOHTA) {
|
||||
// Changed in 2.0
|
||||
// Slight less angle
|
||||
cg.refdefViewAngles[2] += cg.predicted_player_state.fLeanAngle * 0.2;
|
||||
} else {
|
||||
cg.refdefViewAngles[2] += cg.predicted_player_state.fLeanAngle * 0.3;
|
||||
}
|
||||
}
|
||||
} else {
|
||||
cgi.DPrintf("CG_OffsetFirstPersonView warning: Couldn't find 'eyes bone' for player\n");
|
||||
@@ -582,6 +588,8 @@ static int CG_CalcViewValues(void)
|
||||
VectorCopy(ps->origin, cg.refdef.vieworg);
|
||||
VectorCopy(ps->viewangles, cg.refdefViewAngles);
|
||||
|
||||
cg.refdefViewAngles[2] += ps->fLeanAngle * 0.1;
|
||||
|
||||
if (cg.snap->ps.stats[STAT_HEALTH] > 0) {
|
||||
VectorSubtract(cg.refdefViewAngles, cg.predicted_player_state.damage_angles, cg.refdefViewAngles);
|
||||
cg.refdefViewAngles[0] += cg.viewkick[0];
|
||||
@@ -961,8 +969,19 @@ void CG_DrawActiveFrame(int serverTime, int frameTime, stereoFrame_t stereoView,
|
||||
}
|
||||
|
||||
cg.bIntermissionDisplay = qfalse;
|
||||
} else {
|
||||
// Added in OPM
|
||||
// In vanilla, scores are updated because when pressing a key,
|
||||
// it is sent every frame.
|
||||
// In OPM, an event for a key is sent only once, even when it's being held.
|
||||
if (cgs.gametype != GT_SINGLE_PLAYER && cg.showScores) {
|
||||
CG_ScoresDown_f();
|
||||
}
|
||||
}
|
||||
|
||||
// Added in OPM
|
||||
CG_ProcessPlayerModel();
|
||||
|
||||
// build the render lists
|
||||
if (!cg.hyperspace) {
|
||||
CG_AddPacketEntities(); // after calcViewValues, so predicted player state is correct
|
||||
|
||||
@@ -7,6 +7,11 @@ add_subdirectory("../cgame" "./cgame")
|
||||
file(GLOB SOURCES_CLIENT "./*.c*")
|
||||
file(GLOB_RECURSE SOURCES_UILIB "../uilib/*.c*")
|
||||
|
||||
set(SOURCES_CLIENT ${SOURCES_CLIENT}
|
||||
# Gamespy
|
||||
"${CMAKE_SOURCE_DIR}/code/gamespy/cl_gamespy.c"
|
||||
)
|
||||
|
||||
# Made as an interface and not static, as static only links used methods
|
||||
add_library(omohclient INTERFACE)
|
||||
target_compile_definitions(omohclient INTERFACE APP_MODULE)
|
||||
|
||||
@@ -629,6 +629,7 @@ void CL_InitCGameDLL( clientGameImport_t *cgi, clientGameExport_t **cge ) {
|
||||
cgi->Cvar_Get = Cvar_Get;
|
||||
cgi->Cvar_Find = Cvar_FindVar;
|
||||
cgi->Cvar_Set = Cvar_Set;
|
||||
cgi->Cvar_CheckRange = Cvar_CheckRange;
|
||||
|
||||
cgi->Argc = Cmd_Argc;
|
||||
cgi->Args = Cmd_Args;
|
||||
|
||||
@@ -471,6 +471,33 @@ void CL_JoystickEvent( int axis, int value, int time ) {
|
||||
cl.joystickAxis[axis] = value;
|
||||
}
|
||||
|
||||
/*
|
||||
=================
|
||||
CL_UpdateMouse
|
||||
|
||||
Added in OPM
|
||||
Update mouse position with absolute position (relative to the window)
|
||||
when the UI catcher is active.
|
||||
=================
|
||||
*/
|
||||
void CL_UpdateMouse() {
|
||||
if (!(Key_GetCatcher() & KEYCATCH_UI)) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (IN_IsCursorActive()) {
|
||||
// If it's grabbed, don't use absolute position
|
||||
return;
|
||||
}
|
||||
|
||||
if (com_unfocused->integer) {
|
||||
// Ignore updates when unfocused
|
||||
return;
|
||||
}
|
||||
|
||||
IN_GetMousePosition(&cl.mousex, &cl.mousey);
|
||||
}
|
||||
|
||||
/*
|
||||
=================
|
||||
CL_JoystickMove
|
||||
@@ -866,8 +893,8 @@ qboolean CL_ReadyToSendPacket( void ) {
|
||||
}
|
||||
|
||||
// check for exceeding cl_maxpackets
|
||||
if ( cl_maxpackets->integer < 15 ) {
|
||||
Cvar_Set( "cl_maxpackets", "15" );
|
||||
if ( cl_maxpackets->integer < 30 ) {
|
||||
Cvar_Set( "cl_maxpackets", "30" );
|
||||
} else if ( cl_maxpackets->integer > 125 ) {
|
||||
Cvar_Set( "cl_maxpackets", "125" );
|
||||
}
|
||||
|
||||
@@ -0,0 +1,640 @@
|
||||
/*
|
||||
===========================================================================
|
||||
Copyright (C) 2025 the OpenMoHAA team
|
||||
|
||||
This file is part of OpenMoHAA source code.
|
||||
|
||||
OpenMoHAA source code is free software; you can redistribute it
|
||||
and/or modify it under the terms of the GNU General Public License as
|
||||
published by the Free Software Foundation; either version 2 of the License,
|
||||
or (at your option) any later version.
|
||||
|
||||
OpenMoHAA source code is distributed in the hope that it will be
|
||||
useful, but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with OpenMoHAA source code; if not, write to the Free Software
|
||||
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
===========================================================================
|
||||
*/
|
||||
|
||||
#include "cl_ui.h"
|
||||
#include "cl_instantAction.h"
|
||||
#include "cl_uiserverlist.h"
|
||||
#include "../gamespy/sv_gamespy.h"
|
||||
|
||||
Event EV_UIInstantAction_AcceptServer
|
||||
(
|
||||
"acceptserver",
|
||||
EV_DEFAULT,
|
||||
NULL,
|
||||
NULL,
|
||||
"Connect to the current server"
|
||||
);
|
||||
|
||||
Event EV_UIInstantAction_RejectServer
|
||||
(
|
||||
"rejectserver",
|
||||
EV_DEFAULT,
|
||||
NULL,
|
||||
NULL,
|
||||
"Reject the current server"
|
||||
);
|
||||
|
||||
Event EV_UIInstantAction_Cancel
|
||||
(
|
||||
"ia_cancel",
|
||||
EV_DEFAULT,
|
||||
NULL,
|
||||
NULL,
|
||||
"cancel the server update"
|
||||
);
|
||||
|
||||
Event EV_UIInstantAction_Refresh
|
||||
(
|
||||
"ia_refresh",
|
||||
EV_DEFAULT,
|
||||
NULL,
|
||||
NULL,
|
||||
"Refresh the server list"
|
||||
);
|
||||
|
||||
CLASS_DECLARATION(UIWidget, UIInstantAction, NULL) {
|
||||
{&EV_UIInstantAction_AcceptServer, &UIInstantAction::Connect },
|
||||
{&EV_UIInstantAction_RejectServer, &UIInstantAction::Reject },
|
||||
{&EV_UIInstantAction_Cancel, &UIInstantAction::CancelRefresh},
|
||||
{&EV_UIInstantAction_Refresh, &UIInstantAction::Refresh },
|
||||
{NULL, NULL }
|
||||
};
|
||||
|
||||
struct ServerListInstance {
|
||||
int iServerType;
|
||||
UIInstantAction *pServerList;
|
||||
};
|
||||
|
||||
ServerListInstance g_IAServerListInst[2];
|
||||
|
||||
UIInstantAction::UIInstantAction()
|
||||
{
|
||||
state = IA_INITIALIZE;
|
||||
numFoundServers = 0;
|
||||
numServers = 0;
|
||||
minPlayers = 3;
|
||||
startingMaxPing = 100;
|
||||
endingMaxPing = 1500;
|
||||
maxServers = -1;
|
||||
servers = NULL;
|
||||
doneList[0] = false;
|
||||
doneList[1] = false;
|
||||
serverList[0] = NULL;
|
||||
serverList[1] = NULL;
|
||||
|
||||
ReadIniFile();
|
||||
EnableServerInfo(false);
|
||||
|
||||
menuManager.PassEventToWidget("ia_cancel_button", new Event(EV_Widget_Disable));
|
||||
menuManager.PassEventToWidget("ia_refresh_button", new Event(EV_Widget_Disable));
|
||||
}
|
||||
|
||||
UIInstantAction::~UIInstantAction()
|
||||
{
|
||||
CleanUp();
|
||||
}
|
||||
|
||||
void UIInstantAction::CleanUp()
|
||||
{
|
||||
if (serverList[0]) {
|
||||
ServerListFree(serverList[0]);
|
||||
serverList[0] = NULL;
|
||||
}
|
||||
|
||||
if (serverList[1]) {
|
||||
ServerListFree(serverList[1]);
|
||||
serverList[1] = NULL;
|
||||
}
|
||||
|
||||
if (servers) {
|
||||
delete[] servers;
|
||||
servers = NULL;
|
||||
}
|
||||
}
|
||||
|
||||
void UIInstantAction::Init()
|
||||
{
|
||||
const char *secret_key;
|
||||
const char *game_name;
|
||||
|
||||
static const unsigned int iNumConcurrent = 10;
|
||||
|
||||
numFoundServers = 0;
|
||||
numServers = 0;
|
||||
doneList[0] = false;
|
||||
doneList[1] = false;
|
||||
|
||||
EnableServerInfo(false);
|
||||
|
||||
menuManager.PassEventToWidget("ia_cancel_button", new Event(EV_Widget_Disable));
|
||||
menuManager.PassEventToWidget("ia_refresh_button", new Event(EV_Widget_Disable));
|
||||
menuManager.PassEventToWidget("ia_noserverfound", new Event(EV_Widget_Disable));
|
||||
|
||||
Cvar_Set("ia_search_percentage", va("%d %%", 0));
|
||||
|
||||
if (com_target_game->integer < target_game_e::TG_MOHTT) {
|
||||
g_IAServerListInst[0].iServerType = com_target_game->integer;
|
||||
g_IAServerListInst[0].pServerList = this;
|
||||
|
||||
game_name = GS_GetGameName(com_target_game->integer);
|
||||
secret_key = GS_GetGameKey(com_target_game->integer);
|
||||
|
||||
serverList[0] = ServerListNew(
|
||||
game_name,
|
||||
game_name,
|
||||
secret_key,
|
||||
iNumConcurrent,
|
||||
(void *)&IAServerListCallBack,
|
||||
1,
|
||||
(void *)&g_IAServerListInst[0]
|
||||
);
|
||||
|
||||
ServerListClear(serverList[0]);
|
||||
} else {
|
||||
g_IAServerListInst[0].iServerType = target_game_e::TG_MOHTT;
|
||||
g_IAServerListInst[0].pServerList = this;
|
||||
|
||||
game_name = GS_GetGameName(target_game_e::TG_MOHTT);
|
||||
secret_key = GS_GetGameKey(target_game_e::TG_MOHTT);
|
||||
|
||||
serverList[0] = ServerListNew(
|
||||
game_name,
|
||||
game_name,
|
||||
secret_key,
|
||||
iNumConcurrent,
|
||||
(void *)&IAServerListCallBack,
|
||||
1,
|
||||
(void *)&g_IAServerListInst[0]
|
||||
);
|
||||
|
||||
ServerListClear(serverList[0]);
|
||||
|
||||
g_IAServerListInst[1].iServerType = target_game_e::TG_MOHTA;
|
||||
g_IAServerListInst[1].pServerList = this;
|
||||
|
||||
game_name = GS_GetGameName(target_game_e::TG_MOHTA);
|
||||
secret_key = GS_GetGameKey(target_game_e::TG_MOHTA);
|
||||
|
||||
serverList[1] = ServerListNew(
|
||||
game_name,
|
||||
game_name,
|
||||
secret_key,
|
||||
iNumConcurrent,
|
||||
(void *)&IAServerListCallBack,
|
||||
1,
|
||||
(void *)&g_IAServerListInst[1]
|
||||
);
|
||||
|
||||
ServerListClear(serverList[1]);
|
||||
}
|
||||
|
||||
state = IA_WAITING;
|
||||
numFoundServers = 0;
|
||||
|
||||
ServerListUpdate(serverList[0], true);
|
||||
|
||||
if (serverList[1]) {
|
||||
ServerListUpdate(serverList[1], true);
|
||||
}
|
||||
|
||||
menuManager.PassEventToWidget("ia_cancel_button", new Event(EV_Widget_Enable));
|
||||
menuManager.PassEventToWidget("searchstatus", new Event(EV_Widget_Enable));
|
||||
menuManager.PassEventToWidget("searchstatuslable", new Event(EV_Widget_Enable));
|
||||
}
|
||||
|
||||
int UIInstantAction::GetServerIndex(int maxPing, int gameType)
|
||||
{
|
||||
int bestPing = 1500;
|
||||
int bestServer = -1;
|
||||
int i;
|
||||
|
||||
for (i = 0; i < numFoundServers; i++) {
|
||||
const IAServer_t& IAServer = servers[i];
|
||||
|
||||
char *gameVer;
|
||||
float fGameVer;
|
||||
int ping;
|
||||
int numPlayers;
|
||||
|
||||
if (IAServer.rejected) {
|
||||
continue;
|
||||
}
|
||||
|
||||
// Skip servers that don't match the provided game type
|
||||
if (ServerGetIntValue(IAServer.server, "g_gametype_i", 1) != gameType) {
|
||||
continue;
|
||||
}
|
||||
|
||||
// Skip servers with high ping
|
||||
ping = ServerGetPing(IAServer.server);
|
||||
if (ping > maxPing) {
|
||||
continue;
|
||||
}
|
||||
|
||||
gameVer = ServerGetStringValue(IAServer.server, "gamever", "1.00");
|
||||
if (com_target_demo->integer && *gameVer != 'd') {
|
||||
// Skip retail servers on demo game
|
||||
continue;
|
||||
} else if (!com_target_demo->integer && *gameVer == 'd') {
|
||||
// Skip demo servers on retail game
|
||||
continue;
|
||||
}
|
||||
|
||||
// Skip incompatible servers
|
||||
fGameVer = atof(gameVer);
|
||||
if (com_target_game->integer >= target_game_e::TG_MOHTT) {
|
||||
if (IAServer.serverGame.serverType == target_game_e::TG_MOHTT) {
|
||||
if (fabs(fGameVer) < 2.3f) {
|
||||
continue;
|
||||
}
|
||||
} else {
|
||||
if (fabs(fGameVer) < 2.1f) {
|
||||
continue;
|
||||
}
|
||||
}
|
||||
} else {
|
||||
if (fabs(fGameVer - com_target_shortversion->value) > 0.1f) {
|
||||
continue;
|
||||
}
|
||||
}
|
||||
|
||||
// Skip servers with a password
|
||||
if (ServerGetIntValue(IAServer.server, "password", 0)) {
|
||||
continue;
|
||||
}
|
||||
|
||||
// Skip servers that don't match the minimum number of players
|
||||
numPlayers = ServerGetIntValue(IAServer.server, "numplayers", 0);
|
||||
if (numPlayers < minPlayers) {
|
||||
continue;
|
||||
}
|
||||
|
||||
// Skip full servers
|
||||
if (numPlayers == ServerGetIntValue(IAServer.server, "maxplayers", 0)) {
|
||||
continue;
|
||||
}
|
||||
|
||||
// Skip servers with an higher ping than the best one
|
||||
if (ping >= bestPing) {
|
||||
continue;
|
||||
}
|
||||
|
||||
//
|
||||
// Found a potential server
|
||||
//
|
||||
|
||||
bestPing = ping;
|
||||
bestServer = i;
|
||||
}
|
||||
|
||||
return bestServer;
|
||||
}
|
||||
|
||||
void UIInstantAction::ReadIniFile()
|
||||
{
|
||||
char *buffer;
|
||||
const char *p;
|
||||
const char *pVal;
|
||||
int intValue;
|
||||
char value[32];
|
||||
|
||||
if (!FS_ReadFileEx("iaction.ini", (void **)&buffer, qtrue)) {
|
||||
return;
|
||||
}
|
||||
|
||||
for (p = buffer; p; p = strstr(pVal, "\n")) {
|
||||
if (sscanf(p, "%31s", value) != 1) {
|
||||
break;
|
||||
}
|
||||
|
||||
pVal = strstr(p, "=");
|
||||
if (!pVal) {
|
||||
break;
|
||||
}
|
||||
|
||||
pVal++;
|
||||
|
||||
if (sscanf(pVal, "%d", &intValue) != 1) {
|
||||
break;
|
||||
}
|
||||
|
||||
if (!Q_stricmpn(value, "MinPlayers", 10)) {
|
||||
minPlayers = intValue;
|
||||
}
|
||||
|
||||
if (!Q_stricmpn(value, "StartingMaxPing", 15)) {
|
||||
startingMaxPing = intValue;
|
||||
}
|
||||
|
||||
if (!Q_stricmpn(value, "EndingMaxPing", 13)) {
|
||||
endingMaxPing = intValue;
|
||||
}
|
||||
|
||||
if (!Q_stricmpn(value, "MaxServers", 10)) {
|
||||
maxServers = intValue;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void UIInstantAction::FindServer()
|
||||
{
|
||||
int ping;
|
||||
int i;
|
||||
|
||||
currentServer = -1;
|
||||
state = IA_NONE;
|
||||
|
||||
for (ping = startingMaxPing; ping < endingMaxPing; ping += 100) {
|
||||
//
|
||||
// Find the best server starting from FFA gametype first
|
||||
//
|
||||
for (i = 1; i < 7; i++) {
|
||||
currentServer = GetServerIndex(ping, i);
|
||||
if (currentServer >= 0) {
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if (currentServer >= 0) {
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
menuManager.PassEventToWidget("ia_refresh_button", new Event(EV_Widget_Enable));
|
||||
menuManager.PassEventToWidget("ia_cancel_button", new Event(EV_Widget_Disable));
|
||||
menuManager.PassEventToWidget("searchstatus", new Event(EV_Widget_Disable));
|
||||
menuManager.PassEventToWidget("searchstatuslable", new Event(EV_Widget_Disable));
|
||||
|
||||
if (currentServer < 0) {
|
||||
EnableServerInfo(false);
|
||||
|
||||
menuManager.PassEventToWidget("ia_noserverfound", new Event(EV_Widget_Enable));
|
||||
return;
|
||||
}
|
||||
|
||||
const IAServer_t& IAServer = servers[currentServer];
|
||||
const char *hostname = ServerGetStringValue(IAServer.server, "hostname", "(NONE)");
|
||||
const char *gametype = ServerGetStringValue(IAServer.server, "gametype", "(NONE)");
|
||||
int numplayers = ServerGetIntValue(IAServer.server, "numplayers", 0);
|
||||
int maxplayers = ServerGetIntValue(IAServer.server, "maxplayers", 0);
|
||||
ping = ServerGetPing(IAServer.server);
|
||||
|
||||
Cvar_Set("ia_servername", va(" %s", hostname));
|
||||
Cvar_Set("ia_ping", va("%d", ping));
|
||||
Cvar_Set("ia_gametype", va("%s", gametype));
|
||||
Cvar_Set("ia_players", va("%d", numplayers));
|
||||
Cvar_Set("ia_maxplayers", va("%d", maxplayers));
|
||||
|
||||
EnableServerInfo(true);
|
||||
}
|
||||
|
||||
void UIInstantAction::Connect(Event *ev)
|
||||
{
|
||||
char *gameVer;
|
||||
float fGameVer;
|
||||
bool bDiffVersion;
|
||||
char command[256];
|
||||
|
||||
if (currentServer < 0 || currentServer < numServers) {
|
||||
return;
|
||||
}
|
||||
|
||||
const IAServer_t& IAServer = servers[currentServer];
|
||||
|
||||
gameVer = ServerGetStringValue(IAServer.server, "gamever", "1.00");
|
||||
if (gameVer[0] == 'd') {
|
||||
gameVer++;
|
||||
}
|
||||
|
||||
// Skip incompatible servers
|
||||
fGameVer = atof(gameVer);
|
||||
bDiffVersion = false;
|
||||
if (com_target_game->integer >= target_game_e::TG_MOHTT) {
|
||||
if (IAServer.serverGame.serverType == target_game_e::TG_MOHTT) {
|
||||
if (fabs(fGameVer) < 2.3f) {
|
||||
bDiffVersion = true;
|
||||
}
|
||||
} else {
|
||||
if (fabs(fGameVer) < 2.1f) {
|
||||
bDiffVersion = true;
|
||||
}
|
||||
}
|
||||
} else {
|
||||
if (fabs(fGameVer - com_target_shortversion->value) > 0.1f) {
|
||||
bDiffVersion = true;
|
||||
}
|
||||
}
|
||||
|
||||
if (bDiffVersion) {
|
||||
if (fGameVer - com_target_shortversion->value > 0) {
|
||||
// Older version
|
||||
UI_SetReturnMenuToCurrent();
|
||||
Cvar_Set("com_errormessage", va("Server is version %s, you are using %s", gameVer, "2.40"));
|
||||
UI_PushMenu("wrongversion");
|
||||
} else {
|
||||
// Server version is newer
|
||||
Cvar_Set("dm_serverstatus", va("Can not connect to v%s server, you are using v%s", gameVer, "2.40"));
|
||||
}
|
||||
}
|
||||
|
||||
UI_SetReturnMenuToCurrent();
|
||||
Cvar_Set("g_servertype", va("%d", servers[currentServer].serverGame.serverType));
|
||||
|
||||
Com_sprintf(
|
||||
command,
|
||||
sizeof(command),
|
||||
"connect %s:%i\n",
|
||||
ServerGetAddress(IAServer.server),
|
||||
ServerGetIntValue(IAServer.server, "hostport", PORT_SERVER)
|
||||
);
|
||||
Cbuf_AddText(command);
|
||||
}
|
||||
|
||||
void UIInstantAction::Reject(Event *ev)
|
||||
{
|
||||
servers[currentServer].rejected = 1;
|
||||
FindServer();
|
||||
}
|
||||
|
||||
void UIInstantAction::Draw()
|
||||
{
|
||||
switch (state) {
|
||||
case IA_INITIALIZE:
|
||||
Init();
|
||||
break;
|
||||
case IA_UPDATE:
|
||||
Update();
|
||||
break;
|
||||
case IA_FINISHED:
|
||||
FindServer();
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
if (serverList[0]) {
|
||||
ServerListThink(serverList[0]);
|
||||
}
|
||||
|
||||
if (serverList[1]) {
|
||||
ServerListThink(serverList[1]);
|
||||
}
|
||||
}
|
||||
|
||||
void UIInstantAction::Update()
|
||||
{
|
||||
numFoundServers = 0;
|
||||
|
||||
// count the total number of servers from both server list
|
||||
numServers = ServerListCount(serverList[0]);
|
||||
if (serverList[1]) {
|
||||
numServers += ServerListCount(serverList[1]);
|
||||
}
|
||||
|
||||
state = IA_FINISHED;
|
||||
servers = new IAServer_t[numServers];
|
||||
|
||||
ServerListHalt(serverList[0]);
|
||||
if (serverList[1]) {
|
||||
ServerListHalt(serverList[1]);
|
||||
}
|
||||
|
||||
ServerListThink(serverList[0]);
|
||||
if (serverList[1]) {
|
||||
ServerListThink(serverList[1]);
|
||||
}
|
||||
|
||||
state = IA_SEARCHING;
|
||||
|
||||
// Start updating the first list
|
||||
doneList[0] = false;
|
||||
ServerListClear(serverList[0]);
|
||||
ServerListUpdate(serverList[0], true);
|
||||
|
||||
// Update the second optional list
|
||||
if (serverList[1]) {
|
||||
doneList[1] = false;
|
||||
ServerListClear(serverList[1]);
|
||||
ServerListUpdate(serverList[1], true);
|
||||
}
|
||||
}
|
||||
|
||||
int UIInstantAction::AddServer(GServer server, const ServerGame_t& serverGame)
|
||||
{
|
||||
servers[numFoundServers].server = server;
|
||||
servers[numFoundServers].serverGame = serverGame;
|
||||
servers[numFoundServers].rejected = false;
|
||||
numFoundServers++;
|
||||
|
||||
return numFoundServers;
|
||||
}
|
||||
|
||||
void UIInstantAction::CancelRefresh(Event *ev)
|
||||
{
|
||||
state = IA_FINISHED;
|
||||
ServerListHalt(serverList[0]);
|
||||
ServerListHalt(serverList[1]);
|
||||
}
|
||||
|
||||
void UIInstantAction::Refresh(Event *ev)
|
||||
{
|
||||
state = IA_INITIALIZE;
|
||||
}
|
||||
|
||||
void UIInstantAction::EnableServerInfo(bool enable)
|
||||
{
|
||||
if (enable) {
|
||||
menuManager.PassEventToWidget("iaservername_label", new Event(EV_Widget_Enable));
|
||||
menuManager.PassEventToWidget("ia_servername_field", new Event(EV_Widget_Enable));
|
||||
menuManager.PassEventToWidget("ia_ping_label", new Event(EV_Widget_Enable));
|
||||
menuManager.PassEventToWidget("ia_ping_field", new Event(EV_Widget_Enable));
|
||||
menuManager.PassEventToWidget("ia_gametype_label", new Event(EV_Widget_Enable));
|
||||
menuManager.PassEventToWidget("ia_gametype_field", new Event(EV_Widget_Enable));
|
||||
menuManager.PassEventToWidget("ia_players_label", new Event(EV_Widget_Enable));
|
||||
menuManager.PassEventToWidget("ia_players_field", new Event(EV_Widget_Enable));
|
||||
menuManager.PassEventToWidget("ia_maxplayers_label", new Event(EV_Widget_Enable));
|
||||
menuManager.PassEventToWidget("ia_maxplayers_field", new Event(EV_Widget_Enable));
|
||||
menuManager.PassEventToWidget("acceptserver", new Event(EV_Widget_Enable));
|
||||
menuManager.PassEventToWidget("rejectserver", new Event(EV_Widget_Enable));
|
||||
} else {
|
||||
menuManager.PassEventToWidget("iaservername_label", new Event(EV_Widget_Disable));
|
||||
menuManager.PassEventToWidget("ia_servername_field", new Event(EV_Widget_Disable));
|
||||
menuManager.PassEventToWidget("ia_ping_label", new Event(EV_Widget_Disable));
|
||||
menuManager.PassEventToWidget("ia_ping_field", new Event(EV_Widget_Disable));
|
||||
menuManager.PassEventToWidget("ia_gametype_label", new Event(EV_Widget_Disable));
|
||||
menuManager.PassEventToWidget("ia_gametype_field", new Event(EV_Widget_Disable));
|
||||
menuManager.PassEventToWidget("ia_players_label", new Event(EV_Widget_Disable));
|
||||
menuManager.PassEventToWidget("ia_players_field", new Event(EV_Widget_Disable));
|
||||
menuManager.PassEventToWidget("ia_maxplayers_label", new Event(EV_Widget_Disable));
|
||||
menuManager.PassEventToWidget("ia_maxplayers_field", new Event(EV_Widget_Disable));
|
||||
menuManager.PassEventToWidget("acceptserver", new Event(EV_Widget_Disable));
|
||||
menuManager.PassEventToWidget("rejectserver", new Event(EV_Widget_Disable));
|
||||
}
|
||||
}
|
||||
|
||||
void UIInstantAction::IAServerListCallBack(GServerList serverlist, int msg, void *instance, void *param1, void *param2)
|
||||
{
|
||||
const ServerListInstance *pInstance = (const ServerListInstance *)instance;
|
||||
UIInstantAction *pServerList = pInstance->pServerList;
|
||||
|
||||
if (msg == LIST_PROGRESS) {
|
||||
if (pServerList->state == IA_WAITING) {
|
||||
if (pInstance->iServerType == com_target_game->integer) {
|
||||
pServerList->doneList[0] = true;
|
||||
}
|
||||
|
||||
if (com_target_game->integer >= target_game_e::TG_MOHTT && pInstance->iServerType == target_game_e::TG_MOHTA) {
|
||||
pServerList->doneList[1] = true;
|
||||
}
|
||||
|
||||
if (pServerList->doneList[0] && (!pServerList->serverList[1] || pServerList->doneList[1])) {
|
||||
pServerList->state = IA_UPDATE;
|
||||
}
|
||||
} else if (pServerList->state == IA_SEARCHING) {
|
||||
ServerGame_t serverGame;
|
||||
serverGame.serverType = pInstance->iServerType;
|
||||
const int serverIndex = pServerList->AddServer((GServer)param1, serverGame);
|
||||
|
||||
Cvar_Set("ia_search_percentage", va("%d %%", 100 * serverIndex / pServerList->numServers));
|
||||
|
||||
if (pServerList->maxServers >= 0 && serverIndex >= pServerList->maxServers) {
|
||||
// Reached the maximum number of servers, stop there
|
||||
pServerList->doneList[0] = true;
|
||||
ServerListHalt(pServerList->serverList[0]);
|
||||
|
||||
if (pServerList->serverList[1]) {
|
||||
pServerList->doneList[1] = true;
|
||||
ServerListHalt(pServerList->serverList[1]);
|
||||
}
|
||||
|
||||
pServerList->state = IA_FINISHED;
|
||||
}
|
||||
}
|
||||
} else if (msg == LIST_STATECHANGED && ServerListState(serverlist) == GServerListState::sl_idle) {
|
||||
if (pInstance->iServerType == com_target_game->integer) {
|
||||
pServerList->doneList[0] = true;
|
||||
}
|
||||
|
||||
if (com_target_game->integer >= target_game_e::TG_MOHTT && pInstance->iServerType == target_game_e::TG_MOHTA) {
|
||||
pServerList->doneList[1] = true;
|
||||
}
|
||||
|
||||
if (pServerList->doneList[0] && (!pServerList->serverList[1] || pServerList->doneList[1])) {
|
||||
if (pServerList->state == IA_WAITING) {
|
||||
pServerList->state = IA_UPDATE;
|
||||
}
|
||||
if (pServerList->state == IA_SEARCHING) {
|
||||
pServerList->state = IA_FINISHED;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,103 @@
|
||||
/*
|
||||
===========================================================================
|
||||
Copyright (C) 2025 the OpenMoHAA team
|
||||
|
||||
This file is part of OpenMoHAA source code.
|
||||
|
||||
OpenMoHAA source code is free software; you can redistribute it
|
||||
and/or modify it under the terms of the GNU General Public License as
|
||||
published by the Free Software Foundation; either version 2 of the License,
|
||||
or (at your option) any later version.
|
||||
|
||||
OpenMoHAA source code is distributed in the hope that it will be
|
||||
useful, but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with OpenMoHAA source code; if not, write to the Free Software
|
||||
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
===========================================================================
|
||||
*/
|
||||
|
||||
// Added in 2.30
|
||||
// Instantly find a server matching common criterias
|
||||
|
||||
#pragma once
|
||||
|
||||
#include "../gamespy/goaceng.h"
|
||||
|
||||
typedef struct {
|
||||
int serverType;
|
||||
} ServerGame_t;
|
||||
|
||||
typedef struct {
|
||||
GServer server;
|
||||
ServerGame_t serverGame;
|
||||
bool rejected;
|
||||
} IAServer_t;
|
||||
|
||||
enum IAState_e {
|
||||
IA_NONE,
|
||||
IA_INITIALIZE,
|
||||
IA_WAITING,
|
||||
IA_UPDATE,
|
||||
IA_SEARCHING,
|
||||
IA_FINISHED
|
||||
};
|
||||
|
||||
class UIInstantAction : public UIWidget
|
||||
{
|
||||
public:
|
||||
CLASS_PROTOTYPE(UIInstantAction);
|
||||
|
||||
public:
|
||||
UIInstantAction();
|
||||
~UIInstantAction() override;
|
||||
|
||||
void CleanUp();
|
||||
void Init();
|
||||
|
||||
int GetServerIndex(int maxPing, int gameType);
|
||||
void ReadIniFile();
|
||||
void FindServer();
|
||||
void Connect(Event *ev);
|
||||
void Reject(Event *ev);
|
||||
void Draw();
|
||||
void Update();
|
||||
int AddServer(GServer server, const ServerGame_t& serverGame);
|
||||
void CancelRefresh(Event *ev);
|
||||
void Refresh(Event *ev);
|
||||
void EnableServerInfo(bool enable);
|
||||
|
||||
private:
|
||||
static void IAServerListCallBack(GServerList serverlist, int msg, void *instance, void *param1, void *param2);
|
||||
|
||||
private:
|
||||
//
|
||||
// List
|
||||
//
|
||||
bool doneList[2];
|
||||
GServerList serverList[2];
|
||||
int maxServers;
|
||||
|
||||
//
|
||||
// Current states
|
||||
//
|
||||
IAState_e state;
|
||||
int numServers;
|
||||
int numFoundServers;
|
||||
|
||||
//
|
||||
// Filters
|
||||
//
|
||||
int minPlayers;
|
||||
int startingMaxPing;
|
||||
int endingMaxPing;
|
||||
|
||||
//
|
||||
// Servers
|
||||
//
|
||||
IAServer_t *servers;
|
||||
int currentServer;
|
||||
};
|
||||
+100
-14
@@ -29,6 +29,8 @@ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
#include "../qcommon/localization.h"
|
||||
#include "../qcommon/bg_compat.h"
|
||||
#include "../sys/sys_local.h"
|
||||
#include "../sys/sys_update_checker.h"
|
||||
#include "../uilib/uimessage.h"
|
||||
|
||||
extern "C" {
|
||||
#include "../sys/sys_loadlib.h"
|
||||
@@ -171,6 +173,7 @@ void CL_ServerStatus_f(void);
|
||||
void CL_ServerStatusResponse( netadr_t from, msg_t *msg );
|
||||
|
||||
static qboolean cl_bCLSystemStarted = qfalse;
|
||||
static qboolean cl_updateNotified = qfalse;
|
||||
|
||||
/*
|
||||
===============
|
||||
@@ -880,6 +883,25 @@ void CL_MapLoading( qboolean flush, const char *pszMapName ) {
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
=====================
|
||||
CL_CleanupUserInfo
|
||||
|
||||
Remove user-created userinfo variables
|
||||
=====================
|
||||
*/
|
||||
void CL_CleanupUserInfo()
|
||||
{
|
||||
cvar_t *cv;
|
||||
cvar_t *next;
|
||||
|
||||
for(cv = Cvar_Next(NULL), next = cv->next; cv; cv = next, next = Cvar_Next(cv)) {
|
||||
if ((cv->flags & CVAR_USER_CREATED) && (cv->flags & CVAR_USERINFO)) {
|
||||
Cvar_Unset(cv);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
=====================
|
||||
CL_ClearState
|
||||
@@ -898,6 +920,9 @@ void CL_ClearState( void )
|
||||
UI_ClearState();
|
||||
|
||||
Com_Memset( &cl, 0, sizeof( clientActive_t ) );
|
||||
|
||||
// Added in OPM
|
||||
CL_CleanupUserInfo();
|
||||
}
|
||||
|
||||
/*
|
||||
@@ -1123,6 +1148,8 @@ in anyway.
|
||||
===================
|
||||
*/
|
||||
void CL_RequestAuthorization( void ) {
|
||||
// MOHAA doesn't support this
|
||||
#if 0
|
||||
char nums[64];
|
||||
int i, j;
|
||||
size_t l;
|
||||
@@ -1165,6 +1192,7 @@ void CL_RequestAuthorization( void ) {
|
||||
fs = Cvar_Get ("cl_anonymous", "0", CVAR_INIT|CVAR_SYSTEMINFO );
|
||||
|
||||
CL_NET_OutOfBandPrint(cls.authorizeServer, "getKeyAuthorize %i %s", fs->integer, nums );
|
||||
#endif
|
||||
}
|
||||
|
||||
/*
|
||||
@@ -2006,11 +2034,10 @@ void CL_CheckForResend( void ) {
|
||||
|
||||
switch ( clc.state ) {
|
||||
case CA_CONNECTING:
|
||||
// requesting a challenge
|
||||
//wombat: not authorization in mohaa
|
||||
// if ( !Sys_IsLANAddress( clc.serverAddress ) ) {
|
||||
// CL_RequestAuthorization();
|
||||
// }
|
||||
#ifndef STANDALONE
|
||||
if (!com_standalone->integer && clc.serverAddress.type == NA_IP && !Sys_IsLANAddress( clc.serverAddress ) )
|
||||
CL_RequestAuthorization();
|
||||
#endif
|
||||
CL_NET_OutOfBandPrint(clc.serverAddress, "getchallenge");
|
||||
break;
|
||||
case CA_AUTHORIZING:
|
||||
@@ -2025,7 +2052,13 @@ wombat: sending conect here: an example connect string from MOHAA looks like thi
|
||||
*/
|
||||
|
||||
// sending back the challenge
|
||||
port = Cvar_VariableValue ("net_qport");
|
||||
port = Cvar_VariableIntegerValue ("net_qport");
|
||||
|
||||
// sanitize the name before sending it
|
||||
char szSanitizedName[MAX_NAME_LENGTH];
|
||||
if (Com_SanitizeName(name->string, szSanitizedName, sizeof(szSanitizedName))) {
|
||||
Cvar_Set("name", szSanitizedName);
|
||||
}
|
||||
|
||||
Q_strncpyz( info, Cvar_InfoString( CVAR_USERINFO ), sizeof( info ) );
|
||||
|
||||
@@ -2038,9 +2071,9 @@ wombat: sending conect here: an example connect string from MOHAA looks like thi
|
||||
else
|
||||
#endif
|
||||
Info_SetValueForKey(info, "protocol", va("%i", com_protocol->integer));
|
||||
Info_SetValueForKey( info, "qport", va("%i", port ) );
|
||||
Info_SetValueForKey(info, "qport", va("%i", port));
|
||||
Info_SetValueForKey(info, "challenge", va("%i", clc.challenge));
|
||||
Info_SetValueForKey(info, "version", com_target_version->string);
|
||||
Info_SetValueForKey(info, "version", com_target_shortversion->string);
|
||||
if (com_target_game->integer == target_game_e::TG_MOHTT) {
|
||||
// only send if maintt is loaded
|
||||
Info_SetValueForKey(info, "clientType", "Breakthrough");
|
||||
@@ -2412,7 +2445,7 @@ void CL_ConnectionlessPacket( netadr_t from, msg_t *msg ) {
|
||||
|
||||
if (!Q_stricmp(c, "wrongver")) {
|
||||
reason = MSG_ReadString(msg);
|
||||
Cvar_Set("com_errorMessage", va("Server is version %s, you are using %s, from base '%s'", reason, com_target_version->string, Cvar_VariableString("fs_basegame")));
|
||||
Cvar_Set("com_errorMessage", va("Server is version %s, you are using %s, from base '%s'", reason, com_target_shortversion->string, Cvar_VariableString("fs_basegame")));
|
||||
CL_Disconnect_f();
|
||||
UI_ForceMenuOff(qtrue);
|
||||
UI_PushMenu("errormessage");
|
||||
@@ -2597,6 +2630,36 @@ void CL_SetFrameNumber(int frameNumber) {
|
||||
re.SetFrameNumber(frameNumber);
|
||||
}
|
||||
|
||||
/*
|
||||
==================
|
||||
CL_VerifyUpdate
|
||||
|
||||
Check for a new version and display a message box
|
||||
when a new version is available
|
||||
==================
|
||||
*/
|
||||
void CL_VerifyUpdate() {
|
||||
if (cl_updateNotified) {
|
||||
return;
|
||||
}
|
||||
|
||||
int lastMajor, lastMinor, lastPatch;
|
||||
if (updateChecker.CheckNewVersion(lastMajor, lastMinor, lastPatch)) {
|
||||
cl_updateNotified = true;
|
||||
|
||||
const char *updateText =
|
||||
va("A new update is available!\n"
|
||||
"The latest version is v%d.%d.%d (you are running v%s).\n"
|
||||
"Check https://github.com/openmoh/openmohaa for more.",
|
||||
lastMajor,
|
||||
lastMinor,
|
||||
lastPatch,
|
||||
PRODUCT_VERSION_NUMBER_STRING);
|
||||
|
||||
UIMessageDialog::ShowMessageBox("Update available", updateText);
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
==================
|
||||
CL_Frame
|
||||
@@ -2635,6 +2698,8 @@ void CL_Frame ( int msec ) {
|
||||
S_TriggeredMusic_PlayIntroMusic();
|
||||
UI_MenuEscape("main");
|
||||
}
|
||||
|
||||
CL_VerifyUpdate();
|
||||
} else if (clc.state == CA_CINEMATIC) {
|
||||
UI_ForceMenuOff(qtrue);
|
||||
}
|
||||
@@ -2757,6 +2822,9 @@ void CL_Frame ( int msec ) {
|
||||
|
||||
L_ProcessPendingEvents();
|
||||
|
||||
// Added in OPM
|
||||
CL_UpdateMouse();
|
||||
|
||||
// update the screen
|
||||
SCR_UpdateScreen();
|
||||
|
||||
@@ -3121,14 +3189,14 @@ void CL_InitRef( void ) {
|
||||
#ifdef USE_RENDERER_DLOPEN
|
||||
cl_renderer = Cvar_Get("cl_renderer", "opengl1", CVAR_ARCHIVE | CVAR_LATCH);
|
||||
|
||||
Com_sprintf(dllName, sizeof(dllName), "renderer_%s" ARCH_SUFFIX DLL_SUFFIX DLL_EXT, cl_renderer->string);
|
||||
Com_sprintf(dllName, sizeof(dllName), "renderer_%s" DLL_SUFFIX DLL_EXT, cl_renderer->string);
|
||||
|
||||
if(!(rendererLib = Sys_LoadDll(dllName, qfalse)) && strcmp(cl_renderer->string, cl_renderer->resetString))
|
||||
{
|
||||
Com_Printf("failed:\n\"%s\"\n", Sys_LibraryError());
|
||||
Cvar_ForceReset("cl_renderer");
|
||||
|
||||
Com_sprintf(dllName, sizeof(dllName), "renderer_opengl1" ARCH_SUFFIX DLL_SUFFIX DLL_EXT);
|
||||
Com_sprintf(dllName, sizeof(dllName), "renderer_opengl1" DLL_SUFFIX DLL_EXT);
|
||||
rendererLib = Sys_LoadDll(dllName, qfalse);
|
||||
}
|
||||
|
||||
@@ -3618,8 +3686,8 @@ void CL_Init( void ) {
|
||||
cl_consoleKeys = Cvar_Get( "cl_consoleKeys", "~ ` 0x7e 0x60", CVAR_ARCHIVE );
|
||||
|
||||
// userinfo
|
||||
name = Cvar_Get ("name", "UnnamedSoldier", CVAR_USERINFO | CVAR_ARCHIVE );
|
||||
cl_rate = Cvar_Get ("rate", "5000", CVAR_USERINFO | CVAR_ARCHIVE );
|
||||
name = Cvar_Get ("name", va("UnnamedSoldier#%d", rand() % 100000), CVAR_USERINFO | CVAR_ARCHIVE);
|
||||
cl_rate = Cvar_Get ("rate", "25000", CVAR_USERINFO | CVAR_ARCHIVE );
|
||||
Cvar_Get ("snaps", "20", CVAR_USERINFO | CVAR_ARCHIVE );
|
||||
Cvar_Get ("password", "", CVAR_USERINFO);
|
||||
Cvar_Get ("dm_playermodel", "american_army", CVAR_USERINFO | CVAR_ARCHIVE );
|
||||
@@ -3685,6 +3753,12 @@ void CL_Init( void ) {
|
||||
|
||||
end = Sys_Milliseconds();
|
||||
|
||||
if (com_gotOriginalConfig) {
|
||||
// Added in OPM
|
||||
// Apply config tweaks after loading the original config
|
||||
CL_ApplyOriginalConfigTweaks();
|
||||
}
|
||||
|
||||
Com_Printf( "----- Client Initialization Complete ----- %i ms\n", start - end );
|
||||
}
|
||||
|
||||
@@ -3877,7 +3951,7 @@ void CL_ServerInfoPacket( netadr_t from, msg_t *msg ) {
|
||||
}
|
||||
}
|
||||
} else {
|
||||
if (fabs(atof(pszVersion) - com_target_version->value) > 0.1f) {
|
||||
if (fabs(atof(pszVersion) - com_target_shortversion->value) > 0.1f) {
|
||||
return;
|
||||
}
|
||||
}
|
||||
@@ -4861,3 +4935,15 @@ void TIKI_CG_Command_ProcessFile(char* filename, qboolean quiet, dtiki_t* curTik
|
||||
|
||||
Com_Printf("NO CGE \n");
|
||||
}
|
||||
|
||||
void CL_ApplyOriginalConfigTweaks()
|
||||
{
|
||||
cvar_t* snaps = Cvar_Get("snaps", "", 0);
|
||||
|
||||
// Those variables are not editable via UI so reset them
|
||||
// snaps/maxpackets can also have wrong values due to them being changed
|
||||
// via stufftext
|
||||
|
||||
Cvar_Set("snaps", snaps->resetString);
|
||||
Cvar_Set("cl_maxpackets", cl_maxpackets->resetString);
|
||||
}
|
||||
+56
-32
@@ -29,6 +29,7 @@ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
#include "../qcommon/q_version.h"
|
||||
|
||||
#include "cl_ui.h"
|
||||
#include "cl_uigamespy.h"
|
||||
|
||||
#include <ctime>
|
||||
|
||||
@@ -152,6 +153,10 @@ static str scoreboard_menuname;
|
||||
static str ui_sCurrentLoadingMenu;
|
||||
static Container<Menu *> hudList;
|
||||
|
||||
const UColor UWhiteChatMessageColor(0.75, 0.75, 0.75);
|
||||
const UColor URedChatMessageColor(1.0, 0.25, 0.25);
|
||||
const UColor UGreenChatMessageColor(0.0, 1.0, 0.25, 1.0);
|
||||
|
||||
void UI_MultiplayerMenuWidgetsUpdate(void);
|
||||
void UI_MultiplayerMainMenuWidgetsUpdate(void);
|
||||
void UI_MainMenuWidgetsUpdate(void);
|
||||
@@ -1303,16 +1308,14 @@ UI_PrintConsole
|
||||
*/
|
||||
void UI_PrintConsole(const char *msg)
|
||||
{
|
||||
UColor *pColor = NULL;
|
||||
const char *pszString;
|
||||
char szString[1024];
|
||||
char szBlah[1024];
|
||||
qboolean bPrintedDMBox = qfalse;
|
||||
const UColor *pColor = NULL;
|
||||
const char *pszString;
|
||||
char szBlah[1024];
|
||||
qboolean bPrintedDMBox = qfalse;
|
||||
|
||||
pszString = msg;
|
||||
strncpy(szString, msg, 1024);
|
||||
|
||||
if (*pszString < MESSAGE_MAX) {
|
||||
if (*pszString > 0 && (unsigned char)*pszString < MESSAGE_MAX) {
|
||||
qboolean bNormalMessage = qfalse;
|
||||
qboolean bDMMessage = qfalse;
|
||||
qboolean bBold = qfalse;
|
||||
@@ -1325,7 +1328,7 @@ void UI_PrintConsole(const char *msg)
|
||||
break;
|
||||
case MESSAGE_CHAT_WHITE:
|
||||
bDMMessage = qtrue;
|
||||
pColor = &UGrey;
|
||||
pColor = &UWhiteChatMessageColor;
|
||||
break;
|
||||
case MESSAGE_WHITE:
|
||||
bBold = qtrue;
|
||||
@@ -1333,26 +1336,24 @@ void UI_PrintConsole(const char *msg)
|
||||
break;
|
||||
case MESSAGE_CHAT_RED:
|
||||
bDeathMessage = MESSAGE_CHAT_RED;
|
||||
pColor = &ULightRed;
|
||||
pColor = &URedChatMessageColor;
|
||||
break;
|
||||
case MESSAGE_CHAT_GREEN:
|
||||
bDeathMessage = MESSAGE_CHAT_GREEN;
|
||||
pColor = &UGreen;
|
||||
pColor = &UGreenChatMessageColor;
|
||||
break;
|
||||
}
|
||||
|
||||
if (*pszString != 0) {
|
||||
pszString++;
|
||||
}
|
||||
pszString++;
|
||||
|
||||
//
|
||||
// print to the deathmatch console
|
||||
//
|
||||
if (dm_console && !bNormalMessage) {
|
||||
if (bDMMessage) {
|
||||
dm_console->AddDMMessageText(szString + 1, pColor);
|
||||
dm_console->AddDMMessageText(pszString, pColor);
|
||||
} else {
|
||||
dm_console->AddText(szString + 1, pColor);
|
||||
dm_console->AddText(pszString, pColor);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1360,14 +1361,20 @@ void UI_PrintConsole(const char *msg)
|
||||
// print to the deathmatch message box
|
||||
//
|
||||
if (dmbox) {
|
||||
// Changed in OPM
|
||||
// Avoid touching/copying buffers
|
||||
/*
|
||||
if (bDMMessage) {
|
||||
*szString = MESSAGE_CHAT_WHITE;
|
||||
dmbox->Print(szString);
|
||||
pszString = msg + 1;
|
||||
bPrintedDMBox = qtrue;
|
||||
} else if (bDeathMessage) {
|
||||
*szString = bDeathMessage;
|
||||
dmbox->Print(szString);
|
||||
*szString = bDeathMessage;
|
||||
}
|
||||
*/
|
||||
|
||||
if (bDMMessage || bDeathMessage) {
|
||||
dmbox->Print(msg);
|
||||
bPrintedDMBox = qtrue;
|
||||
}
|
||||
}
|
||||
@@ -1377,12 +1384,15 @@ void UI_PrintConsole(const char *msg)
|
||||
//
|
||||
if (gmbox && !bPrintedDMBox) {
|
||||
if (bBold) {
|
||||
*szString = MESSAGE_WHITE;
|
||||
gmbox->Print(szString);
|
||||
// Changed in OPM
|
||||
// Avoid touching/copying buffers
|
||||
//*szString = MESSAGE_WHITE;
|
||||
//gmbox->Print(szString);
|
||||
|
||||
gmbox->Print(msg);
|
||||
uii.Snd_PlaySound("objective_text");
|
||||
pszString = msg + 1;
|
||||
} else {
|
||||
gmbox->Print(szString + 1);
|
||||
gmbox->Print(pszString);
|
||||
}
|
||||
|
||||
if (!ui_gmboxspam->integer) {
|
||||
@@ -1390,7 +1400,7 @@ void UI_PrintConsole(const char *msg)
|
||||
}
|
||||
|
||||
if (!bDMMessage) {
|
||||
memcpy(szBlah, "Game Message: ", 15);
|
||||
Q_strncpyz(szBlah, "Game Message: ", sizeof(szBlah));
|
||||
Q_strcat(szBlah, sizeof(szBlah), pszString);
|
||||
pszString = szBlah;
|
||||
}
|
||||
@@ -2014,7 +2024,7 @@ void UI_Update(void)
|
||||
// try to show the weapons bar
|
||||
//
|
||||
if (hud_weapons) {
|
||||
if (ui_weaponsbar->integer) {
|
||||
if (ui_weaponsbar->integer && !(cl.snap.ps.pm_flags & PMF_NO_WEAPONBAR)) {
|
||||
int iEquippedDiff = 0;
|
||||
int iOwnedDiff = 0;
|
||||
|
||||
@@ -2557,6 +2567,12 @@ void UI_PopMenu(qboolean restore_cvars)
|
||||
{
|
||||
Menu *menu;
|
||||
|
||||
//
|
||||
// Added in OPM
|
||||
// Close any active floating windows (e.g. maplist)
|
||||
//
|
||||
UI_DeactiveFloatingWindows();
|
||||
|
||||
if (uWinMan.DialogExists()) {
|
||||
uWinMan.RemoveAllDialogBoxes();
|
||||
return;
|
||||
@@ -3374,7 +3390,8 @@ void UI_ApplyPlayerModel_f(void)
|
||||
Cvar_Set("dm_playermodel", pszUIPlayerModel);
|
||||
|
||||
pszUIPlayerModel = CvarGetForUI("ui_dm_playergermanmodel_set", "german_wehrmacht_soldier");
|
||||
if (!Q_stricmpn(pszUIPlayerModel, "german_waffen", 14)) {
|
||||
if (!Q_stricmpn(pszUIPlayerModel, "german_waffen_", 14)) {
|
||||
Q_strncpyz(donotshowssindeorfr, "german_waffenss_", sizeof(donotshowssindeorfr));
|
||||
Q_strcat(donotshowssindeorfr, sizeof(donotshowssindeorfr), pszUIPlayerModel + 14);
|
||||
Cvar_Set("dm_playergermanmodel", donotshowssindeorfr);
|
||||
} else {
|
||||
@@ -3409,7 +3426,7 @@ void UI_GetPlayerModel_f(void)
|
||||
Cvar_Set("ui_dm_playergermanmodel", PM_FilenameToDisplayname(pszUIPlayerModel));
|
||||
Cvar_Set("ui_dm_playergermanmodel_set", pszUIPlayerModel);
|
||||
|
||||
if (!strncmp(pszUIPlayerModel, "german_waffen_", 14)) {
|
||||
if (!Q_stricmpn(pszUIPlayerModel, "german_waffen_", 14)) {
|
||||
Q_strncpyz(donotshowssindeorfr, "german_waffenss_", sizeof(donotshowssindeorfr));
|
||||
Q_strcat(donotshowssindeorfr, sizeof(donotshowssindeorfr), pszUIPlayerModel + 14);
|
||||
Cvar_Set("ui_disp_playergermanmodel", va("models/player/%s.tik", donotshowssindeorfr));
|
||||
@@ -3789,6 +3806,8 @@ void CL_FillUIImports(void)
|
||||
|
||||
uii.GetRefSequence = CL_GetRefSequence;
|
||||
uii.IsRendererLoaded = CL_IsRendererLoaded;
|
||||
uii.Rend_LoadRawImage = re.LoadRawImage;
|
||||
uii.Rend_FreeRawImage = re.FreeRawImage;
|
||||
}
|
||||
|
||||
/*
|
||||
@@ -4171,6 +4190,9 @@ void UI_ClearState(void)
|
||||
if (dmbox) {
|
||||
dmbox->Clear();
|
||||
}
|
||||
|
||||
// Added in OPM
|
||||
SCR_StopCinematic ();
|
||||
}
|
||||
|
||||
/*
|
||||
@@ -4367,10 +4389,8 @@ UI_ShowScoreboard_f
|
||||
void UI_ShowScoreboard_f(const char *pszMenuName)
|
||||
{
|
||||
if (pszMenuName) {
|
||||
if (scoreboard_menuname.length()) {
|
||||
if (str::icmp(scoreboard_menuname, pszMenuName)) {
|
||||
scoreboard_menu->ForceHide();
|
||||
}
|
||||
if (scoreboard_menuname.length() && str::icmp(scoreboard_menuname, pszMenuName) && scoreboard_menu) {
|
||||
scoreboard_menu->ForceHide();
|
||||
}
|
||||
|
||||
scoreboard_menuname = pszMenuName;
|
||||
@@ -4419,7 +4439,10 @@ void UI_HideScoreboard_f(void)
|
||||
}
|
||||
|
||||
if (scoreboard_menuname.length()) {
|
||||
scoreboard_menu->ForceHide();
|
||||
// Fixed in 2.30 (scoreboard_menu check)
|
||||
if (scoreboard_menu) {
|
||||
scoreboard_menu->ForceHide();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -5293,7 +5316,7 @@ void CL_InitializeUI(void)
|
||||
|
||||
// New since mohta
|
||||
// Version number
|
||||
Cvar_Set("game_version", va("v%s", com_target_version->string));
|
||||
Cvar_Set("game_version", va("v%s", com_target_shortversion->string));
|
||||
|
||||
// Add all commands
|
||||
Cmd_AddCommand("pushmenu", UI_PushMenu_f);
|
||||
@@ -5342,6 +5365,7 @@ void CL_InitializeUI(void)
|
||||
Cmd_AddCommand("setreturnmenu", UI_SetReturnMenuToCurrent);
|
||||
Cmd_AddCommand("gotoreturnmenu", UI_PushReturnMenu_f);
|
||||
Cmd_AddCommand("salesscreen", UI_SalesScreen_f);
|
||||
Cmd_AddCommand("launchgamespy", UI_LaunchGameSpy_f);
|
||||
|
||||
if (developer->integer) {
|
||||
UColor bgColor;
|
||||
|
||||
+7
-4
@@ -47,10 +47,13 @@ void CL_ShutdownUI(void);
|
||||
//
|
||||
// general ui stuff
|
||||
//
|
||||
extern inventory_t client_inv;
|
||||
extern bind_t client_bind;
|
||||
extern cvar_t *cl_greenfps;
|
||||
extern qboolean server_loading;
|
||||
extern inventory_t client_inv;
|
||||
extern bind_t client_bind;
|
||||
extern cvar_t *cl_greenfps;
|
||||
extern qboolean server_loading;
|
||||
extern const UColor UWhiteChatMessageColor;
|
||||
extern const UColor URedChatMessageColor;
|
||||
extern const UColor UGreenChatMessageColor;
|
||||
|
||||
const char *CvarGetForUI(const char *name, const char *defval);
|
||||
void UI_ClearState(void);
|
||||
|
||||
@@ -21,6 +21,7 @@ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
*/
|
||||
|
||||
#include "cl_ui.h"
|
||||
#include "../qcommon/localization.h"
|
||||
|
||||
Event EV_DMBox_Goin
|
||||
(
|
||||
@@ -299,23 +300,19 @@ void UIDMBox::Print(const char *text)
|
||||
m_items[m_numitems].flags = 0;
|
||||
|
||||
if (*text == MESSAGE_CHAT_WHITE) {
|
||||
m_items[m_numitems].color = UGrey;
|
||||
m_items[m_numitems].color = UWhiteChatMessageColor;
|
||||
m_items[m_numitems].font = m_fontbold;
|
||||
m_items[m_numitems].flags |= DMBOX_ITEM_FLAG_BOLD;
|
||||
|
||||
text1 = text + 1;
|
||||
} else if (*text == MESSAGE_CHAT_RED) {
|
||||
m_items[m_numitems].color = ULightRed;
|
||||
m_items[m_numitems].color = URedChatMessageColor;
|
||||
m_items[m_numitems].font = m_fontbold;
|
||||
m_items[m_numitems].flags |= DMBOX_ITEM_FLAG_DEATH;
|
||||
|
||||
text1 = text + 1;
|
||||
} else if (*text == MESSAGE_CHAT_GREEN) {
|
||||
if (com_target_game->integer >= TG_MOHTA) {
|
||||
m_items[m_numitems].color = ULightGreen;
|
||||
} else {
|
||||
m_items[m_numitems].color = UGreen;
|
||||
}
|
||||
m_items[m_numitems].color = UGreenChatMessageColor;
|
||||
m_items[m_numitems].font = m_fontbold;
|
||||
m_items[m_numitems].flags |= DMBOX_ITEM_FLAG_DEATH;
|
||||
|
||||
@@ -325,7 +322,7 @@ void UIDMBox::Print(const char *text)
|
||||
m_items[m_numitems].font = m_font;
|
||||
}
|
||||
|
||||
m_items[m_numitems].string = CalculateBreaks(m_items[m_numitems].font, text1, s_dmboxWidth);
|
||||
m_items[m_numitems].string = CalculateBreaks(m_items[m_numitems].font, Sys_LV_CL_ConvertString(text1), s_dmboxWidth);
|
||||
|
||||
m_numitems++;
|
||||
VerifyBoxOut();
|
||||
|
||||
@@ -0,0 +1,118 @@
|
||||
/*
|
||||
===========================================================================
|
||||
Copyright (C) 2025 the OpenMoHAA team
|
||||
|
||||
This file is part of OpenMoHAA source code.
|
||||
|
||||
OpenMoHAA source code is free software; you can redistribute it
|
||||
and/or modify it under the terms of the GNU General Public License as
|
||||
published by the Free Software Foundation; either version 2 of the License,
|
||||
or (at your option) any later version.
|
||||
|
||||
OpenMoHAA source code is distributed in the hope that it will be
|
||||
useful, but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with OpenMoHAA source code; if not, write to the Free Software
|
||||
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
===========================================================================
|
||||
*/
|
||||
|
||||
// cl_uigamespy.cpp
|
||||
#include "cl_uigamespy.h"
|
||||
|
||||
CLASS_DECLARATION(UIFloatingWindow, GameSpyDialog, NULL) {
|
||||
{&W_Deactivated, &UIFloatingWindow::ClosePressed},
|
||||
{NULL, NULL }
|
||||
};
|
||||
|
||||
GameSpyDialog::GameSpyDialog()
|
||||
: overlay(NULL)
|
||||
, label(NULL)
|
||||
, closeButton(NULL)
|
||||
{
|
||||
AddFlag(WF_ALWAYS_TOP);
|
||||
}
|
||||
|
||||
GameSpyDialog::~GameSpyDialog()
|
||||
{
|
||||
if (overlay) {
|
||||
delete overlay;
|
||||
overlay = NULL;
|
||||
}
|
||||
|
||||
if (label) {
|
||||
delete label;
|
||||
label = NULL;
|
||||
}
|
||||
|
||||
if (closeButton) {
|
||||
delete closeButton;
|
||||
closeButton = NULL;
|
||||
}
|
||||
}
|
||||
|
||||
void GameSpyDialog::FrameInitialized(void)
|
||||
{
|
||||
UIFloatingWindow::FrameInitialized();
|
||||
|
||||
label = new UILabel();
|
||||
|
||||
label->InitFrame(getChildSpace(), getChildSpace()->getClientFrame(), 0);
|
||||
label->setTitle(
|
||||
"GameSpy's multiplayer matchmaking\n"
|
||||
"and server browsing services, which were\n"
|
||||
"essential for online gaming in many classic\n"
|
||||
"titles including Medal of Honor: Allied Assault,\n"
|
||||
"were permanently shut down in 2014."
|
||||
);
|
||||
label->setForegroundColor(UHudColor);
|
||||
|
||||
closeButton = new UIButton();
|
||||
closeButton->InitFrame(getChildSpace(), UIRect2D(100, 150, 100, 30), 0);
|
||||
closeButton->setTitle("Close");
|
||||
closeButton->AllowActivate(true);
|
||||
closeButton->Connect(this, W_Button_Pressed, W_Deactivated);
|
||||
|
||||
overlay = new UIButton();
|
||||
overlay->InitFrame(NULL, UIRect2D(0, 0, uid.vidWidth, uid.vidHeight), 0);
|
||||
overlay->setBackgroundColor(UColor(0, 0, 0, 0.5f), true);
|
||||
overlay->AllowActivate(true);
|
||||
|
||||
overlay->Connect(this, W_Button_Pressed, W_Deactivated);
|
||||
}
|
||||
|
||||
void GameSpyDialog::Create(
|
||||
UIWidget *parent, const UIRect2D& rect, const char *title, const UColor& bgColor, const UColor& fgColor
|
||||
)
|
||||
{
|
||||
// First call parent's Create
|
||||
UIFloatingWindow::Create(parent, rect, title, bgColor, fgColor);
|
||||
|
||||
// After creation, find minimize button by name and hide it
|
||||
for (UIWidget *child = getFirstChild(); child; child = getNextChild(child)) {
|
||||
if (strcmp(child->getName(), "minimizebutton") == 0) {
|
||||
child->setShow(false);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void UI_LaunchGameSpy_f(void)
|
||||
{
|
||||
GameSpyDialog *dialog = new GameSpyDialog();
|
||||
|
||||
dialog->Create(
|
||||
NULL,
|
||||
UIRect2D((uid.vidWidth - 300) / 2, (uid.vidHeight - 200) / 2, 300, 200),
|
||||
"GameSpy",
|
||||
UColor(0.15f, 0.195f, 0.278f),
|
||||
UHudColor
|
||||
);
|
||||
|
||||
uWinMan.ActivateControl(dialog);
|
||||
|
||||
dialog->Connect(dialog, W_Deactivated, W_Deactivated);
|
||||
}
|
||||
@@ -0,0 +1,50 @@
|
||||
/*
|
||||
===========================================================================
|
||||
Copyright (C) 2025 the OpenMoHAA team
|
||||
|
||||
This file is part of OpenMoHAA source code.
|
||||
|
||||
OpenMoHAA source code is free software; you can redistribute it
|
||||
and/or modify it under the terms of the GNU General Public License as
|
||||
published by the Free Software Foundation; either version 2 of the License,
|
||||
or (at your option) any later version.
|
||||
|
||||
OpenMoHAA source code is distributed in the hope that it will be
|
||||
useful, but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with OpenMoHAA source code; if not, write to the Free Software
|
||||
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
===========================================================================
|
||||
*/
|
||||
|
||||
// cl_gamespy.h
|
||||
#ifndef __CL_GAMESPY_H__
|
||||
#define __CL_GAMESPY_H__
|
||||
|
||||
#include "cl_ui.h"
|
||||
#include "keycodes.h"
|
||||
|
||||
class GameSpyDialog : public UIFloatingWindow
|
||||
{
|
||||
private:
|
||||
UIButton *overlay;
|
||||
UILabel *label;
|
||||
UIButton *closeButton;
|
||||
|
||||
protected:
|
||||
void FrameInitialized(void) override;
|
||||
|
||||
public:
|
||||
GameSpyDialog();
|
||||
~GameSpyDialog();
|
||||
void
|
||||
Create(UIWidget *parent, const UIRect2D& rect, const char *title, const UColor& bgColor, const UColor& fgColor);
|
||||
|
||||
CLASS_PROTOTYPE(GameSpyDialog);
|
||||
};
|
||||
|
||||
void UI_LaunchGameSpy_f(void);
|
||||
#endif
|
||||
@@ -21,6 +21,7 @@ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
*/
|
||||
|
||||
#include "cl_ui.h"
|
||||
#include "../qcommon/localization.h"
|
||||
|
||||
Event EV_GMBox_Goin
|
||||
(
|
||||
@@ -295,7 +296,7 @@ void UIGMBox::Print(const char *text)
|
||||
|
||||
m_items[m_numitems].flags = 0;
|
||||
|
||||
if (*text == 3) {
|
||||
if (*text == MESSAGE_WHITE) {
|
||||
m_items[m_numitems].color = UWhite;
|
||||
m_items[m_numitems].font = m_fontbold;
|
||||
m_items[m_numitems].flags |= GMBOX_ITEM_FLAG_BOLD;
|
||||
@@ -306,7 +307,7 @@ void UIGMBox::Print(const char *text)
|
||||
m_items[m_numitems].font = m_font;
|
||||
}
|
||||
|
||||
m_items[m_numitems].string = CalculateBreaks(m_items[m_numitems].font, text1, s_gmboxWidth);
|
||||
m_items[m_numitems].string = CalculateBreaks(m_items[m_numitems].font, Sys_LV_CL_ConvertString(text1), s_gmboxWidth);
|
||||
|
||||
m_numitems++;
|
||||
VerifyBoxOut();
|
||||
|
||||
@@ -333,6 +333,7 @@ str FAKKLoadGameItem::getListItemString(int which) const
|
||||
{
|
||||
int numseconds;
|
||||
int numseconds_hours;
|
||||
int seconds;
|
||||
|
||||
// hours
|
||||
numseconds = atol(strings[1]);
|
||||
@@ -341,17 +342,18 @@ str FAKKLoadGameItem::getListItemString(int which) const
|
||||
|
||||
// minutes
|
||||
numseconds_hours = numseconds % 3600;
|
||||
if (numseconds_hours / 60 <= 9) {
|
||||
if (numseconds_hours / 60 < 10) {
|
||||
itemstring += "0";
|
||||
}
|
||||
itemstring += (numseconds_hours / 60);
|
||||
itemstring += ":";
|
||||
|
||||
// seconds
|
||||
if (numseconds_hours / 60 <= 9) {
|
||||
seconds = numseconds_hours % 60;
|
||||
if (seconds < 10) {
|
||||
itemstring += "0";
|
||||
}
|
||||
itemstring += (numseconds_hours % 60);
|
||||
itemstring += seconds;
|
||||
}
|
||||
break;
|
||||
case 2:
|
||||
@@ -360,7 +362,7 @@ str FAKKLoadGameItem::getListItemString(int which) const
|
||||
char buffer[2048];
|
||||
|
||||
time = atol(strings[2]);
|
||||
strftime(buffer, sizeof(buffer), "%a %b %d %H:%M:%S %Y", localtime(&time));
|
||||
strftime(buffer, sizeof(buffer), "%a %b %d %Y %H:%M:%S", localtime(&time));
|
||||
itemstring = buffer;
|
||||
}
|
||||
break;
|
||||
|
||||
@@ -82,8 +82,8 @@ static const PMPickerModel_t pickerModels[] = {
|
||||
{"german_panzer_tankcommander", "DE - Panzer Tank Commander" },
|
||||
{"german_scientist", "DE - German Scientist" },
|
||||
// Those skins were superseded by german_waffenss
|
||||
{"german_waffen_officer", "DE - Waffen Officer" },
|
||||
{"german_waffen_shutze", "DE - Waffen Shutze" },
|
||||
// {"german_waffen_officer", "DE - Waffen Officer" },
|
||||
// {"german_waffen_shutze", "DE - Waffen Shutze" },
|
||||
// 1.0 skins
|
||||
{"german_waffenss_officer", "DE - Waffen Officer" },
|
||||
{"german_waffenss_shutze", "DE - Waffen Shutze" },
|
||||
|
||||
+484
-345
File diff suppressed because it is too large.
Load diff
@@ -22,34 +22,61 @@ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
|
||||
#pragma once
|
||||
|
||||
class UIFAKKServerList : public UIListCtrl {
|
||||
protected:
|
||||
// need a new struct instead of gamespy
|
||||
struct GServerListImplementation *m_serverList[2];
|
||||
bool m_bHasList;
|
||||
bool m_bLANListing;
|
||||
#include "../gamespy/goaceng.h"
|
||||
|
||||
public:
|
||||
CLASS_PROTOTYPE( UIFAKKServerList );
|
||||
#define NUM_SERVERLISTS 2
|
||||
|
||||
bool m_bGettingList[2];
|
||||
bool m_bUpdatingList;
|
||||
struct FAKKServerListInstance {
|
||||
int iServerType;
|
||||
class UIFAKKServerList *serverList;
|
||||
};
|
||||
|
||||
class UIFAKKServerList : public UIListCtrl
|
||||
{
|
||||
friend class FAKKServerListItem;
|
||||
|
||||
public:
|
||||
CLASS_PROTOTYPE(UIFAKKServerList);
|
||||
|
||||
protected:
|
||||
// need a new struct instead of gamespy
|
||||
struct GServerListImplementation *m_serverList[NUM_SERVERLISTS];
|
||||
bool m_bHasList;
|
||||
bool m_bLANListing;
|
||||
|
||||
public:
|
||||
bool m_bGettingList[NUM_SERVERLISTS];
|
||||
bool m_bUpdatingList;
|
||||
|
||||
private:
|
||||
// Added in OPM
|
||||
// Servers count
|
||||
FAKKServerListInstance m_ServerListInst[NUM_SERVERLISTS];
|
||||
int m_iServerQueryCount;
|
||||
int m_iServerTotalCount;
|
||||
int m_iTotalNumPlayers;
|
||||
bool m_bDoneUpdating[NUM_SERVERLISTS];
|
||||
bool m_NeedAdditionalLANSearch;
|
||||
|
||||
protected:
|
||||
void SelectServer( Event *ev );
|
||||
void ConnectServer( Event *ev );
|
||||
qboolean KeyEvent( int key, unsigned int time ) override;
|
||||
void UpdateUIElement( void ) override;
|
||||
void RefreshServerList( Event *ev );
|
||||
void RefreshLANServerList( Event *ev );
|
||||
void CancelRefresh( Event *ev );
|
||||
void NewServerList( void );
|
||||
void MakeLANListing( Event *ev );
|
||||
void UpdateServer( Event *ev );
|
||||
static int ServerCompareFunction( const UIListCtrlItem *i1, const UIListCtrlItem *i2, int columnname );
|
||||
void SelectServer(Event *ev);
|
||||
void ConnectServer(Event *ev);
|
||||
qboolean KeyEvent(int key, unsigned int time) override;
|
||||
void UpdateUIElement(void) override;
|
||||
void RefreshServerList(Event *ev);
|
||||
void RefreshLANServerList(Event *ev);
|
||||
void CancelRefresh(Event *ev);
|
||||
void NewServerList(void);
|
||||
void MakeLANListing(Event *ev);
|
||||
void UpdateServer(Event *ev);
|
||||
void RefreshStatus();
|
||||
|
||||
static int ServerCompareFunction(const UIListCtrlItem *i1, const UIListCtrlItem *i2, int columnname);
|
||||
static void UpdateServerListCallBack(GServerList serverlist, int msg, void *instance, void *param1, void *param2);
|
||||
|
||||
public:
|
||||
UIFAKKServerList();
|
||||
UIFAKKServerList();
|
||||
|
||||
void Draw( void ) override;
|
||||
void SortByColumn( int column ) override;
|
||||
void Draw(void) override;
|
||||
void SortByColumn(int column) override;
|
||||
};
|
||||
+53
-26
@@ -262,8 +262,7 @@ void DisplayServerNetProfileInfo(UIFont *font, float y, netprofclient_t *netprof
|
||||
y,
|
||||
va("%i",
|
||||
(unsigned int)((float)(netprofile->outPackets.numFragmented + netprofile->inPackets.numFragmented)
|
||||
/ (float)(netprofile->inPackets.totalProcessed + netprofile->outPackets.totalProcessed)
|
||||
)),
|
||||
/ (float)(netprofile->inPackets.totalProcessed + netprofile->outPackets.totalProcessed))),
|
||||
-1
|
||||
);
|
||||
font->Print(334, y, va("%i", netprofile->inPackets.percentDropped));
|
||||
@@ -273,8 +272,7 @@ void DisplayServerNetProfileInfo(UIFont *font, float y, netprofclient_t *netprof
|
||||
y,
|
||||
va("%i",
|
||||
(unsigned int)((float)(netprofile->outPackets.numDropped + netprofile->inPackets.numDropped)
|
||||
/ (float)(netprofile->inPackets.totalProcessed + netprofile->outPackets.totalProcessed)
|
||||
)),
|
||||
/ (float)(netprofile->inPackets.totalProcessed + netprofile->outPackets.totalProcessed))),
|
||||
-1
|
||||
);
|
||||
font->Print(434, y, va("%i", netprofile->inPackets.percentDropped));
|
||||
@@ -347,25 +345,21 @@ void DisplayClientNetProfile(UIFont *font, float x, float y, netprofclient_t *ne
|
||||
font->Print(x, columnHeight, "Total Data");
|
||||
|
||||
font->Print(
|
||||
columns[0],
|
||||
columnHeight,
|
||||
va("%i", netprofile->inPackets.packetsPerSec + netprofile->outPackets.packetsPerSec)
|
||||
columns[0], columnHeight, va("%i", netprofile->inPackets.packetsPerSec + netprofile->outPackets.packetsPerSec)
|
||||
);
|
||||
font->Print(
|
||||
columns[1],
|
||||
columnHeight,
|
||||
va("%i%%",
|
||||
(unsigned int)((float)(netprofile->outPackets.numFragmented + netprofile->inPackets.numFragmented)
|
||||
/ (float)(netprofile->inPackets.totalProcessed + netprofile->outPackets.totalProcessed)
|
||||
))
|
||||
/ (float)(netprofile->inPackets.totalProcessed + netprofile->outPackets.totalProcessed)))
|
||||
);
|
||||
font->Print(
|
||||
columns[2],
|
||||
columnHeight,
|
||||
va("%i%%",
|
||||
(unsigned int)((float)(netprofile->outPackets.numDropped + netprofile->inPackets.numDropped)
|
||||
/ (double)(netprofile->inPackets.totalProcessed + netprofile->outPackets.totalProcessed
|
||||
)))
|
||||
/ (double)(netprofile->inPackets.totalProcessed + netprofile->outPackets.totalProcessed)))
|
||||
);
|
||||
font->Print(
|
||||
columns[3],
|
||||
@@ -376,9 +370,7 @@ void DisplayClientNetProfile(UIFont *font, float x, float y, netprofclient_t *ne
|
||||
/ (float)(netprofile->outPackets.totalSize + netprofile->inPackets.totalSize)))
|
||||
);
|
||||
font->Print(
|
||||
columns[4],
|
||||
columnHeight,
|
||||
va("%i", netprofile->inPackets.bytesPerSec + netprofile->outPackets.bytesPerSec)
|
||||
columns[4], columnHeight, va("%i", netprofile->inPackets.bytesPerSec + netprofile->outPackets.bytesPerSec)
|
||||
);
|
||||
}
|
||||
|
||||
@@ -571,9 +563,7 @@ void View3D::CenterPrint(void)
|
||||
|
||||
frame = getClientFrame();
|
||||
|
||||
m_font->PrintJustified(
|
||||
frame, m_iFontAlignmentHorizontal, m_iFontAlignmentVertical, p, getVirtualScale()
|
||||
);
|
||||
m_font->PrintJustified(frame, m_iFontAlignmentHorizontal, m_iFontAlignmentVertical, p, getVirtualScale());
|
||||
|
||||
m_font->setColor(UBlack);
|
||||
} else if ((mat = m_print_mat->GetMaterial())) {
|
||||
@@ -798,9 +788,10 @@ void View3D::DrawSubtitleOverlay(void)
|
||||
|
||||
c = subs[i]->string;
|
||||
|
||||
total = 0;
|
||||
end = NULL;
|
||||
start = buf;
|
||||
total = 0;
|
||||
end = NULL;
|
||||
start = buf;
|
||||
buf[0] = 0;
|
||||
|
||||
while (*c) {
|
||||
blockcount = m_font->DBCSGetWordBlockCount(c, -1);
|
||||
@@ -812,10 +803,22 @@ void View3D::DrawSubtitleOverlay(void)
|
||||
|
||||
if (total + width > maxX) {
|
||||
m_font->setColor(UColor(0, 0, 0, alpha[i] * subAlpha->value));
|
||||
m_font->Print(18, (m_font->getHeight(getHighResScale()) * line + minX + 1.f) / getHighResScale()[1], buf, -1, getHighResScale());
|
||||
m_font->Print(
|
||||
18,
|
||||
(m_font->getHeight(getHighResScale()) * line + minX + 1.f) / getHighResScale()[1],
|
||||
buf,
|
||||
-1,
|
||||
getHighResScale()
|
||||
);
|
||||
|
||||
m_font->setColor(UColor(1, 1, 1, alpha[i] * subAlpha->value));
|
||||
m_font->Print(20, (m_font->getHeight(getHighResScale()) * line + minX) / getHighResScale()[1], buf, -1, getHighResScale());
|
||||
m_font->Print(
|
||||
20,
|
||||
(m_font->getHeight(getHighResScale()) * line + minX) / getHighResScale()[1],
|
||||
buf,
|
||||
-1,
|
||||
getHighResScale()
|
||||
);
|
||||
|
||||
line++;
|
||||
|
||||
@@ -838,17 +841,41 @@ void View3D::DrawSubtitleOverlay(void)
|
||||
}
|
||||
|
||||
m_font->setColor(UColor(0, 0, 0, alpha[i] * subAlpha->value));
|
||||
m_font->Print(18, (m_font->getHeight(getHighResScale()) * line + minX + 1.f) / getHighResScale()[1], buf, -1, getHighResScale());
|
||||
m_font->Print(
|
||||
18,
|
||||
(m_font->getHeight(getHighResScale()) * line + minX + 1.f) / getHighResScale()[1],
|
||||
buf,
|
||||
-1,
|
||||
getHighResScale()
|
||||
);
|
||||
|
||||
m_font->setColor(UColor(1, 1, 1, alpha[i] * subAlpha->value));
|
||||
m_font->Print(20, (m_font->getHeight(getHighResScale()) * line + minX) / getHighResScale()[1], buf, -1, getHighResScale());
|
||||
m_font->Print(
|
||||
20,
|
||||
(m_font->getHeight(getHighResScale()) * line + minX) / getHighResScale()[1],
|
||||
buf,
|
||||
-1,
|
||||
getHighResScale()
|
||||
);
|
||||
line++;
|
||||
} else {
|
||||
m_font->setColor(UColor(0, 0, 0, alpha[i] * subAlpha->value));
|
||||
m_font->Print(18, (m_font->getHeight(getHighResScale()) * line + minX + 1.f) / getHighResScale()[1], subs[i]->string, -1, getHighResScale());
|
||||
m_font->Print(
|
||||
18,
|
||||
(m_font->getHeight(getHighResScale()) * line + minX + 1.f) / getHighResScale()[1],
|
||||
subs[i]->string,
|
||||
-1,
|
||||
getHighResScale()
|
||||
);
|
||||
|
||||
m_font->setColor(UColor(1, 1, 1, alpha[i] * subAlpha->value));
|
||||
m_font->Print(20, (m_font->getHeight(getHighResScale()) * line + minX) / getHighResScale()[1], subs[i]->string, -1, getHighResScale());
|
||||
m_font->Print(
|
||||
20,
|
||||
(m_font->getHeight(getHighResScale()) * line + minX) / getHighResScale()[1],
|
||||
subs[i]->string,
|
||||
-1,
|
||||
getHighResScale()
|
||||
);
|
||||
|
||||
line++;
|
||||
}
|
||||
|
||||
@@ -561,6 +561,7 @@ qboolean CL_CheckPaused(void);
|
||||
|
||||
int CL_GetRefSequence(void);
|
||||
qboolean CL_IsRendererLoaded(void);
|
||||
void CL_ApplyOriginalConfigTweaks();
|
||||
|
||||
//
|
||||
// cl_input
|
||||
@@ -581,6 +582,7 @@ extern qboolean in_guimouse;
|
||||
void IN_ToggleMouse( void );
|
||||
void IN_MouseOn( void );
|
||||
void IN_MouseOff( void );
|
||||
void CL_UpdateMouse();
|
||||
|
||||
void CL_InitInput (void);
|
||||
void CL_ShutdownInput(void);
|
||||
|
||||
@@ -36,15 +36,18 @@ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
#ifdef USE_LOCAL_HEADERS
|
||||
#include "../AL/al.h"
|
||||
#include "../AL/alc.h"
|
||||
#include "../AL/alext.h"
|
||||
#else
|
||||
#if defined(_MSC_VER) || defined(__APPLE__)
|
||||
// MSVC users must install the OpenAL SDK which doesn't use the AL/*.h scheme.
|
||||
// OSX framework also needs this
|
||||
#include <al.h>
|
||||
#include <alc.h>
|
||||
#include <alext.h>
|
||||
#else
|
||||
#include <AL/al.h>
|
||||
#include <AL/alc.h>
|
||||
#include <AL/alext.h>
|
||||
#endif
|
||||
#endif
|
||||
|
||||
|
||||
@@ -26,12 +26,6 @@ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
#include "../server/server.h"
|
||||
#include "snd_codec.h"
|
||||
|
||||
#if defined(_MSC_VER) || defined(__APPLE__)
|
||||
# include <alext.h>
|
||||
#else
|
||||
# include <AL/alext.h>
|
||||
#endif
|
||||
|
||||
typedef struct {
|
||||
const char *funcname;
|
||||
void **funcptr;
|
||||
@@ -69,15 +63,17 @@ static float reverb_table[] = {
|
||||
1.0f, 0.097000003f, 0.208f, 0.65200001f, 1.0f, 0.875f, 0.139f, 0.486f,
|
||||
};
|
||||
|
||||
static vec3_t vec_zero = {0, 0, 0};
|
||||
int s_iNumMilesAudioProviders = 0;
|
||||
bool s_bProvidersEmunerated = false;
|
||||
static bool al_initialized = false;
|
||||
static bool al_use_reverb = false;
|
||||
static float al_current_volume = 0;
|
||||
static unsigned int al_frequency = 22050;
|
||||
static ALCcontext *al_context_id = NULL;
|
||||
static ALCdevice *al_device = NULL;
|
||||
static vec3_t vec_zero = {0, 0, 0};
|
||||
int s_iNumMilesAudioProviders = 0;
|
||||
bool s_bProvidersEmunerated = false;
|
||||
static bool al_initialized = false;
|
||||
static bool al_use_reverb = false;
|
||||
static float al_current_volume = 0;
|
||||
static unsigned int al_frequency = 22050;
|
||||
static ALCcontext *al_context_id = NULL;
|
||||
static ALCdevice *al_device = NULL;
|
||||
static ALsizei al_default_resampler_index = 0;
|
||||
static ALsizei al_resampler_index = 0;
|
||||
|
||||
static ALboolean (*_alutLoadMP3_LOKI)(unsigned int buffer, const byte *data, int length);
|
||||
static void (*_alReverbScale_LOKI)();
|
||||
@@ -132,6 +128,13 @@ static ALuint S_OPENAL_Format(float width, int channels);
|
||||
# define ALDRIVER_DEFAULT "libopenal.so.1"
|
||||
#endif
|
||||
|
||||
//
|
||||
// alext
|
||||
//
|
||||
#ifdef AL_SOFT_source_resampler
|
||||
LPALGETSTRINGISOFT qalGetStringiSOFT;
|
||||
#endif
|
||||
|
||||
/*
|
||||
==============
|
||||
__alDieIfError
|
||||
@@ -271,7 +274,7 @@ S_OPENAL_InitContext
|
||||
static bool S_OPENAL_InitContext()
|
||||
{
|
||||
const char *dev;
|
||||
int attrlist[8];
|
||||
int attrlist[12];
|
||||
|
||||
Com_DPrintf("OpenAL: Context initialization\n");
|
||||
|
||||
@@ -378,6 +381,11 @@ static bool S_OPENAL_InitContext()
|
||||
|
||||
#ifdef ALC_SOFT_output_mode
|
||||
attrlist[4] = ALC_OUTPUT_MODE_SOFT;
|
||||
// Disable HRTF by default
|
||||
// For example, actual speakers that are recognized as headphones by the OS
|
||||
// will not get forced HRTF
|
||||
attrlist[6] = ALC_HRTF_SOFT;
|
||||
attrlist[7] = ALC_FALSE;
|
||||
|
||||
switch (s_speaker_type->integer) {
|
||||
// Two speakers
|
||||
@@ -388,6 +396,8 @@ static bool S_OPENAL_InitContext()
|
||||
// Headphones
|
||||
case 1:
|
||||
attrlist[5] = ALC_STEREO_HRTF_SOFT;
|
||||
// Allow HRTF mixing (without forcing in case it's unsupported)
|
||||
attrlist[7] = ALC_DONT_CARE_SOFT;
|
||||
break;
|
||||
// Surround
|
||||
case 2:
|
||||
@@ -408,8 +418,13 @@ static bool S_OPENAL_InitContext()
|
||||
attrlist[5] = 0;
|
||||
#endif
|
||||
|
||||
attrlist[6] = 0;
|
||||
attrlist[7] = 0;
|
||||
#ifdef ALC_SOFT_output_limiter
|
||||
// Disable limiter
|
||||
attrlist[8] = ALC_OUTPUT_LIMITER_SOFT;
|
||||
attrlist[9] = ALC_FALSE;
|
||||
#endif
|
||||
attrlist[10] = 0;
|
||||
attrlist[11] = 0;
|
||||
|
||||
Com_Printf("OpenAL: Creating AL context...\n");
|
||||
al_context_id = qalcCreateContext(al_device, attrlist);
|
||||
@@ -452,11 +467,7 @@ S_OPENAL_InitExtensions
|
||||
*/
|
||||
static bool S_OPENAL_InitExtensions()
|
||||
{
|
||||
ima4_ext = qalIsExtensionPresent("AL_EXT_IMA4");
|
||||
soft_block_align = qalIsExtensionPresent("AL_SOFT_block_alignment");
|
||||
|
||||
return true;
|
||||
|
||||
/*
|
||||
extensions_table_t extensions_table[4] = {
|
||||
"alutLoadMP3_LOKI",
|
||||
(void **)&_alutLoadMP3_LOKI,
|
||||
@@ -468,6 +479,17 @@ static bool S_OPENAL_InitExtensions()
|
||||
(void **)&_alReverbDelay_LOKI,
|
||||
true
|
||||
};
|
||||
*/
|
||||
|
||||
extensions_table_t extensions_table[] = {
|
||||
#ifdef AL_SOFT_source_resampler
|
||||
extensions_table_t {
|
||||
"alGetStringiSOFT", (void **)&qalGetStringiSOFT,
|
||||
false, },
|
||||
#endif
|
||||
extensions_table_t {NULL, NULL, NULL}
|
||||
};
|
||||
|
||||
extensions_table_t *i;
|
||||
|
||||
for (i = extensions_table; i->funcname; ++i) {
|
||||
@@ -490,6 +512,9 @@ static bool S_OPENAL_InitExtensions()
|
||||
Com_Printf("...found.\n");
|
||||
}
|
||||
|
||||
ima4_ext = qalIsExtensionPresent("AL_EXT_IMA4");
|
||||
soft_block_align = qalIsExtensionPresent("AL_SOFT_block_alignment");
|
||||
|
||||
qalGetError();
|
||||
return true;
|
||||
}
|
||||
@@ -529,6 +554,11 @@ static bool S_OPENAL_InitChannel(int idx, openal_channel *chan)
|
||||
qalSourcei(chan->source, AL_SOURCE_RELATIVE, true);
|
||||
alDieIfError();
|
||||
|
||||
#ifdef AL_SOFT_source_resampler
|
||||
qalSourcei(chan->source, AL_SOURCE_RESAMPLER_SOFT, al_resampler_index);
|
||||
alDieIfError();
|
||||
#endif
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -605,6 +635,28 @@ qboolean S_OPENAL_Init()
|
||||
qalListenerf(AL_GAIN, al_current_volume);
|
||||
alDieIfError();
|
||||
|
||||
#ifdef AL_SOFT_source_resampler
|
||||
if (qalGetStringiSOFT) {
|
||||
size_t numResamplers;
|
||||
size_t i;
|
||||
|
||||
al_default_resampler_index = qalGetInteger(AL_DEFAULT_RESAMPLER_SOFT);
|
||||
alDieIfError();
|
||||
al_resampler_index = al_default_resampler_index;
|
||||
numResamplers = qalGetInteger(AL_NUM_RESAMPLERS_SOFT);
|
||||
alDieIfError();
|
||||
|
||||
for (i = 0; i < numResamplers; i++) {
|
||||
const ALchar *resamplerName = qalGetStringiSOFT(AL_RESAMPLER_NAME_SOFT, i);
|
||||
if (Q_stristr(resamplerName, "spline")) {
|
||||
Com_Printf("OpenAL: Using %s as the resampler.\n", resamplerName);
|
||||
al_resampler_index = i;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
for (i = 0; i < MAX_SOUNDSYSTEM_CHANNELS_3D; i++) {
|
||||
if (!S_OPENAL_InitChannel(i, &openal.chan_3D[i])) {
|
||||
return false;
|
||||
@@ -708,6 +760,8 @@ void S_OPENAL_Shutdown()
|
||||
|
||||
s_bProvidersEmunerated = false;
|
||||
al_initialized = false;
|
||||
|
||||
QAL_Shutdown();
|
||||
}
|
||||
|
||||
/*
|
||||
@@ -3069,10 +3123,12 @@ bool openal_channel::set_sfx(sfx_t *pSfx)
|
||||
qalGenBuffers(1, &pSfx->buffer);
|
||||
alDieIfError();
|
||||
|
||||
#if AL_SOFT_block_alignment
|
||||
if (pSfx->info.dataalign > 1) {
|
||||
qalBufferi(pSfx->buffer, AL_UNPACK_BLOCK_ALIGNMENT_SOFT, pSfx->info.dataalign);
|
||||
alDieIfError();
|
||||
}
|
||||
#endif
|
||||
|
||||
qalBufferData(
|
||||
pSfx->buffer,
|
||||
@@ -4451,10 +4507,12 @@ bool openal_channel_two_d_stream::set_sfx(sfx_t *pSfx)
|
||||
return true;
|
||||
}
|
||||
|
||||
#if AL_SOFT_block_alignment
|
||||
if (stream->info.dataalign > 1 && soft_block_align) {
|
||||
qalBufferi(buffers[currentBuf], AL_UNPACK_BLOCK_ALIGNMENT_SOFT, stream->info.dataalign);
|
||||
alDieIfError();
|
||||
}
|
||||
#endif
|
||||
|
||||
qalBufferData(buffers[currentBuf], pSfx->info.format, rawData, bytesRead, stream->info.rate);
|
||||
alDieIfError();
|
||||
@@ -4595,10 +4653,12 @@ void openal_channel_two_d_stream::update()
|
||||
}
|
||||
}
|
||||
|
||||
#if AL_SOFT_block_alignment
|
||||
if (stream->info.dataalign > 1 && soft_block_align) {
|
||||
qalBufferi(buffers[currentBuf], AL_UNPACK_BLOCK_ALIGNMENT_SOFT, stream->info.dataalign);
|
||||
alDieIfError();
|
||||
}
|
||||
#endif
|
||||
|
||||
qalBufferData(buffers[currentBuf], format, rawData, bytesRead, stream->info.rate);
|
||||
alDieIfError();
|
||||
|
||||
@@ -0,0 +1,15 @@
|
||||
cmake_minimum_required(VERSION 3.12)
|
||||
|
||||
project(curl)
|
||||
|
||||
add_library(curldefs INTERFACE)
|
||||
target_include_directories(curldefs INTERFACE "./")
|
||||
|
||||
find_package(CURL)
|
||||
|
||||
if (CURL_FOUND)
|
||||
target_include_directories(curldefs INTERFACE ${CURL_INCLUDE_DIRS})
|
||||
target_compile_definitions(curldefs INTERFACE HAS_LIBCURL=1)
|
||||
else()
|
||||
message(WARNING "CURL is not available, HTTP-based features will not work.")
|
||||
endif()
|
||||
@@ -0,0 +1,105 @@
|
||||
/*
|
||||
===========================================================================
|
||||
Copyright (C) 2025 the OpenMoHAA team
|
||||
|
||||
This file is part of OpenMoHAA source code.
|
||||
|
||||
OpenMoHAA source code is free software; you can redistribute it
|
||||
and/or modify it under the terms of the GNU General Public License as
|
||||
published by the Free Software Foundation; either version 2 of the License,
|
||||
or (at your option) any later version.
|
||||
|
||||
OpenMoHAA source code is distributed in the hope that it will be
|
||||
useful, but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with OpenMoHAA source code; if not, write to the Free Software
|
||||
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
===========================================================================
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
|
||||
#include "../qcommon/q_shared.h"
|
||||
|
||||
#ifdef HAS_LIBCURL
|
||||
|
||||
# include <stdint.h>
|
||||
# include <stdlib.h>
|
||||
# include <curl/curl.h>
|
||||
|
||||
//
|
||||
// This structure is guaranteed to work on cURL 7.88.1
|
||||
//
|
||||
typedef struct {
|
||||
char *(*qcurl_version)(void);
|
||||
char *(*qcurl_getenv)(const char *variable);
|
||||
void (*qcurl_free)(void *p);
|
||||
struct curl_slist *(*qcurl_slist_append)(struct curl_slist *list, const char *data);
|
||||
void (*qcurl_slist_free_all)(struct curl_slist *list);
|
||||
struct curl_version_info_data *(*qcurl_version_info)(CURLversion);
|
||||
const char *(*qcurl_easy_strerror)(CURLcode);
|
||||
const char *(*qcurl_share_strerror)(CURLSHcode);
|
||||
CURLcode (*qcurl_easy_pause)(CURL *handle, int bitmask);
|
||||
char *(*qcurl_easy_escape)(CURL *handle, const char *string, int length);
|
||||
char *(*qcurl_easy_unescape)(CURL *handle, const char *string, int length, int *outlength);
|
||||
CURL *(*qcurl_easy_init)(void);
|
||||
CURLcode (*qcurl_easy_setopt)(CURL *curl, CURLoption option, ...);
|
||||
CURLcode (*qcurl_easy_perform)(CURL *curl);
|
||||
void (*qcurl_easy_cleanup)(CURL *curl);
|
||||
CURLcode (*qcurl_easy_getinfo)(CURL *curl, CURLINFO info, ...);
|
||||
CURL *(*qcurl_easy_duphandle)(CURL *curl);
|
||||
void (*qcurl_easy_reset)(CURL *curl);
|
||||
CURLcode (*qcurl_easy_recv)(CURL *curl, void *buffer, size_t buflen, size_t *n);
|
||||
CURLcode (*qcurl_easy_send)(CURL *curl, const void *buffer, size_t buflen, size_t *n);
|
||||
CURLcode (*qcurl_easy_upkeep)(CURL *curl);
|
||||
CURLM *(*qcurl_multi_init)(void);
|
||||
CURLMcode (*qcurl_multi_add_handle)(CURLM *multi_handle, CURL *curl_handle);
|
||||
CURLMcode (*qcurl_multi_remove_handle)(CURLM *multi_handle, CURL *curl_handle);
|
||||
CURLMcode (*qcurl_multi_fdset)(
|
||||
CURLM *multi_handle, fd_set *read_fd_set, fd_set *write_fd_set, fd_set *exc_fd_set, int *max_fd
|
||||
);
|
||||
CURLMcode (*qcurl_multi_wait)(
|
||||
CURLM *multi_handle, struct curl_waitfd extra_fds[], unsigned int extra_nfds, int timeout_ms, int *ret
|
||||
);
|
||||
CURLMcode (*qcurl_multi_poll)(
|
||||
CURLM *multi_handle, struct curl_waitfd extra_fds[], unsigned int extra_nfds, int timeout_ms, int *ret
|
||||
);
|
||||
CURLMcode (*qcurl_multi_wakeup)(CURLM *multi_handle);
|
||||
CURLMcode (*qcurl_multi_perform)(CURLM *multi_handle, int *running_handles);
|
||||
CURLMcode (*qcurl_multi_cleanup)(CURLM *multi_handle);
|
||||
CURLMsg *(*qcurl_multi_info_read)(CURLM *multi_handle, int *msgs_in_queue);
|
||||
const char *(*qcurl_multi_strerror)(CURLMcode);
|
||||
CURLMcode (*qcurl_multi_socket_action)(CURLM *multi_handle, curl_socket_t s, int ev_bitmask, int *running_handles);
|
||||
CURLMcode (*qcurl_multi_timeout)(CURLM *multi_handle, long *milliseconds);
|
||||
CURLMcode (*qcurl_multi_setopt)(CURLM *multi_handle, CURLMoption option, ...);
|
||||
CURLMcode (*qcurl_multi_assign)(CURLM *multi_handle, curl_socket_t sockfd, void *sockp);
|
||||
// 8.4.0
|
||||
//CURL **(*qcurl_multi_get_handles)(CURLM *multi_handle);
|
||||
char *(*qcurl_pushheader_bynum)(struct curl_pushheaders *h, size_t num);
|
||||
char *(*qcurl_pushheader_byname)(struct curl_pushheaders *h, const char *name);
|
||||
// 8.8.0
|
||||
//CURLMcode (*qcurl_multi_waitfds)(CURLM *multi, struct curl_waitfd *ufds, unsigned int size, unsigned int *fd_count);
|
||||
} curlImport_t;
|
||||
|
||||
static inline qboolean Com_IsCurlImportValid(curlImport_t *import)
|
||||
{
|
||||
return import && import->qcurl_version != NULL;
|
||||
}
|
||||
|
||||
#else
|
||||
|
||||
//
|
||||
// No cURL at all
|
||||
//
|
||||
|
||||
typedef void *curlImport_t;
|
||||
|
||||
static inline qboolean Com_IsCurlImportValid(curlImport_t *import)
|
||||
{
|
||||
return qfalse;
|
||||
}
|
||||
|
||||
#endif
|
||||
@@ -58,6 +58,16 @@ if (FLEX_FOUND AND BISON_FOUND)
|
||||
add_flex_bison_dependency(fgame-lexer fgame-parser)
|
||||
endif()
|
||||
|
||||
# Recast navigation
|
||||
add_subdirectory(../recastnavigation/Detour fgame_detour)
|
||||
add_subdirectory(../recastnavigation/DetourCrowd fgame_detour_crowd)
|
||||
add_subdirectory(../recastnavigation/Recast fgame_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)
|
||||
|
||||
target_link_libraries(fgame PRIVATE RecastNavigation::Detour RecastNavigation::DetourCrowd RecastNavigation::Recast)
|
||||
|
||||
file(MAKE_DIRECTORY "${CMAKE_SOURCE_DIR}/code/parser/generated")
|
||||
target_sources(fgame PRIVATE ${BISON_fgame-parser_OUTPUTS} ${FLEX_fgame-lexer_OUTPUTS})
|
||||
|
||||
|
||||
+90
-9
@@ -432,7 +432,7 @@ Event EV_Actor_SetAnimFinal
|
||||
EV_DEFAULT,
|
||||
NULL,
|
||||
NULL,
|
||||
"Whether the animation was succesfully finished",
|
||||
"Whether the animation was successfully finished",
|
||||
EV_SETTER
|
||||
);
|
||||
Event EV_Actor_GetWeaponType
|
||||
@@ -4086,17 +4086,85 @@ bool Actor::CanShootEnemy(int iMaxDirtyTime)
|
||||
/*
|
||||
===============
|
||||
Actor::FriendlyInLineOfFire
|
||||
|
||||
Returns true when a squadmate is in line of fire.
|
||||
|
||||
The line of fire is the line between the actor and the target.
|
||||
It only checks for actors along that line segment,
|
||||
which means it won't check for actors located behind the target.
|
||||
===============
|
||||
*/
|
||||
bool Actor::FriendlyInLineOfFire(Entity *other)
|
||||
{
|
||||
Vector delta;
|
||||
float inverseDot;
|
||||
|
||||
if (g_target_game <= target_game_e::TG_MOH) {
|
||||
return false;
|
||||
}
|
||||
|
||||
//
|
||||
// Fixed in OPM
|
||||
// Correctly check if a squadmate is in line of fire.
|
||||
// This checks for the following situation:
|
||||
//
|
||||
// 0 <-- AI
|
||||
// /
|
||||
// /
|
||||
// 0 <-- Squadmate
|
||||
// /
|
||||
// /
|
||||
// P <-- Player
|
||||
//
|
||||
|
||||
Vector dir;
|
||||
|
||||
if (other->IsSubclassOfSentient()) {
|
||||
dir = static_cast<Sentient *>(other)->EyePosition() - GunPosition();
|
||||
} else {
|
||||
dir = other->centroid - GunPosition();
|
||||
}
|
||||
|
||||
const float dist = dir.normalize();
|
||||
|
||||
//
|
||||
// Try to find a squadmate in sight
|
||||
//
|
||||
|
||||
for (Sentient *pSquad = m_pNextSquadMate; pSquad != this; pSquad = pSquad->m_pNextSquadMate) {
|
||||
// Project the squadmate position onto the direction line
|
||||
// (see @ProjectPointOnLine)
|
||||
const Vector delta = pSquad->origin - origin;
|
||||
const float dot = Q_clamp_float(delta * dir, 0, dist);
|
||||
const Vector proj = dir * dot;
|
||||
if (proj.lengthSquared() < Square(64)) {
|
||||
// Within the safety radius (at least 64 units)
|
||||
return true;
|
||||
}
|
||||
|
||||
// Calculate the closest point on the line
|
||||
const Vector closest = origin + proj;
|
||||
if (closest >= pSquad->absmin && closest <= pSquad->absmax) {
|
||||
// The point is within the bounding box
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
return false;
|
||||
#if 0
|
||||
//
|
||||
// The following code incorrectly returns true at this:
|
||||
//
|
||||
// AI Friend AI
|
||||
// ↓ ↓
|
||||
// 0--------0
|
||||
// /
|
||||
// /
|
||||
// /
|
||||
// /
|
||||
// P <-- Player
|
||||
//
|
||||
|
||||
Vector delta;
|
||||
float inverseDot;
|
||||
|
||||
delta = other->origin - origin;
|
||||
inverseDot = 1.0 / (delta * delta);
|
||||
|
||||
@@ -4117,6 +4185,7 @@ bool Actor::FriendlyInLineOfFire(Entity *other)
|
||||
}
|
||||
|
||||
return false;
|
||||
#endif
|
||||
}
|
||||
|
||||
/*
|
||||
@@ -4351,7 +4420,7 @@ void Actor::MoveTo(Event *ev)
|
||||
}
|
||||
|
||||
if (m_patrolCurrentNode) {
|
||||
m_vScriptGoal = origin;
|
||||
m_vScriptGoal = m_patrolCurrentNode->origin;
|
||||
m_bScriptGoalValid = true;
|
||||
}
|
||||
|
||||
@@ -7412,8 +7481,15 @@ void Actor::UpdateAnim(void)
|
||||
float rate;
|
||||
|
||||
rate = time / total_weight;
|
||||
if (m_Team != TEAM_GERMAN) {
|
||||
rate /= 1.45f;
|
||||
|
||||
if (g_target_game > target_game_e::TG_MOH) {
|
||||
//
|
||||
// Added in 2.0
|
||||
// Slightly decrease the animation rate for non-german actors
|
||||
//
|
||||
if (m_Team != TEAM_GERMAN) {
|
||||
rate /= 1.45f;
|
||||
}
|
||||
}
|
||||
|
||||
SetSyncRate(rate / m_fRunAnimRate);
|
||||
@@ -8614,6 +8690,11 @@ Should actor transition think state to curious ?
|
||||
*/
|
||||
bool Actor::PassesTransitionConditions_Curious(void)
|
||||
{
|
||||
if (!m_bIsCurious) {
|
||||
// Added in 2.30
|
||||
return false;
|
||||
}
|
||||
|
||||
UpdateEnemy(200);
|
||||
|
||||
if (m_bLockThinkState) {
|
||||
@@ -9148,13 +9229,13 @@ void Actor::CuriousSound(int iType, vec3_t sound_origin, float fDistSquared, flo
|
||||
|
||||
fRangeFactor = 1.0;
|
||||
if (fMaxDistSquared) {
|
||||
fRangeFactor = (4.0 / 3.0 - ((4.0 / 3.0 * fDistSquared) / fMaxDistSquared));
|
||||
fRangeFactor = 4.0 / 3.0 - ((4.0 / 3.0 * fDistSquared) / fMaxDistSquared);
|
||||
if (fRangeFactor > 1) {
|
||||
fRangeFactor = 1;
|
||||
}
|
||||
}
|
||||
|
||||
if ((fRangeFactor * m_fSoundAwareness) < random()) {
|
||||
if ((fRangeFactor * m_fSoundAwareness) < random() * 100.0) {
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
@@ -166,8 +166,9 @@ void Actor::InitCover(GlobalFuncs_t *func)
|
||||
func->BeginState = &Actor::Begin_Cover;
|
||||
func->EndState = &Actor::End_Cover;
|
||||
func->SuspendState = &Actor::Suspend_Cover;
|
||||
func->FinishedAnimation = &Actor::FinishedAnimation_Cover;
|
||||
func->RestartState = NULL;
|
||||
func->PassesTransitionConditions = &Actor::PassesTransitionConditions_Attack;
|
||||
func->FinishedAnimation = &Actor::FinishedAnimation_Cover;
|
||||
func->IsState = &Actor::IsAttackState;
|
||||
func->PathnodeClaimRevoked = &Actor::PathnodeClaimRevoked_Cover;
|
||||
}
|
||||
|
||||
@@ -29,6 +29,7 @@ void Actor::InitCurious(GlobalFuncs_t *func)
|
||||
func->ThinkState = &Actor::Think_Curious;
|
||||
func->BeginState = &Actor::Begin_Curious;
|
||||
func->EndState = &Actor::End_Curious;
|
||||
func->RestartState = NULL;
|
||||
func->ResumeState = &Actor::Resume_Curious;
|
||||
func->SuspendState = &Actor::Suspend_Curious;
|
||||
func->FinishedAnimation = &Actor::FinishedAnimation_Curious;
|
||||
|
||||
@@ -29,6 +29,7 @@ void Actor::InitDogIdle(GlobalFuncs_t *func)
|
||||
func->BeginState = &Actor::Begin_Dog;
|
||||
func->EndState = &Actor::End_Dog;
|
||||
func->ThinkState = &Actor::Think_Dog_Idle;
|
||||
func->RestartState = NULL;
|
||||
func->PassesTransitionConditions = &Actor::PassesTransitionConditions_Idle;
|
||||
func->IsState = &Actor::IsDogState;
|
||||
}
|
||||
@@ -38,6 +39,7 @@ void Actor::InitDogAttack(GlobalFuncs_t *func)
|
||||
func->BeginState = &Actor::Begin_Dog;
|
||||
func->EndState = &Actor::End_Dog;
|
||||
func->ThinkState = &Actor::Think_Dog_Attack;
|
||||
func->RestartState = NULL;
|
||||
func->PassesTransitionConditions = &Actor::PassesTransitionConditions_Attack;
|
||||
func->IsState = &Actor::IsDogState;
|
||||
}
|
||||
@@ -47,6 +49,7 @@ void Actor::InitDogCurious(GlobalFuncs_t *func)
|
||||
func->BeginState = &Actor::Begin_Dog;
|
||||
func->EndState = &Actor::End_Dog;
|
||||
func->ThinkState = &Actor::Think_Dog_Curious;
|
||||
func->RestartState = NULL;
|
||||
func->PassesTransitionConditions = &Actor::PassesTransitionConditions_Curious;
|
||||
func->IsState = &Actor::IsDogState;
|
||||
}
|
||||
|
||||
@@ -28,7 +28,9 @@ void Actor::InitWeaponless(GlobalFuncs_t *func)
|
||||
{
|
||||
func->ThinkState = &Actor::Think_Weaponless;
|
||||
func->BeginState = &Actor::Begin_Weaponless;
|
||||
func->EndState = NULL;
|
||||
func->SuspendState = &Actor::Suspend_Weaponless;
|
||||
func->RestartState = NULL;
|
||||
func->PassesTransitionConditions = &Actor::PassesTransitionConditions_Attack;
|
||||
func->FinishedAnimation = &Actor::FinishedAnimation_Weaponless;
|
||||
func->IsState = &Actor::IsAttackState;
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
/*
|
||||
===========================================================================
|
||||
Copyright (C) 2015 the OpenMoHAA team
|
||||
Copyright (C) 2025 the OpenMoHAA team
|
||||
|
||||
This file is part of OpenMoHAA source code.
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
/*
|
||||
===========================================================================
|
||||
Copyright (C) 2015 the OpenMoHAA team
|
||||
Copyright (C) 2025 the OpenMoHAA team
|
||||
|
||||
This file is part of OpenMoHAA source code.
|
||||
|
||||
@@ -24,6 +24,9 @@ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
|
||||
#pragma once
|
||||
|
||||
#include "navigate.h"
|
||||
#include "archive.h"
|
||||
|
||||
#define MIN_FALLHEIGHT 18
|
||||
#define MAX_FALLHEIGHT 1024
|
||||
|
||||
|
||||
+1
-1
@@ -100,7 +100,7 @@ Item *AmmoEntity::ItemPickup(Entity *other, qboolean add_to_inventory)
|
||||
gi.SendServerCommand(
|
||||
other->edict - g_entities,
|
||||
"print \"" HUD_MESSAGE_YELLOW "%s\"",
|
||||
gi.LV_ConvertString(va("Got %d %s Rounds", amount, item_name.c_str()))
|
||||
gi.LV_ConvertString(va("Got %d %s Rounds", amount, GetCapitalized(item_name).c_str()))
|
||||
);
|
||||
|
||||
// Give the ammo to the player
|
||||
|
||||
@@ -109,11 +109,6 @@ const char *ArchiveFile::Filename(void)
|
||||
|
||||
qboolean ArchiveFile::Compress()
|
||||
{
|
||||
#ifdef Q3_BIG_ENDIAN
|
||||
// FIXME: Decompressing crashes on big-endian architectures
|
||||
return false;
|
||||
#endif
|
||||
|
||||
byte *tempbuf;
|
||||
size_t out_len;
|
||||
size_t tempbuf_len;
|
||||
@@ -126,7 +121,9 @@ qboolean ArchiveFile::Compress()
|
||||
tempbuf[1] = 'S';
|
||||
tempbuf[2] = 'V';
|
||||
tempbuf[3] = 'G';
|
||||
*(size_t *)(tempbuf + 4) = length;
|
||||
|
||||
unsigned int temp = length;
|
||||
CopyLittleLong(tempbuf + 4, &temp);
|
||||
|
||||
// Compress the data
|
||||
if (g_lz77.Compress(buffer, length, tempbuf + 8, &out_len)) {
|
||||
@@ -1129,7 +1126,7 @@ void Archiver::WriteType(int type)
|
||||
|
||||
void Archiver::CheckType(int type)
|
||||
{
|
||||
int t;
|
||||
unsigned int t;
|
||||
|
||||
assert((type >= 0) && (type < ARC_NUMTYPES));
|
||||
|
||||
|
||||
+20
-14
@@ -1,6 +1,6 @@
|
||||
/*
|
||||
===========================================================================
|
||||
Copyright (C) 2024 the OpenMoHAA team
|
||||
Copyright (C) 2025 the OpenMoHAA team
|
||||
|
||||
This file is part of OpenMoHAA source code.
|
||||
|
||||
@@ -153,7 +153,7 @@ public:
|
||||
|
||||
void ArchiveRaw(void *data, size_t size);
|
||||
void ArchiveObject(Class *obj);
|
||||
void ArchiveObject(SafePtrBase* obj); // Added in OPM
|
||||
void ArchiveObject(SafePtrBase *obj); // Added in OPM
|
||||
|
||||
qboolean ObjectPositionExists(void *obj);
|
||||
|
||||
@@ -167,23 +167,29 @@ public:
|
||||
template<class Type>
|
||||
inline void Container<Type>::Archive(Archiver& arc, void (*ArchiveFunc)(Archiver& arc, Type *obj))
|
||||
{
|
||||
int num;
|
||||
int i;
|
||||
Type *obj;
|
||||
int num;
|
||||
int i;
|
||||
|
||||
if (arc.Loading()) {
|
||||
arc.ArchiveInteger(&num);
|
||||
Resize(num);
|
||||
} else {
|
||||
num = numobjects;
|
||||
arc.ArchiveInteger(&num);
|
||||
}
|
||||
|
||||
for (i = 1; i <= num; i++) {
|
||||
if (num > numobjects) {
|
||||
numobjects = num;
|
||||
}
|
||||
|
||||
ArchiveFunc(arc, &objlist[i - 1]);
|
||||
for (i = 0; i < num; i++) {
|
||||
obj = new (objlist + i) Type();
|
||||
ArchiveFunc(arc, obj);
|
||||
}
|
||||
} else {
|
||||
num = numobjects;
|
||||
arc.ArchiveInteger(&num);
|
||||
|
||||
for (i = 0; i < num; i++) {
|
||||
ArchiveFunc(arc, &objlist[i]);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -287,7 +293,7 @@ void con_set<key, value>::Archive(Archiver& arc)
|
||||
|
||||
if (arc.Loading()) {
|
||||
if (tableLength != 1) {
|
||||
table = new Entry *[tableLength]();
|
||||
table = new (NewTable(tableLength)) Entry *[tableLength]();
|
||||
memset(table, 0, tableLength * sizeof(Entry *));
|
||||
}
|
||||
|
||||
@@ -303,7 +309,7 @@ void con_set<key, value>::Archive(Archiver& arc)
|
||||
|
||||
defaultEntry = e;
|
||||
} else {
|
||||
#ifndef NDEBUG
|
||||
# ifndef NDEBUG
|
||||
int total;
|
||||
|
||||
total = 0;
|
||||
@@ -316,13 +322,13 @@ void con_set<key, value>::Archive(Archiver& arc)
|
||||
}
|
||||
// it must match the number of elements
|
||||
assert(total == count);
|
||||
#else
|
||||
# else
|
||||
for (i = 0; i < tableLength; i++) {
|
||||
for (e = table[i]; e != NULL; e = e->next) {
|
||||
e->Archive(arc);
|
||||
}
|
||||
}
|
||||
#endif
|
||||
# endif
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
+25
-19
@@ -1,6 +1,6 @@
|
||||
/*
|
||||
===========================================================================
|
||||
Copyright (C) 2024 the OpenMoHAA team
|
||||
Copyright (C) 2025 the OpenMoHAA team
|
||||
|
||||
This file is part of OpenMoHAA source code.
|
||||
|
||||
@@ -350,7 +350,7 @@ void BarrelObject::BarrelDamaged(Event *ev)
|
||||
Vector vHitDirection;
|
||||
Vector vHitNormal;
|
||||
|
||||
if (!takedamage) {
|
||||
if (takedamage == DAMAGE_NO) {
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -378,23 +378,24 @@ void BarrelObject::BarrelDamaged(Event *ev)
|
||||
m_vJitterAngles[2] = -(m_fJitterScale * 1.5f);
|
||||
}
|
||||
|
||||
if (!(spawnflags & BARREL_INDESTRUCTABLE)) {
|
||||
if ((iMeansOfDeath == MOD_VEHICLE || iMeansOfDeath == MOD_ROCKET || iMeansOfDeath == MOD_GRENADE
|
||||
|| iMeansOfDeath == MOD_EXPLODEWALL || iMeansOfDeath == MOD_EXPLOSION || m_iBarrelType == BARREL_GAS)
|
||||
&& iMeansOfDeath != MOD_BASH) {
|
||||
if (iDamage >= health) {
|
||||
PostEvent(EV_Killed, 0.01f);
|
||||
takedamage = DAMAGE_NO;
|
||||
return;
|
||||
}
|
||||
if (!(spawnflags & BARREL_INDESTRUCTABLE)
|
||||
&& ((iMeansOfDeath == MOD_GRENADE || iMeansOfDeath == MOD_EXPLOSION || iMeansOfDeath == MOD_EXPLODEWALL
|
||||
|| iMeansOfDeath == MOD_ROCKET
|
||||
|| iMeansOfDeath == MOD_VEHICLE
|
||||
// Added in 2.30
|
||||
// Landmine
|
||||
|| iMeansOfDeath == MOD_LANDMINE)
|
||||
|| (m_iBarrelType == BARREL_GAS && iMeansOfDeath != MOD_BASH))) {
|
||||
if (iDamage > health) {
|
||||
PostEvent(EV_Killed, 0.01f);
|
||||
takedamage = DAMAGE_NO;
|
||||
return;
|
||||
}
|
||||
|
||||
if (m_iBarrelType == BARREL_GAS) {
|
||||
iDamage /= 2;
|
||||
|
||||
health -= iDamage;
|
||||
if (health < 1.0f) {
|
||||
health = 1.0f;
|
||||
}
|
||||
if (m_iBarrelType == BARREL_GAS) {
|
||||
health -= iDamage / 2;
|
||||
if (health < 1.0f) {
|
||||
health = 1.0f;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -404,7 +405,12 @@ void BarrelObject::BarrelDamaged(Event *ev)
|
||||
ProcessEvent(EV_Barrel_Think);
|
||||
}
|
||||
|
||||
if (m_iBarrelType <= BARREL_WATER) {
|
||||
|
||||
//
|
||||
// Fixed in 2.30
|
||||
// Prevent bashes causing barrel leaks
|
||||
//
|
||||
if ((m_iBarrelType == BARREL_OIL || m_iBarrelType == BARREL_WATER) && iMeansOfDeath != MOD_BASH) {
|
||||
int index = PickBarrelLeak();
|
||||
|
||||
if (vHitPos[2] <= m_fFluidAmount / m_fHeightFluid + origin[2] + mins[2]) {
|
||||
|
||||
@@ -1398,7 +1398,7 @@ void PmoveSingle(pmove_t *pmove)
|
||||
}
|
||||
}
|
||||
|
||||
if (pm->ps->pm_flags & PMF_NO_LEAN) {
|
||||
if (pm->ps->pm_flags & PMF_NO_HUD) {
|
||||
pm->ps->fLeanAngle = 0;
|
||||
}
|
||||
|
||||
|
||||
@@ -256,10 +256,9 @@ movement on the server game.
|
||||
#define PMF_VIEW_DUCK_RUN (1 << 9)
|
||||
#define PMF_VIEW_JUMP_START (1 << 10)
|
||||
#define PMF_LEVELEXIT (1 << 11)
|
||||
#define PMF_NO_GRAVITY (1 << 12)
|
||||
#define PMF_NO_HUD (1 << 13)
|
||||
#define PMF_TURRET (1 << 14)
|
||||
#define PMF_NO_LEAN (1 << 15)
|
||||
#define PMF_TURRET (1 << 12)
|
||||
#define PMF_NO_WEAPONBAR (1 << 14)
|
||||
#define PMF_NO_HUD (1 << 15)
|
||||
|
||||
// moveposflags
|
||||
enum moveposflags_e {
|
||||
@@ -770,8 +769,8 @@ movement on the server game.
|
||||
CGM_HUDDRAW_ALPHA,
|
||||
CGM_HUDDRAW_STRING,
|
||||
CGM_HUDDRAW_FONT,
|
||||
CGM_NOTIFY_KILL,
|
||||
CGM_NOTIFY_HIT,
|
||||
CGM_NOTIFY_KILL,
|
||||
CGM_VOICE_CHAT,
|
||||
CGM_FENCEPOST,
|
||||
};
|
||||
@@ -812,8 +811,8 @@ movement on the server game.
|
||||
CGM6_HUDDRAW_ALPHA,
|
||||
CGM6_HUDDRAW_STRING,
|
||||
CGM6_HUDDRAW_FONT,
|
||||
CGM6_NOTIFY_KILL,
|
||||
CGM6_NOTIFY_HIT,
|
||||
CGM6_NOTIFY_KILL,
|
||||
CGM6_VOICE_CHAT,
|
||||
};
|
||||
|
||||
|
||||
@@ -77,7 +77,7 @@ Conditional::Conditional()
|
||||
|
||||
Expression::Expression() {}
|
||||
|
||||
Expression::Expression(Expression& exp)
|
||||
Expression::Expression(const Expression& exp)
|
||||
|
||||
{
|
||||
int i;
|
||||
|
||||
@@ -184,7 +184,7 @@ private:
|
||||
|
||||
public:
|
||||
Expression();
|
||||
Expression(Expression& exp);
|
||||
Expression(const Expression& exp);
|
||||
Expression(Script& script, State& state);
|
||||
|
||||
void operator=(const Expression& exp);
|
||||
|
||||
+135
-108
@@ -42,8 +42,8 @@ typedef struct spawnsort_s {
|
||||
|
||||
static qboolean SpotWouldTelefrag(float *origin)
|
||||
{
|
||||
static Vector mins = Vector(-16, -16, 1);
|
||||
static Vector maxs = Vector(16, 16, 97);
|
||||
static Vector mins = Vector(-15, -15, 1);
|
||||
static Vector maxs = Vector(15, 15, 96);
|
||||
trace_t trace;
|
||||
|
||||
trace = G_Trace(Vector(origin), mins, maxs, Vector(origin), NULL, MASK_PLAYERSTART, qfalse, "SpotWouldTelefrag");
|
||||
@@ -58,15 +58,12 @@ static qboolean SpotWouldTelefrag(float *origin)
|
||||
static int compare_spawnsort(const void *pe1, const void *pe2)
|
||||
{
|
||||
float fDelta = ((spawnsort_t *)pe1)->fMetric - ((spawnsort_t *)pe2)->fMetric;
|
||||
|
||||
if (fDelta >= -0.001f) {
|
||||
if (fDelta <= 0.001f) {
|
||||
return 0;
|
||||
} else {
|
||||
return -1;
|
||||
}
|
||||
} else {
|
||||
if (fDelta < -0.001) {
|
||||
return 1;
|
||||
} else if (fDelta > 0.001) {
|
||||
return -1;
|
||||
} else {
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -83,56 +80,56 @@ static PlayerStart *GetRandomSpawnpointFromList(spawnsort_t *pSpots, int nSpots)
|
||||
|
||||
qsort(pSpots, nSpots, sizeof(spawnsort_t), compare_spawnsort);
|
||||
|
||||
if (pSpots[0].fMetric > 0.0f) {
|
||||
if (nSpots > 5) {
|
||||
nSpots = 5;
|
||||
}
|
||||
|
||||
fMinPosMetric = pSpots[0].fMetric * nSpots;
|
||||
fTotalMetric = fMinPosMetric;
|
||||
|
||||
if (nSpots <= 1) {
|
||||
fChosen = fMinPosMetric;
|
||||
} else {
|
||||
i = 0;
|
||||
fTotalMetric = 0.0f;
|
||||
|
||||
for (i = 0; i < nSpots; i++) {
|
||||
if (pSpots[i].fMetric <= 0.0f) {
|
||||
break;
|
||||
}
|
||||
|
||||
fChosen = pSpots[i].fMetric * (nSpots - i);
|
||||
fTotalMetric += fChosen;
|
||||
|
||||
i++;
|
||||
}
|
||||
|
||||
if (i < nSpots) {
|
||||
fChosen = fMinPosMetric;
|
||||
}
|
||||
|
||||
fMinPosMetric = fTotalMetric;
|
||||
}
|
||||
|
||||
fTotalMetric = (fMinPosMetric - i * fChosen * 0.90f) * G_Random();
|
||||
for (i = 0; i < nSpots - 1; i++) {
|
||||
fTotalMetric -= (nSpots - i) * pSpots[i].fMetric - (fChosen * 0.90f);
|
||||
if (fTotalMetric <= 0.0f) {
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
return pSpots[i].spawnpoint;
|
||||
} else {
|
||||
if (pSpots[0].fMetric <= 0) {
|
||||
// return the spot anyway
|
||||
return pSpots[0].spawnpoint;
|
||||
}
|
||||
|
||||
if (nSpots > 5) {
|
||||
nSpots = 5;
|
||||
}
|
||||
|
||||
fMinPosMetric = pSpots[0].fMetric * nSpots;
|
||||
fTotalMetric = fMinPosMetric;
|
||||
|
||||
if (nSpots > 1) {
|
||||
i = 0;
|
||||
fTotalMetric = 0.0f;
|
||||
|
||||
for (i = 0; i < nSpots; i++) {
|
||||
if (pSpots[i].fMetric <= 0.0f) {
|
||||
break;
|
||||
}
|
||||
|
||||
fChosen = pSpots[i].fMetric * (nSpots - i);
|
||||
fTotalMetric += fChosen;
|
||||
|
||||
i++;
|
||||
}
|
||||
|
||||
if (i < nSpots) {
|
||||
fChosen = fMinPosMetric;
|
||||
}
|
||||
|
||||
fMinPosMetric = fTotalMetric;
|
||||
} else {
|
||||
fChosen = fMinPosMetric;
|
||||
}
|
||||
|
||||
fTotalMetric = (fMinPosMetric - i * fChosen * 0.9) * random();
|
||||
for (i = 0; i < nSpots - 1; i++) {
|
||||
fTotalMetric -= (nSpots - i) * pSpots[i].fMetric - (fChosen * 0.9);
|
||||
if (fTotalMetric <= 0) {
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
return pSpots[i].spawnpoint;
|
||||
}
|
||||
|
||||
float SpawnpointMetric_Ffa(const vec3_t origin, DM_Team *dmTeam, const Player *player)
|
||||
{
|
||||
float fMinEnemyDistSquared = Square(23170);
|
||||
float fMinEnemyDistSquared = Square(23170.f);
|
||||
int i;
|
||||
int nPlayers = dmManager.PlayerCount();
|
||||
float fDist;
|
||||
@@ -150,12 +147,12 @@ float SpawnpointMetric_Ffa(const vec3_t origin, DM_Team *dmTeam, const Player *p
|
||||
}
|
||||
}
|
||||
|
||||
return fMinEnemyDistSquared - (G_Random(0.25f) + 1.0f) * Square(1024);
|
||||
return fMinEnemyDistSquared - (random() * 0.25 + 1.0) * Square(1024);
|
||||
}
|
||||
|
||||
float SpawnpointMetric_Team(const vec3_t origin, DM_Team *dmTeam, const Player *player)
|
||||
{
|
||||
float fMinEnemyDistSquared = Square(23170);
|
||||
float fMinEnemyDistSquared = Square(23170.f);
|
||||
float fSumFriendDistSquared = 0.0f;
|
||||
float fDistSquared;
|
||||
float fMetric;
|
||||
@@ -179,10 +176,10 @@ float SpawnpointMetric_Team(const vec3_t origin, DM_Team *dmTeam, const Player *
|
||||
}
|
||||
}
|
||||
|
||||
fMetric = fMinEnemyDistSquared - (G_Random(0.25f) + 1.0f) * Square(1024);
|
||||
fMetric = fMinEnemyDistSquared - (random() * 0.25 + 1.0) * Square(1024);
|
||||
|
||||
if (nFriends) {
|
||||
fMetric += 0.25f * ((23170.0f * 23170.0f) - fSumFriendDistSquared / nFriends);
|
||||
fMetric += (Square(23170) - fSumFriendDistSquared / nFriends) * 0.25;
|
||||
}
|
||||
|
||||
return fMetric;
|
||||
@@ -369,9 +366,9 @@ PlayerStart *DM_Team::FarthestSpawnPoint(void)
|
||||
}
|
||||
}
|
||||
|
||||
if (pSpot3 && G_Random() < 0.2f) {
|
||||
if (pSpot3 && random() < 0.2f) {
|
||||
return pSpot3;
|
||||
} else if (pSpot2 && G_Random() < 0.3f) {
|
||||
} else if (pSpot2 && random() < 0.3f) {
|
||||
return pSpot2;
|
||||
} else {
|
||||
return pBestSpot;
|
||||
@@ -400,7 +397,12 @@ PlayerStart *DM_Team::GetRandomSpawnpointWithMetric(
|
||||
Player *player, float (*MetricFunction)(const float *origin, DM_Team *dmTeam, const Player *player)
|
||||
)
|
||||
{
|
||||
static float offset[4][3];
|
||||
static const vec3_t offset[4] = {
|
||||
{-48.0, -48.0, 32.0},
|
||||
{48.0, -48.0, 32.0},
|
||||
{-48.0, 48.0, 32.0},
|
||||
{48.0, 48.0, 32.0},
|
||||
};
|
||||
spawnsort_t points[1024];
|
||||
PlayerStart *spot = NULL;
|
||||
int numSpots = 0;
|
||||
@@ -428,6 +430,11 @@ PlayerStart *DM_Team::GetRandomSpawnpointWithMetric(
|
||||
return spot;
|
||||
}
|
||||
|
||||
//
|
||||
// No spawnpoints are available.
|
||||
// Search for free locations next to spawnpoints
|
||||
//
|
||||
|
||||
numSpots = 0;
|
||||
|
||||
for (int i = 1; i <= m_spawnpoints.NumObjects(); i++) {
|
||||
@@ -436,35 +443,36 @@ PlayerStart *DM_Team::GetRandomSpawnpointWithMetric(
|
||||
continue;
|
||||
}
|
||||
|
||||
for (int j = 0; j < sizeof(offset) / sizeof(offset[0]); j++) {
|
||||
Vector vNewSpawn = spot->origin + offset[j];
|
||||
for (int j = 0; j < ARRAY_LEN(offset); j++) {
|
||||
const Vector vNewSpawn = spot->origin + offset[j];
|
||||
|
||||
if (G_SightTrace(
|
||||
spot->origin,
|
||||
spot->origin + Vector(0, 0, 16),
|
||||
player->mins,
|
||||
player->maxs,
|
||||
vNewSpawn,
|
||||
(Entity *)NULL,
|
||||
(Entity *)NULL,
|
||||
MASK_PLAYERSOLID,
|
||||
MASK_PLAYERSOLID & ~CONTENTS_BODY,
|
||||
qfalse,
|
||||
"DM_Team::GetRandomSpawnpointWithMetric"
|
||||
)
|
||||
== 1) {
|
||||
Vector vEnd = vNewSpawn - Vector(0, 0, 64);
|
||||
)) {
|
||||
const Vector vEnd = vNewSpawn - Vector(0, 0, 64);
|
||||
|
||||
trace_t trace = G_Trace(
|
||||
const trace_t trace = G_Trace(
|
||||
vNewSpawn, player->mins, player->maxs, vEnd, player, MASK_PLAYERSOLID, qfalse, "TempSpawnPoint"
|
||||
);
|
||||
|
||||
if (!trace.allsolid && !trace.startsolid && trace.fraction != 1.0f && trace.plane.dist >= 0.8f) {
|
||||
if (!trace.allsolid && !trace.startsolid && trace.fraction != 0 && trace.fraction != 1
|
||||
&& trace.plane.normal[2] >= 0.8f) {
|
||||
points[numSpots].spawnpoint = new PlayerStart;
|
||||
points[numSpots].spawnpoint->setOrigin(trace.endpos);
|
||||
points[numSpots].spawnpoint->setAngles(spot->angles);
|
||||
points[numSpots].fMetric = MetricFunction(vNewSpawn, this, player);
|
||||
points[numSpots].spawnpoint->m_bDeleteOnSpawn = true;
|
||||
points[numSpots].fMetric = MetricFunction(vNewSpawn, this, player);
|
||||
numSpots++;
|
||||
|
||||
if (numSpots >= (sizeof(points) / sizeof(points[0]))) {
|
||||
if (numSpots >= ARRAY_LEN(points)) {
|
||||
break;
|
||||
}
|
||||
}
|
||||
@@ -475,8 +483,8 @@ PlayerStart *DM_Team::GetRandomSpawnpointWithMetric(
|
||||
spot = GetRandomSpawnpointFromList(points, numSpots);
|
||||
for (int i = 0; i < numSpots; i++) {
|
||||
// delete all created spawnpoint
|
||||
if (points[numSpots].spawnpoint != spot) {
|
||||
delete points[numSpots].spawnpoint;
|
||||
if (points[i].spawnpoint != spot) {
|
||||
delete points[i].spawnpoint;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -488,7 +496,7 @@ PlayerStart *DM_Team::GetRandomSpawnpointWithMetric(
|
||||
|
||||
for (int i = 1; i <= m_spawnpoints.NumObjects(); i++) {
|
||||
spot = m_spawnpoints.ObjectAt(i);
|
||||
if (!spot->m_bForbidSpawns && player->GetLastSpawnpoint() != spot) {
|
||||
if (!spot->m_bForbidSpawns || player->GetLastSpawnpoint() != spot) {
|
||||
continue;
|
||||
}
|
||||
|
||||
@@ -831,25 +839,44 @@ int DM_Manager::compareScores(const void *elem1, const void *elem2)
|
||||
Player *p1 = (Player *)G_GetEntity(*(int *)elem1);
|
||||
Player *p2 = (Player *)G_GetEntity(*(int *)elem2);
|
||||
|
||||
if (p1->GetNumKills() < p2->GetNumKills()) {
|
||||
return 1;
|
||||
} else if (p1->GetNumKills() == p2->GetNumKills()) {
|
||||
// sort by death if they have the same number of kills
|
||||
if (p1->GetNumDeaths() < p2->GetNumDeaths()) {
|
||||
return 1;
|
||||
} else if (p1->GetNumDeaths() == p2->GetNumDeaths()) {
|
||||
// sort by netname if they have the same number of deaths
|
||||
return Q_stricmp(p1->client->pers.netname, p2->client->pers.netname);
|
||||
} else if (p1->GetNumDeaths() > p2->GetNumDeaths()) {
|
||||
switch (g_gametype->integer) {
|
||||
case GT_TEAM_ROUNDS:
|
||||
case GT_OBJECTIVE:
|
||||
case GT_TOW:
|
||||
case GT_LIBERATION:
|
||||
// Sort using the total kills in round-based matches
|
||||
if (p1->GetNumDeaths() > p2->GetNumDeaths()) {
|
||||
return -1;
|
||||
} else if (p1->GetNumDeaths() < p2->GetNumDeaths()) {
|
||||
return 1;
|
||||
}
|
||||
} else if (p1->GetNumKills() > p2->GetNumKills()) {
|
||||
return -1;
|
||||
|
||||
// Sort using the number of kills in the current round
|
||||
if (p1->GetNumKills() > p2->GetNumKills()) {
|
||||
return -1;
|
||||
} else if (p1->GetNumKills() < p2->GetNumKills()) {
|
||||
return 1;
|
||||
}
|
||||
break;
|
||||
default:
|
||||
if (p1->GetNumKills() > p2->GetNumKills()) {
|
||||
return -1;
|
||||
} else if (p1->GetNumKills() < p2->GetNumKills()) {
|
||||
return 1;
|
||||
}
|
||||
|
||||
// sort by death if they have the same number of kills
|
||||
if (p1->GetNumDeaths() > p2->GetNumDeaths()) {
|
||||
return -1;
|
||||
} else if (p1->GetNumDeaths() < p2->GetNumDeaths()) {
|
||||
return 1;
|
||||
}
|
||||
|
||||
break;
|
||||
}
|
||||
|
||||
// just to avoid the compiler warning
|
||||
// shouldn't go there
|
||||
return 0;
|
||||
// sort by netname if they have the same number of deaths
|
||||
return Q_stricmp(p1->client->pers.netname, p2->client->pers.netname);
|
||||
}
|
||||
|
||||
void DM_Manager::Score(Player *player)
|
||||
@@ -923,7 +950,7 @@ void DM_Manager::Score(Player *player)
|
||||
continue;
|
||||
}
|
||||
|
||||
iPlayerList[j] = currentPlayer->client->ps.clientNum;
|
||||
iPlayerList[j] = currentPlayer->edict - g_entities;
|
||||
|
||||
j++;
|
||||
}
|
||||
@@ -1412,26 +1439,26 @@ void DM_Manager::EventDoRoundTransition(Event *ev)
|
||||
}
|
||||
|
||||
if (m_iTeamWin == TEAM_AXIS) {
|
||||
G_CenterPrintToAllClients(va("\n\n\n%s\n", gi.LV_ConvertString("Axis win!\n")));
|
||||
G_PrintToAllClients(va("%s\n", gi.LV_ConvertString("Axis win!\n")));
|
||||
G_CenterPrintToAllClients(va("\n\n\n%s\n", gi.LV_ConvertString("Axis win!")));
|
||||
G_PrintToAllClients(va("%s\n", gi.LV_ConvertString("Axis win!")));
|
||||
|
||||
// Play the axis victory sound
|
||||
world->Sound("den_victory_v");
|
||||
|
||||
Unregister(STRING_AXISWIN);
|
||||
level.Unregister(STRING_AXISWIN);
|
||||
} else if (m_iTeamWin == TEAM_ALLIES) {
|
||||
G_CenterPrintToAllClients(va("\n\n\n%s\n", gi.LV_ConvertString("Allies win!\n")));
|
||||
G_PrintToAllClients(va("%s\n", gi.LV_ConvertString("Allies win!\n")));
|
||||
G_CenterPrintToAllClients(va("\n\n\n%s\n", gi.LV_ConvertString("Allies win!")));
|
||||
G_PrintToAllClients(va("%s\n", gi.LV_ConvertString("Allies win!")));
|
||||
|
||||
// Play the allies victory sound
|
||||
world->Sound("dfr_victory_v");
|
||||
|
||||
Unregister(STRING_ALLIESWIN);
|
||||
level.Unregister(STRING_ALLIESWIN);
|
||||
} else {
|
||||
G_CenterPrintToAllClients(va("\n\n\n%s\n", gi.LV_ConvertString("It's a draw!\n")));
|
||||
G_PrintToAllClients(va("%s\n", gi.LV_ConvertString("It's a draw!\n")));
|
||||
G_CenterPrintToAllClients(va("\n\n\n%s\n", gi.LV_ConvertString("It's a draw!")));
|
||||
G_PrintToAllClients(va("%s\n", gi.LV_ConvertString("It's a draw!")));
|
||||
|
||||
Unregister(STRING_DRAW);
|
||||
level.Unregister(STRING_DRAW);
|
||||
}
|
||||
|
||||
G_DisplayScoresToAllClients();
|
||||
@@ -1492,7 +1519,7 @@ teamtype_t DM_Manager::GetAutoJoinTeam(void)
|
||||
if (allies < axis) {
|
||||
return TEAM_ALLIES;
|
||||
} else if (allies == axis) {
|
||||
return (G_Random() >= 0.5f) ? TEAM_ALLIES : TEAM_AXIS;
|
||||
return (random() >= 0.5f) ? TEAM_ALLIES : TEAM_AXIS;
|
||||
} else {
|
||||
return TEAM_AXIS;
|
||||
}
|
||||
@@ -1846,7 +1873,7 @@ void DM_Manager::BuildTeamInfo_ver6(DM_Team *dmTeam)
|
||||
for (int i = iNumPlayers; i > 0; i--) {
|
||||
pTeamPlayer = dmTeam->m_players.ObjectAt(i);
|
||||
|
||||
if (pTeamPlayer->IsSubclassOfBot()) {
|
||||
if (pTeamPlayer->edict->r.svFlags & SVF_BOT) {
|
||||
continue;
|
||||
}
|
||||
|
||||
@@ -1891,7 +1918,7 @@ void DM_Manager::BuildTeamInfo_ver15(DM_Team *dmTeam)
|
||||
for (int i = iNumPlayers; i > 0; i--) {
|
||||
pTeamPlayer = dmTeam->m_players.ObjectAt(i);
|
||||
|
||||
if (pTeamPlayer->IsSubclassOfBot()) {
|
||||
if (pTeamPlayer->edict->r.svFlags & SVF_BOT) {
|
||||
continue;
|
||||
}
|
||||
|
||||
@@ -1903,11 +1930,11 @@ void DM_Manager::BuildTeamInfo_ver15(DM_Team *dmTeam)
|
||||
iPing /= iNumPlayers;
|
||||
}
|
||||
|
||||
if (g_gametype->integer >= GT_TEAM_ROUNDS) {
|
||||
iKills = dmTeam->m_wins_in_a_row;
|
||||
iDeaths = dmTeam->m_teamwins;
|
||||
if (g_gametype->integer == GT_TEAM_ROUNDS || g_gametype->integer == GT_OBJECTIVE || g_gametype->integer == GT_TOW) {
|
||||
iKills = dmTeam->m_teamwins;
|
||||
iDeaths = dmTeam->m_wins_in_a_row;
|
||||
} else {
|
||||
iKills = dmTeam->m_iKills;
|
||||
iKills = dmTeam->m_teamwins;
|
||||
iDeaths = dmTeam->m_iDeaths;
|
||||
}
|
||||
|
||||
@@ -1965,7 +1992,7 @@ void DM_Manager::BuildPlayerTeamInfo(DM_Team *dmTeam, int *iPlayerList, DM_Team
|
||||
pTeamPlayer->GetNumKills(),
|
||||
pTeamPlayer->GetNumDeaths(),
|
||||
G_TimeString(level.svsFloatTime - pTeamPlayer->edict->client->pers.enterTime),
|
||||
pTeamPlayer->IsSubclassOfBot() ? "bot" : va("%d", pTeamPlayer->client->ps.ping)
|
||||
(pTeamPlayer->edict->r.svFlags & SVF_BOT) ? "bot" : va("%d", pTeamPlayer->client->ps.ping)
|
||||
);
|
||||
} else {
|
||||
Com_sprintf(
|
||||
@@ -1976,7 +2003,7 @@ void DM_Manager::BuildPlayerTeamInfo(DM_Team *dmTeam, int *iPlayerList, DM_Team
|
||||
pTeamPlayer->GetNumKills(),
|
||||
pTeamPlayer->GetNumDeaths(),
|
||||
G_TimeString(level.svsFloatTime - pTeamPlayer->edict->client->pers.enterTime),
|
||||
pTeamPlayer->IsSubclassOfBot() ? "bot" : va("%d", pTeamPlayer->client->ps.ping)
|
||||
(pTeamPlayer->edict->r.svFlags & SVF_BOT) ? "bot" : va("%d", pTeamPlayer->client->ps.ping)
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
@@ -848,10 +848,11 @@ void Door::DoorBlocked(Event *ev)
|
||||
if (state == STATE_OPENING || state == STATE_OPEN) {
|
||||
spawnflags &= ~DOOR_START_OPEN;
|
||||
|
||||
const bool bWasOpening = (previous_state == STATE_CLOSING);
|
||||
const bool bIsMoving = EventPending(EV_MoveDone);
|
||||
ProcessEvent(EV_Door_Close);
|
||||
|
||||
if (bIsMoving) {
|
||||
if (bIsMoving && !bWasOpening) {
|
||||
// Added in OPM
|
||||
// Reopen to the other side so sentients can still pass.
|
||||
// This avoid entities like players trying to prevent the door
|
||||
|
||||
+1
-1
@@ -1,6 +1,6 @@
|
||||
/*
|
||||
===========================================================================
|
||||
Copyright (C) 2015 the OpenMoHAA team
|
||||
Copyright (C) 2025 the OpenMoHAA team
|
||||
|
||||
This file is part of OpenMoHAA source code.
|
||||
|
||||
|
||||
+186
-172
@@ -1217,6 +1217,8 @@ Event EV_CanSee
|
||||
"returns 1 if the entities can see eachother, 0 if not",
|
||||
EV_RETURN
|
||||
);
|
||||
|
||||
// Added in 2.0
|
||||
Event EV_CanSeeNoEnts
|
||||
(
|
||||
"canseenoents",
|
||||
@@ -1226,6 +1228,7 @@ Event EV_CanSeeNoEnts
|
||||
"returns 1 if the entities can see eachother, 0 if not; ignores any entities between them",
|
||||
EV_RETURN
|
||||
);
|
||||
|
||||
Event EV_Entity_InPVS
|
||||
(
|
||||
"inpvs",
|
||||
@@ -1628,6 +1631,7 @@ CLASS_DECLARATION(SimpleEntity, Entity, NULL) {
|
||||
{&EV_IsTouching, &Entity::IsTouching },
|
||||
{&EV_IsInside, &Entity::IsInside },
|
||||
{&EV_CanSee, &Entity::CanSee },
|
||||
{&EV_CanSeeNoEnts, &Entity::CanSeeNoEnts }, // Added in 2.0
|
||||
{&EV_Entity_InPVS, &Entity::EventInPVS },
|
||||
{&EV_SetShaderData, &Entity::SetShaderData },
|
||||
{&EV_GetVelocity, &Entity::GetVelocity },
|
||||
@@ -2188,9 +2192,7 @@ void Entity::setSolidType(solid_t type)
|
||||
setContentsSolid();
|
||||
}
|
||||
} else if (edict->solid == SOLID_NOT) {
|
||||
if (getContents()
|
||||
& (CONTENTS_CORPSE | CONTENTS_BODY | CONTENTS_UNKNOWN3 | CONTENTS_UNKNOWN2 | CONTENTS_NOBOTCLIP
|
||||
| CONTENTS_BBOX | CONTENTS_NOTTEAM2 | CONTENTS_NOTTEAM1 | CONTENTS_LADDER)) {
|
||||
if (getContents() & MASK_SCRIPT_SLAVE) {
|
||||
setContents(0);
|
||||
}
|
||||
} else if (edict->solid == SOLID_BSP) {
|
||||
@@ -2669,7 +2671,7 @@ void Entity::DamageEvent(Event *ev)
|
||||
Vector momentum;
|
||||
Vector position, direction, normal;
|
||||
int knockback, damageflags, meansofdeath, location;
|
||||
Event *event;
|
||||
Event event;
|
||||
float m;
|
||||
EntityPtr This;
|
||||
|
||||
@@ -2755,67 +2757,79 @@ void Entity::DamageEvent(Event *ev)
|
||||
|
||||
if (health <= 0) {
|
||||
if (attacker) {
|
||||
event = new Event(EV_GotKill);
|
||||
event->AddEntity(this);
|
||||
event->AddInteger(damage);
|
||||
event->AddEntity(inflictor);
|
||||
event->AddInteger(meansofdeath);
|
||||
event->AddInteger(0);
|
||||
const EntityPtr attackerPtr = attacker;
|
||||
|
||||
attacker->ProcessEvent(event);
|
||||
event = Event(EV_GotKill, 5);
|
||||
event.AddEntity(this);
|
||||
event.AddInteger(damage);
|
||||
event.AddEntity(inflictor);
|
||||
event.AddInteger(meansofdeath);
|
||||
event.AddInteger(0);
|
||||
|
||||
attackerPtr->ProcessEvent(event);
|
||||
if (attackerPtr) {
|
||||
attackerPtr->delegate_gotKill.Execute(event);
|
||||
}
|
||||
}
|
||||
|
||||
if (!This) {
|
||||
return;
|
||||
}
|
||||
|
||||
event = new Event(EV_Killed);
|
||||
event->AddEntity(attacker);
|
||||
event->AddFloat(damage);
|
||||
event->AddEntity(inflictor);
|
||||
event->AddVector(position);
|
||||
event->AddVector(direction);
|
||||
event->AddVector(normal);
|
||||
event->AddInteger(knockback);
|
||||
event->AddInteger(damageflags);
|
||||
event->AddInteger(meansofdeath);
|
||||
event->AddInteger(location);
|
||||
event = Event(EV_Killed, 10);
|
||||
event.AddEntity(attacker);
|
||||
event.AddFloat(damage);
|
||||
event.AddEntity(inflictor);
|
||||
event.AddVector(position);
|
||||
event.AddVector(direction);
|
||||
event.AddVector(normal);
|
||||
event.AddInteger(knockback);
|
||||
event.AddInteger(damageflags);
|
||||
event.AddInteger(meansofdeath);
|
||||
event.AddInteger(location);
|
||||
|
||||
ProcessEvent(event);
|
||||
|
||||
if (!This) {
|
||||
return;
|
||||
}
|
||||
|
||||
// Notify scripts
|
||||
Unregister(STRING_DAMAGE);
|
||||
if (!This) {
|
||||
return;
|
||||
}
|
||||
|
||||
delegate_killed.Execute(event);
|
||||
return;
|
||||
}
|
||||
|
||||
event = new Event(EV_Pain);
|
||||
event->AddEntity(attacker);
|
||||
event->AddFloat(damage);
|
||||
event->AddEntity(inflictor);
|
||||
event->AddVector(position);
|
||||
event->AddVector(direction);
|
||||
event->AddVector(normal);
|
||||
event->AddInteger(knockback);
|
||||
event->AddInteger(damageflags);
|
||||
event->AddInteger(meansofdeath);
|
||||
event->AddInteger(location);
|
||||
event = Event(EV_Pain, 10);
|
||||
event.AddEntity(attacker);
|
||||
event.AddFloat(damage);
|
||||
event.AddEntity(inflictor);
|
||||
event.AddVector(position);
|
||||
event.AddVector(direction);
|
||||
event.AddVector(normal);
|
||||
event.AddInteger(knockback);
|
||||
event.AddInteger(damageflags);
|
||||
event.AddInteger(meansofdeath);
|
||||
event.AddInteger(location);
|
||||
|
||||
ProcessEvent(event);
|
||||
|
||||
if (!This) {
|
||||
return;
|
||||
}
|
||||
|
||||
// Notify scripts
|
||||
Unregister(STRING_DAMAGE);
|
||||
if (!This) {
|
||||
return;
|
||||
}
|
||||
|
||||
delegate_damage.Execute(event);
|
||||
}
|
||||
|
||||
qboolean Entity::IsTouching(Entity *e1)
|
||||
|
||||
{
|
||||
if (e1->absmin.x > absmax.x) {
|
||||
return false;
|
||||
@@ -3609,106 +3623,104 @@ void Entity::Sound(
|
||||
}
|
||||
|
||||
if (!name) {
|
||||
name = sound_name.c_str();
|
||||
name = gi.GlobalAlias_FindRandom(sound_name.c_str(), &ret);
|
||||
}
|
||||
|
||||
// Play the sound
|
||||
|
||||
if (name != NULL) {
|
||||
if (ret) {
|
||||
aliaschannel = ret->channel;
|
||||
aliasvolume = G_Random() * ret->volumeMod + ret->volume;
|
||||
aliaspitch = G_Random() * ret->pitchMod + ret->pitch;
|
||||
aliasmin_dist = ret->dist;
|
||||
aliasmax_dist = ret->maxDist;
|
||||
if (name && ret) {
|
||||
aliaschannel = ret->channel;
|
||||
aliasvolume = G_Random() * ret->volumeMod + ret->volume;
|
||||
aliaspitch = G_Random() * ret->pitchMod + ret->pitch;
|
||||
aliasmin_dist = ret->dist;
|
||||
aliasmax_dist = ret->maxDist;
|
||||
|
||||
if (channel < 0) {
|
||||
channel = ret->channel;
|
||||
}
|
||||
|
||||
num = entnum;
|
||||
if (sound_origin) {
|
||||
VectorCopy(*sound_origin, org);
|
||||
num = ENTITYNUM_NONE;
|
||||
} else {
|
||||
VectorCopy(edict->s.origin, org);
|
||||
|
||||
if (doCallback) {
|
||||
num |= S_FLAG_DO_CALLBACK;
|
||||
}
|
||||
}
|
||||
|
||||
switch (argstype) {
|
||||
case 0:
|
||||
volume = aliasvolume;
|
||||
pitch = aliaspitch;
|
||||
min_dist = aliasmin_dist;
|
||||
max_dist = aliasmax_dist;
|
||||
channel = aliaschannel;
|
||||
break;
|
||||
case 1:
|
||||
if (volume >= 0.0f) {
|
||||
volume = volume * aliasvolume;
|
||||
} else {
|
||||
volume = aliasvolume;
|
||||
}
|
||||
|
||||
if (pitch >= 0.0f) {
|
||||
pitch = pitch * aliaspitch;
|
||||
} else {
|
||||
pitch = aliaspitch;
|
||||
}
|
||||
|
||||
if (min_dist < 0.0f) {
|
||||
min_dist = aliasmin_dist;
|
||||
}
|
||||
|
||||
if (max_dist < 0.0f) {
|
||||
max_dist = aliasmax_dist;
|
||||
}
|
||||
|
||||
if (channel < 0) {
|
||||
channel = ret->channel;
|
||||
}
|
||||
|
||||
num = entnum;
|
||||
if (sound_origin) {
|
||||
VectorCopy(*sound_origin, org);
|
||||
num = ENTITYNUM_NONE;
|
||||
} else {
|
||||
VectorCopy(edict->s.origin, org);
|
||||
|
||||
if (doCallback) {
|
||||
num |= S_FLAG_DO_CALLBACK;
|
||||
}
|
||||
}
|
||||
|
||||
switch (argstype) {
|
||||
case 0:
|
||||
volume = aliasvolume;
|
||||
pitch = aliaspitch;
|
||||
min_dist = aliasmin_dist;
|
||||
max_dist = aliasmax_dist;
|
||||
channel = aliaschannel;
|
||||
break;
|
||||
case 1:
|
||||
if (volume >= 0.0f) {
|
||||
volume = volume * aliasvolume;
|
||||
} else {
|
||||
volume = aliasvolume;
|
||||
}
|
||||
|
||||
if (pitch >= 0.0f) {
|
||||
pitch = pitch * aliaspitch;
|
||||
} else {
|
||||
pitch = aliaspitch;
|
||||
}
|
||||
|
||||
if (min_dist < 0.0f) {
|
||||
min_dist = aliasmin_dist;
|
||||
}
|
||||
|
||||
if (max_dist < 0.0f) {
|
||||
max_dist = aliasmax_dist;
|
||||
}
|
||||
|
||||
if (channel < 0) {
|
||||
channel = aliaschannel;
|
||||
}
|
||||
break;
|
||||
default:
|
||||
if (volume < 0.0) {
|
||||
volume = aliasvolume;
|
||||
}
|
||||
if (pitch < 0.0) {
|
||||
pitch = aliaspitch;
|
||||
}
|
||||
if (min_dist < 0.0) {
|
||||
min_dist = aliasmin_dist;
|
||||
}
|
||||
if (max_dist < 0.0) {
|
||||
max_dist = aliasmax_dist;
|
||||
}
|
||||
if (channel < 0) {
|
||||
channel = aliaschannel;
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
if ((!checkSubtitle || g_subtitle->integer) && ret->subtitle) {
|
||||
Entity *p = G_GetEntity(0);
|
||||
|
||||
if (g_subtitle->integer == 2 || Square(max_dist) > DistanceSquared(org, p->edict->s.origin)) {
|
||||
cvar_t *curSubtitle = gi.Cvar_Get("curSubtitle", "0", 0);
|
||||
int curSub;
|
||||
|
||||
gi.cvar_set(va("subtitle%d", curSubtitle->integer), va("%s", ret->subtitle));
|
||||
curSub = curSubtitle->integer + 1;
|
||||
if (curSubtitle->integer + 1 < 0) {
|
||||
curSub = curSubtitle->integer + MAX_SUBTITLES;
|
||||
}
|
||||
|
||||
gi.cvar_set("curSubtitle", va("%d", (curSubtitle->integer + 1) - MAX_SUBTITLES * (curSub >> 2)));
|
||||
}
|
||||
break;
|
||||
default:
|
||||
if (volume < 0.0) {
|
||||
volume = aliasvolume;
|
||||
}
|
||||
|
||||
gi.Sound(&org, num, channel, name, volume, min_dist, pitch, max_dist, ret->streamed);
|
||||
if (pitch < 0.0) {
|
||||
pitch = aliaspitch;
|
||||
}
|
||||
if (min_dist < 0.0) {
|
||||
min_dist = aliasmin_dist;
|
||||
}
|
||||
if (max_dist < 0.0) {
|
||||
max_dist = aliasmax_dist;
|
||||
}
|
||||
if (channel < 0) {
|
||||
channel = aliaschannel;
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
if (g_gametype->integer == GT_SINGLE_PLAYER && (ret->forcesubtitle || !checkSubtitle || g_subtitle->integer) && ret->subtitle) {
|
||||
Entity *p = G_GetEntity(0);
|
||||
|
||||
if (p && (g_subtitle->integer == 2 || Square(max_dist) > DistanceSquared(org, p->edict->s.origin))) {
|
||||
cvar_t *curSubtitle = gi.Cvar_Get("curSubtitle", "0", 0);
|
||||
int curSub;
|
||||
|
||||
gi.cvar_set(va("subtitle%d", curSubtitle->integer), va("%s", ret->subtitle));
|
||||
curSub = curSubtitle->integer + 1;
|
||||
if (curSubtitle->integer + 1 < 0) {
|
||||
curSub = curSubtitle->integer + MAX_SUBTITLES;
|
||||
}
|
||||
|
||||
gi.cvar_set("curSubtitle", va("%d", (curSubtitle->integer + 1) - MAX_SUBTITLES * (curSub >> 2)));
|
||||
}
|
||||
}
|
||||
|
||||
gi.Sound(&org, num, channel, name, volume, min_dist, pitch, max_dist, ret->streamed);
|
||||
} else {
|
||||
gi.DPrintf(
|
||||
"ERROR: Entity::Sound: %s needs an alias in ubersound.scr or uberdialog.scr - Please fix.\n",
|
||||
@@ -5512,74 +5524,76 @@ void Entity::ForceActivate(Event *ev)
|
||||
|
||||
void Entity::EventTrace(Event *ev)
|
||||
{
|
||||
Vector start, end, mins, maxs;
|
||||
int mask = MASK_SOLID;
|
||||
Entity *ent;
|
||||
Vector start;
|
||||
Vector mins;
|
||||
Vector maxs;
|
||||
Vector end;
|
||||
int content_mask = MASK_SOLID;
|
||||
trace_t trace;
|
||||
|
||||
//
|
||||
// NOTE: mins/maxs are never passed to the trace function in the original game.
|
||||
// Using them now may break some scripts.
|
||||
//
|
||||
mins = vec_zero;
|
||||
maxs = vec_zero;
|
||||
ent = NULL;
|
||||
|
||||
start = ev->GetVector(1);
|
||||
end = ev->GetVector(2);
|
||||
|
||||
if (ev->NumArgs() > 2) {
|
||||
if (ev->GetInteger(3)) {
|
||||
mask = 1;
|
||||
}
|
||||
}
|
||||
|
||||
if (ev->NumArgs() > 3) {
|
||||
mins = ev->GetVector(4);
|
||||
}
|
||||
|
||||
if (ev->NumArgs() > 4) {
|
||||
switch (ev->NumArgs()) {
|
||||
case 5:
|
||||
maxs = ev->GetVector(5);
|
||||
}
|
||||
|
||||
if (ev->NumArgs() > 5) {
|
||||
ent = G_GetEntity(ev->GetInteger(6));
|
||||
case 4:
|
||||
mins = ev->GetVector(4);
|
||||
case 3:
|
||||
if (ev->GetInteger(3)) {
|
||||
content_mask &= ~MASK_IGNORE_ENTS;
|
||||
}
|
||||
case 2:
|
||||
case 1:
|
||||
start = ev->GetVector(1);
|
||||
end = ev->GetVector(2);
|
||||
break;
|
||||
default:
|
||||
throw ScriptException("Wrong number of arguments for trace.");
|
||||
}
|
||||
|
||||
// call trace
|
||||
trace = G_Trace(start, mins, maxs, end, ent, mask, qfalse, "Entity::EventTrace");
|
||||
trace = G_Trace(start, vec_zero, vec_zero, end, this, content_mask, false, "Entity::EventTrace");
|
||||
|
||||
ev->AddVector(trace.endpos);
|
||||
}
|
||||
|
||||
void Entity::EventSightTrace(Event *ev)
|
||||
{
|
||||
Vector start, end, mins, maxs;
|
||||
int mask = MASK_SOLID;
|
||||
Entity *ent = nullptr;
|
||||
qboolean hit = qfalse;
|
||||
Vector start;
|
||||
Vector mins;
|
||||
Vector maxs;
|
||||
Vector end;
|
||||
int content_mask = MASK_SOLID;
|
||||
qboolean hit = qfalse;
|
||||
|
||||
mins = vec_zero;
|
||||
maxs = vec_zero;
|
||||
|
||||
start = ev->GetVector(1);
|
||||
end = ev->GetVector(2);
|
||||
|
||||
if (ev->NumArgs() > 2) {
|
||||
if (ev->GetInteger(3)) {
|
||||
mask = 1;
|
||||
}
|
||||
}
|
||||
|
||||
if (ev->NumArgs() > 3) {
|
||||
mins = ev->GetVector(4);
|
||||
}
|
||||
|
||||
if (ev->NumArgs() > 4) {
|
||||
switch (ev->NumArgs()) {
|
||||
case 5:
|
||||
maxs = ev->GetVector(5);
|
||||
case 4:
|
||||
mins = ev->GetVector(4);
|
||||
case 3:
|
||||
if (ev->GetInteger(3)) {
|
||||
content_mask &= ~MASK_IGNORE_ENTS;
|
||||
}
|
||||
case 2:
|
||||
case 1:
|
||||
start = ev->GetVector(1);
|
||||
end = ev->GetVector(2);
|
||||
break;
|
||||
default:
|
||||
throw ScriptException("Wrong number of arguments for trace.");
|
||||
}
|
||||
|
||||
if (ev->NumArgs() > 5) {
|
||||
ent = G_GetEntity(ev->GetInteger(6));
|
||||
}
|
||||
|
||||
hit = G_SightTrace(start, mins, maxs, end, ent, NULL, mask, qfalse, "Entity::EventSightTrace");
|
||||
// call trace
|
||||
hit = G_SightTrace(start, mins, maxs, end, this, NULL, content_mask, false, "Entity::EventSightTrace");
|
||||
|
||||
ev->AddInteger(hit);
|
||||
}
|
||||
|
||||
@@ -51,6 +51,7 @@ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
#include "script.h"
|
||||
#include "listener.h"
|
||||
#include "simpleentity.h"
|
||||
#include "../qcommon/delegate.h"
|
||||
|
||||
// modification flags
|
||||
#define FLAG_IGNORE 0
|
||||
@@ -296,6 +297,12 @@ public:
|
||||
//====
|
||||
#endif
|
||||
|
||||
MulticastDelegate<void (const Event& ev)> delegate_damage;
|
||||
MulticastDelegate<void (const Event& ev)> delegate_killed;
|
||||
MulticastDelegate<void (const Event& ev)> delegate_gotKill;
|
||||
|
||||
public:
|
||||
|
||||
Entity();
|
||||
virtual ~Entity();
|
||||
|
||||
|
||||
+48
-31
@@ -1,6 +1,6 @@
|
||||
/*
|
||||
===========================================================================
|
||||
Copyright (C) 2024 the OpenMoHAA team
|
||||
Copyright (C) 2025 the OpenMoHAA team
|
||||
|
||||
This file is part of OpenMoHAA source code.
|
||||
|
||||
@@ -26,10 +26,9 @@ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
#include "playerbot.h"
|
||||
#include "g_bot.h"
|
||||
|
||||
static saved_bot_t *saved_bots = NULL;
|
||||
static unsigned int num_saved_bots = 0;
|
||||
static unsigned int current_bot_count = 0;
|
||||
static unsigned int botId = 0;
|
||||
static saved_bot_t *saved_bots = NULL;
|
||||
static unsigned int num_saved_bots = 0;
|
||||
static unsigned int botId = 0;
|
||||
|
||||
Container<str> alliedModelList;
|
||||
Container<str> germanModelList;
|
||||
@@ -158,16 +157,16 @@ Begin spawning a new bot entity
|
||||
*/
|
||||
void G_BotBegin(gentity_t *ent)
|
||||
{
|
||||
PlayerBot *player;
|
||||
Player *player;
|
||||
BotController *controller;
|
||||
|
||||
level.spawn_entnum = ent->s.number;
|
||||
player = new PlayerBot;
|
||||
player = new Player;
|
||||
|
||||
G_ClientBegin(ent, NULL);
|
||||
|
||||
controller = botManager.getControllerManager().createController(player);
|
||||
player->setController(controller);
|
||||
//player->setController(controller);
|
||||
}
|
||||
|
||||
/*
|
||||
@@ -272,7 +271,7 @@ void G_BotShift(int clientNum)
|
||||
return;
|
||||
}
|
||||
|
||||
if (!ent->entity->IsSubclassOfBot()) {
|
||||
if (!botManager.getControllerManager().findController(ent->entity)) {
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -356,7 +355,7 @@ bool G_IsBot(gentity_t *ent)
|
||||
return false;
|
||||
}
|
||||
|
||||
if (!ent->entity || !ent->entity->IsSubclassOfBot()) {
|
||||
if (!ent->entity || !botManager.getControllerManager().findController(ent->entity)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -376,7 +375,7 @@ bool G_IsPlayer(gentity_t *ent)
|
||||
return false;
|
||||
}
|
||||
|
||||
if (!ent->entity || ent->entity->IsSubclassOfBot()) {
|
||||
if (!ent->entity || botManager.getControllerManager().findController(ent->entity)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -388,7 +387,7 @@ bool G_IsPlayer(gentity_t *ent)
|
||||
G_GetRandomAlliedPlayerModel
|
||||
============
|
||||
*/
|
||||
const char* G_GetRandomAlliedPlayerModel()
|
||||
const char *G_GetRandomAlliedPlayerModel()
|
||||
{
|
||||
if (!alliedModelList.NumObjects()) {
|
||||
return "";
|
||||
@@ -403,7 +402,7 @@ const char* G_GetRandomAlliedPlayerModel()
|
||||
G_GetRandomGermanPlayerModel
|
||||
============
|
||||
*/
|
||||
const char* G_GetRandomGermanPlayerModel()
|
||||
const char *G_GetRandomGermanPlayerModel()
|
||||
{
|
||||
if (!germanModelList.NumObjects()) {
|
||||
return "";
|
||||
@@ -438,7 +437,6 @@ void G_AddBot(const saved_bot_t *saved)
|
||||
|
||||
clientNum = e - g_entities;
|
||||
|
||||
current_bot_count++;
|
||||
// increase the unique ID
|
||||
botId++;
|
||||
|
||||
@@ -504,7 +502,6 @@ void G_RemoveBot(gentity_t *ent)
|
||||
}
|
||||
|
||||
G_ClientDisconnect(ent);
|
||||
current_bot_count--;
|
||||
}
|
||||
|
||||
/*
|
||||
@@ -583,17 +580,18 @@ void G_SaveBots()
|
||||
saved_bots = NULL;
|
||||
}
|
||||
|
||||
if (!current_bot_count) {
|
||||
const BotControllerManager& manager = botManager.getControllerManager();
|
||||
unsigned int numSpawnedBots = manager.getControllers().NumObjects();
|
||||
|
||||
if (!numSpawnedBots) {
|
||||
return;
|
||||
}
|
||||
|
||||
saved_bots = new saved_bot_t[current_bot_count];
|
||||
saved_bots = new saved_bot_t[numSpawnedBots];
|
||||
num_saved_bots = 0;
|
||||
|
||||
const BotControllerManager& manager = botManager.getControllerManager();
|
||||
|
||||
count = manager.getControllers().NumObjects();
|
||||
assert(count <= current_bot_count);
|
||||
assert(count <= numSpawnedBots);
|
||||
|
||||
for (n = 1; n <= count; n++) {
|
||||
const BotController *controller = manager.getControllers().ObjectAt(n);
|
||||
@@ -623,10 +621,12 @@ void G_RestoreBots()
|
||||
return;
|
||||
}
|
||||
|
||||
for (n = 0; n < num_saved_bots; n++) {
|
||||
const saved_bot_t& saved = saved_bots[n];
|
||||
if (g_gametype->integer != GT_SINGLE_PLAYER) {
|
||||
for (n = 0; n < num_saved_bots; n++) {
|
||||
const saved_bot_t& saved = saved_bots[n];
|
||||
|
||||
G_AddBot(&saved);
|
||||
G_AddBot(&saved);
|
||||
}
|
||||
}
|
||||
|
||||
delete[] saved_bots;
|
||||
@@ -687,6 +687,18 @@ int G_CountClients()
|
||||
return count;
|
||||
}
|
||||
|
||||
/*
|
||||
===========
|
||||
G_RestartBots
|
||||
|
||||
Save bots
|
||||
============
|
||||
*/
|
||||
void G_RestartBots()
|
||||
{
|
||||
G_SaveBots();
|
||||
}
|
||||
|
||||
/*
|
||||
===========
|
||||
G_ResetBots
|
||||
@@ -696,12 +708,9 @@ Save and reset the bot count
|
||||
*/
|
||||
void G_ResetBots()
|
||||
{
|
||||
G_SaveBots();
|
||||
|
||||
botManager.Cleanup();
|
||||
|
||||
current_bot_count = 0;
|
||||
botId = 0;
|
||||
botId = 0;
|
||||
}
|
||||
|
||||
/*
|
||||
@@ -754,6 +763,12 @@ void G_SpawnBots()
|
||||
{
|
||||
unsigned int numClients;
|
||||
unsigned int numBotsToSpawn;
|
||||
unsigned int numSpawnedBots;
|
||||
|
||||
if (g_gametype->integer == GT_SINGLE_PLAYER) {
|
||||
// No bot on single-player
|
||||
return;
|
||||
}
|
||||
|
||||
//
|
||||
// Check the minimum bot count
|
||||
@@ -776,12 +791,14 @@ void G_SpawnBots()
|
||||
numBotsToSpawn = Q_min(numBotsToSpawn, sv_maxbots->integer);
|
||||
}
|
||||
|
||||
numSpawnedBots = botManager.getControllerManager().getControllers().NumObjects();
|
||||
|
||||
//
|
||||
// Spawn bots
|
||||
//
|
||||
if (numBotsToSpawn > current_bot_count) {
|
||||
G_AddBots(numBotsToSpawn - current_bot_count);
|
||||
} else if (numBotsToSpawn < current_bot_count) {
|
||||
G_RemoveBots(current_bot_count - numBotsToSpawn);
|
||||
if (numBotsToSpawn > numSpawnedBots) {
|
||||
G_AddBots(numBotsToSpawn - numSpawnedBots);
|
||||
} else if (numBotsToSpawn < numSpawnedBots) {
|
||||
G_RemoveBots(numSpawnedBots - numBotsToSpawn);
|
||||
}
|
||||
}
|
||||
+19
-18
@@ -1,6 +1,6 @@
|
||||
/*
|
||||
===========================================================================
|
||||
Copyright (C) 2024 the OpenMoHAA team
|
||||
Copyright (C) 2025 the OpenMoHAA team
|
||||
|
||||
This file is part of OpenMoHAA source code.
|
||||
|
||||
@@ -26,20 +26,21 @@ struct saved_bot_t {
|
||||
char userinfo[MAX_INFO_STRING];
|
||||
};
|
||||
|
||||
void G_BotBegin(gentity_t *ent);
|
||||
void G_BotThink(gentity_t *ent, int msec);
|
||||
void G_BotShift(int clientNum);
|
||||
gentity_t *G_GetFirstBot();
|
||||
void G_AddBot(const saved_bot_t *saved = NULL);
|
||||
void G_AddBots(unsigned int num);
|
||||
void G_RemoveBot(gentity_t *ent);
|
||||
void G_RemoveBots(unsigned int num);
|
||||
bool G_IsBot(gentity_t *ent);
|
||||
bool G_IsPlayer(gentity_t *ent);
|
||||
void G_ResetBots();
|
||||
void G_BotInit();
|
||||
void G_BotFrame();
|
||||
void G_BotPostInit();
|
||||
void G_SpawnBots();
|
||||
const char* G_GetRandomAlliedPlayerModel();
|
||||
const char* G_GetRandomGermanPlayerModel();
|
||||
void G_BotBegin(gentity_t *ent);
|
||||
void G_BotThink(gentity_t *ent, int msec);
|
||||
void G_BotShift(int clientNum);
|
||||
gentity_t *G_GetFirstBot();
|
||||
void G_AddBot(const saved_bot_t *saved = NULL);
|
||||
void G_AddBots(unsigned int num);
|
||||
void G_RemoveBot(gentity_t *ent);
|
||||
void G_RemoveBots(unsigned int num);
|
||||
bool G_IsBot(gentity_t *ent);
|
||||
bool G_IsPlayer(gentity_t *ent);
|
||||
void G_ResetBots();
|
||||
void G_RestartBots();
|
||||
void G_BotInit();
|
||||
void G_BotFrame();
|
||||
void G_BotPostInit();
|
||||
void G_SpawnBots();
|
||||
const char *G_GetRandomAlliedPlayerModel();
|
||||
const char *G_GetRandomGermanPlayerModel();
|
||||
+66
-18
@@ -757,6 +757,7 @@ void G_ClientUserinfoChanged(gentity_t *ent, const char *u)
|
||||
char *s;
|
||||
gclient_t *client;
|
||||
int clientnum;
|
||||
char oldname[MAX_NAME_LENGTH];
|
||||
|
||||
if (!ent) {
|
||||
return;
|
||||
@@ -772,6 +773,7 @@ void G_ClientUserinfoChanged(gentity_t *ent, const char *u)
|
||||
|
||||
clientnum = ent - g_entities;
|
||||
|
||||
Q_strncpyz(oldname, client->pers.netname, sizeof(oldname));
|
||||
if (gi.SanitizeName(s, client->pers.netname, sizeof(client->pers.netname))) {
|
||||
gi.Printf("WARNING: had to sanitize the name for client %i\n", clientnum);
|
||||
}
|
||||
@@ -815,6 +817,9 @@ void G_ClientUserinfoChanged(gentity_t *ent, const char *u)
|
||||
ent->entity->ProcessEvent(ev);
|
||||
}
|
||||
|
||||
Q_strncpyz(client->pers.ip, Info_ValueForKey(u, "ip"), sizeof(client->pers.ip));
|
||||
client->pers.port = atoi(Info_ValueForKey(u, "port"));
|
||||
|
||||
Q_strncpyz(client->pers.userinfo, u, sizeof(client->pers.userinfo));
|
||||
}
|
||||
|
||||
@@ -827,6 +832,7 @@ void G_BotConnect(int clientNum, qboolean firstTime, const char *userinfo)
|
||||
|
||||
ent->client = game.clients + clientNum;
|
||||
ent->s.number = clientNum;
|
||||
ent->r.svFlags |= SVF_BOT;
|
||||
|
||||
client = ent->client;
|
||||
|
||||
@@ -877,8 +883,6 @@ const char *G_ClientConnect(int clientNum, qboolean firstTime, qboolean differen
|
||||
gentity_t *ent;
|
||||
char userinfo[MAX_INFO_STRING];
|
||||
|
||||
gi.DPrintf("TTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTT\n");
|
||||
|
||||
// Added in OPM
|
||||
G_BotShift(clientNum);
|
||||
|
||||
@@ -886,6 +890,7 @@ const char *G_ClientConnect(int clientNum, qboolean firstTime, qboolean differen
|
||||
|
||||
gi.GetUserinfo(clientNum, userinfo, sizeof(userinfo));
|
||||
|
||||
#if 0
|
||||
// IP filtering
|
||||
// https://zerowing.idsoftware.com/bugzilla/show_bug.cgi?id=500
|
||||
// recommanding PB based IP / GUID banning, the builtin system is pretty limited
|
||||
@@ -893,15 +898,16 @@ const char *G_ClientConnect(int clientNum, qboolean firstTime, qboolean differen
|
||||
ip = Info_ValueForKey(userinfo, "ip");
|
||||
port = Info_ValueForKey(userinfo, "port");
|
||||
|
||||
// FIXME: what is fucking wrong with G_FilterPacket...
|
||||
// NOTE: IP banning is directly handled by the server
|
||||
//if ( G_FilterPacket( value ) ) {
|
||||
// return "Banned IP";
|
||||
//}
|
||||
if ( G_FilterPacket( value ) ) {
|
||||
return "Banned IP";
|
||||
}
|
||||
#endif
|
||||
|
||||
// we don't check password for bots and local client
|
||||
// NOTE: local client <-> "ip" "localhost"
|
||||
// this means this client is not running in our current process
|
||||
ip = Info_ValueForKey(userinfo, "ip");
|
||||
if ((strcmp(ip, "localhost") != 0)) {
|
||||
// check for a password
|
||||
value = Info_ValueForKey(userinfo, "password");
|
||||
@@ -935,9 +941,6 @@ const char *G_ClientConnect(int clientNum, qboolean firstTime, qboolean differen
|
||||
}
|
||||
}
|
||||
|
||||
Q_strncpyz(client->pers.ip, ip, sizeof(client->pers.ip));
|
||||
client->pers.port = atoi(port);
|
||||
|
||||
G_ClientUserinfoChanged(ent, userinfo);
|
||||
|
||||
#if 0
|
||||
@@ -953,9 +956,7 @@ const char *G_ClientConnect(int clientNum, qboolean firstTime, qboolean differen
|
||||
|
||||
// don't do the "xxx connected" messages if they were caried over from previous level
|
||||
if (firstTime && g_gametype->integer != GT_SINGLE_PLAYER) {
|
||||
if (dedicated->integer) {
|
||||
gi.Printf("%s is preparing for deployment\n", client->pers.netname);
|
||||
}
|
||||
G_PrintfClient(ent, "is preparing for deployment\n");
|
||||
|
||||
G_PrintToAllClients(va("%s is preparing for deployment\n", client->pers.netname), 2);
|
||||
}
|
||||
@@ -973,6 +974,8 @@ and on transition between teams, but doesn't happen on respawns
|
||||
*/
|
||||
void G_ClientBegin(gentity_t *ent, usercmd_t *cmd)
|
||||
{
|
||||
Player *player = NULL;
|
||||
|
||||
try {
|
||||
assert(ent->s.number < game.maxclients);
|
||||
assert(ent->client != NULL);
|
||||
@@ -984,23 +987,34 @@ void G_ClientBegin(gentity_t *ent, usercmd_t *cmd)
|
||||
// state when the game is saved, so we need to compensate
|
||||
// with deltaangles
|
||||
ent->entity->SetDeltaAngles();
|
||||
|
||||
if (ent->entity->IsSubclassOfPlayer()) {
|
||||
player = static_cast<Player *>(ent->entity);
|
||||
|
||||
// Added in OPM
|
||||
// When a client reuses an entity, make the player instance aware about it
|
||||
if (player) {
|
||||
player->ResetClient();
|
||||
}
|
||||
}
|
||||
} else {
|
||||
// a spawn point will completely reinitialize the entity
|
||||
level.spawn_entnum = ent->s.number;
|
||||
|
||||
Player *player = new Player;
|
||||
player = new Player;
|
||||
}
|
||||
|
||||
// Fixed in OPM
|
||||
// Initialize the enter time even when there is an intermission.
|
||||
// This is so in the scoreboard it shows up properly
|
||||
ent->client->pers.enterTime = level.svsFloatTime;
|
||||
|
||||
if (level.intermissiontime && ent->entity) {
|
||||
G_MoveClientToIntermission(ent->entity);
|
||||
} else {
|
||||
ent->client->pers.enterTime = level.svsFloatTime;
|
||||
|
||||
if (g_gametype->integer != GT_SINGLE_PLAYER) {
|
||||
// send effect if in a multiplayer game
|
||||
if (dedicated->integer) {
|
||||
gi.Printf("%s has entered the battle\n", ent->client->pers.netname);
|
||||
}
|
||||
G_PrintfClient(ent, "has entered the battle\n");
|
||||
|
||||
G_PrintToAllClients(va("%s has entered the battle\n", ent->client->pers.netname), 2);
|
||||
}
|
||||
@@ -1061,6 +1075,8 @@ void G_ClientDisconnect(gentity_t *ent)
|
||||
return;
|
||||
}
|
||||
|
||||
G_PrintfClient(ent, "has left the battle\n");
|
||||
|
||||
G_PrintToAllClients(va("%s has left the battle\n", ent->client->pers.netname), 2);
|
||||
|
||||
assert(ent->entity->IsSubclassOfPlayer());
|
||||
@@ -1135,3 +1151,35 @@ void G_ClientDisconnect(gentity_t *ent)
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
/*
|
||||
===========
|
||||
G_PrintfClient
|
||||
|
||||
Logs message with client context.
|
||||
For bots it falls back to regular print.
|
||||
============
|
||||
*/
|
||||
void G_PrintfClient(gentity_t *ent, const char *fmt, ...) {
|
||||
va_list argptr;
|
||||
char msg[MAXPRINTMSG];
|
||||
|
||||
if (!dedicated->integer) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (!ent->client) {
|
||||
return;
|
||||
}
|
||||
|
||||
va_start(argptr, fmt);
|
||||
Q_vsnprintf(msg, sizeof(msg), fmt, argptr);
|
||||
va_end(argptr);
|
||||
|
||||
if (ent->r.svFlags & SVF_BOT) {
|
||||
gi.Printf("%s %s", ent->client->pers.netname, msg);
|
||||
return;
|
||||
}
|
||||
|
||||
gi.PrintfClient(ent - g_entities, "%s", msg);
|
||||
}
|
||||
@@ -422,6 +422,8 @@ void G_ClientBegin(gentity_t *ent, usercmd_t *cmd);
|
||||
void G_SetClientConfigString(gentity_t *ent);
|
||||
void G_ClientCommand(gentity_t *ent);
|
||||
|
||||
void G_PrintfClient(gentity_t *ent, const char *fmt, ...);
|
||||
|
||||
//
|
||||
// g_active.c
|
||||
//
|
||||
|
||||
+69
-41
@@ -38,6 +38,8 @@ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
#include "smokesprite.h"
|
||||
#include "playerbot.h"
|
||||
#include "g_bot.h"
|
||||
#include "navigation_recast_load.h"
|
||||
|
||||
#include <tiki.h>
|
||||
|
||||
#ifdef WIN32
|
||||
@@ -227,9 +229,13 @@ void G_AllocGameData(void)
|
||||
|
||||
void G_DeAllocGameData(void)
|
||||
{
|
||||
// Initialize debug lines
|
||||
// Free up debug lines
|
||||
G_DeAllocDebugLines();
|
||||
|
||||
// Added in OPM
|
||||
// Free up debug strings
|
||||
G_DeAllocDebugStrings();
|
||||
|
||||
// free up the entities
|
||||
if (g_entities) {
|
||||
gi.Free(g_entities);
|
||||
@@ -537,6 +543,8 @@ void G_RunFrame(int levelTime, int frameTime)
|
||||
|
||||
PathManager.ShowNodes();
|
||||
|
||||
G_Navigation_Frame();
|
||||
|
||||
showentnums = (sv_showentnums->integer && (g_gametype->integer == GT_SINGLE_PLAYER || sv_cheats->integer));
|
||||
|
||||
g_iInThinks++;
|
||||
@@ -914,6 +922,9 @@ void G_Restart(void)
|
||||
|
||||
// Added in 2.0
|
||||
G_ResetSmokeSprites();
|
||||
|
||||
// Added in OPM
|
||||
G_RestartBots();
|
||||
}
|
||||
|
||||
void G_SetFrameNumber(int framenum)
|
||||
@@ -971,7 +982,8 @@ void G_SoundCallback(int entNum, soundChannel_t channelNumber, const char *name)
|
||||
Entity *entity = ent->entity;
|
||||
|
||||
if (!entity) {
|
||||
ScriptError("ERROR: wait on playsound only works on entities that still exist when the sound is done playing."
|
||||
ScriptError(
|
||||
"ERROR: wait on playsound only works on entities that still exist when the sound is done playing."
|
||||
);
|
||||
}
|
||||
|
||||
@@ -1135,6 +1147,17 @@ void G_ArchivePersistant(const char *name, qboolean loading)
|
||||
arc.Close();
|
||||
return;
|
||||
}
|
||||
|
||||
if (game.Vars()->size()) {
|
||||
Com_Printf("^~^~^ game variables being cleared:\n");
|
||||
game.Vars()->Print(&Com_Printf);
|
||||
|
||||
if (g_scriptcheck->integer) {
|
||||
Com_Error(ERR_DROP, "game variables being cleared");
|
||||
}
|
||||
}
|
||||
|
||||
game.Vars()->ClearList();
|
||||
} else {
|
||||
arc.Create(name);
|
||||
|
||||
@@ -1146,7 +1169,6 @@ void G_ArchivePersistant(const char *name, qboolean loading)
|
||||
G_ArchivePersistantData(arc);
|
||||
|
||||
arc.Close();
|
||||
return;
|
||||
}
|
||||
|
||||
qboolean G_ReadPersistant(const char *name)
|
||||
@@ -1863,75 +1885,81 @@ void G_ExitLevel(void)
|
||||
int j;
|
||||
gentity_t *ent;
|
||||
|
||||
// Don't allow exit level if the mission was failed
|
||||
|
||||
if (level.mission_failed) {
|
||||
return;
|
||||
}
|
||||
|
||||
// close the player log file if necessary
|
||||
// Close the player log file if necessary
|
||||
ClosePlayerLogFile();
|
||||
|
||||
// kill the sounds
|
||||
// Kill the sounds
|
||||
Com_sprintf(command, sizeof(command), "stopsound\n");
|
||||
gi.SendConsoleCommand(command);
|
||||
|
||||
if (g_gametype->integer != GT_SINGLE_PLAYER) {
|
||||
if (strlen(sv_nextmap->string)) {
|
||||
if (sv_nextmap->string && sv_nextmap->string[0]) {
|
||||
// The nextmap cvar was set (possibly by a vote - so go ahead and use it)
|
||||
level.nextmap = sv_nextmap->string;
|
||||
gi.cvar_set("nextmap", "");
|
||||
} else {
|
||||
} else if (sv_maplist->string && sv_maplist->string[0]) {
|
||||
// Use the next map in the maplist
|
||||
char *s, *f, *t;
|
||||
char *s, *t;
|
||||
qboolean bLevelSet = false;
|
||||
str sFirst;
|
||||
|
||||
f = NULL;
|
||||
s = strdup(sv_maplist->string);
|
||||
t = strtok(s, seps);
|
||||
while (t != NULL) {
|
||||
for (t = strtok(s, seps); t; t = strtok(NULL, seps)) {
|
||||
if (!Q_stricmp(t, level.mapname.c_str())) {
|
||||
// it's in the list, go to the next one
|
||||
// It's in the list, go to the next one
|
||||
t = strtok(NULL, seps);
|
||||
if (t) {
|
||||
level.nextmap = t;
|
||||
} else if (f) {
|
||||
// end of list, go to first one
|
||||
level.nextmap = f;
|
||||
} else {
|
||||
// there isn't a first one, same level
|
||||
level.nextmap = level.mapname;
|
||||
if (sFirst.length()) {
|
||||
// End of list, go to first one
|
||||
level.nextmap = sFirst;
|
||||
} else {
|
||||
// There isn't a first one, same level
|
||||
level.nextmap = level.mapname;
|
||||
}
|
||||
}
|
||||
|
||||
bLevelSet = true;
|
||||
break;
|
||||
}
|
||||
|
||||
// set the first map
|
||||
if (!f) {
|
||||
f = t;
|
||||
if (!sFirst.length()) {
|
||||
sFirst = t;
|
||||
}
|
||||
t = strtok(NULL, seps);
|
||||
}
|
||||
|
||||
free(s);
|
||||
|
||||
if (!bLevelSet) {
|
||||
// No level set, use the first map
|
||||
level.nextmap = sFirst;
|
||||
bLevelSet = true;
|
||||
}
|
||||
}
|
||||
|
||||
// level.nextmap should be set now, but if it isn't use the same map
|
||||
if (level.nextmap.length() == 0) {
|
||||
// Stay on the same map since no nextmap was set
|
||||
Com_sprintf(command, sizeof(command), "restart\n");
|
||||
gi.SendConsoleCommand(command);
|
||||
} else if (level.nextmap == level.mapname) {
|
||||
if (!level.nextmap.length()) {
|
||||
level.nextmap = level.mapname;
|
||||
}
|
||||
|
||||
if (level.nextmap == level.mapname) {
|
||||
// Stay on the same map if it's the same as the current map
|
||||
Com_sprintf(command, sizeof(command), "restart\n");
|
||||
gi.SendConsoleCommand(command);
|
||||
} else if (!Q_stricmpn(level.nextmap, "vstr", 4)) {
|
||||
// alias on another map
|
||||
Q_strncpyz(command, level.nextmap, sizeof(command));
|
||||
gi.SendConsoleCommand(command);
|
||||
} else {
|
||||
// use the level.nextmap variable
|
||||
Com_sprintf(command, sizeof(command), "gamemap \"%s\"\n", level.nextmap.c_str());
|
||||
gi.SendConsoleCommand(command);
|
||||
}
|
||||
// Added in 2.15
|
||||
// Execute a cvar command with `vstr`
|
||||
//else if (!Q_stricmpn(level.nextmap, "vstr", 4)) {
|
||||
// Fixed in OPM
|
||||
// Match the exact vstr command
|
||||
else if (!Q_stricmpn(level.nextmap, "vstr ", 5)) {
|
||||
Q_strncpyz(command, level.nextmap, sizeof(command));
|
||||
} else {
|
||||
// Use the level.nextmap variable
|
||||
Com_sprintf(command, sizeof(command), "gamemap \"%s\"\n", level.nextmap.c_str());
|
||||
}
|
||||
|
||||
gi.SendConsoleCommand(command);
|
||||
} else {
|
||||
Com_sprintf(command, sizeof(command), "gamemap \"%s\"\n", level.nextmap.c_str());
|
||||
gi.SendConsoleCommand(command);
|
||||
|
||||
@@ -365,6 +365,7 @@ void MM_StepSlideMove(void)
|
||||
vec3_t start_hit_origin;
|
||||
vec3_t first_hit_origin;
|
||||
trace_t nostep_groundTrace;
|
||||
qboolean nostep_validGroundTrace;
|
||||
|
||||
VectorCopy(mm->origin, start_o);
|
||||
VectorCopy(mm->velocity, start_v);
|
||||
@@ -410,6 +411,9 @@ void MM_StepSlideMove(void)
|
||||
VectorCopy(mm->origin, nostep_o);
|
||||
VectorCopy(mm->velocity, nostep_v);
|
||||
memcpy(&nostep_groundTrace, &mml.groundTrace, sizeof(trace_t));
|
||||
// Fixed in OPM
|
||||
// Save the valid ground trace
|
||||
nostep_validGroundTrace = mml.validGroundTrace;
|
||||
|
||||
VectorCopy(up, mm->origin);
|
||||
VectorCopy(start_v, mm->velocity);
|
||||
@@ -432,6 +436,10 @@ void MM_StepSlideMove(void)
|
||||
VectorCopy(nostep_o, mm->origin);
|
||||
VectorCopy(nostep_v, mm->velocity);
|
||||
memcpy(&mml.groundTrace, &nostep_groundTrace, sizeof(mml.groundTrace));
|
||||
// Fixed in OPM
|
||||
// Do not use the ground trace as it's invalid and would have an invalid entity number
|
||||
mml.validGroundTrace = nostep_validGroundTrace;
|
||||
|
||||
mm->hit_obstacle = first_hit_wall;
|
||||
VectorCopy(first_hit_origin, mm->hit_origin);
|
||||
VectorCopy(first_wall_normal, mm->obstacle_normal);
|
||||
|
||||
@@ -248,6 +248,8 @@ typedef struct gameImport_s {
|
||||
void (*cvar_set)(const char *varName, const char *varValue);
|
||||
cvar_t *(*cvar_set2)(const char *varName, const char *varValue, qboolean force);
|
||||
cvar_t *(*NextCvar)(cvar_t *var);
|
||||
void (*Cvar_CheckRange)(cvar_t* var, float min, float max, qboolean integral);
|
||||
|
||||
int (*Argc)();
|
||||
char *(*Argv)(int arg);
|
||||
char *(*Args)();
|
||||
@@ -257,6 +259,7 @@ typedef struct gameImport_s {
|
||||
int (*FS_WriteFile)(const char *qpath, const void *buffer, int size);
|
||||
fileHandle_t (*FS_FOpenFileWrite)(const char *fileName);
|
||||
fileHandle_t (*FS_FOpenFileAppend)(const char *fileName);
|
||||
long (*FS_FOpenFile)(const char* qpath, fileHandle_t *file, qboolean uniqueFILE, qboolean quiet);
|
||||
const char *(*FS_PrepFileWrite)(const char *fileName);
|
||||
size_t (*FS_Write)(const void *buffer, size_t size, fileHandle_t fileHandle);
|
||||
size_t (*FS_Read)(void *buffer, size_t len, fileHandle_t fileHandle);
|
||||
@@ -484,6 +487,11 @@ typedef struct gameImport_s {
|
||||
// Added in OPM
|
||||
//
|
||||
|
||||
/**
|
||||
* Print a message related to a client
|
||||
*/
|
||||
void (*PrintfClient)(int clientNum, const char *fmt, ...);
|
||||
|
||||
int (*pvssoundindex)(const char* name, int streamed);
|
||||
|
||||
cvar_t *fsDebug;
|
||||
|
||||
@@ -108,11 +108,14 @@ void G_InitWorldSession( void ) {
|
||||
int gt;
|
||||
|
||||
cvar_t *v = gi.Cvar_Get( "session", "-1", 0 );
|
||||
|
||||
g_bNewSession = false;
|
||||
|
||||
// if the gametype changed since the last session, don't use any
|
||||
// client sessions
|
||||
if ( g_gametype->integer != v->integer ) {
|
||||
G_Printf( "Gametype changed, clearing session data.\n" );
|
||||
g_bNewSession = true;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
+32
-11
@@ -1,6 +1,6 @@
|
||||
/*
|
||||
===========================================================================
|
||||
Copyright (C) 2023 the OpenMoHAA team
|
||||
Copyright (C) 2025 the OpenMoHAA team
|
||||
|
||||
This file is part of OpenMoHAA source code.
|
||||
|
||||
@@ -2161,19 +2161,36 @@ int G_NumClients(void)
|
||||
|
||||
void G_PrintToAllClients(const char *pszString, int iType)
|
||||
{
|
||||
gentity_t *ent;
|
||||
int i;
|
||||
|
||||
if (g_protocol >= protocol_e::PROTOCOL_MOHTA_MIN) {
|
||||
if (iType == 0) {
|
||||
gi.SendServerCommand(-1, "print \"" HUD_MESSAGE_YELLOW "%s\"", pszString);
|
||||
} else if (iType == 1) {
|
||||
gi.SendServerCommand(-1, "print \"" HUD_MESSAGE_WHITE "%s\"", pszString);
|
||||
} else if (iType == 2) {
|
||||
gi.SendServerCommand(-1, "print \"" HUD_MESSAGE_CHAT_WHITE "%s\"", pszString);
|
||||
for (i = 0; i < game.maxclients; i++) {
|
||||
ent = &g_entities[i];
|
||||
if (!ent->inuse || !ent->entity) {
|
||||
continue;
|
||||
}
|
||||
|
||||
if (iType == 0) {
|
||||
gi.SendServerCommand(i, "print \"" HUD_MESSAGE_YELLOW "%s\"", pszString);
|
||||
} else if (iType == 1) {
|
||||
gi.SendServerCommand(i, "print \"" HUD_MESSAGE_WHITE "%s\"", pszString);
|
||||
} else if (iType == 2) {
|
||||
gi.SendServerCommand(i, "print \"" HUD_MESSAGE_CHAT_WHITE "%s\"", pszString);
|
||||
}
|
||||
}
|
||||
} else {
|
||||
if (iType == 0) {
|
||||
gi.SendServerCommand(-1, "print \"" HUD_MESSAGE_YELLOW "%s\"", pszString);
|
||||
} else {
|
||||
gi.SendServerCommand(-1, "print \"" HUD_MESSAGE_WHITE "%s\"", pszString);
|
||||
for (i = 0; i < game.maxclients; i++) {
|
||||
ent = &g_entities[i];
|
||||
if (!ent->inuse || !ent->entity) {
|
||||
continue;
|
||||
}
|
||||
|
||||
if (iType == 0) {
|
||||
gi.SendServerCommand(i, "print \"" HUD_MESSAGE_YELLOW "%s\"", pszString);
|
||||
} else {
|
||||
gi.SendServerCommand(i, "print \"" HUD_MESSAGE_WHITE "%s\"", pszString);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -2453,6 +2470,10 @@ gentity_t *G_GetGEntity(int ent_num)
|
||||
return ent;
|
||||
}
|
||||
|
||||
unsigned int G_GetWeaponCommandMask() {
|
||||
return GetWeaponCommandMask(g_protocol >= PROTOCOL_MOHTA_MIN ? WEAPON_COMMAND_MAX_VER17 : WEAPON_COMMAND_MAX_VER6);
|
||||
}
|
||||
|
||||
unsigned int G_GetWeaponCommand(unsigned int buttons) {
|
||||
return GetWeaponCommand(buttons, g_protocol >= PROTOCOL_MOHTA_MIN ? WEAPON_COMMAND_MAX_VER17 : WEAPON_COMMAND_MAX_VER6);
|
||||
}
|
||||
+10
-9
@@ -1,6 +1,6 @@
|
||||
/*
|
||||
===========================================================================
|
||||
Copyright (C) 2023 the OpenMoHAA team
|
||||
Copyright (C) 2025 the OpenMoHAA team
|
||||
|
||||
This file is part of OpenMoHAA source code.
|
||||
|
||||
@@ -30,9 +30,9 @@ class SimpleEntity;
|
||||
class SimpleArchivedEntity;
|
||||
class ScriptThread;
|
||||
|
||||
void G_ArchivePlayerState(Archiver& arc, playerState_t* ps);
|
||||
void G_ArchiveTrace(Archiver& arc, trace_t* trace);
|
||||
void G_ArchiveClient(Archiver& arc, gclient_t* client);
|
||||
void G_ArchivePlayerState(Archiver& arc, playerState_t *ps);
|
||||
void G_ArchiveTrace(Archiver& arc, trace_t *trace);
|
||||
void G_ArchiveClient(Archiver& arc, gclient_t *client);
|
||||
void G_ArchiveEdict(Archiver& arc, gentity_t *edict);
|
||||
|
||||
void G_AllocDebugLines(void);
|
||||
@@ -107,10 +107,10 @@ trace_t G_Trace(
|
||||
qboolean tracedeep = qfalse
|
||||
);
|
||||
void G_TraceEntities(
|
||||
Vector & start,
|
||||
Vector & mins,
|
||||
Vector & maxs,
|
||||
Vector & end,
|
||||
Vector& start,
|
||||
Vector& mins,
|
||||
Vector& maxs,
|
||||
Vector& end,
|
||||
Container<Entity *> *victimlist,
|
||||
int contentmask,
|
||||
qboolean bIncludeTriggers = qfalse
|
||||
@@ -140,7 +140,7 @@ Vector G_PredictPosition(Vector start, Vector target, Vector targetvelocity, flo
|
||||
qboolean G_LoadAndExecScript(const char *filename, const char *label = NULL, qboolean quiet = qfalse);
|
||||
ScriptThread *ExecuteThread(str thread_name, qboolean start = true);
|
||||
|
||||
int MOD_string_to_int(const str &immune_string);
|
||||
int MOD_string_to_int(const str& immune_string);
|
||||
qboolean MOD_matches(int incoming_damage, int damage_type);
|
||||
|
||||
void G_MissionFailed(void);
|
||||
@@ -327,4 +327,5 @@ const char *WeaponHandNumToName(weaponhand_t hand);
|
||||
weaponhand_t WeaponHandNameToNum(str side);
|
||||
void G_DebugTargets(Entity *e, str from);
|
||||
void G_DebugDamage(float damage, Entity *victim, Entity *attacker, Entity *inflictor);
|
||||
unsigned int G_GetWeaponCommandMask();
|
||||
unsigned int G_GetWeaponCommand(unsigned int buttons);
|
||||
@@ -298,6 +298,9 @@ cvar_t *g_textmsg_minDelay;
|
||||
// Whether or not to prevent teams from being unbalanced
|
||||
cvar_t *g_teambalance;
|
||||
|
||||
// Whether or not to use Legacy Navigation
|
||||
cvar_t *g_navigation_legacy;
|
||||
|
||||
void CVAR_Init(void)
|
||||
{
|
||||
int i;
|
||||
@@ -676,5 +679,7 @@ void CVAR_Init(void)
|
||||
|
||||
g_teambalance = gi.Cvar_Get("g_teambalance", "0", 0);
|
||||
|
||||
g_navigation_legacy = gi.Cvar_Get("g_navigation_legacy", "0", CVAR_LATCH);
|
||||
|
||||
cl_running = gi.Cvar_Get("cl_running", "", 0);
|
||||
}
|
||||
@@ -284,6 +284,8 @@ extern cvar_t *g_textmsg_minDelay;
|
||||
|
||||
extern cvar_t *g_teambalance;
|
||||
|
||||
extern cvar_t *g_navigation_legacy;
|
||||
|
||||
void CVAR_Init(void);
|
||||
|
||||
#ifdef __cplusplus
|
||||
|
||||
+25
-13
@@ -1,6 +1,6 @@
|
||||
/*
|
||||
===========================================================================
|
||||
Copyright (C) 2024 the OpenMoHAA team
|
||||
Copyright (C) 2025 the OpenMoHAA team
|
||||
|
||||
This file is part of OpenMoHAA source code.
|
||||
|
||||
@@ -686,10 +686,17 @@ void GameScript::ArchiveCodePos(Archiver& arc, unsigned char **codePos)
|
||||
|
||||
void GameScript::Close(void)
|
||||
{
|
||||
// Free up catch blocks
|
||||
for (int i = m_CatchBlocks.NumObjects(); i > 0; i--) {
|
||||
delete m_CatchBlocks.ObjectAt(i);
|
||||
}
|
||||
|
||||
// Added in OPM
|
||||
// Free up allocated state scripts
|
||||
for (int i = m_StateScripts.NumObjects(); i > 0; i--) {
|
||||
delete m_StateScripts.ObjectAt(i);
|
||||
}
|
||||
|
||||
m_CatchBlocks.FreeObjectList();
|
||||
|
||||
if (m_ProgToSource) {
|
||||
@@ -814,7 +821,11 @@ StateScript *GameScript::CreateCatchStateScript(unsigned char *try_begin_code_po
|
||||
|
||||
StateScript *GameScript::CreateSwitchStateScript(void)
|
||||
{
|
||||
return new StateScript;
|
||||
StateScript *stateScript = new StateScript;
|
||||
|
||||
m_StateScripts.AddObject(stateScript);
|
||||
|
||||
return stateScript;
|
||||
}
|
||||
|
||||
StateScript *GameScript::GetCatchStateScript(unsigned char *in, unsigned char *& out)
|
||||
@@ -866,7 +877,7 @@ ScriptThreadLabel::ScriptThreadLabel()
|
||||
m_Label = STRING_EMPTY;
|
||||
}
|
||||
|
||||
ScriptThread *ScriptThreadLabel::Create(Listener *listener)
|
||||
ScriptThread *ScriptThreadLabel::Create(Listener *listener) const
|
||||
{
|
||||
ScriptClass *scriptClass;
|
||||
ScriptThread *thread;
|
||||
@@ -896,7 +907,7 @@ ScriptThread *ScriptThreadLabel::Create(Listener *listener)
|
||||
return thread;
|
||||
}
|
||||
|
||||
void ScriptThreadLabel::Execute(Listener *listener)
|
||||
void ScriptThreadLabel::Execute(Listener *listener) const
|
||||
{
|
||||
if (!m_Script) {
|
||||
return;
|
||||
@@ -909,12 +920,7 @@ void ScriptThreadLabel::Execute(Listener *listener)
|
||||
}
|
||||
}
|
||||
|
||||
void ScriptThreadLabel::Execute(Listener *listener, Event& ev)
|
||||
{
|
||||
Execute(listener, &ev);
|
||||
}
|
||||
|
||||
void ScriptThreadLabel::Execute(Listener *listener, Event *ev)
|
||||
void ScriptThreadLabel::Execute(Listener *listener, Event& ev) const
|
||||
{
|
||||
if (!m_Script) {
|
||||
return;
|
||||
@@ -927,7 +933,13 @@ void ScriptThreadLabel::Execute(Listener *listener, Event *ev)
|
||||
}
|
||||
}
|
||||
|
||||
void ScriptThreadLabel::Execute(Listener *listener, Event *ev) const
|
||||
{
|
||||
Execute(listener, *ev);
|
||||
}
|
||||
|
||||
void ScriptThreadLabel::Execute(Listener *pSelf, const SafePtr<Listener>& listener, const SafePtr<Listener>& param)
|
||||
const
|
||||
{
|
||||
if (!m_Script) {
|
||||
return;
|
||||
@@ -1214,7 +1226,7 @@ bool ScriptThreadLabel::TrySetScript(const_str label)
|
||||
return true;
|
||||
}
|
||||
|
||||
void ScriptThreadLabel::GetScriptValue(ScriptVariable *var)
|
||||
void ScriptThreadLabel::GetScriptValue(ScriptVariable *var) const
|
||||
{
|
||||
if (!m_Script) {
|
||||
var->Clear();
|
||||
@@ -1228,12 +1240,12 @@ void ScriptThreadLabel::GetScriptValue(ScriptVariable *var)
|
||||
var->setConstArrayValue(var_array, 2);
|
||||
}
|
||||
|
||||
bool ScriptThreadLabel::IsSet(void)
|
||||
bool ScriptThreadLabel::IsSet(void) const
|
||||
{
|
||||
return m_Script != NULL;
|
||||
}
|
||||
|
||||
bool ScriptThreadLabel::IsFile(const_str filename)
|
||||
bool ScriptThreadLabel::IsFile(const_str filename) const
|
||||
{
|
||||
return m_Script && m_Script->ConstFilename() == filename && m_Label == STRING_EMPTY;
|
||||
}
|
||||
|
||||
+11
-10
@@ -1,6 +1,6 @@
|
||||
/*
|
||||
===========================================================================
|
||||
Copyright (C) 2024 the OpenMoHAA team
|
||||
Copyright (C) 2025 the OpenMoHAA team
|
||||
|
||||
This file is part of OpenMoHAA source code.
|
||||
|
||||
@@ -118,7 +118,8 @@ class GameScript : public AbstractScript
|
||||
{
|
||||
protected:
|
||||
// try/throw variable
|
||||
Container<CatchBlock *> m_CatchBlocks;
|
||||
Container<CatchBlock *> m_CatchBlocks;
|
||||
Container<StateScript *> m_StateScripts;
|
||||
|
||||
public:
|
||||
// program variables
|
||||
@@ -169,11 +170,11 @@ private:
|
||||
public:
|
||||
ScriptThreadLabel();
|
||||
|
||||
ScriptThread *Create(Listener *listener);
|
||||
void Execute(Listener *listener = NULL);
|
||||
void Execute(Listener *listener, Event& ev);
|
||||
void Execute(Listener *listener, Event *ev);
|
||||
void Execute(Listener *pSelf, const SafePtr<Listener>& listener, const SafePtr<Listener>& param);
|
||||
ScriptThread *Create(Listener *listener) const;
|
||||
void Execute(Listener *listener = NULL) const;
|
||||
void Execute(Listener *listener, Event& ev) const;
|
||||
void Execute(Listener *listener, Event *ev) const;
|
||||
void Execute(Listener *pSelf, const SafePtr<Listener>& listener, const SafePtr<Listener>& param) const;
|
||||
|
||||
void Clear();
|
||||
void Set(const char *label);
|
||||
@@ -188,10 +189,10 @@ public:
|
||||
bool TrySetScript(const_str label);
|
||||
bool TrySetScript(const char *label);
|
||||
|
||||
bool IsSet(void);
|
||||
bool IsFile(const_str filename);
|
||||
bool IsSet(void) const;
|
||||
bool IsFile(const_str filename) const;
|
||||
|
||||
void GetScriptValue(ScriptVariable *var);
|
||||
void GetScriptValue(ScriptVariable *var) const;
|
||||
|
||||
void Archive(Archiver& arc);
|
||||
|
||||
|
||||
@@ -114,7 +114,7 @@ void Health::PickupHealth(Event *ev)
|
||||
|
||||
gi.SendServerCommand(
|
||||
player->edict - g_entities,
|
||||
"print \"" HUD_MESSAGE_YELLOW "%s \"",
|
||||
"print \"" HUD_MESSAGE_YELLOW "%s\n\"",
|
||||
gi.LV_ConvertString(va("Recovered %d Health", amount))
|
||||
);
|
||||
}
|
||||
|
||||
+45
-5
@@ -35,6 +35,8 @@ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
#include "Entities.h"
|
||||
#include "health.h"
|
||||
|
||||
#include "navigation_recast_load.h"
|
||||
|
||||
#include "scriptmaster.h"
|
||||
#include "scriptthread.h"
|
||||
#include "scriptvariable.h"
|
||||
@@ -855,6 +857,8 @@ void Level::CleanUp(qboolean samemap, qboolean resetConfigStrings)
|
||||
// clear active current bots
|
||||
G_ResetBots();
|
||||
|
||||
navigationMap.CleanUp(samemap);
|
||||
|
||||
assert(active_edicts.next);
|
||||
assert(active_edicts.next->prev == &active_edicts);
|
||||
assert(active_edicts.prev);
|
||||
@@ -1502,6 +1506,12 @@ void Level::ServerSpawned(void)
|
||||
Director.Unpause();
|
||||
|
||||
Unregister(STRING_SPAWN);
|
||||
|
||||
if (!g_navigation_legacy->integer) {
|
||||
// Added in OPM
|
||||
// Recast navigation
|
||||
navigationMap.LoadWorldMap(m_mapfile);
|
||||
}
|
||||
} else {
|
||||
Director.LoadMenus();
|
||||
}
|
||||
@@ -1511,9 +1521,9 @@ void Level::ServerSpawned(void)
|
||||
|
||||
void Level::SetMap(const char *themapname)
|
||||
{
|
||||
char *spawnpos;
|
||||
int i;
|
||||
str text;
|
||||
const char *spawnpos;
|
||||
int i;
|
||||
str text;
|
||||
|
||||
Init();
|
||||
|
||||
@@ -1522,8 +1532,8 @@ void Level::SetMap(const char *themapname)
|
||||
// set a specific spawnpoint if the map was started with a $
|
||||
spawnpos = strchr((char *)themapname, '$');
|
||||
if (spawnpos) {
|
||||
mapname = (const char *)(spawnpos - themapname);
|
||||
spawnpoint = mapname;
|
||||
mapname = str(themapname, 0, spawnpos - themapname);
|
||||
spawnpoint = spawnpos + 1;
|
||||
} else {
|
||||
mapname = themapname;
|
||||
spawnpoint = "";
|
||||
@@ -1588,6 +1598,30 @@ void Level::Precache(void)
|
||||
|
||||
LoadAllScripts("global", ".scr");
|
||||
InitVoteOptions();
|
||||
|
||||
// Added in OPM
|
||||
// Cache all player models in multi-player
|
||||
// This avoids using precache scripts
|
||||
if (g_gametype->integer != GT_SINGLE_PLAYER) {
|
||||
char **fileList;
|
||||
int numFiles;
|
||||
int i;
|
||||
|
||||
fileList = gi.FS_ListFiles("models/player", ".tik", qfalse, &numFiles);
|
||||
|
||||
for (i = 0; i < numFiles; i++) {
|
||||
const char *filename = fileList[i];
|
||||
const size_t filelen = strlen(filename);
|
||||
|
||||
if (!Q_stricmpn(filename, "allied_", 7) || !Q_stricmpn(filename, "american_", 9)
|
||||
|| !Q_stricmpn(filename, "german_", 7) || !Q_stricmpn(filename, "IT_", 3)
|
||||
|| !Q_stricmpn(filename, "SC_", 3)) {
|
||||
CacheResource(va("models/player/%s", filename));
|
||||
}
|
||||
}
|
||||
|
||||
gi.FS_FreeFileList(fileList);
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
@@ -1730,6 +1764,10 @@ void Level::FreeEdict(gentity_t *ed)
|
||||
{
|
||||
gclient_t *client;
|
||||
|
||||
// clear the model so it decreases the user count
|
||||
// and free memory if the model is not used anywhere
|
||||
gi.clearmodel(ed);
|
||||
|
||||
// unlink from world
|
||||
gi.unlinkentity(ed);
|
||||
|
||||
@@ -1916,6 +1954,8 @@ void Level::CheckVote(void)
|
||||
level.m_voteNo++;
|
||||
}
|
||||
}
|
||||
|
||||
numVoters++;
|
||||
}
|
||||
|
||||
level.m_numVoters = numVoters;
|
||||
|
||||
+52
-115
@@ -1,6 +1,6 @@
|
||||
/*
|
||||
===========================================================================
|
||||
Copyright (C) 2023 the OpenMoHAA team
|
||||
Copyright (C) 2025 the OpenMoHAA team
|
||||
|
||||
This file is part of OpenMoHAA source code.
|
||||
|
||||
@@ -146,8 +146,7 @@ If PROJECTILES is set, the trigger will respond to projectiles (rockets, grenade
|
||||
|
||||
Event EV_ExplodingWall_StopRotating
|
||||
(
|
||||
"stoprotating",
|
||||
EV_DEFAULT,
|
||||
"stoprotating", EV_DEFAULT,
|
||||
NULL,
|
||||
NULL,
|
||||
"Stop rotating the wall.",
|
||||
@@ -155,17 +154,16 @@ Event EV_ExplodingWall_StopRotating
|
||||
);
|
||||
Event EV_ExplodingWall_OnGround
|
||||
(
|
||||
"checkonground",
|
||||
EV_DEFAULT,
|
||||
"checkonground", EV_DEFAULT,
|
||||
NULL,
|
||||
NULL,
|
||||
"Check if exploding wall is on ground.",
|
||||
EV_NORMAL
|
||||
|
||||
);
|
||||
Event EV_ExplodingWall_AngleSpeed
|
||||
(
|
||||
"anglespeed",
|
||||
EV_DEFAULT,
|
||||
"anglespeed", EV_DEFAULT,
|
||||
"f",
|
||||
"speed",
|
||||
"Set the angle speed.",
|
||||
@@ -173,8 +171,7 @@ Event EV_ExplodingWall_AngleSpeed
|
||||
);
|
||||
Event EV_ExplodingWall_LandRadius
|
||||
(
|
||||
"land_radius",
|
||||
EV_DEFAULT,
|
||||
"land_radius", EV_DEFAULT,
|
||||
"f",
|
||||
"radius",
|
||||
"Set the land radius.",
|
||||
@@ -182,8 +179,7 @@ Event EV_ExplodingWall_LandRadius
|
||||
);
|
||||
Event EV_ExplodingWall_LandAngles
|
||||
(
|
||||
"land_angles",
|
||||
EV_DEFAULT,
|
||||
"land_angles", EV_DEFAULT,
|
||||
"v",
|
||||
"angles",
|
||||
"Set the land angles.",
|
||||
@@ -191,15 +187,13 @@ Event EV_ExplodingWall_LandAngles
|
||||
);
|
||||
Event EV_ExplodingWall_BaseVelocity
|
||||
(
|
||||
"base_velocity",
|
||||
EV_DEFAULT,
|
||||
"base_velocity", EV_DEFAULT,
|
||||
"v",
|
||||
"velocity",
|
||||
"Set the base velocity.",
|
||||
EV_NORMAL
|
||||
);
|
||||
Event EV_ExplodingWall_RandomVelocity
|
||||
(
|
||||
Event EV_ExplodingWall_RandomVelocity(
|
||||
"random_velocity",
|
||||
EV_DEFAULT,
|
||||
"v",
|
||||
@@ -209,8 +203,7 @@ Event EV_ExplodingWall_RandomVelocity
|
||||
);
|
||||
Event EV_ExplodingWall_SetDmg
|
||||
(
|
||||
"dmg",
|
||||
EV_DEFAULT,
|
||||
"dmg", EV_DEFAULT,
|
||||
"i",
|
||||
"dmg",
|
||||
"Set the damage from the exploding wall.",
|
||||
@@ -218,17 +211,16 @@ Event EV_ExplodingWall_SetDmg
|
||||
);
|
||||
Event EV_ExplodingWall_SetExplosions
|
||||
(
|
||||
"explosions",
|
||||
EV_DEFAULT,
|
||||
"explosions", EV_DEFAULT,
|
||||
"i",
|
||||
"explosions",
|
||||
"Set the number of explosions.",
|
||||
EV_NORMAL
|
||||
|
||||
);
|
||||
Event EV_ExplodingWall_Setup
|
||||
(
|
||||
"setup",
|
||||
EV_CODEONLY,
|
||||
"setup", EV_CODEONLY,
|
||||
NULL,
|
||||
NULL,
|
||||
"Initializes the exploding wall.",
|
||||
@@ -253,49 +245,41 @@ CLASS_DECLARATION(Trigger, ExplodingWall, "func_explodingwall") {
|
||||
};
|
||||
|
||||
void ExplodingWall::AngleSpeed(Event *ev)
|
||||
|
||||
{
|
||||
angle_speed = ev->GetFloat(1);
|
||||
}
|
||||
|
||||
void ExplodingWall::LandRadius(Event *ev)
|
||||
|
||||
{
|
||||
land_radius = ev->GetFloat(1);
|
||||
}
|
||||
|
||||
void ExplodingWall::LandAngles(Event *ev)
|
||||
|
||||
{
|
||||
land_angles = ev->GetVector(1);
|
||||
}
|
||||
|
||||
void ExplodingWall::BaseVelocity(Event *ev)
|
||||
|
||||
{
|
||||
base_velocity = ev->GetVector(1);
|
||||
}
|
||||
|
||||
void ExplodingWall::RandomVelocity(Event *ev)
|
||||
|
||||
{
|
||||
random_velocity = ev->GetVector(1);
|
||||
}
|
||||
|
||||
void ExplodingWall::SetDmg(Event *ev)
|
||||
|
||||
{
|
||||
dmg = ev->GetInteger(1);
|
||||
}
|
||||
|
||||
void ExplodingWall::SetExplosions(Event *ev)
|
||||
|
||||
{
|
||||
explosions = ev->GetInteger(1);
|
||||
}
|
||||
|
||||
void ExplodingWall::Explode(Event *ev)
|
||||
|
||||
{
|
||||
Entity *other;
|
||||
Vector pos;
|
||||
@@ -390,7 +374,6 @@ void ExplodingWall::Explode(Event *ev)
|
||||
}
|
||||
|
||||
void ExplodingWall::DamageEvent(Event *ev)
|
||||
|
||||
{
|
||||
Event *event;
|
||||
Entity *inflictor;
|
||||
@@ -427,7 +410,6 @@ void ExplodingWall::DamageEvent(Event *ev)
|
||||
}
|
||||
|
||||
void ExplodingWall::GroundDamage(Event *ev)
|
||||
|
||||
{
|
||||
Entity *inflictor;
|
||||
Entity *attacker;
|
||||
@@ -467,14 +449,12 @@ void ExplodingWall::GroundDamage(Event *ev)
|
||||
}
|
||||
|
||||
void ExplodingWall::SetupSecondStage(void)
|
||||
|
||||
{
|
||||
health = max_health;
|
||||
takedamage = DAMAGE_YES;
|
||||
}
|
||||
|
||||
void ExplodingWall::StopRotating(Event *ev)
|
||||
|
||||
{
|
||||
avelocity = vec_zero;
|
||||
setAngles(land_angles);
|
||||
@@ -484,7 +464,6 @@ void ExplodingWall::StopRotating(Event *ev)
|
||||
}
|
||||
|
||||
void ExplodingWall::CheckOnGround(Event *ev)
|
||||
|
||||
{
|
||||
if ((velocity == vec_zero) && groundentity) {
|
||||
Vector delta;
|
||||
@@ -532,7 +511,6 @@ void ExplodingWall::CheckOnGround(Event *ev)
|
||||
}
|
||||
|
||||
void ExplodingWall::TouchFunc(Event *ev)
|
||||
|
||||
{
|
||||
Entity *other;
|
||||
|
||||
@@ -568,7 +546,6 @@ void ExplodingWall::TouchFunc(Event *ev)
|
||||
}
|
||||
|
||||
void ExplodingWall::Setup(Event *ev)
|
||||
|
||||
{
|
||||
if (spawnflags & INVISIBLE) {
|
||||
if (Targeted()) {
|
||||
@@ -650,6 +627,7 @@ Event EV_Teleporter_StopTeleport
|
||||
"entity",
|
||||
"Releases the entity at the end of the teleport.",
|
||||
EV_NORMAL
|
||||
|
||||
);
|
||||
Event EV_Teleporter_SetThread
|
||||
(
|
||||
@@ -759,7 +737,6 @@ void Teleporter::StartTeleport(Event *ev)
|
||||
}
|
||||
|
||||
void Teleporter::Teleport(Event *ev)
|
||||
|
||||
{
|
||||
Entity *dest;
|
||||
int i;
|
||||
@@ -873,7 +850,6 @@ void Teleporter::Teleport(Event *ev)
|
||||
}
|
||||
|
||||
void Teleporter::StopTeleport(Event *ev)
|
||||
|
||||
{
|
||||
Entity *other;
|
||||
|
||||
@@ -974,6 +950,7 @@ Event EV_UseAnim_Reset
|
||||
NULL,
|
||||
"Reset's the Use Anim after it has no longer been touched.",
|
||||
EV_NORMAL
|
||||
|
||||
);
|
||||
Event EV_UseAnim_Thread
|
||||
(
|
||||
@@ -983,15 +960,16 @@ Event EV_UseAnim_Thread
|
||||
"label",
|
||||
"Sets which thread to use when this UseAnim is triggered.",
|
||||
EV_NORMAL
|
||||
|
||||
);
|
||||
Event EV_UseAnim_Count
|
||||
(
|
||||
"count",
|
||||
EV_DEFAULT,
|
||||
"count", EV_DEFAULT,
|
||||
"i",
|
||||
"newCount",
|
||||
"Sets how many times the UseAnim can be triggered.",
|
||||
EV_NORMAL
|
||||
|
||||
);
|
||||
Event EV_UseAnim_TriggerTarget
|
||||
(
|
||||
@@ -1019,6 +997,7 @@ Event EV_UseAnim_SetKey
|
||||
"keyName",
|
||||
"set the key needed to make this UseAnim function.",
|
||||
EV_NORMAL
|
||||
|
||||
);
|
||||
Event EV_UseAnim_SetState
|
||||
(
|
||||
@@ -1029,8 +1008,7 @@ Event EV_UseAnim_SetState
|
||||
"set the state to use for the player.",
|
||||
EV_NORMAL
|
||||
);
|
||||
Event EV_UseAnim_SetCamera
|
||||
(
|
||||
Event EV_UseAnim_SetCamera(
|
||||
"camera",
|
||||
EV_DEFAULT,
|
||||
"s",
|
||||
@@ -1047,9 +1025,9 @@ Event EV_UseAnim_SetNumLoops
|
||||
"loopCount",
|
||||
"set the number of times to loop an animation per use.",
|
||||
EV_NORMAL
|
||||
|
||||
);
|
||||
Event EV_UseAnim_SetDelay
|
||||
(
|
||||
Event EV_UseAnim_SetDelay(
|
||||
"delay",
|
||||
EV_DEFAULT,
|
||||
"f",
|
||||
@@ -1120,7 +1098,6 @@ UseAnim::UseAnim()
|
||||
}
|
||||
|
||||
void UseAnim::Touched(Event *ev)
|
||||
|
||||
{
|
||||
Entity *other;
|
||||
|
||||
@@ -1142,7 +1119,6 @@ void UseAnim::Touched(Event *ev)
|
||||
}
|
||||
|
||||
bool UseAnim::canBeUsed(Entity *activator)
|
||||
|
||||
{
|
||||
Entity *dest;
|
||||
|
||||
@@ -1210,7 +1186,6 @@ bool UseAnim::canBeUsed(Entity *activator)
|
||||
bool UseAnim::GetInformation(
|
||||
Entity *activator, Vector *org, Vector *angles, str *animation, int *loopcount, str *state, str *camera
|
||||
)
|
||||
|
||||
{
|
||||
Entity *dest;
|
||||
UseAnimDestination *uadest;
|
||||
@@ -1282,7 +1257,6 @@ bool UseAnim::GetInformation(
|
||||
}
|
||||
|
||||
void UseAnim::TriggerTargets(Entity *activator)
|
||||
|
||||
{
|
||||
//
|
||||
// fire off our trigger target if appropriate
|
||||
@@ -1312,7 +1286,6 @@ void UseAnim::TriggerTargets(Entity *activator)
|
||||
}
|
||||
|
||||
void UseAnim::Reset(Event *ev)
|
||||
|
||||
{
|
||||
//
|
||||
// find out if our triggertarget is of type door and only reset if the door is closed
|
||||
@@ -1363,25 +1336,21 @@ void UseAnim::Reset(Event *ev)
|
||||
}
|
||||
|
||||
void UseAnim::SetThread(Event *ev)
|
||||
|
||||
{
|
||||
thread.SetThread(ev->GetValue(1));
|
||||
}
|
||||
|
||||
void UseAnim::SetDelay(Event *ev)
|
||||
|
||||
{
|
||||
delay = ev->GetFloat(1);
|
||||
}
|
||||
|
||||
void UseAnim::SetTriggerTarget(Event *ev)
|
||||
|
||||
{
|
||||
triggertarget = ev->GetString(1);
|
||||
}
|
||||
|
||||
void UseAnim::SetCount(Event *ev)
|
||||
|
||||
{
|
||||
count = ev->GetInteger(1);
|
||||
}
|
||||
@@ -1518,6 +1487,7 @@ Event EV_UseObject_StopThread
|
||||
"label",
|
||||
"Sets which stop thread to use when this UseObject is finished.",
|
||||
EV_NORMAL
|
||||
|
||||
);
|
||||
Event EV_UseObject_ResetThread
|
||||
(
|
||||
@@ -1527,6 +1497,7 @@ Event EV_UseObject_ResetThread
|
||||
"label",
|
||||
"Sets which thread to call when resetting.",
|
||||
EV_NORMAL
|
||||
|
||||
);
|
||||
Event EV_UseObject_Count
|
||||
(
|
||||
@@ -1536,6 +1507,7 @@ Event EV_UseObject_Count
|
||||
"newCount",
|
||||
"Sets how many times the UseObject can be triggered.",
|
||||
EV_NORMAL
|
||||
|
||||
);
|
||||
Event EV_UseObject_Cone
|
||||
(
|
||||
@@ -1545,6 +1517,7 @@ Event EV_UseObject_Cone
|
||||
"newCone",
|
||||
"Sets the cone in angles of where the Useobject can be used.",
|
||||
EV_NORMAL
|
||||
|
||||
);
|
||||
Event EV_UseObject_Offset
|
||||
(
|
||||
@@ -1554,6 +1527,7 @@ Event EV_UseObject_Offset
|
||||
"newOffset",
|
||||
"Sets the offset to use for this UseObject.",
|
||||
EV_NORMAL
|
||||
|
||||
);
|
||||
Event EV_UseObject_YawOffset
|
||||
(
|
||||
@@ -1563,6 +1537,7 @@ Event EV_UseObject_YawOffset
|
||||
"newYawOffset",
|
||||
"Sets the yaw offset to use for this UseObject.",
|
||||
EV_NORMAL
|
||||
|
||||
);
|
||||
Event EV_UseObject_State
|
||||
(
|
||||
@@ -1581,6 +1556,7 @@ Event EV_UseObject_StateBackwards
|
||||
"newState",
|
||||
"Sets the backward state to use for this UseObject.",
|
||||
EV_NORMAL
|
||||
|
||||
);
|
||||
Event EV_UseObject_TriggerTarget
|
||||
(
|
||||
@@ -1626,6 +1602,7 @@ Event EV_UseObject_Resetting
|
||||
NULL,
|
||||
"Intermediate function for useobject reset.",
|
||||
EV_NORMAL
|
||||
|
||||
);
|
||||
Event EV_UseObject_DamageTriggered
|
||||
(
|
||||
@@ -1662,6 +1639,7 @@ Event EV_UseObject_UseMaterial
|
||||
"nameOfUseMaterial",
|
||||
"the name of the material that glows when active.",
|
||||
EV_NORMAL
|
||||
|
||||
);
|
||||
Event EV_UseObject_SetActiveState
|
||||
(
|
||||
@@ -1671,6 +1649,7 @@ Event EV_UseObject_SetActiveState
|
||||
NULL,
|
||||
"event that sets up the proper skin for the useobject.",
|
||||
EV_NORMAL
|
||||
|
||||
);
|
||||
|
||||
#define MULTI_STATE (1 << 0)
|
||||
@@ -1821,87 +1800,73 @@ void UseObject::SetActiveState(Event *ev)
|
||||
}
|
||||
|
||||
void UseObject::SetMoveThread(Event *ev)
|
||||
|
||||
{
|
||||
move_thread.SetThread(ev->GetValue(1));
|
||||
}
|
||||
|
||||
void UseObject::SetStopThread(Event *ev)
|
||||
|
||||
{
|
||||
stop_thread.SetThread(ev->GetValue(1));
|
||||
}
|
||||
|
||||
void UseObject::SetResetThread(Event *ev)
|
||||
|
||||
{
|
||||
reset_thread.SetThread(ev->GetValue(1));
|
||||
}
|
||||
|
||||
void UseObject::ActivateEvent(Event *ev)
|
||||
|
||||
{
|
||||
active = qtrue;
|
||||
PostEvent(EV_UseObject_SetActiveState, 0);
|
||||
}
|
||||
|
||||
void UseObject::DeactivateEvent(Event *ev)
|
||||
|
||||
{
|
||||
active = qfalse;
|
||||
PostEvent(EV_UseObject_SetActiveState, 0);
|
||||
}
|
||||
|
||||
void UseObject::SetTriggerTarget(Event *ev)
|
||||
|
||||
{
|
||||
triggertarget = ev->GetString(1);
|
||||
}
|
||||
|
||||
void UseObject::SetOffset(Event *ev)
|
||||
|
||||
{
|
||||
offset = ev->GetVector(1);
|
||||
}
|
||||
|
||||
void UseObject::SetYawOffset(Event *ev)
|
||||
|
||||
{
|
||||
yaw_offset = ev->GetFloat(1);
|
||||
}
|
||||
|
||||
void UseObject::SetCount(Event *ev)
|
||||
|
||||
{
|
||||
count = ev->GetInteger(1);
|
||||
}
|
||||
|
||||
void UseObject::SetCone(Event *ev)
|
||||
|
||||
{
|
||||
cone = cos(DEG2RAD(ev->GetFloat(1)));
|
||||
}
|
||||
|
||||
void UseObject::SetState(Event *ev)
|
||||
|
||||
{
|
||||
state = ev->GetString(1);
|
||||
}
|
||||
|
||||
void UseObject::SetBackwardsState(Event *ev)
|
||||
|
||||
{
|
||||
state_backwards = ev->GetString(1);
|
||||
}
|
||||
|
||||
void UseObject::UseMaterialEvent(Event *ev)
|
||||
|
||||
{
|
||||
useMaterial = ev->GetString(1);
|
||||
}
|
||||
|
||||
void UseObject::SetResetTime(Event *ev)
|
||||
|
||||
{
|
||||
reset_time = ev->GetFloat(1);
|
||||
}
|
||||
@@ -1912,7 +1877,6 @@ void UseObject::Reset(Event *ev)
|
||||
}
|
||||
|
||||
void UseObject::Resetting(Event *ev)
|
||||
|
||||
{
|
||||
SetActiveState(NULL);
|
||||
NewAnim("start");
|
||||
@@ -1948,7 +1912,6 @@ void UseObject::Resetting(Event *ev)
|
||||
}
|
||||
|
||||
bool UseObject::canBeUsed(Vector org, Vector dir)
|
||||
|
||||
{
|
||||
float dot;
|
||||
Vector forward;
|
||||
@@ -1992,7 +1955,6 @@ bool UseObject::canBeUsed(Vector org, Vector dir)
|
||||
}
|
||||
|
||||
void UseObject::DamageFunc(Event *ev)
|
||||
|
||||
{
|
||||
Event *e;
|
||||
Entity *attacker;
|
||||
@@ -2029,14 +1991,12 @@ void UseObject::DamageFunc(Event *ev)
|
||||
}
|
||||
|
||||
void UseObject::DamageTriggered(Event *ev)
|
||||
|
||||
{
|
||||
// grab the attacker from our event
|
||||
Stop(ev->GetEntity(1));
|
||||
}
|
||||
|
||||
void UseObject::Setup(Entity *activator, Vector *org, Vector *ang, str *newstate)
|
||||
|
||||
{
|
||||
if ((spawnflags & MULTI_STATE) && objectState) {
|
||||
*newstate = state_backwards;
|
||||
@@ -2060,7 +2020,6 @@ void UseObject::Setup(Entity *activator, Vector *org, Vector *ang, str *newstate
|
||||
}
|
||||
|
||||
void UseObject::Start(Event *ev)
|
||||
|
||||
{
|
||||
//
|
||||
// fire off the move_thread
|
||||
@@ -2079,7 +2038,6 @@ void UseObject::Start(Event *ev)
|
||||
}
|
||||
|
||||
bool UseObject::Loop(void)
|
||||
|
||||
{
|
||||
if (!count) {
|
||||
return qfalse;
|
||||
@@ -2089,7 +2047,6 @@ bool UseObject::Loop(void)
|
||||
}
|
||||
|
||||
void UseObject::Stop(Entity *activator)
|
||||
|
||||
{
|
||||
if ((spawnflags & MULTI_STATE) && objectState) {
|
||||
NewAnim("start");
|
||||
@@ -2222,7 +2179,6 @@ MonkeyBars::MonkeyBars()
|
||||
}
|
||||
|
||||
void MonkeyBars::SetAngleEvent(Event *ev)
|
||||
|
||||
{
|
||||
dir = ev->GetFloat(1);
|
||||
}
|
||||
@@ -2252,7 +2208,6 @@ HorizontalPipe::HorizontalPipe()
|
||||
}
|
||||
|
||||
void HorizontalPipe::SetAngleEvent(Event *ev)
|
||||
|
||||
{
|
||||
dir = ev->GetFloat(1);
|
||||
}
|
||||
@@ -2263,14 +2218,15 @@ void HorizontalPipe::SetAngleEvent(Event *ev)
|
||||
|
||||
Event EV_TossObject_SetBounceSound
|
||||
(
|
||||
"bouncesound", EV_DEFAULT,
|
||||
"bouncesound",
|
||||
EV_DEFAULT,
|
||||
"s",
|
||||
"sound",
|
||||
"When bouncing, what sound to play on impact",
|
||||
EV_NORMAL
|
||||
|
||||
);
|
||||
Event EV_TossObject_SetBounceSoundChance
|
||||
(
|
||||
Event EV_TossObject_SetBounceSoundChance(
|
||||
"bouncesoundchance",
|
||||
EV_DEFAULT,
|
||||
"f[0,1]",
|
||||
@@ -2309,31 +2265,26 @@ TossObject::TossObject(str model)
|
||||
}
|
||||
|
||||
void TossObject::SetBounceSound(str bounce)
|
||||
|
||||
{
|
||||
bouncesound = bounce;
|
||||
}
|
||||
|
||||
void TossObject::SetBounceSound(Event *ev)
|
||||
|
||||
{
|
||||
bouncesound = ev->GetString(1);
|
||||
}
|
||||
|
||||
void TossObject::SetBounceSoundChance(float chance)
|
||||
|
||||
{
|
||||
bouncesoundchance = chance;
|
||||
}
|
||||
|
||||
void TossObject::SetBounceSoundChance(Event *ev)
|
||||
|
||||
{
|
||||
bouncesoundchance = ev->GetFloat(1);
|
||||
}
|
||||
|
||||
void TossObject::Stop(Event *ev)
|
||||
|
||||
{
|
||||
setMoveType(MOVETYPE_NONE);
|
||||
setSolidType(SOLID_NOT);
|
||||
@@ -2345,7 +2296,6 @@ void TossObject::Stop(Event *ev)
|
||||
}
|
||||
|
||||
void TossObject::Touch(Event *ev)
|
||||
|
||||
{
|
||||
Entity *ent;
|
||||
|
||||
@@ -2368,7 +2318,6 @@ void TossObject::Touch(Event *ev)
|
||||
}
|
||||
|
||||
void TossObject::SetVelocity(float severity)
|
||||
|
||||
{
|
||||
setSolidType(SOLID_BBOX);
|
||||
velocity[0] = 100.0 * crandom();
|
||||
@@ -2413,8 +2362,7 @@ Pushable object
|
||||
|
||||
Event EV_PushObject_Start
|
||||
(
|
||||
"start",
|
||||
EV_DEFAULT,
|
||||
"start", EV_DEFAULT,
|
||||
NULL,
|
||||
NULL,
|
||||
"Sets up the pushobject.",
|
||||
@@ -2423,8 +2371,7 @@ Event EV_PushObject_Start
|
||||
|
||||
Event EV_PushObject_SetDamage
|
||||
(
|
||||
"dmg",
|
||||
EV_DEFAULT,
|
||||
"dmg", EV_DEFAULT,
|
||||
"i",
|
||||
"damage",
|
||||
"Set the damage.",
|
||||
@@ -2433,8 +2380,7 @@ Event EV_PushObject_SetDamage
|
||||
|
||||
Event EV_PushObject_SetPushSound
|
||||
(
|
||||
"pushsound",
|
||||
EV_DEFAULT,
|
||||
"pushsound", EV_DEFAULT,
|
||||
"s",
|
||||
"sound",
|
||||
"Set the pushing sound",
|
||||
@@ -2464,13 +2410,11 @@ PushObject::PushObject()
|
||||
}
|
||||
|
||||
void PushObject::SetPushSound(Event *ev)
|
||||
|
||||
{
|
||||
pushsound = ev->GetString(1);
|
||||
}
|
||||
|
||||
void PushObject::Start(Event *ev)
|
||||
|
||||
{
|
||||
// make sure that this touches triggers
|
||||
flags |= FL_TOUCH_TRIGGERS;
|
||||
@@ -2483,7 +2427,6 @@ void PushObject::Start(Event *ev)
|
||||
}
|
||||
|
||||
qboolean PushObject::canPush(Vector dir)
|
||||
|
||||
{
|
||||
trace_t trace;
|
||||
|
||||
@@ -2494,7 +2437,6 @@ qboolean PushObject::canPush(Vector dir)
|
||||
}
|
||||
|
||||
qboolean PushObject::Push(Entity *pusher, Vector move)
|
||||
|
||||
{
|
||||
trace_t trace;
|
||||
|
||||
@@ -2524,13 +2466,11 @@ qboolean PushObject::Push(Entity *pusher, Vector move)
|
||||
}
|
||||
|
||||
Entity *PushObject::getOwner(void)
|
||||
|
||||
{
|
||||
return (Entity *)owner;
|
||||
}
|
||||
|
||||
void PushObject::BlockFunc(Event *ev)
|
||||
|
||||
{
|
||||
Entity *other;
|
||||
|
||||
@@ -2544,7 +2484,6 @@ void PushObject::BlockFunc(Event *ev)
|
||||
}
|
||||
|
||||
void PushObject::SetDamage(Event *ev)
|
||||
|
||||
{
|
||||
dmg = ev->GetInteger(1);
|
||||
}
|
||||
@@ -2632,6 +2571,7 @@ Event EV_FallingRock_SetBounceSound
|
||||
"sound",
|
||||
"Set the sound to play when the rock bounces",
|
||||
EV_NORMAL
|
||||
|
||||
);
|
||||
|
||||
CLASS_DECLARATION(Entity, FallingRock, "func_fallingrock") {
|
||||
@@ -2666,7 +2606,6 @@ FallingRock::FallingRock()
|
||||
}
|
||||
|
||||
Entity *FallingRock::SetNextBounceDir(void)
|
||||
|
||||
{
|
||||
Entity *ent;
|
||||
|
||||
@@ -2686,7 +2625,6 @@ Entity *FallingRock::SetNextBounceDir(void)
|
||||
}
|
||||
|
||||
void FallingRock::NextBounce(void)
|
||||
|
||||
{
|
||||
float time;
|
||||
float distance;
|
||||
@@ -2729,7 +2667,6 @@ void FallingRock::NextBounce(void)
|
||||
}
|
||||
|
||||
void FallingRock::Rotate(Event *ev)
|
||||
|
||||
{
|
||||
float mat[3][3];
|
||||
float ang;
|
||||
@@ -2747,19 +2684,16 @@ void FallingRock::Rotate(Event *ev)
|
||||
}
|
||||
|
||||
void FallingRock::SetWait(Event *ev)
|
||||
|
||||
{
|
||||
wait = ev->GetFloat(1);
|
||||
}
|
||||
|
||||
void FallingRock::SetSpeed(Event *ev)
|
||||
|
||||
{
|
||||
speed = ev->GetFloat(1);
|
||||
}
|
||||
|
||||
void FallingRock::SetDmg(Event *ev)
|
||||
|
||||
{
|
||||
dmg = ev->GetInteger(1);
|
||||
}
|
||||
@@ -2772,13 +2706,11 @@ void FallingRock::SetBounceSound(str sound)
|
||||
}
|
||||
|
||||
void FallingRock::SetBounceSound(Event *ev)
|
||||
|
||||
{
|
||||
SetBounceSound(ev->GetString(1));
|
||||
}
|
||||
|
||||
void FallingRock::Activate(Event *ev)
|
||||
|
||||
{
|
||||
if (active == 1) {
|
||||
return;
|
||||
@@ -2802,7 +2734,6 @@ void FallingRock::Activate(Event *ev)
|
||||
}
|
||||
|
||||
void FallingRock::StartFalling(Event *ev)
|
||||
|
||||
{
|
||||
if (current) {
|
||||
return;
|
||||
@@ -2827,7 +2758,6 @@ void FallingRock::StartFalling(Event *ev)
|
||||
}
|
||||
|
||||
void FallingRock::Touch(Event *ev)
|
||||
|
||||
{
|
||||
Entity *other;
|
||||
|
||||
@@ -2858,7 +2788,6 @@ void FallingRock::Touch(Event *ev)
|
||||
}
|
||||
|
||||
void FallingRock::Bounce(Event *ev)
|
||||
|
||||
{
|
||||
Vector delta;
|
||||
|
||||
@@ -3155,10 +3084,19 @@ void FuncLadder::EnsureForwardOffLadder(Entity *pUser)
|
||||
pUser->setOrigin(trace.endpos);
|
||||
}
|
||||
|
||||
const Vector& FuncLadder::getFacingAngles() const
|
||||
{
|
||||
return m_vFacingAngles;
|
||||
}
|
||||
|
||||
const Vector& FuncLadder::getFacingDir() const
|
||||
{
|
||||
return m_vFacingDir;
|
||||
}
|
||||
|
||||
Event EV_InfoLandmark_Name
|
||||
(
|
||||
"landmark_name",
|
||||
EV_DEFAULT,
|
||||
"landmark_name", EV_DEFAULT,
|
||||
"s",
|
||||
"name",
|
||||
"Set the name of this landmark",
|
||||
@@ -3166,8 +3104,7 @@ Event EV_InfoLandmark_Name
|
||||
);
|
||||
Event EV_InfoLandmark_SetOrigin
|
||||
(
|
||||
"origin",
|
||||
EV_DEFAULT,
|
||||
"origin", EV_DEFAULT,
|
||||
"v",
|
||||
"origin",
|
||||
"Set the origin of the landmark.",
|
||||
|
||||
+4
-1
@@ -1,6 +1,6 @@
|
||||
/*
|
||||
===========================================================================
|
||||
Copyright (C) 2023 the OpenMoHAA team
|
||||
Copyright (C) 2025 the OpenMoHAA team
|
||||
|
||||
This file is part of OpenMoHAA source code.
|
||||
|
||||
@@ -565,6 +565,9 @@ public:
|
||||
void EnsureOverLadder(Entity *pUser);
|
||||
void EnsureForwardOffLadder(Entity *pUser);
|
||||
|
||||
const Vector& getFacingAngles() const;
|
||||
const Vector& getFacingDir() const;
|
||||
|
||||
void Archive(Archiver& arc) override;
|
||||
};
|
||||
|
||||
|
||||
+22
-1
@@ -1,6 +1,6 @@
|
||||
/*
|
||||
===========================================================================
|
||||
Copyright (C) 2024 the OpenMoHAA team
|
||||
Copyright (C) 2025 the OpenMoHAA team
|
||||
|
||||
This file is part of OpenMoHAA source code.
|
||||
|
||||
@@ -250,3 +250,24 @@ void Mover::LinearInterpolate(Vector tdest, Vector angdest, float time, Event& e
|
||||
|
||||
PostEvent(EV_MoveDone, time);
|
||||
}
|
||||
|
||||
/*
|
||||
=============
|
||||
Stop
|
||||
===============
|
||||
*/
|
||||
void Mover::Stop()
|
||||
{
|
||||
if (endevent) {
|
||||
delete endevent;
|
||||
endevent = NULL;
|
||||
}
|
||||
|
||||
CancelEventsOfType(EV_MoveDone);
|
||||
|
||||
moveflags = 0;
|
||||
avelocity = vec_zero;
|
||||
velocity = vec_zero;
|
||||
accel = vec_zero;
|
||||
aaccel = vec_zero;
|
||||
}
|
||||
+2
-1
@@ -1,6 +1,6 @@
|
||||
/*
|
||||
===========================================================================
|
||||
Copyright (C) 2024 the OpenMoHAA team
|
||||
Copyright (C) 2025 the OpenMoHAA team
|
||||
|
||||
This file is part of OpenMoHAA source code.
|
||||
|
||||
@@ -48,6 +48,7 @@ public:
|
||||
void MoveDone(Event *ev);
|
||||
void MoveTo(Vector tdest, Vector angdest, float tspeed, Event& event);
|
||||
void LinearInterpolate(Vector tdest, Vector angdest, float time, Event& event);
|
||||
void Stop();
|
||||
void Archive(Archiver& arc) override;
|
||||
};
|
||||
|
||||
|
||||
@@ -1001,7 +1001,7 @@ PathNode *PathSearch::FindCornerNodeForWall(
|
||||
|
||||
PathNode *PathSearch::FindCornerNodeForExactPath(Entity *pSelf, Sentient *enemy, float fMaxPath)
|
||||
{
|
||||
PathNode *pPathNode[4096];
|
||||
PathNode *pPathNode[MAX_PATHNODES];
|
||||
PathNode *pParentNode;
|
||||
size_t i, iDepth;
|
||||
Vector vEnd;
|
||||
@@ -1554,7 +1554,7 @@ void DrawNode(int iNodeCount)
|
||||
Vector aStart;
|
||||
Vector aEnd;
|
||||
PathNode *node;
|
||||
PathNode *nodelist[4096];
|
||||
PathNode *nodelist[MAX_PATHNODES];
|
||||
Vector end;
|
||||
Vector start;
|
||||
Vector p;
|
||||
@@ -1562,8 +1562,8 @@ void DrawNode(int iNodeCount)
|
||||
|
||||
playerorigin = g_entities[0].client->ps.origin;
|
||||
|
||||
if (iNodeCount > 4096) {
|
||||
iNodeCount = 4096;
|
||||
if (iNodeCount > MAX_PATHNODES) {
|
||||
iNodeCount = MAX_PATHNODES;
|
||||
}
|
||||
|
||||
if (ai_showallnode->integer) {
|
||||
@@ -2500,7 +2500,10 @@ PathNode *PathSearch::FindNearestSniperNode(Entity*pEnt, Vector& vPos, Entity *p
|
||||
|
||||
PathNode *PathSearch::GetSpawnNode(ClassDef *cls)
|
||||
{
|
||||
if (m_bNodesloaded) {
|
||||
if (m_bNodesloaded
|
||||
// Fixed in OPM
|
||||
&& m_LoadIndex < nodecount
|
||||
) {
|
||||
return pathnodes[m_LoadIndex++];
|
||||
} else {
|
||||
// Otherwise create a new node
|
||||
|
||||
@@ -252,7 +252,7 @@ private:
|
||||
static int m_LoadIndex;
|
||||
|
||||
public:
|
||||
static PathNode *pathnodes[4096];
|
||||
static PathNode *pathnodes[MAX_PATHNODES];
|
||||
static int nodecount;
|
||||
static float total_dist;
|
||||
static const char *last_error;
|
||||
|
||||
Loaded 100 of 538 files, more files were not shown because too many files have changed in this diff.
Show more
Reference in new issue
Block a user