Compare commits
1401
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
a8df763823 | ||
|
|
58af8f84b9 | ||
|
|
b0395ad539 | ||
|
|
b712cba62d | ||
|
|
16c0b48f4a | ||
|
|
fcadd03607 | ||
|
|
e1ad48ec16 | ||
|
|
fbb77e8428 | ||
|
|
72c05fae77 | ||
|
|
8867dc959e | ||
|
|
e9fc57b97d | ||
|
|
7c490de93e | ||
|
|
3c85295622 | ||
|
|
bdeb7e5e9d | ||
|
|
2e766a7e16 | ||
|
|
9bab3d5795 | ||
|
|
1015800483 | ||
|
|
c4149e26e8 | ||
|
|
602e4df5b9 | ||
|
|
9be5780597 | ||
|
|
363f4c56f4 | ||
|
|
9ca21f1fb4 | ||
|
|
826183ce2a | ||
|
|
ec41a7152c | ||
|
|
4e394951bc | ||
|
|
837f74f28a | ||
|
|
fb02389922 | ||
|
|
f12f5b8bd1 | ||
|
|
20a3f4b6f3 | ||
|
|
f1ca991041 | ||
|
|
83df870bb5 | ||
|
|
8e56998c9a | ||
|
|
43e5f694bc | ||
|
|
9197a50c5b | ||
|
|
40fb4da2e8 | ||
|
|
f458fdbebe | ||
|
|
069f8bc009 | ||
|
|
a9f579d949 | ||
|
|
7b0b2d8cd7 | ||
|
|
4dce42e458 | ||
|
|
f819471c06 | ||
|
|
45393cbb78 | ||
|
|
bf6727b43a | ||
|
|
87134a42b4 | ||
|
|
d27a849d79 | ||
|
|
2aaa52c639 | ||
|
|
5348739a2c | ||
|
|
b21396bd34 | ||
|
|
19c97d3137 | ||
|
|
421dca5615 | ||
|
|
d5b64a4df3 | ||
|
|
098d1afb50 | ||
|
|
9d122aa686 | ||
|
|
e465e83cb3 | ||
|
|
619a8e2f42 | ||
|
|
b3c0c6f2b4 | ||
|
|
f0a1cd01c3 | ||
|
|
144740a270 | ||
|
|
0b478b7a91 | ||
|
|
d23451b6e7 | ||
|
|
20897deeee | ||
|
|
677e381a2c | ||
|
|
4b06a3eabf | ||
|
|
36c1369041 | ||
|
|
d4b179d59e | ||
|
|
81fbd75646 | ||
|
|
c7e37eac05 | ||
|
|
dd6403691f | ||
|
|
e42b179fad | ||
|
|
ebb0ebcab0 | ||
|
|
347a5ed40a | ||
|
|
dee91ed1ef | ||
|
|
a80f702bb8 | ||
|
|
7d91d06ce0 | ||
|
|
ab1f04ac31 | ||
|
|
0696ac7340 | ||
|
|
137a917f58 | ||
|
|
00cfdfef27 | ||
|
|
c1d5d153aa | ||
|
|
1fb3b2110c | ||
|
|
ef9472097d | ||
|
|
ed75d89baf | ||
|
|
fed4c934ad | ||
|
|
63ea13ab3c | ||
|
|
2c802799e8 | ||
|
|
fe30cbb4aa | ||
|
|
ca1d3e337a | ||
|
|
28f1ee6335 | ||
|
|
91f377b382 | ||
|
|
6d6fa156f3 | ||
|
|
5383fee6af | ||
|
|
a2c7b68a60 | ||
|
|
7be0b38f47 | ||
|
|
4e05679b10 | ||
|
|
36d3c76a52 | ||
|
|
eee263c2c2 | ||
|
|
c1cdb83e8d | ||
|
|
451ab81f0b | ||
|
|
d803c1b9cd | ||
|
|
72b26c19ce | ||
|
|
f35d827bd4 | ||
|
|
358eeaa981 | ||
|
|
55e88cf740 | ||
|
|
be4125e4ca | ||
|
|
920b00348e | ||
|
|
80aeae1692 | ||
|
|
0e52845f50 | ||
|
|
ca5dd9e78f | ||
|
|
956fc099ad | ||
|
|
1da376e777 | ||
|
|
b0b4259af6 | ||
|
|
26343b4449 | ||
|
|
a46926f5cc | ||
|
|
49518059d1 | ||
|
|
e6ce425bbd | ||
|
|
19b9ec0521 | ||
|
|
c98861be6e | ||
|
|
29db810c54 | ||
|
|
14bf24ed27 | ||
|
|
ff5bb34204 | ||
|
|
77a00b08a5 | ||
|
|
27caf1bc70 | ||
|
|
01b24e5417 | ||
|
|
7a320c9c54 | ||
|
|
3a65b687a8 | ||
|
|
0919ad015c | ||
|
|
437f900c25 | ||
|
|
cd7ce5698c | ||
|
|
86eda4f358 | ||
|
|
d791d2ce55 | ||
|
|
1883a4884a | ||
|
|
403c34fe5c | ||
|
|
f86a99cd1b | ||
|
|
85cac497ea | ||
|
|
92d6c2b7b0 | ||
|
|
46be62b256 | ||
|
|
f67f8e7dbf | ||
|
|
191fd4b68a | ||
|
|
c504c0f8f0 | ||
|
|
6adf39b460 | ||
|
|
e160427108 | ||
|
|
275d28c9c6 | ||
|
|
2a848e32e4 | ||
|
|
039daa0145 | ||
|
|
a425935bc4 | ||
|
|
6af09bd215 | ||
|
|
015d9208e3 | ||
|
|
f247796ffc | ||
|
|
29c72be994 | ||
|
|
8d70016edc | ||
|
|
6919b9fd91 | ||
|
|
c5d58f5de2 | ||
|
|
4855d29d31 | ||
|
|
2d22c2b265 | ||
|
|
acf121cac6 | ||
|
|
94d01d1ee9 | ||
|
|
e3c9ae6de5 | ||
|
|
dff8f549da | ||
|
|
b93a5c5305 | ||
|
|
0c75d8aca3 | ||
|
|
71c28ad00b | ||
|
|
7e5acd72c1 | ||
|
|
29006e9926 | ||
|
|
10d4365376 | ||
|
|
611edea6e0 | ||
|
|
fcbf45521a | ||
|
|
32d8120516 | ||
|
|
fdba6a253a | ||
|
|
18bdbfdb07 | ||
|
|
6f93299aaf | ||
|
|
c47814c29a | ||
|
|
0dd49869f5 | ||
|
|
74c9c09fcd | ||
|
|
6f891dd235 | ||
|
|
6e123b0732 | ||
|
|
2c51c9f5f8 | ||
|
|
8a781b4fa2 | ||
|
|
e3a79ab099 | ||
|
|
05364cc4dc | ||
|
|
3c5d997eff | ||
|
|
696a9ea464 | ||
|
|
c2d97397e8 | ||
|
|
4f534c5ce3 | ||
|
|
15288ced57 | ||
|
|
30eca524d9 | ||
|
|
168a2c9684 | ||
|
|
0e05dca3d5 | ||
|
|
717f5e3c13 | ||
|
|
2cad7f7210 | ||
|
|
34783cfe94 | ||
|
|
12149a4773 | ||
|
|
7d81990699 | ||
|
|
531de8bd1e | ||
|
|
232e6a4b5b | ||
|
|
65d3684d0b | ||
|
|
6017543666 | ||
|
|
7c7f924ef1 | ||
|
|
ba40d45321 | ||
|
|
3af0009453 | ||
|
|
7ac01390d0 | ||
|
|
6dee986a28 | ||
|
|
145eecf8a4 | ||
|
|
080719c251 | ||
|
|
d58719d09b | ||
|
|
05d1eab441 | ||
|
|
caffda3221 | ||
|
|
650a50278a | ||
|
|
1ef0909204 | ||
|
|
42878841e6 | ||
|
|
34e4cf123d | ||
|
|
7ffb3ebdfe | ||
|
|
684a43a95c | ||
|
|
4fcb41f659 | ||
|
|
2d1c876e0d | ||
|
|
8d1ef1721f | ||
|
|
02ffceb300 | ||
|
|
44fe156751 | ||
|
|
aca48d69cd | ||
|
|
294ce055cd | ||
|
|
4117eb5b40 | ||
|
|
a9068ee162 | ||
|
|
9549a204a5 | ||
|
|
c276736002 | ||
|
|
cfd960124e | ||
|
|
77cd898bd2 | ||
|
|
e7c40dd914 | ||
|
|
bcb1a1d5eb | ||
|
|
bf53db8d68 | ||
|
|
b5dfe74cfe | ||
|
|
6c891f1146 | ||
|
|
7d06f59da5 | ||
|
|
9dee0f0ea8 | ||
|
|
9338b5b10f | ||
|
|
b7ecffedcd | ||
|
|
71ab8c0b7d | ||
|
|
8901c62201 | ||
|
|
7deeb4486f | ||
|
|
a559e36306 | ||
|
|
602bd1a010 | ||
|
|
f57b8092fc | ||
|
|
5777c638f1 | ||
|
|
60307da80e | ||
|
|
d6e97c328a | ||
|
|
e4f35e827d | ||
|
|
e7cab1a376 | ||
|
|
6eb1114d17 | ||
|
|
e6a0b4f58b | ||
|
|
c8d9ff6575 | ||
|
|
0d9d176415 | ||
|
|
e1413764f6 | ||
|
|
ca04e084a2 | ||
|
|
56d03042ec | ||
|
|
0c8df833e9 | ||
|
|
f275eb5f9a | ||
|
|
88081068e9 | ||
|
|
9893584b4f | ||
|
|
0b4fad3cca | ||
|
|
bbb4749815 | ||
|
|
4fc780298f | ||
|
|
f24f3b5b23 | ||
|
|
ff6279a406 | ||
|
|
c36f64e97b | ||
|
|
2c4bee6e6a | ||
|
|
7b776f01bd | ||
|
|
43b7492300 | ||
|
|
1fe79fe236 | ||
|
|
222b63d2c3 | ||
|
|
a7c41b458a | ||
|
|
3901c7c7da | ||
|
|
932a08b2da | ||
|
|
4c97a4f9e0 | ||
|
|
a1d16b4613 | ||
|
|
16e1e00c67 | ||
|
|
b76fc9699a | ||
|
|
cb3638e3ab | ||
|
|
e85d91e682 | ||
|
|
2653b59af4 | ||
|
|
caff071a1b | ||
|
|
86ccf40884 | ||
|
|
85dba64b84 | ||
|
|
40165fd6db | ||
|
|
c701e1fe7e | ||
|
|
525e19566e | ||
|
|
27e734bde0 | ||
|
|
fa10eb5801 | ||
|
|
2e44a50f7f | ||
|
|
bd53786887 | ||
|
|
ad1b1eabe4 | ||
|
|
2de9a2be68 | ||
|
|
e120907e0f | ||
|
|
b0c217201e | ||
|
|
dac7026739 | ||
|
|
91a4646f19 | ||
|
|
8963e17b83 | ||
|
|
8ba52e2530 | ||
|
|
bf2184582a | ||
|
|
501a770fee | ||
|
|
327f7085f6 | ||
|
|
8aef549cfc | ||
|
|
8dd268b83e | ||
|
|
5fddc3156b | ||
|
|
d6976ca64f | ||
|
|
809219d5e8 | ||
|
|
278dd12ced | ||
|
|
f3cfa969c9 | ||
|
|
7b64b22012 | ||
|
|
267ccae3a9 | ||
|
|
5f77dbb946 | ||
|
|
1a46d7d16c | ||
|
|
c8a2278cb7 | ||
|
|
75b269d4bb | ||
|
|
35e499027d | ||
|
|
356b2f279c | ||
|
|
eba5965220 | ||
|
|
feda0bae80 | ||
|
|
44ecb677ad | ||
|
|
3e99f4d142 | ||
|
|
d6b838f7cb | ||
|
|
14400097dd | ||
|
|
c44c0e10c1 | ||
|
|
bbf49db184 | ||
|
|
15787a97bb | ||
|
|
b76ce23ed2 | ||
|
|
d6c5066bfd | ||
|
|
60783d7109 | ||
|
|
db525f15da | ||
|
|
f33daf6bee | ||
|
|
d13928b394 | ||
|
|
5613a0d173 | ||
|
|
aa38586f82 | ||
|
|
d2b1ceb641 | ||
|
|
9dd7e9a25f | ||
|
|
1648273ddd | ||
|
|
3f90e4f12a | ||
|
|
2b9d565f0c | ||
|
|
70af63cc94 | ||
|
|
64b92881f9 | ||
|
|
be5ea069ad | ||
|
|
71e9357114 | ||
|
|
e28f86ac32 | ||
|
|
f97fe4bd65 | ||
|
|
3d0ac03f06 | ||
|
|
094132b7d3 | ||
|
|
51b9c9ae5a | ||
|
|
d31941ef13 | ||
|
|
48db826142 | ||
|
|
32b62d19ff | ||
|
|
e4f2961129 | ||
|
|
eba09dfad2 | ||
|
|
d9b72fcae6 | ||
|
|
6f17e7f735 | ||
|
|
047b82acc0 | ||
|
|
5347039d75 | ||
|
|
edc8095577 | ||
|
|
06f69723c2 | ||
|
|
8218fd4f57 | ||
|
|
6ee22edac5 | ||
|
|
37215ef1f4 | ||
|
|
a2eb2222b9 | ||
|
|
d63b4d9463 | ||
|
|
3bd85c20bc | ||
|
|
f70063c7d8 | ||
|
|
a2f7dd7408 | ||
|
|
147014d43a | ||
|
|
9460d1e9a1 | ||
|
|
b3a9a6b59a | ||
|
|
69f7d669c8 | ||
|
|
74a68b1462 | ||
|
|
006ea90493 | ||
|
|
aede063266 | ||
|
|
5aaeff4c5d | ||
|
|
5f80d6c18d | ||
|
|
7c59c9e6ec | ||
|
|
aae83b3235 | ||
|
|
520165128a | ||
|
|
556ced63cf | ||
|
|
063bf830ff | ||
|
|
7fd3bd412c | ||
|
|
47b9508af2 | ||
|
|
417c44aad0 | ||
|
|
1fefa0a99a | ||
|
|
06db4d2b62 | ||
|
|
bf7fc12a8d | ||
|
|
395daf57fa | ||
|
|
97219b7a84 | ||
|
|
0d5d677eff | ||
|
|
3bd6c99a3b | ||
|
|
1d2d8d58db | ||
|
|
9909b002fe | ||
|
|
ccda1ef104 | ||
|
|
52a882bda2 | ||
|
|
177c60e857 | ||
|
|
0566b96738 | ||
|
|
f72c179f56 | ||
|
|
0da963c794 | ||
|
|
7d885f7100 | ||
|
|
c1c2f794e3 | ||
|
|
8bb1c7a032 | ||
|
|
804123afc1 | ||
|
|
8e4f278ce4 | ||
|
|
3193241b11 | ||
|
|
edb44fa6a2 | ||
|
|
66e9ac3657 | ||
|
|
87e0796bf4 | ||
|
|
6bc6db3665 | ||
|
|
2a4aa51373 | ||
|
|
e15b052570 | ||
|
|
629e249a12 | ||
|
|
86a260bb89 | ||
|
|
6ab2de2787 | ||
|
|
8effdc1615 | ||
|
|
561fc2d01a | ||
|
|
3fd9cf573b | ||
|
|
d7c0bed4eb | ||
|
|
afd1f595e1 | ||
|
|
f47a43df2f | ||
|
|
4385327101 | ||
|
|
4e73c05ef9 | ||
|
|
c01ef035a5 | ||
|
|
b59c080943 | ||
|
|
814c65b290 | ||
|
|
9f1c1c3f18 | ||
|
|
e0df7dfba5 | ||
|
|
220db7212f | ||
|
|
d59f45a26a | ||
|
|
f88d92ecee | ||
|
|
c28188b6d8 | ||
|
|
80419748db | ||
|
|
874e6cd5af | ||
|
|
cd500fc344 | ||
|
|
ae7afc5749 | ||
|
|
b0fa94c781 | ||
|
|
9bf717fae9 | ||
|
|
859c1020e6 | ||
|
|
9108d64820 | ||
|
|
e9d3c1a421 | ||
|
|
f36e069f40 | ||
|
|
1f5c7b1d12 | ||
|
|
94ecb9e634 | ||
|
|
b9db67bc08 | ||
|
|
c152799295 | ||
|
|
f91165857d | ||
|
|
29b93f02f1 | ||
|
|
f9a6452528 | ||
|
|
e7e51957e9 | ||
|
|
f8903e7ce7 | ||
|
|
d3548a4dfb | ||
|
|
eca72c6dc6 | ||
|
|
6e378f4de6 | ||
|
|
94ac52d792 | ||
|
|
1f276a7eb6 | ||
|
|
a28a590078 | ||
|
|
91d052d25e | ||
|
|
2f6ded132d | ||
|
|
51cdc1ce90 | ||
|
|
494fe0b1e7 | ||
|
|
eac5310f5e | ||
|
|
7f4a2f9943 | ||
|
|
28a31301d4 | ||
|
|
1c5e575718 | ||
|
|
4a2d6b2241 | ||
|
|
001baec444 | ||
|
|
1b35d4f03b | ||
|
|
75fc8cb766 | ||
|
|
28bef8c54f | ||
|
|
787973a3d5 | ||
|
|
f0e3ca7c1f | ||
|
|
1b837a81ef | ||
|
|
b74dd85ef2 | ||
|
|
fc9cc62b12 | ||
|
|
e665edb652 | ||
|
|
e81cde8753 | ||
|
|
4e995436c5 | ||
|
|
c57154a8e5 | ||
|
|
31fbba057a | ||
|
|
46fa6e7ba4 | ||
|
|
bbb0379813 | ||
|
|
156b63440e | ||
|
|
20e062b031 | ||
|
|
c98ebc9f35 | ||
|
|
c6001c7bf6 | ||
|
|
2d0945264f | ||
|
|
3d0981cf7b | ||
|
|
cce581fa51 | ||
|
|
2446b804c7 | ||
|
|
20cdb1c5ec | ||
|
|
212b184320 | ||
|
|
37e98f342c | ||
|
|
578f5b85dd | ||
|
|
99b1e3f969 | ||
|
|
8c9ef0e8f3 | ||
|
|
f91d3ccf24 | ||
|
|
691063983e | ||
|
|
b912047f68 | ||
|
|
f2ddbf1e68 | ||
|
|
5cd36e55ab | ||
|
|
1cb590ebb8 | ||
|
|
280e937844 | ||
|
|
5afb55547d | ||
|
|
e3c91629db | ||
|
|
1b0496b1e7 | ||
|
|
b7369b40cb | ||
|
|
6567313de6 | ||
|
|
5ecf3cc36c | ||
|
|
71e3d89181 | ||
|
|
a284ece8e4 | ||
|
|
e73e75e740 | ||
|
|
9bfd61fabc | ||
|
|
a2aeaa51e8 | ||
|
|
b558c3db98 | ||
|
|
0f70bcbf28 | ||
|
|
f7c4600007 | ||
|
|
8910f073e5 | ||
|
|
ea18be1866 | ||
|
|
0bd687eb15 | ||
|
|
25b74bf3dd | ||
|
|
e4f9ca3f3c | ||
|
|
38a3f403bd | ||
|
|
51dd2030a0 | ||
|
|
7e31067e6a | ||
|
|
9bf06ff30b | ||
|
|
85aa726bb7 | ||
|
|
3a67ff3afa | ||
|
|
0a022a4348 | ||
|
|
ad24beea5b | ||
|
|
9026ae7a16 | ||
|
|
2fee9b861f | ||
|
|
b7e2bcf02e | ||
|
|
d548848b18 | ||
|
|
4c628ea74f | ||
|
|
d3ef97f637 | ||
|
|
02bd819f7e | ||
|
|
ea3b4ddeb0 | ||
|
|
ab3ea7475f | ||
|
|
b9b97d0a56 | ||
|
|
e19db23bb5 | ||
|
|
5ec1ca46e5 | ||
|
|
c2c918fdda | ||
|
|
4627989401 | ||
|
|
9552e09471 | ||
|
|
c8fb25066b | ||
|
|
b1cb6d42f4 | ||
|
|
caf7e4a1cf | ||
|
|
6a5c0223c4 | ||
|
|
9ff2d66079 | ||
|
|
2db2b9309d | ||
|
|
7a38c15d59 | ||
|
|
cb7375f873 | ||
|
|
41e52f9e88 | ||
|
|
ce7e30a752 | ||
|
|
3214811fcb | ||
|
|
edda2a5399 | ||
|
|
926bc8e72c | ||
|
|
eadffb6be3 | ||
|
|
cf04e8c23c | ||
|
|
ec5840f840 | ||
|
|
7dc4a7177d | ||
|
|
3d91de8178 | ||
|
|
6ea1abfedc | ||
|
|
5251482dd7 | ||
|
|
dd73787c8b | ||
|
|
340450a67e | ||
|
|
0d40989f4c | ||
|
|
c640096d9c | ||
|
|
76081869e3 | ||
|
|
9156c1b850 | ||
|
|
d78718d8f4 | ||
|
|
eef1e986a6 | ||
|
|
8fa99c34be | ||
|
|
a35fbdd1b5 | ||
|
|
0efef78684 | ||
|
|
62ce17cb4c | ||
|
|
6112be232a | ||
|
|
c1a9c58eb5 | ||
|
|
0393588fe8 | ||
|
|
b7ff0325ea | ||
|
|
c4d39eae25 | ||
|
|
0e88981425 | ||
|
|
ed7fcae33b | ||
|
|
8b967fb3b7 | ||
|
|
4d68a5dc2b | ||
|
|
ecd6ef40ef | ||
|
|
0c9dc33ff0 | ||
|
|
98c27fe8ef | ||
|
|
3d490f52b2 | ||
|
|
c78c17d953 | ||
|
|
ee5d667a24 | ||
|
|
b9653b4ff8 | ||
|
|
78bcfa8cfa | ||
|
|
1f1130efda | ||
|
|
3d7b05d633 | ||
|
|
343bbd8a1a | ||
|
|
f702df48f5 | ||
|
|
bc382366a1 | ||
|
|
c158144b7b | ||
|
|
d4337fbc56 | ||
|
|
e822d8e7d1 | ||
|
|
dc95b2e8d7 | ||
|
|
d226ad38ff | ||
|
|
2a160c5247 | ||
|
|
641a9dc4e2 | ||
|
|
7e71af8d25 | ||
|
|
8e33d2e1b2 | ||
|
|
61118b348c | ||
|
|
84faff82a2 | ||
|
|
d6cf7cc06f | ||
|
|
0688b94729 | ||
|
|
695f53194d | ||
|
|
1b963c9439 | ||
|
|
b50d6dd389 | ||
|
|
2afad9490e | ||
|
|
812a275add | ||
|
|
90ccf7699b | ||
|
|
31ed12d88a | ||
|
|
5a4e44d064 | ||
|
|
515c67fa3a | ||
|
|
81d60165a3 | ||
|
|
cc0fac3546 | ||
|
|
d71ad13fcf | ||
|
|
0d13811305 | ||
|
|
b69cc4e34a | ||
|
|
caf8f383ad | ||
|
|
7db160a8e2 | ||
|
|
202a3d1fb1 | ||
|
|
332135fc6f | ||
|
|
7e895f82b2 | ||
|
|
c5c61f7692 | ||
|
|
bd8a392882 | ||
|
|
36183e6dc8 | ||
|
|
5ae4af54da | ||
|
|
620bdd1419 | ||
|
|
c18eacbb81 | ||
|
|
bb8acc5f51 | ||
|
|
d41f4810d7 | ||
|
|
387c4edb3b | ||
|
|
c3fd7c1a7a | ||
|
|
94f1ec18de | ||
|
|
e00f8f6cee | ||
|
|
79b0a9c833 | ||
|
|
5e8e2f4b3a | ||
|
|
f0158dd915 | ||
|
|
10cf251b46 | ||
|
|
72231e5658 | ||
|
|
c510ff3b1c | ||
|
|
936e138fee | ||
|
|
8325696b55 | ||
|
|
d63f517ae5 | ||
|
|
e74df8db90 | ||
|
|
1a0bf67452 | ||
|
|
f0df9b399b | ||
|
|
f9345308ff | ||
|
|
6ed7c75448 | ||
|
|
cb71167fb7 | ||
|
|
d4292987cc | ||
|
|
5da24a18dc | ||
|
|
1cf7b3e697 | ||
|
|
3f3672497b | ||
|
|
7714304c7a | ||
|
|
ff640639b2 | ||
|
|
0965603c8f | ||
|
|
b8412cec96 | ||
|
|
86b7e192b2 | ||
|
|
32b9e6094b | ||
|
|
3ff7f3158b | ||
|
|
bd83ba8ca9 | ||
|
|
785881c90e | ||
|
|
567ccf8a59 | ||
|
|
11423a6d78 | ||
|
|
ab6b716e78 | ||
|
|
7b1be2e34f | ||
|
|
19d0d247b4 | ||
|
|
1074a9e1d2 | ||
|
|
0648f384bb | ||
|
|
58d72204cc | ||
|
|
067b4c260f | ||
|
|
9e7e4d5fe7 | ||
|
|
7d9609be76 | ||
|
|
7e510f8bc5 | ||
|
|
a16e009370 | ||
|
|
a021c497b6 | ||
|
|
e77159cb58 | ||
|
|
36ac353f1f | ||
|
|
58122bf023 | ||
|
|
c5da23bb02 | ||
|
|
fd45391616 | ||
|
|
11dd80e4e7 | ||
|
|
298f8ef842 | ||
|
|
4c45b9fb85 | ||
|
|
599cea3238 | ||
|
|
0c5685e9eb | ||
|
|
760b82fd63 | ||
|
|
340034adf7 | ||
|
|
d978bfd0db | ||
|
|
de9f9722ac | ||
|
|
4dd9dc03fe | ||
|
|
47fc4aa39a | ||
|
|
84ad608d70 | ||
|
|
d4dd0c9992 | ||
|
|
ac93d027af | ||
|
|
190a95584c | ||
|
|
9ad368e420 | ||
|
|
a524215479 | ||
|
|
6104c36455 | ||
|
|
a04287c9f6 | ||
|
|
99876e3f73 | ||
|
|
f16f498f27 | ||
|
|
4f9b5923bd | ||
|
|
84476cd51f | ||
|
|
bf9a6bde82 | ||
|
|
a6f8f57725 | ||
|
|
02f4c334f0 | ||
|
|
9884b294c6 | ||
|
|
49f22b5790 | ||
|
|
841270e824 | ||
|
|
630ce57303 | ||
|
|
94aed4d1d1 | ||
|
|
cdc0ec96a9 | ||
|
|
751188bcd8 | ||
|
|
c0c44d46bc | ||
|
|
19d8749abf | ||
|
|
c6f9fb2ac2 | ||
|
|
b1cfdfbc14 | ||
|
|
360df11aa6 | ||
|
|
d88cc3251f | ||
|
|
cd7079da92 | ||
|
|
77a0e8213b | ||
|
|
5efa778509 | ||
|
|
02e6463fae | ||
|
|
b411787fe7 | ||
|
|
8fd91194a7 | ||
|
|
4f85e1d603 | ||
|
|
fae0aeb442 | ||
|
|
ec77824a96 | ||
|
|
4127936eef | ||
|
|
ae829375a0 | ||
|
|
a1afcbc855 | ||
|
|
e1e3aa899d | ||
|
|
2644a3bf6e | ||
|
|
6b4e81e1ec | ||
|
|
c705a0f35a | ||
|
|
b1b3102b31 | ||
|
|
2d823d34f9 | ||
|
|
1bb9fb2c67 | ||
|
|
b90e3ce9da | ||
|
|
e04a074a79 | ||
|
|
f98c3311af | ||
|
|
1a8c44af27 | ||
|
|
a57089c1a9 | ||
|
|
87001f7e78 | ||
|
|
1fbb05c938 | ||
|
|
3eef9d3b62 | ||
|
|
af2adf0134 | ||
|
|
bbdfee8d33 | ||
|
|
2c4da83502 | ||
|
|
75f2868971 | ||
|
|
87d9ecc3c8 | ||
|
|
b637943bd9 | ||
|
|
0514475155 | ||
|
|
8cfb39e035 | ||
|
|
a9a7cb7be0 | ||
|
|
f8649a24aa | ||
|
|
ee5a860e07 | ||
|
|
e6f03c1136 | ||
|
|
780162f516 | ||
|
|
a6d32d834b | ||
|
|
cef3c7f032 | ||
|
|
07f8a532f9 | ||
|
|
352adf526a | ||
|
|
df48f9caf9 | ||
|
|
f611053d4f | ||
|
|
39011cd93b | ||
|
|
562cb8cebd | ||
|
|
89ae721421 | ||
|
|
f65f4b32e2 | ||
|
|
303fca6bcc | ||
|
|
4aba159ee8 | ||
|
|
5838e60bf6 | ||
|
|
527e436d57 | ||
|
|
60ede73ff8 | ||
|
|
298d5e95fc | ||
|
|
e9a68f0b7d | ||
|
|
d613cf4d4c | ||
|
|
3487fae95d | ||
|
|
9ee47a071b | ||
|
|
3579fc3dea | ||
|
|
921bff19f1 | ||
|
|
d07420eaeb | ||
|
|
8028db77d8 | ||
|
|
e49a059783 | ||
|
|
482b6e6844 | ||
|
|
aa70635919 | ||
|
|
c331b0fa89 | ||
|
|
fe55744de2 | ||
|
|
15e9d85a14 | ||
|
|
51043b61a1 | ||
|
|
6620d5fb26 | ||
|
|
f547020fc5 | ||
|
|
89ea473c3b | ||
|
|
b60d9d0be7 | ||
|
|
4fdb2174f0 | ||
|
|
06a48584d6 | ||
|
|
e9f9c1009d | ||
|
|
b66ceda525 | ||
|
|
7c9c28f026 | ||
|
|
72f0552ef1 | ||
|
|
877a1f15a9 | ||
|
|
efa2a68805 | ||
|
|
023209bb76 | ||
|
|
da5dcde6ee | ||
|
|
e92c5e1bf9 | ||
|
|
2b7c4ae76c | ||
|
|
ea26db2cbd | ||
|
|
b9e3747f99 | ||
|
|
4d608b7f37 | ||
|
|
9c42b77879 | ||
|
|
a2d0ea9d11 | ||
|
|
298b4d23e8 | ||
|
|
875adb17b1 | ||
|
|
9eb68bf052 | ||
|
|
8cec2dab82 | ||
|
|
5f58e7b343 | ||
|
|
28bb88e9b4 | ||
|
|
04455c9625 | ||
|
|
9853150e57 | ||
|
|
85c7216eaa | ||
|
|
a54384a579 | ||
|
|
19f1d8b847 | ||
|
|
8270b64624 | ||
|
|
81e3810c32 | ||
|
|
c266151071 | ||
|
|
27d55260e8 | ||
|
|
233583657e | ||
|
|
7bb1eed249 | ||
|
|
aa85fc3787 | ||
|
|
c9a88617b1 | ||
|
|
2f899fdfcc | ||
|
|
cdd2b6560e | ||
|
|
60f29edbca | ||
|
|
60cffe1ed1 | ||
|
|
e77e7d1643 | ||
|
|
5dc22f502e | ||
|
|
7a309c1175 | ||
|
|
9ce5baad9e | ||
|
|
a4aa9a76f2 | ||
|
|
befa25de5c | ||
|
|
83175d5c09 | ||
|
|
d8df8e8778 | ||
|
|
09957d0279 | ||
|
|
9e44985f56 | ||
|
|
b657a84699 | ||
|
|
5ec7835556 | ||
|
|
03a864156d | ||
|
|
c823bf3320 | ||
|
|
4f4d2f1f4c | ||
|
|
1bb389052d | ||
|
|
31fdc5bbc1 | ||
|
|
db3833430d | ||
|
|
6d2212d259 | ||
|
|
912c0e7fc4 | ||
|
|
43d232819a | ||
|
|
302eaf60b5 | ||
|
|
84535faa90 | ||
|
|
8c55d3c705 | ||
|
|
ec11b9268f | ||
|
|
a45af4a80c | ||
|
|
df627b6830 | ||
|
|
dfbeaf30ad | ||
|
|
a03f74b125 | ||
|
|
1a01f1299c | ||
|
|
91f0cdbaca | ||
|
|
e50bd4125d | ||
|
|
ded2c8a7c8 | ||
|
|
88ce9fc0a6 | ||
|
|
3c713248b3 | ||
|
|
75f3edcd92 | ||
|
|
081a7779a6 | ||
|
|
6e995207a6 | ||
|
|
3492b77aa0 | ||
|
|
e864901035 | ||
|
|
7ee6de6b6a | ||
|
|
553b8ccf6b | ||
|
|
bceef0b861 | ||
|
|
53cce6c6bb | ||
|
|
b95047d09f | ||
|
|
c6cb4375f5 | ||
|
|
a07e2b8eda | ||
|
|
98e7002167 | ||
|
|
3428dde3c6 | ||
|
|
13d48f982b | ||
|
|
b2e4dc27e4 | ||
|
|
deddeab049 | ||
|
|
c3a6410822 | ||
|
|
c5915091aa | ||
|
|
4401f0659e | ||
|
|
a0c72d32e8 | ||
|
|
1493045ec4 | ||
|
|
210efb2be7 | ||
|
|
a02fc1de63 | ||
|
|
7755bfc861 | ||
|
|
01172bca77 | ||
|
|
143cbc8587 | ||
|
|
b65f655a8a | ||
|
|
ed04c86369 | ||
|
|
c0eaa17eb3 | ||
|
|
6383a55038 | ||
|
|
574df60d58 | ||
|
|
61ee575cd3 | ||
|
|
bdd963081e | ||
|
|
6b908d7a14 | ||
|
|
7d0d70c094 | ||
|
|
e75c5a9248 | ||
|
|
b8ed5f4f1a | ||
|
|
660d7060e4 | ||
|
|
79c5f57714 | ||
|
|
606d8fbe55 | ||
|
|
edfa116a40 | ||
|
|
55ca0c712f | ||
|
|
16bef488ee | ||
|
|
82d784d9f8 | ||
|
|
103fb2dfc1 | ||
|
|
bba3e1810b | ||
|
|
af5333f63e | ||
|
|
ea77a5fb53 | ||
|
|
a4aef0894b | ||
|
|
bab7972518 | ||
|
|
88853a7aee | ||
|
|
d3339df853 | ||
|
|
385614b448 | ||
|
|
c47ba80f5d | ||
|
|
6de0700f49 | ||
|
|
d9fe52b1a1 | ||
|
|
ccfc476ec0 | ||
|
|
f518b3c48b | ||
|
|
81d52db722 | ||
|
|
df9973da99 | ||
|
|
ca4c779c66 | ||
|
|
7897352175 | ||
|
|
e0e75eac33 | ||
|
|
31d83dd26e | ||
|
|
698a0b811f | ||
|
|
f69609b403 | ||
|
|
56259e3476 | ||
|
|
f3dfa53f31 | ||
|
|
e10d60c08e | ||
|
|
ad4037351f | ||
|
|
f9e1da8c9f | ||
|
|
2f05137af7 | ||
|
|
c305e31c2e | ||
|
|
a55fabe4f9 | ||
|
|
c58848b298 | ||
|
|
ede644d3c4 | ||
|
|
4ff98e62a9 | ||
|
|
e87fd2fff6 | ||
|
|
33e8b10579 | ||
|
|
d11780f62d | ||
|
|
7706aa0bf0 | ||
|
|
cf96e10552 | ||
|
|
1d01e1e6cd | ||
|
|
a5c4759662 | ||
|
|
e7ff1d693b | ||
|
|
9b4354a057 | ||
|
|
51a46ba92c | ||
|
|
31c4e0d59f | ||
|
|
6b246548c3 | ||
|
|
57dda3843a | ||
|
|
b04ac14751 | ||
|
|
5ad8497db2 | ||
|
|
672f07a5ee | ||
|
|
aceffafc4e | ||
|
|
891b3183ed | ||
|
|
26dd066280 | ||
|
|
157ebdb5fe | ||
|
|
1a18839f82 | ||
|
|
e7f8e7628f | ||
|
|
07190571a1 | ||
|
|
f04d922fca | ||
|
|
7fa382d4e9 | ||
|
|
97766710c0 | ||
|
|
994ee060a7 | ||
|
|
589c27fdcf | ||
|
|
37a018fda4 | ||
|
|
f49381d1c5 | ||
|
|
573095bbad | ||
|
|
0fdcc8e288 | ||
|
|
03d7e26c3d | ||
|
|
3a5cd835ad | ||
|
|
47a8f081e9 | ||
|
|
ad8d691c11 | ||
|
|
8186696e62 | ||
|
|
183ec22923 | ||
|
|
5376995350 | ||
|
|
acb6e30fad | ||
|
|
fe0dabb177 | ||
|
|
194ae46ce8 | ||
|
|
2e9f1bfe90 | ||
|
|
a82adc4948 | ||
|
|
6440c70a38 | ||
|
|
748eb07c9a | ||
|
|
5be2f591d2 | ||
|
|
f2e4950e89 | ||
|
|
7444c5b826 | ||
|
|
5f6cca68cc | ||
|
|
3d33e5351b | ||
|
|
c6e245450d | ||
|
|
36854a16b7 | ||
|
|
b4ee8229ee | ||
|
|
cf0a3841e8 | ||
|
|
3ebd2257f8 | ||
|
|
844d1967cc | ||
|
|
dac37f8938 | ||
|
|
dd74bc7c2b | ||
|
|
7eec58a834 | ||
|
|
da81998c71 | ||
|
|
d1552e7b71 | ||
|
|
c64e10083b | ||
|
|
43e2be58da | ||
|
|
63b60d2546 | ||
|
|
91ddc709eb | ||
|
|
1bcb67ffb9 | ||
|
|
976177c244 | ||
|
|
a37c81a142 | ||
|
|
58de3a35a0 | ||
|
|
44b8a8a0d8 | ||
|
|
b0f5f4338f | ||
|
|
6457847633 | ||
|
|
69d47a5e53 | ||
|
|
02177a7794 | ||
|
|
65c15126f1 | ||
|
|
76c78b8e63 | ||
|
|
f63342ff0f | ||
|
|
e3410cf34c | ||
|
|
7a129047e7 | ||
|
|
343716b7da | ||
|
|
1687fb9120 | ||
|
|
3e89057c23 | ||
|
|
774587efa6 | ||
|
|
2dc8bf321e | ||
|
|
992813d770 | ||
|
|
46882dee93 | ||
|
|
8bbb7b540f | ||
|
|
f5f1ab036d | ||
|
|
f15d556c05 | ||
|
|
570a664db8 | ||
|
|
52f69324d9 | ||
|
|
ea6016b1ba | ||
|
|
30fcffd63c | ||
|
|
50446bbde4 | ||
|
|
b307033aab | ||
|
|
3e5985833c | ||
|
|
8421f02aab | ||
|
|
b6daafec17 | ||
|
|
fc058b669e | ||
|
|
99214b98b9 | ||
|
|
ab35a44ed9 | ||
|
|
125b82a5bb | ||
|
|
f294ea157f | ||
|
|
486ae052ef | ||
|
|
53b5442dad | ||
|
|
507c5f75bd | ||
|
|
0fb72c579e | ||
|
|
c5d6ac63c5 | ||
|
|
a934c76263 | ||
|
|
0098c3bbc0 | ||
|
|
f3eedc03e6 | ||
|
|
17c71a2528 | ||
|
|
d2ecbd7c6e | ||
|
|
2ce7dc0c37 | ||
|
|
b648424c18 | ||
|
|
301754c857 | ||
|
|
c9a3c4c9b8 | ||
|
|
ce0c8b363a | ||
|
|
9d6c38004c | ||
|
|
19a58cc8c6 | ||
|
|
d855c39da2 | ||
|
|
03f4bfecc1 | ||
|
|
c8d9e4c7b3 | ||
|
|
cb2b8f2e7c | ||
|
|
0272dd4c24 | ||
|
|
3b327937c2 | ||
|
|
f8f2f17184 | ||
|
|
2efaebcf89 | ||
|
|
150c695979 | ||
|
|
6fe87ab05a | ||
|
|
f6613a5555 | ||
|
|
947d5c2739 | ||
|
|
1544706ff4 | ||
|
|
e121d1a8a1 | ||
|
|
badbdbf03f | ||
|
|
3b5495b53a | ||
|
|
545027ae64 | ||
|
|
91896433f8 | ||
|
|
a60074fc8a | ||
|
|
eb82aa14bb | ||
|
|
cb4b640730 | ||
|
|
266d9a3c71 | ||
|
|
7a5a704a15 | ||
|
|
29ed8de935 | ||
|
|
3418cab5de | ||
|
|
e2ce015d49 | ||
|
|
0d0ab3f414 | ||
|
|
22b5bcc7e1 | ||
|
|
34d5d73d7e | ||
|
|
7ae4441731 | ||
|
|
d0b7f6203c | ||
|
|
3757f3ae57 | ||
|
|
8f9366da5a | ||
|
|
b8e55f87a9 | ||
|
|
b469f70e02 | ||
|
|
6df69b24db | ||
|
|
0133a5eb23 | ||
|
|
86712c2c48 | ||
|
|
5195caa3c6 | ||
|
|
684ad38d4b | ||
|
|
c6d292a3d7 | ||
|
|
246414a735 | ||
|
|
429bcffaf8 | ||
|
|
d92e7b138c | ||
|
|
cd51ad2a25 | ||
|
|
8732825404 | ||
|
|
fc37cdcc95 | ||
|
|
2435ec9515 | ||
|
|
623fab8ea8 | ||
|
|
e063345c4b | ||
|
|
27533a1dcd | ||
|
|
d232e0e2c6 | ||
|
|
0475489e24 | ||
|
|
34b35db27f | ||
|
|
b47bc12e48 | ||
|
|
4d102dcf68 | ||
|
|
a8c9663200 | ||
|
|
57660cc5af | ||
|
|
c459e918af | ||
|
|
962abba1b2 | ||
|
|
5297d18f92 | ||
|
|
7853e48a6f | ||
|
|
303d87f69d | ||
|
|
9dcdc9500d | ||
|
|
7723bafff6 | ||
|
|
d74a89c6c1 | ||
|
|
cce443be0b | ||
|
|
81fa3d27bf | ||
|
|
493091cd66 | ||
|
|
c75f5ee961 | ||
|
|
083e0ca2e0 | ||
|
|
79bd89016c | ||
|
|
eca7e38763 | ||
|
|
b5cbfb970f | ||
|
|
74e1cafd9d | ||
|
|
ee7381b67d | ||
|
|
7f93bc305d | ||
|
|
c7931ca69c | ||
|
|
90f06a3289 | ||
|
|
0e344a7e02 | ||
|
|
3f91a4e908 | ||
|
|
fb443c58ab | ||
|
|
b233514b58 | ||
|
|
11615171d1 | ||
|
|
2df4738af2 | ||
|
|
9e62f5bd52 | ||
|
|
80349ae8ee | ||
|
|
06d51f2648 | ||
|
|
fcc810f703 | ||
|
|
d6d70e1525 | ||
|
|
e5f79e061c | ||
|
|
ad3c0a1ffd | ||
|
|
2ef935198a | ||
|
|
dc3b9c648a | ||
|
|
2d610d40b6 | ||
|
|
d2c686f48b | ||
|
|
5cafec3262 | ||
|
|
580c42d167 | ||
|
|
dcfec35e57 | ||
|
|
701bac6e11 | ||
|
|
0c46d593d8 | ||
|
|
b867de0667 | ||
|
|
e207b75c7a | ||
|
|
fc3df5bfe4 | ||
|
|
dfb05b9d39 | ||
|
|
19702daecd | ||
|
|
dde4b4df3b | ||
|
|
c070930a8c | ||
|
|
d36b5f7c59 | ||
|
|
0e517907ce | ||
|
|
739e9716ab | ||
|
|
0e5972d895 | ||
|
|
71975658ca | ||
|
|
6572e29a64 | ||
|
|
41b21c2a0c | ||
|
|
2b19d2e6de | ||
|
|
f99aa3459c | ||
|
|
5bce9d5abf | ||
|
|
abe102649e | ||
|
|
424fcdc63a | ||
|
|
a3fd451c74 | ||
|
|
731fd113d2 | ||
|
|
c9ca1bda5c | ||
|
|
58ea822050 | ||
|
|
671484d6f9 | ||
|
|
e6e74194bc | ||
|
|
04432c8368 | ||
|
|
6782876c0c | ||
|
|
4b09e92d7c | ||
|
|
3266f64fb9 | ||
|
|
2a9886e698 | ||
|
|
1319e3a811 | ||
|
|
6cbb40f874 | ||
|
|
07fd6a3ad4 | ||
|
|
8891869013 | ||
|
|
04fc735e12 | ||
|
|
7b9860f1be | ||
|
|
38f26a2bd8 | ||
|
|
a9750f8cff | ||
|
|
ad86e7f34a | ||
|
|
496435ef3b | ||
|
|
5275b31e7e | ||
|
|
e341991703 | ||
|
|
fb65496507 | ||
|
|
abe52ba440 | ||
|
|
ee5d097201 | ||
|
|
0ea182d04f | ||
|
|
8d737c96c9 | ||
|
|
5c93b90c2e | ||
|
|
41bee850da | ||
|
|
416c2a9e9d | ||
|
|
8fa9fccc79 | ||
|
|
c5a4071a06 | ||
|
|
930e48ad39 | ||
|
|
868678f321 | ||
|
|
8530b6512c | ||
|
|
2a5f487e5f | ||
|
|
141f6c51dc | ||
|
|
1fc9492b30 | ||
|
|
65782d3d75 | ||
|
|
b5cb6dfb9d | ||
|
|
6667e4b8bc | ||
|
|
5e2492a930 | ||
|
|
4f07372e0f | ||
|
|
80a1a97083 | ||
|
|
204476c55d | ||
|
|
8fab258778 | ||
|
|
12059955e5 | ||
|
|
3ca1f957ba | ||
|
|
b11362aec1 | ||
|
|
75630df10e | ||
|
|
4d93abb7ac | ||
|
|
731943f980 | ||
|
|
265dc1f296 | ||
|
|
c449ffcc98 | ||
|
|
34500d32d0 | ||
|
|
d3e5dfc346 | ||
|
|
8ed11107eb | ||
|
|
2f51108783 | ||
|
|
2667a66419 | ||
|
|
0fd073f2f0 | ||
|
|
840cf4e00a | ||
|
|
d5d99f94b7 | ||
|
|
dea19e4416 | ||
|
|
f7612d7398 | ||
|
|
e39182607e | ||
|
|
79f1febbce | ||
|
|
120def9676 | ||
|
|
82562bc20d | ||
|
|
1c51361120 | ||
|
|
c07e79deb7 | ||
|
|
81cb1111b4 | ||
|
|
369307181e | ||
|
|
7881e04e6b | ||
|
|
66a72eb1be | ||
|
|
ad77f11859 | ||
|
|
96d177876f | ||
|
|
dc7392f86b | ||
|
|
6f6252b6f8 | ||
|
|
20b32df2c6 | ||
|
|
d413d02bf7 | ||
|
|
426c0366cc | ||
|
|
d3d3655580 | ||
|
|
d4a011ee6d | ||
|
|
b08118734e | ||
|
|
41ee6de784 | ||
|
|
139d2e6be8 | ||
|
|
a866461b0a | ||
|
|
6f61331d46 | ||
|
|
7731ca9fb2 | ||
|
|
3de0c4f5d8 | ||
|
|
2e602f8861 | ||
|
|
1a7d92a082 | ||
|
|
5aa2a0c821 | ||
|
|
4f2328b8dc | ||
|
|
e929e524a3 | ||
|
|
e6b9f18d3d | ||
|
|
7f197ef84e | ||
|
|
a9d7ca3332 | ||
|
|
a65e586de5 | ||
|
|
7072a50060 | ||
|
|
fc1a367c2e | ||
|
|
3b376d85d4 | ||
|
|
9aca8438a2 | ||
|
|
c2d37dfb61 | ||
|
|
3c3bd0f0ea | ||
|
|
958db336b7 | ||
|
|
342d570b3b | ||
|
|
67457c25df | ||
|
|
a98d46f8a8 | ||
|
|
b2fca84b15 | ||
|
|
2e31169738 | ||
|
|
4cda2c8093 | ||
|
|
73b4e8a988 | ||
|
|
82dbfb4379 | ||
|
|
0e2ff2390a | ||
|
|
220d5db739 | ||
|
|
212d475f50 | ||
|
|
b7fbd0433f | ||
|
|
d28dd96aa0 | ||
|
|
0e46f91c51 | ||
|
|
d6dabacb05 | ||
|
|
4363473955 | ||
|
|
7e5fd4e290 | ||
|
|
c30a0cd4f1 | ||
|
|
98d56a38f5 | ||
|
|
f26e95e7c9 | ||
|
|
f39e1a9b70 | ||
|
|
1d5b531ba3 | ||
|
|
a90bd08405 | ||
|
|
1cbb726cab | ||
|
|
ce61d00dcf | ||
|
|
2d92b798c6 | ||
|
|
cc62164a7c | ||
|
|
af510bce93 | ||
|
|
4ba60bedcd | ||
|
|
583bf26129 | ||
|
|
d8c3623141 | ||
|
|
2cd0875da6 | ||
|
|
73d0848f7e | ||
|
|
d757e82e3f | ||
|
|
007238e7dd | ||
|
|
944e019020 | ||
|
|
634f8897b4 | ||
|
|
7651d31c50 | ||
|
|
1702873ab1 | ||
|
|
44e7d5249c | ||
|
|
8ab37040db | ||
|
|
ac203b0ccb | ||
|
|
557546c9c3 | ||
|
|
52a94dbe78 | ||
|
|
f4ffc19981 | ||
|
|
ac3c117b03 | ||
|
|
1ac008ab02 | ||
|
|
58ac86e3bf | ||
|
|
1daf06858b | ||
|
|
a4e8ce7f01 | ||
|
|
ed6e16cdce | ||
|
|
57bb92a36c | ||
|
|
142540e263 | ||
|
|
5a17430747 | ||
|
|
23c84a9e96 | ||
|
|
6bb9dcc216 | ||
|
|
1901e4dbdc | ||
|
|
1657f769da | ||
|
|
c82eb489fe | ||
|
|
9f05befd70 | ||
|
|
f274ed3fd8 | ||
|
|
f6e027abcb | ||
|
|
a92114a854 | ||
|
|
ffb84705d3 | ||
|
|
2f8366b6f9 | ||
|
|
a6f062c126 | ||
|
|
41c24f3bc9 | ||
|
|
af40bdb11b | ||
|
|
00a69e6aed | ||
|
|
04b2d784ce | ||
|
|
a5de51b039 | ||
|
|
4a80e9f20f | ||
|
|
8676769a8f | ||
|
|
2f8c7a81ca | ||
|
|
ac11af6048 | ||
|
|
7c558802a4 | ||
|
|
5a516aa1ad | ||
|
|
4d1b6ed974 | ||
|
|
e8e6bb0499 | ||
|
|
58f94666d1 | ||
|
|
085efaa605 | ||
|
|
6028e392f0 | ||
|
|
fa67dd74a0 | ||
|
|
cb734b50c3 | ||
|
|
087e58b88b | ||
|
|
78b9d67aaa | ||
|
|
a6015e4647 | ||
|
|
fcbe95447a | ||
|
|
760fe392a8 | ||
|
|
5dab606980 | ||
|
|
c265575dfd | ||
|
|
4a1f526ac6 | ||
|
|
497b633661 | ||
|
|
c7f54a98e0 | ||
|
|
7da8c20409 | ||
|
|
116328c7bf | ||
|
|
bd68fef4a2 | ||
|
|
7759d56ad3 | ||
|
|
9c7020a369 | ||
|
|
f8c1903316 | ||
|
|
652423ad14 |
No files matched your search
@@ -4,6 +4,7 @@
|
||||
*.plg
|
||||
*.suo
|
||||
*.vcproj.*.*.user
|
||||
*.kate-swp
|
||||
Win32_LIB_ASM_Debug
|
||||
Win32_LIB_ASM_Release
|
||||
*.bsc
|
||||
|
||||
+12
@@ -192,6 +192,18 @@ from `0` to `#musicdefs-1`, or string indices (which is equal to calling `S_Find
|
||||
Hook is called whenever `S_ShowMusicCredit` (either from game or mod) is called. Takes musicdef as only argument, returning true
|
||||
will overwrite vanilla behavior (not show music credit), can be used to implement custom music credit pop-ups.
|
||||
|
||||
## addHook("SetupVote", function(result, gt, secondgt, prevmap))
|
||||
|
||||
Hook is called whenever server sets up options for vote screen. `result` is table where lua can store options to,
|
||||
(for example, `result[1] = 1` will force green hills as first option), gt is current gametype, secondgt is
|
||||
alternative gametype picked for 3rd entry (for example, gt can be `GT_RACE`, and secondgt can be `GT_MATCH`)
|
||||
prevmap is the previous map that was played (small note - in game code, it is offset by -1, but for lua its offset back,
|
||||
so if previous gamemap was 1, prevmap would also be 1. Which means you can safely do mapheaderinfo[prevmap] to get info on previous map)
|
||||
|
||||
Limitations: currently, game can only change gametype for 3rd option in map (meaning for example, if current gametype is race, and you
|
||||
put battle map in first option, when it gets picked that map will be still run in race gametype). That means, game will only handle maps with
|
||||
different gametype if it is put in 3rd vote option.
|
||||
|
||||
# Other changes
|
||||
|
||||
## P_PlayRinglossSound(source, damager)
|
||||
|
||||
@@ -30,6 +30,24 @@ CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
|
||||
ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
||||
POSSIBILITY OF SUCH DAMAGE.
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
0-Clause BSD License
|
||||
applies to:
|
||||
- qs22k
|
||||
Copyright (c) 2022, Raymond Gardner
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
Permission to use, copy, modify, and/or distribute this software for any
|
||||
purpose with or without fee is hereby granted.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
|
||||
WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
|
||||
MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY
|
||||
SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
|
||||
WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
|
||||
ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR
|
||||
IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
curl License
|
||||
applies to:
|
||||
|
||||
+20
-7
@@ -49,7 +49,7 @@
|
||||
# Already enabled by default for 32-bit
|
||||
# Windows.
|
||||
# NOCURL=1 - Disable libcurl--HTTP capability.
|
||||
# NOGME=1 - Disable game music emu, retro VGM support.
|
||||
# NOLIBGME=1 - Disable game music emu, retro VGM support.
|
||||
# NOOPENMPT=1 - Disable module (tracker) music support.
|
||||
# NOMIXER=1 - Disable SDL Mixer (audio playback).
|
||||
# NOTHREADS=1 - Disable multithreading.
|
||||
@@ -131,9 +131,19 @@ endif
|
||||
include Makefile.d/util.mk
|
||||
|
||||
ifdef PREFIX
|
||||
ifdef USECLANG
|
||||
CC:=$(PREFIX)-clang
|
||||
CXX:=$(PREFIX)-clang++
|
||||
else
|
||||
CC:=$(PREFIX)-gcc
|
||||
CXX:=$(PREFIX)-g++
|
||||
endif
|
||||
endif
|
||||
|
||||
ifdef USECLANG
|
||||
CC=clang
|
||||
CXX=clang++
|
||||
endif
|
||||
|
||||
OBJDUMP_OPTS?=--wide --source --line-numbers
|
||||
|
||||
@@ -161,7 +171,7 @@ sources:=
|
||||
makedir:=../make
|
||||
|
||||
# -DCOMPVERSION: flag to use comptime.h
|
||||
opts:=-DCOMPVERSION -g
|
||||
opts:=-DCOMPVERSION -g -fwrapv
|
||||
libs:=
|
||||
|
||||
# This is a list of variables names, of which if defined,
|
||||
@@ -236,7 +246,7 @@ endif
|
||||
# build with profiling information
|
||||
ifdef PROFILEMODE
|
||||
opts+=-pg
|
||||
libs+=-pg
|
||||
LDFLAGS+=-pg
|
||||
endif
|
||||
|
||||
ifdef DEBUGMODE
|
||||
@@ -248,10 +258,10 @@ ifdef USELTO
|
||||
# compile with LTO
|
||||
ifdef MINGW
|
||||
opts+=-flto=auto -g
|
||||
libs+=-flto=auto -g
|
||||
LDFLAGS+=-flto=auto -g
|
||||
else
|
||||
opts+=-flto=auto
|
||||
libs+=-flto=auto
|
||||
LDFLAGS+=-flto=auto
|
||||
endif
|
||||
endif
|
||||
endif
|
||||
@@ -265,8 +275,10 @@ else
|
||||
opts+=-fsanitize=address
|
||||
libs+=-fsanitize=address
|
||||
endif
|
||||
opts+=-fsanitize=address
|
||||
libs+=-fsanitize=address
|
||||
endif
|
||||
|
||||
ifeq ($(CC),clang)
|
||||
LDFLAGS+= -fuse-ld=lld
|
||||
endif
|
||||
|
||||
# debug_opts also get passed to windres
|
||||
@@ -281,6 +293,7 @@ cxxopts:=$(opts) $(CXXFLAGS)
|
||||
opts+=$(CWFLAGS) # warning flags that shouldnt be passed to c++ compiler
|
||||
|
||||
libs+=$(LDFLAGS) -lstdc++ -lpthread
|
||||
|
||||
asflags:=$(ASFLAGS) -x assembler-with-cpp
|
||||
|
||||
cc=$(CC)
|
||||
|
||||
@@ -14,6 +14,6 @@ sources+=dedicated/i_threads.c
|
||||
endif
|
||||
|
||||
NOOPENMPT=1
|
||||
NOGME=1
|
||||
NOLIBGME=1
|
||||
NOHW=1
|
||||
NOUPNP=1
|
||||
@@ -73,13 +73,6 @@ libs+=-lbacktrace
|
||||
opts+=-DHAVE_LIBBACKTRACE
|
||||
endif
|
||||
|
||||
#windoze hack
|
||||
ifdef MINGW
|
||||
ifndef NODISCORDRPC
|
||||
HAVE_DISCORDRPC=1
|
||||
endif
|
||||
endif
|
||||
|
||||
ifdef HAVE_DISCORDRPC
|
||||
$(eval $(call Propogate_flags,DISCORDRPC))
|
||||
libs+=-ldiscord-rpc
|
||||
|
||||
@@ -144,9 +144,13 @@ ifdef GCC81
|
||||
WFLAGS+=-Wno-error=multistatement-macros
|
||||
endif
|
||||
|
||||
ifeq ($(CC),clang)
|
||||
WFLAGS+= -Wno-unknown-pragmas -Wno-cast-align
|
||||
endif
|
||||
|
||||
ifdef NONX86
|
||||
ifdef X86_64 # yeah that SEEMS contradictory
|
||||
opts+=-march=nocona
|
||||
opts+=-march=x86-64-v2
|
||||
endif
|
||||
else
|
||||
ifndef GCC29
|
||||
|
||||
@@ -15,6 +15,7 @@ endif
|
||||
|
||||
sources+=win32/Srb2win.rc
|
||||
opts+=-DSTDC_HEADERS
|
||||
libs+=-Wl,-Bstatic -lstdc++ -lpthread -lgcc -Wl,-Bdynamic
|
||||
libs+=-ladvapi32 -lkernel32 -lmsvcrt -luser32
|
||||
|
||||
ifndef DEDICATED
|
||||
@@ -42,6 +43,10 @@ libs+=-Wl,--large-address-aware
|
||||
NOLIBBACKTRACE=1
|
||||
endif
|
||||
|
||||
ifndef NODISCORDRPC
|
||||
HAVE_DISCORDRPC=1
|
||||
endif
|
||||
|
||||
ifndef MINGW64
|
||||
32=32
|
||||
x86=x86
|
||||
|
||||
+3
-3
@@ -46,11 +46,11 @@ tables.c
|
||||
v_video.c
|
||||
w_wad.c
|
||||
y_inter.c
|
||||
z_zone.c
|
||||
z_zone.cpp
|
||||
r_bsp.c
|
||||
r_data.c
|
||||
r_draw.c
|
||||
r_fps.c
|
||||
r_fps.cpp
|
||||
r_main.cpp
|
||||
r_patch.c
|
||||
r_patchrotation.c
|
||||
@@ -67,7 +67,7 @@ p_floor.c
|
||||
p_inter.c
|
||||
p_lights.c
|
||||
p_map.c
|
||||
p_maputl.c
|
||||
p_maputl.cpp
|
||||
p_mobj.c
|
||||
p_polyobj.c
|
||||
p_saveg.c
|
||||
|
||||
+1
-11
@@ -89,7 +89,7 @@ precise_t I_GetPreciseTime(void)
|
||||
return 0;
|
||||
}
|
||||
|
||||
UINT64 I_GetPrecisePrecision(void)
|
||||
UINT64 I_GetPrecisePrecision(void)
|
||||
{
|
||||
return 1000000;
|
||||
}
|
||||
@@ -98,16 +98,6 @@ void I_GetEvent(void){}
|
||||
|
||||
void I_OsPolling(void){}
|
||||
|
||||
ticcmd_t *I_BaseTiccmd(void)
|
||||
{
|
||||
return NULL;
|
||||
}
|
||||
|
||||
ticcmd_t *I_BaseTiccmd2(void)
|
||||
{
|
||||
return NULL;
|
||||
}
|
||||
|
||||
void I_Quit(void)
|
||||
{
|
||||
LOGD("SRB2Kart quitting!");
|
||||
|
||||
@@ -10,12 +10,8 @@
|
||||
|
||||
rendermode_t rendermode = render_soft;
|
||||
|
||||
boolean highcolor = false;
|
||||
|
||||
boolean allow_fullscreen = false;
|
||||
|
||||
|
||||
|
||||
consvar_t cv_vidwait = {"vid_wait", "Off", CV_SAVE, CV_OnOff, NULL, 0, NULL, NULL, 0, 0, NULL};
|
||||
|
||||
void I_StartupGraphics(void){}
|
||||
|
||||
+13
-2
@@ -18,6 +18,14 @@
|
||||
#define INT32 int32_t
|
||||
#endif
|
||||
|
||||
#ifndef __cplusplus
|
||||
#ifndef min // Double-Check with WATTCP-32's cdefs.h
|
||||
#define min(x, y) (((x) < (y)) ? (x) : (y))
|
||||
#endif
|
||||
#ifndef max // Double-Check with WATTCP-32's cdefs.h
|
||||
#define max(x, y) (((x) > (y)) ? (x) : (y))
|
||||
#endif
|
||||
#endif
|
||||
|
||||
/*
|
||||
** ==================================================================
|
||||
@@ -534,8 +542,11 @@
|
||||
#endif
|
||||
#define lua_number2str(s,n) sprintf((s), LUA_NUMBER_FMT, (n))
|
||||
#define LUAI_MAXNUMBER2STR 12 /* 10 digits, sign, and \0 */
|
||||
#define lua_str2number(s,p) strtol((s), (p), 10)
|
||||
|
||||
#define lua_str2number(s,p) ({ \
|
||||
long nmr = strtol((s), (p), 10); \
|
||||
nmr = max(INT32_MIN, min((nmr), INT32_MAX)); \
|
||||
nmr; \
|
||||
})
|
||||
|
||||
/*
|
||||
@@ The luai_num* macros define the primitive operations over numbers.
|
||||
|
||||
+47
-70
@@ -1,7 +1,7 @@
|
||||
// SONIC ROBO BLAST 2
|
||||
//-----------------------------------------------------------------------------
|
||||
// Copyright (C) 1998-2000 by DooM Legacy Team.
|
||||
// Copyright (C) 1999-2024 by Sonic Team Junior.
|
||||
// Copyright (C) 1999-2025 by Sonic Team Junior.
|
||||
//
|
||||
// This program is free software distributed under the
|
||||
// terms of the GNU General Public License, version 2.
|
||||
@@ -14,72 +14,47 @@
|
||||
#ifndef __BYTEPTR_H__
|
||||
#define __BYTEPTR_H__
|
||||
|
||||
#if defined (__alpha__) || defined (__arm__) || defined (__mips__) || defined (__ia64__) || defined (__clang__)
|
||||
#define DEALIGNED
|
||||
#endif
|
||||
|
||||
#include "endian.h"
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
#ifndef SRB2_BIG_ENDIAN
|
||||
//
|
||||
// Little-endian machines
|
||||
//
|
||||
#ifdef DEALIGNED
|
||||
#define WRITEUINT8(p,b) do { UINT8 *p_tmp = (void *)p; const UINT8 tv = ( UINT8)(b); memcpy(p, &tv, sizeof( UINT8)); p_tmp++; p = (void *)p_tmp; } while (0)
|
||||
#define WRITESINT8(p,b) do { SINT8 *p_tmp = (void *)p; const SINT8 tv = ( UINT8)(b); memcpy(p, &tv, sizeof( UINT8)); p_tmp++; p = (void *)p_tmp; } while (0)
|
||||
#define WRITEINT16(p,b) do { INT16 *p_tmp = (void *)p; const INT16 tv = ( INT16)(b); memcpy(p, &tv, sizeof( INT16)); p_tmp++; p = (void *)p_tmp; } while (0)
|
||||
#define WRITEINT16_2(p,b) do { INT16 *p_tmp = ( INT16 *)p; const INT16 tv = ( INT16)(b); memcpy(p, &tv, sizeof( INT16)); p_tmp++; *(void**)(&(p)) = (void *)p_tmp; } while (0) // dumb hack for mumble
|
||||
#define WRITEUINT16(p,b) do { UINT16 *p_tmp = (void *)p; const UINT16 tv = ( UINT16)(b); memcpy(p, &tv, sizeof( UINT16)); p_tmp++; p = (void *)p_tmp; } while (0)
|
||||
#define WRITEINT32(p,b) do { INT32 *p_tmp = (void *)p; const INT32 tv = ( INT32)(b); memcpy(p, &tv, sizeof( INT32)); p_tmp++; p = (void *)p_tmp; } while (0)
|
||||
#define WRITEUINT32(p,b) do { UINT32 *p_tmp = (void *)p; const UINT32 tv = ( UINT32)(b); memcpy(p, &tv, sizeof( UINT32)); p_tmp++; p = (void *)p_tmp; } while (0)
|
||||
#define WRITECHAR(p,b) do { char *p_tmp = (void *)p; const char tv = ( char)(b); memcpy(p, &tv, sizeof( char)); p_tmp++; p = (void *)p_tmp; } while (0)
|
||||
#define WRITEFIXED(p,b) do { fixed_t *p_tmp = (void *)p; const fixed_t tv = (fixed_t)(b); memcpy(p, &tv, sizeof(fixed_t)); p_tmp++; p = (void *)p_tmp; } while (0)
|
||||
#define WRITEANGLE(p,b) do { angle_t *p_tmp = (void *)p; const angle_t tv = (angle_t)(b); memcpy(p, &tv, sizeof(angle_t)); p_tmp++; p = (void *)p_tmp; } while (0)
|
||||
#else
|
||||
#define WRITEUINT8(p,b) do { UINT8 *p_tmp = ( UINT8 *)p; *p_tmp = ( UINT8)(b); p_tmp++; p = (void *)p_tmp; } while (0)
|
||||
#define WRITESINT8(p,b) do { SINT8 *p_tmp = ( SINT8 *)p; *p_tmp = ( SINT8)(b); p_tmp++; p = (void *)p_tmp; } while (0)
|
||||
#define WRITEINT16(p,b) do { INT16 *p_tmp = ( INT16 *)p; *p_tmp = ( INT16)(b); p_tmp++; p = (void *)p_tmp; } while (0)
|
||||
#define WRITEINT16_2(p,b) do { INT16 *p_tmp = ( INT16 *)p; *p_tmp = ( INT16)(b); p_tmp++; *(void**)(&(p)) = (void *)p_tmp; } while (0) // dumb hack for mumble
|
||||
#define WRITEUINT16(p,b) do { UINT16 *p_tmp = ( UINT16 *)p; *p_tmp = ( UINT16)(b); p_tmp++; p = (void *)p_tmp; } while (0)
|
||||
#define WRITEINT32(p,b) do { INT32 *p_tmp = ( INT32 *)p; *p_tmp = ( INT32)(b); p_tmp++; p = (void *)p_tmp; } while (0)
|
||||
#define WRITEUINT32(p,b) do { UINT32 *p_tmp = ( UINT32 *)p; *p_tmp = ( UINT32)(b); p_tmp++; p = (void *)p_tmp; } while (0)
|
||||
#define WRITECHAR(p,b) do { char *p_tmp = ( char *)p; *p_tmp = ( char)(b); p_tmp++; p = (void *)p_tmp; } while (0)
|
||||
#define WRITEFIXED(p,b) do { fixed_t *p_tmp = (fixed_t *)p; *p_tmp = (fixed_t)(b); p_tmp++; p = (void *)p_tmp; } while (0)
|
||||
#define WRITEANGLE(p,b) do { angle_t *p_tmp = (angle_t *)p; *p_tmp = (angle_t)(b); p_tmp++; p = (void *)p_tmp; } while (0)
|
||||
#endif
|
||||
#define WRITEUINT8(p,b) do { UINT8 *p_tmp = ( UINT8 *)p; const UINT8 tv = ( UINT8)(b); memcpy(p, &tv, sizeof( UINT8)); p_tmp++; *(void**)(&(p)) = (void *)p_tmp; } while (0)
|
||||
#define WRITESINT8(p,b) do { SINT8 *p_tmp = ( SINT8 *)p; const SINT8 tv = ( UINT8)(b); memcpy(p, &tv, sizeof( UINT8)); p_tmp++; *(void**)(&(p)) = (void *)p_tmp; } while (0)
|
||||
#define WRITEINT16(p,b) do { INT16 *p_tmp = ( INT16 *)p; const INT16 tv = ( INT16)(b); memcpy(p, &tv, sizeof( INT16)); p_tmp++; *(void**)(&(p)) = (void *)p_tmp; } while (0)
|
||||
#define WRITEUINT16(p,b) do { UINT16 *p_tmp = ( UINT16 *)p; const UINT16 tv = ( UINT16)(b); memcpy(p, &tv, sizeof( UINT16)); p_tmp++; *(void**)(&(p)) = (void *)p_tmp; } while (0)
|
||||
#define WRITEINT32(p,b) do { INT32 *p_tmp = ( INT32 *)p; const INT32 tv = ( INT32)(b); memcpy(p, &tv, sizeof( INT32)); p_tmp++; *(void**)(&(p)) = (void *)p_tmp; } while (0)
|
||||
#define WRITEUINT32(p,b) do { UINT32 *p_tmp = ( UINT32 *)p; const UINT32 tv = ( UINT32)(b); memcpy(p, &tv, sizeof( UINT32)); p_tmp++; *(void**)(&(p)) = (void *)p_tmp; } while (0)
|
||||
#define WRITECHAR(p,b) do { char *p_tmp = ( char *)p; const char tv = ( char)(b); memcpy(p, &tv, sizeof( char)); p_tmp++; *(void**)(&(p)) = (void *)p_tmp; } while (0)
|
||||
#define WRITEFIXED(p,b) do { fixed_t *p_tmp = (fixed_t *)p; const fixed_t tv = (fixed_t)(b); memcpy(p, &tv, sizeof(fixed_t)); p_tmp++; *(void**)(&(p)) = (void *)p_tmp; } while (0)
|
||||
#define WRITEANGLE(p,b) do { angle_t *p_tmp = (angle_t *)p; const angle_t tv = (angle_t)(b); memcpy(p, &tv, sizeof(angle_t)); p_tmp++; *(void**)(&(p)) = (void *)p_tmp; } while (0)
|
||||
|
||||
#ifdef __GNUC__
|
||||
#ifdef DEALIGNED
|
||||
#define READUINT8(p) ({ UINT8 *p_tmp = (void *)p; UINT8 b; memcpy(&b, p, sizeof( UINT8)); p_tmp++; p = (void *)p_tmp; b; })
|
||||
#define READSINT8(p) ({ SINT8 *p_tmp = (void *)p; SINT8 b; memcpy(&b, p, sizeof( SINT8)); p_tmp++; p = (void *)p_tmp; b; })
|
||||
#define READINT16(p) ({ INT16 *p_tmp = (void *)p; INT16 b; memcpy(&b, p, sizeof( INT16)); p_tmp++; p = (void *)p_tmp; b; })
|
||||
#define READUINT16(p) ({ UINT16 *p_tmp = (void *)p; UINT16 b; memcpy(&b, p, sizeof( UINT16)); p_tmp++; p = (void *)p_tmp; b; })
|
||||
#define READINT32(p) ({ INT32 *p_tmp = (void *)p; INT32 b; memcpy(&b, p, sizeof( INT32)); p_tmp++; p = (void *)p_tmp; b; })
|
||||
#define READUINT32(p) ({ UINT32 *p_tmp = (void *)p; UINT32 b; memcpy(&b, p, sizeof( UINT32)); p_tmp++; p = (void *)p_tmp; b; })
|
||||
#define READCHAR(p) ({ char *p_tmp = (void *)p; char b; memcpy(&b, p, sizeof( char)); p_tmp++; p = (void *)p_tmp; b; })
|
||||
#define READFIXED(p) ({ fixed_t *p_tmp = (void *)p; fixed_t b; memcpy(&b, p, sizeof(fixed_t)); p_tmp++; p = (void *)p_tmp; b; })
|
||||
#define READANGLE(p) ({ angle_t *p_tmp = (void *)p; angle_t b; memcpy(&b, p, sizeof(angle_t)); p_tmp++; p = (void *)p_tmp; b; })
|
||||
// what is this?
|
||||
#if defined (__GNUC__)
|
||||
#define READUINT8(p) ({ UINT8 *p_tmp = (UINT8 *)p; UINT8 b; memcpy(&b, p, sizeof( UINT8)); p_tmp++; *(void**)(&(p)) = (void *)p_tmp; b; })
|
||||
#define READSINT8(p) ({ SINT8 *p_tmp = (SINT8 *)p; SINT8 b; memcpy(&b, p, sizeof( SINT8)); p_tmp++; *(void**)(&(p)) = (void *)p_tmp; b; })
|
||||
#define READINT16(p) ({ INT16 *p_tmp = (INT16 *)p; INT16 b; memcpy(&b, p, sizeof( INT16)); p_tmp++; *(void**)(&(p)) = (void *)p_tmp; b; })
|
||||
#define READUINT16(p) ({ UINT16 *p_tmp = (UINT16 *)p; UINT16 b; memcpy(&b, p, sizeof( UINT16)); p_tmp++; *(void**)(&(p)) = (void *)p_tmp; b; })
|
||||
#define READINT32(p) ({ INT32 *p_tmp = (INT32 *)p; INT32 b; memcpy(&b, p, sizeof( INT32)); p_tmp++; *(void**)(&(p)) = (void *)p_tmp; b; })
|
||||
#define READUINT32(p) ({ UINT32 *p_tmp = (UINT32 *)p; UINT32 b; memcpy(&b, p, sizeof( UINT32)); p_tmp++; *(void**)(&(p)) = (void *)p_tmp; b; })
|
||||
#define READCHAR(p) ({ char *p_tmp = (char *)p; char b; memcpy(&b, p, sizeof( char)); p_tmp++; *(void**)(&(p)) = (void *)p_tmp; b; })
|
||||
#define READFIXED(p) ({ fixed_t *p_tmp = (fixed_t *)p; fixed_t b; memcpy(&b, p, sizeof(fixed_t)); p_tmp++; *(void**)(&(p)) = (void *)p_tmp; b; })
|
||||
#define READANGLE(p) ({ angle_t *p_tmp = (angle_t *)p; angle_t b; memcpy(&b, p, sizeof(angle_t)); p_tmp++; *(void**)(&(p)) = (void *)p_tmp; b; })
|
||||
#else
|
||||
#define READUINT8(p) ({ UINT8 *p_tmp = ( UINT8 *)p; UINT8 b = *p_tmp; p_tmp++; p = (void *)p_tmp; b; })
|
||||
#define READSINT8(p) ({ SINT8 *p_tmp = ( SINT8 *)p; SINT8 b = *p_tmp; p_tmp++; p = (void *)p_tmp; b; })
|
||||
#define READINT16(p) ({ INT16 *p_tmp = ( INT16 *)p; INT16 b = *p_tmp; p_tmp++; p = (void *)p_tmp; b; })
|
||||
#define READUINT16(p) ({ UINT16 *p_tmp = ( UINT16 *)p; UINT16 b = *p_tmp; p_tmp++; p = (void *)p_tmp; b; })
|
||||
#define READINT32(p) ({ INT32 *p_tmp = ( INT32 *)p; INT32 b = *p_tmp; p_tmp++; p = (void *)p_tmp; b; })
|
||||
#define READUINT32(p) ({ UINT32 *p_tmp = ( UINT32 *)p; UINT32 b = *p_tmp; p_tmp++; p = (void *)p_tmp; b; })
|
||||
#define READCHAR(p) ({ char *p_tmp = ( char *)p; char b = *p_tmp; p_tmp++; p = (void *)p_tmp; b; })
|
||||
#define READFIXED(p) ({ fixed_t *p_tmp = (fixed_t *)p; fixed_t b = *p_tmp; p_tmp++; p = (void *)p_tmp; b; })
|
||||
#define READANGLE(p) ({ angle_t *p_tmp = (angle_t *)p; angle_t b = *p_tmp; p_tmp++; p = (void *)p_tmp; b; })
|
||||
#endif
|
||||
#else
|
||||
#define READUINT8(p) *(( UINT8 *)p)++
|
||||
#define READSINT8(p) *(( SINT8 *)p)++
|
||||
#define READINT16(p) *(( INT16 *)p)++
|
||||
#define READUINT16(p) *(( UINT16 *)p)++
|
||||
#define READINT32(p) *(( INT32 *)p)++
|
||||
#define READUINT32(p) *(( UINT32 *)p)++
|
||||
#define READCHAR(p) *(( char *)p)++
|
||||
#define READFIXED(p) *((fixed_t *)p)++
|
||||
#define READANGLE(p) *((angle_t *)p)++
|
||||
#define READUINT8(p) ((UINT8*)(*(void**)(&(p)) = (void*)&((UINT8*)(p))[1]))[-1]
|
||||
#define READSINT8(p) ((SINT8*)(*(void**)(&(p)) = (void*)&((SINT8*)(p))[1]))[-1]
|
||||
#define READINT16(p) ((INT16*)(*(void**)(&(p)) = (void*)&((INT16*)(p))[1]))[-1]
|
||||
#define READUINT16(p) ((UINT16*)(*(void**)(&(p)) = (void*)&((UINT16*)(p))[1]))[-1]
|
||||
#define READINT32(p) ((INT32*)(*(void**)(&(p)) = (void*)&((INT32*)(p))[1]))[-1]
|
||||
#define READUINT32(p) ((UINT32*)(*(void**)(&(p)) = (void*)&((UINT32*)(p))[1]))[-1]
|
||||
#define READCHAR(p) ((char*)(*(void**)(&(p)) = (void*)&((char*)(p))[1]))[-1]
|
||||
#define READFIXED(p) ((fixed_t*)(*(void**)(&(p)) = (void*)&((fixed_t*)(p))[1]))[-1]
|
||||
#define READANGLE(p) ((angle_t*)(*(void**)(&(p)) = (void*)&((angle_t*)(p))[1]))[-1]
|
||||
#endif
|
||||
|
||||
#else //SRB2_BIG_ENDIAN
|
||||
@@ -142,19 +117,17 @@ FUNCINLINE static ATTRINLINE UINT32 readulong(void *ptr)
|
||||
return (ucp[3] << 24) | (ucp[2] << 16) | (ucp[1] << 8) | ucp[0];
|
||||
}
|
||||
|
||||
#define READUINT8(p) ({ UINT8 *p_tmp = ( UINT8 *)p; UINT8 b = *p_tmp; p_tmp++; p = (void *)p_tmp; b; })
|
||||
#define READSINT8(p) ({ SINT8 *p_tmp = ( SINT8 *)p; SINT8 b = *p_tmp; p_tmp++; p = (void *)p_tmp; b; })
|
||||
#define READINT16(p) ({ INT16 *p_tmp = ( INT16 *)p; INT16 b = readshort(p); p_tmp++; p = (void *)p_tmp; b; })
|
||||
#define READUINT16(p) ({ UINT16 *p_tmp = ( UINT16 *)p; UINT16 b = readushort(p); p_tmp++; p = (void *)p_tmp; b; })
|
||||
#define READINT32(p) ({ INT32 *p_tmp = ( INT32 *)p; INT32 b = readlong(p); p_tmp++; p = (void *)p_tmp; b; })
|
||||
#define READUINT32(p) ({ UINT32 *p_tmp = ( UINT32 *)p; UINT32 b = readulong(p); p_tmp++; p = (void *)p_tmp; b; })
|
||||
#define READCHAR(p) ({ char *p_tmp = ( char *)p; char b = *p_tmp; p_tmp++; p = (void *)p_tmp; b; })
|
||||
#define READFIXED(p) ({ fixed_t *p_tmp = (fixed_t *)p; fixed_t b = readlong(p); p_tmp++; p = (void *)p_tmp; b; })
|
||||
#define READANGLE(p) ({ angle_t *p_tmp = (angle_t *)p; angle_t b = readulong(p); p_tmp++; p = (void *)p_tmp; b; })
|
||||
#define READUINT8(p) ((UINT8*)(p = (void*)&((UINT8*)p)[1]))[-1]
|
||||
#define READSINT8(p) ((SINT8*)(p = (void*)&((SINT8*)p)[1]))[-1]
|
||||
#define READINT16(p) readshort(&((INT16*)(p = (void*)&((INT16*)p)[1]))[-1])
|
||||
#define READUINT16(p) readushort(&((UINT16*)(p = (void*)&((UINT16*)p)[1]))[-1])
|
||||
#define READINT32(p) readlong(&((INT32*)(p = (void*)&((INT32*)p)[1]))[-1])
|
||||
#define READUINT32(p) readulong(&((UINT32*)(p = (void*)&((UINT32*)p)[1]))
|
||||
#define READCHAR(p) ((char*)(p = (void*)&((char*)p)[1]))[-1]
|
||||
#define READFIXED(p) readlong(&((fixed_t*)(p = (void*)&((fixed_t*)p)[1]))[-1])
|
||||
#define READANGLE(p) readulong(&((angle_t*)(p = (void*)&((angle_t*)p)[1]))[-1])
|
||||
#endif //SRB2_BIG_ENDIAN
|
||||
|
||||
#undef DEALIGNED
|
||||
|
||||
#define WRITESTRINGN(p, s, n) do { \
|
||||
size_t tmp_i; \
|
||||
\
|
||||
@@ -231,4 +204,8 @@ FUNCINLINE static ATTRINLINE UINT32 readulong(void *ptr)
|
||||
p += n; \
|
||||
} while (0)
|
||||
|
||||
#ifdef __cplusplus
|
||||
} // extern "C"
|
||||
#endif
|
||||
|
||||
#endif // __BYTEPTR_H__
|
||||
+2
-2
@@ -838,7 +838,7 @@ static void COM_Help_f(void)
|
||||
{
|
||||
{
|
||||
if (!stricmp(cvar->PossibleValue[0].strvalue, "MIN") && !stricmp(cvar->PossibleValue[1].strvalue, "MAX"))
|
||||
{
|
||||
{
|
||||
if (floatmode)
|
||||
{
|
||||
float fu = FIXED_TO_FLOAT(cvar->PossibleValue[0].value);
|
||||
@@ -1044,7 +1044,7 @@ static void COM_Add_f(void)
|
||||
|
||||
if (( cvar->flags & CV_FLOAT ))
|
||||
{
|
||||
float n =FIXED_TO_FLOAT (cvar->value) + atof(COM_Argv(2));
|
||||
float n = FIXED_TO_FLOAT(cvar->value) + (float)atof(COM_Argv(2));
|
||||
CV_Set(cvar, va("%ld%s", (long)n, M_Ftrim(n)));
|
||||
}
|
||||
else
|
||||
|
||||
+1
-1
@@ -836,7 +836,7 @@ boolean CON_Responder(event_t *ev)
|
||||
// check for console toggle key
|
||||
if (ev->type != ev_console)
|
||||
{
|
||||
if (modeattacking || metalrecording)
|
||||
if (modeattacking)
|
||||
return false;
|
||||
|
||||
if (ev->data1 >= KEY_MOUSE1) // See also: HUD_Responder
|
||||
|
||||
@@ -10,6 +10,9 @@
|
||||
/// \file console.h
|
||||
/// \brief Console drawing and input
|
||||
|
||||
#ifndef __CONSOLE__
|
||||
#define __CONSOLE__
|
||||
|
||||
#include "d_event.h"
|
||||
#include "command.h"
|
||||
#include "i_threads.h"
|
||||
@@ -62,3 +65,5 @@ void CON_ToggleOff(void);
|
||||
boolean CON_Ready(void);
|
||||
|
||||
void CON_LogMessage(const char *msg);
|
||||
|
||||
#endif
|
||||
+89
-1
@@ -10,10 +10,14 @@
|
||||
|
||||
#include "memory.h"
|
||||
|
||||
#include <array>
|
||||
#include <new>
|
||||
#include <cstdint>
|
||||
|
||||
#include "../cxxutil.hpp"
|
||||
#include "../z_zone.h"
|
||||
#include "../lua_script.h"
|
||||
|
||||
using namespace srb2;
|
||||
|
||||
namespace
|
||||
{
|
||||
@@ -58,6 +62,90 @@ void LinearMemory::reset() noexcept
|
||||
|
||||
} // namespace
|
||||
|
||||
PoolAllocator::~PoolAllocator()
|
||||
{
|
||||
release();
|
||||
}
|
||||
|
||||
constexpr static size_t nearest_multiple(size_t v, size_t divisor)
|
||||
{
|
||||
return (v + (divisor - 1)) & ~(divisor - 1);
|
||||
}
|
||||
|
||||
PoolAllocator::ChunkFooter* PoolAllocator::allocate_chunk()
|
||||
{
|
||||
uint8_t* chunk = (uint8_t*)Z_Malloc(nearest_multiple(blocks_ * block_size_, alignof(ChunkFooter)) + sizeof(ChunkFooter), tag_, nullptr);
|
||||
ChunkFooter* footer = (ChunkFooter*)(chunk + (blocks_ * block_size_));
|
||||
footer->next = nullptr;
|
||||
footer->start = (void*)chunk;
|
||||
for (size_t i = 0; i < blocks_; i++)
|
||||
{
|
||||
FreeBlock* cur = (FreeBlock*)(chunk + (i * block_size_));
|
||||
FreeBlock* next = (FreeBlock*)(chunk + ((i + 1) * block_size_));
|
||||
cur->next = next;
|
||||
}
|
||||
((FreeBlock*)(chunk + ((blocks_ - 1) * block_size_)))->next = nullptr;
|
||||
return footer;
|
||||
}
|
||||
|
||||
void* PoolAllocator::allocate()
|
||||
{
|
||||
if (first_chunk_ == nullptr)
|
||||
{
|
||||
SRB2_ASSERT(head_ == nullptr);
|
||||
|
||||
// No chunks allocated yet
|
||||
first_chunk_ = allocate_chunk();
|
||||
head_ = (FreeBlock*)first_chunk_->start;
|
||||
}
|
||||
|
||||
if (head_->next == nullptr)
|
||||
{
|
||||
// Current chunk will be full; allocate another at the end of the list
|
||||
ChunkFooter* last_chunk = first_chunk_;
|
||||
while (last_chunk->next != nullptr)
|
||||
{
|
||||
last_chunk = last_chunk->next;
|
||||
}
|
||||
ChunkFooter* new_chunk = allocate_chunk();
|
||||
last_chunk->next = new_chunk;
|
||||
head_->next = (FreeBlock*)new_chunk->start;
|
||||
}
|
||||
|
||||
FreeBlock* ret = head_;
|
||||
head_ = head_->next;
|
||||
return ret;
|
||||
}
|
||||
|
||||
void PoolAllocator::deallocate(void* p)
|
||||
{
|
||||
// Required in case this block is reused
|
||||
LUA_InvalidateUserdata(p);
|
||||
|
||||
FreeBlock* block = reinterpret_cast<FreeBlock*>(p);
|
||||
block->next = head_;
|
||||
head_ = block;
|
||||
}
|
||||
|
||||
void PoolAllocator::release()
|
||||
{
|
||||
ChunkFooter* next = nullptr;
|
||||
for (ChunkFooter* i = first_chunk_; i != nullptr; i = next)
|
||||
{
|
||||
uint8_t *chunk = (uint8_t*)i->start;
|
||||
for (size_t j = 0; j < blocks_; j++)
|
||||
{
|
||||
// Invalidate all blocks that possibly weren't passed to deallocate
|
||||
LUA_InvalidateUserdata(chunk + (j * block_size_));
|
||||
}
|
||||
next = i->next;
|
||||
Z_Free(i->start);
|
||||
}
|
||||
|
||||
first_chunk_ = nullptr;
|
||||
head_ = nullptr;
|
||||
}
|
||||
|
||||
static LinearMemory g_frame_memory {4 * 1024 * 1024};
|
||||
|
||||
void* Z_Frame_Alloc(size_t size)
|
||||
|
||||
@@ -14,6 +14,58 @@
|
||||
#include <stddef.h>
|
||||
|
||||
#ifdef __cplusplus
|
||||
|
||||
#include <cstdint>
|
||||
|
||||
namespace srb2
|
||||
{
|
||||
|
||||
/// Pool allocator; manages bulk allocations of same-size block. If the pool is full,
|
||||
/// allocations will fail by returning nullptr.
|
||||
class PoolAllocator final
|
||||
{
|
||||
struct FreeBlock
|
||||
{
|
||||
FreeBlock* next;
|
||||
};
|
||||
struct ChunkFooter
|
||||
{
|
||||
ChunkFooter* next;
|
||||
void* start;
|
||||
};
|
||||
ChunkFooter* first_chunk_;
|
||||
FreeBlock* head_;
|
||||
size_t block_size_;
|
||||
size_t blocks_;
|
||||
int32_t tag_;
|
||||
|
||||
ChunkFooter* allocate_chunk();
|
||||
|
||||
public:
|
||||
constexpr PoolAllocator(size_t block_size, size_t blocks, int32_t tag)
|
||||
: first_chunk_(nullptr)
|
||||
, head_(nullptr)
|
||||
, block_size_(block_size)
|
||||
, blocks_(blocks)
|
||||
, tag_(tag)
|
||||
{}
|
||||
PoolAllocator(const PoolAllocator&) = delete;
|
||||
PoolAllocator(PoolAllocator&&) noexcept = default;
|
||||
~PoolAllocator();
|
||||
|
||||
PoolAllocator& operator=(const PoolAllocator&) = delete;
|
||||
PoolAllocator& operator=(PoolAllocator&&) noexcept = default;
|
||||
|
||||
void* allocate();
|
||||
void deallocate(void* p);
|
||||
constexpr size_t block_size() const noexcept { return block_size_; };
|
||||
|
||||
void release();
|
||||
};
|
||||
|
||||
} // namespace srb2
|
||||
|
||||
|
||||
extern "C" {
|
||||
#endif // __cpluspplus
|
||||
|
||||
|
||||
+1
-1
@@ -61,7 +61,7 @@ struct SourceLocation {
|
||||
|
||||
class IErrorAssertHandler {
|
||||
public:
|
||||
static void handle(const SourceLocation& source_location, const char* expression) {
|
||||
[[ noreturn ]] static void handle(const SourceLocation& source_location, const char* expression) {
|
||||
I_Error("Assertion failed at %s:%u: %s != true",
|
||||
source_location.file_name,
|
||||
source_location.line_number,
|
||||
|
||||
+413
-188
@@ -16,6 +16,8 @@
|
||||
#include <unistd.h> //for unlink
|
||||
#endif
|
||||
|
||||
#include <zlib.h>
|
||||
|
||||
#include "i_time.h"
|
||||
#include "i_net.h"
|
||||
#include "i_system.h"
|
||||
@@ -87,6 +89,17 @@ boolean serverrunning = false;
|
||||
INT32 serverplayer = 0;
|
||||
char motd[254], server_context[8]; // Message of the Day, Unique Context (even without Mumble support)
|
||||
|
||||
#define MAP_ICON_REQUEST_FREQUENCY 8
|
||||
|
||||
static UINT8 map_icon_index; // amount of fragments we have retrieved
|
||||
static UINT8 map_icon_needed; // amount of fragments we need to get the full data set
|
||||
static INT32 map_icon_read; // amount of bytes we have read
|
||||
static UINT32 map_icon_missing; // bitmask of fragments we haven't received yet
|
||||
static tic_t map_icon_last_request; // last time we sent an icon request, to avoid flood
|
||||
static int map_icon_request_count; // current count of icon requests sent
|
||||
static UINT8 *map_icon_data;
|
||||
static patch_t *map_icon;
|
||||
|
||||
plrinfo playerinfo[MAXPLAYERS];
|
||||
SINT8 joinnode = 0; // used for CL_VIEWSERVER
|
||||
|
||||
@@ -198,17 +211,10 @@ tic_t firstconnectattempttime = 0;
|
||||
// Must be a power of two
|
||||
#define TEXTCMD_HASH_SIZE 4
|
||||
|
||||
typedef struct textcmdplayer_s
|
||||
{
|
||||
INT32 playernum;
|
||||
UINT8 cmd[MAXTEXTCMD];
|
||||
struct textcmdplayer_s *next;
|
||||
} textcmdplayer_t;
|
||||
|
||||
typedef struct textcmdtic_s
|
||||
{
|
||||
tic_t tic;
|
||||
textcmdplayer_t *playercmds[TEXTCMD_HASH_SIZE];
|
||||
UINT8 *playercmds[MAXPLAYERS];
|
||||
struct textcmdtic_s *next;
|
||||
} textcmdtic_t;
|
||||
|
||||
@@ -259,27 +265,21 @@ static inline boolean UseVanillaSynch(INT32 node)
|
||||
|
||||
static inline void *G_DcpyTiccmd(void* dest, const ticcmd_t* src, const size_t n)
|
||||
{
|
||||
const size_t d = n / sizeof(ticcmd_t);
|
||||
const size_t r = n % sizeof(ticcmd_t);
|
||||
UINT8 *ret = dest;
|
||||
|
||||
if (r)
|
||||
M_Memcpy(dest, src, n);
|
||||
else if (d)
|
||||
G_MoveTiccmd(dest, src, d);
|
||||
if (n)
|
||||
G_MoveTiccmd(dest, src, n/sizeof(ticcmd_t));
|
||||
|
||||
return ret+n;
|
||||
}
|
||||
|
||||
static inline void *G_ScpyTiccmd(ticcmd_t* dest, void* src, const size_t n)
|
||||
{
|
||||
const size_t d = n / sizeof(ticcmd_t);
|
||||
const size_t r = n % sizeof(ticcmd_t);
|
||||
UINT8 *ret = src;
|
||||
|
||||
if (r)
|
||||
M_Memcpy(dest, src, n);
|
||||
else if (d)
|
||||
G_MoveTiccmd(dest, src, d);
|
||||
if (n)
|
||||
G_MoveTiccmd(dest, src, n/sizeof(ticcmd_t));
|
||||
|
||||
return ret+n;
|
||||
}
|
||||
|
||||
@@ -400,22 +400,13 @@ static void D_FreeTextcmd(tic_t tic)
|
||||
|
||||
if (textcmdtic)
|
||||
{
|
||||
INT32 i;
|
||||
|
||||
// Remove this tic from the list.
|
||||
*tctprev = textcmdtic->next;
|
||||
|
||||
// Free all players.
|
||||
for (i = 0; i < TEXTCMD_HASH_SIZE; i++)
|
||||
for (INT32 i = 0; i < MAXPLAYERS; i++)
|
||||
{
|
||||
textcmdplayer_t *textcmdplayer = textcmdtic->playercmds[i];
|
||||
|
||||
while (textcmdplayer)
|
||||
{
|
||||
textcmdplayer_t *tcpnext = textcmdplayer->next;
|
||||
Z_Free(textcmdplayer);
|
||||
textcmdplayer = tcpnext;
|
||||
}
|
||||
Z_Free(textcmdtic->playercmds[i]);
|
||||
}
|
||||
|
||||
// Free this tic's own memory.
|
||||
@@ -432,10 +423,8 @@ static UINT8* D_GetExistingTextcmd(tic_t tic, INT32 playernum)
|
||||
// Do we have an entry for the tic? If so, look for player.
|
||||
if (textcmdtic)
|
||||
{
|
||||
textcmdplayer_t *textcmdplayer = textcmdtic->playercmds[playernum & (TEXTCMD_HASH_SIZE - 1)];
|
||||
while (textcmdplayer && textcmdplayer->playernum != playernum) textcmdplayer = textcmdplayer->next;
|
||||
|
||||
if (textcmdplayer) return textcmdplayer->cmd;
|
||||
UINT8 *cmd = textcmdtic->playercmds[playernum];
|
||||
if (cmd) return cmd;
|
||||
}
|
||||
|
||||
return NULL;
|
||||
@@ -446,7 +435,6 @@ static UINT8* D_GetTextcmd(tic_t tic, INT32 playernum)
|
||||
{
|
||||
textcmdtic_t *textcmdtic = textcmds[tic & (TEXTCMD_HASH_SIZE - 1)];
|
||||
textcmdtic_t **tctprev = &textcmds[tic & (TEXTCMD_HASH_SIZE - 1)];
|
||||
textcmdplayer_t *textcmdplayer, **tcpprev;
|
||||
|
||||
// Look for the tic.
|
||||
while (textcmdtic && textcmdtic->tic != tic)
|
||||
@@ -462,24 +450,11 @@ static UINT8* D_GetTextcmd(tic_t tic, INT32 playernum)
|
||||
textcmdtic->tic = tic;
|
||||
}
|
||||
|
||||
tcpprev = &textcmdtic->playercmds[playernum & (TEXTCMD_HASH_SIZE - 1)];
|
||||
textcmdplayer = *tcpprev;
|
||||
|
||||
// Look for the player.
|
||||
while (textcmdplayer && textcmdplayer->playernum != playernum)
|
||||
{
|
||||
tcpprev = &textcmdplayer->next;
|
||||
textcmdplayer = textcmdplayer->next;
|
||||
}
|
||||
|
||||
// If we don't have an entry for the player, make it.
|
||||
if (!textcmdplayer)
|
||||
{
|
||||
textcmdplayer = *tcpprev = Z_Calloc(sizeof (textcmdplayer_t), PU_STATIC, NULL);
|
||||
textcmdplayer->playernum = playernum;
|
||||
}
|
||||
if (!textcmdtic->playercmds[playernum])
|
||||
textcmdtic->playercmds[playernum] = Z_Calloc(MAXTEXTCMD, PU_STATIC, NULL);
|
||||
|
||||
return textcmdplayer->cmd;
|
||||
return textcmdtic->playercmds[playernum];
|
||||
}
|
||||
|
||||
static void ExtraDataTicker(void)
|
||||
@@ -1211,6 +1186,10 @@ static inline void CL_DrawConnectionStatus(void)
|
||||
if (!menuactive) // menu already draws its own fade
|
||||
V_DrawFadeScreen(0xFF00, 16); // force default
|
||||
|
||||
// reset the counter for mapicon
|
||||
if (cl_mode != CL_VIEWSERVER)
|
||||
map_icon_request_count = 0;
|
||||
|
||||
if (cl_mode != CL_DOWNLOADFILES && cl_mode != CL_LOADFILES && cl_mode != CL_CHECKFILES && cl_mode != CL_VIEWSERVER
|
||||
#ifdef HAVE_CURL
|
||||
&& cl_mode != CL_DOWNLOADHTTPFILES
|
||||
@@ -1337,11 +1316,48 @@ static inline void CL_DrawConnectionStatus(void)
|
||||
|
||||
V_DrawThinString(12 + 80, 18, V_ALLOWLOWERCASE, va("%s", serverlist[joinnode].info.servername));
|
||||
|
||||
const char *map = va("%sP", serverlist[joinnode].info.mapname);
|
||||
patch_t *current_map = W_LumpExists(map) ? W_CachePatchName(map, PU_CACHE) : W_CachePatchName("BLANKLVL", PU_CACHE);
|
||||
V_DrawSmallScaledPatch(10, 18, 0, current_map);
|
||||
if (map_icon == NULL)
|
||||
{
|
||||
const char *map = va("%sP", serverlist[joinnode].info.mapname);
|
||||
patch_t *current_map = W_LumpExists(map) ? W_CachePatchName(map, PU_CACHE) : NULL;
|
||||
|
||||
// check first if we may have the map icon loaded already
|
||||
if (current_map != NULL)
|
||||
V_DrawSmallScaledPatch(10, 18, 0, current_map);
|
||||
else if (map_icon_data != NULL && map_icon_request_count <= 5)
|
||||
{
|
||||
if (I_GetTime() - map_icon_last_request > MAP_ICON_REQUEST_FREQUENCY)
|
||||
{
|
||||
doomdata_t *netbuffer = DOOMCOM_DATA(doomcom);
|
||||
netbuffer->packettype = PT_NEEDMAPICON;
|
||||
|
||||
// failed to retrieve map icon, request it again
|
||||
HSendPacket(servernode, false, 0, 0);
|
||||
map_icon_last_request = I_GetTime();
|
||||
map_icon_request_count++;
|
||||
}
|
||||
|
||||
V_DrawFill(10, 18, MAP_ICON_WIDTH / 2, MAP_ICON_HEIGHT / 2, 31);
|
||||
char dots[4] = "...";
|
||||
if ((I_GetTime() & 0xf) < 4)
|
||||
dots[0] = '\0';
|
||||
else if ((I_GetTime() & 0xf) < 8)
|
||||
dots[1] = '\0';
|
||||
else if ((I_GetTime() & 0xf) < 12)
|
||||
dots[2] = '\0';
|
||||
V_DrawString(10 + MAP_ICON_WIDTH / 4 - V_StringWidth("...", 0) / 2, 18 + MAP_ICON_HEIGHT / 4 - 3, 0, dots);
|
||||
}
|
||||
else
|
||||
V_DrawSmallScaledPatch(10, 18, 0, W_CachePatchName("BLANKLVL", PU_CACHE));
|
||||
}
|
||||
else
|
||||
V_DrawSmallScaledPatch(10, 18, 0, map_icon);
|
||||
|
||||
if (serverlist[joinnode].info.iszone)
|
||||
V_DrawThinString(12 + 80, 38, V_ALLOWLOWERCASE, va("%s Zone", serverlist[joinnode].info.maptitle));
|
||||
else
|
||||
V_DrawThinString(12 + 80, 38, V_ALLOWLOWERCASE, va("%s", serverlist[joinnode].info.maptitle));
|
||||
|
||||
V_DrawThinString(12 + 80, 38, V_ALLOWLOWERCASE, va("%s", serverlist[joinnode].info.maptitle));
|
||||
V_DrawThinString(12 + 80, 48, V_ALLOWLOWERCASE, va("%s", Gametype_Names[serverlist[joinnode].info.gametype]));
|
||||
|
||||
if (fileneedednum > 0)
|
||||
@@ -1535,12 +1551,12 @@ static boolean CL_SendJoin(void)
|
||||
netbuffer->u.clientcfg.version = VERSION;
|
||||
netbuffer->u.clientcfg.subversion = SUBVERSION;
|
||||
strncpy(netbuffer->u.clientcfg.application, SRB2APPLICATION,
|
||||
sizeof netbuffer->u.clientcfg.application);
|
||||
sizeof(netbuffer->u.clientcfg.application));
|
||||
#ifdef SATURNJOIN
|
||||
netbuffer->u.clientcfg.issaturn = ISSATURN;
|
||||
#endif
|
||||
|
||||
return HSendPacket(servernode, false, 0, sizeof (clientconfig_pak));
|
||||
return HSendPacket(servernode, false, 0, sizeof(clientconfig_pak));
|
||||
}
|
||||
|
||||
static void SV_SendServerInfo(INT32 node, tic_t servertime)
|
||||
@@ -1581,59 +1597,38 @@ static void SV_SendServerInfo(INT32 node, tic_t servertime)
|
||||
|
||||
CopyCaretColors(netbuffer->u.serverinfo.servername, cv_servername.string,
|
||||
MAXSERVERNAME);
|
||||
strncpy(netbuffer->u.serverinfo.mapname, G_BuildMapName(gamemap), 7);
|
||||
strncpy(netbuffer->u.serverinfo.mapname, G_BuildMapName(gamemap), sizeof(netbuffer->u.serverinfo.mapname)-1);
|
||||
|
||||
M_Memcpy(netbuffer->u.serverinfo.mapmd5, mapmd5, 16);
|
||||
M_Memcpy(netbuffer->u.serverinfo.mapmd5, mapmd5, sizeof(netbuffer->u.serverinfo.mapmd5));
|
||||
|
||||
if (!(mapheaderinfo[gamemap-1]->levelflags & LF_NOZONE) && !(mapheaderinfo[prevmap]->zonttl[0]))
|
||||
netbuffer->u.serverinfo.iszone = 1;
|
||||
else
|
||||
netbuffer->u.serverinfo.iszone = 0;
|
||||
netbuffer->u.serverinfo.iszone = 0;
|
||||
|
||||
memset(netbuffer->u.serverinfo.maptitle, 0, 33);
|
||||
memset(netbuffer->u.serverinfo.maptitle, 0, sizeof(netbuffer->u.serverinfo.maptitle));
|
||||
memset(netbuffer->u.serverinfo.httpsource, 0, MAX_MIRROR_LENGTH);
|
||||
|
||||
if (!(mapheaderinfo[gamemap-1]->menuflags & LF2_HIDEINMENU) && mapheaderinfo[gamemap-1]->lvlttl[0])
|
||||
{
|
||||
//strncpy(netbuffer->u.serverinfo.maptitle, (char *)mapheaderinfo[gamemap-1]->lvlttl, 33);
|
||||
// set up the levelstring
|
||||
if (netbuffer->u.serverinfo.iszone || (mapheaderinfo[gamemap-1]->levelflags & LF_NOZONE))
|
||||
strncpy(netbuffer->u.serverinfo.maptitle, mapheaderinfo[gamemap-1]->lvlttl, sizeof(netbuffer->u.serverinfo.maptitle)-1);
|
||||
|
||||
if (!(mapheaderinfo[gamemap-1]->levelflags & LF_NOZONE))
|
||||
{
|
||||
if (mapheaderinfo[gamemap-1]->actnum[0])
|
||||
snprintf(netbuffer->u.serverinfo.maptitle,
|
||||
33,
|
||||
"%s %s",
|
||||
mapheaderinfo[gamemap-1]->lvlttl, mapheaderinfo[gamemap-1]->actnum);
|
||||
if (mapheaderinfo[gamemap-1]->zonttl[0])
|
||||
{
|
||||
strncat(netbuffer->u.serverinfo.maptitle, " ", sizeof(netbuffer->u.serverinfo.maptitle)-1);
|
||||
strncat(netbuffer->u.serverinfo.maptitle, mapheaderinfo[gamemap-1]->zonttl,
|
||||
sizeof(netbuffer->u.serverinfo.maptitle)-1);
|
||||
}
|
||||
else
|
||||
snprintf(netbuffer->u.serverinfo.maptitle,
|
||||
33,
|
||||
"%s",
|
||||
mapheaderinfo[gamemap-1]->lvlttl);
|
||||
{
|
||||
netbuffer->u.serverinfo.iszone = 1; // ms and clients will append this themselves
|
||||
}
|
||||
}
|
||||
else
|
||||
|
||||
if (mapheaderinfo[gamemap-1]->actnum[0])
|
||||
{
|
||||
if (mapheaderinfo[gamemap-1]->actnum[0])
|
||||
{
|
||||
if (snprintf(netbuffer->u.serverinfo.maptitle,
|
||||
33,
|
||||
"%s %s %s",
|
||||
mapheaderinfo[gamemap-1]->lvlttl, mapheaderinfo[gamemap-1]->zonttl, mapheaderinfo[gamemap-1]->actnum) < 0)
|
||||
{
|
||||
// If there's an encoding error, send UNKNOWN, we accept that the above may be truncated
|
||||
strncpy(netbuffer->u.serverinfo.maptitle, "Unknown", 33);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if (snprintf(netbuffer->u.serverinfo.maptitle,
|
||||
33,
|
||||
"%s %s",
|
||||
mapheaderinfo[gamemap-1]->lvlttl, mapheaderinfo[gamemap-1]->zonttl) < 0)
|
||||
{
|
||||
// If there's an encoding error, send UNKNOWN, we accept that the above may be truncated
|
||||
strncpy(netbuffer->u.serverinfo.maptitle, "Unknown", 33);
|
||||
}
|
||||
}
|
||||
strncat(netbuffer->u.serverinfo.maptitle, " ", sizeof(netbuffer->u.serverinfo.maptitle)-1);
|
||||
strncat(netbuffer->u.serverinfo.maptitle, mapheaderinfo[gamemap-1]->actnum,
|
||||
sizeof(netbuffer->u.serverinfo.maptitle)-1);
|
||||
}
|
||||
}
|
||||
else
|
||||
@@ -1722,6 +1717,83 @@ static void SV_SendPlayerInfo(INT32 node)
|
||||
HSendPacket(node, false, 0, sizeof(plrinfo) * MSCOMPAT_MAXPLAYERS);
|
||||
}
|
||||
|
||||
static void SV_SendMapIcon(INT32 node)
|
||||
{
|
||||
doomdata_t *netbuffer = DOOMCOM_DATA(doomcom);
|
||||
|
||||
const char *map = va("%sP", G_BuildMapName(gamemap));
|
||||
if (!W_LumpExists(map) || (mapheaderinfo[gamemap-1]->menuflags & LF2_HIDEINMENU))
|
||||
{
|
||||
// send an empty icon to tell the client there is no map icon
|
||||
netbuffer->packettype = PT_MAPICON;
|
||||
UINT8 *icondata = netbuffer->u.mapicondata;
|
||||
WRITEUINT8(icondata, 0x80);
|
||||
HSendPacket(node, false, 0, 1);
|
||||
return;
|
||||
}
|
||||
|
||||
patch_t *current_map = W_CachePatchName(map, PU_CACHE);
|
||||
if (current_map->width != MAP_ICON_WIDTH || current_map->height != MAP_ICON_HEIGHT)
|
||||
{
|
||||
// we only support 160x100 for now
|
||||
netbuffer->packettype = PT_MAPICON;
|
||||
UINT8 *icondata = netbuffer->u.mapicondata;
|
||||
WRITEUINT8(icondata, 0x80);
|
||||
HSendPacket(node, false, 0, 1);
|
||||
return;
|
||||
}
|
||||
|
||||
UINT8 *data = Z_Malloc(2 * current_map->width * current_map->height, PU_STATIC, NULL);
|
||||
UINT8 *pixeldata = data + current_map->width * current_map->height;
|
||||
|
||||
R_PatchToPixels(current_map, pixeldata);
|
||||
|
||||
z_stream stream;
|
||||
stream.zalloc = NULL;
|
||||
stream.zfree = NULL;
|
||||
stream.opaque = NULL;
|
||||
if (deflateInit(&stream, Z_DEFAULT_COMPRESSION) != Z_OK)
|
||||
{
|
||||
CONS_Alert(CONS_WARNING, "Cannot compress map icon, not enough memory\n");
|
||||
Z_Free(data);
|
||||
return;
|
||||
}
|
||||
|
||||
stream.next_in = pixeldata;
|
||||
stream.avail_in = current_map->width * current_map->height;
|
||||
stream.next_out = data;
|
||||
stream.avail_out = current_map->width * current_map->height;
|
||||
if (deflate(&stream, Z_FINISH) != Z_STREAM_END)
|
||||
{
|
||||
CONS_Alert(CONS_WARNING, "Cannot compress map icon, error occured during compression\n");
|
||||
deflateEnd(&stream);
|
||||
Z_Free(data);
|
||||
return;
|
||||
}
|
||||
size_t count = stream.total_out;
|
||||
deflateEnd(&stream);
|
||||
|
||||
size_t index = 0;
|
||||
|
||||
for (size_t i = 0; i < count; i += MAXPACKETLENGTH-BASEPACKETSIZE-1)
|
||||
{
|
||||
size_t size = min(MAXPACKETLENGTH-BASEPACKETSIZE-1, count-i);
|
||||
|
||||
UINT8 *icondata = netbuffer->u.mapicondata;
|
||||
netbuffer->packettype = PT_MAPICON;
|
||||
|
||||
if (count-i <= MAXPACKETLENGTH-BASEPACKETSIZE-1)
|
||||
WRITEUINT8(icondata, 0x80 | index);
|
||||
else
|
||||
WRITEUINT8(icondata, index);
|
||||
index++;
|
||||
|
||||
WRITEMEM(icondata, &data[i], size);
|
||||
HSendPacket(node, false, 0, size + 1);
|
||||
}
|
||||
Z_Free(data);
|
||||
}
|
||||
|
||||
/** Sends a PT_SERVERCFG packet
|
||||
*
|
||||
* \param node The destination
|
||||
@@ -2704,9 +2776,26 @@ static boolean CL_ServerConnectionTicker(const char *tmpsave, tic_t *oldtic, tic
|
||||
if (cl_mode == CL_VIEWSERVER)
|
||||
{
|
||||
if (key == KEY_ENTER || key == KEY_JOY1)
|
||||
{
|
||||
cl_mode = CL_CHECKFILES;
|
||||
if (map_icon != NULL)
|
||||
Patch_Free(map_icon);
|
||||
map_icon = NULL;
|
||||
if (map_icon_data != NULL)
|
||||
Z_Free(map_icon_data);
|
||||
map_icon_data = NULL;
|
||||
}
|
||||
else if (key == KEY_ESCAPE || key == KEY_JOY1+1)
|
||||
{
|
||||
cl_mode = CL_ABORTED;
|
||||
if (map_icon != NULL)
|
||||
Patch_Free(map_icon);
|
||||
map_icon = NULL;
|
||||
if (map_icon_data != NULL)
|
||||
Z_Free(map_icon_data);
|
||||
map_icon_data = NULL;
|
||||
map_icon_request_count = 0;
|
||||
}
|
||||
}
|
||||
|
||||
// Only ESC and non-keyboard keys abort connection
|
||||
@@ -2822,6 +2911,17 @@ static void CL_ConnectToServer(void)
|
||||
serverlist[i].info.version, serverlist[i].info.subversion);
|
||||
}
|
||||
SL_ClearServerList(servernode);
|
||||
|
||||
if (map_icon_data != NULL)
|
||||
Z_Free(map_icon_data);
|
||||
if (map_icon != NULL)
|
||||
Patch_Free(map_icon);
|
||||
map_icon_data = Z_Malloc(MAP_ICON_WIDTH * MAP_ICON_HEIGHT, PU_CACHE, NULL);
|
||||
map_icon_index = 0;
|
||||
map_icon_needed = 0xff;
|
||||
map_icon_read = 0;
|
||||
map_icon_missing = 0xffffffff;
|
||||
map_icon_last_request = I_GetTime();
|
||||
#endif
|
||||
|
||||
do
|
||||
@@ -3351,10 +3451,6 @@ void CL_RemovePlayer(INT32 playernum, INT32 reason)
|
||||
|
||||
void CL_Reset(void)
|
||||
{
|
||||
if (metalrecording)
|
||||
G_StopMetalRecording();
|
||||
if (metalplayback)
|
||||
G_StopMetalDemo();
|
||||
if (demo.recording)
|
||||
G_CheckDemoStatus();
|
||||
|
||||
@@ -4111,8 +4207,8 @@ consvar_t cv_resynchcooldown = {"gamestatecooldown", "5", CV_SAVE, resynchcooldo
|
||||
consvar_t cv_blamecfail = {"blamecfail", "Off", CV_SAVE, CV_OnOff, NULL, 0, NULL, NULL, 0, 0, NULL };
|
||||
|
||||
// max file size to send to a player (in kilobytes)
|
||||
static CV_PossibleValue_t maxsend_cons_t[] = {{0, "MIN"}, {51200, "MAX"}, {0, NULL}};
|
||||
consvar_t cv_maxsend = {"maxsend", "MAX", CV_SAVE, maxsend_cons_t, NULL, 0, NULL, NULL, 0, 0, NULL};
|
||||
static CV_PossibleValue_t maxsend_cons_t[] = {{-1, "MIN"}, {999999999, "MAX"}, {0, NULL}};
|
||||
consvar_t cv_maxsend = {"maxsend", "204800", CV_SAVE, maxsend_cons_t, NULL, 0, NULL, NULL, 0, 0, NULL};
|
||||
consvar_t cv_noticedownload = {"noticedownload", "Off", CV_SAVE, CV_OnOff, NULL, 0, NULL, NULL, 0, 0, NULL};
|
||||
|
||||
// Speed of file downloading (in packets per tic)
|
||||
@@ -4428,6 +4524,7 @@ static void Got_AddPlayer(UINT8 **p, INT32 playernum)
|
||||
displayplayers[i] = newplayernum;
|
||||
DEBFILE("spawning me\n");
|
||||
}
|
||||
|
||||
D_SendPlayerConfig();
|
||||
addedtogame = true;
|
||||
}
|
||||
@@ -4599,8 +4696,6 @@ boolean SV_SpawnServer(void)
|
||||
{
|
||||
if (demo.playback)
|
||||
G_StopDemo(); // reset engine parameter
|
||||
if (metalplayback)
|
||||
G_StopMetalDemo();
|
||||
|
||||
if (!serverrunning)
|
||||
{
|
||||
@@ -4706,6 +4801,10 @@ static void HandleConnect(SINT8 node)
|
||||
if (playernode[i] != UINT8_MAX) // We use this to count players because it is affected by SV_AddWaitingPlayers when more than one client joins on the same tic, unlike playeringame and D_NumPlayers. UINT8_MAX denotes no node for that player
|
||||
connectedplayers++;
|
||||
|
||||
#ifdef SATURNJOIN
|
||||
const boolean issaturn = (((doomcom->datalength) == sizeof(clientconfig_pak)) && netbuffer->u.clientcfg.issaturn == ISSATURN); // Check the packet lenght to skip potential garbo data!
|
||||
#endif
|
||||
|
||||
if (bannednode && bannednode[node].banid != SIZE_MAX)
|
||||
{
|
||||
const char *reason = NULL;
|
||||
@@ -4759,7 +4858,7 @@ static void HandleConnect(SINT8 node)
|
||||
SV_SendRefuse(node, va(M_GetText("Different SRB2Kart versions cannot\nplay a netgame!\n(server version %d.%d)"), VERSION, SUBVERSION));
|
||||
}
|
||||
#ifdef SATURNJOIN
|
||||
else if ((!cv_allownewplayer.value && node && netbuffer->u.clientcfg.issaturn != ISSATURN) || (!cv_allownewsaturnplayer.value && node && netbuffer->u.clientcfg.issaturn == ISSATURN))
|
||||
else if (((!cv_allownewplayer.value && !issaturn) || (!cv_allownewsaturnplayer.value && issaturn)) && node)
|
||||
#else
|
||||
else if (!cv_allownewplayer.value && node)
|
||||
#endif
|
||||
@@ -4787,16 +4886,15 @@ static void HandleConnect(SINT8 node)
|
||||
#ifndef NONET
|
||||
boolean newnode = false;
|
||||
#endif
|
||||
|
||||
// client authorised to join
|
||||
nodewaiting[node] = (UINT8)(netbuffer->u.clientcfg.localplayers - playerpernode[node]);
|
||||
|
||||
if (!nodeingame[node])
|
||||
{
|
||||
gamestate_t backupstate = gamestate;
|
||||
#ifndef NONET
|
||||
newnode = true;
|
||||
#endif
|
||||
|
||||
SV_AddNode(node);
|
||||
|
||||
/// \note Wait what???
|
||||
@@ -4818,12 +4916,14 @@ static void HandleConnect(SINT8 node)
|
||||
/// \todo fix this !!!
|
||||
return; // restart the while
|
||||
}
|
||||
|
||||
SV_SendServerInfo(node, 0); // Dunno if 0 time is good idea
|
||||
//if (gamestate != GS_LEVEL) // GS_INTERMISSION, etc?
|
||||
// SV_SendPlayerConfigs(node); // send bare minimum player info
|
||||
G_SetGamestate(backupstate);
|
||||
DEBFILE("new node joined\n");
|
||||
}
|
||||
|
||||
#ifdef JOININGAME
|
||||
if (nodewaiting[node])
|
||||
{
|
||||
@@ -4832,6 +4932,7 @@ static void HandleConnect(SINT8 node)
|
||||
SV_SendSaveGame(node, false); // send a complete game state
|
||||
DEBFILE("send savegame\n");
|
||||
}
|
||||
|
||||
SV_AddWaitingPlayers();
|
||||
}
|
||||
#else
|
||||
@@ -4871,17 +4972,6 @@ static void HandleTimeout(SINT8 node)
|
||||
M_StartMessage(M_GetText("Server Timeout\n\nPress Esc\n"), NULL, MM_NOTHING);
|
||||
}
|
||||
|
||||
// Helper function for packets that should only be sent by the server
|
||||
// If it is NOT from the server, bail out and close the connection!
|
||||
static boolean ServerOnly(SINT8 node)
|
||||
{
|
||||
if (node == servernode)
|
||||
return false;
|
||||
|
||||
Net_CloseConnection(node);
|
||||
return true;
|
||||
}
|
||||
|
||||
#ifndef NONET
|
||||
/** Called when a PT_SERVERINFO packet is received
|
||||
*
|
||||
@@ -4921,6 +5011,115 @@ static void HandlePlayerInfo(void)
|
||||
playerinfo[i] = netbuffer->u.playerinfo[i];
|
||||
}
|
||||
|
||||
// Helper function for packets that should only be sent by the server
|
||||
// If it is NOT from the server, bail out and close the connection!
|
||||
static boolean ServerOnly(SINT8 node)
|
||||
{
|
||||
if (node == servernode)
|
||||
return false;
|
||||
|
||||
Net_CloseConnection(node);
|
||||
return true;
|
||||
}
|
||||
|
||||
static void PT_MapIcon(void)
|
||||
{
|
||||
if (map_icon_data == NULL)
|
||||
return;
|
||||
|
||||
if (ServerOnly(doomcom->remotenode))
|
||||
return;
|
||||
|
||||
doomdata_t *netbuffer = DOOMCOM_DATA(doomcom);
|
||||
|
||||
UINT8 *icondata = netbuffer->u.mapicondata;
|
||||
|
||||
map_icon_last_request = I_GetTime();
|
||||
map_icon_request_count = 0;
|
||||
|
||||
UINT8 index = READUINT8(icondata);
|
||||
if (index & 0x80)
|
||||
map_icon_needed = (index & 0x7f) + 1;
|
||||
index &= 0x7f;
|
||||
|
||||
// check if we already got this fragment
|
||||
if (map_icon_missing & ((UINT32)1 << index))
|
||||
{
|
||||
map_icon_missing &= ~((UINT32)1 << index);
|
||||
INT32 offset = index * (MAXPACKETLENGTH-BASEPACKETSIZE-1);
|
||||
if (offset + doomcom->datalength-1 > MAP_ICON_WIDTH * MAP_ICON_HEIGHT)
|
||||
{
|
||||
CONS_Alert(CONS_WARNING, "Excess amount of data for map icon (expected %d, got %d)\n", MAP_ICON_WIDTH * MAP_ICON_HEIGHT, offset + doomcom->datalength-1);
|
||||
Z_Free(map_icon_data);
|
||||
map_icon_data = NULL;
|
||||
return;
|
||||
}
|
||||
|
||||
READMEM(icondata, &map_icon_data[offset], doomcom->datalength-1);
|
||||
map_icon_read += doomcom->datalength-1;
|
||||
map_icon_index++;
|
||||
}
|
||||
|
||||
if (map_icon_index >= map_icon_needed)
|
||||
{
|
||||
if (map_icon_read == 0)
|
||||
{
|
||||
// map has no icon
|
||||
Z_Free(map_icon_data);
|
||||
map_icon_data = NULL;
|
||||
return;
|
||||
}
|
||||
|
||||
UINT8 *data = Z_Malloc(MAP_ICON_WIDTH * MAP_ICON_HEIGHT, PU_STATIC, NULL);
|
||||
z_stream stream;
|
||||
stream.zalloc = NULL;
|
||||
stream.zfree = NULL;
|
||||
stream.opaque = NULL;
|
||||
stream.next_in = map_icon_data;
|
||||
stream.avail_in = map_icon_read;
|
||||
if (inflateInit(&stream) != Z_OK)
|
||||
{
|
||||
CONS_Alert(CONS_WARNING, "Cannot decompress map icon, not enough memory\n");
|
||||
Z_Free(data);
|
||||
Z_Free(map_icon_data);
|
||||
map_icon_data = NULL;
|
||||
return;
|
||||
}
|
||||
stream.next_out = data;
|
||||
stream.avail_out = MAP_ICON_WIDTH * MAP_ICON_HEIGHT;
|
||||
if (inflate(&stream, Z_FINISH) != Z_STREAM_END)
|
||||
{
|
||||
CONS_Alert(CONS_WARNING, "Failed to decompress map icon, map icon is invalid or corrupted\n");
|
||||
deflateEnd(&stream);
|
||||
Z_Free(data);
|
||||
Z_Free(map_icon_data);
|
||||
map_icon_data = NULL;
|
||||
return;
|
||||
}
|
||||
inflateEnd(&stream);
|
||||
Z_Free(map_icon_data);
|
||||
map_icon_data = NULL;
|
||||
|
||||
if (stream.total_out > MAP_ICON_WIDTH * MAP_ICON_HEIGHT)
|
||||
{
|
||||
CONS_Alert(CONS_WARNING, "Excess amount of data for map icon (expected %d, got %ld)\n", MAP_ICON_WIDTH * MAP_ICON_HEIGHT, stream.total_out);
|
||||
Z_Free(data);
|
||||
return;
|
||||
}
|
||||
else if (stream.total_out < MAP_ICON_WIDTH * MAP_ICON_HEIGHT)
|
||||
{
|
||||
CONS_Alert(CONS_WARNING, "Insufficient amount of data for map icon (expected %d, got %ld)\n", MAP_ICON_WIDTH * MAP_ICON_HEIGHT, stream.total_out);
|
||||
Z_Free(data);
|
||||
return;
|
||||
}
|
||||
|
||||
//map_icon = Patch_CreateFromData(MAP_ICON_WIDTH, MAP_ICON_HEIGHT, data);
|
||||
map_icon = (patch_t *)R_PixelsToPatch(data, MAP_ICON_WIDTH, MAP_ICON_HEIGHT, 0, 0, NULL);
|
||||
|
||||
Z_Free(data);
|
||||
}
|
||||
}
|
||||
|
||||
static void PT_TellFilesNeeded(SINT8 node)
|
||||
{
|
||||
if (server && serverrunning)
|
||||
@@ -4969,11 +5168,18 @@ static void PT_AskInfo(SINT8 node)
|
||||
doomdata_t *netbuffer = DOOMCOM_DATA(doomcom);
|
||||
SV_SendServerInfo(node, (tic_t)LONG(netbuffer->u.askinfo.time));
|
||||
SV_SendPlayerInfo(node); // Send extra info
|
||||
//SV_SendMapIcon(node); // idk i dont think we need this here
|
||||
}
|
||||
|
||||
Net_CloseConnection(node);
|
||||
}
|
||||
|
||||
static void PT_NeedMapIcon(SINT8 node)
|
||||
{
|
||||
SV_SendMapIcon(node);
|
||||
Net_CloseConnection(node);
|
||||
}
|
||||
|
||||
// Negative response of client join request
|
||||
static void PT_ServerRefuse(SINT8 node)
|
||||
{
|
||||
@@ -5234,6 +5440,12 @@ static void HandlePacketFromAwayNode(SINT8 node)
|
||||
case PT_PLAYERINFO:
|
||||
HandlePlayerInfo();
|
||||
break;
|
||||
case PT_MAPICON:
|
||||
PT_MapIcon();
|
||||
break;
|
||||
case PT_NEEDMAPICON:
|
||||
PT_NeedMapIcon(node);
|
||||
break;
|
||||
case PT_SERVERTICS:
|
||||
// Do not remove my own server (we have just get a out of order packet)
|
||||
if (node == servernode)
|
||||
@@ -5522,10 +5734,10 @@ static void PT_TextCmd(INT32 netconsole, SINT8 node)
|
||||
|
||||
// ignore if the textcmd size var is actually larger than it should be
|
||||
// BASEPACKETSIZE + 1 (for size) + textcmd[0] should == datalength
|
||||
if (netbuffer->u.textcmd[0] > (size_t)doomcom->datalength-BASEPACKETSIZE-1)
|
||||
if (netbuffer->u.textcmd[0] > (size_t)doomcom->datalength-1)
|
||||
{
|
||||
DEBFILE(va("GetPacket: Bad Textcmd packet size! (expected %d, actual %s, node %u, player %d)\n",
|
||||
netbuffer->u.textcmd[0], sizeu1((size_t)doomcom->datalength-BASEPACKETSIZE-1),
|
||||
netbuffer->u.textcmd[0], sizeu1((size_t)doomcom->datalength-1),
|
||||
node, netconsole));
|
||||
Net_UnAcknowledgePacket(node);
|
||||
return;
|
||||
@@ -5566,7 +5778,6 @@ static void PT_TextCmd(INT32 netconsole, SINT8 node)
|
||||
|
||||
static void PT_ClientQuit(INT32 netconsole, SINT8 node)
|
||||
{
|
||||
|
||||
if (client)
|
||||
return;
|
||||
|
||||
@@ -5620,29 +5831,28 @@ static void PT_Resynched(SINT8 node)
|
||||
static void PT_ServerTics(SINT8 node)
|
||||
{
|
||||
tic_t realend, realstart;
|
||||
UINT8 *pak, *txtpak = NULL, numtxtpak;
|
||||
|
||||
// Only accept PT_SERVERTICS from the server.
|
||||
if (!FromServer(node, "PT_SERVERTICS"))
|
||||
return;
|
||||
|
||||
doomdata_t *netbuffer = DOOMCOM_DATA(doomcom);
|
||||
servertics_pak *packet = &netbuffer->u.serverpak;
|
||||
|
||||
realstart = ExpandTics(netbuffer->u.serverpak.starttic, maketic);
|
||||
realend = realstart + netbuffer->u.serverpak.numtics;
|
||||
|
||||
if (!txtpak)
|
||||
txtpak = (UINT8 *)&netbuffer->u.serverpak.cmds[netbuffer->u.serverpak.numslots
|
||||
* netbuffer->u.serverpak.numtics];
|
||||
realstart = ExpandTics(packet->starttic, maketic);
|
||||
realend = realstart + packet->numtics;
|
||||
|
||||
if (realend > gametic + CLIENTBACKUPTICS)
|
||||
realend = gametic + CLIENTBACKUPTICS;
|
||||
cl_packetmissed = realstart > neededtic;
|
||||
|
||||
UINT8 *pak = (UINT8 *)&packet->cmds;
|
||||
UINT8 *txtpak = (UINT8 *)&packet->cmds[packet->numslots * packet->numtics];
|
||||
|
||||
if (realstart <= neededtic && realend > neededtic)
|
||||
{
|
||||
tic_t i, j;
|
||||
pak = (UINT8 *)&netbuffer->u.serverpak.cmds;
|
||||
pak = (UINT8 *)&packet->cmds;
|
||||
|
||||
for (i = realstart; i < realend; i++)
|
||||
{
|
||||
@@ -5651,10 +5861,10 @@ static void PT_ServerTics(SINT8 node)
|
||||
|
||||
// copy the tics
|
||||
pak = G_ScpyTiccmd(netcmds[i%BACKUPTICS], pak,
|
||||
netbuffer->u.serverpak.numslots*sizeof (ticcmd_t));
|
||||
packet->numslots*sizeof (ticcmd_t));
|
||||
|
||||
// copy the textcmds
|
||||
numtxtpak = *txtpak++;
|
||||
UINT8 numtxtpak = *txtpak++;
|
||||
|
||||
for (j = 0; j < numtxtpak; j++)
|
||||
{
|
||||
@@ -5678,11 +5888,6 @@ static void PT_ServerTics(SINT8 node)
|
||||
else
|
||||
{
|
||||
DEBFILE(va("frame not in bound: %u (bounds are from %u to %u)\n", neededtic, realstart, realend));
|
||||
/*if (realend < neededtic - 2 * TICRATE || neededtic + 2 * TICRATE < realstart)
|
||||
* I_Error("Received an out of order PT_SERVERTICS packet!\n"
|
||||
* "Got tics %d-%d, needed tic %d\n\n"
|
||||
* "Please report this crash on the Master Board,\n"
|
||||
* "IRC or Discord so it can be fixed.\n", (INT32)realstart, (INT32)realend, (INT32)neededtic);*/
|
||||
}
|
||||
}
|
||||
|
||||
@@ -6802,6 +7007,69 @@ void NetKeepAlive(void)
|
||||
// If a tree falls in the forest but nobody is around to hear it, does it make a tic?
|
||||
#define DEDICATEDIDLETIME (10*TICRATE)
|
||||
|
||||
#ifdef DEDICATEDIDLETIME
|
||||
static void DedicatedIdleUpdate(INT32 *realtics)
|
||||
{
|
||||
INT32 i;
|
||||
static tic_t dedicatedidle = 0;
|
||||
|
||||
if (!server || !dedicated || gamestate != GS_LEVEL)
|
||||
return;
|
||||
|
||||
boolean empty = true;
|
||||
for (i = 0; i < MAXPLAYERS; i++)
|
||||
if (playeringame[i])
|
||||
{
|
||||
empty = false;
|
||||
break;
|
||||
}
|
||||
|
||||
if (empty)
|
||||
{
|
||||
if (leveltime == 2)
|
||||
{
|
||||
// On next tick...
|
||||
dedicatedidle = DEDICATEDIDLETIME - 1;
|
||||
}
|
||||
else if (dedicatedidle >= DEDICATEDIDLETIME)
|
||||
{
|
||||
if (D_GetExistingTextcmd(gametic, 0) || D_GetExistingTextcmd(gametic + 1, 0))
|
||||
{
|
||||
CONS_Printf("DEDICATED: Awakening from idle (Netxcmd detected...)\n");
|
||||
dedicatedidle = 0;
|
||||
}
|
||||
else
|
||||
{
|
||||
(*realtics) = 0;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
dedicatedidle += (*realtics);
|
||||
|
||||
if (dedicatedidle >= DEDICATEDIDLETIME)
|
||||
{
|
||||
const char *idlereason = "at round start";
|
||||
if (leveltime > 3)
|
||||
idlereason = va("for %d seconds", dedicatedidle / TICRATE);
|
||||
|
||||
CONS_Printf("DEDICATED: No players %s, idling...\n", idlereason);
|
||||
(*realtics) = 0;
|
||||
dedicatedidle = DEDICATEDIDLETIME;
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if (dedicatedidle >= DEDICATEDIDLETIME)
|
||||
{
|
||||
CONS_Printf("DEDICATED: Awakening from idle (Player detected...)\n");
|
||||
}
|
||||
dedicatedidle = 0;
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
void NetUpdate(void)
|
||||
{
|
||||
static tic_t resptime = 0;
|
||||
@@ -6815,54 +7083,6 @@ void NetUpdate(void)
|
||||
if (realtics <= 0) // nothing new to update
|
||||
return;
|
||||
|
||||
#ifdef DEDICATEDIDLETIME
|
||||
if (server && dedicated && gamestate == GS_LEVEL)
|
||||
{
|
||||
static tic_t dedicatedidle = 0;
|
||||
|
||||
for (i = 1; i < MAXNETNODES; ++i)
|
||||
if (nodeingame[i])
|
||||
{
|
||||
if (dedicatedidle == DEDICATEDIDLETIME)
|
||||
{
|
||||
CONS_Printf("DEDICATED: Awakening from idle (Node %d detected...)\n", i);
|
||||
dedicatedidle = 0;
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
if (i == MAXNETNODES)
|
||||
{
|
||||
if (leveltime == 2)
|
||||
{
|
||||
// On next tick...
|
||||
dedicatedidle = DEDICATEDIDLETIME-1;
|
||||
}
|
||||
else if (dedicatedidle == DEDICATEDIDLETIME)
|
||||
{
|
||||
if (D_GetExistingTextcmd(gametic, 0) || D_GetExistingTextcmd(gametic+1, 0))
|
||||
{
|
||||
CONS_Printf("DEDICATED: Awakening from idle (Netxcmd detected...)\n");
|
||||
dedicatedidle = 0;
|
||||
}
|
||||
else
|
||||
{
|
||||
realtics = 0;
|
||||
}
|
||||
}
|
||||
else if (++dedicatedidle == DEDICATEDIDLETIME)
|
||||
{
|
||||
const char *idlereason = "at round start";
|
||||
if (leveltime > 3)
|
||||
idlereason = va("for %d seconds", dedicatedidle/TICRATE);
|
||||
|
||||
CONS_Printf("DEDICATED: No nodes %s, idling...\n", idlereason);
|
||||
realtics = 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
if (realtics > 5)
|
||||
{
|
||||
if (server)
|
||||
@@ -6871,6 +7091,10 @@ void NetUpdate(void)
|
||||
realtics = 5;
|
||||
}
|
||||
|
||||
#ifdef DEDICATEDIDLETIME
|
||||
DedicatedIdleUpdate(&realtics);
|
||||
#endif
|
||||
|
||||
gametime = nowtime;
|
||||
|
||||
UpdatePingTable();
|
||||
@@ -6982,6 +7206,7 @@ void NetUpdate(void)
|
||||
#endif
|
||||
CON_Ticker();
|
||||
}
|
||||
|
||||
SV_FileSendTicker();
|
||||
}
|
||||
|
||||
|
||||
+3
-1
@@ -120,6 +120,8 @@ typedef enum
|
||||
PT_ISSATURN, // Saturn specific identifier packet
|
||||
#endif
|
||||
|
||||
PT_MAPICON, // Send map image icon (gamespy).
|
||||
PT_NEEDMAPICON, // Request missed map icon (gamespy).
|
||||
NUMPACKETTYPE
|
||||
} packettype_t;
|
||||
|
||||
@@ -513,6 +515,7 @@ typedef struct
|
||||
INT32 filesneedednum; // 4 bytes
|
||||
filesneededconfig_pak filesneededcfg; // ??? bytes
|
||||
UINT32 pingtable[MAXPLAYERS+1]; // 68 bytes
|
||||
UINT8 mapicondata[0];
|
||||
} u; // This is needed to pack diff packet types data together
|
||||
} ATTRPACK doomdata_t;
|
||||
|
||||
@@ -564,7 +567,6 @@ typedef enum
|
||||
KR_TIMEOUT, //Connection Timeout
|
||||
KR_BAN, //Banned by server
|
||||
KR_LEAVE, //Quit the game
|
||||
|
||||
} kickreason_t;
|
||||
|
||||
/* the max number of name changes in some time period */
|
||||
|
||||
+269
-325
@@ -96,20 +96,17 @@
|
||||
// platform independant focus loss
|
||||
UINT8 window_notinfocus = false;
|
||||
|
||||
//
|
||||
// DEMO LOOP
|
||||
//
|
||||
//static INT32 demosequence;
|
||||
static char *startupwadfiles[MAX_WADFILES];
|
||||
static char *startupiwadfiles[MAX_WADFILES];
|
||||
static char *startuppwads[MAX_WADFILES];
|
||||
|
||||
// autoloading
|
||||
char *autoloadwadfiles[MAX_WADFILES];
|
||||
char *autoloadwadfilespost[MAX_WADFILES];
|
||||
static char *autoloadwadfiles[MAX_WADFILES];
|
||||
static char *autoloadwadfilespost[MAX_WADFILES];
|
||||
boolean autoloading;
|
||||
boolean autoloaded;
|
||||
boolean postautoloaded = false;
|
||||
boolean wasautoloaded = false;
|
||||
//
|
||||
|
||||
boolean devparm = false; // started game with -devparm
|
||||
|
||||
@@ -121,11 +118,8 @@ INT32 postimgparam[MAXSPLITSCREENPLAYERS];
|
||||
// These variables are only true if
|
||||
// whether the respective sound system is disabled
|
||||
// or they're init'ed, but the player just toggled them
|
||||
#ifndef NO_MIDI
|
||||
boolean midi_disabled = false;
|
||||
#endif
|
||||
boolean sound_disabled = false;
|
||||
boolean digital_disabled = false;
|
||||
boolean music_disabled = false;
|
||||
|
||||
#ifdef DEBUGFILE
|
||||
INT32 debugload = 0;
|
||||
@@ -153,8 +147,6 @@ boolean dedicated = false;
|
||||
|
||||
boolean loaded_config = false; // true once config.cfg loaded AND executed
|
||||
|
||||
static void D_CleanFile(char **filearray);
|
||||
|
||||
//
|
||||
// D_PostEvent
|
||||
// Called by the I/O functions when input is detected
|
||||
@@ -223,11 +215,12 @@ static void D_GamePadMenuScrollTicker(void)
|
||||
}
|
||||
#undef SCROLLDELAY
|
||||
|
||||
static UINT16 curcolor[MAXSPLITSCREENPLAYERS] = {0};
|
||||
|
||||
static void D_DeviceLEDTick(void)
|
||||
{
|
||||
UINT8 i;
|
||||
static UINT16 color[MAXSPLITSCREENPLAYERS] = {0};
|
||||
static UINT16 curcolor[MAXSPLITSCREENPLAYERS] = {0};
|
||||
|
||||
if (numcontrollers == 0)
|
||||
{
|
||||
@@ -249,6 +242,11 @@ static void D_DeviceLEDTick(void)
|
||||
}
|
||||
}
|
||||
|
||||
void D_ResetDeviceLED(void)
|
||||
{
|
||||
memset(curcolor, 0, sizeof(curcolor));
|
||||
}
|
||||
|
||||
//
|
||||
// D_ProcessEvents
|
||||
// Send all the events of the given timestamp down the responder chain
|
||||
@@ -329,7 +327,7 @@ static void D_Renderview(void)
|
||||
if (automapactive)
|
||||
return;
|
||||
|
||||
R_ApplyLevelInterpolators(rendertimefrac);
|
||||
R_ApplyLevelInterpolators(R_GetTimeFrac(RTF_LEVEL));
|
||||
|
||||
if (rendermode == render_soft)
|
||||
{
|
||||
@@ -451,7 +449,7 @@ static boolean D_Display(void)
|
||||
|
||||
if (rendermode == render_soft && !splitscreen)
|
||||
{
|
||||
R_InterpolateViewRollAngle(rendertimefrac_unpaused);
|
||||
R_InterpolateViewRollAngle(R_GetTimeFrac(RTF_CAMERA));
|
||||
R_CheckViewMorph();
|
||||
}
|
||||
|
||||
@@ -811,7 +809,7 @@ void D_SRB2Loop(void)
|
||||
debugload--;
|
||||
#endif
|
||||
|
||||
interp = (R_UsingFrameInterpolation() && !dedicated);
|
||||
interp = !dedicated && R_UsingFrameInterpolation();
|
||||
doDisplay = false;
|
||||
|
||||
renderisnewtic = (realtics > 0 || singletics);
|
||||
@@ -870,33 +868,16 @@ void D_SRB2Loop(void)
|
||||
// I looked at the possibility of putting in a float drawer for
|
||||
// perfstats and it's very complicated, so we'll just do this instead...
|
||||
ps_interp_frac.value.p = (precise_t)((FIXED_TO_FLOAT(g_time.timefrac)) * 1000.0f);
|
||||
ps_interp_lag.value.p = (precise_t)((deltasecs) * 1000.0f);
|
||||
ps_interp_lag.value.p = (precise_t)((deltasecs) * 1000.0);
|
||||
|
||||
const boolean lagging = ((deltatics >= 1.0) || hu_stopped);
|
||||
|
||||
if (!(paused || P_AutoPause()) && !lagging)
|
||||
{
|
||||
rendertimefrac = g_time.timefrac;
|
||||
}
|
||||
else
|
||||
{
|
||||
rendertimefrac = FRACUNIT;
|
||||
}
|
||||
|
||||
if (!lagging)
|
||||
{
|
||||
rendertimefrac_unpaused = g_time.timefrac;
|
||||
}
|
||||
else
|
||||
{
|
||||
rendertimefrac_unpaused = FRACUNIT;
|
||||
}
|
||||
R_SetTimeFrac(lagging ? FRACUNIT : g_time.timefrac);
|
||||
}
|
||||
else
|
||||
{
|
||||
renderdeltatics = realtics * FRACUNIT;
|
||||
rendertimefrac = FRACUNIT;
|
||||
rendertimefrac_unpaused = FRACUNIT;
|
||||
R_SetTimeFrac(FRACUNIT);
|
||||
}
|
||||
|
||||
if (interp || doDisplay)
|
||||
@@ -936,7 +917,6 @@ void D_SRB2Loop(void)
|
||||
Discord_RunCallbacks();
|
||||
}
|
||||
#endif
|
||||
|
||||
// Fully completed frame made.
|
||||
finishprecise = I_GetPreciseTime();
|
||||
|
||||
@@ -974,6 +954,7 @@ void D_SRB2Loop(void)
|
||||
I_SleepDuration(capbudget - elapsed);
|
||||
}
|
||||
}
|
||||
|
||||
// Capture the time once more to get the real delta time.
|
||||
finishprecise = I_GetPreciseTime();
|
||||
deltasecs = (double)((INT64)(finishprecise - enterprecise)) / I_GetPrecisePrecision();
|
||||
@@ -986,39 +967,17 @@ void D_SRB2Loop(void)
|
||||
// =========================================================================
|
||||
|
||||
//
|
||||
// D_StartTitle
|
||||
// D_ClearState
|
||||
//
|
||||
void D_StartTitle(void)
|
||||
void D_ClearState(void)
|
||||
{
|
||||
INT32 i;
|
||||
|
||||
if (netgame)
|
||||
{
|
||||
if (gametype == GT_RACE) // SRB2kart
|
||||
{
|
||||
G_SetGamestate(GS_WAITINGPLAYERS); // hack to prevent a command repeat
|
||||
|
||||
if (server)
|
||||
{
|
||||
char mapname[6];
|
||||
|
||||
strlcpy(mapname, G_BuildMapName(spstage_start), sizeof (mapname));
|
||||
strlwr(mapname);
|
||||
mapname[5] = '\0';
|
||||
|
||||
COM_BufAddText(va("map %s\n", mapname));
|
||||
}
|
||||
}
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
M_ClearMenus(true);
|
||||
|
||||
// okay, stop now
|
||||
// (otherwise the game still thinks we're playing!)
|
||||
SV_StopServer();
|
||||
SV_ResetServer();
|
||||
serverlistultimatecount = 0;
|
||||
|
||||
for (i = 0; i < MAXPLAYERS; i++)
|
||||
CL_ClearPlayer(i);
|
||||
@@ -1034,8 +993,11 @@ void D_StartTitle(void)
|
||||
// reset modeattacking
|
||||
modeattacking = ATTACKING_NONE;
|
||||
|
||||
// empty maptol so mario/etc sounds don't play in sound test when they shouldn't
|
||||
// empty some other semi-important state
|
||||
maptol = 0;
|
||||
nextmapoverride = 0;
|
||||
skipstats = 0;
|
||||
gamemap = 1;
|
||||
|
||||
gameaction = ga_nothing;
|
||||
memset(displayplayers, 0, sizeof(displayplayers));
|
||||
@@ -1044,9 +1006,38 @@ void D_StartTitle(void)
|
||||
gametype = GT_RACE; // SRB2kart
|
||||
paused = false;
|
||||
|
||||
// clear cmd building stuff
|
||||
memset(gamekeydown, 0, sizeof(gamekeydown));
|
||||
memset(joyxmove, 0, sizeof(joyxmove));
|
||||
memset(joyymove, 0, sizeof(joyymove));
|
||||
mousex = mousey = 0;
|
||||
|
||||
// Reset the palette
|
||||
if (rendermode != render_none)
|
||||
V_SetPaletteLump("PLAYPAL");
|
||||
|
||||
G_ResetAllDeviceRumbles();
|
||||
|
||||
S_StopSounds();
|
||||
S_ResetKeepAndSpecialMus(); // just in case
|
||||
|
||||
P_FreeLevelState();
|
||||
|
||||
G_SetGamestate(GS_NULL);
|
||||
wipegamestate = GS_NULL;
|
||||
}
|
||||
|
||||
//
|
||||
// D_StartTitle
|
||||
//
|
||||
void D_StartTitle(void)
|
||||
{
|
||||
demo.title = false;
|
||||
D_ClearState();
|
||||
netgame = false; // title menu shouldnt be a netgame lmao
|
||||
M_ClearMenus(true);
|
||||
F_StartTitleScreen();
|
||||
D_ResetDeviceLED();
|
||||
}
|
||||
|
||||
//
|
||||
@@ -1070,31 +1061,39 @@ static void D_AddFile(const char *file, char **filearray)
|
||||
filearray[pnumwadfiles] = newfile;
|
||||
}
|
||||
|
||||
static void D_CleanFile(char **filearray)
|
||||
{
|
||||
size_t pnumwadfiles;
|
||||
for (pnumwadfiles = 0; filearray[pnumwadfiles]; pnumwadfiles++)
|
||||
{
|
||||
free(filearray[pnumwadfiles]);
|
||||
filearray[pnumwadfiles] = NULL;
|
||||
}
|
||||
}
|
||||
|
||||
// Taken from TSoURDt3rd
|
||||
// https://github.com/StarManiaKG/The-Story-of-Uncapped-Revengence-Discord-the-3rd/blob/main/src/STAR/star_functions.c
|
||||
static INT32 D_DetectFileType(const char* filename)
|
||||
{
|
||||
if (pathisdirectory(filename) == 1)
|
||||
return 1;
|
||||
else
|
||||
{
|
||||
if (!stricmp(&filename[strlen(filename) - 4], ".wad"))
|
||||
return 2;
|
||||
else if (!stricmp(&filename[strlen(filename) - 4], ".pk3"))
|
||||
return 3;
|
||||
else if (!stricmp(&filename[strlen(filename) - 5], ".kart"))
|
||||
return 4;
|
||||
|
||||
else if (!stricmp(&filename[strlen(filename) - 4], ".lua"))
|
||||
return 5;
|
||||
else if (!stricmp(&filename[strlen(filename) - 4], ".soc"))
|
||||
return 6;
|
||||
const size_t len = strlen(filename);
|
||||
|
||||
else if (!stricmp(&filename[strlen(filename) - 4], ".cfg"))
|
||||
return 7;
|
||||
else if (!stricmp(&filename[strlen(filename) - 4], ".txt"))
|
||||
return 8;
|
||||
}
|
||||
if (!stricmp(&filename[len - 4], ".wad"))
|
||||
return 2;
|
||||
else if (!stricmp(&filename[len - 4], ".pk3"))
|
||||
return 3;
|
||||
else if (!stricmp(&filename[len - 5], ".kart"))
|
||||
return 4;
|
||||
else if (!stricmp(&filename[len - 4], ".lua"))
|
||||
return 5;
|
||||
else if (!stricmp(&filename[len - 4], ".soc"))
|
||||
return 6;
|
||||
else if (!stricmp(&filename[len - 4], ".cfg"))
|
||||
return 7;
|
||||
else if (!stricmp(&filename[len - 4], ".txt"))
|
||||
return 8;
|
||||
|
||||
return 0;
|
||||
}
|
||||
@@ -1233,16 +1232,6 @@ void D_AddPostloadFiles(void)
|
||||
postautoloaded = true;
|
||||
}
|
||||
|
||||
static void D_CleanFile(char **filearray)
|
||||
{
|
||||
size_t pnumwadfiles;
|
||||
for (pnumwadfiles = 0; filearray[pnumwadfiles]; pnumwadfiles++)
|
||||
{
|
||||
free(filearray[pnumwadfiles]);
|
||||
filearray[pnumwadfiles] = NULL;
|
||||
}
|
||||
}
|
||||
|
||||
// ==========================================================================
|
||||
// Identify the SRB2 version, and IWAD file to use.
|
||||
// ==========================================================================
|
||||
@@ -1253,18 +1242,176 @@ static boolean AddIWAD(void)
|
||||
|
||||
if (FIL_ReadFileOK(path))
|
||||
{
|
||||
D_AddFile(path, startupwadfiles);
|
||||
D_AddFile(path, startupiwadfiles);
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
// extra graphic patches for saturn specific thingies
|
||||
// Optional saturn extra files
|
||||
boolean found_extra_kart = false;
|
||||
boolean found_extra2_kart = false;
|
||||
boolean found_extra3_kart = false;
|
||||
|
||||
static void IdentifyVersion(void)
|
||||
{
|
||||
const char *srb2waddir = NULL;
|
||||
|
||||
#if defined (__unix__) || defined (UNIXCOMMON) || defined (HAVE_SDL)
|
||||
// change to the directory where 'srb2.srb' is found
|
||||
srb2waddir = I_LocateWad();
|
||||
#endif
|
||||
|
||||
char tempsrb2path[256] = ".";
|
||||
getcwd(tempsrb2path, 256);
|
||||
|
||||
// get the current directory (possible problem on NT with "." as current dir)
|
||||
if (!srb2waddir)
|
||||
{
|
||||
if (tempsrb2path[0])
|
||||
srb2waddir = tempsrb2path;
|
||||
else
|
||||
{
|
||||
srb2waddir = ".";
|
||||
}
|
||||
}
|
||||
|
||||
#if (1) // reduce the amount of findfile by only using full cwd in this func
|
||||
if (strcmp(tempsrb2path, srb2waddir))
|
||||
#endif
|
||||
{
|
||||
strlcpy(srb2path, srb2waddir, sizeof (srb2path));
|
||||
}
|
||||
|
||||
// Load the IWAD
|
||||
if (!AddIWAD())
|
||||
{
|
||||
I_Error("SRB2.SRB not found! Expected in %s\n", srb2waddir);
|
||||
}
|
||||
|
||||
// will be overwritten in case of -cdrom or unix/win home
|
||||
snprintf(configfile, sizeof configfile, "%s" PATHSEP CONFIGFILENAME, srb2waddir);
|
||||
configfile[sizeof configfile - 1] = '\0';
|
||||
|
||||
// if you change the ordering of this or add/remove a file, be sure to update the md5
|
||||
// checking in D_SRB2Main
|
||||
|
||||
#ifdef USE_PATCH_DTA
|
||||
// Add our crappy patches to fix our bugs
|
||||
D_AddFile(va(pandf,srb2waddir,"patch.dta"));
|
||||
#endif
|
||||
|
||||
D_AddFile(va(pandf, srb2waddir, "gfx.kart"), startupiwadfiles);
|
||||
D_AddFile(va(pandf, srb2waddir, "textures.kart"), startupiwadfiles);
|
||||
D_AddFile(va(pandf, srb2waddir, "chars.kart"), startupiwadfiles);
|
||||
D_AddFile(va(pandf, srb2waddir, "maps.kart"), startupiwadfiles);
|
||||
#ifdef USE_PATCH_KART
|
||||
D_AddFile(va(pandf,srb2waddir,"patch.kart"), startupiwadfiles);
|
||||
#endif
|
||||
|
||||
const char *path = NULL;
|
||||
|
||||
path = va(pandf, srb2waddir, "extra.kart");
|
||||
|
||||
// completely optional
|
||||
if (FIL_ReadFileOK(path))
|
||||
{
|
||||
D_AddFile(path, startupiwadfiles);
|
||||
found_extra_kart = true;
|
||||
}
|
||||
|
||||
path = va(pandf, srb2waddir, "extra2.kart");
|
||||
|
||||
// completely optional 2: Back with a vengence
|
||||
if (FIL_ReadFileOK(path))
|
||||
{
|
||||
D_AddFile(path, startupiwadfiles);
|
||||
found_extra2_kart = true;
|
||||
}
|
||||
|
||||
path = va(pandf, srb2waddir, "extra3.kart");
|
||||
|
||||
if (FIL_ReadFileOK(path))
|
||||
{
|
||||
D_AddFile(path, startupiwadfiles);
|
||||
found_extra3_kart = true;
|
||||
}
|
||||
|
||||
#if !defined (HAVE_SDL) || defined (HAVE_MIXER)
|
||||
#define MUSICTEST(str) \
|
||||
musicpath = va(pandf,srb2waddir,str);\
|
||||
handle = W_OpenWadFile(&musicpath, false); \
|
||||
if (handle) \
|
||||
{\
|
||||
int ms = W_VerifyNMUSlumps(musicpath, handle, false); \
|
||||
fclose(handle); \
|
||||
if (ms == 0) \
|
||||
I_Error("File " str " has been modified with non-music/sound lumps"); \
|
||||
if (ms == 1) \
|
||||
D_AddFile(musicpath, startupiwadfiles); \
|
||||
}
|
||||
{
|
||||
const char *musicpath;
|
||||
FILE *handle;
|
||||
|
||||
MUSICTEST("sounds.kart")
|
||||
MUSICTEST("music.kart")
|
||||
}
|
||||
#undef MUSICTEST
|
||||
#endif
|
||||
}
|
||||
|
||||
//
|
||||
// search for maps
|
||||
//
|
||||
static void D_CheckMaps(boolean checkreplaced)
|
||||
{
|
||||
INT32 i;
|
||||
char *name;
|
||||
UINT16 wadnum;
|
||||
lumpinfo_t *lumpinfo;
|
||||
|
||||
for (wadnum = 0; wadnum < mainwads; wadnum++)
|
||||
{
|
||||
lumpinfo = wadfiles[wadnum]->lumpinfo;
|
||||
for (i = 0; i < wadfiles[wadnum]->numlumps; i++, lumpinfo++)
|
||||
{
|
||||
name = lumpinfo->name;
|
||||
P_CheckMapReplacements(name, checkreplaced);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//
|
||||
// Center the title string, then add the date and time of compilation.
|
||||
//
|
||||
static inline void D_MakeTitleString(char *s)
|
||||
{
|
||||
char temp[82];
|
||||
char *t;
|
||||
const char *u;
|
||||
INT32 i;
|
||||
const size_t len = (80-strlen(s))/2;
|
||||
|
||||
for (i = 0, t = temp; i < 82; i++)
|
||||
*t++=' ';
|
||||
|
||||
for (t = temp + len, u = s; *u != '\0' ;)
|
||||
*t++ = *u++;
|
||||
|
||||
u = compdate;
|
||||
for (t = temp + 1, i = 11; i-- ;)
|
||||
*t++ = *u++;
|
||||
u = comptime;
|
||||
for (t = temp + 71, i = 8; i-- ;)
|
||||
*t++ = *u++;
|
||||
|
||||
temp[80] = '\0';
|
||||
strcpy(s, temp);
|
||||
}
|
||||
|
||||
// extra graphic patches for saturn specific thingies
|
||||
boolean xtra_speedo = false; // extra speedometer check
|
||||
boolean xtra_speedo_clr = false; // extra speedometer colour check
|
||||
boolean xtra_speedo3 = false; // 80x 11 extra speedometer check
|
||||
@@ -1289,118 +1436,6 @@ boolean minidoticon = false; // Dot graphic for minimap player angle displ
|
||||
boolean minilighticon = false; // mkwii-style minimap headlight
|
||||
//
|
||||
|
||||
static void IdentifyVersion(void)
|
||||
{
|
||||
const char *srb2waddir = NULL;
|
||||
|
||||
#if defined (__unix__) || defined (UNIXCOMMON) || defined (HAVE_SDL)
|
||||
// change to the directory where 'srb2.srb' is found
|
||||
srb2waddir = I_LocateWad();
|
||||
#endif
|
||||
|
||||
// get the current directory (possible problem on NT with "." as current dir)
|
||||
if (srb2waddir)
|
||||
{
|
||||
strlcpy(srb2path, srb2waddir, sizeof(srb2path));
|
||||
}
|
||||
else
|
||||
{
|
||||
if (getcwd(srb2path, sizeof(srb2path)))
|
||||
srb2waddir = srb2path;
|
||||
else
|
||||
{
|
||||
srb2waddir = srb2path;
|
||||
}
|
||||
}
|
||||
|
||||
// Load the IWAD
|
||||
if (!AddIWAD())
|
||||
{
|
||||
I_Error("SRB2.SRB not found! Expected in %s\n", srb2waddir);
|
||||
}
|
||||
|
||||
// will be overwritten in case of -cdrom or unix/win home
|
||||
snprintf(configfile, sizeof configfile, "%s" PATHSEP CONFIGFILENAME, srb2waddir);
|
||||
configfile[sizeof configfile - 1] = '\0';
|
||||
|
||||
// if you change the ordering of this or add/remove a file, be sure to update the md5
|
||||
// checking in D_SRB2Main
|
||||
|
||||
#ifdef USE_PATCH_DTA
|
||||
// Add our crappy patches to fix our bugs
|
||||
D_AddFile(va(pandf,srb2waddir,"patch.dta"));
|
||||
#endif
|
||||
|
||||
D_AddFile(va(pandf,srb2waddir,"gfx.kart"), startupwadfiles);
|
||||
D_AddFile(va(pandf,srb2waddir,"textures.kart"), startupwadfiles);
|
||||
D_AddFile(va(pandf,srb2waddir,"chars.kart"), startupwadfiles);
|
||||
D_AddFile(va(pandf,srb2waddir,"maps.kart"), startupwadfiles);
|
||||
#ifdef USE_PATCH_KART
|
||||
D_AddFile(va(pandf,srb2waddir,"patch.kart"), startupwadfiles);
|
||||
#endif
|
||||
// completely optional
|
||||
if (FIL_ReadFileOK(va(pandf,srb2waddir,"extra.kart")))
|
||||
{
|
||||
D_AddFile(va(pandf,srb2waddir,"extra.kart"), startupwadfiles);
|
||||
found_extra_kart = true;
|
||||
}
|
||||
|
||||
// completely optional 2: Back with a vengence
|
||||
if (FIL_ReadFileOK(va(pandf,srb2waddir,"extra2.kart")))
|
||||
{
|
||||
D_AddFile(va(pandf,srb2waddir,"extra2.kart"), startupwadfiles);
|
||||
found_extra2_kart = true;
|
||||
}
|
||||
|
||||
if (FIL_ReadFileOK(va(pandf,srb2waddir,"extra3.kart")))
|
||||
{
|
||||
D_AddFile(va(pandf,srb2waddir,"extra3.kart"), startupwadfiles);
|
||||
found_extra3_kart = true;
|
||||
}
|
||||
|
||||
#if !defined (HAVE_SDL) || defined (HAVE_MIXER)
|
||||
#define MUSICTEST(str) \
|
||||
{\
|
||||
const char *musicpath = va(pandf,srb2waddir,str);\
|
||||
int ms = W_VerifyNMUSlumps(musicpath); \
|
||||
if (ms == 1) \
|
||||
D_AddFile(musicpath, startupwadfiles); \
|
||||
else if (ms == 0) \
|
||||
I_Error("File "str" has been modified with non-music/sound lumps"); \
|
||||
}
|
||||
MUSICTEST("sounds.kart")
|
||||
MUSICTEST("music.kart")
|
||||
#undef MUSICTEST
|
||||
#endif
|
||||
}
|
||||
|
||||
//
|
||||
// Center the title string, then add the date and time of compilation.
|
||||
//
|
||||
static inline void D_MakeTitleString(char *s)
|
||||
{
|
||||
char temp[82];
|
||||
char *t;
|
||||
const char *u;
|
||||
INT32 i;
|
||||
|
||||
for (i = 0, t = temp; i < 82; i++)
|
||||
*t++=' ';
|
||||
|
||||
for (t = temp + (80-strlen(s))/2, u = s; *u != '\0' ;)
|
||||
*t++ = *u++;
|
||||
|
||||
u = compdate;
|
||||
for (t = temp + 1, i = 11; i-- ;)
|
||||
*t++ = *u++;
|
||||
u = comptime;
|
||||
for (t = temp + 71, i = 8; i-- ;)
|
||||
*t++ = *u++;
|
||||
|
||||
temp[80] = '\0';
|
||||
strcpy(s, temp);
|
||||
}
|
||||
|
||||
static void D_CheckSaturnExtraFiles(void)
|
||||
{
|
||||
// Possible value that changes depending on whether required files for speedometer are found or not
|
||||
@@ -1502,12 +1537,14 @@ static void D_CheckSaturnExtraFiles(void)
|
||||
PUSHCONS(inputdisplay_cons_temp, last_inputdisplay_i, 3, "StickGFX");
|
||||
}
|
||||
|
||||
// minimap dot
|
||||
if (W_LumpExists("MMAPDOT"))
|
||||
{
|
||||
minidoticon = true;
|
||||
PUSHCONS(minimapdot_cons_temp, last_minimapdot_i, 1, "Dot");
|
||||
}
|
||||
|
||||
// minimap headlight
|
||||
if (W_LumpExists("MMAPHDLT"))
|
||||
{
|
||||
minilighticon = true;
|
||||
@@ -1597,12 +1634,9 @@ static void D_CheckSaturnExtraFiles(void)
|
||||
//
|
||||
void D_SRB2Main(void)
|
||||
{
|
||||
INT32 p, i;
|
||||
INT32 p;
|
||||
char srb2[82]; // srb2 title banner
|
||||
char title[82];
|
||||
lumpinfo_t *lumpinfo;
|
||||
UINT16 wadnum;
|
||||
char *name;
|
||||
|
||||
INT32 pstartmap = 1;
|
||||
boolean autostart = false;
|
||||
@@ -1660,9 +1694,7 @@ void D_SRB2Main(void)
|
||||
|
||||
#if defined (__OS2__) && !defined (HAVE_SDL)
|
||||
// set PM window title
|
||||
snprintf(pmData->title, sizeof (pmData->title),
|
||||
"SRB2Kart" VERSIONSTRING ": %s",
|
||||
title);
|
||||
snprintf(pmData->title, sizeof (pmData->title), "SRB2Kart" VERSIONSTRING ": %s", title);
|
||||
pmData->title[sizeof (pmData->title) - 1] = '\0';
|
||||
#endif
|
||||
|
||||
@@ -1788,9 +1820,6 @@ void D_SRB2Main(void)
|
||||
I_InitializeTime();
|
||||
setlocale(LC_TIME, "");
|
||||
|
||||
// Make backups of some SOCcable tables.
|
||||
P_BackupTables();
|
||||
|
||||
// Setup default unlockable conditions
|
||||
M_SetupDefaultConditionSets();
|
||||
|
||||
@@ -1800,14 +1829,9 @@ void D_SRB2Main(void)
|
||||
|
||||
// load wad, including the main wad file
|
||||
CONS_Printf("W_InitMultipleFiles(): Adding IWAD and main PWADs.\n");
|
||||
if (!W_InitMultipleFiles(startupwadfiles, false))
|
||||
#ifdef _DEBUG
|
||||
CONS_Error("A WAD file was not found or not valid.\nCheck the log to see which ones.\n");
|
||||
#else
|
||||
I_Error("A WAD file was not found or not valid.\nCheck the log to see which ones.\n");
|
||||
#endif
|
||||
D_CleanFile(startupwadfiles);
|
||||
|
||||
W_InitMultipleFiles(startupiwadfiles, false);
|
||||
D_CleanFile(startupiwadfiles);
|
||||
mainwads = 0;
|
||||
|
||||
#ifndef DEVELOP
|
||||
@@ -1844,66 +1868,18 @@ void D_SRB2Main(void)
|
||||
// conversion sometimes needs the palette
|
||||
V_ReloadPalette();
|
||||
|
||||
//
|
||||
// search for maps
|
||||
//
|
||||
for (wadnum = 0; wadnum < mainwads; wadnum++)
|
||||
D_CheckMaps(false);
|
||||
|
||||
W_InitMultipleFiles(startuppwads, true);
|
||||
|
||||
// Only search for pwad maps if we actually have a pwad added
|
||||
if (startuppwads[0] != NULL)
|
||||
{
|
||||
lumpinfo = wadfiles[wadnum]->lumpinfo;
|
||||
for (i = 0; i < wadfiles[wadnum]->numlumps; i++, lumpinfo++)
|
||||
{
|
||||
name = lumpinfo->name;
|
||||
|
||||
if (memcmp(name, "MAP", 3) == 0) // Ignore the headers
|
||||
{
|
||||
INT16 num;
|
||||
if (name[5] != '\0')
|
||||
continue;
|
||||
num = (INT16)M_MapNumber(name[3], name[4]);
|
||||
|
||||
// we want to record whether this map exists. if it doesn't have a header, we can assume it's not relephant
|
||||
if (num <= NUMMAPS && mapheaderinfo[num - 1])
|
||||
{
|
||||
mapheaderinfo[num - 1]->menuflags |= LF2_EXISTSHACK;
|
||||
}
|
||||
}
|
||||
}
|
||||
D_CheckMaps(true);
|
||||
}
|
||||
|
||||
if (!W_InitMultipleFiles(startuppwads, true))
|
||||
CONS_Error("A PWAD file was not found or not valid.\nCheck the log to see which ones.\n");
|
||||
D_CleanFile(startuppwads);
|
||||
|
||||
//
|
||||
// search for maps... again.
|
||||
//
|
||||
for (wadnum = mainwads+1; wadnum < numwadfiles; wadnum++)
|
||||
{
|
||||
lumpinfo = wadfiles[wadnum]->lumpinfo;
|
||||
for (i = 0; i < wadfiles[wadnum]->numlumps; i++, lumpinfo++)
|
||||
{
|
||||
name = lumpinfo->name;
|
||||
|
||||
if (memcmp(name, "MAP", 3) == 0) // Ignore the headers
|
||||
{
|
||||
INT16 num;
|
||||
if (name[5] != '\0')
|
||||
continue;
|
||||
num = (INT16)M_MapNumber(name[3], name[4]);
|
||||
|
||||
// we want to record whether this map exists. if it doesn't have a header, we can assume it's not relephant
|
||||
if (num <= NUMMAPS && mapheaderinfo[num - 1])
|
||||
{
|
||||
if (mapheaderinfo[num - 1]->menuflags & LF2_EXISTSHACK)
|
||||
G_SetGameModified(multiplayer, true); // oops, double-defined - no record attack privileges for you
|
||||
mapheaderinfo[num - 1]->menuflags |= LF2_EXISTSHACK;
|
||||
}
|
||||
|
||||
CONS_Printf("%s\n", name);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
cht_Init();
|
||||
|
||||
//---------------------------------------------------- READY SCREEN
|
||||
@@ -1923,8 +1899,12 @@ void D_SRB2Main(void)
|
||||
// setup loading screen
|
||||
SCR_Startup();
|
||||
|
||||
// Do this in background; lots of number crunching
|
||||
R_InitTranslucencyTables();
|
||||
|
||||
// we need the font of the console
|
||||
CONS_Printf("HU_Init(): Setting up heads up display.\n");
|
||||
|
||||
HU_Init();
|
||||
|
||||
COM_Init();
|
||||
@@ -1986,48 +1966,20 @@ void D_SRB2Main(void)
|
||||
R_Init();
|
||||
|
||||
// setting up sound
|
||||
if (dedicated)
|
||||
if (dedicated || M_CheckParm("-noaudio")) // combines -nosound and -nomusic
|
||||
{
|
||||
sound_disabled = true;
|
||||
digital_disabled = true;
|
||||
#ifndef NO_MIDI
|
||||
midi_disabled = true;
|
||||
#endif
|
||||
}
|
||||
if (M_CheckParm("-noaudio")) // combines -nosound and -nomusic
|
||||
{
|
||||
sound_disabled = true;
|
||||
digital_disabled = true;
|
||||
#ifndef NO_MIDI
|
||||
midi_disabled = true;
|
||||
#endif
|
||||
music_disabled = true;
|
||||
}
|
||||
else
|
||||
{
|
||||
if (M_CheckParm("-nosound"))
|
||||
sound_disabled = true;
|
||||
if (M_CheckParm("-nomusic")) // combines -nomidimusic and -nodigmusic
|
||||
{
|
||||
digital_disabled = true;
|
||||
#ifndef NO_MIDI
|
||||
midi_disabled = true;
|
||||
#endif
|
||||
}
|
||||
else
|
||||
{
|
||||
#ifndef NO_MIDI
|
||||
if (M_CheckParm("-nomidimusic"))
|
||||
midi_disabled = true; // WARNING: DOS version initmusic in I_StartupSound
|
||||
#endif
|
||||
if (M_CheckParm("-nodigmusic"))
|
||||
digital_disabled = true; // WARNING: DOS version initmusic in I_StartupSound
|
||||
}
|
||||
if (M_CheckParm("-nomusic"))
|
||||
music_disabled = true;
|
||||
}
|
||||
if (!( sound_disabled && digital_disabled
|
||||
#ifndef NO_MIDI
|
||||
&& midi_disabled
|
||||
#endif
|
||||
))
|
||||
|
||||
if (!(sound_disabled && music_disabled))
|
||||
{
|
||||
CONS_Printf("S_InitSfxChannels(): Setting up sound channels.\n");
|
||||
I_StartupSound();
|
||||
@@ -2066,12 +2018,7 @@ void D_SRB2Main(void)
|
||||
|
||||
// check for a driver that wants intermission stats
|
||||
// start the apropriate game based on parms
|
||||
if (M_CheckParm("-metal"))
|
||||
{
|
||||
G_RecordMetal();
|
||||
autostart = true;
|
||||
}
|
||||
else if (M_CheckParm("-record") && M_IsNextParm())
|
||||
if (M_CheckParm("-record") && M_IsNextParm())
|
||||
{
|
||||
G_RecordDemo(M_GetNextParm());
|
||||
autostart = true;
|
||||
@@ -2152,12 +2099,6 @@ void D_SRB2Main(void)
|
||||
}
|
||||
#endif
|
||||
|
||||
/*if (M_CheckParm("-ultimatemode"))
|
||||
{
|
||||
autostart = true;
|
||||
ultimatemode = true;
|
||||
}*/
|
||||
|
||||
if (autostart || netgame)
|
||||
{
|
||||
gameaction = ga_nothing;
|
||||
@@ -2302,6 +2243,9 @@ const char *D_Home(void)
|
||||
}
|
||||
#endif// !__CYGWIN__
|
||||
#endif// _WIN32
|
||||
if (usehome) return userhome;
|
||||
else return NULL;
|
||||
|
||||
if (usehome)
|
||||
return userhome;
|
||||
else
|
||||
return NULL;
|
||||
}
|
||||
+3
-4
@@ -64,12 +64,8 @@ extern boolean minilighticon; // mkwii-style minimap headlight
|
||||
extern boolean autoloading;
|
||||
extern boolean autoloaded;
|
||||
extern boolean postautoloaded;
|
||||
|
||||
void D_AddPostloadFiles(void);
|
||||
|
||||
extern char *autoloadwadfilespost[MAX_WADFILES];
|
||||
extern char *autoloadwadfiles[MAX_WADFILES];
|
||||
|
||||
// the infinite loop of D_SRB2Loop() called from win_main for windows version
|
||||
void D_SRB2Loop(void) FUNCNORETURN;
|
||||
|
||||
@@ -87,9 +83,12 @@ void D_ProcessEvents(void);
|
||||
|
||||
const char *D_Home(void);
|
||||
|
||||
void D_ResetDeviceLED(void);
|
||||
|
||||
//
|
||||
// BASE LEVEL
|
||||
//
|
||||
void D_ClearState(void);
|
||||
void D_StartTitle(void);
|
||||
|
||||
#ifdef __cplusplus
|
||||
|
||||
+24
-12
@@ -219,14 +219,14 @@ static boolean GetFreeAcknum(UINT8 *freeack)
|
||||
node_t *node = &nodes[doomcom->remotenode];
|
||||
INT32 i, numfreeslot = 0;
|
||||
|
||||
doomdata_t *netbuffer = DOOMCOM_DATA(doomcom);
|
||||
|
||||
if (cmpack((UINT8)((node->remotefirstack + MAXACKTOSEND) % 256), node->nextacknum) < 0)
|
||||
{
|
||||
DEBFILE(va("too fast %d %d\n",node->remotefirstack,node->nextacknum));
|
||||
return false;
|
||||
}
|
||||
|
||||
doomdata_t *netbuffer = DOOMCOM_DATA(doomcom);
|
||||
|
||||
for (i = 0; i < MAXACKPACKETS; i++)
|
||||
{
|
||||
if (!ackpak[i].acknum)
|
||||
@@ -262,7 +262,10 @@ static boolean GetFreeAcknum(UINT8 *freeack)
|
||||
CONS_Debug(DBG_NETPLAY, "No more free ackpacket\n");
|
||||
#endif
|
||||
if (netbuffer->packettype < PT_CANFAIL)
|
||||
I_Error("Connection lost\n");
|
||||
{
|
||||
CONS_Alert(CONS_WARNING, "Connection from %s is not acknowledging packets, killing connection\n", I_GetNodeAddress(doomcom->remotenode));
|
||||
Net_CloseConnection(doomcom->remotenode | FORCECLOSE);
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
@@ -461,6 +464,7 @@ void Net_ConnectionTimeout(INT32 node)
|
||||
// Don't timeout several times
|
||||
if (nodes[node].flags & NF_TIMEOUT)
|
||||
return;
|
||||
|
||||
nodes[node].flags |= NF_TIMEOUT;
|
||||
|
||||
// Send a very special packet to self (hack the reboundstore queue)
|
||||
@@ -487,11 +491,11 @@ void Net_AckTicker(void)
|
||||
|
||||
for (i = 0; i < MAXACKPACKETS; i++)
|
||||
{
|
||||
const INT32 nodei = ackpak[i].destinationnode;
|
||||
node_t *node = &nodes[nodei];
|
||||
|
||||
if (ackpak[i].acknum && ackpak[i].senttime + NODETIMEOUT < I_GetTime())
|
||||
{
|
||||
const INT32 nodei = ackpak[i].destinationnode;
|
||||
node_t *node = &nodes[nodei];
|
||||
|
||||
if (ackpak[i].resentnum > 10 && (node->flags & NF_CLOSE))
|
||||
{
|
||||
DEBFILE(va("ack %d sent 10 times so connection is supposed lost: node %d\n",
|
||||
@@ -540,13 +544,14 @@ void Net_UnAcknowledgePacket(INT32 node)
|
||||
#ifdef NONET
|
||||
(void)node;
|
||||
#else
|
||||
doomdata_t *netbuffer = DOOMCOM_DATA(doomcom);
|
||||
INT32 hm1 = (nodes[node].acktosend_head-1+MAXACKTOSEND) % MAXACKTOSEND;
|
||||
DEBFILE(va("UnAcknowledge node %d\n", node));
|
||||
|
||||
if (!node)
|
||||
return;
|
||||
|
||||
doomdata_t *netbuffer = DOOMCOM_DATA(doomcom);
|
||||
|
||||
if (nodes[node].acktosend[hm1] == netbuffer->ack)
|
||||
{
|
||||
nodes[node].acktosend[hm1] = 0;
|
||||
@@ -683,7 +688,6 @@ void Net_CloseConnection(INT32 node)
|
||||
(void)node;
|
||||
#else
|
||||
INT32 i;
|
||||
boolean forceclose = (node & FORCECLOSE) != 0;
|
||||
|
||||
if (node == -1)
|
||||
{
|
||||
@@ -691,6 +695,8 @@ void Net_CloseConnection(INT32 node)
|
||||
return; // nope, just ignore it
|
||||
}
|
||||
|
||||
boolean forceclose = (node & FORCECLOSE) != 0;
|
||||
|
||||
node &= ~FORCECLOSE;
|
||||
|
||||
if (!node)
|
||||
@@ -710,6 +716,12 @@ void Net_CloseConnection(INT32 node)
|
||||
Net_SendAcks(node);
|
||||
Net_SendAcks(node);
|
||||
}
|
||||
else
|
||||
{
|
||||
// if the connection hasn't acknowledged anything, it's possible for it to permanently occupy the node.
|
||||
// to prevent this, drop the connection.
|
||||
forceclose = true;
|
||||
}
|
||||
|
||||
// check if we are waiting for an ack from this node
|
||||
for (i = 0; i < MAXACKPACKETS; i++)
|
||||
@@ -1201,6 +1213,7 @@ boolean HGetPacket(void)
|
||||
GotAcks();
|
||||
continue;
|
||||
}
|
||||
doomcom->datalength -= BASEPACKETSIZE;
|
||||
break;
|
||||
}
|
||||
#endif // ifndef NONET
|
||||
@@ -1258,13 +1271,12 @@ SINT8 I_NetMakeNode(const char *hostname)
|
||||
|
||||
void D_SetDoomcom(void)
|
||||
{
|
||||
if (doomcom) return;
|
||||
if (doomcom)
|
||||
return;
|
||||
|
||||
doomcom = Z_Calloc(sizeof (doomcom_t), PU_STATIC, NULL);
|
||||
doomcom->id = DOOMCOM_ID;
|
||||
doomcom->numslots = doomcom->numnodes = 1;
|
||||
doomcom->gametype = 0;
|
||||
doomcom->consoleplayer = 0;
|
||||
doomcom->extratics = 0;
|
||||
}
|
||||
|
||||
//
|
||||
|
||||
+45
-29
@@ -277,7 +277,8 @@ consvar_t cv_skipmapcheck = {"skipmapcheck", "Off", CV_SAVE, CV_OnOff, NULL, 0,
|
||||
INT32 cv_debug;
|
||||
|
||||
static void UseMouse_OnChange(void);
|
||||
consvar_t cv_usemouse = {"use_mouse", "Off", CV_SAVE|CV_CALL,usemouse_cons_t, UseMouse_OnChange, 0, NULL, NULL, 0, 0, NULL};
|
||||
consvar_t cv_usemouse = {"use_mouse", "Off", CV_SAVE|CV_CALL, usemouse_cons_t, UseMouse_OnChange, 0, NULL, NULL, 0, 0, NULL};
|
||||
consvar_t cv_mousevisible = {"mousevisible", "Off", CV_SAVE|CV_CALL, CV_OnOff, UseMouse_OnChange, 0, NULL, NULL, 0, 0, NULL};
|
||||
|
||||
static void UseMouse_OnChange(void)
|
||||
{
|
||||
@@ -858,6 +859,7 @@ void D_RegisterClientCommands(void)
|
||||
// GIF variables
|
||||
CV_RegisterVar(&cv_gif_optimize);
|
||||
CV_RegisterVar(&cv_gif_downscale);
|
||||
CV_RegisterVar(&cv_gif_dynamicdelay);
|
||||
|
||||
#ifdef WALLSPLATS
|
||||
CV_RegisterVar(&cv_splats);
|
||||
@@ -937,6 +939,7 @@ void D_RegisterClientCommands(void)
|
||||
CV_RegisterVar(&cv_consolechat);
|
||||
CV_RegisterVar(&cv_chatnotifications);
|
||||
CV_RegisterVar(&cv_chatbacktint);
|
||||
CV_RegisterVar(&cv_chatcentertext);
|
||||
CV_RegisterVar(&cv_songcredits);
|
||||
CV_RegisterVar(&cv_showfreeplay);
|
||||
CV_RegisterVar(&cv_skinselectspin);
|
||||
@@ -1002,6 +1005,7 @@ void D_RegisterClientCommands(void)
|
||||
CV_RegisterVar(&cv_invertmouse);
|
||||
CV_RegisterVar(&cv_mousesens);
|
||||
CV_RegisterVar(&cv_mouseysens);
|
||||
CV_RegisterVar(&cv_mousevisible);
|
||||
|
||||
// s_sound.c
|
||||
CV_RegisterVar(&cv_soundvolume);
|
||||
@@ -1528,12 +1532,7 @@ static void SendNameAndColor(void)
|
||||
if (players[consoleplayer].mo)
|
||||
players[consoleplayer].mo->color = players[consoleplayer].skincolor;
|
||||
|
||||
if (metalrecording)
|
||||
{ // Metal Sonic is Sonic, obviously.
|
||||
SetPlayerSkinByNum(consoleplayer, 0);
|
||||
CV_StealthSet(&cv_skin, skins[0].name);
|
||||
}
|
||||
else if ((foundskin = R_SkinAvailable(cv_skin.string)) != -1)
|
||||
if ((foundskin = R_SkinAvailable(cv_skin.string)) != -1)
|
||||
{
|
||||
cv_skin.value = foundskin;
|
||||
SetPlayerSkin(consoleplayer, cv_skin.string);
|
||||
@@ -2323,8 +2322,6 @@ static void Command_Playdemo_f(void)
|
||||
// disconnect from server here?
|
||||
if (demo.playback)
|
||||
G_StopDemo();
|
||||
if (metalplayback)
|
||||
G_StopMetalDemo();
|
||||
|
||||
// open the demo file
|
||||
strcpy(name, COM_Argv(1));
|
||||
@@ -2371,8 +2368,6 @@ static void Command_Timedemo_f(void)
|
||||
// disconnect from server here?
|
||||
if (demo.playback)
|
||||
G_StopDemo();
|
||||
if (metalplayback)
|
||||
G_StopMetalDemo();
|
||||
|
||||
// open the demo file
|
||||
strcpy (name, COM_Argv(1));
|
||||
@@ -2505,6 +2500,14 @@ void D_SetupVote(void)
|
||||
UINT8 gt = (cv_kartgametypepreference.value == -1) ? gametype : cv_kartgametypepreference.value;
|
||||
UINT8 secondgt = G_SometimesGetDifferentGametype(gt);
|
||||
INT16 votebuffer[4] = {-1,-1,-1,0};
|
||||
INT16 luamaps[4] = {0, 0, 0, 0};
|
||||
|
||||
LUA_HookSetupVote(luamaps, sizeof(luamaps)/sizeof(luamaps[0]), gt, secondgt);
|
||||
|
||||
// Correct secondgt if needed
|
||||
UINT8 typeoflevel = mapheaderinfo[luamaps[2]-1]->typeoflevel;
|
||||
if (luamaps[2] && (typeoflevel & G_TOLFlag(secondgt&(~0x80))) == 0)
|
||||
secondgt = ((typeoflevel & TOL_RACE) ? GT_RACE : GT_MATCH)|(secondgt&0x80);
|
||||
|
||||
if (cv_kartencore.value && gt == GT_RACE)
|
||||
WRITEUINT8(p, (gt|0x80));
|
||||
@@ -2513,10 +2516,13 @@ void D_SetupVote(void)
|
||||
WRITEUINT8(p, secondgt);
|
||||
secondgt &= ~0x80;
|
||||
|
||||
|
||||
for (i = 0; i < 4; i++)
|
||||
{
|
||||
UINT16 m;
|
||||
if (i == 2) // sometimes a different gametype
|
||||
if (luamaps[i])
|
||||
m = luamaps[i]-1;
|
||||
else if (i == 2) // sometimes a different gametype
|
||||
m = G_RandMap(G_TOLFlag(secondgt), prevmap, false, 0, true, votebuffer);
|
||||
else if (i >= 3) // unknown-random and force-unknown MAP HELL
|
||||
m = G_RandMap(G_TOLFlag(gt), prevmap, false, (i-2), (i < 4), votebuffer);
|
||||
@@ -2918,8 +2924,6 @@ static void Got_Mapcmd(UINT8 **cp, INT32 playernum)
|
||||
if (demo.timing)
|
||||
G_DoneLevelLoad();
|
||||
|
||||
if (metalrecording)
|
||||
G_BeginMetal();
|
||||
if (demo.recording) // Okay, level loaded, character spawned and skinned,
|
||||
G_BeginRecording(); // I AM NOW READY TO RECORD.
|
||||
demo.deferstart = true;
|
||||
@@ -4392,7 +4396,9 @@ static void Command_Addfile(void)
|
||||
char buf[256];
|
||||
char *buf_p = buf;
|
||||
INT32 i;
|
||||
int musiconly; // W_VerifyNMUSlumps isn't boolean
|
||||
int musiconly = -1; // W_VerifyNMUSlumps isn't boolean
|
||||
|
||||
FILE *fhandle = NULL;
|
||||
|
||||
if (COM_Argc() != 2)
|
||||
{
|
||||
@@ -4407,9 +4413,18 @@ static void Command_Addfile(void)
|
||||
if (!isprint(fn[i]) || fn[i] == ';')
|
||||
return;
|
||||
|
||||
musiconly = W_VerifyNMUSlumps(fn);
|
||||
if (fhandle)
|
||||
{
|
||||
fclose(fhandle);
|
||||
fhandle = NULL;
|
||||
}
|
||||
|
||||
if (!musiconly)
|
||||
if ((fhandle = W_OpenWadFile(&fn, true)) != NULL)
|
||||
{
|
||||
musiconly = W_VerifyNMUSlumps(fn, fhandle, false);
|
||||
}
|
||||
|
||||
if (musiconly == -1)
|
||||
{
|
||||
// ... But only so long as they contain nothing more then music and sprites.
|
||||
if (netgame && !(server || IsPlayerAdmin(consoleplayer)))
|
||||
@@ -4433,36 +4448,31 @@ static void Command_Addfile(void)
|
||||
break;
|
||||
++p;
|
||||
|
||||
WRITESTRINGN(buf_p,p,240);
|
||||
|
||||
// calculate and check md5
|
||||
{
|
||||
UINT8 md5sum[16];
|
||||
#ifdef NOMD5
|
||||
memset(md5sum,0,16);
|
||||
#else
|
||||
FILE *fhandle;
|
||||
|
||||
if ((fhandle = W_OpenWadFile(&fn, true)) != NULL)
|
||||
{
|
||||
tic_t t = I_GetTime();
|
||||
CONS_Debug(DBG_SETUP, "Making MD5 for %s\n",fn);
|
||||
md5_stream(fhandle, md5sum);
|
||||
CONS_Debug(DBG_SETUP, "MD5 calc for %s took %f second\n", fn, (float)(I_GetTime() - t)/TICRATE);
|
||||
fclose(fhandle);
|
||||
}
|
||||
else // file not found
|
||||
return;
|
||||
|
||||
for (i = 0; i < numwadfiles; i++)
|
||||
{
|
||||
if (!memcmp(wadfiles[i]->md5sum, md5sum, 16))
|
||||
{
|
||||
CONS_Alert(CONS_ERROR, M_GetText("%s is already loaded\n"), fn);
|
||||
return;
|
||||
}
|
||||
if (memcmp(wadfiles[i]->md5sum, md5sum, 16))
|
||||
continue;
|
||||
|
||||
CONS_Alert(CONS_ERROR, M_GetText("%s is already loaded\n"), fn);
|
||||
goto addfile_finally;
|
||||
}
|
||||
#endif
|
||||
// Finally okay to write this important data
|
||||
WRITESTRINGN(buf_p,p,240);
|
||||
WRITEMEM(buf_p, md5sum, 16);
|
||||
}
|
||||
|
||||
@@ -4470,6 +4480,10 @@ static void Command_Addfile(void)
|
||||
SendNetXCmd(XD_REQADDFILE, buf, buf_p - buf);
|
||||
else
|
||||
SendNetXCmd(XD_ADDFILE, buf, buf_p - buf);
|
||||
|
||||
addfile_finally:
|
||||
if (fhandle)
|
||||
fclose(fhandle);
|
||||
}
|
||||
|
||||
/** Adds something at runtime.
|
||||
@@ -5593,7 +5607,9 @@ void Command_ExitGame_f(void)
|
||||
closefilemenu(true);
|
||||
|
||||
if (!modeattacking)
|
||||
{
|
||||
D_StartTitle();
|
||||
}
|
||||
}
|
||||
|
||||
void Command_Retry_f(void)
|
||||
|
||||
@@ -50,6 +50,7 @@ extern consvar_t cv_splitplayers;
|
||||
extern consvar_t cv_seenames, cv_allowseenames;
|
||||
#endif
|
||||
extern consvar_t cv_usemouse;
|
||||
extern consvar_t cv_mousevisible;
|
||||
//WTF
|
||||
extern consvar_t cv_mouseturn;
|
||||
extern consvar_t cv_usejoystick[4]; //MAXSPLITSCREENPLAYERS
|
||||
|
||||
+68
-32
@@ -163,7 +163,8 @@ UINT8 *PutFileNeeded(UINT16 firstfile)
|
||||
nameonly(strcpy(wadfilename, wadfiles[i]->filename));
|
||||
|
||||
// Look below at the WRITE macros to understand what these numbers mean.
|
||||
if (p + 1 + 4 + min(strlen(wadfilename) + 1, MAX_WADPATH) + 16 > p_start + MAXFILENEEDED)
|
||||
const size_t len = strlen(wadfilename) + 1;
|
||||
if (p + 1 + 4 + min(len, MAX_WADPATH) + 16 > p_start + MAXFILENEEDED)
|
||||
{
|
||||
// Too many files to send all at once
|
||||
if (netbuffer->packettype == PT_MOREFILESNEEDED)
|
||||
@@ -178,7 +179,7 @@ UINT8 *PutFileNeeded(UINT16 firstfile)
|
||||
// Store in the upper four bits
|
||||
if (!cv_downloading.value)
|
||||
filestatus += (2 << 4); // Won't send
|
||||
else if ((wadfiles[i]->filesize <= (UINT32)cv_maxsend.value * 1024))
|
||||
else if (cv_maxsend.value == -1 || wadfiles[i]->filesize <= (UINT32)cv_maxsend.value * 1024)
|
||||
filestatus += (1 << 4); // Will send if requested
|
||||
// else
|
||||
// filestatus += (0 << 4); -- Won't send, too big
|
||||
@@ -212,6 +213,7 @@ void D_ParseFileneeded(INT32 fileneedednum_parm, UINT8 *fileneededstr, UINT16 fi
|
||||
|
||||
fileneedednum = firstfile + fileneedednum_parm;
|
||||
p = (UINT8 *)fileneededstr;
|
||||
|
||||
for (i = firstfile; i < fileneedednum; i++)
|
||||
{
|
||||
fileneeded[i].status = FS_NOTCHECKED; // We haven't even started looking for the file yet
|
||||
@@ -648,7 +650,8 @@ static boolean SV_SendFile(INT32 node, const char *filename, UINT8 fileid)
|
||||
{
|
||||
filetx_t **q; // A pointer to the "next" field of the last file in the list
|
||||
filetx_t *p; // The new file request
|
||||
INT32 i;
|
||||
UINT16 wadnum;
|
||||
|
||||
char wadfilename[MAX_WADPATH];
|
||||
|
||||
if (cv_noticedownload.value)
|
||||
@@ -674,20 +677,21 @@ static boolean SV_SendFile(INT32 node, const char *filename, UINT8 fileid)
|
||||
nameonly(p->id.filename);
|
||||
|
||||
// Look for the requested file through all loaded files
|
||||
for (i = 0; wadfiles[i]; i++)
|
||||
for (wadnum = 0; wadfiles[wadnum]; wadnum++)
|
||||
{
|
||||
strlcpy(wadfilename, wadfiles[i]->filename, MAX_WADPATH);
|
||||
strlcpy(wadfilename, wadfiles[wadnum]->filename, MAX_WADPATH);
|
||||
nameonly(wadfilename);
|
||||
|
||||
if (!stricmp(wadfilename, p->id.filename))
|
||||
{
|
||||
// Copy file name with full path
|
||||
strlcpy(p->id.filename, wadfiles[i]->filename, MAX_WADPATH);
|
||||
strlcpy(p->id.filename, wadfiles[wadnum]->filename, MAX_WADPATH);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
// Handle non-loaded file requests
|
||||
if (!wadfiles[i])
|
||||
if (!wadfiles[wadnum])
|
||||
{
|
||||
DEBFILE(va("%s not found in wadfiles\n", filename));
|
||||
// This formerly checked if (!findfile(p->id.filename, NULL, true))
|
||||
@@ -702,7 +706,7 @@ static boolean SV_SendFile(INT32 node, const char *filename, UINT8 fileid)
|
||||
}
|
||||
|
||||
// Handle huge file requests (i.e. bigger than cv_maxsend.value KB)
|
||||
if (wadfiles[i]->filesize > (UINT32)cv_maxsend.value * 1024)
|
||||
if (cv_maxsend.value != -1 && wadfiles[wadnum]->filesize > (UINT32)cv_maxsend.value * 1024)
|
||||
{
|
||||
// Too big
|
||||
// Don't inform client (client sucks, man)
|
||||
@@ -773,6 +777,7 @@ static void SV_EndFileSend(INT32 node)
|
||||
case SF_FILE: // It's a file, close it and free its filename
|
||||
if (cv_noticedownload.value)
|
||||
CONS_Printf("Ending file transfer (id %d) for node %d\n", p->fileid, node);
|
||||
|
||||
if (transferFiles[p->fileid].file)
|
||||
{
|
||||
if (transferFiles[p->fileid].count > 0)
|
||||
@@ -786,6 +791,7 @@ static void SV_EndFileSend(INT32 node)
|
||||
transferFiles[p->fileid].file = NULL;
|
||||
}
|
||||
}
|
||||
|
||||
free(p->id.filename);
|
||||
break;
|
||||
case SF_Z_RAM: // It's a memory block allocated with Z_Alloc or the likes, use Z_Free
|
||||
@@ -821,11 +827,12 @@ void SV_FileSendTicker(void)
|
||||
size_t size;
|
||||
filetx_t *f;
|
||||
INT32 packetsent, ram, i, j;
|
||||
doomdata_t *netbuffer = DOOMCOM_DATA(doomcom);
|
||||
|
||||
if (!filestosend) // No file to send
|
||||
return;
|
||||
|
||||
doomdata_t *netbuffer = DOOMCOM_DATA(doomcom);
|
||||
|
||||
packetsent = cv_downloadspeed.value;
|
||||
|
||||
netbuffer->packettype = PT_FILEFRAGMENT;
|
||||
@@ -957,8 +964,8 @@ void Got_Filetxpak(void)
|
||||
static INT32 filetime = 0;
|
||||
|
||||
if (!(strcmp(filename, "srb2.srb")
|
||||
&& strcmp(filename, "srb2.wad")
|
||||
&& strcmp(filename, "patch.dta")
|
||||
//&& strcmp(filename, "srb2.wad")
|
||||
//&& strcmp(filename, "patch.dta")
|
||||
//&& strcmp(filename, "music.dta")
|
||||
&& strcmp(filename, "gfx.kart")
|
||||
&& strcmp(filename, "textures.kart")
|
||||
@@ -1001,6 +1008,7 @@ void Got_Filetxpak(void)
|
||||
pos &= ~0x80000000;
|
||||
file->totalsize = pos + size;
|
||||
}
|
||||
|
||||
// We can receive packet in the wrong order, anyway all os support gaped file
|
||||
fseek(file->file, pos, SEEK_SET);
|
||||
if (fwrite(netbuffer->u.filetxpak.data,size,1,file->file) != 1)
|
||||
@@ -1173,28 +1181,56 @@ filestatus_t findfile(char *filename, const UINT8 *wantedmd5sum, boolean complet
|
||||
filestatus_t homecheck; // store result of last file search
|
||||
boolean badmd5 = false; // store whether md5 was bad from either of the first two searches (if nothing was found in the third)
|
||||
|
||||
// first, check SRB2's "home" directory
|
||||
homecheck = filesearch(filename, srb2home, wantedmd5sum, completepath, 10);
|
||||
|
||||
if (homecheck == FS_FOUND) // we found the file, so return that we have :)
|
||||
return FS_FOUND;
|
||||
else if (homecheck == FS_MD5SUMBAD) // file has a bad md5; move on and look for a file with the right md5
|
||||
badmd5 = true;
|
||||
// if not found at all, just move on without doing anything
|
||||
|
||||
// next, check SRB2's "path" directory
|
||||
homecheck = filesearch(filename, srb2path, wantedmd5sum, completepath, 10);
|
||||
|
||||
if (homecheck == FS_FOUND) // we found the file, so return that we have :)
|
||||
return FS_FOUND;
|
||||
else if (homecheck == FS_MD5SUMBAD) // file has a bad md5; move on and look for a file with the right md5
|
||||
badmd5 = true;
|
||||
// if not found at all, just move on without doing anything
|
||||
|
||||
if (cv_addons_option.value == 3 && *cv_addons_folder.string != '\0')
|
||||
// skip for startup, our mainwads wont be in there
|
||||
if (loaded_config)
|
||||
{
|
||||
// next, check any custom directory if specified
|
||||
homecheck = filesearch(filename, cv_addons_folder.string, wantedmd5sum, completepath, 10);
|
||||
if (cv_addons_option.value == 3 && *cv_addons_folder.string != '\0')
|
||||
{
|
||||
// first, check any custom directory if specified
|
||||
homecheck = filesearch(filename, cv_addons_folder.string, wantedmd5sum, completepath, 10);
|
||||
|
||||
if (homecheck == FS_FOUND) // we found the file, so return that we have :)
|
||||
return FS_FOUND;
|
||||
else if (homecheck == FS_MD5SUMBAD) // file has a bad md5; move on and look for a file with the right md5
|
||||
badmd5 = true;
|
||||
// if not found at all, just move on without doing anything
|
||||
}
|
||||
|
||||
// next, check "DOWNLOAD" directory
|
||||
homecheck = filesearch(filename, "DOWNLOAD", wantedmd5sum, completepath, 10);
|
||||
|
||||
if (homecheck == FS_FOUND) // we found the file, so return that we have :)
|
||||
return FS_FOUND;
|
||||
else if (homecheck == FS_MD5SUMBAD) // file has a bad md5; move on and look for a file with the right md5
|
||||
badmd5 = true;
|
||||
// if not found at all, just move on without doing anything
|
||||
|
||||
// next, check "addons" directory
|
||||
homecheck = filesearch(filename, "addons", wantedmd5sum, completepath, 10);
|
||||
|
||||
if (homecheck == FS_FOUND) // we found the file, so return that we have :)
|
||||
return FS_FOUND;
|
||||
else if (homecheck == FS_MD5SUMBAD) // file has a bad md5; move on and look for a file with the right md5
|
||||
badmd5 = true;
|
||||
// if not found at all, just move on without doing anything
|
||||
}
|
||||
|
||||
// next, check SRB2's "home" directory (if non-'.')
|
||||
if (strcmp(srb2home, "."))
|
||||
{
|
||||
homecheck = filesearch(filename, srb2home, wantedmd5sum, completepath, 10);
|
||||
|
||||
if (homecheck == FS_FOUND) // we found the file, so return that we have :)
|
||||
return FS_FOUND;
|
||||
else if (homecheck == FS_MD5SUMBAD) // file has a bad md5; move on and look for a file with the right md5
|
||||
badmd5 = true;
|
||||
// if not found at all, just move on without doing anything
|
||||
}
|
||||
|
||||
// next, check SRB2's "path" directory (also if non-'.')
|
||||
if (strcmp(srb2path, "."))
|
||||
{
|
||||
homecheck = filesearch(filename, srb2path, wantedmd5sum, completepath, 10);
|
||||
|
||||
if (homecheck == FS_FOUND) // we found the file, so return that we have :)
|
||||
return FS_FOUND;
|
||||
|
||||
+2
-4
@@ -383,10 +383,6 @@ typedef struct player_s
|
||||
fixed_t viewz;
|
||||
// Base height above floor for viewz.
|
||||
fixed_t viewheight;
|
||||
// Bob/squat speed.
|
||||
//fixed_t deltaviewheight;
|
||||
// bounded/scaled total momentum.
|
||||
//fixed_t bob;
|
||||
|
||||
angle_t viewrollangle;
|
||||
angle_t tilt;
|
||||
@@ -568,6 +564,8 @@ typedef struct player_s
|
||||
squishdance_t squishdance;
|
||||
|
||||
fixed_t fovadd; // adjust FOV for hw rendering
|
||||
|
||||
SINT8 driftlevel; // just for controller rumble for now
|
||||
} player_t;
|
||||
|
||||
#endif
|
||||
+6
-5
@@ -60,7 +60,7 @@ static boolean RegisterProtocols(const char *path)
|
||||
HKEY hKey = OpenKey(HKEY_CURRENT_USER,"Software\\Classes\\srb2kart");
|
||||
SetStringValue(hKey, "URL Protocol", "");
|
||||
RegCloseKey(hKey);
|
||||
hKey = OpenKey(HKEY_CURRENT_USER,"Software\\Classes\\srb2kart\\shell\\open\\command");
|
||||
hKey = OpenKey(HKEY_CURRENT_USER,"Software\\Classes\\srb2kart\\shell\\open\\command");
|
||||
SetStringValue(hKey, "", va("\"%s\" \"%%1\"", path));
|
||||
RegCloseKey(hKey);
|
||||
#elif defined (__unix__) || defined (UNIXCOMMON)
|
||||
@@ -76,12 +76,12 @@ static boolean RegisterProtocols(const char *path)
|
||||
|
||||
if (system("which update-desktop-database > /dev/null 2>&1"))
|
||||
{
|
||||
// command not found, probably doesn't have freedesktop, so let's ignore
|
||||
// command not found, probably doesn't have freedesktop, so let's ignore
|
||||
CONS_Alert(CONS_ERROR, "Unable to register protocols. Your system doesn't seem to have freedesktop.\n");
|
||||
return false;
|
||||
}
|
||||
|
||||
if (stat(applicationsfolder, &sb) == -1)
|
||||
if (stat(applicationsfolder, &sb) == -1)
|
||||
{
|
||||
// location doesn't exist, so let's actually create it
|
||||
newfolder = true;
|
||||
@@ -119,12 +119,13 @@ static boolean RegisterProtocols(const char *path)
|
||||
|
||||
if (!alreadyexists)
|
||||
fprintf(mimefile, "x-scheme-handler/srb2kart=srb2kart-handler.desktop;\n");
|
||||
|
||||
|
||||
if (newfolder)
|
||||
{
|
||||
if (system(va("update-desktop-database %s/.local/share/applications/", homedir)) == -1)
|
||||
{
|
||||
CONS_Alert(CONS_ERROR, "Unable to register protocols. Could not run call to run update-desktop-database sucessfully.\n");
|
||||
fclose(mimefile);
|
||||
return false;
|
||||
}
|
||||
}
|
||||
@@ -206,7 +207,7 @@ void D_SetupProtocol(void)
|
||||
|
||||
fp = fopen(protocolfile, "a+");
|
||||
result = fgets(buffer, PATH_MAX, fp);
|
||||
if (result)
|
||||
if (result)
|
||||
{
|
||||
if (strcmp(buffer, "no") == 0)
|
||||
{
|
||||
|
||||
+12
-1
@@ -30,6 +30,15 @@
|
||||
//
|
||||
typedef void (*actionf_p1)(void *);
|
||||
|
||||
typedef enum
|
||||
{
|
||||
/// The allocation is standard e.g. Z_Malloc
|
||||
TAT_MALLOC,
|
||||
|
||||
/// The allocation is in the pool allocator (e.g. Z_LevelPoolCalloc)
|
||||
TAT_LEVELPOOL
|
||||
} thinker_alloc_type_e;
|
||||
|
||||
// Historically, "think_t" is yet another function pointer to a routine
|
||||
// to handle an actor.
|
||||
typedef actionf_p1 think_t;
|
||||
@@ -44,7 +53,9 @@ typedef struct thinker_s
|
||||
// killough 11/98: count of how many other objects reference
|
||||
// this one using pointers. Used for garbage collection.
|
||||
INT32 references;
|
||||
boolean cachable;
|
||||
INT32 alloctype;
|
||||
size_t size;
|
||||
|
||||
#ifdef PARANOIA
|
||||
INT32 debug_mobjtype;
|
||||
tic_t debug_time;
|
||||
|
||||
@@ -69,13 +69,11 @@ void I_ShutdownSound(void){}
|
||||
|
||||
\return sfx handle
|
||||
*/
|
||||
INT32 I_StartSound(sfxenum_t id, UINT8 vol, UINT8 sep, UINT8 pitch, UINT8 priority, INT32 channel)
|
||||
INT32 I_StartSound(sfxenum_t id, UINT8 vol, UINT8 sep, INT32 channel)
|
||||
{
|
||||
(void)id;
|
||||
(void)vol;
|
||||
(void)sep;
|
||||
(void)pitch;
|
||||
(void)priority;
|
||||
(void)channel;
|
||||
return 0;
|
||||
}
|
||||
@@ -116,12 +114,11 @@ boolean I_SoundIsPlaying(INT32 handle)
|
||||
|
||||
\return void
|
||||
*/
|
||||
void I_UpdateSoundParams(INT32 handle, UINT8 vol, UINT8 sep, UINT8 pitch)
|
||||
void I_UpdateSoundParams(INT32 handle, UINT8 vol, UINT8 sep)
|
||||
{
|
||||
(void)handle;
|
||||
(void)vol;
|
||||
(void)sep;
|
||||
(void)pitch;
|
||||
}
|
||||
|
||||
/** \brief The I_SetSfxVolume function
|
||||
|
||||
@@ -1223,43 +1223,6 @@ void I_UpdateMumble(const mobj_t *mobj, const listener_t listener)
|
||||
#undef WINMUMBLE
|
||||
#endif // NOMUMBLE
|
||||
|
||||
|
||||
/** \brief empty ticcmd for player 1
|
||||
*/
|
||||
static ticcmd_t emptycmd;
|
||||
|
||||
ticcmd_t *I_BaseTiccmd(void)
|
||||
{
|
||||
return &emptycmd;
|
||||
}
|
||||
|
||||
/** \brief empty ticcmd for player 2
|
||||
*/
|
||||
static ticcmd_t emptycmd2;
|
||||
|
||||
ticcmd_t *I_BaseTiccmd2(void)
|
||||
{
|
||||
return &emptycmd2;
|
||||
}
|
||||
|
||||
/** \brief empty ticcmd for player 3
|
||||
*/
|
||||
static ticcmd_t emptycmd3;
|
||||
|
||||
ticcmd_t *I_BaseTiccmd3(void)
|
||||
{
|
||||
return &emptycmd3;
|
||||
}
|
||||
|
||||
/** \brief empty ticcmd for player 4
|
||||
*/
|
||||
static ticcmd_t emptycmd4;
|
||||
|
||||
ticcmd_t *I_BaseTiccmd4(void)
|
||||
{
|
||||
return &emptycmd4;
|
||||
}
|
||||
|
||||
//
|
||||
// I_GetTime
|
||||
// returns time in 1/TICRATE second tics
|
||||
@@ -1476,8 +1439,6 @@ void I_Quit(void)
|
||||
|
||||
if (demo.recording)
|
||||
G_CheckDemoStatus();
|
||||
if (metalrecording)
|
||||
G_StopMetalRecording();
|
||||
|
||||
D_QuitNetGame();
|
||||
I_ShutdownMusic();
|
||||
@@ -1583,8 +1544,6 @@ void I_Error(const char *error, ...)
|
||||
// Shutdown. Here might be other errors.
|
||||
if (demo.recording)
|
||||
G_CheckDemoStatus();
|
||||
if (metalrecording)
|
||||
G_StopMetalRecording();
|
||||
|
||||
D_QuitNetGame();
|
||||
I_ShutdownMusic();
|
||||
@@ -1899,7 +1858,7 @@ static const char *searchWad(const char *searchDir)
|
||||
filestatus_t fstemp;
|
||||
|
||||
strcpy(tempsw, WADKEYWORD1);
|
||||
fstemp = filesearch(tempsw,searchDir,NULL,true,20);
|
||||
fstemp = filesearch(tempsw, searchDir, NULL, true, 20);
|
||||
if (fstemp == FS_FOUND)
|
||||
{
|
||||
pathonly(tempsw);
|
||||
|
||||
@@ -29,16 +29,12 @@
|
||||
|
||||
rendermode_t rendermode = render_none;
|
||||
|
||||
boolean highcolor = false;
|
||||
|
||||
// synchronize page flipping with screen refresh
|
||||
consvar_t cv_vidwait = {"vid_wait", "On", CV_SAVE, CV_OnOff, NULL, 0, NULL, NULL, 0, 0, NULL};
|
||||
|
||||
static CV_PossibleValue_t keyboardlayout_cons_t[] = {{1,"Default US"}, {2, "Native"}, {3, "AZERTY"}, {0, NULL}};
|
||||
consvar_t cv_keyboardlayout = {"keyboardlayout", "Default US", CV_SAVE, keyboardlayout_cons_t, NULL, 0, NULL, NULL, 0, 0, NULL};
|
||||
|
||||
consvar_t cv_alwaysgrabmouse = {"alwaysgrabmouse", "Off", CV_SAVE, CV_OnOff, NULL, 0, NULL, NULL, 0, 0, NULL};
|
||||
|
||||
INT32 numcontrollers = 0;
|
||||
|
||||
UINT8 graphics_started = 0; // Is used in console.c and screen.c
|
||||
@@ -148,12 +144,16 @@ UINT32 I_GetRefreshRate(void)
|
||||
return 0;
|
||||
}
|
||||
|
||||
void I_SetTextInput(void)
|
||||
{
|
||||
}
|
||||
|
||||
boolean I_UseNativeKeyboard(void)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
void I_SetBorderlessWindow(void)
|
||||
void I_SetBorderlessWindow(void)
|
||||
{
|
||||
|
||||
}
|
||||
+11
-2
@@ -178,6 +178,9 @@ FUNCPRINTF static void deh_warning(const char *first, ...)
|
||||
else
|
||||
CONS_Alert(CONS_WARNING, "Line %u: %s\n", dbg_line, buf);
|
||||
|
||||
if (dbg_line != -1 && (M_CheckParm("-strict") || M_CheckParm("-strict-soc")))
|
||||
I_Error("deh_warning: %s", buf);
|
||||
|
||||
deh_num_warning++;
|
||||
|
||||
Z_Free(buf);
|
||||
@@ -2628,7 +2631,7 @@ static void readmaincfg(MYFILE *f)
|
||||
}
|
||||
else if (fastcmp(word, "RESETDATA"))
|
||||
{
|
||||
P_ResetData(value);
|
||||
CONS_Alert(CONS_WARNING, M_GetText("RESETDATA is obsolete and no longer has any effect.\n"));
|
||||
}
|
||||
else if (fastcmp(word, "CUSTOMVERSION"))
|
||||
{
|
||||
@@ -2855,7 +2858,7 @@ static void DEH_LoadDehackedFile(MYFILE *f, UINT16 wad)
|
||||
dbg_line = -1; // start at -1 so the first line is 0.
|
||||
while (!myfeof(f))
|
||||
{
|
||||
char origpos[128];
|
||||
char origpos[256];
|
||||
INT32 size = 0;
|
||||
char *traverse;
|
||||
|
||||
@@ -2871,6 +2874,12 @@ static void DEH_LoadDehackedFile(MYFILE *f, UINT16 wad)
|
||||
size++;
|
||||
}
|
||||
|
||||
if (size > (int)sizeof(origpos))
|
||||
{
|
||||
deh_warning("Line is too long");
|
||||
size = sizeof(origpos)-1;
|
||||
}
|
||||
|
||||
strncpy(origpos, s, size);
|
||||
origpos[size] = '\0';
|
||||
|
||||
|
||||
+4
-10
@@ -115,8 +115,8 @@ extern char logfilename[1024];
|
||||
#else
|
||||
#define VERSION 1 // Game version
|
||||
#define SUBVERSION 6 // more precise version number
|
||||
#define VERSIONSTRING "Saturn v8.3"
|
||||
#define VERSIONSTRINGW L"Saturn v8.3"
|
||||
#define VERSIONSTRING "Saturn v9"
|
||||
#define VERSIONSTRINGW L"Saturn v9"
|
||||
// Hey! If you change this, add 1 to the MODVERSION below! Otherwise we can't force updates!
|
||||
// And change CMakeLists.txt (not src/, but in root), for CMake users!
|
||||
// AND appveyor.yml, for the build bots!
|
||||
@@ -626,13 +626,6 @@ extern const char *compdate, *comptime, *comprevision, *compbranch;
|
||||
/// Most modifications should probably enable this.
|
||||
//#define SAVEGAME_OTHERVERSIONS
|
||||
|
||||
/// Allow the use of the SOC RESETINFO command.
|
||||
/// \note Builds that are tight on memory should disable this.
|
||||
/// This stops the game from storing backups of the states, sprites, and mobjinfo tables.
|
||||
/// Though this info is compressed under normal circumstances, it's still a lot of extra
|
||||
/// memory that never gets touched.
|
||||
#define ALLOW_RESETDATA
|
||||
|
||||
#ifndef NONET
|
||||
/// Display a connection screen on join attempts.
|
||||
#define CLIENT_LOADINGSCREEN
|
||||
@@ -650,7 +643,8 @@ extern const char *compdate, *comptime, *comprevision, *compbranch;
|
||||
#define NOCLIPCAM
|
||||
|
||||
/// SRB2Kart: MIDI support is shitty and busted and we don't want it, lets throw it behind a define
|
||||
#define NO_MIDI
|
||||
// yall didnt properly disable it so it always worked lol (:
|
||||
//#define NO_MIDI
|
||||
|
||||
/// Sprite rotation
|
||||
#define ROTSPRITE
|
||||
|
||||
+1
-8
@@ -71,7 +71,6 @@ extern boolean majormods;
|
||||
extern UINT16 mainwads;
|
||||
extern boolean savemoddata; // This mod saves time/emblem data.
|
||||
extern boolean imcontinuing; // Temporary flag while continuing
|
||||
extern boolean metalrecording;
|
||||
|
||||
#define ATTACKING_NONE 0
|
||||
#define ATTACKING_RECORD 1
|
||||
@@ -102,13 +101,8 @@ extern boolean forceresetplayers, deferencoremode;
|
||||
// Internal parameters for sound rendering.
|
||||
// ========================================
|
||||
|
||||
#ifdef NO_MIDI
|
||||
#define midi_disabled true
|
||||
#else
|
||||
extern boolean midi_disabled;
|
||||
#endif
|
||||
extern boolean sound_disabled;
|
||||
extern boolean digital_disabled;
|
||||
extern boolean music_disabled;
|
||||
|
||||
// =========================
|
||||
// Status flags for refresh.
|
||||
@@ -574,7 +568,6 @@ extern consvar_t cv_forceskin; // force clients to use the server's skin
|
||||
extern consvar_t cv_downloading; // allow clients to downloading WADs.
|
||||
extern consvar_t cv_nettimeout; // SRB2Kart: Advanced server options menu
|
||||
extern consvar_t cv_jointimeout;
|
||||
extern consvar_t cv_maxping;
|
||||
extern ticcmd_t netcmds[BACKUPTICS][MAXPLAYERS];
|
||||
extern INT32 serverplayer;
|
||||
extern INT32 adminplayers[MAXPLAYERS];
|
||||
|
||||
+2
-2
@@ -148,8 +148,8 @@ int strlwr(char *n); // from dosstr.c
|
||||
#include <stddef.h> // for size_t
|
||||
|
||||
#ifndef SRB2_HAVE_STRLCPY
|
||||
size_t strlcat(char *dst, const char *src, size_t siz);
|
||||
size_t strlcpy(char *dst, const char *src, size_t siz);
|
||||
size_t strlcat(char *dst, const char *src, size_t dsize);
|
||||
size_t strlcpy(char *dst, const char *src, size_t dsize);
|
||||
#endif
|
||||
|
||||
// Macro for use with char foo[FOOSIZE+1] type buffers.
|
||||
|
||||
+8
-6
@@ -34,6 +34,8 @@
|
||||
#include "y_inter.h"
|
||||
#include "m_cond.h"
|
||||
|
||||
#include "r_fps.h" // R_GetTimeFrac
|
||||
|
||||
// Stage of animation:
|
||||
// 0 = text, 1 = art screen
|
||||
static INT32 finalecount;
|
||||
@@ -170,8 +172,8 @@ static void F_SkyScroll(INT32 scrollspeed)
|
||||
w = (vid.width / vid.dupx)<<FRACBITS;
|
||||
|
||||
// The scroll offset MUST be clamped before shifting by FRACBITS, or else it'll overflow in about 3 minutes
|
||||
animtimer = ((((finalecount * scrollspeed) % (pat->width*16))<<FRACBITS) + (R_GetMenuUncap() * scrollspeed))/16;
|
||||
anim2 = (pat2->width<<FRACBITS) - ((((finalecount * scrollspeed) % (pat2->width*16))<<FRACBITS) + (R_GetMenuUncap() * scrollspeed))/16;
|
||||
animtimer = ((((finalecount * scrollspeed) % (pat->width*16))<<FRACBITS) + (R_GetTimeFrac(RTF_MENU) * scrollspeed))/16;
|
||||
anim2 = (pat2->width<<FRACBITS) - ((((finalecount * scrollspeed) % (pat2->width*16))<<FRACBITS) + (R_GetTimeFrac(RTF_MENU) * scrollspeed))/16;
|
||||
|
||||
// SRB2Kart: F_DrawPatchCol is over-engineered; recoded to be less shitty and error-prone
|
||||
if (rendermode != render_none)
|
||||
@@ -948,7 +950,7 @@ void F_GameEndTicker(void)
|
||||
if (timetonext > 0)
|
||||
timetonext--;
|
||||
else
|
||||
D_StartTitle();
|
||||
G_EndGame();
|
||||
}
|
||||
|
||||
// ==============
|
||||
@@ -1003,7 +1005,7 @@ void F_TitleScreenDrawer(void)
|
||||
if (finalecount >= 20)
|
||||
V_DrawSmallScaledPatch(84, 87, 0, ttkart);
|
||||
else if (finalecount >= 10)
|
||||
V_DrawSciencePatch((84<<FRACBITS) - 18*(((20 - finalecount)<<FRACBITS) - R_GetMenuUncap()), 87<<FRACBITS, 0, ttkart, FRACUNIT/2);
|
||||
V_DrawSciencePatch((84<<FRACBITS) - 18*(((20 - finalecount)<<FRACBITS) - R_GetTimeFrac(RTF_MENU)), 87<<FRACBITS, 0, ttkart, FRACUNIT/2);
|
||||
}
|
||||
else if (finalecount < 52)
|
||||
{
|
||||
@@ -1019,8 +1021,8 @@ void F_TitleScreenDrawer(void)
|
||||
|
||||
F_SkyScroll(titlescrollspeed);
|
||||
|
||||
V_DrawSciencePatch(0, -40*FixedDiv(((finalecount % 70)<<FRACBITS) + R_GetMenuUncap(), 70<<FRACBITS), V_SNAPTOTOP|V_SNAPTOLEFT, ttcheckers, FRACUNIT);
|
||||
V_DrawSciencePatch(280<<FRACBITS, -(40<<FRACBITS) + 40*FixedDiv(((finalecount % 70)<<FRACBITS) + R_GetMenuUncap(), 70<<FRACBITS), V_SNAPTOTOP|V_SNAPTORIGHT, ttcheckers, FRACUNIT);
|
||||
V_DrawSciencePatch(0, -40*FixedDiv(((finalecount % 70)<<FRACBITS) + R_GetTimeFrac(RTF_MENU), 70<<FRACBITS), V_SNAPTOTOP|V_SNAPTOLEFT, ttcheckers, FRACUNIT);
|
||||
V_DrawSciencePatch(280<<FRACBITS, -(40<<FRACBITS) + 40*FixedDiv(((finalecount % 70)<<FRACBITS) + R_GetTimeFrac(RTF_MENU), 70<<FRACBITS), V_SNAPTOTOP|V_SNAPTORIGHT, ttcheckers, FRACUNIT);
|
||||
|
||||
if (transval)
|
||||
V_DrawFadeScreen(120, 10 - transval);
|
||||
|
||||
+154
-63
@@ -341,6 +341,7 @@ char *refreshdirname = NULL;
|
||||
// direrror is set if there was an error.
|
||||
INT32 pathisdirectory(const char *path)
|
||||
{
|
||||
#ifndef _WIN32
|
||||
struct stat fsstat;
|
||||
|
||||
if (stat(path, &fsstat) < 0)
|
||||
@@ -348,39 +349,67 @@ INT32 pathisdirectory(const char *path)
|
||||
return -1;
|
||||
}
|
||||
else if (S_ISDIR(fsstat.st_mode))
|
||||
{
|
||||
return 1;
|
||||
}
|
||||
|
||||
#else
|
||||
DWORD fileattr = GetFileAttributes(path);
|
||||
if (fileattr == INVALID_FILE_ATTRIBUTES)
|
||||
{
|
||||
return -1;
|
||||
}
|
||||
else if (fileattr & FILE_ATTRIBUTE_DIRECTORY)
|
||||
{
|
||||
return 1;
|
||||
}
|
||||
#endif
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
// skip those folders, they will not have any addons
|
||||
static const char *exclude_paths[] = {
|
||||
"logs",
|
||||
"luafiles",
|
||||
"replay",
|
||||
"mdls",
|
||||
"gifs",
|
||||
"screenshots",
|
||||
NULL
|
||||
};
|
||||
|
||||
filestatus_t filesearch(char *filename, const char *startpath, const UINT8 *wantedmd5sum, boolean completepath, int maxsearchdepth)
|
||||
{
|
||||
filestatus_t retval = FS_NOTFOUND;
|
||||
DIR **dirhandle;
|
||||
struct dirent *dent;
|
||||
#ifndef _WIN32
|
||||
struct stat fsstat;
|
||||
#endif
|
||||
int found = 0;
|
||||
char *searchname = strdup(filename);
|
||||
char *searchname;
|
||||
int depthleft = maxsearchdepth;
|
||||
char searchpath[1024];
|
||||
size_t *searchpathindex;
|
||||
|
||||
dirhandle = (DIR**) malloc(maxsearchdepth * sizeof(DIR*));
|
||||
searchpathindex = (size_t *) malloc(maxsearchdepth * sizeof(size_t));
|
||||
dirhandle = (DIR**)malloc(maxsearchdepth * sizeof(DIR*));
|
||||
searchpathindex = (size_t *)malloc(maxsearchdepth * sizeof(size_t));
|
||||
|
||||
strcpy(searchpath,startpath);
|
||||
strcpy(searchpath, startpath);
|
||||
searchpathindex[--depthleft] = strlen(searchpath) + 1;
|
||||
|
||||
dirhandle[depthleft] = opendir(searchpath);
|
||||
|
||||
if (dirhandle[depthleft] == NULL)
|
||||
{
|
||||
free(searchname);
|
||||
free(dirhandle);
|
||||
free(searchpathindex);
|
||||
return FS_NOTFOUND;
|
||||
}
|
||||
|
||||
searchname = strdup(filename);
|
||||
|
||||
if (searchpath[searchpathindex[depthleft]-2] != PATHSEP[0])
|
||||
{
|
||||
searchpath[searchpathindex[depthleft]-1] = PATHSEP[0];
|
||||
@@ -412,62 +441,88 @@ filestatus_t filesearch(char *filename, const char *startpath, const UINT8 *want
|
||||
// okay, now we actually want searchpath to incorporate d_name
|
||||
strcpy(&searchpath[searchpathindex[depthleft]], dent->d_name);
|
||||
|
||||
#if defined(__linux__) || defined(__FreeBSD__)
|
||||
if (dent->d_type == DT_UNKNOWN && lstat(searchpath, &fsstat) == 0)
|
||||
{
|
||||
if (S_ISDIR(fsstat.st_mode))
|
||||
#if defined(__linux__) || defined(__FreeBSD__) || defined(__OpenBSD__)
|
||||
if (dent->d_type == DT_UNKNOWN || dent->d_type == DT_LNK)
|
||||
if (stat(searchpath, &fsstat) == 0 && S_ISDIR(fsstat.st_mode))
|
||||
dent->d_type = DT_DIR;
|
||||
else if (S_ISLNK(fsstat.st_mode))
|
||||
dent->d_type = DT_LNK;
|
||||
}
|
||||
|
||||
// Symlinks aren't always directory symlinks. Dunno if this would resolve recursive
|
||||
// symlinks, but i think stat already does that
|
||||
if (dent->d_type == DT_LNK && stat(searchpath,&fsstat) == 0 && !S_ISDIR(fsstat.st_mode))
|
||||
{
|
||||
dent->d_type = DT_UNKNOWN;
|
||||
}
|
||||
|
||||
// Linux and FreeBSD has a special field for file type on dirent, so use that to speed up lookups.
|
||||
// FIXME: should we also follow symlinks?
|
||||
if ((dent->d_type == DT_DIR && depthleft) || (dent->d_type == DT_LNK && depthleft))
|
||||
if (dent->d_type == DT_DIR)
|
||||
#elif defined (_WIN32)
|
||||
// if we wanna follow symlinks we can check with FILE_ATTRIBUTE_REPARSE_POINT
|
||||
DWORD fileattr = GetFileAttributes(searchpath);
|
||||
if (fileattr == INVALID_FILE_ATTRIBUTES)
|
||||
continue; // was the file (re)moved? can't stat it
|
||||
|
||||
if (fileattr & FILE_ATTRIBUTE_DIRECTORY)
|
||||
#else
|
||||
if (stat(searchpath,&fsstat) < 0) // do we want to follow symlinks? if not: change it to lstat
|
||||
; // was the file (re)moved? can't stat it
|
||||
else if (S_ISDIR(fsstat.st_mode) && depthleft)
|
||||
continue; // was the file (re)moved? can't stat it
|
||||
|
||||
if (S_ISDIR(fsstat.st_mode))
|
||||
#endif
|
||||
{
|
||||
searchpathindex[--depthleft] = strlen(searchpath) + 1;
|
||||
dirhandle[depthleft] = opendir(searchpath);
|
||||
// I am a folder!
|
||||
|
||||
if (!dirhandle[depthleft])
|
||||
if (!depthleft)
|
||||
continue; // No additional folder delving permitted...
|
||||
|
||||
const char **path = exclude_paths;
|
||||
|
||||
if (depthleft == maxsearchdepth-1)
|
||||
{
|
||||
// can't open it... maybe no read-permissions
|
||||
// go back to previous dir
|
||||
depthleft++;
|
||||
// When we're at the root of the search, we exclude certain folders.
|
||||
|
||||
boolean skipfolder = false;
|
||||
|
||||
for (; *path != NULL; path++)
|
||||
{
|
||||
if (strcasecmp(*path, dent->d_name) == 0)
|
||||
{
|
||||
skipfolder = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if (skipfolder)
|
||||
{
|
||||
continue;
|
||||
}
|
||||
}
|
||||
|
||||
searchpath[searchpathindex[depthleft]-1] = PATHSEP[0];
|
||||
searchpath[searchpathindex[depthleft]] = 0;
|
||||
if (strcasecmp(".git", dent->d_name) // sanity if you're weird like me
|
||||
&& (dirhandle[depthleft-1] = opendir(searchpath)) != NULL)
|
||||
{
|
||||
// Got read permissions!
|
||||
searchpathindex[--depthleft] = strlen(searchpath) + 1;
|
||||
|
||||
searchpath[searchpathindex[depthleft]-1] = PATHSEP[0];
|
||||
searchpath[searchpathindex[depthleft]] = 0;
|
||||
}
|
||||
|
||||
continue;
|
||||
}
|
||||
else if (!strcasecmp(searchname, dent->d_name))
|
||||
|
||||
// I am a file!
|
||||
|
||||
if (strcasecmp(searchname, dent->d_name))
|
||||
continue; // Not what we're looking for!
|
||||
|
||||
switch (checkfilemd5(searchpath, wantedmd5sum))
|
||||
{
|
||||
switch (checkfilemd5(searchpath, wantedmd5sum))
|
||||
{
|
||||
case FS_FOUND:
|
||||
if (completepath)
|
||||
strcpy(filename, searchpath);
|
||||
else
|
||||
strcpy(filename, dent->d_name);
|
||||
retval = FS_FOUND;
|
||||
found = 1;
|
||||
break;
|
||||
case FS_MD5SUMBAD:
|
||||
retval = FS_MD5SUMBAD;
|
||||
break;
|
||||
default: // prevent some compiler warnings
|
||||
break;
|
||||
}
|
||||
case FS_FOUND:
|
||||
if (completepath)
|
||||
strcpy(filename, searchpath);
|
||||
else
|
||||
strcpy(filename, dent->d_name);
|
||||
retval = FS_FOUND;
|
||||
found = 1;
|
||||
break;
|
||||
case FS_MD5SUMBAD:
|
||||
retval = FS_MD5SUMBAD;
|
||||
break;
|
||||
default: // prevent some compiler warnings
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -644,7 +699,9 @@ boolean preparefilemenu(boolean samedepth, boolean replayhut)
|
||||
{
|
||||
DIR *dirhandle;
|
||||
struct dirent *dent;
|
||||
#ifndef _WIN32
|
||||
struct stat fsstat;
|
||||
#endif
|
||||
size_t pos = 0, folderpos = 0, numfolders = 0;
|
||||
char *tempname = NULL;
|
||||
|
||||
@@ -680,30 +737,44 @@ boolean preparefilemenu(boolean samedepth, boolean replayhut)
|
||||
if (!dent)
|
||||
break;
|
||||
else if (dent->d_name[0]=='.' &&
|
||||
(dent->d_name[1]=='\0' ||
|
||||
(dent->d_name[1]=='.' &&
|
||||
dent->d_name[2]=='\0')))
|
||||
(dent->d_name[1]=='\0' ||
|
||||
(dent->d_name[1]=='.' &&
|
||||
dent->d_name[2]=='\0')))
|
||||
continue; // we don't want to scan uptree
|
||||
|
||||
strcpy(&menupath[menupathindex[menudepthleft]],dent->d_name);
|
||||
|
||||
if (stat(menupath,&fsstat) < 0) // do we want to follow symlinks? if not: change it to lstat
|
||||
#ifndef _WIN32
|
||||
if (stat(menupath, &fsstat) < 0)
|
||||
#else
|
||||
// if we wanna follow symlinks we can check with FILE_ATTRIBUTE_REPARSE_POINT
|
||||
DWORD fileattr = GetFileAttributes(menupath);
|
||||
if (fileattr == INVALID_FILE_ATTRIBUTES)
|
||||
#endif
|
||||
; // was the file (re)moved? can't stat it
|
||||
else // is a file or directory
|
||||
{
|
||||
#ifndef _WIN32
|
||||
if (!S_ISDIR(fsstat.st_mode)) // file
|
||||
#else
|
||||
if (!(fileattr & FILE_ATTRIBUTE_DIRECTORY))
|
||||
#endif
|
||||
{
|
||||
size_t len = strlen(dent->d_name)+1;
|
||||
if (replayhut)
|
||||
{
|
||||
if (strcasecmp(".lmp", dent->d_name+len-5)) continue; // Not a replay
|
||||
if (strcasecmp(".lmp", dent->d_name+len-5))
|
||||
continue; // Not a replay
|
||||
}
|
||||
else if (!cv_addons_showall.value)
|
||||
{
|
||||
UINT8 ext;
|
||||
for (ext = 0; ext < NUM_EXT_TABLE; ext++)
|
||||
if (!strcasecmp(exttable[ext]+1, dent->d_name+len-(exttable[ext][0]))) break; // extension comparison
|
||||
if (ext == NUM_EXT_TABLE) continue; // not an addfile-able (or exec-able) file
|
||||
if (!strcasecmp(exttable[ext]+1, dent->d_name+len-(exttable[ext][0])))
|
||||
break; // extension comparison
|
||||
|
||||
if (ext == NUM_EXT_TABLE)
|
||||
continue; // not an addfile-able (or exec-able) file
|
||||
}
|
||||
}
|
||||
else // directory
|
||||
@@ -748,14 +819,20 @@ boolean preparefilemenu(boolean samedepth, boolean replayhut)
|
||||
if (!dent)
|
||||
break;
|
||||
else if (dent->d_name[0]=='.' &&
|
||||
(dent->d_name[1]=='\0' ||
|
||||
(dent->d_name[1]=='.' &&
|
||||
dent->d_name[2]=='\0')))
|
||||
(dent->d_name[1]=='\0' ||
|
||||
(dent->d_name[1]=='.' &&
|
||||
dent->d_name[2]=='\0')))
|
||||
continue; // we don't want to scan uptree
|
||||
|
||||
strcpy(&menupath[menupathindex[menudepthleft]],dent->d_name);
|
||||
|
||||
if (stat(menupath,&fsstat) < 0) // do we want to follow symlinks? if not: change it to lstat
|
||||
#ifndef _WIN32
|
||||
if (stat(menupath, &fsstat) < 0)
|
||||
#else
|
||||
// if we wanna follow symlinks we can check with FILE_ATTRIBUTE_REPARSE_POINT
|
||||
DWORD fileattr = GetFileAttributes(menupath);
|
||||
if (fileattr == INVALID_FILE_ATTRIBUTES)
|
||||
#endif
|
||||
; // was the file (re)moved? can't stat it
|
||||
else // is a file or directory
|
||||
{
|
||||
@@ -764,20 +841,31 @@ boolean preparefilemenu(boolean samedepth, boolean replayhut)
|
||||
UINT8 ext = EXT_FOLDER;
|
||||
UINT8 folder;
|
||||
|
||||
#ifndef _WIN32
|
||||
if (!S_ISDIR(fsstat.st_mode)) // file
|
||||
#else
|
||||
if (!(fileattr & FILE_ATTRIBUTE_DIRECTORY))
|
||||
#endif
|
||||
{
|
||||
if (!((numfolders+pos) < sizecoredirmenu)) continue; // crash prevention
|
||||
if (!((numfolders+pos) < sizecoredirmenu))
|
||||
continue; // crash prevention
|
||||
|
||||
if (replayhut)
|
||||
{
|
||||
if (strcasecmp(".lmp", dent->d_name+len-5)) continue; // Not a replay
|
||||
if (strcasecmp(".lmp", dent->d_name+len-5))
|
||||
continue; // Not a replay
|
||||
|
||||
ext = EXT_TXT; // This isn't used anywhere but better safe than sorry for messing with this...
|
||||
}
|
||||
else
|
||||
{
|
||||
for (; ext < NUM_EXT_TABLE; ext++)
|
||||
if (!strcasecmp(exttable[ext]+1, dent->d_name+len-(exttable[ext][0]))) break; // extension comparison
|
||||
if (ext == NUM_EXT_TABLE && !cv_addons_showall.value) continue; // not an addfile-able (or exec-able) file
|
||||
if (!strcasecmp(exttable[ext]+1, dent->d_name+len-(exttable[ext][0])))
|
||||
break; // extension comparison
|
||||
|
||||
if (ext == NUM_EXT_TABLE && !cv_addons_showall.value)
|
||||
continue; // not an addfile-able (or exec-able) file
|
||||
|
||||
ext += EXT_START; // moving to be appropriate position
|
||||
|
||||
if (ext >= EXT_LOADSTART)
|
||||
@@ -794,6 +882,7 @@ boolean preparefilemenu(boolean samedepth, boolean replayhut)
|
||||
|
||||
if (strcmp(dent->d_name, filenamebuf[i]))
|
||||
continue;
|
||||
|
||||
if (cv_addons_md5.value && !checkfilemd5(menupath, wadfiles[i]->md5sum))
|
||||
continue;
|
||||
|
||||
@@ -820,9 +909,11 @@ boolean preparefilemenu(boolean samedepth, boolean replayhut)
|
||||
|
||||
if (!(temp = Z_Malloc((len+DIR_STRING+folder) * sizeof (char), PU_STATIC, NULL)))
|
||||
I_Error("preparefilemenu(): could not create file entry.");
|
||||
|
||||
temp[DIR_TYPE] = ext;
|
||||
temp[DIR_LEN] = (UINT8)(len);
|
||||
strlcpy(temp+DIR_STRING, dent->d_name, len);
|
||||
|
||||
if (folder)
|
||||
{
|
||||
strcpy(temp+len, PATHSEP);
|
||||
|
||||
+1
-2
@@ -30,8 +30,7 @@ extern consvar_t cv_addons_option, cv_addons_folder, cv_addons_md5, cv_addons_sh
|
||||
|
||||
*/
|
||||
|
||||
filestatus_t filesearch(char *filename, const char *startpath, const UINT8 *wantedmd5sum,
|
||||
boolean completepath, int maxsearchdepth);
|
||||
filestatus_t filesearch(char *filename, const char *startpath, const UINT8 *wantedmd5sum, boolean completepath, int maxsearchdepth);
|
||||
|
||||
#define menudepth 20
|
||||
|
||||
|
||||
+24
-442
@@ -82,12 +82,6 @@ static boolean demosynced = true; // console warning message
|
||||
|
||||
struct demovars_s demo;
|
||||
|
||||
boolean metalrecording; // recording as metal sonic
|
||||
mobj_t *metalplayback;
|
||||
static UINT8 *metalbuffer = NULL;
|
||||
static UINT8 *metal_p;
|
||||
static UINT16 metalversion;
|
||||
|
||||
consvar_t cv_resyncdemo = {"resyncdemo", "On", 0, CV_OnOff, NULL, 0, NULL, NULL, 0, 0, NULL};
|
||||
|
||||
// extra data stuff (events registered this frame while recording)
|
||||
@@ -196,46 +190,10 @@ static ticcmd_t oldcmd[MAXPLAYERS];
|
||||
#define EZT_SPRITE 0x40 // Changed sprite set completely out of PLAY (NiGHTS, SOCs, whatever)
|
||||
#define EZT_KART 0x80 // SRB2Kart: Changed current held item/quantity and bumpers for battle
|
||||
|
||||
static mobj_t oldmetal, oldghost[MAXPLAYERS];
|
||||
static mobj_t oldghost[MAXPLAYERS];
|
||||
|
||||
static void G_ResetDemoPlayback(char *pdemoname);
|
||||
|
||||
void G_SaveMetal(UINT8 **buffer)
|
||||
{
|
||||
I_Assert(buffer != NULL && *buffer != NULL);
|
||||
|
||||
WRITEUINT32(*buffer, metal_p - metalbuffer);
|
||||
}
|
||||
|
||||
void G_LoadMetal(UINT8 **buffer)
|
||||
{
|
||||
I_Assert(buffer != NULL && *buffer != NULL);
|
||||
|
||||
G_DoPlayMetal();
|
||||
metal_p = metalbuffer + READUINT32(*buffer);
|
||||
}
|
||||
|
||||
ticcmd_t *G_CopyTiccmd(ticcmd_t* dest, const ticcmd_t* src, const size_t n)
|
||||
{
|
||||
return M_Memcpy(dest, src, n*sizeof(*src));
|
||||
}
|
||||
|
||||
ticcmd_t *G_MoveTiccmd(ticcmd_t* dest, const ticcmd_t* src, const size_t n)
|
||||
{
|
||||
size_t i;
|
||||
for (i = 0; i < n; i++)
|
||||
{
|
||||
dest[i].forwardmove = src[i].forwardmove;
|
||||
dest[i].sidemove = src[i].sidemove;
|
||||
dest[i].angleturn = SHORT(src[i].angleturn);
|
||||
dest[i].aiming = (INT16)SHORT(src[i].aiming);
|
||||
dest[i].buttons = (UINT16)SHORT(src[i].buttons);
|
||||
dest[i].driftturn = (INT16)SHORT(src[i].driftturn);
|
||||
dest[i].latency = (INT16)SHORT(src[i].latency);
|
||||
}
|
||||
return dest;
|
||||
}
|
||||
|
||||
// Finds a skin with the closest stats if the expected skin doesn't exist.
|
||||
static INT32 GetSkinNumClosestToStats(UINT8 kartspeed, UINT8 kartweight)
|
||||
{
|
||||
@@ -700,13 +658,6 @@ void G_WriteAllGhostTics(void)
|
||||
if (multiplayer && ((counter % cv_netdemosyncquality.value) != 0)) // Only write 1 in this many ghost datas per tic to cut down on multiplayer replay size.
|
||||
continue;
|
||||
|
||||
if (((ghostext[i].flags && (ghostext[i].flags & EZT_HIT)) || ghostext[i].hits)
|
||||
&& !ghostext[i].hitlist) // hitlist might be freed during resynch, beware PU_LEVEL!
|
||||
{
|
||||
ghostext[i].hits = 0;
|
||||
continue;
|
||||
}
|
||||
|
||||
CHECKSPACE(1);
|
||||
|
||||
WRITEUINT8(demobuf.p, i);
|
||||
@@ -914,7 +865,9 @@ void G_WriteGhostTic(mobj_t *ghost, INT32 playernum)
|
||||
P_SetTarget(ghostext[playernum].hitlist+i, NULL);
|
||||
}
|
||||
|
||||
Z_Free(ghostext[playernum].hitlist);
|
||||
ghostext[playernum].hits = 0;
|
||||
ghostext[playernum].hitlist = NULL;
|
||||
}
|
||||
|
||||
if (ghostext[playernum].flags & EZT_SPRITE)
|
||||
@@ -1295,15 +1248,15 @@ void G_GhostTicker(void)
|
||||
{
|
||||
switch (ziptic & EZT_THOKMASK)
|
||||
{
|
||||
case EZT_THOK:
|
||||
type = (UINT32)mobjinfo[MT_PLAYER].painchance;
|
||||
break;
|
||||
case EZT_SPIN:
|
||||
type = (UINT32)mobjinfo[MT_PLAYER].damage;
|
||||
break;
|
||||
case EZT_REV:
|
||||
type = (UINT32)mobjinfo[MT_PLAYER].raisestate;
|
||||
break;
|
||||
case EZT_THOK:
|
||||
type = (UINT32)mobjinfo[MT_PLAYER].painchance;
|
||||
break;
|
||||
case EZT_SPIN:
|
||||
type = (UINT32)mobjinfo[MT_PLAYER].damage;
|
||||
break;
|
||||
case EZT_REV:
|
||||
type = (UINT32)mobjinfo[MT_PLAYER].raisestate;
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (type != -1)
|
||||
@@ -1601,216 +1554,6 @@ void G_ConfirmRewind(tic_t rewindtime)
|
||||
P_ResetCamera(&players[displayplayers[i]], &camera[i]);
|
||||
}
|
||||
|
||||
void G_ReadMetalTic(mobj_t *metal)
|
||||
{
|
||||
UINT8 ziptic;
|
||||
UINT16 speed;
|
||||
UINT8 statetype;
|
||||
|
||||
if (!metal_p)
|
||||
return;
|
||||
ziptic = READUINT8(metal_p);
|
||||
|
||||
// Read changes from the tic
|
||||
if (ziptic & GZT_XYZ)
|
||||
{
|
||||
oldmetal.x = READFIXED(metal_p);
|
||||
oldmetal.y = READFIXED(metal_p);
|
||||
oldmetal.z = READFIXED(metal_p);
|
||||
P_MoveOrigin(metal, oldmetal.x, oldmetal.y, oldmetal.z);
|
||||
oldmetal.x = metal->x;
|
||||
oldmetal.y = metal->y;
|
||||
oldmetal.z = metal->z;
|
||||
}
|
||||
else
|
||||
{
|
||||
if (ziptic & GZT_MOMXY)
|
||||
{
|
||||
oldmetal.momx = READINT16(metal_p)<<8;
|
||||
oldmetal.momy = READINT16(metal_p)<<8;
|
||||
}
|
||||
if (ziptic & GZT_MOMZ)
|
||||
oldmetal.momz = READINT16(metal_p)<<8;
|
||||
oldmetal.x += oldmetal.momx;
|
||||
oldmetal.y += oldmetal.momy;
|
||||
oldmetal.z += oldmetal.momz;
|
||||
}
|
||||
if (ziptic & GZT_ANGLE)
|
||||
oldmetal.angle = READUINT8(metal_p)<<24;
|
||||
if (ziptic & GZT_SPRITE)
|
||||
metal_p++; // Currently unused. (Metal Sonic figures out what he's doing his own damn self.)
|
||||
|
||||
// Set movement, position, and angle
|
||||
// oldmetal contains where you're supposed to be.
|
||||
metal->momx = oldmetal.momx;
|
||||
metal->momy = oldmetal.momy;
|
||||
metal->momz = oldmetal.momz;
|
||||
P_UnsetThingPosition(metal);
|
||||
metal->x = oldmetal.x;
|
||||
metal->y = oldmetal.y;
|
||||
metal->z = oldmetal.z;
|
||||
P_SetThingPosition(metal);
|
||||
metal->angle = oldmetal.angle;
|
||||
|
||||
if (ziptic & GZT_EXTRA)
|
||||
{ // But wait, there's more!
|
||||
ziptic = READUINT8(metal_p);
|
||||
if (ziptic & EZT_FLIP)
|
||||
metal->eflags ^= MFE_VERTICALFLIP;
|
||||
if (ziptic & EZT_SCALE)
|
||||
{
|
||||
metal->destscale = READFIXED(metal_p);
|
||||
if (metal->destscale != metal->scale)
|
||||
P_SetScale(metal, metal->destscale);
|
||||
}
|
||||
}
|
||||
|
||||
// Calculates player's speed based on distance-of-a-line formula
|
||||
speed = FixedDiv(P_AproxDistance(oldmetal.momx, oldmetal.momy), metal->scale)>>FRACBITS;
|
||||
|
||||
// Use speed to decide an appropriate state
|
||||
if (speed > 20) // default skin runspeed
|
||||
statetype = 2;
|
||||
else if (speed > 1) // stopspeed
|
||||
statetype = 1;
|
||||
else
|
||||
statetype = 0;
|
||||
|
||||
// Set state
|
||||
if (statetype != metal->threshold)
|
||||
{
|
||||
switch (statetype)
|
||||
{
|
||||
case 2: // run
|
||||
P_SetMobjState(metal,metal->info->meleestate);
|
||||
break;
|
||||
case 1: // walk
|
||||
P_SetMobjState(metal,metal->info->seestate);
|
||||
break;
|
||||
default: // stand
|
||||
P_SetMobjState(metal,metal->info->spawnstate);
|
||||
break;
|
||||
}
|
||||
metal->threshold = statetype;
|
||||
}
|
||||
|
||||
// TODO: Modify state durations based on movement speed, similar to players?
|
||||
|
||||
if (*metal_p == DEMOMARKER)
|
||||
{
|
||||
// end of demo data stream
|
||||
G_StopMetalDemo();
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
void G_WriteMetalTic(mobj_t *metal)
|
||||
{
|
||||
UINT8 ziptic = 0;
|
||||
UINT8 *ziptic_p;
|
||||
|
||||
if (!demobuf.p) // demobuf.p will be NULL until the race start linedef executor is triggered!
|
||||
return;
|
||||
|
||||
ziptic_p = demobuf.p++; // the ziptic, written at the end of this function
|
||||
|
||||
#define MAXMOM (0xFFFF<<8)
|
||||
|
||||
// GZT_XYZ is only useful if you've moved 256 FRACUNITS or more in a single tic.
|
||||
if (abs(metal->x-oldmetal.x) > MAXMOM
|
||||
|| abs(metal->y-oldmetal.y) > MAXMOM
|
||||
|| abs(metal->z-oldmetal.z) > MAXMOM)
|
||||
{
|
||||
oldmetal.x = metal->x;
|
||||
oldmetal.y = metal->y;
|
||||
oldmetal.z = metal->z;
|
||||
WRITEFIXED(demobuf.p,oldmetal.x);
|
||||
WRITEFIXED(demobuf.p,oldmetal.y);
|
||||
WRITEFIXED(demobuf.p,oldmetal.z);
|
||||
ziptic |= GZT_XYZ;
|
||||
}
|
||||
else
|
||||
{
|
||||
// For moving normally:
|
||||
// Store one full byte of movement, plus one byte of fractional movement.
|
||||
INT16 momx = (INT16)((metal->x-oldmetal.x)>>8);
|
||||
INT16 momy = (INT16)((metal->y-oldmetal.y)>>8);
|
||||
if (momx != oldmetal.momx
|
||||
|| momy != oldmetal.momy)
|
||||
{
|
||||
oldmetal.momx = momx;
|
||||
oldmetal.momy = momy;
|
||||
WRITEINT16(demobuf.p,momx);
|
||||
WRITEINT16(demobuf.p,momy);
|
||||
ziptic |= GZT_MOMXY;
|
||||
}
|
||||
momx = (INT16)((metal->z-oldmetal.z)>>8);
|
||||
if (momx != oldmetal.momz)
|
||||
{
|
||||
oldmetal.momz = momx;
|
||||
WRITEINT16(demobuf.p,momx);
|
||||
ziptic |= GZT_MOMZ;
|
||||
}
|
||||
|
||||
// This SHOULD set oldmetal.x/y/z to match metal->x/y/z
|
||||
// but it keeps the fractional loss of one byte,
|
||||
// so it will hopefully be made up for in future tics.
|
||||
oldmetal.x += oldmetal.momx<<8;
|
||||
oldmetal.y += oldmetal.momy<<8;
|
||||
oldmetal.z += oldmetal.momz<<8;
|
||||
}
|
||||
|
||||
#undef MAXMOM
|
||||
|
||||
// Only store the 8 most relevant bits of angle
|
||||
// because exact values aren't too easy to discern to begin with when only 8 angles have different sprites
|
||||
// and it does not affect movement at all anyway.
|
||||
if (metal->angle>>24 != oldmetal.angle)
|
||||
{
|
||||
oldmetal.angle = metal->angle>>24;
|
||||
WRITEUINT8(demobuf.p,oldmetal.angle);
|
||||
ziptic |= GZT_ANGLE;
|
||||
}
|
||||
|
||||
// Metal Sonic does not need our state changes.
|
||||
// ... currently.
|
||||
|
||||
{
|
||||
UINT8 *exttic_p = NULL;
|
||||
UINT8 exttic = 0;
|
||||
if ((metal->eflags & MFE_VERTICALFLIP) != (oldmetal.eflags & MFE_VERTICALFLIP))
|
||||
{
|
||||
if (!exttic_p)
|
||||
exttic_p = demobuf.p++;
|
||||
exttic |= EZT_FLIP;
|
||||
oldmetal.eflags ^= MFE_VERTICALFLIP;
|
||||
}
|
||||
if (metal->scale != oldmetal.scale)
|
||||
{
|
||||
if (!exttic_p)
|
||||
exttic_p = demobuf.p++;
|
||||
exttic |= EZT_SCALE;
|
||||
WRITEFIXED(demobuf.p,metal->scale);
|
||||
oldmetal.scale = metal->scale;
|
||||
}
|
||||
if (exttic_p)
|
||||
{
|
||||
*exttic_p = exttic;
|
||||
ziptic |= GZT_EXTRA;
|
||||
}
|
||||
}
|
||||
|
||||
*ziptic_p = ziptic;
|
||||
|
||||
// attention here for the ticcmd size!
|
||||
// latest demos with mouse aiming byte in ticcmd
|
||||
if (demobuf.p >= demoend - 32)
|
||||
{
|
||||
G_StopMetalRecording(); // no more space
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
//
|
||||
// G_RecordDemo
|
||||
//
|
||||
@@ -1841,23 +1584,6 @@ void G_RecordDemo(const char *name)
|
||||
}
|
||||
}
|
||||
|
||||
void G_RecordMetal(void)
|
||||
{
|
||||
INT32 maxsize;
|
||||
maxsize = cv_maxdemosize.value*1024*1024;
|
||||
if (demobuf.buffer)
|
||||
Z_Free(demobuf.buffer);
|
||||
demobuf.p = NULL;
|
||||
metalrecording = false;
|
||||
demobuf.buffer = Z_Malloc(maxsize + 100*1024, PU_STATIC, NULL);
|
||||
demoend = demobuf.buffer + maxsize;
|
||||
|
||||
if (demobuf.buffer)
|
||||
metalrecording = true;
|
||||
else
|
||||
CONS_Alert(CONS_ERROR, "Failed to allocate demo buffer\n");
|
||||
}
|
||||
|
||||
void G_BeginRecording(void)
|
||||
{
|
||||
UINT8 i, p;
|
||||
@@ -2042,46 +1768,6 @@ void G_BeginRecording(void)
|
||||
}
|
||||
}
|
||||
|
||||
void G_BeginMetal(void)
|
||||
{
|
||||
mobj_t *mo = players[consoleplayer].mo;
|
||||
|
||||
if (demobuf.buffer == NULL)
|
||||
{
|
||||
CONS_Alert(CONS_ERROR, "No metal demo buffer allocated\n");
|
||||
metalrecording = false;
|
||||
return;
|
||||
}
|
||||
|
||||
if (demobuf.p)
|
||||
{
|
||||
Z_Free(demobuf.buffer);
|
||||
demobuf.buffer = NULL;
|
||||
metalrecording = false;
|
||||
return;
|
||||
}
|
||||
|
||||
demobuf.p = demobuf.buffer;
|
||||
|
||||
// Write header.
|
||||
M_Memcpy(demobuf.p, DEMOHEADER, 12); demobuf.p += 12;
|
||||
WRITEUINT8(demobuf.p,VERSION);
|
||||
WRITEUINT8(demobuf.p,SUBVERSION);
|
||||
WRITEUINT16(demobuf.p,DEMOVERSION);
|
||||
|
||||
// demo checksum
|
||||
demobuf.p += 16;
|
||||
|
||||
M_Memcpy(demobuf.p, "METL", 4); demobuf.p += 4;
|
||||
|
||||
// Set up our memory.
|
||||
memset(&oldmetal,0,sizeof(oldmetal));
|
||||
oldmetal.x = mo->x;
|
||||
oldmetal.y = mo->y;
|
||||
oldmetal.z = mo->z;
|
||||
oldmetal.angle = mo->angle;
|
||||
}
|
||||
|
||||
void G_WriteStanding(UINT8 ranking, char *name, INT32 skinnum, UINT8 color, UINT32 val)
|
||||
{
|
||||
char temp[17];
|
||||
@@ -2729,9 +2415,9 @@ void G_LoadDemoTitle(menudemo_t *pdemo)
|
||||
}
|
||||
|
||||
info_p += 12; // DEMOHEADER
|
||||
info_p++; // VERSION
|
||||
info_p++; // SUBVERSION
|
||||
|
||||
READUINT8(info_p);
|
||||
READUINT8(info_p);
|
||||
pdemoversion = READUINT16(info_p);
|
||||
|
||||
memset(pdemo->date, 0, sizeof(pdemo->date));
|
||||
@@ -3683,74 +3369,6 @@ void G_TimeDemo(const char *name)
|
||||
G_DeferedPlayDemo(name);
|
||||
}
|
||||
|
||||
void G_DoPlayMetal(void)
|
||||
{
|
||||
lumpnum_t l;
|
||||
mobj_t *mo = NULL;
|
||||
thinker_t *th;
|
||||
|
||||
// it's an internal demo
|
||||
if ((l = W_CheckNumForName(va("%sMS",G_BuildMapName(gamemap)))) == LUMPERROR)
|
||||
{
|
||||
CONS_Alert(CONS_WARNING, M_GetText("No bot recording for this map.\n"));
|
||||
return;
|
||||
}
|
||||
else
|
||||
metalbuffer = metal_p = W_CacheLumpNum(l, PU_STATIC);
|
||||
|
||||
// find metal sonic
|
||||
for (th = thinkercap.next; th != &thinkercap; th = th->next)
|
||||
{
|
||||
if (th->function != (actionf_p1)P_MobjThinker)
|
||||
continue;
|
||||
|
||||
mo = (mobj_t *)th;
|
||||
if (mo->type == MT_METALSONIC_RACE)
|
||||
break;
|
||||
}
|
||||
if (!mo)
|
||||
{
|
||||
CONS_Alert(CONS_ERROR, M_GetText("Failed to find bot entity.\n"));
|
||||
Z_Free(metalbuffer);
|
||||
return;
|
||||
}
|
||||
|
||||
// read demo header
|
||||
metal_p += 12; // DEMOHEADER
|
||||
metal_p++; // VERSION
|
||||
metal_p++; // SUBVERSION
|
||||
metalversion = READUINT16(metal_p);
|
||||
switch(metalversion)
|
||||
{
|
||||
case DEMOVERSION: // latest always supported
|
||||
break;
|
||||
#ifdef DEMO_COMPAT_100
|
||||
case 0x0001:
|
||||
I_Error("You need to implement demo compat here, doofus! %s:%d", __FILE__, __LINE__);
|
||||
#endif
|
||||
// too old, cannot support.
|
||||
default:
|
||||
CONS_Alert(CONS_WARNING, M_GetText("Failed to load bot recording for this map, format version incompatible.\n"));
|
||||
Z_Free(metalbuffer);
|
||||
return;
|
||||
}
|
||||
metal_p += 16; // demo checksum
|
||||
if (memcmp(metal_p, "METL", 4))
|
||||
{
|
||||
CONS_Alert(CONS_WARNING, M_GetText("Failed to load bot recording for this map, wasn't recorded in Metal format.\n"));
|
||||
Z_Free(metalbuffer);
|
||||
return;
|
||||
} metal_p += 4; // "METL"
|
||||
|
||||
// read initial tic
|
||||
memset(&oldmetal,0,sizeof(oldmetal));
|
||||
oldmetal.x = mo->x;
|
||||
oldmetal.y = mo->y;
|
||||
oldmetal.z = mo->z;
|
||||
oldmetal.angle = mo->angle;
|
||||
metalplayback = mo;
|
||||
}
|
||||
|
||||
void G_DoneLevelLoad(void)
|
||||
{
|
||||
CONS_Printf(M_GetText("Loaded level in %f sec\n"), (double)(I_GetTime() - demostarttime) / TICRATE);
|
||||
@@ -3768,42 +3386,6 @@ void G_DoneLevelLoad(void)
|
||||
===================
|
||||
*/
|
||||
|
||||
// Stops metal sonic's demo. Separate from other functions because metal + replays can coexist
|
||||
void G_StopMetalDemo(void)
|
||||
{
|
||||
// Metal Sonic finishing doesn't end the game, dammit.
|
||||
Z_Free(metalbuffer);
|
||||
metalbuffer = NULL;
|
||||
metalplayback = NULL;
|
||||
metal_p = NULL;
|
||||
}
|
||||
|
||||
// Stops metal sonic recording.
|
||||
ATTRNORETURN void FUNCNORETURN G_StopMetalRecording(void)
|
||||
{
|
||||
boolean saved = false;
|
||||
if (demobuf.p && demobuf.buffer != NULL)
|
||||
{
|
||||
UINT8 *p = demobuf.buffer+16; // checksum position
|
||||
#ifdef NOMD5
|
||||
UINT8 i;
|
||||
WRITEUINT8(demobuf.p, DEMOMARKER); // add the demo end marker
|
||||
for (i = 0; i < 16; i++, p++)
|
||||
*p = P_RandomByte(); // This MD5 was chosen by fair dice roll and most likely < 50% correct.
|
||||
#else
|
||||
WRITEUINT8(demobuf.p, DEMOMARKER); // add the demo end marker
|
||||
md5_buffer((char *)p+16, demobuf.p - (p+16), (void *)p); // make a checksum of everything after the checksum in the file.
|
||||
#endif
|
||||
saved = FIL_WriteFile(va("%sMS.LMP", G_BuildMapName(gamemap)), demobuf.buffer, demobuf.p - demobuf.buffer); // finally output the file.
|
||||
}
|
||||
Z_Free(demobuf.buffer);
|
||||
demobuf.buffer = NULL;
|
||||
metalrecording = false;
|
||||
if (saved)
|
||||
I_Error("Saved to %sMS.LMP", G_BuildMapName(gamemap));
|
||||
I_Error("Failed to save demo!");
|
||||
}
|
||||
|
||||
// reset engine variable set for the demos
|
||||
// called from stopdemo command, map command, and g_checkdemoStatus.
|
||||
void G_StopDemo(void)
|
||||
@@ -3869,8 +3451,8 @@ static void G_StopTimingDemo(void)
|
||||
D_StartTitle();
|
||||
}
|
||||
|
||||
|
||||
boolean G_CheckDemoStatus(void)
|
||||
// Clean up all ghosts
|
||||
void G_FreeGhosts(void)
|
||||
{
|
||||
while (ghosts)
|
||||
{
|
||||
@@ -3879,8 +3461,12 @@ boolean G_CheckDemoStatus(void)
|
||||
ghosts = next;
|
||||
}
|
||||
ghosts = NULL;
|
||||
}
|
||||
|
||||
// DO NOT end metal sonic demos here
|
||||
|
||||
boolean G_CheckDemoStatus(void)
|
||||
{
|
||||
G_FreeGhosts();
|
||||
|
||||
if (demo.timing)
|
||||
{
|
||||
@@ -3927,18 +3513,15 @@ boolean G_CheckDemoStatus(void)
|
||||
|
||||
void G_ResetDemoRecording(void)
|
||||
{
|
||||
if (demobuf.buffer)
|
||||
Z_Free(demobuf.buffer);
|
||||
Z_Free(demobuf.buffer);
|
||||
demobuf.buffer = NULL;
|
||||
demo.recording = false;
|
||||
}
|
||||
|
||||
static void G_ResetDemoPlayback(char *pdemoname)
|
||||
{
|
||||
if (pdemoname)
|
||||
Z_Free(pdemoname);
|
||||
if (demobuf.buffer)
|
||||
Z_Free(demobuf.buffer);
|
||||
Z_Free(pdemoname);
|
||||
Z_Free(demobuf.buffer);
|
||||
demobuf.buffer = NULL;
|
||||
demo.playback = false;
|
||||
if (demo.title)
|
||||
@@ -4027,7 +3610,6 @@ void G_SaveDemo(void)
|
||||
md5_buffer((char *)p+16, (demobuf.buffer + length) - (p+16), p);
|
||||
#endif
|
||||
|
||||
|
||||
if (FIL_WriteFile(va(pandf, srb2home, demoname), demobuf.buffer, demobuf.p - demobuf.buffer)) // finally output the file.
|
||||
demo.savemode = DSM_SAVED;
|
||||
|
||||
|
||||
+1
-12
@@ -87,13 +87,9 @@ typedef struct menudemo_s {
|
||||
} standings[MAXPLAYERS];
|
||||
} menudemo_t;
|
||||
|
||||
extern mobj_t *metalplayback;
|
||||
|
||||
// Only called by startup code.
|
||||
void G_RecordDemo(const char *name);
|
||||
void G_RecordMetal(void);
|
||||
void G_BeginRecording(void);
|
||||
void G_BeginMetal(void);
|
||||
|
||||
// Only called by shutdown code.
|
||||
void G_WriteStanding(UINT8 ranking, char *name, INT32 skinnum, UINT8 color, UINT32 val);
|
||||
@@ -147,11 +143,6 @@ void G_StoreRewindInfo(void);
|
||||
void G_PreviewRewind(tic_t previewtime);
|
||||
void G_ConfirmRewind(tic_t rewindtime);
|
||||
|
||||
void G_ReadMetalTic(mobj_t *metal);
|
||||
void G_WriteMetalTic(mobj_t *metal);
|
||||
void G_SaveMetal(UINT8 **buffer);
|
||||
void G_LoadMetal(UINT8 **buffer);
|
||||
|
||||
// Your naming conventions are stupid and useless.
|
||||
// There is no conflict here.
|
||||
typedef struct demoghost {
|
||||
@@ -174,11 +165,9 @@ void G_ResetDemoRecording(void);
|
||||
void G_DoPlayDemo(char *defdemoname);
|
||||
void G_TimeDemo(const char *name);
|
||||
void G_AddGhost(char *defdemoname);
|
||||
void G_FreeGhosts(void);
|
||||
void G_UpdateStaffGhostName(lumpnum_t l);
|
||||
void G_DoPlayMetal(void);
|
||||
void G_DoneLevelLoad(void);
|
||||
void G_StopMetalDemo(void);
|
||||
ATTRNORETURN void FUNCNORETURN G_StopMetalRecording(void);
|
||||
void G_StopDemo(void);
|
||||
boolean G_CheckDemoStatus(void);
|
||||
void G_SaveDemo(void);
|
||||
|
||||
+170
-84
@@ -310,6 +310,8 @@ consvar_t cv_chatbacktint = {"chatbacktint", "On", CV_SAVE, CV_OnOff, NULL, 0, N
|
||||
static CV_PossibleValue_t consolechat_cons_t[] = {{0, "Window"}, {1, "Console"}, {2, "Window (Hidden)"}, {0, NULL}};
|
||||
consvar_t cv_consolechat = {"chatmode", "Window", CV_SAVE, consolechat_cons_t, NULL, 0, NULL, NULL, 0, 0, NULL};
|
||||
|
||||
consvar_t cv_chatcentertext = {"chatcentertext", "Off", CV_SAVE, CV_OnOff, NULL, 0, NULL, NULL, 0, 0, NULL};
|
||||
|
||||
// Pause game upon window losing focus
|
||||
consvar_t cv_pauseifunfocused = {"pauseifunfocused", "Yes", CV_SAVE, CV_YesNo, NULL, 0, NULL, NULL, 0, 0, NULL};
|
||||
|
||||
@@ -628,7 +630,6 @@ const char *G_BuildMapName(INT32 map)
|
||||
map = G_RandMap(G_TOLFlag(cv_newgametype.value), map, false, 0, false, NULL)+1;
|
||||
}
|
||||
|
||||
|
||||
if (map < 100 && map >= 0) // ...but why use signed integer in first place? idk but this prevents warning (and potential buffer overflow lol)
|
||||
sprintf(&mapname[3], "%.2d", map);
|
||||
else
|
||||
@@ -806,6 +807,60 @@ static fixed_t forwardmove[2] = {25<<FRACBITS>>16, 50<<FRACBITS>>16};
|
||||
static fixed_t sidemove[2] = {2<<FRACBITS>>16, 4<<FRACBITS>>16};
|
||||
static fixed_t angleturn[3] = {KART_FULLTURN/2, KART_FULLTURN, KART_FULLTURN/4}; // + slow turn
|
||||
|
||||
static void G_HandleLocalDriftturn(ticcmd_t *cmd, UINT8 ssplayer)
|
||||
{
|
||||
INT32 axis = 0;
|
||||
boolean turnleft, turnright;
|
||||
|
||||
const UINT8 forplayer = (ssplayer-1);
|
||||
|
||||
const boolean analogjoystickmove = cv_usejoystick[forplayer].value && !Joystick[forplayer].bGamepadStyle;
|
||||
const boolean gamepadjoystickmove = cv_usejoystick[forplayer].value && Joystick[forplayer].bGamepadStyle;
|
||||
|
||||
turnright = InputDown(gc_turnright, ssplayer);
|
||||
turnleft = InputDown(gc_turnleft, ssplayer);
|
||||
|
||||
axis = JoyAxis(AXISTURN, ssplayer);
|
||||
|
||||
if (encoremode)
|
||||
{
|
||||
turnright ^= turnleft; // swap these using three XORs
|
||||
turnleft ^= turnright;
|
||||
turnright ^= turnleft;
|
||||
axis = -axis;
|
||||
}
|
||||
|
||||
if (gamepadjoystickmove && axis != 0)
|
||||
{
|
||||
turnright = turnright || (axis > 0);
|
||||
turnleft = turnleft || (axis < 0);
|
||||
}
|
||||
|
||||
cmd->driftturn = 0;
|
||||
|
||||
// let movement keys cancel each other out
|
||||
if (turnright && !(turnleft))
|
||||
{
|
||||
cmd->driftturn = (INT16)(cmd->driftturn - (angleturn[1]));
|
||||
}
|
||||
else if (turnleft && !(turnright))
|
||||
{
|
||||
cmd->driftturn = (INT16)(cmd->driftturn + (angleturn[1]));
|
||||
}
|
||||
|
||||
if (analogjoystickmove && axis != 0)
|
||||
{
|
||||
// JOYAXISRANGE should be 1023 (divide by 1024)
|
||||
cmd->driftturn = (INT16)(cmd->driftturn - (((axis * angleturn[1]) >> 10)));
|
||||
}
|
||||
|
||||
if (cv_mouseturn.value)
|
||||
{
|
||||
//THIS WORKS WTF????????
|
||||
cmd->driftturn = (INT16)(cmd->driftturn - ((mousex*(encoremode ? -1 : 1)*8)));
|
||||
}
|
||||
}
|
||||
|
||||
//
|
||||
// G_BuildLocalTiccmd
|
||||
// extremely basic cut down ticcmd builder
|
||||
@@ -839,6 +894,16 @@ static void G_BuildLocalTiccmd(ticcmd_t *cmd, UINT8 ssplayer, boolean freecam)
|
||||
CHECKINPUT(gc_accelerate, AXISMOVE, BT_ACCELERATE);
|
||||
CHECKINPUT(gc_brake, AXISBRAKE, BT_BRAKE);
|
||||
|
||||
// for lua menus during spec
|
||||
axis = JoyAxis(AXISAIM, ssplayer);
|
||||
if (InputDown(gc_aimforward, ssplayer) || (usejoystick && axis < 0))
|
||||
cmd->buttons |= BT_FORWARD;
|
||||
if (InputDown(gc_aimbackward, ssplayer) || (usejoystick && axis > 0))
|
||||
cmd->buttons |= BT_BACKWARD;
|
||||
|
||||
G_HandleLocalDriftturn(cmd, ssplayer);
|
||||
//
|
||||
|
||||
#undef CHECKINPUT
|
||||
|
||||
moveinput = (InputDown(gc_turnleft, ssplayer) || InputDown(gc_turnright, ssplayer)
|
||||
@@ -883,7 +948,7 @@ void G_BuildTiccmd(ticcmd_t *cmd, INT32 realtics, UINT8 ssplayer)
|
||||
return;
|
||||
|
||||
const UINT8 forplayer = (ssplayer-1);
|
||||
player_t *player = ((ssplayer == 1) ? &players[consoleplayer] : &players[displayplayers[forplayer]]);
|
||||
player_t *player = P_GetLocalPlayerForNum(forplayer);
|
||||
|
||||
camera_t *thiscam = &camera[forplayer];
|
||||
const boolean freecam = camera[forplayer].freecam;
|
||||
@@ -896,22 +961,7 @@ void G_BuildTiccmd(ticcmd_t *cmd, INT32 realtics, UINT8 ssplayer)
|
||||
th = turnheld[forplayer];
|
||||
rd = resetdown[forplayer];
|
||||
|
||||
switch (ssplayer)
|
||||
{
|
||||
case 2:
|
||||
G_CopyTiccmd(cmd, I_BaseTiccmd2(), 1);
|
||||
break;
|
||||
case 3:
|
||||
G_CopyTiccmd(cmd, I_BaseTiccmd3(), 1);
|
||||
break;
|
||||
case 4:
|
||||
G_CopyTiccmd(cmd, I_BaseTiccmd4(), 1);
|
||||
break;
|
||||
case 1:
|
||||
default:
|
||||
G_CopyTiccmd(cmd, I_BaseTiccmd(), 1); // empty, or external driver
|
||||
break;
|
||||
}
|
||||
memset(cmd, 0, sizeof(ticcmd_t));
|
||||
|
||||
// why build a ticcmd if we're paused?
|
||||
// Or, for that matter, if we're being reborn.
|
||||
@@ -1162,6 +1212,27 @@ void G_BuildTiccmd(ticcmd_t *cmd, INT32 realtics, UINT8 ssplayer)
|
||||
}
|
||||
}
|
||||
|
||||
ticcmd_t *G_CopyTiccmd(ticcmd_t* dest, const ticcmd_t* src, const size_t n)
|
||||
{
|
||||
return M_Memcpy(dest, src, n*sizeof(*src));
|
||||
}
|
||||
|
||||
ticcmd_t *G_MoveTiccmd(ticcmd_t* dest, const ticcmd_t* src, const size_t n)
|
||||
{
|
||||
size_t i;
|
||||
for (i = 0; i < n; i++)
|
||||
{
|
||||
dest[i].forwardmove = src[i].forwardmove;
|
||||
dest[i].sidemove = src[i].sidemove;
|
||||
dest[i].angleturn = SHORT(src[i].angleturn);
|
||||
dest[i].aiming = (INT16)SHORT(src[i].aiming);
|
||||
dest[i].buttons = (UINT16)SHORT(src[i].buttons);
|
||||
dest[i].driftturn = (INT16)SHORT(src[i].driftturn);
|
||||
dest[i].latency = (INT16)SHORT(src[i].latency);
|
||||
}
|
||||
return dest;
|
||||
}
|
||||
|
||||
//
|
||||
// G_DoLoadLevel
|
||||
//
|
||||
@@ -1195,7 +1266,7 @@ static void G_DoLoadLevel(boolean resetplayer)
|
||||
}
|
||||
|
||||
// Setup the level.
|
||||
if (!P_SetupLevel(false,false))
|
||||
if (!P_SetupLevel(false, false))
|
||||
{
|
||||
// fail so reset game stuff
|
||||
Command_ExitGame_f();
|
||||
@@ -1793,11 +1864,11 @@ void G_Ticker(boolean run)
|
||||
{
|
||||
for (i = 0; i < MAXPLAYERS; i++) // read/write demo and check turbo cheat
|
||||
{
|
||||
cmd = &players[i].cmd;
|
||||
|
||||
if (!playeringame[i])
|
||||
continue;
|
||||
|
||||
cmd = &players[i].cmd;
|
||||
|
||||
//@TODO all this throwdir stuff shouldn't be here! But it stays for now to maintain 1.0.4 compat...
|
||||
// Remove for 1.1!
|
||||
|
||||
@@ -2355,23 +2426,23 @@ void G_SpawnPlayer(INT32 playernum, boolean starpost)
|
||||
{
|
||||
if (nummapthings)
|
||||
{
|
||||
if (playernum == consoleplayer
|
||||
|| (splitscreen && playernum == displayplayers[1])
|
||||
|| (splitscreen > 1 && playernum == displayplayers[2])
|
||||
|| (splitscreen > 2 && playernum == displayplayers[3]))
|
||||
CONS_Alert(CONS_ERROR, M_GetText("No player spawns found, spawning at the first mapthing!\n"));
|
||||
if (P_IsLocalPlayerNum(playernum))
|
||||
{
|
||||
CONS_Alert(CONS_ERROR, "No player spawns found, spawning at the first mapthing!\n");
|
||||
}
|
||||
|
||||
spawnpoint = &mapthings[0];
|
||||
}
|
||||
else
|
||||
{
|
||||
if (playernum == consoleplayer
|
||||
|| (splitscreen && playernum == displayplayers[1])
|
||||
|| (splitscreen > 1 && playernum == displayplayers[2])
|
||||
|| (splitscreen > 2 && playernum == displayplayers[3]))
|
||||
CONS_Alert(CONS_ERROR, M_GetText("No player spawns found, spawning at the origin!\n"));
|
||||
//P_MovePlayerToSpawn handles this fine if the spawnpoint is NULL.
|
||||
if (P_IsLocalPlayerNum(playernum))
|
||||
{
|
||||
CONS_Alert(CONS_ERROR, "No player spawns found, spawning at the origin!\n");
|
||||
//P_MovePlayerToSpawn handles this fine if the spawnpoint is NULL.
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
P_MovePlayerToSpawn(playernum, spawnpoint);
|
||||
|
||||
LUA_HookPlayer(&players[playernum], HOOK(PlayerSpawn)); // Lua hook for player spawning :)
|
||||
@@ -2383,11 +2454,11 @@ mapthing_t *G_FindCTFStart(INT32 playernum)
|
||||
|
||||
if (!numredctfstarts && !numbluectfstarts) //why even bother, eh?
|
||||
{
|
||||
if (playernum == consoleplayer
|
||||
|| (splitscreen && playernum == displayplayers[1])
|
||||
|| (splitscreen > 1 && playernum == displayplayers[2])
|
||||
|| (splitscreen > 2 && playernum == displayplayers[3]))
|
||||
CONS_Alert(CONS_WARNING, M_GetText("No CTF starts in this map!\n"));
|
||||
if (P_IsLocalPlayerNum(playernum))
|
||||
{
|
||||
CONS_Alert(CONS_WARNING, "No CTF starts in this map!\n");
|
||||
}
|
||||
|
||||
return NULL;
|
||||
}
|
||||
|
||||
@@ -2395,11 +2466,11 @@ mapthing_t *G_FindCTFStart(INT32 playernum)
|
||||
{
|
||||
if (!numredctfstarts)
|
||||
{
|
||||
if (playernum == consoleplayer
|
||||
|| (splitscreen && playernum == displayplayers[1])
|
||||
|| (splitscreen > 1 && playernum == displayplayers[2])
|
||||
|| (splitscreen > 2 && playernum == displayplayers[3]))
|
||||
CONS_Alert(CONS_WARNING, M_GetText("No Red Team starts in this map!\n"));
|
||||
if (P_IsLocalPlayerNum(playernum))
|
||||
{
|
||||
CONS_Alert(CONS_WARNING, "No Red Team starts in this map!\n");
|
||||
}
|
||||
|
||||
return NULL;
|
||||
}
|
||||
|
||||
@@ -2410,22 +2481,22 @@ mapthing_t *G_FindCTFStart(INT32 playernum)
|
||||
return redctfstarts[i];
|
||||
}
|
||||
|
||||
if (playernum == consoleplayer
|
||||
|| (splitscreen && playernum == displayplayers[1])
|
||||
|| (splitscreen > 1 && playernum == displayplayers[2])
|
||||
|| (splitscreen > 2 && playernum == displayplayers[3]))
|
||||
CONS_Alert(CONS_WARNING, M_GetText("Could not spawn at any Red Team starts!\n"));
|
||||
if (P_IsLocalPlayerNum(playernum))
|
||||
{
|
||||
CONS_Alert(CONS_WARNING, "Could not spawn at any Red Team starts!\n");
|
||||
}
|
||||
|
||||
return NULL;
|
||||
}
|
||||
else if (!players[playernum].ctfteam || players[playernum].ctfteam == 2) //blue
|
||||
{
|
||||
if (!numbluectfstarts)
|
||||
{
|
||||
if (playernum == consoleplayer
|
||||
|| (splitscreen && playernum == displayplayers[1])
|
||||
|| (splitscreen > 1 && playernum == displayplayers[2])
|
||||
|| (splitscreen > 2 && playernum == displayplayers[3]))
|
||||
CONS_Alert(CONS_WARNING, M_GetText("No Blue Team starts in this map!\n"));
|
||||
if (P_IsLocalPlayerNum(playernum))
|
||||
{
|
||||
CONS_Alert(CONS_WARNING, "No Blue Team starts in this map!\n");
|
||||
}
|
||||
|
||||
return NULL;
|
||||
}
|
||||
|
||||
@@ -2435,11 +2506,12 @@ mapthing_t *G_FindCTFStart(INT32 playernum)
|
||||
if (G_CheckSpot(playernum, bluectfstarts[i]))
|
||||
return bluectfstarts[i];
|
||||
}
|
||||
if (playernum == consoleplayer
|
||||
|| (splitscreen && playernum == displayplayers[1])
|
||||
|| (splitscreen > 1 && playernum == displayplayers[2])
|
||||
|| (splitscreen > 2 && playernum == displayplayers[3]))
|
||||
CONS_Alert(CONS_WARNING, M_GetText("Could not spawn at any Blue Team starts!\n"));
|
||||
|
||||
if (P_IsLocalPlayerNum(playernum))
|
||||
{
|
||||
CONS_Alert(CONS_WARNING, "Could not spawn at any Blue Team starts!\n");
|
||||
}
|
||||
|
||||
return NULL;
|
||||
}
|
||||
//should never be reached but it gets stuff to shut up
|
||||
@@ -2458,19 +2530,20 @@ mapthing_t *G_FindMatchStart(INT32 playernum)
|
||||
if (G_CheckSpot(playernum, deathmatchstarts[i]))
|
||||
return deathmatchstarts[i];
|
||||
}
|
||||
if (playernum == consoleplayer
|
||||
|| (splitscreen && playernum == displayplayers[1])
|
||||
|| (splitscreen > 1 && playernum == displayplayers[2])
|
||||
|| (splitscreen > 2 && playernum == displayplayers[3]))
|
||||
CONS_Alert(CONS_WARNING, M_GetText("Could not spawn at any Deathmatch starts!\n"));
|
||||
|
||||
if (P_IsLocalPlayerNum(playernum))
|
||||
{
|
||||
CONS_Alert(CONS_WARNING, "Could not spawn at any Deathmatch starts!\n");
|
||||
}
|
||||
|
||||
return NULL;
|
||||
}
|
||||
|
||||
if (playernum == consoleplayer
|
||||
|| (splitscreen && playernum == displayplayers[1])
|
||||
|| (splitscreen > 1 && playernum == displayplayers[2])
|
||||
|| (splitscreen > 2 && playernum == displayplayers[3]))
|
||||
CONS_Alert(CONS_WARNING, M_GetText("No Deathmatch starts in this map!\n"));
|
||||
if (P_IsLocalPlayerNum(playernum))
|
||||
{
|
||||
CONS_Alert(CONS_WARNING, "No Deathmatch starts in this map!\n");
|
||||
}
|
||||
|
||||
return NULL;
|
||||
}
|
||||
|
||||
@@ -2534,19 +2607,19 @@ mapthing_t *G_FindRaceStart(INT32 playernum)
|
||||
// Just spawn there.
|
||||
//return playerstarts[0];
|
||||
|
||||
if (playernum == consoleplayer
|
||||
|| (splitscreen && playernum == displayplayers[1])
|
||||
|| (splitscreen > 1 && playernum == displayplayers[2])
|
||||
|| (splitscreen > 2 && playernum == displayplayers[3]))
|
||||
CONS_Alert(CONS_WARNING, M_GetText("Could not spawn at any Race starts!\n"));
|
||||
if (P_IsLocalPlayerNum(playernum))
|
||||
{
|
||||
CONS_Alert(CONS_WARNING, "Could not spawn at any Race starts!\n");
|
||||
}
|
||||
|
||||
return NULL;
|
||||
}
|
||||
|
||||
if (playernum == consoleplayer
|
||||
|| (splitscreen && playernum == displayplayers[1])
|
||||
|| (splitscreen > 1 && playernum == displayplayers[2])
|
||||
|| (splitscreen > 2 && playernum == displayplayers[3]))
|
||||
CONS_Alert(CONS_WARNING, M_GetText("No Race starts in this map!\n"));
|
||||
if (P_IsLocalPlayerNum(playernum))
|
||||
{
|
||||
CONS_Alert(CONS_WARNING, "No Race starts in this map!\n");
|
||||
}
|
||||
|
||||
return NULL;
|
||||
}
|
||||
|
||||
@@ -2980,11 +3053,6 @@ static void G_DoCompleted(void)
|
||||
|
||||
gameaction = ga_nothing;
|
||||
|
||||
if (metalplayback)
|
||||
G_StopMetalDemo();
|
||||
if (metalrecording)
|
||||
G_StopMetalRecording();
|
||||
|
||||
K_StatRound();
|
||||
|
||||
for (i = 0; i < MAXPLAYERS; i++)
|
||||
@@ -3311,8 +3379,26 @@ void G_EndGame(void)
|
||||
}
|
||||
}
|
||||
|
||||
// 1100 or competitive multiplayer, so go back to title screen.
|
||||
D_StartTitle();
|
||||
if (netgame)
|
||||
{
|
||||
G_SetGamestate(GS_WAITINGPLAYERS); // hack to prevent a command repeat
|
||||
|
||||
if (server)
|
||||
{
|
||||
char mapname[6];
|
||||
|
||||
strlcpy(mapname, G_BuildMapName(spstage_start), sizeof (mapname));
|
||||
strlwr(mapname);
|
||||
mapname[5] = '\0';
|
||||
|
||||
COM_BufAddText(va("map %s\n", mapname));
|
||||
}
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
// Time to return to the menu.
|
||||
Command_ExitGame_f();
|
||||
}
|
||||
|
||||
//
|
||||
|
||||
+1
-1
@@ -49,7 +49,7 @@ extern tic_t timeinmap; // Ticker for time spent in level (used for levelcard di
|
||||
extern INT16 rw_maximums[NUM_WEAPONS];
|
||||
|
||||
// used in game menu
|
||||
extern consvar_t cv_chatwidth, cv_chatnotifications, cv_chatheight, cv_chattime, cv_consolechat, cv_chatbacktint, cv_chatspamprotection/*, cv_compactscoreboard*/;
|
||||
extern consvar_t cv_chatwidth, cv_chatnotifications, cv_chatheight, cv_chattime, cv_consolechat, cv_chatbacktint, cv_chatspamprotection, cv_chatcentertext/*, cv_compactscoreboard*/;
|
||||
extern consvar_t cv_songcredits;
|
||||
extern consvar_t cv_showfreeplay;
|
||||
extern consvar_t cv_growmusic, cv_supermusic;
|
||||
|
||||
+73
-38
@@ -99,7 +99,8 @@ void HWR_ProcessPolygon(FSurfaceInfo *pSurf, FOutVector *pOutVerts, FUINT iNumPt
|
||||
polygonArrayAllocSize *= 2;
|
||||
polygonArray = realloc(polygonArray, polygonArrayAllocSize * sizeof(PolygonArrayEntry));
|
||||
// also need to redo the index array, dont need to copy it though
|
||||
polygonArraySorted = realloc(polygonArraySorted, polygonArrayAllocSize * sizeof(PolygonArrayEntry*));
|
||||
free(polygonArraySorted);
|
||||
polygonArraySorted = malloc(polygonArrayAllocSize * sizeof(PolygonArrayEntry *));
|
||||
}
|
||||
|
||||
while (unsortedVertexArraySize + (int)iNumPts > unsortedVertexArrayAllocSize)
|
||||
@@ -118,8 +119,38 @@ void HWR_ProcessPolygon(FSurfaceInfo *pSurf, FOutVector *pOutVerts, FUINT iNumPt
|
||||
polygonArray[polygonArraySize].texture = current_texture;
|
||||
polygonArray[polygonArraySize].shader = (shader_target != SHADER_NONE) ? HWR_GetShaderFromTarget(shader_target) : shader_target;
|
||||
polygonArray[polygonArraySize].horizonSpecial = horizonSpecial;
|
||||
// default to maximum value so skybox ánd horizon lines come first
|
||||
polygonArray[polygonArraySize].hash = INT32_MIN+polygonArraySize;
|
||||
polygonArraySize++;
|
||||
|
||||
if (!(PolyFlags & PF_NoTexture) && !horizonSpecial)
|
||||
{
|
||||
// use FNV-1a to hash polygons for later sorting.
|
||||
INT32 hash = 0x811c9dc5;
|
||||
#define DIGEST(h, x) h ^= (x); h *= 0x01000193
|
||||
if (current_texture)
|
||||
{
|
||||
DIGEST(hash, current_texture->downloaded);
|
||||
}
|
||||
|
||||
DIGEST(hash, PolyFlags);
|
||||
DIGEST(hash, pSurf->PolyColor.rgba);
|
||||
|
||||
if (cv_glshaders.value && gl_shadersavailable)
|
||||
{
|
||||
DIGEST(hash, shader_target);
|
||||
DIGEST(hash, pSurf->TintColor.rgba);
|
||||
DIGEST(hash, pSurf->FadeColor.rgba);
|
||||
DIGEST(hash, pSurf->LightInfo.light_level);
|
||||
DIGEST(hash, pSurf->LightInfo.fade_start);
|
||||
DIGEST(hash, pSurf->LightInfo.fade_end);
|
||||
DIGEST(hash, pSurf->LightInfo.directional);
|
||||
}
|
||||
#undef DIGEST
|
||||
// remove the sign bit to ensure that skybox and horizon line comes first.
|
||||
polygonArray[polygonArraySize-1].hash = (hash & INT32_MAX);
|
||||
}
|
||||
|
||||
memcpy(&unsortedVertexArray[unsortedVertexArraySize], pOutVerts, iNumPts * sizeof(FOutVector));
|
||||
unsortedVertexArraySize += iNumPts;
|
||||
}
|
||||
@@ -345,52 +376,56 @@ void HWR_RenderBatches(void)
|
||||
{
|
||||
// check if a state change is required, set the change bools and next vars
|
||||
const PolygonArrayEntry *nextEntry = polygonArraySorted[polygonReadPos];
|
||||
nextShader = nextEntry->shader;
|
||||
nextTexture = nextEntry->texture;
|
||||
nextPolyFlags = nextEntry->polyFlags;
|
||||
nextSurfaceInfo = nextEntry->surf;
|
||||
|
||||
if (nextPolyFlags & PF_NoTexture)
|
||||
nextTexture = 0;
|
||||
|
||||
if (currentShader != nextShader && HWR_UseShader())
|
||||
if (entry->hash != nextEntry->hash)
|
||||
{
|
||||
changeState = true;
|
||||
changeShader = true;
|
||||
}
|
||||
nextShader = nextEntry->shader;
|
||||
nextTexture = nextEntry->texture;
|
||||
nextPolyFlags = nextEntry->polyFlags;
|
||||
nextSurfaceInfo = nextEntry->surf;
|
||||
|
||||
if (currentTexture != nextTexture)
|
||||
{
|
||||
changeState = true;
|
||||
changeTexture = true;
|
||||
}
|
||||
if (nextPolyFlags & PF_NoTexture)
|
||||
nextTexture = 0;
|
||||
|
||||
if (currentPolyFlags != nextPolyFlags)
|
||||
{
|
||||
changeState = true;
|
||||
changePolyFlags = true;
|
||||
}
|
||||
|
||||
if (HWR_UseShader())
|
||||
{
|
||||
if (currentSurfaceInfo.PolyColor.rgba != nextSurfaceInfo.PolyColor.rgba ||
|
||||
currentSurfaceInfo.TintColor.rgba != nextSurfaceInfo.TintColor.rgba ||
|
||||
currentSurfaceInfo.FadeColor.rgba != nextSurfaceInfo.FadeColor.rgba ||
|
||||
currentSurfaceInfo.LightInfo.light_level != nextSurfaceInfo.LightInfo.light_level ||
|
||||
currentSurfaceInfo.LightInfo.fade_start != nextSurfaceInfo.LightInfo.fade_start ||
|
||||
currentSurfaceInfo.LightInfo.fade_end != nextSurfaceInfo.LightInfo.fade_end ||
|
||||
currentSurfaceInfo.LightInfo.directional != nextSurfaceInfo.LightInfo.directional)
|
||||
if (currentShader != nextShader && HWR_UseShader())
|
||||
{
|
||||
changeState = true;
|
||||
changeSurfaceInfo = true;
|
||||
changeShader = true;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if (currentSurfaceInfo.PolyColor.rgba != nextSurfaceInfo.PolyColor.rgba)
|
||||
|
||||
if (currentTexture != nextTexture)
|
||||
{
|
||||
changeState = true;
|
||||
changeSurfaceInfo = true;
|
||||
changeTexture = true;
|
||||
}
|
||||
|
||||
if (currentPolyFlags != nextPolyFlags)
|
||||
{
|
||||
changeState = true;
|
||||
changePolyFlags = true;
|
||||
}
|
||||
|
||||
if (HWR_UseShader())
|
||||
{
|
||||
if (currentSurfaceInfo.PolyColor.rgba != nextSurfaceInfo.PolyColor.rgba ||
|
||||
currentSurfaceInfo.TintColor.rgba != nextSurfaceInfo.TintColor.rgba ||
|
||||
currentSurfaceInfo.FadeColor.rgba != nextSurfaceInfo.FadeColor.rgba ||
|
||||
currentSurfaceInfo.LightInfo.light_level != nextSurfaceInfo.LightInfo.light_level ||
|
||||
currentSurfaceInfo.LightInfo.fade_start != nextSurfaceInfo.LightInfo.fade_start ||
|
||||
currentSurfaceInfo.LightInfo.fade_end != nextSurfaceInfo.LightInfo.fade_end ||
|
||||
currentSurfaceInfo.LightInfo.directional != nextSurfaceInfo.LightInfo.directional)
|
||||
{
|
||||
changeState = true;
|
||||
changeSurfaceInfo = true;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if (currentSurfaceInfo.PolyColor.rgba != nextSurfaceInfo.PolyColor.rgba)
|
||||
{
|
||||
changeState = true;
|
||||
changeSurfaceInfo = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -31,6 +31,7 @@ typedef struct
|
||||
int shader;
|
||||
// this tells batching that the plane belongs to a horizon line and must be drawn in correct order with the skywalls
|
||||
boolean horizonSpecial;
|
||||
INT32 hash;
|
||||
} PolygonArrayEntry;
|
||||
|
||||
void HWR_StartBatching(void);
|
||||
|
||||
+15
-23
@@ -36,7 +36,11 @@ extrasubsector_t *extrasubsectors = NULL;
|
||||
// newsubsectors are subsectors without segs, added for the plane polygons
|
||||
#define NEWSUBSECTORS 50
|
||||
static size_t totsubsectors;
|
||||
#ifdef PARANOIA
|
||||
size_t addsubsector;
|
||||
#else
|
||||
static size_t addsubsector;
|
||||
#endif
|
||||
|
||||
typedef struct
|
||||
{
|
||||
@@ -70,7 +74,7 @@ static INT32 totalsubsecpolys = 0;
|
||||
static poly_t *HWR_AllocPoly(INT32 numpts)
|
||||
{
|
||||
poly_t *p;
|
||||
size_t size = sizeof (poly_t) + sizeof (polyvertex_t) * numpts;
|
||||
size_t size = sizeof(poly_t) + sizeof(polyvertex_t) * numpts;
|
||||
p = Z_Malloc(size, PU_HWRPLANE, NULL);
|
||||
p->numpts = numpts;
|
||||
return p;
|
||||
@@ -79,7 +83,7 @@ static poly_t *HWR_AllocPoly(INT32 numpts)
|
||||
static polyvertex_t *HWR_AllocVertex(void)
|
||||
{
|
||||
polyvertex_t *p;
|
||||
size_t size = sizeof (polyvertex_t);
|
||||
size_t size = sizeof(polyvertex_t);
|
||||
p = Z_Malloc(size, PU_HWRPLANE, NULL);
|
||||
return p;
|
||||
}
|
||||
@@ -175,9 +179,9 @@ static void SplitPoly (fdivline_t *bsp, //splitting parametric line
|
||||
|
||||
INT32 ps = -1, pe = -1;
|
||||
INT32 nptfront, nptback;
|
||||
polyvertex_t vs = {0,0,0};
|
||||
polyvertex_t ve = {0,0,0};
|
||||
polyvertex_t lastpv = {0,0,0};
|
||||
polyvertex_t vs = {};
|
||||
polyvertex_t ve = {};
|
||||
polyvertex_t lastpv = {};
|
||||
float fracs = 0.0f, frace = 0.0f; //used to tell which poly is on
|
||||
// the front side of the bsp partition line
|
||||
INT32 psonline = 0, peonline = 0;
|
||||
@@ -349,8 +353,8 @@ static poly_t *CutOutSubsecPoly(seg_t *lseg, INT32 count, poly_t *poly)
|
||||
INT32 i, j;
|
||||
polyvertex_t *pv;
|
||||
INT32 nump = 0, ps, pe;
|
||||
polyvertex_t vs = {0, 0, 0}, ve = {0, 0, 0},
|
||||
p1 = {0, 0, 0}, p2 = {0, 0, 0};
|
||||
polyvertex_t vs = {}, ve = {},
|
||||
p1 = {}, p2 = {};
|
||||
float fracs = 0.0f;
|
||||
fdivline_t cutseg; // x, y, dx, dy as start of node_t struct
|
||||
poly_t *temppoly;
|
||||
@@ -937,22 +941,10 @@ static void AdjustSegs(void)
|
||||
lseg->pv2 = pv;
|
||||
}
|
||||
|
||||
// recompute length
|
||||
{
|
||||
float x,y;
|
||||
|
||||
const polyvertex_t *pv1 = (polyvertex_t *)lseg->pv1;
|
||||
const polyvertex_t *pv2 = (polyvertex_t *)lseg->pv2;
|
||||
|
||||
x = pv2->x - pv1->x + 0.5f;
|
||||
y = pv2->y - pv1->y + 0.5f;
|
||||
|
||||
lseg->flength = hypotf(x, y);
|
||||
|
||||
// BP: debug see this kind of segs
|
||||
//if (nearv2 > NEARDIST*NEARDIST || nearv1 > NEARDIST*NEARDIST)
|
||||
// lseg->length = 1;
|
||||
}
|
||||
lseg->pv1->x2 = FloatToFixed(lseg->pv1->x);
|
||||
lseg->pv1->y2 = FloatToFixed(lseg->pv1->y);
|
||||
lseg->pv2->x2 = FloatToFixed(lseg->pv2->x);
|
||||
lseg->pv2->y2 = FloatToFixed(lseg->pv2->y);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
+104
-121
@@ -38,6 +38,8 @@ INT32 textureformat = GL_TEXFMT_P_8; // use chromakey for hole
|
||||
|
||||
RGBA_t mapPalette[256] = {0}; // the palette for the currently loaded level or menu etc.
|
||||
|
||||
static void HWR_FreeTextureColormaps(patch_t *patch);
|
||||
|
||||
static INT32 format2bpp(GLTextureFormat_t format)
|
||||
{
|
||||
switch (format)
|
||||
@@ -320,15 +322,13 @@ static void HWR_GenerateTexture(INT32 texnum, GLMapTexture_t *gltex, boolean noe
|
||||
INT32 i, idx;
|
||||
boolean skyspecial = false; // poor hack for Legacy large skies..
|
||||
|
||||
RGBA_t *palette;
|
||||
|
||||
texture = textures[texnum];
|
||||
|
||||
gltex->mipmap.flags = TF_CHROMAKEYED | TF_WRAPXY;
|
||||
gltex->mipmap.format = textureformat;
|
||||
|
||||
// hack the Legacy skies..
|
||||
if (UNLIKELY(strncmp(texture->name, "SKY", 3) == 0 &&
|
||||
if (UNLIKELY(memcmp(texture->name, "SKY", 3) == 0 &&
|
||||
(texture->name[4] == 0 || texture->name[5] == 0)))
|
||||
{
|
||||
skyspecial = true;
|
||||
@@ -358,7 +358,7 @@ static void HWR_GenerateTexture(INT32 texnum, GLMapTexture_t *gltex, boolean noe
|
||||
INT32 j;
|
||||
RGBA_t col;
|
||||
|
||||
palette = HWR_GetTexturePalette();
|
||||
const RGBA_t *palette = HWR_GetTexturePalette();
|
||||
|
||||
col = palette[HWR_CHROMAKEY_EQUIVALENTCOLORINDEX];
|
||||
|
||||
@@ -440,7 +440,7 @@ void HWR_MakePatch(const patch_t *patch, GLPatch_t *glPatch, GLMipmap_t *glMipma
|
||||
static size_t gl_numtextures = 0; // Texture count
|
||||
static GLMapTexture_t *gl_textures; // For all textures
|
||||
|
||||
void HWR_FreeTextureData(patch_t *patch)
|
||||
static void HWR_FreeTextureData(patch_t *patch)
|
||||
{
|
||||
GLPatch_t *glPatch;
|
||||
|
||||
@@ -451,8 +451,8 @@ void HWR_FreeTextureData(patch_t *patch)
|
||||
|
||||
if (vid.glstate == VID_GL_LIBRARY_LOADED)
|
||||
GL_DeleteTexture(glPatch->mipmap);
|
||||
if (glPatch->mipmap->data)
|
||||
Z_Free(glPatch->mipmap->data);
|
||||
|
||||
Z_Free(glPatch->mipmap->data);
|
||||
}
|
||||
|
||||
void HWR_FreeTexture(patch_t *patch)
|
||||
@@ -479,7 +479,7 @@ void HWR_FreeTexture(patch_t *patch)
|
||||
}
|
||||
|
||||
// Called by HWR_FreePatchCache.
|
||||
void HWR_FreeTextureColormaps(patch_t *patch)
|
||||
static void HWR_FreeTextureColormaps(patch_t *patch)
|
||||
{
|
||||
GLPatch_t *pat;
|
||||
|
||||
@@ -512,10 +512,8 @@ void HWR_FreeTextureColormaps(patch_t *patch)
|
||||
pat->mipmap->nextcolormap = next->nextcolormap;
|
||||
|
||||
// Free image data from memory.
|
||||
if (next->data)
|
||||
Z_Free(next->data);
|
||||
if (next->colormap)
|
||||
Z_Free(next->colormap);
|
||||
Z_Free(next->data);
|
||||
Z_Free(next->colormap);
|
||||
next->data = NULL;
|
||||
next->colormap = NULL;
|
||||
GL_DeleteTexture(next);
|
||||
@@ -559,10 +557,10 @@ void HWR_ClearAllTextures(void)
|
||||
HWR_FreePatchCache(true);
|
||||
}
|
||||
|
||||
void HWR_FreeColormapCache(void)
|
||||
/*static void HWR_FreeColormapCache(void)
|
||||
{
|
||||
HWR_FreePatchCache(false);
|
||||
}
|
||||
}*/
|
||||
|
||||
void HWR_InitMapTextures(void)
|
||||
{
|
||||
@@ -572,8 +570,7 @@ void HWR_InitMapTextures(void)
|
||||
static void FreeMapTexture(GLMapTexture_t *tex)
|
||||
{
|
||||
GL_DeleteTexture(&tex->mipmap);
|
||||
if (tex->mipmap.data)
|
||||
Z_Free(tex->mipmap.data);
|
||||
Z_Free(tex->mipmap.data);
|
||||
tex->mipmap.data = NULL;
|
||||
}
|
||||
|
||||
@@ -600,7 +597,6 @@ void HWR_FreeMapTextures(void)
|
||||
|
||||
static void HWR_PrecacheLevelFlats(void)
|
||||
{
|
||||
levelflat_t levelflat;
|
||||
lumpnum_t lump;
|
||||
size_t i, j;
|
||||
INT32 k;
|
||||
@@ -614,28 +610,22 @@ static void HWR_PrecacheLevelFlats(void)
|
||||
{
|
||||
sector_t *sec = §ors[i];
|
||||
|
||||
// sector checked already?
|
||||
if (sec->validcount == validcount)
|
||||
continue;
|
||||
|
||||
sec->validcount = validcount;
|
||||
|
||||
// gotta check sector floor and ceiling
|
||||
for (j = 0; j < 2; j++)
|
||||
{
|
||||
const boolean ceiling = (j == 0);
|
||||
INT32 pic = ceiling ? sec->ceilingpic : sec->floorpic;
|
||||
const INT32 pic = ceiling ? sec->ceilingpic : sec->floorpic;
|
||||
|
||||
levelflat = levelflats[pic];
|
||||
const levelflat_t *levelflat = &levelflats[pic];
|
||||
|
||||
lump = levelflat.lumpnum;
|
||||
lump = levelflat->lumpnum;
|
||||
HWR_GetFlat(lump, R_NoEncore(sec, ceiling));
|
||||
|
||||
if (levelflat.speed) // it is an animated flat
|
||||
if (levelflat->speed) // it is an animated flat
|
||||
{
|
||||
for (k = 1; k < levelflat.numpics; k++)
|
||||
for (k = 1; k < levelflat->numpics; k++)
|
||||
{
|
||||
lump = levelflat.baselumpnum + k;
|
||||
lump = levelflat->baselumpnum + k;
|
||||
HWR_GetFlat(lump, R_NoEncore(sec, ceiling));
|
||||
}
|
||||
}
|
||||
@@ -649,18 +639,18 @@ static void HWR_PrecacheLevelFlats(void)
|
||||
// just load every flat in the level
|
||||
for (i = 0; i < numlevelflats; i++)
|
||||
{
|
||||
levelflat = levelflats[i];
|
||||
lump = levelflat.lumpnum;
|
||||
const levelflat_t *levelflat = &levelflats[i];
|
||||
lump = levelflat->lumpnum;
|
||||
|
||||
HWR_GetFlat(lump, false);
|
||||
|
||||
if (levelflat.speed) // it is an animated flat
|
||||
if (!levelflat->speed) // is it an animated flat ?
|
||||
continue;
|
||||
|
||||
for (k = 1; k < levelflat->numpics; k++)
|
||||
{
|
||||
for (k = 1; k < levelflat.numpics; k++)
|
||||
{
|
||||
lump = levelflat.baselumpnum + k;
|
||||
HWR_GetFlat(lump, false);
|
||||
}
|
||||
lump = levelflat->baselumpnum + k;
|
||||
HWR_GetFlat(lump, false);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -670,52 +660,55 @@ static void HWR_PrecacheLevelTextures(void)
|
||||
{
|
||||
char *texturepresent;
|
||||
anim_t *anim;
|
||||
size_t i, j;
|
||||
size_t i, j, f;
|
||||
INT32 h;
|
||||
|
||||
texturepresent = calloc(numtextures, sizeof (*texturepresent));
|
||||
if (texturepresent == NULL) I_Error("%s: Out of memory looking up textures", "HWR_PrecacheLevel");
|
||||
if (texturepresent == NULL)
|
||||
I_Error("%s: Out of memory looking up textures", "HWR_PrecacheLevel");
|
||||
|
||||
// Sky texture is always present.
|
||||
// Note that F_SKY1 is the name used to indicate a sky floor/ceiling as a flat,
|
||||
// while the sky texture is stored like a wall texture, with a skynum dependent name.
|
||||
texturepresent[skytexture] = 1;
|
||||
HWR_GetTexture(skytexture, false);
|
||||
|
||||
for (i = 0; i < numlines; i++)
|
||||
{
|
||||
line_t *line = &lines[i];
|
||||
const line_t *line = &lines[i];
|
||||
#ifdef GLENCORE
|
||||
const int noencoremap = ((line->flags & ML_TFERLINE) ? 2 : 1);
|
||||
const int noencoremap = ((encoremap && (line->flags & ML_TFERLINE)) ? 2 : 1);
|
||||
#else
|
||||
const int noencoremap = 1;
|
||||
#endif
|
||||
|
||||
// line checked already?
|
||||
if (line->validcount == validcount)
|
||||
continue;
|
||||
|
||||
line->validcount = validcount;
|
||||
|
||||
// two sides
|
||||
for (j = 0; j < 2; j++)
|
||||
{
|
||||
side_t *side = &sides[line->sidenum[j]];
|
||||
|
||||
// Single-side linedef
|
||||
// check if single-sided linedef
|
||||
if (line->sidenum[j] == 0xffff)
|
||||
continue;
|
||||
|
||||
if (side->toptexture >= 0 && side->toptexture < numtextures)
|
||||
const side_t *side = &sides[line->sidenum[j]];
|
||||
const INT32 sidetex[] = {side->toptexture, side->midtexture, side->bottomtexture};
|
||||
|
||||
// gotta check from top to bottom uwu
|
||||
for (f = 0; f < 3; f++)
|
||||
{
|
||||
texturepresent[side->toptexture] = 1|noencoremap;
|
||||
}
|
||||
if (side->midtexture >= 0 && side->midtexture < numtextures)
|
||||
{
|
||||
texturepresent[side->midtexture] = 1|noencoremap;
|
||||
}
|
||||
if (side->bottomtexture >= 0 && side->bottomtexture < numtextures)
|
||||
{
|
||||
texturepresent[side->bottomtexture] = 1|noencoremap;
|
||||
const INT32 texnum = sidetex[f];
|
||||
if (texnum < 0 || texnum >= numtextures || texturepresent[texnum])
|
||||
continue;
|
||||
|
||||
texturepresent[texnum] = 1|noencoremap;
|
||||
|
||||
HWR_GetTexture(texnum, false);
|
||||
#ifdef GLENCORE
|
||||
if (noencoremap & 2)
|
||||
HWR_GetTexture(texnum, true);
|
||||
#endif
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// check for animated textures
|
||||
for (anim = anims; anim < lastanim; anim++)
|
||||
{
|
||||
if (!anim->istexture)
|
||||
@@ -726,47 +719,21 @@ static void HWR_PrecacheLevelTextures(void)
|
||||
if (!texpresent)
|
||||
continue;
|
||||
|
||||
if (texpresent & 1)
|
||||
for (h = 1; h < anim->numpics; h++)
|
||||
{
|
||||
for (h = 1; h < anim->numpics; h++)
|
||||
if (texpresent & 1)
|
||||
{
|
||||
HWR_GetTexture(anim->basepic+h, false);
|
||||
}
|
||||
}
|
||||
#ifdef GLENCORE
|
||||
if (texpresent & 2)
|
||||
{
|
||||
for (h = 1; h < anim->numpics; h++)
|
||||
if (texpresent & 2)
|
||||
{
|
||||
HWR_GetTexture(anim->basepic+h, true);
|
||||
}
|
||||
}
|
||||
#endif
|
||||
}
|
||||
}
|
||||
|
||||
// Sky texture is always present.
|
||||
// Note that F_SKY1 is the name used to indicate a sky floor/ceiling as a flat,
|
||||
// while the sky texture is stored like a wall texture, with a skynum dependent name.
|
||||
texturepresent[skytexture] = 1;
|
||||
|
||||
for (i = 0; i < (unsigned)numtextures; i++)
|
||||
{
|
||||
const char texpresent = texturepresent[i];
|
||||
|
||||
if (!texpresent)
|
||||
continue;
|
||||
|
||||
if (texpresent & 1)
|
||||
{
|
||||
HWR_GetTexture(i, false);
|
||||
}
|
||||
#ifdef GLENCORE
|
||||
if (texpresent & 2)
|
||||
{
|
||||
HWR_GetTexture(i, true);
|
||||
}
|
||||
#endif
|
||||
}
|
||||
free(texturepresent);
|
||||
}
|
||||
|
||||
@@ -775,21 +742,19 @@ static void HWR_PrecacheLevelSprites(void)
|
||||
patch_t *spritepatch;
|
||||
char *spritepresent;
|
||||
size_t i, j, k;
|
||||
lumpnum_t lump;
|
||||
|
||||
thinker_t *th;
|
||||
mobj_t *mo;
|
||||
spriteframe_t *sf;
|
||||
|
||||
spritepresent = calloc(numsprites, sizeof (*spritepresent));
|
||||
if (spritepresent == NULL) I_Error("%s: Out of memory looking up sprites", "HWR_PrecacheLevel");
|
||||
if (spritepresent == NULL)
|
||||
I_Error("%s: Out of memory looking up sprites", "HWR_PrecacheLevel");
|
||||
|
||||
for (th = thinkercap.next; th != &thinkercap; th = th->next)
|
||||
{
|
||||
if (th->function != (actionf_p1)P_MobjThinker)
|
||||
continue;
|
||||
|
||||
mo = (mobj_t *)th;
|
||||
const mobj_t *mo = (mobj_t *)th;
|
||||
|
||||
// ogl is weird
|
||||
// for some reason it does not want to preload sprites with colormaps
|
||||
@@ -807,10 +772,10 @@ static void HWR_PrecacheLevelSprites(void)
|
||||
|
||||
for (j = 0; j < sprites[i].numframes; j++)
|
||||
{
|
||||
sf = &sprites[i].spriteframes[j];
|
||||
const spriteframe_t *sf = &sprites[i].spriteframes[j];
|
||||
|
||||
#define cacheang(a) {\
|
||||
lump = sf->lumppat[a];\
|
||||
const lumpnum_t lump = sf->lumppat[a];\
|
||||
spritepatch = (patch_t *)W_CachePatchNum(lump, PU_SPRITE);\
|
||||
if (spritepatch != NULL)\
|
||||
HWR_GetPatch(spritepatch);\
|
||||
@@ -892,12 +857,14 @@ GLMapTexture_t *HWR_GetTexture(INT32 tex, boolean noencore)
|
||||
#endif
|
||||
|
||||
// Generate texture if missing from the cache
|
||||
if (!gltex->mipmap.data && !gltex->mipmap.downloaded)
|
||||
HWR_GenerateTexture(tex, gltex, noencore);
|
||||
|
||||
// If hardware does not have the texture, then call GL_SetTexture to upload it
|
||||
if (!gltex->mipmap.downloaded)
|
||||
{
|
||||
if (!gltex->mipmap.data)
|
||||
HWR_GenerateTexture(tex, gltex, noencore);
|
||||
|
||||
// If hardware does not have the texture, then call GL_SetTexture to upload it
|
||||
GL_SetTexture(&gltex->mipmap);
|
||||
}
|
||||
HWR_SetCurrentTexture(&gltex->mipmap);
|
||||
|
||||
// The system-memory data can be purged now.
|
||||
@@ -913,6 +880,7 @@ static void HWR_CacheFlat(GLMipmap_t *glMipmap, lumpnum_t flatlumpnum)
|
||||
size_t steppy;
|
||||
#endif
|
||||
size_t size, pflatsize;
|
||||
boolean haschromakey = false;
|
||||
|
||||
// setup the texture info
|
||||
glMipmap->format = GL_TEXFMT_P_8;
|
||||
@@ -945,8 +913,7 @@ static void HWR_CacheFlat(GLMipmap_t *glMipmap, lumpnum_t flatlumpnum)
|
||||
break;
|
||||
}
|
||||
|
||||
glMipmap->width = (UINT16)pflatsize;
|
||||
glMipmap->height = (UINT16)pflatsize;
|
||||
glMipmap->width = glMipmap->height = (UINT16)pflatsize;
|
||||
|
||||
// the flat raw data needn't be converted with palettized textures
|
||||
W_ReadLump(flatlumpnum, Z_Malloc(size, PU_HWRCACHE, &glMipmap->data));
|
||||
@@ -956,11 +923,25 @@ static void HWR_CacheFlat(GLMipmap_t *glMipmap, lumpnum_t flatlumpnum)
|
||||
for (steppy = 0; steppy < size; steppy++)
|
||||
{
|
||||
if (flat[steppy] == HWR_PATCHES_CHROMAKEY_COLORINDEX)
|
||||
{
|
||||
haschromakey = true;
|
||||
continue;
|
||||
}
|
||||
|
||||
flat[steppy] = glMipmap->colormap->source[flat[steppy]];
|
||||
}
|
||||
#endif
|
||||
|
||||
if (haschromakey)
|
||||
{
|
||||
const char *flatname = W_CheckNameForNum(flatlumpnum);
|
||||
|
||||
// hack for gba rainbow roads cyan floors
|
||||
if (UNLIKELY(memcmp(flatname, "GBA_RRF5", 8) == 0 && flatname[8] == 0))
|
||||
{
|
||||
glMipmap->flags &= ~TF_CHROMAKEYED;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Download a Doom 'flat' to the hardware cache and make it ready for use
|
||||
@@ -987,12 +968,14 @@ void HWR_GetFlat(lumpnum_t flatlumpnum, boolean noencoremap)
|
||||
M_Memcpy(glMipmap->colormap->data, colormap, 256 * sizeof(UINT8));
|
||||
}
|
||||
|
||||
if (!glMipmap->downloaded && !glMipmap->data)
|
||||
HWR_CacheFlat(glMipmap, flatlumpnum);
|
||||
|
||||
// If hardware does not have the texture, then call GL_SetTexture to upload it
|
||||
if (!glMipmap->downloaded)
|
||||
{
|
||||
if (!glMipmap->data)
|
||||
HWR_CacheFlat(glMipmap, flatlumpnum);
|
||||
|
||||
// If hardware does not have the texture, then call GL_SetTexture to upload it
|
||||
GL_SetTexture(glMipmap);
|
||||
}
|
||||
HWR_SetCurrentTexture(glMipmap);
|
||||
|
||||
// The system-memory data can be purged now.
|
||||
@@ -1006,12 +989,14 @@ static void HWR_LoadPatchMipmap(patch_t *patch, GLMipmap_t *glMipmap)
|
||||
{
|
||||
GLPatch_t *glPatch = patch->hardware;
|
||||
|
||||
if (!glMipmap->downloaded && !glMipmap->data)
|
||||
HWR_MakePatch(patch, glPatch, glMipmap, true);
|
||||
|
||||
// If hardware does not have the texture, then call GL_SetTexture to upload it
|
||||
if (!glMipmap->downloaded)
|
||||
{
|
||||
if (!glMipmap->data)
|
||||
HWR_MakePatch(patch, glPatch, glMipmap, true);
|
||||
|
||||
// If hardware does not have the texture, then call GL_SetTexture to upload it
|
||||
GL_SetTexture(glMipmap);
|
||||
}
|
||||
HWR_SetCurrentTexture(glMipmap);
|
||||
|
||||
// The system-memory data can be purged now.
|
||||
@@ -1070,11 +1055,11 @@ void HWR_GetMappedPatch(patch_t *patch, const UINT8 *colormap)
|
||||
|
||||
// search for the mipmap
|
||||
// skip the first (no colormap translated)
|
||||
for (glMipmap = glPatch->mipmap; LIKELY(glMipmap->nextcolormap);)
|
||||
for (glMipmap = glPatch->mipmap; glMipmap->nextcolormap;)
|
||||
{
|
||||
glMipmap = glMipmap->nextcolormap;
|
||||
|
||||
if (UNLIKELY(glMipmap->colormap && glMipmap->colormap->source == colormap))
|
||||
if (glMipmap->colormap && glMipmap->colormap->source == colormap)
|
||||
{
|
||||
if (memcmp(glMipmap->colormap->data, colormap, 256 * sizeof(UINT8)))
|
||||
{
|
||||
@@ -1143,11 +1128,10 @@ static void HWR_DrawFadeMaskInCache(GLMipmap_t *mipmap, INT32 pblockwidth, INT32
|
||||
UINT8 *flat;
|
||||
UINT8 *dest, *src, texel;
|
||||
RGBA_t col;
|
||||
RGBA_t *palette = HWR_GetTexturePalette();
|
||||
const RGBA_t *palette = HWR_GetTexturePalette();
|
||||
|
||||
// Place the flats data into flat
|
||||
W_ReadLump(fademasklumpnum, Z_Malloc(W_LumpLength(fademasklumpnum),
|
||||
PU_HWRCACHE, &flat));
|
||||
W_ReadLump(fademasklumpnum, Z_Malloc(W_LumpLength(fademasklumpnum), PU_HWRCACHE, &flat));
|
||||
|
||||
stepy = ((INT32)fmheight<<FRACBITS)/pblockheight;
|
||||
stepx = ((INT32)fmwidth<<FRACBITS)/pblockwidth;
|
||||
@@ -1370,7 +1354,7 @@ void HWR_SetMapPalette(void)
|
||||
|
||||
// Creates a hardware lighttable from the supplied lighttable.
|
||||
// Returns the id of the hw lighttable, usable in FSurfaceInfo.
|
||||
UINT32 HWR_CreateLightTable(UINT8 *lighttable)
|
||||
static UINT32 HWR_CreateLightTable(UINT8 *lighttable)
|
||||
{
|
||||
UINT32 i, id;
|
||||
RGBA_t *palette = HWR_GetTexturePalette();
|
||||
@@ -1418,8 +1402,7 @@ UINT32 HWR_GetLightTableID(extracolormap_t *colormap)
|
||||
// call become invalid and must not be used.
|
||||
void HWR_ClearLightTables(void)
|
||||
{
|
||||
if (vid.glstate == VID_GL_LIBRARY_LOADED)
|
||||
GL_ClearLightTables();
|
||||
GL_ClearLightTables();
|
||||
}
|
||||
|
||||
#endif //HWRENDER
|
||||
@@ -331,8 +331,8 @@ angle_t gld_FrustumAngle(angle_t tiltangle)
|
||||
|
||||
// ok, this is a gross hack that barely works...
|
||||
// but at least it doesn't overestimate too much...
|
||||
clipfov = atan(1 / projMatrix[0]) * 360.0f / M_PIl;
|
||||
floatangle = 2.0f + (45.0f + (tilt / 1.9f)) * clipfov / 90.0f;
|
||||
clipfov = atan(1 / (GLdouble)projMatrix[0]) * 360.0 / M_PIl;
|
||||
floatangle = 2.0 + (45.0 + ((double)tilt / 1.9)) * clipfov / 90.0;
|
||||
if (floatangle >= 180.0)
|
||||
return 0xffffffff;
|
||||
a1 = (angle_t)xs_CRoundToInt(ANG1 * floatangle);
|
||||
|
||||
@@ -19,7 +19,7 @@
|
||||
#ifndef _HWR_DEFS_
|
||||
#define _HWR_DEFS_
|
||||
#include "../doomtype.h"
|
||||
#include "../r_defs.h"
|
||||
#include "../m_fixed.h"
|
||||
|
||||
#define ZCLIP_PLANE 4.0f // Used for the actual game drawing
|
||||
#define NZCLIP_PLANE 0.9f // Seems to be only used for the HUD and screen textures
|
||||
@@ -95,9 +95,8 @@ typedef struct
|
||||
// a vertex of a Doom 'plane' polygon
|
||||
typedef struct
|
||||
{
|
||||
float x;
|
||||
float y;
|
||||
float z;
|
||||
float x, y, z;
|
||||
fixed_t x2, y2, z2;
|
||||
} polyvertex_t;
|
||||
|
||||
#ifdef _MSC_VER
|
||||
|
||||
@@ -496,7 +496,7 @@ void HWR_DrawCroppedPatch(patch_t *gpatch, fixed_t x, fixed_t y, fixed_t pscale,
|
||||
void HWR_DrawFlatFill(INT32 x, INT32 y, INT32 w, INT32 h, lumpnum_t flatlumpnum)
|
||||
{
|
||||
FOutVector v[4];
|
||||
double dflatsize;
|
||||
float dflatsize;
|
||||
INT32 flatflag;
|
||||
const size_t len = W_LumpLength(flatlumpnum);
|
||||
|
||||
|
||||
@@ -40,9 +40,9 @@ typedef struct gl_vissprite_s
|
||||
boolean flip;
|
||||
UINT8 translucency; //alpha level 0-255
|
||||
mobj_t *mobj;
|
||||
boolean precip; // Tails 08-25-2002
|
||||
precipmobj_t *precip; // Tails 08-25-2002
|
||||
boolean vflip;
|
||||
//Hurdler: 25/04/2000: now support colormap in hardware mode
|
||||
//Hurdler: 25/04/2000: now support colormap in hardware mode
|
||||
UINT8 *colormap;
|
||||
INT32 dispoffset; // copy of info->dispoffset, affects ordering but not drawing
|
||||
} gl_vissprite_t;
|
||||
@@ -53,7 +53,9 @@ void HWR_ObjectLightLevelPost(gl_vissprite_t *spr, const sector_t *sector, INT32
|
||||
// hw_bsp.c
|
||||
// --------
|
||||
extern extrasubsector_t *extrasubsectors;
|
||||
#ifdef PARANOIA
|
||||
extern size_t addsubsector;
|
||||
#endif
|
||||
|
||||
void HWR_FreeExtraSubsectors(void);
|
||||
|
||||
@@ -82,15 +84,11 @@ void HWR_GetFlat(lumpnum_t flatlumpnum, boolean noencoremap);
|
||||
// ^ some flats must NOT be remapped to encore, since we remap them as we cache them for ease, adding a toggle here seems wise.
|
||||
|
||||
void HWR_FreeTexture(patch_t *patch);
|
||||
void HWR_FreeTextureData(patch_t *patch);
|
||||
void HWR_FreeTextureColormaps(patch_t *patch);
|
||||
void HWR_ClearAllTextures(void);
|
||||
void HWR_FreeColormapCache(void);
|
||||
void HWR_UnlockCachedPatch(GLPatch_t *gpatch);
|
||||
|
||||
void HWR_SetPalette(RGBA_t *palette);
|
||||
void HWR_SetMapPalette(void);
|
||||
UINT32 HWR_CreateLightTable(UINT8 *lighttable);
|
||||
UINT32 HWR_GetLightTableID(extracolormap_t *colormap);
|
||||
void HWR_ClearLightTables(void);
|
||||
|
||||
|
||||
+107
-116
@@ -66,7 +66,6 @@
|
||||
// ==========================================================================
|
||||
|
||||
#define ABS(x) ((x) < 0 ? -(x) : (x))
|
||||
#define SOFTLIGHT(llevel) HWR_ShouldUsePaletteRendering() ? ((llevel) >> LIGHTSEGSHIFT) << LIGHTSEGSHIFT : (llevel)
|
||||
|
||||
// false if shaders have not been initialized yet, or if shaders are not available
|
||||
boolean gl_shadersavailable = false;
|
||||
@@ -378,7 +377,7 @@ void HWR_ObjectLightLevelPost(gl_vissprite_t *spr, const sector_t *sector, INT32
|
||||
fixed_t extralight = R_GetSpriteDirectionalLighting(R_PointToAngle(spr->mobj->x, spr->mobj->y));
|
||||
|
||||
// Less change in contrast in dark sectors
|
||||
extralight = FixedMul(extralight, CLAMP(*lightlevel, 0, 255) * FRACUNIT / 255);
|
||||
extralight = FixedMul(extralight, std::min(std::max(0, *lightlevel), 255) * FRACUNIT / 255);
|
||||
|
||||
// simple OGL approximation
|
||||
fixed_t tr = R_QuickCamDist(spr->mobj->x, spr->mobj->y) << FRACBITS;
|
||||
@@ -413,8 +412,12 @@ void HWR_Lighting(FSurfaceInfo *Surface, INT32 light_level, extracolormap_t *col
|
||||
tint_color.rgba = (colormap != NULL) ? (UINT32)colormap->rgba : GL_DEFAULTMIX;
|
||||
fade_color.rgba = (colormap != NULL) ? (UINT32)colormap->fadergba : GL_DEFAULTFOG;
|
||||
|
||||
// Shift the lightlevel for Palette rendering mode to replicate software´s limited 32 lightlevels
|
||||
if (HWR_ShouldUsePaletteRendering())
|
||||
light_level = (light_level >> LIGHTSEGSHIFT) << LIGHTSEGSHIFT;
|
||||
|
||||
// Clamp the light level, since it can sometimes go out of the 0-255 range from animations
|
||||
light_level = CLAMP(SOFTLIGHT(light_level), cv_secbright.value, 255);
|
||||
light_level = CLAMP(light_level, cv_secbright.value, 255);
|
||||
|
||||
// Crappy backup coloring if you can't do shaders
|
||||
if (!HWR_UseShader())
|
||||
@@ -459,6 +462,7 @@ void HWR_Lighting(FSurfaceInfo *Surface, INT32 light_level, extracolormap_t *col
|
||||
V_CubeApply(&tint_color.s.red, &tint_color.s.green, &tint_color.s.blue);
|
||||
V_CubeApply(&fade_color.s.red, &fade_color.s.green, &fade_color.s.blue);
|
||||
}
|
||||
|
||||
Surface->PolyColor.rgba = poly_color.rgba;
|
||||
Surface->TintColor.rgba = tint_color.rgba;
|
||||
Surface->FadeColor.rgba = fade_color.rgba;
|
||||
@@ -548,9 +552,9 @@ static void HWR_RenderPlane(subsector_t *subsector, extrasubsector_t *xsub, bool
|
||||
INT32 i;
|
||||
|
||||
float height; // constant y for all points on the convex flat polygon
|
||||
float flatxref, flatyref = 0.0f;
|
||||
float fflatsize = 64.0f;
|
||||
INT32 flatflag = 63;
|
||||
static float flatxref = 0.0f, flatyref = 0.0f;
|
||||
static float fflatsize = 64.0f;
|
||||
static INT32 flatflag = 63;
|
||||
size_t len;
|
||||
|
||||
float tempxsow, tempytow;
|
||||
@@ -677,8 +681,8 @@ static void HWR_RenderPlane(subsector_t *subsector, extrasubsector_t *xsub, bool
|
||||
tempxsow = flatxref;
|
||||
tempytow = flatyref;
|
||||
anglef = ANG2RAD(InvAngle(angle));
|
||||
flatxref = (tempxsow * cos(anglef)) - (tempytow * sin(anglef));
|
||||
flatyref = (tempxsow * sin(anglef)) + (tempytow * cos(anglef));
|
||||
flatxref = (tempxsow * cosf(anglef)) - (tempytow * sinf(anglef));
|
||||
flatyref = (tempxsow * sinf(anglef)) + (tempytow * cosf(anglef));
|
||||
}
|
||||
|
||||
#define SETUP3DVERT(vert, vx, vy) {\
|
||||
@@ -691,8 +695,8 @@ static void HWR_RenderPlane(subsector_t *subsector, extrasubsector_t *xsub, bool
|
||||
{\
|
||||
tempxsow = vert->s;\
|
||||
tempytow = vert->t;\
|
||||
vert->s = (tempxsow * cos(anglef)) - (tempytow * sin(anglef));\
|
||||
vert->t = (tempxsow * sin(anglef)) + (tempytow * cos(anglef));\
|
||||
vert->s = (tempxsow * cosf(anglef)) - (tempytow * sinf(anglef));\
|
||||
vert->t = (tempxsow * sinf(anglef)) + (tempytow * cosf(anglef));\
|
||||
}\
|
||||
\
|
||||
vert->x = (vx);\
|
||||
@@ -763,8 +767,8 @@ static void HWR_RenderPlane(subsector_t *subsector, extrasubsector_t *xsub, bool
|
||||
|
||||
if (line->pv1)
|
||||
{
|
||||
x1 = ((polyvertex_t *)line->pv1)->x;
|
||||
y1 = ((polyvertex_t *)line->pv1)->y;
|
||||
x1 = line->pv1->x;
|
||||
y1 = line->pv1->y;
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -773,8 +777,8 @@ static void HWR_RenderPlane(subsector_t *subsector, extrasubsector_t *xsub, bool
|
||||
|
||||
if (line->pv2)
|
||||
{
|
||||
xd = ((polyvertex_t *)line->pv2)->x - x1;
|
||||
yd = ((polyvertex_t *)line->pv2)->y - y1;
|
||||
xd = line->pv2->x - x1;
|
||||
yd = line->pv2->y - y1;
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -844,11 +848,11 @@ static void HWR_DrawSegsSplats(FSurfaceInfo * pSurf)
|
||||
|
||||
M_ClearBox(segbbox);
|
||||
M_AddToBox(segbbox,
|
||||
FloatToFixed(((polyvertex_t *)gl_curline->pv1)->x),
|
||||
FloatToFixed(((polyvertex_t *)gl_curline->pv1)->y));
|
||||
FloatToFixed(gl_curline->pv1->x),
|
||||
FloatToFixed(gl_curline->pv1->y));
|
||||
M_AddToBox(segbbox,
|
||||
FloatToFixed(((polyvertex_t *)gl_curline->pv2)->x),
|
||||
FloatToFixed(((polyvertex_t *)gl_curline->pv2)->y));
|
||||
FloatToFixed(gl_curline->pv2->x),
|
||||
FloatToFixed(gl_curline->pv2->y));
|
||||
|
||||
splat = (wallsplat_t *)gl_curline->linedef->splats;
|
||||
for (; splat; splat = splat->next)
|
||||
@@ -1013,10 +1017,10 @@ static void HWR_SplitWall(sector_t *sector, FOutVector *wallVerts, INT32 texnum,
|
||||
|
||||
float diff;
|
||||
|
||||
fixed_t v1x = FloatToFixed(wallVerts[0].x);
|
||||
fixed_t v1y = FloatToFixed(wallVerts[0].z);
|
||||
fixed_t v2x = FloatToFixed(wallVerts[1].x);
|
||||
fixed_t v2y = FloatToFixed(wallVerts[1].z);
|
||||
const fixed_t v1x = FloatToFixed(wallVerts[0].x);
|
||||
const fixed_t v1y = FloatToFixed(wallVerts[0].z);
|
||||
const fixed_t v2x = FloatToFixed(wallVerts[1].x);
|
||||
const fixed_t v2y = FloatToFixed(wallVerts[1].z);
|
||||
|
||||
const UINT8 alpha = Surf->PolyColor.s.alpha;
|
||||
FUINT lightnum = HWR_CalcWallLight(sector->lightlevel, gl_curline, NULL);
|
||||
@@ -1123,8 +1127,8 @@ static void HWR_SplitWall(sector_t *sector, FOutVector *wallVerts, INT32 texnum,
|
||||
|
||||
// Found a break
|
||||
// The heights are clamped to ensure the polygon doesn't cross itself.
|
||||
bot = CLAMP(bheight, realbot, top);
|
||||
endbot = CLAMP(endbheight, endrealbot, endtop);
|
||||
bot = std::max(bheight, realbot);
|
||||
endbot = std::max(endbheight, endrealbot);
|
||||
|
||||
Surf->PolyColor.s.alpha = alpha;
|
||||
|
||||
@@ -1222,6 +1226,7 @@ static void HWR_DrawSkyWallList(void)
|
||||
|
||||
HWR_SetCurrentTexture(NULL);
|
||||
GL_UnSetShader();
|
||||
|
||||
for (i = 0; i < skyWallVertexArraySize; i++)
|
||||
{
|
||||
GL_DrawPolygon(&surf, skyWallVertexArray + i * 4, 4, PF_Occlude|PF_Invisible|PF_NoTexture|PF_Skydecal);
|
||||
@@ -1344,10 +1349,10 @@ void HWR_ProcessSeg(void) // Sort of like GLWall::Process in GZDoom
|
||||
|
||||
if (LIKELY(gl_curline->pv1))
|
||||
{
|
||||
vs.x = ((polyvertex_t *)gl_curline->pv1)->x;
|
||||
vs.y = ((polyvertex_t *)gl_curline->pv1)->y;
|
||||
v1x = FloatToFixed(vs.x);
|
||||
v1y = FloatToFixed(vs.y);
|
||||
vs.x = gl_curline->pv1->x;
|
||||
vs.y = gl_curline->pv1->y;
|
||||
v1x = gl_curline->pv1->x2;
|
||||
v1y = gl_curline->pv1->y2;
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -1359,10 +1364,10 @@ void HWR_ProcessSeg(void) // Sort of like GLWall::Process in GZDoom
|
||||
|
||||
if (LIKELY(gl_curline->pv2))
|
||||
{
|
||||
ve.x = ((polyvertex_t *)gl_curline->pv2)->x;
|
||||
ve.y = ((polyvertex_t *)gl_curline->pv2)->y;
|
||||
v2x = FloatToFixed(ve.x);
|
||||
v2y = FloatToFixed(ve.y);
|
||||
ve.x = gl_curline->pv2->x;
|
||||
ve.y = gl_curline->pv2->y;
|
||||
v2x = gl_curline->pv2->x2;
|
||||
v2y = gl_curline->pv2->y2;
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -1394,7 +1399,7 @@ void HWR_ProcessSeg(void) // Sort of like GLWall::Process in GZDoom
|
||||
// x offset the texture
|
||||
const fixed_t texturehpeg = gl_sidedef->textureoffset + gl_curline->offset;
|
||||
const float cliplow = (float)texturehpeg;
|
||||
const float cliphigh = (float)(texturehpeg + (gl_curline->flength*FRACUNIT));
|
||||
const float cliphigh = (float)(texturehpeg + gl_curline->length);
|
||||
|
||||
FUINT lightnum = gl_frontsector->lightlevel;
|
||||
extracolormap_t *colormap = gl_frontsector->extra_colormap;
|
||||
@@ -1904,6 +1909,19 @@ void HWR_ProcessSeg(void) // Sort of like GLWall::Process in GZDoom
|
||||
{
|
||||
for (rover = gl_backsector->ffloors; rover; rover = rover->next)
|
||||
{
|
||||
boolean bothsides = false;
|
||||
// Skip if it exists on both sectors.
|
||||
ffloor_t * r2;
|
||||
for (r2 = gl_frontsector->ffloors; r2; r2 = r2->next)
|
||||
if (rover->master == r2->master)
|
||||
{
|
||||
bothsides = true;
|
||||
break;
|
||||
}
|
||||
|
||||
if (bothsides)
|
||||
continue;
|
||||
|
||||
const ffloortype_e roverflags = rover->flags;
|
||||
|
||||
if (!(roverflags & FF_EXISTS) || !(roverflags & FF_RENDERSIDES) || (roverflags & FF_INVERTSIDES))
|
||||
@@ -2055,6 +2073,17 @@ void HWR_ProcessSeg(void) // Sort of like GLWall::Process in GZDoom
|
||||
{
|
||||
for (rover = gl_frontsector->ffloors; rover; rover = rover->next)
|
||||
{
|
||||
boolean bothsides = false;
|
||||
// Skip if it exists on both sectors.
|
||||
ffloor_t * r2;
|
||||
for (r2 = gl_backsector->ffloors; r2; r2 = r2->next)
|
||||
if (rover->master == r2->master)
|
||||
{
|
||||
bothsides = true;
|
||||
break;
|
||||
}
|
||||
|
||||
if (bothsides) continue;
|
||||
const ffloortype_e roverflags = rover->flags;
|
||||
|
||||
if (!(roverflags & FF_EXISTS) || !(roverflags & FF_RENDERSIDES) || !(roverflags & FF_ALLSIDES))
|
||||
@@ -2199,8 +2228,8 @@ static boolean CheckClip(sector_t * afrontsector, sector_t * abacksector)
|
||||
|
||||
if (LIKELY(gl_curline->pv1))
|
||||
{
|
||||
v1x = FloatToFixed(((polyvertex_t *)gl_curline->pv1)->x);
|
||||
v1y = FloatToFixed(((polyvertex_t *)gl_curline->pv1)->y);
|
||||
v1x = gl_curline->pv1->x2;
|
||||
v1y = gl_curline->pv1->y2;
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -2210,8 +2239,8 @@ static boolean CheckClip(sector_t * afrontsector, sector_t * abacksector)
|
||||
|
||||
if (LIKELY(gl_curline->pv2))
|
||||
{
|
||||
v2x = FloatToFixed(((polyvertex_t *)gl_curline->pv2)->x);
|
||||
v2y = FloatToFixed(((polyvertex_t *)gl_curline->pv2)->y);
|
||||
v2x = gl_curline->pv2->x2;
|
||||
v2y = gl_curline->pv2->y2;
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -2427,8 +2456,8 @@ static void HWR_AddLine(seg_t *line)
|
||||
|
||||
if (LIKELY(gl_curline->pv1))
|
||||
{
|
||||
v1x = FloatToFixed(((polyvertex_t *)gl_curline->pv1)->x);
|
||||
v1y = FloatToFixed(((polyvertex_t *)gl_curline->pv1)->y);
|
||||
v1x = gl_curline->pv1->x2;
|
||||
v1y = gl_curline->pv1->y2;
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -2438,8 +2467,8 @@ static void HWR_AddLine(seg_t *line)
|
||||
|
||||
if (LIKELY(gl_curline->pv2))
|
||||
{
|
||||
v2x = FloatToFixed(((polyvertex_t *)gl_curline->pv2)->x);
|
||||
v2y = FloatToFixed(((polyvertex_t *)gl_curline->pv2)->y);
|
||||
v2x = gl_curline->pv2->x2;
|
||||
v2y = gl_curline->pv2->y2;
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -2556,7 +2585,9 @@ static boolean HWR_CheckBBox(const fixed_t *bspcoord)
|
||||
else // node
|
||||
mindist = 0;
|
||||
}
|
||||
if (mindist > current_bsp_culling_distance) return false;
|
||||
|
||||
if (mindist > current_bsp_culling_distance)
|
||||
return false;
|
||||
}
|
||||
|
||||
angle1 = R_PointToAngle64(px1, py1);
|
||||
@@ -2894,7 +2925,7 @@ static void HWR_Subsector(size_t num)
|
||||
extracolormap_t *ceilingcolormap;
|
||||
ffloor_t *rover;
|
||||
|
||||
#ifdef PARANOIA //no risk while developing, enough debugging nights!
|
||||
#ifdef PARANOIA // no risk while developing, enough debugging nights!
|
||||
if (num >= addsubsector)
|
||||
I_Error("HWR_Subsector: ss %s with numss = %s, addss = %s\n",
|
||||
sizeu1(num), sizeu2(numsubsectors), sizeu3(addsubsector));
|
||||
@@ -3540,27 +3571,13 @@ static void HWR_RotateSpritePolyToAim(gl_vissprite_t *spr, FOutVector *wallVerts
|
||||
float basey, lowy;
|
||||
|
||||
// do interpolation
|
||||
if (R_UsingFrameInterpolation() && !paused && R_CheckInterpDist(spr->mobj))
|
||||
if (precip)
|
||||
{
|
||||
if (precip)
|
||||
{
|
||||
R_InterpolatePrecipMobjState((precipmobj_t *)spr->mobj, rendertimefrac, &interp);
|
||||
}
|
||||
else
|
||||
{
|
||||
R_InterpolateMobjState(spr->mobj, rendertimefrac, &interp);
|
||||
}
|
||||
R_InterpolatePrecipMobjState(spr->precip, R_GetPrecipMobjTimeFrac(spr->precip), &interp);
|
||||
}
|
||||
else
|
||||
{
|
||||
if (precip)
|
||||
{
|
||||
R_InterpolatePrecipMobjState((precipmobj_t *)spr->mobj, FRACUNIT, &interp);
|
||||
}
|
||||
else
|
||||
{
|
||||
R_InterpolateMobjState(spr->mobj, FRACUNIT, &interp);
|
||||
}
|
||||
R_InterpolateMobjState(spr->mobj, R_GetMobjTimeFrac(spr->mobj), &interp);
|
||||
}
|
||||
|
||||
if (!precip && P_MobjFlip(spr->mobj) == -1) // precip doesn't have eflags so they can't flip
|
||||
@@ -3814,8 +3831,8 @@ static void HWR_SplitSprite(gl_vissprite_t *spr, const boolean papersprite)
|
||||
|
||||
// Found a break
|
||||
// The heights are clamped to ensure the polygon doesn't cross itself.
|
||||
bot = CLAMP(bheight, realbot, top);
|
||||
endbot = CLAMP(endbheight, endrealbot, endtop);
|
||||
bot = std::max(bheight, realbot);
|
||||
endbot = std::max(endbheight, endrealbot);
|
||||
|
||||
wallVerts[3].t = towtop + ((realtop - top) * towmult);
|
||||
wallVerts[2].t = towtop + ((endrealtop - endtop) * towmult);
|
||||
@@ -4056,7 +4073,7 @@ static void HWR_DrawPrecipitationSprite(gl_vissprite_t *spr)
|
||||
|
||||
INT32 shader = SHADER_NONE;
|
||||
|
||||
const mobj_t *sprmo = spr->mobj;
|
||||
const precipmobj_t *sprmo = spr->precip;
|
||||
|
||||
if (UNLIKELY(!sprmo || !sprmo->subsector))
|
||||
return;
|
||||
@@ -4104,7 +4121,7 @@ static void HWR_DrawPrecipitationSprite(gl_vissprite_t *spr)
|
||||
{
|
||||
INT32 light;
|
||||
|
||||
light = R_GetPlaneLight(sector, sprmo->z + sprmo->height, false); // Always use the light at the top instead of whatever I was doing before
|
||||
light = R_GetPlaneLight(sector, sprmo->z, false); // Always use the light at the top instead of whatever I was doing before
|
||||
|
||||
if (!(sprmo->frame & FF_FULLBRIGHT))
|
||||
lightlevel = static_cast<INT32>(*sector->lightlist[light].lightlevel);
|
||||
@@ -4166,8 +4183,8 @@ static int CompareVisSprites(const void *p1, const void *p2)
|
||||
// "boolean to int"
|
||||
|
||||
// check for precip first, because then sprX->mobj is actually a precipmobj_t and does not have flags2 or tracer
|
||||
const int transparency1 = (!spr1->precip && (spr1->mobj->flags2 & MF2_SHADOW)) || (spr1->mobj->frame & FF_TRANSMASK);
|
||||
const int transparency2 = (!spr2->precip && (spr2->mobj->flags2 & MF2_SHADOW)) || (spr2->mobj->frame & FF_TRANSMASK);
|
||||
const int transparency1 = (spr1->precip ? (spr1->precip->frame & FF_TRANSMASK) : ((spr1->mobj->flags2 & MF2_SHADOW)) || (spr1->mobj->frame & FF_TRANSMASK));
|
||||
const int transparency2 = (spr2->precip ? (spr2->precip->frame & FF_TRANSMASK) : ((spr2->mobj->flags2 & MF2_SHADOW)) || (spr2->mobj->frame & FF_TRANSMASK));
|
||||
|
||||
idiff = transparency1 - transparency2;
|
||||
if (idiff != 0) return idiff;
|
||||
@@ -4606,7 +4623,7 @@ static void HWR_AddPrecipitationSprites(void)
|
||||
return;
|
||||
}
|
||||
|
||||
drawdist = ((fixed_t)(cv_drawdist_precip.value) * (cv_mobjscaleprecip.value ? mapobjectscale : FRACUNIT));
|
||||
drawdist = ((fixed_t)(cv_drawdist_precip.value) * mapobjectscale);
|
||||
|
||||
// No to infinite precipitation draw distance.
|
||||
if (cv_drawdist_precip.value == 0)
|
||||
@@ -4683,14 +4700,7 @@ static void HWR_ProjectSprite(mobj_t *thing)
|
||||
// uncapped/interpolation
|
||||
interpmobjstate_t interp = {};
|
||||
|
||||
if (R_UsingFrameInterpolation() && !paused && R_CheckInterpDist(thing))
|
||||
{
|
||||
R_InterpolateMobjState(thing, rendertimefrac, &interp);
|
||||
}
|
||||
else
|
||||
{
|
||||
R_InterpolateMobjState(thing, FRACUNIT, &interp);
|
||||
}
|
||||
R_InterpolateMobjState(thing, R_GetMobjTimeFrac(thing), &interp);
|
||||
|
||||
if (interp.spritexscale < 1 || interp.spriteyscale < 1)
|
||||
return;
|
||||
@@ -5006,7 +5016,7 @@ static void HWR_ProjectSprite(mobj_t *thing)
|
||||
|
||||
vis->vflip = vflip;
|
||||
|
||||
vis->precip = false;
|
||||
vis->precip = NULL;
|
||||
}
|
||||
|
||||
// Precipitation projector for hardware mode
|
||||
@@ -5038,21 +5048,7 @@ static void HWR_ProjectPrecipitationSprite(precipmobj_t *thing)
|
||||
interpmobjstate_t interp = {};
|
||||
|
||||
// do interpolation
|
||||
if (R_UsingFrameInterpolation() && !paused && R_CheckInterpDist((mobj_t*)thing))
|
||||
{
|
||||
R_InterpolatePrecipMobjState(thing, rendertimefrac, &interp);
|
||||
}
|
||||
else
|
||||
{
|
||||
R_InterpolatePrecipMobjState(thing, FRACUNIT, &interp);
|
||||
}
|
||||
|
||||
// Visibility check by the blend mode.
|
||||
if (thing->frame & FF_TRANSMASK)
|
||||
{
|
||||
if (!R_BlendLevelVisible(thing->blendmode, (thing->frame & FF_TRANSMASK)>>FF_TRANSSHIFT))
|
||||
return;
|
||||
}
|
||||
R_InterpolatePrecipMobjState(thing, R_GetPrecipMobjTimeFrac(thing), &interp);
|
||||
|
||||
// transform the origin point
|
||||
tr_x = FixedToFloat(interp.x);
|
||||
@@ -5130,7 +5126,7 @@ static void HWR_ProjectPrecipitationSprite(precipmobj_t *thing)
|
||||
vis->dispoffset = 0; // Monster Iestyn: 23/11/15: HARDWARE SUPPORT AT LAST
|
||||
vis->gpatch = (patch_t *)W_CachePatchNum(sprframe->lumppat[rot], PU_SPRITE);
|
||||
vis->flip = flip;
|
||||
vis->mobj = (mobj_t *)thing;
|
||||
vis->mobj = NULL;
|
||||
|
||||
vis->colormap = NULL;
|
||||
|
||||
@@ -5143,7 +5139,7 @@ static void HWR_ProjectPrecipitationSprite(precipmobj_t *thing)
|
||||
vis->gzt = FixedToFloat(interp.z) + (FixedToFloat(spritecachedinfo[lumpoff].topoffset) * this_scale);
|
||||
vis->gz = vis->gzt - (FixedToFloat(spritecachedinfo[lumpoff].height) * this_scale);
|
||||
|
||||
vis->precip = true;
|
||||
vis->precip = thing;
|
||||
}
|
||||
|
||||
|
||||
@@ -5304,19 +5300,14 @@ static void HWR_DrawSkyBackground(void)
|
||||
{
|
||||
FTransform dometransform;
|
||||
|
||||
if (drewsky)
|
||||
return;
|
||||
|
||||
if (HWR_IsWireframeMode())
|
||||
if (drewsky || HWR_IsWireframeMode())
|
||||
return;
|
||||
|
||||
GL_SetBlend(PF_Translucent|PF_NoDepthTest|PF_Modulated);
|
||||
|
||||
memcpy(&dometransform, &atransform, sizeof(FTransform));
|
||||
|
||||
dometransform.x = 0.0;
|
||||
dometransform.y = 0.0;
|
||||
dometransform.z = 0.0;
|
||||
dometransform.x = dometransform.y = dometransform.z = 0.0;
|
||||
|
||||
//04/01/2000: Hurdler: added for T&L
|
||||
// It should replace all other gl_viewxxx when finished
|
||||
@@ -5333,6 +5324,7 @@ static void HWR_DrawSkyBackground(void)
|
||||
|
||||
if (HWR_UseShader())
|
||||
GL_SetShader(HWR_GetShaderFromTarget(SHADER_SKY));
|
||||
|
||||
GL_SetTransform(&dometransform);
|
||||
GL_RenderSkyDome(&gl_sky);
|
||||
}
|
||||
@@ -5350,7 +5342,6 @@ static inline void HWR_ClearView(void)
|
||||
GL_ClearBuffer(false, true, true, NULL);
|
||||
}
|
||||
|
||||
|
||||
// -----------------+
|
||||
// HWR_SetViewSize : set projection and scaling values
|
||||
// -----------------+
|
||||
@@ -5581,7 +5572,7 @@ void HWR_RenderViewpoint(gl_portal_t *rootportal, player_t *player, int stencil_
|
||||
drewsky = false;
|
||||
HWR_DrawSkyBackground();
|
||||
HWR_SetStencilState(HWR_STENCIL_NORMAL, 0);
|
||||
GL_ClearBuffer(false, false, true, 0);// clear skywall markings from the stencil buffer
|
||||
GL_ClearBuffer(false, false, true, NULL);// clear skywall markings from the stencil buffer
|
||||
HWR_SetTransform(fpov);// restore transform
|
||||
}
|
||||
}
|
||||
@@ -5700,13 +5691,7 @@ void HWR_RenderPlayerView(void)
|
||||
// Clear the color buffer, stops HOMs. Also seems to fix the skybox issue on Intel GPUs.
|
||||
if (viewssnum == 0) // Only do it if it's the first screen being rendered
|
||||
{
|
||||
FRGBAFloat ClearColor;
|
||||
|
||||
ClearColor.red = 0.0f;
|
||||
ClearColor.green = 0.0f;
|
||||
ClearColor.blue = 0.0f;
|
||||
ClearColor.alpha = 1.0f;
|
||||
|
||||
static FRGBAFloat ClearColor = {0.0f, 0.0f, 0.0f, 1.0f};
|
||||
GL_ClearBuffer(true, false, false, &ClearColor);
|
||||
}
|
||||
|
||||
@@ -5715,13 +5700,19 @@ void HWR_RenderPlayerView(void)
|
||||
if (cv_ripplewater.value)
|
||||
GL_SetShaderInfo(HWD_SHADERINFO_LEVELTIME, (INT32)leveltime); // The water surface shader needs the leveltime.
|
||||
|
||||
const angle_t light_angle = maplighting.angle - viewangle + ANGLE_90; // I fucking hate OGL's coordinate system
|
||||
GL_SetShaderInfo(HWD_SHADERINFO_LIGHT_X, FINECOSINE(light_angle >> ANGLETOFINESHIFT));
|
||||
GL_SetShaderInfo(HWD_SHADERINFO_LIGHT_Y, 0);
|
||||
GL_SetShaderInfo(HWD_SHADERINFO_LIGHT_Z, -FINESINE(light_angle >> ANGLETOFINESHIFT));
|
||||
if (cv_glmdls.value)
|
||||
{
|
||||
if (maplighting.directional)
|
||||
{
|
||||
const angle_t light_angle = maplighting.angle - viewangle + ANGLE_90; // I fucking hate OGL's coordinate system
|
||||
GL_SetShaderInfo(HWD_SHADERINFO_LIGHT_X, FINECOSINE(light_angle >> ANGLETOFINESHIFT));
|
||||
GL_SetShaderInfo(HWD_SHADERINFO_LIGHT_Y, 0);
|
||||
GL_SetShaderInfo(HWD_SHADERINFO_LIGHT_Z, -FINESINE(light_angle >> ANGLETOFINESHIFT));
|
||||
}
|
||||
|
||||
GL_SetShaderInfo(HWD_SHADERINFO_LIGHT_CONTRAST, maplighting.contrast);
|
||||
GL_SetShaderInfo(HWD_SHADERINFO_LIGHT_BACKLIGHT, maplighting.backlight);
|
||||
GL_SetShaderInfo(HWD_SHADERINFO_LIGHT_CONTRAST, maplighting.contrast);
|
||||
GL_SetShaderInfo(HWD_SHADERINFO_LIGHT_BACKLIGHT, maplighting.backlight);
|
||||
}
|
||||
}
|
||||
|
||||
if (viewssnum > 3)
|
||||
@@ -6045,7 +6036,7 @@ static void HWR_DoPostProcessor(player_t *player)
|
||||
{
|
||||
// 10 by 10 grid. 2 coordinates (xy)
|
||||
float v[SCREENVERTS][SCREENVERTS][2];
|
||||
float disStart = (leveltime-1) + FixedToFloat(rendertimefrac);
|
||||
float disStart = (leveltime-1) + FixedToFloat(R_GetTimeFrac(RTF_LEVEL));
|
||||
|
||||
UINT8 x, y;
|
||||
INT32 WAVELENGTH;
|
||||
|
||||
+4
-11
@@ -1176,6 +1176,8 @@ void HWR_DrawMD2(gl_vissprite_t *spr)
|
||||
|
||||
// Look at HWR_ProjectSprite for more
|
||||
{
|
||||
md2_t *md2s;
|
||||
int skinnum;
|
||||
patch_t *gpatch, *blendgpatch;
|
||||
GLPatch_t *hwrPatch = NULL, *hwrBlendPatch = NULL;
|
||||
INT32 durs = spr->mobj->state->tics;
|
||||
@@ -1188,16 +1190,7 @@ void HWR_DrawMD2(gl_vissprite_t *spr)
|
||||
spriteinfo_t *sprinfo;
|
||||
interpmobjstate_t interp;
|
||||
|
||||
if (R_UsingFrameInterpolation() && !paused && R_CheckInterpDist(spr->mobj))
|
||||
{
|
||||
R_InterpolateMobjState(spr->mobj, rendertimefrac, &interp);
|
||||
}
|
||||
else
|
||||
{
|
||||
R_InterpolateMobjState(spr->mobj, FRACUNIT, &interp);
|
||||
}
|
||||
md2_t *md2s;
|
||||
int skinnum;
|
||||
R_InterpolateMobjState(spr->mobj, R_GetMobjTimeFrac(spr->mobj), &interp);
|
||||
|
||||
// Apparently people don't like jump frames like that, so back it goes
|
||||
//if (tics > durs)
|
||||
@@ -1375,7 +1368,7 @@ void HWR_DrawMD2(gl_vissprite_t *spr)
|
||||
|
||||
#ifdef USE_MODEL_NEXTFRAME
|
||||
// Interpolate the model interpolation. (lol)
|
||||
tics -= FixedToFloat(rendertimefrac);
|
||||
tics -= FixedToFloat(R_GetTimeFrac(RTF_LEVEL));
|
||||
|
||||
if (cv_glmdls.value == 1 && tics <= durs)
|
||||
{
|
||||
|
||||
@@ -35,7 +35,7 @@ static struct {
|
||||
// Sprite shader
|
||||
{GLSL_DEFAULT_VERTEX_SHADER, GLSL_WALL_FRAGMENT_SHADER},
|
||||
|
||||
// Model shader
|
||||
// Model shader + diffuse lighting from above
|
||||
{GLSL_MODEL_LIGHTING_VERTEX_SHADER, GLSL_WALL_FRAGMENT_SHADER},
|
||||
|
||||
// Water shader
|
||||
|
||||
+410
-150
@@ -27,6 +27,8 @@
|
||||
|
||||
#if defined (HWRENDER) && !defined (NOROPENGL)
|
||||
|
||||
#include "../../r_fps.h" // For R_GetTimeFrac, used for the leveltime shader uniform
|
||||
|
||||
#include "r_opengl.h"
|
||||
#include "r_vbo.h"
|
||||
|
||||
@@ -126,12 +128,27 @@ GLfloat projMatrix[16];
|
||||
static GLint viewport[4];
|
||||
|
||||
#ifdef USE_FBO_OGL
|
||||
GLuint FramebufferObject, FramebufferTexture, RenderbufferObject;
|
||||
|
||||
boolean supportFBO = false;
|
||||
enum
|
||||
{
|
||||
FBO_NONE,
|
||||
FBO_ARB,
|
||||
FBO_EXT,
|
||||
FBO_EXT_STENCIL // supports stencil attachment
|
||||
};
|
||||
|
||||
int supportFBO = FBO_NONE;
|
||||
static boolean fboinit = false;
|
||||
|
||||
static void GL_Framebuffer_DeleteAttachments(void);
|
||||
|
||||
static int FBO_FRAMEBUFFER = GL_FRAMEBUFFER;
|
||||
static int FBO_COLOR_ATTACHMENT = GL_COLOR_ATTACHMENT0;
|
||||
static int FBO_DEPTH_ATTACHMENT = GL_DEPTH_STENCIL_ATTACHMENT;
|
||||
static int FBO_DEPTH_STENCIL = GL_DEPTH24_STENCIL8;
|
||||
static int FBO_RENDERBUFFER = GL_RENDERBUFFER;
|
||||
static int FBO_COMPLETE = GL_FRAMEBUFFER_COMPLETE;
|
||||
|
||||
#endif
|
||||
|
||||
// Sryder: NextTexAvail is broken for these because palette changes or changes to the texture filter or antialiasing
|
||||
@@ -225,8 +242,9 @@ static void GL_MSG_Warning(const char *format, ...)
|
||||
CONS_Alert(CONS_WARNING, "%s", str);
|
||||
#endif
|
||||
#ifdef DEBUG_TO_FILE
|
||||
if (!gllogstream)
|
||||
if (!gllogstream)
|
||||
gllogstream = fopen("ogllog.txt", "w");
|
||||
|
||||
fwrite(str, strlen(str), 1, gllogstream);
|
||||
#endif
|
||||
}
|
||||
@@ -325,6 +343,10 @@ static void GL_MSG_Error(const char *format, ...)
|
||||
#define pglCopyTexImage2D glCopyTexImage2D
|
||||
#define pglCopyTexSubImage2D glCopyTexSubImage2D
|
||||
|
||||
#ifdef GLDEBUGMESSAGE
|
||||
#define pglDebugMessageCallback glDebugMessageCallback
|
||||
#endif
|
||||
|
||||
#else //!STATIC_OPENGL
|
||||
|
||||
/* 1.0 functions */
|
||||
@@ -446,7 +468,7 @@ typedef void (APIENTRY * PFNglCopyTexSubImage2D) (GLenum target, GLint level, GL
|
||||
static PFNglCopyTexSubImage2D pglCopyTexSubImage2D;
|
||||
|
||||
#ifdef USE_FBO_OGL
|
||||
/* 3.0 functions for framebuffers and renderbuffers */
|
||||
/* core functions for framebuffers and renderbuffers */
|
||||
typedef void (APIENTRY * PFNglGenFramebuffers) (GLsizei n, GLuint *ids);
|
||||
static PFNglGenFramebuffers pglGenFramebuffers;
|
||||
typedef void (APIENTRY * PFNglBindFramebuffer) (GLenum target, GLuint framebuffer);
|
||||
@@ -465,10 +487,58 @@ typedef void (APIENTRY * PFNglDeleteRenderbuffers) (GLsizei n, GLuint *renderbuf
|
||||
static PFNglDeleteRenderbuffers pglDeleteRenderbuffers;
|
||||
typedef void (APIENTRY * PFNglRenderbufferStorage) (GLenum target, GLenum internalformat, GLsizei width, GLsizei height);
|
||||
static PFNglRenderbufferStorage pglRenderbufferStorage;
|
||||
|
||||
typedef void (APIENTRY * PFNglRenderbufferStorageMultisample) (GLenum target, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height);
|
||||
static PFNglRenderbufferStorageMultisample pglRenderbufferStorageMultisample;
|
||||
|
||||
typedef void (APIENTRY * PFNglBlitFramebuffer) (GLint srcX0, GLint srcY0, GLint srcX1, GLint srcY1, GLint dstX0, GLint dstY0, GLint dstX1, GLint dstY1, GLbitfield mask, GLenum filter);
|
||||
static PFNglBlitFramebuffer pglBlitFramebuffer;
|
||||
|
||||
typedef void (APIENTRY * PFNglTexImage2DMultisample) ( GLenum target,
|
||||
GLsizei samples,
|
||||
GLenum internalformat,
|
||||
GLsizei width,
|
||||
GLsizei height,
|
||||
GLboolean fixedsamplelocations);
|
||||
|
||||
static PFNglTexImage2DMultisample pglTexImage2DMultisample;
|
||||
|
||||
|
||||
typedef void (APIENTRY * PFNglDrawBuffer) ( GLenum buf);
|
||||
static PFNglDrawBuffer pglDrawBuffer;
|
||||
|
||||
typedef void (APIENTRY * PFNglReadBuffer) ( GLenum mode);
|
||||
static PFNglReadBuffer pglReadBuffer;
|
||||
|
||||
typedef void (APIENTRY * PFNglFramebufferRenderbuffer) (GLenum target, GLenum attachment, GLenum renderbuffertarget, GLenum renderbuffer);
|
||||
static PFNglFramebufferRenderbuffer pglFramebufferRenderbuffer;
|
||||
|
||||
/* 2.1 extension functions for framebuffers and renderbuffers */
|
||||
typedef void (APIENTRY * PFNglGenFramebuffersEXT) (GLsizei n, GLuint *ids);
|
||||
static PFNglGenFramebuffersEXT pglGenFramebuffersEXT;
|
||||
typedef void (APIENTRY * PFNglBindFramebufferEXT) (GLenum target, GLuint framebuffer);
|
||||
static PFNglBindFramebufferEXT pglBindFramebufferEXT;
|
||||
typedef void (APIENTRY * PFNglDeleteFramebuffersEXT) (GLsizei n, GLuint *ids);
|
||||
static PFNglDeleteFramebuffersEXT pglDeleteFramebuffersEXT;
|
||||
typedef void (APIENTRY * PFNglFramebufferTexture2DEXT) (GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level);
|
||||
static PFNglFramebufferTexture2DEXT pglFramebufferTexture2DEXT;
|
||||
typedef GLenum (APIENTRY * PFNglCheckFramebufferStatusEXT) (GLenum target);
|
||||
static PFNglCheckFramebufferStatusEXT pglCheckFramebufferStatusEXT;
|
||||
typedef void (APIENTRY * PFNglGenRenderbuffersEXT) (GLsizei n, GLuint *renderbuffers);
|
||||
static PFNglGenRenderbuffersEXT pglGenRenderbuffersEXT;
|
||||
typedef void (APIENTRY * PFNglBindRenderbufferEXT) (GLenum target, GLuint renderbuffer);
|
||||
static PFNglBindRenderbufferEXT pglBindRenderbufferEXT;
|
||||
typedef void (APIENTRY * PFNglDeleteRenderbuffersEXT) (GLsizei n, GLuint *renderbuffers);
|
||||
static PFNglDeleteRenderbuffersEXT pglDeleteRenderbuffersEXT;
|
||||
typedef void (APIENTRY * PFNglRenderbufferStorageEXT) (GLenum target, GLenum internalformat, GLsizei width, GLsizei height);
|
||||
static PFNglRenderbufferStorageEXT pglRenderbufferStorageEXT;
|
||||
typedef void (APIENTRY * PFNglFramebufferRenderbufferEXT) (GLenum target, GLenum attachment, GLenum renderbuffertarget, GLenum renderbuffer);
|
||||
static PFNglFramebufferRenderbufferEXT pglFramebufferRenderbufferEXT;
|
||||
#endif // USE_FBO_OGL
|
||||
|
||||
typedef GLenum (APIENTRY * PFNglGetError) ( void);
|
||||
static PFNglGetError pglGetError;
|
||||
|
||||
#endif //!STATIC_OPENGL
|
||||
|
||||
/* 1.2 functions for 3D textures */
|
||||
@@ -503,6 +573,11 @@ static PFNglColorPointer pglColorPointer;
|
||||
typedef void (APIENTRY * PFNglBlendEquation) (GLenum mode);
|
||||
static PFNglBlendEquation pglBlendEquation;
|
||||
|
||||
#ifdef GLDEBUGMESSAGE
|
||||
typedef void (APIENTRY * PFNglDebugMessageCallback) (void (APIENTRY *DEBUGPROC)(GLenum source, GLenum type, GLuint id, GLenum severity, GLsizei length, const GLchar *message, const void *userParam), const void *userParam);
|
||||
static PFNglDebugMessageCallback pglDebugMessageCallback;
|
||||
#endif
|
||||
|
||||
/* 1.2 Parms */
|
||||
/* GL_CLAMP_TO_EDGE_EXT */
|
||||
#ifndef GL_CLAMP_TO_EDGE
|
||||
@@ -729,16 +804,35 @@ static void GL_Shader_SetUniforms(FSurfaceInfo *Surface, GLRGBAFloat *poly, GLRG
|
||||
static GLRGBAFloat shader_defaultcolor = {1.0f, 1.0f, 1.0f, 1.0f};
|
||||
|
||||
#ifdef USE_FBO_OGL
|
||||
static boolean GLFramebuffer_CheckExt(void)
|
||||
static int GLFramebuffer_CheckExt(void)
|
||||
{
|
||||
//this stuff needs atleast OGL 3.0
|
||||
if (majorGL < 3)
|
||||
return false;
|
||||
// in opengl 3.0 and up fbos are standart and always supported
|
||||
if (majorGL >= 3)
|
||||
return FBO_ARB;
|
||||
|
||||
// check if all needed gl extensions are available
|
||||
return (GL_isExtAvailable("GL_ARB_framebuffer_no_attachments", gl_extensions)
|
||||
&& GL_isExtAvailable("GL_ARB_framebuffer_object", gl_extensions)
|
||||
&& GL_isExtAvailable("GL_ARB_framebuffer_sRGB", gl_extensions));
|
||||
// gl versions from 2.1 may still support framebuffer objects
|
||||
|
||||
// maybe, just maybe, we support the standart extensions
|
||||
if (GL_isExtAvailable("GL_ARB_framebuffer_no_attachments", gl_extensions)
|
||||
&& GL_isExtAvailable("GL_ARB_framebuffer_object", gl_extensions)
|
||||
&& GL_isExtAvailable("GL_ARB_framebuffer_sRGB", gl_extensions))
|
||||
return FBO_ARB;
|
||||
|
||||
// nope, try the older 2.1 extensions
|
||||
if (GL_isExtAvailable("GL_EXT_framebuffer_no_attachments", gl_extensions)
|
||||
&& GL_isExtAvailable("GL_EXT_framebuffer_object", gl_extensions)
|
||||
&& GL_isExtAvailable("GL_EXT_framebuffer_sRGB", gl_extensions))
|
||||
{
|
||||
// perhaps we may even support a stencil attachment
|
||||
if (GL_isExtAvailable("GL_EXT_packed_depth_stencil", gl_extensions))
|
||||
return FBO_EXT_STENCIL;
|
||||
|
||||
// no stencil support, sad
|
||||
return FBO_EXT;
|
||||
}
|
||||
|
||||
// no fbo support for you :c
|
||||
return FBO_NONE;
|
||||
}
|
||||
#endif
|
||||
|
||||
@@ -795,28 +889,105 @@ void SetupGLFunc4(void)
|
||||
GetGLfunc(glUniform3fv);
|
||||
GetGLfunc(glGetUniformLocation);
|
||||
|
||||
#ifdef USE_FBO_OGL
|
||||
if (GLFramebuffer_CheckExt())
|
||||
{
|
||||
GetGLfunc(glGenFramebuffers);
|
||||
GetGLfunc(glBindFramebuffer);
|
||||
GetGLfunc(glDeleteFramebuffers);
|
||||
GetGLfunc(glFramebufferTexture2D);
|
||||
GetGLfunc(glCheckFramebufferStatus);
|
||||
GetGLfunc(glGenRenderbuffers);
|
||||
GetGLfunc(glBindRenderbuffer);
|
||||
GetGLfunc(glDeleteRenderbuffers);
|
||||
GetGLfunc(glRenderbufferStorage);
|
||||
GetGLfunc(glFramebufferRenderbuffer);
|
||||
#ifdef GLDEBUGMESSAGE
|
||||
GetGLfunc(glDebugMessageCallback);
|
||||
#endif
|
||||
|
||||
// check if ALL functions are availible
|
||||
if (pglGenFramebuffers && pglBindFramebuffer &&
|
||||
pglDeleteFramebuffers && pglFramebufferTexture2D &&
|
||||
pglCheckFramebufferStatus && pglGenRenderbuffers &&
|
||||
pglBindRenderbuffer && pglDeleteRenderbuffers &&
|
||||
pglRenderbufferStorage && pglFramebufferRenderbuffer)
|
||||
supportFBO = true;
|
||||
#ifdef USE_FBO_OGL
|
||||
const int fbocheck = GLFramebuffer_CheckExt();
|
||||
|
||||
if (fbocheck != FBO_NONE)
|
||||
{
|
||||
if (fbocheck == FBO_ARB)
|
||||
{
|
||||
GetGLfunc(glGenFramebuffers);
|
||||
GetGLfunc(glBindFramebuffer);
|
||||
GetGLfunc(glDeleteFramebuffers);
|
||||
GetGLfunc(glFramebufferTexture2D);
|
||||
GetGLfunc(glCheckFramebufferStatus);
|
||||
GetGLfunc(glGenRenderbuffers);
|
||||
GetGLfunc(glBindRenderbuffer);
|
||||
GetGLfunc(glDeleteRenderbuffers);
|
||||
GetGLfunc(glRenderbufferStorage);
|
||||
GetGLfunc(glRenderbufferStorageMultisample);
|
||||
GetGLfunc(glBlitFramebuffer);
|
||||
GetGLfunc(glFramebufferRenderbuffer);
|
||||
GetGLfunc(glTexImage2DMultisample);
|
||||
GetGLfunc(glDrawBuffer);
|
||||
GetGLfunc(glReadBuffer);
|
||||
|
||||
// check if ALL functions are availible
|
||||
// what a mouthful
|
||||
if (pglGenFramebuffers && pglBindFramebuffer &&
|
||||
pglDeleteFramebuffers && pglFramebufferTexture2D &&
|
||||
pglCheckFramebufferStatus && pglGenRenderbuffers &&
|
||||
pglBindRenderbuffer && pglDeleteRenderbuffers &&
|
||||
pglRenderbufferStorage && pglFramebufferRenderbuffer)
|
||||
supportFBO = fbocheck;
|
||||
}
|
||||
else if (fbocheck == FBO_EXT || fbocheck == FBO_EXT_STENCIL) // uh oh only support for EXT prefix fbos...
|
||||
{
|
||||
GetGLfunc(glGenFramebuffersEXT);
|
||||
GetGLfunc(glBindFramebufferEXT);
|
||||
GetGLfunc(glDeleteFramebuffersEXT);
|
||||
GetGLfunc(glFramebufferTexture2DEXT);
|
||||
GetGLfunc(glCheckFramebufferStatusEXT);
|
||||
GetGLfunc(glGenRenderbuffersEXT);
|
||||
GetGLfunc(glBindRenderbufferEXT);
|
||||
GetGLfunc(glDeleteRenderbuffersEXT);
|
||||
GetGLfunc(glRenderbufferStorageEXT);
|
||||
GetGLfunc(glFramebufferRenderbufferEXT);
|
||||
|
||||
// check if ALL functions are availible
|
||||
// what a mouthful
|
||||
if (pglGenFramebuffersEXT && pglBindFramebufferEXT &&
|
||||
pglDeleteFramebuffersEXT && pglFramebufferTexture2DEXT &&
|
||||
pglCheckFramebufferStatusEXT && pglGenRenderbuffersEXT &&
|
||||
pglBindRenderbufferEXT && pglDeleteRenderbuffersEXT &&
|
||||
pglRenderbufferStorageEXT && pglFramebufferRenderbufferEXT)
|
||||
{
|
||||
// remapping galore huehue
|
||||
// do this so we dont have to dupe half our code
|
||||
pglGenFramebuffers = pglGenFramebuffersEXT;
|
||||
pglBindFramebuffer = pglBindFramebufferEXT;
|
||||
pglDeleteFramebuffers = pglDeleteFramebuffersEXT;
|
||||
pglFramebufferTexture2D = pglFramebufferTexture2DEXT;
|
||||
pglCheckFramebufferStatus = pglCheckFramebufferStatusEXT;
|
||||
pglGenRenderbuffers = pglGenRenderbuffersEXT;
|
||||
pglBindRenderbuffer = pglBindRenderbufferEXT;
|
||||
pglDeleteRenderbuffers = pglDeleteRenderbuffersEXT;
|
||||
pglRenderbufferStorage = pglRenderbufferStorageEXT;
|
||||
pglFramebufferRenderbuffer = pglFramebufferRenderbufferEXT;
|
||||
|
||||
// the enums "technically" should map the same
|
||||
// but better be safe than sorry
|
||||
FBO_FRAMEBUFFER = GL_FRAMEBUFFER_EXT;
|
||||
FBO_COLOR_ATTACHMENT = GL_COLOR_ATTACHMENT0_EXT;
|
||||
FBO_DEPTH_ATTACHMENT = GL_DEPTH_ATTACHMENT_EXT;
|
||||
FBO_DEPTH_STENCIL = (supportFBO == FBO_EXT_STENCIL) ? GL_DEPTH_STENCIL_EXT : GL_DEPTH_COMPONENT;
|
||||
FBO_RENDERBUFFER = GL_RENDERBUFFER_EXT;
|
||||
FBO_COMPLETE = GL_FRAMEBUFFER_COMPLETE_EXT;
|
||||
|
||||
supportFBO = fbocheck;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/*switch (supportFBO)
|
||||
{
|
||||
case FBO_ARB:
|
||||
GL_DBG_Printf("\nFBO: ARB extensions found\n");
|
||||
break;
|
||||
case FBO_EXT:
|
||||
GL_DBG_Printf("\nFBO: EXT extensions found, no stencil\n");
|
||||
break;
|
||||
case FBO_EXT_STENCIL:
|
||||
GL_DBG_Printf("\nFBO: EXT extensions with packed depth-stencil\n");
|
||||
break;
|
||||
case FBO_NONE:
|
||||
GL_DBG_Printf("\nFBO: No framebuffer object support\n");
|
||||
break;
|
||||
}*/
|
||||
#endif
|
||||
#undef GetGLfunc
|
||||
}
|
||||
@@ -889,7 +1060,7 @@ void GL_SetShaderInfo(hwdshaderinfo_t info, INT32 value)
|
||||
switch (info)
|
||||
{
|
||||
case HWD_SHADERINFO_LEVELTIME:
|
||||
shader_leveltime = (((float)(value-1)) + FIXED_TO_FLOAT(rendertimefrac)) / TICRATE;
|
||||
shader_leveltime = (((float)(value-1)) + FIXED_TO_FLOAT(R_GetTimeFrac(RTF_LEVEL))) / TICRATE;
|
||||
break;
|
||||
case HWD_SHADERINFO_LIGHT_X:
|
||||
shader_light_x = FixedToFloat(value);
|
||||
@@ -1060,6 +1231,53 @@ void GL_SetModelView(GLint w, GLint h)
|
||||
pglGetFloatv(GL_PROJECTION_MATRIX, projMatrix);
|
||||
}
|
||||
|
||||
#ifdef GLDEBUGMESSAGE
|
||||
static void APIENTRY DebugMessage(GLenum source, GLenum type, GLuint id, GLenum severity, GLsizei length, const GLchar *message, const void *userParam)
|
||||
{
|
||||
const char *debugsource, *debugtype;
|
||||
|
||||
switch (source)
|
||||
{
|
||||
#define S(s) case GL_DEBUG_SOURCE_##s: debugsource = #s; break
|
||||
S(API);
|
||||
S(WINDOW_SYSTEM);
|
||||
S(SHADER_COMPILER);
|
||||
S(THIRD_PARTY);
|
||||
S(APPLICATION);
|
||||
S(OTHER);
|
||||
#undef S
|
||||
default:
|
||||
debugsource = "unknown";
|
||||
break;
|
||||
}
|
||||
|
||||
switch (type)
|
||||
{
|
||||
#define S(s) case GL_DEBUG_TYPE_##s: debugtype = #s; break
|
||||
S(ERROR);
|
||||
S(DEPRECATED_BEHAVIOR);
|
||||
S(UNDEFINED_BEHAVIOR);
|
||||
S(PORTABILITY);
|
||||
S(PERFORMANCE);
|
||||
S(MARKER);
|
||||
S(PUSH_GROUP);
|
||||
S(POP_GROUP);
|
||||
S(OTHER);
|
||||
#undef S
|
||||
default:
|
||||
debugtype = "unknown";
|
||||
break;
|
||||
}
|
||||
|
||||
alerttype_t level = severity == GL_DEBUG_SEVERITY_HIGH ? CONS_ERROR
|
||||
: severity == GL_DEBUG_SEVERITY_MEDIUM ? CONS_WARNING
|
||||
: CONS_NOTICE;
|
||||
//CONS_Alert(level, "OpenGL (%s) (%s): %s\n", debugsource, debugtype, message);
|
||||
|
||||
printf("OpenGL (%s) (%s): %s\n", debugsource, debugtype, message);
|
||||
}
|
||||
#endif
|
||||
|
||||
// -----------------+
|
||||
// SetStates : Set permanent states
|
||||
// -----------------+
|
||||
@@ -1096,6 +1314,14 @@ void GL_SetStates(void)
|
||||
pglLoadIdentity();
|
||||
pglScalef(1.0f, 1.0f, -1.0f);
|
||||
pglGetFloatv(GL_MODELVIEW_MATRIX, modelMatrix); // added for new coronas' code (without depth buffer)
|
||||
|
||||
pglEnable(GL_MULTISAMPLE);
|
||||
|
||||
#ifdef GLDEBUGMESSAGE
|
||||
pglEnable(GL_DEBUG_OUTPUT);
|
||||
pglEnable(GL_DEBUG_OUTPUT_SYNCHRONOUS);
|
||||
pglDebugMessageCallback(&DebugMessage, NULL);
|
||||
#endif
|
||||
}
|
||||
|
||||
// -----------------+
|
||||
@@ -1134,48 +1360,80 @@ void GL_DeleteTexture(GLMipmap_t *pTexInfo)
|
||||
pTexInfo->downloaded = 0;
|
||||
}
|
||||
|
||||
#ifdef USE_FBO_OGL
|
||||
static void GL_Framebuffer_GenerateAttachments(void)
|
||||
enum
|
||||
{
|
||||
if (!supportFBO || !UseScreenFBO())
|
||||
FBO_RESOLV,
|
||||
FBO_MSAA,
|
||||
};
|
||||
|
||||
enum
|
||||
{
|
||||
RBO_COLOR,
|
||||
RBO_DEPTH,
|
||||
};
|
||||
|
||||
typedef struct
|
||||
{
|
||||
GLuint fbobject;
|
||||
GLuint rbo[2];
|
||||
} glfbo_t;
|
||||
|
||||
static glfbo_t FBO[2] = {};
|
||||
|
||||
static bool fboInit = false;
|
||||
|
||||
static void GL_Framebuffer_Generate(void)
|
||||
{
|
||||
if (!supportFBO || fboInit)
|
||||
return;
|
||||
|
||||
// Bind the framebuffer
|
||||
pglBindFramebuffer(GL_FRAMEBUFFER, FramebufferObject);
|
||||
if (!FBO[FBO_MSAA].fbobject)
|
||||
pglGenFramebuffers(1, &FBO[FBO_MSAA].fbobject);
|
||||
|
||||
// Generate the framebuffer texture
|
||||
if (!FramebufferTexture)
|
||||
pglBindFramebuffer(GL_FRAMEBUFFER, FBO[FBO_MSAA].fbobject);
|
||||
|
||||
if (!FBO[FBO_MSAA].rbo[RBO_COLOR])
|
||||
{
|
||||
pglGenTextures(1, &FramebufferTexture);
|
||||
pglBindTexture(GL_TEXTURE_2D, FramebufferTexture);
|
||||
pglTexImage2D(GL_TEXTURE_2D, 0, GL_RGB, screen_width, screen_height, 0, GL_RGB, GL_UNSIGNED_BYTE, NULL);
|
||||
pglTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR);
|
||||
pglTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR);
|
||||
pglBindTexture(GL_TEXTURE_2D, 0);
|
||||
|
||||
// Attach the framebuffer texture to the framebuffer
|
||||
pglFramebufferTexture2D(GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT0, GL_TEXTURE_2D, FramebufferTexture, 0);
|
||||
pglGenRenderbuffers(1, &FBO[FBO_MSAA].rbo[RBO_COLOR]);
|
||||
pglBindRenderbuffer(GL_RENDERBUFFER, FBO[FBO_MSAA].rbo[RBO_COLOR]);
|
||||
pglRenderbufferStorageMultisample(GL_RENDERBUFFER, 4, GL_RGBA8, screen_width, screen_height);
|
||||
pglFramebufferRenderbuffer(GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT0, GL_RENDERBUFFER, FBO[FBO_MSAA].rbo[RBO_COLOR]);
|
||||
}
|
||||
|
||||
// Generate the renderbuffer
|
||||
if (!RenderbufferObject)
|
||||
if (!FBO[FBO_MSAA].rbo[RBO_DEPTH])
|
||||
{
|
||||
pglGenRenderbuffers(1, &RenderbufferObject);
|
||||
pglGenRenderbuffers(1, &FBO[FBO_MSAA].rbo[RBO_DEPTH]);
|
||||
pglBindRenderbuffer(GL_RENDERBUFFER, FBO[FBO_MSAA].rbo[RBO_DEPTH]);
|
||||
pglRenderbufferStorageMultisample(GL_RENDERBUFFER, 4, GL_DEPTH24_STENCIL8, screen_width, screen_height);
|
||||
pglFramebufferRenderbuffer(GL_FRAMEBUFFER, GL_DEPTH_STENCIL_ATTACHMENT, GL_RENDERBUFFER, FBO[FBO_MSAA].rbo[RBO_DEPTH]);
|
||||
}
|
||||
|
||||
pglBindRenderbuffer(GL_RENDERBUFFER, RenderbufferObject);
|
||||
if (!FBO[FBO_RESOLV].fbobject)
|
||||
pglGenFramebuffers(1, &FBO[FBO_RESOLV].fbobject);
|
||||
|
||||
pglBindFramebuffer(GL_FRAMEBUFFER, FBO[FBO_RESOLV].fbobject);
|
||||
|
||||
if (!FBO[FBO_RESOLV].rbo[RBO_COLOR])
|
||||
{
|
||||
pglGenRenderbuffers(1, &FBO[FBO_RESOLV].rbo[RBO_COLOR]);
|
||||
pglBindRenderbuffer(GL_RENDERBUFFER, FBO[FBO_RESOLV].rbo[RBO_COLOR]);
|
||||
pglRenderbufferStorage(GL_RENDERBUFFER, GL_RGBA8, screen_width, screen_height);
|
||||
pglFramebufferRenderbuffer(GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT0, GL_RENDERBUFFER, FBO[FBO_RESOLV].rbo[RBO_COLOR]);
|
||||
}
|
||||
|
||||
if (!FBO[FBO_RESOLV].rbo[RBO_DEPTH])
|
||||
{
|
||||
pglGenRenderbuffers(1, &FBO[FBO_RESOLV].rbo[RBO_DEPTH]);
|
||||
pglBindRenderbuffer(GL_RENDERBUFFER, FBO[FBO_RESOLV].rbo[RBO_DEPTH]);
|
||||
pglRenderbufferStorage(GL_RENDERBUFFER, GL_DEPTH24_STENCIL8, screen_width, screen_height);
|
||||
pglFramebufferRenderbuffer(GL_FRAMEBUFFER, GL_DEPTH_STENCIL_ATTACHMENT, GL_RENDERBUFFER, RenderbufferObject);
|
||||
|
||||
// Clear the renderbuffer
|
||||
GL_ClearBuffer(true, true, true, NULL);
|
||||
|
||||
pglBindRenderbuffer(GL_RENDERBUFFER, 0);
|
||||
pglFramebufferRenderbuffer(GL_FRAMEBUFFER, GL_DEPTH_STENCIL_ATTACHMENT, GL_RENDERBUFFER, FBO[FBO_RESOLV].rbo[RBO_DEPTH]);
|
||||
}
|
||||
|
||||
// Unbind the framebuffer
|
||||
// unbind
|
||||
pglBindFramebuffer(GL_FRAMEBUFFER, 0);
|
||||
pglBindRenderbuffer(GL_RENDERBUFFER, 0);
|
||||
|
||||
fboinit = true;
|
||||
fboInit = true;
|
||||
}
|
||||
|
||||
static void GL_Framebuffer_DeleteAttachments(void)
|
||||
@@ -1183,47 +1441,51 @@ static void GL_Framebuffer_DeleteAttachments(void)
|
||||
if (!supportFBO || !fboinit)
|
||||
return;
|
||||
|
||||
if (!FramebufferObject && !RenderbufferObject && !FramebufferTexture)
|
||||
return;
|
||||
if (FBO[FBO_MSAA].rbo[RBO_COLOR])
|
||||
{
|
||||
pglDeleteRenderbuffers(1, &FBO[FBO_MSAA].rbo[RBO_COLOR]);
|
||||
FBO[FBO_MSAA].rbo[RBO_COLOR] = 0;
|
||||
}
|
||||
|
||||
// Unbind the framebuffer
|
||||
pglBindFramebuffer(GL_FRAMEBUFFER, 0);
|
||||
pglBindRenderbuffer(GL_RENDERBUFFER, 0);
|
||||
if (FBO[FBO_MSAA].rbo[RBO_DEPTH])
|
||||
{
|
||||
pglDeleteRenderbuffers(1, &FBO[FBO_MSAA].rbo[RBO_DEPTH]);
|
||||
FBO[FBO_MSAA].rbo[RBO_DEPTH] = 0;
|
||||
}
|
||||
|
||||
if (FramebufferTexture)
|
||||
pglDeleteTextures(1, &FramebufferTexture);
|
||||
if (FBO[FBO_RESOLV].rbo[RBO_COLOR])
|
||||
{
|
||||
pglDeleteRenderbuffers(1, &FBO[FBO_RESOLV].rbo[RBO_COLOR]);
|
||||
FBO[FBO_RESOLV].rbo[RBO_COLOR] = 0;
|
||||
}
|
||||
|
||||
if (RenderbufferObject)
|
||||
pglDeleteRenderbuffers(1, &RenderbufferObject);
|
||||
if (FBO[FBO_RESOLV].rbo[RBO_DEPTH])
|
||||
{
|
||||
pglDeleteRenderbuffers(1, &FBO[FBO_RESOLV].rbo[RBO_DEPTH]);
|
||||
FBO[FBO_RESOLV].rbo[RBO_DEPTH] = 0;
|
||||
}
|
||||
|
||||
FramebufferTexture = 0;
|
||||
RenderbufferObject = 0;
|
||||
fboinit = false;
|
||||
}
|
||||
|
||||
static void GL_Framebuffer_Generate(void)
|
||||
{
|
||||
if (!supportFBO || !UseScreenFBO())
|
||||
return;
|
||||
|
||||
// Generate the framebuffer
|
||||
if (!FramebufferObject)
|
||||
pglGenFramebuffers(1, &FramebufferObject);
|
||||
|
||||
if (pglCheckFramebufferStatus(GL_FRAMEBUFFER) == GL_FRAMEBUFFER_COMPLETE)
|
||||
GL_Framebuffer_GenerateAttachments();
|
||||
fboInit = false;
|
||||
}
|
||||
|
||||
static void GL_Framebuffer_Delete(void)
|
||||
{
|
||||
if (!supportFBO || !fboinit)
|
||||
if (!supportFBO)
|
||||
return;
|
||||
|
||||
if (FramebufferObject)
|
||||
pglDeleteFramebuffers(1, &FramebufferObject);
|
||||
|
||||
GL_Framebuffer_DeleteAttachments();
|
||||
FramebufferObject = 0;
|
||||
|
||||
if (FBO[FBO_MSAA].fbobject)
|
||||
{
|
||||
pglDeleteFramebuffers(1, &FBO[FBO_MSAA].fbobject);
|
||||
FBO[FBO_MSAA].fbobject = 0;
|
||||
}
|
||||
|
||||
if (FBO[FBO_RESOLV].fbobject)
|
||||
{
|
||||
pglDeleteFramebuffers(1, &FBO[FBO_RESOLV].fbobject);
|
||||
FBO[FBO_RESOLV].fbobject = 0;
|
||||
}
|
||||
}
|
||||
|
||||
void GL_Framebuffer_Unbind(void)
|
||||
@@ -1231,41 +1493,36 @@ void GL_Framebuffer_Unbind(void)
|
||||
if (!supportFBO || !fboinit)
|
||||
return;
|
||||
|
||||
if (!FramebufferObject && !RenderbufferObject)
|
||||
return;
|
||||
pglBindFramebuffer(GL_READ_FRAMEBUFFER, FBO[FBO_MSAA].fbobject);
|
||||
pglBindFramebuffer(GL_DRAW_FRAMEBUFFER, FBO[FBO_RESOLV].fbobject);
|
||||
|
||||
pglBlitFramebuffer(0, 0, screen_width, screen_height,
|
||||
0, 0, screen_width, screen_height,
|
||||
GL_COLOR_BUFFER_BIT,
|
||||
GL_NEAREST);
|
||||
|
||||
// back to default framebuffer
|
||||
pglBindFramebuffer(GL_FRAMEBUFFER, 0);
|
||||
pglBindRenderbuffer(GL_RENDERBUFFER, 0);
|
||||
}
|
||||
|
||||
void GL_Framebuffer_Enable(void)
|
||||
{
|
||||
if (!supportFBO || !UseScreenFBO())
|
||||
if (!supportFBO)
|
||||
return;
|
||||
|
||||
if (FramebufferObject == 0)
|
||||
GL_Framebuffer_Generate();
|
||||
else if (!FramebufferTexture || !RenderbufferObject)
|
||||
GL_Framebuffer_GenerateAttachments();
|
||||
|
||||
pglBindFramebuffer(GL_FRAMEBUFFER, FramebufferObject);
|
||||
pglBindRenderbuffer(GL_RENDERBUFFER, RenderbufferObject);
|
||||
GL_Framebuffer_Generate();
|
||||
pglBindFramebuffer(GL_FRAMEBUFFER, FBO[FBO_MSAA].fbobject);
|
||||
}
|
||||
|
||||
void GL_Framebuffer_Disable(void)
|
||||
{
|
||||
if (!supportFBO || !fboinit)
|
||||
return;
|
||||
|
||||
if (!FramebufferObject && !RenderbufferObject)
|
||||
if (!supportFBO)
|
||||
return;
|
||||
|
||||
pglBindFramebuffer(GL_FRAMEBUFFER, 0);
|
||||
pglBindRenderbuffer(GL_RENDERBUFFER, 0);
|
||||
|
||||
GL_Framebuffer_Delete();
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
// -----------------+
|
||||
// Flush : flush OpenGL textures
|
||||
@@ -2112,7 +2369,7 @@ static void GL_Shader_SetUniforms(FSurfaceInfo *Surface, GLRGBAFloat *poly, GLRG
|
||||
UNIFORM_1(shader->uniforms[gluniform_lighting], (GLfloat)Surface->LightInfo.light_level, pglUniform1f);
|
||||
UNIFORM_1(shader->uniforms[gluniform_fade_start], (GLfloat)Surface->LightInfo.fade_start, pglUniform1f);
|
||||
UNIFORM_1(shader->uniforms[gluniform_fade_end], (GLfloat)Surface->LightInfo.fade_end, pglUniform1f);
|
||||
directional = Surface->LightInfo.directional;
|
||||
directional = cv_glmdls.value && Surface->LightInfo.directional;
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -2841,7 +3098,7 @@ void GL_DrawModelEx(model_t *model, INT32 frameIndex, float duration, float tics
|
||||
scaley = vscale;
|
||||
scalez = hscale;
|
||||
|
||||
if (duration > 0.0 && tics >= 0.0) // don't interpolate if instantaneous or infinite in length
|
||||
if (duration > 0.0f && tics >= 0.0f) // don't interpolate if instantaneous or infinite in length
|
||||
{
|
||||
float newtime = (duration - tics); // + 1;
|
||||
|
||||
@@ -3142,8 +3399,8 @@ void GL_PostImgRedraw(float points[SCREENVERTS][SCREENVERTS][2])
|
||||
return;
|
||||
|
||||
// X/Y stretch fix for all resolutions(!)
|
||||
xfix = (float)(screen_texsizew)/((float)((screen_width)/(float)(SCREENVERTS-1)));
|
||||
yfix = (float)(screen_texsizeh)/((float)((screen_height)/(float)(SCREENVERTS-1)));
|
||||
xfix = (float)screen_texsizew/((float)(screen_width/(float)(SCREENVERTS-1)));
|
||||
yfix = (float)screen_texsizeh/((float)(screen_height/(float)(SCREENVERTS-1)));
|
||||
|
||||
pglDisable(GL_DEPTH_TEST);
|
||||
pglDisable(GL_BLEND);
|
||||
@@ -3230,12 +3487,9 @@ void GL_DrawScreenTexture(int tex, FSurfaceInfo *surf, FBITFIELD polyflags)
|
||||
if (gl_enable_screen_textures != 2)
|
||||
return;
|
||||
|
||||
xfix = 1/((float)(screen_texsizew)/((float)((screen_width))));
|
||||
yfix = 1/((float)(screen_texsizeh)/((float)((screen_height))));
|
||||
xfix = 1/((float)screen_texsizew/(float)screen_width);
|
||||
yfix = 1/((float)screen_texsizeh/(float)screen_height);
|
||||
|
||||
// const float screenVerts[12]
|
||||
|
||||
// float fix[8];
|
||||
fix[0] = 0.0f;
|
||||
fix[1] = 0.0f;
|
||||
fix[2] = 0.0f;
|
||||
@@ -3289,12 +3543,9 @@ void GL_DoScreenWipe(int wipeStart, int wipeEnd)
|
||||
if (!gl_enable_screen_textures)
|
||||
return;
|
||||
|
||||
xfix = 1/((float)(screen_texsizew)/((float)((screen_width))));
|
||||
yfix = 1/((float)(screen_texsizeh)/((float)((screen_height))));
|
||||
xfix = 1/((float)screen_texsizew/(float)screen_width);
|
||||
yfix = 1/((float)screen_texsizeh/(float)screen_height);
|
||||
|
||||
// const float screenVerts[12]
|
||||
|
||||
// float fix[8];
|
||||
fix[0] = 0.0f;
|
||||
fix[1] = 0.0f;
|
||||
fix[2] = 0.0f;
|
||||
@@ -3348,7 +3599,6 @@ void GL_DoScreenWipe(int wipeStart, int wipeEnd)
|
||||
|
||||
void GL_RenderVhsEffect(fixed_t upbary, fixed_t downbary, UINT8 updistort, UINT8 downdistort, UINT8 barsize)
|
||||
{
|
||||
int tex = HWD_SCREENTEXTURE_VHS;
|
||||
float xfix, yfix;
|
||||
float fix[8];
|
||||
GLubyte color[4] = {255, 255, 255, 255};
|
||||
@@ -3365,25 +3615,30 @@ void GL_RenderVhsEffect(fixed_t upbary, fixed_t downbary, UINT8 updistort, UINT8
|
||||
if (gl_enable_screen_textures != 2)
|
||||
return;
|
||||
|
||||
xfix = 1/((float)(screen_texsizew)/((float)((screen_width))));
|
||||
yfix = 1/((float)(screen_texsizeh)/((float)((screen_height))));
|
||||
xfix = 1/((float)screen_texsizew/(float)screen_width);
|
||||
yfix = 1/((float)screen_texsizeh/(float)screen_height);
|
||||
|
||||
const GLfloat scrwf = (float)screen_width;
|
||||
const GLfloat scrwh = (float)screen_height;
|
||||
|
||||
// Slight fuzziness
|
||||
GL_MakeScreenTexture(tex);
|
||||
GL_MakeScreenTexture(HWD_SCREENTEXTURE_VHS);
|
||||
GL_SetBlend(PF_Modulated|PF_Translucent|PF_NoDepthTest);
|
||||
pglBindTexture(GL_TEXTURE_2D, screenTextures[tex]);
|
||||
pglBindTexture(GL_TEXTURE_2D, screenTextures[HWD_SCREENTEXTURE_VHS]);
|
||||
|
||||
for (i = 0; i < 1; i += 2.f/vid.height)
|
||||
const float stride = 2.f/scrwh;
|
||||
|
||||
for (i = 0; i < 1; i += stride)
|
||||
{
|
||||
fix[2] = (float)(rand() % 128) / -22000 * xfix;
|
||||
fix[2] = (float)(rand() % 128) / -22000.f * xfix;
|
||||
fix[0] = fix[2];
|
||||
fix[6] = fix[0] + xfix;
|
||||
fix[4] = fix[2] + xfix;
|
||||
fix[1] = fix[7] = i*yfix;
|
||||
fix[3] = fix[5] = (i+0.015)*yfix;
|
||||
fix[3] = fix[5] = (i+0.015f)*yfix;
|
||||
|
||||
screenVerts[1] = screenVerts[10] = 2*i - 1.0f;
|
||||
screenVerts[4] = screenVerts[7] = screenVerts[1] + 0.03;
|
||||
screenVerts[4] = screenVerts[7] = screenVerts[1] + 0.03f;
|
||||
|
||||
pglColor4ubv(color);
|
||||
|
||||
@@ -3393,8 +3648,8 @@ void GL_RenderVhsEffect(fixed_t upbary, fixed_t downbary, UINT8 updistort, UINT8
|
||||
}
|
||||
|
||||
// Upward bar
|
||||
GL_MakeScreenTexture(tex);
|
||||
pglBindTexture(GL_TEXTURE_2D, screenTextures[tex]);
|
||||
//GL_MakeScreenTexture(HWD_SCREENTEXTURE_VHS);
|
||||
//pglBindTexture(GL_TEXTURE_2D, screenTextures[HWD_SCREENTEXTURE_VHS]);
|
||||
|
||||
color[0] = color[1] = color[2] = 190;
|
||||
color[3] = 250;
|
||||
@@ -3402,14 +3657,14 @@ void GL_RenderVhsEffect(fixed_t upbary, fixed_t downbary, UINT8 updistort, UINT8
|
||||
|
||||
fix[0] = 0.0f;
|
||||
fix[6] = xfix;
|
||||
fix[2] = (float)updistort / screen_width * xfix;
|
||||
fix[2] = (float)updistort / scrwf * xfix;
|
||||
fix[4] = fix[2] + fix[6];
|
||||
|
||||
screenVerts[1] = screenVerts[10] = 2.0f*upbary/screen_height - 1.0f;
|
||||
screenVerts[4] = screenVerts[7] = screenVerts[1] + (float)barsize/screen_height;
|
||||
screenVerts[1] = screenVerts[10] = 2.0f*upbary/scrwh - 1.0f;
|
||||
screenVerts[4] = screenVerts[7] = screenVerts[1] + (float)barsize/scrwh;
|
||||
|
||||
fix[1] = fix[7] = (float)upbary/screen_height * yfix;
|
||||
fix[3] = fix[5] = fix[1] + (float)barsize/2/screen_height * yfix;
|
||||
fix[1] = fix[7] = (float)upbary/scrwh * yfix;
|
||||
fix[3] = fix[5] = fix[1] + (float)barsize/2/scrwh * yfix;
|
||||
|
||||
pglTexCoordPointer(2, GL_FLOAT, 0, fix);
|
||||
pglVertexPointer(3, GL_FLOAT, 0, screenVerts);
|
||||
@@ -3422,19 +3677,19 @@ void GL_RenderVhsEffect(fixed_t upbary, fixed_t downbary, UINT8 updistort, UINT8
|
||||
pglDrawArrays(GL_TRIANGLE_FAN, 0, 4);
|
||||
|
||||
// Downward bar
|
||||
GL_MakeScreenTexture(tex);
|
||||
pglBindTexture(GL_TEXTURE_2D, screenTextures[tex]);
|
||||
//GL_MakeScreenTexture(HWD_SCREENTEXTURE_VHS);
|
||||
//pglBindTexture(GL_TEXTURE_2D, screenTextures[HWD_SCREENTEXTURE_VHS]);
|
||||
|
||||
fix[0] = 0.0f;
|
||||
fix[6] = xfix;
|
||||
fix[2] = (float)downdistort / screen_width * -xfix;
|
||||
fix[2] = (float)downdistort / scrwf * -xfix;
|
||||
fix[4] = fix[2] + fix[6];
|
||||
|
||||
screenVerts[1] = screenVerts[10] = 2.0f*downbary/screen_height - 1.0f;
|
||||
screenVerts[4] = screenVerts[7] = screenVerts[1] + (float)barsize/screen_height;
|
||||
screenVerts[1] = screenVerts[10] = 2.0f*downbary/scrwh - 1.0f;
|
||||
screenVerts[4] = screenVerts[7] = screenVerts[1] + (float)barsize/scrwh;
|
||||
|
||||
fix[1] = fix[7] = (float)downbary/screen_height * yfix;
|
||||
fix[3] = fix[5] = fix[1] + (float)barsize/2/screen_height * yfix;
|
||||
fix[1] = fix[7] = (float)downbary/scrwh * yfix;
|
||||
fix[3] = fix[5] = fix[1] + (float)barsize/2/scrwh * yfix;
|
||||
|
||||
pglTexCoordPointer(2, GL_FLOAT, 0, fix);
|
||||
pglVertexPointer(3, GL_FLOAT, 0, screenVerts);
|
||||
@@ -3450,11 +3705,13 @@ void GL_RenderVhsEffect(fixed_t upbary, fixed_t downbary, UINT8 updistort, UINT8
|
||||
// Create a texture from the screen.
|
||||
void GL_MakeScreenTexture(int tex)
|
||||
{
|
||||
boolean firstTime = (screenTextures[tex] == 0);
|
||||
boolean firstTime;
|
||||
|
||||
if (!gl_enable_screen_textures)
|
||||
return;
|
||||
|
||||
firstTime = (screenTextures[tex] == 0);
|
||||
|
||||
// Create screen texture
|
||||
if (firstTime)
|
||||
pglGenTextures(1, &screenTextures[tex]);
|
||||
@@ -3488,8 +3745,8 @@ void GL_DrawScreenFinalTexture(int tex, INT32 width, INT32 height, boolean usesh
|
||||
if (gl_enable_screen_textures != 2)
|
||||
return;
|
||||
|
||||
xfix = 1/((float)(screen_texsizew)/((float)((screen_width))));
|
||||
yfix = 1/((float)(screen_texsizeh)/((float)((screen_height))));
|
||||
xfix = 1/((float)screen_texsizew/(float)screen_width);
|
||||
yfix = 1/((float)screen_texsizeh/(float)screen_height);
|
||||
|
||||
origaspect = (float)screen_width / screen_height;
|
||||
newaspect = (float)width / height;
|
||||
@@ -3539,7 +3796,7 @@ void GL_DrawScreenFinalTexture(int tex, INT32 width, INT32 height, boolean usesh
|
||||
pglBindTexture(GL_TEXTURE_2D, screenTextures[tex]);
|
||||
|
||||
if (useshader)
|
||||
pglUseProgram(gl_shaders[SHADER_PALETTE_POSTPROCESS].program); // palette postprocess shader
|
||||
pglUseProgram(gl_shaders[SHADER_PALETTE_POSTPROCESS].program); // Final postprocess step of palette rendering, after everything else has been drawn.
|
||||
|
||||
pglColor4ubv(white);
|
||||
|
||||
@@ -3557,6 +3814,7 @@ void GL_DrawScreenFinalTexture(int tex, INT32 width, INT32 height, boolean usesh
|
||||
void GL_SetPaletteLookup(UINT8 *lut)
|
||||
{
|
||||
GLenum internalFormat;
|
||||
|
||||
if (gl_version[0] == '1' || gl_version[0] == '2')
|
||||
{
|
||||
// if the OpenGL version is below 3.0, then the GL_R8 format may not be available.
|
||||
@@ -3584,6 +3842,7 @@ void GL_SetPaletteLookup(UINT8 *lut)
|
||||
UINT32 GL_CreateLightTable(RGBA_t *hw_lighttable)
|
||||
{
|
||||
LTListItem *item = malloc(sizeof(LTListItem));
|
||||
|
||||
if (!LightTablesTail)
|
||||
{
|
||||
LightTablesHead = LightTablesTail = item;
|
||||
@@ -3593,6 +3852,7 @@ UINT32 GL_CreateLightTable(RGBA_t *hw_lighttable)
|
||||
LightTablesTail->next = item;
|
||||
LightTablesTail = item;
|
||||
}
|
||||
|
||||
item->next = NULL;
|
||||
pglGenTextures(1, &item->id);
|
||||
pglBindTexture(GL_TEXTURE_2D, item->id);
|
||||
|
||||
@@ -111,9 +111,8 @@ void GL_Framebuffer_Unbind(void);
|
||||
void GL_Framebuffer_Enable(void);
|
||||
void GL_Framebuffer_Disable(void);
|
||||
|
||||
extern GLuint FramebufferObject, FramebufferTexture, RenderbufferObject;
|
||||
extern GLboolean FrameBufferEnabled, RenderToFramebuffer;
|
||||
extern boolean supportFBO;
|
||||
extern int supportFBO;
|
||||
#endif
|
||||
|
||||
// ==========================================================================
|
||||
|
||||
+4
-20
@@ -943,7 +943,6 @@ static void Got_Saycmd(UINT8 **p, INT32 playernum)
|
||||
|
||||
// before we do anything, let's verify the guy isn't spamming, get this easier on us.
|
||||
|
||||
//if (stop_spamming[playernum] != 0 && cv_chatspamprotection.value && !(flags & HU_CSAY))
|
||||
if (stop_spamming[playernum] != 0 && consoleplayer != playernum && cv_chatspamprotection.value && !(flags & HU_CSAY))
|
||||
{
|
||||
CONS_Debug(DBG_NETPLAY,"Received SAY cmd too quickly from Player %d (%s), assuming as spam and blocking message.\n", playernum+1, player_names[playernum]);
|
||||
@@ -1039,6 +1038,7 @@ static void Got_Saycmd(UINT8 **p, INT32 playernum)
|
||||
tempchar = (char *)Z_Calloc(strlen(cstart) + strlen(adminchar) + 1, PU_STATIC, NULL);
|
||||
else if (IsPlayerAdmin(playernum))
|
||||
tempchar = (char *)Z_Calloc(strlen(cstart) + strlen(remotechar) + 1, PU_STATIC, NULL);
|
||||
|
||||
if (tempchar)
|
||||
{
|
||||
if (playernum == serverplayer)
|
||||
@@ -1073,17 +1073,6 @@ static void Got_Saycmd(UINT8 **p, INT32 playernum)
|
||||
}
|
||||
else // To everyone or sayteam, it doesn't change anything.
|
||||
fmt2 = "%s<%s%s%s>\x80 %s%s";
|
||||
/*else // To your team
|
||||
{
|
||||
if (players[playernum].ctfteam == 1) // red
|
||||
prefix = "\x85[TEAM]";
|
||||
else if (players[playernum].ctfteam == 2) // blue
|
||||
prefix = "\x84[TEAM]";
|
||||
else
|
||||
prefix = "\x83"; // makes sure this doesn't implode if you sayteam on non-team gamemodes
|
||||
|
||||
fmt2 = "%s<%s%s>\x80%s %s%s";
|
||||
}*/
|
||||
|
||||
HU_AddChatText(va(fmt2, prefix, cstart, dispname, cend, textcolor, msg), cv_chatnotifications.value); // add to chat
|
||||
|
||||
@@ -1658,7 +1647,7 @@ static void HU_drawMiniChat(void)
|
||||
if (cv_chatbacktint.value) // on request of wolfy
|
||||
V_DrawFillConsoleMap(x + dx + 2, y+dy, charwidth, charheight, 239|V_SNAPTOBOTTOM|V_SNAPTOLEFT);
|
||||
|
||||
V_DrawChatCharacter(x + dx + 2, y+dy, msg[j++] |V_SNAPTOBOTTOM|V_SNAPTOLEFT|transflag, !cv_allcaps.value, colormap);
|
||||
V_DrawChatCharacter(x + dx + 2, y+dy+cv_chatcentertext.value, msg[j++] |V_SNAPTOBOTTOM|V_SNAPTOLEFT|transflag, !cv_allcaps.value, colormap);
|
||||
}
|
||||
|
||||
dx += charwidth;
|
||||
@@ -1847,12 +1836,6 @@ static void HU_DrawChat(void)
|
||||
if (teamtalk)
|
||||
{
|
||||
talk = ttalk;
|
||||
#if 0
|
||||
if (players[consoleplayer].ctfteam == 1)
|
||||
t = 0x500; // Red
|
||||
else if (players[consoleplayer].ctfteam == 2)
|
||||
t = 0x400; // Blue
|
||||
#endif
|
||||
}
|
||||
|
||||
if (CHAT_MUTE)
|
||||
@@ -2049,6 +2032,7 @@ static void HU_DrawChat(void)
|
||||
V_DrawSmallString(chatx + boxw + 4, p_dispy - (6*count), V_SNAPTOBOTTOM|V_SNAPTOLEFT|V_ALLOWLOWERCASE, va("\x82%d\x80 - %s", i, player_names[i]));
|
||||
count++;
|
||||
}
|
||||
|
||||
if (count == 0) // no results.
|
||||
{
|
||||
V_DrawFillConsoleMap(chatx + boxw + 2, p_dispy - (6*count), 48, 6, 239 | V_SNAPTOBOTTOM | V_SNAPTOLEFT); // fill it like the chat so the text doesn't become hard to read because of the hud.
|
||||
@@ -2304,7 +2288,7 @@ static void HU_DrawSongCreditsBox(void)
|
||||
INT32 t = cursongcredit.anim;
|
||||
INT32 bgt;
|
||||
|
||||
fixed_t interpoffset = FixedMul(BOXCREDITHEIGHT*dup*FRACUNIT/(TICRATE/2), R_GetHudUncap());
|
||||
fixed_t interpoffset = FixedMul(BOXCREDITHEIGHT*dup*FRACUNIT/(TICRATE/2), R_GetTimeFrac(RTF_MENU));
|
||||
|
||||
if (t > BOXCREDITSLIDEIN)
|
||||
{
|
||||
|
||||
@@ -91,27 +91,6 @@ void I_GetEvent(void);
|
||||
*/
|
||||
void I_OsPolling(void);
|
||||
|
||||
// Either returns a null ticcmd,
|
||||
// or calls a loadable driver to build it.
|
||||
// This ticcmd will then be modified by the gameloop
|
||||
// for normal input.
|
||||
|
||||
/** \brief Input for the first player
|
||||
*/
|
||||
ticcmd_t *I_BaseTiccmd(void);
|
||||
|
||||
/** \brief Input for the second player
|
||||
*/
|
||||
ticcmd_t *I_BaseTiccmd2(void);
|
||||
|
||||
/** \brief Input for the third player
|
||||
*/
|
||||
ticcmd_t *I_BaseTiccmd3(void);
|
||||
|
||||
/** \brief Input for the fourth player
|
||||
*/
|
||||
ticcmd_t *I_BaseTiccmd4(void);
|
||||
|
||||
/** \brief Called by M_Responder when quit is selected, return exit code 0
|
||||
*/
|
||||
void I_Quit(void) FUNCNORETURN;
|
||||
|
||||
+2
-2
@@ -60,7 +60,7 @@ void I_UpdateTime(fixed_t timescale)
|
||||
tic_t realtics;
|
||||
|
||||
// get real tics
|
||||
ticratescaled = (double)TICRATE * FixedToFloat(timescale);
|
||||
ticratescaled = (double)TICRATE * FixedToDouble(timescale);
|
||||
|
||||
enterprecise = I_GetPreciseTime();
|
||||
elapsedseconds = (double)(enterprecise - oldenterprecise) / I_GetPrecisePrecision();
|
||||
@@ -79,6 +79,6 @@ void I_UpdateTime(fixed_t timescale)
|
||||
{
|
||||
double fractional, integral;
|
||||
fractional = modf(tictimer * ticratescaled, &integral);
|
||||
g_time.timefrac = FloatToFixed(fractional);
|
||||
g_time.timefrac = DoubleToFixed(fractional);
|
||||
}
|
||||
}
|
||||
+2
-5
@@ -24,6 +24,8 @@ extern "C" {
|
||||
#pragma interface
|
||||
#endif
|
||||
|
||||
void I_SetTextInput(void);
|
||||
|
||||
typedef enum
|
||||
{
|
||||
/// Software
|
||||
@@ -40,11 +42,6 @@ typedef enum
|
||||
*/
|
||||
extern rendermode_t rendermode;
|
||||
|
||||
|
||||
/** \brief use highcolor modes if true
|
||||
*/
|
||||
extern boolean highcolor;
|
||||
|
||||
/** \brief setup video mode
|
||||
*/
|
||||
void I_StartupGraphics(void);
|
||||
|
||||
-70
@@ -20176,73 +20176,3 @@ void P_PatchInfoTables(void)
|
||||
for (i = MT_FIRSTFREESLOT; i <= MT_LASTFREESLOT; i++)
|
||||
mobjinfo[i].doomednum = -1;
|
||||
}
|
||||
|
||||
#ifdef ALLOW_RESETDATA
|
||||
static char *sprnamesbackup;
|
||||
static state_t *statesbackup;
|
||||
static mobjinfo_t *mobjinfobackup;
|
||||
static size_t sprnamesbackupsize, statesbackupsize, mobjinfobackupsize;
|
||||
#endif
|
||||
|
||||
void P_BackupTables(void)
|
||||
{
|
||||
#ifdef ALLOW_RESETDATA
|
||||
// Allocate buffers in size equal to that of the uncompressed data to begin with
|
||||
sprnamesbackup = Z_Malloc(sizeof(sprnames), PU_STATIC, NULL);
|
||||
statesbackup = Z_Malloc(sizeof(states), PU_STATIC, NULL);
|
||||
mobjinfobackup = Z_Malloc(sizeof(mobjinfo), PU_STATIC, NULL);
|
||||
|
||||
// Sprite names
|
||||
sprnamesbackupsize = lzf_compress(sprnames, sizeof(sprnames), sprnamesbackup, sizeof(sprnames));
|
||||
if (sprnamesbackupsize > 0)
|
||||
sprnamesbackup = Z_Realloc(sprnamesbackup, sprnamesbackupsize, PU_STATIC, NULL);
|
||||
else
|
||||
M_Memcpy(sprnamesbackup, sprnames, sizeof(sprnames));
|
||||
|
||||
// States
|
||||
statesbackupsize = lzf_compress(states, sizeof(states), statesbackup, sizeof(states));
|
||||
if (statesbackupsize > 0)
|
||||
statesbackup = Z_Realloc(statesbackup, statesbackupsize, PU_STATIC, NULL);
|
||||
else
|
||||
M_Memcpy(statesbackup, states, sizeof(states));
|
||||
|
||||
// Mobj info
|
||||
mobjinfobackupsize = lzf_compress(mobjinfo, sizeof(mobjinfo), mobjinfobackup, sizeof(mobjinfo));
|
||||
if (mobjinfobackupsize > 0)
|
||||
mobjinfobackup = Z_Realloc(mobjinfobackup, mobjinfobackupsize, PU_STATIC, NULL);
|
||||
else
|
||||
M_Memcpy(mobjinfobackup, mobjinfo, sizeof(mobjinfo));
|
||||
#endif
|
||||
}
|
||||
|
||||
void P_ResetData(INT32 flags)
|
||||
{
|
||||
#ifndef ALLOW_RESETDATA
|
||||
(void)flags;
|
||||
CONS_Alert(CONS_NOTICE, M_GetText("P_ResetData(): not supported in this build.\n"));
|
||||
#else
|
||||
if (flags & 1)
|
||||
{
|
||||
if (sprnamesbackupsize > 0)
|
||||
lzf_decompress(sprnamesbackup, sprnamesbackupsize, sprnames, sizeof(sprnames));
|
||||
else
|
||||
M_Memcpy(sprnames, sprnamesbackup, sizeof(sprnamesbackup));
|
||||
}
|
||||
|
||||
if (flags & 2)
|
||||
{
|
||||
if (statesbackupsize > 0)
|
||||
lzf_decompress(statesbackup, statesbackupsize, states, sizeof(states));
|
||||
else
|
||||
M_Memcpy(states, statesbackup, sizeof(statesbackup));
|
||||
}
|
||||
|
||||
if (flags & 4)
|
||||
{
|
||||
if (mobjinfobackupsize > 0)
|
||||
lzf_decompress(mobjinfobackup, mobjinfobackupsize, mobjinfo, sizeof(mobjinfo));
|
||||
else
|
||||
M_Memcpy(mobjinfo, mobjinfobackup, sizeof(mobjinfobackup));
|
||||
}
|
||||
#endif
|
||||
}
|
||||
@@ -5147,8 +5147,4 @@ extern mobjinfo_t mobjinfo[NUMMOBJTYPES];
|
||||
|
||||
void P_PatchInfoTables(void);
|
||||
|
||||
void P_BackupTables(void);
|
||||
|
||||
void P_ResetData(INT32 flags);
|
||||
|
||||
#endif
|
||||
+155
-95
@@ -1073,7 +1073,7 @@ static void K_initKartHUD(void)
|
||||
|
||||
// K_GetScreenCoords needs the right view* variables
|
||||
R_SetViewContext(stplyrnum);
|
||||
R_InterpolateView(rendertimefrac_unpaused, !cv_uncappedhud.value);
|
||||
R_InterpolateView(R_GetTimeFrac(RTF_CAMERA), !cv_uncappedhud.value);
|
||||
}
|
||||
|
||||
UINT8 K_GetHudColor(void)
|
||||
@@ -1089,6 +1089,11 @@ boolean K_UseColorHud(void)
|
||||
return (cv_colorizedhud.value && clr_hud);
|
||||
}
|
||||
|
||||
// Since all our extra Saturn things are in optional files
|
||||
// we gotta do a bunch of extra checks to determine
|
||||
// if the according Assets are actually loaded
|
||||
// see D_CheckSaturnExtraFiles in d_main.c
|
||||
|
||||
enum
|
||||
{
|
||||
SPEEDO_VANILLA,
|
||||
@@ -1138,6 +1143,33 @@ static boolean K_UseColorSpeedo(int speedostyle)
|
||||
}
|
||||
}
|
||||
|
||||
enum
|
||||
{
|
||||
GAUGE_DEFAULT = 1,
|
||||
GAUGE_SMALL,
|
||||
GAUGE_BIGNUM,
|
||||
GAUGE_NUMONLY,
|
||||
GAUGE_EXTRA,
|
||||
};
|
||||
|
||||
static SINT8 K_GetDriftgaugeStyle(void)
|
||||
{
|
||||
if (driftgaugegfx)
|
||||
{
|
||||
if (cv_driftgaugestyle.value == 1)
|
||||
return GAUGE_DEFAULT;
|
||||
else if (cv_driftgaugestyle.value == 2)
|
||||
return GAUGE_SMALL;
|
||||
else if (cv_driftgaugestyle.value == 3)
|
||||
return GAUGE_BIGNUM;
|
||||
else if (cv_driftgaugestyle.value == 5 && xtra_speedo3)
|
||||
return GAUGE_EXTRA;
|
||||
}
|
||||
|
||||
// Fallback
|
||||
return GAUGE_NUMONLY; // (cv_driftgaugestyle.value == 4)
|
||||
}
|
||||
|
||||
static boolean K_IsHighResolution(void)
|
||||
{
|
||||
return (vid.width >= 640 && vid.height >= 400);
|
||||
@@ -1148,7 +1180,7 @@ boolean K_UseHighResPortraits(void)
|
||||
return (cv_highresportrait.value && K_IsHighResolution());
|
||||
}
|
||||
|
||||
// returns the players faceprefix
|
||||
// returns the players faceprefix patch
|
||||
// accounts for localskins
|
||||
patch_t *K_GetFacePrefix(player_t *player, INT32 skinnum)
|
||||
{
|
||||
@@ -1313,40 +1345,76 @@ static void K_drawKartStats(void)
|
||||
spdxoffset = 0;
|
||||
spdoffset = 0;
|
||||
|
||||
flags = V_SNAPTOBOTTOM|V_SNAPTOLEFT;
|
||||
|
||||
if (!LUA_HudEnabled(hud_statdisplay))
|
||||
return;
|
||||
|
||||
flags = V_SNAPTOBOTTOM|V_SNAPTOLEFT;
|
||||
|
||||
//Internal offset for speedometer
|
||||
|
||||
const UINT8 speedostyle = K_GetSpeedometerStyle();
|
||||
|
||||
if (cv_kartspeedometer.value && (!splitscreen))
|
||||
{
|
||||
if ((speedostyle == SPEEDO_EXTRA) || (speedostyle == SPEEDO_ACHII) || (speedostyle == SPEEDO_EXTRA3))
|
||||
spdoffset = -10;
|
||||
else if (speedostyle == SPEEDO_DIAL)
|
||||
switch (speedostyle)
|
||||
{
|
||||
spdxoffset = 11;
|
||||
spdoffset = 14;
|
||||
case SPEEDO_EXTRA:
|
||||
case SPEEDO_ACHII:
|
||||
case SPEEDO_EXTRA3:
|
||||
spdoffset = -10;
|
||||
break;
|
||||
case SPEEDO_DIAL:
|
||||
spdxoffset = 11;
|
||||
spdoffset = 14;
|
||||
break;
|
||||
default:
|
||||
spdoffset = -14;
|
||||
break;
|
||||
}
|
||||
else
|
||||
spdoffset = -14;
|
||||
}
|
||||
else
|
||||
spdoffset = 0;
|
||||
|
||||
if ((speedostyle != SPEEDO_DIAL) || (splitscreen))
|
||||
spdoffset += (G_BattleGametype() ? (stplyr->kartstuff[k_bumper] ? -5 : -8) : 0);
|
||||
if (G_BattleGametype() && ((speedostyle != SPEEDO_DIAL) || splitscreen))
|
||||
spdoffset += ((stplyr->kartstuff[k_bumper] ? -5 : -8));
|
||||
|
||||
// Customizations c:
|
||||
if (!splitscreen)
|
||||
{
|
||||
skin_t *fakeskin;
|
||||
INT32 flags2;
|
||||
|
||||
x += 18 + cv_stat_xoffset.value + spdxoffset;
|
||||
y += cv_stat_yoffset.value + spdoffset;
|
||||
|
||||
flags |= V_HUDTRANS;
|
||||
flags2 = flags|V_ALLOWLOWERCASE|V_SkinColorToHighlightcolor(stplyr->skincolor);
|
||||
|
||||
fakeskin = K_GetPlayerSkin(stplyr);
|
||||
|
||||
// Skin name
|
||||
if (K_IsHighResolution()) // V_DrawSmallString becomes a mess at low resolutions lel
|
||||
{
|
||||
V_DrawSmallString(x+20, y+12, flags2, fakeskin->realname);
|
||||
}
|
||||
else
|
||||
{
|
||||
V_DrawThinString(x+20, y+7, flags2, fakeskin->realname);
|
||||
}
|
||||
|
||||
// Icon and stats
|
||||
if (K_UseHighResPortraits())
|
||||
V_DrawSmallMappedPatch(x, y, flags, R_GetSkinFaceWant(stplyr), R_GetLocalTranslationColormap(fakeskin, fakeskin, stplyr->skincolor, GTC_CACHE, stplyr->skinlocal));
|
||||
else
|
||||
V_DrawMappedPatch(x, y, flags, R_GetSkinFaceRank(stplyr), R_GetLocalTranslationColormap(fakeskin, fakeskin, stplyr->skincolor, GTC_CACHE, stplyr->skinlocal));
|
||||
|
||||
V_DrawMappedPatch(x-3, y-2, flags, kp_facenum[min(9, max(1, stplyr->kartspeed))], R_GetTranslationColormap(TC_RAINBOW, SKINCOLOR_BLUEBERRY, GTC_CACHE));
|
||||
V_DrawMappedPatch(x+10, y+10, flags, kp_facenum[min(9, max(1, stplyr->kartweight))], R_GetTranslationColormap(TC_RAINBOW, SKINCOLOR_BURGUNDY, GTC_CACHE));
|
||||
|
||||
return;
|
||||
}
|
||||
else if (splitscreen == 1) // I tried my best, but this is still mess :/ < :Blobcatpats: c:
|
||||
|
||||
if (splitscreen == 1) // I tried my best, but this is still mess :/ < :Blobcatpats: c:
|
||||
{
|
||||
x -= 10;
|
||||
y -= 40;
|
||||
@@ -1384,35 +1452,8 @@ static void K_drawKartStats(void)
|
||||
|
||||
flags |= V_HUDTRANS;
|
||||
|
||||
if (!splitscreen)
|
||||
{
|
||||
skin_t *fakeskin;
|
||||
fakeskin = K_GetPlayerSkin(stplyr);
|
||||
|
||||
// Skin name
|
||||
if (K_IsHighResolution()) // V_DrawSmallString becomes a mess at low resolutions lel
|
||||
{
|
||||
V_DrawSmallString(x+20, y+12, flags|V_ALLOWLOWERCASE|V_SkinColorToHighlightcolor(stplyr->skincolor), fakeskin->realname);
|
||||
}
|
||||
else
|
||||
{
|
||||
V_DrawThinString(x+20, y+7, flags|V_ALLOWLOWERCASE|V_SkinColorToHighlightcolor(stplyr->skincolor), fakeskin->realname);
|
||||
}
|
||||
|
||||
// Icon and stats
|
||||
if (K_UseHighResPortraits())
|
||||
V_DrawSmallMappedPatch(x, y, flags, R_GetSkinFaceWant(stplyr), R_GetLocalTranslationColormap(fakeskin, fakeskin, stplyr->skincolor, GTC_CACHE, stplyr->skinlocal));
|
||||
else
|
||||
V_DrawMappedPatch(x, y, flags, R_GetSkinFaceRank(stplyr), R_GetLocalTranslationColormap(fakeskin, fakeskin, stplyr->skincolor, GTC_CACHE, stplyr->skinlocal));
|
||||
|
||||
V_DrawMappedPatch(x-3, y-2, flags, kp_facenum[min(9, max(1, stplyr->kartspeed))], R_GetTranslationColormap(TC_RAINBOW, SKINCOLOR_BLUEBERRY, GTC_CACHE));
|
||||
V_DrawMappedPatch(x+10, y+10, flags, kp_facenum[min(9, max(1, stplyr->kartweight))], R_GetTranslationColormap(TC_RAINBOW, SKINCOLOR_BURGUNDY, GTC_CACHE));
|
||||
}
|
||||
else
|
||||
{
|
||||
// In splitscreen, just draw a string with stats
|
||||
V_DrawString(x, y+10, flags, va("\x84%dS \x87%dW", stplyr->kartspeed, stplyr->kartweight));
|
||||
}
|
||||
// In splitscreen, just draw a string with stats
|
||||
V_DrawString(x, y+10, flags, va("\x84%dS \x87%dW", stplyr->kartspeed, stplyr->kartweight));
|
||||
}
|
||||
|
||||
static void K_drawKartItem(void)
|
||||
@@ -1699,7 +1740,7 @@ static void K_drawKartItem(void)
|
||||
switch (stplyr->kartstuff[k_itemblinkmode])
|
||||
{
|
||||
case 2:
|
||||
localcolor = (UINT8)(1 + (leveltime % (MAXSKINCOLORS-1)));
|
||||
localcolor = K_RainbowColor();
|
||||
break;
|
||||
case 1:
|
||||
localcolor = SKINCOLOR_RED;
|
||||
@@ -1730,7 +1771,7 @@ static void K_drawKartItem(void)
|
||||
|
||||
if (cv_fancyroulette.value && stplyr->kartstuff[k_itemroulette] && !stplyr->deadtimer)
|
||||
{
|
||||
fixed_t frac = R_GetHudUncap();
|
||||
fixed_t frac = R_GetTimeFrac(RTF_LEVEL);
|
||||
UINT8 fancystep = (offset ? 6 : 10);
|
||||
fixed_t fancyoffset = (stplyr->kartstuff[k_itemroulette] % 3)-1;
|
||||
|
||||
@@ -2454,8 +2495,9 @@ static void K_DrawDialSpeedometer(fixed_t speed,
|
||||
const UINT8 infoidx = (infoactive) ? 1 : 0;
|
||||
patch_t* dialpatch;
|
||||
|
||||
const fixed_t spd = FixedDiv(speed, divisor);
|
||||
const angle_t speedangle =
|
||||
FixedAngle(((min(135 * FRACUNIT, FixedDiv(speed, divisor)) - (45 * FRACUNIT))));
|
||||
FixedAngle(((min(135 * FRACUNIT, spd) - (45 * FRACUNIT))));
|
||||
|
||||
rot = R_GetRollAngle(speedangle);
|
||||
|
||||
@@ -2788,7 +2830,7 @@ static void K_drawKartBumpersOrKarma(void)
|
||||
}
|
||||
}
|
||||
|
||||
#define lerp(from, to) cv_uncappedhud.value ? from + FixedMul(rendertimefrac, to - from) : to
|
||||
#define lerp(from, to) cv_uncappedhud.value ? from + FixedMul(R_GetTimeFrac(RTF_LEVEL), to - from) : to
|
||||
|
||||
// converts mobj coordinates into screen coordinates
|
||||
// NOTE: use with V_NOSCALESTART!
|
||||
@@ -3038,6 +3080,12 @@ static void K_drawNameTags(void)
|
||||
else
|
||||
flipped = players[i].mo->eflags & MFE_VERTICALFLIP;
|
||||
|
||||
#ifdef HWRENDER
|
||||
// Needs extra offset. Not perfect but this will do for now
|
||||
if (rendermode == render_opengl && !cv_glshearing.value && cv_smallnametags.value)
|
||||
namey -= dup*6;
|
||||
#endif
|
||||
|
||||
if (cv_smallnametags.value || !nametaggfx)
|
||||
{
|
||||
if (flipped)
|
||||
@@ -3149,7 +3197,7 @@ static void K_drawDriftGauge(void)
|
||||
fixed_t basex, basey;
|
||||
const int dup = vid.dupx;
|
||||
int i;
|
||||
UINT8 *cmap;
|
||||
UINT8 *colormap = NULL;
|
||||
|
||||
static const UINT8 driftcolors[3][4] = {
|
||||
{0, 0, 10, 16}, // no drift
|
||||
@@ -3195,23 +3243,21 @@ skipcrap:
|
||||
const INT32 driftcharge = min(driftval*4, stplyr->kartstuff[k_driftcharge]);
|
||||
const INT32 driftlevel = min(driftcharge / driftval, 2);
|
||||
const INT32 drifttrans = ((cv_driftgaugetrans.value) ? V_LocalTransFlag() : 0);
|
||||
const SINT8 gaugestyle = K_GetDriftgaugeStyle();
|
||||
|
||||
basex = pos.x>>FRACBITS;
|
||||
basey = pos.y>>FRACBITS;
|
||||
|
||||
switch (cv_driftgaugestyle.value)
|
||||
switch (gaugestyle)
|
||||
{
|
||||
case 1:
|
||||
case 2:
|
||||
case 3:
|
||||
case 5:
|
||||
case GAUGE_DEFAULT:
|
||||
case GAUGE_SMALL:
|
||||
case GAUGE_EXTRA:
|
||||
case GAUGE_BIGNUM:
|
||||
{
|
||||
if (!driftgaugegfx)
|
||||
break;
|
||||
patch_t *driftpatch = NULL;
|
||||
|
||||
const boolean usescaledpatch = (cv_driftgaugestyle.value == 5 && xtra_speedo3);
|
||||
|
||||
if (cv_driftgaugestyle.value == 1 || cv_driftgaugestyle.value == 3 || usescaledpatch)
|
||||
if (gaugestyle == GAUGE_DEFAULT || gaugestyle == GAUGE_BIGNUM || gaugestyle == GAUGE_EXTRA)
|
||||
{
|
||||
barx = basex - dup*23;
|
||||
BAR_WIDTH = dup*47;
|
||||
@@ -3224,40 +3270,44 @@ skipcrap:
|
||||
|
||||
bary = basey - dup*2;
|
||||
|
||||
if (usescaledpatch) // i hate hud code i hate hud code i hate hud code i hate hud code i hate hud code.....
|
||||
if (gaugestyle == GAUGE_EXTRA) // i hate hud code i hate hud code i hate hud code i hate hud code i hate hud code.....
|
||||
{
|
||||
if (K_UseColorSpeedo(SPEEDO_EXTRA3)) // Colourized hud
|
||||
if (K_UseColorSpeedo(SPEEDO_EXTRA3)) // We reuse the extra speedometer patch hence this check
|
||||
{
|
||||
UINT8 *colormap = R_GetTranslationColormap(TC_DEFAULT, K_GetHudColor(), GTC_CACHE);
|
||||
V_DrawStretchyFixedPatch((basex - dup*30)<<FRACBITS, ((basey<<FRACBITS) - FixedMul(dup<<FRACBITS, 21*FRACUNIT/10)), XTRA3PSCALE, XTRA3VSCALE, V_NOSCALESTART|V_OFFSET|drifttrans, skp_smallstickerclr3, colormap, 0);
|
||||
colormap = R_GetTranslationColormap(TC_DEFAULT, K_GetHudColor(), GTC_CACHE);
|
||||
driftpatch = skp_smallstickerclr3;
|
||||
}
|
||||
else
|
||||
V_DrawStretchyFixedPatch((basex - dup*30)<<FRACBITS, ((basey<<FRACBITS) - FixedMul(dup<<FRACBITS, 21*FRACUNIT/10)), XTRA3PSCALE, XTRA3VSCALE, V_NOSCALESTART|V_OFFSET|drifttrans, skp_smallsticker3, NULL, 0);
|
||||
driftpatch = skp_smallsticker3;
|
||||
|
||||
V_DrawStretchyFixedPatch((basex - dup*30)<<FRACBITS, ((basey<<FRACBITS) - FixedMul(dup<<FRACBITS, 21*FRACUNIT/10)), XTRA3PSCALE, XTRA3VSCALE, V_NOSCALESTART|V_OFFSET|drifttrans, driftpatch, colormap, 0);
|
||||
}
|
||||
else
|
||||
{
|
||||
if (K_UseColorHud()) // Colourized hud
|
||||
{
|
||||
UINT8 *colormap = R_GetTranslationColormap(TC_DEFAULT, K_GetHudColor(), GTC_CACHE);
|
||||
V_DrawMappedPatch(cv_driftgaugestyle.value == 2 ? basex + dup*11 : basex, basey, V_NOSCALESTART|V_OFFSET|drifttrans, cv_driftgaugestyle.value == 2 ? driftgaugesmallcolor : driftgaugecolor, colormap);
|
||||
colormap = R_GetTranslationColormap(TC_DEFAULT, K_GetHudColor(), GTC_CACHE);
|
||||
driftpatch = (gaugestyle == GAUGE_SMALL ? driftgaugesmallcolor : driftgaugecolor);
|
||||
}
|
||||
else
|
||||
V_DrawMappedPatch(cv_driftgaugestyle.value == 2 ? basex + dup*11 : basex, basey, V_NOSCALESTART|V_OFFSET|drifttrans, cv_driftgaugestyle.value == 2 ? driftgaugesmall : driftgauge, NULL);
|
||||
driftpatch = (gaugestyle == GAUGE_SMALL ? driftgaugesmall : driftgauge);
|
||||
|
||||
V_DrawMappedPatch(gaugestyle == GAUGE_SMALL ? basex + dup*11 : basex, basey, V_NOSCALESTART|V_OFFSET|drifttrans, driftpatch, colormap);
|
||||
}
|
||||
|
||||
if (driftcharge >= driftval*4) // rainbow sparks
|
||||
{
|
||||
cmap = R_GetTranslationColormap(TC_RAINBOW, 1 + leveltime % (MAXSKINCOLORS-1),GTC_CACHE);
|
||||
colormap = R_GetTranslationColormap(TC_RAINBOW, K_RainbowColor(), GTC_CACHE);
|
||||
|
||||
for (i = 0; i < 4; i++)
|
||||
V_DrawFill(barx, bary+dup*1+dup*i, BAR_WIDTH, dup, (driftrainbow[min((leveltime % 18) + 1, 18 - 1)] + i*2) | V_NOSCALESTART|drifttrans);
|
||||
V_DrawFill(barx, bary+dup*1+dup*i, BAR_WIDTH, dup, (driftrainbow[min((leveltime % 18) + 1, 17)] + i*2) | V_NOSCALESTART|drifttrans);
|
||||
}
|
||||
else // none/blue/red
|
||||
{
|
||||
const INT32 limit = (driftval * (driftcharge >= driftval*2 ? 2 : 1));
|
||||
const INT32 width = ((driftcharge - (driftcharge >= driftval ? limit : 0)) * BAR_WIDTH) / limit;
|
||||
|
||||
cmap = R_GetTranslationColormap(TC_RAINBOW, driftskins[driftlevel],GTC_CACHE);
|
||||
colormap = R_GetTranslationColormap(TC_RAINBOW, driftskins[driftlevel], GTC_CACHE);
|
||||
|
||||
for (i = 0; i < 4; i++)
|
||||
{
|
||||
@@ -3269,20 +3319,20 @@ skipcrap:
|
||||
}
|
||||
|
||||
// right, also draw a cool number
|
||||
if (cv_driftgaugestyle.value == 3)
|
||||
V_DrawPaddedTallColorNum(basex + (dup*32), basey, V_NOSCALESTART|V_OFFSET|drifttrans, driftcharge*100 / driftval, 3, cmap);
|
||||
if (gaugestyle == GAUGE_BIGNUM)
|
||||
V_DrawPaddedTallColorNum(basex + (dup*32), basey, V_NOSCALESTART|V_OFFSET|drifttrans, driftcharge*100 / driftval, 3, colormap);
|
||||
else
|
||||
V_DrawPingNum(cv_driftgaugestyle.value == 2 ? basex + (dup*22) : basex + (dup*32), basey, V_NOSCALESTART|V_OFFSET|drifttrans, driftcharge*100 / driftval, cmap);
|
||||
V_DrawPingNum((gaugestyle == GAUGE_SMALL ? basex + (dup*22) : basex + (dup*32)), basey, V_NOSCALESTART|V_OFFSET|drifttrans, driftcharge*100 / driftval, colormap);
|
||||
}
|
||||
break;
|
||||
case 4:
|
||||
case GAUGE_NUMONLY:
|
||||
{
|
||||
if (driftcharge >= driftval*4)
|
||||
cmap = R_GetTranslationColormap(TC_RAINBOW, 1 + leveltime % (MAXSKINCOLORS-1),GTC_CACHE);
|
||||
colormap = R_GetTranslationColormap(TC_RAINBOW, K_RainbowColor(), GTC_CACHE);
|
||||
else
|
||||
cmap = R_GetTranslationColormap(TC_RAINBOW, driftskins[driftlevel],GTC_CACHE);
|
||||
colormap = R_GetTranslationColormap(TC_RAINBOW, driftskins[driftlevel], GTC_CACHE);
|
||||
|
||||
V_DrawPaddedTallColorNum(basex + (dup*16), basey, V_NOSCALESTART|V_OFFSET|drifttrans, driftcharge*100 / driftval, 3, cmap);
|
||||
V_DrawPaddedTallColorNum(basex + (dup*16), basey, V_NOSCALESTART|V_OFFSET|drifttrans, driftcharge*100 / driftval, 3, colormap);
|
||||
}
|
||||
break;
|
||||
default:
|
||||
@@ -3343,6 +3393,7 @@ static void K_drawKartWanted(void)
|
||||
{
|
||||
basex = WANT_X;
|
||||
basey = WANT_Y;
|
||||
|
||||
if (splitscreen == 2)
|
||||
{
|
||||
basey += 16; // slight adjust for 3P
|
||||
@@ -3457,7 +3508,7 @@ static void K_drawKartMinimapIcon(fixed_t objx, fixed_t objy, INT32 hudx, INT32
|
||||
fixed_t amnumxpos, amnumypos;
|
||||
INT32 amxpos, amypos;
|
||||
fixed_t scale = FRACUNIT;
|
||||
patch_t *AutomapPic;
|
||||
patch_t *AutomapPic = NULL;
|
||||
INT16 w, h;
|
||||
|
||||
AutomapPic = minimapinfo.minimap_pic;
|
||||
@@ -3514,7 +3565,6 @@ static void K_drawKartMinimapHead(mobj_t *mo, INT32 x, INT32 y, INT32 flags)
|
||||
INT32 amxpos, amypos, wntdamxpos, wntdamypos;
|
||||
fixed_t scale = FRACUNIT;
|
||||
patch_t *minimaphead = NULL;
|
||||
boolean minihead = K_useSmallMinimapHead(mo->player);
|
||||
|
||||
#ifdef ROTSPRITE
|
||||
angle_t rollangle = 0;
|
||||
@@ -3524,6 +3574,9 @@ static void K_drawKartMinimapHead(mobj_t *mo, INT32 x, INT32 y, INT32 flags)
|
||||
skin = K_GetMobjSkin(mo);
|
||||
minimaphead = (skinlocal ? localfacemmapprefix : facemmapprefix)[K_GetMobjSkinNum(skin, skinlocal)];
|
||||
|
||||
if (minimaphead == NULL)
|
||||
return;
|
||||
|
||||
amnumxpos = (FixedMul(lerp(mo->old_x, mo->x), minimapinfo.zoom) - minimapinfo.offs_x);
|
||||
amnumypos = -(FixedMul(lerp(mo->old_y, mo->y), minimapinfo.zoom) - minimapinfo.offs_y);
|
||||
|
||||
@@ -3538,6 +3591,7 @@ static void K_drawKartMinimapHead(mobj_t *mo, INT32 x, INT32 y, INT32 flags)
|
||||
V_DrawCenteredSmallStringAtFixed(amxpos + (4*FRACUNIT), amypos - (3*FRACUNIT), V_ALLOWLOWERCASE|flags|V_SkinColorToHighlightcolor(mo->color), player_names[player - players]);
|
||||
}
|
||||
|
||||
const boolean minihead = K_useSmallMinimapHead(mo->player);
|
||||
|
||||
// thx wanted reticle for having weird offsets very cool
|
||||
wntdamxpos = minihead ? amxpos + (1<<FRACBITS) : amxpos - (4<<FRACBITS);
|
||||
@@ -3707,7 +3761,7 @@ static void K_drawKartMinimap(void)
|
||||
splitflags |= V_HUDTRANS;
|
||||
|
||||
const SINT8 icondotradius = ((cv_minihead.value == 1) && !cv_showminimapnames.value) ? 8 : 10;
|
||||
patch_t* minipatch;
|
||||
patch_t* minipatch = NULL;
|
||||
INT32 rot;
|
||||
INT32 blending;
|
||||
|
||||
@@ -3755,7 +3809,7 @@ static void K_drawKartMinimap(void)
|
||||
else if (cv_showminimapangle.value == MINIANGLE_LIGHT)
|
||||
{
|
||||
rot = R_GetRollAngle(ang);
|
||||
minipatch = W_CachePatchNameRotated("MMAPHDLT", rot, PU_PATCH);
|
||||
minipatch = (patch_t *)W_CachePatchNameRotated("MMAPHDLT", rot, PU_PATCH);
|
||||
|
||||
blending = B_ADD;
|
||||
xoff = yoff = 0;
|
||||
@@ -3829,7 +3883,7 @@ static void K_drawKartFinish(void)
|
||||
|
||||
x = ((vid.width<<FRACBITS)/vid.dupx);
|
||||
xval = (kp_racefinish[pnum]->width<<FRACBITS);
|
||||
x = (FixedMul(((TICRATE - stplyr->kartstuff[k_cardanimation])<<FRACBITS) - R_GetHudUncap(), xval > x ? xval : x))/TICRATE;
|
||||
x = (FixedMul(((TICRATE - stplyr->kartstuff[k_cardanimation])<<FRACBITS) - R_GetTimeFrac(RTF_LEVEL), xval > x ? xval : x))/TICRATE;
|
||||
|
||||
if (splitscreen && stplyrnum == 1)
|
||||
x = -x;
|
||||
@@ -3848,7 +3902,8 @@ static void K_drawBattleFullscreen(void)
|
||||
// fill in the fractional bits
|
||||
if (cardanim && cardanim != 164*FRACUNIT)
|
||||
{
|
||||
INT32 frac = R_GetHudUncap() * ((164 - stplyr->kartstuff[k_cardanimation])/8 + 1);
|
||||
INT32 frac = R_GetTimeFrac(RTF_LEVEL) * ((164 - stplyr->kartstuff[k_cardanimation])/8 + 1);
|
||||
|
||||
if (stplyr->exiting)
|
||||
cardanim += frac;
|
||||
else
|
||||
@@ -3952,7 +4007,6 @@ static void K_drawBattleFullscreen(void)
|
||||
else
|
||||
V_DrawFixedPatch(x<<FRACBITS, ty<<FRACBITS, scale, 0, kp_timeoutsticker, NULL);
|
||||
|
||||
|
||||
V_DrawKartString(x-txoff, ty, 0, va("%d", stplyr->kartstuff[k_comebacktimer]/TICRATE));
|
||||
}
|
||||
}
|
||||
@@ -4092,17 +4146,23 @@ static void K_drawKartFirstPerson(void)
|
||||
x -= xoffs;
|
||||
else
|
||||
x += xoffs;
|
||||
|
||||
if (!splitscreen)
|
||||
y += yoffs;
|
||||
}
|
||||
|
||||
const INT32 driftcharge = stplyr->kartstuff[k_driftcharge];
|
||||
|
||||
// drift sparks!
|
||||
if ((leveltime & 1) && (stplyr->kartstuff[k_driftcharge] >= dsthree))
|
||||
colmap = R_GetTranslationColormap(TC_RAINBOW, (UINT8)(1 + (leveltime % (MAXSKINCOLORS-1))), GTC_CACHE);
|
||||
else if ((leveltime & 1) && (stplyr->kartstuff[k_driftcharge] >= dstwo))
|
||||
colmap = R_GetTranslationColormap(TC_RAINBOW, SKINCOLOR_KETCHUP, GTC_CACHE);
|
||||
else if ((leveltime & 1) && (stplyr->kartstuff[k_driftcharge] >= dsone))
|
||||
colmap = R_GetTranslationColormap(TC_RAINBOW, SKINCOLOR_SAPPHIRE, GTC_CACHE);
|
||||
if ((leveltime & 1) && driftcharge)
|
||||
{
|
||||
if (driftcharge >= dsthree)
|
||||
colmap = R_GetTranslationColormap(TC_RAINBOW, K_RainbowColor(), GTC_CACHE);
|
||||
else if (driftcharge >= dstwo)
|
||||
colmap = R_GetTranslationColormap(TC_RAINBOW, SKINCOLOR_KETCHUP, GTC_CACHE);
|
||||
else if (driftcharge >= dsone)
|
||||
colmap = R_GetTranslationColormap(TC_RAINBOW, SKINCOLOR_SAPPHIRE, GTC_CACHE);
|
||||
}
|
||||
else
|
||||
#endif
|
||||
// invincibility/grow/shrink!
|
||||
@@ -4131,7 +4191,7 @@ static void K_drawInput(void)
|
||||
|
||||
const UINT8 hudcolor = K_GetHudColor();
|
||||
const INT32 accent1 = splitflags|colortranslations[hudcolor][5];
|
||||
const INT32 accent2 = splitflags|colortranslations[hudcolor][9];
|
||||
const INT32 accent2 = splitflags|colortranslations[hudcolor][7];
|
||||
const UINT8 *hudcolormap = R_GetTranslationColormap(0, hudcolor, GTC_CACHE);
|
||||
|
||||
const ticcmd_t *cmd = &stplyr->cmd;
|
||||
@@ -4139,7 +4199,7 @@ static void K_drawInput(void)
|
||||
if (timeinmap < 113)
|
||||
{
|
||||
INT32 count = ((INT32)(timeinmap) - 105);
|
||||
INT32 frac = count > 0 && count < 6 ? R_GetHudUncap() << (FRACBITS - count - 11) : 0;
|
||||
INT32 frac = count > 0 && count < 6 ? R_GetTimeFrac(RTF_LEVEL) << (FRACBITS - count - 11) : 0;
|
||||
|
||||
offs = 64*FRACUNIT;
|
||||
while (count-- > 0)
|
||||
@@ -4329,8 +4389,8 @@ static void K_drawLapStartAnim(void)
|
||||
UINT8 *colormap = R_GetTranslationColormap(TC_DEFAULT, K_GetHudColor(), GTC_CACHE);
|
||||
INT32 vflags = V_SNAPTOTOP|V_HUDTRANS;
|
||||
|
||||
fixed_t slideout = max(0, 32*(((progress - 76)*FRACUNIT) + R_GetHudUncap()));
|
||||
fixed_t slidein = max(0, 32*(((stplyr->kartstuff[k_lapanimation] - 76)*FRACUNIT) - R_GetHudUncap()));
|
||||
fixed_t slideout = max(0, 32*(((progress - 76)*FRACUNIT) + R_GetTimeFrac(RTF_LEVEL)));
|
||||
fixed_t slidein = max(0, 32*(((stplyr->kartstuff[k_lapanimation] - 76)*FRACUNIT) - R_GetTimeFrac(RTF_LEVEL)));
|
||||
|
||||
// First, draw the emblem and hand
|
||||
INT32 emblemx = (BASEVIDWIDTH << (FRACBITS - 1)) + slidein;
|
||||
@@ -4341,7 +4401,7 @@ static void K_drawLapStartAnim(void)
|
||||
INT32 hand = stplyr->kartstuff[k_laphand];
|
||||
if (hand >= 1 && hand <= 3)
|
||||
{
|
||||
y += 4*FRACUNIT - abs((int)(leveltime % 8)*FRACUNIT + R_GetHudUncap() - 4*FRACUNIT);
|
||||
y += 4*FRACUNIT - abs((int)(leveltime % 8)*FRACUNIT + R_GetTimeFrac(RTF_LEVEL) - 4*FRACUNIT);
|
||||
V_DrawFixedPatch(emblemx, y, FRACUNIT, vflags, kp_lapanim_hand[hand - 1], NULL);
|
||||
}
|
||||
|
||||
@@ -4667,7 +4727,7 @@ void K_drawKartHUD(void)
|
||||
if (timeinmap < 113)
|
||||
{
|
||||
INT32 count = ((INT32)(timeinmap) - 104);
|
||||
INT32 frac = count > 0 ? R_GetHudUncap() << max(0, FRACBITS - count - 9) : 0;
|
||||
INT32 frac = count > 0 ? R_GetTimeFrac(RTF_LEVEL) << max(0, FRACBITS - count - 9) : 0;
|
||||
|
||||
offs = 256*FRACUNIT;
|
||||
while (count-- > 0)
|
||||
|
||||
+114
-65
@@ -91,16 +91,10 @@ static void saltyhop_onchange(void)
|
||||
{
|
||||
player_t *player = &players[i];
|
||||
|
||||
if (!player || !playeringame[i] || P_MobjWasRemoved(player->mo))
|
||||
if (!player || P_MobjWasRemoved(player->mo))
|
||||
continue;
|
||||
|
||||
player->mo->salty_jump = false;
|
||||
player->mo->salty_zoffset = 0;
|
||||
player->mo->salty_momz = 0;
|
||||
|
||||
player->mo->salty_ready = false;
|
||||
player->mo->salty_tapping = false;
|
||||
player->mo->init_salty = false;
|
||||
memset(&player->mo->salty, 0, sizeof(player->mo->salty));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -484,6 +478,15 @@ UINT8 colortranslations[MAXTRANSLATIONS][16] = {
|
||||
{120, 120, 96, 96, 97, 98, 98, 99, 81, 81, 69, 71, 73, 75, 77, 79}, // SKINCOLOR_CSUPER5
|
||||
};
|
||||
|
||||
//
|
||||
// Gives you a color to use for rainbow effects (like invincibility).
|
||||
// Return: Skincolor value.
|
||||
//
|
||||
UINT8 K_RainbowColor(void)
|
||||
{
|
||||
return (UINT8)(1 + (leveltime % (MAXSKINCOLORS-1)));
|
||||
}
|
||||
|
||||
// Define for getting accurate color brightness readings according to how the human eye sees them.
|
||||
// https://en.wikipedia.org/wiki/Relative_luminance
|
||||
// 0.2126 to red
|
||||
@@ -645,36 +648,46 @@ UINT8 K_GetKartColorByName(const char *name)
|
||||
return 0;
|
||||
}
|
||||
|
||||
//
|
||||
// returns the players skinnumber
|
||||
// accounts for localskins
|
||||
//
|
||||
INT32 K_GetSkinNum(player_t *player)
|
||||
{
|
||||
return player->localskin ? (player->localskin - 1) : player->skin;
|
||||
}
|
||||
|
||||
//
|
||||
// returns the mobj skinnumber
|
||||
// accounts for localskins
|
||||
//
|
||||
INT32 K_GetMobjSkinNum(const skin_t *skin, boolean local)
|
||||
{
|
||||
return skin - K_GetSkinArray(local);
|
||||
}
|
||||
|
||||
//
|
||||
// returns the players skinnumber
|
||||
// accounts for localskins
|
||||
//
|
||||
skin_t *K_GetMobjSkin(const mobj_t *mobj)
|
||||
{
|
||||
return mobj->localskin ? mobj->localskin : mobj->skin;
|
||||
}
|
||||
|
||||
//
|
||||
// returns the skin array to use
|
||||
// accounts for localskins
|
||||
//
|
||||
skin_t *K_GetSkinArray(boolean local)
|
||||
{
|
||||
return local ? localskins : skins;
|
||||
}
|
||||
|
||||
//
|
||||
// returns the players skin
|
||||
// accounts for localskins
|
||||
//
|
||||
skin_t *K_GetPlayerSkin(player_t *player)
|
||||
{
|
||||
return &K_GetSkinArray(player->skinlocal)[K_GetSkinNum(player)];
|
||||
@@ -2901,6 +2914,7 @@ void K_SpawnMineExplosion(mobj_t *source, UINT8 color)
|
||||
mobj_t *dust;
|
||||
mobj_t *truc;
|
||||
INT32 speed, speed2;
|
||||
fixed_t rand_x, rand_y, rand_z;
|
||||
|
||||
INT32 i, radius, height;
|
||||
mobj_t *smoldering = P_SpawnMobj(source->x, source->y, source->z, MT_SMOLDERING);
|
||||
@@ -2923,9 +2937,11 @@ void K_SpawnMineExplosion(mobj_t *source, UINT8 color)
|
||||
dust->scalespeed = source->scale/12;
|
||||
P_InstaThrust(dust, dust->angle, FixedMul(20*FRACUNIT, source->scale));
|
||||
|
||||
truc = P_SpawnMobj(source->x + P_RandomRange(-radius, radius)*FRACUNIT,
|
||||
source->y + P_RandomRange(-radius, radius)*FRACUNIT,
|
||||
source->z + P_RandomRange(0, height)*FRACUNIT, MT_BOOMEXPLODE);
|
||||
rand_z = source->z + P_RandomRange(0, height)*FRACUNIT;
|
||||
rand_y = source->y + P_RandomRange(-radius, radius)*FRACUNIT;
|
||||
rand_x = source->x + P_RandomRange(-radius, radius)*FRACUNIT;
|
||||
|
||||
truc = P_SpawnMobj(rand_x, rand_y, rand_z, MT_BOOMEXPLODE);
|
||||
K_MatchGenericExtraFlags(truc, source);
|
||||
P_SetScale(truc, source->scale);
|
||||
truc->destscale = source->scale*6;
|
||||
@@ -2942,9 +2958,11 @@ void K_SpawnMineExplosion(mobj_t *source, UINT8 color)
|
||||
|
||||
for (i = 0; i < 16; i++)
|
||||
{
|
||||
dust = P_SpawnMobj(source->x + P_RandomRange(-radius, radius)*FRACUNIT,
|
||||
source->y + P_RandomRange(-radius, radius)*FRACUNIT,
|
||||
source->z + P_RandomRange(0, height)*FRACUNIT, MT_SMOKE);
|
||||
rand_z = source->z + P_RandomRange(0, height)*FRACUNIT;
|
||||
rand_y = source->y + P_RandomRange(-radius, radius)*FRACUNIT;
|
||||
rand_x = source->x + P_RandomRange(-radius, radius)*FRACUNIT;
|
||||
|
||||
dust = P_SpawnMobj(rand_x, rand_y, rand_z, MT_SMOKE);
|
||||
P_SetMobjState(dust, S_OPAQUESMOKE1);
|
||||
P_SetScale(dust, source->scale);
|
||||
dust->destscale = source->scale*10;
|
||||
@@ -2952,9 +2970,11 @@ void K_SpawnMineExplosion(mobj_t *source, UINT8 color)
|
||||
dust->tics = 30;
|
||||
dust->momz = P_RandomRange(FixedMul(3*FRACUNIT, source->scale)>>FRACBITS, FixedMul(7*FRACUNIT, source->scale)>>FRACBITS)*FRACUNIT;
|
||||
|
||||
truc = P_SpawnMobj(source->x + P_RandomRange(-radius, radius)*FRACUNIT,
|
||||
source->y + P_RandomRange(-radius, radius)*FRACUNIT,
|
||||
source->z + P_RandomRange(0, height)*FRACUNIT, MT_BOOMPARTICLE);
|
||||
rand_z = source->z + P_RandomRange(0, height)*FRACUNIT;
|
||||
rand_y = source->y + P_RandomRange(-radius, radius)*FRACUNIT;
|
||||
rand_x = source->x + P_RandomRange(-radius, radius)*FRACUNIT;
|
||||
|
||||
truc = P_SpawnMobj(rand_x, rand_y, rand_z, MT_BOOMPARTICLE);
|
||||
K_MatchGenericExtraFlags(truc, source);
|
||||
P_SetScale(truc, source->scale);
|
||||
truc->destscale = source->scale*5;
|
||||
@@ -3084,7 +3104,7 @@ static UINT16 K_DriftSparkColor(player_t *player, INT32 charge)
|
||||
|
||||
if (charge >= K_GetKartDriftSparkValue(player)*4)
|
||||
{
|
||||
color = (UINT8)(1 + (leveltime % (MAXSKINCOLORS-1)));
|
||||
color = K_RainbowColor();
|
||||
}
|
||||
else if (charge >= K_GetKartDriftSparkValue(player)*2)
|
||||
{
|
||||
@@ -3313,70 +3333,70 @@ static void K_QuiteSaltyHop(player_t *player)
|
||||
return;
|
||||
|
||||
// what the fuck is this haya
|
||||
//fixed_t mos = FRACUNIT; // doesnt work correctly if it isnt :/
|
||||
mobj_t *pmo = player->mo;
|
||||
salty_t *psalt = &pmo->salty;
|
||||
const boolean onground = P_IsObjectOnGround(pmo);
|
||||
|
||||
// ready?
|
||||
if (!player->kartstuff[k_jmp])
|
||||
{
|
||||
pmo->salty_ready = true;
|
||||
pmo->salty_tapping = false;
|
||||
psalt->ready = true;
|
||||
psalt->tapping = false;
|
||||
}
|
||||
else if (pmo->salty_ready)
|
||||
else if (psalt->ready)
|
||||
{
|
||||
pmo->salty_ready = false;
|
||||
pmo->salty_tapping = true;
|
||||
psalt->ready = false;
|
||||
psalt->tapping = true;
|
||||
}
|
||||
else
|
||||
{
|
||||
pmo->salty_tapping = false;
|
||||
psalt->tapping = false;
|
||||
}
|
||||
|
||||
// GO!
|
||||
if (!pmo->init_salty)
|
||||
if (!psalt->init)
|
||||
{
|
||||
pmo->salty_jump = false;
|
||||
pmo->salty_zoffset = 0;
|
||||
pmo->salty_momz = 0;
|
||||
pmo->init_salty = true;
|
||||
psalt->jump = false;
|
||||
psalt->zoffset = 0;
|
||||
psalt->momz = 0;
|
||||
psalt->init = true;
|
||||
}
|
||||
else if (pmo->salty_jump)
|
||||
else if (psalt->jump)
|
||||
{
|
||||
if (pmo->eflags & MFE_JUSTHITFLOOR)
|
||||
{
|
||||
pmo->salty_zoffset = 0;
|
||||
psalt->zoffset = 0;
|
||||
}
|
||||
else if (onground)
|
||||
{
|
||||
pmo->salty_zoffset += pmo->salty_momz;
|
||||
pmo->salty_momz -= (FRACUNIT*3/2);
|
||||
psalt->zoffset += psalt->momz;
|
||||
psalt->momz -= (FRACUNIT*3/2);
|
||||
}
|
||||
else
|
||||
{
|
||||
pmo->salty_zoffset *= (49/50)*FRACUNIT;
|
||||
pmo->salty_momz = 0;
|
||||
psalt->zoffset *= (49/50)*FRACUNIT;
|
||||
psalt->momz = 0;
|
||||
}
|
||||
|
||||
if (pmo->salty_zoffset <= 0)
|
||||
if (psalt->zoffset <= 0)
|
||||
{
|
||||
if (cv_saltyhopsfx.value && !(pmo->eflags & MFE_JUSTHITFLOOR) && onground)
|
||||
S_StartSound(pmo, sfx_s268);
|
||||
pmo->salty_jump = false;
|
||||
pmo->salty_zoffset = 0;
|
||||
pmo->salty_momz = 0;
|
||||
psalt->jump = false;
|
||||
psalt->zoffset = 0;
|
||||
psalt->momz = 0;
|
||||
// shlamma damma
|
||||
if (cv_saltysquish.value)
|
||||
pmo->stretchslam += 8*FRACUNIT;
|
||||
}
|
||||
else if (cv_saltysquish.value && pmo->salty_zoffset >= 0)
|
||||
else if (cv_saltysquish.value && psalt->zoffset >= 0)
|
||||
{
|
||||
// goofy ahh hack
|
||||
pmo->spriteyscale += (FRACUNIT/8);
|
||||
pmo->spritexscale -= (FRACUNIT/8);
|
||||
}
|
||||
|
||||
pmo->spriteyoffset = FixedMul(pmo->salty_zoffset, cv_saltyheight.value);
|
||||
pmo->spriteyoffset = FixedMul(psalt->zoffset, cv_saltyheight.value);
|
||||
|
||||
if (cv_saltyhopsfx.value)
|
||||
{
|
||||
@@ -3386,11 +3406,11 @@ static void K_QuiteSaltyHop(player_t *player)
|
||||
S_StopSoundByID(pmo, sfx_drift);
|
||||
}
|
||||
}
|
||||
else if (pmo->salty_tapping && onground && !player->kartstuff[k_spinouttimer] && !player->kartstuff[k_squishedtimer])
|
||||
else if (psalt->tapping && onground && !player->kartstuff[k_spinouttimer] && !player->kartstuff[k_squishedtimer])
|
||||
{
|
||||
pmo->salty_jump = true;
|
||||
pmo->salty_zoffset = 0;
|
||||
pmo->salty_momz = 6*FRACUNIT;
|
||||
psalt->jump = true;
|
||||
psalt->zoffset = 0;
|
||||
psalt->momz = 6*FRACUNIT;
|
||||
if (cv_saltyhopsfx.value)
|
||||
S_StartSound(pmo, sfx_s25a);
|
||||
}
|
||||
@@ -3417,7 +3437,7 @@ boolean K_ShouldSlopeRoll(mobj_t *mobj)
|
||||
return false;
|
||||
|
||||
// seeing a character rotate mid-hop looks really janky
|
||||
if (!cv_saltyroll.value && mobj->player && mobj->player->mo->salty_jump)
|
||||
if (!cv_saltyroll.value && mobj->player && mobj->player->mo->salty.jump)
|
||||
return false;
|
||||
|
||||
return K_CheckSlopeRollDist(mobj);
|
||||
@@ -3611,9 +3631,13 @@ void K_SpawnWipeoutTrail(mobj_t *mo, boolean translucent)
|
||||
else
|
||||
aoff += ANGLE_45;
|
||||
|
||||
dust = P_SpawnMobj(mo->x + FixedMul(24*mo->scale, FINECOSINE(aoff>>ANGLETOFINESHIFT)) + (P_RandomRange(-8,8) << FRACBITS),
|
||||
mo->y + FixedMul(24*mo->scale, FINESINE(aoff>>ANGLETOFINESHIFT)) + (P_RandomRange(-8,8) << FRACBITS),
|
||||
mo->z, MT_WIPEOUTTRAIL);
|
||||
fixed_t rand_x;
|
||||
fixed_t rand_y;
|
||||
|
||||
rand_y = mo->y + FixedMul(24*mo->scale, FINESINE(aoff>>ANGLETOFINESHIFT)) + (P_RandomRange(-8,8) << FRACBITS);
|
||||
rand_x = mo->x + FixedMul(24*mo->scale, FINECOSINE(aoff>>ANGLETOFINESHIFT)) + (P_RandomRange(-8,8) << FRACBITS);
|
||||
|
||||
dust = P_SpawnMobj(rand_x, rand_y, mo->z, MT_WIPEOUTTRAIL);
|
||||
|
||||
P_SetTarget(&dust->target, mo);
|
||||
dust->angle = R_PointToAngle2(0,0,mo->momx,mo->momy);
|
||||
@@ -4859,7 +4883,9 @@ static void K_MoveHeldObjects(player_t *player)
|
||||
mobj_t *cur = player->mo->hnext;
|
||||
mobj_t *targ = player->mo;
|
||||
|
||||
if (P_IsObjectOnGround(player->mo) && player->speed > 0)
|
||||
const boolean ponground = P_IsObjectOnGround(player->mo);
|
||||
|
||||
if (ponground && player->speed > 0)
|
||||
player->kartstuff[k_bananadrag]++;
|
||||
|
||||
while (!P_MobjWasRemoved(cur))
|
||||
@@ -4916,13 +4942,18 @@ static void K_MoveHeldObjects(player_t *player)
|
||||
targz -= 8*(2*FRACUNIT)/7;
|
||||
}*/
|
||||
|
||||
if (cv_bananajitter.value && P_IsObjectOnGround(player->mo) && player->speed > 0 && player->kartstuff[k_bananadrag] > TICRATE
|
||||
&& M_RandomChance(min(FRACUNIT/2, FixedDiv(player->speed, K_GetKartSpeed(player, false))/2)))
|
||||
if (cv_bananajitter.value && ponground
|
||||
&& player->speed > 0 && player->kartstuff[k_bananadrag] > TICRATE)
|
||||
{
|
||||
if (leveltime & 1)
|
||||
cur->spriteyoffset += 8*(2*FRACUNIT)/7;
|
||||
else
|
||||
cur->spriteyoffset -= 8*(2*FRACUNIT)/7;
|
||||
const fixed_t halfpspeed = FixedDiv(player->speed, K_GetKartSpeed(player, false))/2;
|
||||
|
||||
if (M_RandomChance(min(FRACUNIT/2, halfpspeed)))
|
||||
{
|
||||
if (leveltime & 1)
|
||||
cur->spriteyoffset += 8*(2*FRACUNIT)/7;
|
||||
else
|
||||
cur->spriteyoffset -= 8*(2*FRACUNIT)/7;
|
||||
}
|
||||
}
|
||||
|
||||
if (speed > dist)
|
||||
@@ -5371,7 +5402,7 @@ static UINT8 K_GetSpeedLineColor(player_t *player, boolean colorSpeed)
|
||||
else if (player->kartstuff[k_driftboost] <= 50)
|
||||
speedcolor = SKINCOLOR_RASPBERRY;
|
||||
else if (player->kartstuff[k_driftboost] <= 125)
|
||||
speedcolor = (UINT8)(1 + (leveltime % (MAXSKINCOLORS-1)));
|
||||
speedcolor = K_RainbowColor();
|
||||
|
||||
if (cv_coloredspeedlines.value == 2)
|
||||
speedcolor = (leveltime & 1) ? playercolor : speedcolor;
|
||||
@@ -5400,10 +5431,15 @@ FUNCINLINE static ATTRINLINE void K_SpawnNormalSpeedLines(player_t *player, bool
|
||||
{
|
||||
randomFunc randomfunc = synched ? P_RandomRange : M_RandomRange;
|
||||
|
||||
mobj_t *fast = P_SpawnMobj(player->mo->x + (randomfunc(-36,36) * player->mo->scale),
|
||||
player->mo->y + (randomfunc(-36,36) * player->mo->scale),
|
||||
player->mo->z + (player->mo->height/2) + (randomfunc(-20,20) * player->mo->scale),
|
||||
MT_FASTLINE);
|
||||
fixed_t rand_x;
|
||||
fixed_t rand_y;
|
||||
fixed_t rand_z;
|
||||
|
||||
rand_z = player->mo->z + (player->mo->height/2) + (randomfunc(-20,20) * player->mo->scale);
|
||||
rand_y = player->mo->y + (randomfunc(-36,36) * player->mo->scale);
|
||||
rand_x = player->mo->x + (randomfunc(-36,36) * player->mo->scale);
|
||||
|
||||
mobj_t *fast = P_SpawnMobj(rand_x, rand_y, rand_z, MT_FASTLINE);
|
||||
|
||||
fast->angle = R_PointToAngle2(0, 0, player->mo->momx, player->mo->momy);
|
||||
fast->momx = 3*player->mo->momx/4;
|
||||
@@ -6010,14 +6046,27 @@ static void K_KartDrift(player_t *player, boolean onground)
|
||||
if (player->speed > minspeed*2)
|
||||
player->kartstuff[k_getsparks] = 1;
|
||||
|
||||
const boolean driftblue = (player->kartstuff[k_driftcharge] < dsone && player->kartstuff[k_driftcharge]+driftadditive >= dsone);
|
||||
const boolean driftred = (player->kartstuff[k_driftcharge] < dstwo && player->kartstuff[k_driftcharge]+driftadditive >= dstwo);
|
||||
const boolean driftrainbow = (player->kartstuff[k_driftcharge] < dsthree && player->kartstuff[k_driftcharge]+driftadditive >= dsthree);
|
||||
|
||||
// Sound whenever you get a different tier of sparks
|
||||
if ((player->kartstuff[k_driftcharge] < dsone && player->kartstuff[k_driftcharge]+driftadditive >= dsone)
|
||||
|| (player->kartstuff[k_driftcharge] < dstwo && player->kartstuff[k_driftcharge]+driftadditive >= dstwo)
|
||||
|| (player->kartstuff[k_driftcharge] < dsthree && player->kartstuff[k_driftcharge]+driftadditive >= dsthree))
|
||||
if (driftblue
|
||||
|| driftred
|
||||
|| driftrainbow)
|
||||
{
|
||||
//S_StartSound(player->mo, sfx_s3ka2);
|
||||
if (P_IsLocalPlayer(player)) // UGHGHGH...
|
||||
{
|
||||
S_StartSoundAtVolume(player->mo, sfx_s3ka2, 192); // Ugh...
|
||||
}
|
||||
|
||||
if (driftrainbow)
|
||||
player->driftlevel = 3;
|
||||
else if (driftred)
|
||||
player->driftlevel = 2;
|
||||
else if (driftblue)
|
||||
player->driftlevel = 1;
|
||||
|
||||
player->driftsparkGrowTimer = DRIFTSPARKGROWTICS;
|
||||
}
|
||||
|
||||
@@ -19,6 +19,7 @@ extern "C" {
|
||||
extern UINT8 colortranslations[MAXTRANSLATIONS][16];
|
||||
extern const char *KartColor_Names[MAXSKINCOLORS];
|
||||
extern const UINT8 KartColor_Opposite[MAXSKINCOLORS*2];
|
||||
UINT8 K_RainbowColor(void);
|
||||
void K_RainbowColormap(UINT8 *dest_colormap, UINT8 skincolor);
|
||||
void K_GenerateKartColormap(UINT8 *dest_colormap, INT32 skinnum, UINT8 color, boolean local);
|
||||
UINT8 K_GetKartColorByName(const char *name);
|
||||
|
||||
+20
-24
@@ -99,11 +99,12 @@ static int lib_chatprint(lua_State *L)
|
||||
{
|
||||
const char *str = luaL_checkstring(L, 1); // retrieve string
|
||||
boolean sound = lua_optboolean(L, 2); // retrieve sound boolean
|
||||
int len = strlen(str);
|
||||
|
||||
if (str == NULL) // error if we don't have a string!
|
||||
return luaL_error(L, LUA_QL("tostring") " must return a string to " LUA_QL("chatprint"));
|
||||
|
||||
int len = strlen(str);
|
||||
|
||||
if (len > 255) // string is too long!!!
|
||||
return luaL_error(L, "String exceeds the 255 characters limit of the chat buffer.");
|
||||
|
||||
@@ -117,7 +118,6 @@ static int lib_chatprintf(lua_State *L)
|
||||
int n = lua_gettop(L); /* number of arguments */
|
||||
const char *str = luaL_checkstring(L, 2); // retrieve string
|
||||
boolean sound = lua_optboolean(L, 3); // sound?
|
||||
int len = strlen(str);
|
||||
player_t *plr;
|
||||
|
||||
if (n < 2)
|
||||
@@ -126,12 +126,15 @@ static int lib_chatprintf(lua_State *L)
|
||||
plr = *((player_t **)luaL_checkudata(L, 1, META_PLAYER)); // retrieve player
|
||||
if (!plr)
|
||||
return LUA_ErrInvalid(L, "player_t");
|
||||
|
||||
if (plr != &players[consoleplayer])
|
||||
return 0;
|
||||
|
||||
if (str == NULL) // error if we don't have a string!
|
||||
return luaL_error(L, LUA_QL("tostring") " must return a string to " LUA_QL("chatprintf"));
|
||||
|
||||
int len = strlen(str);
|
||||
|
||||
if (len > 255) // string is too long!!!
|
||||
return luaL_error(L, "String exceeds the 255 characters limit of the chat buffer.");
|
||||
|
||||
@@ -236,7 +239,7 @@ static int lib_pRandomChance(lua_State *L)
|
||||
// P_MAPUTIL
|
||||
///////////////
|
||||
|
||||
static int lib_pAproxDistance(lua_State *L)
|
||||
FUNCINLINE static ATTRINLINE int lib_pAproxDistance(lua_State *L)
|
||||
{
|
||||
fixed_t dx = luaL_checkfixed(L, 1);
|
||||
fixed_t dy = luaL_checkfixed(L, 2);
|
||||
@@ -1110,19 +1113,10 @@ static int lib_pCheckSight(lua_State *L)
|
||||
//HUDSAFE?
|
||||
if (!t1 || !t2)
|
||||
return LUA_ErrInvalid(L, "mobj_t");
|
||||
lua_pushboolean(L, P_CheckSight(t1, t2));
|
||||
return 1;
|
||||
}
|
||||
|
||||
// DONT USE THIS FOR ANYTHING GAMEPLAY, THIS WILL DESYNCH!
|
||||
static int lib_pCheckSightFast(lua_State *L)
|
||||
{
|
||||
mobj_t *t1 = *((mobj_t **)luaL_checkudata(L, 1, META_MOBJ));
|
||||
mobj_t *t2 = *((mobj_t **)luaL_checkudata(L, 2, META_MOBJ));
|
||||
//HUDSAFE?
|
||||
if (!t1 || !t2)
|
||||
return LUA_ErrInvalid(L, "mobj_t");
|
||||
lua_pushboolean(L, P_CheckSightFast(t1, t2));
|
||||
if (hud_running)
|
||||
lua_pushboolean(L, P_CheckSightFast(t1, t2));
|
||||
else
|
||||
lua_pushboolean(L, P_CheckSight(t1, t2));
|
||||
return 1;
|
||||
}
|
||||
|
||||
@@ -1643,7 +1637,7 @@ static int lib_evCrumbleChain(lua_State *L)
|
||||
// P_SLOPES
|
||||
////////////
|
||||
|
||||
static int lib_pGetZAt(lua_State *L)
|
||||
FUNCINLINE static ATTRINLINE int lib_pGetZAt(lua_State *L)
|
||||
{
|
||||
pslope_t *slope = *((pslope_t **)luaL_checkudata(L, 1, META_SLOPE));
|
||||
fixed_t x = luaL_checkfixed(L, 2);
|
||||
@@ -1659,7 +1653,7 @@ static int lib_pGetZAt(lua_State *L)
|
||||
// R_DEFS
|
||||
////////////
|
||||
|
||||
static int lib_rPointToAngle(lua_State *L)
|
||||
FUNCINLINE static ATTRINLINE int lib_rPointToAngle(lua_State *L)
|
||||
{
|
||||
fixed_t x = luaL_checkfixed(L, 1);
|
||||
fixed_t y = luaL_checkfixed(L, 2);
|
||||
@@ -1668,7 +1662,7 @@ static int lib_rPointToAngle(lua_State *L)
|
||||
return 1;
|
||||
}
|
||||
|
||||
static int lib_rPointToAngle2(lua_State *L)
|
||||
FUNCINLINE static ATTRINLINE int lib_rPointToAngle2(lua_State *L)
|
||||
{
|
||||
fixed_t px2 = luaL_checkfixed(L, 1);
|
||||
fixed_t py2 = luaL_checkfixed(L, 2);
|
||||
@@ -1679,7 +1673,7 @@ static int lib_rPointToAngle2(lua_State *L)
|
||||
return 1;
|
||||
}
|
||||
|
||||
static int lib_rPointToDist(lua_State *L)
|
||||
FUNCINLINE static ATTRINLINE int lib_rPointToDist(lua_State *L)
|
||||
{
|
||||
fixed_t x = luaL_checkfixed(L, 1);
|
||||
fixed_t y = luaL_checkfixed(L, 2);
|
||||
@@ -1688,7 +1682,7 @@ static int lib_rPointToDist(lua_State *L)
|
||||
return 1;
|
||||
}
|
||||
|
||||
static int lib_rPointToDist2(lua_State *L)
|
||||
FUNCINLINE static ATTRINLINE int lib_rPointToDist2(lua_State *L)
|
||||
{
|
||||
fixed_t px2 = luaL_checkfixed(L, 1);
|
||||
fixed_t py2 = luaL_checkfixed(L, 2);
|
||||
@@ -1699,12 +1693,15 @@ static int lib_rPointToDist2(lua_State *L)
|
||||
return 1;
|
||||
}
|
||||
|
||||
static int lib_rPointInSubsector(lua_State *L)
|
||||
FUNCINLINE static ATTRINLINE int lib_rPointInSubsector(lua_State *L)
|
||||
{
|
||||
fixed_t x = luaL_checkfixed(L, 1);
|
||||
fixed_t y = luaL_checkfixed(L, 2);
|
||||
//HUDSAFE
|
||||
LUA_PushUserdata(L, R_PointInSubsector(x, y), META_SUBSECTOR);
|
||||
if (hud_running)
|
||||
LUA_PushUserdata(L, R_PointInSubsectorFast(x, y), META_SUBSECTOR);
|
||||
else
|
||||
LUA_PushUserdata(L, R_PointInSubsector(x, y), META_SUBSECTOR);
|
||||
return 1;
|
||||
}
|
||||
|
||||
@@ -3180,7 +3177,6 @@ static luaL_Reg lib[] = {
|
||||
{"P_SlideMove",lib_pSlideMove},
|
||||
{"P_BounceMove",lib_pBounceMove},
|
||||
{"P_CheckSight", lib_pCheckSight},
|
||||
{"P_CheckSightFast", lib_pCheckSightFast},
|
||||
{"P_CheckHoopPosition",lib_pCheckHoopPosition},
|
||||
{"P_RadiusAttack",lib_pRadiusAttack},
|
||||
{"P_FloorzAtPos",lib_pFloorzAtPos},
|
||||
|
||||
@@ -136,6 +136,7 @@ void COM_Lua_f(void)
|
||||
lua_pop(gL, 1); // pop command info table
|
||||
return; // can't execute splitscreen command without player 2!
|
||||
}
|
||||
|
||||
playernum = displayplayers[1];
|
||||
}
|
||||
|
||||
|
||||
@@ -66,6 +66,7 @@
|
||||
X (IntermissionThinker),/* Y_Ticker */\
|
||||
X (VoteThinker),/*SRB2KART*/\
|
||||
X (ServerJoin),/* SRB2KART - Saturn 32p*/\
|
||||
X (SetupVote),/*SRB2KART - Saturn*/
|
||||
|
||||
#define STRING_HOOK_LIST(X) \
|
||||
X (BotAI),/* B_BuildTailsTiccmd by skin name */\
|
||||
@@ -140,3 +141,8 @@ int LUA_HookShouldSquish(player_t *player, mobj_t *inflictor, mobj_t *source); /
|
||||
boolean LUA_HookPlayerSpin(player_t *player, mobj_t *inflictor, mobj_t *source); // SRB2KART: Hook for K_SpinPlayer. Allows Lua to execute code and/or overwrite its behavior.
|
||||
boolean LUA_HookPlayerExplode(player_t *player, mobj_t *inflictor, mobj_t *source); // SRB2KART: Hook for K_ExplodePlayer. Allows Lua to execute code and/or overwrite its behavior.
|
||||
boolean LUA_HookPlayerSquish(player_t *player, mobj_t *inflictor, mobj_t *source); // SRB2KART: Hook for K_SquishPlayer. Allows Lua to execute code and/or overwrite its behavior.
|
||||
|
||||
// SRB2KART - Saturn: Allows changing vote level picks
|
||||
// (note: function format in lua doesn't include maxresults, so its function(result, gametype, secondgametype, prevmap)
|
||||
// to get maxresults use #result)
|
||||
void LUA_HookSetupVote(INT16 result[], INT16 maxresults, UINT8 gt, UINT8 secondgt);
|
||||
+41
-1
@@ -393,7 +393,7 @@ FUNCINLINE static ATTRINLINE boolean prepare_string_hook
|
||||
return false;
|
||||
}
|
||||
|
||||
static boolean prepare_hud_hook
|
||||
FUNCINLINE static ATTRINLINE boolean prepare_hud_hook
|
||||
(
|
||||
Hook_State * hook,
|
||||
int hook_type
|
||||
@@ -1138,3 +1138,43 @@ boolean LUA_HookPlayerExplode(player_t *player, mobj_t *inflictor, mobj_t *sourc
|
||||
{
|
||||
return kartdamage_hook(player, inflictor, source, HOOK(PlayerExplode), res_true);
|
||||
}
|
||||
|
||||
void LUA_HookSetupVote(INT16 result[], INT16 maxresults, UINT8 gt, UINT8 secondgt)
|
||||
{
|
||||
Hook_State hook;
|
||||
if (prepare_hook(&hook, 0, HOOK(SetupVote)))
|
||||
{
|
||||
// { 0, 0, 0, 0, }
|
||||
lua_newtable(gL);
|
||||
for (int i = 1; i <= maxresults; ++i)
|
||||
{
|
||||
lua_pushinteger(gL, 0);
|
||||
lua_rawseti(gL, -2, i);
|
||||
}
|
||||
|
||||
// call_hooks does lua_settop(gL, 0) so we need to store our table somewhere
|
||||
lua_pushvalue(gL, -1);
|
||||
lua_setfield(gL, LUA_REGISTRYINDEX, "SetupVoteResults");
|
||||
|
||||
lua_pushinteger(gL, gt);
|
||||
lua_pushinteger(gL, secondgt);
|
||||
lua_pushinteger(gL, prevmap+1); // prevmap is gamemap-1 so we offset it back
|
||||
|
||||
call_hooks(&hook, 0, res_none);
|
||||
|
||||
lua_getfield(gL, LUA_REGISTRYINDEX, "SetupVoteResults");
|
||||
for (int i = 1; i <= maxresults; ++i)
|
||||
{
|
||||
lua_rawgeti(gL, -1, i);
|
||||
result[i-1] = lua_tointeger(gL, -1);
|
||||
lua_pop(gL, 1);
|
||||
|
||||
if (result[i-1] && (result[i-1] < 0 || !mapheaderinfo[result[i-1]-1]))
|
||||
{
|
||||
CONS_Alert(CONS_WARNING, "Unknown map #%d for vote\n", result[i-1]);
|
||||
result[i-1] = 0;
|
||||
}
|
||||
}
|
||||
lua_pop(gL, 1);
|
||||
}
|
||||
}
|
||||
+21
-17
@@ -239,7 +239,7 @@ static int lib_getHudInfo(lua_State *L)
|
||||
return 1;
|
||||
}
|
||||
|
||||
static int lib_hudinfolen(lua_State *L)
|
||||
FUNCINLINE static ATTRINLINE int lib_hudinfolen(lua_State *L)
|
||||
{
|
||||
lua_pushinteger(L, NUMHUDITEMS);
|
||||
return 1;
|
||||
@@ -281,14 +281,14 @@ static int hudinfo_set(lua_State *L)
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int hudinfo_num(lua_State *L)
|
||||
FUNCINLINE static ATTRINLINE int hudinfo_num(lua_State *L)
|
||||
{
|
||||
hudinfo_t *info = *((hudinfo_t **)luaL_checkudata(L, 1, META_HUDINFO));
|
||||
lua_pushinteger(L, info-hudinfo);
|
||||
return 1;
|
||||
}
|
||||
|
||||
static int colormap_get(lua_State *L)
|
||||
FUNCINLINE static ATTRINLINE int colormap_get(lua_State *L)
|
||||
{
|
||||
return luaL_error(L, "colormap is not a struct.");
|
||||
}
|
||||
@@ -327,7 +327,7 @@ static int patch_get(lua_State *L)
|
||||
return 1;
|
||||
}
|
||||
|
||||
static int patch_set(lua_State *L)
|
||||
FUNCINLINE static ATTRINLINE int patch_set(lua_State *L)
|
||||
{
|
||||
return luaL_error(L, LUA_QL("patch_t") " struct cannot be edited by Lua.");
|
||||
}
|
||||
@@ -395,14 +395,14 @@ static int camera_get(lua_State *L)
|
||||
// lib_draw
|
||||
//
|
||||
|
||||
static int libd_patchExists(lua_State *L)
|
||||
FUNCINLINE static ATTRINLINE int libd_patchExists(lua_State *L)
|
||||
{
|
||||
HUDONLY
|
||||
lua_pushboolean(L, W_LumpExists(luaL_checkstring(L, 1)));
|
||||
return 1;
|
||||
}
|
||||
|
||||
static int libd_cachePatch(lua_State *L)
|
||||
FUNCINLINE static ATTRINLINE int libd_cachePatch(lua_State *L)
|
||||
{
|
||||
HUDONLY
|
||||
LUA_PushUserdata(L, W_CachePatchName(luaL_checkstring(L, 1), PU_PATCH), META_PATCH);
|
||||
@@ -1066,14 +1066,14 @@ static int libd_getColorHudPatch(lua_State *L)
|
||||
return 2;
|
||||
}
|
||||
|
||||
static int libd_getHudColor(lua_State *L)
|
||||
FUNCINLINE static ATTRINLINE int libd_getHudColor(lua_State *L)
|
||||
{
|
||||
HUDONLY
|
||||
lua_pushinteger(L, K_GetHudColor());
|
||||
return 1;
|
||||
}
|
||||
|
||||
static int libd_useColorHud(lua_State *L)
|
||||
FUNCINLINE static ATTRINLINE int libd_useColorHud(lua_State *L)
|
||||
{
|
||||
HUDONLY
|
||||
lua_pushboolean(L, K_UseColorHud());
|
||||
@@ -1081,21 +1081,21 @@ static int libd_useColorHud(lua_State *L)
|
||||
}
|
||||
|
||||
|
||||
static int libd_width(lua_State *L)
|
||||
FUNCINLINE static ATTRINLINE int libd_width(lua_State *L)
|
||||
{
|
||||
HUDONLY
|
||||
lua_pushinteger(L, vid.width); // push screen width
|
||||
return 1;
|
||||
}
|
||||
|
||||
static int libd_height(lua_State *L)
|
||||
FUNCINLINE static ATTRINLINE int libd_height(lua_State *L)
|
||||
{
|
||||
HUDONLY
|
||||
lua_pushinteger(L, vid.height); // push screen height
|
||||
return 1;
|
||||
}
|
||||
|
||||
static int libd_dupx(lua_State *L)
|
||||
FUNCINLINE static ATTRINLINE int libd_dupx(lua_State *L)
|
||||
{
|
||||
HUDONLY
|
||||
lua_pushinteger(L, vid.dupx); // push integral scale (patch scale)
|
||||
@@ -1103,7 +1103,7 @@ static int libd_dupx(lua_State *L)
|
||||
return 2;
|
||||
}
|
||||
|
||||
static int libd_dupy(lua_State *L)
|
||||
FUNCINLINE static ATTRINLINE int libd_dupy(lua_State *L)
|
||||
{
|
||||
HUDONLY
|
||||
lua_pushinteger(L, vid.dupy); // push integral scale (patch scale)
|
||||
@@ -1111,7 +1111,7 @@ static int libd_dupy(lua_State *L)
|
||||
return 2;
|
||||
}
|
||||
|
||||
static int libd_renderer(lua_State *L)
|
||||
FUNCINLINE static ATTRINLINE int libd_renderer(lua_State *L)
|
||||
{
|
||||
HUDONLY
|
||||
switch (rendermode) {
|
||||
@@ -1124,7 +1124,7 @@ static int libd_renderer(lua_State *L)
|
||||
|
||||
// 30/10/18 Lat': Get cv_translucenthud's value for HUD rendering as a normal V_xxTRANS int
|
||||
// Could as well be thrown in global vars for ease of access but I guess it makes sense for it to be a HUD fn
|
||||
static int libd_getlocaltransflag(lua_State *L)
|
||||
FUNCINLINE static ATTRINLINE int libd_getlocaltransflag(lua_State *L)
|
||||
{
|
||||
HUDONLY
|
||||
lua_pushinteger(L, (10-cv_translucenthud.value)*V_10TRANS); // A bit weird that it's called "translucenthud" yet 10 is fully opaque :V
|
||||
@@ -1229,7 +1229,7 @@ static int lib_draw_ref;
|
||||
//
|
||||
|
||||
// enable vanilla HUD element
|
||||
static int lib_hudenable(lua_State *L)
|
||||
FUNCINLINE static ATTRINLINE int lib_hudenable(lua_State *L)
|
||||
{
|
||||
enum hud option = luaL_checkoption(L, 1, NULL, hud_disable_options);
|
||||
hud_enabled[option/8] |= 1<<(option%8);
|
||||
@@ -1237,7 +1237,7 @@ static int lib_hudenable(lua_State *L)
|
||||
}
|
||||
|
||||
// disable vanilla HUD element
|
||||
static int lib_huddisable(lua_State *L)
|
||||
FUNCINLINE static ATTRINLINE int lib_huddisable(lua_State *L)
|
||||
{
|
||||
enum hud option = luaL_checkoption(L, 1, NULL, hud_disable_options);
|
||||
hud_enabled[option/8] &= ~(1<<(option%8));
|
||||
@@ -1245,7 +1245,7 @@ static int lib_huddisable(lua_State *L)
|
||||
}
|
||||
|
||||
// 30/10/18: Lat': How come this wasn't here before?
|
||||
static int lib_hudenabled(lua_State *L)
|
||||
FUNCINLINE static ATTRINLINE int lib_hudenabled(lua_State *L)
|
||||
{
|
||||
enum hud option = luaL_checkoption(L, 1, NULL, hud_disable_options);
|
||||
if (hud_enabled[option/8] & (1<<(option%8)))
|
||||
@@ -1278,6 +1278,10 @@ static int lib_hudsetvotebackground(lua_State *L)
|
||||
strncpy(VoteScreen.luaPrefix, prefix, 4);
|
||||
strupr(VoteScreen.luaPrefix);
|
||||
|
||||
// Update background if we're already on vote screen
|
||||
if (gamestate == GS_VOTING)
|
||||
Y_VoteScreenCheck();
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
@@ -576,7 +576,7 @@ void LUA_HUD_DrawList(huddrawlist_h list)
|
||||
{
|
||||
size_t i;
|
||||
size_t j = 0;
|
||||
fixed_t frac = R_UsingFrameInterpolation() ? rendertimefrac : FRACUNIT;
|
||||
fixed_t frac = R_GetTimeFrac(RTF_INTER);
|
||||
fixed_t lerpx = 0, lerpy = 0;
|
||||
drawitem_t *latchitem = NULL;
|
||||
drawitem_t *oldlatchitem = NULL;
|
||||
|
||||
+9
-9
@@ -62,7 +62,7 @@ static int lib_getSprname(lua_State *L)
|
||||
}
|
||||
|
||||
/// \todo Maybe make it tally up the used_spr from dehacked?
|
||||
static int lib_sprnamelen(lua_State *L)
|
||||
FUNCINLINE static ATTRINLINE int lib_sprnamelen(lua_State *L)
|
||||
{
|
||||
lua_pushinteger(L, NUMSPRITES);
|
||||
return 1;
|
||||
@@ -122,7 +122,7 @@ static void A_Lua(mobj_t *actor)
|
||||
}
|
||||
|
||||
// Arbitrary states[] table index -> state_t *
|
||||
static int lib_getState(lua_State *L)
|
||||
FUNCINLINE static ATTRINLINE int lib_getState(lua_State *L)
|
||||
{
|
||||
UINT32 i;
|
||||
lua_remove(L, 1);
|
||||
@@ -214,7 +214,7 @@ static int lib_setState(lua_State *L)
|
||||
}
|
||||
|
||||
// #states -> NUMSTATES
|
||||
static int lib_statelen(lua_State *L)
|
||||
FUNCINLINE static ATTRINLINE int lib_statelen(lua_State *L)
|
||||
{
|
||||
lua_pushinteger(L, NUMSTATES);
|
||||
return 1;
|
||||
@@ -482,7 +482,7 @@ static int state_num(lua_State *L)
|
||||
///////////////
|
||||
|
||||
// Arbitrary mobjinfo[] table index -> mobjinfo_t *
|
||||
static int lib_getMobjInfo(lua_State *L)
|
||||
FUNCINLINE static ATTRINLINE int lib_getMobjInfo(lua_State *L)
|
||||
{
|
||||
UINT32 i;
|
||||
lua_remove(L, 1);
|
||||
@@ -593,7 +593,7 @@ static int lib_setMobjInfo(lua_State *L)
|
||||
}
|
||||
|
||||
// #mobjinfo -> NUMMOBJTYPES
|
||||
static int lib_mobjinfolen(lua_State *L)
|
||||
FUNCINLINE static ATTRINLINE int lib_mobjinfolen(lua_State *L)
|
||||
{
|
||||
lua_pushinteger(L, NUMMOBJTYPES);
|
||||
return 1;
|
||||
@@ -869,7 +869,7 @@ static int mobjinfo_set(lua_State *L)
|
||||
}
|
||||
|
||||
// mobjinfo_t * -> MT_*
|
||||
static int mobjinfo_num(lua_State *L)
|
||||
FUNCINLINE static ATTRINLINE int mobjinfo_num(lua_State *L)
|
||||
{
|
||||
mobjinfo_t *info = *((mobjinfo_t **)luaL_checkudata(L, 1, META_MOBJINFO));
|
||||
|
||||
@@ -885,7 +885,7 @@ static int mobjinfo_num(lua_State *L)
|
||||
//////////////
|
||||
|
||||
// Arbitrary S_sfx[] table index -> sfxinfo_t *
|
||||
static int lib_getSfxInfo(lua_State *L)
|
||||
FUNCINLINE static ATTRINLINE int lib_getSfxInfo(lua_State *L)
|
||||
{
|
||||
UINT32 i;
|
||||
lua_remove(L, 1);
|
||||
@@ -988,7 +988,7 @@ static int lib_setSfxInfo(lua_State *L)
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int lib_sfxlen(lua_State *L)
|
||||
FUNCINLINE static ATTRINLINE int lib_sfxlen(lua_State *L)
|
||||
{
|
||||
lua_pushinteger(L, NUMSFX);
|
||||
return 1;
|
||||
@@ -1062,7 +1062,7 @@ static int sfxinfo_set(lua_State *L)
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int sfxinfo_num(lua_State *L)
|
||||
FUNCINLINE static ATTRINLINE int sfxinfo_num(lua_State *L)
|
||||
{
|
||||
sfxinfo_t *sfx = *((sfxinfo_t **)luaL_checkudata(L, 1, META_SFXINFO));
|
||||
|
||||
|
||||
+11
-11
@@ -559,7 +559,7 @@ static int sector_set(lua_State *L)
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int sector_num(lua_State *L)
|
||||
FUNCINLINE static ATTRINLINE int sector_num(lua_State *L)
|
||||
{
|
||||
sector_t *sector = *((sector_t **)luaL_checkudata(L, 1, META_SECTOR));
|
||||
lua_pushinteger(L, sector-sectors);
|
||||
@@ -598,7 +598,7 @@ static int subsector_get(lua_State *L)
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int subsector_num(lua_State *L)
|
||||
FUNCINLINE static ATTRINLINE int subsector_num(lua_State *L)
|
||||
{
|
||||
subsector_t *subsector = *((subsector_t **)luaL_checkudata(L, 1, META_SUBSECTOR));
|
||||
lua_pushinteger(L, subsector-subsectors);
|
||||
@@ -698,7 +698,7 @@ static int line_get(lua_State *L)
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int line_num(lua_State *L)
|
||||
FUNCINLINE static ATTRINLINE int line_num(lua_State *L)
|
||||
{
|
||||
line_t *line = *((line_t **)luaL_checkudata(L, 1, META_LINE));
|
||||
lua_pushinteger(L, line-lines);
|
||||
@@ -827,7 +827,7 @@ static int side_set(lua_State *L)
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int side_num(lua_State *L)
|
||||
FUNCINLINE static ATTRINLINE int side_num(lua_State *L)
|
||||
{
|
||||
side_t *side = *((side_t **)luaL_checkudata(L, 1, META_SIDE));
|
||||
lua_pushinteger(L, side-sides);
|
||||
@@ -866,7 +866,7 @@ static int vertex_get(lua_State *L)
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int vertex_num(lua_State *L)
|
||||
FUNCINLINE static ATTRINLINE int vertex_num(lua_State *L)
|
||||
{
|
||||
vertex_t *vertex = *((vertex_t **)luaL_checkudata(L, 1, META_VERTEX));
|
||||
lua_pushinteger(L, vertex-vertexes);
|
||||
@@ -913,7 +913,7 @@ static int lib_getSector(lua_State *L)
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int lib_numsectors(lua_State *L)
|
||||
FUNCINLINE static ATTRINLINE int lib_numsectors(lua_State *L)
|
||||
{
|
||||
lua_pushinteger(L, numsectors);
|
||||
return 1;
|
||||
@@ -959,7 +959,7 @@ static int lib_getSubsector(lua_State *L)
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int lib_numsubsectors(lua_State *L)
|
||||
FUNCINLINE static ATTRINLINE int lib_numsubsectors(lua_State *L)
|
||||
{
|
||||
lua_pushinteger(L, numsubsectors);
|
||||
return 1;
|
||||
@@ -1005,7 +1005,7 @@ static int lib_getLine(lua_State *L)
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int lib_numlines(lua_State *L)
|
||||
FUNCINLINE static ATTRINLINE int lib_numlines(lua_State *L)
|
||||
{
|
||||
lua_pushinteger(L, numlines);
|
||||
return 1;
|
||||
@@ -1051,7 +1051,7 @@ static int lib_getSide(lua_State *L)
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int lib_numsides(lua_State *L)
|
||||
FUNCINLINE static ATTRINLINE int lib_numsides(lua_State *L)
|
||||
{
|
||||
lua_pushinteger(L, numsides);
|
||||
return 1;
|
||||
@@ -1097,7 +1097,7 @@ static int lib_getVertex(lua_State *L)
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int lib_numvertexes(lua_State *L)
|
||||
FUNCINLINE static ATTRINLINE int lib_numvertexes(lua_State *L)
|
||||
{
|
||||
lua_pushinteger(L, numvertexes);
|
||||
return 1;
|
||||
@@ -1467,7 +1467,7 @@ static int lib_getMapheaderinfo(lua_State *L)
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int lib_nummapheaders(lua_State *L)
|
||||
FUNCINLINE static ATTRINLINE int lib_nummapheaders(lua_State *L)
|
||||
{
|
||||
lua_pushinteger(L, NUMMAPS);
|
||||
return 1;
|
||||
|
||||
+20
-20
@@ -23,14 +23,14 @@
|
||||
// General math
|
||||
//////////////////
|
||||
|
||||
static int lib_abs(lua_State *L)
|
||||
FUNCINLINE static ATTRINLINE int lib_abs(lua_State *L)
|
||||
{
|
||||
int a = (int)luaL_checkinteger(L, 1);
|
||||
lua_pushinteger(L, abs(a));
|
||||
return 1;
|
||||
}
|
||||
|
||||
static int lib_min(lua_State *L)
|
||||
FUNCINLINE static ATTRINLINE int lib_min(lua_State *L)
|
||||
{
|
||||
int a = luaL_checkinteger(L, 1);
|
||||
int b = luaL_checkinteger(L, 2);
|
||||
@@ -38,7 +38,7 @@ static int lib_min(lua_State *L)
|
||||
return 1;
|
||||
}
|
||||
|
||||
static int lib_max(lua_State *L)
|
||||
FUNCINLINE static ATTRINLINE int lib_max(lua_State *L)
|
||||
{
|
||||
int a = luaL_checkinteger(L, 1);
|
||||
int b = luaL_checkinteger(L, 2);
|
||||
@@ -49,31 +49,31 @@ static int lib_max(lua_State *L)
|
||||
// Angle math
|
||||
////////////////
|
||||
|
||||
static int lib_fixedangle(lua_State *L)
|
||||
FUNCINLINE static ATTRINLINE int lib_fixedangle(lua_State *L)
|
||||
{
|
||||
lua_pushangle(L, FixedAngle(luaL_checkfixed(L, 1)));
|
||||
return 1;
|
||||
}
|
||||
|
||||
static int lib_anglefixed(lua_State *L)
|
||||
FUNCINLINE static ATTRINLINE int lib_anglefixed(lua_State *L)
|
||||
{
|
||||
lua_pushfixed(L, AngleFixed(luaL_checkangle(L, 1)));
|
||||
return 1;
|
||||
}
|
||||
|
||||
static int lib_invangle(lua_State *L)
|
||||
FUNCINLINE static ATTRINLINE int lib_invangle(lua_State *L)
|
||||
{
|
||||
lua_pushangle(L, InvAngle(luaL_checkangle(L, 1)));
|
||||
return 1;
|
||||
}
|
||||
|
||||
static int lib_finesine(lua_State *L)
|
||||
FUNCINLINE static ATTRINLINE int lib_finesine(lua_State *L)
|
||||
{
|
||||
lua_pushfixed(L, FINESINE((luaL_checkangle(L, 1)>>ANGLETOFINESHIFT) & FINEMASK));
|
||||
return 1;
|
||||
}
|
||||
|
||||
static int lib_finecosine(lua_State *L)
|
||||
FUNCINLINE static ATTRINLINE int lib_finecosine(lua_State *L)
|
||||
{
|
||||
lua_pushfixed(L, FINECOSINE((luaL_checkangle(L, 1)>>ANGLETOFINESHIFT) & FINEMASK));
|
||||
return 1;
|
||||
@@ -101,19 +101,19 @@ static int lib_finetangent(lua_State *L)
|
||||
// Fixed math
|
||||
////////////////
|
||||
|
||||
static int lib_fixedmul(lua_State *L)
|
||||
FUNCINLINE static ATTRINLINE int lib_fixedmul(lua_State *L)
|
||||
{
|
||||
lua_pushfixed(L, FixedMul(luaL_checkfixed(L, 1), luaL_checkfixed(L, 2)));
|
||||
return 1;
|
||||
}
|
||||
|
||||
static int lib_fixedint(lua_State *L)
|
||||
FUNCINLINE static ATTRINLINE int lib_fixedint(lua_State *L)
|
||||
{
|
||||
lua_pushinteger(L, FixedInt(luaL_checkfixed(L, 1)));
|
||||
return 1;
|
||||
}
|
||||
|
||||
static int lib_fixeddiv(lua_State *L)
|
||||
FUNCINLINE static ATTRINLINE int lib_fixeddiv(lua_State *L)
|
||||
{
|
||||
fixed_t i = luaL_checkfixed(L, 1);
|
||||
fixed_t j = luaL_checkfixed(L, 2);
|
||||
@@ -123,13 +123,13 @@ static int lib_fixeddiv(lua_State *L)
|
||||
return 1;
|
||||
}
|
||||
|
||||
static int lib_fixedrem(lua_State *L)
|
||||
FUNCINLINE static ATTRINLINE int lib_fixedrem(lua_State *L)
|
||||
{
|
||||
lua_pushfixed(L, FixedRem(luaL_checkfixed(L, 1), luaL_checkfixed(L, 2)));
|
||||
return 1;
|
||||
}
|
||||
|
||||
static int lib_fixedsqrt(lua_State *L)
|
||||
FUNCINLINE static ATTRINLINE int lib_fixedsqrt(lua_State *L)
|
||||
{
|
||||
fixed_t i = luaL_checkfixed(L, 1);
|
||||
if (i < 0)
|
||||
@@ -138,31 +138,31 @@ static int lib_fixedsqrt(lua_State *L)
|
||||
return 1;
|
||||
}
|
||||
|
||||
static int lib_fixedhypot(lua_State *L)
|
||||
FUNCINLINE static ATTRINLINE int lib_fixedhypot(lua_State *L)
|
||||
{
|
||||
lua_pushfixed(L, FixedHypot(luaL_checkfixed(L, 1), luaL_checkfixed(L, 2)));
|
||||
return 1;
|
||||
}
|
||||
|
||||
static int lib_fixedfloor(lua_State *L)
|
||||
FUNCINLINE static ATTRINLINE int lib_fixedfloor(lua_State *L)
|
||||
{
|
||||
lua_pushfixed(L, FixedFloor(luaL_checkfixed(L, 1)));
|
||||
return 1;
|
||||
}
|
||||
|
||||
static int lib_fixedtrunc(lua_State *L)
|
||||
FUNCINLINE static ATTRINLINE int lib_fixedtrunc(lua_State *L)
|
||||
{
|
||||
lua_pushfixed(L, FixedTrunc(luaL_checkfixed(L, 1)));
|
||||
return 1;
|
||||
}
|
||||
|
||||
static int lib_fixedceil(lua_State *L)
|
||||
FUNCINLINE static ATTRINLINE int lib_fixedceil(lua_State *L)
|
||||
{
|
||||
lua_pushfixed(L, FixedCeil(luaL_checkfixed(L, 1)));
|
||||
return 1;
|
||||
}
|
||||
|
||||
static int lib_fixedround(lua_State *L)
|
||||
FUNCINLINE static ATTRINLINE int lib_fixedround(lua_State *L)
|
||||
{
|
||||
lua_pushfixed(L, FixedRound(luaL_checkfixed(L, 1)));
|
||||
return 1;
|
||||
@@ -172,13 +172,13 @@ static int lib_fixedround(lua_State *L)
|
||||
// (aka extra little funcs that don't quite fit in baselib)
|
||||
//////////////////////////////////////////////////////////////////
|
||||
|
||||
static int lib_getsecspecial(lua_State *L)
|
||||
FUNCINLINE static ATTRINLINE int lib_getsecspecial(lua_State *L)
|
||||
{
|
||||
lua_pushinteger(L, GETSECSPECIAL(luaL_checkinteger(L, 1), luaL_checkinteger(L, 2)));
|
||||
return 1;
|
||||
}
|
||||
|
||||
static int lib_all7emeralds(lua_State *L)
|
||||
FUNCINLINE static ATTRINLINE int lib_all7emeralds(lua_State *L)
|
||||
{
|
||||
lua_pushboolean(L, ALL7EMERALDS(luaL_checkinteger(L, 1)));
|
||||
return 1;
|
||||
|
||||
+10
-9
@@ -251,14 +251,15 @@ int mobj_angle_setter(lua_State *L)
|
||||
mobj_t *mo = GETMO();
|
||||
|
||||
mo->angle = luaL_checkangle(L, 2);
|
||||
if (mo->player == &players[consoleplayer])
|
||||
localangle[0] = mo->angle;
|
||||
else if (mo->player == &players[displayplayers[1]])
|
||||
localangle[1] = mo->angle;
|
||||
else if (mo->player == &players[displayplayers[2]])
|
||||
localangle[2] = mo->angle;
|
||||
else if (mo->player == &players[displayplayers[3]])
|
||||
localangle[3] = mo->angle;
|
||||
for (UINT8 i = 0; i <= splitscreen; i++)
|
||||
{
|
||||
if (mo->player == P_GetLocalPlayerForNum(i))
|
||||
{
|
||||
localangle[i] = mo->angle;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -979,7 +980,7 @@ static int lib_getMapthing(lua_State *L)
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int lib_nummapthings(lua_State *L)
|
||||
FUNCINLINE static ATTRINLINE int lib_nummapthings(lua_State *L)
|
||||
{
|
||||
lua_pushinteger(L, nummapthings);
|
||||
return 1;
|
||||
|
||||
+29
-47
@@ -267,14 +267,14 @@ int player_aiming_setter(lua_State *L)
|
||||
player_t *plr = GETPLAYER();
|
||||
|
||||
plr->aiming = luaL_checkangle(L, 2);
|
||||
if (plr == &players[consoleplayer])
|
||||
localaiming[0] = plr->aiming;
|
||||
else if (plr == &players[displayplayers[1]])
|
||||
localaiming[1] = plr->aiming;
|
||||
else if (plr == &players[displayplayers[2]])
|
||||
localaiming[2] = plr->aiming;
|
||||
else if (plr == &players[displayplayers[3]])
|
||||
localaiming[3] = plr->aiming;
|
||||
for (UINT8 i = 0; i <= splitscreen; i++)
|
||||
{
|
||||
if (plr == P_GetLocalPlayerForNum(i))
|
||||
{
|
||||
localaiming[i] = plr->aiming;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
@@ -438,7 +438,7 @@ static int lib_getPlayer(lua_State *L)
|
||||
}
|
||||
|
||||
// #players -> MAXPLAYERS
|
||||
static int lib_lenPlayer(lua_State *L)
|
||||
FUNCINLINE static ATTRINLINE int lib_lenPlayer(lua_State *L)
|
||||
{
|
||||
lua_pushinteger(L, MAXPLAYERS);
|
||||
return 1;
|
||||
@@ -448,47 +448,29 @@ static int lib_lenPlayer(lua_State *L)
|
||||
|
||||
static int lib_iterateDisplayplayers(lua_State *L)
|
||||
{
|
||||
INT32 i = -1;
|
||||
INT32 temp = -1;
|
||||
INT32 iter = 0;
|
||||
INT32 i = lua_tonumber(L, lua_upvalueindex(1));
|
||||
|
||||
if (lua_gettop(L) < 2)
|
||||
{
|
||||
//return luaL_error(L, "Don't call displayplayers.iterate() directly, use it as 'for player in displayplayers.iterate do <block> end'.");
|
||||
lua_pushcfunction(L, lib_iterateDisplayplayers);
|
||||
lua_pushcclosure(L, lib_iterateDisplayplayers, 1);
|
||||
return 1;
|
||||
}
|
||||
lua_settop(L, 2);
|
||||
lua_remove(L, 1); // state is unused.
|
||||
if (!lua_isnil(L, 1))
|
||||
|
||||
if (i <= splitscreen)
|
||||
{
|
||||
temp = (INT32)(*((player_t **)luaL_checkudata(L, 1, META_PLAYER)) - players); // get the player # of the last iterated player.
|
||||
|
||||
// @FIXME:
|
||||
// I didn't quite find a better way for this; Here, we go back to which player in displayplayers we last iterated to resume the for loop below for this new function call
|
||||
// I don't understand enough about how the Lua stacks work to get this to work in possibly a single line.
|
||||
// So anyone feel free to correct this!
|
||||
|
||||
for (; iter < MAXSPLITSCREENPLAYERS; iter++)
|
||||
{
|
||||
if (displayplayers[iter] == temp)
|
||||
{
|
||||
i = iter;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
for (i++; i < MAXSPLITSCREENPLAYERS; i++)
|
||||
{
|
||||
if (i > splitscreen || !playeringame[displayplayers[i]])
|
||||
return 0; // Stop! There are no more players for us to go through. There will never be a player gap in displayplayers.
|
||||
|
||||
if (!players[displayplayers[i]].mo)
|
||||
continue;
|
||||
if (!playeringame[displayplayers[i]])
|
||||
return 0;
|
||||
|
||||
// Return player and splitscreen index.
|
||||
LUA_PushUserdata(L, &players[displayplayers[i]], META_PLAYER);
|
||||
lua_pushinteger(L, i); // push this to recall what number we were on for the next function call. I suppose this also means you can retrieve the splitscreen player number with 'for p, n in displayplayers.iterate'!
|
||||
lua_pushnumber(L, i);
|
||||
|
||||
// Update splitscreen index value for next iteration.
|
||||
lua_pushnumber(L, i + 1);
|
||||
lua_pushvalue(L, -1);
|
||||
lua_replace(L, lua_upvalueindex(1));
|
||||
lua_pop(L, 1);
|
||||
|
||||
return 2;
|
||||
}
|
||||
return 0;
|
||||
@@ -516,14 +498,14 @@ static int lib_getDisplayplayers(lua_State *L)
|
||||
field = luaL_checkstring(L, 2);
|
||||
if (fastcmp(field,"iterate"))
|
||||
{
|
||||
lua_pushcfunction(L, lib_iterateDisplayplayers);
|
||||
lua_pushcclosure(L, lib_iterateDisplayplayers, 1);
|
||||
return 1;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
// #displayplayers -> MAXSPLITSCREENPLAYERS
|
||||
static int lib_lenDisplayplayers(lua_State *L)
|
||||
FUNCINLINE static ATTRINLINE int lib_lenDisplayplayers(lua_State *L)
|
||||
{
|
||||
lua_pushinteger(L, MAXSPLITSCREENPLAYERS);
|
||||
return 1;
|
||||
@@ -631,7 +613,7 @@ static int player_set(lua_State *L)
|
||||
|
||||
#undef NOSET
|
||||
|
||||
static int player_num(lua_State *L)
|
||||
FUNCINLINE static ATTRINLINE int player_num(lua_State *L)
|
||||
{
|
||||
player_t *plr = *((player_t **)luaL_checkudata(L, 1, META_PLAYER));
|
||||
if (!plr)
|
||||
@@ -668,7 +650,7 @@ static int power_set(lua_State *L)
|
||||
}
|
||||
|
||||
// #powers -> NUMPOWERS
|
||||
static int power_len(lua_State *L)
|
||||
FUNCINLINE static ATTRINLINE int power_len(lua_State *L)
|
||||
{
|
||||
lua_pushinteger(L, NUMPOWERS);
|
||||
return 1;
|
||||
@@ -702,7 +684,7 @@ static int kartstuff_set(lua_State *L)
|
||||
}
|
||||
|
||||
// #kartstuff -> NUMKARTSTUFF
|
||||
static int kartstuff_len(lua_State *L)
|
||||
FUNCINLINE static ATTRINLINE int kartstuff_len(lua_State *L)
|
||||
{
|
||||
lua_pushinteger(L, NUMKARTSTUFF);
|
||||
return 1;
|
||||
|
||||
+74
-18
@@ -24,6 +24,7 @@
|
||||
#include "p_slopes.h" // for P_SlopeById
|
||||
#include "s_sound.h"
|
||||
#include "m_menu.h"
|
||||
#include "m_argv.h"
|
||||
#ifdef LUA_ALLOW_BYTECODE
|
||||
#include "d_netfil.h" // for LUA_DumpFile
|
||||
#endif
|
||||
@@ -252,7 +253,11 @@ static inline void LUA_LoadFile(MYFILE *f, char *name)
|
||||
|
||||
lua_pushcfunction(gL, LUA_GetErrorMessage);
|
||||
if (luaL_loadbuffer(gL, f->data, f->size, va("@%s",name)) || lua_pcall(gL, 0, 0, lua_gettop(gL) - 1)) {
|
||||
CONS_Alert(CONS_WARNING,"%s\n",lua_tostring(gL,-1));
|
||||
if (M_CheckParm("-strict") || M_CheckParm("-strict-lua"))
|
||||
I_Error("Lua error: %s", lua_tostring(gL, -1));
|
||||
else
|
||||
CONS_Alert(CONS_WARNING,"%s\n",lua_tostring(gL,-1));
|
||||
|
||||
lua_pop(gL,1);
|
||||
}
|
||||
lua_gc(gL, LUA_GCCOLLECT, 0);
|
||||
@@ -366,7 +371,18 @@ void LUA_DumpFile(const char *filename)
|
||||
}
|
||||
#endif
|
||||
|
||||
fixed_t LUA_EvalMath(const char *word)
|
||||
static void createMathLibState(void)
|
||||
{
|
||||
mL = lua_newstate(LUA_Alloc, NULL);
|
||||
lua_atpanic(mL, LUA_Panic);
|
||||
|
||||
// open only enum lib
|
||||
lua_pushcfunction(mL, LUA_EnumLib);
|
||||
lua_pushboolean(mL, true);
|
||||
lua_call(mL, 1, 0);
|
||||
}
|
||||
|
||||
fixed_t LUA_EvalMathEx(const char *word, const char **error)
|
||||
{
|
||||
char buf[1024], *b;
|
||||
const char *p;
|
||||
@@ -375,15 +391,7 @@ fixed_t LUA_EvalMath(const char *word)
|
||||
// make a new state so SOC can't interefere with scripts
|
||||
// allocate state
|
||||
if (mL == NULL)
|
||||
{
|
||||
mL = lua_newstate(LUA_Alloc, NULL);
|
||||
lua_atpanic(mL, LUA_Panic);
|
||||
|
||||
// open only enum lib
|
||||
lua_pushcfunction(mL, LUA_EnumLib);
|
||||
lua_pushboolean(mL, true);
|
||||
lua_call(mL, 1, 0);
|
||||
}
|
||||
createMathLibState();
|
||||
|
||||
// change ^ into ^^ for Lua.
|
||||
strcpy(buf, "return ");
|
||||
@@ -394,6 +402,9 @@ fixed_t LUA_EvalMath(const char *word)
|
||||
if (*p == '^')
|
||||
*b++ = '^';
|
||||
}
|
||||
// length of word is zero!?
|
||||
if (p == word)
|
||||
return 0;
|
||||
*b = '\0';
|
||||
|
||||
// eval string.
|
||||
@@ -409,7 +420,7 @@ fixed_t LUA_EvalMath(const char *word)
|
||||
|
||||
p += 3; // "1: "
|
||||
}
|
||||
CONS_Alert(CONS_WARNING, "%s\n", p);
|
||||
if (error) *error = p;
|
||||
}
|
||||
else
|
||||
res = lua_tointeger(mL, -1);
|
||||
@@ -417,6 +428,51 @@ fixed_t LUA_EvalMath(const char *word)
|
||||
return res;
|
||||
}
|
||||
|
||||
fixed_t LUA_EvalMath(const char *word)
|
||||
{
|
||||
const char *error = NULL;
|
||||
fixed_t res = LUA_EvalMathEx(word, &error);
|
||||
|
||||
if (error)
|
||||
CONS_Alert(CONS_WARNING, "%s\n", error);
|
||||
|
||||
return res;
|
||||
}
|
||||
|
||||
// A hack to prevent lua from crashing game if constant doesn't exist
|
||||
static int lua_get_constant(lua_State *L)
|
||||
{
|
||||
lua_pushvalue(mL, LUA_GLOBALSINDEX);
|
||||
lua_pushvalue(L, 1);
|
||||
lua_gettable(L, -2);
|
||||
|
||||
return 1;
|
||||
}
|
||||
|
||||
fixed_t LUA_GetConstant(const char *word)
|
||||
{
|
||||
if (mL == NULL)
|
||||
createMathLibState();
|
||||
|
||||
fixed_t res = 0;
|
||||
|
||||
lua_pushcfunction(mL, lua_get_constant);
|
||||
lua_pushstring(mL, word);
|
||||
|
||||
if (lua_pcall(mL, 1, 1, 0) == 0)
|
||||
{
|
||||
if (lua_isnumber(mL, -1))
|
||||
res = lua_tointeger(mL, -1);
|
||||
}
|
||||
else
|
||||
{
|
||||
// Pop error message
|
||||
lua_pop(mL, 1);
|
||||
}
|
||||
|
||||
return res;
|
||||
}
|
||||
|
||||
void LUA_InvalidateMathlibCache(const char *name)
|
||||
{
|
||||
// No state => no cache => nothing to invalidate :3
|
||||
@@ -1023,8 +1079,8 @@ static UINT8 UnArchiveValue(UINT8 **p, int TABLESINDEX, boolean network)
|
||||
case ARCH_MOBJ:
|
||||
if (network == false) // for replays :chaosleep:
|
||||
{
|
||||
*p += sizeof(UINT32); // Skip this data, we can't read a mobj here, it'd point to garbage and crash the game.
|
||||
return 3; // Don't set the field
|
||||
*p += sizeof(UINT32); // Skip this data, we can't read a mobj here, it'd point to garbage and crash the game.
|
||||
return 3; // Don't set the field
|
||||
}
|
||||
|
||||
LUA_PushUserdata(gL, P_FindNewPosition(READUINT32(*p)), META_MOBJ);
|
||||
@@ -1099,9 +1155,9 @@ static void UnArchiveExtVars(UINT8 **p, void *pointer, boolean network)
|
||||
CONS_Alert(CONS_ERROR, "Unexpected end marker when reading ExtVars (field '%s')\n", field);
|
||||
break;
|
||||
}
|
||||
else if (ret == 3) // This will return 3 if we shouldn't set this field.
|
||||
else if (ret == 3) // This will return 3 if we shouldn't set this field.
|
||||
{
|
||||
CONS_Alert(CONS_WARNING,"Cannot read mobj_t stored in player variable \'%s\'. Desyncs may occur.\n", field);
|
||||
//CONS_Alert(CONS_WARNING,"Cannot read mobj_t stored in player variable \'%s\'. Desyncs may occur.\n", field);
|
||||
continue;
|
||||
}
|
||||
|
||||
@@ -1155,7 +1211,7 @@ static void UnArchiveTables(UINT8 **p, boolean network)
|
||||
ret = UnArchiveValue(p, TABLESINDEX, network);
|
||||
if (ret == 3)
|
||||
{
|
||||
CONS_Alert(CONS_WARNING,"Couldn't read mobj_t\n");
|
||||
//CONS_Alert(CONS_WARNING,"Couldn't read mobj_t\n");
|
||||
lua_pushnil(gL);
|
||||
}
|
||||
else if (ret == 1) // read key
|
||||
@@ -1170,7 +1226,7 @@ static void UnArchiveTables(UINT8 **p, boolean network)
|
||||
}
|
||||
else if (ret == 3)
|
||||
{
|
||||
CONS_Alert(CONS_WARNING,"Couldn't read mobj_t\n");
|
||||
//CONS_Alert(CONS_WARNING,"Couldn't read mobj_t\n");
|
||||
lua_pushnil(gL);
|
||||
}
|
||||
else if (ret == 2) // read value
|
||||
|
||||
@@ -13,6 +13,10 @@
|
||||
#ifndef LUA_SCRIPT_H
|
||||
#define LUA_SCRIPT_H
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
#include "m_fixed.h"
|
||||
#include "doomtype.h"
|
||||
#include "d_player.h"
|
||||
@@ -48,7 +52,9 @@ void LUA_LoadLump(UINT16 wad, UINT16 lump);
|
||||
#ifdef LUA_ALLOW_BYTECODE
|
||||
void LUA_DumpFile(const char *filename);
|
||||
#endif
|
||||
fixed_t LUA_EvalMathEx(const char *word, const char **error);
|
||||
fixed_t LUA_EvalMath(const char *word);
|
||||
fixed_t LUA_GetConstant(const char *word);
|
||||
|
||||
// Need better name for this ;-;
|
||||
void LUA_InvalidateMathlibCache(const char *name);
|
||||
@@ -104,4 +110,8 @@ void COM_Lua_f(void);
|
||||
}\
|
||||
}
|
||||
|
||||
#ifdef __cplusplus
|
||||
} // extern "C"
|
||||
#endif
|
||||
|
||||
#endif/*LUA_SCRIPT_H*/
|
||||
@@ -13,6 +13,7 @@
|
||||
|
||||
#include "m_aatree.h"
|
||||
#include "z_zone.h"
|
||||
#include "m_misc.h"
|
||||
|
||||
// A partial implementation of AA trees,
|
||||
// according to the algorithms given on Wikipedia.
|
||||
@@ -27,6 +28,13 @@ typedef struct aatree_node_s
|
||||
struct aatree_node_s *left, *right;
|
||||
} aatree_node_t;
|
||||
|
||||
typedef struct aatree_entry_s
|
||||
{
|
||||
struct aatree_entry_s *next;
|
||||
char *key;
|
||||
void *value;
|
||||
} aatree_entry_t;
|
||||
|
||||
struct aatree_s
|
||||
{
|
||||
aatree_node_t *root;
|
||||
@@ -143,9 +151,77 @@ static aatree_node_t *M_AATreeSet_Node(aatree_node_t *node, UINT32 flags, INT32
|
||||
|
||||
void M_AATreeSet(aatree_t *aatree, INT32 key, void* value)
|
||||
{
|
||||
I_Assert((aatree->flags & AATREE_STRING) == 0);
|
||||
aatree->root = M_AATreeSet_Node(aatree->root, aatree->flags, key, value);
|
||||
}
|
||||
|
||||
static aatree_node_t *M_AATreeSetString_Node(aatree_node_t *node, UINT32 flags, INT32 hash, const char *key, void* value)
|
||||
{
|
||||
if (!node)
|
||||
{
|
||||
// Nothing here, so just add where we are
|
||||
aatree_entry_t *entry = Z_Malloc(sizeof(aatree_entry_t), PU_STATIC, NULL);
|
||||
entry->next = NULL;
|
||||
entry->key = Z_StrDup(key);
|
||||
if (value && (flags & AATREE_ZUSER)) Z_SetUser(value, &entry->value);
|
||||
else entry->value = value;
|
||||
|
||||
node = Z_Malloc(sizeof (aatree_node_t), PU_STATIC, NULL);
|
||||
node->key = hash;
|
||||
node->value = entry;
|
||||
node->left = node->right = NULL;
|
||||
node->depth = 1;
|
||||
}
|
||||
else
|
||||
{
|
||||
if (hash < node->key)
|
||||
node->left = M_AATreeSetString_Node(node->left, flags, hash, key, value);
|
||||
else if (hash > node->key)
|
||||
node->right = M_AATreeSetString_Node(node->right, flags, hash, key, value);
|
||||
else
|
||||
{
|
||||
aatree_entry_t *entry = node->value;
|
||||
if (entry != NULL && strcmp(entry->key, key) != 0)
|
||||
entry = entry->next;
|
||||
if (entry != NULL)
|
||||
{
|
||||
if (value && (flags & AATREE_ZUSER)) Z_SetUser(value, &entry->value);
|
||||
else entry->value = value;
|
||||
}
|
||||
else
|
||||
{
|
||||
entry = Z_Malloc(sizeof(aatree_entry_t), PU_STATIC, NULL);
|
||||
entry->next = node->value;
|
||||
entry->key = Z_StrDup(key);
|
||||
if (value && (flags & AATREE_ZUSER)) Z_SetUser(value, &entry->value);
|
||||
else entry->value = value;
|
||||
node->value = entry;
|
||||
}
|
||||
}
|
||||
|
||||
node = M_AATreeRebalance(node);
|
||||
if (node->left == NULL && node->right == NULL)
|
||||
node->depth = 1;
|
||||
else if (node->left == NULL)
|
||||
node->depth = node->right->depth + 1;
|
||||
else if (node->right == NULL)
|
||||
node->depth = node->left->depth + 1;
|
||||
else if (node->left->depth > node->right->depth)
|
||||
node->depth = node->left->depth + 1;
|
||||
else
|
||||
node->depth = node->right->depth + 1;
|
||||
}
|
||||
|
||||
return node;
|
||||
}
|
||||
|
||||
void M_AATreeSetString(aatree_t *aatree, const char *key, void *value)
|
||||
{
|
||||
I_Assert((aatree->flags & AATREE_STRING) == AATREE_STRING);
|
||||
UINT32 hash = FNV1a_HashString(key);
|
||||
aatree->root = M_AATreeSetString_Node(aatree->root, aatree->flags, hash, key, value);
|
||||
}
|
||||
|
||||
// Caveat: we don't distinguish between nodes that don't exists
|
||||
// and nodes with value == NULL.
|
||||
static void *M_AATreeGet_Node(aatree_node_t *node, INT32 key)
|
||||
@@ -165,9 +241,20 @@ static void *M_AATreeGet_Node(aatree_node_t *node, INT32 key)
|
||||
|
||||
void *M_AATreeGet(aatree_t *aatree, INT32 key)
|
||||
{
|
||||
I_Assert((aatree->flags & AATREE_STRING) == 0);
|
||||
return M_AATreeGet_Node(aatree->root, key);
|
||||
}
|
||||
|
||||
void *M_AATreeGetString(aatree_t *aatree, const char *key)
|
||||
{
|
||||
I_Assert((aatree->flags & AATREE_STRING) == AATREE_STRING);
|
||||
UINT32 hash = FNV1a_HashString(key);
|
||||
aatree_entry_t *entry = M_AATreeGet_Node(aatree->root, hash);
|
||||
while (entry != NULL && strcmp(entry->key, key) != 0)
|
||||
entry = entry->next;
|
||||
return entry != NULL ? entry->value : NULL;
|
||||
}
|
||||
|
||||
static void M_AATreeIterate_Node(aatree_node_t *node, aatree_iter_t callback)
|
||||
{
|
||||
if (node->left) M_AATreeIterate_Node(node->left, callback);
|
||||
|
||||
@@ -18,6 +18,7 @@
|
||||
|
||||
// Flags for AA trees.
|
||||
#define AATREE_ZUSER 1 // Treat values as z_zone-allocated blocks and set their user fields
|
||||
#define AATREE_STRING 2 // Use strings for keys rather than ints
|
||||
|
||||
typedef struct aatree_s aatree_t;
|
||||
typedef void (*aatree_iter_t)(INT32 key, void *value);
|
||||
@@ -25,7 +26,9 @@ typedef void (*aatree_iter_t)(INT32 key, void *value);
|
||||
aatree_t *M_AATreeAlloc(UINT32 flags);
|
||||
void M_AATreeFree(aatree_t *aatree);
|
||||
void M_AATreeSet(aatree_t *aatree, INT32 key, void* value);
|
||||
void M_AATreeSetString(aatree_t *aatree, const char *key, void *value);
|
||||
void *M_AATreeGet(aatree_t *aatree, INT32 key);
|
||||
void *M_AATreeGetString(aatree_t *aatree, const char *key);
|
||||
void M_AATreeIterate(aatree_t *aatree, aatree_iter_t callback);
|
||||
|
||||
#endif
|
||||
+46
-3
@@ -18,6 +18,7 @@
|
||||
#include "z_zone.h"
|
||||
#include "v_video.h"
|
||||
#include "i_video.h"
|
||||
#include "i_system.h" // I_GetPreciseTime
|
||||
|
||||
#ifdef HWRENDER
|
||||
#include "hardware/hw_main.h"
|
||||
@@ -26,16 +27,26 @@
|
||||
// GIFs are always little-endian
|
||||
#include "byteptr.h"
|
||||
|
||||
CV_PossibleValue_t gif_dynamicdelay_cons_t[] = {
|
||||
{0, "Off"},
|
||||
{1, "On"},
|
||||
{2, "Accurate, experimental"},
|
||||
{0, NULL}};
|
||||
|
||||
consvar_t cv_gif_optimize = {"gif_optimize", "On", CV_SAVE, CV_OnOff, NULL, 0, NULL, NULL, 0, 0, NULL};
|
||||
consvar_t cv_gif_downscale = {"gif_downscale", "On", CV_SAVE, CV_OnOff, NULL, 0, NULL, NULL, 0, 0, NULL};
|
||||
consvar_t cv_gif_dynamicdelay = {"gif_dynamicdelay", "On", CV_SAVE, gif_dynamicdelay_cons_t, NULL, 0, NULL, NULL, 0, 0, NULL};
|
||||
|
||||
#ifdef HAVE_ANIGIF
|
||||
static boolean gif_optimize = false; // So nobody can do something dumb
|
||||
static boolean gif_downscale = false; // like changing cvars mid output
|
||||
static UINT8 gif_dynamicdelay = (UINT8)0; // and messing something up
|
||||
static RGBA_t *gif_palette = NULL;
|
||||
|
||||
static FILE *gif_out = NULL;
|
||||
static INT32 gif_frames = 0;
|
||||
static precise_t gif_prevframetime = 0;
|
||||
static UINT32 gif_delayus = 0; // "us" is microseconds
|
||||
static UINT8 gif_writeover = 0;
|
||||
|
||||
|
||||
@@ -550,11 +561,39 @@ static void GIF_framewrite(void)
|
||||
|
||||
// screen regions are handled in GIF_lzw
|
||||
{
|
||||
int d1 = (int)((100.0f/NEWTICRATE)*(gif_frames+1));
|
||||
int d2 = (int)((100.0f/NEWTICRATE)*(gif_frames));
|
||||
UINT16 delay = d1-d2;
|
||||
UINT16 delay = 0;
|
||||
INT32 startline;
|
||||
|
||||
if (gif_dynamicdelay ==(UINT8) 2)
|
||||
{
|
||||
// golden's attempt at creating a "dynamic delay"
|
||||
UINT16 mingifdelay = 10; // minimum gif delay in milliseconds (keep at 10 because gifs can't get more precise).
|
||||
gif_delayus += (I_GetPreciseTime() - gif_prevframetime) / (I_GetPrecisePrecision() / 1000000); // increase delay by how much time was spent between last measurement
|
||||
|
||||
if (gif_delayus/1000 >= mingifdelay) // delay is big enough to be able to effect gif frame delay?
|
||||
{
|
||||
int frames = (gif_delayus/1000) / mingifdelay; // get amount of frames to delay.
|
||||
delay = frames; // set the delay to delay that amount of frames.
|
||||
gif_delayus -= frames*(mingifdelay*1000); // remove frames by the amount of milliseconds they take. don't reset to 0, the microseconds help consistency.
|
||||
}
|
||||
}
|
||||
else if (gif_dynamicdelay ==(UINT8) 1)
|
||||
{
|
||||
float delayf = ceil(100.0f/NEWTICRATE);
|
||||
|
||||
delay = (UINT16)((I_GetPreciseTime() - gif_prevframetime)) / (I_GetPrecisePrecision() / 1000000) /10/1000;
|
||||
|
||||
if (delay < (UINT16)(delayf))
|
||||
delay = (UINT16)(delayf);
|
||||
}
|
||||
else
|
||||
{
|
||||
// the original code
|
||||
int d1 = (int)((100.0f/NEWTICRATE)*(gif_frames+1));
|
||||
int d2 = (int)((100.0f/NEWTICRATE)*(gif_frames));
|
||||
delay = d1-d2;
|
||||
}
|
||||
|
||||
WRITEMEM(p, gifframe_gchead, 4);
|
||||
|
||||
WRITEUINT16(p, delay);
|
||||
@@ -619,6 +658,7 @@ static void GIF_framewrite(void)
|
||||
}
|
||||
fwrite(gifframe_data, 1, (p - gifframe_data), gif_out);
|
||||
++gif_frames;
|
||||
gif_prevframetime = I_GetPreciseTime();
|
||||
}
|
||||
|
||||
|
||||
@@ -639,12 +679,15 @@ INT32 GIF_open(const char *filename)
|
||||
|
||||
gif_optimize = (!!cv_gif_optimize.value);
|
||||
gif_downscale = (!!cv_gif_downscale.value);
|
||||
gif_dynamicdelay = (UINT8)cv_gif_dynamicdelay.value;
|
||||
|
||||
// no master palettes in SRB2Kart land
|
||||
gif_palette = pLocalPalette;
|
||||
|
||||
GIF_headwrite();
|
||||
gif_frames = 0;
|
||||
gif_prevframetime = I_GetPreciseTime();
|
||||
gif_delayus = 0;
|
||||
return 1;
|
||||
}
|
||||
|
||||
|
||||
+1
-1
@@ -27,6 +27,6 @@ void GIF_frame(void);
|
||||
INT32 GIF_close(void);
|
||||
#endif
|
||||
|
||||
extern consvar_t cv_gif_optimize, cv_gif_downscale;
|
||||
extern consvar_t cv_gif_optimize, cv_gif_dynamicdelay, cv_gif_downscale;
|
||||
|
||||
#endif
|
||||
+8
-7
@@ -830,18 +830,18 @@ void OP_NightsObjectplace(player_t *player)
|
||||
mt->options = (UINT16)((player->mo->z - fheight)>>FRACBITS);
|
||||
mt->angle = (INT16)(mt->angle+(INT16)((FixedInt(FixedDiv(temp*FRACUNIT, 360*(FRACUNIT/256))))<<8));
|
||||
|
||||
P_SpawnHoopsAndRings(mt);
|
||||
P_SpawnHoops(mt);
|
||||
}
|
||||
|
||||
// This places a ring!
|
||||
if (cmd->buttons & BT_BACKWARD)
|
||||
/*if (cmd->buttons & BT_BACKWARD)
|
||||
{
|
||||
player->pflags |= PF_ATTACKDOWN;
|
||||
if (!OP_HeightOkay(player, false))
|
||||
return;
|
||||
|
||||
mt = OP_CreateNewMapThing(player, (UINT16)mobjinfo[MT_RING].doomednum, false);
|
||||
P_SpawnHoopsAndRings(mt);
|
||||
//P_SpawnHoopsAndRings(mt);
|
||||
}
|
||||
|
||||
// This places a wing item!
|
||||
@@ -852,8 +852,8 @@ void OP_NightsObjectplace(player_t *player)
|
||||
return;
|
||||
|
||||
mt = OP_CreateNewMapThing(player, (UINT16)mobjinfo[MT_NIGHTSWING].doomednum, false);
|
||||
P_SpawnHoopsAndRings(mt);
|
||||
}
|
||||
//P_SpawnHoopsAndRings(mt);
|
||||
}*/
|
||||
|
||||
// This places a custom object as defined in the console cv_mapthingnum.
|
||||
if (cmd->buttons & BT_BRAKE)
|
||||
@@ -891,7 +891,7 @@ void OP_NightsObjectplace(player_t *player)
|
||||
|| mt->type == 1705 || mt->type == 1713 // NiGHTS Hoops
|
||||
|| mt->type == 1800) // Mario Coin
|
||||
{
|
||||
P_SpawnHoopsAndRings(mt);
|
||||
P_SpawnHoops(mt);
|
||||
}
|
||||
else
|
||||
P_SpawnMapThing(mt);
|
||||
@@ -1022,7 +1022,8 @@ void OP_ObjectplaceMovement(player_t *player)
|
||||
|| mt->type == 1705 || mt->type == 1713 // NiGHTS Hoops
|
||||
|| mt->type == 1800) // Mario Coin
|
||||
{
|
||||
P_SpawnHoopsAndRings(mt);
|
||||
// NiGHTS hoops only
|
||||
P_SpawnHoops(mt);
|
||||
}
|
||||
else
|
||||
P_SpawnMapThing(mt);
|
||||
|
||||
+2
-2
@@ -23,7 +23,7 @@
|
||||
#include "m_fixed.h"
|
||||
#include "tables.h" // ANGLETOFINESHIFT
|
||||
|
||||
fixed_t FixedSqrt(fixed_t x)
|
||||
FUNCMATH fixed_t FixedSqrt(fixed_t x)
|
||||
{
|
||||
#ifdef HAVE_SQRT
|
||||
const float fx = FIXED_TO_FLOAT(x);
|
||||
@@ -61,7 +61,7 @@ fixed_t FixedSqrt(fixed_t x)
|
||||
#endif
|
||||
}
|
||||
|
||||
fixed_t FixedHypot(fixed_t x, fixed_t y)
|
||||
FUNCMATH fixed_t FixedHypot(fixed_t x, fixed_t y)
|
||||
{
|
||||
// Moved the code from R_PointToDist2 to here,
|
||||
// since R_PointToDist2 did the same thing,
|
||||
|
||||
+61
-44
@@ -683,6 +683,12 @@ static void M_ResetCvars(void)
|
||||
}
|
||||
}
|
||||
|
||||
// This is not a particular elegant solution, but it seems to make do for our purposes
|
||||
static boolean M_CheckTextInput(void)
|
||||
{
|
||||
return (menuactive && currentMenu && (itemOn < currentMenu->numitems) && (((currentMenu->menuitems[itemOn].status & IT_CVARTYPE) == IT_CV_STRING) || (currentMenu->menuitems[itemOn].status == IT_MSGHANDLER && currentMenu->menuitems[itemOn].alphaKey != MM_EVENTHANDLER) || ((currentMenu->menuitems[itemOn].status & IT_TYPE) == IT_KEYHANDLER)));
|
||||
}
|
||||
|
||||
// If current menu item is IT_CV_STRING, setup menuinput
|
||||
static void M_CheckStringItem(void)
|
||||
{
|
||||
@@ -1030,7 +1036,6 @@ boolean M_Responder(event_t *ev)
|
||||
// Handle menuitems which need a specific key handling
|
||||
if (routine && (currentMenu->menuitems[itemOn].status & IT_TYPE) == IT_KEYHANDLER)
|
||||
{
|
||||
menu_text_input = true;
|
||||
ch = M_ShiftChar(ch);
|
||||
routine(ch);
|
||||
return true;
|
||||
@@ -1070,7 +1075,6 @@ boolean M_Responder(event_t *ev)
|
||||
{
|
||||
if ((currentMenu->menuitems[itemOn].status & IT_CVARTYPE) == IT_CV_STRING)
|
||||
{
|
||||
menu_text_input = true;
|
||||
if (M_ChangeStringCvar(ch))
|
||||
return true;
|
||||
else
|
||||
@@ -1725,6 +1729,10 @@ void M_Ticker(void)
|
||||
|
||||
interpTimerHackAllow = true;
|
||||
|
||||
menu_text_input = M_CheckTextInput();
|
||||
|
||||
I_SetTextInput();
|
||||
|
||||
//added : 30-01-98 : test mode for five seconds
|
||||
if (vidm_testingmode > 0)
|
||||
{
|
||||
@@ -2135,7 +2143,8 @@ static void M_DrawSplitText(INT32 x, INT32 y, INT32 option, const char* str, INT
|
||||
char** clines = NULL;
|
||||
INT16 num_lines = 0;
|
||||
|
||||
if (icopy == NULL) return;
|
||||
if (icopy == NULL)
|
||||
return;
|
||||
|
||||
char* tok = strtok(icopy, "\n");
|
||||
|
||||
@@ -2143,17 +2152,26 @@ static void M_DrawSplitText(INT32 x, INT32 y, INT32 option, const char* str, INT
|
||||
{
|
||||
char* line = strdup(tok);
|
||||
|
||||
if (line == NULL) return;
|
||||
if (line == NULL)
|
||||
{
|
||||
goto cleanup;
|
||||
}
|
||||
|
||||
clines = realloc(clines, (num_lines + 1) * sizeof(char*));
|
||||
char **tmp = realloc(clines, (num_lines + 1) * sizeof(char *));
|
||||
|
||||
if (tmp == NULL)
|
||||
{
|
||||
free(line);
|
||||
goto cleanup;
|
||||
}
|
||||
|
||||
clines = tmp;
|
||||
clines[num_lines] = line;
|
||||
num_lines++;
|
||||
|
||||
tok = strtok(NULL, "\n");
|
||||
}
|
||||
|
||||
free(icopy);
|
||||
|
||||
INT16 yoffset;
|
||||
yoffset = (((5*10 - num_lines*10)));
|
||||
|
||||
@@ -2172,11 +2190,17 @@ static void M_DrawSplitText(INT32 x, INT32 y, INT32 option, const char* str, INT
|
||||
V_DrawCenteredThinString(x, y + yoffset, option, clines[i]);
|
||||
V_DrawCenteredThinString(x, y + yoffset, option|V_YELLOWMAP|((9 - alpha) << V_ALPHASHIFT), clines[i]);
|
||||
yoffset += 10;
|
||||
// Remember to free the memory for each line when you're done with it.
|
||||
free(clines[i]);
|
||||
}
|
||||
|
||||
free(clines);
|
||||
cleanup:
|
||||
if (clines)
|
||||
{
|
||||
// Remember to free the memory for each line when you're done with it.
|
||||
for (int i = 0; i < num_lines; i++)
|
||||
free(clines[i]);
|
||||
free(clines);
|
||||
}
|
||||
free(icopy);
|
||||
}
|
||||
|
||||
static void M_DoToolTips(menu_t* menu)
|
||||
@@ -3716,6 +3740,7 @@ static void M_HandleAddons(INT32 choice)
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
if (exitmenu)
|
||||
{
|
||||
closefilemenu(true);
|
||||
@@ -3752,7 +3777,7 @@ I_mutex replayquerymutex;
|
||||
#endif/*HAVE_THREADS*/
|
||||
|
||||
|
||||
#define MAXREPLAYQUERY 40
|
||||
#define MAXREPLAYQUERY 37
|
||||
static char replayqueryinput_buffer[MAXREPLAYQUERY+1]; // The input typed
|
||||
static textinput_t replayqueryinput;
|
||||
|
||||
@@ -3915,13 +3940,12 @@ static void PrepReplayList(boolean reset)
|
||||
|
||||
replayquerycheck = replayqueryfound = 0;
|
||||
|
||||
if (demolist)
|
||||
Z_Free(demolist);
|
||||
|
||||
Z_Free(demolist);
|
||||
demolist = Z_Calloc(sizeof(menudemo_t) * sizedirmenu, PU_STATIC, NULL);
|
||||
|
||||
// If directory didn't change, keep demolist_all
|
||||
if (!reset) return;
|
||||
if (!reset)
|
||||
return;
|
||||
|
||||
Lock_search_state();
|
||||
|
||||
@@ -4454,7 +4478,7 @@ static void M_DrawReplayHut(void)
|
||||
DrawReplayHutReplayInfo();
|
||||
}
|
||||
|
||||
x -= 40;
|
||||
x = 4;
|
||||
|
||||
// Draw search query
|
||||
M_DrawTextBoxFlags(x, 200 - 22, MAXREPLAYQUERY, 1, V_SNAPTOBOTTOM);
|
||||
@@ -4577,17 +4601,23 @@ static void M_DrawReplayStartMenu(void)
|
||||
V_DrawSmallString(4, BASEVIDHEIGHT-14, V_SNAPTOBOTTOM|V_SNAPTOLEFT|V_ALLOWLOWERCASE, warning);
|
||||
}
|
||||
|
||||
void M_ResetDemoList(void)
|
||||
{
|
||||
Z_Free(demolist_all);
|
||||
demolist_all = NULL;
|
||||
|
||||
Z_Free(demolist);
|
||||
demolist = NULL;
|
||||
|
||||
demo.inreplayhut = false;
|
||||
}
|
||||
|
||||
static boolean M_QuitReplayHut(void)
|
||||
{
|
||||
// D_StartTitle does its own wipe, since GS_TIMEATTACK is now a complete gamestate.
|
||||
menuactive = false;
|
||||
D_StartTitle();
|
||||
|
||||
if (demolist)
|
||||
Z_Free(demolist);
|
||||
demolist = NULL;
|
||||
|
||||
demo.inreplayhut = false;
|
||||
M_ResetDemoList();
|
||||
|
||||
return true;
|
||||
}
|
||||
@@ -5271,24 +5301,13 @@ static void M_DrawSkyRoom(void)
|
||||
|
||||
V_DrawRightAlignedString(BASEVIDWIDTH - currentMenu->x,
|
||||
currentMenu->y+currentMenu->menuitems[2].alphaKey,
|
||||
(digital_disabled ? warningflags : highlightflags),
|
||||
(digital_disabled ? "OFF" : "ON"));
|
||||
|
||||
#ifndef NO_MIDI
|
||||
V_DrawRightAlignedString(BASEVIDWIDTH - currentMenu->x,
|
||||
currentMenu->y+currentMenu->menuitems[5].alphaKey,
|
||||
(midi_disabled ? warningflags : highlightflags),
|
||||
(midi_disabled ? "OFF" : "ON"));
|
||||
#endif
|
||||
(music_disabled ? warningflags : highlightflags),
|
||||
(music_disabled ? "OFF" : "ON"));
|
||||
|
||||
if (itemOn == 0)
|
||||
lengthstring = 8*(sound_disabled ? 3 : 2);
|
||||
else if (itemOn == 2)
|
||||
lengthstring = 8*(digital_disabled ? 3 : 2);
|
||||
#ifndef NO_MIDI
|
||||
else if (itemOn == 5)
|
||||
lengthstring = 8*(midi_disabled ? 3 : 2);
|
||||
#endif
|
||||
lengthstring = 8*(music_disabled ? 3 : 2);
|
||||
}
|
||||
|
||||
for (i = 0; i < currentMenu->numitems; ++i)
|
||||
@@ -6743,7 +6762,7 @@ static void M_DrawConnectMenu(void)
|
||||
{
|
||||
const float ease = serverlistslidex / 2.f;
|
||||
const INT32 offx = serverlistslidex > 0 ? BASEVIDWIDTH : -(BASEVIDWIDTH);
|
||||
const INT32 x = (FLOAT_TO_FIXED(serverlistslidex) + ease * rendertimefrac) / FRACUNIT;
|
||||
const INT32 x = (FLOAT_TO_FIXED(serverlistslidex) + ease * R_GetTimeFrac(RTF_MENU)) / FRACUNIT;
|
||||
|
||||
M_DrawServerLines(currentMenu->x + x - offx, oldserverlistpage);
|
||||
M_DrawServerLines(currentMenu->x + x, serverlistpage);
|
||||
@@ -7002,7 +7021,7 @@ void M_PopupMasterServerConnectError(void)
|
||||
{
|
||||
if (!CV_IsSetToDefault(&cv_masterserver) && cv_masterserver_nagattempts.value > 0)
|
||||
{
|
||||
M_StartMessage(M_GetText("There was a problem connecting to\ncustom Master Server\n\nYou've changed the Server Browser address.\nUnless you're from the future, this probably isn't what you want.\n\n\x83Press Accel\x80 to fix this and continue.\n"), connect_error_continue == STARTSERVER_MENU ? M_PreStartServerMenuChoice : M_PreConnectMenuChoice,MM_EVENTHANDLER);
|
||||
M_StartMessage(M_GetText("There was a problem connecting to\ncustom Master Server\n\nYou've changed the Server Browser address.\nUnless you're from the future, this probably isn't what you want.\n\n\x83Press Accel\x80 to fix this and continue.\n"), connect_error_continue == STARTSERVER_MENU ? M_PreStartServerMenuChoice : M_PreConnectMenuChoice, MM_EVENTHANDLER);
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -7057,7 +7076,7 @@ static INT32 M_FindFirstMap(INT32 gtype)
|
||||
{
|
||||
INT32 i;
|
||||
|
||||
if (mapheaderinfo[gamemap] && (mapheaderinfo[gamemap]->typeoflevel & gtype))
|
||||
if (mapheaderinfo[gamemap-1] && (mapheaderinfo[gamemap-1]->typeoflevel & gtype))
|
||||
return gamemap;
|
||||
|
||||
for (i = 0; i < NUMMAPS; i++)
|
||||
@@ -7092,8 +7111,6 @@ static void M_StartServer(INT32 choice)
|
||||
|
||||
if (demo.playback)
|
||||
G_StopDemo();
|
||||
if (metalrecording)
|
||||
G_StopMetalDemo();
|
||||
|
||||
if (!cv_nextmap.value)
|
||||
CV_SetValue(&cv_nextmap, G_RandMap(G_TOLFlag(cv_newgametype.value), -1, false, 0, false, NULL)+1);
|
||||
@@ -9174,7 +9191,6 @@ static void M_DrawControl(void)
|
||||
char tmp[50];
|
||||
INT32 x, y, i, max, cursory = 0, iter;
|
||||
INT32 keys[2];
|
||||
menu_text_input = false; //never use native layout for control setup
|
||||
|
||||
x = currentMenu->x;
|
||||
y = currentMenu->y;
|
||||
@@ -9274,12 +9290,10 @@ static void M_ChangecontrolResponse(event_t *ev)
|
||||
INT32 control;
|
||||
INT32 found;
|
||||
INT32 ch = ev->data1;
|
||||
menu_text_input = false; //never use native layout for control setup
|
||||
|
||||
// ESCAPE cancels; dummy out PAUSE
|
||||
if (ch != KEY_ESCAPE && ch != KEY_PAUSE)
|
||||
{
|
||||
|
||||
switch (ev->type)
|
||||
{
|
||||
// ignore mouse/joy movements, just get buttons
|
||||
@@ -9309,6 +9323,7 @@ static void M_ChangecontrolResponse(event_t *ev)
|
||||
found = 0;
|
||||
else if (setupcontrols[control][1] ==ch)
|
||||
found = 1;
|
||||
|
||||
if (found >= 0)
|
||||
{
|
||||
// replace mouse and joy clicks by double clicks
|
||||
@@ -9336,9 +9351,11 @@ static void M_ChangecontrolResponse(event_t *ev)
|
||||
found = 0;
|
||||
setupcontrols[control][1] = KEY_NULL; //replace key 1,clear key2
|
||||
}
|
||||
|
||||
(void)G_CheckDoubleUsage(ch, true);
|
||||
setupcontrols[control][found] = ch;
|
||||
}
|
||||
|
||||
S_StartSound(NULL, sfx_s221);
|
||||
}
|
||||
else if (ch == KEY_PAUSE)
|
||||
|
||||
@@ -319,6 +319,7 @@ void GameFocus_menu_Onchange (void);
|
||||
void M_UpdateOGLMenu(void);
|
||||
#endif
|
||||
|
||||
void M_ResetDemoList(void);
|
||||
void M_ReplayHut(INT32 choice);
|
||||
void M_SetPlaybackMenuPointer(void);
|
||||
|
||||
|
||||
+50
-55
@@ -933,30 +933,28 @@ static menuitem_t OP_ExpOptionsMenu[] =
|
||||
{
|
||||
{IT_HEADER, NULL, "Advanced Video Options", NULL, 0},
|
||||
{IT_STRING|IT_CVAR, NULL, "Interpolation Distance", &cv_maxinterpdist, 10},
|
||||
{IT_STRING | IT_CVAR, NULL, "Weather Interpolation", &cv_precipinterp, 15},
|
||||
|
||||
{IT_STRING | IT_CVAR, NULL, "Scale Weather with Mobjscale", &cv_mobjscaleprecip, 25},
|
||||
{IT_STRING | IT_CVAR, NULL, "Less Weather Effects", &cv_lessprecip, 30},
|
||||
{IT_STRING | IT_CVAR, NULL, "Less Weather Effects", &cv_lessprecip, 20},
|
||||
|
||||
{IT_STRING | IT_CVAR, NULL, "Minimum Sector Brightness", &cv_secbright, 40},
|
||||
{IT_STRING | IT_CVAR, NULL, "Minimum Sector Brightness", &cv_secbright, 30},
|
||||
|
||||
//{IT_STRING | IT_CVAR, NULL, "Randomized Directional Light", &cv_randomdirlight, 55}, // should this ever come back
|
||||
//{IT_STRING | IT_CVAR, NULL, "Randomized Directional Light", &cv_randomdirlight, 45}, // should this ever come back
|
||||
|
||||
{IT_STRING | IT_CVAR, NULL, "Skyboxes", &cv_skybox, 50},
|
||||
{IT_STRING | IT_CVAR, NULL, "Skyboxes", &cv_skybox, 40},
|
||||
|
||||
{IT_STRING | IT_CVAR, NULL, "FPS counter sampling", &cv_accuratefps, 60},
|
||||
{IT_STRING | IT_CVAR, NULL, "FPS counter sampling", &cv_accuratefps, 50},
|
||||
|
||||
{IT_STRING | IT_CVAR, NULL, "Votescreen Scaling", &cv_votebgscaling, 70},
|
||||
{IT_STRING | IT_CVAR, NULL, "Votescreen Scaling", &cv_votebgscaling, 60},
|
||||
|
||||
#ifdef HWRENDER
|
||||
{IT_STRING | IT_CVAR, NULL, "Screen Textures", &cv_glscreentextures, 80},
|
||||
{IT_STRING | IT_CVAR, NULL, "Screen Textures", &cv_glscreentextures, 70},
|
||||
#ifdef USE_FBO_OGL
|
||||
{IT_STRING | IT_CVAR, NULL, "FBO Downsampling support", &cv_glframebuffer, 85},
|
||||
{IT_STRING | IT_CVAR, NULL, "Palette Depth", &cv_glpalettedepth, 95},
|
||||
{IT_DISABLED, NULL, "", NULL, 105}, // dummy text
|
||||
{IT_STRING | IT_CVAR, NULL, "FBO Downsampling support", &cv_glframebuffer, 75},
|
||||
{IT_STRING | IT_CVAR, NULL, "Palette Depth", &cv_glpalettedepth, 85},
|
||||
{IT_DISABLED, NULL, "", NULL, 95}, // dummy text
|
||||
#else
|
||||
{IT_STRING | IT_CVAR, NULL, "Palette Depth", &cv_glpalettedepth, 90},
|
||||
{IT_DISABLED, NULL, "", NULL, 100}, // dummy text
|
||||
{IT_STRING | IT_CVAR, NULL, "Palette Depth", &cv_glpalettedepth, 80},
|
||||
{IT_DISABLED, NULL, "", NULL, 90}, // dummy text
|
||||
#endif
|
||||
#endif
|
||||
};
|
||||
@@ -965,8 +963,6 @@ static const char* OP_ExpTooltips[] =
|
||||
{
|
||||
NULL,
|
||||
"How far Mobj interpolation should take effect.",
|
||||
"Should weather be interpolated? Weather should look about the\nsame but perform a bit better when disabled.",
|
||||
"Should weather be scaled with Mapobjectscale?.",
|
||||
"When weather is on this will cut the object amount used in half.",
|
||||
"Sets minimum sector brightness, useful for dark areas",
|
||||
//"Should the directional lightning be randomized each map?\nTakes effect on next map load.",
|
||||
@@ -986,8 +982,6 @@ enum
|
||||
{
|
||||
op_exp_header,
|
||||
op_exp_interpdist,
|
||||
op_exp_precipinter,
|
||||
op_exp_precipmoscale,
|
||||
op_exp_lessprecip,
|
||||
op_exp_secbright,
|
||||
//op_exp_dirlight,
|
||||
@@ -1070,29 +1064,26 @@ enum
|
||||
static menuitem_t OP_SoundOptionsMenu[] =
|
||||
{
|
||||
{IT_STRING|IT_CVAR|IT_CV_NOPRINT, NULL, "SFX", &cv_gamesounds, 10},
|
||||
{IT_STRING|IT_CVAR|IT_CV_SLIDER,
|
||||
NULL, "SFX Volume", &cv_soundvolume, 18},
|
||||
{IT_STRING|IT_CVAR|IT_CV_SLIDER, NULL, "SFX Volume", &cv_soundvolume, 18},
|
||||
|
||||
{IT_STRING|IT_CVAR|IT_CV_NOPRINT, NULL, "Music", &cv_gamedigimusic, 30},
|
||||
{IT_STRING|IT_CVAR|IT_CV_SLIDER,
|
||||
NULL, "Music Volume", &cv_digmusicvolume, 38},
|
||||
{IT_STRING|IT_CVAR|IT_CV_SLIDER, NULL, "Music Volume", &cv_digmusicvolume, 38},
|
||||
|
||||
#ifndef NO_MIDI
|
||||
{IT_STRING|IT_CVAR, NULL, "MIDI", &cv_gamemidimusic, 50},
|
||||
{IT_STRING|IT_CVAR|IT_CV_SLIDER,
|
||||
NULL, "MIDI Volume", &cv_midimusicvolume, 58},
|
||||
//#ifndef NO_MIDI
|
||||
#if 0
|
||||
{IT_STRING|IT_CVAR|IT_CV_SLIDER, NULL, "MIDI Volume", &cv_midimusicvolume, 46},
|
||||
|
||||
{IT_STRING|IT_CVAR, NULL, "Reverse L/R Channels", &stereoreverse, 50},
|
||||
{IT_STRING|IT_CVAR, NULL, "Reverse L/R Channels", &stereoreverse, 60},
|
||||
|
||||
{IT_STRING|IT_CVAR, NULL, "Chat Notifications", &cv_chatnotifications, 65},
|
||||
{IT_STRING|IT_CVAR, NULL, "Character voices", &cv_kartvoices, 75},
|
||||
{IT_STRING|IT_CVAR, NULL, "Hit Em Delay", &cv_karthitemdialog, 85},
|
||||
{IT_STRING|IT_CVAR, NULL, "Powerup Warning", &cv_kartinvinsfx, 95},
|
||||
{IT_STRING|IT_CVAR, NULL, "Chat Notifications", &cv_chatnotifications, 75},
|
||||
{IT_STRING|IT_CVAR, NULL, "Character voices", &cv_kartvoices, 85},
|
||||
{IT_STRING|IT_CVAR, NULL, "Hit Em Delay", &cv_karthitemdialog, 95},
|
||||
{IT_STRING|IT_CVAR, NULL, "Powerup Warning", &cv_kartinvinsfx, 105},
|
||||
|
||||
{IT_KEYHANDLER|IT_STRING, NULL, "Sound Test", M_HandleSoundTest, 105},
|
||||
{IT_STRING|IT_CALL, NULL, "Music Test", M_MusicTest, 115},
|
||||
{IT_KEYHANDLER|IT_STRING, NULL, "Sound Test", M_HandleSoundTest, 115},
|
||||
{IT_STRING|IT_CALL, NULL, "Music Test", M_MusicTest, 125},
|
||||
|
||||
{IT_STRING|IT_SUBMENU, NULL, "Advanced Settings...", &OP_SoundAdvancedDef, 125}
|
||||
{IT_STRING|IT_SUBMENU, NULL, "Advanced Settings...", &OP_SoundAdvancedDef, 135}
|
||||
#else
|
||||
{IT_STRING|IT_CVAR, NULL, "Reverse L/R Channels", &stereoreverse, 60},
|
||||
|
||||
@@ -1114,8 +1105,8 @@ static const char* OP_SoundTooltips[] =
|
||||
"Volume of Sound effects.",
|
||||
"Turn Music on or off.",
|
||||
"Volume of Music.",
|
||||
#ifndef NO_MIDI
|
||||
"Turn Midi Music on or off.",
|
||||
//#ifndef NO_MIDI
|
||||
#if 0
|
||||
"Volume of Midi Music.",
|
||||
#endif
|
||||
"Reverse left and right channels of audio.",
|
||||
@@ -1190,7 +1181,7 @@ static menuitem_t OP_FocusOptionsMenu[] =
|
||||
|
||||
{IT_STRING|IT_CVAR, NULL, "Show \"FOCUS LOST\"", &cv_showfocuslost, 100},
|
||||
|
||||
{IT_STRING|IT_CVAR, NULL, "Always Grab Mouse While Focused", &cv_alwaysgrabmouse, 120},
|
||||
{IT_STRING|IT_CVAR, NULL, "Visible Mouse", &cv_mousevisible, 120},
|
||||
};
|
||||
|
||||
static const char* OP_FocusOptionsTooltips[] =
|
||||
@@ -1201,7 +1192,7 @@ static const char* OP_FocusOptionsTooltips[] =
|
||||
"Should the game pause while the game is unfocused?",
|
||||
"Set manual framerate cap while the game is unfocused.",
|
||||
"Should the FOCUS LOST window appear\n while the game is unfocused?",
|
||||
"Should the mouse cursor be grabbed and hidden\n while the game is in focus?",
|
||||
"Displays the mouse cursor while the game is in focus.",
|
||||
};
|
||||
|
||||
static menuitem_t OP_DataOptionsMenu[] =
|
||||
@@ -1349,14 +1340,15 @@ static const char* OP_CamOptionsTooltips[] =
|
||||
};
|
||||
|
||||
#define OP_CAMMENU(pnum) \
|
||||
{IT_STRING | IT_CVAR, NULL, "Flipcam", &cv_flipcam[pnum], 30}, \
|
||||
{IT_STRING | IT_CVAR | IT_CV_BIGFLOAT, NULL, "Camera Distance", &cv_cam_dist[pnum], 50}, \
|
||||
{IT_STRING | IT_CVAR | IT_CV_BIGFLOAT, NULL, "Camera Height", &cv_cam_height[pnum], 60}, \
|
||||
{IT_STRING | IT_CVAR, NULL, "Camera Speed", &cv_cam_speed[pnum], 70}, \
|
||||
{IT_STRING | IT_CVAR, NULL, "Camera Lookback Momentum", &cv_lookbackmom[pnum], 90}, \
|
||||
{IT_STRING | IT_CVAR, NULL, "Camera Vertical Look", &cv_verticallook[pnum], 100}, \
|
||||
{IT_STRING | IT_CVAR, NULL, "Freecam Speed", &cv_freecam_speed[pnum], 120}, \
|
||||
{IT_STRING | IT_CVAR, NULL, "Third Person Camera", &cv_chasecam[pnum], 135}, \
|
||||
{IT_STRING | IT_CVAR, NULL, "Flipcam", &cv_flipcam[pnum], 30}, \
|
||||
{IT_STRING | IT_CVAR | IT_CV_BIGFLOAT, NULL, "Camera Distance", &cv_cam_dist[pnum], 50}, \
|
||||
{IT_STRING | IT_CVAR | IT_CV_BIGFLOAT, NULL, "Camera Height", &cv_cam_height[pnum], 60}, \
|
||||
{IT_STRING | IT_CVAR, NULL, "Camera Slope Pitch", &cv_cam_pitch[pnum], 70}, \
|
||||
{IT_STRING | IT_CVAR, NULL, "Camera Speed", &cv_cam_speed[pnum], 80}, \
|
||||
{IT_STRING | IT_CVAR, NULL, "Camera Lookback Momentum", &cv_cam_lookbackmom[pnum], 100}, \
|
||||
{IT_STRING | IT_CVAR, NULL, "Camera Vertical Look", &cv_verticallook[pnum], 110}, \
|
||||
{IT_STRING | IT_CVAR, NULL, "Freecam Speed", &cv_freecam_speed[pnum], 130}, \
|
||||
{IT_STRING | IT_CVAR, NULL, "Third Person Camera", &cv_chasecam[pnum], 145}, \
|
||||
|
||||
static menuitem_t OP_Player1CamOptionsMenu[] =
|
||||
{
|
||||
@@ -1388,6 +1380,7 @@ static const char* OP_PlayerCamOptionsTooltips[] =
|
||||
"Should the Camera flip on gravity flipped sections?.",
|
||||
"Camera distance relative to the Player.",
|
||||
"Height of the Camera",
|
||||
"Pitch Camera on Upwards or Downhill Slopes",
|
||||
"Speed of the Camera",
|
||||
"Should looking back inherit the Players Momentum?\nEither inherit Player Momentum or double of it\nmay make looking back while boosting or going in high speed less jarring",
|
||||
"Allows looking up/down by holding\naim forward/backward while standing still.",
|
||||
@@ -1405,18 +1398,19 @@ static menuitem_t OP_ChatOptionsMenu[] =
|
||||
NULL, "Chat Box Width", &cv_chatwidth, 20},
|
||||
{IT_STRING | IT_CVAR | IT_CV_SLIDER,
|
||||
NULL, "Chat Box Height", &cv_chatheight, 30},
|
||||
{IT_STRING | IT_CVAR, NULL, "Center Text in Chat", &cv_chatcentertext, 40},
|
||||
|
||||
{IT_STRING | IT_CVAR, NULL, "Chat Background Tint", &cv_chatbacktint, 45},
|
||||
{IT_STRING | IT_CVAR, NULL, "Message Fadeout Time", &cv_chattime, 55},
|
||||
{IT_STRING | IT_CVAR, NULL, "Spam Protection", &cv_chatspamprotection, 65},
|
||||
{IT_STRING | IT_CVAR, NULL, "Max Chat Messages", &cv_chatlogsize, 75},
|
||||
{IT_STRING | IT_CVAR, NULL, "Chat Background Tint", &cv_chatbacktint, 55},
|
||||
{IT_STRING | IT_CVAR, NULL, "Message Fadeout Time", &cv_chattime, 65},
|
||||
{IT_STRING | IT_CVAR, NULL, "Spam Protection", &cv_chatspamprotection, 75},
|
||||
{IT_STRING | IT_CVAR, NULL, "Max Chat Messages", &cv_chatlogsize, 85},
|
||||
|
||||
{IT_STRING | IT_CVAR, NULL, "Local ping display", &cv_showping, 95}, // shows ping above the framerate if we want to.
|
||||
{IT_STRING | IT_CVAR, NULL, "Ping display style", &cv_pingstyle, 105},
|
||||
{IT_STRING | IT_CVAR, NULL, "Ping measurement", &cv_pingmeasurement, 115},
|
||||
{IT_STRING | IT_CVAR, NULL, "Ping icon", &cv_pingicon, 125},
|
||||
{IT_STRING | IT_CVAR, NULL, "Local ping display", &cv_showping, 105}, // shows ping above the framerate if we want to.
|
||||
{IT_STRING | IT_CVAR, NULL, "Ping display style", &cv_pingstyle, 115},
|
||||
{IT_STRING | IT_CVAR, NULL, "Ping measurement", &cv_pingmeasurement, 125},
|
||||
{IT_STRING | IT_CVAR, NULL, "Ping icon", &cv_pingicon, 135},
|
||||
|
||||
{IT_STRING | IT_CVAR, NULL, "Show IP address in playerlist", &cv_shownodeip, 135},
|
||||
{IT_STRING | IT_CVAR, NULL, "Show IP address in playerlist", &cv_shownodeip, 145},
|
||||
};
|
||||
|
||||
static const char* OP_ChatOptionsTooltips[] =
|
||||
@@ -1424,6 +1418,7 @@ static const char* OP_ChatOptionsTooltips[] =
|
||||
"Chat mode used for in-game chat.",
|
||||
"Width of chat box.",
|
||||
"Height of chat box.",
|
||||
"Center text in the chat message pop ups.",
|
||||
"Chatbox background.",
|
||||
"Fadeout time for new chat message.",
|
||||
"Spam protection for in-game chat.",
|
||||
|
||||
+1
-1
@@ -96,7 +96,7 @@ ATTRINLINE static fixed_t FUNCINLINE __internal_prng__(void)
|
||||
randomseed ^= randomseed >> 13;
|
||||
randomseed ^= randomseed >> 11;
|
||||
randomseed ^= randomseed << 21;
|
||||
return ( (randomseed*36548569) >> 4) & (FRACUNIT-1);
|
||||
return ((randomseed*36548569) >> 4) & (FRACUNIT-1);
|
||||
}
|
||||
|
||||
/** Provides a random fixed point number. Distribution is uniform.
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
// SONIC ROBO BLAST 2
|
||||
//-----------------------------------------------------------------------------
|
||||
// Copyright (C) 1995-1996 by the Free Software Foundation, Inc.
|
||||
// Copyright (C) 1995-2025 by the Free Software Foundation, Inc.
|
||||
//
|
||||
// This program is free software distributed under the
|
||||
// terms of the GNU General Public License, version 2.
|
||||
@@ -33,7 +33,7 @@
|
||||
#include "endian.h"
|
||||
|
||||
#if defined (SRB2_BIG_ENDIAN)
|
||||
#define SWAP(n) \
|
||||
#define SWAP(n) \
|
||||
(((n) << 24) | (((n) & 0xff00) << 8) | (((n) >> 8) & 0xff00) | ((n) >> 24))
|
||||
#else
|
||||
#define SWAP(n) (n)
|
||||
@@ -46,27 +46,31 @@ static const unsigned char fillbuf[64] = { 0x80, 0 /*, 0, 0, ... */ };
|
||||
/* Structure to save state of computation between the single steps. */
|
||||
struct md5_ctx
|
||||
{
|
||||
md5_uint32 A;
|
||||
md5_uint32 B;
|
||||
md5_uint32 C;
|
||||
md5_uint32 D;
|
||||
md5_uint32 A;
|
||||
md5_uint32 B;
|
||||
md5_uint32 C;
|
||||
md5_uint32 D;
|
||||
|
||||
md5_uint32 total[2];
|
||||
md5_uint32 buflen;
|
||||
char buffer[128];
|
||||
md5_uint32 total[2];
|
||||
md5_uint32 buflen;
|
||||
union
|
||||
{
|
||||
char buffer[128];
|
||||
md5_uint32 buffer32[32];
|
||||
};
|
||||
};
|
||||
|
||||
/* Initialize structure containing state of computation.
|
||||
(RFC 1321, 3.3: Step 3) */
|
||||
static void md5_init_ctx (struct md5_ctx *ctx)
|
||||
static void md5_init_ctx(struct md5_ctx *ctx)
|
||||
{
|
||||
ctx->A = 0x67452301;
|
||||
ctx->B = 0xefcdab89;
|
||||
ctx->C = 0x98badcfe;
|
||||
ctx->D = 0x10325476;
|
||||
ctx->A = 0x67452301;
|
||||
ctx->B = 0xefcdab89;
|
||||
ctx->C = 0x98badcfe;
|
||||
ctx->D = 0x10325476;
|
||||
|
||||
ctx->total[0] = ctx->total[1] = 0;
|
||||
ctx->buflen = 0;
|
||||
ctx->total[0] = ctx->total[1] = 0;
|
||||
ctx->buflen = 0;
|
||||
}
|
||||
|
||||
/* Put result from CTX in first 16 bytes following RESBUF. The result
|
||||
@@ -74,14 +78,14 @@ static void md5_init_ctx (struct md5_ctx *ctx)
|
||||
|
||||
IMPORTANT: On some systems it is required that RESBUF is correctly
|
||||
aligned for a 32 bits value. */
|
||||
static void *md5_read_ctx (const struct md5_ctx *ctx, void *resbuf)
|
||||
static void *md5_read_ctx(const struct md5_ctx *ctx, void *resbuf)
|
||||
{
|
||||
((md5_uint32 *) resbuf)[0] = SWAP (ctx->A);
|
||||
((md5_uint32 *) resbuf)[1] = SWAP (ctx->B);
|
||||
((md5_uint32 *) resbuf)[2] = SWAP (ctx->C);
|
||||
((md5_uint32 *) resbuf)[3] = SWAP (ctx->D);
|
||||
((md5_uint32 *) resbuf)[0] = SWAP(ctx->A);
|
||||
((md5_uint32 *) resbuf)[1] = SWAP(ctx->B);
|
||||
((md5_uint32 *) resbuf)[2] = SWAP(ctx->C);
|
||||
((md5_uint32 *) resbuf)[3] = SWAP(ctx->D);
|
||||
|
||||
return resbuf;
|
||||
return resbuf;
|
||||
}
|
||||
|
||||
/* These are the four functions used in the four steps of the MD5 algorithm
|
||||
@@ -96,200 +100,215 @@ static void *md5_read_ctx (const struct md5_ctx *ctx, void *resbuf)
|
||||
/* Process LEN bytes of BUFFER, accumulating context into CTX.
|
||||
It is assumed that LEN % 64 == 0. */
|
||||
|
||||
static void md5_process_block (const void *buffer, size_t len, struct md5_ctx *ctx)
|
||||
static void md5_process_block(const void *buffer, size_t len, struct md5_ctx *ctx)
|
||||
{
|
||||
md5_uint32 correct_words[16];
|
||||
const md5_uint32 *words = buffer;
|
||||
size_t nwords = len / sizeof (md5_uint32);
|
||||
const md5_uint32 *endp = words + nwords;
|
||||
md5_uint32 A = ctx->A;
|
||||
md5_uint32 B = ctx->B;
|
||||
md5_uint32 C = ctx->C;
|
||||
md5_uint32 D = ctx->D;
|
||||
md5_uint32 correct_words[16];
|
||||
const md5_uint32 *words = buffer;
|
||||
size_t nwords = len / sizeof (md5_uint32);
|
||||
const md5_uint32 *endp = words + nwords;
|
||||
md5_uint32 A = ctx->A;
|
||||
md5_uint32 B = ctx->B;
|
||||
md5_uint32 C = ctx->C;
|
||||
md5_uint32 D = ctx->D;
|
||||
md5_uint32 lolen = len;
|
||||
|
||||
/* First increment the byte count. RFC 1321 specifies the possible
|
||||
length of the file up to 2^64 bits. Here we only compute the
|
||||
number of bytes. Do a double word increment. */
|
||||
ctx->total[0] = (md5_uint32)(len+ctx->total[0]);
|
||||
if (ctx->total[0] < len)
|
||||
++ctx->total[1];
|
||||
/* First increment the byte count. RFC 1321 specifies the possible
|
||||
length of the file up to 2^64 bits. Here we only compute the
|
||||
number of bytes. Do a double word increment. */
|
||||
ctx->total[0] += lolen;
|
||||
ctx->total[1] += (len >> 31 >> 1) + (ctx->total[0] < lolen);
|
||||
|
||||
/* Process all bytes in the buffer with 64 bytes in each round of
|
||||
the loop. */
|
||||
while (words < endp)
|
||||
{
|
||||
md5_uint32 *cwp = correct_words;
|
||||
md5_uint32 A_save = A;
|
||||
md5_uint32 B_save = B;
|
||||
md5_uint32 C_save = C;
|
||||
md5_uint32 D_save = D;
|
||||
/* Process all bytes in the buffer with 64 bytes in each round of
|
||||
the loop. */
|
||||
while (words < endp)
|
||||
{
|
||||
md5_uint32 *cwp = correct_words;
|
||||
md5_uint32 A_save = A;
|
||||
md5_uint32 B_save = B;
|
||||
md5_uint32 C_save = C;
|
||||
md5_uint32 D_save = D;
|
||||
|
||||
/* First round: using the given function, the context and a constant
|
||||
the next context is computed. Because the algorithms processing
|
||||
unit is a 32-bit word and it is determined to work on words in
|
||||
little endian byte order we perhaps have to change the byte order
|
||||
before the computation. To reduce the work for the next steps
|
||||
we store the swapped words in the array CORRECT_WORDS. */
|
||||
/* First round: using the given function, the context and a constant
|
||||
the next context is computed. Because the algorithms processing
|
||||
unit is a 32-bit word and it is determined to work on words in
|
||||
little endian byte order we perhaps have to change the byte order
|
||||
before the computation. To reduce the work for the next steps
|
||||
we store the swapped words in the array CORRECT_WORDS. */
|
||||
|
||||
#define OP(a, b, c, d, s, T) \
|
||||
do \
|
||||
{ \
|
||||
a += FF (b, c, d) + (*cwp++ = SWAP (*words)) + T; \
|
||||
++words; \
|
||||
CYCLIC (a, s); \
|
||||
a += b; \
|
||||
} \
|
||||
while (0)
|
||||
#define OP(a, b, c, d, s, T) \
|
||||
do \
|
||||
{ \
|
||||
a += FF (b, c, d) + (*cwp++ = SWAP (*words)) + T; \
|
||||
++words; \
|
||||
CYCLIC (a, s); \
|
||||
a += b; \
|
||||
} \
|
||||
while (0)
|
||||
|
||||
/* It is unfortunate that C does not provide an operator for
|
||||
cyclic rotation. Hope the C compiler is smart enough. */
|
||||
/* It is unfortunate that C does not provide an operator for
|
||||
cyclic rotation. Hope the C compiler is smart enough. */
|
||||
#define CYCLIC(w, s) (w = (w << s) | (w >> (32 - s)))
|
||||
|
||||
/* Before we start, one word to the strange constants.
|
||||
They are defined in RFC 1321 as
|
||||
/* Before we start, one word to the strange constants.
|
||||
They are defined in RFC 1321 as
|
||||
|
||||
T[i] = (int) (4294967296.0 * fabs (sin (i))), i = 1..64
|
||||
*/
|
||||
T[i] = (int) (4294967296.0 * fabs (sin (i))), i=1..64
|
||||
*/
|
||||
|
||||
/* Round 1. */
|
||||
OP (A, B, C, D, 7, 0xd76aa478);
|
||||
OP (D, A, B, C, 12, 0xe8c7b756);
|
||||
OP (C, D, A, B, 17, 0x242070db);
|
||||
OP (B, C, D, A, 22, 0xc1bdceee);
|
||||
OP (A, B, C, D, 7, 0xf57c0faf);
|
||||
OP (D, A, B, C, 12, 0x4787c62a);
|
||||
OP (C, D, A, B, 17, 0xa8304613);
|
||||
OP (B, C, D, A, 22, 0xfd469501);
|
||||
OP (A, B, C, D, 7, 0x698098d8);
|
||||
OP (D, A, B, C, 12, 0x8b44f7af);
|
||||
OP (C, D, A, B, 17, 0xffff5bb1);
|
||||
OP (B, C, D, A, 22, 0x895cd7be);
|
||||
OP (A, B, C, D, 7, 0x6b901122);
|
||||
OP (D, A, B, C, 12, 0xfd987193);
|
||||
OP (C, D, A, B, 17, 0xa679438e);
|
||||
OP (B, C, D, A, 22, 0x49b40821);
|
||||
/* Round 1. */
|
||||
OP (A, B, C, D, 7, 0xd76aa478);
|
||||
OP (D, A, B, C, 12, 0xe8c7b756);
|
||||
OP (C, D, A, B, 17, 0x242070db);
|
||||
OP (B, C, D, A, 22, 0xc1bdceee);
|
||||
OP (A, B, C, D, 7, 0xf57c0faf);
|
||||
OP (D, A, B, C, 12, 0x4787c62a);
|
||||
OP (C, D, A, B, 17, 0xa8304613);
|
||||
OP (B, C, D, A, 22, 0xfd469501);
|
||||
OP (A, B, C, D, 7, 0x698098d8);
|
||||
OP (D, A, B, C, 12, 0x8b44f7af);
|
||||
OP (C, D, A, B, 17, 0xffff5bb1);
|
||||
OP (B, C, D, A, 22, 0x895cd7be);
|
||||
OP (A, B, C, D, 7, 0x6b901122);
|
||||
OP (D, A, B, C, 12, 0xfd987193);
|
||||
OP (C, D, A, B, 17, 0xa679438e);
|
||||
OP (B, C, D, A, 22, 0x49b40821);
|
||||
|
||||
/* For the second to fourth round we have the possibly swapped words
|
||||
in CORRECT_WORDS. Redefine the macro to take an additional first
|
||||
argument specifying the function to use. */
|
||||
/* For the second to fourth round we have the possibly swapped words
|
||||
in CORRECT_WORDS. Redefine the macro to take an additional first
|
||||
argument specifying the function to use. */
|
||||
#undef OP
|
||||
#define OP(f, a, b, c, d, k, s, T) \
|
||||
do \
|
||||
{ \
|
||||
a += f (b, c, d) + correct_words[k] + T; \
|
||||
CYCLIC (a, s); \
|
||||
a += b; \
|
||||
} \
|
||||
while (0)
|
||||
#define OP(f, a, b, c, d, k, s, T) \
|
||||
do \
|
||||
{ \
|
||||
a += f (b, c, d) + correct_words[k] + T; \
|
||||
CYCLIC (a, s); \
|
||||
a += b; \
|
||||
} \
|
||||
while (0)
|
||||
|
||||
/* Round 2. */
|
||||
OP (FG, A, B, C, D, 1, 5, 0xf61e2562);
|
||||
OP (FG, D, A, B, C, 6, 9, 0xc040b340);
|
||||
OP (FG, C, D, A, B, 11, 14, 0x265e5a51);
|
||||
OP (FG, B, C, D, A, 0, 20, 0xe9b6c7aa);
|
||||
OP (FG, A, B, C, D, 5, 5, 0xd62f105d);
|
||||
OP (FG, D, A, B, C, 10, 9, 0x02441453);
|
||||
OP (FG, C, D, A, B, 15, 14, 0xd8a1e681);
|
||||
OP (FG, B, C, D, A, 4, 20, 0xe7d3fbc8);
|
||||
OP (FG, A, B, C, D, 9, 5, 0x21e1cde6);
|
||||
OP (FG, D, A, B, C, 14, 9, 0xc33707d6);
|
||||
OP (FG, C, D, A, B, 3, 14, 0xf4d50d87);
|
||||
OP (FG, B, C, D, A, 8, 20, 0x455a14ed);
|
||||
OP (FG, A, B, C, D, 13, 5, 0xa9e3e905);
|
||||
OP (FG, D, A, B, C, 2, 9, 0xfcefa3f8);
|
||||
OP (FG, C, D, A, B, 7, 14, 0x676f02d9);
|
||||
OP (FG, B, C, D, A, 12, 20, 0x8d2a4c8a);
|
||||
/* Round 2. */
|
||||
OP (FG, A, B, C, D, 1, 5, 0xf61e2562);
|
||||
OP (FG, D, A, B, C, 6, 9, 0xc040b340);
|
||||
OP (FG, C, D, A, B, 11, 14, 0x265e5a51);
|
||||
OP (FG, B, C, D, A, 0, 20, 0xe9b6c7aa);
|
||||
OP (FG, A, B, C, D, 5, 5, 0xd62f105d);
|
||||
OP (FG, D, A, B, C, 10, 9, 0x02441453);
|
||||
OP (FG, C, D, A, B, 15, 14, 0xd8a1e681);
|
||||
OP (FG, B, C, D, A, 4, 20, 0xe7d3fbc8);
|
||||
OP (FG, A, B, C, D, 9, 5, 0x21e1cde6);
|
||||
OP (FG, D, A, B, C, 14, 9, 0xc33707d6);
|
||||
OP (FG, C, D, A, B, 3, 14, 0xf4d50d87);
|
||||
OP (FG, B, C, D, A, 8, 20, 0x455a14ed);
|
||||
OP (FG, A, B, C, D, 13, 5, 0xa9e3e905);
|
||||
OP (FG, D, A, B, C, 2, 9, 0xfcefa3f8);
|
||||
OP (FG, C, D, A, B, 7, 14, 0x676f02d9);
|
||||
OP (FG, B, C, D, A, 12, 20, 0x8d2a4c8a);
|
||||
|
||||
/* Round 3. */
|
||||
OP (FH, A, B, C, D, 5, 4, 0xfffa3942);
|
||||
OP (FH, D, A, B, C, 8, 11, 0x8771f681);
|
||||
OP (FH, C, D, A, B, 11, 16, 0x6d9d6122);
|
||||
OP (FH, B, C, D, A, 14, 23, 0xfde5380c);
|
||||
OP (FH, A, B, C, D, 1, 4, 0xa4beea44);
|
||||
OP (FH, D, A, B, C, 4, 11, 0x4bdecfa9);
|
||||
OP (FH, C, D, A, B, 7, 16, 0xf6bb4b60);
|
||||
OP (FH, B, C, D, A, 10, 23, 0xbebfbc70);
|
||||
OP (FH, A, B, C, D, 13, 4, 0x289b7ec6);
|
||||
OP (FH, D, A, B, C, 0, 11, 0xeaa127fa);
|
||||
OP (FH, C, D, A, B, 3, 16, 0xd4ef3085);
|
||||
OP (FH, B, C, D, A, 6, 23, 0x04881d05);
|
||||
OP (FH, A, B, C, D, 9, 4, 0xd9d4d039);
|
||||
OP (FH, D, A, B, C, 12, 11, 0xe6db99e5);
|
||||
OP (FH, C, D, A, B, 15, 16, 0x1fa27cf8);
|
||||
OP (FH, B, C, D, A, 2, 23, 0xc4ac5665);
|
||||
/* Round 3. */
|
||||
OP (FH, A, B, C, D, 5, 4, 0xfffa3942);
|
||||
OP (FH, D, A, B, C, 8, 11, 0x8771f681);
|
||||
OP (FH, C, D, A, B, 11, 16, 0x6d9d6122);
|
||||
OP (FH, B, C, D, A, 14, 23, 0xfde5380c);
|
||||
OP (FH, A, B, C, D, 1, 4, 0xa4beea44);
|
||||
OP (FH, D, A, B, C, 4, 11, 0x4bdecfa9);
|
||||
OP (FH, C, D, A, B, 7, 16, 0xf6bb4b60);
|
||||
OP (FH, B, C, D, A, 10, 23, 0xbebfbc70);
|
||||
OP (FH, A, B, C, D, 13, 4, 0x289b7ec6);
|
||||
OP (FH, D, A, B, C, 0, 11, 0xeaa127fa);
|
||||
OP (FH, C, D, A, B, 3, 16, 0xd4ef3085);
|
||||
OP (FH, B, C, D, A, 6, 23, 0x04881d05);
|
||||
OP (FH, A, B, C, D, 9, 4, 0xd9d4d039);
|
||||
OP (FH, D, A, B, C, 12, 11, 0xe6db99e5);
|
||||
OP (FH, C, D, A, B, 15, 16, 0x1fa27cf8);
|
||||
OP (FH, B, C, D, A, 2, 23, 0xc4ac5665);
|
||||
|
||||
/* Round 4. */
|
||||
OP (FI, A, B, C, D, 0, 6, 0xf4292244);
|
||||
OP (FI, D, A, B, C, 7, 10, 0x432aff97);
|
||||
OP (FI, C, D, A, B, 14, 15, 0xab9423a7);
|
||||
OP (FI, B, C, D, A, 5, 21, 0xfc93a039);
|
||||
OP (FI, A, B, C, D, 12, 6, 0x655b59c3);
|
||||
OP (FI, D, A, B, C, 3, 10, 0x8f0ccc92);
|
||||
OP (FI, C, D, A, B, 10, 15, 0xffeff47d);
|
||||
OP (FI, B, C, D, A, 1, 21, 0x85845dd1);
|
||||
OP (FI, A, B, C, D, 8, 6, 0x6fa87e4f);
|
||||
OP (FI, D, A, B, C, 15, 10, 0xfe2ce6e0);
|
||||
OP (FI, C, D, A, B, 6, 15, 0xa3014314);
|
||||
OP (FI, B, C, D, A, 13, 21, 0x4e0811a1);
|
||||
OP (FI, A, B, C, D, 4, 6, 0xf7537e82);
|
||||
OP (FI, D, A, B, C, 11, 10, 0xbd3af235);
|
||||
OP (FI, C, D, A, B, 2, 15, 0x2ad7d2bb);
|
||||
OP (FI, B, C, D, A, 9, 21, 0xeb86d391);
|
||||
/* Round 4. */
|
||||
OP (FI, A, B, C, D, 0, 6, 0xf4292244);
|
||||
OP (FI, D, A, B, C, 7, 10, 0x432aff97);
|
||||
OP (FI, C, D, A, B, 14, 15, 0xab9423a7);
|
||||
OP (FI, B, C, D, A, 5, 21, 0xfc93a039);
|
||||
OP (FI, A, B, C, D, 12, 6, 0x655b59c3);
|
||||
OP (FI, D, A, B, C, 3, 10, 0x8f0ccc92);
|
||||
OP (FI, C, D, A, B, 10, 15, 0xffeff47d);
|
||||
OP (FI, B, C, D, A, 1, 21, 0x85845dd1);
|
||||
OP (FI, A, B, C, D, 8, 6, 0x6fa87e4f);
|
||||
OP (FI, D, A, B, C, 15, 10, 0xfe2ce6e0);
|
||||
OP (FI, C, D, A, B, 6, 15, 0xa3014314);
|
||||
OP (FI, B, C, D, A, 13, 21, 0x4e0811a1);
|
||||
OP (FI, A, B, C, D, 4, 6, 0xf7537e82);
|
||||
OP (FI, D, A, B, C, 11, 10, 0xbd3af235);
|
||||
OP (FI, C, D, A, B, 2, 15, 0x2ad7d2bb);
|
||||
OP (FI, B, C, D, A, 9, 21, 0xeb86d391);
|
||||
|
||||
/* Add the starting values of the context. */
|
||||
A += A_save;
|
||||
B += B_save;
|
||||
C += C_save;
|
||||
D += D_save;
|
||||
}
|
||||
/* Add the starting values of the context. */
|
||||
A += A_save;
|
||||
B += B_save;
|
||||
C += C_save;
|
||||
D += D_save;
|
||||
}
|
||||
|
||||
/* Put checksum in context given as argument. */
|
||||
ctx->A = A;
|
||||
ctx->B = B;
|
||||
ctx->C = C;
|
||||
ctx->D = D;
|
||||
/* Put checksum in context given as argument. */
|
||||
ctx->A = A;
|
||||
ctx->B = B;
|
||||
ctx->C = C;
|
||||
ctx->D = D;
|
||||
}
|
||||
|
||||
|
||||
static void md5_process_bytes (const void *buffer, size_t len, struct md5_ctx *ctx)
|
||||
static void md5_process_bytes(const void *buffer, size_t len, struct md5_ctx *ctx)
|
||||
{
|
||||
/* When we already have some bits in our internal buffer concatenate
|
||||
both inputs first. */
|
||||
if (ctx->buflen != 0)
|
||||
{
|
||||
size_t left_over = ctx->buflen;
|
||||
size_t add = 128 - left_over > len ? len : 128 - left_over;
|
||||
|
||||
memcpy (&ctx->buffer[left_over], buffer, add);
|
||||
ctx->buflen = (md5_uint32)(add+ctx->buflen);
|
||||
|
||||
if (left_over + add > 64)
|
||||
/* When we already have some bits in our internal buffer concatenate
|
||||
* both inputs first. */
|
||||
if (ctx->buflen != 0)
|
||||
{
|
||||
md5_process_block (ctx->buffer, (left_over + add) & ~63, ctx);
|
||||
/* The regions in the following copy operation cannot overlap. */
|
||||
memcpy (ctx->buffer, &ctx->buffer[(left_over + add) & ~63],
|
||||
(left_over + add) & 63);
|
||||
ctx->buflen = (md5_uint32)((left_over + add) & 63);
|
||||
size_t left_over = ctx->buflen;
|
||||
size_t add = 128 - left_over > len ? len : 128 - left_over;
|
||||
|
||||
memcpy (&ctx->buffer[left_over], buffer, add);
|
||||
ctx->buflen += add;
|
||||
|
||||
if (ctx->buflen > 64)
|
||||
{
|
||||
md5_process_block(ctx->buffer, ctx->buflen & ~63, ctx);
|
||||
|
||||
ctx->buflen &= 63;
|
||||
/* The regions in the following copy operation cannot overlap. */
|
||||
memcpy (ctx->buffer, &ctx->buffer[(left_over + add) & ~63],
|
||||
ctx->buflen);
|
||||
}
|
||||
|
||||
buffer = (const char *) buffer + add;
|
||||
len -= add;
|
||||
}
|
||||
|
||||
buffer = (const char *) buffer + add;
|
||||
len -= add;
|
||||
}
|
||||
/* Process available complete blocks. */
|
||||
if (len >= 64)
|
||||
{
|
||||
while (len > 64)
|
||||
{
|
||||
md5_process_block(memcpy(ctx->buffer, buffer, 64), 64, ctx);
|
||||
buffer = (const char *) buffer + 64;
|
||||
len -= 64;
|
||||
}
|
||||
}
|
||||
|
||||
/* Process available complete blocks. */
|
||||
if (len > 64)
|
||||
{
|
||||
md5_process_block (buffer, len & ~63, ctx);
|
||||
buffer = (const char *) buffer + (len & ~63);
|
||||
len &= 63;
|
||||
}
|
||||
/* Move remaining bytes in internal buffer. */
|
||||
if (len > 0)
|
||||
{
|
||||
size_t left_over = ctx->buflen;
|
||||
|
||||
/* Move remaining bytes in internal buffer. */
|
||||
if (len > 0)
|
||||
{
|
||||
memcpy (ctx->buffer, buffer, len);
|
||||
ctx->buflen = (md5_uint32)len;
|
||||
}
|
||||
memcpy(&ctx->buffer[left_over], buffer, len);
|
||||
left_over += len;
|
||||
|
||||
if (left_over >= 64)
|
||||
{
|
||||
md5_process_block (ctx->buffer, 64, ctx);
|
||||
left_over -= 64;
|
||||
memcpy(ctx->buffer, &ctx->buffer[64], left_over);
|
||||
}
|
||||
|
||||
ctx->buflen = left_over;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -298,100 +317,98 @@ static void md5_process_bytes (const void *buffer, size_t len, struct md5_ctx *c
|
||||
|
||||
IMPORTANT: On some systems it is required that RESBUF is correctly
|
||||
aligned for a 32 bits value. */
|
||||
static void *md5_finish_ctx (struct md5_ctx *ctx, void *resbuf)
|
||||
static void *md5_finish_ctx(struct md5_ctx *ctx, void *resbuf)
|
||||
{
|
||||
/* Take yet unprocessed bytes into account. */
|
||||
md5_uint32 bytes = ctx->buflen;
|
||||
size_t pad;
|
||||
md5_uint32 *buffer = NULL;
|
||||
/* Take yet unprocessed bytes into account. */
|
||||
md5_uint32 bytes = ctx->buflen;
|
||||
size_t pad;
|
||||
|
||||
/* Now count remaining bytes. */
|
||||
ctx->total[0] += bytes;
|
||||
if (ctx->total[0] < bytes)
|
||||
++ctx->total[1];
|
||||
/* Now count remaining bytes. */
|
||||
ctx->total[0] += bytes;
|
||||
if (ctx->total[0] < bytes)
|
||||
++ctx->total[1];
|
||||
|
||||
pad = bytes >= 56 ? 64 + 56 - bytes : 56 - bytes;
|
||||
memcpy (&ctx->buffer[bytes], fillbuf, pad);
|
||||
pad = bytes >= 56 ? 64 + 56 - bytes : 56 - bytes;
|
||||
memcpy(&ctx->buffer[bytes], fillbuf, pad);
|
||||
|
||||
/* Put the 64-bit file length in *bits* at the end of the buffer. */
|
||||
buffer = (void *)&ctx->buffer[bytes + pad];
|
||||
*buffer = SWAP (ctx->total[0] << 3);
|
||||
buffer = (void *)&ctx->buffer[bytes + pad + 4];
|
||||
*buffer = SWAP ((ctx->total[1] << 3) | (ctx->total[0] >> 29));
|
||||
/* Put the 64-bit file length in *bits* at the end of the buffer. */
|
||||
ctx->buffer32[(bytes + pad) / 4] = SWAP (ctx->total[0] << 3);
|
||||
ctx->buffer32[(bytes + pad + 4) / 4] = SWAP ((ctx->total[1] << 3)
|
||||
| (ctx->total[0] >> 29));
|
||||
|
||||
/* Process last bytes. */
|
||||
md5_process_block (ctx->buffer, bytes + pad + 8, ctx);
|
||||
/* Process last bytes. */
|
||||
md5_process_block(ctx->buffer, bytes + pad + 8, ctx);
|
||||
|
||||
return md5_read_ctx (ctx, resbuf);
|
||||
return md5_read_ctx(ctx, resbuf);
|
||||
}
|
||||
|
||||
/* Compute MD5 message digest for bytes read from STREAM. The
|
||||
resulting message digest number will be written into the 16 bytes
|
||||
beginning at RESBLOCK. */
|
||||
int md5_stream (FILE *stream, void *resblock)
|
||||
int md5_stream(FILE *stream, void *resblock)
|
||||
{
|
||||
/* Important: BLOCKSIZE must be a multiple of 64. */
|
||||
/* Important: BLOCKSIZE must be a multiple of 64. */
|
||||
#define BLOCKSIZE 4096
|
||||
struct md5_ctx ctx;
|
||||
char buffer[BLOCKSIZE + 72];
|
||||
size_t sum = 0;
|
||||
struct md5_ctx ctx;
|
||||
char buffer[BLOCKSIZE + 72];
|
||||
size_t sum = 0;
|
||||
|
||||
/* Initialize the computation context. */
|
||||
md5_init_ctx (&ctx);
|
||||
/* Initialize the computation context. */
|
||||
md5_init_ctx(&ctx);
|
||||
|
||||
/* Iterate over full file contents. */
|
||||
while (1)
|
||||
{
|
||||
/* We read the file in blocks of BLOCKSIZE bytes. One call of the
|
||||
computation function processes the whole buffer so that with the
|
||||
next round of the loop another block can be read. */
|
||||
size_t n;
|
||||
sum = 0;
|
||||
|
||||
/* Read block. Take care for partial reads. */
|
||||
do
|
||||
/* Iterate over full file contents. */
|
||||
while (1)
|
||||
{
|
||||
n = fread (buffer + sum, 1, BLOCKSIZE - sum, stream);
|
||||
/* We read the file in blocks of BLOCKSIZE bytes. One call of the
|
||||
computation function processes the whole buffer so that with the
|
||||
next round of the loop another block can be read. */
|
||||
size_t n;
|
||||
sum = 0;
|
||||
|
||||
sum += n;
|
||||
/* Read block. Take care for partial reads. */
|
||||
do
|
||||
{
|
||||
n = fread(buffer + sum, 1, BLOCKSIZE - sum, stream);
|
||||
sum += n;
|
||||
}
|
||||
|
||||
while (sum < BLOCKSIZE && n != 0);
|
||||
if (n == 0 && ferror(stream))
|
||||
return 1;
|
||||
|
||||
/* If end of file is reached, end the loop. */
|
||||
if (n == 0)
|
||||
break;
|
||||
|
||||
/* Process buffer with BLOCKSIZE bytes. Note that
|
||||
BLOCKSIZE % 64 == 0
|
||||
*/
|
||||
md5_process_block(buffer, BLOCKSIZE, &ctx);
|
||||
}
|
||||
while (sum < BLOCKSIZE && n != 0);
|
||||
if (n == 0 && ferror (stream))
|
||||
return 1;
|
||||
|
||||
/* If end of file is reached, end the loop. */
|
||||
if (n == 0)
|
||||
break;
|
||||
/* Add the last bytes if necessary. */
|
||||
if (sum > 0)
|
||||
md5_process_bytes(buffer, sum, &ctx);
|
||||
|
||||
/* Process buffer with BLOCKSIZE bytes. Note that
|
||||
BLOCKSIZE % 64 == 0
|
||||
*/
|
||||
md5_process_block (buffer, BLOCKSIZE, &ctx);
|
||||
}
|
||||
|
||||
/* Add the last bytes if necessary. */
|
||||
if (sum > 0)
|
||||
md5_process_bytes (buffer, sum, &ctx);
|
||||
|
||||
/* Construct result in desired memory. */
|
||||
md5_finish_ctx (&ctx, resblock);
|
||||
return 0;
|
||||
/* Construct result in desired memory. */
|
||||
md5_finish_ctx(&ctx, resblock);
|
||||
return 0;
|
||||
}
|
||||
|
||||
/* Compute MD5 message digest for LEN bytes beginning at BUFFER. The
|
||||
result is always in little endian byte order, so that a byte-wise
|
||||
output yields to the wanted ASCII representation of the message
|
||||
digest. */
|
||||
void *md5_buffer (const char *buffer, size_t len, void *resblock)
|
||||
void *md5_buffer(const char *buffer, size_t len, void *resblock)
|
||||
{
|
||||
struct md5_ctx ctx;
|
||||
struct md5_ctx ctx;
|
||||
|
||||
/* Initialize the computation context. */
|
||||
md5_init_ctx (&ctx);
|
||||
/* Initialize the computation context. */
|
||||
md5_init_ctx(&ctx);
|
||||
|
||||
/* Process whole buffer but last len % 64 bytes. */
|
||||
md5_process_bytes (buffer, len, &ctx);
|
||||
/* Process whole buffer but last len % 64 bytes. */
|
||||
md5_process_bytes (buffer, len, &ctx);
|
||||
|
||||
/* Put result in desired memory area. */
|
||||
return md5_finish_ctx (&ctx, resblock);
|
||||
/* Put result in desired memory area. */
|
||||
return md5_finish_ctx(&ctx, resblock);
|
||||
}
|
||||
@@ -1,6 +1,6 @@
|
||||
// SONIC ROBO BLAST 2
|
||||
//-----------------------------------------------------------------------------
|
||||
// Copyright (C) 1995-1996 by the Free Software Foundation, Inc.
|
||||
// Copyright (C) 1995-2025 by the Free Software Foundation, Inc.
|
||||
//
|
||||
// This program is free software distributed under the
|
||||
// terms of the GNU General Public License, version 2.
|
||||
@@ -24,108 +24,32 @@
|
||||
|
||||
#define MD5_LEN 16
|
||||
|
||||
/* The following contortions are an attempt to use the C preprocessor
|
||||
to determine an unsigned integral type that is 32 bits wide. An
|
||||
alternative approach is to use autoconf's AC_CHECK_SIZEOF macro, but
|
||||
doing that would require that the configure script compile and *run*
|
||||
the resulting executable. Locally running cross-compiled executables
|
||||
is usually not possible. */
|
||||
/* The following contortions are an attempt to use the C preprocessor
|
||||
to determine an unsigned integral type that is 32 bits wide. An
|
||||
alternative approach is to use autoconf's AC_CHECK_SIZEOF macro, but
|
||||
doing that would require that the configure script compile and *run*
|
||||
the resulting executable. Locally running cross-compiled executables
|
||||
is usually not possible. */
|
||||
|
||||
#ifdef _LIBC
|
||||
# include <sys/types.h>
|
||||
typedef u_int32_t md5_uint32;
|
||||
#include <stdint.h>
|
||||
typedef uint32_t md5_uint32;
|
||||
typedef uintptr_t md5_uintptr;
|
||||
|
||||
#if defined (__THROW)
|
||||
#define THROWFUNC __THROW
|
||||
#else
|
||||
# if defined __STDC__ && __STDC__
|
||||
# define UINT_MAX_32_BITS 4294967295U
|
||||
# else
|
||||
# define UINT_MAX_32_BITS 0xFFFFFFFF
|
||||
# endif
|
||||
|
||||
/* If UINT_MAX isn't defined, assume it's a 32-bit type.
|
||||
This should be valid for all systems GNU cares about because
|
||||
that doesn't include 16-bit systems, and only modern systems
|
||||
(that certainly have <limits.h>) have 64+-bit integral types. */
|
||||
|
||||
# ifndef UINT_MAX
|
||||
# define UINT_MAX UINT_MAX_32_BITS
|
||||
# endif
|
||||
|
||||
# if UINT_MAX == UINT_MAX_32_BITS
|
||||
typedef unsigned int md5_uint32;
|
||||
# else
|
||||
# if USHRT_MAX == UINT_MAX_32_BITS
|
||||
typedef unsigned short md5_uint32;
|
||||
# else
|
||||
# if ULONG_MAX == UINT_MAX_32_BITS
|
||||
typedef unsigned long md5_uint32;
|
||||
# else
|
||||
/* The following line is intended to evoke an error.
|
||||
Using #error is not portable enough. */
|
||||
"Cannot determine unsigned 32-bit data type."
|
||||
# endif
|
||||
# endif
|
||||
# endif
|
||||
#define THROWFUNC
|
||||
#endif
|
||||
|
||||
#undef __P
|
||||
#if defined (__STDC__) && __STDC__
|
||||
#define __P(x) x
|
||||
#else
|
||||
#define __P(x) ()
|
||||
#endif
|
||||
/* Compute MD5 message digest for bytes read from STREAM. The
|
||||
resulting message digest number will be written into the 16 bytes
|
||||
beginning at RESBLOCK. */
|
||||
int md5_stream(FILE *stream, void *resblock) THROWFUNC;
|
||||
|
||||
/*
|
||||
* The following three functions are build up the low level used in
|
||||
* the functions `md5_stream' and `md5_buffer'.
|
||||
*/
|
||||
#if 0
|
||||
/* Initialize structure containing state of computation.
|
||||
(RFC 1321, 3.3: Step 3) */
|
||||
extern void md5_init_ctx __P ((struct md5_ctx *ctx));
|
||||
/* Compute MD5 message digest for LEN bytes beginning at BUFFER. The
|
||||
result is always in little endian byte order, so that a byte-wise
|
||||
output yields to the wanted ASCII representation of the message
|
||||
digest. */
|
||||
extern void *md5_buffer(const char *buffer, size_t len, void *resblock) THROWFUNC;
|
||||
|
||||
/* Starting with the result of former calls of this function (or the
|
||||
initialization function update the context for the next LEN bytes
|
||||
starting at BUFFER.
|
||||
It is necessary that LEN is a multiple of 64!!! */
|
||||
extern void md5_process_block __P ((const void *buffer, size_t len,
|
||||
struct md5_ctx *ctx));
|
||||
|
||||
/* Starting with the result of former calls of this function (or the
|
||||
initialization function update the context for the next LEN bytes
|
||||
starting at BUFFER.
|
||||
It is NOT required that LEN is a multiple of 64. */
|
||||
extern void md5_process_bytes __P ((const void *buffer, size_t len,
|
||||
struct md5_ctx *ctx));
|
||||
|
||||
/* Process the remaining bytes in the buffer and put result from CTX
|
||||
in first 16 bytes following RESBUF. The result is always in little
|
||||
endian byte order, so that a byte-wise output yields to the wanted
|
||||
ASCII representation of the message digest.
|
||||
|
||||
IMPORTANT: On some systems it is required that RESBUF is correctly
|
||||
aligned for a 32 bits value. */
|
||||
extern void *md5_finish_ctx __P ((struct md5_ctx *ctx, void *resbuf));
|
||||
|
||||
|
||||
/* Put result from CTX in first 16 bytes following RESBUF. The result is
|
||||
always in little endian byte order, so that a byte-wise output yields
|
||||
to the wanted ASCII representation of the message digest.
|
||||
|
||||
IMPORTANT: On some systems it is required that RESBUF is correctly
|
||||
aligned for a 32 bits value. */
|
||||
extern void *md5_read_ctx __P ((const struct md5_ctx *ctx, void *resbuf));
|
||||
|
||||
#endif
|
||||
|
||||
/* Compute MD5 message digest for bytes read from STREAM. The
|
||||
resulting message digest number will be written into the 16 bytes
|
||||
beginning at RESBLOCK. */
|
||||
int md5_stream __P ((FILE *stream, void *resblock));
|
||||
|
||||
/* Compute MD5 message digest for LEN bytes beginning at BUFFER. The
|
||||
result is always in little endian byte order, so that a byte-wise
|
||||
output yields to the wanted ASCII representation of the message
|
||||
digest. */
|
||||
extern void *md5_buffer __P ((const char *buffer, size_t len, void *resblock));
|
||||
|
||||
#endif
|
||||
#endif /* md5.h */
|
||||
+9
-2
@@ -11,6 +11,7 @@
|
||||
/// \file p_ceilng.c
|
||||
/// \brief Ceiling aninmation (lowering, crushing, raising)
|
||||
|
||||
#include "d_think.h"
|
||||
#include "doomdef.h"
|
||||
#include "p_local.h"
|
||||
#include "r_fps.h"
|
||||
@@ -396,6 +397,7 @@ void T_CrushCeiling(ceiling_t *ceiling)
|
||||
INT32 EV_DoCeiling(line_t *line, ceiling_e type)
|
||||
{
|
||||
INT32 rtn = 0, firstone = 1;
|
||||
|
||||
INT32 secnum = -1;
|
||||
sector_t *sec;
|
||||
ceiling_t *ceiling;
|
||||
@@ -409,7 +411,9 @@ INT32 EV_DoCeiling(line_t *line, ceiling_e type)
|
||||
|
||||
// new door thinker
|
||||
rtn = 1;
|
||||
ceiling = Z_Calloc(sizeof (*ceiling), PU_LEVSPEC, NULL);
|
||||
ceiling = Z_LevelPoolCalloc(sizeof(*ceiling));
|
||||
ceiling->thinker.alloctype = TAT_LEVELPOOL;
|
||||
ceiling->thinker.size = sizeof(*ceiling);
|
||||
P_AddThinker(&ceiling->thinker);
|
||||
sec->ceilingdata = ceiling;
|
||||
ceiling->thinker.function = (actionf_p1)T_MoveCeiling;
|
||||
@@ -619,6 +623,7 @@ INT32 EV_DoCeiling(line_t *line, ceiling_e type)
|
||||
INT32 EV_DoCrush(line_t *line, ceiling_e type)
|
||||
{
|
||||
INT32 rtn = 0;
|
||||
|
||||
INT32 secnum = -1;
|
||||
sector_t *sec;
|
||||
ceiling_t *ceiling;
|
||||
@@ -632,7 +637,9 @@ INT32 EV_DoCrush(line_t *line, ceiling_e type)
|
||||
|
||||
// new door thinker
|
||||
rtn = 1;
|
||||
ceiling = Z_Calloc(sizeof (*ceiling), PU_LEVSPEC, NULL);
|
||||
ceiling = Z_LevelPoolCalloc(sizeof(*ceiling));
|
||||
ceiling->thinker.alloctype = TAT_LEVELPOOL;
|
||||
ceiling->thinker.size = sizeof(*ceiling);
|
||||
P_AddThinker(&ceiling->thinker);
|
||||
sec->ceilingdata = ceiling;
|
||||
ceiling->thinker.function = (actionf_p1)T_CrushCeiling;
|
||||
|
||||
+54
-16
@@ -8035,8 +8035,15 @@ void A_JawzExplode(void *thing)
|
||||
{
|
||||
INT32 speed, speed2;
|
||||
|
||||
truc = P_SpawnMobj(actor->x + P_RandomRange(-8, 8)*FRACUNIT, actor->y + P_RandomRange(-8, 8)*FRACUNIT,
|
||||
actor->z + P_RandomRange(0, 8)*FRACUNIT, MT_BOOMPARTICLE);
|
||||
fixed_t rand_x;
|
||||
fixed_t rand_y;
|
||||
fixed_t rand_z;
|
||||
|
||||
rand_z = actor->z + P_RandomRange(0, 8)*FRACUNIT;
|
||||
rand_y = actor->y + P_RandomRange(-8, 8)*FRACUNIT;
|
||||
rand_x = actor->x + P_RandomRange(-8, 8)*FRACUNIT;
|
||||
|
||||
truc = P_SpawnMobj(rand_x, rand_y, rand_z, MT_BOOMPARTICLE);
|
||||
truc->scale = actor->scale*2;
|
||||
|
||||
speed = FixedMul(7*FRACUNIT, actor->scale)>>FRACBITS;
|
||||
@@ -8205,10 +8212,16 @@ void A_SPBChase(void *thing)
|
||||
: (16*R_PointToDist2(0, 0, actor->tracer->momx, actor->tracer->momy))/15) // Going faster than the target
|
||||
&& xyspeed > K_GetKartSpeed(actor->tracer->player, false)/4) // Don't display speedup lines at pitifully low speeds
|
||||
{
|
||||
mobj_t *fast = P_SpawnMobj(actor->x + (P_RandomRange(-24,24) * actor->scale),
|
||||
actor->y + (P_RandomRange(-24,24) * actor->scale),
|
||||
actor->z + (actor->height/2) + (P_RandomRange(-24,24) * actor->scale),
|
||||
MT_FASTLINE);
|
||||
|
||||
fixed_t rand_x;
|
||||
fixed_t rand_y;
|
||||
fixed_t rand_z;
|
||||
|
||||
rand_z = actor->z + (actor->height/2) + (P_RandomRange(-24,24) * actor->scale);
|
||||
rand_y = actor->y + (P_RandomRange(-24,24) * actor->scale);
|
||||
rand_x = actor->x + (P_RandomRange(-24,24) * actor->scale);
|
||||
|
||||
mobj_t *fast = P_SpawnMobj(rand_x, rand_y, rand_z, MT_FASTLINE);
|
||||
fast->angle = R_PointToAngle2(0, 0, actor->momx, actor->momy);
|
||||
//fast->momx = (3*actor->momx)/4;
|
||||
//fast->momy = (3*actor->momy)/4;
|
||||
@@ -8416,8 +8429,15 @@ void A_FZBoomSmoke(void *thing)
|
||||
|
||||
for (i = 0; i < 8+(4*var1); i++)
|
||||
{
|
||||
mobj_t *smoke = P_SpawnMobj(actor->x + (P_RandomRange(-rad, rad)*actor->scale), actor->y + (P_RandomRange(-rad, rad)*actor->scale),
|
||||
actor->z + (P_RandomRange(0, 72)*actor->scale), MT_THOK);
|
||||
fixed_t rand_x;
|
||||
fixed_t rand_y;
|
||||
fixed_t rand_z;
|
||||
|
||||
rand_z = actor->z + (P_RandomRange(0, 72)*actor->scale);
|
||||
rand_y = actor->y + (P_RandomRange(-rad, rad)*actor->scale);
|
||||
rand_x = actor->x + (P_RandomRange(-rad, rad)*actor->scale);
|
||||
|
||||
mobj_t *smoke = P_SpawnMobj(rand_x, rand_y, rand_z, MT_THOK);
|
||||
|
||||
P_SetMobjState(smoke, S_FZEROSMOKE1);
|
||||
smoke->tics += P_RandomRange(-3, 4);
|
||||
@@ -8593,7 +8613,15 @@ void A_MementosTPParticles(void *thing)
|
||||
|
||||
for (; i < 4; i++)
|
||||
{
|
||||
particle = P_SpawnMobj(actor->x + (P_RandomRange(-256, 256)<<FRACBITS), actor->y + (P_RandomRange(-256, 256)<<FRACBITS), actor->z + (P_RandomRange(48, 256)<<FRACBITS), MT_MEMENTOSPARTICLE);
|
||||
fixed_t rand_x;
|
||||
fixed_t rand_y;
|
||||
fixed_t rand_z;
|
||||
|
||||
rand_z = actor->z + (P_RandomRange(48, 256)<<FRACBITS);
|
||||
rand_y = actor->y + (P_RandomRange(-256, 256)<<FRACBITS);
|
||||
rand_x = actor->x + (P_RandomRange(-256, 256)<<FRACBITS);
|
||||
|
||||
particle = P_SpawnMobj(rand_x, rand_y, rand_z, MT_MEMENTOSPARTICLE);
|
||||
particle->frame = 0;
|
||||
particle->color = ((i%2) ? (SKINCOLOR_RED) : (SKINCOLOR_BLACK));
|
||||
particle->destscale = 1;
|
||||
@@ -8656,9 +8684,15 @@ void A_ReaperThinker(void *thing)
|
||||
if (actor->scale < 2<<FRACBITS) // we haven't finished growing YET.
|
||||
{
|
||||
// Spawn particles as we grow out of the floor, ゴ ゴ ゴ ゴ
|
||||
for (; i<16; i++)
|
||||
for (; i < 16; i++)
|
||||
{
|
||||
particle = P_SpawnMobj(actor->x + (P_RandomRange(-60, 60)<<FRACBITS), actor->y + (P_RandomRange(-60, 60)<<FRACBITS), actor->z, MT_THOK);
|
||||
fixed_t rand_x;
|
||||
fixed_t rand_y;
|
||||
|
||||
rand_y = actor->y + (P_RandomRange(-60, 60)<<FRACBITS);
|
||||
rand_x = actor->x + (P_RandomRange(-60, 60)<<FRACBITS);
|
||||
|
||||
particle = P_SpawnMobj(rand_x, rand_y, actor->z, MT_THOK);
|
||||
particle->momz = 20<<FRACBITS;
|
||||
particle->color = ((i%2 !=0) ? (SKINCOLOR_RED) : (SKINCOLOR_BLACK));
|
||||
particle->frame = 0;
|
||||
@@ -8813,11 +8847,15 @@ void A_FlameParticle(void *thing)
|
||||
if (LUA_CallAction(A_FLAMEPARTICLE, actor))
|
||||
return;
|
||||
|
||||
par = P_SpawnMobj(
|
||||
actor->x + (P_RandomRange(-rad, rad)<<FRACBITS),
|
||||
actor->y + (P_RandomRange(-rad, rad)<<FRACBITS),
|
||||
actor->z + (P_RandomRange(hei/2, hei)<<FRACBITS),
|
||||
actor->info->painchance);
|
||||
fixed_t rand_x;
|
||||
fixed_t rand_y;
|
||||
fixed_t rand_z;
|
||||
|
||||
rand_z = actor->z + (P_RandomRange(hei/2, hei)<<FRACBITS);
|
||||
rand_y = actor->y + (P_RandomRange(-rad, rad)<<FRACBITS);
|
||||
rand_x = actor->x + (P_RandomRange(-rad, rad)<<FRACBITS);
|
||||
|
||||
par = P_SpawnMobj(rand_x, rand_y, rand_z, actor->info->painchance);
|
||||
par->momz = actor->scale<<1;
|
||||
}
|
||||
|
||||
|
||||
+18
-7
@@ -2538,7 +2538,9 @@ INT32 EV_DoFloor(line_t *line, floor_e floortype)
|
||||
|
||||
// new floor thinker
|
||||
rtn = 1;
|
||||
dofloor = Z_Calloc(sizeof (*dofloor), PU_LEVSPEC, NULL);
|
||||
dofloor = Z_LevelPoolCalloc(sizeof(*dofloor));
|
||||
dofloor->thinker.alloctype = TAT_LEVELPOOL;
|
||||
dofloor->thinker.size = sizeof(*dofloor);
|
||||
P_AddThinker(&dofloor->thinker);
|
||||
|
||||
// make sure another floor thinker won't get started over this one
|
||||
@@ -2762,7 +2764,9 @@ INT32 EV_DoElevator(line_t *line, elevator_e elevtype, boolean customspeed)
|
||||
|
||||
// create and initialize new elevator thinker
|
||||
rtn = 1;
|
||||
elevator = Z_Calloc(sizeof (*elevator), PU_LEVSPEC, NULL);
|
||||
elevator = Z_LevelPoolCalloc(sizeof(*elevator));
|
||||
elevator->thinker.alloctype = TAT_LEVELPOOL;
|
||||
elevator->thinker.size = sizeof(*elevator);
|
||||
P_AddThinker(&elevator->thinker);
|
||||
sec->floordata = elevator;
|
||||
sec->ceilingdata = elevator;
|
||||
@@ -2951,7 +2955,9 @@ INT32 EV_BounceSector(sector_t *sec, fixed_t momz, line_t *sourceline)
|
||||
if (sec->ceilingdata) // One at a time, ma'am.
|
||||
return 0;
|
||||
|
||||
bouncer = Z_Calloc(sizeof (*bouncer), PU_LEVSPEC, NULL);
|
||||
bouncer = Z_LevelPoolCalloc(sizeof(*bouncer));
|
||||
bouncer->thinker.alloctype = TAT_LEVELPOOL;
|
||||
bouncer->thinker.size = sizeof(*bouncer);
|
||||
P_AddThinker(&bouncer->thinker);
|
||||
sec->ceilingdata = bouncer;
|
||||
bouncer->thinker.function = (actionf_p1)T_BounceCheese;
|
||||
@@ -2989,7 +2995,9 @@ INT32 EV_DoContinuousFall(sector_t *sec, sector_t *backsector, fixed_t spd, bool
|
||||
backsector = sec;
|
||||
|
||||
// create and initialize new thinker
|
||||
faller = Z_Calloc(sizeof (*faller), PU_LEVSPEC, NULL);
|
||||
faller = Z_LevelPoolCalloc(sizeof(*faller));
|
||||
faller->thinker.alloctype = TAT_LEVELPOOL;
|
||||
faller->thinker.size = sizeof(*faller);
|
||||
P_AddThinker(&faller->thinker);
|
||||
faller->thinker.function = (actionf_p1)T_ContinuousFalling;
|
||||
|
||||
@@ -3042,7 +3050,9 @@ INT32 EV_StartCrumble(sector_t *sec, ffloor_t *rover, boolean floating,
|
||||
return 0;
|
||||
|
||||
// create and initialize new elevator thinker
|
||||
elevator = Z_Calloc(sizeof (*elevator), PU_LEVSPEC, NULL);
|
||||
elevator = Z_LevelPoolCalloc(sizeof(*elevator));
|
||||
elevator->thinker.alloctype = TAT_LEVELPOOL;
|
||||
elevator->thinker.size = sizeof(*elevator);
|
||||
P_AddThinker(&elevator->thinker);
|
||||
elevator->thinker.function = (actionf_p1)T_StartCrumble;
|
||||
|
||||
@@ -3118,8 +3128,9 @@ INT32 EV_MarioBlock(sector_t *sec, sector_t *roversector, fixed_t topheight, mob
|
||||
{
|
||||
const boolean itsamonitor = (thing->flags & MF_MONITOR) == MF_MONITOR;
|
||||
// create and initialize new elevator thinker
|
||||
|
||||
block = Z_Calloc(sizeof (*block), PU_LEVSPEC, NULL);
|
||||
block = Z_LevelPoolCalloc(sizeof(*block));
|
||||
block->thinker.alloctype = TAT_LEVELPOOL;
|
||||
block->thinker.size = sizeof(*block);
|
||||
P_AddThinker(&block->thinker);
|
||||
sec->floordata = block;
|
||||
sec->ceilingdata = block;
|
||||
|
||||
+39
-49
@@ -558,7 +558,9 @@ void P_TouchSpecialThing(mobj_t *special, mobj_t *toucher, boolean heightcheck)
|
||||
{
|
||||
special->momx = toucher->momx;
|
||||
special->momy = toucher->momy;
|
||||
special->momz = flip * max(P_AproxDistance(toucher->momx, toucher->momy) / 4, FixedMul(special->info->speed, special->scale));
|
||||
const fixed_t dist = P_AproxDistance(toucher->momx, toucher->momy) / 4;
|
||||
const fixed_t scale = FixedMul(special->info->speed, special->scale);
|
||||
special->momz = flip * max(dist, scale);
|
||||
if (flip * toucher->momz > 0)
|
||||
special->momz += toucher->momz / 8;
|
||||
if ((statenum_t)(special->state-states) != special->info->seestate)
|
||||
@@ -800,10 +802,6 @@ void P_TouchSpecialThing(mobj_t *special, mobj_t *toucher, boolean heightcheck)
|
||||
if (!P_PlayerTouchingSectorSpecial(player, 4, 2 + flagteam))
|
||||
{
|
||||
CONS_Printf(M_GetText("%s returned the %c%s%c to base.\n"), plname, flagcolor, flagtext, 0x80);
|
||||
|
||||
// The fuse code plays this sound effect
|
||||
//if (players[consoleplayer].ctfteam == player->ctfteam)
|
||||
// S_StartSound(NULL, sfx_hoop1);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -871,14 +869,14 @@ void P_TouchSpecialThing(mobj_t *special, mobj_t *toucher, boolean heightcheck)
|
||||
|
||||
toucher->angle = special->angle;
|
||||
|
||||
if (player == &players[consoleplayer])
|
||||
localangle[0] = toucher->angle;
|
||||
else if (player == &players[displayplayers[1]])
|
||||
localangle[1] = toucher->angle;
|
||||
else if (player == &players[displayplayers[2]])
|
||||
localangle[2] = toucher->angle;
|
||||
else if (player == &players[displayplayers[3]])
|
||||
localangle[3] = toucher->angle;
|
||||
for (UINT8 i = 0; i <= splitscreen; i++)
|
||||
{
|
||||
if (player == P_GetLocalPlayerForNum(i))
|
||||
{
|
||||
localangle[i] = toucher->angle;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
P_ResetPlayer(player);
|
||||
|
||||
@@ -892,16 +890,19 @@ void P_TouchSpecialThing(mobj_t *special, mobj_t *toucher, boolean heightcheck)
|
||||
break;
|
||||
case MT_HOOPCOLLIDE:
|
||||
// This produces a kind of 'domino effect' with the hoop's pieces.
|
||||
for (; !P_MobjWasRemoved(special->hprev); special = special->hprev); // Move to the first sprite in the hoop
|
||||
for (; special->hprev != NULL; special = special->hprev); // Move to the first sprite in the hoop
|
||||
|
||||
i = 0;
|
||||
for (; !P_MobjWasRemoved(special->hnext) && special->type == MT_HOOP; special = special->hnext)
|
||||
for (; special->hnext != NULL && special->type == MT_HOOP; special = special->hnext)
|
||||
{
|
||||
special->fuse = 11;
|
||||
special->movedir = i;
|
||||
special->extravalue1 = special->target->extravalue1;
|
||||
special->extravalue2 = special->target->extravalue2;
|
||||
special->target->threshold = 4242;
|
||||
if (!P_MobjWasRemoved(special->target))
|
||||
{
|
||||
special->fuse = 11;
|
||||
special->movedir = i;
|
||||
special->extravalue1 = special->target->extravalue1;
|
||||
special->extravalue2 = special->target->extravalue2;
|
||||
special->target->threshold = 4242;
|
||||
}
|
||||
i++;
|
||||
}
|
||||
// Make the collision detectors disappear.
|
||||
@@ -1577,9 +1578,6 @@ void P_KillMobj(mobj_t *target, mobj_t *inflictor, mobj_t *source)
|
||||
// Let EVERYONE know what happened to a player! 01-29-2002 Tails
|
||||
if (target->player && !target->player->spectator)
|
||||
{
|
||||
if (metalrecording) // Ack! Metal Sonic shouldn't die! Cut the tape, end recording!
|
||||
G_StopMetalRecording();
|
||||
|
||||
target->flags2 &= ~MF2_DONTDRAW;
|
||||
}
|
||||
|
||||
@@ -1624,25 +1622,20 @@ void P_KillMobj(mobj_t *target, mobj_t *inflictor, mobj_t *source)
|
||||
S_FadeOutStopMusic(cv_respawnfademusicout.value);
|
||||
}
|
||||
|
||||
if (target->player == &players[consoleplayer])
|
||||
for (UINT8 i = 0; i <= splitscreen; i++)
|
||||
{
|
||||
// don't die in auto map,
|
||||
// switch view prior to dying
|
||||
if (automapactive)
|
||||
AM_Stop();
|
||||
if (target->player == P_GetLocalPlayerForNum(i))
|
||||
{
|
||||
// don't die in auto map,
|
||||
// switch view prior to dying
|
||||
if (i == 0 && automapactive)
|
||||
AM_Stop();
|
||||
|
||||
//added : 22-02-98: recenter view for next life...
|
||||
localaiming[0] = 0;
|
||||
// added : 22-02-98: recenter view for next life...
|
||||
localaiming[i] = 0;
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (target->player == &players[displayplayers[1]])
|
||||
{
|
||||
// added : 22-02-98: recenter view for next life...
|
||||
localaiming[1] = 0;
|
||||
}
|
||||
if (target->player == &players[displayplayers[2]])
|
||||
localaiming[2] = 0;
|
||||
if (target->player == &players[displayplayers[3]])
|
||||
localaiming[3] = 0;
|
||||
|
||||
if (G_BattleGametype())
|
||||
K_CheckBumpers();
|
||||
@@ -2261,18 +2254,15 @@ boolean P_DamageMobj(mobj_t *target, mobj_t *inflictor, mobj_t *source, INT32 da
|
||||
}
|
||||
|
||||
// Everything above here can't be forced.
|
||||
if (!metalrecording)
|
||||
{
|
||||
UINT8 shouldForce = LUA_HookShouldDamage(target, inflictor, source, damage);
|
||||
UINT8 shouldForce = LUA_HookShouldDamage(target, inflictor, source, damage);
|
||||
|
||||
if (P_MobjWasRemoved(target))
|
||||
return (shouldForce == 1); // mobj was removed
|
||||
if (P_MobjWasRemoved(target))
|
||||
return (shouldForce == 1); // mobj was removed
|
||||
|
||||
if (shouldForce == 1)
|
||||
force = true;
|
||||
else if (shouldForce == 2)
|
||||
return false;
|
||||
}
|
||||
if (shouldForce == 1)
|
||||
force = true;
|
||||
else if (shouldForce == 2)
|
||||
return false;
|
||||
|
||||
if (!force)
|
||||
{
|
||||
|
||||
+15
-5
@@ -74,7 +74,9 @@ fireflicker_t *P_SpawnAdjustableFireFlicker(sector_t *minsector, sector_t *maxse
|
||||
fireflicker_t *flick;
|
||||
|
||||
P_RemoveLighting(maxsector); // out with the old, in with the new
|
||||
flick = Z_Calloc(sizeof (*flick), PU_LEVSPEC, NULL);
|
||||
flick = Z_LevelPoolCalloc(sizeof(*flick));
|
||||
flick->thinker.alloctype = TAT_LEVELPOOL;
|
||||
flick->thinker.size = sizeof(*flick);
|
||||
|
||||
P_AddThinker(&flick->thinker);
|
||||
|
||||
@@ -153,7 +155,9 @@ void P_SpawnLightningFlash(sector_t *sector)
|
||||
|
||||
sector->lightingdata = NULL;
|
||||
|
||||
flash = Z_Calloc(sizeof (*flash), PU_LEVSPEC, NULL);
|
||||
flash = Z_LevelPoolCalloc(sizeof(*flash));
|
||||
flash->thinker.alloctype = TAT_LEVELPOOL;
|
||||
flash->thinker.size = sizeof(*flash);
|
||||
|
||||
P_AddThinker(&flash->thinker);
|
||||
|
||||
@@ -212,7 +216,9 @@ strobe_t *P_SpawnAdjustableStrobeFlash(sector_t *minsector, sector_t *maxsector,
|
||||
strobe_t *flash;
|
||||
|
||||
P_RemoveLighting(maxsector); // out with the old, in with the new
|
||||
flash = Z_Calloc(sizeof (*flash), PU_LEVSPEC, NULL);
|
||||
flash = Z_LevelPoolCalloc(sizeof(*flash));
|
||||
flash->thinker.alloctype = TAT_LEVELPOOL;
|
||||
flash->thinker.size = sizeof(*flash);
|
||||
|
||||
P_AddThinker(&flash->thinker);
|
||||
|
||||
@@ -287,7 +293,9 @@ glow_t *P_SpawnAdjustableGlowingLight(sector_t *minsector, sector_t *maxsector,
|
||||
glow_t *g;
|
||||
|
||||
P_RemoveLighting(maxsector); // out with the old, in with the new
|
||||
g = Z_Calloc(sizeof (*g), PU_LEVSPEC, NULL);
|
||||
g = Z_LevelPoolCalloc(sizeof(*g));
|
||||
g->thinker.alloctype = TAT_LEVELPOOL;
|
||||
g->thinker.size = sizeof(*g);
|
||||
|
||||
P_AddThinker(&g->thinker);
|
||||
|
||||
@@ -346,7 +354,9 @@ void P_FadeLight(INT16 tag, INT32 destvalue, INT32 speed)
|
||||
sector = §ors[i];
|
||||
|
||||
P_RemoveLighting(sector); // remove the old lighting effect first
|
||||
ll = Z_Calloc(sizeof (*ll), PU_LEVSPEC, NULL);
|
||||
ll = Z_LevelPoolCalloc(sizeof(*ll));
|
||||
ll->thinker.alloctype = TAT_LEVELPOOL;
|
||||
ll->thinker.size = sizeof(*ll);
|
||||
ll->thinker.function = (actionf_p1)T_LightFade;
|
||||
sector->lightingdata = ll; // set it to the lightlevel_t
|
||||
|
||||
|
||||
+24
-8
@@ -14,6 +14,10 @@
|
||||
#ifndef __P_LOCAL__
|
||||
#define __P_LOCAL__
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
#include "command.h"
|
||||
#include "d_player.h"
|
||||
#include "d_think.h"
|
||||
@@ -67,7 +71,6 @@
|
||||
// both the head and tail of the thinker list
|
||||
extern thinker_t thinkercap;
|
||||
extern thinker_t precipcap;
|
||||
extern mobj_t *mobjcache;
|
||||
|
||||
void P_InitThinkers(void);
|
||||
void P_AddThinker(thinker_t *thinker);
|
||||
@@ -128,6 +131,9 @@ typedef struct camera_s
|
||||
// SRB2Kart: camera pans while drifting
|
||||
fixed_t pan;
|
||||
|
||||
// SRB2Kart: camera pitches on slopes
|
||||
angle_t pitch;
|
||||
|
||||
// postproccess effects
|
||||
UINT8 postimg;
|
||||
} camera_t;
|
||||
@@ -144,9 +150,11 @@ enum
|
||||
|
||||
extern camera_t camera[MAXSPLITSCREENPLAYERS];
|
||||
extern consvar_t cv_cam_dist[MAXSPLITSCREENPLAYERS];
|
||||
extern consvar_t cv_cam_still[MAXSPLITSCREENPLAYERS];
|
||||
extern consvar_t cv_cam_height[MAXSPLITSCREENPLAYERS];
|
||||
extern consvar_t cv_cam_pitch[MAXSPLITSCREENPLAYERS];
|
||||
extern consvar_t cv_cam_speed[MAXSPLITSCREENPLAYERS];
|
||||
extern consvar_t cv_cam_lookbackmom[MAXSPLITSCREENPLAYERS];
|
||||
extern consvar_t cv_cam_still[MAXSPLITSCREENPLAYERS];
|
||||
extern consvar_t cv_cam_rotate[MAXSPLITSCREENPLAYERS];
|
||||
extern consvar_t cv_cam_timeover[MAXSPLITSCREENPLAYERS];
|
||||
|
||||
@@ -160,8 +168,6 @@ extern consvar_t cv_actionmovie;
|
||||
|
||||
extern consvar_t cv_screenquake;
|
||||
|
||||
extern consvar_t cv_lookbackmom[MAXSPLITSCREENPLAYERS];
|
||||
|
||||
extern consvar_t cv_verticallook[MAXSPLITSCREENPLAYERS];
|
||||
|
||||
extern fixed_t t_cam_rotate[MAXSPLITSCREENPLAYERS];
|
||||
@@ -169,18 +175,25 @@ extern fixed_t t_cam_rotate[MAXSPLITSCREENPLAYERS];
|
||||
fixed_t P_GetPlayerHeight(player_t *player);
|
||||
fixed_t P_GetPlayerSpinHeight(player_t *player);
|
||||
void P_AddPlayerScore(player_t *player, UINT32 amount);
|
||||
|
||||
void P_SetupCamera(camera_t *cam);
|
||||
void P_ResetCamera(player_t *player, camera_t *thiscam);
|
||||
boolean P_TryCameraMove(fixed_t x, fixed_t y, camera_t *thiscam);
|
||||
#ifndef NOCLIPCAM
|
||||
void P_SlideCameraMove(camera_t *thiscam);
|
||||
//void P_DemoCameraMovement(camera_t *cam, UINT8 num);
|
||||
#endif
|
||||
boolean P_MoveChaseCamera(player_t *player, camera_t *thiscam, boolean resetcalled);
|
||||
void P_ResetLocalCamAiming(player_t *player);
|
||||
void P_ToggleDemoCamera(UINT8 viewnum);
|
||||
void P_CalcChasePostImg(player_t *player, camera_t *thiscam);
|
||||
|
||||
boolean P_PlayerInPain(player_t *player);
|
||||
void P_DoPlayerPain(player_t *player, mobj_t *source, mobj_t *inflictor);
|
||||
void P_ResetPlayer(player_t *player);
|
||||
player_t *P_GetLocalPlayerForNum(UINT8 pnum);
|
||||
INT32 P_GetLocalPlayerNumForNum(UINT8 pnum);
|
||||
boolean P_IsLocalPlayer(const player_t *player);
|
||||
boolean P_IsLocalPlayerNum(UINT8 pnum);
|
||||
boolean P_IsDisplayPlayer(const player_t *player);
|
||||
|
||||
boolean P_SpectatorJoinGame(player_t *player);
|
||||
@@ -252,10 +265,11 @@ void P_PlayVictorySound(mobj_t *source);
|
||||
extern mapthing_t *itemrespawnque[ITEMQUESIZE];
|
||||
extern tic_t itemrespawntime[ITEMQUESIZE];
|
||||
extern size_t iquehead, iquetail;
|
||||
extern consvar_t cv_gravity/*, cv_viewheight*/;
|
||||
extern consvar_t cv_gravity;
|
||||
|
||||
void P_RespawnSpecials(void);
|
||||
|
||||
mobj_t *P_AllocateMobj(void);
|
||||
mobj_t *P_SpawnMobj(fixed_t x, fixed_t y, fixed_t z, mobjtype_t type);
|
||||
|
||||
mobj_t *P_SpawnShadowMobj(mobj_t * caster);
|
||||
@@ -379,7 +393,6 @@ void P_SetThingPosition(mobj_t *thing);
|
||||
void P_SetUnderlayPosition(mobj_t *thing);
|
||||
|
||||
boolean P_CheckPosition(mobj_t *thing, fixed_t x, fixed_t y);
|
||||
boolean P_CheckCameraPosition(fixed_t x, fixed_t y, camera_t *thiscam);
|
||||
boolean P_TryMove(mobj_t *thing, fixed_t x, fixed_t y, boolean allowdropoff);
|
||||
boolean P_Move(mobj_t *actor, fixed_t speed);
|
||||
boolean P_SetOrigin(mobj_t *thing, fixed_t x, fixed_t y, fixed_t z);
|
||||
@@ -399,7 +412,6 @@ boolean P_CheckSector(sector_t *sector, boolean crunch);
|
||||
void P_DelSeclist(msecnode_t *node);
|
||||
|
||||
void P_CreateSecNodeList(mobj_t *thing, fixed_t x, fixed_t y);
|
||||
void P_Initsecnode(void);
|
||||
|
||||
void P_RadiusAttack(mobj_t *spot, mobj_t *source, fixed_t damagedist);
|
||||
|
||||
@@ -479,4 +491,8 @@ void P_Thrust(mobj_t *mo, angle_t angle, fixed_t move);
|
||||
void P_ExplodeMissile(mobj_t *mo);
|
||||
void P_CheckGravity(mobj_t *mo, boolean affect);
|
||||
|
||||
#ifdef __cplusplus
|
||||
} // extern "C"
|
||||
#endif
|
||||
|
||||
#endif // __P_LOCAL__
|
||||
+24
-33
@@ -225,8 +225,7 @@ boolean P_DoSpring(mobj_t *spring, mobj_t *object)
|
||||
{
|
||||
for (UINT8 j = 0; j <= splitscreen; ++j)
|
||||
{
|
||||
INT32 id = (j == 0 ? consoleplayer : displayplayers[j]);
|
||||
if (object->player == &players[id])
|
||||
if (object->player == P_GetLocalPlayerForNum(j))
|
||||
{
|
||||
localangle[j] = spring->angle;
|
||||
break;
|
||||
@@ -1982,7 +1981,7 @@ void P_CheckHoopPosition(mobj_t *hoopthing, fixed_t x, fixed_t y, fixed_t z, fix
|
||||
//
|
||||
// P_CheckCameraPosition
|
||||
//
|
||||
boolean P_CheckCameraPosition(fixed_t x, fixed_t y, camera_t *thiscam)
|
||||
static boolean P_CheckCameraPosition(fixed_t x, fixed_t y, camera_t *thiscam)
|
||||
{
|
||||
INT32 xl, xh, yl, yh, bx, by;
|
||||
sector_t *newsec;
|
||||
@@ -2396,13 +2395,15 @@ boolean P_TryMove(mobj_t *thing, fixed_t x, fixed_t y, boolean allowdropoff)
|
||||
|
||||
if (thing->player)
|
||||
{
|
||||
const INT32 special = GETSECSPECIAL(R_PointInSubsector(x, y)->sector->special, 1);
|
||||
|
||||
// If using type Section1:13, double the maxstep.
|
||||
if (P_PlayerTouchingSectorSpecial(thing->player, 1, 13)
|
||||
|| GETSECSPECIAL(R_PointInSubsector(x, y)->sector->special, 1) == 13)
|
||||
|| special == 13)
|
||||
maxstep <<= 1;
|
||||
// If using type Section1:12, no maxstep. For ledges you don't want the player to climb! (see: Egg Zeppelin & SMK port walls)
|
||||
else if (P_PlayerTouchingSectorSpecial(thing->player, 1, 12)
|
||||
|| GETSECSPECIAL(R_PointInSubsector(x, y)->sector->special, 1) == 12)
|
||||
|| special == 12)
|
||||
maxstep = 0;
|
||||
}
|
||||
|
||||
@@ -2614,11 +2615,12 @@ static boolean P_ThingHeightClip(mobj_t *thing)
|
||||
{
|
||||
boolean floormoved;
|
||||
fixed_t oldfloorz = thing->floorz;
|
||||
boolean onfloor = P_IsObjectOnGround(thing);//(thing->z <= thing->floorz);
|
||||
|
||||
if (thing->flags & MF_NOCLIPHEIGHT)
|
||||
return true;
|
||||
|
||||
const boolean onfloor = P_IsObjectOnGround(thing);//(thing->z <= thing->floorz);
|
||||
|
||||
P_CheckPosition(thing, thing->x, thing->y);
|
||||
|
||||
if (P_MobjWasRemoved(thing))
|
||||
@@ -2686,6 +2688,7 @@ static fixed_t tmxmove, tmymove;
|
||||
//
|
||||
// P_HitCameraSlideLine
|
||||
//
|
||||
#ifndef NOCLIPCAM
|
||||
static void P_HitCameraSlideLine(line_t *ld, camera_t *thiscam)
|
||||
{
|
||||
INT32 side;
|
||||
@@ -2705,7 +2708,7 @@ static void P_HitCameraSlideLine(line_t *ld, camera_t *thiscam)
|
||||
}
|
||||
|
||||
side = P_PointOnLineSide(thiscam->x, thiscam->y, ld);
|
||||
lineangle = R_PointToAngle2(0, 0, ld->dx, ld->dy);
|
||||
lineangle = ld->angle;
|
||||
|
||||
if (side == 1)
|
||||
lineangle += ANGLE_180;
|
||||
@@ -2725,6 +2728,7 @@ static void P_HitCameraSlideLine(line_t *ld, camera_t *thiscam)
|
||||
tmxmove = FixedMul(newlen, FINECOSINE(lineangle));
|
||||
tmymove = FixedMul(newlen, FINESINE(lineangle));
|
||||
}
|
||||
#endif
|
||||
|
||||
//
|
||||
// P_HitSlideLine
|
||||
@@ -2751,7 +2755,7 @@ static void P_HitSlideLine(line_t *ld)
|
||||
|
||||
side = P_PointOnLineSide(slidemo->x, slidemo->y, ld);
|
||||
|
||||
lineangle = R_PointToAngle2(0, 0, ld->dx, ld->dy);
|
||||
lineangle = ld->angle;
|
||||
|
||||
if (side == 1)
|
||||
lineangle += ANGLE_180;
|
||||
@@ -2784,7 +2788,7 @@ static void P_PlayerHitBounceLine(line_t *ld)
|
||||
fixed_t movelen;
|
||||
|
||||
side = P_PointOnLineSide(slidemo->x, slidemo->y, ld);
|
||||
lineangle = R_PointToAngle2(0, 0, ld->dx, ld->dy)-ANGLE_90;
|
||||
lineangle = ld->angle-ANGLE_90;
|
||||
|
||||
if (side == 1)
|
||||
lineangle += ANGLE_180;
|
||||
@@ -2822,7 +2826,7 @@ static void P_HitBounceLine(line_t *ld)
|
||||
return;
|
||||
}
|
||||
|
||||
lineangle = R_PointToAngle2(0, 0, ld->dx, ld->dy);
|
||||
lineangle = ld->angle;
|
||||
|
||||
if (lineangle >= ANGLE_180)
|
||||
lineangle -= ANGLE_180;
|
||||
@@ -2844,6 +2848,7 @@ static void P_HitBounceLine(line_t *ld)
|
||||
//
|
||||
// PTR_SlideCameraTraverse
|
||||
//
|
||||
#ifndef NOCLIPCAM
|
||||
static boolean PTR_SlideCameraTraverse(intercept_t *in)
|
||||
{
|
||||
line_t *li;
|
||||
@@ -2890,6 +2895,7 @@ isblocking:
|
||||
|
||||
return false; // stop
|
||||
}
|
||||
#endif
|
||||
|
||||
//
|
||||
// PTR_SlideTraverse
|
||||
@@ -2960,6 +2966,7 @@ isblocking:
|
||||
//
|
||||
// Tries to slide the camera along a wall.
|
||||
//
|
||||
#ifndef NOCLIPCAM
|
||||
void P_SlideCameraMove(camera_t *thiscam)
|
||||
{
|
||||
fixed_t leadx, leady, trailx, traily, newx, newy;
|
||||
@@ -3053,6 +3060,7 @@ stairstep:
|
||||
if (!retval)
|
||||
goto retry;
|
||||
}
|
||||
#endif
|
||||
|
||||
//
|
||||
// P_SlideMove
|
||||
@@ -3815,36 +3823,19 @@ boolean P_CheckSector(sector_t *sector, boolean crunch)
|
||||
Lots of new Boom functions that work faster and add functionality.
|
||||
*/
|
||||
|
||||
static msecnode_t *headsecnode = NULL;
|
||||
|
||||
void P_Initsecnode(void)
|
||||
{
|
||||
headsecnode = NULL;
|
||||
}
|
||||
|
||||
// P_GetSecnode() retrieves a node from the freelist. The calling routine
|
||||
// should make sure it sets all fields properly.
|
||||
|
||||
static msecnode_t *P_GetSecnode(void)
|
||||
{
|
||||
msecnode_t *node;
|
||||
|
||||
if (headsecnode)
|
||||
{
|
||||
node = headsecnode;
|
||||
headsecnode = headsecnode->m_thinglist_next;
|
||||
}
|
||||
else
|
||||
node = Z_Calloc(sizeof (*node), PU_LEVEL, NULL);
|
||||
return node;
|
||||
return Z_LevelPoolCalloc(sizeof(msecnode_t));
|
||||
}
|
||||
|
||||
// P_PutSecnode() returns a node to the freelist.
|
||||
|
||||
static inline void P_PutSecnode(msecnode_t *node)
|
||||
{
|
||||
node->m_thinglist_next = headsecnode;
|
||||
headsecnode = node;
|
||||
Z_LevelPoolFree(node, sizeof(msecnode_t));
|
||||
}
|
||||
|
||||
// P_AddSecnode() searches the current list to see if this sector is
|
||||
@@ -3949,9 +3940,9 @@ void P_DelSeclist(msecnode_t *node)
|
||||
|
||||
static inline boolean PIT_GetSectors(line_t *ld)
|
||||
{
|
||||
if (tmbbox[BOXRIGHT] <= ld->bbox[BOXLEFT] ||
|
||||
tmbbox[BOXLEFT] >= ld->bbox[BOXRIGHT] ||
|
||||
tmbbox[BOXTOP] <= ld->bbox[BOXBOTTOM] ||
|
||||
if (tmbbox[BOXRIGHT] <= ld->bbox[BOXLEFT] ||
|
||||
tmbbox[BOXLEFT] >= ld->bbox[BOXRIGHT] ||
|
||||
tmbbox[BOXTOP] <= ld->bbox[BOXBOTTOM] ||
|
||||
tmbbox[BOXBOTTOM] >= ld->bbox[BOXTOP])
|
||||
return true;
|
||||
|
||||
@@ -4071,7 +4062,7 @@ void P_CreateSecNodeList(mobj_t *thing, fixed_t x, fixed_t y)
|
||||
* Must clear tmthing at tic end, as it might contain a pointer to a removed thinker, or the level might have ended/been ended and we clear the objects it was pointing too. Hopefully we don't need to carry this between tics for sync. */
|
||||
void P_MapStart(void)
|
||||
{
|
||||
if (tmthing)
|
||||
if (UNLIKELY(tmthing))
|
||||
I_Error("P_MapStart: tmthing set!");
|
||||
}
|
||||
|
||||
|
||||
@@ -130,35 +130,12 @@ void P_ClosestPointOnLine3D(fixed_t x, fixed_t y, fixed_t z, line_t *line, verte
|
||||
return;
|
||||
}
|
||||
|
||||
//
|
||||
// P_PointOnLineSide
|
||||
// Returns 0 or 1
|
||||
//
|
||||
INT32 P_PointOnLineSide(fixed_t x, fixed_t y, const line_t *line)
|
||||
{
|
||||
fixed_t dx, dy, left, right;
|
||||
|
||||
if (!line->dx)
|
||||
return x <= line->v1->x ? line->dy > 0 : line->dy < 0;
|
||||
|
||||
if (!line->dy)
|
||||
return y <= line->v1->y ? line->dx < 0 : line->dx > 0;
|
||||
|
||||
dx = (x - line->v1->x);
|
||||
dy = (y - line->v1->y);
|
||||
|
||||
left = FixedMul(line->dy>>FRACBITS, dx);
|
||||
right = FixedMul(dy, line->dx>>FRACBITS);
|
||||
|
||||
return right < left ? 0 : 1;
|
||||
}
|
||||
|
||||
//
|
||||
// P_BoxOnLineSide
|
||||
// Considers the line to be infinite
|
||||
// Returns side 0 or 1, -1 if box crosses the line.
|
||||
//
|
||||
INT32 P_BoxOnLineSide(fixed_t *tmbox, const line_t *ld)
|
||||
PUREFUNC INT32 P_BoxOnLineSide(fixed_t *tmbox, const line_t *ld)
|
||||
{
|
||||
INT32 p1, p2;
|
||||
|
||||
@@ -208,30 +185,15 @@ INT32 P_BoxOnLineSide(fixed_t *tmbox, const line_t *ld)
|
||||
// P_PointOnDivlineSide
|
||||
// Returns 0 or 1.
|
||||
//
|
||||
static INT32 P_PointOnDivlineSide(fixed_t x, fixed_t y, divline_t *line)
|
||||
FUNCINLINE static ATTRINLINE PUREFUNC INT32 P_PointOnDivlineSide(fixed_t x, fixed_t y, divline_t *line)
|
||||
{
|
||||
fixed_t dx, dy, left, right;
|
||||
|
||||
if (!line->dx)
|
||||
return x <= line->x ? line->dy > 0 : line->dy < 0;
|
||||
|
||||
if (!line->dy)
|
||||
return y <= line->y ? line->dx < 0 : line->dx > 0;
|
||||
|
||||
dx = (x - line->x);
|
||||
dy = (y - line->y);
|
||||
|
||||
// try to quickly decide by looking at sign bits
|
||||
if ((line->dy ^ line->dx ^ dx ^ dy) & 0x80000000)
|
||||
return ((line->dy ^ dx) & 0x80000000) ? 1 : 0;
|
||||
|
||||
left = FixedMul(line->dy>>8, dx>>8);
|
||||
right = FixedMul(dy>>8, line->dx>>8);
|
||||
|
||||
return right < left ? 0 : 1;
|
||||
return
|
||||
!line->dx ? x <= line->x ? line->dy > 0 : line->dy < 0 :
|
||||
!line->dy ? y <= line->y ? line->dx < 0 : line->dx > 0 :
|
||||
(line->dy^line->dx^(x -= line->x)^(y -= line->y)) < 0 ? (line->dy^x) < 0 :
|
||||
FixedMul(y>>8, line->dx>>8) >= FixedMul(line->dy>>8, x>>8);
|
||||
}
|
||||
|
||||
|
||||
//
|
||||
// P_MakeDivline
|
||||
//
|
||||
@@ -248,7 +210,7 @@ void P_MakeDivline(line_t *li, divline_t *dl)
|
||||
// Returns the fractional intercept point along the first divline.
|
||||
// This is only called by the addthings and addlines traversers.
|
||||
//
|
||||
fixed_t P_InterceptVector(divline_t *v2, divline_t *v1)
|
||||
PUREFUNC fixed_t P_InterceptVector(divline_t *v2, divline_t *v1)
|
||||
{
|
||||
fixed_t frac, num, den;
|
||||
|
||||
@@ -768,7 +730,8 @@ void P_UnsetPrecipThingPosition(precipmobj_t *thing)
|
||||
bnext->bprev = bprev;
|
||||
}
|
||||
|
||||
static void P_LinkToBlockMap(mobj_t *thing, mobj_t **bmap)
|
||||
template<typename T>
|
||||
static void P_LinkToBlockMap(T *thing, T **bmap)
|
||||
{
|
||||
const INT32 blockx = (unsigned)(thing->x - bmaporgx) >> MAPBLOCKSHIFT;
|
||||
const INT32 blocky = (unsigned)(thing->y - bmaporgy) >> MAPBLOCKSHIFT;
|
||||
@@ -780,8 +743,8 @@ static void P_LinkToBlockMap(mobj_t *thing, mobj_t **bmap)
|
||||
// pointer-to-pointer prev pointers --
|
||||
// allows head nodes to be treated like everything else
|
||||
|
||||
mobj_t **link = &bmap[(blocky * bmapwidth) + blockx];
|
||||
mobj_t *bnext = *link;
|
||||
T **link = &bmap[(blocky * bmapwidth) + blockx];
|
||||
T *bnext = *link;
|
||||
|
||||
thing->bnext = bnext;
|
||||
|
||||
@@ -909,10 +872,7 @@ void P_SetUnderlayPosition(mobj_t *thing)
|
||||
void P_SetPrecipitationThingPosition(precipmobj_t *thing)
|
||||
{
|
||||
thing->subsector = R_PointInSubsectorFast(thing->x, thing->y);
|
||||
|
||||
// NOTE: this works because bnext/bprev are at the same
|
||||
// offsets in precipmobj_t and mobj_t
|
||||
P_LinkToBlockMap((mobj_t*)thing, (mobj_t**)precipblocklinks);
|
||||
P_LinkToBlockMap(thing, precipblocklinks);
|
||||
}
|
||||
|
||||
//
|
||||
@@ -1041,7 +1001,7 @@ static void P_CheckIntercepts(void)
|
||||
else
|
||||
max_intercepts *= 2;
|
||||
|
||||
intercepts = Z_Realloc(intercepts, sizeof (*intercepts) * max_intercepts, PU_STATIC, NULL);
|
||||
intercepts = static_cast<intercept_t*>(Z_Realloc(intercepts, sizeof (*intercepts) * max_intercepts, PU_STATIC, NULL));
|
||||
|
||||
intercept_p = intercepts + count;
|
||||
}
|
||||
+24
-3
@@ -13,6 +13,10 @@
|
||||
#ifndef __P_MAPUTL__
|
||||
#define __P_MAPUTL__
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
#include "doomtype.h"
|
||||
#include "r_defs.h"
|
||||
#include "m_fixed.h"
|
||||
@@ -41,14 +45,26 @@ typedef boolean (*traverser_t)(intercept_t *in);
|
||||
boolean P_PathTraverse(fixed_t px1, fixed_t py1, fixed_t px2, fixed_t py2,
|
||||
INT32 pflags, traverser_t ptrav);
|
||||
|
||||
//
|
||||
// P_PointOnLineSide
|
||||
// Returns 0 or 1
|
||||
//
|
||||
FUNCINLINE static ATTRINLINE PUREFUNC INT32 P_PointOnLineSide(fixed_t x, fixed_t y, const line_t *line)
|
||||
{
|
||||
return
|
||||
!line->dx ? x <= line->v1->x ? line->dy > 0 : line->dy < 0 :
|
||||
!line->dy ? y <= line->v1->y ? line->dx < 0 : line->dx > 0 :
|
||||
FixedMul(y-line->v1->y, line->dx>>FRACBITS) >=
|
||||
FixedMul(line->dy>>FRACBITS, x-line->v1->x);
|
||||
}
|
||||
|
||||
#define P_AproxDistance(dx, dy) FixedHypot(dx, dy)
|
||||
void P_ClosestPointOnLine(fixed_t x, fixed_t y, line_t *line, vertex_t *result);
|
||||
void P_ClosestPointOnLine3D(fixed_t x, fixed_t y, fixed_t z, line_t *line, vertex_t *result);
|
||||
INT32 P_PointOnLineSide(fixed_t x, fixed_t y, const line_t *line);
|
||||
void P_MakeDivline(line_t *li, divline_t *dl);
|
||||
void P_CameraLineOpening(line_t *plinedef);
|
||||
fixed_t P_InterceptVector(divline_t *v2, divline_t *v1);
|
||||
INT32 P_BoxOnLineSide(fixed_t *tmbox, const line_t *ld);
|
||||
PUREFUNC fixed_t P_InterceptVector(divline_t *v2, divline_t *v1);
|
||||
PUREFUNC INT32 P_BoxOnLineSide(fixed_t *tmbox, const line_t *ld);
|
||||
void P_UnsetPrecipThingPosition(precipmobj_t *thing);
|
||||
void P_SetPrecipitationThingPosition(precipmobj_t *thing);
|
||||
void P_CreatePrecipSecNodeList(precipmobj_t *thing, fixed_t x,fixed_t y);
|
||||
@@ -74,4 +90,9 @@ extern fixed_t tmbbox[4]; // p_map.c
|
||||
// bbox defined by the radius
|
||||
//boolean P_RadiusLinesCheck(fixed_t radius, fixed_t x, fixed_t y,
|
||||
// boolean (*func)(line_t *));
|
||||
|
||||
#ifdef __cplusplus
|
||||
} // extern "C"
|
||||
#endif
|
||||
|
||||
#endif // __P_MAPUTL__
|
||||
Loaded 100 of 155 files, more files were not shown because too many files have changed in this diff.
Show more
Reference in new issue
Block a user