mirror of
https://github.com/FWGS/xash3d-fwgs.git
synced 2026-08-07 12:50:38 +08:00
Compare commits
1683 Commits
v0.20
...
new_vgui_s
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
fa90a4aaa2 | ||
|
|
50dbfb3747 | ||
|
|
41e51c530a | ||
|
|
05b32e4caf | ||
|
|
7e6b5253b2 | ||
|
|
3629448f0c | ||
|
|
78e239d883 | ||
|
|
5a7b68fcc1 | ||
|
|
c33a384975 | ||
|
|
5b582b744a | ||
|
|
c96f8ba722 | ||
|
|
9f92e2a1f7 | ||
|
|
710b234493 | ||
|
|
75759530e3 | ||
|
|
5162ab62fd | ||
|
|
3e2a215c15 | ||
|
|
e2540bd446 | ||
|
|
07fd4f37ef | ||
|
|
92b72a7d33 | ||
|
|
cb3b16e2ec | ||
|
|
bd3dc71f39 | ||
|
|
48176233bd | ||
|
|
a292d2fd53 | ||
|
|
27aad9f4a0 | ||
|
|
71a3cedba8 | ||
|
|
ec2951cf45 | ||
|
|
ff436ae100 | ||
|
|
cfdfdd5c93 | ||
|
|
8b96e7ca87 | ||
|
|
1603b8028c | ||
|
|
8c7db8499f | ||
|
|
fbdd79644b | ||
|
|
ac39090f6e | ||
|
|
8f207362a5 | ||
|
|
b16fa8eddc | ||
|
|
2261b0dcab | ||
|
|
9eb49fc673 | ||
|
|
c61c84ad4f | ||
|
|
71c9fd2772 | ||
|
|
1464e1e2be | ||
|
|
cf557d191a | ||
|
|
b72033eb74 | ||
|
|
cec903fd10 | ||
|
|
b333edeefe | ||
|
|
76c7273600 | ||
|
|
096ee34f67 | ||
|
|
5b52a9a19f | ||
|
|
cacfff008f | ||
|
|
398cec626e | ||
|
|
cadad6ce34 | ||
|
|
588d080a63 | ||
|
|
1affc36f06 | ||
|
|
8d6ac3fad4 | ||
|
|
0d5d30398b | ||
|
|
eb0686fca1 | ||
|
|
41025c0049 | ||
|
|
6518a5cf8b | ||
|
|
49936120ca | ||
|
|
e4a5b95e81 | ||
|
|
84fc8d4281 | ||
|
|
e9da3e2976 | ||
|
|
c1252b5642 | ||
|
|
7d54952422 | ||
|
|
b28d10f69f | ||
|
|
6cb3b2f01a | ||
|
|
248be5458f | ||
|
|
2e7306e96a | ||
|
|
558ded6d6a | ||
|
|
c52dc69360 | ||
|
|
ba1648c689 | ||
|
|
101a7a1240 | ||
|
|
25d6b2b069 | ||
|
|
f67b97e63c | ||
|
|
9a24cb8c96 | ||
|
|
c157b7def3 | ||
|
|
de88aec958 | ||
|
|
7f31871b5a | ||
|
|
f55ef63e26 | ||
|
|
824a34ee1e | ||
|
|
46e2ccd2bf | ||
|
|
339c08d89f | ||
|
|
2db2375b4d | ||
|
|
d86ab19351 | ||
|
|
db40d58208 | ||
|
|
33ff7bbd61 | ||
|
|
4d4162336a | ||
|
|
372514151d | ||
|
|
6c9ce478a9 | ||
|
|
78555ab125 | ||
|
|
f2c671d809 | ||
|
|
4bce193645 | ||
|
|
129de871e3 | ||
|
|
c24a1fafc5 | ||
|
|
cee3757e6f | ||
|
|
12ed092446 | ||
|
|
2fb19a0cfd | ||
|
|
79624fa400 | ||
|
|
550ced9c36 | ||
|
|
fd795d5612 | ||
|
|
dc0982932b | ||
|
|
5d387101b9 | ||
|
|
eef1e1868a | ||
|
|
4005ef831a | ||
|
|
b0c71c598f | ||
|
|
d7848b7b8d | ||
|
|
9cdce1ce69 | ||
|
|
84edd9d0c4 | ||
|
|
d8355a651f | ||
|
|
004ac8105e | ||
|
|
2e8ab13242 | ||
|
|
27d9fc0afe | ||
|
|
192d510924 | ||
|
|
3614cfa878 | ||
|
|
12efcf1c44 | ||
|
|
a8de11643c | ||
|
|
597027277c | ||
|
|
48988e66bd | ||
|
|
37e3cf7e86 | ||
|
|
01e0542223 | ||
|
|
93a7ccd14f | ||
|
|
892e5c59eb | ||
|
|
c2992afb4a | ||
|
|
b99e7a6304 | ||
|
|
8888b456df | ||
|
|
53987f47e2 | ||
|
|
7cac1d290d | ||
|
|
55b048aab9 | ||
|
|
881a7edb9f | ||
|
|
6c62136f11 | ||
|
|
f34b35be5a | ||
|
|
4b5ee87de1 | ||
|
|
67903b55cc | ||
|
|
55bf0e8a53 | ||
|
|
f1487cf576 | ||
|
|
29e32310cf | ||
|
|
2ea549f250 | ||
|
|
b2ea8c9d18 | ||
|
|
6e27926a10 | ||
|
|
96c30371b7 | ||
|
|
9a42f4149f | ||
|
|
dca4226e4b | ||
|
|
b3c1c173a9 | ||
|
|
3e67445ef3 | ||
|
|
127bd89b44 | ||
|
|
3361e74f54 | ||
|
|
48e199bfa1 | ||
|
|
575179dbf5 | ||
|
|
e024a67436 | ||
|
|
e3103249f4 | ||
|
|
0746cb5365 | ||
|
|
fcda7517fe | ||
|
|
2c77f4c566 | ||
|
|
1caa276531 | ||
|
|
e673fe9a02 | ||
|
|
3ccbc7a28c | ||
|
|
8bb5ec5e26 | ||
|
|
35ff062407 | ||
|
|
ec355a83d1 | ||
|
|
182d8edb42 | ||
|
|
762e4da7a0 | ||
|
|
098c4c009b | ||
|
|
f8cf2c8953 | ||
|
|
cc6838ec97 | ||
|
|
dca637d4bb | ||
|
|
3949422430 | ||
|
|
2c8488f07a | ||
|
|
1df1fc32df | ||
|
|
eac8c116a8 | ||
|
|
a03019f5e4 | ||
|
|
714b4f45e4 | ||
|
|
68be8157ea | ||
|
|
ea2a8b6785 | ||
|
|
8c80d3b85d | ||
|
|
33c0764e65 | ||
|
|
d085c5a843 | ||
|
|
4ada40e8a8 | ||
|
|
1630d87c0d | ||
|
|
3a956a1ad3 | ||
|
|
774ced312f | ||
|
|
fec3d33dcf | ||
|
|
d4610e30fd | ||
|
|
885cda971d | ||
|
|
ef0b227967 | ||
|
|
19a785a98a | ||
|
|
b96bfcfe7a | ||
|
|
412c635499 | ||
|
|
da5ec56567 | ||
|
|
e664e80b27 | ||
|
|
d177b6f528 | ||
|
|
2ef3d78d9f | ||
|
|
5ea5e1167b | ||
|
|
116a605248 | ||
|
|
9690fe9334 | ||
|
|
a81fa84321 | ||
|
|
5ef97ae99e | ||
|
|
d667845777 | ||
|
|
b12b2aaf79 | ||
|
|
6b62f9c1b9 | ||
|
|
ba1cf25314 | ||
|
|
fb2ba6a6e2 | ||
|
|
fb6e310eab | ||
|
|
bcbd1a59c6 | ||
|
|
8e45a43ad2 | ||
|
|
115ed82c19 | ||
|
|
5c1e06ae74 | ||
|
|
f9205825b6 | ||
|
|
9040c34f48 | ||
|
|
9e9703e6de | ||
|
|
6486533355 | ||
|
|
34160151a4 | ||
|
|
daaaa324bd | ||
|
|
af5c74981b | ||
|
|
249ce6bca1 | ||
|
|
b648c74815 | ||
|
|
a2d459ae84 | ||
|
|
573781b45d | ||
|
|
3299999f3d | ||
|
|
91be4f6521 | ||
|
|
f2f21b24a1 | ||
|
|
9ef43a4794 | ||
|
|
fc02a69686 | ||
|
|
b10a0dc5c5 | ||
|
|
e5f0d1557c | ||
|
|
d8a3f4850a | ||
|
|
882d957b5c | ||
|
|
afd1727898 | ||
|
|
70a73e47a7 | ||
|
|
fe3f15ad33 | ||
|
|
66f625f840 | ||
|
|
3e1833722f | ||
|
|
4b8e11f561 | ||
|
|
0d04c20578 | ||
|
|
41c819f3d3 | ||
|
|
957154f097 | ||
|
|
fad506ef03 | ||
|
|
9150bbdfd8 | ||
|
|
aa4e2f0ae4 | ||
|
|
2bacc91922 | ||
|
|
458aa6d8b8 | ||
|
|
6963741020 | ||
|
|
b55aa982b0 | ||
|
|
492481eea8 | ||
|
|
76bff9cd4b | ||
|
|
47a6be86b1 | ||
|
|
287688d985 | ||
|
|
610d528042 | ||
|
|
89ec39821e | ||
|
|
82cfd3ecc3 | ||
|
|
5a3e3b3977 | ||
|
|
9cf6e421cb | ||
|
|
5c56b51044 | ||
|
|
577add56f1 | ||
|
|
adc5aa4659 | ||
|
|
5beed5ab29 | ||
|
|
34dd52ca90 | ||
|
|
6304b51f32 | ||
|
|
97a7de3377 | ||
|
|
7424b29e56 | ||
|
|
3c64d2ad80 | ||
|
|
1274fa13c8 | ||
|
|
3765686077 | ||
|
|
9fffd7a270 | ||
|
|
e37c07f44f | ||
|
|
214a3cce73 | ||
|
|
d738b07660 | ||
|
|
48ca8f9a70 | ||
|
|
c565b0a505 | ||
|
|
474833a3bf | ||
|
|
602f23fbdf | ||
|
|
7e9d46689c | ||
|
|
b6347d17c9 | ||
|
|
8293bc91d4 | ||
|
|
fb0f184d6b | ||
|
|
58e95c7d6f | ||
|
|
7a5381e658 | ||
|
|
375c06400c | ||
|
|
e481c86ba2 | ||
|
|
21b9f07323 | ||
|
|
0bff62e696 | ||
|
|
858597832d | ||
|
|
9b0ac7cb32 | ||
|
|
3c27384b6b | ||
|
|
1e8c26a527 | ||
|
|
f4069de7f2 | ||
|
|
e95161aa14 | ||
|
|
0984368a31 | ||
|
|
f4961d9da7 | ||
|
|
f42a174482 | ||
|
|
13bf607031 | ||
|
|
3cfdb1213b | ||
|
|
d58105d64d | ||
|
|
1bdd844860 | ||
|
|
11f3d97cd7 | ||
|
|
fccf044976 | ||
|
|
c23396f533 | ||
|
|
33c9f7118b | ||
|
|
c741ec223f | ||
|
|
d6d98bd297 | ||
|
|
5e1b5d89f7 | ||
|
|
a0edfd28b2 | ||
|
|
555fd02407 | ||
|
|
f7f9cfecfc | ||
|
|
2aeee59a31 | ||
|
|
12b8965a8c | ||
|
|
b5b6b8b785 | ||
|
|
35e073ceff | ||
|
|
b2cc96cf0d | ||
|
|
f7489a3747 | ||
|
|
0e7ebf6d44 | ||
|
|
69607d7890 | ||
|
|
4e87eb068a | ||
|
|
03a7c67731 | ||
|
|
5ba2449d10 | ||
|
|
0ee2fd8a8a | ||
|
|
080b9b30a1 | ||
|
|
749ac5ed54 | ||
|
|
6c8b9af6bb | ||
|
|
07922c0239 | ||
|
|
1a54ec92e0 | ||
|
|
663b574b8b | ||
|
|
430c51b71a | ||
|
|
20bcd03f19 | ||
|
|
dab959fc32 | ||
|
|
eff75e5d50 | ||
|
|
d103f022b4 | ||
|
|
72b8246969 | ||
|
|
030d05f018 | ||
|
|
59cd5493e7 | ||
|
|
98a7f6fa3f | ||
|
|
65095df124 | ||
|
|
ee370ea007 | ||
|
|
05016f8639 | ||
|
|
12154de6f5 | ||
|
|
3fca567b81 | ||
|
|
634574f249 | ||
|
|
f782d444a8 | ||
|
|
b68def2b9c | ||
|
|
d944301a60 | ||
|
|
15ba932046 | ||
|
|
b73c16c216 | ||
|
|
0ba4ef678c | ||
|
|
919d510f63 | ||
|
|
6557ac7fb4 | ||
|
|
87c307f47e | ||
|
|
f3e50b5500 | ||
|
|
705f252ed8 | ||
|
|
cb28101732 | ||
|
|
f87863b8bc | ||
|
|
25fb89f717 | ||
|
|
36e7856b9c | ||
|
|
34b0cdc125 | ||
|
|
25a1cb8ce7 | ||
|
|
a610b1545b | ||
|
|
30b698067a | ||
|
|
f63f1a0dc6 | ||
|
|
9cb867a7d4 | ||
|
|
00ddd95c27 | ||
|
|
0ffd1b9ff1 | ||
|
|
2109d49aa3 | ||
|
|
f910f4896c | ||
|
|
6eae3471cf | ||
|
|
c0fa91bec9 | ||
|
|
ba6dd3c751 | ||
|
|
fd63018fb5 | ||
|
|
2225915702 | ||
|
|
d14e486721 | ||
|
|
82b6da493a | ||
|
|
bec0b36bb9 | ||
|
|
e2c2821191 | ||
|
|
a19d34035d | ||
|
|
77ea03a62c | ||
|
|
402a0f129d | ||
|
|
d7116afc92 | ||
|
|
d5fe491c14 | ||
|
|
92138428c5 | ||
|
|
f3ff942ea9 | ||
|
|
ced6e8869a | ||
|
|
d7af50ea6c | ||
|
|
f7d4e5a2ea | ||
|
|
2e3788f23d | ||
|
|
eaf9a9283a | ||
|
|
ae66291272 | ||
|
|
4f78ec01cf | ||
|
|
be084d5603 | ||
|
|
aac0be1ab3 | ||
|
|
6282acc825 | ||
|
|
39fd30a472 | ||
|
|
279e391949 | ||
|
|
6df25392b8 | ||
|
|
327372e253 | ||
|
|
801dbaa387 | ||
|
|
ffd5c2d3d0 | ||
|
|
84c14b32ec | ||
|
|
c481e52558 | ||
|
|
b946ed4625 | ||
|
|
ef1572b15b | ||
|
|
aaeb18f433 | ||
|
|
dd1d86c289 | ||
|
|
16b162f7bb | ||
|
|
500ca54550 | ||
|
|
5313dc9475 | ||
|
|
9c0c1a802c | ||
|
|
fbedbdca7d | ||
|
|
6232e288e1 | ||
|
|
a6475f530b | ||
|
|
de84df99f3 | ||
|
|
a5d5c1f60b | ||
|
|
6ac3156a82 | ||
|
|
2705e77a4e | ||
|
|
a09aa31b7a | ||
|
|
9466461ce0 | ||
|
|
74ce7e9b10 | ||
|
|
10481a4ecc | ||
|
|
acd86ce490 | ||
|
|
1119a9ac22 | ||
|
|
171c0c8d3b | ||
|
|
9b5e0fef01 | ||
|
|
2f5e3b0aea | ||
|
|
ca3b0e6246 | ||
|
|
eb0459a045 | ||
|
|
5d98e13fb8 | ||
|
|
113904ea91 | ||
|
|
1dc3cc2d57 | ||
|
|
15a5975abf | ||
|
|
65debeb738 | ||
|
|
209a03a12a | ||
|
|
c28aeb2362 | ||
|
|
9152bbf106 | ||
|
|
40ba0238f8 | ||
|
|
4a3efa511c | ||
|
|
2479d28cd5 | ||
|
|
787d3bc5dd | ||
|
|
0bec78a958 | ||
|
|
e305b81df0 | ||
|
|
4cb109abe0 | ||
|
|
49a65edfc3 | ||
|
|
c6bfc82019 | ||
|
|
a4865fd2fc | ||
|
|
4bbd0cc404 | ||
|
|
4684f174ee | ||
|
|
34eb258cae | ||
|
|
b4c0ccbede | ||
|
|
51b5d7a41d | ||
|
|
15846a8ea8 | ||
|
|
e694081626 | ||
|
|
cb9605430d | ||
|
|
80507b2eca | ||
|
|
ed47346ef1 | ||
|
|
75ccd2283b | ||
|
|
409edf5a70 | ||
|
|
d047dfc319 | ||
|
|
13ed2742b2 | ||
|
|
03a3fb83b6 | ||
|
|
df1c9a5029 | ||
|
|
07e622f224 | ||
|
|
aa3a0fa392 | ||
|
|
c1287b3950 | ||
|
|
e5763e2e9a | ||
|
|
42a3c7b059 | ||
|
|
e621c98602 | ||
|
|
eb7eb4acbc | ||
|
|
e5b32fe8ac | ||
|
|
52061621ac | ||
|
|
339711c3c7 | ||
|
|
256fe7ede9 | ||
|
|
2febe632c5 | ||
|
|
c454e37064 | ||
|
|
fe1aba3561 | ||
|
|
41aa867a21 | ||
|
|
b36ebc294f | ||
|
|
3d71e5d111 | ||
|
|
ac59f25375 | ||
|
|
3393e2d95c | ||
|
|
e1ea3387ee | ||
|
|
071638794a | ||
|
|
953dd3d1a7 | ||
|
|
12bb0ca44b | ||
|
|
499cd48e83 | ||
|
|
444e08f59a | ||
|
|
9450c08eec | ||
|
|
18e68f1ab3 | ||
|
|
7555fefc18 | ||
|
|
f4fb8b4ac2 | ||
|
|
0d5cd89144 | ||
|
|
e273e09fc9 | ||
|
|
327017421c | ||
|
|
6e179346c9 | ||
|
|
ee218f36e0 | ||
|
|
f3400c983e | ||
|
|
9397301a73 | ||
|
|
f1ec612819 | ||
|
|
08f834cd82 | ||
|
|
48c17d08d9 | ||
|
|
f20fddee1c | ||
|
|
754d55beef | ||
|
|
cd813bbfbe | ||
|
|
07afbd64d4 | ||
|
|
af7d6f6fa8 | ||
|
|
cb0f513bf0 | ||
|
|
a3ef6c955c | ||
|
|
60e7a7aa23 | ||
|
|
e1431e1040 | ||
|
|
b794f2fda0 | ||
|
|
934d9ba69a | ||
|
|
9e54ddfd55 | ||
|
|
a86a24d33d | ||
|
|
fe9ed0ac9b | ||
|
|
18c94b6ec4 | ||
|
|
8fa0290e25 | ||
|
|
080cd146dd | ||
|
|
b1d910a3a5 | ||
|
|
840283d6e5 | ||
|
|
d72481e5ac | ||
|
|
dbe9309475 | ||
|
|
9fa4de6ee8 | ||
|
|
fd3c5e8384 | ||
|
|
d50ed1c087 | ||
|
|
e48133bf4b | ||
|
|
ea3bfd969c | ||
|
|
7469d6a248 | ||
|
|
859f36afce | ||
|
|
436a788ac8 | ||
|
|
5098e24806 | ||
|
|
1d8acc16f1 | ||
|
|
802c7a86a9 | ||
|
|
406eb828da | ||
|
|
0e9106685b | ||
|
|
9b001987e9 | ||
|
|
5c2c02c317 | ||
|
|
21c898d796 | ||
|
|
e48b708fa6 | ||
|
|
ccf7619ae5 | ||
|
|
eabbd0061f | ||
|
|
7d0d6b8e0d | ||
|
|
eb36fe0155 | ||
|
|
9381a40506 | ||
|
|
a19270a0dc | ||
|
|
c34ce2d9e1 | ||
|
|
58465c3727 | ||
|
|
177ed2c603 | ||
|
|
7bb994f7bc | ||
|
|
0c4f35e2d0 | ||
|
|
3287501f97 | ||
|
|
2454594a18 | ||
|
|
4daab23e2d | ||
|
|
51161004eb | ||
|
|
6477f1656e | ||
|
|
270e2a76a8 | ||
|
|
c61442e960 | ||
|
|
d0928af355 | ||
|
|
674093517e | ||
|
|
ebf3877cda | ||
|
|
e97310c441 | ||
|
|
cbe3e608b6 | ||
|
|
f30f23ba51 | ||
|
|
1ba117a8e9 | ||
|
|
d9a245dcb5 | ||
|
|
9cbf5ab6a6 | ||
|
|
c9e4e62474 | ||
|
|
aa6a1db0a9 | ||
|
|
e9d66be10a | ||
|
|
8b6f12418e | ||
|
|
7013d447ca | ||
|
|
93b2f535e2 | ||
|
|
591d572870 | ||
|
|
3ab749cc2e | ||
|
|
084fac3606 | ||
|
|
f377461fdf | ||
|
|
a2971ce939 | ||
|
|
65671d8788 | ||
|
|
809d5f1aa8 | ||
|
|
49fc6143ab | ||
|
|
8717843333 | ||
|
|
f6d8996968 | ||
|
|
9389305072 | ||
|
|
b6bd4bc6f8 | ||
|
|
4c6fbafd20 | ||
|
|
43c6175918 | ||
|
|
fcd741e2b8 | ||
|
|
89807250e5 | ||
|
|
24f7db19d8 | ||
|
|
49d93c0e76 | ||
|
|
707c93c32c | ||
|
|
e204f05726 | ||
|
|
3bd8ad50d2 | ||
|
|
3488d4e65f | ||
|
|
3da736a1eb | ||
|
|
e30c61c0e2 | ||
|
|
64e97124c3 | ||
|
|
46979419ae | ||
|
|
30d9b6d844 | ||
|
|
88045ce3be | ||
|
|
dd881d3da9 | ||
|
|
76d0608ee1 | ||
|
|
a894ca60c6 | ||
|
|
023f6712f9 | ||
|
|
42740149ac | ||
|
|
7b74015c4d | ||
|
|
57c71efe53 | ||
|
|
45de874598 | ||
|
|
aa702f0678 | ||
|
|
927dccc71d | ||
|
|
c2a24fbbce | ||
|
|
ae94a6aeba | ||
|
|
e9da43666c | ||
|
|
d27dd68072 | ||
|
|
b1ee27a3f3 | ||
|
|
32372654c2 | ||
|
|
17d0b19f9e | ||
|
|
d13f7f06e4 | ||
|
|
f469b56b93 | ||
|
|
ef74f86ce2 | ||
|
|
616cbdb1eb | ||
|
|
0a49e69818 | ||
|
|
adb8ec1da8 | ||
|
|
5d73c6cb84 | ||
|
|
afa1d429fe | ||
|
|
d1309c3aeb | ||
|
|
b35cf6e30c | ||
|
|
8cbe0e5b30 | ||
|
|
c1fe547925 | ||
|
|
1064b41ab2 | ||
|
|
2a6c2e5db4 | ||
|
|
816337a7bb | ||
|
|
d237114962 | ||
|
|
c1ca2c1a95 | ||
|
|
44a43c2c09 | ||
|
|
ee8098839e | ||
|
|
305b2579eb | ||
|
|
1a09d297ee | ||
|
|
d45e6e0ad1 | ||
|
|
2d2523df4a | ||
|
|
5a0fcfffb0 | ||
|
|
f252161d90 | ||
|
|
e0216e2658 | ||
|
|
0f2bb5720b | ||
|
|
0621e365ff | ||
|
|
8ea455def7 | ||
|
|
8cf822c426 | ||
|
|
4a009c1c2c | ||
|
|
360dc4f7ed | ||
|
|
ffe43e1f22 | ||
|
|
a52d901f25 | ||
|
|
5bae2f06ad | ||
|
|
69b0954007 | ||
|
|
0645402946 | ||
|
|
c59b244d04 | ||
|
|
5678d9a253 | ||
|
|
a520d245a6 | ||
|
|
b56f6fa330 | ||
|
|
f141869ce3 | ||
|
|
807f3852bd | ||
|
|
084089b919 | ||
|
|
f571a41cf3 | ||
|
|
686a966ff7 | ||
|
|
c29eb458ea | ||
|
|
234c843f60 | ||
|
|
7ed0499aa9 | ||
|
|
401b145040 | ||
|
|
3853ff5435 | ||
|
|
744c6b2680 | ||
|
|
030a17fc58 | ||
|
|
b1e2e84a11 | ||
|
|
12a6088912 | ||
|
|
fe9f3f78a0 | ||
|
|
327eb330ed | ||
|
|
470121512a | ||
|
|
dedc144b8b | ||
|
|
6d37398fad | ||
|
|
3c8fe508f0 | ||
|
|
8ffb3aac8a | ||
|
|
0ed9391969 | ||
|
|
e54289f811 | ||
|
|
17b091e5a9 | ||
|
|
61c142e2db | ||
|
|
7e664679a0 | ||
|
|
fd152e82e8 | ||
|
|
0c50e43663 | ||
|
|
7a2ac4a9c0 | ||
|
|
e6bb9d980d | ||
|
|
45cc7e5bcc | ||
|
|
4be4870982 | ||
|
|
19c2061831 | ||
|
|
3a8c58d192 | ||
|
|
24763f9b07 | ||
|
|
0d7a2e7bad | ||
|
|
82ab06efdd | ||
|
|
4110ee0928 | ||
|
|
4b05cf4399 | ||
|
|
f29a9f5f58 | ||
|
|
28001ea150 | ||
|
|
f633b3dbf6 | ||
|
|
bebfa611fc | ||
|
|
3e9f2df2bf | ||
|
|
fce8afabfb | ||
|
|
9d49985100 | ||
|
|
a7d4cafe10 | ||
|
|
ca2a6635b6 | ||
|
|
7f1bb9b4a6 | ||
|
|
7341a6b020 | ||
|
|
ac05acf6dc | ||
|
|
3e1db432df | ||
|
|
3c682507e7 | ||
|
|
e9ae6d08b5 | ||
|
|
f435a81c97 | ||
|
|
cb34c23844 | ||
|
|
9f9141823a | ||
|
|
d3437c70bd | ||
|
|
8630ef2c67 | ||
|
|
0b50678912 | ||
|
|
22ff45f5d0 | ||
|
|
905bbf1515 | ||
|
|
88c1b1400d | ||
|
|
8e48a98d48 | ||
|
|
76dbefb9ec | ||
|
|
327dcc0293 | ||
|
|
e6c55107c7 | ||
|
|
c5dbbea9ef | ||
|
|
74707551ae | ||
|
|
2f5f5ef0a6 | ||
|
|
f7dc9d8e72 | ||
|
|
238162bb79 | ||
|
|
1fda8753bd | ||
|
|
a688bed79f | ||
|
|
b0ff51d5a0 | ||
|
|
68f633e9cd | ||
|
|
a520af42e8 | ||
|
|
0a6885e02d | ||
|
|
aa5a509316 | ||
|
|
97879430e9 | ||
|
|
ae97eae42f | ||
|
|
c5d7e3c783 | ||
|
|
9bcd36cc24 | ||
|
|
c6881a425f | ||
|
|
8d0209b122 | ||
|
|
279894cfd4 | ||
|
|
169ee14724 | ||
|
|
8866d5cfd6 | ||
|
|
3b9a7910d0 | ||
|
|
b5885d4107 | ||
|
|
a254a342b1 | ||
|
|
0db95d76a8 | ||
|
|
69a9211fc9 | ||
|
|
44cd03f464 | ||
|
|
9242a0a510 | ||
|
|
2b9e050f57 | ||
|
|
9d4fe707bb | ||
|
|
0d2552c3f6 | ||
|
|
b3c9637422 | ||
|
|
01a3321d63 | ||
|
|
5a5e72c424 | ||
|
|
b8dc7494eb | ||
|
|
532cd779a7 | ||
|
|
d202a6c572 | ||
|
|
6e864e4f8f | ||
|
|
6ef76fe665 | ||
|
|
314672d82c | ||
|
|
1d558b33d6 | ||
|
|
911385d019 | ||
|
|
5b97c2135a | ||
|
|
365f24e1fe | ||
|
|
7157c3b441 | ||
|
|
28d7f2eaa2 | ||
|
|
0d449370e0 | ||
|
|
10ad1c3b38 | ||
|
|
90c566dde3 | ||
|
|
33cbead4a4 | ||
|
|
d6dfeaeba7 | ||
|
|
bc00c6c54b | ||
|
|
3d5aa7c20c | ||
|
|
a5ba43ea39 | ||
|
|
3eb4862794 | ||
|
|
c025606739 | ||
|
|
067e9be37a | ||
|
|
b7b9c611cf | ||
|
|
3c4eec62ae | ||
|
|
fd7dba74cd | ||
|
|
a8674c18df | ||
|
|
b26cd6cc94 | ||
|
|
55a29e6e6b | ||
|
|
56d7c05b51 | ||
|
|
5e4fc64430 | ||
|
|
12ea6dcfd7 | ||
|
|
a41f8cb01b | ||
|
|
a9c82dbe21 | ||
|
|
5350d88f57 | ||
|
|
fc132e87f4 | ||
|
|
c326853617 | ||
|
|
3ad60a0fa1 | ||
|
|
772f4dcb60 | ||
|
|
657a6af9dc | ||
|
|
5e1f189db3 | ||
|
|
a2d11f670a | ||
|
|
5bf6f814ef | ||
|
|
fc84cd2a0a | ||
|
|
ab43486ee0 | ||
|
|
d8724f0be4 | ||
|
|
fce3959d15 | ||
|
|
36b0d47f5f | ||
|
|
cf84ad12f1 | ||
|
|
ffe7114a47 | ||
|
|
6891ed8064 | ||
|
|
8f91830997 | ||
|
|
fbdfed84be | ||
|
|
786c408f6e | ||
|
|
6e031b518a | ||
|
|
500dd0a82b | ||
|
|
d562642e26 | ||
|
|
cbcb90638b | ||
|
|
8211acf4e0 | ||
|
|
c4a25e0d70 | ||
|
|
3ec9977212 | ||
|
|
64eb0a694d | ||
|
|
d46d62bf03 | ||
|
|
95ed044fee | ||
|
|
3fe392b41f | ||
|
|
854bfb8673 | ||
|
|
fb43a5590f | ||
|
|
5d4f8373c4 | ||
|
|
ac9664c7ae | ||
|
|
2905f951bd | ||
|
|
79dc090aae | ||
|
|
d52b07beac | ||
|
|
12815bfbf2 | ||
|
|
b9b8b0521b | ||
|
|
af8febabd1 | ||
|
|
f0a856d9c8 | ||
|
|
85895c5311 | ||
|
|
c076f4ff8e | ||
|
|
87ce35b32d | ||
|
|
5285f51a26 | ||
|
|
3e23634369 | ||
|
|
36cec298c2 | ||
|
|
6199426e5e | ||
|
|
4e295622be | ||
|
|
2182ba9630 | ||
|
|
e5720cf8b9 | ||
|
|
6063ca2ad1 | ||
|
|
99de598ea4 | ||
|
|
b23d5ed354 | ||
|
|
a1ce5faac2 | ||
|
|
afaabe26a6 | ||
|
|
a68afcc672 | ||
|
|
d4bb5423ae | ||
|
|
ce8e5880e2 | ||
|
|
0cef18af86 | ||
|
|
ad4d0cf00a | ||
|
|
a6f12d3009 | ||
|
|
fa09854671 | ||
|
|
78d2cd848a | ||
|
|
463997da51 | ||
|
|
fef0993f54 | ||
|
|
2218126c75 | ||
|
|
2388260848 | ||
|
|
40298cefb6 | ||
|
|
45bf927c74 | ||
|
|
347c6d6a91 | ||
|
|
ab6214142f | ||
|
|
402b38951d | ||
|
|
6807cf5849 | ||
|
|
15dc25d2cd | ||
|
|
568c7fd917 | ||
|
|
e5562a7b61 | ||
|
|
ac308f7298 | ||
|
|
7a88379917 | ||
|
|
e44718d531 | ||
|
|
e6a2c207de | ||
|
|
df83b155a1 | ||
|
|
cc2c97cfad | ||
|
|
c69ea00e79 | ||
|
|
f63dd72260 | ||
|
|
5b0b917468 | ||
|
|
b138a63502 | ||
|
|
8eec5389fe | ||
|
|
5524aaae1e | ||
|
|
acffeb1dad | ||
|
|
6c7d57e1eb | ||
|
|
7c9f5f8ab1 | ||
|
|
6b4f55c4bf | ||
|
|
89335938c1 | ||
|
|
437630d26d | ||
|
|
341c9dae39 | ||
|
|
c10b70cb61 | ||
|
|
4c7bf1ff44 | ||
|
|
f467d0c807 | ||
|
|
a717b7fc49 | ||
|
|
07a9c4602d | ||
|
|
eeb170af22 | ||
|
|
c532c3032c | ||
|
|
2b8b3e1993 | ||
|
|
b0a889d1a1 | ||
|
|
bd1bfea695 | ||
|
|
a1299e1dfe | ||
|
|
1a5a76a201 | ||
|
|
b072b627a2 | ||
|
|
5d18c6d678 | ||
|
|
59fba30a52 | ||
|
|
193cde83b6 | ||
|
|
12bfb8f795 | ||
|
|
9ae72dbc47 | ||
|
|
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:
|
task:
|
||||||
name: freebsd-12-amd64
|
name: freebsd-12-amd64
|
||||||
freebsd_instance:
|
freebsd_instance:
|
||||||
image_family: freebsd-12-0
|
image_family: freebsd-12-3
|
||||||
setup_script:
|
setup_script:
|
||||||
- pkg install -y git sdl2 python
|
- pkg update
|
||||||
|
- pkg install -y git sdl2 python fontconfig
|
||||||
- git submodule update --init --recursive
|
- git submodule update --init --recursive
|
||||||
test_script:
|
test_script:
|
||||||
# - ./scripts/build_freebsd_engine.sh dedicated
|
- ./scripts/cirrus/build_freebsd.sh dedicated
|
||||||
- ./scripts/build_freebsd_engine.sh
|
- ./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
|
||||||
126
.github/workflows/c-cpp.yml
vendored
Normal file
126
.github/workflows/c-cpp.yml
vendored
Normal file
@@ -0,0 +1,126 @@
|
|||||||
|
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-20.04
|
||||||
|
targetos: linux
|
||||||
|
targetarch: amd64
|
||||||
|
- os: ubuntu-20.04
|
||||||
|
targetos: linux
|
||||||
|
targetarch: i386
|
||||||
|
# - os: ubuntu-aarch64-20.04
|
||||||
|
# targetos: linux
|
||||||
|
# targetarch: aarch64
|
||||||
|
|
||||||
|
# - os: ubuntu-20.04
|
||||||
|
# targetos: android
|
||||||
|
# targetarch: 32
|
||||||
|
# - os: ubuntu-20.04
|
||||||
|
# targetos: android
|
||||||
|
# targetarch: 64
|
||||||
|
|
||||||
|
# - os: ubuntu-20.04
|
||||||
|
# targetos: motomagx
|
||||||
|
# targetarch: armv6
|
||||||
|
|
||||||
|
- os: ubuntu-20.04
|
||||||
|
targetos: nswitch
|
||||||
|
targetarch: arm64
|
||||||
|
- os: ubuntu-20.04
|
||||||
|
targetos: psvita
|
||||||
|
targetarch: armv7hf
|
||||||
|
- os: windows-latest
|
||||||
|
targetos: win32
|
||||||
|
targetarch: amd64
|
||||||
|
- os: windows-latest
|
||||||
|
targetos: win32
|
||||||
|
targetarch: i386
|
||||||
|
env:
|
||||||
|
SDL_VERSION: 2.26.2
|
||||||
|
GH_CPU_ARCH: ${{ matrix.targetarch }}
|
||||||
|
ANDROID_SDK_TOOLS_VER: 4333796
|
||||||
|
steps:
|
||||||
|
- name: Checkout
|
||||||
|
uses: actions/checkout@v3
|
||||||
|
with:
|
||||||
|
submodules: recursive
|
||||||
|
- 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 (artifacts)
|
||||||
|
uses: actions/upload-artifact@v3
|
||||||
|
with:
|
||||||
|
name: artifact-${{ matrix.targetos }}-${{ matrix.targetarch }}
|
||||||
|
path: artifacts/*
|
||||||
|
flatpak:
|
||||||
|
name: "Flatpak"
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
strategy:
|
||||||
|
matrix:
|
||||||
|
include:
|
||||||
|
- app: su.xash.Engine.Compat.i386
|
||||||
|
container:
|
||||||
|
image: bilelmoussaoui/flatpak-github-actions:freedesktop-22.08
|
||||||
|
options: --privileged
|
||||||
|
steps:
|
||||||
|
- name: Checkout
|
||||||
|
uses: actions/checkout@v3
|
||||||
|
with:
|
||||||
|
submodules: recursive
|
||||||
|
- name: Build flatpak (Compat.i386)
|
||||||
|
uses: FWGS/flatpak-github-actions/flatpak-builder@v5
|
||||||
|
with:
|
||||||
|
bundle: ${{ matrix.app }}.flatpak
|
||||||
|
manifest-path: scripts/flatpak/${{ matrix.app }}.yml
|
||||||
|
- name: Upload engine (artifacts)
|
||||||
|
uses: actions/upload-artifact@v3
|
||||||
|
with:
|
||||||
|
name: artifact-${{ matrix.targetos }}-${{ matrix.targetarch }}
|
||||||
|
path: artifacts/*
|
||||||
|
release:
|
||||||
|
name: "Upload releases"
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
needs: [build, flatpak]
|
||||||
|
if: ${{ github.event_name == 'push' }}
|
||||||
|
steps:
|
||||||
|
- name: Remove old release
|
||||||
|
uses: FWGS/delete-tag-and-release@v0.2.1-dev
|
||||||
|
with:
|
||||||
|
tag_name: ${{ github.ref_name == 'master' && 'continuous' || format('continuous-{0}', github.ref_name) }}
|
||||||
|
delete_release: true
|
||||||
|
github_token: ${{ secrets.GITHUB_TOKEN }}
|
||||||
|
- name: Fetch artifacts
|
||||||
|
uses: actions/download-artifact@v3.0.1
|
||||||
|
with:
|
||||||
|
path: artifacts/
|
||||||
|
- name: Repackage binaries and allow GitHub to process removed release for few seconds
|
||||||
|
run: |
|
||||||
|
cd artifacts/
|
||||||
|
for i in artifact-* su.xash.Engine.*; do
|
||||||
|
mv "$i"/* .
|
||||||
|
rm -rf "$i"
|
||||||
|
done
|
||||||
|
ls -R .
|
||||||
|
cd ../
|
||||||
|
sleep 20s
|
||||||
|
- name: Upload new release
|
||||||
|
uses: FWGS/action-gh-release@v0.1.15
|
||||||
|
with:
|
||||||
|
name: Xash3D FWGS Continuous ${{ github.ref_name }} Build
|
||||||
|
tag_name: ${{ github.ref_name == 'master' && 'continuous' || format('continuous-{0}', github.ref_name) }}
|
||||||
|
prerelease: true
|
||||||
|
token: ${{ secrets.GITHUB_TOKEN }}
|
||||||
|
files: artifacts/*
|
||||||
|
draft: false
|
||||||
12
.gitignore
vendored
12
.gitignore
vendored
@@ -314,9 +314,8 @@ build-*
|
|||||||
|
|
||||||
# Waf
|
# Waf
|
||||||
build_current
|
build_current
|
||||||
.waf-*
|
*waf-*/
|
||||||
waf-*/
|
*waf3-*/
|
||||||
waf3-*/
|
|
||||||
.lock-waf*
|
.lock-waf*
|
||||||
*.lastbuildstate
|
*.lastbuildstate
|
||||||
*.unsuccessfulbuild
|
*.unsuccessfulbuild
|
||||||
@@ -327,3 +326,10 @@ __pycache__
|
|||||||
*.vcproj
|
*.vcproj
|
||||||
*.sln
|
*.sln
|
||||||
*.vcxproj
|
*.vcxproj
|
||||||
|
|
||||||
|
# Visual Studio Code
|
||||||
|
.vscode/*
|
||||||
|
*.code-workspace
|
||||||
|
.history/*
|
||||||
|
.cache/*
|
||||||
|
enc_temp_folder/
|
||||||
|
|||||||
21
.gitmodules
vendored
21
.gitmodules
vendored
@@ -1,12 +1,21 @@
|
|||||||
[submodule "mainui"]
|
[submodule "mainui"]
|
||||||
path = mainui
|
path = 3rdparty/mainui
|
||||||
url = https://github.com/FWGS/mainui_cpp
|
url = https://github.com/FWGS/mainui_cpp
|
||||||
[submodule "ref_gl/nanogl"]
|
[submodule "ref_gl/nanogl"]
|
||||||
path = ref_gl/nanogl
|
path = 3rdparty/nanogl
|
||||||
url = https://github.com/FWGS/nanogl
|
url = https://github.com/FWGS/nanogl
|
||||||
[submodule "ref_gl/gl-wes-v2"]
|
[submodule "ref_gl/gl-wes-v2"]
|
||||||
path = ref_gl/gl-wes-v2
|
path = 3rdparty/gl-wes-v2
|
||||||
url = https://github.com/FWGS/gl-wes-v2
|
url = https://github.com/FWGS/gl-wes-v2
|
||||||
[submodule "vgui-dev"]
|
[submodule "ref_gl/gl4es"]
|
||||||
path = vgui-dev
|
path = 3rdparty/gl4es/gl4es
|
||||||
url = https://github.com/FWGS/vgui-dev
|
url = https://github.com/ptitSeb/gl4es
|
||||||
|
[submodule "vgui_support"]
|
||||||
|
path = 3rdparty/vgui_support
|
||||||
|
url = https://github.com/FWGS/vgui_support
|
||||||
|
[submodule "opus"]
|
||||||
|
path = 3rdparty/opus/opus
|
||||||
|
url = https://github.com/xiph/opus
|
||||||
|
[submodule "3rdparty/xash-extras"]
|
||||||
|
path = 3rdparty/extras/xash-extras
|
||||||
|
url = https://github.com/FWGS/xash-extras
|
||||||
|
|||||||
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
|
|
||||||
29
3rdparty/extras/wscript
vendored
Normal file
29
3rdparty/extras/wscript
vendored
Normal file
@@ -0,0 +1,29 @@
|
|||||||
|
#! /usr/bin/env python
|
||||||
|
# encoding: utf-8
|
||||||
|
|
||||||
|
import os
|
||||||
|
|
||||||
|
def options(opt):
|
||||||
|
pass
|
||||||
|
|
||||||
|
def configure(conf):
|
||||||
|
if not conf.path.find_dir('xash-extras'):
|
||||||
|
conf.fatal('Can\'t find xash-extras submodule.')
|
||||||
|
return
|
||||||
|
|
||||||
|
conf.load('zip')
|
||||||
|
|
||||||
|
def build(bld):
|
||||||
|
srcdir = bld.path.find_dir('xash-extras')
|
||||||
|
|
||||||
|
if bld.env.DEST_OS in ['android']:
|
||||||
|
install_path = bld.env.PREFIX
|
||||||
|
else:
|
||||||
|
install_path = os.path.join(bld.env.SHAREDIR, bld.env.GAMEDIR)
|
||||||
|
|
||||||
|
bld(features='zip',
|
||||||
|
name = 'extras.pk3',
|
||||||
|
files = srcdir.ant_glob('**/*'),
|
||||||
|
relative_to = srcdir,
|
||||||
|
compresslevel = 0,
|
||||||
|
install_path = install_path)
|
||||||
1
3rdparty/extras/xash-extras
vendored
Submodule
1
3rdparty/extras/xash-extras
vendored
Submodule
Submodule 3rdparty/extras/xash-extras added at 853f633be1
1
3rdparty/gl-wes-v2
vendored
Submodule
1
3rdparty/gl-wes-v2
vendored
Submodule
Submodule 3rdparty/gl-wes-v2 added at 0be6803f81
1
3rdparty/gl4es/gl4es
vendored
Submodule
1
3rdparty/gl4es/gl4es
vendored
Submodule
Submodule 3rdparty/gl4es/gl4es added at 277be116c1
24
3rdparty/gl4es/wscript
vendored
Normal file
24
3rdparty/gl4es/wscript
vendored
Normal file
@@ -0,0 +1,24 @@
|
|||||||
|
#! /usr/bin/env python
|
||||||
|
# encoding: utf-8
|
||||||
|
|
||||||
|
import os
|
||||||
|
|
||||||
|
def options(opt):
|
||||||
|
pass
|
||||||
|
|
||||||
|
def configure(conf):
|
||||||
|
if not conf.path.find_dir('gl4es') or not conf.path.find_dir('gl4es/src'):
|
||||||
|
conf.fatal('Can\'t find gl4es submodule. Run `git submodule update --init --recursive`.')
|
||||||
|
return
|
||||||
|
|
||||||
|
def build(bld):
|
||||||
|
gl4es_srcdir = bld.path.find_node('gl4es/src')
|
||||||
|
|
||||||
|
bld.stlib(source = gl4es_srcdir.ant_glob(['gl/*.c', 'gl/*/*.c', 'glx/hardext.c']),
|
||||||
|
target = 'gl4es',
|
||||||
|
features = 'c',
|
||||||
|
includes = ['gl4es/src', 'gl4es/src/gl', 'gl4es/src/glx', 'gl4es/include'],
|
||||||
|
defines = ['NOX11', 'NO_GBM', 'NO_INIT_CONSTRUCTOR', 'DEFAULT_ES=2', 'NOEGL', 'EXTERNAL_GETPROCADDRESS=GL4ES_GetProcAddress', 'NO_LOADER', 'STATICLIB'],
|
||||||
|
cflags = ['-w', '-fvisibility=hidden', '-std=gnu99'],
|
||||||
|
subsystem = bld.env.MSVC_SUBSYSTEM,
|
||||||
|
export_includes = '.')
|
||||||
1
3rdparty/mainui
vendored
Submodule
1
3rdparty/mainui
vendored
Submodule
Submodule 3rdparty/mainui added at 262128c0d1
1
3rdparty/nanogl
vendored
Submodule
1
3rdparty/nanogl
vendored
Submodule
Submodule 3rdparty/nanogl added at 5f2892a37e
1
3rdparty/opus/opus
vendored
Submodule
1
3rdparty/opus/opus
vendored
Submodule
Submodule 3rdparty/opus/opus added at 8cf872a186
40
3rdparty/opus/wscript
vendored
Normal file
40
3rdparty/opus/wscript
vendored
Normal file
@@ -0,0 +1,40 @@
|
|||||||
|
#! /usr/bin/env python
|
||||||
|
# encoding: utf-8
|
||||||
|
|
||||||
|
import os
|
||||||
|
|
||||||
|
def options(opt):
|
||||||
|
pass
|
||||||
|
|
||||||
|
def configure(conf):
|
||||||
|
if not conf.path.find_dir('opus') or not conf.path.find_dir('opus/src'):
|
||||||
|
conf.fatal('Can\'t find opus submodule. Run `git submodule update --init --recursive`.')
|
||||||
|
return
|
||||||
|
|
||||||
|
# TODO: ARM/x86 intrinsics detection
|
||||||
|
# TODO: maybe call autotools/cmake/meson instead?
|
||||||
|
|
||||||
|
def build(bld):
|
||||||
|
sources = bld.path.ant_glob([
|
||||||
|
'opus/src/*.c',
|
||||||
|
'opus/celt/*.c',
|
||||||
|
'opus/silk/*.c',
|
||||||
|
'opus/silk/float/*.c'
|
||||||
|
], excl = [
|
||||||
|
'opus/src/repacketizer_demo.c',
|
||||||
|
'opus/src/opus_demo.c',
|
||||||
|
'opus/src/opus_compare.c',
|
||||||
|
'opus/celt/opus_custom_demo.c'
|
||||||
|
])
|
||||||
|
includes = ['opus/include/', 'opus/celt/', 'opus/silk/', 'opus/silk/float/']
|
||||||
|
defines = ['USE_ALLOCA', 'OPUS_BUILD', 'FLOAT_APPROX', 'PACKAGE_VERSION="1.3.1"', 'CUSTOM_MODES']
|
||||||
|
|
||||||
|
bld.stlib(
|
||||||
|
source = sources,
|
||||||
|
target = 'opus',
|
||||||
|
features = 'c',
|
||||||
|
includes = includes,
|
||||||
|
defines = defines,
|
||||||
|
subsystem = bld.env.MSVC_SUBSYSTEM,
|
||||||
|
export_includes = ['opus/include/']
|
||||||
|
)
|
||||||
1
3rdparty/vgui_support
vendored
Submodule
1
3rdparty/vgui_support
vendored
Submodule
Submodule 3rdparty/vgui_support added at 27fbcbf2bf
17
Documentation/bug-compatibility.md
Normal file
17
Documentation/bug-compatibility.md
Normal file
@@ -0,0 +1,17 @@
|
|||||||
|
# Bug-compatibility in Xash3D FWGS
|
||||||
|
|
||||||
|
Xash3D FWGS has special mode for games that rely on original engine bugs.
|
||||||
|
|
||||||
|
In this mode, we emulate the behaviour of selected functions that may help running mods relying on engine bugs, but enabling them by default may break majority of other games.
|
||||||
|
|
||||||
|
At this time, we only have implemented GoldSrc bug-compatibility. It can be enabled with `-bugcomp` command line switch.
|
||||||
|
|
||||||
|
## GoldSrc bug-compatibility
|
||||||
|
|
||||||
|
### Emulated bugs
|
||||||
|
|
||||||
|
* `pfnPEntityOfEntIndex` in GoldSrc returns NULL for last player due to incorrect player index comparison
|
||||||
|
|
||||||
|
### Games and mods that require this
|
||||||
|
|
||||||
|
* Counter-Strike: Condition Zero - Deleted Scenes
|
||||||
9
Documentation/cross-compiling-for-windows-with-wine.md
Normal file
9
Documentation/cross-compiling-for-windows-with-wine.md
Normal file
@@ -0,0 +1,9 @@
|
|||||||
|
# Cross-compiling for Windows with Wine
|
||||||
|
|
||||||
|
This can be useful to test engine in Wine without using virtual machines or dual-booting to Windows.
|
||||||
|
|
||||||
|
0. Clone and install https://github.com/mstorsjo/msvc-wine (you can skip CMake part)
|
||||||
|
1. Set environment variable MSVC_WINE_PATH to the path to installed MSVC toolchain
|
||||||
|
2. Pre-load wine: `wineserver -k; wineserver -p; wine64 wineboot`
|
||||||
|
3. Run `./waf configure -T <build-type> --enable-wine-msvc --sdl2=../SDL2_VC`. Configuration step will take more time than usual.
|
||||||
|
4. .. other typical steps to build from console ...
|
||||||
10
Documentation/debugging-using-minidumps.md
Normal file
10
Documentation/debugging-using-minidumps.md
Normal file
@@ -0,0 +1,10 @@
|
|||||||
|
# Debugging your mod using minidump files (Windows only)
|
||||||
|
Minidump files is awesome instrument for debugging your mod after it's being released, or for catch specific crashes which are presented only in one specific configuration, but doesn't happens in other configurations or even on developer machine. It contains a lot of information useful for debugging, and therefore it size is not so small: around hundreds or even thousands of megabytes. But this is not a problem, since minidump files compresses very effectively using common algorithms.
|
||||||
|
There are short algorithm, explaining how to use this debugging instrument:
|
||||||
|
|
||||||
|
1. User starts your mod with `-minidumps` startup parameter
|
||||||
|
2. Finally, crash happened on user's machine, and minidump file being written. This file has `.mdmp` extension and located in same folder, where mod folder located
|
||||||
|
3. User packs this minidump file to .zip/.7z archive, and somehow sends it to developer
|
||||||
|
4. Developer just opens minidump file in Visual Studio, then a virtual debugging session is opened and now reasons of crash is pretty easy to detect: you can see call stack, local function variables and global variables, information about exception and a lot of other information
|
||||||
|
|
||||||
|
You can find more information about minidumps in this [awesome article](https://learn.microsoft.com/en-us/windows/win32/dxtecharts/crash-dump-analysis?source=recommendations#writing-a-minidump).
|
||||||
150
Documentation/entity-tools.md
Normal file
150
Documentation/entity-tools.md
Normal file
@@ -0,0 +1,150 @@
|
|||||||
|
# There are few new commands availiable in xash3d fork:
|
||||||
|
|
||||||
|
## Commands:
|
||||||
|
### ent_create
|
||||||
|
Create entity with specified classname and key/values
|
||||||
|
|
||||||
|
`ent_create <classname> <key> <value> <key> <value> ...`
|
||||||
|
|
||||||
|
for example:
|
||||||
|
|
||||||
|
`ent_create monster_zombie targetname zomb1`
|
||||||
|
|
||||||
|
after creating entity, ent_last_xxx cvars are set to new entity and ent_last_cb called, look at ent_getvars description
|
||||||
|
|
||||||
|
### ent_fire
|
||||||
|
|
||||||
|
Make some actions on entity
|
||||||
|
|
||||||
|
`ent_fire <pattern> <command> <args>`
|
||||||
|
Availiavle commands:
|
||||||
|
* Set fields (Only set entity field, does not call any functions):
|
||||||
|
* health
|
||||||
|
* gravity
|
||||||
|
* movetype
|
||||||
|
* solid
|
||||||
|
* rendermode
|
||||||
|
* rendercolor (vector)
|
||||||
|
* renderfx
|
||||||
|
* renderamt
|
||||||
|
* hullmin (vector)
|
||||||
|
* hullmax (vector)
|
||||||
|
* Actions
|
||||||
|
* rename: set entity targetname
|
||||||
|
* settarget: set entity target (only targetnames)
|
||||||
|
* setmodel: set entity model (does not update)
|
||||||
|
* set: set key/value by server library
|
||||||
|
* See game FGD to get list.
|
||||||
|
* command takes two arguments
|
||||||
|
* touch: touch entity by current player.
|
||||||
|
* use: use entity by current player.
|
||||||
|
* movehere: place entity in player fov.
|
||||||
|
* drop2floor: place entity to nearest floor surface
|
||||||
|
* moveup: move entity to 25 units up
|
||||||
|
* moveup (value): move by y axis relatively to specified value
|
||||||
|
* Flags (Set/clear specified flag bit, arg is bit number):
|
||||||
|
* setflag
|
||||||
|
* clearflag
|
||||||
|
* setspawnflag
|
||||||
|
* clearspawnflag
|
||||||
|
|
||||||
|
### ent_info
|
||||||
|
Print information about entity by identificator
|
||||||
|
|
||||||
|
`ent_info <identificator>`
|
||||||
|
|
||||||
|
### ent_getvars
|
||||||
|
Set client cvars containing entity information (useful for [[Scripting]]) and call ent_last_cb
|
||||||
|
|
||||||
|
`ent_getvars <identificator>`
|
||||||
|
|
||||||
|
These cvars are set:
|
||||||
|
```
|
||||||
|
ent_last_name
|
||||||
|
ent_last_num
|
||||||
|
ent_last_inst
|
||||||
|
ent_last_origin
|
||||||
|
ent_last_class
|
||||||
|
```
|
||||||
|
|
||||||
|
### ent_list
|
||||||
|
Print short information about antities, filtered by pattern
|
||||||
|
|
||||||
|
`ent_list <pattern>`
|
||||||
|
|
||||||
|
## Syntax description
|
||||||
|
|
||||||
|
### \<identificator\>
|
||||||
|
|
||||||
|
* !cross: entity under aim
|
||||||
|
* Instance code: !\<number\>_\<seria\l>
|
||||||
|
* set by ent_getvars command
|
||||||
|
* Entity index
|
||||||
|
* targetname pattern
|
||||||
|
|
||||||
|
### \<pattern\>
|
||||||
|
|
||||||
|
Pattern is like identificator, but may filter many entities by classname
|
||||||
|
|
||||||
|
### (vector)
|
||||||
|
|
||||||
|
used by ent_fire command. vector means three float values, entered without quotes
|
||||||
|
|
||||||
|
### key/value
|
||||||
|
|
||||||
|
All entities parameters may be set by specifiing key and value strings.
|
||||||
|
|
||||||
|
Originally, this mechanizm is used in map/bsp format, but it can be used in enttools too.
|
||||||
|
|
||||||
|
Keys and values are passed to server library and processed by entity keyvalue function, setting edict and entity owns parameters.
|
||||||
|
|
||||||
|
If value contains spaces, it must be put in quotes:
|
||||||
|
|
||||||
|
`ent_fire !cross set origin "0 0 0"`
|
||||||
|
|
||||||
|
## Using with scripting
|
||||||
|
|
||||||
|
ent_create and ent_getvars commands are setting cvars on client
|
||||||
|
|
||||||
|
It can be used with ent_last_cb alias that is executed after setting cvars.
|
||||||
|
|
||||||
|
Simple example:
|
||||||
|
|
||||||
|
```
|
||||||
|
ent_create weapon_c4
|
||||||
|
alias ent_last_cb "ent_fire \$ent_last_inst use"
|
||||||
|
```
|
||||||
|
|
||||||
|
Use weapon_c4 after creating it.
|
||||||
|
|
||||||
|
Note that you cannot use many dfferent callbacks at the same time.
|
||||||
|
|
||||||
|
You can set entity name by by pattern and create special script, contatning all callbacks.
|
||||||
|
|
||||||
|
Example:
|
||||||
|
|
||||||
|
example.cfg
|
||||||
|
```
|
||||||
|
alias ent_last_cb exec entity_cb.cfg
|
||||||
|
ent create \<class\> targetname my_ent1_$name
|
||||||
|
ent_create \<class\> targetname my_ent2_$name
|
||||||
|
```
|
||||||
|
entity_cb.cfg
|
||||||
|
```
|
||||||
|
if $ent_last_name == my_ent1_$name
|
||||||
|
:(ent1 actions)
|
||||||
|
if $ent_last_name == my_ent2_$name
|
||||||
|
:(ent2 actions)
|
||||||
|
```
|
||||||
|
Note that scripting cannot be blocking. You cannot wait for server answer and continue. But you can use small scripts, connected with ent_last_cb command. The best usage is user interaction. You can add touch buttons to screen or call user command menu actions by callbacks.
|
||||||
|
## Server side
|
||||||
|
|
||||||
|
To enable entity tools on server, set sv_enttools_enable to 1
|
||||||
|
|
||||||
|
To change maximum number of entities, touched by ent_fire, change sv_enttools_maxfire to required number.
|
||||||
|
|
||||||
|
To enable actions on players, set sv_enttools_players to 1.
|
||||||
|
|
||||||
|
To enable entity tools for player by nickname, set sv_enttools_godplayer to nickname. Useful to temporary enable from rcon.
|
||||||
|
|
||||||
|
To prevent crash on some actions, set host_mapdesign_fatal to 0
|
||||||
8
Documentation/extensions/expanded-common-structures.md
Normal file
8
Documentation/extensions/expanded-common-structures.md
Normal file
@@ -0,0 +1,8 @@
|
|||||||
|
# Expanded structures that used by engine and mods
|
||||||
|
To make porting and developing mods on 64-bit platforms less painful, we decided to expand size of several structures.
|
||||||
|
This information important in case you are using codebase like XashXT, Paranoia 2: Savior and want to compile your mod for platform with 64-bit pointer size: you should replace old definitions with new ones, otherwise your mod will not work with Xash3D FWGS (typically, it's just crashing when starting map).
|
||||||
|
| Structure name | Locates in file | Original size on 64-bit | Current size on 64-bit |
|
||||||
|
|----------------|-----------------|-------------------------|------------------------|
|
||||||
|
|`mfaceinfo_t` | `common/com_model.h` | 176 bytes | 304 bytes |
|
||||||
|
|`decal_s` | `common/com_model.h` | 72 bytes | 88 bytes |
|
||||||
|
|`mextrasurf_t` | `common/com_model.h` | 376 bytes | 504 bytes |
|
||||||
@@ -31,11 +31,14 @@ Issue #0. Inconsistency between ABI and Q_buildarch.\
|
|||||||
Resolution: Change Q_buildarch return value to use Debian-styled architectures list: https://www.debian.org/ports/, which includes a special naming for big/little-endian and hard/soft-float ARM.
|
Resolution: Change Q_buildarch return value to use Debian-styled architectures list: https://www.debian.org/ports/, which includes a special naming for big/little-endian and hard/soft-float ARM.
|
||||||
|
|
||||||
Issue #1: Build-system integration.\
|
Issue #1: Build-system integration.\
|
||||||
Resolution: implemented as [LibraryNaming.cmake](https://github.com/FWGS/hlsdk-xash3d/blob/master/cmake/LibraryNaming.cmake) and [library_naming.py](https://github.com/FWGS/hlsdk-xash3d/blob/master/scripts/waifulib/library_naming.py) extensions, see
|
Resolution: implemented as [LibraryNaming.cmake](https://github.com/FWGS/hlsdk-portable/blob/master/cmake/LibraryNaming.cmake) and [library_naming.py](https://github.com/FWGS/hlsdk-portable/blob/master/scripts/waifulib/library_naming.py) extensions, see
|
||||||
|
|
||||||
Issue #2(related to #0): Which ARM flavours we actually need to handle?\
|
Issue #2(related to #0): Which ARM flavours we actually need to handle?\
|
||||||
Resolution: Little-endian only, as there is no known big-endian ARM platforms in the wild.
|
Resolution: Little-endian only, as there is no known big-endian ARM platforms in the wild.
|
||||||
Architecture is coded this way:
|
Architecture is coded this way:
|
||||||
* ```armvxy```, where `x` is ARM instruction set level and `y` is hard-float ABI presence: `hf` where hard float ABI used, otherwise `l`.
|
* ```armvxy```, where `x` is ARM instruction set level and `y` is hard-float ABI presence: `hf` where hard float ABI used, otherwise `l`.
|
||||||
|
|
||||||
|
Issue #3: Some mods (like The Specialists, Tyrian, ...) already apply suffixes _i386, _i686 to the gamedll path:\
|
||||||
|
Resolution: On x86 on **Win/Lin/Mac**, don't change anything. Otherwise, strip the _i?86 part and follow the usual scheme.
|
||||||
|
|
||||||
See discussion: https://github.com/FWGS/xash3d-fwgs/issues/39
|
See discussion: https://github.com/FWGS/xash3d-fwgs/issues/39
|
||||||
|
|||||||
22
Documentation/extensions/mp3-loops.md
Normal file
22
Documentation/extensions/mp3-loops.md
Normal file
@@ -0,0 +1,22 @@
|
|||||||
|
## Looping MP3 extension
|
||||||
|
|
||||||
|
It is now possible to loop MP3 file in Xash3D FWGS by adding a custom text tag with `LOOP_START` or `LOOPSTART` in description and time point (in raw samples) in value.
|
||||||
|
|
||||||
|
### Example with foobar2000
|
||||||
|
1. Open Foobar2000
|
||||||
|
2. Add your .mp3 file to playlist
|
||||||
|
3. Right click to newly added file and select Properties
|
||||||
|
4. In Metadata tab, at the bottom of the table, select "+add new"
|
||||||
|
5. In newly added line replace `<60>input field name<6D>` with `LOOP_START` (without any symbols).
|
||||||
|
6. Press Tab and enter loop time point in raw samples. For example, `0` will replay sound file from beginning to end indefinitely.
|
||||||
|
|
||||||
|
### Possible alternatives
|
||||||
|
1. Classic WAV files looping. HQ WAV files can take too much disk space, and recommended software supporting cue points is paid, outdated and can't run on modern systems. (Although there is alternative that's proven to work with idTech-based engines called LoopAuditioneer.)
|
||||||
|
2. Vorbis looping through comment. Engine doesn't support Vorbis but this extension was highly inspired by this hack.
|
||||||
|
|
||||||
|
### Known bugs and limitations
|
||||||
|
1. At this time using MP3 as SFX requires complete decoding. This can cause noticeable stutters, so keep MP3 file length in mind.
|
||||||
|
2. We deliberately only support modern ID3v2.3 and ID3v2.4 tags. Using ID3v1 is not possible.
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@@ -1,7 +1,40 @@
|
|||||||
# Server porting
|
# Self-made port
|
||||||
|
## Compatibility with RISC architectures
|
||||||
|
### Unaligned access
|
||||||
|
Unaligned access on **i386** causes only performance penalty, but on **RISC** it can cause unstable work.
|
||||||
|
|
||||||
|
For HLSDK at least you need such patches in util.cpp:
|
||||||
|
- https://github.com/FWGS/halflife/commit/7bfefe86e35d67867ae7af830ac1fc38f2908360
|
||||||
|
- https://github.com/FWGS/hlsdk-portable/commit/617d75545f2ecb9b2d46cc30728dc37c9eb6d35e
|
||||||
|
|
||||||
|
### Signed chars
|
||||||
|
`char` type defined as **signed** for **x86** and as **unsigned** for **arm**.
|
||||||
|
|
||||||
|
And sometimes such difference can break logic.
|
||||||
|
|
||||||
|
As a solution you can use `signed char` type in code directly or use `-fsigned-char` option for gcc/clang compilers.
|
||||||
|
|
||||||
|
For HLSDK at least you need such [fix](https://github.com/FWGS/hlsdk-portable/commit/1ca34fcb4381682bd517612b530db22a1354a795) in nodes.cpp/.h.
|
||||||
|
|
||||||
|
## Compatibility with 64bit architectures
|
||||||
|
You need list of patches for Studio Model Render, MAKE_STRING macro and nodes:
|
||||||
|
- https://github.com/FWGS/hlsdk-portable/commit/d287ed446332e615ab5fb25ca81b99fa14d18a73
|
||||||
|
- https://github.com/FWGS/hlsdk-portable/commit/3bce17e3a04f8af10a927a07ceb8ab0f09152ec4
|
||||||
|
- https://github.com/FWGS/hlsdk-portable/commit/9ebfc981773ec4c7a89ffe52d9c249e1fbef9634
|
||||||
|
- https://github.com/FWGS/hlsdk-portable/commit/00833188dab87ef5746286479ba5aeb9d83b4a0c
|
||||||
|
- https://github.com/FWGS/hlsdk-portable/commit/4661b5c1a5245b27a5532745c11e44b5540e4172
|
||||||
|
- https://github.com/FWGS/hlsdk-portable/commit/2b61380146b1d58a8c465f0e312c061b12bda115
|
||||||
|
- https://github.com/FWGS/hlsdk-portable/commit/8ef6cb2427ee16a763103bd3f315f38e2f01cfe2
|
||||||
|
|
||||||
|
## Mobility API
|
||||||
|
Xash3D FWGS has special extended interface in `mobility_int.h` which adds some new features like vibration on mobile platforms.
|
||||||
|
|
||||||
|
## Porting server-side code
|
||||||
Original valve's server code was compatible with linux and gcc 2.x.
|
Original valve's server code was compatible with linux and gcc 2.x.
|
||||||
|
|
||||||
Newer gcc versions have restriction which breaks build.
|
Newer gcc versions have restriction which breaks build.
|
||||||
Now, to make it building with gcc 4.x, you need do following:
|
|
||||||
|
Now, to make it building with gcc 4.x+ or clang, you need to do following:
|
||||||
* Go to cbase.h and redefine macros as following
|
* Go to cbase.h and redefine macros as following
|
||||||
```
|
```
|
||||||
#define SetThink( a ) m_pfnThink = static_cast <void (CBaseEntity::*)(void)> (&a)
|
#define SetThink( a ) m_pfnThink = static_cast <void (CBaseEntity::*)(void)> (&a)
|
||||||
@@ -18,58 +51,60 @@ Now, to make it building with gcc 4.x, you need do following:
|
|||||||
* Replace all SetThink(NULL), SetTouch(NULL), setUse(NULL) and SetBlocked(NULL) by ResetThink(), ResetTouch(), ResetUse() and ResetBlocked()
|
* Replace all SetThink(NULL), SetTouch(NULL), setUse(NULL) and SetBlocked(NULL) by ResetThink(), ResetTouch(), ResetUse() and ResetBlocked()
|
||||||
* Sometimes you may need to add #include <ctype.h> if functions tolower or isspace are missing
|
* Sometimes you may need to add #include <ctype.h> if functions tolower or isspace are missing
|
||||||
|
|
||||||
# Client porting
|
## Porting client-side code
|
||||||
|
|
||||||
## VGUI library
|
|
||||||
|
|
||||||
Valve's client uses vgui library which is available only on x86 systems and has big amount of mistakes in headers. The best and simplest way of porting is removing VGUI dependency at all.
|
|
||||||
Most singleplayer mods don't really use VGUI at all. It is used in multiplayer only to show score table and MOTD window
|
|
||||||
|
|
||||||
## Porting
|
|
||||||
|
|
||||||
### First strategy: full port
|
|
||||||
|
|
||||||
#### Basic port (Stage 1)
|
|
||||||
* First, remove all files and headers which use vgui (contains "vgui" in file name).
|
|
||||||
* After that, try to build it and remove vgui includes.
|
|
||||||
* Remove all gViewPort usings.
|
|
||||||
* Remove all CVoiceManager usings (xash3d does not support voice)
|
|
||||||
* Redefine all DLLEXPORT defines as empty field (Place it under _WIN32 macro if you want to keep windows compatibility).
|
* Redefine all DLLEXPORT defines as empty field (Place it under _WIN32 macro if you want to keep windows compatibility).
|
||||||
* Remove hud_servers.cpp and Servers_Init/Servers_Shutdown from hud.cpp
|
* Remove hud_servers.cpp and Servers_Init/Servers_Shutdown from hud.cpp.
|
||||||
* Fix CAPS filenames in includes (like STDIO.H, replace by stdio.h).
|
* Fix CAPS filenames in includes (like STDIO.H, replace by stdio.h).
|
||||||
* Replace broken macros as DECLARE_MESSAGE, DECLARE_COMMAND by fixed examples from our hlsdk-xash3d port (cl_util.h)
|
* Replace broken macros as DECLARE_MESSAGE, DECLARE_COMMAND by fixed examples from our hlsdk-portable port (cl_util.h).
|
||||||
* Add ctype.h where it is need (tolower, isspace functions)
|
* Add ctype.h where is needed (tolower, isspace functions).
|
||||||
* Add string.h where it is need (memcpy, strcpy, etc)
|
* Add string.h where is needed (memcpy, strcpy, etc).
|
||||||
* Use in_defs.h from hlsdk_client
|
* Use in_defs.h from hlsdk-portable.
|
||||||
* Add scoreboard_stub.cpp and input_stub.cpp from hlsdk-xash3d to fix linking.
|
* Add input_xash3d.cpp from hlsdk-portable project to fix input.
|
||||||
Now your client should be able to build and work correctly. Add input_xash3d.cpp from hlsdk-xash3d project to fix input.
|
|
||||||
|
|
||||||
#### Multiplayer fix (Stage 2)
|
Now your client should be able to build and work correctly.
|
||||||
Look at hlsdk-xash3d project.
|
|
||||||
|
|
||||||
Main changes are:
|
# Porting mod to hlsdk-portable
|
||||||
* Add MOTD.cpp, scoreboard.cpp and input_xash3d.cpp
|
Look at changes which was made.
|
||||||
* Add missing functions to hud_redraw.cpp, hud.cpp and tri.cpp, fix class defination in hud.h
|
|
||||||
* Remove duplicate functions from hud.cpp and HOOK_MESSAGE's for it
|
|
||||||
* Remove +showscores/-showscores hooks from input.h
|
|
||||||
* Fix cl_util.h
|
|
||||||
|
|
||||||
### Second way: move mod to hlsdk-xash3d
|
If there are not too much changes (for example, only some weapons was added), add these changes in hlsdk-portable.
|
||||||
Look at changes you made in client.
|
|
||||||
|
|
||||||
If there are not much changes (for example, only some weapons was add), add these changes in hlsdk-xash3d.
|
You can use diff with original HLSDK and apply it as patch to hlsdk-portable.
|
||||||
|
|
||||||
You may use diff with original HLSDK you used and apply it as patch to hlsdk-xash3d.
|
|
||||||
|
|
||||||
|
```
|
||||||
|
NOTE: Many an old mods was made on HLSDK 2.0-2.1 and some rare mods on HLSDK 1.0.
|
||||||
|
So you need to have different versions of HLSDK to make diffs.
|
||||||
|
Plus different Spirit of Half-Life versions if mod was made on it.
|
||||||
|
Also, weapons in old HLSDK versions does not use client weapon prediction system and you may be need to port standart half-life weapons to server side.
|
||||||
|
```
|
||||||
Files must have same line endings (use dos2unix on all files).
|
Files must have same line endings (use dos2unix on all files).
|
||||||
|
|
||||||
I recommend to enable ignoring space changes in diff.
|
We recommend to enable ignoring space changes in diff.
|
||||||
### Writing Makefiles
|
|
||||||
|
|
||||||
Use Makefile from hlsdk-xash3d as Makefile example.
|
Move all new files to separate directories.
|
||||||
|
|
||||||
Get .c and .cpp file lists from Visual Studio project and fill SRCS and SRCS_C variables to Makefile.
|
# Possible replacements for non-portable external dependencies
|
||||||
|
1. If mod uses **fmod.dll** or **base.dll** to play mp3/ogg on client-side or to precache sounds on server-side, you can replace it with:
|
||||||
|
- [pfnPrimeMusicStream](https://github.com/FWGS/hlsdk-portable/blob/master/engine/cdll_int.h#L293=) engine callback;
|
||||||
|
- [miniaudio](https://github.com/mackron/miniaudio);
|
||||||
|
- [phonon](https://community.kde.org/Phonon).
|
||||||
|
|
||||||
Remove all files containing vgui in name from list, add missing include dirs.
|
2. If mod uses **OpenGL**, porting code to Xash3D render interface is recommended.
|
||||||
|
|
||||||
|
3. If mod uses **cg.dll**, you can try to port code to [NVFX](https://github.com/tlorach/nvFX).
|
||||||
|
|
||||||
|
4. If mod uses detours, comment code or try to find replacement somehow by yourself.
|
||||||
|
|
||||||
|
# Additional recommendations
|
||||||
|
1. If mod uses STL, you can replace it with [MiniUTL](https://github.com/FWGS/MiniUTL).
|
||||||
|
2. Avoid to use dynamic casts to make small size binaries.
|
||||||
|
3. Avoid to use exceptions to make small size binaries.
|
||||||
|
|
||||||
|
# Writing build scripts
|
||||||
|
|
||||||
|
Use wscript/CMakeLists.txt files from hlsdk-portable as build scripts example.
|
||||||
|
|
||||||
|
Get .c and .cpp file lists from Visual Studio project.
|
||||||
|
|
||||||
|
Add missing include dirs.
|
||||||
|
|
||||||
Do same for Android.mk if you are building for android.
|
|
||||||
|
|||||||
11
Documentation/not-supported-mod-list-and-reasons-why.md
Normal file
11
Documentation/not-supported-mod-list-and-reasons-why.md
Normal file
@@ -0,0 +1,11 @@
|
|||||||
|
# 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 custom GoldSrc engine |
|
||||||
|
|
||||||
353
Documentation/opensource-mods.md
Normal file
353
Documentation/opensource-mods.md
Normal file
@@ -0,0 +1,353 @@
|
|||||||
|
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 (dead link!)
|
||||||
|
|
||||||
|
Mirrored on github - https://github.com/HLSources/BubbleMod
|
||||||
|
|
||||||
|
## 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/nekonomicon/gw1.45src
|
||||||
|
|
||||||
|
## Go-mod
|
||||||
|
Versions 2.0 and 3.0, available in mod archives on ModDB - https://www.moddb.com/mods/go-mod/downloads
|
||||||
|
|
||||||
|
Version 3.0, mirrored on github - https://github.com/nekonomicon/Go-mod30
|
||||||
|
|
||||||
|
## 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-portable - https://github.com/FWGS/hlsdk-portable/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
|
||||||
|
Mirrored on github - https://github.com/nekonomicon/HeartOfEvil
|
||||||
|
|
||||||
|
## 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
|
||||||
|
|
||||||
|
## Oz Deathmatch
|
||||||
|
Mirrored on github - https://github.com/nekonomicon/OZDM
|
||||||
|
|
||||||
|
## 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-portable - https://github.com/FWGS/hlsdk-portable/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-portable - https://github.com/FWGS/hlsdk-portable/tree/aom
|
||||||
|
|
||||||
|
## Afraid of Monsters: Director's cut
|
||||||
|
Reverse-engineered code, branch **aomdc** in hlsdk-portable - https://github.com/FWGS/hlsdk-portable/tree/aomdc
|
||||||
|
|
||||||
|
## Azure Sheep
|
||||||
|
malortie's recreation - https://github.com/malortie/hl-asheep
|
||||||
|
|
||||||
|
Reverse-engineered code, branch **asheep** in hlsdk-portable - https://github.com/FWGS/hlsdk-portable/tree/asheep
|
||||||
|
|
||||||
|
## Big Lolly
|
||||||
|
malortie's recreation - https://github.com/malortie/hl-biglolly
|
||||||
|
|
||||||
|
Branch **biglolly** in hlsdk-portable - https://github.com/FWGS/hlsdk-portable/tree/biglolly
|
||||||
|
|
||||||
|
## Black Ops
|
||||||
|
malortie's recreation - https://github.com/malortie/hl-blackops
|
||||||
|
|
||||||
|
Branch **blackops** in hlsdk-portable - https://github.com/FWGS/hlsdk-portable/tree/blackops
|
||||||
|
|
||||||
|
## Bloody Pizza: Vendetta
|
||||||
|
Branch **caseclosed** in hlsdk-portable - https://github.com/FWGS/hlsdk-portable/tree/caseclosed
|
||||||
|
|
||||||
|
## Case Closed
|
||||||
|
Branch **caseclosed** in hlsdk-portable - https://github.com/FWGS/hlsdk-portable/tree/caseclosed
|
||||||
|
|
||||||
|
## Cleaner's Adventures
|
||||||
|
Branch **CAd** in hlsdk-portable - https://github.com/FWGS/hlsdk-portable/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-portable - https://github.com/FWGS/hlsdk-portable/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-portable - https://github.com/FWGS/hlsdk-portable/tree/bshift
|
||||||
|
|
||||||
|
## Half-Life: Induction
|
||||||
|
Branch **induction** in hlsdk-portable - https://github.com/FWGS/hlsdk-portable/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-portable - https://github.com/FWGS/hlsdk-portable/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-portable - https://github.com/FWGS/hlsdk-portable/tree/rebellion
|
||||||
|
|
||||||
|
## Half-Life: Urbicide
|
||||||
|
Branch **hl_urbicide** in hlsdk-portable - https://github.com/FWGS/hlsdk-portable/tree/hl_urbicide
|
||||||
|
|
||||||
|
## Half-Life: Visitors
|
||||||
|
malortie's recreation - https://github.com/malortie/hl-visitors
|
||||||
|
|
||||||
|
Reverse-engineered code, branch **visitors** in hlsdk-portable - https://github.com/FWGS/hlsdk-portable/tree/visitors
|
||||||
|
|
||||||
|
## Half-Secret
|
||||||
|
Branch **half-secret** in hlsdk-portable - https://github.com/FWGS/hlsdk-portable/tree/half-secret
|
||||||
|
|
||||||
|
## Night at the Office
|
||||||
|
malortie's recreation - https://github.com/malortie/hl-nato
|
||||||
|
|
||||||
|
Branch **noffice** in hlsdk-portable - https://github.com/FWGS/hlsdk-portable/tree/noffice
|
||||||
|
|
||||||
|
## Poke 646
|
||||||
|
malortie's recreation - https://github.com/malortie/hl-poke646
|
||||||
|
|
||||||
|
Reverse-engineered code, branch **poke646** in hlsdk-portable - https://github.com/FWGS/hlsdk-portable/tree/poke646
|
||||||
|
|
||||||
|
## Poke 646: Vendetta
|
||||||
|
malortie's recreation - https://github.com/malortie/hl-poke646-vendetta
|
||||||
|
|
||||||
|
Reverse-engineered code, branch **poke646_vendetta** in hlsdk-portable - https://github.com/FWGS/hlsdk-portable/tree/poke646_vendetta
|
||||||
|
|
||||||
|
## Residual Life
|
||||||
|
Reverse-engineered code, branch **residual_point** in hlsdk-portable - https://github.com/FWGS/hlsdk-portable/tree/residual_point
|
||||||
|
|
||||||
|
## Residual Point
|
||||||
|
Reverse-engineered code, branch **residual_point** in hlsdk-portable - https://github.com/FWGS/hlsdk-portable/tree/residual_point
|
||||||
|
|
||||||
|
## Sewer Beta
|
||||||
|
Branch **sewer_beta** in hlsdk-portable - https://github.com/FWGS/hlsdk-portable/tree/sewer_beta
|
||||||
|
|
||||||
|
## 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-portable - https://github.com/FWGS/hlsdk-portable/tree/thegate
|
||||||
|
|
||||||
|
## They Hunger
|
||||||
|
malortie's recreation - https://github.com/malortie/hl-theyhunger
|
||||||
|
|
||||||
|
Reverse-engineered code, branch **theyhunger** in hlsdk-portable - https://github.com/FWGS/hlsdk-portable/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-portable - https://github.com/FWGS/hlsdk-portable/tree/tot
|
||||||
|
|
||||||
|
# Derived work
|
||||||
|
## Adrenaline Gamer
|
||||||
|
Branch **aghl** in hlsdk-portable - https://github.com/FWGS/hlsdk-portable/tree/aghl
|
||||||
|
|
||||||
|
## Bubblemod
|
||||||
|
Branch **bubblemod** in hlsdk-portable - https://github.com/FWGS/hlsdk-portable/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-portable - https://github.com/FWGS/hlsdk-portable/tree/dmc
|
||||||
|
|
||||||
|
## Half-Life: Echoes
|
||||||
|
Branch **echoes** in hlsdk-portable - https://github.com/FWGS/hlsdk-portable/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
|
||||||
|
|
||||||
|
Branch **invasion** in hlsdk-portable - https://github.com/FWGS/hlsdk-portable/tree/invasion
|
||||||
|
|
||||||
|
## Half-Life: Top-Down
|
||||||
|
Branch **hltopdown** in hlsdk-portable - https://github.com/FWGS/hlsdk-portable/tree/hltopdown
|
||||||
|
|
||||||
|
## Half-Screwed
|
||||||
|
Branch **half-screwed** in hlsdk-portable - https://github.com/FWGS/hlsdk-portable/tree/half-screwed
|
||||||
|
|
||||||
|
## Natural Selection
|
||||||
|
Port to Linux - https://github.com/fmoraw/NS
|
||||||
|
|
||||||
|
## Spirit of Half-Life
|
||||||
|
Version 1.2, branch **sohl1.2** in hlsdk-portable - https://github.com/FWGS/hlsdk-portable/tree/sohl1.2
|
||||||
|
|
||||||
|
## Swiss Cheese Halloween 2002
|
||||||
|
Just more playable version by malortie - https://github.com/malortie/hl-shall
|
||||||
|
|
||||||
|
Branch **halloween** in hlsdk-portable - https://github.com/FWGS/hlsdk-portable/tree/halloween
|
||||||
|
|
||||||
|
## Threewave CTF
|
||||||
|
Branch **dmc** in hlsdk-portable - https://github.com/FWGS/hlsdk-portable/tree/dmc
|
||||||
|
|
||||||
|
## Zombie-X
|
||||||
|
Branch **zombie-x** in hlsdk-portable - https://github.com/FWGS/hlsdk-portable/tree/zombie-x
|
||||||
|
|
||||||
@@ -15,22 +15,25 @@ Status:
|
|||||||
|
|
||||||
Table is sorted by status.
|
Table is sorted by status.
|
||||||
|
|
||||||
| Platform | Status | Maintainer | Note
|
| Platform | Status | Maintainer | Note
|
||||||
| -------- | ------ | ---------- | ----
|
| -------- | ------ | ---------- | ----
|
||||||
| Windows | Supported | @a1batross |
|
| Windows | Supported | @a1batross, @SNMetamorph |
|
||||||
| Linux(x86) | Supported | @a1batross, @mittorn |
|
| *BSD | Supported | @nekonomicon |
|
||||||
| Linux(amd64) | Supported | @mittorn |
|
| GNU/Linux(x86, amd64, arm) | Supported | @a1batross, @mittorn |
|
||||||
| *BSD | Supported | @nekonomicon |
|
| Android | Supported | @a1batross, @mittorn |
|
||||||
| Linux(arm) | Supported | @a1batross, @mittorn |
|
| MotoMAGX | Supported | @a1batross |
|
||||||
| Android | Supported | @a1batross, @mittorn |
|
| GNU/Linux(elbrus) | Supported | @a1batross, @mittorn | Rare and eventual access to e2k machine
|
||||||
| MotoMAGX | Supported | @a1batross |
|
| Haiku | Supported | not maintained | Was added by #478 and #483
|
||||||
| Linux(elbrus) | In progress | @a1batross, @mittorn | Rare and eventual access to e2k machine
|
| DOS4GW | Supported | @mittorn |
|
||||||
| Android/Linux(aarch64) | In progress | @a1batross |
|
| GNU/Linux(mipsel) | Supported | @mittorn |
|
||||||
| Linux(mipsel) | In progress | @mittorn |
|
| PSVita | Supported | @fgsfdsfgs |
|
||||||
| Haiku | Incomplete, Old Engine | not maintained |
|
| Switch | Supported | @fgsfdsfgs |
|
||||||
| Emscripten | Incomplete, Old Engine | not maintained |
|
| Wii | In progress | Collaborative effort | [GitHub Repository](https://github.com/saucesaft/xash3d-wii)
|
||||||
| PSVita | Not merged, Old Engine | not maintained | [GitHub Repository](https://github.com/fgsfdsfgs/vitaXash3D)
|
| PSP | In progress | @Crow_bar, @Velaron | [GitHub Repository](https://github.com/Crow-bar/xash3d-fwgs)
|
||||||
| Switch | Not merged, Old Engine | not maintained | [GitHub Repository](https://github.com/switchports/xash3d-switch)
|
| Emscripten | Old Engine | not maintained |
|
||||||
| 3DS | Not merged, Old Engine | not maintained | [GitHub Repository](https://github.com/masterfeizz/Xash3DS)
|
| Oculus Quest | Old Engine fork | @DrBeef | [GitHub Repository](https://github.com/DrBeef/Lambda1VR)
|
||||||
| macOS | Deprecated | not maintained | See GitHub issue #61
|
| PSVita | Old Engine fork | not maintained | [GitHub Repository](https://github.com/fgsfdsfgs/vitaXash3D)
|
||||||
| iOS | Deprecated | not maintained | See GitHub issue #61
|
| 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
|
||||||
|
|||||||
49
Documentation/psvita.md
Normal file
49
Documentation/psvita.md
Normal file
@@ -0,0 +1,49 @@
|
|||||||
|
## PlayStation Vita port
|
||||||
|
|
||||||
|
### Prerequisites
|
||||||
|
1. Make sure your PSVita is [set up to run homebrew applications](https://vita.hacks.guide/).
|
||||||
|
2. Install [kubridge](https://github.com/TheOfficialFloW/kubridge/releases/) by copying `kubridge.suprx` to your taiHEN plugins folder (usually `ux0:/tai`) and add it to your `config.txt`, for example:
|
||||||
|
```
|
||||||
|
*KERNEL
|
||||||
|
ux0:tai/kubridge.skprx
|
||||||
|
```
|
||||||
|
3. Install `libshacccg.suprx` by following [this guide](https://cimmerian.gitbook.io/vita-troubleshooting-guide/shader-compiler/extract-libshacccg.suprx).
|
||||||
|
|
||||||
|
### Installation
|
||||||
|
1. If you have an old vitaXash3D install, remove it.
|
||||||
|
2. Get `xash3d-fwgs-psvita.7z` from the latest [automatic build](https://github.com/FWGS/xash3d-fwgs/releases/tag/continuous).
|
||||||
|
3. Install `xash.vpk` from the 7z archive onto your PSVita.
|
||||||
|
4. Copy the `data` directory from the 7z archive to the root of your PSVita's SD card.
|
||||||
|
5. Copy the valve folder and any other mod folders from your Half-Life install to `ux0:/data/xash3d/` (you can use other mountpoints instead of `ux0`). **Do not overwrite anything.**
|
||||||
|
|
||||||
|
### Build instructions
|
||||||
|
1. Install [VitaSDK](https://vitasdk.org/).
|
||||||
|
2. Build and install [vitaGL](https://github.com/Rinnegatamante/vitaGL):
|
||||||
|
```
|
||||||
|
git clone https://github.com/Rinnegatamante/vitaGL.git
|
||||||
|
make -C vitaGL NO_TEX_COMBINER=1 HAVE_UNFLIPPED_FBOS=1 HAVE_PTHREAD=1 SINGLE_THREADED_GC=1 MATH_SPEEDHACK=1 DRAW_SPEEDHACK=1 HAVE_CUSTOM_HEAP=1 -j2 install
|
||||||
|
```
|
||||||
|
3. Build and install [vita-rtld](https://github.com/fgsfdsfgs/vita-rtld):
|
||||||
|
```
|
||||||
|
git clone https://github.com/fgsfdsfgs/vita-rtld.git && cd vita-rtld
|
||||||
|
mkdir build && cd build
|
||||||
|
cmake -DCMAKE_BUILD_TYPE=Release ..
|
||||||
|
make -j2 install
|
||||||
|
```
|
||||||
|
4. Build and install [this SDL2 fork](https://github.com/Northfear/SDL) with vitaGL integration:
|
||||||
|
```
|
||||||
|
git clone https://github.com/Northfear/SDL.git && cd SDL
|
||||||
|
mkdir build && cd build
|
||||||
|
cmake -DCMAKE_TOOLCHAIN_FILE=${VITASDK}/share/vita.toolchain.cmake -DCMAKE_BUILD_TYPE=Release -DVIDEO_VITA_VGL=ON ..
|
||||||
|
make -j2 install
|
||||||
|
```
|
||||||
|
5. Use `waf`:
|
||||||
|
```
|
||||||
|
./waf configure -T release --psvita
|
||||||
|
./waf build
|
||||||
|
```
|
||||||
|
6. Copy all the resulting `.so` files into a single folder:
|
||||||
|
```
|
||||||
|
./waf install --destdir=xash3d
|
||||||
|
```
|
||||||
|
7. `xash.vpk` is located in `build/engine/`.
|
||||||
@@ -46,7 +46,7 @@ For mappacks - place *.bsp files to **valve/maps** folder, *.wad files to **valv
|
|||||||
16. [Betrayal](http://www.moddb.com/mods/betrayal) (this mod has inner bugs; set **gl_allow_mirrors** to **0** to prevent drops of game's perfomance in some areas)
|
16. [Betrayal](http://www.moddb.com/mods/betrayal) (this mod has inner bugs; set **gl_allow_mirrors** to **0** to prevent drops of game's perfomance in some areas)
|
||||||
17. [Between Two Worlds](https://www.runthinkshootlive.com/posts/between-two-worlds/)
|
17. [Between Two Worlds](https://www.runthinkshootlive.com/posts/between-two-worlds/)
|
||||||
18. [Black Mesa Energy Testing Chamber](http://twhl.info/competitions.php?results=17)
|
18. [Black Mesa Energy Testing Chamber](http://twhl.info/competitions.php?results=17)
|
||||||
19. [Black Mesa Sideline](http://www.isolated-design.de/half-life-mods/black-mesa-sideline/) (set **gl_allow_mirrors** to **0** to prevent drops of game's perfomance in some areas)
|
19. [Black Mesa Sideline](https://www.moddb.com/mods/black-mesa-sideline) (set **gl_allow_mirrors** to **0** to prevent drops of game's perfomance in some areas)
|
||||||
20. [BlackMesa 2007( Black Mesa Missions 2007 )](http://www.moddb.com/addons/blackmesa-2007)
|
20. [BlackMesa 2007( Black Mesa Missions 2007 )](http://www.moddb.com/addons/blackmesa-2007)
|
||||||
21. [Blood and Bones](https://www.runthinkshootlive.com/posts/blood-and-bones/)
|
21. [Blood and Bones](https://www.runthinkshootlive.com/posts/blood-and-bones/)
|
||||||
22. Boom (Huknenn) v1.0 & [HL Boom: Gold Edition v1.1](http://www.moddb.com/mods/boom)
|
22. Boom (Huknenn) v1.0 & [HL Boom: Gold Edition v1.1](http://www.moddb.com/mods/boom)
|
||||||
@@ -103,8 +103,8 @@ For mappacks - place *.bsp files to **valve/maps** folder, *.wad files to **valv
|
|||||||
72. [Freeman](https://www.runthinkshootlive.com/posts/freeman/)
|
72. [Freeman](https://www.runthinkshootlive.com/posts/freeman/)
|
||||||
73. [Freeman's Escape](http://www.moddb.com/mods/freeman-escape-french) (2 maps by *JiggZ*)
|
73. [Freeman's Escape](http://www.moddb.com/mods/freeman-escape-french) (2 maps by *JiggZ*)
|
||||||
74. [Freeman's Fight](https://www.runthinkshootlive.com/posts/freemans-fight/)
|
74. [Freeman's Fight](https://www.runthinkshootlive.com/posts/freemans-fight/)
|
||||||
75. [Freeman's Return](http://jpmaps.wz.cz/epizody.htm)
|
75. [Freeman's Return](https://www.moddb.com/games/half-life/addons/freemans-return-v12)
|
||||||
76. [Freeman's Return 2](http://jpmaps.wz.cz/epizody.htm)
|
76. [Freeman's Return 2](https://www.moddb.com/games/half-life/addons/freemans-return-2-v11)
|
||||||
77. [Freeman's Revenge](https://www.runthinkshootlive.com/posts/freemans-revenge/)
|
77. [Freeman's Revenge](https://www.runthinkshootlive.com/posts/freemans-revenge/)
|
||||||
78. [Freeman's Tomb( The Crypt )](http://twhl.info/vault.php?map=3787)
|
78. [Freeman's Tomb( The Crypt )](http://twhl.info/vault.php?map=3787)
|
||||||
79. [G-Invasion v2.5](http://www.moddb.com/mods/g-man-invasion) aka G-Man Invasion (there is an inner crash bug on final titles: some text lines are too long and cannot be properly displayed)
|
79. [G-Invasion v2.5](http://www.moddb.com/mods/g-man-invasion) aka G-Man Invasion (there is an inner crash bug on final titles: some text lines are too long and cannot be properly displayed)
|
||||||
@@ -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)
|
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 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)
|
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-Life: Uplink](https://www.fileplanet.com/10360/10000/fileinfo/Half-Life:-UpLink-Demo)
|
||||||
92. [Half-Quake](http://www.moddb.com/mods/halfquake-amen)
|
92. [Half-Quake](http://www.moddb.com/mods/halfquake-amen)
|
||||||
93. [Half-Quake 2: Amen](http://www.moddb.com/mods/halfquake-amen)
|
93. [Half-Quake 2: Amen](http://www.moddb.com/mods/halfquake-amen)
|
||||||
@@ -129,7 +129,7 @@ For mappacks - place *.bsp files to **valve/maps** folder, *.wad files to **valv
|
|||||||
96. [Haunted](https://www.runthinkshootlive.com/posts/haunted/) (set **sv_validate_changelevel** to **0** to avoid a problem with level change between maps **pagan7** and **pagan8**)
|
96. [Haunted](https://www.runthinkshootlive.com/posts/haunted/) (set **sv_validate_changelevel** to **0** to avoid a problem with level change between maps **pagan7** and **pagan8**)
|
||||||
97. [Hazardous Materials: Episode 1 & 2](http://www.moddb.com/mods/half-life-hazardous-materials)
|
97. [Hazardous Materials: Episode 1 & 2](http://www.moddb.com/mods/half-life-hazardous-materials)
|
||||||
98. [Hazardous-Course 2](http://www.moddb.com/mods/hazardous-course-2)
|
98. [Hazardous-Course 2](http://www.moddb.com/mods/hazardous-course-2)
|
||||||
99. [Help Wanted](http://maps.mrsucko.org/work/)
|
99. [Help Wanted](https://www.moddb.com/games/half-life/addons/help-wanted)
|
||||||
100. [Hidden Evil v1.01](https://www.runthinkshootlive.com/posts/hidden-evil/)
|
100. [Hidden Evil v1.01](https://www.runthinkshootlive.com/posts/hidden-evil/)
|
||||||
101. [High Speed](http://www.moddb.com/games/half-life/addons/high-speed-english-version)
|
101. [High Speed](http://www.moddb.com/games/half-life/addons/high-speed-english-version)
|
||||||
102. [hlife_hotdog_compo26](http://twhl.info/vault.php?map=5181)
|
102. [hlife_hotdog_compo26](http://twhl.info/vault.php?map=5181)
|
||||||
@@ -155,7 +155,7 @@ For mappacks - place *.bsp files to **valve/maps** folder, *.wad files to **valv
|
|||||||
122. [Mario Keys](http://www.moddb.com/mods/mario-keys)
|
122. [Mario Keys](http://www.moddb.com/mods/mario-keys)
|
||||||
123. [McBeth](https://www.runthinkshootlive.com/posts/mcbeth/)
|
123. [McBeth](https://www.runthinkshootlive.com/posts/mcbeth/)
|
||||||
124. [Medieval World](http://www.moddb.com/mods/medieval-world)
|
124. [Medieval World](http://www.moddb.com/mods/medieval-world)
|
||||||
125. [Mel Soaring 2: Star Rancor](http://www.etherealhell.com/etherealhell/index.php/my-levels/half-life)
|
125. [Mel Soaring 2: Star Rancor](https://www.moddb.com/addons/mel-soaring-2-star-rancor)
|
||||||
126. [MINIMICUS](http://twhl.info/vault.php?map=163)
|
126. [MINIMICUS](http://twhl.info/vault.php?map=163)
|
||||||
127. [Mission Failed](http://www.moddb.com/mods/mission-failed)
|
127. [Mission Failed](http://www.moddb.com/mods/mission-failed)
|
||||||
128. [Mission MC Poker](http://www.moddb.com/mods/half-life-mission-mc-poker)
|
128. [Mission MC Poker](http://www.moddb.com/mods/half-life-mission-mc-poker)
|
||||||
@@ -176,7 +176,7 @@ For mappacks - place *.bsp files to **valve/maps** folder, *.wad files to **valv
|
|||||||
143. [Operation: Nova](http://www.moddb.com/mods/half-life-operation-nova) (there is an inner bug with an M60 machinegun on a map with Osprey: it can be activated and used if you are staying in front of it, not behind it)
|
143. [Operation: Nova](http://www.moddb.com/mods/half-life-operation-nova) (there is an inner bug with an M60 machinegun on a map with Osprey: it can be activated and used if you are staying in front of it, not behind it)
|
||||||
144. [Optimum Fear](https://www.fileplanet.com/7472/0/fileinfo/Optimum-Fear)
|
144. [Optimum Fear](https://www.fileplanet.com/7472/0/fileinfo/Optimum-Fear)
|
||||||
145. [Outrun](http://www.moddb.com/mods/outrun)
|
145. [Outrun](http://www.moddb.com/mods/outrun)
|
||||||
146. [Outwards (Day One)](http://www.visgi.info/maps/)
|
146. [Outwards (Day One)](https://drive.google.com/file/d/1mjQ8wUazYbwTq9Ocg0Vs0raq4avbTRne/view?usp=sharing)
|
||||||
147. [Overhaul Pack](http://www.moddb.com/mods/half-life-overhaul-pack) (Just HD pack for Half-Life)
|
147. [Overhaul Pack](http://www.moddb.com/mods/half-life-overhaul-pack) (Just HD pack for Half-Life)
|
||||||
148. [P.I.Z.D.E.C.](https://www.runthinkshootlive.com/posts/pizdec/)
|
148. [P.I.Z.D.E.C.](https://www.runthinkshootlive.com/posts/pizdec/)
|
||||||
149. [pagoda](http://www.moddb.com/mods/pagoda1)
|
149. [pagoda](http://www.moddb.com/mods/pagoda1)
|
||||||
@@ -184,7 +184,7 @@ For mappacks - place *.bsp files to **valve/maps** folder, *.wad files to **valv
|
|||||||
151. [Phobos IV](http://www.moddb.com/mods/phobos-iv)
|
151. [Phobos IV](http://www.moddb.com/mods/phobos-iv)
|
||||||
152. [Pimp My Car](https://www.runthinkshootlive.com/posts/pimp-my-car/) (there is an inner issue with incorrect responses of buttons on combination locks)
|
152. [Pimp My Car](https://www.runthinkshootlive.com/posts/pimp-my-car/) (there is an inner issue with incorrect responses of buttons on combination locks)
|
||||||
153. [Point Blank – Stackdeath Complex](https://www.runthinkshootlive.com/posts/half-life-point-blank-stackdeath-complex/)
|
153. [Point Blank – Stackdeath Complex](https://www.runthinkshootlive.com/posts/half-life-point-blank-stackdeath-complex/)
|
||||||
154. [Prisoner Escaped](http://four0four.org/downloads/maps/)
|
154. [Prisoner Escaped](https://www.moddb.com/mods/prisoner-escaped-1-2)
|
||||||
155. [Prisoner of Event](http://wp.vondur.net/?page_id=40)
|
155. [Prisoner of Event](http://wp.vondur.net/?page_id=40)
|
||||||
156. [Prisoner of War](https://www.runthinkshootlive.com/posts/prisoner-of-war/)
|
156. [Prisoner of War](https://www.runthinkshootlive.com/posts/prisoner-of-war/)
|
||||||
157. [Project Quantum Leap](http://www.moddb.com/mods/project-quantum-leap)
|
157. [Project Quantum Leap](http://www.moddb.com/mods/project-quantum-leap)
|
||||||
@@ -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*)
|
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)
|
174. [S.W.A.T.](http://www.moddb.com/mods/swat2)
|
||||||
175. [Sabotage](https://www.runthinkshootlive.com/posts/sabotage-2/)
|
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)
|
177. [Sandscroll](https://gamebanana.com/maps/15988)
|
||||||
178. [Saving Bob](https://www.runthinkshootlive.com/posts/saving-bob/)
|
178. [Saving Bob](https://www.runthinkshootlive.com/posts/saving-bob/)
|
||||||
179. [Secret Base](https://www.runthinkshootlive.com/posts/secret-base/)
|
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)
|
184. [Sky Mesa](http://www.moddb.com/mods/sky-mesa)
|
||||||
185. [Sleephorst v1.5](http://www.moddb.com/mods/sleephorst-v15)
|
185. [Sleephorst v1.5](http://www.moddb.com/mods/sleephorst-v15)
|
||||||
186. [Smart Decoy](http://www.moddb.com/mods/smart-decoy)
|
186. [Smart Decoy](http://www.moddb.com/mods/smart-decoy)
|
||||||
187. [Somewhere in Time](http://twhl.info/vault.php?map=5530) (link dead!)
|
187. [Somewhere in Time](https://www.runthinkshootlive.com/posts/somewhere-in-time/)
|
||||||
188. [Sooper 2](http://www.k-saz.freeserve.co.uk/projects.htm) (link dead!)
|
188. [Sooper2](https://www.runthinkshootlive.com/posts/sooper-2/)
|
||||||
189. [Split-Second](http://twhl.info/vault.php?map=4343)
|
189. [Split-Second](http://twhl.info/vault.php?map=4343)
|
||||||
190. [Subhumanity](https://www.runthinkshootlive.com/posts/sub-humanity/)
|
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)
|
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/)
|
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)
|
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)
|
195. [The Evil Thing](http://www.moddb.com/mods/the-evil-thing)
|
||||||
@@ -282,12 +282,12 @@ For mappacks - place *.bsp files to **valve/maps** folder, *.wad files to **valv
|
|||||||
6. [Catacombs: Part 1](https://www.runthinkshootlive.com/posts/catacombs/)
|
6. [Catacombs: Part 1](https://www.runthinkshootlive.com/posts/catacombs/)
|
||||||
7. [Cro-man's Office Mappack](http://twhl.info/vault.php?map=5547)
|
7. [Cro-man's Office Mappack](http://twhl.info/vault.php?map=5547)
|
||||||
8. [Half-Life Episode Two Demo Alpha v1.0](http://hl.loess.ru/?mod=451)
|
8. [Half-Life Episode Two Demo Alpha v1.0](http://hl.loess.ru/?mod=451)
|
||||||
9. [Hazardous-Course (first version of Hazardous-Course 2)](http://www.richmans-maps.ch.vu/) (link dead!)
|
9. [Hazardous-Course (first version of Hazardous-Course 2)](https://drive.google.com/file/d/16djJZSpNWKyScSxSyMqX-u_S-2i400rl/view?usp=sharing)
|
||||||
10. [High Tech v0.2](http://hl.loess.ru/?mod=499)
|
10. [High Tech v0.2](http://hl.loess.ru/?mod=499)
|
||||||
11. [HL Shadows, Part 1](https://www.fileplanet.com/7466/0/fileinfo/'HL-Shadows',-Part-1)
|
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)
|
12. [HLNewEnd](http://twhl.info/vault.php?map=2275)
|
||||||
13. [Kleiners Adventures Demo](http://www.moddb.com/mods/kleiners-adventures)
|
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/)
|
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)
|
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)
|
17. [Meth-Life Demo v1.0](https://www.gamewatcher.com/mods/half-life-mod/meth-life-mod-demo-1-0)
|
||||||
@@ -305,11 +305,11 @@ For mappacks - place *.bsp files to **valve/maps** folder, *.wad files to **valv
|
|||||||
29. [Shortcut v1.0 Beta](https://www.runthinkshootlive.com/posts/shortcut/)
|
29. [Shortcut v1.0 Beta](https://www.runthinkshootlive.com/posts/shortcut/)
|
||||||
30. [Stoka](https://www.ceskemody.cz/mapy.php?lng=1&clanek=222&razeni_hra=1&pn=stoka)
|
30. [Stoka](https://www.ceskemody.cz/mapy.php?lng=1&clanek=222&razeni_hra=1&pn=stoka)
|
||||||
31. [Striker's Compo 26](http://twhl.info/vault.php?map=5190) (buggy)
|
31. [Striker's Compo 26](http://twhl.info/vault.php?map=5190) (buggy)
|
||||||
32. [Technology Test 2](http://www.richmans-maps.ch.vu/) (link dead!)
|
32. [Technology Test 2](https://drive.google.com/file/d/1LfldzsMIN5j07bgtNkfY5v0Xl0S9de_G/view?usp=sharing)
|
||||||
33. [The Gate Playable Demo](https://www.fileplanet.com/116347/110000/fileinfo/The-Gate-Playable-Demo)
|
33. [The Gate Playable Demo](https://www.fileplanet.com/116347/110000/fileinfo/The-Gate-Playable-Demo)
|
||||||
34. [They are Back](https://www.runthinkshootlive.com/posts/they-are-back/)
|
34. [They are Back](https://www.runthinkshootlive.com/posts/they-are-back/)
|
||||||
35. [Tiefseelabor( Deep Sea Laboratory )](https://www.runthinkshootlive.com/posts/deep-sea-laboratory/)
|
35. [Tiefseelabor( Deep Sea Laboratory )](https://www.runthinkshootlive.com/posts/deep-sea-laboratory/)
|
||||||
36. [Time-Shift](http://www.richmans-maps.ch.vu/) (link dead!)
|
36. [Time-Shift](https://drive.google.com/file/d/1pK1s-2SIlSMQHVRPMLdC_94wTa__8_DX/view?usp=sharing)
|
||||||
37. [Train Single Beta](https://cs-mapping.com.ua/forum/showthread.php?t=36394) (Remove **gfx.wad** from **TrainSingle** folder)
|
37. [Train Single Beta](https://cs-mapping.com.ua/forum/showthread.php?t=36394) (Remove **gfx.wad** from **TrainSingle** folder)
|
||||||
38. [WAR: The Killer Beta 0.1](http://www.moddb.com/mods/war)
|
38. [WAR: The Killer Beta 0.1](http://www.moddb.com/mods/war)
|
||||||
39. [White Force Beta( Residual Point prototype )](http://www.moddb.com/mods/hl-residual-point/downloads/white-force-beta-2002)
|
39. [White Force Beta( Residual Point prototype )](http://www.moddb.com/mods/hl-residual-point/downloads/white-force-beta-2002)
|
||||||
@@ -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)
|
41. [Zombieland v1.1](http://www.moddb.com/mods/zombieland)
|
||||||
|
|
||||||
## Just mappacks
|
## 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)
|
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)
|
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)
|
4. [Cook The Headcrab Episode 4](http://www.moddb.com/games/half-life/addons/cook-the-headcrab-episode-4)
|
||||||
@@ -379,7 +379,7 @@ Mods:
|
|||||||
5. [Half-Life Baby v1.4](http://www.moddb.com/games/half-life/addons/half-life-baby) (it's an unfinished but playable mod; after installing of the mod open **liblist.gam** or **gameinfo.txt** file in the mod's folder and correct the line **gamedll "..\hlbaby\dlls\hl.dll"** for **gamedll "dlls\hl.dll"**, otherwise you'll not be able to start a game)
|
5. [Half-Life Baby v1.4](http://www.moddb.com/games/half-life/addons/half-life-baby) (it's an unfinished but playable mod; after installing of the mod open **liblist.gam** or **gameinfo.txt** file in the mod's folder and correct the line **gamedll "..\hlbaby\dlls\hl.dll"** for **gamedll "dlls\hl.dll"**, otherwise you'll not be able to start a game)
|
||||||
6. [Half-Secret](http://www.moddb.com/mods/half-secret) (this mod has custom **weapon_snark** code)
|
6. [Half-Secret](http://www.moddb.com/mods/half-secret) (this mod has custom **weapon_snark** code)
|
||||||
7. [Induction](http://www.moddb.com/mods/half-life-induction) (this mod has new item - **item_flashlight**)
|
7. [Induction](http://www.moddb.com/mods/half-life-induction) (this mod has new item - **item_flashlight**)
|
||||||
8. [Lost in Black Mesa(first version without HLFX)](http://half-life.ru/forum/showthread.php?threadid=13959)
|
8. [Lost in Black Mesa(first version without HLFX)](https://drive.google.com/file/d/1bEnm_AxJs-ly8hTEZIQBw_v2BsXdSiGa/view?usp=sharing)
|
||||||
9. [Soldier](http://www.moddb.com/mods/half-life-soldier)
|
9. [Soldier](http://www.moddb.com/mods/half-life-soldier)
|
||||||
10. [Solo Operations](http://www.moddb.com/mods/solo-operations)
|
10. [Solo Operations](http://www.moddb.com/mods/solo-operations)
|
||||||
11. [The Blood v1.1](http://hl.loess.ru/?mods=&search=The+Blood) (there are some inner bugs in the mod, but they don't interfere with a game progress)
|
11. [The Blood v1.1](http://hl.loess.ru/?mods=&search=The+Blood) (there are some inner bugs in the mod, but they don't interfere with a game progress)
|
||||||
@@ -422,7 +422,7 @@ Mods:
|
|||||||
33. [C2](https://www.runthinkshootlive.com/posts/c2/)
|
33. [C2](https://www.runthinkshootlive.com/posts/c2/)
|
||||||
34. [C3](https://www.runthinkshootlive.com/posts/c3/)
|
34. [C3](https://www.runthinkshootlive.com/posts/c3/)
|
||||||
35. [C5](https://www.runthinkshootlive.com/posts/c5/)
|
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)
|
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)
|
38. [CataXen](http://twhl.info/vault.php?map=3429)
|
||||||
39. [Cause of Death](http://twhl.info/competitions.php?results=7)
|
39. [Cause of Death](http://twhl.info/competitions.php?results=7)
|
||||||
@@ -440,7 +440,7 @@ Mods:
|
|||||||
51. [Data-base](https://www.runthinkshootlive.com/posts/database/)
|
51. [Data-base](https://www.runthinkshootlive.com/posts/database/)
|
||||||
52. [de_dust2_azabetfeN](https://cs-mapping.com.ua/forum/showthread.php?t=36394) (remove **cl_dlls** & **dlls** folders from inside of mod's directory before you start the game)
|
52. [de_dust2_azabetfeN](https://cs-mapping.com.ua/forum/showthread.php?t=36394) (remove **cl_dlls** & **dlls** folders from inside of mod's directory before you start the game)
|
||||||
53. [De-railed](http://twhl.info/competitions.php?results=7)
|
53. [De-railed](http://twhl.info/competitions.php?results=7)
|
||||||
54. [Dead Shift Beta](http://www.moddb.com/mods/dead-shift) - [Demo 1](https://www.gamewatcher.com/mods/half-life-mod/dead-shift-1-0-beta) & [Demo 2](https://www.gamefront.com/files/13532512) (3rd link dead!)
|
54. [Dead Shift Beta](http://www.moddb.com/mods/dead-shift) - [Demo 1](https://www.gamewatcher.com/mods/half-life-mod/dead-shift-1-0-beta) & [Demo 2](https://drive.google.com/file/d/1uHvr8xONogTTNOy-8X6G4ehFV6Eawvbq/view?usp=sharing)
|
||||||
55. [Deep](http://twhl.info/vault.php?map=1669)
|
55. [Deep](http://twhl.info/vault.php?map=1669)
|
||||||
56. [Desert Attack](http://fyzzer.narod.ru/index.html)
|
56. [Desert Attack](http://fyzzer.narod.ru/index.html)
|
||||||
57. [Desert Combat Demo](https://www.fileplanet.com/190487/190000/fileinfo/Half-Life---Desert-Combat-Mod) (despite a big file size there's only one small unfinished map)
|
57. [Desert Combat Demo](https://www.fileplanet.com/190487/190000/fileinfo/Half-Life---Desert-Combat-Mod) (despite a big file size there's only one small unfinished map)
|
||||||
@@ -469,7 +469,7 @@ Mods:
|
|||||||
80. [Extinct Lifeform Hunt](https://www.fileplanet.com/13501/10000/fileinfo/Extinct-Lifeform-Hunt)
|
80. [Extinct Lifeform Hunt](https://www.fileplanet.com/13501/10000/fileinfo/Extinct-Lifeform-Hunt)
|
||||||
81. [Facility](http://twhl.info/vault.php?map=5482)
|
81. [Facility](http://twhl.info/vault.php?map=5482)
|
||||||
82. [Facility Escape](http://twhl.info/vault.php?map=3673)
|
82. [Facility Escape](http://twhl.info/vault.php?map=3673)
|
||||||
83. [Fallout](http://www.thewall.de/forum/thread/hl1-sp-48h-mapping-contest/64975.4.html) (map by *simb*)
|
83. [Fallout](http://www.thewall.de/forum/thread/hl1-sp-48h-mapping-contest/64975.4.html) (map by *simb*) (link dead!)
|
||||||
84. [Final Assault](http://twhl.info/vault.php?map=4500)
|
84. [Final Assault](http://twhl.info/vault.php?map=4500)
|
||||||
85. [Flat](http://hl.loess.ru/?mods=&search=Flat)
|
85. [Flat](http://hl.loess.ru/?mods=&search=Flat)
|
||||||
86. [Freeman's Allegiance](https://www.runthinkshootlive.com/posts/freemans-allegiance/)
|
86. [Freeman's Allegiance](https://www.runthinkshootlive.com/posts/freemans-allegiance/)
|
||||||
@@ -498,8 +498,8 @@ Mods:
|
|||||||
109. [Hospital](https://gamebanana.com/maps/167446) (you need to edit **liblist.gam** file in the mod's folder - delete *gamedll & type* strings from it before you start to play)
|
109. [Hospital](https://gamebanana.com/maps/167446) (you need to edit **liblist.gam** file in the mod's folder - delete *gamedll & type* strings from it before you start to play)
|
||||||
110. [Hostage](https://www.runthinkshootlive.com/posts/hostage-2/)
|
110. [Hostage](https://www.runthinkshootlive.com/posts/hostage-2/)
|
||||||
111. [House](http://www.artpeter.net/Data/HalfLife/Hl.php)
|
111. [House](http://www.artpeter.net/Data/HalfLife/Hl.php)
|
||||||
112. [Impulse 101 Fun - The Train](http://web.archive.org/web/20070305075816/http://www.twhl.co.za/mapvault/2817.zip) (map from *TWHL* by *Archie* aka *The Hunter*)
|
112. [Impulse 101 Fun - The Train](https://drive.google.com/file/d/1jAuMCCmREH0mfAEAscqaG8FQGa2uNknb/view?usp=sharing) (map from *TWHL* by *Archie* aka *The Hunter*)
|
||||||
113. [In America](http://www.lambda-force.org/load/half_life/karty/half_life_in_america/18-1-0-476)
|
113. [In America](https://drive.google.com/file/d/1gOC8zfnUvBxRy8Rr8juNiUNbLYjoZpnn/view?usp=sharing)
|
||||||
114. [In the Kitchen](http://twhl.info/vault.php?map=4314)
|
114. [In the Kitchen](http://twhl.info/vault.php?map=4314)
|
||||||
115. [Infiltration](https://www.fileplanet.com/7467/0/fileinfo/Infiltration)
|
115. [Infiltration](https://www.fileplanet.com/7467/0/fileinfo/Infiltration)
|
||||||
116. [Interactivity & Lots of Entities](http://twhl.info/vault.php?map=5744) (link dead!)
|
116. [Interactivity & Lots of Entities](http://twhl.info/vault.php?map=5744) (link dead!)
|
||||||
@@ -641,7 +641,7 @@ Mods:
|
|||||||
252. [Tower](http://twhl.info/vault.php?map=250) (Required Spirit of Half-Life for item_suit)
|
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)
|
253. [TriggerHappy](https://www.fileplanet.com/8929/0/fileinfo/TriggerHappy)
|
||||||
254. [TriggerHappy2](https://www.fileplanet.com/13503/10000/fileinfo/TriggerHappy2)
|
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)
|
256. [Trouble](https://gamebanana.com/maps/166033)
|
||||||
257. [Tunnels](http://twhl.info/vault.php?map=5350)
|
257. [Tunnels](http://twhl.info/vault.php?map=5350)
|
||||||
258. [Twisted Hazard Course](https://www.fileplanet.com/52919/50000/fileinfo/Twisted-Hazard-Course)
|
258. [Twisted Hazard Course](https://www.fileplanet.com/52919/50000/fileinfo/Twisted-Hazard-Course)
|
||||||
@@ -668,7 +668,7 @@ Mods:
|
|||||||
279. [X-treme Violence](http://www.moddb.com/mods/x-treme-violence)
|
279. [X-treme Violence](http://www.moddb.com/mods/x-treme-violence)
|
||||||
280. [XargoL's Entry for Vassy's Compo](http://twhl.info/vault.php?map=769)
|
280. [XargoL's Entry for Vassy's Compo](http://twhl.info/vault.php?map=769)
|
||||||
281. [Xen Again](https://www.fileplanet.com/9132/0/fileinfo/XEN-AGAIN)
|
281. [Xen Again](https://www.fileplanet.com/9132/0/fileinfo/XEN-AGAIN)
|
||||||
282. [Xen World](http://www.lambda-force.org/load/half_life/karty/half_life_xen_world/18-1-0-481)
|
282. [Xen World](http://www.lambda-force.org/load/half_life/karty/half_life_xen_world/18-1-0-481) (link dead!)
|
||||||
283. [XUnil](https://www.fileplanet.com/7883/0/fileinfo/XUNIL)
|
283. [XUnil](https://www.fileplanet.com/7883/0/fileinfo/XUNIL)
|
||||||
284. [Zeeba-G's TWHL Compo 26 Entry](http://twhl.info/competitions.php?results=26)
|
284. [Zeeba-G's TWHL Compo 26 Entry](http://twhl.info/competitions.php?results=26)
|
||||||
285. [Zombies!](https://gamebanana.com/maps/160812)
|
285. [Zombies!](https://gamebanana.com/maps/160812)
|
||||||
@@ -694,7 +694,7 @@ For Linux and OS X you must download crossbuild from [here](http://www.moddb.com
|
|||||||
2. [Big Scientists](http://www.moddb.com/mods/big-scientists)
|
2. [Big Scientists](http://www.moddb.com/mods/big-scientists)
|
||||||
3. [Black Silla Assault DEMO v1.2](http://www.moddb.com/mods/black-silla-assault)
|
3. [Black Silla Assault DEMO v1.2](http://www.moddb.com/mods/black-silla-assault)
|
||||||
4. [Blbej Den](http://www.moddb.com/mods/blbej-den)
|
4. [Blbej Den](http://www.moddb.com/mods/blbej-den)
|
||||||
5. [Cold Experiment v1](http://jpmaps.wz.cz/epizody.htm) (you will need some files from SoHL to play it properly; download SoHL 1.2, extract files and copy following folders into **coldexv1** folder: cl_dlls, dlls, models, sprites)
|
5. [Cold Experiment v1](https://www.moddb.com/games/half-life/addons/cold-experiment) (you will need some files from SoHL to play it properly; download SoHL 1.2, extract files and copy following folders into **coldexv1** folder: cl_dlls, dlls, models, sprites)
|
||||||
6. [Dead Sector v1.0a](http://www.moddb.com/mods/dead-sector)
|
6. [Dead Sector v1.0a](http://www.moddb.com/mods/dead-sector)
|
||||||
7. [Death Is Dead](http://www.moddb.com/games/half-life/addons/death-is-dead) (there is a fog-related inner bug at the first map)
|
7. [Death Is Dead](http://www.moddb.com/games/half-life/addons/death-is-dead) (there is a fog-related inner bug at the first map)
|
||||||
8. [Escape from Black Mesa Alpha](http://www.moddb.com/mods/escape-from-black-mesa)
|
8. [Escape from Black Mesa Alpha](http://www.moddb.com/mods/escape-from-black-mesa)
|
||||||
@@ -708,11 +708,11 @@ 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)
|
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)
|
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)
|
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)
|
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!)
|
21. [Terrorist Attack 2](https://www.moddb.com/games/half-life/addons/terrorist-attack-2)
|
||||||
22. [Timeline III: The Heart of Darkness](http://www.moddb.com/mods/timeline-series)
|
22. [Timeline III: The Heart of Darkness](http://www.moddb.com/mods/timeline-series)
|
||||||
23. [Underground 2 Demo](http://www.isolated-design.de/half-life-mods/underground-2/)
|
23. [Underground 2 Demo](https://www.moddb.com/games/half-life/addons/underground-2-demo)
|
||||||
|
|
||||||
## Mods which based on modified Spirit of Half-Life 1.2 or older(Partially playable with SoHL 1.2 libraries or not playable at all)
|
## Mods which based on modified Spirit of Half-Life 1.2 or older(Partially playable with SoHL 1.2 libraries or not playable at all)
|
||||||
1. [Black Death](http://www.moddb.com/mods/half-life-black-death)
|
1. [Black Death](http://www.moddb.com/mods/half-life-black-death)
|
||||||
@@ -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)
|
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)
|
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)
|
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)
|
5. [Far Crab Demo v2](http://www.moddb.com/mods/far-crab)
|
||||||
6. [Firefighter Demo v1.1](http://www.moddb.com/mods/firefighter-mod)
|
6. [Firefighter Demo v1.1](http://www.moddb.com/mods/firefighter-mod)
|
||||||
7. [Halfquake 3: Sunrise](http://www.moddb.com/mods/halfquake-amen)
|
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)
|
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)
|
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)
|
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)
|
20. [Realms](http://www.snarkpit.net/index.php?s=maps&map=3483)
|
||||||
21. [Shepard's Adventures](http://www.moddb.com/mods/shepards-adventures)
|
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)
|
22. [Snowy Rock](http://www.moddb.com/games/half-life-opposing-force/addons/snow-rock)
|
||||||
@@ -825,10 +825,10 @@ Mods:
|
|||||||
3. [Bomb Squad](http://www.snarkpit.net/index.php?s=maps&map=3471)
|
3. [Bomb Squad](http://www.snarkpit.net/index.php?s=maps&map=3471)
|
||||||
4. [Corruption](http://www.snarkpit.net/index.php?s=maps&map=3154)
|
4. [Corruption](http://www.snarkpit.net/index.php?s=maps&map=3154)
|
||||||
5. [Critical Mass](http://www.moddb.com/mods/half-life-critical-mass) [C3M1 Build 1 Demo](https://www.fileplanet.com/125746/120000/fileinfo/C3M1-Build-1)
|
5. [Critical Mass](http://www.moddb.com/mods/half-life-critical-mass) [C3M1 Build 1 Demo](https://www.fileplanet.com/125746/120000/fileinfo/C3M1-Build-1)
|
||||||
6. [EPRST!](http://www.planetphillip.com/posts/ep-rst-opposing-force/) (link dead!)
|
6. [EPRST!](https://www.runthinkshootlive.com/posts/ep-rst/)
|
||||||
7. [Firing Range](https://www.runthinkshootlive.com/posts/firing-range/)
|
7. [Firing Range](https://www.runthinkshootlive.com/posts/firing-range/)
|
||||||
8. [Friendly Fire](https://www.runthinkshootlive.com/posts/friendly-fire/)
|
8. [Friendly Fire](https://www.runthinkshootlive.com/posts/friendly-fire/)
|
||||||
9. [Guitar Star Pre-Alpha](http://hl-lab.ru/eng/mods_goldsrc/Guitar_Star_(Prealpha)) (link dead!)
|
9. [Guitar Star Pre-Alpha](http://gamer-lab.com/rus/mods_goldsrc/Guitar_Star_(Prealpha))
|
||||||
10. [J2000](https://www.runthinkshootlive.com/posts/j2000/)
|
10. [J2000](https://www.runthinkshootlive.com/posts/j2000/)
|
||||||
11. [Killing House for OF](https://www.runthinkshootlive.com/posts/scientist-rescue-aka-cqb/)
|
11. [Killing House for OF](https://www.runthinkshootlive.com/posts/scientist-rescue-aka-cqb/)
|
||||||
12. [Klabautermann](https://www.runthinkshootlive.com/posts/klabautermann/) (though the map has some inner issues, it can be properly finished, just don't let the welder soldier die and don't press the fifth button until you mount a special gun in its' place)
|
12. [Klabautermann](https://www.runthinkshootlive.com/posts/klabautermann/) (though the map has some inner issues, it can be properly finished, just don't let the welder soldier die and don't press the fifth button until you mount a special gun in its' place)
|
||||||
|
|||||||
41
Documentation/vgui2-support.md
Normal file
41
Documentation/vgui2-support.md
Normal file
@@ -0,0 +1,41 @@
|
|||||||
|
# Experimental VGUI2 Support
|
||||||
|
|
||||||
|
Thanks to @kungfulon contributions, Xash3D FWGS now supports VGUI2.
|
||||||
|
|
||||||
|
VGUI2 is undocumented UI system from Source Engine that GoldSrc used in some games and it's main menu.
|
||||||
|
|
||||||
|
## Support status
|
||||||
|
|
||||||
|
Doesn't draw anything, doesn't take any input.
|
||||||
|
|
||||||
|
## List of games that require VGUI2 support
|
||||||
|
|
||||||
|
- Counter-Strike 1.6
|
||||||
|
- Counter-Strike: Condition Zero
|
||||||
|
- Counter-Strike: Condition Zero Deleted Scenes
|
||||||
|
- Day of Defeat
|
||||||
|
- Half-Life: Blue Shift
|
||||||
|
|
||||||
|
## How to enable VGUI2 support
|
||||||
|
|
||||||
|
By default, engine doesn't initialize VGUI2 to not confuse existing games and mods that use or do not use VGUI1. This support also relies on a number of proprietary libraries, that we better not redistribute, so you have to supply them yourself. Keep in mind, that these libraries are compiled only for 32-bit Windows, Linux and OSX, you shouldn't expect them running anywhere else.
|
||||||
|
|
||||||
|
1. Download latest Half-Life from Steam.
|
||||||
|
2. Open local files.
|
||||||
|
3. Copy libraries in the list below according to your platform, to folder where Xash3D searches it's libraries (usually in same folder where executable is located)
|
||||||
|
|
||||||
|
| Linux | Windows
|
||||||
|
| -------- | --------
|
||||||
|
| `chromehtml.so` | `chromehtml.dll`
|
||||||
|
| `vgui2.so` | `vgui2.dll`
|
||||||
|
| `libcef.so` | `libcef.dll`
|
||||||
|
| `libtier0.so` | `tier0.dll`
|
||||||
|
| `libvstdlib.so` | `vstdlib.dll`
|
||||||
|
| `libsteam_api.so` | `steam_api.dll`
|
||||||
|
|
||||||
|
Some files must also be copied:
|
||||||
|
- `cef_gtk.pak`
|
||||||
|
|
||||||
|
Additionally, on Linux other libraries must be provided. Use `ldd` tool to figure out which libraries you miss. Many of them can be pulled from Steam Runtime.
|
||||||
|
|
||||||
|
Do not recommend using RoDir with VGUI2 games. Many of them are broken. Steam API will crash without `steam_appid.txt` in Xash root directory.
|
||||||
79
README.md
79
README.md
@@ -1,5 +1,6 @@
|
|||||||
# Xash3D FWGS Engine
|
# 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.
|
Xash3D FWGS is a fork of Xash3D Engine by Unkle Mike with extended features and crossplatform.
|
||||||
|
|
||||||
@@ -9,37 +10,55 @@ 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
|
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
|
## Fork features
|
||||||
* HLSDK 2.4 support.
|
* 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.
|
* Modern compilers support: say no more to MSVC6.
|
||||||
* Better multiplayer support: multiple master servers, headless dedicated server.
|
* Better multiplayer support: multiple master servers, headless dedicated server.
|
||||||
* Mobility API: allows better game integration on mobile devices(vibration, touch controls)
|
* Mobility API: allows better game integration on mobile devices(vibration, touch controls)
|
||||||
* Different input methods: touch, gamepad and classic mouse & keyboard.
|
* Different input methods: touch, gamepad and classic mouse & keyboard.
|
||||||
* TrueType font rendering, as a part of mainui_cpp.
|
* TrueType font rendering, as a part of mainui_cpp.
|
||||||
* Multiple renderers support(OpenGL, GLES, Software)
|
* Multiple renderers support: OpenGL, GLESv1, GLESv2, Software.
|
||||||
|
* Voice support.
|
||||||
|
* External filesystem module like in GoldSrc engine.
|
||||||
|
* External vgui support module.
|
||||||
|
* PNG image format support.
|
||||||
* A set of small improvements, without broken compatibility.
|
* A set of small improvements, without broken compatibility.
|
||||||
|
|
||||||
## Planned fork features
|
## Planned fork features
|
||||||
* Virtual Reality support and game API
|
* Virtual Reality support and game API.
|
||||||
* Voice support
|
* Vulkan renderer.
|
||||||
* 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-portable).
|
||||||
|
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
|
## 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 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
|
## Build instructions
|
||||||
We are using Waf build system. If you have some Waf-related questions, I recommend you to read https://waf.io/book/
|
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
|
### Prerequisites
|
||||||
#### Windows(Visual Studio)
|
|
||||||
|
If your CPU is x86 compatible, we are building 32-bit code by default. This was done to maintain 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-portable).
|
||||||
|
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 Visual Studio.
|
||||||
* Install latest [Python](https://python.org) **OR** run `cinst python.install` if you have Chocolatey.
|
* 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.
|
* Install latest [Git](https://git-scm.com/download/win) **OR** run `cinst git.install` if you have Chocolatey.
|
||||||
@@ -48,46 +67,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.
|
* 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
|
#### 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
|
##### Debian/Ubuntu
|
||||||
* Enable i386 on your system, if you're compiling 32-bit engine on amd64. If not, skip this
|
* Enable i386 on your system, if you're compiling 32-bit engine on amd64. If not, skip this
|
||||||
|
|
||||||
`$ sudo dpkg --add-architecture i386`
|
`$ sudo dpkg --add-architecture i386`
|
||||||
* Install development tools
|
* 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`
|
`$ 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`
|
`$ sudo apt install build-essential python libsdl2-dev libfontconfig-dev libfreetype6-dev`
|
||||||
* Clone this repostory:
|
* Clone this repostory:
|
||||||
`$ git clone --recursive https://github.com/FWGS/xash3d-fwgs`
|
`$ 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
|
### Building
|
||||||
#### Windows(Visual Studio)
|
#### Windows (Visual Studio)
|
||||||
0) Open command line
|
0) Open command line
|
||||||
1) Navigate to `xash3d-fwgs` directory.
|
1) Navigate to `xash3d-fwgs` directory.
|
||||||
2) Carefully examine which build options are available: `waf --help`
|
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`
|
4) Compile: `waf build`
|
||||||
5) Install: `waf install`
|
5) Install: `waf install --destdir=c:/path/to/any/output/directory`
|
||||||
|
|
||||||
#### Linux
|
#### 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`
|
0) Examine which build options are available: `./waf --help`
|
||||||
1) Configure build: `./waf configure -T release --prefix=/path/to/any/output/directory`
|
1) Configure build: `./waf configure -T release`
|
||||||
(To compile 64-bit engine on 64-bit x86 processor, you need to pass `-8` also)
|
(You need to pass `-8` to compile 64-bit engine on 64-bit x86 processor)
|
||||||
2) Compile: `./waf build`
|
2) Compile: `./waf build`
|
||||||
3) Install(optional): `./waf install`
|
3) Install(optional): `./waf install --destdir=/path/to/any/output/directory`
|
||||||
|
|
||||||
## 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.
|
|
||||||
|
|||||||
@@ -20,6 +20,8 @@ GNU General Public License for more details.
|
|||||||
#define VIDEO_SDL 1
|
#define VIDEO_SDL 1
|
||||||
#define VIDEO_ANDROID 2
|
#define VIDEO_ANDROID 2
|
||||||
#define VIDEO_FBDEV 3
|
#define VIDEO_FBDEV 3
|
||||||
|
#define VIDEO_DOS 4
|
||||||
|
|
||||||
|
|
||||||
// audio backends (XASH_SOUND)
|
// audio backends (XASH_SOUND)
|
||||||
#define SOUND_NULL 0
|
#define SOUND_NULL 0
|
||||||
@@ -27,12 +29,6 @@ GNU General Public License for more details.
|
|||||||
#define SOUND_OPENSLES 2
|
#define SOUND_OPENSLES 2
|
||||||
#define SOUND_ALSA 3
|
#define SOUND_ALSA 3
|
||||||
|
|
||||||
// crash handler (XASH_CRASHHANDLER)
|
|
||||||
#define CRASHHANDLER_NULL 0
|
|
||||||
#define CRASHHANDLER_UCONTEXT 1
|
|
||||||
#define CRASHHANDLER_DBGHELP 2
|
|
||||||
#define CRASHHANDLER_WIN32 3
|
|
||||||
|
|
||||||
// input (XASH_INPUT)
|
// input (XASH_INPUT)
|
||||||
#define INPUT_NULL 0
|
#define INPUT_NULL 0
|
||||||
#define INPUT_SDL 1
|
#define INPUT_SDL 1
|
||||||
@@ -42,13 +38,23 @@ GNU General Public License for more details.
|
|||||||
// timer (XASH_TIMER)
|
// timer (XASH_TIMER)
|
||||||
#define TIMER_NULL 0 // not used
|
#define TIMER_NULL 0 // not used
|
||||||
#define TIMER_SDL 1
|
#define TIMER_SDL 1
|
||||||
#define TIMER_LINUX 2
|
#define TIMER_POSIX 2
|
||||||
#define TIMER_WIN32 3
|
#define TIMER_WIN32 3
|
||||||
|
#define TIMER_DOS 4
|
||||||
|
|
||||||
// messageboxes (XASH_MESSAGEBOX)
|
// messageboxes (XASH_MESSAGEBOX)
|
||||||
#define MSGBOX_STDERR 0
|
#define MSGBOX_STDERR 0
|
||||||
#define MSGBOX_SDL 1
|
#define MSGBOX_SDL 1
|
||||||
#define MSGBOX_ANDROID 2
|
#define MSGBOX_ANDROID 2
|
||||||
#define MSGBOX_WIN32 3
|
#define MSGBOX_WIN32 3
|
||||||
|
#define MSGBOX_NSWITCH 4
|
||||||
|
|
||||||
|
|
||||||
|
// library loading (XASH_LIB)
|
||||||
|
#define LIB_NULL 0
|
||||||
|
#define LIB_POSIX 1
|
||||||
|
#define LIB_WIN32 2
|
||||||
|
#define LIB_STATIC 3
|
||||||
|
|
||||||
|
|
||||||
#endif /* BACKENDS_H */
|
#endif /* BACKENDS_H */
|
||||||
|
|||||||
@@ -61,23 +61,27 @@ BRUSH MODELS
|
|||||||
#define LS_UNUSED 0xFE
|
#define LS_UNUSED 0xFE
|
||||||
#define LS_NONE 0xFF
|
#define LS_NONE 0xFF
|
||||||
|
|
||||||
|
#define MAX_MAP_CLIPNODES_HLBSP 32767
|
||||||
|
#define MAX_MAP_CLIPNODES_BSP2 524288
|
||||||
|
|
||||||
// these limis not using by modelloader but only for displaying 'mapstats' correctly
|
// these limis not using by modelloader but only for displaying 'mapstats' correctly
|
||||||
#ifdef SUPPORT_BSP2_FORMAT
|
#ifdef SUPPORT_BSP2_FORMAT
|
||||||
#define MAX_MAP_MODELS 2048 // embedded models
|
#define MAX_MAP_MODELS 2048 // embedded models
|
||||||
#define MAX_MAP_ENTSTRING 0x200000 // 2 Mb should be enough
|
#define MAX_MAP_ENTSTRING 0x200000 // 2 Mb should be enough
|
||||||
#define MAX_MAP_PLANES 131072 // can be increased without problems
|
#define MAX_MAP_PLANES 131072 // can be increased without problems
|
||||||
#define MAX_MAP_NODES 262144 // can be increased without problems
|
#define MAX_MAP_NODES 262144 // can be increased without problems
|
||||||
#define MAX_MAP_CLIPNODES 524288 // can be increased without problems
|
#define MAX_MAP_CLIPNODES MAX_MAP_CLIPNODES_BSP2 // can be increased without problems
|
||||||
#define MAX_MAP_LEAFS 131072 // CRITICAL STUFF to run ad_sepulcher!!!
|
#define MAX_MAP_LEAFS 131072 // CRITICAL STUFF to run ad_sepulcher!!!
|
||||||
#define MAX_MAP_VERTS 524288 // can be increased without problems
|
#define MAX_MAP_VERTS 524288 // can be increased without problems
|
||||||
#define MAX_MAP_FACES 262144 // can be increased without problems
|
#define MAX_MAP_FACES 262144 // can be increased without problems
|
||||||
#define MAX_MAP_MARKSURFACES 524288 // can be increased without problems
|
#define MAX_MAP_MARKSURFACES 524288 // can be increased without problems
|
||||||
#else
|
#else
|
||||||
#define MAX_MAP_MODELS 768 // embedded models
|
// increased to match PrimeXT compilers
|
||||||
|
#define MAX_MAP_MODELS 1024 // embedded models
|
||||||
#define MAX_MAP_ENTSTRING 0x100000 // 1 Mb should be enough
|
#define MAX_MAP_ENTSTRING 0x100000 // 1 Mb should be enough
|
||||||
#define MAX_MAP_PLANES 65536 // can be increased without problems
|
#define MAX_MAP_PLANES 65536 // can be increased without problems
|
||||||
#define MAX_MAP_NODES 32767 // because negative shorts are leafs
|
#define MAX_MAP_NODES 32767 // because negative shorts are leafs
|
||||||
#define MAX_MAP_CLIPNODES 32767 // because negative shorts are contents
|
#define MAX_MAP_CLIPNODES MAX_MAP_CLIPNODES_HLBSP // because negative shorts are contents
|
||||||
#define MAX_MAP_LEAFS 32767 // signed short limit
|
#define MAX_MAP_LEAFS 32767 // signed short limit
|
||||||
#define MAX_MAP_VERTS 65535 // unsigned short limit
|
#define MAX_MAP_VERTS 65535 // unsigned short limit
|
||||||
#define MAX_MAP_FACES 65535 // unsigned short limit
|
#define MAX_MAP_FACES 65535 // unsigned short limit
|
||||||
|
|||||||
@@ -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 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
|
typedef enum
|
||||||
{
|
{
|
||||||
@@ -21,10 +21,13 @@ typedef enum
|
|||||||
PF_RGB_24, // uncompressed dds or another 24-bit image
|
PF_RGB_24, // uncompressed dds or another 24-bit image
|
||||||
PF_BGR_24, // big-endian RGB (MacOS)
|
PF_BGR_24, // big-endian RGB (MacOS)
|
||||||
PF_LUMINANCE,
|
PF_LUMINANCE,
|
||||||
PF_DXT1, // s3tc DXT1 format
|
PF_DXT1, // s3tc DXT1/BC1 format
|
||||||
PF_DXT3, // s3tc DXT3 format
|
PF_DXT3, // s3tc DXT3/BC2 format
|
||||||
PF_DXT5, // s3tc DXT5 format
|
PF_DXT5, // s3tc DXT5/BC3 format
|
||||||
PF_ATI2, // latc ATI2N 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
|
PF_TOTALCOUNT, // must be last
|
||||||
} pixformat_t;
|
} pixformat_t;
|
||||||
|
|
||||||
@@ -46,6 +49,7 @@ typedef enum
|
|||||||
IL_DDS_HARDWARE = BIT(4), // DXT compression is support
|
IL_DDS_HARDWARE = BIT(4), // DXT compression is support
|
||||||
IL_LOAD_DECAL = BIT(5), // special mode for load gradient decals
|
IL_LOAD_DECAL = BIT(5), // special mode for load gradient decals
|
||||||
IL_OVERVIEW = BIT(6), // overview required some unque operations
|
IL_OVERVIEW = BIT(6), // overview required some unque operations
|
||||||
|
IL_LOAD_PLAYER_DECAL = BIT(7), // special mode for player decals
|
||||||
} ilFlags_t;
|
} ilFlags_t;
|
||||||
|
|
||||||
// goes into rgbdata_t->encode
|
// goes into rgbdata_t->encode
|
||||||
@@ -82,7 +86,7 @@ typedef enum
|
|||||||
IMAGE_ROT_90 = BIT(18), // flip from upper left corner to down right corner
|
IMAGE_ROT_90 = BIT(18), // flip from upper left corner to down right corner
|
||||||
IMAGE_ROT180 = IMAGE_FLIP_X|IMAGE_FLIP_Y,
|
IMAGE_ROT180 = IMAGE_FLIP_X|IMAGE_FLIP_Y,
|
||||||
IMAGE_ROT270 = IMAGE_FLIP_X|IMAGE_FLIP_Y|IMAGE_ROT_90,
|
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
|
IMAGE_RESAMPLE = BIT(20), // resample image to specified dims
|
||||||
// reserved
|
// reserved
|
||||||
// reserved
|
// reserved
|
||||||
|
|||||||
@@ -32,7 +32,8 @@ GNU General Public License for more details.
|
|||||||
|
|
||||||
#define MIPLEVELS 4
|
#define MIPLEVELS 4
|
||||||
#define VERTEXSIZE 7
|
#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
|
#define NUM_AMBIENTS 4 // automatic ambient sounds
|
||||||
|
|
||||||
// model types
|
// model types
|
||||||
@@ -104,7 +105,7 @@ typedef struct
|
|||||||
|
|
||||||
vec3_t mins, maxs; // terrain bounds (fill by user)
|
vec3_t mins, maxs; // terrain bounds (fill by user)
|
||||||
|
|
||||||
int reserved[32]; // just for future expansions or mod-makers
|
intptr_t reserved[32]; // just for future expansions or mod-makers
|
||||||
} mfaceinfo_t;
|
} mfaceinfo_t;
|
||||||
|
|
||||||
typedef struct
|
typedef struct
|
||||||
@@ -172,8 +173,8 @@ struct decal_s
|
|||||||
short entityIndex; // Entity this is attached to
|
short entityIndex; // Entity this is attached to
|
||||||
// Xash3D specific
|
// Xash3D specific
|
||||||
vec3_t position; // location of the decal center in world space.
|
vec3_t position; // location of the decal center in world space.
|
||||||
glpoly_t *polys; // precomputed decal vertices
|
glpoly_t *polys; // precomputed decal vertices
|
||||||
int reserved[4]; // just for future expansions or mod-makers
|
intptr_t reserved[4]; // just for future expansions or mod-makers
|
||||||
};
|
};
|
||||||
|
|
||||||
typedef struct mleaf_s
|
typedef struct mleaf_s
|
||||||
@@ -227,7 +228,7 @@ typedef struct mextrasurf_s
|
|||||||
unsigned short numverts; // world->vertexes[]
|
unsigned short numverts; // world->vertexes[]
|
||||||
int firstvertex; // fisrt look up in tr.tbn_vectors[], then acess to world->vertexes[]
|
int firstvertex; // fisrt look up in tr.tbn_vectors[], then acess to world->vertexes[]
|
||||||
|
|
||||||
int reserved[32]; // just for future expansions or mod-makers
|
intptr_t reserved[32]; // just for future expansions or mod-makers
|
||||||
} mextrasurf_t;
|
} mextrasurf_t;
|
||||||
|
|
||||||
struct msurface_s
|
struct msurface_s
|
||||||
@@ -290,7 +291,7 @@ typedef struct model_s
|
|||||||
// shared modelinfo
|
// shared modelinfo
|
||||||
modtype_t type; // model type
|
modtype_t type; // model type
|
||||||
int numframes; // sprite's framecount
|
int numframes; // sprite's framecount
|
||||||
byte *mempool; // private mempool (was synctype)
|
poolhandle_t mempool; // private mempool (was synctype)
|
||||||
int flags; // hl compatibility
|
int flags; // hl compatibility
|
||||||
|
|
||||||
//
|
//
|
||||||
@@ -529,7 +530,7 @@ typedef struct
|
|||||||
#define MAX_DEMOS 32
|
#define MAX_DEMOS 32
|
||||||
#define MAX_MOVIES 8
|
#define MAX_MOVIES 8
|
||||||
#define MAX_CDTRACKS 32
|
#define MAX_CDTRACKS 32
|
||||||
#define MAX_CLIENT_SPRITES 256 // SpriteTextures
|
#define MAX_CLIENT_SPRITES 512 // SpriteTextures (0-256 hud, 256-512 client)
|
||||||
#define MAX_EFRAGS 8192 // Arcane Dimensions required
|
#define MAX_EFRAGS 8192 // Arcane Dimensions required
|
||||||
#define MAX_REQUESTS 64
|
#define MAX_REQUESTS 64
|
||||||
|
|
||||||
|
|||||||
116
common/const.h
116
common/const.h
@@ -20,45 +20,45 @@
|
|||||||
// Most came from server.h
|
// Most came from server.h
|
||||||
|
|
||||||
// edict->flags
|
// edict->flags
|
||||||
#define FL_FLY (1<<0) // Changes the SV_Movestep() behavior to not need to be on ground
|
#define FL_FLY (1U<<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_SWIM (1U<<1) // Changes the SV_Movestep() behavior to not need to be on ground (but stay in water)
|
||||||
#define FL_CONVEYOR (1<<2)
|
#define FL_CONVEYOR (1U<<2)
|
||||||
#define FL_CLIENT (1<<3)
|
#define FL_CLIENT (1U<<3)
|
||||||
#define FL_INWATER (1<<4)
|
#define FL_INWATER (1U<<4)
|
||||||
#define FL_MONSTER (1<<5)
|
#define FL_MONSTER (1U<<5)
|
||||||
#define FL_GODMODE (1<<6)
|
#define FL_GODMODE (1U<<6)
|
||||||
#define FL_NOTARGET (1<<7)
|
#define FL_NOTARGET (1U<<7)
|
||||||
#define FL_SKIPLOCALHOST (1<<8) // Don't send entity to local host, it's predicting this entity itself
|
#define FL_SKIPLOCALHOST (1U<<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_ONGROUND (1U<<9) // At rest / on the ground
|
||||||
#define FL_PARTIALGROUND (1<<10) // not all corners are valid
|
#define FL_PARTIALGROUND (1U<<10) // not all corners are valid
|
||||||
#define FL_WATERJUMP (1<<11) // player jumping out of water
|
#define FL_WATERJUMP (1U<<11) // player jumping out of water
|
||||||
#define FL_FROZEN (1<<12) // Player is frozen for 3rd person camera
|
#define FL_FROZEN (1U<<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_FAKECLIENT (1U<<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_DUCKING (1U<<14) // Player flag -- Player is fully crouched
|
||||||
#define FL_FLOAT (1<<15) // Apply floating force to this entity when in water
|
#define FL_FLOAT (1U<<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_GRAPHED (1U<<16) // worldgraph has this ent listed as something that blocks a connection
|
||||||
|
|
||||||
// UNDONE: Do we need these?
|
// UNDONE: Do we need these?
|
||||||
#define FL_IMMUNE_WATER (1<<17)
|
#define FL_IMMUNE_WATER (1U<<17)
|
||||||
#define FL_IMMUNE_SLIME (1<<18)
|
#define FL_IMMUNE_SLIME (1U<<18)
|
||||||
#define FL_IMMUNE_LAVA (1<<19)
|
#define FL_IMMUNE_LAVA (1U<<19)
|
||||||
|
|
||||||
#define FL_PROXY (1<<20) // This is a spectator proxy
|
#define FL_PROXY (1U<<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_ALWAYSTHINK (1U<<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_BASEVELOCITY (1U<<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_MONSTERCLIP (1U<<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_ONTRAIN (1U<<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_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 (1<<26) // This client is a spectator, don't run touch functions, etc.
|
#define FL_SPECTATOR (1U<<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_LASERDOT (1U<<27) // Predicted laser spot from rocket launcher
|
||||||
|
|
||||||
#define FL_CUSTOMENTITY (1<<29) // This is a custom entity
|
#define FL_CUSTOMENTITY (1U<<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_KILLME (1U<<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_DORMANT (1U<<31) // Entity is dormant, no updates to client
|
||||||
|
|
||||||
// Goes into globalvars_t.trace_flags
|
// Goes into globalvars_t.trace_flags
|
||||||
#define FTRACE_SIMPLEBOX (1<<0) // Traceline with a simple box
|
#define FTRACE_SIMPLEBOX (1U<<0) // Traceline with a simple box
|
||||||
#define FTRACE_IGNORE_GLASS (1<<1) // traceline will be ignored entities with rendermode != kRenderNormal
|
#define FTRACE_IGNORE_GLASS (1U<<1) // traceline will be ignored entities with rendermode != kRenderNormal
|
||||||
|
|
||||||
// walkmove modes
|
// walkmove modes
|
||||||
#define WALKMOVE_NORMAL 0 // normal walkmove
|
#define WALKMOVE_NORMAL 0 // normal walkmove
|
||||||
@@ -114,11 +114,11 @@
|
|||||||
#define EF_LIGHT 64 // rocket flare glow sprite
|
#define EF_LIGHT 64 // rocket flare glow sprite
|
||||||
#define EF_NODRAW 128 // don't draw entity
|
#define EF_NODRAW 128 // don't draw entity
|
||||||
|
|
||||||
#define EF_WATERSIDES (1<<26) // Do not remove sides for func_water entity
|
#define EF_WATERSIDES (1U<<26) // Do not remove sides for func_water entity
|
||||||
#define EF_FULLBRIGHT (1<<27) // Just get fullbright
|
#define EF_FULLBRIGHT (1U<<27) // Just get fullbright
|
||||||
#define EF_NOSHADOW (1<<28) // ignore shadow for this entity
|
#define EF_NOSHADOW (1U<<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_MERGE_VISIBILITY (1U<<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_REQUEST_PHS (1U<<30) // This entity requested phs bitvector instead of pvsbitvector in AddToFullPack calls
|
||||||
// g-cont. one reserved bit here for me
|
// g-cont. one reserved bit here for me
|
||||||
|
|
||||||
// entity flags
|
// entity flags
|
||||||
@@ -606,13 +606,6 @@
|
|||||||
#define CONTENT_GRAVITY_FLYFIELD -18
|
#define CONTENT_GRAVITY_FLYFIELD -18
|
||||||
#define CONTENT_FOG -19
|
#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
|
// channels
|
||||||
#define CHAN_AUTO 0
|
#define CHAN_AUTO 0
|
||||||
#define CHAN_WEAPON 1
|
#define CHAN_WEAPON 1
|
||||||
@@ -647,22 +640,22 @@
|
|||||||
#define SF_TRAIN_PASSABLE 8 // Train is not solid -- used to make water trains
|
#define SF_TRAIN_PASSABLE 8 // Train is not solid -- used to make water trains
|
||||||
|
|
||||||
// buttons
|
// buttons
|
||||||
#define IN_ATTACK (1<<0)
|
#define IN_ATTACK (1U<<0)
|
||||||
#define IN_JUMP (1<<1)
|
#define IN_JUMP (1U<<1)
|
||||||
#define IN_DUCK (1<<2)
|
#define IN_DUCK (1U<<2)
|
||||||
#define IN_FORWARD (1<<3)
|
#define IN_FORWARD (1U<<3)
|
||||||
#define IN_BACK (1<<4)
|
#define IN_BACK (1U<<4)
|
||||||
#define IN_USE (1<<5)
|
#define IN_USE (1U<<5)
|
||||||
#define IN_CANCEL (1<<6)
|
#define IN_CANCEL (1U<<6)
|
||||||
#define IN_LEFT (1<<7)
|
#define IN_LEFT (1U<<7)
|
||||||
#define IN_RIGHT (1<<8)
|
#define IN_RIGHT (1U<<8)
|
||||||
#define IN_MOVELEFT (1<<9)
|
#define IN_MOVELEFT (1U<<9)
|
||||||
#define IN_MOVERIGHT (1<<10)
|
#define IN_MOVERIGHT (1U<<10)
|
||||||
#define IN_ATTACK2 (1<<11)
|
#define IN_ATTACK2 (1U<<11)
|
||||||
#define IN_RUN (1<<12)
|
#define IN_RUN (1U<<12)
|
||||||
#define IN_RELOAD (1<<13)
|
#define IN_RELOAD (1U<<13)
|
||||||
#define IN_ALT1 (1<<14)
|
#define IN_ALT1 (1U<<14)
|
||||||
#define IN_SCORE (1<<15) // Used by client.dll for when scoreboard is held down
|
#define IN_SCORE (1U<<15) // Used by client.dll for when scoreboard is held down
|
||||||
|
|
||||||
// Break Model Defines
|
// Break Model Defines
|
||||||
#define BREAK_TYPEMASK 0x4F
|
#define BREAK_TYPEMASK 0x4F
|
||||||
@@ -732,7 +725,6 @@ typedef int string_t;
|
|||||||
typedef unsigned short word;
|
typedef unsigned short word;
|
||||||
|
|
||||||
#include "xash3d_types.h"
|
#include "xash3d_types.h"
|
||||||
#define Q_isspace( ch ) (ch < 32 || ch > 255)
|
|
||||||
|
|
||||||
typedef struct
|
typedef struct
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -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_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_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_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
|
// Xash3D extensions
|
||||||
#define FCVAR_LATCH (1<<11) // notify client what this cvar will be applied only after server restart (but don't does more nothing)
|
|
||||||
#define FCVAR_GLCONFIG (1<<12) // write it into <renderer>.cfg(see RefAPI)
|
#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_CHANGED (1<<13) // set each time the cvar is changed
|
||||||
#define FCVAR_GAMEUIDLL (1<<14) // defined by the menu DLL
|
#define FCVAR_GAMEUIDLL (1<<14) // defined by the menu DLL
|
||||||
#define FCVAR_CHEAT (1<<15) // can not be changed if cheats are disabled
|
#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
|
typedef struct cvar_s
|
||||||
{
|
{
|
||||||
char *name;
|
char *name;
|
||||||
|
|||||||
@@ -47,7 +47,9 @@ SETUP BACKENDS DEFINITIONS
|
|||||||
#endif // XASH_TIMER
|
#endif // XASH_TIMER
|
||||||
|
|
||||||
#ifndef XASH_MESSAGEBOX
|
#ifndef XASH_MESSAGEBOX
|
||||||
#define XASH_MESSAGEBOX MSGBOX_SDL
|
#if !XASH_NSWITCH // SDL2 messageboxes not available
|
||||||
|
#define XASH_MESSAGEBOX MSGBOX_SDL
|
||||||
|
#endif
|
||||||
#endif // XASH_MESSAGEBOX
|
#endif // XASH_MESSAGEBOX
|
||||||
#endif
|
#endif
|
||||||
#elif XASH_ANDROID
|
#elif XASH_ANDROID
|
||||||
@@ -68,7 +70,8 @@ SETUP BACKENDS DEFINITIONS
|
|||||||
#define XASH_MESSAGEBOX MSGBOX_ANDROID
|
#define XASH_MESSAGEBOX MSGBOX_ANDROID
|
||||||
#endif // XASH_MESSAGEBOX
|
#endif // XASH_MESSAGEBOX
|
||||||
|
|
||||||
#define XASH_USE_EVDEV
|
#define XASH_USE_EVDEV 1
|
||||||
|
#define XASH_DYNAMIC_DLADDR
|
||||||
#elif XASH_LINUX
|
#elif XASH_LINUX
|
||||||
// we are building for Linux without SDL2, can draw only to framebuffer yet
|
// we are building for Linux without SDL2, can draw only to framebuffer yet
|
||||||
#ifndef XASH_VIDEO
|
#ifndef XASH_VIDEO
|
||||||
@@ -83,8 +86,18 @@ SETUP BACKENDS DEFINITIONS
|
|||||||
#define XASH_SOUND SOUND_ALSA
|
#define XASH_SOUND SOUND_ALSA
|
||||||
#endif // XASH_SOUND
|
#endif // XASH_SOUND
|
||||||
|
|
||||||
#define XASH_USE_EVDEV
|
#define XASH_USE_EVDEV 1
|
||||||
#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
|
#endif // XASH_DEDICATED
|
||||||
|
|
||||||
@@ -94,24 +107,13 @@ SETUP BACKENDS DEFINITIONS
|
|||||||
#ifndef XASH_MESSAGEBOX
|
#ifndef XASH_MESSAGEBOX
|
||||||
#if XASH_WIN32
|
#if XASH_WIN32
|
||||||
#define XASH_MESSAGEBOX MSGBOX_WIN32
|
#define XASH_MESSAGEBOX MSGBOX_WIN32
|
||||||
|
#elif XASH_NSWITCH
|
||||||
|
#define XASH_MESSAGEBOX MSGBOX_NSWITCH
|
||||||
#else // !XASH_WIN32
|
#else // !XASH_WIN32
|
||||||
#define XASH_MESSAGEBOX MSGBOX_STDERR
|
#define XASH_MESSAGEBOX MSGBOX_STDERR
|
||||||
#endif // !XASH_WIN32
|
#endif // !XASH_WIN32
|
||||||
#endif // XASH_MESSAGEBOX
|
#endif // XASH_MESSAGEBOX
|
||||||
|
|
||||||
//
|
|
||||||
// select crashhandler based on defines
|
|
||||||
//
|
|
||||||
#ifndef XASH_CRASHHANDLER
|
|
||||||
#if XASH_WIN32 && defined(DBGHELP)
|
|
||||||
#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
|
|
||||||
|
|
||||||
//
|
//
|
||||||
// no timer - no xash
|
// no timer - no xash
|
||||||
//
|
//
|
||||||
@@ -119,10 +121,20 @@ SETUP BACKENDS DEFINITIONS
|
|||||||
#if XASH_WIN32
|
#if XASH_WIN32
|
||||||
#define XASH_TIMER TIMER_WIN32
|
#define XASH_TIMER TIMER_WIN32
|
||||||
#else // !XASH_WIN32
|
#else // !XASH_WIN32
|
||||||
#define XASH_TIMER TIMER_LINUX
|
#define XASH_TIMER TIMER_POSIX
|
||||||
#endif // !XASH_WIN32
|
#endif // !XASH_WIN32
|
||||||
#endif
|
#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
|
// fallback to NULL
|
||||||
//
|
//
|
||||||
@@ -146,39 +158,53 @@ Default build-depended cvar and constant values
|
|||||||
=========================================================================
|
=========================================================================
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#if XASH_MOBILE_PLATFORM
|
// Platform overrides
|
||||||
#define DEFAULT_TOUCH_ENABLE "1"
|
#if XASH_NSWITCH
|
||||||
#define DEFAULT_M_IGNORE "1"
|
|
||||||
#else // !XASH_MOBILE_PLATFORM
|
|
||||||
#define DEFAULT_TOUCH_ENABLE "0"
|
#define DEFAULT_TOUCH_ENABLE "0"
|
||||||
#define DEFAULT_M_IGNORE "0"
|
#define DEFAULT_M_IGNORE "1"
|
||||||
#endif // !XASH_MOBILE_PLATFORM
|
#define DEFAULT_MODE_WIDTH 1280
|
||||||
|
#define DEFAULT_MODE_HEIGHT 720
|
||||||
|
#define DEFAULT_ALLOWCONSOLE 1
|
||||||
|
#elif XASH_PSVITA
|
||||||
|
#define DEFAULT_TOUCH_ENABLE "0"
|
||||||
|
#define DEFAULT_M_IGNORE "1"
|
||||||
|
#define DEFAULT_MODE_WIDTH 960
|
||||||
|
#define DEFAULT_MODE_HEIGHT 544
|
||||||
|
#define DEFAULT_ALLOWCONSOLE 1
|
||||||
|
#elif XASH_MOBILE_PLATFORM
|
||||||
|
#define DEFAULT_TOUCH_ENABLE "1"
|
||||||
|
#define DEFAULT_M_IGNORE "1"
|
||||||
|
#endif // !XASH_MOBILE_PLATFORM && !XASH_NSWITCH
|
||||||
|
|
||||||
#if XASH_ANDROID || XASH_IOS || XASH_EMSCRIPTEN
|
#if XASH_ANDROID || XASH_IOS || XASH_EMSCRIPTEN
|
||||||
#define XASH_INTERNAL_GAMELIBS
|
// this means that libraries are provided with engine, but not in game data
|
||||||
// this means that libraries are provided with engine, but not in game data
|
// You need add library loading code to library.c when adding new platform
|
||||||
// You need add library loading code to library.c when adding new platform
|
#define XASH_INTERNAL_GAMELIBS
|
||||||
#endif // XASH_ANDROID || XASH_IOS || XASH_EMSCRIPTEN
|
#endif // XASH_ANDROID || XASH_IOS || XASH_EMSCRIPTEN
|
||||||
|
|
||||||
// allow override for developer/debug builds
|
// Defaults
|
||||||
|
#ifndef DEFAULT_TOUCH_ENABLE
|
||||||
|
#define DEFAULT_TOUCH_ENABLE "0"
|
||||||
|
#endif // DEFAULT_TOUCH_ENABLE
|
||||||
|
|
||||||
|
#ifndef DEFAULT_M_IGNORE
|
||||||
|
#define DEFAULT_M_IGNORE "0"
|
||||||
|
#endif // DEFAULT_M_IGNORE
|
||||||
|
|
||||||
|
#ifndef DEFAULT_JOY_DEADZONE
|
||||||
|
#define DEFAULT_JOY_DEADZONE "4096"
|
||||||
|
#endif // DEFAULT_JOY_DEADZONE
|
||||||
|
|
||||||
#ifndef DEFAULT_DEV
|
#ifndef DEFAULT_DEV
|
||||||
#define DEFAULT_DEV 0
|
#define DEFAULT_DEV 0
|
||||||
#endif // DEFAULT_DEV
|
#endif // DEFAULT_DEV
|
||||||
|
|
||||||
|
#ifndef DEFAULT_ALLOWCONSOLE
|
||||||
|
#define DEFAULT_ALLOWCONSOLE 0
|
||||||
|
#endif // DEFAULT_ALLOWCONSOLE
|
||||||
|
|
||||||
#ifndef DEFAULT_FULLSCREEN
|
#ifndef DEFAULT_FULLSCREEN
|
||||||
#define DEFAULT_FULLSCREEN 1
|
#define DEFAULT_FULLSCREEN 1
|
||||||
#endif // DEFAULT_FULLSCREEN
|
#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
|
#endif // DEFAULTS_H
|
||||||
|
|||||||
@@ -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_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_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_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
|
#endif//FEATURES_H
|
||||||
|
|||||||
@@ -18,6 +18,7 @@ GNU General Public License for more details.
|
|||||||
|
|
||||||
#define GFL_NOMODELS (1<<0)
|
#define GFL_NOMODELS (1<<0)
|
||||||
#define GFL_NOSKILLS (1<<1)
|
#define GFL_NOSKILLS (1<<1)
|
||||||
|
#define GFL_RENDER_PICBUTTON_TEXT (1<<2)
|
||||||
|
|
||||||
/*
|
/*
|
||||||
========================================================================
|
========================================================================
|
||||||
|
|||||||
@@ -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 (*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 (*CancelRequest)( int context );
|
||||||
void (*CancelAllRequests)( void );
|
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 ( *CompareAdr)( struct netadr_s *a, struct netadr_s *b );
|
||||||
int ( *StringToAdr)( char *s, struct netadr_s *a );
|
int ( *StringToAdr)( char *s, struct netadr_s *a );
|
||||||
const char *(*ValueForKey)( const char *s, const char *key );
|
const char *(*ValueForKey)( const char *s, const char *key );
|
||||||
|
|||||||
@@ -16,22 +16,61 @@
|
|||||||
#ifndef NETADR_H
|
#ifndef NETADR_H
|
||||||
#define NETADR_H
|
#define NETADR_H
|
||||||
|
|
||||||
|
#include "build.h"
|
||||||
|
#include STDINT_H
|
||||||
|
|
||||||
typedef enum
|
typedef enum
|
||||||
{
|
{
|
||||||
NA_UNUSED,
|
NA_UNUSED = 0,
|
||||||
NA_LOOPBACK,
|
NA_LOOPBACK,
|
||||||
NA_BROADCAST,
|
NA_BROADCAST,
|
||||||
NA_IP,
|
NA_IP,
|
||||||
NA_IPX,
|
NA_IPX,
|
||||||
NA_BROADCAST_IPX
|
NA_BROADCAST_IPX,
|
||||||
|
NA_IP6,
|
||||||
|
NA_MULTICAST_IP6, // all nodes multicast
|
||||||
} netadrtype_t;
|
} netadrtype_t;
|
||||||
|
|
||||||
|
// Original structure:
|
||||||
|
// typedef struct netadr_s
|
||||||
|
// {
|
||||||
|
// netadrtype_t type;
|
||||||
|
// unsigned char ip[4];
|
||||||
|
// unsigned char ipx[10];
|
||||||
|
// unsigned short port;
|
||||||
|
// } netadr_t;
|
||||||
|
|
||||||
|
#pragma pack( push, 1 )
|
||||||
typedef struct netadr_s
|
typedef struct netadr_s
|
||||||
{
|
{
|
||||||
netadrtype_t type;
|
union
|
||||||
unsigned char ip[4];
|
{
|
||||||
unsigned char ipx[10];
|
struct
|
||||||
unsigned short port;
|
{
|
||||||
|
uint32_t type;
|
||||||
|
union
|
||||||
|
{
|
||||||
|
uint8_t ip[4];
|
||||||
|
uint32_t ip4;
|
||||||
|
};
|
||||||
|
uint8_t ipx[10];
|
||||||
|
};
|
||||||
|
struct
|
||||||
|
{
|
||||||
|
#if XASH_LITTLE_ENDIAN
|
||||||
|
uint16_t type6;
|
||||||
|
uint8_t ip6[16];
|
||||||
|
#elif XASH_BIG_ENDIAN
|
||||||
|
uint8_t ip6_0[2];
|
||||||
|
uint16_t type6;
|
||||||
|
uint8_t ip6_2[14];
|
||||||
|
#endif
|
||||||
|
};
|
||||||
|
};
|
||||||
|
uint16_t port;
|
||||||
} netadr_t;
|
} netadr_t;
|
||||||
|
#pragma pack( pop )
|
||||||
|
|
||||||
|
STATIC_ASSERT( sizeof( netadr_t ) == 20, "invalid netadr_t size" );
|
||||||
|
|
||||||
#endif//NETADR_H
|
#endif//NETADR_H
|
||||||
|
|||||||
@@ -20,74 +20,49 @@ GNU General Public License for more details.
|
|||||||
#include "build.h"
|
#include "build.h"
|
||||||
|
|
||||||
#if !XASH_WIN32
|
#if !XASH_WIN32
|
||||||
#include <dlfcn.h>
|
|
||||||
#include <unistd.h>
|
|
||||||
|
|
||||||
#define PATH_SPLITTER "/"
|
|
||||||
|
|
||||||
#if XASH_APPLE
|
#if XASH_APPLE
|
||||||
#include <sys/syslimits.h>
|
#include <sys/syslimits.h>
|
||||||
#include "TargetConditionals.h"
|
|
||||||
#define OS_LIB_EXT "dylib"
|
#define OS_LIB_EXT "dylib"
|
||||||
#define OPEN_COMMAND "open"
|
#define OPEN_COMMAND "open"
|
||||||
#else
|
#else
|
||||||
#define OS_LIB_EXT "so"
|
#define OS_LIB_EXT "so"
|
||||||
#define OPEN_COMMAND "xdg-open"
|
#define OPEN_COMMAND "xdg-open"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#define OS_LIB_PREFIX "lib"
|
#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
|
#define VGUI_SUPPORT_DLL "libvgui_support." OS_LIB_EXT
|
||||||
|
|
||||||
// Windows-specific
|
// Windows-specific
|
||||||
#define __cdecl
|
#define __cdecl
|
||||||
#define __stdcall
|
#define __stdcall
|
||||||
|
|
||||||
#define _inline static inline
|
#define _inline static inline
|
||||||
#define FORCEINLINE inline __attribute__((always_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
|
#if XASH_POSIX
|
||||||
#define _mkdir( x ) mkdir( x, S_IRWXU | S_IRWXG | S_IROTH | S_IXOTH )
|
#include <unistd.h>
|
||||||
#define LoadLibrary( x ) dlopen( x, RTLD_NOW )
|
#if XASH_NSWITCH
|
||||||
#define GetProcAddress( x, y ) dlsym( x, y )
|
#define SOLDER_LIBDL_COMPAT
|
||||||
#define SetCurrentDirectory( x ) (!chdir( x ))
|
#include <solder.h>
|
||||||
#define FreeLibrary( x ) dlclose( x )
|
#elif XASH_PSVITA
|
||||||
//#define MAKEWORD( a, b ) ((short int)(((unsigned char)(a))|(((short int)((unsigned char)(b)))<<8)))
|
#define VRTLD_LIBDL_COMPAT
|
||||||
#define max( a, b ) (((a) > (b)) ? (a) : (b))
|
#include <vrtld.h>
|
||||||
#define min( a, b ) (((a) < (b)) ? (a) : (b))
|
#define O_BINARY 0
|
||||||
#define tell( a ) lseek(a, 0, SEEK_CUR)
|
#else
|
||||||
|
#include <dlfcn.h>
|
||||||
typedef unsigned char BYTE;
|
#define HAVE_DUP
|
||||||
typedef short int WORD;
|
#define O_BINARY 0
|
||||||
typedef unsigned int DWORD;
|
#endif
|
||||||
typedef int LONG;
|
#define O_TEXT 0
|
||||||
typedef unsigned int ULONG;
|
#define _mkdir( x ) mkdir( x, S_IRWXU | S_IRWXG | S_IROTH | S_IXOTH )
|
||||||
typedef int WPARAM;
|
#endif
|
||||||
typedef unsigned int LPARAM;
|
|
||||||
|
|
||||||
typedef void* HANDLE;
|
typedef void* HANDLE;
|
||||||
typedef void* HMODULE;
|
|
||||||
typedef void* HINSTANCE;
|
typedef void* HINSTANCE;
|
||||||
|
|
||||||
typedef char* LPSTR;
|
|
||||||
|
|
||||||
typedef struct tagPOINT
|
typedef struct tagPOINT
|
||||||
{
|
{
|
||||||
int x, y;
|
int x, y;
|
||||||
} POINT;
|
} POINT;
|
||||||
#else // WIN32
|
#else // WIN32
|
||||||
#define PATH_SPLITTER "\\"
|
|
||||||
#ifdef __MINGW32__
|
#ifdef __MINGW32__
|
||||||
#define _inline static inline
|
#define _inline static inline
|
||||||
#define FORCEINLINE inline __attribute__((always_inline))
|
#define FORCEINLINE inline __attribute__((always_inline))
|
||||||
@@ -99,19 +74,6 @@ GNU General Public License for more details.
|
|||||||
#define read _read
|
#define read _read
|
||||||
#define alloca _alloca
|
#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 HSPRITE WINAPI_HSPRITE
|
||||||
#define WIN32_LEAN_AND_MEAN
|
#define WIN32_LEAN_AND_MEAN
|
||||||
#include <winsock2.h>
|
#include <winsock2.h>
|
||||||
@@ -121,11 +83,9 @@ GNU General Public License for more details.
|
|||||||
#define OS_LIB_PREFIX ""
|
#define OS_LIB_PREFIX ""
|
||||||
#define OS_LIB_EXT "dll"
|
#define OS_LIB_EXT "dll"
|
||||||
#define VGUI_SUPPORT_DLL "../vgui_support." OS_LIB_EXT
|
#define VGUI_SUPPORT_DLL "../vgui_support." OS_LIB_EXT
|
||||||
#ifdef XASH_64BIT
|
#define HAVE_DUP
|
||||||
// windows NameForFunction not implemented yet
|
|
||||||
#define XASH_ALLOW_SAVERESTORE_OFFSETS
|
|
||||||
#endif
|
|
||||||
#endif //WIN32
|
#endif //WIN32
|
||||||
|
|
||||||
#ifndef XASH_LOW_MEMORY
|
#ifndef XASH_LOW_MEMORY
|
||||||
#define XASH_LOW_MEMORY 0
|
#define XASH_LOW_MEMORY 0
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
@@ -82,7 +82,7 @@ typedef enum
|
|||||||
TF_KEEP_SOURCE = (1<<1), // some images keep source
|
TF_KEEP_SOURCE = (1<<1), // some images keep source
|
||||||
TF_NOFLIP_TGA = (1<<2), // Steam background completely ignore tga attribute 0x20
|
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_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_RECTANGLE = (1<<5), // this is GL_TEXTURE_RECTANGLE
|
||||||
TF_CUBEMAP = (1<<6), // it's cubemap texture
|
TF_CUBEMAP = (1<<6), // it's cubemap texture
|
||||||
TF_DEPTHMAP = (1<<7), // custom texture filter used
|
TF_DEPTHMAP = (1<<7), // custom texture filter used
|
||||||
@@ -107,20 +107,23 @@ typedef enum
|
|||||||
TF_ARB_FLOAT = (1<<26), // float textures
|
TF_ARB_FLOAT = (1<<26), // float textures
|
||||||
TF_NOCOMPARE = (1<<27), // disable comparing for depth textures
|
TF_NOCOMPARE = (1<<27), // disable comparing for depth textures
|
||||||
TF_ARB_16BIT = (1<<28), // keep image as 16-bit (not 24)
|
TF_ARB_16BIT = (1<<28), // keep image as 16-bit (not 24)
|
||||||
|
TF_MULTISAMPLE = (1<<29) // multisampling texture
|
||||||
} texFlags_t;
|
} texFlags_t;
|
||||||
|
|
||||||
typedef enum
|
typedef enum
|
||||||
{
|
{
|
||||||
CONTEXT_TYPE_GL = 0,
|
CONTEXT_TYPE_GL = 0, // compatibility profile
|
||||||
CONTEXT_TYPE_GLES_1_X,
|
CONTEXT_TYPE_GLES_1_X,
|
||||||
CONTEXT_TYPE_GLES_2_X
|
CONTEXT_TYPE_GLES_2_X,
|
||||||
|
CONTEXT_TYPE_GL_CORE
|
||||||
} gl_context_type_t;
|
} gl_context_type_t;
|
||||||
|
|
||||||
typedef enum
|
typedef enum
|
||||||
{
|
{
|
||||||
GLES_WRAPPER_NONE = 0, // native GLES
|
GLES_WRAPPER_NONE = 0, // native GL
|
||||||
GLES_WRAPPER_NANOGL, // used on GLES platforms
|
GLES_WRAPPER_NANOGL, // used on GLES platforms
|
||||||
GLES_WRAPPER_WES, // used on GLES platforms
|
GLES_WRAPPER_WES, // used on GLES platforms
|
||||||
|
GLES_WRAPPER_GL4ES, // used on GLES platforms
|
||||||
} gles_wrapper_t;
|
} gles_wrapper_t;
|
||||||
|
|
||||||
// 30 bytes here
|
// 30 bytes here
|
||||||
@@ -158,7 +161,7 @@ struct ref_viewpass_s;
|
|||||||
typedef struct render_api_s
|
typedef struct render_api_s
|
||||||
{
|
{
|
||||||
// Get renderer info (doesn't changes engine state at all)
|
// Get renderer info (doesn't changes engine state at all)
|
||||||
int (*RenderGetParm)( int parm, int arg ); // generic
|
intptr_t (*RenderGetParm)( int parm, int arg ); // generic
|
||||||
void (*GetDetailScaleForTexture)( int texture, float *xScale, float *yScale );
|
void (*GetDetailScaleForTexture)( int texture, float *xScale, float *yScale );
|
||||||
void (*GetExtraParmsForTexture)( int texture, byte *red, byte *green, byte *blue, byte *alpha );
|
void (*GetExtraParmsForTexture)( int texture, byte *red, byte *green, byte *blue, byte *alpha );
|
||||||
lightstyle_t* (*GetLightStyle)( int number );
|
lightstyle_t* (*GetLightStyle)( int number );
|
||||||
@@ -190,9 +193,9 @@ typedef struct render_api_s
|
|||||||
|
|
||||||
// AVIkit support
|
// AVIkit support
|
||||||
void *(*AVI_LoadVideo)( const char *filename, qboolean load_audio );
|
void *(*AVI_LoadVideo)( const char *filename, qboolean load_audio );
|
||||||
int (*AVI_GetVideoInfo)( void *Avi, long *xres, long *yres, float *duration );
|
int (*AVI_GetVideoInfo)( void *Avi, int *xres, int *yres, float *duration ); // a1ba: changed longs to int
|
||||||
long (*AVI_GetVideoFrameNumber)( void *Avi, float time );
|
int (*AVI_GetVideoFrameNumber)( void *Avi, float time );
|
||||||
byte *(*AVI_GetVideoFrame)( void *Avi, long frame );
|
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_UploadRawFrame)( int texture, int cols, int rows, int width, int height, const byte *data );
|
||||||
void (*AVI_FreeVideo)( void *Avi );
|
void (*AVI_FreeVideo)( void *Avi );
|
||||||
int (*AVI_IsActive)( void *Avi );
|
int (*AVI_IsActive)( void *Avi );
|
||||||
|
|||||||
@@ -12,16 +12,26 @@
|
|||||||
* without written permission from Valve LLC.
|
* without written permission from Valve LLC.
|
||||||
*
|
*
|
||||||
****/
|
****/
|
||||||
|
#pragma once
|
||||||
#ifndef STUDIO_EVENT_H
|
#ifndef STUDIO_EVENT_H
|
||||||
#define STUDIO_EVENT_H
|
#define STUDIO_EVENT_H
|
||||||
|
|
||||||
|
#define MAXEVENTSTRING 64
|
||||||
|
|
||||||
typedef struct mstudioevent_s
|
typedef struct mstudioevent_s
|
||||||
{
|
{
|
||||||
int frame;
|
// the frame at which this animation event occurs
|
||||||
int event;
|
int32_t frame;
|
||||||
int type;
|
|
||||||
char options[64];
|
// 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;
|
} mstudioevent_t;
|
||||||
|
|
||||||
#endif//STUDIO_EVENT_H
|
#endif // STUDIO_EVENT_H
|
||||||
|
|||||||
24
common/synctype.h
Normal file
24
common/synctype.h
Normal file
@@ -0,0 +1,24 @@
|
|||||||
|
/*
|
||||||
|
synctype.h -- shared synctype_t definition
|
||||||
|
Copyright (C) 1996-1997 Id Software, Inc.
|
||||||
|
Copyright (C) 2023 Alibek Omarov
|
||||||
|
|
||||||
|
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 2
|
||||||
|
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.
|
||||||
|
|
||||||
|
You should have received a copy of the GNU General Public License
|
||||||
|
along with this program; if not, write to the Free Software
|
||||||
|
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||||
|
*/
|
||||||
|
#ifndef SYNCTYPE_H
|
||||||
|
#define SYNCTYPE_H
|
||||||
|
typedef enum {ST_SYNC=0, ST_RAND } synctype_t;
|
||||||
|
#endif
|
||||||
@@ -2,11 +2,19 @@
|
|||||||
#ifndef XASH_TYPES_H
|
#ifndef XASH_TYPES_H
|
||||||
#define XASH_TYPES_H
|
#define XASH_TYPES_H
|
||||||
|
|
||||||
#ifdef _WIN32
|
#include "build.h"
|
||||||
|
|
||||||
|
#if XASH_IRIX
|
||||||
|
#include <port.h>
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#if XASH_WIN32
|
||||||
#include <wchar.h> // off_t
|
#include <wchar.h> // off_t
|
||||||
#endif // _WIN32
|
#endif // _WIN32
|
||||||
|
|
||||||
#include <sys/types.h> // off_t
|
#include <sys/types.h> // off_t
|
||||||
|
#include STDINT_H
|
||||||
|
#include <assert.h>
|
||||||
|
|
||||||
typedef unsigned char byte;
|
typedef unsigned char byte;
|
||||||
typedef int sound_t;
|
typedef int sound_t;
|
||||||
@@ -20,6 +28,12 @@ typedef byte rgb_t[3]; // unsigned byte colorpack
|
|||||||
typedef vec_t matrix3x4[3][4];
|
typedef vec_t matrix3x4[3][4];
|
||||||
typedef vec_t matrix4x4[4][4];
|
typedef vec_t matrix4x4[4][4];
|
||||||
|
|
||||||
|
#if XASH_64BIT
|
||||||
|
typedef uint32_t poolhandle_t;
|
||||||
|
#else
|
||||||
|
typedef void* poolhandle_t;
|
||||||
|
#endif
|
||||||
|
|
||||||
#undef true
|
#undef true
|
||||||
#undef false
|
#undef false
|
||||||
|
|
||||||
@@ -29,20 +43,14 @@ typedef enum { false, true } qboolean;
|
|||||||
typedef int qboolean;
|
typedef int qboolean;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if _MSC_VER == 1200
|
typedef uint64_t longtime_t;
|
||||||
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;
|
|
||||||
|
|
||||||
#define MAX_STRING 256 // generic string
|
#define MAX_STRING 256 // generic string
|
||||||
#define MAX_INFO_STRING 256 // infostrings are transmitted across network
|
#define MAX_INFO_STRING 256 // infostrings are transmitted across network
|
||||||
#define MAX_SERVERINFO_STRING 512 // server handles too many settings. expand to 1024?
|
#define MAX_SERVERINFO_STRING 512 // server handles too many settings. expand to 1024?
|
||||||
#define MAX_LOCALINFO_STRING 32768 // localinfo used on server and not sended to the clients
|
#define MAX_LOCALINFO_STRING 32768 // localinfo used on server and not sended to the clients
|
||||||
#define MAX_SYSPATH 1024 // system filepath
|
#define MAX_SYSPATH 1024 // system filepath
|
||||||
|
#define MAX_VA_STRING 1024 // string length returned by va()
|
||||||
#define MAX_PRINT_MSG 8192 // how many symbols can handle single call of Con_Printf or Con_DPrintf
|
#define MAX_PRINT_MSG 8192 // how many symbols can handle single call of Con_Printf or Con_DPrintf
|
||||||
#define MAX_TOKEN 2048 // parse token length
|
#define MAX_TOKEN 2048 // parse token length
|
||||||
#define MAX_MODS 512 // environment games that engine can keep visible
|
#define MAX_MODS 512 // environment games that engine can keep visible
|
||||||
@@ -69,21 +77,48 @@ typedef integer64 longtime_t;
|
|||||||
#define ColorIndex( c ) ((( c ) - '0' ) & 7 )
|
#define ColorIndex( c ) ((( c ) - '0' ) & 7 )
|
||||||
|
|
||||||
#if defined(__GNUC__)
|
#if defined(__GNUC__)
|
||||||
#ifdef __i386__
|
#ifdef __i386__
|
||||||
#define EXPORT __attribute__ ((visibility ("default"),force_align_arg_pointer))
|
#define EXPORT __attribute__ ((visibility ("default"),force_align_arg_pointer))
|
||||||
#define GAME_EXPORT __attribute((force_align_arg_pointer))
|
#define GAME_EXPORT __attribute((force_align_arg_pointer))
|
||||||
#else
|
#else
|
||||||
#define EXPORT __attribute__ ((visibility ("default")))
|
#define EXPORT __attribute__ ((visibility ("default")))
|
||||||
#define GAME_EXPORT
|
#define GAME_EXPORT
|
||||||
#endif
|
#endif
|
||||||
|
#define _format(x) __attribute__((format(printf, x, x+1)))
|
||||||
|
#define NORETURN __attribute__((noreturn))
|
||||||
#elif defined(_MSC_VER)
|
#elif defined(_MSC_VER)
|
||||||
#define EXPORT __declspec( dllexport )
|
#define EXPORT __declspec( dllexport )
|
||||||
#define GAME_EXPORT
|
#define GAME_EXPORT
|
||||||
|
#define _format(x)
|
||||||
|
#define NORETURN
|
||||||
#else
|
#else
|
||||||
#define EXPORT
|
#define EXPORT
|
||||||
#define GAME_EXPORT
|
#define GAME_EXPORT
|
||||||
|
#define _format(x)
|
||||||
|
#define NORETURN
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#if ( __GNUC__ >= 3 )
|
||||||
|
#define unlikely(x) __builtin_expect(x, 0)
|
||||||
|
#define likely(x) __builtin_expect(x, 1)
|
||||||
|
#elif defined( __has_builtin )
|
||||||
|
#if __has_builtin( __builtin_expect )
|
||||||
|
#define unlikely(x) __builtin_expect(x, 0)
|
||||||
|
#define likely(x) __builtin_expect(x, 1)
|
||||||
|
#else
|
||||||
|
#define unlikely(x) (x)
|
||||||
|
#define likely(x) (x)
|
||||||
|
#endif
|
||||||
|
#else
|
||||||
|
#define unlikely(x) (x)
|
||||||
|
#define likely(x) (x)
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#if defined( static_assert ) // C11 static_assert
|
||||||
|
#define STATIC_ASSERT static_assert
|
||||||
|
#else
|
||||||
|
#define STATIC_ASSERT( x, y ) extern int _static_assert_##__LINE__[( x ) ? 1 : -1]
|
||||||
|
#endif
|
||||||
|
|
||||||
#ifdef XASH_BIG_ENDIAN
|
#ifdef XASH_BIG_ENDIAN
|
||||||
#define LittleLong(x) (((int)(((x)&255)<<24)) + ((int)((((x)>>8)&255)<<16)) + ((int)(((x)>>16)&255)<<8) + (((x) >> 24)&255))
|
#define LittleLong(x) (((int)(((x)&255)<<24)) + ((int)((((x)>>8)&255)<<16)) + ((int)(((x)>>16)&255)<<8) + (((x) >> 24)&255))
|
||||||
@@ -119,9 +154,13 @@ typedef unsigned int dword;
|
|||||||
typedef unsigned int uint;
|
typedef unsigned int uint;
|
||||||
typedef char string[MAX_STRING];
|
typedef char string[MAX_STRING];
|
||||||
typedef struct file_s file_t; // normal file
|
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 struct stream_s stream_t; // sound stream for background music playing
|
||||||
typedef off_t fs_offset_t;
|
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
|
typedef struct dllfunc_s
|
||||||
{
|
{
|
||||||
@@ -137,7 +176,7 @@ typedef struct dll_info_s
|
|||||||
void *link; // hinstance of loading library
|
void *link; // hinstance of loading library
|
||||||
} dll_info_t;
|
} 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
|
// config strings are a general means of communication from
|
||||||
// the server to all connected clients.
|
// the server to all connected clients.
|
||||||
|
|||||||
@@ -16,6 +16,10 @@
|
|||||||
#ifndef ALIAS_H
|
#ifndef ALIAS_H
|
||||||
#define ALIAS_H
|
#define ALIAS_H
|
||||||
|
|
||||||
|
#include "build.h"
|
||||||
|
#include STDINT_H
|
||||||
|
#include "synctype.h"
|
||||||
|
|
||||||
/*
|
/*
|
||||||
==============================================================================
|
==============================================================================
|
||||||
|
|
||||||
@@ -39,16 +43,6 @@ Alias models are position independent, so the cache manager can move them.
|
|||||||
#define ALIAS_TRACER2 0x0040 // orange split trail + rotate
|
#define ALIAS_TRACER2 0x0040 // orange split trail + rotate
|
||||||
#define ALIAS_TRACER3 0x0080 // purple trail
|
#define ALIAS_TRACER3 0x0080 // purple trail
|
||||||
|
|
||||||
// must match definition in sprite.h
|
|
||||||
#ifndef SYNCTYPE_T
|
|
||||||
#define SYNCTYPE_T
|
|
||||||
typedef enum
|
|
||||||
{
|
|
||||||
ST_SYNC = 0,
|
|
||||||
ST_RAND
|
|
||||||
} synctype_t;
|
|
||||||
#endif
|
|
||||||
|
|
||||||
typedef enum
|
typedef enum
|
||||||
{
|
{
|
||||||
ALIAS_SINGLE = 0,
|
ALIAS_SINGLE = 0,
|
||||||
@@ -63,36 +57,42 @@ typedef enum
|
|||||||
|
|
||||||
typedef struct
|
typedef struct
|
||||||
{
|
{
|
||||||
int ident;
|
int32_t ident;
|
||||||
int version;
|
int32_t version;
|
||||||
vec3_t scale;
|
vec3_t scale;
|
||||||
vec3_t scale_origin;
|
vec3_t scale_origin;
|
||||||
float boundingradius;
|
float boundingradius;
|
||||||
vec3_t eyeposition;
|
vec3_t eyeposition;
|
||||||
int numskins;
|
int32_t numskins;
|
||||||
int skinwidth;
|
int32_t skinwidth;
|
||||||
int skinheight;
|
int32_t skinheight;
|
||||||
int numverts;
|
int32_t numverts;
|
||||||
int numtris;
|
int32_t numtris;
|
||||||
int numframes;
|
int32_t numframes;
|
||||||
synctype_t synctype;
|
uint32_t synctype; // was synctype_t
|
||||||
int flags;
|
int32_t flags;
|
||||||
float size;
|
float size;
|
||||||
} daliashdr_t;
|
} daliashdr_t;
|
||||||
|
|
||||||
|
STATIC_ASSERT( sizeof( daliashdr_t ) == 84, "invalid daliashdr_t size" );
|
||||||
|
|
||||||
typedef struct
|
typedef struct
|
||||||
{
|
{
|
||||||
int onseam;
|
int32_t onseam;
|
||||||
int s;
|
int32_t s;
|
||||||
int t;
|
int32_t t;
|
||||||
} stvert_t;
|
} stvert_t;
|
||||||
|
|
||||||
|
STATIC_ASSERT( sizeof( stvert_t ) == 12, "invalid stvert_t size" );
|
||||||
|
|
||||||
typedef struct dtriangle_s
|
typedef struct dtriangle_s
|
||||||
{
|
{
|
||||||
int facesfront;
|
int32_t facesfront;
|
||||||
int vertindex[3];
|
int32_t vertindex[3];
|
||||||
} dtriangle_t;
|
} dtriangle_t;
|
||||||
|
|
||||||
|
STATIC_ASSERT( sizeof( dtriangle_t ) == 16, "invalid dtriangle_t size" );
|
||||||
|
|
||||||
#define DT_FACES_FRONT 0x0010
|
#define DT_FACES_FRONT 0x0010
|
||||||
#define ALIAS_ONSEAM 0x0020
|
#define ALIAS_ONSEAM 0x0020
|
||||||
|
|
||||||
@@ -103,36 +103,50 @@ typedef struct
|
|||||||
char name[16]; // frame name from grabbing
|
char name[16]; // frame name from grabbing
|
||||||
} daliasframe_t;
|
} daliasframe_t;
|
||||||
|
|
||||||
|
STATIC_ASSERT( sizeof( daliasframe_t ) == 24, "invalid daliasframe_t size" );
|
||||||
|
|
||||||
typedef struct
|
typedef struct
|
||||||
{
|
{
|
||||||
int numframes;
|
int32_t numframes;
|
||||||
trivertex_t bboxmin; // lightnormal isn't used
|
trivertex_t bboxmin; // lightnormal isn't used
|
||||||
trivertex_t bboxmax; // lightnormal isn't used
|
trivertex_t bboxmax; // lightnormal isn't used
|
||||||
} daliasgroup_t;
|
} daliasgroup_t;
|
||||||
|
|
||||||
|
STATIC_ASSERT( sizeof( daliasgroup_t ) == 12, "invalid daliasgrou_t size" );
|
||||||
|
|
||||||
typedef struct
|
typedef struct
|
||||||
{
|
{
|
||||||
int numskins;
|
int32_t numskins;
|
||||||
} daliasskingroup_t;
|
} daliasskingroup_t;
|
||||||
|
|
||||||
|
STATIC_ASSERT( sizeof( daliasskingroup_t ) == 4, "invalid daliasskingroup_t size" );
|
||||||
|
|
||||||
typedef struct
|
typedef struct
|
||||||
{
|
{
|
||||||
float interval;
|
float interval;
|
||||||
} daliasinterval_t;
|
} daliasinterval_t;
|
||||||
|
|
||||||
|
STATIC_ASSERT( sizeof( daliasinterval_t ) == 4, "invalid daliasinterval_t size" );
|
||||||
|
|
||||||
typedef struct
|
typedef struct
|
||||||
{
|
{
|
||||||
float interval;
|
float interval;
|
||||||
} daliasskininterval_t;
|
} daliasskininterval_t;
|
||||||
|
|
||||||
|
STATIC_ASSERT( sizeof( daliasskininterval_t ) == 4, "invalid daliasskininterval_t size" );
|
||||||
|
|
||||||
typedef struct
|
typedef struct
|
||||||
{
|
{
|
||||||
aliasframetype_t type;
|
uint32_t type; // was aliasframetype_t
|
||||||
} daliasframetype_t;
|
} daliasframetype_t;
|
||||||
|
|
||||||
|
STATIC_ASSERT( sizeof( daliasframetype_t ) == 4, "invalid daliasframetype_t size" );
|
||||||
|
|
||||||
typedef struct
|
typedef struct
|
||||||
{
|
{
|
||||||
aliasskintype_t type;
|
uint32_t type; // was aliasskintype_t
|
||||||
} daliasskintype_t;
|
} daliasskintype_t;
|
||||||
|
|
||||||
|
STATIC_ASSERT( sizeof( daliasskintype_t ) == 4, "invalid daliasskintype_t size" );
|
||||||
|
|
||||||
#endif//ALIAS_H
|
#endif//ALIAS_H
|
||||||
|
|||||||
@@ -285,9 +285,9 @@ typedef struct cl_enginefuncs_s
|
|||||||
const char *(*LocalPlayerInfo_ValueForKey)( const char* key );
|
const char *(*LocalPlayerInfo_ValueForKey)( const char* key );
|
||||||
int (*pfnVGUI2DrawCharacter)( int x, int y, int ch, unsigned int font );
|
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 );
|
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* (*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 );
|
int (*pfnIsPlayingCareerMatch)( void );
|
||||||
void (*pfnPlaySoundVoiceByName)( char *szSound, float volume, int pitch );
|
void (*pfnPlaySoundVoiceByName)( char *szSound, float volume, int pitch );
|
||||||
void (*pfnPrimeMusicStream)( char *filename, int looping );
|
void (*pfnPrimeMusicStream)( char *filename, int looping );
|
||||||
|
|||||||
@@ -27,7 +27,6 @@ int AVI_GetAudioChunk( movie_state_t *Avi, char *audiodata, int offset, int leng
|
|||||||
void AVI_OpenVideo( movie_state_t *Avi, const char *filename, qboolean load_audio, int quiet );
|
void AVI_OpenVideo( movie_state_t *Avi, const char *filename, qboolean load_audio, int quiet );
|
||||||
movie_state_t *AVI_LoadVideo( const char *filename, qboolean load_audio );
|
movie_state_t *AVI_LoadVideo( const char *filename, qboolean load_audio );
|
||||||
int AVI_TimeToSoundPosition( movie_state_t *Avi, int time );
|
int AVI_TimeToSoundPosition( movie_state_t *Avi, int time );
|
||||||
int AVI_GetVideoFrameCount( movie_state_t *Avi );
|
|
||||||
void AVI_CloseVideo( movie_state_t *Avi );
|
void AVI_CloseVideo( movie_state_t *Avi );
|
||||||
qboolean AVI_IsActive( movie_state_t *Avi );
|
qboolean AVI_IsActive( movie_state_t *Avi );
|
||||||
void AVI_FreeVideo( movie_state_t *Avi );
|
void AVI_FreeVideo( movie_state_t *Avi );
|
||||||
|
|||||||
@@ -57,11 +57,6 @@ int AVI_TimeToSoundPosition( movie_state_t *Avi, int time )
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
int AVI_GetVideoFrameCount( movie_state_t *Avi )
|
|
||||||
{
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
void AVI_CloseVideo( movie_state_t *Avi )
|
void AVI_CloseVideo( movie_state_t *Avi )
|
||||||
{
|
{
|
||||||
;
|
;
|
||||||
|
|||||||
@@ -1,5 +1,6 @@
|
|||||||
/*
|
/*
|
||||||
avi_win.c - playing AVI files (based on original AVIKit code, Win32 version)
|
avi_win.c - playing AVI files (based on original AVIKit code, Win32 version)
|
||||||
|
Copyright (c) 2003-2004, Ruari O'Sullivan
|
||||||
Copyright (C) 2010 Uncle Mike
|
Copyright (C) 2010 Uncle Mike
|
||||||
|
|
||||||
This program is free software: you can redistribute it and/or modify
|
This program is free software: you can redistribute it and/or modify
|
||||||
@@ -59,14 +60,14 @@ dll_info_t msacm_dll = { "msacm32.dll", msacm_funcs, false };
|
|||||||
static int (_stdcall *pAVIStreamInfo)( PAVISTREAM pavi, AVISTREAMINFO *psi, LONG lSize );
|
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 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 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 void* (_stdcall *pAVIStreamGetFrame)( PGETFRAME pg, LONG lPos );
|
||||||
static int (_stdcall *pAVIStreamGetFrameClose)( PGETFRAME pg );
|
static int (_stdcall *pAVIStreamGetFrameClose)( PGETFRAME pg );
|
||||||
static dword (_stdcall *pAVIStreamRelease)( PAVISTREAM pavi );
|
static dword (_stdcall *pAVIStreamRelease)( PAVISTREAM pavi );
|
||||||
static int (_stdcall *pAVIFileOpen)( PAVIFILE *ppfile, LPCSTR szFile, UINT uMode, LPCLSID lpHandler );
|
static int (_stdcall *pAVIFileOpenW)( PAVIFILE *ppfile, LPCWSTR szFile, UINT uMode, LPCLSID lpHandler );
|
||||||
static int (_stdcall *pAVIFileGetStream)( PAVIFILE pfile, PAVISTREAM *ppavi, DWORD fccType, LONG lParam );
|
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 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 dword (_stdcall *pAVIFileRelease)( PAVIFILE pfile );
|
||||||
static void (_stdcall *pAVIFileInit)( void );
|
static void (_stdcall *pAVIFileInit)( void );
|
||||||
static void (_stdcall *pAVIFileExit)( void );
|
static void (_stdcall *pAVIFileExit)( void );
|
||||||
@@ -76,7 +77,7 @@ static dllfunc_t avifile_funcs[] =
|
|||||||
{ "AVIFileExit", (void **) &pAVIFileExit },
|
{ "AVIFileExit", (void **) &pAVIFileExit },
|
||||||
{ "AVIFileGetStream", (void **) &pAVIFileGetStream },
|
{ "AVIFileGetStream", (void **) &pAVIFileGetStream },
|
||||||
{ "AVIFileInit", (void **) &pAVIFileInit },
|
{ "AVIFileInit", (void **) &pAVIFileInit },
|
||||||
{ "AVIFileOpenA", (void **) &pAVIFileOpen },
|
{ "AVIFileOpenW", (void **) &pAVIFileOpenW },
|
||||||
{ "AVIFileRelease", (void **) &pAVIFileRelease },
|
{ "AVIFileRelease", (void **) &pAVIFileRelease },
|
||||||
{ "AVIStreamGetFrame", (void **) &pAVIStreamGetFrame },
|
{ "AVIStreamGetFrame", (void **) &pAVIStreamGetFrame },
|
||||||
{ "AVIStreamGetFrameClose", (void **) &pAVIStreamGetFrameClose },
|
{ "AVIStreamGetFrameClose", (void **) &pAVIStreamGetFrameClose },
|
||||||
@@ -100,17 +101,17 @@ typedef struct movie_state_s
|
|||||||
PAVIFILE pfile; // avi file pointer
|
PAVIFILE pfile; // avi file pointer
|
||||||
PAVISTREAM video_stream; // video stream pointer
|
PAVISTREAM video_stream; // video stream pointer
|
||||||
PGETFRAME video_getframe; // pointer to getframe object for video stream
|
PGETFRAME video_getframe; // pointer to getframe object for video stream
|
||||||
long video_frames; // total frames
|
int video_frames; // total frames
|
||||||
long video_xres; // video stream resolution
|
int video_xres; // video stream resolution
|
||||||
long video_yres;
|
int video_yres;
|
||||||
float video_fps; // video stream fps
|
float video_fps; // video stream fps
|
||||||
|
|
||||||
PAVISTREAM audio_stream; // audio stream pointer
|
PAVISTREAM audio_stream; // audio stream pointer
|
||||||
WAVEFORMAT *audio_header; // audio stream header
|
WAVEFORMAT *audio_header; // audio stream header
|
||||||
long audio_header_size; // WAVEFORMAT is returned for PCM data; WAVEFORMATEX for others
|
int audio_header_size; // WAVEFORMAT is returned for PCM data; WAVEFORMATEX for others
|
||||||
long audio_codec; // WAVE_FORMAT_PCM is oldstyle: anything else needs conversion
|
int audio_codec; // WAVE_FORMAT_PCM is oldstyle: anything else needs conversion
|
||||||
long audio_length; // in converted samples
|
int audio_length; // in converted samples
|
||||||
long audio_bytes_per_sample; // guess.
|
int audio_bytes_per_sample; // guess.
|
||||||
|
|
||||||
// compressed audio specific data
|
// compressed audio specific data
|
||||||
dword cpa_blockalign; // block size to read
|
dword cpa_blockalign; // block size to read
|
||||||
@@ -278,14 +279,6 @@ int AVI_GetVideoFrameNumber( movie_state_t *Avi, float time )
|
|||||||
return (time * Avi->video_fps);
|
return (time * Avi->video_fps);
|
||||||
}
|
}
|
||||||
|
|
||||||
int AVI_GetVideoFrameCount( movie_state_t *Avi )
|
|
||||||
{
|
|
||||||
if( !Avi->active )
|
|
||||||
return 0;
|
|
||||||
|
|
||||||
return Avi->video_frames;
|
|
||||||
}
|
|
||||||
|
|
||||||
int AVI_TimeToSoundPosition( movie_state_t *Avi, int time )
|
int AVI_TimeToSoundPosition( movie_state_t *Avi, int time )
|
||||||
{
|
{
|
||||||
if( !Avi->active || !Avi->audio_stream )
|
if( !Avi->active || !Avi->audio_stream )
|
||||||
@@ -296,7 +289,7 @@ int AVI_TimeToSoundPosition( movie_state_t *Avi, int time )
|
|||||||
}
|
}
|
||||||
|
|
||||||
// gets the raw frame data
|
// 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;
|
LPBITMAPINFOHEADER frame_info;
|
||||||
byte *frame_raw;
|
byte *frame_raw;
|
||||||
@@ -385,7 +378,7 @@ qboolean AVI_SeekPosition( movie_state_t *Avi, dword offset )
|
|||||||
// get a chunk of audio from the stream (in bytes)
|
// get a chunk of audio from the stream (in bytes)
|
||||||
int AVI_GetAudioChunk( movie_state_t *Avi, char *audiodata, int offset, int length )
|
int AVI_GetAudioChunk( movie_state_t *Avi, char *audiodata, int offset, int length )
|
||||||
{
|
{
|
||||||
long result = 0;
|
int result = 0;
|
||||||
int i;
|
int i;
|
||||||
|
|
||||||
// zero data past the end of the file
|
// zero data past the end of the file
|
||||||
@@ -393,7 +386,7 @@ int AVI_GetAudioChunk( movie_state_t *Avi, char *audiodata, int offset, int leng
|
|||||||
{
|
{
|
||||||
if( offset <= Avi->audio_length )
|
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 );
|
AVI_GetAudioChunk( Avi, audiodata, offset, remaining_length );
|
||||||
|
|
||||||
@@ -428,7 +421,7 @@ int AVI_GetAudioChunk( movie_state_t *Avi, char *audiodata, int offset, int leng
|
|||||||
|
|
||||||
while( length > 0 )
|
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
|
if( blockread <= 0 ) // read next
|
||||||
{
|
{
|
||||||
@@ -491,8 +484,9 @@ void AVI_OpenVideo( movie_state_t *Avi, const char *filename, qboolean load_audi
|
|||||||
{
|
{
|
||||||
BITMAPINFOHEADER bmih;
|
BITMAPINFOHEADER bmih;
|
||||||
AVISTREAMINFO stream_info;
|
AVISTREAMINFO stream_info;
|
||||||
long opened_streams = 0;
|
int opened_streams = 0;
|
||||||
LONG hr;
|
LONG hr;
|
||||||
|
wchar_t pathBuffer[MAX_PATH];
|
||||||
|
|
||||||
// default state: non-working.
|
// default state: non-working.
|
||||||
Avi->active = false;
|
Avi->active = false;
|
||||||
@@ -501,8 +495,15 @@ void AVI_OpenVideo( movie_state_t *Avi, const char *filename, qboolean load_audi
|
|||||||
// can't load Video For Windows :-(
|
// can't load Video For Windows :-(
|
||||||
if( !avi_initialized ) return;
|
if( !avi_initialized ) return;
|
||||||
|
|
||||||
|
// convert to wide char
|
||||||
|
if( MultiByteToWideChar( CP_UTF8, 0, filename, -1, pathBuffer, ARRAYSIZE( pathBuffer )) <= 0 )
|
||||||
|
{
|
||||||
|
Con_DPrintf( S_ERROR "filename buffer limit exceeded\n" );
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
// load the AVI
|
// load the AVI
|
||||||
hr = pAVIFileOpen( &Avi->pfile, filename, OF_SHARE_DENY_WRITE, 0L );
|
hr = pAVIFileOpenW( &Avi->pfile, pathBuffer, OF_SHARE_DENY_WRITE, 0L );
|
||||||
|
|
||||||
if( hr != 0 ) // error opening AVI:
|
if( hr != 0 ) // error opening AVI:
|
||||||
{
|
{
|
||||||
@@ -558,7 +559,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 )
|
else if( stream_info.fccType == streamtypeAUDIO && Avi->audio_stream == NULL && load_audio )
|
||||||
{
|
{
|
||||||
long size;
|
int size;
|
||||||
|
|
||||||
Avi->audio_stream = stream;
|
Avi->audio_stream = stream;
|
||||||
|
|
||||||
@@ -571,7 +572,7 @@ void AVI_OpenVideo( movie_state_t *Avi, const char *filename, qboolean load_audi
|
|||||||
Avi->audio_codec = Avi->audio_header->wFormatTag;
|
Avi->audio_codec = Avi->audio_header->wFormatTag;
|
||||||
|
|
||||||
// length of converted audio in samples
|
// 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;
|
Avi->audio_length *= Avi->audio_header->nSamplesPerSec;
|
||||||
|
|
||||||
if( Avi->audio_codec != WAVE_FORMAT_PCM )
|
if( Avi->audio_codec != WAVE_FORMAT_PCM )
|
||||||
@@ -657,7 +658,7 @@ movie_state_t *AVI_LoadVideo( const char *filename, qboolean load_audio )
|
|||||||
|
|
||||||
// open cinematic
|
// open cinematic
|
||||||
Q_snprintf( path, sizeof( path ), "media/%s", filename );
|
Q_snprintf( path, sizeof( path ), "media/%s", filename );
|
||||||
COM_DefaultExtension( path, ".avi" );
|
COM_DefaultExtension( path, ".avi", sizeof( path ));
|
||||||
fullpath = FS_GetDiskPath( path, false );
|
fullpath = FS_GetDiskPath( path, false );
|
||||||
|
|
||||||
if( FS_FileExists( path, false ) && !fullpath )
|
if( FS_FileExists( path, false ) && !fullpath )
|
||||||
|
|||||||
@@ -126,7 +126,7 @@ void CL_PlayCDTrack_f( void )
|
|||||||
int i, maxTrack;
|
int i, maxTrack;
|
||||||
|
|
||||||
for( maxTrack = i = 0; i < MAX_CDTRACKS; i++ )
|
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 );
|
Con_Printf( "%u tracks\n", maxTrack );
|
||||||
if( track )
|
if( track )
|
||||||
@@ -145,7 +145,7 @@ void CL_PlayCDTrack_f( void )
|
|||||||
CL_ScreenshotGetName
|
CL_ScreenshotGetName
|
||||||
==================
|
==================
|
||||||
*/
|
*/
|
||||||
qboolean CL_ScreenshotGetName( int lastnum, char *filename )
|
static qboolean CL_ScreenshotGetName( int lastnum, char *filename, size_t size )
|
||||||
{
|
{
|
||||||
if( lastnum < 0 || lastnum > 9999 )
|
if( lastnum < 0 || lastnum > 9999 )
|
||||||
{
|
{
|
||||||
@@ -153,9 +153,7 @@ qboolean CL_ScreenshotGetName( int lastnum, char *filename )
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
Q_sprintf( filename, "scrshots/%s_shot%0004d.png", clgame.mapname, lastnum );
|
return Q_snprintf( filename, size, "scrshots/%s_shot%04d.png", clgame.mapname, lastnum ) > 0;
|
||||||
|
|
||||||
return true;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
@@ -163,7 +161,7 @@ qboolean CL_ScreenshotGetName( int lastnum, char *filename )
|
|||||||
CL_SnapshotGetName
|
CL_SnapshotGetName
|
||||||
==================
|
==================
|
||||||
*/
|
*/
|
||||||
qboolean CL_SnapshotGetName( int lastnum, char *filename )
|
static qboolean CL_SnapshotGetName( int lastnum, char *filename, size_t size )
|
||||||
{
|
{
|
||||||
if( lastnum < 0 || lastnum > 9999 )
|
if( lastnum < 0 || lastnum > 9999 )
|
||||||
{
|
{
|
||||||
@@ -172,9 +170,7 @@ qboolean CL_SnapshotGetName( int lastnum, char *filename )
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
Q_sprintf( filename, "../%s_%0004d.png", clgame.mapname, lastnum );
|
return Q_snprintf( filename, size, "../%s_%04d.png", clgame.mapname, lastnum ) > 0;
|
||||||
|
|
||||||
return true;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
@@ -207,7 +203,7 @@ void CL_ScreenShot_f( void )
|
|||||||
// scan for a free filename
|
// scan for a free filename
|
||||||
for( i = 0; i < 9999; i++ )
|
for( i = 0; i < 9999; i++ )
|
||||||
{
|
{
|
||||||
if( !CL_ScreenshotGetName( i, checkname ))
|
if( !CL_ScreenshotGetName( i, checkname, sizeof( checkname )))
|
||||||
return; // no namespace
|
return; // no namespace
|
||||||
|
|
||||||
if( !FS_FileExists( checkname, false ))
|
if( !FS_FileExists( checkname, false ))
|
||||||
@@ -247,7 +243,7 @@ void CL_SnapShot_f( void )
|
|||||||
// scan for a free filename
|
// scan for a free filename
|
||||||
for( i = 0; i < 9999; i++ )
|
for( i = 0; i < 9999; i++ )
|
||||||
{
|
{
|
||||||
if( !CL_SnapshotGetName( i, checkname ))
|
if( !CL_SnapshotGetName( i, checkname, sizeof( checkname )))
|
||||||
return; // no namespace
|
return; // no namespace
|
||||||
|
|
||||||
if( !FS_FileExists( checkname, false ))
|
if( !FS_FileExists( checkname, false ))
|
||||||
@@ -278,7 +274,7 @@ void CL_EnvShot_f( void )
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
Q_sprintf( cls.shotname, "gfx/env/%s", Cmd_Argv( 1 ));
|
Q_snprintf( cls.shotname, sizeof( cls.shotname ), "gfx/env/%s", Cmd_Argv( 1 ));
|
||||||
cls.scrshot_action = scrshot_envshot; // build new frame for envshot
|
cls.scrshot_action = scrshot_envshot; // build new frame for envshot
|
||||||
cls.envshot_vieworg = NULL; // no custom view
|
cls.envshot_vieworg = NULL; // no custom view
|
||||||
cls.envshot_viewsize = 0;
|
cls.envshot_viewsize = 0;
|
||||||
@@ -299,7 +295,7 @@ void CL_SkyShot_f( void )
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
Q_sprintf( cls.shotname, "gfx/env/%s", Cmd_Argv( 1 ));
|
Q_snprintf( cls.shotname, sizeof( cls.shotname ),"gfx/env/%s", Cmd_Argv( 1 ));
|
||||||
cls.scrshot_action = scrshot_skyshot; // build new frame for skyshot
|
cls.scrshot_action = scrshot_skyshot; // build new frame for skyshot
|
||||||
cls.envshot_vieworg = NULL; // no custom view
|
cls.envshot_vieworg = NULL; // no custom view
|
||||||
cls.envshot_viewsize = 0;
|
cls.envshot_viewsize = 0;
|
||||||
@@ -323,7 +319,8 @@ void CL_LevelShot_f( void )
|
|||||||
// check for exist
|
// check for exist
|
||||||
if( cls.demoplayback && ( cls.demonum != -1 ))
|
if( cls.demoplayback && ( cls.demonum != -1 ))
|
||||||
{
|
{
|
||||||
Q_sprintf( cls.shotname, "levelshots/%s_%s.bmp", cls.demoname, refState.wideScreen ? "16x9" : "4x3" );
|
Q_snprintf( cls.shotname, sizeof( cls.shotname ),
|
||||||
|
"levelshots/%s_%s.bmp", cls.demoname, refState.wideScreen ? "16x9" : "4x3" );
|
||||||
Q_snprintf( filename, sizeof( filename ), "%s.dem", cls.demoname );
|
Q_snprintf( filename, sizeof( filename ), "%s.dem", cls.demoname );
|
||||||
|
|
||||||
// make sure what levelshot is newer than demo
|
// make sure what levelshot is newer than demo
|
||||||
@@ -332,7 +329,8 @@ void CL_LevelShot_f( void )
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
Q_sprintf( cls.shotname, "levelshots/%s_%s.bmp", clgame.mapname, refState.wideScreen ? "16x9" : "4x3" );
|
Q_snprintf( cls.shotname, sizeof( cls.shotname ),
|
||||||
|
"levelshots/%s_%s.bmp", clgame.mapname, refState.wideScreen ? "16x9" : "4x3" );
|
||||||
|
|
||||||
// make sure what levelshot is newer than bsp
|
// make sure what levelshot is newer than bsp
|
||||||
ft1 = FS_FileTime( cl.worldmodel->name, false );
|
ft1 = FS_FileTime( cl.worldmodel->name, false );
|
||||||
@@ -360,7 +358,7 @@ void CL_SaveShot_f( void )
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
Q_sprintf( cls.shotname, "%s%s.bmp", DEFAULT_SAVE_DIRECTORY, Cmd_Argv( 1 ));
|
Q_snprintf( cls.shotname, sizeof( cls.shotname ), DEFAULT_SAVE_DIRECTORY "%s.bmp", Cmd_Argv( 1 ));
|
||||||
cls.scrshot_action = scrshot_savegame; // build new frame for saveshot
|
cls.scrshot_action = scrshot_savegame; // build new frame for saveshot
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -418,3 +416,32 @@ void SCR_Viewpos_f( void )
|
|||||||
Con_Printf( "org ( %g %g %g )\n", refState.vieworg[0], refState.vieworg[1], refState.vieworg[2] );
|
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] );
|
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,7 +39,7 @@ qboolean CL_CheckFile( sizebuf_t *msg, resource_t *pResource )
|
|||||||
}
|
}
|
||||||
|
|
||||||
if( pResource->type == t_sound )
|
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 ));
|
else Q_strncpy( filepath, pResource->szFileName, sizeof( filepath ));
|
||||||
|
|
||||||
if( !COM_IsSafeFileToDownload( filepath ))
|
if( !COM_IsSafeFileToDownload( filepath ))
|
||||||
@@ -78,7 +78,7 @@ qboolean CL_CheckFile( sizebuf_t *msg, resource_t *pResource )
|
|||||||
}
|
}
|
||||||
|
|
||||||
MSG_BeginClientCmd( msg, clc_stringcmd );
|
MSG_BeginClientCmd( msg, clc_stringcmd );
|
||||||
MSG_WriteString( msg, va( "dlfile %s", filepath ));
|
MSG_WriteStringf( msg, "dlfile %s", filepath );
|
||||||
host.downloadcount++;
|
host.downloadcount++;
|
||||||
|
|
||||||
return false;
|
return false;
|
||||||
@@ -106,7 +106,7 @@ void CL_RemoveFromResourceList( resource_t *pResource )
|
|||||||
if( pResource->pPrev == NULL || pResource->pNext == NULL )
|
if( pResource->pPrev == NULL || pResource->pNext == NULL )
|
||||||
Host_Error( "mislinked resource in CL_RemoveFromResourceList\n" );
|
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" );
|
Host_Error( "attempt to free last entry in list.\n" );
|
||||||
|
|
||||||
pResource->pPrev->pNext = pResource->pNext;
|
pResource->pPrev->pNext = pResource->pNext;
|
||||||
|
|||||||
@@ -25,69 +25,6 @@ GNU General Public License for more details.
|
|||||||
#define MSG_COUNT 32 // last 32 messages parsed
|
#define MSG_COUNT 32 // last 32 messages parsed
|
||||||
#define MSG_MASK (MSG_COUNT - 1)
|
#define MSG_MASK (MSG_COUNT - 1)
|
||||||
|
|
||||||
const char *svc_strings[svc_lastmsg+1] =
|
|
||||||
{
|
|
||||||
"svc_bad",
|
|
||||||
"svc_nop",
|
|
||||||
"svc_disconnect",
|
|
||||||
"svc_event",
|
|
||||||
"svc_changing",
|
|
||||||
"svc_setview",
|
|
||||||
"svc_sound",
|
|
||||||
"svc_time",
|
|
||||||
"svc_print",
|
|
||||||
"svc_stufftext",
|
|
||||||
"svc_setangle",
|
|
||||||
"svc_serverdata",
|
|
||||||
"svc_lightstyle",
|
|
||||||
"svc_updateuserinfo",
|
|
||||||
"svc_deltatable",
|
|
||||||
"svc_clientdata",
|
|
||||||
"svc_resource",
|
|
||||||
"svc_pings",
|
|
||||||
"svc_particle",
|
|
||||||
"svc_restoresound",
|
|
||||||
"svc_spawnstatic",
|
|
||||||
"svc_event_reliable",
|
|
||||||
"svc_spawnbaseline",
|
|
||||||
"svc_temp_entity",
|
|
||||||
"svc_setpause",
|
|
||||||
"svc_signonnum",
|
|
||||||
"svc_centerprint",
|
|
||||||
"svc_unused27",
|
|
||||||
"svc_unused28",
|
|
||||||
"svc_unused29",
|
|
||||||
"svc_intermission",
|
|
||||||
"svc_finale",
|
|
||||||
"svc_cdtrack",
|
|
||||||
"svc_restore",
|
|
||||||
"svc_cutscene",
|
|
||||||
"svc_weaponanim",
|
|
||||||
"svc_bspdecal",
|
|
||||||
"svc_roomtype",
|
|
||||||
"svc_addangle",
|
|
||||||
"svc_usermessage",
|
|
||||||
"svc_packetentities",
|
|
||||||
"svc_deltapacketentities",
|
|
||||||
"svc_choke",
|
|
||||||
"svc_resourcelist",
|
|
||||||
"svc_deltamovevars",
|
|
||||||
"svc_resourcerequest",
|
|
||||||
"svc_customization",
|
|
||||||
"svc_crosshairangle",
|
|
||||||
"svc_soundfade",
|
|
||||||
"svc_filetxferfailed",
|
|
||||||
"svc_hltv",
|
|
||||||
"svc_director",
|
|
||||||
"svc_voiceinit",
|
|
||||||
"svc_voicedata",
|
|
||||||
"svc_deltapacketbones",
|
|
||||||
"svc_unused55",
|
|
||||||
"svc_resourcelocation",
|
|
||||||
"svc_querycvarvalue",
|
|
||||||
"svc_querycvarvalue2",
|
|
||||||
};
|
|
||||||
|
|
||||||
typedef struct
|
typedef struct
|
||||||
{
|
{
|
||||||
int command;
|
int command;
|
||||||
@@ -108,7 +45,7 @@ const char *CL_MsgInfo( int cmd )
|
|||||||
{
|
{
|
||||||
static string sz;
|
static string sz;
|
||||||
|
|
||||||
Q_strcpy( sz, "???" );
|
Q_strncpy( sz, "???", sizeof( sz ));
|
||||||
|
|
||||||
if( cmd >= 0 && cmd <= svc_lastmsg )
|
if( cmd >= 0 && cmd <= svc_lastmsg )
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -371,7 +371,7 @@ void CL_WriteDemoHeader( const char *name )
|
|||||||
|
|
||||||
demo.header.id = IDEMOHEADER;
|
demo.header.id = IDEMOHEADER;
|
||||||
demo.header.dem_protocol = DEMO_PROTOCOL;
|
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 );
|
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.mapname, clgame.mapname, sizeof( demo.header.mapname ));
|
||||||
Q_strncpy( demo.header.comment, clgame.maptitle, sizeof( demo.header.comment ));
|
Q_strncpy( demo.header.comment, clgame.maptitle, sizeof( demo.header.comment ));
|
||||||
@@ -518,14 +518,26 @@ CL_ReadDemoCmdHeader
|
|||||||
read the demo command
|
read the demo command
|
||||||
=================
|
=================
|
||||||
*/
|
*/
|
||||||
void CL_ReadDemoCmdHeader( byte *cmd, float *dt )
|
qboolean CL_ReadDemoCmdHeader( byte *cmd, float *dt )
|
||||||
{
|
{
|
||||||
// read the command
|
// read the command
|
||||||
FS_Read( cls.demofile, cmd, sizeof( byte ));
|
// HACKHACK: skip NOPs
|
||||||
Assert( *cmd >= 1 && *cmd <= dem_lastcmd );
|
do
|
||||||
|
{
|
||||||
|
FS_Read( cls.demofile, cmd, sizeof( byte ));
|
||||||
|
} while( *cmd == dem_unknown );
|
||||||
|
|
||||||
|
if( *cmd > dem_lastcmd )
|
||||||
|
{
|
||||||
|
Con_Printf( S_ERROR "Demo cmd %d > %d, file offset = %d\n", *cmd, dem_lastcmd, (int)FS_Tell( cls.demofile ));
|
||||||
|
CL_DemoCompleted();
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
// read the timestamp
|
// read the timestamp
|
||||||
FS_Read( cls.demofile, dt, sizeof( float ));
|
FS_Read( cls.demofile, dt, sizeof( float ));
|
||||||
|
|
||||||
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
@@ -888,7 +900,7 @@ qboolean CL_DemoReadMessage( byte *buffer, size_t *length )
|
|||||||
qboolean swallowmessages = true;
|
qboolean swallowmessages = true;
|
||||||
static int tdlastdemoframe = 0;
|
static int tdlastdemoframe = 0;
|
||||||
byte *userbuf = NULL;
|
byte *userbuf = NULL;
|
||||||
size_t size;
|
size_t size = 0;
|
||||||
byte cmd;
|
byte cmd;
|
||||||
|
|
||||||
if( !cls.demofile )
|
if( !cls.demofile )
|
||||||
@@ -913,7 +925,8 @@ qboolean CL_DemoReadMessage( byte *buffer, size_t *length )
|
|||||||
if( !cls.demofile ) break;
|
if( !cls.demofile ) break;
|
||||||
curpos = FS_Tell( cls.demofile );
|
curpos = FS_Tell( cls.demofile );
|
||||||
|
|
||||||
CL_ReadDemoCmdHeader( &cmd, &demo.timestamp );
|
if( !CL_ReadDemoCmdHeader( &cmd, &demo.timestamp ))
|
||||||
|
return false;
|
||||||
|
|
||||||
fElapsedTime = CL_GetDemoPlaybackClock() - demo.starttime;
|
fElapsedTime = CL_GetDemoPlaybackClock() - demo.starttime;
|
||||||
if( !cls.timedemo ) bSkipMessage = ((demo.timestamp - cl_serverframetime()) >= fElapsedTime) ? true : false;
|
if( !cls.timedemo ) bSkipMessage = ((demo.timestamp - cl_serverframetime()) >= fElapsedTime) ? true : false;
|
||||||
@@ -1171,7 +1184,7 @@ void CL_StopPlayback( void )
|
|||||||
CL_GetDemoComment
|
CL_GetDemoComment
|
||||||
==================
|
==================
|
||||||
*/
|
*/
|
||||||
int CL_GetDemoComment( const char *demoname, char *comment )
|
int GAME_EXPORT CL_GetDemoComment( const char *demoname, char *comment )
|
||||||
{
|
{
|
||||||
file_t *demfile;
|
file_t *demfile;
|
||||||
demoheader_t demohdr;
|
demoheader_t demohdr;
|
||||||
@@ -1185,7 +1198,7 @@ int CL_GetDemoComment( const char *demoname, char *comment )
|
|||||||
demfile = FS_Open( demoname, "rb", false );
|
demfile = FS_Open( demoname, "rb", false );
|
||||||
if( !demfile )
|
if( !demfile )
|
||||||
{
|
{
|
||||||
Q_strncpy( comment, "", MAX_STRING );
|
comment[0] = '\0';
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1199,7 +1212,9 @@ int CL_GetDemoComment( const char *demoname, char *comment )
|
|||||||
return false;
|
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 );
|
FS_Close( demfile );
|
||||||
Q_strncpy( comment, "<invalid protocol>", MAX_STRING );
|
Q_strncpy( comment, "<invalid protocol>", MAX_STRING );
|
||||||
@@ -1226,7 +1241,7 @@ int CL_GetDemoComment( const char *demoname, char *comment )
|
|||||||
// split comment to sections
|
// split comment to sections
|
||||||
Q_strncpy( comment, demohdr.mapname, CS_SIZE );
|
Q_strncpy( comment, demohdr.mapname, CS_SIZE );
|
||||||
Q_strncpy( comment + CS_SIZE, demohdr.comment, 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
|
// all done
|
||||||
FS_Close( demfile );
|
FS_Close( demfile );
|
||||||
@@ -1302,16 +1317,16 @@ void CL_CheckStartupDemos( void )
|
|||||||
CL_DemoGetName
|
CL_DemoGetName
|
||||||
==================
|
==================
|
||||||
*/
|
*/
|
||||||
static void CL_DemoGetName( int lastnum, char *filename )
|
static void CL_DemoGetName( int lastnum, char *filename, size_t size )
|
||||||
{
|
{
|
||||||
if( lastnum < 0 || lastnum > 9999 )
|
if( lastnum < 0 || lastnum > 9999 )
|
||||||
{
|
{
|
||||||
// bound
|
// bound
|
||||||
Q_strcpy( filename, "demo9999" );
|
Q_strncpy( filename, "demo9999.dem", size );
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
Q_sprintf( filename, "demo%0004d", lastnum );
|
Q_snprintf( filename, size, "demo%04d.dem", lastnum );
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
@@ -1365,8 +1380,8 @@ void CL_Record_f( void )
|
|||||||
// scan for a free filename
|
// scan for a free filename
|
||||||
for( n = 0; n < 10000; n++ )
|
for( n = 0; n < 10000; n++ )
|
||||||
{
|
{
|
||||||
CL_DemoGetName( n, demoname );
|
CL_DemoGetName( n, demoname, sizeof( demoname ));
|
||||||
if( !FS_FileExists( va( "%s.dem", demoname ), true ))
|
if( !FS_FileExists( demoname, true ))
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1379,9 +1394,9 @@ void CL_Record_f( void )
|
|||||||
else Q_strncpy( demoname, name, sizeof( demoname ));
|
else Q_strncpy( demoname, name, sizeof( demoname ));
|
||||||
|
|
||||||
// open the demo file
|
// open the demo file
|
||||||
Q_sprintf( demopath, "%s.dem", demoname );
|
Q_snprintf( demopath, sizeof( demopath ), "%s.dem", demoname );
|
||||||
|
|
||||||
// make sure what old demo is removed
|
// make sure that old demo is removed
|
||||||
if( FS_FileExists( demopath, false ))
|
if( FS_FileExists( demopath, false ))
|
||||||
FS_Delete( demopath );
|
FS_Delete( demopath );
|
||||||
|
|
||||||
@@ -1406,7 +1421,7 @@ void CL_PlayDemo_f( void )
|
|||||||
|
|
||||||
if( Cmd_Argc() < 2 )
|
if( Cmd_Argc() < 2 )
|
||||||
{
|
{
|
||||||
Con_Printf( S_USAGE "playdemo <demoname>\n" );
|
Con_Printf( S_USAGE "%s <demoname>\n", Cmd_Argv( 0 ));
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1476,13 +1491,17 @@ void CL_PlayDemo_f( void )
|
|||||||
return;
|
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 )
|
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 );
|
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();
|
CL_DemoAborted();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@@ -1515,6 +1534,7 @@ void CL_PlayDemo_f( void )
|
|||||||
|
|
||||||
// g-cont. is this need?
|
// g-cont. is this need?
|
||||||
Q_strncpy( cls.servername, demoname, sizeof( cls.servername ));
|
Q_strncpy( cls.servername, demoname, sizeof( cls.servername ));
|
||||||
|
cls.legacymode = demo.header.net_protocol == PROTOCOL_LEGACY_VERSION;
|
||||||
|
|
||||||
// begin a playback demo
|
// begin a playback demo
|
||||||
}
|
}
|
||||||
@@ -1528,12 +1548,6 @@ timedemo <demoname>
|
|||||||
*/
|
*/
|
||||||
void CL_TimeDemo_f( void )
|
void CL_TimeDemo_f( void )
|
||||||
{
|
{
|
||||||
if( Cmd_Argc() != 2 )
|
|
||||||
{
|
|
||||||
Con_Printf( S_USAGE "timedemo <demoname>\n" );
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
CL_PlayDemo_f ();
|
CL_PlayDemo_f ();
|
||||||
|
|
||||||
// cls.td_starttime will be grabbed at the second frame of the demo, so
|
// cls.td_starttime will be grabbed at the second frame of the demo, so
|
||||||
|
|||||||
@@ -18,7 +18,7 @@ GNU General Public License for more details.
|
|||||||
#include "studio.h"
|
#include "studio.h"
|
||||||
#include "world.h" // BOX_ON_PLANE_SIDE
|
#include "world.h" // BOX_ON_PLANE_SIDE
|
||||||
#include "client.h"
|
#include "client.h"
|
||||||
#include "mathlib.h"
|
#include "xash3d_mathlib.h"
|
||||||
|
|
||||||
/*
|
/*
|
||||||
===============================================================================
|
===============================================================================
|
||||||
@@ -33,46 +33,6 @@ static mnode_t *r_pefragtopnode;
|
|||||||
static vec3_t r_emins, r_emaxs;
|
static vec3_t r_emins, r_emaxs;
|
||||||
static cl_entity_t *r_addent;
|
static cl_entity_t *r_addent;
|
||||||
|
|
||||||
/*
|
|
||||||
================
|
|
||||||
R_RemoveEfrags
|
|
||||||
|
|
||||||
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;
|
|
||||||
while( 1 )
|
|
||||||
{
|
|
||||||
walk = *prev;
|
|
||||||
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;
|
|
||||||
}
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
===================
|
===================
|
||||||
R_SplitEntityOnNode
|
R_SplitEntityOnNode
|
||||||
@@ -188,8 +148,6 @@ void R_StoreEfrags( efrag_t **ppefrag, int framecount )
|
|||||||
case mod_brush:
|
case mod_brush:
|
||||||
case mod_studio:
|
case mod_studio:
|
||||||
case mod_sprite:
|
case mod_sprite:
|
||||||
pent = pefrag->entity;
|
|
||||||
|
|
||||||
if( pent->visframe != framecount )
|
if( pent->visframe != framecount )
|
||||||
{
|
{
|
||||||
if( CL_AddVisibleEntity( pent, ET_FRAGMENTED ))
|
if( CL_AddVisibleEntity( pent, ET_FRAGMENTED ))
|
||||||
|
|||||||
@@ -39,14 +39,14 @@ R_LookupColor
|
|||||||
find nearest color in particle palette
|
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;
|
int i, best;
|
||||||
float diff, bestdiff;
|
float diff, bestdiff;
|
||||||
float rf, gf, bf;
|
float rf, gf, bf;
|
||||||
|
|
||||||
bestdiff = 999999;
|
bestdiff = 999999;
|
||||||
best = 65535;
|
best = -1;
|
||||||
|
|
||||||
for( i = 0; i < 256; i++ )
|
for( i = 0; i < 256; i++ )
|
||||||
{
|
{
|
||||||
@@ -74,7 +74,7 @@ R_GetPackedColor
|
|||||||
in hardware mode does nothing
|
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;
|
if( packed ) *packed = 0;
|
||||||
}
|
}
|
||||||
@@ -140,26 +140,6 @@ void CL_FreeParticles( void )
|
|||||||
cl_particles = NULL;
|
cl_particles = NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
|
||||||
================
|
|
||||||
CL_FreeParticle
|
|
||||||
|
|
||||||
move particle to freelist
|
|
||||||
================
|
|
||||||
*/
|
|
||||||
void CL_FreeParticle( particle_t *p )
|
|
||||||
{
|
|
||||||
if( p->deathfunc )
|
|
||||||
{
|
|
||||||
// call right the deathfunc before die
|
|
||||||
p->deathfunc( p );
|
|
||||||
p->deathfunc = NULL;
|
|
||||||
}
|
|
||||||
|
|
||||||
p->next = cl_free_particles;
|
|
||||||
cl_free_particles = p;
|
|
||||||
}
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
================
|
================
|
||||||
CL_AllocParticleFast
|
CL_AllocParticleFast
|
||||||
@@ -187,7 +167,7 @@ R_AllocParticle
|
|||||||
can return NULL if particles is out
|
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;
|
particle_t *p;
|
||||||
|
|
||||||
@@ -513,19 +493,19 @@ void CL_ReadLineFile_f( void )
|
|||||||
|
|
||||||
while( 1 )
|
while( 1 )
|
||||||
{
|
{
|
||||||
pfile = COM_ParseFile( pfile, token );
|
pfile = COM_ParseFile( pfile, token, sizeof( token ));
|
||||||
if( !pfile ) break;
|
if( !pfile ) break;
|
||||||
p1[0] = Q_atof( token );
|
p1[0] = Q_atof( token );
|
||||||
|
|
||||||
pfile = COM_ParseFile( pfile, token );
|
pfile = COM_ParseFile( pfile, token, sizeof( token ));
|
||||||
if( !pfile ) break;
|
if( !pfile ) break;
|
||||||
p1[1] = Q_atof( token );
|
p1[1] = Q_atof( token );
|
||||||
|
|
||||||
pfile = COM_ParseFile( pfile, token );
|
pfile = COM_ParseFile( pfile, token, sizeof( token ));
|
||||||
if( !pfile ) break;
|
if( !pfile ) break;
|
||||||
p1[2] = Q_atof( token );
|
p1[2] = Q_atof( token );
|
||||||
|
|
||||||
pfile = COM_ParseFile( pfile, token );
|
pfile = COM_ParseFile( pfile, token, sizeof( token ));
|
||||||
if( !pfile ) break;
|
if( !pfile ) break;
|
||||||
|
|
||||||
if( token[0] != '-' )
|
if( token[0] != '-' )
|
||||||
@@ -534,15 +514,15 @@ void CL_ReadLineFile_f( void )
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
pfile = COM_ParseFile( pfile, token );
|
pfile = COM_ParseFile( pfile, token, sizeof( token ));
|
||||||
if( !pfile ) break;
|
if( !pfile ) break;
|
||||||
p2[0] = Q_atof( token );
|
p2[0] = Q_atof( token );
|
||||||
|
|
||||||
pfile = COM_ParseFile( pfile, token );
|
pfile = COM_ParseFile( pfile, token, sizeof( token ));
|
||||||
if( !pfile ) break;
|
if( !pfile ) break;
|
||||||
p2[1] = Q_atof( token );
|
p2[1] = Q_atof( token );
|
||||||
|
|
||||||
pfile = COM_ParseFile( pfile, token );
|
pfile = COM_ParseFile( pfile, token, sizeof( token ));
|
||||||
if( !pfile ) break;
|
if( !pfile ) break;
|
||||||
p2[2] = Q_atof( token );
|
p2[2] = Q_atof( token );
|
||||||
|
|
||||||
@@ -654,7 +634,7 @@ Remove beam attached to specified entity
|
|||||||
and all particle trails (if this is a beamfollow)
|
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;
|
cl_entity_t *pDeadEntity;
|
||||||
|
|
||||||
@@ -683,42 +663,46 @@ void CL_ParseViewBeam( sizebuf_t *msg, int beamType )
|
|||||||
switch( beamType )
|
switch( beamType )
|
||||||
{
|
{
|
||||||
case TE_BEAMPOINTS:
|
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:
|
case TE_BEAMENTPOINT:
|
||||||
startEnt = MSG_ReadShort( msg );
|
case TE_BEAMENTS:
|
||||||
end[0] = MSG_ReadCoord( msg );
|
if( beamType == TE_BEAMENTS )
|
||||||
end[1] = MSG_ReadCoord( msg );
|
{
|
||||||
end[2] = MSG_ReadCoord( msg );
|
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 );
|
modelIndex = MSG_ReadShort( msg );
|
||||||
startFrame = MSG_ReadByte( msg );
|
startFrame = MSG_ReadByte( msg );
|
||||||
frameRate = (float)MSG_ReadByte( msg );
|
frameRate = (float)MSG_ReadByte( msg ) * 0.1f;
|
||||||
life = (float)(MSG_ReadByte( msg ) * 0.1f);
|
life = (float)MSG_ReadByte( msg ) * 0.1f;
|
||||||
width = (float)(MSG_ReadByte( msg ) * 0.1f);
|
width = (float)MSG_ReadByte( msg ) * 0.1f;
|
||||||
noise = (float)(MSG_ReadByte( msg ) * 0.01f);
|
noise = (float)MSG_ReadByte( msg ) * 0.01f;
|
||||||
r = (float)MSG_ReadByte( msg ) / 255.0f;
|
r = (float)MSG_ReadByte( msg ) / 255.0f;
|
||||||
g = (float)MSG_ReadByte( msg ) / 255.0f;
|
g = (float)MSG_ReadByte( msg ) / 255.0f;
|
||||||
b = (float)MSG_ReadByte( msg ) / 255.0f;
|
b = (float)MSG_ReadByte( msg ) / 255.0f;
|
||||||
a = (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_BeamEntPoint( startEnt, end, modelIndex, life, width, noise, a, speed, startFrame, frameRate, r, g, b );
|
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;
|
break;
|
||||||
case TE_LIGHTNING:
|
case TE_LIGHTNING:
|
||||||
start[0] = MSG_ReadCoord( msg );
|
start[0] = MSG_ReadCoord( msg );
|
||||||
@@ -727,27 +711,11 @@ void CL_ParseViewBeam( sizebuf_t *msg, int beamType )
|
|||||||
end[0] = MSG_ReadCoord( msg );
|
end[0] = MSG_ReadCoord( msg );
|
||||||
end[1] = MSG_ReadCoord( msg );
|
end[1] = MSG_ReadCoord( msg );
|
||||||
end[2] = MSG_ReadCoord( msg );
|
end[2] = MSG_ReadCoord( msg );
|
||||||
life = (float)(MSG_ReadByte( msg ) * 0.1f);
|
life = (float)MSG_ReadByte( msg ) * 0.1f;
|
||||||
width = (float)(MSG_ReadByte( msg ) * 0.1f);
|
width = (float)MSG_ReadByte( msg ) * 0.1f;
|
||||||
noise = (float)(MSG_ReadByte( msg ) * 0.01f);
|
noise = (float)MSG_ReadByte( msg ) * 0.01f;
|
||||||
modelIndex = MSG_ReadShort( msg );
|
modelIndex = MSG_ReadShort( msg );
|
||||||
R_BeamLightning( start, end, modelIndex, life, width, noise, 0.6F, 3.5f );
|
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 );
|
|
||||||
break;
|
break;
|
||||||
case TE_BEAM:
|
case TE_BEAM:
|
||||||
break;
|
break;
|
||||||
@@ -773,21 +741,21 @@ void CL_ParseViewBeam( sizebuf_t *msg, int beamType )
|
|||||||
end[2] = MSG_ReadCoord( msg );
|
end[2] = MSG_ReadCoord( msg );
|
||||||
modelIndex = MSG_ReadShort( msg );
|
modelIndex = MSG_ReadShort( msg );
|
||||||
startFrame = MSG_ReadByte( msg );
|
startFrame = MSG_ReadByte( msg );
|
||||||
frameRate = (float)(MSG_ReadByte( msg ));
|
frameRate = (float)MSG_ReadByte( msg ) * 0.1f;
|
||||||
life = (float)(MSG_ReadByte( msg ) * 0.1f);
|
life = (float)MSG_ReadByte( msg ) * 0.1f;
|
||||||
width = (float)(MSG_ReadByte( msg ));
|
width = (float)MSG_ReadByte( msg );
|
||||||
noise = (float)(MSG_ReadByte( msg ) * 0.1f);
|
noise = (float)MSG_ReadByte( msg ) * 0.01f;
|
||||||
r = (float)MSG_ReadByte( msg ) / 255.0f;
|
r = (float)MSG_ReadByte( msg ) / 255.0f;
|
||||||
g = (float)MSG_ReadByte( msg ) / 255.0f;
|
g = (float)MSG_ReadByte( msg ) / 255.0f;
|
||||||
b = (float)MSG_ReadByte( msg ) / 255.0f;
|
b = (float)MSG_ReadByte( msg ) / 255.0f;
|
||||||
a = (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 );
|
R_BeamCirclePoints( beamType, start, end, modelIndex, life, width, noise, a, speed, startFrame, frameRate, r, g, b );
|
||||||
break;
|
break;
|
||||||
case TE_BEAMFOLLOW:
|
case TE_BEAMFOLLOW:
|
||||||
startEnt = MSG_ReadShort( msg );
|
startEnt = MSG_ReadShort( msg );
|
||||||
modelIndex = 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 );
|
width = (float)MSG_ReadByte( msg );
|
||||||
r = (float)MSG_ReadByte( msg ) / 255.0f;
|
r = (float)MSG_ReadByte( msg ) / 255.0f;
|
||||||
g = (float)MSG_ReadByte( msg ) / 255.0f;
|
g = (float)MSG_ReadByte( msg ) / 255.0f;
|
||||||
@@ -800,15 +768,15 @@ void CL_ParseViewBeam( sizebuf_t *msg, int beamType )
|
|||||||
endEnt = MSG_ReadShort( msg );
|
endEnt = MSG_ReadShort( msg );
|
||||||
modelIndex = MSG_ReadShort( msg );
|
modelIndex = MSG_ReadShort( msg );
|
||||||
startFrame = MSG_ReadByte( msg );
|
startFrame = MSG_ReadByte( msg );
|
||||||
frameRate = (float)MSG_ReadByte( msg );
|
frameRate = (float)MSG_ReadByte( msg ) * 0.1f;
|
||||||
life = (float)(MSG_ReadByte( msg ) * 0.1f);
|
life = (float)MSG_ReadByte( msg ) * 0.1f;
|
||||||
width = (float)(MSG_ReadByte( msg ) * 0.1f);
|
width = (float)MSG_ReadByte( msg ) * 0.1f;
|
||||||
noise = (float)(MSG_ReadByte( msg ) * 0.01f);
|
noise = (float)MSG_ReadByte( msg ) * 0.01f;
|
||||||
r = (float)MSG_ReadByte( msg ) / 255.0f;
|
r = (float)MSG_ReadByte( msg ) / 255.0f;
|
||||||
g = (float)MSG_ReadByte( msg ) / 255.0f;
|
g = (float)MSG_ReadByte( msg ) / 255.0f;
|
||||||
b = (float)MSG_ReadByte( msg ) / 255.0f;
|
b = (float)MSG_ReadByte( msg ) / 255.0f;
|
||||||
a = (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 );
|
R_BeamRing( startEnt, endEnt, modelIndex, life, width, noise, a, speed, startFrame, frameRate, r, g, b );
|
||||||
break;
|
break;
|
||||||
case TE_BEAMHOSE:
|
case TE_BEAMHOSE:
|
||||||
@@ -828,7 +796,7 @@ R_BeamEnts
|
|||||||
Create beam between two ents
|
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 )
|
float speed, int startFrame, float framerate, float r, float g, float b )
|
||||||
{
|
{
|
||||||
cl_entity_t *start, *end;
|
cl_entity_t *start, *end;
|
||||||
@@ -873,7 +841,7 @@ R_BeamPoints
|
|||||||
Create beam between two points
|
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 )
|
float brightness, float speed, int startFrame, float framerate, float r, float g, float b )
|
||||||
{
|
{
|
||||||
BEAM *pbeam;
|
BEAM *pbeam;
|
||||||
@@ -904,7 +872,7 @@ R_BeamCirclePoints
|
|||||||
Create beam cicrle
|
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 )
|
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 );
|
BEAM *pbeam = R_BeamLightning( start, end, modelIndex, life, width, amplitude, brightness, speed );
|
||||||
@@ -925,7 +893,7 @@ R_BeamEntPoint
|
|||||||
Create beam between entity and point
|
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 )
|
float brightness, float speed, int startFrame, float framerate, float r, float g, float b )
|
||||||
{
|
{
|
||||||
BEAM *pbeam;
|
BEAM *pbeam;
|
||||||
@@ -965,7 +933,7 @@ R_BeamRing
|
|||||||
Create beam between two ents
|
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 )
|
float speed, int startFrame, float framerate, float r, float g, float b )
|
||||||
{
|
{
|
||||||
BEAM *pbeam;
|
BEAM *pbeam;
|
||||||
@@ -1001,7 +969,7 @@ R_BeamFollow
|
|||||||
Create beam following with entity
|
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();
|
BEAM *pbeam = R_BeamAlloc();
|
||||||
|
|
||||||
@@ -1030,7 +998,7 @@ R_BeamLightning
|
|||||||
template for new beams
|
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();
|
BEAM *pbeam = R_BeamAlloc();
|
||||||
|
|
||||||
@@ -1054,7 +1022,7 @@ R_EntityParticles
|
|||||||
set EF_BRIGHTFIELD effect
|
set EF_BRIGHTFIELD effect
|
||||||
===============
|
===============
|
||||||
*/
|
*/
|
||||||
void R_EntityParticles( cl_entity_t *ent )
|
void GAME_EXPORT R_EntityParticles( cl_entity_t *ent )
|
||||||
{
|
{
|
||||||
float angle;
|
float angle;
|
||||||
float sr, sp, sy, cr, cp, cy;
|
float sr, sp, sy, cr, cp, cy;
|
||||||
@@ -1089,7 +1057,7 @@ R_ParticleExplosion
|
|||||||
|
|
||||||
===============
|
===============
|
||||||
*/
|
*/
|
||||||
void R_ParticleExplosion( const vec3_t org )
|
void GAME_EXPORT R_ParticleExplosion( const vec3_t org )
|
||||||
{
|
{
|
||||||
particle_t *p;
|
particle_t *p;
|
||||||
int i, j;
|
int i, j;
|
||||||
@@ -1120,12 +1088,16 @@ 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 i, j;
|
||||||
int colorMod = 0;
|
int colorMod = 0, packedColor;
|
||||||
particle_t *p;
|
particle_t *p;
|
||||||
|
|
||||||
|
if( FBitSet( host.features, ENGINE_QUAKE_COMPATIBLE ))
|
||||||
|
packedColor = 255; // use old code for blob particles
|
||||||
|
else packedColor = 0;
|
||||||
|
|
||||||
for( i = 0; i < 512; i++ )
|
for( i = 0; i < 512; i++ )
|
||||||
{
|
{
|
||||||
p = R_AllocParticle( NULL );
|
p = R_AllocParticle( NULL );
|
||||||
@@ -1133,7 +1105,7 @@ void R_ParticleExplosion2( const vec3_t org, int colorStart, int colorLength )
|
|||||||
|
|
||||||
p->die = cl.time + 0.3f;
|
p->die = cl.time + 0.3f;
|
||||||
p->color = colorStart + ( colorMod % colorLength );
|
p->color = colorStart + ( colorMod % colorLength );
|
||||||
p->packedColor = 255; // use old code for blob particles
|
p->packedColor = packedColor;
|
||||||
colorMod++;
|
colorMod++;
|
||||||
|
|
||||||
p->type = pt_blob;
|
p->type = pt_blob;
|
||||||
@@ -1152,18 +1124,22 @@ R_BlobExplosion
|
|||||||
|
|
||||||
===============
|
===============
|
||||||
*/
|
*/
|
||||||
void R_BlobExplosion( const vec3_t org )
|
void GAME_EXPORT R_BlobExplosion( const vec3_t org )
|
||||||
{
|
{
|
||||||
particle_t *p;
|
particle_t *p;
|
||||||
int i, j;
|
int i, j, packedColor;
|
||||||
|
|
||||||
|
if( FBitSet( host.features, ENGINE_QUAKE_COMPATIBLE ))
|
||||||
|
packedColor = 255; // use old code for blob particles
|
||||||
|
else packedColor = 0;
|
||||||
|
|
||||||
for( i = 0; i < 1024; i++ )
|
for( i = 0; i < 1024; i++ )
|
||||||
{
|
{
|
||||||
p = R_AllocParticle( NULL );
|
p = R_AllocParticle( NULL );
|
||||||
if( !p ) return;
|
if( !p ) return;
|
||||||
|
|
||||||
p->die = cl.time + COM_RandomFloat( 2.0f, 2.4f );
|
p->die = cl.time + COM_RandomFloat( 1.0f, 1.4f );
|
||||||
p->packedColor = 255; // use old code for blob particles
|
p->packedColor = packedColor;
|
||||||
|
|
||||||
if( i & 1 )
|
if( i & 1 )
|
||||||
{
|
{
|
||||||
@@ -1191,7 +1167,7 @@ ParticleEffect
|
|||||||
PARTICLE_EFFECT on server
|
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;
|
particle_t *p;
|
||||||
int i;
|
int i;
|
||||||
@@ -1224,7 +1200,7 @@ R_Blood
|
|||||||
particle spray
|
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;
|
vec3_t pos, dir, vec;
|
||||||
float pspeed = speed * 3.0f;
|
float pspeed = speed * 3.0f;
|
||||||
@@ -1260,12 +1236,12 @@ R_BloodStream
|
|||||||
particle spray 2
|
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;
|
particle_t *p;
|
||||||
int i, j;
|
int i, j;
|
||||||
float arc;
|
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++ )
|
for( arc = 0.05f, i = 0; i < 100; i++ )
|
||||||
{
|
{
|
||||||
@@ -1337,7 +1313,7 @@ R_LavaSplash
|
|||||||
|
|
||||||
===============
|
===============
|
||||||
*/
|
*/
|
||||||
void R_LavaSplash( const vec3_t org )
|
void GAME_EXPORT R_LavaSplash( const vec3_t org )
|
||||||
{
|
{
|
||||||
particle_t *p;
|
particle_t *p;
|
||||||
float vel;
|
float vel;
|
||||||
@@ -1379,7 +1355,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;
|
particle_t *p;
|
||||||
vec3_t dir, dest;
|
vec3_t dir, dest;
|
||||||
@@ -1412,7 +1388,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;
|
particle_t *p;
|
||||||
float vel, dist;
|
float vel, dist;
|
||||||
@@ -1459,7 +1435,7 @@ R_TeleportSplash
|
|||||||
|
|
||||||
===============
|
===============
|
||||||
*/
|
*/
|
||||||
void R_TeleportSplash( const vec3_t org )
|
void GAME_EXPORT R_TeleportSplash( const vec3_t org )
|
||||||
{
|
{
|
||||||
particle_t *p;
|
particle_t *p;
|
||||||
vec3_t dir;
|
vec3_t dir;
|
||||||
@@ -1501,7 +1477,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;
|
vec3_t vec, right, up;
|
||||||
static int tracercount;
|
static int tracercount;
|
||||||
@@ -1620,7 +1596,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;
|
int pcolor;
|
||||||
|
|
||||||
@@ -1634,7 +1610,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 mins, maxs;
|
||||||
vec3_t origin;
|
vec3_t origin;
|
||||||
@@ -1655,7 +1631,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;
|
vec3_t dir, org;
|
||||||
float len;
|
float len;
|
||||||
@@ -1687,7 +1663,7 @@ R_BulletImpactParticles
|
|||||||
|
|
||||||
===============
|
===============
|
||||||
*/
|
*/
|
||||||
void R_BulletImpactParticles( const vec3_t pos )
|
void GAME_EXPORT R_BulletImpactParticles( const vec3_t pos )
|
||||||
{
|
{
|
||||||
int i, quantity;
|
int i, quantity;
|
||||||
int color;
|
int color;
|
||||||
@@ -1729,7 +1705,7 @@ R_FlickerParticles
|
|||||||
|
|
||||||
===============
|
===============
|
||||||
*/
|
*/
|
||||||
void R_FlickerParticles( const vec3_t org )
|
void GAME_EXPORT R_FlickerParticles( const vec3_t org )
|
||||||
{
|
{
|
||||||
particle_t *p;
|
particle_t *p;
|
||||||
int i;
|
int i;
|
||||||
@@ -1757,7 +1733,7 @@ R_StreakSplash
|
|||||||
create a splash of streaks
|
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;
|
vec3_t vel, vel2;
|
||||||
particle_t *p;
|
particle_t *p;
|
||||||
@@ -1822,7 +1798,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;
|
vec3_t pos, vel, dir;
|
||||||
float len, speed;
|
float len, speed;
|
||||||
@@ -1849,7 +1825,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;
|
particle_t *p;
|
||||||
|
|
||||||
@@ -1884,7 +1860,7 @@ R_SparkStreaks
|
|||||||
create a streak tracers
|
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;
|
particle_t *p;
|
||||||
vec3_t vel;
|
vec3_t vel;
|
||||||
@@ -1912,7 +1888,7 @@ R_Implosion
|
|||||||
make implosion tracers
|
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 );
|
float dist = ( radius / 100.0f );
|
||||||
vec3_t start, temp, vel;
|
vec3_t start, temp, vel;
|
||||||
@@ -2020,15 +1996,15 @@ void CL_ReadPointFile_f( void )
|
|||||||
|
|
||||||
while( 1 )
|
while( 1 )
|
||||||
{
|
{
|
||||||
pfile = COM_ParseFile( pfile, token );
|
pfile = COM_ParseFile( pfile, token, sizeof( token ));
|
||||||
if( !pfile ) break;
|
if( !pfile ) break;
|
||||||
org[0] = Q_atof( token );
|
org[0] = Q_atof( token );
|
||||||
|
|
||||||
pfile = COM_ParseFile( pfile, token );
|
pfile = COM_ParseFile( pfile, token, sizeof( token ));
|
||||||
if( !pfile ) break;
|
if( !pfile ) break;
|
||||||
org[1] = Q_atof( token );
|
org[1] = Q_atof( token );
|
||||||
|
|
||||||
pfile = COM_ParseFile( pfile, token );
|
pfile = COM_ParseFile( pfile, token, sizeof( token ));
|
||||||
if( !pfile ) break;
|
if( !pfile ) break;
|
||||||
org[2] = Q_atof( token );
|
org[2] = Q_atof( token );
|
||||||
|
|
||||||
@@ -2152,6 +2128,7 @@ void CL_ThinkParticle( double frametime, particle_t *p )
|
|||||||
p->vel[2] -= grav;
|
p->vel[2] -= grav;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
// intentionally fallthrough
|
||||||
case pt_blob2:
|
case pt_blob2:
|
||||||
if( p->packedColor == 255 )
|
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;
|
con_nprint_t info;
|
||||||
|
string origin_str = { 0 }; //, angles_str = { 0 };
|
||||||
|
|
||||||
if( !eventname || !cl_showevents->value )
|
if( !cl_showevents->value )
|
||||||
return;
|
return;
|
||||||
|
|
||||||
// mark reliable as green and unreliable as red
|
info.time_to_live = 1.0f;
|
||||||
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.index = idx;
|
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,7 +158,7 @@ CL_EventIndex
|
|||||||
*/
|
*/
|
||||||
word CL_EventIndex( const char *name )
|
word CL_EventIndex( const char *name )
|
||||||
{
|
{
|
||||||
int i;
|
word i;
|
||||||
|
|
||||||
if( !COM_CheckString( name ))
|
if( !COM_CheckString( name ))
|
||||||
return 0;
|
return 0;
|
||||||
@@ -202,7 +227,7 @@ qboolean CL_FireEvent( event_info_t *ei, int slot )
|
|||||||
{
|
{
|
||||||
if( ev->func )
|
if( ev->func )
|
||||||
{
|
{
|
||||||
CL_DescribeEvent( slot, ei->flags, cl.event_precache[ei->index] );
|
CL_DescribeEvent( ei, slot );
|
||||||
ev->func( &ei->args );
|
ev->func( &ei->args );
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
@@ -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 )
|
float *angles, float fparam1, float fparam2, int iparam1, int iparam2, int bparam1, int bparam2 )
|
||||||
{
|
{
|
||||||
event_args_t args;
|
event_args_t args;
|
||||||
@@ -459,7 +484,7 @@ void CL_PlaybackEvent( int flags, const edict_t *pInvoker, word eventindex, floa
|
|||||||
return;
|
return;
|
||||||
|
|
||||||
// first check event for out of bounds
|
// 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 );
|
Con_DPrintf( S_ERROR "CL_PlaybackEvent: invalid eventindex %i\n", eventindex );
|
||||||
return;
|
return;
|
||||||
|
|||||||
350
engine/client/cl_font.c
Normal file
350
engine/client/cl_font.c
Normal file
@@ -0,0 +1,350 @@
|
|||||||
|
/*
|
||||||
|
cl_font.c - bare bones engine font manager
|
||||||
|
Copyright (C) 2023 Alibek Omarov
|
||||||
|
|
||||||
|
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 "filesystem.h"
|
||||||
|
#include "client.h"
|
||||||
|
#include "qfont.h"
|
||||||
|
|
||||||
|
qboolean CL_FixedFont( cl_font_t *font )
|
||||||
|
{
|
||||||
|
return font && font->valid && font->type == FONT_FIXED;
|
||||||
|
}
|
||||||
|
|
||||||
|
static int CL_LoadFontTexture( const char *fontname, uint texFlags, int *width )
|
||||||
|
{
|
||||||
|
int font_width;
|
||||||
|
int tex;
|
||||||
|
|
||||||
|
if( !g_fsapi.FileExists( fontname, false ))
|
||||||
|
return 0;
|
||||||
|
|
||||||
|
tex = ref.dllFuncs.GL_LoadTexture( fontname, NULL, 0, texFlags );
|
||||||
|
if( !tex )
|
||||||
|
return 0;
|
||||||
|
|
||||||
|
font_width = REF_GET_PARM( PARM_TEX_WIDTH, tex );
|
||||||
|
if( !font_width )
|
||||||
|
{
|
||||||
|
ref.dllFuncs.GL_FreeTexture( tex );
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
*width = font_width;
|
||||||
|
return tex;
|
||||||
|
}
|
||||||
|
|
||||||
|
qboolean Con_LoadFixedWidthFont( const char *fontname, cl_font_t *font, float scale, int rendermode, uint texFlags )
|
||||||
|
{
|
||||||
|
int font_width, i;
|
||||||
|
|
||||||
|
if( font->valid )
|
||||||
|
return true; // already loaded
|
||||||
|
|
||||||
|
font->hFontTexture = CL_LoadFontTexture( fontname, texFlags, &font_width );
|
||||||
|
if( !font->hFontTexture )
|
||||||
|
return false;
|
||||||
|
|
||||||
|
font->type = FONT_FIXED;
|
||||||
|
font->valid = true;
|
||||||
|
font->scale = scale;
|
||||||
|
font->nearest = FBitSet( texFlags, TF_NEAREST );
|
||||||
|
font->rendermode = rendermode;
|
||||||
|
font->charHeight = Q_rint( font_width / 16 * scale );
|
||||||
|
|
||||||
|
for( i = 0; i < ARRAYSIZE( font->fontRc ); i++ )
|
||||||
|
{
|
||||||
|
font->fontRc[i].left = ( i * font_width / 16 ) % font_width;
|
||||||
|
font->fontRc[i].right = font->fontRc[i].left + font_width / 16;
|
||||||
|
font->fontRc[i].top = ( i / 16 ) * ( font_width / 16 );
|
||||||
|
font->fontRc[i].bottom = font->fontRc[i].top + font_width / 16;
|
||||||
|
|
||||||
|
font->charWidths[i] = Q_rint( font_width / 16 * scale );
|
||||||
|
}
|
||||||
|
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
qboolean Con_LoadVariableWidthFont( const char *fontname, cl_font_t *font, float scale, int rendermode, uint texFlags )
|
||||||
|
{
|
||||||
|
fs_offset_t length;
|
||||||
|
qfont_t src;
|
||||||
|
byte *pfile;
|
||||||
|
int font_width, i;
|
||||||
|
|
||||||
|
if( font->valid )
|
||||||
|
return true;
|
||||||
|
|
||||||
|
pfile = g_fsapi.LoadFile( fontname, &length, false );
|
||||||
|
if( !pfile )
|
||||||
|
return false;
|
||||||
|
|
||||||
|
if( length < sizeof( src ))
|
||||||
|
{
|
||||||
|
Mem_Free( pfile );
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
memcpy( &src, pfile, sizeof( src ));
|
||||||
|
Mem_Free( pfile );
|
||||||
|
|
||||||
|
font->hFontTexture = CL_LoadFontTexture( fontname, texFlags, &font_width );
|
||||||
|
if( !font->hFontTexture )
|
||||||
|
return false;
|
||||||
|
|
||||||
|
font->type = FONT_VARIABLE;
|
||||||
|
font->valid = true;
|
||||||
|
font->scale = scale;
|
||||||
|
font->nearest = FBitSet( texFlags, TF_NEAREST );
|
||||||
|
font->rendermode = rendermode;
|
||||||
|
font->charHeight = Q_rint( src.rowheight * scale );
|
||||||
|
|
||||||
|
for( i = 0; i < ARRAYSIZE( font->fontRc ); i++ )
|
||||||
|
{
|
||||||
|
const charinfo *ci = &src.fontinfo[i];
|
||||||
|
|
||||||
|
font->fontRc[i].left = (word)ci->startoffset % font_width;
|
||||||
|
font->fontRc[i].right = font->fontRc[i].left + ci->charwidth;
|
||||||
|
font->fontRc[i].top = (word)ci->startoffset / font_width;
|
||||||
|
font->fontRc[i].bottom = font->fontRc[i].top + src.rowheight;
|
||||||
|
|
||||||
|
font->charWidths[i] = Q_rint( src.fontinfo[i].charwidth * scale );
|
||||||
|
}
|
||||||
|
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
void CL_FreeFont( cl_font_t *font )
|
||||||
|
{
|
||||||
|
if( !font || !font->valid )
|
||||||
|
return;
|
||||||
|
|
||||||
|
ref.dllFuncs.GL_FreeTexture( font->hFontTexture );
|
||||||
|
memset( font, 0, sizeof( *font ));
|
||||||
|
}
|
||||||
|
|
||||||
|
static int CL_CalcTabStop( const cl_font_t *font, int x )
|
||||||
|
{
|
||||||
|
int space = font->charWidths[' '];
|
||||||
|
int tab = space * 6; // 6 spaces
|
||||||
|
int stop = tab - x % tab;
|
||||||
|
|
||||||
|
if( stop < space )
|
||||||
|
return tab * 2 - x % tab; // select next
|
||||||
|
|
||||||
|
return stop;
|
||||||
|
}
|
||||||
|
|
||||||
|
int CL_DrawCharacter( float x, float y, int number, rgba_t color, cl_font_t *font, int flags )
|
||||||
|
{
|
||||||
|
wrect_t *rc;
|
||||||
|
float w, h;
|
||||||
|
float s1, t1, s2, t2, half = 0.5f;
|
||||||
|
int texw, texh;
|
||||||
|
|
||||||
|
if( !font || !font->valid || y < -font->charHeight )
|
||||||
|
return 0;
|
||||||
|
|
||||||
|
// check if printable
|
||||||
|
if( number <= 32 )
|
||||||
|
{
|
||||||
|
if( number == ' ' )
|
||||||
|
return font->charWidths[' '];
|
||||||
|
else if( number == '\t' )
|
||||||
|
return CL_CalcTabStop( font, x );
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
if( FBitSet( flags, FONT_DRAW_UTF8 ))
|
||||||
|
number = Con_UtfProcessChar( number & 255 );
|
||||||
|
else number &= 255;
|
||||||
|
|
||||||
|
if( !number || !font->charWidths[number])
|
||||||
|
return 0;
|
||||||
|
|
||||||
|
R_GetTextureParms( &texw, &texh, font->hFontTexture );
|
||||||
|
if( !texw || !texh )
|
||||||
|
return font->charWidths[number];
|
||||||
|
|
||||||
|
rc = &font->fontRc[number];
|
||||||
|
if( font->nearest || font->scale <= 1.0f )
|
||||||
|
half = 0;
|
||||||
|
|
||||||
|
s1 = ((float)rc->left + half ) / texw;
|
||||||
|
t1 = ((float)rc->top + half ) / texh;
|
||||||
|
s2 = ((float)rc->right - half ) / texw;
|
||||||
|
t2 = ((float)rc->bottom - half ) / texh;
|
||||||
|
w = ( rc->right - rc->left ) * font->scale;
|
||||||
|
h = ( rc->bottom - rc->top ) * font->scale;
|
||||||
|
|
||||||
|
if( FBitSet( flags, FONT_DRAW_HUD ))
|
||||||
|
SPR_AdjustSize( &x, &y, &w, &h );
|
||||||
|
|
||||||
|
if( !FBitSet( flags, FONT_DRAW_NORENDERMODE ))
|
||||||
|
ref.dllFuncs.GL_SetRenderMode( font->rendermode );
|
||||||
|
|
||||||
|
// don't apply color to fixed fonts it's already colored
|
||||||
|
if( font->type != FONT_FIXED || REF_GET_PARM( PARM_TEX_GLFORMAT, font->hFontTexture ) == 0x8045 ) // GL_LUMINANCE8_ALPHA8
|
||||||
|
ref.dllFuncs.Color4ub( color[0], color[1], color[2], color[3] );
|
||||||
|
else ref.dllFuncs.Color4ub( 255, 255, 255, color[3] );
|
||||||
|
ref.dllFuncs.R_DrawStretchPic( x, y, w, h, s1, t1, s2, t2, font->hFontTexture );
|
||||||
|
|
||||||
|
return font->charWidths[number];
|
||||||
|
}
|
||||||
|
|
||||||
|
int CL_DrawString( float x, float y, const char *s, rgba_t color, cl_font_t *font, int flags )
|
||||||
|
{
|
||||||
|
rgba_t current_color;
|
||||||
|
int draw_len = 0;
|
||||||
|
|
||||||
|
if( !font || !font->valid )
|
||||||
|
return 0;
|
||||||
|
|
||||||
|
if( FBitSet( flags, FONT_DRAW_UTF8 ))
|
||||||
|
Con_UtfProcessChar( 0 ); // clear utf state
|
||||||
|
|
||||||
|
if( !FBitSet( flags, FONT_DRAW_NORENDERMODE ))
|
||||||
|
ref.dllFuncs.GL_SetRenderMode( font->rendermode );
|
||||||
|
|
||||||
|
Vector4Copy( color, current_color );
|
||||||
|
|
||||||
|
while( *s )
|
||||||
|
{
|
||||||
|
if( *s == '\n' )
|
||||||
|
{
|
||||||
|
s++;
|
||||||
|
|
||||||
|
if( !*s )
|
||||||
|
break;
|
||||||
|
|
||||||
|
// some client functions ignore newlines
|
||||||
|
if( !FBitSet( flags, FONT_DRAW_NOLF ))
|
||||||
|
{
|
||||||
|
draw_len = 0;
|
||||||
|
y += font->charHeight;
|
||||||
|
}
|
||||||
|
|
||||||
|
if( FBitSet( flags, FONT_DRAW_RESETCOLORONLF ))
|
||||||
|
Vector4Copy( color, current_color );
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
|
if( IsColorString( s ))
|
||||||
|
{
|
||||||
|
// don't copy alpha
|
||||||
|
if( !FBitSet( flags, FONT_DRAW_FORCECOL ))
|
||||||
|
VectorCopy( g_color_table[ColorIndex(*( s + 1 ))], current_color );
|
||||||
|
|
||||||
|
s += 2;
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
|
// skip setting rendermode, it was changed for this string already
|
||||||
|
draw_len += CL_DrawCharacter( x + draw_len, y, (byte)*s, current_color, font, flags | FONT_DRAW_NORENDERMODE );
|
||||||
|
|
||||||
|
s++;
|
||||||
|
}
|
||||||
|
|
||||||
|
return draw_len;
|
||||||
|
}
|
||||||
|
|
||||||
|
int CL_DrawStringf( cl_font_t *font, float x, float y, rgba_t color, int flags, const char *fmt, ... )
|
||||||
|
{
|
||||||
|
va_list va;
|
||||||
|
char buf[MAX_VA_STRING];
|
||||||
|
|
||||||
|
va_start( va, fmt );
|
||||||
|
Q_vsnprintf( buf, sizeof( buf ), fmt, va );
|
||||||
|
va_end( va );
|
||||||
|
|
||||||
|
return CL_DrawString( x, y, buf, color, font, flags );
|
||||||
|
}
|
||||||
|
|
||||||
|
void CL_DrawCharacterLen( cl_font_t *font, int number, int *width, int *height )
|
||||||
|
{
|
||||||
|
if( !font || !font->valid ) return;
|
||||||
|
if( width )
|
||||||
|
{
|
||||||
|
if( number == '\t' )
|
||||||
|
*width = CL_CalcTabStop( font, 0 ); // at least return max tabstop
|
||||||
|
else *width = font->charWidths[number & 255];
|
||||||
|
}
|
||||||
|
if( height ) *height = font->charHeight;
|
||||||
|
}
|
||||||
|
|
||||||
|
void CL_DrawStringLen( cl_font_t *font, const char *s, int *width, int *height, int flags )
|
||||||
|
{
|
||||||
|
int draw_len = 0;
|
||||||
|
|
||||||
|
if( !font || !font->valid )
|
||||||
|
return;
|
||||||
|
|
||||||
|
if( height )
|
||||||
|
*height = font->charHeight;
|
||||||
|
|
||||||
|
if( width )
|
||||||
|
*width = 0;
|
||||||
|
|
||||||
|
if( !COM_CheckString( s ))
|
||||||
|
return;
|
||||||
|
|
||||||
|
if( FBitSet( flags, FONT_DRAW_UTF8 ))
|
||||||
|
Con_UtfProcessChar( 0 ); // reset utf state
|
||||||
|
|
||||||
|
while( *s )
|
||||||
|
{
|
||||||
|
int number;
|
||||||
|
|
||||||
|
if( *s == '\n' )
|
||||||
|
{
|
||||||
|
// BUG: no check for end string here
|
||||||
|
// but high chances somebody's relying on this
|
||||||
|
s++;
|
||||||
|
draw_len = 0;
|
||||||
|
if( !FBitSet( flags, FONT_DRAW_NOLF ))
|
||||||
|
{
|
||||||
|
if( height )
|
||||||
|
*height += font->charHeight;
|
||||||
|
}
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
else if( *s == '\t' )
|
||||||
|
{
|
||||||
|
draw_len += CL_CalcTabStop( font, 0 ); // at least return max tabstop
|
||||||
|
s++;
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
|
if( IsColorString( s ))
|
||||||
|
{
|
||||||
|
s += 2;
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
|
if( FBitSet( flags, FONT_DRAW_UTF8 ))
|
||||||
|
number = Con_UtfProcessChar( (byte)*s );
|
||||||
|
else number = (byte)*s;
|
||||||
|
|
||||||
|
if( number )
|
||||||
|
{
|
||||||
|
draw_len += font->charWidths[number];
|
||||||
|
|
||||||
|
if( draw_len > *width )
|
||||||
|
*width = draw_len;
|
||||||
|
}
|
||||||
|
|
||||||
|
s++;
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -58,10 +58,13 @@ void CL_UpdatePositions( cl_entity_t *ent )
|
|||||||
|
|
||||||
ent->current_position = (ent->current_position + 1) & HISTORY_MASK;
|
ent->current_position = (ent->current_position + 1) & HISTORY_MASK;
|
||||||
ph = &ent->ph[ent->current_position];
|
ph = &ent->ph[ent->current_position];
|
||||||
|
|
||||||
VectorCopy( ent->curstate.origin, ph->origin );
|
VectorCopy( ent->curstate.origin, ph->origin );
|
||||||
VectorCopy( ent->curstate.angles, ph->angles );
|
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 )
|
qboolean CL_EntityIgnoreLerp( cl_entity_t *e )
|
||||||
{
|
{
|
||||||
|
if( cl_nointerp->value > 0.f )
|
||||||
|
return true;
|
||||||
|
|
||||||
if( e->model && e->model->type == mod_alias )
|
if( e->model && e->model->type == mod_alias )
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
@@ -216,7 +222,7 @@ void CL_UpdateLatchedVars( cl_entity_t *ent )
|
|||||||
|
|
||||||
if( ent->curstate.sequence != ent->prevstate.sequence )
|
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.prevsequence = ent->prevstate.sequence;
|
||||||
ent->latched.sequencetime = ent->curstate.animtime;
|
ent->latched.sequencetime = ent->curstate.animtime;
|
||||||
}
|
}
|
||||||
@@ -235,7 +241,7 @@ CL_GetStudioEstimatedFrame
|
|||||||
|
|
||||||
====================
|
====================
|
||||||
*/
|
*/
|
||||||
float CL_GetStudioEstimatedFrame( cl_entity_t *ent )
|
static float CL_GetStudioEstimatedFrame( cl_entity_t *ent )
|
||||||
{
|
{
|
||||||
studiohdr_t *pstudiohdr;
|
studiohdr_t *pstudiohdr;
|
||||||
mstudioseqdesc_t *pseqdesc;
|
mstudioseqdesc_t *pseqdesc;
|
||||||
@@ -249,7 +255,7 @@ float CL_GetStudioEstimatedFrame( cl_entity_t *ent )
|
|||||||
{
|
{
|
||||||
sequence = bound( 0, ent->curstate.sequence, pstudiohdr->numseq - 1 );
|
sequence = bound( 0, ent->curstate.sequence, pstudiohdr->numseq - 1 );
|
||||||
pseqdesc = (mstudioseqdesc_t *)((byte *)pstudiohdr + pstudiohdr->seqindex) + sequence;
|
pseqdesc = (mstudioseqdesc_t *)((byte *)pstudiohdr + pstudiohdr->seqindex) + sequence;
|
||||||
return ref.dllFuncs.R_StudioEstimateFrame( ent, pseqdesc );
|
return ref.dllFuncs.R_StudioEstimateFrame( ent, pseqdesc, cl.time );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -307,7 +313,7 @@ void CL_ProcessEntityUpdate( cl_entity_t *ent )
|
|||||||
if( FBitSet( ent->curstate.entityType, ENTITY_NORMAL ))
|
if( FBitSet( ent->curstate.entityType, ENTITY_NORMAL ))
|
||||||
COM_NormalizeAngles( ent->curstate.angles );
|
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
|
// allow interpolation on bmodels too
|
||||||
if( ent->model && ent->model->type == mod_brush )
|
if( ent->model && ent->model->type == mod_brush )
|
||||||
@@ -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 CL_FindInterpolationUpdates( cl_entity_t *ent, float targettime, position_history_t **ph0, position_history_t **ph1 )
|
||||||
{
|
{
|
||||||
qboolean extrapolate = true;
|
qboolean extrapolate = true;
|
||||||
int i, i0, i1, imod;
|
uint i, i0, i1, imod;
|
||||||
float at;
|
float at;
|
||||||
|
|
||||||
imod = ent->current_position;
|
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 );
|
VectorSubtract( ph0->origin, ph1->origin, delta );
|
||||||
|
|
||||||
if( t0 != t1 )
|
if( !Q_equal( t0, t1 ))
|
||||||
frac = ( t - t1 ) / ( t0 - t1 );
|
frac = ( t - t1 ) / ( t0 - t1 );
|
||||||
else frac = 1.0f;
|
else frac = 1.0f;
|
||||||
|
|
||||||
@@ -483,7 +489,9 @@ int CL_InterpolateModel( cl_entity_t *e )
|
|||||||
return 0;
|
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->origin, e->origin );
|
||||||
VectorCopy( ph0->angles, e->angles );
|
VectorCopy( ph0->angles, e->angles );
|
||||||
@@ -526,9 +534,16 @@ void CL_ComputePlayerOrigin( cl_entity_t *ent )
|
|||||||
vec3_t origin;
|
vec3_t origin;
|
||||||
vec3_t angles;
|
vec3_t angles;
|
||||||
|
|
||||||
if( !ent->player || ent->index == ( cl.playernum + 1 ))
|
if( !ent->player )
|
||||||
return;
|
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 )
|
if( cls.demoplayback == DEMO_QUAKE1 )
|
||||||
{
|
{
|
||||||
// quake lerping is easy
|
// quake lerping is easy
|
||||||
@@ -639,6 +654,24 @@ FRAME PARSING
|
|||||||
|
|
||||||
=========================================================================
|
=========================================================================
|
||||||
*/
|
*/
|
||||||
|
static qboolean CL_ParseEntityNumFromPacket( sizebuf_t *msg, int *newnum )
|
||||||
|
{
|
||||||
|
if( cls.legacymode )
|
||||||
|
{
|
||||||
|
*newnum = MSG_ReadWord( msg );
|
||||||
|
if( *newnum == 0 )
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
*newnum = MSG_ReadUBitLong( msg, MAX_ENTITY_BITS );
|
||||||
|
if( *newnum == LAST_EDICT )
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
=================
|
=================
|
||||||
CL_FlushEntityPacket
|
CL_FlushEntityPacket
|
||||||
@@ -659,8 +692,8 @@ void CL_FlushEntityPacket( sizebuf_t *msg )
|
|||||||
// read it all, but ignore it
|
// read it all, but ignore it
|
||||||
while( 1 )
|
while( 1 )
|
||||||
{
|
{
|
||||||
newnum = MSG_ReadUBitLong( msg, MAX_ENTITY_BITS );
|
if( !CL_ParseEntityNumFromPacket( msg, &newnum ))
|
||||||
if( newnum == LAST_EDICT ) break; // done
|
break; // done
|
||||||
|
|
||||||
if( MSG_CheckOverflow( msg ))
|
if( MSG_CheckOverflow( msg ))
|
||||||
Host_Error( "CL_FlushEntityPacket: overflow\n" );
|
Host_Error( "CL_FlushEntityPacket: overflow\n" );
|
||||||
@@ -832,21 +865,12 @@ int CL_ParsePacketEntities( sizebuf_t *msg, qboolean delta )
|
|||||||
|
|
||||||
while( 1 )
|
while( 1 )
|
||||||
{
|
{
|
||||||
int lastedict;
|
if( !CL_ParseEntityNumFromPacket( msg, &newnum ))
|
||||||
if( cls.legacymode )
|
break; // done
|
||||||
{
|
|
||||||
newnum = MSG_ReadWord( msg );
|
|
||||||
lastedict = 0;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
newnum = MSG_ReadUBitLong( msg, MAX_ENTITY_BITS );
|
|
||||||
lastedict = LAST_EDICT;
|
|
||||||
}
|
|
||||||
|
|
||||||
if( newnum == lastedict ) break; // end of packet entities
|
|
||||||
if( MSG_CheckOverflow( msg ))
|
if( MSG_CheckOverflow( msg ))
|
||||||
Host_Error( "CL_ParsePacketEntities: overflow\n" );
|
Host_Error( "CL_ParsePacketEntities: overflow\n" );
|
||||||
|
|
||||||
player = CL_IsPlayerIndex( newnum );
|
player = CL_IsPlayerIndex( newnum );
|
||||||
|
|
||||||
while( oldnum < newnum )
|
while( oldnum < newnum )
|
||||||
@@ -955,9 +979,25 @@ all the visible entities should pass this filter
|
|||||||
*/
|
*/
|
||||||
qboolean CL_AddVisibleEntity( cl_entity_t *ent, int entityType )
|
qboolean CL_AddVisibleEntity( cl_entity_t *ent, int entityType )
|
||||||
{
|
{
|
||||||
|
qboolean draw_player = true;
|
||||||
|
|
||||||
if( !ent || !ent->model )
|
if( !ent || !ent->model )
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
|
// don't add the player in firstperson mode
|
||||||
|
if( RP_LOCALCLIENT( ent ))
|
||||||
|
{
|
||||||
|
cl.local.apply_effects = true;
|
||||||
|
|
||||||
|
if( !CL_IsThirdPerson( ) && ( ent->index == cl.viewentity ))
|
||||||
|
{
|
||||||
|
// we don't draw player in default renderer in firstperson mode
|
||||||
|
// but let the client.dll know about player entity anyway
|
||||||
|
// for use in custom renderers
|
||||||
|
draw_player = false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// check for adding this entity
|
// check for adding this entity
|
||||||
if( !clgame.dllFuncs.pfnAddEntity( entityType, ent, ent->model->name ))
|
if( !clgame.dllFuncs.pfnAddEntity( entityType, ent, ent->model->name ))
|
||||||
{
|
{
|
||||||
@@ -967,8 +1007,7 @@ qboolean CL_AddVisibleEntity( cl_entity_t *ent, int entityType )
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
// don't add the player in firstperson mode
|
if( !draw_player )
|
||||||
if( RP_LOCALCLIENT( ent ) && !CL_IsThirdPerson( ) && ( ent->index == cl.viewentity ))
|
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
if( entityType == ET_BEAM )
|
if( entityType == ET_BEAM )
|
||||||
@@ -983,12 +1022,8 @@ qboolean CL_AddVisibleEntity( cl_entity_t *ent, int entityType )
|
|||||||
|
|
||||||
// because pTemp->entity.curstate.effects
|
// because pTemp->entity.curstate.effects
|
||||||
// is already occupied by FTENT_FLICKER
|
// 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
|
// apply client-side effects
|
||||||
CL_AddEntityEffects( ent );
|
CL_AddEntityEffects( ent );
|
||||||
|
|
||||||
@@ -1040,7 +1075,6 @@ void CL_LinkPlayers( frame_t *frame )
|
|||||||
// apply muzzleflash to weaponmodel
|
// apply muzzleflash to weaponmodel
|
||||||
if( ent && FBitSet( ent->curstate.effects, EF_MUZZLEFLASH ))
|
if( ent && FBitSet( ent->curstate.effects, EF_MUZZLEFLASH ))
|
||||||
SetBits( clgame.viewent.curstate.effects, EF_MUZZLEFLASH );
|
SetBits( clgame.viewent.curstate.effects, EF_MUZZLEFLASH );
|
||||||
cl.local.apply_effects = true;
|
|
||||||
|
|
||||||
// check all the clients but add only visible
|
// check all the clients but add only visible
|
||||||
for( i = 0, state = frame->playerstate; i < MAX_CLIENTS; i++, state++ )
|
for( i = 0, state = frame->playerstate; i < MAX_CLIENTS; i++, state++ )
|
||||||
@@ -1079,6 +1113,9 @@ void CL_LinkPlayers( frame_t *frame )
|
|||||||
|
|
||||||
if ( i == cl.playernum )
|
if ( i == cl.playernum )
|
||||||
{
|
{
|
||||||
|
// using interpolation only for local player angles
|
||||||
|
CL_ComputePlayerOrigin( ent );
|
||||||
|
|
||||||
if( cls.demoplayback == DEMO_QUAKE1 )
|
if( cls.demoplayback == DEMO_QUAKE1 )
|
||||||
VectorLerp( ent->prevstate.origin, cl.lerpFrac, ent->curstate.origin, cl.simorg );
|
VectorLerp( ent->prevstate.origin, cl.lerpFrac, ent->curstate.origin, cl.simorg );
|
||||||
VectorCopy( cl.simorg, ent->origin );
|
VectorCopy( cl.simorg, ent->origin );
|
||||||
@@ -1368,17 +1405,19 @@ qboolean CL_GetEntitySpatialization( channel_t *ch )
|
|||||||
ent = CL_GetEntityByIndex( ch->entnum );
|
ent = CL_GetEntityByIndex( ch->entnum );
|
||||||
|
|
||||||
// entity is not present on the client but has valid origin
|
// 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;
|
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
|
// setup origin
|
||||||
VectorAverage( ent->curstate.mins, ent->curstate.maxs, ch->origin );
|
if( ent->model->type == mod_brush )
|
||||||
VectorAdd( ch->origin, ent->curstate.origin, ch->origin );
|
{
|
||||||
|
VectorAverage( ent->model->mins, ent->model->maxs, ch->origin );
|
||||||
|
VectorAdd( ent->origin, ch->origin, ch->origin );
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
VectorCopy( ent->origin, ch->origin );
|
||||||
|
}
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
@@ -1396,12 +1435,15 @@ qboolean CL_GetMovieSpatialization( rawchan_t *ch )
|
|||||||
return valid_origin;
|
return valid_origin;
|
||||||
|
|
||||||
// setup origin
|
// setup origin
|
||||||
VectorAverage( ent->curstate.mins, ent->curstate.maxs, ch->origin );
|
if( ent->model->type == mod_brush )
|
||||||
VectorAdd( ch->origin, ent->curstate.origin, ch->origin );
|
{
|
||||||
|
VectorAverage( ent->model->mins, ent->model->maxs, ch->origin );
|
||||||
// setup radius
|
VectorAdd( ent->origin, ch->origin, ch->origin );
|
||||||
if( ent->model != NULL && ent->model->radius ) ch->radius = ent->model->radius;
|
}
|
||||||
else ch->radius = RadiusFromBounds( ent->curstate.mins, ent->curstate.maxs );
|
else
|
||||||
|
{
|
||||||
|
VectorCopy( ent->origin, ch->origin );
|
||||||
|
}
|
||||||
|
|
||||||
return true;
|
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 float cin_time;
|
||||||
static int last_frame = -1;
|
static int last_frame = -1;
|
||||||
@@ -309,7 +309,7 @@ static void UI_DrawLogo( const char *filename, float x, float y, float width, fl
|
|||||||
|
|
||||||
// run cinematic if not
|
// run cinematic if not
|
||||||
Q_snprintf( path, sizeof( path ), "media/%s", filename );
|
Q_snprintf( path, sizeof( path ), "media/%s", filename );
|
||||||
COM_DefaultExtension( path, ".avi" );
|
COM_DefaultExtension( path, ".avi", sizeof( path ));
|
||||||
fullpath = FS_GetDiskPath( path, false );
|
fullpath = FS_GetDiskPath( path, false );
|
||||||
|
|
||||||
if( FS_FileExists( path, false ) && !fullpath )
|
if( FS_FileExists( path, false ) && !fullpath )
|
||||||
@@ -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 );
|
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;
|
return gameui.logo_xres;
|
||||||
}
|
}
|
||||||
|
|
||||||
static int UI_GetLogoHeight( void )
|
static int GAME_EXPORT UI_GetLogoHeight( void )
|
||||||
{
|
{
|
||||||
return gameui.logo_yres;
|
return gameui.logo_yres;
|
||||||
}
|
}
|
||||||
|
|
||||||
static float UI_GetLogoLength( void )
|
static float GAME_EXPORT UI_GetLogoLength( void )
|
||||||
{
|
{
|
||||||
return gameui.logo_length;
|
return gameui.logo_length;
|
||||||
}
|
}
|
||||||
@@ -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->startmap, in->startmap, sizeof( out->startmap ));
|
||||||
Q_strncpy( out->trainmap, in->trainmap, sizeof( out->trainmap ));
|
Q_strncpy( out->trainmap, in->trainmap, sizeof( out->trainmap ));
|
||||||
Q_strncpy( out->title, in->title, sizeof( out->title ));
|
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->game_url, in->game_url, sizeof( out->game_url ));
|
||||||
Q_strncpy( out->update_url, in->update_url, sizeof( out->update_url ));
|
Q_strncpy( out->update_url, in->update_url, sizeof( out->update_url ));
|
||||||
@@ -417,54 +417,8 @@ static void UI_ConvertGameInfo( GAMEINFO *out, gameinfo_t *in )
|
|||||||
out->flags |= GFL_NOMODELS;
|
out->flags |= GFL_NOMODELS;
|
||||||
if( in->noskills )
|
if( in->noskills )
|
||||||
out->flags |= GFL_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 )
|
|
||||||
{
|
|
||||||
float dudx, dvdy;
|
|
||||||
|
|
||||||
// clip sub rect to sprite
|
|
||||||
if(( width == 0 ) || ( height == 0 ))
|
|
||||||
return false;
|
|
||||||
|
|
||||||
if( *x + *width <= gameui.ds.scissor_x )
|
|
||||||
return false;
|
|
||||||
if( *x >= gameui.ds.scissor_x + gameui.ds.scissor_width )
|
|
||||||
return false;
|
|
||||||
if( *y + *height <= gameui.ds.scissor_y )
|
|
||||||
return false;
|
|
||||||
if( *y >= gameui.ds.scissor_y + gameui.ds.scissor_height )
|
|
||||||
return false;
|
|
||||||
|
|
||||||
dudx = (*u1 - *u0) / *width;
|
|
||||||
dvdy = (*v1 - *v0) / *height;
|
|
||||||
|
|
||||||
if( *x < gameui.ds.scissor_x )
|
|
||||||
{
|
|
||||||
*u0 += (gameui.ds.scissor_x - *x) * dudx;
|
|
||||||
*width -= gameui.ds.scissor_x - *x;
|
|
||||||
*x = gameui.ds.scissor_x;
|
|
||||||
}
|
|
||||||
|
|
||||||
if( *x + *width > gameui.ds.scissor_x + gameui.ds.scissor_width )
|
|
||||||
{
|
|
||||||
*u1 -= (*x + *width - (gameui.ds.scissor_x + gameui.ds.scissor_width)) * dudx;
|
|
||||||
*width = gameui.ds.scissor_x + gameui.ds.scissor_width - *x;
|
|
||||||
}
|
|
||||||
|
|
||||||
if( *y < gameui.ds.scissor_y )
|
|
||||||
{
|
|
||||||
*v0 += (gameui.ds.scissor_y - *y) * dvdy;
|
|
||||||
*height -= gameui.ds.scissor_y - *y;
|
|
||||||
*y = gameui.ds.scissor_y;
|
|
||||||
}
|
|
||||||
|
|
||||||
if( *y + *height > gameui.ds.scissor_y + gameui.ds.scissor_height )
|
|
||||||
{
|
|
||||||
*v1 -= (*y + *height - (gameui.ds.scissor_y + gameui.ds.scissor_height)) * dvdy;
|
|
||||||
*height = gameui.ds.scissor_y + gameui.ds.scissor_height - *y;
|
|
||||||
}
|
|
||||||
return true;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
@@ -485,10 +439,10 @@ static void PIC_DrawGeneric( float x, float y, float width, float height, const
|
|||||||
if( prc )
|
if( prc )
|
||||||
{
|
{
|
||||||
// calc user-defined rectangle
|
// calc user-defined rectangle
|
||||||
s1 = (float)prc->left / (float)w;
|
s1 = prc->left / (float)w;
|
||||||
t1 = (float)prc->top / (float)h;
|
t1 = prc->top / (float)h;
|
||||||
s2 = (float)prc->right / (float)w;
|
s2 = prc->right / (float)w;
|
||||||
t2 = (float)prc->bottom / (float)h;
|
t2 = prc->bottom / (float)h;
|
||||||
|
|
||||||
if( width == -1 && height == -1 )
|
if( width == -1 && height == -1 )
|
||||||
{
|
{
|
||||||
@@ -509,10 +463,9 @@ static void PIC_DrawGeneric( float x, float y, float width, float height, const
|
|||||||
}
|
}
|
||||||
|
|
||||||
// pass scissor test if supposed
|
// pass scissor test if supposed
|
||||||
if( gameui.ds.scissor_test && !PIC_Scissor( &x, &y, &width, &height, &s1, &t1, &s2, &t2 ))
|
if( !CL_Scissor( &gameui.ds.scissor, &x, &y, &width, &height, &s1, &t1, &s2, &t2 ))
|
||||||
return;
|
return;
|
||||||
|
|
||||||
PicAdjustSize( &x, &y, &width, &height );
|
|
||||||
ref.dllFuncs.R_DrawStretchPic( x, y, width, height, s1, t1, s2, t2, gameui.ds.gl_texturenum );
|
ref.dllFuncs.R_DrawStretchPic( x, y, width, height, s1, t1, s2, t2, gameui.ds.gl_texturenum );
|
||||||
ref.dllFuncs.Color4ub( 255, 255, 255, 255 );
|
ref.dllFuncs.Color4ub( 255, 255, 255, 255 );
|
||||||
}
|
}
|
||||||
@@ -529,7 +482,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;
|
HIMAGE tx;
|
||||||
|
|
||||||
@@ -555,7 +508,7 @@ pfnPIC_Width
|
|||||||
|
|
||||||
=========
|
=========
|
||||||
*/
|
*/
|
||||||
static int pfnPIC_Width( HIMAGE hPic )
|
static int GAME_EXPORT pfnPIC_Width( HIMAGE hPic )
|
||||||
{
|
{
|
||||||
int picWidth;
|
int picWidth;
|
||||||
|
|
||||||
@@ -570,7 +523,7 @@ pfnPIC_Height
|
|||||||
|
|
||||||
=========
|
=========
|
||||||
*/
|
*/
|
||||||
static int pfnPIC_Height( HIMAGE hPic )
|
static int GAME_EXPORT pfnPIC_Height( HIMAGE hPic )
|
||||||
{
|
{
|
||||||
int picHeight;
|
int picHeight;
|
||||||
|
|
||||||
@@ -585,7 +538,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;
|
gameui.ds.gl_texturenum = hPic;
|
||||||
r = bound( 0, r, 255 );
|
r = bound( 0, r, 255 );
|
||||||
@@ -601,7 +554,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 );
|
ref.dllFuncs.GL_SetRenderMode( kRenderNormal );
|
||||||
PIC_DrawGeneric( x, y, width, height, prc );
|
PIC_DrawGeneric( x, y, width, height, prc );
|
||||||
@@ -613,7 +566,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 );
|
ref.dllFuncs.GL_SetRenderMode( kRenderTransTexture );
|
||||||
PIC_DrawGeneric( x, y, width, height, prc );
|
PIC_DrawGeneric( x, y, width, height, prc );
|
||||||
@@ -625,7 +578,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 );
|
ref.dllFuncs.GL_SetRenderMode( kRenderTransAlpha );
|
||||||
PIC_DrawGeneric( x, y, width, height, prc );
|
PIC_DrawGeneric( x, y, width, height, prc );
|
||||||
@@ -637,7 +590,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 );
|
ref.dllFuncs.GL_SetRenderMode( kRenderTransAdd );
|
||||||
PIC_DrawGeneric( x, y, width, height, prc );
|
PIC_DrawGeneric( x, y, width, height, prc );
|
||||||
@@ -649,7 +602,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
|
// check bounds
|
||||||
x = bound( 0, x, gameui.globals->scrWidth );
|
x = bound( 0, x, gameui.globals->scrWidth );
|
||||||
@@ -657,11 +610,7 @@ static void pfnPIC_EnableScissor( int x, int y, int width, int height )
|
|||||||
width = bound( 0, width, gameui.globals->scrWidth - x );
|
width = bound( 0, width, gameui.globals->scrWidth - x );
|
||||||
height = bound( 0, height, gameui.globals->scrHeight - y );
|
height = bound( 0, height, gameui.globals->scrHeight - y );
|
||||||
|
|
||||||
gameui.ds.scissor_x = x;
|
CL_EnableScissor( &gameui.ds.scissor, x, y, width, height );
|
||||||
gameui.ds.scissor_width = width;
|
|
||||||
gameui.ds.scissor_y = y;
|
|
||||||
gameui.ds.scissor_height = height;
|
|
||||||
gameui.ds.scissor_test = true;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
@@ -670,13 +619,9 @@ pfnPIC_DisableScissor
|
|||||||
|
|
||||||
=========
|
=========
|
||||||
*/
|
*/
|
||||||
static void pfnPIC_DisableScissor( void )
|
static void GAME_EXPORT pfnPIC_DisableScissor( void )
|
||||||
{
|
{
|
||||||
gameui.ds.scissor_x = 0;
|
CL_DisableScissor( &gameui.ds.scissor );
|
||||||
gameui.ds.scissor_width = 0;
|
|
||||||
gameui.ds.scissor_y = 0;
|
|
||||||
gameui.ds.scissor_height = 0;
|
|
||||||
gameui.ds.scissor_test = false;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
@@ -685,7 +630,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 );
|
r = bound( 0, r, 255 );
|
||||||
g = bound( 0, g, 255 );
|
g = bound( 0, g, 255 );
|
||||||
@@ -703,7 +648,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] )
|
if( !szCmdString || !szCmdString[0] )
|
||||||
return;
|
return;
|
||||||
@@ -721,7 +666,7 @@ pfnPlaySound
|
|||||||
|
|
||||||
=============
|
=============
|
||||||
*/
|
*/
|
||||||
static void pfnPlaySound( const char *szSound )
|
static void GAME_EXPORT pfnPlaySound( const char *szSound )
|
||||||
{
|
{
|
||||||
if( !COM_CheckString( szSound )) return;
|
if( !COM_CheckString( szSound )) return;
|
||||||
S_StartLocalSound( szSound, VOL_NORM, false );
|
S_StartLocalSound( szSound, VOL_NORM, false );
|
||||||
@@ -734,7 +679,7 @@ pfnDrawCharacter
|
|||||||
quakefont draw character
|
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;
|
rgba_t color;
|
||||||
float row, col, size;
|
float row, col, size;
|
||||||
@@ -764,7 +709,7 @@ static void pfnDrawCharacter( int ix, int iy, int iwidth, int iheight, int ch, i
|
|||||||
t2 = t1 + size;
|
t2 = t1 + size;
|
||||||
|
|
||||||
// pass scissor test if supposed
|
// pass scissor test if supposed
|
||||||
if( gameui.ds.scissor_test && !PIC_Scissor( &x, &y, &width, &height, &s1, &t1, &s2, &t2 ))
|
if( !CL_Scissor( &gameui.ds.scissor, &x, &y, &width, &height, &s1, &t1, &s2, &t2 ))
|
||||||
return;
|
return;
|
||||||
|
|
||||||
ref.dllFuncs.GL_SetRenderMode( kRenderTransTexture );
|
ref.dllFuncs.GL_SetRenderMode( kRenderTransTexture );
|
||||||
@@ -779,7 +724,7 @@ 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;
|
int drawLen;
|
||||||
|
|
||||||
@@ -797,7 +742,7 @@ pfnDrawSetTextColor
|
|||||||
set color for anything
|
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
|
// bound color and convert to byte
|
||||||
gameui.ds.textColor[0] = r;
|
gameui.ds.textColor[0] = r;
|
||||||
@@ -813,7 +758,7 @@ pfnGetPlayerModel
|
|||||||
for drawing playermodel previews
|
for drawing playermodel previews
|
||||||
====================
|
====================
|
||||||
*/
|
*/
|
||||||
static cl_entity_t* pfnGetPlayerModel( void )
|
static cl_entity_t* GAME_EXPORT pfnGetPlayerModel( void )
|
||||||
{
|
{
|
||||||
return &gameui.playermodel;
|
return &gameui.playermodel;
|
||||||
}
|
}
|
||||||
@@ -825,7 +770,7 @@ pfnSetPlayerModel
|
|||||||
for drawing playermodel previews
|
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->model = Mod_ForName( path, false, false );
|
||||||
ent->curstate.modelindex = MAX_MODELS; // unreachable index
|
ent->curstate.modelindex = MAX_MODELS; // unreachable index
|
||||||
@@ -838,7 +783,7 @@ pfnClearScene
|
|||||||
for drawing playermodel previews
|
for drawing playermodel previews
|
||||||
====================
|
====================
|
||||||
*/
|
*/
|
||||||
static void pfnClearScene( void )
|
static void GAME_EXPORT pfnClearScene( void )
|
||||||
{
|
{
|
||||||
ref.dllFuncs.R_PushScene();
|
ref.dllFuncs.R_PushScene();
|
||||||
ref.dllFuncs.R_ClearScene();
|
ref.dllFuncs.R_ClearScene();
|
||||||
@@ -851,7 +796,7 @@ pfnRenderScene
|
|||||||
for drawing playermodel previews
|
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;
|
ref_viewpass_t copy;
|
||||||
|
|
||||||
@@ -877,7 +822,7 @@ pfnAddEntity
|
|||||||
adding player model into visible list
|
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 ))
|
if( !ref.dllFuncs.R_AddEntity( ent, entityType ))
|
||||||
return false;
|
return false;
|
||||||
@@ -891,9 +836,9 @@ pfnClientJoin
|
|||||||
send client connect
|
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 )));
|
Cbuf_AddTextf( "connect %s\n", NET_AdrToString( adr ));
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
@@ -903,7 +848,7 @@ pfnKeyGetOverstrikeMode
|
|||||||
get global key overstrike state
|
get global key overstrike state
|
||||||
====================
|
====================
|
||||||
*/
|
*/
|
||||||
static int pfnKeyGetOverstrikeMode( void )
|
static int GAME_EXPORT pfnKeyGetOverstrikeMode( void )
|
||||||
{
|
{
|
||||||
return host.key_overstrike;
|
return host.key_overstrike;
|
||||||
}
|
}
|
||||||
@@ -915,7 +860,7 @@ pfnKeySetOverstrikeMode
|
|||||||
set global key overstrike mode
|
set global key overstrike mode
|
||||||
====================
|
====================
|
||||||
*/
|
*/
|
||||||
static void pfnKeySetOverstrikeMode( int fActive )
|
static void GAME_EXPORT pfnKeySetOverstrikeMode( int fActive )
|
||||||
{
|
{
|
||||||
host.key_overstrike = fActive;
|
host.key_overstrike = fActive;
|
||||||
}
|
}
|
||||||
@@ -951,7 +896,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 );
|
_Mem_Free( mem, filename, fileline );
|
||||||
}
|
}
|
||||||
@@ -962,7 +907,7 @@ pfnGetGameInfo
|
|||||||
|
|
||||||
=========
|
=========
|
||||||
*/
|
*/
|
||||||
static int pfnGetGameInfo( GAMEINFO *pgameinfo )
|
static int GAME_EXPORT pfnGetGameInfo( GAMEINFO *pgameinfo )
|
||||||
{
|
{
|
||||||
if( !pgameinfo ) return 0;
|
if( !pgameinfo ) return 0;
|
||||||
|
|
||||||
@@ -976,9 +921,9 @@ pfnGetGamesList
|
|||||||
|
|
||||||
=========
|
=========
|
||||||
*/
|
*/
|
||||||
static GAMEINFO **pfnGetGamesList( int *numGames )
|
static GAMEINFO ** GAME_EXPORT pfnGetGamesList( int *numGames )
|
||||||
{
|
{
|
||||||
if( numGames ) *numGames = SI.numgames;
|
if( numGames ) *numGames = FI->numgames;
|
||||||
return gameui.modsInfo;
|
return gameui.modsInfo;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -989,7 +934,7 @@ pfnGetFilesList
|
|||||||
release prev search on a next call
|
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;
|
static search_t *t = NULL;
|
||||||
|
|
||||||
@@ -1024,7 +969,7 @@ pfnCheckGameDll
|
|||||||
|
|
||||||
=========
|
=========
|
||||||
*/
|
*/
|
||||||
int pfnCheckGameDll( void )
|
int GAME_EXPORT pfnCheckGameDll( void )
|
||||||
{
|
{
|
||||||
string dllpath;
|
string dllpath;
|
||||||
void *hInst;
|
void *hInst;
|
||||||
@@ -1046,7 +991,7 @@ int pfnCheckGameDll( void )
|
|||||||
COM_FreeLibrary( hInst ); // don't increase linker's reference counter
|
COM_FreeLibrary( hInst ); // don't increase linker's reference counter
|
||||||
return true;
|
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;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1056,12 +1001,9 @@ pfnChangeInstance
|
|||||||
|
|
||||||
=========
|
=========
|
||||||
*/
|
*/
|
||||||
static void pfnChangeInstance( const char *newInstance, const char *szFinalMessage )
|
static void GAME_EXPORT pfnChangeInstance( const char *newInstance, const char *szFinalMessage )
|
||||||
{
|
{
|
||||||
if( !szFinalMessage ) szFinalMessage = "";
|
Con_Reportf( S_ERROR "ChangeInstance menu call is deprecated!\n" );
|
||||||
if( !newInstance || !*newInstance ) return;
|
|
||||||
|
|
||||||
Host_NewInstance( newInstance, szFinalMessage );
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
@@ -1070,7 +1012,7 @@ pfnHostEndGame
|
|||||||
|
|
||||||
=========
|
=========
|
||||||
*/
|
*/
|
||||||
static void pfnHostEndGame( const char *szFinalMessage )
|
static void GAME_EXPORT pfnHostEndGame( const char *szFinalMessage )
|
||||||
{
|
{
|
||||||
if( !szFinalMessage ) szFinalMessage = "";
|
if( !szFinalMessage ) szFinalMessage = "";
|
||||||
Host_EndGame( false, "%s", szFinalMessage );
|
Host_EndGame( false, "%s", szFinalMessage );
|
||||||
@@ -1082,12 +1024,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 );
|
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 );
|
ref.dllFuncs.GL_ProcessTexture( texnum, gamma, topColor, bottomColor );
|
||||||
}
|
}
|
||||||
@@ -1098,7 +1040,7 @@ static void GL_ProcessTexture( int texnum, float gamma, int topColor, int bottom
|
|||||||
UI_ShellExecute
|
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 );
|
Platform_ShellExecute( path, parms );
|
||||||
|
|
||||||
@@ -1106,6 +1048,41 @@ static void UI_ShellExecute( const char *path, const char *parms, int shouldExit
|
|||||||
Sys_Quit();
|
Sys_Quit();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
==============
|
||||||
|
pfnParseFile
|
||||||
|
|
||||||
|
legacy wrapper
|
||||||
|
==============
|
||||||
|
*/
|
||||||
|
static char *pfnParseFile( char *buf, char *token )
|
||||||
|
{
|
||||||
|
return COM_ParseFile( buf, token, INT_MAX );
|
||||||
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
=============
|
||||||
|
pfnFileExists
|
||||||
|
|
||||||
|
legacy wrapper
|
||||||
|
=============
|
||||||
|
*/
|
||||||
|
static int pfnFileExists( const char *path, int gamedironly )
|
||||||
|
{
|
||||||
|
return FS_FileExists( path, gamedironly );
|
||||||
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
=============
|
||||||
|
pfnDelete
|
||||||
|
|
||||||
|
legacy wrapper
|
||||||
|
=============
|
||||||
|
*/
|
||||||
|
static int pfnDelete( const char *path )
|
||||||
|
{
|
||||||
|
return FS_Delete( path );
|
||||||
|
}
|
||||||
|
|
||||||
// engine callbacks
|
// engine callbacks
|
||||||
static ui_enginefuncs_t gEngfuncs =
|
static ui_enginefuncs_t gEngfuncs =
|
||||||
@@ -1153,13 +1130,13 @@ static ui_enginefuncs_t gEngfuncs =
|
|||||||
pfnRenderScene,
|
pfnRenderScene,
|
||||||
pfnAddEntity,
|
pfnAddEntity,
|
||||||
Host_Error,
|
Host_Error,
|
||||||
FS_FileExists,
|
pfnFileExists,
|
||||||
pfnGetGameDir,
|
pfnGetGameDir,
|
||||||
Cmd_CheckMapsList,
|
Cmd_CheckMapsList,
|
||||||
CL_Active,
|
CL_Active,
|
||||||
pfnClientJoin,
|
pfnClientJoin,
|
||||||
COM_LoadFileForMe,
|
COM_LoadFileForMe,
|
||||||
COM_ParseFile,
|
pfnParseFile,
|
||||||
COM_FreeFile,
|
COM_FreeFile,
|
||||||
Key_ClearStates,
|
Key_ClearStates,
|
||||||
Key_SetKeyDest,
|
Key_SetKeyDest,
|
||||||
@@ -1192,7 +1169,7 @@ static ui_enginefuncs_t gEngfuncs =
|
|||||||
COM_CompareFileTime,
|
COM_CompareFileTime,
|
||||||
VID_GetModeString,
|
VID_GetModeString,
|
||||||
(void*)COM_SaveFile,
|
(void*)COM_SaveFile,
|
||||||
(void*)FS_Delete
|
pfnDelete
|
||||||
};
|
};
|
||||||
|
|
||||||
static void pfnEnableTextInput( int enable )
|
static void pfnEnableTextInput( int enable )
|
||||||
@@ -1214,13 +1191,22 @@ static int pfnGetRenderers( unsigned int num, char *shortName, size_t size1, cha
|
|||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static char *pfnParseFileSafe( char *data, char *buf, const int size, unsigned int flags, int *len )
|
||||||
|
{
|
||||||
|
return COM_ParseFileSafe( data, buf, size, flags, len, NULL );
|
||||||
|
}
|
||||||
|
|
||||||
static ui_extendedfuncs_t gExtendedfuncs =
|
static ui_extendedfuncs_t gExtendedfuncs =
|
||||||
{
|
{
|
||||||
pfnEnableTextInput,
|
pfnEnableTextInput,
|
||||||
Con_UtfProcessChar,
|
Con_UtfProcessChar,
|
||||||
Con_UtfMoveLeft,
|
Con_UtfMoveLeft,
|
||||||
Con_UtfMoveRight,
|
Con_UtfMoveRight,
|
||||||
pfnGetRenderers
|
pfnGetRenderers,
|
||||||
|
Sys_DoubleTime,
|
||||||
|
pfnParseFileSafe,
|
||||||
|
NET_AdrToString,
|
||||||
|
NET_CompareAdrSort,
|
||||||
};
|
};
|
||||||
|
|
||||||
void UI_UnloadProgs( void )
|
void UI_UnloadProgs( void )
|
||||||
@@ -1340,13 +1326,13 @@ qboolean UI_LoadProgs( void )
|
|||||||
Cvar_FullSet( "host_gameuiloaded", "1", FCVAR_READ_ONLY );
|
Cvar_FullSet( "host_gameuiloaded", "1", FCVAR_READ_ONLY );
|
||||||
|
|
||||||
// setup gameinfo
|
// setup gameinfo
|
||||||
for( i = 0; i < SI.numgames; i++ )
|
for( i = 0; i < FI->numgames; i++ )
|
||||||
{
|
{
|
||||||
gameui.modsInfo[i] = Mem_Calloc( gameui.mempool, sizeof( GAMEINFO ));
|
gameui.modsInfo[i] = Mem_Calloc( gameui.mempool, sizeof( GAMEINFO ));
|
||||||
UI_ConvertGameInfo( gameui.modsInfo[i], SI.games[i] );
|
UI_ConvertGameInfo( gameui.modsInfo[i], FI->games[i] );
|
||||||
}
|
}
|
||||||
|
|
||||||
UI_ConvertGameInfo( &gameui.gameInfo, SI.GameInfo ); // current gameinfo
|
UI_ConvertGameInfo( &gameui.gameInfo, FI->GameInfo ); // current gameinfo
|
||||||
|
|
||||||
// setup globals
|
// setup globals
|
||||||
gameui.globals->developer = host.allow_console;
|
gameui.globals->developer = host.allow_console;
|
||||||
|
|||||||
@@ -22,12 +22,14 @@ GNU General Public License for more details.
|
|||||||
#include "vgui_draw.h"
|
#include "vgui_draw.h"
|
||||||
#include "library.h"
|
#include "library.h"
|
||||||
#include "vid_common.h"
|
#include "vid_common.h"
|
||||||
|
#include "pm_local.h"
|
||||||
|
#include "sequence.h"
|
||||||
|
|
||||||
#define MAX_TOTAL_CMDS 32
|
#define MAX_TOTAL_CMDS 32
|
||||||
#define MAX_CMD_BUFFER 8000
|
#define MAX_CMD_BUFFER 8000
|
||||||
#define CONNECTION_PROBLEM_TIME 15.0 // 15 seconds
|
#define CONNECTION_PROBLEM_TIME 15.0 // 15 seconds
|
||||||
#define CL_CONNECTION_RETRIES 10
|
#define CL_CONNECTION_RETRIES 10
|
||||||
#define CL_TEST_RETRIES_NORESPONCE 2
|
#define CL_TEST_RETRIES_NORESPONCE 3
|
||||||
#define CL_TEST_RETRIES 5
|
#define CL_TEST_RETRIES 5
|
||||||
|
|
||||||
CVAR_DEFINE_AUTO( mp_decals, "300", FCVAR_ARCHIVE, "decals limit in multiplayer" );
|
CVAR_DEFINE_AUTO( mp_decals, "300", FCVAR_ARCHIVE, "decals limit in multiplayer" );
|
||||||
@@ -38,12 +40,11 @@ CVAR_DEFINE_AUTO( cl_allow_upload, "1", FCVAR_ARCHIVE, "allow to uploading resou
|
|||||||
CVAR_DEFINE_AUTO( cl_download_ingame, "1", FCVAR_ARCHIVE, "allow to downloading resources while client is active" );
|
CVAR_DEFINE_AUTO( cl_download_ingame, "1", FCVAR_ARCHIVE, "allow to downloading resources while client is active" );
|
||||||
CVAR_DEFINE_AUTO( cl_logofile, "lambda", FCVAR_ARCHIVE, "player logo name" );
|
CVAR_DEFINE_AUTO( cl_logofile, "lambda", FCVAR_ARCHIVE, "player logo name" );
|
||||||
CVAR_DEFINE_AUTO( cl_logocolor, "orange", FCVAR_ARCHIVE, "player logo color" );
|
CVAR_DEFINE_AUTO( cl_logocolor, "orange", FCVAR_ARCHIVE, "player logo color" );
|
||||||
|
CVAR_DEFINE_AUTO( cl_logoext, "bmp", FCVAR_ARCHIVE, "temporary cvar to tell engine which logo must be packed" );
|
||||||
CVAR_DEFINE_AUTO( cl_test_bandwidth, "1", FCVAR_ARCHIVE, "test network bandwith before connection" );
|
CVAR_DEFINE_AUTO( cl_test_bandwidth, "1", FCVAR_ARCHIVE, "test network bandwith before connection" );
|
||||||
convar_t *rcon_client_password;
|
|
||||||
convar_t *rcon_address;
|
convar_t *rcon_address;
|
||||||
convar_t *cl_timeout;
|
convar_t *cl_timeout;
|
||||||
convar_t *cl_nopred;
|
convar_t *cl_nopred;
|
||||||
convar_t *cl_showfps;
|
|
||||||
convar_t *cl_nodelta;
|
convar_t *cl_nodelta;
|
||||||
convar_t *cl_crosshair;
|
convar_t *cl_crosshair;
|
||||||
convar_t *cl_cmdbackup;
|
convar_t *cl_cmdbackup;
|
||||||
@@ -57,6 +58,7 @@ convar_t *cl_nosmooth;
|
|||||||
convar_t *cl_smoothtime;
|
convar_t *cl_smoothtime;
|
||||||
convar_t *cl_clockreset;
|
convar_t *cl_clockreset;
|
||||||
convar_t *cl_fixtimerate;
|
convar_t *cl_fixtimerate;
|
||||||
|
convar_t *hud_fontscale;
|
||||||
convar_t *hud_scale;
|
convar_t *hud_scale;
|
||||||
convar_t *cl_solid_players;
|
convar_t *cl_solid_players;
|
||||||
convar_t *cl_draw_beams;
|
convar_t *cl_draw_beams;
|
||||||
@@ -64,12 +66,14 @@ convar_t *cl_updaterate;
|
|||||||
convar_t *cl_showevents;
|
convar_t *cl_showevents;
|
||||||
convar_t *cl_cmdrate;
|
convar_t *cl_cmdrate;
|
||||||
convar_t *cl_interp;
|
convar_t *cl_interp;
|
||||||
|
convar_t *cl_nointerp;
|
||||||
convar_t *cl_dlmax;
|
convar_t *cl_dlmax;
|
||||||
convar_t *cl_upmax;
|
convar_t *cl_upmax;
|
||||||
|
|
||||||
convar_t *cl_lw;
|
convar_t *cl_lw;
|
||||||
convar_t *cl_charset;
|
convar_t *cl_charset;
|
||||||
convar_t *cl_trace_messages;
|
convar_t *cl_trace_messages;
|
||||||
|
convar_t *cl_nat;
|
||||||
convar_t *hud_utf8;
|
convar_t *hud_utf8;
|
||||||
convar_t *ui_renderworld;
|
convar_t *ui_renderworld;
|
||||||
|
|
||||||
@@ -89,7 +93,7 @@ clgame_static_t clgame;
|
|||||||
void CL_InternetServers_f( void );
|
void CL_InternetServers_f( void );
|
||||||
|
|
||||||
//======================================================================
|
//======================================================================
|
||||||
int CL_Active( void )
|
int GAME_EXPORT CL_Active( void )
|
||||||
{
|
{
|
||||||
return ( cls.state == ca_active );
|
return ( cls.state == ca_active );
|
||||||
}
|
}
|
||||||
@@ -146,16 +150,6 @@ qboolean CL_DisableVisibility( void )
|
|||||||
return cls.envshot_disable_vis;
|
return cls.envshot_disable_vis;
|
||||||
}
|
}
|
||||||
|
|
||||||
qboolean CL_IsBackgroundDemo( void )
|
|
||||||
{
|
|
||||||
return ( cls.demoplayback && cls.demonum != -1 );
|
|
||||||
}
|
|
||||||
|
|
||||||
qboolean CL_IsBackgroundMap( void )
|
|
||||||
{
|
|
||||||
return ( cl.background && !cls.demoplayback );
|
|
||||||
}
|
|
||||||
|
|
||||||
char *CL_Userinfo( void )
|
char *CL_Userinfo( void )
|
||||||
{
|
{
|
||||||
return cls.userinfo;
|
return cls.userinfo;
|
||||||
@@ -195,8 +189,6 @@ void CL_CheckClientState( void )
|
|||||||
Netchan_ReportFlow( &cls.netchan );
|
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
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -234,9 +226,13 @@ void CL_SignonReply( void )
|
|||||||
Mem_PrintStats();
|
Mem_PrintStats();
|
||||||
break;
|
break;
|
||||||
case 2:
|
case 2:
|
||||||
|
SCR_EndLoadingPlaque();
|
||||||
if( cl.proxy_redirect && !cls.spectator )
|
if( cl.proxy_redirect && !cls.spectator )
|
||||||
CL_Disconnect();
|
CL_Disconnect();
|
||||||
cl.proxy_redirect = false;
|
cl.proxy_redirect = false;
|
||||||
|
|
||||||
|
if( cls.demoplayback )
|
||||||
|
Sequence_OnLevelLoad( clgame.mapname );
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -251,49 +247,26 @@ should be put at.
|
|||||||
*/
|
*/
|
||||||
static float CL_LerpPoint( void )
|
static float CL_LerpPoint( void )
|
||||||
{
|
{
|
||||||
float f, frac = 1.0f;
|
double f = cl_serverframetime();
|
||||||
|
double frac;
|
||||||
|
|
||||||
f = cl_serverframetime();
|
if( f == 0.0 || cls.timedemo )
|
||||||
|
|
||||||
if( f == 0.0f || cls.timedemo )
|
|
||||||
{
|
{
|
||||||
|
double fgap = cl_clientframetime();
|
||||||
cl.time = cl.mtime[0];
|
cl.time = cl.mtime[0];
|
||||||
|
|
||||||
|
// maybe don't need for Xash demos
|
||||||
|
if( cls.demoplayback )
|
||||||
|
cl.oldtime = cl.mtime[0] - fgap;
|
||||||
|
|
||||||
return 1.0f;
|
return 1.0f;
|
||||||
}
|
}
|
||||||
|
|
||||||
if( f > 0.1f )
|
if( cl_interp->value <= 0.001 )
|
||||||
{
|
return 1.0f;
|
||||||
// dropped packet, or start of demo
|
|
||||||
cl.mtime[1] = cl.mtime[0] - 0.1f;
|
frac = ( cl.time - cl.mtime[0] ) / cl_interp->value;
|
||||||
f = 0.1f;
|
|
||||||
}
|
|
||||||
#if 1
|
|
||||||
frac = (cl.time - cl.mtime[1]) / f;
|
|
||||||
|
|
||||||
if( frac < 0.0f )
|
|
||||||
{
|
|
||||||
if( frac < -0.01f )
|
|
||||||
cl.time = cl.mtime[1];
|
|
||||||
frac = 0.0f;
|
|
||||||
}
|
|
||||||
else if( frac > 1.0f )
|
|
||||||
{
|
|
||||||
if( frac > 1.01f )
|
|
||||||
cl.time = cl.mtime[0];
|
|
||||||
frac = 1.0f;
|
|
||||||
}
|
|
||||||
#else
|
|
||||||
if( cl_interp->value > 0.001f )
|
|
||||||
{
|
|
||||||
// manual lerp value (goldsrc mode)
|
|
||||||
frac = ( cl.time - cl.mtime[0] ) / cl_interp->value;
|
|
||||||
}
|
|
||||||
else if( f > 0.001f )
|
|
||||||
{
|
|
||||||
// automatic lerp (classic mode)
|
|
||||||
frac = ( cl.time - cl.mtime[1] ) / f;
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
return frac;
|
return frac;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -334,10 +307,10 @@ Validate interpolation cvars, calc interpolation window
|
|||||||
*/
|
*/
|
||||||
void CL_ComputeClientInterpolationAmount( usercmd_t *cmd )
|
void CL_ComputeClientInterpolationAmount( usercmd_t *cmd )
|
||||||
{
|
{
|
||||||
int min_interp = MIN_EX_INTERP;
|
const float epsilon = 0.001f; // to avoid float invalid comparision
|
||||||
int max_interp = MAX_EX_INTERP;
|
float min_interp;
|
||||||
int interpolation_msec;
|
float max_interp = MAX_EX_INTERP;
|
||||||
qboolean forced = false;
|
float interpolation_time;
|
||||||
|
|
||||||
if( cl_updaterate->value < MIN_UPDATERATE )
|
if( cl_updaterate->value < MIN_UPDATERATE )
|
||||||
{
|
{
|
||||||
@@ -352,29 +325,24 @@ void CL_ComputeClientInterpolationAmount( usercmd_t *cmd )
|
|||||||
}
|
}
|
||||||
|
|
||||||
if( cls.spectator )
|
if( cls.spectator )
|
||||||
max_interp = 200;
|
max_interp = 0.2f;
|
||||||
|
|
||||||
min_interp = 1000.0f / cl_updaterate->value;
|
min_interp = 1.0f / cl_updaterate->value;
|
||||||
min_interp = Q_max( 1, min_interp );
|
interpolation_time = cl_interp->value * 1000.0;
|
||||||
interpolation_msec = cl_interp->value * 1000.0f;
|
|
||||||
|
|
||||||
if(( interpolation_msec + 1 ) < min_interp )
|
if( (cl_interp->value + epsilon) < min_interp )
|
||||||
{
|
{
|
||||||
Con_Printf( "ex_interp forced up to %i msec\n", interpolation_msec );
|
Con_Printf( "ex_interp forced up to %.1f msec\n", min_interp * 1000.f );
|
||||||
interpolation_msec = min_interp;
|
Cvar_SetValue( "ex_interp", min_interp );
|
||||||
forced = true;
|
|
||||||
}
|
}
|
||||||
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 );
|
Con_Printf( "ex_interp forced down to %.1f msec\n", max_interp * 1000.f );
|
||||||
interpolation_msec = max_interp;
|
Cvar_SetValue( "ex_interp", max_interp );
|
||||||
forced = true;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if( forced ) Cvar_SetValue( "ex_interp", (float)interpolation_msec * 0.001f );
|
interpolation_time = bound( min_interp, interpolation_time, max_interp );
|
||||||
interpolation_msec = bound( min_interp, interpolation_msec, max_interp );
|
cmd->lerp_msec = CL_DriftInterpolationAmount( interpolation_time * 1000 );
|
||||||
|
|
||||||
cmd->lerp_msec = CL_DriftInterpolationAmount( interpolation_msec );
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
@@ -522,7 +490,7 @@ qboolean CL_ProcessShowTexturesCmds( usercmd_t *cmd )
|
|||||||
if( released & ( IN_RIGHT|IN_MOVERIGHT ))
|
if( released & ( IN_RIGHT|IN_MOVERIGHT ))
|
||||||
Cvar_SetValue( "r_showtextures", gl_showtextures->value + 1 );
|
Cvar_SetValue( "r_showtextures", gl_showtextures->value + 1 );
|
||||||
if( released & ( IN_LEFT|IN_MOVELEFT ))
|
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;
|
oldbuttons = cmd->buttons;
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
@@ -616,7 +584,7 @@ CL_CreateCmd
|
|||||||
*/
|
*/
|
||||||
void CL_CreateCmd( void )
|
void CL_CreateCmd( void )
|
||||||
{
|
{
|
||||||
usercmd_t cmd;
|
usercmd_t nullcmd, *cmd;
|
||||||
runcmd_t *pcmd;
|
runcmd_t *pcmd;
|
||||||
vec3_t angles;
|
vec3_t angles;
|
||||||
qboolean active;
|
qboolean active;
|
||||||
@@ -629,7 +597,6 @@ void CL_CreateCmd( void )
|
|||||||
// store viewangles in case it's will be freeze
|
// store viewangles in case it's will be freeze
|
||||||
VectorCopy( cl.viewangles, angles );
|
VectorCopy( cl.viewangles, angles );
|
||||||
ms = bound( 1, host.frametime * 1000, 255 );
|
ms = bound( 1, host.frametime * 1000, 255 );
|
||||||
memset( &cmd, 0, sizeof( cmd ));
|
|
||||||
input_override = 0;
|
input_override = 0;
|
||||||
|
|
||||||
CL_SetSolidEntities();
|
CL_SetSolidEntities();
|
||||||
@@ -648,12 +615,18 @@ void CL_CreateCmd( void )
|
|||||||
pcmd->receivedtime = -1.0;
|
pcmd->receivedtime = -1.0;
|
||||||
pcmd->heldback = false;
|
pcmd->heldback = false;
|
||||||
pcmd->sendsize = 0;
|
pcmd->sendsize = 0;
|
||||||
|
cmd = &pcmd->cmd;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
memset( &nullcmd, 0, sizeof( nullcmd ));
|
||||||
|
cmd = &nullcmd;
|
||||||
}
|
}
|
||||||
|
|
||||||
active = (( cls.signon == SIGNONS ) && !cl.paused && !cls.demoplayback );
|
active = (( cls.signon == SIGNONS ) && !cl.paused && !cls.demoplayback );
|
||||||
Platform_PreCreateMove();
|
Platform_PreCreateMove();
|
||||||
clgame.dllFuncs.CL_CreateMove( host.frametime, &pcmd->cmd, active );
|
clgame.dllFuncs.CL_CreateMove( host.frametime, cmd, active );
|
||||||
IN_EngineAppendMove( host.frametime, &pcmd->cmd, active );
|
IN_EngineAppendMove( host.frametime, cmd, active );
|
||||||
|
|
||||||
CL_PopPMStates();
|
CL_PopPMStates();
|
||||||
|
|
||||||
@@ -730,15 +703,22 @@ void CL_WritePacket( void )
|
|||||||
|
|
||||||
CL_ComputePacketLoss ();
|
CL_ComputePacketLoss ();
|
||||||
|
|
||||||
|
memset( data, 0, sizeof( data ));
|
||||||
MSG_Init( &buf, "ClientData", data, sizeof( data ));
|
MSG_Init( &buf, "ClientData", data, sizeof( data ));
|
||||||
|
|
||||||
// Determine number of backup commands to send along
|
// Determine number of backup commands to send along
|
||||||
numbackup = bound( 0, cl_cmdbackup->value, MAX_BACKUP_COMMANDS );
|
numbackup = bound( 0, cl_cmdbackup->value, cls.legacymode ? MAX_LEGACY_BACKUP_CMDS : MAX_BACKUP_COMMANDS );
|
||||||
if( cls.state == ca_connected ) numbackup = 0;
|
if( cls.state == ca_connected ) numbackup = 0;
|
||||||
|
|
||||||
// clamp cmdrate
|
// clamp cmdrate
|
||||||
if( cl_cmdrate->value < 0.0f ) Cvar_SetValue( "cl_cmdrate", 0.0f );
|
if( cl_cmdrate->value < 10.0f )
|
||||||
else if( cl_cmdrate->value > 100.0f ) Cvar_SetValue( "cl_cmdrate", 100.0f );
|
{
|
||||||
|
Cvar_SetValue( "cl_cmdrate", 10.0f );
|
||||||
|
}
|
||||||
|
else if( cl_cmdrate->value > 100.0f )
|
||||||
|
{
|
||||||
|
Cvar_SetValue( "cl_cmdrate", 100.0f );
|
||||||
|
}
|
||||||
|
|
||||||
// Check to see if we can actually send this command
|
// Check to see if we can actually send this command
|
||||||
|
|
||||||
@@ -768,6 +748,7 @@ void CL_WritePacket( void )
|
|||||||
if(( host.realtime - cls.netchan.last_received ) > CONNECTION_PROBLEM_TIME )
|
if(( host.realtime - cls.netchan.last_received ) > CONNECTION_PROBLEM_TIME )
|
||||||
{
|
{
|
||||||
Con_NPrintf( 1, "^3Warning:^1 Connection Problem^7\n" );
|
Con_NPrintf( 1, "^3Warning:^1 Connection Problem^7\n" );
|
||||||
|
Con_NPrintf( 2, "^1Auto-disconnect in %.1f seconds^7", cl_timeout->value - ( host.realtime - cls.netchan.last_received ));
|
||||||
cl.validsequence = 0;
|
cl.validsequence = 0;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -807,12 +788,13 @@ void CL_WritePacket( void )
|
|||||||
newcmds = ( cls.netchan.outgoing_sequence - cls.lastoutgoingcommand );
|
newcmds = ( cls.netchan.outgoing_sequence - cls.lastoutgoingcommand );
|
||||||
|
|
||||||
// put an upper/lower bound on this
|
// put an upper/lower bound on this
|
||||||
newcmds = bound( 0, newcmds, cls.legacymode?MAX_LEGACY_TOTAL_CMDS:MAX_TOTAL_CMDS );
|
newcmds = bound( 0, newcmds, cls.legacymode ? MAX_LEGACY_TOTAL_CMDS: MAX_TOTAL_CMDS );
|
||||||
if( cls.state == ca_connected ) newcmds = 0;
|
if( cls.state == ca_connected ) newcmds = 0;
|
||||||
|
|
||||||
MSG_WriteByte( &buf, newcmds );
|
MSG_WriteByte( &buf, newcmds );
|
||||||
|
|
||||||
numcmds = newcmds + numbackup;
|
numcmds = newcmds + numbackup;
|
||||||
|
|
||||||
from = -1;
|
from = -1;
|
||||||
|
|
||||||
for( i = numcmds - 1; i >= 0; i-- )
|
for( i = numcmds - 1; i >= 0; i-- )
|
||||||
@@ -858,6 +840,9 @@ void CL_WritePacket( void )
|
|||||||
cl.commands[cls.netchan.outgoing_sequence & CL_UPDATE_MASK].sendsize = MSG_GetNumBytesWritten( &buf );
|
cl.commands[cls.netchan.outgoing_sequence & CL_UPDATE_MASK].sendsize = MSG_GetNumBytesWritten( &buf );
|
||||||
cl.commands[cls.netchan.outgoing_sequence & CL_UPDATE_MASK].heldback = false;
|
cl.commands[cls.netchan.outgoing_sequence & CL_UPDATE_MASK].heldback = false;
|
||||||
|
|
||||||
|
// send voice data to the server
|
||||||
|
CL_AddVoiceToDatagram();
|
||||||
|
|
||||||
// composite the rest of the datagram..
|
// composite the rest of the datagram..
|
||||||
if( MSG_GetNumBitsWritten( &cls.datagram ) <= MSG_GetNumBitsLeft( &buf ))
|
if( MSG_GetNumBitsWritten( &cls.datagram ) <= MSG_GetNumBitsLeft( &buf ))
|
||||||
MSG_WriteBits( &buf, MSG_GetData( &cls.datagram ), MSG_GetNumBitsWritten( &cls.datagram ));
|
MSG_WriteBits( &buf, MSG_GetData( &cls.datagram ), MSG_GetNumBitsWritten( &cls.datagram ));
|
||||||
@@ -1035,9 +1020,12 @@ void CL_SendConnectPacket( void )
|
|||||||
input_devices = IN_CollectInputDevices();
|
input_devices = IN_CollectInputDevices();
|
||||||
IN_LockInputDevices( true );
|
IN_LockInputDevices( true );
|
||||||
|
|
||||||
Info_SetValueForKey( protinfo, "d", va( "%d", input_devices ), sizeof( protinfo ) );
|
Cvar_SetCheatState();
|
||||||
|
Cvar_FullSet( "sv_cheats", "0", FCVAR_READ_ONLY | FCVAR_SERVER );
|
||||||
|
|
||||||
|
Info_SetValueForKeyf( protinfo, "d", sizeof( protinfo ), "%d", input_devices );
|
||||||
Info_SetValueForKey( protinfo, "v", XASH_VERSION, sizeof( protinfo ) );
|
Info_SetValueForKey( protinfo, "v", XASH_VERSION, sizeof( protinfo ) );
|
||||||
Info_SetValueForKey( protinfo, "b", va( "%d", Q_buildnum() ), sizeof( protinfo ) );
|
Info_SetValueForKeyf( protinfo, "b", sizeof( protinfo ), "%d", Q_buildnum( ));
|
||||||
Info_SetValueForKey( protinfo, "o", Q_buildos(), sizeof( protinfo ) );
|
Info_SetValueForKey( protinfo, "o", Q_buildos(), sizeof( protinfo ) );
|
||||||
Info_SetValueForKey( protinfo, "a", Q_buildarch(), sizeof( protinfo ) );
|
Info_SetValueForKey( protinfo, "a", Q_buildarch(), sizeof( protinfo ) );
|
||||||
}
|
}
|
||||||
@@ -1071,7 +1059,7 @@ void CL_SendConnectPacket( void )
|
|||||||
|
|
||||||
Info_SetValueForKey( protinfo, "uuid", key, sizeof( protinfo ));
|
Info_SetValueForKey( protinfo, "uuid", key, sizeof( protinfo ));
|
||||||
Info_SetValueForKey( protinfo, "qport", qport, sizeof( protinfo ));
|
Info_SetValueForKey( protinfo, "qport", qport, sizeof( protinfo ));
|
||||||
Info_SetValueForKey( protinfo, "ext", va("%d", extensions), sizeof( protinfo ));
|
Info_SetValueForKeyf( protinfo, "ext", sizeof( protinfo ), "%d", extensions);
|
||||||
|
|
||||||
Netchan_OutOfBandPrint( NS_CLIENT, adr, "connect %i %i \"%s\" \"%s\"\n", PROTOCOL_VERSION, cls.challenge, protinfo, cls.userinfo );
|
Netchan_OutOfBandPrint( NS_CLIENT, adr, "connect %i %i \"%s\" \"%s\"\n", PROTOCOL_VERSION, cls.challenge, protinfo, cls.userinfo );
|
||||||
Con_Printf( "Trying to connect by modern protocol\n" );
|
Con_Printf( "Trying to connect by modern protocol\n" );
|
||||||
@@ -1089,8 +1077,9 @@ Resend a connect message if the last one has timed out
|
|||||||
*/
|
*/
|
||||||
void CL_CheckForResend( void )
|
void CL_CheckForResend( void )
|
||||||
{
|
{
|
||||||
netadr_t adr;
|
netadr_t adr;
|
||||||
int res;
|
net_gai_state_t res;
|
||||||
|
qboolean bandwidthTest;
|
||||||
|
|
||||||
if( cls.internetservers_wait )
|
if( cls.internetservers_wait )
|
||||||
CL_InternetServers_f();
|
CL_InternetServers_f();
|
||||||
@@ -1122,13 +1111,13 @@ void CL_CheckForResend( void )
|
|||||||
|
|
||||||
res = NET_StringToAdrNB( cls.servername, &adr );
|
res = NET_StringToAdrNB( cls.servername, &adr );
|
||||||
|
|
||||||
if( !res )
|
if( res == NET_EAI_NONAME )
|
||||||
{
|
{
|
||||||
CL_Disconnect();
|
CL_Disconnect();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if( res == 2 )
|
if( res == NET_EAI_AGAIN )
|
||||||
{
|
{
|
||||||
cls.connect_time = MAX_HEARTBEAT;
|
cls.connect_time = MAX_HEARTBEAT;
|
||||||
return;
|
return;
|
||||||
@@ -1155,14 +1144,18 @@ void CL_CheckForResend( void )
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bandwidthTest = !cls.legacymode && cl_test_bandwidth.value;
|
||||||
cls.serveradr = adr;
|
cls.serveradr = adr;
|
||||||
cls.max_fragment_size = Q_max( FRAGMENT_MAX_SIZE, cls.max_fragment_size >> Q_min( 1, cls.connect_retry ));
|
cls.max_fragment_size = Q_min( FRAGMENT_MAX_SIZE, cls.max_fragment_size / (cls.connect_retry + 1));
|
||||||
cls.connect_time = host.realtime; // for retransmit requests
|
cls.connect_time = host.realtime; // for retransmit requests
|
||||||
cls.connect_retry++;
|
cls.connect_retry++;
|
||||||
|
|
||||||
Con_Printf( "Connecting to %s... [retry #%i]\n", cls.servername, cls.connect_retry );
|
if( bandwidthTest )
|
||||||
|
Con_Printf( "Connecting to %s... [retry #%i, max fragment size %i]\n", cls.servername, cls.connect_retry, cls.max_fragment_size );
|
||||||
|
else
|
||||||
|
Con_Printf( "Connecting to %s... [retry #%i]\n", cls.servername, cls.connect_retry );
|
||||||
|
|
||||||
if( !cls.legacymode && cl_test_bandwidth.value )
|
if( bandwidthTest )
|
||||||
Netchan_OutOfBandPrint( NS_CLIENT, adr, "bandwidth %i %i\n", PROTOCOL_VERSION, cls.max_fragment_size );
|
Netchan_OutOfBandPrint( NS_CLIENT, adr, "bandwidth %i %i\n", PROTOCOL_VERSION, cls.max_fragment_size );
|
||||||
else
|
else
|
||||||
Netchan_OutOfBandPrint( NS_CLIENT, adr, "getchallenge\n" );
|
Netchan_OutOfBandPrint( NS_CLIENT, adr, "getchallenge\n" );
|
||||||
@@ -1187,7 +1180,7 @@ resource_t *CL_AddResource( resourcetype_t type, const char *name, int size, qbo
|
|||||||
|
|
||||||
void CL_CreateResourceList( void )
|
void CL_CreateResourceList( void )
|
||||||
{
|
{
|
||||||
char szFileName[MAX_OSPATH];
|
char szFileName[MAX_OSPATH];
|
||||||
byte rgucMD5_hash[16];
|
byte rgucMD5_hash[16];
|
||||||
resource_t *pNewResource;
|
resource_t *pNewResource;
|
||||||
int nSize;
|
int nSize;
|
||||||
@@ -1195,30 +1188,36 @@ void CL_CreateResourceList( void )
|
|||||||
|
|
||||||
HPAK_FlushHostQueue();
|
HPAK_FlushHostQueue();
|
||||||
cl.num_resources = 0;
|
cl.num_resources = 0;
|
||||||
|
|
||||||
Q_snprintf( szFileName, sizeof( szFileName ), "logos/remapped.bmp" );
|
|
||||||
memset( rgucMD5_hash, 0, sizeof( rgucMD5_hash ));
|
memset( rgucMD5_hash, 0, sizeof( rgucMD5_hash ));
|
||||||
|
|
||||||
|
// sanitize cvar value
|
||||||
|
if( Q_strcmp( cl_logoext.string, "bmp" ) &&
|
||||||
|
Q_strcmp( cl_logoext.string, "png" ))
|
||||||
|
Cvar_DirectSet( &cl_logoext, "bmp" );
|
||||||
|
|
||||||
|
Q_snprintf( szFileName, sizeof( szFileName ),
|
||||||
|
"logos/remapped.%s", cl_logoext.string );
|
||||||
fp = FS_Open( szFileName, "rb", true );
|
fp = FS_Open( szFileName, "rb", true );
|
||||||
|
|
||||||
if( fp )
|
if( !fp )
|
||||||
|
return;
|
||||||
|
|
||||||
|
MD5_HashFile( rgucMD5_hash, szFileName, NULL );
|
||||||
|
nSize = FS_FileLength( fp );
|
||||||
|
|
||||||
|
if( nSize != 0 )
|
||||||
{
|
{
|
||||||
MD5_HashFile( rgucMD5_hash, szFileName, NULL );
|
pNewResource = CL_AddResource( t_decal, szFileName, nSize, false, 0 );
|
||||||
nSize = FS_FileLength( fp );
|
|
||||||
|
|
||||||
if( nSize != 0 )
|
if( pNewResource )
|
||||||
{
|
{
|
||||||
pNewResource = CL_AddResource( t_decal, szFileName, nSize, false, 0 );
|
SetBits( pNewResource->ucFlags, RES_CUSTOM );
|
||||||
|
memcpy( pNewResource->rgucMD5_hash, rgucMD5_hash, 16 );
|
||||||
if( pNewResource )
|
HPAK_AddLump( false, CUSTOM_RES_PATH, pNewResource, NULL, fp );
|
||||||
{
|
|
||||||
SetBits( pNewResource->ucFlags, RES_CUSTOM );
|
|
||||||
memcpy( pNewResource->rgucMD5_hash, rgucMD5_hash, 16 );
|
|
||||||
HPAK_AddLump( false, CUSTOM_RES_PATH, pNewResource, NULL, fp );
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
FS_Close( fp );
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
FS_Close( fp );
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
@@ -1247,7 +1246,7 @@ void CL_Connect_f( void )
|
|||||||
|
|
||||||
// if running a local server, kill it and reissue
|
// if running a local server, kill it and reissue
|
||||||
if( SV_Active( )) Host_ShutdownServer();
|
if( SV_Active( )) Host_ShutdownServer();
|
||||||
NET_Config( true ); // allow remote
|
NET_Config( true, !CVAR_TO_BOOL( cl_nat )); // allow remote
|
||||||
|
|
||||||
Con_Printf( "server %s\n", server );
|
Con_Printf( "server %s\n", server );
|
||||||
CL_Disconnect();
|
CL_Disconnect();
|
||||||
@@ -1278,9 +1277,10 @@ void CL_Rcon_f( void )
|
|||||||
{
|
{
|
||||||
char message[1024];
|
char message[1024];
|
||||||
netadr_t to;
|
netadr_t to;
|
||||||
|
string command;
|
||||||
int i;
|
int i;
|
||||||
|
|
||||||
if( !COM_CheckString( rcon_client_password->string ))
|
if( !COM_CheckString( rcon_password.string ))
|
||||||
{
|
{
|
||||||
Con_Printf( "You must set 'rcon_password' before issuing an rcon command.\n" );
|
Con_Printf( "You must set 'rcon_password' before issuing an rcon command.\n" );
|
||||||
return;
|
return;
|
||||||
@@ -1292,16 +1292,17 @@ void CL_Rcon_f( void )
|
|||||||
message[3] = (char)255;
|
message[3] = (char)255;
|
||||||
message[4] = 0;
|
message[4] = 0;
|
||||||
|
|
||||||
NET_Config( true ); // allow remote
|
NET_Config( true, false ); // allow remote
|
||||||
|
|
||||||
Q_strcat( message, "rcon " );
|
Q_strncat( message, "rcon ", sizeof( message ));
|
||||||
Q_strcat( message, rcon_client_password->string );
|
Q_strncat( message, rcon_password.string, sizeof( message ));
|
||||||
Q_strcat( message, " " );
|
Q_strncat( message, " ", sizeof( message ) );
|
||||||
|
|
||||||
for( i = 1; i < Cmd_Argc(); i++ )
|
for( i = 1; i < Cmd_Argc(); i++ )
|
||||||
{
|
{
|
||||||
Q_strcat( message, Cmd_Argv( i ));
|
Cmd_Escape( command, Cmd_Argv( i ), sizeof( command ));
|
||||||
Q_strcat( message, " " );
|
Q_strncat( message, command, sizeof( message ));
|
||||||
|
Q_strncat( message, " ", sizeof( message ));
|
||||||
}
|
}
|
||||||
|
|
||||||
if( cls.state >= ca_connected )
|
if( cls.state >= ca_connected )
|
||||||
@@ -1343,7 +1344,7 @@ void CL_ClearState( void )
|
|||||||
CL_ClearEffects ();
|
CL_ClearEffects ();
|
||||||
CL_FreeEdicts ();
|
CL_FreeEdicts ();
|
||||||
|
|
||||||
CL_ClearPhysEnts ();
|
PM_ClearPhysEnts( clgame.pmove );
|
||||||
NetAPI_CancelAllRequests();
|
NetAPI_CancelAllRequests();
|
||||||
|
|
||||||
// wipe the entire cl structure
|
// wipe the entire cl structure
|
||||||
@@ -1351,6 +1352,7 @@ void CL_ClearState( void )
|
|||||||
MSG_Clear( &cls.netchan.message );
|
MSG_Clear( &cls.netchan.message );
|
||||||
memset( &clgame.fade, 0, sizeof( clgame.fade ));
|
memset( &clgame.fade, 0, sizeof( clgame.fade ));
|
||||||
memset( &clgame.shake, 0, sizeof( clgame.shake ));
|
memset( &clgame.shake, 0, sizeof( clgame.shake ));
|
||||||
|
clgame.mapname[0] = '\0';
|
||||||
Cvar_FullSet( "cl_background", "0", FCVAR_READ_ONLY );
|
Cvar_FullSet( "cl_background", "0", FCVAR_READ_ONLY );
|
||||||
cl.maxclients = 1; // allow to drawing player in menu
|
cl.maxclients = 1; // allow to drawing player in menu
|
||||||
cl.mtime[0] = cl.mtime[1] = 1.0f; // because level starts from 1.0f second
|
cl.mtime[0] = cl.mtime[1] = 1.0f; // because level starts from 1.0f second
|
||||||
@@ -1492,6 +1494,7 @@ void CL_Disconnect( void )
|
|||||||
cls.connect_time = 0;
|
cls.connect_time = 0;
|
||||||
cls.changedemo = false;
|
cls.changedemo = false;
|
||||||
cls.max_fragment_size = FRAGMENT_MAX_SIZE; // reset fragment size
|
cls.max_fragment_size = FRAGMENT_MAX_SIZE; // reset fragment size
|
||||||
|
Voice_Disconnect();
|
||||||
CL_Stop_f();
|
CL_Stop_f();
|
||||||
|
|
||||||
// send a disconnect message to the server
|
// send a disconnect message to the server
|
||||||
@@ -1554,17 +1557,43 @@ void CL_LocalServers_f( void )
|
|||||||
netadr_t adr;
|
netadr_t adr;
|
||||||
|
|
||||||
Con_Printf( "Scanning for servers on the local network area...\n" );
|
Con_Printf( "Scanning for servers on the local network area...\n" );
|
||||||
NET_Config( true ); // allow remote
|
NET_Config( true, true ); // allow remote
|
||||||
cls.legacyservercount = 0;
|
|
||||||
|
|
||||||
// send a broadcast packet
|
// send a broadcast packet
|
||||||
adr.type = NA_BROADCAST;
|
adr.type = NA_BROADCAST;
|
||||||
adr.port = MSG_BigShort( PORT_SERVER );
|
adr.port = MSG_BigShort( PORT_SERVER );
|
||||||
|
Netchan_OutOfBandPrint( NS_CLIENT, adr, "info %i", PROTOCOL_VERSION );
|
||||||
|
|
||||||
|
adr.type = NA_MULTICAST_IP6;
|
||||||
Netchan_OutOfBandPrint( NS_CLIENT, adr, "info %i", PROTOCOL_VERSION );
|
Netchan_OutOfBandPrint( NS_CLIENT, adr, "info %i", PROTOCOL_VERSION );
|
||||||
}
|
}
|
||||||
|
|
||||||
#define MS_SCAN_REQUEST "1\xFF" "0.0.0.0:0\0"
|
/*
|
||||||
|
=================
|
||||||
|
CL_BuildMasterServerScanRequest
|
||||||
|
=================
|
||||||
|
*/
|
||||||
|
size_t CL_BuildMasterServerScanRequest( char *buf, size_t size, qboolean nat )
|
||||||
|
{
|
||||||
|
size_t remaining;
|
||||||
|
char *info;
|
||||||
|
|
||||||
|
if( unlikely( size < sizeof( MS_SCAN_REQUEST )))
|
||||||
|
return 0;
|
||||||
|
|
||||||
|
Q_strncpy( buf, MS_SCAN_REQUEST, size );
|
||||||
|
|
||||||
|
info = buf + sizeof( MS_SCAN_REQUEST ) - 1;
|
||||||
|
remaining = size - sizeof( MS_SCAN_REQUEST );
|
||||||
|
|
||||||
|
info[0] = 0;
|
||||||
|
|
||||||
|
Info_SetValueForKey( info, "gamedir", GI->gamefolder, remaining );
|
||||||
|
Info_SetValueForKey( info, "clver", XASH_VERSION, remaining ); // let master know about client version
|
||||||
|
Info_SetValueForKey( info, "nat", nat ? "1" : "0", remaining );
|
||||||
|
|
||||||
|
return sizeof( MS_SCAN_REQUEST ) + Q_strlen( info );
|
||||||
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
=================
|
=================
|
||||||
@@ -1573,19 +1602,17 @@ CL_InternetServers_f
|
|||||||
*/
|
*/
|
||||||
void CL_InternetServers_f( void )
|
void CL_InternetServers_f( void )
|
||||||
{
|
{
|
||||||
char fullquery[512] = MS_SCAN_REQUEST;
|
char fullquery[512];
|
||||||
char *info = fullquery + sizeof( MS_SCAN_REQUEST ) - 1;
|
size_t len;
|
||||||
const size_t remaining = sizeof( fullquery ) - sizeof( MS_SCAN_REQUEST );
|
qboolean nat = cl_nat->value != 0.0f;
|
||||||
|
|
||||||
NET_Config( true ); // allow remote
|
len = CL_BuildMasterServerScanRequest( fullquery, sizeof( fullquery ), nat );
|
||||||
|
|
||||||
Con_Printf( "Scanning for servers on the internet area...\n" );
|
Con_Printf( "Scanning for servers on the internet area...\n" );
|
||||||
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 );
|
NET_Config( true, true ); // allow remote
|
||||||
|
|
||||||
|
cls.internetservers_wait = NET_SendToMasters( NS_CLIENT, len, fullquery );
|
||||||
cls.internetservers_pending = true;
|
cls.internetservers_pending = true;
|
||||||
|
|
||||||
if( !cls.internetservers_wait )
|
if( !cls.internetservers_wait )
|
||||||
@@ -1619,6 +1646,8 @@ void CL_Reconnect_f( void )
|
|||||||
|
|
||||||
if( COM_CheckString( cls.servername ))
|
if( COM_CheckString( cls.servername ))
|
||||||
{
|
{
|
||||||
|
qboolean legacy = cls.legacymode;
|
||||||
|
|
||||||
if( cls.state >= ca_connected )
|
if( cls.state >= ca_connected )
|
||||||
CL_Disconnect();
|
CL_Disconnect();
|
||||||
|
|
||||||
@@ -1626,6 +1655,7 @@ void CL_Reconnect_f( void )
|
|||||||
cls.demonum = cls.movienum = -1; // not in the demo loop now
|
cls.demonum = cls.movienum = -1; // not in the demo loop now
|
||||||
cls.state = ca_connecting;
|
cls.state = ca_connecting;
|
||||||
cls.signon = 0;
|
cls.signon = 0;
|
||||||
|
cls.legacymode = legacy; // don't change protocol
|
||||||
|
|
||||||
Con_Printf( "reconnecting...\n" );
|
Con_Printf( "reconnecting...\n" );
|
||||||
}
|
}
|
||||||
@@ -1707,36 +1737,39 @@ void CL_ParseStatusMessage( netadr_t from, sizebuf_t *msg )
|
|||||||
static char infostring[MAX_INFO_STRING+8];
|
static char infostring[MAX_INFO_STRING+8];
|
||||||
char *s = MSG_ReadString( msg );
|
char *s = MSG_ReadString( msg );
|
||||||
int i;
|
int i;
|
||||||
|
const char *magic = ": wrong version\n";
|
||||||
|
size_t len = Q_strlen( s ), magiclen = Q_strlen( magic );
|
||||||
|
|
||||||
CL_FixupColorStringsForInfoString( s, infostring );
|
if( len >= magiclen && !Q_strcmp( s + len - magiclen, magic ))
|
||||||
|
|
||||||
if( Q_strstr( infostring, "wrong version" ) )
|
|
||||||
{
|
{
|
||||||
Netchan_OutOfBandPrint( NS_CLIENT, from, "info %i", PROTOCOL_LEGACY_VERSION );
|
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;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if( !Info_IsValid( s ))
|
||||||
|
{
|
||||||
|
Con_Printf( "^1Server^7: %s, invalid infostring\n", NET_AdrToString( from ));
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
CL_FixupColorStringsForInfoString( s, infostring );
|
||||||
|
|
||||||
if( !COM_CheckString( Info_ValueForKey( infostring, "gamedir" )))
|
if( !COM_CheckString( Info_ValueForKey( infostring, "gamedir" )))
|
||||||
{
|
{
|
||||||
Con_Printf( "^1Server^7: %s, Info: %s\n", NET_AdrToString( from ), infostring );
|
Con_Printf( "^1Server^7: %s, Info: %s\n", NET_AdrToString( from ), infostring );
|
||||||
return; // unsupported proto
|
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_Printf( "^3Server^7: %s, Game: %s\n", NET_AdrToString( from ), Info_ValueForKey( infostring, "gamedir" ));
|
||||||
Info_SetValueForKey( infostring, "legacy", "1", sizeof( infostring ) );
|
}
|
||||||
Con_Print("Legacy: ");
|
else
|
||||||
break;
|
{
|
||||||
}
|
// more info about servers
|
||||||
|
Con_Printf( "^2Server^7: %s, Game: %s\n", NET_AdrToString( from ), Info_ValueForKey( infostring, "gamedir" ));
|
||||||
}
|
}
|
||||||
|
|
||||||
// more info about servers
|
|
||||||
Con_Printf( "^2Server^7: %s, Game: %s\n", NET_AdrToString( from ), Info_ValueForKey( infostring, "gamedir" ));
|
|
||||||
|
|
||||||
UI_AddServerToList( from, infostring );
|
UI_AddServerToList( from, infostring );
|
||||||
}
|
}
|
||||||
@@ -2047,7 +2080,7 @@ void CL_ConnectionlessPacket( netadr_t from, sizebuf_t *msg )
|
|||||||
|
|
||||||
if( NET_CompareAdr( from, cls.legacyserver ))
|
if( NET_CompareAdr( from, cls.legacyserver ))
|
||||||
{
|
{
|
||||||
Cbuf_AddText( va( "connect %s legacy\n", NET_AdrToString( from )));
|
Cbuf_AddTextf( "connect %s legacy\n", NET_AdrToString( from ));
|
||||||
memset( &cls.legacyserver, 0, sizeof( cls.legacyserver ));
|
memset( &cls.legacyserver, 0, sizeof( cls.legacyserver ));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -2095,6 +2128,12 @@ void CL_ConnectionlessPacket( netadr_t from, sizebuf_t *msg )
|
|||||||
}
|
}
|
||||||
else if( !Q_strcmp( c, "f" ))
|
else if( !Q_strcmp( c, "f" ))
|
||||||
{
|
{
|
||||||
|
if( !NET_IsMasterAdr( from ))
|
||||||
|
{
|
||||||
|
Con_Printf( S_WARN "unexpected server list packet from %s\n", NET_AdrToString( from ));
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
// serverlist got from masterserver
|
// serverlist got from masterserver
|
||||||
while( MSG_GetNumBitsLeft( msg ) > 8 )
|
while( MSG_GetNumBitsLeft( msg ) > 8 )
|
||||||
{
|
{
|
||||||
@@ -2153,7 +2192,7 @@ void CL_ConnectionlessPacket( netadr_t from, sizebuf_t *msg )
|
|||||||
}
|
}
|
||||||
else if( clgame.request_type == NET_REQUEST_GAMEUI )
|
else if( clgame.request_type == NET_REQUEST_GAMEUI )
|
||||||
{
|
{
|
||||||
NET_Config( true ); // allow remote
|
NET_Config( true, false ); // allow remote
|
||||||
Netchan_OutOfBandPrint( NS_CLIENT, servadr, "info %i", PROTOCOL_VERSION );
|
Netchan_OutOfBandPrint( NS_CLIENT, servadr, "info %i", PROTOCOL_VERSION );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -2345,11 +2384,10 @@ Replace the displayed name for some resources
|
|||||||
*/
|
*/
|
||||||
const char *CL_CleanFileName( const char *filename )
|
const char *CL_CleanFileName( const char *filename )
|
||||||
{
|
{
|
||||||
const char *pfilename = filename;
|
|
||||||
|
|
||||||
if( COM_CheckString( filename ) && filename[0] == '!' )
|
if( COM_CheckString( filename ) && filename[0] == '!' )
|
||||||
pfilename = "customization";
|
return "customization";
|
||||||
return pfilename;
|
|
||||||
|
return filename;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -2397,7 +2435,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 )
|
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];
|
byte rgucMD5_hash[16];
|
||||||
const char *pfilename;
|
const char *pfilename;
|
||||||
resource_t *p;
|
resource_t *p;
|
||||||
@@ -2406,11 +2444,18 @@ void CL_ProcessFile( qboolean successfully_received, const char *filename )
|
|||||||
{
|
{
|
||||||
if( filename[0] != '!' )
|
if( filename[0] != '!' )
|
||||||
Con_Printf( "processing %s\n", filename );
|
Con_Printf( "processing %s\n", filename );
|
||||||
|
|
||||||
|
if( !Q_strnicmp( filename, "downloaded/", 11 ))
|
||||||
|
{
|
||||||
|
// skip "downloaded/" part to avoid mismatch with needed resources list
|
||||||
|
filename += 11;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
else if( !successfully_received )
|
else if( !successfully_received )
|
||||||
{
|
{
|
||||||
Con_Printf( S_ERROR "server failed to transmit file '%s'\n", CL_CleanFileName( filename ));
|
Con_Printf( S_ERROR "server failed to transmit file '%s'\n", CL_CleanFileName( filename ));
|
||||||
}
|
}
|
||||||
|
|
||||||
if( cls.legacymode )
|
if( cls.legacymode )
|
||||||
{
|
{
|
||||||
if( host.downloadcount > 0 )
|
if( host.downloadcount > 0 )
|
||||||
@@ -2529,7 +2574,7 @@ CL_ServerCommand
|
|||||||
send command to a server
|
send command to a server
|
||||||
====================
|
====================
|
||||||
*/
|
*/
|
||||||
void CL_ServerCommand( qboolean reliable, char *fmt, ... )
|
void CL_ServerCommand( qboolean reliable, const char *fmt, ... )
|
||||||
{
|
{
|
||||||
char string[MAX_SYSPATH];
|
char string[MAX_SYSPATH];
|
||||||
va_list argptr;
|
va_list argptr;
|
||||||
@@ -2538,7 +2583,7 @@ void CL_ServerCommand( qboolean reliable, char *fmt, ... )
|
|||||||
return;
|
return;
|
||||||
|
|
||||||
va_start( argptr, fmt );
|
va_start( argptr, fmt );
|
||||||
Q_vsprintf( string, fmt, argptr );
|
Q_vsnprintf( string, sizeof( string ), fmt, argptr );
|
||||||
va_end( argptr );
|
va_end( argptr );
|
||||||
|
|
||||||
if( reliable )
|
if( reliable )
|
||||||
@@ -2666,7 +2711,7 @@ qboolean CL_PrecacheResources( void )
|
|||||||
{
|
{
|
||||||
if( FBitSet( pRes->ucFlags, RES_WASMISSING ))
|
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_precache[pRes->nIndex][0] = 0;
|
||||||
cl.sound_index[pRes->nIndex] = 0;
|
cl.sound_index[pRes->nIndex] = 0;
|
||||||
}
|
}
|
||||||
@@ -2807,20 +2852,23 @@ void CL_InitLocal( void )
|
|||||||
Cvar_RegisterVariable( &cl_download_ingame );
|
Cvar_RegisterVariable( &cl_download_ingame );
|
||||||
Cvar_RegisterVariable( &cl_logofile );
|
Cvar_RegisterVariable( &cl_logofile );
|
||||||
Cvar_RegisterVariable( &cl_logocolor );
|
Cvar_RegisterVariable( &cl_logocolor );
|
||||||
|
Cvar_RegisterVariable( &cl_logoext );
|
||||||
Cvar_RegisterVariable( &cl_test_bandwidth );
|
Cvar_RegisterVariable( &cl_test_bandwidth );
|
||||||
|
|
||||||
|
Voice_RegisterCvars();
|
||||||
|
VGui_RegisterCvars();
|
||||||
|
|
||||||
// register our variables
|
// register our variables
|
||||||
cl_crosshair = Cvar_Get( "crosshair", "1", FCVAR_ARCHIVE, "show weapon chrosshair" );
|
cl_crosshair = Cvar_Get( "crosshair", "1", FCVAR_ARCHIVE, "show weapon chrosshair" );
|
||||||
cl_nodelta = Cvar_Get ("cl_nodelta", "0", 0, "disable delta-compression for server messages" );
|
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_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_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_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)" );
|
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" );
|
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", "", FCVAR_PRIVILEGED, "remote control address" );
|
||||||
rcon_address = Cvar_Get( "rcon_address", "", 0, "remote control address" );
|
|
||||||
|
|
||||||
cl_trace_messages = Cvar_Get( "cl_trace_messages", "0", FCVAR_ARCHIVE|FCVAR_CHEAT, "enable message names tracing (good for developers)");
|
cl_trace_messages = Cvar_Get( "cl_trace_messages", "0", FCVAR_ARCHIVE|FCVAR_CHEAT, "enable message names tracing (good for developers)");
|
||||||
|
|
||||||
@@ -2831,7 +2879,8 @@ void CL_InitLocal( void )
|
|||||||
cl_updaterate = Cvar_Get( "cl_updaterate", "20", FCVAR_USERINFO|FCVAR_ARCHIVE, "refresh rate of server messages" );
|
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_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" );
|
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" );
|
cl_nat = Cvar_Get( "cl_nat", "0", 0, "show servers running under NAT" );
|
||||||
|
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" );
|
topcolor = Cvar_Get( "topcolor", "0", FCVAR_USERINFO|FCVAR_ARCHIVE, "player top color" );
|
||||||
bottomcolor = Cvar_Get( "bottomcolor", "0", FCVAR_USERINFO|FCVAR_ARCHIVE, "player bottom 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" );
|
cl_lw = Cvar_Get( "cl_lw", "1", FCVAR_ARCHIVE|FCVAR_USERINFO, "enable client weapon predicting" );
|
||||||
@@ -2840,11 +2889,11 @@ void CL_InitLocal( void )
|
|||||||
Cvar_Get( "team", "", FCVAR_USERINFO, "player team" );
|
Cvar_Get( "team", "", FCVAR_USERINFO, "player team" );
|
||||||
Cvar_Get( "skin", "", FCVAR_USERINFO, "player skin" );
|
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" );
|
||||||
cl_nosmooth = Cvar_Get( "cl_nosmooth", "0", FCVAR_ARCHIVE, "disable smooth up stair climbing and interpolate position in multiplayer" );
|
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_smoothtime = Cvar_Get( "cl_smoothtime", "0.1", FCVAR_ARCHIVE, "time to smooth up" );
|
||||||
cl_cmdbackup = Cvar_Get( "cl_cmdbackup", "10", FCVAR_ARCHIVE, "how many additional history commands are sent" );
|
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" );
|
cl_cmdrate = Cvar_Get( "cl_cmdrate", "60", FCVAR_ARCHIVE, "Max number of command packets sent to server per second" );
|
||||||
cl_draw_particles = Cvar_Get( "r_drawparticles", "1", FCVAR_CHEAT, "render particles" );
|
cl_draw_particles = Cvar_Get( "r_drawparticles", "1", FCVAR_CHEAT, "render particles" );
|
||||||
cl_draw_tracers = Cvar_Get( "r_drawtracers", "1", FCVAR_CHEAT, "render tracers" );
|
cl_draw_tracers = Cvar_Get( "r_drawtracers", "1", FCVAR_CHEAT, "render tracers" );
|
||||||
cl_draw_beams = Cvar_Get( "r_drawbeams", "1", FCVAR_CHEAT, "render beams" );
|
cl_draw_beams = Cvar_Get( "r_drawbeams", "1", FCVAR_CHEAT, "render beams" );
|
||||||
@@ -2853,6 +2902,7 @@ void CL_InitLocal( void )
|
|||||||
cl_bmodelinterp = Cvar_Get( "cl_bmodelinterp", "1", FCVAR_ARCHIVE, "enable bmodel interpolation" );
|
cl_bmodelinterp = Cvar_Get( "cl_bmodelinterp", "1", FCVAR_ARCHIVE, "enable bmodel interpolation" );
|
||||||
cl_clockreset = Cvar_Get( "cl_clockreset", "0.1", FCVAR_ARCHIVE, "frametime delta maximum value before reset" );
|
cl_clockreset = Cvar_Get( "cl_clockreset", "0.1", FCVAR_ARCHIVE, "frametime delta maximum value before reset" );
|
||||||
cl_fixtimerate = Cvar_Get( "cl_fixtimerate", "7.5", FCVAR_ARCHIVE, "time in msec to client clock adjusting" );
|
cl_fixtimerate = Cvar_Get( "cl_fixtimerate", "7.5", FCVAR_ARCHIVE, "time in msec to client clock adjusting" );
|
||||||
|
hud_fontscale = Cvar_Get( "hud_fontscale", "1.0", FCVAR_ARCHIVE|FCVAR_LATCH, "scale hud font texture" );
|
||||||
hud_scale = Cvar_Get( "hud_scale", "0", FCVAR_ARCHIVE|FCVAR_LATCH, "scale hud at current resolution" );
|
hud_scale = Cvar_Get( "hud_scale", "0", FCVAR_ARCHIVE|FCVAR_LATCH, "scale hud at current resolution" );
|
||||||
Cvar_Get( "cl_background", "0", FCVAR_READ_ONLY, "indicate what background map is running" );
|
Cvar_Get( "cl_background", "0", FCVAR_READ_ONLY, "indicate what background map is running" );
|
||||||
cl_showevents = Cvar_Get( "cl_showevents", "0", FCVAR_ARCHIVE, "show events playback" );
|
cl_showevents = Cvar_Get( "cl_showevents", "0", FCVAR_ARCHIVE, "show events playback" );
|
||||||
@@ -2870,10 +2920,15 @@ void CL_InitLocal( void )
|
|||||||
Cmd_AddCommand ("give", NULL, "give specified item or weapon" );
|
Cmd_AddCommand ("give", NULL, "give specified item or weapon" );
|
||||||
Cmd_AddCommand ("drop", NULL, "drop current/specified item or weapon" );
|
Cmd_AddCommand ("drop", NULL, "drop current/specified item or weapon" );
|
||||||
Cmd_AddCommand ("gametitle", NULL, "show game logo" );
|
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 ("god", NULL, "enable godmode" );
|
||||||
Cmd_AddCommand ("fov", NULL, "set client field of view" );
|
Cmd_AddCommand ("fov", NULL, "set client field of view" );
|
||||||
Cmd_AddCommand ("log", NULL, "logging server events" );
|
|
||||||
|
Cmd_AddRestrictedCommand ("ent_list", NULL, "list entities on server" );
|
||||||
|
Cmd_AddRestrictedCommand ("ent_fire", NULL, "fire entity command (be careful)" );
|
||||||
|
Cmd_AddRestrictedCommand ("ent_info", NULL, "dump entity information" );
|
||||||
|
Cmd_AddRestrictedCommand ("ent_create", NULL, "create entity with specified values (be careful)" );
|
||||||
|
Cmd_AddRestrictedCommand ("ent_getvars", NULL, "put parameters of specified entities to client's' ent_last_* cvars" );
|
||||||
|
|
||||||
// register our commands
|
// register our commands
|
||||||
Cmd_AddCommand ("pause", NULL, "pause the game (if the server allows pausing)" );
|
Cmd_AddCommand ("pause", NULL, "pause the game (if the server allows pausing)" );
|
||||||
@@ -2881,9 +2936,10 @@ void CL_InitLocal( void )
|
|||||||
Cmd_AddCommand ("internetservers", CL_InternetServers_f, "collect info about internet 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 ("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 ("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_AddRestrictedCommand ("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 ("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 ("physinfo", CL_Physinfo_f, "print current client physinfo" );
|
||||||
Cmd_AddCommand ("disconnect", CL_Disconnect_f, "disconnect from server" );
|
Cmd_AddCommand ("disconnect", CL_Disconnect_f, "disconnect from server" );
|
||||||
Cmd_AddCommand ("record", CL_Record_f, "record a demo" );
|
Cmd_AddCommand ("record", CL_Record_f, "record a demo" );
|
||||||
@@ -2902,8 +2958,8 @@ void CL_InitLocal( void )
|
|||||||
Cmd_AddCommand ("fullserverinfo", CL_FullServerinfo_f, "sent by server when serverinfo changes" );
|
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 ("upload", CL_BeginUpload_f, "uploading file to the server" );
|
||||||
|
|
||||||
Cmd_AddCommand ("quit", CL_Quit_f, "quit from game" );
|
Cmd_AddRestrictedCommand ("quit", CL_Quit_f, "quit from game" );
|
||||||
Cmd_AddCommand ("exit", 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 ("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" );
|
Cmd_AddCommand ("snapshot", CL_SnapShot_f, "takes a snapshot of the next rendered frame" );
|
||||||
@@ -2940,12 +2996,12 @@ void CL_AdjustClock( void )
|
|||||||
if( fabs( cl.timedelta ) >= 0.001f )
|
if( fabs( cl.timedelta ) >= 0.001f )
|
||||||
{
|
{
|
||||||
double msec, adjust;
|
double msec, adjust;
|
||||||
float sign;
|
double sign;
|
||||||
|
|
||||||
msec = ( cl.timedelta * 1000.0f );
|
msec = ( cl.timedelta * 1000.0 );
|
||||||
sign = ( msec < 0 ) ? 1.0f : -1.0f;
|
sign = ( msec < 0 ) ? 1.0 : -1.0;
|
||||||
msec = fabs( msec );
|
msec = Q_min( cl_fixtimerate->value, fabs( msec ));
|
||||||
adjust = sign * ( cl_fixtimerate->value / 1000.0f );
|
adjust = sign * ( msec / 1000.0 );
|
||||||
|
|
||||||
if( fabs( adjust ) < fabs( cl.timedelta ))
|
if( fabs( adjust ) < fabs( cl.timedelta ))
|
||||||
{
|
{
|
||||||
@@ -2966,12 +3022,12 @@ Host_ClientBegin
|
|||||||
*/
|
*/
|
||||||
void Host_ClientBegin( void )
|
void Host_ClientBegin( void )
|
||||||
{
|
{
|
||||||
// if client is not active, do nothing
|
|
||||||
if( !cls.initialized ) return;
|
|
||||||
|
|
||||||
// exec console commands
|
// exec console commands
|
||||||
Cbuf_Execute ();
|
Cbuf_Execute ();
|
||||||
|
|
||||||
|
// if client is not active, do nothing
|
||||||
|
if( !cls.initialized ) return;
|
||||||
|
|
||||||
// finalize connection process if needs
|
// finalize connection process if needs
|
||||||
CL_CheckClientState();
|
CL_CheckClientState();
|
||||||
|
|
||||||
@@ -3009,8 +3065,8 @@ void Host_ClientFrame( void )
|
|||||||
// a new portion updates from server
|
// a new portion updates from server
|
||||||
CL_RedoPrediction ();
|
CL_RedoPrediction ();
|
||||||
|
|
||||||
// TODO: implement
|
// update voice
|
||||||
// Voice_Idle( host.frametime );
|
Voice_Idle( host.frametime );
|
||||||
|
|
||||||
// emit visible entities
|
// emit visible entities
|
||||||
CL_EmitEntities ();
|
CL_EmitEntities ();
|
||||||
@@ -3030,9 +3086,6 @@ void Host_ClientFrame( void )
|
|||||||
// catch changes video settings
|
// catch changes video settings
|
||||||
VID_CheckChanges();
|
VID_CheckChanges();
|
||||||
|
|
||||||
// process VGUI
|
|
||||||
VGui_RunFrame ();
|
|
||||||
|
|
||||||
// update the screen
|
// update the screen
|
||||||
SCR_UpdateScreen ();
|
SCR_UpdateScreen ();
|
||||||
|
|
||||||
@@ -3064,12 +3117,13 @@ void CL_Init( void )
|
|||||||
|
|
||||||
VID_Init(); // init video
|
VID_Init(); // init video
|
||||||
S_Init(); // init sound
|
S_Init(); // init sound
|
||||||
|
Voice_Init( VOICE_DEFAULT_CODEC, 3 ); // init voice
|
||||||
|
Sequence_Init();
|
||||||
|
|
||||||
// unreliable buffer. unsed for unreliable commands and voice stream
|
// unreliable buffer. unsed for unreliable commands and voice stream
|
||||||
MSG_Init( &cls.datagram, "cls.datagram", cls.datagram_buf, sizeof( cls.datagram_buf ));
|
MSG_Init( &cls.datagram, "cls.datagram", cls.datagram_buf, sizeof( cls.datagram_buf ));
|
||||||
|
|
||||||
// IN_TouchInit();
|
// IN_TouchInit();
|
||||||
Con_LoadHistory();
|
|
||||||
|
|
||||||
COM_GetCommonLibraryPath( LIBRARY_CLIENT, libpath, sizeof( libpath ));
|
COM_GetCommonLibraryPath( LIBRARY_CLIENT, libpath, sizeof( libpath ));
|
||||||
|
|
||||||
@@ -3090,13 +3144,9 @@ CL_Shutdown
|
|||||||
*/
|
*/
|
||||||
void CL_Shutdown( void )
|
void CL_Shutdown( void )
|
||||||
{
|
{
|
||||||
// already freed
|
|
||||||
if( !cls.initialized ) return;
|
|
||||||
cls.initialized = false;
|
|
||||||
|
|
||||||
Con_Printf( "CL_Shutdown()\n" );
|
Con_Printf( "CL_Shutdown()\n" );
|
||||||
|
|
||||||
if( !host.crashed )
|
if( !host.crashed && cls.initialized )
|
||||||
{
|
{
|
||||||
Host_WriteOpenGLConfig ();
|
Host_WriteOpenGLConfig ();
|
||||||
Host_WriteVideoConfig ();
|
Host_WriteVideoConfig ();
|
||||||
@@ -3110,11 +3160,18 @@ void CL_Shutdown( void )
|
|||||||
Mobile_Shutdown ();
|
Mobile_Shutdown ();
|
||||||
SCR_Shutdown ();
|
SCR_Shutdown ();
|
||||||
CL_UnloadProgs ();
|
CL_UnloadProgs ();
|
||||||
|
cls.initialized = false;
|
||||||
|
|
||||||
FS_Delete( "demoheader.tmp" ); // remove tmp file
|
// for client-side VGUI support we use other order
|
||||||
|
if( FI && FI->GameInfo && !FI->GameInfo->internal_vgui_support )
|
||||||
|
VGui_Shutdown();
|
||||||
|
|
||||||
|
if( g_fsapi.Delete )
|
||||||
|
g_fsapi.Delete( "demoheader.tmp" ); // remove tmp file
|
||||||
SCR_FreeCinematic (); // release AVI's *after* client.dll because custom renderer may use them
|
SCR_FreeCinematic (); // release AVI's *after* client.dll because custom renderer may use them
|
||||||
S_Shutdown ();
|
S_Shutdown ();
|
||||||
R_Shutdown ();
|
R_Shutdown ();
|
||||||
|
|
||||||
Con_Shutdown ();
|
Con_Shutdown ();
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -25,6 +25,9 @@ mobile_engfuncs_t *gMobileEngfuncs;
|
|||||||
convar_t *vibration_length;
|
convar_t *vibration_length;
|
||||||
convar_t *vibration_enable;
|
convar_t *vibration_enable;
|
||||||
|
|
||||||
|
static cl_font_t g_scaled_font;
|
||||||
|
static float g_font_scale;
|
||||||
|
|
||||||
static void pfnVibrate( float life, char flags )
|
static void pfnVibrate( float life, char flags )
|
||||||
{
|
{
|
||||||
if( !vibration_enable->value )
|
if( !vibration_enable->value )
|
||||||
@@ -60,28 +63,28 @@ static void pfnEnableTextInput( int enable )
|
|||||||
|
|
||||||
static int pfnDrawScaledCharacter( int x, int y, int number, int r, int g, int b, float scale )
|
static int pfnDrawScaledCharacter( int x, int y, int number, int r, int g, int b, float scale )
|
||||||
{
|
{
|
||||||
int width = clgame.scrInfo.charWidths[number] * scale * hud_scale->value;
|
// this call is very ineffective and possibly broken!
|
||||||
int height = clgame.scrInfo.iCharHeight * scale * hud_scale->value;
|
rgba_t color = { r, g, b, 255 };
|
||||||
|
int flags = FONT_DRAW_HUD;
|
||||||
|
|
||||||
if( !cls.creditsFont.valid )
|
if( hud_utf8->value )
|
||||||
return 0;
|
SetBits( flags, FONT_DRAW_UTF8 );
|
||||||
|
|
||||||
x *= hud_scale->value;
|
if( fabs( g_font_scale - scale ) > 0.1f ||
|
||||||
y *= hud_scale->value;
|
g_scaled_font.hFontTexture != cls.creditsFont.hFontTexture )
|
||||||
|
{
|
||||||
|
int i;
|
||||||
|
|
||||||
number &= 255;
|
g_scaled_font = cls.creditsFont;
|
||||||
number = Con_UtfProcessChar( number );
|
g_scaled_font.scale *= scale;
|
||||||
|
g_scaled_font.charHeight *= scale;
|
||||||
|
for( i = 0; i < ARRAYSIZE( g_scaled_font.charWidths ); i++ )
|
||||||
|
g_scaled_font.charWidths[i] *= scale;
|
||||||
|
|
||||||
if( number < 32 )
|
g_font_scale = scale;
|
||||||
return 0;
|
}
|
||||||
|
|
||||||
if( y < -height )
|
return CL_DrawCharacter( x, y, number, color, &g_scaled_font, flags );
|
||||||
return 0;
|
|
||||||
|
|
||||||
pfnPIC_Set( cls.creditsFont.hFontTexture, r, g, b, 255 );
|
|
||||||
pfnPIC_DrawAdditive( x, y, width, height, &cls.creditsFont.fontRc[number] );
|
|
||||||
|
|
||||||
return width;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static void *pfnGetNativeObject( const char *obj )
|
static void *pfnGetNativeObject( const char *obj )
|
||||||
@@ -93,6 +96,20 @@ static void *pfnGetNativeObject( const char *obj )
|
|||||||
return Platform_GetNativeObject( 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 char *pfnParseFileSafe( char *data, char *buf, const int size, unsigned int flags, int *len )
|
||||||
|
{
|
||||||
|
return COM_ParseFileSafe( data, buf, size, flags, len, NULL );
|
||||||
|
}
|
||||||
|
|
||||||
static mobile_engfuncs_t gpMobileEngfuncs =
|
static mobile_engfuncs_t gpMobileEngfuncs =
|
||||||
{
|
{
|
||||||
@@ -101,14 +118,15 @@ static mobile_engfuncs_t gpMobileEngfuncs =
|
|||||||
pfnEnableTextInput,
|
pfnEnableTextInput,
|
||||||
Touch_AddClientButton,
|
Touch_AddClientButton,
|
||||||
Touch_AddDefaultButton,
|
Touch_AddDefaultButton,
|
||||||
Touch_HideButtons,
|
pfnTouch_HideButtons,
|
||||||
Touch_RemoveButton,
|
pfnTouch_RemoveButton,
|
||||||
(void*)Touch_SetClientOnly,
|
Touch_SetClientOnly,
|
||||||
Touch_ResetDefaultButtons,
|
Touch_ResetDefaultButtons,
|
||||||
pfnDrawScaledCharacter,
|
pfnDrawScaledCharacter,
|
||||||
Sys_Warn,
|
Sys_Warn,
|
||||||
pfnGetNativeObject,
|
pfnGetNativeObject,
|
||||||
ID_SetCustomClientID
|
ID_SetCustomClientID,
|
||||||
|
pfnParseFileSafe
|
||||||
};
|
};
|
||||||
|
|
||||||
qboolean Mobile_Init( void )
|
qboolean Mobile_Init( void )
|
||||||
@@ -124,8 +142,8 @@ qboolean Mobile_Init( void )
|
|||||||
success = true;
|
success = true;
|
||||||
|
|
||||||
Cmd_AddCommand( "vibrate", (xcommand_t)Vibrate_f, "Vibrate for specified time");
|
Cmd_AddCommand( "vibrate", (xcommand_t)Vibrate_f, "Vibrate for specified time");
|
||||||
vibration_length = Cvar_Get( "vibration_length", "1.0", FCVAR_ARCHIVE, "Vibration length");
|
vibration_length = Cvar_Get( "vibration_length", "1.0", FCVAR_ARCHIVE | FCVAR_PRIVILEGED, "Vibration length");
|
||||||
vibration_enable = Cvar_Get( "vibration_enable", "1", FCVAR_ARCHIVE, "Enable vibration");
|
vibration_enable = Cvar_Get( "vibration_enable", "1", FCVAR_ARCHIVE | FCVAR_PRIVILEGED, "Enable vibration");
|
||||||
|
|
||||||
return success;
|
return success;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -15,10 +15,13 @@ GNU General Public License for more details.
|
|||||||
|
|
||||||
#include "common.h"
|
#include "common.h"
|
||||||
#include "client.h"
|
#include "client.h"
|
||||||
|
#include "kbutton.h"
|
||||||
|
|
||||||
#if XASH_LOW_MEMORY
|
#if XASH_LOW_MEMORY == 0
|
||||||
#define NET_TIMINGS 1024
|
#define NET_TIMINGS 1024
|
||||||
#else
|
#elif XASH_LOW_MEMORY == 1
|
||||||
|
#define NET_TIMINGS 256
|
||||||
|
#elif XASH_LOW_MEMORY == 2
|
||||||
#define NET_TIMINGS 64
|
#define NET_TIMINGS 64
|
||||||
#endif
|
#endif
|
||||||
#define NET_TIMINGS_MASK (NET_TIMINGS - 1)
|
#define NET_TIMINGS_MASK (NET_TIMINGS - 1)
|
||||||
@@ -31,11 +34,11 @@ GNU General Public License for more details.
|
|||||||
#define NUM_LATENCY_SAMPLES 8
|
#define NUM_LATENCY_SAMPLES 8
|
||||||
|
|
||||||
convar_t *net_graph;
|
convar_t *net_graph;
|
||||||
convar_t *net_graphpos;
|
static convar_t *net_graphpos;
|
||||||
convar_t *net_graphwidth;
|
static convar_t *net_graphwidth;
|
||||||
convar_t *net_graphheight;
|
static convar_t *net_graphheight;
|
||||||
convar_t *net_graphsolid;
|
static convar_t *net_graphsolid;
|
||||||
convar_t *net_scale;
|
static convar_t *net_scale;
|
||||||
|
|
||||||
static struct packet_latency_t
|
static struct packet_latency_t
|
||||||
{
|
{
|
||||||
@@ -93,7 +96,7 @@ NetGraph_AtEdge
|
|||||||
edge detect
|
edge detect
|
||||||
==========
|
==========
|
||||||
*/
|
*/
|
||||||
qboolean NetGraph_AtEdge( int x, int width )
|
static qboolean NetGraph_AtEdge( int x, int width )
|
||||||
{
|
{
|
||||||
if( x > 3 )
|
if( x > 3 )
|
||||||
{
|
{
|
||||||
@@ -111,7 +114,7 @@ NetGraph_InitColors
|
|||||||
init netgraph colors
|
init netgraph colors
|
||||||
==========
|
==========
|
||||||
*/
|
*/
|
||||||
void NetGraph_InitColors( void )
|
static void NetGraph_InitColors( void )
|
||||||
{
|
{
|
||||||
byte mincolor[2][3];
|
byte mincolor[2][3];
|
||||||
byte maxcolor[2][3];
|
byte maxcolor[2][3];
|
||||||
@@ -155,6 +158,7 @@ void NetGraph_InitColors( void )
|
|||||||
f = (float)(i - hfrac) / (float)(NETGRAPH_LERP_HEIGHT - hfrac );
|
f = (float)(i - hfrac) / (float)(NETGRAPH_LERP_HEIGHT - hfrac );
|
||||||
VectorMA( mincolor[1], f, dc[1], netcolors[NETGRAPH_NET_COLORS + i] );
|
VectorMA( mincolor[1], f, dc[1], netcolors[NETGRAPH_NET_COLORS + i] );
|
||||||
}
|
}
|
||||||
|
netcolors[NETGRAPH_NET_COLORS + i][3] = 255;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -165,7 +169,7 @@ NetGraph_GetFrameData
|
|||||||
get frame data info, like chokes, packet losses, also update graph, packet and cmdinfo
|
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;
|
int i, choke_count = 0, loss_count = 0;
|
||||||
double newtime = Sys_DoubleTime();
|
double newtime = Sys_DoubleTime();
|
||||||
@@ -247,7 +251,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;
|
int i, j, extrap_point = NETGRAPH_LERP_HEIGHT / 3, a, h;
|
||||||
rgba_t colors = { 0.9 * 255, 0.9 * 255, 0.7 * 255, 255 };
|
rgba_t colors = { 0.9 * 255, 0.9 * 255, 0.7 * 255, 255 };
|
||||||
@@ -256,7 +260,7 @@ void NetGraph_DrawTimes( wrect_t rect, int x, int w )
|
|||||||
for( a = 0; a < w; a++ )
|
for( a = 0; a < w; a++ )
|
||||||
{
|
{
|
||||||
i = ( cls.netchan.outgoing_sequence - a ) & NET_TIMINGS_MASK;
|
i = ( cls.netchan.outgoing_sequence - a ) & NET_TIMINGS_MASK;
|
||||||
h = ( netstat_cmdinfo[i].cmd_lerp / 3.0f ) * NETGRAPH_LERP_HEIGHT;
|
h = Q_min(( netstat_cmdinfo[i].cmd_lerp / 3.0f ) * NETGRAPH_LERP_HEIGHT, net_graphheight->value * 0.7f);
|
||||||
|
|
||||||
fill.left = x + w - a - 1;
|
fill.left = x + w - a - 1;
|
||||||
fill.right = fill.bottom = 1;
|
fill.right = fill.bottom = 1;
|
||||||
@@ -277,7 +281,10 @@ void NetGraph_DrawTimes( wrect_t rect, int x, int w )
|
|||||||
|
|
||||||
for( j = start; j < h; j++ )
|
for( j = start; j < h; j++ )
|
||||||
{
|
{
|
||||||
NetGraph_DrawRect( &fill, netcolors[NETGRAPH_NET_COLORS + j + extrap_point] );
|
int color = NETGRAPH_NET_COLORS + j + extrap_point;
|
||||||
|
color = Q_min( color, ARRAYSIZE( netcolors ) - 1 );
|
||||||
|
|
||||||
|
NetGraph_DrawRect( &fill, netcolors[color] );
|
||||||
fill.top--;
|
fill.top--;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -293,7 +300,10 @@ void NetGraph_DrawTimes( wrect_t rect, int x, int w )
|
|||||||
|
|
||||||
for( j = 0; j < h; j++ )
|
for( j = 0; j < h; j++ )
|
||||||
{
|
{
|
||||||
NetGraph_DrawRect( &fill, netcolors[NETGRAPH_NET_COLORS + j + oldh] );
|
int color = NETGRAPH_NET_COLORS + j + oldh;
|
||||||
|
color = Q_min( color, ARRAYSIZE( netcolors ) - 1 );
|
||||||
|
|
||||||
|
NetGraph_DrawRect( &fill, netcolors[color] );
|
||||||
fill.top--;
|
fill.top--;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -322,7 +332,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 );
|
int ystep = (int)( 10.0f / net_scale->value );
|
||||||
byte colorminor[4] = { 0, 63, 63, 200 };
|
byte colorminor[4] = { 0, 63, 63, 200 };
|
||||||
@@ -351,9 +361,10 @@ 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;
|
static int lastout;
|
||||||
|
cl_font_t *font = Con_GetFont( 0 );
|
||||||
rgba_t colors = { 0.9 * 255, 0.9 * 255, 0.7 * 255, 255 };
|
rgba_t colors = { 0.9 * 255, 0.9 * 255, 0.7 * 255, 255 };
|
||||||
int ptx = Q_max( x + w - NETGRAPH_LERP_HEIGHT - 1, 1 );
|
int ptx = Q_max( x + w - NETGRAPH_LERP_HEIGHT - 1, 1 );
|
||||||
int pty = Q_max( rect.top + rect.bottom - NETGRAPH_LERP_HEIGHT - 3, 1 );
|
int pty = Q_max( rect.top + rect.bottom - NETGRAPH_LERP_HEIGHT - 3, 1 );
|
||||||
@@ -375,16 +386,17 @@ void NetGraph_DrawTextFields( int x, int y, int w, wrect_t rect, int count, floa
|
|||||||
|
|
||||||
// move rolling average
|
// move rolling average
|
||||||
framerate = FRAMERATE_AVG_FRAC * host.frametime + ( 1.0f - FRAMERATE_AVG_FRAC ) * framerate;
|
framerate = FRAMERATE_AVG_FRAC * host.frametime + ( 1.0f - FRAMERATE_AVG_FRAC ) * framerate;
|
||||||
Con_SetFont( 0 );
|
|
||||||
|
ref.dllFuncs.GL_SetRenderMode( font->rendermode );
|
||||||
|
|
||||||
if( framerate > 0.0f )
|
if( framerate > 0.0f )
|
||||||
{
|
{
|
||||||
y -= net_graphheight->value;
|
y -= net_graphheight->value;
|
||||||
|
|
||||||
Con_DrawString( x, y, va( "%.1f fps" , 1.0f / framerate ), colors );
|
CL_DrawStringf( font, x, y, colors, FONT_DRAW_NORENDERMODE, "%.1f fps" , 1.0f / framerate);
|
||||||
|
|
||||||
if( avg > 1.0f )
|
if( avg > 1.0f )
|
||||||
Con_DrawString( x + 75, y, va( "%i ms" , (int)avg ), colors );
|
CL_DrawStringf( font, x + 75, y, colors, FONT_DRAW_NORENDERMODE, "%i ms" , (int)avg );
|
||||||
|
|
||||||
y += 15;
|
y += 15;
|
||||||
|
|
||||||
@@ -392,27 +404,27 @@ void NetGraph_DrawTextFields( int x, int y, int w, wrect_t rect, int count, floa
|
|||||||
if( !out ) out = lastout;
|
if( !out ) out = lastout;
|
||||||
else lastout = out;
|
else lastout = out;
|
||||||
|
|
||||||
Con_DrawString( x, y, va( "in : %i %.2f k/s", netstat_graph[j].msgbytes, cls.netchan.flow[FLOW_INCOMING].avgkbytespersec ), colors );
|
CL_DrawStringf( font, x, y, colors, FONT_DRAW_NORENDERMODE,
|
||||||
|
"in : %i %.2f kb/s", netstat_graph[j].msgbytes, cls.netchan.flow[FLOW_INCOMING].avgkbytespersec );
|
||||||
y += 15;
|
y += 15;
|
||||||
|
|
||||||
Con_DrawString( x, y, va( "out: %i %.2f k/s", out, cls.netchan.flow[FLOW_OUTGOING].avgkbytespersec ), colors );
|
CL_DrawStringf( font, x, y, colors, FONT_DRAW_NORENDERMODE,
|
||||||
|
"out: %i %.2f kb/s", out, cls.netchan.flow[FLOW_OUTGOING].avgkbytespersec );
|
||||||
y += 15;
|
y += 15;
|
||||||
|
|
||||||
if( net_graph->value > 2 )
|
if( graphtype > 2 )
|
||||||
{
|
{
|
||||||
int loss = (int)(( packet_loss + PACKETLOSS_AVG_FRAC ) - 0.01f );
|
int loss = (int)(( packet_loss + PACKETLOSS_AVG_FRAC ) - 0.01f );
|
||||||
int choke = (int)(( packet_choke + PACKETCHOKE_AVG_FRAC ) - 0.01f );
|
int choke = (int)(( packet_choke + PACKETCHOKE_AVG_FRAC ) - 0.01f );
|
||||||
|
|
||||||
Con_DrawString( x, y, va( "loss: %i choke: %i", loss, choke ), colors );
|
CL_DrawStringf( font, x, y, colors, FONT_DRAW_NORENDERMODE, "loss: %i choke: %i", loss, choke );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if( net_graph->value < 3 )
|
if( graphtype < 3 )
|
||||||
Con_DrawString( ptx, pty, va( "%i/s", (int)cl_cmdrate->value ), colors );
|
CL_DrawStringf( font, ptx, pty, colors, FONT_DRAW_NORENDERMODE, "%i/s", (int)cl_cmdrate->value );
|
||||||
|
|
||||||
Con_DrawString( ptx, last_y, va( "%i/s" , (int)cl_updaterate->value ), colors );
|
CL_DrawStringf( font, ptx, last_y, colors, FONT_DRAW_NORENDERMODE, "%i/s" , (int)cl_updaterate->value );
|
||||||
|
|
||||||
Con_RestoreFont();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
@@ -421,7 +433,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;
|
float h = bytes / net_scale->value;
|
||||||
byte colors[4] = { r, g, b, a };
|
byte colors[4] = { r, g, b, a };
|
||||||
@@ -448,7 +460,7 @@ NetGraph_ColorForHeight
|
|||||||
color based on packet latency
|
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 )
|
switch( packet->latency )
|
||||||
{
|
{
|
||||||
@@ -483,7 +495,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 a, i, h, lastvalidh = 0, ping;
|
||||||
int pingheight = net_graphheight->value - NETGRAPH_LERP_HEIGHT - 2;
|
int pingheight = net_graphheight->value - NETGRAPH_LERP_HEIGHT - 2;
|
||||||
@@ -538,7 +550,7 @@ void NetGraph_DrawDataUsage( int x, int y, int w )
|
|||||||
if( NetGraph_AtEdge( a, w ))
|
if( NetGraph_AtEdge( a, w ))
|
||||||
NetGraph_DrawRect( &fill, color );
|
NetGraph_DrawRect( &fill, color );
|
||||||
|
|
||||||
if( net_graph->value < 2 )
|
if( graphtype < 2 )
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
color[0] = color[1] = color[2] = color[3] = 255;
|
color[0] = color[1] = color[2] = color[3] = 255;
|
||||||
@@ -585,7 +597,7 @@ void NetGraph_DrawDataUsage( int x, int y, int w )
|
|||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
if( net_graph->value >= 2 )
|
if( graphtype >= 2 )
|
||||||
NetGraph_DrawHatches( x, y - net_graphheight->value - 1 );
|
NetGraph_DrawHatches( x, y - net_graphheight->value - 1 );
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -595,7 +607,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->left = rect->top = 0;
|
||||||
rect->right = refState.width;
|
rect->right = refState.width;
|
||||||
@@ -612,7 +624,7 @@ void NetGraph_GetScreenPos( wrect_t *rect, int *w, int *x, int *y )
|
|||||||
*x = rect->left + rect->right - 5 - *w;
|
*x = rect->left + rect->right - 5 - *w;
|
||||||
break;
|
break;
|
||||||
case 2: // center
|
case 2: // center
|
||||||
*x = rect->left + ( rect->right - 10 - *w ) / 2;
|
*x = ( rect->left + ( rect->right - 10 - *w )) / 2;
|
||||||
break;
|
break;
|
||||||
default: // left sided
|
default: // left sided
|
||||||
*x = rect->left + 5;
|
*x = rect->left + 5;
|
||||||
@@ -634,6 +646,8 @@ void SCR_DrawNetGraph( void )
|
|||||||
float avg_ping;
|
float avg_ping;
|
||||||
int ping_count;
|
int ping_count;
|
||||||
int w, x, y;
|
int w, x, y;
|
||||||
|
kbutton_t *in_graph;
|
||||||
|
int graphtype;
|
||||||
|
|
||||||
if( !host.allow_console )
|
if( !host.allow_console )
|
||||||
return;
|
return;
|
||||||
@@ -641,8 +655,20 @@ void SCR_DrawNetGraph( void )
|
|||||||
if( cls.state != ca_active )
|
if( cls.state != ca_active )
|
||||||
return;
|
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;
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
if( net_scale->value <= 0 )
|
if( net_scale->value <= 0 )
|
||||||
Cvar_SetValue( "net_scale", 0.1f );
|
Cvar_SetValue( "net_scale", 0.1f );
|
||||||
@@ -651,16 +677,16 @@ void SCR_DrawNetGraph( void )
|
|||||||
|
|
||||||
NetGraph_GetFrameData( &avg_ping, &ping_count );
|
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_SetRenderMode( kRenderTransColor );
|
||||||
|
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
|
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
|
// NOTE: fill colors without texture at this point
|
||||||
NetGraph_DrawDataUsage( x, y, w );
|
NetGraph_DrawDataUsage( x, y, w, graphtype );
|
||||||
NetGraph_DrawTimes( rect, x, w );
|
NetGraph_DrawTimes( rect, x, w );
|
||||||
|
|
||||||
ref.dllFuncs.End();
|
ref.dllFuncs.End();
|
||||||
|
|||||||
File diff suppressed because it is too large
Load Diff
@@ -26,27 +26,13 @@ GNU General Public License for more details.
|
|||||||
#define MIN_PREDICTION_EPSILON 0.5f // complain if error is > this and we have cl_showerror set
|
#define MIN_PREDICTION_EPSILON 0.5f // complain if error is > this and we have cl_showerror set
|
||||||
#define MAX_PREDICTION_ERROR 64.0f // above this is assumed to be a teleport, don't smooth, etc.
|
#define MAX_PREDICTION_ERROR 64.0f // above this is assumed to be a teleport, don't smooth, etc.
|
||||||
|
|
||||||
/*
|
|
||||||
=============
|
|
||||||
CL_ClearPhysEnts
|
|
||||||
|
|
||||||
=============
|
|
||||||
*/
|
|
||||||
void CL_ClearPhysEnts( void )
|
|
||||||
{
|
|
||||||
clgame.pmove->numtouch = 0;
|
|
||||||
clgame.pmove->numvisent = 0;
|
|
||||||
clgame.pmove->nummoveent = 0;
|
|
||||||
clgame.pmove->numphysent = 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
=============
|
=============
|
||||||
CL_PushPMStates
|
CL_PushPMStates
|
||||||
|
|
||||||
=============
|
=============
|
||||||
*/
|
*/
|
||||||
void CL_PushPMStates( void )
|
void GAME_EXPORT CL_PushPMStates( void )
|
||||||
{
|
{
|
||||||
if( clgame.pushed ) return;
|
if( clgame.pushed ) return;
|
||||||
clgame.oldphyscount = clgame.pmove->numphysent;
|
clgame.oldphyscount = clgame.pmove->numphysent;
|
||||||
@@ -60,7 +46,7 @@ CL_PopPMStates
|
|||||||
|
|
||||||
=============
|
=============
|
||||||
*/
|
*/
|
||||||
void CL_PopPMStates( void )
|
void GAME_EXPORT CL_PopPMStates( void )
|
||||||
{
|
{
|
||||||
if( !clgame.pushed ) return;
|
if( !clgame.pushed ) return;
|
||||||
clgame.pmove->numphysent = clgame.oldphyscount;
|
clgame.pmove->numphysent = clgame.oldphyscount;
|
||||||
@@ -74,7 +60,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 );
|
hullnum = bound( 0, hullnum, 3 );
|
||||||
VectorCopy( mins, clgame.pmove->player_mins[hullnum] );
|
VectorCopy( mins, clgame.pmove->player_mins[hullnum] );
|
||||||
@@ -87,7 +73,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_mins, host.player_mins, sizeof( host.player_mins ));
|
||||||
memcpy( clgame.pmove->player_maxs, host.player_maxs, sizeof( host.player_maxs ));
|
memcpy( clgame.pmove->player_maxs, host.player_maxs, sizeof( host.player_maxs ));
|
||||||
@@ -208,7 +194,7 @@ check for instant movement in case
|
|||||||
we don't want interpolate this
|
we don't want interpolate this
|
||||||
==================
|
==================
|
||||||
*/
|
*/
|
||||||
qboolean CL_PlayerTeleported( local_state_t *from, local_state_t *to )
|
static qboolean CL_PlayerTeleported( local_state_t *from, local_state_t *to )
|
||||||
{
|
{
|
||||||
int len, maxlen;
|
int len, maxlen;
|
||||||
vec3_t delta;
|
vec3_t delta;
|
||||||
@@ -264,7 +250,9 @@ void CL_CheckPredictionError( void )
|
|||||||
// save for error interpolation
|
// save for error interpolation
|
||||||
VectorCopy( delta, cl.local.prediction_error );
|
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;
|
cls.correction_time = cl_smoothtime->value;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -280,7 +268,7 @@ then with clipping against them.
|
|||||||
This sets up the first phase.
|
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;
|
entity_state_t *state;
|
||||||
predicted_player_t *player;
|
predicted_player_t *player;
|
||||||
@@ -538,7 +526,7 @@ pmove must be setup with world and solid entity hulls before calling
|
|||||||
(via CL_PredictMove)
|
(via CL_PredictMove)
|
||||||
===============
|
===============
|
||||||
*/
|
*/
|
||||||
void CL_SetSolidPlayers( int playernum )
|
void GAME_EXPORT CL_SetSolidPlayers( int playernum )
|
||||||
{
|
{
|
||||||
entity_state_t *state;
|
entity_state_t *state;
|
||||||
predicted_player_t *player;
|
predicted_player_t *player;
|
||||||
@@ -594,7 +582,7 @@ CL_WaterEntity
|
|||||||
|
|
||||||
=============
|
=============
|
||||||
*/
|
*/
|
||||||
int CL_WaterEntity( const float *rgflPos )
|
int GAME_EXPORT CL_WaterEntity( const float *rgflPos )
|
||||||
{
|
{
|
||||||
physent_t *pe;
|
physent_t *pe;
|
||||||
hull_t *hull;
|
hull_t *hull;
|
||||||
@@ -699,148 +687,42 @@ cl_entity_t *CL_GetWaterEntity( const float *rgflPos )
|
|||||||
return CL_GetEntityByIndex( entnum );
|
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 );
|
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 );
|
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;
|
PM_StuckTouch( clgame.pmove, hitent, tr );
|
||||||
|
|
||||||
for( i = 0; i < clgame.pmove->numtouch; i++ )
|
|
||||||
{
|
|
||||||
if( clgame.pmove->touchindex[i].ent == hitent )
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
if( clgame.pmove->numtouch >= MAX_PHYSENTS )
|
|
||||||
return;
|
|
||||||
|
|
||||||
VectorCopy( clgame.pmove->velocity, tr->deltavelocity );
|
|
||||||
tr->ent = hitent;
|
|
||||||
|
|
||||||
clgame.pmove->touchindex[clgame.pmove->numtouch++] = *tr;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static int pfnPointContents( float *p, int *truecontents )
|
static int GAME_EXPORT pfnTruePointContents( float *p )
|
||||||
{
|
|
||||||
int cont, truecont;
|
|
||||||
|
|
||||||
truecont = cont = PM_PointContents( clgame.pmove, p );
|
|
||||||
if( truecontents ) *truecontents = truecont;
|
|
||||||
|
|
||||||
if( cont <= CONTENTS_CURRENT_0 && cont >= CONTENTS_CURRENT_DOWN )
|
|
||||||
cont = CONTENTS_WATER;
|
|
||||||
return cont;
|
|
||||||
}
|
|
||||||
|
|
||||||
static int pfnTruePointContents( float *p )
|
|
||||||
{
|
{
|
||||||
return PM_TruePointContents( clgame.pmove, p );
|
return PM_TruePointContents( clgame.pmove, p );
|
||||||
}
|
}
|
||||||
|
|
||||||
static int pfnHullPointContents( struct hull_s *hull, int num, float *p )
|
static pmtrace_t GAME_EXPORT pfnPlayerTrace( float *start, float *end, int traceFlags, int ignore_pe )
|
||||||
{
|
|
||||||
return PM_HullPointContents( hull, num, p );
|
|
||||||
}
|
|
||||||
|
|
||||||
static pmtrace_t 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 );
|
return PM_PlayerTraceExt( clgame.pmove, start, end, traceFlags, clgame.pmove->numphysent, clgame.pmove->physents, ignore_pe, NULL );
|
||||||
}
|
}
|
||||||
|
|
||||||
pmtrace_t *PM_TraceLine( float *start, float *end, int flags, int usehull, int ignore_pe )
|
static void *pfnHullForBsp( physent_t *pe, float *offset )
|
||||||
{
|
|
||||||
static pmtrace_t tr;
|
|
||||||
int old_usehull;
|
|
||||||
|
|
||||||
old_usehull = clgame.pmove->usehull;
|
|
||||||
clgame.pmove->usehull = usehull;
|
|
||||||
|
|
||||||
switch( flags )
|
|
||||||
{
|
|
||||||
case PM_TRACELINE_PHYSENTSONLY:
|
|
||||||
tr = PM_PlayerTraceExt( clgame.pmove, start, end, 0, clgame.pmove->numphysent, clgame.pmove->physents, ignore_pe, NULL );
|
|
||||||
break;
|
|
||||||
case PM_TRACELINE_ANYVISIBLE:
|
|
||||||
tr = PM_PlayerTraceExt( clgame.pmove, start, end, 0, clgame.pmove->numvisent, clgame.pmove->visents, ignore_pe, NULL );
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
|
|
||||||
clgame.pmove->usehull = old_usehull;
|
|
||||||
|
|
||||||
return &tr;
|
|
||||||
}
|
|
||||||
|
|
||||||
static hull_t *pfnHullForBsp( physent_t *pe, float *offset )
|
|
||||||
{
|
{
|
||||||
return PM_HullForBsp( pe, clgame.pmove, 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;
|
return PM_TraceModel( clgame.pmove, pe, start, end, trace );
|
||||||
vec3_t start_l, end_l;
|
|
||||||
vec3_t offset, temp;
|
|
||||||
qboolean rotated;
|
|
||||||
matrix4x4 matrix;
|
|
||||||
hull_t *hull;
|
|
||||||
|
|
||||||
old_usehull = clgame.pmove->usehull;
|
|
||||||
clgame.pmove->usehull = 2;
|
|
||||||
|
|
||||||
hull = PM_HullForBsp( pe, clgame.pmove, offset );
|
|
||||||
|
|
||||||
clgame.pmove->usehull = old_usehull;
|
|
||||||
|
|
||||||
if( pe->solid == SOLID_BSP && !VectorIsNull( pe->angles ))
|
|
||||||
rotated = true;
|
|
||||||
else rotated = false;
|
|
||||||
|
|
||||||
if( rotated )
|
|
||||||
{
|
|
||||||
Matrix4x4_CreateFromEntity( matrix, pe->angles, offset, 1.0f );
|
|
||||||
Matrix4x4_VectorITransform( matrix, start, start_l );
|
|
||||||
Matrix4x4_VectorITransform( matrix, end, end_l );
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
VectorSubtract( start, offset, start_l );
|
|
||||||
VectorSubtract( end, offset, end_l );
|
|
||||||
}
|
|
||||||
|
|
||||||
PM_RecursiveHullCheck( hull, hull->firstclipnode, 0, 1, start_l, end_l, (pmtrace_t *)trace );
|
|
||||||
trace->ent = NULL;
|
|
||||||
|
|
||||||
if( rotated )
|
|
||||||
{
|
|
||||||
VectorCopy( trace->plane.normal, temp );
|
|
||||||
Matrix4x4_TransformPositivePlane( matrix, temp, trace->plane.dist, trace->plane.normal, &trace->plane.dist );
|
|
||||||
}
|
|
||||||
|
|
||||||
VectorLerp( start, trace->fraction, end, trace->endpos );
|
|
||||||
|
|
||||||
return trace->fraction;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static const char *pfnTraceTexture( int ground, float *vstart, float *vend )
|
static void GAME_EXPORT pfnPlaySound( int channel, const char *sample, float volume, float attenuation, int fFlags, int pitch )
|
||||||
{
|
|
||||||
physent_t *pe;
|
|
||||||
|
|
||||||
if( ground < 0 || ground >= clgame.pmove->numphysent )
|
|
||||||
return NULL; // bad ground
|
|
||||||
|
|
||||||
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 )
|
|
||||||
{
|
{
|
||||||
if( !clgame.pmove->runfuncs )
|
if( !clgame.pmove->runfuncs )
|
||||||
return;
|
return;
|
||||||
@@ -848,43 +730,25 @@ 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 );
|
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 )
|
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 );
|
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 );
|
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 );
|
return PM_TestPlayerPosition( clgame.pmove, pos, ptrace, pmFilter );
|
||||||
}
|
}
|
||||||
|
|
||||||
static pmtrace_t *pfnTraceLineEx( float *start, float *end, int flags, int usehull, pfnIgnore pmFilter )
|
static pmtrace_t *pfnTraceLineEx( float *start, float *end, int flags, int usehull, pfnIgnore pmFilter )
|
||||||
{
|
{
|
||||||
static pmtrace_t tr;
|
return PM_TraceLineEx( clgame.pmove, start, end, flags, usehull, pmFilter );
|
||||||
int old_usehull;
|
|
||||||
|
|
||||||
old_usehull = clgame.pmove->usehull;
|
|
||||||
clgame.pmove->usehull = usehull;
|
|
||||||
|
|
||||||
switch( flags )
|
|
||||||
{
|
|
||||||
case PM_TRACELINE_PHYSENTSONLY:
|
|
||||||
tr = PM_PlayerTraceExt( clgame.pmove, start, end, 0, clgame.pmove->numphysent, clgame.pmove->physents, -1, pmFilter );
|
|
||||||
break;
|
|
||||||
case PM_TRACELINE_ANYVISIBLE:
|
|
||||||
tr = PM_PlayerTraceExt( clgame.pmove, start, end, 0, clgame.pmove->numvisent, clgame.pmove->visents, -1, pmFilter );
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
|
|
||||||
clgame.pmove->usehull = old_usehull;
|
|
||||||
|
|
||||||
return &tr;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
@@ -924,23 +788,23 @@ void CL_InitClientMove( void )
|
|||||||
clgame.pmove->Con_Printf = Con_Printf;
|
clgame.pmove->Con_Printf = Con_Printf;
|
||||||
clgame.pmove->Sys_FloatTime = Sys_DoubleTime;
|
clgame.pmove->Sys_FloatTime = Sys_DoubleTime;
|
||||||
clgame.pmove->PM_StuckTouch = pfnStuckTouch;
|
clgame.pmove->PM_StuckTouch = pfnStuckTouch;
|
||||||
clgame.pmove->PM_PointContents = pfnPointContents;
|
clgame.pmove->PM_PointContents = (void*)PM_CL_PointContents;
|
||||||
clgame.pmove->PM_TruePointContents = pfnTruePointContents;
|
clgame.pmove->PM_TruePointContents = pfnTruePointContents;
|
||||||
clgame.pmove->PM_HullPointContents = pfnHullPointContents;
|
clgame.pmove->PM_HullPointContents = (void*)PM_HullPointContents;
|
||||||
clgame.pmove->PM_PlayerTrace = pfnPlayerTrace;
|
clgame.pmove->PM_PlayerTrace = pfnPlayerTrace;
|
||||||
clgame.pmove->PM_TraceLine = PM_TraceLine;
|
clgame.pmove->PM_TraceLine = PM_CL_TraceLine;
|
||||||
clgame.pmove->RandomLong = COM_RandomLong;
|
clgame.pmove->RandomLong = COM_RandomLong;
|
||||||
clgame.pmove->RandomFloat = COM_RandomFloat;
|
clgame.pmove->RandomFloat = COM_RandomFloat;
|
||||||
clgame.pmove->PM_GetModelType = pfnGetModelType;
|
clgame.pmove->PM_GetModelType = pfnGetModelType;
|
||||||
clgame.pmove->PM_GetModelBounds = pfnGetModelBounds;
|
clgame.pmove->PM_GetModelBounds = pfnGetModelBounds;
|
||||||
clgame.pmove->PM_HullForBsp = (void*)pfnHullForBsp;
|
clgame.pmove->PM_HullForBsp = pfnHullForBsp;
|
||||||
clgame.pmove->PM_TraceModel = pfnTraceModel;
|
clgame.pmove->PM_TraceModel = pfnTraceModel;
|
||||||
clgame.pmove->COM_FileSize = COM_FileSize;
|
clgame.pmove->COM_FileSize = COM_FileSize;
|
||||||
clgame.pmove->COM_LoadFile = COM_LoadFile;
|
clgame.pmove->COM_LoadFile = COM_LoadFile;
|
||||||
clgame.pmove->COM_FreeFile = COM_FreeFile;
|
clgame.pmove->COM_FreeFile = COM_FreeFile;
|
||||||
clgame.pmove->memfgets = COM_MemFgets;
|
clgame.pmove->memfgets = COM_MemFgets;
|
||||||
clgame.pmove->PM_PlaySound = pfnPlaySound;
|
clgame.pmove->PM_PlaySound = pfnPlaySound;
|
||||||
clgame.pmove->PM_TraceTexture = pfnTraceTexture;
|
clgame.pmove->PM_TraceTexture = PM_CL_TraceTexture;
|
||||||
clgame.pmove->PM_PlaybackEventFull = pfnPlaybackEventFull;
|
clgame.pmove->PM_PlaybackEventFull = pfnPlaybackEventFull;
|
||||||
clgame.pmove->PM_PlayerTraceEx = pfnPlayerTraceEx;
|
clgame.pmove->PM_PlayerTraceEx = pfnPlayerTraceEx;
|
||||||
clgame.pmove->PM_TestPlayerPositionEx = pfnTestPlayerPositionEx;
|
clgame.pmove->PM_TestPlayerPositionEx = pfnTestPlayerPositionEx;
|
||||||
@@ -951,21 +815,10 @@ void CL_InitClientMove( void )
|
|||||||
clgame.dllFuncs.pfnPlayerMoveInit( clgame.pmove );
|
clgame.dllFuncs.pfnPlayerMoveInit( clgame.pmove );
|
||||||
}
|
}
|
||||||
|
|
||||||
static void PM_CheckMovingGround( clientdata_t *cd, entity_state_t *state, float frametime )
|
static void CL_SetupPMove( playermove_t *pmove, const local_state_t *from, const usercmd_t *ucmd, qboolean runfuncs, double time )
|
||||||
{
|
{
|
||||||
if(!( cd->flags & FL_BASEVELOCITY ))
|
const entity_state_t *ps;
|
||||||
{
|
const clientdata_t *cd;
|
||||||
// apply momentum (add in half of the previous frame of velocity first)
|
|
||||||
VectorMA( cd->velocity, 1.0f + (frametime * 0.5f), state->basevelocity, cd->velocity );
|
|
||||||
VectorClear( state->basevelocity );
|
|
||||||
}
|
|
||||||
cd->flags &= ~FL_BASEVELOCITY;
|
|
||||||
}
|
|
||||||
|
|
||||||
void CL_SetupPMove( playermove_t *pmove, local_state_t *from, usercmd_t *ucmd, qboolean runfuncs, double time )
|
|
||||||
{
|
|
||||||
entity_state_t *ps;
|
|
||||||
clientdata_t *cd;
|
|
||||||
|
|
||||||
ps = &from->playerstate;
|
ps = &from->playerstate;
|
||||||
cd = &from->client;
|
cd = &from->client;
|
||||||
@@ -982,22 +835,21 @@ void CL_SetupPMove( playermove_t *pmove, local_state_t *from, usercmd_t *ucmd, q
|
|||||||
VectorCopy( ps->basevelocity, pmove->basevelocity );
|
VectorCopy( ps->basevelocity, pmove->basevelocity );
|
||||||
VectorCopy( cd->view_ofs, pmove->view_ofs );
|
VectorCopy( cd->view_ofs, pmove->view_ofs );
|
||||||
VectorClear( pmove->movedir );
|
VectorClear( pmove->movedir );
|
||||||
pmove->flDuckTime = cd->flDuckTime;
|
pmove->flDuckTime = (float)cd->flDuckTime;
|
||||||
pmove->bInDuck = cd->bInDuck;
|
pmove->bInDuck = cd->bInDuck;
|
||||||
pmove->usehull = ps->usehull;
|
pmove->usehull = ps->usehull;
|
||||||
pmove->flTimeStepSound = cd->flTimeStepSound;
|
pmove->flTimeStepSound = cd->flTimeStepSound;
|
||||||
pmove->iStepLeft = ps->iStepLeft;
|
pmove->iStepLeft = ps->iStepLeft;
|
||||||
pmove->flFallVelocity = ps->flFallVelocity;
|
pmove->flFallVelocity = ps->flFallVelocity;
|
||||||
pmove->flSwimTime = cd->flSwimTime;
|
pmove->flSwimTime = (float)cd->flSwimTime;
|
||||||
VectorCopy( cd->punchangle, pmove->punchangle );
|
VectorCopy( cd->punchangle, pmove->punchangle );
|
||||||
pmove->flSwimTime = cd->flSwimTime;
|
|
||||||
pmove->flNextPrimaryAttack = 0.0f; // not used by PM_ code
|
pmove->flNextPrimaryAttack = 0.0f; // not used by PM_ code
|
||||||
pmove->effects = ps->effects;
|
pmove->effects = ps->effects;
|
||||||
pmove->flags = cd->flags;
|
pmove->flags = cd->flags;
|
||||||
pmove->gravity = ps->gravity;
|
pmove->gravity = ps->gravity;
|
||||||
pmove->friction = ps->friction;
|
pmove->friction = ps->friction;
|
||||||
pmove->oldbuttons = ps->oldbuttons;
|
pmove->oldbuttons = ps->oldbuttons;
|
||||||
pmove->waterjumptime = cd->waterjumptime;
|
pmove->waterjumptime = (float)cd->waterjumptime;
|
||||||
pmove->dead = (cl.local.health <= 0);
|
pmove->dead = (cl.local.health <= 0);
|
||||||
pmove->deadflag = cd->deadflag;
|
pmove->deadflag = cd->deadflag;
|
||||||
pmove->spectator = (cls.spectator != 0);
|
pmove->spectator = (cls.spectator != 0);
|
||||||
@@ -1024,7 +876,7 @@ void CL_SetupPMove( playermove_t *pmove, local_state_t *from, usercmd_t *ucmd, q
|
|||||||
Q_strncpy( pmove->physinfo, cls.physinfo, MAX_INFO_STRING );
|
Q_strncpy( pmove->physinfo, cls.physinfo, MAX_INFO_STRING );
|
||||||
}
|
}
|
||||||
|
|
||||||
void CL_FinishPMove( playermove_t *pmove, local_state_t *to )
|
const void CL_FinishPMove( const playermove_t *pmove, local_state_t *to )
|
||||||
{
|
{
|
||||||
entity_state_t *ps;
|
entity_state_t *ps;
|
||||||
clientdata_t *cd;
|
clientdata_t *cd;
|
||||||
@@ -1035,7 +887,7 @@ void CL_FinishPMove( playermove_t *pmove, local_state_t *to )
|
|||||||
cd->flags = pmove->flags;
|
cd->flags = pmove->flags;
|
||||||
cd->bInDuck = pmove->bInDuck;
|
cd->bInDuck = pmove->bInDuck;
|
||||||
cd->flTimeStepSound = pmove->flTimeStepSound;
|
cd->flTimeStepSound = pmove->flTimeStepSound;
|
||||||
cd->flDuckTime = pmove->flDuckTime;
|
cd->flDuckTime = (int)pmove->flDuckTime;
|
||||||
cd->flSwimTime = (int)pmove->flSwimTime;
|
cd->flSwimTime = (int)pmove->flSwimTime;
|
||||||
cd->waterjumptime = (int)pmove->waterjumptime;
|
cd->waterjumptime = (int)pmove->waterjumptime;
|
||||||
cd->watertype = pmove->watertype;
|
cd->watertype = pmove->watertype;
|
||||||
@@ -1048,7 +900,7 @@ void CL_FinishPMove( playermove_t *pmove, local_state_t *to )
|
|||||||
VectorCopy( pmove->angles, ps->angles );
|
VectorCopy( pmove->angles, ps->angles );
|
||||||
VectorCopy( pmove->basevelocity, ps->basevelocity );
|
VectorCopy( pmove->basevelocity, ps->basevelocity );
|
||||||
VectorCopy( pmove->punchangle, cd->punchangle );
|
VectorCopy( pmove->punchangle, cd->punchangle );
|
||||||
ps->oldbuttons = pmove->oldbuttons;
|
ps->oldbuttons = (uint)pmove->cmd.buttons;
|
||||||
ps->friction = pmove->friction;
|
ps->friction = pmove->friction;
|
||||||
ps->movetype = pmove->movetype;
|
ps->movetype = pmove->movetype;
|
||||||
ps->onground = pmove->onground;
|
ps->onground = pmove->onground;
|
||||||
@@ -1080,13 +932,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 )
|
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;
|
usercmd_t cmd;
|
||||||
local_state_t temp;
|
|
||||||
usercmd_t split;
|
|
||||||
|
|
||||||
memset( &temp, 0, sizeof( temp ));
|
|
||||||
|
|
||||||
if( u->msec > 50 )
|
if( u->msec > 50 )
|
||||||
{
|
{
|
||||||
|
local_state_t temp;
|
||||||
|
usercmd_t split;
|
||||||
|
|
||||||
|
memset( &temp, 0, sizeof( temp ));
|
||||||
|
|
||||||
split = *u;
|
split = *u;
|
||||||
split.msec /= 2;
|
split.msec /= 2;
|
||||||
CL_RunUsercmd( from, &temp, &split, runfuncs, time, random_seed );
|
CL_RunUsercmd( from, &temp, &split, runfuncs, time, random_seed );
|
||||||
@@ -1153,15 +1006,11 @@ Sets cl.predicted.origin and cl.predicted.angles
|
|||||||
*/
|
*/
|
||||||
void CL_PredictMovement( qboolean repredicting )
|
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;
|
local_state_t *from = NULL, *to = NULL;
|
||||||
int current_command;
|
frame_t *frame = NULL;
|
||||||
int current_command_mod;
|
uint i, stoppoint;
|
||||||
frame_t *frame = NULL;
|
|
||||||
int i, stoppoint;
|
|
||||||
qboolean runfuncs;
|
|
||||||
double f = 1.0;
|
double f = 1.0;
|
||||||
cl_entity_t *ent;
|
|
||||||
double time;
|
double time;
|
||||||
|
|
||||||
if( cls.state != ca_active || cls.spectator )
|
if( cls.state != ca_active || cls.spectator )
|
||||||
@@ -1172,7 +1021,7 @@ void CL_PredictMovement( qboolean repredicting )
|
|||||||
|
|
||||||
CL_SetUpPlayerPrediction( false, false );
|
CL_SetUpPlayerPrediction( false, false );
|
||||||
|
|
||||||
if( cls.state != ca_active || !cl.validsequence )
|
if( !cl.validsequence )
|
||||||
return;
|
return;
|
||||||
|
|
||||||
if(( cls.netchan.outgoing_sequence - cls.netchan.incoming_acknowledged ) >= CL_UPDATE_MASK )
|
if(( cls.netchan.outgoing_sequence - cls.netchan.incoming_acknowledged ) >= CL_UPDATE_MASK )
|
||||||
@@ -1213,6 +1062,10 @@ void CL_PredictMovement( qboolean repredicting )
|
|||||||
|
|
||||||
for( i = 1; i < CL_UPDATE_MASK && cls.netchan.incoming_acknowledged + i < cls.netchan.outgoing_sequence + stoppoint; i++ )
|
for( i = 1; i < CL_UPDATE_MASK && cls.netchan.incoming_acknowledged + i < cls.netchan.outgoing_sequence + stoppoint; i++ )
|
||||||
{
|
{
|
||||||
|
uint current_command;
|
||||||
|
uint current_command_mod;
|
||||||
|
qboolean runfuncs;
|
||||||
|
|
||||||
current_command = cls.netchan.incoming_acknowledged + i;
|
current_command = cls.netchan.incoming_acknowledged + i;
|
||||||
current_command_mod = current_command & CL_UPDATE_MASK;
|
current_command_mod = current_command & CL_UPDATE_MASK;
|
||||||
|
|
||||||
@@ -1227,10 +1080,6 @@ void CL_PredictMovement( qboolean repredicting )
|
|||||||
if( to_cmd->senttime >= host.realtime )
|
if( to_cmd->senttime >= host.realtime )
|
||||||
break;
|
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 = to;
|
||||||
from_cmd = to_cmd;
|
from_cmd = to_cmd;
|
||||||
}
|
}
|
||||||
@@ -1263,8 +1112,10 @@ void CL_PredictMovement( qboolean repredicting )
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
f = bound( 0.0f, f, 1.0f );
|
// now interpolate some fraction of the final frame
|
||||||
f = 0.0; // FIXME: make work, do revision
|
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 ))
|
if( CL_PlayerTeleported( from, to ))
|
||||||
{
|
{
|
||||||
@@ -1291,7 +1142,7 @@ void CL_PredictMovement( qboolean repredicting )
|
|||||||
|
|
||||||
if( FBitSet( to->client.flags, FL_ONGROUND ))
|
if( FBitSet( to->client.flags, FL_ONGROUND ))
|
||||||
{
|
{
|
||||||
ent = CL_GetEntityByIndex( cl.local.lastground );
|
cl_entity_t *ent = CL_GetEntityByIndex( cl.local.lastground );
|
||||||
cl.local.onground = cl.local.lastground;
|
cl.local.onground = cl.local.lastground;
|
||||||
cl.local.moving = false;
|
cl.local.moving = false;
|
||||||
|
|
||||||
@@ -1313,13 +1164,13 @@ void CL_PredictMovement( qboolean repredicting )
|
|||||||
else
|
else
|
||||||
{
|
{
|
||||||
cl.local.onground = -1;
|
cl.local.onground = -1;
|
||||||
cl.local.moving = 0;
|
cl.local.moving = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
if( cls.correction_time > 0 && !cl_nosmooth->value && cl_smoothtime->value )
|
if( cls.correction_time > 0 && !cl_nosmooth->value && cl_smoothtime->value )
|
||||||
{
|
{
|
||||||
vec3_t delta;
|
vec3_t delta;
|
||||||
float frac;
|
float frac;
|
||||||
|
|
||||||
// only decay timer once per frame
|
// only decay timer once per frame
|
||||||
if( !repredicting )
|
if( !repredicting )
|
||||||
|
|||||||
@@ -237,10 +237,6 @@ static void CL_ParseQuakeServerInfo( sizebuf_t *msg )
|
|||||||
}
|
}
|
||||||
else Cvar_Reset( "r_decals" );
|
else Cvar_Reset( "r_decals" );
|
||||||
|
|
||||||
// re-init mouse
|
|
||||||
if( cl.background )
|
|
||||||
host.mouse_visible = false;
|
|
||||||
|
|
||||||
if( cl.background ) // tell the game parts about background state
|
if( cl.background ) // tell the game parts about background state
|
||||||
Cvar_FullSet( "cl_background", "1", FCVAR_READ_ONLY );
|
Cvar_FullSet( "cl_background", "1", FCVAR_READ_ONLY );
|
||||||
else Cvar_FullSet( "cl_background", "0", FCVAR_READ_ONLY );
|
else Cvar_FullSet( "cl_background", "0", FCVAR_READ_ONLY );
|
||||||
@@ -825,6 +821,9 @@ CL_QuakeStuffText
|
|||||||
void CL_QuakeStuffText( const char *text )
|
void CL_QuakeStuffText( const char *text )
|
||||||
{
|
{
|
||||||
Q_strncat( cmd_buf, text, sizeof( cmd_buf ));
|
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 );
|
Cbuf_AddText( text );
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -861,9 +860,7 @@ void CL_QuakeExecStuff( void )
|
|||||||
|
|
||||||
if( !*text ) break;
|
if( !*text ) break;
|
||||||
|
|
||||||
host.com_ignorebracket = true;
|
text = COM_ParseFileSafe( text, token, sizeof( token ), PFILE_IGNOREBRACKET, NULL, NULL );
|
||||||
text = COM_ParseFile( text, token );
|
|
||||||
host.com_ignorebracket = false;
|
|
||||||
|
|
||||||
if( !text ) break;
|
if( !text ) break;
|
||||||
|
|
||||||
|
|||||||
@@ -98,7 +98,7 @@ CL_DuplicateTexture
|
|||||||
Dupliacte texture with remap pixels
|
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;
|
const char *name;
|
||||||
texture_t *tx = NULL;
|
texture_t *tx = NULL;
|
||||||
@@ -111,12 +111,12 @@ void CL_DuplicateTexture( mstudiotexture_t *ptexture, int topcolor, int bottomco
|
|||||||
// save off the real texture index
|
// save off the real texture index
|
||||||
index = ptexture->index;
|
index = ptexture->index;
|
||||||
name = ref.dllFuncs.GL_TextureName( 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
|
// 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 )
|
if( tx->gl_texturenum == index )
|
||||||
break; // found
|
break; // found
|
||||||
}
|
}
|
||||||
@@ -141,7 +141,7 @@ CL_UpdateStudioTexture
|
|||||||
Update texture top and bottom colors
|
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;
|
rgbdata_t *pic;
|
||||||
texture_t *tx = NULL;
|
texture_t *tx = NULL;
|
||||||
@@ -156,8 +156,8 @@ void CL_UpdateStudioTexture( mstudiotexture_t *ptexture, int topcolor, int botto
|
|||||||
origtexname = ref.dllFuncs.GL_TextureName( ptexture->index );
|
origtexname = ref.dllFuncs.GL_TextureName( ptexture->index );
|
||||||
|
|
||||||
// build name of original texture
|
// 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_FileBase( ptexture->name, name, sizeof( name ));
|
||||||
COM_StripExtension( mdlname );
|
COM_StripExtension( mdlname );
|
||||||
|
|
||||||
Q_snprintf( texname, sizeof( texname ), "#%s/%s.mdl", mdlname, name );
|
Q_snprintf( texname, sizeof( texname ), "#%s/%s.mdl", mdlname, name );
|
||||||
@@ -165,9 +165,9 @@ void CL_UpdateStudioTexture( mstudiotexture_t *ptexture, int topcolor, int botto
|
|||||||
if( !index ) return; // couldn't find texture
|
if( !index ) return; // couldn't find texture
|
||||||
|
|
||||||
// search for pixels
|
// 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 )
|
if( tx->gl_texturenum == index )
|
||||||
break; // found
|
break; // found
|
||||||
}
|
}
|
||||||
@@ -202,21 +202,21 @@ CL_UpdateAliasTexture
|
|||||||
Update texture top and bottom colors
|
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];
|
char texname[MAX_QPATH];
|
||||||
rgbdata_t skin, *pic;
|
rgbdata_t skin, *pic;
|
||||||
texture_t *tx;
|
texture_t *tx;
|
||||||
|
|
||||||
if( !texture || !refState.currentmodel->textures )
|
if( !texture || !entity->model->textures )
|
||||||
return; // no remapinfo in model
|
return; // no remapinfo in model
|
||||||
|
|
||||||
tx = refState.currentmodel->textures[skinnum];
|
tx = entity->model->textures[skinnum];
|
||||||
if( !tx ) return; // missing texture ?
|
if( !tx ) return; // missing texture ?
|
||||||
|
|
||||||
if( *texture == 0 )
|
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.width = tx->width;
|
||||||
skin.height = tx->height;
|
skin.height = tx->height;
|
||||||
skin.depth = skin.numMips = 1;
|
skin.depth = skin.numMips = 1;
|
||||||
@@ -242,7 +242,7 @@ Allocate new remap info per entity
|
|||||||
and make copy of remap textures
|
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;
|
remap_info_t *info;
|
||||||
studiohdr_t *phdr;
|
studiohdr_t *phdr;
|
||||||
@@ -250,10 +250,10 @@ void CL_AllocRemapInfo( int topcolor, int bottomcolor )
|
|||||||
mstudiotexture_t *src, *dst;
|
mstudiotexture_t *src, *dst;
|
||||||
int i, size;
|
int i, size;
|
||||||
|
|
||||||
if( !refState.currententity ) return;
|
if( !entity ) return;
|
||||||
i = ( refState.currententity == &clgame.viewent ) ? clgame.maxEntities : refState.currententity->curstate.number;
|
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
|
// entity has changed model by another type, release remap info
|
||||||
if( clgame.remap_info[i] )
|
if( clgame.remap_info[i] )
|
||||||
@@ -265,7 +265,7 @@ void CL_AllocRemapInfo( int topcolor, int bottomcolor )
|
|||||||
}
|
}
|
||||||
|
|
||||||
// model doesn't contains remap textures
|
// model doesn't contains remap textures
|
||||||
if( refState.currentmodel->numtextures <= 0 )
|
if( model->numtextures <= 0 )
|
||||||
{
|
{
|
||||||
// entity has changed model with no remap textures
|
// entity has changed model with no remap textures
|
||||||
if( clgame.remap_info[i] )
|
if( clgame.remap_info[i] )
|
||||||
@@ -276,16 +276,16 @@ void CL_AllocRemapInfo( int topcolor, int bottomcolor )
|
|||||||
return;
|
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?
|
if( !phdr ) return; // bad model?
|
||||||
|
|
||||||
src = (mstudiotexture_t *)(((byte *)phdr) + phdr->textureindex);
|
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
|
// 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
|
// this code catches studiomodel change with another studiomodel with remap textures
|
||||||
// e.g. playermodel 'barney' with playermodel 'gordon'
|
// e.g. playermodel 'barney' with playermodel 'gordon'
|
||||||
@@ -314,16 +314,16 @@ void CL_AllocRemapInfo( int topcolor, int bottomcolor )
|
|||||||
for( i = 0; i < info->numtextures; i++ )
|
for( i = 0; i < info->numtextures; i++ )
|
||||||
{
|
{
|
||||||
if( dst[i].flags & STUDIO_NF_COLORMAP )
|
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?
|
if( !ahdr ) return; // bad model?
|
||||||
|
|
||||||
// NOTE: we must copy all the structures 'mstudiotexture_t' for easy access when model is rendering
|
// 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
|
// this code catches studiomodel change with another studiomodel with remap textures
|
||||||
// e.g. playermodel 'barney' with playermodel 'gordon'
|
// e.g. playermodel 'barney' with playermodel 'gordon'
|
||||||
@@ -336,10 +336,10 @@ void CL_AllocRemapInfo( int topcolor, int bottomcolor )
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
info->numtextures = refState.currentmodel->numtextures;
|
info->numtextures = model->numtextures;
|
||||||
|
|
||||||
// alias remapping is easy
|
// alias remapping is easy
|
||||||
CL_UpdateRemapInfo( topcolor, bottomcolor );
|
CL_UpdateRemapInfo( entity, topcolor, bottomcolor );
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
@@ -347,7 +347,7 @@ void CL_AllocRemapInfo( int topcolor, int bottomcolor )
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
info->model = refState.currentmodel;
|
info->model = model;
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
@@ -357,12 +357,12 @@ CL_UpdateRemapInfo
|
|||||||
Update all remaps per entity
|
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;
|
remap_info_t *info;
|
||||||
int i;
|
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];
|
info = clgame.remap_info[i];
|
||||||
if( !info ) return; // no remap info
|
if( !info ) return; // no remap info
|
||||||
|
|
||||||
@@ -374,9 +374,9 @@ void CL_UpdateRemapInfo( int topcolor, int bottomcolor )
|
|||||||
if( info->ptexture != NULL )
|
if( info->ptexture != NULL )
|
||||||
{
|
{
|
||||||
if( FBitSet( info->ptexture[i].flags, STUDIO_NF_COLORMAP ))
|
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;
|
info->topcolor = topcolor;
|
||||||
|
|||||||
@@ -117,7 +117,7 @@ static void R_EnvShot( const float *vieworg, const char *name, qboolean skyshot,
|
|||||||
else cls.scrshot_action = scrshot_envshot;
|
else cls.scrshot_action = scrshot_envshot;
|
||||||
|
|
||||||
// catch negative values
|
// catch negative values
|
||||||
cls.envshot_viewsize = max( 0, shotsize );
|
cls.envshot_viewsize = Q_max( 0, shotsize );
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
@@ -133,7 +133,7 @@ const char *CL_GenericHandle( int fileindex )
|
|||||||
return cl.files_precache[fileindex];
|
return cl.files_precache[fileindex];
|
||||||
}
|
}
|
||||||
|
|
||||||
int CL_RenderGetParm( const int parm, const int arg, const qboolean checkRef )
|
intptr_t CL_RenderGetParm( const int parm, const int arg, const qboolean checkRef )
|
||||||
{
|
{
|
||||||
switch( parm )
|
switch( parm )
|
||||||
{
|
{
|
||||||
@@ -161,9 +161,9 @@ int CL_RenderGetParm( const int parm, const int arg, const qboolean checkRef )
|
|||||||
case PARM_WATER_ALPHA:
|
case PARM_WATER_ALPHA:
|
||||||
return FBitSet( world.flags, FWORLD_WATERALPHA );
|
return FBitSet( world.flags, FWORLD_WATERALPHA );
|
||||||
case PARM_DELUXEDATA:
|
case PARM_DELUXEDATA:
|
||||||
return *(int *)&world.deluxedata;
|
return (intptr_t)world.deluxedata;
|
||||||
case PARM_SHADOWDATA:
|
case PARM_SHADOWDATA:
|
||||||
return *(int *)&world.shadowdata;
|
return (intptr_t)world.shadowdata;
|
||||||
default:
|
default:
|
||||||
// indicates call from client.dll
|
// indicates call from client.dll
|
||||||
if( checkRef )
|
if( checkRef )
|
||||||
@@ -204,7 +204,7 @@ int CL_RenderGetParm( const int parm, const int arg, const qboolean checkRef )
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
static int pfnRenderGetParm( int parm, int arg )
|
static intptr_t pfnRenderGetParm( int parm, int arg )
|
||||||
{
|
{
|
||||||
return CL_RenderGetParm( parm, arg, true );
|
return CL_RenderGetParm( parm, arg, true );
|
||||||
}
|
}
|
||||||
@@ -252,7 +252,7 @@ static render_api_t gRenderAPI =
|
|||||||
NULL, // GL_TexGen,
|
NULL, // GL_TexGen,
|
||||||
NULL, // GL_TextureTarget,
|
NULL, // GL_TextureTarget,
|
||||||
NULL, // GL_SetTexCoordArrayMode,
|
NULL, // GL_SetTexCoordArrayMode,
|
||||||
GL_GetProcAddress,
|
NULL, // GL_GetProcAddress,
|
||||||
NULL, // GL_UpdateTexSize,
|
NULL, // GL_UpdateTexSize,
|
||||||
NULL,
|
NULL,
|
||||||
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->GL_DrawParticles = from->GL_DrawParticles;
|
||||||
to->LightVec = from->LightVec;
|
to->LightVec = from->LightVec;
|
||||||
to->StudioGetTexture = from->StudioGetTexture;
|
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_testlights;
|
||||||
convar_t *cl_allow_levelshots;
|
convar_t *cl_allow_levelshots;
|
||||||
convar_t *cl_levelshot_name;
|
convar_t *cl_levelshot_name;
|
||||||
convar_t *cl_envshot_size;
|
static convar_t *cl_envshot_size;
|
||||||
convar_t *v_dark;
|
convar_t *v_dark;
|
||||||
|
static convar_t *net_speeds;
|
||||||
|
static convar_t *cl_showfps;
|
||||||
|
static convar_t *cl_showpos;
|
||||||
|
|
||||||
typedef struct
|
typedef struct
|
||||||
{
|
{
|
||||||
@@ -102,6 +105,41 @@ void SCR_DrawFPS( int height )
|
|||||||
Con_DrawString( refState.width - offset - 4, height, fpsstring, color );
|
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
|
SCR_NetSpeeds
|
||||||
@@ -112,8 +150,7 @@ same as r_speeds but for network channel
|
|||||||
void SCR_NetSpeeds( void )
|
void SCR_NetSpeeds( void )
|
||||||
{
|
{
|
||||||
static char msg[MAX_SYSPATH];
|
static char msg[MAX_SYSPATH];
|
||||||
int x, y, height;
|
int x, y;
|
||||||
char *p, *start, *end;
|
|
||||||
float time = cl.mtime[0];
|
float time = cl.mtime[0];
|
||||||
static int min_svfps = 100;
|
static int min_svfps = 100;
|
||||||
static int max_svfps = 0;
|
static int max_svfps = 0;
|
||||||
@@ -122,6 +159,7 @@ void SCR_NetSpeeds( void )
|
|||||||
static int max_clfps = 0;
|
static int max_clfps = 0;
|
||||||
int cur_clfps = 0;
|
int cur_clfps = 0;
|
||||||
rgba_t color;
|
rgba_t color;
|
||||||
|
cl_font_t *font = Con_GetCurFont();
|
||||||
|
|
||||||
if( !host.allow_console )
|
if( !host.allow_console )
|
||||||
return;
|
return;
|
||||||
@@ -145,28 +183,24 @@ void SCR_NetSpeeds( void )
|
|||||||
if( cur_clfps > max_clfps ) max_clfps = cur_clfps;
|
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",
|
Q_snprintf( msg, sizeof( msg ),
|
||||||
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 ));
|
"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;
|
x = refState.width - 320 * font->scale;
|
||||||
y = 384;
|
y = 384;
|
||||||
|
|
||||||
Con_DrawStringLen( NULL, NULL, &height );
|
|
||||||
MakeRGBA( color, 255, 255, 255, 255 );
|
MakeRGBA( color, 255, 255, 255, 255 );
|
||||||
|
CL_DrawString( x, y, msg, color, font, FONT_DRAW_RESETCOLORONLF );
|
||||||
p = start = msg;
|
|
||||||
|
|
||||||
do
|
|
||||||
{
|
|
||||||
end = Q_strchr( p, '\n' );
|
|
||||||
if( end ) msg[end-start] = '\0';
|
|
||||||
|
|
||||||
Con_DrawString( x, y, p, color );
|
|
||||||
y += height;
|
|
||||||
|
|
||||||
if( end ) p = end + 1;
|
|
||||||
else break;
|
|
||||||
} while( 1 );
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
@@ -183,31 +217,15 @@ void SCR_RSpeeds( void )
|
|||||||
|
|
||||||
if( ref.dllFuncs.R_SpeedsMessage( msg, sizeof( msg )))
|
if( ref.dllFuncs.R_SpeedsMessage( msg, sizeof( msg )))
|
||||||
{
|
{
|
||||||
int x, y, height;
|
int x, y;
|
||||||
char *p, *start, *end;
|
|
||||||
rgba_t color;
|
rgba_t color;
|
||||||
|
cl_font_t *font = Con_GetCurFont();
|
||||||
|
|
||||||
x = refState.width - 340;
|
x = refState.width - 340 * font->scale;
|
||||||
y = 64;
|
y = 64;
|
||||||
|
|
||||||
Con_DrawStringLen( NULL, NULL, &height );
|
|
||||||
MakeRGBA( color, 255, 255, 255, 255 );
|
MakeRGBA( color, 255, 255, 255, 255 );
|
||||||
|
CL_DrawString( x, y, msg, color, font, FONT_DRAW_RESETCOLORONLF );
|
||||||
p = start = msg;
|
|
||||||
do
|
|
||||||
{
|
|
||||||
end = Q_strchr( p, '\n' );
|
|
||||||
if( end ) msg[end-start] = '\0';
|
|
||||||
|
|
||||||
Con_DrawString( x, y, p, color );
|
|
||||||
y += height;
|
|
||||||
|
|
||||||
// handle '\n\n'
|
|
||||||
if( *p == '\n' )
|
|
||||||
y += height;
|
|
||||||
if( end ) p = end + 1;
|
|
||||||
else break;
|
|
||||||
} while( 1 );
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -342,17 +360,18 @@ SCR_BeginLoadingPlaque
|
|||||||
*/
|
*/
|
||||||
void SCR_BeginLoadingPlaque( qboolean is_background )
|
void SCR_BeginLoadingPlaque( qboolean is_background )
|
||||||
{
|
{
|
||||||
float oldclear;
|
float oldclear = 0;;
|
||||||
|
|
||||||
S_StopAllSounds( true );
|
S_StopAllSounds( true );
|
||||||
cl.audio_prepped = false; // don't play ambients
|
cl.audio_prepped = false; // don't play ambients
|
||||||
cl.video_prepped = false;
|
cl.video_prepped = false;
|
||||||
oldclear = gl_clear->value;
|
|
||||||
|
if( !Host_IsDedicated() )
|
||||||
|
oldclear = gl_clear->value;
|
||||||
|
|
||||||
if( CL_IsInMenu( ) && !cls.changedemo && !is_background )
|
if( CL_IsInMenu( ) && !cls.changedemo && !is_background )
|
||||||
{
|
{
|
||||||
UI_SetActiveMenu( false );
|
UI_SetActiveMenu( false );
|
||||||
if( cls.state == ca_disconnected )
|
if( cls.state == ca_disconnected && !(GameState->curstate == STATE_RUNFRAME && GameState->nextstate != STATE_RUNFRAME) )
|
||||||
SCR_UpdateScreen();
|
SCR_UpdateScreen();
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -362,14 +381,18 @@ void SCR_BeginLoadingPlaque( qboolean is_background )
|
|||||||
if( cls.key_dest == key_console )
|
if( cls.key_dest == key_console )
|
||||||
return;
|
return;
|
||||||
|
|
||||||
gl_clear->value = 0.0f;
|
if( !Host_IsDedicated() )
|
||||||
|
gl_clear->value = 0.0f;
|
||||||
|
|
||||||
if( is_background ) IN_MouseSavePos( );
|
if( is_background ) IN_MouseSavePos( );
|
||||||
cls.draw_changelevel = !is_background;
|
cls.draw_changelevel = !is_background;
|
||||||
SCR_UpdateScreen();
|
SCR_UpdateScreen();
|
||||||
cls.disable_screen = host.realtime;
|
cls.disable_screen = host.realtime;
|
||||||
cls.disable_servercount = cl.servercount;
|
|
||||||
cl.background = is_background; // set right state before svc_serverdata is came
|
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();
|
// SNDDMA_LockSound();
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -524,77 +547,6 @@ void SCR_UpdateScreen( void )
|
|||||||
V_PostRender();
|
V_PostRender();
|
||||||
}
|
}
|
||||||
|
|
||||||
qboolean SCR_LoadFixedWidthFont( const char *fontname )
|
|
||||||
{
|
|
||||||
int i, fontWidth;
|
|
||||||
|
|
||||||
if( cls.creditsFont.valid )
|
|
||||||
return true; // already loaded
|
|
||||||
|
|
||||||
if( !FS_FileExists( fontname, false ))
|
|
||||||
return false;
|
|
||||||
|
|
||||||
cls.creditsFont.hFontTexture = ref.dllFuncs.GL_LoadTexture( fontname, NULL, 0, TF_IMAGE|TF_KEEP_SOURCE );
|
|
||||||
R_GetTextureParms( &fontWidth, NULL, cls.creditsFont.hFontTexture );
|
|
||||||
cls.creditsFont.charHeight = clgame.scrInfo.iCharHeight = fontWidth / 16;
|
|
||||||
cls.creditsFont.type = FONT_FIXED;
|
|
||||||
cls.creditsFont.valid = true;
|
|
||||||
|
|
||||||
// build fixed rectangles
|
|
||||||
for( i = 0; i < 256; i++ )
|
|
||||||
{
|
|
||||||
cls.creditsFont.fontRc[i].left = (i * (fontWidth / 16)) % fontWidth;
|
|
||||||
cls.creditsFont.fontRc[i].right = cls.creditsFont.fontRc[i].left + fontWidth / 16;
|
|
||||||
cls.creditsFont.fontRc[i].top = (i / 16) * (fontWidth / 16);
|
|
||||||
cls.creditsFont.fontRc[i].bottom = cls.creditsFont.fontRc[i].top + fontWidth / 16;
|
|
||||||
cls.creditsFont.charWidths[i] = clgame.scrInfo.charWidths[i] = fontWidth / 16;
|
|
||||||
}
|
|
||||||
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
qboolean SCR_LoadVariableWidthFont( const char *fontname )
|
|
||||||
{
|
|
||||||
int i, fontWidth;
|
|
||||||
byte *buffer;
|
|
||||||
fs_offset_t length;
|
|
||||||
qfont_t *src;
|
|
||||||
|
|
||||||
if( cls.creditsFont.valid )
|
|
||||||
return true; // already loaded
|
|
||||||
|
|
||||||
if( !FS_FileExists( fontname, false ))
|
|
||||||
return false;
|
|
||||||
|
|
||||||
cls.creditsFont.hFontTexture = ref.dllFuncs.GL_LoadTexture( fontname, NULL, 0, TF_IMAGE );
|
|
||||||
R_GetTextureParms( &fontWidth, NULL, cls.creditsFont.hFontTexture );
|
|
||||||
|
|
||||||
// half-life font with variable chars witdh
|
|
||||||
buffer = FS_LoadFile( fontname, &length, false );
|
|
||||||
|
|
||||||
// setup creditsfont
|
|
||||||
if( buffer && length >= sizeof( qfont_t ))
|
|
||||||
{
|
|
||||||
src = (qfont_t *)buffer;
|
|
||||||
cls.creditsFont.charHeight = clgame.scrInfo.iCharHeight = src->rowheight;
|
|
||||||
cls.creditsFont.type = FONT_VARIABLE;
|
|
||||||
|
|
||||||
// build rectangles
|
|
||||||
for( i = 0; i < 256; i++ )
|
|
||||||
{
|
|
||||||
cls.creditsFont.fontRc[i].left = (word)src->fontinfo[i].startoffset % fontWidth;
|
|
||||||
cls.creditsFont.fontRc[i].right = cls.creditsFont.fontRc[i].left + src->fontinfo[i].charwidth;
|
|
||||||
cls.creditsFont.fontRc[i].top = (word)src->fontinfo[i].startoffset / fontWidth;
|
|
||||||
cls.creditsFont.fontRc[i].bottom = cls.creditsFont.fontRc[i].top + src->rowheight;
|
|
||||||
cls.creditsFont.charWidths[i] = clgame.scrInfo.charWidths[i] = src->fontinfo[i].charwidth;
|
|
||||||
}
|
|
||||||
cls.creditsFont.valid = true;
|
|
||||||
}
|
|
||||||
if( buffer ) Mem_Free( buffer );
|
|
||||||
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
================
|
================
|
||||||
SCR_LoadCreditsFont
|
SCR_LoadCreditsFont
|
||||||
@@ -604,22 +556,41 @@ INTERNAL RESOURCE
|
|||||||
*/
|
*/
|
||||||
void SCR_LoadCreditsFont( void )
|
void SCR_LoadCreditsFont( void )
|
||||||
{
|
{
|
||||||
const char *path = "gfx/creditsfont.fnt";
|
cl_font_t *const font = &cls.creditsFont;
|
||||||
dword crc;
|
qboolean success = false;
|
||||||
|
float scale = hud_fontscale->value;
|
||||||
|
dword crc = 0;
|
||||||
|
|
||||||
// replace default gfx.wad textures by current charset's font
|
// replace default gfx.wad textures by current charset's font
|
||||||
if( !CRC32_File( &crc, "gfx.wad" ) || crc == 0x49eb9f16 )
|
if( !CRC32_File( &crc, "gfx.wad" ) || crc == 0x49eb9f16 )
|
||||||
{
|
{
|
||||||
const char *path2 = va("creditsfont_%s.fnt", Cvar_VariableString( "con_charset" ) );
|
string charsetFnt;
|
||||||
if( FS_FileExists( path2, false ) )
|
|
||||||
path = path2;
|
if( Q_snprintf( charsetFnt, sizeof( charsetFnt ),
|
||||||
|
"creditsfont_%s.fnt", Cvar_VariableString( "con_charset" )) > 0 )
|
||||||
|
{
|
||||||
|
if( FS_FileExists( charsetFnt, false ))
|
||||||
|
success = Con_LoadVariableWidthFont( charsetFnt, font, scale, kRenderTransAdd, TF_FONT );
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if( !SCR_LoadVariableWidthFont( path ))
|
if( !success )
|
||||||
|
success = Con_LoadVariableWidthFont( "gfx/creditsfont.fnt", font, scale, kRenderTransAdd, TF_FONT );
|
||||||
|
|
||||||
|
if( !success )
|
||||||
|
success = Con_LoadFixedWidthFont( "gfx/conchars", font, scale, kRenderTransAdd, TF_FONT );
|
||||||
|
|
||||||
|
// copy font size for client.dll
|
||||||
|
if( success )
|
||||||
{
|
{
|
||||||
if( !SCR_LoadFixedWidthFont( "gfx/conchars" ))
|
int i;
|
||||||
Con_DPrintf( S_ERROR "failed to load HUD font\n" );
|
|
||||||
|
clgame.scrInfo.iCharHeight = cls.creditsFont.charHeight;
|
||||||
|
|
||||||
|
for( i = 0; i < ARRAYSIZE( cls.creditsFont.charWidths ); i++ )
|
||||||
|
clgame.scrInfo.charWidths[i] = cls.creditsFont.charWidths[i];
|
||||||
}
|
}
|
||||||
|
else Con_DPrintf( S_ERROR "failed to load HUD font\n" );
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
@@ -741,7 +712,13 @@ void SCR_VidInit( void )
|
|||||||
gameui.globals->scrHeight = refState.height;
|
gameui.globals->scrHeight = refState.height;
|
||||||
}
|
}
|
||||||
|
|
||||||
VGui_Startup( NULL, refState.width, refState.height ); // initialized already, so pass NULL
|
// notify vgui about screen size change
|
||||||
|
if( clgame.hInstance )
|
||||||
|
{
|
||||||
|
// do not pass client pointer, we do not want to
|
||||||
|
// re-initialize vgui2
|
||||||
|
VGui_Startup( NULL, refState.width, refState.height );
|
||||||
|
}
|
||||||
|
|
||||||
CL_ClearSpriteTextures(); // now all hud sprites are invalid
|
CL_ClearSpriteTextures(); // now all hud sprites are invalid
|
||||||
|
|
||||||
@@ -771,6 +748,9 @@ void SCR_Init( void )
|
|||||||
cl_envshot_size = Cvar_Get( "cl_envshot_size", "256", FCVAR_ARCHIVE, "envshot size of cube side" );
|
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" );
|
v_dark = Cvar_Get( "v_dark", "0", 0, "starts level from dark screen" );
|
||||||
scr_viewsize = Cvar_Get( "viewsize", "120", FCVAR_ARCHIVE, "screen size" );
|
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", "0", FCVAR_ARCHIVE, "show client fps" );
|
||||||
|
cl_showpos = Cvar_Get( "cl_showpos", "0", FCVAR_ARCHIVE, "show local player position and velocity" );
|
||||||
|
|
||||||
// register our commands
|
// register our commands
|
||||||
Cmd_AddCommand( "skyname", CL_SetSky_f, "set new skybox by basename" );
|
Cmd_AddCommand( "skyname", CL_SetSky_f, "set new skybox by basename" );
|
||||||
|
|||||||
463
engine/client/cl_securedstub.c
Normal file
463
engine/client/cl_securedstub.c
Normal file
@@ -0,0 +1,463 @@
|
|||||||
|
/*
|
||||||
|
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 )
|
||||||
|
{
|
||||||
|
modfuncs_t modFuncs = { 0 };
|
||||||
|
|
||||||
|
// secured client dlls need these
|
||||||
|
cldll_func_src_t cldllFuncSrc =
|
||||||
|
{
|
||||||
|
(void *)&modFuncs,
|
||||||
|
NULL,
|
||||||
|
(void *)&cldllFuncDst
|
||||||
|
};
|
||||||
|
|
||||||
|
// 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
|
// then check sounds
|
||||||
for( i = 0; i < ARRAYSIZE( cl_player_shell_sounds ); i++ )
|
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 ))
|
if( !FS_FileExists( filepath, false ))
|
||||||
CL_AddClientResource( cl_player_shell_sounds[i], t_sound );
|
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++ )
|
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 ))
|
if( !FS_FileExists( filepath, false ))
|
||||||
CL_AddClientResource( cl_weapon_shell_sounds[i], t_sound );
|
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++ )
|
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 ))
|
if( !FS_FileExists( filepath, false ))
|
||||||
CL_AddClientResource( cl_explode_sounds[i], t_sound );
|
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
|
#if 0 // ric sounds was precached by server-side
|
||||||
for( i = 0; i < ARRAYSIZE( cl_ricochet_sounds ); i++ )
|
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 ))
|
if( !FS_FileExists( filepath, false ))
|
||||||
CL_AddClientResource( cl_ricochet_sounds[i], t_sound );
|
CL_AddClientResource( cl_ricochet_sounds[i], t_sound );
|
||||||
@@ -322,15 +322,15 @@ void CL_TempEntPlaySound( TEMPENTITY *pTemp, float damp )
|
|||||||
Q_snprintf( soundname, sizeof( soundname ), "debris/wood%i.wav", COM_RandomLong( 1, 4 ));
|
Q_snprintf( soundname, sizeof( soundname ), "debris/wood%i.wav", COM_RandomLong( 1, 4 ));
|
||||||
break;
|
break;
|
||||||
case BOUNCE_SHRAP:
|
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;
|
break;
|
||||||
case BOUNCE_SHOTSHELL:
|
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
|
isshellcasing = true; // shell casings have different playback parameters
|
||||||
fvol = 0.5f;
|
fvol = 0.5f;
|
||||||
break;
|
break;
|
||||||
case BOUNCE_SHELL:
|
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
|
isshellcasing = true; // shell casings have different playback parameters
|
||||||
break;
|
break;
|
||||||
case BOUNCE_CONCRETE:
|
case BOUNCE_CONCRETE:
|
||||||
@@ -361,8 +361,8 @@ void CL_TempEntPlaySound( TEMPENTITY *pTemp, float damp )
|
|||||||
sound_t handle;
|
sound_t handle;
|
||||||
|
|
||||||
if( isshellcasing )
|
if( isshellcasing )
|
||||||
fvol *= min ( 1.0f, ((float)zvel) / 350.0f );
|
fvol *= Q_min( 1.0f, ((float)zvel) / 350.0f );
|
||||||
else fvol *= min ( 1.0f, ((float)zvel) / 450.0f );
|
else fvol *= Q_min( 1.0f, ((float)zvel) / 450.0f );
|
||||||
|
|
||||||
if( !COM_RandomLong( 0, 3 ) && !isshellcasing )
|
if( !COM_RandomLong( 0, 3 ) && !isshellcasing )
|
||||||
pitch = COM_RandomLong( 95, 105 );
|
pitch = COM_RandomLong( 95, 105 );
|
||||||
@@ -550,7 +550,7 @@ CL_TempEntAlloc
|
|||||||
custom tempentity allocation
|
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;
|
TEMPENTITY *pTemp;
|
||||||
|
|
||||||
@@ -587,7 +587,7 @@ R_FizzEffect
|
|||||||
Create a fizz effect
|
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;
|
TEMPENTITY *pTemp;
|
||||||
int i, width, depth, count;
|
int i, width, depth, count;
|
||||||
@@ -650,7 +650,7 @@ R_Bubbles
|
|||||||
Create 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;
|
TEMPENTITY *pTemp;
|
||||||
float sine, cosine;
|
float sine, cosine;
|
||||||
@@ -696,7 +696,7 @@ R_BubbleTrail
|
|||||||
Create bubble trail
|
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;
|
TEMPENTITY *pTemp;
|
||||||
float sine, cosine, zspeed;
|
float sine, cosine, zspeed;
|
||||||
@@ -741,7 +741,7 @@ R_AttachTentToPlayer
|
|||||||
Attaches entity to player
|
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;
|
TEMPENTITY *pTemp;
|
||||||
vec3_t position;
|
vec3_t position;
|
||||||
@@ -797,7 +797,7 @@ R_KillAttachedTents
|
|||||||
Detach entity from player
|
Detach entity from player
|
||||||
==============
|
==============
|
||||||
*/
|
*/
|
||||||
void R_KillAttachedTents( int client )
|
void GAME_EXPORT R_KillAttachedTents( int client )
|
||||||
{
|
{
|
||||||
int i;
|
int i;
|
||||||
|
|
||||||
@@ -828,7 +828,7 @@ R_RicochetSprite
|
|||||||
Create ricochet sprite
|
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;
|
TEMPENTITY *pTemp;
|
||||||
|
|
||||||
@@ -854,7 +854,7 @@ R_RocketFlare
|
|||||||
Create rocket flare
|
Create rocket flare
|
||||||
==============
|
==============
|
||||||
*/
|
*/
|
||||||
void R_RocketFlare( const vec3_t pos )
|
void GAME_EXPORT R_RocketFlare( const vec3_t pos )
|
||||||
{
|
{
|
||||||
TEMPENTITY *pTemp;
|
TEMPENTITY *pTemp;
|
||||||
|
|
||||||
@@ -880,7 +880,7 @@ R_MuzzleFlash
|
|||||||
Do 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;
|
TEMPENTITY *pTemp;
|
||||||
int index;
|
int index;
|
||||||
@@ -919,7 +919,7 @@ Create a high priority blood sprite
|
|||||||
and some blood drops. This is high-priority tent
|
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;
|
model_t *pModel, *pModel2;
|
||||||
int impactindex;
|
int impactindex;
|
||||||
@@ -1005,7 +1005,7 @@ R_BreakModel
|
|||||||
Create a shards
|
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;
|
TEMPENTITY *pTemp;
|
||||||
model_t *pmodel;
|
model_t *pmodel;
|
||||||
@@ -1037,7 +1037,7 @@ void R_BreakModel( const vec3_t pos, const vec3_t size, const vec3_t dir, float
|
|||||||
vecSpot[1] = pos[1] + COM_RandomFloat( -0.5f, 0.5f ) * size[1];
|
vecSpot[1] = pos[1] + COM_RandomFloat( -0.5f, 0.5f ) * size[1];
|
||||||
vecSpot[2] = pos[2] + COM_RandomFloat( -0.5f, 0.5f ) * size[2];
|
vecSpot[2] = pos[2] + COM_RandomFloat( -0.5f, 0.5f ) * size[2];
|
||||||
|
|
||||||
if( CL_PointContents( vecSpot ) != CONTENTS_SOLID )
|
if( PM_CL_PointContents( vecSpot, NULL ) != CONTENTS_SOLID )
|
||||||
break; // valid spot
|
break; // valid spot
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1180,7 +1180,7 @@ 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;
|
TEMPENTITY *pTemp;
|
||||||
|
|
||||||
@@ -1243,39 +1243,30 @@ R_Sprite_Explode
|
|||||||
apply params for exploding sprite
|
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;
|
qboolean noadditive, drawalpha, rotate;
|
||||||
|
|
||||||
if( FBitSet( flags, TE_EXPLFLAG_NOADDITIVE ))
|
if( !pTemp )
|
||||||
{
|
return;
|
||||||
// solid sprite
|
|
||||||
pTemp->entity.curstate.rendermode = kRenderNormal;
|
|
||||||
pTemp->entity.curstate.renderamt = 255;
|
|
||||||
}
|
|
||||||
else if( FBitSet( flags, TE_EXPLFLAG_DRAWALPHA ))
|
|
||||||
{
|
|
||||||
// alpha sprite (came from hl2)
|
|
||||||
pTemp->entity.curstate.rendermode = kRenderTransAlpha;
|
|
||||||
pTemp->entity.curstate.renderamt = 180;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
// additive sprite
|
|
||||||
pTemp->entity.curstate.rendermode = kRenderTransAdd;
|
|
||||||
pTemp->entity.curstate.renderamt = 180;
|
|
||||||
}
|
|
||||||
|
|
||||||
if( FBitSet( flags, TE_EXPLFLAG_ROTATE ))
|
noadditive = FBitSet( flags, TE_EXPLFLAG_NOADDITIVE );
|
||||||
{
|
drawalpha = FBitSet( flags, TE_EXPLFLAG_DRAWALPHA );
|
||||||
// came from hl2
|
rotate = FBitSet( flags, TE_EXPLFLAG_ROTATE );
|
||||||
pTemp->entity.angles[2] = COM_RandomLong( 0, 360 );
|
|
||||||
}
|
|
||||||
|
|
||||||
pTemp->entity.curstate.renderfx = kRenderFxNone;
|
|
||||||
pTemp->entity.baseline.origin[2] = 8;
|
|
||||||
pTemp->entity.origin[2] += 10;
|
|
||||||
pTemp->entity.curstate.scale = scale;
|
pTemp->entity.curstate.scale = scale;
|
||||||
|
pTemp->entity.baseline.origin[2] = 8.0f;
|
||||||
|
pTemp->entity.origin[2] = pTemp->entity.origin[2] + 10.0f;
|
||||||
|
if( rotate )
|
||||||
|
pTemp->entity.angles[2] = COM_RandomFloat( 0.0, 360.0f );
|
||||||
|
|
||||||
|
pTemp->entity.curstate.rendermode = noadditive ? kRenderNormal :
|
||||||
|
drawalpha ? kRenderTransAlpha : kRenderTransAdd;
|
||||||
|
pTemp->entity.curstate.renderamt = noadditive ? 0xff : 0xb4;
|
||||||
|
pTemp->entity.curstate.renderfx = 0;
|
||||||
|
pTemp->entity.curstate.rendercolor.r = 0;
|
||||||
|
pTemp->entity.curstate.rendercolor.g = 0;
|
||||||
|
pTemp->entity.curstate.rendercolor.b = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
@@ -1285,7 +1276,7 @@ R_Sprite_Smoke
|
|||||||
apply params for smoke sprite
|
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;
|
int iColor;
|
||||||
|
|
||||||
@@ -1309,7 +1300,7 @@ R_Spray
|
|||||||
Throws a shower of sprites or models
|
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;
|
TEMPENTITY *pTemp;
|
||||||
float noise;
|
float noise;
|
||||||
@@ -1375,7 +1366,7 @@ R_Sprite_Spray
|
|||||||
Spray of alpha sprites
|
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 );
|
R_Spray( pos, dir, modelIndex, count, speed, spread, kRenderGlow );
|
||||||
}
|
}
|
||||||
@@ -1388,7 +1379,7 @@ Line of moving glow sprites with gravity,
|
|||||||
fadeout, and collisions
|
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;
|
TEMPENTITY *pTemp;
|
||||||
vec3_t delta, dir;
|
vec3_t delta, dir;
|
||||||
@@ -1440,7 +1431,7 @@ R_FunnelSprite
|
|||||||
Create a funnel effect with custom sprite
|
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;
|
TEMPENTITY *pTemp;
|
||||||
vec3_t dir, dest;
|
vec3_t dir, dest;
|
||||||
@@ -1482,7 +1473,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.baseline.angles[2] = COM_RandomFloat( -100.0f, 100.0f );
|
||||||
pTemp->entity.curstate.framerate = COM_RandomFloat( 0.1f, 0.4f );
|
pTemp->entity.curstate.framerate = COM_RandomFloat( 0.1f, 0.4f );
|
||||||
pTemp->flags = FTENT_ROTATE|FTENT_FADEOUT;
|
pTemp->flags = FTENT_ROTATE|FTENT_FADEOUT;
|
||||||
pTemp->entity.curstate.framerate = 10;
|
|
||||||
|
|
||||||
vel = dest[2] / 8.0f;
|
vel = dest[2] / 8.0f;
|
||||||
if( vel < 64.0f ) vel = 64.0f;
|
if( vel < 64.0f ) vel = 64.0f;
|
||||||
@@ -1502,7 +1492,7 @@ R_SparkEffect
|
|||||||
Create a streaks + richochet sprite
|
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_RicochetSprite( pos, cl_sprite_ricochet, 0.1f, COM_RandomFloat( 0.5f, 1.0f ));
|
||||||
R_SparkStreaks( pos, count, velocityMin, velocityMax );
|
R_SparkStreaks( pos, count, velocityMin, velocityMax );
|
||||||
@@ -1515,17 +1505,18 @@ R_RicochetSound
|
|||||||
Make a random ricochet sound
|
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;
|
sound_t handle;
|
||||||
|
|
||||||
Q_snprintf( soundpath, sizeof( soundpath ), "%s", cl_ricochet_sounds[COM_RandomLong( 0, 4 )] );
|
handle = S_RegisterSound( cl_ricochet_sounds[sound] );
|
||||||
handle = S_RegisterSound( soundpath );
|
|
||||||
|
|
||||||
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 +1526,7 @@ R_Projectile
|
|||||||
Create an projectile entity
|
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;
|
TEMPENTITY *pTemp;
|
||||||
model_t *pmodel;
|
model_t *pmodel;
|
||||||
@@ -1584,7 +1575,7 @@ R_TempSphereModel
|
|||||||
Spherical shower of models, picks from set
|
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;
|
TEMPENTITY *pTemp;
|
||||||
int i;
|
int i;
|
||||||
@@ -1632,7 +1623,7 @@ R_Explosion
|
|||||||
Create an explosion (scale is magnitude)
|
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;
|
sound_t hSound;
|
||||||
|
|
||||||
@@ -1656,7 +1647,7 @@ void R_Explosion( vec3_t pos, int model, float scale, float framerate, int flags
|
|||||||
dl->color.g = 250;
|
dl->color.g = 250;
|
||||||
dl->color.b = 150;
|
dl->color.b = 150;
|
||||||
dl->die = cl.time + 0.01f;
|
dl->die = cl.time + 0.01f;
|
||||||
dl->decay = 80;
|
dl->decay = 800;
|
||||||
|
|
||||||
// red glow
|
// red glow
|
||||||
dl = CL_AllocDlight( 0 );
|
dl = CL_AllocDlight( 0 );
|
||||||
@@ -1672,7 +1663,7 @@ void R_Explosion( vec3_t pos, int model, float scale, float framerate, int flags
|
|||||||
|
|
||||||
if( !FBitSet( flags, TE_EXPLFLAG_NOSOUND ))
|
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 );
|
S_StartSound( pos, 0, CHAN_STATIC, hSound, VOL_NORM, 0.3f, PITCH_NORM, 0 );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -1684,7 +1675,7 @@ R_PlayerSprites
|
|||||||
Create a particle smoke around player
|
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;
|
TEMPENTITY *pTemp;
|
||||||
cl_entity_t *pEnt;
|
cl_entity_t *pEnt;
|
||||||
@@ -1749,7 +1740,7 @@ R_FireField
|
|||||||
Makes a field of fire
|
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;
|
TEMPENTITY *pTemp;
|
||||||
model_t *pmodel;
|
model_t *pmodel;
|
||||||
@@ -1824,7 +1815,7 @@ R_MultiGunshot
|
|||||||
Client version of shotgun shot
|
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;
|
pmtrace_t trace;
|
||||||
vec3_t right, up;
|
vec3_t right, up;
|
||||||
@@ -1880,7 +1871,7 @@ R_Sprite_WallPuff
|
|||||||
Create a 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;
|
if( !pTemp ) return;
|
||||||
|
|
||||||
@@ -1904,7 +1895,7 @@ handle temp-entity messages
|
|||||||
void CL_ParseTempEntity( sizebuf_t *msg )
|
void CL_ParseTempEntity( sizebuf_t *msg )
|
||||||
{
|
{
|
||||||
sizebuf_t buf;
|
sizebuf_t buf;
|
||||||
byte pbuf[256];
|
byte pbuf[2048];
|
||||||
int iSize;
|
int iSize;
|
||||||
int type, color, count, flags;
|
int type, color, count, flags;
|
||||||
int decalIndex, modelIndex, entityIndex;
|
int decalIndex, modelIndex, entityIndex;
|
||||||
@@ -1915,6 +1906,7 @@ void CL_ParseTempEntity( sizebuf_t *msg )
|
|||||||
TEMPENTITY *pTemp;
|
TEMPENTITY *pTemp;
|
||||||
cl_entity_t *pEnt;
|
cl_entity_t *pEnt;
|
||||||
dlight_t *dl;
|
dlight_t *dl;
|
||||||
|
sound_t hSound;
|
||||||
|
|
||||||
if( cls.legacymode )
|
if( cls.legacymode )
|
||||||
iSize = MSG_ReadByte( msg );
|
iSize = MSG_ReadByte( msg );
|
||||||
@@ -1922,6 +1914,10 @@ void CL_ParseTempEntity( sizebuf_t *msg )
|
|||||||
|
|
||||||
decalIndex = modelIndex = entityIndex = 0;
|
decalIndex = modelIndex = entityIndex = 0;
|
||||||
|
|
||||||
|
// this will probably be fatal anyway
|
||||||
|
if( iSize > sizeof( pbuf ))
|
||||||
|
Con_Printf( S_ERROR "%s: Temp buffer overflow!\n", __FUNCTION__ );
|
||||||
|
|
||||||
// parse user message into buffer
|
// parse user message into buffer
|
||||||
MSG_ReadBytes( msg, pbuf, iSize );
|
MSG_ReadBytes( msg, pbuf, iSize );
|
||||||
|
|
||||||
@@ -1969,6 +1965,9 @@ void CL_ParseTempEntity( sizebuf_t *msg )
|
|||||||
pos[1] = MSG_ReadCoord( &buf );
|
pos[1] = MSG_ReadCoord( &buf );
|
||||||
pos[2] = MSG_ReadCoord( &buf );
|
pos[2] = MSG_ReadCoord( &buf );
|
||||||
R_BlobExplosion( pos );
|
R_BlobExplosion( pos );
|
||||||
|
|
||||||
|
hSound = S_RegisterSound( cl_explode_sounds[0] );
|
||||||
|
S_StartSound( pos, -1, CHAN_AUTO, hSound, VOL_NORM, 1.0f, PITCH_NORM, 0 );
|
||||||
break;
|
break;
|
||||||
case TE_SMOKE:
|
case TE_SMOKE:
|
||||||
pos[0] = MSG_ReadCoord( &buf );
|
pos[0] = MSG_ReadCoord( &buf );
|
||||||
@@ -2014,15 +2013,46 @@ void CL_ParseTempEntity( sizebuf_t *msg )
|
|||||||
color = MSG_ReadByte( &buf );
|
color = MSG_ReadByte( &buf );
|
||||||
count = MSG_ReadByte( &buf );
|
count = MSG_ReadByte( &buf );
|
||||||
R_ParticleExplosion2( pos, color, count );
|
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, -1, CHAN_AUTO, hSound, VOL_NORM, 0.6f, PITCH_NORM, 0 );
|
||||||
break;
|
break;
|
||||||
case TE_BSPDECAL:
|
case TE_BSPDECAL:
|
||||||
|
case TE_DECAL:
|
||||||
|
case TE_WORLDDECAL:
|
||||||
|
case TE_WORLDDECALHIGH:
|
||||||
|
case TE_DECALHIGH:
|
||||||
pos[0] = MSG_ReadCoord( &buf );
|
pos[0] = MSG_ReadCoord( &buf );
|
||||||
pos[1] = MSG_ReadCoord( &buf );
|
pos[1] = MSG_ReadCoord( &buf );
|
||||||
pos[2] = MSG_ReadCoord( &buf );
|
pos[2] = MSG_ReadCoord( &buf );
|
||||||
decalIndex = MSG_ReadShort( &buf );
|
if( type == TE_BSPDECAL )
|
||||||
entityIndex = MSG_ReadShort( &buf );
|
{
|
||||||
if( entityIndex ) modelIndex = MSG_ReadShort( &buf );
|
decalIndex = MSG_ReadShort( &buf );
|
||||||
CL_DecalShoot( CL_DecalIndex( decalIndex ), entityIndex, modelIndex, pos, FDECAL_PERMANENT );
|
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;
|
break;
|
||||||
case TE_IMPLOSION:
|
case TE_IMPLOSION:
|
||||||
pos[0] = MSG_ReadCoord( &buf );
|
pos[0] = MSG_ReadCoord( &buf );
|
||||||
@@ -2042,10 +2072,12 @@ void CL_ParseTempEntity( sizebuf_t *msg )
|
|||||||
pos2[2] = MSG_ReadCoord( &buf );
|
pos2[2] = MSG_ReadCoord( &buf );
|
||||||
modelIndex = MSG_ReadShort( &buf );
|
modelIndex = MSG_ReadShort( &buf );
|
||||||
count = MSG_ReadByte( &buf );
|
count = MSG_ReadByte( &buf );
|
||||||
life = (float)(MSG_ReadByte( &buf ) * 0.1f);
|
life = (float)MSG_ReadByte( &buf ) * 0.1f;
|
||||||
scale = (float)(MSG_ReadByte( &buf ) * 0.1f);
|
scale = (float)MSG_ReadByte( &buf );
|
||||||
vel = (float)MSG_ReadByte( &buf );
|
if( !scale ) scale = 1.0f;
|
||||||
random = (float)MSG_ReadByte( &buf );
|
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 );
|
R_Sprite_Trail( type, pos, pos2, modelIndex, count, life, scale, random, 255, vel );
|
||||||
break;
|
break;
|
||||||
case TE_SPRITE:
|
case TE_SPRITE:
|
||||||
@@ -2053,36 +2085,23 @@ void CL_ParseTempEntity( sizebuf_t *msg )
|
|||||||
pos[1] = MSG_ReadCoord( &buf );
|
pos[1] = MSG_ReadCoord( &buf );
|
||||||
pos[2] = MSG_ReadCoord( &buf );
|
pos[2] = MSG_ReadCoord( &buf );
|
||||||
modelIndex = MSG_ReadShort( &buf );
|
modelIndex = MSG_ReadShort( &buf );
|
||||||
scale = (float)(MSG_ReadByte( &buf ) * 0.1f);
|
scale = (float)MSG_ReadByte( &buf ) * 0.1f;
|
||||||
brightness = (float)MSG_ReadByte( &buf );
|
brightness = (float)MSG_ReadByte( &buf ) / 255.0f;
|
||||||
|
|
||||||
if(( pTemp = R_DefaultSprite( pos, modelIndex, 0 )) != NULL )
|
R_TempSprite( pos, vec3_origin, scale, modelIndex,
|
||||||
{
|
kRenderTransAdd, kRenderFxNone, brightness, 0.0, FTENT_SPRANIMATE );
|
||||||
pTemp->entity.curstate.scale = scale;
|
|
||||||
pTemp->entity.baseline.renderamt = brightness;
|
|
||||||
pTemp->entity.curstate.renderamt = brightness;
|
|
||||||
pTemp->entity.curstate.rendermode = kRenderTransAdd;
|
|
||||||
}
|
|
||||||
break;
|
break;
|
||||||
case TE_GLOWSPRITE:
|
case TE_GLOWSPRITE:
|
||||||
pos[0] = MSG_ReadCoord( &buf );
|
pos[0] = MSG_ReadCoord( &buf );
|
||||||
pos[1] = MSG_ReadCoord( &buf );
|
pos[1] = MSG_ReadCoord( &buf );
|
||||||
pos[2] = MSG_ReadCoord( &buf );
|
pos[2] = MSG_ReadCoord( &buf );
|
||||||
modelIndex = MSG_ReadShort( &buf );
|
modelIndex = MSG_ReadShort( &buf );
|
||||||
life = (float)(MSG_ReadByte( &buf ) * 0.1f);
|
life = (float)MSG_ReadByte( &buf ) * 0.1f;
|
||||||
scale = (float)(MSG_ReadByte( &buf ) * 0.1f);
|
scale = (float)MSG_ReadByte( &buf ) * 0.1f;
|
||||||
brightness = (float)MSG_ReadByte( &buf );
|
brightness = (float)MSG_ReadByte( &buf ) / 255.0f;
|
||||||
|
|
||||||
if(( pTemp = R_DefaultSprite( pos, modelIndex, 0 )) != NULL )
|
R_TempSprite( pos, vec3_origin, scale, modelIndex,
|
||||||
{
|
kRenderGlow, kRenderFxNoDissipation, brightness, life, FTENT_FADEOUT );
|
||||||
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;
|
|
||||||
}
|
|
||||||
break;
|
break;
|
||||||
case TE_STREAK_SPLASH:
|
case TE_STREAK_SPLASH:
|
||||||
pos[0] = MSG_ReadCoord( &buf );
|
pos[0] = MSG_ReadCoord( &buf );
|
||||||
@@ -2172,23 +2191,6 @@ void CL_ParseTempEntity( sizebuf_t *msg )
|
|||||||
pos2[2] = MSG_ReadCoord( &buf );
|
pos2[2] = MSG_ReadCoord( &buf );
|
||||||
R_ShowLine( pos, pos2 );
|
R_ShowLine( pos, pos2 );
|
||||||
break;
|
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:
|
case TE_FIZZ:
|
||||||
entityIndex = MSG_ReadShort( &buf );
|
entityIndex = MSG_ReadShort( &buf );
|
||||||
modelIndex = MSG_ReadShort( &buf );
|
modelIndex = MSG_ReadShort( &buf );
|
||||||
@@ -2244,10 +2246,11 @@ void CL_ParseTempEntity( sizebuf_t *msg )
|
|||||||
pos[2] = MSG_ReadCoord( &buf );
|
pos[2] = MSG_ReadCoord( &buf );
|
||||||
entityIndex = MSG_ReadShort( &buf );
|
entityIndex = MSG_ReadShort( &buf );
|
||||||
decalIndex = MSG_ReadByte( &buf );
|
decalIndex = MSG_ReadByte( &buf );
|
||||||
pEnt = CL_GetEntityByIndex( entityIndex );
|
|
||||||
CL_DecalShoot( CL_DecalIndex( decalIndex ), entityIndex, 0, pos, 0 );
|
CL_DecalShoot( CL_DecalIndex( decalIndex ), entityIndex, 0, pos, 0 );
|
||||||
R_BulletImpactParticles( pos );
|
R_BulletImpactParticles( pos );
|
||||||
R_RicochetSound( pos );
|
flags = COM_RandomLong( 0, 0x7fff );
|
||||||
|
if( flags < 0x3fff )
|
||||||
|
R_RicochetSound_( pos, flags % 5 );
|
||||||
break;
|
break;
|
||||||
case TE_SPRAY:
|
case TE_SPRAY:
|
||||||
case TE_SPRITE_SPRAY:
|
case TE_SPRITE_SPRAY:
|
||||||
@@ -2393,7 +2396,7 @@ void CL_ParseTempEntity( sizebuf_t *msg )
|
|||||||
|
|
||||||
// throw warning
|
// throw warning
|
||||||
if( MSG_CheckOverflow( &buf ))
|
if( MSG_CheckOverflow( &buf ))
|
||||||
Con_DPrintf( S_WARN "ParseTempEntity: overflow TE message\n" );
|
Con_DPrintf( S_WARN "ParseTempEntity: overflow TE message %i\n", type );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -2693,7 +2696,7 @@ apply various effects to entity origin or attachment
|
|||||||
void CL_AddEntityEffects( cl_entity_t *ent )
|
void CL_AddEntityEffects( cl_entity_t *ent )
|
||||||
{
|
{
|
||||||
// yellow flies effect 'monster stuck in the wall'
|
// 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 );
|
R_EntityParticles( ent );
|
||||||
|
|
||||||
if( FBitSet( ent->curstate.effects, EF_DIMLIGHT ))
|
if( FBitSet( ent->curstate.effects, EF_DIMLIGHT ))
|
||||||
@@ -2878,7 +2881,7 @@ CL_FireCustomDecal
|
|||||||
custom temporary decal
|
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 );
|
ref.dllFuncs.R_DecalShoot( textureIndex, entityIndex, modelIndex, pos, flags, scale );
|
||||||
}
|
}
|
||||||
@@ -2890,7 +2893,7 @@ CL_DecalShoot
|
|||||||
normal temporary decal
|
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 );
|
CL_FireCustomDecal( textureIndex, entityIndex, modelIndex, pos, flags, 1.0f );
|
||||||
}
|
}
|
||||||
@@ -2914,9 +2917,17 @@ 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( 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 );
|
int sprayTextureIndex;
|
||||||
|
char decalname[MAX_VA_STRING];
|
||||||
|
|
||||||
|
Q_snprintf( decalname, sizeof( decalname ), "player%dlogo%d", playernum, customIndex );
|
||||||
|
sprayTextureIndex = ref.dllFuncs.GL_FindTexture( decalname );
|
||||||
|
if( sprayTextureIndex != 0 )
|
||||||
|
{
|
||||||
|
ref.dllFuncs.GL_FreeTexture( sprayTextureIndex );
|
||||||
|
}
|
||||||
pCust->nUserData1 = GL_LoadTextureInternal( decalname, pCust->pInfo, TF_DECAL );
|
pCust->nUserData1 = GL_LoadTextureInternal( decalname, pCust->pInfo, TF_DECAL );
|
||||||
}
|
}
|
||||||
textureIndex = pCust->nUserData1;
|
textureIndex = pCust->nUserData1;
|
||||||
@@ -2933,7 +2944,7 @@ CL_DecalIndexFromName
|
|||||||
get decal global index from decalname
|
get decal global index from decalname
|
||||||
===============
|
===============
|
||||||
*/
|
*/
|
||||||
int CL_DecalIndexFromName( const char *name )
|
int GAME_EXPORT CL_DecalIndexFromName( const char *name )
|
||||||
{
|
{
|
||||||
int i;
|
int i;
|
||||||
|
|
||||||
@@ -2956,7 +2967,7 @@ CL_DecalIndex
|
|||||||
get texture index from decal global index
|
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 );
|
id = bound( 0, id, MAX_DECALS - 1 );
|
||||||
|
|
||||||
@@ -2977,7 +2988,7 @@ CL_DecalRemoveAll
|
|||||||
remove all decals with specified texture
|
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] );
|
ref.dllFuncs.R_DecalRemoveAll( cl.decal_index[id] );
|
||||||
|
|||||||
@@ -104,7 +104,7 @@ void SCR_CheckStartupVids( void )
|
|||||||
|
|
||||||
pfile = (char *)afile;
|
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] ));
|
Q_strncpy( cls.movies[c], token, sizeof( cls.movies[0] ));
|
||||||
|
|
||||||
@@ -209,7 +209,7 @@ qboolean SCR_PlayCinematic( const char *arg )
|
|||||||
|
|
||||||
if( FS_FileExists( arg, false ) && !fullpath )
|
if( FS_FileExists( arg, false ) && !fullpath )
|
||||||
{
|
{
|
||||||
Con_Printf( S_ERROR "Couldn't load %s from packfile. Please extract it\n", path );
|
Con_Printf( S_ERROR "Couldn't load %s from packfile. Please extract it\n", arg );
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -35,30 +35,39 @@ void V_CalcViewRect( void )
|
|||||||
int sb_lines;
|
int sb_lines;
|
||||||
float size;
|
float size;
|
||||||
|
|
||||||
// intermission is always full screen
|
if( FBitSet( host.features, ENGINE_QUAKE_COMPATIBLE ))
|
||||||
if( cl.intermission ) size = 120.0f;
|
{
|
||||||
else size = scr_viewsize->value;
|
// intermission is always full screen
|
||||||
|
if( cl.intermission ) size = 120.0f;
|
||||||
|
else size = scr_viewsize->value;
|
||||||
|
|
||||||
if( size >= 120.0f )
|
if( size >= 120.0f )
|
||||||
sb_lines = 0; // no status bar at all
|
sb_lines = 0; // no status bar at all
|
||||||
else if( size >= 110.0f )
|
else if( size >= 110.0f )
|
||||||
sb_lines = 24; // no inventory
|
sb_lines = 24; // no inventory
|
||||||
else sb_lines = 48;
|
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;
|
full = true;
|
||||||
size = 100.0f;
|
|
||||||
}
|
|
||||||
else size = scr_viewsize->value;
|
|
||||||
|
|
||||||
if( cl.intermission )
|
|
||||||
{
|
|
||||||
size = 100.0f;
|
|
||||||
sb_lines = 0;
|
sb_lines = 0;
|
||||||
full = true;
|
size = 1.0f;
|
||||||
}
|
}
|
||||||
size /= 100.0f;
|
|
||||||
|
|
||||||
clgame.viewport[2] = refState.width * size;
|
clgame.viewport[2] = refState.width * size;
|
||||||
clgame.viewport[3] = refState.height * size;
|
clgame.viewport[3] = refState.height * size;
|
||||||
@@ -220,6 +229,53 @@ void V_RefApplyOverview( ref_viewpass_t *rvp )
|
|||||||
ref.dllFuncs.GL_OrthoBounds( mins, maxs );
|
ref.dllFuncs.GL_OrthoBounds( mins, maxs );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
====================
|
||||||
|
V_CalcFov
|
||||||
|
====================
|
||||||
|
*/
|
||||||
|
static float V_CalcFov( float *fov_x, float width, float height )
|
||||||
|
{
|
||||||
|
float x, half_fov_y;
|
||||||
|
|
||||||
|
if( *fov_x < 1.0f || *fov_x > 179.0f )
|
||||||
|
*fov_x = 90.0f; // default value
|
||||||
|
|
||||||
|
x = width / tan( DEG2RAD( *fov_x ) * 0.5f );
|
||||||
|
half_fov_y = atan( height / x );
|
||||||
|
|
||||||
|
return RAD2DEG( half_fov_y ) * 2;
|
||||||
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
====================
|
||||||
|
V_AdjustFov
|
||||||
|
====================
|
||||||
|
*/
|
||||||
|
static void V_AdjustFov( float *fov_x, float *fov_y, float width, float height, qboolean lock_x )
|
||||||
|
{
|
||||||
|
float x, y;
|
||||||
|
|
||||||
|
if( width * 3 == 4 * height || width * 4 == height * 5 )
|
||||||
|
{
|
||||||
|
// 4:3 or 5:4 ratio
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
if( lock_x )
|
||||||
|
{
|
||||||
|
*fov_y = 2 * atan((width * 3) / (height * 4) * tan( *fov_y * M_PI_F / 360.0f * 0.5f )) * 360 / M_PI_F;
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
y = V_CalcFov( fov_x, 640, 480 );
|
||||||
|
x = *fov_x;
|
||||||
|
|
||||||
|
*fov_x = V_CalcFov( &y, height, width );
|
||||||
|
if( *fov_x < x ) *fov_x = x;
|
||||||
|
else *fov_y = y;
|
||||||
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
=============
|
=============
|
||||||
V_GetRefParams
|
V_GetRefParams
|
||||||
@@ -277,9 +333,6 @@ qboolean V_PreRender( void )
|
|||||||
if( !ref.initialized )
|
if( !ref.initialized )
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
if( host.status == HOST_NOFOCUS )
|
|
||||||
return false;
|
|
||||||
|
|
||||||
if( host.status == HOST_SLEEP )
|
if( host.status == HOST_SLEEP )
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
@@ -475,6 +528,7 @@ void V_PostRender( void )
|
|||||||
{
|
{
|
||||||
SCR_RSpeeds();
|
SCR_RSpeeds();
|
||||||
SCR_NetSpeeds();
|
SCR_NetSpeeds();
|
||||||
|
SCR_DrawPos();
|
||||||
SCR_DrawNetGraph();
|
SCR_DrawNetGraph();
|
||||||
SV_DrawOrthoTriangles();
|
SV_DrawOrthoTriangles();
|
||||||
CL_DrawDemoRecording();
|
CL_DrawDemoRecording();
|
||||||
|
|||||||
@@ -17,7 +17,7 @@ GNU General Public License for more details.
|
|||||||
#define CLIENT_H
|
#define CLIENT_H
|
||||||
|
|
||||||
#include "xash3d_types.h"
|
#include "xash3d_types.h"
|
||||||
#include "mathlib.h"
|
#include "xash3d_mathlib.h"
|
||||||
#include "cdll_int.h"
|
#include "cdll_int.h"
|
||||||
#include "menu_int.h"
|
#include "menu_int.h"
|
||||||
#include "cl_entity.h"
|
#include "cl_entity.h"
|
||||||
@@ -33,6 +33,7 @@ GNU General Public License for more details.
|
|||||||
#include "net_api.h"
|
#include "net_api.h"
|
||||||
#include "world.h"
|
#include "world.h"
|
||||||
#include "ref_common.h"
|
#include "ref_common.h"
|
||||||
|
#include "voice.h"
|
||||||
|
|
||||||
// client sprite types
|
// client sprite types
|
||||||
#define SPR_CLIENT 0 // client sprite for temp-entities or user-textures
|
#define SPR_CLIENT 0 // client sprite for temp-entities or user-textures
|
||||||
@@ -107,8 +108,7 @@ extern int CL_UPDATE_BACKUP;
|
|||||||
#define MIN_UPDATERATE 10.0f
|
#define MIN_UPDATERATE 10.0f
|
||||||
#define MAX_UPDATERATE 102.0f
|
#define MAX_UPDATERATE 102.0f
|
||||||
|
|
||||||
#define MIN_EX_INTERP 50.0f
|
#define MAX_EX_INTERP 0.1f
|
||||||
#define MAX_EX_INTERP 100.0f
|
|
||||||
|
|
||||||
#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_MAX_RESEND_TIME 20.0f // max time. The cvar cl_resend is bounded by these.
|
||||||
@@ -138,7 +138,7 @@ typedef struct
|
|||||||
int light_level;
|
int light_level;
|
||||||
int waterlevel;
|
int waterlevel;
|
||||||
int usehull;
|
int usehull;
|
||||||
int moving;
|
qboolean moving;
|
||||||
int pushmsec;
|
int pushmsec;
|
||||||
int weapons;
|
int weapons;
|
||||||
float maxspeed;
|
float maxspeed;
|
||||||
@@ -210,7 +210,7 @@ typedef struct
|
|||||||
// a lerp point for other data
|
// a lerp point for other data
|
||||||
double oldtime; // previous cl.time, time-oldtime is used
|
double oldtime; // previous cl.time, time-oldtime is used
|
||||||
// to decay light values and smooth step ups
|
// to decay light values and smooth step ups
|
||||||
float timedelta; // floating delta between two updates
|
double timedelta; // floating delta between two updates
|
||||||
|
|
||||||
char serverinfo[MAX_SERVERINFO_STRING];
|
char serverinfo[MAX_SERVERINFO_STRING];
|
||||||
player_info_t players[MAX_CLIENTS]; // collected info about all other players include himself
|
player_info_t players[MAX_CLIENTS]; // collected info about all other players include himself
|
||||||
@@ -318,32 +318,46 @@ typedef struct
|
|||||||
pfnEventHook func; // user-defined function
|
pfnEventHook func; // user-defined function
|
||||||
} cl_user_event_t;
|
} cl_user_event_t;
|
||||||
|
|
||||||
#define FONT_FIXED 0
|
#define FONT_FIXED 0
|
||||||
#define FONT_VARIABLE 1
|
#define FONT_VARIABLE 1
|
||||||
|
|
||||||
|
#define FONT_DRAW_HUD BIT( 0 ) // pass to drawing function to apply hud_scale
|
||||||
|
#define FONT_DRAW_UTF8 BIT( 1 ) // call UtfProcessChar
|
||||||
|
#define FONT_DRAW_FORCECOL BIT( 2 ) // ignore colorcodes
|
||||||
|
#define FONT_DRAW_NORENDERMODE BIT( 3 ) // ignore font's default rendermode
|
||||||
|
#define FONT_DRAW_NOLF BIT( 4 ) // ignore \n
|
||||||
|
#define FONT_DRAW_RESETCOLORONLF BIT( 5 ) // yet another flag to simulate consecutive Con_DrawString calls...
|
||||||
|
|
||||||
typedef struct
|
typedef struct
|
||||||
{
|
{
|
||||||
int hFontTexture; // handle to texture
|
int hFontTexture; // handle to texture
|
||||||
wrect_t fontRc[256]; // rectangles
|
wrect_t fontRc[256]; // tex coords
|
||||||
byte charWidths[256];
|
float scale; // scale factor
|
||||||
int charHeight;
|
byte charWidths[256]; // scaled widths
|
||||||
int type;
|
int charHeight; // scaled height
|
||||||
qboolean valid; // all rectangles are valid
|
int type; // fixed width font or variable
|
||||||
|
int rendermode; // default rendermode
|
||||||
|
qboolean nearest; // nearest filtering enabled
|
||||||
|
qboolean valid; // all rectangles are valid
|
||||||
} cl_font_t;
|
} cl_font_t;
|
||||||
|
|
||||||
|
typedef struct scissor_state_s
|
||||||
|
{
|
||||||
|
int x;
|
||||||
|
int y;
|
||||||
|
int width;
|
||||||
|
int height;
|
||||||
|
qboolean test;
|
||||||
|
} scissor_state_t;
|
||||||
|
|
||||||
typedef struct
|
typedef struct
|
||||||
{
|
{
|
||||||
|
// scissor test
|
||||||
|
scissor_state_t scissor;
|
||||||
|
|
||||||
// temp handle
|
// temp handle
|
||||||
const model_t *pSprite; // pointer to current SpriteTexture
|
const model_t *pSprite; // pointer to current SpriteTexture
|
||||||
|
|
||||||
// scissor test
|
|
||||||
int scissor_x;
|
|
||||||
int scissor_y;
|
|
||||||
int scissor_width;
|
|
||||||
int scissor_height;
|
|
||||||
qboolean scissor_test;
|
|
||||||
qboolean adjust_size; // allow to adjust scale for fonts
|
|
||||||
|
|
||||||
int renderMode; // override kRenderMode from TriAPI
|
int renderMode; // override kRenderMode from TriAPI
|
||||||
TRICULLSTYLE cullMode; // override CULL FACE from TriAPI
|
TRICULLSTYLE cullMode; // override CULL FACE from TriAPI
|
||||||
|
|
||||||
@@ -370,14 +384,10 @@ typedef struct cl_predicted_player_s
|
|||||||
|
|
||||||
typedef struct
|
typedef struct
|
||||||
{
|
{
|
||||||
int gl_texturenum; // this is a real texnum
|
|
||||||
|
|
||||||
// scissor test
|
// scissor test
|
||||||
int scissor_x;
|
scissor_state_t scissor;
|
||||||
int scissor_y;
|
|
||||||
int scissor_width;
|
int gl_texturenum; // this is a real texnum
|
||||||
int scissor_height;
|
|
||||||
qboolean scissor_test;
|
|
||||||
|
|
||||||
// holds text color
|
// holds text color
|
||||||
rgba_t textColor;
|
rgba_t textColor;
|
||||||
@@ -437,7 +447,7 @@ typedef struct
|
|||||||
void *hInstance; // pointer to client.dll
|
void *hInstance; // pointer to client.dll
|
||||||
cldll_func_t dllFuncs; // dll exported funcs
|
cldll_func_t dllFuncs; // dll exported funcs
|
||||||
render_interface_t drawFuncs; // custom renderer support
|
render_interface_t drawFuncs; // custom renderer support
|
||||||
byte *mempool; // client edicts pool
|
poolhandle_t mempool; // client edicts pool
|
||||||
string mapname; // map name
|
string mapname; // map name
|
||||||
string maptitle; // display map title
|
string maptitle; // display map title
|
||||||
string itemspath; // path to items description for auto-complete func
|
string itemspath; // path to items description for auto-complete func
|
||||||
@@ -465,7 +475,7 @@ typedef struct
|
|||||||
|
|
||||||
string cdtracks[MAX_CDTRACKS]; // 32 cd-tracks read from cdaudio.txt
|
string cdtracks[MAX_CDTRACKS]; // 32 cd-tracks read from cdaudio.txt
|
||||||
|
|
||||||
model_t sprites[MAX_CLIENT_SPRITES]; // client spritetextures
|
model_t sprites[MAX_CLIENT_SPRITES]; // hud&client spritetexturesz
|
||||||
int viewport[4]; // viewport sizes
|
int viewport[4]; // viewport sizes
|
||||||
|
|
||||||
client_draw_t ds; // draw2d stuff (hud, weaponmenu etc)
|
client_draw_t ds; // draw2d stuff (hud, weaponmenu etc)
|
||||||
@@ -496,7 +506,7 @@ typedef struct
|
|||||||
void *hInstance; // pointer to client.dll
|
void *hInstance; // pointer to client.dll
|
||||||
UI_FUNCTIONS dllFuncs; // dll exported funcs
|
UI_FUNCTIONS dllFuncs; // dll exported funcs
|
||||||
UI_EXTENDED_FUNCTIONS dllFuncs2; // fwgs extension
|
UI_EXTENDED_FUNCTIONS dllFuncs2; // fwgs extension
|
||||||
byte *mempool; // client edicts pool
|
poolhandle_t mempool; // client edicts pool
|
||||||
|
|
||||||
cl_entity_t playermodel; // uiPlayerSetup drawing model
|
cl_entity_t playermodel; // uiPlayerSetup drawing model
|
||||||
player_info_t playerinfo; // local playerinfo
|
player_info_t playerinfo; // local playerinfo
|
||||||
@@ -527,14 +537,11 @@ typedef struct
|
|||||||
float disable_screen; // showing loading plaque between levels
|
float disable_screen; // showing loading plaque between levels
|
||||||
// or changing rendering dlls
|
// or changing rendering dlls
|
||||||
// if time gets > 30 seconds ahead, break it
|
// if time gets > 30 seconds ahead, break it
|
||||||
int disable_servercount; // when we receive a frame and cl.servercount
|
|
||||||
// > cls.disable_servercount, clear disable_screen
|
|
||||||
|
|
||||||
qboolean draw_changelevel; // draw changelevel image 'Loading...'
|
qboolean draw_changelevel; // draw changelevel image 'Loading...'
|
||||||
|
|
||||||
keydest_t key_dest;
|
keydest_t key_dest;
|
||||||
|
|
||||||
byte *mempool; // client premamnent pool: edicts etc
|
poolhandle_t mempool; // client premamnent pool: edicts etc
|
||||||
|
|
||||||
netadr_t hltv_listen_address;
|
netadr_t hltv_listen_address;
|
||||||
|
|
||||||
@@ -625,8 +632,6 @@ typedef struct
|
|||||||
// legacy mode support
|
// legacy mode support
|
||||||
qboolean legacymode; // one-way 48 protocol compatibility
|
qboolean legacymode; // one-way 48 protocol compatibility
|
||||||
netadr_t legacyserver;
|
netadr_t legacyserver;
|
||||||
netadr_t legacyservers[MAX_LEGACY_SERVERS];
|
|
||||||
int legacyservercount;
|
|
||||||
int extensions;
|
int extensions;
|
||||||
|
|
||||||
netadr_t serveradr;
|
netadr_t serveradr;
|
||||||
@@ -655,11 +660,10 @@ extern convar_t cl_allow_download;
|
|||||||
extern convar_t cl_allow_upload;
|
extern convar_t cl_allow_upload;
|
||||||
extern convar_t cl_download_ingame;
|
extern convar_t cl_download_ingame;
|
||||||
extern convar_t *cl_nopred;
|
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_timeout;
|
||||||
extern convar_t *cl_nodelta;
|
extern convar_t *cl_nodelta;
|
||||||
extern convar_t *cl_interp;
|
extern convar_t *cl_interp;
|
||||||
|
extern convar_t *cl_nointerp;
|
||||||
extern convar_t *cl_showerror;
|
extern convar_t *cl_showerror;
|
||||||
extern convar_t *cl_nosmooth;
|
extern convar_t *cl_nosmooth;
|
||||||
extern convar_t *cl_smoothtime;
|
extern convar_t *cl_smoothtime;
|
||||||
@@ -677,10 +681,10 @@ extern convar_t *cl_levelshot_name;
|
|||||||
extern convar_t *cl_draw_beams;
|
extern convar_t *cl_draw_beams;
|
||||||
extern convar_t *cl_clockreset;
|
extern convar_t *cl_clockreset;
|
||||||
extern convar_t *cl_fixtimerate;
|
extern convar_t *cl_fixtimerate;
|
||||||
|
extern convar_t *hud_fontscale;
|
||||||
extern convar_t *hud_scale;
|
extern convar_t *hud_scale;
|
||||||
extern convar_t *gl_showtextures;
|
extern convar_t *gl_showtextures;
|
||||||
extern convar_t *cl_bmodelinterp;
|
extern convar_t *cl_bmodelinterp;
|
||||||
extern convar_t *cl_righthand;
|
|
||||||
extern convar_t *cl_lw; // local weapons
|
extern convar_t *cl_lw; // local weapons
|
||||||
extern convar_t *cl_charset;
|
extern convar_t *cl_charset;
|
||||||
extern convar_t *cl_trace_messages;
|
extern convar_t *cl_trace_messages;
|
||||||
@@ -719,6 +723,7 @@ void CL_SaveShot_f( void );
|
|||||||
void CL_LevelShot_f( void );
|
void CL_LevelShot_f( void );
|
||||||
void CL_SetSky_f( void );
|
void CL_SetSky_f( void );
|
||||||
void SCR_Viewpos_f( void );
|
void SCR_Viewpos_f( void );
|
||||||
|
void CL_WavePlayLen_f( void );
|
||||||
|
|
||||||
//
|
//
|
||||||
// cl_custom.c
|
// cl_custom.c
|
||||||
@@ -759,6 +764,7 @@ int CL_IsDevOverviewMode( void );
|
|||||||
void CL_PingServers_f( void );
|
void CL_PingServers_f( void );
|
||||||
void CL_SignonReply( void );
|
void CL_SignonReply( void );
|
||||||
void CL_ClearState( void );
|
void CL_ClearState( void );
|
||||||
|
size_t CL_BuildMasterServerScanRequest( char *buf, size_t size, qboolean nat );
|
||||||
|
|
||||||
//
|
//
|
||||||
// cl_demo.c
|
// cl_demo.c
|
||||||
@@ -800,6 +806,20 @@ void CL_ResetEvent( event_info_t *ei );
|
|||||||
word CL_EventIndex( const char *name );
|
word CL_EventIndex( const char *name );
|
||||||
void CL_FireEvents( void );
|
void CL_FireEvents( void );
|
||||||
|
|
||||||
|
//
|
||||||
|
// cl_font.c
|
||||||
|
//
|
||||||
|
qboolean CL_FixedFont( cl_font_t *font );
|
||||||
|
qboolean Con_LoadFixedWidthFont( const char *fontname, cl_font_t *font, float scale, int rendermode, uint texFlags );
|
||||||
|
qboolean Con_LoadVariableWidthFont( const char *fontname, cl_font_t *font, float scale, int rendermode, uint texFlags );
|
||||||
|
void CL_FreeFont( cl_font_t *font );
|
||||||
|
int CL_DrawCharacter( float x, float y, int number, rgba_t color, cl_font_t *font, int flags );
|
||||||
|
int CL_DrawString( float x, float y, const char *s, rgba_t color, cl_font_t *font, int flags );
|
||||||
|
void CL_DrawCharacterLen( cl_font_t *font, int number, int *width, int *height );
|
||||||
|
void CL_DrawStringLen( cl_font_t *font, const char *s, int *width, int *height, int flags );
|
||||||
|
int CL_DrawStringf( cl_font_t *font, float x, float y, rgba_t color, int flags, const char *fmt, ... ) _format( 6 );
|
||||||
|
|
||||||
|
|
||||||
//
|
//
|
||||||
// cl_game.c
|
// cl_game.c
|
||||||
//
|
//
|
||||||
@@ -815,7 +835,6 @@ void CL_FreeEdicts( void );
|
|||||||
void CL_ClearWorld( void );
|
void CL_ClearWorld( void );
|
||||||
void CL_DrawCenterPrint( void );
|
void CL_DrawCenterPrint( void );
|
||||||
void CL_ClearSpriteTextures( void );
|
void CL_ClearSpriteTextures( void );
|
||||||
void CL_FreeEntity( cl_entity_t *pEdict );
|
|
||||||
void CL_CenterPrint( const char *text, float y );
|
void CL_CenterPrint( const char *text, float y );
|
||||||
void CL_TextMessageParse( byte *pMemFile, int fileSize );
|
void CL_TextMessageParse( byte *pMemFile, int fileSize );
|
||||||
client_textmessage_t *CL_TextMessageGet( const char *pName );
|
client_textmessage_t *CL_TextMessageGet( const char *pName );
|
||||||
@@ -827,13 +846,17 @@ int CL_FindModelIndex( const char *m );
|
|||||||
cl_entity_t *CL_GetLocalPlayer( void );
|
cl_entity_t *CL_GetLocalPlayer( void );
|
||||||
model_t *CL_LoadClientSprite( const char *filename );
|
model_t *CL_LoadClientSprite( const char *filename );
|
||||||
model_t *CL_LoadModel( const char *modelname, int *index );
|
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 );
|
HSPRITE pfnSPR_LoadExt( const char *szPicName, uint texFlags );
|
||||||
void PicAdjustSize( float *x, float *y, float *w, float *h );
|
void SPR_AdjustSize( float *x, float *y, float *w, float *h );
|
||||||
|
void SPR_AdjustTexCoords( float width, float height, float *s1, float *t1, float *s2, float *t2 );
|
||||||
int CL_GetScreenInfo( SCREENINFO *pscrinfo );
|
int CL_GetScreenInfo( SCREENINFO *pscrinfo );
|
||||||
void CL_FillRGBA( int x, int y, int width, int height, int r, int g, int b, int a );
|
void CL_FillRGBA( int x, int y, int width, int height, int r, int g, int b, int a );
|
||||||
void CL_PlayerTrace( float *start, float *end, int traceFlags, int ignore_pe, pmtrace_t *tr );
|
void CL_PlayerTrace( float *start, float *end, int traceFlags, int ignore_pe, pmtrace_t *tr );
|
||||||
void CL_PlayerTraceExt( float *start, float *end, int traceFlags, int (*pfnIgnore)( physent_t *pe ), pmtrace_t *tr );
|
void CL_PlayerTraceExt( float *start, float *end, int traceFlags, int (*pfnIgnore)( physent_t *pe ), pmtrace_t *tr );
|
||||||
|
pmtrace_t *PM_CL_TraceLine( float *start, float *end, int flags, int usehull, int ignore_pe );
|
||||||
|
const char *PM_CL_TraceTexture( int ground, float *vstart, float *vend );
|
||||||
|
int PM_CL_PointContents( const float *p, int *truecontents );
|
||||||
void CL_SetTraceHull( int hull );
|
void CL_SetTraceHull( int hull );
|
||||||
void CL_GetMousePosition( int *mx, int *my ); // TODO: move to input
|
void CL_GetMousePosition( int *mx, int *my ); // TODO: move to input
|
||||||
cl_entity_t* CL_GetViewModel( void );
|
cl_entity_t* CL_GetViewModel( void );
|
||||||
@@ -841,9 +864,18 @@ void pfnGetScreenFade( struct screenfade_s *fade );
|
|||||||
physent_t *pfnGetPhysent( int idx );
|
physent_t *pfnGetPhysent( int idx );
|
||||||
struct msurface_s *pfnTraceSurface( int ground, float *vstart, float *vend );
|
struct msurface_s *pfnTraceSurface( int ground, float *vstart, float *vend );
|
||||||
movevars_t *pfnGetMoveVars( void );
|
movevars_t *pfnGetMoveVars( void );
|
||||||
|
void CL_EnableScissor( scissor_state_t *scissor, int x, int y, int width, int height );
|
||||||
|
void CL_DisableScissor( scissor_state_t *scissor );
|
||||||
|
qboolean CL_Scissor( const scissor_state_t *scissor, float *x, float *y, float *width, float *height, float *u0, float *v0, float *u1, float *v1 );
|
||||||
|
|
||||||
_inline cl_entity_t *CL_EDICT_NUM( int n )
|
_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 ))
|
if(( n >= 0 ) && ( n < clgame.maxEntities ))
|
||||||
return clgame.entities + n;
|
return clgame.entities + n;
|
||||||
|
|
||||||
@@ -859,7 +891,6 @@ void CL_ParseLegacyServerMessage( sizebuf_t *msg, qboolean normal_message );
|
|||||||
void CL_LegacyPrecache_f( void );
|
void CL_LegacyPrecache_f( void );
|
||||||
|
|
||||||
void CL_ParseTempEntity( sizebuf_t *msg );
|
void CL_ParseTempEntity( sizebuf_t *msg );
|
||||||
void CL_StartResourceDownloading( const char *pszMessage, qboolean bCustom );
|
|
||||||
qboolean CL_DispatchUserMessage( const char *pszName, int iSize, void *pbuf );
|
qboolean CL_DispatchUserMessage( const char *pszName, int iSize, void *pbuf );
|
||||||
qboolean CL_RequestMissingResources( void );
|
qboolean CL_RequestMissingResources( void );
|
||||||
void CL_RegisterResources ( sizebuf_t *msg );
|
void CL_RegisterResources ( sizebuf_t *msg );
|
||||||
@@ -882,6 +913,7 @@ void SCR_MakeLevelShot( void );
|
|||||||
void SCR_NetSpeeds( void );
|
void SCR_NetSpeeds( void );
|
||||||
void SCR_RSpeeds( void );
|
void SCR_RSpeeds( void );
|
||||||
void SCR_DrawFPS( int height );
|
void SCR_DrawFPS( int height );
|
||||||
|
void SCR_DrawPos( void );
|
||||||
|
|
||||||
//
|
//
|
||||||
// cl_netgraph.c
|
// cl_netgraph.c
|
||||||
@@ -909,10 +941,8 @@ void CL_PredictMovement( qboolean repredicting );
|
|||||||
void CL_CheckPredictionError( void );
|
void CL_CheckPredictionError( void );
|
||||||
qboolean CL_IsPredicted( void );
|
qboolean CL_IsPredicted( void );
|
||||||
int CL_TruePointContents( const vec3_t p );
|
int CL_TruePointContents( const vec3_t p );
|
||||||
int CL_PointContents( const vec3_t p );
|
|
||||||
int CL_WaterEntity( const float *rgflPos );
|
int CL_WaterEntity( const float *rgflPos );
|
||||||
cl_entity_t *CL_GetWaterEntity( const float *rgflPos );
|
cl_entity_t *CL_GetWaterEntity( const float *rgflPos );
|
||||||
void CL_SetupPMove( playermove_t *pmove, local_state_t *from, usercmd_t *ucmd, qboolean runfuncs, double time );
|
|
||||||
int CL_TestLine( const vec3_t start, const vec3_t end, int flags );
|
int CL_TestLine( const vec3_t start, const vec3_t end, int flags );
|
||||||
pmtrace_t *CL_VisTraceLine( vec3_t start, vec3_t end, int flags );
|
pmtrace_t *CL_VisTraceLine( vec3_t start, vec3_t end, int flags );
|
||||||
pmtrace_t CL_TraceLine( vec3_t start, vec3_t end, int flags );
|
pmtrace_t CL_TraceLine( vec3_t start, vec3_t end, int flags );
|
||||||
@@ -921,7 +951,6 @@ void CL_PopTraceBounds( void );
|
|||||||
void CL_MoveSpectatorCamera( void );
|
void CL_MoveSpectatorCamera( void );
|
||||||
void CL_SetLastUpdate( void );
|
void CL_SetLastUpdate( void );
|
||||||
void CL_RedoPrediction( void );
|
void CL_RedoPrediction( void );
|
||||||
void CL_ClearPhysEnts( void );
|
|
||||||
void CL_PushPMStates( void );
|
void CL_PushPMStates( void );
|
||||||
void CL_PopPMStates( void );
|
void CL_PopPMStates( void );
|
||||||
void CL_SetUpPlayerPrediction( int dopred, int bIncludeLocalClient );
|
void CL_SetUpPlayerPrediction( int dopred, int bIncludeLocalClient );
|
||||||
@@ -953,16 +982,16 @@ void CL_EmitEntities( void );
|
|||||||
// cl_remap.c
|
// cl_remap.c
|
||||||
//
|
//
|
||||||
remap_info_t *CL_GetRemapInfoForEntity( cl_entity_t *e );
|
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_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 );
|
void CL_ClearAllRemaps( void );
|
||||||
|
|
||||||
//
|
//
|
||||||
// cl_render.c
|
// cl_render.c
|
||||||
//
|
//
|
||||||
qboolean R_InitRenderAPI( void );
|
qboolean R_InitRenderAPI( void );
|
||||||
int CL_RenderGetParm( const int parm, const int arg, const qboolean checkRef );
|
intptr_t CL_RenderGetParm( const int parm, const int arg, const qboolean checkRef );
|
||||||
lightstyle_t *CL_GetLightStyle( int number );
|
lightstyle_t *CL_GetLightStyle( int number );
|
||||||
int R_FatPVS( const vec3_t org, float radius, byte *visbuffer, qboolean merge, qboolean fullvis );
|
int R_FatPVS( const vec3_t org, float radius, byte *visbuffer, qboolean merge, qboolean fullvis );
|
||||||
const ref_overview_t *GL_GetOverviewParms( void );
|
const ref_overview_t *GL_GetOverviewParms( void );
|
||||||
@@ -972,7 +1001,6 @@ const ref_overview_t *GL_GetOverviewParms( void );
|
|||||||
//
|
//
|
||||||
void R_StoreEfrags( efrag_t **ppefrag, int framecount );
|
void R_StoreEfrags( efrag_t **ppefrag, int framecount );
|
||||||
void R_AddEfrags( cl_entity_t *ent );
|
void R_AddEfrags( cl_entity_t *ent );
|
||||||
void R_RemoveEfrags( cl_entity_t *ent );
|
|
||||||
//
|
//
|
||||||
// cl_tent.c
|
// cl_tent.c
|
||||||
//
|
//
|
||||||
@@ -1026,13 +1054,13 @@ int Con_UtfProcessChar( int in );
|
|||||||
int Con_UtfProcessCharForce( int in );
|
int Con_UtfProcessCharForce( int in );
|
||||||
int Con_UtfMoveLeft( char *str, int pos );
|
int Con_UtfMoveLeft( char *str, int pos );
|
||||||
int Con_UtfMoveRight( char *str, int pos, int length );
|
int Con_UtfMoveRight( char *str, int pos, int length );
|
||||||
void Con_DrawStringLen( const char *pText, int *length, int *height );
|
|
||||||
int Con_DrawString( int x, int y, const char *string, rgba_t setColor );
|
|
||||||
int Con_DrawCharacter( int x, int y, int number, rgba_t color );
|
|
||||||
void Con_DrawCharacterLen( int number, int *width, int *height );
|
|
||||||
void Con_DefaultColor( int r, int g, int b );
|
void Con_DefaultColor( int r, int g, int b );
|
||||||
void Con_InvalidateFonts( void );
|
void Con_InvalidateFonts( void );
|
||||||
void Con_SetFont( int fontNum );
|
cl_font_t *Con_GetCurFont( void );
|
||||||
|
cl_font_t *Con_GetFont( int num );
|
||||||
|
void Con_DrawCharacterLen( int number, int *width, int *height );
|
||||||
|
int Con_DrawString( int x, int y, const char *string, rgba_t setColor ); // legacy, use cl_font.c
|
||||||
|
void GAME_EXPORT Con_DrawStringLen( const char *pText, int *length, int *height ); // legacy, use cl_font.c
|
||||||
void Con_CharEvent( int key );
|
void Con_CharEvent( int key );
|
||||||
void Con_RestoreFont( void );
|
void Con_RestoreFont( void );
|
||||||
void Key_Console( int key );
|
void Key_Console( int key );
|
||||||
@@ -1042,7 +1070,6 @@ void Con_Bottom( void );
|
|||||||
void Con_Top( void );
|
void Con_Top( void );
|
||||||
void Con_PageDown( int lines );
|
void Con_PageDown( int lines );
|
||||||
void Con_PageUp( int lines );
|
void Con_PageUp( int lines );
|
||||||
void Con_LoadHistory( void );
|
|
||||||
|
|
||||||
//
|
//
|
||||||
// s_main.c
|
// s_main.c
|
||||||
@@ -1106,6 +1133,11 @@ void pfnPIC_DrawAdditive( int x, int y, int width, int height, const wrect_t *pr
|
|||||||
qboolean Mobile_Init( void );
|
qboolean Mobile_Init( void );
|
||||||
void Mobile_Shutdown( void );
|
void Mobile_Shutdown( void );
|
||||||
|
|
||||||
|
//
|
||||||
|
// cl_securedstub.c
|
||||||
|
//
|
||||||
|
void CL_GetSecuredClientAPI( CL_EXPORT_FUNCS F );
|
||||||
|
|
||||||
//
|
//
|
||||||
// cl_video.c
|
// cl_video.c
|
||||||
//
|
//
|
||||||
@@ -1123,7 +1155,6 @@ void CL_PlayVideo_f( void );
|
|||||||
// keys.c
|
// keys.c
|
||||||
//
|
//
|
||||||
int Key_IsDown( int keynum );
|
int Key_IsDown( int keynum );
|
||||||
const char *Key_IsBind( int keynum );
|
|
||||||
void Key_Event( int key, int down );
|
void Key_Event( int key, int down );
|
||||||
void Key_Init( void );
|
void Key_Init( void );
|
||||||
void Key_WriteBindings( file_t *f );
|
void Key_WriteBindings( file_t *f );
|
||||||
|
|||||||
File diff suppressed because it is too large
Load Diff
@@ -24,17 +24,6 @@ GNU General Public License for more details.
|
|||||||
#define SHRT_MAX 0x7FFF
|
#define SHRT_MAX 0x7FFF
|
||||||
#endif
|
#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
|
#define MAX_AXES JOY_AXIS_NULL
|
||||||
|
|
||||||
// index - axis num come from event
|
// index - axis num come from event
|
||||||
@@ -55,6 +44,7 @@ static struct joy_axis_s
|
|||||||
short prevval;
|
short prevval;
|
||||||
} joyaxis[MAX_AXES] = { 0 };
|
} joyaxis[MAX_AXES] = { 0 };
|
||||||
static byte currentbinding; // add posibility to remap keys, to place it in joykeys[]
|
static byte currentbinding; // add posibility to remap keys, to place it in joykeys[]
|
||||||
|
static qboolean joy_initialized;
|
||||||
convar_t *joy_enable;
|
convar_t *joy_enable;
|
||||||
static convar_t *joy_pitch;
|
static convar_t *joy_pitch;
|
||||||
static convar_t *joy_yaw;
|
static convar_t *joy_yaw;
|
||||||
@@ -246,8 +236,6 @@ Axis events
|
|||||||
*/
|
*/
|
||||||
void Joy_AxisMotionEvent( byte axis, short value )
|
void Joy_AxisMotionEvent( byte axis, short value )
|
||||||
{
|
{
|
||||||
byte engineAxis;
|
|
||||||
|
|
||||||
if( !joy_found->value )
|
if( !joy_found->value )
|
||||||
return;
|
return;
|
||||||
|
|
||||||
@@ -257,8 +245,11 @@ void Joy_AxisMotionEvent( byte axis, short value )
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
engineAxis = joyaxesmap[axis]; // convert to engine inner axis control
|
Joy_KnownAxisMotionEvent( joyaxesmap[axis], value );
|
||||||
|
}
|
||||||
|
|
||||||
|
void Joy_KnownAxisMotionEvent( engineAxis_t engineAxis, short value )
|
||||||
|
{
|
||||||
if( engineAxis == JOY_AXIS_NULL )
|
if( engineAxis == JOY_AXIS_NULL )
|
||||||
return;
|
return;
|
||||||
|
|
||||||
@@ -390,40 +381,44 @@ Main init procedure
|
|||||||
*/
|
*/
|
||||||
void Joy_Init( void )
|
void Joy_Init( void )
|
||||||
{
|
{
|
||||||
joy_pitch = Cvar_Get( "joy_pitch", "100.0", FCVAR_ARCHIVE, "joystick pitch sensitivity" );
|
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, "joystick yaw 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, "joystick side sensitivity. Values from -1.0 to 1.0" );
|
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, "joystick forward 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_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, "right trigger threshold. Value from -32768 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
|
// 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_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, "forward 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
|
// 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_side_deadzone = Cvar_Get( "joy_side_deadzone", DEFAULT_JOY_DEADZONE, FCVAR_ARCHIVE | FCVAR_FILTERABLE, "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_forward_deadzone = Cvar_Get( "joy_forward_deadzone", DEFAULT_JOY_DEADZONE, FCVAR_ARCHIVE | FCVAR_FILTERABLE, "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_pitch_deadzone = Cvar_Get( "joy_pitch_deadzone", DEFAULT_JOY_DEADZONE, FCVAR_ARCHIVE | FCVAR_FILTERABLE, "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_yaw_deadzone = Cvar_Get( "joy_yaw_deadzone", DEFAULT_JOY_DEADZONE, 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" );
|
"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" );
|
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.
|
// we doesn't loaded config.cfg yet, so this cvar is not archive.
|
||||||
// change by +set joy_index in cmdline
|
// change by +set joy_index in cmdline
|
||||||
joy_index = Cvar_Get( "joy_index", "0", FCVAR_READ_ONLY, "current active joystick" );
|
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" ))
|
// renamed from -nojoy to -noenginejoy to not conflict with
|
||||||
|
// client.dll's joystick support
|
||||||
|
if( Sys_CheckParm( "-noenginejoy" ))
|
||||||
{
|
{
|
||||||
Cvar_FullSet( "joy_enable", "0", FCVAR_READ_ONLY );
|
Cvar_FullSet( "joy_enable", "0", FCVAR_READ_ONLY );
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
Cvar_FullSet( "joy_found", va( "%d", Platform_JoyInit( joy_index->value )), FCVAR_READ_ONLY );
|
Cvar_FullSet( "joy_found", va( "%d", Platform_JoyInit( joy_index->value )), FCVAR_READ_ONLY );
|
||||||
|
|
||||||
|
joy_initialized = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
@@ -435,5 +430,8 @@ Shutdown joystick code
|
|||||||
*/
|
*/
|
||||||
void Joy_Shutdown( void )
|
void Joy_Shutdown( void )
|
||||||
{
|
{
|
||||||
Cvar_FullSet( "joy_found", 0, FCVAR_READ_ONLY );
|
if( joy_initialized )
|
||||||
|
{
|
||||||
|
Cvar_FullSet( "joy_found", 0, FCVAR_READ_ONLY );
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
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 "client.h"
|
||||||
#include "vgui_draw.h"
|
#include "vgui_draw.h"
|
||||||
|
|
||||||
#ifdef XASH_SDL
|
#if XASH_SDL
|
||||||
#include <SDL.h>
|
#include <SDL.h>
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
@@ -30,22 +30,22 @@ qboolean in_mouseinitialized;
|
|||||||
qboolean in_mouse_suspended;
|
qboolean in_mouse_suspended;
|
||||||
POINT in_lastvalidpos;
|
POINT in_lastvalidpos;
|
||||||
qboolean in_mouse_savedpos;
|
qboolean in_mouse_savedpos;
|
||||||
|
static int in_mstate = 0;
|
||||||
static struct inputstate_s
|
static struct inputstate_s
|
||||||
{
|
{
|
||||||
float lastpitch, lastyaw;
|
float lastpitch, lastyaw;
|
||||||
} inputstate;
|
} inputstate;
|
||||||
|
|
||||||
extern convar_t *vid_fullscreen;
|
extern convar_t *vid_fullscreen;
|
||||||
convar_t *m_enginemouse;
|
|
||||||
convar_t *m_pitch;
|
convar_t *m_pitch;
|
||||||
convar_t *m_yaw;
|
convar_t *m_yaw;
|
||||||
|
|
||||||
convar_t *m_enginesens;
|
|
||||||
convar_t *m_ignore;
|
convar_t *m_ignore;
|
||||||
convar_t *cl_forwardspeed;
|
convar_t *cl_forwardspeed;
|
||||||
convar_t *cl_sidespeed;
|
convar_t *cl_sidespeed;
|
||||||
convar_t *cl_backspeed;
|
convar_t *cl_backspeed;
|
||||||
convar_t *look_filter;
|
convar_t *look_filter;
|
||||||
|
convar_t *m_rawinput;
|
||||||
|
|
||||||
/*
|
/*
|
||||||
================
|
================
|
||||||
@@ -61,7 +61,7 @@ uint IN_CollectInputDevices( void )
|
|||||||
if( !m_ignore->value ) // no way to check is mouse connected, so use cvar only
|
if( !m_ignore->value ) // no way to check is mouse connected, so use cvar only
|
||||||
ret |= INPUT_DEVICE_MOUSE;
|
ret |= INPUT_DEVICE_MOUSE;
|
||||||
|
|
||||||
if( CVAR_TO_BOOL(touch_enable) )
|
if( touch_enable.value )
|
||||||
ret |= INPUT_DEVICE_TOUCH;
|
ret |= INPUT_DEVICE_TOUCH;
|
||||||
|
|
||||||
if( Joy_IsActive() ) // connected or enabled
|
if( Joy_IsActive() ) // connected or enabled
|
||||||
@@ -92,13 +92,13 @@ void IN_LockInputDevices( qboolean lock )
|
|||||||
{
|
{
|
||||||
SetBits( m_ignore->flags, FCVAR_READ_ONLY );
|
SetBits( m_ignore->flags, FCVAR_READ_ONLY );
|
||||||
SetBits( joy_enable->flags, FCVAR_READ_ONLY );
|
SetBits( joy_enable->flags, FCVAR_READ_ONLY );
|
||||||
SetBits( touch_enable->flags, FCVAR_READ_ONLY );
|
SetBits( touch_enable.flags, FCVAR_READ_ONLY );
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
ClearBits( m_ignore->flags, FCVAR_READ_ONLY );
|
ClearBits( m_ignore->flags, FCVAR_READ_ONLY );
|
||||||
ClearBits( joy_enable->flags, FCVAR_READ_ONLY );
|
ClearBits( joy_enable->flags, FCVAR_READ_ONLY );
|
||||||
ClearBits( touch_enable->flags, FCVAR_READ_ONLY );
|
ClearBits( touch_enable.flags, FCVAR_READ_ONLY );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -110,13 +110,12 @@ IN_StartupMouse
|
|||||||
*/
|
*/
|
||||||
void IN_StartupMouse( void )
|
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_pitch = Cvar_Get( "m_pitch", "0.022", FCVAR_ARCHIVE | FCVAR_FILTERABLE, "mouse pitch value" );
|
||||||
m_enginesens = Cvar_Get( "m_enginesens", "0.3", FCVAR_ARCHIVE, "mouse sensitivity, when m_enginemouse enabled" );
|
m_yaw = Cvar_Get( "m_yaw", "0.022", FCVAR_ARCHIVE | FCVAR_FILTERABLE, "mouse yaw value" );
|
||||||
m_pitch = Cvar_Get( "m_pitch", "0.022", FCVAR_ARCHIVE, "mouse pitch value" );
|
look_filter = Cvar_Get( "look_filter", "0", FCVAR_ARCHIVE | FCVAR_FILTERABLE, "filter look events making it smoother" );
|
||||||
m_yaw = Cvar_Get( "m_yaw", "0.022", FCVAR_ARCHIVE, "mouse yaw value" );
|
m_rawinput = Cvar_Get( "m_rawinput", "1", FCVAR_ARCHIVE | FCVAR_FILTERABLE, "enable mouse raw input" );
|
||||||
look_filter = Cvar_Get( "look_filter", "0", FCVAR_ARCHIVE, "filter look events making it smoother" );
|
|
||||||
|
|
||||||
// You can use -nomouse argument to prevent using mouse from client
|
// You can use -nomouse argument to prevent using mouse from client
|
||||||
// -noenginemouse will disable all mouse input
|
// -noenginemouse will disable all mouse input
|
||||||
@@ -125,21 +124,9 @@ void IN_StartupMouse( void )
|
|||||||
in_mouseinitialized = true;
|
in_mouseinitialized = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
static void IN_ActivateCursor( void )
|
void GAME_EXPORT IN_SetCursor( void *hCursor )
|
||||||
{
|
{
|
||||||
if( cls.key_dest == key_menu )
|
// stub
|
||||||
{
|
|
||||||
#ifdef XASH_SDL
|
|
||||||
SDL_SetCursor( in_mousecursor );
|
|
||||||
#endif
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
void IN_SetCursor( void *hCursor )
|
|
||||||
{
|
|
||||||
in_mousecursor = hCursor;
|
|
||||||
|
|
||||||
IN_ActivateCursor();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
@@ -184,63 +171,103 @@ Called when key_dest is changed
|
|||||||
*/
|
*/
|
||||||
void IN_ToggleClientMouse( int newstate, int oldstate )
|
void IN_ToggleClientMouse( int newstate, int oldstate )
|
||||||
{
|
{
|
||||||
if( newstate == oldstate ) return;
|
if( newstate == oldstate )
|
||||||
|
return;
|
||||||
|
|
||||||
if( oldstate == key_game )
|
// since SetCursorType controls cursor visibility
|
||||||
|
// execute it first, and then check mouse grab state
|
||||||
|
if( newstate == key_menu || newstate == key_console )
|
||||||
{
|
{
|
||||||
if( cls.initialized )
|
Platform_SetCursorType( dc_arrow );
|
||||||
clgame.dllFuncs.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();
|
|
||||||
}
|
|
||||||
|
|
||||||
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
|
#if XASH_ANDROID
|
||||||
Android_ShowMouse( true );
|
Android_ShowMouse( true );
|
||||||
#endif
|
#endif
|
||||||
#ifdef XASH_USE_EVDEV
|
#if XASH_USE_EVDEV
|
||||||
Evdev_SetGrab( false );
|
Evdev_SetGrab( false );
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
Platform_SetCursorType( dc_none );
|
||||||
|
|
||||||
#if XASH_ANDROID
|
#if XASH_ANDROID
|
||||||
Android_ShowMouse( false );
|
Android_ShowMouse( false );
|
||||||
#endif
|
#endif
|
||||||
#ifdef XASH_USE_EVDEV
|
#if XASH_USE_EVDEV
|
||||||
Evdev_SetGrab( true );
|
Evdev_SetGrab( true );
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if( oldstate == key_game )
|
||||||
|
{
|
||||||
|
IN_DeactivateMouse();
|
||||||
|
}
|
||||||
|
else if( newstate == key_game )
|
||||||
|
{
|
||||||
|
IN_ActivateMouse();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void IN_CheckMouseState( qboolean active )
|
||||||
|
{
|
||||||
|
static qboolean s_bRawInput, s_bMouseGrab;
|
||||||
|
|
||||||
|
#if XASH_WIN32
|
||||||
|
qboolean useRawInput = ( CVAR_TO_BOOL( m_rawinput ) && clgame.client_dll_uses_sdl ) || clgame.dllFuncs.pfnLookEvent != NULL;
|
||||||
|
#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;
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
@@ -250,58 +277,15 @@ IN_ActivateMouse
|
|||||||
Called when the window gains focus or changes in some way
|
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 )
|
if( !in_mouseinitialized )
|
||||||
return;
|
return;
|
||||||
|
|
||||||
if( CL_Active() && host.mouse_visible && !force )
|
IN_CheckMouseState( true );
|
||||||
return; // VGUI controls
|
if( clgame.dllFuncs.IN_ActivateMouse )
|
||||||
|
|
||||||
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_mouseactive = true;
|
|
||||||
|
|
||||||
if( UI_IsVisible( )) return;
|
|
||||||
|
|
||||||
if( cls.key_dest == key_game )
|
|
||||||
{
|
|
||||||
clgame.dllFuncs.IN_ActivateMouse();
|
clgame.dllFuncs.IN_ActivateMouse();
|
||||||
#ifdef XASH_SDL
|
in_mouseactive = true;
|
||||||
SDL_GetRelativeMouseState( 0, 0 ); // Reset mouse position
|
|
||||||
#endif
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
@@ -313,20 +297,17 @@ Called when the window loses focus
|
|||||||
*/
|
*/
|
||||||
void IN_DeactivateMouse( void )
|
void IN_DeactivateMouse( void )
|
||||||
{
|
{
|
||||||
if( !in_mouseinitialized || !in_mouseactive )
|
if( !in_mouseinitialized )
|
||||||
return;
|
return;
|
||||||
|
|
||||||
if( cls.key_dest == key_game )
|
IN_CheckMouseState( false );
|
||||||
{
|
if( clgame.dllFuncs.IN_DeactivateMouse )
|
||||||
clgame.dllFuncs.IN_DeactivateMouse();
|
clgame.dllFuncs.IN_DeactivateMouse();
|
||||||
}
|
|
||||||
|
|
||||||
in_mouseactive = false;
|
in_mouseactive = false;
|
||||||
#ifdef XASH_SDL
|
|
||||||
SDL_SetWindowGrab( host.hWnd, SDL_FALSE );
|
|
||||||
#endif // XASH_SDL
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
================
|
================
|
||||||
IN_MouseMove
|
IN_MouseMove
|
||||||
@@ -334,27 +315,25 @@ IN_MouseMove
|
|||||||
*/
|
*/
|
||||||
void IN_MouseMove( void )
|
void IN_MouseMove( void )
|
||||||
{
|
{
|
||||||
POINT current_pos;
|
int x, y;
|
||||||
|
|
||||||
if( !in_mouseinitialized || !in_mouseactive || !UI_IsVisible( ))
|
if( !in_mouseinitialized )
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
if( touch_emulate.value )
|
||||||
|
{
|
||||||
|
// touch emulation overrides all input
|
||||||
|
Touch_KeyEvent( 0, 0 );
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
// find mouse movement
|
// find mouse movement
|
||||||
Platform_GetMousePos( ¤t_pos.x, ¤t_pos.y );
|
Platform_GetMousePos( &x, &y );
|
||||||
|
|
||||||
VGui_MouseMove( current_pos.x, current_pos.y );
|
VGui_MouseMove( x, y );
|
||||||
|
|
||||||
// HACKHACK: show cursor in UI, as mainui doesn't call
|
|
||||||
// platform-dependent SetCursor anymore
|
|
||||||
#ifdef XASH_SDL
|
|
||||||
if( UI_IsVisible() )
|
|
||||||
SDL_ShowCursor( SDL_TRUE );
|
|
||||||
#endif
|
|
||||||
|
|
||||||
// if the menu is visible, move the menu cursor
|
// if the menu is visible, move the menu cursor
|
||||||
UI_MouseMove( current_pos.x, current_pos.y );
|
UI_MouseMove( x, y );
|
||||||
|
|
||||||
IN_ActivateCursor();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
@@ -362,76 +341,55 @@ void IN_MouseMove( void )
|
|||||||
IN_MouseEvent
|
IN_MouseEvent
|
||||||
===========
|
===========
|
||||||
*/
|
*/
|
||||||
void IN_MouseEvent( void )
|
void IN_MouseEvent( int key, int down )
|
||||||
{
|
{
|
||||||
int i;
|
if( !in_mouseinitialized )
|
||||||
|
return;
|
||||||
|
|
||||||
// touch emu: handle motion
|
if( down )
|
||||||
if( CVAR_TO_BOOL( touch_emulate ))
|
SetBits( in_mstate, BIT( key ));
|
||||||
|
else ClearBits( in_mstate, BIT( key ));
|
||||||
|
|
||||||
|
// touch emulation overrides all input
|
||||||
|
if( touch_emulate.value )
|
||||||
{
|
{
|
||||||
if( Key_IsDown( K_SHIFT ) )
|
Touch_KeyEvent( K_MOUSE1 + key, down );
|
||||||
Touch_KeyEvent( K_MOUSE2, 2 );
|
|
||||||
else
|
|
||||||
Touch_KeyEvent( K_MOUSE1, 2 );
|
|
||||||
}
|
}
|
||||||
|
else if( cls.key_dest == key_game )
|
||||||
if( !in_mouseinitialized || !in_mouseactive )
|
|
||||||
return;
|
|
||||||
|
|
||||||
|
|
||||||
if( m_ignore->value )
|
|
||||||
return;
|
|
||||||
|
|
||||||
if( cls.key_dest == key_game )
|
|
||||||
{
|
{
|
||||||
#if defined( XASH_SDL )
|
// perform button actions
|
||||||
static qboolean ignore; // igonre mouse warp event
|
VGui_MouseEvent( K_MOUSE1 + key, down );
|
||||||
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 );
|
|
||||||
|
|
||||||
if( x < host.window_center_x / 2 ||
|
// don't do Key_Event here
|
||||||
y < host.window_center_y / 2 ||
|
// client may override IN_MouseEvent
|
||||||
x > host.window_center_x + host.window_center_x / 2 ||
|
// but by default it calls back to Key_Event anyway
|
||||||
y > host.window_center_y + host.window_center_y / 2 )
|
if( in_mouseactive )
|
||||||
{
|
clgame.dllFuncs.IN_MouseEvent( in_mstate );
|
||||||
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;
|
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
#if XASH_SDL && !XASH_WIN32
|
// perform button actions
|
||||||
#if SDL_VERSION_ATLEAST( 2, 0, 0 )
|
Key_Event( K_MOUSE1 + key, down );
|
||||||
SDL_SetRelativeMouseMode( SDL_FALSE );
|
|
||||||
#endif // SDL_VERSION_ATLEAST( 2, 0, 0 )
|
|
||||||
SDL_ShowCursor( SDL_TRUE );
|
|
||||||
#endif // XASH_SDL && !XASH_WIN32
|
|
||||||
IN_MouseMove();
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
==============
|
||||||
|
IN_MWheelEvent
|
||||||
|
|
||||||
|
direction is negative for wheel down, otherwise wheel up
|
||||||
|
==============
|
||||||
|
*/
|
||||||
|
void IN_MWheelEvent( int y )
|
||||||
|
{
|
||||||
|
int b = y > 0 ? K_MWHEELUP : K_MWHEELDOWN;
|
||||||
|
|
||||||
|
VGui_MWheelEvent( y );
|
||||||
|
|
||||||
|
Key_Event( b, true );
|
||||||
|
Key_Event( b, false );
|
||||||
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
===========
|
===========
|
||||||
IN_Shutdown
|
IN_Shutdown
|
||||||
@@ -441,7 +399,7 @@ void IN_Shutdown( void )
|
|||||||
{
|
{
|
||||||
IN_DeactivateMouse( );
|
IN_DeactivateMouse( );
|
||||||
|
|
||||||
#ifdef XASH_USE_EVDEV
|
#if XASH_USE_EVDEV
|
||||||
Evdev_Shutdown();
|
Evdev_Shutdown();
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
@@ -456,9 +414,9 @@ IN_Init
|
|||||||
*/
|
*/
|
||||||
void IN_Init( void )
|
void IN_Init( void )
|
||||||
{
|
{
|
||||||
cl_forwardspeed = Cvar_Get( "cl_forwardspeed", "400", FCVAR_ARCHIVE | FCVAR_CLIENTDLL, "Default forward 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, "Default back 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, "Default side move speed" );
|
cl_sidespeed = Cvar_Get( "cl_sidespeed", "400", FCVAR_ARCHIVE | FCVAR_CLIENTDLL | FCVAR_FILTERABLE, "Default side move speed" );
|
||||||
|
|
||||||
if( !Host_IsDedicated() )
|
if( !Host_IsDedicated() )
|
||||||
{
|
{
|
||||||
@@ -468,7 +426,7 @@ void IN_Init( void )
|
|||||||
|
|
||||||
Touch_Init();
|
Touch_Init();
|
||||||
|
|
||||||
#ifdef XASH_USE_EVDEV
|
#if XASH_USE_EVDEV
|
||||||
Evdev_Init();
|
Evdev_Init();
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
@@ -565,30 +523,16 @@ 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( includeMouse )
|
||||||
{
|
{
|
||||||
#if XASH_INPUT == INPUT_SDL
|
float x, y;
|
||||||
if( includeSdlMouse )
|
Platform_MouseMove( &x, &y );
|
||||||
{
|
*pitch += y * m_pitch->value;
|
||||||
int x, y;
|
*yaw -= x * m_yaw->value;
|
||||||
SDL_GetRelativeMouseState( &x, &y );
|
|
||||||
*pitch += y * m_pitch->value;
|
|
||||||
*yaw -= x * m_yaw->value;
|
|
||||||
}
|
|
||||||
#endif // INPUT_SDL
|
|
||||||
|
|
||||||
#if XASH_INPUT == INPUT_ANDROID
|
#if XASH_USE_EVDEV
|
||||||
{
|
|
||||||
float x, y;
|
|
||||||
Android_MouseMove( &x, &y );
|
|
||||||
*pitch += y * m_pitch->value;
|
|
||||||
*yaw -= x * m_yaw->value;
|
|
||||||
}
|
|
||||||
#endif // ANDROID
|
|
||||||
|
|
||||||
#ifdef XASH_USE_EVDEV
|
|
||||||
IN_EvdevMove( yaw, pitch );
|
IN_EvdevMove( yaw, pitch );
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
@@ -630,7 +574,7 @@ void IN_EngineAppendMove( float frametime, void *cmd1, qboolean active )
|
|||||||
{
|
{
|
||||||
float sensitivity = 1;//( (float)cl.local.scr_fov / (float)90.0f );
|
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 );
|
IN_JoyAppendMove( cmd, forward, side );
|
||||||
|
|
||||||
@@ -639,11 +583,36 @@ void IN_EngineAppendMove( float frametime, void *cmd1, qboolean active )
|
|||||||
cmd->viewangles[YAW] += yaw * sensitivity;
|
cmd->viewangles[YAW] += yaw * sensitivity;
|
||||||
cmd->viewangles[PITCH] += pitch * sensitivity;
|
cmd->viewangles[PITCH] += pitch * sensitivity;
|
||||||
cmd->viewangles[PITCH] = bound( -90, cmd->viewangles[PITCH], 90 );
|
cmd->viewangles[PITCH] = bound( -90, cmd->viewangles[PITCH], 90 );
|
||||||
VectorCopy(cmd->viewangles, cl.viewangles);
|
VectorCopy( cmd->viewangles, cl.viewangles );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void IN_Commands( void )
|
||||||
|
{
|
||||||
|
#if 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
|
Host_InputFrame
|
||||||
@@ -653,47 +622,9 @@ Called every frame, even if not generating commands
|
|||||||
*/
|
*/
|
||||||
void Host_InputFrame( void )
|
void Host_InputFrame( void )
|
||||||
{
|
{
|
||||||
qboolean shutdownMouse = false;
|
|
||||||
float forward = 0, side = 0, pitch = 0, yaw = 0;
|
|
||||||
|
|
||||||
Sys_SendKeyEvents ();
|
Sys_SendKeyEvents ();
|
||||||
|
|
||||||
#ifdef XASH_USE_EVDEV
|
IN_Commands();
|
||||||
IN_EvdevFrame();
|
|
||||||
#endif
|
|
||||||
|
|
||||||
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();
|
IN_MouseMove();
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -33,8 +33,9 @@ extern qboolean in_mouseinitialized;
|
|||||||
void IN_Init( void );
|
void IN_Init( void );
|
||||||
void Host_InputFrame( void );
|
void Host_InputFrame( void );
|
||||||
void IN_Shutdown( void );
|
void IN_Shutdown( void );
|
||||||
void IN_MouseEvent( void );
|
void IN_MouseEvent( int key, int down );
|
||||||
void IN_ActivateMouse( qboolean force );
|
void IN_MWheelEvent( int direction );
|
||||||
|
void IN_ActivateMouse( void );
|
||||||
void IN_DeactivateMouse( void );
|
void IN_DeactivateMouse( void );
|
||||||
void IN_MouseSavePos( void );
|
void IN_MouseSavePos( void );
|
||||||
void IN_MouseRestorePos( void );
|
void IN_MouseRestorePos( void );
|
||||||
@@ -57,16 +58,13 @@ typedef enum
|
|||||||
event_motion
|
event_motion
|
||||||
} touchEventType;
|
} touchEventType;
|
||||||
|
|
||||||
extern convar_t *touch_enable;
|
extern convar_t touch_enable;
|
||||||
extern convar_t *touch_emulate;
|
extern convar_t touch_emulate;
|
||||||
|
|
||||||
void Touch_Draw( void );
|
void Touch_Draw( void );
|
||||||
void Touch_SetClientOnly( qboolean state );
|
void Touch_SetClientOnly( byte state );
|
||||||
void Touch_RemoveButton( const char *name );
|
void Touch_RemoveButton( const char *name, qboolean privileged );
|
||||||
void Touch_HideButtons( const char *name, unsigned char hide );
|
void Touch_HideButtons( const char *name, unsigned char hide, qboolean privileged );
|
||||||
//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_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_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_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 );
|
void Touch_WriteConfig( void );
|
||||||
@@ -76,6 +74,7 @@ void Touch_GetMove( float * forward, float *side, float *yaw, float *pitch );
|
|||||||
void Touch_ResetDefaultButtons( void );
|
void Touch_ResetDefaultButtons( void );
|
||||||
int IN_TouchEvent( touchEventType type, int fingerID, float x, float y, float dx, float dy );
|
int IN_TouchEvent( touchEventType type, int fingerID, float x, float y, float dx, float dy );
|
||||||
void Touch_KeyEvent( int key, int down );
|
void Touch_KeyEvent( int key, int down );
|
||||||
|
qboolean Touch_WantVisibleCursor( void );
|
||||||
|
|
||||||
//
|
//
|
||||||
// in_joy.c
|
// in_joy.c
|
||||||
@@ -93,9 +92,21 @@ enum
|
|||||||
JOY_HAT_LEFTDOWN = JOY_HAT_LEFT | JOY_HAT_DOWN
|
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 );
|
qboolean Joy_IsActive( void );
|
||||||
void Joy_HatMotionEvent( byte hat, byte value );
|
void Joy_HatMotionEvent( byte hat, byte value );
|
||||||
void Joy_AxisMotionEvent( byte axis, short 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_BallMotionEvent( byte ball, short xrel, short yrel );
|
||||||
void Joy_ButtonEvent( byte button, byte down );
|
void Joy_ButtonEvent( byte button, byte down );
|
||||||
void Joy_AddEvent( void );
|
void Joy_AddEvent( void );
|
||||||
|
|||||||
@@ -29,7 +29,7 @@ typedef struct
|
|||||||
|
|
||||||
typedef struct keyname_s
|
typedef struct keyname_s
|
||||||
{
|
{
|
||||||
char *name; // key name
|
const char *name; // key name
|
||||||
int keynum; // key number
|
int keynum; // key number
|
||||||
const char *binding; // default bind
|
const char *binding; // default bind
|
||||||
} keyname_t;
|
} keyname_t;
|
||||||
@@ -98,42 +98,44 @@ keyname_t keynames[] =
|
|||||||
{"KP_PLUS", K_KP_PLUS, "" },
|
{"KP_PLUS", K_KP_PLUS, "" },
|
||||||
{"PAUSE", K_PAUSE, "pause" },
|
{"PAUSE", K_PAUSE, "pause" },
|
||||||
|
|
||||||
{"A_BUTTON", K_A_BUTTON, ""}, // they match xbox controller
|
// Gamepad
|
||||||
{"B_BUTTON", K_B_BUTTON, ""},
|
// A/B X/Y names match the Xbox controller layout
|
||||||
{"X_BUTTON", K_X_BUTTON, ""},
|
{"A_BUTTON", K_A_BUTTON, "+jump"},
|
||||||
{"Y_BUTTON", K_Y_BUTTON, ""},
|
{"B_BUTTON", K_B_BUTTON, "+use"},
|
||||||
{"L1_BUTTON", K_L1_BUTTON, ""},
|
{"X_BUTTON", K_X_BUTTON, "+reload"},
|
||||||
{"R1_BUTTON", K_R1_BUTTON, ""},
|
{"Y_BUTTON", K_Y_BUTTON, "impulse 100"}, // Flashlight
|
||||||
{"BACK", K_BACK_BUTTON, ""},
|
{"BACK", K_BACK_BUTTON, "pause"}, // Menu
|
||||||
{"MODE", K_MODE_BUTTON, ""},
|
{"MODE", K_MODE_BUTTON, ""},
|
||||||
{"START", K_START_BUTTON, ""},
|
{"START", K_START_BUTTON, "escape"},
|
||||||
{"STICK1", K_LSTICK, ""},
|
{"STICK1", K_LSTICK, "+speed"},
|
||||||
{"STICK2", K_RSTICK, ""},
|
{"STICK2", K_RSTICK, "+duck"},
|
||||||
{"L2_BUTTON", K_L2_BUTTON, ""}, // in case...
|
{"L1_BUTTON", K_L1_BUTTON, "+duck"},
|
||||||
{"R2_BUTTON", K_R2_BUTTON, ""},
|
{"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, ""},
|
{"C_BUTTON", K_C_BUTTON, ""},
|
||||||
{"Z_BUTTON", K_Z_BUTTON, ""},
|
{"Z_BUTTON", K_Z_BUTTON, ""},
|
||||||
{"AUX16", K_AUX16, ""}, // generic
|
{"MISC_BUTTON", K_MISC_BUTTON, ""},
|
||||||
{"AUX17", K_AUX17, ""},
|
{"PADDLE1", K_PADDLE1_BUTTON, ""},
|
||||||
{"AUX18", K_AUX18, ""},
|
{"PADDLE2", K_PADDLE2_BUTTON, ""},
|
||||||
{"AUX19", K_AUX19, ""},
|
{"PADDLE3", K_PADDLE3_BUTTON, ""},
|
||||||
{"AUX20", K_AUX20, ""},
|
{"PADDLE4", K_PADDLE4_BUTTON, ""},
|
||||||
{"AUX21", K_AUX21, ""},
|
{"TOUCHPAD", K_TOUCHPAD, ""},
|
||||||
{"AUX22", K_AUX22, ""},
|
{"AUX26", K_AUX26, ""}, // generic
|
||||||
{"AUX23", K_AUX23, ""},
|
|
||||||
{"AUX24", K_AUX24, ""},
|
|
||||||
{"AUX25", K_AUX25, ""},
|
|
||||||
{"AUX26", K_AUX26, ""},
|
|
||||||
{"AUX27", K_AUX27, ""},
|
{"AUX27", K_AUX27, ""},
|
||||||
{"AUX28", K_AUX28, ""},
|
{"AUX28", K_AUX28, ""},
|
||||||
{"AUX29", K_AUX29, ""},
|
{"AUX29", K_AUX29, ""},
|
||||||
{"AUX30", K_AUX30, ""},
|
{"AUX30", K_AUX30, ""},
|
||||||
{"AUX31", K_AUX31, ""},
|
{"AUX31", K_AUX31, ""},
|
||||||
{"AUX32", K_AUX32, ""},
|
{"AUX32", K_AUX32, ""},
|
||||||
{"LTRIGGER" , K_JOY1 , ""},
|
|
||||||
{"RTRIGGER" , K_JOY2 , ""},
|
|
||||||
{"JOY3" , K_JOY3 , ""},
|
|
||||||
{"JOY4" , K_JOY4 , ""},
|
|
||||||
|
|
||||||
// raw semicolon seperates commands
|
// raw semicolon seperates commands
|
||||||
{"SEMICOLON", ';', "" },
|
{"SEMICOLON", ';', "" },
|
||||||
@@ -150,25 +152,13 @@ static convar_t *key_rotate;
|
|||||||
Key_IsDown
|
Key_IsDown
|
||||||
===================
|
===================
|
||||||
*/
|
*/
|
||||||
int Key_IsDown( int keynum )
|
int GAME_EXPORT Key_IsDown( int keynum )
|
||||||
{
|
{
|
||||||
if( keynum == -1 )
|
if( keynum == -1 )
|
||||||
return false;
|
return false;
|
||||||
return keys[keynum].down;
|
return keys[keynum].down;
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
|
||||||
===================
|
|
||||||
Key_GetBind
|
|
||||||
===================
|
|
||||||
*/
|
|
||||||
const char *Key_IsBind( int keynum )
|
|
||||||
{
|
|
||||||
if( keynum == -1 || !keys[keynum].binding )
|
|
||||||
return NULL;
|
|
||||||
return keys[keynum].binding;
|
|
||||||
}
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
===================
|
===================
|
||||||
Key_StringToKeynum
|
Key_StringToKeynum
|
||||||
@@ -279,7 +269,7 @@ const char *Key_KeynumToString( int keynum )
|
|||||||
Key_SetBinding
|
Key_SetBinding
|
||||||
===================
|
===================
|
||||||
*/
|
*/
|
||||||
void Key_SetBinding( int keynum, const char *binding )
|
void GAME_EXPORT Key_SetBinding( int keynum, const char *binding )
|
||||||
{
|
{
|
||||||
if( keynum == -1 ) return;
|
if( keynum == -1 ) return;
|
||||||
|
|
||||||
@@ -313,25 +303,25 @@ Key_GetKey
|
|||||||
*/
|
*/
|
||||||
int Key_GetKey( const char *pBinding )
|
int Key_GetKey( const char *pBinding )
|
||||||
{
|
{
|
||||||
int i;
|
int i, len;
|
||||||
|
const char *p;
|
||||||
|
|
||||||
if( !pBinding ) return -1;
|
if( !pBinding ) return -1;
|
||||||
|
|
||||||
|
len = Q_strlen( pBinding );
|
||||||
|
|
||||||
for( i = 0; i < 256; i++ )
|
for( i = 0; i < 256; i++ )
|
||||||
{
|
{
|
||||||
if( !keys[i].binding )
|
if( !keys[i].binding )
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
if( *keys[i].binding == '+' )
|
p = keys[i].binding;
|
||||||
{
|
|
||||||
if( !Q_strnicmp( keys[i].binding + 1, pBinding, Q_strlen( pBinding )))
|
if( *p == '+' )
|
||||||
return i;
|
p++;
|
||||||
}
|
|
||||||
else
|
if( !Q_strnicmp( p, pBinding, len ) )
|
||||||
{
|
return i;
|
||||||
if( !Q_strnicmp( keys[i].binding, pBinding, Q_strlen( pBinding )))
|
|
||||||
return i;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return -1;
|
return -1;
|
||||||
@@ -372,7 +362,7 @@ void Key_Unbindall_f( void )
|
|||||||
{
|
{
|
||||||
int i;
|
int i;
|
||||||
|
|
||||||
for( i = 0; i < 256; i++ )
|
for( i = 0; i < ARRAYSIZE( keys ); i++ )
|
||||||
{
|
{
|
||||||
if( keys[i].binding )
|
if( keys[i].binding )
|
||||||
Key_SetBinding( i, "" );
|
Key_SetBinding( i, "" );
|
||||||
@@ -380,6 +370,7 @@ void Key_Unbindall_f( void )
|
|||||||
|
|
||||||
// set some defaults
|
// set some defaults
|
||||||
Key_SetBinding( K_ESCAPE, "escape" );
|
Key_SetBinding( K_ESCAPE, "escape" );
|
||||||
|
Key_SetBinding( K_START_BUTTON, "escape" );
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
@@ -393,7 +384,7 @@ void Key_Reset_f( void )
|
|||||||
int i;
|
int i;
|
||||||
|
|
||||||
// clear all keys first
|
// clear all keys first
|
||||||
for( i = 0; i < 256; i++ )
|
for( i = 0; i < ARRAYSIZE( keys ); i++ )
|
||||||
{
|
{
|
||||||
if( keys[i].binding )
|
if( keys[i].binding )
|
||||||
Key_SetBinding( i, "" );
|
Key_SetBinding( i, "" );
|
||||||
@@ -443,8 +434,8 @@ void Key_Bind_f( void )
|
|||||||
|
|
||||||
for( i = 2; i < c; i++ )
|
for( i = 2; i < c; i++ )
|
||||||
{
|
{
|
||||||
Q_strcat( cmd, Cmd_Argv( i ));
|
Q_strncat( cmd, Cmd_Argv( i ), sizeof( cmd ));
|
||||||
if( i != ( c - 1 )) Q_strcat( cmd, " " );
|
if( i != ( c - 1 )) Q_strncat( cmd, " ", sizeof( cmd ));
|
||||||
}
|
}
|
||||||
|
|
||||||
Key_SetBinding( b, cmd );
|
Key_SetBinding( b, cmd );
|
||||||
@@ -460,6 +451,7 @@ Writes lines containing "bind key value"
|
|||||||
void Key_WriteBindings( file_t *f )
|
void Key_WriteBindings( file_t *f )
|
||||||
{
|
{
|
||||||
int i;
|
int i;
|
||||||
|
string newCommand;
|
||||||
|
|
||||||
if( !f ) return;
|
if( !f ) return;
|
||||||
|
|
||||||
@@ -470,7 +462,8 @@ void Key_WriteBindings( file_t *f )
|
|||||||
if( !COM_CheckString( keys[i].binding ))
|
if( !COM_CheckString( keys[i].binding ))
|
||||||
continue;
|
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 +503,18 @@ void Key_Init( void )
|
|||||||
keyname_t *kn;
|
keyname_t *kn;
|
||||||
|
|
||||||
// register our functions
|
// register our functions
|
||||||
Cmd_AddCommand( "bind", Key_Bind_f, "binds a command to the specified key in bindmap" );
|
Cmd_AddRestrictedCommand( "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_AddRestrictedCommand( "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_AddRestrictedCommand( "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( "resetkeys", Key_Reset_f, "reset all keys to their default values" );
|
||||||
Cmd_AddCommand( "bindlist", Key_Bindlist_f, "display current key bindings" );
|
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
|
// 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" );
|
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, "rotate arrow keys (0-3)" );
|
key_rotate = Cvar_Get( "key_rotate", "0", FCVAR_ARCHIVE | FCVAR_FILTERABLE, "rotate arrow keys (0-3)" );
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -548,8 +541,8 @@ void Key_AddKeyCommands( int key, const char *kb, qboolean down )
|
|||||||
if( button[0] == '+' )
|
if( button[0] == '+' )
|
||||||
{
|
{
|
||||||
// button commands add keynum as a parm
|
// button commands add keynum as a parm
|
||||||
if( down ) Q_sprintf( cmd, "%s %i\n", button, key );
|
if( down ) Q_snprintf( cmd, sizeof( cmd ), "%s %i\n", button, key );
|
||||||
else Q_sprintf( cmd, "-%s %i\n", button + 1, key );
|
else Q_snprintf( cmd, sizeof( cmd ), "-%s %i\n", button + 1, key );
|
||||||
Cbuf_AddText( cmd );
|
Cbuf_AddText( cmd );
|
||||||
}
|
}
|
||||||
else if( down )
|
else if( down )
|
||||||
@@ -644,7 +637,7 @@ Key_Event
|
|||||||
Called by the system for both key up and key down events
|
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;
|
const char *kb;
|
||||||
|
|
||||||
@@ -708,7 +701,6 @@ void Key_Event( int key, int down )
|
|||||||
}
|
}
|
||||||
|
|
||||||
VGui_KeyEvent( key, down );
|
VGui_KeyEvent( key, down );
|
||||||
Touch_KeyEvent( key, down );
|
|
||||||
|
|
||||||
// console key is hardcoded, so the user can never unbind it
|
// console key is hardcoded, so the user can never unbind it
|
||||||
if( key == '`' || key == '~' )
|
if( key == '`' || key == '~' )
|
||||||
@@ -810,9 +802,9 @@ void Key_EnableTextInput( qboolean enable, qboolean force )
|
|||||||
OSK_EnableTextInput( enable, force );
|
OSK_EnableTextInput( enable, force );
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if( enable && ( !host.textmode || force ) )
|
if( enable && ( !host.textmode || force ))
|
||||||
Platform_EnableTextInput( true );
|
Platform_EnableTextInput( true );
|
||||||
else if( !enable )
|
else if( !enable && ( host.textmode || force ))
|
||||||
Platform_EnableTextInput( false );
|
Platform_EnableTextInput( false );
|
||||||
|
|
||||||
host.textmode = enable;
|
host.textmode = enable;
|
||||||
@@ -823,7 +815,7 @@ void Key_EnableTextInput( qboolean enable, qboolean force )
|
|||||||
Key_SetKeyDest
|
Key_SetKeyDest
|
||||||
=========
|
=========
|
||||||
*/
|
*/
|
||||||
void Key_SetKeyDest( int key_dest )
|
void GAME_EXPORT Key_SetKeyDest( int key_dest )
|
||||||
{
|
{
|
||||||
IN_ToggleClientMouse( key_dest, cls.key_dest );
|
IN_ToggleClientMouse( key_dest, cls.key_dest );
|
||||||
|
|
||||||
@@ -838,7 +830,9 @@ void Key_SetKeyDest( int key_dest )
|
|||||||
cls.key_dest = key_menu;
|
cls.key_dest = key_menu;
|
||||||
break;
|
break;
|
||||||
case key_console:
|
case key_console:
|
||||||
|
#if !XASH_NSWITCH && !XASH_PSVITA // if we don't disable this, pops up the keyboard during load
|
||||||
Key_EnableTextInput( true, false );
|
Key_EnableTextInput( true, false );
|
||||||
|
#endif
|
||||||
cls.key_dest = key_console;
|
cls.key_dest = key_console;
|
||||||
break;
|
break;
|
||||||
case key_message:
|
case key_message:
|
||||||
@@ -856,7 +850,7 @@ void Key_SetKeyDest( int key_dest )
|
|||||||
Key_ClearStates
|
Key_ClearStates
|
||||||
===================
|
===================
|
||||||
*/
|
*/
|
||||||
void Key_ClearStates( void )
|
void GAME_EXPORT Key_ClearStates( void )
|
||||||
{
|
{
|
||||||
int i;
|
int i;
|
||||||
|
|
||||||
@@ -915,13 +909,17 @@ A helper function if platform input doesn't support text mode properly
|
|||||||
*/
|
*/
|
||||||
int Key_ToUpper( int keynum )
|
int Key_ToUpper( int keynum )
|
||||||
{
|
{
|
||||||
keynum = Q_toupper( keynum );
|
keynum = Q_toupper( keynum );
|
||||||
if( keynum == '-' )
|
if( keynum == '-' )
|
||||||
keynum = '_';
|
keynum = '_';
|
||||||
if( keynum == '=' )
|
if( keynum == '=' )
|
||||||
keynum = '+';
|
keynum = '+';
|
||||||
|
if( keynum == ';' )
|
||||||
|
keynum = ':';
|
||||||
|
if( keynum == '\'' )
|
||||||
|
keynum = '"';
|
||||||
|
|
||||||
return keynum;
|
return keynum;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* On-screen keyboard:
|
/* On-screen keyboard:
|
||||||
@@ -1036,7 +1034,7 @@ static qboolean OSK_KeyEvent( int key, int down )
|
|||||||
else
|
else
|
||||||
osk.curlayout++;
|
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];
|
osk.curbutton.val = osk_keylayout[osk.curlayout][osk.curbutton.y][osk.curbutton.x];
|
||||||
break;
|
break;
|
||||||
case OSK_BACKSPACE:
|
case OSK_BACKSPACE:
|
||||||
@@ -1141,7 +1139,7 @@ Draw button with symbol on it
|
|||||||
*/
|
*/
|
||||||
static void OSK_DrawSymbolButton( int symb, float x, float y, float width, float height )
|
static void OSK_DrawSymbolButton( int symb, float x, float y, float width, float height )
|
||||||
{
|
{
|
||||||
char str[] = {symb & 255, 0};
|
cl_font_t *font = Con_GetCurFont();
|
||||||
byte color[] = { 255, 255, 255, 255 };
|
byte color[] = { 255, 255, 255, 255 };
|
||||||
int x1 = x * refState.width,
|
int x1 = x * refState.width,
|
||||||
y1 = y * refState.height,
|
y1 = y * refState.height,
|
||||||
@@ -1149,14 +1147,15 @@ static void OSK_DrawSymbolButton( int symb, float x, float y, float width, float
|
|||||||
h = height * refState.height;
|
h = height * refState.height;
|
||||||
|
|
||||||
if( symb == osk.curbutton.val )
|
if( symb == osk.curbutton.val )
|
||||||
{
|
|
||||||
ref.dllFuncs.FillRGBABlend( x1, y1, w, h, 255, 160, 0, 100 );
|
ref.dllFuncs.FillRGBABlend( x1, y1, w, h, 255, 160, 0, 100 );
|
||||||
}
|
|
||||||
|
|
||||||
if( !symb || symb == ' ' || (symb >= OSK_TAB && symb < OSK_SPECKEY_LAST ) )
|
if( !symb || symb == ' ' || (symb >= OSK_TAB && symb < OSK_SPECKEY_LAST ) )
|
||||||
return;
|
return;
|
||||||
|
|
||||||
Con_DrawCharacter( x1 + 1, y1, symb, color );
|
CL_DrawCharacter(
|
||||||
|
x1 + width * 0.4 * refState.width,
|
||||||
|
y1 + height * 0.4 * refState.height,
|
||||||
|
symb, color, font, 0 );
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
@@ -1170,7 +1169,11 @@ static void OSK_DrawSpecialButton( const char *name, float x, float y, float wid
|
|||||||
{
|
{
|
||||||
byte color[] = { 0, 255, 0, 255 };
|
byte color[] = { 0, 255, 0, 255 };
|
||||||
|
|
||||||
Con_DrawString( x * refState.width, y * refState.height, name, color );
|
Con_DrawString(
|
||||||
|
x * refState.width + width * 0.4 * refState.width,
|
||||||
|
y * refState.height + height * 0.4 * refState.height,
|
||||||
|
name,
|
||||||
|
color );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -15,9 +15,9 @@ GNU General Public License for more details.
|
|||||||
#include "common.h"
|
#include "common.h"
|
||||||
#include "client.h"
|
#include "client.h"
|
||||||
#include "mod_local.h"
|
#include "mod_local.h"
|
||||||
#include "mathlib.h"
|
#include "xash3d_mathlib.h"
|
||||||
#include "world.h"
|
#include "world.h"
|
||||||
|
#include "eiface.h" // offsetof
|
||||||
|
|
||||||
#define MAX_CLIPNODE_DEPTH 256 // should never exceeds
|
#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 )
|
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 )
|
static void free_winding( winding_t *w )
|
||||||
@@ -84,7 +84,7 @@ static winding_t *winding_copy( winding_t *w )
|
|||||||
winding_t *neww;
|
winding_t *neww;
|
||||||
|
|
||||||
neww = winding_alloc( w->numpoints );
|
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;
|
return neww;
|
||||||
}
|
}
|
||||||
@@ -111,7 +111,7 @@ static void winding_reverse( winding_t *w )
|
|||||||
static winding_t *winding_shrink( winding_t *w )
|
static winding_t *winding_shrink( winding_t *w )
|
||||||
{
|
{
|
||||||
winding_t *neww = winding_alloc( w->numpoints );
|
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 );
|
free_winding( w );
|
||||||
|
|
||||||
return neww;
|
return neww;
|
||||||
|
|||||||
@@ -13,7 +13,7 @@ convar_t *gl_showtextures;
|
|||||||
convar_t *r_decals;
|
convar_t *r_decals;
|
||||||
convar_t *r_adjust_fov;
|
convar_t *r_adjust_fov;
|
||||||
convar_t *r_showtree;
|
convar_t *r_showtree;
|
||||||
convar_t *gl_wgl_msaa_samples;
|
convar_t *gl_msaa_samples;
|
||||||
convar_t *gl_clear;
|
convar_t *gl_clear;
|
||||||
convar_t *r_refdll;
|
convar_t *r_refdll;
|
||||||
|
|
||||||
@@ -30,7 +30,7 @@ GL_FreeImage
|
|||||||
Frees image by name
|
Frees image by name
|
||||||
================
|
================
|
||||||
*/
|
*/
|
||||||
void GL_FreeImage( const char *name )
|
void GAME_EXPORT GL_FreeImage( const char *name )
|
||||||
{
|
{
|
||||||
int texnum;
|
int texnum;
|
||||||
|
|
||||||
@@ -41,21 +41,25 @@ void GL_FreeImage( const char *name )
|
|||||||
ref.dllFuncs.GL_FreeTexture( texnum );
|
ref.dllFuncs.GL_FreeTexture( texnum );
|
||||||
}
|
}
|
||||||
|
|
||||||
void GL_RenderFrame( const ref_viewpass_t *rvp )
|
void R_UpdateRefState( void )
|
||||||
{
|
{
|
||||||
refState.time = cl.time;
|
refState.time = cl.time;
|
||||||
refState.oldtime = cl.oldtime;
|
refState.oldtime = cl.oldtime;
|
||||||
refState.realtime = host.realtime;
|
refState.realtime = host.realtime;
|
||||||
refState.frametime = host.frametime;
|
refState.frametime = host.frametime;
|
||||||
|
}
|
||||||
|
|
||||||
|
void GL_RenderFrame( const ref_viewpass_t *rvp )
|
||||||
|
{
|
||||||
|
R_UpdateRefState();
|
||||||
|
|
||||||
VectorCopy( rvp->vieworigin, refState.vieworg );
|
VectorCopy( rvp->vieworigin, refState.vieworg );
|
||||||
VectorCopy( rvp->viewangles, refState.viewangles );
|
VectorCopy( rvp->viewangles, refState.viewangles );
|
||||||
AngleVectors( refState.viewangles, refState.vforward, refState.vright, refState.vup );
|
|
||||||
|
|
||||||
ref.dllFuncs.GL_RenderFrame( rvp );
|
ref.dllFuncs.GL_RenderFrame( rvp );
|
||||||
}
|
}
|
||||||
|
|
||||||
static int pfnEngineGetParm( int parm, int arg )
|
static intptr_t pfnEngineGetParm( int parm, int arg )
|
||||||
{
|
{
|
||||||
return CL_RenderGetParm( parm, arg, false ); // prevent recursion
|
return CL_RenderGetParm( parm, arg, false ); // prevent recursion
|
||||||
}
|
}
|
||||||
@@ -70,16 +74,6 @@ static void pfnStudioEvent( const mstudioevent_t *event, const cl_entity_t *e )
|
|||||||
clgame.dllFuncs.pfnStudioEvent( event, e );
|
clgame.dllFuncs.pfnStudioEvent( event, e );
|
||||||
}
|
}
|
||||||
|
|
||||||
static efrag_t* pfnGetEfragsFreeList( void )
|
|
||||||
{
|
|
||||||
return clgame.free_efrags;
|
|
||||||
}
|
|
||||||
|
|
||||||
static void pfnSetEfragsFreeList( efrag_t *list )
|
|
||||||
{
|
|
||||||
clgame.free_efrags = list;
|
|
||||||
}
|
|
||||||
|
|
||||||
static model_t *pfnGetDefaultSprite( enum ref_defaultsprite_e spr )
|
static model_t *pfnGetDefaultSprite( enum ref_defaultsprite_e spr )
|
||||||
{
|
{
|
||||||
switch( spr )
|
switch( spr )
|
||||||
@@ -146,7 +140,7 @@ static player_info_t *pfnPlayerInfo( int index )
|
|||||||
if( index == -1 ) // special index for menu
|
if( index == -1 ) // special index for menu
|
||||||
return &gameui.playerinfo;
|
return &gameui.playerinfo;
|
||||||
|
|
||||||
if( index < 0 || index > cl.maxclients )
|
if( index < 0 || index >= cl.maxclients )
|
||||||
return NULL;
|
return NULL;
|
||||||
|
|
||||||
return &cl.players[index];
|
return &cl.players[index];
|
||||||
@@ -173,7 +167,7 @@ static int pfnGetStudioModelInterface( int version, struct r_studio_interface_s
|
|||||||
0;
|
0;
|
||||||
}
|
}
|
||||||
|
|
||||||
static byte *pfnImage_GetPool( void )
|
static poolhandle_t pfnImage_GetPool( void )
|
||||||
{
|
{
|
||||||
return host.imagepool;
|
return host.imagepool;
|
||||||
}
|
}
|
||||||
@@ -220,7 +214,7 @@ static qboolean R_DoResetGamma( void )
|
|||||||
static qboolean R_Init_Video_( const int type )
|
static qboolean R_Init_Video_( const int type )
|
||||||
{
|
{
|
||||||
host.apply_opengl_config = true;
|
host.apply_opengl_config = true;
|
||||||
Cbuf_AddText( va( "exec %s.cfg", ref.dllFuncs.R_GetConfigName()));
|
Cbuf_AddTextf( "exec %s.cfg", ref.dllFuncs.R_GetConfigName());
|
||||||
Cbuf_Execute();
|
Cbuf_Execute();
|
||||||
host.apply_opengl_config = false;
|
host.apply_opengl_config = false;
|
||||||
|
|
||||||
@@ -274,9 +268,6 @@ static ref_api_t gEngfuncs =
|
|||||||
Mod_PointInLeaf,
|
Mod_PointInLeaf,
|
||||||
Mod_CreatePolygonsForHull,
|
Mod_CreatePolygonsForHull,
|
||||||
|
|
||||||
R_StudioSlerpBones,
|
|
||||||
R_StudioCalcBoneQuaternion,
|
|
||||||
R_StudioCalcBonePosition,
|
|
||||||
R_StudioGetAnim,
|
R_StudioGetAnim,
|
||||||
pfnStudioEvent,
|
pfnStudioEvent,
|
||||||
|
|
||||||
@@ -329,11 +320,6 @@ static ref_api_t gEngfuncs =
|
|||||||
COM_FreeLibrary,
|
COM_FreeLibrary,
|
||||||
COM_GetProcAddress,
|
COM_GetProcAddress,
|
||||||
|
|
||||||
FS_LoadFile,
|
|
||||||
COM_ParseFile,
|
|
||||||
FS_FileExists,
|
|
||||||
FS_AllowDirectPaths,
|
|
||||||
|
|
||||||
R_Init_Video_,
|
R_Init_Video_,
|
||||||
R_Free_Video,
|
R_Free_Video,
|
||||||
|
|
||||||
@@ -359,7 +345,7 @@ static ref_api_t gEngfuncs =
|
|||||||
|
|
||||||
pfnGetPhysent,
|
pfnGetPhysent,
|
||||||
pfnTraceSurface,
|
pfnTraceSurface,
|
||||||
PM_TraceLine,
|
PM_CL_TraceLine,
|
||||||
CL_VisTraceLine,
|
CL_VisTraceLine,
|
||||||
CL_TraceLine,
|
CL_TraceLine,
|
||||||
pfnGetMoveVars,
|
pfnGetMoveVars,
|
||||||
@@ -379,7 +365,9 @@ static ref_api_t gEngfuncs =
|
|||||||
|
|
||||||
pfnDrawNormalTriangles,
|
pfnDrawNormalTriangles,
|
||||||
pfnDrawTransparentTriangles,
|
pfnDrawTransparentTriangles,
|
||||||
&clgame.drawFuncs
|
&clgame.drawFuncs,
|
||||||
|
|
||||||
|
&g_fsapi,
|
||||||
};
|
};
|
||||||
|
|
||||||
static void R_UnloadProgs( void )
|
static void R_UnloadProgs( void )
|
||||||
@@ -503,7 +491,7 @@ void R_Shutdown( void )
|
|||||||
|
|
||||||
static void R_GetRendererName( char *dest, size_t size, const char *opt )
|
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;
|
const char *format;
|
||||||
|
|
||||||
@@ -524,7 +512,7 @@ static void R_GetRendererName( char *dest, size_t size, const char *opt )
|
|||||||
else
|
else
|
||||||
{
|
{
|
||||||
// full path
|
// full path
|
||||||
Q_strcpy( dest, opt );
|
Q_strncpy( dest, opt, size );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -567,81 +555,99 @@ static void SetWidthAndHeightFromCommandLine( void )
|
|||||||
static void SetFullscreenModeFromCommandLine( void )
|
static void SetFullscreenModeFromCommandLine( void )
|
||||||
{
|
{
|
||||||
#if !XASH_MOBILE_PLATFORM
|
#if !XASH_MOBILE_PLATFORM
|
||||||
if ( Sys_CheckParm("-fullscreen") )
|
if( Sys_CheckParm( "-fullscreen" ))
|
||||||
{
|
{
|
||||||
Cvar_Set( "fullscreen", "1" );
|
Cvar_Set( "fullscreen", "1" );
|
||||||
}
|
}
|
||||||
else if ( Sys_CheckParm( "-windowed" ) )
|
else if( Sys_CheckParm( "-windowed" ))
|
||||||
{
|
{
|
||||||
Cvar_Set( "fullscreen", "0" );
|
Cvar_Set( "fullscreen", "0" );
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
void R_CollectRendererNames( void )
|
static void R_CollectRendererNames( void )
|
||||||
{
|
{
|
||||||
const char *renderers[] = DEFAULT_RENDERERS;
|
// ordering is important!
|
||||||
int i;
|
static const char *shortNames[] =
|
||||||
|
|
||||||
ref.numRenderers = 0;
|
|
||||||
|
|
||||||
for( i = 0; i < DEFAULT_RENDERERS_LEN; i++ )
|
|
||||||
{
|
{
|
||||||
string temp;
|
#if XASH_REF_GL_ENABLED
|
||||||
void *dll, *pfn;
|
"gl",
|
||||||
|
#endif
|
||||||
|
#if XASH_REF_NANOGL_ENABLED
|
||||||
|
"gles1",
|
||||||
|
#endif
|
||||||
|
#if XASH_REF_GLWES_ENABLED
|
||||||
|
"gles2",
|
||||||
|
#endif
|
||||||
|
#if XASH_REF_GL4ES_ENABLED
|
||||||
|
"gl4es",
|
||||||
|
#endif
|
||||||
|
#if XASH_REF_SOFT_ENABLED
|
||||||
|
"soft",
|
||||||
|
#endif
|
||||||
|
};
|
||||||
|
|
||||||
R_GetRendererName( temp, sizeof( temp ), renderers[i] );
|
// ordering is important here too!
|
||||||
|
static const char *readableNames[ARRAYSIZE( shortNames )] =
|
||||||
|
{
|
||||||
|
#if XASH_REF_GL_ENABLED
|
||||||
|
"OpenGL",
|
||||||
|
#endif
|
||||||
|
#if XASH_REF_NANOGL_ENABLED
|
||||||
|
"GLES1 (NanoGL)",
|
||||||
|
#endif
|
||||||
|
#if XASH_REF_GLWES_ENABLED
|
||||||
|
"GLES2 (gl-wes-v2)",
|
||||||
|
#endif
|
||||||
|
#if XASH_REF_GL4ES_ENABLED
|
||||||
|
"GL4ES",
|
||||||
|
#endif
|
||||||
|
#if XASH_REF_SOFT_ENABLED
|
||||||
|
"Software",
|
||||||
|
#endif
|
||||||
|
};
|
||||||
|
|
||||||
dll = COM_LoadLibrary( temp, false, true );
|
ref.numRenderers = ARRAYSIZE( shortNames );
|
||||||
if( !dll )
|
ref.shortNames = shortNames;
|
||||||
{
|
ref.readableNames = readableNames;
|
||||||
Con_Reportf( "R_CollectRendererNames: can't load library %s: %s\n", temp, COM_GetLibraryError() );
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
|
|
||||||
pfn = COM_GetProcAddress( dll, GET_REF_API );
|
|
||||||
if( !pfn )
|
|
||||||
{
|
|
||||||
Con_Reportf( "R_CollectRendererNames: can't find API entry point in %s\n", temp );
|
|
||||||
COM_FreeLibrary( dll );
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
|
|
||||||
Q_strncpy( ref.shortNames[i], renderers[i], sizeof( ref.shortNames[i] ));
|
|
||||||
|
|
||||||
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] ));
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
REF_HUMANREADABLE_NAME GetHumanReadableName = (REF_HUMANREADABLE_NAME)pfn;
|
|
||||||
|
|
||||||
GetHumanReadableName( ref.readableNames[i], sizeof( ref.readableNames[i] ));
|
|
||||||
}
|
|
||||||
|
|
||||||
Con_Printf( "Found renderer %s: %s\n", ref.shortNames[i], ref.readableNames[i] );
|
|
||||||
|
|
||||||
ref.numRenderers++;
|
|
||||||
COM_FreeLibrary( dll );
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
qboolean R_Init( void )
|
qboolean R_Init( void )
|
||||||
{
|
{
|
||||||
qboolean success = false;
|
qboolean success = false;
|
||||||
string refopt;
|
string requested;
|
||||||
|
|
||||||
gl_vsync = Cvar_Get( "gl_vsync", "0", FCVAR_ARCHIVE, "enable vertical syncronization" );
|
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" );
|
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_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" );
|
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" );
|
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_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" );
|
r_refdll = Cvar_Get( "r_refdll", "", FCVAR_RENDERINFO, "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
|
// cvars are created, execute video config
|
||||||
Cbuf_AddText( "exec video.cfg" );
|
Cbuf_AddText( "exec video.cfg" );
|
||||||
@@ -654,27 +660,32 @@ qboolean R_Init( void )
|
|||||||
|
|
||||||
R_CollectRendererNames();
|
R_CollectRendererNames();
|
||||||
|
|
||||||
// command line have priority
|
// Priority:
|
||||||
if( !Sys_GetParmFromCmdLine( "-ref", refopt ) )
|
// 1. Command line `-ref` argument.
|
||||||
|
// 2. `ref_dll` cvar.
|
||||||
|
// 3. Detected renderers in `DEFAULT_RENDERERS` order.
|
||||||
|
requested[0] = 0;
|
||||||
|
|
||||||
|
if( !success && Sys_GetParmFromCmdLine( "-ref", requested ))
|
||||||
|
success = R_LoadRenderer( requested );
|
||||||
|
|
||||||
|
if( !success && COM_CheckString( r_refdll->string ))
|
||||||
{
|
{
|
||||||
// r_refdll is set to empty by default, so we can change hardcoded defaults just in case
|
Q_strncpy( requested, r_refdll->string, sizeof( requested ));
|
||||||
Q_strncpy( refopt, COM_CheckString( r_refdll->string ) ?
|
success = R_LoadRenderer( requested );
|
||||||
r_refdll->string : DEFAULT_ACCELERATED_RENDERER, sizeof( refopt ) );
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if( !(success = R_LoadRenderer( refopt )))
|
if( !success )
|
||||||
{
|
{
|
||||||
// check if we are tried to load default accelearated renderer already
|
int i;
|
||||||
// and if not, load it first
|
|
||||||
if( Q_strcmp( refopt, DEFAULT_ACCELERATED_RENDERER ) )
|
|
||||||
{
|
|
||||||
success = R_LoadRenderer( refopt );
|
|
||||||
}
|
|
||||||
|
|
||||||
// software renderer is the last chance...
|
for( i = 0; i < ref.numRenderers && !success; i++ )
|
||||||
if( !success )
|
|
||||||
{
|
{
|
||||||
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] );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -27,9 +27,10 @@ struct ref_state_s
|
|||||||
HINSTANCE hInstance;
|
HINSTANCE hInstance;
|
||||||
ref_interface_t dllFuncs;
|
ref_interface_t dllFuncs;
|
||||||
|
|
||||||
|
// depends on build configuration
|
||||||
int numRenderers;
|
int numRenderers;
|
||||||
string shortNames[DEFAULT_RENDERERS_LEN];
|
const char **shortNames;
|
||||||
string readableNames[DEFAULT_RENDERERS_LEN];
|
const char **readableNames;
|
||||||
};
|
};
|
||||||
|
|
||||||
extern struct ref_state_s ref;
|
extern struct ref_state_s ref;
|
||||||
@@ -51,5 +52,8 @@ extern convar_t *gl_clear;
|
|||||||
|
|
||||||
qboolean R_Init( void );
|
qboolean R_Init( void );
|
||||||
void R_Shutdown( void );
|
void R_Shutdown( void );
|
||||||
|
void R_UpdateRefState( void );
|
||||||
|
|
||||||
|
extern triangleapi_t gTriApi;
|
||||||
|
|
||||||
#endif // REF_COMMON_H
|
#endif // REF_COMMON_H
|
||||||
|
|||||||
@@ -33,7 +33,6 @@ GNU General Public License for more details.
|
|||||||
|
|
||||||
#define MAXDLY (STEREODLY + 1)
|
#define MAXDLY (STEREODLY + 1)
|
||||||
#define MAXLP 10
|
#define MAXLP 10
|
||||||
#define MAXPRESETS 29
|
|
||||||
|
|
||||||
typedef struct sx_preset_s
|
typedef struct sx_preset_s
|
||||||
{
|
{
|
||||||
@@ -79,7 +78,7 @@ typedef struct dly_s
|
|||||||
int *lpdelayline;
|
int *lpdelayline;
|
||||||
} dly_t;
|
} dly_t;
|
||||||
|
|
||||||
const sx_preset_t rgsxpre[MAXPRESETS] =
|
const sx_preset_t rgsxpre[] =
|
||||||
{
|
{
|
||||||
// -------reverb-------- -------delay--------
|
// -------reverb-------- -------delay--------
|
||||||
// lp mod size refl rvblp delay feedback dlylp left
|
// 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
|
{ 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
|
// cvars
|
||||||
convar_t *dsp_off; // disable dsp
|
convar_t *dsp_off; // disable dsp
|
||||||
convar_t *roomwater_type; // water room_type
|
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 *sxdly_delay; // current delay in seconds
|
||||||
|
|
||||||
convar_t *dsp_room; // for compability
|
convar_t *dsp_room; // for compability
|
||||||
|
|
||||||
|
convar_t *dsp_coeff_table; // use release or 0.52 style
|
||||||
int idsp_dma_speed;
|
int idsp_dma_speed;
|
||||||
int idsp_room;
|
int idsp_room;
|
||||||
int room_typeprev;
|
int room_typeprev;
|
||||||
@@ -194,6 +234,8 @@ void SX_Init( void )
|
|||||||
sxmod2cur = sxmod2 = 450 * ( idsp_dma_speed / SOUND_11k );
|
sxmod2cur = sxmod2 = 450 * ( idsp_dma_speed / SOUND_11k );
|
||||||
|
|
||||||
dsp_off = Cvar_Get( "dsp_off", "0", FCVAR_ARCHIVE, "disable DSP processing" );
|
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" );
|
roomwater_type = Cvar_Get( "waterroom_type", "14", 0, "water room type" );
|
||||||
room_type = Cvar_Get( "room_type", "0", 0, "current room type preset" );
|
room_type = Cvar_Get( "room_type", "0", 0, "current room type preset" );
|
||||||
|
|
||||||
@@ -352,8 +394,6 @@ void DLY_CheckNewStereoDelayVal( void )
|
|||||||
if( dly->delaysamples == 0 )
|
if( dly->delaysamples == 0 )
|
||||||
DLY_Free( STEREODLY );
|
DLY_Free( STEREODLY );
|
||||||
}
|
}
|
||||||
|
|
||||||
ClearBits( sxste_delay->flags, FCVAR_CHANGED );
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
@@ -441,7 +481,7 @@ void DLY_CheckNewDelayVal( void )
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
delay = min( delay, MAX_MONO_DELAY );
|
delay = Q_min( delay, MAX_MONO_DELAY );
|
||||||
dly->delaysamples = (int)(delay * idsp_dma_speed) << sxhires;
|
dly->delaysamples = (int)(delay * idsp_dma_speed) << sxhires;
|
||||||
|
|
||||||
// init dly
|
// init dly
|
||||||
@@ -463,7 +503,6 @@ void DLY_CheckNewDelayVal( void )
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
ClearBits( sxdly_delay->flags, FCVAR_CHANGED );
|
|
||||||
dly->lp = sxdly_lp->value;
|
dly->lp = sxdly_lp->value;
|
||||||
dly->delayfeedback = 255 * sxdly_feedback->value;
|
dly->delayfeedback = 255 * sxdly_feedback->value;
|
||||||
}
|
}
|
||||||
@@ -497,9 +536,9 @@ void DLY_DoDelay( int count )
|
|||||||
|
|
||||||
if( dly->lp ) // lowpass
|
if( dly->lp ) // lowpass
|
||||||
{
|
{
|
||||||
|
val = ( dly->lp0 + dly->lp1 + val ) / 3;
|
||||||
dly->lp0 = dly->lp1;
|
dly->lp0 = dly->lp1;
|
||||||
dly->lp1 = val;
|
dly->lp1 = val;
|
||||||
val = ( dly->lp0 + dly->lp1 + (val << 1) ) >> 2;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
dly->lpdelayline[dly->idelayinput] = val;
|
dly->lpdelayline[dly->idelayinput] = val;
|
||||||
@@ -512,7 +551,7 @@ void DLY_DoDelay( int count )
|
|||||||
else
|
else
|
||||||
{
|
{
|
||||||
dly->lpdelayline[dly->idelayinput] = 0;
|
dly->lpdelayline[dly->idelayinput] = 0;
|
||||||
dly->lp0 = dly->lp1 = 0;
|
dly->lp0 = dly->lp1 = dly->lp2 = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
DLY_MovePointer( dly );
|
DLY_MovePointer( dly );
|
||||||
@@ -547,7 +586,7 @@ void RVB_SetUpDly( int pos, float delay, int kmod )
|
|||||||
rgsxdly[pos].idelayoutputxf = rgsxdly[pos].idelayinput - samples;
|
rgsxdly[pos].idelayoutputxf = rgsxdly[pos].idelayinput - samples;
|
||||||
if( rgsxdly[pos].idelayoutputxf < 0 )
|
if( rgsxdly[pos].idelayoutputxf < 0 )
|
||||||
rgsxdly[pos].idelayoutputxf += rgsxdly[pos].cdelaysamplesmax;
|
rgsxdly[pos].idelayoutputxf += rgsxdly[pos].cdelaysamplesmax;
|
||||||
rgsxdly[pos].xfade = 32;
|
rgsxdly[pos].xfade = REVERB_XFADE;
|
||||||
}
|
}
|
||||||
|
|
||||||
if( !rgsxdly[pos].delaysamples )
|
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->lp = dly2->lp = sxrvb_lp->value;
|
||||||
dly1->delayfeedback = dly2->delayfeedback = (int)(255 * sxrvb_feedback->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 )
|
if( dly->xfade || delay || samplepair->left || samplepair->right )
|
||||||
{
|
{
|
||||||
// modulate delay rate
|
// modulate delay rate
|
||||||
if( !dly->xfade && !dly->modcur && dly->mod )
|
if( !dly->mod )
|
||||||
{
|
{
|
||||||
dly->idelayoutputxf = dly->idelayoutput + ((COM_RandomLong( 0, 255 ) * delay) >> 9 );
|
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 )
|
if( dly->xfade )
|
||||||
{
|
{
|
||||||
@@ -685,7 +723,9 @@ void RVB_DoReverb( int count )
|
|||||||
voutm = RVB_DoReverbForOneDly( dly1, vlr, paint );
|
voutm = RVB_DoReverbForOneDly( dly1, vlr, paint );
|
||||||
voutm += RVB_DoReverbForOneDly( dly2, 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->left = CLIP( paint->left + voutm );
|
||||||
paint->right = CLIP( paint->right + voutm );
|
paint->right = CLIP( paint->right + voutm );
|
||||||
@@ -718,17 +758,18 @@ void RVB_DoAMod( int count )
|
|||||||
res.left >>= 2;
|
res.left >>= 2;
|
||||||
res.right >>= 2;
|
res.right >>= 2;
|
||||||
|
|
||||||
|
rgsxlp[4] = paint->left;
|
||||||
|
rgsxlp[9] = paint->right;
|
||||||
|
|
||||||
rgsxlp[0] = rgsxlp[1];
|
rgsxlp[0] = rgsxlp[1];
|
||||||
rgsxlp[1] = rgsxlp[2];
|
rgsxlp[1] = rgsxlp[2];
|
||||||
rgsxlp[2] = rgsxlp[3];
|
rgsxlp[2] = rgsxlp[3];
|
||||||
rgsxlp[3] = rgsxlp[4];
|
rgsxlp[3] = rgsxlp[4];
|
||||||
rgsxlp[4] = paint->left;
|
rgsxlp[4] = rgsxlp[5];
|
||||||
|
|
||||||
rgsxlp[5] = rgsxlp[6];
|
rgsxlp[5] = rgsxlp[6];
|
||||||
rgsxlp[6] = rgsxlp[7];
|
rgsxlp[6] = rgsxlp[7];
|
||||||
rgsxlp[7] = rgsxlp[8];
|
rgsxlp[7] = rgsxlp[8];
|
||||||
rgsxlp[8] = rgsxlp[9];
|
rgsxlp[8] = rgsxlp[9];
|
||||||
rgsxlp[9] = paint->right;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if( sxmod_mod->value )
|
if( sxmod_mod->value )
|
||||||
@@ -814,12 +855,33 @@ void CheckNewDspPresets( void )
|
|||||||
if( dsp_off->value != 0.0f )
|
if( dsp_off->value != 0.0f )
|
||||||
return;
|
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 )
|
if( s_listener.waterlevel > 2 )
|
||||||
idsp_room = roomwater_type->value;
|
idsp_room = roomwater_type->value;
|
||||||
else idsp_room = room_type->value;
|
else idsp_room = room_type->value;
|
||||||
|
|
||||||
// don't pass invalid presets
|
// 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 ))
|
if( FBitSet( hisound->flags, FCVAR_CHANGED ))
|
||||||
{
|
{
|
||||||
@@ -830,12 +892,11 @@ void CheckNewDspPresets( void )
|
|||||||
if( idsp_room == room_typeprev && idsp_room == 0 )
|
if( idsp_room == room_typeprev && idsp_room == 0 )
|
||||||
return;
|
return;
|
||||||
|
|
||||||
if( idsp_room > MAX_ROOM_TYPES )
|
|
||||||
return;
|
|
||||||
|
|
||||||
if( idsp_room != room_typeprev )
|
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_lp", cur->room_lp );
|
||||||
Cvar_SetValue( "room_mod", cur->room_mod );
|
Cvar_SetValue( "room_mod", cur->room_mod );
|
||||||
@@ -853,6 +914,10 @@ void CheckNewDspPresets( void )
|
|||||||
RVB_CheckNewReverbVal( );
|
RVB_CheckNewReverbVal( );
|
||||||
DLY_CheckNewDelayVal( );
|
DLY_CheckNewDelayVal( );
|
||||||
DLY_CheckNewStereoDelayVal();
|
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 )
|
void SX_Profiling_f( void )
|
||||||
|
|||||||
@@ -14,6 +14,7 @@ GNU General Public License for more details.
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
#include "common.h"
|
#include "common.h"
|
||||||
|
#include "client.h"
|
||||||
#include "sound.h"
|
#include "sound.h"
|
||||||
|
|
||||||
// during registration it is possible to have more sounds
|
// during registration it is possible to have more sounds
|
||||||
@@ -28,7 +29,6 @@ static sfx_t s_knownSfx[MAX_SFX];
|
|||||||
static sfx_t *s_sfxHashList[MAX_SFX_HASH];
|
static sfx_t *s_sfxHashList[MAX_SFX_HASH];
|
||||||
static string s_sentenceImmediateName; // keep dummy sentence name
|
static string s_sentenceImmediateName; // keep dummy sentence name
|
||||||
qboolean s_registering = false;
|
qboolean s_registering = false;
|
||||||
int s_registration_sequence = 0;
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
=================
|
=================
|
||||||
@@ -54,9 +54,9 @@ void S_SoundList_f( void )
|
|||||||
|
|
||||||
if( sc->loopStart >= 0 ) Con_Printf( "L" );
|
if( sc->loopStart >= 0 ) Con_Printf( "L" );
|
||||||
else Con_Printf( " " );
|
else Con_Printf( " " );
|
||||||
if( sfx->name[0] == '*' )
|
if( sfx->name[0] == '*' || !Q_strncmp( sfx->name, DEFAULT_SOUNDPATH, sizeof( DEFAULT_SOUNDPATH ) - 1 ))
|
||||||
Con_Printf( " (%2db) %s : %s\n", sc->width * 8, Q_memprint( sc->size ), sfx->name );
|
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++;
|
totalSfx++;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -141,6 +141,9 @@ wavdata_t *S_LoadSound( sfx_t *sfx )
|
|||||||
if( Q_stricmp( sfx->name, "*default" ))
|
if( Q_stricmp( sfx->name, "*default" ))
|
||||||
{
|
{
|
||||||
// load it from disk
|
// 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] == '*' )
|
if( sfx->name[0] == '*' )
|
||||||
sc = FS_LoadSound( sfx->name + 1, NULL, 0 );
|
sc = FS_LoadSound( sfx->name + 1, NULL, 0 );
|
||||||
else sc = FS_LoadSound( sfx->name, NULL, 0 );
|
else sc = FS_LoadSound( sfx->name, NULL, 0 );
|
||||||
@@ -196,7 +199,7 @@ sfx_t *S_FindName( const char *pname, int *pfInCache )
|
|||||||
*pfInCache = ( sfx->cache != NULL ) ? true : false;
|
*pfInCache = ( sfx->cache != NULL ) ? true : false;
|
||||||
}
|
}
|
||||||
// prolonge registration
|
// prolonge registration
|
||||||
sfx->servercount = s_registration_sequence;
|
sfx->servercount = cl.servercount;
|
||||||
return sfx;
|
return sfx;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -216,7 +219,7 @@ sfx_t *S_FindName( const char *pname, int *pfInCache )
|
|||||||
memset( sfx, 0, sizeof( *sfx ));
|
memset( sfx, 0, sizeof( *sfx ));
|
||||||
if( pfInCache ) *pfInCache = false;
|
if( pfInCache ) *pfInCache = false;
|
||||||
Q_strncpy( sfx->name, name, MAX_STRING );
|
Q_strncpy( sfx->name, name, MAX_STRING );
|
||||||
sfx->servercount = s_registration_sequence;
|
sfx->servercount = cl.servercount;
|
||||||
sfx->hashValue = COM_HashKey( sfx->name, MAX_SFX_HASH );
|
sfx->hashValue = COM_HashKey( sfx->name, MAX_SFX_HASH );
|
||||||
|
|
||||||
// link it in
|
// link it in
|
||||||
@@ -270,7 +273,6 @@ void S_BeginRegistration( void )
|
|||||||
{
|
{
|
||||||
int i;
|
int i;
|
||||||
|
|
||||||
s_registration_sequence++;
|
|
||||||
snd_ambient = false;
|
snd_ambient = false;
|
||||||
|
|
||||||
// check for automatic ambient sounds
|
// check for automatic ambient sounds
|
||||||
@@ -306,7 +308,7 @@ void S_EndRegistration( void )
|
|||||||
if( !sfx->name[0] || !Q_stricmp( sfx->name, "*default" ))
|
if( !sfx->name[0] || !Q_stricmp( sfx->name, "*default" ))
|
||||||
continue; // don't release default sound
|
continue; // don't release default sound
|
||||||
|
|
||||||
if( sfx->servercount != s_registration_sequence )
|
if( sfx->servercount != cl.servercount )
|
||||||
S_FreeSound( sfx ); // don't need this sound
|
S_FreeSound( sfx ); // don't need this sound
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -346,7 +348,7 @@ sound_t S_RegisterSound( const char *name )
|
|||||||
sfx = S_FindName( name, NULL );
|
sfx = S_FindName( name, NULL );
|
||||||
if( !sfx ) return -1;
|
if( !sfx ) return -1;
|
||||||
|
|
||||||
sfx->servercount = s_registration_sequence;
|
sfx->servercount = cl.servercount;
|
||||||
if( !s_registering ) S_LoadSound( sfx );
|
if( !s_registering ) S_LoadSound( sfx );
|
||||||
|
|
||||||
return sfx - s_knownSfx;
|
return sfx - s_knownSfx;
|
||||||
|
|||||||
@@ -23,7 +23,7 @@ GNU General Public License for more details.
|
|||||||
#define SND_CLIP_DISTANCE 1000.0f
|
#define SND_CLIP_DISTANCE 1000.0f
|
||||||
|
|
||||||
dma_t dma;
|
dma_t dma;
|
||||||
byte *sndpool;
|
poolhandle_t sndpool;
|
||||||
static soundfade_t soundfade;
|
static soundfade_t soundfade;
|
||||||
channel_t channels[MAX_CHANNELS];
|
channel_t channels[MAX_CHANNELS];
|
||||||
sound_t ambient_sfx[NUM_AMBIENTS];
|
sound_t ambient_sfx[NUM_AMBIENTS];
|
||||||
@@ -35,17 +35,18 @@ int total_channels;
|
|||||||
int soundtime; // sample PAIRS
|
int soundtime; // sample PAIRS
|
||||||
int paintedtime; // sample PAIRS
|
int paintedtime; // sample PAIRS
|
||||||
|
|
||||||
convar_t *s_volume;
|
static CVAR_DEFINE( s_volume, "volume", "0.7", FCVAR_ARCHIVE|FCVAR_FILTERABLE, "sound volume" );
|
||||||
convar_t *s_musicvolume;
|
CVAR_DEFINE( s_musicvolume, "MP3Volume", "1.0", FCVAR_ARCHIVE|FCVAR_FILTERABLE, "background music volume" );
|
||||||
convar_t *s_show;
|
static CVAR_DEFINE( s_mixahead, "_snd_mixahead", "0.12", FCVAR_FILTERABLE, "how much sound to mix ahead of time" );
|
||||||
convar_t *s_mixahead;
|
static CVAR_DEFINE_AUTO( s_show, "0", FCVAR_ARCHIVE|FCVAR_FILTERABLE, "show playing sounds" );
|
||||||
convar_t *s_lerping;
|
CVAR_DEFINE_AUTO( s_lerping, "0", FCVAR_ARCHIVE|FCVAR_FILTERABLE, "apply interpolation to sound output" );
|
||||||
convar_t *s_ambient_level;
|
static CVAR_DEFINE( s_ambient_level, "ambient_level", "0.3", FCVAR_ARCHIVE|FCVAR_FILTERABLE, "volume of environment noises (water and wind)" );
|
||||||
convar_t *s_ambient_fade;
|
static CVAR_DEFINE( s_ambient_fade, "ambient_fade", "1000", FCVAR_ARCHIVE|FCVAR_FILTERABLE, "rate of volume fading when client is moving" );
|
||||||
convar_t *s_combine_sounds;
|
static CVAR_DEFINE_AUTO( s_combine_sounds, "0", FCVAR_ARCHIVE|FCVAR_FILTERABLE, "combine channels with same sounds" );
|
||||||
convar_t *snd_mute_losefocus;
|
CVAR_DEFINE_AUTO( snd_mute_losefocus, "1", FCVAR_ARCHIVE|FCVAR_FILTERABLE, "silence the audio when game window loses focus" );
|
||||||
convar_t *s_test; // cvar for testing new effects
|
CVAR_DEFINE_AUTO( s_test, "0", 0, "engine developer cvar for quick testing new features" );
|
||||||
convar_t *s_samplecount;
|
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 = bound( 0.0f, soundfade.percent / 100.0f, 1.0f );
|
||||||
scale = 1.0f - scale;
|
scale = 1.0f - scale;
|
||||||
}
|
}
|
||||||
return s_volume->value * scale;
|
return s_volume.value * scale;
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
@@ -158,7 +159,7 @@ void S_UpdateSoundFade( void )
|
|||||||
}
|
}
|
||||||
|
|
||||||
// spline it.
|
// spline it.
|
||||||
f = SimpleSpline( f );
|
f = -( cos( M_PI * f ) - 1 ) / 2;
|
||||||
f = bound( 0.0f, f, 1.0f );
|
f = bound( 0.0f, f, 1.0f );
|
||||||
|
|
||||||
soundfade.percent = soundfade.initial_percent * f;
|
soundfade.percent = soundfade.initial_percent * f;
|
||||||
@@ -196,6 +197,65 @@ qboolean SND_FStreamIsPlaying( sfx_t *sfx )
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
=================
|
||||||
|
SND_GetChannelTimeLeft
|
||||||
|
|
||||||
|
TODO: this function needs to be removed after whole sound subsystem rewrite
|
||||||
|
=================
|
||||||
|
*/
|
||||||
|
static int SND_GetChannelTimeLeft( const channel_t *ch )
|
||||||
|
{
|
||||||
|
int remaining;
|
||||||
|
|
||||||
|
if( ch->pMixer.finished || !ch->sfx || !ch->sfx->cache )
|
||||||
|
return 0;
|
||||||
|
|
||||||
|
if( ch->isSentence ) // sentences are special, count all remaining words
|
||||||
|
{
|
||||||
|
int i;
|
||||||
|
|
||||||
|
if( !ch->currentWord )
|
||||||
|
return 0;
|
||||||
|
|
||||||
|
// current word
|
||||||
|
remaining = ch->currentWord->forcedEndSample - ch->currentWord->sample;
|
||||||
|
|
||||||
|
// here we count all remaining words, stopping if no sfx or sound file is available
|
||||||
|
// see VOX_LoadWord
|
||||||
|
for( i = ch->wordIndex + 1; i < ARRAYSIZE( ch->words ); i++ )
|
||||||
|
{
|
||||||
|
wavdata_t *sc;
|
||||||
|
int end;
|
||||||
|
|
||||||
|
// don't continue with broken sentences
|
||||||
|
if( !ch->words[i].sfx )
|
||||||
|
break;
|
||||||
|
|
||||||
|
if( !( sc = S_LoadSound( ch->words[i].sfx )))
|
||||||
|
break;
|
||||||
|
|
||||||
|
end = ch->words[i].end;
|
||||||
|
|
||||||
|
if( end )
|
||||||
|
remaining += sc->samples * 0.01f * end;
|
||||||
|
else remaining += sc->samples;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
int curpos;
|
||||||
|
int samples;
|
||||||
|
|
||||||
|
// handle position looping
|
||||||
|
samples = ch->sfx->cache->samples;
|
||||||
|
curpos = S_ConvertLoopedPosition( ch->sfx->cache, ch->pMixer.sample, ch->use_loop );
|
||||||
|
remaining = bound( 0, samples - curpos, samples );
|
||||||
|
}
|
||||||
|
|
||||||
|
return remaining;
|
||||||
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
=================
|
=================
|
||||||
SND_PickDynamicChannel
|
SND_PickDynamicChannel
|
||||||
@@ -245,11 +305,7 @@ channel_t *SND_PickDynamicChannel( int entnum, int channel, sfx_t *sfx, qboolean
|
|||||||
continue;
|
continue;
|
||||||
|
|
||||||
// try to pick the sound with the least amount of data left to play
|
// try to pick the sound with the least amount of data left to play
|
||||||
timeleft = 0;
|
timeleft = SND_GetChannelTimeLeft( ch );
|
||||||
if( ch->sfx )
|
|
||||||
{
|
|
||||||
timeleft = 1; // ch->end - paintedtime
|
|
||||||
}
|
|
||||||
|
|
||||||
if( timeleft < life_left )
|
if( timeleft < life_left )
|
||||||
{
|
{
|
||||||
@@ -525,7 +581,7 @@ void S_StartSound( const vec3_t pos, int ent, int chan, sound_t handle, float fv
|
|||||||
if( !target_chan )
|
if( !target_chan )
|
||||||
{
|
{
|
||||||
if( !bIgnore )
|
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;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -637,7 +693,7 @@ void S_RestoreSound( const vec3_t pos, int ent, int chan, sound_t handle, float
|
|||||||
if( !target_chan )
|
if( !target_chan )
|
||||||
{
|
{
|
||||||
if( !bIgnore )
|
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;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -787,6 +843,8 @@ void S_AmbientSound( const vec3_t pos, int ent, sound_t handle, float fvol, floa
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
pitch *= (sys_timescale.value + 1) / 2;
|
||||||
|
|
||||||
// never update positions if source entity is 0
|
// never update positions if source entity is 0
|
||||||
ch->staticsound = ( ent == 0 ) ? true : false;
|
ch->staticsound = ( ent == 0 ) ? true : false;
|
||||||
ch->use_loop = (flags & SND_STOP_LOOPING) ? false : true;
|
ch->use_loop = (flags & SND_STOP_LOOPING) ? false : true;
|
||||||
@@ -945,7 +1003,7 @@ void S_UpdateAmbientSounds( void )
|
|||||||
|
|
||||||
leaf = Mod_PointInLeaf( s_listener.origin, cl.worldmodel->nodes );
|
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++ )
|
for( ambient_channel = 0; ambient_channel < NUM_AMBIENTS; ambient_channel++ )
|
||||||
channels[ambient_channel].sfx = NULL;
|
channels[ambient_channel].sfx = NULL;
|
||||||
@@ -965,18 +1023,18 @@ void S_UpdateAmbientSounds( void )
|
|||||||
continue;
|
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;
|
if( vol < 0 ) vol = 0;
|
||||||
|
|
||||||
// don't adjust volume too fast
|
// don't adjust volume too fast
|
||||||
if( chan->master_vol < vol )
|
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;
|
if( chan->master_vol > vol ) chan->master_vol = vol;
|
||||||
}
|
}
|
||||||
else if( 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;
|
if( chan->master_vol < vol ) chan->master_vol = vol;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1124,7 +1182,7 @@ static uint S_RawSamplesStereo( portable_samplepair_t *rawsamples, uint rawend,
|
|||||||
S_RawEntSamples
|
S_RawEntSamples
|
||||||
===================
|
===================
|
||||||
*/
|
*/
|
||||||
static void S_RawEntSamples( int entnum, uint samples, uint rate, word width, word channels, const byte *data, int snd_vol )
|
void S_RawEntSamples( int entnum, uint samples, uint rate, word width, word channels, const byte *data, int snd_vol )
|
||||||
{
|
{
|
||||||
rawchan_t *ch;
|
rawchan_t *ch;
|
||||||
|
|
||||||
@@ -1150,7 +1208,6 @@ void S_RawSamples( uint samples, uint rate, word width, word channels, const byt
|
|||||||
int snd_vol = 128;
|
int snd_vol = 128;
|
||||||
|
|
||||||
if( entnum < 0 ) snd_vol = 256; // bg track or movie track
|
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 );
|
S_RawEntSamples( entnum, samples, rate, width, channels, data, snd_vol );
|
||||||
}
|
}
|
||||||
@@ -1192,7 +1249,7 @@ void S_StreamAviSamples( void *Avi, int entnum, float fvol, float attn, float sy
|
|||||||
ch->s_rawend = soundtime;
|
ch->s_rawend = soundtime;
|
||||||
|
|
||||||
// position is changed, synchronization is lost etc
|
// 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->sound_info.loopStart = AVI_TimeToSoundPosition( Avi, synctime * 1000 );
|
||||||
ch->oldtime = synctime; // keep actual time
|
ch->oldtime = synctime; // keep actual time
|
||||||
|
|
||||||
@@ -1235,36 +1292,6 @@ void S_StreamAviSamples( void *Avi, int entnum, float fvol, float attn, float sy
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
|
||||||
===================
|
|
||||||
S_GetRawSamplesLength
|
|
||||||
===================
|
|
||||||
*/
|
|
||||||
uint S_GetRawSamplesLength( int entnum )
|
|
||||||
{
|
|
||||||
rawchan_t *ch;
|
|
||||||
|
|
||||||
if( !( ch = S_FindRawChannel( entnum, false )))
|
|
||||||
return 0;
|
|
||||||
|
|
||||||
return ch->s_rawend <= paintedtime ? 0 : (float)(ch->s_rawend - paintedtime) * DMA_MSEC_PER_SAMPLE;
|
|
||||||
}
|
|
||||||
|
|
||||||
/*
|
|
||||||
===================
|
|
||||||
S_ClearRawChannel
|
|
||||||
===================
|
|
||||||
*/
|
|
||||||
void S_ClearRawChannel( int entnum )
|
|
||||||
{
|
|
||||||
rawchan_t *ch;
|
|
||||||
|
|
||||||
if( !( ch = S_FindRawChannel( entnum, false )))
|
|
||||||
return;
|
|
||||||
|
|
||||||
ch->s_rawend = 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
===================
|
===================
|
||||||
S_FreeIdleRawChannels
|
S_FreeIdleRawChannels
|
||||||
@@ -1285,6 +1312,9 @@ static void S_FreeIdleRawChannels( void )
|
|||||||
if( ch->s_rawend >= paintedtime )
|
if( ch->s_rawend >= paintedtime )
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
|
if ( ch->entnum > 0 )
|
||||||
|
SND_ForceCloseMouth( ch->entnum );
|
||||||
|
|
||||||
if(( paintedtime - ch->s_rawend ) / SOUND_DMA_SPEED >= S_RAW_SOUND_IDLE_SEC )
|
if(( paintedtime - ch->s_rawend ) / SOUND_DMA_SPEED >= S_RAW_SOUND_IDLE_SEC )
|
||||||
{
|
{
|
||||||
raw_channels[i] = NULL;
|
raw_channels[i] = NULL;
|
||||||
@@ -1409,7 +1439,7 @@ S_StopSound
|
|||||||
stop all sounds for entity on a channel.
|
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;
|
sfx_t *sfx;
|
||||||
|
|
||||||
@@ -1450,6 +1480,45 @@ void S_StopAllSounds( qboolean ambient )
|
|||||||
memset( &soundfade, 0, sizeof( soundfade ));
|
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 )
|
void S_UpdateChannels( void )
|
||||||
{
|
{
|
||||||
@@ -1461,12 +1530,12 @@ void S_UpdateChannels( void )
|
|||||||
if( !dma.buffer ) return;
|
if( !dma.buffer ) return;
|
||||||
|
|
||||||
// updates DMA time
|
// updates DMA time
|
||||||
soundtime = SNDDMA_GetSoundtime();
|
soundtime = S_GetSoundtime();
|
||||||
|
|
||||||
// soundtime - total samples that have been played out to hardware at dmaspeed
|
// soundtime - total samples that have been played out to hardware at dmaspeed
|
||||||
// paintedtime - total samples that have been mixed at speed
|
// paintedtime - total samples that have been mixed at speed
|
||||||
// endtime - target for samples in mixahead buffer 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;
|
samps = dma.samples >> 1;
|
||||||
|
|
||||||
if((int)(endtime - soundtime) > samps )
|
if((int)(endtime - soundtime) > samps )
|
||||||
@@ -1562,7 +1631,7 @@ void SND_UpdateSound( void )
|
|||||||
// try to combine static sounds with a previous channel of the same
|
// try to combine static sounds with a previous channel of the same
|
||||||
// sound effect so we don't mix five torches every frame
|
// sound effect so we don't mix five torches every frame
|
||||||
// g-cont: perfomance option, probably kill stereo effect in most cases
|
// 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
|
// see if it can just use the last one
|
||||||
if( combine && combine->sfx == ch->sfx )
|
if( combine && combine->sfx == ch->sfx )
|
||||||
@@ -1602,7 +1671,7 @@ void SND_UpdateSound( void )
|
|||||||
S_SpatializeRawChannels();
|
S_SpatializeRawChannels();
|
||||||
|
|
||||||
// debugging output
|
// debugging output
|
||||||
if( CVAR_TO_BOOL( s_show ))
|
if( s_show.value != 0.0f )
|
||||||
{
|
{
|
||||||
info.color[0] = 1.0f;
|
info.color[0] = 1.0f;
|
||||||
info.color[1] = 0.6f;
|
info.color[1] = 0.6f;
|
||||||
@@ -1623,7 +1692,7 @@ void SND_UpdateSound( void )
|
|||||||
VectorSet( info.color, 1.0f, 1.0f, 1.0f );
|
VectorSet( info.color, 1.0f, 1.0f, 1.0f );
|
||||||
info.index = 0;
|
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 ();
|
S_StreamBackgroundTrack ();
|
||||||
@@ -1679,26 +1748,41 @@ void S_PlayVol_f( void )
|
|||||||
S_StartLocalSound( Cmd_Argv( 1 ), Q_atof( Cmd_Argv( 2 )), false );
|
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 )
|
void S_Say_f( void )
|
||||||
{
|
{
|
||||||
if( Cmd_Argc() == 1 )
|
if( Cmd_Argc() == 1 )
|
||||||
{
|
{
|
||||||
Con_Printf( S_USAGE "speak <soundfile>\n" );
|
Con_Printf( S_USAGE "speak <vox sentence>\n" );
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
S_StartLocalSound( Cmd_Argv( 1 ), 1.0f, false );
|
S_Say( Cmd_Argv( 1 ), false );
|
||||||
}
|
}
|
||||||
|
|
||||||
void S_SayReliable_f( void )
|
void S_SayReliable_f( void )
|
||||||
{
|
{
|
||||||
if( Cmd_Argc() == 1 )
|
if( Cmd_Argc() == 1 )
|
||||||
{
|
{
|
||||||
Con_Printf( S_USAGE "spk <soundfile>\n" );
|
Con_Printf( S_USAGE "spk <vox sentence>\n" );
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
S_StartLocalSound( Cmd_Argv( 1 ), 1.0f, true );
|
S_Say( Cmd_Argv( 1 ), true );
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
@@ -1719,7 +1803,7 @@ void S_Music_f( void )
|
|||||||
else if( c == 2 )
|
else if( c == 2 )
|
||||||
{
|
{
|
||||||
string intro, main, track;
|
string intro, main, track;
|
||||||
char *ext[] = { "mp3", "wav" };
|
const char *ext[] = { "mp3", "wav" };
|
||||||
int i;
|
int i;
|
||||||
|
|
||||||
Q_strncpy( track, Cmd_Argv( 1 ), sizeof( track ));
|
Q_strncpy( track, Cmd_Argv( 1 ), sizeof( track ));
|
||||||
@@ -1728,8 +1812,12 @@ void S_Music_f( void )
|
|||||||
|
|
||||||
for( i = 0; i < 2; i++ )
|
for( i = 0; i < 2; i++ )
|
||||||
{
|
{
|
||||||
const char *intro_path = va( "media/%s.%s", intro, ext[i] );
|
char intro_path[MAX_VA_STRING];
|
||||||
const char *main_path = va( "media/%s.%s", main, ext[i] );
|
char main_path[MAX_VA_STRING];
|
||||||
|
char track_path[MAX_VA_STRING];
|
||||||
|
|
||||||
|
Q_snprintf( intro_path, sizeof( intro_path ), "media/%s.%s", intro, ext[i] );
|
||||||
|
Q_snprintf( main_path, sizeof( main_path ), "media/%s.%s", main, ext[i] );
|
||||||
|
|
||||||
if( FS_FileExists( intro_path, false ) && FS_FileExists( main_path, false ))
|
if( FS_FileExists( intro_path, false ) && FS_FileExists( main_path, false ))
|
||||||
{
|
{
|
||||||
@@ -1737,7 +1825,10 @@ void S_Music_f( void )
|
|||||||
S_StartBackgroundTrack( intro, main, 0, false );
|
S_StartBackgroundTrack( intro, main, 0, false );
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
else if( FS_FileExists( va( "media/%s.%s", track, ext[i] ), false ))
|
|
||||||
|
Q_snprintf( track_path, sizeof( track_path ), "media/%s.%s", track, ext[i] );
|
||||||
|
|
||||||
|
if( FS_FileExists( track_path, false ))
|
||||||
{
|
{
|
||||||
// single non-looped theme
|
// single non-looped theme
|
||||||
S_StartBackgroundTrack( track, NULL, 0, false );
|
S_StartBackgroundTrack( track, NULL, 0, false );
|
||||||
@@ -1792,7 +1883,7 @@ S_SoundInfo_f
|
|||||||
*/
|
*/
|
||||||
void S_SoundInfo_f( void )
|
void S_SoundInfo_f( void )
|
||||||
{
|
{
|
||||||
Con_Printf( "Audio: DirectSound\n" );
|
Con_Printf( "Audio backend: %s\n", dma.backendName );
|
||||||
Con_Printf( "%5d channel(s)\n", 2 );
|
Con_Printf( "%5d channel(s)\n", 2 );
|
||||||
Con_Printf( "%5d samples\n", dma.samples );
|
Con_Printf( "%5d samples\n", dma.samples );
|
||||||
Con_Printf( "%5d bits/sample\n", 16 );
|
Con_Printf( "%5d bits/sample\n", 16 );
|
||||||
@@ -1802,6 +1893,33 @@ void S_SoundInfo_f( void )
|
|||||||
S_PrintBackgroundTrackState ();
|
S_PrintBackgroundTrackState ();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
=================
|
||||||
|
S_VoiceRecordStart_f
|
||||||
|
=================
|
||||||
|
*/
|
||||||
|
void S_VoiceRecordStart_f( void )
|
||||||
|
{
|
||||||
|
if( cls.state != ca_active || cls.legacymode )
|
||||||
|
return;
|
||||||
|
|
||||||
|
Voice_RecordStart();
|
||||||
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
=================
|
||||||
|
S_VoiceRecordStop_f
|
||||||
|
=================
|
||||||
|
*/
|
||||||
|
void S_VoiceRecordStop_f( void )
|
||||||
|
{
|
||||||
|
if( cls.state != ca_active || !Voice_IsRecording() )
|
||||||
|
return;
|
||||||
|
|
||||||
|
CL_AddVoiceToDatagram();
|
||||||
|
Voice_RecordStop();
|
||||||
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
================
|
================
|
||||||
S_Init
|
S_Init
|
||||||
@@ -1815,17 +1933,18 @@ qboolean S_Init( void )
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
s_volume = Cvar_Get( "volume", "0.7", FCVAR_ARCHIVE, "sound volume" );
|
Cvar_RegisterVariable( &s_volume );
|
||||||
s_musicvolume = Cvar_Get( "MP3Volume", "1.0", FCVAR_ARCHIVE, "background music volume" );
|
Cvar_RegisterVariable( &s_musicvolume );
|
||||||
s_mixahead = Cvar_Get( "_snd_mixahead", "0.12", 0, "how much sound to mix ahead of time" );
|
Cvar_RegisterVariable( &s_mixahead );
|
||||||
s_show = Cvar_Get( "s_show", "0", FCVAR_ARCHIVE, "show playing sounds" );
|
Cvar_RegisterVariable( &s_show );
|
||||||
s_lerping = Cvar_Get( "s_lerping", "0", FCVAR_ARCHIVE, "apply interpolation to sound output" );
|
Cvar_RegisterVariable( &s_lerping );
|
||||||
s_ambient_level = Cvar_Get( "ambient_level", "0.3", FCVAR_ARCHIVE, "volume of environment noises (water and wind)" );
|
Cvar_RegisterVariable( &s_ambient_level );
|
||||||
s_ambient_fade = Cvar_Get( "ambient_fade", "1000", FCVAR_ARCHIVE, "rate of volume fading when client is moving" );
|
Cvar_RegisterVariable( &s_ambient_fade );
|
||||||
s_combine_sounds = Cvar_Get( "s_combine_channels", "0", FCVAR_ARCHIVE, "combine channels with same sounds" );
|
Cvar_RegisterVariable( &s_combine_sounds );
|
||||||
snd_mute_losefocus = Cvar_Get( "snd_mute_losefocus", "1", FCVAR_ARCHIVE, "silence the audio when game window loses focus" );
|
Cvar_RegisterVariable( &snd_mute_losefocus );
|
||||||
s_test = Cvar_Get( "s_test", "0", 0, "engine developer cvar for quick testing new features" );
|
Cvar_RegisterVariable( &s_test );
|
||||||
s_samplecount = Cvar_Get( "s_samplecount", "0", FCVAR_ARCHIVE, "sample count (0 for default value)" );
|
Cvar_RegisterVariable( &s_samplecount );
|
||||||
|
Cvar_RegisterVariable( &s_warn_late_precache );
|
||||||
|
|
||||||
Cmd_AddCommand( "play", S_Play_f, "playing a specified sound file" );
|
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
|
Cmd_AddCommand( "play2", S_Play2_f, "playing a group of specified sound files" ); // nehahra stuff
|
||||||
@@ -1835,11 +1954,12 @@ qboolean S_Init( void )
|
|||||||
Cmd_AddCommand( "soundlist", S_SoundList_f, "display loaded sounds" );
|
Cmd_AddCommand( "soundlist", S_SoundList_f, "display loaded sounds" );
|
||||||
Cmd_AddCommand( "s_info", S_SoundInfo_f, "print sound system information" );
|
Cmd_AddCommand( "s_info", S_SoundInfo_f, "print sound system information" );
|
||||||
Cmd_AddCommand( "s_fade", S_SoundFade_f, "fade all sounds then stop all" );
|
Cmd_AddCommand( "s_fade", S_SoundFade_f, "fade all sounds then stop all" );
|
||||||
Cmd_AddCommand( "+voicerecord", Cmd_Null_f, "start voice recording (non-implemented)" );
|
Cmd_AddCommand( "+voicerecord", S_VoiceRecordStart_f, "start voice recording" );
|
||||||
Cmd_AddCommand( "-voicerecord", Cmd_Null_f, "stop voice recording (non-implemented)" );
|
Cmd_AddCommand( "-voicerecord", S_VoiceRecordStop_f, "stop voice recording" );
|
||||||
Cmd_AddCommand( "spk", S_SayReliable_f, "reliable play a specified sententce" );
|
Cmd_AddCommand( "spk", S_SayReliable_f, "reliable play a specified sententce" );
|
||||||
Cmd_AddCommand( "speak", S_Say_f, "playing a specified sententce" );
|
Cmd_AddCommand( "speak", S_Say_f, "playing a specified sententce" );
|
||||||
|
|
||||||
|
dma.backendName = "None";
|
||||||
if( !SNDDMA_Init( ) )
|
if( !SNDDMA_Init( ) )
|
||||||
{
|
{
|
||||||
Con_Printf( "Audio: sound system can't be initialized\n" );
|
Con_Printf( "Audio: sound system can't be initialized\n" );
|
||||||
|
|||||||
@@ -117,13 +117,6 @@ _inline void MIX_ActivatePaintbuffer( int ipaintbuffer )
|
|||||||
paintbuffers[ipaintbuffer].factive = true;
|
paintbuffers[ipaintbuffer].factive = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
// don't mix into this paintbuffer
|
|
||||||
_inline void MIX_DeactivatePaintbuffer( int ipaintbuffer )
|
|
||||||
{
|
|
||||||
Assert( ipaintbuffer < CPAINTBUFFERS );
|
|
||||||
paintbuffers[ipaintbuffer].factive = false;
|
|
||||||
}
|
|
||||||
|
|
||||||
_inline void MIX_SetCurrentPaintbuffer( int ipaintbuffer )
|
_inline void MIX_SetCurrentPaintbuffer( int ipaintbuffer )
|
||||||
{
|
{
|
||||||
Assert( ipaintbuffer < CPAINTBUFFERS );
|
Assert( ipaintbuffer < CPAINTBUFFERS );
|
||||||
@@ -169,12 +162,6 @@ _inline void MIX_ResetPaintbufferFilterCounters( void )
|
|||||||
paintbuffers[i].ifilter = FILTERTYPE_NONE;
|
paintbuffers[i].ifilter = FILTERTYPE_NONE;
|
||||||
}
|
}
|
||||||
|
|
||||||
_inline void MIX_ResetPaintbufferFilterCounter( int ipaintbuffer )
|
|
||||||
{
|
|
||||||
Assert( ipaintbuffer < CPAINTBUFFERS );
|
|
||||||
paintbuffers[ipaintbuffer].ifilter = 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
// return pointer to front paintbuffer pbuf, given index
|
// return pointer to front paintbuffer pbuf, given index
|
||||||
_inline portable_samplepair_t *MIX_GetPFrontFromIPaint( int ipaintbuffer )
|
_inline portable_samplepair_t *MIX_GetPFrontFromIPaint( int ipaintbuffer )
|
||||||
{
|
{
|
||||||
@@ -408,13 +395,13 @@ void S_MixChannel( channel_t *pChannel, void *pData, int outputOffset, int input
|
|||||||
if( pSource->channels == 1 )
|
if( pSource->channels == 1 )
|
||||||
{
|
{
|
||||||
if( pSource->width == 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 S_Mix16Mono( pbuf, pvol, (short *)pData, inputOffset, fracRate, outCount );
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
if( pSource->width == 1 )
|
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 );
|
else S_Mix16Stereo( pbuf, pvol, (short *)pData, inputOffset, fracRate, outCount );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -619,7 +606,9 @@ void MIX_MixChannelsToPaintbuffer( int endtime, int rate, int outputRate )
|
|||||||
ch->pitch = VOX_ModifyPitch( ch, ch->basePitch * 0.01f );
|
ch->pitch = VOX_ModifyPitch( ch, ch->basePitch * 0.01f );
|
||||||
else ch->pitch = ch->basePitch * 0.01f;
|
else ch->pitch = ch->basePitch * 0.01f;
|
||||||
|
|
||||||
if( CL_GetEntityByIndex( ch->entnum ) && ( ch->entchannel == CHAN_VOICE ))
|
ch->pitch *= ( sys_timescale.value + 1 ) / 2;
|
||||||
|
|
||||||
|
if( CL_GetEntityByIndex( ch->entnum ) && ( ch->entchannel == CHAN_VOICE || ch->entchannel == CHAN_STREAM ))
|
||||||
{
|
{
|
||||||
if( pSource->width == 1 )
|
if( pSource->width == 1 )
|
||||||
SND_MoveMouth8( ch, pSource, sampleCount );
|
SND_MoveMouth8( ch, pSource, sampleCount );
|
||||||
@@ -809,7 +798,7 @@ void S_MixBufferUpsample2x( int count, portable_samplepair_t *pbuffer, portable_
|
|||||||
// zero out all paintbuffers
|
// zero out all paintbuffers
|
||||||
void MIX_ClearAllPaintBuffers( int SampleCount, qboolean clearFilters )
|
void MIX_ClearAllPaintBuffers( int SampleCount, qboolean clearFilters )
|
||||||
{
|
{
|
||||||
int count = min( SampleCount, PAINTBUFFER_SIZE );
|
int count = Q_min( SampleCount, PAINTBUFFER_SIZE );
|
||||||
int i;
|
int i;
|
||||||
|
|
||||||
// zero out all paintbuffer data (ignore sampleCount)
|
// zero out all paintbuffer data (ignore sampleCount)
|
||||||
@@ -895,43 +884,13 @@ void S_MixUpsample( int sampleCount, int filtertype )
|
|||||||
ppaint->ifilter++;
|
ppaint->ifilter++;
|
||||||
}
|
}
|
||||||
|
|
||||||
void MIX_MixStreamBuffer( int end )
|
|
||||||
{
|
|
||||||
portable_samplepair_t *pbuf;
|
|
||||||
rawchan_t *ch;
|
|
||||||
|
|
||||||
pbuf = MIX_GetPFrontFromIPaint( ISTREAMBUFFER );
|
|
||||||
ch = S_FindRawChannel( S_RAW_SOUND_BACKGROUNDTRACK, false );
|
|
||||||
|
|
||||||
// clear the paint buffer
|
|
||||||
if( s_listener.paused || !ch || ch->s_rawend < paintedtime )
|
|
||||||
{
|
|
||||||
memset( pbuf, 0, (end - paintedtime) * sizeof( portable_samplepair_t ));
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
int i, stop;
|
|
||||||
|
|
||||||
// copy from the streaming sound source
|
|
||||||
stop = (end < ch->s_rawend) ? end : ch->s_rawend;
|
|
||||||
|
|
||||||
for( i = paintedtime; i < stop; i++ )
|
|
||||||
{
|
|
||||||
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;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
void MIX_MixRawSamplesBuffer( int end )
|
void MIX_MixRawSamplesBuffer( int end )
|
||||||
{
|
{
|
||||||
portable_samplepair_t *pbuf;
|
portable_samplepair_t *pbuf, *roombuf, *streambuf;
|
||||||
uint i, j, stop;
|
uint i, j, stop;
|
||||||
|
|
||||||
pbuf = MIX_GetCurrentPaintbufferPtr()->pbuf;
|
roombuf = MIX_GetPFrontFromIPaint( IROOMBUFFER );
|
||||||
|
streambuf = MIX_GetPFrontFromIPaint( ISTREAMBUFFER );
|
||||||
|
|
||||||
if( s_listener.paused ) return;
|
if( s_listener.paused ) return;
|
||||||
|
|
||||||
@@ -939,16 +898,19 @@ void MIX_MixRawSamplesBuffer( int end )
|
|||||||
for( i = 0; i < MAX_RAW_CHANNELS; i++ )
|
for( i = 0; i < MAX_RAW_CHANNELS; i++ )
|
||||||
{
|
{
|
||||||
// copy from the streaming sound source
|
// copy from the streaming sound source
|
||||||
rawchan_t *ch = raw_channels[i];
|
rawchan_t *ch = raw_channels[i];
|
||||||
|
qboolean stream;
|
||||||
|
|
||||||
// background track should be mixing into another buffer
|
if( !ch )
|
||||||
if( !ch || ch->entnum == S_RAW_SOUND_BACKGROUNDTRACK )
|
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
// not audible
|
// not audible
|
||||||
if( !ch->leftvol && !ch->rightvol )
|
if( !ch->leftvol && !ch->rightvol )
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
|
stream = ch->entnum == S_RAW_SOUND_BACKGROUNDTRACK || CL_IsPlayerIndex( ch->entnum );
|
||||||
|
pbuf = stream ? streambuf : roombuf;
|
||||||
|
|
||||||
stop = (end < ch->s_rawend) ? end : ch->s_rawend;
|
stop = (end < ch->s_rawend) ? end : ch->s_rawend;
|
||||||
|
|
||||||
for( j = paintedtime; j < stop; j++ )
|
for( j = paintedtime; j < stop; j++ )
|
||||||
@@ -956,6 +918,9 @@ void MIX_MixRawSamplesBuffer( int end )
|
|||||||
pbuf[j-paintedtime].left += ( ch->rawsamples[j & ( ch->max_samples - 1 )].left * ch->leftvol ) >> 8;
|
pbuf[j-paintedtime].left += ( ch->rawsamples[j & ( ch->max_samples - 1 )].left * ch->leftvol ) >> 8;
|
||||||
pbuf[j-paintedtime].right += ( ch->rawsamples[j & ( ch->max_samples - 1 )].right * ch->rightvol ) >> 8;
|
pbuf[j-paintedtime].right += ( ch->rawsamples[j & ( ch->max_samples - 1 )].right * ch->rightvol ) >> 8;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if( ch->entnum > 0 )
|
||||||
|
SND_MoveMouthRaw( ch, &ch->rawsamples[paintedtime & ( ch->max_samples - 1 )], stop - paintedtime );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -965,9 +930,6 @@ void MIX_MixRawSamplesBuffer( int end )
|
|||||||
// caller also remixes all into final IPAINTBUFFER output.
|
// caller also remixes all into final IPAINTBUFFER output.
|
||||||
void MIX_UpsampleAllPaintbuffers( int end, int count )
|
void MIX_UpsampleAllPaintbuffers( int end, int count )
|
||||||
{
|
{
|
||||||
// process stream buffer
|
|
||||||
MIX_MixStreamBuffer( end );
|
|
||||||
|
|
||||||
// 11khz sounds are mixed into 3 buffers based on distance from listener, and facing direction
|
// 11khz sounds are mixed into 3 buffers based on distance from listener, and facing direction
|
||||||
// These buffers are facing, facingaway, room
|
// These buffers are facing, facingaway, room
|
||||||
// These 3 mixed buffers are then each upsampled to 22khz.
|
// These 3 mixed buffers are then each upsampled to 22khz.
|
||||||
@@ -988,24 +950,27 @@ void MIX_UpsampleAllPaintbuffers( int end, int count )
|
|||||||
// mix 11khz sounds:
|
// mix 11khz sounds:
|
||||||
MIX_MixChannelsToPaintbuffer( end, SOUND_11k, SOUND_11k );
|
MIX_MixChannelsToPaintbuffer( end, SOUND_11k, SOUND_11k );
|
||||||
|
|
||||||
|
#if SOUND_DMA_SPEED >= SOUND_22k
|
||||||
// upsample all 11khz buffers by 2x
|
// upsample all 11khz buffers by 2x
|
||||||
// only upsample roombuffer if dsp fx are on KDB: perf
|
// only upsample roombuffer if dsp fx are on KDB: perf
|
||||||
MIX_SetCurrentPaintbuffer( IROOMBUFFER ); // operates on MixUpSample
|
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 );
|
MIX_MixChannelsToPaintbuffer( end, SOUND_22k, SOUND_22k );
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#if SOUND_DMA_SPEED >= SOUND_44k
|
||||||
// upsample all 22khz buffers by 2x
|
// upsample all 22khz buffers by 2x
|
||||||
// only upsample roombuffer if dsp fx are on KDB: perf
|
// only upsample roombuffer if dsp fx are on KDB: perf
|
||||||
MIX_SetCurrentPaintbuffer( IROOMBUFFER );
|
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 all 44khz sounds to all active paintbuffers
|
||||||
MIX_MixChannelsToPaintbuffer( end, SOUND_44k, SOUND_DMA_SPEED );
|
MIX_MixChannelsToPaintbuffer( end, SOUND_44k, SOUND_DMA_SPEED );
|
||||||
|
#endif
|
||||||
|
|
||||||
// mix raw samples from the video streams
|
// mix raw samples from the video streams
|
||||||
MIX_SetCurrentPaintbuffer( IROOMBUFFER );
|
|
||||||
MIX_MixRawSamplesBuffer( end );
|
MIX_MixRawSamplesBuffer( end );
|
||||||
|
|
||||||
MIX_DeactivateAllPaintbuffers();
|
MIX_DeactivateAllPaintbuffers();
|
||||||
|
|||||||
@@ -24,17 +24,7 @@ void SND_InitMouth( int entnum, int entchannel )
|
|||||||
{
|
{
|
||||||
if(( entchannel == CHAN_VOICE || entchannel == CHAN_STREAM ) && entnum > 0 )
|
if(( entchannel == CHAN_VOICE || entchannel == CHAN_STREAM ) && entnum > 0 )
|
||||||
{
|
{
|
||||||
cl_entity_t *clientEntity;
|
SND_ForceInitMouth( entnum );
|
||||||
|
|
||||||
// init mouth movement vars
|
|
||||||
clientEntity = CL_GetEntityByIndex( entnum );
|
|
||||||
|
|
||||||
if( clientEntity )
|
|
||||||
{
|
|
||||||
clientEntity->mouth.mouthopen = 0;
|
|
||||||
clientEntity->mouth.sndcount = 0;
|
|
||||||
clientEntity->mouth.sndavg = 0;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -42,15 +32,7 @@ void SND_CloseMouth( channel_t *ch )
|
|||||||
{
|
{
|
||||||
if( ch->entchannel == CHAN_VOICE || ch->entchannel == CHAN_STREAM )
|
if( ch->entchannel == CHAN_VOICE || ch->entchannel == CHAN_STREAM )
|
||||||
{
|
{
|
||||||
cl_entity_t *clientEntity;
|
SND_ForceCloseMouth( ch->entnum );
|
||||||
|
|
||||||
clientEntity = CL_GetEntityByIndex( ch->entnum );
|
|
||||||
|
|
||||||
if( clientEntity )
|
|
||||||
{
|
|
||||||
// shut mouth
|
|
||||||
clientEntity->mouth.mouthopen = 0;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -150,3 +132,68 @@ void SND_MoveMouth16( channel_t *ch, wavdata_t *pSource, int count )
|
|||||||
pMouth->sndcount = 0;
|
pMouth->sndcount = 0;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void SND_ForceInitMouth( int entnum )
|
||||||
|
{
|
||||||
|
cl_entity_t *clientEntity;
|
||||||
|
|
||||||
|
clientEntity = CL_GetEntityByIndex( entnum );
|
||||||
|
|
||||||
|
if( clientEntity )
|
||||||
|
{
|
||||||
|
clientEntity->mouth.mouthopen = 0;
|
||||||
|
clientEntity->mouth.sndavg = 0;
|
||||||
|
clientEntity->mouth.sndcount = 0;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void SND_ForceCloseMouth( int entnum )
|
||||||
|
{
|
||||||
|
cl_entity_t *clientEntity;
|
||||||
|
|
||||||
|
clientEntity = CL_GetEntityByIndex( entnum );
|
||||||
|
|
||||||
|
if( clientEntity )
|
||||||
|
clientEntity->mouth.mouthopen = 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
void SND_MoveMouthRaw( rawchan_t *ch, portable_samplepair_t *pData, int count )
|
||||||
|
{
|
||||||
|
cl_entity_t *clientEntity;
|
||||||
|
mouth_t *pMouth = NULL;
|
||||||
|
int savg, data;
|
||||||
|
int scount = 0;
|
||||||
|
uint i;
|
||||||
|
|
||||||
|
clientEntity = CL_GetEntityByIndex( ch->entnum );
|
||||||
|
if( !clientEntity ) return;
|
||||||
|
|
||||||
|
pMouth = &clientEntity->mouth;
|
||||||
|
|
||||||
|
if( pData == NULL )
|
||||||
|
return;
|
||||||
|
|
||||||
|
i = 0;
|
||||||
|
scount = pMouth->sndcount;
|
||||||
|
savg = 0;
|
||||||
|
|
||||||
|
while ( i < count && scount < CAVGSAMPLES )
|
||||||
|
{
|
||||||
|
data = pData[i].left; // mono sound anyway
|
||||||
|
data = ( bound( -32767, data, 0x7ffe ) >> 8 );
|
||||||
|
savg += abs( data );
|
||||||
|
|
||||||
|
i += 80 + ( (byte)data & 0x1F );
|
||||||
|
scount++;
|
||||||
|
}
|
||||||
|
|
||||||
|
pMouth->sndavg += savg;
|
||||||
|
pMouth->sndcount = (byte)scount;
|
||||||
|
|
||||||
|
if ( pMouth->sndcount >= CAVGSAMPLES )
|
||||||
|
{
|
||||||
|
pMouth->mouthopen = pMouth->sndavg / CAVGSAMPLES;
|
||||||
|
pMouth->sndavg = 0;
|
||||||
|
pMouth->sndcount = 0;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|||||||
@@ -63,7 +63,7 @@ float S_GetMusicVolume( void )
|
|||||||
scale = 1.0f - scale;
|
scale = 1.0f - scale;
|
||||||
}
|
}
|
||||||
|
|
||||||
return s_musicvolume->value * scale;
|
return s_musicvolume.value * scale;
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
@@ -95,7 +95,7 @@ void S_StartBackgroundTrack( const char *introTrack, const char *mainTrack, int
|
|||||||
else Q_strncpy( s_bgTrack.loopName, mainTrack, sizeof( s_bgTrack.loopName ));
|
else Q_strncpy( s_bgTrack.loopName, mainTrack, sizeof( s_bgTrack.loopName ));
|
||||||
|
|
||||||
// open stream
|
// open stream
|
||||||
s_bgTrack.stream = FS_OpenStream( va( "media/%s", introTrack ));
|
s_bgTrack.stream = FS_OpenStream( introTrack );
|
||||||
Q_strncpy( s_bgTrack.current, introTrack, sizeof( s_bgTrack.current ));
|
Q_strncpy( s_bgTrack.current, introTrack, sizeof( s_bgTrack.current ));
|
||||||
memset( &musicfade, 0, sizeof( musicfade )); // clear any soundfade
|
memset( &musicfade, 0, sizeof( musicfade )); // clear any soundfade
|
||||||
s_bgTrack.source = cls.key_dest;
|
s_bgTrack.source = cls.key_dest;
|
||||||
@@ -183,7 +183,7 @@ void S_StreamBackgroundTrack( void )
|
|||||||
return;
|
return;
|
||||||
|
|
||||||
// don't bother playing anything if musicvolume is 0
|
// 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;
|
return;
|
||||||
|
|
||||||
if( !cl.background )
|
if( !cl.background )
|
||||||
@@ -242,7 +242,7 @@ void S_StreamBackgroundTrack( void )
|
|||||||
if( s_bgTrack.loopName[0] )
|
if( s_bgTrack.loopName[0] )
|
||||||
{
|
{
|
||||||
FS_FreeStream( s_bgTrack.stream );
|
FS_FreeStream( s_bgTrack.stream );
|
||||||
s_bgTrack.stream = FS_OpenStream( va( "media/%s", s_bgTrack.loopName ));
|
s_bgTrack.stream = FS_OpenStream( s_bgTrack.loopName );
|
||||||
Q_strncpy( s_bgTrack.current, s_bgTrack.loopName, sizeof( s_bgTrack.current ));
|
Q_strncpy( s_bgTrack.current, s_bgTrack.loopName, sizeof( s_bgTrack.current ));
|
||||||
|
|
||||||
if( !s_bgTrack.stream ) return;
|
if( !s_bgTrack.stream ) return;
|
||||||
|
|||||||
File diff suppressed because it is too large
Load Diff
@@ -16,9 +16,9 @@ GNU General Public License for more details.
|
|||||||
#ifndef SOUND_H
|
#ifndef SOUND_H
|
||||||
#define SOUND_H
|
#define SOUND_H
|
||||||
|
|
||||||
extern byte *sndpool;
|
extern poolhandle_t sndpool;
|
||||||
|
|
||||||
#include "mathlib.h"
|
#include "xash3d_mathlib.h"
|
||||||
|
|
||||||
// sound engine rate defines
|
// sound engine rate defines
|
||||||
#define SOUND_DMA_SPEED 44100 // hardware playback rate
|
#define SOUND_DMA_SPEED 44100 // hardware playback rate
|
||||||
@@ -113,10 +113,11 @@ typedef struct snd_format_s
|
|||||||
typedef struct
|
typedef struct
|
||||||
{
|
{
|
||||||
snd_format_t format;
|
snd_format_t format;
|
||||||
int samples; // mono samples in buffer
|
int samples; // mono samples in buffer
|
||||||
int samplepos; // in mono samples
|
int samplepos; // in mono samples
|
||||||
byte *buffer;
|
byte *buffer;
|
||||||
qboolean initialized; // sound engine is active
|
qboolean initialized; // sound engine is active
|
||||||
|
const char *backendName;
|
||||||
} dma_t;
|
} dma_t;
|
||||||
|
|
||||||
#include "vox.h"
|
#include "vox.h"
|
||||||
@@ -138,7 +139,6 @@ typedef struct rawchan_s
|
|||||||
int rightvol; // 0-255 right volume
|
int rightvol; // 0-255 right volume
|
||||||
float dist_mult; // distance multiplier (attenuation/clipK)
|
float dist_mult; // distance multiplier (attenuation/clipK)
|
||||||
vec3_t origin; // only use if fixed_origin is set
|
vec3_t origin; // only use if fixed_origin is set
|
||||||
float radius; // radius of this sound effect
|
|
||||||
volatile uint s_rawend;
|
volatile uint s_rawend;
|
||||||
wavdata_t sound_info; // advance play position
|
wavdata_t sound_info; // advance play position
|
||||||
float oldtime; // catch time jumps
|
float oldtime; // catch time jumps
|
||||||
@@ -203,7 +203,7 @@ typedef struct
|
|||||||
|
|
||||||
#define MAX_DYNAMIC_CHANNELS (60 + NUM_AMBIENTS)
|
#define MAX_DYNAMIC_CHANNELS (60 + NUM_AMBIENTS)
|
||||||
#define MAX_CHANNELS (256 + MAX_DYNAMIC_CHANNELS) // Scourge Of Armagon has too many static sounds on hip2m4.bsp
|
#define MAX_CHANNELS (256 + MAX_DYNAMIC_CHANNELS) // Scourge Of Armagon has too many static sounds on hip2m4.bsp
|
||||||
#define MAX_RAW_CHANNELS 16
|
#define MAX_RAW_CHANNELS 48
|
||||||
#define MAX_RAW_SAMPLES 8192
|
#define MAX_RAW_SAMPLES 8192
|
||||||
|
|
||||||
extern sound_t ambient_sfx[NUM_AMBIENTS];
|
extern sound_t ambient_sfx[NUM_AMBIENTS];
|
||||||
@@ -217,15 +217,13 @@ extern listener_t s_listener;
|
|||||||
extern int idsp_room;
|
extern int idsp_room;
|
||||||
extern dma_t dma;
|
extern dma_t dma;
|
||||||
|
|
||||||
extern convar_t *s_volume;
|
extern convar_t s_musicvolume;
|
||||||
extern convar_t *s_musicvolume;
|
extern convar_t s_lerping;
|
||||||
extern convar_t *s_show;
|
|
||||||
extern convar_t *s_mixahead;
|
|
||||||
extern convar_t *s_lerping;
|
|
||||||
extern convar_t *dsp_off;
|
extern convar_t *dsp_off;
|
||||||
extern convar_t *s_test; // cvar to testify new effects
|
extern convar_t s_test; // cvar to testify new effects
|
||||||
extern convar_t *s_samplecount;
|
extern convar_t s_samplecount;
|
||||||
extern convar_t *snd_mute_losefocus;
|
extern convar_t snd_mute_losefocus;
|
||||||
|
extern convar_t s_warn_late_precache;
|
||||||
|
|
||||||
void S_InitScaletable( void );
|
void S_InitScaletable( void );
|
||||||
wavdata_t *S_LoadSound( sfx_t *sfx );
|
wavdata_t *S_LoadSound( sfx_t *sfx );
|
||||||
@@ -274,11 +272,10 @@ int S_GetCurrentStaticSounds( soundlist_t *pout, int size );
|
|||||||
int S_GetCurrentDynamicSounds( soundlist_t *pout, int size );
|
int S_GetCurrentDynamicSounds( soundlist_t *pout, int size );
|
||||||
sfx_t *S_GetSfxByHandle( sound_t handle );
|
sfx_t *S_GetSfxByHandle( sound_t handle );
|
||||||
rawchan_t *S_FindRawChannel( int entnum, qboolean create );
|
rawchan_t *S_FindRawChannel( int entnum, qboolean create );
|
||||||
|
void S_RawEntSamples( int entnum, uint samples, uint rate, word width, word channels, const byte *data, int snd_vol );
|
||||||
void S_RawSamples( uint samples, uint rate, word width, word channels, const byte *data, int entnum );
|
void S_RawSamples( uint samples, uint rate, word width, word channels, const byte *data, int entnum );
|
||||||
void S_StopSound( int entnum, int channel, const char *soundname );
|
void S_StopSound( int entnum, int channel, const char *soundname );
|
||||||
void S_UpdateFrame( struct ref_viewpass_s *rvp );
|
void S_UpdateFrame( struct ref_viewpass_s *rvp );
|
||||||
uint S_GetRawSamplesLength( int entnum );
|
|
||||||
void S_ClearRawChannel( int entnum );
|
|
||||||
void S_StopAllSounds( qboolean ambient );
|
void S_StopAllSounds( qboolean ambient );
|
||||||
void S_FreeSounds( void );
|
void S_FreeSounds( void );
|
||||||
|
|
||||||
@@ -286,9 +283,12 @@ void S_FreeSounds( void );
|
|||||||
// s_mouth.c
|
// s_mouth.c
|
||||||
//
|
//
|
||||||
void SND_InitMouth( int entnum, int entchannel );
|
void SND_InitMouth( int entnum, int entchannel );
|
||||||
|
void SND_ForceInitMouth( int entnum );
|
||||||
void SND_MoveMouth8( channel_t *ch, wavdata_t *pSource, int count );
|
void SND_MoveMouth8( channel_t *ch, wavdata_t *pSource, int count );
|
||||||
void SND_MoveMouth16( channel_t *ch, wavdata_t *pSource, int count );
|
void SND_MoveMouth16( channel_t *ch, wavdata_t *pSource, int count );
|
||||||
|
void SND_MoveMouthRaw( rawchan_t *ch, portable_samplepair_t *pData, int count );
|
||||||
void SND_CloseMouth( channel_t *ch );
|
void SND_CloseMouth( channel_t *ch );
|
||||||
|
void SND_ForceCloseMouth( int entnum );
|
||||||
|
|
||||||
//
|
//
|
||||||
// s_stream.c
|
// s_stream.c
|
||||||
@@ -304,6 +304,7 @@ void S_FadeMusicVolume( float fadePercent );
|
|||||||
//
|
//
|
||||||
int S_ZeroCrossingAfter( wavdata_t *pWaveData, int sample );
|
int S_ZeroCrossingAfter( wavdata_t *pWaveData, int sample );
|
||||||
int S_ZeroCrossingBefore( wavdata_t *pWaveData, int sample );
|
int S_ZeroCrossingBefore( wavdata_t *pWaveData, int sample );
|
||||||
|
int S_ConvertLoopedPosition( wavdata_t *pSource, int samplePosition, qboolean use_loop );
|
||||||
int S_GetOutputData( wavdata_t *pSource, void **pData, int samplePosition, int sampleCount, qboolean use_loop );
|
int S_GetOutputData( wavdata_t *pSource, void **pData, int samplePosition, int sampleCount, qboolean use_loop );
|
||||||
void S_SetSampleStart( channel_t *pChan, wavdata_t *pSource, int newPosition );
|
void S_SetSampleStart( channel_t *pChan, wavdata_t *pSource, int newPosition );
|
||||||
void S_SetSampleEnd( channel_t *pChan, wavdata_t *pSource, int newEndPosition );
|
void S_SetSampleEnd( channel_t *pChan, wavdata_t *pSource, int newEndPosition );
|
||||||
|
|||||||
@@ -218,6 +218,7 @@ void CL_TextMessageParse( byte *pMemFile, int fileSize )
|
|||||||
client_textmessage_t textMessages[MAX_MESSAGES];
|
client_textmessage_t textMessages[MAX_MESSAGES];
|
||||||
int i, nameHeapSize, textHeapSize, messageSize, nameOffset;
|
int i, nameHeapSize, textHeapSize, messageSize, nameOffset;
|
||||||
int messageCount, lastNamePos;
|
int messageCount, lastNamePos;
|
||||||
|
size_t textHeapSizeRemaining;
|
||||||
|
|
||||||
lastNamePos = 0;
|
lastNamePos = 0;
|
||||||
lineNumber = 0;
|
lineNumber = 0;
|
||||||
@@ -252,7 +253,7 @@ void CL_TextMessageParse( byte *pMemFile, int fileSize )
|
|||||||
Con_Reportf( "TextMessage: unexpected '}' found, line %d\n", lineNumber );
|
Con_Reportf( "TextMessage: unexpected '}' found, line %d\n", lineNumber );
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
Q_strcpy( currentName, trim );
|
Q_strncpy( currentName, trim, sizeof( currentName ));
|
||||||
break;
|
break;
|
||||||
case MSGFILE_TEXT:
|
case MSGFILE_TEXT:
|
||||||
if( IsEndOfText( trim ))
|
if( IsEndOfText( trim ))
|
||||||
@@ -266,7 +267,7 @@ void CL_TextMessageParse( byte *pMemFile, int fileSize )
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
Q_strcpy( nameHeap + lastNamePos, currentName );
|
Q_strncpy( nameHeap + lastNamePos, currentName, sizeof( nameHeap ) - lastNamePos );
|
||||||
|
|
||||||
// terminate text in-place in the memory file
|
// terminate text in-place in the memory file
|
||||||
// (it's temporary memory that will be deleted)
|
// (it's temporary memory that will be deleted)
|
||||||
@@ -275,7 +276,7 @@ void CL_TextMessageParse( byte *pMemFile, int fileSize )
|
|||||||
// Save name/text on heap
|
// Save name/text on heap
|
||||||
textMessages[messageCount] = gMessageParms;
|
textMessages[messageCount] = gMessageParms;
|
||||||
textMessages[messageCount].pName = nameHeap + lastNamePos;
|
textMessages[messageCount].pName = nameHeap + lastNamePos;
|
||||||
lastNamePos += Q_strlen( currentName ) + 1;
|
lastNamePos += length + 1;
|
||||||
textMessages[messageCount].pMessage = pCurrentText;
|
textMessages[messageCount].pMessage = pCurrentText;
|
||||||
messageCount++;
|
messageCount++;
|
||||||
|
|
||||||
@@ -329,15 +330,20 @@ void CL_TextMessageParse( byte *pMemFile, int fileSize )
|
|||||||
|
|
||||||
|
|
||||||
// copy text & fixup pointers
|
// copy text & fixup pointers
|
||||||
|
textHeapSizeRemaining = textHeapSize;
|
||||||
pCurrentText = pNameHeap + nameHeapSize;
|
pCurrentText = pNameHeap + nameHeapSize;
|
||||||
|
|
||||||
for( i = 0; i < messageCount; i++ )
|
for( i = 0; i < messageCount; i++ )
|
||||||
{
|
{
|
||||||
|
size_t currentTextSize = Q_strlen( clgame.titles[i].pMessage ) + 1;
|
||||||
|
|
||||||
clgame.titles[i].pName = pNameHeap; // adjust name pointer (parallel buffer)
|
clgame.titles[i].pName = pNameHeap; // adjust name pointer (parallel buffer)
|
||||||
Q_strcpy( pCurrentText, clgame.titles[i].pMessage ); // copy text over
|
Q_strncpy( pCurrentText, clgame.titles[i].pMessage, textHeapSizeRemaining ); // copy text over
|
||||||
clgame.titles[i].pMessage = pCurrentText;
|
clgame.titles[i].pMessage = pCurrentText;
|
||||||
|
|
||||||
pNameHeap += Q_strlen( pNameHeap ) + 1;
|
pNameHeap += Q_strlen( pNameHeap ) + 1;
|
||||||
pCurrentText += Q_strlen( pCurrentText ) + 1;
|
pCurrentText += currentTextSize;
|
||||||
|
textHeapSizeRemaining -= currentTextSize;
|
||||||
}
|
}
|
||||||
|
|
||||||
if(( pCurrentText - (char *)clgame.titles ) != ( textHeapSize + nameHeapSize + messageSize ))
|
if(( pCurrentText - (char *)clgame.titles ) != ( textHeapSize + nameHeapSize + messageSize ))
|
||||||
|
|||||||
@@ -21,145 +21,79 @@ GNU General Public License for more details.
|
|||||||
#include "keydefs.h"
|
#include "keydefs.h"
|
||||||
#include "ref_common.h"
|
#include "ref_common.h"
|
||||||
#include "input.h"
|
#include "input.h"
|
||||||
#ifdef XASH_SDL
|
|
||||||
#include <SDL.h>
|
|
||||||
static SDL_Cursor* s_pDefaultCursor[20];
|
|
||||||
#endif
|
|
||||||
#include "platform/platform.h"
|
#include "platform/platform.h"
|
||||||
|
|
||||||
static enum VGUI_KeyCode s_pVirtualKeyTrans[256];
|
CVAR_DEFINE_AUTO( vgui_utf8, "0", FCVAR_ARCHIVE, "enable utf-8 support for vgui text" );
|
||||||
static enum VGUI_DefaultCursor s_currentCursor;
|
|
||||||
static HINSTANCE s_pVGuiSupport; // vgui_support library
|
|
||||||
static convar_t *vgui_utf8 = NULL;
|
|
||||||
|
|
||||||
// Helper functions for vgui backend
|
static void GAME_EXPORT *VGUI_EngineMalloc( size_t size );
|
||||||
|
static void GAME_EXPORT VGUI_GetMousePos( int *, int * );
|
||||||
|
static void GAME_EXPORT VGUI_CursorSelect( VGUI_DefaultCursor );
|
||||||
|
static byte GAME_EXPORT VGUI_GetColor( int, int );
|
||||||
|
static int GAME_EXPORT VGUI_UtfProcessChar( int in );
|
||||||
|
static qboolean GAME_EXPORT VGUI_IsInGame( void );
|
||||||
|
|
||||||
/*void VGUI_HideCursor( void )
|
static struct
|
||||||
{
|
{
|
||||||
host.mouse_visible = false;
|
qboolean initialized;
|
||||||
SDL_HideCursor();
|
vgui_support_interface_t dllFuncs;
|
||||||
}
|
VGUI_DefaultCursor cursor;
|
||||||
|
|
||||||
void VGUI_ShowCursor( void )
|
HINSTANCE hInstance;
|
||||||
|
|
||||||
|
enum VGUI_KeyCode virtualKeyTrans[256];
|
||||||
|
} vgui =
|
||||||
{
|
{
|
||||||
host.mouse_visible = true;
|
false,
|
||||||
SDL_ShowCursor();
|
{ 0 }, // not initialized yet
|
||||||
}*/
|
-1
|
||||||
|
};
|
||||||
|
|
||||||
void GAME_EXPORT *VGUI_EngineMalloc(size_t size)
|
static void GAME_EXPORT *VGUI_EngineMalloc( size_t size )
|
||||||
{
|
{
|
||||||
return Z_Malloc( size );
|
return Z_Malloc( size );
|
||||||
}
|
}
|
||||||
|
|
||||||
qboolean GAME_EXPORT VGUI_IsInGame( void )
|
static qboolean GAME_EXPORT VGUI_IsInGame( void )
|
||||||
{
|
{
|
||||||
return cls.state == ca_active && cls.key_dest == key_game;
|
return cls.state == ca_active && cls.key_dest == key_game;
|
||||||
}
|
}
|
||||||
|
|
||||||
void GAME_EXPORT VGUI_GetMousePos( int *_x, int *_y )
|
static void GAME_EXPORT VGUI_GetMousePos( int *_x, int *_y )
|
||||||
{
|
{
|
||||||
float xscale = (float)refState.width / (float)clgame.scrInfo.iWidth;
|
float xscale = (float)refState.width / (float)clgame.scrInfo.iWidth;
|
||||||
float yscale = (float)refState.height / (float)clgame.scrInfo.iHeight;
|
float yscale = (float)refState.height / (float)clgame.scrInfo.iHeight;
|
||||||
int x, y;
|
int x, y;
|
||||||
|
|
||||||
Platform_GetMousePos( &x, &y );
|
Platform_GetMousePos( &x, &y );
|
||||||
*_x = x / xscale, *_y = y / yscale;
|
*_x = x / xscale;
|
||||||
|
*_y = y / yscale;
|
||||||
}
|
}
|
||||||
|
|
||||||
void VGUI_InitCursors( void )
|
static void GAME_EXPORT VGUI_CursorSelect( VGUI_DefaultCursor cursor )
|
||||||
{
|
{
|
||||||
// load up all default cursors
|
if( vgui.cursor != cursor )
|
||||||
#if SDL_VERSION_ATLEAST( 2, 0, 0 )
|
Platform_SetCursorType( cursor );
|
||||||
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 )
|
static byte GAME_EXPORT VGUI_GetColor( int i, int j )
|
||||||
{
|
|
||||||
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;
|
|
||||||
|
|
||||||
s_currentCursor = cursor;
|
|
||||||
host.mouse_visible = visible;
|
|
||||||
}
|
|
||||||
|
|
||||||
byte GAME_EXPORT VGUI_GetColor( int i, int j)
|
|
||||||
{
|
{
|
||||||
return g_color_table[i][j];
|
return g_color_table[i][j];
|
||||||
}
|
}
|
||||||
|
|
||||||
// Define and initialize vgui API
|
static int GAME_EXPORT VGUI_UtfProcessChar( int in )
|
||||||
|
|
||||||
void GAME_EXPORT VGUI_SetVisible( qboolean state )
|
|
||||||
{
|
{
|
||||||
host.mouse_visible=state;
|
if( vgui_utf8.value )
|
||||||
#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 ) )
|
|
||||||
return Con_UtfProcessCharForce( in );
|
return Con_UtfProcessCharForce( in );
|
||||||
else
|
return in;
|
||||||
return in;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
vguiapi_t vgui =
|
qboolean VGui_IsActive( void )
|
||||||
|
{
|
||||||
|
return vgui.initialized;
|
||||||
|
}
|
||||||
|
|
||||||
|
static vgui_support_api_t gEngfuncs =
|
||||||
{
|
{
|
||||||
false, // Not initialized yet
|
|
||||||
NULL, // VGUI_DrawInit,
|
NULL, // VGUI_DrawInit,
|
||||||
NULL, // VGUI_DrawShutdown,
|
NULL, // VGUI_DrawShutdown,
|
||||||
NULL, // VGUI_SetupDrawingText,
|
NULL, // VGUI_SetupDrawingText,
|
||||||
@@ -174,29 +108,21 @@ vguiapi_t vgui =
|
|||||||
NULL, // VGUI_GetTextureSizes,
|
NULL, // VGUI_GetTextureSizes,
|
||||||
NULL, // VGUI_GenerateTexture,
|
NULL, // VGUI_GenerateTexture,
|
||||||
VGUI_EngineMalloc,
|
VGUI_EngineMalloc,
|
||||||
/* VGUI_ShowCursor,
|
|
||||||
VGUI_HideCursor,*/
|
|
||||||
VGUI_CursorSelect,
|
VGUI_CursorSelect,
|
||||||
VGUI_GetColor,
|
VGUI_GetColor,
|
||||||
VGUI_IsInGame,
|
VGUI_IsInGame,
|
||||||
VGUI_SetVisible,
|
Key_EnableTextInput,
|
||||||
VGUI_GetMousePos,
|
VGUI_GetMousePos,
|
||||||
VGUI_UtfProcessChar,
|
VGUI_UtfProcessChar,
|
||||||
NULL,
|
Platform_GetClipboardText,
|
||||||
NULL,
|
Platform_SetClipboardText,
|
||||||
NULL,
|
Platform_GetKeyModifiers,
|
||||||
NULL,
|
COM_LoadLibrary,
|
||||||
NULL,
|
COM_FreeLibrary,
|
||||||
NULL,
|
COM_GetProcAddress,
|
||||||
NULL,
|
|
||||||
};
|
};
|
||||||
|
|
||||||
qboolean VGui_IsActive( void )
|
static void VGui_FillAPIFromRef( vgui_support_api_t *to, const ref_interface_t *from )
|
||||||
{
|
|
||||||
return vgui.initialized;
|
|
||||||
}
|
|
||||||
|
|
||||||
void VGui_FillAPIFromRef( vguiapi_t *to, const ref_interface_t *from )
|
|
||||||
{
|
{
|
||||||
to->DrawInit = from->VGUI_DrawInit;
|
to->DrawInit = from->VGUI_DrawInit;
|
||||||
to->DrawShutdown = from->VGUI_DrawShutdown;
|
to->DrawShutdown = from->VGUI_DrawShutdown;
|
||||||
@@ -213,127 +139,184 @@ void VGui_FillAPIFromRef( vguiapi_t *to, const ref_interface_t *from )
|
|||||||
to->GenerateTexture = from->VGUI_GenerateTexture;
|
to->GenerateTexture = from->VGUI_GenerateTexture;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void VGui_RegisterCvars( void )
|
||||||
|
{
|
||||||
|
Cvar_RegisterVariable( &vgui_utf8 );
|
||||||
|
}
|
||||||
|
|
||||||
|
static HINSTANCE VGui_LoadSupportLibrary( void )
|
||||||
|
{
|
||||||
|
string vguiloader;
|
||||||
|
string vguilib;
|
||||||
|
HINSTANCE hInstance;
|
||||||
|
|
||||||
|
// HACKHACK: try to load path from custom path
|
||||||
|
// to support having different versions of VGUI
|
||||||
|
if( Sys_GetParmFromCmdLine( "-vguilib", vguilib ) && !COM_LoadLibrary( vguilib, false, false ))
|
||||||
|
{
|
||||||
|
Con_Reportf( S_WARN "VGUI preloading failed. Default library will be used! Reason: %s", COM_GetLibraryError());
|
||||||
|
}
|
||||||
|
|
||||||
|
if( !Sys_GetParmFromCmdLine( "-vguiloader", vguiloader ))
|
||||||
|
{
|
||||||
|
Q_strncpy( vguiloader, VGUI_SUPPORT_DLL, sizeof( vguiloader ));
|
||||||
|
}
|
||||||
|
|
||||||
|
hInstance = COM_LoadLibrary( vguiloader, false, false );
|
||||||
|
|
||||||
|
if( !hInstance )
|
||||||
|
{
|
||||||
|
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" );
|
||||||
|
}
|
||||||
|
|
||||||
|
return hInstance;
|
||||||
|
}
|
||||||
|
|
||||||
|
static qboolean VGui_ProbeNewAPI( HINSTANCE hInstance,
|
||||||
|
vgui_support_interface_t *iface, const vgui_support_api_t *api )
|
||||||
|
{
|
||||||
|
const int version = VGUI_SUPPORT_API_VERSION;
|
||||||
|
static vgui_support_api_t localapi;
|
||||||
|
VGUISUPPORTAPI F;
|
||||||
|
|
||||||
|
F = COM_GetProcAddress( hInstance, GET_VGUI_SUPPORT_API );
|
||||||
|
|
||||||
|
if( !F )
|
||||||
|
return false;
|
||||||
|
|
||||||
|
// keep local temporary copy, do not let vgui_support to mess up here
|
||||||
|
memcpy( &localapi, api, sizeof( localapi ));
|
||||||
|
|
||||||
|
if( F( version, iface, &localapi ) != version )
|
||||||
|
return false;
|
||||||
|
|
||||||
|
Con_Reportf( "vgui_support: initialized new API\n" );
|
||||||
|
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
static qboolean VGui_ProbeOldAPI( HINSTANCE hInstance,
|
||||||
|
vgui_support_interface_t *iface, const vgui_support_api_t *api,
|
||||||
|
qboolean client )
|
||||||
|
{
|
||||||
|
static legacy_vguiapi_t localapi;
|
||||||
|
LEGACY_VGUISUPPORTAPI F;
|
||||||
|
|
||||||
|
F = COM_GetProcAddress( hInstance, client ? LEGACY_CLIENT_GET_VGUI_SUPPORT_API : LEGACY_GET_VGUI_SUPPORT_API );
|
||||||
|
|
||||||
|
if( !F )
|
||||||
|
return false;
|
||||||
|
|
||||||
|
memset( &localapi, 0, sizeof( localapi ));
|
||||||
|
localapi.DrawInit = api->DrawInit;
|
||||||
|
localapi.DrawShutdown = api->DrawShutdown;
|
||||||
|
localapi.SetupDrawingText = api->SetupDrawingText;
|
||||||
|
localapi.SetupDrawingRect = api->SetupDrawingRect;
|
||||||
|
localapi.SetupDrawingImage = api->SetupDrawingImage;
|
||||||
|
localapi.BindTexture = api->BindTexture;
|
||||||
|
localapi.EnableTexture = api->EnableTexture;
|
||||||
|
localapi.CreateTexture = api->CreateTexture;
|
||||||
|
localapi.UploadTexture = api->UploadTexture;
|
||||||
|
localapi.UploadTextureBlock = api->UploadTextureBlock;
|
||||||
|
localapi.DrawQuad = api->DrawQuad;
|
||||||
|
localapi.GetTextureSizes = api->GetTextureSizes;
|
||||||
|
localapi.GenerateTexture = api->GenerateTexture;
|
||||||
|
localapi.EngineMalloc = api->EngineMalloc;
|
||||||
|
localapi.CursorSelect = api->CursorSelect;
|
||||||
|
localapi.GetColor = api->GetColor;
|
||||||
|
localapi.IsInGame = api->IsInGame;
|
||||||
|
localapi.EnableTextInput = api->EnableTextInput;
|
||||||
|
localapi.GetCursorPos = api->GetCursorPos;
|
||||||
|
localapi.ProcessUtfChar = api->ProcessUtfChar;
|
||||||
|
localapi.GetClipboardText = api->GetClipboardText;
|
||||||
|
localapi.SetClipboardText = api->SetClipboardText;
|
||||||
|
localapi.GetKeyModifiers = api->GetKeyModifiers;
|
||||||
|
|
||||||
|
F( &localapi );
|
||||||
|
|
||||||
|
localapi.initialized = true;
|
||||||
|
|
||||||
|
iface->Startup = localapi.Startup;
|
||||||
|
iface->Shutdown = localapi.Shutdown;
|
||||||
|
iface->GetPanel = localapi.GetPanel;
|
||||||
|
iface->Paint = localapi.Paint;
|
||||||
|
iface->Mouse = localapi.Mouse;
|
||||||
|
iface->Key = localapi.Key;
|
||||||
|
iface->MouseMove = localapi.MouseMove;
|
||||||
|
iface->TextInput = localapi.TextInput;
|
||||||
|
|
||||||
|
Con_Reportf( "vgui_support: initialized legacy API in %s module\n", client ? "client" : "support" );
|
||||||
|
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
qboolean VGui_LoadProgs( HINSTANCE hInstance )
|
||||||
|
{
|
||||||
|
LEGACY_VGUISUPPORTAPI F;
|
||||||
|
qboolean client = hInstance != NULL;
|
||||||
|
|
||||||
|
// not loading interface from client.dll, load vgui_support.dll instead
|
||||||
|
if( !client )
|
||||||
|
{
|
||||||
|
hInstance = vgui.hInstance = VGui_LoadSupportLibrary();
|
||||||
|
|
||||||
|
if( !hInstance )
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
// prepare api funcs
|
||||||
|
VGui_FillAPIFromRef( &gEngfuncs, &ref.dllFuncs );
|
||||||
|
|
||||||
|
// try new API first
|
||||||
|
if( !VGui_ProbeNewAPI( vgui.hInstance, &vgui.dllFuncs, &gEngfuncs ))
|
||||||
|
{
|
||||||
|
// try legacy API next
|
||||||
|
if( !VGui_ProbeOldAPI( vgui.hInstance, &vgui.dllFuncs, &gEngfuncs, client ))
|
||||||
|
{
|
||||||
|
Con_Reportf( S_ERROR "Failed to find VGUI support API entry point in %s module\n", client ? "client" : "support" );
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
vgui.initialized = true;
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
================
|
================
|
||||||
VGui_Startup
|
VGui_Startup
|
||||||
|
|
||||||
Load vgui_support library and call VGui_Startup
|
|
||||||
================
|
================
|
||||||
*/
|
*/
|
||||||
void VGui_Startup( const char *clientlib, int width, int height )
|
void VGui_Startup( HINSTANCE clientInstance, int width, int height )
|
||||||
{
|
{
|
||||||
static qboolean failed = false;
|
// vgui not initialized from both support and client modules, skip
|
||||||
|
if( !vgui.initialized )
|
||||||
void (*F) ( vguiapi_t * );
|
|
||||||
char vguiloader[256];
|
|
||||||
char vguilib[256];
|
|
||||||
|
|
||||||
vguiloader[0] = vguilib[0] = '\0';
|
|
||||||
|
|
||||||
if( failed )
|
|
||||||
return;
|
return;
|
||||||
|
|
||||||
if( !vgui.initialized )
|
height = Q_max( 480, height );
|
||||||
|
|
||||||
|
if( width <= 640 ) width = 640;
|
||||||
|
else if( width <= 800 ) width = 800;
|
||||||
|
else if( width <= 1024 ) width = 1024;
|
||||||
|
else if( width <= 1152 ) width = 1152;
|
||||||
|
else if( width <= 1280 ) width = 1280;
|
||||||
|
else if( width <= 1600 ) width = 1600;
|
||||||
|
|
||||||
|
if( !clientInstance )
|
||||||
{
|
{
|
||||||
vgui_utf8 = Cvar_Get( "vgui_utf8", "0", FCVAR_ARCHIVE, "enable utf-8 support for vgui text" );
|
if( vgui.dllFuncs.Startup )
|
||||||
|
vgui.dllFuncs.Startup( width, height );
|
||||||
VGui_FillAPIFromRef( &vgui, &ref.dllFuncs );
|
|
||||||
|
|
||||||
#ifdef XASH_INTERNAL_GAMELIBS
|
|
||||||
s_pVGuiSupport = COM_LoadLibrary( clientlib, false, false );
|
|
||||||
|
|
||||||
if( s_pVGuiSupport )
|
|
||||||
{
|
|
||||||
F = COM_GetProcAddress( s_pVGuiSupport, "InitVGUISupportAPI" );
|
|
||||||
if( F )
|
|
||||||
{
|
|
||||||
F( &vgui );
|
|
||||||
vgui.initialized = true;
|
|
||||||
VGUI_InitCursors();
|
|
||||||
Con_Reportf( "vgui_support: found interal client support\n" );
|
|
||||||
}
|
|
||||||
}
|
|
||||||
#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( 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 );
|
|
||||||
|
|
||||||
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 )
|
|
||||||
{
|
|
||||||
F( &vgui );
|
|
||||||
vgui.initialized = true;
|
|
||||||
VGUI_InitCursors();
|
|
||||||
}
|
|
||||||
else
|
|
||||||
Con_Reportf( S_ERROR "Failed to find vgui_support library entry point!\n" );
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
else
|
||||||
if( height < 480 )
|
|
||||||
height = 480;
|
|
||||||
|
|
||||||
if( width <= 640 )
|
|
||||||
width = 640;
|
|
||||||
else if( width <= 800 )
|
|
||||||
width = 800;
|
|
||||||
else if( width <= 1024 )
|
|
||||||
width = 1024;
|
|
||||||
else if( width <= 1152 )
|
|
||||||
width = 1152;
|
|
||||||
else if( width <= 1280 )
|
|
||||||
width = 1280;
|
|
||||||
else if( width <= 1600 )
|
|
||||||
width = 1600;
|
|
||||||
#ifdef DLL_LOADER
|
|
||||||
else if ( Q_strstr( vguiloader, ".dll" ) )
|
|
||||||
width = 1600;
|
|
||||||
#endif
|
|
||||||
|
|
||||||
|
|
||||||
if( vgui.initialized )
|
|
||||||
{
|
{
|
||||||
//host.mouse_visible = true;
|
if( vgui.dllFuncs.ClientStartup )
|
||||||
vgui.Startup( width, height );
|
vgui.dllFuncs.ClientStartup( clientInstance, width, height );
|
||||||
}
|
}
|
||||||
else failed = true;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
================
|
================
|
||||||
VGui_Shutdown
|
VGui_Shutdown
|
||||||
@@ -343,208 +326,223 @@ Unload vgui_support library and call VGui_Shutdown
|
|||||||
*/
|
*/
|
||||||
void VGui_Shutdown( void )
|
void VGui_Shutdown( void )
|
||||||
{
|
{
|
||||||
if( vgui.Shutdown )
|
if( vgui.dllFuncs.Shutdown )
|
||||||
vgui.Shutdown();
|
vgui.dllFuncs.Shutdown();
|
||||||
|
|
||||||
if( s_pVGuiSupport )
|
if( vgui.hInstance )
|
||||||
COM_FreeLibrary( s_pVGuiSupport );
|
COM_FreeLibrary( vgui.hInstance );
|
||||||
s_pVGuiSupport = NULL;
|
|
||||||
|
|
||||||
|
vgui.hInstance = NULL;
|
||||||
vgui.initialized = false;
|
vgui.initialized = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void VGUI_InitKeyTranslationTable( void )
|
static void VGUI_InitKeyTranslationTable( void )
|
||||||
{
|
{
|
||||||
static qboolean bInitted = false;
|
static qboolean initialized = false;
|
||||||
|
|
||||||
if( bInitted )
|
if( initialized ) return;
|
||||||
return;
|
|
||||||
bInitted = true;
|
initialized = true;
|
||||||
|
|
||||||
// set virtual key translation table
|
// set virtual key translation table
|
||||||
memset( s_pVirtualKeyTrans, -1, sizeof( s_pVirtualKeyTrans ) );
|
memset( vgui.virtualKeyTrans, -1, sizeof( vgui.virtualKeyTrans ) );
|
||||||
|
|
||||||
s_pVirtualKeyTrans['0'] = KEY_0;
|
// TODO: engine keys are not enough here!
|
||||||
s_pVirtualKeyTrans['1'] = KEY_1;
|
// make crossplatform way to pass SDL keys here
|
||||||
s_pVirtualKeyTrans['2'] = KEY_2;
|
|
||||||
s_pVirtualKeyTrans['3'] = KEY_3;
|
|
||||||
s_pVirtualKeyTrans['4'] = KEY_4;
|
|
||||||
s_pVirtualKeyTrans['5'] = KEY_5;
|
|
||||||
s_pVirtualKeyTrans['6'] = KEY_6;
|
|
||||||
s_pVirtualKeyTrans['7'] = KEY_7;
|
|
||||||
s_pVirtualKeyTrans['8'] = KEY_8;
|
|
||||||
s_pVirtualKeyTrans['9'] = KEY_9;
|
|
||||||
s_pVirtualKeyTrans['A'] = s_pVirtualKeyTrans['a'] = KEY_A;
|
|
||||||
s_pVirtualKeyTrans['B'] = s_pVirtualKeyTrans['b'] = KEY_B;
|
|
||||||
s_pVirtualKeyTrans['C'] = s_pVirtualKeyTrans['c'] = KEY_C;
|
|
||||||
s_pVirtualKeyTrans['D'] = s_pVirtualKeyTrans['d'] = KEY_D;
|
|
||||||
s_pVirtualKeyTrans['E'] = s_pVirtualKeyTrans['e'] = KEY_E;
|
|
||||||
s_pVirtualKeyTrans['F'] = s_pVirtualKeyTrans['f'] = KEY_F;
|
|
||||||
s_pVirtualKeyTrans['G'] = s_pVirtualKeyTrans['g'] = KEY_G;
|
|
||||||
s_pVirtualKeyTrans['H'] = s_pVirtualKeyTrans['h'] = KEY_H;
|
|
||||||
s_pVirtualKeyTrans['I'] = s_pVirtualKeyTrans['i'] = KEY_I;
|
|
||||||
s_pVirtualKeyTrans['J'] = s_pVirtualKeyTrans['j'] = KEY_J;
|
|
||||||
s_pVirtualKeyTrans['K'] = s_pVirtualKeyTrans['k'] = KEY_K;
|
|
||||||
s_pVirtualKeyTrans['L'] = s_pVirtualKeyTrans['l'] = KEY_L;
|
|
||||||
s_pVirtualKeyTrans['M'] = s_pVirtualKeyTrans['m'] = KEY_M;
|
|
||||||
s_pVirtualKeyTrans['N'] = s_pVirtualKeyTrans['n'] = KEY_N;
|
|
||||||
s_pVirtualKeyTrans['O'] = s_pVirtualKeyTrans['o'] = KEY_O;
|
|
||||||
s_pVirtualKeyTrans['P'] = s_pVirtualKeyTrans['p'] = KEY_P;
|
|
||||||
s_pVirtualKeyTrans['Q'] = s_pVirtualKeyTrans['q'] = KEY_Q;
|
|
||||||
s_pVirtualKeyTrans['R'] = s_pVirtualKeyTrans['r'] = KEY_R;
|
|
||||||
s_pVirtualKeyTrans['S'] = s_pVirtualKeyTrans['s'] = KEY_S;
|
|
||||||
s_pVirtualKeyTrans['T'] = s_pVirtualKeyTrans['t'] = KEY_T;
|
|
||||||
s_pVirtualKeyTrans['U'] = s_pVirtualKeyTrans['u'] = KEY_U;
|
|
||||||
s_pVirtualKeyTrans['V'] = s_pVirtualKeyTrans['v'] = KEY_V;
|
|
||||||
s_pVirtualKeyTrans['W'] = s_pVirtualKeyTrans['w'] = KEY_W;
|
|
||||||
s_pVirtualKeyTrans['X'] = s_pVirtualKeyTrans['x'] = KEY_X;
|
|
||||||
s_pVirtualKeyTrans['Y'] = s_pVirtualKeyTrans['y'] = KEY_Y;
|
|
||||||
s_pVirtualKeyTrans['Z'] = s_pVirtualKeyTrans['z'] = KEY_Z;
|
|
||||||
|
|
||||||
s_pVirtualKeyTrans[K_KP_5 - 5] = KEY_PAD_0;
|
vgui.virtualKeyTrans['0'] = KEY_0;
|
||||||
s_pVirtualKeyTrans[K_KP_5 - 4] = KEY_PAD_1;
|
vgui.virtualKeyTrans['1'] = KEY_1;
|
||||||
s_pVirtualKeyTrans[K_KP_5 - 3] = KEY_PAD_2;
|
vgui.virtualKeyTrans['2'] = KEY_2;
|
||||||
s_pVirtualKeyTrans[K_KP_5 - 2] = KEY_PAD_3;
|
vgui.virtualKeyTrans['3'] = KEY_3;
|
||||||
s_pVirtualKeyTrans[K_KP_5 - 1] = KEY_PAD_4;
|
vgui.virtualKeyTrans['4'] = KEY_4;
|
||||||
s_pVirtualKeyTrans[K_KP_5 - 0] = KEY_PAD_5;
|
vgui.virtualKeyTrans['5'] = KEY_5;
|
||||||
s_pVirtualKeyTrans[K_KP_5 + 1] = KEY_PAD_6;
|
vgui.virtualKeyTrans['6'] = KEY_6;
|
||||||
s_pVirtualKeyTrans[K_KP_5 + 2] = KEY_PAD_7;
|
vgui.virtualKeyTrans['7'] = KEY_7;
|
||||||
s_pVirtualKeyTrans[K_KP_5 + 3] = KEY_PAD_8;
|
vgui.virtualKeyTrans['8'] = KEY_8;
|
||||||
s_pVirtualKeyTrans[K_KP_5 + 4] = KEY_PAD_9;
|
vgui.virtualKeyTrans['9'] = KEY_9;
|
||||||
s_pVirtualKeyTrans[K_KP_SLASH] = KEY_PAD_DIVIDE;
|
vgui.virtualKeyTrans['A'] = vgui.virtualKeyTrans['a'] = KEY_A;
|
||||||
s_pVirtualKeyTrans['*'] = KEY_PAD_MULTIPLY;
|
vgui.virtualKeyTrans['B'] = vgui.virtualKeyTrans['b'] = KEY_B;
|
||||||
s_pVirtualKeyTrans[K_KP_MINUS] = KEY_PAD_MINUS;
|
vgui.virtualKeyTrans['C'] = vgui.virtualKeyTrans['c'] = KEY_C;
|
||||||
s_pVirtualKeyTrans[K_KP_PLUS] = KEY_PAD_PLUS;
|
vgui.virtualKeyTrans['D'] = vgui.virtualKeyTrans['d'] = KEY_D;
|
||||||
s_pVirtualKeyTrans[K_KP_ENTER] = KEY_PAD_ENTER;
|
vgui.virtualKeyTrans['E'] = vgui.virtualKeyTrans['e'] = KEY_E;
|
||||||
//s_pVirtualKeyTrans[K_KP_DECIMAL] = KEY_PAD_DECIMAL;
|
vgui.virtualKeyTrans['F'] = vgui.virtualKeyTrans['f'] = KEY_F;
|
||||||
s_pVirtualKeyTrans['['] = KEY_LBRACKET;
|
vgui.virtualKeyTrans['G'] = vgui.virtualKeyTrans['g'] = KEY_G;
|
||||||
s_pVirtualKeyTrans[']'] = KEY_RBRACKET;
|
vgui.virtualKeyTrans['H'] = vgui.virtualKeyTrans['h'] = KEY_H;
|
||||||
s_pVirtualKeyTrans[';'] = KEY_SEMICOLON;
|
vgui.virtualKeyTrans['I'] = vgui.virtualKeyTrans['i'] = KEY_I;
|
||||||
s_pVirtualKeyTrans['\''] = KEY_APOSTROPHE;
|
vgui.virtualKeyTrans['J'] = vgui.virtualKeyTrans['j'] = KEY_J;
|
||||||
s_pVirtualKeyTrans['`'] = KEY_BACKQUOTE;
|
vgui.virtualKeyTrans['K'] = vgui.virtualKeyTrans['k'] = KEY_K;
|
||||||
s_pVirtualKeyTrans[','] = KEY_COMMA;
|
vgui.virtualKeyTrans['L'] = vgui.virtualKeyTrans['l'] = KEY_L;
|
||||||
s_pVirtualKeyTrans['.'] = KEY_PERIOD;
|
vgui.virtualKeyTrans['M'] = vgui.virtualKeyTrans['m'] = KEY_M;
|
||||||
s_pVirtualKeyTrans[K_KP_SLASH] = KEY_SLASH;
|
vgui.virtualKeyTrans['N'] = vgui.virtualKeyTrans['n'] = KEY_N;
|
||||||
s_pVirtualKeyTrans['\\'] = KEY_BACKSLASH;
|
vgui.virtualKeyTrans['O'] = vgui.virtualKeyTrans['o'] = KEY_O;
|
||||||
s_pVirtualKeyTrans['-'] = KEY_MINUS;
|
vgui.virtualKeyTrans['P'] = vgui.virtualKeyTrans['p'] = KEY_P;
|
||||||
s_pVirtualKeyTrans['='] = KEY_EQUAL;
|
vgui.virtualKeyTrans['Q'] = vgui.virtualKeyTrans['q'] = KEY_Q;
|
||||||
s_pVirtualKeyTrans[K_ENTER] = KEY_ENTER;
|
vgui.virtualKeyTrans['R'] = vgui.virtualKeyTrans['r'] = KEY_R;
|
||||||
s_pVirtualKeyTrans[K_SPACE] = KEY_SPACE;
|
vgui.virtualKeyTrans['S'] = vgui.virtualKeyTrans['s'] = KEY_S;
|
||||||
s_pVirtualKeyTrans[K_BACKSPACE] = KEY_BACKSPACE;
|
vgui.virtualKeyTrans['T'] = vgui.virtualKeyTrans['t'] = KEY_T;
|
||||||
s_pVirtualKeyTrans[K_TAB] = KEY_TAB;
|
vgui.virtualKeyTrans['U'] = vgui.virtualKeyTrans['u'] = KEY_U;
|
||||||
s_pVirtualKeyTrans[K_CAPSLOCK] = KEY_CAPSLOCK;
|
vgui.virtualKeyTrans['V'] = vgui.virtualKeyTrans['v'] = KEY_V;
|
||||||
s_pVirtualKeyTrans[K_KP_NUMLOCK] = KEY_NUMLOCK;
|
vgui.virtualKeyTrans['W'] = vgui.virtualKeyTrans['w'] = KEY_W;
|
||||||
s_pVirtualKeyTrans[K_ESCAPE] = KEY_ESCAPE;
|
vgui.virtualKeyTrans['X'] = vgui.virtualKeyTrans['x'] = KEY_X;
|
||||||
//s_pVirtualKeyTrans[K_KP_SCROLLLOCK] = KEY_SCROLLLOCK;
|
vgui.virtualKeyTrans['Y'] = vgui.virtualKeyTrans['y'] = KEY_Y;
|
||||||
s_pVirtualKeyTrans[K_INS] = KEY_INSERT;
|
vgui.virtualKeyTrans['Z'] = vgui.virtualKeyTrans['z'] = KEY_Z;
|
||||||
s_pVirtualKeyTrans[K_DEL] = KEY_DELETE;
|
|
||||||
s_pVirtualKeyTrans[K_HOME] = KEY_HOME;
|
vgui.virtualKeyTrans[K_KP_5 - 5] = KEY_PAD_0;
|
||||||
s_pVirtualKeyTrans[K_END] = KEY_END;
|
vgui.virtualKeyTrans[K_KP_5 - 4] = KEY_PAD_1;
|
||||||
s_pVirtualKeyTrans[K_PGUP] = KEY_PAGEUP;
|
vgui.virtualKeyTrans[K_KP_5 - 3] = KEY_PAD_2;
|
||||||
s_pVirtualKeyTrans[K_PGDN] = KEY_PAGEDOWN;
|
vgui.virtualKeyTrans[K_KP_5 - 2] = KEY_PAD_3;
|
||||||
s_pVirtualKeyTrans[K_PAUSE] = KEY_BREAK;
|
vgui.virtualKeyTrans[K_KP_5 - 1] = KEY_PAD_4;
|
||||||
//s_pVirtualKeyTrans[K_SHIFT] = KEY_RSHIFT;
|
vgui.virtualKeyTrans[K_KP_5 - 0] = KEY_PAD_5;
|
||||||
s_pVirtualKeyTrans[K_SHIFT] = KEY_LSHIFT; // SHIFT -> left SHIFT
|
vgui.virtualKeyTrans[K_KP_5 + 1] = KEY_PAD_6;
|
||||||
//s_pVirtualKeyTrans[SDLK_RALT] = KEY_RALT;
|
vgui.virtualKeyTrans[K_KP_5 + 2] = KEY_PAD_7;
|
||||||
s_pVirtualKeyTrans[K_ALT] = KEY_LALT; // ALT -> left ALT
|
vgui.virtualKeyTrans[K_KP_5 + 3] = KEY_PAD_8;
|
||||||
//s_pVirtualKeyTrans[SDLK_RCTRL] = KEY_RCONTROL;
|
vgui.virtualKeyTrans[K_KP_5 + 4] = KEY_PAD_9;
|
||||||
s_pVirtualKeyTrans[K_CTRL] = KEY_LCONTROL; // CTRL -> left CTRL
|
vgui.virtualKeyTrans[K_KP_SLASH] = KEY_PAD_DIVIDE;
|
||||||
s_pVirtualKeyTrans[K_WIN] = KEY_LWIN;
|
vgui.virtualKeyTrans['*'] = KEY_PAD_MULTIPLY;
|
||||||
//s_pVirtualKeyTrans[SDLK_APPLICATION] = KEY_RWIN;
|
vgui.virtualKeyTrans[K_KP_MINUS] = KEY_PAD_MINUS;
|
||||||
//s_pVirtualKeyTrans[K_WIN] = KEY_APP;
|
vgui.virtualKeyTrans[K_KP_PLUS] = KEY_PAD_PLUS;
|
||||||
s_pVirtualKeyTrans[K_UPARROW] = KEY_UP;
|
vgui.virtualKeyTrans[K_KP_ENTER] = KEY_PAD_ENTER;
|
||||||
s_pVirtualKeyTrans[K_LEFTARROW] = KEY_LEFT;
|
vgui.virtualKeyTrans[K_KP_NUMLOCK] = KEY_NUMLOCK;
|
||||||
s_pVirtualKeyTrans[K_DOWNARROW] = KEY_DOWN;
|
vgui.virtualKeyTrans['['] = KEY_LBRACKET;
|
||||||
s_pVirtualKeyTrans[K_RIGHTARROW] = KEY_RIGHT;
|
vgui.virtualKeyTrans[']'] = KEY_RBRACKET;
|
||||||
s_pVirtualKeyTrans[K_F1] = KEY_F1;
|
vgui.virtualKeyTrans[';'] = KEY_SEMICOLON;
|
||||||
s_pVirtualKeyTrans[K_F2] = KEY_F2;
|
vgui.virtualKeyTrans['`'] = KEY_BACKQUOTE;
|
||||||
s_pVirtualKeyTrans[K_F3] = KEY_F3;
|
vgui.virtualKeyTrans[','] = KEY_COMMA;
|
||||||
s_pVirtualKeyTrans[K_F4] = KEY_F4;
|
vgui.virtualKeyTrans['.'] = KEY_PERIOD;
|
||||||
s_pVirtualKeyTrans[K_F5] = KEY_F5;
|
vgui.virtualKeyTrans['-'] = KEY_MINUS;
|
||||||
s_pVirtualKeyTrans[K_F6] = KEY_F6;
|
vgui.virtualKeyTrans['='] = KEY_EQUAL;
|
||||||
s_pVirtualKeyTrans[K_F7] = KEY_F7;
|
vgui.virtualKeyTrans['/'] = KEY_SLASH;
|
||||||
s_pVirtualKeyTrans[K_F8] = KEY_F8;
|
vgui.virtualKeyTrans['\\'] = KEY_BACKSLASH;
|
||||||
s_pVirtualKeyTrans[K_F9] = KEY_F9;
|
vgui.virtualKeyTrans['\''] = KEY_APOSTROPHE;
|
||||||
s_pVirtualKeyTrans[K_F10] = KEY_F10;
|
vgui.virtualKeyTrans[K_TAB] = KEY_TAB;
|
||||||
s_pVirtualKeyTrans[K_F11] = KEY_F11;
|
vgui.virtualKeyTrans[K_ENTER] = KEY_ENTER;
|
||||||
s_pVirtualKeyTrans[K_F12] = KEY_F12;
|
vgui.virtualKeyTrans[K_SPACE] = KEY_SPACE;
|
||||||
|
vgui.virtualKeyTrans[K_CAPSLOCK] = KEY_CAPSLOCK;
|
||||||
|
vgui.virtualKeyTrans[K_BACKSPACE] = KEY_BACKSPACE;
|
||||||
|
vgui.virtualKeyTrans[K_ESCAPE] = KEY_ESCAPE;
|
||||||
|
vgui.virtualKeyTrans[K_INS] = KEY_INSERT;
|
||||||
|
vgui.virtualKeyTrans[K_DEL] = KEY_DELETE;
|
||||||
|
vgui.virtualKeyTrans[K_HOME] = KEY_HOME;
|
||||||
|
vgui.virtualKeyTrans[K_END] = KEY_END;
|
||||||
|
vgui.virtualKeyTrans[K_PGUP] = KEY_PAGEUP;
|
||||||
|
vgui.virtualKeyTrans[K_PGDN] = KEY_PAGEDOWN;
|
||||||
|
vgui.virtualKeyTrans[K_PAUSE] = KEY_BREAK;
|
||||||
|
vgui.virtualKeyTrans[K_SHIFT] = KEY_LSHIFT; // SHIFT -> left SHIFT
|
||||||
|
vgui.virtualKeyTrans[K_ALT] = KEY_LALT; // ALT -> left ALT
|
||||||
|
vgui.virtualKeyTrans[K_CTRL] = KEY_LCONTROL; // CTRL -> left CTRL
|
||||||
|
vgui.virtualKeyTrans[K_WIN] = KEY_LWIN;
|
||||||
|
vgui.virtualKeyTrans[K_UPARROW] = KEY_UP;
|
||||||
|
vgui.virtualKeyTrans[K_LEFTARROW] = KEY_LEFT;
|
||||||
|
vgui.virtualKeyTrans[K_DOWNARROW] = KEY_DOWN;
|
||||||
|
vgui.virtualKeyTrans[K_RIGHTARROW] = KEY_RIGHT;
|
||||||
|
vgui.virtualKeyTrans[K_F1] = KEY_F1;
|
||||||
|
vgui.virtualKeyTrans[K_F2] = KEY_F2;
|
||||||
|
vgui.virtualKeyTrans[K_F3] = KEY_F3;
|
||||||
|
vgui.virtualKeyTrans[K_F4] = KEY_F4;
|
||||||
|
vgui.virtualKeyTrans[K_F5] = KEY_F5;
|
||||||
|
vgui.virtualKeyTrans[K_F6] = KEY_F6;
|
||||||
|
vgui.virtualKeyTrans[K_F7] = KEY_F7;
|
||||||
|
vgui.virtualKeyTrans[K_F8] = KEY_F8;
|
||||||
|
vgui.virtualKeyTrans[K_F9] = KEY_F9;
|
||||||
|
vgui.virtualKeyTrans[K_F10] = KEY_F10;
|
||||||
|
vgui.virtualKeyTrans[K_F11] = KEY_F11;
|
||||||
|
vgui.virtualKeyTrans[K_F12] = KEY_F12;
|
||||||
}
|
}
|
||||||
|
|
||||||
enum VGUI_KeyCode VGUI_MapKey( int keyCode )
|
static enum VGUI_KeyCode VGUI_MapKey( int keyCode )
|
||||||
{
|
{
|
||||||
VGUI_InitKeyTranslationTable();
|
VGUI_InitKeyTranslationTable();
|
||||||
|
|
||||||
if( keyCode < 0 || keyCode >= (int)sizeof( s_pVirtualKeyTrans ) / (int)sizeof( s_pVirtualKeyTrans[0] ))
|
if( keyCode >= 0 && keyCode < ARRAYSIZE( vgui.virtualKeyTrans ))
|
||||||
|
return vgui.virtualKeyTrans[keyCode];
|
||||||
|
|
||||||
|
return (enum VGUI_KeyCode)-1;
|
||||||
|
}
|
||||||
|
|
||||||
|
void VGui_MouseEvent( int key, int clicks )
|
||||||
|
{
|
||||||
|
enum VGUI_MouseAction mact;
|
||||||
|
enum VGUI_MouseCode code;
|
||||||
|
|
||||||
|
if( !vgui.dllFuncs.Mouse )
|
||||||
|
return;
|
||||||
|
|
||||||
|
switch( key )
|
||||||
{
|
{
|
||||||
//Assert( false );
|
case K_MOUSE1: code = MOUSE_LEFT; break;
|
||||||
return (enum VGUI_KeyCode)-1;
|
case K_MOUSE2: code = MOUSE_RIGHT; break;
|
||||||
|
case K_MOUSE3: code = MOUSE_MIDDLE; break;
|
||||||
|
default: return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if( clicks >= 2 )
|
||||||
|
mact = MA_DOUBLE;
|
||||||
|
else if( clicks == 1 )
|
||||||
|
mact = MA_PRESSED;
|
||||||
else
|
else
|
||||||
{
|
mact = MA_RELEASED;
|
||||||
return s_pVirtualKeyTrans[keyCode];
|
|
||||||
}
|
vgui.dllFuncs.Mouse( mact, code );
|
||||||
|
}
|
||||||
|
|
||||||
|
void VGui_MWheelEvent( int y )
|
||||||
|
{
|
||||||
|
if( !vgui.dllFuncs.Mouse )
|
||||||
|
return;
|
||||||
|
|
||||||
|
vgui.dllFuncs.Mouse( MA_WHEEL, y );
|
||||||
}
|
}
|
||||||
|
|
||||||
void VGui_KeyEvent( int key, int down )
|
void VGui_KeyEvent( int key, int down )
|
||||||
{
|
{
|
||||||
if( !vgui.initialized )
|
enum VGUI_KeyCode code;
|
||||||
|
|
||||||
|
if( !vgui.dllFuncs.Key )
|
||||||
return;
|
return;
|
||||||
|
|
||||||
if( host.mouse_visible )
|
if(( code = VGUI_MapKey( key )) < 0 )
|
||||||
Key_EnableTextInput( true, false );
|
return;
|
||||||
|
|
||||||
switch( key )
|
if( down )
|
||||||
{
|
{
|
||||||
case K_MOUSE1:
|
vgui.dllFuncs.Key( KA_PRESSED, code );
|
||||||
vgui.Mouse( down ? MA_PRESSED : MA_RELEASED, MOUSE_LEFT );
|
vgui.dllFuncs.Key( KA_TYPED, code );
|
||||||
return;
|
|
||||||
case K_MOUSE2:
|
|
||||||
vgui.Mouse( down ? MA_PRESSED : MA_RELEASED, MOUSE_RIGHT );
|
|
||||||
return;
|
|
||||||
case K_MOUSE3:
|
|
||||||
vgui.Mouse( down ? MA_PRESSED : MA_RELEASED, MOUSE_MIDDLE );
|
|
||||||
return;
|
|
||||||
case K_MWHEELDOWN:
|
|
||||||
vgui.Mouse( MA_WHEEL, 1 );
|
|
||||||
return;
|
|
||||||
case K_MWHEELUP:
|
|
||||||
vgui.Mouse( MA_WHEEL, -1 );
|
|
||||||
return;
|
|
||||||
default:
|
|
||||||
break;
|
|
||||||
}
|
}
|
||||||
|
else vgui.dllFuncs.Key( KA_RELEASED, code );
|
||||||
if( down == 2 )
|
|
||||||
vgui.Key( KA_TYPED, VGUI_MapKey( key ) );
|
|
||||||
else
|
|
||||||
vgui.Key( down?KA_PRESSED:KA_RELEASED, VGUI_MapKey( key ) );
|
|
||||||
//Msg("VGui_KeyEvent %d %d %d\n", key, VGUI_MapKey( key ), down );
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void VGui_MouseMove( int x, int y )
|
void VGui_MouseMove( int x, int y )
|
||||||
{
|
{
|
||||||
float xscale = (float)refState.width / (float)clgame.scrInfo.iWidth;
|
if( vgui.dllFuncs.MouseMove )
|
||||||
float yscale = (float)refState.height / (float)clgame.scrInfo.iHeight;
|
{
|
||||||
if( vgui.initialized )
|
float xscale = (float)refState.width / (float)clgame.scrInfo.iWidth;
|
||||||
vgui.MouseMove( x / xscale, y / yscale );
|
float yscale = (float)refState.height / (float)clgame.scrInfo.iHeight;
|
||||||
|
vgui.dllFuncs.MouseMove( x / xscale, y / yscale );
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void VGui_Paint( void )
|
void VGui_Paint( void )
|
||||||
{
|
{
|
||||||
if(vgui.initialized)
|
if( vgui.dllFuncs.Paint )
|
||||||
vgui.Paint();
|
vgui.dllFuncs.Paint();
|
||||||
}
|
}
|
||||||
|
|
||||||
void VGui_RunFrame( void )
|
void VGui_UpdateInternalCursorState( VGUI_DefaultCursor cursorType )
|
||||||
{
|
{
|
||||||
//stub
|
vgui.cursor = cursorType;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void *GAME_EXPORT VGui_GetPanel( void )
|
void *GAME_EXPORT VGui_GetPanel( void )
|
||||||
{
|
{
|
||||||
if( vgui.initialized )
|
if( vgui.dllFuncs.GetPanel )
|
||||||
return vgui.GetPanel();
|
return vgui.dllFuncs.GetPanel();
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void VGui_ReportTextInput( const char *text )
|
||||||
|
{
|
||||||
|
if( vgui.dllFuncs.TextInput )
|
||||||
|
vgui.dllFuncs.TextInput( text );
|
||||||
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -16,24 +16,22 @@ GNU General Public License for more details.
|
|||||||
#ifndef VGUI_DRAW_H
|
#ifndef VGUI_DRAW_H
|
||||||
#define VGUI_DRAW_H
|
#define VGUI_DRAW_H
|
||||||
|
|
||||||
#ifdef __cplusplus
|
|
||||||
extern "C" {
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#include "port.h"
|
|
||||||
|
|
||||||
//
|
//
|
||||||
// vgui_draw.c
|
// vgui_draw.c
|
||||||
//
|
//
|
||||||
void VGui_Startup( const char *clientlib, int width, int height );
|
void VGui_RegisterCvars( void );
|
||||||
|
qboolean VGui_LoadProgs( HINSTANCE hInstance );
|
||||||
|
void VGui_Startup( HINSTANCE clientInstance, int width, int height );
|
||||||
void VGui_Shutdown( void );
|
void VGui_Shutdown( void );
|
||||||
void VGui_Paint( void );
|
void VGui_Paint( void );
|
||||||
void VGui_RunFrame( void );
|
void VGui_RunFrame( void );
|
||||||
|
void VGui_MouseEvent( int key, int clicks );
|
||||||
|
void VGui_MWheelEvent( int y );
|
||||||
void VGui_KeyEvent( int key, int down );
|
void VGui_KeyEvent( int key, int down );
|
||||||
void VGui_MouseMove( int x, int y );
|
void VGui_MouseMove( int x, int y );
|
||||||
qboolean VGui_IsActive( void );
|
qboolean VGui_IsActive( void );
|
||||||
void *VGui_GetPanel( void );
|
void *VGui_GetPanel( void );
|
||||||
#ifdef __cplusplus
|
void VGui_ReportTextInput( const char *text );
|
||||||
}
|
void VGui_UpdateInternalCursorState( VGUI_DefaultCursor cursorType );
|
||||||
#endif
|
|
||||||
#endif//VGUI_DRAW_H
|
#endif // VGUI_DRAW_H
|
||||||
|
|||||||
@@ -21,8 +21,8 @@ GNU General Public License for more details.
|
|||||||
#include "platform/platform.h"
|
#include "platform/platform.h"
|
||||||
|
|
||||||
#define WINDOW_NAME XASH_ENGINE_NAME " Window" // Half-Life
|
#define WINDOW_NAME XASH_ENGINE_NAME " Window" // Half-Life
|
||||||
convar_t *vid_displayfrequency;
|
|
||||||
convar_t *vid_fullscreen;
|
convar_t *vid_fullscreen;
|
||||||
|
convar_t *vid_mode;
|
||||||
convar_t *vid_brightness;
|
convar_t *vid_brightness;
|
||||||
convar_t *vid_gamma;
|
convar_t *vid_gamma;
|
||||||
convar_t *vid_highdpi;
|
convar_t *vid_highdpi;
|
||||||
@@ -66,19 +66,30 @@ void VID_InitDefaultResolution( void )
|
|||||||
R_SaveVideoMode
|
R_SaveVideoMode
|
||||||
=================
|
=================
|
||||||
*/
|
*/
|
||||||
void R_SaveVideoMode( int w, int h , int render_w, int render_h )
|
void R_SaveVideoMode( int w, int h, int render_w, int render_h )
|
||||||
{
|
{
|
||||||
|
if( !w || !h || !render_w || !render_h )
|
||||||
|
{
|
||||||
|
host.renderinfo_changed = false;
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
host.window_center_x = w / 2;
|
host.window_center_x = w / 2;
|
||||||
host.window_center_y = h / 2;
|
host.window_center_y = h / 2;
|
||||||
|
|
||||||
Cvar_SetValue( "width", w );
|
Cvar_SetValue( "width", w );
|
||||||
Cvar_SetValue( "height", h );
|
Cvar_SetValue( "height", h );
|
||||||
|
|
||||||
|
// immediately drop changed state or we may trigger
|
||||||
|
// video subsystem to reapply settings
|
||||||
|
host.renderinfo_changed = false;
|
||||||
|
|
||||||
|
if( refState.width == render_w && refState.height == render_h )
|
||||||
|
return;
|
||||||
|
|
||||||
refState.width = render_w;
|
refState.width = render_w;
|
||||||
refState.height = render_h;
|
refState.height = render_h;
|
||||||
|
|
||||||
host.renderinfo_changed = false;
|
|
||||||
|
|
||||||
// check for 4:3 or 5:4
|
// check for 4:3 or 5:4
|
||||||
if( render_w * 3 != render_h * 4 && render_w * 4 != render_h * 5 )
|
if( render_w * 3 != render_h * 4 && render_w * 4 != render_h * 5 )
|
||||||
refState.wideScreen = true;
|
refState.wideScreen = true;
|
||||||
@@ -175,20 +186,20 @@ void VID_Init( void )
|
|||||||
Cvar_Get( "width", "0", FCVAR_RENDERINFO|FCVAR_VIDRESTART, "screen width" );
|
Cvar_Get( "width", "0", FCVAR_RENDERINFO|FCVAR_VIDRESTART, "screen width" );
|
||||||
Cvar_Get( "height", "0", FCVAR_RENDERINFO|FCVAR_VIDRESTART, "screen height" );
|
Cvar_Get( "height", "0", FCVAR_RENDERINFO|FCVAR_VIDRESTART, "screen height" );
|
||||||
|
|
||||||
window_xpos = Cvar_Get( "_window_xpos", "130", FCVAR_RENDERINFO, "window position by horizontal" );
|
window_xpos = Cvar_Get( "_window_xpos", "-1", FCVAR_RENDERINFO, "window position by horizontal" );
|
||||||
window_ypos = Cvar_Get( "_window_ypos", "48", FCVAR_RENDERINFO, "window position by vertical" );
|
window_ypos = Cvar_Get( "_window_ypos", "-1", FCVAR_RENDERINFO, "window position by vertical" );
|
||||||
|
|
||||||
vid_gamma = Cvar_Get( "gamma", "2.5", FCVAR_ARCHIVE, "gamma amount" );
|
vid_gamma = Cvar_Get( "gamma", "2.5", FCVAR_ARCHIVE, "gamma amount" );
|
||||||
vid_brightness = Cvar_Get( "brightness", "0.0", FCVAR_ARCHIVE, "brightness factor" );
|
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_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_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_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" );
|
vid_scale = Cvar_Get( "vid_scale", "1.0", FCVAR_RENDERINFO|FCVAR_VIDRESTART, "pixel scale" );
|
||||||
|
|
||||||
// a1ba: planned to be named vid_mode for compability
|
// a1ba: planned to be named vid_mode for compability
|
||||||
// but supported mode list is filled by backends, so numbers are not portable any more
|
// 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
|
R_Init(); // init renderer
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -31,12 +31,11 @@ extern glwstate_t glw_state;
|
|||||||
#define VID_MIN_WIDTH 320
|
#define VID_MIN_WIDTH 320
|
||||||
|
|
||||||
extern convar_t *vid_fullscreen;
|
extern convar_t *vid_fullscreen;
|
||||||
extern convar_t *vid_displayfrequency;
|
|
||||||
extern convar_t *vid_highdpi;
|
extern convar_t *vid_highdpi;
|
||||||
extern convar_t *vid_rotate;
|
extern convar_t *vid_rotate;
|
||||||
extern convar_t *vid_scale;
|
extern convar_t *vid_scale;
|
||||||
|
|
||||||
extern convar_t *gl_wgl_msaa_samples;
|
extern convar_t *gl_msaa_samples;
|
||||||
void R_SaveVideoMode( int w, int h, int render_w, int render_h );
|
void R_SaveVideoMode( int w, int h, int render_w, int render_h );
|
||||||
void VID_CheckChanges( void );
|
void VID_CheckChanges( void );
|
||||||
const char *VID_GetModeString( int vid_mode );
|
const char *VID_GetModeString( int vid_mode );
|
||||||
|
|||||||
633
engine/client/voice.c
Normal file
633
engine/client/voice.c
Normal file
@@ -0,0 +1,633 @@
|
|||||||
|
/*
|
||||||
|
voice.c - voice chat implementation
|
||||||
|
Copyright (C) 2022 Velaron
|
||||||
|
Copyright (C) 2022 SNMetamorph
|
||||||
|
|
||||||
|
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.
|
||||||
|
*/
|
||||||
|
|
||||||
|
#define CUSTOM_MODES 1 // required to correctly link with Opus Custom
|
||||||
|
#include <opus_custom.h>
|
||||||
|
#include "common.h"
|
||||||
|
#include "client.h"
|
||||||
|
#include "voice.h"
|
||||||
|
|
||||||
|
voice_state_t voice = { 0 };
|
||||||
|
|
||||||
|
CVAR_DEFINE_AUTO( voice_enable, "1", FCVAR_PRIVILEGED|FCVAR_ARCHIVE, "enable voice chat" );
|
||||||
|
CVAR_DEFINE_AUTO( voice_loopback, "0", FCVAR_PRIVILEGED, "loopback voice back to the speaker" );
|
||||||
|
CVAR_DEFINE_AUTO( voice_scale, "1.0", FCVAR_PRIVILEGED|FCVAR_ARCHIVE, "incoming voice volume scale" );
|
||||||
|
CVAR_DEFINE_AUTO( voice_avggain, "0.5", FCVAR_PRIVILEGED|FCVAR_ARCHIVE, "automatic voice gain control (average)" );
|
||||||
|
CVAR_DEFINE_AUTO( voice_maxgain, "5.0", FCVAR_PRIVILEGED|FCVAR_ARCHIVE, "automatic voice gain control (maximum)" );
|
||||||
|
CVAR_DEFINE_AUTO( voice_inputfromfile, "0", FCVAR_PRIVILEGED, "input voice from voice_input.wav" );
|
||||||
|
|
||||||
|
static void Voice_ApplyGainAdjust( int16_t *samples, int count );
|
||||||
|
|
||||||
|
/*
|
||||||
|
===============================================================================
|
||||||
|
|
||||||
|
OPUS INTEGRATION
|
||||||
|
|
||||||
|
===============================================================================
|
||||||
|
*/
|
||||||
|
|
||||||
|
/*
|
||||||
|
=========================
|
||||||
|
Voice_InitOpusDecoder
|
||||||
|
|
||||||
|
=========================
|
||||||
|
*/
|
||||||
|
static qboolean Voice_InitOpusDecoder( void )
|
||||||
|
{
|
||||||
|
int err;
|
||||||
|
|
||||||
|
voice.width = sizeof( opus_int16 );
|
||||||
|
voice.samplerate = VOICE_OPUS_CUSTOM_SAMPLERATE;
|
||||||
|
voice.frame_size = VOICE_OPUS_CUSTOM_FRAME_SIZE;
|
||||||
|
|
||||||
|
voice.custom_mode = opus_custom_mode_create( SOUND_44k, voice.frame_size, &err );
|
||||||
|
if( !voice.custom_mode )
|
||||||
|
{
|
||||||
|
Con_Printf( S_ERROR "Can't create Opus Custom mode: %s\n", opus_strerror( err ));
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
voice.decoder = opus_custom_decoder_create( voice.custom_mode, VOICE_PCM_CHANNELS, &err );
|
||||||
|
if( !voice.decoder )
|
||||||
|
{
|
||||||
|
Con_Printf( S_ERROR "Can't create Opus encoder: %s\n", opus_strerror( err ));
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
=========================
|
||||||
|
Voice_InitOpusEncoder
|
||||||
|
|
||||||
|
=========================
|
||||||
|
*/
|
||||||
|
static qboolean Voice_InitOpusEncoder( int quality )
|
||||||
|
{
|
||||||
|
int err;
|
||||||
|
|
||||||
|
voice.encoder = opus_custom_encoder_create( voice.custom_mode, VOICE_PCM_CHANNELS, &err );
|
||||||
|
if( !voice.encoder )
|
||||||
|
{
|
||||||
|
Con_Printf( S_ERROR "Can't create Opus encoder: %s\n", opus_strerror( err ));
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
switch( quality )
|
||||||
|
{
|
||||||
|
case 1: // 6 kbps
|
||||||
|
opus_custom_encoder_ctl( voice.encoder, OPUS_SET_BITRATE( 6000 ));
|
||||||
|
break;
|
||||||
|
case 2: // 12 kbps
|
||||||
|
opus_custom_encoder_ctl( voice.encoder, OPUS_SET_BITRATE( 12000 ));
|
||||||
|
break;
|
||||||
|
case 4: // 64 kbps
|
||||||
|
opus_custom_encoder_ctl( voice.encoder, OPUS_SET_BITRATE( 64000 ));
|
||||||
|
break;
|
||||||
|
case 5: // 96 kbps
|
||||||
|
opus_custom_encoder_ctl( voice.encoder, OPUS_SET_BITRATE( 96000 ));
|
||||||
|
break;
|
||||||
|
default: // 36 kbps
|
||||||
|
opus_custom_encoder_ctl( voice.encoder, OPUS_SET_BITRATE( 36000 ));
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
=========================
|
||||||
|
Voice_ShutdownOpusDecoder
|
||||||
|
|
||||||
|
=========================
|
||||||
|
*/
|
||||||
|
static void Voice_ShutdownOpusDecoder( void )
|
||||||
|
{
|
||||||
|
if( voice.decoder )
|
||||||
|
{
|
||||||
|
opus_custom_decoder_destroy( voice.decoder );
|
||||||
|
voice.decoder = NULL;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
=========================
|
||||||
|
Voice_ShutdownOpusEncoder
|
||||||
|
|
||||||
|
=========================
|
||||||
|
*/
|
||||||
|
static void Voice_ShutdownOpusEncoder( void )
|
||||||
|
{
|
||||||
|
if( voice.encoder )
|
||||||
|
{
|
||||||
|
opus_custom_encoder_destroy( voice.encoder );
|
||||||
|
voice.encoder = NULL;
|
||||||
|
}
|
||||||
|
|
||||||
|
if( voice.custom_mode )
|
||||||
|
{
|
||||||
|
opus_custom_mode_destroy( voice.custom_mode );
|
||||||
|
voice.custom_mode = NULL;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
=========================
|
||||||
|
Voice_GetOpusCompressedData
|
||||||
|
|
||||||
|
=========================
|
||||||
|
*/
|
||||||
|
static uint Voice_GetOpusCompressedData( byte *out, uint maxsize, uint *frames )
|
||||||
|
{
|
||||||
|
uint ofs = 0, size = 0;
|
||||||
|
uint frame_size_bytes = voice.frame_size * voice.width;
|
||||||
|
|
||||||
|
if( voice.input_file )
|
||||||
|
{
|
||||||
|
uint numbytes;
|
||||||
|
double updateInterval, curtime = Sys_DoubleTime();
|
||||||
|
|
||||||
|
updateInterval = curtime - voice.start_time;
|
||||||
|
voice.start_time = curtime;
|
||||||
|
|
||||||
|
numbytes = updateInterval * voice.samplerate * voice.width * VOICE_PCM_CHANNELS;
|
||||||
|
numbytes = Q_min( numbytes, voice.input_file->size - voice.input_file_pos );
|
||||||
|
numbytes = Q_min( numbytes, sizeof( voice.input_buffer ) - voice.input_buffer_pos );
|
||||||
|
|
||||||
|
memcpy( voice.input_buffer + voice.input_buffer_pos, voice.input_file->buffer + voice.input_file_pos, numbytes );
|
||||||
|
voice.input_buffer_pos += numbytes;
|
||||||
|
voice.input_file_pos += numbytes;
|
||||||
|
}
|
||||||
|
|
||||||
|
if( !voice.input_file )
|
||||||
|
VoiceCapture_Lock( true );
|
||||||
|
|
||||||
|
for( ofs = 0; voice.input_buffer_pos - ofs >= frame_size_bytes && ofs <= voice.input_buffer_pos; ofs += frame_size_bytes )
|
||||||
|
{
|
||||||
|
int bytes;
|
||||||
|
|
||||||
|
#if 1
|
||||||
|
if( !voice.input_file )
|
||||||
|
{
|
||||||
|
// adjust gain before encoding, but only for input from voice
|
||||||
|
Voice_ApplyGainAdjust((opus_int16*)(voice.input_buffer + ofs), voice.frame_size);
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
|
bytes = opus_custom_encode( voice.encoder, (const opus_int16 *)( voice.input_buffer + ofs ),
|
||||||
|
voice.frame_size, out + size + sizeof( uint16_t ), maxsize );
|
||||||
|
|
||||||
|
if( bytes > 0 )
|
||||||
|
{
|
||||||
|
// write compressed frame size
|
||||||
|
*((uint16_t *)&out[size]) = bytes;
|
||||||
|
|
||||||
|
size += bytes + sizeof( uint16_t );
|
||||||
|
maxsize -= bytes + sizeof( uint16_t );
|
||||||
|
|
||||||
|
(*frames)++;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
Con_Printf( S_ERROR "%s: failed to encode frame: %s\n", __func__, opus_strerror( bytes ));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// did we compress anything? update counters
|
||||||
|
if( ofs )
|
||||||
|
{
|
||||||
|
fs_offset_t remaining = voice.input_buffer_pos - ofs;
|
||||||
|
|
||||||
|
// move remaining samples to the beginning of buffer
|
||||||
|
memmove( voice.input_buffer, voice.input_buffer + ofs, remaining );
|
||||||
|
|
||||||
|
voice.input_buffer_pos = remaining;
|
||||||
|
}
|
||||||
|
|
||||||
|
if( !voice.input_file )
|
||||||
|
VoiceCapture_Lock( false );
|
||||||
|
|
||||||
|
return size;
|
||||||
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
===============================================================================
|
||||||
|
|
||||||
|
VOICE CHAT INTEGRATION
|
||||||
|
|
||||||
|
===============================================================================
|
||||||
|
*/
|
||||||
|
|
||||||
|
/*
|
||||||
|
=========================
|
||||||
|
Voice_ApplyGainAdjust
|
||||||
|
|
||||||
|
=========================
|
||||||
|
*/
|
||||||
|
static void Voice_ApplyGainAdjust( int16_t *samples, int count )
|
||||||
|
{
|
||||||
|
float gain, modifiedMax;
|
||||||
|
int average, adjustedSample, blockOffset = 0;
|
||||||
|
|
||||||
|
for( ;; )
|
||||||
|
{
|
||||||
|
int i, localMax = 0, localSum = 0;
|
||||||
|
int blockSize = Q_min( count - ( blockOffset + voice.autogain.block_size ), voice.autogain.block_size );
|
||||||
|
|
||||||
|
if( blockSize < 1 )
|
||||||
|
break;
|
||||||
|
|
||||||
|
for( i = 0; i < blockSize; ++i )
|
||||||
|
{
|
||||||
|
int sample = samples[blockOffset + i];
|
||||||
|
int absSample = abs( sample );
|
||||||
|
|
||||||
|
if( absSample > localMax )
|
||||||
|
localMax = absSample;
|
||||||
|
|
||||||
|
localSum += absSample;
|
||||||
|
|
||||||
|
gain = voice.autogain.current_gain + i * voice.autogain.gain_multiplier;
|
||||||
|
adjustedSample = Q_min( SHRT_MAX, Q_max(( int )( sample * gain ), SHRT_MIN ));
|
||||||
|
samples[blockOffset + i] = adjustedSample;
|
||||||
|
}
|
||||||
|
|
||||||
|
if( blockOffset % voice.autogain.block_size == 0 )
|
||||||
|
{
|
||||||
|
average = localSum / blockSize;
|
||||||
|
modifiedMax = average + ( localMax - average ) * voice_avggain.value;
|
||||||
|
|
||||||
|
voice.autogain.current_gain = voice.autogain.next_gain * voice_scale.value;
|
||||||
|
voice.autogain.next_gain = Q_min( (float)SHRT_MAX / modifiedMax, voice_maxgain.value ) * voice_scale.value;
|
||||||
|
voice.autogain.gain_multiplier = ( voice.autogain.next_gain - voice.autogain.current_gain ) / ( voice.autogain.block_size - 1 );
|
||||||
|
}
|
||||||
|
blockOffset += blockSize;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
=========================
|
||||||
|
Voice_Status
|
||||||
|
|
||||||
|
Notify user dll aboit voice transmission
|
||||||
|
=========================
|
||||||
|
*/
|
||||||
|
static void Voice_Status( int entindex, qboolean bTalking )
|
||||||
|
{
|
||||||
|
if( cls.state == ca_active && clgame.dllFuncs.pfnVoiceStatus )
|
||||||
|
clgame.dllFuncs.pfnVoiceStatus( entindex, bTalking );
|
||||||
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
=========================
|
||||||
|
Voice_StatusTimeout
|
||||||
|
|
||||||
|
Waits few milliseconds and if there was no
|
||||||
|
voice transmission, sends notification
|
||||||
|
=========================
|
||||||
|
*/
|
||||||
|
static void Voice_StatusTimeout( voice_status_t *status, int entindex, double frametime )
|
||||||
|
{
|
||||||
|
if( status->talking_ack )
|
||||||
|
{
|
||||||
|
status->talking_timeout += frametime;
|
||||||
|
if( status->talking_timeout > 0.2 )
|
||||||
|
{
|
||||||
|
status->talking_ack = false;
|
||||||
|
Voice_Status( entindex, false );
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
=========================
|
||||||
|
Voice_StatusAck
|
||||||
|
|
||||||
|
Sends notification to user dll and
|
||||||
|
zeroes timeouts for this client
|
||||||
|
=========================
|
||||||
|
*/
|
||||||
|
void Voice_StatusAck( voice_status_t *status, int playerIndex )
|
||||||
|
{
|
||||||
|
if( !status->talking_ack )
|
||||||
|
Voice_Status( playerIndex, true );
|
||||||
|
|
||||||
|
status->talking_ack = true;
|
||||||
|
status->talking_timeout = 0.0;
|
||||||
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
=========================
|
||||||
|
Voice_IsRecording
|
||||||
|
|
||||||
|
=========================
|
||||||
|
*/
|
||||||
|
qboolean Voice_IsRecording( void )
|
||||||
|
{
|
||||||
|
return voice.is_recording;
|
||||||
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
=========================
|
||||||
|
Voice_RecordStop
|
||||||
|
|
||||||
|
=========================
|
||||||
|
*/
|
||||||
|
void Voice_RecordStop( void )
|
||||||
|
{
|
||||||
|
if( voice.input_file )
|
||||||
|
{
|
||||||
|
FS_FreeSound( voice.input_file );
|
||||||
|
voice.input_file = NULL;
|
||||||
|
}
|
||||||
|
|
||||||
|
VoiceCapture_Activate( false );
|
||||||
|
voice.is_recording = false;
|
||||||
|
|
||||||
|
Voice_Status( VOICE_LOCALCLIENT_INDEX, false );
|
||||||
|
|
||||||
|
voice.input_buffer_pos = 0;
|
||||||
|
memset( voice.input_buffer, 0, sizeof( voice.input_buffer ));
|
||||||
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
=========================
|
||||||
|
Voice_RecordStart
|
||||||
|
|
||||||
|
=========================
|
||||||
|
*/
|
||||||
|
void Voice_RecordStart( void )
|
||||||
|
{
|
||||||
|
Voice_RecordStop();
|
||||||
|
|
||||||
|
if( voice_inputfromfile.value )
|
||||||
|
{
|
||||||
|
voice.input_file = FS_LoadSound( "voice_input.wav", NULL, 0 );
|
||||||
|
|
||||||
|
if( voice.input_file )
|
||||||
|
{
|
||||||
|
Sound_Process( &voice.input_file, voice.samplerate, voice.width, SOUND_RESAMPLE );
|
||||||
|
voice.input_file_pos = 0;
|
||||||
|
|
||||||
|
voice.start_time = Sys_DoubleTime();
|
||||||
|
voice.is_recording = true;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
FS_FreeSound( voice.input_file );
|
||||||
|
voice.input_file = NULL;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if( !Voice_IsRecording() )
|
||||||
|
voice.is_recording = VoiceCapture_Activate( true );
|
||||||
|
|
||||||
|
if( Voice_IsRecording() )
|
||||||
|
Voice_Status( VOICE_LOCALCLIENT_INDEX, true );
|
||||||
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
=========================
|
||||||
|
Voice_Disconnect
|
||||||
|
|
||||||
|
We're disconnected from server
|
||||||
|
stop recording and notify user dlls
|
||||||
|
=========================
|
||||||
|
*/
|
||||||
|
void Voice_Disconnect( void )
|
||||||
|
{
|
||||||
|
int i;
|
||||||
|
|
||||||
|
Voice_RecordStop();
|
||||||
|
|
||||||
|
if( voice.local.talking_ack )
|
||||||
|
{
|
||||||
|
Voice_Status( VOICE_LOOPBACK_INDEX, false );
|
||||||
|
voice.local.talking_ack = false;
|
||||||
|
}
|
||||||
|
|
||||||
|
for( i = 0; i < MAX_CLIENTS; i++ )
|
||||||
|
{
|
||||||
|
if( voice.players_status[i].talking_ack )
|
||||||
|
{
|
||||||
|
Voice_Status( i, false );
|
||||||
|
voice.players_status[i].talking_ack = false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
=========================
|
||||||
|
Voice_StartChannel
|
||||||
|
|
||||||
|
Feed the decoded data to engine sound subsystem
|
||||||
|
=========================
|
||||||
|
*/
|
||||||
|
static void Voice_StartChannel( uint samples, byte *data, int entnum )
|
||||||
|
{
|
||||||
|
SND_ForceInitMouth( entnum );
|
||||||
|
S_RawEntSamples( entnum, samples, voice.samplerate, voice.width, VOICE_PCM_CHANNELS, data, 255 );
|
||||||
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
=========================
|
||||||
|
Voice_AddIncomingData
|
||||||
|
|
||||||
|
Received encoded voice data, decode it
|
||||||
|
=========================
|
||||||
|
*/
|
||||||
|
void Voice_AddIncomingData( int ent, const byte *data, uint size, uint frames )
|
||||||
|
{
|
||||||
|
int samples = 0;
|
||||||
|
int ofs = 0;
|
||||||
|
|
||||||
|
if( !voice.decoder )
|
||||||
|
return;
|
||||||
|
|
||||||
|
// decode frame by frame
|
||||||
|
for( ;; )
|
||||||
|
{
|
||||||
|
int frame_samples;
|
||||||
|
uint16_t compressed_size;
|
||||||
|
|
||||||
|
// no compressed size mark
|
||||||
|
if( ofs + sizeof( uint16_t ) > size )
|
||||||
|
break;
|
||||||
|
|
||||||
|
compressed_size = *(const uint16_t *)(data + ofs);
|
||||||
|
ofs += sizeof( uint16_t );
|
||||||
|
|
||||||
|
// no frame data
|
||||||
|
if( ofs + compressed_size > size )
|
||||||
|
break;
|
||||||
|
|
||||||
|
frame_samples = opus_custom_decode( voice.decoder, data + ofs, compressed_size,
|
||||||
|
(opus_int16*)voice.decompress_buffer + samples, voice.frame_size );
|
||||||
|
|
||||||
|
ofs += compressed_size;
|
||||||
|
samples += frame_samples;
|
||||||
|
}
|
||||||
|
|
||||||
|
if( samples > 0 )
|
||||||
|
Voice_StartChannel( samples, voice.decompress_buffer, ent );
|
||||||
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
=========================
|
||||||
|
CL_AddVoiceToDatagram
|
||||||
|
|
||||||
|
Encode our voice data and send it to server
|
||||||
|
=========================
|
||||||
|
*/
|
||||||
|
void CL_AddVoiceToDatagram( void )
|
||||||
|
{
|
||||||
|
uint size, frames = 0;
|
||||||
|
|
||||||
|
if( cls.state != ca_active || !Voice_IsRecording() || !voice.encoder )
|
||||||
|
return;
|
||||||
|
|
||||||
|
size = Voice_GetOpusCompressedData( voice.output_buffer, sizeof( voice.output_buffer ), &frames );
|
||||||
|
|
||||||
|
if( size > 0 && MSG_GetNumBytesLeft( &cls.datagram ) >= size + 32 )
|
||||||
|
{
|
||||||
|
MSG_BeginClientCmd( &cls.datagram, clc_voicedata );
|
||||||
|
MSG_WriteByte( &cls.datagram, voice_loopback.value != 0 );
|
||||||
|
MSG_WriteByte( &cls.datagram, frames );
|
||||||
|
MSG_WriteShort( &cls.datagram, size );
|
||||||
|
MSG_WriteBytes( &cls.datagram, voice.output_buffer, size );
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
=========================
|
||||||
|
Voice_RegisterCvars
|
||||||
|
|
||||||
|
Register voice related cvars and commands
|
||||||
|
=========================
|
||||||
|
*/
|
||||||
|
void Voice_RegisterCvars( void )
|
||||||
|
{
|
||||||
|
Cvar_RegisterVariable( &voice_enable );
|
||||||
|
Cvar_RegisterVariable( &voice_loopback );
|
||||||
|
Cvar_RegisterVariable( &voice_scale );
|
||||||
|
Cvar_RegisterVariable( &voice_avggain );
|
||||||
|
Cvar_RegisterVariable( &voice_maxgain );
|
||||||
|
Cvar_RegisterVariable( &voice_inputfromfile );
|
||||||
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
=========================
|
||||||
|
Voice_Shutdown
|
||||||
|
|
||||||
|
Completely shutdown the voice subsystem
|
||||||
|
=========================
|
||||||
|
*/
|
||||||
|
static void Voice_Shutdown( void )
|
||||||
|
{
|
||||||
|
int i;
|
||||||
|
|
||||||
|
Voice_RecordStop();
|
||||||
|
Voice_ShutdownOpusEncoder();
|
||||||
|
Voice_ShutdownOpusDecoder();
|
||||||
|
VoiceCapture_Shutdown();
|
||||||
|
|
||||||
|
if( voice.local.talking_ack )
|
||||||
|
Voice_Status( VOICE_LOOPBACK_INDEX, false );
|
||||||
|
|
||||||
|
for( i = 0; i < MAX_CLIENTS; i++ )
|
||||||
|
{
|
||||||
|
if( voice.players_status[i].talking_ack )
|
||||||
|
Voice_Status( i, false );
|
||||||
|
}
|
||||||
|
|
||||||
|
memset( &voice, 0, sizeof( voice ));
|
||||||
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
=========================
|
||||||
|
Voice_Idle
|
||||||
|
|
||||||
|
Run timeout for all clients
|
||||||
|
=========================
|
||||||
|
*/
|
||||||
|
void Voice_Idle( double frametime )
|
||||||
|
{
|
||||||
|
int i;
|
||||||
|
|
||||||
|
if( FBitSet( voice_enable.flags, FCVAR_CHANGED ) && !voice_enable.value )
|
||||||
|
{
|
||||||
|
Voice_Shutdown();
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
// update local player status first
|
||||||
|
Voice_StatusTimeout( &voice.local, VOICE_LOOPBACK_INDEX, frametime );
|
||||||
|
|
||||||
|
for( i = 0; i < MAX_CLIENTS; i++ )
|
||||||
|
Voice_StatusTimeout( &voice.players_status[i], i, frametime );
|
||||||
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
=========================
|
||||||
|
Voice_Init
|
||||||
|
|
||||||
|
Initialize the voice subsystem
|
||||||
|
=========================
|
||||||
|
*/
|
||||||
|
qboolean Voice_Init( const char *pszCodecName, int quality )
|
||||||
|
{
|
||||||
|
if( !voice_enable.value )
|
||||||
|
return false;
|
||||||
|
|
||||||
|
if( Q_strcmp( pszCodecName, VOICE_OPUS_CUSTOM_CODEC ))
|
||||||
|
{
|
||||||
|
Con_Printf( S_ERROR "Server requested unsupported codec: %s\n", pszCodecName );
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
// reinitialize only if codec parameters are different
|
||||||
|
if( Q_strcmp( voice.codec, pszCodecName ) && voice.quality != quality )
|
||||||
|
Voice_Shutdown();
|
||||||
|
|
||||||
|
voice.autogain.block_size = 128;
|
||||||
|
|
||||||
|
if( !Voice_InitOpusDecoder( ))
|
||||||
|
{
|
||||||
|
// no reason to init encoder and open audio device
|
||||||
|
// if we can't hear other players
|
||||||
|
Con_Printf( S_ERROR "Voice chat disabled.\n" );
|
||||||
|
Voice_Shutdown();
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
// we can hear others players, so it's fine to fail now
|
||||||
|
voice.initialized = true;
|
||||||
|
Q_strncpy( voice.codec, pszCodecName, sizeof( voice.codec ));
|
||||||
|
|
||||||
|
if( !Voice_InitOpusEncoder( quality ))
|
||||||
|
{
|
||||||
|
Con_Printf( S_WARN "Other players will not be able to hear you.\n" );
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
voice.quality = quality;
|
||||||
|
|
||||||
|
if( !VoiceCapture_Init( ))
|
||||||
|
Con_Printf( S_WARN "No microphone is available.\n" );
|
||||||
|
|
||||||
|
return true;
|
||||||
|
}
|
||||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user