mirror of
https://github.com/FWGS/xash3d-fwgs.git
synced 2026-08-05 03:24:56 +08:00
Compare commits
800 Commits
v0.20
...
dll-leak-d
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
c395acad63 | ||
|
|
8eec5389fe | ||
|
|
5524aaae1e | ||
|
|
acffeb1dad | ||
|
|
6c7d57e1eb | ||
|
|
7c9f5f8ab1 | ||
|
|
6b4f55c4bf | ||
|
|
89335938c1 | ||
|
|
437630d26d | ||
|
|
341c9dae39 | ||
|
|
c10b70cb61 | ||
|
|
4c7bf1ff44 | ||
|
|
f467d0c807 | ||
|
|
a717b7fc49 | ||
|
|
07a9c4602d | ||
|
|
eeb170af22 | ||
|
|
c532c3032c | ||
|
|
ae6ad74994 | ||
|
|
f417433f59 | ||
|
|
080dc38f11 | ||
|
|
13f93412cd | ||
|
|
ca975d0168 | ||
|
|
b82d0bad7a | ||
|
|
d1de9e2802 | ||
|
|
efdf9e3599 | ||
|
|
060835cf2f | ||
|
|
74485f30d3 | ||
|
|
8dda35a128 | ||
|
|
978ec27a57 | ||
|
|
113f18cfb0 | ||
|
|
6f36edfd16 | ||
|
|
5fb4edeb36 | ||
|
|
dd29e705f8 | ||
|
|
8445567ab4 | ||
|
|
11d4cb0f1e | ||
|
|
db48d0ded7 | ||
|
|
86a777880f | ||
|
|
0d195ee6fe | ||
|
|
5e4996b119 | ||
|
|
f25254369d | ||
|
|
9ce8edcb38 | ||
|
|
33d79ddb24 | ||
|
|
52d1383f14 | ||
|
|
843c9abf9b | ||
|
|
924e895753 | ||
|
|
ac40badaa5 | ||
|
|
fd83b0dc17 | ||
|
|
5715023a0d | ||
|
|
51526948c0 | ||
|
|
10ec32e264 | ||
|
|
4fbd96d201 | ||
|
|
81b01ac561 | ||
|
|
771c359ed0 | ||
|
|
d1a5c33bf1 | ||
|
|
641f0632ef | ||
|
|
974f0787a4 | ||
|
|
87ceb0f9cb | ||
|
|
cfcd58dd78 | ||
|
|
8044d23e7f | ||
|
|
b175d6d95f | ||
|
|
d3e213aa1b | ||
|
|
26e09c240a | ||
|
|
15eb6808c4 | ||
|
|
5402e1a259 | ||
|
|
74086cc4c1 | ||
|
|
9c85d114e7 | ||
|
|
81c4acab66 | ||
|
|
6f2fda427e | ||
|
|
09b7f22cee | ||
|
|
691a305f8e | ||
|
|
66dc20dc2d | ||
|
|
92cfa2af48 | ||
|
|
9515cccb94 | ||
|
|
a7d02b8268 | ||
|
|
22815d2784 | ||
|
|
95ee88720c | ||
|
|
58dbc1ba31 | ||
|
|
d7431783d4 | ||
|
|
c8410f7e46 | ||
|
|
80e20cb55b | ||
|
|
654bac83a5 | ||
|
|
fc7fb8b62d | ||
|
|
65d624140e | ||
|
|
cd2720ba81 | ||
|
|
d2f3b1974e | ||
|
|
91742d613d | ||
|
|
fba323cf1f | ||
|
|
f67d0ffa5a | ||
|
|
a6fbf5fb74 | ||
|
|
df616b950d | ||
|
|
37cf4da136 | ||
|
|
668d528e3b | ||
|
|
12da44a3d7 | ||
|
|
51fcae8cec | ||
|
|
6473efa995 | ||
|
|
cf7852832f | ||
|
|
29ad3de78a | ||
|
|
8169c2a40b | ||
|
|
85f99c723a | ||
|
|
edc171be04 | ||
|
|
9047fe2e74 | ||
|
|
24ea8fba4b | ||
|
|
e07417aead | ||
|
|
13b36e66b3 | ||
|
|
7821f425e7 | ||
|
|
f0783ddee1 | ||
|
|
d4d39c66fb | ||
|
|
a2d8a47376 | ||
|
|
3f7773f83b | ||
|
|
18933e7981 | ||
|
|
9917cba8fc | ||
|
|
203afda053 | ||
|
|
6dbb694fdc | ||
|
|
0c26c24331 | ||
|
|
51635995a2 | ||
|
|
988183a96a | ||
|
|
d8fd0b3dcb | ||
|
|
a6b43fbfff | ||
|
|
61643585e0 | ||
|
|
75e8a51058 | ||
|
|
3a55b9cd67 | ||
|
|
89baa633c8 | ||
|
|
1bf08cc2c3 | ||
|
|
36d757c74a | ||
|
|
0891356ec5 | ||
|
|
0fa1b4f944 | ||
|
|
56103a90eb | ||
|
|
2fa964e939 | ||
|
|
0027678a56 | ||
|
|
ffea7d9729 | ||
|
|
0e286f31c5 | ||
|
|
b9cec43e2c | ||
|
|
bb84a3cb7f | ||
|
|
5aa6bfee85 | ||
|
|
204544f50f | ||
|
|
df4f21680c | ||
|
|
2c1b862654 | ||
|
|
ea5937bce0 | ||
|
|
6e4ab74694 | ||
|
|
2c74a633d0 | ||
|
|
22e770e4d4 | ||
|
|
1f26710bd0 | ||
|
|
96f35f76e1 | ||
|
|
fa37d153c8 | ||
|
|
aa5594d11f | ||
|
|
6b332eabd2 | ||
|
|
13cf909b99 | ||
|
|
606b5354e6 | ||
|
|
e29dcb4125 | ||
|
|
c3513b1615 | ||
|
|
abbd0f92a4 | ||
|
|
f9d0fba05f | ||
|
|
1ffe050205 | ||
|
|
a2f741fe8a | ||
|
|
d0a39ef492 | ||
|
|
f63d2d747f | ||
|
|
7e687b45bb | ||
|
|
284eeea3c3 | ||
|
|
01b2266b7e | ||
|
|
0714ab27b5 | ||
|
|
4ae608913b | ||
|
|
295adcf222 | ||
|
|
3351ecd754 | ||
|
|
ccf90beb7d | ||
|
|
7fbbe9f015 | ||
|
|
46fd27eb14 | ||
|
|
f1a4d66d27 | ||
|
|
c619bb4af7 | ||
|
|
210137c325 | ||
|
|
d4d79573f6 | ||
|
|
b7a32f6843 | ||
|
|
f1dabf13a1 | ||
|
|
947b94d29f | ||
|
|
f007374866 | ||
|
|
7cb06956c2 | ||
|
|
ebfa8e6ffc | ||
|
|
7869aac2e5 | ||
|
|
f3dfbc9219 | ||
|
|
4f89288ccf | ||
|
|
fb8791529e | ||
|
|
f0feb1dfbf | ||
|
|
2df27e14a8 | ||
|
|
764ef93984 | ||
|
|
d8b3ab4dcc | ||
|
|
08e72bad35 | ||
|
|
7e574ea42e | ||
|
|
0963e05716 | ||
|
|
23e2f4d0cc | ||
|
|
ca3544d559 | ||
|
|
7a0a355baf | ||
|
|
f7bf081650 | ||
|
|
a4be009ce7 | ||
|
|
d3248aad66 | ||
|
|
000c594596 | ||
|
|
960a8959d5 | ||
|
|
2604ea39c5 | ||
|
|
dc186c3cba | ||
|
|
f60112773f | ||
|
|
37aa5b1e99 | ||
|
|
aa07dab8ab | ||
|
|
ac213c22ed | ||
|
|
e0efe0aa23 | ||
|
|
29bc0392ee | ||
|
|
054765232e | ||
|
|
89425e4bf2 | ||
|
|
a777e7c80d | ||
|
|
1350fd0b52 | ||
|
|
d7db48ce4b | ||
|
|
293482fbd5 | ||
|
|
3771a1d6c5 | ||
|
|
07f1f7ded1 | ||
|
|
1cac321c00 | ||
|
|
aa7bfb4819 | ||
|
|
0c18a06946 | ||
|
|
24edcf7d9e | ||
|
|
ecddae8ee6 | ||
|
|
1ab49adbf2 | ||
|
|
28b49e00e5 | ||
|
|
1e6be598e9 | ||
|
|
155e15939b | ||
|
|
3f014fde73 | ||
|
|
66db69862f | ||
|
|
fc665527ae | ||
|
|
0c6b51fa0c | ||
|
|
c00e77c02e | ||
|
|
25c0557f7f | ||
|
|
76ea3c39a0 | ||
|
|
e67bd4811a | ||
|
|
7a215766c6 | ||
|
|
576f0a72c5 | ||
|
|
55b4597390 | ||
|
|
c64b3db6b8 | ||
|
|
67e77ca099 | ||
|
|
f726793711 | ||
|
|
1944f48516 | ||
|
|
992bcd89ef | ||
|
|
2356bc9905 | ||
|
|
9159d406e3 | ||
|
|
508eb7ab5f | ||
|
|
1de1852409 | ||
|
|
664506f79e | ||
|
|
06eb6838a9 | ||
|
|
f2a9f805b8 | ||
|
|
c6648a69ba | ||
|
|
3203d9a043 | ||
|
|
8599119c8d | ||
|
|
a3d6e7bcfe | ||
|
|
36702aafe7 | ||
|
|
b93938956e | ||
|
|
c96f10d40b | ||
|
|
8a9231628e | ||
|
|
66d66eb835 | ||
|
|
9a4dec64f9 | ||
|
|
94dc74a37f | ||
|
|
b24c1a51d3 | ||
|
|
c79a649d97 | ||
|
|
f9d1d14848 | ||
|
|
1a1d81de62 | ||
|
|
6c9321e50c | ||
|
|
c366e25a10 | ||
|
|
8ab97fbbf0 | ||
|
|
a5a66f6c3e | ||
|
|
1c6604806c | ||
|
|
39893609fd | ||
|
|
b9901bcb70 | ||
|
|
6571c78ed4 | ||
|
|
d1e6063650 | ||
|
|
42db1faa51 | ||
|
|
efc156fcf5 | ||
|
|
207675990e | ||
|
|
e8cd6e9d65 | ||
|
|
ab256e294e | ||
|
|
d9fd6aa05c | ||
|
|
57382c7cea | ||
|
|
1042291ad6 | ||
|
|
c9e4912a2a | ||
|
|
e5e1570aed | ||
|
|
621399c49b | ||
|
|
c3684109bf | ||
|
|
f3fedbfdba | ||
|
|
29a8bfb1dc | ||
|
|
004e190435 | ||
|
|
378c4f30f3 | ||
|
|
a8c877c841 | ||
|
|
8ce448cc77 | ||
|
|
4ba95277b9 | ||
|
|
cce7c7d782 | ||
|
|
9e5d5e0ea3 | ||
|
|
a235bec5f1 | ||
|
|
a3a8acfe6c | ||
|
|
9e4e9cab04 | ||
|
|
e4ad8def0d | ||
|
|
ec95948b69 | ||
|
|
ef6ff3cfa6 | ||
|
|
7bcfce5a7a | ||
|
|
08c04200fb | ||
|
|
8bbd0d5119 | ||
|
|
ade0fd4afa | ||
|
|
ed7ed818bb | ||
|
|
91f845c335 | ||
|
|
81ef12be9e | ||
|
|
2aafe9df9f | ||
|
|
3b933eabf5 | ||
|
|
f5ccf093d6 | ||
|
|
fe0da74e75 | ||
|
|
2939ab8ea4 | ||
|
|
dd90262db2 | ||
|
|
4f8e4b5f64 | ||
|
|
32068d8090 | ||
|
|
bd4979f5b0 | ||
|
|
a5e1e9646c | ||
|
|
013918a371 | ||
|
|
1b20694a1c | ||
|
|
2db6ad2c8a | ||
|
|
8c351d9255 | ||
|
|
c4ef42009c | ||
|
|
8d5426cdcd | ||
|
|
7b8ec0ad4b | ||
|
|
901e52615b | ||
|
|
88ce5fd0b6 | ||
|
|
588dede2a2 | ||
|
|
0efc5e82ec | ||
|
|
c3da9d8c8f | ||
|
|
a547526e86 | ||
|
|
09d647182d | ||
|
|
af3c0686c5 | ||
|
|
8b76ab93fb | ||
|
|
9ffc02b6e9 | ||
|
|
5d307d603c | ||
|
|
affc64c6da | ||
|
|
e00c20b288 | ||
|
|
dcf7ec2c3d | ||
|
|
21a31ec81d | ||
|
|
9287a0f5c5 | ||
|
|
4723eb2586 | ||
|
|
15ec6539e3 | ||
|
|
8d793521c4 | ||
|
|
2147542e33 | ||
|
|
a0af256641 | ||
|
|
21174dc9cf | ||
|
|
894726d699 | ||
|
|
f8e6033ae6 | ||
|
|
4abe1a77f4 | ||
|
|
79f3a6f60e | ||
|
|
a2c83144c0 | ||
|
|
6e0d372504 | ||
|
|
91ee9bd32a | ||
|
|
6ea25b8194 | ||
|
|
5bc4359a2f | ||
|
|
17d3eaa590 | ||
|
|
6ceb101ba1 | ||
|
|
f7f069a38b | ||
|
|
37c5dfa49f | ||
|
|
0260a6c234 | ||
|
|
2ad209b973 | ||
|
|
e9712fc24f | ||
|
|
eef52ea2d0 | ||
|
|
8018f4a000 | ||
|
|
9d0c7338ab | ||
|
|
18d8ef287d | ||
|
|
9b1fccd1fa | ||
|
|
32e96bdad1 | ||
|
|
c50f73b892 | ||
|
|
a1c948e591 | ||
|
|
db3e71bfcc | ||
|
|
2b436dced0 | ||
|
|
a89f9fa181 | ||
|
|
6063149b93 | ||
|
|
a28d15e519 | ||
|
|
94959110f6 | ||
|
|
86be161677 | ||
|
|
9313f7e80e | ||
|
|
43f1137565 | ||
|
|
ad4062969b | ||
|
|
60c10333aa | ||
|
|
0f84ce40f0 | ||
|
|
3894edcb98 | ||
|
|
5b387ba36a | ||
|
|
d011dccaab | ||
|
|
b7922368bd | ||
|
|
947a615707 | ||
|
|
b2d93b7b55 | ||
|
|
49a20a9ac5 | ||
|
|
8966172ce0 | ||
|
|
ddd48c420b | ||
|
|
f31e9ae19e | ||
|
|
4543008012 | ||
|
|
d54a648792 | ||
|
|
13a3f22001 | ||
|
|
75e80bc2ff | ||
|
|
386ae2067b | ||
|
|
b289de26a6 | ||
|
|
415f5baa1c | ||
|
|
3fdfbff09b | ||
|
|
163225e180 | ||
|
|
1369c2029b | ||
|
|
4f31d7504a | ||
|
|
585955eb19 | ||
|
|
1a5b2576f7 | ||
|
|
ddc4d76668 | ||
|
|
f5e400de69 | ||
|
|
9c8059ea96 | ||
|
|
c62db950f1 | ||
|
|
9c9953bb60 | ||
|
|
acaf15c5d2 | ||
|
|
25569db053 | ||
|
|
a391038d27 | ||
|
|
9ea45a71f5 | ||
|
|
ea39836b88 | ||
|
|
bfa01f5b3b | ||
|
|
23974d24c3 | ||
|
|
868947cbb4 | ||
|
|
cb942d7e81 | ||
|
|
05cf8d0edc | ||
|
|
071f15b570 | ||
|
|
e5a40fd745 | ||
|
|
f2ab4c0d0e | ||
|
|
0ba1a8e7bc | ||
|
|
ed0ca2b2d2 | ||
|
|
26404315cb | ||
|
|
be1958473b | ||
|
|
8b59875e93 | ||
|
|
accacd54f5 | ||
|
|
331a2046c8 | ||
|
|
c9f176f802 | ||
|
|
523798857b | ||
|
|
2edc8b16ae | ||
|
|
29902f48d5 | ||
|
|
d25a661701 | ||
|
|
a93d9ac71c | ||
|
|
c68af64fe5 | ||
|
|
3d9a4560d5 | ||
|
|
9120d40ce5 | ||
|
|
4db2aaffc4 | ||
|
|
155eb1ba58 | ||
|
|
efaf7ac622 | ||
|
|
6cc2205321 | ||
|
|
0a818f3f3f | ||
|
|
fe2c4af8c2 | ||
|
|
3e7dd30fd7 | ||
|
|
42f47f51b5 | ||
|
|
aea9e8efa2 | ||
|
|
a6cd67cc65 | ||
|
|
585ae28dd2 | ||
|
|
4abac92891 | ||
|
|
a813be7d54 | ||
|
|
e77957bc81 | ||
|
|
9b6f26c191 | ||
|
|
385cc3f497 | ||
|
|
c0db39594b | ||
|
|
add4cf4232 | ||
|
|
586d613a27 | ||
|
|
45334064b6 | ||
|
|
ca84a1a10e | ||
|
|
14008703f6 | ||
|
|
58edfbc485 | ||
|
|
fa555c1f09 | ||
|
|
75210b1ff6 | ||
|
|
b278751834 | ||
|
|
3b192ca490 | ||
|
|
12dd225db2 | ||
|
|
56d5f08128 | ||
|
|
256284d76f | ||
|
|
cf5ebd128c | ||
|
|
5b597028fe | ||
|
|
012d1fa8bd | ||
|
|
1b426b67e7 | ||
|
|
8d50049db7 | ||
|
|
cba9fb1a07 | ||
|
|
932fc8e3c7 | ||
|
|
5884cf88d3 | ||
|
|
d2157fa28c | ||
|
|
6e43f9bdd0 | ||
|
|
d9ed654f04 | ||
|
|
8090db2e75 | ||
|
|
652a946e09 | ||
|
|
d6d90f03a0 | ||
|
|
d7b3c7b681 | ||
|
|
c158771f59 | ||
|
|
63c4b2748c | ||
|
|
9bc3d6d315 | ||
|
|
1a59389261 | ||
|
|
221a9bab54 | ||
|
|
102fb8ec40 | ||
|
|
db89c4236a | ||
|
|
b1048556c6 | ||
|
|
11194f339d | ||
|
|
c95e847890 | ||
|
|
4daa7c23a0 | ||
|
|
3e8e751dc7 | ||
|
|
239474b01e | ||
|
|
12b579bc34 | ||
|
|
6d614e028a | ||
|
|
a234888d44 | ||
|
|
5e0a0765ce | ||
|
|
3af742f103 | ||
|
|
9452a389a5 | ||
|
|
766ef84af4 | ||
|
|
5b8d504817 | ||
|
|
61fe9fd1fe | ||
|
|
33ba1f25f3 | ||
|
|
2106eef4b2 | ||
|
|
23998ef720 | ||
|
|
1332381e2d | ||
|
|
7f98998765 | ||
|
|
5aef09ce5d | ||
|
|
69e15e9c7b | ||
|
|
9e1170fc56 | ||
|
|
5a36a26dd1 | ||
|
|
a92b310e0e | ||
|
|
b40344f1f0 | ||
|
|
36b32cad0f | ||
|
|
7b127c23f5 | ||
|
|
9acedb3408 | ||
|
|
5f54582692 | ||
|
|
63d8794902 | ||
|
|
ede9e5095d | ||
|
|
abd9778ef3 | ||
|
|
299e3fe957 | ||
|
|
3e7e251828 | ||
|
|
f2120672d0 | ||
|
|
d3ab2023ae | ||
|
|
cdcd139171 | ||
|
|
88e1780c68 | ||
|
|
68e10d7b53 | ||
|
|
378b655cd2 | ||
|
|
b7fa48a1eb | ||
|
|
eb652d53ac | ||
|
|
c53985c0bc | ||
|
|
f60c398f32 | ||
|
|
bb387cfe4b | ||
|
|
341e440c07 | ||
|
|
e6b9b67825 | ||
|
|
9c6183e6a0 | ||
|
|
2aaa6c6e04 | ||
|
|
80a5c53cb2 | ||
|
|
e4a71afe63 | ||
|
|
23ea7ecbcc | ||
|
|
5cdb35f508 | ||
|
|
03668116d7 | ||
|
|
f3d8a2bcb0 | ||
|
|
09ae961221 | ||
|
|
d015e97eae | ||
|
|
b4aecfbf23 | ||
|
|
df7f8259a1 | ||
|
|
fff71e449e | ||
|
|
d4003f9527 | ||
|
|
9acd2f5d22 | ||
|
|
d30605c09f | ||
|
|
9ff6d44178 | ||
|
|
90b163dc1d | ||
|
|
2d97126baf | ||
|
|
3f3160e220 | ||
|
|
065811cc46 | ||
|
|
e69956c9ea | ||
|
|
e96271a8a9 | ||
|
|
f0c9aa1585 | ||
|
|
ce269f8c6d | ||
|
|
4515d3e3cb | ||
|
|
c80da05e94 | ||
|
|
bef873e1f8 | ||
|
|
a5e3a74e93 | ||
|
|
d9290f2e03 | ||
|
|
98ffbaf87a | ||
|
|
1e1c0a9aa3 | ||
|
|
9979d4feb7 | ||
|
|
5f2d346b9b | ||
|
|
64a96b26ad | ||
|
|
0db1a7743d | ||
|
|
a641488b98 | ||
|
|
371cfc1cce | ||
|
|
46b0590e4e | ||
|
|
95393cde72 | ||
|
|
ea6846e2f9 | ||
|
|
9b22149509 | ||
|
|
ce1fc386a2 | ||
|
|
77bebe3000 | ||
|
|
9292d81052 | ||
|
|
e1985eeb4f | ||
|
|
53768c84d6 | ||
|
|
3c2840f7d1 | ||
|
|
32f6f359a4 | ||
|
|
0428de6285 | ||
|
|
92f0bf54f1 | ||
|
|
8fcfde1e42 | ||
|
|
e0dfc4c0b4 | ||
|
|
80a806aaad | ||
|
|
762d57fd88 | ||
|
|
732cb925e5 | ||
|
|
f59a3ca417 | ||
|
|
deb7591d1e | ||
|
|
82c54b1b54 | ||
|
|
8d942bcc86 | ||
|
|
c39d42cc62 | ||
|
|
51a45d745e | ||
|
|
544fc63b6b | ||
|
|
e06518c594 | ||
|
|
012a193685 | ||
|
|
dc2ab714f6 | ||
|
|
4c6fd79f07 | ||
|
|
293b42b9d4 | ||
|
|
88ab42cc15 | ||
|
|
7429a6bc8a | ||
|
|
89ca0dec5e | ||
|
|
9045657352 | ||
|
|
3984a58025 | ||
|
|
237d6f8689 | ||
|
|
79a7b7b1a3 | ||
|
|
b81345f063 | ||
|
|
87340ceca8 | ||
|
|
7a58813254 | ||
|
|
3d9c482eae | ||
|
|
5d97a293fe | ||
|
|
3c8ce640c4 | ||
|
|
efafd7c01c | ||
|
|
fb165dfec1 | ||
|
|
248c8a745c | ||
|
|
7c47bfd0db | ||
|
|
e96ea719d5 | ||
|
|
17cf4bf402 | ||
|
|
04c17995a2 | ||
|
|
4994a7ef6f | ||
|
|
e3d9ac4840 | ||
|
|
0c69f7649c | ||
|
|
84a3f6883d | ||
|
|
8f8c8e6614 | ||
|
|
1b4f997951 | ||
|
|
6e6185dba2 | ||
|
|
1f134fdb72 | ||
|
|
64b001a505 | ||
|
|
5f4d81866f | ||
|
|
19303f7bd7 | ||
|
|
a967caa91f | ||
|
|
3ce16227ba | ||
|
|
3e7351cb33 | ||
|
|
4021d7bf5c | ||
|
|
68472f90eb | ||
|
|
7ad658ee3a | ||
|
|
0ee5ff3aad | ||
|
|
9a0da3cd4f | ||
|
|
e3b547c8a9 | ||
|
|
e602ca1d66 | ||
|
|
01e2ea24da | ||
|
|
f5783ae1df | ||
|
|
49445f0663 | ||
|
|
27da2e10ff | ||
|
|
7d0e45b507 | ||
|
|
9b40d91a9b | ||
|
|
02c68c3a70 | ||
|
|
a0d09c9954 | ||
|
|
c7e3eae9dd | ||
|
|
70cc52e203 | ||
|
|
51849c6140 | ||
|
|
fe07c48431 | ||
|
|
d8f20f3642 | ||
|
|
828def3b25 | ||
|
|
97228a4249 | ||
|
|
3e3aff040e | ||
|
|
adc718f4d5 | ||
|
|
22c148a39e | ||
|
|
70cddcb9ca | ||
|
|
2b90790071 | ||
|
|
070272489d | ||
|
|
538d8a6fb4 | ||
|
|
c8be38e75d | ||
|
|
303a88730c | ||
|
|
26a1ba543f | ||
|
|
2e2a716710 | ||
|
|
4c7e19adeb | ||
|
|
59f053b1db | ||
|
|
dce35f453d | ||
|
|
3a416636f1 | ||
|
|
bbd033c254 | ||
|
|
22dc5b7416 | ||
|
|
40c73719c0 | ||
|
|
022792709d | ||
|
|
b9ec7ac886 | ||
|
|
32eb42a92f | ||
|
|
5d8b770e6c | ||
|
|
0fe18ae6dc | ||
|
|
d0dbd185ad | ||
|
|
e11a08064d | ||
|
|
e424112020 | ||
|
|
4a56dfcd00 | ||
|
|
6a8cd7090a | ||
|
|
c57d8995c6 | ||
|
|
37435365e2 | ||
|
|
94fc0febc7 | ||
|
|
6f58ef2394 | ||
|
|
177f8ed653 | ||
|
|
d4efb55492 | ||
|
|
ef270eb642 | ||
|
|
d1af73bfcb | ||
|
|
a3a0db447b | ||
|
|
3589537147 | ||
|
|
26b8a1fe1d | ||
|
|
609235b4f1 | ||
|
|
b3ad557dd2 | ||
|
|
9c7c279a5b | ||
|
|
f376d5d59c | ||
|
|
2493659b23 | ||
|
|
e1efacb399 | ||
|
|
05d793c34b | ||
|
|
86867dcbe3 | ||
|
|
c8eac04e9b | ||
|
|
d96dcfba59 | ||
|
|
690a317f4f | ||
|
|
9c4a0d2397 | ||
|
|
a2cba95a3a | ||
|
|
fd962869e6 | ||
|
|
7663da80c3 | ||
|
|
103077b686 | ||
|
|
fbef500fb3 | ||
|
|
37ee9752e1 | ||
|
|
a6572dd042 | ||
|
|
8a99d64139 | ||
|
|
1c0262a8c4 | ||
|
|
ee67d350e3 | ||
|
|
60e3a78221 | ||
|
|
b2105a113c | ||
|
|
c293a7a26d | ||
|
|
4dae13d7bc | ||
|
|
5140bb8d7f | ||
|
|
320a3b0834 | ||
|
|
79405c7cc9 | ||
|
|
99fa5d0252 | ||
|
|
b584e89d90 | ||
|
|
7f1491f884 | ||
|
|
9fbb8a8201 | ||
|
|
4aa5778606 | ||
|
|
338b404055 | ||
|
|
500ff629bf | ||
|
|
033a947631 | ||
|
|
c08c35df69 | ||
|
|
cefe42fd66 | ||
|
|
e0cd5edddb | ||
|
|
ebd1da2730 | ||
|
|
4bbcd5daef | ||
|
|
8d88ecb951 | ||
|
|
b5e1382232 | ||
|
|
8f5c72c510 | ||
|
|
c52453faa3 | ||
|
|
8c9aa2588c | ||
|
|
d03d29f6f5 | ||
|
|
77f8da275a | ||
|
|
0c6c0003b1 | ||
|
|
1c49d76fb7 | ||
|
|
714084bf5b | ||
|
|
2efdf56317 | ||
|
|
7fc09da482 | ||
|
|
d315a838bd | ||
|
|
6879c1f097 | ||
|
|
25860f6263 | ||
|
|
c52d4b7998 | ||
|
|
0c62967d8a | ||
|
|
f34db62940 | ||
|
|
b0ed8a5ba3 | ||
|
|
95ff769020 | ||
|
|
9b158f5926 | ||
|
|
29c2169012 | ||
|
|
56ef16b0f9 | ||
|
|
eeda097603 | ||
|
|
77e296ffef | ||
|
|
72d5dfed34 | ||
|
|
7f8caf1634 | ||
|
|
1871f39b2b | ||
|
|
6eae7acd34 | ||
|
|
36a5247181 | ||
|
|
153b8cbcc3 | ||
|
|
44a8ede94d | ||
|
|
529bb53d52 | ||
|
|
b35415637b | ||
|
|
35e42a2295 | ||
|
|
dbabb861f2 | ||
|
|
224bf07930 | ||
|
|
870ae030ca | ||
|
|
9ba39f65b3 | ||
|
|
3d8fe065b5 | ||
|
|
513381a322 | ||
|
|
c36f415793 | ||
|
|
3617e8e7a1 | ||
|
|
65cf77c32b | ||
|
|
e0ce5640d1 | ||
|
|
e7f369a765 | ||
|
|
58429bbc79 | ||
|
|
5fc39662ec | ||
|
|
4c73f026b2 | ||
|
|
932ad73441 | ||
|
|
bf0d694c71 | ||
|
|
a2e689aba3 | ||
|
|
c82eb39d54 | ||
|
|
a00256a61c | ||
|
|
842a15ee45 | ||
|
|
e7785c9ccb | ||
|
|
2b521ee201 | ||
|
|
ce27aad67b | ||
|
|
6784b9062e | ||
|
|
f23ecc6895 | ||
|
|
ae6b460f35 | ||
|
|
1ca28badad |
55
.cirrus.yml
55
.cirrus.yml
@@ -1,32 +1,35 @@
|
||||
task:
|
||||
name: freebsd-10-amd64
|
||||
freebsd_instance:
|
||||
image_family: freebsd-10-4
|
||||
setup_script:
|
||||
- pkg install -y git sdl2 python
|
||||
- git submodule update --init --recursive
|
||||
test_script:
|
||||
# - ./scripts/build_freebsd_engine.sh dedicated
|
||||
- ./scripts/build_freebsd_engine.sh
|
||||
|
||||
task:
|
||||
name: freebsd-11-amd64
|
||||
freebsd_instance:
|
||||
image_family: freebsd-11-3
|
||||
setup_script:
|
||||
- pkg install -y git sdl2 python
|
||||
- git submodule update --init --recursive
|
||||
test_script:
|
||||
# - ./scripts/build_freebsd_engine.sh dedicated
|
||||
- ./scripts/build_freebsd_engine.sh
|
||||
|
||||
task:
|
||||
name: freebsd-12-amd64
|
||||
freebsd_instance:
|
||||
image_family: freebsd-12-0
|
||||
image_family: freebsd-12-3
|
||||
setup_script:
|
||||
- pkg install -y git sdl2 python
|
||||
- pkg update
|
||||
- pkg install -y git sdl2 python fontconfig
|
||||
- git submodule update --init --recursive
|
||||
test_script:
|
||||
# - ./scripts/build_freebsd_engine.sh dedicated
|
||||
- ./scripts/build_freebsd_engine.sh
|
||||
- ./scripts/cirrus/build_freebsd.sh dedicated
|
||||
- ./scripts/cirrus/build_freebsd.sh full
|
||||
|
||||
task:
|
||||
name: freebsd-13-amd64
|
||||
freebsd_instance:
|
||||
image_family: freebsd-13-1
|
||||
setup_script:
|
||||
- pkg update
|
||||
- pkg install -y git sdl2 python fontconfig
|
||||
- git submodule update --init --recursive
|
||||
test_script:
|
||||
- ./scripts/cirrus/build_freebsd.sh dedicated
|
||||
- ./scripts/cirrus/build_freebsd.sh full
|
||||
|
||||
task:
|
||||
name: freebsd-14-amd64
|
||||
freebsd_instance:
|
||||
image_family: freebsd-14-0-snap
|
||||
setup_script:
|
||||
- pkg update
|
||||
- pkg install -y git sdl2 python fontconfig
|
||||
- git submodule update --init --recursive
|
||||
test_script:
|
||||
- ./scripts/cirrus/build_freebsd.sh dedicated
|
||||
- ./scripts/cirrus/build_freebsd.sh full
|
||||
|
||||
3
.gitattributes
vendored
Normal file
3
.gitattributes
vendored
Normal file
@@ -0,0 +1,3 @@
|
||||
*.c text eol=lf diff=cpp
|
||||
*.h text eol=lf diff=cpp
|
||||
wscript text eol=lf diff=python
|
||||
72
.github/workflows/c-cpp.yml
vendored
Normal file
72
.github/workflows/c-cpp.yml
vendored
Normal file
@@ -0,0 +1,72 @@
|
||||
name: Build & Deploy Engine
|
||||
on: [push, pull_request]
|
||||
jobs:
|
||||
# cleanup:
|
||||
# runs-on: self-hosted
|
||||
# steps:
|
||||
# - name: Cleanup
|
||||
# run: rm -rf .* || true
|
||||
build:
|
||||
runs-on: ${{ matrix.os }}
|
||||
continue-on-error: true
|
||||
strategy:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
include:
|
||||
- os: ubuntu-18.04
|
||||
targetos: linux
|
||||
targetarch: amd64
|
||||
- os: ubuntu-18.04
|
||||
targetos: linux
|
||||
targetarch: i386
|
||||
# - os: ubuntu-aarch64-20.04
|
||||
# targetos: linux
|
||||
# targetarch: aarch64
|
||||
|
||||
- os: ubuntu-18.04
|
||||
targetos: android
|
||||
targetarch: 32
|
||||
- os: ubuntu-18.04
|
||||
targetos: android
|
||||
targetarch: 64
|
||||
|
||||
- os: ubuntu-18.04
|
||||
targetos: motomagx
|
||||
targetarch: armv6
|
||||
|
||||
- os: windows-latest
|
||||
targetos: win32
|
||||
targetarch: amd64
|
||||
- os: windows-latest
|
||||
targetos: win32
|
||||
targetarch: i386
|
||||
env:
|
||||
SDL_VERSION: 2.0.14
|
||||
GH_CPU_ARCH: ${{ matrix.targetarch }}
|
||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
ANDROID_SDK_TOOLS_VER: 4333796
|
||||
UPLOADTOOL_ISPRERELEASE: true
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v2
|
||||
with:
|
||||
submodules: recursive
|
||||
- name: Checkout xash-extras
|
||||
uses: actions/checkout@v2
|
||||
with:
|
||||
repository: FWGS/xash-extras
|
||||
path: xash-extras
|
||||
|
||||
- name: Install dependencies
|
||||
run: bash scripts/gha/deps_${{ matrix.targetos }}.sh
|
||||
|
||||
- name: Build engine
|
||||
run: bash scripts/gha/build_${{ matrix.targetos }}.sh
|
||||
|
||||
- name: Upload engine (prereleases)
|
||||
run: bash scripts/continious_upload.sh artifacts/*
|
||||
- name: Upload engine (artifacts)
|
||||
uses: actions/upload-artifact@v2
|
||||
with:
|
||||
name: artifact-${{ matrix.targetos }}-${{ matrix.targetarch }}
|
||||
path: artifacts/*
|
||||
11
.gitignore
vendored
11
.gitignore
vendored
@@ -314,9 +314,8 @@ build-*
|
||||
|
||||
# Waf
|
||||
build_current
|
||||
.waf-*
|
||||
waf-*/
|
||||
waf3-*/
|
||||
*waf-*/
|
||||
*waf3-*/
|
||||
.lock-waf*
|
||||
*.lastbuildstate
|
||||
*.unsuccessfulbuild
|
||||
@@ -327,3 +326,9 @@ __pycache__
|
||||
*.vcproj
|
||||
*.sln
|
||||
*.vcxproj
|
||||
|
||||
# Visual Studio Code
|
||||
.vscode/*
|
||||
*.code-workspace
|
||||
.history/*
|
||||
.cache/*
|
||||
3
.gitmodules
vendored
3
.gitmodules
vendored
@@ -10,3 +10,6 @@
|
||||
[submodule "vgui-dev"]
|
||||
path = vgui-dev
|
||||
url = https://github.com/FWGS/vgui-dev
|
||||
[submodule "ref_gl/gl4es"]
|
||||
path = ref_gl/gl4es
|
||||
url = https://github.com/ptitSeb/gl4es
|
||||
|
||||
213
.travis.yml
213
.travis.yml
@@ -1,213 +0,0 @@
|
||||
language: c
|
||||
compiler: gcc
|
||||
sudo: false
|
||||
env:
|
||||
global:
|
||||
- SDL_VERSION=2.0.8
|
||||
- DEPLOY_BRANCH=anewengine
|
||||
git:
|
||||
depth: 50
|
||||
submodules: true
|
||||
jdk:
|
||||
- oraclejdk8
|
||||
|
||||
jobs:
|
||||
include:
|
||||
- stage: init
|
||||
name: "Initialize webdav cache"
|
||||
os: linux
|
||||
cache: false
|
||||
script:
|
||||
- sh scripts/yadisk_clear.sh
|
||||
- stage: build
|
||||
name: "Build for Windows MSVC"
|
||||
cache: ccache
|
||||
os: windows
|
||||
before_script:
|
||||
- sh scripts/travis_common_deps.sh
|
||||
- sh scripts/travis_${TRAVIS_OS_NAME}_deps.sh
|
||||
script:
|
||||
- sh scripts/build_${TRAVIS_OS_NAME}_engine.sh
|
||||
after_script:
|
||||
- sh scripts/continious_upload.sh xash3d-vc.7z xash3d-vc2008-sln.7z
|
||||
- # ...
|
||||
name: "Build for Linux i686"
|
||||
cache: ccache
|
||||
os: linux
|
||||
dist: xenial
|
||||
addons:
|
||||
apt:
|
||||
packages:
|
||||
- gcc-multilib
|
||||
- g++-multilib
|
||||
- libx11-dev:i386
|
||||
- libxext-dev:i386
|
||||
- x11-utils
|
||||
- libgl1-mesa-dev
|
||||
- libasound-dev
|
||||
- libstdc++6:i386
|
||||
- libfuse2:i386
|
||||
- zlib1g:i386
|
||||
- unzip
|
||||
before_script:
|
||||
- export ARCH=i686
|
||||
- sh scripts/travis_common_deps.sh
|
||||
- sh scripts/travis_${TRAVIS_OS_NAME}_deps.sh
|
||||
script:
|
||||
- sh scripts/build_${TRAVIS_OS_NAME}_engine.sh full
|
||||
- sh scripts/build_${TRAVIS_OS_NAME}_engine.sh dedicated
|
||||
after_script:
|
||||
- ccache --show-stats
|
||||
- sh scripts/continious_upload.sh xash3d-fwgs-${ARCH}.AppImage xashds-linux-${ARCH}
|
||||
- # ...
|
||||
name: "Build for Android"
|
||||
cache: ccache
|
||||
os: linux
|
||||
dist: xenial
|
||||
language: java # we want xenial, so just java, not android
|
||||
jdk: openjdk8
|
||||
addons:
|
||||
apt:
|
||||
packages:
|
||||
- clang-9
|
||||
- lld-9
|
||||
- p7zip-full
|
||||
sources:
|
||||
- sourceline: 'deb https://apt.llvm.org/xenial/ llvm-toolchain-xenial-9 main'
|
||||
key_url: 'https://apt.llvm.org/llvm-snapshot.gpg.key'
|
||||
before_script:
|
||||
- export ANDROID_HOME=$TRAVIS_BUILD_DIR/sdk
|
||||
- sh scripts/travis_common_deps.sh
|
||||
- sh scripts/travis_android_deps.sh r10e
|
||||
- export ANDROID_SDK_HOME=$ANDROID_HOME
|
||||
- export ANDROID_NDK_HOME=$ANDROID_SDK_HOME/ndk-bundle
|
||||
script:
|
||||
- cd android
|
||||
- export ARCHS="armeabi armeabi-v7a x86"
|
||||
- export TOOLCHAIN="host"
|
||||
- sh compile.sh release
|
||||
after_script:
|
||||
- ccache --show-stats
|
||||
- sh ../scripts/continious_upload.sh xashdroid.apk
|
||||
- # ...
|
||||
name: "Build for Android 64"
|
||||
cache: ccache
|
||||
os: linux
|
||||
dist: xenial
|
||||
language: java # we want xenial, so just java, not android
|
||||
jdk: openjdk8
|
||||
addons:
|
||||
apt:
|
||||
packages:
|
||||
- clang-9
|
||||
- lld-9
|
||||
- p7zip-full
|
||||
sources:
|
||||
- sourceline: 'deb https://apt.llvm.org/xenial/ llvm-toolchain-xenial-9 main'
|
||||
key_url: 'https://apt.llvm.org/llvm-snapshot.gpg.key'
|
||||
before_script:
|
||||
- export ANDROID_HOME=$TRAVIS_BUILD_DIR/sdk
|
||||
- sh scripts/travis_common_deps.sh
|
||||
- sh scripts/travis_android_deps.sh r10e
|
||||
- export ANDROID_SDK_HOME=$ANDROID_HOME
|
||||
- export ANDROID_NDK_HOME=$ANDROID_SDK_HOME/ndk-bundle
|
||||
script:
|
||||
- cd android
|
||||
- export ARCHS="aarch64 x86_64"
|
||||
- export API=21
|
||||
- export TOOLCHAIN="host"
|
||||
- sh compile.sh release
|
||||
after_script:
|
||||
- ccache --show-stats
|
||||
- mv xashdroid.apk xashdroid-64-test.apk
|
||||
- sh ../scripts/continious_upload.sh xashdroid-64-test.apk
|
||||
- # ...
|
||||
name: "Build for Linux amd64"
|
||||
cache: ccache
|
||||
os: linux
|
||||
dist: xenial
|
||||
addons:
|
||||
apt:
|
||||
packages:
|
||||
- libx11-dev
|
||||
- libxext-dev
|
||||
- x11-utils
|
||||
- libgl1-mesa-dev
|
||||
- libasound-dev
|
||||
- libstdc++6
|
||||
- libfuse2
|
||||
- unzip
|
||||
before_script:
|
||||
- export ARCH=x86_64
|
||||
- sh scripts/travis_common_deps.sh
|
||||
- sh scripts/travis_${TRAVIS_OS_NAME}_deps.sh
|
||||
script:
|
||||
- sh scripts/build_${TRAVIS_OS_NAME}_engine.sh full
|
||||
- sh scripts/build_${TRAVIS_OS_NAME}_engine.sh dedicated
|
||||
after_script:
|
||||
- ccache --show-stats
|
||||
- sh scripts/continious_upload.sh xash3d-fwgs-${ARCH}.AppImage xashds-linux-${ARCH}
|
||||
# - # ...
|
||||
# name: "Build for Windows MinGW"
|
||||
# cache: ccache
|
||||
# os: linux
|
||||
# dist: xenial
|
||||
# addons:
|
||||
# apt:
|
||||
# packages:
|
||||
# - mingw-w64-i686-dev
|
||||
# - binutils-mingw-w64-i686
|
||||
# - gcc-mingw-w64-i686
|
||||
# - g++-mingw-w64-i686
|
||||
# - p7zip-full
|
||||
# before_script:
|
||||
# - sh scripts/travis_common_deps.sh
|
||||
# - sh scripts/travis_mingw_deps.sh
|
||||
# script:
|
||||
# - sh scripts/build_mingw_engine.sh
|
||||
# after_script:
|
||||
# - ccache --show-stats
|
||||
# - sh scripts/continious_upload.sh xash3d-mingw.7z
|
||||
# - # ...
|
||||
# name: "Build for OSX"
|
||||
# cache: ccache
|
||||
# os: osx
|
||||
# before_script:
|
||||
# - sh scripts/travis_common_deps.sh
|
||||
# - sh scripts/travis_${TRAVIS_OS_NAME}_deps.sh
|
||||
# script:
|
||||
# - sh scripts/build_${TRAVIS_OS_NAME}_engine.sh
|
||||
# after_script:
|
||||
# - sh scripts/continious_upload.sh xash3d-osx.tar.bz2
|
||||
- # ...
|
||||
name: "Build for MotoMAGX"
|
||||
sudo: true
|
||||
cache: ccache
|
||||
os: linux
|
||||
dist: xenial
|
||||
addons:
|
||||
apt:
|
||||
packages:
|
||||
- libc6:i386
|
||||
- libstdc++6:i386
|
||||
- gcc-multilib
|
||||
- g++-multilib
|
||||
- p7zip-full
|
||||
sources:
|
||||
- sourceline: 'deb https://apt.llvm.org/xenial/ llvm-toolchain-xenial-9 main'
|
||||
key_url: 'https://apt.llvm.org/llvm-snapshot.gpg.key'
|
||||
before_script:
|
||||
- sh scripts/travis_common_deps.sh
|
||||
- sh scripts/travis_motomagx_deps.sh
|
||||
script:
|
||||
- sh scripts/build_motomagx_engine.sh
|
||||
after_script:
|
||||
- cd $TRAVIS_BUILD_DIR
|
||||
- ccache --show-stats
|
||||
- sh scripts/continious_upload.sh xash3d-magx.7z
|
||||
- stage: deploy
|
||||
name: "Deploy to github repo"
|
||||
os: linux
|
||||
cache: false
|
||||
script:
|
||||
- sh scripts/travis-deploy.sh xash3d-fwgs-i686.AppImage xash3d-fwgs-x86_64.AppImage xash3d-vc.7z xash3d-vc2008-sln.7z xashdroid.apk xashdroid-64-test.apk xashds-linux-i686 xashds-linux-x86_64 xash3d-magx.7z
|
||||
12
Documentation/not-supported-mod-list-and-reasons-why.md
Normal file
12
Documentation/not-supported-mod-list-and-reasons-why.md
Normal file
@@ -0,0 +1,12 @@
|
||||
# Not supported mods and reasons why
|
||||
|
||||
|Name |Version |Why not working |What was made for that
|
||||
|---- |------- |--------------- |----------------------
|
||||
|Blue Shift |The latest steam release |Uses vgui2 library which xash3d does not support |Recreated source code here: https://github.com/FWGS/hlsdk-xash3d/tree/bshift
|
||||
|Counter Strike |1.6(The latest steam release) |Uses vgui2 library which xash3d does not support |Some work on vgui2 support was made here: https://github.com/FWGS/xash3d/tree/vinterface
|
||||
|Counter Strike: Condition Zero |The latest steam release |Uses vgui2 library which xash3d does not support |Some work on vgui2 support was made here: https://github.com/FWGS/xash3d/tree/vinterface
|
||||
|Counter Strike: Condition Zero - Deleted scenes |The latest steam release |Uses vgui2 library which xash3d does not support |Some work on vgui2 support was made here: https://github.com/FWGS/xash3d/tree/vinterface
|
||||
|Day of Defeat |The latest steam release |Uses vgui2 library which xash3d does not support |Some work on vgui2 support was made here: https://github.com/FWGS/xash3d/tree/vinterface
|
||||
|Sven-Coop |5.0+ |Uses filesystem_stdio library which xash3d does not support |filesystem_stdio replacement already was made: https://github.com/FWGS/filesystem_stdio_xash
|
||||
|XDM |3.0.4.0 | |
|
||||
|
||||
334
Documentation/opensource-mods.md
Normal file
334
Documentation/opensource-mods.md
Normal file
@@ -0,0 +1,334 @@
|
||||
Source code of this mods is available for modders and porters in public access.
|
||||
|
||||
# Original Work
|
||||
## Absolute Zero
|
||||
Official gitlab repository - https://gitlab.com/Cobalt-57/half-life-absolute-zero/
|
||||
|
||||
## Adrenaline Gamer
|
||||
Official github repository by Martin \"Bullet\" Webrant - https://github.com/martinwebrant/agmod
|
||||
|
||||
## Arrangement
|
||||
Mirrored on github - https://github.com/JoelTroch/am_src_30jan2011
|
||||
|
||||
## Arrangemode: Rebirth
|
||||
Mirrored on github - https://github.com/JoelTroch/am_src_rebirth
|
||||
|
||||
## Battle Grounds
|
||||
Mirrored on github - https://github.com/nekonomicon/BattleGrounds
|
||||
|
||||
## Bubblemod
|
||||
Download page on official site - http://www.bubblemod.org/dl_default.php
|
||||
|
||||
## Chicken Fortress
|
||||
Official github repository - https://github.com/CKFDevPowered/CKF3Alpha
|
||||
|
||||
## Cold Ice
|
||||
Version 1.9 is available on ModDB - https://www.moddb.com/mods/cold-ice/downloads/cold-ice-sdk
|
||||
Version 1.9 mirrored on github - https://github.com/solidi/hl-mods/tree/master/ci
|
||||
|
||||
## Cold Ice Ressurection
|
||||
Mirrored on github - https://github.com/solidi/hl-mods/tree/master/cir
|
||||
|
||||
## Cthulhu
|
||||
Uploaded to github by Oleg Cherkasky - https://github.com/gunrunners-paradise/Cthulhu-HLmod-SDK
|
||||
|
||||
## Deathmatch Classic
|
||||
Available in Valve's Half-Life repository - https://github.com/ValveSoftware/halflife/tree/master/dmc
|
||||
|
||||
## ESHQ
|
||||
Official github repository - https://github.com/adslbarxatov/xash3d-for-ESHQ
|
||||
|
||||
## Flat-Life
|
||||
Available on GamerLab - http://gamer-lab.com/eng/code_mods_goldsrc/Half-Life_2D_(Flat-Life)
|
||||
|
||||
## Gang Wars
|
||||
Mirrored on github - https://github.com/hammermaps/gw1.45src
|
||||
|
||||
## Go-mod
|
||||
Versions 2.0 and 3.0, available in mod archives on ModDB - https://www.moddb.com/mods/go-mod/downloads
|
||||
|
||||
## GT mod
|
||||
Available on GamerLab - http://gamer-lab.com/eng/code_mods_goldsrc/GT_mod_(Polnie_ishodniki)
|
||||
|
||||
## Half-Life: Advanced Deathmatch
|
||||
Mirrored on github - https://github.com/solidi/hl-mods/tree/master/hla
|
||||
|
||||
## Half-Life: Decay
|
||||
Mirrored on github(PC Port) - https://github.com/hoaxer/Half-Life-Decay
|
||||
|
||||
## Half-Life: Echoes
|
||||
Available on ModDB - https://www.moddb.com/mods/half-life-echoes
|
||||
|
||||
## Half-Life: Expanded Arsenal
|
||||
Available on ModDB - https://www.moddb.com/mods/half-life-expanded-arsenal
|
||||
|
||||
## Half-Life: Gravgun mod
|
||||
Branch **gravgun** in hlsdk-xash3d - https://github.com/FWGS/hlsdk-xash3d/tree/gravgun
|
||||
|
||||
## Half-Life: Invasion
|
||||
official github repository - https://github.com/jlecorre/hlinvasion
|
||||
|
||||
## Half-Life: Pong
|
||||
Mirrored on github - https://github.com/solidi/hl-mods/tree/master/pong
|
||||
|
||||
## Half-Life: Quest Mode
|
||||
Available on cs-mapping.com.ua - https://old.cs-mapping.com.ua/forum/showthread.php?t=38030
|
||||
|
||||
## Half-Life: Top-Down
|
||||
Official gitlab repository - https://gitlab.com/Sockman/hltopdown
|
||||
|
||||
## Half-Life: Update
|
||||
Official github repository - https://github.com/Fograin/hl-subsmod-ex
|
||||
|
||||
## Half-Life: Weapon Edition
|
||||
Available on ModDB - https://www.moddb.com/mods/half-life-weapon-edition/downloads/half-life-weapon-edition-1508-alpha-open-src
|
||||
|
||||
## Half-Life: Year of the Dragon
|
||||
Available on ModDB - https://www.moddb.com/mods/year-of-the-dragon
|
||||
|
||||
## Half-Nuked
|
||||
Available on ModDB - https://www.moddb.com/mods/half-nuked/downloads/half-nuked-src
|
||||
|
||||
## Half-Payne
|
||||
Official github repository - https://github.com/suXinjke/HalfPayne
|
||||
|
||||
## Half-Quake
|
||||
Official github repository - https://github.com/muddasheep/hqtrilogy
|
||||
|
||||
## Half-Rats: Parasomnia
|
||||
Official github repository - https://github.com/HeathGames/half_rats_parasomnia_src
|
||||
|
||||
## Half-Screwed
|
||||
Official github repository - https://github.com/desukuran/half-screwed
|
||||
|
||||
## Headcrab Frenzy
|
||||
Version 1.3 on ModDB - https://www.moddb.com/mods/headcrab-frenzy/downloads/headcrab-frenzy-13-beta-source-code
|
||||
|
||||
## Heart of Evil
|
||||
Available on ModDB - https://www.moddb.com/mods/heart-of-evil/downloads/heart-of-evil-dlls-source-code
|
||||
|
||||
## Ingram Chillin' Mod
|
||||
Official SourceForge repository - https://sourceforge.net/projects/icm-hl/
|
||||
|
||||
## MechMod
|
||||
Official github repository - https://github.com/vermagav/mechmod
|
||||
|
||||
## Mortal Combat Forever
|
||||
Available on GamerLab - http://gamer-lab.com/eng/code_mods_goldsrc/Mortal_Combat_Forever_(Polnie_ishodniki)
|
||||
|
||||
## Natural Selection
|
||||
Official github repository - https://github.com/unknownworlds/NS
|
||||
|
||||
## Overturn
|
||||
Available in mod archive on ModDB - https://www.moddb.com/mods/overturn
|
||||
|
||||
## Spirit of Half-Life
|
||||
[Logic&Trick's](https://github.com/LogicAndTrick) mirror - https://files.logic-and-trick.com/#/Half-Life/Mods/Spirit%20of%20Half-Life
|
||||
|
||||
## Threewave CTF
|
||||
*Unfinished mod by Valve Software*
|
||||
|
||||
Available in Valve's Half-Life repository with Deathmatch Classic sources - https://github.com/ValveSoftware/halflife/tree/master/dmc
|
||||
|
||||
## Trinity Render
|
||||
Available on ModDB: https://www.moddb.com/mods/half-life-episode-two/downloads/trinity-rendering-engine-v308f
|
||||
|
||||
## Tyrian: Ground Assault
|
||||
Available on ModDB: https://www.moddb.com/mods/tyriangroundassault/downloads/tyrianga-v1-0-src
|
||||
|
||||
## Paranoia
|
||||
Available on ModDB: https://www.moddb.com/mods/paranoia/downloads/paranoia-toolkit
|
||||
|
||||
## Paranoia 2: The Savior
|
||||
Prealpha, mirrored on github - https://github.com/a1batross/Paranoia2_ancient
|
||||
|
||||
Version 1.51, mirrored on github - https://github.com/a1batross/Paranoia2_original
|
||||
|
||||
## Raven City
|
||||
*Unfinished mod*
|
||||
|
||||
Was found on HLFX - http://hlfx.ru/forum/showthread.php?s=2c892dfc52f72be52a89c3f52a397cd0&threadid=1819&postid=44674#post44674
|
||||
|
||||
## Ricochet
|
||||
Available in Valve's Half-Life repository - https://github.com/ValveSoftware/halflife/tree/master/ricochet
|
||||
|
||||
## Wizard Wars
|
||||
Download page on official site - http://www.thothie.com/ww/
|
||||
|
||||
## XashXT
|
||||
Mirrored on github - https://github.com/a1batross/XashXT_original
|
||||
|
||||
## Zombie-X
|
||||
Available in mod archive on ModDB - https://www.moddb.com/mods/zombie-x-10-final/downloads/zombie-x-10-dle-beta6-last-version
|
||||
|
||||
## ZXC
|
||||
Available on ModDB - https://www.moddb.com/mods/zxc-mod-133/downloads/zxc-mod-136-final
|
||||
|
||||
Mirrored on github - https://github.com/ZXCmod/ZXCmod
|
||||
|
||||
# Reimplementation
|
||||
## Absolute Redemption
|
||||
Branch **redempt** in hlsdk-xash3d - https://github.com/FWGS/hlsdk-xash3d/tree/redempt
|
||||
|
||||
## Adrenaline Gamer
|
||||
OpenAG by YaLTeR - https://github.com/YaLTeR/OpenAG
|
||||
|
||||
## Afraid of Monsters
|
||||
malortie's recreation - https://github.com/malortie/hl-aom
|
||||
|
||||
Branch **aom** in hlsdk-xash3d - https://github.com/FWGS/hlsdk-xash3d/tree/aom
|
||||
|
||||
## Afraid of Monsters: Director's cut
|
||||
Reverse-engineered code, branch **aomdc** in hlsdk-xash3d - https://github.com/FWGS/hlsdk-xash3d/tree/aomdc
|
||||
|
||||
## Azure Sheep
|
||||
malortie's recreation - https://github.com/malortie/hl-asheep
|
||||
|
||||
Reverse-engineered code, branch **asheep** in hlsdk-xash3d - https://github.com/FWGS/hlsdk-xash3d/tree/asheep
|
||||
|
||||
## Big Lolly
|
||||
malortie's recreation - https://github.com/malortie/hl-biglolly
|
||||
|
||||
Branch **biglolly** in hlsdk-xash3d - https://github.com/FWGS/hlsdk-xash3d/tree/biglolly
|
||||
|
||||
## Black Ops
|
||||
malortie's recreation - https://github.com/malortie/hl-blackops
|
||||
|
||||
Branch **blackops** in hlsdk-xash3d - https://github.com/FWGS/hlsdk-xash3d/tree/blackops
|
||||
|
||||
## Bloody Pizza: Vendetta
|
||||
Branch **caseclosed** in hlsdk-xash3d - https://github.com/FWGS/hlsdk-xash3d/tree/caseclosed
|
||||
|
||||
## Case Closed
|
||||
Branch **caseclosed** in hlsdk-xash3d - https://github.com/FWGS/hlsdk-xash3d/tree/caseclosed
|
||||
|
||||
## Cleaner's Adventures
|
||||
Branch **CAd** in hlsdk-xash3d - https://github.com/FWGS/hlsdk-xash3d/tree/CAd
|
||||
|
||||
## Counter Strike
|
||||
Reverse-engineered code of client part by a1batross - https://github.com/FWGS/cs16-client/tree/v1.32
|
||||
|
||||
Reverse-engineered code of server part by nagist - https://github.com/nagist/cs16nd
|
||||
|
||||
Reverse-engineered code of server part by s1lentq - https://github.com/s1lentq/ReGameDLL_CS
|
||||
|
||||
## Counter Strike Online
|
||||
CSO-like Xash3D-based mod, CSMoE - https://github.com/MoeMod/CSMoE
|
||||
|
||||
## Crack-Life: Campaign Mode
|
||||
Recreation by lostgamer aka nillerusr - https://github.com/LostGamerHL/crack_life
|
||||
|
||||
## Escape from the Darkness
|
||||
malortie's recreation - https://github.com/malortie/hl-eftd
|
||||
|
||||
Reverse-engineered code, branch **eftd** in hlsdk-xash3d - https://github.com/FWGS/hlsdk-xash3d/tree/eftd
|
||||
|
||||
## Half-Life: Blue Shift
|
||||
Unkle Mike's recreation - https://hlfx.ru/forum/showthread.php?s=&threadid=5253
|
||||
|
||||
Reverse-engineered code, branch **bshift** in hlsdk-xash3d - https://github.com/FWGS/hlsdk-xash3d/tree/bshift
|
||||
|
||||
## Half-Life: Induction
|
||||
Branch **induction** in hlsdk-xash3d - https://github.com/FWGS/hlsdk-xash3d/tree/induction
|
||||
|
||||
## Half-Life: Opposing Force
|
||||
Recreation by lostgamer aka nillerusr - https://github.com/LostGamerHL/hlsdk-xash3d
|
||||
|
||||
Reverse-engineered code, clean branch **opfor** in hlsdk-xash3d - https://github.com/FWGS/hlsdk-xash3d/tree/opfor
|
||||
|
||||
Spirit of Half Life: Opposing-Force Edition - https://github.com/Hammermaps-DEV/SOHL-V1.9-Opposing-Force-Edition
|
||||
|
||||
## Half-Life: Rebellion
|
||||
Reverse-engineered code, branch **rebellion** in hlsdk-xash3d - https://github.com/FWGS/hlsdk-xash3d/tree/rebellion
|
||||
|
||||
## Half-Life: Visitors
|
||||
malortie's recreation - https://github.com/malortie/hl-visitors
|
||||
|
||||
Reverse-engineered code, branch **visitors** in hlsdk-xash3d - https://github.com/FWGS/hlsdk-xash3d/tree/visitors
|
||||
|
||||
## Half-Secret
|
||||
Branch **half-secret** in hlsdk-xash3d - https://github.com/FWGS/hlsdk-xash3d/tree/half-secret
|
||||
|
||||
## Night at the Office
|
||||
malortie's recreation - https://github.com/malortie/hl-nato
|
||||
|
||||
Branch **noffice** in hlsdk-xash3d - https://github.com/FWGS/hlsdk-xash3d/tree/noffice
|
||||
|
||||
## Poke 646
|
||||
malortie's recreation - https://github.com/malortie/hl-poke646
|
||||
|
||||
Reverse-engineered code, branch **poke646** in hlsdk-xash3d - https://github.com/FWGS/hlsdk-xash3d/tree/poke646
|
||||
|
||||
## Poke 646: Vendetta
|
||||
malortie's recreation - https://github.com/malortie/hl-poke646-vendetta
|
||||
|
||||
Reverse-engineered code, branch **poke646_vendetta** in hlsdk-xash3d - https://github.com/FWGS/hlsdk-xash3d/tree/poke646_vendetta
|
||||
|
||||
## Residual Life
|
||||
Reverse-engineered code, branch **residual_point** in hlsdk-xash3d - https://github.com/FWGS/hlsdk-xash3d/tree/residual_point
|
||||
|
||||
## Residual Point
|
||||
Reverse-engineered code, branch **residual_point** in hlsdk-xash3d - https://github.com/FWGS/hlsdk-xash3d/tree/residual_point
|
||||
|
||||
## Team Fortress Classic
|
||||
Reverse-engineered code by Velaron - https://github.com/Velaron/tf15-client
|
||||
|
||||
## The Gate
|
||||
malortie's recreation - https://github.com/malortie/hl-thegate
|
||||
|
||||
Reverse-engineered code, branch **thegate** in hlsdk-xash3d - https://github.com/FWGS/hlsdk-xash3d/tree/thegate
|
||||
|
||||
## They Hunger
|
||||
malortie's recreation - https://github.com/malortie/hl-theyhunger
|
||||
|
||||
Reverse-engineered code, branch **theyhunger** in hlsdk-xash3d - https://github.com/FWGS/hlsdk-xash3d/tree/theyhunger
|
||||
|
||||
They Hunger: Tactical - https://www.moddb.com/mods/they-hunger-tactical/downloads/tht-source-code-documentation
|
||||
|
||||
## Times of Troubles
|
||||
malortie's recreation - https://github.com/malortie/hl-tot
|
||||
|
||||
Branch **tot** in hlsdk-xash3d - https://github.com/FWGS/hlsdk-xash3d/tree/tot
|
||||
|
||||
# Derived work
|
||||
## Adrenaline Gamer
|
||||
Branch **aghl** in hlsdk-xash3d - https://github.com/FWGS/hlsdk-xash3d/tree/aghl
|
||||
|
||||
## Bubblemod
|
||||
Branch **bubblemod** in hlsdk-xash3d - https://github.com/FWGS/hlsdk-xash3d/tree/bubblemod
|
||||
|
||||
## Deathmatch Classic
|
||||
Deathmatch Classic: Adrenaline Gamer Edition - https://github.com/martinwebrant/agmod/tree/master/src/dmc
|
||||
|
||||
Deathmatch Quaked - https://www.moddb.com/games/deathmatch-classic/downloads/dmq2
|
||||
|
||||
Branch **dmc** in hlsdk-xash3d - https://github.com/FWGS/hlsdk-xash3d/tree/dmc
|
||||
|
||||
## Half-Life: Echoes
|
||||
Branch **echoes** in hlsdk-xash3d - https://github.com/FWGS/hlsdk-xash3d/tree/echoes
|
||||
|
||||
## Half-Life: Invasion
|
||||
Port to HLSDK 2.4 by malortie - https://github.com/malortie/hl-invasion
|
||||
|
||||
Port to Linux by fmoraw - https://github.com/fmoraw/hlinvasion
|
||||
|
||||
## Half-Life: Top-Down
|
||||
Branch **hltopdown** in hlsdk-xash3d - https://github.com/FWGS/hlsdk-xash3d/tree/hltopdown
|
||||
|
||||
## Half-Screwed
|
||||
Branch **half-screwed** in hlsdk-xash3d - https://github.com/FWGS/hlsdk-xash3d/tree/half-screwed
|
||||
|
||||
## Natural Selection
|
||||
Port to Linux - https://github.com/fmoraw/NS
|
||||
|
||||
## Swiss Cheese Halloween 2002
|
||||
Just more playable version by malortie - https://github.com/malortie/hl-shall
|
||||
|
||||
Branch **halloween** in hlsdk-xash3d - https://github.com/FWGS/hlsdk-xash3d/tree/halloween
|
||||
|
||||
## Threewave CTF
|
||||
Branch **dmc** in hlsdk-xash3d - https://github.com/FWGS/hlsdk-xash3d/tree/dmc
|
||||
|
||||
## Zombie-X
|
||||
Branch **zombie-x** in hlsdk-xash3d - https://github.com/FWGS/hlsdk-xash3d/tree/zombie-x
|
||||
|
||||
@@ -15,22 +15,24 @@ Status:
|
||||
|
||||
Table is sorted by status.
|
||||
|
||||
| Platform | Status | Maintainer | Note
|
||||
| -------- | ------ | ---------- | ----
|
||||
| Windows | Supported | @a1batross |
|
||||
| Linux(x86) | Supported | @a1batross, @mittorn |
|
||||
| Linux(amd64) | Supported | @mittorn |
|
||||
| *BSD | Supported | @nekonomicon |
|
||||
| Linux(arm) | Supported | @a1batross, @mittorn |
|
||||
| Android | Supported | @a1batross, @mittorn |
|
||||
| MotoMAGX | Supported | @a1batross |
|
||||
| Linux(elbrus) | In progress | @a1batross, @mittorn | Rare and eventual access to e2k machine
|
||||
| Android/Linux(aarch64) | In progress | @a1batross |
|
||||
| Linux(mipsel) | In progress | @mittorn |
|
||||
| Haiku | Incomplete, Old Engine | not maintained |
|
||||
| Emscripten | Incomplete, Old Engine | not maintained |
|
||||
| PSVita | Not merged, Old Engine | not maintained | [GitHub Repository](https://github.com/fgsfdsfgs/vitaXash3D)
|
||||
| Switch | Not merged, Old Engine | not maintained | [GitHub Repository](https://github.com/switchports/xash3d-switch)
|
||||
| 3DS | Not merged, Old Engine | not maintained | [GitHub Repository](https://github.com/masterfeizz/Xash3DS)
|
||||
| macOS | Deprecated | not maintained | See GitHub issue #61
|
||||
| iOS | Deprecated | not maintained | See GitHub issue #61
|
||||
| Platform | Status | Maintainer | Note
|
||||
| -------- | ------ | ---------- | ----
|
||||
| Windows | Supported | @a1batross, @SNMetamorph |
|
||||
| *BSD | Supported | @nekonomicon |
|
||||
| GNU/Linux(x86, amd64, arm) | Supported | @a1batross, @mittorn |
|
||||
| Android | Supported | @a1batross, @mittorn |
|
||||
| MotoMAGX | Supported | @a1batross |
|
||||
| GNU/Linux(elbrus) | Supported | @a1batross, @mittorn | Rare and eventual access to e2k machine
|
||||
| Haiku | Supported | not maintained | Was added by #478 and #483
|
||||
| DOS4GW | Supported | @mittorn |
|
||||
| GNU/Linux(mipsel) | Supported | @mittorn |
|
||||
| Switch | In progress | @fgsfdsfgs | [GitHub Repository](https://github.com/fgsfdsfgs/xash3d-fwgs/tree/switch_new)
|
||||
| Wii | In progress | Collaborative effort | [GitHub Repository](https://github.com/saucesaft/xash3d-wii)
|
||||
| PSP | In progress | @Crow_bar, @Velaron | [GitHub Repository](https://github.com/Crow-bar/xash3d-fwgs)
|
||||
| Emscripten | Old Engine | not maintained |
|
||||
| Oculus Quest | Old Engine fork | @DrBeef | [GitHub Repository](https://github.com/DrBeef/Lambda1VR)
|
||||
| PSVita | Old Engine fork | not maintained | [GitHub Repository](https://github.com/fgsfdsfgs/vitaXash3D)
|
||||
| Switch | Old Engine fork | not maintained | [GitHub Repository](https://github.com/switchports/xash3d-switch)
|
||||
| 3DS | Old Engine fork | not maintained | [GitHub Repository](https://github.com/masterfeizz/Xash3DS)
|
||||
| macOS | Deprecated | not maintained | See GitHub issue #61
|
||||
| iOS | Deprecated | not maintained | See GitHub issue #61
|
||||
|
||||
@@ -120,7 +120,7 @@ For mappacks - place *.bsp files to **valve/maps** folder, *.wad files to **valv
|
||||
89. [Gut Reaction](http://www.moddb.com/mods/gut-reaction)
|
||||
90. [Half-Life C.A.G.E.D.](https://store.steampowered.com/app/679990/HalfLife_Caged/) (set **-num edicts 4096** in command-line parameters for successful start)
|
||||
90. [Half-Life: Dreamcast v1.1](http://www.moddb.com/mods/half-life-dreamcast)
|
||||
91. [Half-Life: OPS](http://www.dcfan.net.ru/forum/f109/half-life-ops-3791/) (link dead!)
|
||||
91. [Half-Life: OPS](https://www.runthinkshootlive.com/posts/half-life-ops/)
|
||||
92. [Half-Life: Uplink](https://www.fileplanet.com/10360/10000/fileinfo/Half-Life:-UpLink-Demo)
|
||||
92. [Half-Quake](http://www.moddb.com/mods/halfquake-amen)
|
||||
93. [Half-Quake 2: Amen](http://www.moddb.com/mods/halfquake-amen)
|
||||
@@ -206,7 +206,7 @@ For mappacks - place *.bsp files to **valve/maps** folder, *.wad files to **valv
|
||||
173. [Run for Life](https://www.runthinkshootlive.com/posts/run-for-life/) (the "stolen" version of this mod with changed menu background also known as *Mad Escape*)
|
||||
174. [S.W.A.T.](http://www.moddb.com/mods/swat2)
|
||||
175. [Sabotage](https://www.runthinkshootlive.com/posts/sabotage-2/)
|
||||
176. [Sagharmath](http://hl.webz.cz/hl1/eng.php?what=rec&zkratka=sa) (link dead!)
|
||||
176. [Sagharmath](https://www.moddb.com/games/half-life/addons/sagharmath)
|
||||
177. [Sandscroll](https://gamebanana.com/maps/15988)
|
||||
178. [Saving Bob](https://www.runthinkshootlive.com/posts/saving-bob/)
|
||||
179. [Secret Base](https://www.runthinkshootlive.com/posts/secret-base/)
|
||||
@@ -217,12 +217,12 @@ For mappacks - place *.bsp files to **valve/maps** folder, *.wad files to **valv
|
||||
184. [Sky Mesa](http://www.moddb.com/mods/sky-mesa)
|
||||
185. [Sleephorst v1.5](http://www.moddb.com/mods/sleephorst-v15)
|
||||
186. [Smart Decoy](http://www.moddb.com/mods/smart-decoy)
|
||||
187. [Somewhere in Time](http://twhl.info/vault.php?map=5530) (link dead!)
|
||||
188. [Sooper 2](http://www.k-saz.freeserve.co.uk/projects.htm) (link dead!)
|
||||
187. [Somewhere in Time](https://www.runthinkshootlive.com/posts/somewhere-in-time/)
|
||||
188. [Sooper2](https://www.runthinkshootlive.com/posts/sooper-2/)
|
||||
189. [Split-Second](http://twhl.info/vault.php?map=4343)
|
||||
190. [Subhumanity](https://www.runthinkshootlive.com/posts/sub-humanity/)
|
||||
191. [Terror Side](https://www.runthinkshootlive.com/posts/terror-side/) (set **sv_validate_changelevel** to **0** to avoid problem with level change between some maps)
|
||||
192. [Test Your Skill](http://www.tys-mod.de.vu/&e=40455876) (link dead!)
|
||||
192. [Test Your Skill](https://www.moddb.com/games/half-life/addons/test-your-skill)
|
||||
193. [The Challenger Deep](https://www.runthinkshootlive.com/posts/challenger-deep/)
|
||||
194. [The Challenger Deep 2](http://www.moddb.com/mods/the-challenger-deep-2)
|
||||
195. [The Evil Thing](http://www.moddb.com/mods/the-evil-thing)
|
||||
@@ -287,7 +287,7 @@ For mappacks - place *.bsp files to **valve/maps** folder, *.wad files to **valv
|
||||
11. [HL Shadows, Part 1](https://www.fileplanet.com/7466/0/fileinfo/'HL-Shadows',-Part-1)
|
||||
12. [HLNewEnd](http://twhl.info/vault.php?map=2275)
|
||||
13. [Kleiners Adventures Demo](http://www.moddb.com/mods/kleiners-adventures)
|
||||
14. [Kleiners Adventures: The White Line Demo](https://www.gamefront.com/files/13595030/Kleiners_Adventure_siemka321_edition) (link dead!)
|
||||
14. [Kleiners Adventures: The White Line Demo](https://www.moddb.com/mods/kleiners-adventure-siemka321-edition)
|
||||
15. [LV-426: Episode 1](https://www.runthinkshootlive.com/posts/lv426-version-a/)
|
||||
16. [Malevolence(1.3 and older)](http://www.moddb.com/mods/malevolence)
|
||||
17. [Meth-Life Demo v1.0](https://www.gamewatcher.com/mods/half-life-mod/meth-life-mod-demo-1-0)
|
||||
@@ -317,7 +317,7 @@ For mappacks - place *.bsp files to **valve/maps** folder, *.wad files to **valv
|
||||
41. [Zombieland v1.1](http://www.moddb.com/mods/zombieland)
|
||||
|
||||
## Just mappacks
|
||||
1. [AvsM 1 v1.2](http://www.moddb.com/mods/avsm-2-project-xen/downloads/avsm-1-v12-full-version-croeng) (link dead!)
|
||||
1. [AvsM 1 v1.2](https://www.moddb.com/mods/avsm-1-2003-version-re-release/)
|
||||
2. [Cook The Headcrab Episodes 1 & 2](http://www.moddb.com/games/half-life/addons/cook-the-headcrab-episode-series)
|
||||
3. [Cook The Headcrab Episode 3](http://www.moddb.com/games/half-life/addons/cook-the-headcrab-episode-3)
|
||||
4. [Cook The Headcrab Episode 4](http://www.moddb.com/games/half-life/addons/cook-the-headcrab-episode-4)
|
||||
@@ -422,7 +422,7 @@ Mods:
|
||||
33. [C2](https://www.runthinkshootlive.com/posts/c2/)
|
||||
34. [C3](https://www.runthinkshootlive.com/posts/c3/)
|
||||
35. [C5](https://www.runthinkshootlive.com/posts/c5/)
|
||||
36. [Caged](http://www.caylegeorge.com/ld_history/cg_maps.htm) (link dead!)
|
||||
36. [Caged](https://store.steampowered.com/app/679990/HalfLife_Caged/)
|
||||
37. [Camera Puzzle](http://twhl.info/vault.php?map=740) (this map perfectly demonstrates an improved feature of Xash3D Engine - game is correctly saving and restoring 3rd person view for the player after loading a previously saved game)
|
||||
38. [CataXen](http://twhl.info/vault.php?map=3429)
|
||||
39. [Cause of Death](http://twhl.info/competitions.php?results=7)
|
||||
@@ -641,7 +641,7 @@ Mods:
|
||||
252. [Tower](http://twhl.info/vault.php?map=250) (Required Spirit of Half-Life for item_suit)
|
||||
253. [TriggerHappy](https://www.fileplanet.com/8929/0/fileinfo/TriggerHappy)
|
||||
254. [TriggerHappy2](https://www.fileplanet.com/13503/10000/fileinfo/TriggerHappy2)
|
||||
255. [TriggerHappy2.5](http://www.atomicgamer.com/files/14120/trhappy25-zip) (link dead!)
|
||||
255. [TriggerHappy2.5](https://www.moddb.com/games/half-life/addons/trigger-happy-v25)
|
||||
256. [Trouble](https://gamebanana.com/maps/166033)
|
||||
257. [Tunnels](http://twhl.info/vault.php?map=5350)
|
||||
258. [Twisted Hazard Course](https://www.fileplanet.com/52919/50000/fileinfo/Twisted-Hazard-Course)
|
||||
@@ -708,7 +708,7 @@ For Linux and OS X you must download crossbuild from [here](http://www.moddb.com
|
||||
16. [Radiation Alert: Episode 1 v1.1](http://www.moddb.com/mods/radiation-alert-episode-1)
|
||||
17. [Run From Hell v1.1b](https://www.runthinkshootlive.com/posts/run-from-hell/) (there is an inner bug with underwater crates in the map **firstmap9** - they can't be broken, so you should use **noclip** to pass through them)
|
||||
18. [Santa's Revenge](http://twhl.info/vault.php?map=4332) (set **fps_max** to **60** to avoid an inner problem of the last map with final scripted sequence, otherwise the mod can not be finished properly)
|
||||
19. [Sector 6](http://www.moddb.com/mods/sector-6x) (link dead!)
|
||||
19. [Sector 6](https://www.moddb.com/mods/sector-6/)
|
||||
20. [Space Prisoner v1.1](http://www.moddb.com/games/half-life/addons/space-prisoner-v11) (after installing of the mod open **liblist.gam** or **gameinfo.txt** file in the mod's folder and correct the line **gamedll "..\prison\dlls\spirit.dll"** for **gamedll "dlls\spirit.dll"**, otherwise you'll not be able to start a game; there is also a scripting error on a third map of the mod, so you'll be forced to use **noclip** to pass around bugged place)
|
||||
21. [Terrorist Attack 2](http://terroristattack.wz.cz/mody.html) (link dead!)
|
||||
22. [Timeline III: The Heart of Darkness](http://www.moddb.com/mods/timeline-series)
|
||||
@@ -739,7 +739,7 @@ For Linux and OS X you must download crossbuild from [here](http://www.moddb.com
|
||||
1. [Before v1.0](http://www.moddb.com/mods/half-life-before)
|
||||
2. [Christmas Life v1.0](http://www.moddb.com/mods/christmas-life) (initial mod works properly, but additional mappacks for this mod contain few maps that have some gameplay problems under Xash3D)
|
||||
3. [COLONY 42 Alpha](http://twhl.info/vault.php?map=6055)
|
||||
4. [Crazy Crabs Demo 1 & 2](http://www.moddb.com/mods/mad-crabs-2014) (link dead!)
|
||||
4. [Crazy Crabs Demo 1 & 2](https://www.moddb.com/mods/mad-crabs)
|
||||
5. [Far Crab Demo v2](http://www.moddb.com/mods/far-crab)
|
||||
6. [Firefighter Demo v1.1](http://www.moddb.com/mods/firefighter-mod)
|
||||
7. [Halfquake 3: Sunrise](http://www.moddb.com/mods/halfquake-amen)
|
||||
@@ -780,7 +780,7 @@ For mappacks - place *.bsp files to **gearbox/maps** folder, *.wad files to **ge
|
||||
16. [Mechanized Death: An Army of None](http://www.moddb.com/games/half-life-opposing-force/addons/mechanized-death-army-of-none)
|
||||
17. [Nuclear Winter](http://www.moddb.com/mods/nuclear-winter-opfor)
|
||||
18. [Opposing Force Aliens Addon](https://www.fileplanet.com/82829/80000/fileinfo/Half-Life:-Opposing-Force-Aliens-Addon-1.2)
|
||||
19. [Opposing Life2Life](https://www.gamewatcher.com/) (link dead!)
|
||||
19. [Opposing Life2Life](https://www.moddb.com/games/half-life/addons/opposing-life2life-final-hd)
|
||||
20. [Realms](http://www.snarkpit.net/index.php?s=maps&map=3483)
|
||||
21. [Shepard's Adventures](http://www.moddb.com/mods/shepards-adventures)
|
||||
22. [Snowy Rock](http://www.moddb.com/games/half-life-opposing-force/addons/snow-rock)
|
||||
|
||||
70
README.md
70
README.md
@@ -1,5 +1,6 @@
|
||||
# Xash3D FWGS Engine
|
||||
[](https://travis-ci.org/FWGS/xash3d-fwgs) [](https://discord.gg/TbnHcVb)
|
||||
[](https://github.com/FWGS/xash3d-fwgs/actions/workflows/c-cpp.yml) [](https://cirrus-ci.com/github/FWGS/xash3d-fwgs) [](http://fwgsdiscord.mentality.rip/) \
|
||||
[](https://github.com/FWGS/xash3d-fwgs/releases/latest) [](https://github.com/FWGS/xash3d-fwgs/releases/tag/continuous)
|
||||
|
||||
Xash3D FWGS is a fork of Xash3D Engine by Unkle Mike with extended features and crossplatform.
|
||||
|
||||
@@ -9,19 +10,15 @@ as well as to give game developers well known workflow and extend it.
|
||||
Read more about Xash3D on ModDB: https://www.moddb.com/engines/xash3d-engine
|
||||
```
|
||||
|
||||
Latest release build: https://github.com/FWGS/xash3d-fwgs/releases/latest
|
||||
|
||||
Latest development build: https://github.com/FWGS/xash3d-deploy/tree/newengine-master
|
||||
|
||||
## Fork features
|
||||
* HLSDK 2.4 support.
|
||||
* Crossplatform: officially supported x86 and ARM on Windows/Linux/BSD/Android. (see Documentation/ports.md for more info)
|
||||
* Crossplatform: supported x86 and ARM on Windows/Linux/BSD/Android. ([see docs for more info](Documentation/ports.md))
|
||||
* Modern compilers support: say no more to MSVC6.
|
||||
* Better multiplayer support: multiple master servers, headless dedicated server.
|
||||
* Mobility API: allows better game integration on mobile devices(vibration, touch controls)
|
||||
* Different input methods: touch, gamepad and classic mouse & keyboard.
|
||||
* TrueType font rendering, as a part of mainui_cpp.
|
||||
* Multiple renderers support(OpenGL, GLES, Software)
|
||||
* Multiple renderers support: OpenGL, GLESv1, GLESv2, Software
|
||||
* A set of small improvements, without broken compatibility.
|
||||
|
||||
## Planned fork features
|
||||
@@ -29,17 +26,36 @@ Latest development build: https://github.com/FWGS/xash3d-deploy/tree/newengine-m
|
||||
* Voice support
|
||||
* Vulkan renderer
|
||||
|
||||
## Installation & Running
|
||||
0) Get Xash3D FWGS binaries: you can use [testing](https://github.com/FWGS/xash3d-fwgs/releases/tag/continuous) build or you can compile engine from source code.
|
||||
1) Copy engine binaries to some directory.
|
||||
2) Copy `valve` directory from [Half-Life](https://store.steampowered.com/app/70/HalfLife/) to directory with engine binaries.
|
||||
If your CPU is NOT x86 compatible or you're running 64-bit version of the engine, you may want to compile [Half-Life SDK](https://github.com/FWGS/hlsdk-xash3d).
|
||||
This repository contains our fork of HLSDK and restored source code for some of the mods. Not all of them, of course.
|
||||
You still needed to copy `valve` directory as all game resources located there.
|
||||
3) Run the main executable (`xash3d.exe` or AppImage).
|
||||
|
||||
For additional info, run Xash3D with `-help` command line key.
|
||||
|
||||
## Contributing
|
||||
* Before sending an issue, check if someone already reported your issue. Make sure you're following "How To Ask Questions The Smart Way" guide by Eric Steven Raymond. Read more: http://www.catb.org/~esr/faqs/smart-questions.html
|
||||
* Before sending a PR, check if you followed our coding guide in CODING_STYLE.md file.
|
||||
* Issues are accepted in both English and Russian
|
||||
* Before sending a PR, check if you followed our contribution guide in CONTRIBUTING.md file.
|
||||
|
||||
## Build instructions
|
||||
We are using Waf build system. If you have some Waf-related questions, I recommend you to read https://waf.io/book/
|
||||
|
||||
If you're stuck somewhere and you need a clear example, read `.travis.yml` and `scripts/build*.sh`.
|
||||
NOTE: NEVER USE GitHub's ZIP ARCHIVES. GitHub doesn't include external dependencies we're using!
|
||||
|
||||
### Prerequisites
|
||||
#### Windows(Visual Studio)
|
||||
|
||||
If your CPU is x86 compatible, we are building 32-bit code by default. This was dont for keeping compatibility with Steam releases of Half-Life and based on it's engine games.
|
||||
Even if Xash3D FWGS does support targetting 64-bit, you can't load games without recompiling them from source code!
|
||||
|
||||
If your CPU is NOT x86 compatible or you decided build 64-bit version of engine, you may want to compile [Half-Life SDK](https://github.com/FWGS/hlsdk-xash3d).
|
||||
This repository contains our fork of HLSDK and restored source code for some of the mods. Not all of them, of course.
|
||||
|
||||
#### Windows (Visual Studio)
|
||||
* Install Visual Studio.
|
||||
* Install latest [Python](https://python.org) **OR** run `cinst python.install` if you have Chocolatey.
|
||||
* Install latest [Git](https://git-scm.com/download/win) **OR** run `cinst git.install` if you have Chocolatey.
|
||||
@@ -48,46 +64,32 @@ If you're stuck somewhere and you need a clear example, read `.travis.yml` and `
|
||||
* Make sure you have at least 12GB of free space to store all build-time dependencies: ~10GB for Visual Studio, 300 MB for Git, 100 MB for Python and other.
|
||||
|
||||
#### GNU/Linux
|
||||
NOTE FOR USERS WITH X86 COMPATIBLE CPUs:
|
||||
We have forced build system to throw an error, if you're trying to build 64-bit engine. This done for keeping compatibility with Steam releases of Half-Life and based on it's engine games.
|
||||
Even if Xash3D FWGS does support targetting 64-bit, you can't load games without recompiling them from source code!
|
||||
|
||||
##### Debian/Ubuntu
|
||||
* Enable i386 on your system, if you're compiling 32-bit engine on amd64. If not, skip this
|
||||
|
||||
`$ sudo dpkg --add-architecture i386`
|
||||
* Install development tools
|
||||
* For 32-bit engine on amd64:
|
||||
|
||||
* For 32-bit engine on amd64: \
|
||||
`$ sudo apt install build-essential gcc-multilib g++-multilib python libsdl2-dev:i386 libfontconfig-dev:i386 libfreetype6-dev:i386`
|
||||
* For everything else:
|
||||
|
||||
* For everything else: \
|
||||
`$ sudo apt install build-essential python libsdl2-dev libfontconfig-dev libfreetype6-dev`
|
||||
* Clone this repostory:
|
||||
`$ git clone --recursive https://github.com/FWGS/xash3d-fwgs`
|
||||
|
||||
#### ArchLinux
|
||||
* ArchLinux users are lucky enough and there is a `xash3d-git` AUR package for them.
|
||||
|
||||
### Building
|
||||
#### Windows(Visual Studio)
|
||||
#### Windows (Visual Studio)
|
||||
0) Open command line
|
||||
1) Navigate to `xash3d-fwgs` directory.
|
||||
2) Carefully examine which build options are available: `waf --help`
|
||||
3) Configure build: `waf configure -T release --sdl2=c:/path/to/SDL2 --prefix=c:/path/to/any/output/directory`
|
||||
3) Configure build: `waf configure -T release --sdl2=c:/path/to/SDL2`
|
||||
4) Compile: `waf build`
|
||||
5) Install: `waf install`
|
||||
5) Install: `waf install --destdir=c:/path/to/any/output/directory`
|
||||
|
||||
#### Linux
|
||||
If compiling 32-bit on amd64, you may need to supply `export PKG_CONFIG_PATH=/usr/lib/i386-linux-gnu/pkgconfig` prior to running configure.
|
||||
|
||||
0) Examine which build options are available: `./waf --help`
|
||||
1) Configure build: `./waf configure -T release --prefix=/path/to/any/output/directory`
|
||||
(To compile 64-bit engine on 64-bit x86 processor, you need to pass `-8` also)
|
||||
1) Configure build: `./waf configure -T release`
|
||||
(You need to pass `-8` to compile 64-bit engine on 64-bit x86 processor)
|
||||
2) Compile: `./waf build`
|
||||
3) Install(optional): `./waf install`
|
||||
|
||||
## Running
|
||||
0) Copy libraries and main executable somewhere, if you're skipped installation stage.
|
||||
1) Copy game files to same directory
|
||||
2) Run `xash3d.exe`/`xash3d.sh`/`xash3d` depending on which platform you're using.
|
||||
|
||||
For additional info, run Xash3D with `-help` command line key.
|
||||
3) Install(optional): `./waf install --destdir=/path/to/any/output/directory`
|
||||
|
||||
@@ -20,6 +20,8 @@ GNU General Public License for more details.
|
||||
#define VIDEO_SDL 1
|
||||
#define VIDEO_ANDROID 2
|
||||
#define VIDEO_FBDEV 3
|
||||
#define VIDEO_DOS 4
|
||||
|
||||
|
||||
// audio backends (XASH_SOUND)
|
||||
#define SOUND_NULL 0
|
||||
@@ -42,8 +44,9 @@ GNU General Public License for more details.
|
||||
// timer (XASH_TIMER)
|
||||
#define TIMER_NULL 0 // not used
|
||||
#define TIMER_SDL 1
|
||||
#define TIMER_LINUX 2
|
||||
#define TIMER_POSIX 2
|
||||
#define TIMER_WIN32 3
|
||||
#define TIMER_DOS 4
|
||||
|
||||
// messageboxes (XASH_MESSAGEBOX)
|
||||
#define MSGBOX_STDERR 0
|
||||
@@ -51,4 +54,12 @@ GNU General Public License for more details.
|
||||
#define MSGBOX_ANDROID 2
|
||||
#define MSGBOX_WIN32 3
|
||||
|
||||
|
||||
// library loading (XASH_LIB)
|
||||
#define LIB_NULL 0
|
||||
#define LIB_POSIX 1
|
||||
#define LIB_WIN32 2
|
||||
#define LIB_STATIC 3
|
||||
|
||||
|
||||
#endif /* BACKENDS_H */
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
/***
|
||||
*
|
||||
* Copyright (c) 1996-2002, Valve LLC. All rights reserved.
|
||||
*
|
||||
* This product contains software technology licensed from Id
|
||||
* Software, Inc. ("Id Technology"). Id Technology (c) 1996 Id Software, Inc.
|
||||
*
|
||||
* This product contains software technology licensed from Id
|
||||
* Software, Inc. ("Id Technology"). Id Technology (c) 1996 Id Software, Inc.
|
||||
* All Rights Reserved.
|
||||
*
|
||||
* Use, distribution, and modification of this source code and/or resulting
|
||||
|
||||
@@ -48,7 +48,7 @@ BRUSH MODELS
|
||||
|
||||
#define SURF_PLANEBACK BIT( 1 ) // plane should be negated
|
||||
#define SURF_DRAWSKY BIT( 2 ) // sky surface
|
||||
#define SURF_DRAWTURB_QUADS BIT( 3 ) // all subidivided polygons are quads
|
||||
#define SURF_DRAWTURB_QUADS BIT( 3 ) // all subidivided polygons are quads
|
||||
#define SURF_DRAWTURB BIT( 4 ) // warp surface
|
||||
#define SURF_DRAWTILED BIT( 5 ) // face without lighmap
|
||||
#define SURF_CONVEYOR BIT( 6 ) // scrolled texture (was SURF_DRAWBACKGROUND)
|
||||
@@ -166,7 +166,7 @@ typedef struct
|
||||
{
|
||||
int id; // must be little endian XASH
|
||||
int version;
|
||||
dlump_t lumps[EXTRA_LUMPS];
|
||||
dlump_t lumps[EXTRA_LUMPS];
|
||||
} dextrahdr_t;
|
||||
|
||||
typedef struct
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
/***
|
||||
*
|
||||
* Copyright (c) 1996-2002, Valve LLC. All rights reserved.
|
||||
*
|
||||
* This product contains software technology licensed from Id
|
||||
* Software, Inc. ("Id Technology"). Id Technology (c) 1996 Id Software, Inc.
|
||||
*
|
||||
* This product contains software technology licensed from Id
|
||||
* Software, Inc. ("Id Technology"). Id Technology (c) 1996 Id Software, Inc.
|
||||
* All Rights Reserved.
|
||||
*
|
||||
* Use, distribution, and modification of this source code and/or resulting
|
||||
@@ -33,7 +33,7 @@ typedef struct
|
||||
|
||||
typedef struct
|
||||
{
|
||||
float prevanimtime;
|
||||
float prevanimtime;
|
||||
float sequencetime;
|
||||
byte prevseqblending[2];
|
||||
vec3_t prevorigin;
|
||||
|
||||
@@ -9,7 +9,7 @@ NOTE: number at end of pixelformat name it's a total bitscount e.g. PF_RGB_24 ==
|
||||
========================================================================
|
||||
*/
|
||||
#define ImageRAW( type ) (type == PF_RGBA_32 || type == PF_BGRA_32 || type == PF_RGB_24 || type == PF_BGR_24 || type == PF_LUMINANCE)
|
||||
#define ImageDXT( type ) (type == PF_DXT1 || type == PF_DXT3 || type == PF_DXT5 || type == PF_ATI2)
|
||||
#define ImageDXT( type ) (type == PF_DXT1 || type == PF_DXT3 || type == PF_DXT5 || type == PF_ATI2 || type == PF_BC6H_SIGNED || type == PF_BC6H_UNSIGNED || type == PF_BC7)
|
||||
|
||||
typedef enum
|
||||
{
|
||||
@@ -21,10 +21,13 @@ typedef enum
|
||||
PF_RGB_24, // uncompressed dds or another 24-bit image
|
||||
PF_BGR_24, // big-endian RGB (MacOS)
|
||||
PF_LUMINANCE,
|
||||
PF_DXT1, // s3tc DXT1 format
|
||||
PF_DXT3, // s3tc DXT3 format
|
||||
PF_DXT5, // s3tc DXT5 format
|
||||
PF_ATI2, // latc ATI2N format
|
||||
PF_DXT1, // s3tc DXT1/BC1 format
|
||||
PF_DXT3, // s3tc DXT3/BC2 format
|
||||
PF_DXT5, // s3tc DXT5/BC3 format
|
||||
PF_ATI2, // latc ATI2N/BC5 format
|
||||
PF_BC6H_SIGNED, // bptc BC6H signed FP16 format
|
||||
PF_BC6H_UNSIGNED, // bptc BC6H unsigned FP16 format
|
||||
PF_BC7, // bptc BC7 format
|
||||
PF_TOTALCOUNT, // must be last
|
||||
} pixformat_t;
|
||||
|
||||
@@ -82,7 +85,7 @@ typedef enum
|
||||
IMAGE_ROT_90 = BIT(18), // flip from upper left corner to down right corner
|
||||
IMAGE_ROT180 = IMAGE_FLIP_X|IMAGE_FLIP_Y,
|
||||
IMAGE_ROT270 = IMAGE_FLIP_X|IMAGE_FLIP_Y|IMAGE_ROT_90,
|
||||
IMAGE_EMBOSS = BIT(19), // apply emboss mapping
|
||||
// reserved
|
||||
IMAGE_RESAMPLE = BIT(20), // resample image to specified dims
|
||||
// reserved
|
||||
// reserved
|
||||
|
||||
@@ -32,16 +32,17 @@ GNU General Public License for more details.
|
||||
|
||||
#define MIPLEVELS 4
|
||||
#define VERTEXSIZE 7
|
||||
#define MAXLIGHTMAPS 4
|
||||
#define MAXLIGHTMAPS 4 // max light styles per face
|
||||
#define MAXDYNLIGHTS 8 // maximum dynamic lights per one pixel
|
||||
#define NUM_AMBIENTS 4 // automatic ambient sounds
|
||||
|
||||
// model types
|
||||
typedef enum
|
||||
{
|
||||
mod_bad = -1,
|
||||
mod_brush,
|
||||
mod_sprite,
|
||||
mod_alias,
|
||||
mod_brush,
|
||||
mod_sprite,
|
||||
mod_alias,
|
||||
mod_studio
|
||||
} modtype_t;
|
||||
|
||||
@@ -92,7 +93,7 @@ typedef struct texture_s
|
||||
struct texture_s *alternate_anims; // bmodels in frame 1 use these
|
||||
unsigned short fb_texturenum; // auto-luma texturenum
|
||||
unsigned short dt_texturenum; // detail-texture binding
|
||||
unsigned int unused[3]; // reserved
|
||||
unsigned int unused[3]; // reserved
|
||||
} texture_t;
|
||||
|
||||
typedef struct
|
||||
@@ -146,7 +147,7 @@ typedef struct mnode_s
|
||||
|
||||
// node specific
|
||||
mplane_t *plane;
|
||||
struct mnode_s *children[2];
|
||||
struct mnode_s *children[2];
|
||||
#ifdef SUPPORT_BSP2_FORMAT
|
||||
int firstsurface;
|
||||
int numsurfaces;
|
||||
@@ -165,7 +166,7 @@ struct decal_s
|
||||
decal_t *pnext; // linked list for each surface
|
||||
msurface_t *psurface; // Surface id for persistence / unlinking
|
||||
float dx; // local texture coordinates
|
||||
float dy; //
|
||||
float dy; //
|
||||
float scale; // Pixel scale
|
||||
short texture; // Decal texture
|
||||
short flags; // Decal flags FDECAL_*
|
||||
@@ -290,7 +291,7 @@ typedef struct model_s
|
||||
// shared modelinfo
|
||||
modtype_t type; // model type
|
||||
int numframes; // sprite's framecount
|
||||
byte *mempool; // private mempool (was synctype)
|
||||
poolhandle_t mempool; // private mempool (was synctype)
|
||||
int flags; // hl compatibility
|
||||
|
||||
//
|
||||
@@ -298,7 +299,7 @@ typedef struct model_s
|
||||
//
|
||||
vec3_t mins, maxs; // bounding box at angles '0 0 0'
|
||||
float radius;
|
||||
|
||||
|
||||
// brush model
|
||||
int firstmodelsurface;
|
||||
int nummodelsurfaces;
|
||||
@@ -385,7 +386,7 @@ typedef struct player_info_s
|
||||
int bottomcolor;
|
||||
|
||||
// last frame rendered
|
||||
int renderframe;
|
||||
int renderframe;
|
||||
|
||||
// Gait frame estimation
|
||||
int gaitsequence;
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
/***
|
||||
*
|
||||
* Copyright (c) 1996-2002, Valve LLC. All rights reserved.
|
||||
*
|
||||
* This product contains software technology licensed from Id
|
||||
* Software, Inc. ("Id Technology"). Id Technology (c) 1996 Id Software, Inc.
|
||||
*
|
||||
* This product contains software technology licensed from Id
|
||||
* Software, Inc. ("Id Technology"). Id Technology (c) 1996 Id Software, Inc.
|
||||
* All Rights Reserved.
|
||||
*
|
||||
* Use, distribution, and modification of this source code and/or resulting
|
||||
|
||||
354
common/const.h
354
common/const.h
@@ -1,9 +1,9 @@
|
||||
/***
|
||||
*
|
||||
* Copyright (c) 1996-2002, Valve LLC. All rights reserved.
|
||||
*
|
||||
* This product contains software technology licensed from Id
|
||||
* Software, Inc. ("Id Technology"). Id Technology (c) 1996 Id Software, Inc.
|
||||
*
|
||||
* This product contains software technology licensed from Id
|
||||
* Software, Inc. ("Id Technology"). Id Technology (c) 1996 Id Software, Inc.
|
||||
* All Rights Reserved.
|
||||
*
|
||||
* Use, distribution, and modification of this source code and/or resulting
|
||||
@@ -20,45 +20,45 @@
|
||||
// Most came from server.h
|
||||
|
||||
// edict->flags
|
||||
#define FL_FLY (1<<0) // Changes the SV_Movestep() behavior to not need to be on ground
|
||||
#define FL_SWIM (1<<1) // Changes the SV_Movestep() behavior to not need to be on ground (but stay in water)
|
||||
#define FL_CONVEYOR (1<<2)
|
||||
#define FL_CLIENT (1<<3)
|
||||
#define FL_INWATER (1<<4)
|
||||
#define FL_MONSTER (1<<5)
|
||||
#define FL_GODMODE (1<<6)
|
||||
#define FL_NOTARGET (1<<7)
|
||||
#define FL_SKIPLOCALHOST (1<<8) // Don't send entity to local host, it's predicting this entity itself
|
||||
#define FL_ONGROUND (1<<9) // At rest / on the ground
|
||||
#define FL_PARTIALGROUND (1<<10) // not all corners are valid
|
||||
#define FL_WATERJUMP (1<<11) // player jumping out of water
|
||||
#define FL_FROZEN (1<<12) // Player is frozen for 3rd person camera
|
||||
#define FL_FAKECLIENT (1<<13) // JAC: fake client, simulated server side; don't send network messages to them
|
||||
#define FL_DUCKING (1<<14) // Player flag -- Player is fully crouched
|
||||
#define FL_FLOAT (1<<15) // Apply floating force to this entity when in water
|
||||
#define FL_GRAPHED (1<<16) // worldgraph has this ent listed as something that blocks a connection
|
||||
#define FL_FLY (1U<<0) // Changes the SV_Movestep() behavior to not need to be on ground
|
||||
#define FL_SWIM (1U<<1) // Changes the SV_Movestep() behavior to not need to be on ground (but stay in water)
|
||||
#define FL_CONVEYOR (1U<<2)
|
||||
#define FL_CLIENT (1U<<3)
|
||||
#define FL_INWATER (1U<<4)
|
||||
#define FL_MONSTER (1U<<5)
|
||||
#define FL_GODMODE (1U<<6)
|
||||
#define FL_NOTARGET (1U<<7)
|
||||
#define FL_SKIPLOCALHOST (1U<<8) // Don't send entity to local host, it's predicting this entity itself
|
||||
#define FL_ONGROUND (1U<<9) // At rest / on the ground
|
||||
#define FL_PARTIALGROUND (1U<<10) // not all corners are valid
|
||||
#define FL_WATERJUMP (1U<<11) // player jumping out of water
|
||||
#define FL_FROZEN (1U<<12) // Player is frozen for 3rd person camera
|
||||
#define FL_FAKECLIENT (1U<<13) // JAC: fake client, simulated server side; don't send network messages to them
|
||||
#define FL_DUCKING (1U<<14) // Player flag -- Player is fully crouched
|
||||
#define FL_FLOAT (1U<<15) // Apply floating force to this entity when in water
|
||||
#define FL_GRAPHED (1U<<16) // worldgraph has this ent listed as something that blocks a connection
|
||||
|
||||
// UNDONE: Do we need these?
|
||||
#define FL_IMMUNE_WATER (1<<17)
|
||||
#define FL_IMMUNE_SLIME (1<<18)
|
||||
#define FL_IMMUNE_LAVA (1<<19)
|
||||
#define FL_IMMUNE_WATER (1U<<17)
|
||||
#define FL_IMMUNE_SLIME (1U<<18)
|
||||
#define FL_IMMUNE_LAVA (1U<<19)
|
||||
|
||||
#define FL_PROXY (1<<20) // This is a spectator proxy
|
||||
#define FL_ALWAYSTHINK (1<<21) // Brush model flag -- call think every frame regardless of nextthink - ltime (for constantly changing velocity/path)
|
||||
#define FL_BASEVELOCITY (1<<22) // Base velocity has been applied this frame (used to convert base velocity into momentum)
|
||||
#define FL_MONSTERCLIP (1<<23) // Only collide in with monsters who have FL_MONSTERCLIP set
|
||||
#define FL_ONTRAIN (1<<24) // Player is _controlling_ a train, so movement commands should be ignored on client during prediction.
|
||||
#define FL_WORLDBRUSH (1<<25) // Not moveable/removeable brush entity (really part of the world, but represented as an entity for transparency or something)
|
||||
#define FL_SPECTATOR (1<<26) // This client is a spectator, don't run touch functions, etc.
|
||||
#define FL_LASERDOT (1<<27) // Predicted laser spot from rocket launcher
|
||||
#define FL_PROXY (1U<<20) // This is a spectator proxy
|
||||
#define FL_ALWAYSTHINK (1U<<21) // Brush model flag -- call think every frame regardless of nextthink - ltime (for constantly changing velocity/path)
|
||||
#define FL_BASEVELOCITY (1U<<22) // Base velocity has been applied this frame (used to convert base velocity into momentum)
|
||||
#define FL_MONSTERCLIP (1U<<23) // Only collide in with monsters who have FL_MONSTERCLIP set
|
||||
#define FL_ONTRAIN (1U<<24) // Player is _controlling_ a train, so movement commands should be ignored on client during prediction.
|
||||
#define FL_WORLDBRUSH (1U<<25) // Not moveable/removeable brush entity (really part of the world, but represented as an entity for transparency or something)
|
||||
#define FL_SPECTATOR (1U<<26) // This client is a spectator, don't run touch functions, etc.
|
||||
#define FL_LASERDOT (1U<<27) // Predicted laser spot from rocket launcher
|
||||
|
||||
#define FL_CUSTOMENTITY (1<<29) // This is a custom entity
|
||||
#define FL_KILLME (1<<30) // This entity is marked for death -- This allows the engine to kill ents at the appropriate time
|
||||
#define FL_DORMANT (1<<31) // Entity is dormant, no updates to client
|
||||
#define FL_CUSTOMENTITY (1U<<29) // This is a custom entity
|
||||
#define FL_KILLME (1U<<30) // This entity is marked for death -- This allows the engine to kill ents at the appropriate time
|
||||
#define FL_DORMANT (1U<<31) // Entity is dormant, no updates to client
|
||||
|
||||
// Goes into globalvars_t.trace_flags
|
||||
#define FTRACE_SIMPLEBOX (1<<0) // Traceline with a simple box
|
||||
#define FTRACE_IGNORE_GLASS (1<<1) // traceline will be ignored entities with rendermode != kRenderNormal
|
||||
#define FTRACE_SIMPLEBOX (1U<<0) // Traceline with a simple box
|
||||
#define FTRACE_IGNORE_GLASS (1U<<1) // traceline will be ignored entities with rendermode != kRenderNormal
|
||||
|
||||
// walkmove modes
|
||||
#define WALKMOVE_NORMAL 0 // normal walkmove
|
||||
@@ -114,50 +114,50 @@
|
||||
#define EF_LIGHT 64 // rocket flare glow sprite
|
||||
#define EF_NODRAW 128 // don't draw entity
|
||||
|
||||
#define EF_WATERSIDES (1<<26) // Do not remove sides for func_water entity
|
||||
#define EF_FULLBRIGHT (1<<27) // Just get fullbright
|
||||
#define EF_NOSHADOW (1<<28) // ignore shadow for this entity
|
||||
#define EF_MERGE_VISIBILITY (1<<29) // this entity allowed to merge vis (e.g. env_sky or portal camera)
|
||||
#define EF_REQUEST_PHS (1<<30) // This entity requested phs bitvector instead of pvsbitvector in AddToFullPack calls
|
||||
#define EF_WATERSIDES (1U<<26) // Do not remove sides for func_water entity
|
||||
#define EF_FULLBRIGHT (1U<<27) // Just get fullbright
|
||||
#define EF_NOSHADOW (1U<<28) // ignore shadow for this entity
|
||||
#define EF_MERGE_VISIBILITY (1U<<29) // this entity allowed to merge vis (e.g. env_sky or portal camera)
|
||||
#define EF_REQUEST_PHS (1U<<30) // This entity requested phs bitvector instead of pvsbitvector in AddToFullPack calls
|
||||
// g-cont. one reserved bit here for me
|
||||
|
||||
// entity flags
|
||||
#define EFLAG_SLERP 1 // do studio interpolation of this entity
|
||||
|
||||
|
||||
//
|
||||
// temp entity events
|
||||
//
|
||||
#define TE_BEAMPOINTS 0 // beam effect between two points
|
||||
// coord coord coord (start position)
|
||||
// coord coord coord (end position)
|
||||
// short (sprite index)
|
||||
// byte (starting frame)
|
||||
// byte (frame rate in 0.1's)
|
||||
// byte (life in 0.1's)
|
||||
// byte (line width in 0.1's)
|
||||
// byte (noise amplitude in 0.01's)
|
||||
// coord coord coord (start position)
|
||||
// coord coord coord (end position)
|
||||
// short (sprite index)
|
||||
// byte (starting frame)
|
||||
// byte (frame rate in 0.1's)
|
||||
// byte (life in 0.1's)
|
||||
// byte (line width in 0.1's)
|
||||
// byte (noise amplitude in 0.01's)
|
||||
// byte,byte,byte (color)
|
||||
// byte (brightness)
|
||||
// byte (scroll speed in 0.1's)
|
||||
|
||||
#define TE_BEAMENTPOINT 1 // beam effect between point and entity
|
||||
// short (start entity)
|
||||
// coord coord coord (end position)
|
||||
// short (sprite index)
|
||||
// byte (starting frame)
|
||||
// byte (frame rate in 0.1's)
|
||||
// byte (life in 0.1's)
|
||||
// byte (line width in 0.1's)
|
||||
// byte (noise amplitude in 0.01's)
|
||||
// short (start entity)
|
||||
// coord coord coord (end position)
|
||||
// short (sprite index)
|
||||
// byte (starting frame)
|
||||
// byte (frame rate in 0.1's)
|
||||
// byte (life in 0.1's)
|
||||
// byte (line width in 0.1's)
|
||||
// byte (noise amplitude in 0.01's)
|
||||
// byte,byte,byte (color)
|
||||
// byte (brightness)
|
||||
// byte (scroll speed in 0.1's)
|
||||
|
||||
#define TE_GUNSHOT 2 // particle effect plus ricochet sound
|
||||
// coord coord coord (position)
|
||||
// coord coord coord (position)
|
||||
|
||||
#define TE_EXPLOSION 3 // additive sprite, 2 dynamic lights, flickering particles, explosion sound, move vertically 8 pps
|
||||
// coord coord coord (position)
|
||||
// coord coord coord (position)
|
||||
// short (sprite index)
|
||||
// byte (scale in 0.1's)
|
||||
// byte (framerate)
|
||||
@@ -173,54 +173,54 @@
|
||||
#define TE_EXPLFLAG_ROTATE 32 // rotate the sprite randomly
|
||||
|
||||
#define TE_TAREXPLOSION 4 // Quake1 "tarbaby" explosion with sound
|
||||
// coord coord coord (position)
|
||||
// coord coord coord (position)
|
||||
|
||||
#define TE_SMOKE 5 // alphablend sprite, move vertically 30 pps
|
||||
// coord coord coord (position)
|
||||
// coord coord coord (position)
|
||||
// short (sprite index)
|
||||
// byte (scale in 0.1's)
|
||||
// byte (framerate)
|
||||
|
||||
#define TE_TRACER 6 // tracer effect from point to point
|
||||
// coord, coord, coord (start)
|
||||
// coord, coord, coord (start)
|
||||
// coord, coord, coord (end)
|
||||
|
||||
#define TE_LIGHTNING 7 // TE_BEAMPOINTS with simplified parameters
|
||||
// coord, coord, coord (start)
|
||||
// coord, coord, coord (end)
|
||||
// byte (life in 0.1's)
|
||||
// byte (width in 0.1's)
|
||||
// coord, coord, coord (start)
|
||||
// coord, coord, coord (end)
|
||||
// byte (life in 0.1's)
|
||||
// byte (width in 0.1's)
|
||||
// byte (amplitude in 0.01's)
|
||||
// short (sprite model index)
|
||||
|
||||
#define TE_BEAMENTS 8
|
||||
// short (start entity)
|
||||
// short (end entity)
|
||||
// short (sprite index)
|
||||
// byte (starting frame)
|
||||
// byte (frame rate in 0.1's)
|
||||
// byte (life in 0.1's)
|
||||
// byte (line width in 0.1's)
|
||||
// byte (noise amplitude in 0.01's)
|
||||
#define TE_BEAMENTS 8
|
||||
// short (start entity)
|
||||
// short (end entity)
|
||||
// short (sprite index)
|
||||
// byte (starting frame)
|
||||
// byte (frame rate in 0.1's)
|
||||
// byte (life in 0.1's)
|
||||
// byte (line width in 0.1's)
|
||||
// byte (noise amplitude in 0.01's)
|
||||
// byte,byte,byte (color)
|
||||
// byte (brightness)
|
||||
// byte (scroll speed in 0.1's)
|
||||
|
||||
#define TE_SPARKS 9 // 8 random tracers with gravity, ricochet sprite
|
||||
// coord coord coord (position)
|
||||
// coord coord coord (position)
|
||||
|
||||
#define TE_LAVASPLASH 10 // Quake1 lava splash
|
||||
// coord coord coord (position)
|
||||
// coord coord coord (position)
|
||||
|
||||
#define TE_TELEPORT 11 // Quake1 teleport splash
|
||||
// coord coord coord (position)
|
||||
// coord coord coord (position)
|
||||
|
||||
#define TE_EXPLOSION2 12 // Quake1 colormaped (base palette) particle explosion with sound
|
||||
// coord coord coord (position)
|
||||
// coord coord coord (position)
|
||||
// byte (starting color)
|
||||
// byte (num colors)
|
||||
|
||||
#define TE_BSPDECAL 13 // Decal from the .BSP file
|
||||
#define TE_BSPDECAL 13 // Decal from the .BSP file
|
||||
// coord, coord, coord (x,y,z), decal position (center of texture in world)
|
||||
// short (texture index of precached decal texture name)
|
||||
// short (entity index)
|
||||
@@ -230,67 +230,67 @@
|
||||
// coord, coord, coord (position)
|
||||
// byte (radius)
|
||||
// byte (count)
|
||||
// byte (life in 0.1's)
|
||||
// byte (life in 0.1's)
|
||||
|
||||
#define TE_SPRITETRAIL 15 // line of moving glow sprites with gravity, fadeout, and collisions
|
||||
// coord, coord, coord (start)
|
||||
// coord, coord, coord (end)
|
||||
// coord, coord, coord (start)
|
||||
// coord, coord, coord (end)
|
||||
// short (sprite index)
|
||||
// byte (count)
|
||||
// byte (life in 0.1's)
|
||||
// byte (scale in 0.1's)
|
||||
// byte (life in 0.1's)
|
||||
// byte (scale in 0.1's)
|
||||
// byte (velocity along vector in 10's)
|
||||
// byte (randomness of velocity in 10's)
|
||||
|
||||
#define TE_BEAM 16 // obsolete
|
||||
|
||||
#define TE_SPRITE 17 // additive sprite, plays 1 cycle
|
||||
// coord, coord, coord (position)
|
||||
// short (sprite index)
|
||||
// byte (scale in 0.1's)
|
||||
// coord, coord, coord (position)
|
||||
// short (sprite index)
|
||||
// byte (scale in 0.1's)
|
||||
// byte (brightness)
|
||||
|
||||
#define TE_BEAMSPRITE 18 // A beam with a sprite at the end
|
||||
// coord, coord, coord (start position)
|
||||
// coord, coord, coord (end position)
|
||||
// short (beam sprite index)
|
||||
// short (end sprite index)
|
||||
// coord, coord, coord (start position)
|
||||
// coord, coord, coord (end position)
|
||||
// short (beam sprite index)
|
||||
// short (end sprite index)
|
||||
|
||||
#define TE_BEAMTORUS 19 // screen aligned beam ring, expands to max radius over lifetime
|
||||
// coord coord coord (center position)
|
||||
// coord coord coord (axis and radius)
|
||||
// short (sprite index)
|
||||
// byte (starting frame)
|
||||
// byte (frame rate in 0.1's)
|
||||
// byte (life in 0.1's)
|
||||
// byte (line width in 0.1's)
|
||||
// byte (noise amplitude in 0.01's)
|
||||
// coord coord coord (center position)
|
||||
// coord coord coord (axis and radius)
|
||||
// short (sprite index)
|
||||
// byte (starting frame)
|
||||
// byte (frame rate in 0.1's)
|
||||
// byte (life in 0.1's)
|
||||
// byte (line width in 0.1's)
|
||||
// byte (noise amplitude in 0.01's)
|
||||
// byte,byte,byte (color)
|
||||
// byte (brightness)
|
||||
// byte (scroll speed in 0.1's)
|
||||
|
||||
#define TE_BEAMDISK 20 // disk that expands to max radius over lifetime
|
||||
// coord coord coord (center position)
|
||||
// coord coord coord (axis and radius)
|
||||
// short (sprite index)
|
||||
// byte (starting frame)
|
||||
// byte (frame rate in 0.1's)
|
||||
// byte (life in 0.1's)
|
||||
// byte (line width in 0.1's)
|
||||
// byte (noise amplitude in 0.01's)
|
||||
// coord coord coord (center position)
|
||||
// coord coord coord (axis and radius)
|
||||
// short (sprite index)
|
||||
// byte (starting frame)
|
||||
// byte (frame rate in 0.1's)
|
||||
// byte (life in 0.1's)
|
||||
// byte (line width in 0.1's)
|
||||
// byte (noise amplitude in 0.01's)
|
||||
// byte,byte,byte (color)
|
||||
// byte (brightness)
|
||||
// byte (scroll speed in 0.1's)
|
||||
|
||||
#define TE_BEAMCYLINDER 21 // cylinder that expands to max radius over lifetime
|
||||
// coord coord coord (center position)
|
||||
// coord coord coord (axis and radius)
|
||||
// short (sprite index)
|
||||
// byte (starting frame)
|
||||
// byte (frame rate in 0.1's)
|
||||
// byte (life in 0.1's)
|
||||
// byte (line width in 0.1's)
|
||||
// byte (noise amplitude in 0.01's)
|
||||
// coord coord coord (center position)
|
||||
// coord coord coord (axis and radius)
|
||||
// short (sprite index)
|
||||
// byte (starting frame)
|
||||
// byte (frame rate in 0.1's)
|
||||
// byte (life in 0.1's)
|
||||
// byte (line width in 0.1's)
|
||||
// byte (noise amplitude in 0.01's)
|
||||
// byte,byte,byte (color)
|
||||
// byte (brightness)
|
||||
// byte (scroll speed in 0.1's)
|
||||
@@ -298,30 +298,30 @@
|
||||
#define TE_BEAMFOLLOW 22 // create a line of decaying beam segments until entity stops moving
|
||||
// short (entity:attachment to follow)
|
||||
// short (sprite index)
|
||||
// byte (life in 0.1's)
|
||||
// byte (line width in 0.1's)
|
||||
// byte (life in 0.1's)
|
||||
// byte (line width in 0.1's)
|
||||
// byte,byte,byte (color)
|
||||
// byte (brightness)
|
||||
|
||||
#define TE_GLOWSPRITE 23
|
||||
#define TE_GLOWSPRITE 23
|
||||
// coord, coord, coord (pos) short (model index) byte (scale / 10)
|
||||
|
||||
#define TE_BEAMRING 24 // connect a beam ring to two entities
|
||||
// short (start entity)
|
||||
// short (end entity)
|
||||
// short (sprite index)
|
||||
// byte (starting frame)
|
||||
// byte (frame rate in 0.1's)
|
||||
// byte (life in 0.1's)
|
||||
// byte (line width in 0.1's)
|
||||
// byte (noise amplitude in 0.01's)
|
||||
// short (start entity)
|
||||
// short (end entity)
|
||||
// short (sprite index)
|
||||
// byte (starting frame)
|
||||
// byte (frame rate in 0.1's)
|
||||
// byte (life in 0.1's)
|
||||
// byte (line width in 0.1's)
|
||||
// byte (noise amplitude in 0.01's)
|
||||
// byte,byte,byte (color)
|
||||
// byte (brightness)
|
||||
// byte (scroll speed in 0.1's)
|
||||
|
||||
#define TE_STREAK_SPLASH 25 // oriented shower of tracers
|
||||
// coord coord coord (start position)
|
||||
// coord coord coord (direction vector)
|
||||
// coord coord coord (start position)
|
||||
// coord coord coord (direction vector)
|
||||
// byte (color)
|
||||
// short (count)
|
||||
// short (base speed)
|
||||
@@ -330,15 +330,15 @@
|
||||
#define TE_BEAMHOSE 26 // obsolete
|
||||
|
||||
#define TE_DLIGHT 27 // dynamic light, effect world, minor entity effect
|
||||
// coord, coord, coord (pos)
|
||||
// byte (radius in 10's)
|
||||
// coord, coord, coord (pos)
|
||||
// byte (radius in 10's)
|
||||
// byte byte byte (color)
|
||||
// byte (life in 10's)
|
||||
// byte (decay rate in 10's)
|
||||
|
||||
#define TE_ELIGHT 28 // point entity light, no world effect
|
||||
// short (entity:attachment to follow)
|
||||
// coord coord coord (initial position)
|
||||
// coord coord coord (initial position)
|
||||
// coord (radius)
|
||||
// byte byte byte (color)
|
||||
// byte (life in 0.1's)
|
||||
@@ -374,8 +374,8 @@
|
||||
|
||||
#define TE_LARGEFUNNEL 100
|
||||
// coord coord coord (funnel position)
|
||||
// short (sprite index)
|
||||
// short (flags)
|
||||
// short (sprite index)
|
||||
// short (flags)
|
||||
|
||||
#define TE_BLOODSTREAM 101 // particle spray
|
||||
// coord coord coord (start position)
|
||||
@@ -404,7 +404,7 @@
|
||||
// byte (density)
|
||||
|
||||
#define TE_MODEL 106 // create a moving model that bounces and makes a sound when it hits
|
||||
// coord, coord, coord (position)
|
||||
// coord, coord, coord (position)
|
||||
// coord, coord, coord (velocity)
|
||||
// angle (initial yaw)
|
||||
// short (model index)
|
||||
@@ -441,7 +441,7 @@
|
||||
// byte (speed)
|
||||
// byte (noise)
|
||||
|
||||
#define TE_ARMOR_RICOCHET 111 // quick spark sprite, client ricochet sound.
|
||||
#define TE_ARMOR_RICOCHET 111 // quick spark sprite, client ricochet sound.
|
||||
// coord, coord, coord (position)
|
||||
// byte (scale in 0.1's)
|
||||
|
||||
@@ -529,7 +529,7 @@
|
||||
#define TEFIRE_FLAG_SOMEFLOAT 2 // some of the sprites will drift upwards. (50% chance)
|
||||
#define TEFIRE_FLAG_LOOP 4 // if set, sprite plays at 15 fps, otherwise plays at whatever rate stretches the animation over the sprite's duration.
|
||||
#define TEFIRE_FLAG_ALPHA 8 // if set, sprite is rendered alpha blended at 50% else, opaque
|
||||
#define TEFIRE_FLAG_PLANAR 16 // if set, all fire sprites have same initial Z instead of randomly filling a cube.
|
||||
#define TEFIRE_FLAG_PLANAR 16 // if set, all fire sprites have same initial Z instead of randomly filling a cube.
|
||||
#define TEFIRE_FLAG_ADDITIVE 32 // if set, sprite is rendered as additive
|
||||
|
||||
#define TE_PLAYERATTACHMENT 124 // attaches a TENT to a player (this is a high-priority tent)
|
||||
@@ -606,13 +606,6 @@
|
||||
#define CONTENT_GRAVITY_FLYFIELD -18
|
||||
#define CONTENT_FOG -19
|
||||
|
||||
#define CONTENT_EMPTY -1
|
||||
#define CONTENT_SOLID -2
|
||||
#define CONTENT_WATER -3
|
||||
#define CONTENT_SLIME -4
|
||||
#define CONTENT_LAVA -5
|
||||
#define CONTENT_SKY -6
|
||||
|
||||
// channels
|
||||
#define CHAN_AUTO 0
|
||||
#define CHAN_WEAPON 1
|
||||
@@ -620,7 +613,7 @@
|
||||
#define CHAN_ITEM 3
|
||||
#define CHAN_BODY 4
|
||||
#define CHAN_STREAM 5 // allocate stream channel from the static or dynamic area
|
||||
#define CHAN_STATIC 6 // allocate channel from the static area
|
||||
#define CHAN_STATIC 6 // allocate channel from the static area
|
||||
#define CHAN_NETWORKVOICE_BASE 7 // voice data coming across the network
|
||||
#define CHAN_NETWORKVOICE_END 500 // network voice data reserves slots (CHAN_NETWORKVOICE_BASE through CHAN_NETWORKVOICE_END).
|
||||
|
||||
@@ -628,7 +621,7 @@
|
||||
#define ATTN_NONE 0
|
||||
#define ATTN_NORM (float)0.8
|
||||
#define ATTN_IDLE (float)2
|
||||
#define ATTN_STATIC (float)1.25
|
||||
#define ATTN_STATIC (float)1.25
|
||||
|
||||
// pitch values
|
||||
#define PITCH_NORM 100 // non-pitch shifted
|
||||
@@ -647,22 +640,22 @@
|
||||
#define SF_TRAIN_PASSABLE 8 // Train is not solid -- used to make water trains
|
||||
|
||||
// buttons
|
||||
#define IN_ATTACK (1<<0)
|
||||
#define IN_JUMP (1<<1)
|
||||
#define IN_DUCK (1<<2)
|
||||
#define IN_FORWARD (1<<3)
|
||||
#define IN_BACK (1<<4)
|
||||
#define IN_USE (1<<5)
|
||||
#define IN_CANCEL (1<<6)
|
||||
#define IN_LEFT (1<<7)
|
||||
#define IN_RIGHT (1<<8)
|
||||
#define IN_MOVELEFT (1<<9)
|
||||
#define IN_MOVERIGHT (1<<10)
|
||||
#define IN_ATTACK2 (1<<11)
|
||||
#define IN_RUN (1<<12)
|
||||
#define IN_RELOAD (1<<13)
|
||||
#define IN_ALT1 (1<<14)
|
||||
#define IN_SCORE (1<<15) // Used by client.dll for when scoreboard is held down
|
||||
#define IN_ATTACK (1U<<0)
|
||||
#define IN_JUMP (1U<<1)
|
||||
#define IN_DUCK (1U<<2)
|
||||
#define IN_FORWARD (1U<<3)
|
||||
#define IN_BACK (1U<<4)
|
||||
#define IN_USE (1U<<5)
|
||||
#define IN_CANCEL (1U<<6)
|
||||
#define IN_LEFT (1U<<7)
|
||||
#define IN_RIGHT (1U<<8)
|
||||
#define IN_MOVELEFT (1U<<9)
|
||||
#define IN_MOVERIGHT (1U<<10)
|
||||
#define IN_ATTACK2 (1U<<11)
|
||||
#define IN_RUN (1U<<12)
|
||||
#define IN_RELOAD (1U<<13)
|
||||
#define IN_ALT1 (1U<<14)
|
||||
#define IN_SCORE (1U<<15) // Used by client.dll for when scoreboard is held down
|
||||
|
||||
// Break Model Defines
|
||||
#define BREAK_TYPEMASK 0x4F
|
||||
@@ -691,8 +684,8 @@
|
||||
#define TE_BOUNCE_SHOTSHELL 2
|
||||
|
||||
// Rendering constants
|
||||
enum
|
||||
{
|
||||
enum
|
||||
{
|
||||
kRenderNormal, // src
|
||||
kRenderTransColor, // c*a+dest*(1-a)
|
||||
kRenderTransTexture, // src*a+dest*(1-a)
|
||||
@@ -701,21 +694,21 @@ enum
|
||||
kRenderTransAdd, // src*a+dest
|
||||
};
|
||||
|
||||
enum
|
||||
{
|
||||
kRenderFxNone = 0,
|
||||
kRenderFxPulseSlow,
|
||||
kRenderFxPulseFast,
|
||||
kRenderFxPulseSlowWide,
|
||||
kRenderFxPulseFastWide,
|
||||
kRenderFxFadeSlow,
|
||||
kRenderFxFadeFast,
|
||||
kRenderFxSolidSlow,
|
||||
kRenderFxSolidFast,
|
||||
kRenderFxStrobeSlow,
|
||||
kRenderFxStrobeFast,
|
||||
kRenderFxStrobeFaster,
|
||||
kRenderFxFlickerSlow,
|
||||
enum
|
||||
{
|
||||
kRenderFxNone = 0,
|
||||
kRenderFxPulseSlow,
|
||||
kRenderFxPulseFast,
|
||||
kRenderFxPulseSlowWide,
|
||||
kRenderFxPulseFastWide,
|
||||
kRenderFxFadeSlow,
|
||||
kRenderFxFadeFast,
|
||||
kRenderFxSolidSlow,
|
||||
kRenderFxSolidFast,
|
||||
kRenderFxStrobeSlow,
|
||||
kRenderFxStrobeFast,
|
||||
kRenderFxStrobeFaster,
|
||||
kRenderFxFlickerSlow,
|
||||
kRenderFxFlickerFast,
|
||||
kRenderFxNoDissipation,
|
||||
kRenderFxDistort, // Distort/scale/translate flicker
|
||||
@@ -732,7 +725,6 @@ typedef int string_t;
|
||||
typedef unsigned short word;
|
||||
|
||||
#include "xash3d_types.h"
|
||||
#define Q_isspace( ch ) (ch < 32 || ch > 255)
|
||||
|
||||
typedef struct
|
||||
{
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
/***
|
||||
*
|
||||
* Copyright (c) 1996-2002, Valve LLC. All rights reserved.
|
||||
*
|
||||
* This product contains software technology licensed from Id
|
||||
* Software, Inc. ("Id Technology"). Id Technology (c) 1996 Id Software, Inc.
|
||||
*
|
||||
* This product contains software technology licensed from Id
|
||||
* Software, Inc. ("Id Technology"). Id Technology (c) 1996 Id Software, Inc.
|
||||
* All Rights Reserved.
|
||||
*
|
||||
* Use, distribution, and modification of this source code and/or resulting
|
||||
@@ -25,14 +25,18 @@
|
||||
#define FCVAR_PRINTABLEONLY (1<<7) // This cvar's string cannot contain unprintable characters ( e.g., used for player name etc ).
|
||||
#define FCVAR_UNLOGGED (1<<8) // If this is a FCVAR_SERVER, don't log changes to the log file / console if we are creating a log
|
||||
#define FCVAR_NOEXTRAWHITEPACE (1<<9) // strip trailing/leading white space from this cvar
|
||||
#define FCVAR_PRIVILEGED (1<<10) // only available in privileged mode
|
||||
#define FCVAR_FILTERABLE (1<<11) // filtered in unprivileged mode if cl_filterstuffcmd is 1
|
||||
|
||||
#define FCVAR_MOVEVARS (1<<10) // this cvar is a part of movevars_t struct that shared between client and server
|
||||
#define FCVAR_LATCH (1<<11) // notify client what this cvar will be applied only after server restart (but don't does more nothing)
|
||||
// Xash3D extensions
|
||||
#define FCVAR_GLCONFIG (1<<12) // write it into <renderer>.cfg(see RefAPI)
|
||||
#define FCVAR_CHANGED (1<<13) // set each time the cvar is changed
|
||||
#define FCVAR_GAMEUIDLL (1<<14) // defined by the menu DLL
|
||||
#define FCVAR_CHEAT (1<<15) // can not be changed if cheats are disabled
|
||||
|
||||
|
||||
// a1ba: let's reuse higher bits for flags extensions from now on
|
||||
#define FCVAR_LATCH (1<<30) // notify client what this cvar will be applied only after server restart (but don't does more nothing)
|
||||
|
||||
typedef struct cvar_s
|
||||
{
|
||||
char *name;
|
||||
|
||||
@@ -69,6 +69,7 @@ SETUP BACKENDS DEFINITIONS
|
||||
#endif // XASH_MESSAGEBOX
|
||||
|
||||
#define XASH_USE_EVDEV
|
||||
#define XASH_DYNAMIC_DLADDR
|
||||
#elif XASH_LINUX
|
||||
// we are building for Linux without SDL2, can draw only to framebuffer yet
|
||||
#ifndef XASH_VIDEO
|
||||
@@ -84,7 +85,17 @@ SETUP BACKENDS DEFINITIONS
|
||||
#endif // XASH_SOUND
|
||||
|
||||
#define XASH_USE_EVDEV
|
||||
#endif // XASH_LINUX
|
||||
#elif XASH_DOS4GW
|
||||
#ifndef XASH_VIDEO
|
||||
#define XASH_VIDEO VIDEO_DOS
|
||||
#endif
|
||||
#ifndef XASH_TIMER
|
||||
#define XASH_TIMER TIMER_DOS
|
||||
#endif
|
||||
|
||||
// usually only 10-20 fds availiable
|
||||
#define XASH_REDUCE_FD
|
||||
#endif
|
||||
|
||||
#endif // XASH_DEDICATED
|
||||
|
||||
@@ -107,8 +118,6 @@ SETUP BACKENDS DEFINITIONS
|
||||
#define XASH_CRASHHANDLER CRASHHANDLER_DBGHELP
|
||||
#elif XASH_LINUX || XASH_BSD
|
||||
#define XASH_CRASHHANDLER CRASHHANDLER_UCONTEXT
|
||||
#else // !(XASH_LINUX || XASH_BSD || XASH_WIN32)
|
||||
#define XASH_CRASHHANDLER CRASHHANDLER_NULL
|
||||
#endif // !(XASH_LINUX || XASH_BSD || XASH_WIN32)
|
||||
#endif
|
||||
|
||||
@@ -119,10 +128,20 @@ SETUP BACKENDS DEFINITIONS
|
||||
#if XASH_WIN32
|
||||
#define XASH_TIMER TIMER_WIN32
|
||||
#else // !XASH_WIN32
|
||||
#define XASH_TIMER TIMER_LINUX
|
||||
#define XASH_TIMER TIMER_POSIX
|
||||
#endif // !XASH_WIN32
|
||||
#endif
|
||||
|
||||
#ifdef XASH_STATIC_LIBS
|
||||
#define XASH_LIB LIB_STATIC
|
||||
#define XASH_INTERNAL_GAMELIBS
|
||||
#define XASH_ALLOW_SAVERESTORE_OFFSETS
|
||||
#elif XASH_WIN32
|
||||
#define XASH_LIB LIB_WIN32
|
||||
#elif XASH_POSIX
|
||||
#define XASH_LIB LIB_POSIX
|
||||
#endif
|
||||
|
||||
//
|
||||
// fallback to NULL
|
||||
//
|
||||
@@ -138,6 +157,10 @@ SETUP BACKENDS DEFINITIONS
|
||||
#define XASH_INPUT INPUT_NULL
|
||||
#endif // XASH_INPUT
|
||||
|
||||
#ifndef XASH_CRASHHANDLER
|
||||
#define XASH_CRASHHANDLER CRASHHANDLER_NULL
|
||||
#endif // XASH_CRASHHANDLER
|
||||
|
||||
/*
|
||||
=========================================================================
|
||||
|
||||
@@ -169,16 +192,4 @@ Default build-depended cvar and constant values
|
||||
#define DEFAULT_FULLSCREEN 1
|
||||
#endif // DEFAULT_FULLSCREEN
|
||||
|
||||
#ifndef DEFAULT_ACCELERATED_RENDERER
|
||||
#if XASH_MOBILE_PLATFORM
|
||||
#define DEFAULT_ACCELERATED_RENDERER "gles1"
|
||||
#else // !XASH_MOBILE_PLATFORM
|
||||
#define DEFAULT_ACCELERATED_RENDERER "gl"
|
||||
#endif // !XASH_MOBILE_PLATFORM
|
||||
#endif // DEFAULT_ACCELERATED_RENDERER
|
||||
|
||||
#ifndef DEFAULT_SOFTWARE_RENDERER
|
||||
#define DEFAULT_SOFTWARE_RENDERER "soft" // mittorn's ref_soft
|
||||
#endif // DEFAULT_SOFTWARE_RENDERER
|
||||
|
||||
#endif // DEFAULTS_H
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
/***
|
||||
*
|
||||
* Copyright (c) 1996-2002, Valve LLC. All rights reserved.
|
||||
*
|
||||
* This product contains software technology licensed from Id
|
||||
* Software, Inc. ("Id Technology"). Id Technology (c) 1996 Id Software, Inc.
|
||||
*
|
||||
* This product contains software technology licensed from Id
|
||||
* Software, Inc. ("Id Technology"). Id Technology (c) 1996 Id Software, Inc.
|
||||
* All Rights Reserved.
|
||||
*
|
||||
* Use, distribution, and modification of this source code and/or resulting
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
/***
|
||||
*
|
||||
* Copyright (c) 1996-2002, Valve LLC. All rights reserved.
|
||||
*
|
||||
* This product contains software technology licensed from Id
|
||||
* Software, Inc. ("Id Technology"). Id Technology (c) 1996 Id Software, Inc.
|
||||
*
|
||||
* This product contains software technology licensed from Id
|
||||
* Software, Inc. ("Id Technology"). Id Technology (c) 1996 Id Software, Inc.
|
||||
* All Rights Reserved.
|
||||
*
|
||||
* Use, distribution, and modification of this source code and/or resulting
|
||||
|
||||
@@ -17,7 +17,7 @@ GNU General Public License for more details.
|
||||
#define FEATURES_H
|
||||
|
||||
// list of engine features that can be enabled through callback SV_CheckFeatures
|
||||
#define ENGINE_WRITE_LARGE_COORD (1<<0) // replace standard message WRITE_COORD with big message for support more than 8192 units in world
|
||||
#define ENGINE_WRITE_LARGE_COORD (1<<0) // replace standard message WRITE_COORD with big message for support more than 8192 units in world
|
||||
#define ENGINE_QUAKE_COMPATIBLE (1<<1) // make engine compatible with quake (flags and effects)
|
||||
#define ENGINE_LOAD_DELUXEDATA (1<<2) // loading deluxemap for map (if present)
|
||||
#define ENGINE_PHYSICS_PUSHER_EXT (1<<3) // enable sets of improvements for MOVETYPE_PUSH physics
|
||||
@@ -25,5 +25,6 @@ GNU General Public License for more details.
|
||||
#define ENGINE_COMPENSATE_QUAKE_BUG (1<<5) // compensate stupid quake bug (inverse pitch) for mods where this bug is fixed
|
||||
#define ENGINE_IMPROVED_LINETRACE (1<<6) // new traceline that tracing through alphatextures
|
||||
#define ENGINE_COMPUTE_STUDIO_LERP (1<<7) // enable MOVETYPE_STEP lerping back in engine
|
||||
#define ENGINE_LINEAR_GAMMA_SPACE (1<<8) // disable influence of gamma/brightness cvars to textures/lightmaps, for mods with custom renderer
|
||||
|
||||
#endif//FEATURES_H
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
/***
|
||||
*
|
||||
* Copyright (c) 1996-2002, Valve LLC. All rights reserved.
|
||||
*
|
||||
* This product contains software technology licensed from Id
|
||||
* Software, Inc. ("Id Technology"). Id Technology (c) 1996 Id Software, Inc.
|
||||
*
|
||||
* This product contains software technology licensed from Id
|
||||
* Software, Inc. ("Id Technology"). Id Technology (c) 1996 Id Software, Inc.
|
||||
* All Rights Reserved.
|
||||
*
|
||||
* Use, distribution, and modification of this source code and/or resulting
|
||||
@@ -19,7 +19,7 @@
|
||||
#define ENTITY_NORMAL (1<<0)
|
||||
#define ENTITY_BEAM (1<<1)
|
||||
|
||||
// Entity state is used for the baseline and for delta compression of a packet of
|
||||
// Entity state is used for the baseline and for delta compression of a packet of
|
||||
// entities that is sent to a client.
|
||||
typedef struct entity_state_s entity_state_t;
|
||||
|
||||
@@ -63,36 +63,36 @@ struct entity_state_s
|
||||
vec3_t velocity;
|
||||
|
||||
// Send bbox down to client for use during prediction.
|
||||
vec3_t mins;
|
||||
vec3_t mins;
|
||||
vec3_t maxs;
|
||||
|
||||
int aiment;
|
||||
// If owned by a player, the index of that player ( for projectiles ).
|
||||
int owner;
|
||||
int owner;
|
||||
|
||||
// Friction, for prediction.
|
||||
float friction;
|
||||
// Gravity multiplier
|
||||
float gravity;
|
||||
float gravity;
|
||||
|
||||
// PLAYER SPECIFIC
|
||||
int team;
|
||||
int playerclass;
|
||||
int health;
|
||||
qboolean spectator;
|
||||
qboolean spectator;
|
||||
int weaponmodel;
|
||||
int gaitsequence;
|
||||
// If standing on conveyor, e.g.
|
||||
vec3_t basevelocity;
|
||||
vec3_t basevelocity;
|
||||
// Use the crouched hull, or the regular player hull.
|
||||
int usehull;
|
||||
int usehull;
|
||||
// Latched buttons last time state updated.
|
||||
int oldbuttons;
|
||||
// -1 = in air, else pmove entity number
|
||||
int onground;
|
||||
int onground;
|
||||
int iStepLeft;
|
||||
// How fast we are falling
|
||||
float flFallVelocity;
|
||||
float flFallVelocity;
|
||||
|
||||
float fov;
|
||||
int weaponanim;
|
||||
@@ -135,7 +135,7 @@ typedef struct clientdata_s
|
||||
|
||||
int bInDuck;
|
||||
int weapons; // remove?
|
||||
|
||||
|
||||
int flTimeStepSound;
|
||||
int flDuckTime;
|
||||
int flSwimTime;
|
||||
@@ -152,7 +152,7 @@ typedef struct clientdata_s
|
||||
int ammo_cells;
|
||||
int ammo_rockets;
|
||||
float m_flNextAttack;
|
||||
|
||||
|
||||
int tfstate;
|
||||
int pushmsec;
|
||||
int deadflag;
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
/***
|
||||
*
|
||||
* Copyright (c) 1996-2002, Valve LLC. All rights reserved.
|
||||
*
|
||||
* This product contains software technology licensed from Id
|
||||
* Software, Inc. ("Id Technology"). Id Technology (c) 1996 Id Software, Inc.
|
||||
*
|
||||
* This product contains software technology licensed from Id
|
||||
* Software, Inc. ("Id Technology"). Id Technology (c) 1996 Id Software, Inc.
|
||||
* All Rights Reserved.
|
||||
*
|
||||
* Use, distribution, and modification of this source code and/or resulting
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
/***
|
||||
*
|
||||
* Copyright (c) 1996-2002, Valve LLC. All rights reserved.
|
||||
*
|
||||
* This product contains software technology licensed from Id
|
||||
* Software, Inc. ("Id Technology"). Id Technology (c) 1996 Id Software, Inc.
|
||||
*
|
||||
* This product contains software technology licensed from Id
|
||||
* Software, Inc. ("Id Technology"). Id Technology (c) 1996 Id Software, Inc.
|
||||
* All Rights Reserved.
|
||||
*
|
||||
* Use, distribution, and modification of this source code and/or resulting
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
/***
|
||||
*
|
||||
* Copyright (c) 1996-2002, Valve LLC. All rights reserved.
|
||||
*
|
||||
* This product contains software technology licensed from Id
|
||||
* Software, Inc. ("Id Technology"). Id Technology (c) 1996 Id Software, Inc.
|
||||
*
|
||||
* This product contains software technology licensed from Id
|
||||
* Software, Inc. ("Id Technology"). Id Technology (c) 1996 Id Software, Inc.
|
||||
* All Rights Reserved.
|
||||
*
|
||||
* Use, distribution, and modification of this source code and/or resulting
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
/***
|
||||
*
|
||||
* Copyright (c) 1996-2002, Valve LLC. All rights reserved.
|
||||
*
|
||||
* This product contains software technology licensed from Id
|
||||
* Software, Inc. ("Id Technology"). Id Technology (c) 1996 Id Software, Inc.
|
||||
*
|
||||
* This product contains software technology licensed from Id
|
||||
* Software, Inc. ("Id Technology"). Id Technology (c) 1996 Id Software, Inc.
|
||||
* All Rights Reserved.
|
||||
*
|
||||
* Use, distribution, and modification of this source code and/or resulting
|
||||
@@ -17,13 +17,13 @@
|
||||
#define EVENT_FLAGS_H
|
||||
|
||||
// Skip local host for event send.
|
||||
#define FEV_NOTHOST (1<<0)
|
||||
#define FEV_NOTHOST (1<<0)
|
||||
|
||||
// Send the event reliably. You must specify the origin and angles and use
|
||||
// PLAYBACK_EVENT_FULL for this to work correctly on the server for anything
|
||||
// that depends on the event origin/angles. I.e., the origin/angles are not
|
||||
// taken from the invoking edict for reliable events.
|
||||
#define FEV_RELIABLE (1<<1)
|
||||
#define FEV_RELIABLE (1<<1)
|
||||
|
||||
// Don't restrict to PAS/PVS, send this event to _everybody_ on the server ( useful for stopping CHAN_STATIC
|
||||
// sounds started by client event when client is not in PVS anymore ( hwguy in TFC e.g. ).
|
||||
|
||||
@@ -18,6 +18,7 @@ GNU General Public License for more details.
|
||||
|
||||
#define GFL_NOMODELS (1<<0)
|
||||
#define GFL_NOSKILLS (1<<1)
|
||||
#define GFL_RENDER_PICBUTTON_TEXT (1<<2)
|
||||
|
||||
/*
|
||||
========================================================================
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
/***
|
||||
*
|
||||
* Copyright (c) 1996-2002, Valve LLC. All rights reserved.
|
||||
*
|
||||
* This product contains software technology licensed from Id
|
||||
* Software, Inc. ("Id Technology"). Id Technology (c) 1996 Id Software, Inc.
|
||||
*
|
||||
* This product contains software technology licensed from Id
|
||||
* Software, Inc. ("Id Technology"). Id Technology (c) 1996 Id Software, Inc.
|
||||
* All Rights Reserved.
|
||||
*
|
||||
* Use, distribution, and modification of this source code and/or resulting
|
||||
@@ -23,7 +23,7 @@
|
||||
|
||||
// sub commands of svc_hltv:
|
||||
#define HLTV_ACTIVE 0 // tells client that he's an spectator and will get director commands
|
||||
#define HLTV_STATUS 1 // send status infos about proxy
|
||||
#define HLTV_STATUS 1 // send status infos about proxy
|
||||
#define HLTV_LISTEN 2 // tell client to listen to a multicast stream
|
||||
|
||||
// sub commands of svc_director:
|
||||
@@ -45,7 +45,7 @@
|
||||
|
||||
// HLTV_EVENT event flags
|
||||
#define DRC_FLAG_PRIO_MASK 0x0F // priorities between 0 and 15 (15 most important)
|
||||
#define DRC_FLAG_SIDE (1<<4) //
|
||||
#define DRC_FLAG_SIDE (1<<4) //
|
||||
#define DRC_FLAG_DRAMATIC (1<<5) // is a dramatic scene
|
||||
#define DRC_FLAG_SLOWMOTION (1<<6) // would look good in SloMo
|
||||
#define DRC_FLAG_FACEPLAYER (1<<7) // player is doning something (reload/defuse bomb etc)
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
/***
|
||||
*
|
||||
* Copyright (c) 1996-2002, Valve LLC. All rights reserved.
|
||||
*
|
||||
* This product contains software technology licensed from Id
|
||||
* Software, Inc. ("Id Technology"). Id Technology (c) 1996 Id Software, Inc.
|
||||
*
|
||||
* This product contains software technology licensed from Id
|
||||
* Software, Inc. ("Id Technology"). Id Technology (c) 1996 Id Software, Inc.
|
||||
* All Rights Reserved.
|
||||
*
|
||||
* Use, distribution, and modification of this source code and/or resulting
|
||||
@@ -26,10 +26,10 @@ typedef enum
|
||||
typedef struct IVoiceTweak_s
|
||||
{
|
||||
// These turn voice tweak mode on and off. While in voice tweak mode, the user's voice is echoed back
|
||||
// without sending to the server.
|
||||
// without sending to the server.
|
||||
int (*StartVoiceTweakMode)( void ); // Returns 0 on error.
|
||||
void (*EndVoiceTweakMode)( void );
|
||||
|
||||
|
||||
// Get/set control values.
|
||||
void (*SetControlFloat)( VoiceTweakControl iControl, float value );
|
||||
float (*GetControlFloat)( VoiceTweakControl iControl );
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
//========= Copyright © 1996-2002, Valve LLC, All rights reserved. ============
|
||||
//
|
||||
// Purpose:
|
||||
// Purpose:
|
||||
//
|
||||
// $NoKeywords: $
|
||||
//=============================================================================
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
/***
|
||||
*
|
||||
* Copyright (c) 1996-2002, Valve LLC. All rights reserved.
|
||||
*
|
||||
* This product contains software technology licensed from Id
|
||||
* Software, Inc. ("Id Technology"). Id Technology (c) 1996 Id Software, Inc.
|
||||
*
|
||||
* This product contains software technology licensed from Id
|
||||
* Software, Inc. ("Id Technology"). Id Technology (c) 1996 Id Software, Inc.
|
||||
* All Rights Reserved.
|
||||
*
|
||||
* Use, distribution, and modification of this source code and/or resulting
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
/***
|
||||
*
|
||||
* Copyright (c) 1996-2002, Valve LLC. All rights reserved.
|
||||
*
|
||||
* This product contains software technology licensed from Id
|
||||
* Software, Inc. ("Id Technology"). Id Technology (c) 1996 Id Software, Inc.
|
||||
*
|
||||
* This product contains software technology licensed from Id
|
||||
* Software, Inc. ("Id Technology"). Id Technology (c) 1996 Id Software, Inc.
|
||||
* All Rights Reserved.
|
||||
*
|
||||
* Use, distribution, and modification of this source code and/or resulting
|
||||
@@ -64,7 +64,7 @@ typedef struct net_response_s
|
||||
typedef struct net_status_s
|
||||
{
|
||||
// Connected to remote server? 1 == yes, 0 otherwise
|
||||
int connected;
|
||||
int connected;
|
||||
// Client's IP address
|
||||
netadr_t local_address;
|
||||
// Address of remote server
|
||||
@@ -87,7 +87,7 @@ typedef struct net_api_s
|
||||
void (*SendRequest)( int context, int request, int flags, double timeout, struct netadr_s *remote_address, net_api_response_func_t response );
|
||||
void (*CancelRequest)( int context );
|
||||
void (*CancelAllRequests)( void );
|
||||
char *(*AdrToString)( struct netadr_s *a );
|
||||
const char *(*AdrToString)( struct netadr_s *a );
|
||||
int ( *CompareAdr)( struct netadr_s *a, struct netadr_s *b );
|
||||
int ( *StringToAdr)( char *s, struct netadr_s *a );
|
||||
const char *(*ValueForKey)( const char *s, const char *key );
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
/***
|
||||
*
|
||||
* Copyright (c) 1996-2002, Valve LLC. All rights reserved.
|
||||
*
|
||||
* This product contains software technology licensed from Id
|
||||
* Software, Inc. ("Id Technology"). Id Technology (c) 1996 Id Software, Inc.
|
||||
*
|
||||
* This product contains software technology licensed from Id
|
||||
* Software, Inc. ("Id Technology"). Id Technology (c) 1996 Id Software, Inc.
|
||||
* All Rights Reserved.
|
||||
*
|
||||
* Use, distribution, and modification of this source code and/or resulting
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
/***
|
||||
*
|
||||
* Copyright (c) 1996-2002, Valve LLC. All rights reserved.
|
||||
*
|
||||
* This product contains software technology licensed from Id
|
||||
* Software, Inc. ("Id Technology"). Id Technology (c) 1996 Id Software, Inc.
|
||||
*
|
||||
* This product contains software technology licensed from Id
|
||||
* Software, Inc. ("Id Technology"). Id Technology (c) 1996 Id Software, Inc.
|
||||
* All Rights Reserved.
|
||||
*
|
||||
* Use, distribution, and modification of this source code and/or resulting
|
||||
@@ -18,7 +18,7 @@
|
||||
|
||||
typedef enum
|
||||
{
|
||||
pt_static,
|
||||
pt_static,
|
||||
pt_grav,
|
||||
pt_slowgrav,
|
||||
pt_fire,
|
||||
@@ -45,7 +45,7 @@ typedef struct particle_s
|
||||
|
||||
// for pt_clientcusttom, we'll call this function each frame
|
||||
void (*callback)( struct particle_s *particle, float frametime );
|
||||
|
||||
|
||||
// For deathfunc, etc.
|
||||
unsigned char context;
|
||||
} particle_t;
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
/***
|
||||
*
|
||||
* Copyright (c) 1996-2002, Valve LLC. All rights reserved.
|
||||
*
|
||||
* This product contains software technology licensed from Id
|
||||
* Software, Inc. ("Id Technology"). Id Technology (c) 1996 Id Software, Inc.
|
||||
*
|
||||
* This product contains software technology licensed from Id
|
||||
* Software, Inc. ("Id Technology"). Id Technology (c) 1996 Id Software, Inc.
|
||||
* All Rights Reserved.
|
||||
*
|
||||
* Use, distribution, and modification of this source code and/or resulting
|
||||
@@ -33,7 +33,7 @@ struct pmtrace_s
|
||||
vec3_t endpos; // final position
|
||||
pmplane_t plane; // surface normal at impact
|
||||
int ent; // entity at impact
|
||||
vec3_t deltavelocity; // Change in player's velocity caused by impact.
|
||||
vec3_t deltavelocity; // Change in player's velocity caused by impact.
|
||||
// Only run on server.
|
||||
int hitgroup;
|
||||
};
|
||||
|
||||
@@ -20,68 +20,40 @@ GNU General Public License for more details.
|
||||
#include "build.h"
|
||||
|
||||
#if !XASH_WIN32
|
||||
#include <dlfcn.h>
|
||||
#include <unistd.h>
|
||||
|
||||
#define PATH_SPLITTER "/"
|
||||
|
||||
#if XASH_APPLE
|
||||
#include <sys/syslimits.h>
|
||||
#include "TargetConditionals.h"
|
||||
#define OS_LIB_EXT "dylib"
|
||||
#define OPEN_COMMAND "open"
|
||||
#else
|
||||
#define OS_LIB_EXT "so"
|
||||
#define OPEN_COMMAND "xdg-open"
|
||||
#endif
|
||||
|
||||
#define OS_LIB_PREFIX "lib"
|
||||
|
||||
#if XASH_ANDROID
|
||||
//#if defined(LOAD_HARDFP)
|
||||
// #define POSTFIX "_hardfp"
|
||||
//#else
|
||||
#define POSTFIX
|
||||
//#endif
|
||||
#else
|
||||
#endif
|
||||
|
||||
#define VGUI_SUPPORT_DLL "libvgui_support." OS_LIB_EXT
|
||||
|
||||
// Windows-specific
|
||||
#define __cdecl
|
||||
#define __stdcall
|
||||
|
||||
#define _inline static inline
|
||||
#define FORCEINLINE inline __attribute__((always_inline))
|
||||
#define O_BINARY 0 // O_BINARY is Windows extension
|
||||
#define O_TEXT 0 // O_TEXT is Windows extension
|
||||
|
||||
// Windows functions to Linux equivalent
|
||||
#define _mkdir( x ) mkdir( x, S_IRWXU | S_IRWXG | S_IROTH | S_IXOTH )
|
||||
#define LoadLibrary( x ) dlopen( x, RTLD_NOW )
|
||||
#define GetProcAddress( x, y ) dlsym( x, y )
|
||||
#define SetCurrentDirectory( x ) (!chdir( x ))
|
||||
#define FreeLibrary( x ) dlclose( x )
|
||||
//#define MAKEWORD( a, b ) ((short int)(((unsigned char)(a))|(((short int)((unsigned char)(b)))<<8)))
|
||||
#define max( a, b ) (((a) > (b)) ? (a) : (b))
|
||||
#define min( a, b ) (((a) < (b)) ? (a) : (b))
|
||||
#define tell( a ) lseek(a, 0, SEEK_CUR)
|
||||
#if XASH_POSIX
|
||||
#include <unistd.h>
|
||||
#include <dlfcn.h>
|
||||
|
||||
typedef unsigned char BYTE;
|
||||
typedef short int WORD;
|
||||
typedef unsigned int DWORD;
|
||||
typedef int LONG;
|
||||
typedef unsigned int ULONG;
|
||||
typedef int WPARAM;
|
||||
typedef unsigned int LPARAM;
|
||||
#define PATH_SPLITTER "/"
|
||||
#define HAVE_DUP
|
||||
|
||||
#define O_BINARY 0
|
||||
#define O_TEXT 0
|
||||
#define _mkdir( x ) mkdir( x, S_IRWXU | S_IRWXG | S_IROTH | S_IXOTH )
|
||||
#elif XASH_DOS4GW
|
||||
#define PATH_SPLITTER "\\"
|
||||
#endif
|
||||
|
||||
typedef void* HANDLE;
|
||||
typedef void* HMODULE;
|
||||
typedef void* HINSTANCE;
|
||||
|
||||
typedef char* LPSTR;
|
||||
|
||||
typedef struct tagPOINT
|
||||
{
|
||||
int x, y;
|
||||
@@ -99,19 +71,6 @@ GNU General Public License for more details.
|
||||
#define read _read
|
||||
#define alloca _alloca
|
||||
|
||||
// shut-up compiler warnings
|
||||
#pragma warning(disable : 4244) // MIPS
|
||||
#pragma warning(disable : 4018) // signed/unsigned mismatch
|
||||
#pragma warning(disable : 4305) // truncation from const double to float
|
||||
#pragma warning(disable : 4115) // named type definition in parentheses
|
||||
#pragma warning(disable : 4100) // unreferenced formal parameter
|
||||
#pragma warning(disable : 4127) // conditional expression is constant
|
||||
#pragma warning(disable : 4057) // differs in indirection to slightly different base types
|
||||
#pragma warning(disable : 4201) // nonstandard extension used
|
||||
#pragma warning(disable : 4706) // assignment within conditional expression
|
||||
#pragma warning(disable : 4054) // type cast' : from function pointer
|
||||
#pragma warning(disable : 4310) // cast truncates constant value
|
||||
|
||||
#define HSPRITE WINAPI_HSPRITE
|
||||
#define WIN32_LEAN_AND_MEAN
|
||||
#include <winsock2.h>
|
||||
@@ -121,11 +80,9 @@ GNU General Public License for more details.
|
||||
#define OS_LIB_PREFIX ""
|
||||
#define OS_LIB_EXT "dll"
|
||||
#define VGUI_SUPPORT_DLL "../vgui_support." OS_LIB_EXT
|
||||
#ifdef XASH_64BIT
|
||||
// windows NameForFunction not implemented yet
|
||||
#define XASH_ALLOW_SAVERESTORE_OFFSETS
|
||||
#endif
|
||||
#define HAVE_DUP
|
||||
#endif //WIN32
|
||||
|
||||
#ifndef XASH_LOW_MEMORY
|
||||
#define XASH_LOW_MEMORY 0
|
||||
#endif
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
/***
|
||||
*
|
||||
* Copyright (c) 1996-2002, Valve LLC. All rights reserved.
|
||||
*
|
||||
* This product contains software technology licensed from Id
|
||||
* Software, Inc. ("Id Technology"). Id Technology (c) 1996 Id Software, Inc.
|
||||
*
|
||||
* This product contains software technology licensed from Id
|
||||
* Software, Inc. ("Id Technology"). Id Technology (c) 1996 Id Software, Inc.
|
||||
* All Rights Reserved.
|
||||
*
|
||||
* Use, distribution, and modification of this source code and/or resulting
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
/***
|
||||
*
|
||||
* Copyright (c) 1996-2002, Valve LLC. All rights reserved.
|
||||
*
|
||||
* This product contains software technology licensed from Id
|
||||
* Software, Inc. ("Id Technology"). Id Technology (c) 1996 Id Software, Inc.
|
||||
*
|
||||
* This product contains software technology licensed from Id
|
||||
* Software, Inc. ("Id Technology"). Id Technology (c) 1996 Id Software, Inc.
|
||||
* All Rights Reserved.
|
||||
*
|
||||
* Use, distribution, and modification of this source code and/or resulting
|
||||
@@ -17,7 +17,7 @@
|
||||
#define R_EFX_H
|
||||
|
||||
// particle_t
|
||||
#if !defined( PARTICLEDEFH )
|
||||
#if !defined( PARTICLEDEFH )
|
||||
#include "particledef.h"
|
||||
#endif
|
||||
|
||||
@@ -75,7 +75,7 @@ color24 gTracerColors[] =
|
||||
#define FTENT_SPIRAL 0x00000400
|
||||
#define FTENT_SPRCYCLE 0x00000800
|
||||
#define FTENT_COLLIDEALL 0x00001000 // will collide with world and slideboxes
|
||||
#define FTENT_PERSIST 0x00002000 // tent is not removed when unable to draw
|
||||
#define FTENT_PERSIST 0x00002000 // tent is not removed when unable to draw
|
||||
#define FTENT_COLLIDEKILL 0x00004000 // tent is removed upon collision with anything
|
||||
#define FTENT_PLYRATTACHMENT 0x00008000 // tent is attached to a player (owner)
|
||||
#define FTENT_SPRANIMATELOOP 0x00010000 // animating sprite doesn't die when last frame is displayed
|
||||
@@ -102,7 +102,7 @@ typedef struct tempent_s
|
||||
int priority;
|
||||
short clientIndex; // if attached, this is the index of the client to stick to
|
||||
// if COLLIDEALL, this is the index of the client to ignore
|
||||
// TENTS with FTENT_PLYRATTACHMENT MUST set the clientindex!
|
||||
// TENTS with FTENT_PLYRATTACHMENT MUST set the clientindex!
|
||||
|
||||
vec3_t tentOffset; // if attached, client origin + tentOffset = tent origin.
|
||||
cl_entity_t entity;
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
/***
|
||||
*
|
||||
* Copyright (c) 1996-2002, Valve LLC. All rights reserved.
|
||||
*
|
||||
* This product contains software technology licensed from Id
|
||||
* Software, Inc. ("Id Technology"). Id Technology (c) 1996 Id Software, Inc.
|
||||
*
|
||||
* This product contains software technology licensed from Id
|
||||
* Software, Inc. ("Id Technology"). Id Technology (c) 1996 Id Software, Inc.
|
||||
* All Rights Reserved.
|
||||
*
|
||||
* Use, distribution, and modification of this source code and/or resulting
|
||||
@@ -103,7 +103,7 @@ typedef struct engine_studio_api_s
|
||||
|
||||
// True if using D3D/OpenGL
|
||||
int ( *IsHardware )( void );
|
||||
|
||||
|
||||
// Only called by hardware interface
|
||||
void ( *GL_StudioDrawShadow )( void );
|
||||
void ( *GL_SetRenderMode )( int mode );
|
||||
@@ -140,7 +140,7 @@ typedef struct sv_blending_interface_s
|
||||
{
|
||||
int version;
|
||||
|
||||
void ( *SV_StudioSetupBones )( struct model_s *pModel,
|
||||
void ( *SV_StudioSetupBones )( struct model_s *pModel,
|
||||
float frame,
|
||||
int sequence,
|
||||
const vec3_t angles,
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
/***
|
||||
*
|
||||
* Copyright (c) 1996-2002, Valve LLC. All rights reserved.
|
||||
*
|
||||
* This product contains software technology licensed from Id
|
||||
* Software, Inc. ("Id Technology"). Id Technology (c) 1996 Id Software, Inc.
|
||||
*
|
||||
* This product contains software technology licensed from Id
|
||||
* Software, Inc. ("Id Technology"). Id Technology (c) 1996 Id Software, Inc.
|
||||
* All Rights Reserved.
|
||||
*
|
||||
* Use, distribution, and modification of this source code and/or resulting
|
||||
@@ -25,7 +25,7 @@ typedef struct ref_params_s
|
||||
vec3_t forward;
|
||||
vec3_t right;
|
||||
vec3_t up;
|
||||
|
||||
|
||||
// Client frametime;
|
||||
float frametime;
|
||||
// Client time
|
||||
@@ -54,7 +54,7 @@ typedef struct ref_params_s
|
||||
int viewentity;
|
||||
int playernum;
|
||||
int max_entities;
|
||||
int demoplayback;
|
||||
int demoplayback;
|
||||
int hardware;
|
||||
int smoothing;
|
||||
|
||||
|
||||
@@ -82,7 +82,7 @@ typedef enum
|
||||
TF_KEEP_SOURCE = (1<<1), // some images keep source
|
||||
TF_NOFLIP_TGA = (1<<2), // Steam background completely ignore tga attribute 0x20
|
||||
TF_EXPAND_SOURCE = (1<<3), // Don't keep source as 8-bit expand to RGBA
|
||||
TF_ALLOW_EMBOSS = (1<<4), // Allow emboss-mapping for this image
|
||||
// reserved
|
||||
TF_RECTANGLE = (1<<5), // this is GL_TEXTURE_RECTANGLE
|
||||
TF_CUBEMAP = (1<<6), // it's cubemap texture
|
||||
TF_DEPTHMAP = (1<<7), // custom texture filter used
|
||||
@@ -107,20 +107,23 @@ typedef enum
|
||||
TF_ARB_FLOAT = (1<<26), // float textures
|
||||
TF_NOCOMPARE = (1<<27), // disable comparing for depth textures
|
||||
TF_ARB_16BIT = (1<<28), // keep image as 16-bit (not 24)
|
||||
TF_MULTISAMPLE = (1<<29) // multisampling texture
|
||||
} texFlags_t;
|
||||
|
||||
typedef enum
|
||||
{
|
||||
CONTEXT_TYPE_GL = 0,
|
||||
CONTEXT_TYPE_GL = 0, // compatibility profile
|
||||
CONTEXT_TYPE_GLES_1_X,
|
||||
CONTEXT_TYPE_GLES_2_X
|
||||
CONTEXT_TYPE_GLES_2_X,
|
||||
CONTEXT_TYPE_GL_CORE
|
||||
} gl_context_type_t;
|
||||
|
||||
typedef enum
|
||||
{
|
||||
GLES_WRAPPER_NONE = 0, // native GLES
|
||||
GLES_WRAPPER_NONE = 0, // native GL
|
||||
GLES_WRAPPER_NANOGL, // used on GLES platforms
|
||||
GLES_WRAPPER_WES, // used on GLES platforms
|
||||
GLES_WRAPPER_GL4ES, // used on GLES platforms
|
||||
} gles_wrapper_t;
|
||||
|
||||
// 30 bytes here
|
||||
@@ -130,7 +133,7 @@ typedef struct modelstate_s
|
||||
short frame; // 10 bits multiple by 4, should be enough
|
||||
byte blending[2];
|
||||
byte controller[4];
|
||||
byte poseparam[16];
|
||||
byte poseparam[16];
|
||||
byte body;
|
||||
byte skin;
|
||||
short scale; // model scale (multiplied by 16)
|
||||
@@ -161,7 +164,7 @@ typedef struct render_api_s
|
||||
int (*RenderGetParm)( int parm, int arg ); // generic
|
||||
void (*GetDetailScaleForTexture)( int texture, float *xScale, float *yScale );
|
||||
void (*GetExtraParmsForTexture)( int texture, byte *red, byte *green, byte *blue, byte *alpha );
|
||||
lightstyle_t* (*GetLightStyle)( int number );
|
||||
lightstyle_t* (*GetLightStyle)( int number );
|
||||
dlight_t* (*GetDynamicLight)( int number );
|
||||
dlight_t* (*GetEntityLight)( int number );
|
||||
byte (*LightToTexGamma)( byte color ); // software gamma support
|
||||
@@ -190,9 +193,9 @@ typedef struct render_api_s
|
||||
|
||||
// AVIkit support
|
||||
void *(*AVI_LoadVideo)( const char *filename, qboolean load_audio );
|
||||
int (*AVI_GetVideoInfo)( void *Avi, long *xres, long *yres, float *duration );
|
||||
long (*AVI_GetVideoFrameNumber)( void *Avi, float time );
|
||||
byte *(*AVI_GetVideoFrame)( void *Avi, long frame );
|
||||
int (*AVI_GetVideoInfo)( void *Avi, int *xres, int *yres, float *duration ); // a1ba: changed longs to int
|
||||
int (*AVI_GetVideoFrameNumber)( void *Avi, float time );
|
||||
byte *(*AVI_GetVideoFrame)( void *Avi, int frame );
|
||||
void (*AVI_UploadRawFrame)( int texture, int cols, int rows, int width, int height, const byte *data );
|
||||
void (*AVI_FreeVideo)( void *Avi );
|
||||
int (*AVI_IsActive)( void *Avi );
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
/***
|
||||
*
|
||||
* Copyright (c) 1996-2002, Valve LLC. All rights reserved.
|
||||
*
|
||||
* This product contains software technology licensed from Id
|
||||
* Software, Inc. ("Id Technology"). Id Technology (c) 1996 Id Software, Inc.
|
||||
*
|
||||
* This product contains software technology licensed from Id
|
||||
* Software, Inc. ("Id Technology"). Id Technology (c) 1996 Id Software, Inc.
|
||||
* All Rights Reserved.
|
||||
*
|
||||
* Use, distribution, and modification of this source code and/or resulting
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
/***
|
||||
*
|
||||
* Copyright (c) 1996-2002, Valve LLC. All rights reserved.
|
||||
*
|
||||
* This product contains software technology licensed from Id
|
||||
* Software, Inc. ("Id Technology"). Id Technology (c) 1996 Id Software, Inc.
|
||||
*
|
||||
* This product contains software technology licensed from Id
|
||||
* Software, Inc. ("Id Technology"). Id Technology (c) 1996 Id Software, Inc.
|
||||
* All Rights Reserved.
|
||||
*
|
||||
* Use, distribution, and modification of this source code and/or resulting
|
||||
@@ -12,16 +12,26 @@
|
||||
* without written permission from Valve LLC.
|
||||
*
|
||||
****/
|
||||
|
||||
#pragma once
|
||||
#ifndef STUDIO_EVENT_H
|
||||
#define STUDIO_EVENT_H
|
||||
|
||||
#define MAXEVENTSTRING 64
|
||||
|
||||
typedef struct mstudioevent_s
|
||||
{
|
||||
int frame;
|
||||
int event;
|
||||
int type;
|
||||
char options[64];
|
||||
// the frame at which this animation event occurs
|
||||
int32_t frame;
|
||||
|
||||
// the script event type
|
||||
int32_t event;
|
||||
|
||||
// was "type"
|
||||
int32_t unused;
|
||||
|
||||
// options
|
||||
// could be path to sound WAVE files
|
||||
char options[MAXEVENTSTRING];
|
||||
} mstudioevent_t;
|
||||
|
||||
#endif//STUDIO_EVENT_H
|
||||
#endif // STUDIO_EVENT_H
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
/***
|
||||
*
|
||||
* Copyright (c) 1996-2002, Valve LLC. All rights reserved.
|
||||
*
|
||||
* This product contains software technology licensed from Id
|
||||
* Software, Inc. ("Id Technology"). Id Technology (c) 1996 Id Software, Inc.
|
||||
*
|
||||
* This product contains software technology licensed from Id
|
||||
* Software, Inc. ("Id Technology"). Id Technology (c) 1996 Id Software, Inc.
|
||||
* All Rights Reserved.
|
||||
*
|
||||
* Use, distribution, and modification of this source code and/or resulting
|
||||
@@ -16,7 +16,7 @@
|
||||
#ifndef TRIANGLEAPI_H
|
||||
#define TRIANGLEAPI_H
|
||||
|
||||
typedef enum
|
||||
typedef enum
|
||||
{
|
||||
TRI_FRONT = 0,
|
||||
TRI_NONE = 1,
|
||||
@@ -47,7 +47,7 @@ typedef struct triangleapi_s
|
||||
void (*Vertex3fv)( const float *worldPnt );
|
||||
void (*Vertex3f)( float x, float y, float z );
|
||||
void (*Brightness)( float brightness );
|
||||
void (*CullFace)( TRICULLSTYLE style );
|
||||
void (*CullFace)( TRICULLSTYLE style );
|
||||
int (*SpriteTexture)( struct model_s *pSpriteModel, int frame );
|
||||
int (*WorldToScreen)( const float *world, float *screen ); // Returns 1 if it's z clipped
|
||||
void (*Fog)( float flFogColor[3], float flStart, float flEnd, int bOn ); //Works just like GL_FOG, flFogColor is r/g/b.
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
/***
|
||||
*
|
||||
* Copyright (c) 1996-2002, Valve LLC. All rights reserved.
|
||||
*
|
||||
* This product contains software technology licensed from Id
|
||||
* Software, Inc. ("Id Technology"). Id Technology (c) 1996 Id Software, Inc.
|
||||
*
|
||||
* This product contains software technology licensed from Id
|
||||
* Software, Inc. ("Id Technology"). Id Technology (c) 1996 Id Software, Inc.
|
||||
* All Rights Reserved.
|
||||
*
|
||||
* Use, distribution, and modification of this source code and/or resulting
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
/***
|
||||
*
|
||||
* Copyright (c) 1996-2002, Valve LLC. All rights reserved.
|
||||
*
|
||||
* This product contains software technology licensed from Id
|
||||
* Software, Inc. ("Id Technology"). Id Technology (c) 1996 Id Software, Inc.
|
||||
*
|
||||
* This product contains software technology licensed from Id
|
||||
* Software, Inc. ("Id Technology"). Id Technology (c) 1996 Id Software, Inc.
|
||||
* All Rights Reserved.
|
||||
*
|
||||
* Use, distribution, and modification of this source code and/or resulting
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
/***
|
||||
*
|
||||
* Copyright (c) 1996-2002, Valve LLC. All rights reserved.
|
||||
*
|
||||
* This product contains software technology licensed from Id
|
||||
* Software, Inc. ("Id Technology"). Id Technology (c) 1996 Id Software, Inc.
|
||||
*
|
||||
* This product contains software technology licensed from Id
|
||||
* Software, Inc. ("Id Technology"). Id Technology (c) 1996 Id Software, Inc.
|
||||
* All Rights Reserved.
|
||||
*
|
||||
* Use, distribution, and modification of this source code and/or resulting
|
||||
|
||||
@@ -2,11 +2,14 @@
|
||||
#ifndef XASH_TYPES_H
|
||||
#define XASH_TYPES_H
|
||||
|
||||
#ifdef _WIN32
|
||||
#include "build.h"
|
||||
|
||||
#if XASH_WIN32
|
||||
#include <wchar.h> // off_t
|
||||
#endif // _WIN32
|
||||
|
||||
#include <sys/types.h> // off_t
|
||||
#include STDINT_H
|
||||
|
||||
typedef unsigned char byte;
|
||||
typedef int sound_t;
|
||||
@@ -19,6 +22,7 @@ typedef byte rgba_t[4]; // unsigned byte colorpack
|
||||
typedef byte rgb_t[3]; // unsigned byte colorpack
|
||||
typedef vec_t matrix3x4[3][4];
|
||||
typedef vec_t matrix4x4[4][4];
|
||||
typedef uint32_t poolhandle_t;
|
||||
|
||||
#undef true
|
||||
#undef false
|
||||
@@ -29,14 +33,7 @@ typedef enum { false, true } qboolean;
|
||||
typedef int qboolean;
|
||||
#endif
|
||||
|
||||
#if _MSC_VER == 1200
|
||||
typedef __int64 integer64; //msvc6
|
||||
#elif defined (XASH_SDL) && !defined(REF_DLL)
|
||||
typedef Uint64 integer64;
|
||||
#else
|
||||
typedef unsigned long long integer64;
|
||||
#endif
|
||||
typedef integer64 longtime_t;
|
||||
typedef uint64_t longtime_t;
|
||||
|
||||
#define MAX_STRING 256 // generic string
|
||||
#define MAX_INFO_STRING 256 // infostrings are transmitted across network
|
||||
@@ -69,19 +66,25 @@ typedef integer64 longtime_t;
|
||||
#define ColorIndex( c ) ((( c ) - '0' ) & 7 )
|
||||
|
||||
#if defined(__GNUC__)
|
||||
#ifdef __i386__
|
||||
#define EXPORT __attribute__ ((visibility ("default"),force_align_arg_pointer))
|
||||
#define GAME_EXPORT __attribute((force_align_arg_pointer))
|
||||
#else
|
||||
#define EXPORT __attribute__ ((visibility ("default")))
|
||||
#define GAME_EXPORT
|
||||
#endif
|
||||
#ifdef __i386__
|
||||
#define EXPORT __attribute__ ((visibility ("default"),force_align_arg_pointer))
|
||||
#define GAME_EXPORT __attribute((force_align_arg_pointer))
|
||||
#else
|
||||
#define EXPORT __attribute__ ((visibility ("default")))
|
||||
#define GAME_EXPORT
|
||||
#endif
|
||||
#define _format(x) __attribute__((format(printf, x, x+1)))
|
||||
#define NORETURN __attribute__((noreturn))
|
||||
#elif defined(_MSC_VER)
|
||||
#define EXPORT __declspec( dllexport )
|
||||
#define GAME_EXPORT
|
||||
#define EXPORT __declspec( dllexport )
|
||||
#define GAME_EXPORT
|
||||
#define _format(x)
|
||||
#define NORETURN
|
||||
#else
|
||||
#define EXPORT
|
||||
#define GAME_EXPORT
|
||||
#define EXPORT
|
||||
#define GAME_EXPORT
|
||||
#define _format(x)
|
||||
#define NORETURN
|
||||
#endif
|
||||
|
||||
|
||||
@@ -122,6 +125,11 @@ typedef struct file_s file_t; // normal file
|
||||
typedef struct wfile_s wfile_t; // wad file
|
||||
typedef struct stream_s stream_t; // sound stream for background music playing
|
||||
typedef off_t fs_offset_t;
|
||||
#if XASH_WIN32
|
||||
typedef int fs_size_t; // return type of _read, _write funcs
|
||||
#else /* !XASH_WIN32 */
|
||||
typedef ssize_t fs_size_t;
|
||||
#endif /* !XASH_WIN32 */
|
||||
|
||||
typedef struct dllfunc_s
|
||||
{
|
||||
@@ -137,7 +145,7 @@ typedef struct dll_info_s
|
||||
void *link; // hinstance of loading library
|
||||
} dll_info_t;
|
||||
|
||||
typedef void (*setpair_t)( const char *key, const void *value, void *buffer, void *numpairs );
|
||||
typedef void (*setpair_t)( const char *key, const void *value, const void *buffer, void *numpairs );
|
||||
|
||||
// config strings are a general means of communication from
|
||||
// the server to all connected clients.
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
/***
|
||||
*
|
||||
* Copyright (c) 1996-2002, Valve LLC. All rights reserved.
|
||||
*
|
||||
* This product contains software technology licensed from Id
|
||||
* Software, Inc. ("Id Technology"). Id Technology (c) 1996 Id Software, Inc.
|
||||
*
|
||||
* This product contains software technology licensed from Id
|
||||
* Software, Inc. ("Id Technology"). Id Technology (c) 1996 Id Software, Inc.
|
||||
* All Rights Reserved.
|
||||
*
|
||||
* Use, distribution, and modification of this source code and/or resulting
|
||||
|
||||
330
engine/anorms.h
330
engine/anorms.h
@@ -1,9 +1,9 @@
|
||||
/***
|
||||
*
|
||||
* Copyright (c) 1996-2002, Valve LLC. All rights reserved.
|
||||
*
|
||||
* This product contains software technology licensed from Id
|
||||
* Software, Inc. ("Id Technology"). Id Technology (c) 1996 Id Software, Inc.
|
||||
*
|
||||
* This product contains software technology licensed from Id
|
||||
* Software, Inc. ("Id Technology"). Id Technology (c) 1996 Id Software, Inc.
|
||||
* All Rights Reserved.
|
||||
*
|
||||
* Use, distribution, and modification of this source code and/or resulting
|
||||
@@ -13,165 +13,165 @@
|
||||
*
|
||||
****/
|
||||
|
||||
{-0.525731, 0.000000, 0.850651},
|
||||
{-0.442863, 0.238856, 0.864188},
|
||||
{-0.295242, 0.000000, 0.955423},
|
||||
{-0.309017, 0.500000, 0.809017},
|
||||
{-0.162460, 0.262866, 0.951056},
|
||||
{0.000000, 0.000000, 1.000000},
|
||||
{0.000000, 0.850651, 0.525731},
|
||||
{-0.147621, 0.716567, 0.681718},
|
||||
{0.147621, 0.716567, 0.681718},
|
||||
{0.000000, 0.525731, 0.850651},
|
||||
{0.309017, 0.500000, 0.809017},
|
||||
{0.525731, 0.000000, 0.850651},
|
||||
{0.295242, 0.000000, 0.955423},
|
||||
{0.442863, 0.238856, 0.864188},
|
||||
{0.162460, 0.262866, 0.951056},
|
||||
{-0.681718, 0.147621, 0.716567},
|
||||
{-0.809017, 0.309017, 0.500000},
|
||||
{-0.587785, 0.425325, 0.688191},
|
||||
{-0.850651, 0.525731, 0.000000},
|
||||
{-0.864188, 0.442863, 0.238856},
|
||||
{-0.716567, 0.681718, 0.147621},
|
||||
{-0.688191, 0.587785, 0.425325},
|
||||
{-0.500000, 0.809017, 0.309017},
|
||||
{-0.238856, 0.864188, 0.442863},
|
||||
{-0.425325, 0.688191, 0.587785},
|
||||
{-0.716567, 0.681718, -0.147621},
|
||||
{-0.500000, 0.809017, -0.309017},
|
||||
{-0.525731, 0.850651, 0.000000},
|
||||
{0.000000, 0.850651, -0.525731},
|
||||
{-0.238856, 0.864188, -0.442863},
|
||||
{0.000000, 0.955423, -0.295242},
|
||||
{-0.262866, 0.951056, -0.162460},
|
||||
{0.000000, 1.000000, 0.000000},
|
||||
{0.000000, 0.955423, 0.295242},
|
||||
{-0.262866, 0.951056, 0.162460},
|
||||
{0.238856, 0.864188, 0.442863},
|
||||
{0.262866, 0.951056, 0.162460},
|
||||
{0.500000, 0.809017, 0.309017},
|
||||
{0.238856, 0.864188, -0.442863},
|
||||
{0.262866, 0.951056, -0.162460},
|
||||
{0.500000, 0.809017, -0.309017},
|
||||
{0.850651, 0.525731, 0.000000},
|
||||
{0.716567, 0.681718, 0.147621},
|
||||
{0.716567, 0.681718, -0.147621},
|
||||
{0.525731, 0.850651, 0.000000},
|
||||
{0.425325, 0.688191, 0.587785},
|
||||
{0.864188, 0.442863, 0.238856},
|
||||
{0.688191, 0.587785, 0.425325},
|
||||
{0.809017, 0.309017, 0.500000},
|
||||
{0.681718, 0.147621, 0.716567},
|
||||
{0.587785, 0.425325, 0.688191},
|
||||
{0.955423, 0.295242, 0.000000},
|
||||
{1.000000, 0.000000, 0.000000},
|
||||
{0.951056, 0.162460, 0.262866},
|
||||
{0.850651, -0.525731, 0.000000},
|
||||
{0.955423, -0.295242, 0.000000},
|
||||
{0.864188, -0.442863, 0.238856},
|
||||
{0.951056, -0.162460, 0.262866},
|
||||
{0.809017, -0.309017, 0.500000},
|
||||
{0.681718, -0.147621, 0.716567},
|
||||
{0.850651, 0.000000, 0.525731},
|
||||
{0.864188, 0.442863, -0.238856},
|
||||
{0.809017, 0.309017, -0.500000},
|
||||
{0.951056, 0.162460, -0.262866},
|
||||
{0.525731, 0.000000, -0.850651},
|
||||
{0.681718, 0.147621, -0.716567},
|
||||
{0.681718, -0.147621, -0.716567},
|
||||
{0.850651, 0.000000, -0.525731},
|
||||
{0.809017, -0.309017, -0.500000},
|
||||
{0.864188, -0.442863, -0.238856},
|
||||
{0.951056, -0.162460, -0.262866},
|
||||
{0.147621, 0.716567, -0.681718},
|
||||
{0.309017, 0.500000, -0.809017},
|
||||
{0.425325, 0.688191, -0.587785},
|
||||
{0.442863, 0.238856, -0.864188},
|
||||
{0.587785, 0.425325, -0.688191},
|
||||
{0.688191, 0.587785, -0.425325},
|
||||
{-0.147621, 0.716567, -0.681718},
|
||||
{-0.309017, 0.500000, -0.809017},
|
||||
{0.000000, 0.525731, -0.850651},
|
||||
{-0.525731, 0.000000, -0.850651},
|
||||
{-0.442863, 0.238856, -0.864188},
|
||||
{-0.295242, 0.000000, -0.955423},
|
||||
{-0.162460, 0.262866, -0.951056},
|
||||
{0.000000, 0.000000, -1.000000},
|
||||
{0.295242, 0.000000, -0.955423},
|
||||
{0.162460, 0.262866, -0.951056},
|
||||
{-0.442863, -0.238856, -0.864188},
|
||||
{-0.309017, -0.500000, -0.809017},
|
||||
{-0.162460, -0.262866, -0.951056},
|
||||
{0.000000, -0.850651, -0.525731},
|
||||
{-0.147621, -0.716567, -0.681718},
|
||||
{0.147621, -0.716567, -0.681718},
|
||||
{0.000000, -0.525731, -0.850651},
|
||||
{0.309017, -0.500000, -0.809017},
|
||||
{0.442863, -0.238856, -0.864188},
|
||||
{0.162460, -0.262866, -0.951056},
|
||||
{0.238856, -0.864188, -0.442863},
|
||||
{0.500000, -0.809017, -0.309017},
|
||||
{0.425325, -0.688191, -0.587785},
|
||||
{0.716567, -0.681718, -0.147621},
|
||||
{0.688191, -0.587785, -0.425325},
|
||||
{0.587785, -0.425325, -0.688191},
|
||||
{0.000000, -0.955423, -0.295242},
|
||||
{0.000000, -1.000000, 0.000000},
|
||||
{0.262866, -0.951056, -0.162460},
|
||||
{0.000000, -0.850651, 0.525731},
|
||||
{0.000000, -0.955423, 0.295242},
|
||||
{0.238856, -0.864188, 0.442863},
|
||||
{0.262866, -0.951056, 0.162460},
|
||||
{0.500000, -0.809017, 0.309017},
|
||||
{0.716567, -0.681718, 0.147621},
|
||||
{0.525731, -0.850651, 0.000000},
|
||||
{-0.238856, -0.864188, -0.442863},
|
||||
{-0.500000, -0.809017, -0.309017},
|
||||
{-0.262866, -0.951056, -0.162460},
|
||||
{-0.850651, -0.525731, 0.000000},
|
||||
{-0.716567, -0.681718, -0.147621},
|
||||
{-0.716567, -0.681718, 0.147621},
|
||||
{-0.525731, -0.850651, 0.000000},
|
||||
{-0.500000, -0.809017, 0.309017},
|
||||
{-0.238856, -0.864188, 0.442863},
|
||||
{-0.262866, -0.951056, 0.162460},
|
||||
{-0.864188, -0.442863, 0.238856},
|
||||
{-0.809017, -0.309017, 0.500000},
|
||||
{-0.688191, -0.587785, 0.425325},
|
||||
{-0.681718, -0.147621, 0.716567},
|
||||
{-0.442863, -0.238856, 0.864188},
|
||||
{-0.587785, -0.425325, 0.688191},
|
||||
{-0.309017, -0.500000, 0.809017},
|
||||
{-0.147621, -0.716567, 0.681718},
|
||||
{-0.425325, -0.688191, 0.587785},
|
||||
{-0.162460, -0.262866, 0.951056},
|
||||
{0.442863, -0.238856, 0.864188},
|
||||
{0.162460, -0.262866, 0.951056},
|
||||
{0.309017, -0.500000, 0.809017},
|
||||
{0.147621, -0.716567, 0.681718},
|
||||
{0.000000, -0.525731, 0.850651},
|
||||
{0.425325, -0.688191, 0.587785},
|
||||
{0.587785, -0.425325, 0.688191},
|
||||
{0.688191, -0.587785, 0.425325},
|
||||
{-0.955423, 0.295242, 0.000000},
|
||||
{-0.951056, 0.162460, 0.262866},
|
||||
{-1.000000, 0.000000, 0.000000},
|
||||
{-0.850651, 0.000000, 0.525731},
|
||||
{-0.955423, -0.295242, 0.000000},
|
||||
{-0.951056, -0.162460, 0.262866},
|
||||
{-0.864188, 0.442863, -0.238856},
|
||||
{-0.951056, 0.162460, -0.262866},
|
||||
{-0.809017, 0.309017, -0.500000},
|
||||
{-0.864188, -0.442863, -0.238856},
|
||||
{-0.951056, -0.162460, -0.262866},
|
||||
{-0.809017, -0.309017, -0.500000},
|
||||
{-0.681718, 0.147621, -0.716567},
|
||||
{-0.681718, -0.147621, -0.716567},
|
||||
{-0.850651, 0.000000, -0.525731},
|
||||
{-0.688191, 0.587785, -0.425325},
|
||||
{-0.587785, 0.425325, -0.688191},
|
||||
{-0.425325, 0.688191, -0.587785},
|
||||
{-0.425325, -0.688191, -0.587785},
|
||||
{-0.587785, -0.425325, -0.688191},
|
||||
{-0.688191, -0.587785, -0.425325},
|
||||
{-0.525731, 0.000000, 0.850651},
|
||||
{-0.442863, 0.238856, 0.864188},
|
||||
{-0.295242, 0.000000, 0.955423},
|
||||
{-0.309017, 0.500000, 0.809017},
|
||||
{-0.162460, 0.262866, 0.951056},
|
||||
{0.000000, 0.000000, 1.000000},
|
||||
{0.000000, 0.850651, 0.525731},
|
||||
{-0.147621, 0.716567, 0.681718},
|
||||
{0.147621, 0.716567, 0.681718},
|
||||
{0.000000, 0.525731, 0.850651},
|
||||
{0.309017, 0.500000, 0.809017},
|
||||
{0.525731, 0.000000, 0.850651},
|
||||
{0.295242, 0.000000, 0.955423},
|
||||
{0.442863, 0.238856, 0.864188},
|
||||
{0.162460, 0.262866, 0.951056},
|
||||
{-0.681718, 0.147621, 0.716567},
|
||||
{-0.809017, 0.309017, 0.500000},
|
||||
{-0.587785, 0.425325, 0.688191},
|
||||
{-0.850651, 0.525731, 0.000000},
|
||||
{-0.864188, 0.442863, 0.238856},
|
||||
{-0.716567, 0.681718, 0.147621},
|
||||
{-0.688191, 0.587785, 0.425325},
|
||||
{-0.500000, 0.809017, 0.309017},
|
||||
{-0.238856, 0.864188, 0.442863},
|
||||
{-0.425325, 0.688191, 0.587785},
|
||||
{-0.716567, 0.681718, -0.147621},
|
||||
{-0.500000, 0.809017, -0.309017},
|
||||
{-0.525731, 0.850651, 0.000000},
|
||||
{0.000000, 0.850651, -0.525731},
|
||||
{-0.238856, 0.864188, -0.442863},
|
||||
{0.000000, 0.955423, -0.295242},
|
||||
{-0.262866, 0.951056, -0.162460},
|
||||
{0.000000, 1.000000, 0.000000},
|
||||
{0.000000, 0.955423, 0.295242},
|
||||
{-0.262866, 0.951056, 0.162460},
|
||||
{0.238856, 0.864188, 0.442863},
|
||||
{0.262866, 0.951056, 0.162460},
|
||||
{0.500000, 0.809017, 0.309017},
|
||||
{0.238856, 0.864188, -0.442863},
|
||||
{0.262866, 0.951056, -0.162460},
|
||||
{0.500000, 0.809017, -0.309017},
|
||||
{0.850651, 0.525731, 0.000000},
|
||||
{0.716567, 0.681718, 0.147621},
|
||||
{0.716567, 0.681718, -0.147621},
|
||||
{0.525731, 0.850651, 0.000000},
|
||||
{0.425325, 0.688191, 0.587785},
|
||||
{0.864188, 0.442863, 0.238856},
|
||||
{0.688191, 0.587785, 0.425325},
|
||||
{0.809017, 0.309017, 0.500000},
|
||||
{0.681718, 0.147621, 0.716567},
|
||||
{0.587785, 0.425325, 0.688191},
|
||||
{0.955423, 0.295242, 0.000000},
|
||||
{1.000000, 0.000000, 0.000000},
|
||||
{0.951056, 0.162460, 0.262866},
|
||||
{0.850651, -0.525731, 0.000000},
|
||||
{0.955423, -0.295242, 0.000000},
|
||||
{0.864188, -0.442863, 0.238856},
|
||||
{0.951056, -0.162460, 0.262866},
|
||||
{0.809017, -0.309017, 0.500000},
|
||||
{0.681718, -0.147621, 0.716567},
|
||||
{0.850651, 0.000000, 0.525731},
|
||||
{0.864188, 0.442863, -0.238856},
|
||||
{0.809017, 0.309017, -0.500000},
|
||||
{0.951056, 0.162460, -0.262866},
|
||||
{0.525731, 0.000000, -0.850651},
|
||||
{0.681718, 0.147621, -0.716567},
|
||||
{0.681718, -0.147621, -0.716567},
|
||||
{0.850651, 0.000000, -0.525731},
|
||||
{0.809017, -0.309017, -0.500000},
|
||||
{0.864188, -0.442863, -0.238856},
|
||||
{0.951056, -0.162460, -0.262866},
|
||||
{0.147621, 0.716567, -0.681718},
|
||||
{0.309017, 0.500000, -0.809017},
|
||||
{0.425325, 0.688191, -0.587785},
|
||||
{0.442863, 0.238856, -0.864188},
|
||||
{0.587785, 0.425325, -0.688191},
|
||||
{0.688191, 0.587785, -0.425325},
|
||||
{-0.147621, 0.716567, -0.681718},
|
||||
{-0.309017, 0.500000, -0.809017},
|
||||
{0.000000, 0.525731, -0.850651},
|
||||
{-0.525731, 0.000000, -0.850651},
|
||||
{-0.442863, 0.238856, -0.864188},
|
||||
{-0.295242, 0.000000, -0.955423},
|
||||
{-0.162460, 0.262866, -0.951056},
|
||||
{0.000000, 0.000000, -1.000000},
|
||||
{0.295242, 0.000000, -0.955423},
|
||||
{0.162460, 0.262866, -0.951056},
|
||||
{-0.442863, -0.238856, -0.864188},
|
||||
{-0.309017, -0.500000, -0.809017},
|
||||
{-0.162460, -0.262866, -0.951056},
|
||||
{0.000000, -0.850651, -0.525731},
|
||||
{-0.147621, -0.716567, -0.681718},
|
||||
{0.147621, -0.716567, -0.681718},
|
||||
{0.000000, -0.525731, -0.850651},
|
||||
{0.309017, -0.500000, -0.809017},
|
||||
{0.442863, -0.238856, -0.864188},
|
||||
{0.162460, -0.262866, -0.951056},
|
||||
{0.238856, -0.864188, -0.442863},
|
||||
{0.500000, -0.809017, -0.309017},
|
||||
{0.425325, -0.688191, -0.587785},
|
||||
{0.716567, -0.681718, -0.147621},
|
||||
{0.688191, -0.587785, -0.425325},
|
||||
{0.587785, -0.425325, -0.688191},
|
||||
{0.000000, -0.955423, -0.295242},
|
||||
{0.000000, -1.000000, 0.000000},
|
||||
{0.262866, -0.951056, -0.162460},
|
||||
{0.000000, -0.850651, 0.525731},
|
||||
{0.000000, -0.955423, 0.295242},
|
||||
{0.238856, -0.864188, 0.442863},
|
||||
{0.262866, -0.951056, 0.162460},
|
||||
{0.500000, -0.809017, 0.309017},
|
||||
{0.716567, -0.681718, 0.147621},
|
||||
{0.525731, -0.850651, 0.000000},
|
||||
{-0.238856, -0.864188, -0.442863},
|
||||
{-0.500000, -0.809017, -0.309017},
|
||||
{-0.262866, -0.951056, -0.162460},
|
||||
{-0.850651, -0.525731, 0.000000},
|
||||
{-0.716567, -0.681718, -0.147621},
|
||||
{-0.716567, -0.681718, 0.147621},
|
||||
{-0.525731, -0.850651, 0.000000},
|
||||
{-0.500000, -0.809017, 0.309017},
|
||||
{-0.238856, -0.864188, 0.442863},
|
||||
{-0.262866, -0.951056, 0.162460},
|
||||
{-0.864188, -0.442863, 0.238856},
|
||||
{-0.809017, -0.309017, 0.500000},
|
||||
{-0.688191, -0.587785, 0.425325},
|
||||
{-0.681718, -0.147621, 0.716567},
|
||||
{-0.442863, -0.238856, 0.864188},
|
||||
{-0.587785, -0.425325, 0.688191},
|
||||
{-0.309017, -0.500000, 0.809017},
|
||||
{-0.147621, -0.716567, 0.681718},
|
||||
{-0.425325, -0.688191, 0.587785},
|
||||
{-0.162460, -0.262866, 0.951056},
|
||||
{0.442863, -0.238856, 0.864188},
|
||||
{0.162460, -0.262866, 0.951056},
|
||||
{0.309017, -0.500000, 0.809017},
|
||||
{0.147621, -0.716567, 0.681718},
|
||||
{0.000000, -0.525731, 0.850651},
|
||||
{0.425325, -0.688191, 0.587785},
|
||||
{0.587785, -0.425325, 0.688191},
|
||||
{0.688191, -0.587785, 0.425325},
|
||||
{-0.955423, 0.295242, 0.000000},
|
||||
{-0.951056, 0.162460, 0.262866},
|
||||
{-1.000000, 0.000000, 0.000000},
|
||||
{-0.850651, 0.000000, 0.525731},
|
||||
{-0.955423, -0.295242, 0.000000},
|
||||
{-0.951056, -0.162460, 0.262866},
|
||||
{-0.864188, 0.442863, -0.238856},
|
||||
{-0.951056, 0.162460, -0.262866},
|
||||
{-0.809017, 0.309017, -0.500000},
|
||||
{-0.864188, -0.442863, -0.238856},
|
||||
{-0.951056, -0.162460, -0.262866},
|
||||
{-0.809017, -0.309017, -0.500000},
|
||||
{-0.681718, 0.147621, -0.716567},
|
||||
{-0.681718, -0.147621, -0.716567},
|
||||
{-0.850651, 0.000000, -0.525731},
|
||||
{-0.688191, 0.587785, -0.425325},
|
||||
{-0.587785, 0.425325, -0.688191},
|
||||
{-0.425325, 0.688191, -0.587785},
|
||||
{-0.425325, -0.688191, -0.587785},
|
||||
{-0.587785, -0.425325, -0.688191},
|
||||
{-0.688191, -0.587785, -0.425325},
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
/***
|
||||
*
|
||||
* Copyright (c) 1996-2002, Valve LLC. All rights reserved.
|
||||
*
|
||||
* This product contains software technology licensed from Id
|
||||
* Software, Inc. ("Id Technology"). Id Technology (c) 1996 Id Software, Inc.
|
||||
*
|
||||
* This product contains software technology licensed from Id
|
||||
* Software, Inc. ("Id Technology"). Id Technology (c) 1996 Id Software, Inc.
|
||||
* All Rights Reserved.
|
||||
*
|
||||
* Use, distribution, and modification of this source code and/or resulting
|
||||
@@ -15,7 +15,7 @@
|
||||
//
|
||||
// cdll_int.h
|
||||
//
|
||||
// 4-23-98
|
||||
// 4-23-98
|
||||
// JOHN: client dll interface declarations
|
||||
//
|
||||
|
||||
@@ -205,11 +205,11 @@ typedef struct cl_enginefuncs_s
|
||||
|
||||
const struct model_s* (*GetSpritePointer)( HSPRITE hSprite );
|
||||
void (*pfnPlaySoundByNameAtLocation)( char *szSound, float volume, float *origin );
|
||||
|
||||
|
||||
unsigned short (*pfnPrecacheEvent)( int type, const char* psz );
|
||||
void (*pfnPlaybackEvent)( int flags, const struct edict_s *pInvoker, unsigned short eventindex, float delay, float *origin, float *angles, float fparam1, float fparam2, int iparam1, int iparam2, int bparam1, int bparam2 );
|
||||
void (*pfnWeaponAnim)( int iAnim, int body );
|
||||
float (*pfnRandomFloat)( float flLow, float flHigh );
|
||||
float (*pfnRandomFloat)( float flLow, float flHigh );
|
||||
int (*pfnRandomLong)( int lLow, int lHigh );
|
||||
void (*pfnHookEvent)( const char *name, void ( *pfnEvent )( struct event_args_s *args ));
|
||||
|
||||
@@ -229,12 +229,12 @@ typedef struct cl_enginefuncs_s
|
||||
|
||||
struct triangleapi_s *pTriAPI;
|
||||
struct efx_api_s *pEfxAPI;
|
||||
struct event_api_s *pEventAPI;
|
||||
struct event_api_s *pEventAPI;
|
||||
struct demo_api_s *pDemoAPI;
|
||||
struct net_api_s *pNetAPI;
|
||||
struct IVoiceTweak_s *pVoiceTweak;
|
||||
|
||||
// returns 1 if the client is a spectator only (connected to a proxy), 0 otherwise or 2 if in dev_overview mode
|
||||
// returns 1 if the client is a spectator only (connected to a proxy), 0 otherwise or 2 if in dev_overview mode
|
||||
int (*IsSpectateOnly)( void );
|
||||
struct model_s *(*LoadMapSprite)( const char *filename );
|
||||
|
||||
@@ -285,9 +285,9 @@ typedef struct cl_enginefuncs_s
|
||||
const char *(*LocalPlayerInfo_ValueForKey)( const char* key );
|
||||
int (*pfnVGUI2DrawCharacter)( int x, int y, int ch, unsigned int font );
|
||||
int (*pfnVGUI2DrawCharacterAdditive)( int x, int y, int ch, int r, int g, int b, unsigned int font );
|
||||
unsigned int (*pfnGetApproxWavePlayLen)( char *filename );
|
||||
unsigned int (*pfnGetApproxWavePlayLen)( const char *filename );
|
||||
void* (*GetCareerGameUI)( void ); // g-cont. !!!! potential crash-point!
|
||||
void (*Cvar_Set)( char *name, char *value );
|
||||
void (*Cvar_Set)( const char *name, const char *value );
|
||||
int (*pfnIsPlayingCareerMatch)( void );
|
||||
void (*pfnPlaySoundVoiceByName)( char *szSound, float volume, int pitch );
|
||||
void (*pfnPrimeMusicStream)( char *filename, int looping );
|
||||
|
||||
@@ -59,14 +59,14 @@ dll_info_t msacm_dll = { "msacm32.dll", msacm_funcs, false };
|
||||
static int (_stdcall *pAVIStreamInfo)( PAVISTREAM pavi, AVISTREAMINFO *psi, LONG lSize );
|
||||
static int (_stdcall *pAVIStreamRead)( PAVISTREAM pavi, LONG lStart, LONG lSamples, void *lpBuffer, LONG cbBuffer, LONG *plBytes, LONG *plSamples );
|
||||
static PGETFRAME (_stdcall *pAVIStreamGetFrameOpen)( PAVISTREAM pavi, LPBITMAPINFOHEADER lpbiWanted );
|
||||
static long (_stdcall *pAVIStreamTimeToSample)( PAVISTREAM pavi, LONG lTime );
|
||||
static int (_stdcall *pAVIStreamTimeToSample)( PAVISTREAM pavi, LONG lTime );
|
||||
static void* (_stdcall *pAVIStreamGetFrame)( PGETFRAME pg, LONG lPos );
|
||||
static int (_stdcall *pAVIStreamGetFrameClose)( PGETFRAME pg );
|
||||
static dword (_stdcall *pAVIStreamRelease)( PAVISTREAM pavi );
|
||||
static int (_stdcall *pAVIFileOpen)( PAVIFILE *ppfile, LPCSTR szFile, UINT uMode, LPCLSID lpHandler );
|
||||
static int (_stdcall *pAVIFileGetStream)( PAVIFILE pfile, PAVISTREAM *ppavi, DWORD fccType, LONG lParam );
|
||||
static int (_stdcall *pAVIStreamReadFormat)( PAVISTREAM pavi, LONG lPos,LPVOID lpFormat, LONG *lpcbFormat );
|
||||
static long (_stdcall *pAVIStreamStart)( PAVISTREAM pavi );
|
||||
static int (_stdcall *pAVIStreamStart)( PAVISTREAM pavi );
|
||||
static dword (_stdcall *pAVIFileRelease)( PAVIFILE pfile );
|
||||
static void (_stdcall *pAVIFileInit)( void );
|
||||
static void (_stdcall *pAVIFileExit)( void );
|
||||
@@ -91,7 +91,7 @@ static dllfunc_t avifile_funcs[] =
|
||||
};
|
||||
|
||||
dll_info_t avifile_dll = { "avifil32.dll", avifile_funcs, false };
|
||||
|
||||
|
||||
typedef struct movie_state_s
|
||||
{
|
||||
qboolean active;
|
||||
@@ -100,17 +100,17 @@ typedef struct movie_state_s
|
||||
PAVIFILE pfile; // avi file pointer
|
||||
PAVISTREAM video_stream; // video stream pointer
|
||||
PGETFRAME video_getframe; // pointer to getframe object for video stream
|
||||
long video_frames; // total frames
|
||||
long video_xres; // video stream resolution
|
||||
long video_yres;
|
||||
int video_frames; // total frames
|
||||
int video_xres; // video stream resolution
|
||||
int video_yres;
|
||||
float video_fps; // video stream fps
|
||||
|
||||
PAVISTREAM audio_stream; // audio stream pointer
|
||||
WAVEFORMAT *audio_header; // audio stream header
|
||||
long audio_header_size; // WAVEFORMAT is returned for PCM data; WAVEFORMATEX for others
|
||||
long audio_codec; // WAVE_FORMAT_PCM is oldstyle: anything else needs conversion
|
||||
long audio_length; // in converted samples
|
||||
long audio_bytes_per_sample; // guess.
|
||||
int audio_header_size; // WAVEFORMAT is returned for PCM data; WAVEFORMATEX for others
|
||||
int audio_codec; // WAVE_FORMAT_PCM is oldstyle: anything else needs conversion
|
||||
int audio_length; // in converted samples
|
||||
int audio_bytes_per_sample; // guess.
|
||||
|
||||
// compressed audio specific data
|
||||
dword cpa_blockalign; // block size to read
|
||||
@@ -296,7 +296,7 @@ int AVI_TimeToSoundPosition( movie_state_t *Avi, int time )
|
||||
}
|
||||
|
||||
// gets the raw frame data
|
||||
byte *AVI_GetVideoFrame( movie_state_t *Avi, long frame )
|
||||
byte *AVI_GetVideoFrame( movie_state_t *Avi, int frame )
|
||||
{
|
||||
LPBITMAPINFOHEADER frame_info;
|
||||
byte *frame_raw;
|
||||
@@ -385,7 +385,7 @@ qboolean AVI_SeekPosition( movie_state_t *Avi, dword offset )
|
||||
// get a chunk of audio from the stream (in bytes)
|
||||
int AVI_GetAudioChunk( movie_state_t *Avi, char *audiodata, int offset, int length )
|
||||
{
|
||||
long result = 0;
|
||||
int result = 0;
|
||||
int i;
|
||||
|
||||
// zero data past the end of the file
|
||||
@@ -393,7 +393,7 @@ int AVI_GetAudioChunk( movie_state_t *Avi, char *audiodata, int offset, int leng
|
||||
{
|
||||
if( offset <= Avi->audio_length )
|
||||
{
|
||||
long remaining_length = Avi->audio_length - offset;
|
||||
int remaining_length = Avi->audio_length - offset;
|
||||
|
||||
AVI_GetAudioChunk( Avi, audiodata, offset, remaining_length );
|
||||
|
||||
@@ -423,12 +423,12 @@ int AVI_GetAudioChunk( movie_state_t *Avi, char *audiodata, int offset, int leng
|
||||
result = 0;
|
||||
|
||||
// seek to correct chunk and all that stuff
|
||||
if( !AVI_SeekPosition( Avi, offset ))
|
||||
if( !AVI_SeekPosition( Avi, offset ))
|
||||
return 0; // don't continue if we're waiting for the play pointer to catch up
|
||||
|
||||
while( length > 0 )
|
||||
{
|
||||
long blockread = Avi->cpa_conversion_header.cbDstLengthUsed - Avi->cpa_blockpos;
|
||||
int blockread = Avi->cpa_conversion_header.cbDstLengthUsed - Avi->cpa_blockpos;
|
||||
|
||||
if( blockread <= 0 ) // read next
|
||||
{
|
||||
@@ -491,7 +491,7 @@ void AVI_OpenVideo( movie_state_t *Avi, const char *filename, qboolean load_audi
|
||||
{
|
||||
BITMAPINFOHEADER bmih;
|
||||
AVISTREAMINFO stream_info;
|
||||
long opened_streams = 0;
|
||||
int opened_streams = 0;
|
||||
LONG hr;
|
||||
|
||||
// default state: non-working.
|
||||
@@ -535,7 +535,7 @@ void AVI_OpenVideo( movie_state_t *Avi, const char *filename, qboolean load_audi
|
||||
|
||||
Avi->video_stream = Avi->audio_stream = NULL;
|
||||
|
||||
// open the streams until a stream is not available.
|
||||
// open the streams until a stream is not available.
|
||||
while( 1 )
|
||||
{
|
||||
PAVISTREAM stream = NULL;
|
||||
@@ -558,7 +558,7 @@ void AVI_OpenVideo( movie_state_t *Avi, const char *filename, qboolean load_audi
|
||||
}
|
||||
else if( stream_info.fccType == streamtypeAUDIO && Avi->audio_stream == NULL && load_audio )
|
||||
{
|
||||
long size;
|
||||
int size;
|
||||
|
||||
Avi->audio_stream = stream;
|
||||
|
||||
@@ -571,7 +571,7 @@ void AVI_OpenVideo( movie_state_t *Avi, const char *filename, qboolean load_audi
|
||||
Avi->audio_codec = Avi->audio_header->wFormatTag;
|
||||
|
||||
// length of converted audio in samples
|
||||
Avi->audio_length = (long)((float)stream_info.dwLength / Avi->audio_header->nAvgBytesPerSec );
|
||||
Avi->audio_length = (int)((float)stream_info.dwLength / Avi->audio_header->nAvgBytesPerSec );
|
||||
Avi->audio_length *= Avi->audio_header->nSamplesPerSec;
|
||||
|
||||
if( Avi->audio_codec != WAVE_FORMAT_PCM )
|
||||
@@ -585,17 +585,17 @@ void AVI_OpenVideo( movie_state_t *Avi, const char *filename, qboolean load_audi
|
||||
}
|
||||
else Avi->audio_bytes_per_sample = Avi->audio_header->nBlockAlign;
|
||||
Avi->audio_length *= Avi->audio_bytes_per_sample;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
pAVIStreamRelease( stream );
|
||||
}
|
||||
}
|
||||
|
||||
// display error message-stream not found.
|
||||
// display error message-stream not found.
|
||||
if( Avi->video_stream == NULL )
|
||||
{
|
||||
if( Avi->pfile ) // if file is open, close it
|
||||
if( Avi->pfile ) // if file is open, close it
|
||||
pAVIFileRelease( Avi->pfile );
|
||||
if( !Avi->quiet )
|
||||
Con_DPrintf( S_ERROR "couldn't find a valid video stream.\n" );
|
||||
@@ -613,9 +613,9 @@ void AVI_OpenVideo( movie_state_t *Avi, const char *filename, qboolean load_audi
|
||||
}
|
||||
|
||||
bmih.biSize = sizeof( BITMAPINFOHEADER );
|
||||
bmih.biPlanes = 1;
|
||||
bmih.biPlanes = 1;
|
||||
bmih.biBitCount = 32;
|
||||
bmih.biCompression = BI_RGB;
|
||||
bmih.biCompression = BI_RGB;
|
||||
bmih.biWidth = Avi->video_xres;
|
||||
bmih.biHeight = -Avi->video_yres; // invert height to flip image upside down
|
||||
|
||||
|
||||
@@ -126,8 +126,8 @@ void CL_PlayCDTrack_f( void )
|
||||
int i, maxTrack;
|
||||
|
||||
for( maxTrack = i = 0; i < MAX_CDTRACKS; i++ )
|
||||
if( Q_strlen( clgame.cdtracks[i] )) maxTrack++;
|
||||
|
||||
if( COM_CheckStringEmpty( clgame.cdtracks[i] ) ) maxTrack++;
|
||||
|
||||
Con_Printf( "%u tracks\n", maxTrack );
|
||||
if( track )
|
||||
{
|
||||
@@ -140,11 +140,11 @@ void CL_PlayCDTrack_f( void )
|
||||
else Con_Printf( "%s: unknown command %s\n", Cmd_Argv( 0 ), command );
|
||||
}
|
||||
|
||||
/*
|
||||
==================
|
||||
/*
|
||||
==================
|
||||
CL_ScreenshotGetName
|
||||
==================
|
||||
*/
|
||||
==================
|
||||
*/
|
||||
qboolean CL_ScreenshotGetName( int lastnum, char *filename )
|
||||
{
|
||||
if( lastnum < 0 || lastnum > 9999 )
|
||||
@@ -153,16 +153,16 @@ qboolean CL_ScreenshotGetName( int lastnum, char *filename )
|
||||
return false;
|
||||
}
|
||||
|
||||
Q_sprintf( filename, "scrshots/%s_shot%0004d.png", clgame.mapname, lastnum );
|
||||
Q_sprintf( filename, "scrshots/%s_shot%04d.png", clgame.mapname, lastnum );
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
/*
|
||||
==================
|
||||
/*
|
||||
==================
|
||||
CL_SnapshotGetName
|
||||
==================
|
||||
*/
|
||||
==================
|
||||
*/
|
||||
qboolean CL_SnapshotGetName( int lastnum, char *filename )
|
||||
{
|
||||
if( lastnum < 0 || lastnum > 9999 )
|
||||
@@ -172,26 +172,26 @@ qboolean CL_SnapshotGetName( int lastnum, char *filename )
|
||||
return false;
|
||||
}
|
||||
|
||||
Q_sprintf( filename, "../%s_%0004d.png", clgame.mapname, lastnum );
|
||||
Q_sprintf( filename, "../%s_%04d.png", clgame.mapname, lastnum );
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
/*
|
||||
==============================================================================
|
||||
|
||||
SCREEN SHOTS
|
||||
|
||||
==============================================================================
|
||||
/*
|
||||
==============================================================================
|
||||
|
||||
SCREEN SHOTS
|
||||
|
||||
==============================================================================
|
||||
*/
|
||||
/*
|
||||
==================
|
||||
/*
|
||||
==================
|
||||
CL_ScreenShot_f
|
||||
|
||||
normal screenshot
|
||||
==================
|
||||
==================
|
||||
*/
|
||||
void CL_ScreenShot_f( void )
|
||||
void CL_ScreenShot_f( void )
|
||||
{
|
||||
int i;
|
||||
string checkname;
|
||||
@@ -222,14 +222,14 @@ void CL_ScreenShot_f( void )
|
||||
cls.envshot_viewsize = 0;
|
||||
}
|
||||
|
||||
/*
|
||||
==================
|
||||
/*
|
||||
==================
|
||||
CL_SnapShot_f
|
||||
|
||||
save screenshots into root dir
|
||||
==================
|
||||
==================
|
||||
*/
|
||||
void CL_SnapShot_f( void )
|
||||
void CL_SnapShot_f( void )
|
||||
{
|
||||
int i;
|
||||
string checkname;
|
||||
@@ -263,12 +263,12 @@ void CL_SnapShot_f( void )
|
||||
cls.envshot_viewsize = 0;
|
||||
}
|
||||
|
||||
/*
|
||||
==================
|
||||
/*
|
||||
==================
|
||||
CL_EnvShot_f
|
||||
|
||||
cubemap view
|
||||
==================
|
||||
==================
|
||||
*/
|
||||
void CL_EnvShot_f( void )
|
||||
{
|
||||
@@ -284,12 +284,12 @@ void CL_EnvShot_f( void )
|
||||
cls.envshot_viewsize = 0;
|
||||
}
|
||||
|
||||
/*
|
||||
==================
|
||||
/*
|
||||
==================
|
||||
CL_SkyShot_f
|
||||
|
||||
skybox view
|
||||
==================
|
||||
==================
|
||||
*/
|
||||
void CL_SkyShot_f( void )
|
||||
{
|
||||
@@ -305,13 +305,13 @@ void CL_SkyShot_f( void )
|
||||
cls.envshot_viewsize = 0;
|
||||
}
|
||||
|
||||
/*
|
||||
==================
|
||||
/*
|
||||
==================
|
||||
CL_LevelShot_f
|
||||
|
||||
splash logo while map is loading
|
||||
==================
|
||||
*/
|
||||
==================
|
||||
*/
|
||||
void CL_LevelShot_f( void )
|
||||
{
|
||||
size_t ft1, ft2;
|
||||
@@ -345,13 +345,13 @@ void CL_LevelShot_f( void )
|
||||
else cls.scrshot_action = scrshot_inactive; // disable - not needs
|
||||
}
|
||||
|
||||
/*
|
||||
==================
|
||||
/*
|
||||
==================
|
||||
CL_SaveShot_f
|
||||
|
||||
mini-pic in loadgame menu
|
||||
==================
|
||||
*/
|
||||
==================
|
||||
*/
|
||||
void CL_SaveShot_f( void )
|
||||
{
|
||||
if( Cmd_Argc() < 2 )
|
||||
@@ -360,7 +360,7 @@ void CL_SaveShot_f( void )
|
||||
return;
|
||||
}
|
||||
|
||||
Q_sprintf( cls.shotname, "%s%s.bmp", DEFAULT_SAVE_DIRECTORY, Cmd_Argv( 1 ));
|
||||
Q_sprintf( cls.shotname, DEFAULT_SAVE_DIRECTORY "%s.bmp", Cmd_Argv( 1 ));
|
||||
cls.scrshot_action = scrshot_savegame; // build new frame for saveshot
|
||||
}
|
||||
|
||||
@@ -418,3 +418,32 @@ void SCR_Viewpos_f( void )
|
||||
Con_Printf( "org ( %g %g %g )\n", refState.vieworg[0], refState.vieworg[1], refState.vieworg[2] );
|
||||
Con_Printf( "ang ( %g %g %g )\n", refState.viewangles[0], refState.viewangles[1], refState.viewangles[2] );
|
||||
}
|
||||
|
||||
/*
|
||||
=============
|
||||
CL_WavePlayLen_f
|
||||
|
||||
=============
|
||||
*/
|
||||
void CL_WavePlayLen_f( void )
|
||||
{
|
||||
const char *name;
|
||||
uint msecs;
|
||||
|
||||
if( Cmd_Argc() != 2 )
|
||||
{
|
||||
Con_Printf( "waveplaylen <wave file name>: returns approximate number of milliseconds a wave file will take to play.\n" );
|
||||
return;
|
||||
}
|
||||
|
||||
name = Cmd_Argv( 1 );
|
||||
msecs = Sound_GetApproxWavePlayLen( name );
|
||||
|
||||
if( msecs == 0 )
|
||||
{
|
||||
Con_Printf( "Unable to read %s, file may be missing or incorrectly formatted.\n", name );
|
||||
return;
|
||||
}
|
||||
|
||||
Con_Printf( "Play time is approximately %dms\n", msecs );
|
||||
}
|
||||
|
||||
@@ -39,9 +39,9 @@ qboolean CL_CheckFile( sizebuf_t *msg, resource_t *pResource )
|
||||
}
|
||||
|
||||
if( pResource->type == t_sound )
|
||||
Q_strncpy( filepath, va( "%s%s", DEFAULT_SOUNDPATH, pResource->szFileName ), sizeof( filepath ));
|
||||
Q_snprintf( filepath, sizeof( filepath ), DEFAULT_SOUNDPATH "%s", pResource->szFileName );
|
||||
else Q_strncpy( filepath, pResource->szFileName, sizeof( filepath ));
|
||||
|
||||
|
||||
if( !COM_IsSafeFileToDownload( filepath ))
|
||||
{
|
||||
Con_Reportf( "refusing to download %s\n", filepath );
|
||||
@@ -106,7 +106,7 @@ void CL_RemoveFromResourceList( resource_t *pResource )
|
||||
if( pResource->pPrev == NULL || pResource->pNext == NULL )
|
||||
Host_Error( "mislinked resource in CL_RemoveFromResourceList\n" );
|
||||
|
||||
if ( pResource->pNext == pResource || pResource->pPrev == pResource )
|
||||
if( pResource->pNext == pResource || pResource->pPrev == pResource )
|
||||
Host_Error( "attempt to free last entry in list.\n" );
|
||||
|
||||
pResource->pPrev->pNext = pResource->pNext;
|
||||
|
||||
@@ -86,6 +86,7 @@ const char *svc_strings[svc_lastmsg+1] =
|
||||
"svc_resourcelocation",
|
||||
"svc_querycvarvalue",
|
||||
"svc_querycvarvalue2",
|
||||
"svc_exec",
|
||||
};
|
||||
|
||||
typedef struct
|
||||
@@ -97,7 +98,7 @@ typedef struct
|
||||
|
||||
typedef struct
|
||||
{
|
||||
oldcmd_t oldcmd[MSG_COUNT];
|
||||
oldcmd_t oldcmd[MSG_COUNT];
|
||||
int currentcmd;
|
||||
qboolean parsing;
|
||||
} msg_debug_t;
|
||||
@@ -155,7 +156,7 @@ void CL_Parse_RecordCommand( int cmd, int startoffset )
|
||||
int slot;
|
||||
|
||||
if( cmd == svc_nop ) return;
|
||||
|
||||
|
||||
slot = ( cls_message_debug.currentcmd++ & MSG_MASK );
|
||||
cls_message_debug.oldcmd[slot].command = cmd;
|
||||
cls_message_debug.oldcmd[slot].starting_offset = startoffset;
|
||||
@@ -187,7 +188,7 @@ write net_message into buffer.dat for debugging
|
||||
static void CL_WriteErrorMessage( int current_count, sizebuf_t *msg )
|
||||
{
|
||||
const char *buffer_file = "buffer.dat";
|
||||
file_t *fp;
|
||||
file_t *fp;
|
||||
|
||||
fp = FS_Open( buffer_file, "wb", false );
|
||||
if( !fp ) return;
|
||||
|
||||
@@ -156,7 +156,7 @@ CL_GetDemoRecordClock
|
||||
write time while demo is recording
|
||||
====================
|
||||
*/
|
||||
float CL_GetDemoRecordClock( void )
|
||||
float CL_GetDemoRecordClock( void )
|
||||
{
|
||||
return cl.mtime[0];
|
||||
}
|
||||
@@ -168,7 +168,7 @@ CL_GetDemoPlaybackClock
|
||||
overwrite host.realtime
|
||||
====================
|
||||
*/
|
||||
float CL_GetDemoPlaybackClock( void )
|
||||
float CL_GetDemoPlaybackClock( void )
|
||||
{
|
||||
return host.realtime + host.frametime;
|
||||
}
|
||||
@@ -353,7 +353,7 @@ void CL_WriteDemoHeader( const char *name )
|
||||
int copysize;
|
||||
int savepos;
|
||||
int curpos;
|
||||
|
||||
|
||||
Con_Printf( "recording to %s.\n", name );
|
||||
cls.demofile = FS_Open( name, "wb", false );
|
||||
cls.demotime = 0.0;
|
||||
@@ -371,7 +371,7 @@ void CL_WriteDemoHeader( const char *name )
|
||||
|
||||
demo.header.id = IDEMOHEADER;
|
||||
demo.header.dem_protocol = DEMO_PROTOCOL;
|
||||
demo.header.net_protocol = PROTOCOL_VERSION;
|
||||
demo.header.net_protocol = cls.legacymode ? PROTOCOL_LEGACY_VERSION : PROTOCOL_VERSION;
|
||||
demo.header.host_fps = bound( MIN_FPS, host_maxfps->value, MAX_FPS );
|
||||
Q_strncpy( demo.header.mapname, clgame.mapname, sizeof( demo.header.mapname ));
|
||||
Q_strncpy( demo.header.comment, clgame.maptitle, sizeof( demo.header.comment ));
|
||||
@@ -467,7 +467,7 @@ void CL_StopRecord( void )
|
||||
demo.header.directory_offset = curpos;
|
||||
FS_Seek( cls.demofile, 0, SEEK_SET );
|
||||
FS_Write( cls.demofile, &demo.header, sizeof( demo.header ));
|
||||
|
||||
|
||||
FS_Close( cls.demofile );
|
||||
cls.demofile = NULL;
|
||||
cls.demorecording = false;
|
||||
@@ -726,9 +726,9 @@ qboolean CL_DemoMoveToNextSection( void )
|
||||
|
||||
// switch to next section, we got a dem_stop
|
||||
demo.entry = &demo.directory.entries[demo.entryIndex];
|
||||
|
||||
|
||||
// ready to continue reading, reset clock.
|
||||
FS_Seek( cls.demofile, demo.entry->offset, SEEK_SET );
|
||||
FS_Seek( cls.demofile, demo.entry->offset, SEEK_SET );
|
||||
|
||||
// time is now relative to this chunk's clock.
|
||||
demo.starttime = CL_GetDemoPlaybackClock();
|
||||
@@ -739,7 +739,7 @@ qboolean CL_DemoMoveToNextSection( void )
|
||||
|
||||
qboolean CL_ReadRawNetworkData( byte *buffer, size_t *length )
|
||||
{
|
||||
int msglen = 0;
|
||||
int msglen = 0;
|
||||
|
||||
Assert( buffer != NULL );
|
||||
Assert( length != NULL );
|
||||
@@ -795,8 +795,8 @@ qboolean CL_DemoReadMessageQuake( byte *buffer, size_t *length )
|
||||
demoangle_t *a;
|
||||
|
||||
*length = 0; // assume we fail
|
||||
|
||||
// decide if it is time to grab the next message
|
||||
|
||||
// decide if it is time to grab the next message
|
||||
if( cls.signon == SIGNONS ) // allways grab until fully connected
|
||||
{
|
||||
if( cls.timedemo )
|
||||
@@ -971,7 +971,7 @@ qboolean CL_DemoReadMessage( byte *buffer, size_t *length )
|
||||
}
|
||||
} while( swallowmessages );
|
||||
|
||||
// If we are playing back a timedemo, and we've already passed on a
|
||||
// If we are playing back a timedemo, and we've already passed on a
|
||||
// frame update for this host_frame tag, then we'll just skip this message.
|
||||
if( cls.timedemo && ( tdlastdemoframe == host.framecount ))
|
||||
{
|
||||
@@ -993,7 +993,7 @@ qboolean CL_DemoReadMessage( byte *buffer, size_t *length )
|
||||
{
|
||||
// cheat by moving the relative start time forward.
|
||||
demo.starttime = CL_GetDemoPlaybackClock();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
demo.framecount++;
|
||||
@@ -1101,9 +1101,9 @@ void CL_FinishTimeDemo( void )
|
||||
{
|
||||
int frames;
|
||||
double time;
|
||||
|
||||
|
||||
cls.timedemo = false;
|
||||
|
||||
|
||||
// the first frame didn't count
|
||||
frames = (host.framecount - cls.td_startframe) - 1;
|
||||
time = host.realtime - cls.td_starttime;
|
||||
@@ -1151,7 +1151,7 @@ void CL_StopPlayback( void )
|
||||
}
|
||||
else
|
||||
{
|
||||
// let game known about demo state
|
||||
// let game known about demo state
|
||||
Cvar_FullSet( "cl_background", "0", FCVAR_READ_ONLY );
|
||||
cls.state = ca_disconnected;
|
||||
memset( &cls.serveradr, 0, sizeof( cls.serveradr ) );
|
||||
@@ -1166,12 +1166,12 @@ void CL_StopPlayback( void )
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
==================
|
||||
/*
|
||||
==================
|
||||
CL_GetDemoComment
|
||||
==================
|
||||
*/
|
||||
int CL_GetDemoComment( const char *demoname, char *comment )
|
||||
==================
|
||||
*/
|
||||
int GAME_EXPORT CL_GetDemoComment( const char *demoname, char *comment )
|
||||
{
|
||||
file_t *demfile;
|
||||
demoheader_t demohdr;
|
||||
@@ -1179,13 +1179,13 @@ int CL_GetDemoComment( const char *demoname, char *comment )
|
||||
demoentry_t entry;
|
||||
float playtime = 0.0f;
|
||||
int i;
|
||||
|
||||
|
||||
if( !comment ) return false;
|
||||
|
||||
demfile = FS_Open( demoname, "rb", false );
|
||||
if( !demfile )
|
||||
{
|
||||
Q_strncpy( comment, "", MAX_STRING );
|
||||
comment[0] = '\0';
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -1199,7 +1199,9 @@ int CL_GetDemoComment( const char *demoname, char *comment )
|
||||
return false;
|
||||
}
|
||||
|
||||
if( demohdr.net_protocol != PROTOCOL_VERSION || demohdr.dem_protocol != DEMO_PROTOCOL )
|
||||
if(( demohdr.net_protocol != PROTOCOL_VERSION &&
|
||||
demohdr.net_protocol != PROTOCOL_LEGACY_VERSION ) ||
|
||||
demohdr.dem_protocol != DEMO_PROTOCOL )
|
||||
{
|
||||
FS_Close( demfile );
|
||||
Q_strncpy( comment, "<invalid protocol>", MAX_STRING );
|
||||
@@ -1226,11 +1228,11 @@ int CL_GetDemoComment( const char *demoname, char *comment )
|
||||
// split comment to sections
|
||||
Q_strncpy( comment, demohdr.mapname, CS_SIZE );
|
||||
Q_strncpy( comment + CS_SIZE, demohdr.comment, CS_SIZE );
|
||||
Q_strncpy( comment + CS_SIZE * 2, va( "%g sec", playtime ), CS_TIME );
|
||||
Q_snprintf( comment + CS_SIZE * 2, CS_TIME, "%g sec", playtime );
|
||||
|
||||
// all done
|
||||
FS_Close( demfile );
|
||||
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -1267,12 +1269,12 @@ qboolean CL_NextDemo( void )
|
||||
return true;
|
||||
}
|
||||
|
||||
/*
|
||||
==================
|
||||
/*
|
||||
==================
|
||||
CL_CheckStartupDemos
|
||||
|
||||
queue demos loop after movie playing
|
||||
==================
|
||||
==================
|
||||
*/
|
||||
void CL_CheckStartupDemos( void )
|
||||
{
|
||||
@@ -1297,11 +1299,11 @@ void CL_CheckStartupDemos( void )
|
||||
CL_NextDemo ();
|
||||
}
|
||||
|
||||
/*
|
||||
==================
|
||||
/*
|
||||
==================
|
||||
CL_DemoGetName
|
||||
==================
|
||||
*/
|
||||
==================
|
||||
*/
|
||||
static void CL_DemoGetName( int lastnum, char *filename )
|
||||
{
|
||||
if( lastnum < 0 || lastnum > 9999 )
|
||||
@@ -1311,7 +1313,7 @@ static void CL_DemoGetName( int lastnum, char *filename )
|
||||
return;
|
||||
}
|
||||
|
||||
Q_sprintf( filename, "demo%0004d", lastnum );
|
||||
Q_sprintf( filename, "demo%04d", lastnum );
|
||||
}
|
||||
|
||||
/*
|
||||
@@ -1381,13 +1383,13 @@ void CL_Record_f( void )
|
||||
// open the demo file
|
||||
Q_sprintf( demopath, "%s.dem", demoname );
|
||||
|
||||
// make sure what old demo is removed
|
||||
// make sure that old demo is removed
|
||||
if( FS_FileExists( demopath, false ))
|
||||
FS_Delete( demopath );
|
||||
|
||||
Q_strncpy( cls.demoname, demoname, sizeof( cls.demoname ));
|
||||
Q_strncpy( gameui.globals->demoname, demoname, sizeof( gameui.globals->demoname ));
|
||||
|
||||
|
||||
CL_WriteDemoHeader( demopath );
|
||||
}
|
||||
|
||||
@@ -1476,13 +1478,17 @@ void CL_PlayDemo_f( void )
|
||||
return;
|
||||
}
|
||||
|
||||
if( demo.header.net_protocol != PROTOCOL_VERSION || demo.header.dem_protocol != DEMO_PROTOCOL )
|
||||
if( demo.header.dem_protocol != DEMO_PROTOCOL )
|
||||
{
|
||||
if( demo.header.dem_protocol != DEMO_PROTOCOL )
|
||||
Con_Printf( S_ERROR "playdemo: demo protocol outdated (%i should be %i)\n", demo.header.dem_protocol, DEMO_PROTOCOL );
|
||||
Con_Printf( S_ERROR "playdemo: demo protocol outdated (%i should be %i)\n", demo.header.dem_protocol, DEMO_PROTOCOL );
|
||||
CL_DemoAborted();
|
||||
return;
|
||||
}
|
||||
|
||||
if( demo.header.net_protocol != PROTOCOL_VERSION )
|
||||
Con_Printf( S_ERROR "playdemo: net protocol outdated (%i should be %i)\n", demo.header.net_protocol, PROTOCOL_VERSION );
|
||||
if( demo.header.net_protocol != PROTOCOL_VERSION &&
|
||||
demo.header.net_protocol != PROTOCOL_LEGACY_VERSION )
|
||||
{
|
||||
Con_Printf( S_ERROR "playdemo: net protocol outdated (%i should be %i)\n", demo.header.net_protocol, PROTOCOL_VERSION );
|
||||
CL_DemoAborted();
|
||||
return;
|
||||
}
|
||||
@@ -1515,6 +1521,7 @@ void CL_PlayDemo_f( void )
|
||||
|
||||
// g-cont. is this need?
|
||||
Q_strncpy( cls.servername, demoname, sizeof( cls.servername ));
|
||||
cls.legacymode = demo.header.net_protocol == PROTOCOL_LEGACY_VERSION;
|
||||
|
||||
// begin a playback demo
|
||||
}
|
||||
|
||||
@@ -18,7 +18,7 @@ GNU General Public License for more details.
|
||||
#include "studio.h"
|
||||
#include "world.h" // BOX_ON_PLANE_SIDE
|
||||
#include "client.h"
|
||||
#include "mathlib.h"
|
||||
#include "xash3d_mathlib.h"
|
||||
|
||||
/*
|
||||
===============================================================================
|
||||
@@ -43,9 +43,9 @@ Call when removing an object from the world or moving it to another position
|
||||
void R_RemoveEfrags( cl_entity_t *ent )
|
||||
{
|
||||
efrag_t *ef, *old, *walk, **prev;
|
||||
|
||||
|
||||
ef = ent->efrag;
|
||||
|
||||
|
||||
while( ef )
|
||||
{
|
||||
prev = &ef->leaf->efrags;
|
||||
@@ -55,22 +55,22 @@ void R_RemoveEfrags( cl_entity_t *ent )
|
||||
if( !walk ) break;
|
||||
|
||||
if( walk == ef )
|
||||
{
|
||||
{
|
||||
// remove this fragment
|
||||
*prev = ef->leafnext;
|
||||
break;
|
||||
}
|
||||
else prev = &walk->leafnext;
|
||||
}
|
||||
|
||||
|
||||
old = ef;
|
||||
ef = ef->entnext;
|
||||
|
||||
|
||||
// put it on the free list
|
||||
old->entnext = clgame.free_efrags;
|
||||
clgame.free_efrags = old;
|
||||
}
|
||||
ent->efrag = NULL;
|
||||
ent->efrag = NULL;
|
||||
}
|
||||
|
||||
/*
|
||||
@@ -83,10 +83,10 @@ static void R_SplitEntityOnNode( mnode_t *node )
|
||||
efrag_t *ef;
|
||||
mleaf_t *leaf;
|
||||
int sides;
|
||||
|
||||
|
||||
if( node->contents == CONTENTS_SOLID )
|
||||
return;
|
||||
|
||||
|
||||
// add an efrag if the node is a leaf
|
||||
if( node->contents < 0 )
|
||||
{
|
||||
@@ -105,29 +105,29 @@ static void R_SplitEntityOnNode( mnode_t *node )
|
||||
|
||||
clgame.free_efrags = ef->entnext;
|
||||
ef->entity = r_addent;
|
||||
|
||||
// add the entity link
|
||||
|
||||
// add the entity link
|
||||
*lastlink = ef;
|
||||
lastlink = &ef->entnext;
|
||||
ef->entnext = NULL;
|
||||
|
||||
|
||||
// set the leaf links
|
||||
ef->leaf = leaf;
|
||||
ef->leafnext = leaf->efrags;
|
||||
leaf->efrags = ef;
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
// NODE_MIXED
|
||||
sides = BOX_ON_PLANE_SIDE( r_emins, r_emaxs, node->plane );
|
||||
|
||||
|
||||
if( sides == 3 )
|
||||
{
|
||||
// split on this plane
|
||||
// if this is the first splitter of this bmodel, remember it
|
||||
if( !r_pefragtopnode ) r_pefragtopnode = node;
|
||||
}
|
||||
|
||||
|
||||
// recurse down the contacted sides
|
||||
if( sides & 1 ) R_SplitEntityOnNode( node->children[0] );
|
||||
if( sides & 2 ) R_SplitEntityOnNode( node->children[1] );
|
||||
@@ -143,7 +143,7 @@ void R_AddEfrags( cl_entity_t *ent )
|
||||
matrix3x4 transform;
|
||||
vec3_t outmins, outmaxs;
|
||||
int i;
|
||||
|
||||
|
||||
if( !ent->model )
|
||||
return;
|
||||
|
||||
@@ -188,8 +188,6 @@ void R_StoreEfrags( efrag_t **ppefrag, int framecount )
|
||||
case mod_brush:
|
||||
case mod_studio:
|
||||
case mod_sprite:
|
||||
pent = pefrag->entity;
|
||||
|
||||
if( pent->visframe != framecount )
|
||||
{
|
||||
if( CL_AddVisibleEntity( pent, ET_FRAGMENTED ))
|
||||
@@ -202,7 +200,7 @@ void R_StoreEfrags( efrag_t **ppefrag, int framecount )
|
||||
|
||||
ppefrag = &pefrag->leafnext;
|
||||
break;
|
||||
default:
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -39,14 +39,14 @@ R_LookupColor
|
||||
find nearest color in particle palette
|
||||
================
|
||||
*/
|
||||
short R_LookupColor( byte r, byte g, byte b )
|
||||
short GAME_EXPORT R_LookupColor( byte r, byte g, byte b )
|
||||
{
|
||||
int i, best;
|
||||
float diff, bestdiff;
|
||||
float rf, gf, bf;
|
||||
|
||||
bestdiff = 999999;
|
||||
best = 65535;
|
||||
best = -1;
|
||||
|
||||
for( i = 0; i < 256; i++ )
|
||||
{
|
||||
@@ -74,7 +74,7 @@ R_GetPackedColor
|
||||
in hardware mode does nothing
|
||||
================
|
||||
*/
|
||||
void R_GetPackedColor( short *packed, short color )
|
||||
void GAME_EXPORT R_GetPackedColor( short *packed, short color )
|
||||
{
|
||||
if( packed ) *packed = 0;
|
||||
}
|
||||
@@ -187,7 +187,7 @@ R_AllocParticle
|
||||
can return NULL if particles is out
|
||||
================
|
||||
*/
|
||||
particle_t *R_AllocParticle( void (*callback)( particle_t*, float ))
|
||||
particle_t * GAME_EXPORT R_AllocParticle( void (*callback)( particle_t*, float ))
|
||||
{
|
||||
particle_t *p;
|
||||
|
||||
@@ -513,19 +513,19 @@ void CL_ReadLineFile_f( void )
|
||||
|
||||
while( 1 )
|
||||
{
|
||||
pfile = COM_ParseFile( pfile, token );
|
||||
pfile = COM_ParseFile( pfile, token, sizeof( token ));
|
||||
if( !pfile ) break;
|
||||
p1[0] = Q_atof( token );
|
||||
|
||||
pfile = COM_ParseFile( pfile, token );
|
||||
pfile = COM_ParseFile( pfile, token, sizeof( token ));
|
||||
if( !pfile ) break;
|
||||
p1[1] = Q_atof( token );
|
||||
|
||||
pfile = COM_ParseFile( pfile, token );
|
||||
pfile = COM_ParseFile( pfile, token, sizeof( token ));
|
||||
if( !pfile ) break;
|
||||
p1[2] = Q_atof( token );
|
||||
|
||||
pfile = COM_ParseFile( pfile, token );
|
||||
pfile = COM_ParseFile( pfile, token, sizeof( token ));
|
||||
if( !pfile ) break;
|
||||
|
||||
if( token[0] != '-' )
|
||||
@@ -534,15 +534,15 @@ void CL_ReadLineFile_f( void )
|
||||
break;
|
||||
}
|
||||
|
||||
pfile = COM_ParseFile( pfile, token );
|
||||
pfile = COM_ParseFile( pfile, token, sizeof( token ));
|
||||
if( !pfile ) break;
|
||||
p2[0] = Q_atof( token );
|
||||
|
||||
pfile = COM_ParseFile( pfile, token );
|
||||
pfile = COM_ParseFile( pfile, token, sizeof( token ));
|
||||
if( !pfile ) break;
|
||||
p2[1] = Q_atof( token );
|
||||
|
||||
pfile = COM_ParseFile( pfile, token );
|
||||
pfile = COM_ParseFile( pfile, token, sizeof( token ));
|
||||
if( !pfile ) break;
|
||||
p2[2] = Q_atof( token );
|
||||
|
||||
@@ -654,7 +654,7 @@ Remove beam attached to specified entity
|
||||
and all particle trails (if this is a beamfollow)
|
||||
==============
|
||||
*/
|
||||
void R_BeamKill( int deadEntity )
|
||||
void GAME_EXPORT R_BeamKill( int deadEntity )
|
||||
{
|
||||
cl_entity_t *pDeadEntity;
|
||||
|
||||
@@ -683,42 +683,46 @@ void CL_ParseViewBeam( sizebuf_t *msg, int beamType )
|
||||
switch( beamType )
|
||||
{
|
||||
case TE_BEAMPOINTS:
|
||||
start[0] = MSG_ReadCoord( msg );
|
||||
start[1] = MSG_ReadCoord( msg );
|
||||
start[2] = MSG_ReadCoord( msg );
|
||||
end[0] = MSG_ReadCoord( msg );
|
||||
end[1] = MSG_ReadCoord( msg );
|
||||
end[2] = MSG_ReadCoord( msg );
|
||||
modelIndex = MSG_ReadShort( msg );
|
||||
startFrame = MSG_ReadByte( msg );
|
||||
frameRate = (float)MSG_ReadByte( msg );
|
||||
life = (float)(MSG_ReadByte( msg ) * 0.1f);
|
||||
width = (float)(MSG_ReadByte( msg ) * 0.1f);
|
||||
noise = (float)(MSG_ReadByte( msg ) * 0.01f);
|
||||
r = (float)MSG_ReadByte( msg ) / 255.0f;
|
||||
g = (float)MSG_ReadByte( msg ) / 255.0f;
|
||||
b = (float)MSG_ReadByte( msg ) / 255.0f;
|
||||
a = (float)MSG_ReadByte( msg ) / 255.0f;
|
||||
speed = (float)(MSG_ReadByte( msg ) * 0.1f);
|
||||
R_BeamPoints( start, end, modelIndex, life, width, noise, a, speed, startFrame, frameRate, r, g, b );
|
||||
break;
|
||||
case TE_BEAMENTPOINT:
|
||||
startEnt = MSG_ReadShort( msg );
|
||||
end[0] = MSG_ReadCoord( msg );
|
||||
end[1] = MSG_ReadCoord( msg );
|
||||
end[2] = MSG_ReadCoord( msg );
|
||||
case TE_BEAMENTS:
|
||||
if( beamType == TE_BEAMENTS )
|
||||
{
|
||||
startEnt = MSG_ReadShort( msg );
|
||||
endEnt = MSG_ReadShort( msg );
|
||||
}
|
||||
else
|
||||
{
|
||||
if( beamType == TE_BEAMENTPOINT )
|
||||
{
|
||||
startEnt = MSG_ReadShort( msg );
|
||||
}
|
||||
else
|
||||
{
|
||||
start[0] = MSG_ReadCoord( msg );
|
||||
start[1] = MSG_ReadCoord( msg );
|
||||
start[2] = MSG_ReadCoord( msg );
|
||||
}
|
||||
end[0] = MSG_ReadCoord( msg );
|
||||
end[1] = MSG_ReadCoord( msg );
|
||||
end[2] = MSG_ReadCoord( msg );
|
||||
}
|
||||
modelIndex = MSG_ReadShort( msg );
|
||||
startFrame = MSG_ReadByte( msg );
|
||||
frameRate = (float)MSG_ReadByte( msg );
|
||||
life = (float)(MSG_ReadByte( msg ) * 0.1f);
|
||||
width = (float)(MSG_ReadByte( msg ) * 0.1f);
|
||||
noise = (float)(MSG_ReadByte( msg ) * 0.01f);
|
||||
frameRate = (float)MSG_ReadByte( msg ) * 0.1f;
|
||||
life = (float)MSG_ReadByte( msg ) * 0.1f;
|
||||
width = (float)MSG_ReadByte( msg ) * 0.1f;
|
||||
noise = (float)MSG_ReadByte( msg ) * 0.01f;
|
||||
r = (float)MSG_ReadByte( msg ) / 255.0f;
|
||||
g = (float)MSG_ReadByte( msg ) / 255.0f;
|
||||
b = (float)MSG_ReadByte( msg ) / 255.0f;
|
||||
a = (float)MSG_ReadByte( msg ) / 255.0f;
|
||||
speed = (float)(MSG_ReadByte( msg ) * 0.1f);
|
||||
R_BeamEntPoint( startEnt, end, modelIndex, life, width, noise, a, speed, startFrame, frameRate, r, g, b );
|
||||
speed = (float)MSG_ReadByte( msg ) * 0.1f;
|
||||
if( beamType == TE_BEAMENTS )
|
||||
R_BeamEnts( startEnt, endEnt, modelIndex, life, width, noise, a, speed, startFrame, frameRate, r, g, b );
|
||||
else if( beamType == TE_BEAMENTPOINT )
|
||||
R_BeamEntPoint( startEnt, end, modelIndex, life, width, noise, a, speed, startFrame, frameRate, r, g, b );
|
||||
else
|
||||
R_BeamPoints( start, end, modelIndex, life, width, noise, a, speed, startFrame, frameRate, r, g, b );
|
||||
break;
|
||||
case TE_LIGHTNING:
|
||||
start[0] = MSG_ReadCoord( msg );
|
||||
@@ -727,27 +731,11 @@ void CL_ParseViewBeam( sizebuf_t *msg, int beamType )
|
||||
end[0] = MSG_ReadCoord( msg );
|
||||
end[1] = MSG_ReadCoord( msg );
|
||||
end[2] = MSG_ReadCoord( msg );
|
||||
life = (float)(MSG_ReadByte( msg ) * 0.1f);
|
||||
width = (float)(MSG_ReadByte( msg ) * 0.1f);
|
||||
noise = (float)(MSG_ReadByte( msg ) * 0.01f);
|
||||
life = (float)MSG_ReadByte( msg ) * 0.1f;
|
||||
width = (float)MSG_ReadByte( msg ) * 0.1f;
|
||||
noise = (float)MSG_ReadByte( msg ) * 0.01f;
|
||||
modelIndex = MSG_ReadShort( msg );
|
||||
R_BeamLightning( start, end, modelIndex, life, width, noise, 0.6F, 3.5f );
|
||||
break;
|
||||
case TE_BEAMENTS:
|
||||
startEnt = MSG_ReadShort( msg );
|
||||
endEnt = MSG_ReadShort( msg );
|
||||
modelIndex = MSG_ReadShort( msg );
|
||||
startFrame = MSG_ReadByte( msg );
|
||||
frameRate = (float)(MSG_ReadByte( msg ) * 0.1f);
|
||||
life = (float)(MSG_ReadByte( msg ) * 0.1f);
|
||||
width = (float)(MSG_ReadByte( msg ) * 0.1f);
|
||||
noise = (float)(MSG_ReadByte( msg ) * 0.01f);
|
||||
r = (float)MSG_ReadByte( msg ) / 255.0f;
|
||||
g = (float)MSG_ReadByte( msg ) / 255.0f;
|
||||
b = (float)MSG_ReadByte( msg ) / 255.0f;
|
||||
a = (float)MSG_ReadByte( msg ) / 255.0f;
|
||||
speed = (float)(MSG_ReadByte( msg ) * 0.1f);
|
||||
R_BeamEnts( startEnt, endEnt, modelIndex, life, width, noise, a, speed, startFrame, frameRate, r, g, b );
|
||||
R_BeamLightning( start, end, modelIndex, life, width, noise, 0.6f, 3.5f );
|
||||
break;
|
||||
case TE_BEAM:
|
||||
break;
|
||||
@@ -773,21 +761,21 @@ void CL_ParseViewBeam( sizebuf_t *msg, int beamType )
|
||||
end[2] = MSG_ReadCoord( msg );
|
||||
modelIndex = MSG_ReadShort( msg );
|
||||
startFrame = MSG_ReadByte( msg );
|
||||
frameRate = (float)(MSG_ReadByte( msg ));
|
||||
life = (float)(MSG_ReadByte( msg ) * 0.1f);
|
||||
width = (float)(MSG_ReadByte( msg ));
|
||||
noise = (float)(MSG_ReadByte( msg ) * 0.1f);
|
||||
frameRate = (float)MSG_ReadByte( msg ) * 0.1f;
|
||||
life = (float)MSG_ReadByte( msg ) * 0.1f;
|
||||
width = (float)MSG_ReadByte( msg );
|
||||
noise = (float)MSG_ReadByte( msg ) * 0.01f;
|
||||
r = (float)MSG_ReadByte( msg ) / 255.0f;
|
||||
g = (float)MSG_ReadByte( msg ) / 255.0f;
|
||||
b = (float)MSG_ReadByte( msg ) / 255.0f;
|
||||
a = (float)MSG_ReadByte( msg ) / 255.0f;
|
||||
speed = (float)(MSG_ReadByte( msg ) / 0.1f);
|
||||
speed = (float)MSG_ReadByte( msg ) * 0.1f;
|
||||
R_BeamCirclePoints( beamType, start, end, modelIndex, life, width, noise, a, speed, startFrame, frameRate, r, g, b );
|
||||
break;
|
||||
case TE_BEAMFOLLOW:
|
||||
startEnt = MSG_ReadShort( msg );
|
||||
modelIndex = MSG_ReadShort( msg );
|
||||
life = (float)(MSG_ReadByte( msg ) * 0.1f);
|
||||
life = (float)MSG_ReadByte( msg ) * 0.1f;
|
||||
width = (float)MSG_ReadByte( msg );
|
||||
r = (float)MSG_ReadByte( msg ) / 255.0f;
|
||||
g = (float)MSG_ReadByte( msg ) / 255.0f;
|
||||
@@ -800,15 +788,15 @@ void CL_ParseViewBeam( sizebuf_t *msg, int beamType )
|
||||
endEnt = MSG_ReadShort( msg );
|
||||
modelIndex = MSG_ReadShort( msg );
|
||||
startFrame = MSG_ReadByte( msg );
|
||||
frameRate = (float)MSG_ReadByte( msg );
|
||||
life = (float)(MSG_ReadByte( msg ) * 0.1f);
|
||||
width = (float)(MSG_ReadByte( msg ) * 0.1f);
|
||||
noise = (float)(MSG_ReadByte( msg ) * 0.01f);
|
||||
frameRate = (float)MSG_ReadByte( msg ) * 0.1f;
|
||||
life = (float)MSG_ReadByte( msg ) * 0.1f;
|
||||
width = (float)MSG_ReadByte( msg ) * 0.1f;
|
||||
noise = (float)MSG_ReadByte( msg ) * 0.01f;
|
||||
r = (float)MSG_ReadByte( msg ) / 255.0f;
|
||||
g = (float)MSG_ReadByte( msg ) / 255.0f;
|
||||
b = (float)MSG_ReadByte( msg ) / 255.0f;
|
||||
a = (float)MSG_ReadByte( msg ) / 255.0f;
|
||||
speed = (float)(MSG_ReadByte( msg ) * 0.1f);
|
||||
speed = (float)MSG_ReadByte( msg ) * 0.1f;
|
||||
R_BeamRing( startEnt, endEnt, modelIndex, life, width, noise, a, speed, startFrame, frameRate, r, g, b );
|
||||
break;
|
||||
case TE_BEAMHOSE:
|
||||
@@ -828,7 +816,7 @@ R_BeamEnts
|
||||
Create beam between two ents
|
||||
==============
|
||||
*/
|
||||
BEAM *R_BeamEnts( int startEnt, int endEnt, int modelIndex, float life, float width, float amplitude, float brightness,
|
||||
BEAM * GAME_EXPORT R_BeamEnts( int startEnt, int endEnt, int modelIndex, float life, float width, float amplitude, float brightness,
|
||||
float speed, int startFrame, float framerate, float r, float g, float b )
|
||||
{
|
||||
cl_entity_t *start, *end;
|
||||
@@ -873,7 +861,7 @@ R_BeamPoints
|
||||
Create beam between two points
|
||||
==============
|
||||
*/
|
||||
BEAM *R_BeamPoints( vec3_t start, vec3_t end, int modelIndex, float life, float width, float amplitude,
|
||||
BEAM * GAME_EXPORT R_BeamPoints( vec3_t start, vec3_t end, int modelIndex, float life, float width, float amplitude,
|
||||
float brightness, float speed, int startFrame, float framerate, float r, float g, float b )
|
||||
{
|
||||
BEAM *pbeam;
|
||||
@@ -904,7 +892,7 @@ R_BeamCirclePoints
|
||||
Create beam cicrle
|
||||
==============
|
||||
*/
|
||||
BEAM *R_BeamCirclePoints( int type, vec3_t start, vec3_t end, int modelIndex, float life, float width,
|
||||
BEAM * GAME_EXPORT R_BeamCirclePoints( int type, vec3_t start, vec3_t end, int modelIndex, float life, float width,
|
||||
float amplitude, float brightness, float speed, int startFrame, float framerate, float r, float g, float b )
|
||||
{
|
||||
BEAM *pbeam = R_BeamLightning( start, end, modelIndex, life, width, amplitude, brightness, speed );
|
||||
@@ -925,7 +913,7 @@ R_BeamEntPoint
|
||||
Create beam between entity and point
|
||||
==============
|
||||
*/
|
||||
BEAM *R_BeamEntPoint( int startEnt, vec3_t end, int modelIndex, float life, float width, float amplitude,
|
||||
BEAM *GAME_EXPORT R_BeamEntPoint( int startEnt, vec3_t end, int modelIndex, float life, float width, float amplitude,
|
||||
float brightness, float speed, int startFrame, float framerate, float r, float g, float b )
|
||||
{
|
||||
BEAM *pbeam;
|
||||
@@ -965,7 +953,7 @@ R_BeamRing
|
||||
Create beam between two ents
|
||||
==============
|
||||
*/
|
||||
BEAM *R_BeamRing( int startEnt, int endEnt, int modelIndex, float life, float width, float amplitude, float brightness,
|
||||
BEAM * GAME_EXPORT R_BeamRing( int startEnt, int endEnt, int modelIndex, float life, float width, float amplitude, float brightness,
|
||||
float speed, int startFrame, float framerate, float r, float g, float b )
|
||||
{
|
||||
BEAM *pbeam;
|
||||
@@ -1001,7 +989,7 @@ R_BeamFollow
|
||||
Create beam following with entity
|
||||
==============
|
||||
*/
|
||||
BEAM *R_BeamFollow( int startEnt, int modelIndex, float life, float width, float r, float g, float b, float brightness )
|
||||
BEAM *GAME_EXPORT R_BeamFollow( int startEnt, int modelIndex, float life, float width, float r, float g, float b, float brightness )
|
||||
{
|
||||
BEAM *pbeam = R_BeamAlloc();
|
||||
|
||||
@@ -1030,7 +1018,7 @@ R_BeamLightning
|
||||
template for new beams
|
||||
==============
|
||||
*/
|
||||
BEAM *R_BeamLightning( vec3_t start, vec3_t end, int modelIndex, float life, float width, float amplitude, float brightness, float speed )
|
||||
BEAM *GAME_EXPORT R_BeamLightning( vec3_t start, vec3_t end, int modelIndex, float life, float width, float amplitude, float brightness, float speed )
|
||||
{
|
||||
BEAM *pbeam = R_BeamAlloc();
|
||||
|
||||
@@ -1054,7 +1042,7 @@ R_EntityParticles
|
||||
set EF_BRIGHTFIELD effect
|
||||
===============
|
||||
*/
|
||||
void R_EntityParticles( cl_entity_t *ent )
|
||||
void GAME_EXPORT R_EntityParticles( cl_entity_t *ent )
|
||||
{
|
||||
float angle;
|
||||
float sr, sp, sy, cr, cp, cy;
|
||||
@@ -1089,7 +1077,7 @@ R_ParticleExplosion
|
||||
|
||||
===============
|
||||
*/
|
||||
void R_ParticleExplosion( const vec3_t org )
|
||||
void GAME_EXPORT R_ParticleExplosion( const vec3_t org )
|
||||
{
|
||||
particle_t *p;
|
||||
int i, j;
|
||||
@@ -1120,7 +1108,7 @@ R_ParticleExplosion2
|
||||
|
||||
===============
|
||||
*/
|
||||
void R_ParticleExplosion2( const vec3_t org, int colorStart, int colorLength )
|
||||
void GAME_EXPORT R_ParticleExplosion2( const vec3_t org, int colorStart, int colorLength )
|
||||
{
|
||||
int i, j;
|
||||
int colorMod = 0;
|
||||
@@ -1152,7 +1140,7 @@ R_BlobExplosion
|
||||
|
||||
===============
|
||||
*/
|
||||
void R_BlobExplosion( const vec3_t org )
|
||||
void GAME_EXPORT R_BlobExplosion( const vec3_t org )
|
||||
{
|
||||
particle_t *p;
|
||||
int i, j;
|
||||
@@ -1191,7 +1179,7 @@ ParticleEffect
|
||||
PARTICLE_EFFECT on server
|
||||
===============
|
||||
*/
|
||||
void R_RunParticleEffect( const vec3_t org, const vec3_t dir, int color, int count )
|
||||
void GAME_EXPORT R_RunParticleEffect( const vec3_t org, const vec3_t dir, int color, int count )
|
||||
{
|
||||
particle_t *p;
|
||||
int i;
|
||||
@@ -1224,7 +1212,7 @@ R_Blood
|
||||
particle spray
|
||||
===============
|
||||
*/
|
||||
void R_Blood( const vec3_t org, const vec3_t ndir, int pcolor, int speed )
|
||||
void GAME_EXPORT R_Blood( const vec3_t org, const vec3_t ndir, int pcolor, int speed )
|
||||
{
|
||||
vec3_t pos, dir, vec;
|
||||
float pspeed = speed * 3.0f;
|
||||
@@ -1260,12 +1248,12 @@ R_BloodStream
|
||||
particle spray 2
|
||||
===============
|
||||
*/
|
||||
void R_BloodStream( const vec3_t org, const vec3_t dir, int pcolor, int speed )
|
||||
void GAME_EXPORT R_BloodStream( const vec3_t org, const vec3_t dir, int pcolor, int speed )
|
||||
{
|
||||
particle_t *p;
|
||||
int i, j;
|
||||
float arc;
|
||||
float accel = speed;
|
||||
int accel = speed; // must be integer due to bug in GoldSrc
|
||||
|
||||
for( arc = 0.05f, i = 0; i < 100; i++ )
|
||||
{
|
||||
@@ -1337,7 +1325,7 @@ R_LavaSplash
|
||||
|
||||
===============
|
||||
*/
|
||||
void R_LavaSplash( const vec3_t org )
|
||||
void GAME_EXPORT R_LavaSplash( const vec3_t org )
|
||||
{
|
||||
particle_t *p;
|
||||
float vel;
|
||||
@@ -1379,7 +1367,7 @@ R_ParticleBurst
|
||||
|
||||
===============
|
||||
*/
|
||||
void R_ParticleBurst( const vec3_t org, int size, int color, float life )
|
||||
void GAME_EXPORT R_ParticleBurst( const vec3_t org, int size, int color, float life )
|
||||
{
|
||||
particle_t *p;
|
||||
vec3_t dir, dest;
|
||||
@@ -1412,7 +1400,7 @@ R_LargeFunnel
|
||||
|
||||
===============
|
||||
*/
|
||||
void R_LargeFunnel( const vec3_t org, int reverse )
|
||||
void GAME_EXPORT R_LargeFunnel( const vec3_t org, int reverse )
|
||||
{
|
||||
particle_t *p;
|
||||
float vel, dist;
|
||||
@@ -1459,7 +1447,7 @@ R_TeleportSplash
|
||||
|
||||
===============
|
||||
*/
|
||||
void R_TeleportSplash( const vec3_t org )
|
||||
void GAME_EXPORT R_TeleportSplash( const vec3_t org )
|
||||
{
|
||||
particle_t *p;
|
||||
vec3_t dir;
|
||||
@@ -1501,7 +1489,7 @@ R_RocketTrail
|
||||
|
||||
===============
|
||||
*/
|
||||
void R_RocketTrail( vec3_t start, vec3_t end, int type )
|
||||
void GAME_EXPORT R_RocketTrail( vec3_t start, vec3_t end, int type )
|
||||
{
|
||||
vec3_t vec, right, up;
|
||||
static int tracercount;
|
||||
@@ -1620,7 +1608,7 @@ R_ParticleLine
|
||||
|
||||
================
|
||||
*/
|
||||
void R_ParticleLine( const vec3_t start, const vec3_t end, byte r, byte g, byte b, float life )
|
||||
void GAME_EXPORT R_ParticleLine( const vec3_t start, const vec3_t end, byte r, byte g, byte b, float life )
|
||||
{
|
||||
int pcolor;
|
||||
|
||||
@@ -1634,7 +1622,7 @@ R_ParticleBox
|
||||
|
||||
================
|
||||
*/
|
||||
void R_ParticleBox( const vec3_t absmin, const vec3_t absmax, byte r, byte g, byte b, float life )
|
||||
void GAME_EXPORT R_ParticleBox( const vec3_t absmin, const vec3_t absmax, byte r, byte g, byte b, float life )
|
||||
{
|
||||
vec3_t mins, maxs;
|
||||
vec3_t origin;
|
||||
@@ -1655,7 +1643,7 @@ R_ShowLine
|
||||
|
||||
================
|
||||
*/
|
||||
void R_ShowLine( const vec3_t start, const vec3_t end )
|
||||
void GAME_EXPORT R_ShowLine( const vec3_t start, const vec3_t end )
|
||||
{
|
||||
vec3_t dir, org;
|
||||
float len;
|
||||
@@ -1687,7 +1675,7 @@ R_BulletImpactParticles
|
||||
|
||||
===============
|
||||
*/
|
||||
void R_BulletImpactParticles( const vec3_t pos )
|
||||
void GAME_EXPORT R_BulletImpactParticles( const vec3_t pos )
|
||||
{
|
||||
int i, quantity;
|
||||
int color;
|
||||
@@ -1729,7 +1717,7 @@ R_FlickerParticles
|
||||
|
||||
===============
|
||||
*/
|
||||
void R_FlickerParticles( const vec3_t org )
|
||||
void GAME_EXPORT R_FlickerParticles( const vec3_t org )
|
||||
{
|
||||
particle_t *p;
|
||||
int i;
|
||||
@@ -1757,7 +1745,7 @@ R_StreakSplash
|
||||
create a splash of streaks
|
||||
===============
|
||||
*/
|
||||
void R_StreakSplash( const vec3_t pos, const vec3_t dir, int color, int count, float speed, int velocityMin, int velocityMax )
|
||||
void GAME_EXPORT R_StreakSplash( const vec3_t pos, const vec3_t dir, int color, int count, float speed, int velocityMin, int velocityMax )
|
||||
{
|
||||
vec3_t vel, vel2;
|
||||
particle_t *p;
|
||||
@@ -1822,7 +1810,7 @@ R_TracerEffect
|
||||
|
||||
===============
|
||||
*/
|
||||
void R_TracerEffect( const vec3_t start, const vec3_t end )
|
||||
void GAME_EXPORT R_TracerEffect( const vec3_t start, const vec3_t end )
|
||||
{
|
||||
vec3_t pos, vel, dir;
|
||||
float len, speed;
|
||||
@@ -1849,7 +1837,7 @@ R_UserTracerParticle
|
||||
|
||||
===============
|
||||
*/
|
||||
void R_UserTracerParticle( float *org, float *vel, float life, int colorIndex, float length, byte deathcontext, void (*deathfunc)( particle_t *p ))
|
||||
void GAME_EXPORT R_UserTracerParticle( float *org, float *vel, float life, int colorIndex, float length, byte deathcontext, void (*deathfunc)( particle_t *p ))
|
||||
{
|
||||
particle_t *p;
|
||||
|
||||
@@ -1884,7 +1872,7 @@ R_SparkStreaks
|
||||
create a streak tracers
|
||||
===============
|
||||
*/
|
||||
void R_SparkStreaks( const vec3_t pos, int count, int velocityMin, int velocityMax )
|
||||
void GAME_EXPORT R_SparkStreaks( const vec3_t pos, int count, int velocityMin, int velocityMax )
|
||||
{
|
||||
particle_t *p;
|
||||
vec3_t vel;
|
||||
@@ -1912,7 +1900,7 @@ R_Implosion
|
||||
make implosion tracers
|
||||
===============
|
||||
*/
|
||||
void R_Implosion( const vec3_t end, float radius, int count, float life )
|
||||
void GAME_EXPORT R_Implosion( const vec3_t end, float radius, int count, float life )
|
||||
{
|
||||
float dist = ( radius / 100.0f );
|
||||
vec3_t start, temp, vel;
|
||||
@@ -2020,15 +2008,15 @@ void CL_ReadPointFile_f( void )
|
||||
|
||||
while( 1 )
|
||||
{
|
||||
pfile = COM_ParseFile( pfile, token );
|
||||
pfile = COM_ParseFile( pfile, token, sizeof( token ));
|
||||
if( !pfile ) break;
|
||||
org[0] = Q_atof( token );
|
||||
|
||||
pfile = COM_ParseFile( pfile, token );
|
||||
pfile = COM_ParseFile( pfile, token, sizeof( token ));
|
||||
if( !pfile ) break;
|
||||
org[1] = Q_atof( token );
|
||||
|
||||
pfile = COM_ParseFile( pfile, token );
|
||||
pfile = COM_ParseFile( pfile, token, sizeof( token ));
|
||||
if( !pfile ) break;
|
||||
org[2] = Q_atof( token );
|
||||
|
||||
@@ -2152,6 +2140,7 @@ void CL_ThinkParticle( double frametime, particle_t *p )
|
||||
p->vel[2] -= grav;
|
||||
break;
|
||||
}
|
||||
// intentionally fallthrough
|
||||
case pt_blob2:
|
||||
if( p->packedColor == 255 )
|
||||
{
|
||||
|
||||
@@ -78,23 +78,48 @@ CL_DescribeEvent
|
||||
|
||||
=============
|
||||
*/
|
||||
void CL_DescribeEvent( int slot, int flags, const char *eventname )
|
||||
void CL_DescribeEvent( event_info_t *ei, int slot )
|
||||
{
|
||||
int idx = (slot & 31);
|
||||
int idx = (slot & 63) * 2;
|
||||
con_nprint_t info;
|
||||
string origin_str = { 0 }; //, angles_str = { 0 };
|
||||
|
||||
if( !eventname || !cl_showevents->value )
|
||||
if( !cl_showevents->value )
|
||||
return;
|
||||
|
||||
// mark reliable as green and unreliable as red
|
||||
if( FBitSet( flags, FEV_RELIABLE ))
|
||||
VectorSet( info.color, 0.0f, 1.0f, 0.0f );
|
||||
else VectorSet( info.color, 1.0f, 0.0f, 0.0f );
|
||||
|
||||
info.time_to_live = 0.5f;
|
||||
info.time_to_live = 1.0f;
|
||||
info.index = idx;
|
||||
|
||||
Con_NXPrintf( &info, "%i %f %s", slot, cl.time, eventname );
|
||||
// mark reliable as green and unreliable as red
|
||||
if( FBitSet( ei->flags, FEV_RELIABLE ))
|
||||
VectorSet( info.color, 0.5f, 1.0f, 0.5f );
|
||||
else VectorSet( info.color, 1.0f, 0.5f, 0.5f );
|
||||
|
||||
if( !VectorIsNull( ei->args.origin ))
|
||||
{
|
||||
Q_snprintf( origin_str, sizeof( origin_str ), "(%.2f,%.2f,%.2f)",
|
||||
ei->args.origin[0], ei->args.origin[1], ei->args.origin[2]);
|
||||
}
|
||||
|
||||
/*if( !VectorIsNull( ei->args.angles ))
|
||||
{
|
||||
Q_snprintf( angles_str, sizeof( angles_str ), "ang %.2f %.2f %.2f",
|
||||
ei->args.angles[0], ei->args.angles[1], ei->args.angles[2]);
|
||||
}*/
|
||||
|
||||
Con_NXPrintf( &info, "%i %.2f %c %s %s",
|
||||
slot, cl.time,
|
||||
(FBitSet( ei->flags, FEV_CLIENT ) ? 'c' :
|
||||
FBitSet( ei->flags, FEV_SERVER ) ? 's' : '?'),
|
||||
cl.event_precache[ei->index],
|
||||
origin_str);
|
||||
|
||||
info.index++;
|
||||
|
||||
Con_NXPrintf( &info, "b(%i,%i) i(%i,%i) f(%.2f,%.2f)",
|
||||
ei->args.bparam1, ei->args.bparam2,
|
||||
ei->args.iparam1, ei->args.iparam2,
|
||||
ei->args.fparam1, ei->args.fparam2);
|
||||
}
|
||||
|
||||
/*
|
||||
@@ -133,8 +158,8 @@ CL_EventIndex
|
||||
*/
|
||||
word CL_EventIndex( const char *name )
|
||||
{
|
||||
int i;
|
||||
|
||||
word i;
|
||||
|
||||
if( !COM_CheckString( name ))
|
||||
return 0;
|
||||
|
||||
@@ -189,7 +214,7 @@ qboolean CL_FireEvent( event_info_t *ei, int slot )
|
||||
// get the func pointer
|
||||
for( i = 0; i < MAX_EVENTS; i++ )
|
||||
{
|
||||
ev = clgame.events[i];
|
||||
ev = clgame.events[i];
|
||||
|
||||
if( !ev )
|
||||
{
|
||||
@@ -202,14 +227,14 @@ qboolean CL_FireEvent( event_info_t *ei, int slot )
|
||||
{
|
||||
if( ev->func )
|
||||
{
|
||||
CL_DescribeEvent( slot, ei->flags, cl.event_precache[ei->index] );
|
||||
CL_DescribeEvent( ei, slot );
|
||||
ev->func( &ei->args );
|
||||
return true;
|
||||
}
|
||||
|
||||
name = cl.event_precache[ei->index];
|
||||
Con_Reportf( S_ERROR "CL_FireEvent: %s not hooked\n", name );
|
||||
break;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -437,7 +462,7 @@ void CL_ParseEvent( sizebuf_t *msg )
|
||||
args.angles[PITCH] /= -3.0f;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// Place event on queue
|
||||
CL_QueueEvent( FEV_SERVER, event_index, delay, &args );
|
||||
}
|
||||
@@ -450,7 +475,7 @@ CL_PlaybackEvent
|
||||
|
||||
=============
|
||||
*/
|
||||
void CL_PlaybackEvent( int flags, const edict_t *pInvoker, word eventindex, float delay, float *origin,
|
||||
void GAME_EXPORT CL_PlaybackEvent( int flags, const edict_t *pInvoker, word eventindex, float delay, float *origin,
|
||||
float *angles, float fparam1, float fparam2, int iparam1, int iparam2, int bparam1, int bparam2 )
|
||||
{
|
||||
event_args_t args;
|
||||
@@ -459,7 +484,7 @@ void CL_PlaybackEvent( int flags, const edict_t *pInvoker, word eventindex, floa
|
||||
return;
|
||||
|
||||
// first check event for out of bounds
|
||||
if( eventindex < 1 || eventindex > MAX_EVENTS )
|
||||
if( eventindex < 1 || eventindex >= MAX_EVENTS )
|
||||
{
|
||||
Con_DPrintf( S_ERROR "CL_PlaybackEvent: invalid eventindex %i\n", eventindex );
|
||||
return;
|
||||
@@ -469,7 +494,7 @@ void CL_PlaybackEvent( int flags, const edict_t *pInvoker, word eventindex, floa
|
||||
if( !CL_EventIndex( cl.event_precache[eventindex] ))
|
||||
{
|
||||
Con_DPrintf( S_ERROR "CL_PlaybackEvent: event %i was not precached\n", eventindex );
|
||||
return;
|
||||
return;
|
||||
}
|
||||
|
||||
SetBits( flags, FEV_CLIENT ); // it's a client event
|
||||
|
||||
@@ -58,10 +58,13 @@ void CL_UpdatePositions( cl_entity_t *ent )
|
||||
|
||||
ent->current_position = (ent->current_position + 1) & HISTORY_MASK;
|
||||
ph = &ent->ph[ent->current_position];
|
||||
|
||||
VectorCopy( ent->curstate.origin, ph->origin );
|
||||
VectorCopy( ent->curstate.angles, ph->angles );
|
||||
ph->animtime = ent->curstate.animtime; // !!!
|
||||
|
||||
if( ent->model && ent->model->type == mod_brush )
|
||||
ph->animtime = ent->curstate.animtime;
|
||||
else
|
||||
ph->animtime = cl.time;
|
||||
}
|
||||
|
||||
/*
|
||||
@@ -131,6 +134,9 @@ some ents will be ignore lerping
|
||||
*/
|
||||
qboolean CL_EntityIgnoreLerp( cl_entity_t *e )
|
||||
{
|
||||
if( cl_nointerp->value > 0.f )
|
||||
return true;
|
||||
|
||||
if( e->model && e->model->type == mod_alias )
|
||||
return false;
|
||||
|
||||
@@ -216,7 +222,7 @@ void CL_UpdateLatchedVars( cl_entity_t *ent )
|
||||
|
||||
if( ent->curstate.sequence != ent->prevstate.sequence )
|
||||
{
|
||||
memcpy( ent->prevstate.blending, ent->latched.prevseqblending, sizeof( ent->prevstate.blending ));
|
||||
memcpy( ent->latched.prevseqblending, ent->prevstate.blending, sizeof( ent->latched.prevseqblending ));
|
||||
ent->latched.prevsequence = ent->prevstate.sequence;
|
||||
ent->latched.sequencetime = ent->curstate.animtime;
|
||||
}
|
||||
@@ -307,7 +313,7 @@ void CL_ProcessEntityUpdate( cl_entity_t *ent )
|
||||
if( FBitSet( ent->curstate.entityType, ENTITY_NORMAL ))
|
||||
COM_NormalizeAngles( ent->curstate.angles );
|
||||
|
||||
parametric = CL_ParametricMove( ent );
|
||||
parametric = ent->curstate.starttime != 0.0f && ent->curstate.impacttime != 0.0f;
|
||||
|
||||
// allow interpolation on bmodels too
|
||||
if( ent->model && ent->model->type == mod_brush )
|
||||
@@ -323,7 +329,7 @@ void CL_ProcessEntityUpdate( cl_entity_t *ent )
|
||||
}
|
||||
|
||||
// g-cont. it should be done for all the players?
|
||||
if( ent->player && !FBitSet( host.features, ENGINE_COMPUTE_STUDIO_LERP ))
|
||||
if( ent->player && !FBitSet( host.features, ENGINE_COMPUTE_STUDIO_LERP ))
|
||||
ent->curstate.angles[PITCH] /= -3.0f;
|
||||
|
||||
VectorCopy( ent->curstate.origin, ent->origin );
|
||||
@@ -346,7 +352,7 @@ find two timestamps
|
||||
qboolean CL_FindInterpolationUpdates( cl_entity_t *ent, float targettime, position_history_t **ph0, position_history_t **ph1 )
|
||||
{
|
||||
qboolean extrapolate = true;
|
||||
int i, i0, i1, imod;
|
||||
uint i, i0, i1, imod;
|
||||
float at;
|
||||
|
||||
imod = ent->current_position;
|
||||
@@ -403,7 +409,7 @@ void CL_PureOrigin( cl_entity_t *ent, float t, vec3_t outorigin, vec3_t outangle
|
||||
|
||||
VectorSubtract( ph0->origin, ph1->origin, delta );
|
||||
|
||||
if( t0 != t1 )
|
||||
if( !Q_equal( t0, t1 ))
|
||||
frac = ( t - t1 ) / ( t0 - t1 );
|
||||
else frac = 1.0f;
|
||||
|
||||
@@ -483,7 +489,9 @@ int CL_InterpolateModel( cl_entity_t *e )
|
||||
return 0;
|
||||
}
|
||||
|
||||
if( t2 == t1 )
|
||||
// HACKHACK: workaround buggy position history animtime
|
||||
// going backward sometimes
|
||||
if( Q_equal( t2, t1 ) || t2 < t1 )
|
||||
{
|
||||
VectorCopy( ph0->origin, e->origin );
|
||||
VectorCopy( ph0->angles, e->angles );
|
||||
@@ -529,6 +537,13 @@ void CL_ComputePlayerOrigin( cl_entity_t *ent )
|
||||
if( !ent->player || ent->index == ( cl.playernum + 1 ))
|
||||
return;
|
||||
|
||||
if( cl_nointerp->value > 0.f )
|
||||
{
|
||||
VectorCopy( ent->curstate.angles, ent->angles );
|
||||
VectorCopy( ent->curstate.origin, ent->origin );
|
||||
return;
|
||||
}
|
||||
|
||||
if( cls.demoplayback == DEMO_QUAKE1 )
|
||||
{
|
||||
// quake lerping is easy
|
||||
@@ -782,7 +797,7 @@ int CL_ParsePacketEntities( sizebuf_t *msg, qboolean delta )
|
||||
}
|
||||
|
||||
if( subtracted >= CL_UPDATE_MASK )
|
||||
{
|
||||
{
|
||||
// we can't use this, it is too old
|
||||
Con_NPrintf( 2, "^3Warning:^1 delta frame is too old^7\n" );
|
||||
CL_FlushEntityPacket( msg );
|
||||
@@ -850,7 +865,7 @@ int CL_ParsePacketEntities( sizebuf_t *msg, qboolean delta )
|
||||
player = CL_IsPlayerIndex( newnum );
|
||||
|
||||
while( oldnum < newnum )
|
||||
{
|
||||
{
|
||||
// one or more entities from the old packet are unchanged
|
||||
CL_DeltaEntity( msg, newframe, oldnum, oldent, false );
|
||||
oldindex++;
|
||||
@@ -867,7 +882,7 @@ int CL_ParsePacketEntities( sizebuf_t *msg, qboolean delta )
|
||||
}
|
||||
|
||||
if( oldnum == newnum )
|
||||
{
|
||||
{
|
||||
// delta from previous state
|
||||
bufStart = MSG_GetNumBytesRead( msg );
|
||||
CL_DeltaEntity( msg, newframe, newnum, oldent, true );
|
||||
@@ -887,7 +902,7 @@ int CL_ParsePacketEntities( sizebuf_t *msg, qboolean delta )
|
||||
}
|
||||
|
||||
if( oldnum > newnum )
|
||||
{
|
||||
{
|
||||
// delta from baseline ?
|
||||
bufStart = MSG_GetNumBytesRead( msg );
|
||||
CL_DeltaEntity( msg, newframe, newnum, NULL, true );
|
||||
@@ -898,7 +913,7 @@ int CL_ParsePacketEntities( sizebuf_t *msg, qboolean delta )
|
||||
|
||||
// any remaining entities in the old frame are copied over
|
||||
while( oldnum != MAX_ENTNUMBER )
|
||||
{
|
||||
{
|
||||
// one or more entities from the old packet are unchanged
|
||||
CL_DeltaEntity( msg, newframe, oldnum, oldent, false );
|
||||
oldindex++;
|
||||
@@ -928,10 +943,10 @@ int CL_ParsePacketEntities( sizebuf_t *msg, qboolean delta )
|
||||
|
||||
// first update is the final signon stage where we actually receive an entity (i.e., the world at least)
|
||||
if( cls.signon == ( SIGNONS - 1 ))
|
||||
{
|
||||
{
|
||||
// we are done with signon sequence.
|
||||
cls.signon = SIGNONS;
|
||||
|
||||
|
||||
// Clear loading plaque.
|
||||
CL_SignonReply ();
|
||||
}
|
||||
@@ -968,8 +983,13 @@ qboolean CL_AddVisibleEntity( cl_entity_t *ent, int entityType )
|
||||
}
|
||||
|
||||
// don't add the player in firstperson mode
|
||||
if( RP_LOCALCLIENT( ent ) && !CL_IsThirdPerson( ) && ( ent->index == cl.viewentity ))
|
||||
return false;
|
||||
if( RP_LOCALCLIENT( ent ))
|
||||
{
|
||||
cl.local.apply_effects = true;
|
||||
|
||||
if( !CL_IsThirdPerson( ) && ( ent->index == cl.viewentity ))
|
||||
return false;
|
||||
}
|
||||
|
||||
if( entityType == ET_BEAM )
|
||||
{
|
||||
@@ -983,12 +1003,8 @@ qboolean CL_AddVisibleEntity( cl_entity_t *ent, int entityType )
|
||||
|
||||
// because pTemp->entity.curstate.effects
|
||||
// is already occupied by FTENT_FLICKER
|
||||
if( entityType != ET_TEMPENTITY )
|
||||
if( entityType != ET_TEMPENTITY && !RP_LOCALCLIENT( ent ) )
|
||||
{
|
||||
// no reason to do it twice
|
||||
if( RP_LOCALCLIENT( ent ))
|
||||
cl.local.apply_effects = false;
|
||||
|
||||
// apply client-side effects
|
||||
CL_AddEntityEffects( ent );
|
||||
|
||||
@@ -1040,7 +1056,6 @@ void CL_LinkPlayers( frame_t *frame )
|
||||
// apply muzzleflash to weaponmodel
|
||||
if( ent && FBitSet( ent->curstate.effects, EF_MUZZLEFLASH ))
|
||||
SetBits( clgame.viewent.curstate.effects, EF_MUZZLEFLASH );
|
||||
cl.local.apply_effects = true;
|
||||
|
||||
// check all the clients but add only visible
|
||||
for( i = 0, state = frame->playerstate; i < MAX_CLIENTS; i++, state++ )
|
||||
@@ -1224,7 +1239,7 @@ void CL_LinkPacketEntities( frame_t *frame )
|
||||
|
||||
if( ent->model->type == mod_studio )
|
||||
{
|
||||
if( interpolate && FBitSet( host.features, ENGINE_COMPUTE_STUDIO_LERP ))
|
||||
if( interpolate && FBitSet( host.features, ENGINE_COMPUTE_STUDIO_LERP ))
|
||||
ref.dllFuncs.R_StudioLerpMovement( ent, cl.time, ent->origin, ent->angles );
|
||||
}
|
||||
}
|
||||
@@ -1368,17 +1383,19 @@ qboolean CL_GetEntitySpatialization( channel_t *ch )
|
||||
ent = CL_GetEntityByIndex( ch->entnum );
|
||||
|
||||
// entity is not present on the client but has valid origin
|
||||
if( !ent || !ent->index || ent->curstate.messagenum == 0 )
|
||||
if( !ent || !ent->model || ent->curstate.messagenum != cl.parsecount )
|
||||
return valid_origin;
|
||||
|
||||
#if 0
|
||||
// uncomment this if you want enable additional check by PVS
|
||||
if( ent->curstate.messagenum != cl.parsecount )
|
||||
return valid_origin;
|
||||
#endif
|
||||
// setup origin
|
||||
VectorAverage( ent->curstate.mins, ent->curstate.maxs, ch->origin );
|
||||
VectorAdd( ch->origin, ent->curstate.origin, ch->origin );
|
||||
if( ent->model->type == mod_brush )
|
||||
{
|
||||
VectorAverage( ent->model->mins, ent->model->maxs, ch->origin );
|
||||
VectorAdd( ent->origin, ch->origin, ch->origin );
|
||||
}
|
||||
else
|
||||
{
|
||||
VectorCopy( ent->origin, ch->origin );
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
@@ -1396,12 +1413,15 @@ qboolean CL_GetMovieSpatialization( rawchan_t *ch )
|
||||
return valid_origin;
|
||||
|
||||
// setup origin
|
||||
VectorAverage( ent->curstate.mins, ent->curstate.maxs, ch->origin );
|
||||
VectorAdd( ch->origin, ent->curstate.origin, ch->origin );
|
||||
|
||||
// setup radius
|
||||
if( ent->model != NULL && ent->model->radius ) ch->radius = ent->model->radius;
|
||||
else ch->radius = RadiusFromBounds( ent->curstate.mins, ent->curstate.maxs );
|
||||
if( ent->model->type == mod_brush )
|
||||
{
|
||||
VectorAverage( ent->model->mins, ent->model->maxs, ch->origin );
|
||||
VectorAdd( ent->origin, ch->origin, ch->origin );
|
||||
}
|
||||
else
|
||||
{
|
||||
VectorCopy( ent->origin, ch->origin );
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -290,7 +290,7 @@ void UI_ConnectionProgress_ParseServerInfo( const char *server )
|
||||
}
|
||||
}
|
||||
|
||||
static void UI_DrawLogo( const char *filename, float x, float y, float width, float height )
|
||||
static void GAME_EXPORT UI_DrawLogo( const char *filename, float x, float y, float width, float height )
|
||||
{
|
||||
static float cin_time;
|
||||
static int last_frame = -1;
|
||||
@@ -306,7 +306,7 @@ static void UI_DrawLogo( const char *filename, float x, float y, float width, fl
|
||||
{
|
||||
string path;
|
||||
const char *fullpath;
|
||||
|
||||
|
||||
// run cinematic if not
|
||||
Q_snprintf( path, sizeof( path ), "media/%s", filename );
|
||||
COM_DefaultExtension( path, ".avi" );
|
||||
@@ -359,17 +359,17 @@ static void UI_DrawLogo( const char *filename, float x, float y, float width, fl
|
||||
ref.dllFuncs.R_DrawStretchRaw( x, y, width, height, gameui.logo_xres, gameui.logo_yres, cin_data, redraw );
|
||||
}
|
||||
|
||||
static int UI_GetLogoWidth( void )
|
||||
static int GAME_EXPORT UI_GetLogoWidth( void )
|
||||
{
|
||||
return gameui.logo_xres;
|
||||
}
|
||||
|
||||
static int UI_GetLogoHeight( void )
|
||||
static int GAME_EXPORT UI_GetLogoHeight( void )
|
||||
{
|
||||
return gameui.logo_yres;
|
||||
}
|
||||
|
||||
static float UI_GetLogoLength( void )
|
||||
static float GAME_EXPORT UI_GetLogoLength( void )
|
||||
{
|
||||
return gameui.logo_length;
|
||||
}
|
||||
@@ -390,7 +390,7 @@ static void UI_UpdateUserinfo( void )
|
||||
player->bottomcolor = Q_atoi( Info_ValueForKey( player->userinfo, "bottomcolor" ));
|
||||
host.userinfo_changed = false; // we got it
|
||||
}
|
||||
|
||||
|
||||
void Host_Credits( void )
|
||||
{
|
||||
if( !gameui.hInstance ) return;
|
||||
@@ -403,7 +403,7 @@ static void UI_ConvertGameInfo( GAMEINFO *out, gameinfo_t *in )
|
||||
Q_strncpy( out->startmap, in->startmap, sizeof( out->startmap ));
|
||||
Q_strncpy( out->trainmap, in->trainmap, sizeof( out->trainmap ));
|
||||
Q_strncpy( out->title, in->title, sizeof( out->title ));
|
||||
Q_strncpy( out->version, va( "%g", in->version ), sizeof( out->version ));
|
||||
Q_snprintf( out->version, sizeof( out->version ), "%g", in->version );
|
||||
|
||||
Q_strncpy( out->game_url, in->game_url, sizeof( out->game_url ));
|
||||
Q_strncpy( out->update_url, in->update_url, sizeof( out->update_url ));
|
||||
@@ -417,6 +417,8 @@ static void UI_ConvertGameInfo( GAMEINFO *out, gameinfo_t *in )
|
||||
out->flags |= GFL_NOMODELS;
|
||||
if( in->noskills )
|
||||
out->flags |= GFL_NOSKILLS;
|
||||
if( in->render_picbutton_text )
|
||||
out->flags |= GFL_RENDER_PICBUTTON_TEXT;
|
||||
}
|
||||
|
||||
static qboolean PIC_Scissor( float *x, float *y, float *width, float *height, float *u0, float *v0, float *u1, float *v1 )
|
||||
@@ -529,7 +531,7 @@ pfnPIC_Load
|
||||
|
||||
=========
|
||||
*/
|
||||
static HIMAGE pfnPIC_Load( const char *szPicName, const byte *image_buf, int image_size, int flags )
|
||||
static HIMAGE GAME_EXPORT pfnPIC_Load( const char *szPicName, const byte *image_buf, int image_size, int flags )
|
||||
{
|
||||
HIMAGE tx;
|
||||
|
||||
@@ -555,7 +557,7 @@ pfnPIC_Width
|
||||
|
||||
=========
|
||||
*/
|
||||
static int pfnPIC_Width( HIMAGE hPic )
|
||||
static int GAME_EXPORT pfnPIC_Width( HIMAGE hPic )
|
||||
{
|
||||
int picWidth;
|
||||
|
||||
@@ -570,7 +572,7 @@ pfnPIC_Height
|
||||
|
||||
=========
|
||||
*/
|
||||
static int pfnPIC_Height( HIMAGE hPic )
|
||||
static int GAME_EXPORT pfnPIC_Height( HIMAGE hPic )
|
||||
{
|
||||
int picHeight;
|
||||
|
||||
@@ -585,7 +587,7 @@ pfnPIC_Set
|
||||
|
||||
=========
|
||||
*/
|
||||
void pfnPIC_Set( HIMAGE hPic, int r, int g, int b, int a )
|
||||
void GAME_EXPORT pfnPIC_Set( HIMAGE hPic, int r, int g, int b, int a )
|
||||
{
|
||||
gameui.ds.gl_texturenum = hPic;
|
||||
r = bound( 0, r, 255 );
|
||||
@@ -601,7 +603,7 @@ pfnPIC_Draw
|
||||
|
||||
=========
|
||||
*/
|
||||
void pfnPIC_Draw( int x, int y, int width, int height, const wrect_t *prc )
|
||||
void GAME_EXPORT pfnPIC_Draw( int x, int y, int width, int height, const wrect_t *prc )
|
||||
{
|
||||
ref.dllFuncs.GL_SetRenderMode( kRenderNormal );
|
||||
PIC_DrawGeneric( x, y, width, height, prc );
|
||||
@@ -613,7 +615,7 @@ pfnPIC_DrawTrans
|
||||
|
||||
=========
|
||||
*/
|
||||
void pfnPIC_DrawTrans( int x, int y, int width, int height, const wrect_t *prc )
|
||||
void GAME_EXPORT pfnPIC_DrawTrans( int x, int y, int width, int height, const wrect_t *prc )
|
||||
{
|
||||
ref.dllFuncs.GL_SetRenderMode( kRenderTransTexture );
|
||||
PIC_DrawGeneric( x, y, width, height, prc );
|
||||
@@ -625,7 +627,7 @@ pfnPIC_DrawHoles
|
||||
|
||||
=========
|
||||
*/
|
||||
void pfnPIC_DrawHoles( int x, int y, int width, int height, const wrect_t *prc )
|
||||
void GAME_EXPORT pfnPIC_DrawHoles( int x, int y, int width, int height, const wrect_t *prc )
|
||||
{
|
||||
ref.dllFuncs.GL_SetRenderMode( kRenderTransAlpha );
|
||||
PIC_DrawGeneric( x, y, width, height, prc );
|
||||
@@ -637,7 +639,7 @@ pfnPIC_DrawAdditive
|
||||
|
||||
=========
|
||||
*/
|
||||
void pfnPIC_DrawAdditive( int x, int y, int width, int height, const wrect_t *prc )
|
||||
void GAME_EXPORT pfnPIC_DrawAdditive( int x, int y, int width, int height, const wrect_t *prc )
|
||||
{
|
||||
ref.dllFuncs.GL_SetRenderMode( kRenderTransAdd );
|
||||
PIC_DrawGeneric( x, y, width, height, prc );
|
||||
@@ -649,7 +651,7 @@ pfnPIC_EnableScissor
|
||||
|
||||
=========
|
||||
*/
|
||||
static void pfnPIC_EnableScissor( int x, int y, int width, int height )
|
||||
static void GAME_EXPORT pfnPIC_EnableScissor( int x, int y, int width, int height )
|
||||
{
|
||||
// check bounds
|
||||
x = bound( 0, x, gameui.globals->scrWidth );
|
||||
@@ -670,7 +672,7 @@ pfnPIC_DisableScissor
|
||||
|
||||
=========
|
||||
*/
|
||||
static void pfnPIC_DisableScissor( void )
|
||||
static void GAME_EXPORT pfnPIC_DisableScissor( void )
|
||||
{
|
||||
gameui.ds.scissor_x = 0;
|
||||
gameui.ds.scissor_width = 0;
|
||||
@@ -685,7 +687,7 @@ pfnFillRGBA
|
||||
|
||||
=============
|
||||
*/
|
||||
static void pfnFillRGBA( int x, int y, int width, int height, int r, int g, int b, int a )
|
||||
static void GAME_EXPORT pfnFillRGBA( int x, int y, int width, int height, int r, int g, int b, int a )
|
||||
{
|
||||
r = bound( 0, r, 255 );
|
||||
g = bound( 0, g, 255 );
|
||||
@@ -703,7 +705,7 @@ pfnClientCmd
|
||||
|
||||
=============
|
||||
*/
|
||||
static void pfnClientCmd( int exec_now, const char *szCmdString )
|
||||
static void GAME_EXPORT pfnClientCmd( int exec_now, const char *szCmdString )
|
||||
{
|
||||
if( !szCmdString || !szCmdString[0] )
|
||||
return;
|
||||
@@ -721,7 +723,7 @@ pfnPlaySound
|
||||
|
||||
=============
|
||||
*/
|
||||
static void pfnPlaySound( const char *szSound )
|
||||
static void GAME_EXPORT pfnPlaySound( const char *szSound )
|
||||
{
|
||||
if( !COM_CheckString( szSound )) return;
|
||||
S_StartLocalSound( szSound, VOL_NORM, false );
|
||||
@@ -734,7 +736,7 @@ pfnDrawCharacter
|
||||
quakefont draw character
|
||||
=============
|
||||
*/
|
||||
static void pfnDrawCharacter( int ix, int iy, int iwidth, int iheight, int ch, int ulRGBA, HIMAGE hFont )
|
||||
static void GAME_EXPORT pfnDrawCharacter( int ix, int iy, int iwidth, int iheight, int ch, int ulRGBA, HIMAGE hFont )
|
||||
{
|
||||
rgba_t color;
|
||||
float row, col, size;
|
||||
@@ -776,10 +778,10 @@ static void pfnDrawCharacter( int ix, int iy, int iwidth, int iheight, int ch, i
|
||||
=============
|
||||
UI_DrawConsoleString
|
||||
|
||||
drawing string like a console string
|
||||
drawing string like a console string
|
||||
=============
|
||||
*/
|
||||
static int UI_DrawConsoleString( int x, int y, const char *string )
|
||||
static int GAME_EXPORT UI_DrawConsoleString( int x, int y, const char *string )
|
||||
{
|
||||
int drawLen;
|
||||
|
||||
@@ -797,7 +799,7 @@ pfnDrawSetTextColor
|
||||
set color for anything
|
||||
=============
|
||||
*/
|
||||
static void UI_DrawSetTextColor( int r, int g, int b, int alpha )
|
||||
static void GAME_EXPORT UI_DrawSetTextColor( int r, int g, int b, int alpha )
|
||||
{
|
||||
// bound color and convert to byte
|
||||
gameui.ds.textColor[0] = r;
|
||||
@@ -813,7 +815,7 @@ pfnGetPlayerModel
|
||||
for drawing playermodel previews
|
||||
====================
|
||||
*/
|
||||
static cl_entity_t* pfnGetPlayerModel( void )
|
||||
static cl_entity_t* GAME_EXPORT pfnGetPlayerModel( void )
|
||||
{
|
||||
return &gameui.playermodel;
|
||||
}
|
||||
@@ -825,7 +827,7 @@ pfnSetPlayerModel
|
||||
for drawing playermodel previews
|
||||
====================
|
||||
*/
|
||||
static void pfnSetPlayerModel( cl_entity_t *ent, const char *path )
|
||||
static void GAME_EXPORT pfnSetPlayerModel( cl_entity_t *ent, const char *path )
|
||||
{
|
||||
ent->model = Mod_ForName( path, false, false );
|
||||
ent->curstate.modelindex = MAX_MODELS; // unreachable index
|
||||
@@ -838,7 +840,7 @@ pfnClearScene
|
||||
for drawing playermodel previews
|
||||
====================
|
||||
*/
|
||||
static void pfnClearScene( void )
|
||||
static void GAME_EXPORT pfnClearScene( void )
|
||||
{
|
||||
ref.dllFuncs.R_PushScene();
|
||||
ref.dllFuncs.R_ClearScene();
|
||||
@@ -851,7 +853,7 @@ pfnRenderScene
|
||||
for drawing playermodel previews
|
||||
====================
|
||||
*/
|
||||
static void pfnRenderScene( const ref_viewpass_t *rvp )
|
||||
static void GAME_EXPORT pfnRenderScene( const ref_viewpass_t *rvp )
|
||||
{
|
||||
ref_viewpass_t copy;
|
||||
|
||||
@@ -877,7 +879,7 @@ pfnAddEntity
|
||||
adding player model into visible list
|
||||
====================
|
||||
*/
|
||||
static int pfnAddEntity( int entityType, cl_entity_t *ent )
|
||||
static int GAME_EXPORT pfnAddEntity( int entityType, cl_entity_t *ent )
|
||||
{
|
||||
if( !ref.dllFuncs.R_AddEntity( ent, entityType ))
|
||||
return false;
|
||||
@@ -891,7 +893,7 @@ pfnClientJoin
|
||||
send client connect
|
||||
====================
|
||||
*/
|
||||
static void pfnClientJoin( const netadr_t adr )
|
||||
static void GAME_EXPORT pfnClientJoin( const netadr_t adr )
|
||||
{
|
||||
Cbuf_AddText( va( "connect %s\n", NET_AdrToString( adr )));
|
||||
}
|
||||
@@ -903,7 +905,7 @@ pfnKeyGetOverstrikeMode
|
||||
get global key overstrike state
|
||||
====================
|
||||
*/
|
||||
static int pfnKeyGetOverstrikeMode( void )
|
||||
static int GAME_EXPORT pfnKeyGetOverstrikeMode( void )
|
||||
{
|
||||
return host.key_overstrike;
|
||||
}
|
||||
@@ -915,7 +917,7 @@ pfnKeySetOverstrikeMode
|
||||
set global key overstrike mode
|
||||
====================
|
||||
*/
|
||||
static void pfnKeySetOverstrikeMode( int fActive )
|
||||
static void GAME_EXPORT pfnKeySetOverstrikeMode( int fActive )
|
||||
{
|
||||
host.key_overstrike = fActive;
|
||||
}
|
||||
@@ -951,7 +953,7 @@ pfnMemFree
|
||||
|
||||
=========
|
||||
*/
|
||||
static void pfnMemFree( void *mem, const char *filename, const int fileline )
|
||||
static void GAME_EXPORT pfnMemFree( void *mem, const char *filename, const int fileline )
|
||||
{
|
||||
_Mem_Free( mem, filename, fileline );
|
||||
}
|
||||
@@ -962,7 +964,7 @@ pfnGetGameInfo
|
||||
|
||||
=========
|
||||
*/
|
||||
static int pfnGetGameInfo( GAMEINFO *pgameinfo )
|
||||
static int GAME_EXPORT pfnGetGameInfo( GAMEINFO *pgameinfo )
|
||||
{
|
||||
if( !pgameinfo ) return 0;
|
||||
|
||||
@@ -976,7 +978,7 @@ pfnGetGamesList
|
||||
|
||||
=========
|
||||
*/
|
||||
static GAMEINFO **pfnGetGamesList( int *numGames )
|
||||
static GAMEINFO ** GAME_EXPORT pfnGetGamesList( int *numGames )
|
||||
{
|
||||
if( numGames ) *numGames = SI.numgames;
|
||||
return gameui.modsInfo;
|
||||
@@ -989,7 +991,7 @@ pfnGetFilesList
|
||||
release prev search on a next call
|
||||
=========
|
||||
*/
|
||||
static char **pfnGetFilesList( const char *pattern, int *numFiles, int gamedironly )
|
||||
static char ** GAME_EXPORT pfnGetFilesList( const char *pattern, int *numFiles, int gamedironly )
|
||||
{
|
||||
static search_t *t = NULL;
|
||||
|
||||
@@ -1024,7 +1026,7 @@ pfnCheckGameDll
|
||||
|
||||
=========
|
||||
*/
|
||||
int pfnCheckGameDll( void )
|
||||
int GAME_EXPORT pfnCheckGameDll( void )
|
||||
{
|
||||
string dllpath;
|
||||
void *hInst;
|
||||
@@ -1046,7 +1048,7 @@ int pfnCheckGameDll( void )
|
||||
COM_FreeLibrary( hInst ); // don't increase linker's reference counter
|
||||
return true;
|
||||
}
|
||||
Con_Reportf( S_WARN "Could not load server library:\n%s", COM_GetLibraryError() );
|
||||
Con_Reportf( S_WARN "Could not load server library: %s\n", COM_GetLibraryError() );
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -1056,7 +1058,7 @@ pfnChangeInstance
|
||||
|
||||
=========
|
||||
*/
|
||||
static void pfnChangeInstance( const char *newInstance, const char *szFinalMessage )
|
||||
static void GAME_EXPORT pfnChangeInstance( const char *newInstance, const char *szFinalMessage )
|
||||
{
|
||||
if( !szFinalMessage ) szFinalMessage = "";
|
||||
if( !newInstance || !*newInstance ) return;
|
||||
@@ -1070,7 +1072,7 @@ pfnHostEndGame
|
||||
|
||||
=========
|
||||
*/
|
||||
static void pfnHostEndGame( const char *szFinalMessage )
|
||||
static void GAME_EXPORT pfnHostEndGame( const char *szFinalMessage )
|
||||
{
|
||||
if( !szFinalMessage ) szFinalMessage = "";
|
||||
Host_EndGame( false, "%s", szFinalMessage );
|
||||
@@ -1082,12 +1084,12 @@ pfnStartBackgroundTrack
|
||||
|
||||
=========
|
||||
*/
|
||||
static void pfnStartBackgroundTrack( const char *introTrack, const char *mainTrack )
|
||||
static void GAME_EXPORT pfnStartBackgroundTrack( const char *introTrack, const char *mainTrack )
|
||||
{
|
||||
S_StartBackgroundTrack( introTrack, mainTrack, 0, false );
|
||||
}
|
||||
|
||||
static void GL_ProcessTexture( int texnum, float gamma, int topColor, int bottomColor )
|
||||
static void GAME_EXPORT GL_ProcessTexture( int texnum, float gamma, int topColor, int bottomColor )
|
||||
{
|
||||
ref.dllFuncs.GL_ProcessTexture( texnum, gamma, topColor, bottomColor );
|
||||
}
|
||||
@@ -1098,7 +1100,7 @@ static void GL_ProcessTexture( int texnum, float gamma, int topColor, int bottom
|
||||
UI_ShellExecute
|
||||
=================
|
||||
*/
|
||||
static void UI_ShellExecute( const char *path, const char *parms, int shouldExit )
|
||||
static void GAME_EXPORT UI_ShellExecute( const char *path, const char *parms, int shouldExit )
|
||||
{
|
||||
Platform_ShellExecute( path, parms );
|
||||
|
||||
@@ -1106,9 +1108,20 @@ static void UI_ShellExecute( const char *path, const char *parms, int shouldExit
|
||||
Sys_Quit();
|
||||
}
|
||||
|
||||
/*
|
||||
==============
|
||||
pfnParseFile
|
||||
|
||||
legacy wrapper
|
||||
==============
|
||||
*/
|
||||
static char *pfnParseFile( char *buf, char *token )
|
||||
{
|
||||
return COM_ParseFile( buf, token, INT_MAX );
|
||||
}
|
||||
|
||||
// engine callbacks
|
||||
static ui_enginefuncs_t gEngfuncs =
|
||||
static ui_enginefuncs_t gEngfuncs =
|
||||
{
|
||||
pfnPIC_Load,
|
||||
GL_FreeImage,
|
||||
@@ -1149,7 +1162,7 @@ static ui_enginefuncs_t gEngfuncs =
|
||||
Con_DefaultColor,
|
||||
pfnGetPlayerModel,
|
||||
pfnSetPlayerModel,
|
||||
pfnClearScene,
|
||||
pfnClearScene,
|
||||
pfnRenderScene,
|
||||
pfnAddEntity,
|
||||
Host_Error,
|
||||
@@ -1159,7 +1172,7 @@ static ui_enginefuncs_t gEngfuncs =
|
||||
CL_Active,
|
||||
pfnClientJoin,
|
||||
COM_LoadFileForMe,
|
||||
COM_ParseFile,
|
||||
pfnParseFile,
|
||||
COM_FreeFile,
|
||||
Key_ClearStates,
|
||||
Key_SetKeyDest,
|
||||
@@ -1220,7 +1233,10 @@ static ui_extendedfuncs_t gExtendedfuncs =
|
||||
Con_UtfProcessChar,
|
||||
Con_UtfMoveLeft,
|
||||
Con_UtfMoveRight,
|
||||
pfnGetRenderers
|
||||
pfnGetRenderers,
|
||||
Sys_DoubleTime,
|
||||
_COM_ParseFileSafe,
|
||||
NET_AdrToString
|
||||
};
|
||||
|
||||
void UI_UnloadProgs( void )
|
||||
|
||||
@@ -43,7 +43,6 @@ convar_t *rcon_client_password;
|
||||
convar_t *rcon_address;
|
||||
convar_t *cl_timeout;
|
||||
convar_t *cl_nopred;
|
||||
convar_t *cl_showfps;
|
||||
convar_t *cl_nodelta;
|
||||
convar_t *cl_crosshair;
|
||||
convar_t *cl_cmdbackup;
|
||||
@@ -64,6 +63,7 @@ convar_t *cl_updaterate;
|
||||
convar_t *cl_showevents;
|
||||
convar_t *cl_cmdrate;
|
||||
convar_t *cl_interp;
|
||||
convar_t *cl_nointerp;
|
||||
convar_t *cl_dlmax;
|
||||
convar_t *cl_upmax;
|
||||
|
||||
@@ -89,7 +89,7 @@ clgame_static_t clgame;
|
||||
void CL_InternetServers_f( void );
|
||||
|
||||
//======================================================================
|
||||
int CL_Active( void )
|
||||
int GAME_EXPORT CL_Active( void )
|
||||
{
|
||||
return ( cls.state == ca_active );
|
||||
}
|
||||
@@ -184,17 +184,17 @@ void CL_CheckClientState( void )
|
||||
{
|
||||
// first update is the pre-final signon stage
|
||||
if(( cls.state == ca_connected || cls.state == ca_validate ) && ( cls.signon == SIGNONS ))
|
||||
{
|
||||
{
|
||||
cls.state = ca_active;
|
||||
cls.changelevel = false; // changelevel is done
|
||||
cls.changedemo = false; // changedemo is done
|
||||
cl.first_frame = true; // first rendering frame
|
||||
|
||||
SCR_MakeLevelShot(); // make levelshot if needs
|
||||
Cvar_SetValue( "scr_loading", 0.0f ); // reset progress bar
|
||||
Cvar_SetValue( "scr_loading", 0.0f ); // reset progress bar
|
||||
Netchan_ReportFlow( &cls.netchan );
|
||||
|
||||
Con_DPrintf( "client connected at %.2f sec\n", Sys_DoubleTime() - cls.timestart );
|
||||
Con_DPrintf( "client connected at %.2f sec\n", Sys_DoubleTime() - cls.timestart );
|
||||
if(( cls.demoplayback || cls.disable_servercount != cl.servercount ) && cl.video_prepped )
|
||||
SCR_EndLoadingPlaque(); // get rid of loading plaque
|
||||
}
|
||||
@@ -241,6 +241,11 @@ void CL_SignonReply( void )
|
||||
}
|
||||
}
|
||||
|
||||
float CL_LerpInterval( void )
|
||||
{
|
||||
return Q_max( cl_interp->value, 1.f / cl_updaterate->value );
|
||||
}
|
||||
|
||||
/*
|
||||
===============
|
||||
CL_LerpPoint
|
||||
@@ -251,25 +256,29 @@ should be put at.
|
||||
*/
|
||||
static float CL_LerpPoint( void )
|
||||
{
|
||||
float f, frac = 1.0f;
|
||||
float frac = 1.0f;
|
||||
float server_frametime = cl_serverframetime();
|
||||
|
||||
f = cl_serverframetime();
|
||||
|
||||
if( f == 0.0f || cls.timedemo )
|
||||
if( server_frametime == 0.0f || cls.timedemo )
|
||||
{
|
||||
cl.time = cl.mtime[0];
|
||||
return 1.0f;
|
||||
}
|
||||
|
||||
if( f > 0.1f )
|
||||
{
|
||||
if( server_frametime > 0.1f )
|
||||
{
|
||||
// dropped packet, or start of demo
|
||||
cl.mtime[1] = cl.mtime[0] - 0.1f;
|
||||
f = 0.1f;
|
||||
server_frametime = 0.1f;
|
||||
}
|
||||
#if 1
|
||||
#if 0
|
||||
/*
|
||||
g-cont: this code more suitable for singleplayer
|
||||
NOTE in multiplayer causes significant framerate stutter/jitter and
|
||||
occuring frames with zero time delta and even with negative time delta.
|
||||
game becomes more twitchy and as if without interpolation.
|
||||
*/
|
||||
frac = (cl.time - cl.mtime[1]) / f;
|
||||
|
||||
if( frac < 0.0f )
|
||||
{
|
||||
if( frac < -0.01f )
|
||||
@@ -283,15 +292,17 @@ static float CL_LerpPoint( void )
|
||||
frac = 1.0f;
|
||||
}
|
||||
#else
|
||||
// for multiplayer
|
||||
if( cl_interp->value > 0.001f )
|
||||
{
|
||||
// manual lerp value (goldsrc mode)
|
||||
frac = ( cl.time - cl.mtime[0] ) / cl_interp->value;
|
||||
float td = Q_max( 0.f, cl.time - cl.mtime[0] );
|
||||
frac = td / CL_LerpInterval();
|
||||
}
|
||||
else if( f > 0.001f )
|
||||
else if( server_frametime > 0.001f )
|
||||
{
|
||||
// automatic lerp (classic mode)
|
||||
frac = ( cl.time - cl.mtime[1] ) / f;
|
||||
frac = ( cl.time - cl.mtime[1] ) / server_frametime;
|
||||
}
|
||||
#endif
|
||||
return frac;
|
||||
@@ -334,10 +345,10 @@ Validate interpolation cvars, calc interpolation window
|
||||
*/
|
||||
void CL_ComputeClientInterpolationAmount( usercmd_t *cmd )
|
||||
{
|
||||
int min_interp = MIN_EX_INTERP;
|
||||
int max_interp = MAX_EX_INTERP;
|
||||
int interpolation_msec;
|
||||
qboolean forced = false;
|
||||
const float epsilon = 0.001f; // to avoid float invalid comparision
|
||||
float min_interp = MIN_EX_INTERP;
|
||||
float max_interp = MAX_EX_INTERP;
|
||||
float interpolation_time;
|
||||
|
||||
if( cl_updaterate->value < MIN_UPDATERATE )
|
||||
{
|
||||
@@ -352,29 +363,24 @@ void CL_ComputeClientInterpolationAmount( usercmd_t *cmd )
|
||||
}
|
||||
|
||||
if( cls.spectator )
|
||||
max_interp = 200;
|
||||
max_interp = 0.2f;
|
||||
|
||||
min_interp = 1000.0f / cl_updaterate->value;
|
||||
min_interp = Q_max( 1, min_interp );
|
||||
interpolation_msec = cl_interp->value * 1000.0f;
|
||||
|
||||
if(( interpolation_msec + 1 ) < min_interp )
|
||||
min_interp = 1.0f / cl_updaterate->value;
|
||||
interpolation_time = CL_LerpInterval( );
|
||||
|
||||
if( (cl_interp->value + epsilon) < min_interp )
|
||||
{
|
||||
Con_Printf( "ex_interp forced up to %i msec\n", interpolation_msec );
|
||||
interpolation_msec = min_interp;
|
||||
forced = true;
|
||||
Con_Printf( "ex_interp forced up to %.1f msec\n", min_interp * 1000.f );
|
||||
Cvar_SetValue( "ex_interp", min_interp );
|
||||
}
|
||||
else if(( interpolation_msec - 1 ) > max_interp )
|
||||
else if( (cl_interp->value - epsilon) > max_interp )
|
||||
{
|
||||
Con_Printf( "ex_interp forced down to %i msec\n", interpolation_msec );
|
||||
interpolation_msec = max_interp;
|
||||
forced = true;
|
||||
Con_Printf( "ex_interp forced down to %.1f msec\n", max_interp * 1000.f );
|
||||
Cvar_SetValue( "ex_interp", max_interp );
|
||||
}
|
||||
|
||||
if( forced ) Cvar_SetValue( "ex_interp", (float)interpolation_msec * 0.001f );
|
||||
interpolation_msec = bound( min_interp, interpolation_msec, max_interp );
|
||||
|
||||
cmd->lerp_msec = CL_DriftInterpolationAmount( interpolation_msec );
|
||||
interpolation_time = bound( min_interp, interpolation_time, max_interp );
|
||||
cmd->lerp_msec = CL_DriftInterpolationAmount( interpolation_time * 1000 );
|
||||
}
|
||||
|
||||
/*
|
||||
@@ -522,7 +528,7 @@ qboolean CL_ProcessShowTexturesCmds( usercmd_t *cmd )
|
||||
if( released & ( IN_RIGHT|IN_MOVERIGHT ))
|
||||
Cvar_SetValue( "r_showtextures", gl_showtextures->value + 1 );
|
||||
if( released & ( IN_LEFT|IN_MOVELEFT ))
|
||||
Cvar_SetValue( "r_showtextures", max( 1, gl_showtextures->value - 1 ));
|
||||
Cvar_SetValue( "r_showtextures", Q_max( 1, gl_showtextures->value - 1 ));
|
||||
oldbuttons = cmd->buttons;
|
||||
|
||||
return true;
|
||||
@@ -637,7 +643,7 @@ void CL_CreateCmd( void )
|
||||
CL_SetSolidPlayers( cl.playernum );
|
||||
|
||||
// message we are constructing.
|
||||
i = cls.netchan.outgoing_sequence & CL_UPDATE_MASK;
|
||||
i = cls.netchan.outgoing_sequence & CL_UPDATE_MASK;
|
||||
pcmd = &cl.commands[i];
|
||||
pcmd->processedfuncs = false;
|
||||
|
||||
@@ -723,7 +729,7 @@ void CL_WritePacket( void )
|
||||
int numcmds;
|
||||
int newcmds;
|
||||
int cmdnumber;
|
||||
|
||||
|
||||
// don't send anything if playing back a demo
|
||||
if( cls.demoplayback || cls.state < ca_connected || cls.state == ca_cinematic )
|
||||
return;
|
||||
@@ -778,7 +784,7 @@ void CL_WritePacket( void )
|
||||
if( send_command )
|
||||
{
|
||||
int outgoing_sequence;
|
||||
|
||||
|
||||
if( cl_cmdrate->value > 0 ) // clamped between 10 and 100 fps
|
||||
cls.nextcmdtime = host.realtime + bound( 0.1f, ( 1.0f / cl_cmdrate->value ), 0.01f );
|
||||
else cls.nextcmdtime = host.realtime; // always able to send right away
|
||||
@@ -809,7 +815,7 @@ void CL_WritePacket( void )
|
||||
// put an upper/lower bound on this
|
||||
newcmds = bound( 0, newcmds, cls.legacymode?MAX_LEGACY_TOTAL_CMDS:MAX_TOTAL_CMDS );
|
||||
if( cls.state == ca_connected ) newcmds = 0;
|
||||
|
||||
|
||||
MSG_WriteByte( &buf, newcmds );
|
||||
|
||||
numcmds = newcmds + numbackup;
|
||||
@@ -833,7 +839,7 @@ void CL_WritePacket( void )
|
||||
|
||||
// message we are constructing.
|
||||
i = cls.netchan.outgoing_sequence & CL_UPDATE_MASK;
|
||||
|
||||
|
||||
// determine if we need to ask for a new set of delta's.
|
||||
if( cl.validsequence && (cls.state == ca_active) && !( cls.demorecording && cls.demowaiting ))
|
||||
{
|
||||
@@ -1240,7 +1246,7 @@ void CL_Connect_f( void )
|
||||
else if( Cmd_Argc() != 2 )
|
||||
{
|
||||
Con_Printf( S_USAGE "connect <server>\n" );
|
||||
return;
|
||||
return;
|
||||
}
|
||||
|
||||
Q_strncpy( server, Cmd_Argv( 1 ), sizeof( server ));
|
||||
@@ -1278,6 +1284,7 @@ void CL_Rcon_f( void )
|
||||
{
|
||||
char message[1024];
|
||||
netadr_t to;
|
||||
string command;
|
||||
int i;
|
||||
|
||||
if( !COM_CheckString( rcon_client_password->string ))
|
||||
@@ -1300,7 +1307,8 @@ void CL_Rcon_f( void )
|
||||
|
||||
for( i = 1; i < Cmd_Argc(); i++ )
|
||||
{
|
||||
Q_strcat( message, Cmd_Argv( i ));
|
||||
Cmd_Escape( command, Cmd_Argv( i ), sizeof( command ));
|
||||
Q_strcat( message, command );
|
||||
Q_strcat( message, " " );
|
||||
}
|
||||
|
||||
@@ -1319,7 +1327,7 @@ void CL_Rcon_f( void )
|
||||
NET_StringToAdr( rcon_address->string, &to );
|
||||
if( to.port == 0 ) to.port = MSG_BigShort( PORT_SERVER );
|
||||
}
|
||||
|
||||
|
||||
NET_SendPacket( NS_CLIENT, Q_strlen( message ) + 1, message, to );
|
||||
}
|
||||
|
||||
@@ -1555,7 +1563,6 @@ void CL_LocalServers_f( void )
|
||||
|
||||
Con_Printf( "Scanning for servers on the local network area...\n" );
|
||||
NET_Config( true ); // allow remote
|
||||
cls.legacyservercount = 0;
|
||||
|
||||
// send a broadcast packet
|
||||
adr.type = NA_BROADCAST;
|
||||
@@ -1583,7 +1590,6 @@ void CL_InternetServers_f( void )
|
||||
Info_SetValueForKey( info, "gamedir", GI->gamefolder, remaining );
|
||||
Info_SetValueForKey( info, "clver", XASH_VERSION, remaining ); // let master know about client version
|
||||
// Info_SetValueForKey( info, "nat", cl_nat->string, remaining );
|
||||
cls.legacyservercount = 0;
|
||||
|
||||
cls.internetservers_wait = NET_SendToMasters( NS_CLIENT, sizeof( MS_SCAN_REQUEST ) + Q_strlen( info ), fullquery );
|
||||
cls.internetservers_pending = true;
|
||||
@@ -1714,8 +1720,6 @@ void CL_ParseStatusMessage( netadr_t from, sizebuf_t *msg )
|
||||
{
|
||||
Netchan_OutOfBandPrint( NS_CLIENT, from, "info %i", PROTOCOL_LEGACY_VERSION );
|
||||
Con_Printf( "^1Server^7: %s, Info: %s\n", NET_AdrToString( from ), infostring );
|
||||
if( cls.legacyservercount < MAX_LEGACY_SERVERS )
|
||||
cls.legacyservers[cls.legacyservercount++] = from;
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -1725,14 +1729,10 @@ void CL_ParseStatusMessage( netadr_t from, sizebuf_t *msg )
|
||||
return; // unsupported proto
|
||||
}
|
||||
|
||||
for( i = 0; i < cls.legacyservercount; i++ )
|
||||
if( !COM_CheckString( Info_ValueForKey( infostring, "p" )))
|
||||
{
|
||||
if( NET_CompareAdr( cls.legacyservers[i], from ) )
|
||||
{
|
||||
Info_SetValueForKey( infostring, "legacy", "1", sizeof( infostring ) );
|
||||
Con_Print("Legacy: ");
|
||||
break;
|
||||
}
|
||||
Info_SetValueForKey( infostring, "legacy", "1", sizeof( infostring ) );
|
||||
Con_Print("Legacy: ");
|
||||
}
|
||||
|
||||
// more info about servers
|
||||
@@ -1893,7 +1893,7 @@ void CL_ConnectionlessPacket( netadr_t from, sizebuf_t *msg )
|
||||
int len = sizeof( buf );
|
||||
int dataoffset = 0;
|
||||
netadr_t servadr;
|
||||
|
||||
|
||||
MSG_Clear( msg );
|
||||
MSG_ReadLong( msg ); // skip the -1
|
||||
|
||||
@@ -2218,7 +2218,7 @@ void CL_ReadNetMessage( void )
|
||||
continue;
|
||||
}
|
||||
|
||||
// can't be a valid sequenced packet
|
||||
// can't be a valid sequenced packet
|
||||
if( cls.state < ca_connected ) continue;
|
||||
|
||||
if( !cls.demoplayback && MSG_GetMaxBytes( &net_message ) < 8 )
|
||||
@@ -2257,7 +2257,7 @@ void CL_ReadNetMessage( void )
|
||||
MSG_Init( &net_message, "ServerData", net_message_buffer, curSize );
|
||||
CL_ParseServerMessage( &net_message, false );
|
||||
}
|
||||
|
||||
|
||||
if( Netchan_CopyFileFragments( &cls.netchan, &net_message ))
|
||||
{
|
||||
// remove from resource request stuff.
|
||||
@@ -2333,7 +2333,7 @@ void CL_ReadPackets( void )
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
/*
|
||||
@@ -2345,11 +2345,10 @@ Replace the displayed name for some resources
|
||||
*/
|
||||
const char *CL_CleanFileName( const char *filename )
|
||||
{
|
||||
const char *pfilename = filename;
|
||||
|
||||
if( COM_CheckString( filename ) && filename[0] == '!' )
|
||||
pfilename = "customization";
|
||||
return pfilename;
|
||||
return "customization";
|
||||
|
||||
return filename;
|
||||
}
|
||||
|
||||
|
||||
@@ -2397,7 +2396,7 @@ A file has been received via the fragmentation/reassembly layer, put it in the r
|
||||
*/
|
||||
void CL_ProcessFile( qboolean successfully_received, const char *filename )
|
||||
{
|
||||
int sound_len = Q_strlen( DEFAULT_SOUNDPATH );
|
||||
int sound_len = sizeof( DEFAULT_SOUNDPATH ) - 1;
|
||||
byte rgucMD5_hash[16];
|
||||
const char *pfilename;
|
||||
resource_t *p;
|
||||
@@ -2529,7 +2528,7 @@ CL_ServerCommand
|
||||
send command to a server
|
||||
====================
|
||||
*/
|
||||
void CL_ServerCommand( qboolean reliable, char *fmt, ... )
|
||||
void CL_ServerCommand( qboolean reliable, const char *fmt, ... )
|
||||
{
|
||||
char string[MAX_SYSPATH];
|
||||
va_list argptr;
|
||||
@@ -2666,13 +2665,13 @@ qboolean CL_PrecacheResources( void )
|
||||
{
|
||||
if( FBitSet( pRes->ucFlags, RES_WASMISSING ))
|
||||
{
|
||||
Con_Printf( S_ERROR "Could not load sound %s%s\n", DEFAULT_SOUNDPATH, pRes->szFileName );
|
||||
Con_Printf( S_ERROR "Could not load sound " DEFAULT_SOUNDPATH "%s\n", pRes->szFileName );
|
||||
cl.sound_precache[pRes->nIndex][0] = 0;
|
||||
cl.sound_index[pRes->nIndex] = 0;
|
||||
}
|
||||
else
|
||||
{
|
||||
Q_strncpy( cl.sound_precache[pRes->nIndex], pRes->szFileName, sizeof( cl.sound_precache[0] ));
|
||||
Q_strncpy( cl.sound_precache[pRes->nIndex], pRes->szFileName, sizeof( cl.sound_precache[0] ));
|
||||
cl.sound_index[pRes->nIndex] = S_RegisterSound( pRes->szFileName );
|
||||
|
||||
if( !cl.sound_index[pRes->nIndex] )
|
||||
@@ -2814,13 +2813,13 @@ void CL_InitLocal( void )
|
||||
cl_nodelta = Cvar_Get ("cl_nodelta", "0", 0, "disable delta-compression for server messages" );
|
||||
cl_idealpitchscale = Cvar_Get( "cl_idealpitchscale", "0.8", 0, "how much to look up/down slopes and stairs when not using freelook" );
|
||||
cl_solid_players = Cvar_Get( "cl_solid_players", "1", 0, "Make all players not solid (can't traceline them)" );
|
||||
cl_interp = Cvar_Get( "ex_interp", "0.1", FCVAR_ARCHIVE, "Interpolate object positions starting this many seconds in past" );
|
||||
cl_interp = Cvar_Get( "ex_interp", "0.1", FCVAR_ARCHIVE | FCVAR_FILTERABLE, "Interpolate object positions starting this many seconds in past" );
|
||||
cl_timeout = Cvar_Get( "cl_timeout", "60", 0, "connect timeout (in-seconds)" );
|
||||
cl_charset = Cvar_Get( "cl_charset", "utf-8", FCVAR_ARCHIVE, "1-byte charset to use (iconv style)" );
|
||||
hud_utf8 = Cvar_Get( "hud_utf8", "0", FCVAR_ARCHIVE, "Use utf-8 encoding for hud text" );
|
||||
|
||||
rcon_client_password = Cvar_Get( "rcon_password", "", 0, "remote control client password" );
|
||||
rcon_address = Cvar_Get( "rcon_address", "", 0, "remote control address" );
|
||||
rcon_client_password = Cvar_Get( "rcon_password", "", FCVAR_PRIVILEGED, "remote control client password" );
|
||||
rcon_address = Cvar_Get( "rcon_address", "", FCVAR_PRIVILEGED, "remote control address" );
|
||||
|
||||
cl_trace_messages = Cvar_Get( "cl_trace_messages", "0", FCVAR_ARCHIVE|FCVAR_CHEAT, "enable message names tracing (good for developers)");
|
||||
|
||||
@@ -2831,7 +2830,7 @@ void CL_InitLocal( void )
|
||||
cl_updaterate = Cvar_Get( "cl_updaterate", "20", FCVAR_USERINFO|FCVAR_ARCHIVE, "refresh rate of server messages" );
|
||||
cl_dlmax = Cvar_Get( "cl_dlmax", "0", FCVAR_USERINFO|FCVAR_ARCHIVE, "max allowed outcoming fragment size" );
|
||||
cl_upmax = Cvar_Get( "cl_upmax", "1200", FCVAR_ARCHIVE, "max allowed incoming fragment size" );
|
||||
rate = Cvar_Get( "rate", "3500", FCVAR_USERINFO|FCVAR_ARCHIVE, "player network rate" );
|
||||
rate = Cvar_Get( "rate", "3500", FCVAR_USERINFO|FCVAR_ARCHIVE|FCVAR_FILTERABLE, "player network rate" );
|
||||
topcolor = Cvar_Get( "topcolor", "0", FCVAR_USERINFO|FCVAR_ARCHIVE, "player top color" );
|
||||
bottomcolor = Cvar_Get( "bottomcolor", "0", FCVAR_USERINFO|FCVAR_ARCHIVE, "player bottom color" );
|
||||
cl_lw = Cvar_Get( "cl_lw", "1", FCVAR_ARCHIVE|FCVAR_USERINFO, "enable client weapon predicting" );
|
||||
@@ -2840,8 +2839,8 @@ void CL_InitLocal( void )
|
||||
Cvar_Get( "team", "", FCVAR_USERINFO, "player team" );
|
||||
Cvar_Get( "skin", "", FCVAR_USERINFO, "player skin" );
|
||||
|
||||
cl_showfps = Cvar_Get( "cl_showfps", "1", FCVAR_ARCHIVE, "show client fps" );
|
||||
cl_nosmooth = Cvar_Get( "cl_nosmooth", "0", FCVAR_ARCHIVE, "disable smooth up stair climbing and interpolate position in multiplayer" );
|
||||
cl_nosmooth = Cvar_Get( "cl_nosmooth", "0", FCVAR_ARCHIVE, "disable smooth up stair climbing" );
|
||||
cl_nointerp = Cvar_Get( "cl_nointerp", "0", FCVAR_CLIENTDLL, "disable interpolation of entities and players" );
|
||||
cl_smoothtime = Cvar_Get( "cl_smoothtime", "0", FCVAR_ARCHIVE, "time to smooth up" );
|
||||
cl_cmdbackup = Cvar_Get( "cl_cmdbackup", "10", FCVAR_ARCHIVE, "how many additional history commands are sent" );
|
||||
cl_cmdrate = Cvar_Get( "cl_cmdrate", "30", FCVAR_ARCHIVE, "Max number of command packets sent to server per second" );
|
||||
@@ -2870,20 +2869,21 @@ void CL_InitLocal( void )
|
||||
Cmd_AddCommand ("give", NULL, "give specified item or weapon" );
|
||||
Cmd_AddCommand ("drop", NULL, "drop current/specified item or weapon" );
|
||||
Cmd_AddCommand ("gametitle", NULL, "show game logo" );
|
||||
Cmd_AddCommand( "kill", NULL, "die instantly" );
|
||||
Cmd_AddRestrictedCommand ("kill", NULL, "die instantly" );
|
||||
Cmd_AddCommand ("god", NULL, "enable godmode" );
|
||||
Cmd_AddCommand ("fov", NULL, "set client field of view" );
|
||||
Cmd_AddCommand ("log", NULL, "logging server events" );
|
||||
|
||||
|
||||
// register our commands
|
||||
Cmd_AddCommand ("pause", NULL, "pause the game (if the server allows pausing)" );
|
||||
Cmd_AddCommand ("localservers", CL_LocalServers_f, "collect info about local servers" );
|
||||
Cmd_AddCommand ("internetservers", CL_InternetServers_f, "collect info about internet servers" );
|
||||
Cmd_AddCommand ("cd", CL_PlayCDTrack_f, "Play cd-track (not real cd-player of course)" );
|
||||
Cmd_AddCommand ("mp3", CL_PlayCDTrack_f, "Play mp3-track (based on virtual cd-player)" );
|
||||
Cmd_AddCommand ("waveplaylen", CL_WavePlayLen_f, "Get approximate length of wave file");
|
||||
|
||||
Cmd_AddCommand ("setinfo", CL_SetInfo_f, "examine or change the userinfo string (alias of userinfo)" );
|
||||
Cmd_AddCommand ("userinfo", CL_SetInfo_f, "examine or change the userinfo string (alias of setinfo)" );
|
||||
Cmd_AddRestrictedCommand ("setinfo", CL_SetInfo_f, "examine or change the userinfo string (alias of userinfo)" );
|
||||
Cmd_AddRestrictedCommand ("userinfo", CL_SetInfo_f, "examine or change the userinfo string (alias of setinfo)" );
|
||||
Cmd_AddCommand ("physinfo", CL_Physinfo_f, "print current client physinfo" );
|
||||
Cmd_AddCommand ("disconnect", CL_Disconnect_f, "disconnect from server" );
|
||||
Cmd_AddCommand ("record", CL_Record_f, "record a demo" );
|
||||
@@ -2901,9 +2901,9 @@ void CL_InitLocal( void )
|
||||
Cmd_AddCommand ("linefile", CL_ReadLineFile_f, "show leaks on a map (if present of course)" );
|
||||
Cmd_AddCommand ("fullserverinfo", CL_FullServerinfo_f, "sent by server when serverinfo changes" );
|
||||
Cmd_AddCommand ("upload", CL_BeginUpload_f, "uploading file to the server" );
|
||||
|
||||
Cmd_AddCommand ("quit", CL_Quit_f, "quit from game" );
|
||||
Cmd_AddCommand ("exit", CL_Quit_f, "quit from game" );
|
||||
|
||||
Cmd_AddRestrictedCommand ("quit", CL_Quit_f, "quit from game" );
|
||||
Cmd_AddRestrictedCommand ("exit", CL_Quit_f, "quit from game" );
|
||||
|
||||
Cmd_AddCommand ("screenshot", CL_ScreenShot_f, "takes a screenshot of the next rendered frame" );
|
||||
Cmd_AddCommand ("snapshot", CL_SnapShot_f, "takes a snapshot of the next rendered frame" );
|
||||
@@ -2966,12 +2966,12 @@ Host_ClientBegin
|
||||
*/
|
||||
void Host_ClientBegin( void )
|
||||
{
|
||||
// if client is not active, do nothing
|
||||
if( !cls.initialized ) return;
|
||||
|
||||
// exec console commands
|
||||
Cbuf_Execute ();
|
||||
|
||||
// if client is not active, do nothing
|
||||
if( !cls.initialized ) return;
|
||||
|
||||
// finalize connection process if needs
|
||||
CL_CheckClientState();
|
||||
|
||||
@@ -3069,7 +3069,6 @@ void CL_Init( void )
|
||||
MSG_Init( &cls.datagram, "cls.datagram", cls.datagram_buf, sizeof( cls.datagram_buf ));
|
||||
|
||||
// IN_TouchInit();
|
||||
Con_LoadHistory();
|
||||
|
||||
COM_GetCommonLibraryPath( LIBRARY_CLIENT, libpath, sizeof( libpath ));
|
||||
|
||||
@@ -3090,10 +3089,6 @@ CL_Shutdown
|
||||
*/
|
||||
void CL_Shutdown( void )
|
||||
{
|
||||
// already freed
|
||||
if( !cls.initialized ) return;
|
||||
cls.initialized = false;
|
||||
|
||||
Con_Printf( "CL_Shutdown()\n" );
|
||||
|
||||
if( !host.crashed )
|
||||
@@ -3110,6 +3105,9 @@ void CL_Shutdown( void )
|
||||
Mobile_Shutdown ();
|
||||
SCR_Shutdown ();
|
||||
CL_UnloadProgs ();
|
||||
cls.initialized = false;
|
||||
|
||||
VGui_Shutdown();
|
||||
|
||||
FS_Delete( "demoheader.tmp" ); // remove tmp file
|
||||
SCR_FreeCinematic (); // release AVI's *after* client.dll because custom renderer may use them
|
||||
@@ -3117,4 +3115,5 @@ void CL_Shutdown( void )
|
||||
R_Shutdown ();
|
||||
|
||||
Con_Shutdown ();
|
||||
|
||||
}
|
||||
|
||||
@@ -93,6 +93,15 @@ static void *pfnGetNativeObject( const char *obj )
|
||||
return Platform_GetNativeObject( obj );
|
||||
}
|
||||
|
||||
static void pfnTouch_HideButtons( const char *name, byte state )
|
||||
{
|
||||
Touch_HideButtons( name, state, true );
|
||||
}
|
||||
|
||||
static void pfnTouch_RemoveButton( const char *name )
|
||||
{
|
||||
Touch_RemoveButton( name, true );
|
||||
}
|
||||
|
||||
static mobile_engfuncs_t gpMobileEngfuncs =
|
||||
{
|
||||
@@ -101,14 +110,15 @@ static mobile_engfuncs_t gpMobileEngfuncs =
|
||||
pfnEnableTextInput,
|
||||
Touch_AddClientButton,
|
||||
Touch_AddDefaultButton,
|
||||
Touch_HideButtons,
|
||||
Touch_RemoveButton,
|
||||
(void*)Touch_SetClientOnly,
|
||||
pfnTouch_HideButtons,
|
||||
pfnTouch_RemoveButton,
|
||||
Touch_SetClientOnly,
|
||||
Touch_ResetDefaultButtons,
|
||||
pfnDrawScaledCharacter,
|
||||
Sys_Warn,
|
||||
pfnGetNativeObject,
|
||||
ID_SetCustomClientID
|
||||
ID_SetCustomClientID,
|
||||
_COM_ParseFileSafe
|
||||
};
|
||||
|
||||
qboolean Mobile_Init( void )
|
||||
@@ -124,8 +134,8 @@ qboolean Mobile_Init( void )
|
||||
success = true;
|
||||
|
||||
Cmd_AddCommand( "vibrate", (xcommand_t)Vibrate_f, "Vibrate for specified time");
|
||||
vibration_length = Cvar_Get( "vibration_length", "1.0", FCVAR_ARCHIVE, "Vibration length");
|
||||
vibration_enable = Cvar_Get( "vibration_enable", "1", FCVAR_ARCHIVE, "Enable vibration");
|
||||
vibration_length = Cvar_Get( "vibration_length", "1.0", FCVAR_ARCHIVE | FCVAR_PRIVILEGED, "Vibration length");
|
||||
vibration_enable = Cvar_Get( "vibration_enable", "1", FCVAR_ARCHIVE | FCVAR_PRIVILEGED, "Enable vibration");
|
||||
|
||||
return success;
|
||||
}
|
||||
|
||||
@@ -15,10 +15,13 @@ GNU General Public License for more details.
|
||||
|
||||
#include "common.h"
|
||||
#include "client.h"
|
||||
#include "kbutton.h"
|
||||
|
||||
#if XASH_LOW_MEMORY
|
||||
#if XASH_LOW_MEMORY == 0
|
||||
#define NET_TIMINGS 1024
|
||||
#else
|
||||
#elif XASH_LOW_MEMORY == 1
|
||||
#define NET_TIMINGS 256
|
||||
#elif XASH_LOW_MEMORY == 2
|
||||
#define NET_TIMINGS 64
|
||||
#endif
|
||||
#define NET_TIMINGS_MASK (NET_TIMINGS - 1)
|
||||
@@ -31,11 +34,11 @@ GNU General Public License for more details.
|
||||
#define NUM_LATENCY_SAMPLES 8
|
||||
|
||||
convar_t *net_graph;
|
||||
convar_t *net_graphpos;
|
||||
convar_t *net_graphwidth;
|
||||
convar_t *net_graphheight;
|
||||
convar_t *net_graphsolid;
|
||||
convar_t *net_scale;
|
||||
static convar_t *net_graphpos;
|
||||
static convar_t *net_graphwidth;
|
||||
static convar_t *net_graphheight;
|
||||
static convar_t *net_graphsolid;
|
||||
static convar_t *net_scale;
|
||||
|
||||
static struct packet_latency_t
|
||||
{
|
||||
@@ -93,7 +96,7 @@ NetGraph_AtEdge
|
||||
edge detect
|
||||
==========
|
||||
*/
|
||||
qboolean NetGraph_AtEdge( int x, int width )
|
||||
static qboolean NetGraph_AtEdge( int x, int width )
|
||||
{
|
||||
if( x > 3 )
|
||||
{
|
||||
@@ -111,38 +114,38 @@ NetGraph_InitColors
|
||||
init netgraph colors
|
||||
==========
|
||||
*/
|
||||
void NetGraph_InitColors( void )
|
||||
static void NetGraph_InitColors( void )
|
||||
{
|
||||
byte mincolor[2][3];
|
||||
byte maxcolor[2][3];
|
||||
float dc[2][3];
|
||||
int i, hfrac;
|
||||
int i, hfrac;
|
||||
float f;
|
||||
|
||||
|
||||
mincolor[0][0] = 63;
|
||||
mincolor[0][1] = 0;
|
||||
mincolor[0][2] = 100;
|
||||
|
||||
|
||||
maxcolor[0][0] = 0;
|
||||
maxcolor[0][1] = 63;
|
||||
maxcolor[0][2] = 255;
|
||||
|
||||
|
||||
mincolor[1][0] = 255;
|
||||
mincolor[1][1] = 127;
|
||||
mincolor[1][2] = 0;
|
||||
|
||||
|
||||
maxcolor[1][0] = 250;
|
||||
maxcolor[1][1] = 0;
|
||||
maxcolor[1][2] = 0;
|
||||
|
||||
|
||||
for( i = 0; i < 3; i++ )
|
||||
{
|
||||
dc[0][i] = (float)(maxcolor[0][i] - mincolor[0][i]);
|
||||
dc[1][i] = (float)(maxcolor[1][i] - mincolor[1][i]);
|
||||
}
|
||||
|
||||
|
||||
hfrac = NETGRAPH_LERP_HEIGHT / 3;
|
||||
|
||||
|
||||
for( i = 0; i < NETGRAPH_LERP_HEIGHT; i++ )
|
||||
{
|
||||
if( i < hfrac )
|
||||
@@ -165,7 +168,7 @@ NetGraph_GetFrameData
|
||||
get frame data info, like chokes, packet losses, also update graph, packet and cmdinfo
|
||||
==========
|
||||
*/
|
||||
void NetGraph_GetFrameData( float *latency, int *latency_count )
|
||||
static void NetGraph_GetFrameData( float *latency, int *latency_count )
|
||||
{
|
||||
int i, choke_count = 0, loss_count = 0;
|
||||
double newtime = Sys_DoubleTime();
|
||||
@@ -247,7 +250,7 @@ NetGraph_DrawTimes
|
||||
|
||||
===========
|
||||
*/
|
||||
void NetGraph_DrawTimes( wrect_t rect, int x, int w )
|
||||
static void NetGraph_DrawTimes( wrect_t rect, int x, int w )
|
||||
{
|
||||
int i, j, extrap_point = NETGRAPH_LERP_HEIGHT / 3, a, h;
|
||||
rgba_t colors = { 0.9 * 255, 0.9 * 255, 0.7 * 255, 255 };
|
||||
@@ -322,7 +325,7 @@ NetGraph_DrawHatches
|
||||
|
||||
===========
|
||||
*/
|
||||
void NetGraph_DrawHatches( int x, int y )
|
||||
static void NetGraph_DrawHatches( int x, int y )
|
||||
{
|
||||
int ystep = (int)( 10.0f / net_scale->value );
|
||||
byte colorminor[4] = { 0, 63, 63, 200 };
|
||||
@@ -351,7 +354,7 @@ NetGraph_DrawTextFields
|
||||
|
||||
===========
|
||||
*/
|
||||
void NetGraph_DrawTextFields( int x, int y, int w, wrect_t rect, int count, float avg, int packet_loss, int packet_choke )
|
||||
static void NetGraph_DrawTextFields( int x, int y, int w, wrect_t rect, int count, float avg, int packet_loss, int packet_choke, int graphtype )
|
||||
{
|
||||
static int lastout;
|
||||
rgba_t colors = { 0.9 * 255, 0.9 * 255, 0.7 * 255, 255 };
|
||||
@@ -398,7 +401,7 @@ void NetGraph_DrawTextFields( int x, int y, int w, wrect_t rect, int count, floa
|
||||
Con_DrawString( x, y, va( "out: %i %.2f k/s", out, cls.netchan.flow[FLOW_OUTGOING].avgkbytespersec ), colors );
|
||||
y += 15;
|
||||
|
||||
if( net_graph->value > 2 )
|
||||
if( graphtype > 2 )
|
||||
{
|
||||
int loss = (int)(( packet_loss + PACKETLOSS_AVG_FRAC ) - 0.01f );
|
||||
int choke = (int)(( packet_choke + PACKETCHOKE_AVG_FRAC ) - 0.01f );
|
||||
@@ -407,7 +410,7 @@ void NetGraph_DrawTextFields( int x, int y, int w, wrect_t rect, int count, floa
|
||||
}
|
||||
}
|
||||
|
||||
if( net_graph->value < 3 )
|
||||
if( graphtype < 3 )
|
||||
Con_DrawString( ptx, pty, va( "%i/s", (int)cl_cmdrate->value ), colors );
|
||||
|
||||
Con_DrawString( ptx, last_y, va( "%i/s" , (int)cl_updaterate->value ), colors );
|
||||
@@ -421,7 +424,7 @@ NetGraph_DrawDataSegment
|
||||
|
||||
===========
|
||||
*/
|
||||
int NetGraph_DrawDataSegment( wrect_t *fill, int bytes, byte r, byte g, byte b, byte a )
|
||||
static int NetGraph_DrawDataSegment( wrect_t *fill, int bytes, byte r, byte g, byte b, byte a )
|
||||
{
|
||||
float h = bytes / net_scale->value;
|
||||
byte colors[4] = { r, g, b, a };
|
||||
@@ -448,7 +451,7 @@ NetGraph_ColorForHeight
|
||||
color based on packet latency
|
||||
===========
|
||||
*/
|
||||
void NetGraph_ColorForHeight( struct packet_latency_t *packet, byte color[4], int *ping )
|
||||
static void NetGraph_ColorForHeight( struct packet_latency_t *packet, byte color[4], int *ping )
|
||||
{
|
||||
switch( packet->latency )
|
||||
{
|
||||
@@ -483,7 +486,7 @@ NetGraph_DrawDataUsage
|
||||
|
||||
===========
|
||||
*/
|
||||
void NetGraph_DrawDataUsage( int x, int y, int w )
|
||||
static void NetGraph_DrawDataUsage( int x, int y, int w, int graphtype )
|
||||
{
|
||||
int a, i, h, lastvalidh = 0, ping;
|
||||
int pingheight = net_graphheight->value - NETGRAPH_LERP_HEIGHT - 2;
|
||||
@@ -538,7 +541,7 @@ void NetGraph_DrawDataUsage( int x, int y, int w )
|
||||
if( NetGraph_AtEdge( a, w ))
|
||||
NetGraph_DrawRect( &fill, color );
|
||||
|
||||
if( net_graph->value < 2 )
|
||||
if( graphtype < 2 )
|
||||
continue;
|
||||
|
||||
color[0] = color[1] = color[2] = color[3] = 255;
|
||||
@@ -585,7 +588,7 @@ void NetGraph_DrawDataUsage( int x, int y, int w )
|
||||
continue;
|
||||
}
|
||||
|
||||
if( net_graph->value >= 2 )
|
||||
if( graphtype >= 2 )
|
||||
NetGraph_DrawHatches( x, y - net_graphheight->value - 1 );
|
||||
}
|
||||
|
||||
@@ -595,7 +598,7 @@ NetGraph_GetScreenPos
|
||||
|
||||
===========
|
||||
*/
|
||||
void NetGraph_GetScreenPos( wrect_t *rect, int *w, int *x, int *y )
|
||||
static void NetGraph_GetScreenPos( wrect_t *rect, int *w, int *x, int *y )
|
||||
{
|
||||
rect->left = rect->top = 0;
|
||||
rect->right = refState.width;
|
||||
@@ -634,6 +637,8 @@ void SCR_DrawNetGraph( void )
|
||||
float avg_ping;
|
||||
int ping_count;
|
||||
int w, x, y;
|
||||
kbutton_t *in_graph;
|
||||
int graphtype;
|
||||
|
||||
if( !host.allow_console )
|
||||
return;
|
||||
@@ -641,8 +646,20 @@ void SCR_DrawNetGraph( void )
|
||||
if( cls.state != ca_active )
|
||||
return;
|
||||
|
||||
if( !net_graph->value )
|
||||
in_graph = clgame.dllFuncs.KB_Find( "in_graph" );
|
||||
|
||||
if( in_graph->state & 1 )
|
||||
{
|
||||
graphtype = 2;
|
||||
}
|
||||
else if( net_graph->value != 0.0f )
|
||||
{
|
||||
graphtype = (int)net_graph->value;
|
||||
}
|
||||
else
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
if( net_scale->value <= 0 )
|
||||
Cvar_SetValue( "net_scale", 0.1f );
|
||||
@@ -651,16 +668,16 @@ void SCR_DrawNetGraph( void )
|
||||
|
||||
NetGraph_GetFrameData( &avg_ping, &ping_count );
|
||||
|
||||
NetGraph_DrawTextFields( x, y, w, rect, ping_count, avg_ping, packet_loss, packet_choke );
|
||||
NetGraph_DrawTextFields( x, y, w, rect, ping_count, avg_ping, packet_loss, packet_choke, graphtype );
|
||||
|
||||
if( net_graph->value < 3 )
|
||||
if( graphtype < 3 )
|
||||
{
|
||||
ref.dllFuncs.GL_SetRenderMode( kRenderTransAdd );
|
||||
|
||||
ref.dllFuncs.GL_Bind( XASH_TEXTURE0, R_GetBuiltinTexture( REF_WHITE_TEXTURE ) );
|
||||
ref.dllFuncs.Begin( TRI_QUADS ); // draw all the fills as a long solid sequence of quads for speedup reasons
|
||||
|
||||
// NOTE: fill colors without texture at this point
|
||||
NetGraph_DrawDataUsage( x, y, w );
|
||||
NetGraph_DrawDataUsage( x, y, w, graphtype );
|
||||
NetGraph_DrawTimes( rect, x, w );
|
||||
|
||||
ref.dllFuncs.End();
|
||||
|
||||
@@ -61,7 +61,7 @@ void CL_ParseSoundPacket( sizebuf_t *msg )
|
||||
{
|
||||
vec3_t pos;
|
||||
int chan, sound;
|
||||
float volume, attn;
|
||||
float volume, attn;
|
||||
int flags, pitch, entnum;
|
||||
sound_t handle = 0;
|
||||
|
||||
@@ -75,14 +75,14 @@ void CL_ParseSoundPacket( sizebuf_t *msg )
|
||||
|
||||
if( FBitSet( flags, SND_ATTENUATION ))
|
||||
attn = (float)MSG_ReadByte( msg ) / 64.0f;
|
||||
else attn = ATTN_NONE;
|
||||
else attn = ATTN_NONE;
|
||||
|
||||
if( FBitSet( flags, SND_PITCH ))
|
||||
pitch = MSG_ReadByte( msg );
|
||||
else pitch = PITCH_NORM;
|
||||
|
||||
// entity reletive
|
||||
entnum = MSG_ReadUBitLong( msg, MAX_ENTITY_BITS );
|
||||
entnum = MSG_ReadUBitLong( msg, MAX_ENTITY_BITS );
|
||||
|
||||
// positioned in space
|
||||
MSG_ReadVec3Coord( msg, pos );
|
||||
@@ -123,7 +123,7 @@ void CL_ParseRestoreSoundPacket( sizebuf_t *msg )
|
||||
{
|
||||
vec3_t pos;
|
||||
int chan, sound;
|
||||
float volume, attn;
|
||||
float volume, attn;
|
||||
int flags, pitch, entnum;
|
||||
double samplePos, forcedEnd;
|
||||
int wordIndex;
|
||||
@@ -139,7 +139,7 @@ void CL_ParseRestoreSoundPacket( sizebuf_t *msg )
|
||||
|
||||
if( flags & SND_ATTENUATION )
|
||||
attn = (float)MSG_ReadByte( msg ) / 64.0f;
|
||||
else attn = ATTN_NONE;
|
||||
else attn = ATTN_NONE;
|
||||
|
||||
if( flags & SND_PITCH )
|
||||
pitch = MSG_ReadByte( msg );
|
||||
@@ -269,8 +269,8 @@ void CL_ParseParticles( sizebuf_t *msg )
|
||||
vec3_t org, dir;
|
||||
int i, count, color;
|
||||
float life;
|
||||
|
||||
MSG_ReadVec3Coord( msg, org );
|
||||
|
||||
MSG_ReadVec3Coord( msg, org );
|
||||
|
||||
for( i = 0; i < 3; i++ )
|
||||
dir[i] = MSG_ReadChar( msg ) * 0.0625f;
|
||||
@@ -360,7 +360,7 @@ CL_WeaponAnim
|
||||
Set new weapon animation
|
||||
==================
|
||||
*/
|
||||
void CL_WeaponAnim( int iAnim, int body )
|
||||
void GAME_EXPORT CL_WeaponAnim( int iAnim, int body )
|
||||
{
|
||||
cl_entity_t *view = &clgame.viewent;
|
||||
|
||||
@@ -484,6 +484,8 @@ void CL_BatchResourceRequest( qboolean initialize )
|
||||
switch( p->type )
|
||||
{
|
||||
case t_sound:
|
||||
case t_model:
|
||||
case t_eventscript:
|
||||
if( !CL_CheckFile( &msg, p ))
|
||||
break;
|
||||
CL_MoveToOnHandList( p );
|
||||
@@ -491,21 +493,13 @@ void CL_BatchResourceRequest( qboolean initialize )
|
||||
case t_skin:
|
||||
CL_MoveToOnHandList( p );
|
||||
break;
|
||||
case t_model:
|
||||
if( !CL_CheckFile( &msg, p ))
|
||||
break;
|
||||
CL_MoveToOnHandList( p );
|
||||
break;
|
||||
case t_decal:
|
||||
if( !HPAK_GetDataPointer( CUSTOM_RES_PATH, p, NULL, NULL ))
|
||||
{
|
||||
if( !FBitSet( p->ucFlags, RES_REQUESTED ))
|
||||
{
|
||||
string filename;
|
||||
|
||||
Q_snprintf( filename, sizeof( filename ), "!MD5%s", MD5_Print( p->rgucMD5_hash ));
|
||||
MSG_BeginClientCmd( &msg, clc_stringcmd );
|
||||
MSG_WriteString( &msg, va( "dlfile %s", filename ));
|
||||
MSG_WriteString( &msg, va( "dlfile !MD5%s", MD5_Print( p->rgucMD5_hash ) ) );
|
||||
SetBits( p->ucFlags, RES_REQUESTED );
|
||||
}
|
||||
break;
|
||||
@@ -523,11 +517,6 @@ void CL_BatchResourceRequest( qboolean initialize )
|
||||
break;
|
||||
CL_MoveToOnHandList( p );
|
||||
break;
|
||||
case t_eventscript:
|
||||
if( !CL_CheckFile( &msg, p ))
|
||||
break;
|
||||
CL_MoveToOnHandList( p );
|
||||
break;
|
||||
case t_world:
|
||||
ASSERT( 0 );
|
||||
break;
|
||||
@@ -560,7 +549,7 @@ int CL_EstimateNeededResources( void )
|
||||
switch( p->type )
|
||||
{
|
||||
case t_sound:
|
||||
if( p->szFileName[0] != '*' && !FS_FileExists( va( "%s%s", DEFAULT_SOUNDPATH, p->szFileName ), false ) )
|
||||
if( p->szFileName[0] != '*' && !FS_FileExists( va( DEFAULT_SOUNDPATH "%s", p->szFileName ), false ) )
|
||||
{
|
||||
SetBits( p->ucFlags, RES_WASMISSING );
|
||||
nTotalSize += p->nDownloadSize;
|
||||
@@ -910,7 +899,7 @@ void CL_ParseServerData( sizebuf_t *msg )
|
||||
}
|
||||
|
||||
// multiplayer game?
|
||||
if( cl.maxclients > 1 )
|
||||
if( cl.maxclients > 1 )
|
||||
{
|
||||
// allow console in multiplayer games
|
||||
host.allow_console = true;
|
||||
@@ -936,7 +925,7 @@ void CL_ParseServerData( sizebuf_t *msg )
|
||||
Cvar_FullSet( "cl_background", "1", FCVAR_READ_ONLY );
|
||||
else Cvar_FullSet( "cl_background", "0", FCVAR_READ_ONLY );
|
||||
|
||||
if( !cls.changelevel )
|
||||
if( !cls.changelevel )
|
||||
{
|
||||
// continue playing if we are changing level
|
||||
S_StopBackgroundTrack ();
|
||||
@@ -967,7 +956,7 @@ void CL_ParseServerData( sizebuf_t *msg )
|
||||
|
||||
if(( cl_allow_levelshots->value && !cls.changelevel ) || cl.background )
|
||||
{
|
||||
if( !FS_FileExists( va( "%s.bmp", cl_levelshot_name->string ), true ))
|
||||
if( !FS_FileExists( va( "%s.bmp", cl_levelshot_name->string ), true ))
|
||||
Cvar_Set( "cl_levelshot_name", "*black" ); // render a black screen
|
||||
cls.scrshot_request = scrshot_plaque; // request levelshot even if exist (check filetime)
|
||||
}
|
||||
@@ -1027,7 +1016,7 @@ void CL_ParseClientData( sizebuf_t *msg )
|
||||
frame = &cl.frames[cl.parsecountmod]; // frame at index.
|
||||
|
||||
frame->time = cl.mtime[0]; // mark network received time
|
||||
frame->receivedtime = host.realtime; // time now that we are parsing.
|
||||
frame->receivedtime = host.realtime; // time now that we are parsing.
|
||||
|
||||
memset( &frame->graphdata, 0, sizeof( netbandwidthgraph_t ));
|
||||
|
||||
@@ -1035,7 +1024,7 @@ void CL_ParseClientData( sizebuf_t *msg )
|
||||
parsecounttime = cl.commands[command_ack & CL_UPDATE_MASK].senttime;
|
||||
|
||||
// current time that we got a response to the command packet.
|
||||
cl.commands[command_ack & CL_UPDATE_MASK].receivedtime = host.realtime;
|
||||
cl.commands[command_ack & CL_UPDATE_MASK].receivedtime = host.realtime;
|
||||
|
||||
if( cl.last_command_ack != -1 )
|
||||
{
|
||||
@@ -1091,8 +1080,8 @@ void CL_ParseClientData( sizebuf_t *msg )
|
||||
// otherwise, move in 1 ms steps toward observed channel latency.
|
||||
if( latency < cls.latency )
|
||||
cls.latency = latency;
|
||||
else cls.latency += 0.001f; // drift up, so corrections are needed
|
||||
}
|
||||
else cls.latency += 0.001f; // drift up, so corrections are needed
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -1104,7 +1093,7 @@ void CL_ParseClientData( sizebuf_t *msg )
|
||||
{
|
||||
cl.local.health = 1;
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
to_cd = &frame->clientdata;
|
||||
to_wd = frame->weapondata;
|
||||
@@ -1231,13 +1220,13 @@ void CL_ParseAddAngle( sizebuf_t *msg )
|
||||
{
|
||||
pred_viewangle_t *a;
|
||||
float delta_yaw;
|
||||
|
||||
|
||||
delta_yaw = MSG_ReadBitAngle( msg, 16 );
|
||||
#if 0
|
||||
cl.viewangles[YAW] += delta_yaw;
|
||||
return;
|
||||
#endif
|
||||
// update running counter
|
||||
// update running counter
|
||||
cl.addangletotal += delta_yaw;
|
||||
|
||||
// select entry into circular buffer
|
||||
@@ -1301,7 +1290,7 @@ void CL_RegisterUserMessage( sizebuf_t *msg )
|
||||
{
|
||||
char *pszName;
|
||||
int svc_num, size, bits;
|
||||
|
||||
|
||||
svc_num = MSG_ReadByte( msg );
|
||||
|
||||
if( cls.legacymode )
|
||||
@@ -1325,30 +1314,6 @@ void CL_RegisterUserMessage( sizebuf_t *msg )
|
||||
CL_LinkUserMessage( pszName, svc_num, size );
|
||||
}
|
||||
|
||||
/*
|
||||
================
|
||||
CL_RegisterUserMessage
|
||||
|
||||
register new user message or update existing
|
||||
================
|
||||
*/
|
||||
/*
|
||||
void CL_LegacyRegisterUserMessage( sizebuf_t *msg )
|
||||
{
|
||||
char *pszName;
|
||||
int svc_num, size;
|
||||
|
||||
svc_num = MSG_ReadByte( msg );
|
||||
size = MSG_ReadByte( msg );
|
||||
pszName = MSG_ReadString( msg );
|
||||
|
||||
// important stuff
|
||||
if( size == 0xFF ) size = -1;
|
||||
svc_num = bound( 0, svc_num, 255 );
|
||||
|
||||
CL_LinkUserMessage( pszName, svc_num, size );
|
||||
}
|
||||
*/
|
||||
/*
|
||||
================
|
||||
CL_UpdateUserinfo
|
||||
@@ -1455,7 +1420,7 @@ void CL_UpdateUserPings( sizebuf_t *msg )
|
||||
{
|
||||
int i, slot;
|
||||
player_info_t *player;
|
||||
|
||||
|
||||
for( i = 0; i < MAX_CLIENTS; i++ )
|
||||
{
|
||||
if( !MSG_ReadOneBit( msg )) break; // end of message
|
||||
@@ -1496,7 +1461,7 @@ void CL_SendConsistencyInfo( sizebuf_t *msg )
|
||||
MSG_WriteUBitLong( msg, pc->orig_index, MAX_MODEL_BITS );
|
||||
|
||||
if( pc->issound )
|
||||
Q_snprintf( filename, sizeof( filename ), "%s%s", DEFAULT_SOUNDPATH, pc->filename );
|
||||
Q_snprintf( filename, sizeof( filename ), DEFAULT_SOUNDPATH "%s", pc->filename );
|
||||
else Q_strncpy( filename, pc->filename, sizeof( filename ));
|
||||
|
||||
if( Q_strstr( filename, "models/" ))
|
||||
@@ -1578,6 +1543,9 @@ void CL_RegisterResources( sizebuf_t *msg )
|
||||
|
||||
CL_ClearWorld ();
|
||||
|
||||
// update the ref state.
|
||||
R_UpdateRefState ();
|
||||
|
||||
// tell rendering system we have a new set of models.
|
||||
ref.dllFuncs.R_NewMap ();
|
||||
|
||||
@@ -1743,7 +1711,7 @@ void CL_ParseResLocation( sizebuf_t *msg )
|
||||
return;
|
||||
}
|
||||
|
||||
while( ( data = COM_ParseFile( data, token ) ) )
|
||||
while( ( data = COM_ParseFile( data, token, sizeof( token ) ) ) )
|
||||
{
|
||||
Con_Reportf( "Adding %s as download location\n", token );
|
||||
|
||||
@@ -1819,7 +1787,7 @@ void CL_ParseScreenShake( sizebuf_t *msg )
|
||||
clgame.shake.amplitude = (float)(word)MSG_ReadShort( msg ) * (1.0f / (float)(1<<12));
|
||||
clgame.shake.duration = (float)(word)MSG_ReadShort( msg ) * (1.0f / (float)(1<<12));
|
||||
clgame.shake.frequency = (float)(word)MSG_ReadShort( msg ) * (1.0f / (float)(1<<8));
|
||||
clgame.shake.time = cl.time + max( clgame.shake.duration, 0.01f );
|
||||
clgame.shake.time = cl.time + Q_max( clgame.shake.duration, 0.01f );
|
||||
clgame.shake.next_shake = 0.0f; // apply immediately
|
||||
}
|
||||
|
||||
@@ -1883,45 +1851,88 @@ Find the client cvar value
|
||||
and sent it back to the server
|
||||
==============
|
||||
*/
|
||||
void CL_ParseCvarValue( sizebuf_t *msg )
|
||||
void CL_ParseCvarValue( sizebuf_t *msg, const qboolean ext )
|
||||
{
|
||||
const char *cvarName = MSG_ReadString( msg );
|
||||
convar_t *cvar = Cvar_FindVar( cvarName );
|
||||
const char *cvarName, *response;
|
||||
convar_t *cvar;
|
||||
int requestID;
|
||||
|
||||
// build the answer
|
||||
MSG_BeginClientCmd( &cls.netchan.message, clc_requestcvarvalue );
|
||||
MSG_WriteString( &cls.netchan.message, cvar ? cvar->string : "Not Found" );
|
||||
if( ext )
|
||||
requestID = MSG_ReadLong( msg );
|
||||
|
||||
cvarName = MSG_ReadString( msg );
|
||||
cvar = Cvar_FindVar( cvarName );
|
||||
|
||||
if( cvar )
|
||||
{
|
||||
if( cvar->flags & FCVAR_PRIVILEGED )
|
||||
response = "CVAR is privileged";
|
||||
else if( cvar->flags & FCVAR_SERVER )
|
||||
response = "CVAR is server-only";
|
||||
else if( cvar->flags & FCVAR_PROTECTED )
|
||||
response = "CVAR is protected";
|
||||
else
|
||||
response = cvar->string;
|
||||
}
|
||||
else response = "Bad CVAR request";
|
||||
|
||||
if( ext )
|
||||
{
|
||||
MSG_BeginClientCmd( &cls.netchan.message, clc_requestcvarvalue2 );
|
||||
MSG_WriteLong( &cls.netchan.message, requestID );
|
||||
MSG_WriteString( &cls.netchan.message, cvarName );
|
||||
}
|
||||
else
|
||||
{
|
||||
MSG_BeginClientCmd( &cls.netchan.message, clc_requestcvarvalue );
|
||||
}
|
||||
MSG_WriteString( &cls.netchan.message, response );
|
||||
}
|
||||
|
||||
/*
|
||||
==============
|
||||
CL_ParseCvarValue2
|
||||
CL_ParseExec
|
||||
|
||||
Find the client cvar value
|
||||
and sent it back to the server
|
||||
Exec map/class specific configs
|
||||
==============
|
||||
*/
|
||||
void CL_ParseCvarValue2( sizebuf_t *msg )
|
||||
void CL_ParseExec( sizebuf_t *msg )
|
||||
{
|
||||
int requestID = MSG_ReadLong( msg );
|
||||
const char *cvarName = MSG_ReadString( msg );
|
||||
convar_t *cvar = Cvar_FindVar( cvarName );
|
||||
qboolean is_class;
|
||||
int class_idx;
|
||||
string mapname;
|
||||
const char *class_cfgs[] = {
|
||||
"",
|
||||
"exec scout.cfg\n",
|
||||
"exec sniper.cfg\n",
|
||||
"exec soldier.cfg\n",
|
||||
"exec demoman.cfg\n",
|
||||
"exec medic.cfg\n",
|
||||
"exec hwguy.cfg\n",
|
||||
"exec pyro.cfg\n",
|
||||
"exec spy.cfg\n",
|
||||
"exec engineer.cfg\n",
|
||||
"",
|
||||
"exec civilian.cfg\n"
|
||||
};
|
||||
|
||||
// build the answer
|
||||
MSG_BeginClientCmd( &cls.netchan.message, clc_requestcvarvalue2 );
|
||||
MSG_WriteLong( &cls.netchan.message, requestID );
|
||||
MSG_WriteString( &cls.netchan.message, cvarName );
|
||||
is_class = MSG_ReadByte( msg );
|
||||
|
||||
if( cvar )
|
||||
if ( is_class )
|
||||
{
|
||||
// cheater can change value ignoring Cvar_Set so we responce incorrect value
|
||||
if( cvar->value != Q_atof( cvar->string ))
|
||||
MSG_WriteString( &cls.netchan.message, va( "%s (%g)", cvar->string, cvar->value ));
|
||||
else MSG_WriteString( &cls.netchan.message, cvar->string );
|
||||
}
|
||||
else
|
||||
class_idx = MSG_ReadByte( msg );
|
||||
|
||||
if ( class_idx >= 0 && class_idx <= 11 && !Q_stricmp( GI->gamefolder, "tfc" ) )
|
||||
Cbuf_AddText( class_cfgs[class_idx] );
|
||||
}
|
||||
else if ( !Q_stricmp( GI->gamefolder, "tfc" ) )
|
||||
{
|
||||
MSG_WriteString( &cls.netchan.message, "Not Found" );
|
||||
Cbuf_AddText( "exec mapdefault.cfg\n" );
|
||||
|
||||
COM_FileBase( clgame.mapname, mapname );
|
||||
|
||||
if ( COM_CheckString( mapname ) )
|
||||
Cbuf_AddText( va( "exec %s.cfg\n", mapname ) );
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2081,7 +2092,7 @@ void CL_ParseServerMessage( sizebuf_t *msg, qboolean normal_message )
|
||||
// assume no entity/player update this packet
|
||||
if( cls.state == ca_active )
|
||||
{
|
||||
cl.frames[cls.netchan.incoming_sequence & CL_UPDATE_MASK].valid = false;
|
||||
cl.frames[cls.netchan.incoming_sequence & CL_UPDATE_MASK].valid = false;
|
||||
cl.frames[cls.netchan.incoming_sequence & CL_UPDATE_MASK].choked = false;
|
||||
}
|
||||
else
|
||||
@@ -2089,7 +2100,7 @@ void CL_ParseServerMessage( sizebuf_t *msg, qboolean normal_message )
|
||||
CL_ResetFrame( &cl.frames[cls.netchan.incoming_sequence & CL_UPDATE_MASK] );
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// parse the message
|
||||
while( 1 )
|
||||
{
|
||||
@@ -2104,7 +2115,7 @@ void CL_ParseServerMessage( sizebuf_t *msg, qboolean normal_message )
|
||||
|
||||
// end of message (align bits)
|
||||
if( MSG_GetNumBitsLeft( msg ) < 8 )
|
||||
break;
|
||||
break;
|
||||
|
||||
cmd = MSG_ReadServerCmd( msg );
|
||||
|
||||
@@ -2179,11 +2190,11 @@ void CL_ParseServerMessage( sizebuf_t *msg, qboolean normal_message )
|
||||
case svc_stufftext:
|
||||
s = MSG_ReadString( msg );
|
||||
#ifdef HACKS_RELATED_HLMODS
|
||||
// dsiable Cry Of Fear antisave protection
|
||||
// disable Cry Of Fear antisave protection
|
||||
if( !Q_strnicmp( s, "disconnect", 10 ) && cls.signon != SIGNONS )
|
||||
break; // too early
|
||||
#endif
|
||||
Cbuf_AddText( s );
|
||||
Cbuf_AddFilteredText( s );
|
||||
break;
|
||||
case svc_setangle:
|
||||
CL_ParseSetAngle( msg );
|
||||
@@ -2329,10 +2340,13 @@ void CL_ParseServerMessage( sizebuf_t *msg, qboolean normal_message )
|
||||
CL_ParseResLocation( msg );
|
||||
break;
|
||||
case svc_querycvarvalue:
|
||||
CL_ParseCvarValue( msg );
|
||||
CL_ParseCvarValue( msg, false );
|
||||
break;
|
||||
case svc_querycvarvalue2:
|
||||
CL_ParseCvarValue2( msg );
|
||||
CL_ParseCvarValue( msg, true );
|
||||
break;
|
||||
case svc_exec:
|
||||
CL_ParseExec( msg );
|
||||
break;
|
||||
default:
|
||||
CL_ParseUserMessage( msg, cmd );
|
||||
@@ -2367,14 +2381,11 @@ CL_ParseBaseline
|
||||
void CL_LegacyParseBaseline( sizebuf_t *msg )
|
||||
{
|
||||
int i, newnum;
|
||||
entity_state_t nullstate;
|
||||
qboolean player;
|
||||
cl_entity_t *ent;
|
||||
|
||||
Delta_InitClient (); // finalize client delta's
|
||||
|
||||
memset( &nullstate, 0, sizeof( nullstate ));
|
||||
|
||||
newnum = MSG_ReadWord( msg );
|
||||
player = CL_IsPlayerIndex( newnum );
|
||||
|
||||
@@ -2802,7 +2813,7 @@ void CL_LegacyParseResourceList( sizebuf_t *msg )
|
||||
const char *path;
|
||||
|
||||
if( reslist.restype[i] == t_sound )
|
||||
path = va( "sound/%s", reslist.resnames[i] );
|
||||
path = va( DEFAULT_SOUNDPATH "%s", reslist.resnames[i] );
|
||||
else path = reslist.resnames[i];
|
||||
|
||||
if( FS_FileExists( path, false ))
|
||||
@@ -2944,13 +2955,13 @@ void CL_ParseLegacyServerMessage( sizebuf_t *msg, qboolean normal_message )
|
||||
case svc_stufftext:
|
||||
s = MSG_ReadString( msg );
|
||||
#ifdef HACKS_RELATED_HLMODS
|
||||
// dsiable Cry Of Fear antisave protection
|
||||
// disable Cry Of Fear antisave protection
|
||||
if( !Q_strnicmp( s, "disconnect", 10 ) && cls.signon != SIGNONS )
|
||||
break; // too early
|
||||
#endif
|
||||
|
||||
Con_Reportf( "Stufftext: %s", s );
|
||||
Cbuf_AddText( s );
|
||||
Cbuf_AddFilteredText( s );
|
||||
break;
|
||||
case svc_setangle:
|
||||
CL_ParseSetAngle( msg );
|
||||
@@ -3116,10 +3127,10 @@ void CL_ParseLegacyServerMessage( sizebuf_t *msg, qboolean normal_message )
|
||||
CL_ParseResLocation( msg );
|
||||
break;
|
||||
case svc_querycvarvalue:
|
||||
CL_ParseCvarValue( msg );
|
||||
CL_ParseCvarValue( msg, false );
|
||||
break;
|
||||
case svc_querycvarvalue2:
|
||||
CL_ParseCvarValue2( msg );
|
||||
CL_ParseCvarValue( msg, true );
|
||||
break;
|
||||
default:
|
||||
CL_ParseUserMessage( msg, cmd );
|
||||
@@ -3168,6 +3179,9 @@ void CL_LegacyPrecache_f( void )
|
||||
if( clgame.entities )
|
||||
clgame.entities->model = cl.worldmodel;
|
||||
|
||||
// update the ref state.
|
||||
R_UpdateRefState ();
|
||||
|
||||
// tell rendering system we have a new set of models.
|
||||
ref.dllFuncs.R_NewMap ();
|
||||
|
||||
|
||||
@@ -46,7 +46,7 @@ CL_PushPMStates
|
||||
|
||||
=============
|
||||
*/
|
||||
void CL_PushPMStates( void )
|
||||
void GAME_EXPORT CL_PushPMStates( void )
|
||||
{
|
||||
if( clgame.pushed ) return;
|
||||
clgame.oldphyscount = clgame.pmove->numphysent;
|
||||
@@ -60,7 +60,7 @@ CL_PopPMStates
|
||||
|
||||
=============
|
||||
*/
|
||||
void CL_PopPMStates( void )
|
||||
void GAME_EXPORT CL_PopPMStates( void )
|
||||
{
|
||||
if( !clgame.pushed ) return;
|
||||
clgame.pmove->numphysent = clgame.oldphyscount;
|
||||
@@ -74,7 +74,7 @@ CL_PushTraceBounds
|
||||
|
||||
=============
|
||||
*/
|
||||
void CL_PushTraceBounds( int hullnum, const float *mins, const float *maxs )
|
||||
void GAME_EXPORT CL_PushTraceBounds( int hullnum, const float *mins, const float *maxs )
|
||||
{
|
||||
hullnum = bound( 0, hullnum, 3 );
|
||||
VectorCopy( mins, clgame.pmove->player_mins[hullnum] );
|
||||
@@ -87,7 +87,7 @@ CL_PopTraceBounds
|
||||
|
||||
=============
|
||||
*/
|
||||
void CL_PopTraceBounds( void )
|
||||
void GAME_EXPORT CL_PopTraceBounds( void )
|
||||
{
|
||||
memcpy( clgame.pmove->player_mins, host.player_mins, sizeof( host.player_mins ));
|
||||
memcpy( clgame.pmove->player_maxs, host.player_maxs, sizeof( host.player_maxs ));
|
||||
@@ -159,7 +159,7 @@ void CL_SetIdealPitch( void )
|
||||
top[0] = cl.simorg[0] + cosval * (i + 3.0f) * 12.0f;
|
||||
top[1] = cl.simorg[1] + sinval * (i + 3.0f) * 12.0f;
|
||||
top[2] = cl.simorg[2] + cl.viewheight[2];
|
||||
|
||||
|
||||
bottom[0] = top[0];
|
||||
bottom[1] = top[1];
|
||||
bottom[2] = top[2] - 160.0f;
|
||||
@@ -170,10 +170,10 @@ void CL_SetIdealPitch( void )
|
||||
|
||||
if( tr.fraction == 1.0f )
|
||||
return; // near a dropoff
|
||||
|
||||
|
||||
z[i] = top[2] + tr.fraction * (bottom[2] - top[2]);
|
||||
}
|
||||
|
||||
|
||||
dir = 0;
|
||||
steps = 0;
|
||||
|
||||
@@ -186,16 +186,16 @@ void CL_SetIdealPitch( void )
|
||||
if( dir && ( step-dir > ON_EPSILON || step-dir < -ON_EPSILON ))
|
||||
return; // mixed changes
|
||||
|
||||
steps++;
|
||||
steps++;
|
||||
dir = step;
|
||||
}
|
||||
|
||||
|
||||
if( !dir )
|
||||
{
|
||||
cl.local.idealpitch = 0.0f;
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
if( steps < 2 ) return;
|
||||
cl.local.idealpitch = -dir * cl_idealpitchscale->value;
|
||||
}
|
||||
@@ -264,7 +264,9 @@ void CL_CheckPredictionError( void )
|
||||
// save for error interpolation
|
||||
VectorCopy( delta, cl.local.prediction_error );
|
||||
|
||||
if( dist > MIN_CORRECTION_DISTANCE )
|
||||
// GoldSrc checks for singleplayer
|
||||
// we would check for local server
|
||||
if( dist > MIN_CORRECTION_DISTANCE && !SV_Active() )
|
||||
cls.correction_time = cl_smoothtime->value;
|
||||
}
|
||||
}
|
||||
@@ -280,7 +282,7 @@ then with clipping against them.
|
||||
This sets up the first phase.
|
||||
=============
|
||||
*/
|
||||
void CL_SetUpPlayerPrediction( int dopred, int bIncludeLocalClient )
|
||||
void GAME_EXPORT CL_SetUpPlayerPrediction( int dopred, int bIncludeLocalClient )
|
||||
{
|
||||
entity_state_t *state;
|
||||
predicted_player_t *player;
|
||||
@@ -538,7 +540,7 @@ pmove must be setup with world and solid entity hulls before calling
|
||||
(via CL_PredictMove)
|
||||
===============
|
||||
*/
|
||||
void CL_SetSolidPlayers( int playernum )
|
||||
void GAME_EXPORT CL_SetSolidPlayers( int playernum )
|
||||
{
|
||||
entity_state_t *state;
|
||||
predicted_player_t *player;
|
||||
@@ -594,7 +596,7 @@ CL_WaterEntity
|
||||
|
||||
=============
|
||||
*/
|
||||
int CL_WaterEntity( const float *rgflPos )
|
||||
int GAME_EXPORT CL_WaterEntity( const float *rgflPos )
|
||||
{
|
||||
physent_t *pe;
|
||||
hull_t *hull;
|
||||
@@ -627,7 +629,7 @@ int CL_WaterEntity( const float *rgflPos )
|
||||
if( FBitSet( pe->model->flags, MODEL_HAS_ORIGIN ) && !VectorIsNull( pe->angles ))
|
||||
{
|
||||
matrix4x4 matrix;
|
||||
|
||||
|
||||
Matrix4x4_CreateFromEntity( matrix, pe->angles, offset, 1.0f );
|
||||
Matrix4x4_VectorITransform( matrix, rgflPos, test );
|
||||
}
|
||||
@@ -655,7 +657,7 @@ pmtrace_t CL_TraceLine( vec3_t start, vec3_t end, int flags )
|
||||
pmtrace_t tr;
|
||||
|
||||
old_usehull = clgame.pmove->usehull;
|
||||
clgame.pmove->usehull = 2;
|
||||
clgame.pmove->usehull = 2;
|
||||
tr = PM_PlayerTraceExt( clgame.pmove, start, end, flags, clgame.pmove->numphysent, clgame.pmove->physents, -1, NULL );
|
||||
clgame.pmove->usehull = old_usehull;
|
||||
|
||||
@@ -675,7 +677,7 @@ pmtrace_t *CL_VisTraceLine( vec3_t start, vec3_t end, int flags )
|
||||
static pmtrace_t tr;
|
||||
|
||||
old_usehull = clgame.pmove->usehull;
|
||||
clgame.pmove->usehull = 2;
|
||||
clgame.pmove->usehull = 2;
|
||||
tr = PM_PlayerTraceExt( clgame.pmove, start, end, flags, clgame.pmove->numvisent, clgame.pmove->visents, -1, NULL );
|
||||
clgame.pmove->usehull = old_usehull;
|
||||
|
||||
@@ -699,17 +701,17 @@ cl_entity_t *CL_GetWaterEntity( const float *rgflPos )
|
||||
return CL_GetEntityByIndex( entnum );
|
||||
}
|
||||
|
||||
int CL_TestLine( const vec3_t start, const vec3_t end, int flags )
|
||||
int GAME_EXPORT CL_TestLine( const vec3_t start, const vec3_t end, int flags )
|
||||
{
|
||||
return PM_TestLineExt( clgame.pmove, clgame.pmove->physents, clgame.pmove->numphysent, start, end, flags );
|
||||
}
|
||||
|
||||
static int pfnTestPlayerPosition( float *pos, pmtrace_t *ptrace )
|
||||
static int GAME_EXPORT pfnTestPlayerPosition( float *pos, pmtrace_t *ptrace )
|
||||
{
|
||||
return PM_TestPlayerPosition( clgame.pmove, pos, ptrace, NULL );
|
||||
}
|
||||
|
||||
static void pfnStuckTouch( int hitent, pmtrace_t *tr )
|
||||
static void GAME_EXPORT pfnStuckTouch( int hitent, pmtrace_t *tr )
|
||||
{
|
||||
int i;
|
||||
|
||||
@@ -728,7 +730,7 @@ static void pfnStuckTouch( int hitent, pmtrace_t *tr )
|
||||
clgame.pmove->touchindex[clgame.pmove->numtouch++] = *tr;
|
||||
}
|
||||
|
||||
static int pfnPointContents( float *p, int *truecontents )
|
||||
static int GAME_EXPORT pfnPointContents( float *p, int *truecontents )
|
||||
{
|
||||
int cont, truecont;
|
||||
|
||||
@@ -740,17 +742,17 @@ static int pfnPointContents( float *p, int *truecontents )
|
||||
return cont;
|
||||
}
|
||||
|
||||
static int pfnTruePointContents( float *p )
|
||||
static int GAME_EXPORT pfnTruePointContents( float *p )
|
||||
{
|
||||
return PM_TruePointContents( clgame.pmove, p );
|
||||
}
|
||||
|
||||
static int pfnHullPointContents( struct hull_s *hull, int num, float *p )
|
||||
static int GAME_EXPORT pfnHullPointContents( struct hull_s *hull, int num, float *p )
|
||||
{
|
||||
return PM_HullPointContents( hull, num, p );
|
||||
}
|
||||
|
||||
static pmtrace_t pfnPlayerTrace( float *start, float *end, int traceFlags, int ignore_pe )
|
||||
static pmtrace_t GAME_EXPORT pfnPlayerTrace( float *start, float *end, int traceFlags, int ignore_pe )
|
||||
{
|
||||
return PM_PlayerTraceExt( clgame.pmove, start, end, traceFlags, clgame.pmove->numphysent, clgame.pmove->physents, ignore_pe, NULL );
|
||||
}
|
||||
@@ -761,7 +763,7 @@ pmtrace_t *PM_TraceLine( float *start, float *end, int flags, int usehull, int i
|
||||
int old_usehull;
|
||||
|
||||
old_usehull = clgame.pmove->usehull;
|
||||
clgame.pmove->usehull = usehull;
|
||||
clgame.pmove->usehull = usehull;
|
||||
|
||||
switch( flags )
|
||||
{
|
||||
@@ -783,7 +785,7 @@ static hull_t *pfnHullForBsp( physent_t *pe, float *offset )
|
||||
return PM_HullForBsp( pe, clgame.pmove, offset );
|
||||
}
|
||||
|
||||
static float pfnTraceModel( physent_t *pe, float *start, float *end, trace_t *trace )
|
||||
static float GAME_EXPORT pfnTraceModel( physent_t *pe, float *start, float *end, trace_t *trace )
|
||||
{
|
||||
int old_usehull;
|
||||
vec3_t start_l, end_l;
|
||||
@@ -838,9 +840,9 @@ static const char *pfnTraceTexture( int ground, float *vstart, float *vend )
|
||||
|
||||
pe = &clgame.pmove->physents[ground];
|
||||
return PM_TraceTexture( pe, vstart, vend );
|
||||
}
|
||||
}
|
||||
|
||||
static void pfnPlaySound( int channel, const char *sample, float volume, float attenuation, int fFlags, int pitch )
|
||||
static void GAME_EXPORT pfnPlaySound( int channel, const char *sample, float volume, float attenuation, int fFlags, int pitch )
|
||||
{
|
||||
if( !clgame.pmove->runfuncs )
|
||||
return;
|
||||
@@ -848,18 +850,18 @@ static void pfnPlaySound( int channel, const char *sample, float volume, float a
|
||||
S_StartSound( NULL, clgame.pmove->player_index + 1, channel, S_RegisterSound( sample ), volume, attenuation, pitch, fFlags );
|
||||
}
|
||||
|
||||
static void pfnPlaybackEventFull( int flags, int clientindex, word eventindex, float delay, float *origin,
|
||||
static void GAME_EXPORT pfnPlaybackEventFull( int flags, int clientindex, word eventindex, float delay, float *origin,
|
||||
float *angles, float fparam1, float fparam2, int iparam1, int iparam2, int bparam1, int bparam2 )
|
||||
{
|
||||
CL_PlaybackEvent( flags, NULL, eventindex, delay, origin, angles, fparam1, fparam2, iparam1, iparam2, bparam1, bparam2 );
|
||||
}
|
||||
|
||||
static pmtrace_t pfnPlayerTraceEx( float *start, float *end, int traceFlags, pfnIgnore pmFilter )
|
||||
static pmtrace_t GAME_EXPORT pfnPlayerTraceEx( float *start, float *end, int traceFlags, pfnIgnore pmFilter )
|
||||
{
|
||||
return PM_PlayerTraceExt( clgame.pmove, start, end, traceFlags, clgame.pmove->numphysent, clgame.pmove->physents, -1, pmFilter );
|
||||
}
|
||||
|
||||
static int pfnTestPlayerPositionEx( float *pos, pmtrace_t *ptrace, pfnIgnore pmFilter )
|
||||
static int GAME_EXPORT pfnTestPlayerPositionEx( float *pos, pmtrace_t *ptrace, pfnIgnore pmFilter )
|
||||
{
|
||||
return PM_TestPlayerPosition( clgame.pmove, pos, ptrace, pmFilter );
|
||||
}
|
||||
@@ -870,7 +872,7 @@ static pmtrace_t *pfnTraceLineEx( float *start, float *end, int flags, int usehu
|
||||
int old_usehull;
|
||||
|
||||
old_usehull = clgame.pmove->usehull;
|
||||
clgame.pmove->usehull = usehull;
|
||||
clgame.pmove->usehull = usehull;
|
||||
|
||||
switch( flags )
|
||||
{
|
||||
@@ -926,13 +928,13 @@ void CL_InitClientMove( void )
|
||||
clgame.pmove->PM_StuckTouch = pfnStuckTouch;
|
||||
clgame.pmove->PM_PointContents = pfnPointContents;
|
||||
clgame.pmove->PM_TruePointContents = pfnTruePointContents;
|
||||
clgame.pmove->PM_HullPointContents = pfnHullPointContents;
|
||||
clgame.pmove->PM_HullPointContents = pfnHullPointContents;
|
||||
clgame.pmove->PM_PlayerTrace = pfnPlayerTrace;
|
||||
clgame.pmove->PM_TraceLine = PM_TraceLine;
|
||||
clgame.pmove->RandomLong = COM_RandomLong;
|
||||
clgame.pmove->RandomFloat = COM_RandomFloat;
|
||||
clgame.pmove->PM_GetModelType = pfnGetModelType;
|
||||
clgame.pmove->PM_GetModelBounds = pfnGetModelBounds;
|
||||
clgame.pmove->PM_GetModelBounds = pfnGetModelBounds;
|
||||
clgame.pmove->PM_HullForBsp = (void*)pfnHullForBsp;
|
||||
clgame.pmove->PM_TraceModel = pfnTraceModel;
|
||||
clgame.pmove->COM_FileSize = COM_FileSize;
|
||||
@@ -990,7 +992,6 @@ void CL_SetupPMove( playermove_t *pmove, local_state_t *from, usercmd_t *ucmd, q
|
||||
pmove->flFallVelocity = ps->flFallVelocity;
|
||||
pmove->flSwimTime = cd->flSwimTime;
|
||||
VectorCopy( cd->punchangle, pmove->punchangle );
|
||||
pmove->flSwimTime = cd->flSwimTime;
|
||||
pmove->flNextPrimaryAttack = 0.0f; // not used by PM_ code
|
||||
pmove->effects = ps->effects;
|
||||
pmove->flags = cd->flags;
|
||||
@@ -1019,7 +1020,7 @@ void CL_SetupPMove( playermove_t *pmove, local_state_t *from, usercmd_t *ucmd, q
|
||||
VectorCopy( cd->vuser2, pmove->vuser2 );
|
||||
VectorCopy( cd->vuser3, pmove->vuser3 );
|
||||
VectorCopy( cd->vuser4, pmove->vuser4 );
|
||||
pmove->cmd = *ucmd; // copy current cmds
|
||||
pmove->cmd = *ucmd; // copy current cmds
|
||||
|
||||
Q_strncpy( pmove->physinfo, cls.physinfo, MAX_INFO_STRING );
|
||||
}
|
||||
@@ -1048,7 +1049,7 @@ void CL_FinishPMove( playermove_t *pmove, local_state_t *to )
|
||||
VectorCopy( pmove->angles, ps->angles );
|
||||
VectorCopy( pmove->basevelocity, ps->basevelocity );
|
||||
VectorCopy( pmove->punchangle, cd->punchangle );
|
||||
ps->oldbuttons = pmove->oldbuttons;
|
||||
ps->oldbuttons = pmove->cmd.buttons;
|
||||
ps->friction = pmove->friction;
|
||||
ps->movetype = pmove->movetype;
|
||||
ps->onground = pmove->onground;
|
||||
@@ -1080,13 +1081,14 @@ Runs prediction code for user cmd
|
||||
void CL_RunUsercmd( local_state_t *from, local_state_t *to, usercmd_t *u, qboolean runfuncs, double *time, unsigned int random_seed )
|
||||
{
|
||||
usercmd_t cmd;
|
||||
local_state_t temp;
|
||||
usercmd_t split;
|
||||
|
||||
memset( &temp, 0, sizeof( temp ));
|
||||
|
||||
if( u->msec > 50 )
|
||||
{
|
||||
local_state_t temp;
|
||||
usercmd_t split;
|
||||
|
||||
memset( &temp, 0, sizeof( temp ));
|
||||
|
||||
split = *u;
|
||||
split.msec /= 2;
|
||||
CL_RunUsercmd( from, &temp, &split, runfuncs, time, random_seed );
|
||||
@@ -1153,12 +1155,12 @@ Sets cl.predicted.origin and cl.predicted.angles
|
||||
*/
|
||||
void CL_PredictMovement( qboolean repredicting )
|
||||
{
|
||||
runcmd_t *to_cmd, *from_cmd;
|
||||
runcmd_t *to_cmd = NULL, *from_cmd;
|
||||
local_state_t *from = NULL, *to = NULL;
|
||||
int current_command;
|
||||
int current_command_mod;
|
||||
uint current_command;
|
||||
uint current_command_mod;
|
||||
frame_t *frame = NULL;
|
||||
int i, stoppoint;
|
||||
uint i, stoppoint;
|
||||
qboolean runfuncs;
|
||||
double f = 1.0;
|
||||
cl_entity_t *ent;
|
||||
@@ -1227,10 +1229,6 @@ void CL_PredictMovement( qboolean repredicting )
|
||||
if( to_cmd->senttime >= host.realtime )
|
||||
break;
|
||||
|
||||
// now interpolate some fraction of the final frame
|
||||
if( to_cmd->senttime != from_cmd->senttime )
|
||||
f = (host.realtime - from_cmd->senttime) / (to_cmd->senttime - from_cmd->senttime) * 0.1;
|
||||
|
||||
from = to;
|
||||
from_cmd = to_cmd;
|
||||
}
|
||||
@@ -1263,8 +1261,10 @@ void CL_PredictMovement( qboolean repredicting )
|
||||
return;
|
||||
}
|
||||
|
||||
f = bound( 0.0f, f, 1.0f );
|
||||
f = 0.0; // FIXME: make work, do revision
|
||||
// now interpolate some fraction of the final frame
|
||||
if( to_cmd->senttime != from_cmd->senttime )
|
||||
f = bound( 0.0, (host.realtime - from_cmd->senttime) / (to_cmd->senttime - from_cmd->senttime) * 0.1, 1.0 );
|
||||
else f = 0.0;
|
||||
|
||||
if( CL_PlayerTeleported( from, to ))
|
||||
{
|
||||
|
||||
@@ -224,7 +224,7 @@ static void CL_ParseQuakeServerInfo( sizebuf_t *msg )
|
||||
}
|
||||
|
||||
// multiplayer game?
|
||||
if( cl.maxclients > 1 )
|
||||
if( cl.maxclients > 1 )
|
||||
{
|
||||
// allow console in multiplayer games
|
||||
host.allow_console = true;
|
||||
@@ -308,7 +308,7 @@ static void CL_ParseQuakeServerInfo( sizebuf_t *msg )
|
||||
|
||||
if(( cl_allow_levelshots->value && !cls.changelevel ) || cl.background )
|
||||
{
|
||||
if( !FS_FileExists( va( "%s.bmp", cl_levelshot_name->string ), true ))
|
||||
if( !FS_FileExists( va( "%s.bmp", cl_levelshot_name->string ), true ))
|
||||
Cvar_Set( "cl_levelshot_name", "*black" ); // render a black screen
|
||||
cls.scrshot_request = scrshot_plaque; // request levelshot even if exist (check filetime)
|
||||
}
|
||||
@@ -353,7 +353,7 @@ static void CL_ParseQuakeClientData( sizebuf_t *msg )
|
||||
cl.parsecountmod = cl.parsecount & CL_UPDATE_MASK; // index into window.
|
||||
frame = &cl.frames[cl.parsecountmod]; // frame at index.
|
||||
frame->time = cl.mtime[0]; // mark network received time
|
||||
frame->receivedtime = host.realtime; // time now that we are parsing.
|
||||
frame->receivedtime = host.realtime; // time now that we are parsing.
|
||||
memset( &frame->graphdata, 0, sizeof( netbandwidthgraph_t ));
|
||||
memset( frame->flags, 0, sizeof( frame->flags ));
|
||||
frame->first_entity = cls.next_client_entities;
|
||||
@@ -448,7 +448,7 @@ void CL_ParseQuakeEntityData( sizebuf_t *msg, int bits )
|
||||
SetBits( bits, i << 8 );
|
||||
}
|
||||
|
||||
if( FBitSet( bits, U_LONGENTITY ))
|
||||
if( FBitSet( bits, U_LONGENTITY ))
|
||||
newnum = MSG_ReadWord( msg );
|
||||
else newnum = MSG_ReadByte( msg );
|
||||
|
||||
@@ -465,7 +465,7 @@ void CL_ParseQuakeEntityData( sizebuf_t *msg, int bits )
|
||||
if( ent->curstate.msg_time != cl.mtime[1] )
|
||||
forcelink = true; // no previous frame to lerp from
|
||||
else forcelink = false;
|
||||
|
||||
|
||||
if( FBitSet( bits, U_MODEL ))
|
||||
state->modelindex = MSG_ReadByte( msg );
|
||||
else state->modelindex = ent->baseline.modelindex;
|
||||
@@ -573,8 +573,8 @@ void CL_ParseQuakeParticle( sizebuf_t *msg )
|
||||
{
|
||||
int count, color;
|
||||
vec3_t org, dir;
|
||||
|
||||
MSG_ReadVec3Coord( msg, org );
|
||||
|
||||
MSG_ReadVec3Coord( msg, org );
|
||||
dir[0] = MSG_ReadChar( msg ) * 0.0625f;
|
||||
dir[1] = MSG_ReadChar( msg ) * 0.0625f;
|
||||
dir[2] = MSG_ReadChar( msg ) * 0.0625f;
|
||||
@@ -597,12 +597,12 @@ void CL_ParseQuakeStaticSound( sizebuf_t *msg )
|
||||
float vol, attn;
|
||||
vec3_t org;
|
||||
|
||||
MSG_ReadVec3Coord( msg, org );
|
||||
MSG_ReadVec3Coord( msg, org );
|
||||
sound_num = MSG_ReadByte( msg );
|
||||
vol = (float)MSG_ReadByte( msg ) / 255.0f;
|
||||
attn = (float)MSG_ReadByte( msg ) / 64.0f;
|
||||
|
||||
S_StartSound( org, 0, CHAN_STATIC, cl.sound_index[sound_num], vol, attn, PITCH_NORM, 0 );
|
||||
S_StartSound( org, 0, CHAN_STATIC, cl.sound_index[sound_num], vol, attn, PITCH_NORM, 0 );
|
||||
}
|
||||
|
||||
/*
|
||||
@@ -825,6 +825,9 @@ CL_QuakeStuffText
|
||||
void CL_QuakeStuffText( const char *text )
|
||||
{
|
||||
Q_strncat( cmd_buf, text, sizeof( cmd_buf ));
|
||||
|
||||
// a1ba: didn't filtered, anyway quake protocol
|
||||
// only supported for demos, not network games
|
||||
Cbuf_AddText( text );
|
||||
}
|
||||
|
||||
@@ -861,9 +864,7 @@ void CL_QuakeExecStuff( void )
|
||||
|
||||
if( !*text ) break;
|
||||
|
||||
host.com_ignorebracket = true;
|
||||
text = COM_ParseFile( text, token );
|
||||
host.com_ignorebracket = false;
|
||||
text = _COM_ParseFileSafe( text, token, sizeof( token ), PFILE_IGNOREBRACKET, NULL );
|
||||
|
||||
if( !text ) break;
|
||||
|
||||
@@ -908,7 +909,7 @@ void CL_ParseQuakeMessage( sizebuf_t *msg, qboolean normal_message )
|
||||
// assume no entity/player update this packet
|
||||
if( cls.state == ca_active )
|
||||
{
|
||||
cl.frames[cls.netchan.incoming_sequence & CL_UPDATE_MASK].valid = false;
|
||||
cl.frames[cls.netchan.incoming_sequence & CL_UPDATE_MASK].valid = false;
|
||||
cl.frames[cls.netchan.incoming_sequence & CL_UPDATE_MASK].choked = false;
|
||||
}
|
||||
else
|
||||
@@ -931,7 +932,7 @@ void CL_ParseQuakeMessage( sizebuf_t *msg, qboolean normal_message )
|
||||
|
||||
// end of message (align bits)
|
||||
if( MSG_GetNumBitsLeft( msg ) < 8 )
|
||||
break;
|
||||
break;
|
||||
|
||||
cmd = MSG_ReadServerCmd( msg );
|
||||
|
||||
|
||||
@@ -54,7 +54,7 @@ qboolean CL_CmpStudioTextures( int numtexs, mstudiotexture_t *p1, mstudiotexture
|
||||
|
||||
if( p1->index != p2->index )
|
||||
return false;
|
||||
}
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -98,7 +98,7 @@ CL_DuplicateTexture
|
||||
Dupliacte texture with remap pixels
|
||||
====================
|
||||
*/
|
||||
void CL_DuplicateTexture( mstudiotexture_t *ptexture, int topcolor, int bottomcolor )
|
||||
void CL_DuplicateTexture( cl_entity_t *entity, model_t *model, mstudiotexture_t *ptexture, int topcolor, int bottomcolor )
|
||||
{
|
||||
const char *name;
|
||||
texture_t *tx = NULL;
|
||||
@@ -111,12 +111,12 @@ void CL_DuplicateTexture( mstudiotexture_t *ptexture, int topcolor, int bottomco
|
||||
// save off the real texture index
|
||||
index = ptexture->index;
|
||||
name = ref.dllFuncs.GL_TextureName( index );
|
||||
Q_snprintf( texname, sizeof( texname ), "#%i_%s", refState.currententity->curstate.number, name + 1 );
|
||||
Q_snprintf( texname, sizeof( texname ), "#%i_%s", entity->curstate.number, name + 1 );
|
||||
|
||||
// search for pixels
|
||||
for( i = 0; i < refState.currentmodel->numtextures; i++ )
|
||||
for( i = 0; i < model->numtextures; i++ )
|
||||
{
|
||||
tx = refState.currentmodel->textures[i];
|
||||
tx = model->textures[i];
|
||||
if( tx->gl_texturenum == index )
|
||||
break; // found
|
||||
}
|
||||
@@ -141,7 +141,7 @@ CL_UpdateStudioTexture
|
||||
Update texture top and bottom colors
|
||||
====================
|
||||
*/
|
||||
void CL_UpdateStudioTexture( mstudiotexture_t *ptexture, int topcolor, int bottomcolor )
|
||||
void CL_UpdateStudioTexture( cl_entity_t *entity, mstudiotexture_t *ptexture, int topcolor, int bottomcolor )
|
||||
{
|
||||
rgbdata_t *pic;
|
||||
texture_t *tx = NULL;
|
||||
@@ -156,7 +156,7 @@ void CL_UpdateStudioTexture( mstudiotexture_t *ptexture, int topcolor, int botto
|
||||
origtexname = ref.dllFuncs.GL_TextureName( ptexture->index );
|
||||
|
||||
// build name of original texture
|
||||
Q_strncpy( mdlname, refState.currentmodel->name, sizeof( mdlname ));
|
||||
Q_strncpy( mdlname, entity->model->name, sizeof( mdlname ));
|
||||
COM_FileBase( ptexture->name, name );
|
||||
COM_StripExtension( mdlname );
|
||||
|
||||
@@ -165,9 +165,9 @@ void CL_UpdateStudioTexture( mstudiotexture_t *ptexture, int topcolor, int botto
|
||||
if( !index ) return; // couldn't find texture
|
||||
|
||||
// search for pixels
|
||||
for( i = 0; i < refState.currentmodel->numtextures; i++ )
|
||||
for( i = 0; i < entity->model->numtextures; i++ )
|
||||
{
|
||||
tx = refState.currentmodel->textures[i];
|
||||
tx = entity->model->textures[i];
|
||||
if( tx->gl_texturenum == index )
|
||||
break; // found
|
||||
}
|
||||
@@ -202,21 +202,21 @@ CL_UpdateAliasTexture
|
||||
Update texture top and bottom colors
|
||||
====================
|
||||
*/
|
||||
void CL_UpdateAliasTexture( unsigned short *texture, int skinnum, int topcolor, int bottomcolor )
|
||||
void CL_UpdateAliasTexture( cl_entity_t *entity, unsigned short *texture, int skinnum, int topcolor, int bottomcolor )
|
||||
{
|
||||
char texname[MAX_QPATH];
|
||||
rgbdata_t skin, *pic;
|
||||
texture_t *tx;
|
||||
|
||||
if( !texture || !refState.currentmodel->textures )
|
||||
if( !texture || !entity->model->textures )
|
||||
return; // no remapinfo in model
|
||||
|
||||
tx = refState.currentmodel->textures[skinnum];
|
||||
tx = entity->model->textures[skinnum];
|
||||
if( !tx ) return; // missing texture ?
|
||||
|
||||
if( *texture == 0 )
|
||||
{
|
||||
Q_snprintf( texname, sizeof( texname ), "%s:remap%i_%i", refState.currentmodel->name, skinnum, refState.currententity->index );
|
||||
Q_snprintf( texname, sizeof( texname ), "%s:remap%i_%i", entity->model->name, skinnum, entity->index );
|
||||
skin.width = tx->width;
|
||||
skin.height = tx->height;
|
||||
skin.depth = skin.numMips = 1;
|
||||
@@ -242,7 +242,7 @@ Allocate new remap info per entity
|
||||
and make copy of remap textures
|
||||
====================
|
||||
*/
|
||||
void CL_AllocRemapInfo( int topcolor, int bottomcolor )
|
||||
void CL_AllocRemapInfo( cl_entity_t *entity, model_t *model, int topcolor, int bottomcolor )
|
||||
{
|
||||
remap_info_t *info;
|
||||
studiohdr_t *phdr;
|
||||
@@ -250,10 +250,10 @@ void CL_AllocRemapInfo( int topcolor, int bottomcolor )
|
||||
mstudiotexture_t *src, *dst;
|
||||
int i, size;
|
||||
|
||||
if( !refState.currententity ) return;
|
||||
i = ( refState.currententity == &clgame.viewent ) ? clgame.maxEntities : refState.currententity->curstate.number;
|
||||
if( !entity ) return;
|
||||
i = ( entity == &clgame.viewent ) ? clgame.maxEntities : entity->curstate.number;
|
||||
|
||||
if( !refState.currentmodel || ( refState.currentmodel->type != mod_alias && refState.currentmodel->type != mod_studio ))
|
||||
if( !model || ( model->type != mod_alias && model->type != mod_studio ))
|
||||
{
|
||||
// entity has changed model by another type, release remap info
|
||||
if( clgame.remap_info[i] )
|
||||
@@ -265,7 +265,7 @@ void CL_AllocRemapInfo( int topcolor, int bottomcolor )
|
||||
}
|
||||
|
||||
// model doesn't contains remap textures
|
||||
if( refState.currentmodel->numtextures <= 0 )
|
||||
if( model->numtextures <= 0 )
|
||||
{
|
||||
// entity has changed model with no remap textures
|
||||
if( clgame.remap_info[i] )
|
||||
@@ -276,22 +276,22 @@ void CL_AllocRemapInfo( int topcolor, int bottomcolor )
|
||||
return;
|
||||
}
|
||||
|
||||
if( refState.currentmodel->type == mod_studio )
|
||||
if( model->type == mod_studio )
|
||||
{
|
||||
phdr = (studiohdr_t *)Mod_StudioExtradata( refState.currentmodel );
|
||||
phdr = (studiohdr_t *)Mod_StudioExtradata( model );
|
||||
if( !phdr ) return; // bad model?
|
||||
|
||||
src = (mstudiotexture_t *)(((byte *)phdr) + phdr->textureindex);
|
||||
dst = (clgame.remap_info[i] ? clgame.remap_info[i]->ptexture : NULL);
|
||||
dst = (clgame.remap_info[i] ? clgame.remap_info[i]->ptexture : NULL);
|
||||
|
||||
// NOTE: we must copy all the structures 'mstudiotexture_t' for easy access when model is rendering
|
||||
if( !CL_CmpStudioTextures( phdr->numtextures, src, dst ) || clgame.remap_info[i]->model != refState.currentmodel )
|
||||
if( !CL_CmpStudioTextures( phdr->numtextures, src, dst ) || clgame.remap_info[i]->model != model )
|
||||
{
|
||||
// this code catches studiomodel change with another studiomodel with remap textures
|
||||
// e.g. playermodel 'barney' with playermodel 'gordon'
|
||||
if( clgame.remap_info[i] ) CL_FreeRemapInfo( clgame.remap_info[i] ); // free old info
|
||||
size = sizeof( remap_info_t ) + ( sizeof( mstudiotexture_t ) * phdr->numtextures );
|
||||
info = clgame.remap_info[i] = Mem_Calloc( clgame.mempool, size );
|
||||
info = clgame.remap_info[i] = Mem_Calloc( clgame.mempool, size );
|
||||
info->ptexture = (mstudiotexture_t *)(info + 1); // textures are immediately comes after remap_info
|
||||
}
|
||||
else
|
||||
@@ -314,21 +314,21 @@ void CL_AllocRemapInfo( int topcolor, int bottomcolor )
|
||||
for( i = 0; i < info->numtextures; i++ )
|
||||
{
|
||||
if( dst[i].flags & STUDIO_NF_COLORMAP )
|
||||
CL_DuplicateTexture( &dst[i], topcolor, bottomcolor );
|
||||
CL_DuplicateTexture( entity, model, &dst[i], topcolor, bottomcolor );
|
||||
}
|
||||
}
|
||||
else if( refState.currentmodel->type == mod_alias )
|
||||
else if( model->type == mod_alias )
|
||||
{
|
||||
ahdr = (aliashdr_t *)Mod_AliasExtradata( refState.currentmodel );
|
||||
ahdr = (aliashdr_t *)Mod_AliasExtradata( model );
|
||||
if( !ahdr ) return; // bad model?
|
||||
|
||||
// NOTE: we must copy all the structures 'mstudiotexture_t' for easy access when model is rendering
|
||||
if( !clgame.remap_info[i] || clgame.remap_info[i]->model != refState.currentmodel )
|
||||
if( !clgame.remap_info[i] || clgame.remap_info[i]->model != model )
|
||||
{
|
||||
// this code catches studiomodel change with another studiomodel with remap textures
|
||||
// e.g. playermodel 'barney' with playermodel 'gordon'
|
||||
if( clgame.remap_info[i] ) CL_FreeRemapInfo( clgame.remap_info[i] ); // free old info
|
||||
info = clgame.remap_info[i] = Mem_Calloc( clgame.mempool, sizeof( remap_info_t ));
|
||||
info = clgame.remap_info[i] = Mem_Calloc( clgame.mempool, sizeof( remap_info_t ));
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -336,10 +336,10 @@ void CL_AllocRemapInfo( int topcolor, int bottomcolor )
|
||||
return;
|
||||
}
|
||||
|
||||
info->numtextures = refState.currentmodel->numtextures;
|
||||
info->numtextures = model->numtextures;
|
||||
|
||||
// alias remapping is easy
|
||||
CL_UpdateRemapInfo( topcolor, bottomcolor );
|
||||
CL_UpdateRemapInfo( entity, topcolor, bottomcolor );
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -347,7 +347,7 @@ void CL_AllocRemapInfo( int topcolor, int bottomcolor )
|
||||
return;
|
||||
}
|
||||
|
||||
info->model = refState.currentmodel;
|
||||
info->model = model;
|
||||
}
|
||||
|
||||
/*
|
||||
@@ -357,12 +357,12 @@ CL_UpdateRemapInfo
|
||||
Update all remaps per entity
|
||||
====================
|
||||
*/
|
||||
void CL_UpdateRemapInfo( int topcolor, int bottomcolor )
|
||||
void CL_UpdateRemapInfo( cl_entity_t *entity, int topcolor, int bottomcolor )
|
||||
{
|
||||
remap_info_t *info;
|
||||
int i;
|
||||
|
||||
i = ( refState.currententity == &clgame.viewent ) ? clgame.maxEntities : refState.currententity->curstate.number;
|
||||
i = ( entity == &clgame.viewent ) ? clgame.maxEntities : entity->curstate.number;
|
||||
info = clgame.remap_info[i];
|
||||
if( !info ) return; // no remap info
|
||||
|
||||
@@ -374,9 +374,9 @@ void CL_UpdateRemapInfo( int topcolor, int bottomcolor )
|
||||
if( info->ptexture != NULL )
|
||||
{
|
||||
if( FBitSet( info->ptexture[i].flags, STUDIO_NF_COLORMAP ))
|
||||
CL_UpdateStudioTexture( &info->ptexture[i], topcolor, bottomcolor );
|
||||
CL_UpdateStudioTexture( entity, &info->ptexture[i], topcolor, bottomcolor );
|
||||
}
|
||||
else CL_UpdateAliasTexture( &info->textures[i], i, topcolor, bottomcolor );
|
||||
else CL_UpdateAliasTexture( entity, &info->textures[i], i, topcolor, bottomcolor );
|
||||
}
|
||||
|
||||
info->topcolor = topcolor;
|
||||
@@ -409,7 +409,7 @@ void CL_FreeRemapInfo( remap_info_t *info )
|
||||
ref.dllFuncs.GL_FreeTexture( info->textures[i] );
|
||||
}
|
||||
|
||||
Mem_Free( info ); // release struct
|
||||
Mem_Free( info ); // release struct
|
||||
}
|
||||
|
||||
/*
|
||||
@@ -428,7 +428,7 @@ void CL_ClearAllRemaps( void )
|
||||
for( i = 0; i < clgame.maxRemapInfos; i++ )
|
||||
{
|
||||
if( clgame.remap_info[i] )
|
||||
CL_FreeRemapInfo( clgame.remap_info[i] );
|
||||
CL_FreeRemapInfo( clgame.remap_info[i] );
|
||||
}
|
||||
Mem_Free( clgame.remap_info );
|
||||
}
|
||||
|
||||
@@ -117,7 +117,7 @@ static void R_EnvShot( const float *vieworg, const char *name, qboolean skyshot,
|
||||
else cls.scrshot_action = scrshot_envshot;
|
||||
|
||||
// catch negative values
|
||||
cls.envshot_viewsize = max( 0, shotsize );
|
||||
cls.envshot_viewsize = Q_max( 0, shotsize );
|
||||
}
|
||||
|
||||
/*
|
||||
@@ -252,7 +252,7 @@ static render_api_t gRenderAPI =
|
||||
NULL, // GL_TexGen,
|
||||
NULL, // GL_TextureTarget,
|
||||
NULL, // GL_SetTexCoordArrayMode,
|
||||
GL_GetProcAddress,
|
||||
NULL, // GL_GetProcAddress,
|
||||
NULL, // GL_UpdateTexSize,
|
||||
NULL,
|
||||
NULL,
|
||||
@@ -309,6 +309,7 @@ static void R_FillRenderAPIFromRef( render_api_t *to, const ref_interface_t *fro
|
||||
to->GL_DrawParticles = from->GL_DrawParticles;
|
||||
to->LightVec = from->LightVec;
|
||||
to->StudioGetTexture = from->StudioGetTexture;
|
||||
to->GL_GetProcAddress = from->R_GetProcAddress;
|
||||
}
|
||||
|
||||
/*
|
||||
|
||||
@@ -27,8 +27,11 @@ convar_t *scr_viewsize;
|
||||
convar_t *cl_testlights;
|
||||
convar_t *cl_allow_levelshots;
|
||||
convar_t *cl_levelshot_name;
|
||||
convar_t *cl_envshot_size;
|
||||
static convar_t *cl_envshot_size;
|
||||
convar_t *v_dark;
|
||||
static convar_t *net_speeds;
|
||||
static convar_t *cl_showfps;
|
||||
static convar_t *cl_showpos;
|
||||
|
||||
typedef struct
|
||||
{
|
||||
@@ -57,7 +60,7 @@ void SCR_DrawFPS( int height )
|
||||
int offset;
|
||||
|
||||
if( cls.state != ca_active || !cl_showfps->value || cl.background )
|
||||
return;
|
||||
return;
|
||||
|
||||
switch( cls.scrshot_action )
|
||||
{
|
||||
@@ -102,6 +105,41 @@ void SCR_DrawFPS( int height )
|
||||
Con_DrawString( refState.width - offset - 4, height, fpsstring, color );
|
||||
}
|
||||
|
||||
/*
|
||||
==============
|
||||
SCR_DrawPos
|
||||
|
||||
Draw local player position, angles and velocity
|
||||
==============
|
||||
*/
|
||||
void SCR_DrawPos( void )
|
||||
{
|
||||
static char msg[MAX_SYSPATH];
|
||||
float speed;
|
||||
cl_entity_t *ent;
|
||||
rgba_t color;
|
||||
|
||||
if( cls.state != ca_active || !cl_showpos->value || cl.background )
|
||||
return;
|
||||
|
||||
ent = CL_GetLocalPlayer();
|
||||
speed = VectorLength( cl.simvel );
|
||||
|
||||
Q_snprintf( msg, MAX_SYSPATH,
|
||||
"pos: %.2f %.2f %.2f\n"
|
||||
"ang: %.2f %.2f %.2f\n"
|
||||
"velocity: %.2f",
|
||||
cl.simorg[0], cl.simorg[1], cl.simorg[2],
|
||||
// should we use entity angles or viewangles?
|
||||
// view isn't always bound to player
|
||||
ent->angles[0], ent->angles[1], ent->angles[2],
|
||||
speed );
|
||||
|
||||
MakeRGBA( color, 255, 255, 255, 255 );
|
||||
|
||||
Con_DrawString( refState.width / 2, 4, msg, color );
|
||||
}
|
||||
|
||||
/*
|
||||
==============
|
||||
SCR_NetSpeeds
|
||||
@@ -145,8 +183,18 @@ void SCR_NetSpeeds( void )
|
||||
if( cur_clfps > max_clfps ) max_clfps = cur_clfps;
|
||||
}
|
||||
|
||||
Q_snprintf( msg, sizeof( msg ), "sv fps: ^1%4i min, ^3%4i cur, ^2%4i max\ncl fps: ^1%4i min, ^3%4i cur, ^2%4i max\nGame Time: %02d:%02d\nTotal received from server: %s\nTotal sent to server: %s\n",
|
||||
min_svfps, cur_svfps, max_svfps, min_clfps, cur_clfps, max_clfps, (int)(time / 60.0f ), (int)fmod( time, 60.0f ), Q_memprint( cls.netchan.total_received ), Q_memprint( cls.netchan.total_sended ));
|
||||
Q_snprintf( msg, sizeof( msg ),
|
||||
"Updaterate: ^1%2i min, ^3%2i cur, ^2%2i max\n"
|
||||
"Client FPS: ^1%i min, ^3%3i cur, ^2%3i max\n"
|
||||
"Game Time: %02d:%02d\n"
|
||||
"Total received from server: %s\n"
|
||||
"Total sent to server: %s\n",
|
||||
min_svfps, cur_svfps, max_svfps,
|
||||
min_clfps, cur_clfps, max_clfps,
|
||||
(int)(time / 60.0f ), (int)fmod( time, 60.0f ),
|
||||
Q_memprint( cls.netchan.total_received ),
|
||||
Q_memprint( cls.netchan.total_sended )
|
||||
);
|
||||
|
||||
x = refState.width - 320;
|
||||
y = 384;
|
||||
@@ -203,7 +251,7 @@ void SCR_RSpeeds( void )
|
||||
y += height;
|
||||
|
||||
// handle '\n\n'
|
||||
if( *p == '\n' )
|
||||
if( *p == '\n' )
|
||||
y += height;
|
||||
if( end ) p = end + 1;
|
||||
else break;
|
||||
@@ -306,7 +354,7 @@ void SCR_MakeScreenShot( void )
|
||||
// report
|
||||
if( iRet )
|
||||
{
|
||||
// snapshots don't writes message about image
|
||||
// snapshots don't writes message about image
|
||||
if( cls.scrshot_action != scrshot_snapshot )
|
||||
Con_Reportf( "Write %s\n", cls.shotname );
|
||||
}
|
||||
@@ -342,17 +390,18 @@ SCR_BeginLoadingPlaque
|
||||
*/
|
||||
void SCR_BeginLoadingPlaque( qboolean is_background )
|
||||
{
|
||||
float oldclear;
|
||||
|
||||
float oldclear = 0;;
|
||||
S_StopAllSounds( true );
|
||||
cl.audio_prepped = false; // don't play ambients
|
||||
cl.video_prepped = false;
|
||||
oldclear = gl_clear->value;
|
||||
|
||||
if( !Host_IsDedicated() )
|
||||
oldclear = gl_clear->value;
|
||||
|
||||
if( CL_IsInMenu( ) && !cls.changedemo && !is_background )
|
||||
{
|
||||
UI_SetActiveMenu( false );
|
||||
if( cls.state == ca_disconnected )
|
||||
if( cls.state == ca_disconnected && !(GameState->curstate == STATE_RUNFRAME && GameState->nextstate != STATE_RUNFRAME) )
|
||||
SCR_UpdateScreen();
|
||||
}
|
||||
|
||||
@@ -362,14 +411,19 @@ void SCR_BeginLoadingPlaque( qboolean is_background )
|
||||
if( cls.key_dest == key_console )
|
||||
return;
|
||||
|
||||
gl_clear->value = 0.0f;
|
||||
if( !Host_IsDedicated() )
|
||||
gl_clear->value = 0.0f;
|
||||
|
||||
if( is_background ) IN_MouseSavePos( );
|
||||
cls.draw_changelevel = !is_background;
|
||||
SCR_UpdateScreen();
|
||||
cls.disable_screen = host.realtime;
|
||||
cls.disable_servercount = cl.servercount;
|
||||
cl.background = is_background; // set right state before svc_serverdata is came
|
||||
gl_clear->value = oldclear;
|
||||
|
||||
if( !Host_IsDedicated() )
|
||||
gl_clear->value = oldclear;
|
||||
|
||||
// SNDDMA_LockSound();
|
||||
}
|
||||
|
||||
@@ -455,7 +509,7 @@ void SCR_TileClear( void )
|
||||
right = left + clgame.viewport[2] - 1;
|
||||
|
||||
if( clear.y1 < top )
|
||||
{
|
||||
{
|
||||
// clear above view screen
|
||||
i = clear.y2 < top-1 ? clear.y2 : top - 1;
|
||||
ref.dllFuncs.R_DrawTileClear( cls.tileImage, clear.x1, clear.y1, clear.x2 - clear.x1 + 1, i - clear.y1 + 1 );
|
||||
@@ -463,7 +517,7 @@ void SCR_TileClear( void )
|
||||
}
|
||||
|
||||
if( clear.y2 > bottom )
|
||||
{
|
||||
{
|
||||
// clear below view screen
|
||||
i = clear.y1 > bottom + 1 ? clear.y1 : bottom + 1;
|
||||
ref.dllFuncs.R_DrawTileClear( cls.tileImage, clear.x1, i, clear.x2 - clear.x1 + 1, clear.y2 - i + 1 );
|
||||
@@ -479,7 +533,7 @@ void SCR_TileClear( void )
|
||||
}
|
||||
|
||||
if( clear.x2 > right )
|
||||
{
|
||||
{
|
||||
// clear left of view screen
|
||||
i = clear.x1 > right + 1 ? clear.x1 : right + 1;
|
||||
ref.dllFuncs.R_DrawTileClear( cls.tileImage, i, clear.y1, clear.x2 - i + 1, clear.y2 - clear.y1 + 1 );
|
||||
@@ -572,7 +626,7 @@ qboolean SCR_LoadVariableWidthFont( const char *fontname )
|
||||
// half-life font with variable chars witdh
|
||||
buffer = FS_LoadFile( fontname, &length, false );
|
||||
|
||||
// setup creditsfont
|
||||
// setup creditsfont
|
||||
if( buffer && length >= sizeof( qfont_t ))
|
||||
{
|
||||
src = (qfont_t *)buffer;
|
||||
@@ -691,7 +745,7 @@ void SCR_RegisterTextures( void )
|
||||
cls.loadingBar = ref.dllFuncs.GL_LoadTexture( "gfx/loading.lmp", NULL, 0, TF_IMAGE|TF_LUMINANCE );
|
||||
else cls.loadingBar = ref.dllFuncs.GL_LoadTexture( "gfx/loading.lmp", NULL, 0, TF_IMAGE );
|
||||
}
|
||||
|
||||
|
||||
cls.tileImage = ref.dllFuncs.GL_LoadTexture( "gfx/backtile.lmp", NULL, 0, TF_NOMIPMAP );
|
||||
}
|
||||
|
||||
@@ -727,6 +781,7 @@ SCR_VidInit
|
||||
*/
|
||||
void SCR_VidInit( void )
|
||||
{
|
||||
string libpath;
|
||||
if( !ref.initialized ) // don't call VidInit too soon
|
||||
return;
|
||||
|
||||
@@ -741,10 +796,11 @@ void SCR_VidInit( void )
|
||||
gameui.globals->scrHeight = refState.height;
|
||||
}
|
||||
|
||||
VGui_Startup( NULL, refState.width, refState.height ); // initialized already, so pass NULL
|
||||
COM_GetCommonLibraryPath( LIBRARY_CLIENT, libpath, sizeof( libpath ));
|
||||
VGui_Startup( libpath, refState.width, refState.height );
|
||||
|
||||
CL_ClearSpriteTextures(); // now all hud sprites are invalid
|
||||
|
||||
|
||||
// vid_state has changed
|
||||
if( gameui.hInstance ) gameui.dllFuncs.pfnVidInit();
|
||||
if( clgame.hInstance ) clgame.dllFuncs.pfnVidInit();
|
||||
@@ -771,7 +827,10 @@ void SCR_Init( void )
|
||||
cl_envshot_size = Cvar_Get( "cl_envshot_size", "256", FCVAR_ARCHIVE, "envshot size of cube side" );
|
||||
v_dark = Cvar_Get( "v_dark", "0", 0, "starts level from dark screen" );
|
||||
scr_viewsize = Cvar_Get( "viewsize", "120", FCVAR_ARCHIVE, "screen size" );
|
||||
|
||||
net_speeds = Cvar_Get( "net_speeds", "0", FCVAR_ARCHIVE, "show network packets" );
|
||||
cl_showfps = Cvar_Get( "cl_showfps", "1", FCVAR_ARCHIVE, "show client fps" );
|
||||
cl_showpos = Cvar_Get( "cl_showpos", "0", FCVAR_ARCHIVE, "show local player position and velocity" );
|
||||
|
||||
// register our commands
|
||||
Cmd_AddCommand( "skyname", CL_SetSky_f, "set new skybox by basename" );
|
||||
Cmd_AddCommand( "loadsky", CL_SetSky_f, "set new skybox by basename" );
|
||||
|
||||
460
engine/client/cl_securedstub.c
Normal file
460
engine/client/cl_securedstub.c
Normal file
@@ -0,0 +1,460 @@
|
||||
/*
|
||||
cl_securedstub.c - secured client dll stub
|
||||
Copyright (C) 2022 FWGS
|
||||
|
||||
This program 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 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
This program 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.
|
||||
*/
|
||||
|
||||
#include "common.h"
|
||||
#include "client.h"
|
||||
|
||||
typedef struct cldll_func_src_s
|
||||
{
|
||||
int (*pfnInitialize)( cl_enginefunc_t *pEnginefuncs, int iVersion );
|
||||
void (*pfnInit)( void );
|
||||
int (*pfnVidInit)( void );
|
||||
int (*pfnRedraw)( float flTime, int intermission );
|
||||
int (*pfnUpdateClientData)( client_data_t *cdata, float flTime );
|
||||
void (*pfnReset)( void );
|
||||
void (*pfnPlayerMove)( struct playermove_s *ppmove, int server );
|
||||
void (*pfnPlayerMoveInit)( struct playermove_s *ppmove );
|
||||
char (*pfnPlayerMoveTexture)( char *name );
|
||||
void (*IN_ActivateMouse)( void );
|
||||
void (*IN_DeactivateMouse)( void );
|
||||
void (*IN_MouseEvent)( int mstate );
|
||||
void (*IN_ClearStates)( void );
|
||||
void (*IN_Accumulate)( void );
|
||||
void (*CL_CreateMove)( float frametime, struct usercmd_s *cmd, int active );
|
||||
int (*CL_IsThirdPerson)( void );
|
||||
void (*CL_CameraOffset)( float *ofs ); // unused
|
||||
void *(*KB_Find)( const char *name );
|
||||
void (*CAM_Think)( void ); // camera stuff
|
||||
void (*pfnCalcRefdef)( ref_params_t *pparams );
|
||||
int (*pfnAddEntity)( int type, cl_entity_t *ent, const char *modelname );
|
||||
void (*pfnCreateEntities)( void );
|
||||
void (*pfnDrawNormalTriangles)( void );
|
||||
void (*pfnDrawTransparentTriangles)( void );
|
||||
void (*pfnStudioEvent)( const struct mstudioevent_s *event, const cl_entity_t *entity );
|
||||
void (*pfnPostRunCmd)( struct local_state_s *from, struct local_state_s *to, usercmd_t *cmd, int runfuncs, double time, unsigned int random_seed );
|
||||
void (*pfnShutdown)( void );
|
||||
void (*pfnTxferLocalOverrides)( entity_state_t *state, const clientdata_t *client );
|
||||
void (*pfnProcessPlayerState)( entity_state_t *dst, const entity_state_t *src );
|
||||
void (*pfnTxferPredictionData)( entity_state_t *ps, const entity_state_t *pps, clientdata_t *pcd, const clientdata_t *ppcd, weapon_data_t *wd, const weapon_data_t *pwd );
|
||||
void (*pfnDemo_ReadBuffer)( int size, byte *buffer );
|
||||
int (*pfnConnectionlessPacket)( const struct netadr_s *net_from, const char *args, char *buffer, int *size );
|
||||
int (*pfnGetHullBounds)( int hullnumber, float *mins, float *maxs );
|
||||
void (*pfnFrame)( double time );
|
||||
int (*pfnKey_Event)( int eventcode, int keynum, const char *pszCurrentBinding );
|
||||
void (*pfnTempEntUpdate)( double frametime, double client_time, double cl_gravity, struct tempent_s **ppTempEntFree, struct tempent_s **ppTempEntActive, int ( *Callback_AddVisibleEntity )( cl_entity_t *pEntity ), void ( *Callback_TempEntPlaySound )( struct tempent_s *pTemp, float damp ));
|
||||
cl_entity_t *(*pfnGetUserEntity)( int index );
|
||||
void (*pfnVoiceStatus)( int entindex, qboolean bTalking );
|
||||
void (*pfnDirectorMessage)( int iSize, void *pbuf );
|
||||
int (*pfnGetStudioModelInterface)( int version, struct r_studio_interface_s **ppinterface, struct engine_studio_api_s *pstudio );
|
||||
void (*pfnChatInputPosition)( int *x, int *y );
|
||||
int (*pfnGetPlayerTeam)( int iPlayer );
|
||||
void *(*pfnClientFactory)( void );
|
||||
} cldll_func_src_t;
|
||||
|
||||
typedef struct cldll_func_dst_s
|
||||
{
|
||||
void (*pfnInitialize)( cl_enginefunc_t **pEnginefuncs, int *iVersion );
|
||||
void (*pfnInit)( void );
|
||||
void (*pfnVidInit)( void );
|
||||
void (*pfnRedraw)( float *flTime, int *intermission );
|
||||
void (*pfnUpdateClientData)( client_data_t **cdata, float *flTime );
|
||||
void (*pfnReset)( void );
|
||||
void (*pfnPlayerMove)( struct playermove_s **ppmove, int *server );
|
||||
void (*pfnPlayerMoveInit)( struct playermove_s **ppmove );
|
||||
void (*pfnPlayerMoveTexture)( char **name );
|
||||
void (*IN_ActivateMouse)( void );
|
||||
void (*IN_DeactivateMouse)( void );
|
||||
void (*IN_MouseEvent)( int *mstate );
|
||||
void (*IN_ClearStates)( void );
|
||||
void (*IN_Accumulate)( void );
|
||||
void (*CL_CreateMove)( float *frametime, struct usercmd_s **cmd, int *active );
|
||||
void (*CL_IsThirdPerson)( void );
|
||||
void (*CL_CameraOffset)( float **ofs );
|
||||
void (*KB_Find)( const char **name );
|
||||
void (*CAM_Think)( void );
|
||||
void (*pfnCalcRefdef)( ref_params_t **pparams );
|
||||
void (*pfnAddEntity)( int *type, cl_entity_t **ent, const char **modelname );
|
||||
void (*pfnCreateEntities)( void );
|
||||
void (*pfnDrawNormalTriangles)( void );
|
||||
void (*pfnDrawTransparentTriangles)( void );
|
||||
void (*pfnStudioEvent)( const struct mstudioevent_s **event, const cl_entity_t **entity );
|
||||
void (*pfnPostRunCmd)( struct local_state_s **from, struct local_state_s **to, usercmd_t **cmd, int *runfuncs, double *time, unsigned int *random_seed );
|
||||
void (*pfnShutdown)( void );
|
||||
void (*pfnTxferLocalOverrides)( entity_state_t **state, const clientdata_t **client );
|
||||
void (*pfnProcessPlayerState)( entity_state_t **dst, const entity_state_t **src );
|
||||
void (*pfnTxferPredictionData)( entity_state_t **ps, const entity_state_t **pps, clientdata_t **pcd, const clientdata_t **ppcd, weapon_data_t **wd, const weapon_data_t **pwd );
|
||||
void (*pfnDemo_ReadBuffer)( int *size, byte **buffer );
|
||||
void (*pfnConnectionlessPacket)( const struct netadr_s **net_from, const char **args, char **buffer, int **size );
|
||||
void (*pfnGetHullBounds)( int *hullnumber, float **mins, float **maxs );
|
||||
void (*pfnFrame)( double *time );
|
||||
void (*pfnKey_Event)( int *eventcode, int *keynum, const char **pszCurrentBinding );
|
||||
void (*pfnTempEntUpdate)( double *frametime, double *client_time, double *cl_gravity, struct tempent_s ***ppTempEntFree, struct tempent_s ***ppTempEntActive, int ( **Callback_AddVisibleEntity )( cl_entity_t *pEntity ), void ( **Callback_TempEntPlaySound )( struct tempent_s *pTemp, float damp ));
|
||||
void (*pfnGetUserEntity)( int *index );
|
||||
void (*pfnVoiceStatus)( int *entindex, qboolean *bTalking );
|
||||
void (*pfnDirectorMessage)( int *iSize, void **pbuf );
|
||||
void (*pfnGetStudioModelInterface)( int *version, struct r_studio_interface_s ***ppinterface, struct engine_studio_api_s **pstudio );
|
||||
void (*pfnChatInputPosition)( int **x, int **y );
|
||||
void (*pfnGetPlayerTeam)( int *iPlayer );
|
||||
} cldll_func_dst_t;
|
||||
|
||||
struct cl_enginefunc_dst_s;
|
||||
struct modshelpers_s;
|
||||
struct modchelpers_s;
|
||||
struct engdata_s;
|
||||
|
||||
typedef struct modfuncs_s
|
||||
{
|
||||
void (*m_pfnLoadMod)( char *pchModule );
|
||||
void (*m_pfnCloseMod)( void );
|
||||
int (*m_pfnNCall)( int ijump, int cnArg, ... );
|
||||
void (*m_pfnGetClDstAddrs)( cldll_func_dst_t *pcldstAddrs );
|
||||
void (*m_pfnGetEngDstAddrs)( struct cl_enginefunc_dst_s *pengdstAddrs );
|
||||
void (*m_pfnModuleLoaded)( void );
|
||||
void (*m_pfnProcessOutgoingNet)( struct netchan_s *pchan, struct sizebuf_s *psizebuf );
|
||||
qboolean (*m_pfnProcessIncomingNet)( struct netchan_s *pchan, struct sizebuf_s *psizebuf );
|
||||
void (*m_pfnTextureLoad)( char *pszName, int dxWidth, int dyHeight, char *pbData );
|
||||
void (*m_pfnModelLoad)( struct model_s *pmodel, void *pvBuf );
|
||||
void (*m_pfnFrameBegin)( void );
|
||||
void (*m_pfnFrameRender1)( void );
|
||||
void (*m_pfnFrameRender2)( void );
|
||||
void (*m_pfnSetModSHelpers)( struct modshelpers_s *pmodshelpers );
|
||||
void (*m_pfnSetModCHelpers)( struct modchelpers_s *pmodchelpers );
|
||||
void (*m_pfnSetEngData)( struct engdata_s *pengdata );
|
||||
int m_nVersion;
|
||||
void (*m_pfnConnectClient)( int iPlayer );
|
||||
void (*m_pfnRecordIP)( unsigned int pnIP );
|
||||
void (*m_pfnPlayerStatus)( unsigned char *pbData, int cbData );
|
||||
void (*m_pfnSetEngineVersion)( int nVersion );
|
||||
int m_nVoid2;
|
||||
int m_nVoid3;
|
||||
int m_nVoid4;
|
||||
int m_nVoid5;
|
||||
int m_nVoid6;
|
||||
int m_nVoid7;
|
||||
int m_nVoid8;
|
||||
int m_nVoid9;
|
||||
} modfuncs_t;
|
||||
|
||||
static void DstInitialize( cl_enginefunc_t **pEnginefuncs, int *iVersion )
|
||||
{
|
||||
// stub
|
||||
}
|
||||
|
||||
static void DstInit( void )
|
||||
{
|
||||
// stub
|
||||
}
|
||||
|
||||
static void DstVidInit( void )
|
||||
{
|
||||
// stub
|
||||
}
|
||||
|
||||
static void DstRedraw( float *flTime, int *intermission )
|
||||
{
|
||||
// stub
|
||||
}
|
||||
|
||||
static void DstUpdateClientData( client_data_t **cdata, float *flTime )
|
||||
{
|
||||
// stub
|
||||
}
|
||||
|
||||
static void DstReset( void )
|
||||
{
|
||||
// stub
|
||||
}
|
||||
|
||||
static void DstPlayerMove( struct playermove_s **ppmove, int *server )
|
||||
{
|
||||
// stub
|
||||
}
|
||||
|
||||
static void DstPlayerMoveInit( struct playermove_s **ppmove )
|
||||
{
|
||||
// stub
|
||||
}
|
||||
|
||||
static void DstPlayerMoveTexture( char **name )
|
||||
{
|
||||
// stub
|
||||
}
|
||||
|
||||
static void DstIN_ActivateMouse( void )
|
||||
{
|
||||
// stub
|
||||
}
|
||||
|
||||
static void DstIN_DeactivateMouse( void )
|
||||
{
|
||||
// stub
|
||||
}
|
||||
|
||||
static void DstIN_MouseEvent( int *mstate )
|
||||
{
|
||||
// stub
|
||||
}
|
||||
|
||||
static void DstIN_ClearStates( void )
|
||||
{
|
||||
// stub
|
||||
}
|
||||
|
||||
static void DstIN_Accumulate( void )
|
||||
{
|
||||
// stub
|
||||
}
|
||||
|
||||
static void DstCL_CreateMove( float *frametime, struct usercmd_s **cmd, int *active )
|
||||
{
|
||||
// stub
|
||||
}
|
||||
|
||||
static void DstCL_IsThirdPerson( void )
|
||||
{
|
||||
// stub
|
||||
}
|
||||
|
||||
static void DstCL_CameraOffset( float **ofs )
|
||||
{
|
||||
// stub
|
||||
}
|
||||
|
||||
static void DstKB_Find( const char **name )
|
||||
{
|
||||
// stub
|
||||
}
|
||||
|
||||
static void DstCAM_Think( void )
|
||||
{
|
||||
// stub
|
||||
}
|
||||
|
||||
static void DstCalcRefdef( ref_params_t **pparams )
|
||||
{
|
||||
// stub
|
||||
}
|
||||
|
||||
static void DstAddEntity( int *type, cl_entity_t **ent, const char **modelname )
|
||||
{
|
||||
// stub
|
||||
}
|
||||
|
||||
static void DstCreateEntities( void )
|
||||
{
|
||||
// stub
|
||||
}
|
||||
|
||||
static void DstDrawNormalTriangles( void )
|
||||
{
|
||||
// stub
|
||||
}
|
||||
|
||||
static void DstDrawTransparentTriangles( void )
|
||||
{
|
||||
// stub
|
||||
}
|
||||
|
||||
static void DstStudioEvent( const struct mstudioevent_s **event, const cl_entity_t **entity )
|
||||
{
|
||||
// stub
|
||||
}
|
||||
|
||||
static void DstPostRunCmd( struct local_state_s **from, struct local_state_s **to, usercmd_t **cmd, int *runfuncs, double *time, unsigned int *random_seed )
|
||||
{
|
||||
// stub
|
||||
}
|
||||
|
||||
static void DstShutdown( void )
|
||||
{
|
||||
// stub
|
||||
}
|
||||
|
||||
static void DstTxferLocalOverrides( entity_state_t **state, const clientdata_t **client )
|
||||
{
|
||||
// stub
|
||||
}
|
||||
|
||||
static void DstProcessPlayerState( entity_state_t **dst, const entity_state_t **src )
|
||||
{
|
||||
// stub
|
||||
}
|
||||
|
||||
static void DstTxferPredictionData( entity_state_t **ps, const entity_state_t **pps, clientdata_t **pcd, const clientdata_t **ppcd, weapon_data_t **wd, const weapon_data_t **pwd )
|
||||
{
|
||||
// stub
|
||||
}
|
||||
|
||||
static void DstDemo_ReadBuffer( int *size, byte **buffer )
|
||||
{
|
||||
// stub
|
||||
}
|
||||
|
||||
static void DstConnectionlessPacket( const struct netadr_s **net_from, const char **args, char **buffer, int **size )
|
||||
{
|
||||
// stub
|
||||
}
|
||||
|
||||
static void DstGetHullBounds( int *hullnumber, float **mins, float **maxs )
|
||||
{
|
||||
// stub
|
||||
}
|
||||
|
||||
static void DstFrame( double *time )
|
||||
{
|
||||
// stub
|
||||
}
|
||||
|
||||
static void DstKey_Event( int *eventcode, int *keynum, const char **pszCurrentBinding )
|
||||
{
|
||||
// stub
|
||||
}
|
||||
|
||||
static void DstTempEntUpdate( double *frametime, double *client_time, double *cl_gravity, struct tempent_s ***ppTempEntFree, struct tempent_s ***ppTempEntActive, int ( **Callback_AddVisibleEntity )( cl_entity_t *pEntity ), void ( **Callback_TempEntPlaySound )( struct tempent_s *pTemp, float damp ) )
|
||||
{
|
||||
// stub
|
||||
}
|
||||
|
||||
static void DstGetUserEntity( int *index )
|
||||
{
|
||||
// stub
|
||||
}
|
||||
|
||||
static void DstVoiceStatus( int *entindex, qboolean *bTalking )
|
||||
{
|
||||
// stub
|
||||
}
|
||||
|
||||
static void DstDirectorMessage( int *iSize, void **pbuf )
|
||||
{
|
||||
// stub
|
||||
}
|
||||
|
||||
static void DstGetStudioModelInterface( int *version, struct r_studio_interface_s ***ppinterface, struct engine_studio_api_s **pstudio )
|
||||
{
|
||||
// stub
|
||||
}
|
||||
|
||||
static void DstChatInputPosition( int **x, int **y )
|
||||
{
|
||||
// stub
|
||||
}
|
||||
|
||||
static void DstGetPlayerTeam( int *iPlayer )
|
||||
{
|
||||
// stub
|
||||
}
|
||||
|
||||
static cldll_func_dst_t cldllFuncDst =
|
||||
{
|
||||
DstInitialize,
|
||||
DstInit,
|
||||
DstVidInit,
|
||||
DstRedraw,
|
||||
DstUpdateClientData,
|
||||
DstReset,
|
||||
DstPlayerMove,
|
||||
DstPlayerMoveInit,
|
||||
DstPlayerMoveTexture,
|
||||
DstIN_ActivateMouse,
|
||||
DstIN_DeactivateMouse,
|
||||
DstIN_MouseEvent,
|
||||
DstIN_ClearStates,
|
||||
DstIN_Accumulate,
|
||||
DstCL_CreateMove,
|
||||
DstCL_IsThirdPerson,
|
||||
DstCL_CameraOffset,
|
||||
DstKB_Find,
|
||||
DstCAM_Think,
|
||||
DstCalcRefdef,
|
||||
DstAddEntity,
|
||||
DstCreateEntities,
|
||||
DstDrawNormalTriangles,
|
||||
DstDrawTransparentTriangles,
|
||||
DstStudioEvent,
|
||||
DstPostRunCmd,
|
||||
DstShutdown,
|
||||
DstTxferLocalOverrides,
|
||||
DstProcessPlayerState,
|
||||
DstTxferPredictionData,
|
||||
DstDemo_ReadBuffer,
|
||||
DstConnectionlessPacket,
|
||||
DstGetHullBounds,
|
||||
DstFrame,
|
||||
DstKey_Event,
|
||||
DstTempEntUpdate,
|
||||
DstGetUserEntity,
|
||||
DstVoiceStatus,
|
||||
DstDirectorMessage,
|
||||
DstGetStudioModelInterface,
|
||||
DstChatInputPosition,
|
||||
DstGetPlayerTeam,
|
||||
};
|
||||
|
||||
void CL_GetSecuredClientAPI( CL_EXPORT_FUNCS F )
|
||||
{
|
||||
cldll_func_src_t cldllFuncSrc = { 0 };
|
||||
modfuncs_t modFuncs = { 0 };
|
||||
|
||||
// secured client dlls need these
|
||||
*(cldll_func_dst_t **)&cldllFuncSrc.pfnVidInit = &cldllFuncDst;
|
||||
*(modfuncs_t **)&cldllFuncSrc.pfnInitialize = &modFuncs;
|
||||
|
||||
// trying to fill interface now
|
||||
F( &cldllFuncSrc );
|
||||
|
||||
// map exports to xash's cldll_func_t
|
||||
clgame.dllFuncs.pfnInitialize = cldllFuncSrc.pfnInitialize;
|
||||
clgame.dllFuncs.pfnInit = cldllFuncSrc.pfnInit;
|
||||
clgame.dllFuncs.pfnVidInit = cldllFuncSrc.pfnVidInit;
|
||||
clgame.dllFuncs.pfnRedraw = cldllFuncSrc.pfnRedraw;
|
||||
clgame.dllFuncs.pfnUpdateClientData = cldllFuncSrc.pfnUpdateClientData;
|
||||
clgame.dllFuncs.pfnReset = cldllFuncSrc.pfnReset;
|
||||
clgame.dllFuncs.pfnPlayerMove = cldllFuncSrc.pfnPlayerMove;
|
||||
clgame.dllFuncs.pfnPlayerMoveInit = cldllFuncSrc.pfnPlayerMoveInit;
|
||||
clgame.dllFuncs.pfnPlayerMoveTexture = cldllFuncSrc.pfnPlayerMoveTexture;
|
||||
clgame.dllFuncs.IN_ActivateMouse = cldllFuncSrc.IN_ActivateMouse;
|
||||
clgame.dllFuncs.IN_DeactivateMouse = cldllFuncSrc.IN_DeactivateMouse;
|
||||
clgame.dllFuncs.IN_MouseEvent = cldllFuncSrc.IN_MouseEvent;
|
||||
clgame.dllFuncs.IN_ClearStates = cldllFuncSrc.IN_ClearStates;
|
||||
clgame.dllFuncs.IN_Accumulate = cldllFuncSrc.IN_Accumulate;
|
||||
clgame.dllFuncs.CL_CreateMove = cldllFuncSrc.CL_CreateMove;
|
||||
clgame.dllFuncs.CL_IsThirdPerson = cldllFuncSrc.CL_IsThirdPerson;
|
||||
clgame.dllFuncs.CL_CameraOffset = cldllFuncSrc.CL_CameraOffset;
|
||||
clgame.dllFuncs.KB_Find = cldllFuncSrc.KB_Find;
|
||||
clgame.dllFuncs.CAM_Think = cldllFuncSrc.CAM_Think;
|
||||
clgame.dllFuncs.pfnCalcRefdef = cldllFuncSrc.pfnCalcRefdef;
|
||||
clgame.dllFuncs.pfnAddEntity = cldllFuncSrc.pfnAddEntity;
|
||||
clgame.dllFuncs.pfnCreateEntities = cldllFuncSrc.pfnCreateEntities;
|
||||
clgame.dllFuncs.pfnDrawNormalTriangles = cldllFuncSrc.pfnDrawNormalTriangles;
|
||||
clgame.dllFuncs.pfnDrawTransparentTriangles = cldllFuncSrc.pfnDrawTransparentTriangles;
|
||||
clgame.dllFuncs.pfnStudioEvent = cldllFuncSrc.pfnStudioEvent;
|
||||
clgame.dllFuncs.pfnPostRunCmd = cldllFuncSrc.pfnPostRunCmd;
|
||||
clgame.dllFuncs.pfnShutdown = cldllFuncSrc.pfnShutdown;
|
||||
clgame.dllFuncs.pfnTxferLocalOverrides = cldllFuncSrc.pfnTxferLocalOverrides;
|
||||
clgame.dllFuncs.pfnProcessPlayerState = cldllFuncSrc.pfnProcessPlayerState;
|
||||
clgame.dllFuncs.pfnTxferPredictionData = cldllFuncSrc.pfnTxferPredictionData;
|
||||
clgame.dllFuncs.pfnDemo_ReadBuffer = cldllFuncSrc.pfnDemo_ReadBuffer;
|
||||
clgame.dllFuncs.pfnConnectionlessPacket = cldllFuncSrc.pfnConnectionlessPacket;
|
||||
clgame.dllFuncs.pfnGetHullBounds = cldllFuncSrc.pfnGetHullBounds;
|
||||
clgame.dllFuncs.pfnFrame = cldllFuncSrc.pfnFrame;
|
||||
clgame.dllFuncs.pfnKey_Event = cldllFuncSrc.pfnKey_Event;
|
||||
clgame.dllFuncs.pfnTempEntUpdate = cldllFuncSrc.pfnTempEntUpdate;
|
||||
clgame.dllFuncs.pfnGetUserEntity = cldllFuncSrc.pfnGetUserEntity;
|
||||
clgame.dllFuncs.pfnVoiceStatus = cldllFuncSrc.pfnVoiceStatus;
|
||||
clgame.dllFuncs.pfnDirectorMessage = cldllFuncSrc.pfnDirectorMessage;
|
||||
clgame.dllFuncs.pfnGetStudioModelInterface = cldllFuncSrc.pfnGetStudioModelInterface;
|
||||
clgame.dllFuncs.pfnChatInputPosition = cldllFuncSrc.pfnChatInputPosition;
|
||||
}
|
||||
@@ -163,7 +163,7 @@ void CL_AddClientResources( void )
|
||||
// then check sounds
|
||||
for( i = 0; i < ARRAYSIZE( cl_player_shell_sounds ); i++ )
|
||||
{
|
||||
Q_snprintf( filepath, sizeof( filepath ), "%s%s", DEFAULT_SOUNDPATH, cl_player_shell_sounds[i] );
|
||||
Q_snprintf( filepath, sizeof( filepath ), DEFAULT_SOUNDPATH "%s", cl_player_shell_sounds[i] );
|
||||
|
||||
if( !FS_FileExists( filepath, false ))
|
||||
CL_AddClientResource( cl_player_shell_sounds[i], t_sound );
|
||||
@@ -171,7 +171,7 @@ void CL_AddClientResources( void )
|
||||
|
||||
for( i = 0; i < ARRAYSIZE( cl_weapon_shell_sounds ); i++ )
|
||||
{
|
||||
Q_snprintf( filepath, sizeof( filepath ), "%s%s", DEFAULT_SOUNDPATH, cl_weapon_shell_sounds[i] );
|
||||
Q_snprintf( filepath, sizeof( filepath ), DEFAULT_SOUNDPATH "%s", cl_weapon_shell_sounds[i] );
|
||||
|
||||
if( !FS_FileExists( filepath, false ))
|
||||
CL_AddClientResource( cl_weapon_shell_sounds[i], t_sound );
|
||||
@@ -179,7 +179,7 @@ void CL_AddClientResources( void )
|
||||
|
||||
for( i = 0; i < ARRAYSIZE( cl_explode_sounds ); i++ )
|
||||
{
|
||||
Q_snprintf( filepath, sizeof( filepath ), "%s%s", DEFAULT_SOUNDPATH, cl_explode_sounds[i] );
|
||||
Q_snprintf( filepath, sizeof( filepath ), DEFAULT_SOUNDPATH "%s", cl_explode_sounds[i] );
|
||||
|
||||
if( !FS_FileExists( filepath, false ))
|
||||
CL_AddClientResource( cl_explode_sounds[i], t_sound );
|
||||
@@ -188,7 +188,7 @@ void CL_AddClientResources( void )
|
||||
#if 0 // ric sounds was precached by server-side
|
||||
for( i = 0; i < ARRAYSIZE( cl_ricochet_sounds ); i++ )
|
||||
{
|
||||
Q_snprintf( filepath, sizeof( filepath ), "%s%s", DEFAULT_SOUNDPATH, cl_ricochet_sounds[i] );
|
||||
Q_snprintf( filepath, sizeof( filepath ), DEFAULT_SOUNDPATH "%s", cl_ricochet_sounds[i] );
|
||||
|
||||
if( !FS_FileExists( filepath, false ))
|
||||
CL_AddClientResource( cl_ricochet_sounds[i], t_sound );
|
||||
@@ -265,7 +265,7 @@ void CL_PrepareTEnt( TEMPENTITY *pTemp, model_t *pmodel )
|
||||
|
||||
// use these to set per-frame and termination conditions / actions
|
||||
pTemp->entity.trivial_accept = modelHandle; // keep unchanged
|
||||
pTemp->flags = FTENT_NONE;
|
||||
pTemp->flags = FTENT_NONE;
|
||||
pTemp->die = cl.time + 0.75f;
|
||||
|
||||
if( pmodel ) frameCount = pmodel->numframes;
|
||||
@@ -322,15 +322,15 @@ void CL_TempEntPlaySound( TEMPENTITY *pTemp, float damp )
|
||||
Q_snprintf( soundname, sizeof( soundname ), "debris/wood%i.wav", COM_RandomLong( 1, 4 ));
|
||||
break;
|
||||
case BOUNCE_SHRAP:
|
||||
Q_snprintf( soundname, sizeof( soundname ), "%s", cl_ricochet_sounds[COM_RandomLong( 0, 4 )] );
|
||||
Q_strncpy( soundname, cl_ricochet_sounds[COM_RandomLong( 0, 4 )], sizeof( soundname ) );
|
||||
break;
|
||||
case BOUNCE_SHOTSHELL:
|
||||
Q_snprintf( soundname, sizeof( soundname ), "%s", cl_weapon_shell_sounds[COM_RandomLong( 0, 2 )] );
|
||||
Q_strncpy( soundname, cl_weapon_shell_sounds[COM_RandomLong( 0, 2 )], sizeof( soundname ) );
|
||||
isshellcasing = true; // shell casings have different playback parameters
|
||||
fvol = 0.5f;
|
||||
break;
|
||||
case BOUNCE_SHELL:
|
||||
Q_snprintf( soundname, sizeof( soundname ), "%s", cl_player_shell_sounds[COM_RandomLong( 0, 2 )] );
|
||||
Q_strncpy( soundname, cl_player_shell_sounds[COM_RandomLong( 0, 2 )], sizeof( soundname ) );
|
||||
isshellcasing = true; // shell casings have different playback parameters
|
||||
break;
|
||||
case BOUNCE_CONCRETE:
|
||||
@@ -341,17 +341,17 @@ void CL_TempEntPlaySound( TEMPENTITY *pTemp, float damp )
|
||||
}
|
||||
|
||||
zvel = abs( pTemp->entity.baseline.origin[2] );
|
||||
|
||||
|
||||
// only play one out of every n
|
||||
if( isshellcasing )
|
||||
{
|
||||
// play first bounce, then 1 out of 3
|
||||
{
|
||||
// play first bounce, then 1 out of 3
|
||||
if( zvel < 200 && COM_RandomLong( 0, 3 ))
|
||||
return;
|
||||
}
|
||||
else
|
||||
{
|
||||
if( COM_RandomLong( 0, 5 ))
|
||||
if( COM_RandomLong( 0, 5 ))
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -359,11 +359,11 @@ void CL_TempEntPlaySound( TEMPENTITY *pTemp, float damp )
|
||||
{
|
||||
int pitch;
|
||||
sound_t handle;
|
||||
|
||||
|
||||
if( isshellcasing )
|
||||
fvol *= min ( 1.0f, ((float)zvel) / 350.0f );
|
||||
else fvol *= min ( 1.0f, ((float)zvel) / 450.0f );
|
||||
|
||||
fvol *= Q_min( 1.0f, ((float)zvel) / 350.0f );
|
||||
else fvol *= Q_min( 1.0f, ((float)zvel) / 450.0f );
|
||||
|
||||
if( !COM_RandomLong( 0, 3 ) && !isshellcasing )
|
||||
pitch = COM_RandomLong( 95, 105 );
|
||||
else pitch = PITCH_NORM;
|
||||
@@ -399,7 +399,7 @@ int CL_TempEntAddEntity( cl_entity_t *pEntity )
|
||||
VectorCopy( pEntity->origin, pEntity->curstate.origin );
|
||||
VectorCopy( pEntity->angles, pEntity->latched.prevangles );
|
||||
VectorCopy( pEntity->origin, pEntity->latched.prevorigin );
|
||||
|
||||
|
||||
// add to list
|
||||
CL_AddVisibleEntity( pEntity, ET_TEMPENTITY );
|
||||
|
||||
@@ -503,7 +503,7 @@ TEMPENTITY *CL_TempEntAllocHigh( const vec3_t org, model_t *pmodel )
|
||||
|
||||
if( !cl_free_tents )
|
||||
{
|
||||
// no temporary ents free, so find the first active low-priority temp ent
|
||||
// no temporary ents free, so find the first active low-priority temp ent
|
||||
// and overwrite it.
|
||||
CL_FreeLowPriorityTempEnt();
|
||||
}
|
||||
@@ -511,7 +511,7 @@ TEMPENTITY *CL_TempEntAllocHigh( const vec3_t org, model_t *pmodel )
|
||||
if( !cl_free_tents )
|
||||
{
|
||||
// didn't find anything? The tent list is either full of high-priority tents
|
||||
// or all tents in the list are still due to live for > 10 seconds.
|
||||
// or all tents in the list are still due to live for > 10 seconds.
|
||||
Con_DPrintf( "Couldn't alloc a high priority TENT!\n" );
|
||||
return NULL;
|
||||
}
|
||||
@@ -550,7 +550,7 @@ CL_TempEntAlloc
|
||||
custom tempentity allocation
|
||||
==============
|
||||
*/
|
||||
TEMPENTITY *CL_TempEntAllocCustom( const vec3_t org, model_t *model, int high, void (*pfn)( TEMPENTITY*, float, float ))
|
||||
TEMPENTITY * GAME_EXPORT CL_TempEntAllocCustom( const vec3_t org, model_t *model, int high, void (*pfn)( TEMPENTITY*, float, float ))
|
||||
{
|
||||
TEMPENTITY *pTemp;
|
||||
|
||||
@@ -587,7 +587,7 @@ R_FizzEffect
|
||||
Create a fizz effect
|
||||
==============
|
||||
*/
|
||||
void R_FizzEffect( cl_entity_t *pent, int modelIndex, int density )
|
||||
void GAME_EXPORT R_FizzEffect( cl_entity_t *pent, int modelIndex, int density )
|
||||
{
|
||||
TEMPENTITY *pTemp;
|
||||
int i, width, depth, count;
|
||||
@@ -650,7 +650,7 @@ R_Bubbles
|
||||
Create bubbles
|
||||
==============
|
||||
*/
|
||||
void R_Bubbles( const vec3_t mins, const vec3_t maxs, float height, int modelIndex, int count, float speed )
|
||||
void GAME_EXPORT R_Bubbles( const vec3_t mins, const vec3_t maxs, float height, int modelIndex, int count, float speed )
|
||||
{
|
||||
TEMPENTITY *pTemp;
|
||||
float sine, cosine;
|
||||
@@ -676,12 +676,12 @@ void R_Bubbles( const vec3_t mins, const vec3_t maxs, float height, int modelInd
|
||||
pTemp->y = origin[1];
|
||||
angle = COM_RandomFloat( -M_PI, M_PI );
|
||||
SinCos( angle, &sine, &cosine );
|
||||
|
||||
|
||||
zspeed = COM_RandomLong( 80, 140 );
|
||||
VectorSet( pTemp->entity.baseline.origin, speed * cosine, speed * sine, zspeed );
|
||||
pTemp->die = cl.time + ((height - (origin[2] - mins[2])) / zspeed) - 0.1f;
|
||||
pTemp->entity.curstate.frame = COM_RandomLong( 0, pTemp->frameMax );
|
||||
|
||||
|
||||
// Set sprite scale
|
||||
pTemp->entity.curstate.scale = 1.0f / COM_RandomFloat( 2.0f, 5.0f );
|
||||
pTemp->entity.curstate.rendermode = kRenderTransAlpha;
|
||||
@@ -696,7 +696,7 @@ R_BubbleTrail
|
||||
Create bubble trail
|
||||
==============
|
||||
*/
|
||||
void R_BubbleTrail( const vec3_t start, const vec3_t end, float height, int modelIndex, int count, float speed )
|
||||
void GAME_EXPORT R_BubbleTrail( const vec3_t start, const vec3_t end, float height, int modelIndex, int count, float speed )
|
||||
{
|
||||
TEMPENTITY *pTemp;
|
||||
float sine, cosine, zspeed;
|
||||
@@ -741,7 +741,7 @@ R_AttachTentToPlayer
|
||||
Attaches entity to player
|
||||
==============
|
||||
*/
|
||||
void R_AttachTentToPlayer( int client, int modelIndex, float zoffset, float life )
|
||||
void GAME_EXPORT R_AttachTentToPlayer( int client, int modelIndex, float zoffset, float life )
|
||||
{
|
||||
TEMPENTITY *pTemp;
|
||||
vec3_t position;
|
||||
@@ -767,7 +767,7 @@ void R_AttachTentToPlayer( int client, int modelIndex, float zoffset, float life
|
||||
|
||||
pTemp->entity.curstate.renderfx = kRenderFxNoDissipation;
|
||||
pTemp->entity.curstate.framerate = 1;
|
||||
|
||||
|
||||
pTemp->clientIndex = client;
|
||||
pTemp->tentOffset[0] = 0;
|
||||
pTemp->tentOffset[1] = 0;
|
||||
@@ -797,7 +797,7 @@ R_KillAttachedTents
|
||||
Detach entity from player
|
||||
==============
|
||||
*/
|
||||
void R_KillAttachedTents( int client )
|
||||
void GAME_EXPORT R_KillAttachedTents( int client )
|
||||
{
|
||||
int i;
|
||||
|
||||
@@ -815,7 +815,7 @@ void R_KillAttachedTents( int client )
|
||||
// if it is attached to this client, set it to die instantly.
|
||||
if( pTemp->clientIndex == client )
|
||||
{
|
||||
// good enough, it will die on next tent update.
|
||||
// good enough, it will die on next tent update.
|
||||
pTemp->die = cl.time;
|
||||
}
|
||||
}
|
||||
@@ -828,7 +828,7 @@ R_RicochetSprite
|
||||
Create ricochet sprite
|
||||
==============
|
||||
*/
|
||||
void R_RicochetSprite( const vec3_t pos, model_t *pmodel, float duration, float scale )
|
||||
void GAME_EXPORT R_RicochetSprite( const vec3_t pos, model_t *pmodel, float duration, float scale )
|
||||
{
|
||||
TEMPENTITY *pTemp;
|
||||
|
||||
@@ -854,7 +854,7 @@ R_RocketFlare
|
||||
Create rocket flare
|
||||
==============
|
||||
*/
|
||||
void R_RocketFlare( const vec3_t pos )
|
||||
void GAME_EXPORT R_RocketFlare( const vec3_t pos )
|
||||
{
|
||||
TEMPENTITY *pTemp;
|
||||
|
||||
@@ -880,7 +880,7 @@ R_MuzzleFlash
|
||||
Do muzzleflash
|
||||
==============
|
||||
*/
|
||||
void R_MuzzleFlash( const vec3_t pos, int type )
|
||||
void GAME_EXPORT R_MuzzleFlash( const vec3_t pos, int type )
|
||||
{
|
||||
TEMPENTITY *pTemp;
|
||||
int index;
|
||||
@@ -919,7 +919,7 @@ Create a high priority blood sprite
|
||||
and some blood drops. This is high-priority tent
|
||||
==============
|
||||
*/
|
||||
void R_BloodSprite( const vec3_t org, int colorIndex, int modelIndex, int modelIndex2, float size )
|
||||
void GAME_EXPORT R_BloodSprite( const vec3_t org, int colorIndex, int modelIndex, int modelIndex2, float size )
|
||||
{
|
||||
model_t *pModel, *pModel2;
|
||||
int impactindex;
|
||||
@@ -1005,7 +1005,7 @@ R_BreakModel
|
||||
Create a shards
|
||||
==============
|
||||
*/
|
||||
void R_BreakModel( const vec3_t pos, const vec3_t size, const vec3_t dir, float random, float life, int count, int modelIndex, char flags )
|
||||
void GAME_EXPORT R_BreakModel( const vec3_t pos, const vec3_t size, const vec3_t dir, float random, float life, int count, int modelIndex, char flags )
|
||||
{
|
||||
TEMPENTITY *pTemp;
|
||||
model_t *pmodel;
|
||||
@@ -1026,7 +1026,7 @@ void R_BreakModel( const vec3_t pos, const vec3_t size, const vec3_t dir, float
|
||||
// limit to 100 pieces
|
||||
if( count > 100 ) count = 100;
|
||||
|
||||
for( i = 0; i < count; i++ )
|
||||
for( i = 0; i < count; i++ )
|
||||
{
|
||||
vec3_t vecSpot;
|
||||
|
||||
@@ -1048,7 +1048,7 @@ void R_BreakModel( const vec3_t pos, const vec3_t size, const vec3_t dir, float
|
||||
|
||||
// keep track of break_type, so we know how to play sound on collision
|
||||
pTemp->hitSound = type;
|
||||
|
||||
|
||||
if( pmodel->type == mod_sprite )
|
||||
pTemp->entity.curstate.frame = COM_RandomLong( 0, pTemp->frameMax );
|
||||
else if( pmodel->type == mod_studio )
|
||||
@@ -1056,7 +1056,7 @@ void R_BreakModel( const vec3_t pos, const vec3_t size, const vec3_t dir, float
|
||||
|
||||
pTemp->flags |= FTENT_COLLIDEWORLD | FTENT_FADEOUT | FTENT_SLOWGRAVITY;
|
||||
|
||||
if( COM_RandomLong( 0, 255 ) < 200 )
|
||||
if( COM_RandomLong( 0, 255 ) < 200 )
|
||||
{
|
||||
pTemp->flags |= FTENT_ROTATE;
|
||||
pTemp->entity.baseline.angles[0] = COM_RandomFloat( -256, 255 );
|
||||
@@ -1177,10 +1177,10 @@ TEMPENTITY *R_DefaultSprite( const vec3_t pos, int spriteIndex, float framerate
|
||||
===============
|
||||
R_SparkShower
|
||||
|
||||
Create an animated moving sprite
|
||||
Create an animated moving sprite
|
||||
===============
|
||||
*/
|
||||
void R_SparkShower( const vec3_t pos )
|
||||
void GAME_EXPORT R_SparkShower( const vec3_t pos )
|
||||
{
|
||||
TEMPENTITY *pTemp;
|
||||
|
||||
@@ -1202,7 +1202,7 @@ void R_SparkShower( const vec3_t pos )
|
||||
===============
|
||||
R_TempSprite
|
||||
|
||||
Create an animated moving sprite
|
||||
Create an animated moving sprite
|
||||
===============
|
||||
*/
|
||||
TEMPENTITY *R_TempSprite( vec3_t pos, const vec3_t dir, float scale, int modelIndex, int rendermode, int renderfx, float a, float life, int flags )
|
||||
@@ -1243,7 +1243,7 @@ R_Sprite_Explode
|
||||
apply params for exploding sprite
|
||||
===============
|
||||
*/
|
||||
void R_Sprite_Explode( TEMPENTITY *pTemp, float scale, int flags )
|
||||
void GAME_EXPORT R_Sprite_Explode( TEMPENTITY *pTemp, float scale, int flags )
|
||||
{
|
||||
if( !pTemp ) return;
|
||||
|
||||
@@ -1251,7 +1251,7 @@ void R_Sprite_Explode( TEMPENTITY *pTemp, float scale, int flags )
|
||||
{
|
||||
// solid sprite
|
||||
pTemp->entity.curstate.rendermode = kRenderNormal;
|
||||
pTemp->entity.curstate.renderamt = 255;
|
||||
pTemp->entity.curstate.renderamt = 255;
|
||||
}
|
||||
else if( FBitSet( flags, TE_EXPLFLAG_DRAWALPHA ))
|
||||
{
|
||||
@@ -1285,7 +1285,7 @@ R_Sprite_Smoke
|
||||
apply params for smoke sprite
|
||||
===============
|
||||
*/
|
||||
void R_Sprite_Smoke( TEMPENTITY *pTemp, float scale )
|
||||
void GAME_EXPORT R_Sprite_Smoke( TEMPENTITY *pTemp, float scale )
|
||||
{
|
||||
int iColor;
|
||||
|
||||
@@ -1309,7 +1309,7 @@ R_Spray
|
||||
Throws a shower of sprites or models
|
||||
===============
|
||||
*/
|
||||
void R_Spray( const vec3_t pos, const vec3_t dir, int modelIndex, int count, int speed, int spread, int rendermode )
|
||||
void GAME_EXPORT R_Spray( const vec3_t pos, const vec3_t dir, int modelIndex, int count, int speed, int spread, int rendermode )
|
||||
{
|
||||
TEMPENTITY *pTemp;
|
||||
float noise;
|
||||
@@ -1375,7 +1375,7 @@ R_Sprite_Spray
|
||||
Spray of alpha sprites
|
||||
===============
|
||||
*/
|
||||
void R_Sprite_Spray( const vec3_t pos, const vec3_t dir, int modelIndex, int count, int speed, int spread )
|
||||
void GAME_EXPORT R_Sprite_Spray( const vec3_t pos, const vec3_t dir, int modelIndex, int count, int speed, int spread )
|
||||
{
|
||||
R_Spray( pos, dir, modelIndex, count, speed, spread, kRenderGlow );
|
||||
}
|
||||
@@ -1388,7 +1388,7 @@ Line of moving glow sprites with gravity,
|
||||
fadeout, and collisions
|
||||
===============
|
||||
*/
|
||||
void R_Sprite_Trail( int type, vec3_t start, vec3_t end, int modelIndex, int count, float life, float size, float amp, int renderamt, float speed )
|
||||
void GAME_EXPORT R_Sprite_Trail( int type, vec3_t start, vec3_t end, int modelIndex, int count, float life, float size, float amp, int renderamt, float speed )
|
||||
{
|
||||
TEMPENTITY *pTemp;
|
||||
vec3_t delta, dir;
|
||||
@@ -1440,7 +1440,7 @@ R_FunnelSprite
|
||||
Create a funnel effect with custom sprite
|
||||
===============
|
||||
*/
|
||||
void R_FunnelSprite( const vec3_t org, int modelIndex, int reverse )
|
||||
void GAME_EXPORT R_FunnelSprite( const vec3_t org, int modelIndex, int reverse )
|
||||
{
|
||||
TEMPENTITY *pTemp;
|
||||
vec3_t dir, dest;
|
||||
@@ -1482,7 +1482,6 @@ void R_FunnelSprite( const vec3_t org, int modelIndex, int reverse )
|
||||
pTemp->entity.baseline.angles[2] = COM_RandomFloat( -100.0f, 100.0f );
|
||||
pTemp->entity.curstate.framerate = COM_RandomFloat( 0.1f, 0.4f );
|
||||
pTemp->flags = FTENT_ROTATE|FTENT_FADEOUT;
|
||||
pTemp->entity.curstate.framerate = 10;
|
||||
|
||||
vel = dest[2] / 8.0f;
|
||||
if( vel < 64.0f ) vel = 64.0f;
|
||||
@@ -1502,7 +1501,7 @@ R_SparkEffect
|
||||
Create a streaks + richochet sprite
|
||||
===============
|
||||
*/
|
||||
void R_SparkEffect( const vec3_t pos, int count, int velocityMin, int velocityMax )
|
||||
void GAME_EXPORT R_SparkEffect( const vec3_t pos, int count, int velocityMin, int velocityMax )
|
||||
{
|
||||
R_RicochetSprite( pos, cl_sprite_ricochet, 0.1f, COM_RandomFloat( 0.5f, 1.0f ));
|
||||
R_SparkStreaks( pos, count, velocityMin, velocityMax );
|
||||
@@ -1515,17 +1514,18 @@ R_RicochetSound
|
||||
Make a random ricochet sound
|
||||
==============
|
||||
*/
|
||||
void R_RicochetSound( const vec3_t pos )
|
||||
static void R_RicochetSound_( const vec3_t pos, int sound )
|
||||
{
|
||||
int iPitch = COM_RandomLong( 90, 105 );
|
||||
float fvol = COM_RandomFloat( 0.7f, 0.9f );
|
||||
char soundpath[32];
|
||||
sound_t handle;
|
||||
|
||||
Q_snprintf( soundpath, sizeof( soundpath ), "%s", cl_ricochet_sounds[COM_RandomLong( 0, 4 )] );
|
||||
handle = S_RegisterSound( soundpath );
|
||||
handle = S_RegisterSound( cl_ricochet_sounds[sound] );
|
||||
|
||||
S_StartSound( pos, 0, CHAN_AUTO, handle, fvol, ATTN_NORM, iPitch, 0 );
|
||||
S_StartSound( pos, 0, CHAN_AUTO, handle, VOL_NORM, 1.0, 100, 0 );
|
||||
}
|
||||
|
||||
void GAME_EXPORT R_RicochetSound( const vec3_t pos )
|
||||
{
|
||||
R_RicochetSound_( pos, COM_RandomLong( 0, 4 ));
|
||||
}
|
||||
|
||||
/*
|
||||
@@ -1535,7 +1535,7 @@ R_Projectile
|
||||
Create an projectile entity
|
||||
==============
|
||||
*/
|
||||
void R_Projectile( const vec3_t origin, const vec3_t velocity, int modelIndex, int life, int owner, void (*hitcallback)( TEMPENTITY*, pmtrace_t* ))
|
||||
void GAME_EXPORT R_Projectile( const vec3_t origin, const vec3_t velocity, int modelIndex, int life, int owner, void (*hitcallback)( TEMPENTITY*, pmtrace_t* ))
|
||||
{
|
||||
TEMPENTITY *pTemp;
|
||||
model_t *pmodel;
|
||||
@@ -1584,7 +1584,7 @@ R_TempSphereModel
|
||||
Spherical shower of models, picks from set
|
||||
==============
|
||||
*/
|
||||
void R_TempSphereModel( const vec3_t pos, float speed, float life, int count, int modelIndex )
|
||||
void GAME_EXPORT R_TempSphereModel( const vec3_t pos, float speed, float life, int count, int modelIndex )
|
||||
{
|
||||
TEMPENTITY *pTemp;
|
||||
int i;
|
||||
@@ -1632,7 +1632,7 @@ R_Explosion
|
||||
Create an explosion (scale is magnitude)
|
||||
==============
|
||||
*/
|
||||
void R_Explosion( vec3_t pos, int model, float scale, float framerate, int flags )
|
||||
void GAME_EXPORT R_Explosion( vec3_t pos, int model, float scale, float framerate, int flags )
|
||||
{
|
||||
sound_t hSound;
|
||||
|
||||
@@ -1656,7 +1656,7 @@ void R_Explosion( vec3_t pos, int model, float scale, float framerate, int flags
|
||||
dl->color.g = 250;
|
||||
dl->color.b = 150;
|
||||
dl->die = cl.time + 0.01f;
|
||||
dl->decay = 80;
|
||||
dl->decay = 800;
|
||||
|
||||
// red glow
|
||||
dl = CL_AllocDlight( 0 );
|
||||
@@ -1672,7 +1672,7 @@ void R_Explosion( vec3_t pos, int model, float scale, float framerate, int flags
|
||||
|
||||
if( !FBitSet( flags, TE_EXPLFLAG_NOSOUND ))
|
||||
{
|
||||
hSound = S_RegisterSound( va( "%s", cl_explode_sounds[COM_RandomLong( 0, 2 )] ));
|
||||
hSound = S_RegisterSound( cl_explode_sounds[COM_RandomLong( 0, 2 )] );
|
||||
S_StartSound( pos, 0, CHAN_STATIC, hSound, VOL_NORM, 0.3f, PITCH_NORM, 0 );
|
||||
}
|
||||
}
|
||||
@@ -1684,7 +1684,7 @@ R_PlayerSprites
|
||||
Create a particle smoke around player
|
||||
==============
|
||||
*/
|
||||
void R_PlayerSprites( int client, int modelIndex, int count, int size )
|
||||
void GAME_EXPORT R_PlayerSprites( int client, int modelIndex, int count, int size )
|
||||
{
|
||||
TEMPENTITY *pTemp;
|
||||
cl_entity_t *pEnt;
|
||||
@@ -1749,7 +1749,7 @@ R_FireField
|
||||
Makes a field of fire
|
||||
==============
|
||||
*/
|
||||
void R_FireField( float *org, int radius, int modelIndex, int count, int flags, float life )
|
||||
void GAME_EXPORT R_FireField( float *org, int radius, int modelIndex, int count, int flags, float life )
|
||||
{
|
||||
TEMPENTITY *pTemp;
|
||||
model_t *pmodel;
|
||||
@@ -1824,7 +1824,7 @@ R_MultiGunshot
|
||||
Client version of shotgun shot
|
||||
==============
|
||||
*/
|
||||
void R_MultiGunshot( const vec3_t org, const vec3_t dir, const vec3_t noise, int count, int decalCount, int *decalIndices )
|
||||
void GAME_EXPORT R_MultiGunshot( const vec3_t org, const vec3_t dir, const vec3_t noise, int count, int decalCount, int *decalIndices )
|
||||
{
|
||||
pmtrace_t trace;
|
||||
vec3_t right, up;
|
||||
@@ -1880,7 +1880,7 @@ R_Sprite_WallPuff
|
||||
Create a wallpuff
|
||||
==============
|
||||
*/
|
||||
void R_Sprite_WallPuff( TEMPENTITY *pTemp, float scale )
|
||||
void GAME_EXPORT R_Sprite_WallPuff( TEMPENTITY *pTemp, float scale )
|
||||
{
|
||||
if( !pTemp ) return;
|
||||
|
||||
@@ -1915,6 +1915,7 @@ void CL_ParseTempEntity( sizebuf_t *msg )
|
||||
TEMPENTITY *pTemp;
|
||||
cl_entity_t *pEnt;
|
||||
dlight_t *dl;
|
||||
sound_t hSound;
|
||||
|
||||
if( cls.legacymode )
|
||||
iSize = MSG_ReadByte( msg );
|
||||
@@ -2014,15 +2015,46 @@ void CL_ParseTempEntity( sizebuf_t *msg )
|
||||
color = MSG_ReadByte( &buf );
|
||||
count = MSG_ReadByte( &buf );
|
||||
R_ParticleExplosion2( pos, color, count );
|
||||
|
||||
dl = CL_AllocDlight( 0 );
|
||||
VectorCopy( pos, dl->origin );
|
||||
dl->radius = 350;
|
||||
dl->die = cl.time + 0.5;
|
||||
dl->decay = 300;
|
||||
|
||||
hSound = S_RegisterSound( cl_explode_sounds[0] );
|
||||
S_StartSound( pos, 0, CHAN_STATIC, hSound, VOL_NORM, 0.6f, PITCH_NORM, 0 );
|
||||
break;
|
||||
case TE_BSPDECAL:
|
||||
case TE_DECAL:
|
||||
case TE_WORLDDECAL:
|
||||
case TE_WORLDDECALHIGH:
|
||||
case TE_DECALHIGH:
|
||||
pos[0] = MSG_ReadCoord( &buf );
|
||||
pos[1] = MSG_ReadCoord( &buf );
|
||||
pos[2] = MSG_ReadCoord( &buf );
|
||||
decalIndex = MSG_ReadShort( &buf );
|
||||
entityIndex = MSG_ReadShort( &buf );
|
||||
if( entityIndex ) modelIndex = MSG_ReadShort( &buf );
|
||||
CL_DecalShoot( CL_DecalIndex( decalIndex ), entityIndex, modelIndex, pos, FDECAL_PERMANENT );
|
||||
if( type == TE_BSPDECAL )
|
||||
{
|
||||
decalIndex = MSG_ReadShort( &buf );
|
||||
entityIndex = MSG_ReadShort( &buf );
|
||||
if( entityIndex )
|
||||
modelIndex = MSG_ReadShort( &buf );
|
||||
else modelIndex = 0;
|
||||
}
|
||||
else
|
||||
{
|
||||
decalIndex = MSG_ReadByte( &buf );
|
||||
if( type == TE_DECALHIGH || type == TE_WORLDDECALHIGH )
|
||||
decalIndex += 256;
|
||||
|
||||
if( type == TE_DECALHIGH || type == TE_DECAL )
|
||||
entityIndex = MSG_ReadShort( &buf );
|
||||
else entityIndex = 0;
|
||||
|
||||
pEnt = CL_GetEntityByIndex( entityIndex );
|
||||
modelIndex = pEnt->curstate.modelindex;
|
||||
}
|
||||
CL_DecalShoot( CL_DecalIndex( decalIndex ), entityIndex, modelIndex, pos, type == TE_BSPDECAL ? FDECAL_PERMANENT : 0 );
|
||||
break;
|
||||
case TE_IMPLOSION:
|
||||
pos[0] = MSG_ReadCoord( &buf );
|
||||
@@ -2042,10 +2074,12 @@ void CL_ParseTempEntity( sizebuf_t *msg )
|
||||
pos2[2] = MSG_ReadCoord( &buf );
|
||||
modelIndex = MSG_ReadShort( &buf );
|
||||
count = MSG_ReadByte( &buf );
|
||||
life = (float)(MSG_ReadByte( &buf ) * 0.1f);
|
||||
scale = (float)(MSG_ReadByte( &buf ) * 0.1f);
|
||||
vel = (float)MSG_ReadByte( &buf );
|
||||
random = (float)MSG_ReadByte( &buf );
|
||||
life = (float)MSG_ReadByte( &buf ) * 0.1f;
|
||||
scale = (float)MSG_ReadByte( &buf );
|
||||
if( !scale ) scale = 1.0f;
|
||||
else scale *= 0.1f;
|
||||
vel = (float)MSG_ReadByte( &buf ) * 10;
|
||||
random = (float)MSG_ReadByte( &buf ) * 10;
|
||||
R_Sprite_Trail( type, pos, pos2, modelIndex, count, life, scale, random, 255, vel );
|
||||
break;
|
||||
case TE_SPRITE:
|
||||
@@ -2053,36 +2087,23 @@ void CL_ParseTempEntity( sizebuf_t *msg )
|
||||
pos[1] = MSG_ReadCoord( &buf );
|
||||
pos[2] = MSG_ReadCoord( &buf );
|
||||
modelIndex = MSG_ReadShort( &buf );
|
||||
scale = (float)(MSG_ReadByte( &buf ) * 0.1f);
|
||||
brightness = (float)MSG_ReadByte( &buf );
|
||||
scale = (float)MSG_ReadByte( &buf ) * 0.1f;
|
||||
brightness = (float)MSG_ReadByte( &buf ) / 255.0f;
|
||||
|
||||
if(( pTemp = R_DefaultSprite( pos, modelIndex, 0 )) != NULL )
|
||||
{
|
||||
pTemp->entity.curstate.scale = scale;
|
||||
pTemp->entity.baseline.renderamt = brightness;
|
||||
pTemp->entity.curstate.renderamt = brightness;
|
||||
pTemp->entity.curstate.rendermode = kRenderTransAdd;
|
||||
}
|
||||
R_TempSprite( pos, vec3_origin, scale, modelIndex,
|
||||
kRenderTransAdd, kRenderFxNone, brightness, 0.0, FTENT_SPRANIMATE );
|
||||
break;
|
||||
case TE_GLOWSPRITE:
|
||||
pos[0] = MSG_ReadCoord( &buf );
|
||||
pos[1] = MSG_ReadCoord( &buf );
|
||||
pos[2] = MSG_ReadCoord( &buf );
|
||||
modelIndex = MSG_ReadShort( &buf );
|
||||
life = (float)(MSG_ReadByte( &buf ) * 0.1f);
|
||||
scale = (float)(MSG_ReadByte( &buf ) * 0.1f);
|
||||
brightness = (float)MSG_ReadByte( &buf );
|
||||
life = (float)MSG_ReadByte( &buf ) * 0.1f;
|
||||
scale = (float)MSG_ReadByte( &buf ) * 0.1f;
|
||||
brightness = (float)MSG_ReadByte( &buf ) / 255.0f;
|
||||
|
||||
if(( pTemp = R_DefaultSprite( pos, modelIndex, 0 )) != NULL )
|
||||
{
|
||||
pTemp->entity.curstate.scale = scale;
|
||||
pTemp->entity.curstate.rendermode = kRenderGlow;
|
||||
pTemp->entity.curstate.renderfx = kRenderFxNoDissipation;
|
||||
pTemp->entity.baseline.renderamt = brightness;
|
||||
pTemp->entity.curstate.renderamt = brightness;
|
||||
pTemp->flags = FTENT_FADEOUT;
|
||||
pTemp->die = cl.time + life;
|
||||
}
|
||||
R_TempSprite( pos, vec3_origin, scale, modelIndex,
|
||||
kRenderGlow, kRenderFxNoDissipation, brightness, life, FTENT_FADEOUT );
|
||||
break;
|
||||
case TE_STREAK_SPLASH:
|
||||
pos[0] = MSG_ReadCoord( &buf );
|
||||
@@ -2172,23 +2193,6 @@ void CL_ParseTempEntity( sizebuf_t *msg )
|
||||
pos2[2] = MSG_ReadCoord( &buf );
|
||||
R_ShowLine( pos, pos2 );
|
||||
break;
|
||||
case TE_DECAL:
|
||||
case TE_DECALHIGH:
|
||||
case TE_WORLDDECAL:
|
||||
case TE_WORLDDECALHIGH:
|
||||
pos[0] = MSG_ReadCoord( &buf );
|
||||
pos[1] = MSG_ReadCoord( &buf );
|
||||
pos[2] = MSG_ReadCoord( &buf );
|
||||
decalIndex = MSG_ReadByte( &buf );
|
||||
if( type == TE_DECAL || type == TE_DECALHIGH )
|
||||
entityIndex = MSG_ReadShort( &buf );
|
||||
else entityIndex = 0;
|
||||
if( type == TE_DECALHIGH || type == TE_WORLDDECALHIGH )
|
||||
decalIndex += 256;
|
||||
pEnt = CL_GetEntityByIndex( entityIndex );
|
||||
if( pEnt ) modelIndex = pEnt->curstate.modelindex;
|
||||
CL_DecalShoot( CL_DecalIndex( decalIndex ), entityIndex, modelIndex, pos, 0 );
|
||||
break;
|
||||
case TE_FIZZ:
|
||||
entityIndex = MSG_ReadShort( &buf );
|
||||
modelIndex = MSG_ReadShort( &buf );
|
||||
@@ -2244,10 +2248,11 @@ void CL_ParseTempEntity( sizebuf_t *msg )
|
||||
pos[2] = MSG_ReadCoord( &buf );
|
||||
entityIndex = MSG_ReadShort( &buf );
|
||||
decalIndex = MSG_ReadByte( &buf );
|
||||
pEnt = CL_GetEntityByIndex( entityIndex );
|
||||
CL_DecalShoot( CL_DecalIndex( decalIndex ), entityIndex, 0, pos, 0 );
|
||||
R_BulletImpactParticles( pos );
|
||||
R_RicochetSound( pos );
|
||||
flags = COM_RandomLong( 0, 0x7fff );
|
||||
if( flags < 0x3fff )
|
||||
R_RicochetSound_( pos, flags % 5 );
|
||||
break;
|
||||
case TE_SPRAY:
|
||||
case TE_SPRITE_SPRAY:
|
||||
@@ -2393,7 +2398,7 @@ void CL_ParseTempEntity( sizebuf_t *msg )
|
||||
|
||||
// throw warning
|
||||
if( MSG_CheckOverflow( &buf ))
|
||||
Con_DPrintf( S_WARN "ParseTempEntity: overflow TE message\n" );
|
||||
Con_DPrintf( S_WARN "ParseTempEntity: overflow TE message %i\n", type );
|
||||
}
|
||||
|
||||
|
||||
@@ -2405,7 +2410,7 @@ LIGHT STYLE MANAGEMENT
|
||||
==============================================================
|
||||
*/
|
||||
#define STYLE_LERPING_THRESHOLD 3.0f // because we wan't interpolate fast sequences (like on\off)
|
||||
|
||||
|
||||
/*
|
||||
================
|
||||
CL_ClearLightStyles
|
||||
@@ -2576,7 +2581,7 @@ void CL_DecayLights( void )
|
||||
dlight_t *dl;
|
||||
float time;
|
||||
int i;
|
||||
|
||||
|
||||
time = cl.time - cl.oldtime;
|
||||
|
||||
for( i = 0, dl = cl_dlights; i < MAX_DLIGHTS; i++, dl++ )
|
||||
@@ -2586,7 +2591,7 @@ void CL_DecayLights( void )
|
||||
dl->radius -= time * dl->decay;
|
||||
if( dl->radius < 0 ) dl->radius = 0;
|
||||
|
||||
if( dl->die < cl.time || !dl->radius )
|
||||
if( dl->die < cl.time || !dl->radius )
|
||||
memset( dl, 0, sizeof( *dl ));
|
||||
}
|
||||
|
||||
@@ -2597,7 +2602,7 @@ void CL_DecayLights( void )
|
||||
dl->radius -= time * dl->decay;
|
||||
if( dl->radius < 0 ) dl->radius = 0;
|
||||
|
||||
if( dl->die < cl.time || !dl->radius )
|
||||
if( dl->die < cl.time || !dl->radius )
|
||||
memset( dl, 0, sizeof( *dl ));
|
||||
}
|
||||
}
|
||||
@@ -2675,7 +2680,7 @@ void CL_UpdateFlashlight( cl_entity_t *ent )
|
||||
else falloff = 500.0f / falloff;
|
||||
falloff *= falloff;
|
||||
|
||||
// apply brigthness to dlight
|
||||
// apply brigthness to dlight
|
||||
dl->color.r = bound( 0, falloff * 255, 255 );
|
||||
dl->color.g = bound( 0, falloff * 255, 255 );
|
||||
dl->color.b = bound( 0, falloff * 255, 255 );
|
||||
@@ -2693,7 +2698,7 @@ apply various effects to entity origin or attachment
|
||||
void CL_AddEntityEffects( cl_entity_t *ent )
|
||||
{
|
||||
// yellow flies effect 'monster stuck in the wall'
|
||||
if( FBitSet( ent->curstate.effects, EF_BRIGHTFIELD ))
|
||||
if( FBitSet( ent->curstate.effects, EF_BRIGHTFIELD ) && !RP_LOCALCLIENT( ent ))
|
||||
R_EntityParticles( ent );
|
||||
|
||||
if( FBitSet( ent->curstate.effects, EF_DIMLIGHT ))
|
||||
@@ -2710,10 +2715,10 @@ void CL_AddEntityEffects( cl_entity_t *ent )
|
||||
VectorCopy( ent->origin, dl->origin );
|
||||
dl->die = cl.time + 0.001;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if( FBitSet( ent->curstate.effects, EF_BRIGHTLIGHT ))
|
||||
{
|
||||
{
|
||||
dlight_t *dl = CL_AllocDlight( ent->index );
|
||||
dl->color.r = dl->color.g = dl->color.b = 250;
|
||||
if( ent->player ) dl->radius = 400; // don't flickering
|
||||
@@ -2878,7 +2883,7 @@ CL_FireCustomDecal
|
||||
custom temporary decal
|
||||
===============
|
||||
*/
|
||||
void CL_FireCustomDecal( int textureIndex, int entityIndex, int modelIndex, float *pos, int flags, float scale )
|
||||
void GAME_EXPORT CL_FireCustomDecal( int textureIndex, int entityIndex, int modelIndex, float *pos, int flags, float scale )
|
||||
{
|
||||
ref.dllFuncs.R_DecalShoot( textureIndex, entityIndex, modelIndex, pos, flags, scale );
|
||||
}
|
||||
@@ -2890,7 +2895,7 @@ CL_DecalShoot
|
||||
normal temporary decal
|
||||
===============
|
||||
*/
|
||||
void CL_DecalShoot( int textureIndex, int entityIndex, int modelIndex, float *pos, int flags )
|
||||
void GAME_EXPORT CL_DecalShoot( int textureIndex, int entityIndex, int modelIndex, float *pos, int flags )
|
||||
{
|
||||
CL_FireCustomDecal( textureIndex, entityIndex, modelIndex, pos, flags, 1.0f );
|
||||
}
|
||||
@@ -2914,7 +2919,7 @@ void CL_PlayerDecal( int playernum, int customIndex, int entityIndex, float *pos
|
||||
{
|
||||
if( FBitSet( pCust->resource.ucFlags, RES_CUSTOM ) && pCust->resource.type == t_decal && pCust->bTranslated )
|
||||
{
|
||||
if( !pCust->nUserData1 && pCust->pInfo != NULL )
|
||||
if( !pCust->nUserData1 )
|
||||
{
|
||||
const char *decalname = va( "player%dlogo%d", playernum, customIndex );
|
||||
pCust->nUserData1 = GL_LoadTextureInternal( decalname, pCust->pInfo, TF_DECAL );
|
||||
@@ -2933,7 +2938,7 @@ CL_DecalIndexFromName
|
||||
get decal global index from decalname
|
||||
===============
|
||||
*/
|
||||
int CL_DecalIndexFromName( const char *name )
|
||||
int GAME_EXPORT CL_DecalIndexFromName( const char *name )
|
||||
{
|
||||
int i;
|
||||
|
||||
@@ -2956,7 +2961,7 @@ CL_DecalIndex
|
||||
get texture index from decal global index
|
||||
===============
|
||||
*/
|
||||
int CL_DecalIndex( int id )
|
||||
int GAME_EXPORT CL_DecalIndex( int id )
|
||||
{
|
||||
id = bound( 0, id, MAX_DECALS - 1 );
|
||||
|
||||
@@ -2977,9 +2982,9 @@ CL_DecalRemoveAll
|
||||
remove all decals with specified texture
|
||||
===============
|
||||
*/
|
||||
void CL_DecalRemoveAll( int textureIndex )
|
||||
void GAME_EXPORT CL_DecalRemoveAll( int textureIndex )
|
||||
{
|
||||
int id = bound( 0, textureIndex, MAX_DECALS - 1 );
|
||||
int id = bound( 0, textureIndex, MAX_DECALS - 1 );
|
||||
ref.dllFuncs.R_DecalRemoveAll( cl.decal_index[id] );
|
||||
}
|
||||
|
||||
@@ -3032,7 +3037,7 @@ void CL_ClearStaticEntities( void )
|
||||
|
||||
CL_ClearEfrags ();
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
==============
|
||||
CL_ClearEffects
|
||||
|
||||
@@ -87,7 +87,7 @@ void SCR_CheckStartupVids( void )
|
||||
byte *afile;
|
||||
char *pfile;
|
||||
string token;
|
||||
|
||||
|
||||
if( Sys_CheckParm( "-nointro" ) || host_developer.value || cls.demonum != -1 || GameState->nextstate != STATE_RUNFRAME )
|
||||
{
|
||||
// don't run movies where we in developer-mode
|
||||
@@ -104,7 +104,7 @@ void SCR_CheckStartupVids( void )
|
||||
|
||||
pfile = (char *)afile;
|
||||
|
||||
while(( pfile = COM_ParseFile( pfile, token )) != NULL )
|
||||
while(( pfile = COM_ParseFile( pfile, token, sizeof( token ))) != NULL )
|
||||
{
|
||||
Q_strncpy( cls.movies[c], token, sizeof( cls.movies[0] ));
|
||||
|
||||
@@ -122,7 +122,7 @@ void SCR_CheckStartupVids( void )
|
||||
SCR_NextMovie ();
|
||||
Cbuf_Execute();
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
==================
|
||||
SCR_RunCinematic
|
||||
@@ -152,7 +152,7 @@ void SCR_RunCinematic( void )
|
||||
return;
|
||||
}
|
||||
|
||||
// advances cinematic time (ignores maxfps and host_framerate settings)
|
||||
// advances cinematic time (ignores maxfps and host_framerate settings)
|
||||
cin_time += host.realframetime;
|
||||
|
||||
// stop the video after it finishes
|
||||
@@ -194,7 +194,7 @@ qboolean SCR_DrawCinematic( void )
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
==================
|
||||
SCR_PlayCinematic
|
||||
@@ -238,7 +238,7 @@ qboolean SCR_PlayCinematic( const char *arg )
|
||||
Con_FastClose();
|
||||
cin_time = 0.0f;
|
||||
cls.signon = 0;
|
||||
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -258,7 +258,7 @@ wavdata_t *SCR_GetMovieInfo( void )
|
||||
return &cin_audio;
|
||||
return NULL;
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
==================
|
||||
SCR_StopCinematic
|
||||
|
||||
@@ -35,30 +35,39 @@ void V_CalcViewRect( void )
|
||||
int sb_lines;
|
||||
float size;
|
||||
|
||||
// intermission is always full screen
|
||||
if( cl.intermission ) size = 120.0f;
|
||||
else size = scr_viewsize->value;
|
||||
if( FBitSet( host.features, ENGINE_QUAKE_COMPATIBLE ))
|
||||
{
|
||||
// intermission is always full screen
|
||||
if( cl.intermission ) size = 120.0f;
|
||||
else size = scr_viewsize->value;
|
||||
|
||||
if( size >= 120.0f )
|
||||
sb_lines = 0; // no status bar at all
|
||||
else if( size >= 110.0f )
|
||||
sb_lines = 24; // no inventory
|
||||
else sb_lines = 48;
|
||||
if( size >= 120.0f )
|
||||
sb_lines = 0; // no status bar at all
|
||||
else if( size >= 110.0f )
|
||||
sb_lines = 24; // no inventory
|
||||
else sb_lines = 48;
|
||||
|
||||
if( scr_viewsize->value >= 100.0f )
|
||||
if( scr_viewsize->value >= 100.0f )
|
||||
{
|
||||
full = true;
|
||||
size = 100.0f;
|
||||
}
|
||||
else size = scr_viewsize->value;
|
||||
|
||||
if( cl.intermission )
|
||||
{
|
||||
size = 100.0f;
|
||||
sb_lines = 0;
|
||||
full = true;
|
||||
}
|
||||
size /= 100.0f;
|
||||
}
|
||||
else
|
||||
{
|
||||
full = true;
|
||||
size = 100.0f;
|
||||
}
|
||||
else size = scr_viewsize->value;
|
||||
|
||||
if( cl.intermission )
|
||||
{
|
||||
size = 100.0f;
|
||||
sb_lines = 0;
|
||||
full = true;
|
||||
size = 1.0f;
|
||||
}
|
||||
size /= 100.0f;
|
||||
|
||||
clgame.viewport[2] = refState.width * size;
|
||||
clgame.viewport[3] = refState.height * size;
|
||||
@@ -475,6 +484,7 @@ void V_PostRender( void )
|
||||
{
|
||||
SCR_RSpeeds();
|
||||
SCR_NetSpeeds();
|
||||
SCR_DrawPos();
|
||||
SCR_DrawNetGraph();
|
||||
SV_DrawOrthoTriangles();
|
||||
CL_DrawDemoRecording();
|
||||
|
||||
@@ -17,7 +17,7 @@ GNU General Public License for more details.
|
||||
#define CLIENT_H
|
||||
|
||||
#include "xash3d_types.h"
|
||||
#include "mathlib.h"
|
||||
#include "xash3d_mathlib.h"
|
||||
#include "cdll_int.h"
|
||||
#include "menu_int.h"
|
||||
#include "cl_entity.h"
|
||||
@@ -107,10 +107,10 @@ extern int CL_UPDATE_BACKUP;
|
||||
#define MIN_UPDATERATE 10.0f
|
||||
#define MAX_UPDATERATE 102.0f
|
||||
|
||||
#define MIN_EX_INTERP 50.0f
|
||||
#define MAX_EX_INTERP 100.0f
|
||||
#define MIN_EX_INTERP 0.005f
|
||||
#define MAX_EX_INTERP 0.1f
|
||||
|
||||
#define CL_MIN_RESEND_TIME 1.5f // mininum time gap (in seconds) before a subsequent connection request is sent.
|
||||
#define CL_MIN_RESEND_TIME 1.5f // mininum time gap (in seconds) before a subsequent connection request is sent.
|
||||
#define CL_MAX_RESEND_TIME 20.0f // max time. The cvar cl_resend is bounded by these.
|
||||
|
||||
#define cl_serverframetime() (cl.mtime[0] - cl.mtime[1])
|
||||
@@ -180,7 +180,7 @@ typedef struct
|
||||
// render a frame yet
|
||||
int parsecount; // server message counter
|
||||
int parsecountmod; // modulo with network window
|
||||
|
||||
|
||||
qboolean video_prepped; // false if on new level or new ref dll
|
||||
qboolean audio_prepped; // false if on new level or new snd dll
|
||||
qboolean paused;
|
||||
@@ -306,7 +306,7 @@ typedef struct
|
||||
char name[32];
|
||||
int number; // svc_ number
|
||||
int size; // if size == -1, size come from first byte after svcnum
|
||||
pfnUserMsgHook func; // user-defined function
|
||||
pfnUserMsgHook func; // user-defined function
|
||||
} cl_user_message_t;
|
||||
|
||||
typedef void (*pfnEventHook)( event_args_t *args );
|
||||
@@ -437,7 +437,7 @@ typedef struct
|
||||
void *hInstance; // pointer to client.dll
|
||||
cldll_func_t dllFuncs; // dll exported funcs
|
||||
render_interface_t drawFuncs; // custom renderer support
|
||||
byte *mempool; // client edicts pool
|
||||
poolhandle_t mempool; // client edicts pool
|
||||
string mapname; // map name
|
||||
string maptitle; // display map title
|
||||
string itemspath; // path to items description for auto-complete func
|
||||
@@ -496,7 +496,7 @@ typedef struct
|
||||
void *hInstance; // pointer to client.dll
|
||||
UI_FUNCTIONS dllFuncs; // dll exported funcs
|
||||
UI_EXTENDED_FUNCTIONS dllFuncs2; // fwgs extension
|
||||
byte *mempool; // client edicts pool
|
||||
poolhandle_t mempool; // client edicts pool
|
||||
|
||||
cl_entity_t playermodel; // uiPlayerSetup drawing model
|
||||
player_info_t playerinfo; // local playerinfo
|
||||
@@ -534,11 +534,11 @@ typedef struct
|
||||
|
||||
keydest_t key_dest;
|
||||
|
||||
byte *mempool; // client premamnent pool: edicts etc
|
||||
poolhandle_t mempool; // client premamnent pool: edicts etc
|
||||
|
||||
netadr_t hltv_listen_address;
|
||||
|
||||
int signon; // 0 to SIGNONS, for the signon sequence.
|
||||
int signon; // 0 to SIGNONS, for the signon sequence.
|
||||
int quakePort; // a 16 bit value that allows quake servers
|
||||
// to work around address translating routers
|
||||
// g-cont. this port allow many copies of engine in multiplayer game
|
||||
@@ -625,8 +625,6 @@ typedef struct
|
||||
// legacy mode support
|
||||
qboolean legacymode; // one-way 48 protocol compatibility
|
||||
netadr_t legacyserver;
|
||||
netadr_t legacyservers[MAX_LEGACY_SERVERS];
|
||||
int legacyservercount;
|
||||
int extensions;
|
||||
|
||||
netadr_t serveradr;
|
||||
@@ -655,11 +653,10 @@ extern convar_t cl_allow_download;
|
||||
extern convar_t cl_allow_upload;
|
||||
extern convar_t cl_download_ingame;
|
||||
extern convar_t *cl_nopred;
|
||||
extern convar_t *cl_showfps;
|
||||
extern convar_t *cl_envshot_size;
|
||||
extern convar_t *cl_timeout;
|
||||
extern convar_t *cl_nodelta;
|
||||
extern convar_t *cl_interp;
|
||||
extern convar_t *cl_nointerp;
|
||||
extern convar_t *cl_showerror;
|
||||
extern convar_t *cl_nosmooth;
|
||||
extern convar_t *cl_smoothtime;
|
||||
@@ -680,7 +677,6 @@ extern convar_t *cl_fixtimerate;
|
||||
extern convar_t *hud_scale;
|
||||
extern convar_t *gl_showtextures;
|
||||
extern convar_t *cl_bmodelinterp;
|
||||
extern convar_t *cl_righthand;
|
||||
extern convar_t *cl_lw; // local weapons
|
||||
extern convar_t *cl_charset;
|
||||
extern convar_t *cl_trace_messages;
|
||||
@@ -709,7 +705,7 @@ dlight_t *CL_GetEntityLight( int number );
|
||||
//
|
||||
// cl_cmds.c
|
||||
//
|
||||
void CL_Quit_f( void );
|
||||
void CL_Quit_f( void ) NORETURN;
|
||||
void CL_ScreenShot_f( void );
|
||||
void CL_SnapShot_f( void );
|
||||
void CL_PlayCDTrack_f( void );
|
||||
@@ -719,6 +715,7 @@ void CL_SaveShot_f( void );
|
||||
void CL_LevelShot_f( void );
|
||||
void CL_SetSky_f( void );
|
||||
void SCR_Viewpos_f( void );
|
||||
void CL_WavePlayLen_f( void );
|
||||
|
||||
//
|
||||
// cl_custom.c
|
||||
@@ -827,7 +824,7 @@ int CL_FindModelIndex( const char *m );
|
||||
cl_entity_t *CL_GetLocalPlayer( void );
|
||||
model_t *CL_LoadClientSprite( const char *filename );
|
||||
model_t *CL_LoadModel( const char *modelname, int *index );
|
||||
HSPRITE pfnSPR_Load( const char *szPicName );
|
||||
HSPRITE EXPORT pfnSPR_Load( const char *szPicName );
|
||||
HSPRITE pfnSPR_LoadExt( const char *szPicName, uint texFlags );
|
||||
void PicAdjustSize( float *x, float *y, float *w, float *h );
|
||||
int CL_GetScreenInfo( SCREENINFO *pscrinfo );
|
||||
@@ -844,11 +841,17 @@ movevars_t *pfnGetMoveVars( void );
|
||||
|
||||
_inline cl_entity_t *CL_EDICT_NUM( int n )
|
||||
{
|
||||
if( !clgame.entities )
|
||||
{
|
||||
Host_Error( "CL_EDICT_NUM: clgame.entities is NULL\n");
|
||||
return NULL;
|
||||
}
|
||||
|
||||
if(( n >= 0 ) && ( n < clgame.maxEntities ))
|
||||
return clgame.entities + n;
|
||||
|
||||
Host_Error( "CL_EDICT_NUM: bad number %i\n", n );
|
||||
return NULL;
|
||||
return NULL;
|
||||
}
|
||||
|
||||
//
|
||||
@@ -882,6 +885,7 @@ void SCR_MakeLevelShot( void );
|
||||
void SCR_NetSpeeds( void );
|
||||
void SCR_RSpeeds( void );
|
||||
void SCR_DrawFPS( int height );
|
||||
void SCR_DrawPos( void );
|
||||
|
||||
//
|
||||
// cl_netgraph.c
|
||||
@@ -953,9 +957,9 @@ void CL_EmitEntities( void );
|
||||
// cl_remap.c
|
||||
//
|
||||
remap_info_t *CL_GetRemapInfoForEntity( cl_entity_t *e );
|
||||
void CL_AllocRemapInfo( int topcolor, int bottomcolor );
|
||||
void CL_AllocRemapInfo( cl_entity_t *entity, model_t *model, int topcolor, int bottomcolor );
|
||||
void CL_FreeRemapInfo( remap_info_t *info );
|
||||
void CL_UpdateRemapInfo( int topcolor, int bottomcolor );
|
||||
void CL_UpdateRemapInfo( cl_entity_t *ent, int topcolor, int bottomcolor );
|
||||
void CL_ClearAllRemaps( void );
|
||||
|
||||
//
|
||||
@@ -1042,7 +1046,6 @@ void Con_Bottom( void );
|
||||
void Con_Top( void );
|
||||
void Con_PageDown( int lines );
|
||||
void Con_PageUp( int lines );
|
||||
void Con_LoadHistory( void );
|
||||
|
||||
//
|
||||
// s_main.c
|
||||
@@ -1106,6 +1109,11 @@ void pfnPIC_DrawAdditive( int x, int y, int width, int height, const wrect_t *pr
|
||||
qboolean Mobile_Init( void );
|
||||
void Mobile_Shutdown( void );
|
||||
|
||||
//
|
||||
// cl_securedstub.c
|
||||
//
|
||||
void CL_GetSecuredClientAPI( CL_EXPORT_FUNCS F );
|
||||
|
||||
//
|
||||
// cl_video.c
|
||||
//
|
||||
|
||||
@@ -28,10 +28,13 @@ convar_t *con_fontsize;
|
||||
convar_t *con_charset;
|
||||
convar_t *con_fontscale;
|
||||
convar_t *con_fontnum;
|
||||
convar_t *con_color;
|
||||
|
||||
static int g_codepage = 0;
|
||||
static qboolean g_utf8 = false;
|
||||
|
||||
static qboolean g_messagemode_privileged = true;
|
||||
|
||||
#define CON_TIMES 4 // notify lines
|
||||
#define CON_MAX_TIMES 64 // notify max lines
|
||||
#define COLOR_DEFAULT '7'
|
||||
@@ -78,6 +81,14 @@ typedef struct con_lineinfo_s
|
||||
double addtime; // notify stuff
|
||||
} con_lineinfo_t;
|
||||
|
||||
typedef struct con_history_s
|
||||
{
|
||||
field_t lines[CON_HISTORY];
|
||||
field_t backup;
|
||||
int line; // the line being displayed from history buffer will be <= nextHistoryLine
|
||||
int next; // the last line in the history buffer, not masked
|
||||
} con_history_t;
|
||||
|
||||
typedef struct
|
||||
{
|
||||
qboolean initialized;
|
||||
@@ -106,7 +117,7 @@ typedef struct
|
||||
// console fonts
|
||||
cl_font_t chars[CON_NUMFONTS];// fonts.wad/font1.fnt
|
||||
cl_font_t *curFont, *lastUsedFont;
|
||||
|
||||
|
||||
// console input
|
||||
field_t input;
|
||||
|
||||
@@ -115,10 +126,8 @@ typedef struct
|
||||
string chat_cmd; // can be overrieded by user
|
||||
|
||||
// console history
|
||||
field_t historyLines[CON_HISTORY];
|
||||
int historyLine; // the line being displayed from history buffer will be <= nextHistoryLine
|
||||
int nextHistoryLine; // the last line in the history buffer, not masked
|
||||
field_t backup;
|
||||
con_history_t history;
|
||||
qboolean historyLoaded;
|
||||
|
||||
notify_t notify[MAX_DBG_NOTIFY]; // for Con_NXPrintf
|
||||
qboolean draw_notify; // true if we have NXPrint message
|
||||
@@ -132,6 +141,9 @@ static console_t con;
|
||||
void Con_ClearField( field_t *edit );
|
||||
void Field_CharEvent( field_t *edit, int ch );
|
||||
|
||||
static void Con_LoadHistory( con_history_t *self );
|
||||
static void Con_SaveHistory( con_history_t *self );
|
||||
|
||||
/*
|
||||
================
|
||||
Con_Clear_f
|
||||
@@ -145,33 +157,36 @@ void Con_Clear_f( void )
|
||||
|
||||
/*
|
||||
================
|
||||
Con_SetColor_f
|
||||
Con_SetColor
|
||||
================
|
||||
*/
|
||||
void Con_SetColor_f( void )
|
||||
static void Con_SetColor( void )
|
||||
{
|
||||
vec3_t color;
|
||||
vec3_t color;
|
||||
int r, g, b;
|
||||
int num;
|
||||
|
||||
switch( Cmd_Argc( ))
|
||||
if( !FBitSet( con_color->flags, FCVAR_CHANGED ))
|
||||
return;
|
||||
|
||||
num = sscanf( con_color->string, "%i %i %i", &r, &g, &b );
|
||||
|
||||
switch( num )
|
||||
{
|
||||
case 1:
|
||||
Con_Printf( "\"con_color\" is %i %i %i\n", g_color_table[7][0], g_color_table[7][1], g_color_table[7][2] );
|
||||
Con_DefaultColor( r, r, r );
|
||||
break;
|
||||
case 2:
|
||||
VectorSet( color, g_color_table[7][0], g_color_table[7][1], g_color_table[7][2] );
|
||||
Q_atov( color, Cmd_Argv( 1 ), 3 );
|
||||
Con_DefaultColor( color[0], color[1], color[2] );
|
||||
break;
|
||||
case 4:
|
||||
VectorSet( color, Q_atof( Cmd_Argv( 1 )), Q_atof( Cmd_Argv( 2 )), Q_atof( Cmd_Argv( 3 )));
|
||||
Con_DefaultColor( color[0], color[1], color[2] );
|
||||
case 3:
|
||||
Con_DefaultColor( r, g, b );
|
||||
break;
|
||||
default:
|
||||
Con_Printf( S_USAGE "con_color \"r g b\"\n" );
|
||||
Cvar_DirectSet( con_color, con_color->def_string );
|
||||
break;
|
||||
}
|
||||
|
||||
ClearBits( con_color->flags, FCVAR_CHANGED );
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
================
|
||||
Con_ClearNotify
|
||||
@@ -180,7 +195,7 @@ Con_ClearNotify
|
||||
void Con_ClearNotify( void )
|
||||
{
|
||||
int i;
|
||||
|
||||
|
||||
for( i = 0; i < CON_LINES_COUNT; i++ )
|
||||
CON_LINES( i ).addtime = 0.0;
|
||||
}
|
||||
@@ -192,8 +207,6 @@ Con_ClearTyping
|
||||
*/
|
||||
void Con_ClearTyping( void )
|
||||
{
|
||||
int i;
|
||||
|
||||
Con_ClearField( &con.input );
|
||||
con.input.widthInChars = con.linewidth;
|
||||
|
||||
@@ -238,6 +251,8 @@ Con_MessageMode_f
|
||||
*/
|
||||
void Con_MessageMode_f( void )
|
||||
{
|
||||
g_messagemode_privileged = Cmd_CurrentCommandIsPrivileged();
|
||||
|
||||
if( Cmd_Argc() == 2 )
|
||||
Q_strncpy( con.chat_cmd, Cmd_Argv( 1 ), sizeof( con.chat_cmd ));
|
||||
else Q_strncpy( con.chat_cmd, "say", sizeof( con.chat_cmd ));
|
||||
@@ -252,6 +267,8 @@ Con_MessageMode2_f
|
||||
*/
|
||||
void Con_MessageMode2_f( void )
|
||||
{
|
||||
g_messagemode_privileged = Cmd_CurrentCommandIsPrivileged();
|
||||
|
||||
Q_strncpy( con.chat_cmd, "say_team", sizeof( con.chat_cmd ));
|
||||
Key_SetKeyDest( key_message );
|
||||
}
|
||||
@@ -476,7 +493,7 @@ void Con_CheckResize( void )
|
||||
con.input.widthInChars = con.linewidth;
|
||||
|
||||
for( i = 0; i < CON_HISTORY; i++ )
|
||||
con.historyLines[i].widthInChars = con.linewidth;
|
||||
con.history.lines[i].widthInChars = con.linewidth;
|
||||
}
|
||||
|
||||
/*
|
||||
@@ -524,7 +541,7 @@ void Con_Bottom( void )
|
||||
Con_Visible
|
||||
================
|
||||
*/
|
||||
int Con_Visible( void )
|
||||
int GAME_EXPORT Con_Visible( void )
|
||||
{
|
||||
return (con.vislines > 0);
|
||||
}
|
||||
@@ -671,7 +688,9 @@ static void Con_LoadConchars( void )
|
||||
Con_LoadConsoleFont( i, con.chars + i );
|
||||
|
||||
// select properly fontsize
|
||||
if( refState.width <= 640 )
|
||||
if( con_fontnum->value >= 0 && con_fontnum->value <= CON_NUMFONTS - 1 )
|
||||
fontSize = con_fontnum->value;
|
||||
else if( refState.width <= 640 )
|
||||
fontSize = 0;
|
||||
else if( refState.width >= 1280 )
|
||||
fontSize = 2;
|
||||
@@ -986,14 +1005,16 @@ Con_DrawStringLen
|
||||
compute string width and height in screen pixels
|
||||
====================
|
||||
*/
|
||||
void Con_DrawStringLen( const char *pText, int *length, int *height )
|
||||
void GAME_EXPORT Con_DrawStringLen( const char *pText, int *length, int *height )
|
||||
{
|
||||
int curLength = 0;
|
||||
|
||||
if( !con.curFont ) return;
|
||||
|
||||
if( height ) *height = con.curFont->charHeight;
|
||||
if( !length ) return;
|
||||
if( !con.curFont )
|
||||
return;
|
||||
if( height )
|
||||
*height = con.curFont->charHeight;
|
||||
if (!length)
|
||||
return;
|
||||
|
||||
*length = 0;
|
||||
|
||||
@@ -1048,7 +1069,7 @@ int Con_DrawGenericString( int x, int y, const char *string, rgba_t setColor, qb
|
||||
Con_UtfProcessChar( 0 );
|
||||
|
||||
// draw the colored text
|
||||
*(uint *)color = *(uint *)setColor;
|
||||
memcpy( color, setColor, sizeof( color ));
|
||||
s = string;
|
||||
|
||||
while( *s )
|
||||
@@ -1099,61 +1120,6 @@ int Con_DrawString( int x, int y, const char *string, rgba_t setColor )
|
||||
return Con_DrawGenericString( x, y, string, setColor, false, -1 );
|
||||
}
|
||||
|
||||
void Con_LoadHistory( void )
|
||||
{
|
||||
const byte *aFile = FS_LoadFile( "console_history.txt", NULL, true );
|
||||
const char *pLine = (char *)aFile, *pFile = (char *)aFile;
|
||||
int i;
|
||||
|
||||
if( !aFile )
|
||||
return;
|
||||
|
||||
while( true )
|
||||
{
|
||||
if( !*pFile )
|
||||
break;
|
||||
if( *pFile == '\n')
|
||||
{
|
||||
int len = pFile - pLine + 1;
|
||||
field_t *f;
|
||||
if( len > 255 ) len = 255;
|
||||
Con_ClearField( &con.historyLines[con.nextHistoryLine] );
|
||||
f = &con.historyLines[con.nextHistoryLine % CON_HISTORY];
|
||||
f->widthInChars = con.linewidth;
|
||||
f->cursor = len - 1;
|
||||
Q_strncpy( f->buffer, pLine, len);
|
||||
con.nextHistoryLine++;
|
||||
pLine = pFile + 1;
|
||||
}
|
||||
pFile++;
|
||||
}
|
||||
|
||||
for( i = con.nextHistoryLine; i < CON_HISTORY; i++ )
|
||||
{
|
||||
Con_ClearField( &con.historyLines[i] );
|
||||
con.historyLines[i].widthInChars = con.linewidth;
|
||||
}
|
||||
|
||||
con.historyLine = con.nextHistoryLine;
|
||||
|
||||
}
|
||||
|
||||
void Con_SaveHistory( void )
|
||||
{
|
||||
int historyStart = con.nextHistoryLine - CON_HISTORY;
|
||||
int i;
|
||||
file_t *f;
|
||||
|
||||
if( historyStart < 0 )
|
||||
historyStart = 0;
|
||||
|
||||
f = FS_Open("console_history.txt", "w", true );
|
||||
|
||||
for( i = historyStart; i < con.nextHistoryLine; i++ )
|
||||
FS_Printf( f, "%s\n", con.historyLines[i % CON_HISTORY].buffer );
|
||||
|
||||
FS_Close(f);
|
||||
}
|
||||
|
||||
/*
|
||||
================
|
||||
@@ -1174,6 +1140,7 @@ void Con_Init( void )
|
||||
con_charset = Cvar_Get( "con_charset", "cp1251", FCVAR_ARCHIVE, "console font charset (only cp1251 supported now)" );
|
||||
con_fontscale = Cvar_Get( "con_fontscale", "1.0", FCVAR_ARCHIVE, "scale font texture" );
|
||||
con_fontnum = Cvar_Get( "con_fontnum", "-1", FCVAR_ARCHIVE, "console font number (0, 1 or 2), -1 for autoselect" );
|
||||
con_color = Cvar_Get( "con_color", "240 180 24", FCVAR_ARCHIVE, "set a custom console color" );
|
||||
|
||||
// init the console buffer
|
||||
con.bufsize = CON_TEXTSIZE;
|
||||
@@ -1192,8 +1159,7 @@ void Con_Init( void )
|
||||
con.chat.widthInChars = con.linewidth;
|
||||
|
||||
Cmd_AddCommand( "toggleconsole", Con_ToggleConsole_f, "opens or closes the console" );
|
||||
Cmd_AddCommand( "con_color", Con_SetColor_f, "set a custom console color" );
|
||||
Cmd_AddCommand( "clear", Con_Clear_f, "clear console history" );
|
||||
Cmd_AddRestrictedCommand( "clear", Con_Clear_f, "clear console history" );
|
||||
Cmd_AddCommand( "messagemode", Con_MessageMode_f, "enable message mode \"say\"" );
|
||||
Cmd_AddCommand( "messagemode2", Con_MessageMode2_f, "enable message mode \"say_team\"" );
|
||||
Cmd_AddCommand( "contimes", Con_SetTimes_f, "change number of console overlay lines (4-64)" );
|
||||
@@ -1219,7 +1185,7 @@ void Con_Shutdown( void )
|
||||
|
||||
con.buffer = NULL;
|
||||
con.lines = NULL;
|
||||
Con_SaveHistory();
|
||||
Con_SaveHistory( &con.history );
|
||||
}
|
||||
|
||||
/*
|
||||
@@ -1335,7 +1301,7 @@ Con_NPrint
|
||||
Draw a single debug line with specified height
|
||||
================
|
||||
*/
|
||||
void Con_NPrintf( int idx, const char *fmt, ... )
|
||||
void GAME_EXPORT Con_NPrintf( int idx, const char *fmt, ... )
|
||||
{
|
||||
va_list args;
|
||||
|
||||
@@ -1362,7 +1328,7 @@ Con_NXPrint
|
||||
Draw a single debug line with specified height, color and time to live
|
||||
================
|
||||
*/
|
||||
void Con_NXPrintf( con_nprint_t *info, const char *fmt, ... )
|
||||
void GAME_EXPORT Con_NXPrintf( con_nprint_t *info, const char *fmt, ... )
|
||||
{
|
||||
va_list args;
|
||||
|
||||
@@ -1391,7 +1357,7 @@ UI_NPrint
|
||||
Draw a single debug line with specified height (menu version)
|
||||
================
|
||||
*/
|
||||
void UI_NPrintf( int idx, const char *fmt, ... )
|
||||
void GAME_EXPORT UI_NPrintf( int idx, const char *fmt, ... )
|
||||
{
|
||||
va_list args;
|
||||
|
||||
@@ -1418,7 +1384,7 @@ UI_NXPrint
|
||||
Draw a single debug line with specified height, color and time to live (menu version)
|
||||
================
|
||||
*/
|
||||
void UI_NXPrintf( con_nprint_t *info, const char *fmt, ... )
|
||||
void GAME_EXPORT UI_NXPrintf( con_nprint_t *info, const char *fmt, ... )
|
||||
{
|
||||
va_list args;
|
||||
|
||||
@@ -1454,11 +1420,22 @@ Con_ClearField
|
||||
*/
|
||||
void Con_ClearField( field_t *edit )
|
||||
{
|
||||
memset(edit->buffer, 0, MAX_STRING);
|
||||
memset( edit->buffer, 0, MAX_STRING );
|
||||
edit->cursor = 0;
|
||||
edit->scroll = 0;
|
||||
}
|
||||
|
||||
/*
|
||||
================
|
||||
Field_Set
|
||||
================
|
||||
*/
|
||||
static void Field_Set( field_t *f, const char *string )
|
||||
{
|
||||
f->scroll = 0;
|
||||
f->cursor = Q_strncpy( f->buffer, string, MAX_STRING );
|
||||
}
|
||||
|
||||
/*
|
||||
================
|
||||
Field_Paste
|
||||
@@ -1478,6 +1455,18 @@ void Field_Paste( field_t *edit )
|
||||
Field_CharEvent( edit, cbd[i] );
|
||||
}
|
||||
|
||||
/*
|
||||
=================
|
||||
Field_GoTo
|
||||
|
||||
=================
|
||||
*/
|
||||
static void Field_GoTo( field_t *edit, int pos )
|
||||
{
|
||||
edit->cursor = pos;
|
||||
edit->scroll = Q_max( 0, edit->cursor - edit->widthInChars );
|
||||
}
|
||||
|
||||
/*
|
||||
=================
|
||||
Field_KeyDownEvent
|
||||
@@ -1530,20 +1519,20 @@ void Field_KeyDownEvent( field_t *edit, int key )
|
||||
|
||||
if( key == K_LEFTARROW )
|
||||
{
|
||||
if( edit->cursor > 0 ) edit->cursor= Con_UtfMoveLeft( edit->buffer, edit->cursor );
|
||||
if( edit->cursor > 0 ) edit->cursor = Con_UtfMoveLeft( edit->buffer, edit->cursor );
|
||||
if( edit->cursor < edit->scroll ) edit->scroll--;
|
||||
return;
|
||||
}
|
||||
|
||||
if( key == K_HOME || ( Q_tolower(key) == 'a' && Key_IsDown( K_CTRL )))
|
||||
{
|
||||
edit->cursor = 0;
|
||||
Field_GoTo( edit, 0 );
|
||||
return;
|
||||
}
|
||||
|
||||
if( key == K_END || ( Q_tolower(key) == 'e' && Key_IsDown( K_CTRL )))
|
||||
{
|
||||
edit->cursor = len;
|
||||
Field_GoTo( edit, len );
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -1582,16 +1571,14 @@ void Field_CharEvent( field_t *edit, int ch )
|
||||
if( ch == 'a' - 'a' + 1 )
|
||||
{
|
||||
// ctrl-a is home
|
||||
edit->cursor = 0;
|
||||
edit->scroll = 0;
|
||||
Field_GoTo( edit, 0 );
|
||||
return;
|
||||
}
|
||||
|
||||
if( ch == 'e' - 'a' + 1 )
|
||||
{
|
||||
// ctrl-e is end
|
||||
edit->cursor = len;
|
||||
edit->scroll = edit->cursor - edit->widthInChars;
|
||||
Field_GoTo( edit, len );
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -1599,7 +1586,7 @@ void Field_CharEvent( field_t *edit, int ch )
|
||||
if( ch < 32 ) return;
|
||||
|
||||
if( host.key_overstrike )
|
||||
{
|
||||
{
|
||||
if ( edit->cursor == MAX_STRING - 1 ) return;
|
||||
edit->buffer[edit->cursor] = ch;
|
||||
edit->cursor++;
|
||||
@@ -1664,7 +1651,7 @@ void Field_DrawInputLine( int x, int y, field_t *edit )
|
||||
|
||||
if( host.key_overstrike && cursorChar && !((int)( host.realtime * 4 ) & 1 ))
|
||||
hideChar = edit->cursor - prestep; // skip this char
|
||||
|
||||
|
||||
// draw it
|
||||
Con_DrawGenericString( x, y, str, colorDefault, false, hideChar );
|
||||
|
||||
@@ -1694,12 +1681,134 @@ void Field_DrawInputLine( int x, int y, field_t *edit )
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
=============================================================================
|
||||
|
||||
CONSOLE HISTORY HANDLING
|
||||
|
||||
=============================================================================
|
||||
*/
|
||||
/*
|
||||
===================
|
||||
Con_HistoryUp
|
||||
|
||||
===================
|
||||
*/
|
||||
static void Con_HistoryUp( con_history_t *self, field_t *in )
|
||||
{
|
||||
if( self->line == self->next )
|
||||
self->backup = *in;
|
||||
|
||||
if(( self->next - self->line ) < CON_HISTORY )
|
||||
self->line = Q_max( 0, self->line - 1 );
|
||||
|
||||
*in = self->lines[self->line % CON_HISTORY];
|
||||
}
|
||||
|
||||
/*
|
||||
===================
|
||||
Con_HistoryDown
|
||||
|
||||
===================
|
||||
*/
|
||||
static void Con_HistoryDown( con_history_t *self, field_t *in )
|
||||
{
|
||||
self->line = Q_min( self->next, self->line + 1 );
|
||||
if( self->line == self->next )
|
||||
*in = self->backup;
|
||||
else *in = self->lines[self->line % CON_HISTORY];
|
||||
}
|
||||
|
||||
/*
|
||||
===================
|
||||
Con_HistoryAppend
|
||||
===================
|
||||
*/
|
||||
static void Con_HistoryAppend( con_history_t *self, field_t *from )
|
||||
{
|
||||
int prevLine = Q_max( 0, self->line - 1 );
|
||||
const char *buf = from->buffer;
|
||||
|
||||
// skip backslashes
|
||||
if( from->buffer[0] == '\\' || from->buffer[1] == '/' )
|
||||
buf++;
|
||||
|
||||
// only if non-empty
|
||||
if( !from->buffer[0] )
|
||||
return;
|
||||
|
||||
// skip empty commands
|
||||
if( Q_isspace( buf ))
|
||||
return;
|
||||
|
||||
// if not copy (don't ignore backslashes)
|
||||
if( !Q_strcmp( from->buffer, self->lines[prevLine % CON_HISTORY].buffer ))
|
||||
return;
|
||||
|
||||
self->lines[self->next % CON_HISTORY] = *from;
|
||||
self->line = ++self->next;
|
||||
}
|
||||
|
||||
static void Con_LoadHistory( con_history_t *self )
|
||||
{
|
||||
const byte *aFile = FS_LoadFile( "console_history.txt", NULL, true );
|
||||
const char *pLine, *pFile;
|
||||
int i, len;
|
||||
field_t *f;
|
||||
|
||||
if( !aFile )
|
||||
return;
|
||||
|
||||
for( pFile = pLine = (char *)aFile; *pFile; pFile++ )
|
||||
{
|
||||
if( *pFile != '\n' )
|
||||
continue;
|
||||
|
||||
Con_ClearField( &self->lines[self->next] );
|
||||
|
||||
len = Q_min( pFile - pLine + 1, sizeof( f->buffer ));
|
||||
f = &self->lines[self->next % CON_HISTORY];
|
||||
f->widthInChars = con.linewidth;
|
||||
f->cursor = len - 1;
|
||||
Q_strncpy( f->buffer, pLine, len);
|
||||
|
||||
self->next++;
|
||||
|
||||
pLine = pFile + 1;
|
||||
}
|
||||
|
||||
for( i = self->next; i < CON_HISTORY; i++ )
|
||||
{
|
||||
Con_ClearField( &self->lines[i] );
|
||||
self->lines[i].widthInChars = con.linewidth;
|
||||
}
|
||||
|
||||
self->line = self->next;
|
||||
}
|
||||
|
||||
static void Con_SaveHistory( con_history_t *self )
|
||||
{
|
||||
int historyStart = self->next - CON_HISTORY, i;
|
||||
file_t *f;
|
||||
|
||||
if( historyStart < 0 )
|
||||
historyStart = 0;
|
||||
|
||||
f = FS_Open( "console_history.txt", "w", true );
|
||||
|
||||
for( i = historyStart; i < self->next; i++ )
|
||||
FS_Printf( f, "%s\n", self->lines[i % CON_HISTORY].buffer );
|
||||
|
||||
FS_Close( f );
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
=============================================================================
|
||||
|
||||
CONSOLE LINE EDITING
|
||||
|
||||
==============================================================================
|
||||
=============================================================================
|
||||
*/
|
||||
/*
|
||||
====================
|
||||
@@ -1720,16 +1829,6 @@ void Key_Console( int key )
|
||||
// enter finishes the line
|
||||
if( key == K_ENTER || key == K_KP_ENTER )
|
||||
{
|
||||
// if not in the game explicitly prepent a slash if needed
|
||||
if( cls.state != ca_active && con.input.buffer[0] != '\\' && con.input.buffer[0] != '/' )
|
||||
{
|
||||
char temp[MAX_SYSPATH];
|
||||
|
||||
Q_strncpy( temp, con.input.buffer, sizeof( temp ));
|
||||
Q_sprintf( con.input.buffer, "\\%s", temp );
|
||||
con.input.cursor++;
|
||||
}
|
||||
|
||||
// backslash text are commands, else chat
|
||||
if( con.input.buffer[0] == '\\' || con.input.buffer[0] == '/' )
|
||||
Cbuf_AddText( con.input.buffer + 1 ); // skip backslash
|
||||
@@ -1740,9 +1839,7 @@ void Key_Console( int key )
|
||||
Con_Printf( ">%s\n", con.input.buffer );
|
||||
|
||||
// copy line to history buffer
|
||||
con.historyLines[con.nextHistoryLine % CON_HISTORY] = con.input;
|
||||
con.nextHistoryLine++;
|
||||
con.historyLine = con.nextHistoryLine;
|
||||
Con_HistoryAppend( &con.history, &con.input );
|
||||
|
||||
Con_ClearField( &con.input );
|
||||
con.input.widthInChars = con.linewidth;
|
||||
@@ -1767,23 +1864,13 @@ void Key_Console( int key )
|
||||
// command history (ctrl-p ctrl-n for unix style)
|
||||
if(( key == K_MWHEELUP && Key_IsDown( K_SHIFT )) || ( key == K_UPARROW ) || (( Q_tolower(key) == 'p' ) && Key_IsDown( K_CTRL )))
|
||||
{
|
||||
if( con.historyLine == con.nextHistoryLine )
|
||||
con.backup = con.input;
|
||||
if( con.nextHistoryLine - con.historyLine < CON_HISTORY && con.historyLine > 0 )
|
||||
con.historyLine--;
|
||||
con.input = con.historyLines[con.historyLine % CON_HISTORY];
|
||||
Con_HistoryUp( &con.history, &con.input );
|
||||
return;
|
||||
}
|
||||
|
||||
if(( key == K_MWHEELDOWN && Key_IsDown( K_SHIFT )) || ( key == K_DOWNARROW ) || (( Q_tolower(key) == 'n' ) && Key_IsDown( K_CTRL )))
|
||||
{
|
||||
if( con.historyLine >= con.nextHistoryLine - 1 )
|
||||
con.input = con.backup;
|
||||
else
|
||||
{
|
||||
con.historyLine++;
|
||||
con.input = con.historyLines[con.historyLine % CON_HISTORY];
|
||||
}
|
||||
Con_HistoryDown( &con.history, &con.input );
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -1809,7 +1896,7 @@ void Key_Console( int key )
|
||||
}
|
||||
|
||||
if( key == K_MWHEELDOWN )
|
||||
{
|
||||
{
|
||||
if( Key_IsDown( K_CTRL ))
|
||||
Con_PageDown( 8 );
|
||||
else Con_PageDown( 2 );
|
||||
@@ -1857,7 +1944,10 @@ void Key_Message( int key )
|
||||
if( con.chat.buffer[0] && cls.state == ca_active )
|
||||
{
|
||||
Q_snprintf( buffer, sizeof( buffer ), "%s \"%s\"\n", con.chat_cmd, con.chat.buffer );
|
||||
Cbuf_AddText( buffer );
|
||||
|
||||
if( g_messagemode_privileged )
|
||||
Cbuf_AddText( buffer );
|
||||
else Cbuf_AddFilteredText( buffer );
|
||||
}
|
||||
|
||||
Key_SetKeyDest( key_game );
|
||||
@@ -1909,13 +1999,13 @@ int Con_DrawDebugLines( void )
|
||||
int y = 20;
|
||||
|
||||
defaultX = refState.width / 4;
|
||||
|
||||
|
||||
for( i = 0; i < MAX_DBG_NOTIFY; i++ )
|
||||
{
|
||||
if( host.realtime < con.notify[i].expire && con.notify[i].key_dest == cls.key_dest )
|
||||
{
|
||||
int x, len;
|
||||
int fontTall;
|
||||
int fontTall = 0;
|
||||
|
||||
Con_DrawStringLen( con.notify[i].szNotify, &len, &fontTall );
|
||||
x = refState.width - Q_max( defaultX, len ) - 10;
|
||||
@@ -1949,7 +2039,7 @@ void Con_DrawDebug( void )
|
||||
if( scr_download->value != -1.0f )
|
||||
{
|
||||
Q_snprintf( dlstring, sizeof( dlstring ), "Downloading [%d remaining]: ^2%s^7 %5.1f%% time %.f secs",
|
||||
host.downloadcount, host.downloadfile, scr_download->value, Sys_DoubleTime() - timeStart );
|
||||
host.downloadcount, host.downloadfile, scr_download->value, Sys_DoubleTime() - timeStart );
|
||||
x = refState.width - 500;
|
||||
y = con.curFont->charHeight * 1.05f;
|
||||
Con_DrawString( x, y, dlstring, g_color_table[7] );
|
||||
@@ -1998,7 +2088,7 @@ void Con_DrawNotify( void )
|
||||
y += con.curFont->charHeight;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
if( cls.key_dest == key_message )
|
||||
{
|
||||
string buf;
|
||||
@@ -2084,6 +2174,9 @@ void Con_DrawSolidConsole( int lines )
|
||||
int i, x, y;
|
||||
float fraction;
|
||||
int start;
|
||||
int stringLen, width = 0, charH;
|
||||
string curbuild;
|
||||
byte color[4];
|
||||
|
||||
if( lines <= 0 ) return;
|
||||
|
||||
@@ -2097,28 +2190,20 @@ void Con_DrawSolidConsole( int lines )
|
||||
if( !con.curFont || !host.allow_console )
|
||||
return; // nothing to draw
|
||||
|
||||
if( host.allow_console )
|
||||
{
|
||||
// draw current version
|
||||
int stringLen, width = 0, charH;
|
||||
string curbuild;
|
||||
byte color[4];
|
||||
// draw current version
|
||||
memcpy( color, g_color_table[7], sizeof( color ));
|
||||
|
||||
memcpy( color, g_color_table[7], sizeof( color ));
|
||||
Q_snprintf( curbuild, MAX_STRING, "%s %i/%s (%s-%s build %i)", XASH_ENGINE_NAME, PROTOCOL_VERSION, XASH_VERSION, Q_buildos(), Q_buildarch(), Q_buildnum( ));
|
||||
|
||||
Con_DrawStringLen( curbuild, &stringLen, &charH );
|
||||
start = refState.width - stringLen;
|
||||
stringLen = Con_StringLength( curbuild );
|
||||
|
||||
Q_snprintf( curbuild, MAX_STRING, "%s %i/%s (%s-%s build %i)", XASH_ENGINE_NAME, PROTOCOL_VERSION, XASH_VERSION, Q_buildos(), Q_buildarch(), Q_buildnum( ));
|
||||
fraction = lines / (float)refState.height;
|
||||
color[3] = Q_min( fraction * 2.0f, 1.0f ) * 255; // fadeout version number
|
||||
|
||||
Con_DrawStringLen( curbuild, &stringLen, &charH );
|
||||
start = refState.width - stringLen;
|
||||
stringLen = Con_StringLength( curbuild );
|
||||
|
||||
fraction = lines / (float)refState.height;
|
||||
color[3] = Q_min( fraction * 2.0f, 1.0f ) * 255; // fadeout version number
|
||||
|
||||
for( i = 0; i < stringLen; i++ )
|
||||
width += Con_DrawCharacter( start + width, 0, curbuild[i], color );
|
||||
}
|
||||
for( i = 0; i < stringLen; i++ )
|
||||
width += Con_DrawCharacter( start + width, 0, curbuild[i], color );
|
||||
|
||||
// draw the text
|
||||
if( CON_LINES_COUNT > 0 )
|
||||
@@ -2155,7 +2240,7 @@ void Con_DrawSolidConsole( int lines )
|
||||
Con_DrawInput( lines );
|
||||
|
||||
y = lines - ( con.curFont->charHeight * 1.2f );
|
||||
SCR_DrawFPS( max( y, 4 )); // to avoid to hide fps counter
|
||||
SCR_DrawFPS( Q_max( y, 4 )); // to avoid to hide fps counter
|
||||
|
||||
ref.dllFuncs.Color4ub( 255, 255, 255, 255 );
|
||||
}
|
||||
@@ -2204,14 +2289,14 @@ void Con_DrawConsole( void )
|
||||
case ca_connecting:
|
||||
case ca_connected:
|
||||
case ca_validate:
|
||||
// force to show console always for -dev 3 and higher
|
||||
// force to show console always for -dev 3 and higher
|
||||
Con_DrawSolidConsole( con.vislines );
|
||||
break;
|
||||
case ca_active:
|
||||
case ca_cinematic:
|
||||
case ca_cinematic:
|
||||
if( Cvar_VariableInteger( "cl_background" ) || Cvar_VariableInteger( "sv_background" ))
|
||||
{
|
||||
if( cls.key_dest == key_console )
|
||||
if( cls.key_dest == key_console )
|
||||
Con_DrawSolidConsole( refState.height );
|
||||
}
|
||||
else
|
||||
@@ -2238,7 +2323,7 @@ void Con_DrawVersion( void )
|
||||
{
|
||||
// draws the current build
|
||||
byte *color = g_color_table[7];
|
||||
int i, stringLen, width = 0, charH;
|
||||
int i, stringLen, width = 0, charH = 0;
|
||||
int start, height = refState.height;
|
||||
qboolean draw_version = false;
|
||||
string curbuild;
|
||||
@@ -2284,6 +2369,8 @@ void Con_RunConsole( void )
|
||||
{
|
||||
float lines_per_frame;
|
||||
|
||||
Con_SetColor( );
|
||||
|
||||
// decide on the destination height of the console
|
||||
if( host.allow_console && cls.key_dest == key_console )
|
||||
{
|
||||
@@ -2369,6 +2456,12 @@ INTERNAL RESOURCE
|
||||
*/
|
||||
void Con_VidInit( void )
|
||||
{
|
||||
if( !con.historyLoaded )
|
||||
{
|
||||
Con_LoadHistory( &con.history );
|
||||
con.historyLoaded = true;
|
||||
}
|
||||
|
||||
Con_LoadConchars();
|
||||
Con_CheckResize();
|
||||
#if XASH_LOW_MEMORY
|
||||
@@ -2404,7 +2497,6 @@ void Con_VidInit( void )
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
if( !con.background ) // last chance - quake conback image
|
||||
{
|
||||
qboolean draw_to_console = false;
|
||||
@@ -2427,13 +2519,13 @@ void Con_VidInit( void )
|
||||
lmp_t *cb = (lmp_t *)FS_LoadFile( "gfx/conback.lmp", &length, false );
|
||||
char ver[64];
|
||||
byte *dest;
|
||||
int x, y;
|
||||
int x, y, len;
|
||||
|
||||
if( cb && cb->width == 320 && cb->height == 200 )
|
||||
{
|
||||
Q_snprintf( ver, 64, "%i", Q_buildnum( )); // can store only buildnum
|
||||
dest = (byte *)(cb + 1) + 320 * 186 + 320 - 11 - 8 * Q_strlen( ver );
|
||||
y = Q_strlen( ver );
|
||||
len = Q_snprintf( ver, 64, "%i", Q_buildnum( )); // can store only buildnum
|
||||
dest = (byte *)(cb + 1) + 320 * 186 + 320 - 11 - 8 * len;
|
||||
y = len;
|
||||
for( x = 0; x < y; x++ )
|
||||
Con_DrawCharToConback( ver[x], buf, dest + (x << 3));
|
||||
con.background = ref.dllFuncs.GL_LoadTexture( "#gfx/conback.lmp", (byte *)cb, length, TF_IMAGE );
|
||||
@@ -2485,10 +2577,55 @@ Con_DefaultColor
|
||||
called from MainUI
|
||||
=========
|
||||
*/
|
||||
void Con_DefaultColor( int r, int g, int b )
|
||||
void GAME_EXPORT Con_DefaultColor( int r, int g, int b )
|
||||
{
|
||||
r = bound( 0, r, 255 );
|
||||
g = bound( 0, g, 255 );
|
||||
b = bound( 0, b, 255 );
|
||||
MakeRGBA( g_color_table[7], r, g, b, 255 );
|
||||
}
|
||||
|
||||
#if XASH_ENGINE_TESTS
|
||||
#include "tests.h"
|
||||
|
||||
static void Test_RunConHistory( void )
|
||||
{
|
||||
con_history_t hist = { 0 };
|
||||
field_t input = { 0 };
|
||||
const char *strs1[] = { "map t0a0", "quit", "wtf", "wtf", "", "nyan" };
|
||||
const char *strs2[] = { "nyan", "wtf", "quit", "map t0a0" };
|
||||
const char *testbackup = "unfinished_edit";
|
||||
int i;
|
||||
|
||||
for( i = 0; i < ARRAYSIZE( strs1 ); i++ )
|
||||
{
|
||||
Field_Set( &input, strs1[i] );
|
||||
Con_HistoryAppend( &hist, &input );
|
||||
}
|
||||
|
||||
Field_Set( &input, testbackup );
|
||||
|
||||
for( i = 0; i < ARRAYSIZE( strs2 ); i++ )
|
||||
{
|
||||
Con_HistoryUp( &hist, &input );
|
||||
TASSERT_STR( input.buffer, strs2[i] );
|
||||
}
|
||||
|
||||
// check for overrun
|
||||
Con_HistoryUp( &hist, &input );
|
||||
|
||||
for( i = ARRAYSIZE( strs2 ) - 1; i >= 0; i-- )
|
||||
{
|
||||
TASSERT_STR( input.buffer, strs2[i] );
|
||||
Con_HistoryDown( &hist, &input );
|
||||
}
|
||||
|
||||
TASSERT_STR( input.buffer, testbackup );
|
||||
}
|
||||
|
||||
void Test_RunCon( void )
|
||||
{
|
||||
TRUN( Test_RunConHistory() );
|
||||
}
|
||||
|
||||
#endif /* XASH_ENGINE_TESTS */
|
||||
|
||||
@@ -24,17 +24,6 @@ GNU General Public License for more details.
|
||||
#define SHRT_MAX 0x7FFF
|
||||
#endif
|
||||
|
||||
typedef enum engineAxis_e
|
||||
{
|
||||
JOY_AXIS_SIDE = 0,
|
||||
JOY_AXIS_FWD,
|
||||
JOY_AXIS_PITCH,
|
||||
JOY_AXIS_YAW,
|
||||
JOY_AXIS_RT,
|
||||
JOY_AXIS_LT,
|
||||
JOY_AXIS_NULL
|
||||
} engineAxis_t;
|
||||
|
||||
#define MAX_AXES JOY_AXIS_NULL
|
||||
|
||||
// index - axis num come from event
|
||||
@@ -246,8 +235,6 @@ Axis events
|
||||
*/
|
||||
void Joy_AxisMotionEvent( byte axis, short value )
|
||||
{
|
||||
byte engineAxis;
|
||||
|
||||
if( !joy_found->value )
|
||||
return;
|
||||
|
||||
@@ -257,8 +244,11 @@ void Joy_AxisMotionEvent( byte axis, short value )
|
||||
return;
|
||||
}
|
||||
|
||||
engineAxis = joyaxesmap[axis]; // convert to engine inner axis control
|
||||
return Joy_KnownAxisMotionEvent( joyaxesmap[axis], value );
|
||||
}
|
||||
|
||||
void Joy_KnownAxisMotionEvent( engineAxis_t engineAxis, short value )
|
||||
{
|
||||
if( engineAxis == JOY_AXIS_NULL )
|
||||
return;
|
||||
|
||||
@@ -390,32 +380,32 @@ Main init procedure
|
||||
*/
|
||||
void Joy_Init( void )
|
||||
{
|
||||
joy_pitch = Cvar_Get( "joy_pitch", "100.0", FCVAR_ARCHIVE, "joystick pitch sensitivity" );
|
||||
joy_yaw = Cvar_Get( "joy_yaw", "100.0", FCVAR_ARCHIVE, "joystick yaw sensitivity" );
|
||||
joy_side = Cvar_Get( "joy_side", "1.0", FCVAR_ARCHIVE, "joystick side sensitivity. Values from -1.0 to 1.0" );
|
||||
joy_forward = Cvar_Get( "joy_forward", "1.0", FCVAR_ARCHIVE, "joystick forward sensitivity. Values from -1.0 to 1.0" );
|
||||
joy_pitch = Cvar_Get( "joy_pitch", "100.0", FCVAR_ARCHIVE | FCVAR_FILTERABLE, "joystick pitch sensitivity" );
|
||||
joy_yaw = Cvar_Get( "joy_yaw", "100.0", FCVAR_ARCHIVE | FCVAR_FILTERABLE, "joystick yaw sensitivity" );
|
||||
joy_side = Cvar_Get( "joy_side", "1.0", FCVAR_ARCHIVE | FCVAR_FILTERABLE, "joystick side sensitivity. Values from -1.0 to 1.0" );
|
||||
joy_forward = Cvar_Get( "joy_forward", "1.0", FCVAR_ARCHIVE | FCVAR_FILTERABLE, "joystick forward sensitivity. Values from -1.0 to 1.0" );
|
||||
|
||||
joy_lt_threshold = Cvar_Get( "joy_lt_threshold", "-16384", FCVAR_ARCHIVE, "left trigger threshold. Value from -32768 to 32767");
|
||||
joy_rt_threshold = Cvar_Get( "joy_rt_threshold", "-16384", FCVAR_ARCHIVE, "right trigger threshold. Value from -32768 to 32767" );
|
||||
joy_lt_threshold = Cvar_Get( "joy_lt_threshold", "16384", FCVAR_ARCHIVE | FCVAR_FILTERABLE, "left trigger threshold. Value from 0 to 32767");
|
||||
joy_rt_threshold = Cvar_Get( "joy_rt_threshold", "16384", FCVAR_ARCHIVE | FCVAR_FILTERABLE, "right trigger threshold. Value from 0 to 32767" );
|
||||
|
||||
// emit a key event at 75% axis move
|
||||
joy_side_key_threshold = Cvar_Get( "joy_side_key_threshold", "24576", FCVAR_ARCHIVE, "side axis key event emit threshold. Value from 0 to 32767" );
|
||||
joy_forward_key_threshold = Cvar_Get( "joy_forward_key_threshold", "24576", FCVAR_ARCHIVE, "forward axis key event emit threshold. Value from 0 to 32767");
|
||||
joy_side_key_threshold = Cvar_Get( "joy_side_key_threshold", "24576", FCVAR_ARCHIVE | FCVAR_FILTERABLE, "side axis key event emit threshold. Value from 0 to 32767" );
|
||||
joy_forward_key_threshold = Cvar_Get( "joy_forward_key_threshold", "24576", FCVAR_ARCHIVE | FCVAR_FILTERABLE, "forward axis key event emit threshold. Value from 0 to 32767");
|
||||
|
||||
// by default, we rely on deadzone detection come from system, but some glitchy devices report false deadzones
|
||||
joy_side_deadzone = Cvar_Get( "joy_side_deadzone", "0", FCVAR_ARCHIVE, "side axis deadzone. Value from 0 to 32767" );
|
||||
joy_forward_deadzone = Cvar_Get( "joy_forward_deadzone", "0", FCVAR_ARCHIVE, "forward axis deadzone. Value from 0 to 32767");
|
||||
joy_pitch_deadzone = Cvar_Get( "joy_pitch_deadzone", "0", FCVAR_ARCHIVE, "pitch axis deadzone. Value from 0 to 32767");
|
||||
joy_yaw_deadzone = Cvar_Get( "joy_yaw_deadzone", "0", FCVAR_ARCHIVE, "yaw axis deadzone. Value from 0 to 32767" );
|
||||
joy_side_deadzone = Cvar_Get( "joy_side_deadzone", "0", FCVAR_ARCHIVE | FCVAR_FILTERABLE, "side axis deadzone. Value from 0 to 32767" );
|
||||
joy_forward_deadzone = Cvar_Get( "joy_forward_deadzone", "0", FCVAR_ARCHIVE | FCVAR_FILTERABLE, "forward axis deadzone. Value from 0 to 32767");
|
||||
joy_pitch_deadzone = Cvar_Get( "joy_pitch_deadzone", "0", FCVAR_ARCHIVE | FCVAR_FILTERABLE, "pitch axis deadzone. Value from 0 to 32767");
|
||||
joy_yaw_deadzone = Cvar_Get( "joy_yaw_deadzone", "0", FCVAR_ARCHIVE | FCVAR_FILTERABLE, "yaw axis deadzone. Value from 0 to 32767" );
|
||||
|
||||
joy_axis_binding = Cvar_Get( "joy_axis_binding", "sfpyrl", FCVAR_ARCHIVE, "axis hardware id to engine inner axis binding, "
|
||||
joy_axis_binding = Cvar_Get( "joy_axis_binding", "sfpyrl", FCVAR_ARCHIVE | FCVAR_FILTERABLE, "axis hardware id to engine inner axis binding, "
|
||||
"s - side, f - forward, y - yaw, p - pitch, r - left trigger, l - right trigger" );
|
||||
joy_found = Cvar_Get( "joy_found", "0", FCVAR_READ_ONLY, "is joystick is connected" );
|
||||
// we doesn't loaded config.cfg yet, so this cvar is not archive.
|
||||
// change by +set joy_index in cmdline
|
||||
joy_index = Cvar_Get( "joy_index", "0", FCVAR_READ_ONLY, "current active joystick" );
|
||||
|
||||
joy_enable = Cvar_Get( "joy_enable", "1", FCVAR_ARCHIVE, "enable joystick" );
|
||||
joy_enable = Cvar_Get( "joy_enable", "1", FCVAR_ARCHIVE | FCVAR_FILTERABLE, "enable joystick" );
|
||||
|
||||
if( Sys_CheckParm( "-nojoy" ))
|
||||
{
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -18,7 +18,7 @@ GNU General Public License for more details.
|
||||
#include "client.h"
|
||||
#include "vgui_draw.h"
|
||||
|
||||
#ifdef XASH_SDL
|
||||
#if XASH_SDL
|
||||
#include <SDL.h>
|
||||
#endif
|
||||
|
||||
@@ -30,22 +30,24 @@ qboolean in_mouseinitialized;
|
||||
qboolean in_mouse_suspended;
|
||||
POINT in_lastvalidpos;
|
||||
qboolean in_mouse_savedpos;
|
||||
static int in_mstate = 0;
|
||||
static struct inputstate_s
|
||||
{
|
||||
float lastpitch, lastyaw;
|
||||
} inputstate;
|
||||
|
||||
extern convar_t *vid_fullscreen;
|
||||
convar_t *m_enginemouse;
|
||||
convar_t *m_pitch;
|
||||
convar_t *m_yaw;
|
||||
|
||||
convar_t *m_enginesens;
|
||||
convar_t *m_ignore;
|
||||
convar_t *cl_forwardspeed;
|
||||
convar_t *cl_sidespeed;
|
||||
convar_t *cl_backspeed;
|
||||
convar_t *look_filter;
|
||||
convar_t *m_rawinput;
|
||||
|
||||
static qboolean s_bRawInput, s_bMouseGrab;
|
||||
|
||||
/*
|
||||
================
|
||||
@@ -110,13 +112,12 @@ IN_StartupMouse
|
||||
*/
|
||||
void IN_StartupMouse( void )
|
||||
{
|
||||
m_ignore = Cvar_Get( "m_ignore", DEFAULT_M_IGNORE, FCVAR_ARCHIVE , "ignore mouse events" );
|
||||
m_ignore = Cvar_Get( "m_ignore", DEFAULT_M_IGNORE, FCVAR_ARCHIVE | FCVAR_FILTERABLE, "ignore mouse events" );
|
||||
|
||||
m_enginemouse = Cvar_Get( "m_enginemouse", "0", FCVAR_ARCHIVE, "read mouse events in engine instead of client" );
|
||||
m_enginesens = Cvar_Get( "m_enginesens", "0.3", FCVAR_ARCHIVE, "mouse sensitivity, when m_enginemouse enabled" );
|
||||
m_pitch = Cvar_Get( "m_pitch", "0.022", FCVAR_ARCHIVE, "mouse pitch value" );
|
||||
m_yaw = Cvar_Get( "m_yaw", "0.022", FCVAR_ARCHIVE, "mouse yaw value" );
|
||||
look_filter = Cvar_Get( "look_filter", "0", FCVAR_ARCHIVE, "filter look events making it smoother" );
|
||||
m_pitch = Cvar_Get( "m_pitch", "0.022", FCVAR_ARCHIVE | FCVAR_FILTERABLE, "mouse pitch value" );
|
||||
m_yaw = Cvar_Get( "m_yaw", "0.022", FCVAR_ARCHIVE | FCVAR_FILTERABLE, "mouse yaw value" );
|
||||
look_filter = Cvar_Get( "look_filter", "0", FCVAR_ARCHIVE | FCVAR_FILTERABLE, "filter look events making it smoother" );
|
||||
m_rawinput = Cvar_Get( "m_rawinput", "1", FCVAR_ARCHIVE | FCVAR_FILTERABLE, "enable mouse raw input" );
|
||||
|
||||
// You can use -nomouse argument to prevent using mouse from client
|
||||
// -noenginemouse will disable all mouse input
|
||||
@@ -125,21 +126,9 @@ void IN_StartupMouse( void )
|
||||
in_mouseinitialized = true;
|
||||
}
|
||||
|
||||
static void IN_ActivateCursor( void )
|
||||
void GAME_EXPORT IN_SetCursor( void *hCursor )
|
||||
{
|
||||
if( cls.key_dest == key_menu )
|
||||
{
|
||||
#ifdef XASH_SDL
|
||||
SDL_SetCursor( in_mousecursor );
|
||||
#endif
|
||||
}
|
||||
}
|
||||
|
||||
void IN_SetCursor( void *hCursor )
|
||||
{
|
||||
in_mousecursor = hCursor;
|
||||
|
||||
IN_ActivateCursor();
|
||||
// stub
|
||||
}
|
||||
|
||||
/*
|
||||
@@ -188,43 +177,15 @@ void IN_ToggleClientMouse( int newstate, int oldstate )
|
||||
|
||||
if( oldstate == key_game )
|
||||
{
|
||||
if( cls.initialized )
|
||||
clgame.dllFuncs.IN_DeactivateMouse();
|
||||
IN_DeactivateMouse();
|
||||
}
|
||||
else if( newstate == key_game )
|
||||
{
|
||||
// reset mouse pos, so cancel effect in game
|
||||
#if SDL_VERSION_ATLEAST( 2, 0, 0 )
|
||||
if( CVAR_TO_BOOL( touch_enable ) )
|
||||
{
|
||||
SDL_SetRelativeMouseMode( SDL_FALSE );
|
||||
SDL_SetWindowGrab( host.hWnd, SDL_FALSE );
|
||||
}
|
||||
else
|
||||
#endif
|
||||
{
|
||||
Platform_SetMousePos( host.window_center_x, host.window_center_y );
|
||||
#if XASH_SDL
|
||||
SDL_SetWindowGrab( host.hWnd, SDL_TRUE );
|
||||
#if SDL_VERSION_ATLEAST( 2, 0, 0 )
|
||||
if( clgame.dllFuncs.pfnLookEvent )
|
||||
SDL_SetRelativeMouseMode( SDL_TRUE );
|
||||
#endif
|
||||
#endif // XASH_SDL
|
||||
}
|
||||
if( cls.initialized )
|
||||
clgame.dllFuncs.IN_ActivateMouse();
|
||||
IN_ActivateMouse();
|
||||
}
|
||||
|
||||
if( ( newstate == key_menu || newstate == key_console || newstate == key_message ) && ( !CL_IsBackgroundMap() || CL_IsBackgroundDemo( )))
|
||||
{
|
||||
#ifdef XASH_SDL
|
||||
SDL_SetWindowGrab(host.hWnd, SDL_FALSE);
|
||||
#if SDL_VERSION_ATLEAST( 2, 0, 0 )
|
||||
if( clgame.dllFuncs.pfnLookEvent )
|
||||
SDL_SetRelativeMouseMode( SDL_FALSE );
|
||||
#endif
|
||||
#endif // XASH_SDL
|
||||
#if XASH_ANDROID
|
||||
Android_ShowMouse( true );
|
||||
#endif
|
||||
@@ -243,6 +204,65 @@ void IN_ToggleClientMouse( int newstate, int oldstate )
|
||||
}
|
||||
}
|
||||
|
||||
void IN_CheckMouseState( qboolean active )
|
||||
{
|
||||
#if XASH_WIN32
|
||||
qboolean useRawInput = CVAR_TO_BOOL( m_rawinput ) && clgame.client_dll_uses_sdl || clgame.dllFuncs.pfnLookEvent;
|
||||
#else
|
||||
qboolean useRawInput = true; // always use SDL code
|
||||
#endif
|
||||
|
||||
if( active && useRawInput && !host.mouse_visible && cls.state == ca_active )
|
||||
{
|
||||
if( !s_bRawInput )
|
||||
{
|
||||
#if XASH_SDL == 2
|
||||
SDL_GetRelativeMouseState( NULL, NULL );
|
||||
SDL_SetRelativeMouseMode( SDL_TRUE );
|
||||
#endif
|
||||
|
||||
// Con_Printf( "Enable relative mode\n" );
|
||||
s_bRawInput = true;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if( s_bRawInput )
|
||||
{
|
||||
#if XASH_SDL == 2
|
||||
SDL_GetRelativeMouseState( NULL, NULL );
|
||||
SDL_SetRelativeMouseMode( SDL_FALSE );
|
||||
#endif
|
||||
// Con_Printf( "Disable relative mode\n" );
|
||||
s_bRawInput = false;
|
||||
}
|
||||
}
|
||||
|
||||
if( active && !host.mouse_visible && cls.state == ca_active )
|
||||
{
|
||||
if( !s_bMouseGrab )
|
||||
{
|
||||
#if XASH_SDL
|
||||
SDL_SetWindowGrab( host.hWnd, SDL_TRUE );
|
||||
#endif
|
||||
// Con_Printf( "Enable grab\n" );
|
||||
s_bMouseGrab = true;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if( s_bMouseGrab )
|
||||
{
|
||||
#if XASH_SDL
|
||||
SDL_SetWindowGrab( host.hWnd, SDL_FALSE );
|
||||
#endif
|
||||
|
||||
// Con_Printf( "Disable grab\n" );
|
||||
s_bMouseGrab = false;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
===========
|
||||
IN_ActivateMouse
|
||||
@@ -250,58 +270,14 @@ IN_ActivateMouse
|
||||
Called when the window gains focus or changes in some way
|
||||
===========
|
||||
*/
|
||||
void IN_ActivateMouse( qboolean force )
|
||||
void IN_ActivateMouse( void )
|
||||
{
|
||||
int width, height;
|
||||
static int oldstate;
|
||||
|
||||
if( !in_mouseinitialized )
|
||||
return;
|
||||
|
||||
if( CL_Active() && host.mouse_visible && !force )
|
||||
return; // VGUI controls
|
||||
|
||||
if( cls.key_dest == key_menu && !Cvar_VariableInteger( "fullscreen" ))
|
||||
{
|
||||
// check for mouse leave-entering
|
||||
if( !in_mouse_suspended && !UI_MouseInRect( ))
|
||||
in_mouse_suspended = true;
|
||||
|
||||
if( oldstate != in_mouse_suspended )
|
||||
{
|
||||
if( in_mouse_suspended )
|
||||
{
|
||||
#ifdef XASH_SDL
|
||||
/// TODO: Platform_ShowCursor
|
||||
if( !touch_emulate )
|
||||
SDL_ShowCursor( SDL_FALSE );
|
||||
#endif
|
||||
UI_ShowCursor( false );
|
||||
}
|
||||
}
|
||||
|
||||
oldstate = in_mouse_suspended;
|
||||
|
||||
if( in_mouse_suspended )
|
||||
{
|
||||
in_mouse_suspended = false;
|
||||
in_mouseactive = false; // re-initialize mouse
|
||||
UI_ShowCursor( true );
|
||||
}
|
||||
}
|
||||
|
||||
if( in_mouseactive ) return;
|
||||
IN_CheckMouseState( true );
|
||||
clgame.dllFuncs.IN_ActivateMouse();
|
||||
in_mouseactive = true;
|
||||
|
||||
if( UI_IsVisible( )) return;
|
||||
|
||||
if( cls.key_dest == key_game )
|
||||
{
|
||||
clgame.dllFuncs.IN_ActivateMouse();
|
||||
#ifdef XASH_SDL
|
||||
SDL_GetRelativeMouseState( 0, 0 ); // Reset mouse position
|
||||
#endif
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
@@ -313,20 +289,16 @@ Called when the window loses focus
|
||||
*/
|
||||
void IN_DeactivateMouse( void )
|
||||
{
|
||||
if( !in_mouseinitialized || !in_mouseactive )
|
||||
if( !in_mouseinitialized )
|
||||
return;
|
||||
|
||||
if( cls.key_dest == key_game )
|
||||
{
|
||||
clgame.dllFuncs.IN_DeactivateMouse();
|
||||
}
|
||||
|
||||
IN_CheckMouseState( false );
|
||||
clgame.dllFuncs.IN_DeactivateMouse();
|
||||
in_mouseactive = false;
|
||||
#ifdef XASH_SDL
|
||||
SDL_SetWindowGrab( host.hWnd, SDL_FALSE );
|
||||
#endif // XASH_SDL
|
||||
}
|
||||
|
||||
|
||||
|
||||
/*
|
||||
================
|
||||
IN_MouseMove
|
||||
@@ -335,8 +307,8 @@ IN_MouseMove
|
||||
void IN_MouseMove( void )
|
||||
{
|
||||
POINT current_pos;
|
||||
|
||||
if( !in_mouseinitialized || !in_mouseactive || !UI_IsVisible( ))
|
||||
|
||||
if( !in_mouseinitialized )
|
||||
return;
|
||||
|
||||
// find mouse movement
|
||||
@@ -346,15 +318,13 @@ void IN_MouseMove( void )
|
||||
|
||||
// HACKHACK: show cursor in UI, as mainui doesn't call
|
||||
// platform-dependent SetCursor anymore
|
||||
#ifdef XASH_SDL
|
||||
#if XASH_SDL
|
||||
if( UI_IsVisible() )
|
||||
SDL_ShowCursor( SDL_TRUE );
|
||||
#endif
|
||||
|
||||
// if the menu is visible, move the menu cursor
|
||||
UI_MouseMove( current_pos.x, current_pos.y );
|
||||
|
||||
IN_ActivateCursor();
|
||||
}
|
||||
|
||||
/*
|
||||
@@ -362,73 +332,32 @@ void IN_MouseMove( void )
|
||||
IN_MouseEvent
|
||||
===========
|
||||
*/
|
||||
void IN_MouseEvent( void )
|
||||
void IN_MouseEvent( int key, int down )
|
||||
{
|
||||
int i;
|
||||
|
||||
// touch emu: handle motion
|
||||
if( CVAR_TO_BOOL( touch_emulate ))
|
||||
{
|
||||
if( Key_IsDown( K_SHIFT ) )
|
||||
Touch_KeyEvent( K_MOUSE2, 2 );
|
||||
else
|
||||
Touch_KeyEvent( K_MOUSE1, 2 );
|
||||
}
|
||||
|
||||
if( !in_mouseinitialized || !in_mouseactive )
|
||||
if( !in_mouseinitialized )
|
||||
return;
|
||||
|
||||
|
||||
if( m_ignore->value )
|
||||
return;
|
||||
if( down )
|
||||
SetBits( in_mstate, BIT( key ));
|
||||
else ClearBits( in_mstate, BIT( key ));
|
||||
|
||||
if( cls.key_dest == key_game )
|
||||
{
|
||||
#if defined( XASH_SDL )
|
||||
static qboolean ignore; // igonre mouse warp event
|
||||
int x, y;
|
||||
Platform_GetMousePos(&x, &y);
|
||||
if( host.mouse_visible )
|
||||
SDL_ShowCursor( SDL_TRUE );
|
||||
else if( !CVAR_TO_BOOL( touch_emulate ) )
|
||||
SDL_ShowCursor( SDL_FALSE );
|
||||
// perform button actions
|
||||
VGui_KeyEvent( K_MOUSE1 + key, down );
|
||||
|
||||
if( x < host.window_center_x / 2 ||
|
||||
y < host.window_center_y / 2 ||
|
||||
x > host.window_center_x + host.window_center_x / 2 ||
|
||||
y > host.window_center_y + host.window_center_y / 2 )
|
||||
{
|
||||
Platform_SetMousePos( host.window_center_x, host.window_center_y );
|
||||
ignore = 1; // next mouse event will be mouse warp
|
||||
return;
|
||||
}
|
||||
|
||||
if ( !ignore )
|
||||
{
|
||||
if( !m_enginemouse->value )
|
||||
{
|
||||
// a1ba: mouse keys are now separated
|
||||
// so pass 0 here
|
||||
clgame.dllFuncs.IN_MouseEvent( 0 );
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
SDL_GetRelativeMouseState( 0, 0 ); // reset relative state
|
||||
ignore = 0;
|
||||
}
|
||||
#endif
|
||||
return;
|
||||
// don't do Key_Event here
|
||||
// client may override IN_MouseEvent
|
||||
// but by default it calls back to Key_Event anyway
|
||||
if( in_mouseactive )
|
||||
clgame.dllFuncs.IN_MouseEvent( in_mstate );
|
||||
}
|
||||
else
|
||||
{
|
||||
#if XASH_SDL && !XASH_WIN32
|
||||
#if SDL_VERSION_ATLEAST( 2, 0, 0 )
|
||||
SDL_SetRelativeMouseMode( SDL_FALSE );
|
||||
#endif // SDL_VERSION_ATLEAST( 2, 0, 0 )
|
||||
SDL_ShowCursor( SDL_TRUE );
|
||||
#endif // XASH_SDL && !XASH_WIN32
|
||||
IN_MouseMove();
|
||||
// perform button actions
|
||||
Key_Event( K_MOUSE1 + key, down );
|
||||
}
|
||||
}
|
||||
|
||||
@@ -456,9 +385,9 @@ IN_Init
|
||||
*/
|
||||
void IN_Init( void )
|
||||
{
|
||||
cl_forwardspeed = Cvar_Get( "cl_forwardspeed", "400", FCVAR_ARCHIVE | FCVAR_CLIENTDLL, "Default forward move speed" );
|
||||
cl_backspeed = Cvar_Get( "cl_backspeed", "400", FCVAR_ARCHIVE | FCVAR_CLIENTDLL, "Default back move speed" );
|
||||
cl_sidespeed = Cvar_Get( "cl_sidespeed", "400", FCVAR_ARCHIVE | FCVAR_CLIENTDLL, "Default side move speed" );
|
||||
cl_forwardspeed = Cvar_Get( "cl_forwardspeed", "400", FCVAR_ARCHIVE | FCVAR_CLIENTDLL | FCVAR_FILTERABLE, "Default forward move speed" );
|
||||
cl_backspeed = Cvar_Get( "cl_backspeed", "400", FCVAR_ARCHIVE | FCVAR_CLIENTDLL | FCVAR_FILTERABLE, "Default back move speed" );
|
||||
cl_sidespeed = Cvar_Get( "cl_sidespeed", "400", FCVAR_ARCHIVE | FCVAR_CLIENTDLL | FCVAR_FILTERABLE, "Default side move speed" );
|
||||
|
||||
if( !Host_IsDedicated() )
|
||||
{
|
||||
@@ -565,37 +494,23 @@ static void IN_JoyAppendMove( usercmd_t *cmd, float forwardmove, float sidemove
|
||||
}
|
||||
}
|
||||
|
||||
void IN_CollectInput( float *forward, float *side, float *pitch, float *yaw, qboolean includeMouse, qboolean includeSdlMouse )
|
||||
static void IN_CollectInput( float *forward, float *side, float *pitch, float *yaw, qboolean includeMouse )
|
||||
{
|
||||
if( includeMouse )
|
||||
{
|
||||
#if XASH_INPUT == INPUT_SDL
|
||||
if( includeSdlMouse )
|
||||
{
|
||||
int x, y;
|
||||
SDL_GetRelativeMouseState( &x, &y );
|
||||
*pitch += y * m_pitch->value;
|
||||
*yaw -= x * m_yaw->value;
|
||||
}
|
||||
#endif // INPUT_SDL
|
||||
|
||||
#if XASH_INPUT == INPUT_ANDROID
|
||||
{
|
||||
float x, y;
|
||||
Android_MouseMove( &x, &y );
|
||||
*pitch += y * m_pitch->value;
|
||||
*yaw -= x * m_yaw->value;
|
||||
}
|
||||
#endif // ANDROID
|
||||
float x, y;
|
||||
Platform_MouseMove( &x, &y );
|
||||
*pitch += y * m_pitch->value;
|
||||
*yaw -= x * m_yaw->value;
|
||||
|
||||
#ifdef XASH_USE_EVDEV
|
||||
IN_EvdevMove( yaw, pitch );
|
||||
#endif
|
||||
}
|
||||
|
||||
|
||||
Joy_FinalizeMove( forward, side, yaw, pitch );
|
||||
Touch_GetMove( forward, side, yaw, pitch );
|
||||
|
||||
|
||||
if( look_filter->value )
|
||||
{
|
||||
*pitch = ( inputstate.lastpitch + *pitch ) / 2;
|
||||
@@ -630,8 +545,8 @@ void IN_EngineAppendMove( float frametime, void *cmd1, qboolean active )
|
||||
{
|
||||
float sensitivity = 1;//( (float)cl.local.scr_fov / (float)90.0f );
|
||||
|
||||
IN_CollectInput( &forward, &side, &pitch, &yaw, in_mouseinitialized && !CVAR_TO_BOOL( m_ignore ), m_enginemouse->value );
|
||||
|
||||
IN_CollectInput( &forward, &side, &pitch, &yaw, false );
|
||||
|
||||
IN_JoyAppendMove( cmd, forward, side );
|
||||
|
||||
if( pitch || yaw )
|
||||
@@ -639,11 +554,36 @@ void IN_EngineAppendMove( float frametime, void *cmd1, qboolean active )
|
||||
cmd->viewangles[YAW] += yaw * sensitivity;
|
||||
cmd->viewangles[PITCH] += pitch * sensitivity;
|
||||
cmd->viewangles[PITCH] = bound( -90, cmd->viewangles[PITCH], 90 );
|
||||
VectorCopy(cmd->viewangles, cl.viewangles);
|
||||
VectorCopy( cmd->viewangles, cl.viewangles );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void IN_Commands( void )
|
||||
{
|
||||
#ifdef XASH_USE_EVDEV
|
||||
IN_EvdevFrame();
|
||||
#endif
|
||||
|
||||
if( clgame.dllFuncs.pfnLookEvent )
|
||||
{
|
||||
float forward = 0, side = 0, pitch = 0, yaw = 0;
|
||||
|
||||
IN_CollectInput( &forward, &side, &pitch, &yaw, in_mouseinitialized && !CVAR_TO_BOOL( m_ignore ) );
|
||||
|
||||
if( cls.key_dest == key_game )
|
||||
{
|
||||
clgame.dllFuncs.pfnLookEvent( yaw, pitch );
|
||||
clgame.dllFuncs.pfnMoveEvent( forward, side );
|
||||
}
|
||||
}
|
||||
|
||||
if( !in_mouseinitialized )
|
||||
return;
|
||||
|
||||
IN_CheckMouseState( in_mouseactive );
|
||||
}
|
||||
|
||||
/*
|
||||
==================
|
||||
Host_InputFrame
|
||||
@@ -653,47 +593,9 @@ Called every frame, even if not generating commands
|
||||
*/
|
||||
void Host_InputFrame( void )
|
||||
{
|
||||
qboolean shutdownMouse = false;
|
||||
float forward = 0, side = 0, pitch = 0, yaw = 0;
|
||||
|
||||
Sys_SendKeyEvents ();
|
||||
|
||||
#ifdef XASH_USE_EVDEV
|
||||
IN_EvdevFrame();
|
||||
#endif
|
||||
IN_Commands();
|
||||
|
||||
if( clgame.dllFuncs.pfnLookEvent )
|
||||
{
|
||||
IN_CollectInput( &forward, &side, &pitch, &yaw, in_mouseinitialized && !CVAR_TO_BOOL( m_ignore ), true );
|
||||
|
||||
if( cls.key_dest == key_game )
|
||||
{
|
||||
clgame.dllFuncs.pfnLookEvent( yaw, pitch );
|
||||
clgame.dllFuncs.pfnMoveEvent( forward, side );
|
||||
}
|
||||
}
|
||||
|
||||
Cbuf_Execute ();
|
||||
|
||||
if( !in_mouseinitialized )
|
||||
return;
|
||||
|
||||
if( host.status != HOST_FRAME )
|
||||
{
|
||||
IN_DeactivateMouse();
|
||||
return;
|
||||
}
|
||||
|
||||
// release mouse during pause or console typeing
|
||||
if( cl.paused && cls.key_dest == key_game )
|
||||
shutdownMouse = true;
|
||||
|
||||
if( shutdownMouse && !Cvar_VariableInteger( "fullscreen" ))
|
||||
{
|
||||
IN_DeactivateMouse();
|
||||
return;
|
||||
}
|
||||
|
||||
IN_ActivateMouse( false );
|
||||
IN_MouseMove();
|
||||
}
|
||||
|
||||
@@ -33,8 +33,8 @@ extern qboolean in_mouseinitialized;
|
||||
void IN_Init( void );
|
||||
void Host_InputFrame( void );
|
||||
void IN_Shutdown( void );
|
||||
void IN_MouseEvent( void );
|
||||
void IN_ActivateMouse( qboolean force );
|
||||
void IN_MouseEvent( int key, int down );
|
||||
void IN_ActivateMouse( void );
|
||||
void IN_DeactivateMouse( void );
|
||||
void IN_MouseSavePos( void );
|
||||
void IN_MouseRestorePos( void );
|
||||
@@ -61,12 +61,9 @@ extern convar_t *touch_enable;
|
||||
extern convar_t *touch_emulate;
|
||||
|
||||
void Touch_Draw( void );
|
||||
void Touch_SetClientOnly( qboolean state );
|
||||
void Touch_RemoveButton( const char *name );
|
||||
void Touch_HideButtons( const char *name, unsigned char hide );
|
||||
//void IN_TouchSetCommand( const char *name, const char *command );
|
||||
//void IN_TouchSetTexture( const char *name, const char *texture );
|
||||
//void IN_TouchSetColor( const char *name, byte *color );
|
||||
void Touch_SetClientOnly( byte state );
|
||||
void Touch_RemoveButton( const char *name, qboolean privileged );
|
||||
void Touch_HideButtons( const char *name, unsigned char hide, qboolean privileged );
|
||||
void Touch_AddClientButton( const char *name, const char *texture, const char *command, float x1, float y1, float x2, float y2, byte *color, int round, float aspect, int flags );
|
||||
void Touch_AddDefaultButton( const char *name, const char *texturefile, const char *command, float x1, float y1, float x2, float y2, byte *color, int round, float aspect, int flags );
|
||||
void Touch_WriteConfig( void );
|
||||
@@ -93,9 +90,21 @@ enum
|
||||
JOY_HAT_LEFTDOWN = JOY_HAT_LEFT | JOY_HAT_DOWN
|
||||
};
|
||||
|
||||
typedef enum engineAxis_e
|
||||
{
|
||||
JOY_AXIS_SIDE = 0,
|
||||
JOY_AXIS_FWD,
|
||||
JOY_AXIS_PITCH,
|
||||
JOY_AXIS_YAW,
|
||||
JOY_AXIS_RT,
|
||||
JOY_AXIS_LT,
|
||||
JOY_AXIS_NULL
|
||||
} engineAxis_t;
|
||||
|
||||
qboolean Joy_IsActive( void );
|
||||
void Joy_HatMotionEvent( byte hat, byte value );
|
||||
void Joy_AxisMotionEvent( byte axis, short value );
|
||||
void Joy_KnownAxisMotionEvent( engineAxis_t engineAxis, short value );
|
||||
void Joy_BallMotionEvent( byte ball, short xrel, short yrel );
|
||||
void Joy_ButtonEvent( byte button, byte down );
|
||||
void Joy_AddEvent( void );
|
||||
|
||||
@@ -29,7 +29,7 @@ typedef struct
|
||||
|
||||
typedef struct keyname_s
|
||||
{
|
||||
char *name; // key name
|
||||
const char *name; // key name
|
||||
int keynum; // key number
|
||||
const char *binding; // default bind
|
||||
} keyname_t;
|
||||
@@ -98,26 +98,32 @@ keyname_t keynames[] =
|
||||
{"KP_PLUS", K_KP_PLUS, "" },
|
||||
{"PAUSE", K_PAUSE, "pause" },
|
||||
|
||||
{"A_BUTTON", K_A_BUTTON, ""}, // they match xbox controller
|
||||
{"B_BUTTON", K_B_BUTTON, ""},
|
||||
{"X_BUTTON", K_X_BUTTON, ""},
|
||||
{"Y_BUTTON", K_Y_BUTTON, ""},
|
||||
{"L1_BUTTON", K_L1_BUTTON, ""},
|
||||
{"R1_BUTTON", K_R1_BUTTON, ""},
|
||||
{"BACK", K_BACK_BUTTON, ""},
|
||||
// Gamepad
|
||||
// A/B X/Y names match the Xbox controller layout
|
||||
{"A_BUTTON", K_A_BUTTON, "+jump"},
|
||||
{"B_BUTTON", K_B_BUTTON, "+use"},
|
||||
{"X_BUTTON", K_X_BUTTON, "+reload"},
|
||||
{"Y_BUTTON", K_Y_BUTTON, "impulse 100"}, // Flashlight
|
||||
{"BACK", K_BACK_BUTTON, "cancelselect"}, // Menu
|
||||
{"MODE", K_MODE_BUTTON, ""},
|
||||
{"START", K_START_BUTTON, ""},
|
||||
{"STICK1", K_LSTICK, ""},
|
||||
{"STICK2", K_RSTICK, ""},
|
||||
{"L2_BUTTON", K_L2_BUTTON, ""}, // in case...
|
||||
{"R2_BUTTON", K_R2_BUTTON, ""},
|
||||
{"START", K_START_BUTTON, "pause"},
|
||||
{"STICK1", K_LSTICK, "+speed"},
|
||||
{"STICK2", K_RSTICK, "+duck"},
|
||||
{"L1_BUTTON", K_L1_BUTTON, "+duck"},
|
||||
{"R1_BUTTON", K_R1_BUTTON, "+attack"},
|
||||
{"DPAD_UP", K_DPAD_UP, "impulse 201"}, // Spray
|
||||
{"DPAD_DOWN", K_DPAD_DOWN, "lastinv"},
|
||||
{"DPAD_LEFT", K_DPAD_LEFT, "invprev"},
|
||||
{"DPAD_RIGHT", K_DPAD_RIGHT, "invnext"},
|
||||
{"L2_BUTTON", K_L2_BUTTON, "+speed"},
|
||||
{"R2_BUTTON", K_R2_BUTTON, "+attack2"},
|
||||
{"LTRIGGER" , K_JOY1 , "+speed"}, // L2 in SDL2
|
||||
{"RTRIGGER" , K_JOY2 , "+attack2"}, // R2 in SDL2
|
||||
{"JOY3" , K_JOY3 , ""},
|
||||
{"JOY4" , K_JOY4 , ""},
|
||||
{"C_BUTTON", K_C_BUTTON, ""},
|
||||
{"Z_BUTTON", K_Z_BUTTON, ""},
|
||||
{"AUX16", K_AUX16, ""}, // generic
|
||||
{"AUX17", K_AUX17, ""},
|
||||
{"AUX18", K_AUX18, ""},
|
||||
{"AUX19", K_AUX19, ""},
|
||||
{"AUX20", K_AUX20, ""},
|
||||
{"AUX20", K_AUX20, ""}, // generic
|
||||
{"AUX21", K_AUX21, ""},
|
||||
{"AUX22", K_AUX22, ""},
|
||||
{"AUX23", K_AUX23, ""},
|
||||
@@ -130,10 +136,6 @@ keyname_t keynames[] =
|
||||
{"AUX30", K_AUX30, ""},
|
||||
{"AUX31", K_AUX31, ""},
|
||||
{"AUX32", K_AUX32, ""},
|
||||
{"LTRIGGER" , K_JOY1 , ""},
|
||||
{"RTRIGGER" , K_JOY2 , ""},
|
||||
{"JOY3" , K_JOY3 , ""},
|
||||
{"JOY4" , K_JOY4 , ""},
|
||||
|
||||
// raw semicolon seperates commands
|
||||
{"SEMICOLON", ';', "" },
|
||||
@@ -150,7 +152,7 @@ static convar_t *key_rotate;
|
||||
Key_IsDown
|
||||
===================
|
||||
*/
|
||||
int Key_IsDown( int keynum )
|
||||
int GAME_EXPORT Key_IsDown( int keynum )
|
||||
{
|
||||
if( keynum == -1 )
|
||||
return false;
|
||||
@@ -185,7 +187,7 @@ to be configured even if they don't have defined names.
|
||||
int Key_StringToKeynum( const char *str )
|
||||
{
|
||||
keyname_t *kn;
|
||||
|
||||
|
||||
if( !str || !str[0] ) return -1;
|
||||
if( !str[1] ) return str[0];
|
||||
|
||||
@@ -193,7 +195,7 @@ int Key_StringToKeynum( const char *str )
|
||||
if( str[0] == '0' && str[1] == 'x' && Q_strlen( str ) == 4 )
|
||||
{
|
||||
int n1, n2;
|
||||
|
||||
|
||||
n1 = str[2];
|
||||
if( n1 >= '0' && n1 <= '9' )
|
||||
{
|
||||
@@ -239,7 +241,7 @@ given keynum.
|
||||
*/
|
||||
const char *Key_KeynumToString( int keynum )
|
||||
{
|
||||
keyname_t *kn;
|
||||
keyname_t *kn;
|
||||
static char tinystr[5];
|
||||
int i, j;
|
||||
|
||||
@@ -279,7 +281,7 @@ const char *Key_KeynumToString( int keynum )
|
||||
Key_SetBinding
|
||||
===================
|
||||
*/
|
||||
void Key_SetBinding( int keynum, const char *binding )
|
||||
void GAME_EXPORT Key_SetBinding( int keynum, const char *binding )
|
||||
{
|
||||
if( keynum == -1 ) return;
|
||||
|
||||
@@ -289,7 +291,7 @@ void Key_SetBinding( int keynum, const char *binding )
|
||||
Mem_Free((char *)keys[keynum].binding );
|
||||
keys[keynum].binding = NULL;
|
||||
}
|
||||
|
||||
|
||||
// allocate memory for new binding
|
||||
keys[keynum].binding = copystring( binding );
|
||||
}
|
||||
@@ -306,32 +308,32 @@ const char *Key_GetBinding( int keynum )
|
||||
return keys[keynum].binding;
|
||||
}
|
||||
|
||||
/*
|
||||
/*
|
||||
===================
|
||||
Key_GetKey
|
||||
===================
|
||||
*/
|
||||
int Key_GetKey( const char *pBinding )
|
||||
{
|
||||
int i;
|
||||
int i, len;
|
||||
const char *p;
|
||||
|
||||
if( !pBinding ) return -1;
|
||||
|
||||
len = Q_strlen( pBinding );
|
||||
|
||||
for( i = 0; i < 256; i++ )
|
||||
{
|
||||
if( !keys[i].binding )
|
||||
continue;
|
||||
|
||||
if( *keys[i].binding == '+' )
|
||||
{
|
||||
if( !Q_strnicmp( keys[i].binding + 1, pBinding, Q_strlen( pBinding )))
|
||||
return i;
|
||||
}
|
||||
else
|
||||
{
|
||||
if( !Q_strnicmp( keys[i].binding, pBinding, Q_strlen( pBinding )))
|
||||
return i;
|
||||
}
|
||||
p = keys[i].binding;
|
||||
|
||||
if( *p == '+' )
|
||||
p++;
|
||||
|
||||
if( !Q_strnicmp( p, pBinding, len ) )
|
||||
return i;
|
||||
}
|
||||
|
||||
return -1;
|
||||
@@ -351,7 +353,7 @@ void Key_Unbind_f( void )
|
||||
Con_Printf( S_USAGE "unbind <key> : remove commands from a key\n" );
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
b = Key_StringToKeynum( Cmd_Argv( 1 ));
|
||||
|
||||
if( b == -1 )
|
||||
@@ -371,7 +373,7 @@ Key_Unbindall_f
|
||||
void Key_Unbindall_f( void )
|
||||
{
|
||||
int i;
|
||||
|
||||
|
||||
for( i = 0; i < 256; i++ )
|
||||
{
|
||||
if( keys[i].binding )
|
||||
@@ -392,7 +394,7 @@ void Key_Reset_f( void )
|
||||
keyname_t *kn;
|
||||
int i;
|
||||
|
||||
// clear all keys first
|
||||
// clear all keys first
|
||||
for( i = 0; i < 256; i++ )
|
||||
{
|
||||
if( keys[i].binding )
|
||||
@@ -401,7 +403,7 @@ void Key_Reset_f( void )
|
||||
|
||||
// apply default values
|
||||
for( kn = keynames; kn->name; kn++ )
|
||||
Key_SetBinding( kn->keynum, kn->binding );
|
||||
Key_SetBinding( kn->keynum, kn->binding );
|
||||
}
|
||||
|
||||
/*
|
||||
@@ -413,7 +415,7 @@ void Key_Bind_f( void )
|
||||
{
|
||||
char cmd[1024];
|
||||
int i, c, b;
|
||||
|
||||
|
||||
c = Cmd_Argc();
|
||||
|
||||
if( c < 2 )
|
||||
@@ -437,7 +439,7 @@ void Key_Bind_f( void )
|
||||
else Con_Printf( "\"%s\" is not bound\n", Cmd_Argv( 1 ));
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
// copy the rest of the command line
|
||||
cmd[0] = 0; // start out with a null string
|
||||
|
||||
@@ -460,6 +462,7 @@ Writes lines containing "bind key value"
|
||||
void Key_WriteBindings( file_t *f )
|
||||
{
|
||||
int i;
|
||||
string newCommand;
|
||||
|
||||
if( !f ) return;
|
||||
|
||||
@@ -470,7 +473,8 @@ void Key_WriteBindings( file_t *f )
|
||||
if( !COM_CheckString( keys[i].binding ))
|
||||
continue;
|
||||
|
||||
FS_Printf( f, "bind %s \"%s\"\n", Key_KeynumToString( i ), keys[i].binding );
|
||||
Cmd_Escape( newCommand, keys[i].binding, sizeof( newCommand ));
|
||||
FS_Printf( f, "bind %s \"%s\"\n", Key_KeynumToString( i ), newCommand );
|
||||
}
|
||||
}
|
||||
|
||||
@@ -510,18 +514,18 @@ void Key_Init( void )
|
||||
keyname_t *kn;
|
||||
|
||||
// register our functions
|
||||
Cmd_AddCommand( "bind", Key_Bind_f, "binds a command to the specified key in bindmap" );
|
||||
Cmd_AddCommand( "unbind", Key_Unbind_f, "removes a command on the specified key in bindmap" );
|
||||
Cmd_AddCommand( "unbindall", Key_Unbindall_f, "removes all commands from all keys in bindmap" );
|
||||
Cmd_AddCommand( "resetkeys", Key_Reset_f, "reset all keys to their default values" );
|
||||
Cmd_AddRestrictedCommand( "bind", Key_Bind_f, "binds a command to the specified key in bindmap" );
|
||||
Cmd_AddRestrictedCommand( "unbind", Key_Unbind_f, "removes a command on the specified key in bindmap" );
|
||||
Cmd_AddRestrictedCommand( "unbindall", Key_Unbindall_f, "removes all commands from all keys in bindmap" );
|
||||
Cmd_AddRestrictedCommand( "resetkeys", Key_Reset_f, "reset all keys to their default values" );
|
||||
Cmd_AddCommand( "bindlist", Key_Bindlist_f, "display current key bindings" );
|
||||
Cmd_AddCommand( "makehelp", Key_EnumCmds_f, "write help.txt that contains all console cvars and cmds" );
|
||||
Cmd_AddCommand( "makehelp", Key_EnumCmds_f, "write help.txt that contains all console cvars and cmds" );
|
||||
|
||||
// setup default binding. "unbindall" from config.cfg will be reset it
|
||||
for( kn = keynames; kn->name; kn++ ) Key_SetBinding( kn->keynum, kn->binding );
|
||||
for( kn = keynames; kn->name; kn++ ) Key_SetBinding( kn->keynum, kn->binding );
|
||||
|
||||
osk_enable = Cvar_Get( "osk_enable", "0", FCVAR_ARCHIVE, "enable built-in on-screen keyboard" );
|
||||
key_rotate = Cvar_Get( "key_rotate", "0", FCVAR_ARCHIVE, "rotate arrow keys (0-3)" );
|
||||
osk_enable = Cvar_Get( "osk_enable", "0", FCVAR_ARCHIVE | FCVAR_FILTERABLE, "enable built-in on-screen keyboard" );
|
||||
key_rotate = Cvar_Get( "key_rotate", "0", FCVAR_ARCHIVE | FCVAR_FILTERABLE, "rotate arrow keys (0-3)" );
|
||||
|
||||
}
|
||||
|
||||
@@ -592,7 +596,7 @@ static qboolean Key_IsAllowedAutoRepeat( int key )
|
||||
return true;
|
||||
default:
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
static int Key_Rotate( int key )
|
||||
@@ -644,7 +648,7 @@ Key_Event
|
||||
Called by the system for both key up and key down events
|
||||
===================
|
||||
*/
|
||||
void Key_Event( int key, int down )
|
||||
void GAME_EXPORT Key_Event( int key, int down )
|
||||
{
|
||||
const char *kb;
|
||||
|
||||
@@ -774,7 +778,7 @@ void Key_Event( int key, int down )
|
||||
|
||||
// key up events only perform actions if the game key binding is
|
||||
// a button command (leading + sign). These will be processed even in
|
||||
// console mode and menu mode, to keep the character from continuing
|
||||
// console mode and menu mode, to keep the character from continuing
|
||||
// an action started before a mode switch.
|
||||
if( !down )
|
||||
{
|
||||
@@ -810,9 +814,9 @@ void Key_EnableTextInput( qboolean enable, qboolean force )
|
||||
OSK_EnableTextInput( enable, force );
|
||||
return;
|
||||
}
|
||||
if( enable && ( !host.textmode || force ) )
|
||||
if( enable && ( !host.textmode || force ))
|
||||
Platform_EnableTextInput( true );
|
||||
else if( !enable )
|
||||
else if( !enable && ( host.textmode || force ))
|
||||
Platform_EnableTextInput( false );
|
||||
|
||||
host.textmode = enable;
|
||||
@@ -823,7 +827,7 @@ void Key_EnableTextInput( qboolean enable, qboolean force )
|
||||
Key_SetKeyDest
|
||||
=========
|
||||
*/
|
||||
void Key_SetKeyDest( int key_dest )
|
||||
void GAME_EXPORT Key_SetKeyDest( int key_dest )
|
||||
{
|
||||
IN_ToggleClientMouse( key_dest, cls.key_dest );
|
||||
|
||||
@@ -856,7 +860,7 @@ void Key_SetKeyDest( int key_dest )
|
||||
Key_ClearStates
|
||||
===================
|
||||
*/
|
||||
void Key_ClearStates( void )
|
||||
void GAME_EXPORT Key_ClearStates( void )
|
||||
{
|
||||
int i;
|
||||
|
||||
@@ -892,7 +896,7 @@ void CL_CharEvent( int key )
|
||||
if( cls.key_dest == key_console && !Con_Visible( ))
|
||||
{
|
||||
if((char)key == '`' || (char)key == '?' )
|
||||
return; // don't pass '`' when we open the console
|
||||
return; // don't pass '`' when we open the console
|
||||
}
|
||||
|
||||
// distribute the key down event to the apropriate handler
|
||||
@@ -915,13 +919,17 @@ A helper function if platform input doesn't support text mode properly
|
||||
*/
|
||||
int Key_ToUpper( int keynum )
|
||||
{
|
||||
keynum = Q_toupper( keynum );
|
||||
if( keynum == '-' )
|
||||
keynum = '_';
|
||||
if( keynum == '=' )
|
||||
keynum = '+';
|
||||
keynum = Q_toupper( keynum );
|
||||
if( keynum == '-' )
|
||||
keynum = '_';
|
||||
if( keynum == '=' )
|
||||
keynum = '+';
|
||||
if( keynum == ';' )
|
||||
keynum = ':';
|
||||
if( keynum == '\'' )
|
||||
keynum = '"';
|
||||
|
||||
return keynum;
|
||||
return keynum;
|
||||
}
|
||||
|
||||
/* On-screen keyboard:
|
||||
@@ -1036,7 +1044,7 @@ static qboolean OSK_KeyEvent( int key, int down )
|
||||
else
|
||||
osk.curlayout++;
|
||||
|
||||
osk.shift = osk.curbutton.val == OSK_SHIFT;
|
||||
osk.shift = true;
|
||||
osk.curbutton.val = osk_keylayout[osk.curlayout][osk.curbutton.y][osk.curbutton.x];
|
||||
break;
|
||||
case OSK_BACKSPACE:
|
||||
|
||||
@@ -15,9 +15,9 @@ GNU General Public License for more details.
|
||||
#include "common.h"
|
||||
#include "client.h"
|
||||
#include "mod_local.h"
|
||||
#include "mathlib.h"
|
||||
#include "xash3d_mathlib.h"
|
||||
#include "world.h"
|
||||
|
||||
#include "eiface.h" // offsetof
|
||||
|
||||
#define MAX_CLIPNODE_DEPTH 256 // should never exceeds
|
||||
|
||||
@@ -67,7 +67,7 @@ _inline void list_del( hullnode_t *entry )
|
||||
|
||||
static winding_t * winding_alloc( uint numpoints )
|
||||
{
|
||||
return (winding_t *)malloc( (int)((winding_t *)0)->p[numpoints] );
|
||||
return (winding_t *)malloc( offsetof( winding_t, p[numpoints] ) );
|
||||
}
|
||||
|
||||
static void free_winding( winding_t *w )
|
||||
@@ -84,7 +84,7 @@ static winding_t *winding_copy( winding_t *w )
|
||||
winding_t *neww;
|
||||
|
||||
neww = winding_alloc( w->numpoints );
|
||||
memcpy( neww, w, (int)((winding_t *)0)->p[w->numpoints] );
|
||||
memcpy( neww, w, offsetof( winding_t, p[w->numpoints] ) );
|
||||
|
||||
return neww;
|
||||
}
|
||||
@@ -111,7 +111,7 @@ static void winding_reverse( winding_t *w )
|
||||
static winding_t *winding_shrink( winding_t *w )
|
||||
{
|
||||
winding_t *neww = winding_alloc( w->numpoints );
|
||||
memcpy( neww, w, (int)((winding_t *)0)->p[w->numpoints] );
|
||||
memcpy( neww, w, offsetof( winding_t, p[w->numpoints] ));
|
||||
free_winding( w );
|
||||
|
||||
return neww;
|
||||
|
||||
@@ -13,7 +13,7 @@ convar_t *gl_showtextures;
|
||||
convar_t *r_decals;
|
||||
convar_t *r_adjust_fov;
|
||||
convar_t *r_showtree;
|
||||
convar_t *gl_wgl_msaa_samples;
|
||||
convar_t *gl_msaa_samples;
|
||||
convar_t *gl_clear;
|
||||
convar_t *r_refdll;
|
||||
|
||||
@@ -30,7 +30,7 @@ GL_FreeImage
|
||||
Frees image by name
|
||||
================
|
||||
*/
|
||||
void GL_FreeImage( const char *name )
|
||||
void GAME_EXPORT GL_FreeImage( const char *name )
|
||||
{
|
||||
int texnum;
|
||||
|
||||
@@ -41,12 +41,17 @@ void GL_FreeImage( const char *name )
|
||||
ref.dllFuncs.GL_FreeTexture( texnum );
|
||||
}
|
||||
|
||||
void GL_RenderFrame( const ref_viewpass_t *rvp )
|
||||
void R_UpdateRefState( void )
|
||||
{
|
||||
refState.time = cl.time;
|
||||
refState.oldtime = cl.oldtime;
|
||||
refState.realtime = host.realtime;
|
||||
refState.frametime = host.frametime;
|
||||
}
|
||||
|
||||
void GL_RenderFrame( const ref_viewpass_t *rvp )
|
||||
{
|
||||
R_UpdateRefState();
|
||||
|
||||
VectorCopy( rvp->vieworigin, refState.vieworg );
|
||||
VectorCopy( rvp->viewangles, refState.viewangles );
|
||||
@@ -173,7 +178,7 @@ static int pfnGetStudioModelInterface( int version, struct r_studio_interface_s
|
||||
0;
|
||||
}
|
||||
|
||||
static byte *pfnImage_GetPool( void )
|
||||
static poolhandle_t pfnImage_GetPool( void )
|
||||
{
|
||||
return host.imagepool;
|
||||
}
|
||||
@@ -325,12 +330,11 @@ static ref_api_t gEngfuncs =
|
||||
_Mem_Realloc,
|
||||
_Mem_Free,
|
||||
|
||||
COM_LoadLibrary,
|
||||
_COM_LoadLibrary,
|
||||
COM_FreeLibrary,
|
||||
COM_GetProcAddress,
|
||||
|
||||
FS_LoadFile,
|
||||
COM_ParseFile,
|
||||
FS_FileExists,
|
||||
FS_AllowDirectPaths,
|
||||
|
||||
@@ -503,7 +507,7 @@ void R_Shutdown( void )
|
||||
|
||||
static void R_GetRendererName( char *dest, size_t size, const char *opt )
|
||||
{
|
||||
if( !Q_strstr( opt, va( ".%s", OS_LIB_EXT )))
|
||||
if( !Q_strstr( opt, "." OS_LIB_EXT ))
|
||||
{
|
||||
const char *format;
|
||||
|
||||
@@ -581,10 +585,9 @@ static void SetFullscreenModeFromCommandLine( void )
|
||||
void R_CollectRendererNames( void )
|
||||
{
|
||||
const char *renderers[] = DEFAULT_RENDERERS;
|
||||
int i;
|
||||
|
||||
ref.numRenderers = 0;
|
||||
int i, cur;
|
||||
|
||||
cur = 0;
|
||||
for( i = 0; i < DEFAULT_RENDERERS_LEN; i++ )
|
||||
{
|
||||
string temp;
|
||||
@@ -607,42 +610,65 @@ void R_CollectRendererNames( void )
|
||||
continue;
|
||||
}
|
||||
|
||||
Q_strncpy( ref.shortNames[i], renderers[i], sizeof( ref.shortNames[i] ));
|
||||
Q_strncpy( ref.shortNames[cur], renderers[i], sizeof( ref.shortNames[cur] ));
|
||||
|
||||
pfn = COM_GetProcAddress( dll, GET_REF_HUMANREADABLE_NAME );
|
||||
if( !pfn ) // just in case
|
||||
{
|
||||
Con_Reportf( "R_CollectRendererNames: can't find GetHumanReadableName export in %s\n", temp );
|
||||
Q_strncpy( ref.readableNames[i], renderers[i], sizeof( ref.readableNames[i] ));
|
||||
Q_strncpy( ref.readableNames[cur], renderers[i], sizeof( ref.readableNames[cur] ));
|
||||
}
|
||||
else
|
||||
{
|
||||
REF_HUMANREADABLE_NAME GetHumanReadableName = (REF_HUMANREADABLE_NAME)pfn;
|
||||
|
||||
GetHumanReadableName( ref.readableNames[i], sizeof( ref.readableNames[i] ));
|
||||
GetHumanReadableName( ref.readableNames[cur], sizeof( ref.readableNames[cur] ));
|
||||
}
|
||||
|
||||
Con_Printf( "Found renderer %s: %s\n", ref.shortNames[i], ref.readableNames[i] );
|
||||
Con_Printf( "Found renderer %s: %s\n", ref.shortNames[cur], ref.readableNames[cur] );
|
||||
|
||||
ref.numRenderers++;
|
||||
cur++;
|
||||
COM_FreeLibrary( dll );
|
||||
}
|
||||
ref.numRenderers = cur;
|
||||
}
|
||||
|
||||
qboolean R_Init( void )
|
||||
{
|
||||
qboolean success = false;
|
||||
string refopt;
|
||||
string requested;
|
||||
|
||||
gl_vsync = Cvar_Get( "gl_vsync", "0", FCVAR_ARCHIVE, "enable vertical syncronization" );
|
||||
gl_showtextures = Cvar_Get( "r_showtextures", "0", FCVAR_CHEAT, "show all uploaded textures" );
|
||||
r_adjust_fov = Cvar_Get( "r_adjust_fov", "1", FCVAR_ARCHIVE, "making FOV adjustment for wide-screens" );
|
||||
r_decals = Cvar_Get( "r_decals", "4096", FCVAR_ARCHIVE, "sets the maximum number of decals" );
|
||||
gl_wgl_msaa_samples = Cvar_Get( "gl_wgl_msaa_samples", "0", FCVAR_GLCONFIG, "samples number for multisample anti-aliasing" );
|
||||
gl_msaa_samples = Cvar_Get( "gl_msaa_samples", "0", FCVAR_GLCONFIG, "samples number for multisample anti-aliasing" );
|
||||
gl_clear = Cvar_Get( "gl_clear", "0", FCVAR_ARCHIVE, "clearing screen after each frame" );
|
||||
r_showtree = Cvar_Get( "r_showtree", "0", FCVAR_ARCHIVE, "build the graph of visible BSP tree" );
|
||||
r_refdll = Cvar_Get( "r_refdll", "", FCVAR_RENDERINFO|FCVAR_VIDRESTART, "choose renderer implementation, if supported" );
|
||||
|
||||
// cvars that are expected to exist
|
||||
Cvar_Get( "r_speeds", "0", FCVAR_ARCHIVE, "shows renderer speeds" );
|
||||
Cvar_Get( "r_fullbright", "0", FCVAR_CHEAT, "disable lightmaps, get fullbright for entities" );
|
||||
Cvar_Get( "r_norefresh", "0", 0, "disable 3D rendering (use with caution)" );
|
||||
Cvar_Get( "r_dynamic", "1", FCVAR_ARCHIVE, "allow dynamic lighting (dlights, lightstyles)" );
|
||||
Cvar_Get( "r_lightmap", "0", FCVAR_CHEAT, "lightmap debugging tool" );
|
||||
Cvar_Get( "tracerred", "0.8", 0, "tracer red component weight ( 0 - 1.0 )" );
|
||||
Cvar_Get( "tracergreen", "0.8", 0, "tracer green component weight ( 0 - 1.0 )" );
|
||||
Cvar_Get( "tracerblue", "0.4", 0, "tracer blue component weight ( 0 - 1.0 )" );
|
||||
Cvar_Get( "traceralpha", "0.5", 0, "tracer alpha amount ( 0 - 1.0 )" );
|
||||
|
||||
Cvar_Get( "r_sprite_lerping", "1", FCVAR_ARCHIVE, "enables sprite animation lerping" );
|
||||
Cvar_Get( "r_sprite_lighting", "1", FCVAR_ARCHIVE, "enables sprite lighting (blood etc)" );
|
||||
|
||||
Cvar_Get( "r_drawviewmodel", "1", 0, "draw firstperson weapon model" );
|
||||
Cvar_Get( "r_glowshellfreq", "2.2", 0, "glowing shell frequency update" );
|
||||
|
||||
// cvars that are expected to exist by client.dll
|
||||
// refdll should just get pointer to them
|
||||
Cvar_Get( "r_drawentities", "1", FCVAR_CHEAT, "render entities" );
|
||||
Cvar_Get( "cl_himodels", "1", FCVAR_ARCHIVE, "draw high-resolution player models in multiplayer" );
|
||||
|
||||
// cvars are created, execute video config
|
||||
Cbuf_AddText( "exec video.cfg" );
|
||||
Cbuf_Execute();
|
||||
@@ -654,27 +680,34 @@ qboolean R_Init( void )
|
||||
|
||||
R_CollectRendererNames();
|
||||
|
||||
// command line have priority
|
||||
if( !Sys_GetParmFromCmdLine( "-ref", refopt ) )
|
||||
{
|
||||
// Priority:
|
||||
// 1. Command line `-ref` argument.
|
||||
// 2. `ref_dll` cvar.
|
||||
// 3. Detected renderers in `DEFAULT_RENDERERS` order.
|
||||
requested[0] = '\0';
|
||||
if( !Sys_GetParmFromCmdLine( "-ref", requested ) && COM_CheckString( r_refdll->string ) )
|
||||
// r_refdll is set to empty by default, so we can change hardcoded defaults just in case
|
||||
Q_strncpy( refopt, COM_CheckString( r_refdll->string ) ?
|
||||
r_refdll->string : DEFAULT_ACCELERATED_RENDERER, sizeof( refopt ) );
|
||||
}
|
||||
Q_strncpy( requested, r_refdll->string, sizeof( requested ) );
|
||||
|
||||
if( !(success = R_LoadRenderer( refopt )))
|
||||
if ( requested[0] )
|
||||
success = R_LoadRenderer( requested );
|
||||
|
||||
if( !success )
|
||||
{
|
||||
// check if we are tried to load default accelearated renderer already
|
||||
// and if not, load it first
|
||||
if( Q_strcmp( refopt, DEFAULT_ACCELERATED_RENDERER ) )
|
||||
{
|
||||
success = R_LoadRenderer( refopt );
|
||||
}
|
||||
int i;
|
||||
|
||||
// software renderer is the last chance...
|
||||
if( !success )
|
||||
// cycle through renderers that we collected in CollectRendererNames
|
||||
for( i = 0; i < ref.numRenderers; i++ )
|
||||
{
|
||||
success = R_LoadRenderer( DEFAULT_SOFTWARE_RENDERER );
|
||||
// skip renderer that was requested but failed to load
|
||||
if( !Q_strcmp( requested, ref.shortNames[i] ) )
|
||||
continue;
|
||||
|
||||
success = R_LoadRenderer( ref.shortNames[i] );
|
||||
|
||||
// yay, found working one
|
||||
if( success )
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -51,5 +51,8 @@ extern convar_t *gl_clear;
|
||||
|
||||
qboolean R_Init( void );
|
||||
void R_Shutdown( void );
|
||||
void R_UpdateRefState( void );
|
||||
|
||||
extern triangleapi_t gTriApi;
|
||||
|
||||
#endif // REF_COMMON_H
|
||||
|
||||
@@ -33,7 +33,6 @@ GNU General Public License for more details.
|
||||
|
||||
#define MAXDLY (STEREODLY + 1)
|
||||
#define MAXLP 10
|
||||
#define MAXPRESETS 29
|
||||
|
||||
typedef struct sx_preset_s
|
||||
{
|
||||
@@ -79,7 +78,7 @@ typedef struct dly_s
|
||||
int *lpdelayline;
|
||||
} dly_t;
|
||||
|
||||
const sx_preset_t rgsxpre[MAXPRESETS] =
|
||||
const sx_preset_t rgsxpre[] =
|
||||
{
|
||||
// -------reverb-------- -------delay--------
|
||||
// lp mod size refl rvblp delay feedback dlylp left
|
||||
@@ -114,6 +113,45 @@ const sx_preset_t rgsxpre[MAXPRESETS] =
|
||||
{ 0.0, 0.0, 0.001, 0.999, 0.0, 0.2, 0.8, 2.0, 0.05 } // 28
|
||||
};
|
||||
|
||||
// 0x0045dca8 enginegl.exe
|
||||
// SHA256: 42383d32cd712e59ee2c1bd78b7ba48814e680e7026c4223e730111f34a60d66
|
||||
const sx_preset_t rgsxpre_hlalpha052[] =
|
||||
{
|
||||
// -------reverb-------- -------delay--------
|
||||
// lp mod size refl rvblp delay feedback dlylp left
|
||||
{ 0.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 2.0, 0.0 }, // 0 off
|
||||
{ 0.0, 0.0, 0.0, 0.0, 1.0, 0.08, 0.8, 2.0, 0.0 }, // 1 generic
|
||||
{ 0.0, 0.0, 0.0, 0.0, 1.0, 0.02, 0.75, 0.0, 0.001 }, // 2 metalic
|
||||
{ 0.0, 0.0, 0.0, 0.0, 1.0, 0.03, 0.78, 0.0, 0.002 }, // 3
|
||||
{ 0.0, 0.0, 0.0, 0.0, 1.0, 0.06, 0.77, 0.0, 0.003 }, // 4
|
||||
{ 0.0, 0.0, 0.05, 0.85, 1.0, 0.008, 0.96, 2.0, 0.01 }, // 5 tunnel
|
||||
{ 0.0, 0.0, 0.05, 0.88, 1.0, 0.01, 0.98, 2.0, 0.02 }, // 6
|
||||
{ 0.0, 0.0, 0.05, 0.92, 1.0, 0.015, 0.995, 2.0, 0.04 }, // 7
|
||||
{ 0.0, 0.0, 0.05, 0.84, 1.0, 0.0, 0.0, 2.0, 0.003 }, // 8 chamber
|
||||
{ 0.0, 0.0, 0.05, 0.9, 1.0, 0.0, 0.0, 2.0, 0.002 }, // 9
|
||||
{ 0.0, 0.0, 0.05, 0.95, 1.0, 0.0, 0.0, 2.0, 0.001 }, // 10
|
||||
{ 0.0, 0.0, 0.05, 0.7, 0.0, 0.0, 0.0, 2.0, 0.003 }, // 11 brite
|
||||
{ 0.0, 0.0, 0.055, 0.78, 0.0, 0.0, 0.0, 2.0, 0.002 }, // 12
|
||||
{ 0.0, 0.0, 0.05, 0.86, 0.0, 0.0, 0.0, 2.0, 0.001 }, // 13
|
||||
{ 1.0, 1.0, 0.0, 0.0, 1.0, 0.0, 0.0, 2.0, 0.01 }, // 14 water
|
||||
{ 1.0, 1.0, 0.0, 0.0, 1.0, 0.06, 0.85, 2.0, 0.02 }, // 15
|
||||
{ 1.0, 1.0, 0.0, 0.0, 1.0, 0.2, 0.6, 2.0, 0.05 }, // 16
|
||||
{ 0.0, 0.0, 0.05, 0.8, 1.0, 0.15, 0.48, 2.0, 0.008 }, // 17 concrete
|
||||
{ 0.0, 0.0, 0.06, 0.9, 1.0, 0.22, 0.52, 2.0, 0.005 }, // 18
|
||||
{ 0.0, 0.0, 0.07, 0.94, 1.0, 0.3, 0.6, 2.0, 0.001 }, // 19
|
||||
{ 0.0, 0.0, 0.0, 0.0, 1.0, 0.3, 0.42, 2.0, 0.0 }, // 20 outside
|
||||
{ 0.0, 0.0, 0.0, 0.0, 1.0, 0.35, 0.48, 2.0, 0.0 }, // 21
|
||||
{ 0.0, 0.0, 0.0, 0.0, 1.0, 0.38, 0.6, 2.0, 0.0 }, // 22
|
||||
{ 0.0, 0.0, 0.05, 0.9, 1.0, 0.2, 0.28, 0.0, 0.0 }, // 23 cavern
|
||||
{ 0.0, 0.0, 0.07, 0.9, 1.0, 0.3, 0.4, 0.0, 0.0 }, // 24
|
||||
{ 0.0, 0.0, 0.09, 0.9, 1.0, 0.35, 0.5, 0.0, 0.0 }, // 25
|
||||
{ 0.0, 1.0, 0.01, 0.9, 0.0, 0.0, 0.0, 2.0, 0.05 }, // 26 weirdo
|
||||
{ 0.0, 0.0, 0.0, 0.0, 1.0, 0.009, 0.999, 2.0, 0.04 }, // 27
|
||||
{ 0.0, 0.0, 0.001, 0.999, 0.0, 0.2, 0.8, 2.0, 0.05 }, // 28
|
||||
};
|
||||
|
||||
const sx_preset_t *ptable = rgsxpre;
|
||||
|
||||
// cvars
|
||||
convar_t *dsp_off; // disable dsp
|
||||
convar_t *roomwater_type; // water room_type
|
||||
@@ -138,6 +176,8 @@ convar_t *sxdly_feedback; // cycles
|
||||
convar_t *sxdly_delay; // current delay in seconds
|
||||
|
||||
convar_t *dsp_room; // for compability
|
||||
|
||||
convar_t *dsp_coeff_table; // use release or 0.52 style
|
||||
int idsp_dma_speed;
|
||||
int idsp_room;
|
||||
int room_typeprev;
|
||||
@@ -194,6 +234,8 @@ void SX_Init( void )
|
||||
sxmod2cur = sxmod2 = 450 * ( idsp_dma_speed / SOUND_11k );
|
||||
|
||||
dsp_off = Cvar_Get( "dsp_off", "0", FCVAR_ARCHIVE, "disable DSP processing" );
|
||||
dsp_coeff_table = Cvar_Get( "dsp_coeff_table", "0", FCVAR_ARCHIVE, "select DSP coefficient table: 0 for release or 1 for alpha 0.52" );
|
||||
|
||||
roomwater_type = Cvar_Get( "waterroom_type", "14", 0, "water room type" );
|
||||
room_type = Cvar_Get( "room_type", "0", 0, "current room type preset" );
|
||||
|
||||
@@ -352,8 +394,6 @@ void DLY_CheckNewStereoDelayVal( void )
|
||||
if( dly->delaysamples == 0 )
|
||||
DLY_Free( STEREODLY );
|
||||
}
|
||||
|
||||
ClearBits( sxste_delay->flags, FCVAR_CHANGED );
|
||||
}
|
||||
|
||||
/*
|
||||
@@ -441,7 +481,7 @@ void DLY_CheckNewDelayVal( void )
|
||||
}
|
||||
else
|
||||
{
|
||||
delay = min( delay, MAX_MONO_DELAY );
|
||||
delay = Q_min( delay, MAX_MONO_DELAY );
|
||||
dly->delaysamples = (int)(delay * idsp_dma_speed) << sxhires;
|
||||
|
||||
// init dly
|
||||
@@ -463,7 +503,6 @@ void DLY_CheckNewDelayVal( void )
|
||||
}
|
||||
}
|
||||
|
||||
ClearBits( sxdly_delay->flags, FCVAR_CHANGED );
|
||||
dly->lp = sxdly_lp->value;
|
||||
dly->delayfeedback = 255 * sxdly_feedback->value;
|
||||
}
|
||||
@@ -497,9 +536,9 @@ void DLY_DoDelay( int count )
|
||||
|
||||
if( dly->lp ) // lowpass
|
||||
{
|
||||
val = ( dly->lp0 + dly->lp1 + val ) / 3;
|
||||
dly->lp0 = dly->lp1;
|
||||
dly->lp1 = val;
|
||||
val = ( dly->lp0 + dly->lp1 + (val << 1) ) >> 2;
|
||||
}
|
||||
|
||||
dly->lpdelayline[dly->idelayinput] = val;
|
||||
@@ -512,7 +551,7 @@ void DLY_DoDelay( int count )
|
||||
else
|
||||
{
|
||||
dly->lpdelayline[dly->idelayinput] = 0;
|
||||
dly->lp0 = dly->lp1 = 0;
|
||||
dly->lp0 = dly->lp1 = dly->lp2 = 0;
|
||||
}
|
||||
|
||||
DLY_MovePointer( dly );
|
||||
@@ -547,7 +586,7 @@ void RVB_SetUpDly( int pos, float delay, int kmod )
|
||||
rgsxdly[pos].idelayoutputxf = rgsxdly[pos].idelayinput - samples;
|
||||
if( rgsxdly[pos].idelayoutputxf < 0 )
|
||||
rgsxdly[pos].idelayoutputxf += rgsxdly[pos].cdelaysamplesmax;
|
||||
rgsxdly[pos].xfade = 32;
|
||||
rgsxdly[pos].xfade = REVERB_XFADE;
|
||||
}
|
||||
|
||||
if( !rgsxdly[pos].delaysamples )
|
||||
@@ -582,7 +621,6 @@ void RVB_CheckNewReverbVal( void )
|
||||
}
|
||||
}
|
||||
|
||||
ClearBits( sxrvb_size->flags, FCVAR_CHANGED );
|
||||
dly1->lp = dly2->lp = sxrvb_lp->value;
|
||||
dly1->delayfeedback = dly2->delayfeedback = (int)(255 * sxrvb_feedback->value);
|
||||
}
|
||||
@@ -609,14 +647,14 @@ int RVB_DoReverbForOneDly( dly_t *dly, const int vlr, const portable_samplepair_
|
||||
if( dly->xfade || delay || samplepair->left || samplepair->right )
|
||||
{
|
||||
// modulate delay rate
|
||||
if( !dly->xfade && !dly->modcur && dly->mod )
|
||||
if( !dly->mod )
|
||||
{
|
||||
dly->idelayoutputxf = dly->idelayoutput + ((COM_RandomLong( 0, 255 ) * delay) >> 9 );
|
||||
|
||||
//dly->xfade = 32;
|
||||
}
|
||||
dly->idelayoutputxf %= dly->cdelaysamplesmax;
|
||||
|
||||
dly->idelayoutputxf %= dly->cdelaysamplesmax;
|
||||
dly->xfade = REVERB_XFADE;
|
||||
}
|
||||
|
||||
if( dly->xfade )
|
||||
{
|
||||
@@ -685,7 +723,9 @@ void RVB_DoReverb( int count )
|
||||
voutm = RVB_DoReverbForOneDly( dly1, vlr, paint );
|
||||
voutm += RVB_DoReverbForOneDly( dly2, vlr, paint );
|
||||
|
||||
voutm = (11 * voutm) >> 6;
|
||||
if( dsp_coeff_table->value == 1.0f )
|
||||
voutm /= 6; // alpha
|
||||
else voutm = (11 * voutm) >> 6;
|
||||
|
||||
paint->left = CLIP( paint->left + voutm );
|
||||
paint->right = CLIP( paint->right + voutm );
|
||||
@@ -718,17 +758,18 @@ void RVB_DoAMod( int count )
|
||||
res.left >>= 2;
|
||||
res.right >>= 2;
|
||||
|
||||
rgsxlp[4] = paint->left;
|
||||
rgsxlp[9] = paint->right;
|
||||
|
||||
rgsxlp[0] = rgsxlp[1];
|
||||
rgsxlp[1] = rgsxlp[2];
|
||||
rgsxlp[2] = rgsxlp[3];
|
||||
rgsxlp[3] = rgsxlp[4];
|
||||
rgsxlp[4] = paint->left;
|
||||
|
||||
rgsxlp[4] = rgsxlp[5];
|
||||
rgsxlp[5] = rgsxlp[6];
|
||||
rgsxlp[6] = rgsxlp[7];
|
||||
rgsxlp[7] = rgsxlp[8];
|
||||
rgsxlp[8] = rgsxlp[9];
|
||||
rgsxlp[9] = paint->right;
|
||||
}
|
||||
|
||||
if( sxmod_mod->value )
|
||||
@@ -814,12 +855,33 @@ void CheckNewDspPresets( void )
|
||||
if( dsp_off->value != 0.0f )
|
||||
return;
|
||||
|
||||
if( FBitSet( dsp_coeff_table->flags, FCVAR_CHANGED ))
|
||||
{
|
||||
switch( (int)dsp_coeff_table->value )
|
||||
{
|
||||
case 0: // release
|
||||
ptable = rgsxpre;
|
||||
break;
|
||||
case 1: // alpha
|
||||
ptable = rgsxpre_hlalpha052;
|
||||
break;
|
||||
default:
|
||||
ptable = rgsxpre;
|
||||
break;
|
||||
}
|
||||
|
||||
SX_ReloadRoomFX();
|
||||
room_typeprev = -1;
|
||||
|
||||
ClearBits( dsp_coeff_table->flags, FCVAR_CHANGED );
|
||||
}
|
||||
|
||||
if( s_listener.waterlevel > 2 )
|
||||
idsp_room = roomwater_type->value;
|
||||
else idsp_room = room_type->value;
|
||||
|
||||
// don't pass invalid presets
|
||||
idsp_room = bound( 0, idsp_room, MAXPRESETS - 1 );
|
||||
idsp_room = bound( 0, idsp_room, MAX_ROOM_TYPES );
|
||||
|
||||
if( FBitSet( hisound->flags, FCVAR_CHANGED ))
|
||||
{
|
||||
@@ -830,12 +892,11 @@ void CheckNewDspPresets( void )
|
||||
if( idsp_room == room_typeprev && idsp_room == 0 )
|
||||
return;
|
||||
|
||||
if( idsp_room > MAX_ROOM_TYPES )
|
||||
return;
|
||||
|
||||
if( idsp_room != room_typeprev )
|
||||
{
|
||||
const sx_preset_t *cur = rgsxpre + idsp_room;
|
||||
const sx_preset_t *cur;
|
||||
|
||||
cur = ptable + idsp_room;
|
||||
|
||||
Cvar_SetValue( "room_lp", cur->room_lp );
|
||||
Cvar_SetValue( "room_mod", cur->room_mod );
|
||||
@@ -853,6 +914,10 @@ void CheckNewDspPresets( void )
|
||||
RVB_CheckNewReverbVal( );
|
||||
DLY_CheckNewDelayVal( );
|
||||
DLY_CheckNewStereoDelayVal();
|
||||
|
||||
ClearBits( sxrvb_size->flags, FCVAR_CHANGED );
|
||||
ClearBits( sxdly_delay->flags, FCVAR_CHANGED );
|
||||
ClearBits( sxste_delay->flags, FCVAR_CHANGED );
|
||||
}
|
||||
|
||||
void SX_Profiling_f( void )
|
||||
|
||||
@@ -56,7 +56,7 @@ void S_SoundList_f( void )
|
||||
else Con_Printf( " " );
|
||||
if( sfx->name[0] == '*' )
|
||||
Con_Printf( " (%2db) %s : %s\n", sc->width * 8, Q_memprint( sc->size ), sfx->name );
|
||||
else Con_Printf( " (%2db) %s : %s%s\n", sc->width * 8, Q_memprint( sc->size ), DEFAULT_SOUNDPATH, sfx->name );
|
||||
else Con_Printf( " (%2db) %s : " DEFAULT_SOUNDPATH "%s\n", sc->width * 8, Q_memprint( sc->size ), sfx->name );
|
||||
totalSfx++;
|
||||
}
|
||||
}
|
||||
@@ -141,6 +141,9 @@ wavdata_t *S_LoadSound( sfx_t *sfx )
|
||||
if( Q_stricmp( sfx->name, "*default" ))
|
||||
{
|
||||
// load it from disk
|
||||
if( s_warn_late_precache.value > 0 && CL_Active() )
|
||||
Con_Printf( S_WARN "S_LoadSound: late precache of %s\n", sfx->name );
|
||||
|
||||
if( sfx->name[0] == '*' )
|
||||
sc = FS_LoadSound( sfx->name + 1, NULL, 0 );
|
||||
else sc = FS_LoadSound( sfx->name, NULL, 0 );
|
||||
@@ -211,7 +214,7 @@ sfx_t *S_FindName( const char *pname, int *pfInCache )
|
||||
return NULL;
|
||||
s_numSfx++;
|
||||
}
|
||||
|
||||
|
||||
sfx = &s_knownSfx[i];
|
||||
memset( sfx, 0, sizeof( *sfx ));
|
||||
if( pfInCache ) *pfInCache = false;
|
||||
@@ -222,7 +225,7 @@ sfx_t *S_FindName( const char *pname, int *pfInCache )
|
||||
// link it in
|
||||
sfx->hashNext = s_sfxHashList[sfx->hashValue];
|
||||
s_sfxHashList[sfx->hashValue] = sfx;
|
||||
|
||||
|
||||
return sfx;
|
||||
}
|
||||
|
||||
@@ -299,7 +302,7 @@ void S_EndRegistration( void )
|
||||
|
||||
if( !s_registering || !dma.initialized )
|
||||
return;
|
||||
|
||||
|
||||
// free any sounds not from this registration sequence
|
||||
for( i = 0, sfx = s_knownSfx; i < s_numSfx; i++, sfx++ )
|
||||
{
|
||||
|
||||
@@ -23,7 +23,7 @@ GNU General Public License for more details.
|
||||
#define SND_CLIP_DISTANCE 1000.0f
|
||||
|
||||
dma_t dma;
|
||||
byte *sndpool;
|
||||
poolhandle_t sndpool;
|
||||
static soundfade_t soundfade;
|
||||
channel_t channels[MAX_CHANNELS];
|
||||
sound_t ambient_sfx[NUM_AMBIENTS];
|
||||
@@ -35,17 +35,18 @@ int total_channels;
|
||||
int soundtime; // sample PAIRS
|
||||
int paintedtime; // sample PAIRS
|
||||
|
||||
convar_t *s_volume;
|
||||
convar_t *s_musicvolume;
|
||||
convar_t *s_show;
|
||||
convar_t *s_mixahead;
|
||||
convar_t *s_lerping;
|
||||
convar_t *s_ambient_level;
|
||||
convar_t *s_ambient_fade;
|
||||
convar_t *s_combine_sounds;
|
||||
convar_t *snd_mute_losefocus;
|
||||
convar_t *s_test; // cvar for testing new effects
|
||||
convar_t *s_samplecount;
|
||||
static CVAR_DEFINE( s_volume, "volume", "0.7", FCVAR_ARCHIVE|FCVAR_FILTERABLE, "sound volume" );
|
||||
CVAR_DEFINE( s_musicvolume, "MP3Volume", "1.0", FCVAR_ARCHIVE|FCVAR_FILTERABLE, "background music volume" );
|
||||
static CVAR_DEFINE( s_mixahead, "_snd_mixahead", "0.12", FCVAR_FILTERABLE, "how much sound to mix ahead of time" );
|
||||
static CVAR_DEFINE_AUTO( s_show, "0", FCVAR_ARCHIVE|FCVAR_FILTERABLE, "show playing sounds" );
|
||||
CVAR_DEFINE_AUTO( s_lerping, "0", FCVAR_ARCHIVE|FCVAR_FILTERABLE, "apply interpolation to sound output" );
|
||||
static CVAR_DEFINE( s_ambient_level, "ambient_level", "0.3", FCVAR_ARCHIVE|FCVAR_FILTERABLE, "volume of environment noises (water and wind)" );
|
||||
static CVAR_DEFINE( s_ambient_fade, "ambient_fade", "1000", FCVAR_ARCHIVE|FCVAR_FILTERABLE, "rate of volume fading when client is moving" );
|
||||
static CVAR_DEFINE_AUTO( s_combine_sounds, "0", FCVAR_ARCHIVE|FCVAR_FILTERABLE, "combine channels with same sounds" );
|
||||
CVAR_DEFINE_AUTO( snd_mute_losefocus, "1", FCVAR_ARCHIVE|FCVAR_FILTERABLE, "silence the audio when game window loses focus" );
|
||||
CVAR_DEFINE_AUTO( s_test, "0", 0, "engine developer cvar for quick testing new features" );
|
||||
CVAR_DEFINE_AUTO( s_samplecount, "0", FCVAR_ARCHIVE|FCVAR_FILTERABLE, "sample count (0 for default value)" );
|
||||
CVAR_DEFINE_AUTO( s_warn_late_precache, "0", FCVAR_ARCHIVE|FCVAR_FILTERABLE, "warn about late precached sounds on client-side" );
|
||||
|
||||
/*
|
||||
=============================================================================
|
||||
@@ -68,7 +69,7 @@ float S_GetMasterVolume( void )
|
||||
scale = bound( 0.0f, soundfade.percent / 100.0f, 1.0f );
|
||||
scale = 1.0f - scale;
|
||||
}
|
||||
return s_volume->value * scale;
|
||||
return s_volume.value * scale;
|
||||
}
|
||||
|
||||
/*
|
||||
@@ -80,8 +81,8 @@ void S_FadeClientVolume( float fadePercent, float fadeOutSeconds, float holdTime
|
||||
{
|
||||
soundfade.starttime = cl.mtime[0];
|
||||
soundfade.initial_percent = fadePercent;
|
||||
soundfade.fadeouttime = fadeOutSeconds;
|
||||
soundfade.holdtime = holdTime;
|
||||
soundfade.fadeouttime = fadeOutSeconds;
|
||||
soundfade.holdtime = holdTime;
|
||||
soundfade.fadeintime = fadeInSeconds;
|
||||
}
|
||||
|
||||
@@ -97,7 +98,7 @@ qboolean S_IsClient( int entnum )
|
||||
|
||||
|
||||
// free channel so that it may be allocated by the
|
||||
// next request to play a sound. If sound is a
|
||||
// next request to play a sound. If sound is a
|
||||
// word in a sentence, release the sentence.
|
||||
// Works for static, dynamic, sentence and stream sounds
|
||||
/*
|
||||
@@ -129,7 +130,7 @@ void S_UpdateSoundFade( void )
|
||||
|
||||
// determine current fade value.
|
||||
// assume no fading remains
|
||||
soundfade.percent = 0;
|
||||
soundfade.percent = 0;
|
||||
|
||||
totaltime = soundfade.fadeouttime + soundfade.fadeintime + soundfade.holdtime;
|
||||
|
||||
@@ -178,7 +179,7 @@ void S_UpdateSoundFade( void )
|
||||
=================
|
||||
SND_FStreamIsPlaying
|
||||
|
||||
Select a channel from the dynamic channel allocation area. For the given entity,
|
||||
Select a channel from the dynamic channel allocation area. For the given entity,
|
||||
override any other sound playing on the same channel (see code comments below for
|
||||
exceptions).
|
||||
=================
|
||||
@@ -200,7 +201,7 @@ qboolean SND_FStreamIsPlaying( sfx_t *sfx )
|
||||
=================
|
||||
SND_PickDynamicChannel
|
||||
|
||||
Select a channel from the dynamic channel allocation area. For the given entity,
|
||||
Select a channel from the dynamic channel allocation area. For the given entity,
|
||||
override any other sound playing on the same channel (see code comments below for
|
||||
exceptions).
|
||||
=================
|
||||
@@ -227,7 +228,7 @@ channel_t *SND_PickDynamicChannel( int entnum, int channel, sfx_t *sfx, qboolean
|
||||
for( ch_idx = NUM_AMBIENTS; ch_idx < MAX_DYNAMIC_CHANNELS; ch_idx++ )
|
||||
{
|
||||
channel_t *ch = &channels[ch_idx];
|
||||
|
||||
|
||||
// Never override a streaming sound that is currently playing or
|
||||
// voice over IP data that is playing or any sound on CHAN_VOICE( acting )
|
||||
if( ch->sfx && ( ch->entchannel == CHAN_STREAM ))
|
||||
@@ -290,8 +291,8 @@ channel_t *SND_PickDynamicChannel( int entnum, int channel, sfx_t *sfx, qboolean
|
||||
SND_PickStaticChannel
|
||||
|
||||
Pick an empty channel from the static sound area, or allocate a new
|
||||
channel. Only fails if we're at max_channels (128!!!) or if
|
||||
we're trying to allocate a channel for a stream sound that is
|
||||
channel. Only fails if we're at max_channels (128!!!) or if
|
||||
we're trying to allocate a channel for a stream sound that is
|
||||
already playing.
|
||||
=====================
|
||||
*/
|
||||
@@ -310,7 +311,7 @@ channel_t *SND_PickStaticChannel( const vec3_t pos, sfx_t *sfx )
|
||||
break;
|
||||
}
|
||||
|
||||
if( i < total_channels )
|
||||
if( i < total_channels )
|
||||
{
|
||||
// reuse an empty static sound channel
|
||||
ch = &channels[i];
|
||||
@@ -346,7 +347,7 @@ returns FALSE if sound was not found (sound is not playing)
|
||||
int S_AlterChannel( int entnum, int channel, sfx_t *sfx, int vol, int pitch, int flags )
|
||||
{
|
||||
channel_t *ch;
|
||||
int i;
|
||||
int i;
|
||||
|
||||
if( S_TestSoundChar( sfx->name, '!' ))
|
||||
{
|
||||
@@ -361,10 +362,10 @@ int S_AlterChannel( int entnum, int channel, sfx_t *sfx, int vol, int pitch, int
|
||||
{
|
||||
if( flags & SND_CHANGE_PITCH )
|
||||
ch->basePitch = pitch;
|
||||
|
||||
|
||||
if( flags & SND_CHANGE_VOL )
|
||||
ch->master_vol = vol;
|
||||
|
||||
|
||||
if( flags & SND_STOP )
|
||||
S_FreeChannel( ch );
|
||||
|
||||
@@ -383,7 +384,7 @@ int S_AlterChannel( int entnum, int channel, sfx_t *sfx, int vol, int pitch, int
|
||||
{
|
||||
if( flags & SND_CHANGE_PITCH )
|
||||
ch->basePitch = pitch;
|
||||
|
||||
|
||||
if( flags & SND_CHANGE_VOL )
|
||||
ch->master_vol = vol;
|
||||
|
||||
@@ -476,7 +477,7 @@ void SND_Spatialize( channel_t *ch )
|
||||
====================
|
||||
S_StartSound
|
||||
|
||||
Start a sound effect for the given entity on the given channel (ie; voice, weapon etc).
|
||||
Start a sound effect for the given entity on the given channel (ie; voice, weapon etc).
|
||||
Try to grab a channel out of the 8 dynamic spots available.
|
||||
Currently used for looping sounds, streaming sounds, sentences, and regular entity sounds.
|
||||
NOTE: volume is 0.0 - 1.0 and attenuation is 0.0 - 1.0 when passed in.
|
||||
@@ -509,7 +510,7 @@ void S_StartSound( const vec3_t pos, int ent, int chan, sound_t handle, float fv
|
||||
return;
|
||||
|
||||
if( flags & SND_STOP ) return;
|
||||
// fall through - if we're not trying to stop the sound,
|
||||
// fall through - if we're not trying to stop the sound,
|
||||
// and we didn't find it (it's not playing), go ahead and start it up
|
||||
}
|
||||
|
||||
@@ -525,13 +526,15 @@ void S_StartSound( const vec3_t pos, int ent, int chan, sound_t handle, float fv
|
||||
if( !target_chan )
|
||||
{
|
||||
if( !bIgnore )
|
||||
Con_DPrintf( S_ERROR "dropped sound \"%s%s\"\n", DEFAULT_SOUNDPATH, sfx->name );
|
||||
Con_DPrintf( S_ERROR "dropped sound \"" DEFAULT_SOUNDPATH "%s\"\n", sfx->name );
|
||||
return;
|
||||
}
|
||||
|
||||
// spatialize
|
||||
memset( target_chan, 0, sizeof( *target_chan ));
|
||||
|
||||
pitch *= (sys_timescale.value + 1) / 2;
|
||||
|
||||
VectorCopy( pos, target_chan->origin );
|
||||
target_chan->staticsound = ( ent == 0 ) ? true : false;
|
||||
target_chan->use_loop = (flags & SND_STOP_LOOPING) ? false : true;
|
||||
@@ -552,7 +555,7 @@ void S_StartSound( const vec3_t pos, int ent, int chan, sound_t handle, float fv
|
||||
// link all words and load the first word
|
||||
// NOTE: sentence names stored in the cache lookup are
|
||||
// prepended with a '!'. Sentence names stored in the
|
||||
// sentence file do not have a leading '!'.
|
||||
// sentence file do not have a leading '!'.
|
||||
VOX_LoadSound( target_chan, S_SkipSoundChar( sfx->name ));
|
||||
Q_strncpy( target_chan->name, sfx->name, sizeof( target_chan->name ));
|
||||
sfx = target_chan->sfx;
|
||||
@@ -574,7 +577,7 @@ void S_StartSound( const vec3_t pos, int ent, int chan, sound_t handle, float fv
|
||||
SND_Spatialize( target_chan );
|
||||
|
||||
// If a client can't hear a sound when they FIRST receive the StartSound message,
|
||||
// the client will never be able to hear that sound. This is so that out of
|
||||
// the client will never be able to hear that sound. This is so that out of
|
||||
// range sounds don't fill the playback buffer. For streaming sounds, we bypass this optimization.
|
||||
if( !target_chan->leftvol && !target_chan->rightvol )
|
||||
{
|
||||
@@ -637,7 +640,7 @@ void S_RestoreSound( const vec3_t pos, int ent, int chan, sound_t handle, float
|
||||
if( !target_chan )
|
||||
{
|
||||
if( !bIgnore )
|
||||
Con_DPrintf( S_ERROR "dropped sound \"%s%s\"\n", DEFAULT_SOUNDPATH, sfx->name );
|
||||
Con_DPrintf( S_ERROR "dropped sound \"" DEFAULT_SOUNDPATH "%s\"\n", sfx->name );
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -664,7 +667,7 @@ void S_RestoreSound( const vec3_t pos, int ent, int chan, sound_t handle, float
|
||||
// link all words and load the first word
|
||||
// NOTE: sentence names stored in the cache lookup are
|
||||
// prepended with a '!'. Sentence names stored in the
|
||||
// sentence file do not have a leading '!'.
|
||||
// sentence file do not have a leading '!'.
|
||||
VOX_LoadSound( target_chan, S_SkipSoundChar( sfx->name ));
|
||||
Q_strncpy( target_chan->name, sfx->name, sizeof( target_chan->name ));
|
||||
|
||||
@@ -708,7 +711,7 @@ void S_RestoreSound( const vec3_t pos, int ent, int chan, sound_t handle, float
|
||||
|
||||
// apply the sample offests
|
||||
target_chan->pMixer.sample = sample;
|
||||
target_chan->pMixer.forcedEndSample = end;
|
||||
target_chan->pMixer.forcedEndSample = end;
|
||||
|
||||
// Init client entity mouth movement vars
|
||||
SND_InitMouth( ent, chan );
|
||||
@@ -763,7 +766,7 @@ void S_AmbientSound( const vec3_t pos, int ent, sound_t handle, float fvol, floa
|
||||
// this is a sentence. link words to play in sequence.
|
||||
// NOTE: sentence names stored in the cache lookup are
|
||||
// prepended with a '!'. Sentence names stored in the
|
||||
// sentence file do not have a leading '!'.
|
||||
// sentence file do not have a leading '!'.
|
||||
|
||||
// link all words and load the first word
|
||||
VOX_LoadSound( ch, S_SkipSoundChar( sfx->name ));
|
||||
@@ -787,6 +790,8 @@ void S_AmbientSound( const vec3_t pos, int ent, sound_t handle, float fvol, floa
|
||||
return;
|
||||
}
|
||||
|
||||
pitch *= (sys_timescale.value + 1) / 2;
|
||||
|
||||
// never update positions if source entity is 0
|
||||
ch->staticsound = ( ent == 0 ) ? true : false;
|
||||
ch->use_loop = (flags & SND_STOP_LOOPING) ? false : true;
|
||||
@@ -812,7 +817,7 @@ void S_StartLocalSound( const char *name, float volume, qboolean reliable )
|
||||
|
||||
if( reliable ) channel = CHAN_STATIC;
|
||||
|
||||
if( !dma.initialized ) return;
|
||||
if( !dma.initialized ) return;
|
||||
sfxHandle = S_RegisterSound( name );
|
||||
S_StartSound( NULL, s_listener.entnum, channel, sfxHandle, volume, ATTN_NONE, PITCH_NORM, flags );
|
||||
}
|
||||
@@ -881,7 +886,7 @@ int S_GetCurrentDynamicSounds( soundlist_t *pout, int size )
|
||||
looped = ( channels[i].use_loop && channels[i].sfx->cache->loopStart != -1 );
|
||||
|
||||
if( channels[i].entchannel == CHAN_STATIC && looped && !Host_IsQuakeCompatible())
|
||||
continue; // never serialize static looped sounds. It will be restoring in game code
|
||||
continue; // never serialize static looped sounds. It will be restoring in game code
|
||||
|
||||
if( channels[i].isSentence && channels[i].name[0] )
|
||||
Q_strncpy( pout->name, channels[i].name, sizeof( pout->name ));
|
||||
@@ -916,7 +921,7 @@ void S_InitAmbientChannels( void )
|
||||
|
||||
for( ambient_channel = 0; ambient_channel < NUM_AMBIENTS; ambient_channel++ )
|
||||
{
|
||||
chan = &channels[ambient_channel];
|
||||
chan = &channels[ambient_channel];
|
||||
|
||||
chan->staticsound = true;
|
||||
chan->use_loop = true;
|
||||
@@ -945,7 +950,7 @@ void S_UpdateAmbientSounds( void )
|
||||
|
||||
leaf = Mod_PointInLeaf( s_listener.origin, cl.worldmodel->nodes );
|
||||
|
||||
if( !leaf || !s_ambient_level->value )
|
||||
if( !leaf || !s_ambient_level.value )
|
||||
{
|
||||
for( ambient_channel = 0; ambient_channel < NUM_AMBIENTS; ambient_channel++ )
|
||||
channels[ambient_channel].sfx = NULL;
|
||||
@@ -954,7 +959,7 @@ void S_UpdateAmbientSounds( void )
|
||||
|
||||
for( ambient_channel = 0; ambient_channel < NUM_AMBIENTS; ambient_channel++ )
|
||||
{
|
||||
chan = &channels[ambient_channel];
|
||||
chan = &channels[ambient_channel];
|
||||
chan->sfx = S_GetSfxByHandle( ambient_sfx[ambient_channel] );
|
||||
|
||||
// ambient is unused
|
||||
@@ -965,21 +970,21 @@ void S_UpdateAmbientSounds( void )
|
||||
continue;
|
||||
}
|
||||
|
||||
vol = s_ambient_level->value * leaf->ambient_sound_level[ambient_channel];
|
||||
vol = s_ambient_level.value * leaf->ambient_sound_level[ambient_channel];
|
||||
if( vol < 0 ) vol = 0;
|
||||
|
||||
// don't adjust volume too fast
|
||||
if( chan->master_vol < vol )
|
||||
{
|
||||
chan->master_vol += s_listener.frametime * s_ambient_fade->value;
|
||||
chan->master_vol += s_listener.frametime * s_ambient_fade.value;
|
||||
if( chan->master_vol > vol ) chan->master_vol = vol;
|
||||
}
|
||||
else if( chan->master_vol > vol )
|
||||
{
|
||||
chan->master_vol -= s_listener.frametime * s_ambient_fade->value;
|
||||
chan->master_vol -= s_listener.frametime * s_ambient_fade.value;
|
||||
if( chan->master_vol < vol ) chan->master_vol = vol;
|
||||
}
|
||||
|
||||
|
||||
chan->leftvol = chan->rightvol = chan->master_vol;
|
||||
}
|
||||
}
|
||||
@@ -1150,7 +1155,6 @@ void S_RawSamples( uint samples, uint rate, word width, word channels, const byt
|
||||
int snd_vol = 128;
|
||||
|
||||
if( entnum < 0 ) snd_vol = 256; // bg track or movie track
|
||||
if( snd_vol < 0 ) snd_vol = 0; // fixup negative values
|
||||
|
||||
S_RawEntSamples( entnum, samples, rate, width, channels, data, snd_vol );
|
||||
}
|
||||
@@ -1192,7 +1196,7 @@ void S_StreamAviSamples( void *Avi, int entnum, float fvol, float attn, float sy
|
||||
ch->s_rawend = soundtime;
|
||||
|
||||
// position is changed, synchronization is lost etc
|
||||
if( fabs( ch->oldtime - synctime ) > s_mixahead->value )
|
||||
if( fabs( ch->oldtime - synctime ) > s_mixahead.value )
|
||||
ch->sound_info.loopStart = AVI_TimeToSoundPosition( Avi, synctime * 1000 );
|
||||
ch->oldtime = synctime; // keep actual time
|
||||
|
||||
@@ -1240,7 +1244,7 @@ void S_StreamAviSamples( void *Avi, int entnum, float fvol, float attn, float sy
|
||||
S_GetRawSamplesLength
|
||||
===================
|
||||
*/
|
||||
uint S_GetRawSamplesLength( int entnum )
|
||||
uint S_GetRawSamplesLength( int entnum )
|
||||
{
|
||||
rawchan_t *ch;
|
||||
|
||||
@@ -1255,7 +1259,7 @@ uint S_GetRawSamplesLength( int entnum )
|
||||
S_ClearRawChannel
|
||||
===================
|
||||
*/
|
||||
void S_ClearRawChannel( int entnum )
|
||||
void S_ClearRawChannel( int entnum )
|
||||
{
|
||||
rawchan_t *ch;
|
||||
|
||||
@@ -1320,7 +1324,7 @@ S_SpatializeRawChannels
|
||||
static void S_SpatializeRawChannels( void )
|
||||
{
|
||||
int i;
|
||||
|
||||
|
||||
for( i = 0; i < MAX_RAW_CHANNELS; i++ )
|
||||
{
|
||||
rawchan_t *ch = raw_channels[i];
|
||||
@@ -1409,7 +1413,7 @@ S_StopSound
|
||||
stop all sounds for entity on a channel.
|
||||
==================
|
||||
*/
|
||||
void S_StopSound( int entnum, int channel, const char *soundname )
|
||||
void GAME_EXPORT S_StopSound( int entnum, int channel, const char *soundname )
|
||||
{
|
||||
sfx_t *sfx;
|
||||
|
||||
@@ -1430,7 +1434,7 @@ void S_StopAllSounds( qboolean ambient )
|
||||
if( !dma.initialized ) return;
|
||||
total_channels = MAX_DYNAMIC_CHANNELS; // no statics
|
||||
|
||||
for( i = 0; i < MAX_CHANNELS; i++ )
|
||||
for( i = 0; i < MAX_CHANNELS; i++ )
|
||||
{
|
||||
if( !channels[i].sfx ) continue;
|
||||
S_FreeChannel( &channels[i] );
|
||||
@@ -1450,6 +1454,45 @@ void S_StopAllSounds( qboolean ambient )
|
||||
memset( &soundfade, 0, sizeof( soundfade ));
|
||||
}
|
||||
|
||||
/*
|
||||
==============
|
||||
S_GetSoundtime
|
||||
|
||||
update global soundtime
|
||||
|
||||
(was part of platform code)
|
||||
===============
|
||||
*/
|
||||
static int S_GetSoundtime( void )
|
||||
{
|
||||
static int buffers, oldsamplepos;
|
||||
int samplepos, fullsamples;
|
||||
|
||||
fullsamples = dma.samples / 2;
|
||||
|
||||
// it is possible to miscount buffers
|
||||
// if it has wrapped twice between
|
||||
// calls to S_Update. Oh well.
|
||||
samplepos = dma.samplepos;
|
||||
|
||||
if( samplepos < oldsamplepos )
|
||||
{
|
||||
buffers++; // buffer wrapped
|
||||
|
||||
if( paintedtime > 0x40000000 )
|
||||
{
|
||||
// time to chop things off to avoid 32 bit limits
|
||||
buffers = 0;
|
||||
paintedtime = fullsamples;
|
||||
S_StopAllSounds( true );
|
||||
}
|
||||
}
|
||||
|
||||
oldsamplepos = samplepos;
|
||||
|
||||
return ( buffers * fullsamples + samplepos / 2 );
|
||||
}
|
||||
|
||||
//=============================================================================
|
||||
void S_UpdateChannels( void )
|
||||
{
|
||||
@@ -1461,20 +1504,20 @@ void S_UpdateChannels( void )
|
||||
if( !dma.buffer ) return;
|
||||
|
||||
// updates DMA time
|
||||
soundtime = SNDDMA_GetSoundtime();
|
||||
soundtime = S_GetSoundtime();
|
||||
|
||||
// soundtime - total samples that have been played out to hardware at dmaspeed
|
||||
// paintedtime - total samples that have been mixed at speed
|
||||
// endtime - target for samples in mixahead buffer at speed
|
||||
endtime = soundtime + s_mixahead->value * SOUND_DMA_SPEED;
|
||||
endtime = soundtime + s_mixahead.value * SOUND_DMA_SPEED;
|
||||
samps = dma.samples >> 1;
|
||||
|
||||
if((int)(endtime - soundtime) > samps )
|
||||
endtime = soundtime + samps;
|
||||
|
||||
|
||||
if(( endtime - paintedtime ) & 0x3 )
|
||||
{
|
||||
// the difference between endtime and painted time should align on
|
||||
// the difference between endtime and painted time should align on
|
||||
// boundaries of 4 samples. this is important when upsampling from 11khz -> 44khz.
|
||||
endtime -= ( endtime - paintedtime ) & 0x3;
|
||||
}
|
||||
@@ -1507,7 +1550,7 @@ update listener position
|
||||
void S_UpdateFrame( struct ref_viewpass_s *rvp )
|
||||
{
|
||||
if( !FBitSet( rvp->flags, RF_DRAW_WORLD ) || FBitSet( rvp->flags, RF_ONLY_CLIENTDRAW ))
|
||||
return;
|
||||
return;
|
||||
|
||||
VectorCopy( rvp->vieworigin, s_listener.origin );
|
||||
AngleVectors( rvp->viewangles, s_listener.forward, s_listener.right, s_listener.up );
|
||||
@@ -1550,7 +1593,7 @@ void SND_UpdateSound( void )
|
||||
|
||||
combine = NULL;
|
||||
|
||||
// update spatialization for static and dynamic sounds
|
||||
// update spatialization for static and dynamic sounds
|
||||
for( i = NUM_AMBIENTS, ch = channels + NUM_AMBIENTS; i < total_channels; i++, ch++ )
|
||||
{
|
||||
if( !ch->sfx ) continue;
|
||||
@@ -1562,7 +1605,7 @@ void SND_UpdateSound( void )
|
||||
// try to combine static sounds with a previous channel of the same
|
||||
// sound effect so we don't mix five torches every frame
|
||||
// g-cont: perfomance option, probably kill stereo effect in most cases
|
||||
if( i >= MAX_DYNAMIC_CHANNELS && s_combine_sounds->value )
|
||||
if( i >= MAX_DYNAMIC_CHANNELS && s_combine_sounds.value )
|
||||
{
|
||||
// see if it can just use the last one
|
||||
if( combine && combine->sfx == ch->sfx )
|
||||
@@ -1602,7 +1645,7 @@ void SND_UpdateSound( void )
|
||||
S_SpatializeRawChannels();
|
||||
|
||||
// debugging output
|
||||
if( CVAR_TO_BOOL( s_show ))
|
||||
if( s_show.value != 0.0f )
|
||||
{
|
||||
info.color[0] = 1.0f;
|
||||
info.color[1] = 0.6f;
|
||||
@@ -1623,7 +1666,7 @@ void SND_UpdateSound( void )
|
||||
VectorSet( info.color, 1.0f, 1.0f, 1.0f );
|
||||
info.index = 0;
|
||||
|
||||
Con_NXPrintf( &info, "room_type: %i ----(%i)---- painted: %i\n", idsp_room, total - 1, paintedtime );
|
||||
Con_NXPrintf( &info, "room_type: %i (%s) ----(%i)---- painted: %i\n", idsp_room, Cvar_VariableString( "dsp_coeff_table" ), total - 1, paintedtime );
|
||||
}
|
||||
|
||||
S_StreamBackgroundTrack ();
|
||||
@@ -1679,26 +1722,41 @@ void S_PlayVol_f( void )
|
||||
S_StartLocalSound( Cmd_Argv( 1 ), Q_atof( Cmd_Argv( 2 )), false );
|
||||
}
|
||||
|
||||
static void S_Say( const char *name, qboolean reliable )
|
||||
{
|
||||
char sentence[1024];
|
||||
|
||||
// predefined vox sentence
|
||||
if( name[0] == '!' )
|
||||
{
|
||||
S_StartLocalSound( name, 1.0f, reliable );
|
||||
return;
|
||||
}
|
||||
|
||||
Q_snprintf( sentence, sizeof( sentence ), "!#%s", name );
|
||||
S_StartLocalSound( sentence, 1.0f, reliable );
|
||||
}
|
||||
|
||||
void S_Say_f( void )
|
||||
{
|
||||
if( Cmd_Argc() == 1 )
|
||||
{
|
||||
Con_Printf( S_USAGE "speak <soundfile>\n" );
|
||||
Con_Printf( S_USAGE "speak <vox sentence>\n" );
|
||||
return;
|
||||
}
|
||||
|
||||
S_StartLocalSound( Cmd_Argv( 1 ), 1.0f, false );
|
||||
S_Say( Cmd_Argv( 1 ), false );
|
||||
}
|
||||
|
||||
void S_SayReliable_f( void )
|
||||
{
|
||||
if( Cmd_Argc() == 1 )
|
||||
{
|
||||
Con_Printf( S_USAGE "spk <soundfile>\n" );
|
||||
Con_Printf( S_USAGE "spk <vox sentence>\n" );
|
||||
return;
|
||||
}
|
||||
|
||||
S_StartLocalSound( Cmd_Argv( 1 ), 1.0f, true );
|
||||
S_Say( Cmd_Argv( 1 ), true );
|
||||
}
|
||||
|
||||
/*
|
||||
@@ -1719,7 +1777,7 @@ void S_Music_f( void )
|
||||
else if( c == 2 )
|
||||
{
|
||||
string intro, main, track;
|
||||
char *ext[] = { "mp3", "wav" };
|
||||
const char *ext[] = { "mp3", "wav" };
|
||||
int i;
|
||||
|
||||
Q_strncpy( track, Cmd_Argv( 1 ), sizeof( track ));
|
||||
@@ -1815,17 +1873,18 @@ qboolean S_Init( void )
|
||||
return false;
|
||||
}
|
||||
|
||||
s_volume = Cvar_Get( "volume", "0.7", FCVAR_ARCHIVE, "sound volume" );
|
||||
s_musicvolume = Cvar_Get( "MP3Volume", "1.0", FCVAR_ARCHIVE, "background music volume" );
|
||||
s_mixahead = Cvar_Get( "_snd_mixahead", "0.12", 0, "how much sound to mix ahead of time" );
|
||||
s_show = Cvar_Get( "s_show", "0", FCVAR_ARCHIVE, "show playing sounds" );
|
||||
s_lerping = Cvar_Get( "s_lerping", "0", FCVAR_ARCHIVE, "apply interpolation to sound output" );
|
||||
s_ambient_level = Cvar_Get( "ambient_level", "0.3", FCVAR_ARCHIVE, "volume of environment noises (water and wind)" );
|
||||
s_ambient_fade = Cvar_Get( "ambient_fade", "1000", FCVAR_ARCHIVE, "rate of volume fading when client is moving" );
|
||||
s_combine_sounds = Cvar_Get( "s_combine_channels", "0", FCVAR_ARCHIVE, "combine channels with same sounds" );
|
||||
snd_mute_losefocus = Cvar_Get( "snd_mute_losefocus", "1", FCVAR_ARCHIVE, "silence the audio when game window loses focus" );
|
||||
s_test = Cvar_Get( "s_test", "0", 0, "engine developer cvar for quick testing new features" );
|
||||
s_samplecount = Cvar_Get( "s_samplecount", "0", FCVAR_ARCHIVE, "sample count (0 for default value)" );
|
||||
Cvar_RegisterVariable( &s_volume );
|
||||
Cvar_RegisterVariable( &s_musicvolume );
|
||||
Cvar_RegisterVariable( &s_mixahead );
|
||||
Cvar_RegisterVariable( &s_show );
|
||||
Cvar_RegisterVariable( &s_lerping );
|
||||
Cvar_RegisterVariable( &s_ambient_level );
|
||||
Cvar_RegisterVariable( &s_ambient_fade );
|
||||
Cvar_RegisterVariable( &s_combine_sounds );
|
||||
Cvar_RegisterVariable( &snd_mute_losefocus );
|
||||
Cvar_RegisterVariable( &s_test );
|
||||
Cvar_RegisterVariable( &s_samplecount );
|
||||
Cvar_RegisterVariable( &s_warn_late_precache );
|
||||
|
||||
Cmd_AddCommand( "play", S_Play_f, "playing a specified sound file" );
|
||||
Cmd_AddCommand( "play2", S_Play2_f, "playing a group of specified sound files" ); // nehahra stuff
|
||||
|
||||
@@ -109,7 +109,7 @@ void S_TransferPaintBuffer( int endtime )
|
||||
//===============================================================================
|
||||
// Mix buffer (paintbuffer) management routines
|
||||
//===============================================================================
|
||||
// Activate a paintbuffer. All active paintbuffers are mixed in parallel within
|
||||
// Activate a paintbuffer. All active paintbuffers are mixed in parallel within
|
||||
// MIX_MixChannelsToPaintbuffer, according to flags
|
||||
_inline void MIX_ActivatePaintbuffer( int ipaintbuffer )
|
||||
{
|
||||
@@ -146,7 +146,7 @@ _inline int MIX_GetCurrentPaintbufferIndex( void )
|
||||
_inline paintbuffer_t *MIX_GetCurrentPaintbufferPtr( void )
|
||||
{
|
||||
int ipaint = MIX_GetCurrentPaintbufferIndex();
|
||||
|
||||
|
||||
Assert( ipaint < CPAINTBUFFERS );
|
||||
return &paintbuffers[ipaint];
|
||||
}
|
||||
@@ -183,7 +183,7 @@ _inline portable_samplepair_t *MIX_GetPFrontFromIPaint( int ipaintbuffer )
|
||||
}
|
||||
|
||||
_inline paintbuffer_t *MIX_GetPPaintFromIPaint( int ipaint )
|
||||
{
|
||||
{
|
||||
Assert( ipaint < CPAINTBUFFERS );
|
||||
return &paintbuffers[ipaint];
|
||||
}
|
||||
@@ -203,7 +203,7 @@ void MIX_InitAllPaintbuffers( void )
|
||||
paintbuffers[IPAINTBUFFER].pbuf = paintbuffer;
|
||||
paintbuffers[IROOMBUFFER].pbuf = roombuffer;
|
||||
paintbuffers[ISTREAMBUFFER].pbuf = streambuffer;
|
||||
|
||||
|
||||
MIX_SetCurrentPaintbuffer( IPAINTBUFFER );
|
||||
}
|
||||
|
||||
@@ -218,7 +218,7 @@ void S_PaintMonoFrom8( portable_samplepair_t *pbuf, int *volume, byte *pData, in
|
||||
{
|
||||
int *lscale, *rscale;
|
||||
int i, data;
|
||||
|
||||
|
||||
lscale = snd_scaletable[volume[0] >> SND_SCALE_SHIFT];
|
||||
rscale = snd_scaletable[volume[1] >> SND_SCALE_SHIFT];
|
||||
|
||||
@@ -272,7 +272,7 @@ void S_PaintStereoFrom16( portable_samplepair_t *pbuf, int *volume, short *pData
|
||||
int i;
|
||||
|
||||
data = (uint *)pData;
|
||||
|
||||
|
||||
for( i = 0; i < outCount; i++, data++ )
|
||||
{
|
||||
left = (signed short)((*data & 0x0000FFFF));
|
||||
@@ -408,13 +408,13 @@ void S_MixChannel( channel_t *pChannel, void *pData, int outputOffset, int input
|
||||
if( pSource->channels == 1 )
|
||||
{
|
||||
if( pSource->width == 1 )
|
||||
S_Mix8Mono( pbuf, pvol, (char *)pData, inputOffset, fracRate, outCount, timecompress );
|
||||
S_Mix8Mono( pbuf, pvol, pData, inputOffset, fracRate, outCount, timecompress );
|
||||
else S_Mix16Mono( pbuf, pvol, (short *)pData, inputOffset, fracRate, outCount );
|
||||
}
|
||||
else
|
||||
{
|
||||
if( pSource->width == 1 )
|
||||
S_Mix8Stereo( pbuf, pvol, (char *)pData, inputOffset, fracRate, outCount );
|
||||
S_Mix8Stereo( pbuf, pvol, pData, inputOffset, fracRate, outCount );
|
||||
else S_Mix16Stereo( pbuf, pvol, (short *)pData, inputOffset, fracRate, outCount );
|
||||
}
|
||||
}
|
||||
@@ -425,7 +425,7 @@ int S_MixDataToDevice( channel_t *pChannel, int sampleCount, int outRate, int ou
|
||||
int startingOffset = outOffset;
|
||||
float inputRate = ( pChannel->pitch * pChannel->sfx->cache->rate );
|
||||
float rate = inputRate / outRate;
|
||||
|
||||
|
||||
// shouldn't be playing this if finished, but return if we are
|
||||
if( pChannel->pMixer.finished )
|
||||
return 0;
|
||||
@@ -528,7 +528,7 @@ qboolean S_ShouldContinueMixing( channel_t *ch )
|
||||
// flags: if SOUND_MIX_DRY, then mix only samples with channel flagged as 'dry'
|
||||
// outputRate: target mix rate for all samples. Note, if outputRate = SOUND_DMA_SPEED, then
|
||||
// this routine will fill the paintbuffer to endtime. Otherwise, fewer samples are mixed.
|
||||
// if( endtime - paintedtime ) is not aligned on boundaries of 4,
|
||||
// if( endtime - paintedtime ) is not aligned on boundaries of 4,
|
||||
// we'll miss data if outputRate < SOUND_DMA_SPEED!
|
||||
void MIX_MixChannelsToPaintbuffer( int endtime, int rate, int outputRate )
|
||||
{
|
||||
@@ -539,16 +539,16 @@ void MIX_MixChannelsToPaintbuffer( int endtime, int rate, int outputRate )
|
||||
|
||||
// mix each channel into paintbuffer
|
||||
ch = channels;
|
||||
|
||||
|
||||
// validate parameters
|
||||
Assert( outputRate <= SOUND_DMA_SPEED );
|
||||
|
||||
// make sure we're not discarding data
|
||||
Assert( !(( endtime - paintedtime ) & 0x3 ) || ( outputRate == SOUND_DMA_SPEED ));
|
||||
|
||||
|
||||
// 44k: try to mix this many samples at outputRate
|
||||
sampleCount = ( endtime - paintedtime ) / ( SOUND_DMA_SPEED / outputRate );
|
||||
|
||||
|
||||
if( sampleCount <= 0 ) return;
|
||||
|
||||
for( i = 0; i < total_channels; i++, ch++ )
|
||||
@@ -578,10 +578,10 @@ void MIX_MixChannelsToPaintbuffer( int endtime, int rate, int outputRate )
|
||||
|
||||
pSource = S_LoadSound( ch->sfx );
|
||||
|
||||
// Don't mix sound data for sounds with zero volume. If it's a non-looping sound,
|
||||
// Don't mix sound data for sounds with zero volume. If it's a non-looping sound,
|
||||
// just remove the sound when its volume goes to zero.
|
||||
bZeroVolume = !ch->leftvol && !ch->rightvol;
|
||||
|
||||
|
||||
if( !bZeroVolume )
|
||||
{
|
||||
// this values matched with GoldSrc
|
||||
@@ -647,7 +647,7 @@ _inline portable_samplepair_t *S_GetNextpFilter( int i, portable_samplepair_t *p
|
||||
if( i == 0 ) return (&(pfiltermem[1]));
|
||||
if( i == 1 ) return (&(pfiltermem[2]));
|
||||
|
||||
// return from paintbuffer, where samples are doubled.
|
||||
// return from paintbuffer, where samples are doubled.
|
||||
// even samples are to be replaced with interpolated value.
|
||||
return (&(pbuffer[(i-2) * 2 + 1]));
|
||||
}
|
||||
@@ -708,32 +708,32 @@ void S_Interpolate2xCubic( portable_samplepair_t *pbuffer, portable_samplepair_t
|
||||
x0 = psamp1->left;
|
||||
x1 = psamp2->left;
|
||||
x2 = psamp3->left;
|
||||
|
||||
|
||||
// interpolate
|
||||
a = (3 * (x0-x1) - xm1 + x2) / 2;
|
||||
b = 2*x1 + xm1 - (5*x0 + x2) / 2;
|
||||
c = (x1 - xm1) / 2;
|
||||
|
||||
|
||||
// write out interpolated sample
|
||||
temppaintbuffer[outpos].left = a/8 + b/4 + c/2 + x0;
|
||||
|
||||
|
||||
// get all right samples for window
|
||||
xm1 = psamp0->right;
|
||||
x0 = psamp1->right;
|
||||
x1 = psamp2->right;
|
||||
x2 = psamp3->right;
|
||||
|
||||
|
||||
// interpolate
|
||||
a = (3 * (x0-x1) - xm1 + x2) / 2;
|
||||
b = 2*x1 + xm1 - (5*x0 + x2) / 2;
|
||||
c = (x1 - xm1) / 2;
|
||||
|
||||
|
||||
// write out interpolated sample, increment output counter
|
||||
temppaintbuffer[outpos++].right = a/8 + b/4 + c/2 + x0;
|
||||
|
||||
|
||||
Assert( outpos <= ( sizeof( temppaintbuffer ) / sizeof( temppaintbuffer[0] )));
|
||||
}
|
||||
|
||||
|
||||
Assert( cfltmem >= 3 );
|
||||
|
||||
// save last 3 samples from paintbuffer
|
||||
@@ -770,7 +770,7 @@ void S_Interpolate2xLinear( portable_samplepair_t *pbuffer, portable_samplepair_
|
||||
}
|
||||
|
||||
// save last value to be played out in buffer
|
||||
*pfiltermem = pbuffer[upCount - 1];
|
||||
*pfiltermem = pbuffer[upCount - 1];
|
||||
}
|
||||
|
||||
// upsample by 2x, optionally using interpolation
|
||||
@@ -783,11 +783,11 @@ void S_Interpolate2xLinear( portable_samplepair_t *pbuffer, portable_samplepair_
|
||||
void S_MixBufferUpsample2x( int count, portable_samplepair_t *pbuffer, portable_samplepair_t *pfiltermem, int cfltmem, int filtertype )
|
||||
{
|
||||
int upCount = count<<1;
|
||||
int i, j;
|
||||
int i, j;
|
||||
|
||||
// reverse through buffer, duplicating contents for 'count' samples
|
||||
for( i = upCount - 1, j = count - 1; j >= 0; i-=2, j-- )
|
||||
{
|
||||
{
|
||||
pbuffer[i] = pbuffer[j];
|
||||
pbuffer[i-1] = pbuffer[j];
|
||||
}
|
||||
@@ -809,7 +809,7 @@ void S_MixBufferUpsample2x( int count, portable_samplepair_t *pbuffer, portable_
|
||||
// zero out all paintbuffers
|
||||
void MIX_ClearAllPaintBuffers( int SampleCount, qboolean clearFilters )
|
||||
{
|
||||
int count = min( SampleCount, PAINTBUFFER_SIZE );
|
||||
int count = Q_min( SampleCount, PAINTBUFFER_SIZE );
|
||||
int i;
|
||||
|
||||
// zero out all paintbuffer data (ignore sampleCount)
|
||||
@@ -839,7 +839,7 @@ void MIX_MixPaintbuffers( int ibuf1, int ibuf2, int ibuf3, int count, float fgai
|
||||
int i, gain;
|
||||
|
||||
gain = 256 * fgain;
|
||||
|
||||
|
||||
Assert( count <= PAINTBUFFER_SIZE );
|
||||
Assert( ibuf1 < CPAINTBUFFERS );
|
||||
Assert( ibuf2 < CPAINTBUFFERS );
|
||||
@@ -848,8 +848,8 @@ void MIX_MixPaintbuffers( int ibuf1, int ibuf2, int ibuf3, int count, float fgai
|
||||
pbuf1 = paintbuffers[ibuf1].pbuf;
|
||||
pbuf2 = paintbuffers[ibuf2].pbuf;
|
||||
pbuf3 = paintbuffers[ibuf3].pbuf;
|
||||
|
||||
// destination buffer stereo - average n chans down to stereo
|
||||
|
||||
// destination buffer stereo - average n chans down to stereo
|
||||
|
||||
// destination 2ch:
|
||||
// pb1 2ch + pb2 2ch -> pb3 2ch
|
||||
@@ -874,7 +874,7 @@ void MIX_CompressPaintbuffer( int ipaint, int count )
|
||||
|
||||
ppaint = MIX_GetPPaintFromIPaint( ipaint );
|
||||
pbuf = ppaint->pbuf;
|
||||
|
||||
|
||||
for( i = 0; i < count; i++, pbuf++ )
|
||||
{
|
||||
pbuf->left = CLIP( pbuf->left );
|
||||
@@ -909,7 +909,7 @@ void MIX_MixStreamBuffer( int end )
|
||||
memset( pbuf, 0, (end - paintedtime) * sizeof( portable_samplepair_t ));
|
||||
}
|
||||
else
|
||||
{
|
||||
{
|
||||
int i, stop;
|
||||
|
||||
// copy from the streaming sound source
|
||||
@@ -919,7 +919,7 @@ void MIX_MixStreamBuffer( int end )
|
||||
{
|
||||
pbuf[i-paintedtime].left = ( ch->rawsamples[i & ( ch->max_samples - 1 )].left * ch->leftvol ) >> 8;
|
||||
pbuf[i-paintedtime].right = ( ch->rawsamples[i & ( ch->max_samples - 1 )].right * ch->rightvol ) >> 8;
|
||||
}
|
||||
}
|
||||
|
||||
for( ; i < end; i++ )
|
||||
pbuf[i-paintedtime].left = pbuf[i-paintedtime].right = 0;
|
||||
@@ -985,24 +985,28 @@ void MIX_UpsampleAllPaintbuffers( int end, int count )
|
||||
// only mix to roombuffer if dsp fx are on KDB: perf
|
||||
MIX_ActivatePaintbuffer( IROOMBUFFER ); // operates on MIX_MixChannelsToPaintbuffer
|
||||
|
||||
// mix 11khz sounds:
|
||||
// mix 11khz sounds:
|
||||
MIX_MixChannelsToPaintbuffer( end, SOUND_11k, SOUND_11k );
|
||||
|
||||
#if SOUND_DMA_SPEED >= SOUND_22k
|
||||
// upsample all 11khz buffers by 2x
|
||||
// only upsample roombuffer if dsp fx are on KDB: perf
|
||||
MIX_SetCurrentPaintbuffer( IROOMBUFFER ); // operates on MixUpSample
|
||||
S_MixUpsample( count / ( SOUND_DMA_SPEED / SOUND_11k ), s_lerping->value );
|
||||
S_MixUpsample( count / ( SOUND_DMA_SPEED / SOUND_11k ), s_lerping.value );
|
||||
|
||||
// mix 22khz sounds:
|
||||
// mix 22khz sounds:
|
||||
MIX_MixChannelsToPaintbuffer( end, SOUND_22k, SOUND_22k );
|
||||
|
||||
#endif
|
||||
|
||||
#if SOUND_DMA_SPEED >= SOUND_44k
|
||||
// upsample all 22khz buffers by 2x
|
||||
// only upsample roombuffer if dsp fx are on KDB: perf
|
||||
MIX_SetCurrentPaintbuffer( IROOMBUFFER );
|
||||
S_MixUpsample( count / ( SOUND_DMA_SPEED / SOUND_22k ), s_lerping->value );
|
||||
S_MixUpsample( count / ( SOUND_DMA_SPEED / SOUND_22k ), s_lerping.value );
|
||||
|
||||
// mix all 44khz sounds to all active paintbuffers
|
||||
MIX_MixChannelsToPaintbuffer( end, SOUND_44k, SOUND_DMA_SPEED );
|
||||
#endif
|
||||
|
||||
// mix raw samples from the video streams
|
||||
MIX_SetCurrentPaintbuffer( IROOMBUFFER );
|
||||
@@ -1040,7 +1044,7 @@ void MIX_PaintChannels( int endtime )
|
||||
MIX_MixPaintbuffers( IPAINTBUFFER, IROOMBUFFER, IPAINTBUFFER, count, S_GetMasterVolume() );
|
||||
|
||||
// add music or soundtrack from movie (no dsp)
|
||||
MIX_MixPaintbuffers( IPAINTBUFFER, ISTREAMBUFFER, IPAINTBUFFER, count, S_GetMusicVolume() );
|
||||
MIX_MixPaintbuffers( IPAINTBUFFER, ISTREAMBUFFER, IPAINTBUFFER, count, S_GetMusicVolume() );
|
||||
|
||||
// clip all values > 16 bit down to 16 bit
|
||||
MIX_CompressPaintbuffer( IPAINTBUFFER, count );
|
||||
|
||||
@@ -63,7 +63,7 @@ float S_GetMusicVolume( void )
|
||||
scale = 1.0f - scale;
|
||||
}
|
||||
|
||||
return s_musicvolume->value * scale;
|
||||
return s_musicvolume.value * scale;
|
||||
}
|
||||
|
||||
/*
|
||||
@@ -183,7 +183,7 @@ void S_StreamBackgroundTrack( void )
|
||||
return;
|
||||
|
||||
// don't bother playing anything if musicvolume is 0
|
||||
if( !s_musicvolume->value || s_listener.paused || s_listener.stream_paused )
|
||||
if( !s_musicvolume.value || s_listener.paused || s_listener.stream_paused )
|
||||
return;
|
||||
|
||||
if( !cl.background )
|
||||
|
||||
@@ -36,10 +36,10 @@ int S_ZeroCrossingBefore( wavdata_t *pWaveData, int sample )
|
||||
|
||||
sampleSize = pWaveData->width * pWaveData->channels;
|
||||
|
||||
// this can never be zero -- other functions divide by this.
|
||||
// this can never be zero -- other functions divide by this.
|
||||
// This should never happen, but avoid crashing
|
||||
if( sampleSize <= 0 ) sampleSize = 1;
|
||||
|
||||
|
||||
if( pWaveData->width == 1 )
|
||||
{
|
||||
signed char *pData = (signed char *)(pWaveData->buffer + sample * sampleSize);
|
||||
@@ -133,7 +133,7 @@ int S_ZeroCrossingAfter( wavdata_t *pWaveData, int sample )
|
||||
|
||||
sampleSize = pWaveData->width * pWaveData->channels;
|
||||
|
||||
// this can never be zero -- other functions divide by this.
|
||||
// this can never be zero -- other functions divide by this.
|
||||
// This should never happen, but avoid crashing
|
||||
if( sampleSize <= 0 ) sampleSize = 1;
|
||||
|
||||
@@ -232,7 +232,7 @@ int S_ConvertLoopedPosition( wavdata_t *pSource, int samplePosition, qboolean us
|
||||
|
||||
// subtract off starting bit of the wave
|
||||
samplePosition -= pSource->loopStart;
|
||||
|
||||
|
||||
if( loopSize )
|
||||
{
|
||||
// "real" position in memory (mod off extra loops)
|
||||
@@ -264,7 +264,7 @@ int S_GetOutputData( wavdata_t *pSource, void **pData, int samplePosition, int s
|
||||
|
||||
sampleSize = pSource->width * pSource->channels;
|
||||
|
||||
// this can never be zero -- other functions divide by this.
|
||||
// this can never be zero -- other functions divide by this.
|
||||
// This should never happen, but avoid crashing
|
||||
if( sampleSize <= 0 ) sampleSize = 1;
|
||||
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -16,9 +16,9 @@ GNU General Public License for more details.
|
||||
#ifndef SOUND_H
|
||||
#define SOUND_H
|
||||
|
||||
extern byte *sndpool;
|
||||
extern poolhandle_t sndpool;
|
||||
|
||||
#include "mathlib.h"
|
||||
#include "xash3d_mathlib.h"
|
||||
|
||||
// sound engine rate defines
|
||||
#define SOUND_DMA_SPEED 44100 // hardware playback rate
|
||||
@@ -138,7 +138,6 @@ typedef struct rawchan_s
|
||||
int rightvol; // 0-255 right volume
|
||||
float dist_mult; // distance multiplier (attenuation/clipK)
|
||||
vec3_t origin; // only use if fixed_origin is set
|
||||
float radius; // radius of this sound effect
|
||||
volatile uint s_rawend;
|
||||
wavdata_t sound_info; // advance play position
|
||||
float oldtime; // catch time jumps
|
||||
@@ -155,7 +154,7 @@ typedef struct channel_s
|
||||
int rightvol; // 0-255 right volume
|
||||
|
||||
int entnum; // entity soundsource
|
||||
int entchannel; // sound channel (CHAN_STREAM, CHAN_VOICE, etc.)
|
||||
int entchannel; // sound channel (CHAN_STREAM, CHAN_VOICE, etc.)
|
||||
vec3_t origin; // only use if fixed_origin is set
|
||||
float dist_mult; // distance multiplier (attenuation/clipK)
|
||||
int master_vol; // 0-255 master volume
|
||||
@@ -217,15 +216,13 @@ extern listener_t s_listener;
|
||||
extern int idsp_room;
|
||||
extern dma_t dma;
|
||||
|
||||
extern convar_t *s_volume;
|
||||
extern convar_t *s_musicvolume;
|
||||
extern convar_t *s_show;
|
||||
extern convar_t *s_mixahead;
|
||||
extern convar_t *s_lerping;
|
||||
extern convar_t s_musicvolume;
|
||||
extern convar_t s_lerping;
|
||||
extern convar_t *dsp_off;
|
||||
extern convar_t *s_test; // cvar to testify new effects
|
||||
extern convar_t *s_samplecount;
|
||||
extern convar_t *snd_mute_losefocus;
|
||||
extern convar_t s_test; // cvar to testify new effects
|
||||
extern convar_t s_samplecount;
|
||||
extern convar_t snd_mute_losefocus;
|
||||
extern convar_t s_warn_late_precache;
|
||||
|
||||
void S_InitScaletable( void );
|
||||
wavdata_t *S_LoadSound( sfx_t *sfx );
|
||||
|
||||
@@ -32,7 +32,7 @@ static int IsComment( const char *pText )
|
||||
|
||||
if( length >= 2 && pText[0] == '/' && pText[1] == '/' )
|
||||
return 1;
|
||||
|
||||
|
||||
// no text?
|
||||
if( length > 0 )
|
||||
return 0;
|
||||
@@ -213,7 +213,7 @@ void CL_TextMessageParse( byte *pMemFile, int fileSize )
|
||||
char buf[512], trim[512], currentName[512];
|
||||
char *pCurrentText = NULL, *pNameHeap;
|
||||
char nameHeap[32768]; // g-cont. i will scale up heap to handle all TFC messages
|
||||
int mode = MSGFILE_NAME; // searching for a message name
|
||||
int mode = MSGFILE_NAME; // searching for a message name
|
||||
int lineNumber, filePos, lastLinePos;
|
||||
client_textmessage_t textMessages[MAX_MESSAGES];
|
||||
int i, nameHeapSize, textHeapSize, messageSize, nameOffset;
|
||||
@@ -275,7 +275,7 @@ void CL_TextMessageParse( byte *pMemFile, int fileSize )
|
||||
// Save name/text on heap
|
||||
textMessages[messageCount] = gMessageParms;
|
||||
textMessages[messageCount].pName = nameHeap + lastNamePos;
|
||||
lastNamePos += Q_strlen( currentName ) + 1;
|
||||
lastNamePos += length + 1;
|
||||
textMessages[messageCount].pMessage = pCurrentText;
|
||||
messageCount++;
|
||||
|
||||
@@ -318,10 +318,10 @@ void CL_TextMessageParse( byte *pMemFile, int fileSize )
|
||||
|
||||
// must malloc because we need to be able to clear it after initialization
|
||||
clgame.titles = (client_textmessage_t *)Mem_Calloc( cls.mempool, textHeapSize + nameHeapSize + messageSize );
|
||||
|
||||
|
||||
// copy table over
|
||||
memcpy( clgame.titles, textMessages, messageSize );
|
||||
|
||||
|
||||
// copy Name heap
|
||||
pNameHeap = ((char *)clgame.titles) + messageSize;
|
||||
memcpy( pNameHeap, nameHeap, nameHeapSize );
|
||||
|
||||
@@ -21,31 +21,13 @@ GNU General Public License for more details.
|
||||
#include "keydefs.h"
|
||||
#include "ref_common.h"
|
||||
#include "input.h"
|
||||
#ifdef XASH_SDL
|
||||
#include <SDL.h>
|
||||
static SDL_Cursor* s_pDefaultCursor[20];
|
||||
#endif
|
||||
#include "platform/platform.h"
|
||||
|
||||
static enum VGUI_KeyCode s_pVirtualKeyTrans[256];
|
||||
static enum VGUI_DefaultCursor s_currentCursor;
|
||||
static VGUI_DefaultCursor s_currentCursor;
|
||||
static HINSTANCE s_pVGuiSupport; // vgui_support library
|
||||
static convar_t *vgui_utf8 = NULL;
|
||||
|
||||
// Helper functions for vgui backend
|
||||
|
||||
/*void VGUI_HideCursor( void )
|
||||
{
|
||||
host.mouse_visible = false;
|
||||
SDL_HideCursor();
|
||||
}
|
||||
|
||||
void VGUI_ShowCursor( void )
|
||||
{
|
||||
host.mouse_visible = true;
|
||||
SDL_ShowCursor();
|
||||
}*/
|
||||
|
||||
void GAME_EXPORT *VGUI_EngineMalloc(size_t size)
|
||||
{
|
||||
return Z_Malloc( size );
|
||||
@@ -66,69 +48,10 @@ void GAME_EXPORT VGUI_GetMousePos( int *_x, int *_y )
|
||||
*_x = x / xscale, *_y = y / yscale;
|
||||
}
|
||||
|
||||
void VGUI_InitCursors( void )
|
||||
void GAME_EXPORT VGUI_CursorSelect( VGUI_DefaultCursor cursor )
|
||||
{
|
||||
// load up all default cursors
|
||||
#if SDL_VERSION_ATLEAST( 2, 0, 0 )
|
||||
s_pDefaultCursor[dc_none] = NULL;
|
||||
s_pDefaultCursor[dc_arrow] = SDL_CreateSystemCursor(SDL_SYSTEM_CURSOR_ARROW);
|
||||
s_pDefaultCursor[dc_ibeam] = SDL_CreateSystemCursor(SDL_SYSTEM_CURSOR_IBEAM);
|
||||
s_pDefaultCursor[dc_hourglass]= SDL_CreateSystemCursor(SDL_SYSTEM_CURSOR_WAIT);
|
||||
s_pDefaultCursor[dc_crosshair]= SDL_CreateSystemCursor(SDL_SYSTEM_CURSOR_CROSSHAIR);
|
||||
s_pDefaultCursor[dc_up] = SDL_CreateSystemCursor(SDL_SYSTEM_CURSOR_ARROW);
|
||||
s_pDefaultCursor[dc_sizenwse] = SDL_CreateSystemCursor(SDL_SYSTEM_CURSOR_SIZENWSE);
|
||||
s_pDefaultCursor[dc_sizenesw] = SDL_CreateSystemCursor(SDL_SYSTEM_CURSOR_SIZENESW);
|
||||
s_pDefaultCursor[dc_sizewe] = SDL_CreateSystemCursor(SDL_SYSTEM_CURSOR_SIZEWE);
|
||||
s_pDefaultCursor[dc_sizens] = SDL_CreateSystemCursor(SDL_SYSTEM_CURSOR_SIZENS);
|
||||
s_pDefaultCursor[dc_sizeall] = SDL_CreateSystemCursor(SDL_SYSTEM_CURSOR_SIZEALL);
|
||||
s_pDefaultCursor[dc_no] = SDL_CreateSystemCursor(SDL_SYSTEM_CURSOR_NO);
|
||||
s_pDefaultCursor[dc_hand] = SDL_CreateSystemCursor(SDL_SYSTEM_CURSOR_HAND);
|
||||
//host.mouse_visible = true;
|
||||
SDL_SetCursor( s_pDefaultCursor[dc_arrow] );
|
||||
#endif
|
||||
}
|
||||
|
||||
void GAME_EXPORT VGUI_CursorSelect(enum VGUI_DefaultCursor cursor )
|
||||
{
|
||||
qboolean visible;
|
||||
if( cls.key_dest != key_game || cl.paused )
|
||||
return;
|
||||
|
||||
switch( cursor )
|
||||
{
|
||||
case dc_user:
|
||||
case dc_none:
|
||||
visible = false;
|
||||
break;
|
||||
default:
|
||||
visible = true;
|
||||
break;
|
||||
}
|
||||
|
||||
#if SDL_VERSION_ATLEAST( 2, 0, 0 )
|
||||
/// TODO: platform cursors
|
||||
|
||||
if( CVAR_TO_BOOL( touch_emulate ) )
|
||||
return;
|
||||
if( host.mouse_visible )
|
||||
{
|
||||
SDL_SetRelativeMouseMode( SDL_FALSE );
|
||||
SDL_SetCursor( s_pDefaultCursor[cursor] );
|
||||
SDL_ShowCursor( true );
|
||||
}
|
||||
else
|
||||
{
|
||||
SDL_ShowCursor( false );
|
||||
if( host.mouse_visible )
|
||||
SDL_GetRelativeMouseState( NULL, NULL );
|
||||
}
|
||||
//SDL_SetRelativeMouseMode(false);
|
||||
#endif
|
||||
if( s_currentCursor == cursor )
|
||||
return;
|
||||
|
||||
Platform_SetCursorType( cursor );
|
||||
s_currentCursor = cursor;
|
||||
host.mouse_visible = visible;
|
||||
}
|
||||
|
||||
byte GAME_EXPORT VGUI_GetColor( int i, int j)
|
||||
@@ -137,21 +60,9 @@ byte GAME_EXPORT VGUI_GetColor( int i, int j)
|
||||
}
|
||||
|
||||
// Define and initialize vgui API
|
||||
|
||||
void GAME_EXPORT VGUI_SetVisible( qboolean state )
|
||||
{
|
||||
host.mouse_visible=state;
|
||||
#ifdef XASH_SDL
|
||||
SDL_ShowCursor( state );
|
||||
if( !state )
|
||||
SDL_GetRelativeMouseState( NULL, NULL );
|
||||
#endif
|
||||
Key_EnableTextInput( state, true );
|
||||
}
|
||||
|
||||
int GAME_EXPORT VGUI_UtfProcessChar( int in )
|
||||
{
|
||||
if( CVAR_TO_BOOL( vgui_utf8 ) )
|
||||
if( CVAR_TO_BOOL( vgui_utf8 ))
|
||||
return Con_UtfProcessCharForce( in );
|
||||
else
|
||||
return in;
|
||||
@@ -174,14 +85,15 @@ vguiapi_t vgui =
|
||||
NULL, // VGUI_GetTextureSizes,
|
||||
NULL, // VGUI_GenerateTexture,
|
||||
VGUI_EngineMalloc,
|
||||
/* VGUI_ShowCursor,
|
||||
VGUI_HideCursor,*/
|
||||
VGUI_CursorSelect,
|
||||
VGUI_GetColor,
|
||||
VGUI_IsInGame,
|
||||
VGUI_SetVisible,
|
||||
NULL,
|
||||
VGUI_GetMousePos,
|
||||
VGUI_UtfProcessChar,
|
||||
Platform_GetClipboardText,
|
||||
Platform_SetClipboardText,
|
||||
Platform_GetKeyModifiers,
|
||||
NULL,
|
||||
NULL,
|
||||
NULL,
|
||||
@@ -189,6 +101,7 @@ vguiapi_t vgui =
|
||||
NULL,
|
||||
NULL,
|
||||
NULL,
|
||||
NULL
|
||||
};
|
||||
|
||||
qboolean VGui_IsActive( void )
|
||||
@@ -239,7 +152,6 @@ void VGui_Startup( const char *clientlib, int width, int height )
|
||||
|
||||
VGui_FillAPIFromRef( &vgui, &ref.dllFuncs );
|
||||
|
||||
#ifdef XASH_INTERNAL_GAMELIBS
|
||||
s_pVGuiSupport = COM_LoadLibrary( clientlib, false, false );
|
||||
|
||||
if( s_pVGuiSupport )
|
||||
@@ -249,58 +161,70 @@ void VGui_Startup( const char *clientlib, int width, int height )
|
||||
{
|
||||
F( &vgui );
|
||||
vgui.initialized = true;
|
||||
VGUI_InitCursors();
|
||||
Con_Reportf( "vgui_support: found interal client support\n" );
|
||||
Con_Reportf( "vgui_support: found internal client support\n" );
|
||||
}
|
||||
else
|
||||
{
|
||||
COM_FreeLibrary( s_pVGuiSupport );
|
||||
}
|
||||
}
|
||||
#endif // XASH_INTERNAL_GAMELIBS
|
||||
|
||||
// HACKHACK: load vgui with correct path first if specified.
|
||||
// it will be reused while resolving vgui support and client deps
|
||||
if( Sys_GetParmFromCmdLine( "-vguilib", vguilib ) )
|
||||
if( !vgui.initialized )
|
||||
{
|
||||
if( Q_strstr( vguilib, ".dll") )
|
||||
// HACKHACK: load vgui with correct path first if specified.
|
||||
// it will be reused while resolving vgui support and client deps
|
||||
if( Sys_GetParmFromCmdLine( "-vguilib", vguilib ))
|
||||
{
|
||||
if( Q_strstr( vguilib, ".dll" ))
|
||||
Q_strncpy( vguiloader, "vgui_support.dll", 256 );
|
||||
else
|
||||
Q_strncpy( vguiloader, VGUI_SUPPORT_DLL, 256 );
|
||||
|
||||
if( !COM_LoadLibrary( vguilib, false, false ))
|
||||
Con_Reportf( S_WARN "VGUI preloading failed. Default library will be used! Reason: %s\n", COM_GetLibraryError() );
|
||||
}
|
||||
|
||||
if( Q_strstr( clientlib, ".dll" ))
|
||||
Q_strncpy( vguiloader, "vgui_support.dll", 256 );
|
||||
else
|
||||
|
||||
if( !vguiloader[0] && !Sys_GetParmFromCmdLine( "-vguiloader", vguiloader ))
|
||||
Q_strncpy( vguiloader, VGUI_SUPPORT_DLL, 256 );
|
||||
|
||||
if( !COM_LoadLibrary( vguilib, false, false ) )
|
||||
Con_Reportf( S_WARN "VGUI preloading failed. Default library will be used! Reason: %s\n", COM_GetLibraryError());
|
||||
}
|
||||
s_pVGuiSupport = COM_LoadLibrary( vguiloader, false, false );
|
||||
|
||||
if( Q_strstr( clientlib, ".dll" ) )
|
||||
Q_strncpy( vguiloader, "vgui_support.dll", 256 );
|
||||
|
||||
if( !vguiloader[0] && !Sys_GetParmFromCmdLine( "-vguiloader", vguiloader ) )
|
||||
Q_strncpy( vguiloader, VGUI_SUPPORT_DLL, 256 );
|
||||
|
||||
s_pVGuiSupport = COM_LoadLibrary( vguiloader, false, false );
|
||||
|
||||
if( !s_pVGuiSupport )
|
||||
{
|
||||
s_pVGuiSupport = COM_LoadLibrary( va( "../%s", vguiloader ), false, false );
|
||||
}
|
||||
|
||||
if( !s_pVGuiSupport )
|
||||
{
|
||||
if( FS_FileExists( vguiloader, false ) )
|
||||
Con_Reportf( S_ERROR "Failed to load vgui_support library: %s", COM_GetLibraryError() );
|
||||
else
|
||||
Con_Reportf( "vgui_support: not found\n" );
|
||||
}
|
||||
else
|
||||
{
|
||||
F = COM_GetProcAddress( s_pVGuiSupport, "InitAPI" );
|
||||
if( F )
|
||||
if( !s_pVGuiSupport )
|
||||
{
|
||||
F( &vgui );
|
||||
vgui.initialized = true;
|
||||
VGUI_InitCursors();
|
||||
s_pVGuiSupport = COM_LoadLibrary( va( "../%s", vguiloader ), false, false );
|
||||
}
|
||||
|
||||
if( !s_pVGuiSupport )
|
||||
{
|
||||
if( FS_FileExists( vguiloader, false ))
|
||||
{
|
||||
Con_Reportf( S_ERROR "Failed to load vgui_support library: %s\n", COM_GetLibraryError() );
|
||||
}
|
||||
else
|
||||
{
|
||||
Con_Reportf( "vgui_support: not found\n" );
|
||||
}
|
||||
failed = true;
|
||||
}
|
||||
else
|
||||
Con_Reportf( S_ERROR "Failed to find vgui_support library entry point!\n" );
|
||||
{
|
||||
F = COM_GetProcAddress( s_pVGuiSupport, "InitAPI" );
|
||||
if( F )
|
||||
{
|
||||
F( &vgui );
|
||||
vgui.initialized = true;
|
||||
}
|
||||
else
|
||||
{
|
||||
Con_Reportf( S_ERROR "Failed to find vgui_support library entry point!\n" );
|
||||
failed = true;
|
||||
COM_FreeLibrary( s_pVGuiSupport );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
if( height < 480 )
|
||||
@@ -318,7 +242,7 @@ void VGui_Startup( const char *clientlib, int width, int height )
|
||||
width = 1280;
|
||||
else if( width <= 1600 )
|
||||
width = 1600;
|
||||
#ifdef DLL_LOADER
|
||||
#ifdef XASH_DLL_LOADER
|
||||
else if ( Q_strstr( vguiloader, ".dll" ) )
|
||||
width = 1600;
|
||||
#endif
|
||||
@@ -329,7 +253,10 @@ void VGui_Startup( const char *clientlib, int width, int height )
|
||||
//host.mouse_visible = true;
|
||||
vgui.Startup( width, height );
|
||||
}
|
||||
else failed = true;
|
||||
else if ( COM_CheckString( clientlib ) )
|
||||
{
|
||||
failed = true;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -491,12 +418,12 @@ void VGui_KeyEvent( int key, int down )
|
||||
if( !vgui.initialized )
|
||||
return;
|
||||
|
||||
if( host.mouse_visible )
|
||||
Key_EnableTextInput( true, false );
|
||||
|
||||
switch( key )
|
||||
{
|
||||
case K_MOUSE1:
|
||||
if( down && host.mouse_visible ) {
|
||||
Key_EnableTextInput(true, false);
|
||||
}
|
||||
vgui.Mouse( down ? MA_PRESSED : MA_RELEASED, MOUSE_LEFT );
|
||||
return;
|
||||
case K_MOUSE2:
|
||||
@@ -532,7 +459,7 @@ void VGui_MouseMove( int x, int y )
|
||||
|
||||
void VGui_Paint( void )
|
||||
{
|
||||
if(vgui.initialized)
|
||||
if( vgui.initialized )
|
||||
vgui.Paint();
|
||||
}
|
||||
|
||||
@@ -548,3 +475,9 @@ void *GAME_EXPORT VGui_GetPanel( void )
|
||||
return vgui.GetPanel();
|
||||
return NULL;
|
||||
}
|
||||
|
||||
void VGui_ReportTextInput( const char *text )
|
||||
{
|
||||
if ( vgui.initialized )
|
||||
vgui.TextInput( text );
|
||||
}
|
||||
|
||||
@@ -33,6 +33,7 @@ void VGui_KeyEvent( int key, int down );
|
||||
void VGui_MouseMove( int x, int y );
|
||||
qboolean VGui_IsActive( void );
|
||||
void *VGui_GetPanel( void );
|
||||
void VGui_ReportTextInput( const char *text );
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
@@ -23,6 +23,7 @@ GNU General Public License for more details.
|
||||
#define WINDOW_NAME XASH_ENGINE_NAME " Window" // Half-Life
|
||||
convar_t *vid_displayfrequency;
|
||||
convar_t *vid_fullscreen;
|
||||
convar_t *vid_mode;
|
||||
convar_t *vid_brightness;
|
||||
convar_t *vid_gamma;
|
||||
convar_t *vid_highdpi;
|
||||
@@ -182,13 +183,14 @@ void VID_Init( void )
|
||||
vid_brightness = Cvar_Get( "brightness", "0.0", FCVAR_ARCHIVE, "brightness factor" );
|
||||
vid_displayfrequency = Cvar_Get ( "vid_displayfrequency", "0", FCVAR_RENDERINFO|FCVAR_VIDRESTART, "fullscreen refresh rate" );
|
||||
vid_fullscreen = Cvar_Get( "fullscreen", "0", FCVAR_RENDERINFO|FCVAR_VIDRESTART, "enable fullscreen mode" );
|
||||
vid_mode = Cvar_Get( "vid_mode", "0", FCVAR_RENDERINFO, "current video mode index (used just for storage)" );
|
||||
vid_highdpi = Cvar_Get( "vid_highdpi", "1", FCVAR_RENDERINFO|FCVAR_VIDRESTART, "enable High-DPI mode" );
|
||||
vid_rotate = Cvar_Get( "vid_rotate", "0", FCVAR_RENDERINFO|FCVAR_VIDRESTART, "screen rotation (0-3)" );
|
||||
vid_scale = Cvar_Get( "vid_scale", "1.0", FCVAR_RENDERINFO|FCVAR_VIDRESTART, "pixel scale" );
|
||||
|
||||
// a1ba: planned to be named vid_mode for compability
|
||||
// but supported mode list is filled by backends, so numbers are not portable any more
|
||||
Cmd_AddCommand( "vid_setmode", VID_Mode_f, "display video mode" );
|
||||
Cmd_AddRestrictedCommand( "vid_setmode", VID_Mode_f, "display video mode" );
|
||||
|
||||
R_Init(); // init renderer
|
||||
}
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user