mirror of
https://github.com/bearstonem/openmohaa-vr.git
synced 2026-10-23 13:00:30 +02:00
Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
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 | ||
|
|
60faa9dd9b | ||
|
|
75f8f86f86 | ||
|
|
0ee1307e75 | ||
|
|
f0c38305b5 | ||
|
|
e07dda6991 | ||
|
|
b10ce9a426 | ||
|
|
2ac2800ecb | ||
|
|
e59200a7de | ||
|
|
a7902a8837 | ||
|
|
615726cc75 | ||
|
|
839abf6076 | ||
|
|
c7c8d4580d | ||
|
|
2cc47e10f9 | ||
|
|
8fc5dacebf | ||
|
|
cb23f3bb70 | ||
|
|
d7350d8629 | ||
|
|
ac6b5ef1f7 | ||
|
|
7fdd26c59e | ||
|
|
fad555308b | ||
|
|
969255c48e | ||
|
|
433305617c | ||
|
|
5418d84c7e | ||
|
|
cca37e3dfe | ||
|
|
0e9d83ee14 | ||
|
|
ecbf7f6caa | ||
|
|
5a3638fa68 | ||
|
|
111088b540 | ||
|
|
ba1703ebf0 | ||
|
|
825df20a72 | ||
|
|
0a42fd79d2 | ||
|
|
e50a041c12 | ||
|
|
ce0e9fe77e | ||
|
|
5105dcce04 | ||
|
|
58b4a9a676 | ||
|
|
1146c834fb | ||
|
|
9068264132 | ||
|
|
59ac8ea437 | ||
|
|
afafacaeec | ||
|
|
baf451d2a2 | ||
|
|
d588012168 | ||
|
|
a3ed25cb2e | ||
|
|
c399f45841 | ||
|
|
6a6eeae4ee | ||
|
|
65f36505d1 | ||
|
|
b852980842 | ||
|
|
d351ced78b | ||
|
|
4cd45c63c4 | ||
|
|
de16a72aed | ||
|
|
4b29c63fc9 | ||
|
|
770e832592 | ||
|
|
14f9acdb57 | ||
|
|
573a6f5bd5 | ||
|
|
8c64b7aa89 | ||
|
|
8d49f8935c | ||
|
|
ff8ec63e95 | ||
|
|
771ee1b5a9 | ||
|
|
096692fec8 | ||
|
|
d29454b44d | ||
|
|
30a1ccb2e2 | ||
|
|
ea1b411cc0 | ||
|
|
7794ee8aea | ||
|
|
99a9022b53 | ||
|
|
1255964e6b | ||
|
|
37de859bee | ||
|
|
990aa5cdb2 | ||
|
|
befcedcf58 | ||
|
|
eeb697570d | ||
|
|
6410567e9a | ||
|
|
bde7242cc7 | ||
|
|
e8aad97975 | ||
|
|
0662359776 | ||
|
|
5568d160ab | ||
|
|
defa297a56 | ||
|
|
782c37c4fe | ||
|
|
6f03c88ad5 | ||
|
|
3ec980c8ec | ||
|
|
c0a50eb2ff | ||
|
|
f73e4b6f22 | ||
|
|
096972827e | ||
|
|
08c040d4ea | ||
|
|
6d8b6b5f29 | ||
|
|
410f1c0ed8 | ||
|
|
cb73cfd57b | ||
|
|
8cb8a7f370 | ||
|
|
8c893acfff | ||
|
|
e453d1fa17 | ||
|
|
a7301ed7b6 | ||
|
|
42ebfd5394 | ||
|
|
cdf2f84b14 | ||
|
|
2592aeab8b | ||
|
|
34d4225ea0 | ||
|
|
17dcb4b00e | ||
|
|
eb1d096539 | ||
|
|
05c74655be | ||
|
|
3e0e0ba3b1 | ||
|
|
f90b6cd18c | ||
|
|
f0ecfcb708 | ||
|
|
177702d027 | ||
|
|
64429232f8 | ||
|
|
d6b7fecb69 | ||
|
|
51a0ee56aa | ||
|
|
2ed369568c | ||
|
|
e5b7e16d1a | ||
|
|
4a9f676d5d | ||
|
|
0e0da3d767 | ||
|
|
343ce4a6a7 | ||
|
|
df8b854cb7 | ||
|
|
831dc770d8 | ||
|
|
8a9285c64f | ||
|
|
7e4e06b09d | ||
|
|
96748b3fbc | ||
|
|
f1325048e9 | ||
|
|
deee21eb68 | ||
|
|
2f43e5c5ea | ||
|
|
4766067edb | ||
|
|
bc54f22639 | ||
|
|
20c8c87e79 | ||
|
|
3a5dcd6a3c | ||
|
|
a5ba02c2bb | ||
|
|
e1554efc08 | ||
|
|
9d652dd41b | ||
|
|
22eadf2c08 | ||
|
|
d3f1b62208 | ||
|
|
affc28ab79 | ||
|
|
41be7f44ab | ||
|
|
646c1f0f16 | ||
|
|
3cea097b48 | ||
|
|
786d72575e | ||
|
|
6d9a794aaf | ||
|
|
9e69df1e94 | ||
|
|
72d4bb0206 | ||
|
|
f68e06a949 | ||
|
|
f4da539d95 | ||
|
|
17af75a9bb | ||
|
|
dcbb39d640 | ||
|
|
d0ba1df4e0 | ||
|
|
2b92869683 | ||
|
|
379a4b0ce4 | ||
|
|
d4c7d4a7e1 | ||
|
|
dcac24c9e2 | ||
|
|
753589d840 | ||
|
|
382903c9e1 | ||
|
|
f29fec0b31 | ||
|
|
f9dc37d60a | ||
|
|
c5e48c67bb | ||
|
|
cc62ebcffc | ||
|
|
0f36504959 | ||
|
|
1fb8e25209 | ||
|
|
260876b1a2 | ||
|
|
e4fc074f09 | ||
|
|
7899e5161e | ||
|
|
95603b1142 | ||
|
|
bf8e0eb812 | ||
|
|
0c04ffc1e8 | ||
|
|
bd86acf118 | ||
|
|
6caa16444e | ||
|
|
94d4cbeb82 | ||
|
|
b31f4bc00c | ||
|
|
cf0808e119 | ||
|
|
92333909fd | ||
|
|
9c68af92be | ||
|
|
bc5d7f5e93 | ||
|
|
f2ba9a88be | ||
|
|
81b711364e | ||
|
|
554e0c7fac | ||
|
|
bd2c1c387b | ||
|
|
f19edac9ca | ||
|
|
1698f6d1bf | ||
|
|
2c3180813a | ||
|
|
a262fe5d9d | ||
|
|
a69249ee22 | ||
|
|
393c2a81d1 | ||
|
|
3a6be342ce | ||
|
|
6616bfe53e | ||
|
|
bafe60f48f | ||
|
|
e306c415f0 | ||
|
|
56a8c8d48d | ||
|
|
421f1d39a4 | ||
|
|
7c655944a5 | ||
|
|
0a27f37dc0 | ||
|
|
4695932ea1 | ||
|
|
7fe7a12167 | ||
|
|
f9487b0ba3 | ||
|
|
7c5c34741c | ||
|
|
d09459f4bf | ||
|
|
c0c6598151 | ||
|
|
f52fcc6f0e | ||
|
|
2e9ef64bd2 | ||
|
|
ff3ee39830 | ||
|
|
abd757f3bc | ||
|
|
c741591a36 | ||
|
|
78c481d725 | ||
|
|
b2ece37819 | ||
|
|
a557b29ecf | ||
|
|
1184843318 | ||
|
|
dd1f8bd92a | ||
|
|
220c82954c | ||
|
|
8879bacb1d | ||
|
|
5824022745 | ||
|
|
3ecb5bd06a | ||
|
|
7de31a776b | ||
|
|
503320d13f | ||
|
|
bd263c5d22 | ||
|
|
b0201aef5d | ||
|
|
31014808c8 | ||
|
|
0906124867 | ||
|
|
43bb5ce653 | ||
|
|
7e66483b1a | ||
|
|
f96b606a1a | ||
|
|
30d26c3e44 | ||
|
|
57e450a745 | ||
|
|
24297bf396 | ||
|
|
481cd760a9 | ||
|
|
6d6043775e | ||
|
|
bb97ec8933 | ||
|
|
dc028b87e4 | ||
|
|
0d1b7a9c8a | ||
|
|
a6e602af1d | ||
|
|
04a6012e5d | ||
|
|
0f7691c722 | ||
|
|
f01a0a17c1 | ||
|
|
b291ab92b6 | ||
|
|
fb4bf4fcaa | ||
|
|
98816156d7 | ||
|
|
92bfb4c426 | ||
|
|
cac883c4a0 | ||
|
|
5a4fb90c96 | ||
|
|
c4f9eb65ae | ||
|
|
9f5557b33c | ||
|
|
4d876fdf5d | ||
|
|
978666c946 | ||
|
|
9b9fa696e8 | ||
|
|
088b22073c | ||
|
|
4f9831faa4 | ||
|
|
3373caa939 | ||
|
|
dc1be17b2a | ||
|
|
64a3b04181 | ||
|
|
57e1920b9c | ||
|
|
ddb6236eb9 | ||
|
|
4e4af590e5 | ||
|
|
a249f6b29b | ||
|
|
7787729b24 | ||
|
|
45c8c704af | ||
|
|
31fde1ad94 | ||
|
|
bfb0fbd656 | ||
|
|
8afb7457c2 | ||
|
|
0ae1c8f771 | ||
|
|
6ff046ae29 | ||
|
|
6f9f845bb2 | ||
|
|
00033c3a70 | ||
|
|
acf71610df | ||
|
|
86e9ae343a | ||
|
|
9bbd546d4c | ||
|
|
31f2573b28 | ||
|
|
4d7fcb77c2 | ||
|
|
da02a8c73a | ||
|
|
dd0b4505a6 | ||
|
|
eaff26216a | ||
|
|
e850dd1963 | ||
|
|
cf61ae0332 | ||
|
|
5cffe3fb05 | ||
|
|
b996918d3b | ||
|
|
4a9f9a45c2 | ||
|
|
3a75772005 | ||
|
|
c196e31c6c | ||
|
|
60ceff5ae0 | ||
|
|
34a4a0c892 | ||
|
|
2a3c42d47b | ||
|
|
0b1f796e0a | ||
|
|
766d4d23bf | ||
|
|
6860a1e992 | ||
|
|
70c628d759 | ||
|
|
6eff8bc273 | ||
|
|
0b1e8cdbf3 | ||
|
|
6f58b34f87 | ||
|
|
adf081ba3c | ||
|
|
6d4a9fde3f | ||
|
|
5a5cc4ea17 | ||
|
|
69df583508 | ||
|
|
18506d9932 | ||
|
|
f076e7609e | ||
|
|
0b0d053044 | ||
|
|
ce7dfdd986 | ||
|
|
50e589f27c | ||
|
|
e904dafa38 | ||
|
|
6a210fa212 | ||
|
|
ae33155ed3 | ||
|
|
d3d44001ef | ||
|
|
c2aec1ff57 | ||
|
|
d5f08fe950 | ||
|
|
bdf4df9fd0 | ||
|
|
7481b0939e | ||
|
|
346e59f18a | ||
|
|
4725aad3e9 | ||
|
|
59fd1bfdb2 | ||
|
|
7546d91580 | ||
|
|
c81df27470 | ||
|
|
bd6232d913 | ||
|
|
7f6b73e60f | ||
|
|
e3562f9e56 | ||
|
|
40141c55de | ||
|
|
a6f6cbd9b5 | ||
|
|
e9ffb4b9b5 | ||
|
|
1f0418a9cd | ||
|
|
e76837b42c | ||
|
|
87be7068c9 | ||
|
|
49cb5af265 | ||
|
|
f0fe93429f | ||
|
|
c2461f1219 | ||
|
|
f82b6b75ff | ||
|
|
3486b590eb | ||
|
|
5730af672c | ||
|
|
4daff05142 | ||
|
|
e930768c67 | ||
|
|
6f03e388bf | ||
|
|
9b340e03c5 | ||
|
|
d5b61fe5cc | ||
|
|
5b46e48a17 | ||
|
|
585221f7cc | ||
|
|
77eb7a5259 | ||
|
|
77bfc4b599 | ||
|
|
95bbfba1b8 | ||
|
|
844a50dfd8 | ||
|
|
cd2fea5262 | ||
|
|
79d8b4bb0b | ||
|
|
531825545d | ||
|
|
daab5b9238 | ||
|
|
ce59e5e6a7 | ||
|
|
ea0c4b5060 | ||
|
|
9b9908b660 | ||
|
|
101894be37 | ||
|
|
3e314251f2 | ||
|
|
1995c75006 | ||
|
|
ff85986c44 | ||
|
|
9131297d43 | ||
|
|
301f3091d1 | ||
|
|
b59bd449d4 | ||
|
|
5e510ef0e2 | ||
|
|
c7c3fcd0e0 | ||
|
|
a5532ad67b | ||
|
|
290cd5501c | ||
|
|
8d1b1410cd | ||
|
|
df9aead324 | ||
|
|
851fd240d3 | ||
|
|
2da03c89d1 | ||
|
|
89cd12d2c1 | ||
|
|
e21d2a0adb | ||
|
|
2fad64b08a | ||
|
|
97fd147fbe | ||
|
|
0f01f6af11 | ||
|
|
a9892c88be | ||
|
|
f1d76a042d | ||
|
|
77d4e5d051 | ||
|
|
7041acfd51 | ||
|
|
b27bfbe189 | ||
|
|
1c10e7a63d | ||
|
|
0a7c324d48 | ||
|
|
c81d247fbb | ||
|
|
82294b7b2e | ||
|
|
d80f55d5bf | ||
|
|
7930cda277 | ||
|
|
7870db7202 | ||
|
|
407538fd85 | ||
|
|
1a293420c0 | ||
|
|
1e94cdd8ca | ||
|
|
7a2311d6e6 | ||
|
|
e686937ae9 | ||
|
|
8dca8988fe | ||
|
|
c890ac5944 | ||
|
|
56e52fda80 | ||
|
|
e7786b3192 | ||
|
|
4cc3a84e98 | ||
|
|
6e0b048ae7 | ||
|
|
115786798d | ||
|
|
376db9e9e6 | ||
|
|
8abdb80e85 | ||
|
|
656f212608 | ||
|
|
60e07cc4ff | ||
|
|
e132c0a015 | ||
|
|
8e63526f2a | ||
|
|
a5b7c774c1 | ||
|
|
130a5bb8c4 | ||
|
|
3802dd9984 | ||
|
|
7d37397222 | ||
|
|
932454d7b2 | ||
|
|
5d2e6c46aa | ||
|
|
38089195be | ||
|
|
85a6c1d145 | ||
|
|
85d034b7fb | ||
|
|
82b5468fb4 | ||
|
|
89759c44af | ||
|
|
6f66a1d1c3 | ||
|
|
d4bac185f6 | ||
|
|
658bba576e | ||
|
|
31f3c25b18 | ||
|
|
4a1f149051 | ||
|
|
c55a78b8b4 | ||
|
|
3dbf957304 | ||
|
|
8f98f49f1b | ||
|
|
0a8322960b | ||
|
|
63d73c6f86 | ||
|
|
f8cbbe78a2 | ||
|
|
2bb09503c6 | ||
|
|
ba313decd1 | ||
|
|
0d6847c76c | ||
|
|
7b721c7849 | ||
|
|
1fb073fd6a | ||
|
|
484272aed4 | ||
|
|
57422ce793 | ||
|
|
ba855cd064 | ||
|
|
39ac9f7de6 | ||
|
|
4368035da4 | ||
|
|
4391912ee3 | ||
|
|
fc17536f55 | ||
|
|
3bae4338c3 | ||
|
|
f59bdd6b9f | ||
|
|
03f3676b00 | ||
|
|
e0d7079745 | ||
|
|
b7f421481f | ||
|
|
3506cb3f94 | ||
|
|
7280acee42 | ||
|
|
d757fa6306 | ||
|
|
475fc92629 | ||
|
|
f24303dd78 | ||
|
|
180a20f561 | ||
|
|
2e5ca5b9dc | ||
|
|
decee20fd8 | ||
|
|
3d9a60c415 | ||
|
|
a4a7002867 | ||
|
|
96c9a014e6 | ||
|
|
11b4471be9 | ||
|
|
17aea205f7 | ||
|
|
739f54ed87 | ||
|
|
01be5bee72 | ||
|
|
dfcf0da710 | ||
|
|
f47fb87d1b | ||
|
|
bd639ba936 | ||
|
|
e784e62a4e | ||
|
|
e4425dcbf8 | ||
|
|
0dcffe8771 | ||
|
|
2b27f6c452 | ||
|
|
3ba3c728bc | ||
|
|
7193198af2 | ||
|
|
6691afd160 | ||
|
|
59fb220197 | ||
|
|
ff7651d4c8 | ||
|
|
b02abb1f18 | ||
|
|
9f42da4686 | ||
|
|
58e3056374 | ||
|
|
3142865fef | ||
|
|
06e3497a57 | ||
|
|
e49833737d | ||
|
|
7eedc5fef8 | ||
|
|
c442942022 | ||
|
|
2c2652ed1d | ||
|
|
97bcc07aab | ||
|
|
001704b22e | ||
|
|
f1d9cd93ce | ||
|
|
49aa2aa858 | ||
|
|
6274d9a1e9 | ||
|
|
5fa9d91401 | ||
|
|
9acb803ffe | ||
|
|
105924bca3 | ||
|
|
5f12be2037 | ||
|
|
13931c40cb | ||
|
|
ada5d614c5 | ||
|
|
7323d51219 | ||
|
|
f5071f2667 | ||
|
|
0ca0a81644 | ||
|
|
e1bd69b467 | ||
|
|
b17494519e | ||
|
|
13555f505c | ||
|
|
2a65f53084 | ||
|
|
71fe83083e | ||
|
|
0ddb5c859f | ||
|
|
f7b12d5108 | ||
|
|
baa8f4334b | ||
|
|
24a211b190 | ||
|
|
6e82f254b7 | ||
|
|
fbfedcf8d6 | ||
|
|
5b06a0c2a4 | ||
|
|
f3204b0845 | ||
|
|
334314a137 | ||
|
|
8ecc8122b8 | ||
|
|
eb9a119dfe | ||
|
|
313ece62f7 | ||
|
|
5799bcceb2 | ||
|
|
61e7571388 | ||
|
|
6cfd99e40a | ||
|
|
b3bdd9d563 | ||
|
|
5bec3d8471 | ||
|
|
711e46ecfb | ||
|
|
ddd127352f | ||
|
|
784fd825bb | ||
|
|
673a42242d | ||
|
|
3317345d92 | ||
|
|
7958ba38d8 | ||
|
|
2dd7e0c03f | ||
|
|
b94f021567 | ||
|
|
cf50c5b535 | ||
|
|
1b71169565 | ||
|
|
30f2b9d5ed | ||
|
|
999d6a449b | ||
|
|
a65aa2a0d0 | ||
|
|
36fc0b6e8a | ||
|
|
f97362cdb1 | ||
|
|
6398484459 | ||
|
|
07e8c6feaa | ||
|
|
faf351a496 | ||
|
|
cd9315852e | ||
|
|
8c8487231a | ||
|
|
65ebdf0862 | ||
|
|
9704362501 | ||
|
|
f0e87cd85a | ||
|
|
f6e6bf1d6b | ||
|
|
4b4e8f806b | ||
|
|
4141cee13f | ||
|
|
b2ee346f68 | ||
|
|
2220f1ff05 | ||
|
|
7ba48dd666 | ||
|
|
2a48e2fd27 | ||
|
|
63a24c4448 | ||
|
|
787df3362b | ||
|
|
5ad0f60ee3 | ||
|
|
d42f92361a | ||
|
|
0693db3ef5 | ||
|
|
fafb0e2793 | ||
|
|
0a4819d172 | ||
|
|
ee03f32a3e | ||
|
|
f4e01917a2 | ||
|
|
eed9b36c9f | ||
|
|
055192c2a8 | ||
|
|
cca39108dc | ||
|
|
b1bbd5e366 | ||
|
|
afb718f01f | ||
|
|
653b4e0ab7 | ||
|
|
c3d228a9f5 | ||
|
|
15e10caca0 | ||
|
|
46efa85441 | ||
|
|
bb42456653 | ||
|
|
38bf80aa52 | ||
|
|
c5c2aa5348 | ||
|
|
1e67aeb667 | ||
|
|
9ac7bccba5 | ||
|
|
610b82cfb7 | ||
|
|
c8144539d0 | ||
|
|
60f83597ee | ||
|
|
46c0c6085d | ||
|
|
36d4c4af61 | ||
|
|
7406c3dc23 | ||
|
|
24bb15ce29 | ||
|
|
f3ad05dc85 | ||
|
|
bbae3223cb | ||
|
|
8cedb24d31 | ||
|
|
528414dfef | ||
|
|
6e1c58e343 | ||
|
|
002e935193 | ||
|
|
e26d7d346a | ||
|
|
5d917f2578 | ||
|
|
8aecff1879 | ||
|
|
718672119e | ||
|
|
6ec7482662 | ||
|
|
5f3ea7c634 | ||
|
|
1c813a59d0 | ||
|
|
a66236fc3d | ||
|
|
ef9b7022df | ||
|
|
ad7efce855 | ||
|
|
78a9990c3a | ||
|
|
422b9eb6c0 | ||
|
|
703eb271f9 | ||
|
|
2aca32c44a | ||
|
|
56c30bddb1 | ||
|
|
1179b50ad1 | ||
|
|
6ad44441a6 | ||
|
|
2455c09475 | ||
|
|
7a1e07e72a | ||
|
|
aa8e95885a | ||
|
|
54bae94ad9 | ||
|
|
98b7e01069 | ||
|
|
12c7707bc3 | ||
|
|
a8a2c7e345 | ||
|
|
6c7542ec0c | ||
|
|
5ec56cbe77 | ||
|
|
6b79770783 | ||
|
|
e125a83625 | ||
|
|
d05b47e996 | ||
|
|
e1093d0c0c | ||
|
|
25690648d6 | ||
|
|
5c3c4f6288 | ||
|
|
9dec5e9e54 | ||
|
|
ae1fa808da | ||
|
|
ed6839dc99 | ||
|
|
e95d71da0d | ||
|
|
128c8f3c06 | ||
|
|
04f61a1af7 | ||
|
|
974e86b698 | ||
|
|
12c03384b2 | ||
|
|
99ba912d7b | ||
|
|
7607932216 | ||
|
|
acc9c241a3 | ||
|
|
5f5055f4fc | ||
|
|
fc3749e008 | ||
|
|
155734370c | ||
|
|
1095e3d509 | ||
|
|
f7bfa47f2e | ||
|
|
9f6ef14ea1 | ||
|
|
15de08556e | ||
|
|
e7dfa8fcfe | ||
|
|
7a67dc5dfd | ||
|
|
7eb8ef42b7 | ||
|
|
c9c7a4beed | ||
|
|
bcf3aad1b2 | ||
|
|
ad75363028 | ||
|
|
f4ec3939a5 | ||
|
|
aead97d29d | ||
|
|
f468305a2c | ||
|
|
a962f469eb | ||
|
|
63e025cc02 | ||
|
|
b2d332f152 | ||
|
|
e160cf240c | ||
|
|
19a4f70c44 | ||
|
|
dcca3901d5 | ||
|
|
0ee4ffbfbc | ||
|
|
776bc781cd | ||
|
|
b1bb79e19f | ||
|
|
76c69b7bd1 | ||
|
|
15a25a412f | ||
|
|
b511d89dcc | ||
|
|
9512ae7aeb | ||
|
|
5db086e470 | ||
|
|
d63f668291 | ||
|
|
35c72a9570 | ||
|
|
b29f62ddd4 | ||
|
|
525dc17573 | ||
|
|
4d8ed24833 | ||
|
|
aa15d996e0 | ||
|
|
0ec846945d | ||
|
|
03ff158e76 | ||
|
|
b3371b2d63 | ||
|
|
ed64d03bf5 | ||
|
|
3d936dede1 | ||
|
|
33e9c5b1ea | ||
|
|
078c90bbc9 | ||
|
|
2caf2cad5a | ||
|
|
5dec21dd43 | ||
|
|
36aa9bd802 | ||
|
|
bed2f15a72 | ||
|
|
f949f1e88d | ||
|
|
8af202bd5f | ||
|
|
67556a88f1 | ||
|
|
4f8573784d | ||
|
|
c5a46be23e | ||
|
|
47a3c0bf55 | ||
|
|
e8d2a2a461 | ||
|
|
7b72a3fba4 | ||
|
|
dda79e7f27 | ||
|
|
9a104566ba | ||
|
|
b4d8982341 | ||
|
|
5ea3fc28f7 | ||
|
|
0bbf39660e | ||
|
|
791f38762b | ||
|
|
c296b909c7 | ||
|
|
9c7a54f8fc | ||
|
|
4289eab72b | ||
|
|
7b0dbc7445 | ||
|
|
02db904336 | ||
|
|
55140fee3a | ||
|
|
96d881a1f1 | ||
|
|
260a95c05e | ||
|
|
99d633587f | ||
|
|
cf2f0256a2 | ||
|
|
dae8e8dfbd | ||
|
|
6d2d35e82d | ||
|
|
5e23a6b640 | ||
|
|
f2ec502dc2 | ||
|
|
be04f31256 | ||
|
|
85dd881c97 | ||
|
|
0ef2dccd90 | ||
|
|
000ec39c81 | ||
|
|
3160c6ee0b | ||
|
|
9da403e534 | ||
|
|
f19c3408e1 | ||
|
|
38c0e09e8a | ||
|
|
2be4f7cdaf | ||
|
|
cd48272fbb | ||
|
|
a5a146bb02 | ||
|
|
c901bcf321 | ||
|
|
8f3142e532 | ||
|
|
88438d6db4 | ||
|
|
7348734070 | ||
|
|
a99a4a3a2b | ||
|
|
7bc8c3ab5b | ||
|
|
2a58fbdd22 | ||
|
|
d102f5a88a | ||
|
|
8227f7125b | ||
|
|
673535dc08 | ||
|
|
9750489d07 | ||
|
|
53c6224ed0 | ||
|
|
f84794acbe | ||
|
|
9e535e509a | ||
|
|
489210424f | ||
|
|
394abbdb6f | ||
|
|
5fdeb92429 | ||
|
|
11cc39e41b | ||
|
|
b3d5851fdc | ||
|
|
5c25839bab | ||
|
|
fbd314b447 | ||
|
|
86888a32d4 | ||
|
|
37c2d22b10 | ||
|
|
19758ef75d | ||
|
|
519ccc90f7 | ||
|
|
b592d15d1f | ||
|
|
78d70a892c | ||
|
|
dbcf4c1800 | ||
|
|
cbd4630b3c | ||
|
|
92fdfe3f35 | ||
|
|
8b563e5232 | ||
|
|
aeb4875fa5 | ||
|
|
5ebb9c61f9 | ||
|
|
c0e5b8fe15 | ||
|
|
f852efea7d | ||
|
|
664ae905bb | ||
|
|
243b0fd109 | ||
|
|
43b0944403 | ||
|
|
ecc3c9f7b4 | ||
|
|
296249b203 | ||
|
|
8c1145bb9f | ||
|
|
7ad18a68f8 | ||
|
|
99ba396c24 | ||
|
|
f88e9960f2 | ||
|
|
b53466ea0d | ||
|
|
2afda6a470 | ||
|
|
acc8081ef2 | ||
|
|
7433677ead | ||
|
|
4132f7efe6 | ||
|
|
56e0f5797e | ||
|
|
54c142ce78 | ||
|
|
c106aeef2b | ||
|
|
66bde85807 | ||
|
|
08363511a7 | ||
|
|
d6b93b712c | ||
|
|
a85d6d0f4c | ||
|
|
2c1f341099 | ||
|
|
52bb709ca5 | ||
|
|
24ea958748 | ||
|
|
b6143ce54c | ||
|
|
463ea7d34b | ||
|
|
1015302a7f | ||
|
|
c73f5917f8 | ||
|
|
9315cfa488 | ||
|
|
0f58b5780a | ||
|
|
edd5f07d48 | ||
|
|
a7f258f2b1 | ||
|
|
65dcb72cba | ||
|
|
4885c536c8 | ||
|
|
b6204dab78 | ||
|
|
5b5951483a | ||
|
|
194d53569f | ||
|
|
5e8b54be7e | ||
|
|
8dc91e413e | ||
|
|
57cf513b39 | ||
|
|
bb1326860b | ||
|
|
136838e40b | ||
|
|
30d9483504 | ||
|
|
05d3c50866 | ||
|
|
d5e93d863a | ||
|
|
d3f93aae15 | ||
|
|
963e4aa7ec | ||
|
|
5a250ea247 | ||
|
|
bc8d8aafc0 | ||
|
|
f67ab4ec7f | ||
|
|
cf9af20fbd | ||
|
|
3be2a3eb79 | ||
|
|
7dfd18f4fb | ||
|
|
05fc960338 | ||
|
|
21d41ce14b | ||
|
|
1562ba3f97 | ||
|
|
2798e73707 | ||
|
|
89aeee4269 | ||
|
|
d50302fa41 | ||
|
|
8efae54450 | ||
|
|
2785a72789 | ||
|
|
ac55a44761 | ||
|
|
42f1a286a8 | ||
|
|
241fa5d485 | ||
|
|
e87f9c5710 | ||
|
|
c95a6ee3fd | ||
|
|
10b954cb1a | ||
|
|
cf7914b6f8 | ||
|
|
e58e048f00 | ||
|
|
b92cd8a64f | ||
|
|
317aead26d | ||
|
|
e93780c66c | ||
|
|
af8990acf0 | ||
|
|
e41dcf03ad | ||
|
|
0209e8f782 | ||
|
|
50d935171e | ||
|
|
86ee9089e9 | ||
|
|
ba6fe112bb | ||
|
|
15860a7795 | ||
|
|
78b3ad8075 | ||
|
|
f61bda330e | ||
|
|
5c9fceea2c | ||
|
|
32cceebc47 | ||
|
|
9d921df733 | ||
|
|
428f8c183d | ||
|
|
45aae54b32 | ||
|
|
d9ca73bc4c | ||
|
|
c2e24da9bd | ||
|
|
c6ae5ed551 | ||
|
|
0f86a5ee8a | ||
|
|
803e53869b | ||
|
|
a4fc25cca8 | ||
|
|
28fbcf5628 | ||
|
|
3ea73febe4 | ||
|
|
9eb3b3e1c3 | ||
|
|
48e1c39320 | ||
|
|
fe38c7650f | ||
|
|
5e2f5010f8 | ||
|
|
efce4703ca | ||
|
|
94ab4a5ac5 | ||
|
|
58321be1ce | ||
|
|
20282ffa56 | ||
|
|
ff4987cc81 | ||
|
|
80a22ca2ed | ||
|
|
51ca0a06a7 | ||
|
|
010794418c | ||
|
|
51b5b2571a | ||
|
|
182a677337 | ||
|
|
17f6c25bc7 | ||
|
|
31d19cb0f6 | ||
|
|
6c65bba279 | ||
|
|
8ae15be0de | ||
|
|
11fb5ee2af | ||
|
|
b68992e55e | ||
|
|
007a7681eb | ||
|
|
7d4cdac52c | ||
|
|
916f38e1b2 | ||
|
|
39ae88a2ab | ||
|
|
24f82e8e36 | ||
|
|
247d09a09d | ||
|
|
030b291af1 | ||
|
|
9d0a5faed3 | ||
|
|
261b15851f | ||
|
|
2929bd82a5 | ||
|
|
4939927975 | ||
|
|
f9ef6733b9 | ||
|
|
de08fe7ca3 | ||
|
|
482536ff1c | ||
|
|
3089cc8bc3 | ||
|
|
a307450e17 | ||
|
|
50cfc7e5ad | ||
|
|
5b82cc4f11 | ||
|
|
a83a76da95 | ||
|
|
2e4759ab1f | ||
|
|
af056d7646 | ||
|
|
46e57f0a1f | ||
|
|
fe5473bc85 | ||
|
|
1a03288144 | ||
|
|
0c2326480b | ||
|
|
24f3b3bc93 | ||
|
|
459aa89ca2 | ||
|
|
ec8eaacc69 | ||
|
|
84f55f627e | ||
|
|
a30f78e834 | ||
|
|
d22cda594f | ||
|
|
8cfa909b73 | ||
|
|
86a6dd020f | ||
|
|
556133fa11 | ||
|
|
4001de1dde | ||
|
|
7a57a25c58 | ||
|
|
d95cdcc142 | ||
|
|
d2a967e577 | ||
|
|
84adaa07e0 | ||
|
|
2efeb7e972 | ||
|
|
b9655e3f19 | ||
|
|
dce004ef13 | ||
|
|
b9f1530eec | ||
|
|
9b15b27f28 | ||
|
|
ff2e64a742 | ||
|
|
4e38b803fb | ||
|
|
9825e1e6f2 | ||
|
|
b278f2eafa | ||
|
|
25912079db | ||
|
|
b1753df1ed | ||
|
|
03143d1341 | ||
|
|
843b49d56b | ||
|
|
00644e7605 | ||
|
|
93814bd05b | ||
|
|
438ed2c0ea | ||
|
|
0310475957 | ||
|
|
435bfe1271 | ||
|
|
7ca532f0e4 | ||
|
|
8c3997f13b | ||
|
|
d8ae1ce6b9 | ||
|
|
5cb1e5de84 | ||
|
|
7fd2aff17b | ||
|
|
b9f3ee867b | ||
|
|
f16b992a97 | ||
|
|
9ba5710412 | ||
|
|
7e6854f96b | ||
|
|
aa25ef6c68 | ||
|
|
9db1076603 | ||
|
|
7b39218af5 | ||
|
|
ba5b2adf94 | ||
|
|
ded7d941ea | ||
|
|
09ed4e4a1d | ||
|
|
9b3aaa0f87 | ||
|
|
a274325f43 | ||
|
|
b0da0b8321 | ||
|
|
a241ea20fa | ||
|
|
f8d5a5ecd2 | ||
|
|
f20b47ebc0 | ||
|
|
de10ab8df3 | ||
|
|
47c7c5a5e3 | ||
|
|
80ada3225d | ||
|
|
a1745829b2 | ||
|
|
b2853465ed | ||
|
|
c89091b4cd | ||
|
|
e5beb0d9b9 | ||
|
|
80ab513d76 | ||
|
|
854136d85b | ||
|
|
25c417187b | ||
|
|
e3e9328ba3 | ||
|
|
3cc0c41b7b | ||
|
|
697013bbbf | ||
|
|
0080d4b9a8 | ||
|
|
8c391ef880 | ||
|
|
e6d3ca32f4 | ||
|
|
fab78f933e | ||
|
|
5cd7d89e72 | ||
|
|
15e8146306 | ||
|
|
250f1d090e | ||
|
|
03c5864034 | ||
|
|
07b7f10912 | ||
|
|
0e1837db31 | ||
|
|
070fe17473 | ||
|
|
ba607a0aad | ||
|
|
2b38a0f48e | ||
|
|
a1fb3b283c | ||
|
|
12e85aba45 | ||
|
|
44fe18fef1 | ||
|
|
28de2543ec | ||
|
|
4435984b81 | ||
|
|
1435489a43 | ||
|
|
3d20b3a232 | ||
|
|
97543622bf | ||
|
|
a9374f068b | ||
|
|
d80e9d80e7 | ||
|
|
4f757445c4 | ||
|
|
2749ab92b2 | ||
|
|
011bee9f33 | ||
|
|
1b86e60548 | ||
|
|
23e01fc1a7 | ||
|
|
2c9c80d7bc | ||
|
|
5146b1f36b | ||
|
|
bc81fe78b2 | ||
|
|
4de1b7c73b | ||
|
|
3c8c4e9f97 | ||
|
|
c366c10530 | ||
|
|
6f5106803d | ||
|
|
55a6b7956a | ||
|
|
911d1f1706 | ||
|
|
56fba733f3 | ||
|
|
a3c65ef7e4 | ||
|
|
73bc196592 | ||
|
|
8487099264 | ||
|
|
bdcd0dbd56 | ||
|
|
3c2600648c | ||
|
|
f1abfeced6 | ||
|
|
99bce5a11a | ||
|
|
ab5a3604bf | ||
|
|
fab7d8539c | ||
|
|
0347a5ca0b | ||
|
|
42ad1cb41c | ||
|
|
64e3c18fb9 | ||
|
|
7e113359b3 | ||
|
|
467802c466 | ||
|
|
ce1b3aaee9 | ||
|
|
1a53bdd584 | ||
|
|
5521e7654d | ||
|
|
73716dd624 | ||
|
|
840d23dcac | ||
|
|
525a0c7c82 | ||
|
|
46c35057fb | ||
|
|
6d03b9763a | ||
|
|
9eaecb0a2a | ||
|
|
c274af839e | ||
|
|
f9232840e4 | ||
|
|
3ea40fda82 | ||
|
|
c357c2614a | ||
|
|
efed6d0eac | ||
|
|
244220f031 | ||
|
|
7ce87575bc | ||
|
|
401cfeda65 | ||
|
|
a45a8c7742 | ||
|
|
c80b360918 | ||
|
|
8514ef6ef8 | ||
|
|
9b1dc34ea1 | ||
|
|
f5490321e7 | ||
|
|
1f4393e3b2 | ||
|
|
8aa6a16a27 | ||
|
|
286f553a54 | ||
|
|
f0ec50e37b | ||
|
|
c1ee0332e3 | ||
|
|
d2737f2b40 | ||
|
|
0d501ec38a | ||
|
|
d39e6421fe | ||
|
|
c2125947ab | ||
|
|
953a33a6ff | ||
|
|
883e7884c4 | ||
|
|
508903c3b1 | ||
|
|
9116063d3f | ||
|
|
e2a0d2d01e | ||
|
|
5343949254 | ||
|
|
c17454b124 | ||
|
|
4f8dc5dc2a | ||
|
|
0fea47bb69 | ||
|
|
47665fcd70 | ||
|
|
968b073338 | ||
|
|
03582bb59a | ||
|
|
149d3ce2fc | ||
|
|
fe5e151d89 | ||
|
|
06a7341eda | ||
|
|
456ed42e14 | ||
|
|
2337f93df8 | ||
|
|
ad675b05ac | ||
|
|
44f6de9524 | ||
|
|
e25605b898 | ||
|
|
919d14e329 | ||
|
|
8fc64cd1b1 | ||
|
|
028a7d6125 | ||
|
|
60b9a6e2e0 | ||
|
|
9ad515335a | ||
|
|
7593ea53f9 | ||
|
|
07374ba1ed | ||
|
|
2deba01a5f | ||
|
|
3daee90b5b | ||
|
|
c4ba60afbd | ||
|
|
81e9ce10cd | ||
|
|
c4738966fe | ||
|
|
0eedc4e2f8 | ||
|
|
14f9368575 | ||
|
|
394546dee7 | ||
|
|
e86e5c0d80 | ||
|
|
e0b5a62c4f | ||
|
|
7fb42cf655 | ||
|
|
819f6bcf71 | ||
|
|
ad47f8855b | ||
|
|
a50102ef52 | ||
|
|
0b2a0634f5 | ||
|
|
8ea32fee31 | ||
|
|
f0571385d5 | ||
|
|
83318af532 | ||
|
|
860c9b33ef | ||
|
|
ecbd6ae282 | ||
|
|
3ec799d150 | ||
|
|
72715c1a85 | ||
|
|
16d262f6ee | ||
|
|
49850940d6 | ||
|
|
e634fb5022 | ||
|
|
c0726f0634 | ||
|
|
91dc3e5884 | ||
|
|
ba2c3ed5fd | ||
|
|
161f7e3313 | ||
|
|
f2f7afadef | ||
|
|
0898bffb43 | ||
|
|
99dc7bf7f2 | ||
|
|
64acea9018 | ||
|
|
8e05347ba0 | ||
|
|
07e90d37ee | ||
|
|
71bd04e5b2 | ||
|
|
95510279ed | ||
|
|
f1502833b2 | ||
|
|
e6448697d3 | ||
|
|
5a96d6dd96 | ||
|
|
8d6b3d0bd8 | ||
|
|
1fd0cd097f | ||
|
|
421126db38 | ||
|
|
7258a2e972 | ||
|
|
df66ab0339 | ||
|
|
c49d0c7afa | ||
|
|
421b3d6375 | ||
|
|
11ef489225 | ||
|
|
e1da6797c5 | ||
|
|
430c7d1a57 | ||
|
|
d3794c0dd9 | ||
|
|
eef1368083 | ||
|
|
6dfefa04f5 | ||
|
|
8b17d81545 | ||
|
|
ec58ca0f13 | ||
|
|
3fd87f90a2 | ||
|
|
9f268b0f6a | ||
|
|
f857116f75 | ||
|
|
ea78d96bc3 | ||
|
|
0be9e69833 | ||
|
|
8171641e3a | ||
|
|
ee6014a30f | ||
|
|
16c22a3ee5 | ||
|
|
571e48fecf | ||
|
|
973d7c5f34 | ||
|
|
a1c5ca288a | ||
|
|
e330d00565 | ||
|
|
6feeb21e21 | ||
|
|
bb5cf24d5f | ||
|
|
0dda70cca1 | ||
|
|
5e83e03e33 | ||
|
|
d2b3f6c12b | ||
|
|
f5af33b181 | ||
|
|
0da1ed8764 | ||
|
|
8aa6f29c4c | ||
|
|
1b7a4442d3 | ||
|
|
a163df993c | ||
|
|
2787007b9d | ||
|
|
cea2c178b5 | ||
|
|
77a9cd5a9a | ||
|
|
ec3259271e | ||
|
|
ae02abba3b | ||
|
|
bf960f6f32 | ||
|
|
66a1087099 | ||
|
|
c1a431f857 | ||
|
|
dac5279a59 | ||
|
|
a175ea27d7 | ||
|
|
ddac42e21e | ||
|
|
34535ad415 | ||
|
|
c0597e441c | ||
|
|
04b66684dd | ||
|
|
244a2e66f9 | ||
|
|
55b737e730 | ||
|
|
059dacf2a7 | ||
|
|
41f7003747 | ||
|
|
64ba900511 | ||
|
|
e371b4bbd3 | ||
|
|
aa44150525 | ||
|
|
3572be718a | ||
|
|
a56d74814b | ||
|
|
8d41b58635 | ||
|
|
e80f326ee6 | ||
|
|
c5bd64912a | ||
|
|
8a808b616e | ||
|
|
91bb2f2e0b | ||
|
|
aa4e6a0651 | ||
|
|
8e9ff2b289 | ||
|
|
d53ab8540e | ||
|
|
7b133e5b2f | ||
|
|
2b72959935 | ||
|
|
82d0b62631 | ||
|
|
7205e27c8c | ||
|
|
c8d1248d86 | ||
|
|
845e4556ef | ||
|
|
a92bfbde40 | ||
|
|
999b6409b3 | ||
|
|
0ae0be4047 | ||
|
|
fc7029c271 | ||
|
|
307ee117bd | ||
|
|
087d28eb9a | ||
|
|
1deea345bc | ||
|
|
e0fa706f6c | ||
|
|
cf794d2b95 | ||
|
|
391e82bb92 | ||
|
|
83a44b3158 | ||
|
|
8cd0e6c5bf | ||
|
|
619ab00035 | ||
|
|
4ded5c3380 | ||
|
|
85fa2185f8 | ||
|
|
ab39259bbe | ||
|
|
9bf2065d18 | ||
|
|
ceb121d588 | ||
|
|
e7dbc25ca0 | ||
|
|
7386784765 | ||
|
|
9062952539 | ||
|
|
9f0a479c3b | ||
|
|
517b9296dc | ||
|
|
3ca09613e1 | ||
|
|
ba931cbedf | ||
|
|
090b354b23 | ||
|
|
dd30bfde15 | ||
|
|
477735cb3d | ||
|
|
38599f2181 | ||
|
|
bd794fb286 | ||
|
|
ce34b78113 | ||
|
|
b8a87dc6ea | ||
|
|
7bdc30936c | ||
|
|
9e635a7207 | ||
|
|
e5626378ef | ||
|
|
73921c116d | ||
|
|
d4b98ef9dd | ||
|
|
40318f052a | ||
|
|
a130f45c62 | ||
|
|
e687d97660 | ||
|
|
e4a0406fc2 | ||
|
|
ef18c389be | ||
|
|
85099801ab | ||
|
|
3472657f92 | ||
|
|
c197513ff3 | ||
|
|
9dca77c2cf | ||
|
|
f08a7fa21e | ||
|
|
2df56c810d | ||
|
|
8c6098f730 | ||
|
|
1462d4f8d9 | ||
|
|
5bd49304d7 | ||
|
|
f52d648d6f | ||
|
|
987af7eb81 | ||
|
|
f313b6a058 | ||
|
|
99b989bb63 | ||
|
|
7ebbba6ce5 | ||
|
|
c2a6db15a6 | ||
|
|
aa58bcf948 | ||
|
|
fa5b030522 | ||
|
|
3e44049abf | ||
|
|
94c501e71b | ||
|
|
484b2a8900 | ||
|
|
e8ff4fb9a7 | ||
|
|
b89e10fd5c | ||
|
|
d86ea606eb | ||
|
|
2135be12b8 | ||
|
|
ae5d51f2e9 | ||
|
|
6eaf25ff80 | ||
|
|
17c371c15e | ||
|
|
13febc125e | ||
|
|
b0f26acc18 | ||
|
|
8ffa5f15e6 | ||
|
|
f6bcc1ab86 | ||
|
|
a4d6442526 | ||
|
|
b7fac3a5b0 | ||
|
|
64ebf3ed05 | ||
|
|
9933612607 | ||
|
|
22ff072b54 | ||
|
|
73b0a84ad0 | ||
|
|
7b03f953bf | ||
|
|
367d6ff6fc | ||
|
|
ca61fde54b | ||
|
|
f739588c73 | ||
|
|
ce02d782c4 | ||
|
|
a498b11e20 | ||
|
|
ffa5a91cd2 | ||
|
|
ae680ffd5d | ||
|
|
4c17d12fc6 | ||
|
|
0259f1a251 | ||
|
|
04708aeb67 | ||
|
|
a47eb1653e | ||
|
|
10fda39430 | ||
|
|
b2be03cce3 | ||
|
|
84ecf838d4 | ||
|
|
c115796137 | ||
|
|
7e054c8beb | ||
|
|
e8df36998e | ||
|
|
0cc558f757 | ||
|
|
5c9bc074f4 | ||
|
|
d89175ebc8 | ||
|
|
727eb71995 | ||
|
|
3d48c00902 | ||
|
|
963318264c | ||
|
|
d9123799d6 | ||
|
|
6562bcb164 | ||
|
|
4fa8af3b30 | ||
|
|
3f4be4f8ef | ||
|
|
09c7badf4f | ||
|
|
7b9b371cf6 | ||
|
|
25e44e7a45 | ||
|
|
51374729d3 | ||
|
|
5a19f7f574 | ||
|
|
40ac8a1557 | ||
|
|
ca42a3e08e | ||
|
|
3a04357b71 | ||
|
|
078223c1b6 | ||
|
|
3fe7cbf725 | ||
|
|
d6059e42ba | ||
|
|
02c1fbe4fc | ||
|
|
6f8fee47f2 | ||
|
|
6c247b300e | ||
|
|
3627760748 | ||
|
|
f3affb3d4c | ||
|
|
a86ed01ba3 | ||
|
|
d40755eb7c | ||
|
|
ce7599cb02 | ||
|
|
68bf89c522 | ||
|
|
0c5b57ee05 | ||
|
|
69a10da52c | ||
|
|
ab534623c4 | ||
|
|
ae4ea14b35 | ||
|
|
ea3c48af02 | ||
|
|
9df0c023ed | ||
|
|
a5259ebc05 | ||
|
|
add59ad12a | ||
|
|
53eecb4d4c | ||
|
|
77fb47451c | ||
|
|
80ae39c2a7 | ||
|
|
118ce0d550 | ||
|
|
dfd9afceba | ||
|
|
6f7eb93645 | ||
|
|
a5268cbd24 | ||
|
|
c732ed66b2 | ||
|
|
10981f706f | ||
|
|
d61218d7e2 | ||
|
|
615032bc25 | ||
|
|
ea70be07a2 | ||
|
|
1884d3d23c | ||
|
|
3f036cca5e | ||
|
|
3e02fe340b | ||
|
|
50d62f1505 | ||
|
|
60511ace99 | ||
|
|
aef54d05ae | ||
|
|
15633626fe | ||
|
|
d43b60c818 | ||
|
|
7941524aad | ||
|
|
3aa4a6157c | ||
|
|
fc9cf41557 | ||
|
|
527131e513 | ||
|
|
b79163f998 | ||
|
|
121aaa164a | ||
|
|
2522559a04 | ||
|
|
cf61471b2d | ||
|
|
9ebdc6a238 | ||
|
|
0c65f5dab3 | ||
|
|
12d6b064ec | ||
|
|
9de676a86b | ||
|
|
087d0047b3 | ||
|
|
d6952b8915 | ||
|
|
396e543b74 | ||
|
|
fa3479cc96 | ||
|
|
0e27ebb3e4 | ||
|
|
cd3e9bec03 | ||
|
|
6082e0abe1 | ||
|
|
23cf561405 | ||
|
|
a6c7f7d4e0 | ||
|
|
74f230077d | ||
|
|
c2cc57fa6b | ||
|
|
7b1ab5fea6 | ||
|
|
3161f28da6 | ||
|
|
403e98fba6 | ||
|
|
3e657679a0 | ||
|
|
7c2cdd52b0 | ||
|
|
6c46c5d5c0 | ||
|
|
930784bdf3 | ||
|
|
92efd2a4bb | ||
|
|
751283aeb5 | ||
|
|
e97250875c | ||
|
|
c5f853aa1f | ||
|
|
00c07b4e10 | ||
|
|
783cefacf9 | ||
|
|
832067d967 | ||
|
|
8e60786307 | ||
|
|
7172f480eb | ||
|
|
b1c732eeb9 | ||
|
|
4aad275e3b | ||
|
|
2a34e54000 | ||
|
|
f725192d7d | ||
|
|
3682d3b799 | ||
|
|
24b22392ff | ||
|
|
035ed1fe24 | ||
|
|
129e3bfe6e | ||
|
|
134873cc51 | ||
|
|
d3bda17814 | ||
|
|
29c321d2cc | ||
|
|
7106396b3e | ||
|
|
ea7ee996a0 | ||
|
|
a2808a0dbf | ||
|
|
d0a8ac91a7 | ||
|
|
58b88201dd | ||
|
|
eceef48267 | ||
|
|
f32d32f720 | ||
|
|
c269a4f034 | ||
|
|
9189538410 | ||
|
|
00b028b381 | ||
|
|
7d309553cc | ||
|
|
8c7dd5fad6 | ||
|
|
a5ff63cd01 | ||
|
|
5e55e72b5c | ||
|
|
01fbba74ef | ||
|
|
c7de9048e5 | ||
|
|
6faded773c | ||
|
|
ca4e55fad8 | ||
|
|
bcf58f90d6 | ||
|
|
3f8db539af | ||
|
|
e181e00807 | ||
|
|
22fdf36cc6 | ||
|
|
415a5e60da | ||
|
|
7828cddc2a | ||
|
|
83a6493024 | ||
|
|
e763d2b17d | ||
|
|
ae8d26ce18 | ||
|
|
1438c052b4 | ||
|
|
8489059ea8 | ||
|
|
2866bfdd04 | ||
|
|
52f60e647d | ||
|
|
66213821c5 | ||
|
|
baee33e07f | ||
|
|
800ccaf020 | ||
|
|
7e526ca9a5 | ||
|
|
b07784d884 | ||
|
|
6891d297d2 | ||
|
|
69c2ea4614 | ||
|
|
7515c99195 | ||
|
|
70463db037 | ||
|
|
2015fbda4d | ||
|
|
f227fcdcaa | ||
|
|
3a27275cb2 | ||
|
|
c05403d5d3 | ||
|
|
89b2c9be9d | ||
|
|
e288272c4a | ||
|
|
fc362fbe6b | ||
|
|
113e3c3d87 | ||
|
|
1ae812af96 | ||
|
|
f66ce78a56 | ||
|
|
9882a20a95 | ||
|
|
7458077346 | ||
|
|
483df8ef87 | ||
|
|
6318a606e8 | ||
|
|
608b8bec30 | ||
|
|
ac8f34a40c | ||
|
|
7cc687e110 | ||
|
|
819fe53eaa | ||
|
|
e0a4661ec0 | ||
|
|
8b83b8e5bb | ||
|
|
a2e7a4b4a6 | ||
|
|
f164bc638b | ||
|
|
68df65994a | ||
|
|
2dc43f9104 | ||
|
|
b8ff6d0f21 | ||
|
|
7063469585 | ||
|
|
84f785a872 | ||
|
|
d7700ea1c2 | ||
|
|
4e4e82c874 | ||
|
|
0c57ec27e6 | ||
|
|
bc249844bf | ||
|
|
7da3432b8c | ||
|
|
e8ecd1ca9e | ||
|
|
ec21e2e4d0 | ||
|
|
83d8fcb0e6 | ||
|
|
dc2b99fb58 | ||
|
|
0f05f8356f | ||
|
|
34a426adf1 | ||
|
|
f4790a0e50 | ||
|
|
e943b95025 | ||
|
|
981610b13f | ||
|
|
50098b3aed | ||
|
|
e3f1705065 | ||
|
|
25d526ade5 | ||
|
|
9c0d66c9f2 | ||
|
|
db216a56bf | ||
|
|
8a46597820 | ||
|
|
75572eb1b9 | ||
|
|
f930d39a42 | ||
|
|
13828994fb | ||
|
|
68d48d9889 | ||
|
|
37d8938e91 | ||
|
|
5333c7ff4a | ||
|
|
4d3fe0fd73 | ||
|
|
61650a22fd | ||
|
|
7a6d6070dc | ||
|
|
51116b933d | ||
|
|
4263b2843a | ||
|
|
fd871d6c8f | ||
|
|
1776ac2344 | ||
|
|
b0b80dda6f | ||
|
|
b5dd79287a | ||
|
|
d4fb368dab | ||
|
|
53e6391c54 | ||
|
|
805a101978 | ||
|
|
837fb40732 | ||
|
|
668f74ffc0 | ||
|
|
d3a4b3e53d | ||
|
|
087f1d38f5 | ||
|
|
6e1fbbaddc | ||
|
|
17b63e56ca | ||
|
|
4841d8026f | ||
|
|
942bc9e523 | ||
|
|
08fec1a8c5 | ||
|
|
41cfac1ec4 | ||
|
|
4d75c9ad05 | ||
|
|
96f72c0bb8 | ||
|
|
a3755ff308 | ||
|
|
87b238e6de | ||
|
|
7db4d1a3f4 | ||
|
|
7b34f064d0 | ||
|
|
36dce22071 | ||
|
|
fa69717bed | ||
|
|
174d3f7447 | ||
|
|
b6a44fe810 | ||
|
|
b9c5a4d5ba | ||
|
|
b67b3863ba | ||
|
|
1947c30d3d | ||
|
|
9d3fa377df | ||
|
|
9603f8e38a | ||
|
|
cb95284d0c | ||
|
|
00b926db29 | ||
|
|
cf009a4628 | ||
|
|
e456964be4 | ||
|
|
8418da422c | ||
|
|
0f0fbb7b0d | ||
|
|
8a7cb7fb24 | ||
|
|
ca468b9407 | ||
|
|
7eac426e31 | ||
|
|
e33a562c04 | ||
|
|
dbfa741a06 | ||
|
|
f1aecd3939 | ||
|
|
e8a9eb775e | ||
|
|
a4d71bb150 | ||
|
|
3def146e90 | ||
|
|
906f9cb89d | ||
|
|
cbe6354d2d | ||
|
|
931c3147f8 | ||
|
|
f02cc7942d | ||
|
|
75aeba31c6 | ||
|
|
ff0474a483 | ||
|
|
7e18d51550 | ||
|
|
ba4680d510 | ||
|
|
c83bbd6a58 | ||
|
|
79ce5261a5 | ||
|
|
9fdda882e5 | ||
|
|
55e07205e3 | ||
|
|
3ff4a7b8e4 | ||
|
|
f6c25921dc | ||
|
|
f38645d19f | ||
|
|
6134b150c1 | ||
|
|
e275c4692e | ||
|
|
fdd4968ba9 | ||
|
|
02993eaa9b | ||
|
|
7e44b955d7 | ||
|
|
1855bf1bd4 | ||
|
|
adc6a6579f |
No files matched your search
@@ -0,0 +1,90 @@
|
||||
---
|
||||
Language: Cpp
|
||||
Standard: c++17
|
||||
|
||||
AccessModifierOffset: -4
|
||||
AlignAfterOpenBracket: BlockIndent
|
||||
AlignArrayOfStructures: Left
|
||||
AlignConsecutiveAssignments: Consecutive
|
||||
AlignConsecutiveBitFields: Consecutive
|
||||
AlignConsecutiveDeclarations: Consecutive
|
||||
AlignConsecutiveMacros:
|
||||
Enabled: true
|
||||
AcrossEmptyLines: true
|
||||
AcrossComments: false
|
||||
AlignEscapedNewlines: Left
|
||||
AlignOperands: AlignAfterOperator
|
||||
AllowAllArgumentsOnNextLine: true
|
||||
AllowAllParametersOfDeclarationOnNextLine: true
|
||||
AllowShortBlocksOnASingleLine: Empty
|
||||
AllowShortCaseLabelsOnASingleLine: false
|
||||
AllowShortEnumsOnASingleLine: false
|
||||
AllowShortFunctionsOnASingleLine: Inline
|
||||
AllowShortIfStatementsOnASingleLine: Never
|
||||
AllowShortLambdasOnASingleLine: Inline
|
||||
AllowShortLoopsOnASingleLine: false
|
||||
AlwaysBreakAfterReturnType: None
|
||||
AlwaysBreakBeforeMultilineStrings: True
|
||||
AlwaysBreakTemplateDeclarations: Yes
|
||||
BinPackArguments: false
|
||||
BinPackParameters: false
|
||||
BitFieldColonSpacing: Both
|
||||
BraceWrapping:
|
||||
AfterClass: true
|
||||
AfterEnum: false
|
||||
AfterExternBlock: false
|
||||
AfterFunction: true
|
||||
AfterNamespace: true
|
||||
AfterStruct: false
|
||||
AfterUnion: false
|
||||
BeforeCatch: false
|
||||
BeforeElse: false
|
||||
BeforeLambdaBody: true
|
||||
BeforeWhile: false
|
||||
IndentBraces: false
|
||||
SplitEmptyFunction: false
|
||||
SplitEmptyNamespace: false
|
||||
SplitEmptyRecord: false
|
||||
BreakArrays: true
|
||||
BreakBeforeBinaryOperators: NonAssignment
|
||||
BreakBeforeBraces: Custom
|
||||
BreakBeforeConceptDeclarations: Always
|
||||
BreakBeforeTernaryOperators: true
|
||||
BreakConstructorInitializers: BeforeComma
|
||||
BreakInheritanceList: BeforeComma
|
||||
ColumnLimit: 120
|
||||
CompactNamespaces: false
|
||||
Cpp11BracedListStyle: true
|
||||
EmptyLineBeforeAccessModifier: Always
|
||||
IndentAccessModifiers: false
|
||||
IndentCaseBlocks: true
|
||||
IndentCaseLabels: false
|
||||
IndentExternBlock: Indent
|
||||
IndentGotoLabels: true
|
||||
IndentPPDirectives: AfterHash
|
||||
IndentRequiresClause: true
|
||||
IndentWidth: 4
|
||||
InsertBraces: true
|
||||
KeepEmptyLinesAtTheStartOfBlocks: false
|
||||
LambdaBodyIndentation: Signature
|
||||
LineEnding: LF
|
||||
MaxEmptyLinesToKeep: 1
|
||||
NamespaceIndentation: All
|
||||
PackConstructorInitializers: Never
|
||||
PointerAlignment: Right
|
||||
QualifierAlignment: Left
|
||||
ReferenceAlignment: Left
|
||||
ReflowComments: false
|
||||
RequiresClausePosition: WithFollowing
|
||||
SeparateDefinitionBlocks: Always
|
||||
SortIncludes: false
|
||||
SortUsingDeclarations: Lexicographic
|
||||
SpaceAfterCStyleCast: false
|
||||
SpaceAfterLogicalNot: false
|
||||
SpaceAfterTemplateKeyword: false
|
||||
SpaceBeforeAssignmentOperators: true
|
||||
SpaceBeforeCaseColon: false
|
||||
SpaceBeforeCpp11BracedList: true
|
||||
SpaceBeforeParens: ControlStatements
|
||||
SpacesInAngles: Never
|
||||
UseTab: Never
|
||||
@@ -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.
|
||||
@@ -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"
|
||||
@@ -1,222 +0,0 @@
|
||||
name: Build
|
||||
|
||||
on:
|
||||
push:
|
||||
branches: [ "main" ]
|
||||
pull_request:
|
||||
branches: [ "main" ]
|
||||
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
|
||||
|
||||
# container:
|
||||
# image: ubuntu:22.04
|
||||
# volumes:
|
||||
# - ${{github.workspace}}:${{github.workspace}}
|
||||
#
|
||||
# steps:
|
||||
# - name: Install required packages
|
||||
# run: apt update && apt install -y clang-15 cmake ninja-build flex bison git
|
||||
#
|
||||
# - name: Install required cross-platform packages (${{ matrix.architecture.triple }})
|
||||
# if: matrix.architecture.name != 'amd64'
|
||||
# run: apt install -y gcc-12-${{ matrix.architecture.triple }} g++-12-${{ matrix.architecture.triple }}
|
||||
|
||||
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 }}
|
||||
|
||||
- name: Install dependencies
|
||||
working-directory: ${{github.workspace}}
|
||||
run: |
|
||||
echo Using triple: ${{ matrix.architecture.triple }}
|
||||
mkdir -p thirdparties && cd thirdparties
|
||||
git clone --depth 1 --single-branch --branch SDL2 https://github.com/libsdl-org/SDL.git
|
||||
cmake -B SDL-build \
|
||||
-DCMAKE_C_COMPILER=clang \
|
||||
-DCMAKE_CXX_COMPILER=clang++ \
|
||||
-DCMAKE_C_FLAGS=--target=${{ matrix.architecture.triple }} \
|
||||
-DCMAKE_CXX_FLAGS=--target=${{ matrix.architecture.triple }} \
|
||||
-DCMAKE_INSTALL_PREFIX='${{github.workspace}}/thirdparties/SDL-install' \
|
||||
./SDL
|
||||
cmake --build SDL-build --config Release
|
||||
cmake --install SDL-build
|
||||
|
||||
- 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 }} \
|
||||
-DSDL2_DIR='${{github.workspace}}/thirdparties/SDL-install/lib/cmake/SDL2' \
|
||||
-DWITH_CLIENT=1" >> $GITHUB_ENV
|
||||
|
||||
- name: Configure CMake
|
||||
working-directory: ${{github.workspace}}
|
||||
run: |
|
||||
cmake -B ./build ${{ env.CMAKE_PARAM }} -DTARGET_GAME_TYPE=0 ./source
|
||||
cmake -B ./buildtt ${{ env.CMAKE_PARAM }} -DTARGET_GAME_TYPE=2 ./source
|
||||
|
||||
- name: Build
|
||||
working-directory: ${{github.workspace}}
|
||||
run: |
|
||||
cmake --build ${{github.workspace}}/build --config ${{env.BUILD_TYPE}}
|
||||
cmake --build ${{github.workspace}}/buildtt --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}}
|
||||
cd "${{github.workspace}}/buildtt"
|
||||
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}}
|
||||
cmake --install ${{github.workspace}}/buildtt --config ${{env.BUILD_TYPE}}
|
||||
cp '${{github.workspace}}/thirdparties/SDL-install/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
|
||||
|
||||
- name: Install required packages
|
||||
working-directory: ${{github.workspace}}
|
||||
run: |
|
||||
mkdir thirdparties && cd thirdparties
|
||||
git clone --depth 1 --single-branch --branch SDL2 https://github.com/libsdl-org/SDL.git
|
||||
cmake -B SDL-build -A ${{ matrix.architecture.config }} -DCMAKE_INSTALL_PREFIX='${{github.workspace}}/thirdparties/SDL-install' ./SDL
|
||||
cmake --build SDL-build --config Release --parallel
|
||||
cmake --install SDL-build
|
||||
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' `
|
||||
-DCMAKE_C_COMPILER=clang `
|
||||
-DCMAKE_CXX_COMPILER=clang++ `
|
||||
-DGIT_REVISION_BUILD_NUMBER=${{ github.run_number }} `
|
||||
-DSDL2_DIR='${{github.workspace}}/thirdparties/SDL-install/cmake' `
|
||||
-DBISON_EXECUTABLE='${{github.workspace}}/thirdparties/winflexbison-install/win_bison.exe' `
|
||||
-DFLEX_EXECUTABLE='${{github.workspace}}/thirdparties/winflexbison-install/win_flex.exe' `
|
||||
-DWITH_CLIENT=1".Replace("`r", "").Replace("`n", "") >> $env:GITHUB_ENV
|
||||
|
||||
- name: Configure CMake
|
||||
working-directory: ${{github.workspace}}
|
||||
run: |
|
||||
cmake -B ./build ${{ env.CMAKE_PARAM }} -DTARGET_GAME_TYPE=0 ./source
|
||||
cmake -B ./buildtt ${{ env.CMAKE_PARAM }} -DTARGET_GAME_TYPE=2 ./source
|
||||
|
||||
- name: Build
|
||||
working-directory: ${{github.workspace}}
|
||||
run: |
|
||||
cmake --build ${{github.workspace}}/build --config ${{env.BUILD_TYPE}}
|
||||
cmake --build ${{github.workspace}}/buildtt --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}}
|
||||
cd "${{github.workspace}}/buildtt"
|
||||
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}}
|
||||
cmake --install ${{github.workspace}}/buildtt --config ${{env.BUILD_TYPE}}
|
||||
Copy-Item "${{github.workspace}}/thirdparties/SDL-install/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,11 +45,18 @@ jobs:
|
||||
|
||||
steps:
|
||||
- name: Checkout repository
|
||||
uses: actions/checkout@v3
|
||||
uses: actions/checkout@v4
|
||||
|
||||
# Setup SDL
|
||||
- name: Set up SDL
|
||||
id: sdl
|
||||
uses: libsdl-org/setup-sdl@main
|
||||
with:
|
||||
version: sdl2-latest
|
||||
|
||||
# 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.
|
||||
@@ -59,7 +70,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
|
||||
@@ -72,6 +83,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}}"
|
||||
@@ -0,0 +1,477 @@
|
||||
name: Shared 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:
|
||||
##########################
|
||||
#
|
||||
# Linux
|
||||
# Ubuntu 22.04
|
||||
#
|
||||
# Using this version instead of 24.04 to use a lower GLIBC version (2.34)
|
||||
##########################
|
||||
build-platform-linux:
|
||||
strategy:
|
||||
matrix:
|
||||
architecture: [
|
||||
{name: 'amd64', triple: 'x86_64-linux-gnu'},
|
||||
{name: 'i686', triple: 'i686-linux-gnu'},
|
||||
{name: 'arm64', triple: 'aarch64-linux-gnu'},
|
||||
{name: 'armhf', triple: 'arm-linux-gnueabihf'},
|
||||
{name: 'powerpc', triple: 'powerpc-linux-gnu'},
|
||||
{name: 'ppc64', triple: 'powerpc64-linux-gnu'},
|
||||
{name: 'ppc64el', triple: 'powerpc64le-linux-gnu'}
|
||||
]
|
||||
|
||||
name: "Building for platform linux-${{matrix.architecture.name}}"
|
||||
runs-on: "ubuntu-22.04"
|
||||
environment: ${{ inputs.environment }}
|
||||
|
||||
steps:
|
||||
###
|
||||
# Packages
|
||||
###
|
||||
|
||||
- uses: awalsh128/cache-apt-pkgs-action@latest
|
||||
name: Install required packages
|
||||
with:
|
||||
packages: flex bison ninja-build cmake clang libpulse-dev portaudio19-dev libasound2-dev libjack-dev libpipewire-0.3-dev qtbase5-dev libdbus-1-dev
|
||||
version: "0.1"
|
||||
|
||||
- uses: awalsh128/cache-apt-pkgs-action@latest
|
||||
name: Install required cross-platform packages (${{ matrix.architecture.triple }})
|
||||
if: matrix.architecture.name != 'amd64'
|
||||
with:
|
||||
packages: gcc-12-${{ matrix.architecture.triple }} g++-12-${{ matrix.architecture.triple }}
|
||||
version: "0.1"
|
||||
|
||||
- name: Settings
|
||||
working-directory: ${{github.workspace}}
|
||||
run: |
|
||||
echo "CMAKE_GENERATOR=Ninja Multi-Config" >> $GITHUB_ENV
|
||||
echo "CC=clang" >> $GITHUB_ENV
|
||||
echo "CXX=clang++" >> $GITHUB_ENV
|
||||
echo "CFLAGS='--target=${{ matrix.architecture.triple }}'" >> $GITHUB_ENV
|
||||
echo "CXXFLAGS='--target=${{ matrix.architecture.triple }}'" >> $GITHUB_ENV
|
||||
# Temporary workaround for PowerPC as the 1.24.0 version doesn't check for altivec
|
||||
# Will use older versions until a new tag is created with this issue resolved
|
||||
if [ ${{ matrix.architecture.name }} != 'powerpc' ] && [ ${{ matrix.architecture.name }} != 'ppc64' ] && [ ${{ matrix.architecture.name }} != 'ppc64el' ]; then
|
||||
echo "OPENAL_REF=1.24.0" >> $GITHUB_ENV
|
||||
else
|
||||
echo "OPENAL_REF=1.23.1" >> $GITHUB_ENV
|
||||
fi
|
||||
|
||||
###
|
||||
# SDL
|
||||
###
|
||||
|
||||
# Setup SDL
|
||||
- name: Set up SDL
|
||||
id: sdl
|
||||
uses: libsdl-org/setup-sdl@main
|
||||
with:
|
||||
version: 2-latest
|
||||
build-type: Release
|
||||
# Workaround for when changing the runner OS version
|
||||
cmake-arguments: "-DCACHE_OS_VERSION=Ubuntu_22.04"
|
||||
|
||||
###
|
||||
# OpenAL
|
||||
###
|
||||
|
||||
# soft-oal setup
|
||||
- name: Checkout soft-oal
|
||||
uses: actions/checkout@v4
|
||||
with:
|
||||
repository: 'kcat/openal-soft'
|
||||
path: 'thirdparties/soft-oal'
|
||||
ref: ${{ env.OPENAL_REF }}
|
||||
|
||||
- name: Configure and install soft-oal
|
||||
working-directory: ${{github.workspace}}/thirdparties/soft-oal
|
||||
run: |
|
||||
cmake -B ./build \
|
||||
-DCMAKE_INSTALL_PREFIX='${{github.workspace}}/thirdparties/soft-oal/install'
|
||||
cmake --build ./build --config Release --parallel
|
||||
cmake --install ./build --config Release
|
||||
|
||||
###
|
||||
# Project
|
||||
###
|
||||
|
||||
- uses: actions/checkout@v4
|
||||
with:
|
||||
path: 'source'
|
||||
|
||||
- name: CMake Settings
|
||||
run: |
|
||||
echo "CMAKE_PARAM=--log-level=VERBOSE \
|
||||
-DCMAKE_INSTALL_PREFIX='${{github.workspace}}/install' \
|
||||
-DOPENAL_LIBRARY='${{github.workspace}}/thirdparties/soft-oal' \
|
||||
-DOPENAL_INCLUDE_DIR='${{github.workspace}}/thirdparties/soft-oal/include' \
|
||||
-DGIT_REVISION_BUILD_NUMBER=${{ github.run_number }} \
|
||||
-DPRODUCT_VERSION_STAGE='${{ env.RELEASE_STAGE }}'" >> $GITHUB_ENV
|
||||
|
||||
- name: Configure CMake
|
||||
working-directory: ${{github.workspace}}
|
||||
run: |
|
||||
cmake -B ./build ${{ env.CMAKE_PARAM }} ./source
|
||||
|
||||
- name: Build
|
||||
working-directory: ${{github.workspace}}
|
||||
run: |
|
||||
cmake --build ${{github.workspace}}/build --config ${{env.BUILD_TYPE}} --parallel
|
||||
|
||||
- name: Test
|
||||
working-directory: ${{github.workspace}}
|
||||
# Execute tests defined by the CMake configuration.
|
||||
# See https://cmake.org/cmake/help/latest/manual/ctest.1.html for more detail
|
||||
run: |
|
||||
cd "${{github.workspace}}/build"
|
||||
ctest -C ${{env.BUILD_TYPE}}
|
||||
|
||||
- name: Install
|
||||
working-directory: ${{github.workspace}}
|
||||
# Install to the directory defined in CMAKE_INSTALL_PREFIX
|
||||
run: |
|
||||
cmake --install ${{github.workspace}}/build --config ${{env.BUILD_TYPE}}
|
||||
# Copy libraries
|
||||
mkdir ${{github.workspace}}/package
|
||||
cp -l ${{steps.sdl.outputs.prefix}}/lib/libSDL2-2.0.so.0 '${{github.workspace}}/package/'
|
||||
cp -l ${{github.workspace}}/thirdparties/soft-oal/install/lib/libopenal.so.1 '${{github.workspace}}/package/'
|
||||
if [ -d ${{github.workspace}}/install/bin ]; then cp -r ${{github.workspace}}/install/bin/openmohaa/. '${{github.workspace}}/package'; fi
|
||||
if [ -d ${{github.workspace}}/install/lib ]; then cp -r ${{github.workspace}}/install/lib/openmohaa/. '${{github.workspace}}/package'; fi
|
||||
|
||||
###
|
||||
# Artifacts
|
||||
###
|
||||
|
||||
- uses: actions/upload-artifact@v4
|
||||
with:
|
||||
name: out-linux-${{matrix.architecture.name}}
|
||||
if-no-files-found: error
|
||||
path:
|
||||
${{github.workspace}}/package
|
||||
|
||||
##########################
|
||||
#
|
||||
# Microsoft Windows
|
||||
# Windows Server 2022
|
||||
#
|
||||
##########################
|
||||
build-platform-windows:
|
||||
strategy:
|
||||
matrix:
|
||||
architecture: [
|
||||
{name: 'x64', config: 'x64', toolset: 'x64' },
|
||||
{name: 'x86', config: 'Win32', toolset: 'x64_x86' },
|
||||
{name: 'arm64', config: 'ARM64', toolset: 'x64_arm64' }
|
||||
]
|
||||
|
||||
name: "Building for platform windows-${{matrix.architecture.name}}"
|
||||
runs-on: "windows-2022"
|
||||
environment: ${{ inputs.environment }}
|
||||
|
||||
steps:
|
||||
###
|
||||
# Packages
|
||||
###
|
||||
|
||||
#
|
||||
# Commented out for now, chocolatey servers started complaining about too many requests
|
||||
#
|
||||
#- name: Install required packages
|
||||
# run: |
|
||||
# choco install -y ninja
|
||||
|
||||
- name: Install required packages
|
||||
run: |
|
||||
$DownloadPath="$($env:USERPROFILE)\Downloads"
|
||||
Invoke-WebRequest "https://github.com/ninja-build/ninja/releases/download/v1.12.1/ninja-win.zip" -OutFile "$DownloadPath\ninja-win.zip"
|
||||
Expand-Archive -Path "$DownloadPath\ninja-win.zip" -DestinationPath "$($env:PROGRAMFILES)\ninja"
|
||||
echo "$($env:PROGRAMFILES)\ninja" >> $GITHUB_PATH
|
||||
|
||||
- name: Install Flex/Bison
|
||||
working-directory: ${{github.workspace}}
|
||||
run: |
|
||||
mkdir thirdparties && cd thirdparties
|
||||
git clone --depth 1 --single-branch --branch v2.5.25 https://github.com/lexxmark/winflexbison.git
|
||||
cmake -B winflexbison-build -DCMAKE_INSTALL_PREFIX='${{github.workspace}}/thirdparties/winflexbison-install' ./winflexbison
|
||||
cmake --build winflexbison-build --config Release --parallel
|
||||
cmake --install winflexbison-build --config Release
|
||||
|
||||
- name: Settings
|
||||
working-directory: ${{github.workspace}}
|
||||
run: |
|
||||
echo "CMAKE_GENERATOR=Ninja Multi-Config" >> $env:GITHUB_ENV
|
||||
echo "CC=cl.exe" >> $env:GITHUB_ENV
|
||||
echo "CXX=cl.exe" >> $env:GITHUB_ENV
|
||||
pushd "$($env:PROGRAMFILES)\Microsoft Visual Studio\*\*\VC\Auxiliary\Build"
|
||||
cmd /c "vcvarsall.bat ${{ matrix.architecture.toolset }} & set" | ForEach-Object {
|
||||
if ($_ -match "=") {
|
||||
# Split into key=value
|
||||
$var = $_.split("=", 2);
|
||||
echo "$($var[0])=$($var[1])" >> $env:GITHUB_ENV
|
||||
}
|
||||
}
|
||||
popd
|
||||
|
||||
###
|
||||
# SDL
|
||||
###
|
||||
|
||||
# Setup SDL
|
||||
- name: Set up SDL
|
||||
id: sdl
|
||||
uses: libsdl-org/setup-sdl@main
|
||||
with:
|
||||
version: 2-latest
|
||||
build-type: Release
|
||||
cmake-arguments: ""
|
||||
|
||||
###
|
||||
# OpenAL
|
||||
###
|
||||
|
||||
# soft-oal setup
|
||||
- name: Checkout soft-oal
|
||||
uses: actions/checkout@v4
|
||||
with:
|
||||
repository: 'kcat/openal-soft'
|
||||
path: 'thirdparties/soft-oal'
|
||||
ref: '1.24.0'
|
||||
|
||||
# soft-oal build
|
||||
# Statically link the CRT runtime into OAL as a workaround to prevent crashes
|
||||
- name: Configure and install soft-oal
|
||||
working-directory: ${{github.workspace}}/thirdparties/soft-oal
|
||||
run: |
|
||||
cmake -B ./build `
|
||||
-DCMAKE_INSTALL_PREFIX='${{github.workspace}}/thirdparties/soft-oal/install' `
|
||||
-DALSOFT_BUILD_ROUTER=OFF `
|
||||
-DALSOFT_REQUIRE_WINMM=ON `
|
||||
-DALSOFT_REQUIRE_DSOUND=ON `
|
||||
-DALSOFT_REQUIRE_WASAPI=ON `
|
||||
-DCMAKE_C_FLAGS_RELEASE="/MT /O2 /Ob2 /DNDEBUG" `
|
||||
-DCMAKE_CXX_FLAGS_RELEASE="/MT /O2 /Ob2 /DNDEBUG" `
|
||||
-DCMAKE_C_FLAGS_MINSIZEREL="/MT /O2 /Ob2 /DNDEBUG" `
|
||||
-DCMAKE_CXX_FLAGS_MINSIZEREL="/MT /O1 /Ob1 /DNDEBUG" `
|
||||
-DCMAKE_C_FLAGS_RELWITHDEBINFO="/MT /Zi /O2 /Ob1 /DNDEBUG" `
|
||||
-DCMAKE_CXX_FLAGS_RELWITHDEBINFO="/MT /Zi /O2 /Ob1 /DNDEBUG"
|
||||
cmake --build ./build --config Release --parallel
|
||||
cmake --install ./build --config Release
|
||||
# Unfortunately soft-oal produces a binary called OpenAL32 even in 64-bit
|
||||
if (("x64", "ARM64") -icontains "${{ matrix.architecture.config }}") { Rename-Item -Path '.\install\bin\OpenAL32.dll' -NewName 'OpenAL64.dll' }
|
||||
|
||||
###
|
||||
# Project
|
||||
###
|
||||
|
||||
- uses: actions/checkout@v4
|
||||
with:
|
||||
path: 'source'
|
||||
|
||||
- name: CMake Settings
|
||||
run: |
|
||||
echo "CMAKE_PARAM= `
|
||||
--log-level=VERBOSE `
|
||||
-DCMAKE_INSTALL_PREFIX='${{github.workspace}}/install' `
|
||||
-DGIT_REVISION_BUILD_NUMBER=${{ github.run_number }} `
|
||||
-DBISON_EXECUTABLE='${{github.workspace}}/thirdparties/winflexbison-install/win_bison.exe' `
|
||||
-DOPENAL_LIBRARY='${{github.workspace}}/thirdparties/soft-oal' `
|
||||
-DOPENAL_INCLUDE_DIR='${{github.workspace}}/thirdparties/soft-oal/include' `
|
||||
-DFLEX_EXECUTABLE='${{github.workspace}}/thirdparties/winflexbison-install/win_flex.exe' `
|
||||
-DPRODUCT_VERSION_STAGE='${{ env.RELEASE_STAGE }}'".Replace("`r", "").Replace("`n", "") >> $env:GITHUB_ENV
|
||||
|
||||
- name: Configure CMake
|
||||
working-directory: ${{github.workspace}}
|
||||
run: |
|
||||
cmake -B ./build ${{ env.CMAKE_PARAM }} ./source
|
||||
|
||||
- name: Build
|
||||
working-directory: ${{github.workspace}}
|
||||
run: |
|
||||
cmake --build ${{github.workspace}}/build --config ${{env.BUILD_TYPE}} --parallel
|
||||
|
||||
- name: Test
|
||||
working-directory: ${{github.workspace}}
|
||||
# Execute tests defined by the CMake configuration.
|
||||
# See https://cmake.org/cmake/help/latest/manual/ctest.1.html for more detail
|
||||
run: |
|
||||
cd "${{github.workspace}}/build"
|
||||
ctest -C ${{env.BUILD_TYPE}}
|
||||
|
||||
- name: Install
|
||||
working-directory: ${{github.workspace}}
|
||||
# Install to the directory defined in CMAKE_INSTALL_PREFIX
|
||||
run: |
|
||||
cmake --install ${{github.workspace}}/build --config ${{env.BUILD_TYPE}}
|
||||
New-Item -ItemType Directory '${{github.workspace}}/package'
|
||||
Copy-Item '${{steps.sdl.outputs.prefix}}/bin/*.dll' -Destination '${{github.workspace}}/package'
|
||||
Copy-Item '${{github.workspace}}/thirdparties/soft-oal/install/bin/*.dll' -Destination '${{github.workspace}}/package'
|
||||
if (Test-Path ${{github.workspace}}/install/bin) { Copy-Item '${{github.workspace}}/install/bin/*' -Include '*.dll','*.exe','*.pdb' -Destination '${{github.workspace}}/package' }
|
||||
if (Test-Path ${{github.workspace}}/install/lib) { Copy-Item '${{github.workspace}}/install/lib/*' -Include '*.dll','*.exe','*.pdb' -Destination '${{github.workspace}}/package' }
|
||||
|
||||
###
|
||||
# Artifact
|
||||
###
|
||||
|
||||
- uses: actions/upload-artifact@v4
|
||||
with:
|
||||
name: out-windows-${{matrix.architecture.name}}
|
||||
if-no-files-found: error
|
||||
path: |
|
||||
${{github.workspace}}/package
|
||||
!${{github.workspace}}/package/**/*.pdb
|
||||
|
||||
- uses: actions/upload-artifact@v4
|
||||
with:
|
||||
name: out-windows-${{matrix.architecture.name}}-pdb
|
||||
if-no-files-found: error
|
||||
path: |
|
||||
${{github.workspace}}/package
|
||||
|
||||
##########################
|
||||
#
|
||||
# Apple macOS
|
||||
# macOS 14
|
||||
#
|
||||
# This version is used as the OS, as older versions are slower.
|
||||
##########################
|
||||
build-platform-macos:
|
||||
strategy:
|
||||
matrix:
|
||||
architecture: [
|
||||
{name: 'x86_64', triple: 'x86_64-apple-macos10.8'},
|
||||
{name: 'arm64', triple: 'arm64-apple-macos11'}
|
||||
]
|
||||
|
||||
name: "Building for platform macos-${{matrix.architecture.name}}"
|
||||
runs-on: "macos-14"
|
||||
environment: ${{inputs.environment}}
|
||||
|
||||
steps:
|
||||
###
|
||||
# Packages
|
||||
###
|
||||
|
||||
# Install required packages
|
||||
# Paths on x86_64 and ARM64 are different for homebrew
|
||||
- name: Install required packages
|
||||
run: |
|
||||
brew update && brew install git flex bison ninja cmake llvm ninja
|
||||
|
||||
- name: Settings
|
||||
working-directory: ${{github.workspace}}
|
||||
run: |
|
||||
echo "CMAKE_GENERATOR=Ninja Multi-Config" >> $GITHUB_ENV
|
||||
echo "CC=clang" >> $GITHUB_ENV
|
||||
echo "CXX=clang++" >> $GITHUB_ENV
|
||||
echo "MACOSX_DEPLOYMENT_TARGET=10.15" >> $GITHUB_ENV
|
||||
|
||||
###
|
||||
# SDL
|
||||
###
|
||||
|
||||
# Setup SDL
|
||||
- name: Set up SDL
|
||||
id: sdl
|
||||
uses: libsdl-org/setup-sdl@main
|
||||
with:
|
||||
version: 2-latest
|
||||
build-type: Release
|
||||
cmake-arguments: "-DCMAKE_OSX_ARCHITECTURES=${{ matrix.architecture.name }}
|
||||
-DCMAKE_VERBOSE_MAKEFILE=on"
|
||||
###
|
||||
# OpenAL
|
||||
###
|
||||
|
||||
# soft-oal setup
|
||||
# Use GCC instead of Clang because of missing SSE intrinsics
|
||||
# It also doesn't enable altivec support on PowerPC by default
|
||||
- name: Checkout soft-oal
|
||||
uses: actions/checkout@v4
|
||||
with:
|
||||
repository: 'kcat/openal-soft'
|
||||
path: 'thirdparties/soft-oal'
|
||||
ref: '1.24.0'
|
||||
|
||||
- name: Configure and install soft-oal
|
||||
working-directory: ${{github.workspace}}/thirdparties/soft-oal
|
||||
run: |
|
||||
cmake -B ./build \
|
||||
-DCMAKE_INSTALL_PREFIX='${{github.workspace}}/thirdparties/soft-oal/install' \
|
||||
-DCMAKE_OSX_ARCHITECTURES=${{ matrix.architecture.name }} \
|
||||
-DCMAKE_VERBOSE_MAKEFILE=on
|
||||
cmake --build ./build --config Release --parallel
|
||||
cmake --install ./build --config Release
|
||||
|
||||
###
|
||||
# Project
|
||||
###
|
||||
|
||||
- uses: actions/checkout@v4
|
||||
with:
|
||||
path: 'source'
|
||||
|
||||
- name: CMake Settings
|
||||
run: |
|
||||
echo "CMAKE_PARAM=--log-level=VERBOSE \
|
||||
-DCMAKE_INSTALL_PREFIX='${{github.workspace}}/install' \
|
||||
-DCMAKE_VERBOSE_MAKEFILE=on \
|
||||
-DCMAKE_OSX_ARCHITECTURES=${{ matrix.architecture.name }} \
|
||||
-DOPENAL_LIBRARY='${{github.workspace}}/thirdparties/soft-oal/install' \
|
||||
-DOPENAL_INCLUDE_DIR='${{github.workspace}}/thirdparties/soft-oal/install/include/AL' \
|
||||
-DGIT_REVISION_BUILD_NUMBER=${{ github.run_number }} \
|
||||
-DPRODUCT_VERSION_STAGE='${{ env.RELEASE_STAGE }}'" >> $GITHUB_ENV
|
||||
|
||||
- name: Configure CMake
|
||||
working-directory: ${{github.workspace}}
|
||||
run: |
|
||||
cmake -B ./build ${{ env.CMAKE_PARAM }} ./source
|
||||
|
||||
- name: Build
|
||||
working-directory: ${{github.workspace}}
|
||||
run: |
|
||||
cmake --build ${{github.workspace}}/build --config ${{env.BUILD_TYPE}} --parallel
|
||||
|
||||
- name: Test
|
||||
working-directory: ${{github.workspace}}
|
||||
# Execute tests defined by the CMake configuration.
|
||||
# See https://cmake.org/cmake/help/latest/manual/ctest.1.html for more detail
|
||||
run: |
|
||||
cd "${{github.workspace}}/build"
|
||||
ctest -C ${{env.BUILD_TYPE}}
|
||||
|
||||
- name: Install
|
||||
working-directory: ${{github.workspace}}
|
||||
# Install to the directory defined in CMAKE_INSTALL_PREFIX
|
||||
run: |
|
||||
cmake --install ${{github.workspace}}/build --config ${{env.BUILD_TYPE}}
|
||||
# Create hard-link and copy symbolic links
|
||||
mkdir ${{github.workspace}}/package
|
||||
cp -l ${{steps.sdl.outputs.prefix}}/lib/libSDL2-2.0.0.dylib '${{github.workspace}}/package/'
|
||||
cp -l ${{github.workspace}}/thirdparties/soft-oal/install/lib/libopenal.1.dylib '${{github.workspace}}/package/'
|
||||
if [ -d ${{github.workspace}}/install/bin ]; then cp -r ${{github.workspace}}/install/bin/openmohaa/. '${{github.workspace}}/package'; fi
|
||||
if [ -d ${{github.workspace}}/install/lib ]; then cp -r ${{github.workspace}}/install/lib/openmohaa/. '${{github.workspace}}/package'; fi
|
||||
|
||||
###
|
||||
# Artifacts
|
||||
###
|
||||
|
||||
- uses: actions/upload-artifact@v4
|
||||
with:
|
||||
name: out-macos-${{matrix.architecture.name}}
|
||||
if-no-files-found: error
|
||||
path:
|
||||
${{github.workspace}}/package
|
||||
+20
-10
@@ -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,33 +14,43 @@ permissions:
|
||||
|
||||
jobs:
|
||||
build-all:
|
||||
uses: ./.github/workflows/build-cmake.yml
|
||||
uses: ./.github/workflows/shared-build.yml
|
||||
with:
|
||||
environment: "release"
|
||||
|
||||
deploy_all:
|
||||
strategy:
|
||||
# Set the maximum number of parallel jobs to 1, to avoid a race-condition
|
||||
# while creating a new release
|
||||
max-parallel: 1
|
||||
matrix:
|
||||
target_os: [
|
||||
'linux-amd64',
|
||||
'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'
|
||||
]
|
||||
|
||||
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}}
|
||||
@@ -50,8 +60,8 @@ jobs:
|
||||
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
|
||||
+4
-1
@@ -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/*
|
||||
@@ -1,13 +0,0 @@
|
||||
=== Patch 1.12 ===
|
||||
|
||||
>>> Client :
|
||||
- Added GFX features such as bloom, SSAO & FXAA
|
||||
- Added support of .vision files
|
||||
- Added support of custom weapons and view model animations
|
||||
|
||||
>>> Game :
|
||||
- Added more scripting functions
|
||||
- Lot more..
|
||||
|
||||
|
||||
THIS CHANGELOG IS NOT COMPLETED YET.
|
||||
+172
-44
@@ -5,39 +5,72 @@ include(TargetArch.cmake)
|
||||
|
||||
target_architecture(TARGET_ARCH)
|
||||
|
||||
if(TARGET_GAME_TYPE)
|
||||
if(TARGET_GAME_TYPE EQUAL 1)
|
||||
# Build for Team Assault (Spearhead)
|
||||
set(TARGET_BASE_SUFFIX "ta")
|
||||
elseif(TARGET_GAME_TYPE EQUAL 2)
|
||||
# Build for Team Tactics (Breakthrough)
|
||||
set(TARGET_BASE_SUFFIX "tt")
|
||||
else()
|
||||
set(TARGET_BASE_SUFFIX)
|
||||
message(SEND_ERROR "Invalid game type. Game type can be 0, 1 or 2")
|
||||
endif()
|
||||
else()
|
||||
set(TARGET_BASE_SUFFIX)
|
||||
set(TARGET_GAME_TYPE 0)
|
||||
set(USE_INTERNAL_LIBS ON)
|
||||
if(USE_SYSTEM_LIBS)
|
||||
set(USE_INTERNAL_LIBS OFF)
|
||||
endif()
|
||||
|
||||
set(TARGET_BASE_GAME "main${TARGET_BASE_SUFFIX}")
|
||||
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})
|
||||
|
||||
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
|
||||
# which will cause undefined behavior and crashes due to memory corruption
|
||||
add_compile_options(-fno-gnu-unique)
|
||||
endif()
|
||||
|
||||
if(DEBUG_MEMORY)
|
||||
add_definitions(-D_DEBUG_MEM)
|
||||
endif()
|
||||
|
||||
IF("${TARGET_ARCH}" STREQUAL "i386")
|
||||
set(TARGET_ARCH_SUFFIX "x86")
|
||||
ELSE()
|
||||
set(TARGET_ARCH_SUFFIX ${TARGET_ARCH})
|
||||
ENDIF()
|
||||
|
||||
message(STATUS "Architecture detected: ${TARGET_ARCH}, suffix set to ${TARGET_ARCH_SUFFIX}")
|
||||
set(TARGET_BIN_SUFFIX ".${TARGET_ARCH}")
|
||||
|
||||
message(STATUS "Architecture detected: ${TARGET_ARCH}, suffix set to ${TARGET_ARCH_SUFFIX}.")
|
||||
|
||||
IF(WIN32)
|
||||
set(TARGET_PLATFORM_PREFIX "")
|
||||
@@ -50,28 +83,68 @@ ELSE()
|
||||
ENDIF()
|
||||
|
||||
IF(CMAKE_BUILD_TYPE MATCHES Debug)
|
||||
set(TARGET_CONFIG_SUFFIX "-dbg")
|
||||
add_definitions(-D_DEBUG)
|
||||
add_compile_definitions(_DEBUG)
|
||||
|
||||
# NOTE: The following may mess up function importation
|
||||
#if(UNIX)
|
||||
# # Enable all exports so all functions name can be seen during executable crash
|
||||
# set(CMAKE_ENABLE_EXPORTS ON)
|
||||
# message(STATUS "Enabling exports on Unix for backtrace")
|
||||
#endif()
|
||||
ELSE()
|
||||
set(TARGET_CONFIG_SUFFIX "")
|
||||
# Non-debug builds
|
||||
add_compile_definitions(NDEBUG)
|
||||
ENDIF()
|
||||
|
||||
# Common stuff
|
||||
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)
|
||||
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")
|
||||
@@ -81,23 +154,27 @@ target_compile_features(omohaaded PUBLIC c_variadic_macros)
|
||||
target_link_libraries(omohaaded PRIVATE omohserver)
|
||||
target_link_libraries(omohaaded PRIVATE syslib)
|
||||
target_link_libraries(omohaaded PRIVATE qcommon qcommon_standalone)
|
||||
# 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}${TARGET_CONFIG_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 (WITH_CLIENT)
|
||||
if (NOT BUILD_NO_CLIENT)
|
||||
##
|
||||
## Client app
|
||||
##
|
||||
|
||||
add_subdirectory("code/client")
|
||||
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")
|
||||
@@ -110,26 +187,77 @@ if (WITH_CLIENT)
|
||||
target_link_libraries(openmohaa PRIVATE omohclient)
|
||||
target_link_libraries(openmohaa PRIVATE omohrenderer omohsdl)
|
||||
target_link_libraries(openmohaa PRIVATE qcommon qcommon_standalone)
|
||||
|
||||
# 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})
|
||||
|
||||
### 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}${TARGET_CONFIG_SUFFIX}")
|
||||
|
||||
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()
|
||||
if(USE_INTERNAL_JPEG)
|
||||
target_include_directories(openmohaa PUBLIC "code/jpeg-8c")
|
||||
target_link_libraries(openmohaa PRIVATE jpeg8)
|
||||
else()
|
||||
find_package(JPEG REQUIRED)
|
||||
target_include_directories(openmohaa PUBLIC ${JPEG_INCLUDE_DIRS})
|
||||
target_link_libraries(openmohaa PRIVATE ${JPEG_LIBRARIES})
|
||||
endif()
|
||||
|
||||
INSTALL(TARGETS openmohaa DESTINATION ${CMAKE_INSTALL_BINDIR}/${BIN_INSTALL_SUBDIR})
|
||||
|
||||
if (MSVC)
|
||||
target_link_options(openmohaa PRIVATE "/MANIFEST:NO")
|
||||
INSTALL(FILES $<TARGET_PDB_FILE:openmohaa> DESTINATION "./" 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()
|
||||
|
||||
@@ -1,111 +1,55 @@
|
||||
# OpenMoHAA
|
||||
|
||||
/ _ \ _ __ ___ _ __ | \/ |/ _ \| | | | / \ / \
|
||||
| | | | '_ \ / _ \ '_ \| |\/| | | | | |_| | / _ \ / _ \
|
||||
| |_| | |_) | __/ | | | | | | |_| | _ |/ ___ \ / ___ \
|
||||
\___/| .__/ \___|_| |_|_| |_|\___/|_| |_/_/ \_\/_/ \_\
|
||||
|_|
|
||||
|
||||
[](https://github.com/openmoh/openmohaa/actions/workflows/branches-build.yml) [](https://github.com/openmoh/openmohaa/releases) [](https://github.com/openmoh/openmohaa/releases)
|
||||
|
||||
 
|
||||
|
||||
## Discord
|
||||

|
||||
|
||||
[](https://discord.gg/NYtH58R)
|
||||

|
||||
|
||||
## Current State
|
||||
## Intro
|
||||
|
||||
[](https://github.com/openmoh/openmohaa/actions/workflows/build-cmake.yml)
|
||||
The main goal of OpenMoHAA is to ensure the future and continuity of **Medal of Honor: Allied Assault** 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 the original game (in terms of protocol, assets, and scripts).
|
||||
|
||||
OpenMoHAA is still in its early days.
|
||||
## Getting started
|
||||
|
||||
### Server
|
||||
- [Downloading and installing OpenMoHAA](docs/getting_started_installation.md)
|
||||
- [Running OpenMoHAA and using expansion assets](docs/getting_started_running.md)
|
||||
- [Dedicated server configuration](docs/configuration/server.md)
|
||||
|
||||
The server version can successfully be built.
|
||||
Some stuff are not working as intended, such as Actor or Vehicle. These systems are both almost fully implemented, but not really in stable state.
|
||||
## Current state
|
||||
|
||||
Overall the server part and the game module are almost fully implemented, but the stability may vary, there may be some minor bugs and crashes.
|
||||
### Single-player
|
||||
|
||||
### Client
|
||||
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.
|
||||
|
||||
The client version of OpenMoHAA is partially implemented and not stable currently. The cgame module is partially implemented as well, but is compatible with the original MOH:AA game. Credits to **Heavy Metal: F.A.K.K. 2**'s SDK for the cgame module.
|
||||
### Multiplayer
|
||||
|
||||
Here is the current working state for each part of the engine:
|
||||
The Multiplayer part is almost fully stable.
|
||||
|
||||
| Part name | 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, vehicle, and few gameplay bugs |
|
||||
| UI | | | | x | | | Has core features only (menu, widgets, console, hud, urc loading) |
|
||||
Server admins can use OpenMoHAA to [host](docs/getting_started_installation.md#server) a mohaa/mohaas/mohaab server. Bugs must be reported by creating a new [issue](https://github.com/openmoh/openmohaa/issues) on the OpenMoHAA GitHub project. Players can use OpenMoHAA to [play](docs/getting_started_installation.md#client) on a mohaa/mohaas/mohaab server.
|
||||
|
||||
NOTE: Both client and server version can be compiled to target **Medal of Honor: Spearhead** and **Medal of Honor: Breakthrough**.
|
||||
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.
|
||||
|
||||
## Running
|
||||
## Features
|
||||
|
||||
Backup existing mohaa files, **cgamex86.dll** and **gamex86.dll** (set their extension to **.bak**)
|
||||
|
||||
a) extract archive to your MOHAA installation directory.
|
||||
|
||||
-or-
|
||||
|
||||
b) Copy all pak*.pk3 files and the sound/ directory from your **MOHAA/main** directory into openmohaa's 'main' directory.
|
||||
|
||||
If you have problems running the game :
|
||||
|
||||
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
|
||||
|
||||
You can now start a local OpenMOHAA server or play on a server.
|
||||
- [List of new features](docs/features.md)
|
||||
- [Scripting commands](https://htmlpreview.github.io/?https://github.com/openmoh/openmohaa/blob/main/docs/features_g_allclasses.html)
|
||||
|
||||
## Compiling
|
||||
|
||||
OpenMoHAA supports both x86 and x64 architectures, and although the target platform is Windows, it still can be compiled for other platforms, and even other architectures.
|
||||
|
||||
These are the tools required for all platforms :
|
||||
- CMake >= 3.5
|
||||
- Flex and Bison (currently not used)
|
||||
- A C++11 compiler is required.
|
||||
|
||||
The installation directory can be set to MOHAA directory.
|
||||
|
||||
The client build can be built by adding `-DWITH_CLIENT=1` to the CMake command line. This will compile the cgame module and the full app with rendering, ui and sound suppport, alongside the dedicated server version.
|
||||
|
||||
To compile for either Spearhead or Breakthrough, append `-DTARGET_GAME_TYPE=x` where x can be 1 for Team Assault (Spearhead), and 2 for Team Tactics (Breakthrough). 2 is recommended because Team Tactics can connect to both Spearhead and Breakthrough servers.
|
||||
|
||||
### Linux
|
||||
|
||||
These are the tools required on Unix :
|
||||
- Clang >= 3.3 or GCC >= 4.8.1
|
||||
|
||||
**clang-3.5** and **gcc-4.8.5** should work (tested on Ubuntu 16.04). Use the latest possible version of those compilers.
|
||||
|
||||
SDL2 library is required (libsdl2-dev).
|
||||
|
||||
1 line install command with latest clang version : `sudo apt-get install -y ninja-build cmake make clang-15 lld-15 flex bison libsdl2-dev`
|
||||
|
||||
Example with **CMake**, **clang-15** and **ninja-build** installed:
|
||||
```sh
|
||||
mkdir .cmake && cd .cmake
|
||||
cmake -DCMAKE_C_COMPILER=clang-15 -DCMAKE_CXX_COMPILER=clang++-15 -DWITH_CLIENT=1 -G Ninja
|
||||
```
|
||||
|
||||
### Windows
|
||||
|
||||
Visual Studio (2019 or 2022) is generally preferred.
|
||||
- See [Compiling OpenMoHAA](docs/compiling.md)
|
||||
|
||||
## Screenshots
|
||||
|
||||
| | |
|
||||
|---------------------------------------------------------------------|---------------------------------------------------------------------------|
|
||||
|  |  |
|
||||
|  |  |
|
||||
| | |
|
||||
|-----------------------------------------------------------------------------------|----------------------------------------------------------------------------|
|
||||
|  |  |
|
||||
|  |  |
|
||||
|  |  |
|
||||
|
||||
*More screenshots [here](docs/images)*
|
||||
|
||||
## Third party
|
||||
|
||||
@@ -113,20 +57,14 @@ Visual Studio (2019 or 2022) is generally preferred.
|
||||
|
||||
http://www.libsdl.org/
|
||||
|
||||
download Source code, compile
|
||||
|
||||
### OpenAL
|
||||
|
||||
https://www.openal.org/ download OpenAL soft source
|
||||
|
||||
run cmake on OpenAL, compile
|
||||
https://www.openal.org/
|
||||
|
||||
### LibMAD
|
||||
|
||||
http://www.underbit.com/products/mad/
|
||||
|
||||
download source code, compile
|
||||
|
||||
### cURL
|
||||
|
||||
https://curl.se/
|
||||
@@ -143,8 +81,14 @@ https://xiph.org/vorbis/
|
||||
|
||||
https://opus-codec.org/
|
||||
|
||||
## URLs and communities
|
||||
## Communities
|
||||
|
||||
### URLs
|
||||
|
||||
- https://github.com/openmoh/openmohaa/
|
||||
- https://mohaaaa.co.uk/AAAAMOHAA/index.php
|
||||
- https://x-null.net/
|
||||
|
||||
### Discord
|
||||
|
||||
[](https://discord.gg/NYtH58R)
|
||||
@@ -1,25 +0,0 @@
|
||||
//// //// //// //// ////
|
||||
/// OpenMoHAA - TODO ///
|
||||
//// //// //// //// ////
|
||||
|
||||
================
|
||||
= Server code =
|
||||
================
|
||||
1) Fix some crashes
|
||||
|
||||
================
|
||||
= Client =
|
||||
================
|
||||
2) Better client/sound implementation
|
||||
3) Better renderer implementation (light, fog)
|
||||
4) Better cgame implementation (using FAKK2)
|
||||
5) UI implementation (unfortunately, the mohaa UI is fully based on FAKK 2 sources but isn't available anywhere)
|
||||
|
||||
================
|
||||
= Game code =
|
||||
================
|
||||
6) Finish the vehicle implementation
|
||||
--- Open Beta ---
|
||||
7) Actors/SinglePlayer
|
||||
8) SH/BT features (there are not much things to implement I guess)
|
||||
--- Release ---
|
||||
+44
-22
@@ -1,36 +1,52 @@
|
||||
set(archdetect_c_code "
|
||||
#if defined(__i386) || defined(__i386__) || defined(_M_IX86)
|
||||
#error cmake_ARCH x86
|
||||
# error cmake_ARCH x86
|
||||
#elif defined(__x86_64) || defined(__x86_64__) || defined(__amd64) || defined(_M_X64)
|
||||
#error cmake_ARCH x86_64
|
||||
#elif defined(__ppc64__) || defined(__powerpc64__)
|
||||
#error cmake_ARCH ppc64
|
||||
# error cmake_ARCH x86_64
|
||||
#elif defined(__PPC64__) || defined(__ppc64__) || defined(__powerpc64__) || defined(_ARCH_PPC64)
|
||||
# if __BIG_ENDIAN__
|
||||
# error cmake_ARCH ppc64
|
||||
# else
|
||||
# error cmake_ARCH ppc64el
|
||||
# endif
|
||||
#elif defined(__ppc__) || defined(__ppc) || defined(__powerpc__)
|
||||
#error cmake_ARCH ppc
|
||||
# error cmake_ARCH ppc
|
||||
#elif defined __s390__
|
||||
#error cmake_ARCH s390
|
||||
# error cmake_ARCH s390
|
||||
#elif defined __s390x__
|
||||
#error cmake_ARCH s390x
|
||||
# error cmake_ARCH s390x
|
||||
#elif defined __ia64__
|
||||
#error cmake_ARCH ia64
|
||||
# error cmake_ARCH ia64
|
||||
#elif defined __e2k__
|
||||
# error cmake_ARCH e2k
|
||||
#elif defined __alpha__
|
||||
#error cmake_ARCH alpha
|
||||
# error cmake_ARCH alpha
|
||||
#elif defined __sparc__
|
||||
#error cmake_ARCH sparc
|
||||
#elif defined __arm__ || defined (_M_ARM)
|
||||
#error cmake_ARCH arm
|
||||
# error cmake_ARCH sparc
|
||||
#elif defined(__aarch64__) || defined(__ARM64__) || defined(_M_ARM64)
|
||||
#error cmake_ARCH aarch64
|
||||
# error cmake_ARCH arm64
|
||||
#elif defined __arm__ || defined (_M_ARM)
|
||||
# if defined(__ARM_PCS_VFP) && (__ARM_PCS_VFP)
|
||||
# error cmake_ARCH armhf
|
||||
# else
|
||||
# error cmake_ARCH armel
|
||||
# endif
|
||||
#elif defined __cris__
|
||||
#error cmake_ARCH cris
|
||||
# error cmake_ARCH cris
|
||||
#elif defined __hppa__
|
||||
#error cmake_ARCH hppa
|
||||
# error cmake_ARCH hppa
|
||||
#elif defined __mips__
|
||||
#error cmake_ARCH mips
|
||||
# error cmake_ARCH mips
|
||||
#elif defined __sh__
|
||||
#error cmake_ARCH sh
|
||||
# error cmake_ARCH sh
|
||||
#elif defined __riscv
|
||||
# if __UINTPTR_MAX__ == __UINT64_MAX__
|
||||
# error cmake_ARCH riscv64
|
||||
# else
|
||||
# error cmake_ARCH riscv
|
||||
# endif
|
||||
#else
|
||||
#error cmake_ARCH unknown
|
||||
# error cmake_ARCH unknown
|
||||
#endif
|
||||
|
||||
")
|
||||
@@ -55,12 +71,14 @@ function(target_architecture output_var)
|
||||
foreach(osx_arch ${CMAKE_OSX_ARCHITECTURES})
|
||||
if("${osx_arch}" STREQUAL "ppc" AND ppc_support)
|
||||
set(osx_arch_ppc TRUE)
|
||||
elseif("${osx_arch}" STREQUAL "ppc64" AND ppc_support)
|
||||
set(osx_arch_ppc64 TRUE)
|
||||
elseif("${osx_arch}" STREQUAL "i386")
|
||||
set(osx_arch_i386 TRUE)
|
||||
elseif("${osx_arch}" STREQUAL "x86_64")
|
||||
set(osx_arch_x86_64 TRUE)
|
||||
elseif("${osx_arch}" STREQUAL "ppc64" AND ppc_support)
|
||||
set(osx_arch_ppc64 TRUE)
|
||||
elseif("${osx_arch}" STREQUAL "arm64")
|
||||
set(osx_arch_arm64 TRUE)
|
||||
else()
|
||||
message(FATAL_ERROR "Invalid OS X arch name: ${osx_arch}")
|
||||
endif()
|
||||
@@ -71,6 +89,10 @@ function(target_architecture output_var)
|
||||
list(APPEND ARCH ppc)
|
||||
endif()
|
||||
|
||||
if(osx_arch_ppc64)
|
||||
list(APPEND ARCH ppc64)
|
||||
endif()
|
||||
|
||||
if(osx_arch_i386)
|
||||
list(APPEND ARCH i386)
|
||||
endif()
|
||||
@@ -79,8 +101,8 @@ function(target_architecture output_var)
|
||||
list(APPEND ARCH x86_64)
|
||||
endif()
|
||||
|
||||
if(osx_arch_ppc64)
|
||||
list(APPEND ARCH ppc64)
|
||||
if(osx_arch_arm64)
|
||||
list(APPEND ARCH arm64)
|
||||
endif()
|
||||
else()
|
||||
# figure out extension for the source 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()
|
||||
@@ -0,0 +1,36 @@
|
||||
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)
|
||||
@@ -0,0 +1,32 @@
|
||||
/*
|
||||
===========================================================================
|
||||
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
|
||||
===========================================================================
|
||||
*/
|
||||
|
||||
// launch.h: Base interface for starting programs
|
||||
|
||||
#include "q_platform.h"
|
||||
|
||||
#include <filesystem>
|
||||
#include <string>
|
||||
#include <vector>
|
||||
|
||||
std::filesystem::path GetProgramLocation();
|
||||
void LaunchProgram(const std::filesystem::path& path, const std::vector<std::string>& argumentList);
|
||||
@@ -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);
|
||||
}
|
||||
@@ -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_STRING DLL_SUFFIX EXE_EXT;
|
||||
#else
|
||||
const char* programName = "omohaaded" "." ARCH_STRING 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;
|
||||
}
|
||||
@@ -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,5 +1,5 @@
|
||||
cmake_minimum_required(VERSION 3.5)
|
||||
project(fgame)
|
||||
project(cgame)
|
||||
|
||||
# Shared source files for modules
|
||||
set(SOURCES_SHARED
|
||||
@@ -18,25 +18,20 @@ set(SOURCES_SHARED
|
||||
"../script/scriptvariable.cpp"
|
||||
)
|
||||
|
||||
file(GLOB_RECURSE SOURCES_BG "../fgame/bg_*.cpp")
|
||||
file(GLOB_RECURSE SOURCES_BG "../fgame/bg_misc.cpp" "../fgame/bg_pmove.cpp" "../fgame/bg_slidemove.cpp" "../fgame/bg_voteoptions.cpp")
|
||||
file(GLOB_RECURSE SOURCES_CGAME "./*.c" "./*.cpp")
|
||||
|
||||
add_library(cgame SHARED ${SOURCES_CGAME} ${SOURCES_BG})
|
||||
target_compile_definitions(cgame PRIVATE CGAME_DLL TARGET_GAME_TYPE=${TARGET_GAME_TYPE})
|
||||
target_compile_definitions(cgame PRIVATE CGAME_DLL)
|
||||
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}${TARGET_CONFIG_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
|
||||
DESTINATION "${TARGET_BASE_GAME}"
|
||||
ARCHIVE EXCLUDE_FROM_ALL
|
||||
)
|
||||
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()
|
||||
@@ -0,0 +1,196 @@
|
||||
/*
|
||||
===========================================================================
|
||||
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 "cg_local.h"
|
||||
#include "cg_archive.h"
|
||||
#include "cg_commands.h"
|
||||
#include "memarchiver.h"
|
||||
#include "../qcommon/tiki.h"
|
||||
|
||||
void CG_ArchiveStuff(MemArchiver& archiver, int svsTime)
|
||||
{
|
||||
archiver.SetBaseTime(svsTime);
|
||||
commandManager.ArchiveToMemory(archiver);
|
||||
CG_ArchiveVSSGlobals(archiver);
|
||||
}
|
||||
|
||||
size_t CG_SaveStateToBuffer(void** out, int svsTime)
|
||||
{
|
||||
MemArchiver archiver;
|
||||
size_t size;
|
||||
|
||||
archiver.SetupForWriting(0x200000);
|
||||
CG_ArchiveStuff(archiver, svsTime);
|
||||
size = archiver.BufferSize();
|
||||
if (size && out) {
|
||||
*out = archiver.ConfiscateBuffer();
|
||||
}
|
||||
|
||||
return size;
|
||||
}
|
||||
|
||||
qboolean CG_LoadStateToBuffer(void* state, size_t size, int svsTime)
|
||||
{
|
||||
MemArchiver archiver;
|
||||
|
||||
archiver.SetupForReading((byte*)state, size);
|
||||
CG_ArchiveStuff(archiver, svsTime);
|
||||
|
||||
return archiver.FinishedReading();
|
||||
}
|
||||
|
||||
void CG_ArchiveStringContainer(MemArchiver& archiver, Container<str>* container)
|
||||
{
|
||||
int num;
|
||||
int i;
|
||||
|
||||
if (archiver.IsReading()) {
|
||||
str tmp;
|
||||
|
||||
archiver.ArchiveInteger(&num);
|
||||
container->ClearObjectList();
|
||||
|
||||
for (i = 0; i < num; i++) {
|
||||
archiver.ArchiveString(&tmp);
|
||||
container->AddObject(tmp);
|
||||
}
|
||||
} else {
|
||||
num = container->NumObjects();
|
||||
archiver.ArchiveInteger(&num);
|
||||
|
||||
for (i = 0; i < num; i++) {
|
||||
str& tmp = container->ObjectAt(i + 1);
|
||||
archiver.ArchiveString(&tmp);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void CG_ArchiveTikiPointer(MemArchiver& archiver, dtiki_t** pTiki)
|
||||
{
|
||||
str tmp;
|
||||
|
||||
if (archiver.IsReading()) {
|
||||
archiver.ArchiveString(&tmp);
|
||||
if (tmp.length()) {
|
||||
*pTiki = cgi.R_Model_GetHandle(cgi.R_RegisterModel(tmp.c_str()));
|
||||
} else {
|
||||
*pTiki = NULL;
|
||||
}
|
||||
} else {
|
||||
if (*pTiki) {
|
||||
tmp = (*pTiki)->name;
|
||||
}
|
||||
|
||||
archiver.ArchiveString(&tmp);
|
||||
}
|
||||
}
|
||||
|
||||
void CG_ArchiveModelHandle(MemArchiver& archiver, qhandle_t* handle)
|
||||
{
|
||||
str tmp;
|
||||
|
||||
if (archiver.IsReading()) {
|
||||
archiver.ArchiveString(&tmp);
|
||||
if (tmp.length()) {
|
||||
*handle = cgi.R_RegisterModel(tmp.c_str());
|
||||
} else {
|
||||
*handle = (qhandle_t)0;
|
||||
}
|
||||
} else {
|
||||
if (*handle) {
|
||||
tmp = cgi.R_GetModelName(*handle);
|
||||
} else {
|
||||
tmp = "";
|
||||
}
|
||||
|
||||
archiver.ArchiveString(&tmp);
|
||||
}
|
||||
}
|
||||
|
||||
void CG_ArchiveShaderHandle(MemArchiver& archiver, qhandle_t* handle)
|
||||
{
|
||||
str tmp;
|
||||
|
||||
if (archiver.IsReading()) {
|
||||
archiver.ArchiveString(&tmp);
|
||||
if (tmp.length()) {
|
||||
*handle = cgi.R_RegisterShader(tmp.c_str());
|
||||
} else {
|
||||
*handle = (qhandle_t)0;
|
||||
}
|
||||
} else {
|
||||
if (*handle) {
|
||||
tmp = cgi.R_GetShaderName(*handle);
|
||||
} else {
|
||||
tmp = "";
|
||||
}
|
||||
|
||||
archiver.ArchiveString(&tmp);
|
||||
}
|
||||
}
|
||||
|
||||
void CG_ArchiveRefEntity(MemArchiver& archiver, refEntity_t* ref)
|
||||
{
|
||||
archiver.ArchiveRaw(&ref->reType, sizeof(ref->reType));
|
||||
archiver.ArchiveInteger(&ref->renderfx);
|
||||
|
||||
CG_ArchiveModelHandle(archiver, &ref->hModel);
|
||||
CG_ArchiveModelHandle(archiver, &ref->hOldModel);
|
||||
|
||||
archiver.ArchiveVec3(ref->lightingOrigin);
|
||||
archiver.ArchiveInteger(&ref->parentEntity);
|
||||
archiver.ArchiveVec3(ref->axis[0]);
|
||||
archiver.ArchiveVec3(ref->axis[1]);
|
||||
archiver.ArchiveVec3(ref->axis[2]);
|
||||
archiver.ArchiveBoolean(&ref->nonNormalizedAxes);
|
||||
archiver.ArchiveVec3(ref->origin);
|
||||
archiver.ArchiveRaw(ref->frameInfo, sizeof(ref->frameInfo));
|
||||
archiver.ArchiveFloat(&ref->actionWeight);
|
||||
archiver.ArchiveShort(&ref->wasframe);
|
||||
archiver.ArchiveFloat(&ref->scale);
|
||||
archiver.ArchiveVec3(ref->oldorigin);
|
||||
archiver.ArchiveInteger(&ref->skinNum);
|
||||
|
||||
CG_ArchiveShaderHandle(archiver, &ref->customShader);
|
||||
archiver.ArchiveRaw(ref->shaderRGBA, sizeof(ref->shaderRGBA));
|
||||
archiver.ArchiveFloat(ref->shaderTexCoord);
|
||||
archiver.ArchiveFloat(&ref->shaderTexCoord[1]);
|
||||
archiver.ArchiveFloat(&ref->shaderTime);
|
||||
|
||||
archiver.ArchiveInteger(&ref->entityNumber);
|
||||
archiver.ArchiveRaw(ref->surfaces, 32);
|
||||
archiver.ArchiveFloat(ref->shader_data);
|
||||
archiver.ArchiveFloat(&ref->shader_data[1]);
|
||||
|
||||
ref->bone_tag = NULL;
|
||||
ref->bone_quat = NULL;
|
||||
ref->of = NULL;
|
||||
ref->nf = NULL;
|
||||
|
||||
CG_ArchiveTikiPointer(archiver, &ref->tiki);
|
||||
|
||||
archiver.ArchiveInteger(&ref->bonestart);
|
||||
archiver.ArchiveInteger(&ref->morphstart);
|
||||
archiver.ArchiveBoolean(&ref->hasMorph);
|
||||
archiver.ArchiveFloat(&ref->radius);
|
||||
archiver.ArchiveFloat(&ref->rotation);
|
||||
}
|
||||
@@ -0,0 +1,53 @@
|
||||
/*
|
||||
===========================================================================
|
||||
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
|
||||
===========================================================================
|
||||
*/
|
||||
|
||||
// DESCRIPTION:
|
||||
// Memory archiver
|
||||
|
||||
#pragma once
|
||||
|
||||
#ifdef __cplusplus
|
||||
|
||||
#include "../qcommon/container.h"
|
||||
#include "../qcommon/str.h"
|
||||
|
||||
class MemArchiver;
|
||||
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
size_t CG_SaveStateToBuffer(void** out, int svsTime);
|
||||
qboolean CG_LoadStateToBuffer(void* state, size_t size, int svsTime);
|
||||
|
||||
#ifdef __cplusplus
|
||||
void CG_ArchiveStuff(MemArchiver& archiver, int svsTime);
|
||||
void CG_ArchiveStringContainer(MemArchiver& archiver, Container<str>* container);
|
||||
void CG_ArchiveTikiPointer(MemArchiver& archiver, dtiki_t** pTiki);
|
||||
void CG_ArchiveModelHandle(MemArchiver& archiver, qhandle_t* handle);
|
||||
void CG_ArchiveShaderHandle(MemArchiver& archiver, qhandle_t* handle);
|
||||
void CG_ArchiveRefEntity(MemArchiver& archiver, refEntity_t* ref);
|
||||
#endif
|
||||
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
+437
-595
File diff suppressed because it is too large.
Load diff
+3034
-2439
File diff suppressed because it is too large.
Load diff
+575
-492
File diff suppressed because it is too large.
Load diff
+262
-126
@@ -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);
|
||||
|
||||
@@ -61,22 +62,25 @@ Debugging command to print the current position
|
||||
*/
|
||||
static void CG_Viewpos_f(void)
|
||||
{
|
||||
cgi.Printf("(%i %i %i) : %i\n", (int)cg.refdef.vieworg[0],
|
||||
(int)cg.refdef.vieworg[1], (int)cg.refdef.vieworg[2],
|
||||
(int)cg.refdefViewAngles[YAW]);
|
||||
cgi.Printf(
|
||||
"(%i %i %i) : %i\n",
|
||||
(int)cg.refdef.vieworg[0],
|
||||
(int)cg.refdef.vieworg[1],
|
||||
(int)cg.refdef.vieworg[2],
|
||||
(int)cg.refdefViewAngles[YAW]
|
||||
);
|
||||
}
|
||||
|
||||
void CG_SetDesiredObjectiveAlpha(float fAlpha)
|
||||
{
|
||||
cg.ObjectivesDesiredAlpha = fAlpha;
|
||||
cg.ObjectivesAlphaTime = (float)(cg.time + 250);
|
||||
cg.ObjectivesBaseAlpha = cg.ObjectivesCurrentAlpha;
|
||||
cg.ObjectivesAlphaTime = (float)(cg.time + 250);
|
||||
cg.ObjectivesBaseAlpha = cg.ObjectivesCurrentAlpha;
|
||||
}
|
||||
|
||||
void CG_ScoresDown_f( void )
|
||||
void CG_ScoresDown_f(void)
|
||||
{
|
||||
if (cgs.gametype == GT_SINGLE_PLAYER)
|
||||
{
|
||||
if (cgs.gametype == GT_SINGLE_PLAYER) {
|
||||
if (!cg.scoresRequestTime) {
|
||||
cg.scoresRequestTime = cg.time;
|
||||
CG_SetDesiredObjectiveAlpha(1.0f);
|
||||
@@ -85,33 +89,30 @@ void CG_ScoresDown_f( void )
|
||||
return;
|
||||
}
|
||||
|
||||
if ( cg.scoresRequestTime + 2000 >= cg.time )
|
||||
{
|
||||
if (cg.scoresRequestTime + 2000 >= cg.time) {
|
||||
// send another request
|
||||
cg.showScores = qtrue;
|
||||
CG_PrepScoreBoardInfo();
|
||||
cgi.UI_ShowScoreBoard(cg.scoresMenuName);
|
||||
return;
|
||||
}
|
||||
|
||||
cg.scoresRequestTime = cg.time;
|
||||
cgi.SendClientCommand( "score" );
|
||||
return;
|
||||
}
|
||||
|
||||
if ( !cg.showScores ) {
|
||||
// don't display anything until first score returns
|
||||
cg.showScores = qtrue;
|
||||
cg.scoresRequestTime = cg.time;
|
||||
cgi.SendClientCommand("score");
|
||||
|
||||
if (!cg.showScores) {
|
||||
// don't display anything until first score returns
|
||||
cg.showScores = qtrue;
|
||||
CG_PrepScoreBoardInfo();
|
||||
cgi.UI_ShowScoreBoard(cg.scoresMenuName);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void CG_ScoresUp_f( void )
|
||||
void CG_ScoresUp_f(void)
|
||||
{
|
||||
if (cgs.gametype == GT_SINGLE_PLAYER)
|
||||
{
|
||||
if (!cg.scoresRequestTime)
|
||||
{
|
||||
cg.scoresRequestTime = cg.time;
|
||||
if (cgs.gametype == GT_SINGLE_PLAYER) {
|
||||
if (cg.scoresRequestTime) {
|
||||
cg.scoresRequestTime = 0;
|
||||
CG_SetDesiredObjectiveAlpha(0.0f);
|
||||
}
|
||||
|
||||
@@ -126,12 +127,12 @@ void CG_ScoresUp_f( void )
|
||||
cgi.UI_HideScoreBoard();
|
||||
}
|
||||
|
||||
baseshader_t* CG_GetShaderUnderCrosshair(qboolean bVerbose, trace_t* pRetTrace)
|
||||
baseshader_t *CG_GetShaderUnderCrosshair(qboolean bVerbose, trace_t *pRetTrace)
|
||||
{
|
||||
vec3_t vPos, vEnd;
|
||||
vec3_t axis[3];
|
||||
baseshader_t* pShader;
|
||||
trace_t trace;
|
||||
vec3_t vPos, vEnd;
|
||||
vec3_t axis[3];
|
||||
baseshader_t *pShader;
|
||||
trace_t trace;
|
||||
|
||||
AnglesToAxis(cg.refdefViewAngles, axis);
|
||||
vPos[0] = cg.refdef.vieworg[0];
|
||||
@@ -140,18 +141,13 @@ baseshader_t* CG_GetShaderUnderCrosshair(qboolean bVerbose, trace_t* pRetTrace)
|
||||
VectorMA(vPos, 4096.0, axis[0], vEnd);
|
||||
|
||||
CG_Trace(&trace, vPos, vec3_origin, vec3_origin, vEnd, 0, MASK_SHOT, 0, 0, "CG_GetShaderUnderCrosshair");
|
||||
|
||||
|
||||
if (trace.startsolid || trace.fraction == 1.0) {
|
||||
return NULL;
|
||||
}
|
||||
|
||||
if (bVerbose)
|
||||
{
|
||||
cgi.Printf(
|
||||
"Surface hit at (%i %i %i)\n",
|
||||
(int)trace.endpos[0],
|
||||
(int)trace.endpos[1],
|
||||
(int)trace.endpos[2]);
|
||||
if (bVerbose) {
|
||||
cgi.Printf("Surface hit at (%i %i %i)\n", (int)trace.endpos[0], (int)trace.endpos[1], (int)trace.endpos[2]);
|
||||
}
|
||||
|
||||
pShader = cgi.GetShader(trace.shaderNum);
|
||||
@@ -164,34 +160,170 @@ 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)
|
||||
{
|
||||
trace_t trace;
|
||||
baseshader_t* pShader;
|
||||
trace_t trace;
|
||||
baseshader_t *pShader;
|
||||
|
||||
pShader = CG_GetShaderUnderCrosshair(qtrue, &trace);
|
||||
cgi.Printf("\n");
|
||||
if (pShader)
|
||||
{
|
||||
if (pShader->surfaceFlags & SURF_SKY)
|
||||
{
|
||||
if (pShader) {
|
||||
if (pShader->surfaceFlags & SURF_SKY) {
|
||||
cgi.Printf("Hit the sky\n");
|
||||
}
|
||||
else
|
||||
{
|
||||
} else {
|
||||
cgi.Printf("Shader: %s\n", pShader->shader);
|
||||
cgi.Printf("Shader Contents:");
|
||||
CG_PrintContentTypes(pShader->contentFlags);
|
||||
@@ -212,28 +344,23 @@ void CG_GetCHShader(void)
|
||||
CG_PrintSurfaceType(trace.surfaceFlags);
|
||||
cgi.Printf("\n\n");
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
} else {
|
||||
cgi.Printf("No surface selected\n");
|
||||
}
|
||||
}
|
||||
|
||||
void CG_EditCHShader(void)
|
||||
{
|
||||
char name[1024];
|
||||
baseshader_t* pShader;
|
||||
char name[1024];
|
||||
baseshader_t *pShader;
|
||||
|
||||
pShader = CG_GetShaderUnderCrosshair(qfalse, NULL);
|
||||
if (pShader)
|
||||
{
|
||||
strcpy(name, "editspecificshader ");
|
||||
strcat(name, pShader->shader);
|
||||
strcat(name, "\n");
|
||||
if (pShader) {
|
||||
Q_strncpyz(name, "editspecificshader ", sizeof(name));
|
||||
Q_strcat(name, sizeof(name), pShader->shader);
|
||||
Q_strcat(name, sizeof(name), "\n");
|
||||
cgi.AddCommand(name);
|
||||
}
|
||||
else
|
||||
{
|
||||
} else {
|
||||
cgi.Printf("No surface selected\n");
|
||||
}
|
||||
}
|
||||
@@ -348,61 +475,70 @@ void CG_AddTestModel (void) {
|
||||
#endif
|
||||
|
||||
typedef struct {
|
||||
char* cmd;
|
||||
char *cmd;
|
||||
void (*function)(void);
|
||||
} consoleCommand_t;
|
||||
|
||||
static consoleCommand_t commands[] = {
|
||||
{ "useweaponclass", &CG_UseWeaponClass_f },
|
||||
{ "weapnext", &CG_NextWeapon_f },
|
||||
{ "weapprev", &CG_PrevWeapon_f },
|
||||
{ "uselast", &CG_UseLastWeapon_f },
|
||||
{ "holster", &CG_HolsterWeapon_f },
|
||||
{ "weapdrop", &CG_DropWeapon_f },
|
||||
{ "toggleitem", &CG_ToggleItem_f },
|
||||
{ "+scores", &CG_ScoresDown_f },
|
||||
{ "-scores", &CG_ScoresUp_f },
|
||||
{ "viewpos", &CG_Viewpos_f },
|
||||
{ "sizeup", &CG_SizeUp_f },
|
||||
{ "sizedown", &CG_SizeDown_f },
|
||||
{ "cg_eventlist", &CG_EventList_f },
|
||||
{ "cg_eventhelp", &CG_EventHelp_f },
|
||||
{ "cg_dumpevents", &CG_DumpEventHelp_f },
|
||||
{ "cg_pendingevents", &CG_PendingEvents_f },
|
||||
{ "cg_classlist", &CG_ClassList_f },
|
||||
{ "cg_classtree", &CG_ClassTree_f },
|
||||
{ "cg_classevents", &CG_ClassEvents_f },
|
||||
{ "cg_dumpclassevents", &CG_DumpClassEvents_f },
|
||||
{ "cg_dumpallclasses", &CG_DumpAllClasses_f },
|
||||
{ "testemitter", &CG_TestEmitter_f },
|
||||
{ "triggertestemitter", &CG_TriggerTestEmitter_f },
|
||||
{ "prevemittercommand", &CG_PrevEmitterCommand_f },
|
||||
{ "nextemittercommand", &CG_NextEmitterCommand_f },
|
||||
{ "newemittercommand", &CG_NewEmitterCommand_f },
|
||||
{ "deleteemittercommand", &CG_DeleteEmitterCommand_f },
|
||||
{ "dumpemitter", &CG_DumpEmitter_f },
|
||||
{ "loademitter", &CG_LoadEmitter_f },
|
||||
{ "resetvss", &CG_ResetVSSSources },
|
||||
{ "getchshader", &CG_GetCHShader },
|
||||
{ "editchshader", &CG_EditCHShader },
|
||||
{ "messagemode", &CG_MessageMode_f },
|
||||
{ "messagemode_all", &CG_MessageMode_All_f },
|
||||
{ "messagemode_team", &CG_MessageMode_Team_f },
|
||||
{ "messagemode_private", &CG_MessageMode_Private_f },
|
||||
{ "say", &CG_MessageSingleAll_f },
|
||||
{ "sayteam", &CG_MessageSingleTeam_f },
|
||||
{ "teamsay", &CG_MessageSingleTeam_f },
|
||||
{ "sayprivate", &CG_MessageSingleClient_f },
|
||||
{ "sayone", &CG_MessageSingleClient_f },
|
||||
{ "wisper", &CG_MessageSingleClient_f },
|
||||
{ "instamsg_main", &CG_InstaMessageMain_f },
|
||||
{ "instamsg_group_a", &CG_InstaMessageGroupA_f },
|
||||
{ "instamsg_group_b", &CG_InstaMessageGroupB_f },
|
||||
{ "instamsg_group_c", &CG_InstaMessageGroupC_f },
|
||||
{ "instamsg_group_d", &CG_InstaMessageGroupD_f },
|
||||
{ "instamsg_group_e", &CG_InstaMessageGroupE_f },
|
||||
{ "pushmenu_teamselect", &CG_PushMenuTeamSelect_f },
|
||||
{ "pushmenu_weaponselect", &CG_PushMenuWeaponSelect_f },
|
||||
{"useweaponclass", &CG_UseWeaponClass_f },
|
||||
{"weapnext", &CG_NextWeapon_f },
|
||||
{"weapprev", &CG_PrevWeapon_f },
|
||||
{"uselast", &CG_UseLastWeapon_f },
|
||||
{"holster", &CG_HolsterWeapon_f },
|
||||
{"weapdrop", &CG_DropWeapon_f },
|
||||
{"toggleitem", &CG_ToggleItem_f },
|
||||
{"+scores", &CG_ScoresDown_f },
|
||||
{"-scores", &CG_ScoresUp_f },
|
||||
{"viewpos", &CG_Viewpos_f },
|
||||
{"sizeup", &CG_SizeUp_f },
|
||||
{"sizedown", &CG_SizeDown_f },
|
||||
{"cg_eventlist", &CG_EventList_f },
|
||||
{"cg_eventhelp", &CG_EventHelp_f },
|
||||
{"cg_dumpevents", &CG_DumpEventHelp_f },
|
||||
{"cg_pendingevents", &CG_PendingEvents_f },
|
||||
{"cg_classlist", &CG_ClassList_f },
|
||||
{"cg_classtree", &CG_ClassTree_f },
|
||||
{"cg_classevents", &CG_ClassEvents_f },
|
||||
{"cg_dumpclassevents", &CG_DumpClassEvents_f },
|
||||
{"cg_dumpallclasses", &CG_DumpAllClasses_f },
|
||||
{"testemitter", &CG_TestEmitter_f },
|
||||
{"triggertestemitter", &CG_TriggerTestEmitter_f },
|
||||
{"prevemittercommand", &CG_PrevEmitterCommand_f },
|
||||
{"nextemittercommand", &CG_NextEmitterCommand_f },
|
||||
{"newemittercommand", &CG_NewEmitterCommand_f },
|
||||
{"deleteemittercommand", &CG_DeleteEmitterCommand_f },
|
||||
{"dumpemitter", &CG_DumpEmitter_f },
|
||||
{"loademitter", &CG_LoadEmitter_f },
|
||||
{"resetvss", &CG_ResetVSSSources },
|
||||
{"getchshader", &CG_GetCHShader },
|
||||
{"editchshader", &CG_EditCHShader },
|
||||
{"messagemode", &CG_MessageMode_f },
|
||||
{"messagemode_all", &CG_MessageMode_All_f },
|
||||
{"messagemode_team", &CG_MessageMode_Team_f },
|
||||
{"messagemode_private", &CG_MessageMode_Private_f },
|
||||
{"say", &CG_MessageSingleAll_f },
|
||||
{"sayteam", &CG_MessageSingleTeam_f },
|
||||
{"teamsay", &CG_MessageSingleTeam_f },
|
||||
{"sayprivate", &CG_MessageSingleClient_f },
|
||||
{"sayone", &CG_MessageSingleClient_f },
|
||||
{"wisper", &CG_MessageSingleClient_f },
|
||||
{"instamsg_main", &CG_InstaMessageMain_f },
|
||||
{"instamsg_group_a", &CG_InstaMessageGroupA_f },
|
||||
{"instamsg_group_b", &CG_InstaMessageGroupB_f },
|
||||
{"instamsg_group_c", &CG_InstaMessageGroupC_f },
|
||||
{"instamsg_group_d", &CG_InstaMessageGroupD_f },
|
||||
{"instamsg_group_e", &CG_InstaMessageGroupE_f },
|
||||
{"pushmenu_teamselect", &CG_PushMenuTeamSelect_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 },
|
||||
};
|
||||
|
||||
/*
|
||||
@@ -415,8 +551,8 @@ Cmd_Argc() / Cmd_Argv()
|
||||
*/
|
||||
qboolean CG_ConsoleCommand(void)
|
||||
{
|
||||
const char* cmd;
|
||||
int i;
|
||||
const char *cmd;
|
||||
int i;
|
||||
|
||||
cmd = cgi.Argv(0);
|
||||
|
||||
@@ -475,7 +611,7 @@ void CG_PushMenuTeamSelect_f(void)
|
||||
default:
|
||||
cgi.Cmd_Execute(EXEC_NOW, "pushmenu SelectTeam\n");
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void CG_PushMenuWeaponSelect_f(void)
|
||||
@@ -489,7 +625,7 @@ void CG_PushMenuWeaponSelect_f(void)
|
||||
|
||||
void CG_UseWeaponClass_f(void)
|
||||
{
|
||||
const char* cmd;
|
||||
const char *cmd;
|
||||
|
||||
cmd = cgi.Argv(1);
|
||||
|
||||
@@ -520,37 +656,37 @@ void CG_UseWeaponClass_f(void)
|
||||
|
||||
void CG_NextWeapon_f(void)
|
||||
{
|
||||
cg.iWeaponCommand = WEAPON_COMMAND_USE_NEXT_WEAPON;
|
||||
cg.iWeaponCommand = WEAPON_COMMAND_USE_NEXT_WEAPON;
|
||||
cg.iWeaponCommandSend = 0;
|
||||
}
|
||||
|
||||
void CG_PrevWeapon_f(void)
|
||||
{
|
||||
cg.iWeaponCommand = WEAPON_COMMAND_USE_PREV_WEAPON;
|
||||
cg.iWeaponCommand = WEAPON_COMMAND_USE_PREV_WEAPON;
|
||||
cg.iWeaponCommandSend = 0;
|
||||
}
|
||||
|
||||
void CG_UseLastWeapon_f(void)
|
||||
{
|
||||
cg.iWeaponCommand = WEAPON_COMMAND_USE_LAST_WEAPON;
|
||||
cg.iWeaponCommand = WEAPON_COMMAND_USE_LAST_WEAPON;
|
||||
cg.iWeaponCommandSend = 0;
|
||||
}
|
||||
|
||||
void CG_HolsterWeapon_f(void)
|
||||
{
|
||||
cg.iWeaponCommand = WEAPON_COMMAND_HOLSTER;
|
||||
cg.iWeaponCommand = WEAPON_COMMAND_HOLSTER;
|
||||
cg.iWeaponCommandSend = 0;
|
||||
}
|
||||
|
||||
void CG_DropWeapon_f(void)
|
||||
{
|
||||
cg.iWeaponCommand = WEAPON_COMMAND_DROP;
|
||||
cg.iWeaponCommand = WEAPON_COMMAND_DROP;
|
||||
cg.iWeaponCommandSend = 0;
|
||||
}
|
||||
|
||||
void CG_ToggleItem_f(void)
|
||||
{
|
||||
cg.iWeaponCommand = WEAPON_COMMAND_USE_ITEM1;
|
||||
cg.iWeaponCommand = WEAPON_COMMAND_USE_ITEM1;
|
||||
cg.iWeaponCommandSend = 0;
|
||||
}
|
||||
|
||||
@@ -562,7 +698,7 @@ int CG_WeaponCommandButtonBits(void)
|
||||
return 0;
|
||||
}
|
||||
|
||||
iShiftedWeaponCommand = cg.iWeaponCommand << 7;
|
||||
iShiftedWeaponCommand = cg.iWeaponCommand << 7;
|
||||
|
||||
cg.iWeaponCommandSend++;
|
||||
if (cg.iWeaponCommandSend > 2) {
|
||||
|
||||
+768
-621
File diff suppressed because it is too large.
Load diff
+346
-358
@@ -23,6 +23,7 @@ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
// cg_ents.c -- present snapshot entities, happens every single frame
|
||||
|
||||
#include "cg_local.h"
|
||||
#include "cg_radar.h"
|
||||
|
||||
/*
|
||||
==========================================================================
|
||||
@@ -37,48 +38,42 @@ FUNCTIONS CALLED EACH FRAME
|
||||
CG_SetEntitySoundPosition
|
||||
======================
|
||||
*/
|
||||
void CG_SetEntitySoundPosition( centity_t *cent )
|
||||
{
|
||||
vec3_t origin;
|
||||
void CG_SetEntitySoundPosition(centity_t *cent)
|
||||
{
|
||||
vec3_t origin;
|
||||
|
||||
if ( cent->currentState.solid == SOLID_BMODEL )
|
||||
{
|
||||
float *v;
|
||||
vec3_t vel;
|
||||
if (cent->currentState.solid == SOLID_BMODEL) {
|
||||
float *v;
|
||||
vec3_t vel;
|
||||
|
||||
v = cgs.inlineModelMidpoints[ cent->currentState.modelindex ];
|
||||
VectorAdd( cent->lerpOrigin, v, origin );
|
||||
v = cgs.inlineModelMidpoints[cent->currentState.modelindex];
|
||||
VectorAdd(cent->lerpOrigin, v, origin);
|
||||
|
||||
vel[0] = 0.0;
|
||||
vel[1] = 0.0;
|
||||
vel[2] = 0.0;
|
||||
vel[0] = 0.0;
|
||||
vel[1] = 0.0;
|
||||
vel[2] = 0.0;
|
||||
|
||||
cgi.S_UpdateEntity( cent->currentState.number, origin, vel, qfalse );
|
||||
}
|
||||
else
|
||||
{
|
||||
if ( cent && cg.snap && cent->currentState.parent == cg.snap->ps.clientNum )
|
||||
{
|
||||
vec3_t origin;
|
||||
vec3_t velocity;
|
||||
cgi.S_UpdateEntity(cent->currentState.number, origin, vel, qfalse);
|
||||
} else {
|
||||
if (cent && cg.snap && cent->currentState.parent == cg.snap->ps.clientNum) {
|
||||
vec3_t origin;
|
||||
vec3_t velocity;
|
||||
|
||||
origin[0] = 0;
|
||||
origin[1] = 0;
|
||||
origin[2] = 0;
|
||||
origin[0] = 0;
|
||||
origin[1] = 0;
|
||||
origin[2] = 0;
|
||||
|
||||
velocity[0] = 0;
|
||||
velocity[1] = 0;
|
||||
velocity[2] = 0;
|
||||
velocity[0] = 0;
|
||||
velocity[1] = 0;
|
||||
velocity[2] = 0;
|
||||
|
||||
cgi.S_UpdateEntity( cent->currentState.number, origin, velocity, qtrue );
|
||||
}
|
||||
else
|
||||
{
|
||||
CG_GetOrigin( cent, origin );
|
||||
cgi.S_UpdateEntity( cent->currentState.number, origin, cent->currentState.pos.trDelta, qfalse );
|
||||
}
|
||||
}
|
||||
}
|
||||
cgi.S_UpdateEntity(cent->currentState.number, origin, velocity, qtrue);
|
||||
} else {
|
||||
CG_GetOrigin(cent, origin);
|
||||
cgi.S_UpdateEntity(cent->currentState.number, origin, cent->currentState.pos.trDelta, qfalse);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
==================
|
||||
@@ -87,165 +82,173 @@ CG_EntityEffects
|
||||
Add continuous entity effects, like local entity emission and lighting
|
||||
==================
|
||||
*/
|
||||
void CG_EntityEffects( centity_t *cent )
|
||||
{
|
||||
// initialize with the client colors
|
||||
cent->color[ 0 ] = cent->client_color[ 0 ];
|
||||
cent->color[ 1 ] = cent->client_color[ 1 ];
|
||||
cent->color[ 2 ] = cent->client_color[ 2 ];
|
||||
cent->color[ 3 ] = cent->client_color[ 3 ];
|
||||
void CG_EntityEffects(centity_t *cent)
|
||||
{
|
||||
// initialize with the client colors
|
||||
cent->color[0] = cent->client_color[0];
|
||||
cent->color[1] = cent->client_color[1];
|
||||
cent->color[2] = cent->client_color[2];
|
||||
cent->color[3] = cent->client_color[3];
|
||||
|
||||
if ( cent->currentState.constantLight != 0xffffff )
|
||||
{
|
||||
int style;
|
||||
unsigned cl;
|
||||
float i, r, g, b;
|
||||
if (cent->currentState.constantLight != 0xffffff) {
|
||||
int style;
|
||||
unsigned cl;
|
||||
float i, r, g, b;
|
||||
|
||||
cl = cent->currentState.constantLight;
|
||||
style = ( cl & 255 );
|
||||
r = ( float )style / 255.0f;
|
||||
g = ( float )( ( cl >> 8 ) & 255 ) / 255.0f;
|
||||
b = ( float )( ( cl >> 16 ) & 255 ) / 255.0f;
|
||||
i = ( ( cl >> 24 ) & 255 ) * CONSTANTLIGHT_RADIUS_SCALE;
|
||||
if ( cent->currentState.renderfx & RF_LIGHTSTYLE_DLIGHT )
|
||||
{
|
||||
float color[ 4 ];
|
||||
cl = cent->currentState.constantLight;
|
||||
style = (cl & 255);
|
||||
r = (float)style / 255.0f;
|
||||
g = (float)((cl >> 8) & 255) / 255.0f;
|
||||
b = (float)((cl >> 16) & 255) / 255.0f;
|
||||
i = ((cl >> 24) & 255) * CONSTANTLIGHT_RADIUS_SCALE;
|
||||
if (cent->currentState.renderfx & RF_LIGHTSTYLE_DLIGHT) {
|
||||
float color[4];
|
||||
|
||||
CG_LightStyleColor( style, cg.time, color, qfalse );
|
||||
r = color[ 0 ];
|
||||
g = color[ 1 ];
|
||||
b = color[ 2 ];
|
||||
i *= color[ 3 ];
|
||||
}
|
||||
if ( i )
|
||||
{
|
||||
int flags;
|
||||
CG_LightStyleColor(style, cg.time, color, qfalse);
|
||||
r = color[0];
|
||||
g = color[1];
|
||||
b = color[2];
|
||||
i *= color[3];
|
||||
}
|
||||
if (i) {
|
||||
int flags;
|
||||
|
||||
flags = 0;
|
||||
if ( cent->currentState.renderfx & RF_LENSFLARE )
|
||||
{
|
||||
flags |= lensflare;
|
||||
flags = 0;
|
||||
if (cent->currentState.renderfx & RF_LENSFLARE) {
|
||||
flags |= lensflare;
|
||||
} else if (cent->currentState.renderfx & RF_VIEWLENSFLARE) {
|
||||
flags |= viewlensflare;
|
||||
}
|
||||
else if ( cent->currentState.renderfx & RF_VIEWLENSFLARE )
|
||||
{
|
||||
flags |= viewlensflare;
|
||||
if (cent->currentState.renderfx & RF_ADDITIVE_DLIGHT) {
|
||||
flags |= additive;
|
||||
}
|
||||
if ( cent->currentState.renderfx & RF_ADDITIVE_DLIGHT )
|
||||
{
|
||||
flags |= additive;
|
||||
}
|
||||
cgi.R_AddLightToScene( cent->lerpOrigin, i, r, g, b, flags );
|
||||
}
|
||||
if ( r < cent->color[ 0 ] )
|
||||
cent->color[ 0 ] = r;
|
||||
if ( g < cent->color[ 1 ] )
|
||||
cent->color[ 1 ] = g;
|
||||
if ( b < cent->color[ 2 ] )
|
||||
cent->color[ 2 ] = b;
|
||||
}
|
||||
}
|
||||
cgi.R_AddLightToScene(cent->lerpOrigin, i, r, g, b, flags);
|
||||
}
|
||||
if (r < cent->color[0]) {
|
||||
cent->color[0] = r;
|
||||
}
|
||||
if (g < cent->color[1]) {
|
||||
cent->color[1] = g;
|
||||
}
|
||||
if (b < cent->color[2]) {
|
||||
cent->color[2] = b;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
==================
|
||||
CG_General
|
||||
==================
|
||||
*/
|
||||
void CG_General( centity_t *cent ) {
|
||||
refEntity_t ent;
|
||||
entityState_t *s1;
|
||||
int i;
|
||||
vec3_t vMins, vMaxs, vTmp;
|
||||
void CG_General(centity_t *cent)
|
||||
{
|
||||
refEntity_t ent;
|
||||
entityState_t *s1;
|
||||
int i;
|
||||
vec3_t vMins, vMaxs, vTmp;
|
||||
|
||||
s1 = ¢->currentState;
|
||||
s1 = ¢->currentState;
|
||||
|
||||
// add loop sound
|
||||
if ( s1->loopSound )
|
||||
{
|
||||
cgi.S_AddLoopingSound( cent->lerpOrigin, vec3_origin, cgs.sound_precache[s1->loopSound], s1->loopSoundVolume, s1->loopSoundMinDist, s1->loopSoundMaxDist, s1->loopSoundPitch, s1->loopSoundFlags );
|
||||
}
|
||||
if ( cent->tikiLoopSound )
|
||||
cgi.S_AddLoopingSound( cent->lerpOrigin, vec3_origin, cent->tikiLoopSound, cent->tikiLoopSoundVolume, cent->tikiLoopSoundMinDist, cent->tikiLoopSoundMaxDist, cent->tikiLoopSoundPitch, cent->tikiLoopSoundFlags );
|
||||
// add loop sound
|
||||
if (s1->loopSound) {
|
||||
cgi.S_AddLoopingSound(
|
||||
cent->lerpOrigin,
|
||||
vec3_origin,
|
||||
cgs.sound_precache[s1->loopSound],
|
||||
s1->loopSoundVolume,
|
||||
s1->loopSoundMinDist,
|
||||
s1->loopSoundMaxDist,
|
||||
s1->loopSoundPitch,
|
||||
s1->loopSoundFlags
|
||||
);
|
||||
}
|
||||
if (cent->tikiLoopSound) {
|
||||
cgi.S_AddLoopingSound(
|
||||
cent->lerpOrigin,
|
||||
vec3_origin,
|
||||
cent->tikiLoopSound,
|
||||
cent->tikiLoopSoundVolume,
|
||||
cent->tikiLoopSoundMinDist,
|
||||
cent->tikiLoopSoundMaxDist,
|
||||
cent->tikiLoopSoundPitch,
|
||||
cent->tikiLoopSoundFlags
|
||||
);
|
||||
}
|
||||
|
||||
// if set to invisible, skip
|
||||
if (!s1->modelindex) {
|
||||
return;
|
||||
}
|
||||
if (s1->renderfx & RF_SKYORIGIN) {
|
||||
AnglesToAxis(cent->lerpAngles, cg.sky_axis);
|
||||
VectorCopy(cent->lerpOrigin, cg.sky_origin);
|
||||
}
|
||||
|
||||
memset (&ent, 0, sizeof(ent));
|
||||
// if set to invisible, skip
|
||||
if (!s1->modelindex) {
|
||||
return;
|
||||
}
|
||||
|
||||
// set frame
|
||||
if (s1->renderfx & RF_DONTDRAW) {
|
||||
return;
|
||||
}
|
||||
|
||||
ent.wasframe = s1->wasframe;
|
||||
memset(&ent, 0, sizeof(ent));
|
||||
|
||||
VectorCopy( cent->lerpOrigin, ent.origin);
|
||||
VectorCopy( cent->lerpOrigin, ent.oldorigin);
|
||||
// set frame
|
||||
|
||||
// set skin
|
||||
IntegerToBoundingBox(s1->solid, vMins, vMaxs);
|
||||
VectorSubtract(vMins, vMaxs, vTmp);
|
||||
ent.lightingOrigin[0] = ent.origin[0] + (vMins[0] + vMaxs[0]) * 0.5;
|
||||
ent.lightingOrigin[1] = ent.origin[1] + (vMins[1] + vMaxs[1]) * 0.5;
|
||||
ent.lightingOrigin[2] = ent.origin[2] + (vMins[2] + vMaxs[2]) * 0.5;
|
||||
ent.radius = VectorLength(vTmp) * 0.5;
|
||||
ent.wasframe = s1->wasframe;
|
||||
|
||||
ent.skinNum = s1->skinNum;
|
||||
VectorCopy(cent->lerpOrigin, ent.origin);
|
||||
VectorCopy(cent->lerpOrigin, ent.oldorigin);
|
||||
|
||||
ent.hModel = cgs.model_draw[s1->modelindex];
|
||||
// set skin
|
||||
IntegerToBoundingBox(s1->solid, vMins, vMaxs);
|
||||
VectorMA(ent.origin, 0.5f, ent.lightingOrigin, ent.lightingOrigin);
|
||||
VectorSubtract(vMins, vMaxs, vTmp);
|
||||
ent.radius = VectorLength(vTmp) * 0.5;
|
||||
|
||||
// set surfaces
|
||||
memcpy( ent.surfaces, s1->surfaces, MAX_MODEL_SURFACES );
|
||||
ent.skinNum = s1->skinNum;
|
||||
|
||||
// Modulation based off the color
|
||||
for( i=0; i<3; i++ )
|
||||
ent.shaderRGBA[ i ] = cent->color[ i ] * 255;
|
||||
ent.hModel = cgs.model_draw[s1->modelindex];
|
||||
|
||||
// take the alpha from the entity if less than 1, else grab it from the client commands version
|
||||
if ( s1->alpha < 1 )
|
||||
{
|
||||
ent.shaderRGBA[ 3 ] = s1->alpha * 255;
|
||||
}
|
||||
else
|
||||
{
|
||||
ent.shaderRGBA[ 3 ] = cent->color[ 3 ] * 255;
|
||||
}
|
||||
// set surfaces
|
||||
memcpy(ent.surfaces, s1->surfaces, MAX_MODEL_SURFACES);
|
||||
|
||||
// convert angles to axis
|
||||
AnglesToAxis( cent->lerpAngles, ent.axis );
|
||||
// Modulation based off the color
|
||||
for (i = 0; i < 3; i++) {
|
||||
ent.shaderRGBA[i] = cent->color[i] * 255;
|
||||
}
|
||||
|
||||
// Interpolated state variables
|
||||
if ( cent->interpolate )
|
||||
{
|
||||
ent.scale = s1->scale + cg.frameInterpolation * ( cent->nextState.scale - cent->currentState.scale );
|
||||
}
|
||||
else
|
||||
{
|
||||
ent.scale = s1->scale;
|
||||
}
|
||||
// set the entity number
|
||||
ent.entityNumber = s1->number;
|
||||
// take the alpha from the entity if less than 1, else grab it from the client commands version
|
||||
if (s1->alpha < 1) {
|
||||
ent.shaderRGBA[3] = s1->alpha * 255;
|
||||
} else {
|
||||
ent.shaderRGBA[3] = cent->color[3] * 255;
|
||||
}
|
||||
|
||||
// copy shader specific data
|
||||
ent.shader_data[ 0 ] = s1->tag_num;
|
||||
ent.shader_data[ 1 ] = s1->skinNum;
|
||||
ent.renderfx |= s1->renderfx;
|
||||
// convert angles to axis
|
||||
AnglesToAxis(cent->lerpAngles, ent.axis);
|
||||
|
||||
if ( ent.renderfx & RF_SKYORIGIN )
|
||||
{
|
||||
memcpy( cg.sky_axis, ent.axis, sizeof( cg.sky_axis ) );
|
||||
VectorCopy( ent.origin, cg.sky_origin );
|
||||
}
|
||||
// Interpolated state variables
|
||||
if (cent->interpolate) {
|
||||
ent.scale = s1->scale + cg.frameInterpolation * (cent->nextState.scale - cent->currentState.scale);
|
||||
} else {
|
||||
ent.scale = s1->scale;
|
||||
}
|
||||
// set the entity number
|
||||
ent.entityNumber = s1->number;
|
||||
|
||||
ent.tiki = cgi.R_Model_GetHandle(cgs.model_draw[s1->modelindex]);
|
||||
ent.frameInfo[0].index = s1->frameInfo[0].index;
|
||||
ent.frameInfo[0].time = s1->frameInfo[0].time;
|
||||
ent.frameInfo[0].weight = s1->frameInfo[0].weight;
|
||||
ent.actionWeight = 1.0;
|
||||
// copy shader specific data
|
||||
ent.shader_data[0] = s1->tag_num;
|
||||
ent.shader_data[1] = s1->skinNum;
|
||||
ent.renderfx |= s1->renderfx;
|
||||
|
||||
// add to refresh list
|
||||
cgi.R_AddRefEntityToScene (&ent, ENTITYNUM_NONE);
|
||||
ent.tiki = cgi.R_Model_GetHandle(cgs.model_draw[s1->modelindex]);
|
||||
ent.frameInfo[0] = s1->frameInfo[0];
|
||||
ent.actionWeight = 1.0;
|
||||
|
||||
if (ent.tiki)
|
||||
{
|
||||
// add to refresh list
|
||||
cgi.R_AddRefEntityToScene(&ent, ENTITYNUM_NONE);
|
||||
|
||||
if (ent.tiki) {
|
||||
// update any emitter's...
|
||||
CG_UpdateEntityEmitters(s1->number, &ent, cent);
|
||||
}
|
||||
@@ -258,58 +261,57 @@ CG_Speaker
|
||||
Speaker entities can automatically play sounds
|
||||
==================
|
||||
*/
|
||||
void CG_Speaker( centity_t *cent )
|
||||
{
|
||||
if ( ! cent->currentState.clientNum ) // FIXME: use something other than clientNum...
|
||||
{
|
||||
return; // not auto triggering
|
||||
}
|
||||
void CG_Speaker(centity_t *cent)
|
||||
{
|
||||
if (!cent->currentState.clientNum) // FIXME: use something other than clientNum...
|
||||
{
|
||||
return; // not auto triggering
|
||||
}
|
||||
|
||||
if ( cg.time < cent->miscTime )
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
// FIXME
|
||||
//cgi.S_StartSound (NULL, cent->currentState.number, CHAN_ITEM, cgs.sound_precache[cent->currentState.eventParm] );
|
||||
if (cg.time < cent->miscTime) {
|
||||
return;
|
||||
}
|
||||
|
||||
// ent->s.frame = ent->wait * 10;
|
||||
// ent->s.clientNum = ent->random * 10;
|
||||
cent->miscTime = cg.time + cent->currentState.wasframe * 100 + cent->currentState.clientNum * 100 * crandom();
|
||||
}
|
||||
// FIXME
|
||||
//cgi.S_StartSound (NULL, cent->currentState.number, CHAN_ITEM, cgs.sound_precache[cent->currentState.eventParm] );
|
||||
|
||||
// ent->s.frame = ent->wait * 10;
|
||||
// ent->s.clientNum = ent->random * 10;
|
||||
cent->miscTime = cg.time + cent->currentState.wasframe * 100 + cent->currentState.clientNum * 100 * crandom();
|
||||
}
|
||||
|
||||
/*
|
||||
===============
|
||||
CG_Mover
|
||||
===============
|
||||
*/
|
||||
void CG_Mover( centity_t *cent ) {
|
||||
refEntity_t ent;
|
||||
entityState_t *s1;
|
||||
void CG_Mover(centity_t *cent)
|
||||
{
|
||||
refEntity_t ent;
|
||||
entityState_t *s1;
|
||||
|
||||
s1 = ¢->currentState;
|
||||
s1 = ¢->currentState;
|
||||
|
||||
// create the render entity
|
||||
memset (&ent, 0, sizeof(ent));
|
||||
VectorCopy( cent->lerpOrigin, ent.origin);
|
||||
VectorCopy( cent->lerpOrigin, ent.oldorigin);
|
||||
AnglesToAxis( cent->lerpAngles, ent.axis );
|
||||
// create the render entity
|
||||
memset(&ent, 0, sizeof(ent));
|
||||
VectorCopy(cent->lerpOrigin, ent.origin);
|
||||
VectorCopy(cent->lerpOrigin, ent.oldorigin);
|
||||
AnglesToAxis(cent->lerpAngles, ent.axis);
|
||||
|
||||
ent.renderfx &= ~RF_SHADOW;
|
||||
ent.renderfx &= ~RF_SHADOW;
|
||||
|
||||
// flicker between two skins (FIXME?)
|
||||
ent.skinNum = ( cg.time >> 6 ) & 1;
|
||||
// flicker between two skins (FIXME?)
|
||||
ent.skinNum = (cg.time >> 6) & 1;
|
||||
|
||||
// get the model, either as a bmodel or a modelindex
|
||||
if ( s1->solid == SOLID_BMODEL ) {
|
||||
ent.hModel = cgs.inlineDrawModel[s1->modelindex];
|
||||
} else {
|
||||
ent.hModel = cgs.model_draw[s1->modelindex];
|
||||
}
|
||||
// get the model, either as a bmodel or a modelindex
|
||||
if (s1->solid == SOLID_BMODEL) {
|
||||
ent.hModel = cgs.inlineDrawModel[s1->modelindex];
|
||||
} else {
|
||||
ent.hModel = cgs.model_draw[s1->modelindex];
|
||||
}
|
||||
|
||||
// add to refresh list
|
||||
cgi.R_AddRefEntityToScene(&ent, ENTITYNUM_NONE);
|
||||
// add to refresh list
|
||||
cgi.R_AddRefEntityToScene(&ent, ENTITYNUM_NONE);
|
||||
}
|
||||
|
||||
/*
|
||||
@@ -317,120 +319,117 @@ void CG_Mover( centity_t *cent ) {
|
||||
CG_Beam
|
||||
===============
|
||||
*/
|
||||
void CG_Beam( centity_t *cent ) {
|
||||
entityState_t *s1;
|
||||
vec3_t vz={0,0,0},origin={0,0,0};
|
||||
float modulate[4];
|
||||
int i;
|
||||
void CG_Beam(centity_t *cent)
|
||||
{
|
||||
entityState_t *s1;
|
||||
vec3_t vz = {0, 0, 0}, origin = {0, 0, 0};
|
||||
float modulate[4];
|
||||
int i;
|
||||
|
||||
s1 = ¢->currentState;
|
||||
s1 = ¢->currentState;
|
||||
|
||||
for ( i=0;i<4;i++ )
|
||||
modulate[i] = cent->color[i];
|
||||
for (i = 0; i < 4; i++) {
|
||||
modulate[i] = cent->color[i];
|
||||
}
|
||||
|
||||
if ( s1->beam_entnum != ENTITYNUM_NONE )
|
||||
{
|
||||
refEntity_t *parent;
|
||||
parent = cgi.R_GetRenderEntity( s1->beam_entnum);
|
||||
if (s1->beam_entnum != ENTITYNUM_NONE) {
|
||||
refEntity_t *parent;
|
||||
parent = cgi.R_GetRenderEntity(s1->beam_entnum);
|
||||
|
||||
if ( !parent )
|
||||
{
|
||||
cgi.DPrintf( "CG_Beam: Could not find parent entity\n" );
|
||||
return;
|
||||
}
|
||||
if (!parent) {
|
||||
cgi.DPrintf("CG_Beam: Could not find parent entity\n");
|
||||
return;
|
||||
}
|
||||
|
||||
VectorAdd( s1->origin, parent->origin, origin );
|
||||
}
|
||||
else
|
||||
{
|
||||
VectorCopy( s1->origin, origin );
|
||||
}
|
||||
VectorAdd(s1->origin, parent->origin, origin);
|
||||
} else {
|
||||
VectorCopy(s1->origin, origin);
|
||||
}
|
||||
|
||||
CG_CreateBeam( origin, // start
|
||||
vz, // dir ( auto calculated by using origin2-origin )
|
||||
s1->number, // owner number
|
||||
cgs.model_draw[s1->modelindex], //hModel
|
||||
s1->alpha, // alpha
|
||||
s1->scale, // scale
|
||||
s1->skinNum, // flags
|
||||
0, // length ( auto calculated )
|
||||
PKT_TO_BEAM_PARM( s1->surfaces[0] ) * 1000, // life
|
||||
qfalse, // don't always create the beam, just update it
|
||||
s1->origin2, // endpoint
|
||||
s1->bone_angles[0][0], // min offset
|
||||
s1->bone_angles[0][1], // max offset
|
||||
PKT_TO_BEAM_PARM( s1->surfaces[3] ), // overlap
|
||||
s1->surfaces[4], // subdivisions
|
||||
PKT_TO_BEAM_PARM( s1->surfaces[5] ) * 1000, // delay
|
||||
CG_ConfigString( CS_IMAGES + s1->tag_num ), // index for shader configstring
|
||||
modulate, // modulate color
|
||||
s1->surfaces[6], // num sphere beams
|
||||
PKT_TO_BEAM_PARM( s1->surfaces[7] ), // sphere radius
|
||||
PKT_TO_BEAM_PARM( s1->surfaces[8] ), // toggle delay
|
||||
PKT_TO_BEAM_PARM( s1->surfaces[9] ), // end alpha
|
||||
s1->renderfx,
|
||||
""
|
||||
);
|
||||
CG_CreateBeam(
|
||||
origin, // start
|
||||
vz, // dir ( auto calculated by using origin2-origin )
|
||||
s1->number, // owner number
|
||||
cgs.model_draw[s1->modelindex], //hModel
|
||||
s1->alpha, // alpha
|
||||
s1->scale, // scale
|
||||
s1->skinNum, // flags
|
||||
0, // length ( auto calculated )
|
||||
PKT_TO_BEAM_PARM(s1->surfaces[0]) * 1000, // life
|
||||
qfalse, // don't always create the beam, just update it
|
||||
s1->origin2, // endpoint
|
||||
s1->bone_angles[0][0], // min offset
|
||||
s1->bone_angles[0][1], // max offset
|
||||
PKT_TO_BEAM_PARM(s1->surfaces[3]), // overlap
|
||||
s1->surfaces[4], // subdivisions
|
||||
PKT_TO_BEAM_PARM(s1->surfaces[5]) * 1000, // delay
|
||||
CG_ConfigString(CS_IMAGES + s1->tag_num), // index for shader configstring
|
||||
modulate, // modulate color
|
||||
s1->surfaces[6], // num sphere beams
|
||||
PKT_TO_BEAM_PARM(s1->surfaces[7]), // sphere radius
|
||||
PKT_TO_BEAM_PARM(s1->surfaces[8]), // toggle delay
|
||||
PKT_TO_BEAM_PARM(s1->surfaces[9]), // end alpha
|
||||
s1->renderfx,
|
||||
""
|
||||
);
|
||||
}
|
||||
|
||||
void CG_Decal(centity_t *cent)
|
||||
|
||||
void CG_Decal
|
||||
(
|
||||
centity_t *cent
|
||||
)
|
||||
{
|
||||
qhandle_t shader;
|
||||
vec3_t dir;
|
||||
entityState_t *s1;
|
||||
|
||||
{
|
||||
qhandle_t shader;
|
||||
vec3_t dir;
|
||||
entityState_t *s1;
|
||||
s1 = ¢->currentState;
|
||||
|
||||
s1 = ¢->currentState;
|
||||
|
||||
shader = cgi.R_RegisterShader( CG_ConfigString( CS_IMAGES + s1->tag_num ) );
|
||||
ByteToDir( s1->surfaces[0], dir );
|
||||
CG_ImpactMark( shader,
|
||||
s1->origin,
|
||||
dir,
|
||||
s1->angles[2],
|
||||
cent->color[0],
|
||||
cent->color[1],
|
||||
cent->color[2],
|
||||
cent->color[3],
|
||||
qtrue,
|
||||
s1->scale,
|
||||
qfalse,
|
||||
-1,
|
||||
qfalse,
|
||||
0.f,
|
||||
0.f);
|
||||
}
|
||||
shader = cgi.R_RegisterShader(CG_ConfigString(CS_IMAGES + s1->tag_num));
|
||||
ByteToDir(s1->surfaces[0], dir);
|
||||
CG_ImpactMark(
|
||||
shader,
|
||||
s1->origin,
|
||||
dir,
|
||||
s1->angles[2],
|
||||
s1->scale,
|
||||
s1->scale,
|
||||
cent->color[0],
|
||||
cent->color[1],
|
||||
cent->color[2],
|
||||
cent->color[3],
|
||||
qtrue,
|
||||
qfalse,
|
||||
qtrue,
|
||||
qfalse,
|
||||
0.5f,
|
||||
0.5f
|
||||
);
|
||||
}
|
||||
|
||||
/*
|
||||
===============
|
||||
CG_Portal
|
||||
===============
|
||||
*/
|
||||
void CG_Portal(centity_t* cent)
|
||||
{
|
||||
}
|
||||
void CG_Portal(centity_t *cent) {}
|
||||
|
||||
/*
|
||||
================
|
||||
BG_EvaluateTrajectory
|
||||
================
|
||||
*/
|
||||
void BG_EvaluateTrajectory(const trajectory_t* tr, int atTime, const vec3_t base, vec3_t result) {
|
||||
float deltaTime;
|
||||
void BG_EvaluateTrajectory(const trajectory_t *tr, int atTime, const vec3_t base, vec3_t result)
|
||||
{
|
||||
float deltaTime;
|
||||
|
||||
if (atTime > cg_smoothClientsTime->integer + tr->trTime) {
|
||||
atTime = cg_smoothClientsTime->integer + tr->trTime;
|
||||
}
|
||||
if (atTime > cg_smoothClientsTime->integer + tr->trTime) {
|
||||
atTime = cg_smoothClientsTime->integer + tr->trTime;
|
||||
}
|
||||
|
||||
deltaTime = (float)(atTime - tr->trTime) / 1000.0;
|
||||
deltaTime = (float)(atTime - tr->trTime) / 1000.0;
|
||||
|
||||
result[0] = tr->trDelta[0] * deltaTime + base[0];
|
||||
result[1] = tr->trDelta[1] * deltaTime + base[1];
|
||||
result[2] = tr->trDelta[2] * deltaTime + base[2];
|
||||
result[0] = tr->trDelta[0] * deltaTime + base[0];
|
||||
result[1] = tr->trDelta[1] * deltaTime + base[1];
|
||||
result[2] = tr->trDelta[2] * deltaTime + base[2];
|
||||
}
|
||||
|
||||
/*
|
||||
@@ -439,17 +438,15 @@ CG_CalcEntityLerpPositions
|
||||
|
||||
===============
|
||||
*/
|
||||
void CG_CalcEntityLerpPositions( centity_t *cent )
|
||||
void CG_CalcEntityLerpPositions(centity_t *cent)
|
||||
{
|
||||
int i;
|
||||
float f;
|
||||
float f;
|
||||
|
||||
f = cg.frameInterpolation;
|
||||
|
||||
if (cent->currentState.eType == ET_PLAYER)
|
||||
{
|
||||
if (cent->currentState.number == cg.snap->ps.clientNum)
|
||||
{
|
||||
if (cent->currentState.eType == ET_PLAYER) {
|
||||
if (cent->currentState.number == cg.snap->ps.clientNum) {
|
||||
// if the player, take position from prediction
|
||||
VectorCopy(cg.predicted_player_state.origin, cent->lerpOrigin);
|
||||
for (i = 0; i < 3; i++) {
|
||||
@@ -471,28 +468,26 @@ void CG_CalcEntityLerpPositions( centity_t *cent )
|
||||
}
|
||||
|
||||
for (i = 0; i < 3; i++) {
|
||||
cent->lerpOrigin[i] = cent->currentState.origin[i] +
|
||||
f * (cent->nextState.origin[i] - cent->currentState.origin[i]);
|
||||
cent->lerpOrigin[i] =
|
||||
cent->currentState.origin[i] + f * (cent->nextState.origin[i] - cent->currentState.origin[i]);
|
||||
}
|
||||
|
||||
if (!memcmp(cent->currentState.angles, cent->nextState.angles, sizeof(vec3_t))) {
|
||||
VectorCopy(cent->currentState.angles, cent->lerpAngles);
|
||||
}
|
||||
else {
|
||||
} else {
|
||||
// use spherical interpolation using quaternions so that bound objects
|
||||
// rotate properly without gimble lock.
|
||||
SlerpQuaternion(cent->currentState.quat, cent->nextState.quat, f, quat);
|
||||
QuatToMat(quat, mat);
|
||||
MatrixToEulerAngles(mat, cent->lerpAngles);
|
||||
}
|
||||
}
|
||||
else if (cent->interpolate) {
|
||||
} else if (cent->interpolate) {
|
||||
float quat[4];
|
||||
float mat[3][3];
|
||||
|
||||
// if the entity has a valid next state, interpolate a value between the frames
|
||||
// unless it is a mover with a known start and stop
|
||||
vec3_t current, next;
|
||||
vec3_t current, next;
|
||||
|
||||
// this will linearize a sine or parabolic curve, but it is important
|
||||
// to not extrapolate player positions if more recent data is available
|
||||
@@ -505,16 +500,14 @@ void CG_CalcEntityLerpPositions( centity_t *cent )
|
||||
|
||||
if (!memcmp(cent->currentState.angles, cent->nextState.angles, sizeof(vec3_t))) {
|
||||
VectorCopy(cent->currentState.angles, cent->lerpAngles);
|
||||
}
|
||||
else {
|
||||
} else {
|
||||
// use spherical interpolation using quaternions so that bound objects
|
||||
// rotate properly without gimble lock.
|
||||
SlerpQuaternion(cent->currentState.quat, cent->nextState.quat, f, quat);
|
||||
QuatToMat(quat, mat);
|
||||
MatrixToEulerAngles(mat, cent->lerpAngles);
|
||||
}
|
||||
}
|
||||
else {
|
||||
} else {
|
||||
// just use the current frame and evaluate as best we can
|
||||
BG_EvaluateTrajectory(¢->currentState.pos, cg.time, cent->currentState.origin, cent->lerpOrigin);
|
||||
VectorCopy(cent->currentState.angles, cent->lerpAngles);
|
||||
@@ -527,7 +520,7 @@ CG_AddCEntity
|
||||
|
||||
===============
|
||||
*/
|
||||
void CG_AddCEntity(centity_t* cent)
|
||||
void CG_AddCEntity(centity_t *cent)
|
||||
{
|
||||
// event-only entities will have been dealt with already
|
||||
if (cent->currentState.eType >= ET_EVENTS) {
|
||||
@@ -558,10 +551,13 @@ void CG_AddCEntity(centity_t* cent)
|
||||
CG_ModelAnim(cent, qtrue);
|
||||
break;
|
||||
case ET_PLAYER:
|
||||
CG_Player(cent);
|
||||
CG_Player(cent);
|
||||
CG_Splash(cent);
|
||||
case ET_ITEM:
|
||||
CG_ModelAnim(cent, qfalse);
|
||||
CG_UpdateRadarClient(cent);
|
||||
break;
|
||||
case ET_ITEM:
|
||||
CG_ModelAnim(cent, qfalse);
|
||||
break;
|
||||
case ET_GENERAL:
|
||||
CG_General(cent);
|
||||
@@ -588,10 +584,10 @@ void CG_AddCEntity(centity_t* cent)
|
||||
break;
|
||||
case ET_ROPE: // skip
|
||||
CG_Rope(cent);
|
||||
break;
|
||||
case ET_EXEC_COMMANDS:
|
||||
CG_ModelAnim(cent, qfalse);
|
||||
break;
|
||||
break;
|
||||
case ET_EXEC_COMMANDS:
|
||||
CG_ModelAnim(cent, qfalse);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -601,29 +597,30 @@ CG_AddPacketEntities
|
||||
|
||||
===============
|
||||
*/
|
||||
void CG_AddPacketEntities( void ) {
|
||||
int num;
|
||||
centity_t *cent;
|
||||
int child, parent;
|
||||
qboolean processed[MAX_ENTITIES];
|
||||
int i;
|
||||
void CG_AddPacketEntities(void)
|
||||
{
|
||||
int num;
|
||||
centity_t *cent;
|
||||
int child, parent;
|
||||
qboolean processed[MAX_ENTITIES];
|
||||
int i;
|
||||
|
||||
// the auto-rotating items will all have the same axis
|
||||
cg.autoAngles[0] = 0;
|
||||
cg.autoAngles[1] = ( cg.time & 2047 ) * 360 / 2048.0;
|
||||
cg.autoAngles[2] = 0;
|
||||
// the auto-rotating items will all have the same axis
|
||||
cg.autoAngles[0] = 0;
|
||||
cg.autoAngles[1] = (cg.time & 2047) * 360 / 2048.0;
|
||||
cg.autoAngles[2] = 0;
|
||||
|
||||
cg.autoAnglesSlow[0] = 0;
|
||||
cg.autoAnglesSlow[1] = ( cg.time & 4095 ) * 360 / 4096.0f;
|
||||
cg.autoAnglesSlow[2] = 0;
|
||||
cg.autoAnglesSlow[0] = 0;
|
||||
cg.autoAnglesSlow[1] = (cg.time & 4095) * 360 / 4096.0f;
|
||||
cg.autoAnglesSlow[2] = 0;
|
||||
|
||||
cg.autoAnglesFast[0] = 0;
|
||||
cg.autoAnglesFast[1] = ( cg.time & 1023 ) * 360 / 1024.0f;
|
||||
cg.autoAnglesFast[2] = 0;
|
||||
cg.autoAnglesFast[0] = 0;
|
||||
cg.autoAnglesFast[1] = (cg.time & 1023) * 360 / 1024.0f;
|
||||
cg.autoAnglesFast[2] = 0;
|
||||
|
||||
AnglesToAxis( cg.autoAngles, cg.autoAxis );
|
||||
AnglesToAxis( cg.autoAnglesSlow, cg.autoAxisSlow );
|
||||
AnglesToAxis( cg.autoAnglesFast, cg.autoAxisFast );
|
||||
AnglesToAxis(cg.autoAngles, cg.autoAxis);
|
||||
AnglesToAxis(cg.autoAnglesSlow, cg.autoAxisSlow);
|
||||
AnglesToAxis(cg.autoAnglesFast, cg.autoAxisFast);
|
||||
|
||||
for (i = 0; i < MAX_ENTITIES; i++) {
|
||||
processed[i] = qtrue;
|
||||
@@ -636,51 +633,43 @@ void CG_AddPacketEntities( void ) {
|
||||
// add each entity sent over by the server
|
||||
for (num = 0; num < cg.snap->numEntities; num++) {
|
||||
child = cg.snap->entities[num].number;
|
||||
cent = &cg_entities[child];
|
||||
cent = &cg_entities[child];
|
||||
// add the parent first
|
||||
// so attachments are consistent
|
||||
for (parent = cent->currentState.parent;
|
||||
parent != ENTITYNUM_NONE && !processed[parent];
|
||||
parent = cg_entities[parent].currentState.parent)
|
||||
{
|
||||
for (parent = cent->currentState.parent; parent != ENTITYNUM_NONE && !processed[parent];
|
||||
parent = cg_entities[parent].currentState.parent) {
|
||||
processed[parent] = qtrue;
|
||||
CG_AddCEntity(&cg_entities[parent]);
|
||||
}
|
||||
|
||||
if (!processed[child])
|
||||
{
|
||||
if (!processed[child]) {
|
||||
// now add the children if not processed
|
||||
processed[child] = qtrue;
|
||||
CG_AddCEntity(cent);
|
||||
}
|
||||
}
|
||||
|
||||
// Add in the multibeams at the end
|
||||
for ( num = 0 ; num < cg.snap->numEntities ; num++ ) {
|
||||
cent = &cg_entities[ cg.snap->entities[ num ].number ];
|
||||
if ( cent->currentState.eType == ET_MULTIBEAM )
|
||||
CG_MultiBeam( cent );
|
||||
}
|
||||
|
||||
// Add in the multibeams at the end
|
||||
for (num = 0; num < cg.snap->numEntities; num++) {
|
||||
cent = &cg_entities[cg.snap->entities[num].number];
|
||||
if (cent->currentState.eType == ET_MULTIBEAM) {
|
||||
CG_MultiBeam(cent);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void CG_GetOrigin(centity_t* cent, vec3_t origin)
|
||||
void CG_GetOrigin(centity_t *cent, vec3_t origin)
|
||||
{
|
||||
if (cent->currentState.parent == ENTITYNUM_NONE)
|
||||
{
|
||||
if (cent->currentState.parent == ENTITYNUM_NONE) {
|
||||
VectorCopy(cent->lerpOrigin, origin);
|
||||
}
|
||||
else
|
||||
{
|
||||
} else {
|
||||
int i;
|
||||
orientation_t or;
|
||||
refEntity_t* parent;
|
||||
orientation_t or ;
|
||||
refEntity_t *parent;
|
||||
|
||||
parent = cgi.R_GetRenderEntity(cent->currentState.parent);
|
||||
|
||||
if (!parent)
|
||||
{
|
||||
cgi.DPrintf("CG_GetOrigin: Could not find parent entity\n");
|
||||
if (!parent) {
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -689,9 +678,8 @@ void CG_GetOrigin(centity_t* cent, vec3_t origin)
|
||||
|
||||
VectorCopy(parent->origin, origin);
|
||||
|
||||
for (i = 0; i < 3; i++)
|
||||
{
|
||||
VectorMA(origin, or .origin[i], parent->axis[i], origin);
|
||||
for (i = 0; i < 3; i++) {
|
||||
VectorMA(origin, or.origin[i], parent->axis[i], origin);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -25,7 +25,6 @@ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
|
||||
#include "cg_local.h"
|
||||
|
||||
|
||||
/*
|
||||
==============
|
||||
CG_EntityEvent
|
||||
@@ -34,6 +33,4 @@ An entity has an event value
|
||||
==============
|
||||
*/
|
||||
|
||||
void CG_EntityEvent( centity_t *cent, vec3_t position )
|
||||
{
|
||||
}
|
||||
void CG_EntityEvent(centity_t *cent, vec3_t position) {}
|
||||
+478
-521
File diff suppressed because it is too large.
Load diff
+810
-748
File diff suppressed because it is too large.
Load diff
+577
-471
File diff suppressed because it is too large.
Load diff
+1864
-280
File diff suppressed because it is too large.
Load diff
+766
-591
File diff suppressed because it is too large.
Load diff
+46
-57
@@ -26,22 +26,22 @@ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
#include "cg_local.h"
|
||||
#include "cg_commands.h"
|
||||
|
||||
cvar_t* cg_rain;
|
||||
cvar_t* cg_rain_drawcoverage;
|
||||
cvar_t *cg_rain;
|
||||
cvar_t *cg_rain_drawcoverage;
|
||||
|
||||
void RainTouch(ctempmodel_t* ct, trace_t* trace)
|
||||
void RainTouch(ctempmodel_t *ct, trace_t *trace)
|
||||
{
|
||||
Vector norm, neworg;
|
||||
|
||||
ct->ent.hModel = cgi.R_RegisterModel("splash_z.spr");
|
||||
ct->cgd.velocity = vec_zero;
|
||||
ct->cgd.accel = vec_zero;
|
||||
ct->killTime = cg.time + 400;
|
||||
norm = trace->plane.normal;
|
||||
norm.x = -norm.x;
|
||||
norm.y = -norm.y;
|
||||
ct->cgd.angles = norm.toAngles();
|
||||
ct->ent.scale = 0.3f;
|
||||
ct->ent.hModel = cgi.R_RegisterModel("splash_z.spr");
|
||||
ct->cgd.velocity = vec_zero;
|
||||
ct->cgd.accel = vec_zero;
|
||||
ct->killTime = cg.time + 400;
|
||||
norm = trace->plane.normal;
|
||||
norm.x = -norm.x;
|
||||
norm.y = -norm.y;
|
||||
ct->cgd.angles = norm.toAngles();
|
||||
ct->ent.scale = 0.3f;
|
||||
ct->cgd.scaleRate = 4.0;
|
||||
ct->cgd.flags |= T_FADE;
|
||||
|
||||
@@ -49,25 +49,26 @@ void RainTouch(ctempmodel_t* ct, trace_t* trace)
|
||||
VectorCopy(neworg, ct->ent.origin);
|
||||
}
|
||||
|
||||
void ClientGameCommandManager::RainTouch(Event* ev)
|
||||
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_drawcoverage = cgi.Cvar_Get("cg_rain_drawcoverage", "0", CVAR_SAVEGAME | CVAR_SERVER_CREATED | CVAR_SYSTEMINFO);
|
||||
cg_rain = cgi.Cvar_Get("cg_rain", "1", CVAR_ARCHIVE);
|
||||
cg_rain_drawcoverage =
|
||||
cgi.Cvar_Get("cg_rain_drawcoverage", "0", CVAR_SAVEGAME | CVAR_RESETSTRING | CVAR_SYSTEMINFO);
|
||||
|
||||
cg.rain.density = 0.0;
|
||||
cg.rain.speed = 2048.0f;
|
||||
cg.rain.length = 90.0f;
|
||||
cg.rain.min_dist = 512.0f;
|
||||
cg.rain.width = 1.0f;
|
||||
cg.rain.density = 0.0;
|
||||
cg.rain.speed = 2048.0f;
|
||||
cg.rain.length = 90.0f;
|
||||
cg.rain.min_dist = 512.0f;
|
||||
cg.rain.width = 1.0f;
|
||||
cg.rain.speed_vary = 512;
|
||||
cg.rain.slant = 50;
|
||||
cg.rain.slant = 50;
|
||||
|
||||
for (i = 0; i < MAX_RAIN_SHADERS; i++) {
|
||||
cg.rain.shader[i][0] = 0;
|
||||
@@ -76,19 +77,19 @@ void ClientGameCommandManager::InitializeRainCvars()
|
||||
cg.rain.numshaders = 0;
|
||||
}
|
||||
|
||||
void CG_Rain(centity_t* cent)
|
||||
void CG_Rain(centity_t *cent)
|
||||
{
|
||||
int iLife;
|
||||
vec3_t mins, maxs;
|
||||
vec3_t vOmins, vOmaxs, vOe;
|
||||
float fcolor[4];
|
||||
vec3_t vStart, vEnd;
|
||||
int iNumSpawn;
|
||||
int i;
|
||||
int iRandom;
|
||||
float fDensity;
|
||||
vec3_t vLength;
|
||||
const char* shadername;
|
||||
int iLife;
|
||||
vec3_t mins, maxs;
|
||||
vec3_t vOmins, vOmaxs, vOe;
|
||||
float fcolor[4];
|
||||
vec3_t vStart, vEnd;
|
||||
int iNumSpawn;
|
||||
int i;
|
||||
int iRandom;
|
||||
float fDensity;
|
||||
vec3_t vLength;
|
||||
const char *shadername;
|
||||
|
||||
fcolor[0] = 1.0;
|
||||
fcolor[1] = 1.0;
|
||||
@@ -133,35 +134,26 @@ void CG_Rain(centity_t* cent)
|
||||
return;
|
||||
}
|
||||
|
||||
if (cg_rain_drawcoverage->integer)
|
||||
{
|
||||
if (cg_rain_drawcoverage->integer) {
|
||||
cgi.R_DebugLine(
|
||||
Vector(vOmins[0], vOmins[1], vOmins[2]),
|
||||
Vector(vOmaxs[0], vOmins[1], vOmins[2]),
|
||||
1.0, 0.0, 0.0, 1.0
|
||||
Vector(vOmins[0], vOmins[1], vOmins[2]), Vector(vOmaxs[0], vOmins[1], vOmins[2]), 1.0, 0.0, 0.0, 1.0
|
||||
);
|
||||
|
||||
cgi.R_DebugLine(
|
||||
Vector(vOmaxs[0], vOmins[1], vOmins[2]),
|
||||
Vector(vOmaxs[0], vOmaxs[1], vOmins[2]),
|
||||
1.0, 0.0, 0.0, 1.0
|
||||
Vector(vOmaxs[0], vOmins[1], vOmins[2]), Vector(vOmaxs[0], vOmaxs[1], vOmins[2]), 1.0, 0.0, 0.0, 1.0
|
||||
);
|
||||
|
||||
cgi.R_DebugLine(
|
||||
Vector(vOmaxs[0], vOmaxs[1], vOmins[2]),
|
||||
Vector(vOmins[0], vOmaxs[1], vOmins[2]),
|
||||
1.0, 0.0, 0.0, 1.0
|
||||
Vector(vOmaxs[0], vOmaxs[1], vOmins[2]), Vector(vOmins[0], vOmaxs[1], vOmins[2]), 1.0, 0.0, 0.0, 1.0
|
||||
);
|
||||
|
||||
cgi.R_DebugLine(
|
||||
Vector(vOmins[0], vOmaxs[1], vOmins[2]),
|
||||
Vector(vOmins[0], vOmins[1], vOmins[2]),
|
||||
1.0, 0.0, 0.0, 1.0
|
||||
Vector(vOmins[0], vOmaxs[1], vOmins[2]), Vector(vOmins[0], vOmins[1], vOmins[2]), 1.0, 0.0, 0.0, 1.0
|
||||
);
|
||||
}
|
||||
|
||||
VectorSubtract(vOmaxs, vOmins, vOe);
|
||||
fDensity = cg.rain.density / 200.0;
|
||||
fDensity = cg.rain.density / 200.0;
|
||||
iNumSpawn = (int)(sqrt(vOe[0] * vOe[1]) * fDensity);
|
||||
if (iNumSpawn > MAX_BEAMS) {
|
||||
iNumSpawn = MAX_BEAMS;
|
||||
@@ -171,21 +163,18 @@ void CG_Rain(centity_t* cent)
|
||||
|
||||
if (cg.rain.numshaders) {
|
||||
shadername = cg.rain.shader[iRandom % cg.rain.numshaders];
|
||||
}
|
||||
else {
|
||||
} else {
|
||||
shadername = cg.rain.shader[0];
|
||||
}
|
||||
|
||||
for (i = 0; i < iNumSpawn; ++i)
|
||||
{
|
||||
iLife = (int)(vOe[2] / ((float)(iRandom % cg.rain.speed_vary) + cg.rain.speed) * 1000.0);
|
||||
for (i = 0; i < iNumSpawn; ++i) {
|
||||
iLife = (int)(vOe[2] / ((float)(iRandom % cg.rain.speed_vary) + cg.rain.speed) * 1000.0);
|
||||
vStart[0] = (float)(iRandom % (int)(vOe[0] + 1.0)) + vOmins[0];
|
||||
iRandom = ((214013 * iRandom + 2531011) >> 16) & 0x7FFF;
|
||||
iRandom = ((214013 * iRandom + 2531011) >> 16) & 0x7FFF;
|
||||
vStart[1] = (float)(iRandom % (int)(vOe[1] + 1.0)) + vOmins[1];
|
||||
vStart[2] = vOmaxs[2];
|
||||
|
||||
if (cg.snap)
|
||||
{
|
||||
if (cg.snap) {
|
||||
vLength[0] = cg.snap->ps.origin[0] - vStart[0];
|
||||
vLength[1] = cg.snap->ps.origin[1] - vStart[1];
|
||||
vLength[2] = 0.0;
|
||||
|
||||
+1730
-790
File diff suppressed because it is too large.
Load diff
@@ -29,9 +29,9 @@ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
void CG_AddBulletTracers();
|
||||
void CG_AddBulletImpacts();
|
||||
void CG_ParseCGMessage();
|
||||
void CG_AddBulletTracers();
|
||||
void CG_AddBulletImpacts();
|
||||
void CG_InitCGMessageAPI(clientGameExport_t *cge);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
|
||||
@@ -21,7 +21,7 @@ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
*/
|
||||
|
||||
// DESCRIPTION:
|
||||
// Player functions for the cgame
|
||||
// Player functions for the cgame
|
||||
|
||||
#include "cg_local.h"
|
||||
#include "cg_commands.h"
|
||||
@@ -42,9 +42,9 @@ CG_ResetPlayerEntity
|
||||
A player just came into view or teleported, so reset all animation info
|
||||
===============
|
||||
*/
|
||||
void CG_ResetPlayerEntity( centity_t *cent )
|
||||
void CG_ResetPlayerEntity(centity_t *cent)
|
||||
{
|
||||
cent->errorTime = -99999; // guarantee no error decay added
|
||||
cent->errorTime = -99999; // guarantee no error decay added
|
||||
cent->extrapolated = qfalse;
|
||||
|
||||
VectorCopy(cent->currentState.origin, cent->lerpOrigin);
|
||||
@@ -53,8 +53,7 @@ void CG_ResetPlayerEntity( centity_t *cent )
|
||||
VectorCopy(cent->currentState.angles, cent->lerpAngles);
|
||||
VectorCopy(cent->lerpAngles, cent->rawAngles);
|
||||
|
||||
if (cent->currentState.number == cg.snap->ps.clientNum)
|
||||
{
|
||||
if (cent->currentState.number == cg.snap->ps.clientNum) {
|
||||
// initialize the camera position
|
||||
VectorCopy(cent->lerpOrigin, cg.currentViewPos);
|
||||
// initialize the camera angles
|
||||
@@ -70,7 +69,7 @@ void CG_ResetPlayerEntity( centity_t *cent )
|
||||
CG_Player
|
||||
===============
|
||||
*/
|
||||
void CG_Player( centity_t *cent )
|
||||
{
|
||||
//CG_PlayerSplash( cent );
|
||||
}
|
||||
void CG_Player(centity_t *cent)
|
||||
{
|
||||
//CG_PlayerSplash( cent );
|
||||
}
|
||||
@@ -21,7 +21,7 @@ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
*/
|
||||
|
||||
// DESCRIPTION:
|
||||
//
|
||||
//
|
||||
// this file acts on changes in a new playerState_t.
|
||||
// With normal play, this will be done after local prediction, but when
|
||||
// following another player or playing back a demo, it will be checked
|
||||
@@ -35,8 +35,4 @@ CG_TransitionPlayerState
|
||||
|
||||
===============
|
||||
*/
|
||||
void CG_TransitionPlayerState( playerState_t *ps, playerState_t *ops )
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
void CG_TransitionPlayerState(playerState_t *ps, playerState_t *ops) {}
|
||||
+197
-110
@@ -25,14 +25,18 @@ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
// interpolating between snapshots from the server or locally predicting
|
||||
// ahead the client's movement. It also handles local physics interaction,
|
||||
// like fragments bouncing off walls
|
||||
//
|
||||
// ADDITIONS:
|
||||
// - CG_InterpolatePlayerState() footer: Interpolate the lean angles
|
||||
|
||||
#include "cg_local.h"
|
||||
|
||||
static pmove_t cg_pmove;
|
||||
|
||||
static int cg_numSolidEntities;
|
||||
static centity_t* cg_solidEntities[MAX_ENTITIES_IN_SNAPSHOT];
|
||||
static int cg_numTriggerEntities;
|
||||
static int cg_numSolidEntities;
|
||||
static centity_t *cg_solidEntities[MAX_ENTITIES_IN_SNAPSHOT];
|
||||
static int cg_numTriggerEntities;
|
||||
|
||||
// static centity_t *cg_triggerEntities[MAX_ENTITIES_IN_SNAPSHOT];
|
||||
|
||||
/*
|
||||
@@ -46,12 +50,12 @@ efficient collision detection
|
||||
*/
|
||||
void CG_BuildSolidList(void)
|
||||
{
|
||||
int i;
|
||||
centity_t* cent;
|
||||
snapshot_t* snap;
|
||||
entityState_t* ent;
|
||||
int i;
|
||||
centity_t *cent;
|
||||
snapshot_t *snap;
|
||||
entityState_t *ent;
|
||||
|
||||
cg_numSolidEntities = 0;
|
||||
cg_numSolidEntities = 0;
|
||||
cg_numTriggerEntities = 0;
|
||||
|
||||
if (cg.nextSnap && !cg.nextFrameTeleport && !cg.thisFrameTeleport) {
|
||||
@@ -62,10 +66,9 @@ void CG_BuildSolidList(void)
|
||||
|
||||
for (i = 0; i < snap->numEntities; i++) {
|
||||
cent = &cg_entities[snap->entities[i].number];
|
||||
ent = ¢->currentState;
|
||||
ent = ¢->currentState;
|
||||
|
||||
if (ent->eType == ET_ITEM || ent->eType == ET_PUSH_TRIGGER ||
|
||||
ent->eType == ET_TELEPORT_TRIGGER) {
|
||||
if (ent->eType == ET_ITEM || ent->eType == ET_PUSH_TRIGGER || ent->eType == ET_TELEPORT_TRIGGER) {
|
||||
/*
|
||||
cg_triggerEntities[cg_numTriggerEntities] = cent;
|
||||
cg_numTriggerEntities++;
|
||||
@@ -81,29 +84,71 @@ void CG_BuildSolidList(void)
|
||||
}
|
||||
}
|
||||
|
||||
int CG_GetBrushEntitiesInBounds(int iMaxEnts, centity_t** pEntList, const vec3_t vMins, const vec3_t vMaxs)
|
||||
{
|
||||
int i;
|
||||
int iEntCount;
|
||||
clipHandle_t cmodel;
|
||||
vec3_t vEntMins, vEntMaxs;
|
||||
centity_t* cent;
|
||||
|
||||
iEntCount = 0;
|
||||
for (i = 0; i < cg_numSolidEntities; i++) {
|
||||
cent = cg_solidEntities[i];
|
||||
if (cent->currentState.solid != SOLID_BMODEL) {
|
||||
continue;
|
||||
}
|
||||
|
||||
cmodel = cgi.CM_InlineModel(cent->currentState.modelindex);
|
||||
cgi.R_GetInlineModelBounds(cmodel, vEntMins, vEntMaxs);
|
||||
if (cent->lerpAngles[0] || cent->lerpAngles[1] || cent->lerpAngles[2]) {
|
||||
CalculateRotatedBounds(cent->lerpAngles, vEntMins, vEntMaxs);
|
||||
}
|
||||
|
||||
VectorAdd(vEntMins, cent->lerpOrigin, vEntMins);
|
||||
VectorAdd(vEntMaxs, cent->lerpOrigin, vEntMaxs);
|
||||
|
||||
if (vEntMins[0] <= vMaxs[0] && vEntMaxs[0] >= vMins[0]
|
||||
&& vEntMins[1] <= vMaxs[1] && vEntMaxs[1] >= vMins[1]
|
||||
&& vEntMins[2] <= vMaxs[2] && vEntMaxs[2] >= vMins[2]) {
|
||||
pEntList[iEntCount++] = cent;
|
||||
if (iEntCount >= iMaxEnts) {
|
||||
return iEntCount;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return iEntCount;
|
||||
}
|
||||
|
||||
/*
|
||||
====================
|
||||
CG_ClipMoveToEntities
|
||||
|
||||
====================
|
||||
*/
|
||||
void CG_ClipMoveToEntities(const vec3_t start, const vec3_t mins,
|
||||
const vec3_t maxs, const vec3_t end,
|
||||
int skipNumber, int mask, trace_t* tr,
|
||||
qboolean cylinder)
|
||||
|
||||
void CG_ClipMoveToEntities(
|
||||
const vec3_t start,
|
||||
const vec3_t mins,
|
||||
const vec3_t maxs,
|
||||
const vec3_t end,
|
||||
int skipNumber,
|
||||
int mask,
|
||||
trace_t *tr,
|
||||
qboolean cylinder
|
||||
)
|
||||
{
|
||||
int i;
|
||||
trace_t trace;
|
||||
entityState_t* ent;
|
||||
clipHandle_t cmodel;
|
||||
vec3_t bmins, bmaxs;
|
||||
vec3_t origin, angles;
|
||||
centity_t* cent;
|
||||
int i;
|
||||
trace_t trace;
|
||||
entityState_t *ent;
|
||||
clipHandle_t cmodel;
|
||||
vec3_t bmins, bmaxs;
|
||||
vec3_t origin, angles;
|
||||
centity_t *cent;
|
||||
|
||||
for (i = 0; i < cg_numSolidEntities; i++) {
|
||||
cent = cg_solidEntities[i];
|
||||
ent = ¢->currentState;
|
||||
ent = ¢->currentState;
|
||||
|
||||
if (ent->number == skipNumber) {
|
||||
continue;
|
||||
@@ -117,42 +162,44 @@ void CG_ClipMoveToEntities(const vec3_t start, const vec3_t mins,
|
||||
}
|
||||
} else {
|
||||
IntegerToBoundingBox(ent->solid, bmins, bmaxs);
|
||||
cmodel = cgi.CM_TempBoxModel(
|
||||
bmins, bmaxs,
|
||||
CONTENTS_BBOX);
|
||||
cmodel = cgi.CM_TempBoxModel(bmins, bmaxs, CONTENTS_BBOX);
|
||||
}
|
||||
|
||||
VectorCopy(cent->lerpOrigin, origin);
|
||||
if (ent->eFlags & EF_LINKANGLES) {
|
||||
VectorCopy(cent->lerpAngles, angles);
|
||||
}
|
||||
else {
|
||||
} else {
|
||||
VectorClear(angles);
|
||||
}
|
||||
|
||||
cgi.CM_TransformedBoxTrace(&trace, start, end, mins, maxs, cmodel, mask,
|
||||
origin, angles, cylinder);
|
||||
cgi.CM_TransformedBoxTrace(&trace, start, end, mins, maxs, cmodel, mask, origin, angles, cylinder);
|
||||
|
||||
if (trace.allsolid || trace.fraction < tr->fraction) {
|
||||
trace.entityNum = ent->number;
|
||||
*tr = trace;
|
||||
*tr = trace;
|
||||
} else if (trace.startsolid) {
|
||||
tr->startsolid = qtrue;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void CG_ShowTrace(trace_t* trace, int passent, const char* reason)
|
||||
|
||||
void CG_ShowTrace(trace_t *trace, int passent, const char *reason)
|
||||
{
|
||||
char text[1024];
|
||||
|
||||
assert(reason);
|
||||
assert(trace);
|
||||
|
||||
sprintf(text, "%0.2f : Pass (%d) Frac %f Hit (%d): '%s'\n",
|
||||
(float)cg.time / 1000.0f, passent, trace->fraction,
|
||||
trace->entityNum, reason ? reason : "");
|
||||
Com_sprintf(
|
||||
text,
|
||||
sizeof(text),
|
||||
"%0.2f : Pass (%d) Frac %f Hit (%d): '%s'\n",
|
||||
(float)cg.time / 1000.0f,
|
||||
passent,
|
||||
trace->fraction,
|
||||
trace->entityNum,
|
||||
reason ? reason : ""
|
||||
);
|
||||
|
||||
if (cg_traceinfo->integer == 3) {
|
||||
cgi.DebugPrintf(text);
|
||||
@@ -166,11 +213,18 @@ void CG_ShowTrace(trace_t* trace, int passent, const char* reason)
|
||||
CG_Trace
|
||||
================
|
||||
*/
|
||||
void CG_Trace(trace_t* result, const vec3_t start, const vec3_t mins,
|
||||
const vec3_t maxs, const vec3_t end, int skipNumber, int mask,
|
||||
qboolean cylinder, qboolean cliptoentities,
|
||||
const char* description)
|
||||
|
||||
void CG_Trace(
|
||||
trace_t *result,
|
||||
const vec3_t start,
|
||||
const vec3_t mins,
|
||||
const vec3_t maxs,
|
||||
const vec3_t end,
|
||||
int skipNumber,
|
||||
int mask,
|
||||
qboolean cylinder,
|
||||
qboolean cliptoentities,
|
||||
const char *description
|
||||
)
|
||||
{
|
||||
trace_t t;
|
||||
|
||||
@@ -185,8 +239,7 @@ void CG_Trace(trace_t* result, const vec3_t start, const vec3_t mins,
|
||||
|
||||
if (cliptoentities) {
|
||||
// check all other solid models
|
||||
CG_ClipMoveToEntities(start, mins, maxs, end, skipNumber, mask, &t,
|
||||
cylinder);
|
||||
CG_ClipMoveToEntities(start, mins, maxs, end, skipNumber, mask, &t, cylinder);
|
||||
}
|
||||
|
||||
*result = t;
|
||||
@@ -201,13 +254,19 @@ void CG_Trace(trace_t* result, const vec3_t start, const vec3_t mins,
|
||||
CG_PlayerTrace
|
||||
================
|
||||
*/
|
||||
void CG_PlayerTrace(trace_t* result, const vec3_t start, const vec3_t mins,
|
||||
const vec3_t maxs, const vec3_t end, int skipNumber,
|
||||
int mask, qboolean cylinder, qboolean tracedeep)
|
||||
|
||||
void CG_PlayerTrace(
|
||||
trace_t *result,
|
||||
const vec3_t start,
|
||||
const vec3_t mins,
|
||||
const vec3_t maxs,
|
||||
const vec3_t end,
|
||||
int skipNumber,
|
||||
int mask,
|
||||
qboolean cylinder,
|
||||
qboolean tracedeep
|
||||
)
|
||||
{
|
||||
CG_Trace(result, start, mins, maxs, end, skipNumber, mask, cylinder, qtrue,
|
||||
"PlayerTrace");
|
||||
CG_Trace(result, start, mins, maxs, end, skipNumber, mask, cylinder, qtrue, "PlayerTrace");
|
||||
}
|
||||
|
||||
/*
|
||||
@@ -217,11 +276,11 @@ CG_PointContents
|
||||
*/
|
||||
int CG_PointContents(const vec3_t point, int passEntityNum)
|
||||
{
|
||||
int i;
|
||||
entityState_t* ent;
|
||||
centity_t* cent;
|
||||
clipHandle_t cmodel;
|
||||
int contents;
|
||||
int i;
|
||||
entityState_t *ent;
|
||||
centity_t *cent;
|
||||
clipHandle_t cmodel;
|
||||
int contents;
|
||||
|
||||
contents = cgi.CM_PointContents(point, 0);
|
||||
|
||||
@@ -243,8 +302,7 @@ int CG_PointContents(const vec3_t point, int passEntityNum)
|
||||
continue;
|
||||
}
|
||||
|
||||
contents |= cgi.CM_TransformedPointContents(point, cmodel, ent->origin,
|
||||
ent->angles);
|
||||
contents |= cgi.CM_TransformedPointContents(point, cmodel, ent->origin, ent->angles);
|
||||
}
|
||||
|
||||
return contents;
|
||||
@@ -260,8 +318,8 @@ cg.snap->player_state and cg.nextFrame->player_state
|
||||
*/
|
||||
static void CG_InterpolatePlayerStateCamera(void)
|
||||
{
|
||||
float f;
|
||||
int i;
|
||||
float f;
|
||||
int i;
|
||||
snapshot_t *prev, *next;
|
||||
|
||||
prev = cg.snap;
|
||||
@@ -283,8 +341,7 @@ static void CG_InterpolatePlayerStateCamera(void)
|
||||
return;
|
||||
}
|
||||
|
||||
f = (float)(cg.time - prev->serverTime) /
|
||||
(next->serverTime - prev->serverTime);
|
||||
f = (float)(cg.time - prev->serverTime) / (next->serverTime - prev->serverTime);
|
||||
|
||||
// interpolate fov
|
||||
cg.camera_fov = prev->ps.fov + f * (next->ps.fov - prev->ps.fov);
|
||||
@@ -293,12 +350,16 @@ static void CG_InterpolatePlayerStateCamera(void)
|
||||
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);
|
||||
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);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -312,12 +373,12 @@ cg.snap->player_state and cg.nextFrame->player_state
|
||||
*/
|
||||
static void CG_InterpolatePlayerState(qboolean grabAngles)
|
||||
{
|
||||
float f;
|
||||
int i;
|
||||
playerState_t* out;
|
||||
snapshot_t *prev, *next;
|
||||
float f;
|
||||
int i;
|
||||
playerState_t *out;
|
||||
snapshot_t *prev, *next;
|
||||
|
||||
out = &cg.predicted_player_state;
|
||||
out = &cg.predicted_player_state;
|
||||
prev = cg.snap;
|
||||
next = cg.nextSnap;
|
||||
|
||||
@@ -329,7 +390,7 @@ static void CG_InterpolatePlayerState(qboolean grabAngles)
|
||||
// if we are still allowing local input, short circuit the view angles
|
||||
if (grabAngles) {
|
||||
usercmd_t cmd;
|
||||
int cmdNum;
|
||||
int cmdNum;
|
||||
|
||||
cmdNum = cgi.GetCurrentCmdNumber();
|
||||
cgi.GetUserCmd(cmdNum, &cmd);
|
||||
@@ -349,15 +410,15 @@ static void CG_InterpolatePlayerState(qboolean grabAngles)
|
||||
f = cg.frameInterpolation;
|
||||
|
||||
for (i = 0; i < 3; i++) {
|
||||
out->origin[i] =
|
||||
prev->ps.origin[i] + f * (next->ps.origin[i] - prev->ps.origin[i]);
|
||||
out->origin[i] = prev->ps.origin[i] + f * (next->ps.origin[i] - prev->ps.origin[i]);
|
||||
if (!grabAngles) {
|
||||
out->viewangles[i] =
|
||||
LerpAngle(prev->ps.viewangles[i], next->ps.viewangles[i], f);
|
||||
out->viewangles[i] = LerpAngle(prev->ps.viewangles[i], next->ps.viewangles[i], f);
|
||||
}
|
||||
out->velocity[i] = prev->ps.velocity[i] +
|
||||
f * (next->ps.velocity[i] - prev->ps.velocity[i]);
|
||||
out->velocity[i] = prev->ps.velocity[i] + f * (next->ps.velocity[i] - prev->ps.velocity[i]);
|
||||
}
|
||||
|
||||
// interpolate the lean angle
|
||||
out->fLeanAngle = LerpAngle(prev->ps.fLeanAngle, next->ps.fLeanAngle, f);
|
||||
}
|
||||
|
||||
/*
|
||||
@@ -388,10 +449,10 @@ to ease the jerk.
|
||||
*/
|
||||
void CG_PredictPlayerState(void)
|
||||
{
|
||||
int cmdNum, current;
|
||||
int cmdNum, current;
|
||||
playerState_t oldPlayerState;
|
||||
qboolean moved;
|
||||
usercmd_t latestCmd;
|
||||
qboolean moved;
|
||||
usercmd_t latestCmd;
|
||||
|
||||
cg.hyperspace = qfalse; // will be set if touching a trigger_teleport
|
||||
|
||||
@@ -399,13 +460,12 @@ void CG_PredictPlayerState(void)
|
||||
// predicted_player_state is valid even if there is some
|
||||
// other error condition
|
||||
if (!cg.validPPS) {
|
||||
cg.validPPS = qtrue;
|
||||
cg.validPPS = qtrue;
|
||||
cg.predicted_player_state = cg.snap->ps;
|
||||
}
|
||||
|
||||
// demo playback just copies the moves
|
||||
if (cg.demoPlayback || (cg.snap->ps.pm_flags & PMF_NO_PREDICTION) ||
|
||||
(cg.snap->ps.pm_flags & PMF_FROZEN)) {
|
||||
if (cg.demoPlayback || (cg.snap->ps.pm_flags & PMF_NO_PREDICTION) || (cg.snap->ps.pm_flags & PMF_FROZEN)) {
|
||||
CG_InterpolatePlayerState(qfalse);
|
||||
return;
|
||||
}
|
||||
@@ -414,15 +474,14 @@ void CG_PredictPlayerState(void)
|
||||
// FIXME
|
||||
// Noclip is jittery for some reason, so I'm disabling prediction while
|
||||
// noclipping
|
||||
if (cg_nopredict->integer || cg_synchronousClients->integer ||
|
||||
(cg.snap->ps.pm_type == PM_NOCLIP)) {
|
||||
if (cg_nopredict->integer || cg_synchronousClients->integer || (cg.snap->ps.pm_type == PM_NOCLIP)) {
|
||||
CG_InterpolatePlayerState(qtrue);
|
||||
return;
|
||||
}
|
||||
|
||||
// prepare for pmove
|
||||
cg_pmove.ps = &cg.predicted_player_state;
|
||||
cg_pmove.trace = CG_PlayerTrace;
|
||||
cg_pmove.ps = &cg.predicted_player_state;
|
||||
cg_pmove.trace = CG_PlayerTrace;
|
||||
cg_pmove.pointcontents = CG_PointContents;
|
||||
|
||||
if (cg_pmove.ps->pm_type == PM_DEAD) {
|
||||
@@ -432,6 +491,29 @@ void CG_PredictPlayerState(void)
|
||||
}
|
||||
|
||||
cg_pmove.noFootsteps = (cgs.dmflags & DF_NO_FOOTSTEPS) > 0;
|
||||
if (cg_protocol >= PROTOCOL_MOHTA_MIN) {
|
||||
// Leaning while moving is allowed in mohta and mohtt only with a specific dm flag bit set
|
||||
cg_pmove.alwaysAllowLean = (cgs.dmflags & DF_ALLOW_LEAN_MOVEMENT) ? qtrue : qfalse;
|
||||
|
||||
cg_pmove.leanMax = 45.f;
|
||||
cg_pmove.leanAdd = 6.f;
|
||||
cg_pmove.leanRecoverSpeed = 8.5f;
|
||||
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;
|
||||
}
|
||||
|
||||
cg_pmove.protocol = cg_protocol;
|
||||
|
||||
// save the state before the pmove so we can detect transitions
|
||||
oldPlayerState = cg.predicted_player_state;
|
||||
@@ -446,26 +528,28 @@ 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;
|
||||
cg.physicsTime = cg.nextSnap->serverTime;
|
||||
} else {
|
||||
cg.predicted_player_state = cg.snap->ps;
|
||||
cg.physicsTime = cg.snap->serverTime;
|
||||
cg.physicsTime = cg.snap->serverTime;
|
||||
}
|
||||
|
||||
if (pmove_msec->integer >= 8)
|
||||
{
|
||||
if (pmove_msec->integer > 33)
|
||||
if (pmove_msec->integer >= 8) {
|
||||
if (pmove_msec->integer > 33) {
|
||||
cgi.Cvar_Set("pmove_msec", "33");
|
||||
}
|
||||
else
|
||||
{
|
||||
}
|
||||
} else {
|
||||
cgi.Cvar_Set("pmove_msec", "8");
|
||||
}
|
||||
|
||||
cg_pmove.pmove_fixed = pmove_fixed->integer;
|
||||
cg_pmove.pmove_msec = pmove_msec->integer;
|
||||
cg_pmove.pmove_msec = pmove_msec->integer;
|
||||
|
||||
// run cmds
|
||||
moved = qfalse;
|
||||
@@ -492,9 +576,7 @@ void CG_PredictPlayerState(void)
|
||||
// from the snapshot, but on a wan we will have
|
||||
// to predict several commands to get to the point
|
||||
// we want to compare
|
||||
if (cg.predicted_player_state.commandTime ==
|
||||
oldPlayerState.commandTime) {
|
||||
|
||||
if (cg.predicted_player_state.commandTime == oldPlayerState.commandTime) {
|
||||
if (cg.thisFrameTeleport) {
|
||||
// a teleport will not cause an error decay
|
||||
VectorClear(cg.predictedError);
|
||||
@@ -508,13 +590,12 @@ void CG_PredictPlayerState(void)
|
||||
// if our feet are falling, don't try to move
|
||||
if (cg_pmove.ps->feetfalling && (cg_pmove.waterlevel < 2)) {
|
||||
cg_pmove.cmd.forwardmove = 0;
|
||||
cg_pmove.cmd.rightmove = 0;
|
||||
cg_pmove.cmd.rightmove = 0;
|
||||
}
|
||||
|
||||
if (cg_pmove.pmove_fixed) {
|
||||
cg_pmove.cmd.serverTime = pmove_msec->integer
|
||||
* ((cg_pmove.cmd.serverTime + pmove_msec->integer - 1)
|
||||
/ pmove_msec->integer);
|
||||
cg_pmove.cmd.serverTime =
|
||||
pmove_msec->integer * ((cg_pmove.cmd.serverTime + pmove_msec->integer - 1) / pmove_msec->integer);
|
||||
}
|
||||
|
||||
Pmove(&cg_pmove);
|
||||
@@ -534,8 +615,8 @@ void CG_PredictPlayerState(void)
|
||||
|
||||
// Interpolate the player position
|
||||
if (cg.predicted_player_state.groundEntityNum != ENTITYNUM_WORLD) {
|
||||
centity_t* cent;
|
||||
vec3_t offset;
|
||||
centity_t *cent;
|
||||
vec3_t offset;
|
||||
|
||||
cent = &cg_entities[cg.predicted_player_state.groundEntityNum];
|
||||
|
||||
@@ -544,9 +625,15 @@ void CG_PredictPlayerState(void)
|
||||
|
||||
f = cg.frameInterpolation - 1.0;
|
||||
|
||||
offset[0] = (cent->nextState.origin[0] - cg_entities[cg.predicted_player_state.groundEntityNum].currentState.origin[0]) * f;
|
||||
offset[1] = (cent->nextState.origin[1] - cg_entities[cg.predicted_player_state.groundEntityNum].currentState.origin[1]) * f;
|
||||
offset[2] = (cent->nextState.origin[2] - cg_entities[cg.predicted_player_state.groundEntityNum].currentState.origin[2]) * f;
|
||||
offset[0] = (cent->nextState.origin[0]
|
||||
- cg_entities[cg.predicted_player_state.groundEntityNum].currentState.origin[0])
|
||||
* f;
|
||||
offset[1] = (cent->nextState.origin[1]
|
||||
- cg_entities[cg.predicted_player_state.groundEntityNum].currentState.origin[1])
|
||||
* f;
|
||||
offset[2] = (cent->nextState.origin[2]
|
||||
- cg_entities[cg.predicted_player_state.groundEntityNum].currentState.origin[2])
|
||||
* f;
|
||||
|
||||
cg.predicted_player_state.origin[0] += offset[0];
|
||||
cg.predicted_player_state.origin[1] += offset[1];
|
||||
|
||||
+426
-317
@@ -23,62 +23,60 @@ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
// DESCRIPTION:
|
||||
// client game public interfaces
|
||||
|
||||
#ifndef __CG_PUBLIC_H__
|
||||
#define __CG_PUBLIC_H__
|
||||
#pragma once
|
||||
|
||||
#include "../renderercommon/tr_types.h"
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C"
|
||||
{
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
#define MAGIC_UNUSED_NUMBER 7777
|
||||
#define CMD_BACKUP 128
|
||||
#define CMD_MASK (CMD_BACKUP - 1)
|
||||
// allow a lot of command backups for very fast systems
|
||||
// multiple commands may be combined into a single packet, so this
|
||||
// needs to be larger than PACKET_BACKUP
|
||||
#define MAGIC_UNUSED_NUMBER 7777
|
||||
#define CMD_BACKUP 128
|
||||
#define CMD_MASK (CMD_BACKUP - 1)
|
||||
// allow a lot of command backups for very fast systems
|
||||
// multiple commands may be combined into a single packet, so this
|
||||
// needs to be larger than PACKET_BACKUP
|
||||
|
||||
#define MAX_ENTITIES_IN_SNAPSHOT 1024
|
||||
|
||||
#define MAX_ENTITIES_IN_SNAPSHOT 1024
|
||||
// snapshots are a view of the server at a given time
|
||||
|
||||
// snapshots are a view of the server at a given time
|
||||
// Snapshots are generated at regular time intervals by the server,
|
||||
// but they may not be sent if a client's rate level is exceeded, or
|
||||
// they may be dropped by the network.
|
||||
typedef struct {
|
||||
int snapFlags; // SNAPFLAG_RATE_DELAYED, etc
|
||||
int ping;
|
||||
|
||||
// Snapshots are generated at regular time intervals by the server,
|
||||
// but they may not be sent if a client's rate level is exceeded, or
|
||||
// they may be dropped by the network.
|
||||
typedef struct {
|
||||
int snapFlags; // SNAPFLAG_RATE_DELAYED, etc
|
||||
int ping;
|
||||
int serverTime; // server time the message is valid for (in msec)
|
||||
|
||||
int serverTime; // server time the message is valid for (in msec)
|
||||
byte areamask[MAX_MAP_AREA_BYTES]; // portalarea visibility bits
|
||||
|
||||
byte areamask[MAX_MAP_AREA_BYTES]; // portalarea visibility bits
|
||||
playerState_t ps; // complete information about the current player at this time
|
||||
|
||||
playerState_t ps; // complete information about the current player at this time
|
||||
int numEntities; // all of the entities that need to be presented
|
||||
entityState_t entities[MAX_ENTITIES_IN_SNAPSHOT]; // at the time of this snapshot
|
||||
|
||||
int numEntities; // all of the entities that need to be presented
|
||||
entityState_t entities[MAX_ENTITIES_IN_SNAPSHOT]; // at the time of this snapshot
|
||||
int numServerCommands; // text based server commands to execute when this
|
||||
int serverCommandSequence; // snapshot becomes current
|
||||
|
||||
int numServerCommands; // text based server commands to execute when this
|
||||
int serverCommandSequence; // snapshot becomes current
|
||||
int number_of_sounds;
|
||||
server_sound_t sounds[MAX_SERVER_SOUNDS];
|
||||
} snapshot_t;
|
||||
|
||||
int number_of_sounds;
|
||||
server_sound_t sounds[ MAX_SERVER_SOUNDS ];
|
||||
} snapshot_t;
|
||||
typedef struct stopWatch_s {
|
||||
int iStartTime;
|
||||
int iEndTime;
|
||||
int eType;
|
||||
} stopWatch_t;
|
||||
|
||||
typedef struct stopWatch_s
|
||||
{
|
||||
int iStartTime;
|
||||
int iEndTime;
|
||||
typedef struct AliasList_s AliasList_t;
|
||||
typedef struct AliasListNode_s AliasListNode_t;
|
||||
typedef struct dtiki_s dtiki_t;
|
||||
typedef struct tiki_cmd_s tiki_cmd_t;
|
||||
|
||||
} stopWatch_t;
|
||||
|
||||
typedef struct AliasList_s AliasList_t;
|
||||
typedef struct AliasListNode_s AliasListNode_t;
|
||||
typedef struct dtiki_s dtiki_t;
|
||||
typedef struct tiki_cmd_s tiki_cmd_t;
|
||||
|
||||
/*
|
||||
/*
|
||||
==================================================================
|
||||
|
||||
functions imported from the main executable
|
||||
@@ -86,9 +84,9 @@ functions imported from the main executable
|
||||
==================================================================
|
||||
*/
|
||||
|
||||
#define CGAME_IMPORT_API_VERSION 3
|
||||
#define CGAME_IMPORT_API_VERSION 3
|
||||
|
||||
/*
|
||||
/*
|
||||
==================================================================
|
||||
|
||||
functions exported to the main executable
|
||||
@@ -96,274 +94,355 @@ functions exported to the main executable
|
||||
==================================================================
|
||||
*/
|
||||
|
||||
typedef struct
|
||||
{
|
||||
int apiversion;
|
||||
|
||||
//============== general services ==================
|
||||
typedef struct {
|
||||
int apiversion;
|
||||
|
||||
// print message on the local console
|
||||
void (*Printf)( const char *fmt, ...);
|
||||
void (*DPrintf)( const char *fmt, ...);
|
||||
void (*DebugPrintf)( const char *fmt, ...);
|
||||
//============== general services ==================
|
||||
|
||||
// managed memory allocation
|
||||
void *(*Malloc)( int size );
|
||||
void (*Free)( void *block );
|
||||
// print message on the local console
|
||||
void (*Printf)(const char *fmt, ...);
|
||||
void (*DPrintf)(const char *fmt, ...);
|
||||
void (*DebugPrintf)(const char *fmt, ...);
|
||||
|
||||
// abort the game
|
||||
void (*Error)( int errorLevel, const char *fmt, ...);
|
||||
// managed memory allocation
|
||||
void *(*Malloc)(int size);
|
||||
void (*Free)(void *block);
|
||||
|
||||
// milliseconds should only be used for profiling, never
|
||||
// for anything game related. Get time from CG_ReadyToBuildScene.
|
||||
int (*Milliseconds)( void );
|
||||
// abort the game
|
||||
void (*Error)(int errorLevel, const char *fmt, ...);
|
||||
|
||||
// localization
|
||||
const char* (*LV_ConvertString)(const char* string);
|
||||
// milliseconds should only be used for profiling, never
|
||||
// for anything game related. Get time from CG_ReadyToBuildScene.
|
||||
int (*Milliseconds)(void);
|
||||
|
||||
// console variable interaction
|
||||
cvar_t * (*Cvar_Get)( const char *var_name, const char *value, int flags );
|
||||
void (*Cvar_Set)( const char *var_name, const char *value );
|
||||
// localization
|
||||
const char *(*LV_ConvertString)(const char *string);
|
||||
|
||||
// ClientCommand and ConsoleCommand parameter access
|
||||
int (*Argc)( void );
|
||||
char * (*Argv)( int n );
|
||||
char * (*Args)( void ); // concatenation of all argv >= 1
|
||||
void (*AddCommand)( const char *cmd );
|
||||
void (*Cmd_Stuff)(const char* text);
|
||||
void (*Cmd_Execute)(int execWhen, const char* text);
|
||||
void (*Cmd_TokenizeString)(const char* textIn);
|
||||
// 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);
|
||||
|
||||
// a -1 return means the file does not exist
|
||||
// NULL can be passed for buf to just determine existance
|
||||
long (*FS_ReadFile)( const char *name, void **buf, qboolean quiet );
|
||||
void (*FS_FreeFile)( void *buf );
|
||||
int (*FS_WriteFile)( const char *qpath, const void *buffer, int size );
|
||||
void (*FS_WriteTextFile)( const char *qpath, const void *buffer, int size );
|
||||
// add commands to the local console as if they were typed in
|
||||
// for map changing, etc. The command is not executed immediately,
|
||||
// but will be executed in order the next time console commands
|
||||
// are processed
|
||||
void (*SendConsoleCommand)( const char *text );
|
||||
// ClientCommand and ConsoleCommand parameter access
|
||||
int (*Argc)(void);
|
||||
char *(*Argv)(int n);
|
||||
char *(*Args)(void); // concatenation of all argv >= 1
|
||||
void (*AddCommand)(const char *cmd);
|
||||
void (*Cmd_Stuff)(const char *text);
|
||||
void (*Cmd_Execute)(int execWhen, const char *text);
|
||||
void (*Cmd_TokenizeString)(const char *textIn);
|
||||
|
||||
// =========== client specific functions ===============
|
||||
// a -1 return means the file does not exist
|
||||
// NULL can be passed for buf to just determine existance
|
||||
long (*FS_ReadFile)(const char *name, void **buf, qboolean quiet);
|
||||
void (*FS_FreeFile)(void *buf);
|
||||
int (*FS_WriteFile)(const char *qpath, const void *buffer, int size);
|
||||
void (*FS_WriteTextFile)(const char *qpath, const void *buffer, int size);
|
||||
char** (*FS_ListFilteredFiles)(const char* path, const char* extension, const char* filter, qboolean wantSubs, int* numfiles, qboolean allowNonPureFilesOnDisk);
|
||||
void (*FS_FreeFileList)(char **list);
|
||||
// add commands to the local console as if they were typed in
|
||||
// for map changing, etc. The command is not executed immediately,
|
||||
// but will be executed in order the next time console commands
|
||||
// are processed
|
||||
void (*SendConsoleCommand)(const char *text);
|
||||
|
||||
// send a string to the server over the network
|
||||
int (*MSG_ReadBits)(int bits);
|
||||
int (*MSG_ReadChar)();
|
||||
int (*MSG_ReadByte)();
|
||||
int (*MSG_ReadSVC)();
|
||||
int (*MSG_ReadShort)();
|
||||
int (*MSG_ReadLong)();
|
||||
float (*MSG_ReadFloat)();
|
||||
char* (*MSG_ReadString)();
|
||||
char* (*MSG_ReadStringLine)();
|
||||
float (*MSG_ReadAngle8)();
|
||||
float (*MSG_ReadAngle16)();
|
||||
void (*MSG_ReadData)(void* data, int len);
|
||||
float (*MSG_ReadCoord)();
|
||||
void (*MSG_ReadDir)(vec3_t dir);
|
||||
void (*SendClientCommand)( const char *s );
|
||||
// =========== client specific functions ===============
|
||||
|
||||
// CM functions
|
||||
void (*CM_LoadMap)( const char *name );
|
||||
clipHandle_t (*CM_InlineModel)( int index ); // 0 = world, 1+ = bmodels
|
||||
int (*CM_NumInlineModels)( void );
|
||||
int (*CM_PointContents)( const vec3_t p, int headnode );
|
||||
int (*CM_TransformedPointContents)(const vec3_t p, clipHandle_t model, const vec3_t origin, const vec3_t angles);
|
||||
void (*CM_BoxTrace)( trace_t *results, const vec3_t start, const vec3_t end,
|
||||
const vec3_t mins, const vec3_t maxs,
|
||||
int headnode, int brushmask, qboolean cylinder );
|
||||
void (*CM_TransformedBoxTrace)( trace_t *results, const vec3_t start, const vec3_t end,
|
||||
const vec3_t mins, const vec3_t maxs,
|
||||
int headnode, int brushmask,
|
||||
const vec3_t origin, const vec3_t angles,
|
||||
qboolean cylinder
|
||||
);
|
||||
clipHandle_t (*CM_TempBoxModel)( const vec3_t mins, const vec3_t maxs, int contents );
|
||||
void (*CM_PrintBSPFileSizes)();
|
||||
qboolean (*CM_LeafInPVS)(int leaf1, int leaf2);
|
||||
int (*CM_PointLeafnum)(const vec3_t p);
|
||||
int (*R_MarkFragments)( int numPoints, const vec3_t *points, const vec3_t projection,
|
||||
int maxPoints, vec3_t pointBuffer,
|
||||
int maxFragments, markFragment_t *fragmentBuffer, float fRadiusSquared );
|
||||
int (*R_MarkFragmentsForInlineModel)(clipHandle_t bmodel, const vec3_t vAngles, const vec3_t vOrigin,
|
||||
int numPoints, const vec3_t *points, const vec3_t projection,
|
||||
int maxPoints, vec3_t pointBuffer,
|
||||
int maxFragments, markFragment_t *fragmentBuffer, float fRadiusSquared );
|
||||
// send a string to the server over the network
|
||||
int (*MSG_ReadBits)(int bits);
|
||||
int (*MSG_ReadChar)();
|
||||
int (*MSG_ReadByte)();
|
||||
int (*MSG_ReadSVC)();
|
||||
int (*MSG_ReadShort)();
|
||||
int (*MSG_ReadLong)();
|
||||
float (*MSG_ReadFloat)();
|
||||
char *(*MSG_ReadString)();
|
||||
char *(*MSG_ReadStringLine)();
|
||||
float (*MSG_ReadAngle8)();
|
||||
float (*MSG_ReadAngle16)();
|
||||
void (*MSG_ReadData)(void *data, int len);
|
||||
float (*MSG_ReadCoord)();
|
||||
void (*MSG_ReadDir)(vec3_t dir);
|
||||
void (*SendClientCommand)(const char *s);
|
||||
|
||||
void (*R_GetInlineModelBounds)(int index, vec3_t mins, vec3_t maxs);
|
||||
void (*R_GetLightingForDecal)(vec3_t light, vec3_t facing, vec3_t origin);
|
||||
void (*R_GetLightingForSmoke)(vec3_t light, vec3_t origin);
|
||||
int (*R_GatherLightSources)(const vec3_t pos, vec3_t* lightPos, vec3_t* lightIntensity, int maxLights);
|
||||
// CM functions
|
||||
void (*CM_LoadMap)(const char *name, int* checksum);
|
||||
clipHandle_t (*CM_InlineModel)(int index); // 0 = world, 1+ = bmodels
|
||||
int (*CM_NumInlineModels)(void);
|
||||
int (*CM_PointContents)(const vec3_t p, int headnode);
|
||||
int (*CM_TransformedPointContents)(
|
||||
const vec3_t p, clipHandle_t model, const vec3_t origin, const vec3_t angles
|
||||
);
|
||||
void (*CM_BoxTrace)(
|
||||
trace_t *results,
|
||||
const vec3_t start,
|
||||
const vec3_t end,
|
||||
const vec3_t mins,
|
||||
const vec3_t maxs,
|
||||
int headnode,
|
||||
int brushmask,
|
||||
qboolean cylinder
|
||||
);
|
||||
void (*CM_TransformedBoxTrace)(
|
||||
trace_t *results,
|
||||
const vec3_t start,
|
||||
const vec3_t end,
|
||||
const vec3_t mins,
|
||||
const vec3_t maxs,
|
||||
int headnode,
|
||||
int brushmask,
|
||||
const vec3_t origin,
|
||||
const vec3_t angles,
|
||||
qboolean cylinder
|
||||
);
|
||||
clipHandle_t (*CM_TempBoxModel)(const vec3_t mins, const vec3_t maxs, int contents);
|
||||
void (*CM_PrintBSPFileSizes)();
|
||||
qboolean (*CM_LeafInPVS)(int leaf1, int leaf2);
|
||||
int (*CM_PointLeafnum)(const vec3_t p);
|
||||
int (*R_MarkFragments)(
|
||||
int numPoints,
|
||||
const vec3_t *points,
|
||||
const vec3_t projection,
|
||||
int maxPoints,
|
||||
vec3_t pointBuffer,
|
||||
int maxFragments,
|
||||
markFragment_t *fragmentBuffer,
|
||||
float fRadiusSquared
|
||||
);
|
||||
int (*R_MarkFragmentsForInlineModel)(
|
||||
clipHandle_t bmodel,
|
||||
const vec3_t vAngles,
|
||||
const vec3_t vOrigin,
|
||||
int numPoints,
|
||||
const vec3_t *points,
|
||||
const vec3_t projection,
|
||||
int maxPoints,
|
||||
vec3_t pointBuffer,
|
||||
int maxFragments,
|
||||
markFragment_t *fragmentBuffer,
|
||||
float fRadiusSquared
|
||||
);
|
||||
|
||||
// =========== sound function calls ===============
|
||||
void (*R_GetInlineModelBounds)(int index, vec3_t mins, vec3_t maxs);
|
||||
void (*R_GetLightingForDecal)(vec3_t light, const vec3_t facing, const vec3_t origin);
|
||||
void (*R_GetLightingForSmoke)(vec3_t light, const vec3_t origin);
|
||||
int (*R_GatherLightSources)(const vec3_t pos, vec3_t *lightPos, vec3_t *lightIntensity, int maxLights);
|
||||
|
||||
void (*S_StartSound)(const vec3_t origin, int entNum, int entChannel, sfxHandle_t sfxHandle, float volume, float minDist, float pitch, float maxDist, int streamed);
|
||||
void (*S_StartLocalSound)(const char* soundName, qboolean forceLoad);
|
||||
void (*S_StopSound)( int entnum, int channel );
|
||||
void (*S_ClearLoopingSounds)(void);
|
||||
void (*S_AddLoopingSound)(const vec3_t origin, const vec3_t velocity, sfxHandle_t sfxHandle, float volume, float minDist, float maxDist, float pitch, int flags);
|
||||
void (*S_Respatialize)( int entityNum, const vec3_t origin, vec3_t axis[3] );
|
||||
void (*S_BeginRegistration)( void );
|
||||
sfxHandle_t (*S_RegisterSound)( const char *sample, int streamed );
|
||||
void (*S_EndRegistration)( void );
|
||||
void (*S_UpdateEntity)( int entityNum, const vec3_t origin, const vec3_t velocity, qboolean use_listener );
|
||||
void (*S_SetReverb)( int reverb_type, float reverb_level );
|
||||
void (*S_SetGlobalAmbientVolumeLevel)( float volume );
|
||||
float (*S_GetSoundTime)(sfxHandle_t handle);
|
||||
int (*S_ChannelNameToNum)(const char* name);
|
||||
const char* (*S_ChannelNumToName)(int channel);
|
||||
int (*S_IsSoundPlaying)(int channelNumber, const char* name);
|
||||
// =========== sound function calls ===============
|
||||
|
||||
// =========== music function calls ===============
|
||||
void (*S_StartSound)(
|
||||
const vec3_t origin,
|
||||
int entNum,
|
||||
int entChannel,
|
||||
sfxHandle_t sfxHandle,
|
||||
float volume,
|
||||
float minDist,
|
||||
float pitch,
|
||||
float maxDist,
|
||||
int streamed
|
||||
);
|
||||
void (*S_StartLocalSound)(const char *soundName, qboolean forceLoad);
|
||||
void (*S_StopSound)(int entnum, int channel);
|
||||
void (*S_ClearLoopingSounds)(void);
|
||||
void (*S_AddLoopingSound)(
|
||||
const vec3_t origin,
|
||||
const vec3_t velocity,
|
||||
sfxHandle_t sfxHandle,
|
||||
float volume,
|
||||
float minDist,
|
||||
float maxDist,
|
||||
float pitch,
|
||||
int flags
|
||||
);
|
||||
void (*S_Respatialize)(int entityNum, const vec3_t origin, vec3_t axis[3]);
|
||||
void (*S_BeginRegistration)(void);
|
||||
sfxHandle_t (*S_RegisterSound)(const char *sample, int streamed);
|
||||
void (*S_EndRegistration)(void);
|
||||
void (*S_UpdateEntity)(int entityNum, const vec3_t origin, const vec3_t velocity, qboolean use_listener);
|
||||
void (*S_SetReverb)(int reverb_type, float reverb_level);
|
||||
void (*S_SetGlobalAmbientVolumeLevel)(float volume);
|
||||
float (*S_GetSoundTime)(sfxHandle_t handle);
|
||||
int (*S_ChannelNameToNum)(const char *name);
|
||||
const char *(*S_ChannelNumToName)(int channel);
|
||||
int (*S_IsSoundPlaying)(int channelNumber, const char *name);
|
||||
|
||||
void (*MUSIC_NewSoundtrack)( const char *name );
|
||||
void (*MUSIC_UpdateMood)( int current_mood, int fallback_mood );
|
||||
void (*MUSIC_UpdateVolume)( float volume, float fade_time );
|
||||
// =========== music function calls ===============
|
||||
|
||||
// =========== camera function calls ===============
|
||||
void (*MUSIC_NewSoundtrack)(const char *name);
|
||||
void (*MUSIC_UpdateMood)(int current_mood, int fallback_mood);
|
||||
void (*MUSIC_UpdateVolume)(float volume, float fade_time);
|
||||
|
||||
float * (*get_camera_offset)( qboolean *lookactive, qboolean *resetview );
|
||||
// =========== camera function calls ===============
|
||||
|
||||
// =========== renderer function calls ================
|
||||
void (*R_ClearScene)( void );
|
||||
void (*R_RenderScene)( const refdef_t *fd );
|
||||
void (*R_LoadWorldMap)(const char* mapname);
|
||||
void (*R_PrintBSPFileSizes)();
|
||||
int (*MapVersion)();
|
||||
int (*R_MapVersion)();
|
||||
qhandle_t (*R_RegisterModel)( const char *name );
|
||||
qhandle_t (*R_SpawnEffectModel)(const char* name, vec3_t pos, vec3_t axis[3]);
|
||||
qhandle_t (*R_RegisterServerModel)(const char* name);
|
||||
void (*R_UnregisterServerModel)(qhandle_t hModel);
|
||||
qhandle_t (*R_RegisterSkin)( const char *name );
|
||||
qhandle_t (*R_RegisterShader)( const char *name );
|
||||
qhandle_t (*R_RegisterShaderNoMip)( const char *name );
|
||||
void (*R_AddRefEntityToScene)(const refEntity_t *ent, int parentEntityNumber );
|
||||
void (*R_AddRefSpriteToScene)(const refEntity_t *ent );
|
||||
void (*R_AddLightToScene)(const vec3_t origin, float intensity, float r, float g, float b, int type );
|
||||
qboolean (*R_AddPolyToScene)(qhandle_t hShader, int numVerts, const polyVert_t* verts, int renderfx);
|
||||
void (*R_AddTerrainMarkToScene)(int terrainIndex, qhandle_t hShader, int numVerts, const polyVert_t* verts, int renderFx);
|
||||
void (*R_SetColor)( const vec4_t rgba ); // NULL = 1,1,1,1
|
||||
void (*R_DrawStretchPic) ( float x, float y, float w, float h,
|
||||
float s1, float t1, float s2, float t2,
|
||||
qhandle_t hShader ); // 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);
|
||||
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 );
|
||||
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 =============
|
||||
void (*R_SwipeBegin) ( float thistime, float life, qhandle_t shader );
|
||||
void (*R_SwipePoint) ( vec3_t p1, vec3_t p2, float time );
|
||||
void (*R_SwipeEnd) ( void );
|
||||
int (*R_GetShaderWidth)( qhandle_t shader );
|
||||
int (*R_GetShaderHeight)( qhandle_t shader );
|
||||
void (*R_DrawBox)( float x, float y, float w, float h );
|
||||
float *(*get_camera_offset)(qboolean *lookactive, qboolean *resetview);
|
||||
|
||||
// =========== data shared with the client =============
|
||||
void (*GetGameState)( gameState_t *gamestate );
|
||||
int (*GetSnapshot)( int snapshotNumber, snapshot_t *snapshot );
|
||||
int (*GetServerStartTime)();
|
||||
void (*SetTime)(int time);
|
||||
void (*GetCurrentSnapshotNumber)( int *snapshotNumber, int *serverTime );
|
||||
void (*GetGlconfig)( glconfig_t *glconfig );
|
||||
// =========== renderer function calls ================
|
||||
void (*R_ClearScene)(void);
|
||||
void (*R_RenderScene)(const refdef_t *fd);
|
||||
void (*R_LoadWorldMap)(const char *mapname);
|
||||
void (*R_PrintBSPFileSizes)();
|
||||
int (*MapVersion)();
|
||||
int (*R_MapVersion)();
|
||||
qhandle_t (*R_RegisterModel)(const char *name);
|
||||
qhandle_t (*R_SpawnEffectModel)(const char *name, vec3_t pos, vec3_t axis[3]);
|
||||
qhandle_t (*R_RegisterServerModel)(const char *name);
|
||||
const char * (*R_GetModelName)(qhandle_t hModel);
|
||||
void (*R_UnregisterServerModel)(qhandle_t hModel);
|
||||
qhandle_t (*R_RegisterShader)(const char *name);
|
||||
qhandle_t (*R_RegisterShaderNoMip)(const char *name);
|
||||
const char* (*R_GetShaderName)(qhandle_t hShader);
|
||||
void (*R_AddRefEntityToScene)(const refEntity_t *ent, int parentEntityNumber);
|
||||
void (*R_AddRefSpriteToScene)(const refEntity_t *ent);
|
||||
void (*R_AddLightToScene)(const vec3_t origin, float intensity, float r, float g, float b, int type);
|
||||
qboolean (*R_AddPolyToScene)(qhandle_t hShader, int numVerts, const polyVert_t *verts, int renderfx);
|
||||
void (*R_AddTerrainMarkToScene)(
|
||||
int terrainIndex, qhandle_t hShader, int numVerts, const polyVert_t *verts, int renderFx
|
||||
);
|
||||
void (*R_SetColor)(const vec4_t rgba); // NULL = 1,1,1,1
|
||||
void (*R_DrawStretchPic)(
|
||||
float x,
|
||||
float y,
|
||||
float w,
|
||||
float h,
|
||||
float s1,
|
||||
float t1,
|
||||
float s2,
|
||||
float t2,
|
||||
qhandle_t hShader
|
||||
); // 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
|
||||
);
|
||||
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);
|
||||
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 =============
|
||||
void (*R_SwipeBegin)(float thistime, float life, qhandle_t shader);
|
||||
void (*R_SwipePoint)(vec3_t p1, vec3_t p2, float time);
|
||||
void (*R_SwipeEnd)(void);
|
||||
int (*R_GetShaderWidth)(qhandle_t shader);
|
||||
int (*R_GetShaderHeight)(qhandle_t shader);
|
||||
void (*R_DrawBox)(float x, float y, float w, float h);
|
||||
|
||||
// will return false if the number is so old that it doesn't exist in the buffer anymore
|
||||
qboolean (*GetParseEntityState)( int parseEntityNumber, entityState_t *state );
|
||||
int (*GetCurrentCmdNumber)( void ); // returns the most recent command number
|
||||
// which is the local predicted command for
|
||||
// the following frame
|
||||
qboolean (*GetUserCmd)( int cmdNumber, usercmd_t *ucmd );
|
||||
qboolean (*GetServerCommand)(int serverCommandNumber, qboolean differentServer);
|
||||
// =========== data shared with the client =============
|
||||
void (*GetGameState)(gameState_t *gamestate);
|
||||
int (*GetSnapshot)(int snapshotNumber, snapshot_t *snapshot);
|
||||
int (*GetServerStartTime)();
|
||||
void (*SetTime)(int time);
|
||||
void (*GetCurrentSnapshotNumber)(int *snapshotNumber, int *serverTime);
|
||||
void (*GetGlconfig)(glconfig_t *glconfig);
|
||||
|
||||
// ALIAS STUFF
|
||||
qboolean (*Alias_Add)( const char * alias, const char * name, const char *parameters );
|
||||
qboolean (*Alias_ListAdd)(AliasList_t* list, const char* alias, const char* name, const char* parameters);
|
||||
const char* (*Alias_FindRandom)(const char* alias, AliasListNode_t **ret);
|
||||
const char* (*Alias_ListFindRandom)(AliasList_t* list, const char* alias, AliasListNode_t** ret);
|
||||
void (*Alias_Dump)( void );
|
||||
void (*Alias_Clear)( void );
|
||||
AliasList_t* (*AliasList_New)(const char* name);
|
||||
void (*Alias_ListFindRandomRange)(AliasList_t* list, const char* alias, int* minIndex, int* maxIndex, float* totalWeight);
|
||||
AliasList_t* (*Alias_GetGlobalList)();
|
||||
// will return false if the number is so old that it doesn't exist in the buffer anymore
|
||||
qboolean (*GetParseEntityState)(int parseEntityNumber, entityState_t *state);
|
||||
int (*GetCurrentCmdNumber)(void); // returns the most recent command number
|
||||
// which is the local predicted command for
|
||||
// the following frame
|
||||
qboolean (*GetUserCmd)(int cmdNumber, usercmd_t *ucmd);
|
||||
qboolean (*GetServerCommand)(int serverCommandNumber, qboolean differentServer);
|
||||
|
||||
// ==================== UI STUFF ==========================
|
||||
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);
|
||||
// ALIAS STUFF
|
||||
qboolean (*Alias_Add)(const char *alias, const char *name, const char *parameters);
|
||||
qboolean (*Alias_ListAdd)(AliasList_t *list, const char *alias, const char *name, const char *parameters);
|
||||
const char *(*Alias_FindRandom)(const char *alias, AliasListNode_t **ret);
|
||||
const char *(*Alias_ListFindRandom)(AliasList_t *list, const char *alias, AliasListNode_t **ret);
|
||||
void (*Alias_Dump)(void);
|
||||
void (*Alias_Clear)(void);
|
||||
AliasList_t *(*AliasList_New)(const char *name);
|
||||
void (*Alias_ListFindRandomRange)(
|
||||
AliasList_t *list, const char *alias, int *minIndex, int *maxIndex, float *totalWeight
|
||||
);
|
||||
AliasList_t *(*Alias_GetGlobalList)();
|
||||
|
||||
int (*Key_StringToKeynum)(const char* str);
|
||||
const char* (*Key_KeynumToBindString)(int keyNum);
|
||||
void (*Key_GetKeysForCommand)(const char* command, int* key1, int* key2);
|
||||
// ==================== UI STUFF ==========================
|
||||
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);
|
||||
|
||||
// ==================== TIKI STUFF ==========================
|
||||
// TIKI SPECIFIC STUFF
|
||||
dtiki_t* (*R_Model_GetHandle)(qhandle_t handle);
|
||||
int (*TIKI_NumAnims)(dtiki_t* pmdl);
|
||||
void (*TIKI_CalculateBounds)(dtiki_t* pmdl, float scale, vec3_t mins, vec3_t maxs);
|
||||
const char* (*TIKI_Name)(dtiki_t* tiki);
|
||||
void* (*TIKI_GetSkeletor)(dtiki_t* tiki, int entNum);
|
||||
void (*TIKI_SetEyeTargetPos)(dtiki_t* tiki, int entNum, vec3_t pos);
|
||||
int (*Key_StringToKeynum)(const char *str);
|
||||
const char *(*Key_KeynumToBindString)(int keyNum);
|
||||
void (*Key_GetKeysForCommand)(const char *command, int *key1, int *key2);
|
||||
|
||||
// ANIM SPECIFIC STUFF
|
||||
const char * (*Anim_NameForNum) (dtiki_t* tiki, int animnum );
|
||||
int (*Anim_NumForName) (dtiki_t* tiki, const char * name );
|
||||
int (*Anim_Random) (dtiki_t* tiki, const char * name );
|
||||
int (*Anim_NumFrames) (dtiki_t* tiki, int animnum );
|
||||
float (*Anim_Time) (dtiki_t* tiki, int animnum);
|
||||
float (*Anim_Frametime) (dtiki_t* tiki, int animnum);
|
||||
void (*Anim_Delta) (dtiki_t* tiki, int animnum, vec3_t delta );
|
||||
int (*Anim_Flags) (dtiki_t* tiki, int animnum);
|
||||
int (*Anim_FlagsSkel) (dtiki_t* tiki, int animnum);
|
||||
float (*Anim_CrossblendTime) (dtiki_t* tiki, int animnum );
|
||||
qboolean (*Anim_HasCommands) (dtiki_t* tiki, int animnum );
|
||||
// ==================== TIKI STUFF ==========================
|
||||
// TIKI SPECIFIC STUFF
|
||||
dtiki_t *(*R_Model_GetHandle)(qhandle_t handle);
|
||||
int (*TIKI_NumAnims)(dtiki_t *pmdl);
|
||||
void (*TIKI_CalculateBounds)(dtiki_t *pmdl, float scale, vec3_t mins, vec3_t maxs);
|
||||
const char *(*TIKI_Name)(dtiki_t *tiki);
|
||||
void *(*TIKI_GetSkeletor)(dtiki_t *tiki, int entNum);
|
||||
void (*TIKI_SetEyeTargetPos)(dtiki_t *tiki, int entNum, vec3_t pos);
|
||||
|
||||
// FRAME SPECIFIC STUFF
|
||||
qboolean (*Frame_Commands) (dtiki_t* tiki, int animnum, int framenum, tiki_cmd_t * tiki_cmd );
|
||||
qboolean (*Frame_CommandsTime) (dtiki_t* tiki, int animnum, float start, float end, tiki_cmd_t * tiki_cmd );
|
||||
// ANIM SPECIFIC STUFF
|
||||
const char *(*Anim_NameForNum)(dtiki_t *tiki, int animnum);
|
||||
int (*Anim_NumForName)(dtiki_t *tiki, const char *name);
|
||||
int (*Anim_Random)(dtiki_t *tiki, const char *name);
|
||||
int (*Anim_NumFrames)(dtiki_t *tiki, int animnum);
|
||||
float (*Anim_Time)(dtiki_t *tiki, int animnum);
|
||||
float (*Anim_Frametime)(dtiki_t *tiki, int animnum);
|
||||
void (*Anim_Delta)(dtiki_t *tiki, int animnum, vec3_t delta);
|
||||
int (*Anim_Flags)(dtiki_t *tiki, int animnum);
|
||||
int (*Anim_FlagsSkel)(dtiki_t *tiki, int animnum);
|
||||
float (*Anim_CrossblendTime)(dtiki_t *tiki, int animnum);
|
||||
qboolean (*Anim_HasCommands)(dtiki_t *tiki, int animnum);
|
||||
|
||||
// SURFACE SPECIFIC STUFF
|
||||
int (*Surface_NameToNum) (dtiki_t* tiki, const char * name );
|
||||
//const char * (*Surface_NumToName) (dtiki_t* tiki, int num );
|
||||
//int (*Surface_Flags) (dtiki_t* tiki, int num );
|
||||
//int (*Surface_NumSkins) (dtiki_t* tiki, int num );
|
||||
// FRAME SPECIFIC STUFF
|
||||
qboolean (*Frame_Commands)(dtiki_t *tiki, int animnum, int framenum, tiki_cmd_t *tiki_cmd);
|
||||
qboolean (*Frame_CommandsTime)(dtiki_t *tiki, int animnum, float start, float end, tiki_cmd_t *tiki_cmd);
|
||||
|
||||
// TAG SPECIFIC STUFF
|
||||
int (*Tag_NumForName) (dtiki_t* tiki, const char * name );
|
||||
const char * (*Tag_NameForNum) (dtiki_t* tiki, int num );
|
||||
void (*ForceUpdatePose)(refEntity_t* model);
|
||||
orientation_t (*TIKI_Orientation)(refEntity_t* model, int tagNum);
|
||||
qboolean (*TIKI_IsOnGround)(refEntity_t* model, int tagNum, float threshold);
|
||||
// SURFACE SPECIFIC STUFF
|
||||
int (*Surface_NameToNum)(dtiki_t *tiki, const char *name);
|
||||
//const char * (*Surface_NumToName) (dtiki_t* tiki, int num );
|
||||
//int (*Surface_Flags) (dtiki_t* tiki, int num );
|
||||
//int (*Surface_NumSkins) (dtiki_t* tiki, int num );
|
||||
|
||||
// MISCELLANEOUS SPECIFIC STUFF
|
||||
void (*UI_ShowScoreBoard)(const char* menuName);
|
||||
void (*UI_HideScoreBoard)();
|
||||
void (*UI_SetScoreBoardItem)(int itemNumber, const char* data1,
|
||||
const char* data2, const char* data3,
|
||||
const char* data4, const char* data5,
|
||||
const char* data6, const char* data7,
|
||||
const char* data8, const vec4_t textColor,
|
||||
const vec4_t backColor, qboolean isHeader);
|
||||
void (*UI_DeleteScoreBoardItems)(int maxIndex);
|
||||
void (*UI_ToggleDMMessageConsole)(int consoleMode);
|
||||
dtiki_t* (*TIKI_FindTiki)(const char* path);
|
||||
void (*LoadResource)(const char* name);
|
||||
void (*FS_CanonicalFilename)(char* name);
|
||||
// TAG SPECIFIC STUFF
|
||||
int (*Tag_NumForName)(dtiki_t *tiki, const char *name);
|
||||
const char *(*Tag_NameForNum)(dtiki_t *tiki, int num);
|
||||
void (*ForceUpdatePose)(refEntity_t *model);
|
||||
orientation_t (*TIKI_Orientation)(refEntity_t *model, int tagNum);
|
||||
qboolean (*TIKI_IsOnGround)(refEntity_t *model, int tagNum, float threshold);
|
||||
|
||||
cvar_t* fsDebug;
|
||||
hdelement_t* HudDrawElements;
|
||||
clientAnim_t* anim;
|
||||
stopWatch_t* stopWatch;
|
||||
// MISCELLANEOUS SPECIFIC STUFF
|
||||
void (*UI_ShowScoreBoard)(const char *menuName);
|
||||
void (*UI_HideScoreBoard)();
|
||||
void (*UI_SetScoreBoardItem)(
|
||||
int itemNumber,
|
||||
const char *data1,
|
||||
const char *data2,
|
||||
const char *data3,
|
||||
const char *data4,
|
||||
const char *data5,
|
||||
const char *data6,
|
||||
const char *data7,
|
||||
const char *data8,
|
||||
const vec4_t textColor,
|
||||
const vec4_t backColor,
|
||||
qboolean isHeader
|
||||
);
|
||||
void (*UI_DeleteScoreBoardItems)(int maxIndex);
|
||||
void (*UI_ToggleDMMessageConsole)(int consoleMode);
|
||||
void (*CL_InitRadar)(radarClient_t* radars, qhandle_t* shaders, int clientNum); // Added in 2.0
|
||||
dtiki_t *(*TIKI_FindTiki)(const char *path);
|
||||
void (*LoadResource)(const char *name);
|
||||
void (*FS_CanonicalFilename)(char *name);
|
||||
void (*CL_RestoreSavedCgameState)();
|
||||
void (*CL_ClearSavedCgameState)();
|
||||
|
||||
} clientGameImport_t;
|
||||
size_t (*getConfigStringIdNormalized)(size_t num);
|
||||
|
||||
cvar_t *fsDebug;
|
||||
hdelement_t *HudDrawElements;
|
||||
clientAnim_t *anim;
|
||||
stopWatch_t *stopWatch;
|
||||
|
||||
/*
|
||||
} clientGameImport_t;
|
||||
|
||||
/*
|
||||
==================================================================
|
||||
|
||||
functions exported to the main executable
|
||||
@@ -371,54 +450,84 @@ functions exported to the main executable
|
||||
==================================================================
|
||||
*/
|
||||
|
||||
typedef struct {
|
||||
void (*CG_Init)( clientGameImport_t *imported, int serverMessageNum, int serverCommandSequence, int clientNum );
|
||||
void (*CG_Shutdown)( void );
|
||||
void (*CG_DrawActiveFrame)( int serverTime, int frameTime, stereoFrame_t stereoView, qboolean demoPlayback );
|
||||
qboolean (*CG_ConsoleCommand)( void );
|
||||
void (*CG_GetRendererConfig)( void );
|
||||
void (*CG_Draw2D)( void );
|
||||
void (*CG_EyePosition)(vec3_t* eyePos);
|
||||
void (*CG_EyeOffset)(vec3_t* eyeOffset);
|
||||
void (*CG_EyeAngles)(vec3_t* eyeAngles);
|
||||
float (*CG_SensitivityScale)();
|
||||
void (*CG_ParseCGMessage)();
|
||||
void (*CG_RefreshHudDrawElements)();
|
||||
void (*CG_HudDrawShader)(int info);
|
||||
void (*CG_HudDrawFont)(int info);
|
||||
int (*CG_GetParent)(int entNum);
|
||||
float (*CG_GetObjectiveAlpha)();
|
||||
int (*CG_PermanentMark)(const vec3_t origin, const vec3_t dir, float orientation, float sScale, float tScale, float red, float green, float blue, float alpha, qboolean doLighting, float sCenter, float tCenter, markFragment_t* markFragments, void* polyVerts);
|
||||
int (*CG_PermanentTreadMarkDecal)(treadMark_t* treadMark, qboolean startSegment, qboolean doLighting, markFragment_t* markFragments, void* polyVerts);
|
||||
int (*CG_PermanentUpdateTreadMark)(treadMark_t* treadMark, float alpha, float minSegment, float maxSegment, float maxOffset, float texScale);
|
||||
void (*CG_ProcessInitCommands)(dtiki_t* tiki, refEntity_t* ent);
|
||||
void (*CG_EndTiki)(dtiki_t* tiki);
|
||||
const char* (*CG_GetColumnName)(int columnNum, int* columnWidth);
|
||||
void (*CG_GetScoreBoardColor)(float* red, float* green, float* blue, float* alpha);
|
||||
void (*CG_GetScoreBoardFontColor)(float* red, float* green, float* blue, float* alpha);
|
||||
int (*CG_GetScoreBoardDrawHeader)();
|
||||
void (*CG_GetScoreBoardPosition)(float* x, float* y, float* width, float* height);
|
||||
int (*CG_WeaponCommandButtonBits)();
|
||||
int (*CG_CheckCaptureKey)(int key, qboolean down, unsigned int time);
|
||||
typedef struct {
|
||||
void (*CG_Init)(clientGameImport_t *imported, int serverMessageNum, int serverCommandSequence, int clientNum);
|
||||
void (*CG_Shutdown)(void);
|
||||
void (*CG_DrawActiveFrame)(int serverTime, int frameTime, stereoFrame_t stereoView, qboolean demoPlayback);
|
||||
qboolean (*CG_ConsoleCommand)(void);
|
||||
void (*CG_GetRendererConfig)(void);
|
||||
void (*CG_Draw2D)(void);
|
||||
void (*CG_EyePosition)(vec3_t *eyePos);
|
||||
void (*CG_EyeOffset)(vec3_t *eyeOffset);
|
||||
void (*CG_EyeAngles)(vec3_t *eyeAngles);
|
||||
float (*CG_SensitivityScale)();
|
||||
void (*CG_ParseCGMessage)();
|
||||
void (*CG_RefreshHudDrawElements)();
|
||||
void (*CG_HudDrawShader)(int info);
|
||||
void (*CG_HudDrawFont)(int info);
|
||||
int (*CG_GetParent)(int entNum);
|
||||
float (*CG_GetObjectiveAlpha)();
|
||||
int (*CG_PermanentMark)(
|
||||
vec3_t origin,
|
||||
vec3_t dir,
|
||||
float orientation,
|
||||
float sScale,
|
||||
float tScale,
|
||||
float red,
|
||||
float green,
|
||||
float blue,
|
||||
float alpha,
|
||||
qboolean doLighting,
|
||||
float sCenter,
|
||||
float tCenter,
|
||||
markFragment_t *markFragments,
|
||||
void *polyVerts
|
||||
);
|
||||
int (*CG_PermanentTreadMarkDecal)(
|
||||
treadMark_t *treadMark,
|
||||
qboolean startSegment,
|
||||
qboolean doLighting,
|
||||
markFragment_t *markFragments,
|
||||
void *polyVerts
|
||||
);
|
||||
int (*CG_PermanentUpdateTreadMark)(
|
||||
treadMark_t *treadMark, float alpha, float minSegment, float maxSegment, float maxOffset, float texScale
|
||||
);
|
||||
void (*CG_ProcessInitCommands)(dtiki_t *tiki, refEntity_t *ent);
|
||||
void (*CG_EndTiki)(dtiki_t *tiki);
|
||||
const char *(*CG_GetColumnName)(int columnNum, int *columnWidth);
|
||||
void (*CG_GetScoreBoardColor)(float *red, float *green, float *blue, float *alpha);
|
||||
void (*CG_GetScoreBoardFontColor)(float *red, float *green, float *blue, float *alpha);
|
||||
int (*CG_GetScoreBoardDrawHeader)();
|
||||
void (*CG_GetScoreBoardPosition)(float *x, float *y, float *width, float *height);
|
||||
int (*CG_WeaponCommandButtonBits)();
|
||||
int (*CG_CheckCaptureKey)(int key, qboolean down, unsigned int time);
|
||||
|
||||
// FIXME
|
||||
//prof_cgame_t* profStruct;
|
||||
//
|
||||
// Added in 2.0
|
||||
//
|
||||
void (*CG_ReadNonPVSClient)(radarUnpacked_t* radarUnpacked);
|
||||
void (*CG_UpdateRadar)();
|
||||
size_t (*CG_SaveStateToBuffer)(void** out, int svsTime);
|
||||
qboolean (*CG_LoadStateToBuffer)(void* state, size_t size, int svsTime);
|
||||
void (*CG_CleanUpTempModels)();
|
||||
|
||||
qboolean (*CG_Command_ProcessFile)(const char* name, qboolean quiet, dtiki_t* curTiki);
|
||||
// FIXME
|
||||
//prof_cgame_t* profStruct;
|
||||
|
||||
} clientGameExport_t;
|
||||
qboolean (*CG_Command_ProcessFile)(const char *name, qboolean quiet, dtiki_t *curTiki);
|
||||
|
||||
} clientGameExport_t;
|
||||
|
||||
#ifdef CGAME_DLL
|
||||
#ifdef WIN32
|
||||
__declspec(dllexport)
|
||||
#else
|
||||
__attribute__((visibility("default")))
|
||||
# ifdef WIN32
|
||||
__declspec(dllexport)
|
||||
# else
|
||||
__attribute__((visibility("default")))
|
||||
# endif
|
||||
#endif
|
||||
#endif
|
||||
clientGameExport_t* GetCGameAPI(void);
|
||||
clientGameExport_t *GetCGameAPI(void);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif // __CG_PUBLIC_H__
|
||||
@@ -0,0 +1,168 @@
|
||||
/*
|
||||
===========================================================================
|
||||
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 "cg_local.h"
|
||||
#include "cg_radar.h"
|
||||
|
||||
void CG_InitRadar()
|
||||
{
|
||||
int i;
|
||||
|
||||
cg.radarShaders[0] = cgi.R_RegisterShader("textures/hud/radar_allies.tga");
|
||||
cg.radarShaders[1] = cgi.R_RegisterShader("textures/hud/radar_axis.tga");
|
||||
|
||||
for (i = 0; i < MAX_CLIENTS; i++)
|
||||
{
|
||||
cg.radars[i].time = 0;
|
||||
cg.radars[i].lastSpeakTime = 0;
|
||||
}
|
||||
|
||||
cgi.CL_InitRadar(cg.radars, cg.radarShaders, cg.snap->ps.clientNum);
|
||||
}
|
||||
|
||||
bool CG_InTeamGame(centity_t *ent)
|
||||
{
|
||||
return ent->currentState.solid && cg.clientinfo[ent->currentState.number].team;
|
||||
}
|
||||
|
||||
bool CG_SameTeam(centity_t *ent)
|
||||
{
|
||||
return cg.clientinfo[ent->currentState.number].team == cg.clientinfo[cg.snap->ps.clientNum].team;
|
||||
}
|
||||
|
||||
bool CG_IsTeamGame()
|
||||
{
|
||||
return cgs.gametype >= GT_TEAM;
|
||||
}
|
||||
|
||||
bool CG_ValidRadarClient(centity_t *ent)
|
||||
{
|
||||
if (!cg.snap) {
|
||||
return qfalse;
|
||||
}
|
||||
|
||||
if (!CG_IsTeamGame()) {
|
||||
return false;
|
||||
}
|
||||
|
||||
if (!CG_InTeamGame(&cg_entities[cg.snap->ps.clientNum])) {
|
||||
return false;
|
||||
}
|
||||
|
||||
if (!CG_InTeamGame(ent)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
return CG_SameTeam(ent);
|
||||
}
|
||||
|
||||
int CG_RadarIcon()
|
||||
{
|
||||
switch (cg.clientinfo[cg.snap->ps.clientNum].team)
|
||||
{
|
||||
case TEAM_ALLIES:
|
||||
return 0;
|
||||
default:
|
||||
case TEAM_AXIS:
|
||||
return 1;
|
||||
}
|
||||
}
|
||||
|
||||
void CG_UpdateRadarClient(centity_t* ent)
|
||||
{
|
||||
radarClient_t* radar;
|
||||
|
||||
radar = &cg.radars[ent->currentState.number];
|
||||
if (!CG_ValidRadarClient(ent)) {
|
||||
radar->time = 0;
|
||||
return;
|
||||
}
|
||||
|
||||
radar->time = cg.time;
|
||||
radar->teamShader = CG_RadarIcon();
|
||||
if (cg.snap->ps.clientNum == ent->currentState.number)
|
||||
{
|
||||
radar->origin[0] = cg.refdef.vieworg[0];
|
||||
radar->origin[1] = cg.refdef.vieworg[1];
|
||||
radar->axis[0] = cg.refdef.viewaxis[0][0];
|
||||
radar->axis[1] = cg.refdef.viewaxis[0][1];
|
||||
VectorNormalize2D(radar->axis);
|
||||
}
|
||||
else
|
||||
{
|
||||
float axis[2];
|
||||
|
||||
radar->origin[0] = ent->currentState.origin[0];
|
||||
radar->origin[1] = ent->currentState.origin[1];
|
||||
YawToAxis(ent->currentState.angles[1], axis);
|
||||
|
||||
radar->axis[0] = axis[0];
|
||||
radar->axis[1] = axis[1];
|
||||
VectorNormalize2D(radar->axis);
|
||||
}
|
||||
}
|
||||
|
||||
void CG_ReadNonPVSClient(radarUnpacked_t* radarUnpacked)
|
||||
{
|
||||
radarClient_t* radar;
|
||||
float axis[2];
|
||||
|
||||
if (!CG_ValidRadarClient(&cg_entities[radarUnpacked->clientNum])) {
|
||||
return;
|
||||
}
|
||||
|
||||
radar = &cg.radars[radarUnpacked->clientNum];
|
||||
radar->time = cg.time;
|
||||
radar->teamShader = CG_RadarIcon();
|
||||
// copy origin
|
||||
radar->origin[0] = radarUnpacked->x;
|
||||
radar->origin[1] = radarUnpacked->y;
|
||||
// copy yaw
|
||||
YawToAxis(radarUnpacked->yaw, axis);
|
||||
radar->axis[0] = axis[0];
|
||||
radar->axis[1] = axis[1];
|
||||
VectorNormalize2D(radar->axis);
|
||||
}
|
||||
|
||||
void CG_UpdateRadar()
|
||||
{
|
||||
int i;
|
||||
|
||||
for (i = 0; i < MAX_CLIENTS; i++)
|
||||
{
|
||||
if (cg.radars[i].time)
|
||||
{
|
||||
if (!CG_ValidRadarClient(&cg_entities[i])) {
|
||||
cg.radars[i].time = 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void CG_RadarClientSpeaks(int num)
|
||||
{
|
||||
if (!CG_ValidRadarClient(&cg_entities[num])) {
|
||||
return;
|
||||
}
|
||||
|
||||
cg.radars[num].lastSpeakTime = cg.time;
|
||||
}
|
||||
@@ -1,38 +1,42 @@
|
||||
/*
|
||||
===========================================================================
|
||||
Copyright (C) 1999-2005 Id Software, Inc.
|
||||
Copyright (C) 2023 the OpenMoHAA team
|
||||
|
||||
This file is part of Quake III Arena source code.
|
||||
This file is part of OpenMoHAA source code.
|
||||
|
||||
Quake III Arena source code is free software; you can redistribute it
|
||||
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.
|
||||
|
||||
Quake III Arena source code is distributed in the hope that it will be
|
||||
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 Foobar; if not, write to the Free Software
|
||||
along with OpenMoHAA source code; if not, write to the Free Software
|
||||
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
===========================================================================
|
||||
*/
|
||||
#if !( defined __linux__ || defined __FreeBSD__ )
|
||||
#error You should include this file only on Linux/FreeBSD platforms
|
||||
|
||||
// DESCRIPTION:
|
||||
// Radar client
|
||||
|
||||
#pragma once
|
||||
|
||||
#include "cg_local.h"
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
#ifndef __GLW_LINUX_H__
|
||||
#define __GLW_LINUX_H__
|
||||
|
||||
typedef struct
|
||||
{
|
||||
void *OpenGLLib; // instance of OpenGL library
|
||||
|
||||
FILE *log_fp;
|
||||
} glwstate_t;
|
||||
|
||||
extern glwstate_t glw_state;
|
||||
void CG_InitRadar();
|
||||
void CG_UpdateRadarClient(centity_t* ent);
|
||||
void CG_ReadNonPVSClient(radarUnpacked_t* radarUnpacked);
|
||||
void CG_UpdateRadar();
|
||||
void CG_RadarClientSpeaks(int num);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
+467
-527
File diff suppressed because it is too large.
Load diff
+440
-133
@@ -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.
|
||||
|
||||
@@ -24,12 +25,31 @@ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
// cg_servercmds.c -- text commands sent by the server
|
||||
|
||||
#include "cg_local.h"
|
||||
#include "../fgame/bg_voteoptions.h"
|
||||
|
||||
static const char* IsWeaponAllowed(int dmFlags, int flags) {
|
||||
static qboolean CG_IsStatementFiltered(char *cmd);
|
||||
|
||||
/*
|
||||
================
|
||||
IsWeaponAllowed
|
||||
|
||||
Returns true if the weapon is allowed
|
||||
================
|
||||
*/
|
||||
static const char *IsWeaponAllowed(int dmFlags, int flags)
|
||||
{
|
||||
return (dmFlags & flags) ? "0" : "1";
|
||||
}
|
||||
|
||||
static qboolean QueryLandminesAllowed2(const char* mapname, int dmflags) {
|
||||
/*
|
||||
================
|
||||
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) {
|
||||
return qfalse;
|
||||
}
|
||||
@@ -38,43 +58,61 @@ static qboolean QueryLandminesAllowed2(const char* mapname, int dmflags) {
|
||||
return qtrue;
|
||||
}
|
||||
|
||||
if (!Q_stricmpn(mapname, "obj/obj_", 8u))
|
||||
return qfalse;
|
||||
if (!Q_stricmpn(mapname, "dm/mohdm", 8u))
|
||||
return qfalse;
|
||||
if (!Q_stricmp(mapname, "DM/MP_Bahnhof_DM"))
|
||||
return qfalse;
|
||||
if (!Q_stricmp(mapname, "obj/MP_Ardennes_TOW"))
|
||||
return qfalse;
|
||||
if (!Q_stricmp(mapname, "DM/MP_Bazaar_DM"))
|
||||
return qfalse;
|
||||
if (!Q_stricmp(mapname, "obj/MP_Berlin_TOW"))
|
||||
return qfalse;
|
||||
if (!Q_stricmp(mapname, "DM/MP_Brest_DM"))
|
||||
return qfalse;
|
||||
if (!Q_stricmp(mapname, "obj/MP_Druckkammern_TOW"))
|
||||
return qfalse;
|
||||
if (!Q_stricmp(mapname, "DM/MP_Gewitter_DM"))
|
||||
return qfalse;
|
||||
if (!Q_stricmp(mapname, "obj/MP_Flughafen_TOW"))
|
||||
return qfalse;
|
||||
if (!Q_stricmp(mapname, "DM/MP_Holland_DM"))
|
||||
return qfalse;
|
||||
if (!Q_stricmp(mapname, "DM/MP_Malta_DM"))
|
||||
return qfalse;
|
||||
if (!Q_stricmp(mapname, "DM/MP_Stadt_DM"))
|
||||
return qfalse;
|
||||
if (!Q_stricmp(mapname, "DM/MP_Unterseite_DM"))
|
||||
return qfalse;
|
||||
if (!Q_stricmp(mapname, "DM/MP_Verschneit_DM"))
|
||||
if (!Q_stricmpn(mapname, "obj/obj_", 8u)) {
|
||||
return qfalse;
|
||||
if (!Q_stricmp(mapname, "lib/mp_ship_lib"))
|
||||
}
|
||||
if (!Q_stricmpn(mapname, "dm/mohdm", 8u)) {
|
||||
return qfalse;
|
||||
if (!Q_stricmp(mapname, "DM/MP_Verschneit_DM"))
|
||||
}
|
||||
if (!Q_stricmp(mapname, "DM/MP_Bahnhof_DM")) {
|
||||
return qfalse;
|
||||
if (!Q_stricmp(mapname, "lib/mp_ship_lib"))
|
||||
}
|
||||
if (!Q_stricmp(mapname, "obj/MP_Ardennes_TOW")) {
|
||||
return qfalse;
|
||||
return qtrue;
|
||||
}
|
||||
if (!Q_stricmp(mapname, "DM/MP_Bazaar_DM")) {
|
||||
return qfalse;
|
||||
}
|
||||
if (!Q_stricmp(mapname, "obj/MP_Berlin_TOW")) {
|
||||
return qfalse;
|
||||
}
|
||||
if (!Q_stricmp(mapname, "DM/MP_Brest_DM")) {
|
||||
return qfalse;
|
||||
}
|
||||
if (!Q_stricmp(mapname, "obj/MP_Druckkammern_TOW")) {
|
||||
return qfalse;
|
||||
}
|
||||
if (!Q_stricmp(mapname, "DM/MP_Gewitter_DM")) {
|
||||
return qfalse;
|
||||
}
|
||||
if (!Q_stricmp(mapname, "obj/MP_Flughafen_TOW")) {
|
||||
return qfalse;
|
||||
}
|
||||
if (!Q_stricmp(mapname, "DM/MP_Holland_DM")) {
|
||||
return qfalse;
|
||||
}
|
||||
if (!Q_stricmp(mapname, "DM/MP_Malta_DM")) {
|
||||
return qfalse;
|
||||
}
|
||||
if (!Q_stricmp(mapname, "DM/MP_Stadt_DM")) {
|
||||
return qfalse;
|
||||
}
|
||||
if (!Q_stricmp(mapname, "DM/MP_Unterseite_DM")) {
|
||||
return qfalse;
|
||||
}
|
||||
if (!Q_stricmp(mapname, "DM/MP_Verschneit_DM")) {
|
||||
return qfalse;
|
||||
}
|
||||
if (!Q_stricmp(mapname, "lib/mp_ship_lib")) {
|
||||
return qfalse;
|
||||
}
|
||||
if (!Q_stricmp(mapname, "DM/MP_Verschneit_DM")) {
|
||||
return qfalse;
|
||||
}
|
||||
if (!Q_stricmp(mapname, "lib/mp_ship_lib")) {
|
||||
return qfalse;
|
||||
}
|
||||
return qtrue;
|
||||
}
|
||||
|
||||
/*
|
||||
@@ -87,40 +125,53 @@ and whenever the server updates any serverinfo flagged cvars
|
||||
*/
|
||||
void CG_ParseServerinfo(void)
|
||||
{
|
||||
const char* info;
|
||||
const char* mapname;
|
||||
char map[MAX_QPATH];
|
||||
char* spawnpos;
|
||||
const char* version;
|
||||
const char *info;
|
||||
const char *mapname;
|
||||
char map[MAX_QPATH];
|
||||
char *spawnpos;
|
||||
const char *version;
|
||||
const char *mapChecksumStr;
|
||||
|
||||
info = CG_ConfigString(CS_SERVERINFO);
|
||||
cgs.gametype = atoi(Info_ValueForKey(info, "g_gametype"));
|
||||
cgs.dmflags = atoi(Info_ValueForKey(info, "dmflags"));
|
||||
cgs.teamflags = atoi(Info_ValueForKey(info, "teamflags"));
|
||||
cgs.fraglimit = atoi(Info_ValueForKey(info, "fraglimit"));
|
||||
cgs.timelimit = atoi(Info_ValueForKey(info, "timelimit"));
|
||||
info = CG_ConfigString(CS_SERVERINFO);
|
||||
cgs.gametype = atoi(Info_ValueForKey(info, "g_gametype"));
|
||||
cgs.dmflags = atoi(Info_ValueForKey(info, "dmflags"));
|
||||
cgs.teamflags = atoi(Info_ValueForKey(info, "teamflags"));
|
||||
cgs.fraglimit = atoi(Info_ValueForKey(info, "fraglimit"));
|
||||
cgs.timelimit = atoi(Info_ValueForKey(info, "timelimit"));
|
||||
cgs.maxclients = atoi(Info_ValueForKey(info, "sv_maxclients"));
|
||||
|
||||
version = Info_ValueForKey(info, "version");
|
||||
if (strstr(version, "Spearhead")) {
|
||||
cgi.Cvar_Set("g_servertype", "1");
|
||||
} else {
|
||||
cgi.Cvar_Set("g_servertype", "2");
|
||||
cgi.Cvar_Set("g_servertype", "2");
|
||||
}
|
||||
|
||||
cgi.Cvar_Set("cg_gametype", Info_ValueForKey(info, "g_gametype"));
|
||||
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"));
|
||||
cgi.Cvar_Set("cg_obj_axistext1", Info_ValueForKey(info, "cg_obj_axistext1"));
|
||||
cgi.Cvar_Set("cg_obj_axistext2", Info_ValueForKey(info, "cg_obj_axistext2"));
|
||||
cgi.Cvar_Set("cg_obj_axistext3", Info_ValueForKey(info, "cg_obj_axistext3"));
|
||||
cgi.Cvar_Set("cg_obj_alliedtext4", Info_ValueForKey(info, "g_obj_alliedtext4"));
|
||||
cgi.Cvar_Set("cg_obj_alliedtext5", Info_ValueForKey(info, "g_obj_alliedtext5"));
|
||||
cgi.Cvar_Set("cg_obj_axistext1", Info_ValueForKey(info, "g_obj_axistext1"));
|
||||
cgi.Cvar_Set("cg_obj_axistext2", Info_ValueForKey(info, "g_obj_axistext2"));
|
||||
cgi.Cvar_Set("cg_obj_axistext3", Info_ValueForKey(info, "g_obj_axistext3"));
|
||||
cgi.Cvar_Set("cg_obj_axistext4", Info_ValueForKey(info, "g_obj_axistext4"));
|
||||
cgi.Cvar_Set("cg_obj_axistext5", Info_ValueForKey(info, "g_obj_axistext5"));
|
||||
cgi.Cvar_Set("cg_scoreboardpic", Info_ValueForKey(info, "g_scoreboardpic"));
|
||||
cgi.Cvar_Set("cg_scoreboardpicover", Info_ValueForKey(info, "g_scoreboardpicover"));
|
||||
cgs.mapChecksum = atoi(Info_ValueForKey(info, "sv_mapChecksum"));
|
||||
mapChecksumStr = Info_ValueForKey(info, "sv_mapChecksum");
|
||||
if (mapChecksumStr && mapChecksumStr[0]) {
|
||||
cgs.mapChecksum = atoi(mapChecksumStr);
|
||||
cgs.useMapChecksum = qtrue;
|
||||
} else {
|
||||
cgs.mapChecksum = 0;
|
||||
cgs.useMapChecksum = qfalse;
|
||||
}
|
||||
|
||||
mapname = Info_ValueForKey(info, "mapname");
|
||||
|
||||
@@ -136,28 +187,22 @@ void CG_ParseServerinfo(void)
|
||||
if (spawnpos) {
|
||||
Q_strncpyz(map, mapname, spawnpos - mapname + 1);
|
||||
} else {
|
||||
strcpy(map, mapname);
|
||||
Q_strncpyz(map, mapname, sizeof(map));
|
||||
}
|
||||
|
||||
Com_sprintf(cgs.mapname, sizeof(cgs.mapname), "maps/%s.bsp", map);
|
||||
|
||||
// hide/show huds
|
||||
if (cgs.gametype)
|
||||
{
|
||||
if (cgs.gametype) {
|
||||
cgi.Cmd_Execute(EXEC_NOW, "ui_addhud hud_timelimit\n");
|
||||
if (cgs.fraglimit)
|
||||
{
|
||||
if (cgs.fraglimit) {
|
||||
cgi.Cmd_Execute(EXEC_NOW, "ui_addhud hud_fraglimit\n");
|
||||
cgi.Cmd_Execute(EXEC_NOW, "ui_removehud hud_score\n");
|
||||
}
|
||||
else
|
||||
{
|
||||
} else {
|
||||
cgi.Cmd_Execute(EXEC_NOW, "ui_addhud hud_score\n");
|
||||
cgi.Cmd_Execute(EXEC_NOW, "ui_removehud hud_fraglimit\n");
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
} else {
|
||||
cgi.Cmd_Execute(EXEC_NOW, "ui_removehud hud_timelimit\n");
|
||||
cgi.Cmd_Execute(EXEC_NOW, "ui_removehud hud_fraglimit\n");
|
||||
cgi.Cmd_Execute(EXEC_NOW, "ui_removehud hud_score\n");
|
||||
@@ -170,17 +215,13 @@ CG_ConfigStringModified
|
||||
|
||||
================
|
||||
*/
|
||||
static void CG_ConfigStringModified(void)
|
||||
static void CG_ConfigStringModified(int num, qboolean modelOnly)
|
||||
{
|
||||
int num;
|
||||
|
||||
num = atoi(cgi.Argv(1));
|
||||
|
||||
// get the gamestate from the client system, which will have the
|
||||
// new configstring already integrated
|
||||
cgi.GetGameState(&cgs.gameState);
|
||||
|
||||
CG_ProcessConfigString(num);
|
||||
CG_ProcessConfigString(num, modelOnly);
|
||||
}
|
||||
|
||||
/*
|
||||
@@ -219,32 +260,29 @@ CG_Stopwatch_f
|
||||
|
||||
================
|
||||
*/
|
||||
#if TARGET_GAME_PROTOCOL >= 15
|
||||
|
||||
static void CG_Stopwatch_f()
|
||||
{
|
||||
if (cgi.Argc() < 3) {
|
||||
Com_Error(ERR_DROP, "stopwatch didn't have 2 parameters");
|
||||
}
|
||||
if (cgi.Argc() < 3) {
|
||||
Com_Error(ERR_DROP, "stopwatch didn't have 2 parameters");
|
||||
}
|
||||
|
||||
cgi.stopWatch->iStartTime = atoi(cgi.Argv(1));
|
||||
cgi.stopWatch->iEndTime = cgi.stopWatch->iStartTime + 1000 * atoi(cgi.Argv(2));
|
||||
if (cg_protocol >= PROTOCOL_MOHTA_MIN) {
|
||||
cgi.stopWatch->iStartTime = atoi(cgi.Argv(1));
|
||||
|
||||
if (cgi.Argc() > 3) {
|
||||
cgi.stopWatch->eType = atoi(cgi.Argv(3));
|
||||
} else {
|
||||
// Normal stop watch
|
||||
cgi.stopWatch->eType = SWT_NORMAL;
|
||||
}
|
||||
} else {
|
||||
// The base game has it wrong
|
||||
cgi.stopWatch->iStartTime = 1000 * atoi(cgi.Argv(1));
|
||||
}
|
||||
|
||||
cgi.stopWatch->iEndTime = cgi.stopWatch->iStartTime + 1000 * atoi(cgi.Argv(2));
|
||||
}
|
||||
|
||||
#else
|
||||
|
||||
static void CG_Stopwatch_f()
|
||||
{
|
||||
if (cgi.Argc() < 3) {
|
||||
Com_Error(ERR_DROP, "stopwatch didn't have 2 parameters");
|
||||
}
|
||||
|
||||
cgi.stopWatch->iStartTime = 1000 * atoi(cgi.Argv(1));
|
||||
cgi.stopWatch->iEndTime = cgi.stopWatch->iStartTime + 1000 * atoi(cgi.Argv(2));
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
/*
|
||||
================
|
||||
CG_ServerLag_f
|
||||
@@ -264,9 +302,9 @@ The string has been tokenized and can be retrieved with
|
||||
Cmd_Argc() / Cmd_Argv()
|
||||
=================
|
||||
*/
|
||||
static void CG_ServerCommand(void)
|
||||
static void CG_ServerCommand(qboolean modelOnly)
|
||||
{
|
||||
const char* cmd;
|
||||
const char *cmd;
|
||||
|
||||
cmd = cgi.Argv(0);
|
||||
|
||||
@@ -276,7 +314,11 @@ static void CG_ServerCommand(void)
|
||||
}
|
||||
|
||||
if (!strcmp(cmd, "cs")) {
|
||||
CG_ConfigStringModified();
|
||||
CG_ConfigStringModified(cgi.getConfigStringIdNormalized(atoi(cgi.Argv(1))), modelOnly);
|
||||
return;
|
||||
}
|
||||
|
||||
if (modelOnly) {
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -286,54 +328,56 @@ static void CG_ServerCommand(void)
|
||||
CG_HudPrint_f();
|
||||
}
|
||||
return;
|
||||
}
|
||||
else if (!strcmp(cmd, "printdeathmsg")) {
|
||||
const char* s1, * s2, * s3, * s4, * s5;
|
||||
const char* result1, * result2;
|
||||
int hudColor;
|
||||
} else if (!strcmp(cmd, "printdeathmsg")) {
|
||||
const char *s1, *s2, *attackerName, *victimName, *type;
|
||||
const char *result1, *result2;
|
||||
int hudColor;
|
||||
|
||||
result1 = NULL;
|
||||
result2 = NULL;
|
||||
s1 = cgi.Argv(1);
|
||||
s2 = cgi.Argv(2);
|
||||
s3 = cgi.Argv(3);
|
||||
s4 = cgi.Argv(4);
|
||||
s5 = cgi.Argv(5);
|
||||
result1 = NULL;
|
||||
result2 = NULL;
|
||||
s1 = cgi.Argv(1);
|
||||
s2 = cgi.Argv(2);
|
||||
attackerName = cgi.Argv(3);
|
||||
victimName = cgi.Argv(4);
|
||||
type = cgi.Argv(5);
|
||||
|
||||
if (*s5 == tolower(*s5)) {
|
||||
if (*type == tolower(*type)) {
|
||||
hudColor = 4;
|
||||
} else {
|
||||
hudColor = 5;
|
||||
hudColor = 5;
|
||||
}
|
||||
|
||||
if (*s1 != 'x')
|
||||
result1 = cgi.LV_ConvertString(s1);
|
||||
if (*s2 != 'x')
|
||||
result2 = cgi.LV_ConvertString(s2);
|
||||
if (tolower(*s5) == 's')
|
||||
{
|
||||
cgi.Printf("%c%s %s\n", hudColor, s4, result1);
|
||||
}
|
||||
else if (tolower(*s5) == 'p')
|
||||
{
|
||||
if (*s2 == 'x')
|
||||
cgi.Printf("%c%s %s %s\n", hudColor, s4, result1, s3);
|
||||
else
|
||||
cgi.Printf("%c%s %s %s%s\n", hudColor, s4, result1, s3, result2);
|
||||
}
|
||||
else if (tolower(*s5) == 'w')
|
||||
{
|
||||
cgi.Printf("%c%s %s\n", hudColor, s4, result1);
|
||||
}
|
||||
else
|
||||
{
|
||||
cgi.Printf("%s", cgi.Argv(1));
|
||||
}
|
||||
if (*s1 != 'x') {
|
||||
result1 = cgi.LV_ConvertString(s1);
|
||||
}
|
||||
if (*s2 != 'x') {
|
||||
result2 = cgi.LV_ConvertString(s2);
|
||||
}
|
||||
if (tolower(*type) == 's') {
|
||||
cgi.Printf("%c%s %s\n", hudColor, victimName, result1);
|
||||
} else if (tolower(*type) == 'p') {
|
||||
if (*s2 == 'x') {
|
||||
cgi.Printf("%c%s %s %s\n", hudColor, victimName, result1, attackerName);
|
||||
} else {
|
||||
cgi.Printf("%c%s %s %s%s\n", hudColor, victimName, result1, attackerName, result2);
|
||||
}
|
||||
} else if (tolower(*type) == 'w') {
|
||||
cgi.Printf("%c%s %s\n", hudColor, victimName, result1);
|
||||
} else {
|
||||
cgi.Printf("%s", cgi.Argv(1));
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
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;
|
||||
}
|
||||
@@ -358,6 +402,28 @@ static void CG_ServerCommand(void)
|
||||
return;
|
||||
}
|
||||
|
||||
if (!strcmp(cmd, "voteresult")) {
|
||||
cmd = cgi.Argv(1);
|
||||
if (*cmd) {
|
||||
strcmp(cmd, "passed");
|
||||
}
|
||||
}
|
||||
|
||||
if (!strcmp(cmd, "vo0")) {
|
||||
CG_VoteOptions_StartReadFromServer(cgi.Argv(1));
|
||||
return;
|
||||
}
|
||||
|
||||
if (!strcmp(cmd, "vo1")) {
|
||||
CG_VoteOptions_ContinueReadFromServer(cgi.Argv(1));
|
||||
return;
|
||||
}
|
||||
|
||||
if (!strcmp(cmd, "vo2")) {
|
||||
CG_VoteOptions_FinishReadFromServer(cgi.Argv(1));
|
||||
return;
|
||||
}
|
||||
|
||||
cgi.Printf("Unknown client game command: %s\n", cmd);
|
||||
}
|
||||
|
||||
@@ -371,9 +437,250 @@ with this this snapshot.
|
||||
*/
|
||||
void CG_ExecuteNewServerCommands(int latestSequence, qboolean differentServer)
|
||||
{
|
||||
int lastServerCommandSequence;
|
||||
|
||||
lastServerCommandSequence = cgs.serverCommandSequence;
|
||||
|
||||
while (cgs.serverCommandSequence < latestSequence) {
|
||||
if (cgi.GetServerCommand(++cgs.serverCommandSequence, differentServer)) {
|
||||
CG_ServerCommand();
|
||||
CG_ServerCommand(qtrue);
|
||||
}
|
||||
}
|
||||
|
||||
cgs.serverCommandSequence = lastServerCommandSequence;
|
||||
while (cgs.serverCommandSequence < latestSequence) {
|
||||
if (cgi.GetServerCommand(++cgs.serverCommandSequence, differentServer)) {
|
||||
CG_ServerCommand(qfalse);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//
|
||||
// List of client variables allowed to be changed by the server
|
||||
//
|
||||
static const char *whiteListedVariables[] = {
|
||||
"r_fastsky", // some mods set this variable to make the sky uniform
|
||||
"ui_hud",
|
||||
};
|
||||
|
||||
//
|
||||
// List of client variables allowed to be changed by the server
|
||||
//
|
||||
static const char *whiteListedLocalServerVariables[] = {"ui_hidemouse", "ui_showmouse", "cg_marks_add"};
|
||||
|
||||
//
|
||||
// List of commands allowed to be executed by the server
|
||||
//
|
||||
static const char *whiteListedCommands[] = {
|
||||
"primarydmweapon",
|
||||
"pushmenu",
|
||||
"pushmenu_teamselect",
|
||||
"pushmenu_weaponselect",
|
||||
"popmenu",
|
||||
"wait",
|
||||
"globalwidgetcommand", // used for mods adding custom HUDs
|
||||
"ui_addhud",
|
||||
"ui_removehud",
|
||||
"tmstart",
|
||||
"tmstartloop",
|
||||
"tmstop",
|
||||
"tmvolume",
|
||||
"`stufftext",
|
||||
"+moveup", // workaround for mods that want to prevent inactivity when handling the spectate
|
||||
"-moveup",
|
||||
"screenshot",
|
||||
"screenshotJPEG",
|
||||
"levelshot"
|
||||
};
|
||||
|
||||
//
|
||||
// List of commands allowed to be executed by the server
|
||||
//
|
||||
static const char *whiteListedLocalServerCommands[] = {
|
||||
"spmap", // Used by briefings
|
||||
"map",
|
||||
"disconnect",
|
||||
"cinematic",
|
||||
"showmenu",
|
||||
"hidemenu"
|
||||
};
|
||||
|
||||
/*
|
||||
====================
|
||||
CG_IsVariableFiltered
|
||||
|
||||
Returns whether or not the variable should be filtered
|
||||
====================
|
||||
*/
|
||||
static qboolean CG_IsVariableFiltered(const char *name)
|
||||
{
|
||||
cvar_t *var;
|
||||
size_t i;
|
||||
|
||||
for (i = 0; i < ARRAY_LEN(whiteListedVariables); i++) {
|
||||
if (!Q_stricmp(name, whiteListedVariables[i])) {
|
||||
return qfalse;
|
||||
}
|
||||
}
|
||||
|
||||
if (cgs.localServer) {
|
||||
for (i = 0; i < ARRAY_LEN(whiteListedLocalServerVariables); i++) {
|
||||
if (!Q_stricmp(name, whiteListedLocalServerVariables[i])) {
|
||||
return qfalse;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Filtered
|
||||
return qtrue;
|
||||
}
|
||||
|
||||
/*
|
||||
====================
|
||||
CG_IsSetVariableFiltered
|
||||
|
||||
Returns whether or not the variable should be filtered
|
||||
====================
|
||||
*/
|
||||
static qboolean CG_IsSetVariableFiltered(const char *name, char type)
|
||||
{
|
||||
cvar_t *var;
|
||||
|
||||
if (!CG_IsVariableFiltered(name)) {
|
||||
return qfalse;
|
||||
}
|
||||
|
||||
if (type != 'u' && type != 's') {
|
||||
// Don't allow custom info variables to avoid flooding
|
||||
// the client with many serverinfo and userinfo variables
|
||||
|
||||
var = cgi.Cvar_Find(name);
|
||||
if (!var) {
|
||||
// Allow as it doesn't exist
|
||||
return qfalse;
|
||||
}
|
||||
|
||||
if (var->flags & CVAR_USER_CREATED) {
|
||||
// Allow, it's user-created, wouldn't cause issues
|
||||
return qfalse;
|
||||
}
|
||||
}
|
||||
|
||||
// Filtered
|
||||
return qtrue;
|
||||
}
|
||||
|
||||
/*
|
||||
====================
|
||||
CG_IsCommandFiltered
|
||||
|
||||
Returns whether or not the variable should be filtered
|
||||
====================
|
||||
*/
|
||||
static qboolean CG_IsCommandFiltered(const char *name)
|
||||
{
|
||||
size_t i;
|
||||
|
||||
for (i = 0; i < ARRAY_LEN(whiteListedCommands); i++) {
|
||||
if (!Q_stricmp(name, whiteListedCommands[i])) {
|
||||
return qfalse;
|
||||
}
|
||||
}
|
||||
|
||||
if (cgs.localServer) {
|
||||
// Allow more commands when the client is hosting the server
|
||||
// Mostly used on single-player mode, like when briefings switch to the next map
|
||||
for (i = 0; i < ARRAY_LEN(whiteListedLocalServerCommands); i++) {
|
||||
if (!Q_stricmp(name, whiteListedLocalServerCommands[i])) {
|
||||
return qfalse;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//
|
||||
// Test variables
|
||||
//
|
||||
return CG_IsVariableFiltered(name);
|
||||
}
|
||||
|
||||
/*
|
||||
====================
|
||||
RemoveEndToken
|
||||
====================
|
||||
*/
|
||||
static qboolean RemoveEndToken(char* com_token) {
|
||||
char* p;
|
||||
|
||||
for (p = com_token; p[0]; p++) {
|
||||
if (*p == ';') {
|
||||
*p = 0;
|
||||
return qtrue;
|
||||
}
|
||||
}
|
||||
|
||||
return qfalse;
|
||||
}
|
||||
|
||||
/*
|
||||
====================
|
||||
CG_IsStatementFiltered
|
||||
|
||||
Returns whether or not the statement is filtered
|
||||
====================
|
||||
*/
|
||||
static qboolean CG_IsStatementFiltered(char *cmd)
|
||||
{
|
||||
char* parsed;
|
||||
char* p;
|
||||
char com_token[256];
|
||||
qboolean bNextStatement = qfalse;
|
||||
|
||||
parsed = cmd;
|
||||
|
||||
for (Q_strncpyz(com_token, COM_ParseExt(&parsed, qtrue), sizeof(com_token)); com_token[0]; Q_strncpyz(com_token, COM_ParseExt(&parsed, qtrue), sizeof(com_token))) {
|
||||
bNextStatement = RemoveEndToken(com_token);
|
||||
|
||||
if (com_token[0] == ';') {
|
||||
continue;
|
||||
}
|
||||
|
||||
if (!Q_stricmp(com_token, "set") || !Q_stricmp(com_token, "setu") || !Q_stricmp(com_token, "seta")
|
||||
|| !Q_stricmp(com_token, "sets")) {
|
||||
char type = com_token[3];
|
||||
|
||||
//
|
||||
// variable
|
||||
//
|
||||
Q_strncpyz(com_token, COM_ParseExt(&parsed, qfalse), sizeof(com_token));
|
||||
bNextStatement |= RemoveEndToken(com_token);
|
||||
if (com_token[0] == ';') {
|
||||
continue;
|
||||
}
|
||||
|
||||
if (CG_IsSetVariableFiltered(com_token, type)) {
|
||||
return qtrue;
|
||||
}
|
||||
} else {
|
||||
//
|
||||
// normal command
|
||||
//
|
||||
if (CG_IsCommandFiltered(com_token)) {
|
||||
return qtrue;
|
||||
}
|
||||
}
|
||||
|
||||
if (!bNextStatement) {
|
||||
// Skip up to the next statement
|
||||
while (parsed && parsed[0]) {
|
||||
char c = parsed[0];
|
||||
|
||||
parsed++;
|
||||
if (c == '\n' || c == ';') {
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return qfalse;
|
||||
}
|
||||
+75
-67
@@ -23,8 +23,12 @@ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
// DESCRIPTION:
|
||||
// things that happen on snapshot transition, not necessarily every
|
||||
// single frame
|
||||
//
|
||||
// ADDITIONS:
|
||||
// - CG_TransitionSnapshot() footer: set ps.walking to true if the ps has a ground entity
|
||||
|
||||
#include "cg_local.h"
|
||||
#include "cg_radar.h"
|
||||
#include "tiki.h"
|
||||
|
||||
/*
|
||||
@@ -32,10 +36,10 @@ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
CG_ResetEntity
|
||||
==================
|
||||
*/
|
||||
static void CG_ResetEntity(centity_t* cent)
|
||||
static void CG_ResetEntity(centity_t *cent)
|
||||
{
|
||||
dtiki_t* tiki;
|
||||
int i;
|
||||
dtiki_t *tiki;
|
||||
int i;
|
||||
|
||||
VectorCopy(cent->currentState.origin, cent->lerpOrigin);
|
||||
|
||||
@@ -62,17 +66,17 @@ static void CG_ResetEntity(centity_t* cent)
|
||||
|
||||
// Reset splash info
|
||||
cent->splash_last_spawn_time = 0;
|
||||
cent->splash_still_count = -1;
|
||||
cent->splash_still_count = -1;
|
||||
|
||||
tiki = cgi.R_Model_GetHandle(cgs.model_draw[cent->currentState.modelindex]);
|
||||
// reset client command
|
||||
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 {
|
||||
@@ -83,14 +87,15 @@ static void CG_ResetEntity(centity_t* cent)
|
||||
} else {
|
||||
// clear all the last animations
|
||||
for (i = 0; i < MAX_FRAMEINFOS; i++) {
|
||||
cent->animLast[i] = -1;
|
||||
cent->animLast[i] = -1;
|
||||
cent->animLastTimes[i] = 0.0;
|
||||
}
|
||||
|
||||
cent->animLastWeight = 0;
|
||||
}
|
||||
|
||||
cent->usageIndexLast = 0;
|
||||
cent->bFootOnGround_Left = qtrue;
|
||||
cent->usageIndexLast = 0;
|
||||
cent->bFootOnGround_Left = qtrue;
|
||||
cent->bFootOnGround_Right = qtrue;
|
||||
|
||||
if (cent->currentState.eType == ET_PLAYER) {
|
||||
@@ -105,7 +110,7 @@ CG_TransitionEntity
|
||||
cent->nextState is moved to cent->currentState and events are fired
|
||||
===============
|
||||
*/
|
||||
static void CG_TransitionEntity(centity_t* cent)
|
||||
static void CG_TransitionEntity(centity_t *cent)
|
||||
{
|
||||
cent->currentState = cent->nextState;
|
||||
cent->currentValid = qtrue;
|
||||
@@ -134,11 +139,11 @@ on tourney restarts. All other times will use
|
||||
CG_TransitionSnapshot instead.
|
||||
==================
|
||||
*/
|
||||
void CG_SetInitialSnapshot(snapshot_t* snap)
|
||||
void CG_SetInitialSnapshot(snapshot_t *snap)
|
||||
{
|
||||
int i;
|
||||
centity_t* cent;
|
||||
entityState_t* state;
|
||||
int i;
|
||||
centity_t *cent;
|
||||
entityState_t *state;
|
||||
|
||||
cg.snap = snap;
|
||||
|
||||
@@ -149,20 +154,21 @@ void CG_SetInitialSnapshot(snapshot_t* snap)
|
||||
|
||||
for (i = 0; i < cg.snap->numEntities; i++) {
|
||||
state = &cg.snap->entities[i];
|
||||
cent = &cg_entities[state->number];
|
||||
cent = &cg_entities[state->number];
|
||||
|
||||
cent->currentState = *state;
|
||||
cent->interpolate = qfalse;
|
||||
cent->interpolate = qfalse;
|
||||
cent->currentValid = qtrue;
|
||||
|
||||
CG_ResetEntity(cent);
|
||||
}
|
||||
|
||||
cgi.MUSIC_UpdateMood(snap->ps.current_music_mood,
|
||||
snap->ps.fallback_music_mood);
|
||||
cgi.MUSIC_UpdateVolume(snap->ps.music_volume,
|
||||
snap->ps.music_volume_fade_time);
|
||||
cgi.MUSIC_UpdateMood(snap->ps.current_music_mood, snap->ps.fallback_music_mood);
|
||||
cgi.MUSIC_UpdateVolume(snap->ps.music_volume, snap->ps.music_volume_fade_time);
|
||||
cgi.S_SetReverb(snap->ps.reverb_type, snap->ps.reverb_level);
|
||||
|
||||
CG_InitRadar();
|
||||
cgi.CL_RestoreSavedCgameState();
|
||||
}
|
||||
|
||||
/*
|
||||
@@ -174,9 +180,9 @@ The transition point from snap to nextSnap has passed
|
||||
*/
|
||||
static void CG_TransitionSnapshot(qboolean differentServer)
|
||||
{
|
||||
centity_t* cent;
|
||||
snapshot_t* oldFrame;
|
||||
int i;
|
||||
centity_t *cent;
|
||||
snapshot_t *oldFrame;
|
||||
int i;
|
||||
|
||||
if (differentServer) {
|
||||
CG_ServerRestarted();
|
||||
@@ -187,13 +193,13 @@ static void CG_TransitionSnapshot(qboolean differentServer)
|
||||
|
||||
// clear the currentValid flag for all entities in the existing snapshot
|
||||
for (i = 0; i < cg.snap->numEntities; i++) {
|
||||
cent = &cg_entities[cg.snap->entities[i].number];
|
||||
cent = &cg_entities[cg.snap->entities[i].number];
|
||||
cent->currentValid = qfalse;
|
||||
}
|
||||
|
||||
// move nextSnap to snap and do the transitions
|
||||
oldFrame = cg.snap;
|
||||
cg.snap = cg.nextSnap;
|
||||
cg.snap = cg.nextSnap;
|
||||
|
||||
// FAKK: Commented out to make our stuff work
|
||||
// cg_entities[ cg.snap->ps.clientNum ].interpolate = qfalse;
|
||||
@@ -202,9 +208,12 @@ static void CG_TransitionSnapshot(qboolean differentServer)
|
||||
cent = &cg_entities[cg.snap->entities[i].number];
|
||||
if (differentServer) {
|
||||
cent->interpolate = qfalse;
|
||||
cent->teleported = qfalse;
|
||||
cent->teleported = qfalse;
|
||||
}
|
||||
CG_TransitionEntity(cent);
|
||||
|
||||
// remember time of snapshot this entity was last updated in
|
||||
cent->snapShotTime = cg.snap->serverTime;
|
||||
}
|
||||
|
||||
for (i = 0; i < cg.snap->number_of_sounds; i++) {
|
||||
@@ -220,31 +229,37 @@ static void CG_TransitionSnapshot(qboolean differentServer)
|
||||
playerState_t *ops, *ps;
|
||||
|
||||
ops = &oldFrame->ps;
|
||||
ps = &cg.snap->ps;
|
||||
ps = &cg.snap->ps;
|
||||
|
||||
// teleporting checks are irrespective of prediction
|
||||
if (ps->pm_flags & PMF_RESPAWNED) {
|
||||
cg.thisFrameTeleport = qtrue;
|
||||
}
|
||||
|
||||
if ((ops->music_volume != ps->music_volume) ||
|
||||
(ops->music_volume_fade_time != ps->music_volume_fade_time)) {
|
||||
cgi.MUSIC_UpdateVolume(ps->music_volume,
|
||||
ps->music_volume_fade_time);
|
||||
if ((ops->music_volume != ps->music_volume) || (ops->music_volume_fade_time != ps->music_volume_fade_time)) {
|
||||
cgi.MUSIC_UpdateVolume(ps->music_volume, ps->music_volume_fade_time);
|
||||
}
|
||||
|
||||
if ((ops->reverb_type != ps->reverb_type) ||
|
||||
(ops->reverb_level != ps->reverb_level)) {
|
||||
if ((ops->reverb_type != ps->reverb_type) || (ops->reverb_level != ps->reverb_level)) {
|
||||
cgi.S_SetReverb(ps->reverb_type, ps->reverb_level);
|
||||
}
|
||||
|
||||
// if we are not doing client side movement prediction for any
|
||||
// reason, then the client events and view changes will be issued now
|
||||
if (cg.demoPlayback || (cg.snap->ps.pm_flags & PMF_NO_PREDICTION) ||
|
||||
cg_nopredict->integer || cg_synchronousClients->integer) {
|
||||
if (cg.demoPlayback || (cg.snap->ps.pm_flags & PMF_NO_PREDICTION) || cg_nopredict->integer
|
||||
|| cg_synchronousClients->integer) {
|
||||
CG_TransitionPlayerState(ps, ops);
|
||||
}
|
||||
}
|
||||
|
||||
if (differentServer) {
|
||||
cgi.CL_RestoreSavedCgameState();
|
||||
} else {
|
||||
cgi.CL_ClearSavedCgameState();
|
||||
}
|
||||
|
||||
// this allows the view model to still look normal when the player is on ground
|
||||
cg.snap->ps.walking = cg.snap->ps.groundEntityNum != ENTITYNUM_NONE;
|
||||
}
|
||||
|
||||
/*
|
||||
@@ -254,11 +269,11 @@ CG_SetNextSnap
|
||||
A new snapshot has just been read in from the client system.
|
||||
===================
|
||||
*/
|
||||
static void CG_SetNextSnap(snapshot_t* snap)
|
||||
static void CG_SetNextSnap(snapshot_t *snap)
|
||||
{
|
||||
int num;
|
||||
entityState_t* es;
|
||||
centity_t* cent;
|
||||
int num;
|
||||
entityState_t *es;
|
||||
centity_t *cent;
|
||||
|
||||
cg.nextSnap = snap;
|
||||
|
||||
@@ -266,17 +281,15 @@ static void CG_SetNextSnap(snapshot_t* snap)
|
||||
|
||||
// check for extrapolation errors
|
||||
for (num = 0; num < snap->numEntities; num++) {
|
||||
es = &snap->entities[num];
|
||||
es = &snap->entities[num];
|
||||
cent = &cg_entities[es->number];
|
||||
|
||||
cent->nextState = *es;
|
||||
|
||||
// if this frame is a teleport, or the entity wasn't in the
|
||||
// previous frame, don't interpolate
|
||||
if (!cent->currentValid ||
|
||||
((cent->currentState.eFlags ^ es->eFlags) & EF_TELEPORT_BIT) ||
|
||||
(cent->currentState.parent != es->parent) ||
|
||||
(cent->currentState.modelindex != es->modelindex)) {
|
||||
if (!cent->currentValid || ((cent->currentState.eFlags ^ es->eFlags) & EF_TELEPORT_BIT)
|
||||
|| (cent->currentState.parent != es->parent) || (cent->currentState.modelindex != es->modelindex)) {
|
||||
cent->interpolate = qfalse;
|
||||
// if this isn't the first frame and we have valid data, set the
|
||||
// teleport flag
|
||||
@@ -302,8 +315,7 @@ static void CG_SetNextSnap(snapshot_t* snap)
|
||||
}
|
||||
|
||||
// if the camera cut bit changed, than the next frame is a camera cut
|
||||
if ((cg.nextSnap->ps.camera_flags & CF_CAMERA_CUT_BIT) !=
|
||||
(cg.snap->ps.camera_flags & CF_CAMERA_CUT_BIT)) {
|
||||
if ((cg.nextSnap->ps.camera_flags & CF_CAMERA_CUT_BIT) != (cg.snap->ps.camera_flags & CF_CAMERA_CUT_BIT)) {
|
||||
cg.nextFrameCameraCut = qtrue;
|
||||
} else {
|
||||
cg.nextFrameCameraCut = qfalse;
|
||||
@@ -329,14 +341,17 @@ times if the client system fails to return a
|
||||
valid snapshot.
|
||||
========================
|
||||
*/
|
||||
static snapshot_t* CG_ReadNextSnapshot(void)
|
||||
static snapshot_t *CG_ReadNextSnapshot(void)
|
||||
{
|
||||
qboolean r;
|
||||
snapshot_t* dest;
|
||||
qboolean r;
|
||||
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
|
||||
);
|
||||
}
|
||||
|
||||
while (cgs.processedSnapshotNum < cg.latestSnapshotNum) {
|
||||
@@ -394,17 +409,16 @@ of an interpolating one)
|
||||
*/
|
||||
void CG_ProcessSnapshots(void)
|
||||
{
|
||||
snapshot_t* snap;
|
||||
int n;
|
||||
qboolean differentServer;
|
||||
snapshot_t *snap;
|
||||
int n;
|
||||
qboolean differentServer;
|
||||
|
||||
// see what the latest snapshot the client system has is
|
||||
cgi.GetCurrentSnapshotNumber(&n, &cg.latestSnapshotTime);
|
||||
if (n != cg.latestSnapshotNum) {
|
||||
if (n < cg.latestSnapshotNum) {
|
||||
// this should never happen
|
||||
cgi.Error(ERR_DROP,
|
||||
"CG_ProcessSnapshots: n < cg.latestSnapshotNum");
|
||||
cgi.Error(ERR_DROP, "CG_ProcessSnapshots: n < cg.latestSnapshotNum");
|
||||
}
|
||||
cg.latestSnapshotNum = n;
|
||||
}
|
||||
@@ -445,11 +459,8 @@ void CG_ProcessSnapshots(void)
|
||||
// if time went backwards, we have a level restart
|
||||
if (cg.nextSnap->serverTime < cg.snap->serverTime) {
|
||||
// only drop if this is not a restart or loadgame
|
||||
if (!((cg.nextSnap->snapFlags ^ cg.snap->snapFlags) &
|
||||
SNAPFLAG_SERVERCOUNT)) {
|
||||
cgi.Error(
|
||||
ERR_DROP,
|
||||
"CG_ProcessSnapshots: Server time went backwards");
|
||||
if (!((cg.nextSnap->snapFlags ^ cg.snap->snapFlags) & SNAPFLAG_SERVERCOUNT)) {
|
||||
cgi.Error(ERR_DROP, "CG_ProcessSnapshots: Server time went backwards");
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -457,9 +468,7 @@ void CG_ProcessSnapshots(void)
|
||||
differentServer = cg.snap->serverTime <= cgi.GetServerStartTime();
|
||||
|
||||
// if our time is < nextFrame's, we have a nice interpolating state
|
||||
if (cg.time >= cg.snap->serverTime &&
|
||||
cg.time < cg.nextSnap->serverTime &&
|
||||
!differentServer) {
|
||||
if (cg.time >= cg.snap->serverTime && cg.time < cg.nextSnap->serverTime && !differentServer) {
|
||||
break;
|
||||
}
|
||||
|
||||
@@ -477,7 +486,6 @@ void CG_ProcessSnapshots(void)
|
||||
cgi.SetTime(cg.time);
|
||||
}
|
||||
if (cg.nextSnap != NULL && cg.nextSnap->serverTime <= cg.time) {
|
||||
cgi.Error(ERR_DROP,
|
||||
"CG_ProcessSnapshots: cg.nextSnap->serverTime <= cg.time");
|
||||
cgi.Error(ERR_DROP, "CG_ProcessSnapshots: cg.nextSnap->serverTime <= cg.time");
|
||||
}
|
||||
}
|
||||
+18
-12
@@ -25,15 +25,21 @@ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
|
||||
#include "cg_local.h"
|
||||
|
||||
void CG_ProcessSound( server_sound_t *sound )
|
||||
{
|
||||
if ( sound->stop_flag )
|
||||
{
|
||||
cgi.S_StopSound( sound->entity_number, sound->channel );
|
||||
}
|
||||
else
|
||||
{
|
||||
cgi.S_StartSound( sound->origin, sound->entity_number, sound->channel, cgs.sound_precache[sound->sound_index],
|
||||
sound->volume, sound->min_dist, sound->pitch, sound->maxDist, sound->streamed );
|
||||
}
|
||||
}
|
||||
void CG_ProcessSound(server_sound_t *sound)
|
||||
{
|
||||
if (sound->stop_flag) {
|
||||
cgi.S_StopSound(sound->entity_number, sound->channel);
|
||||
} else {
|
||||
cgi.S_StartSound(
|
||||
sound->origin,
|
||||
sound->entity_number,
|
||||
sound->channel,
|
||||
cgs.sound_precache[sound->sound_index],
|
||||
sound->volume,
|
||||
sound->min_dist,
|
||||
sound->pitch,
|
||||
sound->maxDist,
|
||||
sound->streamed
|
||||
);
|
||||
}
|
||||
}
|
||||
+742
-599
File diff suppressed because it is too large.
Load diff
+134
-20
@@ -31,11 +31,127 @@ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
|
||||
#define MAX_SPECIAL_EFFECT_COMMANDS 32
|
||||
|
||||
class specialeffectcommand_t : public Class {
|
||||
typedef enum {
|
||||
SFX_BHIT_PAPER_LITE,
|
||||
SFX_BHIT_PAPER_HARD,
|
||||
SFX_BHIT_WOOD_LITE,
|
||||
SFX_BHIT_WOOD_HARD,
|
||||
SFX_BHIT_METAL_LITE,
|
||||
SFX_BHIT_METAL_HARD,
|
||||
SFX_BHIT_STONE_LITE,
|
||||
SFX_BHIT_STONE_HARD,
|
||||
SFX_BHIT_DIRT_LITE,
|
||||
SFX_BHIT_DIRT_HARD,
|
||||
SFX_BHIT_GRILL_LITE,
|
||||
SFX_BHIT_GRILL_HARD,
|
||||
SFX_BHIT_GRASS_LITE,
|
||||
SFX_BHIT_GRASS_HARD,
|
||||
SFX_BHIT_MUD_LITE,
|
||||
SFX_BHIT_MUD_HARD,
|
||||
SFX_BHIT_PUDDLE_LITE,
|
||||
SFX_BHIT_PUDDLE_HARD,
|
||||
SFX_BHIT_GLASS_LITE,
|
||||
SFX_BHIT_GLASS_HARD,
|
||||
SFX_BHIT_GRAVEL_LITE,
|
||||
SFX_BHIT_GRAVEL_HARD,
|
||||
SFX_BHIT_SAND_LITE,
|
||||
SFX_BHIT_SAND_HARD,
|
||||
SFX_BHIT_FOLIAGE_LITE,
|
||||
SFX_BHIT_FOLIAGE_HARD,
|
||||
SFX_BHIT_SNOW_LITE,
|
||||
SFX_BHIT_SNOW_HARD,
|
||||
SFX_BHIT_CARPET_LITE,
|
||||
SFX_BHIT_CARPET_HARD,
|
||||
SFX_BHIT_HUMAN_UNIFORM_LITE,
|
||||
SFX_BHIT_HUMAN_UNIFORM_HARD,
|
||||
SFX_WATER_TRAIL_BUBBLE,
|
||||
SFX_VFX_PAPER_LITE,
|
||||
SFX_VFX_PAPER_HARD,
|
||||
SFX_VFX_WOOD_LITE,
|
||||
SFX_VFX_WOOD_HARD,
|
||||
SFX_VFX_METAL_LITE,
|
||||
SFX_VFX_METAL_HARD,
|
||||
SFX_VFX_STONE_LITE,
|
||||
SFX_VFX_STONE_HARD,
|
||||
SFX_VFX_DIRT_LITE,
|
||||
SFX_VFX_DIRT_HARD,
|
||||
SFX_VFX_GRILL_LITE,
|
||||
SFX_VFX_GRILL_HARD,
|
||||
SFX_VFX_GRASS_LITE,
|
||||
SFX_VFX_GRASS_HARD,
|
||||
SFX_VFX_MUD_LITE,
|
||||
SFX_VFX_MUD_HARD,
|
||||
SFX_VFX_PUDDLE_LITE,
|
||||
SFX_VFX_PUDDLE_HARD,
|
||||
SFX_VFX_GLASS_LITE,
|
||||
SFX_VFX_GLASS_HARD,
|
||||
SFX_VFX_GRAVEL_LITE,
|
||||
SFX_VFX_GRAVEL_HARD,
|
||||
SFX_VFX_SAND_LITE,
|
||||
SFX_VFX_SAND_HARD,
|
||||
SFX_VFX_FOLIAGE_LITE,
|
||||
SFX_VFX_FOLIAGE_HARD,
|
||||
SFX_VFX_SNOW_LITE,
|
||||
SFX_VFX_SNOW_HARD,
|
||||
SFX_VFX_CARPET_LITE,
|
||||
SFX_VFX_CARPET_HARD,
|
||||
SFX_EXP_GREN_BASE,
|
||||
SFX_EXP_BAZOOKA_BASE,
|
||||
SFX_EXP_HEAVYSHELL_BASE,
|
||||
SFX_EXP_TANK_BASE,
|
||||
SFX_EXP_GREN_PAPER,
|
||||
SFX_EXP_GREN_WOOD,
|
||||
SFX_EXP_GREN_METAL,
|
||||
SFX_EXP_GREN_STONE,
|
||||
SFX_EXP_GREN_DIRT,
|
||||
SFX_EXP_GREN_GRILL,
|
||||
SFX_EXP_GREN_GRASS,
|
||||
SFX_EXP_GREN_MUD,
|
||||
SFX_EXP_GREN_PUDDLE,
|
||||
SFX_EXP_GREN_GLASS,
|
||||
SFX_EXP_GREN_GRAVEL,
|
||||
SFX_EXP_GREN_SAND,
|
||||
SFX_EXP_GREN_FOLIAGE,
|
||||
SFX_EXP_GREN_SNOW,
|
||||
SFX_EXP_GREN_CARPET,
|
||||
SFX_EXP_HEAVYSHELL_DIRT,
|
||||
SFX_EXP_HEAVYSHELL_STONE,
|
||||
SFX_EXP_HEAVYSHELL_SNOW,
|
||||
SFX_EXP_TANK_DIRT,
|
||||
SFX_EXP_TANK_STONE,
|
||||
SFX_EXP_TANK_SNOW,
|
||||
SFX_EXP_BAZOOKA_DIRT,
|
||||
SFX_EXP_BAZOOKA_STONE,
|
||||
SFX_EXP_BAZOOKA_SNOW,
|
||||
SFX_WATER_RIPPLE_STILL,
|
||||
SFX_WATER_RIPPLE_MOVING,
|
||||
SFX_OIL_LEAK_BIG,
|
||||
SFX_OIL_LEAK_MEDIUM,
|
||||
SFX_OIL_LEAK_SMALL,
|
||||
SFX_OIL_LEAK_SPLAT,
|
||||
SFX_WATER_LEAK_BIG,
|
||||
SFX_WATER_LEAK_MEDIUM,
|
||||
SFX_WATER_LEAK_SMALL,
|
||||
SFX_WATER_LEAK_SPLAT,
|
||||
SFX_FOOT_LIGHT_DUST,
|
||||
SFX_FOOT_HEAVY_DUST,
|
||||
SFX_FOOT_DIRT,
|
||||
SFX_FOOT_GRASS,
|
||||
SFX_FOOT_MUD,
|
||||
SFX_FOOT_PUDDLE,
|
||||
SFX_FOOT_SAND,
|
||||
SFX_FOOT_SNOW,
|
||||
SFX_FENCE_WOOD,
|
||||
SFX_TEST_EFFECT,
|
||||
SFX_COUNT
|
||||
} SpecialEffects;
|
||||
|
||||
class specialeffectcommand_t : public Class
|
||||
{
|
||||
public:
|
||||
spawnthing_t* emitter;
|
||||
spawnthing_t *emitter;
|
||||
float fCommandTime;
|
||||
void (*endfcn)();
|
||||
void (ClientGameCommandManager::*endfcn)();
|
||||
Event *pEvent;
|
||||
|
||||
public:
|
||||
@@ -45,39 +161,37 @@ public:
|
||||
class specialeffect_t : public Class
|
||||
{
|
||||
public:
|
||||
int m_iCommandCount;
|
||||
specialeffectcommand_t* m_commands[MAX_SPECIAL_EFFECT_COMMANDS];
|
||||
int m_iCommandCount;
|
||||
specialeffectcommand_t *m_commands[MAX_SPECIAL_EFFECT_COMMANDS];
|
||||
|
||||
public:
|
||||
specialeffect_t();
|
||||
|
||||
specialeffectcommand_t* AddNewCommand();
|
||||
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];
|
||||
qboolean m_bEffectsLoaded;
|
||||
int m_iNumPendingEvents;
|
||||
class ClientSpecialEffectsManager : public Listener
|
||||
{
|
||||
specialeffect_t m_effects[SFX_COUNT];
|
||||
qboolean m_bEffectsLoaded;
|
||||
int m_iNumPendingEvents;
|
||||
|
||||
public:
|
||||
CLASS_PROTOTYPE(ClientSpecialEffectsManager);
|
||||
|
||||
private:
|
||||
void ContinueEffectExecution(Event* ev);
|
||||
void ContinueEffectExecution(Event *ev);
|
||||
void ExecuteEffect(int iEffect, int iStartCommand, Vector vPos, Vector vAngles, float axis[3][3]);
|
||||
|
||||
public:
|
||||
ClientSpecialEffectsManager();
|
||||
|
||||
void LoadEffects();
|
||||
qboolean EffectsPending();
|
||||
void MakeEffect_Normal(int iEffect, Vector vPos, Vector vNormal);
|
||||
void MakeEffect_Angles(int iEffect, Vector vPos, Vector vAngles);
|
||||
void MakeEffect_Axis(int iEffect, Vector vPos, float axis[3][3]);
|
||||
specialeffect_t* GetTestEffectPointer();
|
||||
void LoadEffects();
|
||||
qboolean EffectsPending();
|
||||
void MakeEffect_Normal(int iEffect, Vector vPos, Vector vNormal);
|
||||
void MakeEffect_Angles(int iEffect, Vector vPos, Vector vAngles);
|
||||
void MakeEffect_Axis(int iEffect, Vector vPos, float axis[3][3]);
|
||||
specialeffect_t *GetTestEffectPointer();
|
||||
};
|
||||
|
||||
extern ClientSpecialEffectsManager sfxManager;
|
||||
+175
-203
@@ -25,256 +25,228 @@ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
|
||||
#include "cg_commands.h"
|
||||
|
||||
swipething_t m_swipes[MAX_SWIPES];
|
||||
extern int current_entity_number;
|
||||
swipething_t m_swipes[MAX_SWIPES];
|
||||
extern int current_entity_number;
|
||||
extern refEntity_t *current_entity;
|
||||
extern dtiki_t* current_tiki;
|
||||
extern centity_t *current_centity;
|
||||
extern dtiki_t *current_tiki;
|
||||
extern centity_t *current_centity;
|
||||
|
||||
void ClientGameCommandManager::SwipeOn
|
||||
(
|
||||
Event *ev
|
||||
)
|
||||
void ClientGameCommandManager::SwipeOn(Event *ev)
|
||||
|
||||
{
|
||||
// Make a swipe for this if available
|
||||
int i;
|
||||
int freeswipe = -1;
|
||||
str tagname_start,tagname_end;
|
||||
qhandle_t shader;
|
||||
{
|
||||
// Make a swipe for this if available
|
||||
int i;
|
||||
int freeswipe = -1;
|
||||
str tagname_start, tagname_end;
|
||||
qhandle_t shader;
|
||||
|
||||
if ( ev->NumArgs () != 4 )
|
||||
return;
|
||||
if (ev->NumArgs() != 4) {
|
||||
return;
|
||||
}
|
||||
|
||||
shader = cgi.R_RegisterShader( ev->GetString( 1 ) );
|
||||
tagname_start = ev->GetString( 2 );
|
||||
tagname_end = ev->GetString( 3 );
|
||||
|
||||
for ( i=0; i < MAX_SWIPES; i++ )
|
||||
{
|
||||
swipething_t &swipe = m_swipes[i];
|
||||
shader = cgi.R_RegisterShader(ev->GetString(1));
|
||||
tagname_start = ev->GetString(2);
|
||||
tagname_end = ev->GetString(3);
|
||||
|
||||
if ( !swipe.enabled ||
|
||||
(
|
||||
( swipe.entitynum == current_entity_number ) &&
|
||||
( tagname_start == swipe.tagname_start ) &&
|
||||
( tagname_end == swipe.tagname_end ) &&
|
||||
( shader == swipe.shader )
|
||||
)
|
||||
)
|
||||
{
|
||||
freeswipe = i;
|
||||
break;
|
||||
}
|
||||
}
|
||||
for (i = 0; i < MAX_SWIPES; i++) {
|
||||
swipething_t& swipe = m_swipes[i];
|
||||
|
||||
if ( freeswipe == -1 )
|
||||
return;
|
||||
if (!swipe.enabled
|
||||
|| ((swipe.entitynum == current_entity_number) && (tagname_start == swipe.tagname_start)
|
||||
&& (tagname_end == swipe.tagname_end) && (shader == swipe.shader))) {
|
||||
freeswipe = i;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
swipething_t &swipe = m_swipes[freeswipe];
|
||||
if (freeswipe == -1) {
|
||||
return;
|
||||
}
|
||||
|
||||
if ( !swipe.enabled )
|
||||
{
|
||||
swipe.Init ();
|
||||
swipe.enabled = qtrue;
|
||||
swipe.entitynum = current_entity_number;
|
||||
}
|
||||
swipething_t& swipe = m_swipes[freeswipe];
|
||||
|
||||
swipe.shader = cgi.R_RegisterShader( ev->GetString( 1 ) );
|
||||
swipe.tagname_start = ev->GetString ( 2 );
|
||||
swipe.tagname_end = ev->GetString ( 3 );
|
||||
swipe.life = ev->GetFloat ( 4 ) * 1000.f;
|
||||
if (!swipe.enabled) {
|
||||
swipe.Init();
|
||||
swipe.enabled = qtrue;
|
||||
swipe.entitynum = current_entity_number;
|
||||
}
|
||||
|
||||
if ( current_centity )
|
||||
current_centity->clientFlags |= CF_UPDATESWIPE;
|
||||
}
|
||||
swipe.shader = cgi.R_RegisterShader(ev->GetString(1));
|
||||
swipe.tagname_start = ev->GetString(2);
|
||||
swipe.tagname_end = ev->GetString(3);
|
||||
swipe.life = ev->GetFloat(4) * 1000.f;
|
||||
|
||||
void ClientGameCommandManager::SwipeOff
|
||||
(
|
||||
Event *ev
|
||||
)
|
||||
if (current_centity) {
|
||||
current_centity->clientFlags |= CF_UPDATESWIPE;
|
||||
}
|
||||
}
|
||||
|
||||
{
|
||||
qboolean was_enabled;
|
||||
int i;
|
||||
void ClientGameCommandManager::SwipeOff(Event *ev)
|
||||
|
||||
was_enabled = qfalse;
|
||||
for ( i=0; i < MAX_SWIPES; i++ )
|
||||
{
|
||||
swipething_t &swipe = m_swipes[i];
|
||||
{
|
||||
qboolean was_enabled;
|
||||
int i;
|
||||
|
||||
if ( swipe.enabled && swipe.entitynum == current_entity_number )
|
||||
{
|
||||
swipe.enabled = qfalse;
|
||||
was_enabled = qtrue;
|
||||
}
|
||||
}
|
||||
was_enabled = qfalse;
|
||||
for (i = 0; i < MAX_SWIPES; i++) {
|
||||
swipething_t& swipe = m_swipes[i];
|
||||
|
||||
if ( was_enabled )
|
||||
{
|
||||
//cgi.R_SwipeBegin ( 0.f, 0.f, -1 );
|
||||
//cgi.R_SwipeEnd ();
|
||||
if (swipe.enabled && swipe.entitynum == current_entity_number) {
|
||||
swipe.enabled = qfalse;
|
||||
was_enabled = qtrue;
|
||||
}
|
||||
}
|
||||
|
||||
if ( current_centity )
|
||||
current_centity->clientFlags &= ~CF_UPDATESWIPE;
|
||||
}
|
||||
}
|
||||
if (was_enabled) {
|
||||
//cgi.R_SwipeBegin ( 0.f, 0.f, -1 );
|
||||
//cgi.R_SwipeEnd ();
|
||||
|
||||
void ClientGameCommandManager::Swipe
|
||||
(
|
||||
Event *ev
|
||||
)
|
||||
if (current_centity) {
|
||||
current_centity->clientFlags &= ~CF_UPDATESWIPE;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
{
|
||||
// This does a swipe effect on the entity
|
||||
int i,swipenum;
|
||||
orientation_t _or;
|
||||
int tagnum_start,tagnum_end;
|
||||
qboolean add_cnt_point = qfalse;
|
||||
vec3_t tmp;
|
||||
void ClientGameCommandManager::Swipe(Event *ev)
|
||||
|
||||
assert(current_entity);
|
||||
assert(current_tiki);
|
||||
{
|
||||
// This does a swipe effect on the entity
|
||||
int i, swipenum;
|
||||
orientation_t _or;
|
||||
int tagnum_start, tagnum_end;
|
||||
qboolean add_cnt_point = qfalse;
|
||||
vec3_t tmp;
|
||||
|
||||
if (!current_entity || !current_tiki)
|
||||
{
|
||||
return;
|
||||
}
|
||||
assert(current_entity);
|
||||
assert(current_tiki);
|
||||
|
||||
// Let's find us a new (or current) swipe
|
||||
for ( swipenum=0; swipenum < MAX_SWIPES; swipenum++ )
|
||||
{
|
||||
swipething_t &swipe = m_swipes[swipenum];
|
||||
if (!current_entity || !current_tiki) {
|
||||
return;
|
||||
}
|
||||
|
||||
if ( swipe.enabled && swipe.entitynum == current_entity_number )
|
||||
{
|
||||
while ( swipe.num_live_swipes > 1 )
|
||||
{
|
||||
i = ( swipe.first_swipe + 1 ) % MAX_SWIPE_POINTS;
|
||||
swipepoint_t &swipepoint = swipe.swipepoints[i];
|
||||
// Let's find us a new (or current) swipe
|
||||
for (swipenum = 0; swipenum < MAX_SWIPES; swipenum++) {
|
||||
swipething_t& swipe = m_swipes[swipenum];
|
||||
|
||||
if ( swipepoint.time < cg.time - swipe.life )
|
||||
{
|
||||
// then let's delete the previous
|
||||
swipe.first_swipe = ( swipe.first_swipe + 1 ) % MAX_SWIPE_POINTS;
|
||||
swipe.num_live_swipes--;
|
||||
}
|
||||
else
|
||||
{
|
||||
break;
|
||||
}
|
||||
if (swipe.enabled && swipe.entitynum == current_entity_number) {
|
||||
while (swipe.num_live_swipes > 1) {
|
||||
i = (swipe.first_swipe + 1) % MAX_SWIPE_POINTS;
|
||||
swipepoint_t& swipepoint = swipe.swipepoints[i];
|
||||
|
||||
if (swipepoint.time < cg.time - swipe.life) {
|
||||
// then let's delete the previous
|
||||
swipe.first_swipe = (swipe.first_swipe + 1) % MAX_SWIPE_POINTS;
|
||||
swipe.num_live_swipes--;
|
||||
} else {
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if ( swipe.num_live_swipes == 1 )
|
||||
{
|
||||
swipepoint_t &swipepoint = swipe.swipepoints[swipe.first_swipe];
|
||||
if ( swipepoint.time < cg.time - swipe.life )
|
||||
{
|
||||
swipe.num_live_swipes = 0;
|
||||
}
|
||||
if (swipe.num_live_swipes == 1) {
|
||||
swipepoint_t& swipepoint = swipe.swipepoints[swipe.first_swipe];
|
||||
if (swipepoint.time < cg.time - swipe.life) {
|
||||
swipe.num_live_swipes = 0;
|
||||
}
|
||||
}
|
||||
|
||||
swipe.cntPoint.time = cg.time;
|
||||
VectorCopy ( current_entity->origin, swipe.cntPoint.points[0] );
|
||||
swipe.cntPoint.time = cg.time;
|
||||
VectorCopy(current_entity->origin, swipe.cntPoint.points[0]);
|
||||
|
||||
tagnum_start = cgi.Tag_NumForName( current_tiki, swipe.tagname_start.c_str() );
|
||||
_or = cgi.TIKI_Orientation(current_entity, tagnum_start);
|
||||
tagnum_start = cgi.Tag_NumForName(current_tiki, swipe.tagname_start.c_str());
|
||||
_or = cgi.TIKI_Orientation(current_entity, tagnum_start);
|
||||
|
||||
// Clear out the points
|
||||
VectorClear ( tmp );
|
||||
VectorClear ( swipe.cntPoint.points[0] );
|
||||
VectorClear ( swipe.cntPoint.points[1] );
|
||||
// Clear out the points
|
||||
VectorClear(tmp);
|
||||
VectorClear(swipe.cntPoint.points[0]);
|
||||
VectorClear(swipe.cntPoint.points[1]);
|
||||
|
||||
if ( ev->NumArgs() > 0 )
|
||||
VectorCopy( ev->GetVector( 1 ), tmp );
|
||||
else
|
||||
VectorCopy ( current_entity->origin, tmp );
|
||||
|
||||
// Transform the origin of the tag by the axis of the entity and add it to the origin of the entity
|
||||
for ( i = 0; i < 3; i++ )
|
||||
{
|
||||
VectorMA ( tmp, _or.origin[i], current_entity->axis[i], tmp );
|
||||
if (ev->NumArgs() > 0) {
|
||||
VectorCopy(ev->GetVector(1), tmp);
|
||||
} else {
|
||||
VectorCopy(current_entity->origin, tmp);
|
||||
}
|
||||
|
||||
// Copy tmp into the startpoint
|
||||
VectorCopy ( tmp, swipe.cntPoint.points[0] );
|
||||
|
||||
tagnum_end = cgi.Tag_NumForName( current_tiki, swipe.tagname_end.c_str() );
|
||||
_or = cgi.TIKI_Orientation(current_entity, tagnum_end);
|
||||
|
||||
if ( ev->NumArgs() > 0 )
|
||||
VectorCopy( ev->GetVector( 1 ), tmp );
|
||||
else
|
||||
VectorCopy ( current_entity->origin, tmp );
|
||||
|
||||
// Transform the origin of the tag by the axis of the entity and add it to the origin of the entity
|
||||
for ( i = 0; i < 3; i++ )
|
||||
{
|
||||
VectorMA ( tmp, _or.origin[i], current_entity->axis[i], tmp );
|
||||
// Transform the origin of the tag by the axis of the entity and add it to the origin of the entity
|
||||
for (i = 0; i < 3; i++) {
|
||||
VectorMA(tmp, _or.origin[i], current_entity->axis[i], tmp);
|
||||
}
|
||||
|
||||
// Copy tmp into the startpoint
|
||||
VectorCopy ( tmp, swipe.cntPoint.points[1] );
|
||||
// Copy tmp into the startpoint
|
||||
VectorCopy(tmp, swipe.cntPoint.points[0]);
|
||||
|
||||
if ( swipe.num_live_swipes == 0 )
|
||||
add_cnt_point = qtrue;
|
||||
else
|
||||
{
|
||||
float deltime = swipe.life / float ( MAX_SWIPES );
|
||||
swipepoint_t &lastpoint = swipe.swipepoints[ ( swipe.first_swipe + swipe.num_live_swipes - 1 ) % MAX_SWIPE_POINTS];
|
||||
tagnum_end = cgi.Tag_NumForName(current_tiki, swipe.tagname_end.c_str());
|
||||
_or = cgi.TIKI_Orientation(current_entity, tagnum_end);
|
||||
|
||||
if ( swipe.cntPoint.time - lastpoint.time >= deltime )
|
||||
add_cnt_point = qtrue;
|
||||
if (ev->NumArgs() > 0) {
|
||||
VectorCopy(ev->GetVector(1), tmp);
|
||||
} else {
|
||||
VectorCopy(current_entity->origin, tmp);
|
||||
}
|
||||
|
||||
cgi.R_SwipeBegin ( cg.time, swipe.life, swipe.shader );
|
||||
|
||||
if ( add_cnt_point )
|
||||
{
|
||||
swipepoint_t &swipepoint = swipe.swipepoints[ ( swipe.first_swipe + swipe.num_live_swipes ) % MAX_SWIPE_POINTS];
|
||||
|
||||
swipepoint = swipe.cntPoint;
|
||||
|
||||
if ( swipe.num_live_swipes == MAX_SWIPE_POINTS )
|
||||
swipe.first_swipe = ( swipe.first_swipe + 1 ) % MAX_SWIPE_POINTS;
|
||||
else
|
||||
swipe.num_live_swipes++;
|
||||
// Transform the origin of the tag by the axis of the entity and add it to the origin of the entity
|
||||
for (i = 0; i < 3; i++) {
|
||||
VectorMA(tmp, _or.origin[i], current_entity->axis[i], tmp);
|
||||
}
|
||||
|
||||
for ( i = 0; i != swipe.num_live_swipes; i++ )
|
||||
{
|
||||
swipepoint_t &swipepoint = swipe.swipepoints[ ( swipe.first_swipe + i ) % MAX_SWIPE_POINTS];
|
||||
// Copy tmp into the startpoint
|
||||
VectorCopy(tmp, swipe.cntPoint.points[1]);
|
||||
|
||||
cgi.R_SwipePoint ( swipepoint.points[0], swipepoint.points[1], swipepoint.time );
|
||||
if (swipe.num_live_swipes == 0) {
|
||||
add_cnt_point = qtrue;
|
||||
} else {
|
||||
float deltime = swipe.life / float(MAX_SWIPES);
|
||||
swipepoint_t& lastpoint =
|
||||
swipe.swipepoints[(swipe.first_swipe + swipe.num_live_swipes - 1) % MAX_SWIPE_POINTS];
|
||||
|
||||
if (swipe.cntPoint.time - lastpoint.time >= deltime) {
|
||||
add_cnt_point = qtrue;
|
||||
}
|
||||
}
|
||||
|
||||
if ( !add_cnt_point )
|
||||
cgi.R_SwipePoint ( swipe.cntPoint.points[0], swipe.cntPoint.points[1], swipe.cntPoint.time );
|
||||
cgi.R_SwipeBegin(cg.time, swipe.life, swipe.shader);
|
||||
|
||||
cgi.R_SwipeEnd ();
|
||||
}
|
||||
}
|
||||
}
|
||||
if (add_cnt_point) {
|
||||
swipepoint_t& swipepoint =
|
||||
swipe.swipepoints[(swipe.first_swipe + swipe.num_live_swipes) % MAX_SWIPE_POINTS];
|
||||
|
||||
void ClientGameCommandManager::ClearSwipes
|
||||
(
|
||||
void
|
||||
)
|
||||
swipepoint = swipe.cntPoint;
|
||||
|
||||
{
|
||||
int i;
|
||||
if (swipe.num_live_swipes == MAX_SWIPE_POINTS) {
|
||||
swipe.first_swipe = (swipe.first_swipe + 1) % MAX_SWIPE_POINTS;
|
||||
} else {
|
||||
swipe.num_live_swipes++;
|
||||
}
|
||||
}
|
||||
|
||||
for ( i=0; i < MAX_SWIPES; i++ )
|
||||
{
|
||||
swipething_t &swipe = m_swipes[i];
|
||||
for (i = 0; i != swipe.num_live_swipes; i++) {
|
||||
swipepoint_t& swipepoint = swipe.swipepoints[(swipe.first_swipe + i) % MAX_SWIPE_POINTS];
|
||||
|
||||
swipe.enabled = qfalse;
|
||||
}
|
||||
cgi.R_SwipePoint(swipepoint.points[0], swipepoint.points[1], swipepoint.time);
|
||||
}
|
||||
|
||||
cgi.R_SwipeBegin ( 0.f, 0.f, -1 );
|
||||
cgi.R_SwipeEnd ();
|
||||
}
|
||||
if (!add_cnt_point) {
|
||||
cgi.R_SwipePoint(swipe.cntPoint.points[0], swipe.cntPoint.points[1], swipe.cntPoint.time);
|
||||
}
|
||||
|
||||
cgi.R_SwipeEnd();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void ClientGameCommandManager::ClearSwipes(void)
|
||||
|
||||
{
|
||||
int i;
|
||||
|
||||
for (i = 0; i < MAX_SWIPES; i++) {
|
||||
swipething_t& swipe = m_swipes[i];
|
||||
|
||||
swipe.enabled = qfalse;
|
||||
}
|
||||
|
||||
cgi.R_SwipeBegin(0.f, 0.f, -1);
|
||||
cgi.R_SwipeEnd();
|
||||
}
|
||||
|
||||
/*
|
||||
===================
|
||||
@@ -283,7 +255,7 @@ CG_ClearSwipes
|
||||
This is called at startup and for tournement restarts
|
||||
===================
|
||||
*/
|
||||
void CG_ClearSwipes( void )
|
||||
{
|
||||
commandManager.ClearSwipes();
|
||||
}
|
||||
void CG_ClearSwipes(void)
|
||||
{
|
||||
commandManager.ClearSwipes();
|
||||
}
|
||||
+570
-460
File diff suppressed because it is too large.
Load diff
+1904
-292
File diff suppressed because it is too large.
Load diff
+40
-17
@@ -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,9 +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;
|
||||
}
|
||||
@@ -79,8 +79,7 @@ void CG_MessageSingleAll_f(void)
|
||||
|
||||
if (cgi.Argc() > 1) {
|
||||
cgi.SendClientCommand(va("dmmessage 0 %s\n", cgi.Args()));
|
||||
}
|
||||
else {
|
||||
} else {
|
||||
cgi.UI_ToggleDMMessageConsole(-100);
|
||||
}
|
||||
}
|
||||
@@ -93,8 +92,7 @@ void CG_MessageSingleTeam_f(void)
|
||||
|
||||
if (cgi.Argc() > 1) {
|
||||
cgi.SendClientCommand(va("dmmessage -1 %s\n", cgi.Args()));
|
||||
}
|
||||
else {
|
||||
} else {
|
||||
cgi.UI_ToggleDMMessageConsole(-200);
|
||||
}
|
||||
}
|
||||
@@ -108,14 +106,12 @@ void CG_MessageSingleClient_f(void)
|
||||
}
|
||||
|
||||
clientNum = atoi(cgi.Argv(1));
|
||||
if (clientNum < 1 || clientNum > MAX_CLIENTS)
|
||||
{
|
||||
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;
|
||||
}
|
||||
|
||||
if (cgi.Argc() > 2)
|
||||
{
|
||||
if (cgi.Argc() > 2) {
|
||||
int i;
|
||||
str sString;
|
||||
|
||||
@@ -129,8 +125,7 @@ void CG_MessageSingleClient_f(void)
|
||||
|
||||
sString += "\n";
|
||||
cgi.SendClientCommand(sString.c_str());
|
||||
}
|
||||
else {
|
||||
} else {
|
||||
cgi.UI_ToggleDMMessageConsole(-clientNum);
|
||||
}
|
||||
}
|
||||
@@ -195,11 +190,39 @@ void CG_InstaMessageGroupE_f(void)
|
||||
|
||||
void CG_HudPrint_f(void)
|
||||
{
|
||||
cgi.Printf("\x1%s", cgi.Argv(0));
|
||||
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;
|
||||
}
|
||||
@@ -26,17 +26,14 @@ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
#include "cg_local.h"
|
||||
#include "cg_commands.h"
|
||||
|
||||
void CG_Vehicle(centity_t* cent)
|
||||
{
|
||||
void CG_Vehicle(centity_t *cent) {}
|
||||
|
||||
}
|
||||
|
||||
void ClientGameCommandManager::SpawnTreads(Event* ev)
|
||||
void ClientGameCommandManager::SpawnTreads(Event *ev)
|
||||
{
|
||||
// stub
|
||||
}
|
||||
|
||||
void ClientGameCommandManager::TreadsOff(Event* ev)
|
||||
void ClientGameCommandManager::TreadsOff(Event *ev)
|
||||
{
|
||||
// stub
|
||||
}
|
||||
+456
-328
File diff suppressed because it is too large.
Load diff
+324
-309
@@ -26,9 +26,9 @@ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
#include "cg_local.h"
|
||||
#include "tiki.h"
|
||||
|
||||
static const char* AnimPrefixList[] =
|
||||
{
|
||||
static const char *AnimPrefixList[] = {
|
||||
"",
|
||||
"unarmed",
|
||||
"papers",
|
||||
"colt45",
|
||||
"p38",
|
||||
@@ -46,7 +46,6 @@ static const char* AnimPrefixList[] =
|
||||
"bazooka",
|
||||
"panzerschreck",
|
||||
"shotgun",
|
||||
"unarmed",
|
||||
//
|
||||
// Team Assault and Team Tactics weapons
|
||||
"mg42portable",
|
||||
@@ -60,7 +59,6 @@ static const char* AnimPrefixList[] =
|
||||
"enfieldl42a1",
|
||||
"carcano",
|
||||
"delisle",
|
||||
"thompson",
|
||||
"sten",
|
||||
"ppsh",
|
||||
"moschetto",
|
||||
@@ -82,9 +80,9 @@ static const char* AnimPrefixList[] =
|
||||
"PIAT"
|
||||
};
|
||||
|
||||
enum animPrefix_e
|
||||
{
|
||||
enum animPrefix_e {
|
||||
WPREFIX_NONE,
|
||||
WPREFIX_UNARMED,
|
||||
WPREFIX_PAPERS,
|
||||
WPREFIX_COLT45,
|
||||
WPREFIX_P38,
|
||||
@@ -102,191 +100,226 @@ enum animPrefix_e
|
||||
WPREFIX_BAZOOKA,
|
||||
WPREFIX_PANZERSCHRECK,
|
||||
WPREFIX_SHOTGUN,
|
||||
WPREFIX_UNARMED,
|
||||
//
|
||||
// Team Assault and Team Tactics weapons
|
||||
WPREFIX_MG42_PORTABLE,
|
||||
WPREFIX_WEBLEY,
|
||||
WPREFIX_NAGANTREV,
|
||||
WPREFIX_BERETTA,
|
||||
WPREFIX_ENFIELD,
|
||||
WPREFIX_SVT,
|
||||
WPREFIX_MOSIN,
|
||||
WPREFIX_G43,
|
||||
WPREFIX_ENFIELDL42A,
|
||||
WPREFIX_CARCANO,
|
||||
WPREFIX_DELISLE,
|
||||
WPREFIX_STEN,
|
||||
WPREFIX_PPSH,
|
||||
WPREFIX_MOSCHETTO,
|
||||
WPREFIX_FG42,
|
||||
WPREFIX_VICKERS,
|
||||
WPREFIX_BREDA,
|
||||
WPREFIX_F1_GRENADE,
|
||||
WPREFIX_MILLS_GRENADE,
|
||||
WPREFIX_NEBELHANDGRANATE,
|
||||
WPREFIX_M18_SMOKE_GRENADE,
|
||||
WPREFIX_RDG1_SMOKE_GRENADE,
|
||||
//
|
||||
// Team Assault and Team Tactics weapons
|
||||
WPREFIX_MG42_PORTABLE,
|
||||
WPREFIX_WEBLEY,
|
||||
WPREFIX_NAGANTREV,
|
||||
WPREFIX_BERETTA,
|
||||
WPREFIX_ENFIELD,
|
||||
WPREFIX_SVT,
|
||||
WPREFIX_MOSIN,
|
||||
WPREFIX_G43,
|
||||
WPREFIX_ENFIELDL42A,
|
||||
WPREFIX_CARCANO,
|
||||
WPREFIX_DELISLE,
|
||||
WPREFIX_STEN,
|
||||
WPREFIX_PPSH,
|
||||
WPREFIX_MOSCHETTO,
|
||||
WPREFIX_FG42,
|
||||
WPREFIX_VICKERS,
|
||||
WPREFIX_BREDA,
|
||||
WPREFIX_F1_GRENADE,
|
||||
WPREFIX_MILLS_GRENADE,
|
||||
WPREFIX_NEBELHANDGRANATE,
|
||||
WPREFIX_M18_SMOKE_GRENADE,
|
||||
WPREFIX_RDG1_SMOKE_GRENADE,
|
||||
WPREFIX_BOMBA,
|
||||
WPREFIX_BOMBA_BREDA,
|
||||
WPREFIX_MINE,
|
||||
WPREFIX_MINE_DETECTOR,
|
||||
WPREFIX_MINE_DETECTOR_AXIS,
|
||||
WPREFIX_DETONATOR,
|
||||
WPREFIX_KAR98_MORTAR,
|
||||
WPREFIX_PIAT
|
||||
WPREFIX_BOMBA_BREDA,
|
||||
WPREFIX_MINE,
|
||||
WPREFIX_MINE_DETECTOR,
|
||||
WPREFIX_MINE_DETECTOR_AXIS,
|
||||
WPREFIX_DETONATOR,
|
||||
WPREFIX_KAR98_MORTAR,
|
||||
WPREFIX_PIAT
|
||||
};
|
||||
|
||||
int CG_GetVMAnimPrefixIndex()
|
||||
{
|
||||
const char* szWeaponName;
|
||||
int iWeaponClass;
|
||||
const char *szWeaponName;
|
||||
int iWeaponClass;
|
||||
|
||||
iWeaponClass = cg.snap->ps.stats[STAT_EQUIPPED_WEAPON];
|
||||
szWeaponName = CG_ConfigString(CS_WEAPONS + cg.snap->ps.activeItems[1]);
|
||||
|
||||
if (iWeaponClass & WEAPON_CLASS_ANY_ITEM)
|
||||
{
|
||||
if (!Q_stricmp(szWeaponName, "Papers"))
|
||||
return WPREFIX_PAPERS;
|
||||
if (!Q_stricmp(szWeaponName, "Packed MG42 Turret"))
|
||||
return WPREFIX_MG42_PORTABLE;
|
||||
}
|
||||
else if (iWeaponClass & WEAPON_CLASS_PISTOL)
|
||||
{
|
||||
if (!Q_stricmp(szWeaponName, "Colt 45"))
|
||||
if (iWeaponClass & WEAPON_CLASS_ANY_ITEM) {
|
||||
if (!Q_stricmp(szWeaponName, "Papers")) {
|
||||
return WPREFIX_PAPERS;
|
||||
}
|
||||
if (!Q_stricmp(szWeaponName, "Packed MG42 Turret")) {
|
||||
return WPREFIX_MG42_PORTABLE;
|
||||
}
|
||||
} else if (iWeaponClass & WEAPON_CLASS_PISTOL) {
|
||||
if (!Q_stricmp(szWeaponName, "Colt 45")) {
|
||||
return WPREFIX_COLT45;
|
||||
if (!Q_stricmp(szWeaponName, "Walther P38"))
|
||||
}
|
||||
if (!Q_stricmp(szWeaponName, "Walther P38")) {
|
||||
return WPREFIX_P38;
|
||||
if (!Q_stricmp(szWeaponName, "Hi-Standard Silenced"))
|
||||
return WPREFIX_HISTANDARD;
|
||||
|
||||
//
|
||||
// Team Assault and Team Tactics
|
||||
//
|
||||
if (!Q_stricmp(szWeaponName, "Webley Revolver"))
|
||||
return WPREFIX_WEBLEY;
|
||||
if (!Q_stricmp(szWeaponName, "Nagant Revolver"))
|
||||
return WPREFIX_NAGANTREV;
|
||||
if (!Q_stricmp(szWeaponName, "Beretta"))
|
||||
return WPREFIX_BERETTA;
|
||||
|
||||
return WPREFIX_COLT45;
|
||||
}
|
||||
else if (iWeaponClass & WEAPON_CLASS_RIFLE)
|
||||
{
|
||||
if (!Q_stricmp(szWeaponName, "M1 Garand"))
|
||||
return WPREFIX_GARAND;
|
||||
if (!Q_stricmp(szWeaponName, "Mauser KAR 98K"))
|
||||
return WPREFIX_KAR98;
|
||||
if (!Q_stricmp(szWeaponName, "KAR98 - Sniper"))
|
||||
return WPREFIX_KAR98SNIPER;
|
||||
if (!Q_stricmp(szWeaponName, "Springfield '03 Sniper"))
|
||||
return WPREFIX_SPRINGFIELD;
|
||||
}
|
||||
if (!Q_stricmp(szWeaponName, "Hi-Standard Silenced")) {
|
||||
return WPREFIX_HISTANDARD;
|
||||
}
|
||||
|
||||
//
|
||||
// Team Assault and Team Tactics
|
||||
//
|
||||
if (!Q_stricmp(szWeaponName, "Lee-Enfield"))
|
||||
return WPREFIX_SPRINGFIELD;
|
||||
if (!Q_stricmp(szWeaponName, "SVT 40"))
|
||||
return WPREFIX_SVT;
|
||||
if (!Q_stricmp(szWeaponName, "Mosin Nagant Rifle"))
|
||||
return WPREFIX_MOSIN;
|
||||
if (!Q_stricmp(szWeaponName, "G 43"))
|
||||
return WPREFIX_G43;
|
||||
if (!Q_stricmp(szWeaponName, "Enfield L42A1"))
|
||||
return WPREFIX_ENFIELD;
|
||||
if (!Q_stricmp(szWeaponName, "Carcano"))
|
||||
return WPREFIX_CARCANO;
|
||||
if (!Q_stricmp(szWeaponName, "DeLisle"))
|
||||
return WPREFIX_DELISLE;
|
||||
if (!Q_stricmp(szWeaponName, "Webley Revolver")) {
|
||||
return WPREFIX_WEBLEY;
|
||||
}
|
||||
if (!Q_stricmp(szWeaponName, "Nagant Revolver")) {
|
||||
return WPREFIX_NAGANTREV;
|
||||
}
|
||||
if (!Q_stricmp(szWeaponName, "Beretta")) {
|
||||
return WPREFIX_BERETTA;
|
||||
}
|
||||
|
||||
return WPREFIX_COLT45;
|
||||
} else if (iWeaponClass & WEAPON_CLASS_RIFLE) {
|
||||
if (!Q_stricmp(szWeaponName, "M1 Garand")) {
|
||||
return WPREFIX_GARAND;
|
||||
}
|
||||
if (!Q_stricmp(szWeaponName, "Mauser KAR 98K")) {
|
||||
return WPREFIX_KAR98;
|
||||
}
|
||||
if (!Q_stricmp(szWeaponName, "KAR98 - Sniper")) {
|
||||
return WPREFIX_KAR98SNIPER;
|
||||
}
|
||||
if (!Q_stricmp(szWeaponName, "Springfield '03 Sniper")) {
|
||||
return WPREFIX_SPRINGFIELD;
|
||||
}
|
||||
|
||||
//
|
||||
// Team Assault and Team Tactics
|
||||
//
|
||||
if (!Q_stricmp(szWeaponName, "Lee-Enfield")) {
|
||||
return WPREFIX_ENFIELD;
|
||||
}
|
||||
if (!Q_stricmp(szWeaponName, "SVT 40")) {
|
||||
return WPREFIX_SVT;
|
||||
}
|
||||
if (!Q_stricmp(szWeaponName, "Mosin Nagant Rifle")) {
|
||||
return WPREFIX_MOSIN;
|
||||
}
|
||||
if (!Q_stricmp(szWeaponName, "G 43")) {
|
||||
return WPREFIX_G43;
|
||||
}
|
||||
if (!Q_stricmp(szWeaponName, "Enfield L42A1")) {
|
||||
return WPREFIX_ENFIELDL42A;
|
||||
}
|
||||
if (!Q_stricmp(szWeaponName, "Carcano")) {
|
||||
return WPREFIX_CARCANO;
|
||||
}
|
||||
if (!Q_stricmp(szWeaponName, "DeLisle")) {
|
||||
return WPREFIX_DELISLE;
|
||||
}
|
||||
|
||||
return WPREFIX_GARAND;
|
||||
}
|
||||
else if (iWeaponClass & WEAPON_CLASS_SMG)
|
||||
{
|
||||
if (!Q_stricmp(szWeaponName, "Thompson"))
|
||||
} else if (iWeaponClass & WEAPON_CLASS_SMG) {
|
||||
if (!Q_stricmp(szWeaponName, "Thompson")) {
|
||||
return WPREFIX_THOMPSON;
|
||||
if (!Q_stricmp(szWeaponName, "MP40"))
|
||||
return WPREFIX_MP40;
|
||||
//
|
||||
// Team Assault and Team Tactics
|
||||
//
|
||||
if (!Q_stricmp(szWeaponName, "Sten Mark II"))
|
||||
return WPREFIX_STEN;
|
||||
if (!Q_stricmp(szWeaponName, "PPSH SMG"))
|
||||
return WPREFIX_PPSH;
|
||||
if (!Q_stricmp(szWeaponName, "Moschetto"))
|
||||
return WPREFIX_MOSCHETTO;
|
||||
}
|
||||
if (!Q_stricmp(szWeaponName, "MP40")) {
|
||||
return WPREFIX_MP40;
|
||||
}
|
||||
//
|
||||
// Team Assault and Team Tactics
|
||||
//
|
||||
if (!Q_stricmp(szWeaponName, "Sten Mark II")) {
|
||||
return WPREFIX_STEN;
|
||||
}
|
||||
if (!Q_stricmp(szWeaponName, "PPSH SMG")) {
|
||||
return WPREFIX_PPSH;
|
||||
}
|
||||
if (!Q_stricmp(szWeaponName, "Moschetto")) {
|
||||
return WPREFIX_MOSCHETTO;
|
||||
}
|
||||
|
||||
return WPREFIX_THOMPSON;
|
||||
}
|
||||
else if (iWeaponClass & WEAPON_CLASS_MG)
|
||||
{
|
||||
if (!Q_stricmp(szWeaponName, "BAR"))
|
||||
} else if (iWeaponClass & WEAPON_CLASS_MG) {
|
||||
if (!Q_stricmp(szWeaponName, "BAR")) {
|
||||
return WPREFIX_BAR;
|
||||
if (!Q_stricmp(szWeaponName, "StG 44"))
|
||||
return WPREFIX_MP44;
|
||||
//
|
||||
// Team Assault and Team Tactics
|
||||
//
|
||||
if (!Q_stricmp(szWeaponName, "FG 42"))
|
||||
return WPREFIX_MP44;
|
||||
if (!Q_stricmp(szWeaponName, "Vickers-Berthier"))
|
||||
return WPREFIX_MP44;
|
||||
if (!Q_stricmp(szWeaponName, "Breda"))
|
||||
return WPREFIX_MP44;
|
||||
}
|
||||
if (!Q_stricmp(szWeaponName, "StG 44")) {
|
||||
return WPREFIX_MP44;
|
||||
}
|
||||
//
|
||||
// Team Assault and Team Tactics
|
||||
//
|
||||
if (!Q_stricmp(szWeaponName, "FG 42")) {
|
||||
return WPREFIX_MP44;
|
||||
}
|
||||
if (!Q_stricmp(szWeaponName, "Vickers-Berthier")) {
|
||||
return WPREFIX_VICKERS;
|
||||
}
|
||||
if (!Q_stricmp(szWeaponName, "Breda")) {
|
||||
return WPREFIX_BREDA;
|
||||
}
|
||||
|
||||
return WPREFIX_BAR;
|
||||
}
|
||||
else if (iWeaponClass & WEAPON_CLASS_GRENADE)
|
||||
{
|
||||
if (!Q_stricmp(szWeaponName, "Frag Grenade"))
|
||||
} else if (iWeaponClass & WEAPON_CLASS_GRENADE) {
|
||||
if (!Q_stricmp(szWeaponName, "Frag Grenade")) {
|
||||
return WPREFIX_FRAGGRENADE;
|
||||
if (!Q_stricmp(szWeaponName, "Stielhandgranate"))
|
||||
return WPREFIX_STIELHANDGRANATE;
|
||||
//
|
||||
// Team Assault and Team Tactics
|
||||
//
|
||||
if (!Q_stricmp(szWeaponName, "F1 Grenade"))
|
||||
return WPREFIX_F1_GRENADE;
|
||||
if (!Q_stricmp(szWeaponName, "Mills Grenade"))
|
||||
return WPREFIX_MILLS_GRENADE;
|
||||
if (!Q_stricmp(szWeaponName, "Nebelhandgranate"))
|
||||
}
|
||||
if (!Q_stricmp(szWeaponName, "Stielhandgranate")) {
|
||||
return WPREFIX_STIELHANDGRANATE;
|
||||
}
|
||||
//
|
||||
// Team Assault and Team Tactics
|
||||
//
|
||||
if (!Q_stricmp(szWeaponName, "F1 Grenade")) {
|
||||
return WPREFIX_F1_GRENADE;
|
||||
}
|
||||
if (!Q_stricmp(szWeaponName, "Mills Grenade")) {
|
||||
return WPREFIX_MILLS_GRENADE;
|
||||
}
|
||||
if (!Q_stricmp(szWeaponName, "Nebelhandgranate")) {
|
||||
return WPREFIX_NEBELHANDGRANATE;
|
||||
if (!Q_stricmp(szWeaponName, "M18 Smoke Grenade"))
|
||||
return WPREFIX_M18_SMOKE_GRENADE;
|
||||
if (!Q_stricmp(szWeaponName, "RDG-1 Smoke Grenade"))
|
||||
return WPREFIX_RDG1_SMOKE_GRENADE;
|
||||
if (!Q_stricmp(szWeaponName, "Bomba A Mano"))
|
||||
}
|
||||
if (!Q_stricmp(szWeaponName, "M18 Smoke Grenade")) {
|
||||
return WPREFIX_M18_SMOKE_GRENADE;
|
||||
}
|
||||
if (!Q_stricmp(szWeaponName, "RDG-1 Smoke Grenade")) {
|
||||
return WPREFIX_RDG1_SMOKE_GRENADE;
|
||||
}
|
||||
if (!Q_stricmp(szWeaponName, "Bomba A Mano")) {
|
||||
return WPREFIX_BOMBA;
|
||||
if (!Q_stricmp(szWeaponName, "Bomba A Mano Breda"))
|
||||
return WPREFIX_BOMBA_BREDA;
|
||||
if (!Q_stricmp(szWeaponName, "LandmineAllies"))
|
||||
return WPREFIX_MINE;
|
||||
if (!Q_stricmp(szWeaponName, "LandmineAxis"))
|
||||
return WPREFIX_MINE;
|
||||
if (!Q_stricmp(szWeaponName, "Minensuchgerat"))
|
||||
return WPREFIX_MINE_DETECTOR_AXIS;
|
||||
if (!Q_stricmp(szWeaponName, "Minedetector"))
|
||||
return WPREFIX_MINE_DETECTOR;
|
||||
}
|
||||
if (!Q_stricmp(szWeaponName, "Bomba A Mano Breda")) {
|
||||
return WPREFIX_BOMBA_BREDA;
|
||||
}
|
||||
if (!Q_stricmp(szWeaponName, "LandmineAllies")) {
|
||||
return WPREFIX_MINE;
|
||||
}
|
||||
if (!Q_stricmp(szWeaponName, "LandmineAxis")) {
|
||||
return WPREFIX_MINE;
|
||||
}
|
||||
if (!Q_stricmp(szWeaponName, "Minensuchgerat")) {
|
||||
return WPREFIX_MINE_DETECTOR_AXIS;
|
||||
}
|
||||
if (!Q_stricmp(szWeaponName, "Minedetector")) {
|
||||
return WPREFIX_MINE_DETECTOR;
|
||||
}
|
||||
|
||||
return WPREFIX_FRAGGRENADE;
|
||||
}
|
||||
else if (iWeaponClass & WEAPON_CLASS_HEAVY)
|
||||
{
|
||||
if (!Q_stricmp(szWeaponName, "Bazooka"))
|
||||
} else if (iWeaponClass & WEAPON_CLASS_HEAVY) {
|
||||
if (!Q_stricmp(szWeaponName, "Bazooka")) {
|
||||
return WPREFIX_BAZOOKA;
|
||||
if (!Q_stricmp(szWeaponName, "Panzerschreck"))
|
||||
}
|
||||
if (!Q_stricmp(szWeaponName, "Panzerschreck")) {
|
||||
return WPREFIX_PANZERSCHRECK;
|
||||
if (!Q_stricmp(szWeaponName, "Shotgun"))
|
||||
return WPREFIX_SHOTGUN;
|
||||
//
|
||||
// Team Assault and Team Tactics
|
||||
//
|
||||
if (!Q_stricmp(szWeaponName, "PIAT"))
|
||||
return WPREFIX_PIAT;
|
||||
}
|
||||
if (!Q_stricmp(szWeaponName, "Gewehrgranate")) {
|
||||
return WPREFIX_KAR98_MORTAR;
|
||||
}
|
||||
if (!Q_stricmp(szWeaponName, "Shotgun")) {
|
||||
return WPREFIX_SHOTGUN;
|
||||
}
|
||||
//
|
||||
// Team Assault and Team Tactics
|
||||
//
|
||||
if (!Q_stricmp(szWeaponName, "PIAT")) {
|
||||
return WPREFIX_PIAT;
|
||||
}
|
||||
|
||||
return WPREFIX_BAZOOKA;
|
||||
}
|
||||
@@ -294,63 +327,59 @@ int CG_GetVMAnimPrefixIndex()
|
||||
return WPREFIX_UNARMED;
|
||||
}
|
||||
|
||||
void CG_ViewModelAnimation(refEntity_t* pModel)
|
||||
void CG_ViewModelAnimation(refEntity_t *pModel)
|
||||
{
|
||||
int i;
|
||||
int iAnimFlags;
|
||||
float fCrossblendTime, fCrossblendFrac, fCrossblendAmount;
|
||||
float fAnimLength;
|
||||
int iAnimPrefixIndex;
|
||||
const char* pszAnimSuffix;
|
||||
char szAnimName[MAX_QPATH];
|
||||
dtiki_t* pTiki;
|
||||
qboolean bAnimChanged;
|
||||
int i;
|
||||
int iAnimFlags;
|
||||
float fCrossblendTime, fCrossblendFrac, fCrossblendAmount;
|
||||
float fAnimLength;
|
||||
int iAnimPrefixIndex;
|
||||
const char *pszAnimSuffix;
|
||||
char szAnimName[MAX_QPATH];
|
||||
dtiki_t *pTiki;
|
||||
qboolean bAnimChanged;
|
||||
qboolean bWeaponChanged;
|
||||
|
||||
fCrossblendFrac = 0.0;
|
||||
bAnimChanged = 0;
|
||||
pTiki = pModel->tiki;
|
||||
bAnimChanged = qfalse;
|
||||
bWeaponChanged = qfalse; // Added in OPM
|
||||
pTiki = pModel->tiki;
|
||||
|
||||
if (cgi.anim->g_iLastEquippedWeaponStat == cg.snap->ps.stats[STAT_EQUIPPED_WEAPON]
|
||||
&& !strcmp(cgi.anim->g_szLastActiveItem, CG_ConfigString(CS_WEAPONS + cg.snap->ps.activeItems[1])))
|
||||
{
|
||||
&& !strcmp(cgi.anim->g_szLastActiveItem, CG_ConfigString(CS_WEAPONS + cg.snap->ps.activeItems[1]))) {
|
||||
iAnimPrefixIndex = cgi.anim->g_iLastAnimPrefixIndex;
|
||||
}
|
||||
else
|
||||
{
|
||||
iAnimPrefixIndex = CG_GetVMAnimPrefixIndex();
|
||||
} 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;
|
||||
|
||||
bAnimChanged = qtrue;
|
||||
bWeaponChanged = qtrue;
|
||||
}
|
||||
|
||||
if (cgi.anim->g_iLastVMAnim == -1)
|
||||
{
|
||||
sprintf(szAnimName, "%s_idle", AnimPrefixList[iAnimPrefixIndex]);
|
||||
if (cgi.anim->g_iLastVMAnim == -1) {
|
||||
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)
|
||||
{
|
||||
if (cgi.anim->g_VMFrameInfo[cgi.anim->g_iCurrentVMAnimSlot].index == -1) {
|
||||
cgi.anim->g_VMFrameInfo[cgi.anim->g_iCurrentVMAnimSlot].index = cgi.Anim_NumForName(pTiki, "idle");
|
||||
cgi.DPrintf("Warning: Couldn't find view model animation %s\n", szAnimName);
|
||||
}
|
||||
|
||||
cgi.anim->g_VMFrameInfo[cgi.anim->g_iCurrentVMAnimSlot].time = 0.0;
|
||||
cgi.anim->g_VMFrameInfo[cgi.anim->g_iCurrentVMAnimSlot].time = 0.0;
|
||||
cgi.anim->g_VMFrameInfo[cgi.anim->g_iCurrentVMAnimSlot].weight = 1.0;
|
||||
cgi.anim->g_iLastVMAnim = 0;
|
||||
cgi.anim->g_iLastVMAnim = 0;
|
||||
}
|
||||
|
||||
if (cg.snap->ps.iViewModelAnimChanged != cgi.anim->g_iLastVMAnimChanged)
|
||||
{
|
||||
bAnimChanged = qtrue;
|
||||
cgi.anim->g_iLastVMAnim = cg.snap->ps.iViewModelAnim;
|
||||
if (cg.snap->ps.iViewModelAnimChanged != cgi.anim->g_iLastVMAnimChanged) {
|
||||
bAnimChanged = qtrue;
|
||||
cgi.anim->g_iLastVMAnim = cg.snap->ps.iViewModelAnim;
|
||||
cgi.anim->g_iLastVMAnimChanged = cg.snap->ps.iViewModelAnimChanged;
|
||||
}
|
||||
|
||||
if (bAnimChanged)
|
||||
{
|
||||
switch (cgi.anim->g_iLastVMAnim)
|
||||
{
|
||||
if (bAnimChanged) {
|
||||
switch (cgi.anim->g_iLastVMAnim) {
|
||||
case VM_ANIM_CHARGE:
|
||||
pszAnimSuffix = "charge";
|
||||
break;
|
||||
@@ -381,136 +410,138 @@ void CG_ViewModelAnimation(refEntity_t* pModel)
|
||||
case VM_ANIM_LADDERSTEP:
|
||||
pszAnimSuffix = "ladderstep";
|
||||
break;
|
||||
case VM_ANIM_IDLE_0:
|
||||
pszAnimSuffix = "idle0";
|
||||
break;
|
||||
case VM_ANIM_IDLE_1:
|
||||
pszAnimSuffix = "idle1";
|
||||
break;
|
||||
case VM_ANIM_IDLE_2:
|
||||
pszAnimSuffix = "idle2";
|
||||
break;
|
||||
case VM_ANIM_DISABLED:
|
||||
pszAnimSuffix = "disabled";
|
||||
break;
|
||||
case VM_ANIM_IDLE_0:
|
||||
pszAnimSuffix = "idle0";
|
||||
break;
|
||||
case VM_ANIM_IDLE_1:
|
||||
pszAnimSuffix = "idle1";
|
||||
break;
|
||||
case VM_ANIM_IDLE_2:
|
||||
pszAnimSuffix = "idle2";
|
||||
break;
|
||||
case VM_ANIM_DISABLED:
|
||||
pszAnimSuffix = "disabled";
|
||||
break;
|
||||
default:
|
||||
case VM_ANIM_IDLE:
|
||||
pszAnimSuffix = "idle";
|
||||
break;
|
||||
case VM_ANIM_IDLE:
|
||||
pszAnimSuffix = "idle";
|
||||
break;
|
||||
}
|
||||
|
||||
sprintf(szAnimName, "%s_%s", AnimPrefixList[iAnimPrefixIndex], pszAnimSuffix);
|
||||
fCrossblendTime = cgi.Anim_CrossblendTime(pTiki, cgi.anim->g_VMFrameInfo[cgi.anim->g_iCurrentVMAnimSlot].index);
|
||||
fCrossblendAmount = cgi.anim->g_iCurrentVMDuration / 1000.0;
|
||||
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)
|
||||
{
|
||||
fCrossblendFrac = fCrossblendAmount / fCrossblendTime;
|
||||
for (i = 0; i < MAX_FRAMEINFOS; ++i)
|
||||
{
|
||||
if (cgi.anim->g_VMFrameInfo[i].weight)
|
||||
{
|
||||
if (i == cgi.anim->g_iCurrentVMAnimSlot) {
|
||||
cgi.anim->g_VMFrameInfo[i].weight = fCrossblendFrac;
|
||||
}
|
||||
else {
|
||||
cgi.anim->g_VMFrameInfo[i].weight *= (1.0 - fCrossblendFrac);
|
||||
if (fCrossblendAmount < fCrossblendTime && fCrossblendAmount > 0.0) {
|
||||
fCrossblendFrac = fCrossblendAmount / fCrossblendTime;
|
||||
for (i = 0; i < MAX_FRAMEINFOS; ++i) {
|
||||
if (cgi.anim->g_VMFrameInfo[i].weight) {
|
||||
if (i == cgi.anim->g_iCurrentVMAnimSlot) {
|
||||
cgi.anim->g_VMFrameInfo[i].weight = fCrossblendFrac;
|
||||
} else {
|
||||
cgi.anim->g_VMFrameInfo[i].weight *= (1.0 - fCrossblendFrac);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
} 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);
|
||||
|
||||
if (cgi.anim->g_VMFrameInfo[cgi.anim->g_iCurrentVMAnimSlot].index == -1)
|
||||
{
|
||||
if (cgi.anim->g_VMFrameInfo[cgi.anim->g_iCurrentVMAnimSlot].index == -1) {
|
||||
cgi.anim->g_VMFrameInfo[cgi.anim->g_iCurrentVMAnimSlot].index = cgi.Anim_NumForName(pTiki, "idle");
|
||||
cgi.DPrintf("Warning: Couldn't find view model animation %s\n", szAnimName);
|
||||
}
|
||||
|
||||
cgi.anim->g_VMFrameInfo[cgi.anim->g_iCurrentVMAnimSlot].time = 0.0;
|
||||
cgi.anim->g_VMFrameInfo[cgi.anim->g_iCurrentVMAnimSlot].time = 0.0;
|
||||
cgi.anim->g_VMFrameInfo[cgi.anim->g_iCurrentVMAnimSlot].weight = 1.0;
|
||||
cgi.anim->g_iCurrentVMDuration = 0;
|
||||
cgi.anim->g_iCurrentVMDuration = 0;
|
||||
|
||||
fCrossblendTime = cgi.Anim_CrossblendTime(pTiki, cgi.anim->g_VMFrameInfo[cgi.anim->g_iCurrentVMAnimSlot].index);
|
||||
if (!fCrossblendTime)
|
||||
{
|
||||
for (i = 0; i < MAX_FRAMEINFOS; ++i)
|
||||
{
|
||||
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) {
|
||||
cgi.anim->g_VMFrameInfo[i].weight = 0.0;
|
||||
}
|
||||
}
|
||||
|
||||
cgi.anim->g_bCrossblending = qfalse;
|
||||
} 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_bCrossblending = qfalse;
|
||||
}
|
||||
else
|
||||
{
|
||||
cgi.anim->g_bCrossblending = qtrue;
|
||||
}
|
||||
}
|
||||
|
||||
cgi.anim->g_iCurrentVMDuration += cg.frametime;
|
||||
if (cgi.anim->g_bCrossblending)
|
||||
{
|
||||
if (cgi.anim->g_bCrossblending) {
|
||||
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)
|
||||
{
|
||||
if (fCrossblendAmount >= fCrossblendTime || fCrossblendAmount <= 0.0) {
|
||||
// clear crossblend values
|
||||
for (i = 0; i < MAX_FRAMEINFOS; ++i)
|
||||
{
|
||||
for (i = 0; i < MAX_FRAMEINFOS; ++i) {
|
||||
if (i != cgi.anim->g_iCurrentVMAnimSlot) {
|
||||
cgi.anim->g_VMFrameInfo[i].weight = 0.0;
|
||||
}
|
||||
}
|
||||
|
||||
cgi.anim->g_bCrossblending = qfalse;
|
||||
}
|
||||
else {
|
||||
} else {
|
||||
fCrossblendFrac = fCrossblendAmount / fCrossblendTime;
|
||||
}
|
||||
}
|
||||
|
||||
for (i = 0; i < MAX_FRAMEINFOS; ++i)
|
||||
{
|
||||
if (!cgi.anim->g_VMFrameInfo[i].weight)
|
||||
{
|
||||
for (i = 0; i < MAX_FRAMEINFOS; ++i) {
|
||||
if (!cgi.anim->g_VMFrameInfo[i].weight) {
|
||||
// clear the weight values of the ref entity
|
||||
pModel->frameInfo[i].index = 0;
|
||||
pModel->frameInfo[i].time = 0.0;
|
||||
pModel->frameInfo[i].index = 0;
|
||||
pModel->frameInfo[i].time = 0.0;
|
||||
pModel->frameInfo[i].weight = 0.0;
|
||||
}
|
||||
else
|
||||
{
|
||||
} else {
|
||||
fAnimLength = cgi.Anim_Time(pTiki, cgi.anim->g_VMFrameInfo[i].index);
|
||||
cgi.anim->g_VMFrameInfo[i].time += cg.frametime / 1000.0;
|
||||
|
||||
if (cgi.anim->g_VMFrameInfo[i].time > fAnimLength)
|
||||
{
|
||||
if (cgi.Anim_Flags(pTiki, cgi.anim->g_VMFrameInfo[i].index) & TAF_DELTADRIVEN) {
|
||||
cgi.anim->g_VMFrameInfo[i].time -= fAnimLength;
|
||||
}
|
||||
else {
|
||||
cgi.anim->g_VMFrameInfo[i].time = fAnimLength;
|
||||
if (cgi.anim->g_VMFrameInfo[i].time > fAnimLength) {
|
||||
if (pTiki) {
|
||||
if (cgi.Anim_Flags(pTiki, cgi.anim->g_VMFrameInfo[i].index) & TAF_DELTADRIVEN) {
|
||||
cgi.anim->g_VMFrameInfo[i].time -= fAnimLength;
|
||||
} else {
|
||||
cgi.anim->g_VMFrameInfo[i].time = fAnimLength;
|
||||
}
|
||||
} else {
|
||||
cgi.anim->g_VMFrameInfo[i].time = 0.f;
|
||||
}
|
||||
}
|
||||
|
||||
pModel->frameInfo[i].index = cgi.anim->g_VMFrameInfo[i].index;
|
||||
pModel->frameInfo[i].time = cgi.anim->g_VMFrameInfo[i].time;
|
||||
pModel->frameInfo[i].time = cgi.anim->g_VMFrameInfo[i].time;
|
||||
|
||||
if (cgi.anim->g_bCrossblending)
|
||||
{
|
||||
if (cgi.anim->g_bCrossblending) {
|
||||
if (i == cgi.anim->g_iCurrentVMAnimSlot) {
|
||||
pModel->frameInfo[i].weight = fCrossblendFrac;
|
||||
} else {
|
||||
pModel->frameInfo[i].weight = cgi.anim->g_VMFrameInfo[i].weight * (1.0 - fCrossblendFrac);
|
||||
}
|
||||
else {
|
||||
pModel->frameInfo[i].weight *= (1.0 - fCrossblendFrac);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
} else {
|
||||
pModel->frameInfo[i].weight = 1.0;
|
||||
}
|
||||
}
|
||||
@@ -519,60 +550,48 @@ void CG_ViewModelAnimation(refEntity_t* pModel)
|
||||
pModel->actionWeight = 1.0;
|
||||
}
|
||||
|
||||
void CG_CalcViewModelMovement(float fViewBobPhase, float fViewBobAmp, vec_t* vVelocity, vec_t* vMovement)
|
||||
void CG_CalcViewModelMovement(float fViewBobPhase, float fViewBobAmp, vec_t *vVelocity, vec_t *vMovement)
|
||||
{
|
||||
int i;
|
||||
float fPhase, fDelta;
|
||||
int i;
|
||||
float fPhase, fDelta;
|
||||
vec3_t vTargOfs;
|
||||
vec3_t vNorm;
|
||||
|
||||
fPhase = sin(fViewBobPhase + M_PI / 10) * fViewBobAmp * vm_sway_side->value;
|
||||
fPhase = sin(fViewBobPhase + M_PI / 10) * fViewBobAmp * vm_sway_side->value;
|
||||
vMovement[0] = fPhase * vm_sway_front->value;
|
||||
vMovement[1] = fPhase;
|
||||
|
||||
fPhase = sin(fViewBobPhase - 0.94 + fViewBobPhase - 0.94 + M_PI);
|
||||
fPhase = sin(fViewBobPhase - 0.94 + fViewBobPhase - 0.94 + M_PI);
|
||||
vMovement[2] = (sin((fViewBobPhase - 0.94) * 4.0 + M_PI / 2) * 0.125 + fPhase) * fViewBobAmp * vm_sway_up->value;
|
||||
|
||||
if (cg.predicted_player_state.walking)
|
||||
{
|
||||
if (cg.predicted_player_state.viewheight == CROUCH_EYE_HEIGHT)
|
||||
{
|
||||
if (cgi.anim->g_iLastAnimPrefixIndex == WPREFIX_BAZOOKA || cgi.anim->g_iLastAnimPrefixIndex == WPREFIX_PANZERSCHRECK)
|
||||
{
|
||||
if (cg.predicted_player_state.walking) {
|
||||
if (cg.predicted_player_state.viewheight == CROUCH_EYE_HEIGHT) {
|
||||
if (cgi.anim->g_iLastAnimPrefixIndex == WPREFIX_BAZOOKA
|
||||
|| cgi.anim->g_iLastAnimPrefixIndex == WPREFIX_PANZERSCHRECK) {
|
||||
vTargOfs[0] = vm_offset_rocketcrouch_front->value;
|
||||
vTargOfs[1] = vm_offset_rocketcrouch_side->value;
|
||||
vTargOfs[2] = vm_offset_rocketcrouch_up->value;
|
||||
}
|
||||
else if (cgi.anim->g_iLastAnimPrefixIndex == WPREFIX_SHOTGUN)
|
||||
{
|
||||
} else if (cgi.anim->g_iLastAnimPrefixIndex == WPREFIX_SHOTGUN) {
|
||||
vTargOfs[0] = vm_offset_shotguncrouch_front->value;
|
||||
vTargOfs[1] = vm_offset_shotguncrouch_side->value;
|
||||
vTargOfs[2] = vm_offset_shotguncrouch_up->value;
|
||||
}
|
||||
else
|
||||
{
|
||||
} else {
|
||||
vTargOfs[0] = vm_offset_crouch_front->value;
|
||||
vTargOfs[1] = vm_offset_crouch_side->value;
|
||||
vTargOfs[2] = vm_offset_crouch_up->value;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
} else {
|
||||
memset(vTargOfs, 0, sizeof(vTargOfs));
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
} else {
|
||||
vTargOfs[0] = vm_offset_air_front->value;
|
||||
vTargOfs[1] = vm_offset_air_side->value;
|
||||
vTargOfs[2] = vm_offset_air_up->value;
|
||||
}
|
||||
|
||||
if (cg.predicted_player_state.walking)
|
||||
{
|
||||
if (cg.predicted_player_state.walking) {
|
||||
fDelta = VectorLength(vVelocity) - vm_offset_vel_base->value;
|
||||
if (fDelta > 0.0)
|
||||
{
|
||||
if (fDelta > 0.0) {
|
||||
if (fDelta > 250.0 - vm_offset_vel_base->value) {
|
||||
fDelta = 250.0 - vm_offset_vel_base->value;
|
||||
}
|
||||
@@ -582,23 +601,19 @@ void CG_CalcViewModelMovement(float fViewBobPhase, float fViewBobAmp, vec_t* vVe
|
||||
vTargOfs[1] += fPhase * vm_offset_vel_side->value;
|
||||
vTargOfs[2] += fPhase * vm_offset_vel_up->value;
|
||||
}
|
||||
}
|
||||
else if (vVelocity[2]) {
|
||||
} else if (vVelocity[2]) {
|
||||
vTargOfs[2] -= vVelocity[2] * vm_offset_upvel->value;
|
||||
}
|
||||
|
||||
for (i = 0; i < 3; i++)
|
||||
{
|
||||
for (i = 0; i < 3; i++) {
|
||||
fDelta = vTargOfs[i] - cgi.anim->g_vCurrentVMPosOffset[i];
|
||||
cgi.anim->g_vCurrentVMPosOffset[i] += cg.frametime / 1000.0 * fDelta * vm_offset_speed->value;
|
||||
|
||||
if (fDelta > 0.0)
|
||||
{
|
||||
if (fDelta > 0.0) {
|
||||
if (cgi.anim->g_vCurrentVMPosOffset[i] > vTargOfs[i]) {
|
||||
cgi.anim->g_vCurrentVMPosOffset[i] = vTargOfs[i];
|
||||
}
|
||||
}
|
||||
else if (fDelta < 0.0) {
|
||||
} else if (fDelta < 0.0) {
|
||||
if (cgi.anim->g_vCurrentVMPosOffset[i] < vTargOfs[i]) {
|
||||
cgi.anim->g_vCurrentVMPosOffset[i] = vTargOfs[i];
|
||||
}
|
||||
|
||||
+553
-698
File diff suppressed because it is too large.
Load diff
@@ -0,0 +1,241 @@
|
||||
/*
|
||||
===========================================================================
|
||||
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 "cg_local.h"
|
||||
#include "memarchiver.h"
|
||||
#include "../qcommon/vector.h"
|
||||
#include "../qcommon/str.h"
|
||||
|
||||
MemArchiver::MemArchiver()
|
||||
{
|
||||
state = MEMARC_WRITING;
|
||||
buffer = 0;
|
||||
allocatedSize = 0;
|
||||
bufferSize = 0;
|
||||
}
|
||||
|
||||
MemArchiver::~MemArchiver()
|
||||
{
|
||||
if (state == MEMARC_WRITING && buffer) {
|
||||
cgi.Free(buffer);
|
||||
}
|
||||
}
|
||||
|
||||
void MemArchiver::SetupForWriting(size_t initialSize)
|
||||
{
|
||||
this->state = MEMARC_WRITING;
|
||||
this->buffer = (byte*)cgi.Malloc(initialSize);
|
||||
this->allocatedSize = initialSize;
|
||||
this->bufferSize = 0;
|
||||
}
|
||||
|
||||
void MemArchiver::SetupForReading(byte* buffer, size_t size)
|
||||
{
|
||||
this->state = MEMARC_READING;
|
||||
this->buffer = buffer;
|
||||
this->allocatedSize = size;
|
||||
this->bufferSize = 0;
|
||||
}
|
||||
|
||||
void MemArchiver::SetBaseTime(unsigned int time)
|
||||
{
|
||||
this->svsTime = time;
|
||||
}
|
||||
|
||||
size_t MemArchiver::BufferSize() const
|
||||
{
|
||||
return bufferSize;
|
||||
}
|
||||
|
||||
byte* MemArchiver::ConfiscateBuffer()
|
||||
{
|
||||
byte* confiscatedBuffer = buffer;
|
||||
|
||||
buffer = NULL;
|
||||
allocatedSize = 0;
|
||||
bufferSize = 0;
|
||||
|
||||
return confiscatedBuffer;
|
||||
}
|
||||
|
||||
bool MemArchiver::IsReading() const
|
||||
{
|
||||
return !IsWriting();
|
||||
}
|
||||
|
||||
bool MemArchiver::IsWriting() const
|
||||
{
|
||||
return state == MEMARC_WRITING;
|
||||
}
|
||||
|
||||
bool MemArchiver::FinishedReading() const
|
||||
{
|
||||
return bufferSize == allocatedSize;
|
||||
}
|
||||
|
||||
void MemArchiver::ArchiveByte(byte* value)
|
||||
{
|
||||
ArchiveRaw(value, sizeof(byte));
|
||||
}
|
||||
|
||||
void MemArchiver::ArchiveBoolean(qboolean* value)
|
||||
{
|
||||
ArchiveRaw(value, sizeof(qboolean));
|
||||
}
|
||||
|
||||
void MemArchiver::ArchiveChar(char* value)
|
||||
{
|
||||
ArchiveRaw(value, sizeof(char));
|
||||
}
|
||||
|
||||
void MemArchiver::ArchiveUChar(unsigned char* value)
|
||||
{
|
||||
ArchiveRaw(value, sizeof(unsigned char));
|
||||
}
|
||||
|
||||
void MemArchiver::ArchiveShort(short* value)
|
||||
{
|
||||
ArchiveRaw(value, sizeof(short));
|
||||
}
|
||||
|
||||
void MemArchiver::ArchiveInteger(int* value)
|
||||
{
|
||||
ArchiveRaw(value, sizeof(int));
|
||||
}
|
||||
|
||||
void MemArchiver::ArchiveSize(size_t* value)
|
||||
{
|
||||
ArchiveRaw(value, sizeof(size_t));
|
||||
}
|
||||
|
||||
void MemArchiver::ArchiveFloat(float* value)
|
||||
{
|
||||
ArchiveRaw(value, sizeof(float));
|
||||
}
|
||||
|
||||
void MemArchiver::ArchiveVec3(vec3_t value)
|
||||
{
|
||||
ArchiveRaw(value, sizeof(vec3_t));
|
||||
}
|
||||
|
||||
void MemArchiver::ArchiveVector(Vector* value)
|
||||
{
|
||||
ArchiveFloat(&value->x);
|
||||
ArchiveFloat(&value->y);
|
||||
ArchiveFloat(&value->z);
|
||||
}
|
||||
|
||||
void MemArchiver::ArchiveString(str* value)
|
||||
{
|
||||
char tmp[4096];
|
||||
int current = 0;
|
||||
|
||||
if (IsReading()) {
|
||||
for (current = 0; current < 4096; current++) {
|
||||
ArchiveReadRaw(&tmp[current], sizeof(char));
|
||||
if (!tmp[current]) {
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if (current == 4096) {
|
||||
tmp[current - 1] = 0;
|
||||
}
|
||||
|
||||
*value = tmp;
|
||||
} else {
|
||||
ArchiveWriteRaw(value->c_str(), value->length() + 1);
|
||||
}
|
||||
}
|
||||
|
||||
void MemArchiver::ArchiveTime(int* value)
|
||||
{
|
||||
int time;
|
||||
|
||||
if (IsReading()) {
|
||||
ArchiveReadRaw(&time, sizeof(time));
|
||||
|
||||
if (time) {
|
||||
time += svsTime;
|
||||
}
|
||||
|
||||
*value = time;
|
||||
} else {
|
||||
time = *value;
|
||||
if (time) {
|
||||
time -= svsTime;
|
||||
}
|
||||
|
||||
ArchiveWriteRaw(&time, sizeof(time));
|
||||
}
|
||||
}
|
||||
|
||||
void MemArchiver::ArchiveRaw(void* buffer, size_t size)
|
||||
{
|
||||
if (IsReading()) {
|
||||
ArchiveReadRaw(buffer, size);
|
||||
} else {
|
||||
ArchiveWriteRaw(buffer, size);
|
||||
}
|
||||
}
|
||||
|
||||
void MemArchiver::ArchiveReadRaw(void* buffer, size_t size)
|
||||
{
|
||||
if (!size) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (size + this->bufferSize > this->allocatedSize) {
|
||||
Com_Error(ERR_DROP, "MemArchiver: tried to read past end of buffer");
|
||||
}
|
||||
|
||||
memcpy(buffer, this->buffer + this->bufferSize, size);
|
||||
this->bufferSize += size;
|
||||
}
|
||||
|
||||
void MemArchiver::ArchiveWriteRaw(const void* buffer, size_t size)
|
||||
{
|
||||
if (!size) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (size + this->bufferSize > this->allocatedSize) {
|
||||
if (!this->allocatedSize) {
|
||||
this->allocatedSize = 1024;
|
||||
this->buffer = (byte*)cgi.Malloc(this->allocatedSize);
|
||||
} else {
|
||||
byte* newBuffer;
|
||||
|
||||
do {
|
||||
this->allocatedSize *= 2;
|
||||
} while (size + this->bufferSize > this->allocatedSize);
|
||||
|
||||
newBuffer = (byte*)cgi.Malloc(this->allocatedSize);
|
||||
memcpy(newBuffer, this->buffer, this->bufferSize);
|
||||
cgi.Free(this->buffer);
|
||||
this->buffer = newBuffer;
|
||||
}
|
||||
}
|
||||
|
||||
memcpy(this->buffer + this->bufferSize, buffer, size);
|
||||
this->bufferSize += size;
|
||||
}
|
||||
@@ -0,0 +1,72 @@
|
||||
/*
|
||||
===========================================================================
|
||||
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
|
||||
===========================================================================
|
||||
*/
|
||||
|
||||
// DESCRIPTION:
|
||||
// In-memory archiver
|
||||
|
||||
#include "cg_local.h"
|
||||
|
||||
class Vector;
|
||||
class str;
|
||||
|
||||
typedef enum {
|
||||
MEMARC_WRITING,
|
||||
MEMARC_READING
|
||||
} archiverState_e;
|
||||
|
||||
class MemArchiver {
|
||||
public:
|
||||
MemArchiver();
|
||||
~MemArchiver();
|
||||
|
||||
void SetupForWriting(size_t initialSize);
|
||||
void SetupForReading(byte* buffer, size_t size);
|
||||
void SetBaseTime(unsigned int time);
|
||||
size_t BufferSize() const;
|
||||
byte* ConfiscateBuffer();
|
||||
bool IsReading() const;
|
||||
bool IsWriting() const;
|
||||
bool FinishedReading() const;
|
||||
|
||||
void ArchiveByte(byte* value);
|
||||
void ArchiveBoolean(qboolean* value);
|
||||
void ArchiveChar(char* value);
|
||||
void ArchiveUChar(unsigned char* value);
|
||||
void ArchiveShort(short* value);
|
||||
void ArchiveInteger(int* value);
|
||||
void ArchiveSize(size_t* value);
|
||||
void ArchiveFloat(float* value);
|
||||
void ArchiveVec3(vec3_t value);
|
||||
void ArchiveVector(Vector* value);
|
||||
void ArchiveString(str* value);
|
||||
void ArchiveTime(int* value);
|
||||
void ArchiveRaw(void* buffer, size_t size);
|
||||
void ArchiveReadRaw(void* buffer, size_t size);
|
||||
void ArchiveWriteRaw(const void* buffer, size_t size);
|
||||
|
||||
private:
|
||||
archiverState_e state;
|
||||
byte* buffer;
|
||||
size_t bufferSize;
|
||||
size_t allocatedSize;
|
||||
int svsTime;
|
||||
};
|
||||
@@ -1,15 +1,17 @@
|
||||
cmake_minimum_required(VERSION 3.5)
|
||||
project(omohclient)
|
||||
|
||||
option(NO_OPENAL "Use older sound-system" FALSE)
|
||||
|
||||
add_subdirectory("../cgame" "./cgame")
|
||||
|
||||
file(GLOB_RECURSE SOURCES_CLIENT "./*.c*")
|
||||
file(GLOB SOURCES_CLIENT "./*.c*")
|
||||
file(GLOB_RECURSE SOURCES_UILIB "../uilib/*.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_definitions(omohclient INTERFACE USE_OPENAL_DLOPEN=1)
|
||||
target_compile_features(omohclient INTERFACE cxx_nullptr)
|
||||
target_compile_features(omohclient INTERFACE c_variadic_macros)
|
||||
target_link_libraries(omohclient INTERFACE omohsdl)
|
||||
@@ -18,6 +20,56 @@ 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)
|
||||
target_include_directories(omohclient INTERFACE "../libmad-0.15.1b")
|
||||
if (NOT NO_OPENAL)
|
||||
# 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()
|
||||
target_link_libraries(omohclient INTERFACE ${OPENAL_LIBRARY})
|
||||
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
|
||||
}
|
||||
|
||||
/*
|
||||
|
||||
+207
-67
@@ -23,8 +23,10 @@ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
|
||||
#include "client.h"
|
||||
#include "cl_ui.h"
|
||||
#include "cl_uiradar.h"
|
||||
#include "../qcommon/tiki.h"
|
||||
#include "../qcommon/localization.h"
|
||||
#include "../qcommon/bg_compat.h"
|
||||
|
||||
extern qboolean loadCamera(const char *name);
|
||||
extern void startCamera(int time);
|
||||
@@ -209,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;
|
||||
@@ -232,33 +234,37 @@ 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)
|
||||
{
|
||||
for (i = count; i < snapshot->numEntities; i++)
|
||||
if (snapshot->numEntities != count) {
|
||||
Com_DPrintf("CL_GetSnapshot: Not all children could find their parents.\n");
|
||||
|
||||
for (i = snapshot->numEntities; i < count; i++)
|
||||
{
|
||||
s1 = &cl.parseEntities[(clSnap->parseEntitiesNum + i) & (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",
|
||||
s1->number,
|
||||
s1->parent,
|
||||
CL_ConfigString(CS_MODELS + s1->modelindex),
|
||||
s1->origin[0],
|
||||
s1->origin[1],
|
||||
s1->origin[2]
|
||||
);
|
||||
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",
|
||||
s1->number,
|
||||
s1->parent,
|
||||
CL_ConfigString(CS_MODELS + s1->modelindex),
|
||||
s1->origin[0],
|
||||
s1->origin[1],
|
||||
s1->origin[2]
|
||||
);
|
||||
|
||||
parents[s1->number] = -2;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -290,19 +296,17 @@ void CL_CgameError( const char *string ) {
|
||||
CL_ConfigstringModified
|
||||
=====================
|
||||
*/
|
||||
void CL_ConfigstringModified( void ) {
|
||||
char *old, *s;
|
||||
int i, index;
|
||||
void CL_ConfigstringModified(int index, char* s) {
|
||||
char *old;
|
||||
int i;
|
||||
char *dup;
|
||||
gameState_t oldGs;
|
||||
size_t len;
|
||||
|
||||
index = atoi( Cmd_Argv(1) );
|
||||
index = CPT_NormalizeConfigstring(index);
|
||||
if ( index < 0 || index >= MAX_CONFIGSTRINGS ) {
|
||||
Com_Error( ERR_DROP, "configstring > MAX_CONFIGSTRINGS" );
|
||||
}
|
||||
// get everything after "cs <num>"
|
||||
s = Cmd_ArgsFrom(2);
|
||||
|
||||
old = cl.gameState.stringData + cl.gameState.stringOffsets[ index ];
|
||||
if ( !strcmp( old, s ) ) {
|
||||
@@ -346,6 +350,48 @@ void CL_ConfigstringModified( void ) {
|
||||
|
||||
}
|
||||
|
||||
/*
|
||||
=====================
|
||||
CL_ProcessServerCommand
|
||||
=====================
|
||||
*/
|
||||
qboolean CL_ProcessServerCommand(const char* origString, const char* cmd, qboolean differentServer) {
|
||||
if (!strcmp(cmd, "disconnect")) {
|
||||
// Execute the disconnect command in the main loop
|
||||
// Never call Com_Error there:
|
||||
// because this function might be called from a module that would be unloaded
|
||||
// inside Com_Error
|
||||
UI_ForceMenuOff(1);
|
||||
// Fixed in OPM
|
||||
// Added a newline for next commands
|
||||
Cbuf_AddText("disconnect;pushmenu disconnected\n");
|
||||
return qtrue;
|
||||
}
|
||||
|
||||
if (!strcmp(cmd, "cs")) {
|
||||
CL_ConfigstringModified(atoi(Cmd_Argv(1)), Cmd_ArgsFrom(2));
|
||||
// reparse the string, because CL_ConfigstringModified may have done another Cmd_TokenizeString()
|
||||
Cmd_TokenizeString(origString);
|
||||
return qtrue;
|
||||
}
|
||||
|
||||
if (!strcmp(cmd, "fadesound")) {
|
||||
Com_Printf("CL_ProcessServerCommand: fadesound '%s'\n", Cmd_Argv(1));
|
||||
|
||||
if (differentServer) {
|
||||
Com_Printf("^~^~^ fadesound from previous map ignored\n");
|
||||
return qfalse;
|
||||
}
|
||||
|
||||
S_FadeSound(atof(Cmd_Argv(1)));
|
||||
return qfalse;
|
||||
}
|
||||
|
||||
// we may want to put a "connect to other server" command here
|
||||
|
||||
// cgame can now act on the command
|
||||
return qtrue;
|
||||
}
|
||||
|
||||
/*
|
||||
===================
|
||||
@@ -355,10 +401,9 @@ Set up argc/argv for the given command
|
||||
===================
|
||||
*/
|
||||
qboolean CL_GetServerCommand( int serverCommandNumber, qboolean differentServer ) {
|
||||
char *s;
|
||||
char *cmd;
|
||||
char *s;
|
||||
char *cmd;
|
||||
static char bigConfigString[BIG_INFO_STRING];
|
||||
int argc;
|
||||
|
||||
// if we have irretrievably lost a reliable command, drop the connection
|
||||
if ( serverCommandNumber <= clc.serverCommandSequence - MAX_RELIABLE_COMMANDS ) {
|
||||
@@ -382,31 +427,40 @@ qboolean CL_GetServerCommand( int serverCommandNumber, qboolean differentServer
|
||||
Com_DPrintf( "serverCommand: %i : %s\n", serverCommandNumber, s );
|
||||
}
|
||||
|
||||
rescan:
|
||||
Cmd_TokenizeString( s );
|
||||
Cmd_TokenizeString(s);
|
||||
cmd = Cmd_Argv(0);
|
||||
argc = Cmd_Argc();
|
||||
|
||||
if ( !strcmp( cmd, "disconnect" ) ) {
|
||||
// https://zerowing.idsoftware.com/bugzilla/show_bug.cgi?id=552
|
||||
// allow server to indicate why they were disconnected
|
||||
if ( argc >= 2 )
|
||||
Com_Error( ERR_SERVERDISCONNECT, "Server disconnected - %s", Cmd_Argv( 1 ) );
|
||||
else
|
||||
Com_Error( ERR_SERVERDISCONNECT, "Server disconnected\n" );
|
||||
// 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, "cs" ) ) {
|
||||
CL_ConfigstringModified();
|
||||
// reparse the string, because CL_ConfigstringModified may have done another Cmd_TokenizeString()
|
||||
Cmd_TokenizeString( s );
|
||||
return qtrue;
|
||||
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;
|
||||
}
|
||||
|
||||
// we may want to put a "connect to other server" command here
|
||||
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;
|
||||
|
||||
// cgame can now act on the command
|
||||
return qtrue;
|
||||
// reparse
|
||||
Cmd_TokenizeString(s);
|
||||
cmd = Cmd_Argv(0);
|
||||
}
|
||||
|
||||
return CL_ProcessServerCommand(s, cmd, differentServer);
|
||||
}
|
||||
|
||||
|
||||
@@ -417,10 +471,10 @@ CL_CM_LoadMap
|
||||
Just adds default parameters that cgame doesn't need to know about
|
||||
====================
|
||||
*/
|
||||
void CL_CM_LoadMap( const char *mapname ) {
|
||||
int checksum;
|
||||
|
||||
CM_LoadMap( mapname, qtrue, &checksum );
|
||||
void CL_CM_LoadMap( const char *mapname, int *checksum ) {
|
||||
CM_LoadMap( mapname, qtrue, checksum );
|
||||
// prepare world vis data
|
||||
re.SetWorldVisData(CM_VisibilityPointer());
|
||||
}
|
||||
|
||||
/*
|
||||
@@ -443,6 +497,16 @@ void CL_CG_Free( void *ptr )
|
||||
Z_Free( ptr );
|
||||
}
|
||||
|
||||
/*
|
||||
====================
|
||||
CL_CG_AddReliableCommand
|
||||
====================
|
||||
*/
|
||||
void CL_CG_AddReliableCommand(const char* cmd)
|
||||
{
|
||||
CL_AddReliableCommand(cmd, qfalse);
|
||||
}
|
||||
|
||||
/*
|
||||
====================
|
||||
CL_R_AddPolyToScene
|
||||
@@ -513,6 +577,29 @@ void CL_StartLocalSound(const char* soundName, qboolean forceLoad) {
|
||||
S_StartLocalSound(soundName, qfalse );
|
||||
}
|
||||
|
||||
/*
|
||||
====================
|
||||
CL_RestoreSavedCgameState
|
||||
====================
|
||||
*/
|
||||
void CL_RestoreSavedCgameState() {
|
||||
if (cls.savedCgameState) {
|
||||
cge->CG_LoadStateToBuffer(cls.savedCgameState, cls.savedCgameStateSize, cl.snap.serverTime);
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
====================
|
||||
CL_ClearSavedCgameState
|
||||
====================
|
||||
*/
|
||||
void CL_ClearSavedCgameState() {
|
||||
if (cls.savedCgameState) {
|
||||
cls.savedCgameState = NULL;
|
||||
cls.savedCgameStateSize = 0;
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
====================
|
||||
CL_InitCGameDLL
|
||||
@@ -529,6 +616,7 @@ void CL_InitCGameDLL( clientGameImport_t *cgi, clientGameExport_t **cge ) {
|
||||
|
||||
cgi->Printf = Com_Printf;
|
||||
cgi->DPrintf = Com_DPrintf;
|
||||
cgi->DebugPrintf = Com_DebugPrintf;
|
||||
|
||||
cgi->Malloc = CL_CG_Malloc;
|
||||
cgi->Free = CL_CG_Free;
|
||||
@@ -539,6 +627,7 @@ 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->Argc = Cmd_Argc;
|
||||
@@ -554,6 +643,8 @@ void CL_InitCGameDLL( clientGameImport_t *cgi, clientGameExport_t **cge ) {
|
||||
cgi->FS_FreeFile = FS_FreeFile;
|
||||
cgi->FS_WriteFile = FS_WriteFile;
|
||||
cgi->FS_WriteTextFile = FS_WriteTextFile;
|
||||
cgi->FS_ListFilteredFiles = FS_ListFilteredFiles;
|
||||
cgi->FS_FreeFileList = FS_FreeFileList;
|
||||
|
||||
cgi->SendConsoleCommand = Cbuf_AddText;
|
||||
|
||||
@@ -572,7 +663,7 @@ void CL_InitCGameDLL( clientGameImport_t *cgi, clientGameExport_t **cge ) {
|
||||
cgi->MSG_ReadCoord = CL_MSG_ReadCoord;
|
||||
cgi->MSG_ReadDir = CL_MSG_ReadDir;
|
||||
|
||||
cgi->SendClientCommand = CL_AddReliableCommand;
|
||||
cgi->SendClientCommand = CL_CG_AddReliableCommand;
|
||||
|
||||
cgi->CM_LoadMap = CL_CM_LoadMap;
|
||||
cgi->CM_NumInlineModels = CM_NumInlineModels;
|
||||
@@ -625,9 +716,11 @@ void CL_InitCGameDLL( clientGameImport_t *cgi, clientGameExport_t **cge ) {
|
||||
cgi->R_RegisterModel = re.RegisterModel;
|
||||
cgi->R_SpawnEffectModel = re.SpawnEffectModel;
|
||||
cgi->R_RegisterServerModel = re.RegisterServerModel;
|
||||
cgi->R_GetModelName = re.GetModelName;
|
||||
cgi->R_UnregisterServerModel = re.UnregisterServerModel;
|
||||
cgi->R_RegisterShader = re.RegisterShader;
|
||||
cgi->R_RegisterShaderNoMip = re.RegisterShaderNoMip;
|
||||
cgi->R_GetShaderName = re.GetShaderName;
|
||||
|
||||
cgi->R_AddRefEntityToScene = re.AddRefEntityToScene;
|
||||
cgi->R_AddRefSpriteToScene = re.AddRefSpriteToScene;
|
||||
@@ -679,7 +772,8 @@ 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->Key_StringToKeynum = Key_StringToKeynum;
|
||||
cgi->Key_KeynumToBindString = Key_KeynumToBindString;
|
||||
cgi->Key_GetKeysForCommand = Key_GetKeysForCommand;
|
||||
@@ -718,11 +812,16 @@ void CL_InitCGameDLL( clientGameImport_t *cgi, clientGameExport_t **cge ) {
|
||||
cgi->UI_SetScoreBoardItem = UI_SetScoreBoardItem;
|
||||
cgi->UI_DeleteScoreBoardItems = UI_DeleteScoreBoardItems;
|
||||
cgi->UI_ToggleDMMessageConsole = UI_ToggleDMConsole;
|
||||
cgi->CL_InitRadar = CL_InitRadar;
|
||||
|
||||
cgi->TIKI_FindTiki = TIKI_FindTiki;
|
||||
|
||||
cgi->LoadResource = UI_LoadResource;
|
||||
cgi->FS_CanonicalFilename = FS_CanonicalFilename;
|
||||
cgi->CL_RestoreSavedCgameState = CL_RestoreSavedCgameState;
|
||||
cgi->CL_ClearSavedCgameState = CL_ClearSavedCgameState;
|
||||
|
||||
cgi->getConfigStringIdNormalized = CPT_NormalizeConfigstring;
|
||||
|
||||
cgi->fsDebug = fs_debug;
|
||||
cgi->HudDrawElements = cls.HudDrawElements;
|
||||
@@ -877,8 +976,6 @@ qboolean CL_GameCommand( void ) {
|
||||
return cge->CG_ConsoleCommand();
|
||||
}
|
||||
|
||||
|
||||
|
||||
/*
|
||||
=====================
|
||||
CL_CGameRendering
|
||||
@@ -893,6 +990,10 @@ void CL_CGameRendering( stereoFrame_t stereo ) {
|
||||
cge->CG_DrawActiveFrame( cl.serverTime, cl.serverTime - cl.oldServerTime, stereo, clc.demoplaying );
|
||||
|
||||
cl.oldServerTime = cl.serverTime;
|
||||
//
|
||||
// Let cgame clean up temp models
|
||||
//
|
||||
cge->CG_CleanUpTempModels();
|
||||
}
|
||||
|
||||
/*
|
||||
@@ -1014,6 +1115,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;
|
||||
@@ -1064,20 +1201,23 @@ 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;
|
||||
}
|
||||
|
||||
// FIXME
|
||||
//if( ( cl.snap.snapFlags ^ lastSnapFlags ) & SNAPFLAG_SERVERCOUNT ) {
|
||||
// CL_ServerRestarted();
|
||||
//} else {
|
||||
|
||||
if( ( cl.snap.snapFlags ^ lastSnapFlags ) & SNAPFLAG_SERVERCOUNT ) {
|
||||
CL_ServerRestarted();
|
||||
} else {
|
||||
if( cl.snap.serverTime < cl.oldFrameServerTime ) {
|
||||
assert( 0 );
|
||||
Com_Error( ERR_DROP, "cl.snap.serverTime < cl.oldFrameServerTime" );
|
||||
}
|
||||
//}
|
||||
}
|
||||
|
||||
cl.oldFrameServerTime = cl.snap.serverTime;
|
||||
|
||||
|
||||
+161
-46
@@ -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");
|
||||
@@ -1583,43 +1637,106 @@ void CIN_DrawCinematic (int handle) {
|
||||
|
||||
CIN_ResampleCinematic(handle, buf2);
|
||||
|
||||
re.DrawStretchRaw( x, y, w, h, 256, 256, (byte *)buf2, 0, qfalse);
|
||||
re.DrawStretchRaw( x, y, w, h, 256, 256, 0, (byte *)buf2);
|
||||
cinTable[handle].dirty = qfalse;
|
||||
Hunk_FreeTempMemory(buf2);
|
||||
return;
|
||||
}
|
||||
|
||||
re.DrawStretchRaw( x, y, w, h, cinTable[handle].drawX, cinTable[handle].drawY, buf, 0, qfalse);
|
||||
re.DrawStretchRaw( x, y, w, h, cinTable[handle].drawX, cinTable[handle].drawY, 0, buf);
|
||||
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_StopAllSounds( 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_StopAllSounds( qtrue );
|
||||
CL_handle = -1;
|
||||
}
|
||||
}
|
||||
@@ -1,330 +0,0 @@
|
||||
/*
|
||||
===========================================================================
|
||||
Copyright (C) 2006 Tony J. White (tjw@tjw.org)
|
||||
|
||||
This file is part of Quake III Arena source code.
|
||||
|
||||
Quake III Arena 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.
|
||||
|
||||
Quake III Arena 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 Quake III Arena source code; if not, write to the Free Software
|
||||
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
===========================================================================
|
||||
*/
|
||||
|
||||
#ifdef USE_CURL
|
||||
#include "client.h"
|
||||
cvar_t *cl_cURLLib;
|
||||
|
||||
#ifdef USE_CURL_DLOPEN
|
||||
#include "../sys/sys_loadlib.h"
|
||||
|
||||
char* (*qcurl_version)(void);
|
||||
|
||||
CURL* (*qcurl_easy_init)(void);
|
||||
CURLcode (*qcurl_easy_setopt)(CURL *curl, CURLoption option, ...);
|
||||
CURLcode (*qcurl_easy_perform)(CURL *curl);
|
||||
void (*qcurl_easy_cleanup)(CURL *curl);
|
||||
CURLcode (*qcurl_easy_getinfo)(CURL *curl, CURLINFO info, ...);
|
||||
CURL* (*qcurl_easy_duphandle)(CURL *curl);
|
||||
void (*qcurl_easy_reset)(CURL *curl);
|
||||
const char *(*qcurl_easy_strerror)(CURLcode);
|
||||
|
||||
CURLM* (*qcurl_multi_init)(void);
|
||||
CURLMcode (*qcurl_multi_add_handle)(CURLM *multi_handle,
|
||||
CURL *curl_handle);
|
||||
CURLMcode (*qcurl_multi_remove_handle)(CURLM *multi_handle,
|
||||
CURL *curl_handle);
|
||||
CURLMcode (*qcurl_multi_fdset)(CURLM *multi_handle,
|
||||
fd_set *read_fd_set,
|
||||
fd_set *write_fd_set,
|
||||
fd_set *exc_fd_set,
|
||||
int *max_fd);
|
||||
CURLMcode (*qcurl_multi_perform)(CURLM *multi_handle,
|
||||
int *running_handles);
|
||||
CURLMcode (*qcurl_multi_cleanup)(CURLM *multi_handle);
|
||||
CURLMsg *(*qcurl_multi_info_read)(CURLM *multi_handle,
|
||||
int *msgs_in_queue);
|
||||
const char *(*qcurl_multi_strerror)(CURLMcode);
|
||||
|
||||
static void *cURLLib = NULL;
|
||||
|
||||
/*
|
||||
=================
|
||||
GPA
|
||||
=================
|
||||
*/
|
||||
static void *GPA(char *str)
|
||||
{
|
||||
void *rv;
|
||||
|
||||
rv = Sys_LoadFunction(cURLLib, str);
|
||||
if(!rv)
|
||||
{
|
||||
Com_Printf("Can't load symbol %s\n", str);
|
||||
clc.cURLEnabled = qfalse;
|
||||
return NULL;
|
||||
}
|
||||
else
|
||||
{
|
||||
Com_DPrintf("Loaded symbol %s (0x%p)\n", str, rv);
|
||||
return rv;
|
||||
}
|
||||
}
|
||||
#endif /* USE_CURL_DLOPEN */
|
||||
|
||||
/*
|
||||
=================
|
||||
CL_cURL_Init
|
||||
=================
|
||||
*/
|
||||
qboolean CL_cURL_Init()
|
||||
{
|
||||
#ifdef USE_CURL_DLOPEN
|
||||
if(cURLLib)
|
||||
return qtrue;
|
||||
|
||||
|
||||
Com_Printf("Loading \"%s\"...", cl_cURLLib->string);
|
||||
if( (cURLLib = Sys_LoadLibrary(cl_cURLLib->string)) == 0 )
|
||||
{
|
||||
#ifdef _WIN32
|
||||
return qfalse;
|
||||
#else
|
||||
char fn[1024];
|
||||
Q_strncpyz( fn, Sys_Cwd( ), sizeof( fn ) );
|
||||
strncat(fn, "/", sizeof(fn)-strlen(fn)-1);
|
||||
strncat(fn, cl_cURLLib->string, sizeof(fn)-strlen(fn)-1);
|
||||
|
||||
if( (cURLLib = Sys_LoadLibrary(fn)) == 0 )
|
||||
{
|
||||
return qfalse;
|
||||
}
|
||||
#endif /* _WIN32 */
|
||||
}
|
||||
|
||||
clc.cURLEnabled = qtrue;
|
||||
|
||||
qcurl_version = GPA("curl_version");
|
||||
|
||||
qcurl_easy_init = GPA("curl_easy_init");
|
||||
qcurl_easy_setopt = GPA("curl_easy_setopt");
|
||||
qcurl_easy_perform = GPA("curl_easy_perform");
|
||||
qcurl_easy_cleanup = GPA("curl_easy_cleanup");
|
||||
qcurl_easy_getinfo = GPA("curl_easy_getinfo");
|
||||
qcurl_easy_duphandle = GPA("curl_easy_duphandle");
|
||||
qcurl_easy_reset = GPA("curl_easy_reset");
|
||||
qcurl_easy_strerror = GPA("curl_easy_strerror");
|
||||
|
||||
qcurl_multi_init = GPA("curl_multi_init");
|
||||
qcurl_multi_add_handle = GPA("curl_multi_add_handle");
|
||||
qcurl_multi_remove_handle = GPA("curl_multi_remove_handle");
|
||||
qcurl_multi_fdset = GPA("curl_multi_fdset");
|
||||
qcurl_multi_perform = GPA("curl_multi_perform");
|
||||
qcurl_multi_cleanup = GPA("curl_multi_cleanup");
|
||||
qcurl_multi_info_read = GPA("curl_multi_info_read");
|
||||
qcurl_multi_strerror = GPA("curl_multi_strerror");
|
||||
|
||||
if(!clc.cURLEnabled)
|
||||
{
|
||||
CL_cURL_Shutdown();
|
||||
Com_Printf("FAIL One or more symbols not found\n");
|
||||
return qfalse;
|
||||
}
|
||||
Com_Printf("OK\n");
|
||||
|
||||
return qtrue;
|
||||
#else
|
||||
clc.cURLEnabled = qtrue;
|
||||
return qtrue;
|
||||
#endif /* USE_CURL_DLOPEN */
|
||||
}
|
||||
|
||||
/*
|
||||
=================
|
||||
CL_cURL_Shutdown
|
||||
=================
|
||||
*/
|
||||
void CL_cURL_Shutdown( void )
|
||||
{
|
||||
CL_cURL_Cleanup();
|
||||
#ifdef USE_CURL_DLOPEN
|
||||
if(cURLLib)
|
||||
{
|
||||
Sys_UnloadLibrary(cURLLib);
|
||||
cURLLib = NULL;
|
||||
}
|
||||
qcurl_easy_init = NULL;
|
||||
qcurl_easy_setopt = NULL;
|
||||
qcurl_easy_perform = NULL;
|
||||
qcurl_easy_cleanup = NULL;
|
||||
qcurl_easy_getinfo = NULL;
|
||||
qcurl_easy_duphandle = NULL;
|
||||
qcurl_easy_reset = NULL;
|
||||
|
||||
qcurl_multi_init = NULL;
|
||||
qcurl_multi_add_handle = NULL;
|
||||
qcurl_multi_remove_handle = NULL;
|
||||
qcurl_multi_fdset = NULL;
|
||||
qcurl_multi_perform = NULL;
|
||||
qcurl_multi_cleanup = NULL;
|
||||
qcurl_multi_info_read = NULL;
|
||||
qcurl_multi_strerror = NULL;
|
||||
#endif /* USE_CURL_DLOPEN */
|
||||
}
|
||||
|
||||
void CL_cURL_Cleanup(void)
|
||||
{
|
||||
if(clc.downloadCURLM) {
|
||||
if(clc.downloadCURL) {
|
||||
qcurl_multi_remove_handle(clc.downloadCURLM,
|
||||
clc.downloadCURL);
|
||||
qcurl_easy_cleanup(clc.downloadCURL);
|
||||
}
|
||||
qcurl_multi_cleanup(clc.downloadCURLM);
|
||||
clc.downloadCURLM = NULL;
|
||||
clc.downloadCURL = NULL;
|
||||
}
|
||||
else if(clc.downloadCURL) {
|
||||
qcurl_easy_cleanup(clc.downloadCURL);
|
||||
clc.downloadCURL = NULL;
|
||||
}
|
||||
}
|
||||
|
||||
static int CL_cURL_CallbackProgress( void *dummy, double dltotal, double dlnow,
|
||||
double ultotal, double ulnow )
|
||||
{
|
||||
clc.downloadSize = (int)dltotal;
|
||||
Cvar_SetValue( "cl_downloadSize", clc.downloadSize );
|
||||
clc.downloadCount = (int)dlnow;
|
||||
Cvar_SetValue( "cl_downloadCount", clc.downloadCount );
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int CL_cURL_CallbackWrite(void *buffer, size_t size, size_t nmemb,
|
||||
void *stream)
|
||||
{
|
||||
FS_Write( buffer, size*nmemb, ((fileHandle_t*)stream)[0] );
|
||||
return size*nmemb;
|
||||
}
|
||||
|
||||
void CL_cURL_BeginDownload( const char *localName, const char *remoteURL )
|
||||
{
|
||||
clc.cURLUsed = qtrue;
|
||||
Com_Printf("URL: %s\n", remoteURL);
|
||||
Com_DPrintf("***** CL_cURL_BeginDownload *****\n"
|
||||
"Localname: %s\n"
|
||||
"RemoteURL: %s\n"
|
||||
"****************************\n", localName, remoteURL);
|
||||
CL_cURL_Cleanup();
|
||||
Q_strncpyz(clc.downloadURL, remoteURL, sizeof(clc.downloadURL));
|
||||
Q_strncpyz(clc.downloadName, localName, sizeof(clc.downloadName));
|
||||
Com_sprintf(clc.downloadTempName, sizeof(clc.downloadTempName),
|
||||
"%s.tmp", localName);
|
||||
|
||||
// Set so UI gets access to it
|
||||
Cvar_Set("cl_downloadName", localName);
|
||||
Cvar_Set("cl_downloadSize", "0");
|
||||
Cvar_Set("cl_downloadCount", "0");
|
||||
Cvar_SetValue("cl_downloadTime", cls.realtime);
|
||||
|
||||
clc.downloadBlock = 0; // Starting new file
|
||||
clc.downloadCount = 0;
|
||||
|
||||
clc.downloadCURL = qcurl_easy_init();
|
||||
if(!clc.downloadCURL) {
|
||||
Com_Error(ERR_DROP, "CL_cURL_BeginDownload: qcurl_easy_init() "
|
||||
"failed\n");
|
||||
return;
|
||||
}
|
||||
clc.download = FS_SV_FOpenFileWrite(clc.downloadTempName);
|
||||
if(!clc.download) {
|
||||
Com_Error(ERR_DROP, "CL_cURL_BeginDownload: failed to open "
|
||||
"%s for writing\n", clc.downloadTempName);
|
||||
return;
|
||||
}
|
||||
qcurl_easy_setopt(clc.downloadCURL, CURLOPT_WRITEDATA, clc.download);
|
||||
if(developer->integer)
|
||||
qcurl_easy_setopt(clc.downloadCURL, CURLOPT_VERBOSE, 1);
|
||||
qcurl_easy_setopt(clc.downloadCURL, CURLOPT_URL, clc.downloadURL);
|
||||
qcurl_easy_setopt(clc.downloadCURL, CURLOPT_TRANSFERTEXT, 0);
|
||||
qcurl_easy_setopt(clc.downloadCURL, CURLOPT_REFERER, va("ioQ3://%s",
|
||||
NET_AdrToString(clc.serverAddress)));
|
||||
qcurl_easy_setopt(clc.downloadCURL, CURLOPT_USERAGENT, va("%s %s",
|
||||
Q3_VERSION, qcurl_version()));
|
||||
qcurl_easy_setopt(clc.downloadCURL, CURLOPT_WRITEFUNCTION,
|
||||
CL_cURL_CallbackWrite);
|
||||
qcurl_easy_setopt(clc.downloadCURL, CURLOPT_WRITEDATA, &clc.download);
|
||||
qcurl_easy_setopt(clc.downloadCURL, CURLOPT_NOPROGRESS, 0);
|
||||
qcurl_easy_setopt(clc.downloadCURL, CURLOPT_PROGRESSFUNCTION,
|
||||
CL_cURL_CallbackProgress);
|
||||
qcurl_easy_setopt(clc.downloadCURL, CURLOPT_PROGRESSDATA, NULL);
|
||||
qcurl_easy_setopt(clc.downloadCURL, CURLOPT_FAILONERROR, 1);
|
||||
qcurl_easy_setopt(clc.downloadCURL, CURLOPT_FOLLOWLOCATION, 1);
|
||||
qcurl_easy_setopt(clc.downloadCURL, CURLOPT_MAXREDIRS, 5);
|
||||
clc.downloadCURLM = qcurl_multi_init();
|
||||
if(!clc.downloadCURLM) {
|
||||
qcurl_easy_cleanup(clc.downloadCURL);
|
||||
clc.downloadCURL = NULL;
|
||||
Com_Error(ERR_DROP, "CL_cURL_BeginDownload: qcurl_multi_init() "
|
||||
"failed\n");
|
||||
return;
|
||||
}
|
||||
qcurl_multi_add_handle(clc.downloadCURLM, clc.downloadCURL);
|
||||
|
||||
if(!(clc.sv_allowDownload & DLF_NO_DISCONNECT) &&
|
||||
!clc.cURLDisconnected) {
|
||||
|
||||
CL_AddReliableCommand("disconnect");
|
||||
CL_WritePacket();
|
||||
CL_WritePacket();
|
||||
CL_WritePacket();
|
||||
clc.cURLDisconnected = qtrue;
|
||||
}
|
||||
}
|
||||
|
||||
void CL_cURL_PerformDownload(void)
|
||||
{
|
||||
CURLMcode res;
|
||||
CURLMsg *msg;
|
||||
int c;
|
||||
int i = 0;
|
||||
|
||||
res = qcurl_multi_perform(clc.downloadCURLM, &c);
|
||||
while(res == CURLM_CALL_MULTI_PERFORM && i < 100) {
|
||||
res = qcurl_multi_perform(clc.downloadCURLM, &c);
|
||||
i++;
|
||||
}
|
||||
if(res == CURLM_CALL_MULTI_PERFORM)
|
||||
return;
|
||||
msg = qcurl_multi_info_read(clc.downloadCURLM, &c);
|
||||
if(msg == NULL) {
|
||||
return;
|
||||
}
|
||||
FS_FCloseFile(clc.download);
|
||||
if(msg->msg == CURLMSG_DONE && msg->data.result == CURLE_OK) {
|
||||
FS_SV_Rename(clc.downloadTempName, clc.downloadName);
|
||||
clc.downloadRestart = qtrue;
|
||||
}
|
||||
else {
|
||||
long code;
|
||||
|
||||
qcurl_easy_getinfo(msg->easy_handle, CURLINFO_RESPONSE_CODE,
|
||||
&code);
|
||||
Com_Error(ERR_DROP, "Download Error: %s Code: %ld URL: %s",
|
||||
qcurl_easy_strerror(msg->data.result),
|
||||
code, clc.downloadURL);
|
||||
}
|
||||
*clc.downloadTempName = *clc.downloadName = 0;
|
||||
Cvar_Set( "cl_downloadName", "" );
|
||||
CL_NextDownload();
|
||||
}
|
||||
#endif /* USE_CURL */
|
||||
+190
-21
@@ -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;
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
@@ -609,8 +651,8 @@ void CL_CmdButtons( usercmd_t *cmd ) {
|
||||
if (UI_MenuActive() || UI_ConsoleIsOpen()) {
|
||||
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 ) {
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
@@ -1051,8 +1141,8 @@ void CL_InitInput( void ) {
|
||||
Cmd_AddCommand("-leanleft", IN_LeanLeftUp);
|
||||
Cmd_AddCommand("+leanright", IN_LeanRightDown);
|
||||
Cmd_AddCommand("-leanright", IN_LeanRightUp);
|
||||
Cmd_AddCommand("+speed", IN_SpeedUp);
|
||||
Cmd_AddCommand("-speed", IN_SpeedDown);
|
||||
Cmd_AddCommand("+speed", IN_SpeedDown);
|
||||
Cmd_AddCommand("-speed", IN_SpeedUp);
|
||||
Cmd_AddCommand("+button0", IN_Button0Down);
|
||||
Cmd_AddCommand("-button0", IN_Button0Up);
|
||||
Cmd_AddCommand("+button1", IN_Button1Down);
|
||||
@@ -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
|
||||
}
|
||||
+973
-130
File diff suppressed because it is too large.
Load diff
+173
-150
@@ -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,175 +20,198 @@ 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 {
|
||||
public:
|
||||
float scale;
|
||||
Vector angles;
|
||||
Vector angledeltas;
|
||||
Vector rotateoffset;
|
||||
Vector offset;
|
||||
inv_move_type move;
|
||||
str model;
|
||||
str anim;
|
||||
};
|
||||
typedef enum {
|
||||
INV_ALIGN_NONE,
|
||||
INV_ALIGN_LEFT,
|
||||
INV_ALIGN_RIGHT
|
||||
} inv_align_type;
|
||||
|
||||
class inventory_item_t : public Class {
|
||||
public:
|
||||
str name;
|
||||
str ammoname;
|
||||
int equip;
|
||||
int width;
|
||||
int height;
|
||||
int barwidth;
|
||||
int barheight;
|
||||
int baroffsetY;
|
||||
int baroffsetX;
|
||||
float modelWindowX;
|
||||
float modelWindowY;
|
||||
float modelWindowWidth;
|
||||
float modelWindowHeight;
|
||||
bool selShaderOnTop;
|
||||
bool checkammo;
|
||||
str command;
|
||||
inv_hudangles_type anglesType;
|
||||
item_properties_t hudprops;
|
||||
item_properties_t invprops;
|
||||
UIReggedMaterial *bgshader;
|
||||
UIReggedMaterial *barshader;
|
||||
UIReggedMaterial *selshader;
|
||||
};
|
||||
typedef enum {
|
||||
INV_CASCADE_LEFT,
|
||||
INV_CASCADE_RIGHT
|
||||
} inv_cascade_type;
|
||||
|
||||
class inventory_type_t {
|
||||
public:
|
||||
str name;
|
||||
bool bg_tile;
|
||||
UIReggedMaterial *texture;
|
||||
UIReggedMaterial *bg;
|
||||
UIReggedMaterial *hoverTexture;
|
||||
UIReggedMaterial *selTexture;
|
||||
Container<inventory_item_t *> items;
|
||||
typedef enum {
|
||||
INV_HUDANGLES_BASE,
|
||||
INV_HUDANGLES_COMPASS,
|
||||
INV_HUDANGLES_COMPASS_NEEDLE
|
||||
} inv_hudangles_type;
|
||||
|
||||
int IndexOfItemPtr( inventory_item_t *item );
|
||||
};
|
||||
|
||||
inline
|
||||
int inventory_type_t::IndexOfItemPtr( inventory_item_t *item )
|
||||
class item_properties_t : public Class
|
||||
{
|
||||
for( int i = items.NumObjects(); i > 0; i-- )
|
||||
{
|
||||
if( items.ObjectAt( i ) == item )
|
||||
{
|
||||
return i;
|
||||
}
|
||||
}
|
||||
public:
|
||||
float scale;
|
||||
Vector angles;
|
||||
Vector angledeltas;
|
||||
Vector rotateoffset;
|
||||
Vector offset;
|
||||
inv_move_type move;
|
||||
str model;
|
||||
str anim;
|
||||
};
|
||||
|
||||
return 0;
|
||||
class inventory_item_t : public Class
|
||||
{
|
||||
public:
|
||||
str name;
|
||||
str ammoname;
|
||||
int equip;
|
||||
int width;
|
||||
int height;
|
||||
int barwidth;
|
||||
int barheight;
|
||||
int baroffsetY;
|
||||
int baroffsetX;
|
||||
float modelWindowX;
|
||||
float modelWindowY;
|
||||
float modelWindowWidth;
|
||||
float modelWindowHeight;
|
||||
bool selShaderOnTop;
|
||||
bool checkammo;
|
||||
str command;
|
||||
inv_hudangles_type anglesType;
|
||||
item_properties_t hudprops;
|
||||
item_properties_t invprops;
|
||||
UIReggedMaterial *bgshader;
|
||||
UIReggedMaterial *barshader;
|
||||
UIReggedMaterial *selshader;
|
||||
};
|
||||
|
||||
class inventory_type_t
|
||||
{
|
||||
public:
|
||||
str name;
|
||||
bool bg_tile;
|
||||
UIReggedMaterial *texture;
|
||||
UIReggedMaterial *bg;
|
||||
UIReggedMaterial *hoverTexture;
|
||||
UIReggedMaterial *selTexture;
|
||||
Container<inventory_item_t *> items;
|
||||
|
||||
int 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) {
|
||||
return i;
|
||||
}
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
class inventory_t {
|
||||
class inventory_t
|
||||
{
|
||||
public:
|
||||
int typewidth;
|
||||
int typeheight;
|
||||
int horizoffset;
|
||||
int vertoffset;
|
||||
int align;
|
||||
inv_cascade_type cascade;
|
||||
str selectsound;
|
||||
str rejectsound;
|
||||
str changesound;
|
||||
Container<inventory_type_t *> types;
|
||||
int typewidth;
|
||||
int typeheight;
|
||||
int horizoffset;
|
||||
int vertoffset;
|
||||
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;
|
||||
inventory_item_t *curitem;
|
||||
int defaultWidth;
|
||||
int defaultHeight;
|
||||
int defaultBarWidth;
|
||||
int defaultBarHeight;
|
||||
int defaultBarOffsetX;
|
||||
int defaultBarOffsetY;
|
||||
inventory_t *inv;
|
||||
inventory_type_t *curtype;
|
||||
inventory_item_t *curitem;
|
||||
int defaultWidth;
|
||||
int defaultHeight;
|
||||
int defaultBarWidth;
|
||||
int defaultBarHeight;
|
||||
int defaultBarOffsetX;
|
||||
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();
|
||||
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);
|
||||
+965
-132
File diff suppressed because it is too large.
Load diff
+81
-58
@@ -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,79 +20,102 @@ 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 ];
|
||||
inventory_item_t *m_hoveritem;
|
||||
inventory_item_t *m_lastmenuitem;
|
||||
FakkInventory *m_parent;
|
||||
float m_hovertop;
|
||||
inventory_type_t *type;
|
||||
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();
|
||||
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;
|
||||
inventory_type_t *m_currenttype;
|
||||
int m_currentitemnum;
|
||||
inventory_t *m_inv;
|
||||
SafePtr<FakkItemList> m_currentlist;
|
||||
inventory_type_t *m_currenttype;
|
||||
int m_currentitemnum;
|
||||
|
||||
public:
|
||||
CLASS_PROTOTYPE( FakkInventory );
|
||||
|
||||
protected:
|
||||
void VerifyItemUp( inventory_item_t *item, qboolean warpmouse );
|
||||
CLASS_PROTOTYPE(FakkInventory);
|
||||
|
||||
public:
|
||||
FakkInventory();
|
||||
~FakkInventory();
|
||||
qboolean m_mouse_active;
|
||||
|
||||
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 );
|
||||
protected:
|
||||
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 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);
|
||||
+933
-919
File diff suppressed because it is too large.
Load diff
+732
-441
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);
|
||||
}
|
||||
}
|
||||
+288
-46
@@ -23,6 +23,7 @@ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
|
||||
#include "client.h"
|
||||
#include "cl_ui.h"
|
||||
#include "../qcommon/bg_compat.h"
|
||||
|
||||
const char *svc_strings[256] = {
|
||||
"svc_bad",
|
||||
@@ -193,6 +194,69 @@ void CL_ParsePacketEntities( msg_t *msg, clSnapshot_t *oldframe, clSnapshot_t *n
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
================
|
||||
CL_UnpackNonPVSClient
|
||||
|
||||
Unpack info about non-visible client.
|
||||
================
|
||||
*/
|
||||
qboolean CL_UnpackNonPVSClient(int* packed, radarUnpacked_t* unpacked) {
|
||||
int x, y;
|
||||
int yaw;
|
||||
qboolean bValid;
|
||||
float range;
|
||||
|
||||
unpacked->clientNum = *packed & (MAX_CLIENTS - 1);
|
||||
if (unpacked->clientNum == cl.snap.ps.clientNum) {
|
||||
return qfalse;
|
||||
}
|
||||
|
||||
x = ((*packed >> 6) & 0x7F) - (MAX_CLIENTS - 1);
|
||||
y = ((*packed >> 13) & 0x7F) - (MAX_CLIENTS - 1);
|
||||
yaw = (*packed >> 20) & 0x1F;
|
||||
bValid = (*packed >> 25) & 1;
|
||||
|
||||
if (com_radar_range && com_radar_range->value) {
|
||||
range = com_radar_range->value;
|
||||
} else {
|
||||
range = 0;
|
||||
}
|
||||
|
||||
unpacked->x = x * range / (MAX_CLIENTS - 1);
|
||||
unpacked->y = y * range / (MAX_CLIENTS - 1);
|
||||
|
||||
if (!bValid)
|
||||
{
|
||||
unpacked->x = x * range / (MAX_CLIENTS - 1) * 1024.0;
|
||||
unpacked->y = y * range / (MAX_CLIENTS - 1) * 1024.0;
|
||||
}
|
||||
|
||||
unpacked->yaw = yaw * 11.25f;
|
||||
|
||||
return qtrue;
|
||||
}
|
||||
|
||||
/*
|
||||
================
|
||||
CL_ReadNonPVSClient
|
||||
|
||||
Reads packed info about non-visible client.
|
||||
================
|
||||
*/
|
||||
void CL_ReadNonPVSClient(int radarInfo) {
|
||||
radarUnpacked_t unpacked;
|
||||
|
||||
if (!cge) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (CL_UnpackNonPVSClient(&radarInfo, &unpacked)) {
|
||||
unpacked.x += cl.snap.ps.origin[0];
|
||||
unpacked.y += cl.snap.ps.origin[1];
|
||||
cge->CG_ReadNonPVSClient(&unpacked);
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
================
|
||||
@@ -278,6 +342,9 @@ void CL_ParseSnapshot( msg_t *msg ) {
|
||||
} else {
|
||||
MSG_ReadDeltaPlayerstate( msg, NULL, &newSnap.ps, cls.serverFrameTime);
|
||||
}
|
||||
// get normalized flags
|
||||
newSnap.ps.pm_flags = CPT_NormalizePlayerStateFlags(newSnap.ps.net_pm_flags);
|
||||
newSnap.ps.iViewModelAnim = CPT_NormalizeViewModelAnim(newSnap.ps.iNetViewModelAnim);
|
||||
|
||||
// read packet entities
|
||||
SHOWNET( msg, "packet entities" );
|
||||
@@ -328,6 +395,9 @@ void CL_ParseSnapshot( msg_t *msg ) {
|
||||
}
|
||||
|
||||
cl.newSnapshots = qtrue;
|
||||
|
||||
// read radar info about invisible clients
|
||||
CL_ReadNonPVSClient(cl.snap.ps.radarInfo);
|
||||
}
|
||||
|
||||
|
||||
@@ -359,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();
|
||||
@@ -444,35 +526,13 @@ static void CL_ParseServerInfo(void)
|
||||
sizeof(clc.sv_dlURL));
|
||||
}
|
||||
|
||||
#if TARGET_GAME_PROTOCOL >= 15
|
||||
|
||||
char* MSG_ReadGameStateChar(msg_t* msg) {
|
||||
return MSG_ReadScrambledBigString(msg);
|
||||
}
|
||||
|
||||
float MSG_ReadServerFrameTime(msg_t* msg) {
|
||||
return MSG_ReadFloat(msg);
|
||||
}
|
||||
|
||||
#else
|
||||
|
||||
char* MSG_ReadGameStateChar(msg_t* msg) {
|
||||
return MSG_ReadString(msg);
|
||||
}
|
||||
|
||||
float MSG_ReadServerFrameTime(msg_t* msg) {
|
||||
return 1.f / atof(Info_ValueForKey(cl.gameState.stringData + cl.gameState.stringOffsets[CS_SYSTEMINFO], "sv_fps"));
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
/*
|
||||
==================
|
||||
CL_ParseGamestate
|
||||
==================
|
||||
*/
|
||||
void CL_ParseGamestate( msg_t *msg ) {
|
||||
int i;
|
||||
int i, csNum;
|
||||
entityState_t *es;
|
||||
int newnum;
|
||||
entityState_t nullstate;
|
||||
@@ -502,22 +562,24 @@ void CL_ParseGamestate( msg_t *msg ) {
|
||||
}
|
||||
|
||||
if ( cmd == svc_configstring ) {
|
||||
int len;
|
||||
int len;
|
||||
|
||||
i = MSG_ReadShort( msg );
|
||||
if ( i < 0 || i >= MAX_CONFIGSTRINGS ) {
|
||||
Com_Error( ERR_DROP, "configstring > MAX_CONFIGSTRINGS" );
|
||||
}
|
||||
s = MSG_ReadGameStateChar( msg );
|
||||
len = strlen( s );
|
||||
i = MSG_ReadShort(msg);
|
||||
csNum = CPT_NormalizeConfigstring(i);
|
||||
if (csNum < 0 || csNum >= MAX_CONFIGSTRINGS) {
|
||||
Com_Error(ERR_DROP, "configstring > MAX_CONFIGSTRINGS");
|
||||
}
|
||||
s = MSG_ReadScrambledBigString(msg);
|
||||
len = strlen(s);
|
||||
|
||||
if ( len + 1 + cl.gameState.dataCount > MAX_GAMESTATE_CHARS ) {
|
||||
Com_Error( ERR_DROP, "MAX_GAMESTATE_CHARS exceeded" );
|
||||
}
|
||||
// append it to the gameState string buffer
|
||||
cl.gameState.stringOffsets[ i ] = cl.gameState.dataCount;
|
||||
Com_Memcpy( cl.gameState.stringData + cl.gameState.dataCount, s, len + 1 );
|
||||
cl.gameState.dataCount += len + 1;
|
||||
if (len + 1 + cl.gameState.dataCount > MAX_GAMESTATE_CHARS) {
|
||||
Com_Error(ERR_DROP, "MAX_GAMESTATE_CHARS exceeded");
|
||||
}
|
||||
|
||||
// append it to the gameState string buffer
|
||||
cl.gameState.stringOffsets[csNum] = cl.gameState.dataCount;
|
||||
Com_Memcpy(cl.gameState.stringData + cl.gameState.dataCount, s, len + 1);
|
||||
cl.gameState.dataCount += len + 1;
|
||||
} else if ( cmd == svc_baseline ) {
|
||||
newnum = MSG_ReadEntityNum(msg);
|
||||
if ( newnum < 0 || newnum >= MAX_GENTITIES ) {
|
||||
@@ -536,7 +598,7 @@ void CL_ParseGamestate( msg_t *msg ) {
|
||||
clc.clientNum = MSG_ReadLong(msg);
|
||||
// read the checksum feed
|
||||
clc.checksumFeed = MSG_ReadLong( msg );
|
||||
cls.serverFrameTime = MSG_ReadServerFrameTime(msg);
|
||||
cls.serverFrameTime = MSG_ReadServerFrameTime(msg, &cl.gameState);
|
||||
|
||||
// parse serverId and other cvars
|
||||
CL_SystemInfoChanged();
|
||||
@@ -546,7 +608,7 @@ void CL_ParseGamestate( msg_t *msg ) {
|
||||
CL_StopRecord_f();
|
||||
|
||||
// reinitialize the filesystem if the game directory has changed
|
||||
FS_ConditionalRestart( clc.checksumFeed );
|
||||
FS_ConditionalRestart( clc.checksumFeed, qfalse );
|
||||
|
||||
clc.state = CA_LOADING;
|
||||
if (!com_sv_running->integer)
|
||||
@@ -651,7 +713,7 @@ void CL_ParseDownload ( msg_t *msg ) {
|
||||
|
||||
if (!*clc.downloadTempName) {
|
||||
Com_Printf("Server sending download, but no download was requested\n");
|
||||
CL_AddReliableCommand( "stopdl" );
|
||||
CL_AddReliableCommand( "stopdl", qfalse );
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -693,7 +755,7 @@ void CL_ParseDownload ( msg_t *msg ) {
|
||||
|
||||
if (!clc.download) {
|
||||
Com_Printf( "Could not create %s\n", clc.downloadTempName );
|
||||
CL_AddReliableCommand( "stopdl" );
|
||||
CL_AddReliableCommand( "stopdl", qfalse );
|
||||
CL_NextDownload();
|
||||
return;
|
||||
}
|
||||
@@ -702,7 +764,7 @@ void CL_ParseDownload ( msg_t *msg ) {
|
||||
if (size)
|
||||
FS_Write( data, size, clc.download );
|
||||
|
||||
CL_AddReliableCommand( va("nextdl %d", clc.downloadBlock) );
|
||||
CL_AddReliableCommand( va("nextdl %d", clc.downloadBlock), qfalse );
|
||||
clc.downloadBlock++;
|
||||
|
||||
clc.downloadCount += size;
|
||||
@@ -716,7 +778,7 @@ void CL_ParseDownload ( msg_t *msg ) {
|
||||
clc.download = 0;
|
||||
|
||||
// rename the file
|
||||
FS_SV_Rename ( clc.downloadTempName, clc.downloadName );
|
||||
FS_SV_Rename ( clc.downloadTempName, clc.downloadName, qfalse );
|
||||
}
|
||||
*clc.downloadTempName = *clc.downloadName = 0;
|
||||
Cvar_Set( "cl_downloadName", "" );
|
||||
@@ -734,6 +796,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
|
||||
@@ -882,8 +1116,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,18 +520,20 @@ 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();
|
||||
CL_StartHunkUsers(qfalse);
|
||||
SCR_SimpleUpdateScreen();
|
||||
|
||||
// set the fps value
|
||||
@@ -553,6 +555,6 @@ void SCR_UpdateScreen( void ) {
|
||||
}
|
||||
}
|
||||
|
||||
recursive = 0;
|
||||
screen_recursive = qfalse;
|
||||
}
|
||||
|
||||
+4098
-4130
File diff suppressed because it is too large.
Load diff
+93
-63
@@ -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.
|
||||
|
||||
@@ -20,103 +20,133 @@ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
===========================================================================
|
||||
*/
|
||||
|
||||
#ifndef __CL_UI_H__
|
||||
#define __CL_UI_H__
|
||||
#pragma once
|
||||
|
||||
#include "../uilib/ui_extern.h"
|
||||
#include "../uilib/uiwidget.h"
|
||||
|
||||
typedef struct {
|
||||
UIReggedMaterial *loading;
|
||||
UIReggedMaterial *loading;
|
||||
} static_media_t;
|
||||
|
||||
//
|
||||
// cvars
|
||||
//
|
||||
extern cvar_t *ui_health_start;
|
||||
extern cvar_t *ui_health_end;
|
||||
extern cvar_t *sound_overlay;
|
||||
extern cvar_t *cl_movieaudio;
|
||||
|
||||
//
|
||||
// initialization
|
||||
//
|
||||
void CL_FillUIDef( void );
|
||||
void CL_InitializeUI( void );
|
||||
void CL_ShutdownUI( void );
|
||||
void CL_FillUIDef(void);
|
||||
void CL_InitializeUI(void);
|
||||
void CL_ShutdownUI(void);
|
||||
|
||||
//
|
||||
// general ui stuff
|
||||
//
|
||||
extern inventory_t client_inv;
|
||||
extern bind_t client_bind;
|
||||
extern cvar_t* cl_greenfps;
|
||||
extern bind_t client_bind;
|
||||
extern cvar_t *cl_greenfps;
|
||||
extern qboolean server_loading;
|
||||
|
||||
const char *CvarGetForUI( const char *name, const char *defval );
|
||||
void UI_ClearState( void );
|
||||
void CL_BeginRegistration( void );
|
||||
void CL_EndRegistration(void);
|
||||
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);
|
||||
|
||||
//
|
||||
// menu
|
||||
//
|
||||
extern Menu *ui_pLoadingMenu;
|
||||
|
||||
void UI_ShowMenu( const char *name, qboolean bForce );
|
||||
void UI_HideMenu( const char *name, qboolean bForce );
|
||||
void UI_ForceMenuOff( bool force );
|
||||
void UI_PushMenu( const char *name );
|
||||
void UI_ForceMenu( const char *name );
|
||||
qboolean UI_BindActive( void );
|
||||
void UI_ActivateView3D( void );
|
||||
void UI_MenuEscape( const char *name );
|
||||
void UI_CreateScoreboard( void );
|
||||
qboolean UI_MenuActive( void );
|
||||
qboolean UI_MenuUp( void );
|
||||
void UI_DrawConnect( void );
|
||||
void UI_CreateDialog( const char *title, char *cvarname, const char *command, const char *cancelCommand, int width, int height, const char *shader, const char *okshader, const char *cancelshader );
|
||||
void UI_ToggleDMConsole( int iMode );
|
||||
void UI_ShowScoreboard_f( const char *pszMenuName );
|
||||
void UI_HideScoreboard_f( void );
|
||||
void UI_SetScoreBoardItem( int iItemNumber,
|
||||
const char *pszData1, const char *pszData2, const char *pszData3, const char *pszData4,
|
||||
const char *pszData5, const char *pszData6, const char *pszData7, const char *pszData8,
|
||||
const vec4_t pTextColor, const vec4_t pBackColor, qboolean bIsHeader );
|
||||
void UI_DeleteScoreBoardItems( int iMaxIndex );
|
||||
void UI_ShowMenu(const char *name, qboolean bForce);
|
||||
void UI_HideMenu(const char *name, qboolean bForce);
|
||||
void UI_ForceMenuOff(bool force);
|
||||
void UI_PushMenu(const char *name);
|
||||
void UI_ForceMenu(const char *name);
|
||||
qboolean UI_BindActive(void);
|
||||
void UI_SetReturnMenuToCurrent(void);
|
||||
void UI_ActivateView3D(void);
|
||||
void UI_MenuEscape(const char *name);
|
||||
void UI_CreateScoreboard(void);
|
||||
qboolean UI_MenuActive(void);
|
||||
qboolean UI_MenuUp(void);
|
||||
void UI_FocusMenuIfExists(void);
|
||||
void UI_DrawConnect(void);
|
||||
void UI_CreateDialog(
|
||||
const char *title,
|
||||
char *cvarname,
|
||||
const char *command,
|
||||
const char *cancelCommand,
|
||||
int width,
|
||||
int height,
|
||||
const char *shader,
|
||||
const char *okshader,
|
||||
const char *cancelshader
|
||||
);
|
||||
void UI_ToggleDMConsole(int iMode);
|
||||
void UI_ShowScoreboard_f(const char *pszMenuName);
|
||||
void UI_HideScoreboard_f(void);
|
||||
void UI_SetScoreBoardItem(
|
||||
int iItemNumber,
|
||||
const char *pszData1,
|
||||
const char *pszData2,
|
||||
const char *pszData3,
|
||||
const char *pszData4,
|
||||
const char *pszData5,
|
||||
const char *pszData6,
|
||||
const char *pszData7,
|
||||
const char *pszData8,
|
||||
const vec4_t pTextColor,
|
||||
const vec4_t pBackColor,
|
||||
qboolean bIsHeader
|
||||
);
|
||||
void UI_DeleteScoreBoardItems(int iMaxIndex);
|
||||
|
||||
//
|
||||
// ressources
|
||||
//
|
||||
void UI_BeginLoad( const char *pszMapName );
|
||||
void UI_EndLoad( void );
|
||||
void UI_AbortLoad( void );
|
||||
void UI_BeginLoadResource( void );
|
||||
void UI_EndLoadResource( void );
|
||||
void UI_EndLoadResource( const char *name );
|
||||
qboolean UI_IsResourceLoaded( const char *name );
|
||||
void UI_RegisterLoadResource( const char *name );
|
||||
void UI_ClearResource( void );
|
||||
void UI_LoadResource( const char *name );
|
||||
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);
|
||||
qboolean UI_IsResourceLoaded(const char *name);
|
||||
void UI_RegisterLoadResource(const char *name);
|
||||
void UI_ClearResource(void);
|
||||
void UI_LoadResource(const char *name);
|
||||
|
||||
//
|
||||
// windows
|
||||
//
|
||||
void UI_DeactiveFloatingWindows( void );
|
||||
void UI_DeactiveFloatingWindows(void);
|
||||
|
||||
//
|
||||
// console
|
||||
//
|
||||
void UI_OpenConsole( void );
|
||||
qboolean UI_ConsoleIsVisible( void );
|
||||
qboolean UI_ConsoleIsOpen( void );
|
||||
void UI_CloseConsole( void );
|
||||
void UI_ToggleConsole( void );
|
||||
void UI_OpenDMConsole( int iMode );
|
||||
void UI_CloseDMConsole( void );
|
||||
void UI_ToggleDMConsole( int iMode );
|
||||
void UI_OpenDeveloperConsole( void );
|
||||
void UI_CloseDeveloperConsole( void );
|
||||
void UI_PrintConsole(const char* msg);
|
||||
void UI_OpenConsole(void);
|
||||
qboolean UI_ConsoleIsVisible(void);
|
||||
qboolean UI_ConsoleIsOpen(void);
|
||||
void UI_CloseConsole(void);
|
||||
void UI_ToggleConsole(void);
|
||||
void UI_OpenDMConsole(int iMode);
|
||||
void UI_CloseDMConsole(void);
|
||||
void UI_ToggleDMConsole(int iMode);
|
||||
void UI_OpenDeveloperConsole(void);
|
||||
void UI_CloseDeveloperConsole(void);
|
||||
void UI_PrintConsole(const char *msg);
|
||||
|
||||
//
|
||||
// callbacks
|
||||
//
|
||||
void UI_Update( void );
|
||||
void UI_ServerLoaded( void );
|
||||
void UI_ResolutionChange( void );
|
||||
void UI_KeyEvent( int key, unsigned int time );
|
||||
void UI_CharEvent( int ch );
|
||||
|
||||
#endif /* __CL_UI_H__ */
|
||||
void UI_Update(void);
|
||||
void UI_ServerLoaded(void);
|
||||
void UI_ResolutionChange(void);
|
||||
void UI_KeyEvent(int key, unsigned int time);
|
||||
void UI_CharEvent(int ch);
|
||||
+430
-182
@@ -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,281 +24,529 @@ 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()
|
||||
{
|
||||
Clear();
|
||||
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() {}
|
||||
|
||||
bindlistener::bindlistener(bind_t *b)
|
||||
{
|
||||
bind = b;
|
||||
}
|
||||
|
||||
bindlistener::bindlistener
|
||||
(
|
||||
bind_t *b
|
||||
)
|
||||
|
||||
void bindlistener::Header(Event *ev)
|
||||
{
|
||||
bind = b;
|
||||
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));
|
||||
}
|
||||
}
|
||||
|
||||
bool bindlistener::Load
|
||||
(
|
||||
Script& script
|
||||
)
|
||||
|
||||
void bindlistener::ChangeSound(Event *ev)
|
||||
{
|
||||
// FIXME: stub
|
||||
return false;
|
||||
bind->changesound = ev->GetString(1);
|
||||
}
|
||||
|
||||
void bindlistener::Header
|
||||
(
|
||||
Event *ev
|
||||
)
|
||||
|
||||
void bindlistener::ActiveSound(Event *ev)
|
||||
{
|
||||
// FIXME: stub
|
||||
bind->activesound = ev->GetString(1);
|
||||
}
|
||||
|
||||
void bindlistener::Width
|
||||
(
|
||||
Event *ev
|
||||
)
|
||||
|
||||
void bindlistener::EnterSound(Event *ev)
|
||||
{
|
||||
// FIXME: stub
|
||||
bind->entersound = ev->GetString(1);
|
||||
}
|
||||
|
||||
void bindlistener::FillWidth
|
||||
(
|
||||
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::Height
|
||||
(
|
||||
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::CommandWidth
|
||||
(
|
||||
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::CommandHeight
|
||||
(
|
||||
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::PrimaryKeyWidth
|
||||
(
|
||||
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::PrimaryKeyHeight
|
||||
(
|
||||
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::AlternateKeyWidth
|
||||
(
|
||||
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::AlternateKeyHeight
|
||||
(
|
||||
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::NewItem
|
||||
(
|
||||
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::Align
|
||||
(
|
||||
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::TitleForegroundColor
|
||||
(
|
||||
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::TitleBackgroundColor
|
||||
(
|
||||
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::InactiveForegroundColor
|
||||
(
|
||||
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::InactiveBackgroundColor
|
||||
(
|
||||
Event *ev
|
||||
)
|
||||
|
||||
void bindlistener::Width(Event *ev)
|
||||
{
|
||||
// FIXME: stub
|
||||
bind->width = ev->GetInteger(1);
|
||||
}
|
||||
|
||||
void bindlistener::ActiveForegroundColor
|
||||
(
|
||||
Event *ev
|
||||
)
|
||||
|
||||
void bindlistener::Height(Event *ev)
|
||||
{
|
||||
// FIXME: stub
|
||||
bind->height = ev->GetInteger(1);
|
||||
}
|
||||
|
||||
void bindlistener::ActiveBackgroundColor
|
||||
(
|
||||
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::ActiveBorderColor
|
||||
(
|
||||
Event *ev
|
||||
)
|
||||
|
||||
void bindlistener::CommandWidth(Event *ev)
|
||||
{
|
||||
// FIXME: stub
|
||||
bind->commandwidth = ev->GetInteger(1);
|
||||
}
|
||||
|
||||
void bindlistener::HighlightForegroundColor
|
||||
(
|
||||
Event *ev
|
||||
)
|
||||
|
||||
void bindlistener::CommandHeight(Event *ev)
|
||||
{
|
||||
// FIXME: stub
|
||||
bind->commandheight = ev->GetInteger(1);
|
||||
}
|
||||
|
||||
void bindlistener::HighlightBackgroundColor
|
||||
(
|
||||
Event *ev
|
||||
)
|
||||
|
||||
void bindlistener::PrimaryKeyWidth(Event *ev)
|
||||
{
|
||||
// FIXME: stub
|
||||
bind->primarykeywidth = ev->GetInteger(1);
|
||||
}
|
||||
|
||||
void bindlistener::SelectForegroundColor
|
||||
(
|
||||
Event *ev
|
||||
)
|
||||
|
||||
void bindlistener::PrimaryKeyHeight(Event *ev)
|
||||
{
|
||||
// FIXME: stub
|
||||
bind->primarykeyheight = ev->GetInteger(1);
|
||||
}
|
||||
|
||||
void bindlistener::SelectBackgroundColor
|
||||
(
|
||||
Event *ev
|
||||
)
|
||||
|
||||
void bindlistener::AlternateKeyWidth(Event *ev)
|
||||
{
|
||||
// FIXME: stub
|
||||
bind->alternatekeywidth = ev->GetInteger(1);
|
||||
}
|
||||
|
||||
void bindlistener::ChangeSound
|
||||
(
|
||||
Event *ev
|
||||
)
|
||||
|
||||
void bindlistener::AlternateKeyHeight(Event *ev)
|
||||
{
|
||||
// FIXME: stub
|
||||
bind->alternatekeyheight = ev->GetInteger(1);
|
||||
}
|
||||
|
||||
void bindlistener::ActiveSound
|
||||
(
|
||||
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;
|
||||
}
|
||||
|
||||
void bindlistener::EnterSound
|
||||
(
|
||||
Event *ev
|
||||
)
|
||||
|
||||
bool CL_LoadBind(const char *filename, bind_t *bind)
|
||||
{
|
||||
// FIXME: stub
|
||||
Script script;
|
||||
|
||||
bind->Clear();
|
||||
|
||||
bindlistener listener(bind);
|
||||
script.LoadFile(filename);
|
||||
// Load the bind file
|
||||
return listener.Load(script);
|
||||
}
|
||||
+82
-88
@@ -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,115 +20,109 @@ 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;
|
||||
str name;
|
||||
str command;
|
||||
UIReggedMaterial *nameMaterial;
|
||||
|
||||
bind_item_t();
|
||||
bind_item_t( str name, str command, UIReggedMaterial *nameMaterial );
|
||||
bind_item_t();
|
||||
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;
|
||||
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;
|
||||
this->name = name;
|
||||
this->command = command;
|
||||
this->nameMaterial = nameMaterial;
|
||||
}
|
||||
|
||||
class bind_t {
|
||||
class bind_t
|
||||
{
|
||||
public:
|
||||
int width;
|
||||
int height;
|
||||
int fillwidth;
|
||||
int commandwidth;
|
||||
int commandheight;
|
||||
int primarykeywidth;
|
||||
int primarykeyheight;
|
||||
int alternatekeywidth;
|
||||
int alternatekeyheight;
|
||||
int align;
|
||||
UColor titlebgcolor;
|
||||
UColor titlefgcolor;
|
||||
UColor activefgcolor;
|
||||
UColor activebgcolor;
|
||||
UColor activebordercolor;
|
||||
UColor inactivefgcolor;
|
||||
UColor inactivebgcolor;
|
||||
UColor highlightfgcolor;
|
||||
UColor highlightbgcolor;
|
||||
UColor selectfgcolor;
|
||||
UColor selectbgcolor;
|
||||
str changesound;
|
||||
str activesound;
|
||||
str entersound;
|
||||
str headers[ 3 ];
|
||||
UIReggedMaterial *headermats[ 3 ];
|
||||
UIReggedMaterial *fillmaterial;
|
||||
Container<bind_item_t *> binds;
|
||||
int width;
|
||||
int height;
|
||||
int fillwidth;
|
||||
int commandwidth;
|
||||
int commandheight;
|
||||
int primarykeywidth;
|
||||
int primarykeyheight;
|
||||
int alternatekeywidth;
|
||||
int alternatekeyheight;
|
||||
int align;
|
||||
UColor titlebgcolor;
|
||||
UColor titlefgcolor;
|
||||
UColor activefgcolor;
|
||||
UColor activebgcolor;
|
||||
UColor activebordercolor;
|
||||
UColor inactivefgcolor;
|
||||
UColor inactivebgcolor;
|
||||
UColor highlightfgcolor;
|
||||
UColor highlightbgcolor;
|
||||
UColor selectfgcolor;
|
||||
UColor selectbgcolor;
|
||||
str changesound;
|
||||
str activesound;
|
||||
str entersound;
|
||||
str headers[3];
|
||||
UIReggedMaterial *headermats[3];
|
||||
UIReggedMaterial *fillmaterial;
|
||||
Container<bind_item_t *> binds;
|
||||
|
||||
public:
|
||||
bind_t();
|
||||
~bind_t();
|
||||
bind_t();
|
||||
~bind_t();
|
||||
|
||||
void Clear( void );
|
||||
void Clear(void);
|
||||
};
|
||||
|
||||
class bindlistener : public Listener {
|
||||
class bindlistener : public Listener
|
||||
{
|
||||
protected:
|
||||
bind_t *bind;
|
||||
bind_t *bind;
|
||||
|
||||
public:
|
||||
CLASS_PROTOTYPE( bindlistener );
|
||||
CLASS_PROTOTYPE(bindlistener);
|
||||
|
||||
public:
|
||||
bindlistener();
|
||||
bindlistener( bind_t *b );
|
||||
bindlistener();
|
||||
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);
|
||||
+40
-10
@@ -61,6 +61,7 @@ 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 )
|
||||
@@ -161,10 +162,13 @@ void UIDMBox::PostDecayEvent( void )
|
||||
}
|
||||
}
|
||||
|
||||
//
|
||||
// Bold as twice more decay
|
||||
//
|
||||
if (m_items[0].flags & DMBOX_ITEM_FLAG_BOLD) {
|
||||
if (m_items[0].flags & DMBOX_ITEM_FLAG_BOLD) {
|
||||
fDelayTime = iNumLines * 8.0;
|
||||
}
|
||||
//
|
||||
// Bold as twice more decay
|
||||
//
|
||||
else if (m_items[0].flags & DMBOX_ITEM_FLAG_DEATH) {
|
||||
fDelayTime = iNumLines * 6.0;
|
||||
}
|
||||
else {
|
||||
@@ -275,6 +279,28 @@ float UIDMBox::PrintWrap( UIFont *font, float x, float y, str text )
|
||||
|
||||
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);
|
||||
|
||||
@@ -285,7 +311,7 @@ void UIDMBox::Print( const char *text )
|
||||
{
|
||||
const char* text1 = text;
|
||||
|
||||
if (m_numitems > 4)
|
||||
if (m_numitems > 5)
|
||||
{
|
||||
//
|
||||
// Overwrite an item
|
||||
@@ -307,15 +333,19 @@ void UIDMBox::Print( const char *text )
|
||||
{
|
||||
m_items[m_numitems].color = ULightRed;
|
||||
m_items[m_numitems].font = m_fontbold;
|
||||
m_items[m_numitems].flags |= DMBOX_ITEM_FLAG_BOLD;
|
||||
m_items[m_numitems].flags |= DMBOX_ITEM_FLAG_DEATH;
|
||||
|
||||
text1 = text + 1;
|
||||
}
|
||||
else if (*text == MESSAGE_CHAT_GREEN)
|
||||
{
|
||||
m_items[m_numitems].color = UGreen;
|
||||
m_items[m_numitems].font = m_fontbold;
|
||||
m_items[m_numitems].flags |= DMBOX_ITEM_FLAG_BOLD;
|
||||
if (com_target_game->integer >= TG_MOHTA) {
|
||||
m_items[m_numitems].color = ULightGreen;
|
||||
} else {
|
||||
m_items[m_numitems].color = UGreen;
|
||||
}
|
||||
m_items[m_numitems].font = m_fontbold;
|
||||
m_items[m_numitems].flags |= DMBOX_ITEM_FLAG_DEATH;
|
||||
|
||||
text1 = text + 1;
|
||||
}
|
||||
@@ -377,7 +407,7 @@ void UIDMBox::Draw( void )
|
||||
float alpha;
|
||||
float alphaScale;
|
||||
|
||||
alphaScale = 0.8;
|
||||
alphaScale = 0.8f;
|
||||
HandleBoxMoving();
|
||||
|
||||
if (!m_numitems) {
|
||||
|
||||
@@ -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,10 +20,10 @@ 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 = 1u;
|
||||
static constexpr unsigned int DMBOX_ITEM_FLAG_BOLD = 2u;
|
||||
static constexpr unsigned int DMBOX_ITEM_FLAG_DEATH = 4u;
|
||||
|
||||
typedef enum { box_moving_out, box_moving_in, box_out, box_in } boxstate_t;
|
||||
|
||||
@@ -46,6 +46,8 @@ protected:
|
||||
int m_movespeed;
|
||||
int m_iBeginDecay;
|
||||
int m_iEndDecay;
|
||||
// Added in OPM
|
||||
bool m_drawoutline;
|
||||
|
||||
public:
|
||||
CLASS_PROTOTYPE( UIDMBox );
|
||||
@@ -74,5 +76,3 @@ public:
|
||||
void setRealShow( bool b );
|
||||
void Clear( void );
|
||||
};
|
||||
|
||||
#endif /* __CL_UIDMBOX_H__ */
|
||||
+211
-27
@@ -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((cls.glconfig.vidWidth - 400) / 2, (cls.glconfig.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 {
|
||||
UIFloatingWindow *window;
|
||||
UIListCtrl *listbox;
|
||||
str currentDirectory;
|
||||
str rootDirectory;
|
||||
str extension;
|
||||
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();
|
||||
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__ */
|
||||
@@ -61,6 +61,7 @@ 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 )
|
||||
@@ -272,6 +273,28 @@ float UIGMBox::PrintWrap( UIFont *font, float x, float y, str text )
|
||||
|
||||
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);
|
||||
|
||||
|
||||
@@ -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
|
||||
+197
-17
@@ -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)
|
||||
{
|
||||
// FIXME: stub
|
||||
return qfalse;
|
||||
if (!getCurrentItem()) {
|
||||
return;
|
||||
}
|
||||
|
||||
const serverInfo_t& serverInfo = cls.localServers[getCurrentItem() - 1];
|
||||
|
||||
UI_SetReturnMenuToCurrent();
|
||||
CL_Connect(NET_AdrToStringwPort(serverInfo.adr), netadrtype_t::NA_UNSPEC);
|
||||
}
|
||||
|
||||
void UILANGameClass::UpdateUIElement( void )
|
||||
qboolean UILANGameClass::KeyEvent(int key, unsigned int time)
|
||||
{
|
||||
// FIXME: stub
|
||||
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
|
||||
{
|
||||
return qfalse;
|
||||
}
|
||||
+14
-16
@@ -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;
|
||||
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();
|
||||
UILANGameClass();
|
||||
};
|
||||
|
||||
#endif /* __CL_UILANGAME_H__ */
|
||||
+319
-25
@@ -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,357 @@ 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
|
||||
return qfalse;
|
||||
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::UpdateUIElement( void )
|
||||
void UIFAKKLoadGameClass::LoadGame(Event *ev)
|
||||
{
|
||||
// FIXME: stub
|
||||
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::SetupFiles( void )
|
||||
void UIFAKKLoadGameClass::SaveGame(Event *ev)
|
||||
{
|
||||
// FIXME: stub
|
||||
Cbuf_ExecuteText(EXEC_NOW, "savegame");
|
||||
}
|
||||
|
||||
void UI_SetupFiles( void ) {
|
||||
// FIXME: stub
|
||||
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 UI_SetupFiles(void)
|
||||
{
|
||||
if (loadgame_ui && loadgame_ui->getShow()) {
|
||||
loadgame_ui->SetupFiles();
|
||||
}
|
||||
}
|
||||
|
||||
FAKKLoadGameItem::FAKKLoadGameItem(
|
||||
const str& missionName, const str& elapsedTime, const str& dateTime, const str& fileName
|
||||
)
|
||||
{
|
||||
strings[0] = missionName;
|
||||
strings[1] = elapsedTime;
|
||||
strings[2] = dateTime;
|
||||
strings[3] = fileName;
|
||||
}
|
||||
|
||||
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;
|
||||
|
||||
// hours
|
||||
numseconds = atol(strings[1]);
|
||||
itemstring += (numseconds / 3600);
|
||||
itemstring += ":";
|
||||
|
||||
// minutes
|
||||
numseconds_hours = numseconds % 3600;
|
||||
if (numseconds_hours / 60 <= 9) {
|
||||
itemstring += "0";
|
||||
}
|
||||
itemstring += (numseconds_hours / 60);
|
||||
itemstring += ":";
|
||||
|
||||
// seconds
|
||||
if (numseconds_hours / 60 <= 9) {
|
||||
itemstring += "0";
|
||||
}
|
||||
itemstring += (numseconds_hours % 60);
|
||||
}
|
||||
break;
|
||||
case 2:
|
||||
{
|
||||
time_t time;
|
||||
char buffer[2048];
|
||||
|
||||
time = atol(strings[2]);
|
||||
strftime(buffer, sizeof(buffer), "%a %b %d %H:%M:%S %Y", 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;
|
||||
}
|
||||
+18
-28
@@ -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,38 +20,28 @@ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
===========================================================================
|
||||
*/
|
||||
|
||||
#ifndef __CL_UILOADSAVE_H__
|
||||
#define __CL_UILOADSAVE_H__
|
||||
#pragma once
|
||||
|
||||
class UIFAKKLoadGameClass : public UIListCtrl {
|
||||
bool m_bRemovePending;
|
||||
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();
|
||||
~UIFAKKLoadGameClass();
|
||||
|
||||
void SetupFiles( void );
|
||||
void SetupFiles(void);
|
||||
};
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
void UI_SetupFiles( void );
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif
|
||||
@@ -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);
|
||||
}
|
||||
@@ -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;
|
||||
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);
|
||||
+138
-27
@@ -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(false);
|
||||
}
|
||||
|
||||
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(false);
|
||||
for (i = m_lines.NumObjects(); i > 0; i--) {
|
||||
if (-m_font->getHeight(false) >= aty) {
|
||||
break;
|
||||
}
|
||||
|
||||
m_font->Print(0, aty, m_lines.ObjectAt(i), -1, false);
|
||||
aty -= m_font->getHeight(false);
|
||||
}
|
||||
}
|
||||
|
||||
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();
|
||||
}
|
||||
}
|
||||
+23
-25
@@ -20,38 +20,36 @@ 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;
|
||||
bool m_reallyshown;
|
||||
bool m_boxmovingout;
|
||||
boxstate_t m_boxstate;
|
||||
int m_boxtime;
|
||||
int m_movespeed;
|
||||
Container<str> m_lines;
|
||||
int m_maxlines;
|
||||
bool m_reallyshown;
|
||||
bool m_boxmovingout;
|
||||
boxstate_t m_boxstate;
|
||||
int m_boxtime;
|
||||
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();
|
||||
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((cls.glconfig.vidWidth - 300) / 2, (cls.glconfig.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 {
|
||||
UIFloatingWindow *window;
|
||||
UIListCtrl *listbox;
|
||||
str currentDirectory;
|
||||
str rootDirectory;
|
||||
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();
|
||||
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((cls.glconfig.vidWidth - 400) / 2, (cls.glconfig.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 {
|
||||
UIFloatingWindow *window;
|
||||
UIListCtrl *listbox;
|
||||
str currentDirectory;
|
||||
str rootDirectory;
|
||||
qboolean m_bGermanModels;
|
||||
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();
|
||||
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);
|
||||
@@ -0,0 +1,170 @@
|
||||
/*
|
||||
===========================================================================
|
||||
Copyright (C) 2015 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_uiradar.cpp: draw teammates
|
||||
// since 2.0
|
||||
|
||||
#include "cl_uiradar.h"
|
||||
#include "client.h"
|
||||
|
||||
radarClient_t* g_radarClients;
|
||||
qhandle_t* g_radarShaders;
|
||||
int g_radarClientNum;
|
||||
|
||||
void CL_InitRadar(radarClient_t* radars, qhandle_t* shaders, int clientNum)
|
||||
{
|
||||
g_radarClients = radars;
|
||||
g_radarShaders = shaders;
|
||||
g_radarClientNum = clientNum;
|
||||
}
|
||||
|
||||
CLASS_DECLARATION( UIWidget, UIRadar, NULL )
|
||||
{
|
||||
{ NULL, NULL }
|
||||
};
|
||||
|
||||
UIRadar::UIRadar()
|
||||
{
|
||||
m_fRadius = 32.f;
|
||||
g_radarClients = NULL;
|
||||
}
|
||||
|
||||
UIRadar::~UIRadar()
|
||||
{
|
||||
}
|
||||
|
||||
void UIRadar::Draw(void)
|
||||
{
|
||||
radarClient_t* radar;
|
||||
float inv;
|
||||
float iconSize;
|
||||
int blinkTime, speakTime;
|
||||
vec2_t origin, axis;
|
||||
float halfScale;
|
||||
int i;
|
||||
|
||||
if (!g_radarClients) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (!cl.snap.valid) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (g_radarClientNum < 0) {
|
||||
return;
|
||||
}
|
||||
|
||||
cge->CG_UpdateRadar();
|
||||
|
||||
radar = &g_radarClients[g_radarClientNum];
|
||||
if (!radar->time) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (com_radar_range && com_radar_range->value > 0) {
|
||||
inv = 1.f / com_radar_range->value;
|
||||
} else {
|
||||
inv = 0;
|
||||
}
|
||||
|
||||
if (cl_radar_icon_size->value > 0) {
|
||||
iconSize = cl_radar_icon_size->value;
|
||||
} else {
|
||||
iconSize = 0;
|
||||
}
|
||||
|
||||
axis[0] = radar->axis[0];
|
||||
axis[1] = radar->axis[1];
|
||||
origin[0] = radar->origin[0];
|
||||
origin[1] = radar->origin[1];
|
||||
blinkTime = cl_radar_blink_time->value * 1000;
|
||||
speakTime = cl_radar_speak_time->value * 1000;
|
||||
|
||||
if (blinkTime < 100) blinkTime = 100;
|
||||
|
||||
halfScale = iconSize * 0.5f;
|
||||
|
||||
for (i = 0; i < MAX_CLIENTS; i++) {
|
||||
vec2_t delta;
|
||||
vec2_t newOrg;
|
||||
vec2_t screenOrg;
|
||||
float length;
|
||||
|
||||
radar = &g_radarClients[i];
|
||||
if (i == g_radarClientNum) {
|
||||
continue;
|
||||
}
|
||||
|
||||
if (!radar->time) {
|
||||
continue;
|
||||
}
|
||||
|
||||
if (cl.snap.serverTime - radar->time >= 5000) {
|
||||
continue;
|
||||
}
|
||||
|
||||
if (radar->lastSpeakTime) {
|
||||
int delta = cl.snap.serverTime - radar->lastSpeakTime;
|
||||
// make the icon blink
|
||||
if (delta >= 0 && delta < speakTime && ((delta / blinkTime) % 2) == 0) {
|
||||
continue;
|
||||
}
|
||||
|
||||
if (delta < 0 || delta >= speakTime) {
|
||||
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;
|
||||
newOrg[1] = (delta[0] * axis[1] + delta[1] * -axis[0]) * inv;
|
||||
length = VectorLength2D(newOrg);
|
||||
|
||||
if (length > 1)
|
||||
{
|
||||
newOrg[0] *= 1.f / length;
|
||||
newOrg[1] *= 1.f / length;
|
||||
}
|
||||
|
||||
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],
|
||||
screenOrg[1],
|
||||
m_vVirtualScale[0] * iconSize,
|
||||
m_vVirtualScale[1] * iconSize,
|
||||
0,
|
||||
0,
|
||||
1,
|
||||
1,
|
||||
radar->axis[0] * axis[0] - (-radar->axis[1] * axis[1]),
|
||||
radar->axis[0] * axis[1] + (-radar->axis[1] * axis[0]),
|
||||
g_radarShaders[radar->teamShader]
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
Loaded 100 of 855 files, more files were not shown because too many files have changed in this diff.
Show more
Reference in new issue
Block a user