mirror of
https://github.com/bearstonem/openmohaa-vr.git
synced 2026-10-23 05:00:27 +02:00
Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
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.
|
||||
@@ -2,9 +2,9 @@ name: Build
|
||||
|
||||
on:
|
||||
push:
|
||||
branches: [ "main" ]
|
||||
branches:
|
||||
- '**'
|
||||
pull_request:
|
||||
branches: [ "main" ]
|
||||
workflow_call:
|
||||
|
||||
concurrency:
|
||||
@@ -20,28 +20,18 @@ jobs:
|
||||
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: '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
|
||||
|
||||
# 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}}
|
||||
@@ -51,29 +41,46 @@ jobs:
|
||||
|
||||
- name: Install required packages
|
||||
run: |
|
||||
sudo apt update && sudo apt install -y flex bison
|
||||
sudo apt update && sudo apt install -y flex bison \
|
||||
libpulse-dev portaudio19-dev libasound2-dev libjack-dev libpipewire-0.3-dev qtbase5-dev libdbus-1-dev
|
||||
|
||||
- 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
|
||||
# Setup SDL
|
||||
- name: Set up SDL
|
||||
id: sdl
|
||||
uses: libsdl-org/setup-sdl@main
|
||||
with:
|
||||
version: sdl2-latest
|
||||
build-type: Release
|
||||
cmake-arguments: "-DCMAKE_C_COMPILER=clang
|
||||
-DCMAKE_CXX_COMPILER=clang++
|
||||
-DCMAKE_C_FLAGS=--target=${{ matrix.architecture.triple }}
|
||||
-DCMAKE_CXX_FLAGS=--target=${{ matrix.architecture.triple }}"
|
||||
|
||||
# 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.23.1'
|
||||
|
||||
- name: Configure and install soft-oal
|
||||
working-directory: ${{github.workspace}}/thirdparties/soft-oal
|
||||
run: |
|
||||
cmake -B ./build -DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}} \
|
||||
-DCMAKE_INSTALL_PREFIX='${{github.workspace}}/thirdparties/soft-oal/install' \
|
||||
-DCMAKE_C_COMPILER=${{ matrix.architecture.triple }}-gcc-12 \
|
||||
-DCMAKE_CXX_COMPILER=${{ matrix.architecture.triple }}-g++-12
|
||||
cmake --build ./build --config ${{env.BUILD_TYPE}}
|
||||
cmake --install ./build --config ${{env.BUILD_TYPE}}
|
||||
|
||||
- uses: actions/checkout@v4
|
||||
with:
|
||||
path: 'source'
|
||||
|
||||
@@ -86,21 +93,19 @@ jobs:
|
||||
-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
|
||||
-DOPENAL_LIBRARY='${{github.workspace}}/thirdparties/soft-oal' \
|
||||
-DOPENAL_INCLUDE_DIR='${{github.workspace}}/thirdparties/soft-oal/include' \
|
||||
-DGIT_REVISION_BUILD_NUMBER=${{ github.run_number }}" >> $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
|
||||
cmake -B ./build ${{ env.CMAKE_PARAM }} ./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}}
|
||||
@@ -109,18 +114,17 @@ jobs:
|
||||
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'
|
||||
# Create hard-link and copy symbolic links
|
||||
cp -l ${{steps.sdl.outputs.prefix}}/lib/libSDL2-2.0.so.0 '${{github.workspace}}/install/'
|
||||
cp -l ${{github.workspace}}/thirdparties/soft-oal/install/lib/libopenal.so.1 '${{github.workspace}}/install/'
|
||||
|
||||
- uses: actions/upload-artifact@v3
|
||||
- uses: actions/upload-artifact@v4
|
||||
with:
|
||||
name: out-linux-${{matrix.architecture.name}}
|
||||
if-no-files-found: error
|
||||
@@ -145,20 +149,56 @@ jobs:
|
||||
run: |
|
||||
echo "CMAKE_BUILD_PARALLEL_LEVEL=$((Get-CimInstance Win32_ComputerSystem).NumberOfLogicalProcessors * 16)" >> $GITHUB_ENV
|
||||
|
||||
- name: Install required packages
|
||||
# Setup SDL
|
||||
- name: Set up SDL
|
||||
id: sdl
|
||||
uses: libsdl-org/setup-sdl@main
|
||||
with:
|
||||
version: sdl2-latest
|
||||
build-type: Release
|
||||
cmake-arguments: "-A ${{ matrix.architecture.config }}"
|
||||
|
||||
- name: Install Flex/Bison
|
||||
working-directory: ${{github.workspace}}
|
||||
run: |
|
||||
mkdir thirdparties && cd thirdparties
|
||||
git clone --depth 1 --single-branch --branch 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
|
||||
# soft-oal setup
|
||||
- name: Checkout soft-oal
|
||||
uses: actions/checkout@v4
|
||||
with:
|
||||
repository: 'kcat/openal-soft'
|
||||
path: 'thirdparties/soft-oal'
|
||||
ref: '1.23.1'
|
||||
|
||||
# soft-oal build
|
||||
# Statically link the CRT runtime into OAL as a workaround to prevent crashes
|
||||
- name: Configure and install soft-oal
|
||||
working-directory: ${{github.workspace}}/thirdparties/soft-oal
|
||||
run: |
|
||||
cmake -B ./build -A ${{ matrix.architecture.config }} `
|
||||
-DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}} `
|
||||
-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 ${{env.BUILD_TYPE}}
|
||||
cmake --install ./build --config ${{env.BUILD_TYPE}}
|
||||
# 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' }
|
||||
|
||||
- uses: actions/checkout@v4
|
||||
with:
|
||||
path: 'source'
|
||||
|
||||
@@ -168,25 +208,21 @@ jobs:
|
||||
--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
|
||||
-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'".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
|
||||
cmake -B ./build ${{ env.CMAKE_PARAM }} ./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}}
|
||||
@@ -195,18 +231,16 @@ jobs:
|
||||
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"
|
||||
Copy-Item '${{steps.sdl.outputs.prefix}}/bin/*.dll' -Destination '${{github.workspace}}/install'
|
||||
Copy-Item '${{github.workspace}}/thirdparties/soft-oal/install/bin/*.dll' -Destination '${{github.workspace}}/install'
|
||||
|
||||
- uses: actions/upload-artifact@v3
|
||||
- uses: actions/upload-artifact@v4
|
||||
with:
|
||||
name: out-windows-${{matrix.architecture.name}}
|
||||
if-no-files-found: error
|
||||
@@ -214,7 +248,7 @@ jobs:
|
||||
${{github.workspace}}/install
|
||||
!${{github.workspace}}/install/**/*.pdb
|
||||
|
||||
- uses: actions/upload-artifact@v3
|
||||
- uses: actions/upload-artifact@v4
|
||||
with:
|
||||
name: out-windows-${{matrix.architecture.name}}-pdb
|
||||
if-no-files-found: error
|
||||
|
||||
@@ -41,11 +41,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 +66,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 +79,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}}"
|
||||
@@ -18,12 +18,18 @@ jobs:
|
||||
|
||||
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',
|
||||
@@ -40,7 +46,7 @@ jobs:
|
||||
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,7 +56,7 @@ 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}}'
|
||||
prerelease: ${{env.RELEASE_IS_PRERELEASE}}
|
||||
|
||||
+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.
|
||||
+36
-33
@@ -5,39 +5,50 @@ 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)
|
||||
message(SEND_ERROR "TARGET_GAME_TYPE is now unsupported, it is now done at runtime.")
|
||||
endif()
|
||||
|
||||
set(TARGET_BASE_GAME "main${TARGET_BASE_SUFFIX}")
|
||||
|
||||
set(TARGET_BASE_GAME "./")
|
||||
set(CMAKE_DEBUG_POSTFIX "-dbg")
|
||||
|
||||
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()
|
||||
|
||||
if(CMAKE_CXX_COMPILER_ID STREQUAL "Clang" 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()
|
||||
|
||||
if(CMAKE_CXX_COMPILER_ID STREQUAL "Clang")
|
||||
# Ignore warnings for code like 'assert("Assert string")'
|
||||
add_compile_options(-Wno-pointer-bool-conversion)
|
||||
endif()
|
||||
|
||||
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}")
|
||||
message(STATUS "Architecture detected: ${TARGET_ARCH}, suffix set to ${TARGET_ARCH_SUFFIX}.")
|
||||
|
||||
IF(WIN32)
|
||||
set(TARGET_PLATFORM_PREFIX "")
|
||||
@@ -50,16 +61,14 @@ ELSE()
|
||||
ENDIF()
|
||||
|
||||
IF(CMAKE_BUILD_TYPE MATCHES Debug)
|
||||
set(TARGET_CONFIG_SUFFIX "-dbg")
|
||||
add_definitions(-D_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 "")
|
||||
ENDIF()
|
||||
|
||||
# Common stuff
|
||||
@@ -81,9 +90,11 @@ 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
|
||||
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_BASE_SUFFIX}${TARGET_ARCH_SUFFIX}")
|
||||
set_target_properties(omohaaded PROPERTIES DEBUG_POSTFIX ${CMAKE_DEBUG_POSTFIX})
|
||||
|
||||
if (MSVC)
|
||||
target_link_options(omohaaded PRIVATE "/MANIFEST:NO")
|
||||
@@ -92,12 +103,12 @@ 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")
|
||||
@@ -113,18 +124,10 @@ if (WITH_CLIENT)
|
||||
|
||||
### 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}")
|
||||
set_target_properties(openmohaa PROPERTIES OUTPUT_NAME "openmohaa${TARGET_BASE_SUFFIX}${TARGET_ARCH_SUFFIX}")
|
||||
set_target_properties(openmohaa PROPERTIES DEBUG_POSTFIX ${CMAKE_DEBUG_POSTFIX})
|
||||
|
||||
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()
|
||||
endif()
|
||||
|
||||
if (MSVC)
|
||||
target_link_options(openmohaa PRIVATE "/MANIFEST:NO")
|
||||
|
||||
@@ -1,111 +1,62 @@
|
||||
# OpenMoHAA
|
||||
|
||||
 [](https://github.com/openmoh/openmohaa/releases) [](https://github.com/openmoh/openmohaa/releases)
|
||||
|
||||
 
|
||||
|
||||

|
||||
|
||||
|
||||
```
|
||||
/ _ \ _ __ ___ _ __ | \/ |/ _ \| | | | / \ / \
|
||||
| | | | '_ \ / _ \ '_ \| |\/| | | | | |_| | / _ \ / _ \
|
||||
| |_| | |_) | __/ | | | | | | |_| | _ |/ ___ \ / ___ \
|
||||
\___/| .__/ \___|_| |_|_| |_|\___/|_| |_/_/ \_\/_/ \_\
|
||||
|_|
|
||||
|
||||
```
|
||||
|
||||
## Intro
|
||||
|
||||
## Discord
|
||||
The main goal of OpenMoHAA is to ensure the future and continuity of **Medal of Honor: Allied Assault**. It has always been a dream in the community to provide patches and security fixes for the game. Thanks to the ioquake3 project, F.A.K.K SDK and other quality tools, OpenMoHAA has already reached more than half of its goal: to create an open-source version of MoH:AA (based on version 2.40) that is fully compatible with the original game (in terms of protocol, assets, and scripts).
|
||||
|
||||
[](https://discord.gg/NYtH58R)
|
||||
## Getting started
|
||||
|
||||
## Current State
|
||||
- [Installing OpenMoHAA](docs/getting_started_installation.md)
|
||||
- [Running OpenMoHAA and using expansion assets](docs/getting_started_running.md)
|
||||
|
||||
[](https://github.com/openmoh/openmohaa/actions/workflows/build-cmake.yml)
|
||||
## Current state
|
||||
|
||||
OpenMoHAA is still in its early days.
|
||||
### Single-player
|
||||
|
||||
### Server
|
||||
The entire single-player campaign can be played from start to end. There may be occasional bugs though; if you encounter any, please create a new [GitHub issue](https://github.com/openmoh/openmohaa/issues) describing them.
|
||||
|
||||
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.
|
||||
### Multiplayer
|
||||
|
||||
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.
|
||||
The Multiplayer part is almost fully stable.
|
||||
|
||||
### Client
|
||||
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.
|
||||
|
||||
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.
|
||||
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.
|
||||
|
||||
Here is the current working state for each part of the engine:
|
||||
## Features
|
||||
|
||||
| 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) |
|
||||
|
||||
NOTE: Both client and server version can be compiled to target **Medal of Honor: Spearhead** and **Medal of Honor: Breakthrough**.
|
||||
|
||||
## Running
|
||||
|
||||
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.
|
||||
- [What's working](docs/features_implementation.md)
|
||||
- [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 +64,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 +88,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 ---
|
||||
+34
-18
@@ -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
|
||||
|
||||
")
|
||||
|
||||
@@ -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,23 +18,23 @@ 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 OUTPUT_NAME "cgame${TARGET_ARCH_SUFFIX}")
|
||||
set_target_properties(cgame PROPERTIES RUNTIME_OUTPUT_DIRECTORY "${TARGET_BASE_GAME}")
|
||||
|
||||
INSTALL(
|
||||
TARGETS cgame
|
||||
DESTINATION "${TARGET_BASE_GAME}"
|
||||
ARCHIVE EXCLUDE_FROM_ALL
|
||||
LIBRARY DESTINATION "${TARGET_BASE_GAME}"
|
||||
RUNTIME DESTINATION "${TARGET_BASE_GAME}"
|
||||
)
|
||||
|
||||
if(MSVC)
|
||||
|
||||
@@ -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
+2880
-2413
File diff suppressed because it is too large.
Load diff
+573
-492
File diff suppressed because it is too large.
Load diff
+115
-119
@@ -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);
|
||||
@@ -179,19 +175,15 @@ static void CG_PrintSurfaceType(int iSurfType)
|
||||
|
||||
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 +204,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)
|
||||
{
|
||||
if (pShader) {
|
||||
strcpy(name, "editspecificshader ");
|
||||
strcat(name, pShader->shader);
|
||||
strcat(name, "\n");
|
||||
cgi.AddCommand(name);
|
||||
}
|
||||
else
|
||||
{
|
||||
} else {
|
||||
cgi.Printf("No surface selected\n");
|
||||
}
|
||||
}
|
||||
@@ -348,61 +335,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 +411,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 +471,7 @@ void CG_PushMenuTeamSelect_f(void)
|
||||
default:
|
||||
cgi.Cmd_Execute(EXEC_NOW, "pushmenu SelectTeam\n");
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void CG_PushMenuWeaponSelect_f(void)
|
||||
@@ -489,7 +485,7 @@ void CG_PushMenuWeaponSelect_f(void)
|
||||
|
||||
void CG_UseWeaponClass_f(void)
|
||||
{
|
||||
const char* cmd;
|
||||
const char *cmd;
|
||||
|
||||
cmd = cgi.Argv(1);
|
||||
|
||||
@@ -520,37 +516,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 +558,7 @@ int CG_WeaponCommandButtonBits(void)
|
||||
return 0;
|
||||
}
|
||||
|
||||
iShiftedWeaponCommand = cg.iWeaponCommand << 7;
|
||||
iShiftedWeaponCommand = cg.iWeaponCommand << 7;
|
||||
|
||||
cg.iWeaponCommandSend++;
|
||||
if (cg.iWeaponCommandSend > 2) {
|
||||
|
||||
+717
-604
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
+809
-749
File diff suppressed because it is too large.
Load diff
+520
-449
File diff suppressed because it is too large.
Load diff
+958
-263
File diff suppressed because it is too large.
Load diff
+687
-523
File diff suppressed because it is too large.
Load diff
+45
-56
@@ -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,7 +49,7 @@ 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
|
||||
}
|
||||
@@ -58,16 +58,17 @@ 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_SERVER_CREATED | 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;
|
||||
|
||||
+1667
-786
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) {}
|
||||
+179
-109
@@ -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,43 @@ 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 : "");
|
||||
sprintf(
|
||||
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 +212,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 +238,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 +253,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 +275,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 +301,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 +317,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 +340,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);
|
||||
@@ -294,11 +350,8 @@ static void CG_InterpolatePlayerStateCamera(void)
|
||||
}
|
||||
|
||||
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 +365,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 +382,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 +402,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 +441,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 +452,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 +466,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 +483,24 @@ 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;
|
||||
|
||||
cg_pmove.leanMax = 40.f;
|
||||
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;
|
||||
@@ -448,24 +517,22 @@ void CG_PredictPlayerState(void)
|
||||
// be ahead of everything else anyway
|
||||
if (cg.nextSnap && !cg.nextFrameTeleport && !cg.thisFrameTeleport) {
|
||||
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 +559,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 +573,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 +598,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 +608,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];
|
||||
|
||||
+423
-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,352 @@ 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);
|
||||
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);
|
||||
|
||||
// ==================== 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 +447,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)(
|
||||
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);
|
||||
|
||||
// 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
|
||||
+446
-508
File diff suppressed because it is too large.
Load diff
+182
-130
@@ -24,12 +24,15 @@ 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 const char *IsWeaponAllowed(int dmFlags, int flags)
|
||||
{
|
||||
return (dmFlags & flags) ? "0" : "1";
|
||||
}
|
||||
|
||||
static qboolean QueryLandminesAllowed2(const char* mapname, int dmflags) {
|
||||
static qboolean QueryLandminesAllowed2(const char *mapname, int dmflags)
|
||||
{
|
||||
if (dmflags & DF_WEAPON_NO_LANDMINE) {
|
||||
return qfalse;
|
||||
}
|
||||
@@ -38,43 +41,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,25 +108,26 @@ 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"));
|
||||
@@ -115,12 +137,23 @@ void CG_ParseServerinfo(void)
|
||||
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");
|
||||
|
||||
@@ -142,22 +175,16 @@ void CG_ParseServerinfo(void)
|
||||
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 +197,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 +242,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 +284,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 +296,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,52 +310,47 @@ 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));
|
||||
cgi.Cmd_Stuff("\n");
|
||||
@@ -358,6 +377,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 +412,20 @@ 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);
|
||||
}
|
||||
}
|
||||
}
|
||||
+69
-64
@@ -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,7 +66,7 @@ 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
|
||||
@@ -71,7 +75,7 @@ static void CG_ResetEntity(centity_t* cent)
|
||||
// reset the animation for the entities
|
||||
if (tiki && tiki->a->bIsCharacter) {
|
||||
for (i = 0; i < MAX_FRAMEINFOS; i++) {
|
||||
cent->animLast[i] = cent->currentState.frameInfo[i].index;
|
||||
cent->animLast[i] = cent->currentState.frameInfo[i].index;
|
||||
cent->animLastTimes[i] = cent->currentState.frameInfo[i].time;
|
||||
if (cent->currentState.frameInfo[i].weight) {
|
||||
cent->animLastWeight |= 1 << i;
|
||||
@@ -89,8 +93,8 @@ static void CG_ResetEntity(centity_t* cent)
|
||||
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 +109,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 +138,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 +153,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 +179,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 +192,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 +207,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 +228,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 +268,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 +280,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 +314,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 +340,15 @@ 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.Error(
|
||||
ERR_DROP, "CG_ReadNextSnapshot: way out of range, %i > %i", cg.latestSnapshotNum, cgs.processedSnapshotNum
|
||||
);
|
||||
}
|
||||
|
||||
while (cgs.processedSnapshotNum < cg.latestSnapshotNum) {
|
||||
@@ -394,17 +406,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 +456,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 +465,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 +483,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
|
||||
);
|
||||
}
|
||||
}
|
||||
+741
-598
File diff suppressed because it is too large.
Load diff
+133
-16
@@ -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,40 @@ 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 {
|
||||
class ClientSpecialEffectsManager : public Listener
|
||||
{
|
||||
specialeffect_t m_effects[99];
|
||||
qboolean m_bEffectsLoaded;
|
||||
int m_iNumPendingEvents;
|
||||
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();
|
||||
}
|
||||
+488
-450
File diff suppressed because it is too large.
Load diff
+276
-274
@@ -26,103 +26,103 @@ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
#include "cg_commands.h"
|
||||
#include "cg_specialfx.h"
|
||||
|
||||
cvar_t* cg_te_alpha;
|
||||
cvar_t* cg_te_dietouch;
|
||||
cvar_t* cg_te_bouncefactor;
|
||||
cvar_t* cg_te_scale;
|
||||
cvar_t* cg_te_scalemin;
|
||||
cvar_t* cg_te_scalemax;
|
||||
cvar_t* cg_te_model;
|
||||
cvar_t* cg_te_life;
|
||||
cvar_t* cg_te_color_r;
|
||||
cvar_t* cg_te_color_g;
|
||||
cvar_t* cg_te_color_b;
|
||||
cvar_t* cg_te_accel_x;
|
||||
cvar_t* cg_te_accel_y;
|
||||
cvar_t* cg_te_accel_z;
|
||||
cvar_t* cg_te_count;
|
||||
cvar_t* cg_te_fade;
|
||||
cvar_t* cg_te_fadedelay;
|
||||
cvar_t* cg_te_fadein;
|
||||
cvar_t* cg_te_spawnrate;
|
||||
cvar_t* cg_te_offsbase_x;
|
||||
cvar_t* cg_te_offsbase_y;
|
||||
cvar_t* cg_te_offsbase_z;
|
||||
cvar_t* cg_te_offsamp_x;
|
||||
cvar_t* cg_te_offsamp_y;
|
||||
cvar_t* cg_te_offsamp_z;
|
||||
cvar_t* cg_te_scalerate;
|
||||
cvar_t* cg_te_circle;
|
||||
cvar_t* cg_te_sphere;
|
||||
cvar_t* cg_te_insphere;
|
||||
cvar_t* cg_te_radius;
|
||||
cvar_t* cg_te_align;
|
||||
cvar_t* cg_te_flickeralpha;
|
||||
cvar_t* cg_te_collision;
|
||||
cvar_t* cg_te_randomroll;
|
||||
cvar_t* cg_te_anglesbase_p;
|
||||
cvar_t* cg_te_anglesbase_y;
|
||||
cvar_t* cg_te_anglesbase_r;
|
||||
cvar_t* cg_te_anglesamp_p;
|
||||
cvar_t* cg_te_anglesamp_y;
|
||||
cvar_t* cg_te_anglesamp_r;
|
||||
cvar_t* cg_te_forwardvel;
|
||||
cvar_t* cg_te_randvelbase_x;
|
||||
cvar_t* cg_te_randvelbase_y;
|
||||
cvar_t* cg_te_randvelbase_z;
|
||||
cvar_t* cg_te_randvelamp_x;
|
||||
cvar_t* cg_te_randvelamp_y;
|
||||
cvar_t* cg_te_randvelamp_z;
|
||||
cvar_t* cg_te_clampvelmin_x;
|
||||
cvar_t* cg_te_clampvelmax_x;
|
||||
cvar_t* cg_te_clampvelmin_y;
|
||||
cvar_t* cg_te_clampvelmax_y;
|
||||
cvar_t* cg_te_clampvelmin_z;
|
||||
cvar_t* cg_te_clampvelmax_z;
|
||||
cvar_t* cg_te_clampvelaxis;
|
||||
cvar_t* cg_te_volumetric;
|
||||
cvar_t* cg_te_randaxis;
|
||||
cvar_t* cg_te_axisoffsbase_x;
|
||||
cvar_t* cg_te_axisoffsbase_y;
|
||||
cvar_t* cg_te_axisoffsbase_z;
|
||||
cvar_t* cg_te_axisoffsamp_x;
|
||||
cvar_t* cg_te_axisoffsamp_y;
|
||||
cvar_t* cg_te_axisoffsamp_z;
|
||||
cvar_t* cg_te_swarm_freq;
|
||||
cvar_t* cg_te_swarm_maxspeed;
|
||||
cvar_t* cg_te_swarm_delta;
|
||||
cvar_t* cg_te_avelbase_p;
|
||||
cvar_t* cg_te_avelbase_y;
|
||||
cvar_t* cg_te_avelbase_r;
|
||||
cvar_t* cg_te_avelamp_p;
|
||||
cvar_t* cg_te_avelamp_y;
|
||||
cvar_t* cg_te_avelamp_r;
|
||||
cvar_t* cg_te_radial_scale;
|
||||
cvar_t* cg_te_radial_min;
|
||||
cvar_t* cg_te_radial_max;
|
||||
cvar_t* cg_te_friction;
|
||||
cvar_t* cg_te_varycolor;
|
||||
cvar_t* cg_te_spritegridlighting;
|
||||
cvar_t* cg_te_cone_height;
|
||||
cvar_t* cg_te_alignstretch_scale;
|
||||
cvar_t* cg_te_spawnrange_a;
|
||||
cvar_t* cg_te_spawnrange_b;
|
||||
cvar_t* cg_te_command_time;
|
||||
cvar_t* cg_te_singlelinecommand;
|
||||
cvar_t* cg_te_tag;
|
||||
cvar_t* cg_te_xangles;
|
||||
cvar_t* cg_te_yangles;
|
||||
cvar_t* cg_te_zangles;
|
||||
cvar_t *cg_te_alpha;
|
||||
cvar_t *cg_te_dietouch;
|
||||
cvar_t *cg_te_bouncefactor;
|
||||
cvar_t *cg_te_scale;
|
||||
cvar_t *cg_te_scalemin;
|
||||
cvar_t *cg_te_scalemax;
|
||||
cvar_t *cg_te_model;
|
||||
cvar_t *cg_te_life;
|
||||
cvar_t *cg_te_color_r;
|
||||
cvar_t *cg_te_color_g;
|
||||
cvar_t *cg_te_color_b;
|
||||
cvar_t *cg_te_accel_x;
|
||||
cvar_t *cg_te_accel_y;
|
||||
cvar_t *cg_te_accel_z;
|
||||
cvar_t *cg_te_count;
|
||||
cvar_t *cg_te_fade;
|
||||
cvar_t *cg_te_fadedelay;
|
||||
cvar_t *cg_te_fadein;
|
||||
cvar_t *cg_te_spawnrate;
|
||||
cvar_t *cg_te_offsbase_x;
|
||||
cvar_t *cg_te_offsbase_y;
|
||||
cvar_t *cg_te_offsbase_z;
|
||||
cvar_t *cg_te_offsamp_x;
|
||||
cvar_t *cg_te_offsamp_y;
|
||||
cvar_t *cg_te_offsamp_z;
|
||||
cvar_t *cg_te_scalerate;
|
||||
cvar_t *cg_te_circle;
|
||||
cvar_t *cg_te_sphere;
|
||||
cvar_t *cg_te_insphere;
|
||||
cvar_t *cg_te_radius;
|
||||
cvar_t *cg_te_align;
|
||||
cvar_t *cg_te_flickeralpha;
|
||||
cvar_t *cg_te_collision;
|
||||
cvar_t *cg_te_randomroll;
|
||||
cvar_t *cg_te_anglesbase_p;
|
||||
cvar_t *cg_te_anglesbase_y;
|
||||
cvar_t *cg_te_anglesbase_r;
|
||||
cvar_t *cg_te_anglesamp_p;
|
||||
cvar_t *cg_te_anglesamp_y;
|
||||
cvar_t *cg_te_anglesamp_r;
|
||||
cvar_t *cg_te_forwardvel;
|
||||
cvar_t *cg_te_randvelbase_x;
|
||||
cvar_t *cg_te_randvelbase_y;
|
||||
cvar_t *cg_te_randvelbase_z;
|
||||
cvar_t *cg_te_randvelamp_x;
|
||||
cvar_t *cg_te_randvelamp_y;
|
||||
cvar_t *cg_te_randvelamp_z;
|
||||
cvar_t *cg_te_clampvelmin_x;
|
||||
cvar_t *cg_te_clampvelmax_x;
|
||||
cvar_t *cg_te_clampvelmin_y;
|
||||
cvar_t *cg_te_clampvelmax_y;
|
||||
cvar_t *cg_te_clampvelmin_z;
|
||||
cvar_t *cg_te_clampvelmax_z;
|
||||
cvar_t *cg_te_clampvelaxis;
|
||||
cvar_t *cg_te_volumetric;
|
||||
cvar_t *cg_te_randaxis;
|
||||
cvar_t *cg_te_axisoffsbase_x;
|
||||
cvar_t *cg_te_axisoffsbase_y;
|
||||
cvar_t *cg_te_axisoffsbase_z;
|
||||
cvar_t *cg_te_axisoffsamp_x;
|
||||
cvar_t *cg_te_axisoffsamp_y;
|
||||
cvar_t *cg_te_axisoffsamp_z;
|
||||
cvar_t *cg_te_swarm_freq;
|
||||
cvar_t *cg_te_swarm_maxspeed;
|
||||
cvar_t *cg_te_swarm_delta;
|
||||
cvar_t *cg_te_avelbase_p;
|
||||
cvar_t *cg_te_avelbase_y;
|
||||
cvar_t *cg_te_avelbase_r;
|
||||
cvar_t *cg_te_avelamp_p;
|
||||
cvar_t *cg_te_avelamp_y;
|
||||
cvar_t *cg_te_avelamp_r;
|
||||
cvar_t *cg_te_radial_scale;
|
||||
cvar_t *cg_te_radial_min;
|
||||
cvar_t *cg_te_radial_max;
|
||||
cvar_t *cg_te_friction;
|
||||
cvar_t *cg_te_varycolor;
|
||||
cvar_t *cg_te_spritegridlighting;
|
||||
cvar_t *cg_te_cone_height;
|
||||
cvar_t *cg_te_alignstretch_scale;
|
||||
cvar_t *cg_te_spawnrange_a;
|
||||
cvar_t *cg_te_spawnrange_b;
|
||||
cvar_t *cg_te_command_time;
|
||||
cvar_t *cg_te_singlelinecommand;
|
||||
cvar_t *cg_te_tag;
|
||||
cvar_t *cg_te_xangles;
|
||||
cvar_t *cg_te_yangles;
|
||||
cvar_t *cg_te_zangles;
|
||||
class specialeffect_t;
|
||||
refEntity_t te_refEnt;
|
||||
cvar_t* cg_te_emittermodel;
|
||||
cvar_t* cg_te_mode;
|
||||
cvar_t* cg_te_mode_name;
|
||||
cvar_t* cg_te_currCommand;
|
||||
cvar_t* cg_te_numCommands;
|
||||
float te_vEmitterOrigin[3];
|
||||
int te_iNumCommands;
|
||||
int te_iCurrCommand;
|
||||
refEntity_t te_refEnt;
|
||||
cvar_t *cg_te_emittermodel;
|
||||
cvar_t *cg_te_mode;
|
||||
cvar_t *cg_te_mode_name;
|
||||
cvar_t *cg_te_currCommand;
|
||||
cvar_t *cg_te_numCommands;
|
||||
float te_vEmitterOrigin[3];
|
||||
int te_iNumCommands;
|
||||
int te_iCurrCommand;
|
||||
specialeffect_t *pTesteffect;
|
||||
|
||||
#define MAX_TESTEMITTERS_SAVE 32
|
||||
@@ -212,94 +212,94 @@ str cg_te_command_timeG[MAX_TESTEMITTERS_SAVE];
|
||||
str cg_te_singlelinecommandG[MAX_TESTEMITTERS_SAVE];
|
||||
str cg_te_tagG[MAX_TESTEMITTERS_SAVE];
|
||||
|
||||
spawnthing_t* testspawnthing = NULL;
|
||||
spawnthing_t *testspawnthing = NULL;
|
||||
|
||||
void CG_SaveEffectCommandCvars(int iCommand)
|
||||
{
|
||||
cg_te_alphaG[iCommand] = cg_te_alpha->string;
|
||||
cg_te_dietouchG[iCommand] = cg_te_dietouch->string;
|
||||
cg_te_bouncefactorG[iCommand] = cg_te_bouncefactor->string;
|
||||
cg_te_scaleG[iCommand] = cg_te_scale->string;
|
||||
cg_te_scaleminG[iCommand] = cg_te_scalemin->string;
|
||||
cg_te_scalemaxG[iCommand] = cg_te_scalemax->string;
|
||||
cg_te_modelG[iCommand] = cg_te_model->string;
|
||||
cg_te_lifeG[iCommand] = cg_te_life->string;
|
||||
cg_te_color_rG[iCommand] = cg_te_color_r->string;
|
||||
cg_te_color_gG[iCommand] = cg_te_color_g->string;
|
||||
cg_te_color_bG[iCommand] = cg_te_color_b->string;
|
||||
cg_te_accel_xG[iCommand] = cg_te_accel_x->string;
|
||||
cg_te_accel_yG[iCommand] = cg_te_accel_y->string;
|
||||
cg_te_accel_zG[iCommand] = cg_te_accel_z->string;
|
||||
cg_te_countG[iCommand] = cg_te_count->string;
|
||||
cg_te_fadeG[iCommand] = cg_te_fade->string;
|
||||
cg_te_fadedelayG[iCommand] = cg_te_fadedelay->string;
|
||||
cg_te_fadeinG[iCommand] = cg_te_fadein->string;
|
||||
cg_te_spawnrateG[iCommand] = cg_te_spawnrate->string;
|
||||
cg_te_offsbase_xG[iCommand] = cg_te_offsbase_x->string;
|
||||
cg_te_offsbase_yG[iCommand] = cg_te_offsbase_y->string;
|
||||
cg_te_offsbase_zG[iCommand] = cg_te_offsbase_z->string;
|
||||
cg_te_offsamp_xG[iCommand] = cg_te_offsamp_x->string;
|
||||
cg_te_offsamp_yG[iCommand] = cg_te_offsamp_y->string;
|
||||
cg_te_offsamp_zG[iCommand] = cg_te_offsamp_z->string;
|
||||
cg_te_scalerateG[iCommand] = cg_te_scalerate->string;
|
||||
cg_te_circleG[iCommand] = cg_te_circle->string;
|
||||
cg_te_sphereG[iCommand] = cg_te_sphere->string;
|
||||
cg_te_insphereG[iCommand] = cg_te_insphere->string;
|
||||
cg_te_radiusG[iCommand] = cg_te_radius->string;
|
||||
cg_te_alignG[iCommand] = cg_te_align->string;
|
||||
cg_te_flickeralphaG[iCommand] = cg_te_flickeralpha->string;
|
||||
cg_te_collisionG[iCommand] = cg_te_collision->string;
|
||||
cg_te_randomrollG[iCommand] = cg_te_randomroll->string;
|
||||
cg_te_anglesbase_pG[iCommand] = cg_te_anglesbase_p->string;
|
||||
cg_te_anglesbase_yG[iCommand] = cg_te_anglesbase_y->string;
|
||||
cg_te_anglesbase_rG[iCommand] = cg_te_anglesbase_r->string;
|
||||
cg_te_anglesamp_pG[iCommand] = cg_te_anglesamp_p->string;
|
||||
cg_te_anglesamp_yG[iCommand] = cg_te_anglesamp_y->string;
|
||||
cg_te_anglesamp_rG[iCommand] = cg_te_anglesamp_r->string;
|
||||
cg_te_forwardvelG[iCommand] = cg_te_forwardvel->string;
|
||||
cg_te_randvelbase_xG[iCommand] = cg_te_randvelbase_x->string;
|
||||
cg_te_randvelbase_yG[iCommand] = cg_te_randvelbase_y->string;
|
||||
cg_te_randvelbase_zG[iCommand] = cg_te_randvelbase_z->string;
|
||||
cg_te_randvelamp_xG[iCommand] = cg_te_randvelamp_x->string;
|
||||
cg_te_randvelamp_yG[iCommand] = cg_te_randvelamp_y->string;
|
||||
cg_te_randvelamp_zG[iCommand] = cg_te_randvelamp_z->string;
|
||||
cg_te_clampvelmin_xG[iCommand] = cg_te_clampvelmin_x->string;
|
||||
cg_te_clampvelmax_xG[iCommand] = cg_te_clampvelmax_x->string;
|
||||
cg_te_clampvelmin_yG[iCommand] = cg_te_clampvelmin_y->string;
|
||||
cg_te_clampvelmax_yG[iCommand] = cg_te_clampvelmax_y->string;
|
||||
cg_te_clampvelmin_zG[iCommand] = cg_te_clampvelmin_z->string;
|
||||
cg_te_clampvelmax_zG[iCommand] = cg_te_clampvelmax_z->string;
|
||||
cg_te_clampvelaxisG[iCommand] = cg_te_clampvelaxis->string;
|
||||
cg_te_volumetricG[iCommand] = cg_te_volumetric->string;
|
||||
cg_te_randaxisG[iCommand] = cg_te_randaxis->string;
|
||||
cg_te_axisoffsbase_xG[iCommand] = cg_te_axisoffsbase_x->string;
|
||||
cg_te_axisoffsbase_yG[iCommand] = cg_te_axisoffsbase_y->string;
|
||||
cg_te_axisoffsbase_zG[iCommand] = cg_te_axisoffsbase_z->string;
|
||||
cg_te_axisoffsamp_xG[iCommand] = cg_te_axisoffsamp_x->string;
|
||||
cg_te_axisoffsamp_yG[iCommand] = cg_te_axisoffsamp_y->string;
|
||||
cg_te_axisoffsamp_zG[iCommand] = cg_te_axisoffsamp_z->string;
|
||||
cg_te_swarm_freqG[iCommand] = cg_te_swarm_freq->string;
|
||||
cg_te_swarm_maxspeedG[iCommand] = cg_te_swarm_maxspeed->string;
|
||||
cg_te_swarm_deltaG[iCommand] = cg_te_swarm_delta->string;
|
||||
cg_te_avelbase_pG[iCommand] = cg_te_avelbase_p->string;
|
||||
cg_te_avelbase_yG[iCommand] = cg_te_avelbase_y->string;
|
||||
cg_te_avelbase_rG[iCommand] = cg_te_avelbase_r->string;
|
||||
cg_te_avelamp_pG[iCommand] = cg_te_avelamp_p->string;
|
||||
cg_te_avelamp_yG[iCommand] = cg_te_avelamp_y->string;
|
||||
cg_te_avelamp_rG[iCommand] = cg_te_avelamp_r->string;
|
||||
cg_te_radial_scaleG[iCommand] = cg_te_radial_scale->string;
|
||||
cg_te_radial_minG[iCommand] = cg_te_radial_min->string;
|
||||
cg_te_radial_maxG[iCommand] = cg_te_radial_max->string;
|
||||
cg_te_frictionG[iCommand] = cg_te_friction->string;
|
||||
cg_te_varycolorG[iCommand] = cg_te_varycolor->string;
|
||||
cg_te_alphaG[iCommand] = cg_te_alpha->string;
|
||||
cg_te_dietouchG[iCommand] = cg_te_dietouch->string;
|
||||
cg_te_bouncefactorG[iCommand] = cg_te_bouncefactor->string;
|
||||
cg_te_scaleG[iCommand] = cg_te_scale->string;
|
||||
cg_te_scaleminG[iCommand] = cg_te_scalemin->string;
|
||||
cg_te_scalemaxG[iCommand] = cg_te_scalemax->string;
|
||||
cg_te_modelG[iCommand] = cg_te_model->string;
|
||||
cg_te_lifeG[iCommand] = cg_te_life->string;
|
||||
cg_te_color_rG[iCommand] = cg_te_color_r->string;
|
||||
cg_te_color_gG[iCommand] = cg_te_color_g->string;
|
||||
cg_te_color_bG[iCommand] = cg_te_color_b->string;
|
||||
cg_te_accel_xG[iCommand] = cg_te_accel_x->string;
|
||||
cg_te_accel_yG[iCommand] = cg_te_accel_y->string;
|
||||
cg_te_accel_zG[iCommand] = cg_te_accel_z->string;
|
||||
cg_te_countG[iCommand] = cg_te_count->string;
|
||||
cg_te_fadeG[iCommand] = cg_te_fade->string;
|
||||
cg_te_fadedelayG[iCommand] = cg_te_fadedelay->string;
|
||||
cg_te_fadeinG[iCommand] = cg_te_fadein->string;
|
||||
cg_te_spawnrateG[iCommand] = cg_te_spawnrate->string;
|
||||
cg_te_offsbase_xG[iCommand] = cg_te_offsbase_x->string;
|
||||
cg_te_offsbase_yG[iCommand] = cg_te_offsbase_y->string;
|
||||
cg_te_offsbase_zG[iCommand] = cg_te_offsbase_z->string;
|
||||
cg_te_offsamp_xG[iCommand] = cg_te_offsamp_x->string;
|
||||
cg_te_offsamp_yG[iCommand] = cg_te_offsamp_y->string;
|
||||
cg_te_offsamp_zG[iCommand] = cg_te_offsamp_z->string;
|
||||
cg_te_scalerateG[iCommand] = cg_te_scalerate->string;
|
||||
cg_te_circleG[iCommand] = cg_te_circle->string;
|
||||
cg_te_sphereG[iCommand] = cg_te_sphere->string;
|
||||
cg_te_insphereG[iCommand] = cg_te_insphere->string;
|
||||
cg_te_radiusG[iCommand] = cg_te_radius->string;
|
||||
cg_te_alignG[iCommand] = cg_te_align->string;
|
||||
cg_te_flickeralphaG[iCommand] = cg_te_flickeralpha->string;
|
||||
cg_te_collisionG[iCommand] = cg_te_collision->string;
|
||||
cg_te_randomrollG[iCommand] = cg_te_randomroll->string;
|
||||
cg_te_anglesbase_pG[iCommand] = cg_te_anglesbase_p->string;
|
||||
cg_te_anglesbase_yG[iCommand] = cg_te_anglesbase_y->string;
|
||||
cg_te_anglesbase_rG[iCommand] = cg_te_anglesbase_r->string;
|
||||
cg_te_anglesamp_pG[iCommand] = cg_te_anglesamp_p->string;
|
||||
cg_te_anglesamp_yG[iCommand] = cg_te_anglesamp_y->string;
|
||||
cg_te_anglesamp_rG[iCommand] = cg_te_anglesamp_r->string;
|
||||
cg_te_forwardvelG[iCommand] = cg_te_forwardvel->string;
|
||||
cg_te_randvelbase_xG[iCommand] = cg_te_randvelbase_x->string;
|
||||
cg_te_randvelbase_yG[iCommand] = cg_te_randvelbase_y->string;
|
||||
cg_te_randvelbase_zG[iCommand] = cg_te_randvelbase_z->string;
|
||||
cg_te_randvelamp_xG[iCommand] = cg_te_randvelamp_x->string;
|
||||
cg_te_randvelamp_yG[iCommand] = cg_te_randvelamp_y->string;
|
||||
cg_te_randvelamp_zG[iCommand] = cg_te_randvelamp_z->string;
|
||||
cg_te_clampvelmin_xG[iCommand] = cg_te_clampvelmin_x->string;
|
||||
cg_te_clampvelmax_xG[iCommand] = cg_te_clampvelmax_x->string;
|
||||
cg_te_clampvelmin_yG[iCommand] = cg_te_clampvelmin_y->string;
|
||||
cg_te_clampvelmax_yG[iCommand] = cg_te_clampvelmax_y->string;
|
||||
cg_te_clampvelmin_zG[iCommand] = cg_te_clampvelmin_z->string;
|
||||
cg_te_clampvelmax_zG[iCommand] = cg_te_clampvelmax_z->string;
|
||||
cg_te_clampvelaxisG[iCommand] = cg_te_clampvelaxis->string;
|
||||
cg_te_volumetricG[iCommand] = cg_te_volumetric->string;
|
||||
cg_te_randaxisG[iCommand] = cg_te_randaxis->string;
|
||||
cg_te_axisoffsbase_xG[iCommand] = cg_te_axisoffsbase_x->string;
|
||||
cg_te_axisoffsbase_yG[iCommand] = cg_te_axisoffsbase_y->string;
|
||||
cg_te_axisoffsbase_zG[iCommand] = cg_te_axisoffsbase_z->string;
|
||||
cg_te_axisoffsamp_xG[iCommand] = cg_te_axisoffsamp_x->string;
|
||||
cg_te_axisoffsamp_yG[iCommand] = cg_te_axisoffsamp_y->string;
|
||||
cg_te_axisoffsamp_zG[iCommand] = cg_te_axisoffsamp_z->string;
|
||||
cg_te_swarm_freqG[iCommand] = cg_te_swarm_freq->string;
|
||||
cg_te_swarm_maxspeedG[iCommand] = cg_te_swarm_maxspeed->string;
|
||||
cg_te_swarm_deltaG[iCommand] = cg_te_swarm_delta->string;
|
||||
cg_te_avelbase_pG[iCommand] = cg_te_avelbase_p->string;
|
||||
cg_te_avelbase_yG[iCommand] = cg_te_avelbase_y->string;
|
||||
cg_te_avelbase_rG[iCommand] = cg_te_avelbase_r->string;
|
||||
cg_te_avelamp_pG[iCommand] = cg_te_avelamp_p->string;
|
||||
cg_te_avelamp_yG[iCommand] = cg_te_avelamp_y->string;
|
||||
cg_te_avelamp_rG[iCommand] = cg_te_avelamp_r->string;
|
||||
cg_te_radial_scaleG[iCommand] = cg_te_radial_scale->string;
|
||||
cg_te_radial_minG[iCommand] = cg_te_radial_min->string;
|
||||
cg_te_radial_maxG[iCommand] = cg_te_radial_max->string;
|
||||
cg_te_frictionG[iCommand] = cg_te_friction->string;
|
||||
cg_te_varycolorG[iCommand] = cg_te_varycolor->string;
|
||||
cg_te_spritegridlightingG[iCommand] = cg_te_spritegridlighting->string;
|
||||
cg_te_spawnrange_aG[iCommand] = cg_te_spawnrange_a->string;
|
||||
cg_te_spawnrange_bG[iCommand] = cg_te_spawnrange_b->string;
|
||||
cg_te_cone_heightG[iCommand] = cg_te_cone_height->string;
|
||||
cg_te_spawnrange_aG[iCommand] = cg_te_spawnrange_a->string;
|
||||
cg_te_spawnrange_bG[iCommand] = cg_te_spawnrange_b->string;
|
||||
cg_te_cone_heightG[iCommand] = cg_te_cone_height->string;
|
||||
cg_te_alignstretch_scaleG[iCommand] = cg_te_alignstretch_scale->string;
|
||||
cg_te_command_timeG[iCommand] = cg_te_command_time->string;
|
||||
cg_te_singlelinecommandG[iCommand] = cg_te_singlelinecommand->string;
|
||||
cg_te_tagG[iCommand] = cg_te_tag->string;
|
||||
cg_te_command_timeG[iCommand] = cg_te_command_time->string;
|
||||
cg_te_singlelinecommandG[iCommand] = cg_te_singlelinecommand->string;
|
||||
cg_te_tagG[iCommand] = cg_te_tag->string;
|
||||
}
|
||||
|
||||
void CG_ResetEffectCommandCvars()
|
||||
@@ -327,7 +327,7 @@ void CG_TriggerTestEmitter_f(void)
|
||||
// FIXME: unimplemented
|
||||
}
|
||||
|
||||
void CG_DumpBaseAndAmplitude(str* buff, char* prefix, Vector* base, Vector* amplitude)
|
||||
void CG_DumpBaseAndAmplitude(str *buff, char *prefix, Vector *base, Vector *amplitude)
|
||||
{
|
||||
// FIXME: unimplemented
|
||||
}
|
||||
@@ -337,7 +337,9 @@ void CG_DumpEmitter_f(void)
|
||||
// FIXME: unimplemented
|
||||
}
|
||||
|
||||
void CG_LoadBaseAndAmplitude(char** pBufer, char* szCvarX, char* szCvarY, char* szCvarZ, char* szCvarXAmp, char* szCvarYAmp, char* szCvarZAmp)
|
||||
void CG_LoadBaseAndAmplitude(
|
||||
char **pBufer, char *szCvarX, char *szCvarY, char *szCvarZ, char *szCvarXAmp, char *szCvarYAmp, char *szCvarZAmp
|
||||
)
|
||||
{
|
||||
// FIXME: unimplemented
|
||||
}
|
||||
@@ -374,111 +376,111 @@ void CG_DeleteEmitterCommand_f(void)
|
||||
|
||||
void CG_InitTestEmitter(void)
|
||||
{
|
||||
cg_te_life = cgi.Cvar_Get("cg_te_life", "1", 0);
|
||||
cg_te_alpha = cgi.Cvar_Get("cg_te_alpha", "1", 0);
|
||||
cg_te_dietouch = cgi.Cvar_Get("cg_te_dietouch", "0", 0);
|
||||
cg_te_bouncefactor = cgi.Cvar_Get("cg_te_bouncefactor", "0.3", 0);
|
||||
cg_te_scale = cgi.Cvar_Get("cg_te_scale", "1", 0);
|
||||
cg_te_scalemin = cgi.Cvar_Get("cg_te_scalemin", "0", 0);
|
||||
cg_te_scalemax = cgi.Cvar_Get("cg_te_scalemax", "0", 0);
|
||||
cg_te_model = cgi.Cvar_Get("cg_te_model", "none", 0);
|
||||
cg_te_life = cgi.Cvar_Get("cg_te_life", "1", 0);
|
||||
cg_te_color_r = cgi.Cvar_Get("cg_te_color_r", "1", 0);
|
||||
cg_te_color_g = cgi.Cvar_Get("cg_te_color_g", "1", 0);
|
||||
cg_te_color_b = cgi.Cvar_Get("cg_te_color_b", "1", 0);
|
||||
cg_te_accel_x = cgi.Cvar_Get("cg_te_accel_x", "0", 0);
|
||||
cg_te_accel_y = cgi.Cvar_Get("cg_te_accel_y", "0", 0);
|
||||
cg_te_accel_z = cgi.Cvar_Get("cg_te_accel_z", "0", 0);
|
||||
cg_te_count = cgi.Cvar_Get("cg_te_count", "1", 0);
|
||||
cg_te_fade = cgi.Cvar_Get("cg_te_fade", "0", 0);
|
||||
cg_te_fadedelay = cgi.Cvar_Get("cg_te_fadedelay", "0", 0);
|
||||
cg_te_fadein = cgi.Cvar_Get("cg_te_fadein", "0", 0);
|
||||
cg_te_spawnrate = cgi.Cvar_Get("cg_te_spawnrate", "1", 0);
|
||||
cg_te_scalerate = cgi.Cvar_Get("cg_te_scalerate", "0", 0);
|
||||
cg_te_circle = cgi.Cvar_Get("cg_te_circle", "0", 0);
|
||||
cg_te_sphere = cgi.Cvar_Get("cg_te_sphere", "0", 0);
|
||||
cg_te_insphere = cgi.Cvar_Get("cg_te_insphere", "0", 0);
|
||||
cg_te_radius = cgi.Cvar_Get("cg_te_radius", "0", 0);
|
||||
cg_te_align = cgi.Cvar_Get("cg_te_align", "0", 0);
|
||||
cg_te_flickeralpha = cgi.Cvar_Get("cg_te_flickeralpha", "0", 0);
|
||||
cg_te_collision = cgi.Cvar_Get("cg_te_collision", "0", 0);
|
||||
cg_te_randomroll = cgi.Cvar_Get("cg_te_randomroll", "0", 0);
|
||||
cg_te_offsbase_x = cgi.Cvar_Get("cg_te_offsbase_x", "0", 0);
|
||||
cg_te_offsbase_y = cgi.Cvar_Get("cg_te_offsbase_y", "0", 0);
|
||||
cg_te_offsbase_z = cgi.Cvar_Get("cg_te_offsbase_z", "0", 0);
|
||||
cg_te_offsamp_x = cgi.Cvar_Get("cg_te_offsamp_x", "0", 0);
|
||||
cg_te_offsamp_y = cgi.Cvar_Get("cg_te_offsamp_y", "0", 0);
|
||||
cg_te_offsamp_z = cgi.Cvar_Get("cg_te_offsamp_z", "0", 0);
|
||||
cg_te_anglesbase_p = cgi.Cvar_Get("cg_te_anglesbase_p", "0", 0);
|
||||
cg_te_anglesbase_y = cgi.Cvar_Get("cg_te_anglesbase_y", "0", 0);
|
||||
cg_te_anglesbase_r = cgi.Cvar_Get("cg_te_anglesbase_r", "0", 0);
|
||||
cg_te_anglesamp_p = cgi.Cvar_Get("cg_te_anglesamp_p", "0", 0);
|
||||
cg_te_anglesamp_y = cgi.Cvar_Get("cg_te_anglesamp_y", "0", 0);
|
||||
cg_te_anglesamp_r = cgi.Cvar_Get("cg_te_anglesamp_r", "0", 0);
|
||||
cg_te_randvelbase_x = cgi.Cvar_Get("cg_te_randvelbase_x", "0", 0);
|
||||
cg_te_randvelbase_y = cgi.Cvar_Get("cg_te_randvelbase_y", "0", 0);
|
||||
cg_te_randvelbase_z = cgi.Cvar_Get("cg_te_randvelbase_z", "0", 0);
|
||||
cg_te_randvelamp_x = cgi.Cvar_Get("cg_te_randvelamp_x", "0", 0);
|
||||
cg_te_randvelamp_y = cgi.Cvar_Get("cg_te_randvelamp_y", "0", 0);
|
||||
cg_te_randvelamp_z = cgi.Cvar_Get("cg_te_randvelamp_z", "0", 0);
|
||||
cg_te_clampvelmin_x = cgi.Cvar_Get("cg_te_clampvelmin_x", "-9999", 0);
|
||||
cg_te_clampvelmax_x = cgi.Cvar_Get("cg_te_clampvelmax_x", "9999", 0);
|
||||
cg_te_clampvelmin_y = cgi.Cvar_Get("cg_te_clampvelmin_y", "-9999", 0);
|
||||
cg_te_clampvelmax_y = cgi.Cvar_Get("cg_te_clampvelmax_y", "9999", 0);
|
||||
cg_te_clampvelmin_z = cgi.Cvar_Get("cg_te_clampvelmin_z", "-9999", 0);
|
||||
cg_te_clampvelmax_z = cgi.Cvar_Get("cg_te_clampvelmax_z", "9999", 0);
|
||||
cg_te_clampvelaxis = cgi.Cvar_Get("cg_te_clampvelaxis", "0", 0);
|
||||
cg_te_forwardvel = cgi.Cvar_Get("cg_te_forwardvel", "0", 0);
|
||||
cg_te_volumetric = cgi.Cvar_Get("cg_te_volumetric", "0", 0);
|
||||
cg_te_randaxis = cgi.Cvar_Get("cg_te_randaxis", "0", 0);
|
||||
cg_te_axisoffsbase_x = cgi.Cvar_Get("cg_te_axisoffsbase_x", "0", 0);
|
||||
cg_te_axisoffsbase_y = cgi.Cvar_Get("cg_te_axisoffsbase_y", "0", 0);
|
||||
cg_te_axisoffsbase_z = cgi.Cvar_Get("cg_te_axisoffsbase_z", "0", 0);
|
||||
cg_te_axisoffsamp_x = cgi.Cvar_Get("cg_te_axisoffsamp_x", "0", 0);
|
||||
cg_te_axisoffsamp_y = cgi.Cvar_Get("cg_te_axisoffsamp_y", "0", 0);
|
||||
cg_te_axisoffsamp_z = cgi.Cvar_Get("cg_te_axisoffsamp_z", "0", 0);
|
||||
cg_te_swarm_freq = cgi.Cvar_Get("cg_te_swarm_freq", "0", 0);
|
||||
cg_te_swarm_maxspeed = cgi.Cvar_Get("cg_te_swarm_maxspeed", "0", 0);
|
||||
cg_te_swarm_delta = cgi.Cvar_Get("cg_te_swarm_delta", "0", 0);
|
||||
cg_te_avelbase_p = cgi.Cvar_Get("cg_te_avelbase_p", "0", 0);
|
||||
cg_te_avelbase_y = cgi.Cvar_Get("cg_te_avelbase_y", "0", 0);
|
||||
cg_te_avelbase_r = cgi.Cvar_Get("cg_te_avelbase_r", "0", 0);
|
||||
cg_te_avelamp_p = cgi.Cvar_Get("cg_te_avelamp_p", "0", 0);
|
||||
cg_te_avelamp_y = cgi.Cvar_Get("cg_te_avelamp_y", "0", 0);
|
||||
cg_te_avelamp_r = cgi.Cvar_Get("cg_te_avelamp_r", "0", 0);
|
||||
cg_te_radial_scale = cgi.Cvar_Get("cg_te_radial_scale", "0", 0);
|
||||
cg_te_radial_min = cgi.Cvar_Get("cg_te_radial_min", "0", 0);
|
||||
cg_te_radial_max = cgi.Cvar_Get("cg_te_radial_max", "0", 0);
|
||||
cg_te_friction = cgi.Cvar_Get("cg_te_friction", "0", 0);
|
||||
cg_te_varycolor = cgi.Cvar_Get("cg_te_varycolor", "0", 0);
|
||||
cg_te_life = cgi.Cvar_Get("cg_te_life", "1", 0);
|
||||
cg_te_alpha = cgi.Cvar_Get("cg_te_alpha", "1", 0);
|
||||
cg_te_dietouch = cgi.Cvar_Get("cg_te_dietouch", "0", 0);
|
||||
cg_te_bouncefactor = cgi.Cvar_Get("cg_te_bouncefactor", "0.3", 0);
|
||||
cg_te_scale = cgi.Cvar_Get("cg_te_scale", "1", 0);
|
||||
cg_te_scalemin = cgi.Cvar_Get("cg_te_scalemin", "0", 0);
|
||||
cg_te_scalemax = cgi.Cvar_Get("cg_te_scalemax", "0", 0);
|
||||
cg_te_model = cgi.Cvar_Get("cg_te_model", "none", 0);
|
||||
cg_te_life = cgi.Cvar_Get("cg_te_life", "1", 0);
|
||||
cg_te_color_r = cgi.Cvar_Get("cg_te_color_r", "1", 0);
|
||||
cg_te_color_g = cgi.Cvar_Get("cg_te_color_g", "1", 0);
|
||||
cg_te_color_b = cgi.Cvar_Get("cg_te_color_b", "1", 0);
|
||||
cg_te_accel_x = cgi.Cvar_Get("cg_te_accel_x", "0", 0);
|
||||
cg_te_accel_y = cgi.Cvar_Get("cg_te_accel_y", "0", 0);
|
||||
cg_te_accel_z = cgi.Cvar_Get("cg_te_accel_z", "0", 0);
|
||||
cg_te_count = cgi.Cvar_Get("cg_te_count", "1", 0);
|
||||
cg_te_fade = cgi.Cvar_Get("cg_te_fade", "0", 0);
|
||||
cg_te_fadedelay = cgi.Cvar_Get("cg_te_fadedelay", "0", 0);
|
||||
cg_te_fadein = cgi.Cvar_Get("cg_te_fadein", "0", 0);
|
||||
cg_te_spawnrate = cgi.Cvar_Get("cg_te_spawnrate", "1", 0);
|
||||
cg_te_scalerate = cgi.Cvar_Get("cg_te_scalerate", "0", 0);
|
||||
cg_te_circle = cgi.Cvar_Get("cg_te_circle", "0", 0);
|
||||
cg_te_sphere = cgi.Cvar_Get("cg_te_sphere", "0", 0);
|
||||
cg_te_insphere = cgi.Cvar_Get("cg_te_insphere", "0", 0);
|
||||
cg_te_radius = cgi.Cvar_Get("cg_te_radius", "0", 0);
|
||||
cg_te_align = cgi.Cvar_Get("cg_te_align", "0", 0);
|
||||
cg_te_flickeralpha = cgi.Cvar_Get("cg_te_flickeralpha", "0", 0);
|
||||
cg_te_collision = cgi.Cvar_Get("cg_te_collision", "0", 0);
|
||||
cg_te_randomroll = cgi.Cvar_Get("cg_te_randomroll", "0", 0);
|
||||
cg_te_offsbase_x = cgi.Cvar_Get("cg_te_offsbase_x", "0", 0);
|
||||
cg_te_offsbase_y = cgi.Cvar_Get("cg_te_offsbase_y", "0", 0);
|
||||
cg_te_offsbase_z = cgi.Cvar_Get("cg_te_offsbase_z", "0", 0);
|
||||
cg_te_offsamp_x = cgi.Cvar_Get("cg_te_offsamp_x", "0", 0);
|
||||
cg_te_offsamp_y = cgi.Cvar_Get("cg_te_offsamp_y", "0", 0);
|
||||
cg_te_offsamp_z = cgi.Cvar_Get("cg_te_offsamp_z", "0", 0);
|
||||
cg_te_anglesbase_p = cgi.Cvar_Get("cg_te_anglesbase_p", "0", 0);
|
||||
cg_te_anglesbase_y = cgi.Cvar_Get("cg_te_anglesbase_y", "0", 0);
|
||||
cg_te_anglesbase_r = cgi.Cvar_Get("cg_te_anglesbase_r", "0", 0);
|
||||
cg_te_anglesamp_p = cgi.Cvar_Get("cg_te_anglesamp_p", "0", 0);
|
||||
cg_te_anglesamp_y = cgi.Cvar_Get("cg_te_anglesamp_y", "0", 0);
|
||||
cg_te_anglesamp_r = cgi.Cvar_Get("cg_te_anglesamp_r", "0", 0);
|
||||
cg_te_randvelbase_x = cgi.Cvar_Get("cg_te_randvelbase_x", "0", 0);
|
||||
cg_te_randvelbase_y = cgi.Cvar_Get("cg_te_randvelbase_y", "0", 0);
|
||||
cg_te_randvelbase_z = cgi.Cvar_Get("cg_te_randvelbase_z", "0", 0);
|
||||
cg_te_randvelamp_x = cgi.Cvar_Get("cg_te_randvelamp_x", "0", 0);
|
||||
cg_te_randvelamp_y = cgi.Cvar_Get("cg_te_randvelamp_y", "0", 0);
|
||||
cg_te_randvelamp_z = cgi.Cvar_Get("cg_te_randvelamp_z", "0", 0);
|
||||
cg_te_clampvelmin_x = cgi.Cvar_Get("cg_te_clampvelmin_x", "-9999", 0);
|
||||
cg_te_clampvelmax_x = cgi.Cvar_Get("cg_te_clampvelmax_x", "9999", 0);
|
||||
cg_te_clampvelmin_y = cgi.Cvar_Get("cg_te_clampvelmin_y", "-9999", 0);
|
||||
cg_te_clampvelmax_y = cgi.Cvar_Get("cg_te_clampvelmax_y", "9999", 0);
|
||||
cg_te_clampvelmin_z = cgi.Cvar_Get("cg_te_clampvelmin_z", "-9999", 0);
|
||||
cg_te_clampvelmax_z = cgi.Cvar_Get("cg_te_clampvelmax_z", "9999", 0);
|
||||
cg_te_clampvelaxis = cgi.Cvar_Get("cg_te_clampvelaxis", "0", 0);
|
||||
cg_te_forwardvel = cgi.Cvar_Get("cg_te_forwardvel", "0", 0);
|
||||
cg_te_volumetric = cgi.Cvar_Get("cg_te_volumetric", "0", 0);
|
||||
cg_te_randaxis = cgi.Cvar_Get("cg_te_randaxis", "0", 0);
|
||||
cg_te_axisoffsbase_x = cgi.Cvar_Get("cg_te_axisoffsbase_x", "0", 0);
|
||||
cg_te_axisoffsbase_y = cgi.Cvar_Get("cg_te_axisoffsbase_y", "0", 0);
|
||||
cg_te_axisoffsbase_z = cgi.Cvar_Get("cg_te_axisoffsbase_z", "0", 0);
|
||||
cg_te_axisoffsamp_x = cgi.Cvar_Get("cg_te_axisoffsamp_x", "0", 0);
|
||||
cg_te_axisoffsamp_y = cgi.Cvar_Get("cg_te_axisoffsamp_y", "0", 0);
|
||||
cg_te_axisoffsamp_z = cgi.Cvar_Get("cg_te_axisoffsamp_z", "0", 0);
|
||||
cg_te_swarm_freq = cgi.Cvar_Get("cg_te_swarm_freq", "0", 0);
|
||||
cg_te_swarm_maxspeed = cgi.Cvar_Get("cg_te_swarm_maxspeed", "0", 0);
|
||||
cg_te_swarm_delta = cgi.Cvar_Get("cg_te_swarm_delta", "0", 0);
|
||||
cg_te_avelbase_p = cgi.Cvar_Get("cg_te_avelbase_p", "0", 0);
|
||||
cg_te_avelbase_y = cgi.Cvar_Get("cg_te_avelbase_y", "0", 0);
|
||||
cg_te_avelbase_r = cgi.Cvar_Get("cg_te_avelbase_r", "0", 0);
|
||||
cg_te_avelamp_p = cgi.Cvar_Get("cg_te_avelamp_p", "0", 0);
|
||||
cg_te_avelamp_y = cgi.Cvar_Get("cg_te_avelamp_y", "0", 0);
|
||||
cg_te_avelamp_r = cgi.Cvar_Get("cg_te_avelamp_r", "0", 0);
|
||||
cg_te_radial_scale = cgi.Cvar_Get("cg_te_radial_scale", "0", 0);
|
||||
cg_te_radial_min = cgi.Cvar_Get("cg_te_radial_min", "0", 0);
|
||||
cg_te_radial_max = cgi.Cvar_Get("cg_te_radial_max", "0", 0);
|
||||
cg_te_friction = cgi.Cvar_Get("cg_te_friction", "0", 0);
|
||||
cg_te_varycolor = cgi.Cvar_Get("cg_te_varycolor", "0", 0);
|
||||
cg_te_spritegridlighting = cgi.Cvar_Get("cg_te_spritegridlighting", "0", 0);
|
||||
cg_te_spawnrange_a = cgi.Cvar_Get("cg_te_spawnrange_a", "0", 0);
|
||||
cg_te_spawnrange_b = cgi.Cvar_Get("cg_te_spawnrange_b", "0", 0);
|
||||
cg_te_cone_height = cgi.Cvar_Get("cg_te_cone_height", "0", 0);
|
||||
cg_te_spawnrange_a = cgi.Cvar_Get("cg_te_spawnrange_a", "0", 0);
|
||||
cg_te_spawnrange_b = cgi.Cvar_Get("cg_te_spawnrange_b", "0", 0);
|
||||
cg_te_cone_height = cgi.Cvar_Get("cg_te_cone_height", "0", 0);
|
||||
cg_te_alignstretch_scale = cgi.Cvar_Get("cg_te_alignstretch_scale", "0", 0);
|
||||
cg_te_command_time = cgi.Cvar_Get("cg_te_command_time", "0", 0);
|
||||
cg_te_singlelinecommand = cgi.Cvar_Get("cg_te_singlelinecommand", "", 0);
|
||||
cg_te_tag = cgi.Cvar_Get("cg_te_tag", "", 0);
|
||||
cg_te_command_time = cgi.Cvar_Get("cg_te_command_time", "0", 0);
|
||||
cg_te_singlelinecommand = cgi.Cvar_Get("cg_te_singlelinecommand", "", 0);
|
||||
cg_te_tag = cgi.Cvar_Get("cg_te_tag", "", 0);
|
||||
|
||||
for (int i = 0; i < MAX_TESTEMITTERS_SAVE; ++i) {
|
||||
CG_SaveEffectCommandCvars(i);
|
||||
}
|
||||
|
||||
cg_te_xangles = cgi.Cvar_Get("cg_te_xangles", "0", 0);
|
||||
cg_te_yangles = cgi.Cvar_Get("cg_te_yangles", "0", 0);
|
||||
cg_te_zangles = cgi.Cvar_Get("cg_te_zangles", "0", 0);
|
||||
cg_te_xangles = cgi.Cvar_Get("cg_te_xangles", "0", 0);
|
||||
cg_te_yangles = cgi.Cvar_Get("cg_te_yangles", "0", 0);
|
||||
cg_te_zangles = cgi.Cvar_Get("cg_te_zangles", "0", 0);
|
||||
cg_te_emittermodel = cgi.Cvar_Get("cg_te_emittermodel", "", 0);
|
||||
cg_te_mode = cgi.Cvar_Get("cg_te_mode", "0", 0);
|
||||
cg_te_mode_name = cgi.Cvar_Get("cg_te_mode_name", "Emitter Mode", 0);
|
||||
cg_te_currCommand = cgi.Cvar_Get("cg_te_currCommand", "0", 0);
|
||||
cg_te_mode = cgi.Cvar_Get("cg_te_mode", "0", 0);
|
||||
cg_te_mode_name = cgi.Cvar_Get("cg_te_mode_name", "Emitter Mode", 0);
|
||||
cg_te_currCommand = cgi.Cvar_Get("cg_te_currCommand", "0", 0);
|
||||
|
||||
te_vEmitterOrigin[2] = 0.0;
|
||||
te_vEmitterOrigin[1] = 0.0;
|
||||
te_vEmitterOrigin[0] = 0.0;
|
||||
te_refEnt.scale = 0.0;
|
||||
cg_te_numCommands = cgi.Cvar_Get("cg_te_numCommands", "0", 0);
|
||||
te_iNumCommands = 0;
|
||||
te_iCurrCommand = 0;
|
||||
te_refEnt.scale = 0.0;
|
||||
cg_te_numCommands = cgi.Cvar_Get("cg_te_numCommands", "0", 0);
|
||||
te_iNumCommands = 0;
|
||||
te_iCurrCommand = 0;
|
||||
|
||||
pTesteffect = sfxManager.GetTestEffectPointer();
|
||||
}
|
||||
+7
-13
@@ -62,8 +62,7 @@ void CG_MessageMode_Private_f(void)
|
||||
}
|
||||
|
||||
clientNum = atoi(cgi.Argv(1)) - 1;
|
||||
if (clientNum < 0 || clientNum >= MAX_CLIENTS)
|
||||
{
|
||||
if (clientNum < 0 || clientNum >= MAX_CLIENTS) {
|
||||
cgi.Printf(HUD_MESSAGE_CHAT_WHITE "Message Error: %s is a bad client number\n", cgi.Argv(1));
|
||||
return;
|
||||
}
|
||||
@@ -79,8 +78,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 +91,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 +105,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 +124,7 @@ void CG_MessageSingleClient_f(void)
|
||||
|
||||
sString += "\n";
|
||||
cgi.SendClientCommand(sString.c_str());
|
||||
}
|
||||
else {
|
||||
} else {
|
||||
cgi.UI_ToggleDMMessageConsole(-clientNum);
|
||||
}
|
||||
}
|
||||
@@ -195,7 +189,7 @@ 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)
|
||||
|
||||
@@ -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
|
||||
}
|
||||
+415
-327
File diff suppressed because it is too large.
Load diff
+321
-306
@@ -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]));
|
||||
cgi.anim->g_iLastAnimPrefixIndex = iAnimPrefixIndex;
|
||||
bAnimChanged = qtrue;
|
||||
|
||||
bAnimChanged = qtrue;
|
||||
bWeaponChanged = qtrue;
|
||||
}
|
||||
|
||||
if (cgi.anim->g_iLastVMAnim == -1)
|
||||
{
|
||||
if (cgi.anim->g_iLastVMAnim == -1) {
|
||||
sprintf(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;
|
||||
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];
|
||||
}
|
||||
|
||||
+544
-679
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,50 @@ 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)
|
||||
add_subdirectory("../libmad" "./libmad" EXCLUDE_FROM_ALL)
|
||||
target_link_libraries(omohclient INTERFACE mad)
|
||||
set(BUILD_SHARED_LIBS ${OLD_VALUE} CACHE BOOL "" FORCE)
|
||||
|
||||
if (USE_OPENAL)
|
||||
# Try to use OpenAL
|
||||
find_package(OpenAL)
|
||||
if (OPENAL_FOUND)
|
||||
target_compile_definitions(omohclient INTERFACE USE_OPENAL=1)
|
||||
target_include_directories(omohclient INTERFACE ${OPENAL_INCLUDE_DIR}/AL)
|
||||
target_link_libraries(omohclient INTERFACE ${OPENAL_LIBRARY})
|
||||
endif()
|
||||
endif()
|
||||
|
||||
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
|
||||
}
|
||||
|
||||
/*
|
||||
|
||||
+148
-53
@@ -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,20 +234,20 @@ qboolean CL_GetSnapshot( int snapshotNumber, snapshot_t *snapshot ) {
|
||||
snapshot->entities[snapshot->numEntities++] = *s1;
|
||||
}
|
||||
|
||||
for(pcount = 0; pcount < 8 && snapshot->numEntities != count; pcount++)
|
||||
{
|
||||
for (i = 0; i < count; i++)
|
||||
{
|
||||
for(pcount = 0; pcount < 8 && snapshot->numEntities != count; pcount++) {
|
||||
for (i = 0; i < count; i++) {
|
||||
s1 = &cl.parseEntities[(clSnap->parseEntitiesNum + i) & (MAX_PARSE_ENTITIES - 1)];
|
||||
pnum = parents[s1->number];
|
||||
if (pnum >= 0 && parents[pnum] == -2) {
|
||||
parents[s1->number] = -2;
|
||||
snapshot->entities[snapshot->numEntities++] = *s1;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (pcount >= 8)
|
||||
{
|
||||
if (snapshot->numEntities != count) {
|
||||
Com_DPrintf("CL_GetSnapshot: Not all children could find their parents.\n");
|
||||
|
||||
for (i = count; i < snapshot->numEntities; i++)
|
||||
{
|
||||
s1 = &cl.parseEntities[(clSnap->parseEntitiesNum + i) & (MAX_PARSE_ENTITIES - 1)];
|
||||
@@ -259,6 +261,8 @@ qboolean CL_GetSnapshot( int snapshotNumber, snapshot_t *snapshot ) {
|
||||
s1->origin[1],
|
||||
s1->origin[2]
|
||||
);
|
||||
|
||||
parents[s1->number] = -2;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -290,19 +294,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 +348,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 +399,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 +425,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 +469,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 +495,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 +575,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 +614,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;
|
||||
@@ -554,6 +640,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 +660,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 +713,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;
|
||||
@@ -718,11 +808,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 +972,6 @@ qboolean CL_GameCommand( void ) {
|
||||
return cge->CG_ConsoleCommand();
|
||||
}
|
||||
|
||||
|
||||
|
||||
/*
|
||||
=====================
|
||||
CL_CGameRendering
|
||||
@@ -893,6 +986,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();
|
||||
}
|
||||
|
||||
/*
|
||||
@@ -1068,16 +1165,14 @@ void CL_SetCGameTime( void ) {
|
||||
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;
|
||||
|
||||
|
||||
+11
-4
@@ -1091,6 +1091,8 @@ static void RoQReset( void ) {
|
||||
|
||||
static void RoQInterrupt(void)
|
||||
{
|
||||
// Removed in OPM
|
||||
#if 0
|
||||
byte *framedata;
|
||||
short sbuf[32768];
|
||||
int ssize;
|
||||
@@ -1214,6 +1216,7 @@ redump:
|
||||
// assert(cinTable[currentHandle].RoQFrameSize <= 65536);
|
||||
// r = FS_Read( cin.file, cinTable[currentHandle].RoQFrameSize+8, cinTable[currentHandle].iFile );
|
||||
cinTable[currentHandle].RoQPlayed += cinTable[currentHandle].RoQFrameSize+8;
|
||||
#endif
|
||||
}
|
||||
|
||||
/******************************************************************************
|
||||
@@ -1397,6 +1400,9 @@ CIN_PlayCinematic
|
||||
==================
|
||||
*/
|
||||
int CIN_PlayCinematic( const char *arg, int x, int y, int w, int h, int systemBits ) {
|
||||
return 0;
|
||||
// Removed in OPM
|
||||
#if 0
|
||||
unsigned short RoQID;
|
||||
char name[MAX_OSPATH];
|
||||
int i;
|
||||
@@ -1478,6 +1484,7 @@ int CIN_PlayCinematic( const char *arg, int x, int y, int w, int h, int systemBi
|
||||
|
||||
RoQShutdown();
|
||||
return -1;
|
||||
#endif
|
||||
}
|
||||
|
||||
void CIN_SetExtents (int handle, int x, int y, int w, int h) {
|
||||
@@ -1583,13 +1590,13 @@ 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;
|
||||
}
|
||||
|
||||
@@ -1612,7 +1619,7 @@ void CL_PlayCinematic_f(void) {
|
||||
bits |= CIN_loop;
|
||||
}
|
||||
|
||||
S_StopAllSounds( qtrue );
|
||||
S_StopAllSounds2( qtrue );
|
||||
|
||||
CL_handle = CIN_PlayCinematic( arg, 0, 0, SCREEN_WIDTH, SCREEN_HEIGHT, bits );
|
||||
if (CL_handle >= 0) {
|
||||
@@ -1639,7 +1646,7 @@ void SCR_RunCinematic (void)
|
||||
void SCR_StopCinematic(void) {
|
||||
if (CL_handle >= 0 && CL_handle < MAX_VIDEO_HANDLES) {
|
||||
CIN_StopCinematic(CL_handle);
|
||||
S_StopAllSounds( qtrue );
|
||||
S_StopAllSounds2( 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 */
|
||||
@@ -432,7 +432,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;
|
||||
@@ -575,6 +575,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;
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
@@ -991,7 +999,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 +1059,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);
|
||||
|
||||
+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);
|
||||
+927
-919
File diff suppressed because it is too large.
Load diff
+582
-267
File diff suppressed because it is too large.
Load diff
+93
-43
@@ -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 / 63.f;
|
||||
unpacked->y = y * range / 63.f;
|
||||
|
||||
if (!bValid)
|
||||
{
|
||||
unpacked->x = x * range / 63.f * 1024;
|
||||
unpacked->y = y * range / 63.f * 1024;
|
||||
}
|
||||
|
||||
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);
|
||||
}
|
||||
|
||||
|
||||
@@ -444,35 +514,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 +550,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 +586,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 +596,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 +701,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 +743,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 +752,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 +766,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", "" );
|
||||
|
||||
@@ -531,7 +531,7 @@ void SCR_UpdateScreen( void ) {
|
||||
}
|
||||
recursive = 1;
|
||||
|
||||
CL_StartHunkUsers();
|
||||
CL_StartHunkUsers(qfalse);
|
||||
SCR_SimpleUpdateScreen();
|
||||
|
||||
// set the fps value
|
||||
|
||||
+3933
-4026
File diff suppressed because it is too large.
Load diff
+90
-63
@@ -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,103 +20,130 @@ 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;
|
||||
|
||||
//
|
||||
// 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);
|
||||
|
||||
//
|
||||
// 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);
|
||||
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);
|
||||
@@ -161,10 +161,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 {
|
||||
@@ -285,7 +288,7 @@ void UIDMBox::Print( const char *text )
|
||||
{
|
||||
const char* text1 = text;
|
||||
|
||||
if (m_numitems > 4)
|
||||
if (m_numitems > 5)
|
||||
{
|
||||
//
|
||||
// Overwrite an item
|
||||
@@ -307,15 +310,15 @@ 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;
|
||||
m_items[m_numitems].font = m_fontbold;
|
||||
m_items[m_numitems].flags |= DMBOX_ITEM_FLAG_DEATH;
|
||||
|
||||
text1 = text + 1;
|
||||
}
|
||||
@@ -377,7 +380,7 @@ void UIDMBox::Draw( void )
|
||||
float alpha;
|
||||
float alphaScale;
|
||||
|
||||
alphaScale = 0.8;
|
||||
alphaScale = 0.8f;
|
||||
HandleBoxMoving();
|
||||
|
||||
if (!m_numitems) {
|
||||
|
||||
@@ -23,7 +23,8 @@ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
#ifndef __CL_UIDMBOX_H__
|
||||
#define __CL_UIDMBOX_H__
|
||||
|
||||
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;
|
||||
|
||||
|
||||
+209
-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,254 @@ 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;
|
||||
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__ */
|
||||
+183
-17
@@ -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,44 +21,210 @@ 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[5];
|
||||
|
||||
public:
|
||||
LANGameItem();
|
||||
LANGameItem(
|
||||
const str& hostName, const str& mapName, const str& players, const str& gameTypeString, const str& ping
|
||||
);
|
||||
|
||||
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");
|
||||
}
|
||||
|
||||
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.4f, false, false);
|
||||
AddColumn(Sys_LV_CL_ConvertString("Map"), 1, width * 0.15f, false, false);
|
||||
AddColumn(Sys_LV_CL_ConvertString("Players"), 2, width * 0.165f, true, true);
|
||||
AddColumn(Sys_LV_CL_ConvertString("GameType"), 3, width * 0.22f, false, false);
|
||||
AddColumn(Sys_LV_CL_ConvertString("Ping"), 4, width * 0.065f, true, false);
|
||||
|
||||
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)
|
||||
);
|
||||
}
|
||||
|
||||
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_AdrToString(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
|
||||
)
|
||||
{
|
||||
strings[0] = hostName;
|
||||
strings[1] = mapName;
|
||||
strings[2] = players;
|
||||
strings[3] = gameTypeString;
|
||||
strings[4] = ping;
|
||||
}
|
||||
|
||||
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(false);
|
||||
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 UIListBase::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,449 @@
|
||||
/*
|
||||
===========================================================================
|
||||
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);
|
||||
}
|
||||
|
||||
strcpy(mapBuffer, maplistVar->string);
|
||||
|
||||
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;
|
||||
|
||||
strcpy(mapName, filename);
|
||||
mapName[strlen(mapName) - 4] = 0;
|
||||
|
||||
if (!COM_IsMapValid(mapName)) {
|
||||
continue;
|
||||
}
|
||||
|
||||
if (bTugOfWar || bLiberation) {
|
||||
strcpy(tokenized, mapName);
|
||||
|
||||
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) {
|
||||
strcpy(tokenized, mapName);
|
||||
|
||||
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];
|
||||
|
||||
strcpy(mapName, filename);
|
||||
mapName[strlen(mapName) - 4] = 0;
|
||||
strcpy(tokenized, mapName);
|
||||
|
||||
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];
|
||||
|
||||
strcpy(mapName, filename);
|
||||
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();
|
||||
|
||||
for (i = 1; i <= rotationList->getNumItems(); i++) {
|
||||
str text = rotationList->getItemText(i);
|
||||
|
||||
mapLength += text.length();
|
||||
}
|
||||
|
||||
if (item) {
|
||||
str text = mapList->getItemText(item);
|
||||
|
||||
if (prefixLength + mapLength + text.length() < 256) {
|
||||
rotationList->AddItem(text, 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;
|
||||
|
||||
strcpy(map, text);
|
||||
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;
|
||||
maplistStr += " ";
|
||||
|
||||
if (i == 1) {
|
||||
Cvar_Set("ui_dmmap", 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 < list->getNumItems() && list->getNumItems() > 1) {
|
||||
str text = list->getItemText(item + 1);
|
||||
|
||||
list->DeleteItem(list->getCurrentItem() - 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(list->getCurrentItem() + 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(); 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,167 @@
|
||||
/*
|
||||
===========================================================================
|
||||
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;
|
||||
float origin[2], axis[2];
|
||||
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++) {
|
||||
float delta[2];
|
||||
float newOrg[2];
|
||||
float screenOrg[2];
|
||||
float length;
|
||||
|
||||
radar = &g_radarClients[i];
|
||||
if (i == g_radarClientNum) {
|
||||
continue;
|
||||
}
|
||||
|
||||
if (!g_radarClients[i].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;
|
||||
}
|
||||
}
|
||||
|
||||
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] = -(delta[0] * axis[0] + delta[1] * axis[1]) * inv * (1.f / length);
|
||||
newOrg[1] = (delta[0] * axis[1] + delta[1] * -axis[0]) * inv * (1.f / length);
|
||||
}
|
||||
|
||||
screenOrg[0] = -((halfScale * (1.141f * newOrg[1] + m_vVirtualScale[0])) - ((1.f + newOrg[1]) * 0.5f * m_frame.size.width));
|
||||
screenOrg[1] = -((halfScale * (1.141f * newOrg[0] + m_vVirtualScale[1])) - ((1.f + newOrg[0]) * 0.5f * m_frame.size.height));
|
||||
|
||||
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]
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -0,0 +1,40 @@
|
||||
/*
|
||||
===========================================================================
|
||||
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
|
||||
===========================================================================
|
||||
*/
|
||||
|
||||
#include "../uilib/uiwidget.h"
|
||||
#include "../cgame/cg_public.h"
|
||||
|
||||
class UIRadar : public UIWidget {
|
||||
public:
|
||||
CLASS_PROTOTYPE(UIRadar);
|
||||
|
||||
public:
|
||||
UIRadar();
|
||||
~UIRadar();
|
||||
|
||||
void Draw(void) override;
|
||||
|
||||
private:
|
||||
float m_fRadius;
|
||||
};
|
||||
|
||||
void CL_InitRadar(radarClient_t* radars, qhandle_t* shaders, int clientNum);
|
||||
+1144
-16
File diff suppressed because it is too large.
Load diff
@@ -20,20 +20,19 @@ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
===========================================================================
|
||||
*/
|
||||
|
||||
#ifndef __CL_UISERVERLIST_H__
|
||||
#define __CL_UISERVERLIST_H__
|
||||
#pragma once
|
||||
|
||||
class UIFAKKServerList : public UIListCtrl {
|
||||
protected:
|
||||
// need a new struct instead of gamespy
|
||||
void *m_serverList;
|
||||
struct GServerListImplementation *m_serverList[2];
|
||||
bool m_bHasList;
|
||||
bool m_bLANListing;
|
||||
|
||||
public:
|
||||
CLASS_PROTOTYPE( UIFAKKServerList );
|
||||
|
||||
bool m_bGettingList;
|
||||
bool m_bGettingList[2];
|
||||
bool m_bUpdatingList;
|
||||
|
||||
protected:
|
||||
@@ -54,5 +53,3 @@ public:
|
||||
void Draw( void ) override;
|
||||
void SortByColumn( int column ) override;
|
||||
};
|
||||
|
||||
#endif /* __CL_UISERVERLIST_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,22 +22,42 @@ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
|
||||
#include "cl_ui.h"
|
||||
|
||||
CLASS_DECLARATION( FilePickerClass, SoundPickerClass, NULL )
|
||||
{
|
||||
{ NULL, NULL }
|
||||
CLASS_DECLARATION(FilePickerClass, SoundPickerClass, NULL) {
|
||||
{NULL, NULL}
|
||||
};
|
||||
|
||||
SoundPickerClass::SoundPickerClass()
|
||||
{
|
||||
// FIXME: stub
|
||||
str soundpath;
|
||||
str currentpath;
|
||||
const char *varValue;
|
||||
int i;
|
||||
|
||||
soundpath = "sound";
|
||||
|
||||
varValue = UI_GetCvarString("ui_pickedsound", NULL);
|
||||
if (varValue && *varValue) {
|
||||
currentpath = varValue;
|
||||
|
||||
for (i = currentpath.length(); i > 0; i--) {
|
||||
if (currentpath[i] == '/') {
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
currentpath = str(currentpath, 0, i + 1);
|
||||
} else {
|
||||
currentpath = soundpath;
|
||||
}
|
||||
}
|
||||
|
||||
void SoundPickerClass::FileSelected( str ¤tDirectory, str &partialName, str &fullname )
|
||||
void SoundPickerClass::FileSelected(const str& currentDirectory, const str& partialName, const str& fullname)
|
||||
{
|
||||
|
||||
uii.Snd_PlaySound(fullname);
|
||||
}
|
||||
|
||||
void SoundPickerClass::FileChosen( str ¤tDirectory, str &partialName, str &fullname )
|
||||
void SoundPickerClass::FileChosen(const str& currentDirectory, const str& partialName, const str& fullname)
|
||||
{
|
||||
|
||||
uii.Cvar_Set("ui_pickedsound", fullname);
|
||||
CloseWindow();
|
||||
}
|
||||
@@ -1,6 +1,6 @@
|
||||
/*
|
||||
===========================================================================
|
||||
Copyright (C) 2015 the OpenMoHAA team
|
||||
Copyright (C) 2023 the OpenMoHAA team
|
||||
|
||||
This file is part of OpenMoHAA source code.
|
||||
|
||||
@@ -20,17 +20,15 @@ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
===========================================================================
|
||||
*/
|
||||
|
||||
#ifndef __CL_UISOUNDPICKER_H__
|
||||
#define __CL_UISOUNDPICKER_H__
|
||||
#pragma once
|
||||
|
||||
class SoundPickerClass : public FilePickerClass {
|
||||
class SoundPickerClass : public FilePickerClass
|
||||
{
|
||||
public:
|
||||
CLASS_PROTOTYPE( SoundPickerClass );
|
||||
CLASS_PROTOTYPE(SoundPickerClass);
|
||||
|
||||
SoundPickerClass();
|
||||
SoundPickerClass();
|
||||
|
||||
void FileSelected( str ¤tDirectory, str &partialName, str &fullname ) override;
|
||||
void FileChosen( str ¤tDirectory, str &partialName, str &fullname ) override;
|
||||
void FileSelected(const str& currentDirectory, const str& partialName, const str& fullname) override;
|
||||
void FileChosen(const str& currentDirectory, const str& partialName, const str& fullname) override;
|
||||
};
|
||||
|
||||
#endif /* __CL_UISOUNDPICKER_H__ */
|
||||
+1373
-915
File diff suppressed because it is too large.
Load diff
+73
-70
@@ -20,85 +20,88 @@ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
===========================================================================
|
||||
*/
|
||||
|
||||
#ifndef __CL_UISTD_H__
|
||||
#define __CL_UISTD_H__
|
||||
#pragma once
|
||||
|
||||
typedef enum {
|
||||
L_STATBAR_NONE,
|
||||
L_STATBAR_HORIZONTAL,
|
||||
L_STATBAR_VERTICAL,
|
||||
L_STATBAR_VERTICAL_REVERSE,
|
||||
L_STATBAR_VERTICAL_STAGGER_EVEN,
|
||||
L_STATBAR_VERTICAL_STAGGER_ODD,
|
||||
L_STATBAR_CIRCULAR,
|
||||
L_STATBAR_NEEDLE,
|
||||
L_STATBAR_ROTATOR,
|
||||
L_STATBAR_COMPASS,
|
||||
L_STATBAR_SPINNER,
|
||||
L_STATBAR_HEADING_SPINNER
|
||||
L_STATBAR_NONE,
|
||||
L_STATBAR_HORIZONTAL,
|
||||
L_STATBAR_VERTICAL,
|
||||
L_STATBAR_VERTICAL_REVERSE,
|
||||
L_STATBAR_VERTICAL_STAGGER_EVEN,
|
||||
L_STATBAR_VERTICAL_STAGGER_ODD,
|
||||
L_STATBAR_CIRCULAR,
|
||||
L_STATBAR_NEEDLE,
|
||||
L_STATBAR_ROTATOR,
|
||||
L_STATBAR_COMPASS,
|
||||
L_STATBAR_SPINNER,
|
||||
L_STATBAR_HEADING_SPINNER
|
||||
} statbar_orientation_t;
|
||||
|
||||
class UIFakkLabel : public UILabel {
|
||||
extern Event EV_ClearInvItemReference;
|
||||
|
||||
class UIFakkLabel : public UILabel
|
||||
{
|
||||
protected:
|
||||
SafePtr<inventory_item_t> m_lastitem;
|
||||
int m_lastitemindex;
|
||||
int m_stat;
|
||||
int m_stat_configstring;
|
||||
int m_maxstat;
|
||||
int m_itemindex;
|
||||
int m_inventoryrendermodelindex;
|
||||
str m_sDrawModelName;
|
||||
qboolean m_rendermodel;
|
||||
statbar_orientation_t m_statbar_or;
|
||||
float m_statbar_min;
|
||||
float m_statbar_max;
|
||||
float m_lastfrac;
|
||||
float m_flashtime;
|
||||
vec3_t m_offset;
|
||||
vec3_t m_rotateoffset;
|
||||
vec3_t m_angles;
|
||||
float m_scale;
|
||||
str m_anim;
|
||||
UIReggedMaterial *m_statbar_material;
|
||||
UIReggedMaterial *m_statbar_material_flash;
|
||||
SafePtr<inventory_item_t> m_lastitem;
|
||||
int m_lastitemindex;
|
||||
int m_stat;
|
||||
int m_stat_alpha;
|
||||
int m_stat_configstring;
|
||||
int m_maxstat;
|
||||
int m_itemindex;
|
||||
int m_inventoryrendermodelindex;
|
||||
str m_sDrawModelName;
|
||||
qboolean m_rendermodel;
|
||||
statbar_orientation_t m_statbar_or;
|
||||
float m_statbar_min;
|
||||
float m_statbar_max;
|
||||
float m_lastfrac;
|
||||
float m_flashtime;
|
||||
vec3_t m_offset;
|
||||
vec3_t m_rotateoffset;
|
||||
vec3_t m_angles;
|
||||
float m_scale;
|
||||
str m_anim;
|
||||
UIReggedMaterial *m_statbar_material;
|
||||
UIReggedMaterial *m_statbar_material_flash;
|
||||
UIReggedMaterial *m_statbar_material_marker;
|
||||
|
||||
public:
|
||||
CLASS_PROTOTYPE( UIFakkLabel );
|
||||
CLASS_PROTOTYPE(UIFakkLabel);
|
||||
|
||||
UIFakkLabel();
|
||||
UIFakkLabel();
|
||||
|
||||
void LayoutPlayerStat( Event *ev );
|
||||
void LayoutPlayerStatConfigstring( Event *ev );
|
||||
void LayoutMaxPlayerStat( Event *ev );
|
||||
void LayoutItemIndex( Event *ev );
|
||||
void InventoryRenderModelIndex( Event *ev );
|
||||
void LayoutModelName( Event *ev );
|
||||
void ClearInvItemReference( Event *ev );
|
||||
void LayoutStatbar( Event *ev );
|
||||
void LayoutStatbarShader( Event *ev );
|
||||
void LayoutStatbarTileShader( Event *ev );
|
||||
void LayoutStatbarShader_Flash( Event *ev );
|
||||
void LayoutStatbarEndAngles( Event *ev );
|
||||
void LayoutStatbarNeedleWidth( Event *ev );
|
||||
void LayoutStatbarRotatorSize( Event *ev );
|
||||
void LayoutStatbarTileShader_Flash( Event *ev );
|
||||
void LayoutRenderModel( Event *ev );
|
||||
void LayoutRenderModelOffset( Event *ev );
|
||||
void LayoutRenderModelRotateOffset( Event *ev );
|
||||
void LayoutRenderModelAngles( Event *ev );
|
||||
void LayoutRenderModelScale( Event *ev );
|
||||
void LayoutRenderModelAnim( Event *ev );
|
||||
void LayoutPlayerStat(Event *ev);
|
||||
void LayoutPlayerStatAlpha(Event *ev); // Added in 2.0
|
||||
void LayoutPlayerStatConfigstring(Event *ev);
|
||||
void LayoutMaxPlayerStat(Event *ev);
|
||||
void LayoutItemIndex(Event *ev);
|
||||
void InventoryRenderModelIndex(Event *ev);
|
||||
void LayoutModelName(Event *ev);
|
||||
void ClearInvItemReference(Event *ev);
|
||||
void LayoutStatbar(Event *ev);
|
||||
void LayoutStatbarShader(Event *ev);
|
||||
void LayoutStatbarTileShader(Event *ev);
|
||||
void LayoutStatbarShader_Flash(Event *ev);
|
||||
void LayoutStatbarShader_Marker(Event *ev); // Added in 2.0
|
||||
void LayoutStatbarEndAngles(Event *ev);
|
||||
void LayoutStatbarNeedleWidth(Event *ev);
|
||||
void LayoutStatbarRotatorSize(Event *ev);
|
||||
void LayoutStatbarTileShader_Flash(Event *ev);
|
||||
void LayoutRenderModel(Event *ev);
|
||||
void LayoutRenderModelOffset(Event *ev);
|
||||
void LayoutRenderModelRotateOffset(Event *ev);
|
||||
void LayoutRenderModelAngles(Event *ev);
|
||||
void LayoutRenderModelScale(Event *ev);
|
||||
void LayoutRenderModelAnim(Event *ev);
|
||||
|
||||
void DrawStatbar( float frac );
|
||||
void DrawStatCircle( float frac );
|
||||
void DrawStatNeedle( float frac );
|
||||
void DrawStatRotator( float frac );
|
||||
void DrawStatCompass( float frac );
|
||||
void DrawStatSpinner( float frac );
|
||||
void StatCircleTexCoord( float fAng, vec3_t vTexCoord );
|
||||
void DrawStatbar(float frac);
|
||||
void DrawStatCircle(float frac);
|
||||
void DrawStatNeedle(float frac);
|
||||
void DrawStatRotator(float frac);
|
||||
void DrawStatCompass(float frac);
|
||||
void DrawStatSpinner(float frac);
|
||||
void StatCircleTexCoord(float fAng, vec3_t vTexCoord);
|
||||
|
||||
void Draw( void ) override;
|
||||
void Draw(void) override;
|
||||
};
|
||||
|
||||
#endif
|
||||
|
||||
+508
-290
@@ -21,355 +21,573 @@ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
*/
|
||||
|
||||
#include "cl_ui.h"
|
||||
#include "../qcommon/localization.h"
|
||||
|
||||
CLASS_DECLARATION( UIWidget, View3D, NULL )
|
||||
{
|
||||
{ &W_Activated, &View3D::OnActivate },
|
||||
{ &W_Deactivated, &View3D::OnDeactivate },
|
||||
{ &W_LeftMouseDown, &View3D::Pressed },
|
||||
{ NULL, NULL }
|
||||
CLASS_DECLARATION(UIWidget, View3D, NULL) {
|
||||
{&W_Activated, &View3D::OnActivate },
|
||||
{&W_Deactivated, &View3D::OnDeactivate},
|
||||
{&W_LeftMouseDown, &View3D::Pressed },
|
||||
{NULL, NULL }
|
||||
};
|
||||
|
||||
cvar_t *subs[MAX_SUBTITLES];
|
||||
cvar_t *teams[MAX_SUBTITLES];
|
||||
float fadeTime[MAX_SUBTITLES];
|
||||
float subLife[MAX_SUBTITLES];
|
||||
float alpha[MAX_SUBTITLES];
|
||||
char oldStrings[MAX_SUBTITLES][2048];
|
||||
|
||||
View3D::View3D()
|
||||
{
|
||||
// set as transparent
|
||||
setBackgroundColor(UClear, true);
|
||||
// no border
|
||||
setBorderStyle(border_none);
|
||||
AllowActivate(true);
|
||||
// set as transparent
|
||||
setBackgroundColor(UClear, true);
|
||||
// no border
|
||||
setBorderStyle(border_none);
|
||||
AllowActivate(true);
|
||||
|
||||
m_printfadetime = 0.0;
|
||||
m_print_mat = NULL;
|
||||
m_locationprint = qfalse;
|
||||
m_printfadetime = 0.0;
|
||||
m_print_mat = NULL;
|
||||
m_locationprint = qfalse;
|
||||
}
|
||||
|
||||
void View3D::Draw
|
||||
(
|
||||
void
|
||||
)
|
||||
|
||||
void View3D::UpdateLocationPrint(int x, int y, const char *s, float alpha)
|
||||
{
|
||||
if (clc.state != CA_DISCONNECTED) {
|
||||
SCR_DrawScreenField();
|
||||
}
|
||||
|
||||
set2D();
|
||||
|
||||
re.SavePerformanceCounters();
|
||||
|
||||
Draw2D();
|
||||
m_printstring = s;
|
||||
m_printalpha = alpha;
|
||||
m_printfadetime = 4000.0;
|
||||
m_x_coord = x;
|
||||
m_y_coord = y;
|
||||
m_locationprint = qtrue;
|
||||
}
|
||||
|
||||
void View3D::DrawLetterbox
|
||||
(
|
||||
void
|
||||
)
|
||||
|
||||
void View3D::UpdateCenterPrint(const char *s, float alpha)
|
||||
{
|
||||
// FIXME: stub
|
||||
m_printstring = s;
|
||||
|
||||
if (s[0] == '@') {
|
||||
m_print_mat = uWinMan.RegisterShader(s + 1);
|
||||
} else {
|
||||
m_print_mat = NULL;
|
||||
}
|
||||
|
||||
m_printalpha = alpha;
|
||||
m_printfadetime = 4000.0;
|
||||
m_locationprint = qfalse;
|
||||
}
|
||||
|
||||
void View3D::DrawFades
|
||||
(
|
||||
void
|
||||
)
|
||||
|
||||
void View3D::PrintSound(int channel, const char *name, float vol, int rvol, float pitch, float base, int& line)
|
||||
{
|
||||
// FIXME: stub
|
||||
char buf[255];
|
||||
float x;
|
||||
float xStep;
|
||||
float height;
|
||||
|
||||
height = m_font->getHeight(false);
|
||||
xStep = height;
|
||||
|
||||
x = 0;
|
||||
sprintf(buf, "%d", channel);
|
||||
m_font->Print(x, height * line + m_frame.pos.y, buf, -1, false);
|
||||
|
||||
x += xStep + xStep;
|
||||
sprintf(buf, "%s", name);
|
||||
m_font->Print(x, height * line + m_frame.pos.y, buf, -1, false);
|
||||
|
||||
x += xStep * 30.0;
|
||||
sprintf(buf, "vol:%.2f", vol);
|
||||
m_font->Print(x, height * line + m_frame.pos.y, buf, -1, false);
|
||||
|
||||
x += xStep * 8;
|
||||
sprintf(buf, "rvol:%.2f", (float)(rvol / 128.f));
|
||||
m_font->Print(x, height * line + m_frame.pos.y, buf, -1, false);
|
||||
|
||||
x += xStep * 5;
|
||||
sprintf(buf, "pit:%.2f", pitch);
|
||||
m_font->Print(x, height * line + m_frame.pos.y, buf, -1, false);
|
||||
|
||||
x += xStep * 5;
|
||||
sprintf(buf, "base:%d", (int)base);
|
||||
m_font->Print(x, height * line + m_frame.pos.y, buf, -1, false);
|
||||
|
||||
line++;
|
||||
}
|
||||
|
||||
void View3D::Draw2D
|
||||
(
|
||||
void
|
||||
)
|
||||
|
||||
void View3D::Pressed(Event *ev)
|
||||
{
|
||||
if (!cls.no_menus) {
|
||||
DrawFades();
|
||||
}
|
||||
|
||||
DrawLetterbox();
|
||||
|
||||
if ((cl_debuggraph->integer || cl_timegraph->integer) && !cls.no_menus)
|
||||
{
|
||||
SCR_DrawDebugGraph();
|
||||
}
|
||||
else if (!cls.no_menus)
|
||||
{
|
||||
if (cge) {
|
||||
cge->CG_Draw2D();
|
||||
}
|
||||
|
||||
if (m_locationprint) {
|
||||
LocationPrint();
|
||||
} else {
|
||||
CenterPrint();
|
||||
}
|
||||
|
||||
if (!cls.no_menus)
|
||||
{
|
||||
DrawSoundOverlay();
|
||||
DrawSubtitleOverlay();
|
||||
}
|
||||
}
|
||||
|
||||
if (fps->integer && !cls.no_menus)
|
||||
{
|
||||
DrawFPS();
|
||||
DrawProf();
|
||||
}
|
||||
IN_MouseOff();
|
||||
OnActivate(ev);
|
||||
}
|
||||
|
||||
void View3D::DrawFPS
|
||||
(
|
||||
void
|
||||
)
|
||||
|
||||
void View3D::OnDeactivate(Event *ev)
|
||||
{
|
||||
char string[128];
|
||||
|
||||
setFont("verdana-14");
|
||||
if (fps->integer == 2)
|
||||
{
|
||||
re.SetColor(UBlack);
|
||||
re.DrawBox(
|
||||
0.0,
|
||||
m_frame.pos.y + m_frame.size.height - m_font->getHeight(qfalse) * 4.0,
|
||||
m_frame.pos.x + m_frame.size.width,
|
||||
m_font->getHeight(qfalse) * 4.0
|
||||
);
|
||||
}
|
||||
|
||||
sprintf(string, "FPS %4.1f", currentfps);
|
||||
if (currentfps > 23.94) {
|
||||
if (cl_greenfps->integer) {
|
||||
m_font->setColor(UGreen);
|
||||
} else {
|
||||
m_font->setColor(UWhite);
|
||||
}
|
||||
} else if (currentfps > 18.0) {
|
||||
m_font->setColor(UYellow);
|
||||
} else {
|
||||
// low fps
|
||||
m_font->setColor(URed);
|
||||
}
|
||||
|
||||
m_font->Print(
|
||||
m_font->getHeight(qfalse) * 10.0,
|
||||
m_frame.pos.y + m_frame.size.height - m_font->getHeight(qfalse) * 3.0,
|
||||
string,
|
||||
-1,
|
||||
qfalse
|
||||
);
|
||||
|
||||
// Draw elements count
|
||||
if (cl_greenfps->integer) {
|
||||
m_font->setColor(UGreen);
|
||||
}
|
||||
else {
|
||||
m_font->setColor(UWhite);
|
||||
}
|
||||
|
||||
sprintf(string, "wt%5d wv%5d cl%d", cls.world_tris, cls.world_verts, cls.character_lights);
|
||||
|
||||
m_font->Print(
|
||||
m_font->getHeight(qfalse) * 10.0,
|
||||
m_frame.pos.y + m_frame.size.height - m_font->getHeight(qfalse) * 2.0,
|
||||
string,
|
||||
-1,
|
||||
qfalse
|
||||
);
|
||||
|
||||
sprintf(string, "t%5d v%5d Mtex%5.2f", cls.total_tris, cls.total_verts, (float)cls.total_texels * 0.00000095367432);
|
||||
|
||||
|
||||
m_font->Print(
|
||||
m_font->getHeight(qfalse) * 10.0,
|
||||
m_frame.pos.y + m_frame.size.height - m_font->getHeight(qfalse),
|
||||
string,
|
||||
-1,
|
||||
qfalse
|
||||
);
|
||||
|
||||
m_font->setColor(UBlack);
|
||||
cls.keyCatchers |= KEYCATCH_UI;
|
||||
}
|
||||
|
||||
void View3D::DrawProf
|
||||
(
|
||||
void
|
||||
)
|
||||
|
||||
void View3D::OnActivate(Event *ev)
|
||||
{
|
||||
// FIXME: stub
|
||||
}
|
||||
|
||||
void View3D::PrintSound
|
||||
(
|
||||
int channel,
|
||||
const char *name,
|
||||
float vol,
|
||||
int rvol,
|
||||
float pitch,
|
||||
float base,
|
||||
int& line
|
||||
)
|
||||
|
||||
{
|
||||
// FIXME: stub
|
||||
}
|
||||
|
||||
void View3D::DrawSoundOverlay
|
||||
(
|
||||
void
|
||||
)
|
||||
|
||||
{
|
||||
// FIXME: stub
|
||||
}
|
||||
|
||||
void View3D::CenterPrint
|
||||
(
|
||||
void
|
||||
)
|
||||
|
||||
{
|
||||
// FIXME: stub
|
||||
}
|
||||
|
||||
void View3D::LocationPrint
|
||||
(
|
||||
void
|
||||
)
|
||||
|
||||
{
|
||||
// FIXME: stub
|
||||
}
|
||||
|
||||
void View3D::OnActivate
|
||||
(
|
||||
Event *ev
|
||||
)
|
||||
|
||||
{
|
||||
UIWidget* wid;
|
||||
UList<UIWidget*> widgets;
|
||||
UIWidget *wid;
|
||||
UList<UIWidget *> widgets;
|
||||
|
||||
UI_CloseInventory();
|
||||
cls.keyCatchers &= ~KEYCATCH_UI;
|
||||
|
||||
for (wid = getParent()->getFirstChild(); wid; wid = getParent()->getNextChild(wid))
|
||||
{
|
||||
if (wid->getAlwaysOnBottom() && wid != this) {
|
||||
widgets.AddTail(wid);
|
||||
}
|
||||
}
|
||||
for (wid = getParent()->getFirstChild(); wid; wid = getParent()->getNextChild(wid)) {
|
||||
if (wid->getAlwaysOnBottom() && wid != this) {
|
||||
widgets.AddTail(wid);
|
||||
}
|
||||
}
|
||||
|
||||
widgets.IterateFromHead();
|
||||
while (widgets.IsCurrentValid())
|
||||
{
|
||||
widgets.getCurrent()->BringToFrontPropogated();
|
||||
widgets.IterateNext();
|
||||
}
|
||||
widgets.IterateFromHead();
|
||||
while (widgets.IsCurrentValid()) {
|
||||
widgets.getCurrent()->BringToFrontPropogated();
|
||||
widgets.IterateNext();
|
||||
}
|
||||
}
|
||||
|
||||
void View3D::OnDeactivate
|
||||
(
|
||||
Event *ev
|
||||
)
|
||||
|
||||
void View3D::LocationPrint(void)
|
||||
{
|
||||
cls.keyCatchers |= KEYCATCH_UI;
|
||||
fonthorzjustify_t horiz;
|
||||
fontvertjustify_t vert;
|
||||
int x, y;
|
||||
const char *p;
|
||||
float alpha;
|
||||
UIRect2D frame;
|
||||
|
||||
if (!m_printfadetime) {
|
||||
m_locationprint = false;
|
||||
return;
|
||||
}
|
||||
|
||||
horiz = FONT_JUSTHORZ_LEFT;
|
||||
vert = FONT_JUSTVERT_TOP;
|
||||
|
||||
p = Sys_LV_CL_ConvertString(m_printstring);
|
||||
if (m_printfadetime > 3250) {
|
||||
alpha = 1.f - (m_printfadetime - 3250.f) / 750.f * m_printalpha;
|
||||
} else if (m_printfadetime >= 750) {
|
||||
alpha = 1.f;
|
||||
} else {
|
||||
alpha = m_printfadetime / 750.f * m_printalpha;
|
||||
}
|
||||
|
||||
alpha = Q_clamp_float(alpha, 0, 1);
|
||||
|
||||
x = m_x_coord / 640.f * m_screenframe.size.width;
|
||||
y = (480 - m_font->getHeight(false) - m_y_coord) / 480.f * m_screenframe.size.height;
|
||||
|
||||
if (m_x_coord == -1) {
|
||||
horiz = FONT_JUSTHORZ_CENTER;
|
||||
x = 0;
|
||||
}
|
||||
if (m_y_coord == -1) {
|
||||
vert = FONT_JUSTVERT_CENTER;
|
||||
y = 0;
|
||||
}
|
||||
|
||||
m_font->setColor(UColor(0, 0, 0, alpha));
|
||||
frame = getClientFrame();
|
||||
|
||||
m_font->PrintJustified(
|
||||
UIRect2D(frame.pos.x + x + 1, frame.pos.y + y + 1, frame.size.width, frame.size.height),
|
||||
horiz,
|
||||
vert,
|
||||
p,
|
||||
m_bVirtual ? m_vVirtualScale : NULL
|
||||
);
|
||||
|
||||
m_font->setColor(UColor(1, 1, 1, alpha));
|
||||
frame = getClientFrame();
|
||||
|
||||
m_font->PrintJustified(
|
||||
UIRect2D(frame.pos.x + x, frame.pos.y + y, frame.size.width, frame.size.height),
|
||||
horiz,
|
||||
vert,
|
||||
p,
|
||||
m_bVirtual ? m_vVirtualScale : NULL
|
||||
);
|
||||
|
||||
m_font->setColor(UBlack);
|
||||
m_printfadetime -= cls.frametime;
|
||||
|
||||
if (m_printfadetime < 0) {
|
||||
m_printfadetime = 0;
|
||||
}
|
||||
}
|
||||
|
||||
void View3D::DrawSubtitleOverlay
|
||||
(
|
||||
void
|
||||
)
|
||||
|
||||
qboolean View3D::LetterboxActive(void)
|
||||
{
|
||||
// FIXME: stub
|
||||
return m_letterbox_active;
|
||||
}
|
||||
|
||||
void View3D::ClearCenterPrint
|
||||
(
|
||||
void
|
||||
)
|
||||
float avWidth = 0.0;
|
||||
|
||||
void View3D::InitSubtitle(void)
|
||||
{
|
||||
// FIXME: stub
|
||||
float totalWidth;
|
||||
|
||||
for (int i = 0; i < 4; i++) {
|
||||
subs[i] = Cvar_Get(va("subtitle%d", i), "", 0);
|
||||
teams[i] = Cvar_Get(va("subteam%d", i), "0", 0);
|
||||
strcpy(oldStrings[i], subs[i]->string);
|
||||
fadeTime[i] = 4000.0;
|
||||
subLife[i] = 4000.0;
|
||||
}
|
||||
|
||||
totalWidth = 0.0;
|
||||
for (char j = 'A'; j <= 'Z'; j++) {
|
||||
totalWidth += m_font->getCharWidth(j);
|
||||
}
|
||||
|
||||
avWidth = totalWidth / 26.0;
|
||||
}
|
||||
|
||||
void View3D::UpdateCenterPrint
|
||||
(
|
||||
const char *s,
|
||||
float alpha
|
||||
)
|
||||
|
||||
void View3D::FrameInitialized(void)
|
||||
{
|
||||
// FIXME: stub
|
||||
Connect(this, W_Activated, W_Activated);
|
||||
Connect(this, W_Deactivated, W_Deactivated);
|
||||
}
|
||||
|
||||
void View3D::UpdateLocationPrint
|
||||
(
|
||||
int x,
|
||||
int y,
|
||||
const char *s,
|
||||
float alpha
|
||||
)
|
||||
|
||||
void View3D::DrawSubtitleOverlay(void)
|
||||
{
|
||||
// FIXME: stub
|
||||
cvar_t *subAlpha;
|
||||
int i;
|
||||
float minX, maxY;
|
||||
int line;
|
||||
|
||||
subAlpha = Cvar_Get("subAlpha", "0.5", 0);
|
||||
|
||||
setFont("facfont-20");
|
||||
m_font->setColor(URed);
|
||||
|
||||
for (i = 0; i < MAX_SUBTITLES; i++) {
|
||||
if (strcmp(oldStrings[i], subs[i]->string)) {
|
||||
fadeTime[i] = 2500 * ((strlen(subs[i]->string) / 68) + 1.f) + 1500;
|
||||
subLife[i] = fadeTime[i];
|
||||
Q_strncpyz(oldStrings[i], subs[i]->string, sizeof(oldStrings[i]));
|
||||
}
|
||||
|
||||
if (fadeTime[i] > subLife[i] - 750.f) {
|
||||
alpha[i] = 1.f - (fadeTime[i] - (subLife[i] - 750.f)) / 750.f;
|
||||
} else if (fadeTime[i] < 750) {
|
||||
alpha[i] = fadeTime[i] / 750.f;
|
||||
} else {
|
||||
alpha[i] = 1.f;
|
||||
}
|
||||
|
||||
fadeTime[i] -= cls.frametime;
|
||||
if (fadeTime[i] < 0) {
|
||||
// Clear the subtitle
|
||||
fadeTime[i] = 0;
|
||||
oldStrings[i][0] = 0;
|
||||
Cvar_Set(va("subtitle%d", i), "");
|
||||
}
|
||||
}
|
||||
|
||||
minX = m_screenframe.size.height - m_font->getHeight(false) * 10;
|
||||
maxY = (m_frame.pos.x + m_frame.size.width) - (m_frame.pos.x + m_frame.size.width) * 0.2f;
|
||||
line = 0;
|
||||
|
||||
for (i = 0; i < MAX_SUBTITLES; i++) {
|
||||
if (m_font->getWidth(subs[i]->string, sizeof(oldStrings[i])) > maxY) {
|
||||
char buf[2048];
|
||||
char *c;
|
||||
char *end;
|
||||
char *start;
|
||||
float total;
|
||||
int blockcount;
|
||||
|
||||
c = buf;
|
||||
strcpy(buf, subs[i]->string);
|
||||
|
||||
total = 0;
|
||||
end = NULL;
|
||||
start = buf;
|
||||
while (*c) {
|
||||
blockcount = m_font->DBCSGetWordBlockCount(c, -1);
|
||||
if (!blockcount) {
|
||||
break;
|
||||
}
|
||||
|
||||
total += m_font->getWidth(c, blockcount);
|
||||
c += blockcount;
|
||||
|
||||
if (total > maxY) {
|
||||
total = 0;
|
||||
if (end < start) {
|
||||
Com_DPrintf("ERROR - word longer than possible line\n");
|
||||
break;
|
||||
}
|
||||
|
||||
m_font->setColor(UColor(0, 0, 0, alpha[i] * subAlpha->value));
|
||||
m_font->Print(18, m_font->getHeight(false) * line + minX + 1.f, start, -1, false);
|
||||
|
||||
m_font->setColor(UColor(1, 1, 1, alpha[i] * subAlpha->value));
|
||||
m_font->Print(20, m_font->getHeight(false) * line + minX, start, -1, false);
|
||||
|
||||
start = end + 1;
|
||||
c = end + 1;
|
||||
line++;
|
||||
}
|
||||
}
|
||||
|
||||
m_font->setColor(UColor(0, 0, 0, alpha[i] * subAlpha->value));
|
||||
m_font->Print(18, m_font->getHeight(false) * line + minX + 1.f, start, -1, qfalse);
|
||||
|
||||
m_font->setColor(UColor(1, 1, 1, alpha[i] * subAlpha->value));
|
||||
m_font->Print(20, m_font->getHeight(false) * line + minX, start, -1, qfalse);
|
||||
line++;
|
||||
} else {
|
||||
m_font->setColor(UColor(0, 0, 0, alpha[i] * subAlpha->value));
|
||||
m_font->Print(18, m_font->getHeight(false) * line + minX + 1.f, subs[i]->string, -1, qfalse);
|
||||
|
||||
m_font->setColor(UColor(1, 1, 1, alpha[i] * subAlpha->value));
|
||||
m_font->Print(20, m_font->getHeight(false) * line + minX, subs[i]->string, -1, qfalse);
|
||||
|
||||
line++;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
qboolean View3D::LetterboxActive
|
||||
(
|
||||
void
|
||||
)
|
||||
|
||||
void View3D::DrawSoundOverlay(void)
|
||||
{
|
||||
return m_letterbox_active;
|
||||
setFont("verdana-14");
|
||||
m_font->setColor(UWhite);
|
||||
|
||||
// FIXME: TODO
|
||||
if (sound_overlay->integer) {
|
||||
Com_Printf("sound_overlay isn't supported with OpenAL/SDL right now.\n");
|
||||
Cvar_Set("sound_overlay", "0");
|
||||
}
|
||||
}
|
||||
|
||||
void View3D::InitSubtitle
|
||||
(
|
||||
void
|
||||
)
|
||||
|
||||
void View3D::DrawProf(void)
|
||||
{
|
||||
// FIXME: stub
|
||||
// Normal empty function
|
||||
}
|
||||
|
||||
void View3D::FrameInitialized
|
||||
(
|
||||
void
|
||||
)
|
||||
|
||||
void View3D::DrawLetterbox(void)
|
||||
{
|
||||
Connect(this, W_Activated, W_Activated);
|
||||
Connect(this, W_Deactivated, W_Deactivated);
|
||||
float frac;
|
||||
vec4_t col;
|
||||
|
||||
col[0] = col[1] = col[2] = 0;
|
||||
col[3] = 1;
|
||||
|
||||
frac = cl.snap.ps.stats[STAT_LETTERBOX] / 32767.0;
|
||||
if (frac > 0.0) {
|
||||
m_letterbox_active = true;
|
||||
re.SetColor(col);
|
||||
|
||||
re.DrawBox(0.0, 0.0, m_screenframe.size.width, m_screenframe.size.height);
|
||||
re.DrawBox(
|
||||
0.0,
|
||||
m_screenframe.size.height - m_screenframe.size.height * frac,
|
||||
m_screenframe.size.width,
|
||||
m_screenframe.size.height
|
||||
);
|
||||
} else {
|
||||
m_letterbox_active = false;
|
||||
}
|
||||
}
|
||||
|
||||
void View3D::Pressed
|
||||
(
|
||||
Event *ev
|
||||
)
|
||||
|
||||
void View3D::DrawFades(void)
|
||||
{
|
||||
IN_MouseOff();
|
||||
OnActivate(ev);
|
||||
if (cl.snap.ps.blend[3] > 0) {
|
||||
re.SetColor(cl.snap.ps.blend);
|
||||
if (cl.snap.ps.stats[STAT_ADDFADE]) {
|
||||
re.AddBox(0.0, 0.0, m_screenframe.size.width, m_screenframe.size.height);
|
||||
} else {
|
||||
re.DrawBox(0.0, 0.0, m_screenframe.size.width, m_screenframe.size.height);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
CLASS_DECLARATION( UIWidget, ConsoleView, NULL )
|
||||
void View3D::DrawFPS(void)
|
||||
{
|
||||
{ NULL, NULL }
|
||||
char string[128];
|
||||
|
||||
setFont("verdana-14");
|
||||
if (fps->integer == 2) {
|
||||
re.SetColor(UBlack);
|
||||
re.DrawBox(
|
||||
0.0,
|
||||
m_frame.pos.y + m_frame.size.height - m_font->getHeight(qfalse) * 4.0,
|
||||
m_frame.pos.x + m_frame.size.width,
|
||||
m_font->getHeight(qfalse) * 4.0
|
||||
);
|
||||
}
|
||||
|
||||
sprintf(string, "FPS %4.1f", currentfps);
|
||||
if (currentfps > 23.94) {
|
||||
if (cl_greenfps->integer) {
|
||||
m_font->setColor(UGreen);
|
||||
} else {
|
||||
m_font->setColor(UWhite);
|
||||
}
|
||||
} else if (currentfps > 18.0) {
|
||||
m_font->setColor(UYellow);
|
||||
} else {
|
||||
// low fps
|
||||
m_font->setColor(URed);
|
||||
}
|
||||
|
||||
m_font->Print(
|
||||
m_font->getHeight(qfalse) * 10.0,
|
||||
m_frame.pos.y + m_frame.size.height - m_font->getHeight(qfalse) * 3.0,
|
||||
string,
|
||||
-1,
|
||||
qfalse
|
||||
);
|
||||
|
||||
// Draw elements count
|
||||
if (cl_greenfps->integer) {
|
||||
m_font->setColor(UGreen);
|
||||
} else {
|
||||
m_font->setColor(UWhite);
|
||||
}
|
||||
|
||||
sprintf(string, "wt%5d wv%5d cl%d", cls.world_tris, cls.world_verts, cls.character_lights);
|
||||
|
||||
m_font->Print(
|
||||
m_font->getHeight(qfalse) * 10.0,
|
||||
m_frame.pos.y + m_frame.size.height - m_font->getHeight(qfalse) * 2.0,
|
||||
string,
|
||||
-1,
|
||||
qfalse
|
||||
);
|
||||
|
||||
sprintf(string, "t%5d v%5d Mtex%5.2f", cls.total_tris, cls.total_verts, (float)cls.total_texels * 0.00000095367432);
|
||||
|
||||
m_font->Print(
|
||||
m_font->getHeight(qfalse) * 10.0,
|
||||
m_frame.pos.y + m_frame.size.height - m_font->getHeight(qfalse),
|
||||
string,
|
||||
-1,
|
||||
qfalse
|
||||
);
|
||||
|
||||
m_font->setColor(UBlack);
|
||||
}
|
||||
|
||||
void View3D::Draw2D(void)
|
||||
{
|
||||
if (!cls.no_menus) {
|
||||
DrawFades();
|
||||
}
|
||||
|
||||
DrawLetterbox();
|
||||
|
||||
if ((cl_debuggraph->integer || cl_timegraph->integer) && !cls.no_menus) {
|
||||
SCR_DrawDebugGraph();
|
||||
} else if (!cls.no_menus) {
|
||||
if (cge) {
|
||||
cge->CG_Draw2D();
|
||||
}
|
||||
|
||||
if (m_locationprint) {
|
||||
LocationPrint();
|
||||
} else {
|
||||
CenterPrint();
|
||||
}
|
||||
|
||||
if (!cls.no_menus) {
|
||||
DrawSoundOverlay();
|
||||
DrawSubtitleOverlay();
|
||||
}
|
||||
}
|
||||
|
||||
if (fps->integer && !cls.no_menus) {
|
||||
DrawFPS();
|
||||
DrawProf();
|
||||
}
|
||||
}
|
||||
|
||||
void View3D::Draw(void)
|
||||
{
|
||||
if (clc.state != CA_DISCONNECTED) {
|
||||
SCR_DrawScreenField();
|
||||
}
|
||||
|
||||
set2D();
|
||||
|
||||
re.SavePerformanceCounters();
|
||||
|
||||
Draw2D();
|
||||
}
|
||||
|
||||
void View3D::ClearCenterPrint(void)
|
||||
{
|
||||
m_printfadetime = 0.0;
|
||||
}
|
||||
|
||||
void View3D::CenterPrint(void)
|
||||
{
|
||||
float alpha;
|
||||
const char *p;
|
||||
qhandle_t mat;
|
||||
float x, y;
|
||||
float w, h;
|
||||
|
||||
if (!m_printfadetime) {
|
||||
return;
|
||||
}
|
||||
|
||||
p = Sys_LV_CL_ConvertString(m_printstring);
|
||||
if (m_printfadetime > 3250) {
|
||||
alpha = 1.f - (m_printfadetime - 3250.f) / 750.f * m_printalpha;
|
||||
} else if (m_printfadetime >= 750) {
|
||||
alpha = 1.f;
|
||||
} else {
|
||||
alpha = m_printfadetime / 750.f * m_printalpha;
|
||||
}
|
||||
|
||||
alpha = Q_clamp_float(alpha, 0, 1);
|
||||
|
||||
if (!m_print_mat) {
|
||||
UIRect2D frame;
|
||||
m_font->setColor(UColor(0, 0, 0, alpha));
|
||||
|
||||
frame = getClientFrame();
|
||||
|
||||
m_font->PrintJustified(
|
||||
UIRect2D(frame.pos.x + 1, frame.pos.y + 1, frame.size.width, frame.size.height),
|
||||
m_iFontAlignmentHorizontal,
|
||||
m_iFontAlignmentVertical,
|
||||
p,
|
||||
m_bVirtual ? m_vVirtualScale : NULL
|
||||
);
|
||||
|
||||
m_font->setColor(UColor(1, 1, 1, alpha));
|
||||
|
||||
frame = getClientFrame();
|
||||
|
||||
m_font->PrintJustified(
|
||||
frame, m_iFontAlignmentHorizontal, m_iFontAlignmentVertical, p, m_bVirtual ? m_vVirtualScale : NULL
|
||||
);
|
||||
|
||||
m_font->setColor(UBlack);
|
||||
} else if ((mat = m_print_mat->GetMaterial())) {
|
||||
vec4_t col {alpha, alpha, alpha, alpha};
|
||||
|
||||
re.SetColor(col);
|
||||
|
||||
w = re.GetShaderWidth(mat);
|
||||
h = re.GetShaderHeight(mat);
|
||||
x = (m_frame.pos.x + m_frame.size.width - w) * 0.5f;
|
||||
y = (m_frame.pos.y + m_frame.size.height - h) * 0.5f;
|
||||
|
||||
re.DrawStretchPic(x, y, w, h, 0, 0, 1, 1, mat);
|
||||
}
|
||||
|
||||
m_printfadetime -= cls.frametime;
|
||||
|
||||
if (m_printfadetime < 0) {
|
||||
m_printfadetime = 0;
|
||||
}
|
||||
}
|
||||
|
||||
CLASS_DECLARATION(UIWidget, ConsoleView, NULL) {
|
||||
{NULL, NULL}
|
||||
};
|
||||
|
||||
void ConsoleView::Draw
|
||||
(
|
||||
void
|
||||
)
|
||||
|
||||
{
|
||||
// FIXME: stub
|
||||
}
|
||||
|
||||
void ConsoleView::Draw(void) {}
|
||||
+37
-38
@@ -20,55 +20,54 @@ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
===========================================================================
|
||||
*/
|
||||
|
||||
#ifndef __CL_UIVIEW3D__
|
||||
#define __CL_UIVIEW3D__
|
||||
#pragma once
|
||||
|
||||
class View3D : public UIWidget {
|
||||
float m_printfadetime;
|
||||
float m_printalpha;
|
||||
str m_printstring;
|
||||
UIReggedMaterial *m_print_mat;
|
||||
qboolean m_locationprint;
|
||||
int m_x_coord;
|
||||
int m_y_coord;
|
||||
qboolean m_letterbox_active;
|
||||
class View3D : public UIWidget
|
||||
{
|
||||
float m_printfadetime;
|
||||
float m_printalpha;
|
||||
str m_printstring;
|
||||
UIReggedMaterial *m_print_mat;
|
||||
qboolean m_locationprint;
|
||||
int m_x_coord;
|
||||
int m_y_coord;
|
||||
qboolean m_letterbox_active;
|
||||
|
||||
public:
|
||||
CLASS_PROTOTYPE( View3D );
|
||||
CLASS_PROTOTYPE(View3D);
|
||||
|
||||
protected:
|
||||
void Draw( void ) override;
|
||||
void DrawLetterbox( void );
|
||||
void DrawFades( void );
|
||||
void Draw2D( void );
|
||||
void DrawFPS( void );
|
||||
void DrawProf( void );
|
||||
void PrintSound( int channel, const char *name, float vol, int rvol, float pitch, float base, int& line );
|
||||
void DrawSoundOverlay( void );
|
||||
void CenterPrint( void );
|
||||
void LocationPrint( void );
|
||||
void OnActivate( Event *ev );
|
||||
void OnDeactivate( Event *ev );
|
||||
void DrawSubtitleOverlay( void );
|
||||
void Draw(void) override;
|
||||
void DrawLetterbox(void);
|
||||
void DrawFades(void);
|
||||
void Draw2D(void);
|
||||
void DrawFPS(void);
|
||||
void DrawProf(void);
|
||||
void PrintSound(int channel, const char *name, float vol, int rvol, float pitch, float base, int& line);
|
||||
void DrawSoundOverlay(void);
|
||||
void CenterPrint(void);
|
||||
void LocationPrint(void);
|
||||
void OnActivate(Event *ev);
|
||||
void OnDeactivate(Event *ev);
|
||||
void DrawSubtitleOverlay(void);
|
||||
|
||||
public:
|
||||
View3D();
|
||||
View3D();
|
||||
|
||||
void ClearCenterPrint( void );
|
||||
void UpdateCenterPrint( const char *s, float alpha );
|
||||
void UpdateLocationPrint( int x, int y, const char *s, float alpha );
|
||||
qboolean LetterboxActive( void );
|
||||
void InitSubtitle( void );
|
||||
void FrameInitialized( void ) override;
|
||||
virtual void Pressed( Event *ev );
|
||||
void ClearCenterPrint(void);
|
||||
void UpdateCenterPrint(const char *s, float alpha);
|
||||
void UpdateLocationPrint(int x, int y, const char *s, float alpha);
|
||||
qboolean LetterboxActive(void);
|
||||
void InitSubtitle(void);
|
||||
void FrameInitialized(void) override;
|
||||
virtual void Pressed(Event *ev);
|
||||
};
|
||||
|
||||
class ConsoleView : public UIWidget {
|
||||
class ConsoleView : public UIWidget
|
||||
{
|
||||
public:
|
||||
CLASS_PROTOTYPE( ConsoleView );
|
||||
CLASS_PROTOTYPE(ConsoleView);
|
||||
|
||||
protected:
|
||||
void Draw( void ) override;
|
||||
void Draw(void) override;
|
||||
};
|
||||
|
||||
#endif /* __CL_UIVIEW3D__ */
|
||||
+11
-13
@@ -21,8 +21,7 @@ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
*/
|
||||
// client.h -- primary header for client
|
||||
|
||||
#ifndef __CLIENT_H__
|
||||
#define __CLIENT_H__
|
||||
#pragma once
|
||||
|
||||
#include "../qcommon/q_shared.h"
|
||||
#include "../qcommon/qcommon.h"
|
||||
@@ -321,7 +320,7 @@ typedef struct {
|
||||
serverInfo_t globalServers[MAX_GLOBAL_SERVERS];
|
||||
// additional global servers
|
||||
int numGlobalServerAddresses;
|
||||
serverAddress_t globalServerAddresses[MAX_GLOBAL_SERVERS];
|
||||
netadr_t globalServerAddresses[MAX_GLOBAL_SERVERS];
|
||||
|
||||
int numfavoriteservers;
|
||||
serverInfo_t favoriteServers[MAX_OTHER_SERVERS];
|
||||
@@ -352,7 +351,7 @@ typedef struct {
|
||||
clientAnim_t anim;
|
||||
stopWatch_t stopwatch;
|
||||
void* savedCgameState;
|
||||
int savedCgameStateSize;
|
||||
size_t savedCgameStateSize;
|
||||
char gcdResponse[73];
|
||||
int unknown3_0;
|
||||
int currentRate;
|
||||
@@ -437,6 +436,9 @@ extern cvar_t *cl_inGameVideo;
|
||||
|
||||
extern cvar_t *cl_lanForcePackets;
|
||||
extern cvar_t *cl_langamerefreshstatus;
|
||||
extern cvar_t *cl_radar_icon_size;
|
||||
extern cvar_t *cl_radar_speak_time;
|
||||
extern cvar_t *cl_radar_blink_time;
|
||||
extern cvar_t *cl_autoRecordDemo;
|
||||
|
||||
extern cvar_t *cl_r_fullscreen;
|
||||
@@ -463,15 +465,12 @@ extern cvar_t* j_up_axis;
|
||||
//
|
||||
|
||||
void CL_Init (void);
|
||||
void CL_InitClientSavedData( void );
|
||||
void CL_InitRef( void );
|
||||
void CL_FlushMemory(void);
|
||||
void CL_ShutdownAll(void);
|
||||
void CL_AddReliableCommand( const char *cmd );
|
||||
void CL_InitClientSavedData(void);
|
||||
void CL_AddReliableCommand(const char *cmd, qboolean isDisconnectCmd);
|
||||
|
||||
void CL_StartHunkUsers( void );
|
||||
void CL_StartHunkUsers( qboolean rendererOnly );
|
||||
|
||||
void CL_Connect( const char *server );
|
||||
void CL_Connect( const char *server, netadrtype_t family );
|
||||
|
||||
void CL_Disconnect_f (void);
|
||||
void CL_GetChallengePacket (void);
|
||||
@@ -573,6 +572,7 @@ void CL_FavoriteServers_f( void );
|
||||
void CL_Ping_f( void );
|
||||
void CL_SaveShot_f( void );
|
||||
void CL_Dialog_f( void );
|
||||
void CL_ServerRestarted( void );
|
||||
qboolean CL_UpdateVisiblePings_f( int source );
|
||||
|
||||
|
||||
@@ -689,5 +689,3 @@ void CL_InitConsoleCommands( void );
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif // __CLIENT_H__
|
||||
@@ -0,0 +1,68 @@
|
||||
/*
|
||||
===========================================================================
|
||||
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
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
typedef struct {
|
||||
int iFlags;
|
||||
char szName[64];
|
||||
} soundSfx_t;
|
||||
|
||||
typedef struct {
|
||||
qboolean bPlaying;
|
||||
int iStatus;
|
||||
soundSfx_t sfx;
|
||||
int iEntNum;
|
||||
int iEntChannel;
|
||||
float vOrigin[3];
|
||||
float fVolume;
|
||||
int iBaseRate;
|
||||
float fNewPitchMult;
|
||||
float fMinDist;
|
||||
float fMaxDist;
|
||||
int iStartTime;
|
||||
int iTime;
|
||||
int iNextCheckObstructionTime;
|
||||
int iEndTime;
|
||||
int iFlags;
|
||||
int iOffset;
|
||||
int iLoopCount;
|
||||
} channelbasesavegame_t;
|
||||
|
||||
typedef struct {
|
||||
channelbasesavegame_t Channels[MAX_CHANNELS];
|
||||
} soundsystemsavegame_t;
|
||||
|
||||
void S_ChannelFree_Callback(channel_t* v);
|
||||
void S_LoadData(soundsystemsavegame_t* pSave);
|
||||
void S_SaveData(soundsystemsavegame_t* pSave);
|
||||
void S_ReLoad(soundsystemsavegame_t* pSave);
|
||||
|
||||
extern qboolean s_bSoundPaused;
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
Loaded 100 of 736 files, more files were not shown because too many files have changed in this diff.
Show more
Reference in new issue
Block a user