mirror of
https://github.com/openmoh/openmohaa.git
synced 2025-04-28 21:57:57 +03:00
Compare commits
2232 commits
Author | SHA1 | Date | |
---|---|---|---|
![]() |
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 | ||
![]() |
efeda23627 | ||
![]() |
465d462756 | ||
![]() |
df22895b94 | ||
![]() |
6b2160c876 | ||
![]() |
088b44e2cc | ||
![]() |
3f299610fc | ||
![]() |
713e361d85 | ||
![]() |
869075f47b | ||
![]() |
a067c58b3d | ||
![]() |
b16aaa5adc | ||
![]() |
f4a412cc24 | ||
![]() |
d83ad43b0b | ||
![]() |
aa9847cf90 | ||
![]() |
18a3658935 | ||
![]() |
716a574abe | ||
![]() |
e0dee12578 | ||
![]() |
04b1e88077 | ||
![]() |
51a2f7d479 | ||
![]() |
2656000ce4 | ||
![]() |
4ec10af1fd | ||
![]() |
78cd0cf28b | ||
![]() |
3e9d2bf89a | ||
![]() |
ebe9795bba | ||
![]() |
3f2c2f7aa4 | ||
![]() |
583c2720e2 | ||
![]() |
47d6843b70 | ||
![]() |
25fd01c46b | ||
![]() |
963b2a2bbd | ||
![]() |
7274ceb0ff | ||
![]() |
cb1c3c0b1c | ||
![]() |
da5c35ec2b | ||
![]() |
515beeafa7 | ||
![]() |
37f5f64ef3 | ||
![]() |
85c401496a | ||
![]() |
07f7c557ce | ||
![]() |
31278fba92 | ||
![]() |
a32a9e8ae8 | ||
![]() |
70dc1820db | ||
![]() |
a760cb75a3 | ||
![]() |
1d0b912f75 | ||
![]() |
439e0718ce | ||
![]() |
4c57ba6ef3 | ||
![]() |
b4bae40da8 | ||
![]() |
e04cbd57ea | ||
![]() |
66664b7b46 | ||
![]() |
546b90d75f | ||
![]() |
14e83a52a4 | ||
![]() |
dc9fec9d03 | ||
![]() |
6d21d52d3e | ||
![]() |
3afb87486b | ||
![]() |
d0c0a55e6d | ||
![]() |
1919b0efcb | ||
![]() |
954d096261 | ||
![]() |
7e150c7a8a | ||
![]() |
77646bda78 | ||
![]() |
e6848a3ab0 | ||
![]() |
011f49616b | ||
![]() |
e1be3c0fd1 | ||
![]() |
3d950764a2 | ||
![]() |
fe16f999d8 | ||
![]() |
390c1d3f3d | ||
![]() |
49b5c29c11 | ||
![]() |
f86b495cc6 | ||
![]() |
a4d0a96ce5 | ||
![]() |
9d4ea75a18 | ||
![]() |
38427fa3c5 | ||
![]() |
7d369dec74 | ||
![]() |
58bef33bc7 | ||
![]() |
bd021b109c | ||
![]() |
7e15c2ac1b | ||
![]() |
3b1b994152 | ||
![]() |
4e69d7a78a | ||
![]() |
16166a36b5 | ||
![]() |
bcbe7cd870 | ||
![]() |
8dba91fbcc | ||
![]() |
29fe5780e9 | ||
![]() |
12686c0ab1 | ||
![]() |
a21d712f54 | ||
![]() |
2c7d18b331 | ||
![]() |
e353673005 | ||
![]() |
6b36bec8e9 | ||
![]() |
1be50cdddf | ||
![]() |
869b257bf8 | ||
![]() |
f165ebf9a3 | ||
![]() |
a6c168c289 | ||
![]() |
0057a8273c | ||
![]() |
876829a742 | ||
![]() |
f4519325ce | ||
![]() |
932367d061 | ||
![]() |
79643d963e | ||
![]() |
872b3f5d70 | ||
![]() |
ac4138a763 | ||
![]() |
0765537d29 | ||
![]() |
f2f9ba9f83 | ||
![]() |
20c1fab815 | ||
![]() |
d3fb1331f8 | ||
![]() |
13eafb9bf1 | ||
![]() |
1ef61a6e3d | ||
![]() |
0fb80a4ab5 | ||
![]() |
981b12b63d | ||
![]() |
508ee871b9 | ||
![]() |
c293a52f7a | ||
![]() |
acf2dd0ad1 | ||
![]() |
32bee2602c | ||
![]() |
d5ec17ec26 | ||
![]() |
e53c6b55bf | ||
![]() |
85da9fabdd | ||
![]() |
e15440af5e | ||
![]() |
26c2225a24 | ||
![]() |
cd06dc0535 | ||
![]() |
1b8ef411ee | ||
![]() |
95466b810f | ||
![]() |
0a41f3bb76 | ||
![]() |
9b247a746c | ||
![]() |
fcdde53774 | ||
![]() |
279cfb364b | ||
![]() |
3dcb2cad64 | ||
![]() |
a199188ede | ||
![]() |
8a84436d1b | ||
![]() |
231553f574 | ||
![]() |
37466cdffb | ||
![]() |
3cc417151d | ||
![]() |
d26718a711 | ||
![]() |
0644bc2967 | ||
![]() |
a2e4f1dc25 | ||
![]() |
9c952ab49d | ||
![]() |
aa52fe73a5 | ||
![]() |
fee6390281 | ||
![]() |
835ddb1de3 | ||
![]() |
b58f031bcc | ||
![]() |
3897a44ce6 | ||
![]() |
1ec88142b9 | ||
![]() |
70a5dde726 | ||
![]() |
f684349c18 | ||
![]() |
a08a9a4f10 | ||
![]() |
f719b87e69 | ||
![]() |
af1cbea966 | ||
![]() |
f3f53947bc | ||
![]() |
f0cc34cccf | ||
![]() |
c4a1175ad0 | ||
![]() |
333c452f44 | ||
![]() |
5801af34bb | ||
![]() |
da0c36cc88 | ||
![]() |
d8d98ade6a | ||
![]() |
c3157ad4d7 | ||
![]() |
6f686cb7fa | ||
![]() |
39981643a8 | ||
![]() |
28bdd1b2b3 | ||
![]() |
35f40e949b | ||
![]() |
115b7b82aa | ||
![]() |
d7c0ee47fe | ||
![]() |
0559d643b7 | ||
![]() |
8446a655bb | ||
![]() |
01d098dab5 | ||
![]() |
b6dd3914be | ||
![]() |
c2e45710ad | ||
![]() |
5da24a8ab5 | ||
![]() |
ac6b274a4f | ||
![]() |
f703ee2f26 | ||
![]() |
70b8f9868e | ||
![]() |
c69bafeb3f | ||
![]() |
f7c8c745c4 | ||
![]() |
861338b0fc | ||
![]() |
499fe44bde | ||
![]() |
ba74943844 | ||
![]() |
21f631e733 | ||
![]() |
b5c32a41de | ||
![]() |
c9373cbc97 | ||
![]() |
b5a73384d3 | ||
![]() |
4f699f3b58 | ||
![]() |
4ea598d76b | ||
![]() |
7e6b0a1c2b | ||
![]() |
d884512a76 | ||
![]() |
71450fb36e | ||
![]() |
4775f29194 | ||
![]() |
d5d5c7a55d | ||
![]() |
aa74934ae0 | ||
![]() |
0534482c22 | ||
![]() |
6fe1e86b31 | ||
![]() |
47983481c9 | ||
![]() |
383bc60ddb | ||
![]() |
d834f08cad | ||
![]() |
387ccd5cc3 | ||
![]() |
0fb775cd60 | ||
![]() |
f31ea39331 | ||
![]() |
56cc3fff53 | ||
![]() |
5f33a617ab | ||
![]() |
b3da62f77e | ||
![]() |
f1e5d02169 | ||
![]() |
7cad7a4bd0 | ||
![]() |
83a874e4fd | ||
![]() |
6eab2ddd57 | ||
![]() |
d944b4a21e | ||
![]() |
58f0245e83 | ||
![]() |
2f8382f100 | ||
![]() |
167bd45a6a | ||
![]() |
1e9decf193 | ||
![]() |
459e13dc76 | ||
![]() |
94e3d95d6c | ||
![]() |
eeb9139024 | ||
![]() |
486b6f40e5 | ||
![]() |
d3fdaa060a | ||
![]() |
766258e84b | ||
![]() |
8213bf41a8 | ||
![]() |
8843a8ee15 | ||
![]() |
6bb09256c5 | ||
![]() |
b2e6e1b56f | ||
![]() |
6b402e5215 | ||
![]() |
04baf673dc | ||
![]() |
10b7651eff | ||
![]() |
4f76d7291f | ||
![]() |
1c2be68253 | ||
![]() |
6c9d6940cc | ||
![]() |
b719455b78 | ||
![]() |
db16c8bea4 | ||
![]() |
abdaecb28d | ||
![]() |
586da44c30 | ||
![]() |
3956e03557 | ||
![]() |
8d0b7b77c6 | ||
![]() |
23ad991743 | ||
![]() |
4493b2c42e | ||
![]() |
8b6b1597d7 | ||
![]() |
dddedba721 | ||
![]() |
be34870a18 | ||
![]() |
4d4b9288c6 | ||
![]() |
fc9be91124 | ||
![]() |
0d24c620fb | ||
![]() |
89140f775e | ||
![]() |
de6718b511 | ||
![]() |
5c094f9c8a | ||
![]() |
e2f4d8cd6b | ||
![]() |
04da76167c | ||
![]() |
90639cee36 | ||
![]() |
ecfdcca4d5 | ||
![]() |
3790f057e1 | ||
![]() |
44d8adcfb0 | ||
![]() |
64f877ae80 | ||
![]() |
2ce8450a7e | ||
![]() |
7e7b3ab280 | ||
![]() |
48c2d026e6 | ||
![]() |
ad825f5114 | ||
![]() |
120a486aea | ||
![]() |
864cdf1fc6 | ||
![]() |
f1c12e0649 | ||
![]() |
58d8a73269 | ||
![]() |
c788d57c52 | ||
![]() |
50eda4156a | ||
![]() |
1e609a4b2f | ||
![]() |
a0e2162dd7 | ||
![]() |
01dfbcdbfe | ||
![]() |
862af012cb | ||
![]() |
d83374d38c | ||
![]() |
05e14f6364 | ||
![]() |
6bc621462c | ||
![]() |
acb08b89f7 | ||
![]() |
2107523eda | ||
![]() |
2662174eba | ||
![]() |
59d03ff6f0 | ||
![]() |
05d304dfc3 | ||
![]() |
614ed6e632 | ||
![]() |
eb938c872d | ||
![]() |
46e1aa979b | ||
![]() |
ec5acb4d98 | ||
![]() |
b237222761 | ||
![]() |
652df1a5af | ||
![]() |
69621335db | ||
![]() |
7b58fbec8a | ||
![]() |
aeb8aa8e55 | ||
![]() |
e74e113199 | ||
![]() |
953091cdc8 | ||
![]() |
5819145af8 | ||
![]() |
154464cda1 | ||
![]() |
2342f08a79 | ||
![]() |
16711a33ef | ||
![]() |
cea0d95fee | ||
![]() |
989ec9574c | ||
![]() |
b0b82f0252 | ||
![]() |
80ddba1013 | ||
![]() |
23f776d3c7 | ||
![]() |
880acf9120 | ||
![]() |
598110477e | ||
![]() |
ffdfbc3c7d | ||
![]() |
a7dc8b3493 | ||
![]() |
67d8cad64d | ||
![]() |
b007842fb4 | ||
![]() |
2c4b5fc9ba | ||
![]() |
e96a3f4f59 | ||
![]() |
8eded28efc | ||
![]() |
b68bb4cee7 | ||
![]() |
824cfd789c | ||
![]() |
a0b80a9096 | ||
![]() |
857d25825b | ||
![]() |
735832829d | ||
![]() |
5703161166 | ||
![]() |
d85455e9ec | ||
![]() |
f6c9de4286 | ||
![]() |
a598cbf0dc | ||
![]() |
67b285924c | ||
![]() |
0c206beb45 | ||
![]() |
9a6472210c | ||
![]() |
7576d1241d | ||
![]() |
fb2f3bddaa | ||
![]() |
96ca9c20e4 | ||
![]() |
d01fa33e46 | ||
![]() |
ab84a6ea58 | ||
![]() |
b0a683c188 | ||
![]() |
e5ef61c5d2 | ||
![]() |
02af9a763d | ||
![]() |
132903a843 | ||
![]() |
fe862badf6 | ||
![]() |
1ad5964c2f | ||
![]() |
851a16e18c | ||
![]() |
763a79cb74 | ||
![]() |
c9ccb0efaf | ||
![]() |
9e060d11b6 | ||
![]() |
50fdbaf152 | ||
![]() |
ccca958ec5 | ||
![]() |
dd37ba2741 | ||
![]() |
81b49236a5 | ||
![]() |
894e1d7d66 | ||
![]() |
9d83d58756 | ||
![]() |
54b9a0c340 | ||
![]() |
2cf380c15d | ||
![]() |
d400d8927d | ||
![]() |
fef30ff3d5 | ||
![]() |
4023c9d863 | ||
![]() |
7bcb91bbb5 | ||
![]() |
5edee7d12e | ||
![]() |
51c7e27bc1 | ||
![]() |
f400190531 | ||
![]() |
8732e368b6 | ||
![]() |
7e4da514f6 | ||
![]() |
9a55939b42 | ||
![]() |
cd89d2c0b4 | ||
![]() |
661b08a7fa | ||
![]() |
d27f928e2d | ||
![]() |
079555e43a | ||
![]() |
fcc4e94655 | ||
![]() |
c5721f8a2c | ||
![]() |
e5acee55ea | ||
![]() |
d3f3b9b51c | ||
![]() |
48e9db8966 | ||
![]() |
67486f1e49 | ||
![]() |
923a6de394 | ||
![]() |
de0e4954f8 | ||
![]() |
1ef1bad9ae | ||
![]() |
23a035e2ca | ||
![]() |
ec73268f94 | ||
![]() |
2b06cc690e | ||
![]() |
7afc2427ac | ||
![]() |
f3bbcba4f0 | ||
![]() |
0dca08a66a | ||
![]() |
f646151ce2 | ||
![]() |
2e0e5db260 | ||
![]() |
f34aad03cd | ||
![]() |
332d209f62 | ||
![]() |
888e35466b | ||
![]() |
1f69fce10e | ||
![]() |
ac3eb58671 | ||
![]() |
14f3e2faf9 | ||
![]() |
a528e916c2 | ||
![]() |
e6f83bc1d6 | ||
![]() |
841a8d2b4a | ||
![]() |
a51c250a31 | ||
![]() |
c2291e92c4 | ||
![]() |
b8cc3313b1 | ||
![]() |
d1fca3e499 | ||
![]() |
66b882346f | ||
![]() |
b38fedb18c | ||
![]() |
e6559c6ae6 | ||
![]() |
772aad79d7 | ||
![]() |
3e84dbe6ac | ||
![]() |
381f2b02f5 | ||
![]() |
f347102ecb | ||
![]() |
f5d2fdbcad | ||
![]() |
ab037f1890 | ||
![]() |
a933c78d93 | ||
![]() |
d08f539e6d | ||
![]() |
caea6e6bba | ||
![]() |
6970e2d00c | ||
![]() |
af084542c4 | ||
![]() |
9f728580b6 | ||
![]() |
c25d0b668a | ||
![]() |
1e29fd7d2b | ||
![]() |
67f822d492 | ||
![]() |
effbbd6c62 | ||
![]() |
db802d1a4c | ||
![]() |
fba40370af | ||
![]() |
fc0ca18632 | ||
![]() |
059b0ba34f | ||
![]() |
e833b08a8e | ||
![]() |
afc431c413 | ||
![]() |
81e407a924 | ||
![]() |
1f232efdf3 | ||
![]() |
94e1830895 | ||
![]() |
406f804ef8 | ||
![]() |
437f20dfb9 | ||
![]() |
ff4438bce9 | ||
![]() |
5cb343730b | ||
![]() |
dacaaa2cef | ||
![]() |
2e6e20cf09 | ||
![]() |
2da379bade | ||
![]() |
cf8f755f6c | ||
![]() |
8114003c84 | ||
![]() |
bb47ba468c | ||
![]() |
b97c47ab32 | ||
![]() |
9042ea320c | ||
![]() |
98e725ef7b | ||
![]() |
05b2d3529e | ||
![]() |
00dbc74269 | ||
![]() |
8addeedf5e | ||
![]() |
bc834b021c | ||
![]() |
6bac4bd57a | ||
![]() |
51324aa8e9 | ||
![]() |
7d1d92980a | ||
![]() |
3d42197f50 | ||
![]() |
8a774c02dc | ||
![]() |
a644e8a09c | ||
![]() |
6f51427c7c | ||
![]() |
62bcf58d83 | ||
![]() |
f40f206161 | ||
![]() |
1235f42143 | ||
![]() |
1016bfa1ad | ||
![]() |
f9ce111784 | ||
![]() |
4c057faf73 | ||
![]() |
4f16179c09 | ||
![]() |
6991c9f9f7 | ||
![]() |
6e6dac0b74 | ||
![]() |
23f9c1a1e6 | ||
![]() |
e4b2c863d8 | ||
![]() |
ae16994289 | ||
![]() |
b8b17bb0c9 | ||
![]() |
3098fc98d3 | ||
![]() |
f3ecfd04da | ||
![]() |
0796fab24b | ||
![]() |
0fda31b430 | ||
![]() |
84a2b4be76 | ||
![]() |
5269fbb1fa | ||
![]() |
f23dfa091e | ||
![]() |
32c3964474 | ||
![]() |
6ff92f0a7e | ||
![]() |
c795b2390e | ||
![]() |
ce7005103c | ||
![]() |
1a18878f26 | ||
![]() |
1e036a7689 | ||
![]() |
858b27b809 | ||
![]() |
b4841a878b | ||
![]() |
4565b6a9a8 | ||
![]() |
9ffb407d11 | ||
![]() |
0f3ffa267a | ||
![]() |
74c8aa95f5 | ||
![]() |
4853235d86 | ||
![]() |
0d01ea939d | ||
![]() |
5ba6c006c2 | ||
![]() |
22e7d1e2e4 | ||
![]() |
c650af7b55 | ||
![]() |
2ce5e498ab | ||
![]() |
d3212c55a0 | ||
![]() |
becf9f5d8c | ||
![]() |
9cd8133068 | ||
![]() |
48fa5c0ce6 | ||
![]() |
6fc7199719 | ||
![]() |
9e04f94625 | ||
![]() |
c9b844b9ea | ||
![]() |
497058d7f4 | ||
![]() |
a509dd4692 | ||
![]() |
8fdfffab36 | ||
![]() |
aa118bceb3 | ||
![]() |
4da50a78d5 | ||
![]() |
4d27a6daa3 | ||
![]() |
b6f8997a01 | ||
![]() |
568efd4742 | ||
![]() |
bf68808eae | ||
![]() |
5cbd2dd988 | ||
![]() |
92b4ae2702 | ||
![]() |
a8cdf0b5ad | ||
![]() |
e8dfa0206b | ||
![]() |
afe1ba47cf | ||
![]() |
2afa9adceb | ||
![]() |
ef32200c8d | ||
![]() |
dae7795478 | ||
![]() |
7c96b68623 | ||
![]() |
558e69dba8 | ||
![]() |
da7cd03f09 | ||
![]() |
6934e5cff8 | ||
![]() |
c7cdde7bc2 | ||
![]() |
940ac789b9 | ||
![]() |
3d46bae1d0 | ||
![]() |
16bedf7e86 | ||
![]() |
2ee531511b | ||
![]() |
0ad5222946 | ||
![]() |
2b4aef4ea6 | ||
![]() |
679cf4b7ec | ||
![]() |
a993b8d352 | ||
![]() |
b7403347bb | ||
![]() |
bf978256e9 | ||
![]() |
9bd25e9734 | ||
![]() |
e7499cca04 | ||
![]() |
e2d6156b5a | ||
![]() |
31cb6216c9 | ||
![]() |
e75f5bbbfc | ||
![]() |
69cc87212a | ||
![]() |
3c1500002b | ||
![]() |
b2287f3d83 | ||
![]() |
005a278210 | ||
![]() |
976e2ae022 | ||
![]() |
8fe87e1067 | ||
![]() |
d142ded9ad | ||
![]() |
090f362bb6 | ||
![]() |
ff3c25cc07 | ||
![]() |
ed22a51a72 | ||
![]() |
9e0c11a970 | ||
![]() |
edb52a8448 | ||
![]() |
afb08e0ea9 | ||
![]() |
8758ba6cb1 | ||
![]() |
e6a9968d23 | ||
![]() |
fcd2d2e668 | ||
![]() |
991c8869d1 | ||
![]() |
aef9dc1704 | ||
![]() |
848cf7ac01 | ||
![]() |
de1d3b6ef4 | ||
![]() |
29f8ff8d71 | ||
![]() |
b641a1040c | ||
![]() |
83acdeb16e | ||
![]() |
aa2d73a1c8 | ||
![]() |
b7a643aa59 | ||
![]() |
3d454c90cb | ||
![]() |
590b3f5cbb | ||
![]() |
f87e6d5938 | ||
![]() |
901e81cdf5 | ||
![]() |
d2ed2f5e95 | ||
![]() |
c580ccdee1 | ||
![]() |
8ecbe1dd79 | ||
![]() |
64696c7645 | ||
![]() |
ff0dcbd786 | ||
![]() |
a3e5d62c96 | ||
![]() |
267e2f4b15 | ||
![]() |
d52bf52e6a | ||
![]() |
f5391bbfa0 | ||
![]() |
a218106c8b | ||
![]() |
8f54f4b806 | ||
![]() |
78b2637c66 | ||
![]() |
4b25e24a13 | ||
![]() |
aa0c704655 | ||
![]() |
4da099d15c | ||
![]() |
0bb11d76bd | ||
![]() |
c146452570 | ||
![]() |
ed05983a57 | ||
![]() |
909dc96c2f | ||
![]() |
863a6293e7 | ||
![]() |
7a49f6fc8b | ||
![]() |
c1433a6d9e | ||
![]() |
374b8b9ae7 | ||
![]() |
e2f5c80afc | ||
![]() |
29911380d1 | ||
![]() |
405a4bfe28 | ||
![]() |
87e41f0c21 | ||
![]() |
dce2bcca7c | ||
![]() |
00421a7666 | ||
![]() |
fd426926e9 | ||
![]() |
d83634f8a2 | ||
![]() |
6efac1c0f7 | ||
![]() |
3a68ca7f4b | ||
![]() |
8898919fd3 | ||
![]() |
40834380cf | ||
![]() |
18abf3854d | ||
![]() |
6d0b4f8cb7 | ||
![]() |
fc1f795e83 | ||
![]() |
ef09f136d4 | ||
![]() |
6136bbd019 | ||
![]() |
5136aa4886 | ||
![]() |
1a3122bef3 | ||
![]() |
23d7db814c | ||
![]() |
3174ca5da9 | ||
![]() |
6a107419e3 | ||
![]() |
6d69a8033f | ||
![]() |
bb9ccdd3b9 | ||
![]() |
5b3ce85695 | ||
![]() |
84c5bfa777 | ||
![]() |
d9166478e5 | ||
![]() |
373fe45b50 | ||
![]() |
cd83091101 | ||
![]() |
631abd2b0f | ||
![]() |
02df233205 | ||
![]() |
11e9d0f9ba | ||
![]() |
35fea91268 | ||
![]() |
6f3d79ae1b | ||
![]() |
32da07ea80 | ||
![]() |
e9a76f933b | ||
![]() |
6b6adf1147 | ||
![]() |
6413e770e1 | ||
![]() |
7d1067108b | ||
![]() |
e00ebda641 | ||
![]() |
2b6fc0602a | ||
![]() |
53c09b5342 | ||
![]() |
d78d8abb9f | ||
![]() |
f6b459b408 | ||
![]() |
581585a47c | ||
![]() |
ddbdcc91dd | ||
![]() |
8f8b75e0aa | ||
![]() |
2e673a6bc9 | ||
![]() |
8c2b92d151 | ||
![]() |
032fb9b5ba | ||
![]() |
b1c5d6c62a | ||
![]() |
037af5d728 | ||
![]() |
61a2b6a837 | ||
![]() |
13698a9590 | ||
![]() |
4f2907ef77 | ||
![]() |
8667d11c52 | ||
![]() |
24309095ff | ||
![]() |
d5a90ded17 | ||
![]() |
9d744367ac | ||
![]() |
46a46a9536 | ||
![]() |
224c1df553 | ||
![]() |
bcea5af30f | ||
![]() |
211ce09c0b | ||
![]() |
1e41a2595d | ||
![]() |
36a080b3a9 | ||
![]() |
a3050f6c64 | ||
![]() |
be5deddc1d | ||
![]() |
36f9bdb88c | ||
![]() |
1a33e9a15b | ||
![]() |
4157a49c7e | ||
![]() |
f27be7314e | ||
![]() |
a425038fa6 | ||
![]() |
0b07858bfc | ||
![]() |
7dbf1d7bf5 | ||
![]() |
34c44ab2cf | ||
![]() |
5ec106642d | ||
![]() |
dcd9ce91a8 | ||
![]() |
a05fbfe69b | ||
![]() |
feb76f4fb4 | ||
![]() |
d467b68187 | ||
![]() |
de18fa2860 | ||
![]() |
58f6c719a9 | ||
![]() |
b2fa21a111 | ||
![]() |
f94099e350 | ||
![]() |
e2f11879d5 | ||
![]() |
aa15b3ea7f | ||
![]() |
1624d10a01 | ||
![]() |
0d53adf9bd | ||
![]() |
295c267c31 | ||
![]() |
d4b3f7378e | ||
![]() |
a503e18966 | ||
![]() |
b1f7d641fc | ||
![]() |
5019d1e4f9 | ||
![]() |
2aa0205872 | ||
![]() |
a7befa8882 | ||
![]() |
a5058c7bab | ||
![]() |
f5558d106e | ||
![]() |
d19328230c | ||
![]() |
b77464386c | ||
![]() |
9119319429 | ||
![]() |
d3d85fded0 | ||
![]() |
9b9642df8f | ||
![]() |
e564a97b05 | ||
![]() |
a150cb5c6e | ||
![]() |
afd7943b62 | ||
![]() |
09eb130b6d | ||
![]() |
5869ba06bc | ||
![]() |
b6c2638c1b | ||
![]() |
16b0f0d625 | ||
![]() |
9293930628 | ||
![]() |
46935b165c | ||
![]() |
c0dd08f6e0 | ||
![]() |
1fde1647e8 | ||
![]() |
7ef006ccca | ||
![]() |
fd69d6b42c | ||
![]() |
627f66fb5b | ||
![]() |
8451c11916 | ||
![]() |
6bbbbcfb05 | ||
![]() |
63465278a5 | ||
![]() |
2980771deb | ||
![]() |
1169b84c2f | ||
![]() |
355491a950 | ||
![]() |
7caa0adbab | ||
![]() |
8acc51c489 | ||
![]() |
732fd98593 | ||
![]() |
21a610d22c | ||
![]() |
a379e6efbf | ||
![]() |
b1e1b6cc68 | ||
![]() |
da86e0ce34 | ||
![]() |
6ca12eb0de | ||
![]() |
a25442368b | ||
![]() |
e7e95d47a5 | ||
![]() |
292fe8eab4 | ||
![]() |
272a401189 | ||
![]() |
592e3f47e9 | ||
![]() |
cabf1a9043 | ||
![]() |
e623541861 | ||
![]() |
b74b6f8c1d | ||
![]() |
11abdd451f | ||
![]() |
1c3596b1f9 | ||
![]() |
1e73333fbe | ||
![]() |
6eb49f567a | ||
![]() |
0120e7e4a5 | ||
![]() |
10e4d3db11 | ||
![]() |
0b34d2dbb8 | ||
![]() |
be1ef1de0e | ||
![]() |
ef45c988c6 | ||
![]() |
3ecdee1b89 | ||
![]() |
c7561b1f6d | ||
![]() |
50a3df8dff | ||
![]() |
dfde4a58de | ||
![]() |
090ba308d8 | ||
![]() |
e01e989c22 | ||
![]() |
a9b4af98fc | ||
![]() |
30f5442728 | ||
![]() |
123ca2812a | ||
![]() |
95435ea512 | ||
![]() |
db625baadd | ||
![]() |
200a80aa02 | ||
![]() |
0472a93c3f | ||
![]() |
9b70e646dc | ||
![]() |
388ab210a7 | ||
![]() |
15e8a71249 | ||
![]() |
dfd04f0d41 | ||
![]() |
88ac49c0c9 | ||
![]() |
7d6ff3e6a4 | ||
![]() |
c68fbfacb9 | ||
![]() |
8e51c7ca3b | ||
![]() |
33064f8392 | ||
![]() |
40141465b5 | ||
![]() |
13d855c2e7 | ||
![]() |
2f8b6a2009 | ||
![]() |
23e56e767f | ||
![]() |
ce5b954c4d | ||
![]() |
a0c20663a0 | ||
![]() |
56f850b59d | ||
![]() |
253d4e2c4d | ||
![]() |
6fef42d6e0 | ||
![]() |
d6a00a5984 | ||
![]() |
26a1e24e3a | ||
![]() |
6103efa8cc | ||
![]() |
9a7ba0786c | ||
![]() |
935efaeb3a | ||
![]() |
020a6d8b66 | ||
![]() |
9dea8fc41e | ||
![]() |
3a7e249edf | ||
![]() |
c406aaf74f | ||
![]() |
83938471ca | ||
![]() |
db6ff8901b | ||
![]() |
737ee3af64 | ||
![]() |
9ea40f31e4 | ||
![]() |
27bd6f4b1c | ||
![]() |
b9e9137f90 | ||
![]() |
bee0bbbe90 | ||
![]() |
277ca0c951 | ||
![]() |
8aa059dd21 | ||
![]() |
c39bdd246a | ||
![]() |
9823af9159 | ||
![]() |
9ee0e0a3c9 | ||
![]() |
bf184fb719 | ||
![]() |
94f308c50f | ||
![]() |
bfa0ef64ec | ||
![]() |
98fc0a8cb9 | ||
![]() |
facabc09f5 | ||
![]() |
51afcd7b96 | ||
![]() |
340f1bb287 | ||
![]() |
40c8479448 | ||
![]() |
27e2063bf9 | ||
![]() |
e43f0a9285 | ||
![]() |
a977cbdd26 | ||
![]() |
dbc536c6c2 | ||
![]() |
97c9075503 | ||
![]() |
290e45062d | ||
![]() |
fc6bffe683 | ||
![]() |
1fb8327ca9 | ||
![]() |
36208de902 | ||
![]() |
5403577642 | ||
![]() |
c76dda1523 | ||
![]() |
b5034e5b12 | ||
![]() |
b039333922 | ||
![]() |
b504e0d109 | ||
![]() |
0692b9dcdb | ||
![]() |
085b72154f | ||
![]() |
4f99c0fa98 | ||
![]() |
b38b71eb44 | ||
![]() |
639da1a4b8 | ||
![]() |
f2d27aae3f | ||
![]() |
931876ac77 | ||
![]() |
e5f62a9188 | ||
![]() |
3fb699979c | ||
![]() |
85f15a1f28 | ||
![]() |
758017b638 | ||
![]() |
724d1db9b8 | ||
![]() |
00421fbee6 | ||
![]() |
2510bab41f | ||
![]() |
c6675f2013 | ||
![]() |
1fd6c2bd52 | ||
![]() |
8f355fe188 | ||
![]() |
dbd10a281b | ||
![]() |
d57ea3695b | ||
![]() |
8dd74b7789 | ||
![]() |
36c00f146d | ||
![]() |
aba9f25744 | ||
![]() |
dacfa6ae55 | ||
![]() |
f53fba082a | ||
![]() |
764b95f617 | ||
![]() |
3237b3564e | ||
![]() |
985731f543 | ||
![]() |
7c28efe9cd | ||
![]() |
5b567f4cba | ||
![]() |
78918eb59d | ||
![]() |
1848506f09 | ||
![]() |
ce0004a296 | ||
![]() |
e85d3f2a19 | ||
![]() |
4e5a0a30bf | ||
![]() |
9ab37e54b4 | ||
![]() |
0bd15172b1 | ||
![]() |
fe0e5c1d9c | ||
![]() |
5128d88722 | ||
![]() |
173ca3e58e | ||
![]() |
2a13fca737 | ||
![]() |
b3a9f4423b | ||
![]() |
62c24826e6 | ||
![]() |
a3d2c2c044 | ||
![]() |
72409622ef | ||
![]() |
c8a2de8235 | ||
![]() |
6b91846b0c | ||
![]() |
92190220aa | ||
![]() |
705d30d125 | ||
![]() |
c316dc7b00 | ||
![]() |
529dc29d08 | ||
![]() |
91e760bf5f | ||
![]() |
61e24499bf | ||
![]() |
75621651e5 | ||
![]() |
3973b95746 | ||
![]() |
f9d264058b | ||
![]() |
a69d9d4483 | ||
![]() |
8b19d00086 | ||
![]() |
1156d4f881 | ||
![]() |
08c5186426 | ||
![]() |
61b4a817f3 | ||
![]() |
13710904ba | ||
![]() |
015ebb650e | ||
![]() |
17d623bf85 | ||
![]() |
0049348de5 | ||
![]() |
20d11f5f97 | ||
![]() |
047a7bb949 | ||
![]() |
52c79f7f77 | ||
![]() |
c97bc2e977 | ||
![]() |
78d564cc04 | ||
![]() |
e27c0716c4 | ||
![]() |
35d037daff | ||
![]() |
f055162ac0 | ||
![]() |
f2e32c737b | ||
![]() |
205709271b | ||
![]() |
3e70a9fab8 | ||
![]() |
733c6c96f0 | ||
![]() |
a010e648ee | ||
![]() |
1c7b561aa9 | ||
![]() |
75a71d35ec | ||
![]() |
7c0f0672bd | ||
![]() |
8fc6b6e3c3 | ||
![]() |
6c2c8ca2b7 | ||
![]() |
1b6bdd07e7 | ||
![]() |
539688dd3d | ||
![]() |
08e09c3b4c | ||
![]() |
4259053c7e | ||
![]() |
c221cfd493 | ||
![]() |
41298b53d4 | ||
![]() |
ddcd05adc6 | ||
![]() |
a28cd64c7a | ||
![]() |
38e62fef18 | ||
![]() |
3f139f463b | ||
![]() |
0597191319 | ||
![]() |
f4c8b0c21f | ||
![]() |
bba7031f3d | ||
![]() |
4785913e02 | ||
![]() |
a6808d1f6a | ||
![]() |
7188e9832a | ||
![]() |
0cce0c81fb | ||
![]() |
a60baa03e0 | ||
![]() |
b0c8dafb33 | ||
![]() |
b672fc8b29 | ||
![]() |
eac69f659f | ||
![]() |
d9ab65154c | ||
![]() |
c120aed8bb | ||
![]() |
ecdbe3d959 | ||
![]() |
96d10fb8b0 | ||
![]() |
2ab826268d | ||
![]() |
c3e3f368e0 | ||
![]() |
f35582489d | ||
![]() |
9acea3484d | ||
![]() |
a72da9b73e | ||
![]() |
df53d35967 | ||
![]() |
e5e7421d3c | ||
![]() |
6ff25d00fc | ||
![]() |
4a5b0b3105 | ||
![]() |
d05d964432 | ||
![]() |
daa4a67b49 | ||
![]() |
9c0224911c | ||
![]() |
ef5759cff5 | ||
![]() |
77292fb9ab | ||
![]() |
6fb9ab078e | ||
![]() |
844a72e0f3 | ||
![]() |
46e9046629 | ||
![]() |
e5af60787e | ||
![]() |
4b0696a187 | ||
![]() |
a6377fedab | ||
![]() |
2f884e6d55 | ||
![]() |
28f8c65771 | ||
![]() |
b509ef5ab4 | ||
![]() |
9f48dabaec | ||
![]() |
5b0224ae3c | ||
![]() |
c3ef267d6d | ||
![]() |
fe9b298705 | ||
![]() |
0b106cf47e | ||
![]() |
9b417c9b26 | ||
![]() |
37d5458c4c | ||
![]() |
77d48cb104 | ||
![]() |
a25200741a | ||
![]() |
d04a32920a | ||
![]() |
792b676c11 | ||
![]() |
690a7a7557 | ||
![]() |
e128c93ad9 | ||
![]() |
39add5ccec | ||
![]() |
a1a89cba34 | ||
![]() |
2d696cf500 | ||
![]() |
45fe0bc8b7 | ||
![]() |
9fc4c67187 | ||
![]() |
34aeab5f77 | ||
![]() |
b510452260 | ||
![]() |
89b8d5a67b | ||
![]() |
500e3a3b2c | ||
![]() |
47e575ed9a | ||
![]() |
10b30d74e7 | ||
![]() |
1ba4c6b7ad | ||
![]() |
eb899be95e | ||
![]() |
6d993af419 | ||
![]() |
a136cccbe1 | ||
![]() |
2b43ebfca4 | ||
![]() |
06f4980ee1 | ||
![]() |
6cdf5b7b7e | ||
![]() |
117b9a5579 | ||
![]() |
9475be8f6f | ||
![]() |
41ca1797f9 | ||
![]() |
e56ae3d266 | ||
![]() |
735ffaf80b | ||
![]() |
ed52d1c648 | ||
![]() |
78fa90c59b | ||
![]() |
548a3efe5a | ||
![]() |
18a12eeba3 | ||
![]() |
83d486ceeb | ||
![]() |
d898c0f995 | ||
![]() |
02faf6f8c1 | ||
![]() |
3478bbddf2 | ||
![]() |
fd1ee31e1e | ||
![]() |
4a565f0985 | ||
![]() |
c68f23cdaf | ||
![]() |
e386eb00ef | ||
![]() |
662d048bf4 | ||
![]() |
d9e3cc2188 | ||
![]() |
a586f13af8 | ||
![]() |
37820c1673 | ||
![]() |
8a2e4ca470 | ||
![]() |
3a5da64c6f | ||
![]() |
9c018a2330 | ||
![]() |
0840cdd83a | ||
![]() |
e972747969 | ||
![]() |
e151c6eb15 | ||
![]() |
603444a69f | ||
![]() |
999e0fd721 | ||
![]() |
47131dec44 | ||
![]() |
6adad053d9 | ||
![]() |
725561b655 | ||
![]() |
b84fbf452e | ||
![]() |
eb7af2bce9 | ||
![]() |
7c57c4b131 | ||
![]() |
4460466cb3 | ||
![]() |
eea19d733d | ||
![]() |
abc97dcab3 | ||
![]() |
065c791a10 | ||
![]() |
6b902e7f5d | ||
![]() |
df0cb87b35 | ||
![]() |
0b9687fea4 | ||
![]() |
99fbe092bc | ||
![]() |
7a7849ae83 | ||
![]() |
47830bb330 | ||
![]() |
0dfb1a3a2a | ||
![]() |
e2e1ab0275 | ||
![]() |
4249cacf2f | ||
![]() |
4e3ec52673 | ||
![]() |
98991a4a7a | ||
![]() |
bca6d656b6 | ||
![]() |
ffc3580d43 | ||
![]() |
c18cdc78ea | ||
![]() |
77ecc73631 | ||
![]() |
3834f51d74 | ||
![]() |
86ddec3f76 | ||
![]() |
4d12bcb184 | ||
![]() |
7d93723382 | ||
![]() |
8e1a52bbb7 | ||
![]() |
cd9b1a741f | ||
![]() |
cefe331e0c | ||
![]() |
14d1fae54a | ||
![]() |
a1601be7a6 | ||
![]() |
a2ebeb11e3 | ||
![]() |
b7f0f32878 | ||
![]() |
58e39add5b | ||
![]() |
61725c95df | ||
![]() |
71a1df661a | ||
![]() |
9eed0eab5f | ||
![]() |
e42b6fe0a9 | ||
![]() |
b1e640ad1d | ||
![]() |
2fc091fdf7 | ||
![]() |
47ba241e7d | ||
![]() |
c0d37c504a | ||
![]() |
1e0195f6e3 | ||
![]() |
e806c1ddf1 | ||
![]() |
78f0072c59 | ||
![]() |
1022ce531a | ||
![]() |
7f08a7bca8 | ||
![]() |
4123bef60d | ||
![]() |
c6464efa07 | ||
![]() |
0a9075748e | ||
![]() |
3733761696 | ||
![]() |
cde7cbc3a3 | ||
![]() |
e927da56cf | ||
![]() |
3b8bffe39c | ||
![]() |
19da377064 | ||
![]() |
4d1380b5c4 | ||
![]() |
25c2904d66 | ||
![]() |
53565663d9 | ||
![]() |
76f0e17987 | ||
![]() |
5052449e38 | ||
![]() |
a539da3200 | ||
![]() |
fb875501f0 | ||
![]() |
89d805ab92 | ||
![]() |
7852929da3 | ||
![]() |
595e6fcb8b | ||
![]() |
a9792bd4c3 | ||
![]() |
c19bc7e7a2 | ||
![]() |
3e980ed371 | ||
![]() |
a9a7c7fdb8 | ||
![]() |
5baf5bccf2 | ||
![]() |
981d72ac5a | ||
![]() |
a9b8cdce64 | ||
![]() |
f3222fc36a | ||
![]() |
e5aee8d206 | ||
![]() |
96d16bcbc1 | ||
![]() |
010a5ffc74 | ||
![]() |
bed9bbbd05 | ||
![]() |
5cc168111c | ||
![]() |
bdec6aab07 | ||
![]() |
56cbab8661 | ||
![]() |
29c3bece4e | ||
![]() |
dc24a4a067 | ||
![]() |
c4683e2417 | ||
![]() |
11f5870a8b | ||
![]() |
9de71e3529 | ||
![]() |
81866d96e0 | ||
![]() |
70fcc70348 | ||
![]() |
1911f04079 | ||
![]() |
b7288ba3f4 | ||
![]() |
be655e2b9c | ||
![]() |
915269e017 | ||
![]() |
6071b5303c | ||
![]() |
e59a24ded3 | ||
![]() |
2239efa439 | ||
![]() |
99fcec9f26 | ||
![]() |
2fe4e85543 | ||
![]() |
68f2635c06 | ||
![]() |
0147677412 | ||
![]() |
89133bf05d | ||
![]() |
7a0a671f18 | ||
![]() |
c7d1f42edb | ||
![]() |
2b9d31fe7f | ||
![]() |
1f71bb714d | ||
![]() |
6b21f7e92e | ||
![]() |
8b5074b6ac | ||
![]() |
7f7d797fce | ||
![]() |
0b3aad5ad2 | ||
![]() |
ad88215b85 | ||
![]() |
ccb1465e17 | ||
![]() |
fde4d8d54f | ||
![]() |
37db2e8acc | ||
![]() |
9413eb0d58 | ||
![]() |
06d2eaf409 | ||
![]() |
444ce284ae | ||
![]() |
a150c1b18b | ||
![]() |
194e898d90 | ||
![]() |
0b1a20dcff | ||
![]() |
93e7561cb3 | ||
![]() |
6ab654264b | ||
![]() |
7023184892 | ||
![]() |
07f13d1ae9 | ||
![]() |
ac22b1cfbf | ||
![]() |
e70cdfb898 | ||
![]() |
022181fcfd | ||
![]() |
e021289d36 | ||
![]() |
91b80a8e21 | ||
![]() |
322ca2b42e | ||
![]() |
d399ffd609 | ||
![]() |
bf2626f804 | ||
![]() |
00f27ac02d | ||
![]() |
5134aed352 | ||
![]() |
b457a84ed9 | ||
![]() |
8188d46ee7 | ||
![]() |
d64e88451f | ||
![]() |
c70c578194 | ||
![]() |
54ceff5107 | ||
![]() |
3b94904ea8 | ||
![]() |
1c8b4a1922 | ||
![]() |
32b0b2dfac | ||
![]() |
6506577787 | ||
![]() |
56775399d3 | ||
![]() |
d6d40975e5 | ||
![]() |
e3936f52a2 | ||
![]() |
53d5dd1e40 | ||
![]() |
b2ef0fd6e3 | ||
![]() |
8832fbe55d | ||
![]() |
b5ffe756d6 | ||
![]() |
01a0173a2f | ||
![]() |
7bebb2adab | ||
![]() |
8c41576daa | ||
![]() |
a529b37f25 | ||
![]() |
f84ed6b794 | ||
![]() |
9526a92fc1 | ||
![]() |
5e60b89a0d | ||
![]() |
e46625a52c | ||
![]() |
037cb0f5cb | ||
![]() |
f67a7c6621 | ||
![]() |
4839a2026b | ||
![]() |
219dbbb5b7 | ||
![]() |
d78de51bc2 | ||
![]() |
faa50352e0 | ||
![]() |
f2b49f7ccb | ||
![]() |
13911b051a | ||
![]() |
694167d352 | ||
![]() |
3b2e4ff9c1 | ||
![]() |
16e0dc17a8 | ||
![]() |
1f4b7718e8 | ||
![]() |
8c59d6020e | ||
![]() |
377b0896c2 | ||
![]() |
a399fdf6cf | ||
![]() |
783c24d6f7 | ||
![]() |
1254146223 | ||
![]() |
f776d842d1 | ||
![]() |
74acf35a89 | ||
![]() |
81b8fe3f61 | ||
![]() |
679bfb90ea | ||
![]() |
deb18c53b7 | ||
![]() |
bbb7aa3771 | ||
![]() |
eb04e26823 | ||
![]() |
3af24ee0ea | ||
![]() |
513fe7773f | ||
![]() |
9150d1cc44 | ||
![]() |
e19b72647e | ||
![]() |
d809975882 | ||
![]() |
7b92d99afa | ||
![]() |
b463c905cf | ||
![]() |
7f8a0c9931 | ||
![]() |
53d812666c | ||
![]() |
7b59f07181 | ||
![]() |
d22dea5e8e | ||
![]() |
8817467216 | ||
![]() |
236afa7c3f | ||
![]() |
cd6ec5e3a7 | ||
![]() |
434aaf3eaf | ||
![]() |
5b80ea20c7 | ||
![]() |
1d60405eaa | ||
![]() |
64f4f59165 | ||
![]() |
192f9ac514 | ||
![]() |
279b1413ec | ||
![]() |
9c5297882c | ||
![]() |
a6d508d791 | ||
![]() |
6b3402c631 | ||
![]() |
d5da32b8a9 | ||
![]() |
39b3ed3d44 | ||
![]() |
f8b97405ff | ||
![]() |
1d4fe357c8 | ||
![]() |
c7900b6048 | ||
![]() |
6e3f959684 | ||
![]() |
eb9a3b1bbf | ||
![]() |
391450f090 | ||
![]() |
f804476fbc | ||
![]() |
60e4fa7005 | ||
![]() |
c13f9dc9a8 | ||
![]() |
f213943b2d | ||
![]() |
5159a534bb | ||
![]() |
c7a4e705cb | ||
![]() |
864ea08393 | ||
![]() |
ebfb6d1846 | ||
![]() |
6b89ec615a | ||
![]() |
af432e6d3f | ||
![]() |
44c17409a7 | ||
![]() |
0f48c39bc1 | ||
![]() |
572e6652cc | ||
![]() |
fecb601fc4 | ||
![]() |
7b238e9d34 | ||
![]() |
73c8ff11b3 | ||
![]() |
682dc89067 | ||
![]() |
ee514710c5 | ||
![]() |
2d15696a5e | ||
![]() |
769d06b0f0 | ||
![]() |
dcb0369e10 | ||
![]() |
1b35d3ce05 | ||
![]() |
31d254cb9f | ||
![]() |
bf4780bbdb | ||
![]() |
5af8e127f8 | ||
![]() |
016e062fef | ||
![]() |
c093122764 | ||
![]() |
11ec6270da | ||
![]() |
81df55310b | ||
![]() |
e5fb85ad08 | ||
![]() |
c5ef60040a | ||
![]() |
757b4849f8 | ||
![]() |
2198bdec21 | ||
![]() |
8bd377ce85 | ||
![]() |
89eae68318 | ||
![]() |
d1e94f3934 | ||
![]() |
fc0a995c66 | ||
![]() |
eee0eaac4a | ||
![]() |
535da856a4 | ||
![]() |
422bf647a7 | ||
![]() |
93cd470659 | ||
![]() |
81b86d61da | ||
![]() |
eac8580f64 | ||
![]() |
d56498e622 | ||
![]() |
551fccb761 | ||
![]() |
5317b8424f | ||
![]() |
5816391e9b | ||
![]() |
543c00037a | ||
![]() |
d5f435ee90 | ||
![]() |
02e2e92d36 | ||
![]() |
040f8db0ef | ||
![]() |
14927df9fa | ||
![]() |
dca9709b12 | ||
![]() |
d6571820fe | ||
![]() |
a0d3333ebb | ||
![]() |
9615fafc1e | ||
![]() |
5fc2425f3a | ||
![]() |
63445c4fc1 | ||
![]() |
eefe8ee2d1 | ||
![]() |
edb1cb0ebe | ||
![]() |
140242a761 | ||
![]() |
ae13be0c37 | ||
![]() |
74ff3b920e | ||
![]() |
2cd6b981f1 | ||
![]() |
f866dcbcfc | ||
![]() |
0d394a7e67 | ||
![]() |
7059f32ecc | ||
![]() |
87baa69d7c | ||
![]() |
408c901342 | ||
![]() |
d709dda87a | ||
![]() |
cda6225659 | ||
![]() |
563182c14c | ||
![]() |
303ed30a38 | ||
![]() |
0a6c745ffb | ||
![]() |
9d654faa3d | ||
![]() |
9407b64fe3 | ||
![]() |
1f0f5764a8 | ||
![]() |
13197acb3a | ||
![]() |
2f48ca6adb | ||
![]() |
01d938b5ba | ||
![]() |
186d7a12e5 | ||
![]() |
5192d36f81 | ||
![]() |
dfb6c37c9e | ||
![]() |
cb208b9ad2 | ||
![]() |
e4d20c3fa1 | ||
![]() |
0b747bf1c5 | ||
![]() |
e207715b5e | ||
![]() |
bef1b456e1 | ||
![]() |
11349f9ad5 | ||
![]() |
2a485a6b69 | ||
![]() |
f41e92de6e | ||
![]() |
835c0b0d9a | ||
![]() |
d9dc34f06d | ||
![]() |
907ff36018 | ||
![]() |
64626a767c | ||
![]() |
a7df73073d | ||
![]() |
40492daecd | ||
![]() |
a5691d7779 | ||
![]() |
d1ecd4a3c8 | ||
![]() |
5482b31c66 | ||
![]() |
15f2f6c798 | ||
![]() |
46b3f4eb5e | ||
![]() |
f5aadbb788 | ||
![]() |
bbb54ea36d | ||
![]() |
d7a5eb5d2f | ||
![]() |
cc716c3fa4 | ||
![]() |
141574a0d7 | ||
![]() |
2df8ed10d0 | ||
![]() |
40e3977664 | ||
![]() |
7ddee0100e | ||
![]() |
6b869c4c0d | ||
![]() |
91497d8fa7 | ||
![]() |
85bf56ae03 | ||
![]() |
84d702838d | ||
![]() |
fd3a36f162 | ||
![]() |
10e3192f85 | ||
![]() |
de874874e4 | ||
![]() |
72e315bce1 | ||
![]() |
02ef85e390 | ||
![]() |
aeba0e0f6f | ||
![]() |
f8fa944054 | ||
![]() |
1d50fa088a | ||
![]() |
546ded324e | ||
![]() |
332a635031 | ||
![]() |
de02c868a2 | ||
![]() |
a74b966b7c | ||
![]() |
ca4b1ebdee | ||
![]() |
42c20ac008 | ||
![]() |
a26e5b74c2 | ||
![]() |
ee5faedaf9 | ||
![]() |
874b034698 | ||
![]() |
dfb2cb6bbf | ||
![]() |
fb15f0f2b3 | ||
![]() |
4d231fbc50 | ||
![]() |
dd85118a9c | ||
![]() |
531340627d | ||
![]() |
6b6e5291dd | ||
![]() |
79b0e6998d | ||
![]() |
445814b144 | ||
![]() |
ebb3173322 | ||
![]() |
c16f2029b1 | ||
![]() |
abefdd772c | ||
![]() |
e550d244df | ||
![]() |
84cc66ad48 | ||
![]() |
fa5a97031d | ||
![]() |
6e454cdfb3 | ||
![]() |
52f43a3aa6 | ||
![]() |
907aa21ba8 | ||
![]() |
ac01ad6751 | ||
![]() |
c84702b490 | ||
![]() |
edd2a9d8f6 | ||
![]() |
a19c7afce0 | ||
![]() |
849f1ee7d1 | ||
![]() |
c60c2c09e1 | ||
![]() |
3254b3f044 | ||
![]() |
9a35d34fc3 | ||
![]() |
4da5e26cdc | ||
![]() |
8a28ad0c36 | ||
![]() |
e08b2fe382 | ||
![]() |
8b16e94829 | ||
![]() |
618223f01b | ||
![]() |
13c63d3e1f | ||
![]() |
8e0aa5185b | ||
![]() |
2b01f092b3 | ||
![]() |
1fd238567e | ||
![]() |
cb59edc963 | ||
![]() |
0ce70b9f8f | ||
![]() |
57175cfa5c | ||
![]() |
8aacdcefb8 | ||
![]() |
69766ae87a | ||
![]() |
d3d2082e41 | ||
![]() |
de621f6acb | ||
![]() |
a7c5067475 | ||
![]() |
7282426736 | ||
![]() |
0333fd86f8 | ||
![]() |
ab91ade685 | ||
![]() |
005afcd53d | ||
![]() |
c1604c0c8c | ||
![]() |
5155c10136 | ||
![]() |
28c6e3b398 | ||
![]() |
41244095b1 | ||
![]() |
a5535fa789 | ||
![]() |
6796a8b3fe | ||
![]() |
819dffcb86 | ||
![]() |
b54db17069 | ||
![]() |
e27f2443e8 | ||
![]() |
a1e0bc5d7c | ||
![]() |
28ea95b9ff | ||
![]() |
e3b9e48d8c | ||
![]() |
026b6b2562 | ||
![]() |
0fa380ecff | ||
![]() |
ebd885f053 | ||
![]() |
74ccb03e54 | ||
![]() |
50264c4968 | ||
![]() |
be222b64a1 | ||
![]() |
db7ae4ffef | ||
![]() |
884a76db4c | ||
![]() |
18e5c6e714 | ||
![]() |
468341b7d0 | ||
![]() |
e03b976ffd | ||
![]() |
34ea099d87 | ||
![]() |
5f2827e2ab | ||
![]() |
1d887b4655 | ||
![]() |
6250380f61 | ||
![]() |
6bb475abe7 | ||
![]() |
31ea951357 | ||
![]() |
091c8b4d12 | ||
![]() |
c4523db991 | ||
![]() |
2b66672d2d | ||
![]() |
77de0b78ba | ||
![]() |
0181fbcfa0 | ||
![]() |
e1f2433c36 | ||
![]() |
c753dcafd8 | ||
![]() |
57ac7d8c19 | ||
![]() |
d64ef13b79 | ||
![]() |
911e87c6ec | ||
![]() |
b75c7b64f1 | ||
![]() |
135b519dd8 | ||
![]() |
b7a0607d52 | ||
![]() |
2ee1a2099d | ||
![]() |
7fe7e74fe2 | ||
![]() |
0a3a23af41 | ||
![]() |
e89262ed3b | ||
![]() |
21fda4cabd | ||
![]() |
a85694b548 | ||
![]() |
16464c5a68 | ||
![]() |
85c8769512 | ||
![]() |
c3abbd9014 | ||
![]() |
98239050d8 | ||
![]() |
dc7caf04a8 | ||
![]() |
db01f72adc | ||
![]() |
170b4b0972 | ||
![]() |
ff6e81d44f | ||
![]() |
88bc0e1e85 | ||
![]() |
c5b46529b0 | ||
![]() |
e5dbfba55e | ||
![]() |
daa7aceecf | ||
![]() |
35681e7a1f | ||
![]() |
d4dfde3340 | ||
![]() |
05a6b43e08 | ||
![]() |
16f775c78c | ||
![]() |
af919dadca | ||
![]() |
41c322ec81 | ||
![]() |
ac8c18250d | ||
![]() |
4b05c400b2 | ||
![]() |
cc85d0c100 | ||
![]() |
56dce21538 | ||
![]() |
3cd5acf3aa | ||
![]() |
48fc5a72b8 | ||
![]() |
26c3375112 | ||
![]() |
e89543710c | ||
![]() |
ee48193f15 | ||
![]() |
6d10ed27c5 | ||
![]() |
19c68aa25d | ||
![]() |
5ee7cb16bb | ||
![]() |
4630a1f386 | ||
![]() |
06dab5d8b0 | ||
![]() |
054201bea9 | ||
![]() |
f39a4c0bc7 | ||
![]() |
0e20d7e880 | ||
![]() |
927f4bb4bd | ||
![]() |
f9901787b5 | ||
![]() |
6731f56aea | ||
![]() |
d6870ecbee | ||
![]() |
eea8c42268 | ||
![]() |
99647e677a | ||
![]() |
a5d637dbb3 | ||
![]() |
048a973290 | ||
![]() |
fa80e0bd75 | ||
![]() |
a23de7b361 | ||
![]() |
dc60cb45b2 | ||
![]() |
2bf1144a14 | ||
![]() |
ab5efa5a64 | ||
![]() |
ccc98e4c62 | ||
![]() |
52424f63f0 | ||
![]() |
881df7193b | ||
![]() |
e859bba61d | ||
![]() |
e3beec985e | ||
![]() |
9eec50d69f | ||
![]() |
5a8cc83e6e | ||
![]() |
724aeb22ed | ||
![]() |
6fdc756b59 | ||
![]() |
25418b7857 | ||
![]() |
b4de0b53e4 | ||
![]() |
cacf1ca1b7 | ||
![]() |
98c61529b9 | ||
![]() |
6675a491be | ||
![]() |
b6485ad7db | ||
![]() |
9f5df368d1 | ||
![]() |
e970e29953 | ||
![]() |
9fb559bdb1 | ||
![]() |
61e9146385 | ||
![]() |
897c2322b9 | ||
![]() |
7b8be9fed1 | ||
![]() |
cebb351505 | ||
![]() |
b4bce3431b | ||
![]() |
c6e3dfdbe6 | ||
![]() |
22d2790735 | ||
![]() |
5d3b76b249 | ||
![]() |
7b07be1502 | ||
![]() |
3acb796b59 | ||
![]() |
25bbc1793d | ||
![]() |
63456beeb0 | ||
![]() |
2e32395cf2 | ||
![]() |
d04ed0aace | ||
![]() |
302f06f8d2 | ||
![]() |
4cf4ca2943 | ||
![]() |
fe35e02ed4 | ||
![]() |
5fa1b98d34 | ||
![]() |
bebe117487 | ||
![]() |
26495fe0f8 | ||
![]() |
4c4ac9f90e | ||
![]() |
bf5fdb8f06 | ||
![]() |
01e68fd5ee | ||
![]() |
e930b5481a | ||
![]() |
9bd4d40f09 | ||
![]() |
40035f4df3 | ||
![]() |
a7b3fdd70b | ||
![]() |
b77af7fced | ||
![]() |
52c89f1de3 | ||
![]() |
e7cd70b8ee | ||
![]() |
e06ee0f26a | ||
![]() |
76c9e4e048 | ||
![]() |
06d8ddbfc7 | ||
![]() |
8b9840d37f | ||
![]() |
960469be77 | ||
![]() |
77ef0f3579 | ||
![]() |
07c840a4a9 | ||
![]() |
35a8c4edfa | ||
![]() |
36af9e6589 | ||
![]() |
ea14ab5664 | ||
![]() |
1ed8538745 | ||
![]() |
12e36b987a | ||
![]() |
8324c599de | ||
![]() |
d972c85fba | ||
![]() |
d8b9abe7f5 | ||
![]() |
4f868d9585 | ||
![]() |
e27ac45f44 | ||
![]() |
58d0e43f78 | ||
![]() |
a6c1cbfd50 | ||
![]() |
e32222884d | ||
![]() |
49a7a1f8ff | ||
![]() |
e5275c0f05 | ||
![]() |
c391605f61 | ||
![]() |
73c9e6f1d8 | ||
![]() |
2d6ac6f0be | ||
![]() |
57870103a6 | ||
![]() |
64604b5c44 | ||
![]() |
9960884e3c | ||
![]() |
593982d586 | ||
![]() |
f229c1c5a8 | ||
![]() |
35e9f9982c | ||
![]() |
a0cb46d4a1 | ||
![]() |
e8a48184b9 | ||
![]() |
d2aa26248f | ||
![]() |
0f1de72ae6 | ||
![]() |
efaea69c09 | ||
![]() |
a67dbff603 | ||
![]() |
35e6435382 | ||
![]() |
7a2735885f | ||
![]() |
cc721a3db6 | ||
![]() |
1a5cac2c6a | ||
![]() |
ef08f1c8f3 | ||
![]() |
8919890dbe | ||
![]() |
cf6335d180 | ||
![]() |
a86a707e4a | ||
![]() |
9d61993878 | ||
![]() |
6eb20a3524 | ||
![]() |
7314543c88 | ||
![]() |
bb4b10d752 | ||
![]() |
416c568c51 | ||
![]() |
65d3a51a17 | ||
![]() |
e55f5902d5 | ||
![]() |
b0180383df | ||
![]() |
61f0fc665f | ||
![]() |
b0c1d79132 | ||
![]() |
7945c2ca66 | ||
![]() |
8b2b1a9a47 | ||
![]() |
b76f9a9a6c | ||
![]() |
8af5da5fca | ||
![]() |
cbe6d85bcd | ||
![]() |
6b6e2c947c | ||
![]() |
66fcc2cd14 | ||
![]() |
af829772f9 | ||
![]() |
7b6a558fe5 | ||
![]() |
4122ee4168 | ||
![]() |
b77f62ab58 | ||
![]() |
783bf1b63c | ||
![]() |
a0728b4a8a | ||
![]() |
ea6e865cc8 | ||
![]() |
1da4113110 | ||
![]() |
7956746b65 | ||
![]() |
10a8d13ade | ||
![]() |
65b47a2b3a | ||
![]() |
46cc00d669 | ||
![]() |
5521cf9ab3 | ||
![]() |
a770df1e0b | ||
![]() |
03943a23ac | ||
![]() |
685dc0336a | ||
![]() |
776012fedf | ||
![]() |
6ba9f2655c | ||
![]() |
8a3b62e93f | ||
![]() |
bd999a6d9c | ||
![]() |
f46078965d | ||
![]() |
60f6bb17e3 | ||
![]() |
fdf1dac618 | ||
![]() |
373a35acf0 | ||
![]() |
abfdac59ba | ||
![]() |
efc1354dcb | ||
![]() |
c9f2603692 | ||
![]() |
aab24260e2 | ||
![]() |
e450156bf7 | ||
![]() |
1533c02a41 | ||
![]() |
c4855029a9 | ||
![]() |
4fa457118f | ||
![]() |
33b403d6eb | ||
![]() |
a5c6654dcb | ||
![]() |
07ec6adecb | ||
![]() |
ceb901e9ca | ||
![]() |
651b86b066 | ||
![]() |
a4003dd61c | ||
![]() |
5e461786f9 | ||
![]() |
45108c6f4b | ||
![]() |
bc0d373dcd | ||
![]() |
0f37a8f6ea | ||
![]() |
03ceaf82ce | ||
![]() |
1e5e5e24f6 | ||
![]() |
eb993dbd43 | ||
![]() |
4f5abb3412 | ||
![]() |
6418d79d76 | ||
![]() |
796a3a711f | ||
![]() |
0ef743d945 | ||
![]() |
7c33f98ae9 | ||
![]() |
51ba1e2951 | ||
![]() |
0b16d599d5 | ||
![]() |
3b2223ad22 | ||
![]() |
186583148a | ||
![]() |
5475624b7f | ||
![]() |
d5be69239a | ||
![]() |
304645d720 | ||
![]() |
0591152f99 | ||
![]() |
74e8a38c00 | ||
![]() |
5cadab46ab | ||
![]() |
1577927d99 | ||
![]() |
5a0aeb2f88 | ||
![]() |
7a1f7773bf | ||
![]() |
b0e597cf55 | ||
![]() |
c40d073d7a | ||
![]() |
dd8b3f607a | ||
![]() |
5cc599984d | ||
![]() |
b95b8c4c20 | ||
![]() |
3e190ca4b3 | ||
![]() |
3853d1ef39 | ||
![]() |
bf700186d0 | ||
![]() |
ca7cacfdcc | ||
![]() |
b893f4f89f | ||
![]() |
109686aca2 | ||
![]() |
6840df4eca | ||
![]() |
ed3f212bd8 | ||
![]() |
e1f2a51f2b | ||
![]() |
d3870309fb | ||
![]() |
1fa2031f11 | ||
![]() |
1d765125c7 | ||
![]() |
5aa70d91f3 | ||
![]() |
f018c2c15a | ||
![]() |
1b8ad12b25 | ||
![]() |
078aa01895 | ||
![]() |
f0aad4bb21 | ||
![]() |
8fe054b063 | ||
![]() |
ac63e6c627 | ||
![]() |
434a48af7d | ||
![]() |
c5dcf96717 | ||
![]() |
84791c42bc | ||
![]() |
e032a1a627 | ||
![]() |
1f2b5dcc86 | ||
![]() |
8bd30ffb22 | ||
![]() |
fbf67fccc3 | ||
![]() |
b848ee0fac | ||
![]() |
4a39e5411f | ||
![]() |
336ba6181e | ||
![]() |
c9aedf242d | ||
![]() |
500c70016f | ||
![]() |
cf1dbf07c7 | ||
![]() |
13ec3435b4 | ||
![]() |
fce0f7b357 | ||
![]() |
0fabdc8c44 | ||
![]() |
2174f2ff85 | ||
![]() |
ac40373c09 | ||
![]() |
d5908bd75c | ||
![]() |
8cf3be3526 | ||
![]() |
0290fa3351 | ||
![]() |
937f3993ec | ||
![]() |
d501285057 | ||
![]() |
0ed92943de | ||
![]() |
56044dd8f8 | ||
![]() |
e8109076f4 | ||
![]() |
0a31ab7558 | ||
![]() |
e73be7ef5c | ||
![]() |
aa209e0aaf | ||
![]() |
570dddddd8 | ||
![]() |
534176423e | ||
![]() |
ca2c2fb8fe | ||
![]() |
4388b7b187 | ||
![]() |
368f94ce3b | ||
![]() |
e7fd0f7419 | ||
![]() |
92f7c3633f | ||
![]() |
bf27caa61e | ||
![]() |
808916029e | ||
![]() |
5f3ee10bc0 | ||
![]() |
45f50cfe25 | ||
![]() |
42c0605abf | ||
![]() |
f83839e01b | ||
![]() |
24dbc1ce4e | ||
![]() |
d8505eff2b | ||
![]() |
bca71ade85 | ||
![]() |
7518d7b418 | ||
![]() |
3f8aeac7e6 | ||
![]() |
c4a9a87929 | ||
![]() |
7eca455795 | ||
![]() |
cb9ac23b23 | ||
![]() |
4a66a41f91 | ||
![]() |
665c35d089 | ||
![]() |
0a634c633b | ||
![]() |
eb70b30e7a | ||
![]() |
8d188073b4 | ||
![]() |
ceea855c6f | ||
![]() |
9b7f192dce | ||
![]() |
23a866f6f8 | ||
![]() |
946a7a406c | ||
![]() |
e209290073 | ||
![]() |
2c441ee541 | ||
![]() |
dd768ec9ef | ||
![]() |
adaeaea596 | ||
![]() |
5a44740592 | ||
![]() |
97a0bd90ec | ||
![]() |
92ee1d9caf | ||
![]() |
9ab28dc7da | ||
![]() |
840501c8dd | ||
![]() |
ef4b79b1f5 | ||
![]() |
b6b35079ef | ||
![]() |
b8e8aead93 | ||
![]() |
dd378db4d0 | ||
![]() |
cc048f5099 | ||
![]() |
ac02afaae6 | ||
![]() |
bff58ae615 | ||
![]() |
748934edcd | ||
![]() |
d9fb375812 | ||
![]() |
55582a85ab | ||
![]() |
9255c5259d | ||
![]() |
f1e2a45520 | ||
![]() |
cb9e69238c | ||
![]() |
56b2971dee | ||
![]() |
ad917d96c8 | ||
![]() |
1fd7bd3fa5 | ||
![]() |
1234bd89c7 | ||
![]() |
187ee87f10 | ||
![]() |
5ae88b816d | ||
![]() |
3418691f88 | ||
![]() |
4e8a51db81 | ||
![]() |
2629ef17c3 | ||
![]() |
9b63625c2b | ||
![]() |
970d72cf07 | ||
![]() |
d88870bc04 | ||
![]() |
9b35e13923 | ||
![]() |
032eb11cfb | ||
![]() |
9ea7b77231 | ||
![]() |
318dc18891 | ||
![]() |
8d327cd0a0 | ||
![]() |
d3de937ee0 | ||
![]() |
3be1673eb9 | ||
![]() |
13f23ace76 | ||
![]() |
26c50f15dc | ||
![]() |
46aa58d0cd | ||
![]() |
aac9dd40de | ||
![]() |
71dba1b7dc | ||
![]() |
8b85e4e075 | ||
![]() |
028489d673 | ||
![]() |
5c4c14a17d | ||
![]() |
2e10a96d11 | ||
![]() |
09ad42ba47 | ||
![]() |
88ccaee5cc | ||
![]() |
e936a0b995 | ||
![]() |
ff5b0b7607 | ||
![]() |
edd2fd5e63 | ||
![]() |
08d97e0277 | ||
![]() |
21d0675035 | ||
![]() |
1dfb81917c | ||
![]() |
af8c92f090 | ||
![]() |
04e0242422 | ||
![]() |
110ffc3a01 | ||
![]() |
6b4a8bd627 | ||
![]() |
0d851fdb68 | ||
![]() |
5064f2c16d | ||
![]() |
ac46d0eef0 | ||
![]() |
70c71b69ee | ||
![]() |
4487113c58 | ||
![]() |
983f5b9ca4 | ||
![]() |
13612d3de9 | ||
![]() |
6317ca7183 | ||
![]() |
2b96aac1c8 | ||
![]() |
a6b75aefa4 | ||
![]() |
7dc72b435e | ||
![]() |
5a586f4700 | ||
![]() |
ef50a5f2cd | ||
![]() |
c2c3f6aa1b | ||
![]() |
9c8ca98e68 | ||
![]() |
3a18c9f327 | ||
![]() |
9438f6497d | ||
![]() |
5c3c3f8e70 | ||
![]() |
3d3c99cd22 | ||
![]() |
b3464e620e | ||
![]() |
72a38b0b68 | ||
![]() |
46e7f29820 | ||
![]() |
cb36015a38 | ||
![]() |
66cb10a3bf | ||
![]() |
bfdd99a028 | ||
![]() |
63ef75222e | ||
![]() |
072ba0a38f | ||
![]() |
576869bda0 | ||
![]() |
0d556b1b40 | ||
![]() |
0cd217b484 | ||
![]() |
907255837e | ||
![]() |
ebf33349a3 | ||
![]() |
ea6920b711 | ||
![]() |
53a47d470a | ||
![]() |
7fe7b6ce79 | ||
![]() |
0110704abd | ||
![]() |
aca23fc62f | ||
![]() |
c0a284927e | ||
![]() |
2d911c37a4 | ||
![]() |
1e7af27227 | ||
![]() |
06678a8b0a | ||
![]() |
e1706610c4 | ||
![]() |
7bb940d819 | ||
![]() |
b4e0120428 | ||
![]() |
db1013d926 | ||
![]() |
759dacd345 | ||
![]() |
903fd28953 | ||
![]() |
6c520babf0 | ||
![]() |
9bb2fda6df | ||
![]() |
d48b37ece1 | ||
![]() |
f4164e84e1 | ||
![]() |
33aabadaf5 | ||
![]() |
e815fda908 | ||
![]() |
fe04adee1d | ||
![]() |
115647a8c0 | ||
![]() |
ddd70eadf6 | ||
![]() |
319e00214e | ||
![]() |
6bdcfc2b6f | ||
![]() |
ae0a2238da | ||
![]() |
a69f9fe88b | ||
![]() |
696b57f990 | ||
![]() |
998c1b78c7 | ||
![]() |
8c207f094d | ||
![]() |
09c9c0ef51 | ||
![]() |
8cd571c96c | ||
![]() |
979af2925d | ||
![]() |
f092eab842 | ||
![]() |
3d4832ca85 | ||
![]() |
b120fc6f2f | ||
![]() |
c299ad92aa | ||
![]() |
956cd59385 | ||
![]() |
acbd802790 | ||
![]() |
c4bcecf5e0 | ||
![]() |
09949251ac | ||
![]() |
43218f1685 | ||
![]() |
eb7d01b3e7 | ||
![]() |
c58e6d58b4 | ||
![]() |
3a892e1a47 | ||
![]() |
5bb487e1fa | ||
![]() |
4ae091be4b | ||
![]() |
7654ab6be6 | ||
![]() |
193cc9dc10 | ||
![]() |
a6d268e1a1 | ||
![]() |
7822e94e61 | ||
![]() |
eb663fdbc1 | ||
![]() |
c738a40c05 | ||
![]() |
2ca3443b7f | ||
![]() |
06be4c03fa | ||
![]() |
32d77f4a7d | ||
![]() |
d217b1d561 | ||
![]() |
0167f0a3a4 | ||
![]() |
4304ad0faa | ||
![]() |
3be17376e4 | ||
![]() |
0b4fd4c17e | ||
![]() |
66c4499b2e | ||
![]() |
cde13177a4 | ||
![]() |
9fce2575ab | ||
![]() |
8f8e92c8c3 | ||
![]() |
8683d317fe | ||
![]() |
1178c619bc | ||
![]() |
2fa568eb01 | ||
![]() |
d62242d653 | ||
![]() |
991bf2f1f5 | ||
![]() |
2f241343ff | ||
![]() |
035de09c15 | ||
![]() |
d3a4407391 | ||
![]() |
395c16ce24 | ||
![]() |
f7accc01ad | ||
![]() |
3733154e63 | ||
![]() |
2ef95ddba9 | ||
![]() |
043f8cba22 | ||
![]() |
09ab172630 | ||
![]() |
c23a182bec | ||
![]() |
c321470382 | ||
![]() |
932bdd402c | ||
![]() |
3692671f49 | ||
![]() |
1cd4c35a79 | ||
![]() |
c0f7a48649 | ||
![]() |
c1258f160b | ||
![]() |
bdb9feb7c5 | ||
![]() |
830cbe7af2 | ||
![]() |
4eb83c0766 | ||
![]() |
210f2fef77 | ||
![]() |
d19a6160d2 | ||
![]() |
cd773cf73f | ||
![]() |
f3b9a10f7a | ||
![]() |
709283ff33 | ||
![]() |
fae261d7da | ||
![]() |
6b5e527b6b | ||
![]() |
b7005a310e | ||
![]() |
edd25b9264 | ||
![]() |
65a8b03ee4 | ||
![]() |
0044ec0ac0 | ||
![]() |
73111d854d | ||
![]() |
065ab98175 | ||
![]() |
cbeaeba828 | ||
![]() |
7af2a9444e | ||
![]() |
f476f3690a | ||
![]() |
fae02da4b1 | ||
![]() |
b0e4e29ce3 | ||
![]() |
11f7728b9d | ||
![]() |
7510b05d25 | ||
![]() |
e467f91262 | ||
![]() |
b03afb899d | ||
![]() |
ec71ff3c3c | ||
![]() |
02ce50ace2 | ||
![]() |
4a4a552a05 | ||
![]() |
5b3615d262 | ||
![]() |
2821488c93 | ||
![]() |
9814887b10 | ||
![]() |
3f86381541 | ||
![]() |
7736966dc1 |
835 changed files with 160282 additions and 131118 deletions
39
.github/ISSUE_TEMPLATE/bug_report.md
vendored
Normal file
39
.github/ISSUE_TEMPLATE/bug_report.md
vendored
Normal file
|
@ -0,0 +1,39 @@
|
|||
---
|
||||
name: Bug report
|
||||
about: Create a report to help us improve
|
||||
title: ''
|
||||
labels: bug
|
||||
assignees: ''
|
||||
|
||||
---
|
||||
|
||||
**Describe the bug**
|
||||
A clear and concise description of what the bug is.
|
||||
|
||||
**To Reproduce**
|
||||
Steps to reproduce the behavior:
|
||||
1. Go to '...'
|
||||
2. Click on '....'
|
||||
3. Scroll down to '....'
|
||||
4. See error
|
||||
|
||||
**Expected behavior**
|
||||
A clear and concise description of what you expected to happen.
|
||||
|
||||
**Screenshots (OPTIONAL)**
|
||||
If applicable, add screenshots to help explain your problem.
|
||||
|
||||
**Logs**
|
||||
- Paste the output of the console window in a text file, and attach the text file.
|
||||
- If applicable (`logfile` set to 2), attach the `qconsole.log` file. On Windows, it can be found in **%APPDATA%\...\qconsole.log** and on Linux, it can be found on the home directory **~/.openmohaa/.../qconsole.log**.
|
||||
|
||||
**Version information (please complete the following information):**
|
||||
- OS: [e.g. `Debian`]
|
||||
- OS Version [e.g `12`]
|
||||
- OpenMoHAA Version: [e.g `0.70.0-alpha+0.0b1a20dcf win_msvc64-x86_64-debug`, can be found below **Common Initialization** in the console, or by typing `version`]
|
||||
|
||||
**Dump (OPTIONAL)**
|
||||
You can include a core dump generated by the OS (`.dmp` file). If you compiled OpenMoHAA yourself, also add all output openmohaa binaries (except libopenal and libSDL).
|
||||
|
||||
**Additional context (OPTIONAL)**
|
||||
Add any other context about the problem here.
|
17
.github/workflows/branches-build.yml
vendored
Normal file
17
.github/workflows/branches-build.yml
vendored
Normal file
|
@ -0,0 +1,17 @@
|
|||
name: Build branch
|
||||
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- '**'
|
||||
pull_request:
|
||||
|
||||
concurrency:
|
||||
group: ${{ github.workflow }}-${{ github.ref }}
|
||||
cancel-in-progress: true
|
||||
|
||||
jobs:
|
||||
build-all:
|
||||
uses: ./.github/workflows/shared-build.yml
|
||||
with:
|
||||
environment: "testing"
|
192
.github/workflows/build-cmake.yml
vendored
192
.github/workflows/build-cmake.yml
vendored
|
@ -1,192 +0,0 @@
|
|||
name: Build
|
||||
|
||||
on:
|
||||
push:
|
||||
pull_request:
|
||||
workflow_call:
|
||||
|
||||
concurrency:
|
||||
group: ${{ github.workflow }}-${{ github.ref }}
|
||||
cancel-in-progress: true
|
||||
|
||||
env:
|
||||
# Customize the CMake build type here (Release, Debug, RelWithDebInfo, etc.)
|
||||
BUILD_TYPE: RelWithDebInfo
|
||||
|
||||
jobs:
|
||||
build-platform-linux:
|
||||
strategy:
|
||||
matrix:
|
||||
architecture: [
|
||||
{name: 'amd64', triple: 'x86_64-linux-gnu'},
|
||||
{name: 'i686', triple: 'i686-linux-gnu'},
|
||||
{name: 'aarch64', triple: 'aarch64-linux-gnu'},
|
||||
{name: 'armhf', triple: 'arm-linux-gnueabihf'}
|
||||
]
|
||||
|
||||
name: "Building for platform linux-${{matrix.architecture.name}}"
|
||||
runs-on: ubuntu-22.04
|
||||
|
||||
steps:
|
||||
- name: Settings
|
||||
working-directory: ${{github.workspace}}
|
||||
run: |
|
||||
echo "CMAKE_BUILD_PARALLEL_LEVEL=$(($(nproc) * 16))" >> $GITHUB_ENV
|
||||
# echo "CMAKE_GENERATOR=Ninja" >> $GITHUB_ENV
|
||||
|
||||
- name: Install required packages
|
||||
run: |
|
||||
sudo apt update && sudo apt install -y flex bison
|
||||
|
||||
- name: Install required cross-platform packages (${{ matrix.architecture.triple }})
|
||||
if: matrix.architecture.name != 'amd64'
|
||||
run: sudo apt install -y gcc-12-${{ matrix.architecture.triple }} g++-12-${{ matrix.architecture.triple }}
|
||||
|
||||
# Setup SDL
|
||||
- name: Set up SDL
|
||||
id: sdl
|
||||
uses: libsdl-org/setup-sdl@main
|
||||
with:
|
||||
version: sdl2-latest
|
||||
build-type: Release
|
||||
cmake-arguments: "-DCMAKE_C_COMPILER=clang
|
||||
-DCMAKE_CXX_COMPILER=clang++
|
||||
-DCMAKE_C_FLAGS=--target=${{ matrix.architecture.triple }}
|
||||
-DCMAKE_CXX_FLAGS=--target=${{ matrix.architecture.triple }}"
|
||||
|
||||
- uses: actions/checkout@v3
|
||||
with:
|
||||
path: 'source'
|
||||
|
||||
- name: CMake Settings
|
||||
run: |
|
||||
echo "CMAKE_PARAM=--log-level=VERBOSE \
|
||||
-DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}} \
|
||||
-DCMAKE_INSTALL_PREFIX='${{github.workspace}}/install' \
|
||||
-DCMAKE_C_COMPILER=clang \
|
||||
-DCMAKE_CXX_COMPILER=clang++ \
|
||||
-DCMAKE_C_FLAGS=--target=${{ matrix.architecture.triple }} \
|
||||
-DCMAKE_CXX_FLAGS=--target=${{ matrix.architecture.triple }} \
|
||||
-DGIT_REVISION_BUILD_NUMBER=${{ github.run_number }}" >> $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}}
|
||||
|
||||
- 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}}
|
||||
cp '${{steps.sdl.outputs.prefix}}/lib/libSDL2.so' '${{github.workspace}}/install'
|
||||
|
||||
- uses: actions/upload-artifact@v3
|
||||
with:
|
||||
name: out-linux-${{matrix.architecture.name}}
|
||||
if-no-files-found: error
|
||||
path:
|
||||
${{github.workspace}}/install
|
||||
|
||||
build-platform-windows:
|
||||
strategy:
|
||||
matrix:
|
||||
architecture: [
|
||||
{name: 'x64', config: 'x64' },
|
||||
{name: 'x86', config: 'Win32' },
|
||||
{name: 'arm64', config: 'ARM64' }
|
||||
]
|
||||
|
||||
name: "Building for platform windows-${{matrix.architecture.name}}"
|
||||
runs-on: windows-2022
|
||||
|
||||
steps:
|
||||
- name: Settings
|
||||
working-directory: ${{github.workspace}}
|
||||
run: |
|
||||
echo "CMAKE_BUILD_PARALLEL_LEVEL=$((Get-CimInstance Win32_ComputerSystem).NumberOfLogicalProcessors * 16)" >> $GITHUB_ENV
|
||||
|
||||
# Setup SDL
|
||||
- name: Set up SDL
|
||||
id: sdl
|
||||
uses: libsdl-org/setup-sdl@main
|
||||
with:
|
||||
version: sdl2-latest
|
||||
build-type: Release
|
||||
cmake-arguments: "-A ${{ matrix.architecture.config }}"
|
||||
|
||||
- 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
|
||||
|
||||
- uses: actions/checkout@v3
|
||||
with:
|
||||
path: 'source'
|
||||
|
||||
- name: CMake Settings
|
||||
run: |
|
||||
echo "CMAKE_PARAM=-A ${{ matrix.architecture.config }} `
|
||||
--log-level=VERBOSE `
|
||||
-DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}} `
|
||||
-DCMAKE_INSTALL_PREFIX='${{github.workspace}}/install' `
|
||||
-DGIT_REVISION_BUILD_NUMBER=${{ github.run_number }} `
|
||||
-DBISON_EXECUTABLE='${{github.workspace}}/thirdparties/winflexbison-install/win_bison.exe' `
|
||||
-DFLEX_EXECUTABLE='${{github.workspace}}/thirdparties/winflexbison-install/win_flex.exe'".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}}
|
||||
|
||||
- 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-Item '${{steps.sdl.outputs.prefix}}/bin/*.dll' -Destination '${{github.workspace}}/install'
|
||||
|
||||
- uses: actions/upload-artifact@v3
|
||||
with:
|
||||
name: out-windows-${{matrix.architecture.name}}
|
||||
if-no-files-found: error
|
||||
path: |
|
||||
${{github.workspace}}/install
|
||||
!${{github.workspace}}/install/**/*.pdb
|
||||
|
||||
- uses: actions/upload-artifact@v3
|
||||
with:
|
||||
name: out-windows-${{matrix.architecture.name}}-pdb
|
||||
if-no-files-found: error
|
||||
path: |
|
||||
${{github.workspace}}/install
|
|
@ -20,6 +20,10 @@ on:
|
|||
schedule:
|
||||
- cron: '42 8 * * 1'
|
||||
|
||||
concurrency:
|
||||
group: ${{ github.workflow }}-${{ github.ref }}
|
||||
cancel-in-progress: true
|
||||
|
||||
jobs:
|
||||
analyze:
|
||||
name: Analyze
|
||||
|
@ -41,7 +45,13 @@ jobs:
|
|||
|
||||
steps:
|
||||
- name: Checkout repository
|
||||
uses: actions/checkout@v3
|
||||
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
|
||||
|
@ -52,7 +62,7 @@ jobs:
|
|||
|
||||
# Initializes the CodeQL tools for scanning.
|
||||
- name: Initialize CodeQL
|
||||
uses: github/codeql-action/init@v2
|
||||
uses: github/codeql-action/init@v3
|
||||
with:
|
||||
languages: ${{ matrix.language }}
|
||||
# If you wish to specify custom queries, you can do so here or in a config file.
|
||||
|
@ -66,7 +76,7 @@ jobs:
|
|||
# Autobuild attempts to build any compiled languages (C/C++, C#, Go, Java, or Swift).
|
||||
# If this step fails, then you should remove it and run the build manually (see below)
|
||||
- name: Autobuild
|
||||
uses: github/codeql-action/autobuild@v2
|
||||
uses: github/codeql-action/autobuild@v3
|
||||
|
||||
# ℹ️ Command-line programs to run using the OS shell.
|
||||
# 📚 See https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#jobsjob_idstepsrun
|
||||
|
@ -79,6 +89,6 @@ jobs:
|
|||
# ./location_of_script_within_repo/buildscript.sh
|
||||
|
||||
- name: Perform CodeQL Analysis
|
||||
uses: github/codeql-action/analyze@v2
|
||||
uses: github/codeql-action/analyze@v3
|
||||
with:
|
||||
category: "/language:${{matrix.language}}"
|
246
.github/workflows/shared-build-linux.yml
vendored
Normal file
246
.github/workflows/shared-build-linux.yml
vendored
Normal file
|
@ -0,0 +1,246 @@
|
|||
##########################
|
||||
#
|
||||
# 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 build workflow
|
||||
|
||||
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: 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/'
|
||||
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
|
239
.github/workflows/shared-build-macos.yml
vendored
Normal file
239
.github/workflows/shared-build-macos.yml
vendored
Normal file
|
@ -0,0 +1,239 @@
|
|||
##########################
|
||||
#
|
||||
# Apple macOS
|
||||
# macOS 15
|
||||
#
|
||||
# This version is used as the OS, as it's faster than other versions.
|
||||
##########################
|
||||
name: MacOS build workflow
|
||||
|
||||
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: 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/'
|
||||
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
|
259
.github/workflows/shared-build-windows.yml
vendored
Normal file
259
.github/workflows/shared-build-windows.yml
vendored
Normal file
|
@ -0,0 +1,259 @@
|
|||
##########################
|
||||
#
|
||||
# Microsoft Windows
|
||||
# Windows Server 2025
|
||||
#
|
||||
##########################
|
||||
name: Windows build workflow
|
||||
|
||||
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' `
|
||||
-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: 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'
|
||||
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' }
|
||||
|
||||
###
|
||||
# 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
|
24
.github/workflows/shared-build.yml
vendored
Normal file
24
.github/workflows/shared-build.yml
vendored
Normal file
|
@ -0,0 +1,24 @@
|
|||
name: Shared build workflow
|
||||
|
||||
on:
|
||||
workflow_call:
|
||||
inputs:
|
||||
environment:
|
||||
required: true
|
||||
type: string
|
||||
|
||||
jobs:
|
||||
build-platform-linux:
|
||||
uses: ./.github/workflows/shared-build-linux.yml
|
||||
with:
|
||||
environment: ${{inputs.environment}}
|
||||
|
||||
build-platform-windows:
|
||||
uses: ./.github/workflows/shared-build-windows.yml
|
||||
with:
|
||||
environment: ${{inputs.environment}}
|
||||
|
||||
build-platform-macos:
|
||||
uses: ./.github/workflows/shared-build-macos.yml
|
||||
with:
|
||||
environment: ${{inputs.environment}}
|
|
@ -6,7 +6,7 @@ on:
|
|||
- "v*.*.*"
|
||||
|
||||
env:
|
||||
RELEASE_TYPE: ${{ vars.RELEASE_TYPE || 'test' }}
|
||||
RELEASE_STAGE: ${{ vars.RELEASE_STAGE || 'unstable' }}
|
||||
RELEASE_IS_PRERELEASE: ${{ vars.RELEASE_IS_PRELEASE }}
|
||||
|
||||
permissions:
|
||||
|
@ -14,7 +14,9 @@ permissions:
|
|||
|
||||
jobs:
|
||||
build-all:
|
||||
uses: ./.github/workflows/build-cmake.yml
|
||||
uses: ./.github/workflows/shared-build.yml
|
||||
with:
|
||||
environment: "release"
|
||||
|
||||
deploy_all:
|
||||
strategy:
|
||||
|
@ -25,36 +27,42 @@ jobs:
|
|||
target_os: [
|
||||
'linux-amd64',
|
||||
'linux-i686',
|
||||
'linux-aarch64',
|
||||
'linux-arm64',
|
||||
'linux-armhf',
|
||||
'linux-powerpc',
|
||||
'linux-ppc64',
|
||||
'linux-ppc64el',
|
||||
'windows-x64',
|
||||
'windows-x86',
|
||||
'windows-x64-pdb',
|
||||
'windows-x86',
|
||||
'windows-x86-pdb',
|
||||
'windows-arm64',
|
||||
'windows-arm64-pdb'
|
||||
'windows-arm64-pdb',
|
||||
#'macos-x86_64',
|
||||
#'macos-arm64',
|
||||
'macos-multiarch(arm64-x86_64)',
|
||||
]
|
||||
|
||||
runs-on: ubuntu-22.04
|
||||
environment: release
|
||||
runs-on: ubuntu-24.04
|
||||
environment: "release"
|
||||
needs: [build-all]
|
||||
|
||||
env:
|
||||
RELEASE_NAME: ${{ github.event.repository.name }}-${{github.ref_name}}-${{matrix.target_os}}
|
||||
|
||||
steps:
|
||||
- uses: actions/download-artifact@v3
|
||||
- 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 ./
|
||||
working-directory: '${{github.workspace}}/${{matrix.target_os}}'
|
||||
run: zip -r "../${{ env.RELEASE_NAME }}.zip" ./
|
||||
|
||||
- name: Release
|
||||
uses: softprops/action-gh-release@v1
|
||||
uses: softprops/action-gh-release@v2
|
||||
with:
|
||||
name: '${{github.ref_name}}-${{env.RELEASE_TYPE}}'
|
||||
name: '${{github.ref_name}}-${{env.RELEASE_STAGE}}'
|
||||
prerelease: ${{env.RELEASE_IS_PRERELEASE}}
|
||||
files: ${{github.workspace}}/${{ env.RELEASE_NAME }}.zip
|
5
.gitignore
vendored
5
.gitignore
vendored
|
@ -5,6 +5,8 @@ Makefile.local
|
|||
*.swp
|
||||
*tags
|
||||
*~
|
||||
/.vscode/
|
||||
/baseq3
|
||||
|
||||
# OS X
|
||||
####################
|
||||
|
@ -44,5 +46,6 @@ profile
|
|||
*.suo
|
||||
|
||||
.vs
|
||||
out
|
||||
code_unfinished/*
|
||||
thirdparties/
|
||||
code/parser/generated/*
|
||||
|
|
220
CMakeLists.txt
220
CMakeLists.txt
|
@ -1,27 +1,58 @@
|
|||
cmake_minimum_required(VERSION 3.5)
|
||||
cmake_minimum_required(VERSION 3.12)
|
||||
project(openmohaa)
|
||||
|
||||
include(TargetArch.cmake)
|
||||
include(misc/cmake/TargetArch.cmake)
|
||||
|
||||
target_architecture(TARGET_ARCH)
|
||||
list(LENGTH TARGET_ARCH TARGET_ARCH_COUNT)
|
||||
|
||||
set(USE_INTERNAL_LIBS ON)
|
||||
if(USE_SYSTEM_LIBS)
|
||||
set(USE_INTERNAL_LIBS OFF)
|
||||
endif()
|
||||
|
||||
option(USE_INTERNAL_JPEG "If set, use bundled libjpeg." ${USE_INTERNAL_LIBS})
|
||||
option(USE_INTERNAL_MAD "If set, use bundled libmad." ${USE_INTERNAL_LIBS})
|
||||
option(USE_INTERNAL_ZLIB "If set, use bundled zlib." ${USE_INTERNAL_LIBS})
|
||||
option(USE_RENDERER_DLOPEN "Whether to compile the renderer as separate pluggable modules" OFF)
|
||||
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.")
|
||||
endif()
|
||||
|
||||
|
||||
set(TARGET_BASE_GAME "./")
|
||||
set(CMAKE_DEBUG_POSTFIX "-dbg")
|
||||
|
||||
#
|
||||
# Microsoft compiler specific parameters
|
||||
#
|
||||
if(MSVC)
|
||||
add_definitions(-D_CRT_SECURE_NO_WARNINGS -D_CRT_NONSTDC_NO_DEPRECATE)
|
||||
elseif(CMAKE_CXX_COMPILER_ID STREQUAL "Clang")
|
||||
# Treat no return type as error
|
||||
add_compile_options(/we4715)
|
||||
endif()
|
||||
|
||||
#
|
||||
# Clang and GCC specific parameters
|
||||
#
|
||||
if(CMAKE_C_COMPILER_ID MATCHES "Clang" OR CMAKE_CXX_COMPILER_ID MATCHES "Clang" OR CMAKE_C_COMPILER_ID STREQUAL "GNU" OR CMAKE_CXX_COMPILER_ID STREQUAL "GNU")
|
||||
add_compile_options(-Wno-comment)
|
||||
# Treat no return type as error
|
||||
add_compile_options(-Werror=return-type)
|
||||
endif()
|
||||
|
||||
#
|
||||
# Clang specific parameters
|
||||
#
|
||||
if(CMAKE_CXX_COMPILER_ID STREQUAL "Clang")
|
||||
# Ignore warnings for code like 'assert("Assert string")'
|
||||
add_compile_options(-Wno-pointer-bool-conversion)
|
||||
endif()
|
||||
|
||||
#
|
||||
# GCC specific parameters
|
||||
#
|
||||
if (CMAKE_CXX_COMPILER_ID STREQUAL "GNU")
|
||||
# Add this option on gcc to prevent functions from having the STB_GNU_UNIQUE binding
|
||||
# Otherwise, it would prevent libraries from being unloaded
|
||||
|
@ -33,26 +64,40 @@ if(DEBUG_MEMORY)
|
|||
add_definitions(-D_DEBUG_MEM)
|
||||
endif()
|
||||
|
||||
IF("${TARGET_ARCH}" STREQUAL "i386")
|
||||
if("${TARGET_ARCH}" STREQUAL "i386")
|
||||
set(TARGET_ARCH_SUFFIX "x86")
|
||||
ELSE()
|
||||
else()
|
||||
set(TARGET_ARCH_SUFFIX ${TARGET_ARCH})
|
||||
ENDIF()
|
||||
endif()
|
||||
|
||||
message(STATUS "Architecture detected: ${TARGET_ARCH}, suffix set to ${TARGET_ARCH_SUFFIX}.")
|
||||
message(STATUS "Architecture detected: ${TARGET_ARCH}")
|
||||
|
||||
IF(WIN32)
|
||||
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()
|
||||
|
||||
if(WIN32)
|
||||
set(TARGET_PLATFORM_PREFIX "")
|
||||
message(STATUS "Using Win32 naming convention")
|
||||
ELSEIF(UNIX)
|
||||
elseif(UNIX)
|
||||
set(TARGET_PLATFORM_PREFIX "")
|
||||
message(STATUS "Using Unix naming convention")
|
||||
ELSE()
|
||||
else()
|
||||
set(TARGET_PLATFORM_PREFIX "")
|
||||
ENDIF()
|
||||
endif()
|
||||
|
||||
IF(CMAKE_BUILD_TYPE MATCHES Debug)
|
||||
add_definitions(-D_DEBUG)
|
||||
if(CMAKE_BUILD_TYPE MATCHES Debug)
|
||||
add_compile_definitions(_DEBUG)
|
||||
|
||||
# NOTE: The following may mess up function importation
|
||||
#if(UNIX)
|
||||
|
@ -60,18 +105,60 @@ IF(CMAKE_BUILD_TYPE MATCHES Debug)
|
|||
# set(CMAKE_ENABLE_EXPORTS ON)
|
||||
# message(STATUS "Enabling exports on Unix for backtrace")
|
||||
#endif()
|
||||
ENDIF()
|
||||
else()
|
||||
# Non-debug builds
|
||||
add_compile_definitions(NDEBUG)
|
||||
endif()
|
||||
|
||||
if(APPLE)
|
||||
# macOS doesn't search the executable path by default
|
||||
# so, locate libraries like SDL in the executable path
|
||||
set(CMAKE_INSTALL_RPATH "@executable_path")
|
||||
set(CMAKE_BUILD_WITH_INSTALL_RPATH ON)
|
||||
|
||||
if(CMAKE_C_COMPILER_ID MATCHES "Clang" OR CMAKE_C_COMPILER_ID STREQUAL "GNU")
|
||||
# Set the visibility to hidden on macOS to prevent shared libraries from
|
||||
# using functions in the executable
|
||||
# it's ok to hide them because the backtrace on macOS will still print the name of the functions
|
||||
add_compile_options(-fvisibility=hidden)
|
||||
endif()
|
||||
endif()
|
||||
|
||||
#
|
||||
# Setup the installation directory
|
||||
#
|
||||
if(WIN32)
|
||||
# By default, both DLLs and EXEs are in the same directory
|
||||
set(CMAKE_DEFAULT_INSTALL_RUNTIME_DIR bin)
|
||||
set(BIN_INSTALL_SUBDIR ".")
|
||||
set(LIB_INSTALL_SUBDIR ".")
|
||||
else()
|
||||
# Unix
|
||||
set(CMAKE_DEFAULT_INSTALL_RUNTIME_DIR lib${CMAKE_LIB_SUFFIX})
|
||||
set(BIN_INSTALL_SUBDIR ${CMAKE_PROJECT_NAME})
|
||||
set(LIB_INSTALL_SUBDIR ${CMAKE_PROJECT_NAME})
|
||||
endif()
|
||||
|
||||
# By default, put both binaries and shared libraries in the same directory
|
||||
# the game uses internal shared libraries that must be in the same folder as the binaries
|
||||
set(CMAKE_INSTALL_BINDIR ${CMAKE_DEFAULT_INSTALL_RUNTIME_DIR} CACHE PATH "Binary dir")
|
||||
set(CMAKE_INSTALL_LIBDIR ${CMAKE_INSTALL_BINDIR} CACHE PATH "Library dir")
|
||||
include(GNUInstallDirs)
|
||||
|
||||
#
|
||||
# Common stuff
|
||||
|
||||
#
|
||||
add_subdirectory("code/qcommon")
|
||||
add_subdirectory("code/gamespy")
|
||||
|
||||
#
|
||||
# Application
|
||||
|
||||
#
|
||||
add_subdirectory("code/sys")
|
||||
|
||||
##
|
||||
## Server app
|
||||
##
|
||||
add_subdirectory("code/server")
|
||||
|
||||
add_executable(omohaaded "code/null/null_client.c" "code/null/null_input.c" "code/null/null_snddma.c")
|
||||
|
@ -82,57 +169,104 @@ target_link_libraries(omohaaded PRIVATE omohserver)
|
|||
target_link_libraries(omohaaded PRIVATE syslib)
|
||||
target_link_libraries(omohaaded PRIVATE qcommon qcommon_standalone)
|
||||
|
||||
# Gamespy dependency
|
||||
# Add the gamespy dependency
|
||||
target_include_directories(omohaaded PUBLIC "code/qcommon" "code/script" "code/gamespy" "code/server")
|
||||
set_target_properties(omohaaded PROPERTIES OUTPUT_NAME "omohaaded${TARGET_BASE_SUFFIX}${TARGET_ARCH_SUFFIX}")
|
||||
set_target_properties(omohaaded PROPERTIES OUTPUT_NAME "omohaaded${TARGET_BIN_SUFFIX}")
|
||||
set_target_properties(omohaaded PROPERTIES DEBUG_POSTFIX ${CMAKE_DEBUG_POSTFIX})
|
||||
|
||||
INSTALL(TARGETS omohaaded DESTINATION ${CMAKE_INSTALL_BINDIR}/${BIN_INSTALL_SUBDIR})
|
||||
|
||||
if (MSVC)
|
||||
target_link_options(omohaaded PRIVATE "/MANIFEST:NO")
|
||||
INSTALL(FILES $<TARGET_PDB_FILE:omohaaded> DESTINATION "./" OPTIONAL)
|
||||
INSTALL(FILES $<TARGET_PDB_FILE:omohaaded> DESTINATION ${CMAKE_INSTALL_BINDIR}/${BIN_INSTALL_SUBDIR} OPTIONAL)
|
||||
endif()
|
||||
|
||||
INSTALL(TARGETS omohaaded DESTINATION "./")
|
||||
|
||||
if (NOT BUILD_NO_CLIENT)
|
||||
##
|
||||
## Client app
|
||||
##
|
||||
option(NO_MODERN_DMA "Use older sound-system" FALSE)
|
||||
|
||||
add_subdirectory("code/renderer")
|
||||
add_subdirectory("code/sdl")
|
||||
add_subdirectory("code/client")
|
||||
|
||||
#include("code/renderergl2/glsl/shaders.cmake")
|
||||
#file(GLOB_RECURSE SOURCES_RENDERER "code/sdl/*.c" "code/renderercommon/*.c" "code/renderergl2/*.c" "code/renderergl2/*.cpp")
|
||||
#list(FILTER SOURCES_RENDERER EXCLUDE REGEX "code/renderergl2/tr_subs.c")
|
||||
#list(FILTER SOURCES_RENDERER EXCLUDE REGEX "code/renderergl2/tr_model.c")
|
||||
add_subdirectory("code/renderercommon")
|
||||
add_subdirectory("code/sdl")
|
||||
|
||||
add_executable(openmohaa "misc/dummy.c")
|
||||
target_link_libraries(openmohaa PRIVATE syslib)
|
||||
target_link_libraries(openmohaa PRIVATE omohserver)
|
||||
target_link_libraries(openmohaa PRIVATE omohclient)
|
||||
target_link_libraries(openmohaa PRIVATE omohrenderer omohsdl)
|
||||
target_link_libraries(openmohaa PRIVATE omohrenderer)
|
||||
target_link_libraries(openmohaa PRIVATE qcommon qcommon_standalone)
|
||||
|
||||
### Gamespy dependency
|
||||
target_include_directories(openmohaa PUBLIC "code/qcommon" "code/script" "code/gamespy" "code/server" "code/client" "code/uilib" "code/jpeg-8c")
|
||||
set_target_properties(openmohaa PROPERTIES OUTPUT_NAME "openmohaa${TARGET_BASE_SUFFIX}${TARGET_ARCH_SUFFIX}")
|
||||
# Add the gamespy dependency
|
||||
target_include_directories(openmohaa PUBLIC "code/qcommon" "code/script" "code/gamespy" "code/server" "code/client" "code/uilib")
|
||||
set_target_properties(openmohaa PROPERTIES OUTPUT_NAME "openmohaa${TARGET_BIN_SUFFIX}")
|
||||
set_target_properties(openmohaa PROPERTIES DEBUG_POSTFIX ${CMAKE_DEBUG_POSTFIX})
|
||||
|
||||
if(USE_INTERNAL_JPEG)
|
||||
target_include_directories(openmohaa PUBLIC "code/jpeg-8c")
|
||||
target_link_libraries(openmohaa PRIVATE jpeg8)
|
||||
if (USE_OPENAL)
|
||||
# Try to use OpenAL
|
||||
find_package(OpenAL)
|
||||
if (OPENAL_FOUND)
|
||||
target_compile_definitions(openmohaa PRIVATE USE_OPENAL=1)
|
||||
target_include_directories(openmohaa PRIVATE ${OPENAL_INCLUDE_DIR})
|
||||
target_link_libraries(openmohaa PRIVATE ${OPENAL_LIBRARY})
|
||||
endif()
|
||||
else()
|
||||
find_package(JPEG REQUIRED)
|
||||
target_include_directories(openmohaa PUBLIC ${JPEG_INCLUDE_DIRS})
|
||||
target_link_libraries(openmohaa PRIVATE ${JPEG_LIBRARIES})
|
||||
endif()
|
||||
|
||||
INSTALL(TARGETS openmohaa DESTINATION ${CMAKE_INSTALL_BINDIR}/${BIN_INSTALL_SUBDIR})
|
||||
|
||||
if (MSVC)
|
||||
target_link_options(openmohaa PRIVATE "/MANIFEST:NO")
|
||||
INSTALL(FILES $<TARGET_PDB_FILE:openmohaa> DESTINATION "./" OPTIONAL)
|
||||
INSTALL(FILES $<TARGET_PDB_FILE:openmohaa> DESTINATION ${CMAKE_INSTALL_BINDIR}/${BIN_INSTALL_SUBDIR} OPTIONAL)
|
||||
endif()
|
||||
|
||||
INSTALL(TARGETS openmohaa DESTINATION "./")
|
||||
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
|
||||
${CMAKE_BINARY_DIR}/misc/linux/org.openmoh.openmohaa.desktop
|
||||
@ONLY
|
||||
)
|
||||
configure_file(
|
||||
misc/linux/org.openmoh.openmohaab.desktop.in
|
||||
${CMAKE_BINARY_DIR}/misc/linux/org.openmoh.openmohaab.desktop
|
||||
@ONLY
|
||||
)
|
||||
configure_file(
|
||||
misc/linux/org.openmoh.openmohaas.desktop.in
|
||||
${CMAKE_BINARY_DIR}/misc/linux/org.openmoh.openmohaas.desktop
|
||||
@ONLY
|
||||
)
|
||||
|
||||
# Install .desktop entries
|
||||
install(FILES ${CMAKE_BINARY_DIR}/misc/linux/org.openmoh.openmohaa.desktop DESTINATION ${CMAKE_INSTALL_DATADIR}/applications)
|
||||
install(FILES ${CMAKE_BINARY_DIR}/misc/linux/org.openmoh.openmohaab.desktop DESTINATION ${CMAKE_INSTALL_DATADIR}/applications)
|
||||
install(FILES ${CMAKE_BINARY_DIR}/misc/linux/org.openmoh.openmohaas.desktop DESTINATION ${CMAKE_INSTALL_DATADIR}/applications)
|
||||
|
||||
install(FILES misc/linux/org.openmoh.openmohaa.metainfo.xml DESTINATION ${CMAKE_INSTALL_DATADIR}/metainfo)
|
||||
|
||||
install(FILES misc/openmohaa.svg DESTINATION ${CMAKE_INSTALL_DATADIR}/icons/hicolor/symbolic/apps/ RENAME org.openmoh.openmohaa.svg)
|
||||
endif()
|
||||
endif()
|
||||
|
||||
#
|
||||
# Launcher
|
||||
#
|
||||
add_subdirectory(code/Launcher)
|
||||
|
||||
#
|
||||
# uninstall target
|
||||
#
|
||||
if(NOT TARGET uninstall)
|
||||
configure_file(
|
||||
"${CMAKE_CURRENT_SOURCE_DIR}/cmake_uninstall.cmake.in"
|
||||
"${CMAKE_CURRENT_BINARY_DIR}/cmake_uninstall.cmake"
|
||||
IMMEDIATE @ONLY)
|
||||
|
||||
add_custom_target(uninstall
|
||||
COMMAND ${CMAKE_COMMAND} -P ${CMAKE_CURRENT_BINARY_DIR}/cmake_uninstall.cmake)
|
||||
endif()
|
||||
|
|
179
README.md
179
README.md
|
@ -1,153 +1,53 @@
|
|||
# OpenMoHAA
|
||||
|
||||
 [](https://github.com/openmoh/openmohaa/releases) [](https://github.com/openmoh/openmohaa/releases)
|
||||
[](https://github.com/openmoh/openmohaa/actions/workflows/branches-build.yml) [](https://github.com/openmoh/openmohaa/releases) [](https://github.com/openmoh/openmohaa/releases)
|
||||
|
||||
 
|
||||
|
||||

|
||||
|
||||
|
||||
```
|
||||
/ _ \ _ __ ___ _ __ | \/ |/ _ \| | | | / \ / \
|
||||
| | | | '_ \ / _ \ '_ \| |\/| | | | | |_| | / _ \ / _ \
|
||||
| |_| | |_) | __/ | | | | | | |_| | _ |/ ___ \ / ___ \
|
||||
\___/| .__/ \___|_| |_|_| |_|\___/|_| |_/_/ \_\/_/ \_\
|
||||
|_|
|
||||
```
|
||||
|
||||
## Current State
|
||||
|
||||
OpenMoHAA is still under development. The single-player campaign is not yet functional due to AI not being fully stable. But the `training` map can be played from start to end. The current focus is on multiplayer.
|
||||

|
||||
|
||||
## Intro
|
||||
|
||||
The main goal of OpenMoHAA is to ensure the future and continuity of **Medal of Honor: Allied Assault**. It has always been a dream in the community to provide patches and security fixes for the game. Thanks to the ioquake3 project, F.A.K.K SDK and other quality tools, OpenMoHAA has already reached more than half of its goal: to create an open-source version of MoH:AA (based on version 2.40) that is fully compatible with the original game (in terms of protocol, assets, and scripts).
|
||||
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).
|
||||
|
||||
## Running
|
||||
## Getting started
|
||||
|
||||
Ensure that you download the binaries compatible with your platform.
|
||||
- [Downloading and installing OpenMoHAA](docs/getting_started_installation.md)
|
||||
- [Running OpenMoHAA and using expansion assets](docs/getting_started_running.md)
|
||||
- [Game configuration](docs/configuration.md)
|
||||
|
||||
### Requirements
|
||||
If you encounter any issues, please refer to the [FAQ](docs/faq.md) for possible solutions.
|
||||
|
||||
You may need to install Microsoft Visual C++ 2015/2017/2019/2022 Redistributable from https://learn.microsoft.com/en-US/cpp/windows/latest-supported-vc-redist?view=msvc-170
|
||||
## Current state
|
||||
|
||||
### Client
|
||||
### Single-player
|
||||
|
||||
a) extract archive to your MOHAA installation directory.
|
||||
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.
|
||||
|
||||
-or-
|
||||
### Multiplayer
|
||||
|
||||
b) extract archive somewhere on your hard drive, create a shortcut to openmohaa (or omohaaded), and set the start directory to your MOHAA installation directory.
|
||||
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.
|
||||
|
||||
### Server
|
||||
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).
|
||||
|
||||
Extract the archive to your MOHAA server installation directory. Then proceed like you would do with mohaa server:
|
||||
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.
|
||||
|
||||
- `.\omohaaded.exe +exec server.cfg` on Windows
|
||||
- `./omohaaded +exec server.cfg` on Linux
|
||||
## Features
|
||||
|
||||
Only `omohaaded*` and `game*` binaries are required for the server version, other binaries can be omitted.
|
||||
- [List of new features](docs/features.md)
|
||||
- [Scripting](docs/scripting.md)
|
||||
|
||||
### Config file
|
||||
## Reporting issues
|
||||
|
||||
The config file can be found in different locations depending on the platform:
|
||||
If you encounter a bug, report it by creating a new [issue](https://github.com/openmoh/openmohaa/issues). Make sure to select the `Bug report` template and fill in the appropriate fields.
|
||||
|
||||
- `%APPDATA%\openmohaa\<game_name>\configs\omconfig.cfg` on Windows
|
||||
- `~/.openmohaa/<game_name>/configs/omconfig.cfg` on Linux
|
||||
|
||||
This has two advantages:
|
||||
- On a multi-user system, each user will have their own configuration file
|
||||
- It doesn't overwrite the existing MOHAA configuration in the MOHAA installation directory.
|
||||
|
||||
### Game selection
|
||||
|
||||
**Medal of Honor: Allied Assault Spearhead** and **Medal of Honor: Allied Assault Breakthrough** are supported in OpenMoHAA using the `com_target_game` variable. To play an expansion, append the following command-line arguments to the executable:
|
||||
|
||||
- `+set com_target_game 1` for Spearhead (mohaas/mohta)
|
||||
- `+set com_target_game 2` for Breakthrough (mohaab/mohtt)
|
||||
|
||||
On Windows, you can create a shortcut to OpenMoHAA with these command-line arguments.
|
||||
The default value of `com_target_game` is 0 for the base game (main).
|
||||
|
||||
With `com_target_game`, OpenMoHAA will support the network protocol accordingly.
|
||||
|
||||
You can now start a local OpenMOHAA server or play on a server.
|
||||
|
||||
### Playing with bots
|
||||
|
||||
OpenMoHAA has a basic bot system that emulates real players. The maximum number of bots is defined by the `sv_maxbots` variable, and the number of initial bots is defined by the `sv_numbots` variable. Bots can also be added or removed using the `addbot` and `removebot` commands.
|
||||
|
||||
This feature is a great way to test the gameplay and mods.
|
||||
|
||||
## Builds
|
||||
|
||||
### Server
|
||||
|
||||
The server version can be built successfully, but some features are not functional. For example, the Actor system is almost fully implemented, but it is not yet stable. This means that Actor may not work as expected and could cause crashes.
|
||||
|
||||
Overall, the server and the fgame components are almost fully implemented, but they may not be completely stable. There could be some minor bugs (and rare crashes), but the game should be playable.
|
||||
|
||||
### Client
|
||||
|
||||
The client version of OpenMoHAA has undergone partial implementation, with the cgame module being nearly completed. Credits to the SDK of **Heavy Metal: F.A.K.K. 2** both the cgame and fgame modules.
|
||||
|
||||
The current operational status for each component is as follow:
|
||||
|
||||
| Component | Full | Almost | Half | Early | Bad | Not working | Comment |
|
||||
|-------------------------|------|--------|------|-------|-----|-------------|-------------------------------------------------------------------|
|
||||
| Audio | | | | | x | | Very basic implementation from Quake III |
|
||||
| CG Module | | x | | | | | Missing FX, Marks and decals |
|
||||
| Client | | x | | | | | Missing GameSpy, server list, binds, map picker, ... |
|
||||
| Collision | x | | | | | | |
|
||||
| Model/TIKI/Skeletor | x | | | | | | |
|
||||
| Renderer | | x | | | | | Missing ghost, marks, sphere lights, sky portal, sun flare, swipe |
|
||||
| Server | | x | | | | | Probably a few bugs remaining |
|
||||
| Server module (fgame) | | x | | | | | Actor, and few gameplay bugs |
|
||||
| UI | | | x | | | | Has core features only (menu, widgets, console, hud, urc loading) |
|
||||
If you need help or have a problem, you can head over to the [discussions](https://github.com/openmoh/openmohaa/discussions) or join the OpenMoHAA Discord server (the link is at the bottom of this README).
|
||||
|
||||
## Compiling
|
||||
|
||||
OpenMoHAA supports any architecture, thanks to the CMake build system and cross-platform code/libraries. While the most common little-Endian architectures (arm, aarch64, x86, x86_64) have been tested and confirmed to work, big-Endian architectures should be supported as well; however, they remain untested.
|
||||
|
||||
The following tools are required for all platforms:
|
||||
- CMake >= 3.5
|
||||
- Flex (>= 2.6.4) and Bison (>= 3.5.1)
|
||||
- A C++11 compiler is also required.
|
||||
|
||||
The installation directory can be set to the MOHAA directory.
|
||||
|
||||
By default, the build will produce both the client and dedicated server versions. The client can be omitted from the build by appending `-DBUILD_NO_CLIENT=1` to the CMake command-line arguments. Using this parameter will result in only the server portion being built.
|
||||
|
||||
### Linux
|
||||
|
||||
These are the tools required on Linux :
|
||||
- Clang >= 3.3 or GCC >= 4.8.5
|
||||
- libsdl2-dev
|
||||
|
||||
**clang-3.5** and **gcc-4.8.5** should work (tested on Ubuntu 16.04), but the latest version should be used.
|
||||
|
||||
Ubuntu 20.04 is the minimum version required to fully compile the project successfully.
|
||||
|
||||
1 line install command with clang:
|
||||
```sh
|
||||
sudo apt-get install -y cmake ninja-build clang lld flex bison libsdl2-dev
|
||||
```
|
||||
|
||||
Example with **CMake** and **ninja-build** installed:
|
||||
```sh
|
||||
mkdir .cmake && cd .cmake
|
||||
cmake -G Ninja ../
|
||||
```
|
||||
|
||||
Other compilers can be specified by appending `-DCMAKE_C_COMPILER=/path/to/compiler -DCMAKE_CXX_COMPILER=path/to/compiler` to the CMake command-line.
|
||||
|
||||
### Windows
|
||||
|
||||
Visual Studio (2019 or 2022) is generally preferred.
|
||||
|
||||
Flex and Bison can be downloaded from here: https://github.com/lexxmark/winflexbison/releases/tag/v2.5.25
|
||||
|
||||
Append `-DFLEX_EXECUTABLE=...\win_flex.exe -DBISON_EXECUTABLE=...\win_bison.exe` to the CMake command-line to use the package from the link above.
|
||||
- See [Compiling OpenMoHAA](docs/compiling.md)
|
||||
|
||||
## Screenshots
|
||||
|
||||
|
@ -159,41 +59,6 @@ Append `-DFLEX_EXECUTABLE=...\win_flex.exe -DBISON_EXECUTABLE=...\win_bison.exe`
|
|||
|
||||
*More screenshots [here](docs/images)*
|
||||
|
||||
## Features
|
||||
|
||||
### Features added and not present in MOH:AA
|
||||
|
||||
#### Server-side
|
||||
|
||||
- Bots
|
||||
- Spectate players in first-person
|
||||
- Demo recording
|
||||
- More script commands for mods
|
||||
- Non-PVS optimization
|
||||
|
||||
##### Non-PVS optimization
|
||||
|
||||
For each client, the server optimizes by only sending them information about other players that they can see. Clients won't see other players they can't see.
|
||||
|
||||
Enable this feature with `set sv_netoptimize 2`.
|
||||
|
||||
#### Client-side and server-side
|
||||
|
||||
- Security fixes and features from ioquake3
|
||||
- IPv6 support (from ioquake3)
|
||||
|
||||
### Objectives / planned features
|
||||
|
||||
This is a non-exhaustive list of objectives and planned features.
|
||||
|
||||
#### Server-side
|
||||
|
||||
- 100% compatibility with mohaa content
|
||||
- More feature for mods
|
||||
- Anticheat
|
||||
- Stats system
|
||||
- Multiple roles/abilities for server admins to reduce password-stealing
|
||||
|
||||
## Third party
|
||||
|
||||
### SDL
|
||||
|
|
21
cmake_uninstall.cmake.in
Normal file
21
cmake_uninstall.cmake.in
Normal file
|
@ -0,0 +1,21 @@
|
|||
if(NOT EXISTS "@CMAKE_BINARY_DIR@/install_manifest.txt")
|
||||
message(FATAL_ERROR "Cannot find install manifest: @CMAKE_BINARY_DIR@/install_manifest.txt")
|
||||
endif()
|
||||
|
||||
file(READ "@CMAKE_BINARY_DIR@/install_manifest.txt" files)
|
||||
string(REGEX REPLACE "\n" ";" files "${files}")
|
||||
foreach(file ${files})
|
||||
message(STATUS "Uninstalling $ENV{DESTDIR}${file}")
|
||||
if(IS_SYMLINK "$ENV{DESTDIR}${file}" OR EXISTS "$ENV{DESTDIR}${file}")
|
||||
execute_process(
|
||||
COMMAND "@CMAKE_COMMAND@" -E remove "$ENV{DESTDIR}${file}"
|
||||
OUTPUT_VARIABLE rm_out
|
||||
RESULT_VARIABLE rm_retval
|
||||
)
|
||||
if(NOT "${rm_retval}" STREQUAL 0)
|
||||
message(FATAL_ERROR "Problem when removing $ENV{DESTDIR}${file}")
|
||||
endif()
|
||||
else(IS_SYMLINK "$ENV{DESTDIR}${file}" OR EXISTS "$ENV{DESTDIR}${file}")
|
||||
message(STATUS "File $ENV{DESTDIR}${file} does not exist.")
|
||||
endif()
|
||||
endforeach()
|
551
code/AL/al.h
551
code/AL/al.h
|
@ -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.
|
||||
* 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,8 +250,8 @@ 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
|
||||
|
||||
|
@ -221,20 +261,22 @@ typedef void ALvoid;
|
|||
* 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 */
|
||||
|
|
230
code/AL/alc.h
230
code/AL/alc.h
|
@ -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 */
|
||||
|
|
897
code/AL/alext.h
897
code/AL/alext.h
|
@ -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 */
|
||||
|
|
135
code/AL/efx.h
135
code/AL/efx.h
|
@ -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 */
|
||||
|
|
38
code/Launcher/CMakeLists.txt
Normal file
38
code/Launcher/CMakeLists.txt
Normal file
|
@ -0,0 +1,38 @@
|
|||
cmake_minimum_required(VERSION 3.12)
|
||||
|
||||
project(Launcher)
|
||||
|
||||
set(LAUNCHER_SOURCES "${CMAKE_SOURCE_DIR}/code/Launcher/launch_main.cpp")
|
||||
|
||||
if (WIN32)
|
||||
set(LAUNCHER_SOURCES ${LAUNCHER_SOURCES}
|
||||
"${CMAKE_SOURCE_DIR}/code/Launcher/launch_win32.cpp"
|
||||
"${CMAKE_SOURCE_DIR}/code/sys/win_resource.rc")
|
||||
else()
|
||||
set(LAUNCHER_SOURCES ${LAUNCHER_SOURCES}
|
||||
"${CMAKE_SOURCE_DIR}/code/Launcher/launch_linux.cpp")
|
||||
endif()
|
||||
|
||||
function (create_launcher name type)
|
||||
if (NOT BUILD_NO_CLIENT)
|
||||
add_executable(openmohaa_launcher_${name} ${LAUNCHER_SOURCES})
|
||||
target_include_directories(openmohaa_launcher_${name} PUBLIC "../qcommon")
|
||||
target_compile_definitions(openmohaa_launcher_${name} PRIVATE NO_RC_MANIFEST=1 TARGET_GAME=${type})
|
||||
target_compile_features(openmohaa_launcher_${name} PRIVATE cxx_std_17)
|
||||
set_target_properties(openmohaa_launcher_${name} PROPERTIES OUTPUT_NAME "launch_openmohaa_${name}${TARGET_BIN_SUFFIX}")
|
||||
|
||||
INSTALL(TARGETS openmohaa_launcher_${name} DESTINATION ${CMAKE_INSTALL_BINDIR}/${BIN_INSTALL_SUBDIR})
|
||||
endif()
|
||||
|
||||
#add_executable(omohaaded_launcher_${name} ${LAUNCHER_SOURCES})
|
||||
#target_include_directories(omohaaded_launcher_${name} PUBLIC "../qcommon")
|
||||
#target_compile_definitions(omohaaded_launcher_${name} PRIVATE NO_RC_MANIFEST=1 TARGET_GAME=${type} DEDICATED=1)
|
||||
#target_compile_features(omohaaded_launcher_${name} PRIVATE cxx_std_17)
|
||||
#set_target_properties(omohaaded_launcher_${name} PROPERTIES OUTPUT_NAME "launch_omohaaded_${name}${TARGET_BIN_SUFFIX}")
|
||||
#
|
||||
#INSTALL(TARGETS omohaaded_launcher_${name} DESTINATION ${CMAKE_INSTALL_BINDIR}/${PROJECT_INSTALL_SUBDIR})
|
||||
endfunction()
|
||||
|
||||
create_launcher(base 0)
|
||||
create_launcher(spearhead 1)
|
||||
create_launcher(breakthrough 2)
|
|
@ -1,6 +1,6 @@
|
|||
/*
|
||||
===========================================================================
|
||||
Copyright (C) 2023 the OpenMoHAA team
|
||||
Copyright (C) 2024 the OpenMoHAA team
|
||||
|
||||
This file is part of OpenMoHAA source code.
|
||||
|
||||
|
@ -20,15 +20,13 @@ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
|||
===========================================================================
|
||||
*/
|
||||
|
||||
// tr_vis.cpp: visibility culling
|
||||
// launch.h: Base interface for starting programs
|
||||
|
||||
#include "tr_local.h"
|
||||
#include "tr_vis.h"
|
||||
#include "q_platform.h"
|
||||
|
||||
void R_VisDebug() {
|
||||
// FIXME: unimplemented
|
||||
}
|
||||
#include <filesystem>
|
||||
#include <string>
|
||||
#include <vector>
|
||||
|
||||
void R_VisDebugLoad(const char* szBSPName) {
|
||||
// FIXME: unimplemented
|
||||
}
|
||||
std::filesystem::path GetProgramLocation();
|
||||
void LaunchProgram(const std::filesystem::path& path, const std::vector<std::string>& argumentList);
|
80
code/Launcher/launch_linux.cpp
Normal file
80
code/Launcher/launch_linux.cpp
Normal file
|
@ -0,0 +1,80 @@
|
|||
/*
|
||||
===========================================================================
|
||||
Copyright (C) 2024 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
|
||||
===========================================================================
|
||||
*/
|
||||
|
||||
// main.cpp: Windows implementation of the launcher
|
||||
|
||||
#include "launch.h"
|
||||
|
||||
#include <unistd.h>
|
||||
#include <spawn.h>
|
||||
#include <sys/wait.h>
|
||||
#include <stdlib.h>
|
||||
|
||||
#include <string>
|
||||
#include <iostream>
|
||||
|
||||
extern "C" char** environ;
|
||||
|
||||
std::filesystem::path GetProgramLocation()
|
||||
{
|
||||
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();
|
||||
}
|
||||
|
||||
void LaunchProgram(const std::filesystem::path& path, const std::vector<std::string>& argumentList)
|
||||
{
|
||||
pid_t pid;
|
||||
std::string pathString = path.string();
|
||||
size_t argCount = argumentList.size();
|
||||
char** argv;
|
||||
int status;
|
||||
|
||||
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[argCount + 1] = NULL;
|
||||
|
||||
//status = posix_spawn(&pid, pathString.c_str(), NULL, NULL, argv, environ);
|
||||
//delete[] argv;
|
||||
//if (status != 0) {
|
||||
// std::cout << "posix_spawn returned error: " << status << std::endl;
|
||||
// return;
|
||||
//}
|
||||
|
||||
//
|
||||
// Using execve rather than posix_spawn
|
||||
// This replaces the current process that is not needed anyway
|
||||
//
|
||||
status = execve(pathString.c_str(), argv, environ);
|
||||
delete[] argv;
|
||||
if (status == -1) {
|
||||
std::cout << "posix_spawn returned error: " << errno << std::endl;
|
||||
return;
|
||||
}
|
||||
|
||||
waitpid(pid, NULL, 0);
|
||||
}
|
67
code/Launcher/launch_main.cpp
Normal file
67
code/Launcher/launch_main.cpp
Normal file
|
@ -0,0 +1,67 @@
|
|||
/*
|
||||
===========================================================================
|
||||
Copyright (C) 2024 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
|
||||
===========================================================================
|
||||
*/
|
||||
|
||||
// main.cpp: The launcher
|
||||
|
||||
#include "launch.h"
|
||||
|
||||
#include <iostream>
|
||||
#include <string>
|
||||
#include <vector>
|
||||
|
||||
const char* targetGameList[] =
|
||||
{
|
||||
"Base",
|
||||
"Spearhead",
|
||||
"Breakthrough"
|
||||
};
|
||||
|
||||
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;
|
||||
#else
|
||||
const char* programName = "omohaaded" ARCH_SUFFIX DLL_SUFFIX EXE_EXT;
|
||||
#endif
|
||||
|
||||
argumentList.push_back("+set");
|
||||
argumentList.push_back("com_target_game");
|
||||
argumentList.push_back(std::to_string(TARGET_GAME));
|
||||
|
||||
for (size_t i = 1; i < argc; i++) {
|
||||
argumentList.push_back(argv[i]);
|
||||
}
|
||||
|
||||
std::cout << "Using the target game: " << targetGameList[TARGET_GAME] << std::endl;
|
||||
std::cout << std::endl;
|
||||
std::cout << "Expected program name: " << programName << std::endl;
|
||||
|
||||
const std::filesystem::path programLocation = GetProgramLocation();
|
||||
const std::filesystem::path programPath = programLocation / programName;
|
||||
|
||||
std::cout << "Program location: " << programLocation << std::endl;
|
||||
std::cout << "Expected path: " << programPath << std::endl;
|
||||
|
||||
LaunchProgram(programPath, argumentList);
|
||||
|
||||
return 0;
|
||||
}
|
87
code/Launcher/launch_win32.cpp
Normal file
87
code/Launcher/launch_win32.cpp
Normal file
|
@ -0,0 +1,87 @@
|
|||
/*
|
||||
===========================================================================
|
||||
Copyright (C) 2024 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
|
||||
===========================================================================
|
||||
*/
|
||||
|
||||
// main.cpp: Windows implementation of the launcher
|
||||
|
||||
#include "launch.h"
|
||||
|
||||
#include <Windows.h>
|
||||
#include <string>
|
||||
#include <iostream>
|
||||
|
||||
std::filesystem::path GetProgramLocation()
|
||||
{
|
||||
wchar_t path[FILENAME_MAX] = { 0 };
|
||||
GetModuleFileNameW(nullptr, path, FILENAME_MAX);
|
||||
|
||||
return std::filesystem::path(path).parent_path();
|
||||
}
|
||||
|
||||
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();
|
||||
|
||||
memset(&processInfo, 0, sizeof(processInfo));
|
||||
memset(&startupInfo, 0, sizeof(startupInfo));
|
||||
startupInfo.cb = sizeof(startupInfo);
|
||||
|
||||
for (size_t i = 0; i < argCount; i++) {
|
||||
commandLine += L"\"";
|
||||
commandLine += std::wstring(argumentList[i].begin(), argumentList[i].end());
|
||||
commandLine += L"\"";
|
||||
if (i != argCount - 1) {
|
||||
commandLine += L" ";
|
||||
}
|
||||
}
|
||||
|
||||
osCommandLine = path.wstring();
|
||||
osCommandLine += L" ";
|
||||
osCommandLine += commandLine;
|
||||
|
||||
returnValue = CreateProcessW(
|
||||
path.wstring().c_str(),
|
||||
(LPWSTR)osCommandLine.c_str(),
|
||||
NULL,
|
||||
NULL,
|
||||
FALSE,
|
||||
0,
|
||||
NULL,
|
||||
std::filesystem::current_path().wstring().c_str(),
|
||||
&startupInfo,
|
||||
&processInfo
|
||||
);
|
||||
|
||||
if (!returnValue) {
|
||||
std::cout << "Error in CreateProcess: " << GetLastError() << std::endl;
|
||||
return;
|
||||
}
|
||||
|
||||
WaitForSingleObject(processInfo.hProcess, INFINITE);
|
||||
|
||||
CloseHandle(processInfo.hProcess);
|
||||
CloseHandle(processInfo.hThread);
|
||||
}
|
|
@ -933,10 +933,13 @@ static void waitToApplyUpdates(void)
|
|||
OS forcibly closes the pipe), we will unblock. Then we can loop on
|
||||
kill() until the process is truly gone. */
|
||||
int x = 0;
|
||||
struct timespec req;
|
||||
req.tv_sec = 0;
|
||||
req.tv_nsec = 100000000;
|
||||
read(3, &x, sizeof (x));
|
||||
info("Pipe has closed, waiting for process to fully go away now.");
|
||||
while (kill(options.waitforprocess, 0) == 0) {
|
||||
usleep(100000);
|
||||
nanosleep(&req, NULL);
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
cmake_minimum_required(VERSION 3.5)
|
||||
cmake_minimum_required(VERSION 3.12)
|
||||
project(cgame)
|
||||
|
||||
# Shared source files for modules
|
||||
|
@ -27,16 +27,11 @@ target_compile_features(cgame PUBLIC cxx_nullptr)
|
|||
target_compile_features(cgame PUBLIC c_variadic_macros)
|
||||
target_link_libraries(cgame PUBLIC qcommon)
|
||||
|
||||
set_target_properties(cgame PROPERTIES PREFIX "${TARGET_PLATFORM_PREFIX}")
|
||||
set_target_properties(cgame PROPERTIES OUTPUT_NAME "cgame${TARGET_ARCH_SUFFIX}")
|
||||
set_target_properties(cgame PROPERTIES RUNTIME_OUTPUT_DIRECTORY "${TARGET_BASE_GAME}")
|
||||
set_target_properties(cgame PROPERTIES PREFIX "")
|
||||
set_target_properties(cgame PROPERTIES OUTPUT_NAME "cgame${TARGET_BIN_SUFFIX}")
|
||||
|
||||
INSTALL(
|
||||
TARGETS cgame
|
||||
LIBRARY DESTINATION "${TARGET_BASE_GAME}"
|
||||
RUNTIME DESTINATION "${TARGET_BASE_GAME}"
|
||||
)
|
||||
INSTALL(TARGETS cgame DESTINATION ${CMAKE_INSTALL_LIBDIR}/${LIB_INSTALL_SUBDIR})
|
||||
|
||||
if(MSVC)
|
||||
INSTALL(FILES $<TARGET_PDB_FILE:cgame> DESTINATION "${TARGET_BASE_GAME}" OPTIONAL)
|
||||
INSTALL(FILES $<TARGET_PDB_FILE:cgame> DESTINATION ${CMAKE_INSTALL_LIBDIR}/${LIB_INSTALL_SUBDIR} OPTIONAL)
|
||||
endif()
|
|
@ -113,7 +113,7 @@ void CG_ArchiveModelHandle(MemArchiver& archiver, qhandle_t* handle)
|
|||
if (tmp.length()) {
|
||||
*handle = cgi.R_RegisterModel(tmp.c_str());
|
||||
} else {
|
||||
*handle = NULL;
|
||||
*handle = (qhandle_t)0;
|
||||
}
|
||||
} else {
|
||||
if (*handle) {
|
||||
|
@ -135,7 +135,7 @@ void CG_ArchiveShaderHandle(MemArchiver& archiver, qhandle_t* handle)
|
|||
if (tmp.length()) {
|
||||
*handle = cgi.R_RegisterShader(tmp.c_str());
|
||||
} else {
|
||||
*handle = NULL;
|
||||
*handle = (qhandle_t)0;
|
||||
}
|
||||
} else {
|
||||
if (*handle) {
|
||||
|
@ -163,7 +163,7 @@ void CG_ArchiveRefEntity(MemArchiver& archiver, refEntity_t* ref)
|
|||
archiver.ArchiveVec3(ref->axis[2]);
|
||||
archiver.ArchiveBoolean(&ref->nonNormalizedAxes);
|
||||
archiver.ArchiveVec3(ref->origin);
|
||||
archiver.ArchiveRaw(ref->frameInfo, 192);
|
||||
archiver.ArchiveRaw(ref->frameInfo, sizeof(ref->frameInfo));
|
||||
archiver.ArchiveFloat(&ref->actionWeight);
|
||||
archiver.ArchiveShort(&ref->wasframe);
|
||||
archiver.ArchiveFloat(&ref->scale);
|
||||
|
@ -171,7 +171,7 @@ void CG_ArchiveRefEntity(MemArchiver& archiver, refEntity_t* ref)
|
|||
archiver.ArchiveInteger(&ref->skinNum);
|
||||
|
||||
CG_ArchiveShaderHandle(archiver, &ref->customShader);
|
||||
archiver.ArchiveRaw(ref->shaderRGBA, 4);
|
||||
archiver.ArchiveRaw(ref->shaderRGBA, sizeof(ref->shaderRGBA));
|
||||
archiver.ArchiveFloat(ref->shaderTexCoord);
|
||||
archiver.ArchiveFloat(&ref->shaderTexCoord[1]);
|
||||
archiver.ArchiveFloat(&ref->shaderTime);
|
||||
|
|
|
@ -196,7 +196,8 @@ Event EV_Client_SetColorVelocity
|
|||
"rVel gVel bVel",
|
||||
"Set the color velocity of the spawned dlight tempmodel"
|
||||
);
|
||||
Event EV_Client_SetRandomVelocity(
|
||||
Event EV_Client_SetRandomVelocity
|
||||
(
|
||||
"randvel",
|
||||
EV_DEFAULT,
|
||||
"SfFSfFSfF",
|
||||
|
@ -210,7 +211,8 @@ Event EV_Client_SetRandomVelocity(
|
|||
"without randomness.\n"
|
||||
"This velocity is applied using the world axis"
|
||||
);
|
||||
Event EV_Client_SetRandomVelocityAlongAxis(
|
||||
Event EV_Client_SetRandomVelocityAlongAxis
|
||||
(
|
||||
"randvelaxis",
|
||||
EV_DEFAULT,
|
||||
"SfFSfFSfF",
|
||||
|
@ -225,6 +227,14 @@ Event EV_Client_SetRandomVelocityAlongAxis(
|
|||
"without randomness.\n"
|
||||
"This velocity is applied using the parent axis"
|
||||
);
|
||||
Event EV_Client_NoTagAxis
|
||||
(
|
||||
"notagaxis",
|
||||
EV_DEFAULT,
|
||||
NULL,
|
||||
NULL,
|
||||
"Forces the effect to use the model's orientation for randvelaxis and offsetalongaxis"
|
||||
);
|
||||
Event EV_Client_SetAccel
|
||||
(
|
||||
"accel",
|
||||
|
@ -554,7 +564,16 @@ Event EV_Client_LoopSound
|
|||
EV_DEFAULT,
|
||||
"sFFf",
|
||||
"soundName volume min_distance pitch",
|
||||
"Play the specifed sound as a looping sound"
|
||||
"Play the specified sound as a looping sound"
|
||||
);
|
||||
// Added in 2.0
|
||||
Event EV_Client_StopLoopSound
|
||||
(
|
||||
"stoploopsound",
|
||||
EV_DEFAULT,
|
||||
NULL,
|
||||
NULL,
|
||||
"Stop the looping sound"
|
||||
);
|
||||
Event EV_Client_Cache
|
||||
(
|
||||
|
@ -975,7 +994,7 @@ Event EV_Client_BounceDecal(
|
|||
"maxamount temporary",
|
||||
"Put a mark when the tempmodel bounces and hits a surface\n"
|
||||
"maxamount = Max amount of decals to make when bouncing\n"
|
||||
"temporary = specify 1 for a temporary mark that only appears for a short time, 0 for a decal that stays aroung "
|
||||
"temporary = specify 1 for a temporary mark that only appears for a short time, 0 for a decal that stays around "
|
||||
"longer (default is 0)\n"
|
||||
);
|
||||
Event EV_Client_SetDecalRadius
|
||||
|
@ -1075,6 +1094,15 @@ Event EV_Client_Print
|
|||
"string",
|
||||
"Prints a string."
|
||||
);
|
||||
// Added in 2.0
|
||||
Event EV_Client_PrintDeathMsg
|
||||
(
|
||||
"printdeathmsg",
|
||||
EV_DEFAULT,
|
||||
"sssss",
|
||||
"msg1, msg2, killer, victim, deathType",
|
||||
"Prints a death message string. Used to allow death messages to appear in their correct language on client machines.."
|
||||
);
|
||||
Event EV_Client_SetVolumetric
|
||||
(
|
||||
"volumetric",
|
||||
|
@ -1112,7 +1140,7 @@ Event EV_Client_SetAlignStretch(
|
|||
EV_DEFAULT,
|
||||
"F",
|
||||
"scaleMultiplier",
|
||||
"Aligns the temp model to the direction of travel, and stretches it betwen the last and current positions.\n"
|
||||
"Aligns the temp model to the direction of travel, and stretches it between the last and current positions.\n"
|
||||
);
|
||||
Event EV_Client_SetClampVelocity
|
||||
(
|
||||
|
@ -1185,6 +1213,14 @@ Event EV_Client_SFXStartDelayed
|
|||
"fDelay sCommand arg1 arg2 arg3 arg4 arg5 arg6 arg7 arg8",
|
||||
"Used for adding commands to a special effect with a time delay"
|
||||
);
|
||||
Event EV_Client_PlayForceFeedback
|
||||
(
|
||||
"playforcefeedback",
|
||||
EV_DEFAULT,
|
||||
"s",
|
||||
"effectname",
|
||||
"Starts a force feedback effect."
|
||||
);
|
||||
|
||||
EffectsEventQueueNode EffectsEventQueue;
|
||||
|
||||
|
@ -1221,6 +1257,7 @@ CLASS_DECLARATION(Listener, ClientGameCommandManager, NULL) {
|
|||
{&EV_Client_SetColorVelocity, &ClientGameCommandManager::SetAngularVelocity },
|
||||
{&EV_Client_SetRandomVelocity, &ClientGameCommandManager::SetRandomVelocity },
|
||||
{&EV_Client_SetRandomVelocityAlongAxis, &ClientGameCommandManager::SetRandomVelocityAlongAxis},
|
||||
{&EV_Client_NoTagAxis, &ClientGameCommandManager::SetNoTagAxis },
|
||||
{&EV_Client_SetAccel, &ClientGameCommandManager::SetAccel },
|
||||
{&EV_Client_SetFriction, &ClientGameCommandManager::SetFriction },
|
||||
{&EV_Client_SetSpin, &ClientGameCommandManager::SetSpin },
|
||||
|
@ -1250,6 +1287,7 @@ CLASS_DECLARATION(Listener, ClientGameCommandManager, NULL) {
|
|||
{&EV_Client_StopSound, &ClientGameCommandManager::StopSound },
|
||||
{&EV_Client_StopAliasChannel, &ClientGameCommandManager::StopAliasChannel },
|
||||
{&EV_Client_LoopSound, &ClientGameCommandManager::LoopSound },
|
||||
{&EV_Client_StopLoopSound, &ClientGameCommandManager::StopLoopSound },
|
||||
{&EV_Client_Cache, &ClientGameCommandManager::Cache },
|
||||
{&EV_Client_CacheImage, &ClientGameCommandManager::CacheImage },
|
||||
{&EV_Client_CacheFont, &ClientGameCommandManager::CacheFont },
|
||||
|
@ -1312,6 +1350,7 @@ CLASS_DECLARATION(Listener, ClientGameCommandManager, NULL) {
|
|||
{&EV_Client_SetClampVelocity, &ClientGameCommandManager::SetClampVel },
|
||||
{&EV_Client_SetClampVelocityAxis, &ClientGameCommandManager::SetClampVelAxis },
|
||||
{&EV_Client_Print, &ClientGameCommandManager::Print },
|
||||
{&EV_Client_PrintDeathMsg, &ClientGameCommandManager::PrintDeathMsg },
|
||||
{&EV_Client_EyeLimits, &ClientGameCommandManager::SetEyeLimits },
|
||||
{&EV_Client_EyeMovement, &ClientGameCommandManager::SetEyeMovement },
|
||||
{&EV_Client_SFXStart, &ClientGameCommandManager::StartSFX },
|
||||
|
@ -1383,10 +1422,12 @@ qboolean ClientGameCommandManager::PostEventForEntity(Event *ev, float fWait)
|
|||
EffectsEventQueueNode *node;
|
||||
int inttime;
|
||||
|
||||
if (!m_fEventWait || current_entity_number < 0) {
|
||||
if (m_fEventWait < 0 || current_entity_number < 0) {
|
||||
if (m_fEventWait != 0.0) {
|
||||
if (!str::icmp(ev->getName(), ")")) {
|
||||
m_fEventWait = 0.0;
|
||||
}
|
||||
}
|
||||
|
||||
delete ev;
|
||||
return qfalse;
|
||||
|
@ -1402,7 +1443,7 @@ qboolean ClientGameCommandManager::PostEventForEntity(Event *ev, float fWait)
|
|||
event = EffectsEventQueue.next;
|
||||
inttime = EVENT_msec + (fWait * 1000.0f + 0.5f);
|
||||
|
||||
while (event != &EffectsEventQueue && inttime > event->inttime) {
|
||||
while (event != &EffectsEventQueue && inttime >= event->inttime) {
|
||||
event = event->next;
|
||||
}
|
||||
|
||||
|
@ -1438,8 +1479,8 @@ void ClientGameCommandManager::SetBaseAndAmplitude(Event *ev, Vector& base, Vect
|
|||
base[j] = ev->GetFloat(i++);
|
||||
amplitude[j] = ev->GetFloat(i++);
|
||||
} else {
|
||||
base[j] = 0.0;
|
||||
amplitude[j] = atof(org.c_str());
|
||||
base[j] = atof(org.c_str());
|
||||
amplitude[j] = 0.0;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -1462,6 +1503,13 @@ void ClientGameCommandManager::Print(Event *ev)
|
|||
}
|
||||
}
|
||||
|
||||
void ClientGameCommandManager::PrintDeathMsg(Event* ev)
|
||||
{
|
||||
if (current_entity) {
|
||||
cgi.DPrintf("%d:%s\n", current_entity->entityNumber, ev->GetString(1).c_str());
|
||||
}
|
||||
}
|
||||
|
||||
qboolean ClientGameCommandManager::IsBlockCommand(const str& name)
|
||||
{
|
||||
if (!str::icmp(name, "originspawn")) {
|
||||
|
@ -1541,7 +1589,6 @@ void ClientGameCommandManager::CommandDelay(Event *ev)
|
|||
ev1->AddValue(ev->GetValue(i));
|
||||
}
|
||||
|
||||
delay = ev->GetFloat(1) * 1000;
|
||||
if (current_entity_number != -1) {
|
||||
PostEventForEntity(ev1, fWait);
|
||||
} else {
|
||||
|
@ -1551,6 +1598,16 @@ void ClientGameCommandManager::CommandDelay(Event *ev)
|
|||
current_tiki->name
|
||||
);
|
||||
}
|
||||
|
||||
if (IsBlockCommand(eventName)) {
|
||||
m_fEventWait = fWait;
|
||||
} else {
|
||||
m_fEventWait = 0;
|
||||
}
|
||||
|
||||
if (current_entity_number == -1 && m_fEventWait > 0) {
|
||||
m_fEventWait = -1;
|
||||
}
|
||||
}
|
||||
|
||||
void ClientGameCommandManager::StartSFX(Event *ev)
|
||||
|
@ -2157,7 +2214,9 @@ void ClientGameCommandManager::SetInwardSphere(Event *ev)
|
|||
}
|
||||
|
||||
m_spawnthing->cgd.flags |= T_INWARDSPHERE;
|
||||
if (ev->NumArgs() > 0) {
|
||||
m_spawnthing->sphereRadius = ev->GetFloat(1);
|
||||
}
|
||||
}
|
||||
|
||||
//=============
|
||||
|
@ -2586,7 +2645,9 @@ void ClientGameCommandManager::SetColorRange(Event *ev)
|
|||
return;
|
||||
}
|
||||
|
||||
// FIXME: unused stub??
|
||||
//
|
||||
// Unused
|
||||
//
|
||||
}
|
||||
|
||||
//=============
|
||||
|
@ -2666,6 +2727,15 @@ void ClientGameCommandManager::SetRandomVelocityAlongAxis(Event *ev)
|
|||
SetRandomVelocity(ev);
|
||||
}
|
||||
|
||||
void ClientGameCommandManager::SetNoTagAxis(Event* ev)
|
||||
{
|
||||
if (!m_spawnthing) {
|
||||
return;
|
||||
}
|
||||
|
||||
m_spawnthing->cgd.flags2 |= T2_NOTAGAXIS;
|
||||
}
|
||||
|
||||
void ClientGameCommandManager::SetRadialVelocity(Event *ev)
|
||||
{
|
||||
if (!m_spawnthing) {
|
||||
|
@ -2803,7 +2873,9 @@ void ClientGameCommandManager::SetAccel(Event *ev)
|
|||
m_spawnthing->cgd.accel[1] = ev->GetFloat(2);
|
||||
m_spawnthing->cgd.accel[2] = ev->GetFloat(3);
|
||||
|
||||
if (!(m_spawnthing->cgd.flags & T_SWARM)) {
|
||||
m_spawnthing->cgd.flags2 |= T2_ACCEL;
|
||||
}
|
||||
}
|
||||
|
||||
void ClientGameCommandManager::SetFriction(Event *ev)
|
||||
|
@ -3032,7 +3104,7 @@ spawnthing_t *ClientGameCommandManager::InitializeSpawnthing(spawnthing_t *sp)
|
|||
sp->cgd.parent = -1;
|
||||
sp->cgd.tiki = nullptr;
|
||||
sp->cgd.lightstyle = -1;
|
||||
sp->cgd.physicsRate = 10;
|
||||
sp->cgd.physicsRate = cg_effect_physicsrate->integer;
|
||||
sp->cgd.shadername = "beamshader";
|
||||
sp->cgd.decal_orientation = 0;
|
||||
sp->cgd.decal_radius = 10;
|
||||
|
@ -3794,7 +3866,7 @@ void ClientGameCommandManager::PlaySound(
|
|||
}
|
||||
|
||||
if (!name || !soundAlias) {
|
||||
Com_Printf(
|
||||
cgi.DPrintf(
|
||||
"\nERROR PlaySound: %s needs an alias in ubersound.scr or uberdialog.scr - Please fix.\n",
|
||||
sound_name.c_str()
|
||||
);
|
||||
|
@ -3851,7 +3923,7 @@ void ClientGameCommandManager::PlaySound(
|
|||
} else {
|
||||
if (debugSound->integer) {
|
||||
Com_Printf(
|
||||
"\nWARNING: OVERRIDE OVERRIDE OVERRIDESound %s had all its parm overriden by code.\n\n",
|
||||
"\nWARNING: OVERRIDE OVERRIDE OVERRIDESound %s had all its parm overridden by code.\n\n",
|
||||
sound_name.c_str()
|
||||
);
|
||||
}
|
||||
|
@ -3965,6 +4037,9 @@ void ClientGameCommandManager::StopSound(Event *ev)
|
|||
cgi.S_StopSound(current_entity_number, channel);
|
||||
}
|
||||
|
||||
//===============
|
||||
// StopAliasChannel
|
||||
//===============
|
||||
void ClientGameCommandManager::StopAliasChannel(Event *ev)
|
||||
{
|
||||
str sound_name;
|
||||
|
@ -3991,7 +4066,7 @@ void ClientGameCommandManager::StopAliasChannel(Event *ev)
|
|||
}
|
||||
|
||||
if (!name || !soundAlias) {
|
||||
Com_Printf("\nERROR stopaliaschannel: couldn't find alias %s\n", sound_name.c_str());
|
||||
cgi.DPrintf("\nERROR stopaliaschannel: couldn't find alias %s\n", sound_name.c_str());
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -4060,6 +4135,54 @@ void ClientGameCommandManager::LoopSound(Event *ev)
|
|||
current_centity->tikiLoopSoundFlags = 0;
|
||||
}
|
||||
|
||||
//===============
|
||||
// StopLoopSound
|
||||
//===============
|
||||
void ClientGameCommandManager::StopLoopSound(Event* ev)
|
||||
{
|
||||
if (!current_centity) {
|
||||
cgi.DPrintf("CCM::StopLoopSound : StopLoopSound in %s without current_centity\n", cgi.TIKI_Name(current_tiki));
|
||||
return;
|
||||
}
|
||||
|
||||
cgi.DPrintf("\n\nClientGameCommandManager::StopLoopSound\n\n");
|
||||
current_centity->tikiLoopSound = (sfxHandle_t)0;
|
||||
}
|
||||
|
||||
//===============
|
||||
// CacheImageResource
|
||||
//===============
|
||||
void CacheImageResource(const char* stuff) {
|
||||
str real_stuff;
|
||||
char filename[1024];
|
||||
|
||||
if (cgi.fsDebug->integer == 2) {
|
||||
Com_Printf("client cacheimage: %s\n", stuff);
|
||||
}
|
||||
|
||||
Q_strncpyz(filename, stuff, sizeof(filename));
|
||||
cgi.FS_CanonicalFilename(filename);
|
||||
|
||||
cgi.R_RegisterShaderNoMip(filename);
|
||||
}
|
||||
|
||||
//===============
|
||||
// CacheFontResource
|
||||
//===============
|
||||
void CacheFontResource(const char* stuff) {
|
||||
str real_stuff;
|
||||
char filename[1024];
|
||||
|
||||
if (cgi.fsDebug->integer == 2) {
|
||||
Com_Printf("client cacheimage: %s\n", stuff);
|
||||
}
|
||||
|
||||
Q_strncpyz(filename, stuff, sizeof(filename));
|
||||
cgi.FS_CanonicalFilename(filename);
|
||||
|
||||
cgi.R_LoadFont(filename);
|
||||
}
|
||||
|
||||
//===============
|
||||
// CacheResource
|
||||
//===============
|
||||
|
@ -4099,12 +4222,12 @@ void ClientGameCommandManager::Cache(Event *ev)
|
|||
|
||||
void ClientGameCommandManager::CacheImage(Event *ev)
|
||||
{
|
||||
// FIXME: stub
|
||||
CacheImageResource(ev->GetString(1).c_str());
|
||||
}
|
||||
|
||||
void ClientGameCommandManager::CacheFont(Event *ev)
|
||||
{
|
||||
// FIXME: stub
|
||||
CacheFontResource(ev->GetString(1).c_str());
|
||||
}
|
||||
|
||||
//===============
|
||||
|
@ -4112,15 +4235,16 @@ void ClientGameCommandManager::CacheFont(Event *ev)
|
|||
//===============
|
||||
void AliasResource(dtiki_t *pmdl, const char *alias, const char *realname, const char *parameters)
|
||||
{
|
||||
if (pmdl) {
|
||||
if (!pmdl) {
|
||||
cgi.Alias_Add(alias, realname, parameters);
|
||||
return;
|
||||
}
|
||||
|
||||
if (!pmdl->a->alias_list) {
|
||||
pmdl->a->alias_list = cgi.AliasList_New(pmdl->a->name);
|
||||
}
|
||||
|
||||
cgi.Alias_ListAdd((AliasList_t *)pmdl->a->alias_list, alias, realname, parameters);
|
||||
} else {
|
||||
cgi.Alias_Add(alias, realname, parameters);
|
||||
}
|
||||
cgi.Alias_ListAdd((AliasList_t*)pmdl->a->alias_list, alias, realname, parameters);
|
||||
}
|
||||
|
||||
qboolean bLoadForMap(const char *psMapsBuffer, const char *name)
|
||||
|
@ -4141,7 +4265,7 @@ qboolean bLoadForMap(const char *psMapsBuffer, const char *name)
|
|||
}
|
||||
|
||||
if (!token || !token[0]) {
|
||||
Com_Printf("ERROR bLoadForMap: %s alias with empty maps specification.\n", name);
|
||||
cgi.DPrintf("ERROR bLoadForMap: %s alias with empty maps specification.\n", name);
|
||||
return false;
|
||||
}
|
||||
|
||||
|
@ -4181,19 +4305,32 @@ void ClientGameCommandManager::AliasCache(Event *ev)
|
|||
psMapsBuffer = NULL;
|
||||
|
||||
for (i = 3; i <= ev->NumArgs(); i++) {
|
||||
if (!strcmp(ev->GetToken(i).c_str(), "maps")) {
|
||||
str s = ev->GetString(i);
|
||||
|
||||
if (!s.icmp("maps")) {
|
||||
i++;
|
||||
psMapsBuffer = ev->GetToken(i);
|
||||
} else if (!strcmp(ev->GetToken(i).c_str(), "always")) {
|
||||
bAlwaysLoaded = true;
|
||||
} else {
|
||||
strcat(parmbuffer, ev->GetToken(i));
|
||||
strcat(parmbuffer, " ");
|
||||
}
|
||||
psMapsBuffer = (char *)ev->GetToken(i).c_str();
|
||||
continue;
|
||||
}
|
||||
|
||||
if (bAlwaysLoaded || bLoadForMap(psMapsBuffer, ev->GetString(1))) {
|
||||
if (!s.icmp("always")) {
|
||||
bAlwaysLoaded = true;
|
||||
continue;
|
||||
}
|
||||
|
||||
strcat(parmbuffer, s);
|
||||
strcat(parmbuffer, " ");
|
||||
}
|
||||
|
||||
if (bAlwaysLoaded) {
|
||||
AliasResource(current_tiki, ev->GetString(1), ev->GetString(2), parmbuffer);
|
||||
}
|
||||
|
||||
if (bLoadForMap(psMapsBuffer, ev->GetString(1))) {
|
||||
if (!bAlwaysLoaded) {
|
||||
AliasResource(current_tiki, ev->GetString(1), ev->GetString(2), parmbuffer);
|
||||
}
|
||||
|
||||
CacheResource(ev->GetString(2));
|
||||
}
|
||||
}
|
||||
|
@ -4223,29 +4360,34 @@ void ClientGameCommandManager::Alias(Event *ev)
|
|||
psMapsBuffer = NULL;
|
||||
|
||||
for (i = 3; i <= ev->NumArgs(); i++) {
|
||||
if (!strcmp(ev->GetToken(i).c_str(), "maps")) {
|
||||
str s = ev->GetString(i);
|
||||
|
||||
if (!s.icmp("maps")) {
|
||||
i++;
|
||||
psMapsBuffer = ev->GetToken(i);
|
||||
} else if (!strcmp(ev->GetToken(i).c_str(), "always")) {
|
||||
bAlwaysLoaded = true;
|
||||
} else {
|
||||
if (!subtitle) {
|
||||
if (!Q_stricmp(ev->GetToken(i), "subtitle") || !Q_stricmp(ev->GetToken(i), "forcesubtitle")) {
|
||||
subtitle = qtrue;
|
||||
strcat(parmbuffer, ev->GetToken(i));
|
||||
} else {
|
||||
strcat(parmbuffer, ev->GetToken(i));
|
||||
psMapsBuffer = (char *)ev->GetToken(i).c_str();
|
||||
continue;
|
||||
}
|
||||
|
||||
if (!s.icmp("always")) {
|
||||
bAlwaysLoaded = true;
|
||||
} else if (subtitle) {
|
||||
strcat(parmbuffer, "\"");
|
||||
strcat(parmbuffer, s);
|
||||
strcat(parmbuffer, "\" ");
|
||||
|
||||
subtitle = 0;
|
||||
} else {
|
||||
strcat(parmbuffer, "\"");
|
||||
strcat(parmbuffer, ev->GetToken(i));
|
||||
strcat(parmbuffer, "\"");
|
||||
subtitle = qfalse;
|
||||
subtitle = s.icmp("subtitle") == 0;
|
||||
|
||||
if (!subtitle) {
|
||||
subtitle = s.icmp("forcesubtitle") == 0;
|
||||
}
|
||||
|
||||
strcat(parmbuffer, s);
|
||||
}
|
||||
|
||||
strcat(parmbuffer, " ");
|
||||
}
|
||||
}
|
||||
|
||||
if (bAlwaysLoaded || bLoadForMap(psMapsBuffer, ev->GetString(1))) {
|
||||
AliasResource(current_tiki, ev->GetString(1), ev->GetString(2), parmbuffer);
|
||||
|
@ -4976,7 +5118,15 @@ bool ClientGameCommandManager::GetTagPositionAndOrientation(str tagname, orienta
|
|||
//===============
|
||||
void ClientGameCommandManager::RestartAllEmitters(void)
|
||||
{
|
||||
// FIXME: stub??
|
||||
ctempmodel_t *p;
|
||||
|
||||
//
|
||||
// FIXME: not sure if it's the right thing
|
||||
//
|
||||
|
||||
for (p = m_active_tempmodels.prev; p != &m_active_tempmodels; p = p->next) {
|
||||
p->cgd.createTime = cg.time;
|
||||
}
|
||||
}
|
||||
|
||||
//===============
|
||||
|
@ -5029,7 +5179,7 @@ void CG_ProcessInitCommands(dtiki_t *tiki, refEntity_t *ent)
|
|||
}
|
||||
|
||||
if (!commandManager.SelectProcessEvent(ev)) {
|
||||
Com_Printf(
|
||||
cgi.DPrintf(
|
||||
"^~^~^ CG_ProcessInitCommands: Bad init client command '%s' in '%s'\n", pcmd->args[0], tiki->name
|
||||
);
|
||||
}
|
||||
|
@ -5075,7 +5225,7 @@ void CG_ProcessCacheInitCommands(dtiki_t *tiki)
|
|||
}
|
||||
|
||||
if (!commandManager.SelectProcessEvent(ev)) {
|
||||
Com_Printf(
|
||||
cgi.DPrintf(
|
||||
"^~^~^ CG_ProcessInitCommands: Bad init client command '%s' in '%s'\n", pcmd->args[0], tiki->name
|
||||
);
|
||||
}
|
||||
|
@ -5148,7 +5298,7 @@ qboolean CG_ProcessEntityCommands(int frame, int anim, int entnum, refEntity_t *
|
|||
current_centity = cent;
|
||||
current_entity_number = entnum;
|
||||
current_tiki = ent->tiki;
|
||||
CG_AnimationDebugMessage(entnum, "Processing Ent Commands: Entity: %3d Anim:#(%i) Frame:#(%i)\n", anim, frame);
|
||||
CG_AnimationDebugMessage(entnum, "Processing Ent Commands: Entity: %3d Anim:#(%i) Frame:#(%i)\n", entnum, anim, frame);
|
||||
|
||||
for (i = 0; i < tikicmds.num_cmds; i++) {
|
||||
Event *ev;
|
||||
|
@ -5187,7 +5337,7 @@ void CG_ClientCommandDebugMessage(centity_t *cent, const char *fmt, ...)
|
|||
char msg[1024];
|
||||
|
||||
va_start(argptr, fmt);
|
||||
vsprintf(msg, fmt, argptr);
|
||||
Q_vsnprintf(msg, sizeof(msg), fmt, argptr);
|
||||
va_end(argptr);
|
||||
|
||||
if ((!cg_debugAnimWatch->integer) || ((cg_debugAnimWatch->integer - 1) == cent->currentState.number)) {
|
||||
|
@ -5342,7 +5492,7 @@ qboolean CG_Command_ProcessFile(const char *filename, qboolean quiet, dtiki_t *c
|
|||
current_tiki = NULL;
|
||||
|
||||
// Update the loading screen
|
||||
sprintf(tempName, "m%s", filename);
|
||||
Com_sprintf(tempName, sizeof(tempName), "m%s", filename);
|
||||
cgi.LoadResource(tempName);
|
||||
|
||||
bufstart = buffer;
|
||||
|
@ -5351,7 +5501,7 @@ qboolean CG_Command_ProcessFile(const char *filename, qboolean quiet, dtiki_t *c
|
|||
Event *ev;
|
||||
|
||||
// grab each line as we go
|
||||
strcpy(com_token, COM_ParseExt(&buffer, qtrue));
|
||||
Q_strncpyz(com_token, COM_ParseExt(&buffer, qtrue), sizeof(com_token));
|
||||
if (!com_token[0]) {
|
||||
break;
|
||||
}
|
||||
|
@ -5359,7 +5509,7 @@ qboolean CG_Command_ProcessFile(const char *filename, qboolean quiet, dtiki_t *c
|
|||
if (!Q_stricmp(com_token, "end") || !Q_stricmp(com_token, "server")) {
|
||||
// skip the line
|
||||
while (1) {
|
||||
strcpy(com_token, COM_ParseExt(&buffer, qfalse));
|
||||
Q_strncpyz(com_token, COM_ParseExt(&buffer, qfalse), sizeof(com_token));
|
||||
if (!com_token[0]) {
|
||||
break;
|
||||
}
|
||||
|
@ -5372,7 +5522,7 @@ qboolean CG_Command_ProcessFile(const char *filename, qboolean quiet, dtiki_t *c
|
|||
|
||||
// get the rest of the line
|
||||
while (1) {
|
||||
strcpy(com_token, COM_ParseExt(&buffer, qfalse));
|
||||
Q_strncpyz(com_token, COM_ParseExt(&buffer, qfalse), sizeof(com_token));
|
||||
if (!com_token[0]) {
|
||||
break;
|
||||
}
|
||||
|
@ -5384,7 +5534,7 @@ qboolean CG_Command_ProcessFile(const char *filename, qboolean quiet, dtiki_t *c
|
|||
cgi.FS_FreeFile((void *)bufstart);
|
||||
|
||||
// Update the loading screen
|
||||
sprintf(tempName, "o%s", filename);
|
||||
Com_sprintf(tempName, sizeof(tempName), "o%s", filename);
|
||||
cgi.LoadResource(tempName);
|
||||
|
||||
return qtrue;
|
||||
|
@ -5690,7 +5840,7 @@ void ClientGameCommandManager::SetCurrentTiki(Event *ev)
|
|||
str tikiName;
|
||||
|
||||
if (ev->NumArgs() != 1) {
|
||||
Com_Printf("ERROR: settiki command takes 1 parameter.\n");
|
||||
cgi.DPrintf("ERROR: settiki command takes 1 parameter.\n");
|
||||
return;
|
||||
}
|
||||
|
||||
|
|
|
@ -113,6 +113,7 @@ TIKI file, similar to ScriptMaster in the server game dll.
|
|||
#define T2_VARYCOLOR (1 << 20)
|
||||
#define T2_SPIN (1 << 21)
|
||||
#define T2_RELATIVEANGLES (1 << 22)
|
||||
#define T2_NOTAGAXIS (1 << 23)
|
||||
|
||||
class spawnthing_t;
|
||||
class specialeffect_t;
|
||||
|
@ -763,6 +764,7 @@ private:
|
|||
void SpawnVSSSource(int count, int timealive);
|
||||
void EventViewKick(Event *ev);
|
||||
void Print(Event *ev);
|
||||
void PrintDeathMsg(Event *ev); // Added in 2.0
|
||||
void StartBlock(Event *ev);
|
||||
void EndBlock(Event *ev);
|
||||
void UpdateSpawnThing(spawnthing_t *ep);
|
||||
|
@ -788,6 +790,7 @@ private:
|
|||
void SetScaleRate(Event *ev);
|
||||
void SetRandomVelocity(Event *ev);
|
||||
void SetRandomVelocityAlongAxis(Event *ev);
|
||||
void SetNoTagAxis(Event *ev); // Added in 2.0
|
||||
void SetAccel(Event *ev);
|
||||
void SetFriction(Event *ev);
|
||||
void SetSpin(Event *ev);
|
||||
|
@ -849,6 +852,7 @@ private:
|
|||
void StopSound(Event *ev);
|
||||
void StopAliasChannel(Event *ev);
|
||||
void LoopSound(Event *ev);
|
||||
void StopLoopSound(Event *ev); // Added in 2.0
|
||||
void Cache(Event *ev);
|
||||
void CacheImage(Event *ev);
|
||||
void CacheFont(Event *ev);
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
/*
|
||||
===========================================================================
|
||||
Copyright (C) 2023 the OpenMoHAA team
|
||||
Copyright (C) 2008-2024 the OpenMoHAA team
|
||||
|
||||
This file is part of OpenMoHAA source code.
|
||||
|
||||
|
@ -25,6 +25,7 @@ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
|||
// text commands typed in at the local console, or executed by a key binding
|
||||
|
||||
#include "cg_local.h"
|
||||
#include "../fgame/bg_voteoptions.h"
|
||||
|
||||
void CG_TargetCommand_f(void);
|
||||
|
||||
|
@ -159,17 +160,157 @@ baseshader_t *CG_GetShaderUnderCrosshair(qboolean bVerbose, trace_t *pRetTrace)
|
|||
|
||||
static void CG_PrintContentTypes(int iContentFlags)
|
||||
{
|
||||
// FIXME: unimplemented
|
||||
if (iContentFlags & CONTENTS_SOLID) {
|
||||
cgi.Printf(" solid");
|
||||
}
|
||||
if (iContentFlags & CONTENTS_LAVA) {
|
||||
cgi.Printf(" lava");
|
||||
}
|
||||
if (iContentFlags & CONTENTS_SLIME) {
|
||||
cgi.Printf(" slime");
|
||||
}
|
||||
if (iContentFlags & CONTENTS_WATER) {
|
||||
cgi.Printf(" water");
|
||||
}
|
||||
if (iContentFlags & CONTENTS_FOG) {
|
||||
cgi.Printf(" fog");
|
||||
}
|
||||
if (iContentFlags & CONTENTS_FENCE) {
|
||||
cgi.Printf(" fence");
|
||||
}
|
||||
if (iContentFlags & CONTENTS_AREAPORTAL) {
|
||||
cgi.Printf(" areaportal");
|
||||
}
|
||||
if (iContentFlags & CONTENTS_PLAYERCLIP) {
|
||||
cgi.Printf(" playerclip");
|
||||
}
|
||||
if (iContentFlags & CONTENTS_VEHICLECLIP) {
|
||||
cgi.Printf(" vehicleclip");
|
||||
}
|
||||
if (iContentFlags & CONTENTS_MONSTERCLIP) {
|
||||
cgi.Printf(" monsterclip");
|
||||
}
|
||||
if (iContentFlags & CONTENTS_WEAPONCLIP) {
|
||||
cgi.Printf(" weaponclip");
|
||||
}
|
||||
if (iContentFlags & CONTENTS_SHOOTONLY) {
|
||||
cgi.Printf(" shootableonly");
|
||||
}
|
||||
if (iContentFlags & CONTENTS_ORIGIN) {
|
||||
cgi.Printf(" origin");
|
||||
}
|
||||
if (iContentFlags & CONTENTS_TRANSLUCENT) {
|
||||
cgi.Printf(" trans");
|
||||
}
|
||||
}
|
||||
|
||||
static void CG_PrintSurfaceProperties(int iSurfaceFlags)
|
||||
{
|
||||
// FIXME: unimplemented
|
||||
if (iSurfaceFlags & SURF_NODAMAGE) {
|
||||
cgi.Printf(" nodamage");
|
||||
}
|
||||
if (iSurfaceFlags & SURF_SLICK) {
|
||||
cgi.Printf(" slick");
|
||||
}
|
||||
if (iSurfaceFlags & SURF_SKY) {
|
||||
cgi.Printf(" sky");
|
||||
}
|
||||
if (iSurfaceFlags & SURF_LADDER) {
|
||||
cgi.Printf(" ladder");
|
||||
}
|
||||
if (iSurfaceFlags & SURF_NOIMPACT) {
|
||||
cgi.Printf(" noimpact");
|
||||
}
|
||||
if (iSurfaceFlags & SURF_NOMARKS) {
|
||||
cgi.Printf(" nomarks");
|
||||
}
|
||||
if (iSurfaceFlags & SURF_CASTSHADOW) {
|
||||
cgi.Printf(" castshadow");
|
||||
}
|
||||
if (iSurfaceFlags & SURF_NODRAW) {
|
||||
cgi.Printf(" nodraw");
|
||||
}
|
||||
if (iSurfaceFlags & SURF_NOLIGHTMAP) {
|
||||
cgi.Printf(" nolightmap");
|
||||
}
|
||||
if (iSurfaceFlags & SURF_ALPHASHADOW) {
|
||||
cgi.Printf(" alphashadow");
|
||||
}
|
||||
if (iSurfaceFlags & SURF_NOSTEPS) {
|
||||
cgi.Printf(" nofootsteps");
|
||||
}
|
||||
if (iSurfaceFlags & SURF_NONSOLID) {
|
||||
cgi.Printf(" nonsolid");
|
||||
}
|
||||
if (iSurfaceFlags & SURF_OVERBRIGHT) {
|
||||
cgi.Printf(" overbright");
|
||||
}
|
||||
if (iSurfaceFlags & SURF_BACKSIDE) {
|
||||
cgi.Printf(" backside");
|
||||
}
|
||||
if (iSurfaceFlags & SURF_NODLIGHT) {
|
||||
cgi.Printf(" nodlight");
|
||||
}
|
||||
if (iSurfaceFlags & SURF_HINT) {
|
||||
cgi.Printf(" hint");
|
||||
}
|
||||
if (iSurfaceFlags & SURF_PATCH) {
|
||||
cgi.Printf(" patch");
|
||||
}
|
||||
}
|
||||
|
||||
static void CG_PrintSurfaceType(int iSurfType)
|
||||
{
|
||||
// FIXME: unimplemented
|
||||
switch (iSurfType & MASK_SURF_TYPE) {
|
||||
case SURF_FOLIAGE:
|
||||
cgi.Printf("foliage");
|
||||
break;
|
||||
case SURF_SNOW:
|
||||
cgi.Printf("snow");
|
||||
break;
|
||||
case SURF_CARPET:
|
||||
cgi.Printf("carpet");
|
||||
break;
|
||||
case SURF_SAND:
|
||||
cgi.Printf("sand");
|
||||
break;
|
||||
case SURF_PUDDLE:
|
||||
cgi.Printf("puddle");
|
||||
break;
|
||||
case SURF_GLASS:
|
||||
cgi.Printf("glass");
|
||||
break;
|
||||
case SURF_GRAVEL:
|
||||
cgi.Printf("gravel");
|
||||
break;
|
||||
case SURF_MUD:
|
||||
cgi.Printf("mud");
|
||||
break;
|
||||
case SURF_DIRT:
|
||||
cgi.Printf("dirt");
|
||||
break;
|
||||
case SURF_GRILL:
|
||||
cgi.Printf("metal grill");
|
||||
break;
|
||||
case SURF_GRASS:
|
||||
cgi.Printf("grass");
|
||||
break;
|
||||
case SURF_ROCK:
|
||||
cgi.Printf("rock");
|
||||
break;
|
||||
case SURF_PAPER:
|
||||
cgi.Printf("paper");
|
||||
break;
|
||||
case SURF_WOOD:
|
||||
cgi.Printf("wood");
|
||||
break;
|
||||
case SURF_METAL:
|
||||
cgi.Printf("metal");
|
||||
break;
|
||||
default:
|
||||
cgi.Printf("!!*none specified*!!");
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
void CG_GetCHShader(void)
|
||||
|
@ -215,9 +356,9 @@ void CG_EditCHShader(void)
|
|||
|
||||
pShader = CG_GetShaderUnderCrosshair(qfalse, NULL);
|
||||
if (pShader) {
|
||||
strcpy(name, "editspecificshader ");
|
||||
strcat(name, pShader->shader);
|
||||
strcat(name, "\n");
|
||||
Q_strncpyz(name, "editspecificshader ", sizeof(name));
|
||||
Q_strcat(name, sizeof(name), pShader->shader);
|
||||
Q_strcat(name, sizeof(name), "\n");
|
||||
cgi.AddCommand(name);
|
||||
} else {
|
||||
cgi.Printf("No surface selected\n");
|
||||
|
@ -365,7 +506,7 @@ static consoleCommand_t commands[] = {
|
|||
{"prevemittercommand", &CG_PrevEmitterCommand_f },
|
||||
{"nextemittercommand", &CG_NextEmitterCommand_f },
|
||||
{"newemittercommand", &CG_NewEmitterCommand_f },
|
||||
{"deleteemittercommand", &CG_DeleteEmitterCommand_f},
|
||||
{"deleteemittercommand", &CG_DeleteEmitterCommand_f },
|
||||
{"dumpemitter", &CG_DumpEmitter_f },
|
||||
{"loademitter", &CG_LoadEmitter_f },
|
||||
{"resetvss", &CG_ResetVSSSources },
|
||||
|
@ -388,7 +529,16 @@ static consoleCommand_t commands[] = {
|
|||
{"instamsg_group_d", &CG_InstaMessageGroupD_f },
|
||||
{"instamsg_group_e", &CG_InstaMessageGroupE_f },
|
||||
{"pushmenu_teamselect", &CG_PushMenuTeamSelect_f },
|
||||
{"pushmenu_weaponselect", &CG_PushMenuWeaponSelect_f},
|
||||
{"pushmenu_weaponselect", &CG_PushMenuWeaponSelect_f },
|
||||
// Added in 2.0
|
||||
{"pushcallvote", &CG_PushCallVote_f },
|
||||
{"pushcallvotesublist", &CG_PushCallVoteSubList_f },
|
||||
{"pushcallvotesubtext", &CG_PushCallVoteSubText_f },
|
||||
{"pushcallvotesubinteger", &CG_PushCallVoteSubInteger_f},
|
||||
{"pushcallvotesubfloat", &CG_PushCallVoteSubFloat_f },
|
||||
{"pushcallvotesubclient", &CG_PushCallVoteSubClient_f },
|
||||
{"pushvote", &CG_PushVote_f },
|
||||
{"callentryvote", &CG_CallEntryVote_f },
|
||||
};
|
||||
|
||||
/*
|
||||
|
@ -555,5 +705,5 @@ int CG_WeaponCommandButtonBits(void)
|
|||
cg.iWeaponCommand = 0;
|
||||
}
|
||||
|
||||
return iShiftedWeaponCommand & WEAPON_COMMAND_MASK;
|
||||
return iShiftedWeaponCommand & GetWeaponCommandMask(cg_protocol >= PROTOCOL_MOHTA_MIN ? WEAPON_COMMAND_MAX_VER17 : WEAPON_COMMAND_MAX_VER6);
|
||||
}
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
/*
|
||||
===========================================================================
|
||||
Copyright (C) 2023 the OpenMoHAA team
|
||||
Copyright (C) 2025 the OpenMoHAA team
|
||||
|
||||
This file is part of OpenMoHAA source code.
|
||||
|
||||
|
@ -191,8 +191,8 @@ void CG_DrawDisconnect(void)
|
|||
}
|
||||
|
||||
handle = cgi.R_RegisterShader("gfx/2d/net.tga");
|
||||
w = cgi.R_GetShaderWidth(handle);
|
||||
h = cgi.R_GetShaderHeight(handle);
|
||||
w = cgi.R_GetShaderWidth(handle) * cgs.uiHiResScale[0];
|
||||
h = cgi.R_GetShaderHeight(handle) * cgs.uiHiResScale[1];
|
||||
x = ((float)cgs.glconfig.vidWidth - w) * 0.5;
|
||||
y = (float)cgs.glconfig.vidHeight - h;
|
||||
|
||||
|
@ -331,7 +331,7 @@ static void CG_DrawPauseIcon()
|
|||
x = (cgs.glconfig.vidWidth - w) / 2.f;
|
||||
|
||||
cgi.R_SetColor(colorWhite);
|
||||
cgi.R_DrawStretchPic(x, y, w, h, 0, 0, 1, 1, handle);
|
||||
cgi.R_DrawStretchPic(x, y, w * cgs.uiHiResScale[0], h * cgs.uiHiResScale[1], 0, 0, 1, 1, handle);
|
||||
}
|
||||
|
||||
static void CG_DrawServerLag()
|
||||
|
@ -362,8 +362,8 @@ static void CG_DrawServerLag()
|
|||
}
|
||||
|
||||
handle = cgi.R_RegisterShader("gfx/2d/slowserver");
|
||||
w = (float)cgi.R_GetShaderWidth(handle) / 4;
|
||||
h = (float)cgi.R_GetShaderHeight(handle) / 4;
|
||||
w = (float)cgi.R_GetShaderWidth(handle) * cgs.uiHiResScale[0] / 4;
|
||||
h = (float)cgi.R_GetShaderHeight(handle) * cgs.uiHiResScale[1] / 4;
|
||||
x = ((float)cgs.glconfig.vidWidth - w) / 2;
|
||||
y = (float)cgs.glconfig.vidHeight - h;
|
||||
cgi.R_DrawStretchPic(x, y, w, h, 0.0, 0.0, 1.0, 1.0, handle);
|
||||
|
@ -580,11 +580,15 @@ void CG_HudDrawElements()
|
|||
int i;
|
||||
float fX, fY;
|
||||
float fWidth, fHeight;
|
||||
vec2_t virtualScale;
|
||||
|
||||
if (!cg_huddraw_force->integer && !cg_hud->integer) {
|
||||
return;
|
||||
}
|
||||
|
||||
virtualScale[0] = cgs.glconfig.vidWidth / 640.0;
|
||||
virtualScale[1] = cgs.glconfig.vidHeight / 480.0;
|
||||
|
||||
for (i = 0; i < MAX_HUDDRAW_ELEMENTS; i++) {
|
||||
if ((!cgi.HudDrawElements[i].hShader && !cgi.HudDrawElements[i].string[0])
|
||||
|| !cgi.HudDrawElements[i].vColor[3]) {
|
||||
|
@ -597,6 +601,13 @@ void CG_HudDrawElements()
|
|||
fWidth = cgi.HudDrawElements[i].iWidth;
|
||||
fHeight = cgi.HudDrawElements[i].iHeight;
|
||||
|
||||
if (!cgi.HudDrawElements[i].bVirtualScreen) {
|
||||
fWidth *= cgs.uiHiResScale[0];
|
||||
fHeight *= cgs.uiHiResScale[1];
|
||||
fX *= cgs.uiHiResScale[0];
|
||||
fY *= cgs.uiHiResScale[1];
|
||||
}
|
||||
|
||||
if (cgi.HudDrawElements[i].iHorizontalAlign == HUD_ALIGN_X_CENTER) {
|
||||
if (cgi.HudDrawElements[i].bVirtualScreen) {
|
||||
fX += 320.0 - fWidth * 0.5;
|
||||
|
@ -627,23 +638,21 @@ void CG_HudDrawElements()
|
|||
|
||||
cgi.R_SetColor(cgi.HudDrawElements[i].vColor);
|
||||
if (cgi.HudDrawElements[i].string[0]) {
|
||||
if (cgi.HudDrawElements[i].pFont) {
|
||||
cgi.R_DrawString(
|
||||
cgi.HudDrawElements[i].pFont,
|
||||
cgi.LV_ConvertString(cgi.HudDrawElements[i].string),
|
||||
fX,
|
||||
fY,
|
||||
-1,
|
||||
cgi.HudDrawElements[i].bVirtualScreen
|
||||
);
|
||||
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);
|
||||
} else {
|
||||
cgi.R_DrawString(
|
||||
cgs.media.hudDrawFont,
|
||||
pFont,
|
||||
cgi.LV_ConvertString(cgi.HudDrawElements[i].string),
|
||||
fX,
|
||||
fY,
|
||||
fX / cgs.uiHiResScale[0],
|
||||
fY / cgs.uiHiResScale[1],
|
||||
-1,
|
||||
cgi.HudDrawElements[i].bVirtualScreen
|
||||
cgs.uiHiResScale
|
||||
);
|
||||
}
|
||||
} else {
|
||||
|
@ -675,14 +684,17 @@ void CG_DrawObjectives()
|
|||
{
|
||||
float vColor[4];
|
||||
float fX, fY;
|
||||
int iNumObjectives;
|
||||
float fObjectivesTop;
|
||||
static float fWidth;
|
||||
float fHeight;
|
||||
int iNumLines[20];
|
||||
int iTotalNumLines;
|
||||
int i;
|
||||
int ii;
|
||||
int iCurrentObjective;
|
||||
float fTimeDelta;
|
||||
const char *pszLocalizedText;
|
||||
const char *pszLine;
|
||||
|
||||
iTotalNumLines = 0;
|
||||
for (i = CS_OBJECTIVES; i < CS_OBJECTIVES + MAX_OBJECTIVES; ++i) {
|
||||
|
@ -702,50 +714,78 @@ void CG_DrawObjectives()
|
|||
return;
|
||||
}
|
||||
|
||||
for (i = 0; i < MAX_OBJECTIVES; i++) {
|
||||
if ((cg.Objectives[i].flags & 0xFFFFFFFE)) {
|
||||
iNumLines[i] = 0;
|
||||
// Added in 2.0
|
||||
// Get the minimum Y value, it should be below the compass
|
||||
fObjectivesTop = cgi.UI_GetObjectivesTop();
|
||||
iNumObjectives = 0;
|
||||
|
||||
for (ii = 0; ii < MAX_STRING_CHARS; ii++) {
|
||||
if (cg.Objectives[i].text[ii] == '\n') {
|
||||
iTotalNumLines++;
|
||||
for (i = 0; i < MAX_OBJECTIVES; i++) {
|
||||
if ((cg.Objectives[i].flags == OBJ_FLAG_NONE) || (cg.Objectives[i].flags & OBJ_FLAG_HIDDEN)) {
|
||||
continue;
|
||||
}
|
||||
|
||||
iNumObjectives++;
|
||||
iNumLines[i] = 0;
|
||||
pszLocalizedText = cgi.LV_ConvertString(cg.Objectives[i].text);
|
||||
|
||||
for (pszLine = strchr(pszLocalizedText, '\n'); pszLine; pszLine = strchr(pszLine + 1, '\n')) {
|
||||
iNumLines[i]++;
|
||||
} else if (!cg.Objectives[i].text[ii]) {
|
||||
iTotalNumLines++;
|
||||
iNumLines[i]++;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
iTotalNumLines += iNumLines[i];
|
||||
}
|
||||
|
||||
fX = 25.0;
|
||||
fY = 125.0;
|
||||
fWidth = (float)(25 * iTotalNumLines + 155) + 5.0 - 130.0;
|
||||
fY = fObjectivesTop + 5;
|
||||
fWidth = (float)(iTotalNumLines * 12 + fObjectivesTop + iNumObjectives * 25 + 32) - fY;
|
||||
vColor[2] = 0.2f;
|
||||
vColor[1] = 0.2f;
|
||||
vColor[0] = 0.2f;
|
||||
vColor[3] = cg.ObjectivesCurrentAlpha * 0.75;
|
||||
cgi.R_SetColor(vColor);
|
||||
cgi.R_DrawStretchPic(fX, fY, 450.0, fWidth, 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 = 130.0;
|
||||
fY = fObjectivesTop + 10;
|
||||
vColor[0] = 1.0;
|
||||
vColor[1] = 1.0;
|
||||
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, -1, 0);
|
||||
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, -1, 0);
|
||||
fHeight = 155.0;
|
||||
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_HIDDEN) || !cg.Objectives[i].flags) {
|
||||
if ((cg.Objectives[i].flags == OBJ_FLAG_NONE) || (cg.Objectives[i].flags & OBJ_FLAG_HIDDEN)) {
|
||||
continue;
|
||||
}
|
||||
|
||||
|
@ -778,7 +818,14 @@ void CG_DrawObjectives()
|
|||
cgi.R_SetColor(vColor);
|
||||
fX = 55.0;
|
||||
fY = fHeight;
|
||||
cgi.R_DrawString(cgs.media.objectiveFont, cgi.LV_ConvertString(cg.Objectives[i].text), 55.0, fHeight, -1, 0);
|
||||
cgi.R_DrawString(
|
||||
cgs.media.objectiveFont,
|
||||
cgi.LV_ConvertString(cg.Objectives[i].text),
|
||||
55.0,
|
||||
fY / cgs.uiHiResScale[1],
|
||||
-1,
|
||||
cgs.uiHiResScale
|
||||
);
|
||||
|
||||
fX = 30.0;
|
||||
fY = fHeight;
|
||||
|
@ -787,9 +834,19 @@ void CG_DrawObjectives()
|
|||
vColor[2] = 1.0;
|
||||
vColor[3] = cg.ObjectivesCurrentAlpha;
|
||||
cgi.R_SetColor(vColor);
|
||||
cgi.R_DrawStretchPic(fX, fY, 16.0, 16.0, 0.0, 0.0, 1.0, 1.0, hBoxShader);
|
||||
cgi.R_DrawStretchPic(
|
||||
fX * cgs.uiHiResScale[0],
|
||||
fY,
|
||||
16.0 * cgs.uiHiResScale[0],
|
||||
16.0 * cgs.uiHiResScale[1],
|
||||
0.0,
|
||||
0.0,
|
||||
1.0,
|
||||
1.0,
|
||||
hBoxShader
|
||||
);
|
||||
|
||||
fHeight += 25 * iNumLines[i];
|
||||
fHeight += iNumLines[i] * 12 + 25 * cgs.uiHiResScale[1];
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -813,7 +870,17 @@ void CG_DrawPlayerTeam()
|
|||
|
||||
if (handle) {
|
||||
cgi.R_SetColor(NULL);
|
||||
cgi.R_DrawStretchPic(96.0, cgs.glconfig.vidHeight - 46, 24.0, 24.0, 0.0, 0.0, 1.0, 1.0, handle);
|
||||
cgi.R_DrawStretchPic(
|
||||
96.0 * cgs.uiHiResScale[0],
|
||||
cgs.glconfig.vidHeight - 46 * cgs.uiHiResScale[1],
|
||||
24.0 * cgs.uiHiResScale[0],
|
||||
24.0 * cgs.uiHiResScale[1],
|
||||
0.0,
|
||||
0.0,
|
||||
1.0,
|
||||
1.0,
|
||||
handle
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -855,13 +922,28 @@ void CG_DrawPlayerEntInfo()
|
|||
|
||||
if (handle) {
|
||||
cgi.R_SetColor(0);
|
||||
cgi.R_DrawStretchPic(56.0, fY, 16.0, 16.0, 0.0, 0.0, 1.0, 1.0, handle);
|
||||
fX = 56.0 + 24.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_SetColor(color);
|
||||
cgi.R_DrawString(cgs.media.hudDrawFont, (char *)pszName, fX, fY, -1, 0);
|
||||
cgi.R_DrawString(cgs.media.hudDrawFont, va("%i", cg.snap->ps.stats[STAT_INFOCLIENT_HEALTH]), fX, fY + 20.0, -1, 0);
|
||||
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()
|
||||
|
@ -900,7 +982,17 @@ void CG_UpdateAttackerDisplay()
|
|||
|
||||
if (handle) {
|
||||
cgi.R_SetColor(0);
|
||||
cgi.R_DrawStretchPic(56.0, fY, 24.0, 24.0, 0.0, 0.0, 1.0, 1.0, handle);
|
||||
cgi.R_DrawStretchPic(
|
||||
56.0 * cgs.uiHiResScale[0],
|
||||
fY,
|
||||
24.0 * cgs.uiHiResScale[0],
|
||||
24.0 * cgs.uiHiResScale[1],
|
||||
0.0,
|
||||
0.0,
|
||||
1.0,
|
||||
1.0,
|
||||
handle
|
||||
);
|
||||
}
|
||||
|
||||
if ((cg.snap->ps.stats[STAT_TEAM] == TEAM_ALLIES || cg.snap->ps.stats[STAT_TEAM] == TEAM_AXIS)
|
||||
|
@ -914,7 +1006,7 @@ void CG_UpdateAttackerDisplay()
|
|||
color[2] = 0.5;
|
||||
}
|
||||
|
||||
fX = 56.0 + 32.0;
|
||||
fX = 56.0;
|
||||
} else {
|
||||
color[0] = 1.0;
|
||||
color[1] = 0.5;
|
||||
|
@ -922,11 +1014,15 @@ void CG_UpdateAttackerDisplay()
|
|||
}
|
||||
|
||||
cgi.R_SetColor(color);
|
||||
cgi.R_DrawString(cgs.media.attackerFont, pszName, fX, fY, -1, 0);
|
||||
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 = "";
|
||||
|
||||
if (!cg.snap) {
|
||||
return;
|
||||
}
|
||||
|
@ -937,16 +1033,25 @@ void CG_UpdateCountdown()
|
|||
iSecondsLeft = (cgs.matchEndTime - cg.time) / 1000;
|
||||
if (iSecondsLeft >= 0) {
|
||||
iMinutesLeft = iSecondsLeft / 60;
|
||||
cgi.Cvar_Set(
|
||||
"ui_timemessage", 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) {
|
||||
cgi.Cvar_Set("ui_timemessage", "");
|
||||
message = "";
|
||||
}
|
||||
} else {
|
||||
// The match has not started yet
|
||||
cgi.Cvar_Set("ui_timemessage", "Waiting For Players");
|
||||
message = "Waiting For Players";
|
||||
}
|
||||
|
||||
if (strcmp(ui_timemessage->string, message)) {
|
||||
cgi.Cvar_Set("ui_timemessage", message);
|
||||
}
|
||||
}
|
||||
|
||||
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");
|
||||
}
|
||||
|
||||
void CG_DrawStopwatch()
|
||||
|
@ -954,38 +1059,55 @@ void CG_DrawStopwatch()
|
|||
int iFraction;
|
||||
|
||||
if (!cg_hud->integer) {
|
||||
cgi.Cmd_Execute(EXEC_NOW, "ui_removehud hud_stopwatch\n");
|
||||
CG_RemoveStopwatch();
|
||||
return;
|
||||
}
|
||||
|
||||
if (!cgi.stopWatch->iStartTime) {
|
||||
cgi.Cmd_Execute(EXEC_NOW, "ui_removehud hud_stopwatch\n");
|
||||
CG_RemoveStopwatch();
|
||||
return;
|
||||
}
|
||||
|
||||
if (cgi.stopWatch->iStartTime >= cgi.stopWatch->iEndTime) {
|
||||
cgi.Cmd_Execute(EXEC_NOW, "ui_removehud hud_stopwatch\n");
|
||||
CG_RemoveStopwatch();
|
||||
return;
|
||||
}
|
||||
|
||||
if (cgi.stopWatch->iEndTime <= cg.time) {
|
||||
cgi.Cmd_Execute(EXEC_NOW, "ui_removehud hud_stopwatch\n");
|
||||
CG_RemoveStopwatch();
|
||||
return;
|
||||
}
|
||||
|
||||
if (cg.ObjectivesCurrentAlpha >= 0.02) {
|
||||
cgi.Cmd_Execute(EXEC_NOW, "ui_removehud hud_stopwatch\n");
|
||||
CG_RemoveStopwatch();
|
||||
return;
|
||||
}
|
||||
|
||||
if (cg.snap && cg.snap->ps.stats[STAT_HEALTH] <= 0) {
|
||||
cgi.Cmd_Execute(EXEC_NOW, "ui_removehud hud_stopwatch\n");
|
||||
CG_RemoveStopwatch();
|
||||
return;
|
||||
}
|
||||
|
||||
if (cgi.stopWatch->eType >= SWT_FUSE_WET) {
|
||||
iFraction = cgi.stopWatch->iEndTime - cgi.stopWatch->iStartTime;
|
||||
} else {
|
||||
iFraction = cgi.stopWatch->iEndTime - cg.time;
|
||||
}
|
||||
|
||||
cgi.Cvar_Set("ui_stopwatch", va("%i", iFraction));
|
||||
|
||||
switch (cgi.stopWatch->eType) {
|
||||
case SWT_NORMAL:
|
||||
default:
|
||||
cgi.Cmd_Execute(EXEC_NOW, "ui_addhud hud_stopwatch\n");
|
||||
break;
|
||||
case SWT_FUSE:
|
||||
cgi.Cmd_Execute(EXEC_NOW, "ui_addhud hud_fuse\n");
|
||||
break;
|
||||
case SWT_FUSE_WET:
|
||||
cgi.Cmd_Execute(EXEC_NOW, "ui_removehud hud_fuse\n");
|
||||
cgi.Cmd_Execute(EXEC_NOW, "ui_addhud hud_fuse_wet\n");
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
void CG_DrawInstantMessageMenu()
|
||||
|
@ -1009,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, y, w, h, 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()
|
||||
|
@ -1032,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, fY, -1, qfalse);
|
||||
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) {
|
||||
|
@ -1048,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, fY, -1, 0);
|
||||
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)) {
|
||||
|
@ -1059,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, fY, -1, 0);
|
||||
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)) {
|
||||
|
@ -1072,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, fY, -1, 0);
|
||||
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 & 0x80) != 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];
|
||||
sprintf(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;
|
||||
|
@ -1093,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, fY, -1, 0);
|
||||
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");
|
||||
|
@ -1105,9 +1252,18 @@ void CG_DrawSpectatorView_ver_15()
|
|||
}
|
||||
|
||||
if (hShader) {
|
||||
fX -= 20.0;
|
||||
cgi.R_SetColor(NULL);
|
||||
cgi.R_DrawStretchPic(fX, fY, 16.0, 16.0, 0.0, 0.0, 1.0, 1.0, hShader);
|
||||
cgi.R_DrawStretchPic(
|
||||
fX - 20.0 * cgs.uiHiResScale[0],
|
||||
fY,
|
||||
16.0 * cgs.uiHiResScale[0],
|
||||
16.0 * cgs.uiHiResScale[1],
|
||||
0.0,
|
||||
0.0,
|
||||
1.0,
|
||||
1.0,
|
||||
hShader
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -1139,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, fY, -1, 0);
|
||||
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);
|
||||
|
@ -1153,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, fY, -1, 0);
|
||||
cgi.R_DrawString(
|
||||
cgs.media.attackerFont, pszString, fX / cgs.uiHiResScale[0], fY / cgs.uiHiResScale[1], -1, cgs.uiHiResScale
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -1180,7 +1344,7 @@ void CG_DrawCrosshair()
|
|||
float x, y;
|
||||
float width, height;
|
||||
|
||||
shader = NULL;
|
||||
shader = (qhandle_t)0;
|
||||
|
||||
if (!cg_hud->integer || !ui_crosshair->integer) {
|
||||
return;
|
||||
|
@ -1190,7 +1354,7 @@ void CG_DrawCrosshair()
|
|||
return;
|
||||
}
|
||||
|
||||
if ((cg.snap->ps.pm_flags & PMF_NO_LEAN) || (cg.snap->ps.pm_flags & PMF_INTERMISSION)) {
|
||||
if ((cg.snap->ps.pm_flags & PMF_NO_HUD) || (cg.snap->ps.pm_flags & PMF_INTERMISSION)) {
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -1199,6 +1363,9 @@ void CG_DrawCrosshair()
|
|||
return;
|
||||
}
|
||||
|
||||
// Fixed in OPM: R_RegisterShaderNoMip
|
||||
// Use R_RegisterShaderNoMip, as it's UI stuff
|
||||
|
||||
if (cgs.gametype != GT_FFA) {
|
||||
AngleVectorsLeft(cg.refdefViewAngles, forward, NULL, NULL);
|
||||
|
||||
|
@ -1226,23 +1393,23 @@ void CG_DrawCrosshair()
|
|||
|| ((myFlags & EF_AXIS) && (friendEnt->currentState.eFlags & EF_AXIS))) {
|
||||
// friend
|
||||
if (cg.snap->ps.stats[STAT_CROSSHAIR]) {
|
||||
shader = cgi.R_RegisterShader(cg_crosshair_friend->string);
|
||||
shader = cgi.R_RegisterShaderNoMip(cg_crosshair_friend->string);
|
||||
}
|
||||
} else {
|
||||
// enemy
|
||||
if (cg.snap->ps.stats[STAT_CROSSHAIR]) {
|
||||
shader = cgi.R_RegisterShader(cg_crosshair->string);
|
||||
shader = cgi.R_RegisterShaderNoMip(cg_crosshair->string);
|
||||
}
|
||||
}
|
||||
} else {
|
||||
if (cg.snap->ps.stats[STAT_CROSSHAIR]) {
|
||||
shader = cgi.R_RegisterShader(cg_crosshair->string);
|
||||
shader = cgi.R_RegisterShaderNoMip(cg_crosshair->string);
|
||||
}
|
||||
}
|
||||
} else {
|
||||
// FFA
|
||||
if (cg.snap->ps.stats[STAT_CROSSHAIR]) {
|
||||
shader = cgi.R_RegisterShader(cg_crosshair->string);
|
||||
shader = cgi.R_RegisterShaderNoMip(cg_crosshair->string);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -1253,7 +1420,7 @@ void CG_DrawCrosshair()
|
|||
y = (cgs.glconfig.vidHeight - height) * 0.5f;
|
||||
|
||||
cgi.R_SetColor(NULL);
|
||||
cgi.R_DrawStretchPic(x, y, width, height, 0, 0, 1, 1, shader);
|
||||
cgi.R_DrawStretchPic(x, y, width * cgs.uiHiResScale[0], height * cgs.uiHiResScale[1], 0, 0, 1, 1, shader);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -1284,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, qfalse);
|
||||
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%%",
|
||||
|
@ -1304,7 +1473,9 @@ void CG_DrawVote()
|
|||
percentNo,
|
||||
cgi.LV_ConvertString("Undecided"),
|
||||
percentUndecided);
|
||||
cgi.R_DrawString(cgs.media.attackerFont, text, x, y, -1, qfalse);
|
||||
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;
|
||||
|
@ -1313,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, qfalse);
|
||||
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, qfalse);
|
||||
cgi.R_DrawString(
|
||||
cgs.media.attackerFont, text, x / cgs.uiHiResScale[0], y / cgs.uiHiResScale[1], -1, cgs.uiHiResScale
|
||||
);
|
||||
cgi.R_SetColor(NULL);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -59,7 +59,7 @@ qboolean CG_LightStyleColor(int style, int realtime, vec4_t color, qboolean clam
|
|||
|
||||
time = realtime / 50;
|
||||
frac = (realtime - (time * 50.0f)) / 50.0f;
|
||||
memset(color, 0, sizeof(color));
|
||||
VectorClear4(color);
|
||||
if ((style < 0) || (style >= (MAX_LIGHTSTYLES * 2))) {
|
||||
cgi.DPrintf("CG_LightStyleColor: style out of range.\n");
|
||||
return qtrue;
|
||||
|
|
|
@ -187,6 +187,7 @@ extern "C" {
|
|||
float min_dist;
|
||||
float width;
|
||||
char shader[MAX_RAIN_SHADERS][MAX_STRING_CHARS];
|
||||
char currentShader[MAX_STRING_CHARS];
|
||||
int numshaders;
|
||||
} crain_t;
|
||||
|
||||
|
@ -269,6 +270,8 @@ extern "C" {
|
|||
qhandle_t hAlliedPlayerModelHandle;
|
||||
dtiki_t *pAxisPlayerModel;
|
||||
qhandle_t hAxisPlayerModelHandle;
|
||||
qboolean serverAlliedModelValid;
|
||||
qboolean serverAxisModelValid;
|
||||
|
||||
// view eyes
|
||||
vec3_t vOffsetViewAngles;
|
||||
|
@ -340,6 +343,7 @@ extern "C" {
|
|||
float ObjectivesBaseAlpha;
|
||||
float ObjectivesDesiredAlpha;
|
||||
float ObjectivesCurrentAlpha;
|
||||
int ObjectivesCurrentIndex;
|
||||
|
||||
// misc
|
||||
crain_t rain;
|
||||
|
@ -378,6 +382,7 @@ extern "C" {
|
|||
float screenXScale; // derived from glconfig
|
||||
float screenYScale;
|
||||
float screenXBias;
|
||||
vec2_t uiHiResScale;
|
||||
|
||||
int serverCommandSequence; // reliable command stream counter
|
||||
int processedSnapshotNum; // the number of snapshots cgame has requested
|
||||
|
@ -429,6 +434,7 @@ extern "C" {
|
|||
extern cgs_t cgs;
|
||||
extern cg_t cg;
|
||||
extern clientGameImport_t cgi;
|
||||
extern target_game_e cg_target_game;
|
||||
extern int cg_protocol;
|
||||
extern centity_t cg_entities[MAX_GENTITIES];
|
||||
extern markPoly_t *cg_markPolys;
|
||||
|
@ -500,10 +506,18 @@ extern "C" {
|
|||
extern cvar_t *voiceChat;
|
||||
extern cvar_t *cg_shadowscount;
|
||||
extern cvar_t *cg_shadowdebug;
|
||||
extern cvar_t *ui_timemessage;
|
||||
|
||||
//
|
||||
// Added in OPM
|
||||
//
|
||||
extern cvar_t *cg_fov;
|
||||
extern cvar_t *cg_cheats;
|
||||
|
||||
//
|
||||
// cg_main.c
|
||||
//
|
||||
qboolean CG_UseLargeLightmaps(const char* mapName);
|
||||
void CG_ProcessConfigString(int num, qboolean modelOnly);
|
||||
const char *CG_ConfigString(int index);
|
||||
void CG_AddToTeamChat(const char *str);
|
||||
|
@ -519,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
|
||||
|
@ -726,8 +743,8 @@ extern "C" {
|
|||
void CG_InitTestTreadMark();
|
||||
void CG_AddTreadMarks();
|
||||
int CG_PermanentMark(
|
||||
const vec3_t origin,
|
||||
const vec3_t dir,
|
||||
vec3_t origin,
|
||||
vec3_t dir,
|
||||
float orientation,
|
||||
float fSScale,
|
||||
float fTScale,
|
||||
|
@ -920,7 +937,8 @@ qboolean CG_LightStyleColor(int style, int realtime, vec4_t color, qboolean clam
|
|||
void CG_InstaMessageGroupD_f(void);
|
||||
void CG_InstaMessageGroupE_f(void);
|
||||
void CG_HudPrint_f(void);
|
||||
int CG_CheckCaptureKey(int key, qboolean down, unsigned int time);
|
||||
|
||||
qboolean CG_CheckCaptureKey(int key, qboolean down, unsigned int time);
|
||||
|
||||
//
|
||||
// cg_vehicle.cpp
|
||||
|
|
|
@ -39,6 +39,7 @@ cvar_t *paused;
|
|||
cvar_t *developer;
|
||||
cg_t cg;
|
||||
cgs_t cgs;
|
||||
target_game_e cg_target_game = TG_INVALID;
|
||||
int cg_protocol;
|
||||
centity_t cg_entities[MAX_GENTITIES];
|
||||
|
||||
|
@ -109,6 +110,13 @@ cvar_t *vm_lean_lower;
|
|||
cvar_t *voiceChat;
|
||||
cvar_t *cg_shadowscount;
|
||||
cvar_t *cg_shadowdebug;
|
||||
cvar_t *ui_timemessage;
|
||||
|
||||
//
|
||||
// Added in OPM
|
||||
//
|
||||
cvar_t *cg_fov;
|
||||
cvar_t *cg_cheats;
|
||||
|
||||
/*
|
||||
=================
|
||||
|
@ -154,9 +162,9 @@ void CG_RegisterCvars(void)
|
|||
cg_shadowdebug = cgi.Cvar_Get("cg_shadowdebug", "0", 0);
|
||||
developer = cgi.Cvar_Get("developer", "0", 0);
|
||||
dm_playermodel = cgi.Cvar_Get("dm_playermodel", "american_army", 3);
|
||||
dm_playergermanmodel = cgi.Cvar_Get("dm_playergermanmodel", "german_wehrmacht_soldier", 3);
|
||||
dm_playergermanmodel = cgi.Cvar_Get("dm_playergermanmodel", "german_wehrmacht_soldier", CVAR_ARCHIVE | CVAR_USERINFO);
|
||||
cg_forceModel = cgi.Cvar_Get("cg_forceModel", "0", CVAR_ARCHIVE);
|
||||
cg_animationviewmodel = cgi.Cvar_Get("cg_animationviewmodel", "0", 8);
|
||||
cg_animationviewmodel = cgi.Cvar_Get("cg_animationviewmodel", "0", CVAR_SYSTEMINFO);
|
||||
cg_hitmessages = cgi.Cvar_Get("cg_hitmessages", "1", CVAR_ARCHIVE);
|
||||
cg_acidtrip = cgi.Cvar_Get("cg_acidtrip", "0", CVAR_CHEAT);
|
||||
cg_hud = cgi.Cvar_Get("cg_hud", "0", 0);
|
||||
|
@ -196,53 +204,113 @@ void CG_RegisterCvars(void)
|
|||
vm_lean_lower = cgi.Cvar_Get("vm_lean_lower", "0.1", 0);
|
||||
voiceChat = cgi.Cvar_Get("cg_voicechat", "1", 0);
|
||||
|
||||
ui_timemessage = cgi.Cvar_Get("ui_timemessage", "", 0);
|
||||
|
||||
// see if we are also running the server on this machine
|
||||
temp = cgi.Cvar_Get("sv_running", "0", 0);
|
||||
cgs.localServer = temp->integer;
|
||||
|
||||
//
|
||||
// Added in OPM
|
||||
//
|
||||
|
||||
cg_fov = cgi.Cvar_Get("cg_fov", "80", CVAR_ARCHIVE);
|
||||
cg_cheats = cgi.Cvar_Get("cheats", "0", CVAR_USERINFO | CVAR_SERVERINFO | CVAR_LATCH);
|
||||
}
|
||||
/*
|
||||
===============
|
||||
CG_UseLargeLightmaps
|
||||
|
||||
Added in 2.0
|
||||
Returns true if the standard BSP file should be used, false if the smaller lightmap BSP file should be used
|
||||
===============
|
||||
*/
|
||||
qboolean CG_UseLargeLightmaps(const char* mapName) {
|
||||
char buffer[MAX_QPATH];
|
||||
|
||||
Com_sprintf(buffer, sizeof(buffer), "maps/%s_sml.bsp", mapName);
|
||||
|
||||
if (cgi.FS_ReadFile(buffer, NULL, qtrue) == -1) {
|
||||
return qtrue;
|
||||
}
|
||||
|
||||
return cgi.Cvar_Get("r_largemap", "0", 0)->integer;
|
||||
}
|
||||
|
||||
/*
|
||||
================
|
||||
CG_RegisterSoundsForFile
|
||||
|
||||
Register the specified ubersound source file
|
||||
================
|
||||
*/
|
||||
void CG_RegisterSoundsForFile(const char *name)
|
||||
{
|
||||
int startTime;
|
||||
int endTime;
|
||||
|
||||
Com_Printf("\n\n-----------PARSING '%s'------------\n", name);
|
||||
Com_Printf(
|
||||
"Any SetCurrentTiki errors means that tiki wasn't prefetched and tiki-specific sounds for it won't work. To "
|
||||
"fix prefetch the tiki. Ignore if you don't use that tiki on this level.\n"
|
||||
);
|
||||
|
||||
startTime = cgi.Milliseconds();
|
||||
CG_Command_ProcessFile(name, qfalse, NULL);
|
||||
endTime = cgi.Milliseconds();
|
||||
|
||||
Com_Printf("Parse/Load time: %f seconds.\n", (float)(endTime - startTime) / 1000.0);
|
||||
Com_Printf("-------------PARSING '%s' DONE---------------\n\n", name);
|
||||
}
|
||||
|
||||
/*
|
||||
=================
|
||||
qsort_compare_strings
|
||||
|
||||
perform case-insensitive sorting
|
||||
=================
|
||||
*/
|
||||
int qsort_compare_strings(const void *s1, const void *s2)
|
||||
{
|
||||
return Q_stricmp(*(const char **)s1, *(const char **)s2);
|
||||
}
|
||||
|
||||
/*
|
||||
=================
|
||||
CG_RegisterSounds
|
||||
|
||||
called during a precache command
|
||||
Called during a precache command
|
||||
=================
|
||||
*/
|
||||
void CG_RegisterSounds(void)
|
||||
{
|
||||
int startTime;
|
||||
int endTime;
|
||||
char filename[MAX_QPATH];
|
||||
char **fileList;
|
||||
int numFiles;
|
||||
int i;
|
||||
|
||||
Com_Printf("\n\n-----------PARSING UBERSOUND------------\n");
|
||||
Com_Printf(
|
||||
"Any SetCurrentTiki errors means that tiki wasn't prefetched and "
|
||||
"tiki-specific sounds for it won't work. To fix prefe"
|
||||
"tch the tiki. Ignore if you don't use that tiki on this level.\n"
|
||||
);
|
||||
Com_sprintf(filename, sizeof(filename), "ubersound/ubersound.scr");
|
||||
fileList = cgi.FS_ListFilteredFiles("ubersound/", "scr", "*.scr", qfalse, &numFiles, qtrue);
|
||||
if (cg_target_game >= TG_MOHTA) {
|
||||
// Fixed in 2.0
|
||||
// The behavior has changed, all aliases get cleared
|
||||
if (cgs.gametype != GT_SINGLE_PLAYER) {
|
||||
cgi.Alias_Clear();
|
||||
}
|
||||
} else {
|
||||
if (!cgs.localServer) {
|
||||
cgi.Alias_Clear();
|
||||
}
|
||||
}
|
||||
|
||||
startTime = cgi.Milliseconds();
|
||||
CG_Command_ProcessFile(filename, 0, 0);
|
||||
endTime = cgi.Milliseconds();
|
||||
qsort(fileList, numFiles, sizeof(char *), &qsort_compare_strings);
|
||||
|
||||
Com_Printf("Parse/Load time: %f seconds.\n", (endTime - startTime) / 1000.0f);
|
||||
for (i = 0; i < numFiles; i++) {
|
||||
// Added in 2.0
|
||||
// Since 2.0, all files in the ubersound folder
|
||||
// are parsed
|
||||
CG_RegisterSoundsForFile(va("ubersound/%s", fileList[i]));
|
||||
}
|
||||
|
||||
Com_Printf("-------------UBERSOUND DONE---------------\n\n");
|
||||
Com_Printf("\n\n-----------PARSING UBERDIALOG------------\n");
|
||||
Com_Printf(
|
||||
"Any SetCurrentTiki errors means that tiki wasn't prefetched and "
|
||||
"tiki-specific sounds for it won't work. To fix prefe"
|
||||
"tch the tiki. Ignore if you don't use that tiki on this level.\n"
|
||||
);
|
||||
Com_sprintf(filename, sizeof(filename), "ubersound/uberdialog.scr");
|
||||
|
||||
startTime = cgi.Milliseconds();
|
||||
CG_Command_ProcessFile(filename, 0, 0);
|
||||
endTime = cgi.Milliseconds() - startTime;
|
||||
|
||||
Com_Printf("Parse/Load time: %f seconds.\n", endTime / 1000.0f);
|
||||
Com_Printf("-------------UBERDIALOG DONE---------------\n\n");
|
||||
cgi.FS_FreeFileList(fileList);
|
||||
}
|
||||
|
||||
/*
|
||||
|
@ -252,13 +320,11 @@ CG_IsHandleUnique
|
|||
Check if the model handle is unique
|
||||
================
|
||||
*/
|
||||
static qboolean CG_IsHandleUnique(int num) {
|
||||
qhandle_t handle;
|
||||
static qboolean CG_IsHandleUnique(qhandle_t handle) {
|
||||
int i;
|
||||
int numRef;
|
||||
|
||||
numRef = 0;
|
||||
handle = cgs.model_draw[num];
|
||||
for (i = 0; i < MAX_MODELS; i++) {
|
||||
if (cgs.model_draw[i] == handle) {
|
||||
numRef++;
|
||||
|
@ -301,6 +367,8 @@ 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)) {
|
||||
|
@ -308,6 +376,10 @@ void CG_ProcessConfigString(int num, qboolean modelOnly)
|
|||
cgi.R_UnregisterServerModel(hOldModel);
|
||||
}
|
||||
cgs.model_draw[num - CS_MODELS] = 0;
|
||||
|
||||
if (!str || !str[0]) {
|
||||
CG_ServerModelUnloaded(hOldModel);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -335,28 +407,39 @@ void CG_ProcessConfigString(int num, qboolean modelOnly)
|
|||
cg.rain.width = atof(str);
|
||||
return;
|
||||
case CS_RAIN_SHADER:
|
||||
Q_strncpyz(cg.rain.currentShader, str, sizeof(cg.rain.currentShader));
|
||||
if (cg.rain.numshaders) {
|
||||
for (i = 0; i < cg.rain.numshaders; i++) {
|
||||
sprintf(cg.rain.shader[i], "%s%i", str, i);
|
||||
// Fixed in OPM
|
||||
// not sure why some maps set a digit at the end...
|
||||
size_t len = strlen(cg.rain.currentShader);
|
||||
if (isdigit(cg.rain.currentShader[len - 1])) {
|
||||
cg.rain.currentShader[len - 1] = 0;
|
||||
}
|
||||
} else {
|
||||
strcpy(cg.rain.shader[0], str);
|
||||
}
|
||||
for (i = 0; i < cg.rain.numshaders; ++i) {
|
||||
Com_sprintf(cg.rain.shader[i], sizeof(cg.rain.shader[i]), "%s%i", cg.rain.currentShader, i);
|
||||
}
|
||||
if (!cg.rain.numshaders) {
|
||||
Q_strncpyz(cg.rain.shader[0], cg.rain.currentShader, sizeof(cg.rain.shader[0]));
|
||||
}
|
||||
return;
|
||||
case CS_RAIN_NUMSHADERS:
|
||||
cg.rain.numshaders = atoi(str);
|
||||
if (cg.rain.numshaders) {
|
||||
for (i = 0; i < cg.rain.numshaders; i++) {
|
||||
sprintf(cg.rain.shader[i], "%s%i", str, i);
|
||||
Com_sprintf(cg.rain.shader[i], sizeof(cg.rain.shader[i]), "%s%i", cg.rain.currentShader, i);
|
||||
}
|
||||
}
|
||||
return;
|
||||
case CS_CURRENT_OBJECTIVE:
|
||||
cg.ObjectivesCurrentIndex = atoi(str);
|
||||
return;
|
||||
}
|
||||
|
||||
if (num >= CS_OBJECTIVES && num < CS_OBJECTIVES + MAX_OBJECTIVES) {
|
||||
cobjective_t *objective = &cg.Objectives[num - CS_OBJECTIVES];
|
||||
objective->flags = atoi(Info_ValueForKey(str, "flags"));
|
||||
strcpy(objective->text, Info_ValueForKey(str, "text"));
|
||||
Q_strncpyz(objective->text, Info_ValueForKey(str, "text"), sizeof(objective->text));
|
||||
}
|
||||
|
||||
switch (num) {
|
||||
|
@ -411,7 +494,7 @@ void CG_ProcessConfigString(int num, qboolean modelOnly)
|
|||
if (len) {
|
||||
qboolean streamed;
|
||||
char buf[1024];
|
||||
strcpy(buf, str);
|
||||
Q_strncpyz(buf, str, sizeof(buf));
|
||||
|
||||
streamed = buf[len - 1] != '0';
|
||||
buf[len - 1] = 0;
|
||||
|
@ -525,6 +608,7 @@ void CG_GetRendererConfig(void)
|
|||
cgi.GetGlconfig(&cgs.glconfig);
|
||||
cgs.screenXScale = cgs.glconfig.vidWidth / 640.0;
|
||||
cgs.screenYScale = cgs.glconfig.vidHeight / 480.0;
|
||||
cgi.UI_GetHighResolutionScale(cgs.uiHiResScale);
|
||||
}
|
||||
|
||||
/*
|
||||
|
@ -623,6 +707,8 @@ void CG_Init(clientGameImport_t *imported, int serverMessageNum, int serverComma
|
|||
cgi = *imported;
|
||||
|
||||
cg_protocol = cgi.Cvar_Get("com_protocol", "", 0)->integer;
|
||||
cg_target_game = (target_game_e)cgi.Cvar_Get("com_target_game", "0", 0)->integer;
|
||||
|
||||
CG_InitCGMessageAPI(&cge);
|
||||
CG_InitScoresAPI(&cge);
|
||||
|
||||
|
@ -811,7 +897,7 @@ void Com_Error(int level, const char *error, ...)
|
|||
char text[1024];
|
||||
|
||||
va_start(argptr, error);
|
||||
vsprintf(text, error, argptr);
|
||||
Q_vsnprintf(text, sizeof(text), error, argptr);
|
||||
va_end(argptr);
|
||||
|
||||
cgi.Error(level, "%s", text);
|
||||
|
@ -823,7 +909,7 @@ void Com_Printf(const char *msg, ...)
|
|||
char text[1024];
|
||||
|
||||
va_start(argptr, msg);
|
||||
vsprintf(text, msg, argptr);
|
||||
Q_vsnprintf(text, sizeof(text), msg, argptr);
|
||||
va_end(argptr);
|
||||
|
||||
cgi.Printf("%s", text);
|
||||
|
|
File diff suppressed because it is too large
Load diff
|
@ -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.tik", modelName);
|
||||
}
|
||||
|
||||
/*
|
||||
===============
|
||||
CG_PlayerTeamIcon
|
||||
===============
|
||||
*/
|
||||
void CG_PlayerTeamIcon(refEntity_t *pModel, entityState_t *pPlayerState)
|
||||
{
|
||||
qboolean bInArtillery, bInTeam, bSpecialIcon;
|
||||
|
@ -180,6 +207,118 @@ void CG_PlayerTeamIcon(refEntity_t *pModel, entityState_t *pPlayerState)
|
|||
}
|
||||
}
|
||||
|
||||
/*
|
||||
===============
|
||||
CG_InterpolateAnimParms
|
||||
|
||||
Interpolate between current and next entity
|
||||
===============
|
||||
*/
|
||||
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;
|
||||
|
||||
if (!vmEntity) {
|
||||
vmEntity = cgi.Cvar_Get("viewmodelanim", "1", 0);
|
||||
}
|
||||
|
||||
if (sNext && sNext->usageIndex == state->usageIndex) {
|
||||
t1 = cg.time - cg.snap->serverTime;
|
||||
t2 = cg.nextSnap->serverTime - cg.snap->serverTime;
|
||||
t = t1 / t2;
|
||||
|
||||
model->actionWeight = (sNext->actionWeight - state->actionWeight) * t + state->actionWeight;
|
||||
|
||||
for (i = 0; i < MAX_FRAMEINFOS; i++) {
|
||||
if (sNext->frameInfo[i].weight) {
|
||||
model->frameInfo[i].index = sNext->frameInfo[i].index;
|
||||
if (sNext->frameInfo[i].index == state->frameInfo[i].index && state->frameInfo[i].weight) {
|
||||
model->frameInfo[i].weight =
|
||||
(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;
|
||||
} else {
|
||||
animLength = cgi.Anim_Time(model->tiki, sNext->frameInfo[i].index);
|
||||
if (!animLength) {
|
||||
t1 = 0.0;
|
||||
} else {
|
||||
t1 = (animLength + sNext->frameInfo[i].time - state->frameInfo[i].time) * t
|
||||
+ state->frameInfo[i].time;
|
||||
}
|
||||
|
||||
t2 = t1;
|
||||
while (t2 > animLength) {
|
||||
t2 -= animLength;
|
||||
|
||||
if (t2 == t1) {
|
||||
t2 = 1.0;
|
||||
break;
|
||||
}
|
||||
|
||||
t1 = t2;
|
||||
}
|
||||
|
||||
model->frameInfo[i].time = t2;
|
||||
}
|
||||
} else {
|
||||
animLength = cgi.Anim_Time(model->tiki, sNext->frameInfo[i].index);
|
||||
if (!animLength) {
|
||||
t1 = 0.0;
|
||||
} else {
|
||||
t1 = sNext->frameInfo[i].time - (cg.nextSnap->serverTime - cg.time) / 1000.0;
|
||||
}
|
||||
|
||||
model->frameInfo[i].time = Q_max(0, t1);
|
||||
model->frameInfo[i].weight = sNext->frameInfo[i].weight;
|
||||
}
|
||||
} else if (sNext->frameInfo[i].index == state->frameInfo[i].index) {
|
||||
animLength = cgi.Anim_Time(model->tiki, sNext->frameInfo[i].index);
|
||||
if (!animLength) {
|
||||
t1 = 0.0;
|
||||
} else {
|
||||
t1 = (cg.time - cg.snap->serverTime) / 1000.0 + state->frameInfo[i].time;
|
||||
}
|
||||
|
||||
model->frameInfo[i].index = Q_clamp_int(state->frameInfo[i].index, 0, model->tiki->a->num_anims - 1);
|
||||
model->frameInfo[i].time = Q_min(animLength, t1);
|
||||
model->frameInfo[i].weight = (1.0 - t) * state->frameInfo[i].weight;
|
||||
} else {
|
||||
model->frameInfo[i].index = -1;
|
||||
model->frameInfo[i].weight = 0.0;
|
||||
}
|
||||
}
|
||||
} else {
|
||||
// no next state, don't blend anims
|
||||
|
||||
model->actionWeight = state->actionWeight;
|
||||
for (i = 0; i < MAX_FRAMEINFOS; i++) {
|
||||
if (state->frameInfo[i].weight) {
|
||||
model->frameInfo[i].index = Q_clamp_int(state->frameInfo[i].index, 0, model->tiki->a->num_anims - 1);
|
||||
model->frameInfo[i].time = state->frameInfo[i].time;
|
||||
model->frameInfo[i].weight = state->frameInfo[i].weight;
|
||||
} else {
|
||||
model->frameInfo[i].index = -1;
|
||||
model->frameInfo[i].weight = 0.0;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (vmEntity->integer == state->number) {
|
||||
static cvar_t *curanim;
|
||||
if (!curanim) {
|
||||
curanim = cgi.Cvar_Get("viewmodelanimslot", "1", 0);
|
||||
}
|
||||
|
||||
cgi.Cvar_Set("viewmodelanimclienttime", va("%0.2f", model->frameInfo[curanim->integer].time));
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
===============
|
||||
CG_CastFootShadow
|
||||
|
@ -187,7 +326,7 @@ 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;
|
||||
|
@ -210,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;
|
||||
|
||||
//
|
||||
|
@ -266,8 +404,7 @@ void CG_CastFootShadow(const vec_t* vLightPos, vec_t* vLightIntensity, int iTag,
|
|||
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);
|
||||
}
|
||||
|
@ -334,7 +471,15 @@ 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;
|
||||
|
@ -444,10 +589,8 @@ qboolean CG_EntityShadow(centity_t *cent, refEntity_t *model)
|
|||
|
||||
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);
|
||||
}
|
||||
|
@ -550,7 +693,7 @@ void CG_AnimationDebugMessage(int number, const char *fmt, ...)
|
|||
char msg[1024];
|
||||
|
||||
va_start(argptr, fmt);
|
||||
vsprintf(msg, fmt, argptr);
|
||||
Q_vsnprintf(msg, sizeof(msg), fmt, argptr);
|
||||
va_end(argptr);
|
||||
|
||||
if ((!cg_debugAnimWatch->integer) || ((cg_debugAnimWatch->integer - 1) == number)) {
|
||||
|
@ -614,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
|
||||
)
|
||||
|
@ -626,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);
|
||||
}
|
||||
|
@ -639,25 +786,160 @@ 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 *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;
|
||||
|
||||
sprintf(szAlliesModel, "models/player/%s.tik", pszAlliesPartial);
|
||||
sprintf(szAxisModel, "models/player/%s.tik", pszAxisPartial);
|
||||
Com_sprintf(szAlliesModel, sizeof(szAlliesModel), "models/player/%s.tik", pszAlliesPartial);
|
||||
Com_sprintf(szAxisModel, sizeof(szAxisModel), "models/player/%s.tik", pszAxisPartial);
|
||||
|
||||
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) hModel = cgi.R_RegisterModel("models/player/american_army.tik");
|
||||
}
|
||||
|
||||
if (hModel) {
|
||||
cg.hAlliedPlayerModelHandle = hModel;
|
||||
|
@ -667,11 +949,14 @@ void CG_UpdateForceModels()
|
|||
}
|
||||
} else {
|
||||
cg.hAlliedPlayerModelHandle = 0;
|
||||
cg.pAlliedPlayerModel = 0;
|
||||
cg.pAlliedPlayerModel = NULL;
|
||||
}
|
||||
|
||||
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) hModel = cgi.R_RegisterModel("models/player/german_wehrmacht_soldier.tik");
|
||||
}
|
||||
|
||||
if (hModel) {
|
||||
cg.hAxisPlayerModelHandle = hModel;
|
||||
|
@ -685,10 +970,35 @@ void CG_UpdateForceModels()
|
|||
}
|
||||
|
||||
// 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;
|
||||
|
@ -697,7 +1007,6 @@ void CG_ModelAnim(centity_t *cent, qboolean bDoShaderTime)
|
|||
int i;
|
||||
vec3_t vMins, vMaxs, vTmp;
|
||||
const char *szTagName;
|
||||
static cvar_t *vmEntity = NULL;
|
||||
int iAnimFlags;
|
||||
|
||||
s1 = ¢->currentState;
|
||||
|
@ -709,10 +1018,6 @@ void CG_ModelAnim(centity_t *cent, qboolean bDoShaderTime)
|
|||
|
||||
memset(&model, 0, sizeof(model));
|
||||
|
||||
if (!vmEntity) {
|
||||
vmEntity = cgi.Cvar_Get("viewmodelanim", "1", 0);
|
||||
}
|
||||
|
||||
if (cent->interpolate) {
|
||||
sNext = ¢->nextState;
|
||||
}
|
||||
|
@ -834,8 +1139,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;
|
||||
|
@ -859,9 +1164,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];
|
||||
|
@ -880,103 +1185,7 @@ void CG_ModelAnim(centity_t *cent, qboolean bDoShaderTime)
|
|||
model.renderfx |= s1->renderfx;
|
||||
cgi.TIKI_SetEyeTargetPos(model.tiki, model.entityNumber, s1->eyeVector);
|
||||
|
||||
if (sNext && sNext->usageIndex == s1->usageIndex) {
|
||||
float t;
|
||||
float animLength;
|
||||
float t1, t2;
|
||||
|
||||
t1 = cg.time - cg.snap->serverTime;
|
||||
t2 = cg.nextSnap->serverTime - cg.snap->serverTime;
|
||||
t = t1 / t2;
|
||||
model.actionWeight = (sNext->actionWeight - s1->actionWeight) * t + s1->actionWeight;
|
||||
|
||||
for (i = 0; i < MAX_FRAMEINFOS; i++) {
|
||||
if (sNext->frameInfo[i].weight) {
|
||||
model.frameInfo[i].index = sNext->frameInfo[i].index;
|
||||
if (sNext->frameInfo[i].index == s1->frameInfo[i].index && s1->frameInfo[i].weight) {
|
||||
model.frameInfo[i].weight =
|
||||
(sNext->frameInfo[i].weight - s1->frameInfo[i].weight) * t + s1->frameInfo[i].weight;
|
||||
|
||||
if (sNext->frameInfo[i].time >= s1->frameInfo[i].time) {
|
||||
model.frameInfo[i].time =
|
||||
(sNext->frameInfo[i].time - s1->frameInfo[i].time) * t + s1->frameInfo[i].time;
|
||||
} else {
|
||||
animLength = cgi.Anim_Time(model.tiki, sNext->frameInfo[i].index);
|
||||
if (!animLength) {
|
||||
t1 = 0.0;
|
||||
} else {
|
||||
t1 = (animLength + sNext->frameInfo[i].time - s1->frameInfo[i].time) * t
|
||||
+ s1->frameInfo[i].time;
|
||||
}
|
||||
|
||||
t2 = t1;
|
||||
while (t2 > animLength) {
|
||||
t2 -= animLength;
|
||||
}
|
||||
|
||||
model.frameInfo[i].time = t2;
|
||||
}
|
||||
} else {
|
||||
animLength = cgi.Anim_Time(model.tiki, sNext->frameInfo[i].index);
|
||||
if (!animLength) {
|
||||
t1 = 0.0;
|
||||
} else {
|
||||
t1 = sNext->frameInfo[i].time - (cg.nextSnap->serverTime - cg.time) / 1000.0;
|
||||
}
|
||||
|
||||
t2 = t1;
|
||||
if (t2 < 0.0) {
|
||||
t2 = 0.0;
|
||||
}
|
||||
|
||||
model.frameInfo[i].time = t2;
|
||||
model.frameInfo[i].weight = sNext->frameInfo[i].weight;
|
||||
}
|
||||
} else if (sNext->frameInfo[i].index == s1->frameInfo[i].index) {
|
||||
animLength = cgi.Anim_Time(model.tiki, sNext->frameInfo[i].index);
|
||||
if (!animLength) {
|
||||
t1 = 0.0;
|
||||
} else {
|
||||
t1 = (cg.time - cg.snap->serverTime) / 1000.0 + s1->frameInfo[i].time;
|
||||
}
|
||||
|
||||
t2 = t1;
|
||||
if (t2 < animLength) {
|
||||
t2 = animLength;
|
||||
}
|
||||
|
||||
model.frameInfo[i].index = s1->frameInfo[i].index;
|
||||
model.frameInfo[i].time = t2;
|
||||
model.frameInfo[i].weight = (1.0 - t) * s1->frameInfo[i].weight;
|
||||
} else {
|
||||
model.frameInfo[i].index = -1;
|
||||
model.frameInfo[i].weight = 0.0;
|
||||
}
|
||||
}
|
||||
} else {
|
||||
// no next state, don't blend anims
|
||||
|
||||
model.actionWeight = s1->actionWeight;
|
||||
for (i = 0; i < MAX_FRAMEINFOS; i++) {
|
||||
if (s1->frameInfo[i].weight) {
|
||||
model.frameInfo[i].index = s1->frameInfo[i].index;
|
||||
model.frameInfo[i].time = s1->frameInfo[i].time;
|
||||
model.frameInfo[i].weight = s1->frameInfo[i].weight;
|
||||
} else {
|
||||
model.frameInfo[i].index = -1;
|
||||
model.frameInfo[i].weight = 0.0;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (vmEntity->integer == s1->number) {
|
||||
static cvar_t *curanim;
|
||||
if (!curanim) {
|
||||
curanim = cgi.Cvar_Get("viewmodelanimslot", "1", 0);
|
||||
}
|
||||
|
||||
cgi.Cvar_Set("viewmodelanimclienttime", va("%0.2f", model.frameInfo[curanim->integer].time));
|
||||
}
|
||||
CG_InterpolateAnimParms(s1, sNext, &model);
|
||||
|
||||
if (cent->currentState.parent != ENTITYNUM_NONE) {
|
||||
int iTagNum;
|
||||
|
@ -1190,7 +1399,9 @@ void CG_ModelAnim(centity_t *cent, qboolean bDoShaderTime)
|
|||
if (!cg.pLastPlayerWorldModel || cg.pLastPlayerWorldModel != model.tiki) {
|
||||
qhandle_t hModel;
|
||||
char fpsname[128];
|
||||
|
||||
COM_StripExtension(model.tiki->a->name, fpsname, sizeof(fpsname));
|
||||
Q_strcat(fpsname, sizeof(fpsname), "_fps.tik");
|
||||
|
||||
hModel = cgi.R_RegisterModel(fpsname);
|
||||
if (hModel) {
|
||||
|
@ -1201,9 +1412,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) {
|
||||
|
@ -1227,6 +1438,7 @@ void CG_ModelAnim(centity_t *cent, qboolean bDoShaderTime)
|
|||
memset(model.surfaces, 0, sizeof(model.surfaces));
|
||||
|
||||
CG_ViewModelAnimation(&model);
|
||||
model.renderfx |= RF_FRAMELERP;
|
||||
cgi.ForceUpdatePose(&model);
|
||||
|
||||
if ((cent->currentState.eFlags & EF_UNARMED) || cg_drawviewmodel->integer <= 1
|
||||
|
@ -1323,7 +1535,12 @@ void CG_ModelAnim(centity_t *cent, qboolean bDoShaderTime)
|
|||
if (model.frameInfo[i].weight) {
|
||||
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);
|
||||
cent->animLastTimes[i] = 0.0;
|
||||
if (cent->animLastTimes[i] == -1) {
|
||||
cent->animLast[i] = model.frameInfo[i].index;
|
||||
cent->animLastTimes[i] = model.frameInfo[i].time;
|
||||
} else {
|
||||
cent->animLastTimes[i] = 0;
|
||||
}
|
||||
}
|
||||
|
||||
CG_ClientCommands(&model, cent, i);
|
||||
|
|
|
@ -51,16 +51,16 @@ void RainTouch(ctempmodel_t *ct, trace_t *trace)
|
|||
|
||||
void ClientGameCommandManager::RainTouch(Event *ev)
|
||||
{
|
||||
// FIXME: unimplemented
|
||||
// Nothing to do
|
||||
}
|
||||
|
||||
void ClientGameCommandManager::InitializeRainCvars()
|
||||
{
|
||||
int i;
|
||||
|
||||
cg_rain = cgi.Cvar_Get("cg_rain", "0", CVAR_ARCHIVE);
|
||||
cg_rain = cgi.Cvar_Get("cg_rain", "1", CVAR_ARCHIVE);
|
||||
cg_rain_drawcoverage =
|
||||
cgi.Cvar_Get("cg_rain_drawcoverage", "0", CVAR_SAVEGAME | CVAR_SERVER_CREATED | CVAR_SYSTEMINFO);
|
||||
cgi.Cvar_Get("cg_rain_drawcoverage", "0", CVAR_SAVEGAME | CVAR_RESETSTRING | CVAR_SYSTEMINFO);
|
||||
|
||||
cg.rain.density = 0.0;
|
||||
cg.rain.speed = 2048.0f;
|
||||
|
|
File diff suppressed because it is too large
Load diff
|
@ -190,8 +190,9 @@ void CG_ShowTrace(trace_t *trace, int passent, const char *reason)
|
|||
assert(reason);
|
||||
assert(trace);
|
||||
|
||||
sprintf(
|
||||
Com_sprintf(
|
||||
text,
|
||||
sizeof(text),
|
||||
"%0.2f : Pass (%d) Frac %f Hit (%d): '%s'\n",
|
||||
(float)cg.time / 1000.0f,
|
||||
passent,
|
||||
|
@ -329,7 +330,17 @@ static void CG_InterpolatePlayerStateCamera(void)
|
|||
//
|
||||
VectorCopy(cg.predicted_player_state.camera_angles, cg.camera_angles);
|
||||
VectorCopy(cg.predicted_player_state.camera_origin, cg.camera_origin);
|
||||
|
||||
//
|
||||
// Added in OPM
|
||||
// Use the specified fov specified by the server
|
||||
// when zooming
|
||||
//
|
||||
if (cg.predicted_player_state.stats[STAT_INZOOM]) {
|
||||
cg.camera_fov = cg.predicted_player_state.fov;
|
||||
} else {
|
||||
cg.camera_fov = cg_fov->value;
|
||||
}
|
||||
|
||||
// if the next frame is a teleport, we can't lerp to it
|
||||
if (cg.nextFrameCameraCut) {
|
||||
|
@ -342,13 +353,24 @@ static void CG_InterpolatePlayerStateCamera(void)
|
|||
|
||||
f = (float)(cg.time - prev->serverTime) / (next->serverTime - prev->serverTime);
|
||||
|
||||
if (cg.predicted_player_state.stats[STAT_INZOOM]) {
|
||||
// interpolate fov
|
||||
cg.camera_fov = prev->ps.fov + f * (next->ps.fov - prev->ps.fov);
|
||||
} else {
|
||||
cg.camera_fov = cg_fov->value;
|
||||
}
|
||||
|
||||
if (!(cg.snap->ps.pm_flags & PMF_CAMERA_VIEW)) {
|
||||
return;
|
||||
}
|
||||
|
||||
// Added in 2.0
|
||||
if (cg.predicted_player_state.camera_flags & CF_CAMERA_ANGLES_TURRETMODE) {
|
||||
VectorCopy(cg.nextSnap->ps.camera_origin, cg.camera_origin);
|
||||
VectorCopy(cg.nextSnap->ps.camera_angles, cg.camera_angles);
|
||||
return;
|
||||
}
|
||||
|
||||
for (i = 0; i < 3; i++) {
|
||||
cg.camera_origin[i] = prev->ps.camera_origin[i] + f * (next->ps.camera_origin[i] - prev->ps.camera_origin[i]);
|
||||
cg.camera_angles[i] = LerpAngle(prev->ps.camera_angles[i], next->ps.camera_angles[i], f);
|
||||
|
@ -493,8 +515,13 @@ void CG_PredictPlayerState(void)
|
|||
cg_pmove.leanSpeed = 2.f;
|
||||
} else {
|
||||
cg_pmove.alwaysAllowLean = qtrue;
|
||||
|
||||
if (cgs.gametype != GT_SINGLE_PLAYER) {
|
||||
cg_pmove.leanMax = 40.f;
|
||||
} else {
|
||||
// Don't allow lean in single-player, like in the original game
|
||||
cg_pmove.leanMax = 0;
|
||||
}
|
||||
|
||||
cg_pmove.leanAdd = 10.f;
|
||||
cg_pmove.leanRecoverSpeed = 15.f;
|
||||
cg_pmove.leanSpeed = 4.f;
|
||||
|
@ -515,7 +542,11 @@ void CG_PredictPlayerState(void)
|
|||
// the server time is beyond our current cg.time,
|
||||
// because predicted player positions are going to
|
||||
// be ahead of everything else anyway
|
||||
if (cg.nextSnap && !cg.nextFrameTeleport && !cg.thisFrameTeleport) {
|
||||
// Added in OPM: prediction check
|
||||
// Don't use the next snapshot if the prediction is about to be disabled
|
||||
// this prevent "blinking" issues like when entering a vehicle turret gun
|
||||
// where arms would be seen shortly
|
||||
if (cg.nextSnap && !cg.nextFrameTeleport && !cg.thisFrameTeleport && !(cg.nextSnap->ps.pm_flags & PMF_NO_PREDICTION)) {
|
||||
cg.predicted_player_state = cg.nextSnap->ps;
|
||||
cg.physicsTime = cg.nextSnap->serverTime;
|
||||
} else {
|
||||
|
|
|
@ -120,7 +120,9 @@ functions exported to the main executable
|
|||
|
||||
// console variable interaction
|
||||
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);
|
||||
|
@ -311,12 +313,12 @@ functions exported to the main executable
|
|||
); // 0 = white
|
||||
fontheader_t *(*R_LoadFont)(const char *name);
|
||||
void (*R_DrawString)(
|
||||
fontheader_t *font, const char *text, float x, float y, int maxLen, qboolean virtualScreen
|
||||
fontheader_t *font, const char *text, float x, float y, int maxLen, const float *pvVirtualScreen
|
||||
);
|
||||
refEntity_t *(*R_GetRenderEntity)(int entityNumber);
|
||||
void (*R_ModelBounds)(clipHandle_t model, vec3_t mins, vec3_t maxs);
|
||||
float (*R_ModelRadius)(clipHandle_t model);
|
||||
float (*R_Noise)(float x, float y, float z, float t);
|
||||
float (*R_Noise)(float x, float y, float z, double t);
|
||||
void (*R_DebugLine)(const vec3_t start, const vec3_t end, float r, float g, float b, float alpha);
|
||||
baseshader_t *(*GetShader)(int shaderNum);
|
||||
// =========== Swipes =============
|
||||
|
@ -360,6 +362,9 @@ functions exported to the main executable
|
|||
void (*UI_ShowMenu)(const char *name, qboolean bForce);
|
||||
void (*UI_HideMenu)(const char *name, qboolean bForce);
|
||||
int (*UI_FontStringWidth)(fontheader_t *font, const char *string, int maxLen);
|
||||
// Added in 2.0
|
||||
float (*UI_GetObjectivesTop)(void);
|
||||
void (*UI_GetHighResolutionScale)(vec2_t scale);
|
||||
|
||||
int (*Key_StringToKeynum)(const char *str);
|
||||
const char *(*Key_KeynumToBindString)(int keyNum);
|
||||
|
@ -430,6 +435,8 @@ functions exported to the main executable
|
|||
void (*CL_RestoreSavedCgameState)();
|
||||
void (*CL_ClearSavedCgameState)();
|
||||
|
||||
size_t (*getConfigStringIdNormalized)(size_t num);
|
||||
|
||||
cvar_t *fsDebug;
|
||||
hdelement_t *HudDrawElements;
|
||||
clientAnim_t *anim;
|
||||
|
@ -463,8 +470,8 @@ functions exported to the main executable
|
|||
int (*CG_GetParent)(int entNum);
|
||||
float (*CG_GetObjectiveAlpha)();
|
||||
int (*CG_PermanentMark)(
|
||||
const vec3_t origin,
|
||||
const vec3_t dir,
|
||||
vec3_t origin,
|
||||
vec3_t dir,
|
||||
float orientation,
|
||||
float sScale,
|
||||
float tScale,
|
||||
|
|
|
@ -58,19 +58,19 @@ void CG_PrepScoreBoardInfo()
|
|||
{
|
||||
switch (cgs.gametype) {
|
||||
case GT_TEAM_ROUNDS:
|
||||
strcpy(cg.scoresMenuName, "DM_Round_Scoreboard");
|
||||
Q_strncpyz(cg.scoresMenuName, "DM_Round_Scoreboard", sizeof(cg.scoresMenuName));
|
||||
break;
|
||||
case GT_OBJECTIVE:
|
||||
strcpy(cg.scoresMenuName, "Obj_Scoreboard");
|
||||
Q_strncpyz(cg.scoresMenuName, "Obj_Scoreboard", sizeof(cg.scoresMenuName));
|
||||
break;
|
||||
case GT_TOW:
|
||||
strcpy(cg.scoresMenuName, "Tow_Scoreboard");
|
||||
Q_strncpyz(cg.scoresMenuName, "Tow_Scoreboard", sizeof(cg.scoresMenuName));
|
||||
break;
|
||||
case GT_LIBERATION:
|
||||
strcpy(cg.scoresMenuName, "Lib_Scoreboard");
|
||||
Q_strncpyz(cg.scoresMenuName, "Lib_Scoreboard", sizeof(cg.scoresMenuName));
|
||||
break;
|
||||
default:
|
||||
strcpy(cg.scoresMenuName, "DM_Scoreboard");
|
||||
Q_strncpyz(cg.scoresMenuName, "DM_Scoreboard", sizeof(cg.scoresMenuName));
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
@ -296,14 +296,15 @@ void CG_ParseScores_ver_15()
|
|||
|
||||
switch (iClientTeam) {
|
||||
case 1:
|
||||
strcpy(szString3, cgi.LV_ConvertString("Spectators"));
|
||||
Q_strncpyz(szString3, cgi.LV_ConvertString("Spectators"), sizeof(szString3));
|
||||
break;
|
||||
case 2:
|
||||
strcpy(szString3, cgi.LV_ConvertString("Free-For-Allers"));
|
||||
Q_strncpyz(szString3, cgi.LV_ConvertString("Free-For-Allers"), sizeof(szString3));
|
||||
break;
|
||||
case 3:
|
||||
sprintf(
|
||||
Com_sprintf(
|
||||
szString3,
|
||||
sizeof(szString3),
|
||||
"%s - %d %s",
|
||||
cgi.LV_ConvertString("Allies"),
|
||||
atoi(cgi.Argv(2 + iCurrentEntry + iDatumCount * i)),
|
||||
|
@ -312,8 +313,9 @@ void CG_ParseScores_ver_15()
|
|||
iCurrentEntry++;
|
||||
break;
|
||||
case 4:
|
||||
sprintf(
|
||||
Com_sprintf(
|
||||
szString3,
|
||||
sizeof(szString3),
|
||||
"%s - %d %s",
|
||||
cgi.LV_ConvertString("Axis"),
|
||||
atoi(cgi.Argv(2 + iCurrentEntry + iDatumCount * i)),
|
||||
|
@ -322,7 +324,7 @@ void CG_ParseScores_ver_15()
|
|||
iCurrentEntry++;
|
||||
break;
|
||||
default:
|
||||
strcpy(szString3, cgi.LV_ConvertString("No Team"));
|
||||
Q_strncpyz(szString3, cgi.LV_ConvertString("No Team"), sizeof(szString3));
|
||||
break;
|
||||
}
|
||||
} else if (iClientNum == -2) {
|
||||
|
@ -330,14 +332,14 @@ void CG_ParseScores_ver_15()
|
|||
szString2[0] = 0;
|
||||
szString3[0] = 0;
|
||||
} else {
|
||||
strcpy(szString2, va("%i", iClientNum));
|
||||
strcpy(szString3, cg.clientinfo[iClientNum].name);
|
||||
Q_strncpyz(szString2, va("%i", iClientNum), sizeof(szString2));
|
||||
Q_strncpyz(szString3, cg.clientinfo[iClientNum].name, sizeof(szString3));
|
||||
}
|
||||
|
||||
strcpy(szString4, cgi.Argv(2 + iCurrentEntry + iDatumCount * i));
|
||||
strcpy(szString5, cgi.Argv(3 + iCurrentEntry + iDatumCount * i));
|
||||
strcpy(szString6, cgi.Argv(4 + iCurrentEntry + iDatumCount * i));
|
||||
strcpy(szString7, cgi.Argv(5 + iCurrentEntry + iDatumCount * i));
|
||||
Q_strncpyz(szString4, cgi.Argv(2 + iCurrentEntry + iDatumCount * i), sizeof(szString4));
|
||||
Q_strncpyz(szString5, cgi.Argv(3 + iCurrentEntry + iDatumCount * i), sizeof(szString5));
|
||||
Q_strncpyz(szString6, cgi.Argv(4 + iCurrentEntry + iDatumCount * i), sizeof(szString6));
|
||||
Q_strncpyz(szString7, cgi.Argv(5 + iCurrentEntry + iDatumCount * i), sizeof(szString7));
|
||||
|
||||
if (cgs.gametype >= GT_TEAM_ROUNDS && iClientNum == -1
|
||||
&& (iClientTeam == TEAM_ALLIES || iClientTeam == TEAM_AXIS)) {
|
||||
|
@ -370,19 +372,19 @@ void CG_ParseScores_ver_15()
|
|||
} else {
|
||||
iClientNum = atoi(cgi.Argv(iCurrentEntry + iDatumCount * i));
|
||||
if (iClientNum >= 0) {
|
||||
strcpy(szString2, va("%i", iClientNum));
|
||||
strcpy(szString3, cg.clientinfo[iClientNum].name);
|
||||
strcpy(szString4, cgi.Argv(1 + iCurrentEntry + iDatumCount * i));
|
||||
strcpy(szString5, cgi.Argv(2 + iCurrentEntry + iDatumCount * i));
|
||||
strcpy(szString6, cgi.Argv(3 + iCurrentEntry + iDatumCount * i));
|
||||
strcpy(szString7, cgi.Argv(4 + iCurrentEntry + iDatumCount * i));
|
||||
Q_strncpyz(szString2, va("%i", iClientNum), sizeof(szString2));
|
||||
Q_strncpyz(szString3, cg.clientinfo[iClientNum].name, sizeof(szString3));
|
||||
Q_strncpyz(szString4, cgi.Argv(1 + iCurrentEntry + iDatumCount * i), sizeof(szString4));
|
||||
Q_strncpyz(szString5, cgi.Argv(2 + iCurrentEntry + iDatumCount * i), sizeof(szString5));
|
||||
Q_strncpyz(szString6, cgi.Argv(3 + iCurrentEntry + iDatumCount * i), sizeof(szString6));
|
||||
Q_strncpyz(szString7, cgi.Argv(4 + iCurrentEntry + iDatumCount * i), sizeof(szString7));
|
||||
} else {
|
||||
szString2[0] = 0;
|
||||
if (iClientNum == -3) {
|
||||
strcpy(szString2, cgi.LV_ConvertString("Players"));
|
||||
Q_strncpyz(szString2, cgi.LV_ConvertString("Players"), sizeof(szString2));
|
||||
bIsHeader = qtrue;
|
||||
} else if (iClientNum == -2) {
|
||||
strcpy(szString2, cgi.LV_ConvertString("Spectators"));
|
||||
Q_strncpyz(szString2, cgi.LV_ConvertString("Spectators"), sizeof(szString2));
|
||||
bIsHeader = qtrue;
|
||||
} else {
|
||||
// unknown
|
||||
|
@ -535,32 +537,32 @@ void CG_ParseScores_ver_6()
|
|||
|
||||
switch (iClientTeam) {
|
||||
case 1:
|
||||
strcpy(szString2, cgi.LV_ConvertString("Spectators"));
|
||||
Q_strncpyz(szString2, cgi.LV_ConvertString("Spectators"), sizeof(szString2));
|
||||
break;
|
||||
case 2:
|
||||
strcpy(szString2, cgi.LV_ConvertString("Free-For-Allers"));
|
||||
Q_strncpyz(szString2, cgi.LV_ConvertString("Free-For-Allers"), sizeof(szString2));
|
||||
break;
|
||||
case 3:
|
||||
strcpy(szString2, cgi.LV_ConvertString("Allies"));
|
||||
Q_strncpyz(szString2, cgi.LV_ConvertString("Allies"), sizeof(szString2));
|
||||
break;
|
||||
case 4:
|
||||
strcpy(szString2, cgi.LV_ConvertString("Axis"));
|
||||
Q_strncpyz(szString2, cgi.LV_ConvertString("Axis"), sizeof(szString2));
|
||||
break;
|
||||
default:
|
||||
strcpy(szString2, cgi.LV_ConvertString("No Team"));
|
||||
Q_strncpyz(szString2, cgi.LV_ConvertString("No Team"), sizeof(szString2));
|
||||
break;
|
||||
}
|
||||
} else if (iClientNum == -2) {
|
||||
// spectating
|
||||
szString2[0] = 0;
|
||||
} else {
|
||||
strcpy(szString2, cg.clientinfo[iClientNum].name);
|
||||
Q_strncpyz(szString2, cg.clientinfo[iClientNum].name, sizeof(szString2));
|
||||
}
|
||||
|
||||
strcpy(szString3, cgi.Argv(2 + iCurrentEntry + iDatumCount * i));
|
||||
strcpy(szString4, cgi.Argv(3 + iCurrentEntry + iDatumCount * i));
|
||||
strcpy(szString5, cgi.Argv(4 + iCurrentEntry + iDatumCount * i));
|
||||
strcpy(szString6, cgi.Argv(5 + iCurrentEntry + iDatumCount * i));
|
||||
Q_strncpyz(szString3, cgi.Argv(2 + iCurrentEntry + iDatumCount * i), sizeof(szString3));
|
||||
Q_strncpyz(szString4, cgi.Argv(3 + iCurrentEntry + iDatumCount * i), sizeof(szString4));
|
||||
Q_strncpyz(szString5, cgi.Argv(4 + iCurrentEntry + iDatumCount * i), sizeof(szString5));
|
||||
Q_strncpyz(szString6, cgi.Argv(5 + iCurrentEntry + iDatumCount * i), sizeof(szString6));
|
||||
|
||||
if (iClientNum == cg.snap->ps.clientNum) {
|
||||
pItemTextColor = vThisClientTextColor;
|
||||
|
@ -587,17 +589,17 @@ void CG_ParseScores_ver_6()
|
|||
} else {
|
||||
iClientNum = atoi(cgi.Argv(iCurrentEntry + iDatumCount * i));
|
||||
if (iClientNum >= 0) {
|
||||
strcpy(szString2, cg.clientinfo[iClientNum].name);
|
||||
strcpy(szString3, cgi.Argv(1 + iCurrentEntry + iDatumCount * i));
|
||||
strcpy(szString4, cgi.Argv(2 + iCurrentEntry + iDatumCount * i));
|
||||
strcpy(szString5, cgi.Argv(3 + iCurrentEntry + iDatumCount * i));
|
||||
strcpy(szString6, cgi.Argv(4 + iCurrentEntry + iDatumCount * i));
|
||||
Q_strncpyz(szString2, cg.clientinfo[iClientNum].name, sizeof(szString2));
|
||||
Q_strncpyz(szString3, cgi.Argv(1 + iCurrentEntry + iDatumCount * i), sizeof(szString3));
|
||||
Q_strncpyz(szString4, cgi.Argv(2 + iCurrentEntry + iDatumCount * i), sizeof(szString4));
|
||||
Q_strncpyz(szString5, cgi.Argv(3 + iCurrentEntry + iDatumCount * i), sizeof(szString5));
|
||||
Q_strncpyz(szString6, cgi.Argv(4 + iCurrentEntry + iDatumCount * i), sizeof(szString6));
|
||||
} else {
|
||||
if (iClientNum == -3) {
|
||||
strcpy(szString2, cgi.LV_ConvertString("Players"));
|
||||
Q_strncpyz(szString2, cgi.LV_ConvertString("Players"), sizeof(szString2));
|
||||
bIsHeader = qtrue;
|
||||
} else if (iClientNum == -2) {
|
||||
strcpy(szString2, cgi.LV_ConvertString("Spectators"));
|
||||
Q_strncpyz(szString2, cgi.LV_ConvertString("Spectators"), sizeof(szString2));
|
||||
bIsHeader = qtrue;
|
||||
} else {
|
||||
// unknown
|
||||
|
|
|
@ -1,6 +1,7 @@
|
|||
/*
|
||||
===========================================================================
|
||||
Copyright (C) 2023 the OpenMoHAA team
|
||||
Copyright (C) 2008-2024 the OpenMoHAA team
|
||||
Copyright (C) 1999-2005 Id Software, Inc.
|
||||
|
||||
This file is part of OpenMoHAA source code.
|
||||
|
||||
|
@ -25,12 +26,27 @@ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
|||
|
||||
#include "cg_local.h"
|
||||
#include "../fgame/bg_voteoptions.h"
|
||||
#include "cg_servercmds_filter.h"
|
||||
|
||||
/*
|
||||
================
|
||||
IsWeaponAllowed
|
||||
|
||||
Returns true if the weapon is allowed
|
||||
================
|
||||
*/
|
||||
static const char *IsWeaponAllowed(int dmFlags, int flags)
|
||||
{
|
||||
return (dmFlags & flags) ? "0" : "1";
|
||||
}
|
||||
|
||||
/*
|
||||
================
|
||||
QueryLandminesAllowed2
|
||||
|
||||
Returns true if landmines is allowed by the map or by a dm flag
|
||||
================
|
||||
*/
|
||||
static qboolean QueryLandminesAllowed2(const char *mapname, int dmflags)
|
||||
{
|
||||
if (dmflags & DF_WEAPON_NO_LANDMINE) {
|
||||
|
@ -134,6 +150,7 @@ void CG_ParseServerinfo(void)
|
|||
cgi.Cvar_Set("cg_fraglimit", Info_ValueForKey(info, "fraglimit"));
|
||||
cgi.Cvar_Set("cg_timelimit", Info_ValueForKey(info, "timelimit"));
|
||||
cgi.Cvar_Set("cg_maxclients", Info_ValueForKey(info, "sv_gametype"));
|
||||
cgi.Cvar_Set("cg_allowvote", Info_ValueForKey(info, "g_allowvote"));
|
||||
cgi.Cvar_Set("cg_obj_alliedtext1", Info_ValueForKey(info, "g_obj_alliedtext1"));
|
||||
cgi.Cvar_Set("cg_obj_alliedtext2", Info_ValueForKey(info, "g_obj_alliedtext2"));
|
||||
cgi.Cvar_Set("cg_obj_alliedtext3", Info_ValueForKey(info, "g_obj_alliedtext3"));
|
||||
|
@ -169,10 +186,14 @@ void CG_ParseServerinfo(void)
|
|||
if (spawnpos) {
|
||||
Q_strncpyz(map, mapname, spawnpos - mapname + 1);
|
||||
} else {
|
||||
strcpy(map, mapname);
|
||||
Q_strncpyz(map, mapname, sizeof(map));
|
||||
}
|
||||
|
||||
if (CG_UseLargeLightmaps(mapname)) {
|
||||
Com_sprintf(cgs.mapname, sizeof(cgs.mapname), "maps/%s.bsp", map);
|
||||
} else {
|
||||
Com_sprintf(cgs.mapname, sizeof(cgs.mapname), "maps/%s_sml.bsp", map);
|
||||
}
|
||||
|
||||
// hide/show huds
|
||||
if (cgs.gametype) {
|
||||
|
@ -296,7 +317,7 @@ static void CG_ServerCommand(qboolean modelOnly)
|
|||
}
|
||||
|
||||
if (!strcmp(cmd, "cs")) {
|
||||
CG_ConfigStringModified(atoi(cgi.Argv(1)), modelOnly);
|
||||
CG_ConfigStringModified(cgi.getConfigStringIdNormalized(atoi(cgi.Argv(1))), modelOnly);
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -311,7 +332,7 @@ static void CG_ServerCommand(qboolean modelOnly)
|
|||
}
|
||||
return;
|
||||
} else if (!strcmp(cmd, "printdeathmsg")) {
|
||||
const char *s1, *s2, * attackerName, * victimName, *type;
|
||||
const char *s1, *s2, *attackerName, *victimName, *type;
|
||||
const char *result1, *result2;
|
||||
int hudColor;
|
||||
|
||||
|
@ -352,7 +373,14 @@ static void CG_ServerCommand(qboolean modelOnly)
|
|||
}
|
||||
|
||||
if (!strcmp(cmd, "stufftext")) {
|
||||
cgi.Cmd_Stuff(cgi.Argv(1));
|
||||
char *cmd = cgi.Argv(1);
|
||||
if (CG_IsStatementFiltered(cmd)) {
|
||||
// Added in OPM
|
||||
// Don't execute filtered commands
|
||||
return;
|
||||
}
|
||||
|
||||
cgi.Cmd_Stuff(cmd);
|
||||
cgi.Cmd_Stuff("\n");
|
||||
return;
|
||||
}
|
||||
|
|
292
code/cgame/cg_servercmds_filter.c
Normal file
292
code/cgame/cg_servercmds_filter.c
Normal file
|
@ -0,0 +1,292 @@
|
|||
/*
|
||||
===========================================================================
|
||||
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_IsVariableFiltered
|
||||
|
||||
Returns whether or not the variable should be filtered
|
||||
====================
|
||||
*/
|
||||
static qboolean CG_IsVariableFiltered(const char *name)
|
||||
{
|
||||
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
|
||||
====================
|
||||
*/
|
||||
qboolean CG_IsStatementFiltered(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_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;
|
||||
}
|
||||
|
30
code/cgame/cg_servercmds_filter.h
Normal file
30
code/cgame/cg_servercmds_filter.h
Normal file
|
@ -0,0 +1,30 @@
|
|||
/*
|
||||
===========================================================================
|
||||
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"
|
||||
|
||||
qboolean CG_IsStatementFiltered(char *cmd);
|
|
@ -73,10 +73,10 @@ static void CG_ResetEntity(centity_t *cent)
|
|||
CG_RemoveClientEntity(cent->currentState.number, tiki, cent);
|
||||
|
||||
// reset the animation for the entities
|
||||
if (tiki && tiki->a->bIsCharacter) {
|
||||
if (tiki) {
|
||||
for (i = 0; i < MAX_FRAMEINFOS; i++) {
|
||||
cent->animLast[i] = cent->currentState.frameInfo[i].index;
|
||||
cent->animLastTimes[i] = cent->currentState.frameInfo[i].time;
|
||||
cent->animLast[i] = -1;
|
||||
cent->animLastTimes[i] = -1;
|
||||
if (cent->currentState.frameInfo[i].weight) {
|
||||
cent->animLastWeight |= 1 << i;
|
||||
} else {
|
||||
|
@ -88,6 +88,7 @@ static void CG_ResetEntity(centity_t *cent)
|
|||
// clear all the last animations
|
||||
for (i = 0; i < MAX_FRAMEINFOS; i++) {
|
||||
cent->animLast[i] = -1;
|
||||
cent->animLastTimes[i] = 0.0;
|
||||
}
|
||||
|
||||
cent->animLastWeight = 0;
|
||||
|
@ -346,8 +347,10 @@ static snapshot_t *CG_ReadNextSnapshot(void)
|
|||
snapshot_t *dest;
|
||||
|
||||
if (cg.latestSnapshotNum > cgs.processedSnapshotNum + 1000) {
|
||||
cgi.Error(
|
||||
ERR_DROP, "CG_ReadNextSnapshot: way out of range, %i > %i", cg.latestSnapshotNum, cgs.processedSnapshotNum
|
||||
cgi.Printf(
|
||||
"WARNING: CG_ReadNextSnapshot: way out of range, %i > %i\n",
|
||||
cg.latestSnapshotNum,
|
||||
cgs.processedSnapshotNum
|
||||
);
|
||||
}
|
||||
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
/*
|
||||
===========================================================================
|
||||
Copyright (C) 2023 the OpenMoHAA team
|
||||
Copyright (C) 2024 the OpenMoHAA team
|
||||
|
||||
This file is part of OpenMoHAA source code.
|
||||
|
||||
|
@ -38,7 +38,8 @@ static vec3_t g_vLadderstepMaxs;
|
|||
|
||||
ClientSpecialEffectsManager sfxManager;
|
||||
|
||||
Event EV_SFX_EffectDelay(
|
||||
Event EV_SFX_EffectDelay
|
||||
(
|
||||
"effectdelay",
|
||||
EV_DEFAULT,
|
||||
"iivvvvv",
|
||||
|
@ -94,7 +95,7 @@ void ClientSpecialEffectsManager::LoadEffects()
|
|||
cgi.DPrintf("Loading Special Effects...\n");
|
||||
AxisClear(axis);
|
||||
|
||||
for (i = 0; i < MAX_SPECIAL_EFFECTS; i++) {
|
||||
for (i = 0; i < SFX_COUNT; i++) {
|
||||
switch (i) {
|
||||
case SFX_BHIT_PAPER_LITE:
|
||||
szEffectModel = "models/fx/bh_paper_lite.tik";
|
||||
|
@ -234,9 +235,15 @@ void ClientSpecialEffectsManager::LoadEffects()
|
|||
szEffectModel = "models/fx/bazookaexp_base.tik";
|
||||
break;
|
||||
case SFX_EXP_HEAVYSHELL_BASE:
|
||||
if (cg_protocol < protocol_e::PROTOCOL_MOHTA_MIN) {
|
||||
continue;
|
||||
}
|
||||
szEffectModel = "models/fx/heavyshellexp_base.tik";
|
||||
break;
|
||||
case SFX_EXP_TANK_BASE:
|
||||
if (cg_protocol < protocol_e::PROTOCOL_MOHTA_MIN) {
|
||||
continue;
|
||||
}
|
||||
szEffectModel = "models/fx/tankexp_base.tik";
|
||||
break;
|
||||
case SFX_EXP_GREN_PAPER:
|
||||
|
@ -285,30 +292,57 @@ void ClientSpecialEffectsManager::LoadEffects()
|
|||
szEffectModel = "models/fx/grenexp_carpet.tik";
|
||||
break;
|
||||
case SFX_EXP_HEAVYSHELL_DIRT:
|
||||
if (cg_protocol < protocol_e::PROTOCOL_MOHTA_MIN) {
|
||||
continue;
|
||||
}
|
||||
szEffectModel = "models/fx/heavyshellexp_dirt.tik";
|
||||
break;
|
||||
case SFX_EXP_HEAVYSHELL_STONE:
|
||||
if (cg_protocol < protocol_e::PROTOCOL_MOHTA_MIN) {
|
||||
continue;
|
||||
}
|
||||
szEffectModel = "models/fx/heavyshellexp_stone.tik";
|
||||
break;
|
||||
case SFX_EXP_HEAVYSHELL_SNOW:
|
||||
if (cg_protocol < protocol_e::PROTOCOL_MOHTA_MIN) {
|
||||
continue;
|
||||
}
|
||||
szEffectModel = "models/fx/heavyshellexp_snow.tik";
|
||||
break;
|
||||
case SFX_EXP_TANK_DIRT:
|
||||
if (cg_protocol < protocol_e::PROTOCOL_MOHTA_MIN) {
|
||||
continue;
|
||||
}
|
||||
szEffectModel = "models/fx/tankexp_dirt.tik";
|
||||
break;
|
||||
case SFX_EXP_TANK_STONE:
|
||||
if (cg_protocol < protocol_e::PROTOCOL_MOHTA_MIN) {
|
||||
continue;
|
||||
}
|
||||
szEffectModel = "models/fx/tankexp_stone.tik";
|
||||
break;
|
||||
case SFX_EXP_TANK_SNOW:
|
||||
if (cg_protocol < protocol_e::PROTOCOL_MOHTA_MIN) {
|
||||
continue;
|
||||
}
|
||||
szEffectModel = "models/fx/tankexp_snow.tik";
|
||||
break;
|
||||
case SFX_EXP_BAZOOKA_DIRT:
|
||||
if (cg_protocol < protocol_e::PROTOCOL_MOHTA_MIN) {
|
||||
continue;
|
||||
}
|
||||
szEffectModel = "models/fx/bazookaexp_dirt.tik";
|
||||
break;
|
||||
case SFX_EXP_BAZOOKA_STONE:
|
||||
if (cg_protocol < protocol_e::PROTOCOL_MOHTA_MIN) {
|
||||
continue;
|
||||
}
|
||||
szEffectModel = "models/fx/bazookaexp_stone.tik";
|
||||
break;
|
||||
case SFX_EXP_BAZOOKA_SNOW:
|
||||
if (cg_protocol < protocol_e::PROTOCOL_MOHTA_MIN) {
|
||||
continue;
|
||||
}
|
||||
szEffectModel = "models/fx/bazookaexp_snow.tik";
|
||||
break;
|
||||
case SFX_WATER_RIPPLE_STILL:
|
||||
|
@ -478,7 +512,7 @@ void ClientSpecialEffectsManager::ExecuteEffect(
|
|||
current_tiki = NULL;
|
||||
|
||||
pCommand->emitter->cgd.origin = vPos;
|
||||
if (pCommand->emitter->cgd.flags & T_ANGLES) {
|
||||
if (!(pCommand->emitter->cgd.flags & T_ANGLES)) {
|
||||
pCommand->emitter->cgd.angles = vAngles;
|
||||
}
|
||||
|
||||
|
@ -904,7 +938,144 @@ void CG_LandingSound(centity_t *ent, refEntity_t *pREnt, float volume, int iEqui
|
|||
|
||||
void CG_BodyFallSound(centity_t *ent, refEntity_t *pREnt, float volume)
|
||||
{
|
||||
// FIXME: unimplemented
|
||||
int contents;
|
||||
int surftype;
|
||||
int iEffectNum = -1;
|
||||
vec3_t vStart, vEnd;
|
||||
vec3_t midlegs;
|
||||
str sSoundName;
|
||||
trace_t trace;
|
||||
|
||||
VectorCopy(ent->lerpOrigin, vStart);
|
||||
vStart[2] += 8;
|
||||
|
||||
VectorCopy(vStart, vEnd);
|
||||
vEnd[2] -= 64;
|
||||
|
||||
if (ent->currentState.eType == ET_PLAYER) {
|
||||
CG_Trace(
|
||||
&trace,
|
||||
vStart,
|
||||
g_vFootstepMins,
|
||||
g_vFootstepMaxs,
|
||||
vEnd,
|
||||
ent->currentState.number,
|
||||
MASK_PLAYERSOLID,
|
||||
qtrue,
|
||||
qtrue,
|
||||
"Player Landing"
|
||||
);
|
||||
} else {
|
||||
CG_Trace(
|
||||
&trace,
|
||||
vStart,
|
||||
g_vFootstepMins,
|
||||
g_vFootstepMaxs,
|
||||
vEnd,
|
||||
ent->currentState.number,
|
||||
MASK_MONSTERSOLID,
|
||||
qfalse,
|
||||
qfalse,
|
||||
"Monster Landing"
|
||||
);
|
||||
}
|
||||
|
||||
if (trace.fraction == 1) {
|
||||
return;
|
||||
}
|
||||
|
||||
sSoundName = "snd_bodyfall_";
|
||||
contents = CG_PointContents(trace.endpos, -1);
|
||||
if (contents & MASK_WATER) {
|
||||
// take our ground position and trace upwards
|
||||
VectorCopy(trace.endpos, midlegs);
|
||||
midlegs[2] += WATER_NO_SPLASH_HEIGHT;
|
||||
contents = CG_PointContents(midlegs, -1);
|
||||
if (contents & MASK_WATER) {
|
||||
sSoundName += "wade";
|
||||
} else {
|
||||
sSoundName += "puddle";
|
||||
iEffectNum = SFX_FOOT_PUDDLE;
|
||||
}
|
||||
} else {
|
||||
surftype = trace.surfaceFlags & MASK_SURF_TYPE;
|
||||
switch (surftype) {
|
||||
case SURF_FOLIAGE:
|
||||
sSoundName += "foliage";
|
||||
iEffectNum = SFX_FOOT_GRASS;
|
||||
break;
|
||||
case SURF_SNOW:
|
||||
sSoundName += "snow";
|
||||
iEffectNum = SFX_FOOT_SNOW;
|
||||
break;
|
||||
case SURF_CARPET:
|
||||
sSoundName += "carpet";
|
||||
iEffectNum = SFX_FOOT_LIGHT_DUST;
|
||||
break;
|
||||
case SURF_SAND:
|
||||
sSoundName += "sand";
|
||||
iEffectNum = SFX_FOOT_SAND;
|
||||
break;
|
||||
case SURF_PUDDLE:
|
||||
sSoundName += "puddle";
|
||||
iEffectNum = SFX_FOOT_PUDDLE;
|
||||
break;
|
||||
case SURF_GLASS:
|
||||
sSoundName += "glass";
|
||||
iEffectNum = SFX_FOOT_LIGHT_DUST;
|
||||
break;
|
||||
case SURF_GRAVEL:
|
||||
sSoundName += "gravel";
|
||||
iEffectNum = SFX_FOOT_HEAVY_DUST;
|
||||
break;
|
||||
case SURF_MUD:
|
||||
sSoundName += "mud";
|
||||
iEffectNum = SFX_FOOT_MUD;
|
||||
break;
|
||||
case SURF_DIRT:
|
||||
sSoundName += "dirt";
|
||||
iEffectNum = SFX_FOOT_DIRT;
|
||||
break;
|
||||
case SURF_GRILL:
|
||||
sSoundName += "grill";
|
||||
iEffectNum = SFX_FOOT_LIGHT_DUST;
|
||||
break;
|
||||
case SURF_GRASS:
|
||||
sSoundName += "grass";
|
||||
iEffectNum = SFX_FOOT_GRASS;
|
||||
break;
|
||||
case SURF_ROCK:
|
||||
sSoundName += "stone";
|
||||
iEffectNum = SFX_FOOT_HEAVY_DUST;
|
||||
break;
|
||||
case SURF_PAPER:
|
||||
sSoundName += "paper";
|
||||
iEffectNum = SFX_FOOT_LIGHT_DUST;
|
||||
break;
|
||||
case SURF_WOOD:
|
||||
sSoundName += "wood";
|
||||
iEffectNum = SFX_FOOT_LIGHT_DUST;
|
||||
break;
|
||||
case SURF_METAL:
|
||||
sSoundName += "metal";
|
||||
iEffectNum = SFX_FOOT_LIGHT_DUST;
|
||||
break;
|
||||
default:
|
||||
sSoundName += "stone";
|
||||
iEffectNum = SFX_FOOT_HEAVY_DUST;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if (cg_debugFootsteps->integer) {
|
||||
cgi.DPrintf("BodyFall: %s volume: %.2f effect = %i\n", sSoundName.c_str(), volume, iEffectNum);
|
||||
}
|
||||
|
||||
commandManager.PlaySound(sSoundName, trace.endpos, -1, volume, -1, -1, 1);
|
||||
|
||||
if (iEffectNum != -1) {
|
||||
sfxManager.MakeEffect_Angles(iEffectNum, trace.endpos, Vector(270, 0, 0));
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
|
@ -1023,5 +1194,5 @@ qboolean ClientSpecialEffectsManager::EffectsPending()
|
|||
|
||||
specialeffect_t *ClientSpecialEffectsManager::GetTestEffectPointer()
|
||||
{
|
||||
return &m_effects[SPECIAL_EFFECT_TEST];
|
||||
return &m_effects[SFX_TEST_EFFECT];
|
||||
}
|
||||
|
|
|
@ -170,12 +170,9 @@ public:
|
|||
specialeffectcommand_t *AddNewCommand();
|
||||
};
|
||||
|
||||
#define MAX_SPECIAL_EFFECTS 99
|
||||
#define SPECIAL_EFFECT_TEST MAX_SPECIAL_EFFECTS - 1
|
||||
|
||||
class ClientSpecialEffectsManager : public Listener
|
||||
{
|
||||
specialeffect_t m_effects[99];
|
||||
specialeffect_t m_effects[SFX_COUNT];
|
||||
qboolean m_bEffectsLoaded;
|
||||
int m_iNumPendingEvents;
|
||||
|
||||
|
|
|
@ -79,6 +79,11 @@ void ClientGameCommandManager::FreeTempModel(ctempmodel_t *p)
|
|||
|
||||
RemoveClientEntity(p->number, p->cgd.tiki, NULL, p);
|
||||
|
||||
if (m_active_tempmodels.next == p) {
|
||||
// use the next active temp model
|
||||
m_active_tempmodels.next = p->next;
|
||||
}
|
||||
|
||||
// remove from the doubly linked active list
|
||||
p->prev->next = p->next;
|
||||
p->next->prev = p->prev;
|
||||
|
@ -86,6 +91,22 @@ void ClientGameCommandManager::FreeTempModel(ctempmodel_t *p)
|
|||
// the free list is only singly linked
|
||||
p->next = m_free_tempmodels;
|
||||
m_free_tempmodels = p;
|
||||
|
||||
if (p->m_spawnthing) {
|
||||
p->m_spawnthing->numtempmodels--;
|
||||
// delete unused spawnthings
|
||||
if (!p->m_spawnthing->numtempmodels) {
|
||||
m_emitters.RemoveObject(p->m_spawnthing);
|
||||
|
||||
if (p->m_spawnthing == m_spawnthing) {
|
||||
m_spawnthing = NULL;
|
||||
}
|
||||
|
||||
delete p->m_spawnthing;
|
||||
}
|
||||
|
||||
p->m_spawnthing = NULL;
|
||||
}
|
||||
}
|
||||
|
||||
//===============
|
||||
|
@ -110,7 +131,7 @@ void ClientGameCommandManager::FreeAllTempModels(void)
|
|||
//===============
|
||||
void ClientGameCommandManager::FreeSomeTempModels(void)
|
||||
{
|
||||
ctempmodel_t* model;
|
||||
ctempmodel_t *model;
|
||||
int count = 0;
|
||||
unsigned int i;
|
||||
unsigned int numToFree;
|
||||
|
@ -138,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) {
|
||||
|
@ -209,9 +230,14 @@ 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);
|
||||
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) {
|
||||
|
@ -418,9 +444,11 @@ qboolean ClientGameCommandManager::TempModelRealtimeEffects(ctempmodel_t *p, flo
|
|||
|
||||
p->ent.shaderRGBA[0] = (int)((float)tempColor[0] * vLighting[0]);
|
||||
p->ent.shaderRGBA[1] = (int)((float)tempColor[1] * vLighting[1]);
|
||||
p->ent.shaderRGBA[2] = (int)((float)tempColor[2] * vLighting[2]);
|
||||
} else {
|
||||
p->ent.shaderRGBA[0] = tempColor[0];
|
||||
p->ent.shaderRGBA[1] = tempColor[1];
|
||||
p->ent.shaderRGBA[2] = tempColor[2];
|
||||
}
|
||||
|
||||
if (p->cgd.flags & T_FADEIN && (fadein < 1)) // Do the fadein effect
|
||||
|
@ -518,6 +546,7 @@ qboolean ClientGameCommandManager::TempModelPhysics(ctempmodel_t *p, float ftime
|
|||
Vector tempangles;
|
||||
trace_t trace;
|
||||
float dot;
|
||||
int i;
|
||||
|
||||
VectorCopy(p->ent.origin, p->lastEnt.origin);
|
||||
AxisCopy(p->ent.axis, p->lastEnt.axis);
|
||||
|
@ -538,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) {
|
||||
|
@ -553,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;
|
||||
}
|
||||
|
||||
|
@ -633,9 +661,7 @@ qboolean ClientGameCommandManager::TempModelPhysics(ctempmodel_t *p, float ftime
|
|||
p->cgd.velocity.x = Q_clamp_float(p->cgd.velocity.x, p->cgd.minVel.x, p->cgd.maxVel.x);
|
||||
p->cgd.velocity.y = Q_clamp_float(p->cgd.velocity.y, p->cgd.minVel.y, p->cgd.maxVel.y);
|
||||
p->cgd.velocity.z = Q_clamp_float(p->cgd.velocity.z, p->cgd.minVel.z, p->cgd.maxVel.z);
|
||||
}
|
||||
|
||||
if (p->cgd.flags2 & T2_CLAMP_VEL_AXIS) {
|
||||
} else if (p->cgd.flags2 & T2_CLAMP_VEL_AXIS) {
|
||||
Vector localVelocity;
|
||||
localVelocity.x = DotProduct(p->cgd.velocity, p->ent.axis[0]);
|
||||
localVelocity.y = DotProduct(p->cgd.velocity, p->ent.axis[1]);
|
||||
|
@ -650,8 +676,48 @@ qboolean ClientGameCommandManager::TempModelPhysics(ctempmodel_t *p, float ftime
|
|||
p->cgd.velocity.z = DotProduct(localVelocity, p->ent.axis[2]);
|
||||
}
|
||||
|
||||
if (p->cgd.flags2 & T_ALIGN) {
|
||||
// FIXME: vss wind
|
||||
if (p->cgd.flags2 & T2_WIND_AFFECT) {
|
||||
for (i = 0; i < 3; i++) {
|
||||
float fWind;
|
||||
|
||||
switch (i) {
|
||||
case 0:
|
||||
fWind = vss_wind_x->value;
|
||||
break;
|
||||
case 1:
|
||||
fWind = vss_wind_y->value;
|
||||
break;
|
||||
case 2:
|
||||
fWind = vss_wind_z->value;
|
||||
break;
|
||||
}
|
||||
|
||||
if (fWind < 0) {
|
||||
if (p->cgd.velocity[i] > fWind) {
|
||||
p->cgd.velocity[i] -= ftime * vss_wind_strength->value;
|
||||
if (p->cgd.velocity[i] > fWind) {
|
||||
p->cgd.velocity[i] = fWind;
|
||||
}
|
||||
} else if (p->cgd.velocity[i] < fWind) {
|
||||
p->cgd.velocity[i] += ftime * vss_movement_dampen->value;
|
||||
if (p->cgd.velocity[i] < fWind) {
|
||||
p->cgd.velocity[i] = fWind;
|
||||
}
|
||||
}
|
||||
} else {
|
||||
if (p->cgd.velocity[i] < fWind) {
|
||||
p->cgd.velocity[i] += ftime * vss_wind_strength->value;
|
||||
if (p->cgd.velocity[i] > fWind) {
|
||||
p->cgd.velocity[i] = fWind;
|
||||
}
|
||||
} else if (p->cgd.velocity[i] > fWind) {
|
||||
p->cgd.velocity[i] -= ftime * vss_wind_strength->value;
|
||||
if (p->cgd.velocity[i] < fWind) {
|
||||
p->cgd.velocity[i] = fWind;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
} else {
|
||||
Vector normal;
|
||||
|
@ -829,7 +895,8 @@ 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;
|
||||
|
@ -913,7 +980,12 @@ void ClientGameCommandManager::AddTempModels(void)
|
|||
// time of this tempmodel
|
||||
lerpfrac = (float)(cg.time - p->lastPhysicsTime) / (float)physics_rate;
|
||||
// Clamp
|
||||
lerpfrac = Q_clamp_float(lerpfrac, 0, 1);
|
||||
if (lerpfrac > 1 || (p->cgd.flags2 & T2_PHYSICS_EVERYFRAME)) {
|
||||
lerpfrac = 1;
|
||||
}
|
||||
if (lerpfrac < 0) {
|
||||
lerpfrac = 0;
|
||||
}
|
||||
|
||||
// Increment the time this tempmodel has been alive
|
||||
p->aliveTime += frameTime;
|
||||
|
@ -1137,7 +1209,13 @@ void ClientGameCommandManager::SpawnTempModel(int mcount)
|
|||
{
|
||||
Vector dst;
|
||||
// Create a circular shaped burst around the up vector
|
||||
float angle = ((float)count / (float)m_spawnthing->count) * 360; // * M_PI * 2;
|
||||
float angle;
|
||||
|
||||
if (mcount == 1) {
|
||||
angle = random() * 360;
|
||||
} else {
|
||||
angle = ((float)count / (float)m_spawnthing->count) * 360; // * M_PI * 2;
|
||||
}
|
||||
|
||||
Vector end = Vector(vLeft) * m_spawnthing->sphereRadius * current_entity_scale;
|
||||
RotatePointAroundVector(dst, Vector(vForward), end, angle);
|
||||
|
@ -1146,7 +1224,7 @@ void ClientGameCommandManager::SpawnTempModel(int mcount)
|
|||
newForward = p->cgd.origin - m_spawnthing->cgd.origin;
|
||||
newForward.normalize();
|
||||
}
|
||||
} else if (m_spawnthing->cgd.flags & T_SPHERE) {
|
||||
} else if (m_spawnthing->cgd.flags & T_INWARDSPHERE) {
|
||||
// Project the origin along a random ray, and set the forward
|
||||
// vector pointing back to the origin
|
||||
Vector dir, end;
|
||||
|
@ -1182,10 +1260,9 @@ void ClientGameCommandManager::SpawnTempModel(int mcount)
|
|||
cosa = cos(fAngle);
|
||||
|
||||
p->cgd.origin = start + vForward * fHeight;
|
||||
p->cgd.origin += start + vLeft * (cosa * fRadius);
|
||||
p->cgd.origin += start + vUp * (sina * fRadius);
|
||||
} else if (m_spawnthing->sphereRadius != 0) // Offset in a spherical pattern
|
||||
{
|
||||
p->cgd.origin += vLeft * (cosa * fRadius);
|
||||
p->cgd.origin += vUp * (sina * fRadius);
|
||||
} else if (m_spawnthing->sphereRadius != 0) { // Offset in a spherical pattern
|
||||
Vector dir, end;
|
||||
|
||||
dir = Vector(crandom(), crandom(), crandom());
|
||||
|
@ -1391,7 +1468,7 @@ void ClientGameCommandManager::SpawnTempModel(int mcount)
|
|||
p->cgd.avelocity[i] = m_spawnthing->avelocity_amplitude[i] * random() + m_spawnthing->avelocity_base[i];
|
||||
|
||||
// Randomize angles or set absolute
|
||||
p->cgd.angles[i] += random() * m_spawnthing->angles_amplitude[i];
|
||||
p->cgd.angles[i] = m_spawnthing->angles_amplitude[i] * random() + m_spawnthing->cgd.angles[i];
|
||||
}
|
||||
|
||||
// If forward velocity is set, just use that otherwise use random
|
||||
|
@ -1425,18 +1502,15 @@ void ClientGameCommandManager::SpawnTempModel(int mcount)
|
|||
}
|
||||
}
|
||||
|
||||
// Calculate one tick of velocity based on time alive ( passed in )
|
||||
p->cgd.origin = p->cgd.origin + (p->cgd.velocity * ((float)p->aliveTime / 1000.0f) * current_entity_scale);
|
||||
|
||||
if (p->cgd.flags2 & T2_ACCEL) {
|
||||
if (m_spawnthing->cgd.flags2 & T2_RADIALVELOCITY) {
|
||||
float fLength;
|
||||
|
||||
p->cgd.velocity = p->cgd.origin - start;
|
||||
|
||||
fLength = p->cgd.velocity.length();
|
||||
if (fLength) {
|
||||
float fVel = m_spawnthing->cgd.velocity.x
|
||||
+ (m_spawnthing->cgd.velocity.y + m_spawnthing->cgd.velocity.z * crandom()) / fLength;
|
||||
float fVel = m_spawnthing->cgd.velocity[0]
|
||||
+ (m_spawnthing->cgd.velocity[1] + m_spawnthing->cgd.velocity[2] * random()) / fLength;
|
||||
|
||||
p->cgd.velocity *= fVel;
|
||||
}
|
||||
|
@ -1447,19 +1521,21 @@ void ClientGameCommandManager::SpawnTempModel(int mcount)
|
|||
(m_spawnthing->randvel_base[i] + m_spawnthing->randvel_amplitude[i] * random()) * current_entity_scale;
|
||||
|
||||
if (m_spawnthing->cgd.flags & T_RANDVELAXIS) {
|
||||
if (p->cgd.flags2 & T2_NOTAGAXIS) {
|
||||
p->cgd.velocity += fVel * Vector(m_spawnthing->axis[i]);
|
||||
} else {
|
||||
p->cgd.velocity += fVel * Vector(m_spawnthing->tag_axis[i]);
|
||||
}
|
||||
} else {
|
||||
p->cgd.velocity[i] += fVel;
|
||||
}
|
||||
}
|
||||
|
||||
if (p->cgd.flags & (T_ALIGN | T_DETAIL)) {
|
||||
if (p->cgd.velocity.x && p->cgd.velocity.y) {
|
||||
p->cgd.angles = p->cgd.velocity.toAngles();
|
||||
}
|
||||
|
||||
p->cgd.origin += p->cgd.velocity * (p->aliveTime / 1000.0) * current_entity_scale;
|
||||
}
|
||||
|
||||
if (p->cgd.flags & T_AUTOCALCLIFE) {
|
||||
Vector end, delta;
|
||||
|
|
File diff suppressed because it is too large
Load diff
|
@ -25,6 +25,7 @@ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
|||
|
||||
#include "cg_local.h"
|
||||
#include "str.h"
|
||||
#include "../client/keycodes.h"
|
||||
|
||||
void CG_MessageMode_f(void)
|
||||
{
|
||||
|
@ -61,8 +62,8 @@ void CG_MessageMode_Private_f(void)
|
|||
return;
|
||||
}
|
||||
|
||||
clientNum = atoi(cgi.Argv(1)) - 1;
|
||||
if (clientNum < 0 || clientNum >= MAX_CLIENTS) {
|
||||
clientNum = atoi(cgi.Argv(1));
|
||||
if (clientNum < 1 || clientNum >= MAX_CLIENTS) {
|
||||
cgi.Printf(HUD_MESSAGE_CHAT_WHITE "Message Error: %s is a bad client number\n", cgi.Argv(1));
|
||||
return;
|
||||
}
|
||||
|
@ -119,7 +120,7 @@ void CG_MessageSingleClient_f(void)
|
|||
|
||||
// copy the rest
|
||||
for (i = 2; i < cgi.Argc(); i++) {
|
||||
sString += va("%s", cgi.Argv(i));
|
||||
sString += va(" %s", cgi.Argv(i));
|
||||
}
|
||||
|
||||
sString += "\n";
|
||||
|
@ -192,8 +193,36 @@ void CG_HudPrint_f(void)
|
|||
cgi.Printf("\x1%s", cgi.Argv(1));
|
||||
}
|
||||
|
||||
int CG_CheckCaptureKey(int key, qboolean down, unsigned int time)
|
||||
qboolean CG_CheckCaptureKey(int key, qboolean down, unsigned int time)
|
||||
{
|
||||
// FIXME: unimplemented
|
||||
return 0;
|
||||
char minKey = '1', maxKey = '9';
|
||||
|
||||
if (!cg.iInstaMessageMenu || !down) {
|
||||
return qfalse;
|
||||
}
|
||||
|
||||
if (cg_protocol >= protocol_e::PROTOCOL_MOHTA_MIN) {
|
||||
maxKey = '8';
|
||||
}
|
||||
|
||||
if (key < minKey || key > maxKey) {
|
||||
if (key == K_ESCAPE || key == '0') {
|
||||
cg.iInstaMessageMenu = 0;
|
||||
return qtrue;
|
||||
}
|
||||
return qfalse;
|
||||
}
|
||||
|
||||
if (cg.iInstaMessageMenu == -1) {
|
||||
if (key > '6') {
|
||||
cg.iInstaMessageMenu = 0;
|
||||
} else {
|
||||
cg.iInstaMessageMenu = key - '0';
|
||||
}
|
||||
} else if (cg.iInstaMessageMenu > 0) {
|
||||
cgi.SendClientCommand(va("dmmessage 0 *%i%i\n", cg.iInstaMessageMenu, key - '0'));
|
||||
cg.iInstaMessageMenu = 0;
|
||||
}
|
||||
|
||||
return qtrue;
|
||||
}
|
||||
|
|
|
@ -242,6 +242,7 @@ void CG_OffsetFirstPersonView(refEntity_t *pREnt, qboolean bUseWorldPosition)
|
|||
float mat[3][3];
|
||||
vec3_t vOldOrigin;
|
||||
vec3_t vStart, vEnd, vMins, vMaxs;
|
||||
vec3_t vVelocity;
|
||||
trace_t trace;
|
||||
|
||||
VectorSet(vMins, -6, -6, -6);
|
||||
|
@ -297,6 +298,15 @@ void CG_OffsetFirstPersonView(refEntity_t *pREnt, qboolean bUseWorldPosition)
|
|||
|
||||
VectorCopy(origin, vOldOrigin);
|
||||
|
||||
if (!cg.predicted_player_state.walking || (!(cg.predicted_player_state.pm_flags & PMF_FROZEN) && !(cg.predicted_player_state.pm_flags & PMF_NO_MOVE))) {
|
||||
VectorCopy(cg.predicted_player_state.velocity, vVelocity);
|
||||
} else {
|
||||
//
|
||||
// Added in OPM
|
||||
// When frozen, there must be no movement at all
|
||||
VectorClear(vVelocity);
|
||||
}
|
||||
|
||||
if (bUseWorldPosition) {
|
||||
iMask = MASK_VIEWSOLID;
|
||||
} else {
|
||||
|
@ -367,7 +377,7 @@ void CG_OffsetFirstPersonView(refEntity_t *pREnt, qboolean bUseWorldPosition)
|
|||
}
|
||||
|
||||
if (cg.predicted_player_state.walking) {
|
||||
fVel = VectorLength(cg.predicted_player_state.velocity);
|
||||
fVel = VectorLength(vVelocity);
|
||||
fPhase = fVel * 0.0015 + 0.9;
|
||||
cg.fCurrentViewBobPhase += (cg.frametime / 1000.0 + cg.frametime / 1000.0) * M_PI * fPhase;
|
||||
|
||||
|
@ -446,7 +456,7 @@ void CG_OffsetFirstPersonView(refEntity_t *pREnt, qboolean bUseWorldPosition)
|
|||
AngleVectorsLeft(vDelta, mat[0], mat[1], mat[2]);
|
||||
|
||||
CG_CalcViewModelMovement(
|
||||
cg.fCurrentViewBobPhase, cg.fCurrentViewBobAmp, cg.predicted_player_state.velocity, vDelta
|
||||
cg.fCurrentViewBobPhase, cg.fCurrentViewBobAmp, vVelocity, vDelta
|
||||
);
|
||||
|
||||
VectorMA(pREnt->origin, vDelta[0], mat[0], pREnt->origin);
|
||||
|
@ -475,8 +485,15 @@ static int CG_CalcFov(void)
|
|||
int contents;
|
||||
float fov_x, fov_y;
|
||||
int inwater;
|
||||
float fov_ratio;
|
||||
|
||||
fov_ratio = (float)cg.refdef.width / (float)cg.refdef.height * (3.0 / 4.0);
|
||||
if (fov_ratio == 1) {
|
||||
fov_x = cg.camera_fov;
|
||||
} else {
|
||||
fov_x = RAD2DEG(atan(tan(DEG2RAD(cg.camera_fov / 2.0)) * fov_ratio)) * 2.0;
|
||||
}
|
||||
|
||||
x = cg.refdef.width / tan(fov_x / 360 * M_PI);
|
||||
fov_y = atan2(cg.refdef.height, x);
|
||||
fov_y = fov_y * 360 / M_PI;
|
||||
|
@ -560,17 +577,6 @@ static int CG_CalcViewValues(void)
|
|||
CG_CalcVrect();
|
||||
CG_SetupFog();
|
||||
|
||||
// setup fog and far clipping plane
|
||||
cg.refdef.farplane_distance = cg.farplane_distance;
|
||||
VectorCopy(cg.farplane_color, cg.refdef.farplane_color);
|
||||
cg.refdef.farplane_cull = cg.farplane_cull;
|
||||
|
||||
// setup portal sky
|
||||
cg.refdef.sky_alpha = cg.sky_alpha;
|
||||
cg.refdef.sky_portal = cg.sky_portal;
|
||||
memcpy(cg.refdef.sky_axis, cg.sky_axis, sizeof(cg.sky_axis));
|
||||
VectorCopy(cg.sky_origin, cg.refdef.sky_origin);
|
||||
|
||||
ps = &cg.predicted_player_state;
|
||||
|
||||
VectorCopy(ps->origin, cg.refdef.vieworg);
|
||||
|
@ -723,7 +729,37 @@ float CG_SensitivityScale()
|
|||
|
||||
void CG_AddLightShow()
|
||||
{
|
||||
// FIXME: unimplemented
|
||||
int i;
|
||||
float fSlopeY, fSlopeZ;
|
||||
float x, y, z;
|
||||
vec3_t vOrg;
|
||||
float r, g, b;
|
||||
float fMax;
|
||||
|
||||
fSlopeY = tan(cg.refdef.fov_x * 0.5);
|
||||
fSlopeZ = tan(cg.refdef.fov_y * 0.5);
|
||||
|
||||
for (i = 0; i < cg_acidtrip->integer; i++) {
|
||||
x = pow(random(), 1.0 / 3.0) * 2048.0;
|
||||
y = crandom() * x * fSlopeY;
|
||||
z = crandom() * x * fSlopeZ;
|
||||
|
||||
VectorCopy(cg.refdef.vieworg, vOrg);
|
||||
VectorMA(vOrg, x, cg.refdef.viewaxis[0], vOrg);
|
||||
VectorMA(vOrg, y, cg.refdef.viewaxis[1], vOrg);
|
||||
VectorMA(vOrg, z, cg.refdef.viewaxis[2], vOrg);
|
||||
|
||||
r = random();
|
||||
g = random();
|
||||
b = random();
|
||||
|
||||
fMax = Q_max(r, Q_max(g, b));
|
||||
r /= fMax;
|
||||
g /= fMax;
|
||||
b /= fMax;
|
||||
|
||||
cgi.R_AddLightToScene(vOrg, (rand() & 0x1FF) + 0x80, r, g, b, 0);
|
||||
}
|
||||
}
|
||||
|
||||
qboolean CG_FrustumCullSphere(const vec3_t vPos, float fRadius) {
|
||||
|
@ -811,6 +847,15 @@ void CG_DrawActiveFrame(int serverTime, int frameTime, stereoFrame_t stereoView,
|
|||
// no entities should be marked as interpolating
|
||||
}
|
||||
|
||||
//
|
||||
// Added in OPM
|
||||
// Clamp the fov to avoid artifacts
|
||||
if (cg_fov->value < 65) {
|
||||
cgi.Cvar_Set("cg_fov", "65");
|
||||
} else if (cg_fov->value > 120) {
|
||||
cgi.Cvar_Set("cg_fov", "120");
|
||||
}
|
||||
|
||||
// update cg.predicted_player_state
|
||||
CG_PredictPlayerState();
|
||||
|
||||
|
@ -882,13 +927,13 @@ void CG_DrawActiveFrame(int serverTime, int frameTime, stereoFrame_t stereoView,
|
|||
{
|
||||
default:
|
||||
case 0:
|
||||
cgi.UI_HideMenu("mission_success_1", CVAR_ARCHIVE);
|
||||
cgi.UI_HideMenu("mission_success_1", qtrue);
|
||||
break;
|
||||
case 2:
|
||||
cgi.UI_HideMenu("mission_success_2", CVAR_ARCHIVE);
|
||||
cgi.UI_HideMenu("mission_success_2", qtrue);
|
||||
break;
|
||||
case 3:
|
||||
cgi.UI_HideMenu("mission_success_3", CVAR_ARCHIVE);
|
||||
cgi.UI_HideMenu("mission_success_3", qtrue);
|
||||
break;
|
||||
}
|
||||
} else {
|
||||
|
@ -896,21 +941,21 @@ void CG_DrawActiveFrame(int serverTime, int frameTime, stereoFrame_t stereoView,
|
|||
{
|
||||
default:
|
||||
case 0:
|
||||
cgi.UI_HideMenu("mission_failed_1", CVAR_ARCHIVE);
|
||||
cgi.UI_HideMenu("mission_failed_1", qtrue);
|
||||
break;
|
||||
case 2:
|
||||
cgi.UI_HideMenu("mission_failed_2", CVAR_ARCHIVE);
|
||||
cgi.UI_HideMenu("mission_failed_2", qtrue);
|
||||
break;
|
||||
case 3:
|
||||
cgi.UI_HideMenu("mission_failed_3", CVAR_ARCHIVE);
|
||||
cgi.UI_HideMenu("mission_failed_3", qtrue);
|
||||
break;
|
||||
}
|
||||
}
|
||||
} else {
|
||||
if (cgi.Cvar_Get("g_success", "", 0)->integer) {
|
||||
cgi.UI_HideMenu("StatsScreen_Success", qfalse);
|
||||
cgi.UI_HideMenu("StatsScreen_Success", qtrue);
|
||||
} else {
|
||||
cgi.UI_HideMenu("StatsScreen_Failed", qfalse);
|
||||
cgi.UI_HideMenu("StatsScreen_Failed", qtrue);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -918,6 +963,9 @@ void CG_DrawActiveFrame(int serverTime, int frameTime, stereoFrame_t stereoView,
|
|||
cg.bIntermissionDisplay = qfalse;
|
||||
}
|
||||
|
||||
// Added in OPM
|
||||
CG_ProcessPlayerModel();
|
||||
|
||||
// build the render lists
|
||||
if (!cg.hyperspace) {
|
||||
CG_AddPacketEntities(); // after calcViewValues, so predicted player state is correct
|
||||
|
|
|
@ -28,6 +28,7 @@ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
|||
|
||||
static const char *AnimPrefixList[] = {
|
||||
"",
|
||||
"unarmed",
|
||||
"papers",
|
||||
"colt45",
|
||||
"p38",
|
||||
|
@ -45,7 +46,6 @@ static const char *AnimPrefixList[] = {
|
|||
"bazooka",
|
||||
"panzerschreck",
|
||||
"shotgun",
|
||||
"unarmed",
|
||||
//
|
||||
// Team Assault and Team Tactics weapons
|
||||
"mg42portable",
|
||||
|
@ -82,6 +82,7 @@ static const char *AnimPrefixList[] = {
|
|||
|
||||
enum animPrefix_e {
|
||||
WPREFIX_NONE,
|
||||
WPREFIX_UNARMED,
|
||||
WPREFIX_PAPERS,
|
||||
WPREFIX_COLT45,
|
||||
WPREFIX_P38,
|
||||
|
@ -99,7 +100,6 @@ enum animPrefix_e {
|
|||
WPREFIX_BAZOOKA,
|
||||
WPREFIX_PANZERSCHRECK,
|
||||
WPREFIX_SHOTGUN,
|
||||
WPREFIX_UNARMED,
|
||||
//
|
||||
// Team Assault and Team Tactics weapons
|
||||
WPREFIX_MG42_PORTABLE,
|
||||
|
@ -308,6 +308,9 @@ int CG_GetVMAnimPrefixIndex()
|
|||
if (!Q_stricmp(szWeaponName, "Panzerschreck")) {
|
||||
return WPREFIX_PANZERSCHRECK;
|
||||
}
|
||||
if (!Q_stricmp(szWeaponName, "Gewehrgranate")) {
|
||||
return WPREFIX_KAR98_MORTAR;
|
||||
}
|
||||
if (!Q_stricmp(szWeaponName, "Shotgun")) {
|
||||
return WPREFIX_SHOTGUN;
|
||||
}
|
||||
|
@ -335,9 +338,11 @@ void CG_ViewModelAnimation(refEntity_t *pModel)
|
|||
char szAnimName[MAX_QPATH];
|
||||
dtiki_t *pTiki;
|
||||
qboolean bAnimChanged;
|
||||
qboolean bWeaponChanged;
|
||||
|
||||
fCrossblendFrac = 0.0;
|
||||
bAnimChanged = 0;
|
||||
bAnimChanged = qfalse;
|
||||
bWeaponChanged = qfalse; // Added in OPM
|
||||
pTiki = pModel->tiki;
|
||||
|
||||
if (cgi.anim->g_iLastEquippedWeaponStat == cg.snap->ps.stats[STAT_EQUIPPED_WEAPON]
|
||||
|
@ -346,13 +351,15 @@ void CG_ViewModelAnimation(refEntity_t *pModel)
|
|||
} else {
|
||||
iAnimPrefixIndex = CG_GetVMAnimPrefixIndex();
|
||||
cgi.anim->g_iLastEquippedWeaponStat = cg.snap->ps.stats[STAT_EQUIPPED_WEAPON];
|
||||
strcpy(cgi.anim->g_szLastActiveItem, CG_ConfigString(CS_WEAPONS + cg.snap->ps.activeItems[1]));
|
||||
Q_strncpyz(cgi.anim->g_szLastActiveItem, CG_ConfigString(CS_WEAPONS + cg.snap->ps.activeItems[1]), sizeof(cgi.anim->g_szLastActiveItem));
|
||||
cgi.anim->g_iLastAnimPrefixIndex = iAnimPrefixIndex;
|
||||
|
||||
bAnimChanged = qtrue;
|
||||
bWeaponChanged = qtrue;
|
||||
}
|
||||
|
||||
if (cgi.anim->g_iLastVMAnim == -1) {
|
||||
sprintf(szAnimName, "%s_idle", AnimPrefixList[iAnimPrefixIndex]);
|
||||
Com_sprintf(szAnimName, sizeof(szAnimName), "%s_idle", AnimPrefixList[iAnimPrefixIndex]);
|
||||
cgi.anim->g_VMFrameInfo[cgi.anim->g_iCurrentVMAnimSlot].index = cgi.Anim_NumForName(pTiki, szAnimName);
|
||||
|
||||
if (cgi.anim->g_VMFrameInfo[cgi.anim->g_iCurrentVMAnimSlot].index == -1) {
|
||||
|
@ -421,8 +428,10 @@ void CG_ViewModelAnimation(refEntity_t *pModel)
|
|||
break;
|
||||
}
|
||||
|
||||
sprintf(szAnimName, "%s_%s", AnimPrefixList[iAnimPrefixIndex], pszAnimSuffix);
|
||||
fCrossblendTime = cgi.Anim_CrossblendTime(pTiki, cgi.anim->g_VMFrameInfo[cgi.anim->g_iCurrentVMAnimSlot].index);
|
||||
Com_sprintf(szAnimName, sizeof(szAnimName), "%s_%s", AnimPrefixList[iAnimPrefixIndex], pszAnimSuffix);
|
||||
if (!bWeaponChanged) {
|
||||
fCrossblendTime =
|
||||
cgi.Anim_CrossblendTime(pTiki, cgi.anim->g_VMFrameInfo[cgi.anim->g_iCurrentVMAnimSlot].index);
|
||||
fCrossblendAmount = cgi.anim->g_iCurrentVMDuration / 1000.0;
|
||||
|
||||
if (fCrossblendAmount < fCrossblendTime && fCrossblendAmount > 0.0) {
|
||||
|
@ -437,6 +446,11 @@ void CG_ViewModelAnimation(refEntity_t *pModel)
|
|||
}
|
||||
}
|
||||
}
|
||||
} else {
|
||||
fCrossblendTime = 0;
|
||||
fCrossblendAmount = 0;
|
||||
fCrossblendFrac = 0;
|
||||
}
|
||||
|
||||
cgi.anim->g_iCurrentVMAnimSlot = (cgi.anim->g_iCurrentVMAnimSlot + 1) % MAX_FRAMEINFOS;
|
||||
cgi.anim->g_VMFrameInfo[cgi.anim->g_iCurrentVMAnimSlot].index = cgi.Anim_NumForName(pTiki, szAnimName);
|
||||
|
@ -450,7 +464,9 @@ void CG_ViewModelAnimation(refEntity_t *pModel)
|
|||
cgi.anim->g_VMFrameInfo[cgi.anim->g_iCurrentVMAnimSlot].weight = 1.0;
|
||||
cgi.anim->g_iCurrentVMDuration = 0;
|
||||
|
||||
fCrossblendTime = cgi.Anim_CrossblendTime(pTiki, cgi.anim->g_VMFrameInfo[cgi.anim->g_iCurrentVMAnimSlot].index);
|
||||
if (!bWeaponChanged) {
|
||||
fCrossblendTime =
|
||||
cgi.Anim_CrossblendTime(pTiki, cgi.anim->g_VMFrameInfo[cgi.anim->g_iCurrentVMAnimSlot].index);
|
||||
if (!fCrossblendTime) {
|
||||
for (i = 0; i < MAX_FRAMEINFOS; ++i) {
|
||||
if (i != cgi.anim->g_iCurrentVMAnimSlot) {
|
||||
|
@ -462,6 +478,18 @@ void CG_ViewModelAnimation(refEntity_t *pModel)
|
|||
} else {
|
||||
cgi.anim->g_bCrossblending = qtrue;
|
||||
}
|
||||
} else {
|
||||
// Added in OPM
|
||||
// If there is a new weapon, don't do any crossblend
|
||||
cgi.anim->g_bCrossblending = qfalse;
|
||||
|
||||
// clear crossblend values
|
||||
for (i = 0; i < MAX_FRAMEINFOS; ++i) {
|
||||
if (i != cgi.anim->g_iCurrentVMAnimSlot) {
|
||||
cgi.anim->g_VMFrameInfo[i].weight = 0.0;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
cgi.anim->g_iCurrentVMDuration += cg.frametime;
|
||||
|
|
|
@ -42,7 +42,9 @@ const char *cg_vsstypes[] = {
|
|||
"debris"
|
||||
};
|
||||
|
||||
cvssource_t *vss_sorttable[16384];
|
||||
#define MAX_VSS_SORTS 16384
|
||||
|
||||
cvssource_t *vss_sorttable[MAX_VSS_SORTS];
|
||||
|
||||
static int lastVSSFrameTime;
|
||||
static constexpr float MAX_VSS_COORDS = 8096.0;
|
||||
|
@ -78,20 +80,26 @@ void VSS_AddRepulsion(cvssource_t *pA, cvssource_t *pB)
|
|||
|
||||
VectorSubtract(pA->newOrigin, pB->newOrigin, vPush);
|
||||
|
||||
if (vPush[0] || vPush[1] || vPush[2]) {
|
||||
if (!vPush[0] && !vPush[1] && !vPush[2]) {
|
||||
VectorSet(vPush, crandom(), crandom(), crandom());
|
||||
VectorAdd(pA->repulsion, vPush, pA->repulsion);
|
||||
VectorSubtract(pB->repulsion, vPush, pB->repulsion);
|
||||
return;
|
||||
}
|
||||
|
||||
fDist = VectorNormalize(vPush);
|
||||
f = fDist - pB->newRadius;
|
||||
|
||||
if (f > 0.0) {
|
||||
if (f > 0.0f) {
|
||||
f *= pA->ooRadius;
|
||||
if (f > 1.49) {
|
||||
f = 0.0;
|
||||
if (f > 1.49f) {
|
||||
f = 0.0f;
|
||||
} else {
|
||||
f = f * (f * 0.0161 + -0.3104) + 1.2887;
|
||||
f = f * (f * 0.0161f + -0.3104f) + 1.2887f;
|
||||
}
|
||||
|
||||
if (f < 0.0) {
|
||||
f = f * 1.1;
|
||||
f *= 1.1f;
|
||||
}
|
||||
|
||||
fForce = f;
|
||||
|
@ -102,30 +110,25 @@ void VSS_AddRepulsion(cvssource_t *pA, cvssource_t *pB)
|
|||
f = fDist - pA->newRadius;
|
||||
if (f > 0.0) {
|
||||
f *= pB->ooRadius;
|
||||
if (f > 1.49) {
|
||||
f = 0.0;
|
||||
if (f > 1.49f) {
|
||||
f = 0.0f;
|
||||
} else {
|
||||
f = f * (f * 0.0161 + -0.3104) + 1.2887;
|
||||
f = f * (f * 0.0161f + -0.3104f) + 1.2887f;
|
||||
}
|
||||
|
||||
if (f < 0.0) {
|
||||
f = f * 1.1;
|
||||
f *= 1.1f;
|
||||
}
|
||||
|
||||
fForce += f;
|
||||
} else {
|
||||
fForce += 1.0;
|
||||
fForce += 1.0f;
|
||||
}
|
||||
|
||||
if (fForce <= -0.05 && fForce >= 0.05) {
|
||||
fForce = (pA->newRadius + pB->newRadius) * 0.03 * fForce;
|
||||
if (fForce <= -0.05f || fForce >= 0.05f) {
|
||||
fForce = (pA->newRadius + pB->newRadius) * 0.03f * fForce;
|
||||
VectorScale(vPush, fForce, vPush);
|
||||
|
||||
VectorAdd(pA->repulsion, vPush, pA->repulsion);
|
||||
VectorSubtract(pB->repulsion, vPush, pB->repulsion);
|
||||
}
|
||||
} else {
|
||||
VectorSet(vPush, crandom(), crandom(), crandom());
|
||||
VectorAdd(pA->repulsion, vPush, pA->repulsion);
|
||||
VectorSubtract(pB->repulsion, vPush, pB->repulsion);
|
||||
}
|
||||
|
@ -206,7 +209,7 @@ void ClientGameCommandManager::ResetVSSSources()
|
|||
|
||||
void ClientGameCommandManager::ResetVSSSources(Event *ev)
|
||||
{
|
||||
// FIXME: stub??
|
||||
ResetVSSSources();
|
||||
}
|
||||
|
||||
void CG_ResetVSSSources()
|
||||
|
@ -286,13 +289,13 @@ qboolean VSS_SourcePhysics(cvssource_t *pSource, float ftime)
|
|||
|
||||
fWind = 0.0;
|
||||
|
||||
if ((pSource->flags2 & 5) != 0) {
|
||||
if ((pSource->flags2 & (T2_ACCEL | T2_MOVE)) != 0) {
|
||||
VectorMA(pSource->velocity, ftime, pSource->repulsion, pSource->velocity);
|
||||
}
|
||||
|
||||
pSource->lastOrigin = pSource->newOrigin;
|
||||
|
||||
if (pSource->flags & 0x800) {
|
||||
if (pSource->flags & T_COLLISION) {
|
||||
trace.allsolid = qfalse;
|
||||
CG_ClipMoveToEntities(
|
||||
pSource->newOrigin, vec3_origin, vec3_origin, pSource->newOrigin, -1, MASK_VOLUMETRIC_SMOKE, &trace, qfalse
|
||||
|
@ -312,11 +315,11 @@ qboolean VSS_SourcePhysics(cvssource_t *pSource, float ftime)
|
|||
}
|
||||
}
|
||||
|
||||
if (pSource->flags2 & 5) {
|
||||
if (pSource->flags2 & (T2_ACCEL | T2_MOVE)) {
|
||||
VectorMA(pSource->newOrigin, ftime, pSource->velocity, pSource->newOrigin);
|
||||
}
|
||||
|
||||
if (pSource->flags & 0x800) {
|
||||
if (pSource->flags & T_COLLISION) {
|
||||
CG_Trace(
|
||||
&trace,
|
||||
pSource->lastOrigin,
|
||||
|
@ -334,6 +337,8 @@ qboolean VSS_SourcePhysics(cvssource_t *pSource, float ftime)
|
|||
float fDot;
|
||||
vec3_t vNorm;
|
||||
|
||||
VectorCopy(trace.plane.normal, vNorm);
|
||||
|
||||
VectorAdd(trace.endpos, trace.plane.normal, pSource->newOrigin);
|
||||
fDot = DotProduct(vNorm, pSource->velocity);
|
||||
VectorMA(pSource->velocity, fDot, vNorm, pSource->velocity);
|
||||
|
@ -358,7 +363,7 @@ qboolean VSS_SourcePhysics(cvssource_t *pSource, float ftime)
|
|||
}
|
||||
|
||||
iSmokeType = abs(pSource->smokeType);
|
||||
if (pSource->flags2 & 5) {
|
||||
if (pSource->flags2 & (T2_ACCEL | T2_MOVE)) {
|
||||
VectorCopy(pSource->velocity, vVel);
|
||||
|
||||
for (i = 0; i < 3; i++) {
|
||||
|
@ -619,7 +624,7 @@ qboolean VSS_LerpSource(cvssource_t *pCurrent, cvssourcestate_t *pState, float f
|
|||
{
|
||||
int i;
|
||||
|
||||
if (pCurrent->flags & 0xA0000) {
|
||||
if (pCurrent->flags & (T_HARDLINK | T_PARENTLINK)) {
|
||||
Vector parentOrigin;
|
||||
|
||||
for (i = 0; i < 3; i++) {
|
||||
|
@ -638,7 +643,7 @@ qboolean VSS_LerpSource(cvssource_t *pCurrent, cvssourcestate_t *pState, float f
|
|||
|
||||
parentOrigin = e->origin;
|
||||
VectorAdd(pState->origin, parentOrigin, pState->origin);
|
||||
} else if (pCurrent->flags2 & 5) {
|
||||
} else if (pCurrent->flags2 & (T2_ACCEL | T2_MOVE)) {
|
||||
for (i = 0; i < 3; i++) {
|
||||
pState->origin[i] =
|
||||
(pCurrent->newOrigin[i] - pCurrent->lastOrigin[i]) * fLerpFrac + pCurrent->lastOrigin[i];
|
||||
|
@ -741,9 +746,8 @@ void ClientGameCommandManager::SpawnVSSSource(int count, int timealive)
|
|||
|
||||
pSource->startAlpha = (random() * 0.15 + 0.85) * fDensity;
|
||||
pSource->newDensity = 0.0;
|
||||
if (m_spawnthing->cgd.flags & 1) {
|
||||
if (m_spawnthing->cgd.flags & T_RANDSCALE) {
|
||||
pSource->newRadius = RandomizeRange(m_spawnthing->cgd.scalemin, m_spawnthing->cgd.scalemax);
|
||||
;
|
||||
if (pSource->newRadius > 32.0) {
|
||||
pSource->newRadius = 32.0;
|
||||
}
|
||||
|
@ -772,16 +776,16 @@ void ClientGameCommandManager::SpawnVSSSource(int count, int timealive)
|
|||
pSource->roll = anglemod(fAngle);
|
||||
|
||||
if (random() < 0.5) {
|
||||
pSource->flags |= 0x40000;
|
||||
pSource->flags |= T_RANDOMROLL;
|
||||
}
|
||||
|
||||
VectorCopy(m_spawnthing->axis[0], vNewForward);
|
||||
if (m_spawnthing->cgd.flags & 4) {
|
||||
if (m_spawnthing->cgd.flags & T_SPHERE) {
|
||||
VectorCopy(m_spawnthing->cgd.origin, pSource->newOrigin);
|
||||
do {
|
||||
vNewForward = Vector(crandom(), crandom(), crandom());
|
||||
} while (Vector::Dot(vNewForward, vNewForward) < 1.0);
|
||||
} else if (m_spawnthing->cgd.flags & 0x10) {
|
||||
} else if (m_spawnthing->cgd.flags & T_CIRCLE) {
|
||||
if (m_spawnthing->sphereRadius != 0.0) {
|
||||
Vector dst, end;
|
||||
|
||||
|
@ -794,7 +798,7 @@ void ClientGameCommandManager::SpawnVSSSource(int count, int timealive)
|
|||
|
||||
fAngle += fAngleStep;
|
||||
}
|
||||
} else if (m_spawnthing->cgd.flags & 8) {
|
||||
} else if (m_spawnthing->cgd.flags & T_INWARDSPHERE) {
|
||||
Vector dir, end;
|
||||
do {
|
||||
dir = Vector(crandom(), crandom(), crandom());
|
||||
|
@ -803,7 +807,7 @@ void ClientGameCommandManager::SpawnVSSSource(int count, int timealive)
|
|||
end = m_spawnthing->cgd.origin + dir * m_spawnthing->sphereRadius;
|
||||
VectorCopy(end, pSource->newOrigin);
|
||||
vNewForward = dir * -1.0;
|
||||
} else if (m_spawnthing->cgd.flags2 & 0x20000) {
|
||||
} else if (m_spawnthing->cgd.flags2 & T2_CONE) {
|
||||
float fHeight, fRadius;
|
||||
float fAngle;
|
||||
float sina, cosa;
|
||||
|
@ -825,8 +829,6 @@ void ClientGameCommandManager::SpawnVSSSource(int count, int timealive)
|
|||
VectorMA(m_spawnthing->cgd.origin, fRadius * cosa, m_spawnthing->axis[1], pSource->newOrigin);
|
||||
VectorMA(m_spawnthing->cgd.origin, fRadius * sina, m_spawnthing->axis[2], pSource->newOrigin);
|
||||
} else if (m_spawnthing->sphereRadius) {
|
||||
VectorCopy(m_spawnthing->cgd.origin, pSource->newOrigin);
|
||||
} else {
|
||||
Vector dir, end;
|
||||
do {
|
||||
dir = Vector(crandom(), crandom(), crandom());
|
||||
|
@ -836,6 +838,8 @@ void ClientGameCommandManager::SpawnVSSSource(int count, int timealive)
|
|||
end = m_spawnthing->cgd.origin + dir * m_spawnthing->sphereRadius;
|
||||
VectorCopy(end, pSource->newOrigin);
|
||||
vNewForward = dir;
|
||||
} else {
|
||||
VectorCopy(m_spawnthing->cgd.origin, pSource->newOrigin);
|
||||
}
|
||||
|
||||
for (i = 0; i < 3; i++) {
|
||||
|
@ -869,15 +873,14 @@ void ClientGameCommandManager::SpawnVSSSource(int count, int timealive)
|
|||
for (i = 0; i < 3; ++i) {
|
||||
float fDist = m_spawnthing->axis_offset_base[i] + random() * m_spawnthing->axis_offset_amplitude[i];
|
||||
|
||||
if (pSource->flags2 & 0x80) {
|
||||
if (pSource->flags2 & T2_PARALLEL) {
|
||||
pSource->newOrigin += Vector(m_spawnthing->axis[i]) * fDist;
|
||||
} else {
|
||||
pSource->newOrigin += Vector(m_spawnthing->tag_axis[i]) * fDist;
|
||||
}
|
||||
}
|
||||
|
||||
pSource->velocity *= pSource->lifeTime / 1000.0;
|
||||
pSource->newOrigin += pSource->velocity;
|
||||
pSource->newOrigin += pSource->velocity * (pSource->lifeTime / 1000.0);
|
||||
if (vss_lighting_fps->integer) {
|
||||
cgi.R_GetLightingForSmoke(pSource->newLighting, pSource->newOrigin);
|
||||
}
|
||||
|
@ -890,9 +893,6 @@ void VSS_CalcRepulsionForces(cvssource_t *pActiveSources)
|
|||
{
|
||||
cvssource_t *pCurrent;
|
||||
cvssource_t *pComp;
|
||||
|
||||
pCurrent = pActiveSources->prev;
|
||||
if (pCurrent != pActiveSources) {
|
||||
qboolean bXUp, bXDown;
|
||||
qboolean bYUp, bYDown;
|
||||
qboolean bZDown;
|
||||
|
@ -904,19 +904,23 @@ void VSS_CalcRepulsionForces(cvssource_t *pActiveSources)
|
|||
float fOfs;
|
||||
cvssource_t *pSTLatch;
|
||||
|
||||
pCurrent = pActiveSources->prev;
|
||||
if (pCurrent == pActiveSources) {
|
||||
return;
|
||||
}
|
||||
|
||||
memset(vss_sorttable, 0, sizeof(vss_sorttable));
|
||||
|
||||
while (pCurrent != pActiveSources) {
|
||||
for (pCurrent = pActiveSources->prev; pCurrent != pActiveSources; pCurrent = pCurrent->prev) {
|
||||
VectorClear(pCurrent->repulsion);
|
||||
|
||||
iIndex = ((int)floor(pCurrent->newOrigin[0] + 8192.0 + 0.5) / 96) % 32;
|
||||
iIndex |= ((int)floor(pCurrent->newOrigin[1] + 8192.0 + 0.5) / 96) % 32;
|
||||
iIndex |= (((int)floor(pCurrent->newOrigin[1] + 8192.0 + 0.5) / 96) % 32) << 5;
|
||||
iIndex |= (((int)floor(pCurrent->newOrigin[2] + 8192.0 + 0.5) / 96) % 16) << 10;
|
||||
|
||||
pCurrent->stnext = vss_sorttable[iIndex];
|
||||
vss_sorttable[iIndex] = pCurrent;
|
||||
pCurrent->stindex = iIndex;
|
||||
pCurrent = pCurrent->prev;
|
||||
}
|
||||
|
||||
for (pCurrent = pActiveSources->prev; pCurrent != pActiveSources; pCurrent = pCurrent->prev) {
|
||||
|
@ -928,53 +932,48 @@ void VSS_CalcRepulsionForces(cvssource_t *pActiveSources)
|
|||
pComp = vss_sorttable[pCurrent->stindex];
|
||||
}
|
||||
|
||||
while (pComp) {
|
||||
for(; pComp; pComp = pComp->stnext) {
|
||||
VSS_AddRepulsion(pCurrent, pComp);
|
||||
if (!pSTLatch && pComp->stnext == pCurrent) {
|
||||
pSTLatch = pComp;
|
||||
// skip current
|
||||
pComp = pComp->stnext;
|
||||
}
|
||||
}
|
||||
|
||||
pComp = pComp->stnext;
|
||||
}
|
||||
iX = ((int)floor(pCurrent->newOrigin[0] + 8192.0 + 0.5) / 96) % 32;
|
||||
iY = ((int)floor(pCurrent->newOrigin[1] + 8192.0 + 0.5) / 96) % 32;
|
||||
iY *= 2;
|
||||
iZ = ((int)floor(pCurrent->newOrigin[2] + 8192.0 + 0.5) / 96) % 16;
|
||||
iZ <<= 10;
|
||||
iY = (((int)floor(pCurrent->newOrigin[1] + 8192.0 + 0.5) / 96) % 32) << 5;
|
||||
iZ = (((int)floor(pCurrent->newOrigin[2] + 8192.0 + 0.5) / 96) % 16) << 10;
|
||||
|
||||
fOfs = pCurrent->newRadius + 1.49 + 48.0;
|
||||
iMaxX = ((int)floor(pCurrent->newOrigin[0] + 8192.0 + 0.5 + fOfs) / 96) % 32;
|
||||
iMaxY = ((int)floor(pCurrent->newOrigin[1] + 8192.0 + 0.5 + fOfs) / 96) % 32;
|
||||
iMaxY *= 2;
|
||||
iMaxZ = ((int)floor(pCurrent->newOrigin[2] + 8192.0 + 0.5 + fOfs) / 96) % 16;
|
||||
iMaxZ <<= 10;
|
||||
iMaxX = ((int)floor(pCurrent->newOrigin[0] + fOfs + 8192.0 + 0.5) / 96) % 32;
|
||||
iMaxY = (((int)floor(pCurrent->newOrigin[1] + fOfs + 8192.0 + 0.5) / 96) % 32) << 5;
|
||||
iMaxZ = (((int)floor(pCurrent->newOrigin[2] + fOfs + 8192.0 + 0.5) / 96) % 16) << 10;
|
||||
|
||||
iMinX = ((int)floor(pCurrent->newOrigin[0] + 8192.0 + 0.5 - fOfs) / 96) % 32;
|
||||
iMinY = ((int)floor(pCurrent->newOrigin[1] + 8192.0 + 0.5 - fOfs) / 96) % 32;
|
||||
iMinY *= 2;
|
||||
iMinZ = ((int)floor(pCurrent->newOrigin[2] + 8192.0 + 0.5 - fOfs) / 96) % 16;
|
||||
iMinZ <<= 10;
|
||||
iMinX = ((int)floor(pCurrent->newOrigin[0] - fOfs + 8192.0 + 0.5) / 96) % 32;
|
||||
iMinY = (((int)floor(pCurrent->newOrigin[1] - fOfs + 8192.0 + 0.5) / 96) % 32) << 5;
|
||||
iMinZ = (((int)floor(pCurrent->newOrigin[2] - fOfs + 8192.0 + 0.5) / 96) % 16) << 10;
|
||||
|
||||
bXUp = (iMaxX | (pCurrent->stindex & 0xFFFFFFE0)) != pCurrent->stindex;
|
||||
bXDown = (iMinX | (pCurrent->stindex & 0xFFFFFFE0)) != pCurrent->stindex;
|
||||
bYUp = (iMaxY | (pCurrent->stindex & 0xFFFFFC1F)) != pCurrent->stindex;
|
||||
bYDown = (iMinY | (pCurrent->stindex & 0xFFFFFC1F)) != pCurrent->stindex;
|
||||
|
||||
iIndex = iMinZ | (pCurrent->stindex & 0xFFFFFCC3);
|
||||
iIndex = iMinZ | (pCurrent->stindex & 0xFFFFC3FF);
|
||||
bZDown = iIndex != pCurrent->stindex;
|
||||
|
||||
if (iIndex == pCurrent->stindex) {
|
||||
iIndex = iMaxY | pCurrent->stindex & 0xFFFFFC1F;
|
||||
iIndex = iMaxY | (pCurrent->stindex & 0xFFFFFC1F);
|
||||
|
||||
i = 9;
|
||||
} else {
|
||||
i = 0;
|
||||
}
|
||||
|
||||
for(; i < (bZDown ? 26 : 17); i++) {
|
||||
for (; i < (bZDown ? 26 : 17); i++) {
|
||||
switch (i) {
|
||||
case 0:
|
||||
iIndex = iMaxZ | (pCurrent->stindex & 0xFFFFFCC3);
|
||||
iIndex = iMaxZ | (pCurrent->stindex & 0xFFFFC3FF);
|
||||
break;
|
||||
case 1:
|
||||
iIndex = iMaxX | (iIndex & 0xFFFFFFE0);
|
||||
|
@ -1123,6 +1122,9 @@ void VSS_CalcRepulsionForces(cvssource_t *pActiveSources)
|
|||
case 25:
|
||||
iIndex = iY | (iIndex & 0xFFFFFC1F);
|
||||
break;
|
||||
default:
|
||||
assert(0); // This can't happen
|
||||
break;
|
||||
}
|
||||
|
||||
for (pComp = vss_sorttable[iIndex]; pComp; pComp = pComp->stnext) {
|
||||
|
@ -1136,7 +1138,6 @@ void VSS_CalcRepulsionForces(cvssource_t *pActiveSources)
|
|||
pSTLatch->stnext = pCurrent->stnext;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void CG_AddVSSSources()
|
||||
|
@ -1222,13 +1223,13 @@ void ClientGameCommandManager::AddVSSSources()
|
|||
pComp = pCurrent->prev;
|
||||
|
||||
newEnt.renderfx = 0;
|
||||
if (pCurrent->flags < 0 && !cg_detail->integer) {
|
||||
if ((pCurrent->flags & T_DETAIL) && !cg_detail->integer) {
|
||||
FreeVSSSource(pCurrent);
|
||||
continue;
|
||||
}
|
||||
|
||||
if ((pCurrent->flags2 & 0x4000) != 0) {
|
||||
newEnt.renderfx = 0x4000000;
|
||||
if ((pCurrent->flags2 & T2_ALWAYSDRAW) != 0) {
|
||||
newEnt.renderfx = RF_ALWAYSDRAW;
|
||||
}
|
||||
|
||||
if (pCurrent->lastPhysicsTime) {
|
||||
|
@ -1237,8 +1238,8 @@ void ClientGameCommandManager::AddVSSSources()
|
|||
mstime = physics_rate;
|
||||
}
|
||||
|
||||
if (mstime >= physics_rate || (pCurrent->flags2 & 0x10) != 0) {
|
||||
if (!VSS_SourcePhysics(pCurrent, (float)mstime * 0.001)) {
|
||||
if (mstime >= physics_rate || (pCurrent->flags2 & T2_PHYSICS_EVERYFRAME) != 0) {
|
||||
if (!VSS_SourcePhysics(pCurrent, (float)mstime / 1000.0)) {
|
||||
FreeVSSSource(pCurrent);
|
||||
continue;
|
||||
}
|
||||
|
@ -1262,26 +1263,18 @@ void ClientGameCommandManager::AddVSSSources()
|
|||
}
|
||||
}
|
||||
|
||||
fLerpFrac = (cg.time - pCurrent->lastPhysicsTime) / physics_rate;
|
||||
if (fLerpFrac > 1.0) {
|
||||
fLerpFrac = 1.0;
|
||||
} else if (fLerpFrac < 0.0) {
|
||||
fLerpFrac = 0.0;
|
||||
}
|
||||
fLerpFrac = (float)(cg.time - pCurrent->lastPhysicsTime) / (float)physics_rate;
|
||||
fLerpFrac = Q_clamp_float(fLerpFrac, 0, 1);
|
||||
|
||||
fLightingFrac = (cg.time - pCurrent->lastLightingTime) / lighting_rate;
|
||||
if (fLightingFrac > 1.0) {
|
||||
fLightingFrac = 1.0;
|
||||
} else if (fLightingFrac < 0.0) {
|
||||
fLightingFrac = 0.0;
|
||||
}
|
||||
fLightingFrac = (float)(cg.time - pCurrent->lastLightingTime) / (float)lighting_rate;
|
||||
fLightingFrac = Q_clamp_float(fLightingFrac, 0, 1);
|
||||
|
||||
if (lastVSSFrameTime) {
|
||||
pCurrent->lifeTime += frameTime;
|
||||
}
|
||||
|
||||
if (!pCurrent->lastValid) {
|
||||
if (!VSS_SourcePhysics(pCurrent, (float)physics_rate * 0.001)) {
|
||||
if (!VSS_SourcePhysics(pCurrent, (float)physics_rate / 1000)) {
|
||||
ClientGameCommandManager::FreeVSSSource(pCurrent);
|
||||
continue;
|
||||
}
|
||||
|
@ -1335,12 +1328,12 @@ void ClientGameCommandManager::AddVSSSources()
|
|||
pCurrent->roll -= j;
|
||||
}
|
||||
|
||||
if ((pCurrent->flags & 0x40000) != 0) {
|
||||
if ((pCurrent->flags & T_RANDOMROLL) != 0) {
|
||||
newEnt.hModel = hModel;
|
||||
} else {
|
||||
newEnt.hModel = hModel2;
|
||||
}
|
||||
} else if ((pCurrent->flags & 0x40000) != 0) {
|
||||
} else if ((pCurrent->flags & T_RANDOMROLL) != 0) {
|
||||
newEnt.hModel = hModel;
|
||||
} else {
|
||||
newEnt.hModel = hModel2;
|
||||
|
|
|
@ -42,23 +42,23 @@ MemArchiver::~MemArchiver()
|
|||
|
||||
void MemArchiver::SetupForWriting(size_t initialSize)
|
||||
{
|
||||
state = MEMARC_WRITING;
|
||||
buffer = (byte*)cgi.Malloc(initialSize);
|
||||
allocatedSize = initialSize;
|
||||
bufferSize = 0;
|
||||
this->state = MEMARC_WRITING;
|
||||
this->buffer = (byte*)cgi.Malloc(initialSize);
|
||||
this->allocatedSize = initialSize;
|
||||
this->bufferSize = 0;
|
||||
}
|
||||
|
||||
void MemArchiver::SetupForReading(byte* buffer, size_t size)
|
||||
{
|
||||
state = MEMARC_READING;
|
||||
buffer = buffer;
|
||||
allocatedSize = size;
|
||||
bufferSize = 0;
|
||||
this->state = MEMARC_READING;
|
||||
this->buffer = buffer;
|
||||
this->allocatedSize = size;
|
||||
this->bufferSize = 0;
|
||||
}
|
||||
|
||||
void MemArchiver::SetBaseTime(unsigned int time)
|
||||
{
|
||||
svsTime = time;
|
||||
this->svsTime = time;
|
||||
}
|
||||
|
||||
size_t MemArchiver::BufferSize() const
|
||||
|
|
|
@ -1,22 +1,84 @@
|
|||
cmake_minimum_required(VERSION 3.5)
|
||||
cmake_minimum_required(VERSION 3.12)
|
||||
|
||||
project(omohclient)
|
||||
|
||||
add_subdirectory("../cgame" "./cgame")
|
||||
|
||||
file(GLOB_RECURSE SOURCES_CLIENT "./*.c*")
|
||||
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_sources(omohclient INTERFACE ${SOURCES_CLIENT} ${SOURCES_UILIB})
|
||||
target_compile_definitions(omohclient INTERFACE APP_MODULE)
|
||||
target_compile_features(omohclient INTERFACE cxx_nullptr)
|
||||
target_compile_features(omohclient INTERFACE c_variadic_macros)
|
||||
target_link_libraries(omohclient INTERFACE omohsdl)
|
||||
target_link_libraries(omohclient INTERFACE omohsdl_client)
|
||||
target_link_libraries(omohclient INTERFACE gcd)
|
||||
|
||||
# Sound stuff
|
||||
target_compile_definitions(omohclient INTERFACE USE_CODEC_MP3)
|
||||
|
||||
add_subdirectory("../libmad-0.15.1b" "./libmad")
|
||||
target_link_libraries(omohclient INTERFACE libmad)
|
||||
if (NOT NO_MODERN_DMA)
|
||||
# Use OpenAL
|
||||
find_package(OpenAL REQUIRED)
|
||||
|
||||
if (OPENAL_FOUND)
|
||||
target_compile_definitions(omohclient INTERFACE USE_OPENAL=1 NO_MODERN_DMA=0)
|
||||
if (MSVC)
|
||||
target_include_directories(omohclient INTERFACE ${OPENAL_INCLUDE_DIR}/AL)
|
||||
else()
|
||||
target_include_directories(omohclient INTERFACE ${OPENAL_INCLUDE_DIR})
|
||||
endif()
|
||||
|
||||
if(NOT USE_SYSTEM_LIBS)
|
||||
target_compile_definitions(omohclient INTERFACE USE_OPENAL_DLOPEN=1)
|
||||
else()
|
||||
# Link against system OpenAL
|
||||
target_link_libraries(omohclient INTERFACE OpenAL::OpenAL)
|
||||
endif()
|
||||
endif()
|
||||
|
||||
list(FILTER SOURCES_CLIENT EXCLUDE REGEX "./snd_([a-zA-Z0-9_]+)\.c$")
|
||||
file(GLOB SOURCES_CLIENT_SND "./snd_*_new.c*" "./snd_codec*.c*")
|
||||
list(APPEND SOURCES_CLIENT ${SOURCES_CLIENT_SND})
|
||||
else()
|
||||
#
|
||||
# Fallback to old DMA sound system
|
||||
#
|
||||
message(NOTICE "OpenAL was explicitly disabled - fallback to old SDL sound system")
|
||||
target_compile_definitions(omohclient INTERFACE NO_MODERN_DMA=1)
|
||||
set(NO_MODERN_DMA TRUE)
|
||||
|
||||
list(FILTER SOURCES_CLIENT EXCLUDE REGEX "./snd_([a-zA-Z0-9_]+)\.cpp$")
|
||||
file(GLOB_RECURSE SOURCES_CLIENT_SND "./new/*.c*")
|
||||
list(APPEND SOURCES_CLIENT ${SOURCES_CLIENT_SND})
|
||||
endif()
|
||||
|
||||
set(OLD_VALUE ${BUILD_SHARED_LIBS})
|
||||
set(BUILD_SHARED_LIBS OFF CACHE BOOL "" FORCE)
|
||||
|
||||
if(USE_INTERNAL_MAD)
|
||||
add_subdirectory("../libmad" "./libmad" EXCLUDE_FROM_ALL)
|
||||
target_link_libraries(omohclient INTERFACE mad)
|
||||
else()
|
||||
include(FindPackageHandleStandardArgs)
|
||||
find_path(LIBMAD_INCLUDE_DIRS mad.h)
|
||||
find_library(LIBMAD_LIBRARIES mad)
|
||||
find_package_handle_standard_args(
|
||||
LibMad
|
||||
DEFAULT_MSG
|
||||
LIBMAD_LIBRARIES
|
||||
LIBMAD_INCLUDE_DIRS
|
||||
)
|
||||
target_include_directories(omohclient INTERFACE ${LIBMAD_INCLUDE_DIRS})
|
||||
target_link_libraries(omohclient INTERFACE ${LIBMAD_LIBRARIES})
|
||||
endif()
|
||||
|
||||
set(BUILD_SHARED_LIBS ${OLD_VALUE} CACHE BOOL "" FORCE)
|
||||
|
||||
target_sources(omohclient INTERFACE ${SOURCES_CLIENT} ${SOURCES_UILIB})
|
||||
|
|
|
@ -334,6 +334,9 @@ writing the actual data can begin
|
|||
*/
|
||||
qboolean CL_OpenAVIForWriting( const char *fileName )
|
||||
{
|
||||
return qfalse;
|
||||
// Removed in OPM
|
||||
#if 0
|
||||
if( afd.fileOpen )
|
||||
return qfalse;
|
||||
|
||||
|
@ -425,6 +428,7 @@ qboolean CL_OpenAVIForWriting( const char *fileName )
|
|||
afd.fileOpen = qtrue;
|
||||
|
||||
return qtrue;
|
||||
#endif
|
||||
}
|
||||
|
||||
/*
|
||||
|
|
|
@ -211,20 +211,20 @@ qboolean CL_GetSnapshot( int snapshotNumber, snapshot_t *snapshot ) {
|
|||
}
|
||||
|
||||
snapshot->numEntities = 0;
|
||||
for ( i = 0 ; i < count ; i++ ) {
|
||||
for(i = 0; i < MAX_ENTITIES_IN_SNAPSHOT; i++) {
|
||||
parents[i] = -1;
|
||||
}
|
||||
|
||||
for (i = 0; i < count; i++) {
|
||||
s1 = &cl.parseEntities[(clSnap->parseEntitiesNum + i) & (MAX_PARSE_ENTITIES - 1)];
|
||||
pnum = s1->parent;
|
||||
|
||||
if (pnum == ENTITYNUM_NONE) {
|
||||
parents[s1->number] = -2;
|
||||
}
|
||||
else
|
||||
{
|
||||
} else {
|
||||
if (parents[pnum] == -2) {
|
||||
parents[s1->number] = -2;
|
||||
}
|
||||
else
|
||||
{
|
||||
} else {
|
||||
// add it later
|
||||
parents[s1->number] = pnum;
|
||||
continue;
|
||||
|
@ -234,23 +234,24 @@ qboolean CL_GetSnapshot( int snapshotNumber, snapshot_t *snapshot ) {
|
|||
snapshot->entities[snapshot->numEntities++] = *s1;
|
||||
}
|
||||
|
||||
for(pcount = 0; pcount < 8 && snapshot->numEntities != count; pcount++)
|
||||
{
|
||||
for (i = 0; i < count; i++)
|
||||
{
|
||||
for(pcount = 0; pcount < 8 && snapshot->numEntities != count; pcount++) {
|
||||
for (i = 0; i < count; i++) {
|
||||
s1 = &cl.parseEntities[(clSnap->parseEntitiesNum + i) & (MAX_PARSE_ENTITIES - 1)];
|
||||
pnum = parents[s1->number];
|
||||
if (pnum >= 0 && parents[pnum] == -2) {
|
||||
parents[s1->number] = -2;
|
||||
snapshot->entities[snapshot->numEntities++] = *s1;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (pcount >= 8)
|
||||
if (snapshot->numEntities != count) {
|
||||
Com_DPrintf("CL_GetSnapshot: Not all children could find their parents.\n");
|
||||
|
||||
for (i = snapshot->numEntities; i < count; i++)
|
||||
{
|
||||
for (i = count; i < snapshot->numEntities; i++)
|
||||
{
|
||||
s1 = &cl.parseEntities[(clSnap->parseEntitiesNum + i) & (MAX_PARSE_ENTITIES - 1)];
|
||||
for (pnum = 0; pnum < count; pnum++) {
|
||||
s1 = &cl.parseEntities[(clSnap->parseEntitiesNum + pnum) & (MAX_PARSE_ENTITIES - 1)];
|
||||
if (parents[s1->number] >= 0) {
|
||||
Com_DPrintf(
|
||||
"CL_GetSnapshot: entity %d with parent %d and model '%s' at %.2f %.2f %.2f, could not find parent.\n",
|
||||
|
@ -261,6 +262,9 @@ qboolean CL_GetSnapshot( int snapshotNumber, snapshot_t *snapshot ) {
|
|||
s1->origin[1],
|
||||
s1->origin[2]
|
||||
);
|
||||
|
||||
parents[s1->number] = -2;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -358,7 +362,9 @@ qboolean CL_ProcessServerCommand(const char* origString, const char* cmd, qboole
|
|||
// because this function might be called from a module that would be unloaded
|
||||
// inside Com_Error
|
||||
UI_ForceMenuOff(1);
|
||||
Cbuf_AddText("disconnect;pushmenu disconnected");
|
||||
// Fixed in OPM
|
||||
// Added a newline for next commands
|
||||
Cbuf_AddText("disconnect;pushmenu disconnected\n");
|
||||
return qtrue;
|
||||
}
|
||||
|
||||
|
@ -421,9 +427,39 @@ qboolean CL_GetServerCommand( int serverCommandNumber, qboolean differentServer
|
|||
Com_DPrintf( "serverCommand: %i : %s\n", serverCommandNumber, s );
|
||||
}
|
||||
|
||||
Cmd_TokenizeString( s );
|
||||
Cmd_TokenizeString(s);
|
||||
cmd = Cmd_Argv(0);
|
||||
|
||||
// Readded in OPM (from ioquake)
|
||||
// Configstring big buffer
|
||||
if (!strcmp(cmd, "bcs0")) {
|
||||
Com_sprintf(bigConfigString, BIG_INFO_STRING, "cs %s \"%s", Cmd_Argv(1), Cmd_Argv(2));
|
||||
return qfalse;
|
||||
}
|
||||
|
||||
if (!strcmp(cmd, "bcs1")) {
|
||||
s = Cmd_Argv(2);
|
||||
if (strlen(bigConfigString) + strlen(s) >= BIG_INFO_STRING) {
|
||||
Com_Error(ERR_DROP, "bcs exceeded BIG_INFO_STRING");
|
||||
}
|
||||
strcat(bigConfigString, s);
|
||||
return qfalse;
|
||||
}
|
||||
|
||||
if (!strcmp(cmd, "bcs2")) {
|
||||
s = Cmd_Argv(2);
|
||||
if (strlen(bigConfigString) + strlen(s) + 1 >= BIG_INFO_STRING) {
|
||||
Com_Error(ERR_DROP, "bcs exceeded BIG_INFO_STRING");
|
||||
}
|
||||
strcat(bigConfigString, s);
|
||||
strcat(bigConfigString, "\"");
|
||||
s = bigConfigString;
|
||||
|
||||
// reparse
|
||||
Cmd_TokenizeString(s);
|
||||
cmd = Cmd_Argv(0);
|
||||
}
|
||||
|
||||
return CL_ProcessServerCommand(s, cmd, differentServer);
|
||||
}
|
||||
|
||||
|
@ -548,7 +584,7 @@ CL_RestoreSavedCgameState
|
|||
*/
|
||||
void CL_RestoreSavedCgameState() {
|
||||
if (cls.savedCgameState) {
|
||||
cge->CG_LoadStateToBuffer(&cls.savedCgameState, cls.savedCgameStateSize, cl.snap.serverTime);
|
||||
cge->CG_LoadStateToBuffer(cls.savedCgameState, cls.savedCgameStateSize, cl.snap.serverTime);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -591,7 +627,9 @@ void CL_InitCGameDLL( clientGameImport_t *cgi, clientGameExport_t **cge ) {
|
|||
cgi->LV_ConvertString = Sys_LV_CL_ConvertString;
|
||||
|
||||
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;
|
||||
|
@ -735,7 +773,9 @@ void CL_InitCGameDLL( clientGameImport_t *cgi, clientGameExport_t **cge ) {
|
|||
|
||||
cgi->UI_ShowMenu = UI_ShowMenu;
|
||||
cgi->UI_HideMenu = UI_HideMenu;
|
||||
cgi->UI_FontStringWidth = uie.FontStringWidth;
|
||||
cgi->UI_FontStringWidth = CL_FontStringWidth;
|
||||
cgi->UI_GetObjectivesTop = UI_GetObjectivesTop;
|
||||
cgi->UI_GetHighResolutionScale = UI_GetHighResolutionScale;
|
||||
cgi->Key_StringToKeynum = Key_StringToKeynum;
|
||||
cgi->Key_KeynumToBindString = Key_KeynumToBindString;
|
||||
cgi->Key_GetKeysForCommand = Key_GetKeysForCommand;
|
||||
|
@ -783,6 +823,8 @@ void CL_InitCGameDLL( clientGameImport_t *cgi, clientGameExport_t **cge ) {
|
|||
cgi->CL_RestoreSavedCgameState = CL_RestoreSavedCgameState;
|
||||
cgi->CL_ClearSavedCgameState = CL_ClearSavedCgameState;
|
||||
|
||||
cgi->getConfigStringIdNormalized = CPT_NormalizeConfigstring;
|
||||
|
||||
cgi->fsDebug = fs_debug;
|
||||
cgi->HudDrawElements = cls.HudDrawElements;
|
||||
cgi->anim = &cls.anim;
|
||||
|
@ -882,7 +924,13 @@ void CL_InitCGame( void ) {
|
|||
// find the current mapname
|
||||
info = cl.gameState.stringData + cl.gameState.stringOffsets[ CS_SERVERINFO ];
|
||||
mapname = Info_ValueForKey( info, "mapname" );
|
||||
Com_sprintf( cl.mapname, sizeof( cl.mapname ), "maps/%s.bsp", mapname );
|
||||
|
||||
if (CL_UseLargeLightmap(mapname)) {
|
||||
Com_sprintf(cl.mapname, sizeof(cl.mapname), "maps/%s.bsp", mapname);
|
||||
} else {
|
||||
// Added in 2.0
|
||||
Com_sprintf(cl.mapname, sizeof(cl.mapname), "maps/%s_sml.bsp", mapname);
|
||||
}
|
||||
|
||||
S_BeginRegistration();
|
||||
CL_ShutdownCGame();
|
||||
|
@ -897,10 +945,17 @@ void CL_InitCGame( void ) {
|
|||
CL_InitClientSavedData();
|
||||
}
|
||||
|
||||
if (cl.snap.valid) {
|
||||
// init for this gamestate
|
||||
// use the lastExecutedServerCommand instead of the serverCommandSequence
|
||||
// otherwise server commands sent just before a gamestate are dropped
|
||||
cge->CG_Init( &cgi, clc.serverMessageSequence, clc.lastExecutedServerCommand, clc.clientNum );
|
||||
cge->CG_Init(&cgi, clc.serverMessageSequence, clc.lastExecutedServerCommand, clc.clientNum);
|
||||
} else {
|
||||
// executing client commands from previous map/server might be an issue, some commands might be cs commands,
|
||||
// like old CS_SYSTEMINFO configstrings which still contain the sv_serverId from previous map.
|
||||
// It would cause the client to lose the game state number
|
||||
cge->CG_Init(&cgi, clc.serverMessageSequence, clc.serverCommandSequence, clc.clientNum);
|
||||
}
|
||||
|
||||
ClearNewConfigFlag();
|
||||
TIKI_FinishLoad();
|
||||
|
@ -1075,6 +1130,42 @@ void CL_FirstSnapshot( void ) {
|
|||
Cbuf_AddText( cl_activeAction->string );
|
||||
Cvar_Set( "activeAction", "" );
|
||||
}
|
||||
|
||||
#ifdef USE_MUMBLE
|
||||
if ((cl_useMumble->integer) && !mumble_islinked()) {
|
||||
int ret = mumble_link(CLIENT_WINDOW_TITLE);
|
||||
Com_Printf("Mumble: Linking to Mumble application %s\n", ret==0?"ok":"failed");
|
||||
}
|
||||
#endif
|
||||
|
||||
#ifdef USE_VOIP
|
||||
if (!clc.voipCodecInitialized) {
|
||||
int i;
|
||||
int error;
|
||||
|
||||
clc.opusEncoder = opus_encoder_create(48000, 1, OPUS_APPLICATION_VOIP, &error);
|
||||
|
||||
if ( error ) {
|
||||
Com_DPrintf("VoIP: Error opus_encoder_create %d\n", error);
|
||||
return;
|
||||
}
|
||||
|
||||
for (i = 0; i < MAX_CLIENTS; i++) {
|
||||
clc.opusDecoder[i] = opus_decoder_create(48000, 1, &error);
|
||||
if ( error ) {
|
||||
Com_DPrintf("VoIP: Error opus_decoder_create(%d) %d\n", i, error);
|
||||
return;
|
||||
}
|
||||
clc.voipIgnore[i] = qfalse;
|
||||
clc.voipGain[i] = 1.0f;
|
||||
}
|
||||
clc.voipCodecInitialized = qtrue;
|
||||
clc.voipMuteAll = qfalse;
|
||||
Cmd_AddCommand ("voip", CL_Voip_f);
|
||||
Cvar_Set("cl_voipSendTarget", "spatial");
|
||||
Com_Memset(clc.voipTargets, ~0, sizeof(clc.voipTargets));
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
static int lastSnapFlags;
|
||||
|
@ -1125,7 +1216,12 @@ void CL_SetCGameTime( void ) {
|
|||
// allow pause in single player
|
||||
if ( paused->integer && com_sv_running->integer ) {
|
||||
// paused
|
||||
CL_AdjustTimeDelta();
|
||||
//CL_AdjustTimeDelta();
|
||||
// Fixed in OPM
|
||||
// Keep in sync with the server time.
|
||||
// In OG, the game could lag for a short time
|
||||
// when pausing and unpausing frequently
|
||||
cl.serverTimeDelta = cl.snap.serverTime - cls.realtime;
|
||||
return;
|
||||
}
|
||||
|
||||
|
|
|
@ -35,6 +35,8 @@ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
|||
#include "../uilib/ui_public.h"
|
||||
#include "snd_local.h"
|
||||
|
||||
#include "cl_ui.h"
|
||||
|
||||
#define MAXSIZE 8
|
||||
#define MINSIZE 4
|
||||
|
||||
|
@ -55,6 +57,7 @@ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
|||
|
||||
|
||||
static void RoQ_init( void );
|
||||
static void CL_FinishedCinematic();
|
||||
|
||||
/******************************************************************************
|
||||
*
|
||||
|
@ -126,6 +129,10 @@ typedef struct {
|
|||
int playonwalls;
|
||||
byte* buf;
|
||||
long drawX, drawY;
|
||||
|
||||
long realTime;
|
||||
long currTime;
|
||||
long soundTime;
|
||||
} cin_cache;
|
||||
|
||||
static cinematics_t cin;
|
||||
|
@ -133,6 +140,10 @@ static cin_cache cinTable[MAX_VIDEO_HANDLES];
|
|||
static int currentHandle = -1;
|
||||
static int CL_handle = -1;
|
||||
|
||||
static connstate_t oldClientState;
|
||||
|
||||
static int audioStartTime = 0;
|
||||
|
||||
extern "C" int s_soundtime; // sample PAIRS
|
||||
|
||||
|
||||
|
@ -160,7 +171,7 @@ static int CIN_HandleForVideo(void) {
|
|||
}
|
||||
|
||||
|
||||
extern "C" int CL_ScaledMilliseconds(void);
|
||||
extern "C" int Com_Milliseconds(void);
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// RllSetupTable
|
||||
|
@ -1142,24 +1153,20 @@ redump:
|
|||
case ZA_SOUND_MONO:
|
||||
if (!cinTable[currentHandle].silent) {
|
||||
ssize = RllDecodeMonoToStereo( framedata, sbuf, cinTable[currentHandle].RoQFrameSize, 0, (unsigned short)cinTable[currentHandle].roq_flags);
|
||||
S_RawSamples(0, ssize, 22050, 2, 1, (byte *)sbuf, 1.0f, -1);
|
||||
// S_RawSamples(0, ssize, 22050, 2, 1, (byte *)sbuf, 1.0f, -1);
|
||||
}
|
||||
break;
|
||||
case ZA_SOUND_STEREO:
|
||||
if (!cinTable[currentHandle].silent) {
|
||||
if (cinTable[currentHandle].numQuads == -1) {
|
||||
S_Update();
|
||||
s_rawend[0] = s_soundtime;
|
||||
}
|
||||
ssize = RllDecodeStereoToStereo( framedata, sbuf, cinTable[currentHandle].RoQFrameSize, 0, (unsigned short)cinTable[currentHandle].roq_flags);
|
||||
S_RawSamples(0, ssize, 22050, 2, 2, (byte *)sbuf, 1.0f, -1);
|
||||
// S_RawSamples(0, ssize, 22050, 2, 2, (byte *)sbuf, 1.0f, -1);
|
||||
}
|
||||
break;
|
||||
case ROQ_QUAD_INFO:
|
||||
if (cinTable[currentHandle].numQuads == -1) {
|
||||
readQuadInfo( framedata );
|
||||
setupQuad( 0, 0 );
|
||||
cinTable[currentHandle].startTime = cinTable[currentHandle].lastTime = CL_ScaledMilliseconds();
|
||||
cinTable[currentHandle].startTime = cinTable[currentHandle].lastTime = Com_Milliseconds();
|
||||
}
|
||||
if (cinTable[currentHandle].numQuads != 1) cinTable[currentHandle].numQuads = 0;
|
||||
break;
|
||||
|
@ -1226,7 +1233,10 @@ redump:
|
|||
|
||||
static void RoQ_init( void )
|
||||
{
|
||||
cinTable[currentHandle].startTime = cinTable[currentHandle].lastTime = CL_ScaledMilliseconds();
|
||||
cinTable[currentHandle].startTime = cinTable[currentHandle].lastTime = Com_Milliseconds();
|
||||
cinTable[currentHandle].realTime = Com_Milliseconds();
|
||||
cinTable[currentHandle].currTime = 0;
|
||||
cinTable[currentHandle].soundTime = 0;
|
||||
|
||||
cinTable[currentHandle].RoQPlayed = 24;
|
||||
|
||||
|
@ -1273,8 +1283,10 @@ static void RoQShutdown( void ) {
|
|||
cinTable[currentHandle].iFile = 0;
|
||||
}
|
||||
|
||||
S_StopMovieAudio();
|
||||
|
||||
if (cinTable[currentHandle].alterGameState) {
|
||||
clc.state = CA_DISCONNECTED;
|
||||
clc.state = oldClientState;
|
||||
// we can't just do a vstr nextmap, because
|
||||
// if we are aborting the intro cinematic with
|
||||
// a devmap command, nextmap would be valid by
|
||||
|
@ -1286,8 +1298,29 @@ static void RoQShutdown( void ) {
|
|||
}
|
||||
CL_handle = -1;
|
||||
}
|
||||
|
||||
cinTable[currentHandle].fileName[0] = 0;
|
||||
currentHandle = -1;
|
||||
|
||||
CL_FinishedCinematic();
|
||||
}
|
||||
|
||||
static void CL_FinishedCinematic()
|
||||
{
|
||||
const char* s;
|
||||
|
||||
if (!CL_FinishedIntro())
|
||||
{
|
||||
CL_FinishedStartStage();
|
||||
return;
|
||||
}
|
||||
|
||||
s = Cvar_VariableString("nextmap");
|
||||
if (*s)
|
||||
{
|
||||
Cbuf_ExecuteText(EXEC_APPEND, va("%s\n", s));
|
||||
Cvar_Set("nextmap", "");
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
|
@ -1328,8 +1361,11 @@ Fetch and decompress the pending frame
|
|||
|
||||
e_status CIN_RunCinematic (int handle)
|
||||
{
|
||||
int start = 0;
|
||||
int thisTime = 0;
|
||||
int deltaTime;
|
||||
int frameTime;
|
||||
int soundTime;
|
||||
int newTime;
|
||||
long tfps;
|
||||
|
||||
if (handle < 0 || handle>= MAX_VIDEO_HANDLES || cinTable[handle].status == FMV_EOF) return FMV_EOF;
|
||||
|
||||
|
@ -1357,24 +1393,46 @@ e_status CIN_RunCinematic (int handle)
|
|||
return cinTable[currentHandle].status;
|
||||
}
|
||||
|
||||
thisTime = CL_ScaledMilliseconds();
|
||||
if (cinTable[currentHandle].shader && (abs(thisTime - cinTable[currentHandle].lastTime))>100) {
|
||||
cinTable[currentHandle].startTime += thisTime - cinTable[currentHandle].lastTime;
|
||||
frameTime = Com_Milliseconds();
|
||||
deltaTime = frameTime - cinTable[currentHandle].realTime;
|
||||
if (deltaTime > 100) {
|
||||
deltaTime = 100;
|
||||
}
|
||||
cinTable[currentHandle].tfps = (((CL_ScaledMilliseconds() - cinTable[currentHandle].startTime)*3)/100);
|
||||
|
||||
start = cinTable[currentHandle].startTime;
|
||||
while( (cinTable[currentHandle].tfps != cinTable[currentHandle].numQuads)
|
||||
newTime = cinTable[currentHandle].currTime + deltaTime;
|
||||
if (cl_movieaudio->integer) {
|
||||
soundTime = S_CurrentMoviePosition();
|
||||
if (soundTime > cinTable[currentHandle].currTime || soundTime > cinTable[currentHandle].soundTime) {
|
||||
cinTable[currentHandle].currTime = newTime + (deltaTime * (soundTime - newTime)) / 100;
|
||||
}
|
||||
else {
|
||||
cinTable[currentHandle].currTime = newTime;
|
||||
}
|
||||
|
||||
cinTable[currentHandle].soundTime = soundTime;
|
||||
} else {
|
||||
//
|
||||
// Fixed in OPM
|
||||
//
|
||||
cinTable[currentHandle].currTime = newTime;
|
||||
}
|
||||
|
||||
cinTable[currentHandle].realTime = frameTime;
|
||||
|
||||
tfps = (cinTable[currentHandle].currTime * 3) / 100;
|
||||
|
||||
while( (tfps != cinTable[currentHandle].numQuads)
|
||||
&& (cinTable[currentHandle].status == FMV_PLAY) )
|
||||
{
|
||||
RoQInterrupt();
|
||||
if (start != cinTable[currentHandle].startTime) {
|
||||
cinTable[currentHandle].tfps = (((CL_ScaledMilliseconds() - cinTable[currentHandle].startTime)*3)/100);
|
||||
start = cinTable[currentHandle].startTime;
|
||||
|
||||
cinTable[currentHandle].realTime = Com_Milliseconds();
|
||||
if (cinTable[currentHandle].realTime > frameTime + 66) {
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
cinTable[currentHandle].lastTime = thisTime;
|
||||
cinTable[currentHandle].lastTime = frameTime;
|
||||
|
||||
if (cinTable[currentHandle].status == FMV_LOOPED) {
|
||||
cinTable[currentHandle].status = FMV_PLAY;
|
||||
|
@ -1422,7 +1480,7 @@ int CIN_PlayCinematic( const char *arg, int x, int y, int w, int h, int systemBi
|
|||
|
||||
cin.currentHandle = currentHandle;
|
||||
|
||||
strcpy(cinTable[currentHandle].fileName, name);
|
||||
Q_strncpyz(cinTable[currentHandle].fileName, name, sizeof(cinTable[currentHandle].fileName));
|
||||
|
||||
cinTable[currentHandle].ROQSize = 0;
|
||||
cinTable[currentHandle].ROQSize = FS_FOpenFileRead (cinTable[currentHandle].fileName, &cinTable[currentHandle].iFile, qtrue, qtrue);
|
||||
|
@ -1468,10 +1526,6 @@ int CIN_PlayCinematic( const char *arg, int x, int y, int w, int h, int systemBi
|
|||
clc.state = CA_CINEMATIC;
|
||||
}
|
||||
|
||||
if (!cinTable[currentHandle].silent) {
|
||||
s_rawend[0] = s_soundtime;
|
||||
}
|
||||
|
||||
return currentHandle;
|
||||
}
|
||||
Com_DPrintf("trFMV::play(), invalid RoQ ID\n");
|
||||
|
@ -1593,33 +1647,96 @@ void CIN_DrawCinematic (int handle) {
|
|||
cinTable[handle].dirty = qfalse;
|
||||
}
|
||||
|
||||
static unsigned short CL_PlayRoQ(const char* name, const char* arg, const char* s) {
|
||||
unsigned short RoQID;
|
||||
|
||||
Com_Memset(&cin, 0, sizeof(cinematics_t) );
|
||||
currentHandle = CIN_HandleForVideo();
|
||||
|
||||
cin.currentHandle = currentHandle;
|
||||
|
||||
Q_strncpyz(cinTable[currentHandle].fileName, name, sizeof(cinTable[currentHandle].fileName));
|
||||
|
||||
cinTable[currentHandle].ROQSize = 0;
|
||||
cinTable[currentHandle].ROQSize = FS_FOpenFileRead (cinTable[currentHandle].fileName, &cinTable[currentHandle].iFile, qtrue, qtrue);
|
||||
|
||||
if (cinTable[currentHandle].ROQSize<=0) {
|
||||
Com_DPrintf("Can not find RoQ cinematic '%s'\n", name);
|
||||
CL_FinishedCinematic();
|
||||
return -1;
|
||||
}
|
||||
|
||||
if ((s && s[0] == '1') || Q_stricmp(arg,"demoend.roq")==0 || Q_stricmp(arg,"end.roq")==0) {
|
||||
cinTable[currentHandle].holdAtEnd = qtrue;
|
||||
}
|
||||
|
||||
CIN_SetExtents(currentHandle, 0, 0, 640, 480);
|
||||
cinTable[currentHandle].alterGameState = qtrue;
|
||||
|
||||
initRoQ();
|
||||
|
||||
FS_Read (cin.file, 16, cinTable[currentHandle].iFile);
|
||||
|
||||
RoQID = (unsigned short)(cin.file[0]) + (unsigned short)(cin.file[1])*256;
|
||||
if (RoQID == 0x1084)
|
||||
{
|
||||
RoQ_init();
|
||||
// FS_Read (cin.file, cinTable[currentHandle].RoQFrameSize+8, cinTable[currentHandle].iFile);
|
||||
|
||||
cinTable[currentHandle].status = FMV_PLAY;
|
||||
Com_DPrintf("trFMV::play(), playing %s\n", arg);
|
||||
|
||||
if (cl_movieaudio->integer) {
|
||||
audioStartTime = Com_Milliseconds();
|
||||
S_SetupMovieAudio(name);
|
||||
}
|
||||
|
||||
oldClientState = clc.state;
|
||||
clc.state = CA_CINEMATIC;
|
||||
|
||||
if (cls.glconfig.maxTextureSize <= 256 || s && *s == '2') {
|
||||
//cinTable[currentHandle].interlaced = qtrue;
|
||||
}
|
||||
|
||||
CL_handle = currentHandle;
|
||||
|
||||
do {
|
||||
SCR_RunCinematic();
|
||||
} while (!cinTable[currentHandle].buf && cinTable[currentHandle].status == FMV_PLAY);
|
||||
|
||||
UI_CloseConsole();
|
||||
|
||||
return currentHandle;
|
||||
}
|
||||
Com_DPrintf("trFMV::play(), invalid RoQ ID\n");
|
||||
|
||||
RoQShutdown();
|
||||
return -1;
|
||||
}
|
||||
|
||||
void CL_PlayCinematic_f(void) {
|
||||
char *arg, *s;
|
||||
int bits = CIN_system;
|
||||
char name[256];
|
||||
|
||||
Com_DPrintf("CL_PlayCinematic_f\n");
|
||||
if (clc.state == CA_CINEMATIC) {
|
||||
SCR_StopCinematic();
|
||||
}
|
||||
|
||||
arg = Cmd_Argv( 1 );
|
||||
Com_DPrintf("CL_PlayCinematic( %s )\n", arg);
|
||||
s = Cmd_Argv(2);
|
||||
|
||||
if ((s && s[0] == '1') || Q_stricmp(arg,"demoend.roq")==0 || Q_stricmp(arg,"end.roq")==0) {
|
||||
bits |= CIN_hold;
|
||||
}
|
||||
if (s && s[0] == '2') {
|
||||
bits |= CIN_loop;
|
||||
CL_StartHunkUsers(qfalse);
|
||||
S_StopAllSounds2(qtrue);
|
||||
|
||||
Com_sprintf(name, sizeof(name), "video/%s", arg);
|
||||
|
||||
if (Q_stricmp(&name[strlen(name) - 4], ".roq")) {
|
||||
Com_Printf("Bad or missing cinematic extension.\n");
|
||||
return;
|
||||
}
|
||||
|
||||
S_StopAllSounds2( qtrue );
|
||||
|
||||
CL_handle = CIN_PlayCinematic( arg, 0, 0, SCREEN_WIDTH, SCREEN_HEIGHT, bits );
|
||||
if (CL_handle >= 0) {
|
||||
do {
|
||||
SCR_RunCinematic();
|
||||
} while (cinTable[currentHandle].buf == NULL && cinTable[currentHandle].status == FMV_PLAY); // wait for first frame (load codebook and sound)
|
||||
}
|
||||
CL_PlayRoQ(name, arg, s);
|
||||
}
|
||||
|
||||
|
||||
|
@ -1639,7 +1756,5 @@ void SCR_RunCinematic (void)
|
|||
void SCR_StopCinematic(void) {
|
||||
if (CL_handle >= 0 && CL_handle < MAX_VIDEO_HANDLES) {
|
||||
CIN_StopCinematic(CL_handle);
|
||||
S_StopAllSounds2( qtrue );
|
||||
CL_handle = -1;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -56,6 +56,10 @@ qboolean in_guimouse;
|
|||
|
||||
kbutton_t in_up, in_down;
|
||||
|
||||
#ifdef USE_VOIP
|
||||
kbutton_t in_voiprecord;
|
||||
#endif
|
||||
|
||||
kbutton_t in_buttons[16];
|
||||
|
||||
qboolean in_mlooking;
|
||||
|
@ -258,6 +262,20 @@ void IN_SpeedUp(void) {IN_KeyUp(&in_speed);}
|
|||
void IN_StrafeDown(void) {IN_KeyDown(&in_strafe);}
|
||||
void IN_StrafeUp(void) {IN_KeyUp(&in_strafe);}
|
||||
|
||||
#ifdef USE_VOIP
|
||||
void IN_VoipRecordDown(void)
|
||||
{
|
||||
IN_KeyDown(&in_voiprecord);
|
||||
Cvar_Set("cl_voipSend", "1");
|
||||
}
|
||||
|
||||
void IN_VoipRecordUp(void)
|
||||
{
|
||||
IN_KeyUp(&in_voiprecord);
|
||||
Cvar_Set("cl_voipSend", "0");
|
||||
}
|
||||
#endif
|
||||
|
||||
void IN_Button0Down(void) {IN_KeyDown(&in_buttons[0]);}
|
||||
void IN_Button0Up(void) {IN_KeyUp(&in_buttons[0]);}
|
||||
void IN_Button1Down(void) {IN_KeyDown(&in_buttons[1]);}
|
||||
|
@ -432,7 +450,7 @@ void CL_MouseEvent( int dx, int dy, int time ) {
|
|||
if( cl.mousey > cls.glconfig.vidHeight )
|
||||
cl.mousey = cls.glconfig.vidHeight;
|
||||
}
|
||||
else
|
||||
else if ( !paused->integer )
|
||||
{
|
||||
cl.mouseDx[cl.mouseIndex] += dx;
|
||||
cl.mouseDy[cl.mouseIndex] += dy;
|
||||
|
@ -461,6 +479,16 @@ CL_JoystickMove
|
|||
void CL_JoystickMove( usercmd_t *cmd ) {
|
||||
float anglespeed;
|
||||
|
||||
float yaw = j_yaw->value * cl.joystickAxis[j_yaw_axis->integer];
|
||||
float right = j_side->value * cl.joystickAxis[j_side_axis->integer];
|
||||
float forward = j_forward->value * cl.joystickAxis[j_forward_axis->integer];
|
||||
float pitch = j_pitch->value * cl.joystickAxis[j_pitch_axis->integer];
|
||||
float up = j_up->value * cl.joystickAxis[j_up_axis->integer];
|
||||
|
||||
if ( in_speed.active ^ cl_run->integer ) {
|
||||
cmd->buttons |= BUTTON_RUN;
|
||||
}
|
||||
|
||||
if ( in_speed.active ) {
|
||||
anglespeed = 0.001 * cls.frametime * cl_anglespeedkey->value;
|
||||
} else {
|
||||
|
@ -468,18 +496,22 @@ void CL_JoystickMove( usercmd_t *cmd ) {
|
|||
}
|
||||
|
||||
if ( !in_strafe.active ) {
|
||||
cl.viewangles[YAW] += anglespeed * cl_yawspeed->value * cl.joystickAxis[AXIS_SIDE];
|
||||
cl.viewangles[YAW] += anglespeed * yaw;
|
||||
cmd->rightmove = ClampChar( cmd->rightmove + (int)right );
|
||||
} else {
|
||||
cmd->rightmove = ClampChar( cmd->rightmove + cl.joystickAxis[AXIS_SIDE] );
|
||||
cl.viewangles[YAW] += anglespeed * right;
|
||||
cmd->rightmove = ClampChar( cmd->rightmove + (int)yaw );
|
||||
}
|
||||
|
||||
if ( in_mlooking ) {
|
||||
cl.viewangles[PITCH] += anglespeed * cl_pitchspeed->value * cl.joystickAxis[AXIS_FORWARD];
|
||||
cl.viewangles[PITCH] += anglespeed * forward;
|
||||
cmd->forwardmove = ClampChar( cmd->forwardmove + (int)pitch );
|
||||
} else {
|
||||
cmd->forwardmove = ClampChar( cmd->forwardmove + cl.joystickAxis[AXIS_FORWARD] );
|
||||
cl.viewangles[PITCH] += anglespeed * pitch;
|
||||
cmd->forwardmove = ClampChar( cmd->forwardmove + (int)forward );
|
||||
}
|
||||
|
||||
cmd->upmove = ClampChar( cmd->upmove + cl.joystickAxis[AXIS_UP] );
|
||||
cmd->upmove = ClampChar( cmd->upmove + (int)up );
|
||||
}
|
||||
|
||||
/*
|
||||
|
@ -565,6 +597,8 @@ void CL_MouseMove( usercmd_t *cmd ) {
|
|||
mx *= cgameSensitivity;
|
||||
my *= cgameSensitivity;
|
||||
|
||||
cmd->buttons |= BUTTON_ANY;
|
||||
|
||||
// add mouse X/Y movement to cmd
|
||||
if(in_strafe.active)
|
||||
cmd->rightmove = ClampChar(cmd->rightmove + m_side->value * mx);
|
||||
|
@ -575,6 +609,14 @@ void CL_MouseMove( usercmd_t *cmd ) {
|
|||
cl.viewangles[PITCH] += m_pitch->value * my;
|
||||
else
|
||||
cmd->forwardmove = ClampChar(cmd->forwardmove - m_forward->value * my);
|
||||
|
||||
if (!isfinite(cl.viewangles[PITCH]) || !isfinite(cl.viewangles[YAW])) {
|
||||
Com_DPrintf("Invalid client viewangles encountered (view pitch: %f, view yaw: %f)!\n", cl.viewangles[PITCH], cl.viewangles[YAW]);
|
||||
Com_DPrintf("cgameSensitivity: %f | mx: %f | my: %f | m_pitch: %f | m_yaw: %f\n", cgameSensitivity, mx, my, m_pitch->value, m_yaw->value);
|
||||
Com_DPrintf("Resetting client viewangles\n");
|
||||
cl.viewangles[PITCH] = 0;
|
||||
cl.viewangles[YAW] = 0;
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
|
@ -610,7 +652,7 @@ void CL_CmdButtons( usercmd_t *cmd ) {
|
|||
cmd->buttons |= BUTTON_TALK;
|
||||
}
|
||||
|
||||
if (in_speed.active == !cl_run->integer) {
|
||||
if ( in_speed.active ^ cl_run->integer ) {
|
||||
cmd->buttons |= BUTTON_RUN;
|
||||
}
|
||||
|
||||
|
@ -718,6 +760,12 @@ void CL_CreateNewCommands( void ) {
|
|||
|
||||
frame_msec = com_frameTime - old_com_frameTime;
|
||||
|
||||
// if running over 1000fps, act as if each frame is 1ms
|
||||
// prevents divisions by zero
|
||||
if ( frame_msec < 1 ) {
|
||||
frame_msec = 1;
|
||||
}
|
||||
|
||||
// if running less than 5fps, truncate the extra time to prevent
|
||||
// unexpected moves after a hitch
|
||||
if ( frame_msec > 200 ) {
|
||||
|
@ -818,8 +866,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" );
|
||||
}
|
||||
|
@ -909,6 +957,58 @@ void CL_WritePacket( void ) {
|
|||
count = MAX_PACKET_USERCMDS;
|
||||
Com_Printf("MAX_PACKET_USERCMDS\n");
|
||||
}
|
||||
|
||||
#ifdef USE_VOIP
|
||||
if (clc.voipOutgoingDataSize > 0)
|
||||
{
|
||||
if((clc.voipFlags & VOIP_SPATIAL) || Com_IsVoipTarget(clc.voipTargets, sizeof(clc.voipTargets), -1))
|
||||
{
|
||||
MSG_WriteByte (&buf, clc_voipOpus);
|
||||
MSG_WriteByte (&buf, clc.voipOutgoingGeneration);
|
||||
MSG_WriteLong (&buf, clc.voipOutgoingSequence);
|
||||
MSG_WriteByte (&buf, clc.voipOutgoingDataFrames);
|
||||
MSG_WriteData (&buf, clc.voipTargets, sizeof(clc.voipTargets));
|
||||
MSG_WriteByte(&buf, clc.voipFlags);
|
||||
MSG_WriteShort (&buf, clc.voipOutgoingDataSize);
|
||||
MSG_WriteData (&buf, clc.voipOutgoingData, clc.voipOutgoingDataSize);
|
||||
|
||||
// If we're recording a demo, we have to fake a server packet with
|
||||
// this VoIP data so it gets to disk; the server doesn't send it
|
||||
// back to us, and we might as well eliminate concerns about dropped
|
||||
// and misordered packets here.
|
||||
if(clc.demorecording && !clc.demowaiting)
|
||||
{
|
||||
const int voipSize = clc.voipOutgoingDataSize;
|
||||
msg_t fakemsg;
|
||||
byte fakedata[MAX_MSGLEN];
|
||||
MSG_Init (&fakemsg, fakedata, sizeof (fakedata));
|
||||
MSG_Bitstream (&fakemsg);
|
||||
MSG_WriteLong (&fakemsg, clc.reliableAcknowledge);
|
||||
MSG_WriteByte (&fakemsg, svc_voipOpus);
|
||||
MSG_WriteShort (&fakemsg, clc.clientNum);
|
||||
MSG_WriteByte (&fakemsg, clc.voipOutgoingGeneration);
|
||||
MSG_WriteLong (&fakemsg, clc.voipOutgoingSequence);
|
||||
MSG_WriteByte (&fakemsg, clc.voipOutgoingDataFrames);
|
||||
MSG_WriteShort (&fakemsg, clc.voipOutgoingDataSize );
|
||||
MSG_WriteBits (&fakemsg, clc.voipFlags, VOIP_FLAGCNT);
|
||||
MSG_WriteData (&fakemsg, clc.voipOutgoingData, voipSize);
|
||||
MSG_WriteByte (&fakemsg, svc_EOF);
|
||||
CL_WriteDemoMessage (&fakemsg, 0);
|
||||
}
|
||||
|
||||
clc.voipOutgoingSequence += clc.voipOutgoingDataFrames;
|
||||
clc.voipOutgoingDataSize = 0;
|
||||
clc.voipOutgoingDataFrames = 0;
|
||||
}
|
||||
else
|
||||
{
|
||||
// We have data, but no targets. Silently discard all data
|
||||
clc.voipOutgoingDataSize = 0;
|
||||
clc.voipOutgoingDataFrames = 0;
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
if ( count >= 1 ) {
|
||||
if ( cl_showSend->integer ) {
|
||||
Com_Printf( "(%i)", count );
|
||||
|
@ -965,16 +1065,6 @@ void CL_WritePacket( void ) {
|
|||
}
|
||||
|
||||
CL_Netchan_Transmit (&clc.netchan, &buf);
|
||||
|
||||
// clients never really should have messages large enough
|
||||
// to fragment, but in case they do, fire them all off
|
||||
// at once
|
||||
// TTimo: this causes a packet burst, which is bad karma for winsock
|
||||
// added a WARNING message, we'll see if there are legit situations where this happens
|
||||
while ( clc.netchan.unsentFragments ) {
|
||||
Com_DPrintf( "WARNING: #462 unsent fragments (not supposed to happen!)\n" );
|
||||
CL_Netchan_TransmitNextFragment( &clc.netchan );
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
|
@ -991,7 +1081,7 @@ void CL_SendCmd( void ) {
|
|||
}
|
||||
|
||||
// don't send commands if paused
|
||||
if ( com_sv_running->integer && paused->integer && paused->integer ) {
|
||||
if ( com_sv_running->integer && paused->integer ) {
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -1086,6 +1176,85 @@ void CL_InitInput( void ) {
|
|||
Cmd_AddCommand("+mlook", IN_MLookDown);
|
||||
Cmd_AddCommand("-mlook", IN_MLookUp);
|
||||
|
||||
#ifdef USE_VOIP
|
||||
Cmd_AddCommand ("+voiprecord", IN_VoipRecordDown);
|
||||
Cmd_AddCommand ("-voiprecord", IN_VoipRecordUp);
|
||||
#endif
|
||||
|
||||
cl_nodelta = Cvar_Get ("cl_nodelta", "0", 0);
|
||||
cl_debugMove = Cvar_Get ("cl_debugMove", "0", 0);
|
||||
}
|
||||
|
||||
/*
|
||||
============
|
||||
CL_ShutdownInput
|
||||
============
|
||||
*/
|
||||
void CL_ShutdownInput(void)
|
||||
{
|
||||
Cmd_RemoveCommand("centerview");
|
||||
|
||||
Cmd_RemoveCommand("+moveup");
|
||||
Cmd_RemoveCommand("-moveup");
|
||||
Cmd_RemoveCommand("+movedown");
|
||||
Cmd_RemoveCommand("-movedown");
|
||||
Cmd_RemoveCommand("+left");
|
||||
Cmd_RemoveCommand("-left");
|
||||
Cmd_RemoveCommand("+right");
|
||||
Cmd_RemoveCommand("-right");
|
||||
Cmd_RemoveCommand("+forward");
|
||||
Cmd_RemoveCommand("-forward");
|
||||
Cmd_RemoveCommand("+back");
|
||||
Cmd_RemoveCommand("-back");
|
||||
Cmd_RemoveCommand("+lookup");
|
||||
Cmd_RemoveCommand("-lookup");
|
||||
Cmd_RemoveCommand("+lookdown");
|
||||
Cmd_RemoveCommand("-lookdown");
|
||||
Cmd_RemoveCommand("+strafe");
|
||||
Cmd_RemoveCommand("-strafe");
|
||||
Cmd_RemoveCommand("+moveleft");
|
||||
Cmd_RemoveCommand("-moveleft");
|
||||
Cmd_RemoveCommand("+moveright");
|
||||
Cmd_RemoveCommand("-moveright");
|
||||
Cmd_RemoveCommand("+speed");
|
||||
Cmd_RemoveCommand("-speed");
|
||||
Cmd_RemoveCommand("+attack");
|
||||
Cmd_RemoveCommand("-attack");
|
||||
Cmd_RemoveCommand("+button0");
|
||||
Cmd_RemoveCommand("-button0");
|
||||
Cmd_RemoveCommand("+button1");
|
||||
Cmd_RemoveCommand("-button1");
|
||||
Cmd_RemoveCommand("+button2");
|
||||
Cmd_RemoveCommand("-button2");
|
||||
Cmd_RemoveCommand("+button3");
|
||||
Cmd_RemoveCommand("-button3");
|
||||
Cmd_RemoveCommand("+button4");
|
||||
Cmd_RemoveCommand("-button4");
|
||||
Cmd_RemoveCommand("+button5");
|
||||
Cmd_RemoveCommand("-button5");
|
||||
Cmd_RemoveCommand("+button6");
|
||||
Cmd_RemoveCommand("-button6");
|
||||
Cmd_RemoveCommand("+button7");
|
||||
Cmd_RemoveCommand("-button7");
|
||||
Cmd_RemoveCommand("+button8");
|
||||
Cmd_RemoveCommand("-button8");
|
||||
Cmd_RemoveCommand("+button9");
|
||||
Cmd_RemoveCommand("-button9");
|
||||
Cmd_RemoveCommand("+button10");
|
||||
Cmd_RemoveCommand("-button10");
|
||||
Cmd_RemoveCommand("+button11");
|
||||
Cmd_RemoveCommand("-button11");
|
||||
Cmd_RemoveCommand("+button12");
|
||||
Cmd_RemoveCommand("-button12");
|
||||
Cmd_RemoveCommand("+button13");
|
||||
Cmd_RemoveCommand("-button13");
|
||||
Cmd_RemoveCommand("+button14");
|
||||
Cmd_RemoveCommand("-button14");
|
||||
Cmd_RemoveCommand("+mlook");
|
||||
Cmd_RemoveCommand("-mlook");
|
||||
|
||||
#ifdef USE_VOIP
|
||||
Cmd_RemoveCommand("+voiprecord");
|
||||
Cmd_RemoveCommand("-voiprecord");
|
||||
#endif
|
||||
}
|
||||
|
|
640
code/client/cl_instantAction.cpp
Normal file
640
code/client/cl_instantAction.cpp
Normal file
|
@ -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_version->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_version->value) > 0.1f) {
|
||||
bDiffVersion = true;
|
||||
}
|
||||
}
|
||||
|
||||
if (bDiffVersion) {
|
||||
if (fGameVer - com_target_version->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;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
103
code/client/cl_instantAction.h
Normal file
103
code/client/cl_instantAction.h
Normal file
|
@ -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;
|
||||
};
|
File diff suppressed because it is too large
Load diff
|
@ -1,6 +1,6 @@
|
|||
/*
|
||||
===========================================================================
|
||||
Copyright (C) 2015 the OpenMoHAA team
|
||||
Copyright (C) 2023 the OpenMoHAA team
|
||||
|
||||
This file is part of OpenMoHAA source code.
|
||||
|
||||
|
@ -20,14 +20,33 @@ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
|||
===========================================================================
|
||||
*/
|
||||
|
||||
#ifndef __CL_INV_H__
|
||||
#define __CL_INV_H__
|
||||
#pragma once
|
||||
|
||||
typedef enum { INV_MOVE_NONE, INV_MOVE_BOB, INV_MOVE_SPIN } inv_move_type;
|
||||
typedef enum { INV_CASCADE_LEFT, INV_CASCADE_RIGHT } inv_cascade_type;
|
||||
typedef enum { INV_HUDANGLES_BASE, INV_HUDANGLES_COMPASS, INV_HUDANGLES_COMPASS_NEEDLE } inv_hudangles_type;
|
||||
typedef enum {
|
||||
INV_MOVE_NONE,
|
||||
INV_MOVE_BOB,
|
||||
INV_MOVE_SPIN
|
||||
} inv_move_type;
|
||||
|
||||
class item_properties_t : public Class {
|
||||
typedef enum {
|
||||
INV_ALIGN_NONE,
|
||||
INV_ALIGN_LEFT,
|
||||
INV_ALIGN_RIGHT
|
||||
} inv_align_type;
|
||||
|
||||
typedef enum {
|
||||
INV_CASCADE_LEFT,
|
||||
INV_CASCADE_RIGHT
|
||||
} inv_cascade_type;
|
||||
|
||||
typedef enum {
|
||||
INV_HUDANGLES_BASE,
|
||||
INV_HUDANGLES_COMPASS,
|
||||
INV_HUDANGLES_COMPASS_NEEDLE
|
||||
} inv_hudangles_type;
|
||||
|
||||
class item_properties_t : public Class
|
||||
{
|
||||
public:
|
||||
float scale;
|
||||
Vector angles;
|
||||
|
@ -39,7 +58,8 @@ public:
|
|||
str anim;
|
||||
};
|
||||
|
||||
class inventory_item_t : public Class {
|
||||
class inventory_item_t : public Class
|
||||
{
|
||||
public:
|
||||
str name;
|
||||
str ammoname;
|
||||
|
@ -65,7 +85,8 @@ public:
|
|||
UIReggedMaterial *selshader;
|
||||
};
|
||||
|
||||
class inventory_type_t {
|
||||
class inventory_type_t
|
||||
{
|
||||
public:
|
||||
str name;
|
||||
bool bg_tile;
|
||||
|
@ -75,16 +96,13 @@ public:
|
|||
UIReggedMaterial *selTexture;
|
||||
Container<inventory_item_t *> items;
|
||||
|
||||
int IndexOfItemPtr( inventory_item_t *item );
|
||||
int IndexOfItemPtr(inventory_item_t *item);
|
||||
};
|
||||
|
||||
inline
|
||||
int inventory_type_t::IndexOfItemPtr( inventory_item_t *item )
|
||||
inline int inventory_type_t::IndexOfItemPtr(inventory_item_t *item)
|
||||
{
|
||||
for( int i = items.NumObjects(); i > 0; i-- )
|
||||
{
|
||||
if( items.ObjectAt( i ) == item )
|
||||
{
|
||||
for (int i = items.NumObjects(); i > 0; i--) {
|
||||
if (items.ObjectAt(i) == item) {
|
||||
return i;
|
||||
}
|
||||
}
|
||||
|
@ -92,23 +110,30 @@ int inventory_type_t::IndexOfItemPtr( inventory_item_t *item )
|
|||
return 0;
|
||||
}
|
||||
|
||||
class inventory_t {
|
||||
class inventory_t
|
||||
{
|
||||
public:
|
||||
int typewidth;
|
||||
int typeheight;
|
||||
int horizoffset;
|
||||
int vertoffset;
|
||||
int align;
|
||||
inv_align_type align;
|
||||
inv_cascade_type cascade;
|
||||
str selectsound;
|
||||
str rejectsound;
|
||||
str changesound;
|
||||
Container<inventory_type_t *> types;
|
||||
|
||||
void Clear() { types.ClearObjectList(); }
|
||||
public:
|
||||
inventory_t();
|
||||
~inventory_t();
|
||||
inventory_t(const inventory_t& other);
|
||||
inventory_t& operator=(const inventory_t& other);
|
||||
void Clear();
|
||||
};
|
||||
|
||||
class invlistener : public Listener {
|
||||
class invlistener : public Listener
|
||||
{
|
||||
protected:
|
||||
inventory_t *inv;
|
||||
inventory_type_t *curtype;
|
||||
|
@ -121,74 +146,72 @@ protected:
|
|||
int defaultBarOffsetY;
|
||||
|
||||
public:
|
||||
CLASS_PROTOTYPE( invlistener );
|
||||
CLASS_PROTOTYPE(invlistener);
|
||||
|
||||
protected:
|
||||
void verify_curitem( void );
|
||||
void verify_curtype( void );
|
||||
void verify_one_arg( Event *ev );
|
||||
void verify_curitem(void);
|
||||
void verify_curtype(void);
|
||||
void verify_one_arg(Event *ev);
|
||||
|
||||
public:
|
||||
invlistener( inventory_t *i );
|
||||
invlistener(inventory_t *i);
|
||||
invlistener();
|
||||
|
||||
bool Load( Script& script );
|
||||
void InvSelectSound( Event *ev );
|
||||
void InvRejectSound( Event *ev );
|
||||
void InvChangeSound( Event *ev );
|
||||
void InvWidth( Event *ev );
|
||||
void InvHeight( Event *ev );
|
||||
void InvHorizOffset( Event *ev );
|
||||
void InvVertOffset( Event *ev );
|
||||
void InvAlign( Event *ev );
|
||||
void InvCascade( Event *ev );
|
||||
void Typedef( Event *ev );
|
||||
void OpenBrace( Event *ev );
|
||||
void CloseBrace( Event *ev );
|
||||
void ButtonShader( Event *ev );
|
||||
void HoverShader( Event *ev );
|
||||
void SelShader( Event *ev );
|
||||
void Background( Event *ev );
|
||||
void BackgroundTile( Event *ev );
|
||||
void Width( Event *ev );
|
||||
void Height( Event *ev );
|
||||
void BarWidth( Event *ev );
|
||||
void BarHeight( Event *ev );
|
||||
void BarOffsetX( Event *ev );
|
||||
void BarOffsetY( Event *ev );
|
||||
void Item( Event *ev );
|
||||
void Ammo( Event *ev );
|
||||
void Equip( Event *ev );
|
||||
void CheckAmmo( Event *ev );
|
||||
void Command( Event *ev );
|
||||
void BGShader( Event *ev );
|
||||
void BarShader( Event *ev );
|
||||
void SelItemShader( Event *ev );
|
||||
void SelItemShaderOnTop( Event *ev );
|
||||
void RotateOffset( Event *ev );
|
||||
void Offset( Event *ev );
|
||||
void Model( Event *ev );
|
||||
void Anim( Event *ev );
|
||||
void Scale( Event *ev );
|
||||
void Angles( Event *ev );
|
||||
void AngleDeltas( Event *ev );
|
||||
void Move( Event *ev );
|
||||
void ModelWindow( Event *ev );
|
||||
void HudRotateOffset( Event *ev );
|
||||
void HudOffset( Event *ev );
|
||||
void HudModel( Event *ev );
|
||||
void HudAnim( Event *ev );
|
||||
void HudScale( Event *ev );
|
||||
void HudAngles( Event *ev );
|
||||
void HudAngleDeltas( Event *ev );
|
||||
void HudMove( Event *ev );
|
||||
void HudCompassAngles( Event *ev );
|
||||
void HudCompassNeedleAngles( Event *ev );
|
||||
bool Load(Script& script);
|
||||
void InvSelectSound(Event *ev);
|
||||
void InvRejectSound(Event *ev);
|
||||
void InvChangeSound(Event *ev);
|
||||
void InvWidth(Event *ev);
|
||||
void InvHeight(Event *ev);
|
||||
void InvHorizOffset(Event *ev);
|
||||
void InvVertOffset(Event *ev);
|
||||
void InvAlign(Event *ev);
|
||||
void InvCascade(Event *ev);
|
||||
void Typedef(Event *ev);
|
||||
void OpenBrace(Event *ev);
|
||||
void CloseBrace(Event *ev);
|
||||
void ButtonShader(Event *ev);
|
||||
void HoverShader(Event *ev);
|
||||
void SelShader(Event *ev);
|
||||
void Background(Event *ev);
|
||||
void BackgroundTile(Event *ev);
|
||||
void Width(Event *ev);
|
||||
void Height(Event *ev);
|
||||
void BarWidth(Event *ev);
|
||||
void BarHeight(Event *ev);
|
||||
void BarOffsetX(Event *ev);
|
||||
void BarOffsetY(Event *ev);
|
||||
void Item(Event *ev);
|
||||
void Ammo(Event *ev);
|
||||
void Equip(Event *ev);
|
||||
void CheckAmmo(Event *ev);
|
||||
void Command(Event *ev);
|
||||
void BGShader(Event *ev);
|
||||
void BarShader(Event *ev);
|
||||
void SelItemShader(Event *ev);
|
||||
void SelItemShaderOnTop(Event *ev);
|
||||
void RotateOffset(Event *ev);
|
||||
void Offset(Event *ev);
|
||||
void Model(Event *ev);
|
||||
void Anim(Event *ev);
|
||||
void Scale(Event *ev);
|
||||
void Angles(Event *ev);
|
||||
void AngleDeltas(Event *ev);
|
||||
void Move(Event *ev);
|
||||
void ModelWindow(Event *ev);
|
||||
void HudRotateOffset(Event *ev);
|
||||
void HudOffset(Event *ev);
|
||||
void HudModel(Event *ev);
|
||||
void HudAnim(Event *ev);
|
||||
void HudScale(Event *ev);
|
||||
void HudAngles(Event *ev);
|
||||
void HudAngleDeltas(Event *ev);
|
||||
void HudMove(Event *ev);
|
||||
void HudCompassAngles(Event *ev);
|
||||
void HudCompassNeedleAngles(Event *ev);
|
||||
};
|
||||
|
||||
bool CL_LoadInventory( const char *filename, inventory_t *inv );
|
||||
inventory_item_t *CL_GetInvItemByName( inventory_t *inv, const char *name );
|
||||
qboolean CL_HasInventoryItem( const char *name );
|
||||
void CL_AmmoCount( const char *name, int *ammo_count, int *max_ammo_count );
|
||||
|
||||
#endif // __CL_INV_H__
|
||||
bool CL_LoadInventory(const char *filename, inventory_t *inv);
|
||||
inventory_item_t *CL_GetInvItemByName(inventory_t *inv, const char *name);
|
||||
qboolean CL_HasInventoryItem(const char *name);
|
||||
void CL_AmmoCount(const char *name, int *ammo_count, int *max_ammo_count);
|
||||
|
|
File diff suppressed because it is too large
Load diff
|
@ -1,6 +1,6 @@
|
|||
/*
|
||||
===========================================================================
|
||||
Copyright (C) 2015 the OpenMoHAA team
|
||||
Copyright (C) 2023 the OpenMoHAA team
|
||||
|
||||
This file is part of OpenMoHAA source code.
|
||||
|
||||
|
@ -20,44 +20,52 @@ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
|||
===========================================================================
|
||||
*/
|
||||
|
||||
#ifndef __CL_INVRENDER_H__
|
||||
#define __CL_INVRENDER_H__
|
||||
#pragma once
|
||||
|
||||
class FakkInventory;
|
||||
|
||||
typedef enum { selectsound, rejectsound, changesound } invsound_t;
|
||||
class FakkItemList : public UIWidget {
|
||||
typedef enum {
|
||||
selectsound,
|
||||
rejectsound,
|
||||
changesound
|
||||
} invsound_t;
|
||||
|
||||
class FakkItemList : public UIWidget
|
||||
{
|
||||
protected:
|
||||
inventory_type_t *type;
|
||||
uipopup_describe m_describe[ 10 ];
|
||||
uipopup_describe m_describe[10];
|
||||
inventory_item_t *m_hoveritem;
|
||||
inventory_item_t *m_lastmenuitem;
|
||||
FakkInventory *m_parent;
|
||||
float m_hovertop;
|
||||
|
||||
public:
|
||||
CLASS_PROTOTYPE( FakkItemList );
|
||||
CLASS_PROTOTYPE(FakkItemList);
|
||||
|
||||
FakkItemList();
|
||||
~FakkItemList();
|
||||
|
||||
void VerifyItemUp( inventory_item_t *item, qboolean warpmouse );
|
||||
void setType( inventory_type_t *t );
|
||||
void Create( float x, float y, FakkInventory *parent );
|
||||
bool HasAnyItems( void );
|
||||
void Draw( void ) override;
|
||||
void OnLeftMouseDown( Event *ev );
|
||||
void OnRightMouseDown( Event *ev );
|
||||
void OnLeftMouseUp( Event *ev );
|
||||
void OnRightMouseUp( Event *ev );
|
||||
void OnMouseMove( Event *ev );
|
||||
void OnMouseEnter( Event *ev );
|
||||
void OnMouseLeave( Event *ev );
|
||||
void OnMenuKilled( Event *ev );
|
||||
void EquipItem( Event *ev );
|
||||
void VerifyItemUp(inventory_item_t *item, qboolean warpmouse);
|
||||
void setType(inventory_type_t *t);
|
||||
void Create(float x, float y, FakkInventory *parent);
|
||||
bool HasAnyItems(void);
|
||||
void Draw(void) override;
|
||||
void OnLeftMouseDown(Event *ev);
|
||||
void OnRightMouseDown(Event *ev);
|
||||
void OnLeftMouseUp(Event *ev);
|
||||
void OnRightMouseUp(Event *ev);
|
||||
void OnMouseMove(Event *ev);
|
||||
void OnMouseEnter(Event *ev);
|
||||
void OnMouseLeave(Event *ev);
|
||||
void OnMenuKilled(Event *ev);
|
||||
void EquipItem(Event *ev);
|
||||
|
||||
inventory_item_t *getHoverItem() const;
|
||||
};
|
||||
|
||||
class FakkInventory : public UIWidget {
|
||||
class FakkInventory : public UIWidget
|
||||
{
|
||||
protected:
|
||||
inventory_t *m_inv;
|
||||
SafePtr<FakkItemList> m_currentlist;
|
||||
|
@ -65,34 +73,49 @@ protected:
|
|||
int m_currentitemnum;
|
||||
|
||||
public:
|
||||
CLASS_PROTOTYPE( FakkInventory );
|
||||
CLASS_PROTOTYPE(FakkInventory);
|
||||
|
||||
public:
|
||||
qboolean m_mouse_active;
|
||||
|
||||
protected:
|
||||
void VerifyItemUp( inventory_item_t *item, qboolean warpmouse );
|
||||
void VerifyTypeUp(inventory_type_t *t, qboolean warpmouse);
|
||||
|
||||
public:
|
||||
FakkInventory();
|
||||
~FakkInventory();
|
||||
|
||||
void setInventory( inventory_t *i );
|
||||
void Draw( void ) override;
|
||||
void OnMouseMove( Event *ev );
|
||||
void OnMouseLeave( Event *ev );
|
||||
void OnMouseEnter( Event *ev );
|
||||
void OnMouseDown( Event *ev );
|
||||
void WarpTo( const char *name );
|
||||
void WarpTo( int slotnum );
|
||||
void NextItem( void );
|
||||
void PrevItem( void );
|
||||
qboolean isDying( void );
|
||||
qboolean KeyEvent( int key, unsigned int time ) override;
|
||||
void PlaySound( invsound_t type );
|
||||
void Timeout( Event *ev );
|
||||
void ChangeItem( int sign );
|
||||
int FindFirstItem( int itemindex, int sign );
|
||||
void setInventory(inventory_t *i);
|
||||
void Draw(void) override;
|
||||
void OnMouseMove(Event *ev);
|
||||
void OnMouseLeave(Event *ev);
|
||||
void OnMouseEnter(Event *ev);
|
||||
void OnMouseDown(Event *ev);
|
||||
void WarpTo(const char *name);
|
||||
void WarpTo(int slotnum);
|
||||
void NextItem(void);
|
||||
void PrevItem(void);
|
||||
qboolean isDying(void);
|
||||
qboolean KeyEvent(int key, unsigned int time) override;
|
||||
void PlaySound(invsound_t type);
|
||||
void Timeout(Event *ev);
|
||||
void ChangeItem(int sign);
|
||||
int FindFirstItem(int itemindex, int sign);
|
||||
};
|
||||
|
||||
void CL_Draw3DModel( float x, float y, float w, float h, qhandle_t model, vec3_t origin, vec3_t rotateoffset, vec3_t offset, vec3_t angle, vec3_t color, str anim );
|
||||
qboolean UI_CloseInventory( void );
|
||||
void CL_Draw3DModel(
|
||||
float x,
|
||||
float y,
|
||||
float w,
|
||||
float h,
|
||||
qhandle_t model,
|
||||
vec3_t origin,
|
||||
vec3_t rotateoffset,
|
||||
vec3_t offset,
|
||||
vec3_t angle,
|
||||
vec3_t color,
|
||||
str anim
|
||||
);
|
||||
|
||||
#endif // __CL_INVRENDER_H__
|
||||
void UI_DoInventory(qboolean activate_mouse);
|
||||
qboolean UI_CloseInventory(void);
|
||||
|
|
File diff suppressed because it is too large
Load diff
File diff suppressed because it is too large
Load diff
|
@ -132,7 +132,7 @@ CL_Netchan_TransmitNextFragment
|
|||
=================
|
||||
*/
|
||||
void CL_Netchan_TransmitNextFragment( netchan_t *chan ) {
|
||||
Netchan_TransmitNextFragment( chan );
|
||||
Netchan_TransmitNextFragment( chan, cl_netprofile->integer ? &cls.netprofile.inPackets : NULL );
|
||||
}
|
||||
|
||||
/*
|
||||
|
@ -144,7 +144,7 @@ void CL_Netchan_Transmit( netchan_t *chan, msg_t* msg ) {
|
|||
MSG_WriteByte( msg, clc_EOF );
|
||||
|
||||
CL_Netchan_Encode( msg );
|
||||
Netchan_Transmit( chan, msg->cursize, msg->data );
|
||||
Netchan_Transmit( chan, msg->cursize, msg->data, cl_netprofile->integer ? &cls.netprofile.inPackets : NULL );
|
||||
}
|
||||
|
||||
extern int oldsize;
|
||||
|
@ -158,10 +158,30 @@ CL_Netchan_Process
|
|||
qboolean CL_Netchan_Process( netchan_t *chan, msg_t *msg ) {
|
||||
int ret;
|
||||
|
||||
ret = Netchan_Process( chan, msg );
|
||||
ret = Netchan_Process( chan, msg, cl_netprofile->integer ? &cls.netprofile.outPackets : NULL );
|
||||
if (!ret)
|
||||
return qfalse;
|
||||
CL_Netchan_Decode( msg );
|
||||
newsize += msg->cursize;
|
||||
return qtrue;
|
||||
}
|
||||
|
||||
/*
|
||||
=================
|
||||
CL_NET_OutOfBandPrint
|
||||
=================
|
||||
*/
|
||||
void CL_NET_OutOfBandPrint(netadr_t adr, const char* format, ...) {
|
||||
va_list argptr;
|
||||
char string[MAX_MSGLEN];
|
||||
|
||||
va_start(argptr, format);
|
||||
Q_vsnprintf(string, sizeof(string), format, argptr);
|
||||
va_end(argptr);
|
||||
|
||||
NET_OutOfBandPrint(NS_CLIENT, adr, "%s", string);
|
||||
|
||||
if (cl_netprofile->integer) {
|
||||
NetProfileAddPacket(&cls.netprofile.inPackets, strlen(string), NETPROF_PACKET_MESSAGE);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -223,13 +223,13 @@ qboolean CL_UnpackNonPVSClient(int* packed, radarUnpacked_t* unpacked) {
|
|||
range = 0;
|
||||
}
|
||||
|
||||
unpacked->x = x * range / 63.f;
|
||||
unpacked->y = y * range / 63.f;
|
||||
unpacked->x = x * range / (MAX_CLIENTS - 1);
|
||||
unpacked->y = y * range / (MAX_CLIENTS - 1);
|
||||
|
||||
if (!bValid)
|
||||
{
|
||||
unpacked->x = x * range / 63.f * 1024;
|
||||
unpacked->y = y * range / 63.f * 1024;
|
||||
unpacked->x = x * range / (MAX_CLIENTS - 1) * 1024.0;
|
||||
unpacked->y = y * range / (MAX_CLIENTS - 1) * 1024.0;
|
||||
}
|
||||
|
||||
unpacked->yaw = yaw * 11.25f;
|
||||
|
@ -429,12 +429,24 @@ void CL_SystemInfoChanged( void ) {
|
|||
// in some cases, outdated cp commands might get sent with this news serverId
|
||||
cl.serverId = atoi( Info_ValueForKey( systemInfo, "sv_serverid" ) );
|
||||
|
||||
#ifdef USE_VOIP
|
||||
#ifdef LEGACY_PROTOCOL
|
||||
if(clc.compat)
|
||||
clc.voipEnabled = qfalse;
|
||||
else
|
||||
#endif
|
||||
{
|
||||
s = Info_ValueForKey( systemInfo, "sv_voipProtocol" );
|
||||
clc.voipEnabled = !Q_stricmp(s, "opus");
|
||||
}
|
||||
#endif
|
||||
|
||||
// don't set any vars when playing a demo
|
||||
if ( clc.demoplaying ) {
|
||||
return;
|
||||
}
|
||||
|
||||
s = Info_ValueForKey( systemInfo, "sv_cheats" );
|
||||
s = Info_ValueForKey( systemInfo, "cheats" );
|
||||
cl_connectedToCheatServer = atoi( s );
|
||||
if ( !cl_connectedToCheatServer ) {
|
||||
Cvar_SetCheatState();
|
||||
|
@ -556,6 +568,7 @@ void CL_ParseGamestate( msg_t *msg ) {
|
|||
csNum = CPT_NormalizeConfigstring(i);
|
||||
if (csNum < 0 || csNum >= MAX_CONFIGSTRINGS) {
|
||||
Com_Error(ERR_DROP, "configstring > MAX_CONFIGSTRINGS");
|
||||
return;
|
||||
}
|
||||
s = MSG_ReadScrambledBigString(msg);
|
||||
len = strlen(s);
|
||||
|
@ -576,8 +589,7 @@ void CL_ParseGamestate( msg_t *msg ) {
|
|||
//Com_Memset (&nullstate, 0, sizeof(nullstate));
|
||||
MSG_GetNullEntityState(&nullstate);
|
||||
es = &cl.entityBaselines[ newnum ];
|
||||
// FIXME: frametime
|
||||
MSG_ReadDeltaEntity( msg, &nullstate, es, newnum, 0.0);
|
||||
MSG_ReadDeltaEntity( msg, &nullstate, es, newnum, cls.serverFrameTime);
|
||||
} else {
|
||||
Com_Error( ERR_DROP, "CL_ParseGamestate: bad command byte %i", cmd );
|
||||
}
|
||||
|
@ -595,15 +607,24 @@ void CL_ParseGamestate( msg_t *msg ) {
|
|||
if(cl_autoRecordDemo->integer && clc.demorecording)
|
||||
CL_StopRecord_f();
|
||||
|
||||
if (clc.state == CA_CONNECTED && !Cvar_Get("sv_paks", "", 0)->string[0]) {
|
||||
// Added in 2.30
|
||||
FS_Restart(clc.checksumFeed);
|
||||
} else {
|
||||
// reinitialize the filesystem if the game directory has changed
|
||||
FS_ConditionalRestart( clc.checksumFeed, qfalse );
|
||||
FS_ConditionalRestart(clc.checksumFeed, qfalse);
|
||||
}
|
||||
|
||||
clc.state = CA_LOADING;
|
||||
if (!com_sv_running->integer)
|
||||
{
|
||||
const char *info = cl.gameState.stringData + cl.gameState.stringOffsets[CS_SERVERINFO];
|
||||
const char *mapname = Info_ValueForKey(info, "mapname");
|
||||
// Added in 2.0
|
||||
Cvar_Set("mapname", mapname);
|
||||
|
||||
UI_ClearState();
|
||||
UI_BeginLoad(Info_ValueForKey(info, "mapname"));
|
||||
UI_BeginLoad(mapname);
|
||||
}
|
||||
|
||||
// This used to call CL_StartHunkUsers, but now we enter the download state before loading the
|
||||
|
@ -784,6 +805,178 @@ void CL_ParseDownload ( msg_t *msg ) {
|
|||
}
|
||||
}
|
||||
|
||||
#ifdef USE_VOIP
|
||||
static
|
||||
qboolean CL_ShouldIgnoreVoipSender(int sender)
|
||||
{
|
||||
if (!cl_voip->integer)
|
||||
return qtrue; // VoIP is disabled.
|
||||
else if ((sender == clc.clientNum) && (!clc.demoplaying))
|
||||
return qtrue; // ignore own voice (unless playing back a demo).
|
||||
else if (clc.voipMuteAll)
|
||||
return qtrue; // all channels are muted with extreme prejudice.
|
||||
else if (clc.voipIgnore[sender])
|
||||
return qtrue; // just ignoring this guy.
|
||||
else if (clc.voipGain[sender] == 0.0f)
|
||||
return qtrue; // too quiet to play.
|
||||
|
||||
return qfalse;
|
||||
}
|
||||
|
||||
/*
|
||||
=====================
|
||||
CL_PlayVoip
|
||||
|
||||
Play raw data
|
||||
=====================
|
||||
*/
|
||||
|
||||
static void CL_PlayVoip(int sender, int samplecnt, const byte *data, int flags)
|
||||
{
|
||||
if(flags & VOIP_DIRECT)
|
||||
{
|
||||
S_RawSamples(sender + 1, samplecnt, 48000, 2, 1,
|
||||
data, clc.voipGain[sender], -1);
|
||||
}
|
||||
|
||||
if(flags & VOIP_SPATIAL)
|
||||
{
|
||||
S_RawSamples(sender + MAX_CLIENTS + 1, samplecnt, 48000, 2, 1,
|
||||
data, 1.0f, sender);
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
=====================
|
||||
CL_ParseVoip
|
||||
|
||||
A VoIP message has been received from the server
|
||||
=====================
|
||||
*/
|
||||
static
|
||||
void CL_ParseVoip ( msg_t *msg, qboolean ignoreData ) {
|
||||
static short decoded[VOIP_MAX_PACKET_SAMPLES*4]; // !!! FIXME: don't hard code
|
||||
|
||||
const int sender = MSG_ReadShort(msg);
|
||||
const int generation = MSG_ReadByte(msg);
|
||||
const int sequence = MSG_ReadLong(msg);
|
||||
const int frames = MSG_ReadByte(msg);
|
||||
const int packetsize = MSG_ReadShort(msg);
|
||||
const int flags = MSG_ReadBits(msg, VOIP_FLAGCNT);
|
||||
unsigned char encoded[4000];
|
||||
int numSamples;
|
||||
int seqdiff;
|
||||
int written = 0;
|
||||
int i;
|
||||
|
||||
Com_DPrintf("VoIP: %d-byte packet from client %d\n", packetsize, sender);
|
||||
|
||||
if (sender < 0)
|
||||
return; // short/invalid packet, bail.
|
||||
else if (generation < 0)
|
||||
return; // short/invalid packet, bail.
|
||||
else if (sequence < 0)
|
||||
return; // short/invalid packet, bail.
|
||||
else if (frames < 0)
|
||||
return; // short/invalid packet, bail.
|
||||
else if (packetsize < 0)
|
||||
return; // short/invalid packet, bail.
|
||||
|
||||
if (packetsize > sizeof (encoded)) { // overlarge packet?
|
||||
int bytesleft = packetsize;
|
||||
while (bytesleft) {
|
||||
int br = bytesleft;
|
||||
if (br > sizeof (encoded))
|
||||
br = sizeof (encoded);
|
||||
MSG_ReadData(msg, encoded, br);
|
||||
bytesleft -= br;
|
||||
}
|
||||
return; // overlarge packet, bail.
|
||||
}
|
||||
|
||||
MSG_ReadData(msg, encoded, packetsize);
|
||||
|
||||
if (ignoreData) {
|
||||
return; // just ignore legacy speex voip data
|
||||
} else if (!clc.voipCodecInitialized) {
|
||||
return; // can't handle VoIP without libopus!
|
||||
} else if (sender >= MAX_CLIENTS) {
|
||||
return; // bogus sender.
|
||||
} else if (CL_ShouldIgnoreVoipSender(sender)) {
|
||||
return; // Channel is muted, bail.
|
||||
}
|
||||
|
||||
// !!! FIXME: make sure data is narrowband? Does decoder handle this?
|
||||
|
||||
Com_DPrintf("VoIP: packet accepted!\n");
|
||||
|
||||
seqdiff = sequence - clc.voipIncomingSequence[sender];
|
||||
|
||||
// This is a new "generation" ... a new recording started, reset the bits.
|
||||
if (generation != clc.voipIncomingGeneration[sender]) {
|
||||
Com_DPrintf("VoIP: new generation %d!\n", generation);
|
||||
opus_decoder_ctl(clc.opusDecoder[sender], OPUS_RESET_STATE);
|
||||
clc.voipIncomingGeneration[sender] = generation;
|
||||
seqdiff = 0;
|
||||
} else if (seqdiff < 0) { // we're ahead of the sequence?!
|
||||
// This shouldn't happen unless the packet is corrupted or something.
|
||||
Com_DPrintf("VoIP: misordered sequence! %d < %d!\n",
|
||||
sequence, clc.voipIncomingSequence[sender]);
|
||||
// reset the decoder just in case.
|
||||
opus_decoder_ctl(clc.opusDecoder[sender], OPUS_RESET_STATE);
|
||||
seqdiff = 0;
|
||||
} else if (seqdiff * VOIP_MAX_PACKET_SAMPLES*2 >= sizeof (decoded)) { // dropped more than we can handle?
|
||||
// just start over.
|
||||
Com_DPrintf("VoIP: Dropped way too many (%d) frames from client #%d\n",
|
||||
seqdiff, sender);
|
||||
opus_decoder_ctl(clc.opusDecoder[sender], OPUS_RESET_STATE);
|
||||
seqdiff = 0;
|
||||
}
|
||||
|
||||
if (seqdiff != 0) {
|
||||
Com_DPrintf("VoIP: Dropped %d frames from client #%d\n",
|
||||
seqdiff, sender);
|
||||
// tell opus that we're missing frames...
|
||||
for (i = 0; i < seqdiff; i++) {
|
||||
assert((written + VOIP_MAX_PACKET_SAMPLES) * 2 < sizeof (decoded));
|
||||
numSamples = opus_decode(clc.opusDecoder[sender], NULL, 0, decoded + written, VOIP_MAX_PACKET_SAMPLES, 0);
|
||||
if ( numSamples <= 0 ) {
|
||||
Com_DPrintf("VoIP: Error decoding frame %d from client #%d\n", i, sender);
|
||||
continue;
|
||||
}
|
||||
written += numSamples;
|
||||
}
|
||||
}
|
||||
|
||||
numSamples = opus_decode(clc.opusDecoder[sender], encoded, packetsize, decoded + written, ARRAY_LEN(decoded) - written, 0);
|
||||
|
||||
if ( numSamples <= 0 ) {
|
||||
Com_DPrintf("VoIP: Error decoding voip data from client #%d\n", sender);
|
||||
numSamples = 0;
|
||||
}
|
||||
|
||||
#if 0
|
||||
static FILE *encio = NULL;
|
||||
if (encio == NULL) encio = fopen("voip-incoming-encoded.bin", "wb");
|
||||
if (encio != NULL) { fwrite(encoded, packetsize, 1, encio); fflush(encio); }
|
||||
static FILE *decio = NULL;
|
||||
if (decio == NULL) decio = fopen("voip-incoming-decoded.bin", "wb");
|
||||
if (decio != NULL) { fwrite(decoded+written, numSamples*2, 1, decio); fflush(decio); }
|
||||
#endif
|
||||
|
||||
written += numSamples;
|
||||
|
||||
Com_DPrintf("VoIP: playback %d bytes, %d samples, %d frames\n",
|
||||
written * 2, written, frames);
|
||||
|
||||
if(written > 0)
|
||||
CL_PlayVoip(sender, written, (const byte *) decoded, flags);
|
||||
|
||||
clc.voipIncomingSequence[sender] = sequence + frames;
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
/*
|
||||
=====================
|
||||
CL_ParseCommandString
|
||||
|
@ -932,8 +1125,16 @@ void CL_ParseServerMessage( msg_t *msg ) {
|
|||
}
|
||||
CL_ParseCGMessage( msg );
|
||||
break;
|
||||
case svc_voipSpeex:
|
||||
#ifdef USE_VOIP
|
||||
CL_ParseVoip( msg, qtrue );
|
||||
#endif
|
||||
break;
|
||||
case svc_voipOpus:
|
||||
#ifdef USE_VOIP
|
||||
CL_ParseVoip( msg, !clc.voipEnabled );
|
||||
#endif
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -343,7 +343,7 @@ void SCR_DrawDemoRecording( void ) {
|
|||
}
|
||||
|
||||
pos = FS_FTell( clc.demofile );
|
||||
sprintf( string, "RECORDING %s: %ik", clc.demoName, pos / 1024 );
|
||||
Com_sprintf( string, sizeof( string ), "RECORDING %s: %ik", clc.demoName, pos / 1024 );
|
||||
|
||||
SCR_DrawStringExt( 320 - strlen( string ) * 4, 20, 8, string, g_color_table[7], qtrue, qfalse );
|
||||
}
|
||||
|
@ -520,16 +520,18 @@ text to the screen.
|
|||
==================
|
||||
*/
|
||||
void SCR_UpdateScreen( void ) {
|
||||
static int recursive;
|
||||
static qboolean screen_recursive;
|
||||
|
||||
if ( !scr_initialized ) {
|
||||
return; // not initialized yet
|
||||
}
|
||||
|
||||
if ( ++recursive > 2 ) {
|
||||
Com_Error( ERR_FATAL, "SCR_UpdateScreen: recursively called" );
|
||||
if (screen_recursive) {
|
||||
// already called
|
||||
return;
|
||||
}
|
||||
recursive = 1;
|
||||
|
||||
screen_recursive = qtrue;
|
||||
|
||||
CL_StartHunkUsers(qfalse);
|
||||
SCR_SimpleUpdateScreen();
|
||||
|
@ -553,6 +555,6 @@ void SCR_UpdateScreen( void ) {
|
|||
}
|
||||
}
|
||||
|
||||
recursive = 0;
|
||||
screen_recursive = qfalse;
|
||||
}
|
||||
|
||||
|
|
File diff suppressed because it is too large
Load diff
|
@ -1,6 +1,6 @@
|
|||
/*
|
||||
===========================================================================
|
||||
Copyright (C) 2023 the OpenMoHAA team
|
||||
Copyright (C) 2023-2024 the OpenMoHAA team
|
||||
|
||||
This file is part of OpenMoHAA source code.
|
||||
|
||||
|
@ -35,6 +35,7 @@ typedef struct {
|
|||
extern cvar_t *ui_health_start;
|
||||
extern cvar_t *ui_health_end;
|
||||
extern cvar_t *sound_overlay;
|
||||
extern cvar_t *cl_movieaudio;
|
||||
|
||||
//
|
||||
// initialization
|
||||
|
@ -49,11 +50,17 @@ void CL_ShutdownUI(void);
|
|||
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);
|
||||
void CL_BeginRegistration(void);
|
||||
void CL_EndRegistration(void);
|
||||
float UI_GetObjectivesTop(void);
|
||||
void UI_GetHighResolutionScale(vec2_t scale);
|
||||
|
||||
//
|
||||
// menu
|
||||
|
@ -110,6 +117,7 @@ void UI_DeleteScoreBoardItems(int iMaxIndex);
|
|||
void UI_BeginLoad(const char *pszMapName);
|
||||
void UI_EndLoad(void);
|
||||
void UI_AbortLoad(void);
|
||||
int CL_FontStringWidth(fontheader_t* pFont, const char* pszString, int iMaxLen);
|
||||
void UI_BeginLoadResource(void);
|
||||
void UI_EndLoadResource(void);
|
||||
void UI_EndLoadResource(const char *name);
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
/*
|
||||
===========================================================================
|
||||
Copyright (C) 2015 the OpenMoHAA team
|
||||
Copyright (C) 2023 the OpenMoHAA team
|
||||
|
||||
This file is part of OpenMoHAA source code.
|
||||
|
||||
|
@ -24,7 +24,20 @@ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
|||
|
||||
bind_t::bind_t()
|
||||
{
|
||||
// FIXME: stub
|
||||
int i;
|
||||
|
||||
commandwidth = 100;
|
||||
commandheight = 20;
|
||||
primarykeywidth = 100;
|
||||
primarykeyheight = 20;
|
||||
alternatekeywidth = 100;
|
||||
alternatekeyheight = 20;
|
||||
fillwidth = 16;
|
||||
fillmaterial = NULL;
|
||||
|
||||
for (i = 0; i < ARRAY_LEN(headermats); i++) {
|
||||
headermats[i] = NULL;
|
||||
}
|
||||
}
|
||||
|
||||
bind_t::~bind_t()
|
||||
|
@ -32,273 +45,508 @@ bind_t::~bind_t()
|
|||
Clear();
|
||||
}
|
||||
|
||||
void bind_t::Clear
|
||||
(
|
||||
void
|
||||
)
|
||||
|
||||
void bind_t::Clear(void)
|
||||
{
|
||||
// FIXME: stub
|
||||
for (int i = binds.NumObjects(); i > 0; i--) {
|
||||
bind_item_t *bi;
|
||||
|
||||
bi = binds.ObjectAt(i);
|
||||
binds.RemoveObjectAt(i);
|
||||
|
||||
if (bi) {
|
||||
delete bi;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
CLASS_DECLARATION( Listener, bindlistener, NULL )
|
||||
{
|
||||
{ NULL, NULL }
|
||||
Event EV_Bind_Header
|
||||
(
|
||||
"header",
|
||||
EV_DEFAULT,
|
||||
"iss",
|
||||
"column_num name material",
|
||||
"Set the header of each column"
|
||||
);
|
||||
Event EV_Bind_Width
|
||||
(
|
||||
"bind_width",
|
||||
EV_DEFAULT,
|
||||
"i",
|
||||
"width",
|
||||
"Width of the bind menu"
|
||||
);
|
||||
Event EV_Bind_Height
|
||||
(
|
||||
"bind_height",
|
||||
EV_DEFAULT,
|
||||
"i",
|
||||
"height",
|
||||
"Height of the bind menu"
|
||||
);
|
||||
Event EV_Bind_FillWidth
|
||||
(
|
||||
"bind_fillwidth",
|
||||
EV_DEFAULT,
|
||||
"iS",
|
||||
"width material",
|
||||
"Width of the filling between widgets"
|
||||
);
|
||||
Event EV_Bind_CommandWidth
|
||||
(
|
||||
"bind_commandwidth",
|
||||
EV_DEFAULT,
|
||||
"i",
|
||||
"width",
|
||||
"Width of the command item"
|
||||
);
|
||||
Event EV_Bind_CommandHeight
|
||||
(
|
||||
"bind_commandheight",
|
||||
EV_DEFAULT,
|
||||
"i",
|
||||
"height",
|
||||
"Height of the command item"
|
||||
);
|
||||
Event EV_Bind_PrimaryKeyWidth
|
||||
(
|
||||
"bind_primarykeywidth",
|
||||
EV_DEFAULT,
|
||||
"i",
|
||||
"width",
|
||||
"Width of the primary key item"
|
||||
);
|
||||
Event EV_Bind_PrimaryKeyHeight
|
||||
(
|
||||
"bind_primarykeyheight",
|
||||
EV_DEFAULT,
|
||||
"i",
|
||||
"height",
|
||||
"Height of the primary key item"
|
||||
);
|
||||
Event EV_Bind_AlternateKeyWidth
|
||||
(
|
||||
"bind_alternatekeywidth",
|
||||
EV_DEFAULT,
|
||||
"i",
|
||||
"width",
|
||||
"Width of the alternate key item"
|
||||
);
|
||||
Event EV_Bind_AlternateKeyHeight
|
||||
(
|
||||
"bind_alternatekeyheight",
|
||||
EV_DEFAULT,
|
||||
"i",
|
||||
"height",
|
||||
"Height of the alternate key item"
|
||||
);
|
||||
Event EV_Bind_NewItem
|
||||
(
|
||||
"binditem",
|
||||
EV_DEFAULT,
|
||||
"ss",
|
||||
"name command",
|
||||
"Create a new bind item in the interface"
|
||||
);
|
||||
Event EV_Bind_Align
|
||||
(
|
||||
"align",
|
||||
EV_DEFAULT,
|
||||
"sSSSSS",
|
||||
"arg1 arg2 arg3 arg4 arg5 arg6",
|
||||
"Set the alignment on the bind menu"
|
||||
);
|
||||
Event EV_Bind_TitleForegroundColor
|
||||
(
|
||||
"titleforegroundcolor",
|
||||
EV_DEFAULT,
|
||||
"ffff",
|
||||
"r g b a",
|
||||
"Set the color for the title foreground"
|
||||
);
|
||||
Event EV_Bind_TitleBackgroundColor
|
||||
(
|
||||
"titlebackgroundcolor",
|
||||
EV_DEFAULT,
|
||||
"ffff",
|
||||
"r g b a",
|
||||
"Set the color for the title background"
|
||||
);
|
||||
Event EV_Bind_InactiveForegroundColor
|
||||
(
|
||||
"inactiveforegroundcolor",
|
||||
EV_DEFAULT,
|
||||
"ffff",
|
||||
"r g b a",
|
||||
"Set the color for the inactive button foreground"
|
||||
);
|
||||
Event EV_Bind_InactiveBackgroundColor
|
||||
(
|
||||
"inactivebackgroundcolor",
|
||||
EV_DEFAULT,
|
||||
"ffff",
|
||||
"r g b a",
|
||||
"Set the color for the inactive button background"
|
||||
);
|
||||
Event EV_Bind_ActiveForegroundColor
|
||||
(
|
||||
"activeforegroundcolor",
|
||||
EV_DEFAULT,
|
||||
"ffff",
|
||||
"r g b a",
|
||||
"Set the color for the active button foreground"
|
||||
);
|
||||
Event EV_Bind_ActiveBackgroundColor
|
||||
(
|
||||
"activebackgroundcolor",
|
||||
EV_DEFAULT,
|
||||
"ffff",
|
||||
"r g b a",
|
||||
"Set the color for the active button background"
|
||||
);
|
||||
Event EV_Bind_ActiveBorderColor
|
||||
(
|
||||
"activebordercolor",
|
||||
EV_DEFAULT,
|
||||
"ffff",
|
||||
"r g b a",
|
||||
"Set the color for the active button border"
|
||||
);
|
||||
Event EV_Bind_HighlightForegroundColor
|
||||
(
|
||||
"highlightforegroundcolor",
|
||||
EV_DEFAULT,
|
||||
"ffff",
|
||||
"r g b a",
|
||||
"Set the color for the highlighted button foreground"
|
||||
);
|
||||
Event EV_Bind_HighlightBackgroundColor
|
||||
(
|
||||
"highlightbackgroundcolor",
|
||||
EV_DEFAULT,
|
||||
"ffff",
|
||||
"r g b a",
|
||||
"Set the color for the highlighted button background"
|
||||
);
|
||||
Event EV_Bind_SelectForegroundColor
|
||||
(
|
||||
"selectforegroundcolor",
|
||||
EV_DEFAULT,
|
||||
"ffff",
|
||||
"r g b a",
|
||||
"Set the color for the selected button foreground"
|
||||
);
|
||||
Event EV_Bind_SelectBackgroundColor
|
||||
(
|
||||
"selectbackgroundcolor",
|
||||
EV_DEFAULT,
|
||||
"ffff",
|
||||
"r g b a",
|
||||
"Set the color for the selected button background"
|
||||
);
|
||||
Event EV_Bind_ChangeSound
|
||||
(
|
||||
"changesound",
|
||||
EV_DEFAULT,
|
||||
"s",
|
||||
"soundname",
|
||||
"Set the name of the sound to play when the highlighted item changes"
|
||||
);
|
||||
Event EV_Bind_ActiveSound
|
||||
(
|
||||
"activesound",
|
||||
EV_DEFAULT,
|
||||
"s",
|
||||
"soundname",
|
||||
"Set the name of the sound to play when the item is made active"
|
||||
);
|
||||
Event EV_Bind_EnterSound
|
||||
(
|
||||
"entersound",
|
||||
EV_DEFAULT,
|
||||
"s",
|
||||
"soundname",
|
||||
"Set the name of the sound to play when the key is entered"
|
||||
);
|
||||
|
||||
CLASS_DECLARATION(Listener, bindlistener, NULL) {
|
||||
{&EV_Bind_Width, &bindlistener::Width },
|
||||
{&EV_Bind_Height, &bindlistener::Height },
|
||||
{&EV_Bind_FillWidth, &bindlistener::FillWidth },
|
||||
{&EV_Bind_CommandWidth, &bindlistener::CommandWidth },
|
||||
{&EV_Bind_CommandHeight, &bindlistener::CommandHeight },
|
||||
{&EV_Bind_PrimaryKeyWidth, &bindlistener::PrimaryKeyWidth },
|
||||
{&EV_Bind_PrimaryKeyHeight, &bindlistener::PrimaryKeyHeight },
|
||||
{&EV_Bind_AlternateKeyWidth, &bindlistener::AlternateKeyWidth },
|
||||
{&EV_Bind_AlternateKeyHeight, &bindlistener::AlternateKeyHeight },
|
||||
{&EV_Bind_Header, &bindlistener::Header },
|
||||
{&EV_Bind_NewItem, &bindlistener::NewItem },
|
||||
{&EV_Bind_Align, &bindlistener::Align },
|
||||
{&EV_Bind_TitleForegroundColor, &bindlistener::TitleForegroundColor },
|
||||
{&EV_Bind_TitleBackgroundColor, &bindlistener::TitleBackgroundColor },
|
||||
{&EV_Bind_InactiveForegroundColor, &bindlistener::InactiveForegroundColor },
|
||||
{&EV_Bind_InactiveBackgroundColor, &bindlistener::InactiveBackgroundColor },
|
||||
{&EV_Bind_ActiveForegroundColor, &bindlistener::ActiveForegroundColor },
|
||||
{&EV_Bind_ActiveBackgroundColor, &bindlistener::ActiveBackgroundColor },
|
||||
{&EV_Bind_ActiveBorderColor, &bindlistener::ActiveBorderColor },
|
||||
{&EV_Bind_HighlightForegroundColor, &bindlistener::HighlightForegroundColor},
|
||||
{&EV_Bind_HighlightBackgroundColor, &bindlistener::HighlightBackgroundColor},
|
||||
{&EV_Bind_SelectForegroundColor, &bindlistener::SelectForegroundColor },
|
||||
{&EV_Bind_SelectBackgroundColor, &bindlistener::SelectBackgroundColor },
|
||||
{&EV_Bind_ChangeSound, &bindlistener::ChangeSound },
|
||||
{&EV_Bind_ActiveSound, &bindlistener::ActiveSound },
|
||||
{&EV_Bind_EnterSound, &bindlistener::EnterSound },
|
||||
{NULL, NULL }
|
||||
};
|
||||
|
||||
bindlistener::bindlistener()
|
||||
{
|
||||
}
|
||||
|
||||
bindlistener::bindlistener
|
||||
(
|
||||
bind_t *b
|
||||
)
|
||||
bindlistener::bindlistener() {}
|
||||
|
||||
bindlistener::bindlistener(bind_t *b)
|
||||
{
|
||||
bind = b;
|
||||
}
|
||||
|
||||
bool bindlistener::Load
|
||||
(
|
||||
Script& script
|
||||
)
|
||||
|
||||
void bindlistener::Header(Event *ev)
|
||||
{
|
||||
// FIXME: stub
|
||||
return false;
|
||||
int num;
|
||||
|
||||
num = ev->GetInteger(1) - 1;
|
||||
if (num > ARRAY_LEN(bind_t::headers)) {
|
||||
return;
|
||||
}
|
||||
|
||||
bind->headers[num] = ev->GetString(2);
|
||||
if (ev->NumArgs() > 2) {
|
||||
bind->headermats[num] = uWinMan.RegisterShader(ev->GetString(3));
|
||||
}
|
||||
}
|
||||
|
||||
void bindlistener::Header
|
||||
(
|
||||
Event *ev
|
||||
)
|
||||
|
||||
void bindlistener::ChangeSound(Event *ev)
|
||||
{
|
||||
// FIXME: stub
|
||||
bind->changesound = ev->GetString(1);
|
||||
}
|
||||
|
||||
void bindlistener::Width
|
||||
(
|
||||
Event *ev
|
||||
)
|
||||
|
||||
void bindlistener::ActiveSound(Event *ev)
|
||||
{
|
||||
// FIXME: stub
|
||||
bind->activesound = ev->GetString(1);
|
||||
}
|
||||
|
||||
void bindlistener::FillWidth
|
||||
(
|
||||
Event *ev
|
||||
)
|
||||
|
||||
void bindlistener::EnterSound(Event *ev)
|
||||
{
|
||||
// FIXME: stub
|
||||
bind->entersound = ev->GetString(1);
|
||||
}
|
||||
|
||||
void bindlistener::Height
|
||||
(
|
||||
Event *ev
|
||||
)
|
||||
|
||||
void bindlistener::SelectForegroundColor(Event *ev)
|
||||
{
|
||||
// FIXME: stub
|
||||
bind->selectfgcolor.r = ev->GetFloat(1);
|
||||
bind->selectfgcolor.g = ev->GetFloat(2);
|
||||
bind->selectfgcolor.b = ev->GetFloat(3);
|
||||
bind->selectfgcolor.a = ev->GetFloat(4);
|
||||
}
|
||||
|
||||
void bindlistener::CommandWidth
|
||||
(
|
||||
Event *ev
|
||||
)
|
||||
|
||||
void bindlistener::SelectBackgroundColor(Event *ev)
|
||||
{
|
||||
// FIXME: stub
|
||||
bind->selectbgcolor.r = ev->GetFloat(1);
|
||||
bind->selectbgcolor.g = ev->GetFloat(2);
|
||||
bind->selectbgcolor.b = ev->GetFloat(3);
|
||||
bind->selectbgcolor.a = ev->GetFloat(4);
|
||||
}
|
||||
|
||||
void bindlistener::CommandHeight
|
||||
(
|
||||
Event *ev
|
||||
)
|
||||
|
||||
void bindlistener::TitleForegroundColor(Event *ev)
|
||||
{
|
||||
// FIXME: stub
|
||||
bind->titlefgcolor.r = ev->GetFloat(1);
|
||||
bind->titlefgcolor.g = ev->GetFloat(2);
|
||||
bind->titlefgcolor.b = ev->GetFloat(3);
|
||||
bind->titlefgcolor.a = ev->GetFloat(4);
|
||||
}
|
||||
|
||||
void bindlistener::PrimaryKeyWidth
|
||||
(
|
||||
Event *ev
|
||||
)
|
||||
|
||||
void bindlistener::TitleBackgroundColor(Event *ev)
|
||||
{
|
||||
// FIXME: stub
|
||||
bind->titlebgcolor.r = ev->GetFloat(1);
|
||||
bind->titlebgcolor.g = ev->GetFloat(2);
|
||||
bind->titlebgcolor.b = ev->GetFloat(3);
|
||||
bind->titlebgcolor.a = ev->GetFloat(4);
|
||||
}
|
||||
|
||||
void bindlistener::PrimaryKeyHeight
|
||||
(
|
||||
Event *ev
|
||||
)
|
||||
|
||||
void bindlistener::ActiveBorderColor(Event *ev)
|
||||
{
|
||||
// FIXME: stub
|
||||
bind->activebordercolor.r = ev->GetFloat(1);
|
||||
bind->activebordercolor.g = ev->GetFloat(2);
|
||||
bind->activebordercolor.b = ev->GetFloat(3);
|
||||
bind->activebordercolor.a = ev->GetFloat(4);
|
||||
}
|
||||
|
||||
void bindlistener::AlternateKeyWidth
|
||||
(
|
||||
Event *ev
|
||||
)
|
||||
|
||||
void bindlistener::ActiveForegroundColor(Event *ev)
|
||||
{
|
||||
// FIXME: stub
|
||||
bind->activefgcolor.r = ev->GetFloat(1);
|
||||
bind->activefgcolor.g = ev->GetFloat(2);
|
||||
bind->activefgcolor.b = ev->GetFloat(3);
|
||||
bind->activefgcolor.a = ev->GetFloat(4);
|
||||
}
|
||||
|
||||
void bindlistener::AlternateKeyHeight
|
||||
(
|
||||
Event *ev
|
||||
)
|
||||
|
||||
void bindlistener::ActiveBackgroundColor(Event *ev)
|
||||
{
|
||||
// FIXME: stub
|
||||
bind->activebgcolor.r = ev->GetFloat(1);
|
||||
bind->activebgcolor.g = ev->GetFloat(2);
|
||||
bind->activebgcolor.b = ev->GetFloat(3);
|
||||
bind->activebgcolor.a = ev->GetFloat(4);
|
||||
}
|
||||
|
||||
void bindlistener::NewItem
|
||||
(
|
||||
Event *ev
|
||||
)
|
||||
|
||||
void bindlistener::InactiveForegroundColor(Event *ev)
|
||||
{
|
||||
// FIXME: stub
|
||||
bind->inactivefgcolor.r = ev->GetFloat(1);
|
||||
bind->inactivefgcolor.g = ev->GetFloat(2);
|
||||
bind->inactivefgcolor.b = ev->GetFloat(3);
|
||||
bind->inactivefgcolor.a = ev->GetFloat(4);
|
||||
}
|
||||
|
||||
void bindlistener::Align
|
||||
(
|
||||
Event *ev
|
||||
)
|
||||
|
||||
void bindlistener::InactiveBackgroundColor(Event *ev)
|
||||
{
|
||||
// FIXME: stub
|
||||
bind->inactivebgcolor.r = ev->GetFloat(1);
|
||||
bind->inactivebgcolor.g = ev->GetFloat(2);
|
||||
bind->inactivebgcolor.b = ev->GetFloat(3);
|
||||
bind->inactivebgcolor.a = ev->GetFloat(4);
|
||||
}
|
||||
|
||||
void bindlistener::TitleForegroundColor
|
||||
(
|
||||
Event *ev
|
||||
)
|
||||
|
||||
void bindlistener::HighlightForegroundColor(Event *ev)
|
||||
{
|
||||
// FIXME: stub
|
||||
bind->highlightfgcolor.r = ev->GetFloat(1);
|
||||
bind->highlightfgcolor.g = ev->GetFloat(2);
|
||||
bind->highlightfgcolor.b = ev->GetFloat(3);
|
||||
bind->highlightfgcolor.a = ev->GetFloat(4);
|
||||
}
|
||||
|
||||
void bindlistener::TitleBackgroundColor
|
||||
(
|
||||
Event *ev
|
||||
)
|
||||
|
||||
void bindlistener::HighlightBackgroundColor(Event *ev)
|
||||
{
|
||||
// FIXME: stub
|
||||
bind->highlightbgcolor.r = ev->GetFloat(1);
|
||||
bind->highlightbgcolor.g = ev->GetFloat(2);
|
||||
bind->highlightbgcolor.b = ev->GetFloat(3);
|
||||
bind->highlightbgcolor.a = ev->GetFloat(4);
|
||||
}
|
||||
|
||||
void bindlistener::InactiveForegroundColor
|
||||
(
|
||||
Event *ev
|
||||
)
|
||||
|
||||
void bindlistener::Align(Event *ev)
|
||||
{
|
||||
// FIXME: stub
|
||||
int i;
|
||||
|
||||
for (i = 1; i <= ev->NumArgs(); i++) {
|
||||
str align = ev->GetString(i);
|
||||
|
||||
if (!str::icmp(align, "left")) {
|
||||
bind->align |= WA_LEFT;
|
||||
} else if (!str::icmp(align, "right")) {
|
||||
bind->align |= WA_RIGHT;
|
||||
} else if (!str::icmp(align, "top")) {
|
||||
bind->align |= WA_TOP;
|
||||
} else if (!str::icmp(align, "bottom")) {
|
||||
bind->align |= WA_BOTTOM;
|
||||
} else if (!str::icmp(align, "centerx")) {
|
||||
bind->align |= WA_CENTERX;
|
||||
} else if (!str::icmp(align, "centery")) {
|
||||
bind->align |= WA_CENTERY;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void bindlistener::InactiveBackgroundColor
|
||||
(
|
||||
Event *ev
|
||||
)
|
||||
|
||||
void bindlistener::NewItem(Event *ev)
|
||||
{
|
||||
// FIXME: stub
|
||||
bind_item_t *bt;
|
||||
UIReggedMaterial *mat = NULL;
|
||||
|
||||
if (ev->NumArgs() > 2) {
|
||||
mat = uWinMan.RegisterShader(ev->GetString(3));
|
||||
}
|
||||
|
||||
str n = ev->GetString(1);
|
||||
str c = ev->GetString(2);
|
||||
|
||||
bt = new bind_item_t;
|
||||
bt->name = n;
|
||||
bt->command = c;
|
||||
bt->nameMaterial = mat;
|
||||
|
||||
bind->binds.AddObject(bt);
|
||||
}
|
||||
|
||||
void bindlistener::ActiveForegroundColor
|
||||
(
|
||||
Event *ev
|
||||
)
|
||||
|
||||
void bindlistener::Width(Event *ev)
|
||||
{
|
||||
// FIXME: stub
|
||||
bind->width = ev->GetInteger(1);
|
||||
}
|
||||
|
||||
void bindlistener::ActiveBackgroundColor
|
||||
(
|
||||
Event *ev
|
||||
)
|
||||
|
||||
void bindlistener::Height(Event *ev)
|
||||
{
|
||||
// FIXME: stub
|
||||
bind->height = ev->GetInteger(1);
|
||||
}
|
||||
|
||||
void bindlistener::ActiveBorderColor
|
||||
(
|
||||
Event *ev
|
||||
)
|
||||
|
||||
void bindlistener::FillWidth(Event *ev)
|
||||
{
|
||||
// FIXME: stub
|
||||
bind->fillwidth = ev->GetInteger(1);
|
||||
|
||||
if (ev->NumArgs() > 1) {
|
||||
bind->fillmaterial = uWinMan.RegisterShader(ev->GetString(2));
|
||||
}
|
||||
}
|
||||
|
||||
void bindlistener::HighlightForegroundColor
|
||||
(
|
||||
Event *ev
|
||||
)
|
||||
|
||||
void bindlistener::CommandWidth(Event *ev)
|
||||
{
|
||||
// FIXME: stub
|
||||
bind->commandwidth = ev->GetInteger(1);
|
||||
}
|
||||
|
||||
void bindlistener::HighlightBackgroundColor
|
||||
(
|
||||
Event *ev
|
||||
)
|
||||
|
||||
void bindlistener::CommandHeight(Event *ev)
|
||||
{
|
||||
// FIXME: stub
|
||||
bind->commandheight = ev->GetInteger(1);
|
||||
}
|
||||
|
||||
void bindlistener::SelectForegroundColor
|
||||
(
|
||||
Event *ev
|
||||
)
|
||||
|
||||
void bindlistener::PrimaryKeyWidth(Event *ev)
|
||||
{
|
||||
// FIXME: stub
|
||||
bind->primarykeywidth = ev->GetInteger(1);
|
||||
}
|
||||
|
||||
void bindlistener::SelectBackgroundColor
|
||||
(
|
||||
Event *ev
|
||||
)
|
||||
|
||||
void bindlistener::PrimaryKeyHeight(Event *ev)
|
||||
{
|
||||
// FIXME: stub
|
||||
bind->primarykeyheight = ev->GetInteger(1);
|
||||
}
|
||||
|
||||
void bindlistener::ChangeSound
|
||||
(
|
||||
Event *ev
|
||||
)
|
||||
|
||||
void bindlistener::AlternateKeyWidth(Event *ev)
|
||||
{
|
||||
// FIXME: stub
|
||||
bind->alternatekeywidth = ev->GetInteger(1);
|
||||
}
|
||||
|
||||
void bindlistener::ActiveSound
|
||||
(
|
||||
Event *ev
|
||||
)
|
||||
|
||||
void bindlistener::AlternateKeyHeight(Event *ev)
|
||||
{
|
||||
// FIXME: stub
|
||||
bind->alternatekeyheight = ev->GetInteger(1);
|
||||
}
|
||||
|
||||
void bindlistener::EnterSound
|
||||
(
|
||||
Event *ev
|
||||
)
|
||||
|
||||
bool bindlistener::Load(Script& script)
|
||||
{
|
||||
// FIXME: stub
|
||||
str token;
|
||||
str errortext;
|
||||
|
||||
while (script.TokenAvailable(true)) {
|
||||
token = script.GetToken(true);
|
||||
|
||||
if (!token.length() || !ValidEvent(token)) {
|
||||
throw "invalid token";
|
||||
}
|
||||
|
||||
Event *event = new Event(token);
|
||||
|
||||
while (script.TokenAvailable(false)) {
|
||||
event->AddToken(script.GetToken(false));
|
||||
}
|
||||
|
||||
ProcessEvent(event);
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
bool CL_LoadBind(const char *filename, bind_t *bind)
|
||||
{
|
||||
Script script;
|
||||
|
||||
bind->Clear();
|
||||
|
||||
bindlistener listener(bind);
|
||||
script.LoadFile(filename);
|
||||
// Load the bind file
|
||||
return listener.Load(script);
|
||||
}
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
/*
|
||||
===========================================================================
|
||||
Copyright (C) 2015 the OpenMoHAA team
|
||||
Copyright (C) 2023 the OpenMoHAA team
|
||||
|
||||
This file is part of OpenMoHAA source code.
|
||||
|
||||
|
@ -20,40 +20,33 @@ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
|||
===========================================================================
|
||||
*/
|
||||
|
||||
#ifndef __CL_UIBIND_H__
|
||||
#define __CL_UIBIND_H__
|
||||
#pragma once
|
||||
|
||||
class bind_item_t {
|
||||
class bind_item_t
|
||||
{
|
||||
public:
|
||||
str name;
|
||||
str command;
|
||||
UIReggedMaterial *nameMaterial;
|
||||
|
||||
bind_item_t();
|
||||
bind_item_t( str name, str command, UIReggedMaterial *nameMaterial );
|
||||
bind_item_t(str name, str command, UIReggedMaterial *nameMaterial);
|
||||
};
|
||||
|
||||
inline
|
||||
bind_item_t::bind_item_t()
|
||||
inline bind_item_t::bind_item_t()
|
||||
{
|
||||
nameMaterial = NULL;
|
||||
}
|
||||
|
||||
inline
|
||||
bind_item_t::bind_item_t
|
||||
(
|
||||
str name,
|
||||
str command,
|
||||
UIReggedMaterial *nameMaterial
|
||||
)
|
||||
|
||||
inline bind_item_t::bind_item_t(str name, str command, UIReggedMaterial *nameMaterial)
|
||||
{
|
||||
this->name = name;
|
||||
this->command = command;
|
||||
this->nameMaterial = nameMaterial;
|
||||
}
|
||||
|
||||
class bind_t {
|
||||
class bind_t
|
||||
{
|
||||
public:
|
||||
int width;
|
||||
int height;
|
||||
|
@ -79,8 +72,8 @@ public:
|
|||
str changesound;
|
||||
str activesound;
|
||||
str entersound;
|
||||
str headers[ 3 ];
|
||||
UIReggedMaterial *headermats[ 3 ];
|
||||
str headers[3];
|
||||
UIReggedMaterial *headermats[3];
|
||||
UIReggedMaterial *fillmaterial;
|
||||
Container<bind_item_t *> binds;
|
||||
|
||||
|
@ -88,47 +81,48 @@ public:
|
|||
bind_t();
|
||||
~bind_t();
|
||||
|
||||
void Clear( void );
|
||||
void Clear(void);
|
||||
};
|
||||
|
||||
class bindlistener : public Listener {
|
||||
class bindlistener : public Listener
|
||||
{
|
||||
protected:
|
||||
bind_t *bind;
|
||||
|
||||
public:
|
||||
CLASS_PROTOTYPE( bindlistener );
|
||||
CLASS_PROTOTYPE(bindlistener);
|
||||
|
||||
public:
|
||||
bindlistener();
|
||||
bindlistener( bind_t *b );
|
||||
bindlistener(bind_t *b);
|
||||
|
||||
bool Load( Script& script );
|
||||
void Header( Event *ev );
|
||||
void Width( Event *ev );
|
||||
void FillWidth( Event *ev );
|
||||
void Height( Event *ev );
|
||||
void CommandWidth( Event *ev );
|
||||
void CommandHeight( Event *ev );
|
||||
void PrimaryKeyWidth( Event *ev );
|
||||
void PrimaryKeyHeight( Event *ev );
|
||||
void AlternateKeyWidth( Event *ev );
|
||||
void AlternateKeyHeight( Event *ev );
|
||||
void NewItem( Event *ev );
|
||||
void Align( Event *ev );
|
||||
void TitleForegroundColor( Event *ev );
|
||||
void TitleBackgroundColor( Event *ev );
|
||||
void InactiveForegroundColor( Event *ev );
|
||||
void InactiveBackgroundColor( Event *ev );
|
||||
void ActiveForegroundColor( Event *ev );
|
||||
void ActiveBackgroundColor( Event *ev );
|
||||
void ActiveBorderColor( Event *ev );
|
||||
void HighlightForegroundColor( Event *ev );
|
||||
void HighlightBackgroundColor( Event *ev );
|
||||
void SelectForegroundColor( Event *ev );
|
||||
void SelectBackgroundColor( Event *ev );
|
||||
void ChangeSound( Event *ev );
|
||||
void ActiveSound( Event *ev );
|
||||
void EnterSound( Event *ev );
|
||||
bool Load(Script& script);
|
||||
void Header(Event *ev);
|
||||
void Width(Event *ev);
|
||||
void FillWidth(Event *ev);
|
||||
void Height(Event *ev);
|
||||
void CommandWidth(Event *ev);
|
||||
void CommandHeight(Event *ev);
|
||||
void PrimaryKeyWidth(Event *ev);
|
||||
void PrimaryKeyHeight(Event *ev);
|
||||
void AlternateKeyWidth(Event *ev);
|
||||
void AlternateKeyHeight(Event *ev);
|
||||
void NewItem(Event *ev);
|
||||
void Align(Event *ev);
|
||||
void TitleForegroundColor(Event *ev);
|
||||
void TitleBackgroundColor(Event *ev);
|
||||
void InactiveForegroundColor(Event *ev);
|
||||
void InactiveBackgroundColor(Event *ev);
|
||||
void ActiveForegroundColor(Event *ev);
|
||||
void ActiveBackgroundColor(Event *ev);
|
||||
void ActiveBorderColor(Event *ev);
|
||||
void HighlightForegroundColor(Event *ev);
|
||||
void HighlightBackgroundColor(Event *ev);
|
||||
void SelectForegroundColor(Event *ev);
|
||||
void SelectBackgroundColor(Event *ev);
|
||||
void ChangeSound(Event *ev);
|
||||
void ActiveSound(Event *ev);
|
||||
void EnterSound(Event *ev);
|
||||
};
|
||||
|
||||
#endif
|
||||
bool CL_LoadBind(const char* filename, bind_t* bind);
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
/*
|
||||
===========================================================================
|
||||
Copyright (C) 2015 the OpenMoHAA team
|
||||
Copyright (C) 2024 the OpenMoHAA team
|
||||
|
||||
This file is part of OpenMoHAA source code.
|
||||
|
||||
|
@ -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
|
||||
(
|
||||
|
@ -44,12 +45,11 @@ static float s_dmboxWidth = 384.0;
|
|||
static float s_dmboxOffsetX = 3.0f;
|
||||
static float s_dmboxOffsetY = 8.0f;
|
||||
|
||||
CLASS_DECLARATION( UIWidget, UIDMBox, NULL )
|
||||
{
|
||||
{ &W_SizeChanged, &UIDMBox::OnSizeChanged },
|
||||
{ &EV_DMBox_Goin, &UIDMBox::MoveInEvent },
|
||||
{ &EV_DMBox_Decay, &UIDMBox::DecayEvent },
|
||||
{ NULL, NULL }
|
||||
CLASS_DECLARATION(UIWidget, UIDMBox, NULL) {
|
||||
{&W_SizeChanged, &UIDMBox::OnSizeChanged},
|
||||
{&EV_DMBox_Goin, &UIDMBox::MoveInEvent },
|
||||
{&EV_DMBox_Decay, &UIDMBox::DecayEvent },
|
||||
{NULL, NULL }
|
||||
};
|
||||
|
||||
UIDMBox::UIDMBox()
|
||||
|
@ -61,18 +61,18 @@ UIDMBox::UIDMBox()
|
|||
m_iBeginDecay = 0;
|
||||
m_boxtime = uid.time;
|
||||
m_movespeed = 500;
|
||||
m_drawoutline = com_target_game->integer >= target_game_e::TG_MOHTA;
|
||||
}
|
||||
|
||||
void UIDMBox::VerifyBoxOut( void )
|
||||
void UIDMBox::VerifyBoxOut(void)
|
||||
{
|
||||
PostMoveinEvent();
|
||||
if (m_boxstate != boxstate_t::box_moving_out && m_boxstate != boxstate_t::box_out)
|
||||
{
|
||||
if (m_boxstate != boxstate_t::box_moving_out && m_boxstate != boxstate_t::box_out) {
|
||||
ChangeBoxState(boxstate_t::box_moving_out);
|
||||
}
|
||||
}
|
||||
|
||||
void UIDMBox::ChangeBoxState( boxstate_t state )
|
||||
void UIDMBox::ChangeBoxState(boxstate_t state)
|
||||
{
|
||||
m_boxstate = state;
|
||||
m_boxtime = uid.time;
|
||||
|
@ -83,7 +83,7 @@ void UIDMBox::ChangeBoxState( boxstate_t state )
|
|||
}
|
||||
}
|
||||
|
||||
void UIDMBox::HandleBoxMoving( void )
|
||||
void UIDMBox::HandleBoxMoving(void)
|
||||
{
|
||||
int delta;
|
||||
UIRect2D newRect;
|
||||
|
@ -94,40 +94,34 @@ void UIDMBox::HandleBoxMoving( void )
|
|||
|
||||
delta = m_movespeed * (uid.time - m_boxtime) / 1000;
|
||||
m_boxtime = 1000 * delta / m_movespeed + m_boxtime;
|
||||
if (m_boxstate == boxstate_t::box_moving_out)
|
||||
{
|
||||
if (m_boxstate == boxstate_t::box_moving_out) {
|
||||
newRect.size.width = m_frame.size.width;
|
||||
newRect.size.height = m_frame.size.height;
|
||||
newRect.pos.x = m_frame.pos.x;
|
||||
newRect.pos.y = delta + m_frame.pos.y;
|
||||
|
||||
if (newRect.pos.y <= 0.0)
|
||||
{
|
||||
if (newRect.pos.y <= 0.0) {
|
||||
newRect.pos.y = 0.0;
|
||||
ChangeBoxState(boxstate_t::box_out);
|
||||
}
|
||||
}
|
||||
else if (m_boxstate == boxstate_t::box_moving_in)
|
||||
{
|
||||
} else if (m_boxstate == boxstate_t::box_moving_in) {
|
||||
newRect.size.width = m_frame.size.width;
|
||||
newRect.size.height = m_frame.size.height;
|
||||
newRect.pos.x = m_frame.pos.x;
|
||||
newRect.pos.y = delta - m_frame.pos.y;
|
||||
|
||||
if (newRect.pos.y <= -newRect.size.height)
|
||||
{
|
||||
if (newRect.pos.y <= -newRect.size.height) {
|
||||
newRect.pos.y = -newRect.size.height;
|
||||
ChangeBoxState(boxstate_t::box_in);
|
||||
}
|
||||
}
|
||||
else {
|
||||
} else {
|
||||
newRect = m_frame;
|
||||
}
|
||||
|
||||
setFrame(newRect);
|
||||
}
|
||||
|
||||
void UIDMBox::PostMoveinEvent( void )
|
||||
void UIDMBox::PostMoveinEvent(void)
|
||||
{
|
||||
if (m_boxstate != boxstate_t::box_out) {
|
||||
return;
|
||||
|
@ -135,27 +129,24 @@ void UIDMBox::PostMoveinEvent( void )
|
|||
|
||||
if (!EventPending(EV_DMBox_Goin)) {
|
||||
PostEvent(EV_DMBox_Goin, 10.0);
|
||||
}
|
||||
else {
|
||||
} else {
|
||||
PostponeEvent(EV_DMBox_Goin, 10.0);
|
||||
}
|
||||
}
|
||||
|
||||
void UIDMBox::PostDecayEvent( void )
|
||||
void UIDMBox::PostDecayEvent(void)
|
||||
{
|
||||
if (!EventPending(EV_DMBox_Decay))
|
||||
{
|
||||
if (!EventPending(EV_DMBox_Decay)) {
|
||||
float fDelayTime;
|
||||
int iNumLines;
|
||||
int i;
|
||||
const char* pszString = m_items[0].string.c_str();
|
||||
const char *pszString = m_items[0].string.c_str();
|
||||
|
||||
//
|
||||
// Calculate the number of lines
|
||||
//
|
||||
iNumLines = 1;
|
||||
for (i = 0; pszString[i]; i++)
|
||||
{
|
||||
for (i = 0; pszString[i]; i++) {
|
||||
if (pszString[i] == '\n') {
|
||||
iNumLines++;
|
||||
}
|
||||
|
@ -169,8 +160,7 @@ void UIDMBox::PostDecayEvent( void )
|
|||
//
|
||||
else if (m_items[0].flags & DMBOX_ITEM_FLAG_DEATH) {
|
||||
fDelayTime = iNumLines * 6.0;
|
||||
}
|
||||
else {
|
||||
} else {
|
||||
fDelayTime = iNumLines * 5.0;
|
||||
}
|
||||
|
||||
|
@ -181,7 +171,7 @@ void UIDMBox::PostDecayEvent( void )
|
|||
}
|
||||
}
|
||||
|
||||
void UIDMBox::setShowState( void )
|
||||
void UIDMBox::setShowState(void)
|
||||
{
|
||||
if (m_reallyshown) {
|
||||
setShow(m_boxstate != box_in);
|
||||
|
@ -190,7 +180,7 @@ void UIDMBox::setShowState( void )
|
|||
}
|
||||
}
|
||||
|
||||
void UIDMBox::RemoveTopItem( void )
|
||||
void UIDMBox::RemoveTopItem(void)
|
||||
{
|
||||
int i;
|
||||
|
||||
|
@ -203,49 +193,37 @@ void UIDMBox::RemoveTopItem( void )
|
|||
}
|
||||
}
|
||||
|
||||
str UIDMBox::CalculateBreaks( UIFont *font, str text, float max_width )
|
||||
str UIDMBox::CalculateBreaks(UIFont *font, str text, float max_width)
|
||||
{
|
||||
str newText, sTmp;
|
||||
int i;
|
||||
str newText;
|
||||
float fX;
|
||||
float fwX, fsX;
|
||||
float fwX;
|
||||
const char *current;
|
||||
int count;
|
||||
|
||||
Cmd_TokenizeString(text.c_str());
|
||||
if (Cmd_Argc())
|
||||
{
|
||||
current = text;
|
||||
fX = 0.0;
|
||||
fsX = font->getCharWidth(' ');
|
||||
|
||||
for (i = 0; i < Cmd_Argc(); i++)
|
||||
{
|
||||
sTmp = Cmd_Argv(i);
|
||||
for (count = font->DBCSGetWordBlockCount(current, -1); count;
|
||||
current += count, count = font->DBCSGetWordBlockCount(current, -1)) {
|
||||
fwX = font->getWidth(current, count);
|
||||
|
||||
fwX = font->getWidth(sTmp.c_str(), -1);
|
||||
if (fwX + i <= max_width)
|
||||
{
|
||||
if (fwX + i + fX <= max_width)
|
||||
{
|
||||
newText += sTmp + " ";
|
||||
if (fX + fwX > max_width) {
|
||||
newText += "\n" + str(current, 0, count);
|
||||
fX = 0;
|
||||
} else {
|
||||
newText += "\n" + sTmp + " ";
|
||||
newText += str(current, 0, count);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
sTmp += "\n";
|
||||
fX = 0.0;
|
||||
}
|
||||
}
|
||||
} else {
|
||||
newText = "";
|
||||
|
||||
fX += fwX;
|
||||
}
|
||||
|
||||
return newText;
|
||||
}
|
||||
|
||||
float UIDMBox::PrintWrap( UIFont *font, float x, float y, str text )
|
||||
float UIDMBox::PrintWrap(UIFont *font, float x, float y, str text)
|
||||
{
|
||||
const char* p1, * p2;
|
||||
const char *p1, *p2;
|
||||
size_t n, l;
|
||||
float fY;
|
||||
|
||||
|
@ -253,8 +231,7 @@ float UIDMBox::PrintWrap( UIFont *font, float x, float y, str text )
|
|||
p1 = text.c_str();
|
||||
l = text.length();
|
||||
|
||||
for (;;)
|
||||
{
|
||||
for (;;) {
|
||||
p2 = strchr(p1, '\n');
|
||||
if (!p2) {
|
||||
break;
|
||||
|
@ -265,31 +242,55 @@ float UIDMBox::PrintWrap( UIFont *font, float x, float y, str text )
|
|||
break;
|
||||
}
|
||||
|
||||
font->Print(x, fY, p1, p2 - p1, qfalse);
|
||||
font->Print(x, fY, p1, p2 - p1, getHighResScale());
|
||||
p1 = p2 + 1;
|
||||
l -= n;
|
||||
fY += font->getHeight(qfalse);
|
||||
fY += font->getHeight();
|
||||
}
|
||||
|
||||
font->Print(x, fY, p1, l, qfalse);
|
||||
if (*p1) {
|
||||
font->Print(x, fY, p1, l, getHighResScale());
|
||||
fY += font->getHeight();
|
||||
}
|
||||
|
||||
return font->getHeight(qfalse) + (fY - y);
|
||||
return fY - y;
|
||||
}
|
||||
|
||||
float UIDMBox::DrawItem( item_t *in, float x, float y, float alpha )
|
||||
float UIDMBox::DrawItem(item_t *in, float x, float y, float alpha)
|
||||
{
|
||||
if (m_drawoutline) {
|
||||
//
|
||||
// Draw an outline
|
||||
//
|
||||
|
||||
in->font->setColor(UBlack);
|
||||
in->font->setAlpha(alpha);
|
||||
|
||||
PrintWrap(in->font, x + 1, y + 2, in->string);
|
||||
PrintWrap(in->font, x + 2, y + 1, in->string);
|
||||
PrintWrap(in->font, x - 1, y + 2, in->string);
|
||||
PrintWrap(in->font, x - 2, y + 1, in->string);
|
||||
PrintWrap(in->font, x - 1, y - 2, in->string);
|
||||
PrintWrap(in->font, x - 2, y - 1, in->string);
|
||||
PrintWrap(in->font, x + 1, y - 2, in->string);
|
||||
PrintWrap(in->font, x + 2, y - 1, in->string);
|
||||
PrintWrap(in->font, x + 2, y, in->string);
|
||||
PrintWrap(in->font, x - 2, y, in->string);
|
||||
PrintWrap(in->font, x, y + 2, in->string);
|
||||
PrintWrap(in->font, x, y - 2, in->string);
|
||||
}
|
||||
|
||||
in->font->setColor(in->color);
|
||||
in->font->setAlpha(alpha);
|
||||
|
||||
return PrintWrap(in->font, x, y, in->string);
|
||||
}
|
||||
|
||||
void UIDMBox::Print( const char *text )
|
||||
void UIDMBox::Print(const char *text)
|
||||
{
|
||||
const char* text1 = text;
|
||||
const char *text1 = text;
|
||||
|
||||
if (m_numitems > 5)
|
||||
{
|
||||
if (m_numitems > 5) {
|
||||
//
|
||||
// Overwrite an item
|
||||
//
|
||||
|
@ -298,49 +299,42 @@ void UIDMBox::Print( const char *text )
|
|||
|
||||
m_items[m_numitems].flags = 0;
|
||||
|
||||
if (*text == MESSAGE_CHAT_WHITE)
|
||||
{
|
||||
m_items[m_numitems].color = UGrey;
|
||||
if (*text == MESSAGE_CHAT_WHITE) {
|
||||
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;
|
||||
} else if (*text == MESSAGE_CHAT_RED) {
|
||||
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)
|
||||
{
|
||||
m_items[m_numitems].color = UGreen;
|
||||
} else if (*text == MESSAGE_CHAT_GREEN) {
|
||||
m_items[m_numitems].color = UGreenChatMessageColor;
|
||||
m_items[m_numitems].font = m_fontbold;
|
||||
m_items[m_numitems].flags |= DMBOX_ITEM_FLAG_DEATH;
|
||||
|
||||
text1 = text + 1;
|
||||
}
|
||||
else
|
||||
{
|
||||
} else {
|
||||
m_items[m_numitems].color = m_foreground_color;
|
||||
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();
|
||||
PostDecayEvent();
|
||||
}
|
||||
|
||||
void UIDMBox::OnSizeChanged( Event *ev )
|
||||
void UIDMBox::OnSizeChanged(Event *ev)
|
||||
{
|
||||
s_dmboxWidth = m_frame.size.width;
|
||||
}
|
||||
|
||||
void UIDMBox::Create( const UIRect2D& rect, const UColor& fore, const UColor& back, float alpha )
|
||||
void UIDMBox::Create(const UIRect2D& rect, const UColor& fore, const UColor& back, float alpha)
|
||||
{
|
||||
InitFrame(NULL, rect, 0, "facfont-20");
|
||||
|
||||
|
@ -361,11 +355,9 @@ void UIDMBox::Create( const UIRect2D& rect, const UColor& fore, const UColor& ba
|
|||
setShowState();
|
||||
}
|
||||
|
||||
void UIDMBox::MoveInEvent( Event *ev )
|
||||
{
|
||||
}
|
||||
void UIDMBox::MoveInEvent(Event *ev) {}
|
||||
|
||||
void UIDMBox::DecayEvent( Event *ev )
|
||||
void UIDMBox::DecayEvent(Event *ev)
|
||||
{
|
||||
RemoveTopItem();
|
||||
if (m_numitems) {
|
||||
|
@ -373,7 +365,7 @@ void UIDMBox::DecayEvent( Event *ev )
|
|||
}
|
||||
}
|
||||
|
||||
void UIDMBox::Draw( void )
|
||||
void UIDMBox::Draw(void)
|
||||
{
|
||||
float fsY;
|
||||
int i;
|
||||
|
@ -392,10 +384,14 @@ void UIDMBox::Draw( void )
|
|||
|
||||
m_font->setColor(m_foreground_color);
|
||||
alpha = (float)(cls.realtime - m_iBeginDecay) / (float)m_iEndDecay;
|
||||
if (alpha > 1.0) alpha = 1.0;
|
||||
if (alpha > 1.0) {
|
||||
alpha = 1.0;
|
||||
}
|
||||
|
||||
alpha = (1.0 - alpha) * 4.0;
|
||||
if (alpha > 1.0) alpha = 1.0;
|
||||
if (alpha > 1.0) {
|
||||
alpha = 1.0;
|
||||
}
|
||||
|
||||
if (cge) {
|
||||
alphaScale = 1.0 - cge->CG_GetObjectiveAlpha();
|
||||
|
@ -404,11 +400,9 @@ void UIDMBox::Draw( void )
|
|||
fsY = DrawItem(m_items, s_dmboxOffsetX, s_dmboxOffsetY, alpha * alphaScale);
|
||||
fsY = alpha <= 0.2 ? s_dmboxOffsetY : fsY + s_dmboxOffsetY;
|
||||
|
||||
for (i = 1; i < m_numitems; i++)
|
||||
{
|
||||
for (i = 1; i < m_numitems; i++) {
|
||||
fsY += DrawItem(&m_items[i], s_dmboxOffsetX, fsY, alphaScale);
|
||||
if (fsY > m_frame.size.height)
|
||||
{
|
||||
if (fsY > m_frame.size.height) {
|
||||
if (EventPending(EV_DMBox_Decay)) {
|
||||
CancelEventsOfType(EV_DMBox_Decay);
|
||||
}
|
||||
|
@ -419,13 +413,13 @@ void UIDMBox::Draw( void )
|
|||
}
|
||||
}
|
||||
|
||||
void UIDMBox::setRealShow( bool b )
|
||||
void UIDMBox::setRealShow(bool b)
|
||||
{
|
||||
this->m_reallyshown = b;
|
||||
setShowState();
|
||||
}
|
||||
|
||||
void UIDMBox::Clear( void )
|
||||
void UIDMBox::Clear(void)
|
||||
{
|
||||
m_numitems = 0;
|
||||
}
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
/*
|
||||
===========================================================================
|
||||
Copyright (C) 2015 the OpenMoHAA team
|
||||
Copyright (C) 2015-2024 the OpenMoHAA team
|
||||
|
||||
This file is part of OpenMoHAA source code.
|
||||
|
||||
|
@ -20,8 +20,7 @@ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
|||
===========================================================================
|
||||
*/
|
||||
|
||||
#ifndef __CL_UIDMBOX_H__
|
||||
#define __CL_UIDMBOX_H__
|
||||
#pragma once
|
||||
|
||||
static constexpr unsigned int DMBOX_ITEM_FLAG_BOLD = 2u;
|
||||
static constexpr unsigned int DMBOX_ITEM_FLAG_DEATH = 4u;
|
||||
|
@ -47,6 +46,8 @@ protected:
|
|||
int m_movespeed;
|
||||
int m_iBeginDecay;
|
||||
int m_iEndDecay;
|
||||
// Added in OPM
|
||||
bool m_drawoutline;
|
||||
|
||||
public:
|
||||
CLASS_PROTOTYPE( UIDMBox );
|
||||
|
@ -75,5 +76,3 @@ public:
|
|||
void setRealShow( bool b );
|
||||
void Clear( void );
|
||||
};
|
||||
|
||||
#endif /* __CL_UIDMBOX_H__ */
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
/*
|
||||
===========================================================================
|
||||
Copyright (C) 2015 the OpenMoHAA team
|
||||
Copyright (C) 2023 the OpenMoHAA team
|
||||
|
||||
This file is part of OpenMoHAA source code.
|
||||
|
||||
|
@ -22,72 +22,256 @@ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
|||
|
||||
#include "cl_ui.h"
|
||||
|
||||
CLASS_DECLARATION( USignal, FilePickerClass, NULL )
|
||||
class FilePickerItem : public UIListCtrlItem
|
||||
{
|
||||
{ NULL, NULL }
|
||||
str strings[3];
|
||||
|
||||
public:
|
||||
FilePickerItem(const str& fileName, const str& date, const str& size);
|
||||
int getListItemValue(int which) const override;
|
||||
griditemtype_t getListItemType(int which) const override;
|
||||
str getListItemString(int which) const override;
|
||||
void DrawListItem(int iColumn, const UIRect2D& drawRect, bool bSelected, UIFont *pFont) override;
|
||||
qboolean IsHeaderEntry() const override;
|
||||
};
|
||||
|
||||
CLASS_DECLARATION(USignal, FilePickerClass, NULL) {
|
||||
{&EV_UIListBase_ItemSelected, &FilePickerClass::FileSelected },
|
||||
{&EV_UIListBase_ItemDoubleClicked, &FilePickerClass::FileChosen },
|
||||
{&W_Deactivated, &FilePickerClass::OnDeactivated},
|
||||
{NULL, NULL }
|
||||
};
|
||||
|
||||
FilePickerClass::FilePickerClass()
|
||||
{
|
||||
// FIXME: stub
|
||||
window = new UIFloatingWindow();
|
||||
window->Create(
|
||||
NULL,
|
||||
UIRect2D((uid.vidWidth - 400) / 2, (uid.vidHeight - 300) / 2, 400, 300),
|
||||
"File Picker",
|
||||
UColor(0.15f, 0.195f, 0.278f),
|
||||
UHudColor
|
||||
);
|
||||
window->Connect(this, W_Deactivated, W_Deactivated);
|
||||
listbox = new UIListCtrl();
|
||||
listbox->InitFrame(window->getChildSpace(), window->getChildSpace()->getClientFrame(), 0);
|
||||
listbox->setBackgroundColor(UColor(0.02f, 0.07f, 0.005f), true);
|
||||
listbox->setForegroundColor(UHudColor);
|
||||
listbox->AddColumn("File Name", 0, 175, false, false);
|
||||
listbox->AddColumn("Date", 1, 125, false, false);
|
||||
listbox->AddColumn("Size", 2, 100, true, false);
|
||||
|
||||
listbox->Connect(this, EV_UIListBase_ItemDoubleClicked, EV_UIListBase_ItemDoubleClicked);
|
||||
listbox->Connect(this, EV_UIListBase_ItemSelected, EV_UIListBase_ItemSelected);
|
||||
listbox->AllowActivate(true);
|
||||
|
||||
// Added in 2.0
|
||||
// Don't localize elements
|
||||
listbox->SetDontLocalize();
|
||||
}
|
||||
|
||||
FilePickerClass::~FilePickerClass()
|
||||
{
|
||||
// FIXME: stub
|
||||
if (listbox) {
|
||||
delete listbox;
|
||||
listbox = NULL;
|
||||
}
|
||||
|
||||
if (window) {
|
||||
delete window;
|
||||
window = NULL;
|
||||
}
|
||||
}
|
||||
|
||||
void FilePickerClass::SetupFiles( void )
|
||||
void FilePickerClass::Setup(
|
||||
const char *root_directory, const char *current_directory, const char *ext, const char *ignore_files
|
||||
)
|
||||
{
|
||||
// FIXME: stub
|
||||
Initialize(root_directory, current_directory, ext, ignore_files);
|
||||
}
|
||||
|
||||
void FilePickerClass::GotoParentDirectory( void )
|
||||
void FilePickerClass::Initialize(
|
||||
const char *root_directory, const char *current_directory, const char *ext, const char *ignore_files
|
||||
)
|
||||
{
|
||||
// FIXME: stub
|
||||
rootDirectory = root_directory;
|
||||
if (rootDirectory.length() > 1 && rootDirectory[rootDirectory.length() - 1] != '/') {
|
||||
rootDirectory += "/";
|
||||
}
|
||||
|
||||
currentDirectory = current_directory;
|
||||
if (currentDirectory.length() > 1 && currentDirectory[currentDirectory.length() - 1] != '/') {
|
||||
currentDirectory += "/";
|
||||
}
|
||||
|
||||
extension = ext;
|
||||
if (ignore_files) {
|
||||
ignoredFiles = ignore_files;
|
||||
}
|
||||
|
||||
SetupFiles();
|
||||
}
|
||||
|
||||
void FilePickerClass::GotoSubDirectory( str subdir )
|
||||
void FilePickerClass::GotoParentDirectory(void)
|
||||
{
|
||||
// FIXME: stub
|
||||
int i;
|
||||
|
||||
if (currentDirectory == rootDirectory) {
|
||||
return;
|
||||
}
|
||||
|
||||
for (i = currentDirectory.length() - 2; i > 0; i--) {
|
||||
if (currentDirectory[i] == '/') {
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if (currentDirectory[i] == '/') {
|
||||
i++;
|
||||
}
|
||||
|
||||
currentDirectory = str(currentDirectory, 0, i);
|
||||
|
||||
// refresh files
|
||||
SetupFiles();
|
||||
}
|
||||
|
||||
void FilePickerClass::Initialize( const char *root_directory, const char *current_directory, const char *ext )
|
||||
void FilePickerClass::GotoSubDirectory(str subdir)
|
||||
{
|
||||
// FIXME: stub
|
||||
currentDirectory += subdir + "/";
|
||||
|
||||
// refresh files
|
||||
SetupFiles();
|
||||
}
|
||||
|
||||
void FilePickerClass::CloseWindow( void )
|
||||
void FilePickerClass::SetupFiles(void)
|
||||
{
|
||||
// FIXME: stub
|
||||
str mappath;
|
||||
str work;
|
||||
char **filenames;
|
||||
int numfiles;
|
||||
int i;
|
||||
char date[128];
|
||||
char size[128];
|
||||
|
||||
listbox->DeleteAllItems();
|
||||
|
||||
if (currentDirectory != rootDirectory) {
|
||||
// create the parent directory item
|
||||
listbox->AddItem(new FilePickerItem("..", "", ""));
|
||||
}
|
||||
|
||||
// retrieve directories
|
||||
filenames = FS_ListFiles(currentDirectory, "/", qfalse, &numfiles);
|
||||
|
||||
for (i = 0; i < numfiles; i++) {
|
||||
const char *filename = filenames[i];
|
||||
|
||||
if (filename[0] == '.' || !strlen(filename)) {
|
||||
continue;
|
||||
}
|
||||
|
||||
work = "[";
|
||||
work += filename;
|
||||
work += "]";
|
||||
|
||||
FS_FileTime(currentDirectory + filename, date, size);
|
||||
|
||||
listbox->AddItem(new FilePickerItem(work, date, size));
|
||||
}
|
||||
|
||||
FS_FreeFileList(filenames);
|
||||
|
||||
filenames = FS_ListFiles(currentDirectory, extension, qfalse, &numfiles);
|
||||
|
||||
for (i = 0; i < numfiles; i++) {
|
||||
const char *filename = filenames[i];
|
||||
|
||||
if (ignoredFiles.length() && strstr(filename, ignoredFiles)) {
|
||||
// Added in 2.0
|
||||
// Check for ignored files
|
||||
continue;
|
||||
}
|
||||
|
||||
work = filename;
|
||||
|
||||
FS_FileTime(currentDirectory + work, date, size);
|
||||
|
||||
listbox->AddItem(new FilePickerItem(work, date, size));
|
||||
}
|
||||
|
||||
FS_FreeFileList(filenames);
|
||||
|
||||
window->setTitle(currentDirectory);
|
||||
}
|
||||
|
||||
void FilePickerClass::FileSelected( Event *ev )
|
||||
void FilePickerClass::FileSelected(const str& currentDirectory, const str& partialName, const str& fullname) {}
|
||||
|
||||
void FilePickerClass::FileSelected(Event *ev)
|
||||
{
|
||||
// FIXME: stub
|
||||
str name = listbox->GetItem(listbox->getCurrentItem())->getListItemString(0);
|
||||
|
||||
if (*name != '[' && *name != '.') {
|
||||
FileSelected(currentDirectory, name, currentDirectory + name);
|
||||
}
|
||||
|
||||
uii.Snd_PlaySound("sound/menu/scroll.wav");
|
||||
}
|
||||
|
||||
void FilePickerClass::FileSelected( str ¤tDirectory, str &partialName, str &fullname )
|
||||
void FilePickerClass::FileChosen(const str& currentDirectory, const str& partialName, const str& fullname) {}
|
||||
|
||||
void FilePickerClass::FileChosen(Event *ev)
|
||||
{
|
||||
// FIXME: stub
|
||||
str filename = listbox->GetItem(listbox->getCurrentItem())->getListItemString(0);
|
||||
|
||||
if (*filename == '[') {
|
||||
uii.Snd_PlaySound("sound/menu/scroll.wav");
|
||||
|
||||
GotoSubDirectory(str(filename, 1, filename.length() - 1));
|
||||
} else if (*filename == '.') {
|
||||
GotoParentDirectory();
|
||||
} else {
|
||||
uii.Snd_PlaySound("sound/menu/apply.wav");
|
||||
|
||||
FileChosen(currentDirectory, filename, currentDirectory + filename);
|
||||
}
|
||||
}
|
||||
|
||||
void FilePickerClass::FileChosen( Event *ev )
|
||||
void FilePickerClass::CloseWindow(void)
|
||||
{
|
||||
// FIXME: stub
|
||||
PostEvent(EV_Remove, 0);
|
||||
}
|
||||
|
||||
void FilePickerClass::FileChosen( str ¤tDirectory, str &partialName, str &fullname )
|
||||
void FilePickerClass::OnDeactivated(Event *ev)
|
||||
{
|
||||
// FIXME: stub
|
||||
CloseWindow();
|
||||
}
|
||||
|
||||
void FilePickerClass::OnDeactivated( Event *ev )
|
||||
FilePickerItem::FilePickerItem(const str& fileName, const str& date, const str& size)
|
||||
{
|
||||
// FIXME: stub
|
||||
strings[0] = fileName;
|
||||
strings[1] = date;
|
||||
strings[2] = size;
|
||||
}
|
||||
|
||||
void FilePickerClass::Setup( const char *root_directory, const char *current_directory, const char *ext )
|
||||
int FilePickerItem::getListItemValue(int which) const
|
||||
{
|
||||
// FIXME: stub
|
||||
return atoi(strings[which]);
|
||||
}
|
||||
|
||||
griditemtype_t FilePickerItem::getListItemType(int which) const
|
||||
{
|
||||
return griditemtype_t::TYPE_STRING;
|
||||
}
|
||||
|
||||
str FilePickerItem::getListItemString(int which) const
|
||||
{
|
||||
return strings[which];
|
||||
}
|
||||
|
||||
void FilePickerItem::DrawListItem(int iColumn, const UIRect2D& drawRect, bool bSelected, UIFont *pFont) {}
|
||||
|
||||
qboolean FilePickerItem::IsHeaderEntry() const
|
||||
{
|
||||
return qfalse;
|
||||
}
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
/*
|
||||
===========================================================================
|
||||
Copyright (C) 2015 the OpenMoHAA team
|
||||
Copyright (C) 2023 the OpenMoHAA team
|
||||
|
||||
This file is part of OpenMoHAA source code.
|
||||
|
||||
|
@ -20,40 +20,41 @@ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
|||
===========================================================================
|
||||
*/
|
||||
|
||||
#ifndef __CL_UIFILEPICKER_H__
|
||||
#define __CL_UIFILEPICKER_H__
|
||||
#pragma once
|
||||
|
||||
class UIListCtrl;
|
||||
|
||||
class FilePickerClass : public USignal {
|
||||
class FilePickerClass : public USignal
|
||||
{
|
||||
UIFloatingWindow *window;
|
||||
UIListCtrl *listbox;
|
||||
str currentDirectory;
|
||||
str rootDirectory;
|
||||
str extension;
|
||||
// Added in 2.0
|
||||
str ignoredFiles;
|
||||
|
||||
public:
|
||||
CLASS_PROTOTYPE( FilePickerClass );
|
||||
CLASS_PROTOTYPE(FilePickerClass);
|
||||
|
||||
private:
|
||||
void SetupFiles( void );
|
||||
void GotoParentDirectory( void );
|
||||
void GotoSubDirectory( str subdir );
|
||||
void Initialize( const char *root_directory, const char *current_directory, const char *ext );
|
||||
void SetupFiles(void);
|
||||
void GotoParentDirectory(void);
|
||||
void GotoSubDirectory(str subdir);
|
||||
// ignore_files parameter, added in 2.0
|
||||
void Initialize(const char *root_directory, const char *current_directory, const char *ext, const char* ignore_files);
|
||||
|
||||
protected:
|
||||
void CloseWindow( void );
|
||||
void FileSelected( Event *ev );
|
||||
virtual void FileSelected( str ¤tDirectory, str &partialName, str &fullname );
|
||||
void FileChosen( Event *ev );
|
||||
virtual void FileChosen( str ¤tDirectory, str &partialName, str &fullname );
|
||||
void OnDeactivated( Event *ev );
|
||||
void CloseWindow(void);
|
||||
void FileSelected(Event *ev);
|
||||
virtual void FileSelected(const str& currentDirectory, const str& partialName, const str& fullname);
|
||||
void FileChosen(Event *ev);
|
||||
virtual void FileChosen(const str& currentDirectory, const str& partialName, const str& fullname);
|
||||
void OnDeactivated(Event *ev);
|
||||
|
||||
public:
|
||||
FilePickerClass();
|
||||
~FilePickerClass();
|
||||
|
||||
void Setup( const char *root_directory, const char *current_directory, const char *ext );
|
||||
void Setup(const char *root_directory, const char *current_directory, const char *ext, const char* ignore_files = NULL);
|
||||
};
|
||||
|
||||
#endif /* __CL_UIFILEPICKER_H__ */
|
||||
|
|
118
code/client/cl_uigamespy.cpp
Normal file
118
code/client/cl_uigamespy.cpp
Normal file
|
@ -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);
|
||||
}
|
50
code/client/cl_uigamespy.h
Normal file
50
code/client/cl_uigamespy.h
Normal file
|
@ -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
|
||||
(
|
||||
|
@ -44,12 +45,11 @@ static float s_gmboxWidth = 640.0;
|
|||
static float s_gmboxOffsetX = 3.0f;
|
||||
static float s_gmboxOffsetY = 0.0f;
|
||||
|
||||
CLASS_DECLARATION( UIWidget, UIGMBox, NULL )
|
||||
{
|
||||
{ &W_SizeChanged, &UIGMBox::OnSizeChanged },
|
||||
{ &EV_GMBox_Goin, &UIGMBox::MoveInEvent },
|
||||
{ &EV_GMBox_Decay, &UIGMBox::DecayEvent },
|
||||
{ NULL, NULL }
|
||||
CLASS_DECLARATION(UIWidget, UIGMBox, NULL) {
|
||||
{&W_SizeChanged, &UIGMBox::OnSizeChanged},
|
||||
{&EV_GMBox_Goin, &UIGMBox::MoveInEvent },
|
||||
{&EV_GMBox_Decay, &UIGMBox::DecayEvent },
|
||||
{NULL, NULL }
|
||||
};
|
||||
|
||||
UIGMBox::UIGMBox()
|
||||
|
@ -61,18 +61,18 @@ UIGMBox::UIGMBox()
|
|||
m_iBeginDecay = 0;
|
||||
m_boxtime = uid.time;
|
||||
m_movespeed = 500;
|
||||
m_drawoutline = com_target_game->integer >= target_game_e::TG_MOHTA;
|
||||
}
|
||||
|
||||
void UIGMBox::VerifyBoxOut( void )
|
||||
void UIGMBox::VerifyBoxOut(void)
|
||||
{
|
||||
PostMoveinEvent();
|
||||
if (m_boxstate != boxstate_t::box_moving_out && m_boxstate != boxstate_t::box_out)
|
||||
{
|
||||
if (m_boxstate != boxstate_t::box_moving_out && m_boxstate != boxstate_t::box_out) {
|
||||
ChangeBoxState(boxstate_t::box_moving_out);
|
||||
}
|
||||
}
|
||||
|
||||
void UIGMBox::ChangeBoxState( boxstate_t state )
|
||||
void UIGMBox::ChangeBoxState(boxstate_t state)
|
||||
{
|
||||
m_boxstate = state;
|
||||
m_boxtime = uid.time;
|
||||
|
@ -83,7 +83,7 @@ void UIGMBox::ChangeBoxState( boxstate_t state )
|
|||
}
|
||||
}
|
||||
|
||||
void UIGMBox::HandleBoxMoving( void )
|
||||
void UIGMBox::HandleBoxMoving(void)
|
||||
{
|
||||
int delta;
|
||||
UIRect2D newRect;
|
||||
|
@ -94,28 +94,23 @@ void UIGMBox::HandleBoxMoving( void )
|
|||
|
||||
delta = m_movespeed * (uid.time - m_boxtime) / 1000;
|
||||
m_boxtime = 1000 * delta / m_movespeed + m_boxtime;
|
||||
if (m_boxstate == boxstate_t::box_moving_out)
|
||||
{
|
||||
if (m_boxstate == boxstate_t::box_moving_out) {
|
||||
newRect.size.width = m_frame.size.width;
|
||||
newRect.size.height = m_frame.size.height;
|
||||
newRect.pos.x = m_frame.pos.x;
|
||||
newRect.pos.y = delta + m_frame.pos.y;
|
||||
|
||||
if (newRect.pos.y <= 0.0)
|
||||
{
|
||||
if (newRect.pos.y <= 0.0) {
|
||||
newRect.pos.y = 0.0;
|
||||
ChangeBoxState(boxstate_t::box_out);
|
||||
}
|
||||
}
|
||||
else if (m_boxstate == boxstate_t::box_moving_in)
|
||||
{
|
||||
} else if (m_boxstate == boxstate_t::box_moving_in) {
|
||||
newRect.size.width = m_frame.size.width;
|
||||
newRect.size.height = m_frame.size.height;
|
||||
newRect.pos.x = m_frame.pos.x;
|
||||
newRect.pos.y = delta - m_frame.pos.y;
|
||||
|
||||
if (newRect.pos.y <= -newRect.size.height)
|
||||
{
|
||||
if (newRect.pos.y <= -newRect.size.height) {
|
||||
newRect.pos.y = -newRect.size.height;
|
||||
ChangeBoxState(boxstate_t::box_in);
|
||||
}
|
||||
|
@ -126,7 +121,7 @@ void UIGMBox::HandleBoxMoving( void )
|
|||
setFrame(newRect);
|
||||
}
|
||||
|
||||
void UIGMBox::PostMoveinEvent( void )
|
||||
void UIGMBox::PostMoveinEvent(void)
|
||||
{
|
||||
if (m_boxstate != boxstate_t::box_out) {
|
||||
return;
|
||||
|
@ -139,21 +134,19 @@ void UIGMBox::PostMoveinEvent( void )
|
|||
}
|
||||
}
|
||||
|
||||
void UIGMBox::PostDecayEvent( void )
|
||||
void UIGMBox::PostDecayEvent(void)
|
||||
{
|
||||
if (!EventPending(EV_GMBox_Decay))
|
||||
{
|
||||
if (!EventPending(EV_GMBox_Decay)) {
|
||||
float fDelayTime;
|
||||
int iNumLines;
|
||||
int i;
|
||||
const char* pszString = m_items[0].string.c_str();
|
||||
const char *pszString = m_items[0].string.c_str();
|
||||
|
||||
//
|
||||
// Calculate the number of lines
|
||||
//
|
||||
iNumLines = 1;
|
||||
for (i = 0; pszString[i]; i++)
|
||||
{
|
||||
for (i = 0; pszString[i]; i++) {
|
||||
if (pszString[i] == '\n') {
|
||||
iNumLines++;
|
||||
}
|
||||
|
@ -175,7 +168,7 @@ void UIGMBox::PostDecayEvent( void )
|
|||
}
|
||||
}
|
||||
|
||||
void UIGMBox::setShowState( void )
|
||||
void UIGMBox::setShowState(void)
|
||||
{
|
||||
if (m_reallyshown) {
|
||||
setShow(m_boxstate != box_in);
|
||||
|
@ -184,7 +177,7 @@ void UIGMBox::setShowState( void )
|
|||
}
|
||||
}
|
||||
|
||||
void UIGMBox::RemoveTopItem( void )
|
||||
void UIGMBox::RemoveTopItem(void)
|
||||
{
|
||||
int i;
|
||||
|
||||
|
@ -197,49 +190,37 @@ void UIGMBox::RemoveTopItem( void )
|
|||
}
|
||||
}
|
||||
|
||||
str UIGMBox::CalculateBreaks( UIFont *font, str text, float max_width )
|
||||
str UIGMBox::CalculateBreaks(UIFont *font, str text, float max_width)
|
||||
{
|
||||
str newText, sTmp;
|
||||
int i;
|
||||
str newText;
|
||||
float fX;
|
||||
float fwX, fsX;
|
||||
float fwX;
|
||||
const char *current;
|
||||
int count;
|
||||
|
||||
Cmd_TokenizeString(text.c_str());
|
||||
if (Cmd_Argc())
|
||||
{
|
||||
current = text;
|
||||
fX = 0.0;
|
||||
fsX = font->getCharWidth(' ');
|
||||
|
||||
for (i = 0; i < Cmd_Argc(); i++)
|
||||
{
|
||||
sTmp = Cmd_Argv(i);
|
||||
for (count = font->DBCSGetWordBlockCount(current, -1); count;
|
||||
current += count, count = font->DBCSGetWordBlockCount(current, -1)) {
|
||||
fwX = font->getWidth(current, count);
|
||||
|
||||
fwX = font->getWidth(sTmp.c_str(), -1);
|
||||
if (fwX + i <= max_width)
|
||||
{
|
||||
if (fwX + i + fX <= max_width)
|
||||
{
|
||||
newText += sTmp + " ";
|
||||
if (fX + fwX > max_width) {
|
||||
newText += "\n" + str(current, 0, count);
|
||||
fX = 0;
|
||||
} else {
|
||||
newText += "\n" + sTmp + " ";
|
||||
newText += str(current, 0, count);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
sTmp += "\n";
|
||||
fX = 0.0;
|
||||
}
|
||||
}
|
||||
} else {
|
||||
newText = "";
|
||||
|
||||
fX += fwX;
|
||||
}
|
||||
|
||||
return newText;
|
||||
}
|
||||
|
||||
float UIGMBox::PrintWrap( UIFont *font, float x, float y, str text )
|
||||
float UIGMBox::PrintWrap(UIFont *font, float x, float y, str text)
|
||||
{
|
||||
const char* p1, * p2;
|
||||
const char *p1, *p2;
|
||||
size_t n, l;
|
||||
float fY;
|
||||
|
||||
|
@ -247,8 +228,7 @@ float UIGMBox::PrintWrap( UIFont *font, float x, float y, str text )
|
|||
p1 = text.c_str();
|
||||
l = text.length();
|
||||
|
||||
for (;;)
|
||||
{
|
||||
for (;;) {
|
||||
p2 = strchr(p1, '\n');
|
||||
if (!p2) {
|
||||
break;
|
||||
|
@ -259,31 +239,55 @@ float UIGMBox::PrintWrap( UIFont *font, float x, float y, str text )
|
|||
break;
|
||||
}
|
||||
|
||||
font->Print(x, fY, p1, p2 - p1, qfalse);
|
||||
font->Print(x, fY, p1, p2 - p1, getHighResScale());
|
||||
p1 = p2 + 1;
|
||||
l -= n;
|
||||
fY += font->getHeight(qfalse);
|
||||
fY += font->getHeight();
|
||||
}
|
||||
|
||||
font->Print(x, fY, p1, l, qfalse);
|
||||
if (*p1) {
|
||||
font->Print(x, fY, p1, l, getHighResScale());
|
||||
fY += font->getHeight();
|
||||
}
|
||||
|
||||
return font->getHeight(qfalse) + (fY - y);
|
||||
return fY - y;
|
||||
}
|
||||
|
||||
float UIGMBox::DrawItem( item_t *in, float x, float y, float alpha )
|
||||
float UIGMBox::DrawItem(item_t *in, float x, float y, float alpha)
|
||||
{
|
||||
if (m_drawoutline) {
|
||||
//
|
||||
// Draw an outline
|
||||
//
|
||||
|
||||
in->font->setColor(UBlack);
|
||||
in->font->setAlpha(alpha);
|
||||
|
||||
PrintWrap(in->font, x + 1, y + 2, in->string);
|
||||
PrintWrap(in->font, x + 2, y + 1, in->string);
|
||||
PrintWrap(in->font, x - 1, y + 2, in->string);
|
||||
PrintWrap(in->font, x - 2, y + 1, in->string);
|
||||
PrintWrap(in->font, x - 1, y - 2, in->string);
|
||||
PrintWrap(in->font, x - 2, y - 1, in->string);
|
||||
PrintWrap(in->font, x + 1, y - 2, in->string);
|
||||
PrintWrap(in->font, x + 2, y - 1, in->string);
|
||||
PrintWrap(in->font, x + 2, y, in->string);
|
||||
PrintWrap(in->font, x - 2, y, in->string);
|
||||
PrintWrap(in->font, x, y + 2, in->string);
|
||||
PrintWrap(in->font, x, y - 2, in->string);
|
||||
}
|
||||
|
||||
in->font->setColor(in->color);
|
||||
in->font->setAlpha(alpha);
|
||||
|
||||
return PrintWrap(in->font, x, y, in->string);
|
||||
}
|
||||
|
||||
void UIGMBox::Print( const char *text )
|
||||
void UIGMBox::Print(const char *text)
|
||||
{
|
||||
const char* text1 = text;
|
||||
const char *text1 = text;
|
||||
|
||||
if (m_numitems > 4)
|
||||
{
|
||||
if (m_numitems > 4) {
|
||||
//
|
||||
// Overwrite an item
|
||||
//
|
||||
|
@ -292,33 +296,30 @@ 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;
|
||||
|
||||
text1 = text + 1;
|
||||
}
|
||||
else
|
||||
{
|
||||
} else {
|
||||
m_items[m_numitems].color = m_foreground_color;
|
||||
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();
|
||||
PostDecayEvent();
|
||||
}
|
||||
|
||||
void UIGMBox::OnSizeChanged( Event *ev )
|
||||
void UIGMBox::OnSizeChanged(Event *ev)
|
||||
{
|
||||
s_gmboxWidth = m_frame.size.width;
|
||||
}
|
||||
|
||||
void UIGMBox::Create( const UIRect2D& rect, const UColor& fore, const UColor& back, float alpha )
|
||||
void UIGMBox::Create(const UIRect2D& rect, const UColor& fore, const UColor& back, float alpha)
|
||||
{
|
||||
InitFrame(NULL, rect, 0, "facfont-20");
|
||||
|
||||
|
@ -339,11 +340,9 @@ void UIGMBox::Create( const UIRect2D& rect, const UColor& fore, const UColor& ba
|
|||
setShowState();
|
||||
}
|
||||
|
||||
void UIGMBox::MoveInEvent( Event *ev )
|
||||
{
|
||||
}
|
||||
void UIGMBox::MoveInEvent(Event *ev) {}
|
||||
|
||||
void UIGMBox::DecayEvent( Event *ev )
|
||||
void UIGMBox::DecayEvent(Event *ev)
|
||||
{
|
||||
RemoveTopItem();
|
||||
if (m_numitems) {
|
||||
|
@ -351,7 +350,7 @@ void UIGMBox::DecayEvent( Event *ev )
|
|||
}
|
||||
}
|
||||
|
||||
void UIGMBox::Draw( void )
|
||||
void UIGMBox::Draw(void)
|
||||
{
|
||||
float fsY;
|
||||
int i;
|
||||
|
@ -370,10 +369,14 @@ void UIGMBox::Draw( void )
|
|||
|
||||
m_font->setColor(m_foreground_color);
|
||||
alpha = (float)(cls.realtime - m_iBeginDecay) / (float)m_iEndDecay;
|
||||
if (alpha > 1.0) alpha = 1.0;
|
||||
if (alpha > 1.0) {
|
||||
alpha = 1.0;
|
||||
}
|
||||
|
||||
alpha = (1.0 - alpha) * 4.0;
|
||||
if (alpha > 1.0) alpha = 1.0;
|
||||
if (alpha > 1.0) {
|
||||
alpha = 1.0;
|
||||
}
|
||||
|
||||
if (cge) {
|
||||
alphaScale = 1.0 - cge->CG_GetObjectiveAlpha();
|
||||
|
@ -382,11 +385,9 @@ void UIGMBox::Draw( void )
|
|||
fsY = DrawItem(m_items, s_gmboxOffsetX, s_gmboxOffsetY, alpha * alphaScale);
|
||||
fsY = alpha <= 0.2 ? s_gmboxOffsetY : fsY + s_gmboxOffsetY;
|
||||
|
||||
for (i = 1; i < m_numitems; i++)
|
||||
{
|
||||
for (i = 1; i < m_numitems; i++) {
|
||||
fsY += DrawItem(&m_items[i], s_gmboxOffsetX, fsY, alphaScale);
|
||||
if (fsY > m_frame.size.height)
|
||||
{
|
||||
if (fsY > m_frame.size.height) {
|
||||
if (EventPending(EV_GMBox_Decay)) {
|
||||
CancelEventsOfType(EV_GMBox_Decay);
|
||||
}
|
||||
|
@ -397,14 +398,13 @@ void UIGMBox::Draw( void )
|
|||
}
|
||||
}
|
||||
|
||||
void UIGMBox::setRealShow( bool b )
|
||||
void UIGMBox::setRealShow(bool b)
|
||||
{
|
||||
this->m_reallyshown = b;
|
||||
setShowState();
|
||||
}
|
||||
|
||||
void UIGMBox::Clear( void )
|
||||
void UIGMBox::Clear(void)
|
||||
{
|
||||
m_numitems = 0;
|
||||
}
|
||||
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
/*
|
||||
===========================================================================
|
||||
Copyright (C) 2015 the OpenMoHAA team
|
||||
Copyright (C) 2015-2024 the OpenMoHAA team
|
||||
|
||||
This file is part of OpenMoHAA source code.
|
||||
|
||||
|
@ -20,8 +20,7 @@ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
|||
===========================================================================
|
||||
*/
|
||||
|
||||
#ifndef __CL_UIGMBOX_H__
|
||||
#define __CL_UIGMBOX_H__
|
||||
#pragma once
|
||||
|
||||
static constexpr unsigned int GMBOX_ITEM_FLAG_BOLD = 1u;
|
||||
|
||||
|
@ -44,6 +43,8 @@ protected:
|
|||
int m_movespeed;
|
||||
int m_iBeginDecay;
|
||||
int m_iEndDecay;
|
||||
// Added in OPM
|
||||
bool m_drawoutline;
|
||||
|
||||
public:
|
||||
CLASS_PROTOTYPE( UIGMBox );
|
||||
|
@ -72,5 +73,3 @@ public:
|
|||
void setRealShow( bool b );
|
||||
void Clear( void );
|
||||
};
|
||||
|
||||
#endif
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
/*
|
||||
===========================================================================
|
||||
Copyright (C) 2015 the OpenMoHAA team
|
||||
Copyright (C) 2023-2024 the OpenMoHAA team
|
||||
|
||||
This file is part of OpenMoHAA source code.
|
||||
|
||||
|
@ -21,44 +21,224 @@ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
|||
*/
|
||||
|
||||
#include "cl_ui.h"
|
||||
#include "../qcommon/localization.h"
|
||||
|
||||
CLASS_DECLARATION( UIListCtrl, UILANGameClass, NULL )
|
||||
class LANGameItem : public UIListCtrlItem
|
||||
{
|
||||
{ NULL, NULL }
|
||||
str strings[6];
|
||||
|
||||
public:
|
||||
LANGameItem();
|
||||
LANGameItem(
|
||||
const str& hostName, const str& mapName, const str& players, const str& gameTypeString, const str& ping, const str& ipAddress
|
||||
);
|
||||
|
||||
int getListItemValue(int which) const override;
|
||||
griditemtype_t getListItemType(int which) const override;
|
||||
str getListItemString(int which) const override;
|
||||
void DrawListItem(int iColumn, const UIRect2D& drawRect, bool bSelected, UIFont *pFont) override;
|
||||
qboolean IsHeaderEntry() const override;
|
||||
};
|
||||
|
||||
Event EV_LANGame_JoinGame
|
||||
(
|
||||
"joingame",
|
||||
EV_DEFAULT,
|
||||
NULL,
|
||||
NULL,
|
||||
"Join the currently selected server"
|
||||
);
|
||||
|
||||
CLASS_DECLARATION(UIListCtrl, UILANGameClass, NULL) {
|
||||
{&EV_UIListBase_ItemSelected, &UILANGameClass::SelectServer},
|
||||
{&EV_UIListBase_ItemDoubleClicked, &UILANGameClass::JoinServer },
|
||||
{&EV_LANGame_JoinGame, &UILANGameClass::JoinServer },
|
||||
{NULL, NULL }
|
||||
};
|
||||
|
||||
UILANGameClass::UILANGameClass()
|
||||
{
|
||||
// FIXME: stub
|
||||
Connect(this, EV_UIListBase_ItemDoubleClicked, EV_UIListBase_ItemDoubleClicked);
|
||||
Connect(this, EV_UIListBase_ItemSelected, EV_UIListBase_ItemSelected);
|
||||
AllowActivate(true);
|
||||
setHeaderFont("facfont-20");
|
||||
|
||||
m_iLastUpdateTime = 0;
|
||||
m_noservers_mat = uWinMan.RegisterShader("textures/menu/noservers");
|
||||
|
||||
//
|
||||
// Added in OPM
|
||||
//
|
||||
m_bVirtual = false;
|
||||
}
|
||||
|
||||
void UILANGameClass::SetupServers( void )
|
||||
void UILANGameClass::Draw(void)
|
||||
{
|
||||
// FIXME: stub
|
||||
if (cls.bNewLocalServerInfo) {
|
||||
SetupServers();
|
||||
}
|
||||
|
||||
UIListCtrl::Draw();
|
||||
|
||||
if (!getNumItems() && m_noservers_mat) {
|
||||
float x, y, w, h;
|
||||
|
||||
w = re.GetShaderWidth(m_noservers_mat->GetMaterial()) * m_vVirtualScale[0];
|
||||
h = re.GetShaderHeight(m_noservers_mat->GetMaterial()) * m_vVirtualScale[1];
|
||||
|
||||
UIRect2D frame = getClientFrame();
|
||||
x = (frame.size.width - w) * 0.5f;
|
||||
y = (frame.size.height - h) * 0.5f;
|
||||
|
||||
re.DrawStretchPic(x, y, w, h, 0, 0, 1, 1, m_noservers_mat->GetMaterial());
|
||||
}
|
||||
|
||||
if (m_iLastUpdateTime && m_iLastUpdateTime < cls.realtime) {
|
||||
Cvar_Set("cl_langamerefreshstatus", "Ready");
|
||||
m_iLastUpdateTime = 0;
|
||||
}
|
||||
}
|
||||
|
||||
void UILANGameClass::Draw( void )
|
||||
void UILANGameClass::UpdateUIElement(void)
|
||||
{
|
||||
// FIXME: stub
|
||||
float width;
|
||||
|
||||
RemoveAllColumns();
|
||||
|
||||
width = getClientFrame().size.width - 16.f;
|
||||
|
||||
AddColumn(Sys_LV_CL_ConvertString("Server Name"), 0, width * 0.27f, false, false); // was 0.4
|
||||
AddColumn(Sys_LV_CL_ConvertString("Map"), 1, width * 0.12f, false, false); // was 0.15
|
||||
AddColumn(Sys_LV_CL_ConvertString("Players"), 2, width * 0.08f, true, true); // was 0.165
|
||||
AddColumn(Sys_LV_CL_ConvertString("GameType"), 3, width * 0.118f, false, false); // was 0.22
|
||||
AddColumn(Sys_LV_CL_ConvertString("Ping"), 4, width * 0.052f, true, false); // was 0.065
|
||||
AddColumn(Sys_LV_CL_ConvertString("IP"), 5, width * 0.36f, false, false); // Added in OPM
|
||||
|
||||
uWinMan.ActivateControl(this);
|
||||
|
||||
SetupServers();
|
||||
}
|
||||
|
||||
void UILANGameClass::SelectServer( Event *ev )
|
||||
void UILANGameClass::SetupServers(void)
|
||||
{
|
||||
// FIXME: stub
|
||||
int i;
|
||||
LANGameItem *pItem;
|
||||
const serverInfo_t *pServerInfo;
|
||||
|
||||
for (i = 1; i <= cls.numlocalservers; i++) {
|
||||
pServerInfo = &cls.localServers[i - 1];
|
||||
|
||||
if (i > getNumItems()) {
|
||||
pItem = new LANGameItem();
|
||||
AddItem(pItem);
|
||||
} else {
|
||||
pItem = static_cast<LANGameItem *>(GetItem(i));
|
||||
}
|
||||
|
||||
*pItem = LANGameItem(
|
||||
pServerInfo->hostName,
|
||||
pServerInfo->mapName,
|
||||
va("%02i/%02i", pServerInfo->clients, pServerInfo->maxClients),
|
||||
pServerInfo->gameTypeString,
|
||||
str(pServerInfo->ping),
|
||||
// Added in OPM
|
||||
NET_AdrToStringwPort(pServerInfo->adr)
|
||||
);
|
||||
}
|
||||
|
||||
while (cls.numlocalservers < getNumItems()) {
|
||||
DeleteItem(getNumItems());
|
||||
}
|
||||
|
||||
cls.bNewLocalServerInfo = false;
|
||||
m_iLastUpdateTime = 0;
|
||||
}
|
||||
|
||||
void UILANGameClass::JoinServer( Event *ev )
|
||||
void UILANGameClass::SelectServer(Event *ev)
|
||||
{
|
||||
// FIXME: stub
|
||||
const serverInfo_t& serverInfo = cls.localServers[getCurrentItem() - 1];
|
||||
static const char info[] = "\xFF\xFF\xFF\xFF\x02getinfo xxx";
|
||||
|
||||
Com_Printf("Requesting updated info from server...\n");
|
||||
Cvar_Set("cl_langamerefreshstatus", "Requesting updated info from server...");
|
||||
|
||||
NET_SendPacket(NS_CLIENT, sizeof(info), info, serverInfo.adr);
|
||||
m_iLastUpdateTime = cls.realtime + 3000;
|
||||
}
|
||||
|
||||
qboolean UILANGameClass::KeyEvent( int key, unsigned int time )
|
||||
void UILANGameClass::JoinServer(Event *ev)
|
||||
{
|
||||
if (!getCurrentItem()) {
|
||||
return;
|
||||
}
|
||||
|
||||
const serverInfo_t& serverInfo = cls.localServers[getCurrentItem() - 1];
|
||||
|
||||
UI_SetReturnMenuToCurrent();
|
||||
CL_Connect(NET_AdrToStringwPort(serverInfo.adr), netadrtype_t::NA_UNSPEC);
|
||||
}
|
||||
|
||||
qboolean UILANGameClass::KeyEvent(int key, unsigned int time)
|
||||
{
|
||||
switch (key) {
|
||||
case K_ENTER:
|
||||
case K_KP_ENTER:
|
||||
JoinServer(NULL);
|
||||
return true;
|
||||
case K_UPARROW:
|
||||
if (getCurrentItem() > 1) {
|
||||
TrySelectItem(getCurrentItem() - 1);
|
||||
SelectServer(NULL);
|
||||
}
|
||||
return false;
|
||||
case K_DOWNARROW:
|
||||
if (getCurrentItem() < getNumItems()) {
|
||||
TrySelectItem(getCurrentItem() + 1);
|
||||
SelectServer(NULL);
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
return UIListBase::KeyEvent(key, time);
|
||||
}
|
||||
|
||||
LANGameItem::LANGameItem() {}
|
||||
|
||||
LANGameItem::LANGameItem(
|
||||
const str& hostName, const str& mapName, const str& players, const str& gameTypeString, const str& ping, const str& ipAddress
|
||||
)
|
||||
{
|
||||
strings[0] = hostName;
|
||||
strings[1] = mapName;
|
||||
strings[2] = players;
|
||||
strings[3] = gameTypeString;
|
||||
strings[4] = ping;
|
||||
|
||||
//
|
||||
// Added in OPM
|
||||
//
|
||||
|
||||
strings[5] = ipAddress;
|
||||
}
|
||||
|
||||
int LANGameItem::getListItemValue(int which) const
|
||||
{
|
||||
return atoi(strings[which]);
|
||||
}
|
||||
|
||||
griditemtype_t LANGameItem::getListItemType(int which) const
|
||||
{
|
||||
return griditemtype_t::TYPE_STRING;
|
||||
}
|
||||
|
||||
str LANGameItem::getListItemString(int which) const
|
||||
{
|
||||
return strings[which];
|
||||
}
|
||||
|
||||
void LANGameItem::DrawListItem(int iColumn, const UIRect2D& drawRect, bool bSelected, UIFont *pFont) {}
|
||||
|
||||
qboolean LANGameItem::IsHeaderEntry() const
|
||||
{
|
||||
// FIXME: stub
|
||||
return qfalse;
|
||||
}
|
||||
|
||||
void UILANGameClass::UpdateUIElement( void )
|
||||
{
|
||||
// FIXME: stub
|
||||
}
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
/*
|
||||
===========================================================================
|
||||
Copyright (C) 2015 the OpenMoHAA team
|
||||
Copyright (C) 2023 the OpenMoHAA team
|
||||
|
||||
This file is part of OpenMoHAA source code.
|
||||
|
||||
|
@ -20,29 +20,27 @@ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
|||
===========================================================================
|
||||
*/
|
||||
|
||||
#ifndef __CL_UILANGAME_H__
|
||||
#define __CL_UILANGAME_H__
|
||||
#pragma once
|
||||
|
||||
class UILANGameClass : public UIListCtrl {
|
||||
class UILANGameClass : public UIListCtrl
|
||||
{
|
||||
protected:
|
||||
int m_iLastUpdateTime;
|
||||
UIReggedMaterial *m_noservers_mat;
|
||||
|
||||
public:
|
||||
CLASS_PROTOTYPE( UILANGameClass );
|
||||
CLASS_PROTOTYPE(UILANGameClass);
|
||||
|
||||
private:
|
||||
void SetupServers( void );
|
||||
void SetupServers(void);
|
||||
|
||||
protected:
|
||||
void Draw( void ) override;
|
||||
void SelectServer( Event *ev );
|
||||
void JoinServer( Event *ev );
|
||||
qboolean KeyEvent( int key, unsigned int time ) override;
|
||||
void UpdateUIElement( void ) override;
|
||||
void Draw(void) override;
|
||||
void SelectServer(Event *ev);
|
||||
void JoinServer(Event *ev);
|
||||
qboolean KeyEvent(int key, unsigned int time) override;
|
||||
void UpdateUIElement(void) override;
|
||||
|
||||
public:
|
||||
UILANGameClass();
|
||||
};
|
||||
|
||||
#endif /* __CL_UILANGAME_H__ */
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
/*
|
||||
===========================================================================
|
||||
Copyright (C) 2015 the OpenMoHAA team
|
||||
Copyright (C) 2023 the OpenMoHAA team
|
||||
|
||||
This file is part of OpenMoHAA source code.
|
||||
|
||||
|
@ -21,63 +21,359 @@ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
|||
*/
|
||||
|
||||
#include "cl_ui.h"
|
||||
#include "../qcommon/localization.h"
|
||||
|
||||
CLASS_DECLARATION( UIListCtrl, UIFAKKLoadGameClass, NULL )
|
||||
class FAKKLoadGameItem : public UIListCtrlItem
|
||||
{
|
||||
{ NULL, NULL }
|
||||
str strings[4];
|
||||
|
||||
public:
|
||||
FAKKLoadGameItem(const str& missionName, const str& elapsedTime, const str& dateTime, const str& fileName);
|
||||
|
||||
int getListItemValue(int which) const override;
|
||||
griditemtype_t getListItemType(int which) const override;
|
||||
str getListItemString(int which) const override;
|
||||
void DrawListItem(int iColumn, const UIRect2D& drawRect, bool bSelected, UIFont *pFont) override;
|
||||
qboolean IsHeaderEntry() const override;
|
||||
};
|
||||
|
||||
static UIFAKKLoadGameClass *loadgame_ui = NULL;
|
||||
|
||||
Event EV_FAKKLoadGame_LoadGame
|
||||
(
|
||||
"loadgame",
|
||||
EV_DEFAULT,
|
||||
NULL,
|
||||
NULL,
|
||||
"Load the currently selected game"
|
||||
);
|
||||
Event EV_FAKKLoadGame_RemoveGame
|
||||
(
|
||||
"removegame",
|
||||
EV_DEFAULT,
|
||||
NULL,
|
||||
NULL,
|
||||
"Delete the currently selected game"
|
||||
);
|
||||
Event EV_FAKKLoadGame_DeleteGame
|
||||
(
|
||||
"deletegame",
|
||||
EV_DEFAULT,
|
||||
NULL,
|
||||
NULL,
|
||||
"Delete the currently selected game... for real"
|
||||
);
|
||||
Event EV_FAKKLoadGame_NoDeleteGame
|
||||
(
|
||||
"nodeletegame",
|
||||
EV_DEFAULT,
|
||||
NULL,
|
||||
NULL,
|
||||
"Delete the currently selected game... for real"
|
||||
);
|
||||
Event EV_FAKKLoadGame_SaveGame
|
||||
(
|
||||
"savegame",
|
||||
EV_DEFAULT,
|
||||
NULL,
|
||||
NULL,
|
||||
"Save the currently selected game"
|
||||
);
|
||||
|
||||
CLASS_DECLARATION(UIListCtrl, UIFAKKLoadGameClass, NULL) {
|
||||
{&EV_UIListBase_ItemSelected, &UIFAKKLoadGameClass::SelectGame },
|
||||
{&EV_UIListBase_ItemDoubleClicked, &UIFAKKLoadGameClass::LoadGame },
|
||||
{&EV_FAKKLoadGame_RemoveGame, &UIFAKKLoadGameClass::RemoveGame },
|
||||
{&EV_FAKKLoadGame_DeleteGame, &UIFAKKLoadGameClass::DeleteGame },
|
||||
{&EV_FAKKLoadGame_NoDeleteGame, &UIFAKKLoadGameClass::NoDeleteGame},
|
||||
{&EV_FAKKLoadGame_LoadGame, &UIFAKKLoadGameClass::LoadGame },
|
||||
{&EV_FAKKLoadGame_SaveGame, &UIFAKKLoadGameClass::SaveGame },
|
||||
{NULL, NULL }
|
||||
};
|
||||
|
||||
UIFAKKLoadGameClass::UIFAKKLoadGameClass()
|
||||
{
|
||||
// FIXME: stub
|
||||
Connect(this, EV_UIListBase_ItemDoubleClicked, EV_UIListBase_ItemDoubleClicked);
|
||||
Connect(this, EV_UIListBase_ItemSelected, EV_UIListBase_ItemSelected);
|
||||
AllowActivate(true);
|
||||
m_bRemovePending = false;
|
||||
|
||||
setHeaderFont("facfont-20");
|
||||
loadgame_ui = this;
|
||||
}
|
||||
|
||||
void UIFAKKLoadGameClass::SelectGame( Event *ev )
|
||||
UIFAKKLoadGameClass::~UIFAKKLoadGameClass()
|
||||
{
|
||||
// FIXME: stub
|
||||
loadgame_ui = NULL;
|
||||
}
|
||||
|
||||
void UIFAKKLoadGameClass::LoadGame( Event *ev )
|
||||
void UIFAKKLoadGameClass::UpdateUIElement(void)
|
||||
{
|
||||
// FIXME: stub
|
||||
float width;
|
||||
|
||||
RemoveAllColumns();
|
||||
|
||||
width = getClientFrame().size.width;
|
||||
AddColumn(Sys_LV_CL_ConvertString("Mission"), 0, width * 0.555, false, false);
|
||||
AddColumn(Sys_LV_CL_ConvertString("Elapsed Time"), 1, width * 0.17f, true, true);
|
||||
AddColumn(Sys_LV_CL_ConvertString("Date & Time Logged"), 2, width * 0.275f, true, true);
|
||||
|
||||
uWinMan.ActivateControl(this);
|
||||
|
||||
SetupFiles();
|
||||
}
|
||||
|
||||
void UIFAKKLoadGameClass::SaveGame( Event *ev )
|
||||
void UIFAKKLoadGameClass::SetupFiles(void)
|
||||
{
|
||||
// FIXME: stub
|
||||
char **filenames;
|
||||
int numfiles;
|
||||
int i;
|
||||
const char *searchFolder = Com_GetArchiveFolder();
|
||||
|
||||
// cleanup
|
||||
DeleteAllItems();
|
||||
|
||||
filenames = FS_ListFiles(searchFolder, "ssv", qfalse, &numfiles);
|
||||
|
||||
for (i = 0; i < numfiles; i++) {
|
||||
const char *filename;
|
||||
str work;
|
||||
str gametime;
|
||||
str date;
|
||||
fileHandle_t f;
|
||||
savegamestruct_t save;
|
||||
|
||||
filename = filenames[i];
|
||||
work = searchFolder;
|
||||
work += "/";
|
||||
work += filename;
|
||||
|
||||
FS_FOpenFileRead(work, &f, qfalse, qtrue);
|
||||
if (!f) {
|
||||
continue;
|
||||
}
|
||||
|
||||
FS_Read(&save, sizeof(savegamestruct_t), f);
|
||||
FS_FCloseFile(f);
|
||||
Com_SwapSaveStruct(&save);
|
||||
|
||||
if (save.version != SAVEGAME_STRUCT_VERSION) {
|
||||
// wrong save game version
|
||||
continue;
|
||||
}
|
||||
|
||||
if (save.type != com_target_game->integer) {
|
||||
continue;
|
||||
}
|
||||
|
||||
gametime = (save.mapTime / 1000);
|
||||
date = save.time;
|
||||
|
||||
AddItem(new FAKKLoadGameItem(save.comment, gametime, date, save.saveName));
|
||||
}
|
||||
|
||||
FS_FreeFileList(filenames);
|
||||
|
||||
// sort by date
|
||||
SortByColumn(2);
|
||||
|
||||
// select the first item
|
||||
TrySelectItem(1);
|
||||
SelectGame(NULL);
|
||||
}
|
||||
|
||||
void UIFAKKLoadGameClass::RemoveGame( Event *ev )
|
||||
void UIFAKKLoadGameClass::SelectGame(Event *ev)
|
||||
{
|
||||
// FIXME: stub
|
||||
UIWidget *wid;
|
||||
const char *shotName;
|
||||
|
||||
if (getCurrentItem() > 0) {
|
||||
shotName = Com_GetArchiveFileName(GetItem(getCurrentItem())->getListItemString(3), "tga");
|
||||
} else {
|
||||
shotName = "textures/menu/no_saved_games.tga";
|
||||
}
|
||||
|
||||
wid = findSibling("LoadSaveShot");
|
||||
if (!wid) {
|
||||
return;
|
||||
}
|
||||
|
||||
wid->setMaterial(uWinMan.RefreshShader(shotName));
|
||||
}
|
||||
|
||||
void UIFAKKLoadGameClass::DeleteGame( Event *ev )
|
||||
void UIFAKKLoadGameClass::RemoveGame(Event *ev)
|
||||
{
|
||||
// FIXME: stub
|
||||
if (m_bRemovePending || getCurrentItem() <= 0) {
|
||||
return;
|
||||
}
|
||||
|
||||
Cbuf_ExecuteText(
|
||||
EXEC_NOW,
|
||||
"dialog \"\" \"\" \"widgetcommand LoadSaveList deletegame\" \"widgetcommand LoadSaveList nodeletegame\" 256 64 "
|
||||
"confirm_delete menu_button_trans menu_button_trans\n"
|
||||
);
|
||||
m_bRemovePending = true;
|
||||
}
|
||||
|
||||
void UIFAKKLoadGameClass::NoDeleteGame( Event *ev )
|
||||
void UIFAKKLoadGameClass::NoDeleteGame(Event *ev)
|
||||
{
|
||||
// FIXME: stub
|
||||
m_bRemovePending = false;
|
||||
}
|
||||
|
||||
qboolean UIFAKKLoadGameClass::KeyEvent( int key, unsigned int time )
|
||||
void UIFAKKLoadGameClass::DeleteGame(Event *ev)
|
||||
{
|
||||
// FIXME: stub
|
||||
str name;
|
||||
cvar_t *var;
|
||||
m_bRemovePending = false;
|
||||
|
||||
if (getCurrentItem() <= 0) {
|
||||
return;
|
||||
}
|
||||
|
||||
name = GetItem(getCurrentItem())->getListItemString(3);
|
||||
var = Cvar_Get("g_lastsave", "", 0);
|
||||
|
||||
if (!strcmp(name, var->string)) {
|
||||
// Make sure the last save is not the save being deleted
|
||||
Cvar_Set("g_lastsave", "");
|
||||
}
|
||||
|
||||
Com_WipeSavegame(name);
|
||||
SetupFiles();
|
||||
}
|
||||
|
||||
void UIFAKKLoadGameClass::LoadGame(Event *ev)
|
||||
{
|
||||
char cmdString[266];
|
||||
str name;
|
||||
|
||||
if (getCurrentItem() <= 0) {
|
||||
return;
|
||||
}
|
||||
|
||||
name = GetItem(getCurrentItem())->getListItemString(3);
|
||||
// Execute the command
|
||||
Com_sprintf(cmdString, sizeof(cmdString), "loadgame %s\n", name.c_str());
|
||||
Cbuf_AddText(cmdString);
|
||||
}
|
||||
|
||||
void UIFAKKLoadGameClass::SaveGame(Event *ev)
|
||||
{
|
||||
Cbuf_ExecuteText(EXEC_NOW, "savegame");
|
||||
}
|
||||
|
||||
qboolean UIFAKKLoadGameClass::KeyEvent(int key, unsigned int time)
|
||||
{
|
||||
switch (key) {
|
||||
case K_DEL:
|
||||
RemoveGame(NULL);
|
||||
return qtrue;
|
||||
case K_ENTER:
|
||||
case K_KP_ENTER:
|
||||
LoadGame(NULL);
|
||||
return qtrue;
|
||||
case K_UPARROW:
|
||||
if (getCurrentItem() > 1) {
|
||||
TrySelectItem(getCurrentItem() - 1);
|
||||
SelectGame(NULL);
|
||||
return qtrue;
|
||||
}
|
||||
break;
|
||||
case K_DOWNARROW:
|
||||
if (getCurrentItem() < getNumItems()) {
|
||||
TrySelectItem(getCurrentItem() + 1);
|
||||
SelectGame(NULL);
|
||||
return qtrue;
|
||||
}
|
||||
break;
|
||||
default:
|
||||
return UIListCtrl::KeyEvent(key, time);
|
||||
}
|
||||
|
||||
return qfalse;
|
||||
}
|
||||
|
||||
void UIFAKKLoadGameClass::UpdateUIElement( void )
|
||||
void UI_SetupFiles(void)
|
||||
{
|
||||
// FIXME: stub
|
||||
if (loadgame_ui && loadgame_ui->getShow()) {
|
||||
loadgame_ui->SetupFiles();
|
||||
}
|
||||
}
|
||||
|
||||
void UIFAKKLoadGameClass::SetupFiles( void )
|
||||
FAKKLoadGameItem::FAKKLoadGameItem(
|
||||
const str& missionName, const str& elapsedTime, const str& dateTime, const str& fileName
|
||||
)
|
||||
{
|
||||
// FIXME: stub
|
||||
strings[0] = missionName;
|
||||
strings[1] = elapsedTime;
|
||||
strings[2] = dateTime;
|
||||
strings[3] = fileName;
|
||||
}
|
||||
|
||||
void UI_SetupFiles( void ) {
|
||||
// FIXME: stub
|
||||
int FAKKLoadGameItem::getListItemValue(int which) const
|
||||
{
|
||||
return atoi(strings[which]);
|
||||
}
|
||||
|
||||
griditemtype_t FAKKLoadGameItem::getListItemType(int which) const
|
||||
{
|
||||
return griditemtype_t::TYPE_STRING;
|
||||
}
|
||||
|
||||
str FAKKLoadGameItem::getListItemString(int which) const
|
||||
{
|
||||
str itemstring;
|
||||
|
||||
switch (which) {
|
||||
case 0:
|
||||
case 3:
|
||||
itemstring = strings[which];
|
||||
break;
|
||||
case 1:
|
||||
{
|
||||
int numseconds;
|
||||
int numseconds_hours;
|
||||
int seconds;
|
||||
|
||||
// hours
|
||||
numseconds = atol(strings[1]);
|
||||
itemstring += (numseconds / 3600);
|
||||
itemstring += ":";
|
||||
|
||||
// minutes
|
||||
numseconds_hours = numseconds % 3600;
|
||||
if (numseconds_hours / 60 < 10) {
|
||||
itemstring += "0";
|
||||
}
|
||||
itemstring += (numseconds_hours / 60);
|
||||
itemstring += ":";
|
||||
|
||||
// seconds
|
||||
seconds = numseconds_hours % 60;
|
||||
if (seconds < 10) {
|
||||
itemstring += "0";
|
||||
}
|
||||
itemstring += seconds;
|
||||
}
|
||||
break;
|
||||
case 2:
|
||||
{
|
||||
time_t time;
|
||||
char buffer[2048];
|
||||
|
||||
time = atol(strings[2]);
|
||||
strftime(buffer, sizeof(buffer), "%a %b %d %Y %H:%M:%S", localtime(&time));
|
||||
itemstring = buffer;
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
return itemstring;
|
||||
}
|
||||
|
||||
void FAKKLoadGameItem::DrawListItem(int iColumn, const UIRect2D& drawRect, bool bSelected, UIFont *pFont) {}
|
||||
|
||||
qboolean FAKKLoadGameItem::IsHeaderEntry() const
|
||||
{
|
||||
return qfalse;
|
||||
}
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
/*
|
||||
===========================================================================
|
||||
Copyright (C) 2015 the OpenMoHAA team
|
||||
Copyright (C) 2023 the OpenMoHAA team
|
||||
|
||||
This file is part of OpenMoHAA source code.
|
||||
|
||||
|
@ -22,23 +22,26 @@ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
|||
|
||||
#pragma once
|
||||
|
||||
class UIFAKKLoadGameClass : public UIListCtrl {
|
||||
class UIFAKKLoadGameClass : public UIListCtrl
|
||||
{
|
||||
bool m_bRemovePending;
|
||||
|
||||
public:
|
||||
CLASS_PROTOTYPE( UIFAKKLoadGameClass );
|
||||
CLASS_PROTOTYPE(UIFAKKLoadGameClass);
|
||||
|
||||
protected:
|
||||
void SelectGame( Event *ev );
|
||||
void LoadGame( Event *ev );
|
||||
void SaveGame( Event *ev );
|
||||
void RemoveGame( Event *ev );
|
||||
void DeleteGame( Event *ev );
|
||||
void NoDeleteGame( Event *ev );
|
||||
qboolean KeyEvent( int key, unsigned int time ) override;
|
||||
void UpdateUIElement( void ) override;
|
||||
void SelectGame(Event *ev);
|
||||
void LoadGame(Event *ev);
|
||||
void SaveGame(Event *ev);
|
||||
void RemoveGame(Event *ev);
|
||||
void DeleteGame(Event *ev);
|
||||
void NoDeleteGame(Event *ev);
|
||||
qboolean KeyEvent(int key, unsigned int time) override;
|
||||
void UpdateUIElement(void) override;
|
||||
|
||||
public:
|
||||
UIFAKKLoadGameClass();
|
||||
~UIFAKKLoadGameClass();
|
||||
|
||||
void SetupFiles( void );
|
||||
void SetupFiles(void);
|
||||
};
|
||||
|
|
457
code/client/cl_uimaprotationsetup.cpp
Normal file
457
code/client/cl_uimaprotationsetup.cpp
Normal file
|
@ -0,0 +1,457 @@
|
|||
/*
|
||||
===========================================================================
|
||||
Copyright (C) 2023 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_uimaprotationsetup.h"
|
||||
|
||||
Event EV_MapListBox_RefreshMapList
|
||||
(
|
||||
"RefreshMapList",
|
||||
EV_DEFAULT,
|
||||
NULL,
|
||||
NULL,
|
||||
"Refreshes the map list."
|
||||
);
|
||||
|
||||
Event EV_MapRotationListBox_RefreshRotationList
|
||||
(
|
||||
"RefreshRotationList",
|
||||
EV_DEFAULT,
|
||||
NULL,
|
||||
NULL,
|
||||
"Refreshed the map rotation list."
|
||||
);
|
||||
|
||||
CLASS_DECLARATION(UIListBox, UIMapRotationListBox, NULL) {
|
||||
{&EV_MapRotationListBox_RefreshRotationList, &UIMapRotationListBox::RefreshRotationList},
|
||||
{NULL, NULL }
|
||||
};
|
||||
|
||||
UIMapRotationListBox::UIMapRotationListBox() {}
|
||||
|
||||
void UIMapRotationListBox::RefreshRotationList(Event *ev)
|
||||
{
|
||||
DeleteAllItems();
|
||||
PopulateRotationList();
|
||||
}
|
||||
|
||||
void UIMapRotationListBox::PopulateRotationList()
|
||||
{
|
||||
cvar_t *filter;
|
||||
cvar_t *maplistVar;
|
||||
const char *token;
|
||||
char mapBuffer[1024];
|
||||
|
||||
filter = Cvar_Get("g_maprotation_filter", "ffa", 0);
|
||||
if (!Q_stricmp(filter->string, "obj")) {
|
||||
maplistVar = Cvar_Get("ui_maplist_obj", "", 0);
|
||||
} else if (!Q_stricmp(filter->string, "tow")) {
|
||||
maplistVar = Cvar_Get("ui_maplist_tow", "", 0);
|
||||
} else if (!Q_stricmp(filter->string, "lib")) {
|
||||
maplistVar = Cvar_Get("ui_maplist_lib", "", 0);
|
||||
} else if (!Q_stricmp(filter->string, "team")) {
|
||||
maplistVar = Cvar_Get("ui_maplist_team", "", 0);
|
||||
} else if (!Q_stricmp(filter->string, "round")) {
|
||||
maplistVar = Cvar_Get("ui_maplist_round", "", 0);
|
||||
} else {
|
||||
maplistVar = Cvar_Get("ui_maplist_ffa", "", 0);
|
||||
}
|
||||
|
||||
Q_strncpyz(mapBuffer, maplistVar->string, sizeof(mapBuffer));
|
||||
|
||||
for (token = strtok(mapBuffer, " /"); token; token = strtok(NULL, " /")) {
|
||||
if (!Q_stricmp(token, "dm")) {
|
||||
continue;
|
||||
}
|
||||
if (!Q_stricmp(token, "obj")) {
|
||||
continue;
|
||||
}
|
||||
if (!Q_stricmp(token, "lib")) {
|
||||
continue;
|
||||
}
|
||||
|
||||
AddItem(token, NULL);
|
||||
}
|
||||
}
|
||||
|
||||
CLASS_DECLARATION(UIListBox, UIMapListBox, NULL) {
|
||||
{&EV_MapListBox_RefreshMapList, &UIMapListBox::RefreshMapList},
|
||||
{NULL, NULL }
|
||||
};
|
||||
|
||||
UIMapListBox::UIMapListBox() {}
|
||||
|
||||
void UIMapListBox::RefreshMapList(Event *ev)
|
||||
{
|
||||
DeleteAllItems();
|
||||
PopulateMapList();
|
||||
}
|
||||
|
||||
void UIMapListBox::PopulateMapList()
|
||||
{
|
||||
cvar_t *filter;
|
||||
char **filenames;
|
||||
int numfiles;
|
||||
str path;
|
||||
int i;
|
||||
bool bTugOfWar = false;
|
||||
bool bObjective = false;
|
||||
bool bLiberation = false;
|
||||
|
||||
filter = Cvar_Get("g_maprotation_filter", "ffa", 0);
|
||||
if (!Q_stricmp(filter->string, "lib")) {
|
||||
path = "maps/lib/";
|
||||
bLiberation = true;
|
||||
} else if (!Q_stricmp(filter->string, "obj") || !Q_stricmp(filter->string, "tow")) {
|
||||
path = "maps/obj/";
|
||||
if (!Q_stricmp(filter->string, "tow")) {
|
||||
bTugOfWar = true;
|
||||
} else {
|
||||
bObjective = true;
|
||||
}
|
||||
} else {
|
||||
path = "maps/dm/";
|
||||
}
|
||||
|
||||
filenames = FS_ListFiles(path, ".bsp", qfalse, &numfiles);
|
||||
|
||||
for (i = 0; i < numfiles; i++) {
|
||||
const char *filename = filenames[i];
|
||||
const char *token;
|
||||
char mapName[256];
|
||||
char tokenized[256];
|
||||
bool bHasMP = false;
|
||||
bool bHasTOW = false;
|
||||
bool bHasLib = false;
|
||||
|
||||
Q_strncpyz(mapName, filename, sizeof(mapName));
|
||||
mapName[strlen(mapName) - 4] = 0;
|
||||
|
||||
if (!COM_IsMapValid(mapName)) {
|
||||
continue;
|
||||
}
|
||||
|
||||
if (bTugOfWar || bLiberation) {
|
||||
Q_strncpyz(tokenized, mapName, sizeof(tokenized));
|
||||
|
||||
for (token = strtok(tokenized, "_"); token; token = strtok(NULL, "_")) {
|
||||
if (bLiberation) {
|
||||
if (!Q_stricmp(token, "MP")) {
|
||||
bHasMP = true;
|
||||
}
|
||||
if (!Q_stricmp(token, "LIB")) {
|
||||
bHasLib = true;
|
||||
}
|
||||
if (bHasMP && bHasLib) {
|
||||
AddItem(mapName, NULL);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if (bTugOfWar) {
|
||||
if (!Q_stricmp(token, "MP")) {
|
||||
bHasMP = true;
|
||||
}
|
||||
if (!Q_stricmp(token, "TOW")) {
|
||||
bHasTOW = true;
|
||||
}
|
||||
if (bHasMP && bHasTOW) {
|
||||
AddItem(mapName, NULL);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
} else if (bObjective) {
|
||||
Q_strncpyz(tokenized, mapName, sizeof(tokenized));
|
||||
|
||||
for (token = strtok(tokenized, "_"); token; token = strtok(NULL, "_")) {
|
||||
if (!Q_stricmp(token, "obj")) {
|
||||
AddItem(mapName, NULL);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if (!Q_stricmp(mapName, "mp_ship_lib")) {
|
||||
AddItem(mapName, NULL);
|
||||
}
|
||||
} else {
|
||||
AddItem(mapName, NULL);
|
||||
}
|
||||
}
|
||||
|
||||
if (bObjective) {
|
||||
path = "maps/lib/";
|
||||
|
||||
filenames = FS_ListFiles(path, ".bsp", qfalse, &numfiles);
|
||||
|
||||
for (i = 0; i < numfiles; i++) {
|
||||
const char *filename = filenames[i];
|
||||
const char *token;
|
||||
char mapName[256];
|
||||
char tokenized[256];
|
||||
|
||||
Q_strncpyz(mapName, filename, sizeof(mapName));
|
||||
mapName[strlen(mapName) - 4] = 0;
|
||||
Q_strncpyz(tokenized, mapName, sizeof(tokenized));
|
||||
|
||||
token = strtok(tokenized, "_");
|
||||
if (!Q_stricmp(token, "obj") || !Q_stricmp(mapName, "mp_ship_lib")) {
|
||||
AddItem(mapName, NULL);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (!bTugOfWar && !bObjective && !bLiberation) {
|
||||
int type;
|
||||
|
||||
for (type = 0; type < 2; type++) {
|
||||
if (type == 0) {
|
||||
path = "maps/obj/";
|
||||
} else {
|
||||
path = "maps/lib/";
|
||||
}
|
||||
|
||||
filenames = FS_ListFiles(path, ".bsp", qfalse, &numfiles);
|
||||
|
||||
for (i = 0; i < numfiles; i++) {
|
||||
const char *filename = filenames[i];
|
||||
char mapName[256];
|
||||
|
||||
Q_strncpyz(mapName, filename, sizeof(mapName));
|
||||
mapName[strlen(mapName) - 4] = 0;
|
||||
|
||||
if (!COM_IsMapValid(mapName)) {
|
||||
continue;
|
||||
}
|
||||
|
||||
if (!Q_stricmp(mapName, "obj_team2") || !Q_stricmp(mapName, "obj_team4")) {
|
||||
continue;
|
||||
}
|
||||
|
||||
AddItem(mapName, NULL);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
CLASS_DECLARATION(UIButton, UIAddToRotationButton, NULL) {
|
||||
{&W_LeftMouseUp, &UIAddToRotationButton::Released},
|
||||
{NULL, NULL }
|
||||
};
|
||||
|
||||
void UIAddToRotationButton::Released(Event *ev)
|
||||
{
|
||||
UIListBox *mapList;
|
||||
UIListBox *rotationList;
|
||||
size_t prefixLength;
|
||||
int i;
|
||||
|
||||
mapList = static_cast<UIListBox *>(uWinMan.FindWidget("Map List"));
|
||||
rotationList = static_cast<UIListBox *>(uWinMan.FindWidget("Rotation List"));
|
||||
|
||||
if (Cvar_Get("g_maprotation_filter", "ffa", 0)) {
|
||||
prefixLength = strlen("obj/") + 1;
|
||||
} else {
|
||||
prefixLength = 1;
|
||||
}
|
||||
|
||||
if (mapList && rotationList) {
|
||||
size_t mapLength = 0;
|
||||
int item = mapList->getCurrentItem();
|
||||
str currentItemText;
|
||||
|
||||
if (item) {
|
||||
currentItemText = mapList->getItemText(item);
|
||||
}
|
||||
|
||||
for (i = 1; i <= rotationList->getNumItems(); i++) {
|
||||
str text = rotationList->getItemText(i);
|
||||
if (text == currentItemText) {
|
||||
// Added in OPM
|
||||
// Prevent adding duplicates
|
||||
item = 0;
|
||||
break;
|
||||
}
|
||||
|
||||
mapLength += text.length();
|
||||
}
|
||||
|
||||
if (item && prefixLength + mapLength + currentItemText.length() < 256) {
|
||||
rotationList->AddItem(currentItemText, NULL);
|
||||
}
|
||||
}
|
||||
|
||||
UIButtonBase::Released(ev);
|
||||
}
|
||||
|
||||
CLASS_DECLARATION(UIButton, UIRemoveFromRotationButton, NULL) {
|
||||
{&W_LeftMouseUp, &UIRemoveFromRotationButton::Released},
|
||||
{NULL, NULL }
|
||||
};
|
||||
|
||||
void UIRemoveFromRotationButton::Released(Event *ev)
|
||||
{
|
||||
UIListBox *list;
|
||||
|
||||
list = static_cast<UIListBox *>(uWinMan.FindWidget("Rotation List"));
|
||||
if (list) {
|
||||
list->DeleteItem(list->getCurrentItem());
|
||||
}
|
||||
|
||||
UIButtonBase::Released(ev);
|
||||
}
|
||||
|
||||
CLASS_DECLARATION(UIButton, UIRotationApplyButton, NULL) {
|
||||
{&W_LeftMouseUp, &UIRotationApplyButton::Released},
|
||||
{NULL, NULL }
|
||||
};
|
||||
|
||||
void UIRotationApplyButton::Released(Event *ev)
|
||||
{
|
||||
UIListBox *list;
|
||||
cvar_t *filter;
|
||||
str cvarName;
|
||||
str maplistStr;
|
||||
int i;
|
||||
bool bObjective = false;
|
||||
bool bLiberation = false;
|
||||
|
||||
filter = Cvar_Get("g_maprotation_filter", "ffa", 0);
|
||||
if (!Q_stricmp(filter->string, "obj")) {
|
||||
cvarName = "ui_maplist_obj";
|
||||
bObjective = true;
|
||||
} else if (!Q_stricmp(filter->string, "tow")) {
|
||||
cvarName = "ui_maplist_obj";
|
||||
bObjective = true;
|
||||
} else if (!Q_stricmp(filter->string, "lib")) {
|
||||
cvarName = "ui_maplist_lib";
|
||||
bLiberation = true;
|
||||
} else if (!Q_stricmp(filter->string, "team")) {
|
||||
cvarName = "ui_maplist_team";
|
||||
} else if (!Q_stricmp(filter->string, "round")) {
|
||||
cvarName = "ui_maplist_round";
|
||||
} else {
|
||||
cvarName = "ui_maplist_ffa";
|
||||
}
|
||||
Cvar_Set(cvarName, "");
|
||||
|
||||
list = static_cast<UIListBox *>(uWinMan.FindWidget("Rotation List"));
|
||||
if (list) {
|
||||
for (i = 1; i <= list->getNumItems(); i++) {
|
||||
const char *token;
|
||||
str text = list->getItemText(i);
|
||||
char map[256];
|
||||
bool bHasTOW = false, bHasObj = false, bHasLib = false, bHasShip = false;
|
||||
|
||||
Q_strncpyz(map, text, sizeof(map));
|
||||
for (token = strtok(map, "_"); token; token = strtok(NULL, "_")) {
|
||||
if (!Q_stricmp(token, "TOW")) {
|
||||
bHasTOW = true;
|
||||
break;
|
||||
}
|
||||
if (!Q_stricmp(token, "obj")) {
|
||||
bHasObj = true;
|
||||
break;
|
||||
}
|
||||
if (!Q_stricmp(token, "lib")) {
|
||||
bHasLib = true;
|
||||
break;
|
||||
}
|
||||
if (!Q_stricmp(token, "ship")) {
|
||||
bHasShip = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if (bHasShip) {
|
||||
maplistStr += "lib/";
|
||||
} else if (bObjective || bHasTOW || bHasObj) {
|
||||
maplistStr += "obj/";
|
||||
} else if (bHasLib || bLiberation) {
|
||||
maplistStr += "lib/";
|
||||
} else {
|
||||
maplistStr += "dm/";
|
||||
}
|
||||
|
||||
maplistStr += text;
|
||||
|
||||
if (i == 1) {
|
||||
Cvar_Set("ui_dmmap", maplistStr);
|
||||
}
|
||||
|
||||
maplistStr += " ";
|
||||
}
|
||||
}
|
||||
|
||||
Cvar_Set(cvarName, maplistStr);
|
||||
|
||||
UIButtonBase::Released(ev);
|
||||
}
|
||||
|
||||
CLASS_DECLARATION(UIButton, UIRotationMoveItemUpButton, NULL) {
|
||||
{&W_LeftMouseUp, &UIRotationMoveItemUpButton::Released},
|
||||
{NULL, NULL }
|
||||
};
|
||||
|
||||
void UIRotationMoveItemUpButton::Released(Event *ev)
|
||||
{
|
||||
UIListBox *list;
|
||||
int item;
|
||||
|
||||
list = static_cast<UIListBox *>(uWinMan.FindWidget("Rotation List"));
|
||||
item = list->getCurrentItem();
|
||||
|
||||
if (item > 1 && list->getNumItems() > 1) {
|
||||
str text = list->getItemText(item - 1);
|
||||
|
||||
list->DeleteItem(item - 1);
|
||||
list->InsertItem(text, item);
|
||||
list->setCurrentItem(item - 1);
|
||||
}
|
||||
|
||||
UIButtonBase::Released(ev);
|
||||
}
|
||||
|
||||
CLASS_DECLARATION(UIButton, UIRotationMoveItemDownButton, NULL) {
|
||||
{&W_LeftMouseUp, &UIRotationMoveItemDownButton::Released},
|
||||
{NULL, NULL }
|
||||
};
|
||||
|
||||
void UIRotationMoveItemDownButton::Released(Event *ev)
|
||||
{
|
||||
UIListBox *list;
|
||||
int item;
|
||||
|
||||
list = static_cast<UIListBox *>(uWinMan.FindWidget("Rotation List"));
|
||||
item = list->getCurrentItem();
|
||||
|
||||
if (item < list->getNumItems() && list->getNumItems() > 1) {
|
||||
str text = list->getItemText(item + 1);
|
||||
|
||||
list->DeleteItem(item + 1);
|
||||
list->InsertItem(text, item);
|
||||
list->setCurrentItem(item + 1);
|
||||
}
|
||||
|
||||
UIButtonBase::Released(ev);
|
||||
}
|
87
code/client/cl_uimaprotationsetup.h
Normal file
87
code/client/cl_uimaprotationsetup.h
Normal file
|
@ -0,0 +1,87 @@
|
|||
/*
|
||||
===========================================================================
|
||||
Copyright (C) 2023 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 "../uilib/uilistbox.h"
|
||||
|
||||
class UIMapRotationListBox : public UIListBox
|
||||
{
|
||||
CLASS_PROTOTYPE(UIMapRotationListBox);
|
||||
|
||||
public:
|
||||
UIMapRotationListBox();
|
||||
|
||||
void RefreshRotationList(Event *ev);
|
||||
void PopulateRotationList();
|
||||
};
|
||||
|
||||
class UIMapListBox : public UIListBox
|
||||
{
|
||||
CLASS_PROTOTYPE(UIMapListBox);
|
||||
|
||||
public:
|
||||
UIMapListBox();
|
||||
|
||||
void RefreshMapList(Event *ev);
|
||||
void PopulateMapList();
|
||||
};
|
||||
|
||||
class UIAddToRotationButton : public UIButton
|
||||
{
|
||||
CLASS_PROTOTYPE(UIAddToRotationButton);
|
||||
|
||||
public:
|
||||
void Released(Event *ev);
|
||||
};
|
||||
|
||||
class UIRemoveFromRotationButton : public UIButton
|
||||
{
|
||||
CLASS_PROTOTYPE(UIRemoveFromRotationButton);
|
||||
|
||||
public:
|
||||
void Released(Event *ev);
|
||||
};
|
||||
|
||||
class UIRotationApplyButton : public UIButton
|
||||
{
|
||||
CLASS_PROTOTYPE(UIRotationApplyButton);
|
||||
|
||||
public:
|
||||
void Released(Event *ev);
|
||||
};
|
||||
|
||||
class UIRotationMoveItemUpButton : public UIButton
|
||||
{
|
||||
CLASS_PROTOTYPE(UIRotationMoveItemUpButton);
|
||||
|
||||
public:
|
||||
void Released(Event *ev);
|
||||
};
|
||||
|
||||
class UIRotationMoveItemDownButton : public UIButton
|
||||
{
|
||||
CLASS_PROTOTYPE(UIRotationMoveItemDownButton);
|
||||
|
||||
public:
|
||||
void Released(Event *ev);
|
||||
};
|
|
@ -1,6 +1,6 @@
|
|||
/*
|
||||
===========================================================================
|
||||
Copyright (C) 2015 the OpenMoHAA team
|
||||
Copyright (C) 2023-2024 the OpenMoHAA team
|
||||
|
||||
This file is part of OpenMoHAA source code.
|
||||
|
||||
|
@ -22,47 +22,107 @@ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
|||
|
||||
#include "cl_ui.h"
|
||||
|
||||
CLASS_DECLARATION( FilePickerClass, MapRunnerClass, NULL )
|
||||
{
|
||||
{ NULL, NULL }
|
||||
CLASS_DECLARATION(FilePickerClass, MapRunnerClass, NULL) {
|
||||
{NULL, NULL}
|
||||
};
|
||||
|
||||
void MapRunnerClass::FileChosen( str ¤tDirectory, str &partialName, str &fullname )
|
||||
void MapRunnerClass::FileChosen(const str& currentDirectory, const str& partialName, const str& fullname)
|
||||
{
|
||||
// FIXME: stub
|
||||
str newName;
|
||||
|
||||
newName = "spmap " + str(fullname, 5, fullname.length() - 4) + "\n";
|
||||
// insert the command
|
||||
Cbuf_AddText(newName);
|
||||
|
||||
CloseWindow();
|
||||
}
|
||||
|
||||
CLASS_DECLARATION( FilePickerClass, ViewSpawnerClass, NULL )
|
||||
{
|
||||
{ NULL, NULL }
|
||||
CLASS_DECLARATION(FilePickerClass, UIPickFileClass, NULL) {
|
||||
{NULL, NULL}
|
||||
};
|
||||
|
||||
void ViewSpawnerClass::FileChosen( str ¤tDirectory, str &partialName, str &fullname )
|
||||
UIPickFileClass::UIPickFileClass()
|
||||
{
|
||||
// FIXME: stub
|
||||
retobj = NULL;
|
||||
retevent = NULL;
|
||||
}
|
||||
|
||||
CLASS_DECLARATION( FilePickerClass, LODSpawnerClass, NULL )
|
||||
UIPickFileClass::~UIPickFileClass()
|
||||
{
|
||||
{ NULL, NULL }
|
||||
if (retevent) {
|
||||
delete retevent;
|
||||
}
|
||||
}
|
||||
|
||||
void UIPickFileClass::FileChosen(const str& currentDirectory, const str& partialName, const str& fullname)
|
||||
{
|
||||
if (!retobj || !retevent) {
|
||||
CloseWindow();
|
||||
return;
|
||||
}
|
||||
|
||||
retevent->AddString(fullname);
|
||||
retobj->ProcessEvent(retevent);
|
||||
|
||||
retevent = NULL;
|
||||
retobj = NULL;
|
||||
|
||||
CloseWindow();
|
||||
}
|
||||
|
||||
void PickFile(const char *name, Listener *obj, Event& event)
|
||||
{
|
||||
UIPickFileClass *picker;
|
||||
str currentpath;
|
||||
int i;
|
||||
|
||||
picker = new UIPickFileClass();
|
||||
picker->retevent = new Event(event);
|
||||
picker->retobj = obj;
|
||||
|
||||
if (name && *name && strchr(name, '/')) {
|
||||
currentpath = name;
|
||||
|
||||
for (i = currentpath.length() - 1; i > 0; i--) {
|
||||
if (currentpath[i] == '/') {
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
currentpath = str(currentpath, 0, i + 1);
|
||||
} else {
|
||||
currentpath = "";
|
||||
}
|
||||
|
||||
picker->Setup("", currentpath, ".*", "");
|
||||
}
|
||||
|
||||
CLASS_DECLARATION(FilePickerClass, ViewSpawnerClass, NULL) {
|
||||
{NULL, NULL}
|
||||
};
|
||||
|
||||
void LODSpawnerClass::FileChosen( str ¤tDirectory, str &partialName, str &fullname )
|
||||
void ViewSpawnerClass::FileChosen(const str& currentDirectory, const str& partialName, const str& fullname)
|
||||
{
|
||||
// FIXME: stub
|
||||
str newName;
|
||||
|
||||
newName = "viewspawn " + fullname + "\n";
|
||||
// insert the command
|
||||
Cbuf_AddText(newName);
|
||||
|
||||
CloseWindow();
|
||||
}
|
||||
|
||||
CLASS_DECLARATION( FilePickerClass, UIPickFileClass, NULL )
|
||||
{
|
||||
{ NULL, NULL }
|
||||
CLASS_DECLARATION(FilePickerClass, LODSpawnerClass, NULL) {
|
||||
{NULL, NULL}
|
||||
};
|
||||
|
||||
void UIPickFileClass::FileChosen( str ¤tDirectory, str &partialName, str &fullname )
|
||||
void LODSpawnerClass::FileChosen(const str& currentDirectory, const str& partialName, const str& fullname)
|
||||
{
|
||||
// FIXME: stub
|
||||
}
|
||||
str newName;
|
||||
|
||||
void PickFile( const char *name, Listener *obj, Event& event )
|
||||
{
|
||||
// FIXME: stub
|
||||
newName = "lod_spawn " + fullname + "\n";
|
||||
// insert the command
|
||||
Cbuf_AddText(newName);
|
||||
|
||||
CloseWindow();
|
||||
}
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
/*
|
||||
===========================================================================
|
||||
Copyright (C) 2015 the OpenMoHAA team
|
||||
Copyright (C) 2023 the OpenMoHAA team
|
||||
|
||||
This file is part of OpenMoHAA source code.
|
||||
|
||||
|
@ -20,40 +20,44 @@ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
|||
===========================================================================
|
||||
*/
|
||||
|
||||
#ifndef __CL_UIMAPRUNNER_H__
|
||||
#define __CL_UIMAPRUNNER_H__
|
||||
#pragma once
|
||||
|
||||
class MapRunnerClass : public FilePickerClass {
|
||||
class MapRunnerClass : public FilePickerClass
|
||||
{
|
||||
public:
|
||||
CLASS_PROTOTYPE( MapRunnerClass );
|
||||
CLASS_PROTOTYPE(MapRunnerClass);
|
||||
|
||||
void FileChosen( str ¤tDirectory, str &partialName, str &fullname ) override;
|
||||
void FileChosen(const str& currentDirectory, const str& partialName, const str& fullname) override;
|
||||
};
|
||||
|
||||
class ViewSpawnerClass : public FilePickerClass {
|
||||
class ViewSpawnerClass : public FilePickerClass
|
||||
{
|
||||
public:
|
||||
CLASS_PROTOTYPE( ViewSpawnerClass );
|
||||
CLASS_PROTOTYPE(ViewSpawnerClass);
|
||||
|
||||
void FileChosen( str ¤tDirectory, str &partialName, str &fullname ) override;
|
||||
void FileChosen(const str& currentDirectory, const str& partialName, const str& fullname) override;
|
||||
};
|
||||
|
||||
class LODSpawnerClass : public FilePickerClass {
|
||||
class LODSpawnerClass : public FilePickerClass
|
||||
{
|
||||
public:
|
||||
CLASS_PROTOTYPE( LODSpawnerClass );
|
||||
CLASS_PROTOTYPE(LODSpawnerClass);
|
||||
|
||||
void FileChosen( str ¤tDirectory, str &partialName, str &fullname ) override;
|
||||
void FileChosen(const str& currentDirectory, const str& partialName, const str& fullname) override;
|
||||
};
|
||||
|
||||
class UIPickFileClass : public FilePickerClass {
|
||||
class UIPickFileClass : public FilePickerClass
|
||||
{
|
||||
public:
|
||||
Listener *retobj;
|
||||
Event *retevent;
|
||||
|
||||
CLASS_PROTOTYPE( UIPickFileClass );
|
||||
CLASS_PROTOTYPE(UIPickFileClass);
|
||||
|
||||
void FileChosen( str ¤tDirectory, str &partialName, str &fullname ) override;
|
||||
UIPickFileClass();
|
||||
~UIPickFileClass();
|
||||
|
||||
void FileChosen(const str& currentDirectory, const str& partialName, const str& fullname) override;
|
||||
};
|
||||
|
||||
void PickFile( const char *name, Listener *obj, Event& event );
|
||||
|
||||
#endif /* __CL_UIMAPRUNNER_H__ */
|
||||
void PickFile(const char *name, Listener *obj, Event& event);
|
||||
|
|
|
@ -22,68 +22,179 @@ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
|||
|
||||
#include "cl_ui.h"
|
||||
|
||||
CLASS_DECLARATION( UIWidget, FakkMiniconsole, NULL )
|
||||
{
|
||||
{ NULL, NULL }
|
||||
Event EV_Minicon_Goin("_minicon_goin", EV_DEFAULT, NULL, NULL, "Event to make the miniconsole disappear");
|
||||
|
||||
CLASS_DECLARATION(UIWidget, FakkMiniconsole, NULL) {
|
||||
{&W_SizeChanged, &FakkMiniconsole::OnSizeChanged},
|
||||
{&EV_Minicon_Goin, &FakkMiniconsole::MoveInEvent },
|
||||
{NULL, NULL }
|
||||
};
|
||||
|
||||
FakkMiniconsole::FakkMiniconsole()
|
||||
{
|
||||
// FIXME: stub
|
||||
m_maxlines = 0;
|
||||
m_reallyshown = true;
|
||||
m_boxstate = boxstate_t::box_in;
|
||||
m_boxtime = uid.time;
|
||||
m_movespeed = 500;
|
||||
}
|
||||
|
||||
|
||||
void FakkMiniconsole::VerifyBoxOut( void )
|
||||
void FakkMiniconsole::setShowState(void)
|
||||
{
|
||||
// FIXME: stub
|
||||
if (m_reallyshown) {
|
||||
setShow(m_boxstate != boxstate_t::box_in);
|
||||
} else {
|
||||
setShow(false);
|
||||
}
|
||||
}
|
||||
|
||||
void FakkMiniconsole::ChangeBoxState( boxstate_t state )
|
||||
void FakkMiniconsole::setRealShow(bool b)
|
||||
{
|
||||
// FIXME: stub
|
||||
m_reallyshown = b;
|
||||
setShowState();
|
||||
}
|
||||
|
||||
void FakkMiniconsole::HandleBoxMoving( void )
|
||||
void FakkMiniconsole::VerifyBoxOut(void)
|
||||
{
|
||||
// FIXME: stub
|
||||
PostMoveinEvent();
|
||||
|
||||
if (m_boxstate && m_boxstate != boxstate_t::box_out) {
|
||||
ChangeBoxState(box_moving_out);
|
||||
}
|
||||
}
|
||||
|
||||
void FakkMiniconsole::PostMoveinEvent( void )
|
||||
void FakkMiniconsole::Print(const char *text)
|
||||
{
|
||||
// FIXME: stub
|
||||
str *lastline;
|
||||
const char *p;
|
||||
|
||||
if (!m_lines.NumObjects()) {
|
||||
m_lines.AddObject({});
|
||||
}
|
||||
|
||||
lastline = &m_lines.ObjectAt(m_lines.NumObjects());
|
||||
|
||||
if (*text) {
|
||||
for (p = text; *p; p++) {
|
||||
if (*p != '\n') {
|
||||
*lastline += *p;
|
||||
} else {
|
||||
m_lines.AddObject({});
|
||||
lastline = &m_lines.ObjectAt(m_lines.NumObjects());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (lastline && lastline->length() > 128) {
|
||||
Print("\n");
|
||||
}
|
||||
|
||||
if (m_maxlines < 0) {
|
||||
m_maxlines = 1;
|
||||
}
|
||||
|
||||
while (m_lines.NumObjects() > this->m_maxlines) {
|
||||
m_lines.RemoveObjectAt(1);
|
||||
}
|
||||
|
||||
VerifyBoxOut();
|
||||
}
|
||||
|
||||
void FakkMiniconsole::setShowState( void )
|
||||
void FakkMiniconsole::PostMoveinEvent(void)
|
||||
{
|
||||
// FIXME: stub
|
||||
if (m_boxstate != boxstate_t::box_out) {
|
||||
return;
|
||||
}
|
||||
|
||||
CancelEventsOfType(EV_Minicon_Goin);
|
||||
PostEvent(new Event(EV_Minicon_Goin), 5.f);
|
||||
}
|
||||
|
||||
void FakkMiniconsole::OnSizeChanged( Event *ev )
|
||||
void FakkMiniconsole::OnSizeChanged(Event *ev)
|
||||
{
|
||||
// FIXME: stub
|
||||
m_maxlines = m_frame.size.height / m_font->getHeight(getHighResScale());
|
||||
}
|
||||
|
||||
void FakkMiniconsole::Print( const char *text )
|
||||
void FakkMiniconsole::MoveInEvent(Event *ev)
|
||||
{
|
||||
// FIXME: stub
|
||||
ChangeBoxState(boxstate_t::box_moving_in);
|
||||
}
|
||||
|
||||
void FakkMiniconsole::Create( const UISize2D& size, const UColor& fore, const UColor& back, float alpha )
|
||||
void FakkMiniconsole::HandleBoxMoving(void)
|
||||
{
|
||||
// FIXME: stub
|
||||
int delta;
|
||||
UIRect2D newRect;
|
||||
|
||||
if (m_boxstate == boxstate_t::box_out || m_boxstate == boxstate_t::box_in) {
|
||||
return;
|
||||
}
|
||||
|
||||
delta = m_movespeed * (uid.time - m_boxtime) / 1000;
|
||||
m_boxtime = 1000 * delta / m_movespeed + m_boxtime;
|
||||
|
||||
switch (m_boxstate) {
|
||||
case boxstate_t::box_moving_in:
|
||||
newRect = UIRect2D(delta + m_frame.pos.x, m_frame.pos.y, m_frame.size.width, m_frame.size.height);
|
||||
if (newRect.pos.x >= uid.vidWidth) {
|
||||
newRect.pos.x = uid.vidWidth;
|
||||
ChangeBoxState(boxstate_t::box_in);
|
||||
}
|
||||
break;
|
||||
case boxstate_t::box_moving_out:
|
||||
newRect = UIRect2D(-delta + m_frame.pos.x, m_frame.pos.y, m_frame.size.width, m_frame.size.height);
|
||||
if (newRect.pos.x <= uid.vidWidth - newRect.size.width) {
|
||||
newRect.pos.x = uid.vidWidth - newRect.size.width;
|
||||
ChangeBoxState(boxstate_t::box_out);
|
||||
}
|
||||
break;
|
||||
default:
|
||||
ChangeBoxState(boxstate_t::box_in);
|
||||
break;
|
||||
}
|
||||
|
||||
setFrame(newRect);
|
||||
}
|
||||
|
||||
void FakkMiniconsole::MoveInEvent( Event *ev )
|
||||
void FakkMiniconsole::Draw(void)
|
||||
{
|
||||
// FIXME: stub
|
||||
float aty;
|
||||
int i;
|
||||
|
||||
HandleBoxMoving();
|
||||
|
||||
m_font->setColor(m_foreground_color);
|
||||
aty = m_frame.size.height - m_font->getHeight(getHighResScale());
|
||||
for (i = m_lines.NumObjects(); i > 0; i--) {
|
||||
if (-m_font->getHeight(getHighResScale()) >= aty) {
|
||||
break;
|
||||
}
|
||||
|
||||
m_font->Print(0, aty / getHighResScale()[1], m_lines.ObjectAt(i), -1, getHighResScale());
|
||||
aty -= m_font->getHeight(getHighResScale());
|
||||
}
|
||||
}
|
||||
|
||||
void FakkMiniconsole::Draw( void )
|
||||
void FakkMiniconsole::Create(const UISize2D& size, const UColor& fore, const UColor& back, float alpha)
|
||||
{
|
||||
// FIXME: stub
|
||||
InitFrame(NULL, uid.vidWidth, 0, size.width, size.height, 0);
|
||||
|
||||
setBackgroundColor(back, true);
|
||||
setForegroundColor(fore);
|
||||
setBackgroundAlpha(alpha);
|
||||
Connect(this, W_SizeChanged, W_SizeChanged);
|
||||
OnSizeChanged(NULL);
|
||||
|
||||
m_movespeed = size.width * 3;
|
||||
|
||||
setShowState();
|
||||
}
|
||||
|
||||
void FakkMiniconsole::setRealShow( bool b )
|
||||
void FakkMiniconsole::ChangeBoxState(boxstate_t state)
|
||||
{
|
||||
// FIXME: stub
|
||||
m_boxstate = state;
|
||||
m_boxtime = uid.time;
|
||||
setShowState();
|
||||
if (state == boxstate_t::box_out) {
|
||||
PostMoveinEvent();
|
||||
}
|
||||
}
|
||||
|
|
|
@ -20,10 +20,10 @@ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
|||
===========================================================================
|
||||
*/
|
||||
|
||||
#ifndef __CL_UIMINICON_H__
|
||||
#define __CL_UIMINICON_H__
|
||||
#pragma once
|
||||
|
||||
class FakkMiniconsole : public UIWidget {
|
||||
class FakkMiniconsole : public UIWidget
|
||||
{
|
||||
protected:
|
||||
Container<str> m_lines;
|
||||
int m_maxlines;
|
||||
|
@ -34,24 +34,22 @@ protected:
|
|||
int m_movespeed;
|
||||
|
||||
public:
|
||||
CLASS_PROTOTYPE( FakkMiniconsole );
|
||||
CLASS_PROTOTYPE(FakkMiniconsole);
|
||||
|
||||
protected:
|
||||
void VerifyBoxOut( void );
|
||||
void ChangeBoxState( boxstate_t state );
|
||||
void HandleBoxMoving( void );
|
||||
void PostMoveinEvent( void );
|
||||
void setShowState( void );
|
||||
void VerifyBoxOut(void);
|
||||
void ChangeBoxState(boxstate_t state);
|
||||
void HandleBoxMoving(void);
|
||||
void PostMoveinEvent(void);
|
||||
void setShowState(void);
|
||||
|
||||
public:
|
||||
FakkMiniconsole();
|
||||
|
||||
void OnSizeChanged( Event *ev );
|
||||
void Print( const char *text );
|
||||
void Create( const UISize2D& size, const UColor& fore, const UColor& back, float alpha );
|
||||
void MoveInEvent( Event *ev );
|
||||
void Draw( void ) override;
|
||||
void setRealShow( bool b );
|
||||
void OnSizeChanged(Event *ev);
|
||||
void Print(const char *text);
|
||||
void Create(const UISize2D& size, const UColor& fore, const UColor& back, float alpha);
|
||||
void MoveInEvent(Event *ev);
|
||||
void Draw(void) override;
|
||||
void setRealShow(bool b);
|
||||
};
|
||||
|
||||
#endif
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
/*
|
||||
===========================================================================
|
||||
Copyright (C) 2015 the OpenMoHAA team
|
||||
Copyright (C) 2023 the OpenMoHAA team
|
||||
|
||||
This file is part of OpenMoHAA source code.
|
||||
|
||||
|
@ -21,73 +21,339 @@ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
|||
*/
|
||||
|
||||
#include "cl_ui.h"
|
||||
#include "../qcommon/localization.h"
|
||||
|
||||
CLASS_DECLARATION( USignal, MpMapPickerClass, NULL )
|
||||
class MpMapPickerItem : public UIListCtrlItem
|
||||
{
|
||||
{ NULL, NULL }
|
||||
str m_string;
|
||||
// Added in 2.0
|
||||
str m_directory;
|
||||
|
||||
public:
|
||||
MpMapPickerItem(const str& string, const str& directory);
|
||||
|
||||
int getListItemValue(int which) const override;
|
||||
griditemtype_t getListItemType(int which) const override;
|
||||
str getListItemString(int which) const override;
|
||||
void DrawListItem(int iColumn, const UIRect2D& drawRect, bool bSelected, UIFont *pFont) override;
|
||||
qboolean IsHeaderEntry() const override;
|
||||
};
|
||||
|
||||
CLASS_DECLARATION(USignal, MpMapPickerClass, NULL) {
|
||||
{&EV_UIListBase_ItemSelected, &MpMapPickerClass::FileSelected },
|
||||
{&EV_UIListBase_ItemDoubleClicked, &MpMapPickerClass::FileChosen },
|
||||
{&W_Deactivated, &MpMapPickerClass::OnDeactivated},
|
||||
{NULL, NULL }
|
||||
};
|
||||
|
||||
MpMapPickerClass::MpMapPickerClass()
|
||||
{
|
||||
// FIXME: stub
|
||||
window = new UIFloatingWindow();
|
||||
window->Create(
|
||||
NULL,
|
||||
UIRect2D((uid.vidWidth - 300) / 2, (uid.vidHeight - 200) / 2, 300, 200),
|
||||
"Select a Map",
|
||||
UColor(0.15f, 0.195f, 0.278f),
|
||||
UHudColor
|
||||
);
|
||||
window->setFont("facfont-20");
|
||||
window->PassEventToWidget("closebutton", new Event(EV_Widget_Disable));
|
||||
window->PassEventToWidget("minimizebutton", new Event(EV_Widget_Disable));
|
||||
window->Connect(this, W_Deactivated, W_Deactivated);
|
||||
|
||||
listbox = new UIListCtrl();
|
||||
listbox->InitFrame(window->getChildSpace(), window->getChildSpace()->getClientFrame(), 0);
|
||||
listbox->SetDrawHeader(false);
|
||||
listbox->setFont("facfont-20");
|
||||
listbox->FrameInitialized();
|
||||
listbox->AddColumn(Sys_LV_CL_ConvertString("Select a Map"), 0, 400, false, false);
|
||||
|
||||
listbox->Connect(this, EV_UIListBase_ItemDoubleClicked, EV_UIListBase_ItemDoubleClicked);
|
||||
listbox->Connect(this, EV_UIListBase_ItemSelected, EV_UIListBase_ItemSelected);
|
||||
listbox->AllowActivate(true);
|
||||
|
||||
// Added in 2.0
|
||||
// Don't localize elements
|
||||
listbox->SetDontLocalize();
|
||||
}
|
||||
|
||||
MpMapPickerClass::~MpMapPickerClass()
|
||||
{
|
||||
// FIXME: stub
|
||||
if (listbox) {
|
||||
delete listbox;
|
||||
listbox = NULL;
|
||||
}
|
||||
|
||||
if (window) {
|
||||
delete window;
|
||||
window = NULL;
|
||||
}
|
||||
}
|
||||
|
||||
void MpMapPickerClass::SetupFiles( void )
|
||||
void MpMapPickerClass::Setup(const char *root_directory, const char *current_directory, const char *game_type)
|
||||
{
|
||||
// FIXME: stub
|
||||
Initialize(root_directory, current_directory, game_type);
|
||||
}
|
||||
|
||||
void MpMapPickerClass::GotoParentDirectory( void )
|
||||
void MpMapPickerClass::Initialize(const char *root_directory, const char *current_directory, const char *game_type)
|
||||
{
|
||||
// FIXME: stub
|
||||
rootDirectory = root_directory;
|
||||
if (rootDirectory.length() > 1 && rootDirectory[rootDirectory.length() - 1] != '/') {
|
||||
rootDirectory += "/";
|
||||
}
|
||||
|
||||
currentDirectory = current_directory;
|
||||
if (currentDirectory.length() > 1 && currentDirectory[currentDirectory.length() - 1] != '/') {
|
||||
currentDirectory += "/";
|
||||
}
|
||||
|
||||
if (game_type) {
|
||||
gameType = game_type;
|
||||
}
|
||||
|
||||
SetupFiles();
|
||||
}
|
||||
|
||||
void MpMapPickerClass::GotoSubDirectory( str subdir )
|
||||
void MpMapPickerClass::GotoParentDirectory(void)
|
||||
{
|
||||
// FIXME: stub
|
||||
uintptr_t i;
|
||||
|
||||
if (currentDirectory == rootDirectory) {
|
||||
return;
|
||||
}
|
||||
|
||||
for (i = currentDirectory.length() - 2; i > 0; i--) {
|
||||
if (currentDirectory[i] == '/') {
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if (currentDirectory[i] == '/') {
|
||||
i++;
|
||||
}
|
||||
|
||||
currentDirectory = str(currentDirectory, 0, i);
|
||||
|
||||
// refresh files
|
||||
SetupFiles();
|
||||
}
|
||||
|
||||
void MpMapPickerClass::Initialize( const char *root_directory, const char *current_directory )
|
||||
void MpMapPickerClass::GotoSubDirectory(str subdir)
|
||||
{
|
||||
// FIXME: stub
|
||||
currentDirectory += subdir + "/";
|
||||
|
||||
// refresh files
|
||||
SetupFiles();
|
||||
}
|
||||
|
||||
void MpMapPickerClass::CloseWindow( void )
|
||||
void MpMapPickerClass::SetupFiles(void)
|
||||
{
|
||||
// FIXME: stub
|
||||
char **filenames;
|
||||
int numfiles;
|
||||
int i;
|
||||
char mapname[128];
|
||||
bool bTugOfWar = false, bObjective = false, bLiberation = false;
|
||||
|
||||
listbox->DeleteAllItems();
|
||||
|
||||
if (gameType == "tow") {
|
||||
bTugOfWar = true;
|
||||
} else if (gameType == "obj") {
|
||||
bObjective = true;
|
||||
} else if (gameType == "lib") {
|
||||
bLiberation = true;
|
||||
} else {
|
||||
// retrieve directories
|
||||
filenames = FS_ListFiles(rootDirectory, ".bsp", qfalse, &numfiles);
|
||||
|
||||
for (i = 0; i < numfiles; i++) {
|
||||
const char *filename = filenames[i];
|
||||
|
||||
strcpy(mapname, filename);
|
||||
mapname[strlen(mapname) - 4] = 0;
|
||||
|
||||
if (COM_IsMapValid(mapname)) {
|
||||
listbox->AddItem(new MpMapPickerItem(mapname, rootDirectory));
|
||||
}
|
||||
}
|
||||
|
||||
FS_FreeFileList(filenames);
|
||||
}
|
||||
|
||||
if (com_target_game->integer > target_game_e::TG_MOH) {
|
||||
if (currentDirectory.length()) {
|
||||
if (currentDirectory == "maps/-/") {
|
||||
SetupSecondaryFiles(currentDirectory, bTugOfWar, bObjective, bLiberation);
|
||||
} else {
|
||||
SetupSecondaryFiles("maps/obj/", bTugOfWar, bObjective, bLiberation);
|
||||
SetupSecondaryFiles("maps/lib/", bTugOfWar, bObjective, bLiberation);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
listbox->SortByColumn(0);
|
||||
}
|
||||
|
||||
void MpMapPickerClass::FileSelected( Event *ev )
|
||||
void MpMapPickerClass::SetupSecondaryFiles(const char *path, bool bTugOfWar, bool bObjective, bool bLiberation)
|
||||
{
|
||||
// FIXME: stub
|
||||
char **filenames;
|
||||
int numfiles;
|
||||
int i;
|
||||
char mapname[128];
|
||||
char string[1024];
|
||||
|
||||
filenames = FS_ListFiles(path, ".bsp", qfalse, &numfiles);
|
||||
|
||||
for (i = 0; i < numfiles; i++) {
|
||||
const char *filename = filenames[i];
|
||||
const char *token;
|
||||
|
||||
strcpy(mapname, filename);
|
||||
mapname[strlen(mapname) - 4] = 0;
|
||||
|
||||
if (!COM_IsMapValid(mapname)) {
|
||||
continue;
|
||||
}
|
||||
|
||||
if (bTugOfWar || bObjective || bLiberation) {
|
||||
bool bHasMP = false, bHasTOW = false, bHasLib = false;
|
||||
|
||||
strcpy(string, mapname);
|
||||
|
||||
for (token = strtok(string, "_"); token; token = strtok(NULL, "_")) {
|
||||
if (bObjective) {
|
||||
if (!Q_stricmp(token, "obj")) {
|
||||
listbox->AddItem(new MpMapPickerItem(mapname, path));
|
||||
} else if (!Q_stricmp(token, "ship")) {
|
||||
listbox->AddItem(new MpMapPickerItem(mapname, path));
|
||||
}
|
||||
}
|
||||
|
||||
if (bTugOfWar) {
|
||||
if (!Q_stricmp(token, "MP")) {
|
||||
bHasMP = true;
|
||||
}
|
||||
if (!Q_stricmp(token, "TOW")) {
|
||||
bHasTOW = true;
|
||||
}
|
||||
|
||||
if (bHasMP && bHasTOW) {
|
||||
listbox->AddItem(new MpMapPickerItem(mapname, path));
|
||||
}
|
||||
}
|
||||
|
||||
if (bLiberation) {
|
||||
if (!Q_stricmp(token, "MP")) {
|
||||
bHasMP = true;
|
||||
}
|
||||
if (!Q_stricmp(token, "LIB")) {
|
||||
bHasLib = true;
|
||||
}
|
||||
|
||||
if (bHasMP && bHasLib) {
|
||||
listbox->AddItem(new MpMapPickerItem(mapname, path));
|
||||
}
|
||||
}
|
||||
}
|
||||
} else {
|
||||
if (!Q_stricmp(mapname, "obj_team2") || !Q_stricmp(mapname, "obj_team4")) {
|
||||
continue;
|
||||
}
|
||||
|
||||
listbox->AddItem(new MpMapPickerItem(mapname, path));
|
||||
}
|
||||
}
|
||||
|
||||
FS_FreeFileList(filenames);
|
||||
}
|
||||
|
||||
void MpMapPickerClass::FileSelected( str& currentDirectory, str& partialName, str& fullname )
|
||||
void MpMapPickerClass::FileSelected(const str& currentDirectory, const str& partialName, const str& fullname)
|
||||
{
|
||||
// FIXME: stub
|
||||
FileChosen(currentDirectory, partialName, fullname);
|
||||
}
|
||||
|
||||
void MpMapPickerClass::FileChosen( Event *ev )
|
||||
void MpMapPickerClass::FileSelected(Event *ev)
|
||||
{
|
||||
// FIXME: stub
|
||||
if (!listbox->getCurrentItem()) {
|
||||
return;
|
||||
}
|
||||
|
||||
uii.Snd_PlaySound("sound/menu/apply.wav");
|
||||
|
||||
UIListCtrlItem *item = listbox->GetItem(listbox->getCurrentItem());
|
||||
str name = item->getListItemString(0);
|
||||
str directory = item->getListItemString(1);
|
||||
|
||||
FileSelected(directory, name, directory + name);
|
||||
}
|
||||
|
||||
void MpMapPickerClass::FileChosen( str& currentDirectory, str& partialName, str& fullname )
|
||||
void MpMapPickerClass::FileChosen(const str& currentDirectory, const str& partialName, const str& fullname)
|
||||
{
|
||||
// FIXME: stub
|
||||
const char *pszFilename;
|
||||
str sCommand;
|
||||
|
||||
pszFilename = fullname.c_str();
|
||||
sCommand = va("ui_dmmap %s\n", pszFilename + 5);
|
||||
|
||||
Cbuf_AddText(sCommand);
|
||||
CloseWindow();
|
||||
}
|
||||
|
||||
void MpMapPickerClass::OnDeactivated( Event *ev )
|
||||
void MpMapPickerClass::FileChosen(Event *ev)
|
||||
{
|
||||
// FIXME: stub
|
||||
if (!listbox->getCurrentItem()) {
|
||||
return;
|
||||
}
|
||||
|
||||
uii.Snd_PlaySound("sound/menu/apply.wav");
|
||||
|
||||
UIListCtrlItem *item = listbox->GetItem(listbox->getCurrentItem());
|
||||
str name = item->getListItemString(0);
|
||||
str directory = item->getListItemString(1);
|
||||
|
||||
FileSelected(directory, name, directory + name);
|
||||
}
|
||||
|
||||
void MpMapPickerClass::Setup( const char *root_directory, const char *current_directory )
|
||||
void MpMapPickerClass::CloseWindow(void)
|
||||
{
|
||||
// FIXME: stub
|
||||
PostEvent(EV_Remove, 0);
|
||||
}
|
||||
|
||||
void MpMapPickerClass::OnDeactivated(Event *ev)
|
||||
{
|
||||
CloseWindow();
|
||||
}
|
||||
|
||||
MpMapPickerItem::MpMapPickerItem(const str& string, const str& directory)
|
||||
{
|
||||
m_string = string;
|
||||
m_directory = directory;
|
||||
}
|
||||
|
||||
int MpMapPickerItem::getListItemValue(int which) const
|
||||
{
|
||||
return atoi(m_string);
|
||||
}
|
||||
|
||||
griditemtype_t MpMapPickerItem::getListItemType(int which) const
|
||||
{
|
||||
return griditemtype_t::TYPE_STRING;
|
||||
}
|
||||
|
||||
str MpMapPickerItem::getListItemString(int which) const
|
||||
{
|
||||
switch (which) {
|
||||
default:
|
||||
case 0:
|
||||
return m_string;
|
||||
case 1:
|
||||
return m_directory;
|
||||
}
|
||||
}
|
||||
|
||||
void MpMapPickerItem::DrawListItem(int iColumn, const UIRect2D& drawRect, bool bSelected, UIFont *pFont) {}
|
||||
|
||||
qboolean MpMapPickerItem::IsHeaderEntry() const
|
||||
{
|
||||
return qfalse;
|
||||
}
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
/*
|
||||
===========================================================================
|
||||
Copyright (C) 2015 the OpenMoHAA team
|
||||
Copyright (C) 2023 the OpenMoHAA team
|
||||
|
||||
This file is part of OpenMoHAA source code.
|
||||
|
||||
|
@ -20,39 +20,40 @@ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
|||
===========================================================================
|
||||
*/
|
||||
|
||||
#ifndef __CL_UIMPMAPPICKER_H__
|
||||
#define __CL_UIMPMAPPICKER_H__
|
||||
#pragma once
|
||||
|
||||
class UIFloatingWindow;
|
||||
|
||||
class MpMapPickerClass : public USignal {
|
||||
class MpMapPickerClass : public USignal
|
||||
{
|
||||
UIFloatingWindow *window;
|
||||
UIListCtrl *listbox;
|
||||
str currentDirectory;
|
||||
str rootDirectory;
|
||||
str gameType;
|
||||
|
||||
public:
|
||||
CLASS_PROTOTYPE( MpMapPickerClass );
|
||||
CLASS_PROTOTYPE(MpMapPickerClass);
|
||||
|
||||
private:
|
||||
void SetupFiles( void );
|
||||
void GotoParentDirectory( void );
|
||||
void GotoSubDirectory( str subdir );
|
||||
void Initialize( const char *root_directory, const char *current_directory );
|
||||
void SetupFiles(void);
|
||||
void SetupSecondaryFiles(const char *path, bool bTugOfWar, bool bObjective, bool bLiberation);
|
||||
void GotoParentDirectory(void);
|
||||
void GotoSubDirectory(str subdir);
|
||||
void Initialize(const char *root_directory, const char *current_directory, const char *game_type);
|
||||
|
||||
protected:
|
||||
void CloseWindow( void );
|
||||
void FileSelected( Event *ev );
|
||||
virtual void FileSelected( str& currentDirectory, str& partialName, str& fullname );
|
||||
void FileChosen( Event *ev );
|
||||
virtual void FileChosen( str& currentDirectory, str& partialName, str& fullname );
|
||||
void OnDeactivated( Event *ev );
|
||||
void CloseWindow(void);
|
||||
void FileSelected(Event *ev);
|
||||
virtual void FileSelected(const str& currentDirectory, const str& partialName, const str& fullname);
|
||||
void FileChosen(Event *ev);
|
||||
virtual void FileChosen(const str& currentDirectory, const str& partialName, const str& fullname);
|
||||
void OnDeactivated(Event *ev);
|
||||
|
||||
public:
|
||||
MpMapPickerClass();
|
||||
~MpMapPickerClass();
|
||||
|
||||
void Setup( const char *root_directory, const char *current_directory );
|
||||
// game_type was added in 2.0
|
||||
void Setup(const char *root_directory, const char *current_directory, const char *game_type = NULL);
|
||||
};
|
||||
|
||||
#endif /* __CL_UIMPMAPPICKER_H__ */
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
/*
|
||||
===========================================================================
|
||||
Copyright (C) 2015 the OpenMoHAA team
|
||||
Copyright (C) 2023 the OpenMoHAA team
|
||||
|
||||
This file is part of OpenMoHAA source code.
|
||||
|
||||
|
@ -22,62 +22,361 @@ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
|||
|
||||
#include "cl_ui.h"
|
||||
|
||||
CLASS_DECLARATION( USignal, PlayerModelPickerClass, NULL )
|
||||
class PMPickerItem : public UIListCtrlItem
|
||||
{
|
||||
{ NULL, NULL }
|
||||
str m_string;
|
||||
|
||||
public:
|
||||
PMPickerItem(const str& string);
|
||||
|
||||
int getListItemValue(int which) const override;
|
||||
griditemtype_t getListItemType(int which) const override;
|
||||
str getListItemString(int which) const override;
|
||||
void DrawListItem(int iColumn, const UIRect2D& drawRect, bool bSelected, UIFont *pFont) override;
|
||||
qboolean IsHeaderEntry() const override;
|
||||
};
|
||||
|
||||
typedef struct {
|
||||
const char *fileName;
|
||||
const char *displayName;
|
||||
} PMPickerModel_t;
|
||||
|
||||
static const PMPickerModel_t pickerModels[] = {
|
||||
// 2.0 skins
|
||||
{"allied_101st_captain", "US - 101st Airborne Captain" },
|
||||
{"allied_101st_infantry", "US - 101st Airborne Private 1" },
|
||||
{"allied_101st_scout", "US - 101st Airborne Private 2" },
|
||||
{"allied_501st_pir_scout", "US - 501st Paratrooper 1" },
|
||||
{"allied_501st_pir_soldier", "US - 501st Paratrooper 2" },
|
||||
// 1.0 skins
|
||||
{"allied_airborne", "US - 501st Paratrooper 3" },
|
||||
// Readded in OPM (was removed in 2.0)
|
||||
{"allied_manon", "US - Manon" },
|
||||
// 2.0 skins
|
||||
{"allied_british_6th_airborne_captain", "UK - 6th Airborne Captain" },
|
||||
{"allied_british_6th_airborne_paratrooper", "UK - 6th Airborne Paratrooper" },
|
||||
// 1.0 skins
|
||||
{"allied_pilot", "US - Army Pilot" },
|
||||
// 2.0 skins
|
||||
{"allied_russian_corporal", "RA - Corporal" },
|
||||
{"allied_russian_crazy_boris", "RA - Crazy Boris" },
|
||||
{"allied_russian_recon_scout", "RA - Junior Lieutenant" },
|
||||
{"allied_russian_recon_soldier", "RA - Black Sea Petty Officer" },
|
||||
// 1.0 skins
|
||||
{"allied_sas", "UK - SAS Officer" },
|
||||
{"american_army", "US - Soldier" },
|
||||
{"american_ranger", "US - Ranger" },
|
||||
// 1.0 skins
|
||||
{"german_afrika_officer", "DE - Afrika Officer" },
|
||||
{"german_afrika_private", "DE - Afrika Private" },
|
||||
// 2.0 skins
|
||||
{"german_ardennes_artillery_commander", "DE - Artillery Commander" },
|
||||
{"german_dday_colonel", "DE - Normandy Colonel" },
|
||||
// 1.0 skins
|
||||
{"german_elite_officer", "DE - Elite Officer" },
|
||||
{"german_elite_sentry", "DE - Elite Sentry" },
|
||||
{"german_kradshutzen", "DE - Kradshutzen" },
|
||||
{"german_panzer_grenadier", "DE - Panzer Grenadier" },
|
||||
{"german_panzer_obershutze", "DE - Panzer Obershutze" },
|
||||
{"german_panzer_shutze", "DE - Panzer Shutze" },
|
||||
{"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" },
|
||||
// 1.0 skins
|
||||
{"german_waffenss_officer", "DE - Waffen Officer" },
|
||||
{"german_waffenss_shutze", "DE - Waffen Shutze" },
|
||||
{"german_wehrmacht_officer", "DE - Wehrmacht Officer" },
|
||||
{"german_wehrmacht_soldier", "DE - Wehrmacht Soldier" },
|
||||
{"german_winter_1", "DE - Winter Infantry 1" },
|
||||
{"german_winter_2", "DE - Winter Infantry 2" },
|
||||
{"german_worker", "DE - German Mechanic" },
|
||||
// 2.11 skins
|
||||
{"allied_british_tank_corporal", "UK - 6th Royal Tank Regiment" },
|
||||
{"allied_russian_seaman", "RA - Red Navy Seaman" },
|
||||
{"german_Panzer_Corporal", "DE - 1st Panzer Regiment" },
|
||||
{"allied_technician", "US - Air Force Technician" },
|
||||
{"german_stukageschwader", "DE - Stukageschwader" },
|
||||
// 2.30 skins
|
||||
{"It_AX_Ital_Vol", "IT - 10th Army XXI Corps" },
|
||||
{"SC_AX_Ital_Inf", "IT - 6th Army 202nd Coastal Div"},
|
||||
{"SC_AX_Ital_Inf2", "IT - 114th Inf Regiment" },
|
||||
{"SC_AX_ITAL_PARA", "IT - Paracadutista Militare" },
|
||||
// 2.40 skins
|
||||
{"allied_Wheathers", "US - General Wheathers" },
|
||||
{"allied_US_Tank", "US - II Corps Tank Commander" },
|
||||
{"allied_US_Mask", "US - II Corps Infantry" },
|
||||
{"allied_british_Cmd", "UK - 10th Corps" },
|
||||
{"allied_british_Tank", "UK - 8th Army" },
|
||||
{NULL, NULL }
|
||||
};
|
||||
|
||||
const char *PM_FilenameToDisplayname(const char *fileName)
|
||||
{
|
||||
int i;
|
||||
|
||||
for (i = 0; pickerModels[i].fileName; i++) {
|
||||
const PMPickerModel_t& model = pickerModels[i];
|
||||
|
||||
if (!Q_stricmp(model.fileName, fileName)) {
|
||||
return model.displayName;
|
||||
}
|
||||
}
|
||||
|
||||
return fileName;
|
||||
}
|
||||
|
||||
const char *PM_DisplaynameToFilename(const char *displayName)
|
||||
{
|
||||
int i;
|
||||
|
||||
for (i = 0; pickerModels[i].fileName; i++) {
|
||||
const PMPickerModel_t& model = pickerModels[i];
|
||||
|
||||
if (!Q_stricmp(model.displayName, displayName)) {
|
||||
return model.fileName;
|
||||
}
|
||||
}
|
||||
|
||||
return displayName;
|
||||
}
|
||||
|
||||
CLASS_DECLARATION(USignal, PlayerModelPickerClass, NULL) {
|
||||
{&EV_UIListBase_ItemSelected, &PlayerModelPickerClass::FileSelected },
|
||||
{&EV_UIListBase_ItemDoubleClicked, &PlayerModelPickerClass::FileChosen },
|
||||
{&UIFloatingWindow::W_ClosePressed, &PlayerModelPickerClass::OnDeactivated},
|
||||
{&W_Deactivated, &PlayerModelPickerClass::OnDeactivated},
|
||||
{NULL, NULL }
|
||||
};
|
||||
|
||||
PlayerModelPickerClass::PlayerModelPickerClass()
|
||||
{
|
||||
// FIXME: stub
|
||||
window = new UIFloatingWindow();
|
||||
window->Create(
|
||||
NULL,
|
||||
UIRect2D((uid.vidWidth - 400) / 2, (uid.vidHeight - 300) / 2, 400, 300),
|
||||
"Player Model Select...",
|
||||
UColor(0.15f, 0.195f, 0.278f),
|
||||
UHudColor
|
||||
);
|
||||
window->setFont("facfont-20");
|
||||
window->PassEventToWidget("closebutton", new Event(EV_Widget_Disable));
|
||||
window->PassEventToWidget("minimizebutton", new Event(EV_Widget_Disable));
|
||||
window->Connect(this, W_Deactivated, W_Deactivated);
|
||||
|
||||
listbox = new UIListCtrl();
|
||||
listbox->InitFrame(window->getChildSpace(), window->getChildSpace()->getClientFrame(), 0);
|
||||
listbox->SetDrawHeader(false);
|
||||
listbox->setFont("facfont-20");
|
||||
listbox->FrameInitialized();
|
||||
listbox->AddColumn("Player Model", 0, 400, false, false);
|
||||
|
||||
listbox->Connect(this, EV_UIListBase_ItemDoubleClicked, EV_UIListBase_ItemDoubleClicked);
|
||||
listbox->Connect(this, EV_UIListBase_ItemSelected, EV_UIListBase_ItemSelected);
|
||||
listbox->AllowActivate(true);
|
||||
|
||||
// Added in 2.0
|
||||
// Don't localize elements
|
||||
listbox->SetDontLocalize();
|
||||
|
||||
m_bGermanModels = false;
|
||||
}
|
||||
|
||||
PlayerModelPickerClass::~PlayerModelPickerClass()
|
||||
{
|
||||
// FIXME: stub
|
||||
if (listbox) {
|
||||
delete listbox;
|
||||
listbox = NULL;
|
||||
}
|
||||
|
||||
if (window) {
|
||||
delete window;
|
||||
window = NULL;
|
||||
}
|
||||
}
|
||||
|
||||
void PlayerModelPickerClass::SetupFiles( void )
|
||||
void PlayerModelPickerClass::Setup(const char *root_directory, const char *current_directory, qboolean bGermanModels)
|
||||
{
|
||||
// FIXME: stub
|
||||
Initialize(root_directory, current_directory, bGermanModels);
|
||||
}
|
||||
|
||||
void PlayerModelPickerClass::Initialize( const char *root_directory, const char *current_directory, qboolean bGermanModels )
|
||||
void PlayerModelPickerClass::Initialize(
|
||||
const char *root_directory, const char *current_directory, qboolean bGermanModels
|
||||
)
|
||||
{
|
||||
// FIXME: stub
|
||||
rootDirectory = root_directory;
|
||||
m_bGermanModels = bGermanModels;
|
||||
if (rootDirectory.length() > 1 && rootDirectory[rootDirectory.length() - 1] != '/') {
|
||||
rootDirectory += "/";
|
||||
}
|
||||
|
||||
currentDirectory = current_directory;
|
||||
if (currentDirectory.length() > 1 && currentDirectory[currentDirectory.length() - 1] != '/') {
|
||||
currentDirectory += "/";
|
||||
}
|
||||
|
||||
SetupFiles();
|
||||
}
|
||||
|
||||
void PlayerModelPickerClass::CloseWindow( void )
|
||||
void PlayerModelPickerClass::SetupFiles(void)
|
||||
{
|
||||
// FIXME: stub
|
||||
str mappath;
|
||||
char work[128];
|
||||
char **filenames;
|
||||
const char *displayName;
|
||||
int numfiles;
|
||||
int i;
|
||||
int iLen;
|
||||
qboolean bIsGerman;
|
||||
|
||||
// cleanup
|
||||
listbox->DeleteAllItems();
|
||||
|
||||
if (m_bGermanModels) {
|
||||
window->setTitle("Select Your Axis Player Model");
|
||||
} else {
|
||||
window->setTitle("Select Your Allied Player Model");
|
||||
}
|
||||
|
||||
filenames = FS_ListFiles(currentDirectory, ".tik", qfalse, &numfiles);
|
||||
|
||||
for (i = 0; i < numfiles; i++) {
|
||||
Q_strncpyz(work, filenames[i], sizeof(work));
|
||||
|
||||
if (strstr(work, "_fps")) {
|
||||
// ignore view models
|
||||
continue;
|
||||
}
|
||||
|
||||
if (work[0] == '_') {
|
||||
// ignore hidden models
|
||||
continue;
|
||||
}
|
||||
|
||||
// allied_manon readded in OPM
|
||||
//if (!Q_stricmpn(work, "allied_manon")) {
|
||||
// continue;
|
||||
//}
|
||||
|
||||
bIsGerman = !Q_stricmpn(work, "german", 6u) || !Q_stricmpn(work, "axis", 4u) || !Q_stricmpn(work, "it", 2u)
|
||||
|| !Q_stricmpn(work, "sc", 2u);
|
||||
|
||||
if (m_bGermanModels != bIsGerman) {
|
||||
continue;
|
||||
}
|
||||
|
||||
// strip the extension
|
||||
work[strlen(work) - 4] = 0;
|
||||
displayName = PM_FilenameToDisplayname(work);
|
||||
|
||||
listbox->AddItem(new PMPickerItem(displayName));
|
||||
}
|
||||
|
||||
FS_FreeFileList(filenames);
|
||||
|
||||
listbox->SortByColumn(0);
|
||||
}
|
||||
|
||||
void PlayerModelPickerClass::FileSelected( Event *ev )
|
||||
void PlayerModelPickerClass::FileSelected(
|
||||
const str& name, const str& currentDirectory, const str& partialName, const str& fullname
|
||||
)
|
||||
{
|
||||
// FIXME: stub
|
||||
FileChosen(name, currentDirectory, partialName, fullname);
|
||||
}
|
||||
|
||||
void PlayerModelPickerClass::FileSelected( str& currentDirectory, str& partialName, str& fullname )
|
||||
void PlayerModelPickerClass::FileSelected(Event *ev)
|
||||
{
|
||||
// FIXME: stub
|
||||
str name;
|
||||
char donotshowssindeorfr[64];
|
||||
str fullname;
|
||||
|
||||
name = listbox->GetItem(listbox->getCurrentItem())->getListItemString(0);
|
||||
fullname = PM_DisplaynameToFilename(name);
|
||||
|
||||
if (!Q_stricmpn(fullname, "german_waffen_", 14)) {
|
||||
Q_strncpyz(donotshowssindeorfr, "german_waffenss_", sizeof(donotshowssindeorfr));
|
||||
Q_strcat(donotshowssindeorfr, sizeof(donotshowssindeorfr), fullname.c_str() + 14);
|
||||
} else {
|
||||
Q_strncpyz(donotshowssindeorfr, fullname, sizeof(donotshowssindeorfr));
|
||||
}
|
||||
|
||||
FileSelected(name, currentDirectory, fullname, currentDirectory + donotshowssindeorfr);
|
||||
}
|
||||
|
||||
void PlayerModelPickerClass::FileChosen( Event *ev )
|
||||
void PlayerModelPickerClass::FileChosen(
|
||||
const str& name, const str& currentDirectory, const str& partialName, const str& fullname
|
||||
)
|
||||
{
|
||||
// FIXME: stub
|
||||
str sCommand;
|
||||
|
||||
if (m_bGermanModels) {
|
||||
sCommand += "ui_dm_playergermanmodel \"" + name;
|
||||
sCommand += "\" ; ui_dm_playergermanmodel_set " + partialName;
|
||||
sCommand += " ; ui_disp_playergermanmodel " + fullname + ".tik";
|
||||
} else {
|
||||
sCommand += "ui_dm_playermodel \"" + name;
|
||||
sCommand += "\" ; ui_dm_playermodel_set " + partialName;
|
||||
sCommand += " ; ui_disp_playermodel " + fullname + ".tik";
|
||||
}
|
||||
sCommand += "\n";
|
||||
|
||||
Cbuf_AddText(sCommand);
|
||||
CloseWindow();
|
||||
}
|
||||
|
||||
void PlayerModelPickerClass::FileChosen( str& currentDirectory, str& partialName, str& fullname )
|
||||
void PlayerModelPickerClass::FileChosen(Event *ev)
|
||||
{
|
||||
// FIXME: stub
|
||||
str name;
|
||||
char donotshowssindeorfr[64];
|
||||
str fullname;
|
||||
|
||||
name = listbox->GetItem(listbox->getCurrentItem())->getListItemString(0);
|
||||
fullname = PM_DisplaynameToFilename(name);
|
||||
|
||||
if (!Q_stricmpn(fullname, "german_waffen_", 14)) {
|
||||
Q_strncpyz(donotshowssindeorfr, "german_waffen_", sizeof(donotshowssindeorfr));
|
||||
Q_strcat(donotshowssindeorfr, sizeof(donotshowssindeorfr), fullname.c_str() + 14);
|
||||
} else {
|
||||
Q_strncpyz(donotshowssindeorfr, fullname, sizeof(donotshowssindeorfr));
|
||||
}
|
||||
|
||||
FileChosen(name, currentDirectory, fullname, currentDirectory + donotshowssindeorfr);
|
||||
}
|
||||
|
||||
void PlayerModelPickerClass::OnDeactivated( Event *ev )
|
||||
void PlayerModelPickerClass::CloseWindow(void)
|
||||
{
|
||||
// FIXME: stub
|
||||
PostEvent(EV_Remove, 0);
|
||||
}
|
||||
|
||||
void PlayerModelPickerClass::Setup( const char *root_directory, const char *current_directory, qboolean bGermanModels )
|
||||
void PlayerModelPickerClass::OnDeactivated(Event *ev)
|
||||
{
|
||||
// FIXME: stub
|
||||
CloseWindow();
|
||||
}
|
||||
|
||||
PMPickerItem::PMPickerItem(const str& string)
|
||||
{
|
||||
m_string = string;
|
||||
}
|
||||
|
||||
int PMPickerItem::getListItemValue(int which) const
|
||||
{
|
||||
return atoi(m_string);
|
||||
}
|
||||
|
||||
griditemtype_t PMPickerItem::getListItemType(int which) const
|
||||
{
|
||||
return griditemtype_t::TYPE_STRING;
|
||||
}
|
||||
|
||||
str PMPickerItem::getListItemString(int which) const
|
||||
{
|
||||
return m_string;
|
||||
}
|
||||
|
||||
void PMPickerItem::DrawListItem(int iColumn, const UIRect2D& drawRect, bool bSelected, UIFont *pFont) {}
|
||||
|
||||
qboolean PMPickerItem::IsHeaderEntry() const
|
||||
{
|
||||
return qfalse;
|
||||
}
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
/*
|
||||
===========================================================================
|
||||
Copyright (C) 2015 the OpenMoHAA team
|
||||
Copyright (C) 2023 the OpenMoHAA team
|
||||
|
||||
This file is part of OpenMoHAA source code.
|
||||
|
||||
|
@ -20,37 +20,41 @@ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
|||
===========================================================================
|
||||
*/
|
||||
|
||||
#ifndef __CL_UIPLAYERMODELPICKER_H__
|
||||
#define __CL_UIPLAYERMODELPICKER_H__
|
||||
#pragma once
|
||||
|
||||
class UIFloatingWindow;
|
||||
|
||||
class PlayerModelPickerClass : public USignal {
|
||||
class PlayerModelPickerClass : public USignal
|
||||
{
|
||||
UIFloatingWindow *window;
|
||||
UIListCtrl *listbox;
|
||||
str currentDirectory;
|
||||
str rootDirectory;
|
||||
qboolean m_bGermanModels;
|
||||
|
||||
public:
|
||||
CLASS_PROTOTYPE( PlayerModelPickerClass );
|
||||
CLASS_PROTOTYPE(PlayerModelPickerClass);
|
||||
|
||||
private:
|
||||
void SetupFiles( void );
|
||||
void Initialize( const char *root_directory, const char *current_directory, qboolean bGermanModels );
|
||||
void SetupFiles(void);
|
||||
void Initialize(const char *root_directory, const char *current_directory, qboolean bGermanModels);
|
||||
|
||||
protected:
|
||||
void CloseWindow( void );
|
||||
void FileSelected( Event *ev );
|
||||
virtual void FileSelected( str& currentDirectory, str& partialName, str& fullname );
|
||||
void FileChosen( Event *ev );
|
||||
virtual void FileChosen( str& currentDirectory, str& partialName, str& fullname );
|
||||
void OnDeactivated( Event *ev );
|
||||
void CloseWindow(void);
|
||||
void FileSelected(Event *ev);
|
||||
// The name parameter was added in 2.0.
|
||||
virtual void FileSelected(const str& name, const str& currentDirectory, const str& partialName, const str& fullname);
|
||||
void FileChosen(Event *ev);
|
||||
// The name parameter was added in 2.0.
|
||||
virtual void FileChosen(const str& name, const str& currentDirectory, const str& partialName, const str& fullname);
|
||||
void OnDeactivated(Event *ev);
|
||||
|
||||
public:
|
||||
PlayerModelPickerClass();
|
||||
~PlayerModelPickerClass();
|
||||
|
||||
void Setup( const char *root_directory, const char *current_directory, qboolean bGermanModels );
|
||||
void Setup(const char *root_directory, const char *current_directory, qboolean bGermanModels);
|
||||
};
|
||||
|
||||
#endif /* __CL_UIPLAYERMODELPICKER_H__ */
|
||||
const char* PM_FilenameToDisplayname(const char* fileName);
|
||||
const char* PM_DisplaynameToFilename(const char* displayName);
|
||||
|
|
|
@ -58,7 +58,7 @@ void UIRadar::Draw(void)
|
|||
float inv;
|
||||
float iconSize;
|
||||
int blinkTime, speakTime;
|
||||
float origin[2], axis[2];
|
||||
vec2_t origin, axis;
|
||||
float halfScale;
|
||||
int i;
|
||||
|
||||
|
@ -105,9 +105,9 @@ void UIRadar::Draw(void)
|
|||
halfScale = iconSize * 0.5f;
|
||||
|
||||
for (i = 0; i < MAX_CLIENTS; i++) {
|
||||
float delta[2];
|
||||
float newOrg[2];
|
||||
float screenOrg[2];
|
||||
vec2_t delta;
|
||||
vec2_t newOrg;
|
||||
vec2_t screenOrg;
|
||||
float length;
|
||||
|
||||
radar = &g_radarClients[i];
|
||||
|
@ -115,7 +115,7 @@ void UIRadar::Draw(void)
|
|||
continue;
|
||||
}
|
||||
|
||||
if (!g_radarClients[i].time) {
|
||||
if (!radar->time) {
|
||||
continue;
|
||||
}
|
||||
|
||||
|
@ -128,10 +128,13 @@ void UIRadar::Draw(void)
|
|||
// make the icon blink
|
||||
if (delta >= 0 && delta < speakTime && ((delta / blinkTime) % 2) == 0) {
|
||||
continue;
|
||||
}
|
||||
|
||||
if (delta < 0 || delta >= speakTime) {
|
||||
radar->lastSpeakTime = 0;
|
||||
}
|
||||
}
|
||||
|
||||
radar->lastSpeakTime = 0;
|
||||
delta[0] = radar->origin[0] - origin[0];
|
||||
delta[1] = radar->origin[1] - origin[1];
|
||||
newOrg[0] = -(delta[0] * axis[0] + delta[1] * axis[1]) * inv;
|
||||
|
@ -140,12 +143,12 @@ void UIRadar::Draw(void)
|
|||
|
||||
if (length > 1)
|
||||
{
|
||||
newOrg[0] = -(delta[0] * axis[0] + delta[1] * axis[1]) * inv * (1.f / length);
|
||||
newOrg[1] = (delta[0] * axis[1] + delta[1] * -axis[0]) * inv * (1.f / length);
|
||||
newOrg[0] *= 1.f / length;
|
||||
newOrg[1] *= 1.f / length;
|
||||
}
|
||||
|
||||
screenOrg[0] = -((halfScale * (1.141f * newOrg[1] + m_vVirtualScale[0])) - ((1.f + newOrg[1]) * 0.5f * m_frame.size.width));
|
||||
screenOrg[1] = -((halfScale * (1.141f * newOrg[0] + m_vVirtualScale[1])) - ((1.f + newOrg[0]) * 0.5f * m_frame.size.height));
|
||||
screenOrg[0] = -((halfScale * (1.414f * newOrg[1] + m_vVirtualScale[0])) - ((1.f + newOrg[1]) * 0.5f * m_frame.size.width));
|
||||
screenOrg[1] = -((halfScale * (1.414f * newOrg[0] + m_vVirtualScale[1])) - ((1.f + newOrg[0]) * 0.5f * m_frame.size.height));
|
||||
|
||||
uii.Rend_DrawPicStretched2(
|
||||
screenOrg[0],
|
||||
|
|
File diff suppressed because it is too large
Load diff
|
@ -22,6 +22,8 @@ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
|||
|
||||
#pragma once
|
||||
|
||||
#include "../gamespy/goaceng.h"
|
||||
|
||||
class UIFAKKServerList : public UIListCtrl {
|
||||
protected:
|
||||
// need a new struct instead of gamespy
|
||||
|
@ -47,6 +49,7 @@ protected:
|
|||
void MakeLANListing( Event *ev );
|
||||
void UpdateServer( Event *ev );
|
||||
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();
|
||||
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
/*
|
||||
===========================================================================
|
||||
Copyright (C) 2015 the OpenMoHAA team
|
||||
Copyright (C) 2023 the OpenMoHAA team
|
||||
|
||||
This file is part of OpenMoHAA source code.
|
||||
|
||||
|
@ -22,22 +22,42 @@ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
|||
|
||||
#include "cl_ui.h"
|
||||
|
||||
CLASS_DECLARATION( FilePickerClass, SoundPickerClass, NULL )
|
||||
{
|
||||
{ NULL, NULL }
|
||||
CLASS_DECLARATION(FilePickerClass, SoundPickerClass, NULL) {
|
||||
{NULL, NULL}
|
||||
};
|
||||
|
||||
SoundPickerClass::SoundPickerClass()
|
||||
{
|
||||
// FIXME: stub
|
||||
str soundpath;
|
||||
str currentpath;
|
||||
const char *varValue;
|
||||
int i;
|
||||
|
||||
soundpath = "sound";
|
||||
|
||||
varValue = UI_GetCvarString("ui_pickedsound", NULL);
|
||||
if (varValue && *varValue) {
|
||||
currentpath = varValue;
|
||||
|
||||
for (i = currentpath.length(); i > 0; i--) {
|
||||
if (currentpath[i] == '/') {
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
currentpath = str(currentpath, 0, i + 1);
|
||||
} else {
|
||||
currentpath = soundpath;
|
||||
}
|
||||
}
|
||||
|
||||
void SoundPickerClass::FileSelected( str ¤tDirectory, str &partialName, str &fullname )
|
||||
void SoundPickerClass::FileSelected(const str& currentDirectory, const str& partialName, const str& fullname)
|
||||
{
|
||||
|
||||
uii.Snd_PlaySound(fullname);
|
||||
}
|
||||
|
||||
void SoundPickerClass::FileChosen( str ¤tDirectory, str &partialName, str &fullname )
|
||||
void SoundPickerClass::FileChosen(const str& currentDirectory, const str& partialName, const str& fullname)
|
||||
{
|
||||
|
||||
uii.Cvar_Set("ui_pickedsound", fullname);
|
||||
CloseWindow();
|
||||
}
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
/*
|
||||
===========================================================================
|
||||
Copyright (C) 2015 the OpenMoHAA team
|
||||
Copyright (C) 2023 the OpenMoHAA team
|
||||
|
||||
This file is part of OpenMoHAA source code.
|
||||
|
||||
|
@ -20,17 +20,15 @@ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
|||
===========================================================================
|
||||
*/
|
||||
|
||||
#ifndef __CL_UISOUNDPICKER_H__
|
||||
#define __CL_UISOUNDPICKER_H__
|
||||
#pragma once
|
||||
|
||||
class SoundPickerClass : public FilePickerClass {
|
||||
class SoundPickerClass : public FilePickerClass
|
||||
{
|
||||
public:
|
||||
CLASS_PROTOTYPE( SoundPickerClass );
|
||||
CLASS_PROTOTYPE(SoundPickerClass);
|
||||
|
||||
SoundPickerClass();
|
||||
|
||||
void FileSelected( str ¤tDirectory, str &partialName, str &fullname ) override;
|
||||
void FileChosen( str ¤tDirectory, str &partialName, str &fullname ) override;
|
||||
void FileSelected(const str& currentDirectory, const str& partialName, const str& fullname) override;
|
||||
void FileChosen(const str& currentDirectory, const str& partialName, const str& fullname) override;
|
||||
};
|
||||
|
||||
#endif /* __CL_UISOUNDPICKER_H__ */
|
||||
|
|
Some files were not shown because too many files have changed in this diff Show more
Loading…
Add table
Add a link
Reference in a new issue