Compare commits
1096
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
e13ba89f1a | ||
|
|
d8b2134aef | ||
|
|
c168832f8e | ||
|
|
448a603a56 | ||
|
|
2a95201c6d | ||
|
|
a73de55f96 | ||
|
|
e4a4496be6 | ||
|
|
a8f3a8dfb0 | ||
|
|
e19b9d1c60 | ||
|
|
e28ec4e7cb | ||
|
|
d0f09b467b | ||
|
|
6617382f54 | ||
|
|
7d68c0598c | ||
|
|
201c725dc7 | ||
|
|
57b2316c42 | ||
|
|
fe682a8071 | ||
|
|
bf44a054a1 | ||
|
|
eca9c60d9b | ||
|
|
cf42c35b9f | ||
|
|
a364068abb | ||
|
|
e88093d9cf | ||
|
|
5e532a76cf | ||
|
|
fb9c459269 | ||
|
|
a6898bd1cd | ||
|
|
ff474d18ee | ||
|
|
f15d3be263 | ||
|
|
19e5366c5b | ||
|
|
346dee019c | ||
|
|
18914f22f2 | ||
|
|
1219ecf818 | ||
|
|
b6923d0d0d | ||
|
|
e8969b0645 | ||
|
|
7932c1af6f | ||
|
|
95b4228d3c | ||
|
|
a0ff44043f | ||
|
|
1e15816057 | ||
|
|
a4566e9496 | ||
|
|
18f88c28dd | ||
|
|
b8dc1b13df | ||
|
|
33c03f1e7a | ||
|
|
7e5ae71714 | ||
|
|
b574ed0b1b | ||
|
|
01c621832b | ||
|
|
608cc66d78 | ||
|
|
35103ad810 | ||
|
|
5ac0262654 | ||
|
|
c361285790 | ||
|
|
a168b5e2b9 | ||
|
|
f70c38a853 | ||
|
|
4c05c063a9 | ||
|
|
ed05a909cb | ||
|
|
e1e45ad3ad | ||
|
|
ca9b001c9f | ||
|
|
3976d80867 | ||
|
|
1ee10457f8 | ||
|
|
116bcd0cb1 | ||
|
|
fcdccb96aa | ||
|
|
723286826b | ||
|
|
b190f09aea | ||
|
|
ff6358b031 | ||
|
|
5899a0c453 | ||
|
|
db4d9a330a | ||
|
|
03264e760f | ||
|
|
224e3b25e5 | ||
|
|
03c624a77b | ||
|
|
1ed76de58a | ||
|
|
5f40ff5a03 | ||
|
|
b1baa90b19 | ||
|
|
f0579de244 | ||
|
|
044836b026 | ||
|
|
c2a761c895 | ||
|
|
5b6e7abd91 | ||
|
|
c47c6aa6e4 | ||
|
|
5a6a954d4f | ||
|
|
92bf8c0788 | ||
|
|
058139f52b | ||
|
|
612d01a8ce | ||
|
|
bc130ce1f9 | ||
|
|
8abab58a5c | ||
|
|
740de2babe | ||
|
|
9d54baf544 | ||
|
|
c68c61975e | ||
|
|
6f7947dd5f | ||
|
|
cb8930fef6 | ||
|
|
93d87e1132 | ||
|
|
d5583ba040 | ||
|
|
7bb3e4445e | ||
|
|
001a38bbd2 | ||
|
|
463778cd88 | ||
|
|
f263585a72 | ||
|
|
ec0ca0d1ab | ||
|
|
121540f428 | ||
|
|
8b5fd5f646 | ||
|
|
23a9afb727 | ||
|
|
38b862ff16 | ||
|
|
7e31536ff9 | ||
|
|
679e582028 | ||
|
|
bfc34337a3 | ||
|
|
c2cf6f17d1 | ||
|
|
5b44c03892 | ||
|
|
69e3722e81 | ||
|
|
2fbc1140c4 | ||
|
|
9747eab9f3 | ||
|
|
f98e7b13f4 | ||
|
|
5cc6743328 | ||
|
|
c0d8f4fbfe | ||
|
|
d7c1e464d4 | ||
|
|
7e5baeebaf | ||
|
|
0c7d50b38a | ||
|
|
fa951475ba | ||
|
|
a608676bbd | ||
|
|
8dd52f278b | ||
|
|
7634859503 | ||
|
|
cf1abbd176 | ||
|
|
b71c1152c6 | ||
|
|
46f3529165 | ||
|
|
ce99a3f5a6 | ||
|
|
880db98961 | ||
|
|
d2d0e0c979 | ||
|
|
7abee5ae11 | ||
|
|
e025404bbf | ||
|
|
f8b9c8290e | ||
|
|
d1d9236539 | ||
|
|
63abd00c6a | ||
|
|
5f01d1ff84 | ||
|
|
62fa1777dd | ||
|
|
59deb7c8c1 | ||
|
|
d1c7e08496 | ||
|
|
066b12f075 | ||
|
|
d1bb0b97d2 | ||
|
|
c0aa3e48cd | ||
|
|
a1a4b7cfbf | ||
|
|
231ff3b502 | ||
|
|
3fb4c6484d | ||
|
|
7a6e1bcf6c | ||
|
|
cd60ee1188 | ||
|
|
4481911cd4 | ||
|
|
53b3a994fc | ||
|
|
ebcdb23d34 | ||
|
|
431c0f41d1 | ||
|
|
838379d970 | ||
|
|
68c913a5e1 | ||
|
|
5f82a3b799 | ||
|
|
2369a0c5a1 | ||
|
|
e995ad0499 | ||
|
|
7ba21abacd | ||
|
|
4c1cfc91da | ||
|
|
79d440d398 | ||
|
|
ace8256d73 | ||
|
|
984d501ee1 | ||
|
|
e138d540c8 | ||
|
|
4f81349ea3 | ||
|
|
b960e3d848 | ||
|
|
9c8aee1bef | ||
|
|
cf453bad5f | ||
|
|
8ad161f061 | ||
|
|
a18e81ee18 | ||
|
|
4f83d3b36b | ||
|
|
97093dbeb9 | ||
|
|
2468277068 | ||
|
|
cd15c5d380 | ||
|
|
b977cf72b7 | ||
|
|
45506b381e | ||
|
|
b6fd7a1e96 | ||
|
|
58a9e17500 | ||
|
|
c14c28ac1e | ||
|
|
5df33e0705 | ||
|
|
987d18fe99 | ||
|
|
7bb4b74c65 | ||
|
|
cf92df5faa | ||
|
|
f81488500c | ||
|
|
a099f825a7 | ||
|
|
d75ce094ae | ||
|
|
1bb52b9c2d | ||
|
|
1d15f89433 | ||
|
|
117db36ed3 | ||
|
|
9d1b8ba736 | ||
|
|
d2844e7087 | ||
|
|
def4028028 | ||
|
|
61a4cb554a | ||
|
|
f75eb0d766 | ||
|
|
ede95c8ec4 | ||
|
|
55704f2ba2 | ||
|
|
87fd33793d | ||
|
|
6509e7fdf9 | ||
|
|
cd7177682a | ||
|
|
0ceeac4726 | ||
|
|
0b515939ad | ||
|
|
abba2a9eac | ||
|
|
72ea257a06 | ||
|
|
e87ca3fe1b | ||
|
|
ca756fd647 | ||
|
|
ef93209d40 | ||
|
|
af104c2d12 | ||
|
|
0e3ab1354b | ||
|
|
5dc1576496 | ||
|
|
c4aba91e79 | ||
|
|
5aca7e12c7 | ||
|
|
60e0e50141 | ||
|
|
db9435f810 | ||
|
|
8edec89a36 | ||
|
|
b43ca1f3c7 | ||
|
|
89906cf384 | ||
|
|
2a3e4c4c6d | ||
|
|
e2b1a87ca5 | ||
|
|
e5e63a56a1 | ||
|
|
1ffb655131 | ||
|
|
4ce111139f | ||
|
|
7c4b93fba8 | ||
|
|
fc7405e542 | ||
|
|
a57afd046e | ||
|
|
bc6ce84a26 | ||
|
|
9638ae56c5 | ||
|
|
f398c0ceea | ||
|
|
af544e4e16 | ||
|
|
7ca201ea1b | ||
|
|
b622fbb653 | ||
|
|
00e59c480e | ||
|
|
cd2f8577a0 | ||
|
|
fe632340b4 | ||
|
|
e872f25ce6 | ||
|
|
f838ff528e | ||
|
|
5ba6021010 | ||
|
|
2e5e753d2e | ||
|
|
e195126ac0 | ||
|
|
7bcf8df6fc | ||
|
|
ce77a29892 | ||
|
|
56392d4e78 | ||
|
|
6cc37b9160 | ||
|
|
2f736fb28c | ||
|
|
127e8b52d1 | ||
|
|
9e8fb1293f | ||
|
|
fa3d2abe13 | ||
|
|
c9faccae64 | ||
|
|
126d26cc98 | ||
|
|
dc49502884 | ||
|
|
f03a12241d | ||
|
|
3fe77da35f | ||
|
|
c79f986a8f | ||
|
|
2b299039e6 | ||
|
|
167e8e9258 | ||
|
|
8943b6a3b7 | ||
|
|
08f208e4a0 | ||
|
|
963eb427cf | ||
|
|
c4fd47657e | ||
|
|
6d15fc1ce4 | ||
|
|
db43b90b70 | ||
|
|
da5aaa7ebf | ||
|
|
2c290b7473 | ||
|
|
541c70498d | ||
|
|
f2d1cb5606 | ||
|
|
8702ddca60 | ||
|
|
f7acf7c2d3 | ||
|
|
bcf82970a4 | ||
|
|
285c850628 | ||
|
|
3b4ffa20bc | ||
|
|
006931eaa8 | ||
|
|
5401cb58bd | ||
|
|
efde25469e | ||
|
|
b207a87f8b | ||
|
|
1da62eb63d | ||
|
|
3e6f028061 | ||
|
|
7bd835f43e | ||
|
|
8ec6b2e737 | ||
|
|
f4fc185f5b | ||
|
|
b28593dba7 | ||
|
|
88dc5f25ad | ||
|
|
a0062060eb | ||
|
|
8e6633d0bc | ||
|
|
2c8d5f2625 | ||
|
|
46e10f67b2 | ||
|
|
962b68c5c3 | ||
|
|
fccfcd12fd | ||
|
|
50caffd70f | ||
|
|
14a1c391a6 | ||
|
|
8ab097f166 | ||
|
|
41cb3e932a | ||
|
|
70f1a6bf48 | ||
|
|
804d9e2e8e | ||
|
|
123fe48cad | ||
|
|
2e7ae45fdb | ||
|
|
6b44ac922e | ||
|
|
1c95b2e464 | ||
|
|
b0ba261e14 | ||
|
|
39f8fa8d34 | ||
|
|
fe1579e960 | ||
|
|
7256fb9d62 | ||
|
|
53f68784fc | ||
|
|
9e53f3f8b0 | ||
|
|
a6bebb2d91 | ||
|
|
8a80f0571c | ||
|
|
13589499f8 | ||
|
|
50656b7afc | ||
|
|
b2e0ad58f9 | ||
|
|
b2f22a379f | ||
|
|
c8b318ba8e | ||
|
|
8db082501e | ||
|
|
5c6c46848e | ||
|
|
69d86e69cb | ||
|
|
0d9ac01fea | ||
|
|
fd14976a4d | ||
|
|
fa06551bd8 | ||
|
|
2342d92ae3 | ||
|
|
561b1c0b92 | ||
|
|
7eb311d99c | ||
|
|
e5f9623113 | ||
|
|
e29c1010d3 | ||
|
|
494c6ca80d | ||
|
|
b4416c32ed | ||
|
|
fa757c6695 | ||
|
|
fb15cfe9f0 | ||
|
|
94eebd2cd0 | ||
|
|
7e6bde73e1 | ||
|
|
da5a2ceefa | ||
|
|
e74340aabf | ||
|
|
48113cb156 | ||
|
|
6ae0b87686 | ||
|
|
98f35b6e06 | ||
|
|
2959a84b74 | ||
|
|
705bb4a8ea | ||
|
|
804ca985f3 | ||
|
|
892a59ff15 | ||
|
|
3e60b1b388 | ||
|
|
9c25d99156 | ||
|
|
e8c6dca8c1 | ||
|
|
02c1a9a58d | ||
|
|
2201d58f7d | ||
|
|
b7542a2106 | ||
|
|
f1bcdaf68f | ||
|
|
1ebebb5690 | ||
|
|
1ddc663e8c | ||
|
|
5b3edc2131 | ||
|
|
bc22830136 | ||
|
|
90475c1128 | ||
|
|
ff6a13f042 | ||
|
|
92f08de1f6 | ||
|
|
29462b082b | ||
|
|
bd9f436227 | ||
|
|
2b6f507785 | ||
|
|
a0739e59e4 | ||
|
|
8251ac9ca8 | ||
|
|
f99794884b | ||
|
|
dd93e1f7b0 | ||
|
|
6b12c55393 | ||
|
|
4b8d072153 | ||
|
|
f159b18e96 | ||
|
|
27653381d3 | ||
|
|
bd77b17c1c | ||
|
|
3261fd12db | ||
|
|
3aff53647d | ||
|
|
4a703a4288 | ||
|
|
4880177e65 | ||
|
|
744e17a0d6 | ||
|
|
b706c55ed8 | ||
|
|
fe3ad3487d | ||
|
|
5ff2b52522 | ||
|
|
d57438bf8c | ||
|
|
5f2a8acfa2 | ||
|
|
01bf367ce1 | ||
|
|
2550f1bee5 | ||
|
|
f2d2307fcc | ||
|
|
33e904632c | ||
|
|
2e34d71af6 | ||
|
|
2bc6754598 | ||
|
|
086caa80bb | ||
|
|
ac85797a4f | ||
|
|
ba7d3324e6 | ||
|
|
6a97341835 | ||
|
|
2970ab6ae3 | ||
|
|
87447e9344 | ||
|
|
2980a87d09 | ||
|
|
75d1b49aed | ||
|
|
a5421d1a51 | ||
|
|
42b2e0622f | ||
|
|
8033348aa1 | ||
|
|
bd39a9c2f8 | ||
|
|
633e9474b8 | ||
|
|
588ec05c80 | ||
|
|
dfcba501c4 | ||
|
|
c81e0d5816 | ||
|
|
92cdc78dda | ||
|
|
5971e12ea9 | ||
|
|
0cb18e2058 | ||
|
|
501df0763b | ||
|
|
1762765c2f | ||
|
|
0a9ae254c8 | ||
|
|
8476e11065 | ||
|
|
014c06a797 | ||
|
|
256f4cf2a8 | ||
|
|
e540cc901c | ||
|
|
42f1a55fa7 | ||
|
|
7f59674ea8 | ||
|
|
0899849681 | ||
|
|
5f5c67601e | ||
|
|
5e8624c79c | ||
|
|
72821f0f16 | ||
|
|
c2e0e56a80 | ||
|
|
6919e3cdc8 | ||
|
|
4a62b44526 | ||
|
|
ac181e238d | ||
|
|
d323b78d3f | ||
|
|
2582f6fe93 | ||
|
|
53d698573e | ||
|
|
7560d272dd | ||
|
|
f6e5d09ffe | ||
|
|
825ab0afc0 | ||
|
|
4c4efdfd11 | ||
|
|
1fb34eb71c | ||
|
|
3963943904 | ||
|
|
d4f97f61c2 | ||
|
|
edf545c9a1 | ||
|
|
15f9bf181a | ||
|
|
884c5d2578 | ||
|
|
0d6b42cc3f | ||
|
|
1e8716450f | ||
|
|
850272e783 | ||
|
|
bf9edef146 | ||
|
|
35db2b0c8e | ||
|
|
c5638d8dbb | ||
|
|
4a8a83bf09 | ||
|
|
4b1110921b | ||
|
|
e159a5f206 | ||
|
|
856cdbda6b | ||
|
|
14df21a2ae | ||
|
|
2075587980 | ||
|
|
a35362f0ed | ||
|
|
480c4111f9 | ||
|
|
e671cfebcf | ||
|
|
25a80e378d | ||
|
|
2d064d61a9 | ||
|
|
6b16d27576 | ||
|
|
5422ab4daf | ||
|
|
cbcfed133c | ||
|
|
064032175e | ||
|
|
e7eca015ac | ||
|
|
d94b443eca | ||
|
|
434048afad | ||
|
|
3614efa965 | ||
|
|
ec30b1a457 | ||
|
|
3b43df0214 | ||
|
|
ea3974d47e | ||
|
|
f7e5f9f5b6 | ||
|
|
c425400480 | ||
|
|
aea03cc2b7 | ||
|
|
e369fbded4 | ||
|
|
792806c20d | ||
|
|
fc894d8631 | ||
|
|
dcc3b1294c | ||
|
|
5d0a8ff6dd | ||
|
|
c6cc7d3d29 | ||
|
|
d2838c2780 | ||
|
|
4e13febeaf | ||
|
|
3e80554a0e | ||
|
|
f3d8b2b3d1 | ||
|
|
475ba7ca10 | ||
|
|
16c13cb561 | ||
|
|
fd9902afd6 | ||
|
|
eb936a6f94 | ||
|
|
184d171b74 | ||
|
|
dc8b9ffc7c | ||
|
|
f7fbb8b859 | ||
|
|
8fce9e39a0 | ||
|
|
dee640d32f | ||
|
|
0af6703c08 | ||
|
|
b0d6ccf572 | ||
|
|
9e3dcbd041 | ||
|
|
9283b443c1 | ||
|
|
189a28f349 | ||
|
|
e02288b689 | ||
|
|
a90c44c7d8 | ||
|
|
eaac6cdbb3 | ||
|
|
aba138447c | ||
|
|
28af4e5277 | ||
|
|
a662a0a68f | ||
|
|
5aa081a01b | ||
|
|
24e149634d | ||
|
|
635b4110a4 | ||
|
|
56ddb5da23 | ||
|
|
ece1122733 | ||
|
|
dd70743bae | ||
|
|
5ab7e8dd80 | ||
|
|
c7473ddf42 | ||
|
|
0119eeb575 | ||
|
|
dc53fac53d | ||
|
|
d86179f1a4 | ||
|
|
53a73e9893 | ||
|
|
3efb6c0241 | ||
|
|
f6535c8ad3 | ||
|
|
6d7035afac | ||
|
|
2c5c08e562 | ||
|
|
11f5d2fb07 | ||
|
|
74ee853b49 | ||
|
|
0af6c133c5 | ||
|
|
cefad32181 | ||
|
|
2b1eb51d94 | ||
|
|
1df7d07abc | ||
|
|
fca3bb3cc3 | ||
|
|
45a7689518 | ||
|
|
16b74190e5 | ||
|
|
2f33b0eb79 | ||
|
|
cf64aa3823 | ||
|
|
944d8187ba | ||
|
|
c9b3459a48 | ||
|
|
ec0a1a97e0 | ||
|
|
dd81b2cc41 | ||
|
|
7d58887138 | ||
|
|
a79f2fa90a | ||
|
|
473c70fd70 | ||
|
|
bbd967adad | ||
|
|
f55fdbf630 | ||
|
|
6b23c70e37 | ||
|
|
1d4e6ca825 | ||
|
|
deeae1ef56 | ||
|
|
ed87c40d13 | ||
|
|
ac28e587e2 | ||
|
|
55d2d2cce4 | ||
|
|
f3d5c3f698 | ||
|
|
d92ba0987b | ||
|
|
9b3fde7a19 | ||
|
|
e39a9c190a | ||
|
|
30fff79bd0 | ||
|
|
7781237c56 | ||
|
|
51408010e8 | ||
|
|
7aeaf76062 | ||
|
|
006bda5bfc | ||
|
|
148b76f4a3 | ||
|
|
422e63a93d | ||
|
|
2aff0ed03a | ||
|
|
341d592001 | ||
|
|
568890e9b3 | ||
|
|
a1e9cacb9f | ||
|
|
a258379a3b | ||
|
|
637499dcd7 | ||
|
|
1e79d464b0 | ||
|
|
932381052b | ||
|
|
367c4179fd | ||
|
|
0fc9f2ec00 | ||
|
|
1646014561 | ||
|
|
9152ee826d | ||
|
|
08ce1b54ca | ||
|
|
37b74be3bb | ||
|
|
fac2e8ec98 | ||
|
|
58fd729bec | ||
|
|
0c2244d668 | ||
|
|
40d0d9d2b8 | ||
|
|
3ce78064ed | ||
|
|
9db8d05206 | ||
|
|
22a0ce1e20 | ||
|
|
3ff8a920c0 | ||
|
|
912e340028 | ||
|
|
751885128a | ||
|
|
644cd36286 | ||
|
|
91601c8a2d | ||
|
|
f70351fc75 | ||
|
|
976cb1ff25 | ||
|
|
3f8fb365a0 | ||
|
|
5cfbc8ce48 | ||
|
|
89033de836 | ||
|
|
ff4c6ea950 | ||
|
|
c3f32da557 | ||
|
|
9d7930ed3c | ||
|
|
0dd54b112e | ||
|
|
b10a502b0e | ||
|
|
980d59c9be | ||
|
|
6d977ea949 | ||
|
|
e723948756 | ||
|
|
d95e3c6e04 | ||
|
|
7fdf986df4 | ||
|
|
6b049ad86d | ||
|
|
a0fc6f7e22 | ||
|
|
d0890c45e2 | ||
|
|
93b3926008 | ||
|
|
3fe94b68a3 | ||
|
|
34f5a58692 | ||
|
|
b605c8e654 | ||
|
|
95df997198 | ||
|
|
51ba4f1ec8 | ||
|
|
457186fe40 | ||
|
|
a30aad04da | ||
|
|
ad74af426b | ||
|
|
115eea3828 | ||
|
|
5bf24e10b2 | ||
|
|
10f1507366 | ||
|
|
badb8c7914 | ||
|
|
13b2f6534e | ||
|
|
c78ecd8453 | ||
|
|
b61e29ef0f | ||
|
|
ca555e7ea6 | ||
|
|
a1f254a0bc | ||
|
|
a9429caf09 | ||
|
|
7bf50c69e2 | ||
|
|
fcd8cfc4d5 | ||
|
|
5b0a662b40 | ||
|
|
255c8437d7 | ||
|
|
83b242a727 | ||
|
|
4ef6c2ea34 | ||
|
|
29b93f63f7 | ||
|
|
a403d96204 | ||
|
|
c1a187084d | ||
|
|
7808dc5740 | ||
|
|
4417eabdc7 | ||
|
|
119b18521f | ||
|
|
ccefafd172 | ||
|
|
a75bf1b2bb | ||
|
|
15a0b9ab93 | ||
|
|
9bed58a863 | ||
|
|
19dd5ddbae | ||
|
|
8cd636c213 | ||
|
|
d156b716f6 | ||
|
|
3f910824e8 | ||
|
|
3509b05d1e | ||
|
|
164bd18234 | ||
|
|
fcc9cdcaef | ||
|
|
b32785f88c | ||
|
|
8c9808b2d6 | ||
|
|
a80f520c38 | ||
|
|
34c517defc | ||
|
|
d5a762f35c | ||
|
|
ab6ec6d11e | ||
|
|
c8a629d8a5 | ||
|
|
71805500ca | ||
|
|
5e7c12dac7 | ||
|
|
29817d6627 | ||
|
|
c010b7319e | ||
|
|
27b190cadf | ||
|
|
e1a02a0729 | ||
|
|
eb512022e0 | ||
|
|
0aec9a85bb | ||
|
|
c1743eb18d | ||
|
|
ccd2855e01 | ||
|
|
d3338f5d81 | ||
|
|
6532dacbb1 | ||
|
|
b42338ea38 | ||
|
|
8f07f183dd | ||
|
|
e66aedaaa1 | ||
|
|
9ac9db0fe0 | ||
|
|
1b610242bc | ||
|
|
be58dd19c1 | ||
|
|
0d2a1bac36 | ||
|
|
f67815b0d3 | ||
|
|
d4c986fb84 | ||
|
|
b24a7e3faf | ||
|
|
18a78e2892 | ||
|
|
323fbb4713 | ||
|
|
bd6b699a1e | ||
|
|
4795af29ea | ||
|
|
f76a62b7d2 | ||
|
|
da7d200d92 | ||
|
|
2de44e7563 | ||
|
|
f30cdc1933 | ||
|
|
f9ccacf118 | ||
|
|
6ed7e26d86 | ||
|
|
91856ea145 | ||
|
|
5b6b0f09e1 | ||
|
|
291677d0cf | ||
|
|
15eee102fd | ||
|
|
0db2aebfda | ||
|
|
7ec00a279c | ||
|
|
881da033b8 | ||
|
|
1e972cbb65 | ||
|
|
e689deaa2b | ||
|
|
93a1a432d7 | ||
|
|
0b71bc2880 | ||
|
|
9f4b72800a | ||
|
|
5d2e08d124 | ||
|
|
5fb1b39742 | ||
|
|
5ef8e5c447 | ||
|
|
3152cddb3d | ||
|
|
c2b87b46fc | ||
|
|
d764941341 | ||
|
|
112ca2707a | ||
|
|
cf26092917 | ||
|
|
842a252576 | ||
|
|
e23d9bc3cc | ||
|
|
e206ad3c08 | ||
|
|
2eddddc6fc | ||
|
|
de6a078f01 | ||
|
|
283f4d1e37 | ||
|
|
0f3cd28019 | ||
|
|
7fec7f8937 | ||
|
|
3f54630531 | ||
|
|
7f864dba3a | ||
|
|
49644f10f5 | ||
|
|
f78b41dde3 | ||
|
|
7163337a27 | ||
|
|
27fd087631 | ||
|
|
9b7ec4f266 | ||
|
|
90fd4b54b3 | ||
|
|
97e5de1ee5 | ||
|
|
5f247a6d11 | ||
|
|
ccc0189e70 | ||
|
|
8543636576 | ||
|
|
b09025df08 | ||
|
|
39c747e430 | ||
|
|
2104822cac | ||
|
|
bcf713932a | ||
|
|
6d671b6576 | ||
|
|
b7345107d7 | ||
|
|
9cdfdf9bda | ||
|
|
42f200aabd | ||
|
|
f8853ae902 | ||
|
|
061201c0de | ||
|
|
f11dab363f | ||
|
|
48dd50afe4 | ||
|
|
352e71d9e9 | ||
|
|
2296ef0987 | ||
|
|
30f11e4e46 | ||
|
|
43dbaf7004 | ||
|
|
55bb65034f | ||
|
|
57ebb297c0 | ||
|
|
a513f10296 | ||
|
|
a1074852dd | ||
|
|
5f546a3df8 | ||
|
|
986c19ef6e | ||
|
|
bea7ad5876 | ||
|
|
f92c519d05 | ||
|
|
ecd3ad40ae | ||
|
|
fad3c2bbdf | ||
|
|
46c53ea679 | ||
|
|
062caa8f53 | ||
|
|
f6a39fea4b | ||
|
|
ea82f89b53 | ||
|
|
23443b2632 | ||
|
|
114eab952b | ||
|
|
f8472721ee | ||
|
|
9634bc99bd | ||
|
|
81a0ba08bd | ||
|
|
12f5bd141d | ||
|
|
6e2b7e534b | ||
|
|
543365f296 | ||
|
|
da3bf945cb | ||
|
|
4e311ca279 | ||
|
|
18c449a9ed | ||
|
|
d7293ef41d | ||
|
|
88c8860548 | ||
|
|
85a64a6c14 | ||
|
|
d7c3cf7d3e | ||
|
|
5f3dc081b5 | ||
|
|
8959d3aec4 | ||
|
|
c589d04a32 | ||
|
|
8ceda27817 | ||
|
|
7260c2c77e | ||
|
|
7991dafe64 | ||
|
|
232790836b | ||
|
|
9305b0a287 | ||
|
|
4ff8b869db | ||
|
|
c1df939ac8 | ||
|
|
aea8cd1d62 | ||
|
|
b816622129 | ||
|
|
d80613f26f | ||
|
|
d5505080cf | ||
|
|
92d6a541ae | ||
|
|
633948e8cc | ||
|
|
2ac48f715a | ||
|
|
e82c9a71ec | ||
|
|
004f6d1495 | ||
|
|
32b54e1346 | ||
|
|
f50b19968c | ||
|
|
c9d0415d84 | ||
|
|
625932e8f3 | ||
|
|
5a03428d76 | ||
|
|
33c6d13c7a | ||
|
|
ba5e15d29b | ||
|
|
de64eb6f8d | ||
|
|
75589f9770 | ||
|
|
9217cd3832 | ||
|
|
49d295535f | ||
|
|
bd489bd462 | ||
|
|
7d621b5b1d | ||
|
|
22b60a07e5 | ||
|
|
adf52e1520 | ||
|
|
b5d027b37c | ||
|
|
c5a1513cf5 | ||
|
|
7116607881 | ||
|
|
559b0bf45a | ||
|
|
72e72af6b1 | ||
|
|
e0d6a6ae0f | ||
|
|
64588f8337 | ||
|
|
66b0931f07 | ||
|
|
5ddabba0b2 | ||
|
|
2e054d8bec | ||
|
|
2c3ff3a628 | ||
|
|
976c74d694 | ||
|
|
e3adcfb62e | ||
|
|
cd76cc0e9f | ||
|
|
e2e356d0c2 | ||
|
|
bb7c217ccc | ||
|
|
591a2e5dbb | ||
|
|
6d1b754db5 | ||
|
|
cae9b754bc | ||
|
|
46e0c88280 | ||
|
|
4942db2806 | ||
|
|
b5be515b9b | ||
|
|
d09d2dcffd | ||
|
|
c5fddbbb69 | ||
|
|
2ef360a7ac | ||
|
|
509d26f938 | ||
|
|
5a9efff87c | ||
|
|
24a93d107a | ||
|
|
26902b4565 | ||
|
|
e320aff5dc | ||
|
|
3f971fbab1 | ||
|
|
f24ce61cc9 | ||
|
|
137be1c7fa | ||
|
|
039018ddc9 | ||
|
|
bef784b32a | ||
|
|
eaad3ebeac | ||
|
|
af8637f8a4 | ||
|
|
ba5ec70669 | ||
|
|
503f20a7f4 | ||
|
|
1237b553f7 | ||
|
|
86c89a47da | ||
|
|
b40cb3331a | ||
|
|
88025040c3 | ||
|
|
e7c0cda77f | ||
|
|
99e64388ba | ||
|
|
8ff0524bbc | ||
|
|
e749c9764c | ||
|
|
69a6adf0a8 | ||
|
|
ab064c90dd | ||
|
|
817df662da | ||
|
|
d093b461d6 | ||
|
|
5cc756f853 | ||
|
|
07c443598b | ||
|
|
3c6116255b | ||
|
|
5689e3815a | ||
|
|
9bf6a72621 | ||
|
|
2e02aa16bb | ||
|
|
8e7fddd6b0 | ||
|
|
ac8f6455ff | ||
|
|
3c268c8cbd | ||
|
|
10b56e7b4f | ||
|
|
f52db71ec6 | ||
|
|
bc1f21961c | ||
|
|
0e1f843f50 | ||
|
|
2a5d1fb84a | ||
|
|
3b0d0dcd0c | ||
|
|
f92cf3df4f | ||
|
|
274c9904e6 | ||
|
|
44ee017dee | ||
|
|
1416650c9d | ||
|
|
4acf6d336b | ||
|
|
dd7a861280 | ||
|
|
bbb4893857 | ||
|
|
3054c2366e | ||
|
|
f9e9b423dd | ||
|
|
f576f39bc6 | ||
|
|
24a7d4b82d | ||
|
|
d623820833 | ||
|
|
a9be6a54ff | ||
|
|
3b60cb2bcd | ||
|
|
fe3ff15539 | ||
|
|
f5018f628a | ||
|
|
aa00419198 | ||
|
|
fd5575ace5 | ||
|
|
2e31e08522 | ||
|
|
1412805503 | ||
|
|
812e269195 | ||
|
|
006fde8fea | ||
|
|
8499ca358b | ||
|
|
63b8cc1104 | ||
|
|
511105beb3 | ||
|
|
258447c17b | ||
|
|
e1bf657a05 | ||
|
|
bca4af201d | ||
|
|
9af243177f | ||
|
|
ca3c2bf70a | ||
|
|
ce5fc9715d | ||
|
|
606a50047c | ||
|
|
b58c0705fc | ||
|
|
841c226732 | ||
|
|
7e8c8f4bb7 | ||
|
|
ebedca82f3 | ||
|
|
e06b61e8d2 | ||
|
|
e2e703540e | ||
|
|
8fa3a73fb2 | ||
|
|
56cff59438 | ||
|
|
cb223d7ddf | ||
|
|
96a4bf3464 | ||
|
|
729a74a561 | ||
|
|
5f0d47ca88 | ||
|
|
250b41612e | ||
|
|
54ed725061 | ||
|
|
5844330301 | ||
|
|
d1c80dfd9b | ||
|
|
b2097e2f93 | ||
|
|
7386a2f40f | ||
|
|
5a1ecb55b8 | ||
|
|
b05d7d09cf | ||
|
|
dc0423f97e | ||
|
|
af968f1868 | ||
|
|
2cc73cc52a | ||
|
|
28109dfb39 | ||
|
|
2912994e6b | ||
|
|
6d6d5996d7 | ||
|
|
bd433e0776 | ||
|
|
fc9644f448 | ||
|
|
1558970064 | ||
|
|
991dd55049 | ||
|
|
dfee1cc490 | ||
|
|
e649690f6a | ||
|
|
783682251f | ||
|
|
7465e1ae4b | ||
|
|
743d1a0e86 | ||
|
|
17f6f1cd4c | ||
|
|
4b856fba2a | ||
|
|
3a8e4e065e | ||
|
|
43f9bd5239 | ||
|
|
6f5a0b9a3f | ||
|
|
ecf55e64ae | ||
|
|
cd566ac9c0 | ||
|
|
6101ded74a | ||
|
|
0d49bbfa7a | ||
|
|
f6d83c17bd | ||
|
|
ac90a0973d | ||
|
|
f195c61200 | ||
|
|
20044fa6a7 | ||
|
|
b9428360c0 | ||
|
|
55c7dd860c | ||
|
|
ecefd1d3ee | ||
|
|
0cdd0ca583 | ||
|
|
31a0122cd1 | ||
|
|
6777cd2a9c | ||
|
|
649373ff51 | ||
|
|
97e6222176 | ||
|
|
eef56a7c82 | ||
|
|
8853666645 | ||
|
|
a379764076 | ||
|
|
edd1cc6059 | ||
|
|
03280db377 | ||
|
|
86aeff5547 | ||
|
|
b5b2062efa | ||
|
|
b51731d675 | ||
|
|
229e8d9592 | ||
|
|
5c6bd1a043 | ||
|
|
dcdd5e8f2d | ||
|
|
a3b3f91f8d | ||
|
|
69568378ec | ||
|
|
8776b36bb0 | ||
|
|
9bde946c55 | ||
|
|
c74898b970 | ||
|
|
f0f2314639 | ||
|
|
edf38cef33 | ||
|
|
a700ec32fd | ||
|
|
7dcd5f41ec | ||
|
|
01208a858d | ||
|
|
c379db831c | ||
|
|
d478a8a8b4 | ||
|
|
39535e9bf8 | ||
|
|
db90142c4b | ||
|
|
63bd3374be | ||
|
|
7a232c8f5d | ||
|
|
34f9dd9ea2 | ||
|
|
4d3fba2bd0 | ||
|
|
83cc7015bf | ||
|
|
dfe151ccb1 | ||
|
|
98f136e747 | ||
|
|
94792fe571 | ||
|
|
6a43f0a09d | ||
|
|
4a2354ab26 | ||
|
|
be8cd85bfe | ||
|
|
7c4eefe8ee | ||
|
|
19d6e30889 | ||
|
|
174af34115 | ||
|
|
5c3711bcc8 | ||
|
|
31aef1d200 | ||
|
|
4aaa2c6fed | ||
|
|
5d3c84327d | ||
|
|
eb1feba304 | ||
|
|
9df6368558 | ||
|
|
0a6092b738 | ||
|
|
6b852822a5 | ||
|
|
b4cde98526 | ||
|
|
5f0f1966a8 | ||
|
|
dbadee987c | ||
|
|
995943d84d | ||
|
|
764a5f3e0a | ||
|
|
d41a2adce7 | ||
|
|
521b53dc09 | ||
|
|
2c94ae8bb4 | ||
|
|
ebbedc558d | ||
|
|
0065c3d610 | ||
|
|
0325ba4c0a | ||
|
|
b348bff7a8 | ||
|
|
b5e43ed73b | ||
|
|
7ac2ba90b1 | ||
|
|
f869393da4 | ||
|
|
6ccece4603 | ||
|
|
4bd2ba4d13 | ||
|
|
ab0a3cde78 | ||
|
|
72f9e4485e | ||
|
|
87c536b698 | ||
|
|
ac03bad282 | ||
|
|
9efdcc1f34 | ||
|
|
f26a965ea9 | ||
|
|
5c7bd954a2 | ||
|
|
184cb8ba19 | ||
|
|
1d324a2d94 | ||
|
|
eeeb3440c2 | ||
|
|
a1c965584e | ||
|
|
e5b4905a12 | ||
|
|
f64ba96962 | ||
|
|
0eec77d8b3 | ||
|
|
7efbe2213a | ||
|
|
ffa25d1690 | ||
|
|
009d851b58 | ||
|
|
6d5e6add9b | ||
|
|
62f7915e97 | ||
|
|
be49bd167b | ||
|
|
13e9e41890 | ||
|
|
e6eec622c8 | ||
|
|
501b8b7bf5 | ||
|
|
99d78d62fb | ||
|
|
1d5758f5d2 | ||
|
|
fad1916259 | ||
|
|
1bff103e53 | ||
|
|
68013b96d6 | ||
|
|
0c687539fb | ||
|
|
0bf0441f49 | ||
|
|
0c66ac97e8 | ||
|
|
8c261dba73 | ||
|
|
6e3b6cb0c1 | ||
|
|
11155cc609 | ||
|
|
a5baa052e2 | ||
|
|
31d8fe4459 | ||
|
|
71021982ed | ||
|
|
4d9c1f7a65 | ||
|
|
406e9dcaf2 | ||
|
|
d3b0d845eb | ||
|
|
335b977cd4 | ||
|
|
3554c91b2b | ||
|
|
460dab0342 | ||
|
|
fb9b04c192 | ||
|
|
478d809620 | ||
|
|
5a7c481f69 | ||
|
|
076e84ed24 | ||
|
|
22164031fe | ||
|
|
cb50144624 | ||
|
|
acd9763b9d | ||
|
|
9f2167ac3c | ||
|
|
e9cfff8165 | ||
|
|
1153d477ee | ||
|
|
d63b158966 | ||
|
|
f23202545b | ||
|
|
037f45df1e | ||
|
|
0eeb6758f4 | ||
|
|
5279192102 | ||
|
|
0c8516d33a | ||
|
|
651f9637fc | ||
|
|
36c5c9939b | ||
|
|
613e32194f | ||
|
|
9a1e96fb99 | ||
|
|
bdcbf12246 | ||
|
|
894b843ccb | ||
|
|
4a9d67521f | ||
|
|
a353dceaa3 | ||
|
|
802dd2608e | ||
|
|
ebc4bf4b45 | ||
|
|
906828fadb | ||
|
|
e35612a6f6 | ||
|
|
f4e0272db9 | ||
|
|
5ecfc5e09d | ||
|
|
927b819bc8 | ||
|
|
857731e89f | ||
|
|
24fed58c81 | ||
|
|
57cef86ca1 | ||
|
|
0f91e18fce | ||
|
|
c01a0147f2 | ||
|
|
d695b6d51a | ||
|
|
3d1e4a93fd | ||
|
|
6a5d36c57a | ||
|
|
7f709aee53 | ||
|
|
4df7bcd87f | ||
|
|
bfd61893a1 | ||
|
|
72d374786f | ||
|
|
eb40eec4c1 | ||
|
|
991f1b17dd | ||
|
|
9a9aa75684 | ||
|
|
d1b023c8c8 | ||
|
|
0d6faed3d5 | ||
|
|
b3750f78ff | ||
|
|
82f96dd080 | ||
|
|
d640ce06d7 | ||
|
|
b8fb74fef3 | ||
|
|
ab4bbbff72 | ||
|
|
4180949307 | ||
|
|
e68ff858f2 | ||
|
|
b978645c28 | ||
|
|
59a99f4c21 | ||
|
|
bf67c6b1d0 | ||
|
|
f1cf370680 | ||
|
|
affa23040b | ||
|
|
a15cefc80f | ||
|
|
5cf00d903b | ||
|
|
47a805ede7 | ||
|
|
206d562f3f |
No files matched your search
+1
-1
@@ -1,4 +1,4 @@
|
||||
cmake_minimum_required(VERSION 3.0)
|
||||
cmake_minimum_required(VERSION 3.5)
|
||||
# DO NOT CHANGE THIS SRB2 STRING! Some variable names depend on this string.
|
||||
# Version change is fine.
|
||||
project(SRB2
|
||||
|
||||
@@ -156,6 +156,11 @@ Add Gamepad Rumble support for things.
|
||||
To be used with Displayplayers.
|
||||
Duration is in milliseconds and is optional to set, default value is 84ms.
|
||||
|
||||
## P_CheckSightFast(mo1, mo2)
|
||||
|
||||
Exactly same as P_CheckSight but uses cheaper algorithm, useful for things like nametags. Doesn't work exactly
|
||||
like P_CheckSight so don't use it for anything gameplay-related.
|
||||
|
||||
# Other changes
|
||||
|
||||
## P_PlayRinglossSound(source, damager)
|
||||
|
||||
@@ -1726,11 +1726,6 @@ HW3SOUND for 3D hardware sound support
|
||||
<Option compilerVar="CC" />
|
||||
</Unit>
|
||||
<Unit filename="src/r_draw.h" />
|
||||
<Unit filename="src/r_draw16.c">
|
||||
<Option compilerVar="CC" />
|
||||
<Option compile="0" />
|
||||
<Option link="0" />
|
||||
</Unit>
|
||||
<Unit filename="src/r_draw8.c">
|
||||
<Option compilerVar="CC" />
|
||||
<Option compile="0" />
|
||||
|
||||
@@ -773,16 +773,6 @@ Priority=1000
|
||||
OverrideBuildCmd=0
|
||||
BuildCmd=
|
||||
|
||||
[Unit79]
|
||||
FileName=src\r_draw16.c
|
||||
Folder=R_Rend
|
||||
Compile=0
|
||||
CompileCpp=0
|
||||
Link=0
|
||||
Priority=1000
|
||||
OverrideBuildCmd=0
|
||||
BuildCmd=
|
||||
|
||||
[Unit80]
|
||||
FileName=src\r_draw8.c
|
||||
Folder=R_Rend
|
||||
|
||||
+32
-32
@@ -1,32 +1,32 @@
|
||||
@echo off
|
||||
set BRA=Unknown
|
||||
set REV=illegal
|
||||
|
||||
copy nul: /b +%1\comptime.c tmp.$$$ > nul
|
||||
move tmp.$$$ %1\comptime.c > nul
|
||||
|
||||
if exist .git goto gitrev
|
||||
if exist ..\.git goto gitrev
|
||||
if exist .svn goto svnrev
|
||||
goto filwri
|
||||
|
||||
:gitrev
|
||||
set GIT=%2
|
||||
if "%GIT%"=="" set GIT=git
|
||||
for /f "usebackq" %%s in (`%GIT% rev-parse --abbrev-ref HEAD`) do @set BRA=%%s
|
||||
for /f "usebackq" %%s in (`%GIT% rev-parse HEAD`) do @set REV=%%s
|
||||
set REV=%REV:~0,8%
|
||||
goto filwri
|
||||
|
||||
:svnrev
|
||||
set BRA=Subversion
|
||||
for /f "usebackq" %%s in (`svnversion .`) do @set REV=%%s
|
||||
set REV=r%REV%
|
||||
goto filwri
|
||||
|
||||
:filwri
|
||||
echo // Do not edit! This file was autogenerated > %1\comptime.h
|
||||
echo // by the %0 batch file >> %1\comptime.h
|
||||
echo // >> %1\comptime.h
|
||||
echo const char* compbranch = "%BRA%"; >> %1\comptime.h
|
||||
echo const char* comprevision = "%REV%"; >> %1\comptime.h
|
||||
@echo off
|
||||
set BRA=Unknown
|
||||
set REV=illegal
|
||||
|
||||
copy nul: /b +%1\comptime.c tmp.$$$ > nul
|
||||
move tmp.$$$ %1\comptime.c > nul
|
||||
|
||||
if exist .git goto gitrev
|
||||
if exist ..\.git goto gitrev
|
||||
if exist .svn goto svnrev
|
||||
goto filwri
|
||||
|
||||
:gitrev
|
||||
set GIT=%2
|
||||
if "%GIT%"=="" set GIT=git
|
||||
for /f "usebackq" %%s in (`%GIT% rev-parse --abbrev-ref HEAD`) do @set BRA=%%s
|
||||
for /f "usebackq" %%s in (`%GIT% rev-parse HEAD`) do @set REV=%%s
|
||||
set REV=%REV:~0,8%
|
||||
goto filwri
|
||||
|
||||
:svnrev
|
||||
set BRA=Subversion
|
||||
for /f "usebackq" %%s in (`svnversion .`) do @set REV=%%s
|
||||
set REV=r%REV%
|
||||
goto filwri
|
||||
|
||||
:filwri
|
||||
echo // Do not edit! This file was autogenerated > %1\comptime.h
|
||||
echo // by the %0 batch file >> %1\comptime.h
|
||||
echo // >> %1\comptime.h
|
||||
echo const char* compbranch = "%BRA%"; >> %1\comptime.h
|
||||
echo const char* comprevision = "%REV%"; >> %1\comptime.h
|
||||
+1
-1
@@ -17,7 +17,7 @@ EOF
|
||||
|
||||
versiongit() {
|
||||
gitbranch="$(git rev-parse --abbrev-ref HEAD)"
|
||||
gitversion="$(git rev-parse HEAD | cut -c -8)"
|
||||
gitversion="$(git show --pretty=format:'%h %s' -s HEAD | sed 's/"/\\"/g')"
|
||||
version "$gitbranch" "$gitversion";
|
||||
exit 0
|
||||
}
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/* backtrace.h -- Public header file for stack backtrace library.
|
||||
Copyright (C) 2012-2020 Free Software Foundation, Inc.
|
||||
Copyright (C) 2012-2024 Free Software Foundation, Inc.
|
||||
Written by Ian Lance Taylor, Google.
|
||||
|
||||
Redistribution and use in source and binary forms, with or without
|
||||
@@ -54,13 +54,14 @@ struct backtrace_state;
|
||||
invalid after this function returns.
|
||||
|
||||
As a special case, the ERRNUM argument will be passed as -1 if no
|
||||
debug info can be found for the executable, but the function
|
||||
requires debug info (e.g., backtrace_full, backtrace_pcinfo). The
|
||||
MSG in this case will be something along the lines of "no debug
|
||||
info". Similarly, ERRNUM will be passed as -1 if there is no
|
||||
symbol table, but the function requires a symbol table (e.g.,
|
||||
backtrace_syminfo). This may be used as a signal that some other
|
||||
approach should be tried. */
|
||||
debug info can be found for the executable, or if the debug info
|
||||
exists but has an unsupported version, but the function requires
|
||||
debug info (e.g., backtrace_full, backtrace_pcinfo). The MSG in
|
||||
this case will be something along the lines of "no debug info".
|
||||
Similarly, ERRNUM will be passed as -1 if there is no symbol table,
|
||||
but the function requires a symbol table (e.g., backtrace_syminfo).
|
||||
This may be used as a signal that some other approach should be
|
||||
tried. */
|
||||
|
||||
typedef void (*backtrace_error_callback) (void *data, const char *msg,
|
||||
int errnum);
|
||||
|
||||
Binary file not shown.
+2
-1
@@ -1,2 +1,3 @@
|
||||
/cscope.out
|
||||
/srb2wii
|
||||
*.json
|
||||
*.idx
|
||||
+5
-1
@@ -129,6 +129,7 @@ set(SRB2_CORE_RENDER_SOURCES
|
||||
r_fps.c
|
||||
r_main.c
|
||||
r_patch.c
|
||||
r_patchrotation.c
|
||||
r_plane.c
|
||||
r_segs.c
|
||||
r_sky.c
|
||||
@@ -143,7 +144,8 @@ set(SRB2_CORE_RENDER_SOURCES
|
||||
r_fps.h
|
||||
r_local.h
|
||||
r_main.h
|
||||
r_patch
|
||||
r_patch.h
|
||||
r_patchrotation.h
|
||||
r_plane.h
|
||||
r_segs.h
|
||||
r_sky.h
|
||||
@@ -173,6 +175,7 @@ set(SRB2_CORE_GAME_SOURCES
|
||||
p_user.c
|
||||
k_director.c
|
||||
k_kart.c
|
||||
k_stats.c
|
||||
i_time.c
|
||||
|
||||
p_local.h
|
||||
@@ -187,6 +190,7 @@ set(SRB2_CORE_GAME_SOURCES
|
||||
p_tick.h
|
||||
k_director.h
|
||||
k_kart.h
|
||||
k_stats.h
|
||||
)
|
||||
|
||||
if(NOT (CMAKE_CXX_COMPILER_ID MATCHES "Clang"))
|
||||
|
||||
+33
-52
@@ -68,7 +68,6 @@ ALL_SYSTEMS=\
|
||||
LINUX64\
|
||||
MINGW64\
|
||||
HAIKU\
|
||||
DUMMY\
|
||||
MINGW\
|
||||
UNIX\
|
||||
LINUX\
|
||||
@@ -81,18 +80,19 @@ ALL_SYSTEMS=\
|
||||
ifeq (,$(filter $(ALL_SYSTEMS),$(.VARIABLES)))
|
||||
ifeq ($(OS),Windows_NT) # all windows are Windows_NT...
|
||||
|
||||
$(info Detected a Windows system, compiling for 32-bit MinGW SDL2...)
|
||||
ifeq ($(shell uname -s | grep -o MINGW64),MINGW64) # 64-bit MinGW
|
||||
$(info Detected a Windows system, compiling for 64-bit MinGW SDL2...)
|
||||
MINGW64=1
|
||||
else # 32-bit MinGW
|
||||
$(info Detected a Windows system, compiling for 32-bit MinGW SDL2...)
|
||||
MINGW=1
|
||||
endif
|
||||
|
||||
# go for a 32-bit sdl mingw exe by default
|
||||
MINGW=1
|
||||
SDL=1
|
||||
WINDOWSHELL=1
|
||||
NOUPX=1
|
||||
NOOBJDUMP=1
|
||||
|
||||
else # if you on the *nix
|
||||
|
||||
NOUPX=1
|
||||
|
||||
system:=$(shell uname -s)
|
||||
|
||||
ifeq ($(system),Linux)
|
||||
@@ -116,6 +116,7 @@ else # if you on the *nix
|
||||
endif
|
||||
endif
|
||||
|
||||
NOUPX=1
|
||||
|
||||
# SRB2 data files
|
||||
D_DIR?=../bin/Resources
|
||||
@@ -156,17 +157,6 @@ endif
|
||||
|
||||
include Makefile.cfg
|
||||
|
||||
ifdef DUMMY
|
||||
NOPNG=1
|
||||
NOZLIB=1
|
||||
NONET=1
|
||||
NOHW=1
|
||||
NOIPX=1
|
||||
EXENAME?=srb2dummy
|
||||
OBJS=$(OBJDIR)/i_video.o
|
||||
LIBS=-lm
|
||||
endif
|
||||
|
||||
ifdef HAIKU
|
||||
NOIPX=1
|
||||
ifndef NONET
|
||||
@@ -193,8 +183,6 @@ endif
|
||||
endif
|
||||
|
||||
ifndef NONET
|
||||
ifndef NOSATURNSYNCH
|
||||
DOSATURNSYNCH=1
|
||||
ifndef NOSATURNJOIN
|
||||
DOSATURNJOIN=1
|
||||
endif
|
||||
@@ -202,7 +190,6 @@ ifndef NOSATURNPAK
|
||||
DOSATURNPAK=1
|
||||
endif
|
||||
endif
|
||||
endif
|
||||
|
||||
ifdef MINGW
|
||||
include win32/Makefile.cfg
|
||||
@@ -297,6 +284,10 @@ ifdef X86_64
|
||||
endif
|
||||
endif
|
||||
|
||||
# apparently MingW just completely ignores everything so just always force this shit
|
||||
# FIXME: we should port our code to c24
|
||||
CFLAGS+=-std=gnu17
|
||||
CPPFLAGS+=-std=gnu17
|
||||
|
||||
ifndef NOPNG
|
||||
OPTS+=-DHAVE_PNG
|
||||
@@ -385,8 +376,6 @@ endif
|
||||
endif
|
||||
|
||||
ifndef NONET
|
||||
ifndef NOSATURNSYNCH
|
||||
OPTS+=-DDOSATURNSYNCH
|
||||
ifndef NOSATURNJOIN
|
||||
OPTS+=-DDOSATURNJOIN
|
||||
endif
|
||||
@@ -394,7 +383,6 @@ ifndef NOSATURNPAK
|
||||
OPTS+=-DDOSATURNPAK
|
||||
endif
|
||||
endif
|
||||
endif
|
||||
|
||||
ifdef HAVE_MINIUPNPC
|
||||
ifdef NONET
|
||||
@@ -451,7 +439,24 @@ else
|
||||
# build a normal optimised version
|
||||
WINDRESFLAGS = -DNDEBUG
|
||||
CFLAGS+=-O3
|
||||
CPPFLAGS+=-O3
|
||||
endif
|
||||
|
||||
ifndef DEBUGMODE
|
||||
ifdef USELTO
|
||||
# compile with LTO
|
||||
CFLAGS+=-flto=auto
|
||||
CPPFLAGS+=-flto=auto
|
||||
endif
|
||||
endif
|
||||
|
||||
ifdef USEASAN
|
||||
# compile with asan
|
||||
CFLAGS+=-fsanitize=address
|
||||
CPPFLAGS+=-fsanitize=address
|
||||
LDFLAGS+=-fsanitize=address
|
||||
endif
|
||||
|
||||
CFLAGS+=-g $(OPTS) $(ARCHOPTS) $(WINDRESFLAGS)
|
||||
|
||||
ifdef PROFILEMODE
|
||||
@@ -506,6 +511,7 @@ OBJS:=$(i_main_o) \
|
||||
$(OBJDIR)/st_stuff.o \
|
||||
$(OBJDIR)/k_director.o \
|
||||
$(OBJDIR)/k_kart.o \
|
||||
$(OBJDIR)/k_stats.o \
|
||||
$(OBJDIR)/m_aatree.o \
|
||||
$(OBJDIR)/m_anigif.o \
|
||||
$(OBJDIR)/m_argv.o \
|
||||
@@ -548,6 +554,7 @@ OBJS:=$(i_main_o) \
|
||||
$(OBJDIR)/r_sky.o \
|
||||
$(OBJDIR)/r_splats.o \
|
||||
$(OBJDIR)/r_patch.o \
|
||||
$(OBJDIR)/r_patchrotation.o \
|
||||
$(OBJDIR)/r_things.o \
|
||||
$(OBJDIR)/r_portal.o \
|
||||
$(OBJDIR)/screen.o \
|
||||
@@ -591,10 +598,6 @@ ifdef SDL
|
||||
all: pre-build $(BIN)/$(EXENAME)
|
||||
endif
|
||||
|
||||
ifdef DUMMY
|
||||
all: $(BIN)/$(EXENAME)
|
||||
endif
|
||||
|
||||
cleandep:
|
||||
$(REMOVE) $(OBJDIR)/depend.dep
|
||||
$(REMOVE) comptime.h
|
||||
@@ -606,7 +609,7 @@ else
|
||||
-$(.)../comptime.sh .
|
||||
endif
|
||||
|
||||
clean:
|
||||
clean: cleandep
|
||||
$(REMOVE) *~ *.flc
|
||||
$(REMOVE) $(OBJDIR)/*.o
|
||||
|
||||
@@ -715,9 +718,7 @@ endif
|
||||
|
||||
#dependecy made by gcc itself !
|
||||
$(OBJS):
|
||||
ifndef DUMMY
|
||||
-include $(OBJDIR)/depend.dep
|
||||
endif
|
||||
|
||||
$(OBJDIR)/depend.dep:
|
||||
@echo "Creating dependency file, depend.dep"
|
||||
@@ -771,30 +772,10 @@ $(OBJDIR)/SRB2.res: win32/Srb2win.rc win32/afxres.h win32/resource.h
|
||||
$(WINDRES) -i $< -O rc $(WINDRESFLAGS) --include-dir=win32 -o $@ -O coff
|
||||
|
||||
ifdef SDL
|
||||
|
||||
ifdef MINGW
|
||||
$(OBJDIR)/win_dbg.o: win32/win_dbg.c
|
||||
$(CC) $(CFLAGS) $(WFLAGS) -c $< -o $@
|
||||
endif
|
||||
|
||||
ifdef FILTERS
|
||||
$(OBJDIR)/%.o: $(INTERFACE)/filter/%.c
|
||||
@echo $< needs deps
|
||||
$(CC) $(CFLAGS) $(WFLAGS) -c $< -o $@
|
||||
|
||||
$(OBJDIR)/filters.o: $(INTERFACE)/filter/filters.c $(INTERFACE)/filter/filters.c \
|
||||
$(INTERFACE)/filter/filters.h
|
||||
$(CC) $(CFLAGS) $(WFLAGS) -c $< -o $@
|
||||
|
||||
$(OBJDIR)/hq2x.o: $(INTERFACE)/filter/hq2x.c $(INTERFACE)/filter/hq2x.c \
|
||||
$(INTERFACE)/filter/filters.h
|
||||
$(CC) $(CFLAGS) $(WFLAGS) -c $< -o $@
|
||||
|
||||
$(OBJDIR)/lq2x.o: $(INTERFACE)/filter/lq2x.c $(INTERFACE)/filter/lq2x.c \
|
||||
$(INTERFACE)/filter/filters.h $(INTERFACE)/filter/interp.h \
|
||||
$(INTERFACE)/filter/hq2x.h $(INTERFACE)/filter/lq2x.h
|
||||
$(CC) $(CFLAGS) $(WFLAGS) -c $< -o $@
|
||||
endif
|
||||
endif
|
||||
|
||||
#############################################################
|
||||
|
||||
+13
-11
@@ -12,6 +12,7 @@
|
||||
# to avoid a false positive with the version detection...
|
||||
|
||||
SUPPORTED_GCC_VERSIONS:=\
|
||||
151 150 15\
|
||||
142 141 140 14\
|
||||
132 131 130 13\
|
||||
123 122 121 120 12\
|
||||
@@ -78,6 +79,18 @@ ifeq (,$(filter GCC%,$(.VARIABLES)))
|
||||
endif
|
||||
endif
|
||||
|
||||
ifdef GCC151
|
||||
GCC150=1
|
||||
endif
|
||||
|
||||
ifdef GCC15
|
||||
GCC150=1
|
||||
endif
|
||||
|
||||
ifdef GCC150
|
||||
GCC142=1
|
||||
endif
|
||||
|
||||
ifdef GCC142
|
||||
GCC141=1
|
||||
endif
|
||||
@@ -469,7 +482,6 @@ ifdef GCC81
|
||||
WFLAGS+=-Wno-error=multistatement-macros
|
||||
endif
|
||||
|
||||
|
||||
#indicate platform and what interface use with
|
||||
ifndef LINUX
|
||||
ifndef FREEBSD
|
||||
@@ -477,7 +489,6 @@ ifndef CYGWIN32
|
||||
ifndef MINGW
|
||||
ifndef MINGW64
|
||||
ifndef SDL
|
||||
ifndef DUMMY
|
||||
$(error No interface or platform flag defined)
|
||||
endif
|
||||
endif
|
||||
@@ -485,7 +496,6 @@ endif
|
||||
endif
|
||||
endif
|
||||
endif
|
||||
endif
|
||||
|
||||
#determine the interface directory (where you put all i_*.c)
|
||||
i_net_o=$(OBJDIR)/i_net.o
|
||||
@@ -510,11 +520,6 @@ UPX_OPTS+=-q
|
||||
endif
|
||||
|
||||
#Interface Setup
|
||||
ifdef DUMMY
|
||||
INTERFACE=dummy
|
||||
OBJDIR:=$(OBJDIR)/dummy
|
||||
BIN:=$(BIN)/dummy
|
||||
else
|
||||
ifdef LINUX
|
||||
SDL=1
|
||||
ifdef LINUX64
|
||||
@@ -561,7 +566,6 @@ endif
|
||||
endif
|
||||
endif
|
||||
endif
|
||||
endif
|
||||
|
||||
ifdef ARCHNAME
|
||||
OBJDIR:=$(OBJDIR)/$(ARCHNAME)
|
||||
@@ -576,7 +580,6 @@ ifdef SDL
|
||||
OBJDIR:=$(OBJDIR)/SDL
|
||||
endif
|
||||
|
||||
ifndef DUMMY
|
||||
ifdef DEBUGMODE
|
||||
OBJDIR:=$(OBJDIR)/Debug
|
||||
BIN:=$(BIN)/Debug
|
||||
@@ -584,4 +587,3 @@ else
|
||||
OBJDIR:=$(OBJDIR)/Release
|
||||
BIN:=$(BIN)/Release
|
||||
endif
|
||||
endif
|
||||
+154
-71
@@ -28,14 +28,15 @@
|
||||
#endif
|
||||
|
||||
// For use if I do walls with outsides/insides
|
||||
static const UINT8 REDS = (2*16);
|
||||
static const UINT8 REDS = (8*16);
|
||||
static const UINT8 REDRANGE = 16;
|
||||
static const UINT8 GRAYS = (1*16);
|
||||
static const UINT8 GRAYSRANGE = 16;
|
||||
static const UINT8 BROWNS = (15*16);
|
||||
static const UINT8 YELLOWS = (5*16)+8;
|
||||
static const UINT8 GREENS = (6*16);
|
||||
static const UINT8 BLUES = (9*16);
|
||||
static const UINT8 BROWNS = (3*16);
|
||||
static const UINT8 YELLOWS = (7*16);
|
||||
static const UINT8 GREENS = (10*16);
|
||||
//static const UINT8 CYANS = (13*16);
|
||||
static const UINT8 BLUES = (14*16);
|
||||
static const UINT8 DBLACK = 31;
|
||||
static const UINT8 DWHITE = 0;
|
||||
|
||||
@@ -46,7 +47,7 @@ static const UINT8 DWHITE = 0;
|
||||
#define THOKWALLCOLORS REDS
|
||||
#define THOKWALLRANGE REDRANGE
|
||||
#define TSWALLCOLORS DWHITE
|
||||
#define TSFINISHLINE GRAYS
|
||||
#define TSFINISHLINE (GREENS + 2)
|
||||
#define TSFOFINFO (BLUES + 4)
|
||||
#define FDWALLCOLORS BROWNS
|
||||
#define CDWALLCOLORS YELLOWS
|
||||
@@ -196,7 +197,7 @@ static fixed_t scale_mtof = (fixed_t)INITSCALEMTOF;
|
||||
// used by FTOM to scale from frame-buffer-to-map coords (=1/scale_mtof)
|
||||
static fixed_t scale_ftom;
|
||||
|
||||
static player_t *plr; // the player represented by an arrow
|
||||
static player_t *plr = NULL; // the player represented by an arrow
|
||||
|
||||
static boolean followplayer = true; // specifies whether to follow the player around
|
||||
|
||||
@@ -236,7 +237,7 @@ static inline void AM_restoreScaleAndLoc(void)
|
||||
m_x = old_m_x;
|
||||
m_y = old_m_y;
|
||||
}
|
||||
else
|
||||
else if (plr && plr->mo)
|
||||
{
|
||||
m_x = (plr->mo->x >> FRACTOMAPBITS) - m_w/2;
|
||||
m_y = (plr->mo->y >> FRACTOMAPBITS) - m_h/2;
|
||||
@@ -264,9 +265,6 @@ static void AM_findMinMaxBoundaries(void)
|
||||
max_w = minimapinfo.map_w << MAPBITS;
|
||||
max_h = minimapinfo.map_h << MAPBITS;
|
||||
|
||||
max_w = (max_x >>= FRACTOMAPBITS) - (min_x >>= FRACTOMAPBITS);
|
||||
max_h = (max_y >>= FRACTOMAPBITS) - (min_y >>= FRACTOMAPBITS);
|
||||
|
||||
a = FixedDiv(f_w<<FRACBITS, max_w);
|
||||
b = FixedDiv(f_h<<FRACBITS, max_h);
|
||||
|
||||
@@ -320,7 +318,8 @@ static void AM_initVariables(void)
|
||||
break;
|
||||
|
||||
plr = &players[pnum];
|
||||
if (plr != NULL && plr->mo != NULL)
|
||||
|
||||
if (plr && plr->mo)
|
||||
{
|
||||
m_x = (plr->mo->x >> FRACTOMAPBITS) - m_w/2;
|
||||
m_y = (plr->mo->y >> FRACTOMAPBITS) - m_h/2;
|
||||
@@ -424,6 +423,7 @@ static void AM_setWindowPanning(void)
|
||||
m_paninc.y = -FTOM(F_PANINC);
|
||||
else
|
||||
m_paninc.y = 0;
|
||||
|
||||
// left and right
|
||||
if (m_keydown[0]) // pan right
|
||||
m_paninc.x = FTOM(F_PANINC);
|
||||
@@ -598,6 +598,9 @@ static inline void AM_changeWindowScale(void)
|
||||
|
||||
static inline void AM_doFollowPlayer(void)
|
||||
{
|
||||
if (!plr || !plr->mo)
|
||||
return;
|
||||
|
||||
if (f_oldloc.x != plr->mo->x || f_oldloc.y != plr->mo->y)
|
||||
{
|
||||
m_x = FTOM(MTOF(plr->mo->x >> FRACTOMAPBITS)) - m_w/2;
|
||||
@@ -899,38 +902,74 @@ static void AM_drawGrid(INT32 color)
|
||||
}
|
||||
}
|
||||
|
||||
static INT32 GetDamage(INT32 special)
|
||||
{
|
||||
switch (special)
|
||||
{
|
||||
case 1: // Damage (Generic)
|
||||
return 1;
|
||||
case 6: // Death Pit (Camera Tilt)
|
||||
return 6;
|
||||
case 7: // Death Pit (No Camera Tilt)
|
||||
return 7;
|
||||
case 8: // Instant Kill
|
||||
return 8;
|
||||
default:
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
||||
static INT32 GetOffroad(INT32 special)
|
||||
{
|
||||
switch (special)
|
||||
{
|
||||
case 2: // Offroad (Weak)
|
||||
return 2;
|
||||
case 3: // Offroad
|
||||
return 3;
|
||||
case 4: // Offroad (Strong)
|
||||
return 4;
|
||||
default:
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
||||
#define SLOPEPARAMS(slope, end1, end2, normalheight) \
|
||||
if (slope) { \
|
||||
end1 = (P_GetZAt(slope, lines[i].v1->x, lines[i].v1->y) + FRACUNIT/2) >> FRACBITS; \
|
||||
end2 = (P_GetZAt(slope, lines[i].v2->x, lines[i].v2->y) + FRACUNIT/2) >> FRACBITS; \
|
||||
} else \
|
||||
end1 = end2 = (normalheight + FRACUNIT/2) >> FRACBITS;
|
||||
end1 = (P_GetZAt(slope, lines[i].v1->x, lines[i].v1->y, ((normalheight + FRACUNIT/2) >> FRACBITS)) + FRACUNIT/2) >> FRACBITS; \
|
||||
end2 = (P_GetZAt(slope, lines[i].v2->x, lines[i].v2->y, ((normalheight + FRACUNIT/2) >> FRACBITS)) + FRACUNIT/2) >> FRACBITS;
|
||||
|
||||
static ffloor_t *AM_CompareFOFs(size_t i, ffloor_t *rover, ffloor_t *secondarystore)
|
||||
{
|
||||
ffloor_t *secondaryrover = NULL;
|
||||
|
||||
for (; rover; rover = rover->next)
|
||||
{
|
||||
fixed_t rovt1, rovt2;
|
||||
fixed_t rovb1, rovb2;
|
||||
|
||||
if (!(rover->flags & FF_EXISTS))
|
||||
continue;
|
||||
if (!(rover->flags & FF_BLOCKPLAYER))
|
||||
continue;
|
||||
|
||||
SLOPEPARAMS(*rover->t_slope, rovt1, rovt2, *rover->topheight)
|
||||
SLOPEPARAMS(*rover->b_slope, rovb1, rovb2, *rover->bottomheight)
|
||||
|
||||
for (secondaryrover = secondarystore; secondaryrover; secondaryrover = secondaryrover->next)
|
||||
{
|
||||
fixed_t sect1, sect2;
|
||||
fixed_t secb1, secb2;
|
||||
|
||||
if (!(secondaryrover->flags & FF_EXISTS))
|
||||
continue;
|
||||
if (!(secondaryrover->flags & FF_BLOCKPLAYER))
|
||||
continue;
|
||||
if (secondaryrover->secnum == rover->secnum)
|
||||
break;
|
||||
|
||||
SLOPEPARAMS(*secondaryrover->t_slope, sect1, sect2, *secondaryrover->topheight)
|
||||
SLOPEPARAMS(*secondaryrover->b_slope, secb1, secb2, *secondaryrover->bottomheight)
|
||||
|
||||
if (rovt1 != sect1)
|
||||
continue;
|
||||
if (rovt2 != sect2)
|
||||
@@ -939,8 +978,27 @@ static ffloor_t *AM_CompareFOFs(size_t i, ffloor_t *rover, ffloor_t *secondaryst
|
||||
continue;
|
||||
if (rovb2 != secb2)
|
||||
continue;
|
||||
|
||||
// this is fucking horrible
|
||||
INT32 damage1, damage2;
|
||||
INT32 offroad1, offroad2;
|
||||
INT32 special1, special2;
|
||||
special1 = GETSECSPECIAL(sectors[rover->secnum].special, 1);
|
||||
special2 = GETSECSPECIAL(sectors[secondaryrover->secnum].special, 1);
|
||||
|
||||
damage1 = GetDamage(special1);
|
||||
damage2 = GetDamage(special2);
|
||||
offroad1 = GetOffroad(special1);
|
||||
offroad2 = GetOffroad(special2);
|
||||
|
||||
if (damage1 != damage2
|
||||
//|| sectors[rover->secnum].friction != sectors[secondaryrover->secnum].friction
|
||||
|| offroad1 != offroad2)
|
||||
continue;
|
||||
|
||||
break;
|
||||
}
|
||||
|
||||
if (secondaryrover == NULL)
|
||||
break;
|
||||
}
|
||||
@@ -983,8 +1041,10 @@ static void AM_drawWalls(UINT8 pass)
|
||||
}
|
||||
continue;
|
||||
}
|
||||
|
||||
SLOPEPARAMS(lines[i].backsector->f_slope, backf1, backf2, lines[i].backsector->floorheight)
|
||||
SLOPEPARAMS(lines[i].backsector->c_slope, backc1, backc2, lines[i].backsector->ceilingheight)
|
||||
|
||||
if ((backf1 == backc1 && backf2 == backc2) // Back is thok barrier
|
||||
|| (frontf1 == frontc1 && frontf2 == frontc2)) // Front is thok barrier
|
||||
{
|
||||
@@ -1003,29 +1063,28 @@ static void AM_drawWalls(UINT8 pass)
|
||||
}
|
||||
else
|
||||
{
|
||||
//dont think kart even supports those idk?
|
||||
/*if (lines[i].flags & (ML_IMPASSABLE|ML_BLOCKPLAYERS))
|
||||
if (lines[i].flags & ML_IMPASSIBLE) // (ML_IMPASSABLE|ML_BLOCKPLAYERS)
|
||||
{
|
||||
if (pass & PASS_SOLID)
|
||||
AM_drawMline(&l, TSWALLCOLORS); // Completely solid course boundary
|
||||
}
|
||||
else if ((lines[i].flags & ML_MIDSOLID)
|
||||
else if ((lines[i].flags & ML_EFFECT4) // ML_MIDSOLID
|
||||
&& sides[lines->sidenum[0]].midtexture)
|
||||
{
|
||||
if (pass & PASS_SOLID)
|
||||
AM_drawMline(&l, TSWALLCOLORS); // solid midtexture, likely a course boundary
|
||||
}*/
|
||||
}
|
||||
if ((backf1 != frontf1 && abs(backf1 - frontf1) > maxstep)
|
||||
|| (backf2 != frontf2 && abs(backf2 - frontf2) > maxstep))
|
||||
{
|
||||
if (pass & PASS_SOLID)
|
||||
AM_drawMline(&l, TSWALLCOLORS); // floor-wall, likely a course boundary
|
||||
}
|
||||
/*else if (lines[i].special == 2001) // guh its a sector effect in kart idk how to make it work tbh lol
|
||||
else if (GETSECSPECIAL(lines[i].frontsector->special, 4) == 10 || GETSECSPECIAL(lines[i].backsector->special, 4) == 10)
|
||||
{
|
||||
if (pass & PASS_SOLID)
|
||||
AM_drawMline(&l, TSFINISHLINE); // finish line
|
||||
}*/
|
||||
}
|
||||
else if (backf1 != frontf1 || backf2 != frontf2)
|
||||
{
|
||||
if (pass & PASS_INTANGIBLE)
|
||||
@@ -1047,54 +1106,52 @@ static void AM_drawWalls(UINT8 pass)
|
||||
}
|
||||
else
|
||||
{
|
||||
{
|
||||
ffloor_t *rover = NULL;
|
||||
ffloor_t *rover = NULL;
|
||||
|
||||
if (lines[i].frontsector->ffloors || lines[i].backsector->ffloors)
|
||||
if (lines[i].frontsector->ffloors || lines[i].backsector->ffloors)
|
||||
{
|
||||
if (lines[i].backsector->ffloors == NULL)
|
||||
{
|
||||
if (lines[i].backsector->ffloors == NULL)
|
||||
// Check frontside for one solid
|
||||
for (rover = lines[i].frontsector->ffloors; rover; rover = rover->next)
|
||||
{
|
||||
// Check frontside for one solid
|
||||
for (rover = lines[i].frontsector->ffloors; rover; rover = rover->next)
|
||||
{
|
||||
if (!(rover->flags & FF_EXISTS))
|
||||
continue;
|
||||
if (!(rover->flags & FF_BLOCKPLAYER))
|
||||
continue;
|
||||
break;
|
||||
}
|
||||
}
|
||||
else if (lines[i].frontsector->ffloors == NULL)
|
||||
{
|
||||
// Check backside for one solid
|
||||
for (rover = lines[i].backsector->ffloors; rover; rover = rover->next)
|
||||
{
|
||||
if (!(rover->flags & FF_EXISTS))
|
||||
continue;
|
||||
if (!(rover->flags & FF_BLOCKPLAYER))
|
||||
continue;
|
||||
break;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
// Check to see if any secnums exist in one but not the other.
|
||||
rover = AM_CompareFOFs(i, lines[i].frontsector->ffloors, lines[i].backsector->ffloors);
|
||||
if (rover == NULL)
|
||||
rover = AM_CompareFOFs(i, lines[i].backsector->ffloors, lines[i].frontsector->ffloors);
|
||||
if (!(rover->flags & FF_EXISTS))
|
||||
continue;
|
||||
if (!(rover->flags & FF_BLOCKPLAYER))
|
||||
continue;
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (rover != NULL)
|
||||
else if (lines[i].frontsector->ffloors == NULL)
|
||||
{
|
||||
if (pass & PASS_FOF)
|
||||
AM_drawMline(&l, TSFOFINFO); // a FOF is here but we don't know how to distinguish them yet
|
||||
// Check backside for one solid
|
||||
for (rover = lines[i].backsector->ffloors; rover; rover = rover->next)
|
||||
{
|
||||
if (!(rover->flags & FF_EXISTS))
|
||||
continue;
|
||||
if (!(rover->flags & FF_BLOCKPLAYER))
|
||||
continue;
|
||||
break;
|
||||
}
|
||||
}
|
||||
else if (!am_minigen)
|
||||
else
|
||||
{
|
||||
if (pass & PASS_INTANGIBLE)
|
||||
AM_drawMline(&l, GRIDCOLORS); // likely low-relevance line
|
||||
// Check to see if any secnums exist in one but not the other.
|
||||
rover = AM_CompareFOFs(i, lines[i].frontsector->ffloors, lines[i].backsector->ffloors);
|
||||
if (rover == NULL)
|
||||
rover = AM_CompareFOFs(i, lines[i].backsector->ffloors, lines[i].frontsector->ffloors);
|
||||
}
|
||||
}
|
||||
if (rover != NULL)
|
||||
{
|
||||
if (pass & PASS_FOF)
|
||||
AM_drawMline(&l, TSFOFINFO); // a FOF is here but we don't know how to distinguish them yet
|
||||
}
|
||||
else if (!am_minigen)
|
||||
{
|
||||
if (pass & PASS_INTANGIBLE)
|
||||
AM_drawMline(&l, GRIDCOLORS); // likely low-relevance line
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1172,18 +1229,11 @@ static inline void AM_drawPlayers(void)
|
||||
player_t *p;
|
||||
INT32 color = GREENS;
|
||||
|
||||
if (!multiplayer)
|
||||
{
|
||||
AM_drawLineCharacter(player_arrow, NUMPLYRLINES, 16<<FRACBITS, plr->mo->angle, DWHITE, plr->mo->x, plr->mo->y);
|
||||
return;
|
||||
}
|
||||
|
||||
// multiplayer (how??)
|
||||
for (i = 0; i < MAXPLAYERS; i++)
|
||||
{
|
||||
if (!playeringame[i] || players[i].spectator)
|
||||
continue;
|
||||
|
||||
|
||||
if (!players[i].mo)
|
||||
continue;
|
||||
|
||||
@@ -1205,7 +1255,36 @@ static inline void AM_drawThings(UINT8 colors)
|
||||
t = sectors[i].thinglist;
|
||||
while (t)
|
||||
{
|
||||
AM_drawLineCharacter(thintriangle_guy, NUMTHINTRIANGLEGUYLINES, 16<<FRACBITS, t->angle, colors, t->x, t->y);
|
||||
if (!t->player)
|
||||
AM_drawLineCharacter(thintriangle_guy, NUMTHINTRIANGLEGUYLINES, 16<<FRACBITS, t->angle, colors, t->x, t->y);
|
||||
t = t->snext;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
static inline void AM_drawSpecialThingsOnly(UINT8 colors)
|
||||
{
|
||||
size_t i;
|
||||
|
||||
for (i = 0; i < numsectors; i++)
|
||||
{
|
||||
mobj_t *t = NULL;
|
||||
|
||||
// this is fucking horrible
|
||||
const INT32 special = GETSECSPECIAL(sectors[i].special, 1);
|
||||
|
||||
if (GetDamage(special) != 0
|
||||
//|| sectors[i].friction < ORIG_FRICTION
|
||||
|| GetOffroad(special) != 0)
|
||||
continue;
|
||||
|
||||
t = sectors[i].thinglist;
|
||||
while (t)
|
||||
{
|
||||
if (t->type == MT_RANDOMITEM
|
||||
|| t->type == MT_STARPOST
|
||||
|| (t->flags & MF_SPRING))
|
||||
AM_drawLineCharacter(thintriangle_guy, NUMTHINTRIANGLEGUYLINES, 16<<FRACBITS, t->angle, colors, t->x, t->y);
|
||||
t = t->snext;
|
||||
}
|
||||
}
|
||||
@@ -1220,16 +1299,19 @@ static inline void AM_drawCrosshair(UINT8 color)
|
||||
const fixed_t scale = 4<<FRACBITS;
|
||||
size_t i;
|
||||
fline_t fl;
|
||||
|
||||
for (i = 0; i < NUMCROSSMARKLINES; i++)
|
||||
{
|
||||
fl.a.x = FixedMul(cross_mark[i].a.x, scale) >> FRACBITS;
|
||||
fl.a.y = FixedMul(cross_mark[i].a.y, scale) >> FRACBITS;
|
||||
fl.b.x = FixedMul(cross_mark[i].b.x, scale) >> FRACBITS;
|
||||
fl.b.y = FixedMul(cross_mark[i].b.y, scale) >> FRACBITS;
|
||||
|
||||
fl.a.x += f_x + (f_w / 2);
|
||||
fl.a.y += f_y + (f_h / 2);
|
||||
fl.b.x += f_x + (f_w / 2);
|
||||
fl.b.y += f_y + (f_h / 2);
|
||||
|
||||
AM_drawFline(&fl, color);
|
||||
}
|
||||
}
|
||||
@@ -1250,8 +1332,8 @@ void AM_Drawer(void)
|
||||
AM_clearFB(BACKGROUND);
|
||||
if (draw_grid) AM_drawGrid(GRIDCOLORS);
|
||||
AM_drawWalls(PASS_FOF|PASS_INTANGIBLE|PASS_SOLID);
|
||||
AM_drawPlayers();
|
||||
AM_drawThings(THINGCOLORS);
|
||||
AM_drawPlayers();
|
||||
|
||||
if (!followplayer) AM_drawCrosshair(XHAIRCOLORS);
|
||||
}
|
||||
@@ -1307,6 +1389,7 @@ minigen_t *AM_MinimapGenerate(INT32 mul)
|
||||
|
||||
//AM_clearFB(BACKGROUND);
|
||||
memset(am_buf, 0xff, (f_w*f_h));
|
||||
AM_drawSpecialThingsOnly(BACKGROUND);
|
||||
AM_drawWalls(PASS_FOF);
|
||||
AM_drawWalls(PASS_INTANGIBLE);
|
||||
AM_drawWalls(PASS_SOLID);
|
||||
|
||||
+2
-16
@@ -240,7 +240,6 @@ void COM_ImmedExecute(const char *ptext)
|
||||
|
||||
while (i < strlen(ptext))
|
||||
{
|
||||
|
||||
quotes = 0;
|
||||
for (j = 0; i < strlen(ptext); i++,j++)
|
||||
{
|
||||
@@ -1493,11 +1492,7 @@ static void Got_NetVar(UINT8 **p, INT32 playernum)
|
||||
|
||||
if (server)
|
||||
{
|
||||
UINT8 buf[2];
|
||||
|
||||
buf[0] = (UINT8)playernum;
|
||||
buf[1] = KICK_MSG_CON_FAIL;
|
||||
SendNetXCmd(XD_KICK, &buf, 2);
|
||||
SendKick(playernum, KICK_MSG_CON_FAIL);
|
||||
}
|
||||
return;
|
||||
}
|
||||
@@ -1988,7 +1983,7 @@ static boolean CV_FilterJoyAxisVars(consvar_t *v, const char *valstr)
|
||||
return true;
|
||||
}
|
||||
|
||||
// Block the Xbox DInput default axes and reset to the current defaults
|
||||
// Block the Xbox DInput default axes and reset to the current defaults
|
||||
static boolean CV_FilterJoyAxisVars2(consvar_t *v, const char *valstr)
|
||||
{
|
||||
if (!stricmp(v->name, "joyaxis_turn") && !stricmp(valstr, "X-Axis"))
|
||||
@@ -2045,15 +2040,6 @@ static boolean CV_FilterVarByVersion(consvar_t *v, const char *valstr)
|
||||
|
||||
if (GETMAJOREXECVERSION(cv_execversion.value) < 2) // 2 = 1.0.2
|
||||
{
|
||||
#if 0
|
||||
// We don't have changed saved cvars yet
|
||||
if (!stricmp(v->name, "alwaysmlook")
|
||||
|| !stricmp(v->name, "alwaysmlook2")
|
||||
|| !stricmp(v->name, "mousemove")
|
||||
|| !stricmp(v->name, "mousemove2"))
|
||||
return false;
|
||||
#endif
|
||||
|
||||
// axis defaults were changed to be friendly to 360 controllers
|
||||
// if ALL axis settings are defaults, then change them to new values
|
||||
if (!CV_FilterJoyAxisVars(v, valstr))
|
||||
|
||||
+36
-32
@@ -275,29 +275,28 @@ void CON_SetupBackColormap(void)
|
||||
|
||||
switch (cons_backcolor.value)
|
||||
{
|
||||
case 0: palindex = 15; break; // White
|
||||
case 1: palindex = 31; break; // Gray
|
||||
case 2: palindex = 47; break; // Sepia
|
||||
case 3: palindex = 63; break; // Brown
|
||||
case 4: palindex = 150; shift = 7; break; // Pink
|
||||
case 5: palindex = 127; shift = 7; break; // Raspberry
|
||||
case 6: palindex = 143; break; // Red
|
||||
case 7: palindex = 86; shift = 7; break; // Creamsicle
|
||||
case 8: palindex = 95; break; // Orange
|
||||
case 9: palindex = 119; shift = 7; break; // Gold
|
||||
case 10: palindex = 111; break; // Yellow
|
||||
case 11: palindex = 191; shift = 7; break; // Emerald
|
||||
case 12: palindex = 175; break; // Green
|
||||
case 13: palindex = 219; break; // Cyan
|
||||
case 14: palindex = 207; shift = 7; break; // Steel
|
||||
case 15: palindex = 230; shift = 7; break; // Periwinkle
|
||||
case 16: palindex = 239; break; // Blue
|
||||
case 17: palindex = 199; shift = 7; break; // Purple
|
||||
case 18: palindex = 255; shift = 7; break; // Lavender
|
||||
case 0: palindex = 15; break; // White
|
||||
case 1: palindex = 31; break; // Gray
|
||||
case 2: palindex = 47; break; // Sepia
|
||||
case 3: palindex = 63; break; // Brown
|
||||
case 4: palindex = 150; shift = 7; break; // Pink
|
||||
case 5: palindex = 127; shift = 7; break; // Raspberry
|
||||
case 6: palindex = 143; break; // Red
|
||||
case 7: palindex = 86; shift = 7; break; // Creamsicle
|
||||
case 8: palindex = 95; break; // Orange
|
||||
case 9: palindex = 119; shift = 7; break; // Gold
|
||||
case 10: palindex = 111; break; // Yellow
|
||||
case 11: palindex = 191; shift = 7; break; // Emerald
|
||||
case 12: palindex = 175; break; // Green
|
||||
case 13: palindex = 219; break; // Cyan
|
||||
case 14: palindex = 207; shift = 7; break; // Steel
|
||||
case 15: palindex = 230; shift = 7; break; // Periwinkle
|
||||
case 16: palindex = 239; break; // Blue
|
||||
case 17: palindex = 199; shift = 7; break; // Purple
|
||||
case 18: palindex = 255; shift = 7; break; // Lavender
|
||||
// Default green
|
||||
default: palindex = 175; break;
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
// setup background colormap
|
||||
for (i = 0, j = 0; i < 768; i += 3, j++)
|
||||
@@ -621,11 +620,11 @@ static void CON_MoveConsole(void)
|
||||
con_curlines -= FixedInt(fracmovement);
|
||||
if (con_curlines < con_destlines)
|
||||
con_curlines = con_destlines;
|
||||
|
||||
|
||||
if (con_destlines == 0) // If the console is being closed, not just moved up...
|
||||
con_tick = 0; // ...don't show the blinking cursor
|
||||
}
|
||||
|
||||
|
||||
fracmovement %= FRACUNIT; // Reset fracmovement's integer value, but keep the fraction
|
||||
|
||||
Unlock_state();
|
||||
@@ -635,7 +634,7 @@ INT32 CON_ShiftChar(INT32 ch)
|
||||
{
|
||||
if (I_UseNativeKeyboard())
|
||||
return ch;
|
||||
|
||||
|
||||
if ((ch >= 'a' && ch <= 'z') || (ch >= 'A' && ch <= 'Z'))
|
||||
{
|
||||
if (cv_keyboardlayout.value == 3)
|
||||
@@ -827,7 +826,7 @@ boolean CON_Responder(event_t *ev)
|
||||
// let go keyup events, don't eat them
|
||||
if (ev->type != ev_keydown && ev->type != ev_console)
|
||||
{
|
||||
if (ev->data1 == gamecontrol[gc_console][0] || ev->data1 == gamecontrol[gc_console][1])
|
||||
if (ev->data1 == gamecontrol[0][gc_console][0] || ev->data1 == gamecontrol[0][gc_console][1])
|
||||
consdown = false;
|
||||
return false;
|
||||
}
|
||||
@@ -845,7 +844,7 @@ boolean CON_Responder(event_t *ev)
|
||||
INT32 i;
|
||||
for (i = 0; i < num_gamecontrols; i++)
|
||||
{
|
||||
if (gamecontrol[i][0] == ev->data1 || gamecontrol[i][1] == ev->data1)
|
||||
if (gamecontrol[0][i][0] == ev->data1 || gamecontrol[0][i][1] == ev->data1)
|
||||
break;
|
||||
}
|
||||
|
||||
@@ -853,7 +852,7 @@ boolean CON_Responder(event_t *ev)
|
||||
return false;
|
||||
}
|
||||
|
||||
if (key == gamecontrol[gc_console][0] || key == gamecontrol[gc_console][1])
|
||||
if (key == gamecontrol[0][gc_console][0] || key == gamecontrol[0][gc_console][1])
|
||||
{
|
||||
if (consdown) // ignore repeat
|
||||
return true;
|
||||
@@ -1244,7 +1243,7 @@ void CONS_Printf(const char *fmt, ...)
|
||||
|
||||
if (con_started)
|
||||
CON_Print(txt);
|
||||
|
||||
|
||||
CON_LogMessage(txt);
|
||||
|
||||
Lock_state();
|
||||
@@ -1334,7 +1333,12 @@ void CONS_Error(const char *msg)
|
||||
|
||||
// dirty quick hack, but for the good cause
|
||||
while (I_GetKey() != KEY_ENTER)
|
||||
{
|
||||
// Sleep so we don't take too much of cpu usage
|
||||
I_Sleep(1.f/TICRATE*1000);
|
||||
|
||||
I_OsPolling();
|
||||
}
|
||||
}
|
||||
|
||||
//======================================================================
|
||||
@@ -1474,7 +1478,7 @@ static void CON_DrawHudlines(void)
|
||||
;//charwidth = 4 * con_scalefactor;
|
||||
else
|
||||
{
|
||||
//charwidth = SHORT(hu_font['A'-HU_FONTSTART]->width) * con_scalefactor;
|
||||
//charwidth = hu_font['A'-HU_FONTSTART]->width * con_scalefactor;
|
||||
V_DrawCharacter(x, y, (INT32)(*p) | charflags | cv_constextsize.value | V_NOSCALESTART, !cv_allcaps.value);
|
||||
}
|
||||
}
|
||||
@@ -1509,7 +1513,7 @@ static void CON_DrawConsole(void)
|
||||
// draw console background
|
||||
if (cons_backpic.value || con_forcepic)
|
||||
{
|
||||
patch_t *con_backpic = W_CachePatchName("KARTKREW", PU_CACHE);
|
||||
patch_t *con_backpic = W_CachePatchName("KARTKREW", PU_PATCH_LOWPRIORITY);
|
||||
|
||||
// Jimita: CON_DrawBackpic just called V_DrawScaledPatch
|
||||
V_DrawFixedPatch(0, 0, FRACUNIT/2, 0, con_backpic, NULL);
|
||||
@@ -1577,11 +1581,11 @@ void CON_Drawer(void)
|
||||
if (con_recalc)
|
||||
{
|
||||
CON_RecalcSize();
|
||||
|
||||
|
||||
if (con_curlines <= 0)
|
||||
CON_ClearHUD();
|
||||
}
|
||||
|
||||
|
||||
// console movement
|
||||
if (con_curlines != con_destlines)
|
||||
CON_MoveConsole();
|
||||
|
||||
+209
-286
File diff suppressed because it is too large.
Load diff
+9
-5
@@ -108,12 +108,11 @@ typedef enum
|
||||
|
||||
PT_PING, // Packet sent to tell clients the other client's latency to server.
|
||||
|
||||
#ifdef SATURNSYNCH
|
||||
#ifdef SATURNPAK
|
||||
PT_WILLRESENDGAMESTATE, // Hey Client, I am about to resend you the gamestate!
|
||||
PT_CANRECEIVEGAMESTATE, // Okay Server, I'm ready to receive it, you can go ahead.
|
||||
PT_RECEIVEDGAMESTATE, // Thank you Server, I am ready to play again!
|
||||
|
||||
// we will reserve this for now even if unused, so order wont get mangled
|
||||
PT_ISSATURN, // Saturn specific identifier packet
|
||||
#endif
|
||||
|
||||
@@ -394,6 +393,7 @@ typedef struct
|
||||
#define MAXSERVERNAME 32
|
||||
#define MAXFILENEEDED 915
|
||||
#define MAX_MIRROR_LENGTH 256
|
||||
|
||||
// This packet is too large
|
||||
typedef struct
|
||||
{
|
||||
@@ -588,7 +588,7 @@ extern tic_t servermaxping;
|
||||
extern boolean server_lagless;
|
||||
extern tic_t simulated_lag;
|
||||
extern tic_t lowest_lag;
|
||||
extern consvar_t cv_mindelay, cv_lagless;
|
||||
extern consvar_t cv_mindelay, cv_gentlemens;
|
||||
|
||||
extern consvar_t
|
||||
#ifdef VANILLAJOINNEXTROUND
|
||||
@@ -599,7 +599,7 @@ extern consvar_t
|
||||
cv_allownewsaturnplayer,
|
||||
#endif
|
||||
cv_joinrefusemessage, cv_maxplayers, cv_resynchattempts,
|
||||
#ifdef SATURNSYNCH
|
||||
#ifdef SATURNPAK
|
||||
cv_resynchcooldown, cv_gamestateattempts,
|
||||
#endif
|
||||
cv_blamecfail, cv_maxsend, cv_noticedownload, cv_downloadspeed;
|
||||
@@ -616,6 +616,7 @@ void D_ClientServerInit(void);
|
||||
void RegisterNetXCmd(netxcmd_t id, void (*cmd_f)(UINT8 **p, INT32 playernum));
|
||||
void SendNetXCmdForPlayer(UINT8 playerid, netxcmd_t id, const void *param, size_t nparam);
|
||||
#define SendNetXCmd(id, param, nparam) SendNetXCmdForPlayer(0, id, param, nparam) // Shortcut for P1
|
||||
void SendKick(UINT8 playernum, UINT8 msg);
|
||||
|
||||
// Create any new ticcmds and broadcast to other players.
|
||||
void NetKeepAlive(void);
|
||||
@@ -634,6 +635,9 @@ void CL_RemovePlayer(INT32 playernum, INT32 reason);
|
||||
void CL_QueryServerList(msg_server_t *list);
|
||||
void CL_UpdateServerList(void);
|
||||
void CL_TimeoutServerList(void);
|
||||
|
||||
void CL_AbortConnection(void);
|
||||
|
||||
// Is there a game running
|
||||
boolean Playing(void);
|
||||
|
||||
@@ -666,7 +670,7 @@ tic_t GetLag(INT32 node);
|
||||
//UINT8 GetFreeXCmdSize(UINT8 playerid);
|
||||
|
||||
extern UINT8 hu_resynching;
|
||||
#ifdef SATURNSYNCH
|
||||
#ifdef SATURNPAK
|
||||
extern UINT8 hu_redownloadinggamestate;
|
||||
#endif
|
||||
extern boolean hu_stopped; // kart, true when the game is stopped for players due to a disconnecting or connecting player
|
||||
|
||||
+426
-295
@@ -147,7 +147,7 @@ INT32 eventhead, eventtail;
|
||||
|
||||
boolean dedicated = false;
|
||||
|
||||
boolean loaded_config = false;
|
||||
boolean loaded_config = false; // true once config.cfg loaded AND executed
|
||||
|
||||
//
|
||||
// D_PostEvent
|
||||
@@ -166,58 +166,64 @@ UINT8 ctrldown = 0; // 0x1 left, 0x2 right
|
||||
UINT8 altdown = 0; // 0x1 left, 0x2 right
|
||||
boolean capslock = 0; // gee i wonder what this does.
|
||||
|
||||
static void D_PadMenuScrollInput(int input)
|
||||
static void D_PadMenuScrollInput(UINT8 input)
|
||||
{
|
||||
event_t myev = {0, 0, 0, 0};
|
||||
myev.type = ev_keydown;
|
||||
myev.data1 = input;
|
||||
D_PostEvent(&myev); // put into eventlist
|
||||
event_t dpadev;
|
||||
memset(&dpadev, 0, sizeof(event_t));
|
||||
dpadev.type = ev_keydown;
|
||||
|
||||
switch (input)
|
||||
{
|
||||
case DPAD_UP:
|
||||
dpadev.data1 = KEY_UPARROW;
|
||||
break;
|
||||
case DPAD_DOWN:
|
||||
dpadev.data1 = KEY_DOWNARROW;
|
||||
break;
|
||||
case DPAD_LEFT:
|
||||
dpadev.data1 = KEY_LEFTARROW;
|
||||
break;
|
||||
case DPAD_RIGHT:
|
||||
dpadev.data1 = KEY_RIGHTARROW;
|
||||
break;
|
||||
}
|
||||
|
||||
D_PostEvent(&dpadev); // put into eventlist
|
||||
}
|
||||
|
||||
#define SCROLLDELAY 19 // TICRATE * ( (k+2) (1 - [wz + h + j - q]^2 - [(gk + 2g + k + 1)(h + j) + h - z]^2 - [16(k + 1)^3(k + 2)(n + 1)^2 + 1 - f^2]^2 calculated by my butt
|
||||
#define SCROLLDELAY 19
|
||||
|
||||
// this is absolutely awful and i hate it lmao
|
||||
// but le hAx0r to make dpad also be able to scroll in the menu
|
||||
// Check if any dpad button is held
|
||||
// and pass it to the eventlist
|
||||
static void D_GamePadMenuScrollTicker(void)
|
||||
{
|
||||
static SINT8 menuInputDelayTimer = 0;
|
||||
int key = 0; // butt-on output
|
||||
UINT8 i;
|
||||
static UINT8 menuInputDelayTimer = 0;
|
||||
|
||||
if (dedicated)
|
||||
return;
|
||||
|
||||
// wish i had a switch ono
|
||||
if (DPADUPSCROLL)
|
||||
key = KEY_UPARROW;
|
||||
else if (DPADDOWNSCROLL)
|
||||
key = KEY_DOWNARROW;
|
||||
else if (DPADLEFTSCROLL)
|
||||
key = KEY_LEFTARROW;
|
||||
else if (DPADRIGHTSCROLL)
|
||||
key = KEY_RIGHTARROW;
|
||||
|
||||
if (key)
|
||||
for (i = 0; i < MAXSPLITSCREENPLAYERS; i++)
|
||||
{
|
||||
if (menuInputDelayTimer < SCROLLDELAY)
|
||||
menuInputDelayTimer++;
|
||||
if (dpadscrollstate[i])
|
||||
{
|
||||
if (menuInputDelayTimer < SCROLLDELAY)
|
||||
menuInputDelayTimer++;
|
||||
else if (menuInputDelayTimer == SCROLLDELAY)
|
||||
D_PadMenuScrollInput(i);
|
||||
|
||||
if (menuInputDelayTimer == SCROLLDELAY)
|
||||
D_PadMenuScrollInput(key);
|
||||
}
|
||||
else
|
||||
{
|
||||
menuInputDelayTimer = 0;
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
menuInputDelayTimer = 0;
|
||||
}
|
||||
#undef SCROLLDELAY
|
||||
|
||||
static void D_DeviceLEDTick(void)
|
||||
{
|
||||
UINT8 i;
|
||||
static UINT16 color[MAXSPLITSCREENPLAYERS] = {0, 0, 0, 0};
|
||||
static UINT16 curcolor[MAXSPLITSCREENPLAYERS] = {0, 0, 0, 0};
|
||||
static UINT16 color[MAXSPLITSCREENPLAYERS] = {0};
|
||||
static UINT16 curcolor[MAXSPLITSCREENPLAYERS] = {0};
|
||||
|
||||
if (dedicated || numcontrollers == 0)
|
||||
if (numcontrollers == 0)
|
||||
{
|
||||
return;
|
||||
}
|
||||
@@ -244,7 +250,6 @@ static void D_DeviceLEDTick(void)
|
||||
void D_ProcessEvents(void)
|
||||
{
|
||||
event_t *ev;
|
||||
|
||||
boolean eaten;
|
||||
|
||||
for (; eventtail != eventhead; eventtail = (eventtail+1) & (MAXEVENTS-1))
|
||||
@@ -283,8 +288,10 @@ void D_ProcessEvents(void)
|
||||
|
||||
// Demo input:
|
||||
if (demo.playback)
|
||||
{
|
||||
if (M_DemoResponder(ev))
|
||||
continue; // demo ate the event
|
||||
}
|
||||
|
||||
// console input
|
||||
#ifdef HAVE_THREADS
|
||||
@@ -309,6 +316,88 @@ void D_ProcessEvents(void)
|
||||
// draw current display, possibly wiping it from the previous
|
||||
//
|
||||
|
||||
static void D_Renderview(void)
|
||||
{
|
||||
UINT8 i;
|
||||
|
||||
if (automapactive)
|
||||
return;
|
||||
|
||||
R_ApplyLevelInterpolators(rendertimefrac);
|
||||
|
||||
for (i = 0; i <= splitscreen; i++)
|
||||
{
|
||||
const boolean issplitscreen = (i > 0);
|
||||
|
||||
if (!P_MobjWasRemoved(players[displayplayers[i]].mo) || players[displayplayers[i]].playerstate == PST_DEAD)
|
||||
{
|
||||
viewssnum = i;
|
||||
|
||||
if (!issplitscreen) // Initialize for P1
|
||||
{
|
||||
viewwindowy = viewwindowx = 0;
|
||||
topleft = screens[0];
|
||||
objectsdrawn = 0;
|
||||
}
|
||||
|
||||
#ifdef HWRENDER
|
||||
if (rendermode == render_opengl)
|
||||
{
|
||||
HWR_RenderPlayerView();
|
||||
R_RestoreLevelInterpolators();
|
||||
return;
|
||||
}
|
||||
#endif
|
||||
if (issplitscreen) // Splitscreen-specific
|
||||
{
|
||||
const INT32 len = viewheight*sizeof(ylookup[0]);
|
||||
|
||||
switch (i)
|
||||
{
|
||||
case 1:
|
||||
if (splitscreen > 1)
|
||||
{
|
||||
viewwindowx = viewwidth;
|
||||
viewwindowy = 0;
|
||||
}
|
||||
else
|
||||
{
|
||||
viewwindowx = 0;
|
||||
viewwindowy = viewheight;
|
||||
}
|
||||
M_Memcpy(ylookup, ylookup2, len);
|
||||
break;
|
||||
case 2:
|
||||
viewwindowx = 0;
|
||||
viewwindowy = viewheight;
|
||||
M_Memcpy(ylookup, ylookup3, len);
|
||||
break;
|
||||
case 3:
|
||||
viewwindowx = viewwidth;
|
||||
viewwindowy = viewheight;
|
||||
M_Memcpy(ylookup, ylookup4, len);
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
topleft = screens[0] + viewwindowy*vid.width + viewwindowx;
|
||||
}
|
||||
|
||||
R_RenderPlayerView(&players[displayplayers[i]]);
|
||||
|
||||
if (issplitscreen)
|
||||
M_Memcpy(ylookup, ylookup1, viewheight*sizeof (ylookup[0]));
|
||||
}
|
||||
|
||||
if (!issplitscreen)
|
||||
R_ApplyViewMorph();
|
||||
|
||||
V_DoPostProcessor(i, postimgparam[i]);
|
||||
}
|
||||
|
||||
R_RestoreLevelInterpolators();
|
||||
}
|
||||
|
||||
// wipegamestate can be set to -1 to force a wipe on the next draw
|
||||
// added comment : there is a wipe eatch change of the gamestate
|
||||
gamestate_t wipegamestate = GS_LEVEL;
|
||||
@@ -319,7 +408,6 @@ static boolean D_Display(void)
|
||||
boolean forcerefresh = false;
|
||||
static boolean wipe = false;
|
||||
INT32 wipedefindex = 0;
|
||||
UINT8 i;
|
||||
|
||||
if (!dedicated)
|
||||
{
|
||||
@@ -358,6 +446,7 @@ static boolean D_Display(void)
|
||||
{
|
||||
// set for all later
|
||||
wipedefindex = gamestate; // wipe_xxx_toblack
|
||||
|
||||
if (gamestate == GS_TITLESCREEN && wipegamestate != GS_INTRO)
|
||||
wipedefindex = wipe_timeattack_toblack;
|
||||
else if (gamestate == GS_INTERMISSION)
|
||||
@@ -370,26 +459,28 @@ static boolean D_Display(void)
|
||||
|
||||
if (!dedicated)
|
||||
{
|
||||
// Fade to black first
|
||||
if (gamestate != GS_LEVEL // fades to black on its own timing, always
|
||||
&& wipedefs[wipedefindex] != UINT8_MAX)
|
||||
if (gamestate != GS_LEVEL)
|
||||
{
|
||||
F_WipeStartScreen();
|
||||
V_DrawFill(0, 0, BASEVIDWIDTH, BASEVIDHEIGHT, 31);
|
||||
F_WipeEndScreen();
|
||||
F_RunWipe(wipedefs[wipedefindex], gamestate != GS_TIMEATTACK);
|
||||
ranwipe = true;
|
||||
}
|
||||
// Fade to black first
|
||||
if (wipedefs[wipedefindex] != UINT8_MAX) // fades to black on its own timing, always
|
||||
{
|
||||
F_WipeStartScreen();
|
||||
V_DrawFill(0, 0, BASEVIDWIDTH, BASEVIDHEIGHT, 31);
|
||||
F_WipeEndScreen();
|
||||
F_RunWipe(wipedefs[wipedefindex], gamestate != GS_TIMEATTACK);
|
||||
ranwipe = true;
|
||||
}
|
||||
|
||||
if (gamestate != GS_LEVEL && rendermode != render_none)
|
||||
{
|
||||
V_SetPaletteLump("PLAYPAL"); // Reset the palette
|
||||
R_ReInitColormaps(0, LUMPERROR);
|
||||
if (rendermode != render_none)
|
||||
{
|
||||
V_SetPaletteLump("PLAYPAL"); // Reset the palette
|
||||
R_ReInitColormaps(0, LUMPERROR);
|
||||
}
|
||||
}
|
||||
|
||||
F_WipeStartScreen();
|
||||
}
|
||||
else //dedicated servers
|
||||
else // dedicated servers
|
||||
{
|
||||
F_RunWipe(wipedefs[wipedefindex], gamestate != GS_TIMEATTACK);
|
||||
ranwipe = true;
|
||||
@@ -397,7 +488,7 @@ static boolean D_Display(void)
|
||||
}
|
||||
}
|
||||
|
||||
if (dedicated) //bail out after wipe logic
|
||||
if (dedicated) // bail out after wipe logic
|
||||
return false;
|
||||
|
||||
// do buffered drawing
|
||||
@@ -422,9 +513,6 @@ static boolean D_Display(void)
|
||||
HU_Drawer();
|
||||
break;
|
||||
|
||||
case GS_TIMEATTACK:
|
||||
break;
|
||||
|
||||
case GS_INTRO:
|
||||
F_IntroDrawer();
|
||||
if (wipegamestate == (gamestate_t)-1)
|
||||
@@ -464,6 +552,7 @@ static boolean D_Display(void)
|
||||
F_TitleScreenDrawer();
|
||||
if (wipe)
|
||||
wipedefindex = wipe_titlescreen_toblack;
|
||||
HU_DrawSongCredits();
|
||||
break;
|
||||
|
||||
case GS_WAITINGPLAYERS:
|
||||
@@ -475,6 +564,7 @@ static boolean D_Display(void)
|
||||
HU_Erase();
|
||||
HU_Drawer();
|
||||
}
|
||||
case GS_TIMEATTACK:
|
||||
case GS_DEDICATEDSERVER:
|
||||
case GS_NULL:
|
||||
break;
|
||||
@@ -483,89 +573,10 @@ static boolean D_Display(void)
|
||||
if (gamestate == GS_LEVEL)
|
||||
{
|
||||
// draw the view directly
|
||||
if (cv_renderview.value && !automapactive)
|
||||
if (cv_renderview.value)
|
||||
{
|
||||
PS_START_TIMING(ps_rendercalltime);
|
||||
|
||||
R_ApplyLevelInterpolators(rendertimefrac);
|
||||
|
||||
for (i = 0; i <= splitscreen; i++)
|
||||
{
|
||||
if (!P_MobjWasRemoved(players[displayplayers[i]].mo) || players[displayplayers[i]].playerstate == PST_DEAD)
|
||||
{
|
||||
viewssnum = i;
|
||||
|
||||
if (i == 0) // Initialize for P1
|
||||
{
|
||||
viewwindowy = 0;
|
||||
viewwindowx = 0;
|
||||
|
||||
topleft = screens[0] + viewwindowy*vid.width + viewwindowx;
|
||||
objectsdrawn = 0;
|
||||
}
|
||||
|
||||
#ifdef HWRENDER
|
||||
if (rendermode == render_opengl)
|
||||
HWR_RenderPlayerView();
|
||||
else
|
||||
#endif
|
||||
if (rendermode != render_none)
|
||||
{
|
||||
if (i > 0) // Splitscreen-specific
|
||||
{
|
||||
switch (i)
|
||||
{
|
||||
case 1:
|
||||
if (splitscreen > 1)
|
||||
{
|
||||
viewwindowx = viewwidth;
|
||||
viewwindowy = 0;
|
||||
}
|
||||
else
|
||||
{
|
||||
viewwindowx = 0;
|
||||
viewwindowy = viewheight;
|
||||
}
|
||||
M_Memcpy(ylookup, ylookup2, viewheight*sizeof (ylookup[0]));
|
||||
break;
|
||||
case 2:
|
||||
viewwindowx = 0;
|
||||
viewwindowy = viewheight;
|
||||
M_Memcpy(ylookup, ylookup3, viewheight*sizeof (ylookup[0]));
|
||||
break;
|
||||
case 3:
|
||||
viewwindowx = viewwidth;
|
||||
viewwindowy = viewheight;
|
||||
M_Memcpy(ylookup, ylookup4, viewheight*sizeof (ylookup[0]));
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
|
||||
topleft = screens[0] + viewwindowy*vid.width + viewwindowx;
|
||||
}
|
||||
|
||||
R_RenderPlayerView(&players[displayplayers[i]]);
|
||||
|
||||
if (i > 0)
|
||||
M_Memcpy(ylookup, ylookup1, viewheight*sizeof (ylookup[0]));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (rendermode == render_soft)
|
||||
{
|
||||
if (!splitscreen)
|
||||
R_ApplyViewMorph();
|
||||
|
||||
for (i = 0; i <= splitscreen; i++)
|
||||
{
|
||||
V_DoPostProcessor(i, postimgparam[i]);
|
||||
}
|
||||
}
|
||||
|
||||
R_RestoreLevelInterpolators();
|
||||
|
||||
D_Renderview();
|
||||
PS_STOP_TIMING(ps_rendercalltime);
|
||||
}
|
||||
|
||||
@@ -575,6 +586,7 @@ static boolean D_Display(void)
|
||||
{
|
||||
VID_BlitLinearScreen(screens[0], screens[1], vid.width*vid.bpp, vid.height, vid.width*vid.bpp, vid.rowbytes);
|
||||
}
|
||||
|
||||
lastdraw = false;
|
||||
}
|
||||
|
||||
@@ -597,14 +609,9 @@ static boolean D_Display(void)
|
||||
// draw pause pic
|
||||
if (paused && cv_showhud.value && !demo.playback)
|
||||
{
|
||||
INT32 py;
|
||||
patch_t *patch;
|
||||
if (automapactive)
|
||||
py = 4;
|
||||
else
|
||||
py = viewwindowy + 4;
|
||||
patch = W_CachePatchName("M_PAUSE", PU_CACHE);
|
||||
V_DrawScaledPatch(viewwindowx + (BASEVIDWIDTH - SHORT(patch->width))/2, py, V_SNAPTOTOP, patch);
|
||||
INT32 py = (automapactive) ? 4 : (viewwindowy + 4);
|
||||
patch_t *patch = W_CachePatchName("M_PAUSE", PU_PATCH);
|
||||
V_DrawScaledPatch(viewwindowx + (BASEVIDWIDTH - patch->width)/2, py, V_SNAPTOTOP, patch);
|
||||
}
|
||||
|
||||
if (rendermode == render_soft && demo.rewinding)
|
||||
@@ -641,6 +648,8 @@ static boolean D_Display(void)
|
||||
}
|
||||
}
|
||||
|
||||
NetUpdate(); // send out any new accumulation
|
||||
|
||||
// It's safe to end the game now.
|
||||
if (G_GetExitGameFlag())
|
||||
{
|
||||
@@ -731,7 +740,7 @@ void D_SRB2Loop(void)
|
||||
COM_ImmedExecute("cls;version");
|
||||
|
||||
if (rendermode == render_soft)
|
||||
V_DrawFixedPatch(0, 0, FRACUNIT/2, 0, (patch_t *)W_CacheLumpNum(W_GetNumForName("KARTKREW"), PU_CACHE), NULL);
|
||||
V_DrawFixedPatch(0, 0, FRACUNIT/2, 0, W_CachePatchNum(W_GetNumForName("KARTKREW"), PU_PATCH_LOWPRIORITY), NULL);
|
||||
I_FinishUpdate(); // page flip or blit buffer
|
||||
|
||||
for (;;)
|
||||
@@ -743,7 +752,7 @@ void D_SRB2Loop(void)
|
||||
|
||||
// Casting the return value of a function is bad practice (apparently)
|
||||
double budget = ((R_GetFramerateCap() == 0) ? 0.0 : round((1.0 / R_GetFramerateCap()) * I_GetPrecisePrecision()));
|
||||
capbudget = (precise_t) budget;
|
||||
capbudget = (precise_t)budget;
|
||||
|
||||
boolean ranwipe = false;
|
||||
|
||||
@@ -813,19 +822,29 @@ void D_SRB2Loop(void)
|
||||
doDisplay = true;
|
||||
}
|
||||
|
||||
if (menuactive)
|
||||
if (!dedicated)
|
||||
{
|
||||
D_GamePadMenuScrollTicker();
|
||||
}
|
||||
if (menuactive)
|
||||
{
|
||||
D_GamePadMenuScrollTicker();
|
||||
}
|
||||
|
||||
D_DeviceLEDTick();
|
||||
D_DeviceLEDTick();
|
||||
}
|
||||
}
|
||||
|
||||
if (interp)
|
||||
{
|
||||
renderdeltatics = FLOAT_TO_FIXED(deltatics);
|
||||
renderdeltatics = FloatToFixed(deltatics);
|
||||
|
||||
if (!(paused || P_AutoPause()) && deltatics < 1.0 && !hu_stopped)
|
||||
// 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);
|
||||
|
||||
const boolean lagging = ((deltatics >= 1.0) || hu_stopped);
|
||||
|
||||
if (!(paused || P_AutoPause()) && !lagging)
|
||||
{
|
||||
rendertimefrac = g_time.timefrac;
|
||||
}
|
||||
@@ -834,7 +853,7 @@ void D_SRB2Loop(void)
|
||||
rendertimefrac = FRACUNIT;
|
||||
}
|
||||
|
||||
if ((deltatics < 1.0) && !hu_stopped)
|
||||
if (!lagging)
|
||||
{
|
||||
rendertimefrac_unpaused = g_time.timefrac;
|
||||
}
|
||||
@@ -867,7 +886,7 @@ void D_SRB2Loop(void)
|
||||
LUA_Step();
|
||||
|
||||
#ifdef HAVE_DISCORDRPC
|
||||
if (!dedicated)
|
||||
if (!dedicated && renderisnewtic)
|
||||
{
|
||||
Discord_RunCallbacks();
|
||||
}
|
||||
@@ -927,6 +946,7 @@ void D_SRB2Loop(void)
|
||||
void D_StartTitle(void)
|
||||
{
|
||||
INT32 i;
|
||||
|
||||
if (netgame)
|
||||
{
|
||||
if (gametype == GT_RACE) // SRB2kart
|
||||
@@ -948,6 +968,8 @@ void D_StartTitle(void)
|
||||
return;
|
||||
}
|
||||
|
||||
M_ClearMenus(true);
|
||||
|
||||
// okay, stop now
|
||||
// (otherwise the game still thinks we're playing!)
|
||||
SV_StopServer();
|
||||
@@ -1060,18 +1082,21 @@ static void D_AutoloadFile(const char *file, char **filearray)
|
||||
COM_BufAddText(va("exec %s\n", newfile));
|
||||
}
|
||||
|
||||
static char *strremove(char *str, const char *sub) {
|
||||
char *p, *q, *r;
|
||||
if (*sub && (q = r = strstr(str, sub)) != NULL) {
|
||||
size_t len = strlen(sub);
|
||||
while ((r = strstr(p = r + len, sub)) != NULL) {
|
||||
while (p < r)
|
||||
*q++ = *p++;
|
||||
}
|
||||
while ((*q++ = *p++) != '\0')
|
||||
continue;
|
||||
}
|
||||
return str;
|
||||
static char *strremove(char *str, const char *sub)
|
||||
{
|
||||
char *p, *q, *r;
|
||||
if (*sub && (q = r = strstr(str, sub)) != NULL)
|
||||
{
|
||||
size_t len = strlen(sub);
|
||||
while ((r = strstr(p = r + len, sub)) != NULL)
|
||||
{
|
||||
while (p < r)
|
||||
*q++ = *p++;
|
||||
}
|
||||
while ((*q++ = *p++) != '\0')
|
||||
continue;
|
||||
}
|
||||
return str;
|
||||
}
|
||||
|
||||
// FIND THEM
|
||||
@@ -1179,47 +1204,49 @@ void D_CleanFile(char **filearray)
|
||||
|
||||
static boolean AddIWAD(void)
|
||||
{
|
||||
char * path = va(pandf,srb2path,"srb2.srb");
|
||||
char * path = va(pandf, srb2path, "srb2.srb");
|
||||
|
||||
if (FIL_ReadFileOK(path))
|
||||
{
|
||||
D_AddFile(path, startupwadfiles);
|
||||
return true;
|
||||
}
|
||||
else
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
// extra graphic patches for saturn specific thingies
|
||||
boolean found_extra_kart;
|
||||
boolean found_extra2_kart;
|
||||
boolean found_extra3_kart;
|
||||
boolean found_extra_kart = false;
|
||||
boolean found_extra2_kart = false;
|
||||
boolean found_extra3_kart = false;
|
||||
|
||||
boolean xtra_speedo; // extra speedometer check
|
||||
boolean xtra_speedo_clr; // extra speedometer colour check
|
||||
boolean xtra_speedo3; // 80x 11 extra speedometer check
|
||||
boolean xtra_speedo_clr3; // 80x 11 extra speedometer colour check
|
||||
boolean achi_speedo; // achiiro speedometer check
|
||||
boolean achi_speedo_clr; // extra speedometer colour check
|
||||
boolean kartz_speedo; // kartZ speedo
|
||||
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
|
||||
boolean xtra_speedo_clr3 = false; // 80x 11 extra speedometer colour check
|
||||
boolean achi_speedo = false; // achiiro speedometer check
|
||||
boolean achi_speedo_clr = false; // extra speedometer colour check
|
||||
boolean dial_speedo = false; // dial speedometer check
|
||||
boolean dial_speedo_clr = false; // dial speedometer colour check
|
||||
boolean kartz_speedo = false; // kartZ speedo
|
||||
boolean kartz_speedo_smol = false; // kartZ speedo but smol
|
||||
|
||||
boolean clr_hud; // colour hud check
|
||||
boolean big_lap; // bigger lap counter
|
||||
boolean big_lap_color; // bigger lap counter but colour
|
||||
boolean statdp; // stat display for extended player setup
|
||||
boolean nametaggfx; // Nametag stuffs
|
||||
boolean driftgaugegfx; // Driftgauge stuffs
|
||||
boolean multiitem_icon; // Extra icons for Sneakers, Banana and Jawz
|
||||
boolean clr_hud = false; // colour hud check
|
||||
boolean driftgaugegfx_clr = false; // driftgauge colour check
|
||||
boolean big_lap = false; // bigger lap counter
|
||||
boolean big_lap_color = false; // bigger lap counter but colour
|
||||
boolean statdp = false; // stat display for extended player setup
|
||||
boolean nametaggfx = false; // Nametag stuffs
|
||||
boolean driftgaugegfx = false; // Driftgauge stuffs
|
||||
boolean multiitem_icon = false; // Extra icons for Sneakers, Banana and Jawz
|
||||
boolean joystickicon = false; // Extra icons for the joystick input display
|
||||
boolean minidoticon = false; // Dot graphic for minimap player angle display
|
||||
boolean minilighticon = false; // mkwii-style minimap headlight
|
||||
//
|
||||
|
||||
static void IdentifyVersion(void)
|
||||
{
|
||||
const char *srb2waddir = NULL;
|
||||
found_extra_kart = false;
|
||||
found_extra2_kart = false;
|
||||
found_extra3_kart = false;
|
||||
|
||||
#if defined (__unix__) || defined (UNIXCOMMON) || defined (HAVE_SDL)
|
||||
// change to the directory where 'srb2.srb' is found
|
||||
@@ -1229,11 +1256,11 @@ static void IdentifyVersion(void)
|
||||
// get the current directory (possible problem on NT with "." as current dir)
|
||||
if (srb2waddir)
|
||||
{
|
||||
strlcpy(srb2path,srb2waddir,sizeof (srb2path));
|
||||
strlcpy(srb2path, srb2waddir, sizeof(srb2path));
|
||||
}
|
||||
else
|
||||
{
|
||||
if (getcwd(srb2path, 256) != NULL)
|
||||
if (getcwd(srb2path, sizeof(srb2path)))
|
||||
srb2waddir = srb2path;
|
||||
else
|
||||
{
|
||||
@@ -1242,7 +1269,7 @@ static void IdentifyVersion(void)
|
||||
}
|
||||
|
||||
// Load the IWAD
|
||||
if (! AddIWAD())
|
||||
if (!AddIWAD())
|
||||
{
|
||||
I_Error("SRB2.SRB not found! Expected in %s\n", srb2waddir);
|
||||
}
|
||||
@@ -1267,18 +1294,21 @@ static void IdentifyVersion(void)
|
||||
D_AddFile(va(pandf,srb2waddir,"patch.kart"), startupwadfiles);
|
||||
#endif
|
||||
// completely optional
|
||||
if (FIL_ReadFileOK(va(pandf,srb2waddir,"extra.kart"))) {
|
||||
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"))) {
|
||||
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"))) {
|
||||
if (FIL_ReadFileOK(va(pandf,srb2waddir,"extra3.kart")))
|
||||
{
|
||||
D_AddFile(va(pandf,srb2waddir,"extra3.kart"), startupwadfiles);
|
||||
found_extra3_kart = true;
|
||||
}
|
||||
@@ -1326,6 +1356,197 @@ static inline void D_MakeTitleString(char *s)
|
||||
strcpy(s, temp);
|
||||
}
|
||||
|
||||
static void D_CheckSaturnExtraFiles(void)
|
||||
{
|
||||
// Possible value that changes depending on whether required files for speedometer are found or not
|
||||
CV_PossibleValue_t speedo_cons_temp[NUMSPEEDOSTUFF] = {{1, "Default"}, {0, NULL}, {0, NULL}, {0, NULL}, {0, NULL}, {0, NULL}, {0, NULL}, {0, NULL}};
|
||||
CV_PossibleValue_t driftgaugestyle_cons_temp[NUMDGAUGESTUFF] = {{1, "Default"}, {2, "Small"}, {3, "Big Numbers"}, {4, "Numbers Only"}, {0, NULL}, {0, NULL}};
|
||||
CV_PossibleValue_t inputdisplay_cons_temp[NUMINPUTDISPLAYSTUFF] = {{0, "Off"}, {1, "Wheel"}, {2, "Stick"}, {0, NULL}, {0, NULL}};
|
||||
CV_PossibleValue_t minimapdot_cons_temp[NUMMINIMAPDOTSTUFF] = {{0, "Off"}, {0, NULL}, {0, NULL}, {0, NULL}, {0, NULL}};
|
||||
|
||||
unsigned last_speedo_i = 0;
|
||||
unsigned last_driftgauge_i = 3;
|
||||
unsigned last_inputdisplay_i = 2;
|
||||
unsigned last_minimapdot_i = 0;
|
||||
#define PUSHCONS(cons, i, id, name) { ++i; cons[i].value = id; cons[i].strvalue = name; }
|
||||
|
||||
// found the funny, add it in!
|
||||
if (found_extra_kart)
|
||||
{
|
||||
mainwads++;
|
||||
|
||||
// now check for extra speedometer stuff
|
||||
if (W_CheckMultipleLumps("SP_SMSTC", "K_TRNULL", "SP_MKMH", "SP_MMPH", "SP_MFRAC", "SP_MPERC", NULL))
|
||||
{
|
||||
xtra_speedo = true;
|
||||
PUSHCONS(speedo_cons_temp, last_speedo_i, 2, "Small");
|
||||
}
|
||||
|
||||
// now check for achii speedometer stuff
|
||||
if (W_CheckMultipleLumps("SP_AMSTC", "K_TRNULL", "SP_AKMH", "SP_AMPH", "SP_AFRAC", "SP_APERC", NULL))
|
||||
{
|
||||
achi_speedo = true;
|
||||
PUSHCONS(speedo_cons_temp, last_speedo_i, 3, "Achii");
|
||||
}
|
||||
|
||||
// now check for dial speedometer stuff
|
||||
if (W_CheckMultipleLumps("K_DSPBS1", "K_DSPBS2", "K_DSDIAL",
|
||||
"K_TRNULL", "SP_DKMH", "SP_DMPH", "SP_DFRAC", "SP_DPERC",
|
||||
"K_DSPNM0", "K_DSPNM1", "K_DSPNM2", "K_DSPNM3", "K_DSPNM4",
|
||||
"K_DSPNM5", "K_DSPNM6", "K_DSPNM7", "K_DSPNM8", "K_DSPNM9",
|
||||
"RANKFIN", NULL))
|
||||
{
|
||||
dial_speedo = true;
|
||||
PUSHCONS(speedo_cons_temp, last_speedo_i, 4, "Dial");
|
||||
}
|
||||
|
||||
// check for bigger lap count
|
||||
if (W_CheckMultipleLumps("K_STLAPB", "K_STLA2B", NULL))
|
||||
{
|
||||
big_lap = true;
|
||||
}
|
||||
|
||||
// kartzspeedo
|
||||
if (W_CheckMultipleLumps("K_KZSP1", "K_KZSP2", "K_KZSP3", "K_KZSP4", "K_KZSP5",
|
||||
"K_KZSP6", "K_KZSP7", "K_KZSP8", "K_KZSP9", "K_KZSP10", "K_KZSP11", "K_KZSP12",
|
||||
"K_KZSP13", "K_KZSP14", "K_KZSP15", "K_KZSP16", "K_KZSP17", "K_KZSP18", "K_KZSP19",
|
||||
"K_KZSP20", "K_KZSP21", "K_KZSP22", "K_KZSP23", "K_KZSP24", "K_KZSP25", NULL))
|
||||
{
|
||||
kartz_speedo = true;
|
||||
PUSHCONS(speedo_cons_temp, last_speedo_i, 5, "P-Meter");
|
||||
}
|
||||
|
||||
if (W_CheckMultipleLumps("K_KZSS1", "K_KZSS2", "K_KZSS3", "K_KZSS4", "K_KZSS5",
|
||||
"K_KZSS6", "K_KZSS7", "K_KZSS8", "K_KZSS9", "K_KZSS10", "K_KZSS11", "K_KZSS12",
|
||||
"K_KZSS13", "K_KZSS14", "K_KZSS15", "K_KZSS16", "K_KZSS17", "K_KZSS18", "K_KZSS19",
|
||||
"K_KZSS20", "K_KZSS21", "K_KZSS22", "K_KZSS23", "K_KZSS24", "K_KZSS25", NULL))
|
||||
{
|
||||
kartz_speedo_smol = true;
|
||||
PUSHCONS(speedo_cons_temp, last_speedo_i, 6, "P-Meter Small");
|
||||
}
|
||||
|
||||
// stat display for extended player setup
|
||||
if (W_CheckMultipleLumps("K_STATNB", "K_STATN1", "K_STATN2",
|
||||
"K_STATN3", "K_STATN4", "K_STATN5", "K_STATN6", NULL))
|
||||
{
|
||||
statdp = true;
|
||||
}
|
||||
|
||||
// Nametag stuffs
|
||||
if (W_CheckMultipleLumps("NTLINE", "NTLINEV", "NTSP", "NTWH", NULL))
|
||||
{
|
||||
nametaggfx = true;
|
||||
}
|
||||
|
||||
// driftgauge
|
||||
if (W_CheckMultipleLumps("K_DGAU","K_DGSU", NULL))
|
||||
{
|
||||
driftgaugegfx = true;
|
||||
}
|
||||
|
||||
// extra item icons
|
||||
if (W_CheckMultipleLumps("K_ITSHO2", "K_ITSHO3", "K_ITBAN2", "K_ITBAN3", "K_ITBAN4", "K_ITJAW2", NULL))
|
||||
{
|
||||
multiitem_icon = true;
|
||||
}
|
||||
|
||||
// extra round joystick inputdisplay sprites
|
||||
if (W_CheckMultipleLumps("JOYBCK","JOYKNB","JOYSHD", NULL))
|
||||
{
|
||||
joystickicon = true;
|
||||
PUSHCONS(inputdisplay_cons_temp, last_inputdisplay_i, 3, "StickGFX");
|
||||
}
|
||||
|
||||
if (W_LumpExists("MMAPDOT"))
|
||||
{
|
||||
minidoticon = true;
|
||||
PUSHCONS(minimapdot_cons_temp, last_minimapdot_i, 1, "Dot");
|
||||
}
|
||||
|
||||
if (W_LumpExists("MMAPHDLT"))
|
||||
{
|
||||
minilighticon = true;
|
||||
PUSHCONS(minimapdot_cons_temp, last_minimapdot_i, 2, "Headlight");
|
||||
}
|
||||
}
|
||||
|
||||
// now check for colour hud stuff
|
||||
if (found_extra2_kart)
|
||||
{
|
||||
mainwads++;
|
||||
|
||||
// kart vanilla hud patches but colourizable
|
||||
if (W_CheckMultipleLumps("K_SCTIME", "K_SCTIMW", "K_SCLAPS", "K_SCLAPW","K_SCBALN", "K_SCBALW",
|
||||
"K_SCKARM", "K_SCTOUT", "K_ISMULC", "K_ITMULC", "K_ITBC", "K_ITBCD", "K_ISBC", "K_ISBCD", NULL))
|
||||
{
|
||||
clr_hud = true;
|
||||
}
|
||||
|
||||
// extra speedo but colour
|
||||
if (W_LumpExists("SC_SMSTC"))
|
||||
{
|
||||
xtra_speedo_clr = true;
|
||||
}
|
||||
|
||||
// achii speedo but colour
|
||||
if (W_CheckMultipleLumps("SC_AMSTC", "K_TRNULL", "SC_AKMH", "SC_AMPH", "SC_AFRAC", "SC_APERC", NULL))
|
||||
{
|
||||
achi_speedo_clr = true;
|
||||
}
|
||||
|
||||
// dial speedo but colour
|
||||
if (W_CheckMultipleLumps("K_DSPBC1", "K_DSPBC2", "K_DSDIAL",
|
||||
"K_TRNULL", "SC_DKMH", "SC_DMPH", "SC_DFRAC", "SC_DPERC",
|
||||
"K_DSPNC0", "K_DSPNC1", "K_DSPNC2", "K_DSPNC3", "K_DSPNC4",
|
||||
"K_DSPNC5", "K_DSPNC6", "K_DSPNC7", "K_DSPNC8", "K_DSPNC9",
|
||||
"RANKFIN", NULL))
|
||||
{
|
||||
dial_speedo_clr = true;
|
||||
}
|
||||
|
||||
// driftgauge but colour
|
||||
if (W_CheckMultipleLumps("K_DCAU","K_DCSU", NULL))
|
||||
{
|
||||
driftgaugegfx_clr = true;
|
||||
}
|
||||
|
||||
// check for bigger lap count but color** its color bitch
|
||||
if (W_CheckMultipleLumps("K_SCLAPB", "K_SCLA2B", NULL))
|
||||
{
|
||||
big_lap_color = true;
|
||||
}
|
||||
}
|
||||
|
||||
// can be used for custom hud stuff
|
||||
// currently used for the v1 beta hud
|
||||
if (found_extra3_kart)
|
||||
{
|
||||
mainwads++;
|
||||
|
||||
// 80x11 speedometer crap
|
||||
if (W_LumpExists("SP_SM3TC"))
|
||||
{
|
||||
xtra_speedo3 = true;
|
||||
PUSHCONS(speedo_cons_temp, last_speedo_i, 7, "Extra");
|
||||
PUSHCONS(driftgaugestyle_cons_temp, last_driftgauge_i, 5, "Extra");
|
||||
}
|
||||
|
||||
// 80x11 speedometer crap but colour
|
||||
if (W_LumpExists("SC_SM3TC"))
|
||||
{
|
||||
xtra_speedo_clr3 = true;
|
||||
}
|
||||
}
|
||||
|
||||
#undef PUSHCONS
|
||||
memcpy(speedo_cons_t, speedo_cons_temp, sizeof(speedo_cons_t));
|
||||
memcpy(driftgaugestyle_cons_t, driftgaugestyle_cons_temp, sizeof(driftgaugestyle_cons_t));
|
||||
memcpy(inputdisplay_cons_t, inputdisplay_cons_temp, sizeof(inputdisplay_cons_t));
|
||||
memcpy(minimapdot_cons_t, minimapdot_cons_temp, sizeof(minimapdot_cons_t));
|
||||
}
|
||||
|
||||
#include <locale.h>
|
||||
|
||||
//
|
||||
// D_SRB2Main
|
||||
//
|
||||
@@ -1523,6 +1744,7 @@ void D_SRB2Main(void)
|
||||
|
||||
CONS_Printf("I_InitializeTime()...\n");
|
||||
I_InitializeTime();
|
||||
setlocale(LC_TIME, "");
|
||||
|
||||
// Make backups of some SOCcable tables.
|
||||
P_BackupTables();
|
||||
@@ -1574,100 +1796,7 @@ void D_SRB2Main(void)
|
||||
|
||||
#endif //ifndef DEVELOP
|
||||
|
||||
// Possible value that changes depending on whether required files for speedometer are found or not
|
||||
CV_PossibleValue_t speedo_cons_temp[NUMSPEEDOSTUFF] = {{1, "Default"}, {0, NULL}, {0, NULL}, {0, NULL}, {0, NULL}, {0, NULL}};
|
||||
CV_PossibleValue_t driftgaugestyle_cons_temp[NUMSPEEDOSTUFF] = {{1, "Default"}, {2, "Small"}, {3, "Big Numbers"}, {4, "Numbers Only"}, {0, NULL}, {0, NULL}}; // ugh i dont want this but bleh
|
||||
unsigned last_speedo_i = 0;
|
||||
unsigned last_driftgauge_i = 0;
|
||||
#define PUSHCONS(cons, i, id, name) { ++i; cons[i].value = id; cons[i].strvalue = name; }
|
||||
|
||||
if (found_extra_kart || found_extra2_kart || found_extra3_kart) // found the funny, add it in!
|
||||
{
|
||||
// HAYA: These are seperated for a reason lmao
|
||||
if (found_extra_kart)
|
||||
mainwads++;
|
||||
if (found_extra2_kart)
|
||||
mainwads++;
|
||||
if (found_extra3_kart)
|
||||
mainwads++;
|
||||
|
||||
// now check for extra speedometer stuff
|
||||
if (W_CheckMultipleLumps("SP_SMSTC", "K_TRNULL", "SP_MKMH", "SP_MMPH", "SP_MFRAC", "SP_MPERC", NULL))
|
||||
{
|
||||
xtra_speedo = true;
|
||||
PUSHCONS(speedo_cons_temp, last_speedo_i, 2, "Small");
|
||||
}
|
||||
|
||||
if (W_LumpExists("SC_SMSTC"))
|
||||
xtra_speedo_clr = true;
|
||||
|
||||
// now check for achii speedometer stuff
|
||||
if (W_CheckMultipleLumps("SP_AMSTC", "K_TRNULL", "SP_AKMH", "SP_AMPH", "SP_AFRAC", "SP_APERC", NULL))
|
||||
{
|
||||
achi_speedo = true;
|
||||
PUSHCONS(speedo_cons_temp, last_speedo_i, 3, "Achii");
|
||||
}
|
||||
|
||||
if (W_CheckMultipleLumps("SC_AMSTC", "K_TRNULL", "SC_AKMH", "SC_AMPH", "SC_AFRAC", "SC_APERC", NULL))
|
||||
achi_speedo_clr = true;
|
||||
|
||||
// check for bigger lap count
|
||||
if (W_CheckMultipleLumps("K_STLAPB", "K_STLA2B", NULL))
|
||||
big_lap = true;
|
||||
|
||||
// now check for colour hud stuff
|
||||
if (W_CheckMultipleLumps("K_SCTIME", "K_SCTIMW", "K_SCLAPS", "K_SCLAPW", \
|
||||
"K_SCBALN", "K_SCBALW", "K_SCKARM", "K_SCTOUT", "K_ISMULC", "K_ITMULC", "K_ITBC", "K_ITBCD", "K_ISBC", "K_ISBCD", NULL))
|
||||
clr_hud = true;
|
||||
|
||||
// check for bigger lap count but color** its color bitch
|
||||
if (W_CheckMultipleLumps("K_SCLAPB", "K_SCLA2B", NULL))
|
||||
big_lap_color = true;
|
||||
|
||||
// kartzspeedo
|
||||
if (W_CheckMultipleLumps("K_KZSP1", "K_KZSP2", "K_KZSP3", "K_KZSP4", "K_KZSP5", \
|
||||
"K_KZSP6", "K_KZSP7", "K_KZSP8", "K_KZSP9", "K_KZSP10", "K_KZSP11", "K_KZSP12", \
|
||||
"K_KZSP13", "K_KZSP14", "K_KZSP15", "K_KZSP16", "K_KZSP17", "K_KZSP18", "K_KZSP19", \
|
||||
"K_KZSP20", "K_KZSP21", "K_KZSP22", "K_KZSP23", "K_KZSP24", "K_KZSP25", NULL))
|
||||
{
|
||||
kartz_speedo = true;
|
||||
PUSHCONS(speedo_cons_temp, last_speedo_i, 4, "P-Meter");
|
||||
}
|
||||
|
||||
// stat display for extended player setup
|
||||
if (W_CheckMultipleLumps("K_STATNB", "K_STATN1", "K_STATN2", "K_STATN3", "K_STATN4", \
|
||||
"K_STATN5", "K_STATN6", NULL))
|
||||
statdp = true;
|
||||
|
||||
// Nametag stuffs
|
||||
if (W_CheckMultipleLumps("NTLINE", "NTLINEV", "NTSP", "NTWH", NULL))
|
||||
nametaggfx = true;
|
||||
|
||||
if (W_CheckMultipleLumps("K_DGAU","K_DCAU","K_DGSU","K_DCSU", NULL))
|
||||
driftgaugegfx = true;
|
||||
|
||||
// extra item icons
|
||||
if (W_CheckMultipleLumps("K_ITSHO2", "K_ITSHO3", "K_ITBAN2", "K_ITBAN3", "K_ITBAN4", "K_ITJAW2", NULL))
|
||||
multiitem_icon = true;
|
||||
|
||||
if (found_extra3_kart)
|
||||
{
|
||||
// 80x11 speedometer crap
|
||||
if (W_LumpExists("SP_SM3TC"))
|
||||
{
|
||||
xtra_speedo3 = true;
|
||||
PUSHCONS(speedo_cons_temp, last_speedo_i, 5, "Extra");
|
||||
PUSHCONS(driftgaugestyle_cons_temp, last_driftgauge_i, 5, "Extra");
|
||||
}
|
||||
|
||||
if (W_LumpExists("SC_SM3TC"))
|
||||
xtra_speedo_clr3 = true;
|
||||
}
|
||||
}
|
||||
|
||||
#undef PUSHCONS
|
||||
memcpy(speedo_cons_t, speedo_cons_temp, sizeof(speedo_cons_t));
|
||||
memcpy(driftgaugestyle_cons_t, driftgaugestyle_cons_temp, sizeof(driftgaugestyle_cons_t));
|
||||
D_CheckSaturnExtraFiles(); // check all the saturn stuff :3
|
||||
|
||||
// Do it before P_InitMapData because PNG patch
|
||||
// conversion sometimes needs the palette
|
||||
@@ -1683,7 +1812,7 @@ void D_SRB2Main(void)
|
||||
{
|
||||
name = lumpinfo->name;
|
||||
|
||||
if (name[0] == 'M' && name[1] == 'A' && name[2] == 'P') // Ignore the headers
|
||||
if (memcmp(name, "MAP", 3) == 0) // Ignore the headers
|
||||
{
|
||||
INT16 num;
|
||||
if (name[5] != '\0')
|
||||
@@ -1713,7 +1842,7 @@ void D_SRB2Main(void)
|
||||
{
|
||||
name = lumpinfo->name;
|
||||
|
||||
if (name[0] == 'M' && name[1] == 'A' && name[2] == 'P') // Ignore the headers
|
||||
if (memcmp(name, "MAP", 3) == 0) // Ignore the headers
|
||||
{
|
||||
INT16 num;
|
||||
if (name[5] != '\0')
|
||||
@@ -1782,7 +1911,9 @@ void D_SRB2Main(void)
|
||||
|
||||
savedata.lives = 0; // flag this as not-used
|
||||
|
||||
loaded_config = true; // so pallettechange doesent get called 500 times at startup lol
|
||||
// make sure I_Quit() will write back the correct config
|
||||
// (do not write back the config if it crash before)
|
||||
loaded_config = true; // so palettechange doesent get called 500 times at startup lol
|
||||
|
||||
//------------------------------------------------ COMMAND LINE PARAMS
|
||||
|
||||
|
||||
+9
-2
@@ -17,9 +17,9 @@
|
||||
#include "d_event.h"
|
||||
#include "w_wad.h" // for MAX_WADFILES
|
||||
|
||||
// make sure not to write back the config until it's been correctly loaded
|
||||
extern tic_t rendergametic;
|
||||
|
||||
// make sure not to write back the config until it's been correctly loaded
|
||||
extern boolean loaded_config;
|
||||
|
||||
extern char srb2home[256]; //Alam: My Home
|
||||
@@ -38,15 +38,22 @@ extern boolean xtra_speedo3; // 80x11 extra speedometer check
|
||||
extern boolean xtra_speedo_clr3; // 80x11 extra speedometer colour check
|
||||
extern boolean achi_speedo; // achiiro speedometer check
|
||||
extern boolean achi_speedo_clr; // extra speedometer colour check
|
||||
extern boolean kartz_speedo; // kartZ speedo
|
||||
extern boolean dial_speedo; // dial speedometer check
|
||||
extern boolean dial_speedo_clr; // dial speedometer colour check
|
||||
extern boolean kartz_speedo; // kartZ speedo
|
||||
extern boolean kartz_speedo_smol; // kartZ speedo but smol
|
||||
|
||||
extern boolean clr_hud; // colour hud check
|
||||
extern boolean driftgaugegfx_clr; // driftgauge colour check
|
||||
extern boolean big_lap; // bigger lap counter
|
||||
extern boolean big_lap_color; // bigger lap counter but colour
|
||||
extern boolean statdp; // stat display for extended player setup
|
||||
extern boolean nametaggfx; // Nametag stuffs
|
||||
extern boolean driftgaugegfx; // Driftgauge stuffs
|
||||
extern boolean multiitem_icon; // Extra icons for Sneakers, Banana and Jawz
|
||||
extern boolean joystickicon; // Extra icons for the joystick input display
|
||||
extern boolean minidoticon; // Dot icon for minimap player angle display
|
||||
extern boolean minilighticon; // mkwii-style minimap headlight
|
||||
//
|
||||
|
||||
// autoload stuff
|
||||
|
||||
+63
-69
@@ -109,20 +109,24 @@ boolean Net_GetNetStat(void)
|
||||
{
|
||||
const tic_t t = I_GetTime();
|
||||
static INT64 oldsendbyte = 0;
|
||||
|
||||
if (statstarttic+STATLENGTH <= t)
|
||||
{
|
||||
const tic_t df = t-statstarttic;
|
||||
const INT64 newsendbyte = sendbytes - oldsendbyte;
|
||||
sendbps = (INT32)(newsendbyte*TICRATE)/df;
|
||||
getbps = (getbytes*TICRATE)/df;
|
||||
|
||||
if (sendackpacket)
|
||||
lostpercent = 100.0f*(float)retransmit/(float)sendackpacket;
|
||||
else
|
||||
lostpercent = 0.0f;
|
||||
|
||||
if (getackpacket)
|
||||
duppercent = 100.0f*(float)duppacket/(float)getackpacket;
|
||||
else
|
||||
duppercent = 0.0f;
|
||||
|
||||
if (ticruned)
|
||||
gamelostpercent = 100.0f*(float)ticmiss/(float)ticruned;
|
||||
else
|
||||
@@ -220,7 +224,7 @@ FUNCMATH static INT32 cmpack(UINT8 a, UINT8 b)
|
||||
* \param lowtimer ???
|
||||
* \return True if a free acknum was found
|
||||
*/
|
||||
static boolean GetFreeAcknum(UINT8 *freeack, boolean lowtimer)
|
||||
static boolean GetFreeAcknum(UINT8 *freeack)
|
||||
{
|
||||
node_t *node = &nodes[doomcom->remotenode];
|
||||
INT32 i, numfreeslot = 0;
|
||||
@@ -232,6 +236,7 @@ static boolean GetFreeAcknum(UINT8 *freeack, boolean lowtimer)
|
||||
}
|
||||
|
||||
for (i = 0; i < MAXACKPACKETS; i++)
|
||||
{
|
||||
if (!ackpak[i].acknum)
|
||||
{
|
||||
// For low priority packets, make sure to let freeslots so urgent packets can be sent
|
||||
@@ -249,17 +254,8 @@ static boolean GetFreeAcknum(UINT8 *freeack, boolean lowtimer)
|
||||
node->nextacknum++;
|
||||
ackpak[i].destinationnode = (UINT8)(node - nodes);
|
||||
ackpak[i].length = doomcom->datalength;
|
||||
if (lowtimer)
|
||||
{
|
||||
// Lowtime means can't be sent now so try it as soon as possible
|
||||
ackpak[i].senttime = 0;
|
||||
ackpak[i].resentnum = 1;
|
||||
}
|
||||
else
|
||||
{
|
||||
ackpak[i].senttime = I_GetTime();
|
||||
ackpak[i].resentnum = 0;
|
||||
}
|
||||
ackpak[i].senttime = I_GetTime();
|
||||
ackpak[i].resentnum = 0;
|
||||
M_Memcpy(ackpak[i].pak.raw, netbuffer, ackpak[i].length);
|
||||
|
||||
*freeack = ackpak[i].acknum;
|
||||
@@ -268,46 +264,17 @@ static boolean GetFreeAcknum(UINT8 *freeack, boolean lowtimer)
|
||||
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
#ifdef PARANOIA
|
||||
CONS_Debug(DBG_NETPLAY, "No more free ackpacket\n");
|
||||
#endif
|
||||
if (netbuffer->packettype < PT_CANFAIL)
|
||||
I_Error("Connection lost\n");
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
/** Counts how many acks are free
|
||||
*
|
||||
* \param urgent True if the type of the packet meant to
|
||||
* use an ack is lower than PT_CANFAIL
|
||||
* If for some reason you don't want use it
|
||||
* for any packet type in particular,
|
||||
* just set to false
|
||||
* \return The number of free acks
|
||||
*
|
||||
*/
|
||||
INT32 Net_GetFreeAcks(boolean urgent)
|
||||
{
|
||||
INT32 i, numfreeslot = 0;
|
||||
INT32 n = 0; // Number of free acks found
|
||||
|
||||
for (i = 0; i < MAXACKPACKETS; i++)
|
||||
if (!ackpak[i].acknum)
|
||||
{
|
||||
// For low priority packets, make sure to let freeslots so urgent packets can be sent
|
||||
if (!urgent)
|
||||
{
|
||||
numfreeslot++;
|
||||
if (numfreeslot <= URGENTFREESLOTNUM)
|
||||
continue;
|
||||
}
|
||||
|
||||
n++;
|
||||
}
|
||||
|
||||
return n;
|
||||
}
|
||||
|
||||
// Get a ack to send in the queue of this node
|
||||
static UINT8 GetAcktosend(INT32 node)
|
||||
{
|
||||
@@ -320,6 +287,7 @@ static void RemoveAck(INT32 i)
|
||||
INT32 node = ackpak[i].destinationnode;
|
||||
DEBFILE(va("Remove ack %d\n",ackpak[i].acknum));
|
||||
ackpak[i].acknum = 0;
|
||||
|
||||
if (nodes[node].flags & NF_CLOSE)
|
||||
Net_CloseConnection(node);
|
||||
}
|
||||
@@ -335,13 +303,16 @@ static boolean Processackpak(void)
|
||||
if (netbuffer->ackreturn && cmpack(node->remotefirstack, netbuffer->ackreturn) < 0)
|
||||
{
|
||||
node->remotefirstack = netbuffer->ackreturn;
|
||||
|
||||
// Search the ackbuffer and free it
|
||||
for (i = 0; i < MAXACKPACKETS; i++)
|
||||
{
|
||||
if (ackpak[i].acknum && ackpak[i].destinationnode == node - nodes
|
||||
&& cmpack(ackpak[i].acknum, netbuffer->ackreturn) <= 0)
|
||||
{
|
||||
RemoveAck(i);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Received a packet with ack, queue it to send the ack back
|
||||
@@ -349,6 +320,7 @@ static boolean Processackpak(void)
|
||||
{
|
||||
UINT8 ack = netbuffer->ack;
|
||||
getackpacket++;
|
||||
|
||||
if (cmpack(ack, node->firstacktosend) <= 0)
|
||||
{
|
||||
DEBFILE(va("Discard(1) ack %d (duplicated)\n", ack));
|
||||
@@ -359,6 +331,7 @@ static boolean Processackpak(void)
|
||||
{
|
||||
// Check if it is not already in the queue
|
||||
for (i = node->acktosend_tail; i != node->acktosend_head; i = (i+1) % MAXACKTOSEND)
|
||||
{
|
||||
if (node->acktosend[i] == ack)
|
||||
{
|
||||
DEBFILE(va("Discard(2) ack %d (duplicated)\n", ack));
|
||||
@@ -366,11 +339,14 @@ static boolean Processackpak(void)
|
||||
goodpacket = false; // Discard packet (duplicate)
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if (goodpacket)
|
||||
{
|
||||
// Is a good packet so increment the acknowledge number,
|
||||
// Then search for a "hole" in the queue
|
||||
UINT8 nextfirstack = (UINT8)(node->firstacktosend + 1);
|
||||
|
||||
if (!nextfirstack)
|
||||
nextfirstack = 1;
|
||||
|
||||
@@ -383,9 +359,11 @@ static boolean Processackpak(void)
|
||||
if (!nextfirstack)
|
||||
nextfirstack = 1;
|
||||
hm1 = (UINT8)((node->acktosend_head-1+MAXACKTOSEND) % MAXACKTOSEND);
|
||||
|
||||
while (change)
|
||||
{
|
||||
change = false;
|
||||
|
||||
for (i = node->acktosend_tail; i != node->acktosend_head;
|
||||
i = (i+1) % MAXACKTOSEND)
|
||||
{
|
||||
@@ -398,6 +376,7 @@ static boolean Processackpak(void)
|
||||
nextfirstack = 1;
|
||||
change = true;
|
||||
}
|
||||
|
||||
if (i == node->acktosend_tail)
|
||||
{
|
||||
node->acktosend[node->acktosend_tail] = 0;
|
||||
@@ -419,6 +398,7 @@ static boolean Processackpak(void)
|
||||
// Will be incremented when the nextfirstack comes (code above)
|
||||
UINT8 newhead = (UINT8)((node->acktosend_head+1) % MAXACKTOSEND);
|
||||
DEBFILE(va("out of order packet (%d expected)\n", nextfirstack));
|
||||
|
||||
if (newhead != node->acktosend_tail)
|
||||
{
|
||||
node->acktosend[node->acktosend_head] = ack;
|
||||
@@ -455,8 +435,11 @@ static void GotAcks(void)
|
||||
INT32 i, j;
|
||||
|
||||
for (j = 0; j < MAXACKTOSEND; j++)
|
||||
{
|
||||
if (netbuffer->u.textcmd[j])
|
||||
{
|
||||
for (i = 0; i < MAXACKPACKETS; i++)
|
||||
{
|
||||
if (ackpak[i].acknum && ackpak[i].destinationnode == doomcom->remotenode)
|
||||
{
|
||||
if (ackpak[i].acknum == netbuffer->u.textcmd[j])
|
||||
@@ -471,6 +454,9 @@ static void GotAcks(void)
|
||||
ackpak[i].senttime--; // hurry up
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
@@ -505,6 +491,7 @@ void Net_AckTicker(void)
|
||||
{
|
||||
const INT32 nodei = ackpak[i].destinationnode;
|
||||
node_t *node = &nodes[nodei];
|
||||
|
||||
if (ackpak[i].acknum && ackpak[i].senttime + NODETIMEOUT < I_GetTime())
|
||||
{
|
||||
if (ackpak[i].resentnum > 10 && (node->flags & NF_CLOSE))
|
||||
@@ -557,8 +544,10 @@ void Net_UnAcknowledgePacket(INT32 node)
|
||||
#else
|
||||
INT32 hm1 = (nodes[node].acktosend_head-1+MAXACKTOSEND) % MAXACKTOSEND;
|
||||
DEBFILE(va("UnAcknowledge node %d\n", node));
|
||||
|
||||
if (!node)
|
||||
return;
|
||||
|
||||
if (nodes[node].acktosend[hm1] == netbuffer->ack)
|
||||
{
|
||||
nodes[node].acktosend[hm1] = 0;
|
||||
@@ -582,6 +571,7 @@ void Net_UnAcknowledgePacket(INT32 node)
|
||||
if (!nodes[node].firstacktosend)
|
||||
nodes[node].firstacktosend = UINT8_MAX;
|
||||
}
|
||||
|
||||
nodes[node].firstacktosend++;
|
||||
if (!nodes[node].firstacktosend)
|
||||
nodes[node].firstacktosend = 1;
|
||||
@@ -600,8 +590,10 @@ static boolean Net_AllAcksReceived(void)
|
||||
INT32 i;
|
||||
|
||||
for (i = 0; i < MAXACKPACKETS; i++)
|
||||
{
|
||||
if (ackpak[i].acknum)
|
||||
return false;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
@@ -621,6 +613,7 @@ void Net_WaitAllAckReceived(UINT32 timeout)
|
||||
timeout = tictac + timeout*NEWTICRATE;
|
||||
|
||||
HGetPacket();
|
||||
|
||||
while (timeout > I_GetTime() && !Net_AllAcksReceived())
|
||||
{
|
||||
while (tictac == I_GetTime())
|
||||
@@ -628,6 +621,7 @@ void Net_WaitAllAckReceived(UINT32 timeout)
|
||||
I_Sleep(cv_sleep.value);
|
||||
I_UpdateTime(cv_timescale.value);
|
||||
}
|
||||
|
||||
tictac = I_GetTime();
|
||||
HGetPacket();
|
||||
Net_AckTicker();
|
||||
@@ -668,13 +662,14 @@ void Net_AbortPacketType(UINT8 packettype)
|
||||
#ifdef NONET
|
||||
(void)packettype;
|
||||
#else
|
||||
INT32 i;
|
||||
for (i = 0; i < MAXACKPACKETS; i++)
|
||||
for (INT32 i = 0; i < MAXACKPACKETS; i++)
|
||||
{
|
||||
if (ackpak[i].acknum && (ackpak[i].pak.data.packettype == packettype
|
||||
|| packettype == UINT8_MAX))
|
||||
{
|
||||
ackpak[i].acknum = 0;
|
||||
}
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
@@ -719,6 +714,7 @@ void Net_CloseConnection(INT32 node)
|
||||
|
||||
// check if we are waiting for an ack from this node
|
||||
for (i = 0; i < MAXACKPACKETS; i++)
|
||||
{
|
||||
if (ackpak[i].acknum && ackpak[i].destinationnode == node)
|
||||
{
|
||||
if (!forceclose)
|
||||
@@ -726,6 +722,7 @@ void Net_CloseConnection(INT32 node)
|
||||
else
|
||||
ackpak[i].acknum = 0;
|
||||
}
|
||||
}
|
||||
|
||||
InitNode(&nodes[node]);
|
||||
SV_AbortSendFiles(node);
|
||||
@@ -742,9 +739,8 @@ static UINT32 NetbufferChecksum(void)
|
||||
UINT32 c = 0x1234567;
|
||||
const INT32 l = doomcom->datalength - 4;
|
||||
const UINT8 *buf = (UINT8 *)netbuffer + 4;
|
||||
INT32 i;
|
||||
|
||||
for (i = 0; i < l; i++, buf++)
|
||||
for (INT32 i = 0; i < l; i++, buf++)
|
||||
c += (*buf) * (i+1);
|
||||
|
||||
return LONG(c);
|
||||
@@ -759,6 +755,7 @@ static void fprintfstring(char *s, size_t len)
|
||||
size_t i;
|
||||
|
||||
for (i = 0; i < len; i++)
|
||||
{
|
||||
if (s[i] < 32)
|
||||
{
|
||||
if (!mode)
|
||||
@@ -778,6 +775,8 @@ static void fprintfstring(char *s, size_t len)
|
||||
}
|
||||
fprintf(debugfile, "%c", s[i]);
|
||||
}
|
||||
}
|
||||
|
||||
if (mode)
|
||||
fprintf(debugfile, "]");
|
||||
}
|
||||
@@ -832,15 +831,14 @@ const char *packettypename[NUMPACKETTYPE] =
|
||||
"MOREFILESNEEDED",
|
||||
|
||||
"PING"
|
||||
#ifdef SATURNSYNCH
|
||||
#ifdef SATURNPAK
|
||||
,
|
||||
|
||||
"WILLRESENDGAMESTATE",
|
||||
"CANRECEIVEGAMESTATE",
|
||||
"RECEIVEDGAMESTATE",
|
||||
|
||||
// we will reserve this for now even if unused, so order wont get mangled
|
||||
"ISSATURN"
|
||||
"ISSATURN" // special packet to identify saturn clients
|
||||
#endif
|
||||
};
|
||||
|
||||
@@ -1035,6 +1033,7 @@ static boolean ShouldDropPacket(void)
|
||||
boolean HSendPacket(INT32 node, boolean reliable, UINT8 acknum, size_t packetlength)
|
||||
{
|
||||
doomcom->datalength = (INT16)(packetlength + BASEPACKETSIZE);
|
||||
|
||||
if (node == 0) // Packet is to go back to us
|
||||
{
|
||||
if ((rebound_head+1) % MAXREBOUND == rebound_tail)
|
||||
@@ -1070,6 +1069,7 @@ boolean HSendPacket(INT32 node, boolean reliable, UINT8 acknum, size_t packetlen
|
||||
// do this before GetFreeAcknum because this function backups
|
||||
// the current packet
|
||||
doomcom->remotenode = (INT16)node;
|
||||
|
||||
if (doomcom->datalength <= 0)
|
||||
{
|
||||
DEBFILE("HSendPacket: nothing to send\n");
|
||||
@@ -1084,9 +1084,10 @@ boolean HSendPacket(INT32 node, boolean reliable, UINT8 acknum, size_t packetlen
|
||||
netbuffer->ackreturn = GetAcktosend(node);
|
||||
else
|
||||
netbuffer->ackreturn = 0;
|
||||
|
||||
if (reliable)
|
||||
{
|
||||
if (!GetFreeAcknum(&netbuffer->ack, false))
|
||||
if (!GetFreeAcknum(&netbuffer->ack))
|
||||
return false;
|
||||
}
|
||||
else
|
||||
@@ -1158,7 +1159,6 @@ boolean HGetPacket(void)
|
||||
|
||||
while(true)
|
||||
{
|
||||
//nodejustjoined = I_NetGet();
|
||||
I_NetGet();
|
||||
|
||||
if (doomcom->remotenode == -1) // No packet received
|
||||
@@ -1187,21 +1187,6 @@ boolean HGetPacket(void)
|
||||
DebugPrintpacket("GET");
|
||||
#endif
|
||||
|
||||
/*// If a new node sends an unexpected packet, just ignore it
|
||||
if (nodejustjoined && server
|
||||
&& !(netbuffer->packettype == PT_ASKINFO
|
||||
|| netbuffer->packettype == PT_SERVERINFO
|
||||
|| netbuffer->packettype == PT_PLAYERINFO
|
||||
|| netbuffer->packettype == PT_REQUESTFILE
|
||||
|| netbuffer->packettype == PT_ASKINFOVIAMS
|
||||
|| netbuffer->packettype == PT_CLIENTJOIN))
|
||||
{
|
||||
DEBFILE(va("New node sent an unexpected %s packet\n", packettypename[netbuffer->packettype]));
|
||||
//CONS_Alert(CONS_NOTICE, "New node sent an unexpected %s packet\n", packettypename[netbuffer->packettype]);
|
||||
Net_CloseConnection(doomcom->remotenode | FORCECLOSE);
|
||||
continue;
|
||||
}*/
|
||||
|
||||
// Proceed the ack and ackreturn field
|
||||
if (!Processackpak())
|
||||
continue; // discarded (duplicated)
|
||||
@@ -1238,6 +1223,7 @@ static void Internal_FreeNodenum(INT32 nodenum)
|
||||
SINT8 I_NetMakeNode(const char *hostname)
|
||||
{
|
||||
SINT8 newnode = -1;
|
||||
|
||||
if (I_NetMakeNodewPort)
|
||||
{
|
||||
char *localhostname = strdup(hostname);
|
||||
@@ -1264,7 +1250,10 @@ void D_SetDoomcom(void)
|
||||
{
|
||||
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;
|
||||
}
|
||||
|
||||
@@ -1288,6 +1277,7 @@ boolean D_CheckNetGame(void)
|
||||
I_NetMakeNodewPort = NULL;
|
||||
|
||||
hardware_MAXPACKETLENGTH = MAXPACKETLENGTH;
|
||||
|
||||
// I_InitNetwork sets doomcom and netgame
|
||||
// check and initialize the network driver
|
||||
multiplayer = false;
|
||||
@@ -1307,6 +1297,7 @@ boolean D_CheckNetGame(void)
|
||||
server = true; // WTF? server always true???
|
||||
// no! The deault mode is server. Client is set elsewhere
|
||||
// when the client executes connect command.
|
||||
doomcom->ticdup = 1;
|
||||
|
||||
if (M_CheckParm("-extratic"))
|
||||
{
|
||||
@@ -1336,6 +1327,8 @@ boolean D_CheckNetGame(void)
|
||||
if (netgame)
|
||||
multiplayer = true;
|
||||
|
||||
if (doomcom->id != DOOMCOM_ID)
|
||||
I_Error("Doomcom buffer invalid!");
|
||||
if (doomcom->numnodes > MAXNETNODES)
|
||||
I_Error("Too many nodes (%d), max:%d", doomcom->numnodes, MAXNETNODES);
|
||||
|
||||
@@ -1348,7 +1341,7 @@ boolean D_CheckNetGame(void)
|
||||
if (M_CheckParm("-debugfile"))
|
||||
{
|
||||
char filename[21];
|
||||
INT32 k = consoleplayer - 1;
|
||||
INT32 k = doomcom->consoleplayer - 1;
|
||||
if (M_IsNextParm())
|
||||
k = atoi(M_GetNextParm()) - 1;
|
||||
while (!debugfile && k < MAXPLAYERS)
|
||||
@@ -1404,6 +1397,7 @@ void Command_Ping_f(void)
|
||||
INT32 i;
|
||||
|
||||
pingc = 0;
|
||||
|
||||
for (i = 1; i < MAXPLAYERS; ++i)
|
||||
{
|
||||
if (playeringame[i])
|
||||
|
||||
+1
-3
@@ -45,12 +45,10 @@ extern boolean nodeingame[MAXNETNODES]; // Set false as nodes leave game
|
||||
|
||||
extern boolean serverrunning;
|
||||
|
||||
INT32 Net_GetFreeAcks(boolean urgent);
|
||||
void Net_AckTicker(void);
|
||||
|
||||
// If reliable return true if packet sent, 0 else
|
||||
boolean HSendPacket(INT32 node, boolean reliable, UINT8 acknum,
|
||||
size_t packetlength);
|
||||
boolean HSendPacket(INT32 node, boolean reliable, UINT8 acknum, size_t packetlength);
|
||||
boolean HGetPacket(void);
|
||||
void D_SetDoomcom(void);
|
||||
#ifndef NONET
|
||||
|
||||
+144
-301
@@ -39,6 +39,7 @@
|
||||
#include "d_main.h"
|
||||
#include "m_random.h"
|
||||
#include "f_finale.h"
|
||||
#include "v_video.h"
|
||||
#include "filesrch.h"
|
||||
#include "mserv.h"
|
||||
#include "md5.h"
|
||||
@@ -210,24 +211,13 @@ void SendWeaponPref4(void);
|
||||
|
||||
static CV_PossibleValue_t usemouse_cons_t[] = {{0, "Off"}, {1, "On"}, {2, "Force"}, {0, NULL}};
|
||||
|
||||
#ifdef LJOYSTICK
|
||||
static CV_PossibleValue_t joyport_cons_t[] = {{1, "/dev/js0"}, {2, "/dev/js1"}, {3, "/dev/js2"},
|
||||
{4, "/dev/js3"}, {0, NULL}};
|
||||
#else
|
||||
// accept whatever value - it is in fact the joystick device number
|
||||
#define usejoystick_cons_t NULL
|
||||
#endif
|
||||
|
||||
static CV_PossibleValue_t autobalance_cons_t[] = {{0, "MIN"}, {4, "MAX"}, {0, NULL}};
|
||||
static CV_PossibleValue_t teamscramble_cons_t[] = {{0, "Off"}, {1, "Random"}, {2, "Points"}, {0, NULL}};
|
||||
|
||||
static CV_PossibleValue_t startingliveslimit_cons_t[] = {{1, "MIN"}, {99, "MAX"}, {0, NULL}};
|
||||
static CV_PossibleValue_t sleeping_cons_t[] = {{0, "MIN"}, {1000/TICRATE, "MAX"}, {0, NULL}};
|
||||
static CV_PossibleValue_t competitionboxes_cons_t[] = {{0, "Normal"}, {1, "Random"}, {2, "Teleports"},
|
||||
{3, "None"}, {0, NULL}};
|
||||
|
||||
static CV_PossibleValue_t matchboxes_cons_t[] = {{0, "Normal"}, {1, "Random"}, {2, "Non-Random"},
|
||||
{3, "None"}, {0, NULL}};
|
||||
static CV_PossibleValue_t competitionboxes_cons_t[] = {{0, "Normal"}, {1, "Random"}, {2, "Teleports"}, {3, "None"}, {0, NULL}};
|
||||
static CV_PossibleValue_t matchboxes_cons_t[] = {{0, "Normal"}, {1, "Random"}, {2, "Non-Random"}, {3, "None"}, {0, NULL}};
|
||||
|
||||
//static CV_PossibleValue_t chances_cons_t[] = {{0, "MIN"}, {9, "MAX"}, {0, NULL}};
|
||||
static CV_PossibleValue_t match_scoring_cons_t[] = {{0, "Normal"}, {1, "Classic"}, {0, NULL}};
|
||||
@@ -290,40 +280,50 @@ consvar_t cv_skipmapcheck = {"skipmapcheck", "Off", CV_SAVE, CV_OnOff, NULL, 0,
|
||||
|
||||
INT32 cv_debug;
|
||||
|
||||
consvar_t cv_usemouse = {"use_mouse", "Off", CV_SAVE|CV_CALL,usemouse_cons_t, I_StartupMouse, 0, NULL, NULL, 0, 0, NULL};
|
||||
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};
|
||||
|
||||
static void UseMouse_OnChange(void)
|
||||
{
|
||||
GameFocus_menu_Onchange();
|
||||
I_StartupMouse();
|
||||
}
|
||||
|
||||
//WTF
|
||||
consvar_t cv_mouseturn = {"mouseturn", "Off", CV_SAVE, CV_OnOff, NULL, 0, NULL, NULL, 0, 0, NULL};
|
||||
|
||||
// Lagless camera! Yay!
|
||||
consvar_t cv_laglesscam = {"laglesscamera", "Off", CV_SAVE, CV_OnOff, NULL, 0, NULL, NULL, 0, 0, NULL};
|
||||
consvar_t cv_laglesscam = {"lagless_camera", "Off", CV_SAVE, CV_OnOff, NULL, 0, NULL, NULL, 0, 0, NULL};
|
||||
|
||||
consvar_t cv_verticallook = {"verticallook", "On", CV_SAVE, CV_OnOff, NULL, 0, NULL, NULL, 0, 0, NULL};
|
||||
consvar_t cv_verticallook[MAXSPLITSCREENPLAYERS] = {
|
||||
{"verticallook", "On", CV_SAVE, CV_OnOff, NULL, 0, NULL, NULL, 0, 0, NULL},
|
||||
{"verticallook2", "On", CV_SAVE, CV_OnOff, NULL, 0, NULL, NULL, 0, 0, NULL},
|
||||
{"verticallook3", "On", CV_SAVE, CV_OnOff, NULL, 0, NULL, NULL, 0, 0, NULL},
|
||||
{"verticallook4", "On", CV_SAVE, CV_OnOff, NULL, 0, NULL, NULL, 0, 0, NULL}
|
||||
};
|
||||
|
||||
#if defined(HAVE_SDL) || defined(_WINDOWS) //joystick 1 and 2
|
||||
consvar_t cv_usejoystick[MAXSPLITSCREENPLAYERS] = {
|
||||
{"use_joystick", "1", CV_SAVE|CV_CALL, usejoystick_cons_t, I_InitJoystick1, 0, NULL, NULL, 0, 0, NULL},
|
||||
{"use_joystick2", "2", CV_SAVE|CV_CALL, usejoystick_cons_t, I_InitJoystick2, 0, NULL, NULL, 0, 0, NULL},
|
||||
{"use_joystick3", "3", CV_SAVE|CV_CALL, usejoystick_cons_t, I_InitJoystick3, 0, NULL, NULL, 0, 0, NULL},
|
||||
{"use_joystick4", "4", CV_SAVE|CV_CALL, usejoystick_cons_t, I_InitJoystick4, 0, NULL, NULL, 0, 0, NULL}
|
||||
{"use_joystick", "1", CV_SAVE|CV_CALL, NULL, I_InitJoystick1, 0, NULL, NULL, 0, 0, NULL},
|
||||
{"use_joystick2", "2", CV_SAVE|CV_CALL, NULL, I_InitJoystick2, 0, NULL, NULL, 0, 0, NULL},
|
||||
{"use_joystick3", "3", CV_SAVE|CV_CALL, NULL, I_InitJoystick3, 0, NULL, NULL, 0, 0, NULL},
|
||||
{"use_joystick4", "4", CV_SAVE|CV_CALL, NULL, I_InitJoystick4, 0, NULL, NULL, 0, 0, NULL}
|
||||
};
|
||||
#endif
|
||||
|
||||
#if (defined (LJOYSTICK) || defined (HAVE_SDL))
|
||||
#ifdef LJOYSTICK
|
||||
consvar_t cv_joyport = {"joyport", "/dev/js0", CV_SAVE, joyport_cons_t, NULL, 0, NULL, NULL, 0, 0, NULL};
|
||||
consvar_t cv_joyport2 = {"joyport2", "/dev/js0", CV_SAVE, joyport_cons_t, NULL, 0, NULL, NULL, 0, 0, NULL}; //Alam: for later
|
||||
#endif
|
||||
#if defined (HAVE_SDL)
|
||||
consvar_t cv_joyscale[MAXSPLITSCREENPLAYERS] = {
|
||||
{"joyscale", "1", CV_SAVE|CV_CALL, NULL, I_JoyScale, 0, NULL, NULL, 0, 0, NULL},
|
||||
{"joyscale", "1", CV_SAVE|CV_CALL, NULL, I_JoyScale, 0, NULL, NULL, 0, 0, NULL},
|
||||
{"joyscale2", "1", CV_SAVE|CV_CALL, NULL, I_JoyScale2, 0, NULL, NULL, 0, 0, NULL},
|
||||
{"joyscale3", "1", CV_SAVE|CV_CALL, NULL, I_JoyScale3, 0, NULL, NULL, 0, 0, NULL},
|
||||
{"joyscale4", "1", CV_SAVE|CV_CALL, NULL, I_JoyScale4, 0, NULL, NULL, 0, 0, NULL}
|
||||
};
|
||||
#else
|
||||
consvar_t cv_joyscale[2] = { //Alam: Dummy for save
|
||||
{"joyscale", "1", CV_SAVE|CV_HIDEN, NULL, NULL, 0, NULL, NULL, 0, 0, NULL},
|
||||
{"joyscale", "1", CV_SAVE|CV_HIDEN, NULL, NULL, 0, NULL, NULL, 0, 0, NULL}
|
||||
consvar_t cv_joyscale[MAXSPLITSCREENPLAYERS] = { //Alam: Dummy for save
|
||||
{"joyscale", "1", CV_SAVE|CV_HIDEN, NULL, NULL, 0, NULL, NULL, 0, 0, NULL},
|
||||
{"joyscale2", "1", CV_SAVE|CV_HIDEN, NULL, NULL, 0, NULL, NULL, 0, 0, NULL},
|
||||
{"joyscale3", "1", CV_SAVE|CV_HIDEN, NULL, NULL, 0, NULL, NULL, 0, 0, NULL},
|
||||
{"joyscale4", "1", CV_SAVE|CV_HIDEN, NULL, NULL, 0, NULL, NULL, 0, 0, NULL}
|
||||
};
|
||||
#endif
|
||||
|
||||
@@ -331,19 +331,6 @@ consvar_t cv_matchboxes = {"matchboxes", "Normal", CV_NETVAR|CV_CHEAT|CV_NOSHOWH
|
||||
consvar_t cv_specialrings = {"specialrings", "On", CV_NETVAR|CV_NOSHOWHELP, CV_OnOff, NULL, 0, NULL, NULL, 0, 0, NULL};
|
||||
consvar_t cv_powerstones = {"powerstones", "On", CV_NETVAR|CV_NOSHOWHELP, CV_OnOff, NULL, 0, NULL, NULL, 0, 0, NULL};
|
||||
|
||||
/*consvar_t cv_recycler = {"tv_recycler", "5", CV_NETVAR|CV_CHEAT, chances_cons_t, NULL, 0, NULL, NULL, 0, 0, NULL};
|
||||
consvar_t cv_teleporters = {"tv_teleporter", "5", CV_NETVAR|CV_CHEAT, chances_cons_t, NULL, 0, NULL, NULL, 0, 0, NULL};
|
||||
consvar_t cv_superring = {"tv_superring", "5", CV_NETVAR|CV_CHEAT, chances_cons_t, NULL, 0, NULL, NULL, 0, 0, NULL};
|
||||
consvar_t cv_supersneakers = {"tv_supersneaker", "5", CV_NETVAR|CV_CHEAT, chances_cons_t, NULL, 0, NULL, NULL, 0, 0, NULL};
|
||||
consvar_t cv_invincibility = {"tv_invincibility", "5", CV_NETVAR|CV_CHEAT, chances_cons_t, NULL, 0, NULL, NULL, 0, 0, NULL};
|
||||
consvar_t cv_jumpshield = {"tv_jumpshield", "5", CV_NETVAR|CV_CHEAT, chances_cons_t, NULL, 0, NULL, NULL, 0, 0, NULL};
|
||||
consvar_t cv_watershield = {"tv_watershield", "5", CV_NETVAR|CV_CHEAT, chances_cons_t, NULL, 0, NULL, NULL, 0, 0, NULL};
|
||||
consvar_t cv_ringshield = {"tv_ringshield", "5", CV_NETVAR|CV_CHEAT, chances_cons_t, NULL, 0, NULL, NULL, 0, 0, NULL};
|
||||
consvar_t cv_forceshield = {"tv_forceshield", "5", CV_NETVAR|CV_CHEAT, chances_cons_t, NULL, 0, NULL, NULL, 0, 0, NULL};
|
||||
consvar_t cv_bombshield = {"tv_bombshield", "5", CV_NETVAR|CV_CHEAT, chances_cons_t, NULL, 0, NULL, NULL, 0, 0, NULL};
|
||||
consvar_t cv_1up = {"tv_1up", "5", CV_NETVAR|CV_CHEAT, chances_cons_t, NULL, 0, NULL, NULL, 0, 0, NULL};
|
||||
consvar_t cv_eggmanbox = {"tv_eggman", "5", CV_NETVAR|CV_CHEAT, chances_cons_t, NULL, 0, NULL, NULL, 0, 0, NULL};*/
|
||||
|
||||
// SRB2kart
|
||||
consvar_t cv_sneaker = {"sneaker", "On", CV_NETVAR|CV_CHEAT, CV_OnOff, NULL, 0, NULL, NULL, 0, 0, NULL};
|
||||
consvar_t cv_rocketsneaker = {"rocketsneaker", "On", CV_NETVAR|CV_CHEAT, CV_OnOff, NULL, 0, NULL, NULL, 0, 0, NULL};
|
||||
@@ -459,7 +446,6 @@ consvar_t cv_killingdead = {"killingdead", "Off", CV_NETVAR|CV_NOSHOWHELP, CV_On
|
||||
consvar_t cv_netstat = {"netstat", "Off", 0, CV_OnOff, NULL, 0, NULL, NULL, 0, 0, NULL}; // show bandwidth statistics
|
||||
static CV_PossibleValue_t nettimeout_cons_t[] = {{TICRATE/7, "MIN"}, {60*TICRATE, "MAX"}, {0, NULL}};
|
||||
consvar_t cv_nettimeout = {"nettimeout", "210", CV_CALL|CV_SAVE, nettimeout_cons_t, NetTimeout_OnChange, 0, NULL, NULL, 0, 0, NULL};
|
||||
//static CV_PossibleValue_t jointimeout_cons_t[] = {{5*TICRATE, "MIN"}, {60*TICRATE, "MAX"}, {0, NULL}};
|
||||
consvar_t cv_jointimeout = {"jointimeout", "210", CV_CALL|CV_SAVE, nettimeout_cons_t, JoinTimeout_OnChange, 0, NULL, NULL, 0, 0, NULL};
|
||||
consvar_t cv_maxping = {"maxdelay", "20", CV_SAVE, CV_Unsigned, NULL, 0, NULL, NULL, 0, 0, NULL};
|
||||
|
||||
@@ -652,7 +638,6 @@ void D_RegisterServerCommands(void)
|
||||
COM_AddCommand("addfilelocal", Command_Addfilelocal);
|
||||
COM_AddCommand("addfile", Command_Addfile);
|
||||
COM_AddCommand("addskins", Command_Addskins);
|
||||
COM_AddCommand("localskin", Command_GLocalSkin);
|
||||
COM_AddCommand("listwad", Command_ListWADS_f);
|
||||
COM_AddCommand("listmapthings", Command_ListDoomednums_f);
|
||||
COM_AddCommand("listunusedsprites", Command_ListUnusedSprites_f);
|
||||
@@ -717,7 +702,7 @@ void D_RegisterServerCommands(void)
|
||||
CV_RegisterVar(&cv_competitionboxes);
|
||||
CV_RegisterVar(&cv_matchboxes);
|
||||
|
||||
K_RegisterKartStuff(); // SRB2kart
|
||||
K_RegisterServerKartStuff(); // SRB2kart
|
||||
|
||||
CV_RegisterVar(&cv_ringslinger);
|
||||
|
||||
@@ -741,9 +726,14 @@ void D_RegisterServerCommands(void)
|
||||
CV_RegisterVar(&cv_killingdead);
|
||||
|
||||
// d_clisrv
|
||||
#ifndef NONET
|
||||
#ifdef SATURNJOIN
|
||||
CV_RegisterVar(&cv_allownewsaturnplayer); // need to register it before cv_maxplayers && cv_allownewplayer
|
||||
#endif
|
||||
#endif
|
||||
CV_RegisterVar(&cv_maxplayers);
|
||||
CV_RegisterVar(&cv_resynchattempts);
|
||||
#ifdef SATURNSYNCH
|
||||
#ifdef SATURNPAK
|
||||
CV_RegisterVar(&cv_gamestateattempts);
|
||||
CV_RegisterVar(&cv_resynchcooldown);
|
||||
#endif
|
||||
@@ -754,9 +744,7 @@ void D_RegisterServerCommands(void)
|
||||
CV_RegisterVar(&cv_httpsource);
|
||||
#ifndef NONET
|
||||
CV_RegisterVar(&cv_allownewplayer);
|
||||
#ifdef SATURNJOIN
|
||||
CV_RegisterVar(&cv_allownewsaturnplayer);
|
||||
#endif
|
||||
|
||||
CV_RegisterVar(&cv_joinrefusemessage);
|
||||
CV_RegisterVar(&cv_chatlogsize);
|
||||
#ifdef VANILLAJOINNEXTROUND
|
||||
@@ -795,8 +783,6 @@ void D_RegisterServerCommands(void)
|
||||
CV_RegisterVar(&cv_netdemosyncquality);
|
||||
CV_RegisterVar(&cv_maxdemosize);
|
||||
CV_RegisterVar(&cv_demochangemap);
|
||||
|
||||
CV_RegisterVar(&cv_keyboardlayout);
|
||||
}
|
||||
|
||||
// =========================================================================
|
||||
@@ -855,6 +841,10 @@ void D_RegisterClientCommands(void)
|
||||
COM_AddCommand("stopmovie", Command_StopMovie_f);
|
||||
COM_AddCommand("minigen", M_MinimapGenerate);
|
||||
|
||||
COM_AddCommand("localskin", Command_GLocalSkin);
|
||||
|
||||
K_RegisterClientKartStuff(); // SRB2kart
|
||||
|
||||
CV_RegisterVar(&cv_screenshot_option);
|
||||
CV_RegisterVar(&cv_screenshot_folder);
|
||||
CV_RegisterVar(&cv_moviemode);
|
||||
@@ -905,11 +895,13 @@ void D_RegisterClientCommands(void)
|
||||
#ifdef SEENAMES
|
||||
CV_RegisterVar(&cv_seenames);
|
||||
#endif
|
||||
|
||||
CV_RegisterVar(&cv_rollingdemos);
|
||||
|
||||
CV_RegisterVar(&cv_netstat);
|
||||
CV_RegisterVar(&cv_netticbuffer);
|
||||
CV_RegisterVar(&cv_mindelay);
|
||||
CV_RegisterVar(&cv_lagless);
|
||||
CV_RegisterVar(&cv_gentlemens);
|
||||
|
||||
#ifdef NETGAME_DEVMODE
|
||||
CV_RegisterVar(&cv_fishcake);
|
||||
@@ -924,6 +916,8 @@ void D_RegisterClientCommands(void)
|
||||
|
||||
CV_RegisterVar(&cv_cechotoggle);
|
||||
|
||||
CV_RegisterVar(&cv_keyboardlayout);
|
||||
|
||||
// time attack ghost options are also saved to config
|
||||
CV_RegisterVar(&cv_ghost_besttime);
|
||||
CV_RegisterVar(&cv_ghost_bestlap);
|
||||
@@ -933,7 +927,10 @@ void D_RegisterClientCommands(void)
|
||||
|
||||
COM_AddCommand("displayplayer", Command_Displayplayer_f);
|
||||
|
||||
CV_RegisterVar(&cv_audbuffersize);
|
||||
CV_RegisterVar(&cv_audbuffersize);
|
||||
|
||||
CV_RegisterVar(&cv_palette);
|
||||
CV_RegisterVar(&cv_palettenum);
|
||||
|
||||
// m_menu.c
|
||||
CV_RegisterVar(&cv_chatheight);
|
||||
@@ -944,10 +941,10 @@ void D_RegisterClientCommands(void)
|
||||
CV_RegisterVar(&cv_chatnotifications);
|
||||
CV_RegisterVar(&cv_chatbacktint);
|
||||
CV_RegisterVar(&cv_songcredits);
|
||||
CV_RegisterVar(&cv_showfreeplay);
|
||||
CV_RegisterVar(&cv_showfreeplay);
|
||||
CV_RegisterVar(&cv_skinselectspin);
|
||||
CV_RegisterVar(&cv_showallmaps);
|
||||
|
||||
|
||||
CV_RegisterVar(&cv_growmusic);
|
||||
CV_RegisterVar(&cv_supermusic);
|
||||
|
||||
@@ -968,7 +965,18 @@ void D_RegisterClientCommands(void)
|
||||
CV_RegisterVar(&cv_showfocuslost);
|
||||
CV_RegisterVar(&cv_pauseifunfocused);
|
||||
|
||||
// filesrch.c
|
||||
CV_RegisterVar(&cv_addons_option);
|
||||
CV_RegisterVar(&cv_addons_folder);
|
||||
CV_RegisterVar(&cv_addons_md5);
|
||||
CV_RegisterVar(&cv_addons_showall);
|
||||
CV_RegisterVar(&cv_addons_search_type);
|
||||
CV_RegisterVar(&cv_addons_search_case);
|
||||
|
||||
// g_input.c
|
||||
CV_RegisterVar(&cv_controlperkey);
|
||||
CV_RegisterVar(&cv_turnsmooth);
|
||||
|
||||
for (i = 0; i < MAXSPLITSCREENPLAYERS; i++)
|
||||
{
|
||||
CV_RegisterVar(&cv_turnaxis[i]);
|
||||
@@ -986,45 +994,17 @@ void D_RegisterClientCommands(void)
|
||||
CV_RegisterVar(&cv_custom3axis[i]);
|
||||
CV_RegisterVar(&cv_xdeadzone[i]);
|
||||
CV_RegisterVar(&cv_ydeadzone[i]);
|
||||
}
|
||||
|
||||
// filesrch.c
|
||||
CV_RegisterVar(&cv_addons_option);
|
||||
CV_RegisterVar(&cv_addons_folder);
|
||||
CV_RegisterVar(&cv_addons_md5);
|
||||
CV_RegisterVar(&cv_addons_showall);
|
||||
CV_RegisterVar(&cv_addons_search_type);
|
||||
CV_RegisterVar(&cv_addons_search_case);
|
||||
|
||||
CV_RegisterVar(&cv_controlperkey);
|
||||
CV_RegisterVar(&cv_turnsmooth);
|
||||
|
||||
for (i = 0; i < MAXSPLITSCREENPLAYERS; i++)
|
||||
{
|
||||
CV_RegisterVar(&cv_usejoystick[i]);
|
||||
CV_RegisterVar(&cv_joyscale[i]);
|
||||
CV_RegisterVar(&cv_rumble[i]);
|
||||
CV_RegisterVar(&cv_gamepadled[i]);
|
||||
CV_RegisterVar(&cv_ledpowerup[i]);
|
||||
}
|
||||
|
||||
CV_RegisterVar(&cv_usemouse);
|
||||
CV_RegisterVar(&cv_invertmouse);
|
||||
CV_RegisterVar(&cv_mousesens);
|
||||
CV_RegisterVar(&cv_mouseysens);
|
||||
//CV_RegisterVar(&cv_mousemove);
|
||||
|
||||
for (i = 0; i < MAXSPLITSCREENPLAYERS; i++)
|
||||
{
|
||||
CV_RegisterVar(&cv_usejoystick[i]);
|
||||
}
|
||||
#ifdef LJOYSTICK
|
||||
CV_RegisterVar(&cv_joyport);
|
||||
CV_RegisterVar(&cv_joyport2);
|
||||
#endif
|
||||
|
||||
for (i = 0; i < MAXSPLITSCREENPLAYERS; i++)
|
||||
{
|
||||
CV_RegisterVar(&cv_joyscale[i]);
|
||||
}
|
||||
|
||||
// s_sound.c
|
||||
CV_RegisterVar(&cv_soundvolume);
|
||||
@@ -1033,7 +1013,7 @@ void D_RegisterClientCommands(void)
|
||||
CV_RegisterVar(&cv_midimusicvolume);
|
||||
#endif
|
||||
CV_RegisterVar(&cv_numChannels);
|
||||
|
||||
|
||||
#ifdef HAVE_OPENMPT
|
||||
CV_RegisterVar(&cv_modfilter);
|
||||
CV_RegisterVar(&cv_stereosep);
|
||||
@@ -1048,7 +1028,6 @@ void D_RegisterClientCommands(void)
|
||||
CV_RegisterVar(&cv_renderview);
|
||||
CV_RegisterVar(&cv_vhseffect);
|
||||
CV_RegisterVar(&cv_shittyscreen);
|
||||
CV_RegisterVar(&cv_scr_depth);
|
||||
CV_RegisterVar(&cv_scr_width);
|
||||
CV_RegisterVar(&cv_scr_height);
|
||||
|
||||
@@ -1068,7 +1047,13 @@ void D_RegisterClientCommands(void)
|
||||
|
||||
CV_RegisterVar(&cv_laglesscam);
|
||||
|
||||
CV_RegisterVar(&cv_verticallook);
|
||||
for (i = 0; i < MAXSPLITSCREENPLAYERS; i++)
|
||||
{
|
||||
CV_RegisterVar(&cv_verticallook[i]);
|
||||
}
|
||||
|
||||
CV_RegisterVar(&cv_demodateformat);
|
||||
CV_RegisterVar(&cv_showspecstuff);
|
||||
|
||||
// ingame object placing
|
||||
COM_AddCommand("objectplace", Command_ObjectPlace_f);
|
||||
@@ -1103,8 +1088,6 @@ void D_RegisterClientCommands(void)
|
||||
CV_RegisterVar(&cv_discordasks);
|
||||
#endif
|
||||
|
||||
CV_RegisterVar(&cv_showspecstuff);
|
||||
|
||||
COM_AddCommand("listskins", Command_ListSkins);
|
||||
COM_AddCommand("skinsearch", Command_SkinSearch);
|
||||
}
|
||||
@@ -1413,13 +1396,10 @@ static void SetPlayerName(INT32 playernum, char *newname)
|
||||
else
|
||||
{
|
||||
CONS_Printf(M_GetText("Player %d sent a bad name change\n"), playernum+1);
|
||||
|
||||
if (server && netgame)
|
||||
{
|
||||
UINT8 buf[2];
|
||||
|
||||
buf[0] = (UINT8)playernum;
|
||||
buf[1] = KICK_MSG_CON_FAIL;
|
||||
SendNetXCmd(XD_KICK, &buf, 2);
|
||||
SendKick(playernum, KICK_MSG_CON_FAIL);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1774,24 +1754,8 @@ static void SendNameAndColor3(void)
|
||||
|
||||
if ((foundskin = R_SkinAvailable(cv_skin3.string)) != -1)
|
||||
{
|
||||
//boolean notsame;
|
||||
|
||||
cv_skin3.value = foundskin;
|
||||
|
||||
//notsame = (cv_skin3.value != players[thirdplaya].skin);
|
||||
|
||||
SetPlayerSkin(thirdplaya, cv_skin3.string);
|
||||
|
||||
// SRB2Kart
|
||||
/*if (notsame)
|
||||
{
|
||||
CV_StealthSetValue(&cv_playercolor3, skins[players[thirdplaya].skin].prefcolor);
|
||||
|
||||
players[thirdplaya].skincolor = (cv_playercolor3.value&0x3F) % MAXSKINCOLORS;
|
||||
|
||||
if (players[thirdplaya].mo)
|
||||
players[thirdplaya].mo->color = players[thirdplaya].skincolor;
|
||||
}*/
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -2013,12 +1977,8 @@ static void Got_NameAndColor(UINT8 **cp, INT32 playernum)
|
||||
|
||||
if (kick)
|
||||
{
|
||||
UINT8 buf[2];
|
||||
CONS_Alert(CONS_WARNING, M_GetText("Illegal color change received from %s (team: %d), color: %d)\n"), player_names[playernum], p->ctfteam, p->skincolor);
|
||||
|
||||
buf[0] = (UINT8)playernum;
|
||||
buf[1] = KICK_MSG_CON_FAIL;
|
||||
SendNetXCmd(XD_KICK, &buf, 2);
|
||||
SendKick(playernum, KICK_MSG_CON_FAIL);
|
||||
return;
|
||||
}
|
||||
}
|
||||
@@ -2107,6 +2067,7 @@ void D_SendPlayerConfig(void)
|
||||
SendNameAndColor3();
|
||||
if (splitscreen > 2)
|
||||
SendNameAndColor4();
|
||||
|
||||
SendWeaponPref();
|
||||
if (splitscreen)
|
||||
SendWeaponPref2();
|
||||
@@ -2130,7 +2091,7 @@ static INT32 LookupPlayer(const char *s)
|
||||
if (*s == '0')/* clever way to bypass atoi */
|
||||
return 0;
|
||||
|
||||
if (( playernum = atoi(s) ))
|
||||
if ((playernum = atoi(s)))
|
||||
{
|
||||
playernum = max(min(playernum, MAXPLAYERS-1), 0);/* not out of range */
|
||||
return playernum;
|
||||
@@ -2211,8 +2172,7 @@ static void Command_View_f(void)
|
||||
|
||||
if (viewnum > 1 && !( multiplayer && demo.playback ))
|
||||
{
|
||||
CONS_Alert(CONS_NOTICE,
|
||||
"You must be viewing a multiplayer replay to use this.\n");
|
||||
CONS_Alert(CONS_NOTICE, "You must be viewing a multiplayer replay to use this.\n");
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -2224,13 +2184,16 @@ static void Command_View_f(void)
|
||||
if (COM_Argc() > 1)/* switch to player */
|
||||
{
|
||||
playerparam = COM_Argv(1);
|
||||
|
||||
if (playerparam[0] == '#')/* search by placement */
|
||||
{
|
||||
placenum = atoi(&playerparam[1]);
|
||||
playernum = FindPlayerByPlace(placenum);
|
||||
|
||||
if (playernum == -1 || !G_CouldView(playernum))
|
||||
{
|
||||
GetViewablePlayerPlaceRange(&firstplace, &lastplace);
|
||||
|
||||
if (playernum == -1)
|
||||
{
|
||||
CONS_Alert(CONS_WARNING, "There is no player in that place! ");
|
||||
@@ -2242,6 +2205,7 @@ static void Command_View_f(void)
|
||||
"The first player that you can view is \x82#%d\x80; ",
|
||||
firstplace);
|
||||
}
|
||||
|
||||
CONS_Printf("Last place is \x82#%d\x80.\n", lastplace);
|
||||
return;
|
||||
}
|
||||
@@ -2290,10 +2254,9 @@ static void Command_SetViews_f(void)
|
||||
UINT8 splits;
|
||||
UINT8 newsplits;
|
||||
|
||||
if (!( demo.playback && multiplayer ))
|
||||
if (!(demo.playback && multiplayer))
|
||||
{
|
||||
CONS_Alert(CONS_NOTICE,
|
||||
"You must be viewing a multiplayer replay to use this.\n");
|
||||
CONS_Alert(CONS_NOTICE, "You must be viewing a multiplayer replay to use this.\n");
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -2512,18 +2475,8 @@ void D_MapChange(INT32 mapnum, INT32 newgametype, boolean pencoremode, boolean r
|
||||
// Kick bot from special stages
|
||||
if (botskin)
|
||||
{
|
||||
if (G_IsSpecialStage(mapnum))
|
||||
if (!botingame)
|
||||
{
|
||||
if (botingame)
|
||||
{
|
||||
//CL_RemoveSplitscreenPlayer();
|
||||
botingame = false;
|
||||
playeringame[1] = false;
|
||||
}
|
||||
}
|
||||
else if (!botingame)
|
||||
{
|
||||
//CL_AddSplitscreenPlayer();
|
||||
botingame = true;
|
||||
displayplayers[1] = 1;
|
||||
playeringame[1] = true;
|
||||
@@ -2596,6 +2549,7 @@ void D_PickVote(void)
|
||||
{
|
||||
if (!playeringame[i] || players[i].spectator)
|
||||
continue;
|
||||
|
||||
if (votes[i] != -1)
|
||||
{
|
||||
temppicks[numvotes] = i;
|
||||
@@ -2671,7 +2625,8 @@ static tic_t last_map_cmd = 0;
|
||||
//
|
||||
static void Command_Map_f(void)
|
||||
{
|
||||
if (I_GetTime() - last_map_cmd < 20) {
|
||||
if (I_GetTime() - last_map_cmd < 20)
|
||||
{
|
||||
CONS_Alert(CONS_WARNING, "Map command is used too frequently!\n");
|
||||
return;
|
||||
}
|
||||
@@ -2729,8 +2684,7 @@ static void Command_Map_f(void)
|
||||
{
|
||||
if (!multiplayer)
|
||||
{
|
||||
CONS_Printf(M_GetText(
|
||||
"You can't switch gametypes in single player!\n"));
|
||||
CONS_Printf(M_GetText("You can't switch gametypes in single player!\n"));
|
||||
return;
|
||||
}
|
||||
else if (COM_Argc() < option_gametype + 2)/* no argument after? */
|
||||
@@ -2820,7 +2774,7 @@ static void Command_Map_f(void)
|
||||
// G_TOLFlag handles both multiplayer gametype and ignores it for !multiplayer
|
||||
else
|
||||
{
|
||||
if (!mapheaderinfo[newmapnum-1] || mapheaderinfo[newmapnum-1] == NULL)
|
||||
if (!mapheaderinfo[newmapnum-1])
|
||||
{
|
||||
CONS_Alert(CONS_WARNING, M_GetText("Invalid mapheaderinfo for Course %s (%s)\n"), realmapname, G_BuildMapName(newmapnum));
|
||||
Z_Free(realmapname);
|
||||
@@ -2899,11 +2853,7 @@ static void Got_Mapcmd(UINT8 **cp, INT32 playernum)
|
||||
CONS_Alert(CONS_WARNING, M_GetText("Illegal map change received from %s\n"), player_names[playernum]);
|
||||
if (server)
|
||||
{
|
||||
UINT8 buf[2];
|
||||
|
||||
buf[0] = (UINT8)playernum;
|
||||
buf[1] = KICK_MSG_CON_FAIL;
|
||||
SendNetXCmd(XD_KICK, &buf, 2);
|
||||
SendKick(playernum, KICK_MSG_CON_FAIL);
|
||||
}
|
||||
return;
|
||||
}
|
||||
@@ -2944,9 +2894,6 @@ static void Got_Mapcmd(UINT8 **cp, INT32 playernum)
|
||||
CON_LogMessage(M_GetText("Speeding off to level...\n"));
|
||||
}
|
||||
|
||||
if (demo.playback && !demo.timing)
|
||||
precache = false;
|
||||
|
||||
if (resetplayer)
|
||||
{
|
||||
if (!FLS || (netgame || multiplayer))
|
||||
@@ -2962,8 +2909,7 @@ static void Got_Mapcmd(UINT8 **cp, INT32 playernum)
|
||||
demo.savemode = (cv_recordmultiplayerdemos.value == 2) ? DSM_WILLAUTOSAVE : DSM_NOTSAVING;
|
||||
demo.savebutton = 0;
|
||||
G_InitNew(pencoremode, mapname, resetplayer, skipprecutscene);
|
||||
if (demo.playback && !demo.timing)
|
||||
precache = true;
|
||||
|
||||
if (demo.timing)
|
||||
G_DoneLevelLoad();
|
||||
|
||||
@@ -3022,11 +2968,7 @@ static void Got_Pause(UINT8 **cp, INT32 playernum)
|
||||
CONS_Alert(CONS_WARNING, M_GetText("Illegal pause command received from %s\n"), player_names[playernum]);
|
||||
if (server)
|
||||
{
|
||||
UINT8 buf[2];
|
||||
|
||||
buf[0] = (UINT8)playernum;
|
||||
buf[1] = KICK_MSG_CON_FAIL;
|
||||
SendNetXCmd(XD_KICK, &buf, 2);
|
||||
SendKick(playernum, KICK_MSG_CON_FAIL);
|
||||
}
|
||||
return;
|
||||
}
|
||||
@@ -3071,18 +3013,30 @@ static void Command_ReplayMarker(void)
|
||||
CONS_Printf(M_GetText("You must be in a level to use this.\n"));
|
||||
return;
|
||||
}
|
||||
if (demo.savemode == DSM_WILLAUTOSAVE) {
|
||||
if (demo.savemode == DSM_WILLAUTOSAVE)
|
||||
{
|
||||
demo.savemode = DSM_NOTSAVING;
|
||||
CONS_Printf("Replay unmarked.\n");
|
||||
} else {
|
||||
int adjustedleveltime = leveltime - starttime;
|
||||
}
|
||||
else
|
||||
{
|
||||
demo.savemode = DSM_WILLAUTOSAVE;
|
||||
|
||||
int adjustedleveltime = leveltime - starttime;
|
||||
|
||||
if (adjustedleveltime < 0)
|
||||
adjustedleveltime = 0;
|
||||
|
||||
char *title = G_BuildMapTitle(gamemap);
|
||||
snprintf(demo.titlename, 64, "%s [%i:%02d/%.5s]", title, G_TicsToMinutes(adjustedleveltime, false), G_TicsToSeconds(adjustedleveltime), modeattacking ? "Record Attack" : connectedservername);
|
||||
|
||||
if (title)
|
||||
{
|
||||
snprintf(demo.titlename, 64, "%s [%i:%02d/%.5s]", title, G_TicsToMinutes(adjustedleveltime, false), G_TicsToSeconds(adjustedleveltime), modeattacking ? "Record Attack" : connectedservername);
|
||||
Z_Free(title);
|
||||
}
|
||||
else
|
||||
snprintf(demo.titlename, 64, "[%i:%02d/%.5s]", G_TicsToMinutes(adjustedleveltime, false), G_TicsToSeconds(adjustedleveltime), modeattacking ? "Record Attack" : connectedservername);
|
||||
|
||||
CONS_Printf("Replay will be saved!\n");
|
||||
}
|
||||
}
|
||||
@@ -3113,20 +3067,6 @@ static void Command_Respawn(void)
|
||||
return;
|
||||
}
|
||||
|
||||
/*if (!G_RaceGametype()) // srb2kart: not necessary, respawning makes you lose a bumper in battle, so it's not desirable to use as a way to escape a hit
|
||||
{
|
||||
CONS_Printf(M_GetText("You may only use this in co-op, race, and competition!\n"));
|
||||
return;
|
||||
}*/
|
||||
|
||||
// Retry is quicker. Probably should force people to use it.
|
||||
// nope, this is srb2kart - a complete retry is overkill
|
||||
/*if (!(netgame || multiplayer))
|
||||
{
|
||||
CONS_Printf(M_GetText("You can't use this in Single Player! Use \"retry\" instead.\n"));
|
||||
return;
|
||||
}*/
|
||||
|
||||
SendNetXCmd(XD_RESPAWN, &buf, 4);
|
||||
}
|
||||
|
||||
@@ -3140,11 +3080,7 @@ static void Got_Respawn(UINT8 **cp, INT32 playernum)
|
||||
CONS_Alert(CONS_WARNING, M_GetText("Illegal respawn command received from %s\n"), player_names[playernum]);
|
||||
if (server)
|
||||
{
|
||||
UINT8 buf[2];
|
||||
|
||||
buf[0] = (UINT8)playernum;
|
||||
buf[1] = KICK_MSG_CON_FAIL;
|
||||
SendNetXCmd(XD_KICK, &buf, 2);
|
||||
SendKick(playernum, KICK_MSG_CON_FAIL);
|
||||
}
|
||||
return;
|
||||
}
|
||||
@@ -3214,11 +3150,7 @@ static void Got_Clearscores(UINT8 **cp, INT32 playernum)
|
||||
CONS_Alert(CONS_WARNING, M_GetText("Illegal clear scores command received from %s\n"), player_names[playernum]);
|
||||
if (server)
|
||||
{
|
||||
UINT8 buf[2];
|
||||
|
||||
buf[0] = (UINT8)playernum;
|
||||
buf[1] = KICK_MSG_CON_FAIL;
|
||||
SendNetXCmd(XD_KICK, &buf, 2);
|
||||
SendKick(playernum, KICK_MSG_CON_FAIL);
|
||||
}
|
||||
return;
|
||||
}
|
||||
@@ -3737,11 +3669,7 @@ static void Got_Teamchange(UINT8 **cp, INT32 playernum)
|
||||
CONS_Alert(CONS_WARNING, M_GetText("Illegal team change received from player %s\n"), player_names[playernum]);
|
||||
if (server)
|
||||
{
|
||||
UINT8 buf[2];
|
||||
|
||||
buf[0] = (UINT8)playernum;
|
||||
buf[1] = KICK_MSG_CON_FAIL;
|
||||
SendNetXCmd(XD_KICK, &buf, 2);
|
||||
SendKick(playernum, KICK_MSG_CON_FAIL);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -3752,11 +3680,7 @@ static void Got_Teamchange(UINT8 **cp, INT32 playernum)
|
||||
CONS_Alert(CONS_WARNING, M_GetText("Illegal team change received from player %s\n"), player_names[playernum]);
|
||||
if (server)
|
||||
{
|
||||
UINT8 buf[2];
|
||||
|
||||
buf[0] = (UINT8)playernum;
|
||||
buf[1] = KICK_MSG_CON_FAIL;
|
||||
SendNetXCmd(XD_KICK, &buf, 2);
|
||||
SendKick(playernum, KICK_MSG_CON_FAIL);
|
||||
}
|
||||
return;
|
||||
}
|
||||
@@ -3790,11 +3714,7 @@ static void Got_Teamchange(UINT8 **cp, INT32 playernum)
|
||||
CONS_Alert(CONS_WARNING, M_GetText("Illegal team change received from player %s\n"), player_names[playernum]);
|
||||
if (server)
|
||||
{
|
||||
UINT8 buf[2];
|
||||
|
||||
buf[0] = (UINT8)playernum;
|
||||
buf[1] = KICK_MSG_CON_FAIL;
|
||||
SendNetXCmd(XD_KICK, &buf, 2);
|
||||
SendKick(playernum, KICK_MSG_CON_FAIL);
|
||||
}
|
||||
}
|
||||
return;
|
||||
@@ -3843,12 +3763,8 @@ static void Got_Teamchange(UINT8 **cp, INT32 playernum)
|
||||
|
||||
if (server && ((NetPacket.packet.newteam < 0 || NetPacket.packet.newteam > 3) || error))
|
||||
{
|
||||
UINT8 buf[2];
|
||||
|
||||
buf[0] = (UINT8)playernum;
|
||||
buf[1] = KICK_MSG_CON_FAIL;
|
||||
CONS_Alert(CONS_WARNING, M_GetText("Illegal team change received from player %s\n"), player_names[playernum]);
|
||||
SendNetXCmd(XD_KICK, &buf, 2);
|
||||
SendKick(playernum, KICK_MSG_CON_FAIL);
|
||||
}
|
||||
|
||||
//Safety first!
|
||||
@@ -4217,11 +4133,7 @@ static void Got_Verification(UINT8 **cp, INT32 playernum)
|
||||
CONS_Alert(CONS_WARNING, M_GetText("Illegal verification received from %s (serverplayer is %s)\n"), player_names[playernum], player_names[serverplayer]);
|
||||
if (server)
|
||||
{
|
||||
UINT8 buf[2];
|
||||
|
||||
buf[0] = (UINT8)playernum;
|
||||
buf[1] = KICK_MSG_CON_FAIL;
|
||||
SendNetXCmd(XD_KICK, &buf, 2);
|
||||
SendKick(playernum, KICK_MSG_CON_FAIL);
|
||||
}
|
||||
return;
|
||||
}
|
||||
@@ -4273,11 +4185,7 @@ static void Got_Removal(UINT8 **cp, INT32 playernum)
|
||||
CONS_Alert(CONS_WARNING, M_GetText("Illegal demotion received from %s (serverplayer is %s)\n"), player_names[playernum], player_names[serverplayer]);
|
||||
if (server)
|
||||
{
|
||||
UINT8 buf[2];
|
||||
|
||||
buf[0] = (UINT8)playernum;
|
||||
buf[1] = KICK_MSG_CON_FAIL;
|
||||
SendNetXCmd(XD_KICK, &buf, 2);
|
||||
SendKick(playernum, KICK_MSG_CON_FAIL);
|
||||
}
|
||||
return;
|
||||
}
|
||||
@@ -4353,11 +4261,7 @@ static void Got_MotD_f(UINT8 **cp, INT32 playernum)
|
||||
CONS_Alert(CONS_WARNING, M_GetText("Illegal motd change received from %s\n"), player_names[playernum]);
|
||||
if (server)
|
||||
{
|
||||
UINT8 buf[2];
|
||||
|
||||
buf[0] = (UINT8)playernum;
|
||||
buf[1] = KICK_MSG_CON_FAIL;
|
||||
SendNetXCmd(XD_KICK, &buf, 2);
|
||||
SendKick(playernum, KICK_MSG_CON_FAIL);
|
||||
}
|
||||
|
||||
Z_Free(mymotd);
|
||||
@@ -4416,11 +4320,7 @@ static void Got_RunSOCcmd(UINT8 **cp, INT32 playernum)
|
||||
CONS_Alert(CONS_WARNING, M_GetText("Illegal runsoc command received from %s\n"), player_names[playernum]);
|
||||
if (server)
|
||||
{
|
||||
UINT8 buf[2];
|
||||
|
||||
buf[0] = (UINT8)playernum;
|
||||
buf[1] = KICK_MSG_CON_FAIL;
|
||||
SendNetXCmd(XD_KICK, &buf, 2);
|
||||
SendKick(playernum, KICK_MSG_CON_FAIL);
|
||||
}
|
||||
return;
|
||||
}
|
||||
@@ -4474,7 +4374,7 @@ static void Command_Addfilelocal(void)
|
||||
// Add any wad file, ignoring checks for if it contains complex things like
|
||||
// lua. Great for complex but client-side customizations, like different
|
||||
// level cards or anything like that.
|
||||
P_AddWadFileLocal(fn);
|
||||
P_AddWadFile(fn, true);
|
||||
}
|
||||
|
||||
|
||||
@@ -4569,38 +4469,9 @@ static void Command_Addfile(void)
|
||||
|
||||
/** Adds something at runtime.
|
||||
*/
|
||||
static void
|
||||
Command_Addskins (void)
|
||||
static void Command_Addskins(void)
|
||||
{
|
||||
if (COM_Argc() > 3)
|
||||
{
|
||||
CONS_Printf(
|
||||
"addskins <file>: Load a skin file.\n");
|
||||
return;
|
||||
}
|
||||
// no forcing?
|
||||
/*
|
||||
if (fasticmp(COM_Argv(2), "-force") || fasticmp(COM_Argv(2), "-f")) {
|
||||
CONS_Alert(CONS_NOTICE, M_GetText("Adding file %s. May or may not be a skin.\n"), COM_Argv(1));
|
||||
P_AddWadFile(COM_Argv(1), 0, true);
|
||||
} else {
|
||||
if (DumbStartsWith("KC_", COM_Argv(1))) {
|
||||
P_AddWadFile(COM_Argv(1), 0, true);
|
||||
} else if (DumbStartsWith("KCL_", COM_Argv(1))) {
|
||||
if (!demo.playback) {
|
||||
CONS_Alert(CONS_ERROR, M_GetText("Cannot add file %s as it is a skin with lua. Include -force or -f to force it to load.\n"), COM_Argv(1));
|
||||
return;
|
||||
} else {
|
||||
*/
|
||||
P_AddWadFile(COM_Argv(1), true);
|
||||
/*
|
||||
}
|
||||
} else {
|
||||
CONS_Alert(CONS_ERROR, M_GetText("Cannot add file %s as it is not a skin.\n"), COM_Argv(1));
|
||||
return;
|
||||
}
|
||||
}
|
||||
*/
|
||||
CONS_Printf("addskins has been deprecated\nuse addfilelocal instead!\n");
|
||||
}
|
||||
|
||||
static void Command_GLocalSkin (void)
|
||||
@@ -4616,7 +4487,7 @@ static void Command_GLocalSkin (void)
|
||||
|
||||
char* fuck; // local skin name
|
||||
|
||||
if (!( first_option = COM_FirstOption() ))
|
||||
if (!(first_option = COM_FirstOption()))
|
||||
first_option = COM_Argc();
|
||||
|
||||
if (first_option < 2)
|
||||
@@ -4624,14 +4495,14 @@ static void Command_GLocalSkin (void)
|
||||
/* holy fucking shit */
|
||||
CONS_Printf("localskin <name> [-player <name>] [-display <number>] [-all]:\n");
|
||||
CONS_Printf(M_GetText("Set a localskin via its internal name (usually printed on the console).\n\n\
|
||||
* Using \"-player\" will set a localskin to a specified player.\n\
|
||||
Defaults to yourself.\n\
|
||||
* Using \"-display\" will set a localskin to the displayed player.\n\
|
||||
Defaults to 0, which is the first player displayed.\n\
|
||||
Can go up to 3 for splitscreen.\n\
|
||||
* Using \"-all\" will set a localskin to ALL players.\n\
|
||||
* \"localskin none\" removes the localskin, just like how\n\
|
||||
\"forceskin none\" does.\n"));
|
||||
* Using \"-player\" will set a localskin to a specified player.\n\
|
||||
Defaults to yourself.\n\
|
||||
* Using \"-display\" will set a localskin to the displayed player.\n\
|
||||
Defaults to 0, which is the first player displayed.\n\
|
||||
Can go up to 3 for splitscreen.\n\
|
||||
* Using \"-all\" will set a localskin to ALL players.\n\
|
||||
* \"localskin none\" removes the localskin, just like how\n\
|
||||
\"forceskin none\" does.\n"));
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -4662,7 +4533,7 @@ static void Command_GLocalSkin (void)
|
||||
{
|
||||
int i;
|
||||
|
||||
for (i = 0; i < MAXPLAYERS; ++i)
|
||||
for (i = 0; i < MAXPLAYERS; ++i)
|
||||
{
|
||||
if (!playeringame[i])
|
||||
continue;
|
||||
@@ -4729,13 +4600,8 @@ static void Got_RequestAddfilecmd(UINT8 **cp, INT32 playernum)
|
||||
|
||||
if ((playernum != serverplayer && !IsPlayerAdmin(playernum)) || kick)
|
||||
{
|
||||
UINT8 buf[2];
|
||||
|
||||
CONS_Alert(CONS_WARNING, M_GetText("Illegal addfile command received from %s\n"), player_names[playernum]);
|
||||
|
||||
buf[0] = (UINT8)playernum;
|
||||
buf[1] = KICK_MSG_CON_FAIL;
|
||||
SendNetXCmd(XD_KICK, &buf, 2);
|
||||
SendKick(playernum, KICK_MSG_CON_FAIL);
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -4784,11 +4650,7 @@ static void Got_Addfilecmd(UINT8 **cp, INT32 playernum)
|
||||
CONS_Alert(CONS_WARNING, M_GetText("Illegal addfile command received from %s\n"), player_names[playernum]);
|
||||
if (server)
|
||||
{
|
||||
UINT8 buf[2];
|
||||
|
||||
buf[0] = (UINT8)playernum;
|
||||
buf[1] = KICK_MSG_CON_FAIL;
|
||||
SendNetXCmd(XD_KICK, &buf, 2);
|
||||
SendKick(playernum, KICK_MSG_CON_FAIL);
|
||||
}
|
||||
return;
|
||||
}
|
||||
@@ -5598,11 +5460,7 @@ static void Got_ExitLevelcmd(UINT8 **cp, INT32 playernum)
|
||||
CONS_Alert(CONS_WARNING, M_GetText("Illegal exitlevel command received from %s\n"), player_names[playernum]);
|
||||
if (server)
|
||||
{
|
||||
UINT8 buf[2];
|
||||
|
||||
buf[0] = (UINT8)playernum;
|
||||
buf[1] = KICK_MSG_CON_FAIL;
|
||||
SendNetXCmd(XD_KICK, &buf, 2);
|
||||
SendKick(playernum, KICK_MSG_CON_FAIL);
|
||||
}
|
||||
return;
|
||||
}
|
||||
@@ -5620,11 +5478,7 @@ static void Got_SetupVotecmd(UINT8 **cp, INT32 playernum)
|
||||
CONS_Alert(CONS_WARNING, M_GetText("Illegal vote setup received from %s\n"), player_names[playernum]);
|
||||
if (server)
|
||||
{
|
||||
UINT8 buf[2];
|
||||
|
||||
buf[0] = (UINT8)playernum;
|
||||
buf[1] = KICK_MSG_CON_FAIL;
|
||||
SendNetXCmd(XD_KICK, &buf, 2);
|
||||
SendKick(playernum, KICK_MSG_CON_FAIL);
|
||||
}
|
||||
return;
|
||||
}
|
||||
@@ -5685,11 +5539,7 @@ static void Got_PickVotecmd(UINT8 **cp, INT32 playernum)
|
||||
CONS_Alert(CONS_WARNING, M_GetText("Illegal vote setup received from %s\n"), player_names[playernum]);
|
||||
if (server)
|
||||
{
|
||||
UINT8 buf[2];
|
||||
|
||||
buf[0] = (UINT8)playernum;
|
||||
buf[1] = KICK_MSG_CON_FAIL;
|
||||
SendNetXCmd(XD_KICK, &buf, 2);
|
||||
SendKick(playernum, KICK_MSG_CON_FAIL);
|
||||
}
|
||||
return;
|
||||
}
|
||||
@@ -5732,6 +5582,7 @@ void Command_ExitGame_f(void)
|
||||
botskin = 0;
|
||||
cv_debug = 0;
|
||||
emeralds = 0;
|
||||
automapactive = false;
|
||||
|
||||
if (dirmenu)
|
||||
closefilemenu(true);
|
||||
@@ -5778,12 +5629,8 @@ static void Fishcake_OnChange(void)
|
||||
*/
|
||||
static void Command_Isgamemodified_f(void)
|
||||
{
|
||||
if (majormods)
|
||||
CONS_Printf("The game has been modified with major addons, so you cannot play Record Attack.\n");
|
||||
else if (savemoddata)
|
||||
CONS_Printf("The game has been modified with an addon with its own save data, so you can play Record Attack and earn medals.\n");
|
||||
else if (modifiedgame)
|
||||
CONS_Printf("The game has been modified with only minor addons. You can play Record Attack, earn medals and unlock extras.\n");
|
||||
if (majormods || modifiedgame)
|
||||
CONS_Printf("The game has been modified, Record Attack data will be saved to a seperate savegame.\n");
|
||||
else
|
||||
CONS_Printf("The game has not been modified. You can play Record Attack, earn medals and unlock extras.\n");
|
||||
}
|
||||
@@ -6073,7 +5920,7 @@ static void Command_ListSkins(void)
|
||||
}
|
||||
|
||||
static void Command_SkinSearch(void)
|
||||
{
|
||||
{
|
||||
size_t i;
|
||||
UINT16 s;
|
||||
UINT16 ic = 0;
|
||||
@@ -6083,7 +5930,7 @@ static void Command_SkinSearch(void)
|
||||
{
|
||||
skin_t *skininput = &skins[s];
|
||||
if (strcasestr(skininput->realname,COM_Argv(i)))
|
||||
{
|
||||
{
|
||||
ic++;
|
||||
CONS_Printf("%d. %s%s:\x80 %s\n", ic,HU_SkinColorToConsoleColor(skininput->prefcolor),skininput->realname,skininput->name);
|
||||
}
|
||||
@@ -6328,11 +6175,7 @@ void Got_DiscordInfo(UINT8 **p, INT32 playernum)
|
||||
CONS_Alert(CONS_WARNING, M_GetText("Illegal Discord info command received from %s\n"), player_names[playernum]);
|
||||
if (server)
|
||||
{
|
||||
UINT8 buf[2];
|
||||
|
||||
buf[0] = (UINT8)playernum;
|
||||
buf[1] = KICK_MSG_CON_FAIL;
|
||||
SendNetXCmd(XD_KICK, &buf, 2);
|
||||
SendKick(playernum, KICK_MSG_CON_FAIL);
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
+2
-3
@@ -149,8 +149,9 @@ extern consvar_t cv_pingstyle;
|
||||
//extern consvar_t cv_smallpos;
|
||||
extern consvar_t cv_showminimapnames;
|
||||
extern consvar_t cv_minihead;
|
||||
extern consvar_t cv_showminimapangle;
|
||||
|
||||
extern consvar_t cv_showlapemblem;
|
||||
extern consvar_t cv_showlapemblem;
|
||||
|
||||
extern consvar_t cv_showviewpointtext;
|
||||
extern consvar_t cv_showdownloadprompt;
|
||||
@@ -198,8 +199,6 @@ extern consvar_t cv_betainterscreen;
|
||||
|
||||
extern consvar_t cv_laglesscam;
|
||||
|
||||
extern consvar_t cv_verticallook;
|
||||
|
||||
typedef enum
|
||||
{
|
||||
SKINMENUTYPE_SCROLL = 0,
|
||||
|
||||
+71
-60
@@ -64,11 +64,11 @@ static boolean SV_SendFile(INT32 node, const char *filename, UINT8 fileid);
|
||||
|
||||
#ifdef HAVE_CURL
|
||||
size_t curlwrite_data(void *ptr, size_t size, size_t nmemb, FILE *stream);
|
||||
#if defined(CURL_AT_LEAST_VERSION) && CURL_AT_LEAST_VERSION(7, 35, 0)
|
||||
#if (LIBCURL_VERSION_MAJOR <= 7) && (LIBCURL_VERSION_MINOR < 35)
|
||||
static int curlprogress_callback(void *clientp, double dltotal, double dlnow, double ultotal, double ulnow);
|
||||
#else
|
||||
static int curlprogress_callbackx(void *clientp, curl_off_t dltotal, curl_off_t dlnow, curl_off_t ultotal, curl_off_t ulnow);
|
||||
#define XFERINFOFUNCTION
|
||||
#else
|
||||
static int curlprogress_callback(void *clientp, double dltotal, double dlnow, double ultotal, double ulnow);
|
||||
#endif
|
||||
#endif
|
||||
|
||||
@@ -114,24 +114,14 @@ fileneeded_t fileneeded[MAX_WADFILES]; // List of needed files
|
||||
static I_mutex downloadmutex;
|
||||
char downloaddir[512] = "DOWNLOAD";
|
||||
|
||||
#ifdef CLIENT_LOADINGSCREEN
|
||||
// for cl loading screen
|
||||
INT32 lastfilenum = -1;
|
||||
INT32 downloadcompletednum = 0;
|
||||
UINT32 downloadcompletedsize = 0;
|
||||
INT32 totalfilesrequestednum = 0;
|
||||
UINT32 totalfilesrequestedsize = 0;
|
||||
#endif
|
||||
file_download_t filedownload;
|
||||
|
||||
#ifdef HAVE_CURL
|
||||
static CURL *http_handle;
|
||||
static CURLM *multi_handle;
|
||||
boolean curl_running = false;
|
||||
boolean curl_failedwebdownload = false;
|
||||
static double curl_dlnow;
|
||||
static double curl_dltotal;
|
||||
static UINT32 curl_dlnow;
|
||||
static UINT32 curl_dltotal;
|
||||
static time_t curl_starttime;
|
||||
INT32 curl_transfers = 0;
|
||||
static int curl_runninghandles = 0;
|
||||
static UINT32 curl_origfilesize;
|
||||
static UINT32 curl_origtotalfilesize;
|
||||
@@ -222,6 +212,7 @@ void D_ParseFileneeded(INT32 fileneedednum_parm, UINT8 *fileneededstr, UINT16 fi
|
||||
for (i = firstfile; i < fileneedednum; i++)
|
||||
{
|
||||
fileneeded[i].status = FS_NOTCHECKED; // We haven't even started looking for the file yet
|
||||
fileneeded[i].justdownloaded = false;
|
||||
filestatus = READUINT8(p); // The first byte is the file status
|
||||
fileneeded[i].willsend = (UINT8)(filestatus >> 4);
|
||||
fileneeded[i].totalsize = READUINT32(p); // The four next bytes are the file size
|
||||
@@ -234,10 +225,11 @@ void D_ParseFileneeded(INT32 fileneedednum_parm, UINT8 *fileneededstr, UINT16 fi
|
||||
void CL_PrepareDownloadSaveGame(const char *tmpsave)
|
||||
{
|
||||
#ifdef CLIENT_LOADINGSCREEN
|
||||
lastfilenum = -1;
|
||||
filedownload.current = -1;
|
||||
#endif
|
||||
fileneedednum = 1;
|
||||
fileneeded[0].status = FS_REQUESTED;
|
||||
fileneeded[0].justdownloaded = false;
|
||||
fileneeded[0].totalsize = UINT32_MAX;
|
||||
fileneeded[0].file = NULL;
|
||||
memset(fileneeded[0].md5sum, 0, 16);
|
||||
@@ -552,13 +544,13 @@ INT32 CL_CheckFiles(void)
|
||||
{
|
||||
if (fileneeded[i].status == FS_NOTFOUND || fileneeded[i].status == FS_MD5SUMBAD || fileneeded[i].status == FS_FALLBACK)
|
||||
downloadrequired = true;
|
||||
|
||||
|
||||
if (fileneeded[i].status != FS_OPEN)
|
||||
filestoload++;
|
||||
|
||||
if (fileneeded[i].status != FS_NOTCHECKED) //since we're running this over multiple tics now, its possible for us to come across files checked in previous tics
|
||||
continue;
|
||||
|
||||
|
||||
CONS_Debug(DBG_NETPLAY, "searching for '%s' ", fileneeded[i].filename);
|
||||
|
||||
// Check in already loaded files
|
||||
@@ -662,13 +654,10 @@ static boolean SV_SendFile(INT32 node, const char *filename, UINT8 fileid)
|
||||
q = &((*q)->next);
|
||||
|
||||
// Allocate a file request and append it to the file list
|
||||
p = *q = (filetx_t *)malloc(sizeof (filetx_t));
|
||||
p = *q = (filetx_t *)calloc(1, sizeof(filetx_t)); // Initialise with zeros
|
||||
if (!p)
|
||||
I_Error("SV_SendFile: No more memory\n");
|
||||
|
||||
// Initialise with zeros
|
||||
memset(p, 0, sizeof (filetx_t));
|
||||
|
||||
// Allocate the file name
|
||||
p->id.filename = (char *)malloc(MAX_WADPATH);
|
||||
if (!p->id.filename)
|
||||
@@ -747,13 +736,10 @@ void SV_SendRam(INT32 node, void *data, size_t size, freemethod_t freemethod, UI
|
||||
q = &((*q)->next);
|
||||
|
||||
// Allocate a file request and append it to the file list
|
||||
p = *q = (filetx_t *)malloc(sizeof (filetx_t));
|
||||
p = *q = (filetx_t *)calloc(1, sizeof(filetx_t)); // Initialise with zeros
|
||||
if (!p)
|
||||
I_Error("SV_SendRam: No more memory\n");
|
||||
|
||||
// Initialise with zeros
|
||||
memset(p, 0, sizeof (filetx_t));
|
||||
|
||||
p->ram = freemethod; // Remember how to free the memory block for when we're done sending it
|
||||
p->id.ram = data;
|
||||
p->size = (UINT32)size;
|
||||
@@ -837,6 +823,7 @@ void SV_FileSendTicker(void)
|
||||
|
||||
netbuffer->packettype = PT_FILEFRAGMENT;
|
||||
|
||||
// (((sendbytes-nowsentbyte)*TICRATE)/(I_GetTime()-starttime)<(UINT32)net_bandwidth)
|
||||
while (packetsent-- && filestosend != 0)
|
||||
{
|
||||
for (i = currentnode, j = 0; j < MAXNETNODES;
|
||||
@@ -867,8 +854,12 @@ void SV_FileSendTicker(void)
|
||||
|
||||
if (!transferFiles[f->fileid].file)
|
||||
{
|
||||
I_Error("Can't open file %s: %s",
|
||||
CONS_Alert(CONS_ERROR, "Can't open file %s: %s\n",
|
||||
f->id.filename, strerror(errno));
|
||||
|
||||
SV_EndFileSend(i);
|
||||
HSendPacket(i, true, 0, PT_SERVERREFUSE);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -973,7 +964,7 @@ void Got_Filetxpak(void)
|
||||
|
||||
if (filenum >= fileneedednum)
|
||||
{
|
||||
DEBFILE(va("fileframent not needed %d>%d\n", filenum, fileneedednum));
|
||||
DEBFILE(va("filefragment not needed %d>%d\n", filenum, fileneedednum));
|
||||
//I_Error("Received an unneeded file fragment (file id received: %d, file id needed: %d)\n", filenum, fileneedednum);
|
||||
return;
|
||||
}
|
||||
@@ -994,6 +985,7 @@ void Got_Filetxpak(void)
|
||||
{
|
||||
UINT32 pos = LONG(netbuffer->u.filetxpak.position);
|
||||
UINT16 size = SHORT(netbuffer->u.filetxpak.size);
|
||||
|
||||
// Use a special trick to know when the file is complete (not always used)
|
||||
// WARNING: file fragments can arrive out of order so don't stop yet!
|
||||
if (pos & 0x80000000)
|
||||
@@ -1013,15 +1005,16 @@ void Got_Filetxpak(void)
|
||||
fclose(file->file);
|
||||
file->file = NULL;
|
||||
file->status = FS_FOUND;
|
||||
file->justdownloaded = true;
|
||||
CONS_Printf(M_GetText("Downloading %s...(done)\n"),
|
||||
filename);
|
||||
#ifndef NONET
|
||||
downloadcompletednum++;
|
||||
downloadcompletedsize += file->totalsize;
|
||||
filedownload.completednum++;
|
||||
filedownload.completedsize += file->totalsize;
|
||||
#endif
|
||||
}
|
||||
}
|
||||
else
|
||||
else if (!file->justdownloaded)
|
||||
{
|
||||
const char *s;
|
||||
switch(file->status)
|
||||
@@ -1044,6 +1037,7 @@ void Got_Filetxpak(void)
|
||||
}
|
||||
I_Error("Received a file not requested (file id: %d, file status: %s)\n", filenum, s);
|
||||
}
|
||||
|
||||
// Send ack back quickly
|
||||
if (++filetime == 3)
|
||||
{
|
||||
@@ -1052,7 +1046,7 @@ void Got_Filetxpak(void)
|
||||
}
|
||||
|
||||
#ifdef CLIENT_LOADINGSCREEN
|
||||
lastfilenum = filenum;
|
||||
filedownload.current = filenum;
|
||||
#endif
|
||||
}
|
||||
|
||||
@@ -1201,9 +1195,7 @@ filestatus_t findfile(char *filename, const UINT8 *wantedmd5sum, boolean complet
|
||||
#ifdef HAVE_CURL
|
||||
size_t curlwrite_data(void *ptr, size_t size, size_t nmemb, FILE *stream)
|
||||
{
|
||||
size_t written;
|
||||
written = fwrite(ptr, size, nmemb, stream);
|
||||
return written;
|
||||
return fwrite(ptr, size, nmemb, stream);
|
||||
}
|
||||
|
||||
#ifdef XFERINFOFUNCTION
|
||||
@@ -1217,12 +1209,12 @@ static int curlprogress_callbackx(void *clientp, curl_off_t dltotal, curl_off_t
|
||||
|
||||
curtime = time(NULL);
|
||||
|
||||
curl_dlnow = dlnow;
|
||||
curl_dltotal = dltotal;
|
||||
curl_dlnow = (UINT32)dlnow;
|
||||
curl_dltotal = (UINT32)dltotal;
|
||||
|
||||
if (curtime > curl_starttime)
|
||||
{
|
||||
getbytes = curl_dlnow / (curtime - curl_starttime); // To-do: Make this more accurate???
|
||||
getbytes = ((double)dlnow) / (curtime - curl_starttime); // To-do: Make this more accurate???
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -1242,12 +1234,12 @@ static int curlprogress_callback(void *clientp, double dltotal, double dlnow, do
|
||||
|
||||
curtime = time(NULL);
|
||||
|
||||
curl_dlnow = dlnow;
|
||||
curl_dltotal = dltotal;
|
||||
curl_dlnow = (UINT32)dlnow;
|
||||
curl_dltotal = (UINT32)dltotal;
|
||||
|
||||
if (curtime > curl_starttime)
|
||||
{
|
||||
getbytes = curl_dlnow / (curtime - curl_starttime); // To-do: Make this more accurate???
|
||||
getbytes = ((double)dlnow) / (curtime - curl_starttime); // To-do: Make this more accurate???
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -1289,10 +1281,10 @@ void CURLPrepareFile(const char* url, int dfilenum)
|
||||
curl_easy_setopt(http_handle, CURLOPT_URL, va("%s/%s", url, curl_realname));
|
||||
|
||||
// Only allow HTTP and HTTPS
|
||||
#if defined(CURL_AT_LEAST_VERSION) && CURL_AT_LEAST_VERSION(7, 85, 0)
|
||||
curl_easy_setopt(http_handle, CURLOPT_PROTOCOLS_STR, "http,https");
|
||||
#else
|
||||
#if (LIBCURL_VERSION_MAJOR <= 7) && (LIBCURL_VERSION_MINOR < 85)
|
||||
curl_easy_setopt(http_handle, CURLOPT_PROTOCOLS, CURLPROTO_HTTP|CURLPROTO_HTTPS);
|
||||
#else
|
||||
curl_easy_setopt(http_handle, CURLOPT_PROTOCOLS_STR, "http,https");
|
||||
#endif
|
||||
|
||||
curl_easy_setopt(http_handle, CURLOPT_USERAGENT, va("SRB2Kart/v%d.%d", VERSION, SUBVERSION)); // Set user agent as some servers won't accept invalid user agents.
|
||||
@@ -1314,6 +1306,21 @@ void CURLPrepareFile(const char* url, int dfilenum)
|
||||
|
||||
strcatbf(curl_curfile->filename, downloaddir, "/");
|
||||
curl_curfile->file = fopen(curl_curfile->filename, "wb");
|
||||
|
||||
if (!curl_curfile->file)
|
||||
{
|
||||
CONS_Alert(CONS_ERROR, "Couldnt open %s for writing!\nAborting file download.\nCheck if you have write access to your download folder!\n", curl_curfile->filename);
|
||||
CL_AbortConnection();
|
||||
M_StartMessage(M_GetText(
|
||||
"An error occured when trying to\n"
|
||||
"download missing addons.\n"
|
||||
"See the console or log file\n"
|
||||
"for additional details.\n\n"
|
||||
"Press ESC\n"
|
||||
), NULL, MM_NOTHING);
|
||||
return;
|
||||
}
|
||||
|
||||
curl_easy_setopt(http_handle, CURLOPT_WRITEDATA, curl_curfile->file);
|
||||
curl_easy_setopt(http_handle, CURLOPT_WRITEFUNCTION, curlwrite_data);
|
||||
curl_easy_setopt(http_handle, CURLOPT_NOPROGRESS, 0L);
|
||||
@@ -1324,23 +1331,25 @@ void CURLPrepareFile(const char* url, int dfilenum)
|
||||
#endif
|
||||
|
||||
curl_curfile->status = FS_DOWNLOADING;
|
||||
lastfilenum = dfilenum;
|
||||
curl_multi_add_handle(multi_handle, http_handle);
|
||||
|
||||
curl_multi_perform(multi_handle, &curl_runninghandles);
|
||||
curl_starttime = time(NULL);
|
||||
|
||||
curl_running = true;
|
||||
filedownload.current = dfilenum;
|
||||
filedownload.http_running = true;
|
||||
|
||||
#ifdef HAVE_THREADS
|
||||
I_spawn_thread("http-download", (I_thread_fn)CURLGetFile, NULL);
|
||||
#endif
|
||||
}
|
||||
else
|
||||
filedownload.http_running = false;
|
||||
}
|
||||
|
||||
void CURLAbortFile(void)
|
||||
{
|
||||
curl_running = false;
|
||||
filedownload.http_running = false;
|
||||
|
||||
// lock and unlock to wait for the download thread to exit
|
||||
I_lock_mutex(&downloadmutex);
|
||||
@@ -1357,10 +1366,8 @@ void CURLGetFile(void)
|
||||
int msgs_left; /* how many messages are left */
|
||||
const char *easy_handle_error;
|
||||
boolean running = true;
|
||||
long response_code = 0;
|
||||
static char *filename;
|
||||
|
||||
while (running && curl_running)
|
||||
while (running && filedownload.http_running)
|
||||
{
|
||||
if (curl_runninghandles)
|
||||
{
|
||||
@@ -1374,6 +1381,7 @@ void CURLGetFile(void)
|
||||
CONS_Alert(CONS_WARNING, "curl_multi_wait() failed, code %d.\n", mc);
|
||||
continue;
|
||||
}
|
||||
|
||||
curl_curfile->currentsize = curl_dlnow;
|
||||
curl_curfile->totalsize = curl_dltotal;
|
||||
}
|
||||
@@ -1387,11 +1395,13 @@ void CURLGetFile(void)
|
||||
e = m->easy_handle;
|
||||
easyres = m->data.result;
|
||||
|
||||
filename = Z_StrDup(curl_realname);
|
||||
char *filename = Z_StrDup(curl_realname);
|
||||
nameonly(filename);
|
||||
|
||||
if (easyres != CURLE_OK)
|
||||
{
|
||||
long response_code = 0;
|
||||
|
||||
if (easyres == CURLE_HTTP_RETURNED_ERROR)
|
||||
curl_easy_getinfo(e, CURLINFO_RESPONSE_CODE, &response_code);
|
||||
|
||||
@@ -1399,7 +1409,7 @@ void CURLGetFile(void)
|
||||
curl_curfile->status = FS_FALLBACK;
|
||||
curl_curfile->currentsize = curl_origfilesize;
|
||||
curl_curfile->totalsize = curl_origtotalfilesize;
|
||||
curl_failedwebdownload = true;
|
||||
filedownload.http_failed = true;
|
||||
fclose(curl_curfile->file);
|
||||
remove(curl_curfile->filename);
|
||||
CONS_Printf(M_GetText("Failed to download %s (%s)\n"), filename, easy_handle_error);
|
||||
@@ -1412,36 +1422,37 @@ void CURLGetFile(void)
|
||||
{
|
||||
CONS_Alert(CONS_ERROR, M_GetText("HTTP Download of %s finished but is corrupt or has been modified\n"), filename);
|
||||
curl_curfile->status = FS_FALLBACK;
|
||||
curl_failedwebdownload = true;
|
||||
filedownload.http_failed = true;
|
||||
}
|
||||
else
|
||||
{
|
||||
CONS_Printf(M_GetText("Finished HTTP download of %s\n"), filename);
|
||||
downloadcompletednum++;
|
||||
downloadcompletedsize += curl_curfile->totalsize;
|
||||
filedownload.completednum++;
|
||||
filedownload.completedsize += curl_curfile->totalsize;
|
||||
curl_curfile->status = FS_FOUND;
|
||||
}
|
||||
}
|
||||
|
||||
Z_Free(filename);
|
||||
curl_curfile->file = NULL;
|
||||
curl_transfers--;
|
||||
filedownload.remaining--;
|
||||
curl_multi_remove_handle(multi_handle, e);
|
||||
curl_easy_cleanup(e);
|
||||
|
||||
if (!curl_transfers)
|
||||
if (!filedownload.remaining)
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (!curl_transfers || !curl_running)
|
||||
if (!filedownload.remaining || !filedownload.http_running)
|
||||
{
|
||||
curl_multi_cleanup(multi_handle);
|
||||
curl_global_cleanup();
|
||||
multi_handle = NULL;
|
||||
}
|
||||
curl_running = false;
|
||||
|
||||
filedownload.http_running = false;
|
||||
I_unlock_mutex(downloadmutex);
|
||||
}
|
||||
|
||||
|
||||
+20
-8
@@ -13,6 +13,7 @@
|
||||
#ifndef __D_NETFIL__
|
||||
#define __D_NETFIL__
|
||||
|
||||
#include "d_clisrv.h"
|
||||
#include "w_wad.h"
|
||||
|
||||
typedef enum
|
||||
@@ -45,24 +46,35 @@ typedef struct
|
||||
UINT32 currentsize;
|
||||
UINT32 totalsize;
|
||||
filestatus_t status; // The value returned by recsearch
|
||||
boolean justdownloaded; // To prevent late fragments from causing an I_Error
|
||||
} fileneeded_t;
|
||||
|
||||
extern INT32 fileneedednum;
|
||||
extern fileneeded_t fileneeded[MAX_WADFILES];
|
||||
extern char downloaddir[512];
|
||||
|
||||
typedef struct
|
||||
{
|
||||
#ifdef CLIENT_LOADINGSCREEN
|
||||
extern INT32 lastfilenum;
|
||||
extern INT32 downloadcompletednum;
|
||||
extern UINT32 downloadcompletedsize;
|
||||
extern INT32 totalfilesrequestednum;
|
||||
extern UINT32 totalfilesrequestedsize;
|
||||
INT32 current;
|
||||
INT32 completednum;
|
||||
UINT32 completedsize;
|
||||
INT32 totalnum;
|
||||
UINT32 totalsize;
|
||||
#endif
|
||||
|
||||
#ifdef HAVE_CURL
|
||||
extern boolean curl_failedwebdownload;
|
||||
extern boolean curl_running;
|
||||
extern INT32 curl_transfers;
|
||||
INT32 remaining;
|
||||
boolean http_failed;
|
||||
boolean http_running;
|
||||
|
||||
char http_source[MAX_MIRROR_LENGTH+1];
|
||||
#endif
|
||||
} file_download_t;
|
||||
|
||||
extern file_download_t filedownload;
|
||||
|
||||
#ifdef HAVE_CURL
|
||||
|
||||
typedef struct HTTP_login HTTP_login;
|
||||
|
||||
|
||||
+13
-1
@@ -356,6 +356,16 @@ typedef enum
|
||||
LAP__MAX
|
||||
} laptime_e;
|
||||
|
||||
// yes i made a whole struct for this :chonkbuncle:
|
||||
typedef struct squishdance_s
|
||||
{
|
||||
tic_t countdown; // hold "custom 3" for 2 seconds to engange le dance
|
||||
tic_t time;
|
||||
fixed_t work;
|
||||
fixed_t ang;
|
||||
fixed_t bounce; // hehe squishy
|
||||
} squishdance_t;
|
||||
|
||||
// ========================================================================
|
||||
// PLAYER STRUCTURE
|
||||
// ========================================================================
|
||||
@@ -402,7 +412,7 @@ typedef struct player_s
|
||||
INT32 kartstuff[NUMKARTSTUFF];
|
||||
angle_t frameangle; // for the player add the ability to have the sprite only face other angles
|
||||
angle_t old_frameangle, old_frameangle2;
|
||||
|
||||
|
||||
// SRB2Kart CEP: Sliptide rolling
|
||||
angle_t sliproll;
|
||||
|
||||
@@ -555,6 +565,8 @@ typedef struct player_s
|
||||
|
||||
fixed_t spinoutrot; // When a player spins out, this value increments modulus 360.
|
||||
|
||||
squishdance_t squishdance;
|
||||
|
||||
fixed_t fovadd; // adjust FOV for hw rendering
|
||||
} player_t;
|
||||
|
||||
|
||||
@@ -17,6 +17,8 @@
|
||||
#ifndef __D_THINK__
|
||||
#define __D_THINK__
|
||||
|
||||
#include "doomdef.h"
|
||||
|
||||
#ifdef __GNUG__
|
||||
#pragma interface
|
||||
#endif
|
||||
@@ -50,6 +52,10 @@ typedef struct thinker_s
|
||||
// this one using pointers. Used for garbage collection.
|
||||
INT32 references;
|
||||
boolean cachable;
|
||||
#ifdef PARANOIA
|
||||
INT32 debug_mobjtype;
|
||||
tic_t debug_time;
|
||||
#endif
|
||||
} thinker_t;
|
||||
|
||||
#endif
|
||||
+6
-6
@@ -28,7 +28,7 @@
|
||||
#include "p_local.h" // for var1 and var2, and some constants
|
||||
#include "p_setup.h"
|
||||
#include "r_data.h"
|
||||
#include "r_patch.h"
|
||||
#include "r_fps.h"
|
||||
#include "r_sky.h"
|
||||
#include "r_draw.h" // translation colormap consts (for lua)
|
||||
#include "fastcmp.h"
|
||||
@@ -1799,7 +1799,7 @@ static void readsound(MYFILE *f, INT32 num, const char *savesfxnames[])
|
||||
* \sa readmaincfg()
|
||||
* \author Graue <graue@oceanbase.org>
|
||||
*/
|
||||
static boolean GoodDataFileName(const char *s)
|
||||
/*static boolean GoodDataFileName(const char *s)
|
||||
{
|
||||
const char *p;
|
||||
const char *tail = ".dat";
|
||||
@@ -1819,7 +1819,7 @@ static boolean GoodDataFileName(const char *s)
|
||||
if (fasticmp(s, "online.dat")) return false; // SRB2Kart online replay folder
|
||||
|
||||
return true;
|
||||
}
|
||||
}*/
|
||||
|
||||
static void reademblemdata(MYFILE *f, INT32 num)
|
||||
{
|
||||
@@ -2597,10 +2597,10 @@ static void readmaincfg(MYFILE *f)
|
||||
{
|
||||
maxXtraLife = (UINT8)get_number(word2);
|
||||
}
|
||||
|
||||
else if (fastcmp(word, "GAMEDATA"))
|
||||
{
|
||||
size_t filenamelen;
|
||||
// just ignore it but dont throw a warning
|
||||
/*size_t filenamelen;
|
||||
|
||||
// Check the data filename so that mods
|
||||
// can't write arbitrary files.
|
||||
@@ -2624,7 +2624,7 @@ static void readmaincfg(MYFILE *f)
|
||||
// can't use sprintf since there is %u in savegamename
|
||||
strcatbf(savegamename, srb2home, PATHSEP);
|
||||
|
||||
refreshdirmenu |= REFRESHDIR_GAMEDATA;
|
||||
refreshdirmenu |= REFRESHDIR_GAMEDATA;*/
|
||||
}
|
||||
else if (fastcmp(word, "RESETDATA"))
|
||||
{
|
||||
|
||||
+10
-4
@@ -388,7 +388,7 @@ static void DRPC_GotServerIP(UINT32 address)
|
||||
--------------------------------------------------*/
|
||||
static const char *DRPC_GetServerIP(void)
|
||||
{
|
||||
const char *address;
|
||||
const char *address;
|
||||
|
||||
// If you're connected
|
||||
if (I_GetNodeAddress && (address = I_GetNodeAddress(servernode)) != NULL)
|
||||
@@ -489,7 +489,7 @@ void DRPC_UpdatePresence(void)
|
||||
{
|
||||
#endif
|
||||
discordPresence.state = "Private";
|
||||
#ifdef MASTERSERVER
|
||||
#ifdef MASTERSERVER
|
||||
}
|
||||
#endif
|
||||
|
||||
@@ -571,9 +571,15 @@ void DRPC_UpdatePresence(void)
|
||||
{
|
||||
// Map name on tool tip
|
||||
char *title = G_BuildMapTitle(gamemap);
|
||||
snprintf(mapname, 48, "Map: %s", title);
|
||||
if (title)
|
||||
{
|
||||
snprintf(mapname, 48, "Map: %s", title);
|
||||
Z_Free(title);
|
||||
}
|
||||
else
|
||||
snprintf(mapname, 48, "Map: UNKNOWN");
|
||||
|
||||
discordPresence.largeImageText = mapname;
|
||||
Z_Free(title);
|
||||
}
|
||||
|
||||
if (gamestate == GS_LEVEL && Playing())
|
||||
|
||||
+17
-10
@@ -113,8 +113,8 @@ extern char logfilename[1024];
|
||||
#else
|
||||
#define VERSION 1 // Game version
|
||||
#define SUBVERSION 6 // more precise version number
|
||||
#define VERSIONSTRING "Saturn v7.2"
|
||||
#define VERSIONSTRINGW L"Saturn v7.2"
|
||||
#define VERSIONSTRING "Saturn v8.2"
|
||||
#define VERSIONSTRINGW L"Saturn v8.2"
|
||||
// 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!
|
||||
@@ -547,6 +547,19 @@ UINT32 quickncasehash (const char *p, size_t n)
|
||||
#define DBL_EPSILON 2.2204460492503131e-16l
|
||||
#endif
|
||||
|
||||
#if defined(__GNUC__) || defined(__clang__)
|
||||
#ifndef LIKELY
|
||||
#define LIKELY(x) __builtin_expect(!!(x), 1)
|
||||
#endif
|
||||
|
||||
#ifndef UNLIKELY
|
||||
#define UNLIKELY(x) __builtin_expect(!!(x), 0)
|
||||
#endif
|
||||
#else
|
||||
#define LIKELY(x) (x)
|
||||
#define UNLIKELY(x) (x)
|
||||
#endif
|
||||
|
||||
// An assert-type mechanism.
|
||||
#ifdef PARANOIA
|
||||
#define I_Assert(e) ((e) ? (void)0 : I_Error("assert failed: %s, file %s, line %d", #e, __FILE__, __LINE__))
|
||||
@@ -571,21 +584,15 @@ extern const char *compdate, *comptime, *comprevision, *compbranch;
|
||||
|
||||
#ifndef NONET
|
||||
//-- SATURN __
|
||||
/// Enable gamestate resynching between Saturn servers and clients
|
||||
/// Like SRB2 and RR does
|
||||
/// Still highly experimental
|
||||
#ifdef DOSATURNSYNCH
|
||||
#define SATURNSYNCH
|
||||
|
||||
/// Detect if a client is on Saturn in the clientconfig.
|
||||
/// To seperately allow them to join or block joining from vanilla clients.
|
||||
#ifdef DOSATURNJOIN
|
||||
#define SATURNJOIN
|
||||
#endif
|
||||
#endif
|
||||
|
||||
/// Server detection for if a connecting client is on Saturn.
|
||||
/// For stuff like extra synching, etc.
|
||||
/// This also enables gamestate resynching between Saturn servers and clients
|
||||
/// Like SRB2 and RR does
|
||||
#ifdef DOSATURNPAK
|
||||
#define SATURNPAK
|
||||
#endif
|
||||
|
||||
+2
-20
@@ -244,7 +244,7 @@ typedef struct
|
||||
INT16 nextlevel; ///< Map number of next level, or 1100-1102 to end.
|
||||
char musname[7]; ///< Music track to play. "" for no music.
|
||||
UINT16 mustrack; ///< Subsong to play. Only really relevant for music modules and specific formats supported by GME. 0 to ignore.
|
||||
UINT32 muspos; ///< Music position to jump to.
|
||||
UINT32 muspos; ///< Music position to jump to.
|
||||
char forcecharacter[17]; ///< (SKINNAMESIZE+1) Skin to switch to or "" to disable.
|
||||
UINT8 weather; ///< 0 = sunny day, 1 = storm, 2 = snow, 3 = rain, 4 = blank, 5 = thunder w/o rain, 6 = rain w/o lightning, 7 = heat wave.
|
||||
INT16 skynum; ///< Sky number to use.
|
||||
@@ -276,7 +276,7 @@ typedef struct
|
||||
|
||||
// SRB2kart
|
||||
//boolean automap; ///< Displays a level's white map outline in modified games
|
||||
fixed_t mobj_scale; ///< Replacement for TOL_ERZ3
|
||||
fixed_t mobj_scale; ///< Replacement for TOL_ERZ3
|
||||
|
||||
mapheader_lighting_t lighting; ///< Wall and sprite lighting
|
||||
mapheader_lighting_t lighting_encore; ///< Alternative lighting for Encore mode
|
||||
@@ -361,9 +361,6 @@ enum GameType // SRB2Kart
|
||||
// String names for gametypes
|
||||
extern const char *Gametype_Names[NUMGAMETYPES];
|
||||
|
||||
extern tic_t totalplaytime;
|
||||
extern UINT32 matchesplayed;
|
||||
|
||||
extern UINT8 stagefailed;
|
||||
|
||||
// Emeralds stored as bits to throw savegame hackers off.
|
||||
@@ -539,18 +536,6 @@ extern mapthing_t *playerstarts[MAXPLAYERS]; // Cooperative
|
||||
extern mapthing_t *bluectfstarts[MAXPLAYERS]; // CTF
|
||||
extern mapthing_t *redctfstarts[MAXPLAYERS]; // CTF
|
||||
|
||||
#define WAYPOINTSEQUENCESIZE 256
|
||||
#define NUMWAYPOINTSEQUENCES 256
|
||||
extern mobj_t *waypoints[NUMWAYPOINTSEQUENCES][WAYPOINTSEQUENCESIZE];
|
||||
extern UINT16 numwaypoints[NUMWAYPOINTSEQUENCES];
|
||||
|
||||
void P_AddWaypoint(UINT8 sequence, UINT8 id, mobj_t *waypoint);
|
||||
mobj_t *P_GetFirstWaypoint(UINT8 sequence);
|
||||
mobj_t *P_GetLastWaypoint(UINT8 sequence);
|
||||
mobj_t *P_GetPreviousWaypoint(mobj_t *current, boolean wrap);
|
||||
mobj_t *P_GetNextWaypoint(mobj_t *current, boolean wrap);
|
||||
mobj_t *P_GetClosestWaypoint(UINT8 sequence, mobj_t *mo);
|
||||
|
||||
// =====================================
|
||||
// Internal parameters, used for engine.
|
||||
// =====================================
|
||||
@@ -571,9 +556,6 @@ extern FILE *debugfile;
|
||||
extern INT32 debugload;
|
||||
#endif
|
||||
|
||||
// if true, load all graphics at level load
|
||||
extern boolean precache;
|
||||
|
||||
// wipegamestate can be set to -1
|
||||
// to force a wipe on the next draw
|
||||
extern gamestate_t wipegamestate;
|
||||
|
||||
@@ -1,21 +0,0 @@
|
||||
#include "../doomdef.h"
|
||||
#include "../d_main.h"
|
||||
#include "../m_argv.h"
|
||||
|
||||
int main(int argc, char **argv)
|
||||
{
|
||||
myargc = argc;
|
||||
myargv = argv; /// \todo pull out path to exe from this string
|
||||
|
||||
// startup SRB2
|
||||
CONS_Printf("Setting up SRB2...\n");
|
||||
D_SRB2Main();
|
||||
CONS_Printf("Entering main game loop...\n");
|
||||
// never return
|
||||
D_SRB2Loop();
|
||||
|
||||
// return to OS
|
||||
#ifndef __GNUC__
|
||||
return 0;
|
||||
#endif
|
||||
}
|
||||
@@ -1,6 +0,0 @@
|
||||
#include "../i_net.h"
|
||||
|
||||
boolean I_InitNetwork(void)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
@@ -1,217 +0,0 @@
|
||||
#include "../i_sound.h"
|
||||
|
||||
UINT8 sound_started = 0;
|
||||
|
||||
void *I_GetSfx(sfxinfo_t *sfx)
|
||||
{
|
||||
(void)sfx;
|
||||
return NULL;
|
||||
}
|
||||
|
||||
void I_FreeSfx(sfxinfo_t *sfx)
|
||||
{
|
||||
(void)sfx;
|
||||
}
|
||||
|
||||
void I_StartupSound(void){}
|
||||
|
||||
void I_ShutdownSound(void){}
|
||||
|
||||
void I_UpdateSound(void){};
|
||||
|
||||
//
|
||||
// SFX I/O
|
||||
//
|
||||
|
||||
INT32 I_StartSound(sfxenum_t id, UINT8 vol, UINT8 sep, UINT8 pitch, UINT8 priority, INT32 channel)
|
||||
{
|
||||
(void)id;
|
||||
(void)vol;
|
||||
(void)sep;
|
||||
(void)pitch;
|
||||
(void)priority;
|
||||
(void)channel;
|
||||
return -1;
|
||||
}
|
||||
|
||||
void I_StopSound(INT32 handle)
|
||||
{
|
||||
(void)handle;
|
||||
}
|
||||
|
||||
boolean I_SoundIsPlaying(INT32 handle)
|
||||
{
|
||||
(void)handle;
|
||||
return false;
|
||||
}
|
||||
|
||||
void I_UpdateSoundParams(INT32 handle, UINT8 vol, UINT8 sep, UINT8 pitch)
|
||||
{
|
||||
(void)handle;
|
||||
(void)vol;
|
||||
(void)sep;
|
||||
(void)pitch;
|
||||
}
|
||||
|
||||
void I_SetSfxVolume(UINT8 volume)
|
||||
{
|
||||
(void)volume;
|
||||
}
|
||||
|
||||
/// ------------------------
|
||||
// MUSIC SYSTEM
|
||||
/// ------------------------
|
||||
|
||||
void I_InitMusic(void){}
|
||||
|
||||
void I_ShutdownMusic(void){}
|
||||
|
||||
/// ------------------------
|
||||
// MUSIC PROPERTIES
|
||||
/// ------------------------
|
||||
|
||||
musictype_t I_SongType(void)
|
||||
{
|
||||
return MU_NONE;
|
||||
}
|
||||
|
||||
boolean I_SongPlaying(void)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
boolean I_SongPaused(void)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
/// ------------------------
|
||||
// MUSIC EFFECTS
|
||||
/// ------------------------
|
||||
|
||||
boolean I_SetSongSpeed(float speed)
|
||||
{
|
||||
(void)speed;
|
||||
return false;
|
||||
}
|
||||
|
||||
/// ------------------------
|
||||
// MUSIC SEEKING
|
||||
/// ------------------------
|
||||
|
||||
UINT32 I_GetSongLength(void)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
boolean I_SetSongLoopPoint(UINT32 looppoint)
|
||||
{
|
||||
(void)looppoint;
|
||||
return false;
|
||||
}
|
||||
|
||||
UINT32 I_GetSongLoopPoint(void)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
boolean I_SetSongPosition(UINT32 position)
|
||||
{
|
||||
(void)position;
|
||||
return false;
|
||||
}
|
||||
|
||||
UINT32 I_GetSongPosition(void)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
/// ------------------------
|
||||
// MUSIC PLAYBACK
|
||||
/// ------------------------
|
||||
|
||||
boolean I_LoadSong(char *data, size_t len)
|
||||
{
|
||||
(void)data;
|
||||
(void)len;
|
||||
return -1;
|
||||
}
|
||||
|
||||
void I_UnloadSong(void)
|
||||
{
|
||||
(void)handle;
|
||||
}
|
||||
|
||||
boolean I_PlaySong(boolean looping)
|
||||
{
|
||||
(void)handle;
|
||||
(void)looping;
|
||||
return false;
|
||||
}
|
||||
|
||||
void I_StopSong(void)
|
||||
{
|
||||
(void)handle;
|
||||
}
|
||||
|
||||
void I_PauseSong(void)
|
||||
{
|
||||
(void)handle;
|
||||
}
|
||||
|
||||
void I_ResumeSong(void)
|
||||
{
|
||||
(void)handle;
|
||||
}
|
||||
|
||||
void I_SetMusicVolume(UINT8 volume)
|
||||
{
|
||||
(void)volume;
|
||||
}
|
||||
|
||||
boolean I_SetSongTrack(INT32 track)
|
||||
{
|
||||
(void)track;
|
||||
return false;
|
||||
}
|
||||
|
||||
/// ------------------------
|
||||
// MUSIC FADING
|
||||
/// ------------------------
|
||||
|
||||
void I_SetInternalMusicVolume(UINT8 volume)
|
||||
{
|
||||
(void)volume;
|
||||
}
|
||||
|
||||
void I_StopFadingSong(void)
|
||||
{
|
||||
}
|
||||
|
||||
boolean I_FadeSongFromVolume(UINT8 target_volume, UINT8 source_volume, UINT32 ms, void (*callback)(void));
|
||||
{
|
||||
(void)target_volume;
|
||||
(void)source_volume;
|
||||
(void)ms;
|
||||
return false;
|
||||
}
|
||||
|
||||
boolean I_FadeSong(UINT8 target_volume, UINT32 ms, void (*callback)(void));
|
||||
{
|
||||
(void)target_volume;
|
||||
(void)ms;
|
||||
return false;
|
||||
}
|
||||
|
||||
boolean I_FadeOutStopSong(UINT32 ms)
|
||||
{
|
||||
(void)ms;
|
||||
return false;
|
||||
}
|
||||
|
||||
boolean I_FadeInPlaySong(UINT32 ms, boolean looping)
|
||||
{
|
||||
(void)ms;
|
||||
(void)looping;
|
||||
return false;
|
||||
}
|
||||
@@ -1,174 +0,0 @@
|
||||
#include "../doomdef.h"
|
||||
#include "../i_system.h"
|
||||
|
||||
UINT8 graphics_started = 0;
|
||||
|
||||
UINT8 keyboard_started = 0;
|
||||
|
||||
size_t I_GetFreeMem(size_t *total)
|
||||
{
|
||||
*total = 0;
|
||||
return 0;
|
||||
}
|
||||
|
||||
void I_Sleep(UINT32 ms){}
|
||||
|
||||
precise_t I_GetPreciseTime(void) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
UINT64 I_GetPrecisePrecision(void) {
|
||||
return 1000000;
|
||||
}
|
||||
|
||||
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)
|
||||
{
|
||||
exit(0);
|
||||
}
|
||||
|
||||
void I_Error(const char *error, ...)
|
||||
{
|
||||
(void)error;
|
||||
exit(-1);
|
||||
}
|
||||
|
||||
void I_Tactile(FFType Type, const JoyFF_t *Effect)
|
||||
{
|
||||
(void)Type;
|
||||
(void)Effect;
|
||||
}
|
||||
|
||||
void I_Tactile2(FFType Type, const JoyFF_t *Effect)
|
||||
{
|
||||
(void)Type;
|
||||
(void)Effect;
|
||||
}
|
||||
|
||||
void I_JoyScale(void){}
|
||||
|
||||
void I_JoyScale2(void){}
|
||||
|
||||
void I_InitJoystick(void){}
|
||||
|
||||
void I_InitJoystick2(void){}
|
||||
|
||||
INT32 I_NumJoys(void)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
const char *I_GetJoyName(INT32 joyindex)
|
||||
{
|
||||
(void)joyindex;
|
||||
return NULL;
|
||||
}
|
||||
|
||||
#ifndef NOMUMBLE
|
||||
void I_UpdateMumble(const mobj_t *mobj, const listener_t listener)
|
||||
{
|
||||
(void)mobj;
|
||||
(void)listener;
|
||||
}
|
||||
#endif
|
||||
|
||||
void I_OutputMsg(const char *error, ...)
|
||||
{
|
||||
(void)error;
|
||||
}
|
||||
|
||||
void I_StartupMouse(void){}
|
||||
|
||||
void I_StartupKeyboard(void){}
|
||||
|
||||
INT32 I_GetKey(void)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
void I_StartupTimer(void){}
|
||||
|
||||
void I_AddExitFunc(void (*func)())
|
||||
{
|
||||
(void)func;
|
||||
}
|
||||
|
||||
void I_RemoveExitFunc(void (*func)())
|
||||
{
|
||||
(void)func;
|
||||
}
|
||||
|
||||
INT32 I_StartupSystem(void)
|
||||
{
|
||||
return -1;
|
||||
}
|
||||
|
||||
void I_ShutdownSystem(void){}
|
||||
|
||||
void I_GetDiskFreeSpace(INT64* freespace)
|
||||
{
|
||||
*freespace = 0;
|
||||
}
|
||||
|
||||
char *I_GetUserName(void)
|
||||
{
|
||||
return NULL;
|
||||
}
|
||||
|
||||
INT32 I_mkdir(const char *dirname, INT32 unixright)
|
||||
{
|
||||
(void)dirname;
|
||||
(void)unixright;
|
||||
return -1;
|
||||
}
|
||||
|
||||
const char *I_LocateWad(void)
|
||||
{
|
||||
return NULL;
|
||||
}
|
||||
|
||||
void I_GetJoystickEvents(void){}
|
||||
|
||||
void I_GetJoystick2Events(void){}
|
||||
|
||||
char *I_GetEnv(const char *name)
|
||||
{
|
||||
(void)name;
|
||||
return NULL;
|
||||
}
|
||||
|
||||
INT32 I_PutEnv(char *variable)
|
||||
{
|
||||
(void)variable;
|
||||
return -1;
|
||||
}
|
||||
|
||||
INT32 I_ClipboardCopy(const char *data, size_t size)
|
||||
{
|
||||
(void)data;
|
||||
(void)size;
|
||||
return -1;
|
||||
}
|
||||
|
||||
char *I_ClipboardPaste(void)
|
||||
{
|
||||
return NULL;
|
||||
}
|
||||
|
||||
void I_RegisterSysCommands(void) {}
|
||||
|
||||
#include "../sdl/dosstr.c"
|
||||
|
||||
@@ -1,67 +0,0 @@
|
||||
#include "../doomdef.h"
|
||||
#include "../command.h"
|
||||
#include "../i_video.h"
|
||||
|
||||
rendermode_t rendermode = render_none;
|
||||
|
||||
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){}
|
||||
|
||||
void I_ShutdownGraphics(void){}
|
||||
|
||||
void I_SetPalette(RGBA_t *palette)
|
||||
{
|
||||
(void)palette;
|
||||
}
|
||||
|
||||
INT32 VID_NumModes(void)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
INT32 VID_GetModeForSize(INT32 w, INT32 h)
|
||||
{
|
||||
(void)w;
|
||||
(void)h;
|
||||
return 0;
|
||||
}
|
||||
|
||||
void VID_PrepareModeList(void){}
|
||||
|
||||
INT32 VID_SetMode(INT32 modenum)
|
||||
{
|
||||
(void)modenum;
|
||||
return 0;
|
||||
}
|
||||
|
||||
const char *VID_GetModeName(INT32 modenum)
|
||||
{
|
||||
(void)modenum;
|
||||
return NULL;
|
||||
}
|
||||
|
||||
void I_UpdateNoBlit(void){}
|
||||
|
||||
void I_FinishUpdate(void){}
|
||||
|
||||
void I_UpdateNoVsync(void) {}
|
||||
|
||||
void I_WaitVBL(INT32 count)
|
||||
{
|
||||
(void)count;
|
||||
}
|
||||
|
||||
void I_ReadScreen(UINT8 *scr)
|
||||
{
|
||||
(void)scr;
|
||||
}
|
||||
|
||||
void I_BeginRead(void){}
|
||||
|
||||
void I_EndRead(void){}
|
||||
|
||||
+38
-34
@@ -149,7 +149,7 @@ static UINT8 F_WriteText(void)
|
||||
static void F_NewCutscene(const char *basetext)
|
||||
{
|
||||
cutscene_basetext = basetext;
|
||||
memset(cutscene_disptext,0,sizeof(cutscene_disptext));
|
||||
memset(cutscene_disptext, 0, sizeof(cutscene_disptext));
|
||||
cutscene_writeptr = cutscene_baseptr = 0;
|
||||
cutscene_textspeed = 9;
|
||||
cutscene_textcount = TICRATE/2;
|
||||
@@ -164,14 +164,14 @@ static void F_SkyScroll(INT32 scrollspeed)
|
||||
patch_t *pat, *pat2;
|
||||
INT32 anim2 = 0;
|
||||
|
||||
pat = W_CachePatchName("TITLEBG1", PU_CACHE);
|
||||
pat2 = W_CachePatchName("TITLEBG2", PU_CACHE);
|
||||
pat = W_CachePatchName("TITLEBG1", PU_PATCH_LOWPRIORITY);
|
||||
pat2 = W_CachePatchName("TITLEBG2", PU_PATCH_LOWPRIORITY);
|
||||
|
||||
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) % (SHORT(pat->width)*16))<<FRACBITS) + (R_GetMenuUncap() * scrollspeed))/16;
|
||||
anim2 = (SHORT(pat2->width)<<FRACBITS) - ((((finalecount * scrollspeed) % (SHORT(pat2->width)*16))<<FRACBITS) + (R_GetMenuUncap() * scrollspeed))/16;
|
||||
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;
|
||||
|
||||
// SRB2Kart: F_DrawPatchCol is over-engineered; recoded to be less shitty and error-prone
|
||||
if (rendermode != render_none)
|
||||
@@ -183,15 +183,15 @@ static void F_SkyScroll(INT32 scrollspeed)
|
||||
while (x < w)
|
||||
{
|
||||
V_DrawFixedPatch(x, y, FRACUNIT, V_SNAPTOTOP|V_SNAPTOLEFT, pat, NULL);
|
||||
x += SHORT(pat->width)<<FRACBITS;
|
||||
x += pat->width<<FRACBITS;
|
||||
}
|
||||
|
||||
x = -anim2;
|
||||
y = (BASEVIDHEIGHT - SHORT(pat2->height))<<FRACBITS;
|
||||
y = (BASEVIDHEIGHT - pat2->height)<<FRACBITS;
|
||||
while (x < w)
|
||||
{
|
||||
V_DrawFixedPatch(x, y, FRACUNIT, V_SNAPTOBOTTOM|V_SNAPTOLEFT, pat2, NULL);
|
||||
x += SHORT(pat2->width)<<FRACBITS;
|
||||
x += pat2->width<<FRACBITS;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -263,7 +263,7 @@ void F_IntroDrawer(void)
|
||||
// DRAW A FULL PIC INSTEAD OF FLAT!
|
||||
if (intro_scenenum == 0)
|
||||
{
|
||||
background = W_CachePatchName("KARTKREW", PU_CACHE);
|
||||
background = W_CachePatchName("KARTKREW", PU_PATCH_LOWPRIORITY);
|
||||
highres = true;
|
||||
}
|
||||
|
||||
@@ -534,8 +534,15 @@ static const char *credits[] = {
|
||||
"\"Sunflower\" aka \"AnimeSonic\"",
|
||||
"\"Yuz\" aka \"Yuzler\"",
|
||||
"\"Democrab\"",
|
||||
"\"Expand\" aka \"Maver\"",
|
||||
"\"EXpand\"",
|
||||
"\"Nexit\"",
|
||||
"\"Spee\"",
|
||||
"\"Jin\"",
|
||||
"\"riomccloud\"",
|
||||
"\"chromaticpipe\"",
|
||||
"\"Achii\"",
|
||||
"\"Anonimus\"",
|
||||
"\"scizor300\"",
|
||||
"",
|
||||
"\1Special Thanks",
|
||||
"SEGA",
|
||||
@@ -623,10 +630,10 @@ void F_CreditDrawer(void)
|
||||
V_DrawFill(0, 0, BASEVIDWIDTH, BASEVIDHEIGHT, 31);
|
||||
|
||||
// Draw background
|
||||
V_DrawSciencePatch(0, 0 - FixedMul(32<<FRACBITS, FixedDiv(credbgtimer%TICRATE, TICRATE)), V_SNAPTOTOP, W_CachePatchName("CREDTILE", PU_CACHE), FRACUNIT);
|
||||
V_DrawSciencePatch(0, 0 - FixedMul(32<<FRACBITS, FixedDiv(credbgtimer%TICRATE, TICRATE)), V_SNAPTOTOP, W_CachePatchName("CREDTILE", PU_PATCH_LOWPRIORITY), FRACUNIT);
|
||||
|
||||
V_DrawSciencePatch(0, 0 - FixedMul(40<<FRACBITS, FixedDiv(credbgtimer%(TICRATE/2), (TICRATE/2))), V_SNAPTOTOP, W_CachePatchName("CREDZIGZ", PU_CACHE), FRACUNIT);
|
||||
V_DrawSciencePatch(320<<FRACBITS, 0 - FixedMul(40<<FRACBITS, FixedDiv(credbgtimer%(TICRATE/2), (TICRATE/2))), V_SNAPTOTOP|V_FLIP, W_CachePatchName("CREDZIGZ", PU_CACHE), FRACUNIT);
|
||||
V_DrawSciencePatch(0, 0 - FixedMul(40<<FRACBITS, FixedDiv(credbgtimer%(TICRATE/2), (TICRATE/2))), V_SNAPTOTOP, W_CachePatchName("CREDZIGZ", PU_PATCH_LOWPRIORITY), FRACUNIT);
|
||||
V_DrawSciencePatch(320<<FRACBITS, 0 - FixedMul(40<<FRACBITS, FixedDiv(credbgtimer%(TICRATE/2), (TICRATE/2))), V_SNAPTOTOP|V_FLIP, W_CachePatchName("CREDZIGZ", PU_PATCH_LOWPRIORITY), FRACUNIT);
|
||||
|
||||
// Draw pictures
|
||||
for (i = 0; credits_pics[i].patch; i++)
|
||||
@@ -640,7 +647,7 @@ void F_CreditDrawer(void)
|
||||
sc = FRACUNIT; // quick hack so I don't have to add another field to credits_pics
|
||||
}
|
||||
|
||||
V_DrawFixedPatch(credits_pics[i].x<<FRACBITS, (credits_pics[i].y<<FRACBITS) - 4*(animtimer<<FRACBITS)/5, sc, 0, W_CachePatchName(credits_pics[i].patch, PU_CACHE), colormap);
|
||||
V_DrawFixedPatch(credits_pics[i].x<<FRACBITS, (credits_pics[i].y<<FRACBITS) - 4*(animtimer<<FRACBITS)/5, sc, 0, W_CachePatchName(credits_pics[i].patch, PU_PATCH), colormap);
|
||||
}
|
||||
|
||||
// Dim the background
|
||||
@@ -839,9 +846,9 @@ void F_GameEvaluationDrawer(void)
|
||||
|
||||
patchname[4] = 'A'+(char)i;
|
||||
if (emeralds & (1<<i))
|
||||
V_DrawScaledPatch(x, y, 0, W_CachePatchName(patchname, PU_CACHE));
|
||||
V_DrawScaledPatch(x, y, 0, W_CachePatchName(patchname, PU_PATCH_LOWPRIORITY));
|
||||
else
|
||||
V_DrawTranslucentPatch(x, y, TRANSLEVEL, W_CachePatchName(patchname, PU_CACHE));
|
||||
V_DrawTranslucentPatch(x, y, TRANSLEVEL, W_CachePatchName(patchname, PU_PATCH_LOWPRIORITY));
|
||||
|
||||
eemeralds_cur += INTERVAL;
|
||||
}
|
||||
@@ -857,9 +864,6 @@ void F_GameEvaluationDrawer(void)
|
||||
if (ALL7EMERALDS(emeralds))
|
||||
++timesBeatenWithEmeralds;
|
||||
|
||||
/*if (ultimatemode)
|
||||
++timesBeatenUltimate;*/
|
||||
|
||||
if (M_UpdateUnlockablesAndExtraEmblems(false))
|
||||
S_StartSound(NULL, sfx_ncitem);
|
||||
|
||||
@@ -870,10 +874,10 @@ void F_GameEvaluationDrawer(void)
|
||||
if (finalecount >= 5*TICRATE)
|
||||
{
|
||||
if (drawemblem)
|
||||
V_DrawScaledPatch(120, 192, 0, W_CachePatchName("NWNGA0", PU_CACHE));
|
||||
V_DrawScaledPatch(120, 192, 0, W_CachePatchName("NWNGA0", PU_PATCH_LOWPRIORITY));
|
||||
|
||||
if (drawchaosemblem)
|
||||
V_DrawScaledPatch(200, 192, 0, W_CachePatchName("NWNGA0", PU_CACHE));
|
||||
V_DrawScaledPatch(200, 192, 0, W_CachePatchName("NWNGA0", PU_PATCH_LOWPRIORITY));
|
||||
|
||||
V_DrawString(8, 16, V_YELLOWMAP, "Unlocked:");
|
||||
|
||||
@@ -968,10 +972,10 @@ void F_StartTitleScreen(void)
|
||||
demoDelayLeft = demoDelayTime;
|
||||
demoIdleLeft = demoIdleTime;
|
||||
|
||||
ttbanner = W_CachePatchName("TTKBANNR", PU_LEVEL);
|
||||
ttkart = W_CachePatchName("TTKART", PU_LEVEL);
|
||||
ttcheckers = W_CachePatchName("TTCHECK", PU_LEVEL);
|
||||
ttkflash = W_CachePatchName("TTKFLASH", PU_LEVEL);
|
||||
ttbanner = W_CachePatchName("TTKBANNR", PU_PATCH_LOWPRIORITY);
|
||||
ttkart = W_CachePatchName("TTKART", PU_PATCH_LOWPRIORITY);
|
||||
ttcheckers = W_CachePatchName("TTCHECK", PU_PATCH_LOWPRIORITY);
|
||||
ttkflash = W_CachePatchName("TTKFLASH", PU_PATCH_LOWPRIORITY);
|
||||
}
|
||||
|
||||
// (no longer) De-Demo'd Title Screen
|
||||
@@ -1006,7 +1010,7 @@ void F_TitleScreenDrawer(void)
|
||||
else
|
||||
{
|
||||
INT32 transval = 0;
|
||||
|
||||
|
||||
if (finalecount <= (50+(9<<1)))
|
||||
transval = (finalecount - 50)>>1;
|
||||
|
||||
@@ -1053,8 +1057,8 @@ void F_TitleScreenTicker(boolean run)
|
||||
return;
|
||||
|
||||
// are demos disabled?
|
||||
if (!cv_rollingdemos.value)
|
||||
return;
|
||||
if (!cv_rollingdemos.value || modifiedgame) // occasionally mappacks supply invalid replays which means the game crashes almost always when you idle on the titlescreen too long
|
||||
return; // we check for all addons since added luas/socs and stuff like that makes them desynch like crazy so why would you even watch them?
|
||||
|
||||
// Wait for a while (for the music to finish, preferably)
|
||||
// before starting demos
|
||||
@@ -1186,7 +1190,7 @@ void F_StartWaitingPlayers(void)
|
||||
for (i = 0; i < 2; i++)
|
||||
{
|
||||
sprframe = &skins[randskin].spritedef.spriteframes[(6+(i*3)) & FF_FRAMEMASK];
|
||||
driver[i] = W_CachePatchNum(sprframe->lumppat[1], PU_LEVEL);
|
||||
driver[i] = W_CachePatchNum(sprframe->lumppat[1], PU_CACHE);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1255,15 +1259,15 @@ void F_ContinueDrawer(void)
|
||||
ncontinues = 20;
|
||||
|
||||
if (imcontinuing)
|
||||
contsonic = W_CachePatchName("CONT2", PU_CACHE);
|
||||
contsonic = W_CachePatchName("CONT2", PU_PATCH_LOWPRIORITY);
|
||||
else
|
||||
contsonic = W_CachePatchName("CONT1", PU_CACHE);
|
||||
contsonic = W_CachePatchName("CONT1", PU_PATCH_LOWPRIORITY);
|
||||
|
||||
V_DrawFill(0, 0, BASEVIDWIDTH, BASEVIDHEIGHT, 31);
|
||||
V_DrawCenteredString(BASEVIDWIDTH/2, 100, 0, "CONTINUE?");
|
||||
|
||||
// Draw a Sonic!
|
||||
V_DrawScaledPatch((BASEVIDWIDTH - SHORT(contsonic->width))/2, 32, 0, contsonic);
|
||||
V_DrawScaledPatch((BASEVIDWIDTH - contsonic->width)/2, 32, 0, contsonic);
|
||||
|
||||
// Draw the continue markers! Show continues minus one.
|
||||
x -= ncontinues * 6;
|
||||
@@ -1482,10 +1486,10 @@ void F_CutsceneDrawer(void)
|
||||
{
|
||||
if (cutscenes[cutnum]->scene[scenenum].pichires[picnum])
|
||||
V_DrawSmallScaledPatch(picxpos, picypos, 0,
|
||||
W_CachePatchName(cutscenes[cutnum]->scene[scenenum].picname[picnum], PU_CACHE));
|
||||
W_CachePatchName(cutscenes[cutnum]->scene[scenenum].picname[picnum], PU_PATCH_LOWPRIORITY));
|
||||
else
|
||||
V_DrawScaledPatch(picxpos,picypos, 0,
|
||||
W_CachePatchName(cutscenes[cutnum]->scene[scenenum].picname[picnum], PU_CACHE));
|
||||
W_CachePatchName(cutscenes[cutnum]->scene[scenenum].picname[picnum], PU_PATCH_LOWPRIORITY));
|
||||
}
|
||||
|
||||
if (dofadenow && rendermode != render_none)
|
||||
|
||||
@@ -661,6 +661,10 @@ boolean preparefilemenu(boolean samedepth, boolean replayhut)
|
||||
return false;
|
||||
}
|
||||
|
||||
if (dirmenu != coredirmenu)
|
||||
Z_Free(dirmenu);
|
||||
dirmenu = NULL;
|
||||
|
||||
for (; sizecoredirmenu > 0; sizecoredirmenu--) // clear out existing items
|
||||
{
|
||||
Z_Free(coredirmenu[sizecoredirmenu-1]);
|
||||
|
||||
+507
-391
File diff suppressed because it is too large.
Load diff
+24
-8
@@ -42,6 +42,7 @@ extern savebuffer_t demobuf;
|
||||
|
||||
// demoplaying back and demo recording
|
||||
extern consvar_t cv_recordmultiplayerdemos, cv_netdemosyncquality, cv_maxdemosize, cv_demochangemap;
|
||||
extern consvar_t cv_demodateformat;
|
||||
|
||||
// Publicly-accessible demo vars
|
||||
struct demovars_s {
|
||||
@@ -83,6 +84,8 @@ typedef struct menudemo_s {
|
||||
menudemotype_e type;
|
||||
|
||||
char title[65]; // Null-terminated for string prints
|
||||
char date[11]; // date when replay was recorded
|
||||
char version[12]; // combined version and subversion
|
||||
UINT16 map;
|
||||
UINT8 addonstatus; // What do we need to do addon-wise to play this demo?
|
||||
UINT8 gametype;
|
||||
@@ -170,8 +173,10 @@ extern consvar_t cv_smallposnum;
|
||||
extern consvar_t cv_newspeedometer;
|
||||
|
||||
extern consvar_t cv_saltyhop;
|
||||
extern consvar_t cv_saltyheight;
|
||||
extern consvar_t cv_saltyhopsfx;
|
||||
extern consvar_t cv_saltysquish;
|
||||
extern consvar_t cv_saltyroll;
|
||||
|
||||
extern consvar_t cv_driftsparkpulse;
|
||||
extern consvar_t cv_gravstretch;
|
||||
@@ -182,6 +187,10 @@ extern consvar_t cv_sloperolldist;
|
||||
extern consvar_t cv_sparkroll;
|
||||
extern consvar_t cv_spinoutroll;
|
||||
|
||||
extern consvar_t cv_squishdance, cv_squishdancespeed;
|
||||
|
||||
extern consvar_t cv_playerblendeffects;
|
||||
|
||||
extern consvar_t cv_cechotoggle;
|
||||
|
||||
#ifndef NONET
|
||||
@@ -379,16 +388,24 @@ boolean G_CheckDemoStatus(void);
|
||||
void G_SaveDemo(void);
|
||||
boolean G_DemoTitleResponder(event_t *ev);
|
||||
|
||||
#define G_GametypeHasTeams() (G_IsGameType(GT_TEAMMATCH) || G_IsGameType(GT_CTF))
|
||||
#define G_BattleGametype() (G_IsGameType(GT_MATCH))
|
||||
#define G_RaceGametype() (G_IsGameType(GT_RACE))
|
||||
#define G_TagGametype() (G_IsGameType(GT_TAG) || G_IsGameType(GT_HIDEANDSEEK))
|
||||
|
||||
FUNCINLINE static ATTRINLINE boolean G_IsGameType(int type)
|
||||
{
|
||||
return (gametype == type);
|
||||
}
|
||||
|
||||
FUNCINLINE static ATTRINLINE boolean G_GametypeHasSpectators(void)
|
||||
{
|
||||
return (netgame || (multiplayer && demo.playback));
|
||||
}
|
||||
|
||||
INT32 G_GetGametypeByName(const char *gametypestr);
|
||||
boolean G_IsSpecialStage(INT32 mapnum);
|
||||
boolean G_GametypeUsesLives(void);
|
||||
boolean G_GametypeHasTeams(void);
|
||||
boolean G_GametypeHasSpectators(void);
|
||||
boolean G_BattleGametype(void);
|
||||
UINT8 G_SometimesGetDifferentGametype(UINT8 prefgametype);
|
||||
UINT8 G_GetGametypeColor(INT16 gt);
|
||||
boolean G_RaceGametype(void);
|
||||
boolean G_TagGametype(void);
|
||||
void G_ExitLevel(void);
|
||||
void G_NextLevel(void);
|
||||
void G_Continue(void);
|
||||
@@ -418,7 +435,6 @@ void G_SetRetryFlag(void);
|
||||
void G_ClearRetryFlag(void);
|
||||
boolean G_GetRetryFlag(void);
|
||||
|
||||
|
||||
void G_LoadGameData(void);
|
||||
void G_LoadGameSettings(void);
|
||||
|
||||
|
||||
+141
-160
@@ -20,6 +20,8 @@
|
||||
#include "d_net.h"
|
||||
#include "console.h"
|
||||
|
||||
#include "m_menu.h"
|
||||
|
||||
#include "i_system.h"
|
||||
#include "i_video.h"
|
||||
#include "r_draw.h"
|
||||
@@ -56,44 +58,35 @@ consvar_t cv_rumble[MAXSPLITSCREENPLAYERS] = {
|
||||
{"rumble4", "Off", CV_SAVE|CV_CALL|CV_NOINIT, CV_OnOff, rumble_off_handle4, 0, NULL, NULL, 0, 0, NULL}
|
||||
};
|
||||
|
||||
static CV_PossibleValue_t gamepadled_cons_t[] = {{0, "Off"}, {1, "Skincolor"}, {2, "Mobjcolor"}, {0, NULL}};
|
||||
consvar_t cv_gamepadled[MAXSPLITSCREENPLAYERS] = {
|
||||
{"gamepadled", "On", CV_SAVE|CV_CALL|CV_NOINIT, CV_OnOff, led_off_handle, 0, NULL, NULL, 0, 0, NULL},
|
||||
{"gamepadled2", "On", CV_SAVE|CV_CALL|CV_NOINIT, CV_OnOff, led_off_handle2, 0, NULL, NULL, 0, 0, NULL},
|
||||
{"gamepadled3", "On", CV_SAVE|CV_CALL|CV_NOINIT, CV_OnOff, led_off_handle3, 0, NULL, NULL, 0, 0, NULL},
|
||||
{"gamepadled4", "On", CV_SAVE|CV_CALL|CV_NOINIT, CV_OnOff, led_off_handle4, 0, NULL, NULL, 0, 0, NULL}
|
||||
};
|
||||
|
||||
consvar_t cv_ledpowerup[MAXSPLITSCREENPLAYERS] = {
|
||||
{"ledpowerup", "Off", CV_SAVE|CV_CALL|CV_NOINIT, CV_OnOff, led_off_handle, 0, NULL, NULL, 0, 0, NULL},
|
||||
{"ledpowerup2", "Off", CV_SAVE|CV_CALL|CV_NOINIT, CV_OnOff, led_off_handle2, 0, NULL, NULL, 0, 0, NULL},
|
||||
{"ledpowerup3", "Off", CV_SAVE|CV_CALL|CV_NOINIT, CV_OnOff, led_off_handle3, 0, NULL, NULL, 0, 0, NULL},
|
||||
{"ledpowerup4", "Off", CV_SAVE|CV_CALL|CV_NOINIT, CV_OnOff, led_off_handle4, 0, NULL, NULL, 0, 0, NULL}
|
||||
{"gamepadled", "Skincolor", CV_SAVE|CV_CALL|CV_NOINIT, gamepadled_cons_t, led_off_handle, 0, NULL, NULL, 0, 0, NULL},
|
||||
{"gamepadled2", "Skincolor", CV_SAVE|CV_CALL|CV_NOINIT, gamepadled_cons_t, led_off_handle2, 0, NULL, NULL, 0, 0, NULL},
|
||||
{"gamepadled3", "Skincolor", CV_SAVE|CV_CALL|CV_NOINIT, gamepadled_cons_t, led_off_handle3, 0, NULL, NULL, 0, 0, NULL},
|
||||
{"gamepadled4", "Skincolor", CV_SAVE|CV_CALL|CV_NOINIT, gamepadled_cons_t, led_off_handle4, 0, NULL, NULL, 0, 0, NULL}
|
||||
};
|
||||
|
||||
static void rumble_off_handle(void)
|
||||
{
|
||||
if (cv_rumble[0].value == 0)
|
||||
if (!cv_rumble[0].value)
|
||||
G_ResetPlayerDeviceRumble(0);
|
||||
}
|
||||
|
||||
|
||||
static void rumble_off_handle2(void)
|
||||
{
|
||||
if (cv_rumble[1].value == 0)
|
||||
if (!cv_rumble[1].value)
|
||||
G_ResetPlayerDeviceRumble(1);
|
||||
}
|
||||
|
||||
|
||||
static void rumble_off_handle3(void)
|
||||
{
|
||||
if (cv_rumble[2].value == 0)
|
||||
if (!cv_rumble[2].value)
|
||||
G_ResetPlayerDeviceRumble(2);
|
||||
}
|
||||
|
||||
|
||||
static void rumble_off_handle4(void)
|
||||
{
|
||||
if (cv_rumble[3].value == 0)
|
||||
if (!cv_rumble[3].value)
|
||||
G_ResetPlayerDeviceRumble(3);
|
||||
}
|
||||
|
||||
@@ -102,19 +95,16 @@ static void led_off_handle(void)
|
||||
G_ResetPlayerGamepadIndicatorColor(0);
|
||||
}
|
||||
|
||||
|
||||
static void led_off_handle2(void)
|
||||
{
|
||||
G_ResetPlayerGamepadIndicatorColor(1);
|
||||
}
|
||||
|
||||
|
||||
static void led_off_handle3(void)
|
||||
{
|
||||
G_ResetPlayerGamepadIndicatorColor(2);
|
||||
}
|
||||
|
||||
|
||||
static void led_off_handle4(void)
|
||||
{
|
||||
G_ResetPlayerGamepadIndicatorColor(3);
|
||||
@@ -131,10 +121,7 @@ joy3xmove[JOYAXISSET], joy3ymove[JOYAXISSET], joy4xmove[JOYAXISSET], joy4ymove[J
|
||||
UINT8 gamekeydown[NUMINPUTS];
|
||||
|
||||
// two key codes (or virtual key) per game control
|
||||
INT32 gamecontrol[num_gamecontrols][2];
|
||||
INT32 gamecontrolbis[num_gamecontrols][2]; // secondary splitscreen player
|
||||
INT32 gamecontrol3[num_gamecontrols][2]; // tertiary splitscreen player
|
||||
INT32 gamecontrol4[num_gamecontrols][2]; // quarternary splitscreen player
|
||||
INT32 gamecontrol[MAXSPLITSCREENPLAYERS][num_gamecontrols][2];
|
||||
|
||||
typedef struct
|
||||
{
|
||||
@@ -264,6 +251,26 @@ void G_MapEventsToControls(event_t *ev)
|
||||
}
|
||||
}
|
||||
|
||||
void G_ResetControls(void)
|
||||
{
|
||||
memset(gamekeydown, 0, NUMINPUTS);
|
||||
|
||||
memset(joyxmove, 0, sizeof(joyxmove));
|
||||
memset(joyymove, 0, sizeof(joyymove));
|
||||
|
||||
memset(joy2xmove, 0, sizeof(joy2xmove));
|
||||
memset(joy2ymove, 0, sizeof(joy2ymove));
|
||||
|
||||
memset(joy3xmove, 0, sizeof(joy3xmove));
|
||||
memset(joy3ymove, 0, sizeof(joy3ymove));
|
||||
|
||||
memset(joy4xmove, 0, sizeof(joy4xmove));
|
||||
memset(joy4ymove, 0, sizeof(joy4ymove));
|
||||
|
||||
// reset those just in case the game missed the keyup event
|
||||
memset(dpadscrollstate, false, sizeof(dpadscrollstate));
|
||||
}
|
||||
|
||||
//
|
||||
// General double-click detection routine for any kind of input.
|
||||
//
|
||||
@@ -881,13 +888,16 @@ UINT16 G_GetSkinColor(INT32 playernum)
|
||||
{
|
||||
player_t *player = &players[displayplayers[playernum]];
|
||||
|
||||
// make rgb rainbow vomit when invul or flash blue when grow
|
||||
if (cv_ledpowerup[playernum].value && player->mo && (player->kartstuff[k_invincibilitytimer] || player->kartstuff[k_growshrinktimer] || player->powers[pw_invulnerability]))
|
||||
return player->mo->color;
|
||||
if (player)
|
||||
{
|
||||
// make rgb rainbow vomit when invul or flash blue when grow
|
||||
if ((cv_gamepadled[playernum].value == 2) && player->mo && player->mo->color)
|
||||
return player->mo->color;
|
||||
|
||||
// take actual player skincolour when ingame
|
||||
if (player->skincolor)
|
||||
return player->skincolor;
|
||||
// take actual player skincolour when ingame
|
||||
if (player->skincolor)
|
||||
return player->skincolor;
|
||||
}
|
||||
}
|
||||
|
||||
// otherwise just fallback to whatever the cvar is
|
||||
@@ -944,13 +954,10 @@ static void G_ResetPlayerDeviceRumble(INT32 playernum)
|
||||
void G_ResetAllDeviceRumbles(void)
|
||||
{
|
||||
int i;
|
||||
int devices;
|
||||
|
||||
devices = I_NumJoys();
|
||||
|
||||
for (i = 0; i < devices; i++)
|
||||
for (i = 0; i < MAXSPLITSCREENPLAYERS; i++)
|
||||
{
|
||||
I_GamepadRumble(devices, 0, 0, 0);
|
||||
I_GamepadRumble(i, 0, 0, 0);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -977,13 +984,14 @@ void G_ClearControlKeys(INT32 (*setupcontrols)[2], INT32 control)
|
||||
|
||||
void G_ClearAllControlKeys(void)
|
||||
{
|
||||
INT32 i;
|
||||
for (i = 0; i < num_gamecontrols; i++)
|
||||
INT32 i, k;
|
||||
|
||||
for (k = 0; k < MAXSPLITSCREENPLAYERS; k++)
|
||||
{
|
||||
G_ClearControlKeys(gamecontrol, i);
|
||||
G_ClearControlKeys(gamecontrolbis, i);
|
||||
G_ClearControlKeys(gamecontrol3, i);
|
||||
G_ClearControlKeys(gamecontrol4, i);
|
||||
for (i = 0; i < num_gamecontrols; i++)
|
||||
{
|
||||
G_ClearControlKeys(gamecontrol[k], i);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1022,7 +1030,7 @@ INT32 G_KeyStringtoNum(const char *keystr)
|
||||
if (!keystr[0])
|
||||
return 0;
|
||||
|
||||
if (!keystr[1] && keystr[0] > ' ' && keystr[0] <= 'z')
|
||||
if (!keystr[0] || (!keystr[1] && keystr[0] > ' ' && keystr[0] <= 'z'))
|
||||
return keystr[0];
|
||||
|
||||
if (!strncmp(keystr, "KEY", 3) && keystr[3] >= '0' && keystr[3] <= '9')
|
||||
@@ -1041,158 +1049,131 @@ void G_Controldefault(UINT8 player)
|
||||
if (player == 0 || player == 1)
|
||||
{
|
||||
// Main controls
|
||||
gamecontrol[gc_aimforward ][0] = KEY_UPARROW;
|
||||
gamecontrol[gc_aimbackward][0] = KEY_DOWNARROW;
|
||||
gamecontrol[gc_turnleft ][0] = KEY_LEFTARROW;
|
||||
gamecontrol[gc_turnright ][0] = KEY_RIGHTARROW;
|
||||
gamecontrol[gc_accelerate ][0] = 'a';
|
||||
gamecontrol[gc_drift ][0] = 's';
|
||||
gamecontrol[gc_brake ][0] = 'd';
|
||||
gamecontrol[gc_fire ][0] = KEY_SPACE;
|
||||
gamecontrol[gc_lookback ][0] = KEY_LSHIFT;
|
||||
gamecontrol[0][gc_aimforward ][0] = KEY_UPARROW;
|
||||
gamecontrol[0][gc_aimbackward][0] = KEY_DOWNARROW;
|
||||
gamecontrol[0][gc_turnleft ][0] = KEY_LEFTARROW;
|
||||
gamecontrol[0][gc_turnright ][0] = KEY_RIGHTARROW;
|
||||
gamecontrol[0][gc_accelerate ][0] = 'a';
|
||||
gamecontrol[0][gc_drift ][0] = 's';
|
||||
gamecontrol[0][gc_brake ][0] = 'd';
|
||||
gamecontrol[0][gc_fire ][0] = KEY_SPACE;
|
||||
gamecontrol[0][gc_lookback ][0] = KEY_LSHIFT;
|
||||
|
||||
gamecontrol[gc_accelerate ][1] = KEY_JOY1+0; // A
|
||||
gamecontrol[gc_lookback ][1] = KEY_JOY1+2; // X
|
||||
gamecontrol[gc_brake ][1] = KEY_JOY1+1; // B
|
||||
gamecontrol[gc_fire ][1] = KEY_JOY1+9; // LB
|
||||
gamecontrol[gc_drift ][1] = KEY_JOY1+10; // RB
|
||||
gamecontrol[0][gc_accelerate ][1] = KEY_JOY1+0; // A
|
||||
gamecontrol[0][gc_lookback ][1] = KEY_JOY1+2; // X
|
||||
gamecontrol[0][gc_brake ][1] = KEY_JOY1+1; // B
|
||||
gamecontrol[0][gc_fire ][1] = KEY_JOY1+9; // LB
|
||||
gamecontrol[0][gc_drift ][1] = KEY_JOY1+10; // RB
|
||||
|
||||
// Extra controls
|
||||
gamecontrol[gc_pause ][0] = KEY_PAUSE;
|
||||
gamecontrol[gc_console ][0] = KEY_CONSOLE;
|
||||
gamecontrol[gc_screenshot ][0] = KEY_F8;
|
||||
gamecontrol[gc_recordgif ][0] = KEY_F9;
|
||||
gamecontrol[gc_viewpoint ][0] = KEY_F12;
|
||||
gamecontrol[gc_talkkey ][0] = 't';
|
||||
gamecontrol[0][gc_pause ][0] = KEY_PAUSE;
|
||||
gamecontrol[0][gc_console ][0] = KEY_CONSOLE;
|
||||
gamecontrol[0][gc_screenshot ][0] = KEY_F8;
|
||||
gamecontrol[0][gc_recordgif ][0] = KEY_F9;
|
||||
gamecontrol[0][gc_viewpoint ][0] = KEY_F12;
|
||||
gamecontrol[0][gc_talkkey ][0] = 't';
|
||||
//gamecontrol[gc_teamkey ][0] = 'y';
|
||||
gamecontrol[gc_scores ][0] = KEY_TAB;
|
||||
gamecontrol[gc_spectate ][0] = '\'';
|
||||
gamecontrol[gc_lookup ][0] = KEY_PGUP;
|
||||
gamecontrol[gc_lookdown ][0] = KEY_PGDN;
|
||||
gamecontrol[gc_centerview ][0] = KEY_END;
|
||||
gamecontrol[gc_camreset ][0] = KEY_HOME;
|
||||
gamecontrol[gc_camtoggle ][0] = KEY_BACKSPACE;
|
||||
gamecontrol[0][gc_scores ][0] = KEY_TAB;
|
||||
gamecontrol[0][gc_spectate ][0] = '\'';
|
||||
gamecontrol[0][gc_lookup ][0] = KEY_PGUP;
|
||||
gamecontrol[0][gc_lookdown ][0] = KEY_PGDN;
|
||||
gamecontrol[0][gc_centerview ][0] = KEY_END;
|
||||
gamecontrol[0][gc_camreset ][0] = KEY_HOME;
|
||||
gamecontrol[0][gc_camtoggle ][0] = KEY_BACKSPACE;
|
||||
|
||||
gamecontrol[gc_viewpoint ][1] = KEY_JOY1+3; // Y
|
||||
gamecontrol[gc_pause ][1] = KEY_JOY1+4; // Back
|
||||
gamecontrol[gc_systemmenu ][0] = KEY_JOY1+6; // Start
|
||||
//gamecontrol[gc_camtoggle ][1] = KEY_HAT1+0; // D-Pad Up
|
||||
//gamecontrol[gc_screenshot ][1] = KEY_HAT1+1; // D-Pad Down // absolutely fucking NOT
|
||||
gamecontrol[gc_talkkey ][1] = KEY_HAT1+1; // D-Pad Down
|
||||
gamecontrol[gc_scores ][1] = KEY_HAT1+0; // D-Pad Up
|
||||
gamecontrol[0][gc_viewpoint ][1] = KEY_JOY1+3; // Y
|
||||
gamecontrol[0][gc_pause ][1] = KEY_JOY1+4; // Back
|
||||
gamecontrol[0][gc_systemmenu ][0] = KEY_JOY1+6; // Start
|
||||
//gamecontrol[0][gc_camtoggle ][1] = KEY_HAT1+0; // D-Pad Up
|
||||
//gamecontrol[0][gc_screenshot ][1] = KEY_HAT1+1; // D-Pad Down // absolutely fucking NOT
|
||||
gamecontrol[0][gc_talkkey ][1] = KEY_HAT1+1; // D-Pad Down
|
||||
gamecontrol[0][gc_scores ][1] = KEY_HAT1+0; // D-Pad Up
|
||||
}
|
||||
|
||||
if (player == 0 || player == 2)
|
||||
{
|
||||
// Player 2 controls
|
||||
gamecontrolbis[gc_accelerate ][0] = KEY_2JOY1+0; // A
|
||||
gamecontrolbis[gc_lookback ][0] = KEY_2JOY1+2; // X
|
||||
gamecontrolbis[gc_brake ][0] = KEY_2JOY1+1; // B
|
||||
gamecontrolbis[gc_fire ][0] = KEY_2JOY1+9; // LB
|
||||
gamecontrolbis[gc_drift ][0] = KEY_2JOY1+10; // RB
|
||||
gamecontrol[1][gc_accelerate ][0] = KEY_2JOY1+0; // A
|
||||
gamecontrol[1][gc_lookback ][0] = KEY_2JOY1+2; // X
|
||||
gamecontrol[1][gc_brake ][0] = KEY_2JOY1+1; // B
|
||||
gamecontrol[1][gc_fire ][0] = KEY_2JOY1+9; // LB
|
||||
gamecontrol[1][gc_drift ][0] = KEY_2JOY1+10; // RB
|
||||
}
|
||||
|
||||
if (player == 0 || player == 3)
|
||||
{
|
||||
// Player 3 controls
|
||||
gamecontrol3[gc_accelerate ][0] = KEY_3JOY1+0; // A
|
||||
gamecontrol3[gc_lookback ][0] = KEY_3JOY1+2; // X
|
||||
gamecontrol3[gc_brake ][0] = KEY_3JOY1+1; // B
|
||||
gamecontrol3[gc_fire ][0] = KEY_3JOY1+9; // LB
|
||||
gamecontrol3[gc_drift ][0] = KEY_3JOY1+10; // RB
|
||||
gamecontrol[2][gc_accelerate ][0] = KEY_3JOY1+0; // A
|
||||
gamecontrol[2][gc_lookback ][0] = KEY_3JOY1+2; // X
|
||||
gamecontrol[2][gc_brake ][0] = KEY_3JOY1+1; // B
|
||||
gamecontrol[2][gc_fire ][0] = KEY_3JOY1+9; // LB
|
||||
gamecontrol[2][gc_drift ][0] = KEY_3JOY1+10; // RB
|
||||
}
|
||||
|
||||
if (player == 0 || player == 4)
|
||||
{
|
||||
// Player 4 controls
|
||||
gamecontrol4[gc_accelerate ][0] = KEY_4JOY1+0; // A
|
||||
gamecontrol4[gc_lookback ][0] = KEY_4JOY1+2; // X
|
||||
gamecontrol4[gc_brake ][0] = KEY_4JOY1+1; // B
|
||||
gamecontrol4[gc_fire ][0] = KEY_4JOY1+9; // LB
|
||||
gamecontrol4[gc_drift ][0] = KEY_4JOY1+10; // RB
|
||||
gamecontrol[3][gc_accelerate ][0] = KEY_4JOY1+0; // A
|
||||
gamecontrol[3][gc_lookback ][0] = KEY_4JOY1+2; // X
|
||||
gamecontrol[3][gc_brake ][0] = KEY_4JOY1+1; // B
|
||||
gamecontrol[3][gc_fire ][0] = KEY_4JOY1+9; // LB
|
||||
gamecontrol[3][gc_drift ][0] = KEY_4JOY1+10; // RB
|
||||
}
|
||||
}
|
||||
|
||||
void G_SaveKeySetting(FILE *f)
|
||||
{
|
||||
INT32 i;
|
||||
INT32 i, k;
|
||||
|
||||
for (i = 1; i < num_gamecontrols; i++)
|
||||
static const char *controltext[MAXSPLITSCREENPLAYERS] = {
|
||||
"setcontrol",
|
||||
"setcontrol2",
|
||||
"setcontrol3",
|
||||
"setcontrol4"
|
||||
};
|
||||
|
||||
for (k = 0; k < MAXSPLITSCREENPLAYERS; k++)
|
||||
{
|
||||
fprintf(f, "setcontrol \"%s\" \"%s\"", gamecontrolname[i],
|
||||
G_KeynumToString(gamecontrol[i][0]));
|
||||
for (i = 1; i < num_gamecontrols; i++)
|
||||
{
|
||||
fprintf(f, "%s \"%s\" \"%s\"", controltext[k], gamecontrolname[i],
|
||||
G_KeynumToString(gamecontrol[k][i][0]));
|
||||
|
||||
if (gamecontrol[i][1])
|
||||
fprintf(f, " \"%s\"\n", G_KeynumToString(gamecontrol[i][1]));
|
||||
else
|
||||
fprintf(f, "\n");
|
||||
}
|
||||
|
||||
for (i = 1; i < num_gamecontrols; i++)
|
||||
{
|
||||
fprintf(f, "setcontrol2 \"%s\" \"%s\"", gamecontrolname[i],
|
||||
G_KeynumToString(gamecontrolbis[i][0]));
|
||||
|
||||
if (gamecontrolbis[i][1])
|
||||
fprintf(f, " \"%s\"\n", G_KeynumToString(gamecontrolbis[i][1]));
|
||||
else
|
||||
fprintf(f, "\n");
|
||||
}
|
||||
|
||||
for (i = 1; i < num_gamecontrols; i++)
|
||||
{
|
||||
fprintf(f, "setcontrol3 \"%s\" \"%s\"", gamecontrolname[i],
|
||||
G_KeynumToString(gamecontrol3[i][0]));
|
||||
|
||||
if (gamecontrol3[i][1])
|
||||
fprintf(f, " \"%s\"\n", G_KeynumToString(gamecontrol3[i][1]));
|
||||
else
|
||||
fprintf(f, "\n");
|
||||
}
|
||||
|
||||
for (i = 1; i < num_gamecontrols; i++)
|
||||
{
|
||||
fprintf(f, "setcontrol4 \"%s\" \"%s\"", gamecontrolname[i],
|
||||
G_KeynumToString(gamecontrol4[i][0]));
|
||||
|
||||
if (gamecontrol4[i][1])
|
||||
fprintf(f, " \"%s\"\n", G_KeynumToString(gamecontrol4[i][1]));
|
||||
else
|
||||
fprintf(f, "\n");
|
||||
if (gamecontrol[k][i][1])
|
||||
fprintf(f, " \"%s\"\n", G_KeynumToString(gamecontrol[k][i][1]));
|
||||
else
|
||||
fprintf(f, "\n");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
INT32 G_CheckDoubleUsage(INT32 keynum, boolean modify)
|
||||
{
|
||||
INT32 result = gc_null;
|
||||
|
||||
if (cv_controlperkey.value == 1)
|
||||
{
|
||||
INT32 i, j;
|
||||
for (i = 0; i < num_gamecontrols; i++)
|
||||
INT32 i, j, k;
|
||||
|
||||
for (k = 0; k < MAXSPLITSCREENPLAYERS; k++)
|
||||
{
|
||||
for (j = 0; j < 2; j++)
|
||||
for (i = 0; i < num_gamecontrols; i++)
|
||||
{
|
||||
if (gamecontrol[i][j] == keynum) {
|
||||
result = i;
|
||||
if (modify) gamecontrol[i][j] = KEY_NULL;
|
||||
for (j = 0; j < 2; j++)
|
||||
{
|
||||
if (gamecontrol[k][i][j] == keynum)
|
||||
{
|
||||
result = i;
|
||||
if (modify) gamecontrol[k][i][j] = KEY_NULL;
|
||||
}
|
||||
|
||||
if (result && !modify)
|
||||
return result;
|
||||
}
|
||||
if (gamecontrolbis[i][j] == keynum) {
|
||||
result = i;
|
||||
if (modify) gamecontrolbis[i][j] = KEY_NULL;
|
||||
}
|
||||
if (gamecontrol3[i][j] == keynum) {
|
||||
result = i;
|
||||
if (modify) gamecontrol3[i][j] = KEY_NULL;
|
||||
}
|
||||
if (gamecontrol4[i][j] == keynum) {
|
||||
result = i;
|
||||
if (modify) gamecontrol4[i][j] = KEY_NULL;
|
||||
}
|
||||
if (result && !modify)
|
||||
return result;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
@@ -1346,11 +1327,11 @@ static void setcontrol(INT32 (*gc)[2])
|
||||
INT32 player;
|
||||
boolean nestedoverride = false;
|
||||
|
||||
if ((void*)gc == (void*)&gamecontrol4)
|
||||
if ((void*)gc == (void*)&gamecontrol[3])
|
||||
player = 3;
|
||||
else if ((void*)gc == (void*)&gamecontrol3)
|
||||
else if ((void*)gc == (void*)&gamecontrol[2])
|
||||
player = 2;
|
||||
else if ((void*)gc == (void*)&gamecontrolbis)
|
||||
else if ((void*)gc == (void*)&gamecontrol[1])
|
||||
player = 1;
|
||||
else
|
||||
player = 0;
|
||||
@@ -1413,7 +1394,7 @@ void Command_Setcontrol_f(void)
|
||||
return;
|
||||
}
|
||||
|
||||
setcontrol(gamecontrol);
|
||||
setcontrol(gamecontrol[0]);
|
||||
}
|
||||
|
||||
void Command_Setcontrol2_f(void)
|
||||
@@ -1428,7 +1409,7 @@ void Command_Setcontrol2_f(void)
|
||||
return;
|
||||
}
|
||||
|
||||
setcontrol(gamecontrolbis);
|
||||
setcontrol(gamecontrol[1]);
|
||||
}
|
||||
|
||||
void Command_Setcontrol3_f(void)
|
||||
@@ -1443,7 +1424,7 @@ void Command_Setcontrol3_f(void)
|
||||
return;
|
||||
}
|
||||
|
||||
setcontrol(gamecontrol3);
|
||||
setcontrol(gamecontrol[2]);
|
||||
}
|
||||
|
||||
void Command_Setcontrol4_f(void)
|
||||
@@ -1458,5 +1439,5 @@ void Command_Setcontrol4_f(void)
|
||||
return;
|
||||
}
|
||||
|
||||
setcontrol(gamecontrol4);
|
||||
setcontrol(gamecontrol[3]);
|
||||
}
|
||||
+7
-9
@@ -109,7 +109,6 @@ extern consvar_t cv_mousesens, cv_mouseysens;
|
||||
extern consvar_t cv_controlperkey, cv_turnsmooth;
|
||||
extern consvar_t cv_rumble[MAXSPLITSCREENPLAYERS];
|
||||
extern consvar_t cv_gamepadled[MAXSPLITSCREENPLAYERS];
|
||||
extern consvar_t cv_ledpowerup[MAXSPLITSCREENPLAYERS];
|
||||
|
||||
extern INT32 mousex, mousey;
|
||||
extern INT32 mlooky; //mousey with mlookSensitivity
|
||||
@@ -121,14 +120,12 @@ extern INT32 joyxmove[JOYAXISSET], joyymove[JOYAXISSET], joy2xmove[JOYAXISSET],
|
||||
extern UINT8 gamekeydown[NUMINPUTS];
|
||||
|
||||
// two key codes (or virtual key) per game control
|
||||
extern INT32 gamecontrol[num_gamecontrols][2];
|
||||
extern INT32 gamecontrolbis[num_gamecontrols][2]; // secondary splitscreen player
|
||||
extern INT32 gamecontrol3[num_gamecontrols][2];
|
||||
extern INT32 gamecontrol4[num_gamecontrols][2];
|
||||
#define PLAYER1INPUTDOWN(gc) (gamekeydown[gamecontrol[gc][0]] || gamekeydown[gamecontrol[gc][1]])
|
||||
#define PLAYER2INPUTDOWN(gc) (gamekeydown[gamecontrolbis[gc][0]] || gamekeydown[gamecontrolbis[gc][1]])
|
||||
#define PLAYER3INPUTDOWN(gc) (gamekeydown[gamecontrol3[gc][0]] || gamekeydown[gamecontrol3[gc][1]])
|
||||
#define PLAYER4INPUTDOWN(gc) (gamekeydown[gamecontrol4[gc][0]] || gamekeydown[gamecontrol4[gc][1]])
|
||||
extern INT32 gamecontrol[MAXSPLITSCREENPLAYERS][num_gamecontrols][2];
|
||||
|
||||
#define PLAYER1INPUTDOWN(gc) (gamekeydown[gamecontrol[0][gc][0]] || gamekeydown[gamecontrol[0][gc][1]])
|
||||
#define PLAYER2INPUTDOWN(gc) (gamekeydown[gamecontrol[1][gc][0]] || gamekeydown[gamecontrol[1][gc][1]])
|
||||
#define PLAYER3INPUTDOWN(gc) (gamekeydown[gamecontrol[2][gc][0]] || gamekeydown[gamecontrol[2][gc][1]])
|
||||
#define PLAYER4INPUTDOWN(gc) (gamekeydown[gamecontrol[3][gc][0]] || gamekeydown[gamecontrol[3][gc][1]])
|
||||
|
||||
// peace to my little coder fingers!
|
||||
// check a gamecontrol being active or not
|
||||
@@ -140,6 +137,7 @@ void G_PlayerDeviceRumble(INT32 playernum, UINT16 low_strength, UINT16 high_stre
|
||||
|
||||
// remaps the input event to a game control.
|
||||
void G_MapEventsToControls(event_t *ev);
|
||||
void G_ResetControls(void);
|
||||
|
||||
// returns the name of a key
|
||||
const char *G_KeynumToString(INT32 keynum);
|
||||
|
||||
@@ -88,7 +88,10 @@ void HWR_ProcessPolygon(FSurfaceInfo *pSurf, FOutVector *pOutVerts, FUINT iNumPt
|
||||
if (currently_batching)
|
||||
{
|
||||
if (!pSurf)
|
||||
{
|
||||
I_Error("Got a null FSurfaceInfo in batching");// nulls should not come in the stuff that batching currently applies to
|
||||
}
|
||||
|
||||
if (polygonArraySize == polygonArrayAllocSize)
|
||||
{
|
||||
PolygonArrayEntry* new_array;
|
||||
@@ -121,7 +124,7 @@ void HWR_ProcessPolygon(FSurfaceInfo *pSurf, FOutVector *pOutVerts, FUINT iNumPt
|
||||
polygonArray[polygonArraySize].numVerts = iNumPts;
|
||||
polygonArray[polygonArraySize].polyFlags = PolyFlags;
|
||||
polygonArray[polygonArraySize].texture = current_texture;
|
||||
polygonArray[polygonArraySize].shader = (shader_target != -1) ? HWR_GetShaderFromTarget(shader_target) : shader_target;
|
||||
polygonArray[polygonArraySize].shader = (shader_target != SHADER_NONE) ? HWR_GetShaderFromTarget(shader_target) : shader_target;
|
||||
polygonArray[polygonArraySize].horizonSpecial = horizonSpecial;
|
||||
polygonArraySize++;
|
||||
|
||||
@@ -228,7 +231,9 @@ void HWR_RenderBatches(void)
|
||||
int i;
|
||||
|
||||
if (!currently_batching)
|
||||
{
|
||||
I_Error("HWR_RenderBatches called without starting batching");
|
||||
}
|
||||
|
||||
nextSurfaceInfo.LightInfo.fade_end = 0;
|
||||
nextSurfaceInfo.LightInfo.fade_start = 0;
|
||||
@@ -236,6 +241,7 @@ void HWR_RenderBatches(void)
|
||||
nextSurfaceInfo.LightInfo.directional = false;
|
||||
|
||||
currently_batching = false;// no longer collecting batches
|
||||
|
||||
if (!polygonArraySize)
|
||||
{
|
||||
ps_hw_numpolys.value.i = ps_hw_numcalls.value.i = ps_hw_numshaders.value.i
|
||||
@@ -243,6 +249,7 @@ void HWR_RenderBatches(void)
|
||||
= ps_hw_numcolors.value.i = 0;
|
||||
return;// nothing to draw
|
||||
}
|
||||
|
||||
// init stats vars
|
||||
ps_hw_numpolys.value.i = polygonArraySize;
|
||||
ps_hw_numcalls.value.i = ps_hw_numverts.value.i = 0;
|
||||
@@ -291,7 +298,7 @@ void HWR_RenderBatches(void)
|
||||
else
|
||||
GL_SetTexture(currentTexture);
|
||||
|
||||
while (1)// note: remember handling notexture polyflag as having texture number 0 (also in comparePolygons)
|
||||
while (1) // note: remember handling notexture polyflag as having texture number 0 (also in comparePolygons)
|
||||
{
|
||||
int firstIndex;
|
||||
int lastIndex;
|
||||
@@ -361,23 +368,28 @@ void HWR_RenderBatches(void)
|
||||
nextTexture = nextEntry->texture;
|
||||
nextPolyFlags = nextEntry->polyFlags;
|
||||
nextSurfaceInfo = nextEntry->surf;
|
||||
|
||||
if (nextPolyFlags & PF_NoTexture)
|
||||
nextTexture = 0;
|
||||
|
||||
if (currentShader != nextShader && cv_glshaders.value && gl_shadersavailable)
|
||||
{
|
||||
changeState = true;
|
||||
changeShader = true;
|
||||
}
|
||||
|
||||
if (currentTexture != nextTexture)
|
||||
{
|
||||
changeState = true;
|
||||
changeTexture = true;
|
||||
}
|
||||
|
||||
if (currentPolyFlags != nextPolyFlags)
|
||||
{
|
||||
changeState = true;
|
||||
changePolyFlags = true;
|
||||
}
|
||||
|
||||
if (cv_glshaders.value && gl_shadersavailable)
|
||||
{
|
||||
if (currentSurfaceInfo.PolyColor.rgba != nextSurfaceInfo.PolyColor.rgba ||
|
||||
@@ -413,10 +425,12 @@ void HWR_RenderBatches(void)
|
||||
finalVertexWritePos = 0;
|
||||
finalIndexWritePos = 0;
|
||||
}
|
||||
else continue;
|
||||
else
|
||||
continue;
|
||||
|
||||
// if we're here then either its time to stop or time to change state
|
||||
if (stopFlag) break;
|
||||
if (stopFlag)
|
||||
break;
|
||||
|
||||
// change state according to change bools and next vars, update current vars and reset bools
|
||||
if (changeState)
|
||||
@@ -429,6 +443,7 @@ void HWR_RenderBatches(void)
|
||||
|
||||
ps_hw_numshaders.value.i++;
|
||||
}
|
||||
|
||||
if (changeTexture)
|
||||
{
|
||||
// texture should be already ready for use from calls to GL_SetTexture during batch collection
|
||||
@@ -438,6 +453,7 @@ void HWR_RenderBatches(void)
|
||||
|
||||
ps_hw_numtextures.value.i++;
|
||||
}
|
||||
|
||||
if (changePolyFlags)
|
||||
{
|
||||
currentPolyFlags = nextPolyFlags;
|
||||
@@ -445,6 +461,7 @@ void HWR_RenderBatches(void)
|
||||
|
||||
ps_hw_numpolyflags.value.i++;
|
||||
}
|
||||
|
||||
if (changeSurfaceInfo)
|
||||
{
|
||||
currentSurfaceInfo = nextSurfaceInfo;
|
||||
|
||||
@@ -369,7 +369,7 @@ static poly_t *CutOutSubsecPoly(seg_t *lseg, INT32 count, poly_t *poly)
|
||||
{
|
||||
//x,y,dx,dy (like a divline)
|
||||
line_t *line = lseg->linedef;
|
||||
|
||||
|
||||
// portal check
|
||||
if (!gl_maphasportals && line->special == 40 && lseg->side == 0)
|
||||
{
|
||||
@@ -380,7 +380,7 @@ static poly_t *CutOutSubsecPoly(seg_t *lseg, INT32 count, poly_t *poly)
|
||||
if (line2 >= 0) // found it!
|
||||
gl_maphasportals = 1;
|
||||
}
|
||||
|
||||
|
||||
p1.x = FIXED_TO_FLOAT(lseg->side ? line->v2->x : line->v1->x);
|
||||
p1.y = FIXED_TO_FLOAT(lseg->side ? line->v2->y : line->v1->y);
|
||||
p2.x = FIXED_TO_FLOAT(lseg->side ? line->v1->x : line->v2->x);
|
||||
@@ -523,7 +523,7 @@ static void loading_status(void)
|
||||
x = BASEVIDWIDTH/2;
|
||||
y = BASEVIDHEIGHT/2;
|
||||
V_DrawFill(0, 0, BASEVIDWIDTH, BASEVIDHEIGHT, 31); // Black background to match fade in effect
|
||||
//V_DrawPatchFill(W_CachePatchName("SRB2BACK",PU_CACHE)); // SRB2 background, ehhh too bright.
|
||||
//V_DrawPatchFill(W_CachePatchName("SRB2BACK", PU_PATCH)); // SRB2 background, ehhh too bright.
|
||||
M_DrawTextBox(x-58, y-8, 13, 1);
|
||||
V_DrawString(x-50, y, V_YELLOWMAP, "Loading...");
|
||||
V_DrawRightAlignedString(x+50, y, V_YELLOWMAP, s);
|
||||
|
||||
+511
-184
File diff suppressed because it is too large.
Load diff
@@ -314,8 +314,6 @@ void gld_clipper_Clear(void)
|
||||
cliphead = NULL;
|
||||
}
|
||||
|
||||
#define RMUL (1.6f/1.333333f)
|
||||
|
||||
angle_t gld_FrustumAngle(angle_t tiltangle)
|
||||
{
|
||||
double clipfov;
|
||||
|
||||
+22
-28
@@ -23,31 +23,39 @@
|
||||
|
||||
typedef enum GLTextureFormat_e
|
||||
{
|
||||
GL_TEXFMT_P_8 = 0x01, /* 8-bit palette */
|
||||
GL_TEXFMT_AP_88 = 0x02, /* 8-bit alpha, 8-bit palette */
|
||||
GL_TEXFMT_P_8 = 0x01, /* 8-bit palette */
|
||||
GL_TEXFMT_AP_88 = 0x02, /* 8-bit alpha, 8-bit palette */
|
||||
|
||||
GL_TEXFMT_RGBA = 0x10, /* 32 bit RGBA! */
|
||||
GL_TEXFMT_RGBA = 0x10, /* 32 bit RGBA! */
|
||||
|
||||
GL_TEXFMT_ALPHA_8 = 0x20, /* (0..0xFF) alpha */
|
||||
GL_TEXFMT_INTENSITY_8 = 0x21, /* (0..0xFF) intensity */
|
||||
GL_TEXFMT_ALPHA_INTENSITY_88 = 0x22,
|
||||
GL_TEXFMT_ALPHA_8 = 0x20, /* (0..0xFF) alpha */
|
||||
GL_TEXFMT_INTENSITY_8 = 0x21, /* (0..0xFF) intensity */
|
||||
GL_TEXFMT_ALPHA_INTENSITY_88 = 0x22,
|
||||
} GLTextureFormat_t;
|
||||
|
||||
// Colormap structure for mipmaps.
|
||||
struct GLColormap_s
|
||||
{
|
||||
const UINT8 *source;
|
||||
UINT8 data[256];
|
||||
};
|
||||
typedef struct GLColormap_s GLColormap_t;
|
||||
|
||||
// Texture information (misleadingly named "mipmap" all over the code.)
|
||||
// The *data pointer holds the address of the graphics data cached in heap memory.
|
||||
// NULL if the texture is not in SRB2's heap cache.
|
||||
struct GLMipmap_s
|
||||
{
|
||||
// for UpdateTexture
|
||||
GLTextureFormat_t format;
|
||||
void *data;
|
||||
GLTextureFormat_t format;
|
||||
void *data;
|
||||
|
||||
UINT32 flags;
|
||||
UINT16 width, height;
|
||||
UINT32 flags;
|
||||
UINT16 width, height;
|
||||
UINT32 downloaded; // The GPU has this texture.
|
||||
|
||||
struct GLMipmap_s *nextcolormap;
|
||||
const UINT8 *colormap;
|
||||
struct GLMipmap_s *nextcolormap;
|
||||
struct GLColormap_s *colormap;
|
||||
};
|
||||
typedef struct GLMipmap_s GLMipmap_t;
|
||||
|
||||
@@ -62,25 +70,11 @@ struct GLMapTexture_s
|
||||
};
|
||||
typedef struct GLMapTexture_s GLMapTexture_t;
|
||||
|
||||
// a cached patch as converted to hardware format, holding the original patch_t
|
||||
// header so that the existing code can retrieve ->width, ->height as usual
|
||||
// This is returned by W_CachePatchNum()/W_CachePatchName(), when rendermode
|
||||
// is 'render_opengl'. Else it returns the normal patch_t data.
|
||||
// Patch information for the hardware renderer.
|
||||
struct GLPatch_s
|
||||
{
|
||||
// the 4 first fields come right away from the original patch_t
|
||||
INT16 width;
|
||||
INT16 height;
|
||||
INT16 leftoffset; // pixels to the left of origin
|
||||
INT16 topoffset; // pixels below the origin
|
||||
//
|
||||
float max_s,max_t;
|
||||
UINT16 wadnum; // the software patch lump num for when the hardware patch
|
||||
UINT16 lumpnum; // was flushed, and we need to re-create it
|
||||
void *rawpatch; // :^)
|
||||
GLMipmap_t *mipmap;
|
||||
|
||||
boolean notfound; // if the texture file was not found, mark it here (used in model texture loading)
|
||||
float max_s,max_t;
|
||||
};
|
||||
typedef struct GLPatch_s GLPatch_t;
|
||||
|
||||
|
||||
+16
-6
@@ -128,21 +128,26 @@ typedef struct
|
||||
{
|
||||
FLOAT x,y,z; // position
|
||||
FLOAT anglex, angley, anglez; // aimingangle / viewangle
|
||||
FLOAT anglex2, anglez2; // secondaries
|
||||
FLOAT scalex, scaley, scalez;
|
||||
FLOAT fovangle;
|
||||
UINT8 splitscreen;
|
||||
boolean flip; // screenflip
|
||||
boolean roll;
|
||||
FLOAT rollangle;
|
||||
FLOAT centerx, centery;
|
||||
FLOAT rollx, rollz;
|
||||
boolean mirror; // SRB2Kart: Encore Mode
|
||||
boolean mirrorflip; // Encore Mode with Flipcam
|
||||
UINT8 fliptype;
|
||||
boolean shearing; // 14042019
|
||||
float viewaiming; // 17052019
|
||||
} FTransform;
|
||||
|
||||
enum
|
||||
{
|
||||
TRANSFORM_NONE = 0,
|
||||
TRANSFORM_FLIP = 1 << 0, // screenflip
|
||||
TRANSFORM_MIRROR = 1 << 1, // SRB2Kart: Encore Mode
|
||||
TRANSFORM_MIRRORFLIP = TRANSFORM_FLIP|TRANSFORM_MIRROR // SRB2Kart: Encore Mode with Flipcam
|
||||
};
|
||||
|
||||
// Transformed vector, as passed to HWR API
|
||||
typedef struct
|
||||
{
|
||||
@@ -256,7 +261,8 @@ enum EPolyFlags
|
||||
PF_RemoveYWrap = 0x00010000, // Force clamp texture on Y
|
||||
PF_ForceWrapX = 0x00020000, // Force repeat texture on X
|
||||
PF_ForceWrapY = 0x00040000, // Forces repeat texture on Y
|
||||
PF_Ripple = 0x00100000 // Water ripple effect. The current backend doesn't use it for anything.
|
||||
PF_Ripple = 0x00100000, // Water ripple effect. The current backend doesn't use it for anything.
|
||||
PF_Skydecal = 0x20000000 // Enables smaller polygon offset, to be used for skywalls only
|
||||
// 0x20000000
|
||||
// 0x40000000
|
||||
// 0x80000000
|
||||
@@ -311,7 +317,9 @@ enum hwdsetspecialstate
|
||||
|
||||
HWD_SET_TEXTUREFILTERMODE,
|
||||
HWD_SET_TEXTUREANISOTROPICMODE,
|
||||
|
||||
|
||||
HWD_SET_WIREFRAME,
|
||||
|
||||
HWD_SET_MSAA,
|
||||
|
||||
HWD_SET_SCREEN_TEXTURES,
|
||||
@@ -319,6 +327,8 @@ enum hwdsetspecialstate
|
||||
HWD_SET_PORTAL_MODE,// new portal thing
|
||||
HWD_SET_STENCIL_LEVEL,
|
||||
|
||||
HWD_SET_TEXTURE_FORMAT,
|
||||
|
||||
HWD_NUMSTATE
|
||||
};
|
||||
typedef enum hwdsetspecialstate hwdspecialstate_t;
|
||||
|
||||
+63
-70
@@ -71,10 +71,11 @@ static const float FLOATBASEVIDHEIGHT = (float)BASEVIDHEIGHT;
|
||||
// Notes : x,y : positions relative to the original Doom resolution
|
||||
// : textes(console+score) + menus + status bar
|
||||
// -----------------+
|
||||
void HWR_DrawPatch(GLPatch_t *gpatch, INT32 x, INT32 y, INT32 option)
|
||||
void HWR_DrawPatch(patch_t *gpatch, INT32 x, INT32 y, INT32 option)
|
||||
{
|
||||
FOutVector v[4];
|
||||
FBITFIELD flags;
|
||||
GLPatch_t *hwrPatch;
|
||||
|
||||
// 3--2
|
||||
// | /|
|
||||
@@ -87,6 +88,7 @@ void HWR_DrawPatch(GLPatch_t *gpatch, INT32 x, INT32 y, INT32 option)
|
||||
|
||||
// make patch ready in hardware cache
|
||||
HWR_GetPatch(gpatch);
|
||||
hwrPatch = ((GLPatch_t *)gpatch->hardware);
|
||||
|
||||
switch (option & V_SCALEPATCHMASK)
|
||||
{
|
||||
@@ -106,17 +108,17 @@ void HWR_DrawPatch(GLPatch_t *gpatch, INT32 x, INT32 y, INT32 option)
|
||||
if (option & V_NOSCALESTART)
|
||||
sdupx = sdupy = 2.0f;
|
||||
|
||||
v[0].x = v[3].x = (x*sdupx-SHORT(gpatch->leftoffset)*pdupx)/vid.width - 1;
|
||||
v[2].x = v[1].x = (x*sdupx+(SHORT(gpatch->width)-SHORT(gpatch->leftoffset))*pdupx)/vid.width - 1;
|
||||
v[0].y = v[1].y = 1-(y*sdupy-SHORT(gpatch->topoffset)*pdupy)/vid.height;
|
||||
v[2].y = v[3].y = 1-(y*sdupy+(SHORT(gpatch->height)-SHORT(gpatch->topoffset))*pdupy)/vid.height;
|
||||
v[0].x = v[3].x = (x*sdupx-gpatch->leftoffset*pdupx)/vid.width - 1;
|
||||
v[2].x = v[1].x = (x*sdupx+(gpatch->width - gpatch->leftoffset)*pdupx)/vid.width - 1;
|
||||
v[0].y = v[1].y = 1-(y*sdupy-gpatch->topoffset*pdupy)/vid.height;
|
||||
v[2].y = v[3].y = 1-(y*sdupy+(gpatch->height - gpatch->topoffset)*pdupy)/vid.height;
|
||||
|
||||
v[0].z = v[1].z = v[2].z = v[3].z = 1.0f;
|
||||
|
||||
v[0].s = v[3].s = 0.0f;
|
||||
v[2].s = v[1].s = gpatch->max_s;
|
||||
v[2].s = v[1].s = hwrPatch->max_s;
|
||||
v[0].t = v[1].t = 0.0f;
|
||||
v[2].t = v[3].t = gpatch->max_t;
|
||||
v[2].t = v[3].t = hwrPatch->max_t;
|
||||
|
||||
flags = PF_Translucent|PF_NoDepthTest;
|
||||
|
||||
@@ -129,7 +131,7 @@ void HWR_DrawPatch(GLPatch_t *gpatch, INT32 x, INT32 y, INT32 option)
|
||||
GL_DrawPolygon(NULL, v, 4, flags);
|
||||
}
|
||||
|
||||
void HWR_DrawStretchyFixedPatch(GLPatch_t *gpatch, fixed_t x, fixed_t y, fixed_t pscale, fixed_t vscale, INT32 option, const UINT8 *colormap, INT32 bflags)
|
||||
void HWR_DrawStretchyFixedPatch(patch_t *gpatch, fixed_t x, fixed_t y, fixed_t pscale, fixed_t vscale, INT32 option, const UINT8 *colormap, INT32 bflags)
|
||||
{
|
||||
FOutVector v[4];
|
||||
FBITFIELD flags;
|
||||
@@ -137,6 +139,7 @@ void HWR_DrawStretchyFixedPatch(GLPatch_t *gpatch, fixed_t x, fixed_t y, fixed_t
|
||||
float cy = FIXED_TO_FLOAT(y);
|
||||
UINT8 alphalevel = ((option & V_ALPHAMASK) >> V_ALPHASHIFT);
|
||||
UINT8 blendmode = ((bflags & V_BLENDMASK) >> V_BLENDSHIFT);
|
||||
GLPatch_t *hwrPatch;
|
||||
|
||||
// 3--2
|
||||
// | /|
|
||||
@@ -156,6 +159,8 @@ void HWR_DrawStretchyFixedPatch(GLPatch_t *gpatch, fixed_t x, fixed_t y, fixed_t
|
||||
else
|
||||
HWR_GetMappedPatch(gpatch, colormap);
|
||||
|
||||
hwrPatch = ((GLPatch_t *)gpatch->hardware);
|
||||
|
||||
dupx = (float)vid.dupx;
|
||||
dupy = (float)vid.dupy;
|
||||
|
||||
@@ -186,13 +191,13 @@ void HWR_DrawStretchyFixedPatch(GLPatch_t *gpatch, fixed_t x, fixed_t y, fixed_t
|
||||
|
||||
// left offset
|
||||
if (option & V_FLIP)
|
||||
offsetx = (float)(SHORT(gpatch->width) - SHORT(gpatch->leftoffset)) * fscalew;
|
||||
offsetx = (float)(gpatch->width - gpatch->leftoffset) * fscalew;
|
||||
else
|
||||
offsetx = (float)SHORT(gpatch->leftoffset) * fscalew;
|
||||
offsetx = (float)(gpatch->leftoffset) * fscalew;
|
||||
|
||||
// top offset
|
||||
// TODO: make some kind of vertical version of V_FLIP, maybe by deprecating V_OFFSET in future?!?
|
||||
offsety = (float)SHORT(gpatch->topoffset) * fscaleh;
|
||||
offsety = (float)(gpatch->topoffset) * fscaleh;
|
||||
|
||||
if ((option & (V_NOSCALESTART|V_OFFSET)) == (V_NOSCALESTART|V_OFFSET)) // Multiply by dupx/dupy for crosshairs
|
||||
{
|
||||
@@ -220,17 +225,15 @@ void HWR_DrawStretchyFixedPatch(GLPatch_t *gpatch, fixed_t x, fixed_t y, fixed_t
|
||||
// if it's meant to cover the whole screen, black out the rest
|
||||
// cx and cy are possibly *slightly* off from float maths
|
||||
// This is done before here compared to software because we directly alter cx and cy to centre
|
||||
if (cx >= -0.1f && cx <= 0.1f && SHORT(gpatch->width) == BASEVIDWIDTH && cy >= -0.1f && cy <= 0.1f && SHORT(gpatch->height) == BASEVIDHEIGHT)
|
||||
if (cx >= -0.1f && cx <= 0.1f && gpatch->width == BASEVIDWIDTH && cy >= -0.1f && cy <= 0.1f && gpatch->height == BASEVIDHEIGHT)
|
||||
{
|
||||
// Need to temporarily cache the real patch to get the colour of the top left pixel
|
||||
patch_t *realpatch = W_CacheLumpNumPwad(gpatch->wadnum, gpatch->lumpnum, PU_STATIC);
|
||||
const column_t *column = (const column_t *)((const UINT8 *)(realpatch) + LONG((realpatch)->columnofs[0]));
|
||||
const column_t *column = (const column_t *)((const UINT8 *)(gpatch->columns) + (gpatch->columnofs[0]));
|
||||
|
||||
if (!column->topdelta)
|
||||
{
|
||||
const UINT8 *source = (const UINT8 *)(column) + 3;
|
||||
HWR_DrawFill(0, 0, BASEVIDWIDTH, BASEVIDHEIGHT, (column->topdelta == 0xff ? 31 : source[0]));
|
||||
}
|
||||
Z_Free(realpatch);
|
||||
}
|
||||
// centre screen
|
||||
if (fabsf(fvw - FLOATBASEVIDWIDTH * dupx) > 1.0E-36f)
|
||||
@@ -252,20 +255,12 @@ void HWR_DrawStretchyFixedPatch(GLPatch_t *gpatch, fixed_t x, fixed_t y, fixed_t
|
||||
}
|
||||
}
|
||||
|
||||
if (pscale != FRACUNIT)
|
||||
{
|
||||
fwidth = (float)SHORT(gpatch->width) * fscalew * dupx;
|
||||
fheight = (float)SHORT(gpatch->height) * fscaleh * dupy;
|
||||
}
|
||||
else
|
||||
{
|
||||
fwidth = (float)SHORT(gpatch->width) * dupx;
|
||||
fheight = (float)SHORT(gpatch->height) * dupy;
|
||||
}
|
||||
fwidth = (float)(gpatch->width) * fscalew * dupx;
|
||||
fheight = (float)(gpatch->height) * fscaleh * dupy;
|
||||
|
||||
// positions of the cx, cy, are between 0 and vid.width/vid.height now, we need them to be between -1 and 1
|
||||
cx = -1.0f + (cx / (vid.width / 2.0f));
|
||||
cy = 1.0f - (cy / (vid.height / 2.0f));
|
||||
cx = -1.0f + (cx / (fvw / 2.0f));
|
||||
cy = 1.0f - (cy / (fvh / 2.0f));
|
||||
|
||||
// fwidth and fheight are similar
|
||||
fwidth /= fvw / 2.0f;
|
||||
@@ -282,19 +277,19 @@ void HWR_DrawStretchyFixedPatch(GLPatch_t *gpatch, fixed_t x, fixed_t y, fixed_t
|
||||
|
||||
if (option & V_FLIP)
|
||||
{
|
||||
v[0].s = v[3].s = gpatch->max_s;
|
||||
v[0].s = v[3].s = hwrPatch->max_s;
|
||||
v[2].s = v[1].s = 0.0f;
|
||||
}
|
||||
else
|
||||
{
|
||||
v[0].s = v[3].s = 0.0f;
|
||||
v[2].s = v[1].s = gpatch->max_s;
|
||||
v[2].s = v[1].s = hwrPatch->max_s;
|
||||
}
|
||||
|
||||
v[0].t = v[1].t = 0.0f;
|
||||
v[2].t = v[3].t = gpatch->max_t;
|
||||
v[2].t = v[3].t = hwrPatch->max_t;
|
||||
|
||||
// whoops
|
||||
// clip it since it is used for bunny scroll in doom I
|
||||
if (blendmode)
|
||||
flags = HWR_GetBlendModeFlag(blendmode+1)|PF_NoDepthTest;
|
||||
else
|
||||
@@ -305,13 +300,11 @@ void HWR_DrawStretchyFixedPatch(GLPatch_t *gpatch, fixed_t x, fixed_t y, fixed_t
|
||||
if (option & V_WRAPY)
|
||||
flags |= PF_ForceWrapY;
|
||||
|
||||
// clip it since it is used for bunny scroll in doom I
|
||||
|
||||
if (alphalevel)
|
||||
{
|
||||
FSurfaceInfo Surf;
|
||||
Surf.PolyColor.s.red = Surf.PolyColor.s.green = Surf.PolyColor.s.blue = 0xff;
|
||||
|
||||
|
||||
if (alphalevel == 13) Surf.PolyColor.s.alpha = softwaretranstogl_lo[hudtrans];
|
||||
else if (alphalevel == 14) Surf.PolyColor.s.alpha = softwaretranstogl[hudtrans];
|
||||
else if (alphalevel == 15) Surf.PolyColor.s.alpha = softwaretranstogl_hi[hudtrans];
|
||||
@@ -324,13 +317,14 @@ void HWR_DrawStretchyFixedPatch(GLPatch_t *gpatch, fixed_t x, fixed_t y, fixed_t
|
||||
GL_DrawPolygon(NULL, v, 4, flags);
|
||||
}
|
||||
|
||||
void HWR_DrawCroppedPatch(GLPatch_t *gpatch, fixed_t x, fixed_t y, fixed_t pscale, INT32 option, fixed_t sx, fixed_t sy, fixed_t w, fixed_t h)
|
||||
void HWR_DrawCroppedPatch(patch_t *gpatch, fixed_t x, fixed_t y, fixed_t pscale, INT32 option, fixed_t sx, fixed_t sy, fixed_t w, fixed_t h)
|
||||
{
|
||||
FOutVector v[4];
|
||||
FBITFIELD flags;
|
||||
float cx = FIXED_TO_FLOAT(x);
|
||||
float cy = FIXED_TO_FLOAT(y);
|
||||
UINT8 alphalevel = ((option & V_ALPHAMASK) >> V_ALPHASHIFT);
|
||||
GLPatch_t *hwrPatch;
|
||||
|
||||
// 3--2
|
||||
// | /|
|
||||
@@ -346,6 +340,7 @@ void HWR_DrawCroppedPatch(GLPatch_t *gpatch, fixed_t x, fixed_t y, fixed_t pscal
|
||||
|
||||
// make patch ready in hardware cache
|
||||
HWR_GetPatch(gpatch);
|
||||
hwrPatch = ((GLPatch_t *)gpatch->hardware);
|
||||
|
||||
dupx = (float)vid.dupx;
|
||||
dupy = (float)vid.dupy;
|
||||
@@ -368,8 +363,8 @@ void HWR_DrawCroppedPatch(GLPatch_t *gpatch, fixed_t x, fixed_t y, fixed_t pscal
|
||||
dupx = dupy = (dupx < dupy ? dupx : dupy);
|
||||
fscale = FIXED_TO_FLOAT(pscale);
|
||||
|
||||
cy -= (float)SHORT(gpatch->topoffset) * fscale;
|
||||
cx -= (float)SHORT(gpatch->leftoffset) * fscale;
|
||||
cy -= (float)(gpatch->topoffset) * fscale;
|
||||
cx -= (float)(gpatch->leftoffset) * fscale;
|
||||
|
||||
if (!(option & V_NOSCALESTART))
|
||||
{
|
||||
@@ -381,17 +376,15 @@ void HWR_DrawCroppedPatch(GLPatch_t *gpatch, fixed_t x, fixed_t y, fixed_t pscal
|
||||
// if it's meant to cover the whole screen, black out the rest
|
||||
// cx and cy are possibly *slightly* off from float maths
|
||||
// This is done before here compared to software because we directly alter cx and cy to centre
|
||||
if (cx >= -0.1f && cx <= 0.1f && SHORT(gpatch->width) == BASEVIDWIDTH && cy >= -0.1f && cy <= 0.1f && SHORT(gpatch->height) == BASEVIDHEIGHT)
|
||||
if (cx >= -0.1f && cx <= 0.1f && gpatch->width == BASEVIDWIDTH && cy >= -0.1f && cy <= 0.1f && gpatch->height == BASEVIDHEIGHT)
|
||||
{
|
||||
// Need to temporarily cache the real patch to get the colour of the top left pixel
|
||||
patch_t *realpatch = W_CacheLumpNumPwad(gpatch->wadnum, gpatch->lumpnum, PU_STATIC);
|
||||
const column_t *column = (const column_t *)((const UINT8 *)(realpatch) + LONG((realpatch)->columnofs[0]));
|
||||
const column_t *column = (const column_t *)((const UINT8 *)(gpatch->columns) + (gpatch->columnofs[0]));
|
||||
|
||||
if (!column->topdelta)
|
||||
{
|
||||
const UINT8 *source = (const UINT8 *)(column) + 3;
|
||||
HWR_DrawFill(0, 0, BASEVIDWIDTH, BASEVIDHEIGHT, (column->topdelta == 0xff ? 31 : source[0]));
|
||||
}
|
||||
Z_Free(realpatch);
|
||||
}
|
||||
// centre screen
|
||||
if (fabsf(fvw - FLOATBASEVIDWIDTH * dupx) > 1.0E-36f)
|
||||
@@ -422,11 +415,11 @@ void HWR_DrawCroppedPatch(GLPatch_t *gpatch, fixed_t x, fixed_t y, fixed_t pscal
|
||||
if (fheight > h - sy)
|
||||
fheight = h - sy;
|
||||
|
||||
if (fwidth > SHORT(gpatch->width))
|
||||
fwidth = SHORT(gpatch->width);
|
||||
if (fwidth > gpatch->width)
|
||||
fwidth = gpatch->width;
|
||||
|
||||
if (fheight > SHORT(gpatch->height))
|
||||
fheight = SHORT(gpatch->height);
|
||||
if (fheight > gpatch->height)
|
||||
fheight = gpatch->height;
|
||||
|
||||
if (pscale != FRACUNIT)
|
||||
{
|
||||
@@ -440,8 +433,8 @@ void HWR_DrawCroppedPatch(GLPatch_t *gpatch, fixed_t x, fixed_t y, fixed_t pscal
|
||||
}
|
||||
|
||||
// positions of the cx, cy, are between 0 and vid.width/vid.height now, we need them to be between -1 and 1
|
||||
cx = -1.0f + (cx / (vid.width / 2.0f));
|
||||
cy = 1.0f - (cy / (vid.height / 2.0f));
|
||||
cx = -1.0f + (cx / (fvw / 2.0f));
|
||||
cy = 1.0f - (cy / (fvh / 2.0f));
|
||||
|
||||
// fwidth and fheight are similar
|
||||
fwidth /= fvw / 2.0f;
|
||||
@@ -456,10 +449,10 @@ void HWR_DrawCroppedPatch(GLPatch_t *gpatch, fixed_t x, fixed_t y, fixed_t pscal
|
||||
|
||||
v[0].z = v[1].z = v[2].z = v[3].z = 1.0f;
|
||||
|
||||
v[0].s = v[3].s = ((sx)/(float)SHORT(gpatch->width) )*gpatch->max_s;
|
||||
v[2].s = v[1].s = ((w )/(float)SHORT(gpatch->width) )*gpatch->max_s;
|
||||
v[0].t = v[1].t = ((sy)/(float)SHORT(gpatch->height))*gpatch->max_t;
|
||||
v[2].t = v[3].t = ((h )/(float)SHORT(gpatch->height))*gpatch->max_t;
|
||||
v[0].s = v[3].s = ((sx)/(float)(gpatch->width) )*hwrPatch->max_s;
|
||||
v[2].s = v[1].s = ((w )/(float)(gpatch->width) )*hwrPatch->max_s;
|
||||
v[0].t = v[1].t = ((sy)/(float)(gpatch->height))*hwrPatch->max_t;
|
||||
v[2].t = v[3].t = ((h )/(float)(gpatch->height))*hwrPatch->max_t;
|
||||
|
||||
flags = PF_Translucent|PF_NoDepthTest;
|
||||
|
||||
@@ -478,7 +471,7 @@ void HWR_DrawCroppedPatch(GLPatch_t *gpatch, fixed_t x, fixed_t y, fixed_t pscal
|
||||
else if (alphalevel == 14) Surf.PolyColor.s.alpha = softwaretranstogl[cv_translucenthud.value];
|
||||
else if (alphalevel == 15) Surf.PolyColor.s.alpha = softwaretranstogl_hi[cv_translucenthud.value];
|
||||
else Surf.PolyColor.s.alpha = softwaretranstogl[10-alphalevel];
|
||||
|
||||
|
||||
flags |= PF_Modulated;
|
||||
GL_DrawPolygon(&Surf, v, 4, flags);
|
||||
}
|
||||
@@ -614,7 +607,7 @@ void HWR_FadeScreenMenuBack(UINT16 color, UINT8 strength)
|
||||
RGBA_t *palette = HWR_GetTexturePalette();
|
||||
Surf.PolyColor.rgba = palette[color&0xFF].rgba;
|
||||
|
||||
if (HWR_ShouldUsePaletteRendering())
|
||||
if (HWR_ShouldUsePaletteRendering())
|
||||
Surf.PolyColor.s.alpha = softwaretranstogl[strength];
|
||||
else
|
||||
Surf.PolyColor.s.alpha = (UINT8)(strength*25.5f);
|
||||
@@ -670,7 +663,7 @@ void HWR_DrawViewBorder(INT32 clearlines)
|
||||
INT32 top, side;
|
||||
INT32 baseviewwidth, baseviewheight;
|
||||
INT32 basewindowx, basewindowy;
|
||||
GLPatch_t *patch;
|
||||
patch_t *patch;
|
||||
|
||||
// if (gl_viewwidth == vid.width)
|
||||
// return;
|
||||
@@ -719,7 +712,7 @@ void HWR_DrawViewBorder(INT32 clearlines)
|
||||
// top edge
|
||||
if (clearlines > basewindowy - 8)
|
||||
{
|
||||
patch = W_CachePatchNum(viewborderlump[BRDR_T], PU_CACHE);
|
||||
patch = W_CachePatchNum(viewborderlump[BRDR_T], PU_PATCH);
|
||||
for (x = 0; x < baseviewwidth; x += 8)
|
||||
HWR_DrawPatch(patch, basewindowx + x, basewindowy - 8,
|
||||
0);
|
||||
@@ -728,7 +721,7 @@ void HWR_DrawViewBorder(INT32 clearlines)
|
||||
// bottom edge
|
||||
if (clearlines > basewindowy + baseviewheight)
|
||||
{
|
||||
patch = W_CachePatchNum(viewborderlump[BRDR_B], PU_CACHE);
|
||||
patch = W_CachePatchNum(viewborderlump[BRDR_B], PU_PATCH);
|
||||
for (x = 0; x < baseviewwidth; x += 8)
|
||||
HWR_DrawPatch(patch, basewindowx + x,
|
||||
basewindowy + baseviewheight, 0);
|
||||
@@ -737,7 +730,7 @@ void HWR_DrawViewBorder(INT32 clearlines)
|
||||
// left edge
|
||||
if (clearlines > basewindowy)
|
||||
{
|
||||
patch = W_CachePatchNum(viewborderlump[BRDR_L], PU_CACHE);
|
||||
patch = W_CachePatchNum(viewborderlump[BRDR_L], PU_PATCH);
|
||||
for (y = 0; y < baseviewheight && basewindowy + y < clearlines;
|
||||
y += 8)
|
||||
{
|
||||
@@ -749,7 +742,7 @@ void HWR_DrawViewBorder(INT32 clearlines)
|
||||
// right edge
|
||||
if (clearlines > basewindowy)
|
||||
{
|
||||
patch = W_CachePatchNum(viewborderlump[BRDR_R], PU_CACHE);
|
||||
patch = W_CachePatchNum(viewborderlump[BRDR_R], PU_PATCH);
|
||||
for (y = 0; y < baseviewheight && basewindowy+y < clearlines;
|
||||
y += 8)
|
||||
{
|
||||
@@ -761,22 +754,22 @@ void HWR_DrawViewBorder(INT32 clearlines)
|
||||
// Draw beveled corners.
|
||||
if (clearlines > basewindowy - 8)
|
||||
HWR_DrawPatch(W_CachePatchNum(viewborderlump[BRDR_TL],
|
||||
PU_CACHE),
|
||||
PU_PATCH),
|
||||
basewindowx - 8, basewindowy - 8, 0);
|
||||
|
||||
if (clearlines > basewindowy - 8)
|
||||
HWR_DrawPatch(W_CachePatchNum(viewborderlump[BRDR_TR],
|
||||
PU_CACHE),
|
||||
PU_PATCH),
|
||||
basewindowx + baseviewwidth, basewindowy - 8, 0);
|
||||
|
||||
if (clearlines > basewindowy+baseviewheight)
|
||||
HWR_DrawPatch(W_CachePatchNum(viewborderlump[BRDR_BL],
|
||||
PU_CACHE),
|
||||
PU_PATCH),
|
||||
basewindowx - 8, basewindowy + baseviewheight, 0);
|
||||
|
||||
if (clearlines > basewindowy + baseviewheight)
|
||||
HWR_DrawPatch(W_CachePatchNum(viewborderlump[BRDR_BR],
|
||||
PU_CACHE),
|
||||
PU_PATCH),
|
||||
basewindowx + baseviewwidth,
|
||||
basewindowy + baseviewheight, 0);
|
||||
}
|
||||
@@ -882,8 +875,8 @@ void HWR_DrawDiag(INT32 x, INT32 y, INT32 wh, INT32 color)
|
||||
if (fy + fh > vid.height)
|
||||
fh = fvh - fy;
|
||||
|
||||
fx = -1.0f + fx / (vid.width / 2.0f);
|
||||
fy = 1.0f - fy / (vid.height / 2.0f);
|
||||
fx = -1.0f + fx / (fvw / 2.0f);
|
||||
fy = 1.0f - fy / (fvh / 2.0f);
|
||||
fw = fw / (fvw / 2.0f);
|
||||
fh = fh / (fvh / 2.0f);
|
||||
|
||||
@@ -995,8 +988,8 @@ void HWR_DrawConsoleFill(INT32 x, INT32 y, INT32 w, INT32 h, UINT32 color, INT32
|
||||
if (fy + fh > vid.height)
|
||||
fh = fvh - fy;
|
||||
|
||||
fx = -1.0f + fx / (vid.width / 2.0f);
|
||||
fy = 1.0f - fy / (vid.height / 2.0f);
|
||||
fx = -1.0f + fx / (fvw / 2.0f);
|
||||
fy = 1.0f - fy / (fvh / 2.0f);
|
||||
fw = fw / (fvw / 2.0f);
|
||||
fh = fh / (fvh / 2.0f);
|
||||
|
||||
@@ -1108,8 +1101,8 @@ void HWR_DrawFill(INT32 x, INT32 y, INT32 w, INT32 h, INT32 color)
|
||||
if (fy + fh > vid.height)
|
||||
fh = fvh - fy;
|
||||
|
||||
fx = -1.0f + fx / (vid.width / 2.0f);
|
||||
fy = 1.0f - fy / (vid.height / 2.0f);
|
||||
fx = -1.0f + fx / (fvw / 2.0f);
|
||||
fy = 1.0f - fy / (fvh / 2.0f);
|
||||
fw = fw / (fvw / 2.0f);
|
||||
fh = fh / (fvh / 2.0f);
|
||||
|
||||
|
||||
@@ -22,7 +22,6 @@
|
||||
#define SCREENVERTS 10
|
||||
|
||||
boolean GL_Init(void);
|
||||
void GL_FinishUpdate(INT32 waitvbl);
|
||||
void SetupGLInfo(void);
|
||||
|
||||
void GL_SetSpecialState(hwdspecialstate_t IdState, INT32 Value);
|
||||
@@ -40,6 +39,7 @@ void GL_DrawModelEx(model_t *model, INT32 frameIndex, float duration, float tics
|
||||
|
||||
void GL_RenderSkyDome(gl_sky_t *sky);
|
||||
|
||||
void GL_UpdateTexture(GLMipmap_t *pTexInfo);
|
||||
void GL_SetTexture(GLMipmap_t *pTexInfo);
|
||||
void GL_DeleteTexture(GLMipmap_t *pTexInfo);
|
||||
|
||||
|
||||
+25
-13
@@ -32,7 +32,7 @@ typedef struct gl_vissprite_s
|
||||
float scale;
|
||||
float spritexscale, spriteyscale;
|
||||
float spritexoffset, spriteyoffset;
|
||||
GLPatch_t *gpatch;
|
||||
patch_t *gpatch;
|
||||
boolean flip;
|
||||
UINT8 translucency; //alpha level 0-255
|
||||
mobj_t *mobj;
|
||||
@@ -51,31 +51,43 @@ void HWR_ObjectLightLevelPost(gl_vissprite_t *spr, const sector_t *sector, INT32
|
||||
extern extrasubsector_t *extrasubsectors;
|
||||
extern size_t addsubsector;
|
||||
|
||||
void HWR_FreeExtraSubsectors(void);
|
||||
|
||||
// --------
|
||||
// hw_cache.c
|
||||
// --------
|
||||
void HWR_InitTextureCache(void);
|
||||
void HWR_FreeTextureCache(void);
|
||||
void HWR_FreeMipmapCache(void);
|
||||
void HWR_FreeExtraSubsectors(void);
|
||||
void HWR_InitMapTextures(void);
|
||||
void HWR_LoadMapTextures(size_t pnumtextures);
|
||||
void HWR_FreeMapTextures(void);
|
||||
|
||||
patch_t *HWR_GetCachedGLPatchPwad(UINT16 wad, UINT16 lump);
|
||||
patch_t *HWR_GetCachedGLPatch(lumpnum_t lumpnum);
|
||||
|
||||
void HWR_GetPatch(patch_t *gpatch);
|
||||
void HWR_GetMappedPatch(patch_t *gpatch, const UINT8 *colormap);
|
||||
void HWR_MakePatch(const patch_t *patch, GLPatch_t *glPatch, GLMipmap_t *glMipmap, boolean makebitmap);
|
||||
void HWR_GetFadeMask(lumpnum_t fademasklumpnum);
|
||||
|
||||
void HWR_PrecacheLevel(void);
|
||||
|
||||
GLMapTexture_t *HWR_GetTexture(INT32 tex, boolean noencore);
|
||||
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.
|
||||
|
||||
GLMapTexture_t *HWR_GetTexture(INT32 tex, boolean noencore);
|
||||
void HWR_GetPatch(GLPatch_t *gpatch);
|
||||
void HWR_GetMappedPatch(GLPatch_t *gpatch, const UINT8 *colormap);
|
||||
void HWR_MakePatch(patch_t *patch, GLPatch_t *glPatch, GLMipmap_t *glMipmap, boolean makebitmap);
|
||||
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);
|
||||
|
||||
RGBA_t *HWR_GetTexturePalette(void);
|
||||
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);
|
||||
GLPatch_t *HWR_GetCachedGLPatchPwad(UINT16 wad, UINT16 lump);
|
||||
GLPatch_t *HWR_GetCachedGLPatch(lumpnum_t lumpnum);
|
||||
void HWR_GetFadeMask(lumpnum_t fademasklumpnum);
|
||||
|
||||
|
||||
// --------
|
||||
// hw_draw.c
|
||||
|
||||
+589
-475
File diff suppressed because it is too large.
Load diff
@@ -85,9 +85,9 @@ extern ps_metric_t ps_hw_batchdrawtime;
|
||||
extern boolean gl_shadersavailable;
|
||||
|
||||
// hw_draw.c
|
||||
void HWR_DrawPatch(GLPatch_t *gpatch, INT32 x, INT32 y, INT32 option);
|
||||
void HWR_DrawStretchyFixedPatch(GLPatch_t *gpatch, fixed_t x, fixed_t y, fixed_t pscale, fixed_t vscale, INT32 option, const UINT8 *colormap, INT32 bflags);
|
||||
void HWR_DrawCroppedPatch(GLPatch_t *gpatch, fixed_t x, fixed_t y, fixed_t pscale, INT32 option, fixed_t sx, fixed_t sy, fixed_t w, fixed_t h);
|
||||
void HWR_DrawPatch(patch_t *gpatch, INT32 x, INT32 y, INT32 option);
|
||||
void HWR_DrawStretchyFixedPatch(patch_t *gpatch, fixed_t x, fixed_t y, fixed_t pscale, fixed_t vscale, INT32 option, const UINT8 *colormap, INT32 bflags);
|
||||
void HWR_DrawCroppedPatch(patch_t *gpatch, fixed_t x, fixed_t y, fixed_t pscale, INT32 option, fixed_t sx, fixed_t sy, fixed_t w, fixed_t h);
|
||||
void HWR_DrawFill(INT32 x, INT32 y, INT32 w, INT32 h, INT32 color);
|
||||
void HWR_DrawConsoleFill(INT32 x, INT32 y, INT32 w, INT32 h, UINT32 color, INT32 options); // Lat: separate flags from color since color needs to be an uint to work right.
|
||||
void HWR_DrawDiag(INT32 x, INT32 y, INT32 wh, INT32 color);
|
||||
@@ -171,13 +171,11 @@ void HWR_ProcessSeg(void); // Sort of like GLWall::Process in GZDoom
|
||||
void HWR_CreatePlanePolygons(INT32 bspnum);
|
||||
extern boolean gl_maphasportals;
|
||||
|
||||
// hw_cache.c
|
||||
void HWR_LoadTextures(size_t pnumtextures);
|
||||
RGBA_t *HWR_GetTexturePalette(void);
|
||||
|
||||
// Console variables
|
||||
extern CV_PossibleValue_t glanisotropicmode_cons_t[];
|
||||
|
||||
extern consvar_t cv_gltexturedepth;
|
||||
|
||||
extern consvar_t cv_glscreentextures;
|
||||
#ifdef USE_FBO_OGL
|
||||
extern consvar_t cv_glframebuffer;
|
||||
@@ -204,6 +202,8 @@ extern consvar_t cv_glsolvetjoin;
|
||||
|
||||
extern consvar_t cv_glbatching;
|
||||
|
||||
extern consvar_t cv_glwireframe;
|
||||
|
||||
extern consvar_t cv_glrenderdistance;
|
||||
|
||||
extern consvar_t cv_glhorizonlines;
|
||||
@@ -225,7 +225,7 @@ FUNCINLINE static ATTRINLINE boolean HWR_ShouldUsePaletteRendering(void)
|
||||
|
||||
FUNCINLINE static ATTRINLINE boolean HWR_PalRenderFlashpal(void)
|
||||
{
|
||||
return (HWR_ShouldUsePaletteRendering() && cv_glflashpal.value);
|
||||
return (cv_glflashpal.value && HWR_ShouldUsePaletteRendering());
|
||||
}
|
||||
|
||||
#endif
|
||||
+143
-103
@@ -244,7 +244,7 @@ static GLTextureFormat_t PNG_Load(const char *filename, int *w, int *h, GLPatch_
|
||||
|
||||
{
|
||||
png_uint_32 i, pitch = png_get_rowbytes(png_ptr, png_info_ptr);
|
||||
png_bytep PNG_image = Z_Malloc(pitch*height, PU_HWRCACHE, &glpatch->mipmap->data);
|
||||
png_bytep PNG_image = Z_Malloc(pitch*height, PU_HWRMODELTEXTURE, &glpatch->mipmap->data);
|
||||
png_bytepp row_pointers = png_malloc(png_ptr, height * sizeof (png_bytep));
|
||||
for (i = 0; i < height; i++)
|
||||
row_pointers[i] = PNG_image + i*pitch;
|
||||
@@ -324,7 +324,7 @@ static GLTextureFormat_t PCX_Load(const char *filename, int *w, int *h,
|
||||
|
||||
pw = *w = header.xmax - header.xmin + 1;
|
||||
ph = *h = header.ymax - header.ymin + 1;
|
||||
image = Z_Malloc(pw*ph*4, PU_HWRCACHE, &glpatch->mipmap->data);
|
||||
image = Z_Malloc(pw*ph*4, PU_HWRMODELTEXTURE, &glpatch->mipmap->data);
|
||||
|
||||
if (fread(palette, sizeof (UINT8), PALSIZE, file) != PALSIZE)
|
||||
{
|
||||
@@ -366,51 +366,56 @@ static GLTextureFormat_t PCX_Load(const char *filename, int *w, int *h,
|
||||
// -----------------+
|
||||
static void md2_loadTexture(md2_t *model)
|
||||
{
|
||||
GLPatch_t *glpatch;
|
||||
patch_t *patch;
|
||||
GLPatch_t *glPatch = NULL;
|
||||
const char *filename = model->filename;
|
||||
|
||||
if (model->glpatch)
|
||||
{
|
||||
glpatch = model->glpatch;
|
||||
Z_Free(glpatch->mipmap->data);
|
||||
patch = model->glpatch;
|
||||
glPatch = (GLPatch_t *)(patch->hardware);
|
||||
if (glPatch)
|
||||
Z_Free(glPatch->mipmap->data);
|
||||
}
|
||||
else
|
||||
{
|
||||
glpatch = Z_Calloc(sizeof *glpatch, PU_HWRPATCHINFO,
|
||||
&(model->glpatch));
|
||||
glpatch->mipmap = Z_Calloc(sizeof (GLMipmap_t), PU_HWRPATCHINFO, NULL);
|
||||
}
|
||||
model->glpatch = patch = Patch_Create(NULL, 0, NULL);
|
||||
|
||||
if (!glpatch->mipmap->downloaded && !glpatch->mipmap->data)
|
||||
if (!patch->hardware)
|
||||
Patch_AllocateHardwarePatch(patch);
|
||||
|
||||
if (glPatch == NULL)
|
||||
glPatch = (GLPatch_t *)(patch->hardware);
|
||||
|
||||
if (!glPatch->mipmap->downloaded && !glPatch->mipmap->data)
|
||||
{
|
||||
int w = 0, h = 0;
|
||||
|
||||
#ifdef HAVE_PNG
|
||||
glpatch->mipmap->format = PNG_Load(filename, &w, &h, glpatch);
|
||||
if (glpatch->mipmap->format == 0)
|
||||
glPatch->mipmap->format = PNG_Load(filename, &w, &h, glPatch);
|
||||
if (glPatch->mipmap->format == 0)
|
||||
#endif
|
||||
glpatch->mipmap->format = PCX_Load(filename, &w, &h, glpatch);
|
||||
if (glpatch->mipmap->format == 0)
|
||||
glPatch->mipmap->format = PCX_Load(filename, &w, &h, glPatch);
|
||||
if (glPatch->mipmap->format == 0)
|
||||
{
|
||||
glpatch->notfound = true;// mark it so its not searched for again repeatedly
|
||||
model->notexturefile = true; // mark it so its not searched for again repeatedly
|
||||
return;
|
||||
}
|
||||
|
||||
glpatch->mipmap->downloaded = 0;
|
||||
glpatch->mipmap->flags = 0;
|
||||
glPatch->mipmap->downloaded = 0;
|
||||
glPatch->mipmap->flags = 0;
|
||||
|
||||
patch->width = (INT16)w;
|
||||
patch->height = (INT16)h;
|
||||
glPatch->mipmap->width = (UINT16)w;
|
||||
glPatch->mipmap->height = (UINT16)h;
|
||||
|
||||
glpatch->width = (INT16)w;
|
||||
glpatch->height = (INT16)h;
|
||||
glpatch->mipmap->width = (UINT16)w;
|
||||
glpatch->mipmap->height = (UINT16)h;
|
||||
|
||||
// for palette rendering, color cube is applied in post-processing instead of here
|
||||
if (!HWR_ShouldUsePaletteRendering())
|
||||
{
|
||||
UINT32 size;
|
||||
RGBA_t *image;
|
||||
// Lactozilla: Apply colour cube
|
||||
image = glpatch->mipmap->data;
|
||||
image = glPatch->mipmap->data;
|
||||
size = w*h;
|
||||
while (size--)
|
||||
{
|
||||
@@ -419,8 +424,8 @@ static void md2_loadTexture(md2_t *model)
|
||||
}
|
||||
}
|
||||
}
|
||||
GL_SetTexture(glpatch->mipmap);
|
||||
HWR_UnlockCachedPatch(glpatch);
|
||||
GL_SetTexture(glPatch->mipmap);
|
||||
HWR_UnlockCachedPatch(glPatch);
|
||||
}
|
||||
|
||||
// -----------------+
|
||||
@@ -428,49 +433,56 @@ static void md2_loadTexture(md2_t *model)
|
||||
// -----------------+
|
||||
static void md2_loadBlendTexture(md2_t *model)
|
||||
{
|
||||
GLPatch_t *glpatch;
|
||||
patch_t *patch;
|
||||
GLPatch_t *glPatch = NULL;
|
||||
|
||||
char *filename = Z_Malloc(strlen(model->filename)+7, PU_STATIC, NULL);
|
||||
|
||||
strcpy(filename, model->filename);
|
||||
|
||||
FIL_ForceExtension(filename, "_blend.png");
|
||||
|
||||
if (model->blendglpatch)
|
||||
{
|
||||
glpatch = model->blendglpatch;
|
||||
Z_Free(glpatch->mipmap->data);
|
||||
patch = model->blendglpatch;
|
||||
glPatch = (GLPatch_t *)(patch->hardware);
|
||||
if (glPatch)
|
||||
Z_Free(glPatch->mipmap->data);
|
||||
}
|
||||
else
|
||||
{
|
||||
glpatch = Z_Calloc(sizeof *glpatch, PU_HWRPATCHINFO,
|
||||
&(model->blendglpatch));
|
||||
glpatch->mipmap = Z_Calloc(sizeof (GLMipmap_t), PU_HWRPATCHINFO, NULL);
|
||||
}
|
||||
model->blendglpatch = patch = Patch_Create(NULL, 0, NULL);
|
||||
|
||||
if (!glpatch->mipmap->downloaded && !glpatch->mipmap->data)
|
||||
if (!patch->hardware)
|
||||
Patch_AllocateHardwarePatch(patch);
|
||||
|
||||
if (glPatch == NULL)
|
||||
glPatch = (GLPatch_t *)(patch->hardware);
|
||||
|
||||
if (!glPatch->mipmap->downloaded && !glPatch->mipmap->data)
|
||||
{
|
||||
int w = 0, h = 0;
|
||||
#ifdef HAVE_PNG
|
||||
glpatch->mipmap->format = PNG_Load(filename, &w, &h, glpatch);
|
||||
if (glpatch->mipmap->format == 0)
|
||||
glPatch->mipmap->format = PNG_Load(filename, &w, &h, glPatch);
|
||||
if (glPatch->mipmap->format == 0)
|
||||
#endif
|
||||
glpatch->mipmap->format = PCX_Load(filename, &w, &h, glpatch);
|
||||
if (glpatch->mipmap->format == 0)
|
||||
glPatch->mipmap->format = PCX_Load(filename, &w, &h, glPatch);
|
||||
if (glPatch->mipmap->format == 0)
|
||||
{
|
||||
glpatch->notfound = true;// mark it so its not searched for again repeatedly
|
||||
model->noblendfile = true; // mark it so its not searched for again repeatedly
|
||||
Z_Free(filename);
|
||||
return;
|
||||
}
|
||||
|
||||
glpatch->mipmap->downloaded = 0;
|
||||
glpatch->mipmap->flags = 0;
|
||||
glPatch->mipmap->downloaded = 0;
|
||||
glPatch->mipmap->flags = 0;
|
||||
|
||||
glpatch->width = (INT16)w;
|
||||
glpatch->height = (INT16)h;
|
||||
glpatch->mipmap->width = (UINT16)w;
|
||||
glpatch->mipmap->height = (UINT16)h;
|
||||
patch->width = (INT16)w;
|
||||
patch->height = (INT16)h;
|
||||
glPatch->mipmap->width = (UINT16)w;
|
||||
glPatch->mipmap->height = (UINT16)h;
|
||||
}
|
||||
GL_SetTexture(glpatch->mipmap); // We do need to do this so that it can be cleared and knows to recreate it when necessary
|
||||
HWR_UnlockCachedPatch(glpatch);
|
||||
GL_SetTexture(glPatch->mipmap); // We do need to do this so that it can be cleared and knows to recreate it when necessary
|
||||
HWR_UnlockCachedPatch(glPatch);
|
||||
|
||||
Z_Free(filename);
|
||||
}
|
||||
@@ -493,6 +505,8 @@ void HWR_InitMD2(void)
|
||||
md2_playermodels[s].model = NULL;
|
||||
md2_playermodels[s].glpatch = NULL;
|
||||
md2_playermodels[s].skin = -1;
|
||||
md2_playermodels[s].notexturefile = false;
|
||||
md2_playermodels[s].noblendfile = false;
|
||||
md2_playermodels[s].notfound = true;
|
||||
md2_playermodels[s].error = false;
|
||||
}
|
||||
@@ -502,6 +516,8 @@ void HWR_InitMD2(void)
|
||||
md2_localplayermodels[s].model = NULL;
|
||||
md2_localplayermodels[s].glpatch = NULL;
|
||||
md2_localplayermodels[s].skin = -1;
|
||||
md2_localplayermodels[s].notexturefile = false;
|
||||
md2_localplayermodels[s].noblendfile = false;
|
||||
md2_localplayermodels[s].notfound = true;
|
||||
md2_localplayermodels[s].error = false;
|
||||
}
|
||||
@@ -511,6 +527,8 @@ void HWR_InitMD2(void)
|
||||
md2_models[i].model = NULL;
|
||||
md2_models[i].glpatch = NULL;
|
||||
md2_models[i].skin = -1;
|
||||
md2_models[s].notexturefile = false;
|
||||
md2_models[s].noblendfile = false;
|
||||
md2_models[i].notfound = true;
|
||||
md2_models[i].error = false;
|
||||
}
|
||||
@@ -531,21 +549,10 @@ void HWR_InitMD2(void)
|
||||
}
|
||||
while (fscanf(f, "%19s %31s %f %f", name, filename, &scale, &offset) == 4)
|
||||
{
|
||||
/*if (stricmp(name, "PLAY") == 0)
|
||||
{
|
||||
CONS_Printf("MD2 for sprite PLAY detected in mdls.dat, use a player skin instead!\n");
|
||||
continue;
|
||||
}*/
|
||||
// 8/1/19: Allow PLAY to load for default MD2.
|
||||
|
||||
for (i = 0; i < NUMSPRITES; i++)
|
||||
{
|
||||
if (stricmp(name, sprnames[i]) == 0)
|
||||
{
|
||||
//if (stricmp(name, "PLAY") == 0)
|
||||
//continue;
|
||||
|
||||
//CONS_Debug(DBG_RENDER, " Found: %s %s %f %f\n", name, filename, scale, offset);
|
||||
md2_models[i].scale = scale;
|
||||
md2_models[i].offset = offset;
|
||||
md2_models[i].notfound = false;
|
||||
@@ -558,7 +565,6 @@ void HWR_InitMD2(void)
|
||||
{
|
||||
if (stricmp(name, skins[s].name) == 0)
|
||||
{
|
||||
//CONS_Printf(" Found: %s %s %f %f\n", name, filename, scale, offset);
|
||||
md2_playermodels[s].skin = s;
|
||||
md2_playermodels[s].scale = scale;
|
||||
md2_playermodels[s].offset = offset;
|
||||
@@ -607,7 +613,7 @@ void HWR_AddPlayerMD2(int skin, boolean local) // For MD2's that were added afte
|
||||
// Check for any MD2s that match the names of player skins!
|
||||
while (fscanf(f, "%19s %31s %f %f", name, filename, &scale, &offset) == 4)
|
||||
{
|
||||
if (stricmp(name, ( (local) ? localskins : skins )[skin].name) == 0)
|
||||
if (stricmp(name, K_GetSkinArray(local)[skin].name) == 0)
|
||||
{
|
||||
md2s[skin].skin = skin;
|
||||
md2s[skin].scale = scale;
|
||||
@@ -682,8 +688,10 @@ spritemd2found:
|
||||
#define SETBRIGHTNESS(brightness,r,g,b) \
|
||||
brightness = (UINT8)(((1063*(UINT32)(r))/5000) + ((3576*(UINT32)(g))/5000) + ((361*(UINT32)(b))/5000))
|
||||
|
||||
static void HWR_CreateBlendedTexture(GLPatch_t *gpatch, GLPatch_t *blendgpatch, GLMipmap_t *glMipmap, INT32 skinnum, skincolors_t color)
|
||||
static void HWR_CreateBlendedTexture(patch_t *gpatch, patch_t *blendgpatch, GLMipmap_t *glMipmap, INT32 skinnum, skincolors_t color)
|
||||
{
|
||||
GLPatch_t *hwrPatch = gpatch->hardware;
|
||||
GLPatch_t *hwrBlendPatch = blendgpatch->hardware;
|
||||
UINT16 w = gpatch->width, h = gpatch->height;
|
||||
UINT32 size = w*h;
|
||||
RGBA_t *image, *blendimage, *cur, blendcolor;
|
||||
@@ -715,11 +723,11 @@ static void HWR_CreateBlendedTexture(GLPatch_t *gpatch, GLPatch_t *blendgpatch,
|
||||
glMipmap->data = NULL;
|
||||
}
|
||||
|
||||
cur = Z_Malloc(size*4, PU_HWRCACHE, &glMipmap->data);
|
||||
cur = Z_Malloc(size*4, PU_HWRMODELTEXTURE, &glMipmap->data);
|
||||
memset(cur, 0x00, size*4);
|
||||
|
||||
image = gpatch->mipmap->data;
|
||||
blendimage = blendgpatch->mipmap->data;
|
||||
image = hwrPatch->mipmap->data;
|
||||
blendimage = hwrBlendPatch->mipmap->data;
|
||||
|
||||
// TC_METALSONIC includes an actual skincolor translation, on top of its flashing.
|
||||
if (skinnum == TC_METALSONIC)
|
||||
@@ -1042,32 +1050,42 @@ skippixel:
|
||||
|
||||
#undef SETBRIGHTNESS
|
||||
|
||||
static void HWR_GetBlendedTexture(GLPatch_t *gpatch, GLPatch_t *blendgpatch, INT32 skinnum, const UINT8 *colormap, skincolors_t color)
|
||||
static void HWR_GetBlendedTexture(patch_t *patch, patch_t *blendgpatch, INT32 skinnum, const UINT8 *colormap, skincolors_t color)
|
||||
{
|
||||
// mostly copied from HWR_GetMappedPatch, hence the similarities and comment
|
||||
GLPatch_t *glPatch = patch->hardware;
|
||||
GLMipmap_t *glMipmap, *newMipmap;
|
||||
|
||||
if (colormap == colormaps || colormap == NULL)
|
||||
|
||||
if (blendgpatch == NULL || colormap == colormaps || colormap == NULL)
|
||||
{
|
||||
// Don't do any blending
|
||||
GL_SetTexture(gpatch->mipmap);
|
||||
GL_SetTexture(glPatch->mipmap);
|
||||
return;
|
||||
}
|
||||
|
||||
// search for the Mipmap
|
||||
// skip the first (no colormap translated)
|
||||
for (glMipmap = gpatch->mipmap; glMipmap->nextcolormap; )
|
||||
for (glMipmap = glPatch->mipmap; glMipmap->nextcolormap; )
|
||||
{
|
||||
glMipmap = glMipmap->nextcolormap;
|
||||
|
||||
if (glMipmap->colormap != colormap)
|
||||
continue;
|
||||
|
||||
if (glMipmap->downloaded && glMipmap->data)
|
||||
if (glMipmap->colormap && glMipmap->colormap->source == colormap)
|
||||
{
|
||||
GL_SetTexture(glMipmap); // found the colormap, set it to the correct texture
|
||||
Z_ChangeTag(glMipmap->data, PU_HWRCACHE_UNLOCKED);
|
||||
return;
|
||||
if (glMipmap->downloaded && glMipmap->data)
|
||||
{
|
||||
if (memcmp(glMipmap->colormap->data, colormap, 256 * sizeof(UINT8)))
|
||||
{
|
||||
M_Memcpy(glMipmap->colormap->data, colormap, 256 * sizeof(UINT8));
|
||||
HWR_CreateBlendedTexture(patch, blendgpatch, glMipmap, skinnum, color);
|
||||
GL_UpdateTexture(glMipmap);
|
||||
}
|
||||
else
|
||||
GL_SetTexture(glMipmap); // found the colormap, set it to the correct texture
|
||||
|
||||
Z_ChangeTag(glMipmap->data, PU_HWRMODELTEXTURE_UNLOCKED);
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1080,14 +1098,17 @@ static void HWR_GetBlendedTexture(GLPatch_t *gpatch, GLPatch_t *blendgpatch, INT
|
||||
// (...) unfortunately z_malloc fragment alot the memory :(so malloc is better
|
||||
newMipmap = calloc(1, sizeof (*newMipmap));
|
||||
if (newMipmap == NULL)
|
||||
I_Error("%s: Out of memory", "HWR_GetMappedPatch");
|
||||
I_Error("%s: Out of memory", "HWR_GetBlendedTexture");
|
||||
glMipmap->nextcolormap = newMipmap;
|
||||
newMipmap->colormap = colormap;
|
||||
|
||||
HWR_CreateBlendedTexture(gpatch, blendgpatch, newMipmap, skinnum, color);
|
||||
newMipmap->colormap = Z_Calloc(sizeof(*newMipmap->colormap), PU_HWRPATCHCOLMIPMAP, NULL);
|
||||
newMipmap->colormap->source = colormap;
|
||||
M_Memcpy(newMipmap->colormap->data, colormap, 256 * sizeof(UINT8));
|
||||
|
||||
HWR_CreateBlendedTexture(patch, blendgpatch, newMipmap, skinnum, color);
|
||||
|
||||
GL_SetTexture(newMipmap);
|
||||
Z_ChangeTag(newMipmap->data, PU_HWRCACHE_UNLOCKED);
|
||||
Z_ChangeTag(newMipmap->data, PU_HWRMODELTEXTURE_UNLOCKED);
|
||||
}
|
||||
|
||||
// -----------------+
|
||||
@@ -1154,7 +1175,8 @@ void HWR_DrawMD2(gl_vissprite_t *spr)
|
||||
|
||||
// Look at HWR_ProjectSprite for more
|
||||
{
|
||||
GLPatch_t *gpatch;
|
||||
patch_t *gpatch, *blendgpatch;
|
||||
GLPatch_t *hwrPatch = NULL, *hwrBlendPatch = NULL;
|
||||
INT32 durs = spr->mobj->state->tics;
|
||||
INT32 tics = spr->mobj->tics;
|
||||
//mdlframe_t *next = NULL;
|
||||
@@ -1179,13 +1201,13 @@ void HWR_DrawMD2(gl_vissprite_t *spr)
|
||||
// Apparently people don't like jump frames like that, so back it goes
|
||||
//if (tics > durs)
|
||||
//durs = tics;
|
||||
|
||||
|
||||
INT32 blendmode;
|
||||
if (spr->mobj->frame & FF_BLENDMASK)
|
||||
blendmode = ((spr->mobj->frame & FF_BLENDMASK) >> FF_BLENDSHIFT) + 1;
|
||||
else
|
||||
blendmode = spr->mobj->blendmode;
|
||||
|
||||
|
||||
blendmode = min(AST_MODULATE, blendmode);
|
||||
|
||||
if (spr->mobj->flags2 & MF2_SHADOW)
|
||||
@@ -1207,7 +1229,7 @@ void HWR_DrawMD2(gl_vissprite_t *spr)
|
||||
|
||||
// dont forget to enabled the depth test because we can't do this like
|
||||
// before: polygons models are not sorted
|
||||
|
||||
|
||||
/* fuck you */
|
||||
if (spr->mobj->localskin)
|
||||
{
|
||||
@@ -1264,21 +1286,38 @@ void HWR_DrawMD2(gl_vissprite_t *spr)
|
||||
}
|
||||
//Hurdler: arf, I don't like that implementation at all... too much crappy
|
||||
gpatch = md2->glpatch;
|
||||
if (!gpatch || ((!gpatch->mipmap->format || !gpatch->mipmap->downloaded) && !gpatch->notfound))
|
||||
md2_loadTexture(md2);
|
||||
gpatch = md2->glpatch; // Load it again, because it isn't being loaded into gpatch after md2_loadtexture...
|
||||
if (gpatch)
|
||||
hwrPatch = ((GLPatch_t *)gpatch->hardware);
|
||||
|
||||
if ((gpatch && gpatch->mipmap->format) // don't load the blend texture if the base texture isn't available
|
||||
&& (!md2->blendglpatch
|
||||
|| ((!((GLPatch_t *)md2->blendglpatch)->mipmap->format || !((GLPatch_t *)md2->blendglpatch)->mipmap->downloaded)
|
||||
&& !((GLPatch_t *)md2->blendglpatch)->notfound)))
|
||||
if (!gpatch || !hwrPatch
|
||||
|| ((!hwrPatch->mipmap->format || !hwrPatch->mipmap->downloaded) && !md2->notexturefile))
|
||||
md2_loadTexture(md2);
|
||||
|
||||
// Load it again, because it isn't being loaded into gpatch after md2_loadtexture...
|
||||
gpatch = md2->glpatch;
|
||||
if (gpatch)
|
||||
hwrPatch = ((GLPatch_t *)gpatch->hardware);
|
||||
|
||||
// Load blend texture
|
||||
blendgpatch = md2->blendglpatch;
|
||||
if (blendgpatch)
|
||||
hwrBlendPatch = ((GLPatch_t *)blendgpatch->hardware);
|
||||
|
||||
if ((gpatch && hwrPatch && hwrPatch->mipmap->format) // don't load the blend texture if the base texture isn't available
|
||||
&& (!blendgpatch || !hwrBlendPatch
|
||||
|| ((!hwrBlendPatch->mipmap->format || !hwrBlendPatch->mipmap->downloaded) && !md2->noblendfile)))
|
||||
md2_loadBlendTexture(md2);
|
||||
|
||||
if (gpatch && gpatch->mipmap->format) // else if meant that if a texture couldn't be loaded, it would just end up using something else's texture
|
||||
// Load it again, because it isn't being loaded into blendgpatch after md2_loadblendtexture...
|
||||
blendgpatch = md2->blendglpatch;
|
||||
if (blendgpatch)
|
||||
hwrBlendPatch = ((GLPatch_t *)blendgpatch->hardware);
|
||||
|
||||
if (gpatch && hwrPatch && hwrPatch->mipmap->format) // else if meant that if a texture couldn't be loaded, it would just end up using something else's texture
|
||||
{
|
||||
if ((skincolors_t)spr->mobj->color != SKINCOLOR_NONE &&
|
||||
md2->blendglpatch && ((GLPatch_t *)md2->blendglpatch)->mipmap->format
|
||||
&& gpatch->width == ((GLPatch_t *)md2->blendglpatch)->width && gpatch->height == ((GLPatch_t *)md2->blendglpatch)->height)
|
||||
blendgpatch && hwrBlendPatch->mipmap->format
|
||||
&& gpatch->width == blendgpatch->width && gpatch->height == blendgpatch->height)
|
||||
{
|
||||
INT32 tcskinnum = TC_DEFAULT;
|
||||
if ((spr->mobj->flags & MF_BOSS) && (spr->mobj->flags2 & MF2_FRET) && (leveltime & 1)) // Bosses "flash"
|
||||
@@ -1298,24 +1337,24 @@ void HWR_DrawMD2(gl_vissprite_t *spr)
|
||||
tcskinnum = TC_RAINBOW;
|
||||
else
|
||||
{
|
||||
tcskinnum = (INT32)((skin_t*)( (spr->mobj->localskin) ? spr->mobj->localskin : spr->mobj->skin ) - ( (spr->mobj->skinlocal) ? localskins : skins ));
|
||||
tcskinnum = (INT32)(K_GetMobjSkinNum(K_GetMobjSkin(spr->mobj), spr->mobj->skinlocal));
|
||||
}
|
||||
}
|
||||
else tcskinnum = TC_DEFAULT;
|
||||
}
|
||||
HWR_GetBlendedTexture(gpatch, (GLPatch_t *)md2->blendglpatch, tcskinnum, spr->colormap, (skincolors_t)spr->mobj->color);
|
||||
|
||||
HWR_GetBlendedTexture(gpatch, blendgpatch, tcskinnum, spr->colormap, (skincolors_t)spr->mobj->color);
|
||||
}
|
||||
else
|
||||
{
|
||||
// This is safe, since we know the texture has been downloaded
|
||||
GL_SetTexture(gpatch->mipmap);
|
||||
GL_SetTexture(hwrPatch->mipmap);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
// Sprite
|
||||
gpatch = spr->gpatch; //gpatch = W_CachePatchNum(spr->patchlumpnum, PU_CACHE);
|
||||
HWR_GetMappedPatch(gpatch, spr->colormap);
|
||||
HWR_GetMappedPatch(spr->gpatch, spr->colormap);
|
||||
}
|
||||
|
||||
if (spr->mobj->frame & FF_ANIMATE)
|
||||
@@ -1364,8 +1403,8 @@ void HWR_DrawMD2(gl_vissprite_t *spr)
|
||||
else
|
||||
p.z = FIXED_TO_FLOAT(interp.z);
|
||||
|
||||
if (spr->mobj->skin && spr->mobj->sprite == SPR_PLAY)
|
||||
sprdef = &((skin_t *)( (spr->mobj->localskin) ? spr->mobj->localskin : spr->mobj->skin ))->spritedef;
|
||||
if ((spr->mobj->skin || spr->mobj->localskin) && spr->mobj->sprite == SPR_PLAY)
|
||||
sprdef = &K_GetMobjSkin(spr->mobj)->spritedef;
|
||||
else
|
||||
sprdef = &sprites[spr->mobj->sprite];
|
||||
|
||||
@@ -1392,6 +1431,8 @@ void HWR_DrawMD2(gl_vissprite_t *spr)
|
||||
? (spr->mobj->rollangle) + (sliptideroll * spr->mobj->player->kartstuff[k_aizdriftstrat])
|
||||
: (spr->mobj->rollangle);
|
||||
|
||||
rollang *= flipfactor;
|
||||
|
||||
fixed_t anglef = AngleFixed(rollang);
|
||||
|
||||
p.rollangle = 0.0f;
|
||||
@@ -1429,8 +1470,7 @@ void HWR_DrawMD2(gl_vissprite_t *spr)
|
||||
p.anglex += flipfactor*FIXED_TO_FLOAT(AngleFixed(interp.roll));
|
||||
p.anglez -= flipfactor*FIXED_TO_FLOAT(AngleFixed(interp.pitch));
|
||||
|
||||
p.flip = atransform.flip;
|
||||
p.mirror = atransform.mirror; // from Kart
|
||||
p.fliptype = atransform.fliptype;
|
||||
|
||||
GL_SetShader(SHADER_MODEL); // model shader
|
||||
{
|
||||
|
||||
@@ -29,7 +29,9 @@ typedef struct
|
||||
float offset;
|
||||
model_t *model;
|
||||
void *glpatch;
|
||||
boolean notexturefile; // true if texture file was not found
|
||||
void *blendglpatch;
|
||||
boolean noblendfile; // true if blend texture file was not found
|
||||
boolean notfound;
|
||||
INT32 skin;
|
||||
boolean error;
|
||||
|
||||
+139
-112
@@ -99,14 +99,16 @@ static GLuint screenPaletteTex = 0; // 1D texture containing the screen palette
|
||||
static GLuint paletteLookupTex = 0; // 3D texture containing RGB -> palette index lookup table
|
||||
RGBA_t myPaletteData[256]; // the palette for converting textures to RGBA
|
||||
|
||||
GLint screen_width = 0; // used by Draw2DLine()
|
||||
GLint screen_height = 0;
|
||||
GLbyte screen_depth = 0;
|
||||
GLint textureformatGL = 0;
|
||||
GLint maximumAnisotropy = 0;
|
||||
static GLboolean MipMap = GL_FALSE;
|
||||
static GLint min_filter = GL_LINEAR;
|
||||
static GLint mag_filter = GL_LINEAR;
|
||||
static GLint gltexformat = GL_RGB5_A1;
|
||||
GLint screen_width = 0; // used by Draw2DLine()
|
||||
GLint screen_height = 0;
|
||||
GLint screen_texsizew = 512; // Power-of-two screen texture render resolution
|
||||
GLint screen_texsizeh = 512; // Power-of-two screen texture render resolution
|
||||
GLbyte screen_depth = 0;
|
||||
GLint maximumAnisotropy = 0;
|
||||
static GLboolean MipMap = GL_FALSE;
|
||||
static GLint min_filter = GL_LINEAR;
|
||||
static GLint mag_filter = GL_LINEAR;
|
||||
static GLint anisotropic_filter = 0;
|
||||
boolean supportMipMap = false;
|
||||
|
||||
@@ -129,6 +131,8 @@ GLuint FramebufferObject, FramebufferTexture, RenderbufferObject;
|
||||
|
||||
boolean supportFBO = false;
|
||||
static boolean fboinit = false;
|
||||
|
||||
static void GL_Framebuffer_DeleteAttachments(void);
|
||||
#endif
|
||||
|
||||
// Sryder: NextTexAvail is broken for these because palette changes or changes to the texture filter or antialiasing
|
||||
@@ -191,7 +195,7 @@ FUNCPRINTF void GL_DBG_Printf(const char *format, ...)
|
||||
|
||||
if (!gllogstream)
|
||||
gllogstream = fopen("ogllog.txt", "w");
|
||||
|
||||
|
||||
va_start(arglist, format);
|
||||
vsnprintf(str, 4096, format, arglist);
|
||||
va_end(arglist);
|
||||
@@ -346,6 +350,8 @@ typedef void (APIENTRY * PFNglDisable) (GLenum cap);
|
||||
static PFNglDisable pglDisable;
|
||||
typedef void (APIENTRY * PFNglGetFloatv) (GLenum pname, GLfloat *params);
|
||||
static PFNglGetFloatv pglGetFloatv;
|
||||
typedef void (APIENTRY * PFNglPolygonMode) (GLenum, GLenum);
|
||||
static PFNglPolygonMode pglPolygonMode;
|
||||
|
||||
/* Depth Buffer */
|
||||
typedef void (APIENTRY * PFNglClearDepth) (GLclampd depth);
|
||||
@@ -545,6 +551,7 @@ boolean SetupGLfunc(void)
|
||||
GETOPENGLFUNC(pglGetFloatv, glGetFloatv)
|
||||
GETOPENGLFUNC(pglGetIntegerv, glGetIntegerv)
|
||||
GETOPENGLFUNC(pglGetString, glGetString)
|
||||
GETOPENGLFUNC(pglPolygonMode, glPolygonMode)
|
||||
|
||||
GETOPENGLFUNC(pglClearDepth, glClearDepth)
|
||||
GETOPENGLFUNC(pglDepthFunc, glDepthFunc)
|
||||
@@ -673,7 +680,7 @@ typedef enum
|
||||
gluniform_light_dir,
|
||||
gluniform_light_contrast,
|
||||
gluniform_light_backlight,
|
||||
|
||||
|
||||
// palette rendering
|
||||
gluniform_palette_tex, // 1d texture containing a palette
|
||||
gluniform_palette_lookup_tex, // 3d texture containing the rgb->index lookup table
|
||||
@@ -743,7 +750,7 @@ void SetupGLFunc4(void)
|
||||
pglMultiTexCoord2f = GetGLFunc("glMultiTexCoord2f");
|
||||
pglClientActiveTexture = GetGLFunc("glClientActiveTexture");
|
||||
pglMultiTexCoord2fv = GetGLFunc("glMultiTexCoord2fv");
|
||||
|
||||
|
||||
/* 1.5 funcs */
|
||||
pglGenBuffers = GetGLFunc("glGenBuffers");
|
||||
pglBindBuffer = GetGLFunc("glBindBuffer");
|
||||
@@ -753,7 +760,7 @@ void SetupGLFunc4(void)
|
||||
|
||||
/* 2.0 funcs */
|
||||
pglBlendEquation = GetGLFunc("glBlendEquation");
|
||||
|
||||
|
||||
pglStencilFuncSeparate = GetGLFunc("glStencilFuncSeparate");
|
||||
pglStencilOpSeparate = GetGLFunc("glStencilOpSeparate");
|
||||
|
||||
@@ -809,7 +816,7 @@ boolean GL_InitShaders(void)
|
||||
{
|
||||
if (!pglUseProgram)
|
||||
return false;
|
||||
|
||||
|
||||
gl_fallback_shader.vertex_shader = Z_StrDup(GLSL_FALLBACK_VERTEX_SHADER);
|
||||
gl_fallback_shader.fragment_shader = Z_StrDup(GLSL_FALLBACK_FRAGMENT_SHADER);
|
||||
|
||||
@@ -948,7 +955,7 @@ void GL_UnSetShader(void)
|
||||
static void GL_SetNoTexture(void)
|
||||
{
|
||||
// Disable texture.
|
||||
if (tex_downloaded != NOTEXTURE_NUM && !currently_batching)
|
||||
if (tex_downloaded != NOTEXTURE_NUM)
|
||||
{
|
||||
if (NOTEXTURE_NUM == 0)
|
||||
pglGenTextures(1, &NOTEXTURE_NUM);
|
||||
@@ -991,8 +998,43 @@ static void GL_Perspective(GLfloat fovy, GLfloat aspect)
|
||||
// -----------------+
|
||||
void GL_SetModelView(GLint w, GLint h)
|
||||
{
|
||||
GLint maxtexsize = 0;
|
||||
//GL_DBG_Printf("SetModelView(): %dx%d\n", (int)w, (int)h);
|
||||
|
||||
// The screen textures need to be flushed if the width or height change so that they be remade for the correct size
|
||||
if (screen_width != w || screen_height != h)
|
||||
{
|
||||
GL_FlushScreenTextures();
|
||||
|
||||
#ifdef USE_FBO_OGL
|
||||
GL_Framebuffer_DeleteAttachments();
|
||||
#endif
|
||||
}
|
||||
|
||||
screen_width = (GLint)w;
|
||||
screen_height = (GLint)h;
|
||||
|
||||
screen_texsizew = screen_texsizeh = 512;
|
||||
|
||||
// look for power of two that is large enough for the screen
|
||||
while (screen_texsizew < w)
|
||||
screen_texsizew <<= 1;
|
||||
|
||||
while (screen_texsizeh < h)
|
||||
screen_texsizeh <<= 1;
|
||||
|
||||
pglGetIntegerv(GL_MAX_TEXTURE_SIZE, &maxtexsize); // Get the maximum supported texture size
|
||||
if ((screen_texsizew > maxtexsize || screen_texsizeh > maxtexsize) && maxtexsize > 0)
|
||||
{
|
||||
// The desired screen texture resolution is too big for the player's GPU!
|
||||
CONS_Alert(CONS_WARNING, "Tried to make a screen texture for a %dx%d game resolution, but your GPU only supports up to %dx%d! Please switch to the software renderer or lower your game resolution.\n", w, h, maxtexsize, maxtexsize);
|
||||
|
||||
// For now, let's just pray that clamping it to the maximum supported size "works"
|
||||
// There'll be a stretchy "border" artefact, but it's better than failing to make the screen textures
|
||||
screen_texsizew = min(screen_texsizew, maxtexsize);
|
||||
screen_texsizeh = min(screen_texsizeh, maxtexsize);
|
||||
}
|
||||
|
||||
pglViewport(0, 0, w, h);
|
||||
|
||||
pglMatrixMode(GL_PROJECTION);
|
||||
@@ -1038,6 +1080,8 @@ void GL_SetStates(void)
|
||||
|
||||
pglPolygonOffset(-1.0f, -1.0f);
|
||||
|
||||
pglDisable(GL_FOG);
|
||||
|
||||
// bp : when no t&l :)
|
||||
pglLoadIdentity();
|
||||
pglScalef(1.0f, 1.0f, -1.0f);
|
||||
@@ -1122,7 +1166,7 @@ static void GL_Framebuffer_GenerateAttachments(void)
|
||||
fboinit = true;
|
||||
}
|
||||
|
||||
void GL_Framebuffer_DeleteAttachments(void)
|
||||
static void GL_Framebuffer_DeleteAttachments(void)
|
||||
{
|
||||
if (!supportFBO || fboinit == false)
|
||||
return;
|
||||
@@ -1529,7 +1573,7 @@ void GL_SetBlend(FBITFIELD PolyFlags)
|
||||
{
|
||||
const FBITFIELD Xor = CurrentPolyFlags^PolyFlags;;
|
||||
|
||||
if (Xor & (PF_Blending|PF_RemoveYWrap|PF_ForceWrapX|PF_ForceWrapY|PF_Occlude|PF_NoTexture|PF_Modulated|PF_NoDepthTest|PF_Decal|PF_Invisible))
|
||||
if (Xor & (PF_Blending|PF_RemoveYWrap|PF_ForceWrapX|PF_ForceWrapY|PF_Occlude|PF_NoTexture|PF_Modulated|PF_NoDepthTest|PF_Decal|PF_Skydecal|PF_Invisible))
|
||||
{
|
||||
if (Xor & PF_Blending) // if blending mode must be changed
|
||||
GL_SetBlendMode(PolyFlags & PF_Blending);
|
||||
@@ -1545,7 +1589,21 @@ void GL_SetBlend(FBITFIELD PolyFlags)
|
||||
if (Xor & PF_Decal)
|
||||
{
|
||||
if (PolyFlags & PF_Decal)
|
||||
{
|
||||
pglPolygonOffset(-1.0f, -1.0f);
|
||||
pglEnable(GL_POLYGON_OFFSET_FILL);
|
||||
}
|
||||
else
|
||||
pglDisable(GL_POLYGON_OFFSET_FILL);
|
||||
}
|
||||
|
||||
if (Xor & PF_Skydecal)
|
||||
{
|
||||
if (PolyFlags & PF_Skydecal)
|
||||
{
|
||||
pglPolygonOffset(0.45f, 0.45f);
|
||||
pglEnable(GL_POLYGON_OFFSET_FILL);
|
||||
}
|
||||
else
|
||||
pglDisable(GL_POLYGON_OFFSET_FILL);
|
||||
}
|
||||
@@ -1643,7 +1701,7 @@ static void GL_AllocTextureBuffer(GLMipmap_t *pTexInfo)
|
||||
// -----------------+
|
||||
// UpdateTexture : Updates texture data.
|
||||
// -----------------+
|
||||
static void GL_UpdateTexture(GLMipmap_t *pTexInfo)
|
||||
void GL_UpdateTexture(GLMipmap_t *pTexInfo)
|
||||
{
|
||||
// Upload a texture
|
||||
GLuint num = pTexInfo->downloaded;
|
||||
@@ -1669,9 +1727,10 @@ static void GL_UpdateTexture(GLMipmap_t *pTexInfo)
|
||||
|
||||
//GL_DBG_Printf("UpdateTexture %d %x\n", (INT32)num, pImgData);
|
||||
|
||||
texformat = textureformatGL;
|
||||
texformat = gltexformat;
|
||||
const GLTextureFormat_t texinfoformat = pTexInfo->format;
|
||||
|
||||
switch (pTexInfo->format)
|
||||
switch (texinfoformat)
|
||||
{
|
||||
case GL_TEXFMT_P_8:
|
||||
case GL_TEXFMT_AP_88:
|
||||
@@ -1696,7 +1755,7 @@ static void GL_UpdateTexture(GLMipmap_t *pTexInfo)
|
||||
|
||||
pImgData++;
|
||||
|
||||
if (pTexInfo->format != GL_TEXFMT_AP_88)
|
||||
if (texinfoformat != GL_TEXFMT_AP_88)
|
||||
continue;
|
||||
if (chromakeyed)
|
||||
continue;
|
||||
@@ -1744,7 +1803,7 @@ static void GL_UpdateTexture(GLMipmap_t *pTexInfo)
|
||||
}
|
||||
break;
|
||||
default:
|
||||
GL_MSG_Warning("UpdateTexture: bad format %d\n", pTexInfo->format);
|
||||
GL_MSG_Warning("UpdateTexture: bad format %d\n", texinfoformat);
|
||||
break;
|
||||
}
|
||||
|
||||
@@ -1767,6 +1826,8 @@ static void GL_UpdateTexture(GLMipmap_t *pTexInfo)
|
||||
|
||||
if (MipMap && !transparent) // No mipmaps on transparent stuff
|
||||
{
|
||||
int maxlod = (texformat == GL_LUMINANCE_ALPHA || texformat == GL_ALPHA) ? 4 : 5;
|
||||
|
||||
pglTexParameteri(GL_TEXTURE_2D, GL_GENERATE_MIPMAP, GL_TRUE);
|
||||
|
||||
if (update)
|
||||
@@ -1776,7 +1837,7 @@ static void GL_UpdateTexture(GLMipmap_t *pTexInfo)
|
||||
|
||||
// Control the mipmap level of detail
|
||||
pglTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_LOD, 0);
|
||||
pglTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAX_LOD, 4);
|
||||
pglTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAX_LOD, maxlod);
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -2021,7 +2082,7 @@ static boolean GL_Shader_CompileProgram(gl_shader_t *shader, GLint i)
|
||||
pglDeleteShader(gl_vertShader);
|
||||
if (frag_shader)
|
||||
pglDeleteShader(gl_fragShader);
|
||||
|
||||
|
||||
// couldn't link?
|
||||
if (result != GL_TRUE)
|
||||
{
|
||||
@@ -2305,7 +2366,16 @@ void GL_SetSpecialState(hwdspecialstate_t IdState, INT32 Value)
|
||||
|
||||
GL_Flush(); //??? if we want to change filter mode by texture, remove this
|
||||
break;
|
||||
|
||||
|
||||
case HWD_SET_WIREFRAME:
|
||||
pglPolygonMode(GL_FRONT_AND_BACK, Value ? GL_LINE : GL_FILL);
|
||||
break;
|
||||
|
||||
case HWD_SET_TEXTURE_FORMAT:
|
||||
gltexformat = (Value == 32) ? GL_RGBA : GL_RGB5_A1;
|
||||
GL_Flush();
|
||||
break;
|
||||
|
||||
case HWD_SET_MSAA:
|
||||
if (Value)
|
||||
{
|
||||
@@ -2615,7 +2685,7 @@ void GL_DrawModelEx(model_t *model, INT32 frameIndex, float duration, float tics
|
||||
scalex = hscale;
|
||||
scaley = vscale;
|
||||
scalez = hscale;
|
||||
|
||||
|
||||
if (duration > 0.0 && tics >= 0.0) // don't interpolate if instantaneous or infinite in length
|
||||
{
|
||||
float newtime = (duration - tics); // + 1;
|
||||
@@ -2667,8 +2737,7 @@ void GL_DrawModelEx(model_t *model, INT32 frameIndex, float duration, float tics
|
||||
// pos->mirror is if the screen is flipped horizontally
|
||||
// XOR all the flips together to figure out what culling to use!
|
||||
{
|
||||
boolean reversecull = (flipped ^ hflipped ^ pos->flip ^ pos->mirror);
|
||||
if (reversecull)
|
||||
if ((flipped ^ hflipped ^ !!(pos->fliptype & TRANSFORM_FLIP) ^ !!(pos->fliptype & TRANSFORM_MIRROR)))
|
||||
pglCullFace(GL_FRONT);
|
||||
else
|
||||
pglCullFace(GL_BACK);
|
||||
@@ -2684,7 +2753,7 @@ void GL_DrawModelEx(model_t *model, INT32 frameIndex, float duration, float tics
|
||||
pglRotatef(pos->anglez, 0.0f, 0.0f, -1.0f);
|
||||
pglRotatef(pos->anglex, 1.0f, 0.0f, 0.0f);
|
||||
pglRotatef(pos->angley, 0.0f, -1.0f, 0.0f);
|
||||
|
||||
|
||||
if (pos->roll)
|
||||
{
|
||||
pglTranslatef(pos->centerx, pos->centery, 0);
|
||||
@@ -2814,14 +2883,21 @@ void GL_SetTransform(FTransform *stransform)
|
||||
used_fov = stransform->fovangle;
|
||||
shearing = stransform->shearing;
|
||||
|
||||
if (stransform->mirror)
|
||||
pglScalef(-stransform->scalex, stransform->scaley, -stransform->scalez);
|
||||
else if (stransform->mirrorflip)
|
||||
pglScalef(-stransform->scalex, -stransform->scaley, -stransform->scalez);
|
||||
else if (stransform->flip)
|
||||
pglScalef(stransform->scalex, -stransform->scaley, -stransform->scalez);
|
||||
else
|
||||
pglScalef(stransform->scalex, stransform->scaley, -stransform->scalez);
|
||||
switch (stransform->fliptype)
|
||||
{
|
||||
case TRANSFORM_MIRROR:
|
||||
pglScalef(-stransform->scalex, stransform->scaley, -stransform->scalez);
|
||||
break;
|
||||
case TRANSFORM_MIRRORFLIP:
|
||||
pglScalef(-stransform->scalex, -stransform->scaley, -stransform->scalez);
|
||||
break;
|
||||
case TRANSFORM_FLIP:
|
||||
pglScalef(stransform->scalex, -stransform->scaley, -stransform->scalez);
|
||||
break;
|
||||
default: // TRANSFORM_NONE
|
||||
pglScalef(stransform->scalex, stransform->scaley, -stransform->scalez);
|
||||
break;
|
||||
}
|
||||
|
||||
if (stransform->roll)
|
||||
pglRotatef(stransform->rollangle, 0.0f, 0.0f, 1.0f);
|
||||
@@ -2847,7 +2923,7 @@ void GL_SetTransform(FTransform *stransform)
|
||||
if (shearing)
|
||||
{
|
||||
float dy = stransform->viewaiming * 2;
|
||||
if (stransform->flip || stransform->mirrorflip)
|
||||
if (stransform->fliptype == TRANSFORM_FLIP || stransform->fliptype == TRANSFORM_MIRRORFLIP)
|
||||
dy *= -1.0f;
|
||||
pglTranslatef(0.0f, -dy/BASEVIDHEIGHT, 0.0f);
|
||||
}
|
||||
@@ -2887,7 +2963,7 @@ INT32 GL_GetTextureUsed(void)
|
||||
res += tmp->height*tmp->width*bpp;
|
||||
tmp = tmp->next;
|
||||
}
|
||||
|
||||
|
||||
return res;
|
||||
}
|
||||
|
||||
@@ -2896,7 +2972,6 @@ void GL_PostImgRedraw(float points[SCREENVERTS][SCREENVERTS][2])
|
||||
INT32 x, y;
|
||||
float float_x, float_y, float_nextx, float_nexty;
|
||||
float xfix, yfix;
|
||||
INT32 texsizew = 512, texsizey = 512;
|
||||
|
||||
const float blackBack[16] =
|
||||
{
|
||||
@@ -2905,23 +2980,17 @@ void GL_PostImgRedraw(float points[SCREENVERTS][SCREENVERTS][2])
|
||||
16.0f, 16.0f, 6.0f,
|
||||
16.0f, -16.0f, 6.0f
|
||||
};
|
||||
|
||||
if (gl_enable_screen_textures != 2)
|
||||
|
||||
if (gl_enable_screen_textures != 2)
|
||||
return;
|
||||
|
||||
// look for power of two that is large enough for the screen
|
||||
while (texsizew < screen_width)
|
||||
texsizew <<= 1;
|
||||
|
||||
while (texsizey < screen_height)
|
||||
texsizey <<= 1;
|
||||
|
||||
// X/Y stretch fix for all resolutions(!)
|
||||
xfix = (float)(texsizew)/((float)((screen_width)/(float)(SCREENVERTS-1)));
|
||||
yfix = (float)(texsizey)/((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);
|
||||
pglDisableClientState(GL_TEXTURE_COORD_ARRAY);
|
||||
|
||||
// Draw a black square behind the screen texture,
|
||||
// so nothing shows through the edges
|
||||
@@ -2929,8 +2998,8 @@ void GL_PostImgRedraw(float points[SCREENVERTS][SCREENVERTS][2])
|
||||
|
||||
pglVertexPointer(3, GL_FLOAT, 0, blackBack);
|
||||
pglDrawArrays(GL_TRIANGLE_FAN, 0, 4);
|
||||
|
||||
pglEnableClientState(GL_TEXTURE_COORD_ARRAY);
|
||||
|
||||
for(x = 0; x < SCREENVERTS-1;x ++)
|
||||
{
|
||||
for(y = 0; y < SCREENVERTS-1; y++)
|
||||
@@ -2991,7 +3060,6 @@ void GL_FlushScreenTextures(void)
|
||||
void GL_DrawScreenTexture(int tex, FSurfaceInfo *surf, FBITFIELD polyflags)
|
||||
{
|
||||
float xfix, yfix;
|
||||
INT32 texsizew = 512, texsizey = 512;
|
||||
|
||||
const float screenVerts[12] =
|
||||
{
|
||||
@@ -3002,19 +3070,12 @@ void GL_DrawScreenTexture(int tex, FSurfaceInfo *surf, FBITFIELD polyflags)
|
||||
};
|
||||
|
||||
float fix[8];
|
||||
|
||||
if (gl_enable_screen_textures != 2)
|
||||
|
||||
if (gl_enable_screen_textures != 2)
|
||||
return;
|
||||
|
||||
// look for power of two that is large enough for the screen
|
||||
while (texsizew < screen_width)
|
||||
texsizew <<= 1;
|
||||
|
||||
while (texsizey < screen_height)
|
||||
texsizey <<= 1;
|
||||
|
||||
xfix = 1/((float)(texsizew)/((float)((screen_width))));
|
||||
yfix = 1/((float)(texsizey)/((float)((screen_height))));
|
||||
xfix = 1/((float)(screen_texsizew)/((float)((screen_width))));
|
||||
yfix = 1/((float)(screen_texsizeh)/((float)((screen_height))));
|
||||
|
||||
// const float screenVerts[12]
|
||||
|
||||
@@ -3031,7 +3092,7 @@ void GL_DrawScreenTexture(int tex, FSurfaceInfo *surf, FBITFIELD polyflags)
|
||||
pglClear(GL_COLOR_BUFFER_BIT|GL_DEPTH_BUFFER_BIT);
|
||||
|
||||
pglBindTexture(GL_TEXTURE_2D, screenTextures[tex]);
|
||||
|
||||
|
||||
GL_PreparePolygon(surf, surf ? polyflags : (PF_NoDepthTest));
|
||||
if (!surf)
|
||||
pglColor4ubv(white);
|
||||
@@ -3047,7 +3108,6 @@ void GL_DrawScreenTexture(int tex, FSurfaceInfo *surf, FBITFIELD polyflags)
|
||||
// Do screen fades!
|
||||
void GL_DoScreenWipe(int wipeStart, int wipeEnd)
|
||||
{
|
||||
INT32 texsizew = 512, texsizey = 512;
|
||||
float xfix, yfix;
|
||||
|
||||
INT32 fademaskdownloaded = tex_downloaded; // the fade mask that has been set
|
||||
@@ -3070,18 +3130,11 @@ void GL_DoScreenWipe(int wipeStart, int wipeEnd)
|
||||
1.0f, 1.0f
|
||||
};
|
||||
|
||||
if (!gl_enable_screen_textures)
|
||||
if (!gl_enable_screen_textures)
|
||||
return;
|
||||
|
||||
// look for power of two that is large enough for the screen
|
||||
while (texsizew < screen_width)
|
||||
texsizew <<= 1;
|
||||
|
||||
while (texsizey < screen_height)
|
||||
texsizey <<= 1;
|
||||
|
||||
xfix = 1/((float)(texsizew)/((float)((screen_width))));
|
||||
yfix = 1/((float)(texsizey)/((float)((screen_height))));
|
||||
xfix = 1/((float)(screen_texsizew)/((float)((screen_width))));
|
||||
yfix = 1/((float)(screen_texsizeh)/((float)((screen_height))));
|
||||
|
||||
// const float screenVerts[12]
|
||||
|
||||
@@ -3121,8 +3174,6 @@ void GL_DoScreenWipe(int wipeStart, int wipeEnd)
|
||||
|
||||
pglTexEnvi(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_MODULATE);
|
||||
|
||||
// const float defaultST[8]
|
||||
|
||||
pglClientActiveTexture(GL_TEXTURE0);
|
||||
pglTexCoordPointer(2, GL_FLOAT, 0, fix);
|
||||
pglVertexPointer(3, GL_FLOAT, 0, screenVerts);
|
||||
@@ -3141,7 +3192,6 @@ void GL_DoScreenWipe(int wipeStart, int wipeEnd)
|
||||
|
||||
void GL_RenderVhsEffect(fixed_t upbary, fixed_t downbary, UINT8 updistort, UINT8 downdistort, UINT8 barsize)
|
||||
{
|
||||
INT32 texsizew = 512, texsizey = 512;
|
||||
int tex = HWD_SCREENTEXTURE_VHS;
|
||||
float xfix, yfix;
|
||||
float fix[8];
|
||||
@@ -3156,18 +3206,11 @@ void GL_RenderVhsEffect(fixed_t upbary, fixed_t downbary, UINT8 updistort, UINT8
|
||||
1.0f, -1.0f, 1.0f
|
||||
};
|
||||
|
||||
if (gl_enable_screen_textures != 2)
|
||||
if (gl_enable_screen_textures != 2)
|
||||
return;
|
||||
|
||||
// look for power of two that is large enough for the screen
|
||||
while (texsizew < screen_width)
|
||||
texsizew <<= 1;
|
||||
|
||||
while (texsizey < screen_height)
|
||||
texsizey <<= 1;
|
||||
|
||||
xfix = 1/((float)(texsizew)/((float)((screen_width))));
|
||||
yfix = 1/((float)(texsizey)/((float)((screen_height))));
|
||||
xfix = 1/((float)(screen_texsizew)/((float)((screen_width))));
|
||||
yfix = 1/((float)(screen_texsizeh)/((float)((screen_height))));
|
||||
|
||||
// Slight fuzziness
|
||||
GL_MakeScreenTexture(tex);
|
||||
@@ -3251,19 +3294,11 @@ void GL_RenderVhsEffect(fixed_t upbary, fixed_t downbary, UINT8 updistort, UINT8
|
||||
// Create a texture from the screen.
|
||||
void GL_MakeScreenTexture(int tex)
|
||||
{
|
||||
INT32 texsizew = 512, texsizey = 512;
|
||||
boolean firstTime = (screenTextures[tex] == 0);
|
||||
|
||||
|
||||
if (!gl_enable_screen_textures)
|
||||
return;
|
||||
|
||||
// look for power of two that is large enough for the screen
|
||||
while (texsizew < screen_width)
|
||||
texsizew <<= 1;
|
||||
|
||||
while (texsizey < screen_height)
|
||||
texsizey <<= 1;
|
||||
|
||||
// Create screen texture
|
||||
if (firstTime)
|
||||
pglGenTextures(1, &screenTextures[tex]);
|
||||
@@ -3275,10 +3310,10 @@ void GL_MakeScreenTexture(int tex)
|
||||
pglTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST);
|
||||
Clamp2D(GL_TEXTURE_WRAP_S);
|
||||
Clamp2D(GL_TEXTURE_WRAP_T);
|
||||
pglCopyTexImage2D(GL_TEXTURE_2D, 0, GL_RGB, 0, 0, texsizew, texsizey, 0);
|
||||
pglCopyTexImage2D(GL_TEXTURE_2D, 0, GL_RGB, 0, 0, screen_texsizew, screen_texsizeh, 0);
|
||||
}
|
||||
else
|
||||
pglCopyTexSubImage2D(GL_TEXTURE_2D, 0, 0, 0, 0, 0, texsizew, texsizey);
|
||||
pglCopyTexSubImage2D(GL_TEXTURE_2D, 0, 0, 0, 0, 0, screen_texsizew, screen_texsizeh);
|
||||
|
||||
tex_downloaded = screenTextures[tex];
|
||||
}
|
||||
@@ -3289,23 +3324,15 @@ void GL_DrawScreenFinalTexture(int tex, INT32 width, INT32 height, boolean usesh
|
||||
float origaspect, newaspect;
|
||||
float xoff = 1, yoff = 1; // xoffset and yoffset for the polygon to have black bars around the screen
|
||||
FRGBAFloat clearColour;
|
||||
INT32 texsizew = 512, texsizey = 512;
|
||||
|
||||
float off[12];
|
||||
float fix[8];
|
||||
|
||||
|
||||
if (gl_enable_screen_textures != 2)
|
||||
return;
|
||||
|
||||
// look for power of two that is large enough for the screen
|
||||
while (texsizew < screen_width)
|
||||
texsizew <<= 1;
|
||||
|
||||
while (texsizey < screen_height)
|
||||
texsizey <<= 1;
|
||||
|
||||
xfix = 1/((float)(texsizew)/((float)((screen_width))));
|
||||
yfix = 1/((float)(texsizey)/((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;
|
||||
@@ -3384,7 +3411,7 @@ void GL_SetPaletteLookup(UINT8 *lut)
|
||||
{
|
||||
internalFormat = GL_R8;
|
||||
}
|
||||
|
||||
|
||||
if (!paletteLookupTex)
|
||||
pglGenTextures(1, &paletteLookupTex);
|
||||
pglActiveTexture(GL_TEXTURE1);
|
||||
@@ -3433,7 +3460,7 @@ void GL_ClearLightTables(void)
|
||||
}
|
||||
|
||||
LightTablesTail = NULL;
|
||||
|
||||
|
||||
// we no longer have a bound light table (if we had one), we just deleted it!
|
||||
lt_downloaded = 0;
|
||||
}
|
||||
|
||||
@@ -103,8 +103,6 @@ extern PFNglGetString pglGetString;
|
||||
#endif
|
||||
|
||||
#ifdef USE_FBO_OGL
|
||||
void GL_Framebuffer_DeleteAttachments(void);
|
||||
|
||||
void GL_Framebuffer_Unbind(void);
|
||||
void GL_Framebuffer_Enable(void);
|
||||
void GL_Framebuffer_Disable(void);
|
||||
@@ -136,7 +134,6 @@ extern boolean supportMipMap;
|
||||
/** \brief OpenGL flags for video driver
|
||||
*/
|
||||
extern INT32 oglflags;
|
||||
extern GLint textureformatGL;
|
||||
|
||||
extern GLfloat projMatrix[16];
|
||||
|
||||
|
||||
+112
-106
@@ -169,7 +169,7 @@ char french_shiftxform[] =
|
||||
31,
|
||||
' ','$', //shift-!
|
||||
'3', //shift-"
|
||||
'#', '$', '%',
|
||||
'#', '$', '%',
|
||||
'1', //shift-&
|
||||
'4', // shift-'
|
||||
'5', // shift-(
|
||||
@@ -179,7 +179,7 @@ char french_shiftxform[] =
|
||||
'6', // shift--
|
||||
'.', '/',
|
||||
'0', '1', '2', '3', '4', '5',
|
||||
'6', '7', '8', '9',
|
||||
'6', '7', '8', '9',
|
||||
'/', // shitf-:
|
||||
'.', // shift-;
|
||||
'>', // shift-<
|
||||
@@ -222,7 +222,7 @@ char french_altgrxform[] =
|
||||
'|', //altg--
|
||||
'.', '/',
|
||||
'0', '1', '2', '3', '4', '5',
|
||||
'6', '7', '8', '9',
|
||||
'6', '7', '8', '9',
|
||||
':', ';', '<',
|
||||
'}', //altgr-=
|
||||
'>', '?', '@',
|
||||
@@ -259,8 +259,6 @@ INT32 HU_FallBackFrSpecialLetter(INT32 key)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
static char cechotext[1024];
|
||||
static tic_t cechotimer = 0;
|
||||
static tic_t cechoduration = 5*TICRATE;
|
||||
@@ -914,12 +912,9 @@ static void Got_Saycmd(UINT8 **p, INT32 playernum)
|
||||
player_names[playernum]);
|
||||
if (server)
|
||||
{
|
||||
UINT8 buf[2];
|
||||
|
||||
buf[0] = (UINT8)playernum;
|
||||
buf[1] = KICK_MSG_CON_FAIL;
|
||||
SendNetXCmd(XD_KICK, &buf, 2);
|
||||
SendKick(playernum, KICK_MSG_CON_FAIL);
|
||||
}
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -934,11 +929,7 @@ static void Got_Saycmd(UINT8 **p, INT32 playernum)
|
||||
CONS_Alert(CONS_WARNING, M_GetText("Illegal say command received from %s containing invalid characters\n"), player_names[playernum]);
|
||||
if (server)
|
||||
{
|
||||
char buf[2];
|
||||
|
||||
buf[0] = (char)playernum;
|
||||
buf[1] = KICK_MSG_CON_FAIL;
|
||||
SendNetXCmd(XD_KICK, &buf, 2);
|
||||
SendKick(playernum, KICK_MSG_CON_FAIL);
|
||||
}
|
||||
return;
|
||||
}
|
||||
@@ -1147,10 +1138,10 @@ void HU_Ticker(void)
|
||||
}
|
||||
|
||||
if (cechotimer > 0) --cechotimer;
|
||||
|
||||
|
||||
// Animate the desynch dots
|
||||
if (hu_resynching
|
||||
#ifdef SATURNSYNCH
|
||||
#ifdef SATURNPAK
|
||||
|| hu_redownloadinggamestate
|
||||
#endif
|
||||
)
|
||||
@@ -1322,7 +1313,7 @@ boolean HU_Responder(event_t *ev)
|
||||
INT32 i;
|
||||
for (i = 0; i < num_gamecontrols; i++)
|
||||
{
|
||||
if (gamecontrol[i][0] == ev->data1 || gamecontrol[i][1] == ev->data1)
|
||||
if (gamecontrol[0][i][0] == ev->data1 || gamecontrol[0][i][1] == ev->data1)
|
||||
break;
|
||||
}
|
||||
|
||||
@@ -1334,7 +1325,7 @@ boolean HU_Responder(event_t *ev)
|
||||
if (!chat_on)
|
||||
{
|
||||
// enter chat mode
|
||||
if ((ev->data1 == gamecontrol[gc_talkkey][0] || ev->data1 == gamecontrol[gc_talkkey][1])
|
||||
if ((ev->data1 == gamecontrol[0][gc_talkkey][0] || ev->data1 == gamecontrol[0][gc_talkkey][1])
|
||||
&& netgame && !OLD_MUTE) // check for old chat mute, still let the players open the chat incase they want to scroll otherwise.
|
||||
{
|
||||
chat_on = true;
|
||||
@@ -1345,7 +1336,7 @@ boolean HU_Responder(event_t *ev)
|
||||
typelines = 1;
|
||||
return true;
|
||||
}
|
||||
if ((ev->data1 == gamecontrol[gc_teamkey][0] || ev->data1 == gamecontrol[gc_teamkey][1])
|
||||
if ((ev->data1 == gamecontrol[0][gc_teamkey][0] || ev->data1 == gamecontrol[0][gc_teamkey][1])
|
||||
&& netgame && !OLD_MUTE)
|
||||
{
|
||||
chat_on = true;
|
||||
@@ -1371,8 +1362,8 @@ boolean HU_Responder(event_t *ev)
|
||||
|
||||
// Ignore non-keyboard keys, except when the talk key is bound
|
||||
if (ev->data1 >= KEY_MOUSE1
|
||||
&& (ev->data1 != gamecontrol[gc_talkkey][0]
|
||||
&& ev->data1 != gamecontrol[gc_talkkey][1]))
|
||||
&& (ev->data1 != gamecontrol[0][gc_talkkey][0]
|
||||
&& ev->data1 != gamecontrol[0][gc_talkkey][1]))
|
||||
return false;
|
||||
|
||||
M_TextInputHandle(&w_chat, c);
|
||||
@@ -1384,8 +1375,8 @@ boolean HU_Responder(event_t *ev)
|
||||
HU_SendChatMessage();
|
||||
}
|
||||
else if (c == KEY_ESCAPE
|
||||
|| ((c == gamecontrol[gc_talkkey][0] || c == gamecontrol[gc_talkkey][1]
|
||||
|| c == gamecontrol[gc_teamkey][0] || c == gamecontrol[gc_teamkey][1])
|
||||
|| ((c == gamecontrol[0][gc_talkkey][0] || c == gamecontrol[0][gc_talkkey][1]
|
||||
|| c == gamecontrol[0][gc_teamkey][0] || c == gamecontrol[0][gc_teamkey][1])
|
||||
&& c >= KEY_MOUSE1)) // If it's not a keyboard key, then the chat button is used as a toggle.
|
||||
{
|
||||
chat_on = false;
|
||||
@@ -1868,7 +1859,8 @@ static void HU_DrawChat(void)
|
||||
if (strnicmp(w_chat_buf, "/pm", 3) == 0 && vid.width >= 400 && !teamtalk) // 320x200 unsupported kthxbai
|
||||
{
|
||||
INT32 count = 0;
|
||||
INT32 p_dispy = chaty - charheight -1;
|
||||
INT32 p_dispy = chaty - charheight - 1;
|
||||
size_t longest_name_length = 0;
|
||||
#ifdef NETSPLITSCREEN
|
||||
if (splitscreen)
|
||||
{
|
||||
@@ -1880,27 +1872,33 @@ static void HU_DrawChat(void)
|
||||
#endif
|
||||
p_dispy -= (cv_kartspeedometer.value ? 16 : 0);
|
||||
|
||||
i = 0;
|
||||
for(i=0; (i<MAXPLAYERS); i++)
|
||||
// Find longest player name, for drawing background for /pm list later
|
||||
for (i = 0; i < MAXPLAYERS; i++)
|
||||
{
|
||||
if (!playeringame[i]) continue;
|
||||
|
||||
longest_name_length = max(longest_name_length, strlen(player_names[i]));
|
||||
}
|
||||
|
||||
for(i = 0; i < MAXPLAYERS; i++)
|
||||
{
|
||||
if (!playeringame[i])
|
||||
continue;
|
||||
|
||||
// filter: (code needs optimization pls help I'm bad with C)
|
||||
if (w_chat_buf[3])
|
||||
{
|
||||
char *nodenum;
|
||||
char nodenum[3];
|
||||
UINT32 n;
|
||||
// right, that's half important: (w_chat_buf[4] may be a space since /pm0 msg is perfectly acceptable!)
|
||||
if ( ( ((w_chat_buf[3] != 0) && ((w_chat_buf[3] < '0') || (w_chat_buf[3] > '9'))) || ((w_chat_buf[4] != 0) && (((w_chat_buf[4] < '0') || (w_chat_buf[4] > '9'))))) && (w_chat_buf[4] != ' '))
|
||||
if (!isdigit(w_chat_buf[3]) || !(isdigit(w_chat_buf[4]) || (w_chat_buf[4] == ' ') || (w_chat_buf[4] == 0)))
|
||||
break;
|
||||
|
||||
|
||||
nodenum = (char*) malloc(3);
|
||||
memcpy(nodenum, w_chat_buf+3, 2);
|
||||
nodenum[2] = '\0';
|
||||
n = atoi((const char*) nodenum); // turn that into a number
|
||||
free(nodenum);
|
||||
// special cases:
|
||||
n = atoi(nodenum); // turn that into a number
|
||||
|
||||
// special cases:
|
||||
if ((n == 0) && !(w_chat_buf[4] == '0'))
|
||||
{
|
||||
if (!(i<10))
|
||||
@@ -1928,23 +1926,20 @@ static void HU_DrawChat(void)
|
||||
}
|
||||
}
|
||||
|
||||
if (playeringame[i])
|
||||
{
|
||||
char name[MAXPLAYERNAME+1];
|
||||
strlcpy(name, player_names[i], 7); // shorten name to 7 characters.
|
||||
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.
|
||||
V_DrawSmallString(chatx+ boxw + 4, p_dispy- (6*count), V_SNAPTOBOTTOM|V_SNAPTOLEFT|V_ALLOWLOWERCASE, va("\x82%d\x80 - %s", i, name));
|
||||
count++;
|
||||
}
|
||||
// fill it like the chat so the text doesn't become hard to read because of the hud.
|
||||
V_DrawFillConsoleMap(chatx + boxw + 2, p_dispy - (6*count), (longest_name_length+4)*4, 6, 239 | V_SNAPTOBOTTOM | V_SNAPTOLEFT);
|
||||
|
||||
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.
|
||||
V_DrawSmallString(chatx+boxw+4, p_dispy- (6*count), V_SNAPTOBOTTOM|V_SNAPTOLEFT|V_ALLOWLOWERCASE, "NO RESULT.");
|
||||
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.
|
||||
V_DrawSmallString(chatx + boxw + 4, p_dispy - (6*count), V_SNAPTOBOTTOM|V_SNAPTOLEFT|V_ALLOWLOWERCASE, "NO RESULT.");
|
||||
}
|
||||
}
|
||||
|
||||
HU_drawChatLog(typelines-1); // typelines is the # of lines we're typing. If there's more than 1 then the log should scroll up to give us more space.
|
||||
HU_drawChatLog(typelines - 1); // typelines is the # of lines we're typing. If there's more than 1 then the log should scroll up to give us more space.
|
||||
}
|
||||
|
||||
|
||||
@@ -1956,17 +1951,11 @@ static void HU_DrawChat_Old(void)
|
||||
const char *ntalk = "Say: ", *ttalk = "Say-Team: ";
|
||||
const char *talk = ntalk;
|
||||
size_t select_start = 0, select_end = 0;
|
||||
INT32 charwidth = 8 * con_scalefactor; //SHORT(hu_font['A'-HU_FONTSTART]->width) * con_scalefactor;
|
||||
INT32 charheight = 8 * con_scalefactor; //SHORT(hu_font['A'-HU_FONTSTART]->height) * con_scalefactor;
|
||||
INT32 charwidth = 8 * con_scalefactor; //hu_font['A'-HU_FONTSTART]->width * con_scalefactor;
|
||||
INT32 charheight = 8 * con_scalefactor; //hu_font['A'-HU_FONTSTART]->height * con_scalefactor;
|
||||
if (teamtalk)
|
||||
{
|
||||
talk = ttalk;
|
||||
#if 0
|
||||
if (players[consoleplayer].ctfteam == 1)
|
||||
t = 0x500; // Red
|
||||
else if (players[consoleplayer].ctfteam == 2)
|
||||
t = 0x400; // Blue
|
||||
#endif
|
||||
}
|
||||
|
||||
while (talk[i])
|
||||
@@ -1978,7 +1967,7 @@ static void HU_DrawChat_Old(void)
|
||||
}
|
||||
else
|
||||
{
|
||||
//charwidth = SHORT(hu_font[talk[i]-HU_FONTSTART]->width) * con_scalefactor;
|
||||
//charwidth = hu_font[talk[i]-HU_FONTSTART]->width * con_scalefactor;
|
||||
V_DrawCharacter(HU_INPUTX + c, y, talk[i++] | cv_constextsize.value | V_NOSCALESTART, !cv_allcaps.value);
|
||||
}
|
||||
c += charwidth;
|
||||
@@ -2006,7 +1995,7 @@ static void HU_DrawChat_Old(void)
|
||||
//Hurdler: isn't it better like that?
|
||||
if (w_chat_buf[i] >= HU_FONTSTART)
|
||||
{
|
||||
//charwidth = SHORT(hu_font[w_chat[i]-HU_FONTSTART]->width) * con_scalefactor;
|
||||
//charwidth = hu_font[w_chat[i]-HU_FONTSTART]->width * con_scalefactor;
|
||||
V_DrawCharacter(HU_INPUTX + c, y, w_chat_buf[i] | cv_constextsize.value | V_NOSCALESTART | t, !cv_allcaps.value);
|
||||
}
|
||||
|
||||
@@ -2212,6 +2201,10 @@ void HU_Drawer(void)
|
||||
if (cechotimer)
|
||||
HU_DrawCEcho();
|
||||
|
||||
// draw song credits
|
||||
if (cv_songcredits.value)
|
||||
HU_DrawSongCredits();
|
||||
|
||||
if (!( Playing() || demo.playback )
|
||||
|| gamestate == GS_INTERMISSION || gamestate == GS_CUTSCENE
|
||||
|| gamestate == GS_CREDITS || gamestate == GS_EVALUATION
|
||||
@@ -2245,13 +2238,9 @@ void HU_Drawer(void)
|
||||
if (gamestate != GS_LEVEL)
|
||||
return;
|
||||
|
||||
// draw song credits
|
||||
if (cv_songcredits.value)
|
||||
HU_DrawSongCredits();
|
||||
|
||||
// draw desynch text
|
||||
if (hu_resynching
|
||||
#ifdef SATURNSYNCH
|
||||
#ifdef SATURNPAK
|
||||
|| hu_redownloadinggamestate
|
||||
#endif
|
||||
)
|
||||
@@ -2357,7 +2346,7 @@ Ping_gfx_num (int lag)
|
||||
}
|
||||
|
||||
static int
|
||||
Ping_gfx_color (int lag)
|
||||
Ping_gfx_color (UINT32 lag)
|
||||
{
|
||||
if (lag < 2)
|
||||
return SKINCOLOR_JAWZ;
|
||||
@@ -2367,8 +2356,17 @@ Ping_gfx_color (int lag)
|
||||
return SKINCOLOR_GOLD;
|
||||
else if (lag < 10)
|
||||
return SKINCOLOR_RED;
|
||||
else if (lag < servermaxping)
|
||||
{
|
||||
if (hu_tick & 2)
|
||||
return SKINCOLOR_GREEN;
|
||||
else if (hu_tick & 4)
|
||||
return SKINCOLOR_YELLOW;
|
||||
else
|
||||
return SKINCOLOR_BLUEBERRY;
|
||||
}
|
||||
else
|
||||
return SKINCOLOR_WHITE; // SKINCOLOR_MAGENTA
|
||||
return SKINCOLOR_WHITE; // to make the flashing work
|
||||
}
|
||||
|
||||
static const UINT8 *
|
||||
@@ -2432,7 +2430,7 @@ void HU_drawPlayerPing(INT32 x, INT32 y, INT32 pnum, INT32 flags)
|
||||
|
||||
if (measureid == 1)
|
||||
V_DrawScaledPatch(x+11 - pingmeasure[measureid]->width, y+9, flags, pingmeasure[measureid]);
|
||||
|
||||
|
||||
if (cv_pingicon.value)
|
||||
V_DrawScaledPatch(x+2, y, flags, pinggfx[gfxnum]);
|
||||
|
||||
@@ -2561,24 +2559,19 @@ static inline void HU_DrawSpectatorTicker(void)
|
||||
|
||||
if (cv_showspecstuff.value)
|
||||
{
|
||||
if (players[i].mo)
|
||||
player_t *player;
|
||||
player = &players[i];
|
||||
|
||||
if (player->mo && player->mo->color)
|
||||
{
|
||||
player_t *p;
|
||||
p = &players[i];
|
||||
const UINT8 *colormap = R_GetTranslationColormap(player->skin, player->mo->color, GTC_CACHE);
|
||||
if (player->mo->colorized)
|
||||
colormap = R_GetTranslationColormap(TC_RAINBOW, player->mo->color, GTC_CACHE);
|
||||
|
||||
if (players[i].mo->color)
|
||||
{
|
||||
const UINT8 *colormap;
|
||||
if (players[i].mo->colorized)
|
||||
colormap = R_GetTranslationColormap(TC_RAINBOW, players[i].mo->color, GTC_CACHE);
|
||||
else
|
||||
colormap = R_GetTranslationColormap(players[i].skin, players[i].mo->color, GTC_CACHE);
|
||||
|
||||
if (cv_highresportrait.value)
|
||||
V_DrawSmallMappedPatch((templength - duptweak), height+10, V_TRANSLUCENT, R_GetSkinFaceWant(p), colormap);
|
||||
else
|
||||
V_DrawMappedPatch((templength - duptweak), height+10, V_TRANSLUCENT, R_GetSkinFaceRank(p), colormap);
|
||||
}
|
||||
if (K_UseHighResPortraits())
|
||||
V_DrawSmallMappedPatch((templength - duptweak), height+10, V_TRANSLUCENT, R_GetSkinFaceWant(player), colormap);
|
||||
else
|
||||
V_DrawMappedPatch((templength - duptweak), height+10, V_TRANSLUCENT, R_GetSkinFaceRank(player), colormap);
|
||||
}
|
||||
|
||||
if ((netgame && i != serverplayer) || (cv_mindelay.value && P_IsLocalPlayer(&players[i])))
|
||||
@@ -2593,7 +2586,6 @@ static inline void HU_DrawSpectatorTicker(void)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
//
|
||||
// HU_DrawRankings
|
||||
//
|
||||
@@ -2603,7 +2595,6 @@ static void HU_DrawRankings(void)
|
||||
playersort_t tab[MAXPLAYERS];
|
||||
INT32 i, j, scorelines, hilicol, numplayersingame = 0;
|
||||
boolean completed[MAXPLAYERS];
|
||||
UINT32 whiteplayer = MAXPLAYERS;
|
||||
|
||||
if (!automapactive)
|
||||
V_DrawFadeScreen(0xFF00, 16); // A little more readable, and prevents cheating the fades under other circumstances.
|
||||
@@ -2615,20 +2606,25 @@ static void HU_DrawRankings(void)
|
||||
else
|
||||
hilicol = ((gametype == GT_RACE) ? V_SKYMAP : V_REDMAP);
|
||||
|
||||
// draw the current gametype in the lower right
|
||||
//if (modeattacking)
|
||||
//V_DrawString(4, 188, hilicol|V_SNAPTOBOTTOM|V_SNAPTOLEFT, "Record Attack");
|
||||
//else
|
||||
//V_DrawString(4, 188, hilicol|V_SNAPTOBOTTOM|V_SNAPTOLEFT, gametype_cons_t[gametype].strvalue);
|
||||
|
||||
// draw the current map in the lower right if theres none just say its unknown
|
||||
char *maptitle = G_BuildMapTitle(gamemap);
|
||||
if (!maptitle)
|
||||
V_DrawString(4, 188, hilicol|V_SNAPTOBOTTOM|V_SNAPTOLEFT, "UNKNOWN");
|
||||
if (!demo.playback)
|
||||
{
|
||||
// draw the current map in the lower right
|
||||
char *maptitle = G_BuildMapTitle(gamemap);
|
||||
|
||||
if (maptitle)
|
||||
{
|
||||
V_DrawString(4, 188, hilicol|V_SNAPTOBOTTOM|V_SNAPTOLEFT, maptitle);
|
||||
Z_Free(maptitle);
|
||||
}
|
||||
else
|
||||
{
|
||||
V_DrawString(4, 188, hilicol|V_SNAPTOBOTTOM|V_SNAPTOLEFT, "UNKNOWN");
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
V_DrawString(4, 188, hilicol|V_SNAPTOBOTTOM|V_SNAPTOLEFT, maptitle);
|
||||
Z_Free(maptitle);
|
||||
// draw the current gametype in the lower right
|
||||
V_DrawString(4, 188, hilicol|V_SNAPTOBOTTOM|V_SNAPTOLEFT, (modeattacking) ? "Record Attack" : gametype_cons_t[gametype].strvalue);
|
||||
}
|
||||
|
||||
if (G_GametypeHasTeams())
|
||||
@@ -2638,7 +2634,7 @@ static void HU_DrawRankings(void)
|
||||
else
|
||||
p = bmatcico;
|
||||
|
||||
V_DrawSmallScaledPatch(128 - SHORT(p->width)/4, 4, 0, p);
|
||||
V_DrawSmallScaledPatch(128 - p->width/4, 4, 0, p);
|
||||
V_DrawCenteredString(128, 16, 0, va("%u", bluescore));
|
||||
|
||||
if (gametype == GT_CTF)
|
||||
@@ -2646,7 +2642,7 @@ static void HU_DrawRankings(void)
|
||||
else
|
||||
p = rmatcico;
|
||||
|
||||
V_DrawSmallScaledPatch(192 - SHORT(p->width)/4, 4, 0, p);
|
||||
V_DrawSmallScaledPatch(192 - p->width/4, 4, 0, p);
|
||||
V_DrawCenteredString(192, 16, 0, va("%u", redscore));
|
||||
}
|
||||
|
||||
@@ -2691,11 +2687,6 @@ static void HU_DrawRankings(void)
|
||||
V_DrawCenteredString(256, 16, hilicol, cv_kartspeed.string);
|
||||
}
|
||||
|
||||
// When you play, you quickly see your score because your name is displayed in white.
|
||||
// When playing back a demo, you quickly see who's the view.
|
||||
if (!splitscreen)
|
||||
whiteplayer = demo.playback ? displayplayers[0] : consoleplayer;
|
||||
|
||||
scorelines = 0;
|
||||
memset(completed, 0, sizeof (completed));
|
||||
memset(tab, 0, sizeof (playersort_t)*MAXPLAYERS);
|
||||
@@ -2751,7 +2742,7 @@ static void HU_DrawRankings(void)
|
||||
#endif
|
||||
}
|
||||
|
||||
HU_DrawTabRankings(((scorelines > 8) ? 32 : 40), 33, tab, scorelines, whiteplayer, hilicol);
|
||||
HU_DrawTabRankings(((scorelines > 8) ? 32 : 40), 33, tab, scorelines, hilicol);
|
||||
|
||||
// draw spectators in a ticker across the bottom
|
||||
if (netgame && G_GametypeHasSpectators())
|
||||
@@ -2778,16 +2769,31 @@ void HU_SetCEchoFlags(INT32 flags)
|
||||
|
||||
void HU_DoCEcho(const char *msg)
|
||||
{
|
||||
if (!cv_cechotoggle.value)
|
||||
return
|
||||
|
||||
I_OutputMsg("%s\n", msg); // print to log
|
||||
|
||||
#pragma GCC diagnostic push
|
||||
#pragma GCC diagnostic ignored "-Wstringop-truncation" // This is fine, we set null byte later
|
||||
strncpy(cechotext, msg, sizeof(cechotext));
|
||||
#pragma GCC diagnostic pop
|
||||
strncat(cechotext, "\\", sizeof(cechotext) - strlen(cechotext) - 1);
|
||||
cechotext[sizeof(cechotext) - 1] = '\0';
|
||||
|
||||
// just print it to console
|
||||
if (cv_cechotoggle.value == 2)
|
||||
{
|
||||
char temp[1024];
|
||||
strncpy(temp, cechotext, sizeof(temp));
|
||||
|
||||
for (char *p = temp; *p != '\0'; ++p)
|
||||
if (*p == '\\')
|
||||
*p = '\n';
|
||||
|
||||
CONS_Printf("%s\n", temp);
|
||||
return;
|
||||
}
|
||||
|
||||
I_OutputMsg("%s\n", msg); // print to log
|
||||
|
||||
if (!cv_cechotoggle.value)
|
||||
return;
|
||||
|
||||
cechotimer = cechoduration;
|
||||
}
|
||||
+1
-1
@@ -122,7 +122,7 @@ void HU_clearChatChars(void);
|
||||
void HU_drawPlayerPing(INT32 x, INT32 y, INT32 pnum, INT32 flags); // Lat': Ping drawer for scoreboard.
|
||||
//void HU_DrawTeamTabRankings(playersort_t *tab, INT32 whiteplayer);
|
||||
//void HU_DrawDualTabRankings(INT32 x, INT32 y, playersort_t *tab, INT32 scorelines, INT32 whiteplayer);
|
||||
void HU_DrawTabRankings(INT32 x, INT32 y, playersort_t *tab, INT32 scorelines, INT32 whiteplayer, INT32 hilicol);
|
||||
void HU_DrawTabRankings(INT32 x, INT32 y, playersort_t *tab, INT32 scorelines, INT32 hilicol);
|
||||
void HU_DrawEmeralds(INT32 x, INT32 y, INT32 pemeralds);
|
||||
const char *HU_SkinColorToConsoleColor(skincolors_t color);
|
||||
|
||||
|
||||
+19
@@ -41,17 +41,36 @@ extern INT16 hardware_MAXPACKETLENGTH;
|
||||
|
||||
typedef struct
|
||||
{
|
||||
/// Supposed to be DOOMCOM_ID
|
||||
INT32 id;
|
||||
|
||||
/// SRB2 executes an INT32 to execute commands.
|
||||
INT16 intnum;
|
||||
/// Communication between SRB2 and the driver.
|
||||
/// Is CMD_SEND or CMD_GET.
|
||||
INT16 command;
|
||||
/// Is dest for send, set by get (-1 = no packet).
|
||||
INT16 remotenode;
|
||||
|
||||
/// Number of bytes in doomdata to be sent
|
||||
INT16 datalength;
|
||||
|
||||
/// Info common to all nodes.
|
||||
/// Console is always node 0.
|
||||
INT16 numnodes;
|
||||
/// Flag: 1 = no duplication, 2-5 = dup for slow nets.
|
||||
INT16 ticdup;
|
||||
/// Flag: 1 = send a backup tic in every packet.
|
||||
INT16 extratics;
|
||||
/// kind of game
|
||||
INT16 gametype;
|
||||
/// Flag: -1 = new game, 0-5 = load savegame
|
||||
INT16 savegame;
|
||||
/// currect map
|
||||
INT16 map;
|
||||
|
||||
/// Info specific to this node.
|
||||
INT16 consoleplayer;
|
||||
/// Number of "slots": the highest player number in use plus one.
|
||||
INT16 numslots;
|
||||
|
||||
|
||||
@@ -112,77 +112,6 @@ ticcmd_t *I_BaseTiccmd4(void);
|
||||
*/
|
||||
void I_Quit(void) FUNCNORETURN;
|
||||
|
||||
typedef enum
|
||||
{
|
||||
EvilForce = -1,
|
||||
//Constant
|
||||
ConstantForce = 0,
|
||||
//Ramp
|
||||
RampForce,
|
||||
//Periodics
|
||||
SquareForce,
|
||||
SineForce,
|
||||
TriangleForce,
|
||||
SawtoothUpForce,
|
||||
SawtoothDownForce,
|
||||
//MAX
|
||||
NumberofForces,
|
||||
} FFType;
|
||||
|
||||
typedef struct JoyFF_s
|
||||
{
|
||||
INT32 ForceX; ///< The X of the Force's Vel
|
||||
INT32 ForceY; ///< The Y of the Force's Vel
|
||||
//All
|
||||
UINT32 Duration; ///< The total duration of the effect, in microseconds
|
||||
INT32 Gain; //< /The gain to be applied to the effect, in the range from 0 through 10,000.
|
||||
//All, CONSTANTFORCE -10,000 to 10,000
|
||||
INT32 Magnitude; ///< Magnitude of the effect, in the range from 0 through 10,000.
|
||||
//RAMPFORCE
|
||||
INT32 Start; ///< Magnitude at the start of the effect, in the range from -10,000 through 10,000.
|
||||
INT32 End; ///< Magnitude at the end of the effect, in the range from -10,000 through 10,000.
|
||||
//PERIODIC
|
||||
INT32 Offset; ///< Offset of the effect.
|
||||
UINT32 Phase; ///< Position in the cycle of the periodic effect at which playback begins, in the range from 0 through 35,999
|
||||
UINT32 Period; ///< Period of the effect, in microseconds.
|
||||
} JoyFF_t;
|
||||
|
||||
/** \brief Forcefeedback for the first joystick
|
||||
|
||||
\param Type what kind of Effect
|
||||
\param Effect Effect Info
|
||||
|
||||
\return void
|
||||
*/
|
||||
|
||||
void I_Tactile(FFType Type, const JoyFF_t *Effect);
|
||||
|
||||
/** \brief Forcefeedback for the second joystick
|
||||
|
||||
\param Type what kind of Effect
|
||||
\param Effect Effect Info
|
||||
|
||||
\return void
|
||||
*/
|
||||
void I_Tactile2(FFType Type, const JoyFF_t *Effect);
|
||||
|
||||
/** \brief Forcefeedback for the third joystick
|
||||
|
||||
\param Type what kind of Effect
|
||||
\param Effect Effect Info
|
||||
|
||||
\return void
|
||||
*/
|
||||
void I_Tactile3(FFType Type, const JoyFF_t *Effect);
|
||||
|
||||
/** \brief Forcefeedback for the fourth joystick
|
||||
|
||||
\param Type what kind of Effect
|
||||
\param Effect Effect Info
|
||||
|
||||
\return void
|
||||
*/
|
||||
void I_Tactile4(FFType Type, const JoyFF_t *Effect);
|
||||
|
||||
/** \brief to set up the first joystick scale
|
||||
*/
|
||||
|
||||
+159
-109
@@ -24,7 +24,7 @@
|
||||
#endif // __OS2__
|
||||
|
||||
#ifndef NO_IPV6
|
||||
#define HAVE_IPV6
|
||||
//#define HAVE_IPV6
|
||||
#endif
|
||||
|
||||
#ifdef _WIN32
|
||||
@@ -49,34 +49,28 @@
|
||||
#ifdef NONET
|
||||
#undef HAVE_MINIUPNPC
|
||||
#else
|
||||
#ifdef USE_WINSOCK1
|
||||
#include <winsock.h>
|
||||
#elif !defined (SCOUW2) && !defined (SCOUW7) && !defined (__OS2__)
|
||||
#ifndef USE_WINSOCK
|
||||
#include <arpa/inet.h>
|
||||
#endif //normal BSD API
|
||||
|
||||
#ifndef USE_WINSOCK
|
||||
#ifdef __APPLE_CC__
|
||||
#ifndef _BSD_SOCKLEN_T_
|
||||
#define _BSD_SOCKLEN_T_
|
||||
#endif //_BSD_SOCKLEN_T_
|
||||
#endif //__APPLE_CC__
|
||||
#include <sys/socket.h>
|
||||
#include <netinet/in.h>
|
||||
#endif //normal BSD API
|
||||
|
||||
#ifndef USE_WINSOCK
|
||||
#include <netdb.h>
|
||||
#include <sys/ioctl.h>
|
||||
#endif //normal BSD API
|
||||
|
||||
#include <errno.h>
|
||||
#include <time.h>
|
||||
#ifdef USE_WINSOCK1
|
||||
#include <winsock.h>
|
||||
#else
|
||||
#ifndef USE_WINSOCK
|
||||
#include <arpa/inet.h>
|
||||
#ifdef __APPLE_CC__
|
||||
#ifndef _BSD_SOCKLEN_T_
|
||||
#define _BSD_SOCKLEN_T_
|
||||
#endif //_BSD_SOCKLEN_T_
|
||||
#endif //__APPLE_CC__
|
||||
#include <sys/socket.h>
|
||||
#include <netinet/in.h>
|
||||
#include <netdb.h>
|
||||
#include <sys/ioctl.h>
|
||||
#endif //normal BSD API
|
||||
|
||||
#if defined (__unix__) || defined (__APPLE__) || defined (UNIXCOMMON)
|
||||
#include <sys/time.h>
|
||||
#endif // UNIXCOMMON
|
||||
#include <errno.h>
|
||||
|
||||
#if defined (__unix__) || defined (__APPLE__) || defined (UNIXCOMMON)
|
||||
#include <sys/time.h>
|
||||
#endif // UNIXCOMMON
|
||||
#endif // !NONET
|
||||
|
||||
#ifdef USE_WINSOCK
|
||||
@@ -123,7 +117,7 @@
|
||||
#ifndef STATUS_INVALID_PARAMETER
|
||||
#define STATUS_INVALID_PARAMETER 0xC000000D
|
||||
#endif
|
||||
#endif
|
||||
#endif // USE_WINSOCK
|
||||
|
||||
typedef union
|
||||
{
|
||||
@@ -168,7 +162,6 @@ static UINT8 UPNP_support = TRUE;
|
||||
#endif
|
||||
|
||||
#include "i_addrinfo.h"
|
||||
|
||||
#define DEFAULTPORT "5029"
|
||||
|
||||
#if defined (USE_WINSOCK) && !defined (NONET)
|
||||
@@ -183,6 +176,8 @@ typedef unsigned long SOCKET_TYPE;
|
||||
#define ERRSOCKET (-1)
|
||||
#endif
|
||||
|
||||
#define IPV6_MULTICAST_ADDRESS "ff15::57e1:1a12"
|
||||
|
||||
#ifdef USE_WINSOCK1
|
||||
typedef int socklen_t;
|
||||
#endif
|
||||
@@ -379,6 +374,7 @@ static const char *SOCK_AddrToStr(mysockaddr_t *sk)
|
||||
static char s[64]; // 255.255.255.255:65535 or IPv6:65535
|
||||
#ifdef HAVE_NTOP
|
||||
void *addr;
|
||||
int e = 0; // save error code so it can't be modified later code and avoid calling WSAGetLastError() more then once
|
||||
|
||||
if(sk->any.sa_family == AF_INET)
|
||||
addr = &sk->ip4.sin_addr;
|
||||
@@ -392,7 +388,10 @@ static const char *SOCK_AddrToStr(mysockaddr_t *sk)
|
||||
if(addr == NULL)
|
||||
sprintf(s, "No address");
|
||||
else if(inet_ntop(sk->any.sa_family, addr, s, sizeof (s)) == NULL)
|
||||
sprintf(s, "Unknown family type, error #%u", errno);
|
||||
{
|
||||
e = errno;
|
||||
sprintf(s, "Unknown family type, error #%u: %s", e, strerror(e));
|
||||
}
|
||||
#ifdef HAVE_IPV6
|
||||
else if(sk->any.sa_family == AF_INET6 && sk->ip6.sin6_port != 0)
|
||||
strcat(s, va(":%d", ntohs(sk->ip6.sin6_port)));
|
||||
@@ -593,6 +592,7 @@ void Command_Numnodes(void)
|
||||
#endif
|
||||
|
||||
#ifndef NONET
|
||||
#ifdef HOLEPUNCH
|
||||
/* not one of the reserved "local" addresses */
|
||||
static boolean
|
||||
is_external_address (UINT32 p)
|
||||
@@ -618,7 +618,6 @@ is_external_address (UINT32 p)
|
||||
}
|
||||
}
|
||||
|
||||
#ifdef HOLEPUNCH
|
||||
static boolean hole_punch(ssize_t c)
|
||||
{
|
||||
|
||||
@@ -644,7 +643,7 @@ static boolean hole_punch(ssize_t c)
|
||||
}
|
||||
|
||||
}
|
||||
#endif
|
||||
#endif //ifdef HOLEPUNCH
|
||||
|
||||
// Returns true if a packet was received from a new node, false in all other cases
|
||||
static boolean SOCK_Get(void)
|
||||
@@ -770,11 +769,12 @@ static inline ssize_t SOCK_SendToAddr(SOCKET_TYPE socket, mysockaddr_t *sockaddr
|
||||
return sendto(socket, (char *)&doomcom->data, doomcom->datalength, 0, &sockaddr->any, d);
|
||||
}
|
||||
|
||||
#define ALLOWEDERROR(x) ((x) == ECONNREFUSED || (x) == EWOULDBLOCK || (x) == EHOSTUNREACH || (x) == ENETUNREACH)
|
||||
#define ALLOWEDERROR(x) ((x) == ECONNREFUSED || (x) == EWOULDBLOCK || (x) == EHOSTUNREACH || (x) == ENETUNREACH || (x) == EADDRNOTAVAIL)
|
||||
|
||||
static void SOCK_Send(void)
|
||||
{
|
||||
ssize_t c = ERRSOCKET;
|
||||
int e = 0; // save error code so it can't be modified later code and avoid calling WSAGetLastError() more then once
|
||||
size_t i, j;
|
||||
|
||||
if (!nodeconnected[doomcom->remotenode])
|
||||
@@ -789,12 +789,15 @@ static void SOCK_Send(void)
|
||||
if (myfamily[i] == broadcastaddress[j].any.sa_family)
|
||||
{
|
||||
c = SOCK_SendToAddr(mysockets[i], &broadcastaddress[j]);
|
||||
if (c == ERRSOCKET && !ALLOWEDERROR(errno))
|
||||
break;
|
||||
if (c == ERRSOCKET)
|
||||
{
|
||||
e = errno;
|
||||
if (!ALLOWEDERROR(e))
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
return;
|
||||
}
|
||||
else if (nodesocket[doomcom->remotenode] == (SOCKET_TYPE)ERRSOCKET)
|
||||
{
|
||||
@@ -803,22 +806,28 @@ static void SOCK_Send(void)
|
||||
if (myfamily[i] == clientaddress[doomcom->remotenode].any.sa_family)
|
||||
{
|
||||
c = SOCK_SendToAddr(mysockets[i], &clientaddress[doomcom->remotenode]);
|
||||
if (c == ERRSOCKET && !ALLOWEDERROR(errno))
|
||||
break;
|
||||
if (c == ERRSOCKET)
|
||||
{
|
||||
e = errno;
|
||||
if (!ALLOWEDERROR(e))
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
return;
|
||||
}
|
||||
else
|
||||
{
|
||||
c = SOCK_SendToAddr(nodesocket[doomcom->remotenode], &clientaddress[doomcom->remotenode]);
|
||||
if (c == ERRSOCKET)
|
||||
{
|
||||
e = errno;
|
||||
}
|
||||
}
|
||||
|
||||
if (c == ERRSOCKET)
|
||||
if (c == ERRSOCKET && e != 0) // 0 means no socket for the address family was found
|
||||
{
|
||||
int e = errno; // save error code so it can't be modified later
|
||||
if (!ALLOWEDERROR(e))
|
||||
I_Error("SOCK_Send, error sending to node %d (%s) #%u: %s", doomcom->remotenode,
|
||||
I_Error("SOCK_Send, error sending to node %d (%s) #%u, %s", doomcom->remotenode,
|
||||
SOCK_GetNodeAddress(doomcom->remotenode), e, strerror(e));
|
||||
}
|
||||
}
|
||||
@@ -852,6 +861,8 @@ static SOCKET_TYPE UDP_Bind(int family, struct sockaddr *addr, socklen_t addrlen
|
||||
{
|
||||
SOCKET_TYPE s = socket(family, SOCK_DGRAM, IPPROTO_UDP);
|
||||
int opt;
|
||||
int rc;
|
||||
int e = 0; // save error code so it can't be modified later code and avoid calling WSAGetLastError() more then once
|
||||
socklen_t opts;
|
||||
#ifdef FIONBIO
|
||||
unsigned long trueval = true;
|
||||
@@ -867,12 +878,17 @@ static SOCKET_TYPE UDP_Bind(int family, struct sockaddr *addr, socklen_t addrlen
|
||||
#ifdef USE_WINSOCK2
|
||||
DWORD dwBytesReturned = 0;
|
||||
BOOL bfalse = FALSE;
|
||||
WSAIoctl(s, SIO_UDP_CONNRESET, &bfalse, sizeof(bfalse),
|
||||
rc = WSAIoctl(s, SIO_UDP_CONNRESET, &bfalse, sizeof(bfalse),
|
||||
NULL, 0, &dwBytesReturned, NULL, NULL);
|
||||
#else
|
||||
unsigned long falseval = false;
|
||||
ioctl(s, SIO_UDP_CONNRESET, &falseval);
|
||||
rc = ioctl(s, SIO_UDP_CONNRESET, &falseval);
|
||||
#endif
|
||||
if (rc == -1)
|
||||
{
|
||||
e = errno;
|
||||
I_OutputMsg("SIO_UDP_CONNRESET failed: #%u, %s\n", e, strerror(e));
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
@@ -887,14 +903,22 @@ static SOCKET_TYPE UDP_Bind(int family, struct sockaddr *addr, socklen_t addrlen
|
||||
{
|
||||
opt = true;
|
||||
opts = (socklen_t)sizeof(opt);
|
||||
setsockopt(s, SOL_SOCKET, SO_REUSEADDR, (char *)&opt, opts);
|
||||
rc = setsockopt(s, SOL_SOCKET, SO_REUSEADDR, (char *)&opt, opts);
|
||||
if (rc <= -1)
|
||||
{
|
||||
e = errno;
|
||||
I_OutputMsg("setting SO_REUSEADDR failed: #%u, %s\n", e, strerror(e));
|
||||
}
|
||||
}
|
||||
// make it broadcastable
|
||||
opt = true;
|
||||
opts = (socklen_t)sizeof(opt);
|
||||
if (setsockopt(s, SOL_SOCKET, SO_BROADCAST, (char *)&opt, opts))
|
||||
rc = setsockopt(s, SOL_SOCKET, SO_BROADCAST, (char *)&opt, opts);
|
||||
if (rc <= -1)
|
||||
{
|
||||
e = errno;
|
||||
CONS_Alert(CONS_WARNING, M_GetText("Could not get broadcast rights\n")); // I do not care anymore
|
||||
I_OutputMsg("setting SO_BROADCAST failed: #%u, %s\n", e, strerror(e));
|
||||
}
|
||||
}
|
||||
#ifdef HAVE_IPV6
|
||||
@@ -904,56 +928,117 @@ static SOCKET_TYPE UDP_Bind(int family, struct sockaddr *addr, socklen_t addrlen
|
||||
{
|
||||
opt = true;
|
||||
opts = (socklen_t)sizeof(opt);
|
||||
setsockopt(s, SOL_SOCKET, SO_REUSEADDR, (char *)&opt, opts);
|
||||
rc = setsockopt(s, SOL_SOCKET, SO_REUSEADDR, (char *)&opt, opts);
|
||||
if (rc <= -1)
|
||||
{
|
||||
e = errno;
|
||||
I_OutputMsg("setting SO_REUSEADDR failed: #%u, %s\n", e, strerror(e));
|
||||
}
|
||||
}
|
||||
#ifdef IPV6_V6ONLY
|
||||
// make it IPv6 ony
|
||||
opt = true;
|
||||
opts = (socklen_t)sizeof(opt);
|
||||
if (setsockopt(s, SOL_SOCKET, IPV6_V6ONLY, (char *)&opt, opts))
|
||||
rc = setsockopt(s, SOL_SOCKET, IPV6_V6ONLY, (char *)&opt, opts);
|
||||
if (rc <= -1)
|
||||
{
|
||||
e = errno;
|
||||
CONS_Alert(CONS_WARNING, M_GetText("Could not limit IPv6 bind\n")); // I do not care anymore
|
||||
I_OutputMsg("setting IPV6_V6ONLY failed: #%u, %s\n", e, strerror(e));
|
||||
}
|
||||
#endif
|
||||
}
|
||||
#endif
|
||||
|
||||
if (bind(s, addr, addrlen) == ERRSOCKET)
|
||||
rc = bind(s, addr, addrlen);
|
||||
if (rc == ERRSOCKET)
|
||||
{
|
||||
e = errno;
|
||||
close(s);
|
||||
I_OutputMsg("Binding failed\n");
|
||||
I_OutputMsg("Binding failed: #%u, %s\n", e, strerror(e));
|
||||
return (SOCKET_TYPE)ERRSOCKET;
|
||||
}
|
||||
|
||||
#ifdef HAVE_IPV6
|
||||
if (family == AF_INET6)
|
||||
{
|
||||
// we need to set all of this *after* binding to an address!
|
||||
if (memcmp(&straddr.ip6.sin6_addr, &in6addr_any, sizeof(in6addr_any)) == 0) //IN6_ARE_ADDR_EQUAL
|
||||
{
|
||||
struct ipv6_mreq maddr;
|
||||
|
||||
inet_pton(AF_INET6, IPV6_MULTICAST_ADDRESS, &maddr.ipv6mr_multiaddr);
|
||||
maddr.ipv6mr_interface = 0;
|
||||
rc = setsockopt(s, SOL_SOCKET, IPV6_JOIN_GROUP, (const char *)&maddr, sizeof(maddr));
|
||||
if (rc <= -1)
|
||||
{
|
||||
e = errno;
|
||||
CONS_Alert(CONS_WARNING, M_GetText("Could not register multicast address\n"));
|
||||
if (e == ENODEV)
|
||||
{
|
||||
close(s);
|
||||
I_OutputMsg("Binding failed: no IPv6 device\n");
|
||||
return (SOCKET_TYPE)ERRSOCKET;
|
||||
}
|
||||
I_OutputMsg("setting IPV6_JOIN_GROUP failed: #%u, %s \n", e, strerror(e));
|
||||
}
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
#ifdef FIONBIO
|
||||
// make it non blocking
|
||||
opt = true;
|
||||
if (ioctl(s, FIONBIO, &trueval) != 0)
|
||||
rc = ioctl(s, FIONBIO, &trueval);
|
||||
if (rc == -1)
|
||||
{
|
||||
e = errno;
|
||||
close(s);
|
||||
I_OutputMsg("Seting FIOBIO on failed\n");
|
||||
I_OutputMsg("FIOBIO failed: #%u, %s\n", e, strerror(e));
|
||||
return (SOCKET_TYPE)ERRSOCKET;
|
||||
}
|
||||
#endif
|
||||
|
||||
opt = 0;
|
||||
opts = (socklen_t)sizeof(opt);
|
||||
getsockopt(s, SOL_SOCKET, SO_RCVBUF, (char *)&opt, &opts);
|
||||
rc = getsockopt(s, SOL_SOCKET, SO_RCVBUF, (char *)&opt, &opts);
|
||||
if (rc <= -1)
|
||||
{
|
||||
e = errno;
|
||||
I_OutputMsg("getting SO_RCVBUF failed: #%u, %s\n", e, strerror(e));
|
||||
}
|
||||
CONS_Printf(M_GetText("Network system buffer: %dKb\n"), opt>>10);
|
||||
|
||||
if (opt < 64<<10) // 64k
|
||||
{
|
||||
opt = 64<<10;
|
||||
opts = (socklen_t)sizeof(opt);
|
||||
setsockopt(s, SOL_SOCKET, SO_RCVBUF, (char *)&opt, opts);
|
||||
getsockopt(s, SOL_SOCKET, SO_RCVBUF, (char *)&opt, &opts);
|
||||
rc = setsockopt(s, SOL_SOCKET, SO_RCVBUF, (char *)&opt, opts);
|
||||
if (rc <= -1)
|
||||
{
|
||||
e = errno;
|
||||
I_OutputMsg("setting SO_RCVBUF failed: #%u, %s\n", e, strerror(e));
|
||||
}
|
||||
opt = 0;
|
||||
rc = getsockopt(s, SOL_SOCKET, SO_RCVBUF, (char *)&opt, &opts);
|
||||
if (rc <= -1)
|
||||
{
|
||||
e = errno;
|
||||
I_OutputMsg("getting SO_RCVBUF failed: #%u, %s\n", e, strerror(e));
|
||||
}
|
||||
|
||||
if (opt < 64<<10)
|
||||
CONS_Alert(CONS_WARNING, M_GetText("Can't set buffer length to 64k, file transfer will be bad\n"));
|
||||
else
|
||||
CONS_Printf(M_GetText("Network system buffer set to: %dKb\n"), opt>>10);
|
||||
}
|
||||
|
||||
if (getsockname(s, (struct sockaddr *)&sin, &len) == -1)
|
||||
rc = getsockname(s, (struct sockaddr *)&sin, &len);
|
||||
if (rc != 0)
|
||||
{
|
||||
e = errno;
|
||||
CONS_Alert(CONS_WARNING, M_GetText("Failed to get port number\n"));
|
||||
I_OutputMsg("getsockname failed: #%u, %s\n", e, strerror(e));
|
||||
}
|
||||
else
|
||||
current_port = (UINT16)ntohs(sin.sin_port);
|
||||
|
||||
@@ -1093,65 +1178,28 @@ static boolean UDP_Socket(void)
|
||||
// ip + udp
|
||||
packetheaderlength = 20 + 8; // for stats
|
||||
|
||||
hints.ai_family = AF_INET;
|
||||
gaie = I_getaddrinfo("127.0.0.1", "0", &hints, &ai);
|
||||
if (gaie == 0)
|
||||
{
|
||||
runp = ai;
|
||||
while (runp != NULL && s < MAXNETNODES+1)
|
||||
{
|
||||
memcpy(&clientaddress[s], runp->ai_addr, runp->ai_addrlen);
|
||||
s++;
|
||||
runp = runp->ai_next;
|
||||
}
|
||||
I_freeaddrinfo(ai);
|
||||
}
|
||||
else
|
||||
{
|
||||
clientaddress[s].any.sa_family = AF_INET;
|
||||
clientaddress[s].ip4.sin_port = htons(0);
|
||||
clientaddress[s].ip4.sin_addr.s_addr = htonl(INADDR_LOOPBACK); //GetLocalAddress(); // my own ip
|
||||
s++;
|
||||
}
|
||||
clientaddress[s].any.sa_family = AF_INET;
|
||||
clientaddress[s].ip4.sin_port = htons(0);
|
||||
clientaddress[s].ip4.sin_addr.s_addr = htonl(INADDR_LOOPBACK); //GetLocalAddress(); // my own ip
|
||||
s++;
|
||||
|
||||
s = 0;
|
||||
|
||||
// setup broadcast adress to BROADCASTADDR entry
|
||||
gaie = I_getaddrinfo("255.255.255.255", "0", &hints, &ai);
|
||||
if (gaie == 0)
|
||||
{
|
||||
runp = ai;
|
||||
while (runp != NULL && s < MAXNETNODES+1)
|
||||
{
|
||||
memcpy(&broadcastaddress[s], runp->ai_addr, runp->ai_addrlen);
|
||||
s++;
|
||||
runp = runp->ai_next;
|
||||
}
|
||||
I_freeaddrinfo(ai);
|
||||
}
|
||||
else
|
||||
{
|
||||
broadcastaddress[s].any.sa_family = AF_INET;
|
||||
broadcastaddress[s].ip4.sin_port = htons(0);
|
||||
broadcastaddress[s].ip4.sin_addr.s_addr = htonl(INADDR_BROADCAST);
|
||||
s++;
|
||||
}
|
||||
broadcastaddress[s].any.sa_family = AF_INET;
|
||||
broadcastaddress[s].ip4.sin_port = htons(atoi(DEFAULTPORT));
|
||||
broadcastaddress[s].ip4.sin_addr.s_addr = htonl(INADDR_BROADCAST);
|
||||
s++;
|
||||
|
||||
#ifdef HAVE_IPV6
|
||||
if (b_ipv6)
|
||||
{
|
||||
hints.ai_family = AF_INET6;
|
||||
gaie = I_getaddrinfo("ff02::1", "0", &hints, &ai);
|
||||
if (gaie == 0)
|
||||
{
|
||||
runp = ai;
|
||||
while (runp != NULL && s < MAXNETNODES+1)
|
||||
{
|
||||
memcpy(&broadcastaddress[s], runp->ai_addr, runp->ai_addrlen);
|
||||
s++;
|
||||
runp = runp->ai_next;
|
||||
}
|
||||
I_freeaddrinfo(ai);
|
||||
}
|
||||
broadcastaddress[s].any.sa_family = AF_INET6;
|
||||
broadcastaddress[s].ip6.sin6_port = htons(atoi(DEFAULTPORT));
|
||||
broadcastaddress[s].ip6.sin6_flowinfo = 0;
|
||||
inet_pton(AF_INET6, IPV6_MULTICAST_ADDRESS, &broadcastaddress[s].ip6.sin6_addr);
|
||||
broadcastaddress[s].ip6.sin6_scope_id = 0;
|
||||
s++;
|
||||
}
|
||||
#endif
|
||||
|
||||
@@ -1642,6 +1690,8 @@ boolean I_InitTcpNetwork(void)
|
||||
// FIXME: for dedicated server, numnodes needs to be set to 0 upon start
|
||||
if (dedicated)
|
||||
doomcom->numnodes = 0;
|
||||
/* else if (M_IsNextParm())
|
||||
doomcom->numnodes = (INT16)atoi(M_GetNextParm());*/
|
||||
else
|
||||
doomcom->numnodes = 1;
|
||||
|
||||
|
||||
+2
-2
@@ -58,7 +58,7 @@ void I_UpdateTime(fixed_t timescale)
|
||||
tic_t realtics;
|
||||
|
||||
// get real tics
|
||||
ticratescaled = (double)TICRATE * FIXED_TO_FLOAT(timescale);
|
||||
ticratescaled = (double)TICRATE * FixedToFloat(timescale);
|
||||
|
||||
enterprecise = I_GetPreciseTime();
|
||||
elapsedseconds = (double)((INT64)enterprecise - oldenterprecise) / I_GetPrecisePrecision();
|
||||
@@ -77,6 +77,6 @@ void I_UpdateTime(fixed_t timescale)
|
||||
{
|
||||
double fractional, integral;
|
||||
fractional = modf(tictimer * ticratescaled, &integral);
|
||||
g_time.timefrac = FLOAT_TO_FIXED(fractional);
|
||||
g_time.timefrac = FloatToFixed(fractional);
|
||||
}
|
||||
}
|
||||
+116
-44
@@ -14,12 +14,15 @@
|
||||
#include "doomdef.h"
|
||||
#include "doomstat.h"
|
||||
#include "g_game.h"
|
||||
#include "m_random.h"
|
||||
#include "v_video.h"
|
||||
#include "k_director.h"
|
||||
#include "d_netcmd.h"
|
||||
#include "p_local.h"
|
||||
#include "st_stuff.h"
|
||||
|
||||
#include "r_fps.h"
|
||||
|
||||
#define SWITCHTIME TICRATE * 5 // cooldown between unforced switches
|
||||
#define BOREDOMTIME 3 * TICRATE / 2 // how long until players considered far apart?
|
||||
#define TRANSFERTIME TICRATE // how long to delay reaction shots?
|
||||
@@ -31,6 +34,7 @@ struct directorinfo
|
||||
{
|
||||
player_t* viewplayer;
|
||||
tic_t cooldown; // how long has it been since we last switched?
|
||||
tic_t chaosleep;// how long did we watch the same player?
|
||||
tic_t freeze; // when nonzero, fixed switch pending, freeze logic!
|
||||
INT32 attacker; // who to switch to when freeze delay elapses
|
||||
INT32 maxdist; // how far is the closest player from finishing?
|
||||
@@ -40,6 +44,19 @@ struct directorinfo
|
||||
INT32 boredom[MAXPLAYERS]; // how long has a given position had no credible attackers?
|
||||
} directorinfo;
|
||||
|
||||
static INT32 K_PlayersPlaying(void)
|
||||
{
|
||||
INT32 num = 0, i;
|
||||
for (i = 0; i < MAXPLAYERS; i++)
|
||||
{
|
||||
if (!playeringame[i] || players[i].spectator || !players[i].mo)
|
||||
continue;
|
||||
|
||||
num++;
|
||||
}
|
||||
return num;
|
||||
}
|
||||
|
||||
static inline boolean race_rules(void)
|
||||
{
|
||||
return gametype == GT_RACE;
|
||||
@@ -52,9 +69,9 @@ static fixed_t ScaleFromMap(fixed_t n, fixed_t scale)
|
||||
|
||||
boolean K_DirectorIsAvailable(void)
|
||||
{
|
||||
if (splitscreen || (demo.playback && demo.title) || modeattacking)
|
||||
if (splitscreen || dedicated || (demo.playback && demo.title) || modeattacking)
|
||||
return false;
|
||||
return ((gamestate == GS_LEVEL) && ((demo.playback && !camera[0].freecam) || (players[consoleplayer].spectator && (D_NumPlayers() > 1))));
|
||||
return ((gamestate == GS_LEVEL) && ((demo.playback && !camera[0].freecam) || (players[consoleplayer].spectator && (K_PlayersPlaying() > 1))));
|
||||
}
|
||||
|
||||
static boolean K_DirectorIsEnabled(void)
|
||||
@@ -62,6 +79,48 @@ static boolean K_DirectorIsEnabled(void)
|
||||
return (cv_director.value && K_DirectorIsAvailable());
|
||||
}
|
||||
|
||||
static mobj_t *finishmo = NULL;
|
||||
|
||||
// scan for the waypoint on the finish line
|
||||
// used to get a very approximate distance from player to finishline
|
||||
// we probably should like, do some maths to find the middle point between multiplayer
|
||||
// waypoints with the same values, but idk if its really worth it
|
||||
static void K_SetupFinishMo(void)
|
||||
{
|
||||
INT16 maxMoveCount = -1;
|
||||
INT16 maxAngle = -1;
|
||||
|
||||
finishmo = NULL;
|
||||
|
||||
if (!(mapheaderinfo[gamemap - 1]->levelflags & LF_SECTIONRACE)) // not a sprint map
|
||||
{
|
||||
// waypoint with angle 0 should always be at the finish line
|
||||
for (finishmo = waypointcap; finishmo != NULL; finishmo = finishmo->tracer)
|
||||
{
|
||||
if (finishmo->spawnpoint->angle == 0)
|
||||
break;
|
||||
}
|
||||
}
|
||||
else // crappy optimization weeeee
|
||||
{
|
||||
// sprint maps finishline waypoint is the one with highest movecount AND angle
|
||||
for (finishmo = waypointcap; finishmo != NULL; finishmo = finishmo->tracer)
|
||||
{
|
||||
if (finishmo->movecount > maxMoveCount)
|
||||
maxMoveCount = finishmo->movecount;
|
||||
if (finishmo->spawnpoint->angle > maxAngle)
|
||||
maxAngle = finishmo->spawnpoint->angle;
|
||||
}
|
||||
|
||||
// now actually get the one
|
||||
for (finishmo = waypointcap; finishmo != NULL; finishmo = finishmo->tracer)
|
||||
{
|
||||
if (finishmo->movecount == maxMoveCount && finishmo->spawnpoint->angle == maxAngle)
|
||||
break; // found it
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void K_InitDirector(void)
|
||||
{
|
||||
INT32 playernum;
|
||||
@@ -71,6 +130,7 @@ void K_InitDirector(void)
|
||||
directorinfo.attacker = 0;
|
||||
directorinfo.maxdist = 0;
|
||||
directorinfo.viewplayer = NULL;
|
||||
directorinfo.chaosleep = 0;
|
||||
|
||||
for (playernum = 0; playernum < MAXPLAYERS; playernum++)
|
||||
{
|
||||
@@ -78,50 +138,18 @@ void K_InitDirector(void)
|
||||
directorinfo.gap[playernum] = INT32_MAX;
|
||||
directorinfo.boredom[playernum] = 0;
|
||||
}
|
||||
|
||||
K_SetupFinishMo();
|
||||
}
|
||||
|
||||
static fixed_t K_GetDistanceToFinish(player_t player)
|
||||
{
|
||||
mobj_t *mo;
|
||||
fixed_t dist = 0;
|
||||
INT16 maxMoveCount = -1;
|
||||
INT16 maxAngle = -1;
|
||||
if (P_MobjWasRemoved(finishmo))
|
||||
return 0;
|
||||
|
||||
if (!(mapheaderinfo[gamemap - 1]->levelflags & LF_SECTIONRACE))
|
||||
{
|
||||
for (mo = waypointcap; mo != NULL; mo = mo->tracer)
|
||||
{
|
||||
if (mo->spawnpoint->angle != 0)
|
||||
continue;
|
||||
|
||||
dist = P_AproxDistance(P_AproxDistance(mo->x - player.mo->x,
|
||||
mo->y - player.mo->y),
|
||||
mo->z - player.mo->z) / FRACUNIT;
|
||||
|
||||
break;
|
||||
}
|
||||
}
|
||||
else // crappy optimization weeeee
|
||||
{
|
||||
for (mo = waypointcap; mo != NULL; mo = mo->tracer)
|
||||
{
|
||||
if (mo->movecount > maxMoveCount)
|
||||
maxMoveCount = mo->movecount;
|
||||
if (mo->spawnpoint->angle > maxAngle)
|
||||
maxAngle = mo->spawnpoint->angle;
|
||||
|
||||
if (!(mo->movecount == maxMoveCount && mo->spawnpoint->angle == maxAngle)) // sprint maps finishline waypoint is the one with highest movecount AND angle
|
||||
continue;
|
||||
|
||||
dist = P_AproxDistance(P_AproxDistance(mo->x - player.mo->x,
|
||||
mo->y - player.mo->y),
|
||||
mo->z - player.mo->z) / FRACUNIT;
|
||||
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
return dist;
|
||||
return P_AproxDistance(P_AproxDistance(finishmo->x - player.mo->x,
|
||||
finishmo->y - player.mo->y),
|
||||
finishmo->z - player.mo->z) / FRACUNIT;
|
||||
}
|
||||
|
||||
static fixed_t K_GetFinishGap(INT32 leader, INT32 follower)
|
||||
@@ -145,10 +173,10 @@ static void K_UpdateDirectorPositions(void)
|
||||
INT32 position;
|
||||
player_t* target;
|
||||
|
||||
memset(directorinfo.sortedplayers, -1, sizeof(directorinfo.sortedplayers));
|
||||
|
||||
for (playernum = 0; playernum < MAXPLAYERS; playernum++)
|
||||
{
|
||||
directorinfo.sortedplayers[playernum] = -1;
|
||||
|
||||
target = &players[playernum];
|
||||
|
||||
if (playeringame[playernum] && !target->spectator && target->kartstuff[k_position] > 0)
|
||||
@@ -216,6 +244,7 @@ static void K_DirectorSwitch(INT32 player, boolean force)
|
||||
|
||||
G_ResetView(1, player, true);
|
||||
directorinfo.cooldown = SWITCHTIME;
|
||||
directorinfo.chaosleep = 0;
|
||||
}
|
||||
|
||||
static void K_DirectorForceSwitch(INT32 player, INT32 time)
|
||||
@@ -227,6 +256,26 @@ static void K_DirectorForceSwitch(INT32 player, INT32 time)
|
||||
|
||||
directorinfo.attacker = player;
|
||||
directorinfo.freeze = time;
|
||||
directorinfo.chaosleep = 0;
|
||||
}
|
||||
|
||||
static void K_DirectorSwitchRandom(void)
|
||||
{
|
||||
INT32 randomplayer = -1;
|
||||
|
||||
// kinda dumb but just check if the random player is existing lmao
|
||||
for (INT32 h = 0; h < MAXPLAYERS; h++)
|
||||
{
|
||||
randomplayer = directorinfo.sortedplayers[M_RandomRange(0, K_PlayersPlaying()-1)]; // switch to someone random
|
||||
|
||||
if (randomplayer != -1 && randomplayer != displayplayers[0]) // dont switch to ourselves Zzz...
|
||||
{
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if (randomplayer != -1)
|
||||
K_DirectorSwitch(randomplayer, true);
|
||||
}
|
||||
|
||||
void K_DirectorFollowAttack(player_t *player, mobj_t *inflictor, mobj_t *source)
|
||||
@@ -269,6 +318,7 @@ void K_DrawDirectorDebugger(void)
|
||||
V_DrawThinString(120, 0, V_70TRANS, va("BORED"));
|
||||
V_DrawThinString(150, 0, V_70TRANS, va("COOLDOWN: %d", directorinfo.cooldown));
|
||||
V_DrawThinString(230, 0, V_70TRANS, va("MAXDIST: %d", directorinfo.maxdist));
|
||||
V_DrawThinString(310, 0, V_70TRANS, va("SLEEPTIME: %d", directorinfo.chaosleep));
|
||||
|
||||
for (position = 0; position < MAXPLAYERS - 1; position++)
|
||||
{
|
||||
@@ -315,7 +365,8 @@ void K_UpdateDirector(void)
|
||||
|
||||
K_UpdateDirectorPositions();
|
||||
|
||||
if (directorinfo.cooldown > 0) {
|
||||
if (directorinfo.cooldown > 0)
|
||||
{
|
||||
directorinfo.cooldown--;
|
||||
}
|
||||
|
||||
@@ -337,6 +388,27 @@ void K_UpdateDirector(void)
|
||||
return;
|
||||
}
|
||||
|
||||
// insta switch if the player were watching finishes
|
||||
if (players[displayplayers[0]].exiting)
|
||||
{
|
||||
K_DirectorSwitchRandom();
|
||||
return;
|
||||
}
|
||||
|
||||
// begin counting when cooldown wore off
|
||||
if (!directorinfo.cooldown)
|
||||
{
|
||||
directorinfo.chaosleep++;
|
||||
}
|
||||
|
||||
// force switch 10 seconds after the cooldown has ended
|
||||
// otherwise i fall asleeb zzz...
|
||||
if (directorinfo.chaosleep > TICRATE*10)
|
||||
{
|
||||
K_DirectorSwitchRandom();
|
||||
return;
|
||||
}
|
||||
|
||||
// aaight, time to walk through the standings to find the first interesting pair
|
||||
// NB: targetposition/sortedplayers is 0-indexed, aiming at the "back half" of a given pair by default.
|
||||
// we adjust for this when comparing to player->position or when looking at the leading player, Don't Freak Out
|
||||
|
||||
+1235
-540
File diff suppressed because it is too large.
Load diff
+14
-3
@@ -20,8 +20,10 @@ void K_GenerateKartColormap(UINT8 *dest_colormap, INT32 skinnum, UINT8 color, bo
|
||||
UINT8 K_GetKartColorByName(const char *name);
|
||||
UINT8 K_GetHudColor(void);
|
||||
boolean K_UseColorHud(void);
|
||||
boolean K_UseHighResPortraits(void);
|
||||
|
||||
void K_RegisterKartStuff(void);
|
||||
void K_RegisterServerKartStuff(void);
|
||||
void K_RegisterClientKartStuff(void);
|
||||
|
||||
extern consvar_t cv_coloredspeedlines, cv_coloredsneakertrail;
|
||||
extern consvar_t cv_bananajitter;
|
||||
@@ -39,9 +41,15 @@ extern consvar_t cv_battlespeedo;
|
||||
extern consvar_t cv_multiitemicon;
|
||||
extern consvar_t cv_huditemamount;
|
||||
|
||||
#define NUMSPEEDOSTUFF 6
|
||||
#define NUMSPEEDOSTUFF 8
|
||||
extern CV_PossibleValue_t speedo_cons_t[NUMSPEEDOSTUFF];
|
||||
extern CV_PossibleValue_t driftgaugestyle_cons_t[NUMSPEEDOSTUFF];
|
||||
#define NUMDGAUGESTUFF 6
|
||||
extern CV_PossibleValue_t driftgaugestyle_cons_t[NUMDGAUGESTUFF];
|
||||
#define NUMINPUTDISPLAYSTUFF 5
|
||||
extern CV_PossibleValue_t inputdisplay_cons_t[NUMINPUTDISPLAYSTUFF];
|
||||
#define NUMMINIMAPDOTSTUFF 5
|
||||
extern CV_PossibleValue_t minimapdot_cons_t[NUMMINIMAPDOTSTUFF];
|
||||
|
||||
|
||||
boolean K_IsPlayerLosing(player_t *player);
|
||||
boolean K_IsPlayerWanted(player_t *player);
|
||||
@@ -61,6 +69,8 @@ void K_ExplodePlayer(player_t *player, mobj_t *source, mobj_t *inflictor);
|
||||
void K_StealBumper(player_t *player, player_t *victim, boolean force);
|
||||
void K_SpawnKartExplosion(fixed_t x, fixed_t y, fixed_t z, fixed_t radius, INT32 number, mobjtype_t type, angle_t rotangle, boolean spawncenter, boolean ghostit, mobj_t *source);
|
||||
void K_SpawnMineExplosion(mobj_t *source, UINT8 color);
|
||||
boolean K_CheckSlopeRollDist(mobj_t *mobj);
|
||||
boolean K_ShouldSlopeRoll(mobj_t *mobj);
|
||||
void K_RollMobjBySlopes(mobj_t *mo, pslope_t *slope);
|
||||
void K_SpawnBoostTrail(player_t *player);
|
||||
void K_SpawnSparkleTrail(mobj_t *mo);
|
||||
@@ -118,6 +128,7 @@ typedef struct
|
||||
patch_t *K_getItemBoxPatch(boolean small, boolean dark);
|
||||
patch_t *K_getItemMulPatch(boolean small);
|
||||
void K_getItemBoxDrawinfo(drawinfo_t *out);
|
||||
INT32 K_getMinimapTrans(void);
|
||||
void K_getLapsDrawinfo(drawinfo_t *out);
|
||||
void K_getMinimapDrawinfo(drawinfo_t *out);
|
||||
|
||||
|
||||
+214
@@ -0,0 +1,214 @@
|
||||
#include "k_stats.h"
|
||||
#include "doomstat.h"
|
||||
#include "g_game.h"
|
||||
#include "byteptr.h"
|
||||
#include "z_zone.h"
|
||||
|
||||
kartstats_t kartstats = {0};
|
||||
|
||||
void K_StatTicker(void)
|
||||
{
|
||||
if (demo.playback)
|
||||
return;
|
||||
|
||||
kartstats.totalplaytime++;
|
||||
|
||||
if (netgame)
|
||||
kartstats.onlineplaytime++;
|
||||
else if (modeattacking)
|
||||
kartstats.raplaytime++;
|
||||
|
||||
if (G_RaceGametype())
|
||||
kartstats.raceplaytime++;
|
||||
else
|
||||
kartstats.battleplaytime++;
|
||||
|
||||
// Should this also track splitscreen players?
|
||||
if (!players[consoleplayer].spectator)
|
||||
{
|
||||
player_t *p = &players[consoleplayer];
|
||||
|
||||
if (p->kartstuff[k_position] == spbplace)
|
||||
kartstats.spbtargettime++;
|
||||
|
||||
if (max(p->kartstuff[k_spinouttimer], p->kartstuff[k_wipeoutslow]) > 0)
|
||||
kartstats.spinouttime++;
|
||||
}
|
||||
}
|
||||
|
||||
void K_StatPlayerHit(player_t *victim, player_t *source)
|
||||
{
|
||||
if (demo.playback)
|
||||
return;
|
||||
|
||||
if (victim == &players[consoleplayer])
|
||||
{
|
||||
if (victim == source)
|
||||
kartstats.selfhits++;
|
||||
}
|
||||
else if (source == &players[consoleplayer])
|
||||
kartstats.hits++;
|
||||
}
|
||||
|
||||
void K_StatPlayerSink(player_t *victim, player_t *source)
|
||||
{
|
||||
if (demo.playback)
|
||||
return;
|
||||
|
||||
if (victim == &players[consoleplayer])
|
||||
kartstats.sinked++;
|
||||
else if (source == &players[consoleplayer])
|
||||
kartstats.sinks++;
|
||||
}
|
||||
|
||||
void K_StatRound(void)
|
||||
{
|
||||
if (demo.playback)
|
||||
return;
|
||||
|
||||
int numplayers = 0;
|
||||
|
||||
for (int i = 0; i < MAXPLAYERS; ++i)
|
||||
{
|
||||
if (playeringame[i] && !players[i].spectator)
|
||||
++numplayers;
|
||||
}
|
||||
|
||||
if (numplayers > 1 && !players[consoleplayer].spectator)
|
||||
{
|
||||
if (players[consoleplayer].kartstuff[k_position] == 1)
|
||||
kartstats.totalwins++;
|
||||
else if (players[consoleplayer].kartstuff[k_position] <= 3) // Should this check if there are more than 3 players in game?
|
||||
kartstats.totalpodium++;
|
||||
}
|
||||
}
|
||||
|
||||
void K_EraseStats(void)
|
||||
{
|
||||
// The only field we want to remember
|
||||
boolean vanilla = kartstats.vanilla;
|
||||
|
||||
if (kartstats.copy)
|
||||
Z_Free(kartstats.copy);
|
||||
|
||||
memset(&kartstats, 0, sizeof(kartstats_t));
|
||||
|
||||
kartstats.vanilla = vanilla;
|
||||
}
|
||||
|
||||
static void K_ReadStatsCustom(savebuffer_t *save)
|
||||
{
|
||||
kartstats.size = READUINT32(save->p);
|
||||
kartstats.version = READUINT32(save->p);
|
||||
|
||||
// So many similar-looking read's... scary...
|
||||
kartstats.raplaytime = READUINT32(save->p);
|
||||
kartstats.onlineplaytime = READUINT32(save->p);
|
||||
kartstats.raceplaytime = READUINT32(save->p);
|
||||
kartstats.battleplaytime = READUINT32(save->p);
|
||||
kartstats.spbtargettime = READUINT32(save->p);
|
||||
kartstats.spinouttime = READUINT32(save->p);
|
||||
kartstats.totalwins = READUINT32(save->p);
|
||||
kartstats.totalpodium = READUINT32(save->p);
|
||||
kartstats.hits = READUINT32(save->p);
|
||||
kartstats.selfhits = READUINT32(save->p);
|
||||
kartstats.sinks = READUINT32(save->p);
|
||||
kartstats.sinked = READUINT32(save->p);
|
||||
kartstats.respawns = READUINT32(save->p);
|
||||
|
||||
// If kartstats gets updated, uncomment this and read next fields after this early return. Do same on next updates,
|
||||
// this way even data is read on different versions, it doesn't get corrupted (as long as fields aren't removed, which shouldn't happen)
|
||||
//if (kartstats.version < 2)
|
||||
// return;
|
||||
//
|
||||
//kartstats.somenewfield = READUINT32(save->p);
|
||||
}
|
||||
|
||||
void K_ReadStats(savebuffer_t *save, boolean vanilla)
|
||||
{
|
||||
// Basically, free old kartstats.copy if needed and memset kartstats with zeros
|
||||
K_EraseStats();
|
||||
|
||||
kartstats.vanilla = vanilla;
|
||||
|
||||
kartstats.totalplaytime = READUINT32(save->p);
|
||||
kartstats.matchesplayed = READUINT32(save->p);
|
||||
|
||||
// Vanilla only has those 2
|
||||
if (vanilla)
|
||||
return;
|
||||
|
||||
// Save where block of custom stats starts
|
||||
UINT8 *customblockstart = save->p;
|
||||
|
||||
K_ReadStatsCustom(save);
|
||||
|
||||
// Make a copy of entire custom stats block, so unread values will still be written back
|
||||
kartstats.copy = Z_Malloc(kartstats.size, PU_STATIC, NULL);
|
||||
memcpy(kartstats.copy, customblockstart, kartstats.size);
|
||||
|
||||
// If there were extra fields we couldn't read, skip them
|
||||
save->p = customblockstart + kartstats.size;
|
||||
}
|
||||
|
||||
static void K_WriteStatsCustom(savebuffer_t *save)
|
||||
{
|
||||
// Update, if needed
|
||||
kartstats.version = max(kartstats.version, KARTSTATSVERSION);
|
||||
|
||||
WRITEUINT32(save->p, kartstats.size); // Note: if we will end up writing more that stored in there, this field in save file would be updated
|
||||
WRITEUINT32(save->p, kartstats.version);
|
||||
|
||||
// Version 1
|
||||
WRITEUINT32(save->p, kartstats.raplaytime);
|
||||
WRITEUINT32(save->p, kartstats.onlineplaytime);
|
||||
WRITEUINT32(save->p, kartstats.raceplaytime);
|
||||
WRITEUINT32(save->p, kartstats.battleplaytime);
|
||||
WRITEUINT32(save->p, kartstats.spbtargettime);
|
||||
WRITEUINT32(save->p, kartstats.spinouttime);
|
||||
WRITEUINT32(save->p, kartstats.totalwins);
|
||||
WRITEUINT32(save->p, kartstats.totalpodium);
|
||||
WRITEUINT32(save->p, kartstats.hits);
|
||||
WRITEUINT32(save->p, kartstats.selfhits);
|
||||
WRITEUINT32(save->p, kartstats.sinks);
|
||||
WRITEUINT32(save->p, kartstats.sinked);
|
||||
WRITEUINT32(save->p, kartstats.respawns);
|
||||
|
||||
// No need for early returns, but please mark each new block of write's with version it corresponds to :3
|
||||
|
||||
// Version 2
|
||||
//WRITEUINT32(save->p, kartstats.somenewfield);
|
||||
}
|
||||
|
||||
void K_WriteStats(savebuffer_t *save, boolean vanilla)
|
||||
{
|
||||
WRITEUINT32(save->p, kartstats.totalplaytime);
|
||||
WRITEUINT32(save->p, kartstats.matchesplayed);
|
||||
|
||||
// Vanilla only has those 2
|
||||
if (vanilla)
|
||||
return;
|
||||
|
||||
// Now need to be careful... We save start of custom stats block
|
||||
UINT8 *customblockstart = save->p;
|
||||
|
||||
// Write everything we know how to write
|
||||
K_WriteStatsCustom(save);
|
||||
|
||||
// Calculate size of data that we wrote
|
||||
UINT32 size = (UINT32)(save->p - customblockstart);
|
||||
|
||||
// Now, if we wrote less data than save originally had, that means our copy that we kept in K_ReadStats
|
||||
// has stats from newer version that we need to append
|
||||
if (size < kartstats.size)
|
||||
{
|
||||
I_Assert(kartstats.copy != NULL); // If kartstats.copy is null, kartstats.size **always** should be 0, this can only happen if we create new save
|
||||
WRITEMEM(save->p, kartstats.copy + size, kartstats.size - size);
|
||||
}
|
||||
else if (size > kartstats.size) // No need to do anything if we wrote exactly same amount...
|
||||
{
|
||||
// ...but, if we wrote more, we need to update size field in header. **It's always located at start of block**
|
||||
// So we can just:
|
||||
WRITEUINT32(customblockstart, size);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,66 @@
|
||||
#ifndef __K_STATS__
|
||||
#define __K_STATS__
|
||||
|
||||
#include "doomtype.h"
|
||||
#include "d_player.h"
|
||||
#include "p_saveg.h"
|
||||
|
||||
#define KARTSTATSVERSION 1
|
||||
|
||||
typedef struct kartstats_s {
|
||||
// Remember if stats we loaded are vanilla ones or not
|
||||
boolean vanilla;
|
||||
|
||||
// Vanilla
|
||||
tic_t totalplaytime;
|
||||
UINT32 matchesplayed;
|
||||
|
||||
// Custom data, fields go in same order as they are written into game save
|
||||
|
||||
// IMPORTANT: size **must be first**, so K_WriteStats can overwrite it (not that we're gonna change order, but just in case)
|
||||
UINT32 size; // Size required for our stats. If older version reads save from newer one, it will just skip unread fields, avoiding reading corrupted values
|
||||
UINT32 version; // Version, so we know which fields we actually can read
|
||||
|
||||
tic_t raplaytime;
|
||||
tic_t onlineplaytime;
|
||||
tic_t raceplaytime;
|
||||
tic_t battleplaytime;
|
||||
tic_t spbtargettime;
|
||||
tic_t spinouttime;
|
||||
UINT32 totalwins; // 1st place
|
||||
UINT32 totalpodium; // 2nd and 3rd place, *but not 1st*
|
||||
UINT32 hits;
|
||||
UINT32 selfhits;
|
||||
UINT32 sinks; // Times hitting *others* by kitchen sink
|
||||
UINT32 sinked; // Times *being hit* by kitchen sink
|
||||
UINT32 respawns;
|
||||
|
||||
UINT8 *copy; // Copy of stats block that has been read from file. In case we're older version that reads newer save, we will keep values that we couldn't read
|
||||
} kartstats_t;
|
||||
|
||||
extern kartstats_t kartstats;
|
||||
|
||||
// Note: All stat-tracking functions check for demo.playback and early return if its true
|
||||
|
||||
// Update global stats such as total play time, etc
|
||||
void K_StatTicker(void);
|
||||
|
||||
// Update hit-related stats (PlayerSpin, PlayerSquish, PlayerExplode)
|
||||
void K_StatPlayerHit(player_t *victim, player_t *source);
|
||||
|
||||
// Separate from stuff above
|
||||
void K_StatPlayerSink(player_t *victim, player_t *source);
|
||||
|
||||
// Update round-related stats (such as matchesplayed, totalwins, etc)
|
||||
void K_StatRound(void);
|
||||
|
||||
void K_EraseStats(void);
|
||||
|
||||
// If vanilla is true, only read vanilla-supported fields. Everything else is initialized to 0
|
||||
void K_ReadStats(savebuffer_t *save, boolean vanilla);
|
||||
|
||||
// Same as above, except it just doesn't write non-vanilla fields if vanilla is true
|
||||
void K_WriteStats(savebuffer_t *save, boolean vanilla);
|
||||
|
||||
|
||||
#endif
|
||||
+6
-6
@@ -25,6 +25,7 @@
|
||||
#include "console.h"
|
||||
#include "k_kart.h" // SRB2Kart
|
||||
#include "d_netcmd.h" // IsPlayerAdmin
|
||||
#include "d_main.h"
|
||||
|
||||
#include "lua_script.h"
|
||||
#include "lua_libs.h"
|
||||
@@ -239,6 +240,7 @@ static int lib_pAproxDistance(lua_State *L)
|
||||
fixed_t dy = luaL_checkfixed(L, 2);
|
||||
//HUDSAFE
|
||||
//LUA_Deprecated(L, "P_AproxDistance", "FixedHypot");
|
||||
LUA_LogDeprecated(L, "P_AproxDistance", "FixedHypot");
|
||||
lua_pushfixed(L, FixedHypot(dx, dy));
|
||||
return 1;
|
||||
}
|
||||
@@ -1039,6 +1041,7 @@ static int lib_pTeleportMove(lua_State *L)
|
||||
if (!thing)
|
||||
return LUA_ErrInvalid(L, "mobj_t");
|
||||
//LUA_Deprecated(L, "P_TeleportMove", "P_SetOrigin\" or \"P_MoveOrigin");
|
||||
LUA_LogDeprecated(L, "P_TeleportMove", "P_SetOrigin\" or \"P_MoveOrigin");
|
||||
lua_pushboolean(L, P_MoveOrigin(thing, x, y, z));
|
||||
LUA_PushUserdata(L, tmthing, META_MOBJ);
|
||||
P_SetTarget(&tmthing, ptmthing);
|
||||
@@ -1393,11 +1396,9 @@ static int lib_pSetMobjStateNF(lua_State *L)
|
||||
static int lib_pDoSuperTransformation(lua_State *L)
|
||||
{
|
||||
player_t *player = *((player_t **)luaL_checkudata(L, 1, META_PLAYER));
|
||||
boolean giverings = lua_optboolean(L, 2);
|
||||
NOHUD
|
||||
if (!player)
|
||||
return LUA_ErrInvalid(L, "player_t");
|
||||
P_DoSuperTransformation(player, giverings);
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -1649,7 +1650,7 @@ static int lib_pGetZAt(lua_State *L)
|
||||
if (!slope)
|
||||
return LUA_ErrInvalid(L, "pslope_t");
|
||||
|
||||
lua_pushfixed(L, P_GetZAt(slope, x, y));
|
||||
lua_pushfixed(L, P_GetSlopeZAt(slope, x, y));
|
||||
return 1;
|
||||
}
|
||||
|
||||
@@ -2449,16 +2450,15 @@ static int lib_gExitLevel(lua_State *L)
|
||||
|
||||
static int lib_gIsSpecialStage(lua_State *L)
|
||||
{
|
||||
INT32 mapnum = luaL_optinteger(L, 1, gamemap);
|
||||
//HUDSAFE
|
||||
lua_pushboolean(L, G_IsSpecialStage(mapnum));
|
||||
lua_pushboolean(L, false);
|
||||
return 1;
|
||||
}
|
||||
|
||||
static int lib_gGametypeUsesLives(lua_State *L)
|
||||
{
|
||||
//HUDSAFE
|
||||
lua_pushboolean(L, G_GametypeUsesLives());
|
||||
lua_pushboolean(L, false);
|
||||
return 1;
|
||||
}
|
||||
|
||||
|
||||
+4
-13
@@ -94,11 +94,7 @@ deny:
|
||||
CONS_Alert(CONS_WARNING, M_GetText("Illegal lua command received from %s\n"), player_names[playernum]);
|
||||
if (server)
|
||||
{
|
||||
UINT8 bufn[2];
|
||||
|
||||
bufn[0] = (UINT8)playernum;
|
||||
bufn[1] = KICK_MSG_CON_FAIL;
|
||||
SendNetXCmd(XD_KICK, &bufn, 2);
|
||||
SendKick(playernum, KICK_MSG_CON_FAIL);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -458,13 +454,10 @@ static int lib_cvRegisterVar(lua_State *L)
|
||||
|
||||
if (!(((cvar->flags & CV_HIDEN)) || (cvar->flags & CV_NOSHOWHELP)) && (cvar->PossibleValue || !(cvar->value == 0 && stricmp(cvar->string, "0"))))
|
||||
{
|
||||
char *temp = NULL;
|
||||
|
||||
if (!category)
|
||||
{
|
||||
temp = strdup(wadfiles[numwadfiles - 1]->filename);
|
||||
nameonly(temp);
|
||||
|
||||
char *temp = wadfiles[numwadfiles - 1]->filename;
|
||||
temp += strlen(temp) - nameonlylength(temp);
|
||||
category = temp;
|
||||
}
|
||||
|
||||
@@ -472,8 +465,6 @@ static int lib_cvRegisterVar(lua_State *L)
|
||||
M_SlotCvarIntoModMenu(cvar, category, menu_name);
|
||||
else
|
||||
M_SlotCvarIntoModMenu(cvar, category, cvar->name);
|
||||
|
||||
free (temp);
|
||||
}
|
||||
|
||||
// return cvar userdata
|
||||
@@ -638,7 +629,7 @@ static int cvar_get(lua_State *L)
|
||||
break;
|
||||
default:
|
||||
if (devparm)
|
||||
return luaL_error(L, LUA_QL("consvar_t") " has no field named " LUA_QS, field);
|
||||
return luaL_error(L, LUA_QL("consvar_t") " has no field named " LUA_QS, lua_tostring(L, 2));
|
||||
else
|
||||
return 0;
|
||||
}
|
||||
|
||||
+1
-1
@@ -8,7 +8,7 @@
|
||||
#define GLIB_DATABASE_MTABLE "metatable" /* Metatable.*/
|
||||
#define GLIB_DATABASE_PROXY "proxy" /* Proxy table for the library that isn't the global table. */
|
||||
|
||||
static inline void lua_glib_push_db(lua_State *L)
|
||||
FUNCINLINE static ATTRINLINE void lua_glib_push_db(lua_State *L)
|
||||
{
|
||||
lua_pushliteral(L, GLIB_DATABASE_GUID);
|
||||
lua_gettable(L, LUA_REGISTRYINDEX);
|
||||
|
||||
+1
-34
@@ -935,40 +935,7 @@ int LUA_HookHurtMsg(player_t *player, mobj_t *inflictor, mobj_t *source)
|
||||
return hook.status;
|
||||
}
|
||||
|
||||
#if 0
|
||||
void LUA_HookNetArchive(lua_CFunction archFunc)
|
||||
{
|
||||
const hook_t * map = &hookIds[HOOK(NetVars)];
|
||||
Hook_State hook;
|
||||
hook.force_mobj = false;
|
||||
/* this is a remarkable case where the stack isn't reset */
|
||||
if (map->numHooks > 0)
|
||||
{
|
||||
// stack: tables
|
||||
I_Assert(lua_gettop(gL) > 0);
|
||||
I_Assert(lua_istable(gL, -1));
|
||||
|
||||
push_error_handler();
|
||||
lua_insert(gL, EINDEX);
|
||||
|
||||
begin_hook_values(&hook);
|
||||
|
||||
// tables becomes an upvalue of archFunc
|
||||
lua_pushvalue(gL, -1);
|
||||
lua_pushcclosure(gL, archFunc, 1);
|
||||
// stack: tables, archFunc
|
||||
|
||||
init_hook_call(&hook, 0, res_none);
|
||||
call_mapped(&hook, map);
|
||||
|
||||
lua_pop(gL, 1); // pop archFunc
|
||||
lua_remove(gL, EINDEX); // pop error handler
|
||||
// stack: tables
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
void LUA_HookNetArchive(lua_CFunction archFunc, savebuffer_t *save) //
|
||||
void LUA_HookNetArchive(lua_CFunction archFunc, savebuffer_t *save)
|
||||
{
|
||||
const hook_t * map = &hookIds[HOOK(NetVars)];
|
||||
Hook_State hook;
|
||||
|
||||
@@ -32,6 +32,7 @@ enum hud {
|
||||
hud_wanted,
|
||||
hud_speedometer,
|
||||
hud_statdisplay,
|
||||
hud_inputdisplay,
|
||||
hud_nametags,
|
||||
hud_driftgauge,
|
||||
hud_freeplay,
|
||||
|
||||
+116
-133
@@ -30,6 +30,10 @@
|
||||
#include "lua_hud.h"
|
||||
#include "lua_hook.h"
|
||||
|
||||
#ifdef ROTSPRITE
|
||||
#include "r_patchrotation.h"
|
||||
#endif
|
||||
|
||||
#define HUDONLY if (!hud_running) return luaL_error(L, "HUD rendering code should not be called outside of rendering hooks!");
|
||||
|
||||
boolean hud_running = false;
|
||||
@@ -61,6 +65,7 @@ static const char *const hud_disable_options[] = {
|
||||
"wanted",
|
||||
"speedometer",
|
||||
"statdisplay",
|
||||
"inputdisplay",
|
||||
"nametags",
|
||||
"driftgauge",
|
||||
"freeplay",
|
||||
@@ -187,7 +192,8 @@ enum hudoffsets {
|
||||
hudoffsets_check,
|
||||
hudoffsets_minimap,
|
||||
hudoffsets_wanted,
|
||||
hudoffsets_statdisplay
|
||||
hudoffsets_statdisplay,
|
||||
hudoffsets_inputdisplay,
|
||||
};
|
||||
|
||||
static const char *const hud_offsets_options[] = {
|
||||
@@ -203,6 +209,7 @@ static const char *const hud_offsets_options[] = {
|
||||
"minimap",
|
||||
"wanted",
|
||||
"statdisplay",
|
||||
"inputdisplay",
|
||||
NULL};
|
||||
|
||||
enum huddrawinfo {
|
||||
@@ -290,9 +297,13 @@ static int patch_get(lua_State *L)
|
||||
patch_t *patch = *((patch_t **)luaL_checkudata(L, 1, META_PATCH));
|
||||
enum patch field = Lua_optoption(L, 2, -1, patch_fields_ref);
|
||||
|
||||
// patches are CURRENTLY always valid, expected to be cached with PU_STATIC
|
||||
// this may change in the future, so patch.valid still exists
|
||||
I_Assert(patch != NULL);
|
||||
if (!patch) {
|
||||
if (field == patch_valid) {
|
||||
lua_pushboolean(L, 0);
|
||||
return 1;
|
||||
}
|
||||
return LUA_ErrInvalid(L, "patch_t");
|
||||
}
|
||||
|
||||
switch (field)
|
||||
{
|
||||
@@ -300,16 +311,16 @@ static int patch_get(lua_State *L)
|
||||
lua_pushboolean(L, patch != NULL);
|
||||
break;
|
||||
case patch_width:
|
||||
lua_pushinteger(L, SHORT(patch->width));
|
||||
lua_pushinteger(L, patch->width);
|
||||
break;
|
||||
case patch_height:
|
||||
lua_pushinteger(L, SHORT(patch->height));
|
||||
lua_pushinteger(L, patch->height);
|
||||
break;
|
||||
case patch_leftoffset:
|
||||
lua_pushinteger(L, SHORT(patch->leftoffset));
|
||||
lua_pushinteger(L, patch->leftoffset);
|
||||
break;
|
||||
case patch_topoffset:
|
||||
lua_pushinteger(L, SHORT(patch->topoffset));
|
||||
lua_pushinteger(L, patch->topoffset);
|
||||
break;
|
||||
}
|
||||
return 1;
|
||||
@@ -393,7 +404,7 @@ static int libd_patchExists(lua_State *L)
|
||||
static int libd_cachePatch(lua_State *L)
|
||||
{
|
||||
HUDONLY
|
||||
LUA_PushUserdata(L, W_CachePatchName(luaL_checkstring(L, 1), PU_STATIC), META_PATCH);
|
||||
LUA_PushUserdata(L, W_CachePatchName(luaL_checkstring(L, 1), PU_PATCH), META_PATCH);
|
||||
return 1;
|
||||
}
|
||||
|
||||
@@ -403,7 +414,7 @@ static int libd_cachePatchRotated(lua_State *L)
|
||||
HUDONLY
|
||||
angle_t rollangle = luaL_checkangle(L, 2);
|
||||
INT32 rot = R_GetRollAngle(rollangle);
|
||||
LUA_PushUserdata(L, W_CachePatchNameRotated(luaL_checkstring(L, 1), rot, PU_STATIC), META_PATCH);
|
||||
LUA_PushUserdata(L, W_CachePatchNameRotated(luaL_checkstring(L, 1), rot, PU_PATCH), META_PATCH);
|
||||
|
||||
return 1;
|
||||
}
|
||||
@@ -513,7 +524,7 @@ static int libd_getSpritePatch(lua_State *L)
|
||||
|
||||
if (rot)
|
||||
{
|
||||
patch_t *rotsprite = Patch_GetRotatedSprite(sprframe, frame, angle, sprframe->flip & (1<<angle), false, sprinfo, rot);
|
||||
patch_t *rotsprite = Patch_GetRotatedSprite(sprframe, frame, angle, sprframe->flip & (1<<angle), sprinfo, rot);
|
||||
LUA_PushUserdata(L, rotsprite, META_PATCH);
|
||||
lua_pushboolean(L, false);
|
||||
lua_pushboolean(L, true);
|
||||
@@ -523,7 +534,7 @@ static int libd_getSpritePatch(lua_State *L)
|
||||
#endif
|
||||
|
||||
// push both the patch and its "flip" value
|
||||
LUA_PushUserdata(L, W_CachePatchNum(sprframe->lumppat[angle], PU_STATIC), META_PATCH);
|
||||
LUA_PushUserdata(L, W_CachePatchNum(sprframe->lumppat[angle], PU_SPRITE), META_PATCH);
|
||||
lua_pushboolean(L, (sprframe->flip & (1<<angle)) != 0);
|
||||
return 2;
|
||||
}
|
||||
@@ -539,6 +550,8 @@ static int libd_draw(lua_State *L)
|
||||
x = luaL_checkinteger(L, 1);
|
||||
y = luaL_checkinteger(L, 2);
|
||||
patch = *((patch_t **)luaL_checkudata(L, 3, META_PATCH));
|
||||
if (!patch)
|
||||
return LUA_ErrInvalid(L, "patch_t");
|
||||
flags = luaL_optinteger(L, 4, 0);
|
||||
if (!lua_isnoneornil(L, 5))
|
||||
colormap = *((UINT8 **)luaL_checkudata(L, 5, META_COLORMAP));
|
||||
@@ -572,6 +585,8 @@ static int libd_drawScaled(lua_State *L)
|
||||
if (scale < 0)
|
||||
return luaL_error(L, "negative scale");
|
||||
patch = *((patch_t **)luaL_checkudata(L, 4, META_PATCH));
|
||||
if (!patch)
|
||||
return LUA_ErrInvalid(L, "patch_t");
|
||||
flags = luaL_optinteger(L, 5, 0);
|
||||
if (!lua_isnoneornil(L, 6))
|
||||
colormap = *((UINT8 **)luaL_checkudata(L, 6, META_COLORMAP));
|
||||
@@ -599,71 +614,16 @@ static int libd_drawOnMinimap(lua_State *L)
|
||||
boolean centered; // the patch is centered and doesn't need readjusting on x/y coordinates.
|
||||
huddrawlist_h list;
|
||||
patch_t *AutomapPic = NULL;
|
||||
|
||||
// base position of the minimap which also takes splits into account:
|
||||
INT32 MM_X, MM_Y;
|
||||
drawinfo_t info;
|
||||
|
||||
// variables used for actually drawing the icon:
|
||||
INT32 splitflags, minimaptrans;
|
||||
fixed_t amnumxpos, amnumypos;
|
||||
fixed_t amxpos, amypos;
|
||||
INT32 mm_x, mm_y;
|
||||
fixed_t patchw, patchh;
|
||||
fixed_t patchw = 0, patchh = 0;
|
||||
|
||||
HUDONLY // only run this function in hud hooks
|
||||
x = luaL_checkinteger(L, 1);
|
||||
y = luaL_checkinteger(L, 2);
|
||||
scale = luaL_checkinteger(L, 3);
|
||||
patch = *((patch_t **)luaL_checkudata(L, 4, META_PATCH));
|
||||
if (!lua_isnoneornil(L, 5))
|
||||
colormap = *((UINT8 **)luaL_checkudata(L, 5, META_COLORMAP));
|
||||
centered = lua_optboolean(L, 6);
|
||||
|
||||
// first, check what position the mmap is supposed to be in (pasted from k_kart.c):
|
||||
MM_X = BASEVIDWIDTH - 50 + cv_mini_xoffset.value; // 270
|
||||
MM_Y = (BASEVIDHEIGHT/2)-16 + cv_mini_yoffset.value; // 84
|
||||
if (splitscreen)
|
||||
{
|
||||
MM_Y = (BASEVIDHEIGHT/2) + cv_mini_yoffset.value;
|
||||
if (splitscreen > 1) // 3P : bottom right
|
||||
{
|
||||
MM_X = (3*BASEVIDWIDTH/4) + cv_mini_xoffset.value;
|
||||
MM_Y = (3*BASEVIDHEIGHT/4) + cv_mini_yoffset.value;
|
||||
|
||||
if (splitscreen > 2) // 4P: centered
|
||||
{
|
||||
MM_X = (BASEVIDWIDTH/2) + cv_mini_xoffset.value;
|
||||
MM_Y = (BASEVIDHEIGHT/2) + cv_mini_yoffset.value;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// splitscreen flags
|
||||
splitflags = (splitscreen == 3 ? 0 : V_SNAPTORIGHT); // flags should only be 0 when it's centered (4p split)
|
||||
|
||||
// translucency:
|
||||
if (timeinmap > 105)
|
||||
{
|
||||
minimaptrans = cv_kartminimap.value;
|
||||
if (timeinmap <= 113)
|
||||
minimaptrans = ((((INT32)timeinmap) - 105)*minimaptrans)/(113-105);
|
||||
if (!minimaptrans)
|
||||
return 0;
|
||||
}
|
||||
else
|
||||
return 0;
|
||||
|
||||
minimaptrans = ((10-minimaptrans)<<FF_TRANSSHIFT);
|
||||
splitflags |= minimaptrans;
|
||||
|
||||
if (!(splitscreen == 2))
|
||||
{
|
||||
splitflags &= ~minimaptrans;
|
||||
splitflags |= V_HUDTRANSHALF;
|
||||
}
|
||||
|
||||
splitflags &= ~V_HUDTRANSHALF;
|
||||
splitflags |= V_HUDTRANS;
|
||||
HUDONLY // only run this function in hud hooks
|
||||
|
||||
// Draw the HUD only when playing in a level.
|
||||
// hu_stuff needs this, unlike st_stuff.
|
||||
@@ -680,29 +640,58 @@ static int libd_drawOnMinimap(lua_State *L)
|
||||
return 0; // no pic, just get outta here
|
||||
}
|
||||
|
||||
minimaptrans = K_getMinimapTrans();
|
||||
|
||||
// Exit early if it wouldn't draw anyway.
|
||||
if (minimaptrans == -1)
|
||||
return 0;
|
||||
|
||||
x = luaL_checkinteger(L, 1);
|
||||
y = luaL_checkinteger(L, 2);
|
||||
scale = luaL_checkinteger(L, 3);
|
||||
patch = *((patch_t **)luaL_checkudata(L, 4, META_PATCH));
|
||||
if (!patch)
|
||||
return LUA_ErrInvalid(L, "patch_t");
|
||||
if (!lua_isnoneornil(L, 5))
|
||||
colormap = *((UINT8 **)luaL_checkudata(L, 5, META_COLORMAP));
|
||||
centered = lua_optboolean(L, 6);
|
||||
|
||||
K_getMinimapDrawinfo(&info);
|
||||
|
||||
splitflags = info.flags;
|
||||
splitflags |= minimaptrans;
|
||||
|
||||
if (!(splitscreen == 2))
|
||||
{
|
||||
splitflags &= ~minimaptrans;
|
||||
splitflags |= V_HUDTRANSHALF;
|
||||
}
|
||||
|
||||
splitflags &= ~V_HUDTRANSHALF;
|
||||
splitflags |= V_HUDTRANS;
|
||||
|
||||
// Handle offsets and stuff.
|
||||
mm_x = MM_X - (SHORT(AutomapPic->width)/2);
|
||||
mm_y = MM_Y - (SHORT(AutomapPic->height)/2);
|
||||
mm_x = info.x - (AutomapPic->width/2);
|
||||
mm_y = info.y - (AutomapPic->height/2);
|
||||
|
||||
// let offsets transfer to the heads, too!
|
||||
if (encoremode)
|
||||
{
|
||||
mm_x += SHORT(AutomapPic->leftoffset);
|
||||
mm_x += AutomapPic->leftoffset;
|
||||
}
|
||||
else
|
||||
{
|
||||
mm_x -= SHORT(AutomapPic->leftoffset);
|
||||
mm_x -= AutomapPic->leftoffset;
|
||||
}
|
||||
|
||||
mm_y -= SHORT(AutomapPic->topoffset);
|
||||
mm_y -= AutomapPic->topoffset;
|
||||
|
||||
// scale patch coords
|
||||
patchw = (SHORT(patch->width) * scale / 2);
|
||||
patchh = (SHORT(patch->height) * scale / 2);
|
||||
|
||||
if (centered)
|
||||
// patch is supposedly already centered, don't butt in.
|
||||
if (!centered)
|
||||
{
|
||||
patchw = patchh = 0; // patch is supposedly already centered, don't butt in.
|
||||
// scale patch coords
|
||||
patchw = (patch->width * scale / 2);
|
||||
patchh = (patch->height * scale / 2);
|
||||
}
|
||||
|
||||
amnumxpos = (FixedMul(x, minimapinfo.zoom) - minimapinfo.offs_x);
|
||||
@@ -713,13 +702,8 @@ static int libd_drawOnMinimap(lua_State *L)
|
||||
amnumxpos = -amnumxpos;
|
||||
}
|
||||
|
||||
amxpos = amnumxpos + ((mm_x + SHORT(AutomapPic->width) / 2)<<FRACBITS) - patchw;
|
||||
amypos = amnumypos + ((mm_y + SHORT(AutomapPic->height) / 2)<<FRACBITS) - patchh;
|
||||
|
||||
// and NOW we can FINALLY DRAW OUR GOD DAMN PATCH :V
|
||||
lua_getfield(L, LUA_REGISTRYINDEX, "HUD_DRAW_LIST");
|
||||
list = (huddrawlist_h) lua_touserdata(L, -1);
|
||||
lua_pop(L, 1);
|
||||
amxpos = amnumxpos + ((mm_x + AutomapPic->width / 2)<<FRACBITS) - patchw;
|
||||
amypos = amnumypos + ((mm_y + AutomapPic->height / 2)<<FRACBITS) - patchh;
|
||||
|
||||
if (cv_minihead.value)
|
||||
{
|
||||
@@ -728,6 +712,11 @@ static int libd_drawOnMinimap(lua_State *L)
|
||||
scale /= 2;
|
||||
}
|
||||
|
||||
// and NOW we can FINALLY DRAW OUR GOD DAMN PATCH :V
|
||||
lua_getfield(L, LUA_REGISTRYINDEX, "HUD_DRAW_LIST");
|
||||
list = (huddrawlist_h) lua_touserdata(L, -1);
|
||||
lua_pop(L, 1);
|
||||
|
||||
if (LUA_HUD_IsDrawListValid(list))
|
||||
{
|
||||
LUA_HUD_AddDrawScaled(list, amxpos, amypos, scale, patch, splitflags, colormap, 0);
|
||||
@@ -758,6 +747,8 @@ static int libd_drawStretched(lua_State *L)
|
||||
if (vscale < 0)
|
||||
return luaL_error(L, "negative vertical scale");
|
||||
patch = *((patch_t **)luaL_checkudata(L, 5, META_PATCH));
|
||||
if (!patch)
|
||||
return LUA_ErrInvalid(L, "patch_t");
|
||||
flags = luaL_optinteger(L, 6, 0);
|
||||
if (!lua_isnoneornil(L, 7))
|
||||
colormap = *((UINT8 **)luaL_checkudata(L, 7, META_COLORMAP));
|
||||
@@ -931,35 +922,37 @@ static int libd_drawString(lua_State *L)
|
||||
if (LUA_HUD_IsDrawListValid(list))
|
||||
LUA_HUD_AddDrawString(list, x, y, str, flags, align);
|
||||
else
|
||||
switch(align)
|
||||
{
|
||||
// hu_font
|
||||
case align_left:
|
||||
V_DrawString(x, y, flags, str);
|
||||
break;
|
||||
case align_center:
|
||||
V_DrawCenteredString(x, y, flags, str);
|
||||
break;
|
||||
case align_right:
|
||||
V_DrawRightAlignedString(x, y, flags, str);
|
||||
break;
|
||||
case align_fixed:
|
||||
V_DrawStringAtFixed(x, y, flags, str);
|
||||
break;
|
||||
// hu_font, 0.5x scale
|
||||
case align_small:
|
||||
V_DrawSmallString(x, y, flags, str);
|
||||
break;
|
||||
case align_smallright:
|
||||
V_DrawRightAlignedSmallString(x, y, flags, str);
|
||||
break;
|
||||
// tny_font
|
||||
case align_thin:
|
||||
V_DrawThinString(x, y, flags, str);
|
||||
break;
|
||||
case align_thinright:
|
||||
V_DrawRightAlignedThinString(x, y, flags, str);
|
||||
break;
|
||||
switch(align)
|
||||
{
|
||||
// hu_font
|
||||
case align_left:
|
||||
V_DrawString(x, y, flags, str);
|
||||
break;
|
||||
case align_center:
|
||||
V_DrawCenteredString(x, y, flags, str);
|
||||
break;
|
||||
case align_right:
|
||||
V_DrawRightAlignedString(x, y, flags, str);
|
||||
break;
|
||||
case align_fixed:
|
||||
V_DrawStringAtFixed(x, y, flags, str);
|
||||
break;
|
||||
// hu_font, 0.5x scale
|
||||
case align_small:
|
||||
V_DrawSmallString(x, y, flags, str);
|
||||
break;
|
||||
case align_smallright:
|
||||
V_DrawRightAlignedSmallString(x, y, flags, str);
|
||||
break;
|
||||
// tny_font
|
||||
case align_thin:
|
||||
V_DrawThinString(x, y, flags, str);
|
||||
break;
|
||||
case align_thinright:
|
||||
V_DrawRightAlignedThinString(x, y, flags, str);
|
||||
break;
|
||||
}
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
@@ -1046,7 +1039,8 @@ static int libd_getColorHudPatch(lua_State *L)
|
||||
UINT8 *colormap = R_GetTranslationColormap(TC_DEFAULT, K_GetHudColor(), GTC_CACHE);
|
||||
boolean small, dark;
|
||||
|
||||
switch (option) {
|
||||
switch (option)
|
||||
{
|
||||
case hudpatch_item:
|
||||
small = lua_optboolean(L, 2);
|
||||
dark = lua_optboolean(L, 3);
|
||||
@@ -1266,15 +1260,10 @@ extern int lib_hudadd(lua_State *L);
|
||||
|
||||
static int lib_hudsetvotebackground(lua_State *L)
|
||||
{
|
||||
memset(VoteScreen.luaPrefix, 0, sizeof(VoteScreen.luaPrefix));
|
||||
|
||||
if (lua_isnoneornil(L, 1))
|
||||
{
|
||||
if (luaVoteScreen)
|
||||
{
|
||||
free(luaVoteScreen);
|
||||
}
|
||||
|
||||
luaVoteScreen = NULL;
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -1285,15 +1274,8 @@ static int lib_hudsetvotebackground(lua_State *L)
|
||||
return luaL_argerror(L, 1, "prefix should 4 characters wide");
|
||||
}
|
||||
|
||||
if (!luaVoteScreen)
|
||||
{
|
||||
luaVoteScreen = (char*)malloc(5);
|
||||
luaVoteScreen[4] = 0;
|
||||
}
|
||||
|
||||
strncpy(luaVoteScreen, prefix, 4);
|
||||
|
||||
strupr(luaVoteScreen);
|
||||
strncpy(VoteScreen.luaPrefix, prefix, 4);
|
||||
strupr(VoteScreen.luaPrefix);
|
||||
|
||||
return 0;
|
||||
}
|
||||
@@ -1318,6 +1300,7 @@ static int lib_hudgetoffsets(lua_State *L)
|
||||
case hudoffsets_minimap: OFS(mini)
|
||||
case hudoffsets_wanted: OFS(want)
|
||||
case hudoffsets_statdisplay: OFS(stat)
|
||||
case hudoffsets_inputdisplay: OFS(wheel)
|
||||
default:
|
||||
return 0; // unreachable
|
||||
}
|
||||
|
||||
@@ -299,6 +299,7 @@ static void CalcFillCoords(drawitem_t *item)
|
||||
else if (!(c & V_SNAPTOLEFT))
|
||||
x += (vid.width - (BASEVIDWIDTH * dupx)) / 2;
|
||||
}
|
||||
|
||||
if (vid.height != BASEVIDHEIGHT * dupy)
|
||||
{
|
||||
// same thing here
|
||||
@@ -307,6 +308,7 @@ static void CalcFillCoords(drawitem_t *item)
|
||||
else if (!(c & V_SNAPTOTOP))
|
||||
y += (vid.height - (BASEVIDHEIGHT * dupy)) / 2;
|
||||
}
|
||||
|
||||
if (c & V_SPLITSCREEN)
|
||||
y += (BASEVIDHEIGHT * dupy)/2;
|
||||
if (c & V_HORZSCREEN)
|
||||
@@ -334,6 +336,7 @@ static UINT64 GetItemId(void)
|
||||
id |= INTERP_LATCH;
|
||||
hud_interplatch = false;
|
||||
}
|
||||
|
||||
if (hud_interpstring)
|
||||
id |= INTERP_STRING;
|
||||
|
||||
@@ -639,18 +642,12 @@ void LUA_HUD_DrawList(huddrawlist_h list)
|
||||
switch (item->type)
|
||||
{
|
||||
case DI_Draw:
|
||||
if (!item->patch || item->patch == NULL)
|
||||
return;
|
||||
V_DrawBlendingFixedPatch(LERPS(x), LERPS(y), FRACUNIT, item->flags, item->patch, item->colormap, item->blend);
|
||||
break;
|
||||
case DI_DrawScaled:
|
||||
if (!item->patch || item->patch == NULL)
|
||||
return;
|
||||
V_DrawBlendingFixedPatch(LERPS(x), LERPS(y), LERP(scale), item->flags, item->patch, item->colormap, item->blend);
|
||||
break;
|
||||
case DI_DrawStretched:
|
||||
if (!item->patch || item->patch == NULL)
|
||||
return;
|
||||
V_DrawStretchyFixedPatch(LERPS(x), LERPS(y), LERP(hscale), LERP(vscale), item->flags, item->patch, item->colormap, item->blend);
|
||||
break;
|
||||
case DI_DrawNum:
|
||||
|
||||
+6
-6
@@ -154,7 +154,7 @@ static int lib_setState(lua_State *L)
|
||||
return luaL_error(L, "Do not alter states in BuildCMD code!");
|
||||
|
||||
// clear the state to start with, in case of missing table elements
|
||||
memset(state,0,sizeof(state_t));
|
||||
memset(state, 0, sizeof(state_t));
|
||||
state->tics = -1;
|
||||
|
||||
lua_pushnil(L);
|
||||
@@ -262,8 +262,8 @@ boolean LUA_CallAction(enum actionnum actionnum, mobj_t *actor)
|
||||
return false; // action not called.
|
||||
|
||||
if (superstack && fasticmp(actionpointers[actionnum].name, superactions[superstack-1])) // the action is calling itself,
|
||||
return false; // let it call the hardcoded function
|
||||
|
||||
return false; // let it call the hardcoded function
|
||||
|
||||
lua_pushcfunction(gL, LUA_GetErrorMessage);
|
||||
|
||||
// grab function by uppercase name.
|
||||
@@ -385,7 +385,7 @@ static int state_get(lua_State *L)
|
||||
default:
|
||||
{
|
||||
if (devparm)
|
||||
return luaL_error(L, LUA_QL("state_t") " has no field named " LUA_QS, field);
|
||||
return luaL_error(L, LUA_QL("state_t") " has no field named " LUA_QS, lua_tostring(L, 2));
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
@@ -462,7 +462,7 @@ static int state_set(lua_State *L)
|
||||
break;
|
||||
|
||||
default:
|
||||
return luaL_error(L, LUA_QL("state_t") " has no field named " LUA_QS, field);
|
||||
return luaL_error(L, LUA_QL("state_t") " has no field named " LUA_QS, lua_tostring(L, 2));
|
||||
}
|
||||
|
||||
return 0;
|
||||
@@ -514,7 +514,7 @@ static int lib_setMobjInfo(lua_State *L)
|
||||
return luaL_error(L, "Do not alter mobjinfo in BuildCMD code!");
|
||||
|
||||
// clear the mobjinfo to start with, in case of missing table elements
|
||||
memset(info,0,sizeof(mobjinfo_t));
|
||||
memset(info, 0, sizeof(mobjinfo_t));
|
||||
info->doomednum = -1; // default to no editor value
|
||||
info->spawnhealth = 1; // avoid 'dead' noclip behaviors
|
||||
|
||||
|
||||
+15
-16
@@ -392,16 +392,16 @@ int mobj_skin_getter(lua_State *L)
|
||||
mobj_t *mo = GETMO();
|
||||
|
||||
if (!mo->skin)
|
||||
return 0;
|
||||
return 0;
|
||||
|
||||
// HUD ONLY!!!!!!!!!!
|
||||
if (hud_running && cv_luaimmersion.value)
|
||||
{
|
||||
lua_pushstring(L, K_GetMobjSkin(mo)->name);
|
||||
}
|
||||
else
|
||||
lua_pushstring(L, ((skin_t *)mo->skin)->name);
|
||||
|
||||
if (hud_running && cv_luaimmersion.value) {
|
||||
if (mo->localskin) // HUD ONLY!!!!!!!!!!
|
||||
lua_pushstring(L, ((skin_t *)mo->localskin)->name);
|
||||
else
|
||||
lua_pushstring(L, ((skin_t *)mo->skin)->name);
|
||||
} else {
|
||||
lua_pushstring(L, ((skin_t *)mo->skin)->name);
|
||||
}
|
||||
return 1;
|
||||
}
|
||||
|
||||
@@ -452,7 +452,7 @@ int mobj_localskin_setter(lua_State *L)
|
||||
strlcpy(skin, luaL_optstring(L, 2, "none"), sizeof skin);
|
||||
strlwr(skin); // all skin names are lowercase
|
||||
|
||||
if (strcasecmp(skin, "none"))
|
||||
if (stricmp(skin, "none"))
|
||||
{
|
||||
// Try localskins
|
||||
for (i = 0; i < numlocalskins; i++)
|
||||
@@ -468,7 +468,7 @@ int mobj_localskin_setter(lua_State *L)
|
||||
// Try other skins
|
||||
for (i = 0; i < numskins; i++)
|
||||
{
|
||||
if (fastcmp(skins[i].name, skin))
|
||||
if (stricmp(skins[i].name, skin) == 0)
|
||||
{
|
||||
mo->localskin = &skins[i];
|
||||
mo->skinlocal = false;
|
||||
@@ -483,7 +483,6 @@ int mobj_localskin_setter(lua_State *L)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -502,12 +501,12 @@ int mobj_color_setter(lua_State *L)
|
||||
int mobj_blendmode_setter(lua_State *L)
|
||||
{
|
||||
mobj_t *mo = GETMO();
|
||||
|
||||
|
||||
INT32 blendmode = (INT32)luaL_checkinteger(L, 2);
|
||||
if (blendmode < 0 || blendmode > AST_OVERLAY)
|
||||
return luaL_error(L, "mobj.blendmode %d out of range (0 - %d).", blendmode, AST_OVERLAY);
|
||||
mo->blendmode = blendmode;
|
||||
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -878,7 +877,7 @@ static int mapthing_get(lua_State *L)
|
||||
break;
|
||||
default:
|
||||
if (devparm)
|
||||
return luaL_error(L, LUA_QL("mapthing_t") " has no field named " LUA_QS, field);
|
||||
return luaL_error(L, LUA_QL("mapthing_t") " has no field named " LUA_QS, lua_tostring(L, 2));
|
||||
else
|
||||
return 0;
|
||||
}
|
||||
@@ -932,7 +931,7 @@ static int mapthing_set(lua_State *L)
|
||||
mt->mobj = *((mobj_t **)luaL_checkudata(L, 3, META_MOBJ));
|
||||
break;
|
||||
default:
|
||||
return luaL_error(L, LUA_QL("mapthing_t") " has no field named " LUA_QS, field);
|
||||
return luaL_error(L, LUA_QL("mapthing_t") " has no field named " LUA_QS, lua_tostring(L, 2));
|
||||
}
|
||||
|
||||
return 0;
|
||||
|
||||
+4
-3
@@ -295,7 +295,7 @@ int player_localskin_getter(lua_State *L)
|
||||
player_t *plr = GETPLAYER();
|
||||
|
||||
if (plr->localskin)
|
||||
lua_pushstring(L, (plr->skinlocal ? localskins : skins)[plr->localskin - 1].name);
|
||||
lua_pushstring(L, K_GetPlayerSkin(plr)->name);
|
||||
else
|
||||
lua_pushnil(L);
|
||||
|
||||
@@ -485,6 +485,7 @@ static int lib_iterateDisplayplayers(lua_State *L)
|
||||
|
||||
if (!players[displayplayers[i]].mo)
|
||||
continue;
|
||||
|
||||
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'!
|
||||
return 2;
|
||||
@@ -706,8 +707,8 @@ static int kartstuff_len(lua_State *L)
|
||||
return 1;
|
||||
}
|
||||
|
||||
#define NOFIELD luaL_error(L, LUA_QL("ticcmd_t") " has no field named " LUA_QS, field)
|
||||
#define NOSET luaL_error(L, LUA_QL("ticcmd_t") " field " LUA_QS " should not be set directly.", field)
|
||||
#define NOFIELD luaL_error(L, LUA_QL("ticcmd_t") " has no field named " LUA_QS, lua_tostring(L, 2))
|
||||
#define NOSET luaL_error(L, LUA_QL("ticcmd_t") " field " LUA_QS " should not be set directly.", lua_tostring(L, 2))
|
||||
|
||||
enum ticcmd_e
|
||||
{
|
||||
|
||||
+5
-3
@@ -696,6 +696,7 @@ static UINT8 ArchiveValue(UINT8 **p, int TABLESINDEX, int myindex)
|
||||
}
|
||||
lua_pop(gL, 1);
|
||||
}
|
||||
|
||||
if (!found)
|
||||
{
|
||||
t++;
|
||||
@@ -860,7 +861,8 @@ static void ArchiveExtVars(UINT8 **p, void *pointer, const char *ptype)
|
||||
int TABLESINDEX;
|
||||
UINT16 i;
|
||||
|
||||
if (!gL) {
|
||||
if (!gL)
|
||||
{
|
||||
if (fastcmp(ptype,"player")) // players must always be included, even if no vars
|
||||
WRITEUINT16(*p, 0);
|
||||
return;
|
||||
@@ -897,8 +899,10 @@ static void ArchiveExtVars(UINT8 **p, void *pointer, const char *ptype)
|
||||
|
||||
if (fastcmp(ptype,"mobj")) // mobjs must write their mobjnum as a header
|
||||
WRITEUINT32(*p, ((mobj_t *)pointer)->mobjnum);
|
||||
|
||||
WRITEUINT16(*p, i);
|
||||
lua_pushnil(gL);
|
||||
|
||||
while (lua_next(gL, -2))
|
||||
{
|
||||
I_Assert(lua_type(gL, -2) == LUA_TSTRING);
|
||||
@@ -1231,7 +1235,6 @@ void LUA_Archive(savebuffer_t *save, boolean network)
|
||||
WRITEUINT32(save->p, UINT32_MAX); // end of mobjs marker, replaces mobjnum.
|
||||
|
||||
LUA_HookNetArchive(NetArchive, save); // call the NetArchive hook in archive mode
|
||||
//LUA_HookNetArchive(NetArchive); // call the NetArchive hook in archive mode
|
||||
}
|
||||
|
||||
ArchiveTables(&save->p);
|
||||
@@ -1272,7 +1275,6 @@ void LUA_UnArchive(savebuffer_t *save, boolean network)
|
||||
} while(mobjnum != UINT32_MAX); // repeat until end of mobjs marker.
|
||||
|
||||
LUA_HookNetArchive(NetUnArchive, save); // call the NetArchive hook in unarchive mode
|
||||
//LUA_HookNetArchive(NetUnArchive); // call the NetArchive hook in unarchive mode
|
||||
}
|
||||
|
||||
UnArchiveTables(&save->p, network);
|
||||
|
||||
+9
-1
@@ -64,7 +64,6 @@ void LUA_CVarChanged(const char *name); // lua_consolelib.c
|
||||
int Lua_optoption(lua_State *L, int narg, int def, int list_ref);
|
||||
int Lua_CreateFieldTable(lua_State *L, const char *const lst[]);
|
||||
void LUA_HookNetArchive(lua_CFunction archFunc, savebuffer_t *save);
|
||||
//void LUA_HookNetArchive(lua_CFunction archFunc);
|
||||
|
||||
// Console wrapper
|
||||
void COM_Lua_f(void);
|
||||
@@ -82,6 +81,15 @@ void COM_Lua_f(void);
|
||||
}\
|
||||
}
|
||||
|
||||
#define LUA_LogDeprecated(L,this_func,use_instead)\
|
||||
{\
|
||||
static UINT8 seen = 0;\
|
||||
if (!seen) {\
|
||||
seen = 1;\
|
||||
CON_LogMessage(va("\"%s\" is deprecated and will be removed.\nUse \"%s\" instead.\n", this_func, use_instead));\
|
||||
}\
|
||||
}
|
||||
|
||||
// Warnings about incorrect function usage.
|
||||
// Shows once, then never again, like deprecation
|
||||
#define LUA_UsageWarning(L, warningmsg)\
|
||||
|
||||
@@ -37,9 +37,8 @@
|
||||
/*
|
||||
* Sacrifice very little compression quality in favour of compression speed.
|
||||
* This gives almost the same compression as the default code, and is
|
||||
* (very roughly) 15% faster. This is the preferable mode of operation.
|
||||
* (very roughly) 15% faster. This is the preferred mode of operation.
|
||||
*/
|
||||
|
||||
#ifndef VERY_FAST
|
||||
# define VERY_FAST 1
|
||||
#endif
|
||||
@@ -48,7 +47,7 @@
|
||||
* Sacrifice some more compression quality in favour of compression speed.
|
||||
* (roughly 1-2% worse compression for large blocks and
|
||||
* 9-10% for small, redundant, blocks and >>20% better speed in both cases)
|
||||
* In INT16: when in need for speed, enable this for binary data,
|
||||
* In short: when in need for speed, enable this for binary data,
|
||||
* possibly disable this for text data.
|
||||
*/
|
||||
#ifndef ULTRA_FAST
|
||||
@@ -80,7 +79,8 @@
|
||||
|
||||
/*
|
||||
* You may choose to pre-set the hash table (might be faster on some
|
||||
* modern cpus and large (>>64k) blocks)
|
||||
* modern cpus and large (>>64k) blocks, and also makes compression
|
||||
* deterministic/repeatable when the configuration otherwise is the same).
|
||||
*/
|
||||
#ifndef INIT_HTAB
|
||||
# define INIT_HTAB 1
|
||||
@@ -88,15 +88,15 @@
|
||||
|
||||
/*
|
||||
* Avoid assigning values to errno variable? for some embedding purposes
|
||||
* (linux kernel for example), this is neccessary. NOTE: this breaks
|
||||
* the documentation in lzf.h.
|
||||
* (linux kernel for example), this is necessary. NOTE: this breaks
|
||||
* the documentation in lzf.h. Avoiding errno has no speed impact.
|
||||
*/
|
||||
#ifndef AVOID_ERRNO
|
||||
# define AVOID_ERRNO 0
|
||||
#endif
|
||||
|
||||
/*
|
||||
* Wether to pass the LZF_STATE variable as argument, or allocate it
|
||||
* Whether to pass the LZF_STATE variable as argument, or allocate it
|
||||
* on the stack. For small-stack environments, define this to 1.
|
||||
* NOTE: this breaks the prototype in lzf.h.
|
||||
*/
|
||||
@@ -105,11 +105,11 @@
|
||||
#endif
|
||||
|
||||
/*
|
||||
* Wether to add extra checks for input validity in lzf_decompress
|
||||
* Whether to add extra checks for input validity in lzf_decompress
|
||||
* and return EINVAL if the input stream has been corrupted. This
|
||||
* only shields against overflowing the input buffer and will not
|
||||
* detect most corrupted streams.
|
||||
* This check is not normally noticable on modern hardware
|
||||
* This check is not normally noticeable on modern hardware
|
||||
* (<1% slowdown), but might slow down older cpus considerably.
|
||||
*/
|
||||
#ifndef CHECK_INPUT
|
||||
|
||||
+3
-5
@@ -98,7 +98,6 @@ static aatree_node_t *M_AATreeSet_Node(aatree_node_t *node, UINT32 flags, INT32
|
||||
if (!node)
|
||||
{
|
||||
// Nothing here, so just add where we are
|
||||
|
||||
node = Z_Malloc(sizeof (aatree_node_t), PU_STATIC, NULL);
|
||||
node->level = 1;
|
||||
node->key = key;
|
||||
@@ -134,11 +133,11 @@ void M_AATreeSet(aatree_t *aatree, INT32 key, void* value)
|
||||
// and nodes with value == NULL.
|
||||
static void *M_AATreeGet_Node(aatree_node_t *node, INT32 key)
|
||||
{
|
||||
if (node)
|
||||
if (LIKELY(node))
|
||||
{
|
||||
if (node->key == key)
|
||||
if (UNLIKELY(node->key == key))
|
||||
return node->value;
|
||||
else if(node->key < key)
|
||||
else if (node->key < key)
|
||||
return M_AATreeGet_Node(node->right, key);
|
||||
else
|
||||
return M_AATreeGet_Node(node->left, key);
|
||||
@@ -152,7 +151,6 @@ void *M_AATreeGet(aatree_t *aatree, INT32 key)
|
||||
return M_AATreeGet_Node(aatree->root, key);
|
||||
}
|
||||
|
||||
|
||||
static void M_AATreeIterate_Node(aatree_node_t *node, aatree_iter_t callback)
|
||||
{
|
||||
if (node->left) M_AATreeIterate_Node(node->left, callback);
|
||||
|
||||
+9
-198
@@ -57,29 +57,11 @@ typedef struct
|
||||
// CHEAT Structures
|
||||
// ==========================================================================
|
||||
|
||||
// Cheat responders
|
||||
/*static UINT8 cheatf_ultimate(void)
|
||||
{
|
||||
if (menuactive && (currentMenu != &MainDef && currentMenu != &SP_LoadDef))
|
||||
return 0; // Only on the main menu, or the save select!
|
||||
|
||||
S_StartSound(0, sfx_itemup);
|
||||
ultimate_selectable = (!ultimate_selectable);
|
||||
|
||||
// If on the save select, move to what is now Ultimate Mode!
|
||||
if (currentMenu == &SP_LoadDef)
|
||||
M_ForceSaveSlotSelected(NOSAVESLOT);
|
||||
return 1;
|
||||
}*/
|
||||
|
||||
static UINT8 cheatf_warp(void)
|
||||
{
|
||||
UINT8 i;
|
||||
boolean success = false;
|
||||
|
||||
/*if (modifiedgame)
|
||||
return 0;*/
|
||||
|
||||
if (menuactive && currentMenu != &MainDef)
|
||||
return 0; // Only on the main menu!
|
||||
|
||||
@@ -134,18 +116,6 @@ static UINT8 cheatf_devmode(void)
|
||||
}
|
||||
#endif
|
||||
|
||||
/*static cheatseq_t cheat_ultimate = {
|
||||
0, cheatf_ultimate,
|
||||
{ SCRAMBLE('u'), SCRAMBLE('l'), SCRAMBLE('t'), SCRAMBLE('i'), SCRAMBLE('m'), SCRAMBLE('a'), SCRAMBLE('t'), SCRAMBLE('e'), 0xff }
|
||||
};*/
|
||||
|
||||
/*static cheatseq_t cheat_ultimate_joy = {
|
||||
0, cheatf_ultimate,
|
||||
{ SCRAMBLE(KEY_UPARROW), SCRAMBLE(KEY_UPARROW), SCRAMBLE(KEY_DOWNARROW), SCRAMBLE(KEY_DOWNARROW),
|
||||
SCRAMBLE(KEY_LEFTARROW), SCRAMBLE(KEY_RIGHTARROW), SCRAMBLE(KEY_LEFTARROW), SCRAMBLE(KEY_RIGHTARROW),
|
||||
SCRAMBLE(KEY_ENTER), 0xff }
|
||||
};*/
|
||||
|
||||
static cheatseq_t cheat_warp = {
|
||||
0, cheatf_warp,
|
||||
//{ SCRAMBLE('r'), SCRAMBLE('e'), SCRAMBLE('d'), SCRAMBLE('x'), SCRAMBLE('v'), SCRAMBLE('i'), 0xff }
|
||||
@@ -376,70 +346,6 @@ void Command_Hurtme_f(void)
|
||||
P_DamageMobj(players[consoleplayer].mo, NULL, NULL, atoi(COM_Argv(1)));
|
||||
}
|
||||
|
||||
// Moves the NiGHTS player to another axis within the current mare
|
||||
/*void Command_JumpToAxis_f(void)
|
||||
{
|
||||
REQUIRE_DEVMODE;
|
||||
REQUIRE_INLEVEL;
|
||||
REQUIRE_SINGLEPLAYER;
|
||||
|
||||
if (COM_Argc() != 2)
|
||||
{
|
||||
CONS_Printf(M_GetText("jumptoaxis <axisnum>: Jump to axis within current mare.\n"));
|
||||
return;
|
||||
}
|
||||
|
||||
P_TransferToAxis(&players[consoleplayer], atoi(COM_Argv(1)));
|
||||
}
|
||||
|
||||
void Command_Charability_f(void)
|
||||
{
|
||||
REQUIRE_DEVMODE;
|
||||
REQUIRE_INLEVEL;
|
||||
REQUIRE_SINGLEPLAYER;
|
||||
|
||||
if (COM_Argc() < 3)
|
||||
{
|
||||
CONS_Printf(M_GetText("charability <1/2> <value>: change character abilities\n"));
|
||||
return;
|
||||
}
|
||||
|
||||
if (atoi(COM_Argv(1)) == 1)
|
||||
players[consoleplayer].charability = (UINT8)atoi(COM_Argv(2));
|
||||
else if (atoi(COM_Argv(1)) == 2)
|
||||
players[consoleplayer].charability2 = (UINT8)atoi(COM_Argv(2));
|
||||
else
|
||||
CONS_Printf(M_GetText("charability <1/2> <value>: change character abilities\n"));
|
||||
}
|
||||
|
||||
void Command_Charspeed_f(void)
|
||||
{
|
||||
REQUIRE_DEVMODE;
|
||||
REQUIRE_INLEVEL;
|
||||
REQUIRE_SINGLEPLAYER;
|
||||
|
||||
if (COM_Argc() < 3)
|
||||
{
|
||||
CONS_Printf(M_GetText("charspeed <normalspeed/runspeed/thrustfactor/accelstart/acceleration/actionspd> <value>: set character speed\n"));
|
||||
return;
|
||||
}
|
||||
|
||||
if (!strcasecmp(COM_Argv(1), "normalspeed"))
|
||||
players[consoleplayer].normalspeed = atoi(COM_Argv(2))<<FRACBITS;
|
||||
else if (!strcasecmp(COM_Argv(1), "runspeed"))
|
||||
players[consoleplayer].runspeed = atoi(COM_Argv(2))<<FRACBITS;
|
||||
else if (!strcasecmp(COM_Argv(1), "thrustfactor"))
|
||||
players[consoleplayer].thrustfactor = atoi(COM_Argv(2));
|
||||
else if (!strcasecmp(COM_Argv(1), "accelstart"))
|
||||
players[consoleplayer].accelstart = atoi(COM_Argv(2));
|
||||
else if (!strcasecmp(COM_Argv(1), "acceleration"))
|
||||
players[consoleplayer].acceleration = atoi(COM_Argv(2));
|
||||
else if (!strcasecmp(COM_Argv(1), "actionspd"))
|
||||
players[consoleplayer].actionspd = atoi(COM_Argv(2))<<FRACBITS;
|
||||
else
|
||||
CONS_Printf(M_GetText("charspeed <normalspeed/runspeed/thrustfactor/accelstart/acceleration/actionspd> <value>: set character speed\n"));
|
||||
}*/
|
||||
|
||||
void Command_RTeleport_f(void)
|
||||
{
|
||||
fixed_t intx, inty, intz;
|
||||
@@ -682,28 +588,6 @@ void Command_Savecheckpoint_f(void)
|
||||
CONS_Printf(M_GetText("Temporary checkpoint created at %d, %d, %d\n"), players[consoleplayer].starpostx, players[consoleplayer].starposty, players[consoleplayer].starpostz);
|
||||
}
|
||||
|
||||
// Like M_GetAllEmeralds() but for console devmode junkies.
|
||||
/*void Command_Getallemeralds_f(void)
|
||||
{
|
||||
REQUIRE_SINGLEPLAYER;
|
||||
REQUIRE_NOULTIMATE;
|
||||
REQUIRE_PANDORA;
|
||||
|
||||
emeralds = ((EMERALD7)*2)-1;
|
||||
|
||||
CONS_Printf(M_GetText("You now have all 7 emeralds.\n"));
|
||||
}
|
||||
|
||||
void Command_Resetemeralds_f(void)
|
||||
{
|
||||
REQUIRE_SINGLEPLAYER;
|
||||
REQUIRE_PANDORA;
|
||||
|
||||
emeralds = 0;
|
||||
|
||||
CONS_Printf(M_GetText("Emeralds reset to zero.\n"));
|
||||
}*/
|
||||
|
||||
void Command_Devmode_f(void)
|
||||
{
|
||||
#ifndef _DEBUG
|
||||
@@ -730,63 +614,6 @@ void Command_Devmode_f(void)
|
||||
G_SetGameModified(multiplayer, true);
|
||||
}
|
||||
|
||||
/*void Command_Setrings_f(void)
|
||||
{
|
||||
REQUIRE_INLEVEL;
|
||||
REQUIRE_SINGLEPLAYER;
|
||||
REQUIRE_NOULTIMATE;
|
||||
REQUIRE_PANDORA;
|
||||
|
||||
if (COM_Argc() > 1)
|
||||
{
|
||||
// P_GivePlayerRings does value clamping
|
||||
players[consoleplayer].health = players[consoleplayer].mo->health = 1;
|
||||
P_GivePlayerRings(&players[consoleplayer], atoi(COM_Argv(1)));
|
||||
if (!G_IsSpecialStage(gamemap) || !useNightsSS)
|
||||
players[consoleplayer].totalring -= atoi(COM_Argv(1)); //undo totalring addition done in P_GivePlayerRings
|
||||
|
||||
G_SetGameModified(multiplayer);
|
||||
}
|
||||
}
|
||||
|
||||
void Command_Setlives_f(void)
|
||||
{
|
||||
REQUIRE_INLEVEL;
|
||||
REQUIRE_SINGLEPLAYER;
|
||||
REQUIRE_NOULTIMATE;
|
||||
REQUIRE_PANDORA;
|
||||
|
||||
if (COM_Argc() > 1)
|
||||
{
|
||||
// P_GivePlayerLives does value clamping
|
||||
players[consoleplayer].lives = 0;
|
||||
P_GivePlayerLives(&players[consoleplayer], atoi(COM_Argv(1)));
|
||||
|
||||
G_SetGameModified(multiplayer);
|
||||
}
|
||||
}
|
||||
|
||||
void Command_Setcontinues_f(void)
|
||||
{
|
||||
REQUIRE_INLEVEL;
|
||||
REQUIRE_SINGLEPLAYER;
|
||||
REQUIRE_NOULTIMATE;
|
||||
REQUIRE_PANDORA;
|
||||
|
||||
if (COM_Argc() > 1)
|
||||
{
|
||||
INT32 numcontinues = atoi(COM_Argv(1));
|
||||
if (numcontinues > 99)
|
||||
numcontinues = 99;
|
||||
else if (numcontinues < 0)
|
||||
numcontinues = 0;
|
||||
|
||||
players[consoleplayer].continues = numcontinues;
|
||||
|
||||
G_SetGameModified(multiplayer);
|
||||
}
|
||||
}*/
|
||||
|
||||
//
|
||||
// OBJECTPLACE (and related variables)
|
||||
//
|
||||
@@ -864,7 +691,7 @@ static boolean OP_HeightOkay(player_t *player, UINT8 ceiling)
|
||||
{
|
||||
// Truncate position to match where mapthing would be when spawned
|
||||
// (this applies to every further P_GetZAt call as well)
|
||||
fixed_t cheight = sec->c_slope ? P_GetZAt(sec->c_slope, player->mo->x & 0xFFFF0000, player->mo->y & 0xFFFF0000) : sec->ceilingheight;
|
||||
fixed_t cheight = P_GetSectorCeilingZAt(sec, (player->mo->x & 0xFFFF0000), (player->mo->y & 0xFFFF0000));
|
||||
|
||||
if (((cheight - player->mo->z - player->mo->height)>>FRACBITS) >= (1 << (16-ZSHIFT)))
|
||||
{
|
||||
@@ -875,7 +702,8 @@ static boolean OP_HeightOkay(player_t *player, UINT8 ceiling)
|
||||
}
|
||||
else
|
||||
{
|
||||
fixed_t fheight = sec->f_slope ? P_GetZAt(sec->f_slope, player->mo->x & 0xFFFF0000, player->mo->y & 0xFFFF0000) : sec->floorheight;
|
||||
fixed_t fheight = P_GetSectorFloorZAt(sec, (player->mo->x & 0xFFFF0000), (player->mo->y & 0xFFFF0000));
|
||||
|
||||
if (((player->mo->z - fheight)>>FRACBITS) >= (1 << (16-ZSHIFT)))
|
||||
{
|
||||
CONS_Printf(M_GetText("Sorry, you're too %s to place this object (max: %d %s).\n"), M_GetText("high"),
|
||||
@@ -922,12 +750,12 @@ static mapthing_t *OP_CreateNewMapThing(player_t *player, UINT16 type, boolean c
|
||||
mt->y = (INT16)(player->mo->y>>FRACBITS);
|
||||
if (ceiling)
|
||||
{
|
||||
fixed_t cheight = sec->c_slope ? P_GetZAt(sec->c_slope, mt->x << FRACBITS, mt->y << FRACBITS) : sec->ceilingheight;
|
||||
fixed_t cheight = P_GetSectorCeilingZAt(sec, (mt->x << FRACBITS), (mt->y << FRACBITS));
|
||||
mt->options = (UINT16)((cheight - player->mo->z - player->mo->height)>>FRACBITS);
|
||||
}
|
||||
else
|
||||
{
|
||||
fixed_t fheight = sec->f_slope ? P_GetZAt(sec->f_slope, mt->x << FRACBITS, mt->y << FRACBITS) : sec->floorheight;
|
||||
fixed_t fheight = P_GetSectorFloorZAt(sec, (mt->x << FRACBITS), (mt->y << FRACBITS));
|
||||
mt->options = (UINT16)((player->mo->z - fheight)>>FRACBITS);
|
||||
}
|
||||
mt->options <<= ZSHIFT;
|
||||
@@ -984,8 +812,7 @@ void OP_NightsObjectplace(player_t *player)
|
||||
UINT16 angle = (UINT16)(player->anotherflyangle % 360);
|
||||
INT16 temp = (INT16)FixedInt(AngleFixed(player->mo->angle)); // Traditional 2D Angle
|
||||
sector_t *sec = player->mo->subsector->sector;
|
||||
fixed_t fheight = sec->f_slope ? P_GetZAt(sec->f_slope, player->mo->x & 0xFFFF0000, player->mo->y & 0xFFFF0000) : sec->floorheight;
|
||||
|
||||
fixed_t fheight = P_GetSectorFloorZAt(sec, (player->mo->x & 0xFFFF0000), (player->mo->y & 0xFFFF0000));
|
||||
|
||||
player->pflags |= PF_ATTACKDOWN;
|
||||
|
||||
@@ -1006,17 +833,6 @@ void OP_NightsObjectplace(player_t *player)
|
||||
P_SpawnHoopsAndRings(mt);
|
||||
}
|
||||
|
||||
// This places a bumper!
|
||||
/*if (cmd->buttons & BT_SPECTATE)
|
||||
{
|
||||
player->pflags |= PF_ATTACKDOWN;
|
||||
if (!OP_HeightOkay(player, false))
|
||||
return;
|
||||
|
||||
mt = OP_CreateNewMapThing(player, (UINT16)mobjinfo[MT_NIGHTSBUMPER].doomednum, false);
|
||||
P_SpawnMapThing(mt);
|
||||
}*/
|
||||
|
||||
// This places a ring!
|
||||
if (cmd->buttons & BT_BACKWARD)
|
||||
{
|
||||
@@ -1141,12 +957,12 @@ void OP_ObjectplaceMovement(player_t *player)
|
||||
|
||||
if (!!(mobjinfo[op_currentthing].flags & MF_SPAWNCEILING) ^ !!(cv_opflags.value & MTF_OBJECTFLIP))
|
||||
{
|
||||
fixed_t cheight = sec->c_slope ? P_GetZAt(sec->c_slope, player->mo->x & 0xFFFF0000, player->mo->y & 0xFFFF0000) : sec->ceilingheight;
|
||||
fixed_t cheight = P_GetSectorCeilingZAt(sec, (player->mo->x & 0xFFFF0000), (player->mo->y & 0xFFFF0000));
|
||||
op_displayflags = (UINT16)((cheight - player->mo->z - mobjinfo[op_currentthing].height)>>FRACBITS);
|
||||
}
|
||||
else
|
||||
{
|
||||
fixed_t fheight = sec->f_slope ? P_GetZAt(sec->f_slope, player->mo->x & 0xFFFF0000, player->mo->y & 0xFFFF0000) : sec->floorheight;
|
||||
fixed_t fheight = P_GetSectorFloorZAt(sec, (player->mo->x & 0xFFFF0000), (player->mo->y & 0xFFFF0000));
|
||||
op_displayflags = (UINT16)((player->mo->z - fheight)>>FRACBITS);
|
||||
}
|
||||
op_displayflags <<= ZSHIFT;
|
||||
@@ -1163,12 +979,7 @@ void OP_ObjectplaceMovement(player_t *player)
|
||||
return;
|
||||
}
|
||||
|
||||
/*if (cmd->buttons & BT_FORWARD)
|
||||
{
|
||||
OP_CycleThings(-1);
|
||||
player->pflags |= PF_ATTACKDOWN;
|
||||
}
|
||||
else*/ if (cmd->buttons & BT_DRIFT)
|
||||
if (cmd->buttons & BT_DRIFT)
|
||||
{
|
||||
OP_CycleThings(1);
|
||||
player->pflags |= PF_ATTACKDOWN;
|
||||
|
||||
+4
-5
@@ -21,6 +21,7 @@
|
||||
#include "r_things.h" // numskins
|
||||
//#include "r_draw.h" // R_GetColorByName
|
||||
#include "k_kart.h" // K_GetKartColorByName
|
||||
#include "k_stats.h"
|
||||
|
||||
// Map triggers for linedef executors
|
||||
// 32 triggers, one bit each
|
||||
@@ -286,9 +287,9 @@ UINT8 M_CheckCondition(condition_t *cn)
|
||||
switch (cn->type)
|
||||
{
|
||||
case UC_PLAYTIME: // Requires total playing time >= x
|
||||
return (totalplaytime >= (unsigned)cn->requirement);
|
||||
return (kartstats.totalplaytime >= (unsigned)cn->requirement);
|
||||
case UC_MATCHESPLAYED: // Requires any level completed >= x times
|
||||
return (matchesplayed >= (unsigned)cn->requirement);
|
||||
return (kartstats.matchesplayed >= (unsigned)cn->requirement);
|
||||
case UC_GAMECLEAR: // Requires game beaten >= x times
|
||||
return (timesBeaten >= (unsigned)cn->requirement);
|
||||
case UC_ALLEMERALDS: // Requires game beaten with all 7 emeralds >= x times
|
||||
@@ -384,9 +385,7 @@ UINT8 M_UpdateUnlockablesAndExtraEmblems(boolean force)
|
||||
INT32 i;
|
||||
char cechoText[992] = "";
|
||||
UINT8 cechoLines = 0;
|
||||
|
||||
if (majormods && !force) // SRB2Kart: for enabling unlocks online in modified servers
|
||||
return false;
|
||||
(void)force;
|
||||
|
||||
M_CheckUnlockConditions();
|
||||
|
||||
|
||||
+795
-624
File diff suppressed because it is too large.
Load diff
@@ -33,6 +33,16 @@ extern boolean forceshowhud;
|
||||
// Does all the real work of the menu interaction.
|
||||
boolean M_Responder(event_t *ev);
|
||||
|
||||
// for scrolling through menus with controllers
|
||||
extern boolean dpadscrollstate[4];
|
||||
enum
|
||||
{
|
||||
DPAD_UP,
|
||||
DPAD_DOWN,
|
||||
DPAD_LEFT,
|
||||
DPAD_RIGHT
|
||||
};
|
||||
|
||||
// Called by main loop, runs for demo playback. If this returns true, nullify any further user input.
|
||||
boolean M_DemoResponder(event_t *ev);
|
||||
|
||||
@@ -298,6 +308,8 @@ void Bird_menu_Onchange(void);
|
||||
// Saturn Hud menu updating
|
||||
void SaturnHud_menu_Onchange(void);
|
||||
|
||||
void GameFocus_menu_Onchange (void);
|
||||
|
||||
#ifdef HWRENDER
|
||||
void M_UpdateOGLMenu(void);
|
||||
#endif
|
||||
|
||||
+32
-25
@@ -443,7 +443,6 @@ char configfile[MAX_WADPATH];
|
||||
// ==========================================================================
|
||||
// CONFIGURATION
|
||||
// ==========================================================================
|
||||
static boolean gameconfig_loaded = false; // true once config.cfg loaded AND executed
|
||||
|
||||
/** Saves a player's config, possibly to a particular file.
|
||||
*
|
||||
@@ -548,10 +547,28 @@ void M_FirstLoadConfig(void)
|
||||
// don't filter anymore vars and don't let this convsvar be changed
|
||||
COM_BufInsertText(va("%s \"%d\"\n", cv_execversion.name, EXECVERSION));
|
||||
CV_ToggleExecVersion(false);
|
||||
}
|
||||
|
||||
// make sure I_Quit() will write back the correct config
|
||||
// (do not write back the config if it crash before)
|
||||
gameconfig_loaded = true;
|
||||
static boolean M_BackupConfig(const char *filename)
|
||||
{
|
||||
char backupfile[MAX_WADPATH+4];
|
||||
|
||||
snprintf(backupfile, sizeof backupfile, "%s.bak", filename);
|
||||
backupfile[sizeof backupfile - 1] = '\0';
|
||||
|
||||
FILE *config = fopen(filename, "r");
|
||||
|
||||
if (config != NULL)
|
||||
{
|
||||
fclose(config);
|
||||
if (FIL_CopyFile(filename, backupfile) == false)
|
||||
{
|
||||
CONS_Alert(CONS_WARNING,"Failed to create a backup of the configuration file. Will not attempt to write to file\n");
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
/** Saves the game configuration.
|
||||
@@ -562,28 +579,11 @@ void M_SaveConfig(const char *filename)
|
||||
{
|
||||
FILE *f;
|
||||
char *filepath;
|
||||
char backupfile[MAX_WADPATH+4];
|
||||
|
||||
// make sure not to write back the config until it's been correctly loaded
|
||||
if (!gameconfig_loaded)
|
||||
if (!loaded_config)
|
||||
return;
|
||||
|
||||
// Create backup of the config file
|
||||
snprintf(backupfile, sizeof backupfile, "%s.bak", configfile);
|
||||
backupfile[sizeof backupfile - 1] = '\0';
|
||||
|
||||
FILE *config = fopen(configfile, "r");
|
||||
|
||||
if (config != NULL)
|
||||
{
|
||||
fclose(config);
|
||||
if (FIL_CopyFile(configfile, backupfile) == false)
|
||||
{
|
||||
CONS_Alert(CONS_WARNING,"Failed to create a backup of the configuration file. Will not attempt to write to file\n");
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
// can change the file name
|
||||
if (filename)
|
||||
{
|
||||
@@ -600,6 +600,10 @@ void M_SaveConfig(const char *filename)
|
||||
else
|
||||
filepath = Z_StrDup(filename);
|
||||
|
||||
// If failed to backup, do not proceed
|
||||
if (!M_BackupConfig(filepath))
|
||||
return;
|
||||
|
||||
f = fopen(filepath, "w");
|
||||
// change it only if valid
|
||||
if (f)
|
||||
@@ -618,6 +622,10 @@ void M_SaveConfig(const char *filename)
|
||||
return;
|
||||
}
|
||||
|
||||
// If failed to backup, do not proceed
|
||||
if (!M_BackupConfig(configfile))
|
||||
return;
|
||||
|
||||
f = fopen(configfile, "w");
|
||||
if (!f)
|
||||
{
|
||||
@@ -1582,9 +1590,9 @@ boolean M_ScreenshotResponder(event_t *ev)
|
||||
if (ch >= KEY_MOUSE1 && menuactive) // If it's not a keyboard key, then don't allow it in the menus!
|
||||
return false;
|
||||
|
||||
if (ch == KEY_F8 || ch == gamecontrol[gc_screenshot][0] || ch == gamecontrol[gc_screenshot][1]) // remappable F8
|
||||
if (ch == KEY_F8 || ch == gamecontrol[0][gc_screenshot][0] || ch == gamecontrol[0][gc_screenshot][1]) // remappable F8
|
||||
M_ScreenShot();
|
||||
else if (ch == KEY_F9 || ch == gamecontrol[gc_recordgif][0] || ch == gamecontrol[gc_recordgif][1]) // remappable F9
|
||||
else if (ch == KEY_F9 || ch == gamecontrol[0][gc_recordgif][0] || ch == gamecontrol[0][gc_recordgif][1]) // remappable F9
|
||||
((moviemode) ? M_StopMovie : M_StartMovie)();
|
||||
else
|
||||
return false;
|
||||
@@ -1668,7 +1676,6 @@ failure:
|
||||
#endif //#ifdef USE_PNG
|
||||
}
|
||||
|
||||
|
||||
// ==========================================================================
|
||||
// TRANSLATION FUNCTIONS
|
||||
// ==========================================================================
|
||||
|
||||
+141
-104
@@ -126,11 +126,11 @@ perfstatrow_t commoncounter_rows[] = {
|
||||
{0}
|
||||
};
|
||||
|
||||
/*perfstatrow_t interpolation_rows[] = {
|
||||
{"intpfrc", "Interp frac: ", &ps_interp_frac, PS_TIME},
|
||||
{"intplag", "Interp lag: ", &ps_interp_lag, PS_TIME},
|
||||
perfstatrow_t interpolation_rows[] = {
|
||||
{"intpfrc", "Interp frac: ", &ps_interp_frac, 0},
|
||||
{"intplag", "Interp lag: ", &ps_interp_lag, 0},
|
||||
{0}
|
||||
};*/
|
||||
};
|
||||
|
||||
#ifdef HWRENDER
|
||||
perfstatrow_t batchcount_rows[] = {
|
||||
@@ -214,6 +214,7 @@ void PS_SetPreThinkFrameHookInfo(int index, precise_t time_taken, char* short_sr
|
||||
// array needs to be initialized
|
||||
prethinkframe_hooks = Z_Calloc(sizeof(ps_hookinfo_t) * prethinkframe_hooks_capacity, PU_STATIC, NULL);
|
||||
}
|
||||
|
||||
if (index >= prethinkframe_hooks_capacity)
|
||||
{
|
||||
// array needs more space, realloc with double size
|
||||
@@ -225,6 +226,7 @@ void PS_SetPreThinkFrameHookInfo(int index, precise_t time_taken, char* short_sr
|
||||
sizeof(ps_hookinfo_t) * prethinkframe_hooks_capacity);
|
||||
prethinkframe_hooks_capacity = new_capacity;
|
||||
}
|
||||
|
||||
prethinkframe_hooks[index].time_taken.value.p = time_taken;
|
||||
memcpy(prethinkframe_hooks[index].short_src, short_src, LUA_IDSIZE * sizeof(char));
|
||||
// since the values are set sequentially from begin to end, the last call should leave
|
||||
@@ -239,6 +241,7 @@ void PS_SetThinkFrameHookInfo(int index, precise_t time_taken, char* short_src)
|
||||
// array needs to be initialized
|
||||
thinkframe_hooks = Z_Calloc(sizeof(ps_hookinfo_t) * thinkframe_hooks_capacity, PU_STATIC, NULL);
|
||||
}
|
||||
|
||||
if (index >= thinkframe_hooks_capacity)
|
||||
{
|
||||
// array needs more space, realloc with double size
|
||||
@@ -250,6 +253,7 @@ void PS_SetThinkFrameHookInfo(int index, precise_t time_taken, char* short_src)
|
||||
sizeof(ps_hookinfo_t) * thinkframe_hooks_capacity);
|
||||
thinkframe_hooks_capacity = new_capacity;
|
||||
}
|
||||
|
||||
thinkframe_hooks[index].time_taken.value.p = time_taken;
|
||||
memcpy(thinkframe_hooks[index].short_src, short_src, LUA_IDSIZE * sizeof(char));
|
||||
// since the values are set sequentially from begin to end, the last call should leave
|
||||
@@ -264,6 +268,7 @@ void PS_SetPostThinkFrameHookInfo(int index, precise_t time_taken, char* short_s
|
||||
// array needs to be initialized
|
||||
postthinkframe_hooks = Z_Calloc(sizeof(ps_hookinfo_t) * postthinkframe_hooks_capacity, PU_STATIC, NULL);
|
||||
}
|
||||
|
||||
if (index >= postthinkframe_hooks_capacity)
|
||||
{
|
||||
// array needs more space, realloc with double size
|
||||
@@ -275,6 +280,7 @@ void PS_SetPostThinkFrameHookInfo(int index, precise_t time_taken, char* short_s
|
||||
sizeof(ps_hookinfo_t) * postthinkframe_hooks_capacity);
|
||||
postthinkframe_hooks_capacity = new_capacity;
|
||||
}
|
||||
|
||||
postthinkframe_hooks[index].time_taken.value.p = time_taken;
|
||||
memcpy(postthinkframe_hooks[index].short_src, short_src, LUA_IDSIZE * sizeof(char));
|
||||
// since the values are set sequentially from begin to end, the last call should leave
|
||||
@@ -282,8 +288,6 @@ void PS_SetPostThinkFrameHookInfo(int index, precise_t time_taken, char* short_s
|
||||
postthinkframe_hooks_length = index + 1;
|
||||
}
|
||||
|
||||
|
||||
|
||||
static boolean PS_HighResolution(void)
|
||||
{
|
||||
return (vid.width >= 640 && vid.height >= 400);
|
||||
@@ -349,6 +353,7 @@ static INT32 PS_GetMetricMinOrMax(ps_metric_t *metric, boolean time_metric, bool
|
||||
for (i = 0; i < cv_ps_samplesize.value; i++)
|
||||
{
|
||||
INT32 value;
|
||||
|
||||
if (time_metric)
|
||||
value = (*((precise_t*)history_read_pos)) / (I_GetPrecisePrecision() / 1000000);
|
||||
else
|
||||
@@ -359,6 +364,7 @@ static INT32 PS_GetMetricMinOrMax(ps_metric_t *metric, boolean time_metric, bool
|
||||
{
|
||||
found_value = value;
|
||||
}
|
||||
|
||||
history_read_pos += value_size;
|
||||
}
|
||||
|
||||
@@ -377,6 +383,7 @@ static INT32 PS_GetMetricSD(ps_metric_t *metric, boolean time_metric)
|
||||
for (i = 0; i < cv_ps_samplesize.value; i++)
|
||||
{
|
||||
INT64 value;
|
||||
|
||||
if (time_metric)
|
||||
value = (*((precise_t*)history_read_pos)) / (I_GetPrecisePrecision() / 1000000);
|
||||
else
|
||||
@@ -396,14 +403,17 @@ static INT32 PS_GetMetricScreenValue(ps_metric_t *metric, boolean time_metric)
|
||||
{
|
||||
if (cv_ps_samplesize.value > 1 && metric->history)
|
||||
{
|
||||
if (cv_ps_descriptor.value == 1)
|
||||
return PS_GetMetricAverage(metric, time_metric);
|
||||
else if (cv_ps_descriptor.value == 2)
|
||||
return PS_GetMetricSD(metric, time_metric);
|
||||
else if (cv_ps_descriptor.value == 3)
|
||||
return PS_GetMetricMinOrMax(metric, time_metric, false);
|
||||
else
|
||||
return PS_GetMetricMinOrMax(metric, time_metric, true);
|
||||
switch (cv_ps_descriptor.value)
|
||||
{
|
||||
case 1:
|
||||
return PS_GetMetricAverage(metric, time_metric);
|
||||
case 2:
|
||||
return PS_GetMetricSD(metric, time_metric);
|
||||
case 3:
|
||||
return PS_GetMetricMinOrMax(metric, time_metric, false);
|
||||
default:
|
||||
return PS_GetMetricMinOrMax(metric, time_metric, true);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -543,8 +553,8 @@ static void PS_UpdateFrameStats(void)
|
||||
if (PS_IsLevelActive())
|
||||
PS_UpdateRowHistories(commoncounter_rows, true);
|
||||
|
||||
/*if (R_UsingFrameInterpolation())
|
||||
PS_UpdateRowHistories(interpolation_rows, true);*/
|
||||
if (R_UsingFrameInterpolation())
|
||||
PS_UpdateRowHistories(interpolation_rows, true);
|
||||
|
||||
#ifdef HWRENDER
|
||||
if (rendermode == render_opengl && cv_glbatching.value)
|
||||
@@ -575,6 +585,7 @@ static void PS_CountThinkers(void)
|
||||
ps_precipcount.value.i = 0;
|
||||
ps_otherthcount.value.i = 0;
|
||||
ps_removecount.value.i = 0;
|
||||
|
||||
for (thinker = thinkercap.next; thinker != &thinkercap; thinker = thinker->next)
|
||||
{
|
||||
ps_thinkercount.value.i++;
|
||||
@@ -644,6 +655,7 @@ void PS_UpdateTickStats(void)
|
||||
{
|
||||
PS_UpdateRowHistories(gamelogicbrief_row, false);
|
||||
}
|
||||
|
||||
if (cv_perfstats.value == 2)
|
||||
{
|
||||
if (PS_IsLevelActive())
|
||||
@@ -656,8 +668,6 @@ void PS_UpdateTickStats(void)
|
||||
ps_lua_thinkframe_time.value.p -
|
||||
ps_lua_postthinkframe_time.value.p;
|
||||
|
||||
|
||||
|
||||
PS_CountThinkers();
|
||||
}
|
||||
|
||||
@@ -668,37 +678,47 @@ void PS_UpdateTickStats(void)
|
||||
PS_UpdateRowHistories(misc_calls_rows, false);
|
||||
}
|
||||
}
|
||||
|
||||
if (cv_ps_samplesize.value > 1)
|
||||
{
|
||||
if(cv_perfstats.value >= 3 && PS_IsLevelActive())
|
||||
if (cv_perfstats.value >= 3 && PS_IsLevelActive())
|
||||
{
|
||||
int i;
|
||||
if (cv_perfstats.value == 3)
|
||||
int i;
|
||||
|
||||
switch (cv_perfstats.value)
|
||||
{
|
||||
for (i = 0; i < thinkframe_hooks_length; i++)
|
||||
PS_UpdateMetricHistory(&thinkframe_hooks[i].time_taken, true, false);
|
||||
}
|
||||
else if (cv_perfstats.value == 4)
|
||||
{
|
||||
for (i = 0; i < prethinkframe_hooks_length; i++)
|
||||
PS_UpdateMetricHistory(&prethinkframe_hooks[i].time_taken, true, false);
|
||||
}
|
||||
else if (cv_perfstats.value == 5)
|
||||
{
|
||||
for (i = 0; i < postthinkframe_hooks_length; i++)
|
||||
PS_UpdateMetricHistory(&postthinkframe_hooks[i].time_taken, true, false);
|
||||
case 3:
|
||||
for (i = 0; i < thinkframe_hooks_length; i++)
|
||||
{
|
||||
PS_UpdateMetricHistory(&thinkframe_hooks[i].time_taken, true, false);
|
||||
}
|
||||
break;
|
||||
case 4:
|
||||
for (i = 0; i < prethinkframe_hooks_length; i++)
|
||||
{
|
||||
PS_UpdateMetricHistory(&prethinkframe_hooks[i].time_taken, true, false);
|
||||
}
|
||||
break;
|
||||
case 5:
|
||||
for (i = 0; i < postthinkframe_hooks_length; i++)
|
||||
{
|
||||
PS_UpdateMetricHistory(&postthinkframe_hooks[i].time_taken, true, false);
|
||||
}
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (cv_perfstats.value)
|
||||
{
|
||||
ps_tick_index++;
|
||||
|
||||
if (ps_tick_index >= cv_ps_samplesize.value)
|
||||
ps_tick_index = 0;
|
||||
|
||||
if (ps_tick_samples_left)
|
||||
ps_tick_samples_left--;
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@@ -712,6 +732,7 @@ static void PS_DrawDescriptorHeader(void)
|
||||
"minimum",
|
||||
"maximum"
|
||||
};
|
||||
|
||||
const boolean hires = PS_HighResolution();
|
||||
char* str;
|
||||
INT32 flags = V_MONOSPACE | V_ALLOWLOWERCASE;
|
||||
@@ -752,7 +773,7 @@ static void PS_DrawRenderStats(void)
|
||||
{
|
||||
const boolean hires = PS_HighResolution();
|
||||
const int half_row = hires ? 5 : 4;
|
||||
int x, y = 10; //, cy = 10;
|
||||
int x, y, cy = 10;
|
||||
|
||||
PS_DrawDescriptorHeader();
|
||||
|
||||
@@ -763,7 +784,7 @@ static void PS_DrawRenderStats(void)
|
||||
if (PS_IsLevelActive())
|
||||
{
|
||||
x = hires ? 115 : 90;
|
||||
/*cy = */PS_DrawPerfRows(x, 10, V_BLUEMAP, commoncounter_rows);// + half_row;
|
||||
cy = PS_DrawPerfRows(x, 10, V_BLUEMAP, commoncounter_rows) + half_row;
|
||||
|
||||
#ifdef HWRENDER
|
||||
if (rendermode == render_opengl && cv_glbatching.value)
|
||||
@@ -778,11 +799,11 @@ static void PS_DrawRenderStats(void)
|
||||
#endif
|
||||
}
|
||||
|
||||
/*if (R_UsingFrameInterpolation())
|
||||
if (R_UsingFrameInterpolation())
|
||||
{
|
||||
x = hires ? 115 : 90;
|
||||
PS_DrawPerfRows(x, cy, V_ROSYMAP, interpolation_rows);
|
||||
}*/
|
||||
PS_DrawPerfRows(x, cy, V_PEACHMAP, interpolation_rows);
|
||||
}
|
||||
}
|
||||
|
||||
static void PS_DrawGameLogicStats(void)
|
||||
@@ -819,12 +840,12 @@ static void PS_DrawGameLogicStats(void)
|
||||
|
||||
static void draw_think_frame_stats(int hook_length, ps_hookinfo_t *hook)
|
||||
{
|
||||
char s[100];
|
||||
char s[100];
|
||||
int i;
|
||||
int maxpage = 0;
|
||||
int page = 0;
|
||||
int pagestart = 0;
|
||||
int pageend = 0;
|
||||
int page = 0;
|
||||
int pagestart = 0;
|
||||
int pageend = 0;
|
||||
// text writing position
|
||||
int x = START_X;
|
||||
int y = START_Y;
|
||||
@@ -832,57 +853,69 @@ static void draw_think_frame_stats(int hook_length, ps_hookinfo_t *hook)
|
||||
char tempbuffer[LUA_IDSIZE];
|
||||
char last_mod_name[LUA_IDSIZE];
|
||||
last_mod_name[0] = '\0';
|
||||
INT32 total = 0;
|
||||
INT32 total = 0;
|
||||
|
||||
//Decide page length based and drawn text on choosen thinker type
|
||||
if (cv_perfstats.value == 3){
|
||||
maxpage = thinkframe_hooks_length/PAGE_ENTRIES + 1;
|
||||
page = max(1, min(cv_ps_thinkframe_page.value, maxpage));
|
||||
pagestart = min((page - 1)*PAGE_ENTRIES, thinkframe_hooks_length);
|
||||
pageend = min(pagestart + PAGE_ENTRIES, thinkframe_hooks_length);
|
||||
|
||||
V_DrawSmallString(MAX_X-50, MAX_Y+2*HEIGHT, V_MONOSPACE | V_GREENMAP, "ThinkFrame");
|
||||
}
|
||||
else if (cv_perfstats.value == 4){
|
||||
maxpage = prethinkframe_hooks_length/PAGE_ENTRIES + 1;
|
||||
page = max(1, min(cv_ps_thinkframe_page.value, maxpage));
|
||||
pagestart = min((page - 1)*PAGE_ENTRIES, prethinkframe_hooks_length);
|
||||
pageend = min(pagestart + PAGE_ENTRIES, prethinkframe_hooks_length);
|
||||
V_DrawSmallString(MAX_X-60, MAX_Y+2*HEIGHT, V_MONOSPACE | V_GREENMAP, "PreThinkFrame");
|
||||
}
|
||||
else if (cv_perfstats.value == 5){
|
||||
maxpage = postthinkframe_hooks_length/PAGE_ENTRIES + 1;
|
||||
page = max(1, min(cv_ps_thinkframe_page.value, maxpage));
|
||||
pagestart = min((page - 1)*PAGE_ENTRIES, postthinkframe_hooks_length);
|
||||
pageend = min(pagestart + PAGE_ENTRIES, postthinkframe_hooks_length);
|
||||
V_DrawSmallString(MAX_X-65, MAX_Y+2*HEIGHT, V_MONOSPACE | V_GREENMAP, "PostThinkFrame");
|
||||
switch (cv_perfstats.value)
|
||||
{
|
||||
case 3:
|
||||
{
|
||||
maxpage = thinkframe_hooks_length/PAGE_ENTRIES + 1;
|
||||
page = max(1, min(cv_ps_thinkframe_page.value, maxpage));
|
||||
pagestart = min((page - 1)*PAGE_ENTRIES, thinkframe_hooks_length);
|
||||
pageend = min(pagestart + PAGE_ENTRIES, thinkframe_hooks_length);
|
||||
|
||||
V_DrawSmallString(MAX_X-50, MAX_Y+2*HEIGHT, V_MONOSPACE | V_GREENMAP, "ThinkFrame");
|
||||
}
|
||||
break;
|
||||
case 4:
|
||||
{
|
||||
maxpage = prethinkframe_hooks_length/PAGE_ENTRIES + 1;
|
||||
page = max(1, min(cv_ps_thinkframe_page.value, maxpage));
|
||||
pagestart = min((page - 1)*PAGE_ENTRIES, prethinkframe_hooks_length);
|
||||
pageend = min(pagestart + PAGE_ENTRIES, prethinkframe_hooks_length);
|
||||
V_DrawSmallString(MAX_X-60, MAX_Y+2*HEIGHT, V_MONOSPACE | V_GREENMAP, "PreThinkFrame");
|
||||
}
|
||||
break;
|
||||
case 5:
|
||||
{
|
||||
maxpage = postthinkframe_hooks_length/PAGE_ENTRIES + 1;
|
||||
page = max(1, min(cv_ps_thinkframe_page.value, maxpage));
|
||||
pagestart = min((page - 1)*PAGE_ENTRIES, postthinkframe_hooks_length);
|
||||
pageend = min(pagestart + PAGE_ENTRIES, postthinkframe_hooks_length);
|
||||
V_DrawSmallString(MAX_X-65, MAX_Y+2*HEIGHT, V_MONOSPACE | V_GREENMAP, "PostThinkFrame");
|
||||
}
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
|
||||
PS_DrawDescriptorHeader();
|
||||
|
||||
for (i = 0; i < hook_length; i++)
|
||||
{
|
||||
|
||||
#define NEXT_ROW() y += HEIGHT;
|
||||
|
||||
INT32 value = PS_GetMetricScreenValue(&hook[i].time_taken, true);
|
||||
total += value;
|
||||
INT32 value = PS_GetMetricScreenValue(&hook[i].time_taken, true);
|
||||
total += value;
|
||||
|
||||
if (i < pagestart || i >= pageend) continue;
|
||||
if (i < pagestart || i >= pageend) continue;
|
||||
|
||||
char* str = hook[i].short_src;
|
||||
char* tempstr = tempbuffer;
|
||||
int len = (int)strlen(str);
|
||||
char* str_ptr;
|
||||
|
||||
if (strcmp(".lua", str + len - 4) == 0)
|
||||
{
|
||||
str[len-4] = '\0'; // remove .lua at end
|
||||
len -= 4;
|
||||
}
|
||||
|
||||
// Print wad name first.
|
||||
strcpy(tempstr, str);
|
||||
str_ptr = strrchr(tempstr, '|');
|
||||
|
||||
if (str_ptr)
|
||||
{
|
||||
*str_ptr = '\0';
|
||||
@@ -891,12 +924,12 @@ static void draw_think_frame_stats(int hook_length, ps_hookinfo_t *hook)
|
||||
if (str_ptr)
|
||||
tempstr = str_ptr + 1;
|
||||
// tempstr should now point to the mod name, (wad/pk3) possibly truncated
|
||||
strcpy(last_mod_name, tempstr);
|
||||
len = (int)strlen(tempstr);
|
||||
if (len > 30)
|
||||
tempstr += len - 30;
|
||||
snprintf(s, sizeof s - 1, "%s", tempstr);
|
||||
V_DrawSmallString(x, y, V_MONOSPACE | V_ALLOWLOWERCASE | V_GRAYMAP, s);
|
||||
strcpy(last_mod_name, tempstr);
|
||||
len = (int)strlen(tempstr);
|
||||
if (len > 30)
|
||||
tempstr += len - 30;
|
||||
snprintf(s, sizeof s - 1, "%s", tempstr);
|
||||
V_DrawSmallString(x, y, V_MONOSPACE | V_ALLOWLOWERCASE | V_GRAYMAP, s);
|
||||
text_color = V_YELLOWMAP;
|
||||
}
|
||||
else
|
||||
@@ -908,35 +941,35 @@ static void draw_think_frame_stats(int hook_length, ps_hookinfo_t *hook)
|
||||
str = str_ptr + 1;
|
||||
text_color = 0; // white
|
||||
}
|
||||
|
||||
len = (int)strlen(str);
|
||||
|
||||
if (len > 40)
|
||||
str += len - 40;
|
||||
|
||||
snprintf(s, sizeof s - 1, "%40s: %d", str, value);
|
||||
V_DrawSmallString(x + WIDTH, y, V_MONOSPACE | V_ALLOWLOWERCASE | text_color, s);
|
||||
NEXT_ROW()
|
||||
|
||||
#undef NEXT_ROW
|
||||
|
||||
}
|
||||
|
||||
snprintf(s, sizeof s - 1, "TOTAL %d", total);
|
||||
V_DrawSmallString(MAX_X, MAX_Y+2*HEIGHT, V_MONOSPACE | V_GREENMAP, s);
|
||||
snprintf(s, sizeof s - 1, "TOTAL %d", total);
|
||||
V_DrawSmallString(MAX_X, MAX_Y+2*HEIGHT, V_MONOSPACE | V_GREENMAP, s);
|
||||
|
||||
if (maxpage > 1) {
|
||||
snprintf(s, sizeof s - 1, "PAGE %d", page);
|
||||
V_DrawSmallString(START_X, MAX_Y+2*HEIGHT, V_MONOSPACE | V_GREENMAP, s);
|
||||
}
|
||||
|
||||
|
||||
if (maxpage > 1)
|
||||
{
|
||||
snprintf(s, sizeof s - 1, "PAGE %d", page);
|
||||
V_DrawSmallString(START_X, MAX_Y+2*HEIGHT, V_MONOSPACE | V_GREENMAP, s);
|
||||
}
|
||||
}
|
||||
|
||||
void PS_ThinkFrame_Page_OnChange(void)
|
||||
{
|
||||
int maxpage = thinkframe_hooks_length/PAGE_ENTRIES + 1;
|
||||
int maxpage = thinkframe_hooks_length/PAGE_ENTRIES + 1;
|
||||
|
||||
if (cv_ps_thinkframe_page.value > maxpage) {
|
||||
CV_StealthSetValue(&cv_ps_thinkframe_page, maxpage);
|
||||
}
|
||||
if (cv_ps_thinkframe_page.value > maxpage)
|
||||
CV_StealthSetValue(&cv_ps_thinkframe_page, maxpage);
|
||||
}
|
||||
|
||||
#undef WIDTH
|
||||
@@ -948,8 +981,6 @@ void PS_ThinkFrame_Page_OnChange(void)
|
||||
|
||||
#undef PAGE_ENTRIES
|
||||
|
||||
|
||||
|
||||
static void PS_DrawPreThinkFrameStats(void)
|
||||
{
|
||||
draw_think_frame_stats(prethinkframe_hooks_length, prethinkframe_hooks);
|
||||
@@ -983,6 +1014,7 @@ void M_DrawPerfStats(void)
|
||||
{
|
||||
if (!PS_IsLevelActive())
|
||||
return;
|
||||
|
||||
if (!PS_HighResolution())
|
||||
{
|
||||
// Low resolutions can't really use V_DrawSmallString that is used by thinkframe stats.
|
||||
@@ -992,19 +1024,21 @@ void M_DrawPerfStats(void)
|
||||
V_DrawThinString(80, 100, V_MONOSPACE | V_ALLOWLOWERCASE | V_YELLOWMAP, "for resolutions below 640x400.");
|
||||
return;
|
||||
}
|
||||
if (cv_perfstats.value == 3)
|
||||
{
|
||||
PS_DrawThinkFrameStats();
|
||||
}
|
||||
else if (cv_perfstats.value == 4)
|
||||
{
|
||||
PS_DrawPreThinkFrameStats();
|
||||
}
|
||||
else if (cv_perfstats.value == 5)
|
||||
{
|
||||
PS_DrawPostThinkFrameStats();
|
||||
}
|
||||
|
||||
switch (cv_perfstats.value)
|
||||
{
|
||||
case 3:
|
||||
PS_DrawThinkFrameStats();
|
||||
break;
|
||||
case 4:
|
||||
PS_DrawPreThinkFrameStats();
|
||||
break;
|
||||
case 5:
|
||||
PS_DrawPostThinkFrameStats();
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1014,15 +1048,18 @@ static void PS_ClearHistory(void)
|
||||
int i;
|
||||
|
||||
Z_FreeTags(PU_PERFSTATS, PU_PERFSTATS);
|
||||
|
||||
// thinkframe hook metric history pointers need to be cleared manually
|
||||
for (i = 0; i < prethinkframe_hooks_length; i++)
|
||||
{
|
||||
prethinkframe_hooks[i].time_taken.history = NULL;
|
||||
}
|
||||
|
||||
for (i = 0; i < thinkframe_hooks_length; i++)
|
||||
{
|
||||
thinkframe_hooks[i].time_taken.history = NULL;
|
||||
}
|
||||
|
||||
for (i = 0; i < postthinkframe_hooks_length; i++)
|
||||
{
|
||||
postthinkframe_hooks[i].time_taken.history = NULL;
|
||||
|
||||
@@ -55,7 +55,6 @@ void PS_SetPreThinkFrameHookInfo(int index, precise_t time_taken, char* short_sr
|
||||
void PS_SetThinkFrameHookInfo(int index, precise_t time_taken, char* short_src);
|
||||
void PS_SetPostThinkFrameHookInfo(int index, precise_t time_taken, char* short_src);
|
||||
|
||||
|
||||
void PS_UpdateTickStats(void);
|
||||
|
||||
void M_DrawPerfStats(void);
|
||||
|
||||
+2
-4
@@ -14,13 +14,11 @@
|
||||
|
||||
#include "doomdef.h"
|
||||
#include "doomtype.h"
|
||||
#include "doomstat.h" // totalplaytime
|
||||
#include "k_stats.h" // kartstats.totalplaytime
|
||||
|
||||
#include "m_random.h"
|
||||
#include "m_fixed.h"
|
||||
|
||||
|
||||
|
||||
// ---------------------------
|
||||
// RNG functions (not synched)
|
||||
// ---------------------------
|
||||
@@ -252,5 +250,5 @@ void P_SetRandSeedD(const char *rfile, INT32 rline, UINT32 seed)
|
||||
*/
|
||||
UINT32 M_RandomizedSeed(void)
|
||||
{
|
||||
return ((totalplaytime & 0xFFFF) << 16)|M_RandomFixed();
|
||||
return ((kartstats.totalplaytime & 0xFFFF) << 16)|M_RandomFixed();
|
||||
}
|
||||
@@ -26,12 +26,6 @@
|
||||
|
||||
#if defined (STDC_HEADERS) || defined (_LIBC)
|
||||
#include <stdlib.h>
|
||||
#else
|
||||
#ifndef HAVE_MEMCPY
|
||||
#if !(defined (_WIN32) && !defined (__CYGWIN__)) && !defined (__APPLE__)
|
||||
#define memcpy(d, s, n) bcopy ((s), (d), (n))
|
||||
#endif
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#include "md5.h"
|
||||
|
||||
+9
-12
@@ -4011,18 +4011,15 @@ void A_SignPlayer(mobj_t *actor)
|
||||
P_SetTarget(&ov->target, actor);
|
||||
ov->color = actor->target->player->skincolor;
|
||||
ov->skin = &skins[actor->target->player->skin];
|
||||
if (actor->target->skinlocal) {
|
||||
// needs - 1 or else it pukes an error out
|
||||
// same thing happens on p_mobj.c
|
||||
|
||||
// needs - 1 or else it pukes an error out
|
||||
// same thing happens on p_mobj.c
|
||||
if (actor->target->skinlocal)
|
||||
ov->localskin = &localskins[actor->target->player->localskin - 1];
|
||||
ov->skinlocal = actor->target->skinlocal;
|
||||
} else {
|
||||
// needs - 1 or else it pukes an error out
|
||||
// same thing happens on p_mobj.c
|
||||
if (actor->target->player->localskin)
|
||||
ov->localskin = &skins[actor->target->player->localskin - 1];
|
||||
ov->skinlocal = actor->target->skinlocal;
|
||||
}
|
||||
else if (actor->target->player->localskin)
|
||||
ov->localskin = &skins[actor->target->player->localskin - 1];
|
||||
ov->skinlocal = actor->target->skinlocal;
|
||||
|
||||
P_SetMobjState(ov, actor->info->seestate); // S_PLAY_SIGN
|
||||
}
|
||||
|
||||
@@ -9255,7 +9252,7 @@ void A_Custom3DRotate(mobj_t *actor)
|
||||
P_RemoveMobj(actor);
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
if (hspeed==0 && vspeed==0)
|
||||
{
|
||||
if (cv_debug)
|
||||
|
||||
+21
-53
@@ -452,25 +452,16 @@ void T_MoveElevator(elevator_t *elevator)
|
||||
const fixed_t dh = abs(elevator->sector->floorheight - elevator->floordestheight);
|
||||
|
||||
// Slow down when reaching destination Tails 12-06-2000
|
||||
if (wh < dh)
|
||||
elevator->speed = FixedDiv(wh,25*FRACUNIT) + FRACUNIT/4;
|
||||
else
|
||||
elevator->speed = FixedDiv(dh,25*FRACUNIT) + FRACUNIT/4;
|
||||
elevator->speed = FixedDiv(((wh < dh) ? wh : dh), 25*FRACUNIT) + FRACUNIT/4;
|
||||
|
||||
if (elevator->origspeed)
|
||||
{
|
||||
elevator->speed = FixedMul(elevator->speed,origspeed);
|
||||
if (elevator->speed > elevator->origspeed)
|
||||
elevator->speed = (elevator->origspeed);
|
||||
if (elevator->speed < 1)
|
||||
elevator->speed = 1;
|
||||
elevator->speed = FixedMul(elevator->speed, origspeed);
|
||||
elevator->speed = CLAMP(elevator->speed, 1, elevator->origspeed);
|
||||
}
|
||||
else
|
||||
{
|
||||
if (elevator->speed > 3*FRACUNIT)
|
||||
elevator->speed = 3*FRACUNIT;
|
||||
if (elevator->speed < 1)
|
||||
elevator->speed = 1;
|
||||
elevator->speed = CLAMP(elevator->speed, 1, 3*FRACUNIT);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -513,26 +504,18 @@ void T_MoveElevator(elevator_t *elevator)
|
||||
const fixed_t origspeed = FixedDiv(elevator->origspeed,(ELEVATORSPEED/2));
|
||||
const fixed_t wc = abs(elevator->sector->ceilingheight - elevator->ceilingwasheight);
|
||||
const fixed_t dc = abs(elevator->sector->ceilingheight - elevator->ceilingdestheight);
|
||||
|
||||
// Slow down when reaching destination Tails 12-06-2000
|
||||
if (wc < dc)
|
||||
elevator->speed = FixedDiv(wc,25*FRACUNIT) + FRACUNIT/4;
|
||||
else
|
||||
elevator->speed = FixedDiv(dc,25*FRACUNIT) + FRACUNIT/4;
|
||||
elevator->speed = FixedDiv(((wc < dc) ? wc : dc), 25*FRACUNIT) + FRACUNIT/4;
|
||||
|
||||
if (elevator->origspeed)
|
||||
{
|
||||
elevator->speed = FixedMul(elevator->speed,origspeed);
|
||||
if (elevator->speed > elevator->origspeed)
|
||||
elevator->speed = (elevator->origspeed);
|
||||
if (elevator->speed < 1)
|
||||
elevator->speed = 1;
|
||||
elevator->speed = FixedMul(elevator->speed, origspeed);
|
||||
elevator->speed = CLAMP(elevator->speed, 1, elevator->origspeed);
|
||||
}
|
||||
else
|
||||
{
|
||||
if (elevator->speed > 3*FRACUNIT)
|
||||
elevator->speed = 3*FRACUNIT;
|
||||
if (elevator->speed < 1)
|
||||
elevator->speed = 1;
|
||||
elevator->speed = CLAMP(elevator->speed, 1, 3*FRACUNIT);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -571,11 +554,7 @@ void T_MoveElevator(elevator_t *elevator)
|
||||
else
|
||||
res = res1;
|
||||
}
|
||||
/*
|
||||
// make floor move sound
|
||||
if (!(leveltime&7))
|
||||
S_StartSound(&elevator->sector->soundorg, sfx_stnmov);
|
||||
*/
|
||||
|
||||
if (res == pastdest || res == crushed) // if destination height acheived
|
||||
{
|
||||
if (elevator->type == elevateContinuous)
|
||||
@@ -608,7 +587,6 @@ void T_MoveElevator(elevator_t *elevator)
|
||||
elevator->ceilingdestheight =
|
||||
elevator->floordestheight + elevator->sector->ceilingheight - elevator->sector->floorheight;
|
||||
}
|
||||
// T_MoveElevator(elevator);
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -638,7 +616,6 @@ void T_MoveElevator(elevator_t *elevator)
|
||||
elevator->ceilingdestheight =
|
||||
elevator->floordestheight + elevator->sector->ceilingheight - elevator->sector->floorheight;
|
||||
}
|
||||
// T_MoveElevator(elevator);
|
||||
}
|
||||
elevator->delaytimer = elevator->delay;
|
||||
}
|
||||
@@ -651,9 +628,8 @@ void T_MoveElevator(elevator_t *elevator)
|
||||
P_RemoveThinker(&elevator->thinker); // remove elevator from actives
|
||||
dontupdate = true;
|
||||
}
|
||||
// make floor stop sound
|
||||
// S_StartSound(&elevator->sector->soundorg, sfx_pstop);
|
||||
}
|
||||
|
||||
if (!dontupdate)
|
||||
{
|
||||
elevator->sector->floorspeed = elevator->speed*elevator->direction;
|
||||
@@ -2154,10 +2130,7 @@ void T_EachTimeThinker(levelspecthink_t *eachtime)
|
||||
if (!playeringame[j])
|
||||
continue;
|
||||
|
||||
if (!players[j].mo)
|
||||
continue;
|
||||
|
||||
if (players[j].mo->health <= 0)
|
||||
if (!players[j].mo || (players[j].mo->health <= 0))
|
||||
continue;
|
||||
|
||||
if ((netgame || multiplayer) && players[j].spectator)
|
||||
@@ -2168,6 +2141,7 @@ void T_EachTimeThinker(levelspecthink_t *eachtime)
|
||||
else if (sec->flags & SF_TRIGGERSPECIAL_TOUCH)
|
||||
{
|
||||
boolean insector = false;
|
||||
|
||||
for (node = players[j].mo->touching_sectorlist; node; node = node->m_sectorlist_next)
|
||||
{
|
||||
if (node->m_sector == targetsec)
|
||||
@@ -2176,6 +2150,7 @@ void T_EachTimeThinker(levelspecthink_t *eachtime)
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if (!insector)
|
||||
continue;
|
||||
}
|
||||
@@ -2220,10 +2195,7 @@ void T_EachTimeThinker(levelspecthink_t *eachtime)
|
||||
if (!playeringame[i])
|
||||
continue;
|
||||
|
||||
if (!players[i].mo)
|
||||
continue;
|
||||
|
||||
if (players[i].mo->health <= 0)
|
||||
if (!players[i].mo || (players[i].mo->health <= 0))
|
||||
continue;
|
||||
|
||||
if ((netgame || multiplayer) && players[i].spectator)
|
||||
@@ -2234,6 +2206,7 @@ void T_EachTimeThinker(levelspecthink_t *eachtime)
|
||||
else if (sec->flags & SF_TRIGGERSPECIAL_TOUCH)
|
||||
{
|
||||
boolean insector = false;
|
||||
|
||||
for (node = players[i].mo->touching_sectorlist; node; node = node->m_sectorlist_next)
|
||||
{
|
||||
if (node->m_sector == sec)
|
||||
@@ -2242,6 +2215,7 @@ void T_EachTimeThinker(levelspecthink_t *eachtime)
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if (!insector)
|
||||
continue;
|
||||
}
|
||||
@@ -2302,10 +2276,7 @@ void T_EachTimeThinker(levelspecthink_t *eachtime)
|
||||
if (!playeringame[i])
|
||||
continue;
|
||||
|
||||
if (!players[i].mo)
|
||||
continue;
|
||||
|
||||
if (players[i].mo->health <= 0)
|
||||
if (!players[i].mo || (players[i].mo->health <= 0))
|
||||
continue;
|
||||
|
||||
if ((netgame || multiplayer) && players[i].spectator)
|
||||
@@ -2359,11 +2330,7 @@ void T_RaiseSector(levelspecthink_t *raise)
|
||||
{
|
||||
thing = node->m_thing;
|
||||
|
||||
if (!thing->player)
|
||||
continue;
|
||||
|
||||
// Ignore spectators.
|
||||
if (thing->player && thing->player->spectator)
|
||||
if (!thing->player || thing->player->spectator) // Ignore spectators.
|
||||
continue;
|
||||
|
||||
// Option to require spindashing.
|
||||
@@ -2923,6 +2890,7 @@ void EV_CrumbleChain(sector_t *sec, ffloor_t *rover)
|
||||
|
||||
// soundorg z height never gets set normally, so MEH.
|
||||
sec->soundorg.z = sec->floorheight;
|
||||
//sec->soundorg.z = (rover->master->frontsector->floorheight + rover->master->frontsector->ceilingheight)/2; // actual accurate z but well smth smth synchsafe
|
||||
S_StartSound(&sec->soundorg, sfx_crumbl);
|
||||
|
||||
// Find the outermost vertexes in the subsector
|
||||
@@ -2955,6 +2923,7 @@ void EV_CrumbleChain(sector_t *sec, ffloor_t *rover)
|
||||
if (R_PointInSubsector(a, b)->sector == sec)
|
||||
{
|
||||
mobj_t *spawned = NULL;
|
||||
|
||||
for (c = topz; c > *rover->bottomheight; c -= spacing)
|
||||
{
|
||||
spawned = P_SpawnMobj(a, b, c, type);
|
||||
@@ -3119,7 +3088,6 @@ INT32 EV_StartCrumble(sector_t *sec, ffloor_t *rover, boolean floating,
|
||||
for (i = -1; (i = P_FindSectorFromTag(elevator->sourceline->tag, i)) >= 0 ;)
|
||||
{
|
||||
foundsec = §ors[i];
|
||||
|
||||
P_SpawnMobj(foundsec->soundorg.x, foundsec->soundorg.y, elevator->direction == 1 ? elevator->sector->floorheight : elevator->sector->ceilingheight, MT_CRUMBLEOBJ);
|
||||
}
|
||||
|
||||
|
||||
+23
-167
@@ -37,62 +37,6 @@
|
||||
#define CTFTEAMCODE(pl) pl->ctfteam ? (pl->ctfteam == 1 ? "\x85" : "\x84") : ""
|
||||
#define CTFTEAMENDCODE(pl) pl->ctfteam ? "\x80" : ""
|
||||
|
||||
void P_ForceFeed(const player_t *player, INT32 attack, INT32 fade, tic_t duration, INT32 period)
|
||||
{
|
||||
BasicFF_t Basicfeed;
|
||||
if (!player)
|
||||
return;
|
||||
Basicfeed.Duration = (UINT32)(duration * (100L/TICRATE));
|
||||
Basicfeed.ForceX = Basicfeed.ForceY = 1;
|
||||
Basicfeed.Gain = 25000;
|
||||
Basicfeed.Magnitude = period*10;
|
||||
Basicfeed.player = player;
|
||||
/// \todo test FFB
|
||||
P_RampConstant(&Basicfeed, attack, fade);
|
||||
}
|
||||
|
||||
void P_ForceConstant(const BasicFF_t *FFInfo)
|
||||
{
|
||||
JoyFF_t ConstantQuake;
|
||||
if (!FFInfo || !FFInfo->player)
|
||||
return;
|
||||
ConstantQuake.ForceX = FFInfo->ForceX;
|
||||
ConstantQuake.ForceY = FFInfo->ForceY;
|
||||
ConstantQuake.Duration = FFInfo->Duration;
|
||||
ConstantQuake.Gain = FFInfo->Gain;
|
||||
ConstantQuake.Magnitude = FFInfo->Magnitude;
|
||||
if (FFInfo->player == &players[consoleplayer])
|
||||
I_Tactile(ConstantForce, &ConstantQuake);
|
||||
else if (splitscreen && FFInfo->player == &players[displayplayers[1]])
|
||||
I_Tactile2(ConstantForce, &ConstantQuake);
|
||||
else if (splitscreen > 1 && FFInfo->player == &players[displayplayers[2]])
|
||||
I_Tactile3(ConstantForce, &ConstantQuake);
|
||||
else if (splitscreen > 2 && FFInfo->player == &players[displayplayers[3]])
|
||||
I_Tactile4(ConstantForce, &ConstantQuake);
|
||||
}
|
||||
void P_RampConstant(const BasicFF_t *FFInfo, INT32 Start, INT32 End)
|
||||
{
|
||||
JoyFF_t RampQuake;
|
||||
if (!FFInfo || !FFInfo->player)
|
||||
return;
|
||||
RampQuake.ForceX = FFInfo->ForceX;
|
||||
RampQuake.ForceY = FFInfo->ForceY;
|
||||
RampQuake.Duration = FFInfo->Duration;
|
||||
RampQuake.Gain = FFInfo->Gain;
|
||||
RampQuake.Magnitude = FFInfo->Magnitude;
|
||||
RampQuake.Start = Start;
|
||||
RampQuake.End = End;
|
||||
if (FFInfo->player == &players[consoleplayer])
|
||||
I_Tactile(ConstantForce, &RampQuake);
|
||||
else if (splitscreen && FFInfo->player == &players[displayplayers[1]])
|
||||
I_Tactile2(ConstantForce, &RampQuake);
|
||||
else if (splitscreen > 1 && FFInfo->player == &players[displayplayers[2]])
|
||||
I_Tactile3(ConstantForce, &RampQuake);
|
||||
else if (splitscreen > 2 && FFInfo->player == &players[displayplayers[3]])
|
||||
I_Tactile4(ConstantForce, &RampQuake);
|
||||
}
|
||||
|
||||
|
||||
//
|
||||
// GET STUFF
|
||||
//
|
||||
@@ -107,9 +51,6 @@ boolean P_CanPickupItem(player_t *player, UINT8 weapon)
|
||||
if (player->exiting || mapreset)
|
||||
return false;
|
||||
|
||||
/*if (G_BattleGametype() && player->kartstuff[k_bumper] <= 0) // No bumpers in Match
|
||||
return false;*/
|
||||
|
||||
if (weapon)
|
||||
{
|
||||
// Item slot already taken up
|
||||
@@ -165,26 +106,14 @@ void P_DoNightsScore(player_t *player)
|
||||
return; // Don't do any fancy shit for failures.
|
||||
|
||||
dummymo = P_SpawnMobj(player->mo->x, player->mo->y, player->mo->z+player->mo->height/2, MT_NIGHTSCORE);
|
||||
|
||||
if (player->bot)
|
||||
player = &players[consoleplayer];
|
||||
|
||||
if (G_IsSpecialStage(gamemap)) // Global link count? Maybe not a good idea...
|
||||
{
|
||||
INT32 i;
|
||||
for (i = 0; i < MAXPLAYERS; i++)
|
||||
if (playeringame[i])
|
||||
{
|
||||
if (++players[i].linkcount > players[i].maxlink)
|
||||
players[i].maxlink = players[i].linkcount;
|
||||
players[i].linktimer = 2*TICRATE;
|
||||
}
|
||||
}
|
||||
else // Individual link counts
|
||||
{
|
||||
if (++player->linkcount > player->maxlink)
|
||||
player->maxlink = player->linkcount;
|
||||
player->linktimer = 2*TICRATE;
|
||||
}
|
||||
// Individual link counts
|
||||
if (++player->linkcount > player->maxlink)
|
||||
player->maxlink = player->linkcount;
|
||||
player->linktimer = 2*TICRATE;
|
||||
|
||||
if (player->linkcount < 10)
|
||||
{
|
||||
@@ -214,12 +143,10 @@ void P_DoNightsScore(player_t *player)
|
||||
}
|
||||
|
||||
// Hoops are the only things that should add to your drill meter
|
||||
//player->drillmeter += TICRATE;
|
||||
dummymo->momz = FRACUNIT;
|
||||
dummymo->fuse = 3*TICRATE;
|
||||
|
||||
// What?! NO, don't use the camera! Scale up instead!
|
||||
//P_InstaThrust(dummymo, R_PointToAngle2(dummymo->x, dummymo->y, camera[0].x, camera[0].y), 3*FRACUNIT);
|
||||
dummymo->scalespeed = FRACUNIT/25;
|
||||
dummymo->destscale = 2*FRACUNIT;
|
||||
}
|
||||
@@ -374,7 +301,6 @@ void P_TouchSpecialThing(mobj_t *special, mobj_t *toucher, boolean heightcheck)
|
||||
else
|
||||
{
|
||||
K_DropItems(player); //K_StripItems(player);
|
||||
//K_StripOther(player);
|
||||
player->kartstuff[k_itemroulette] = 1;
|
||||
player->kartstuff[k_roulettetype] = 2;
|
||||
}
|
||||
@@ -521,8 +447,7 @@ void P_TouchSpecialThing(mobj_t *special, mobj_t *toucher, boolean heightcheck)
|
||||
|
||||
special->target->player->kartstuff[k_comebacktimer] = comebacktime;
|
||||
|
||||
K_DropItems(player); //K_StripItems(player);
|
||||
//K_StripOther(player);
|
||||
K_DropItems(player);
|
||||
|
||||
player->kartstuff[k_itemroulette] = 1;
|
||||
player->kartstuff[k_roulettetype] = 2;
|
||||
@@ -554,7 +479,6 @@ void P_TouchSpecialThing(mobj_t *special, mobj_t *toucher, boolean heightcheck)
|
||||
|
||||
if (player->kartstuff[k_invincibilitytimer] > 0 || player->kartstuff[k_growshrinktimer] > 0 || player->kartstuff[k_hyudorotimer] > 0)
|
||||
{
|
||||
//player->powers[pw_flashing] = 0;
|
||||
K_DropHnextList(player);
|
||||
K_StripItems(player);
|
||||
}
|
||||
@@ -842,8 +766,6 @@ void P_TouchSpecialThing(mobj_t *special, mobj_t *toucher, boolean heightcheck)
|
||||
return;
|
||||
if (special->fuse == 1)
|
||||
return;
|
||||
// if (special->momz > 0)
|
||||
// return;
|
||||
{
|
||||
UINT8 flagteam = (special->type == MT_REDFLAG) ? 1 : 2;
|
||||
const char *flagtext;
|
||||
@@ -964,14 +886,7 @@ void P_TouchSpecialThing(mobj_t *special, mobj_t *toucher, boolean heightcheck)
|
||||
}
|
||||
return;
|
||||
case MT_NIGHTSWING:
|
||||
if (G_IsSpecialStage(gamemap) && useNightsSS)
|
||||
{ // Pseudo-ring.
|
||||
S_StartSound(toucher, special->info->painsound);
|
||||
player->totalring++;
|
||||
}
|
||||
else
|
||||
S_StartSound(toucher, special->info->activesound);
|
||||
|
||||
S_StartSound(toucher, special->info->activesound);
|
||||
P_DoNightsScore(player);
|
||||
break;
|
||||
case MT_HOOPCOLLIDE:
|
||||
@@ -1002,13 +917,7 @@ void P_TouchSpecialThing(mobj_t *special, mobj_t *toucher, boolean heightcheck)
|
||||
|
||||
// Hoops are the only things that should add to the drill meter
|
||||
// Also, one tic's worth of drill is too much.
|
||||
if (G_IsSpecialStage(gamemap))
|
||||
{
|
||||
for (i = 0; i < MAXPLAYERS; i++)
|
||||
if (playeringame[i] && players[i].pflags & PF_NIGHTSMODE)
|
||||
players[i].drillmeter += TICRATE/2;
|
||||
}
|
||||
else if (player->bot)
|
||||
if (player->bot)
|
||||
players[consoleplayer].drillmeter += TICRATE/2;
|
||||
else
|
||||
player->drillmeter += TICRATE/2;
|
||||
@@ -1293,31 +1202,7 @@ void P_TouchSpecialThing(mobj_t *special, mobj_t *toucher, boolean heightcheck)
|
||||
P_SetMobjState(special, special->info->deathstate);
|
||||
return;
|
||||
case MT_SPECIALSPIKEBALL:
|
||||
if (!(!useNightsSS && G_IsSpecialStage(gamemap))) // Only for old special stages
|
||||
{
|
||||
P_DamageMobj(toucher, special, special, 1);
|
||||
return;
|
||||
}
|
||||
|
||||
if (player->powers[pw_invulnerability] || player->powers[pw_flashing]
|
||||
|| (player->powers[pw_super] && !(ALL7EMERALDS(player->powers[pw_emeralds]))))
|
||||
return;
|
||||
if (player->powers[pw_shield] || player->bot) //If One-Hit Shield
|
||||
{
|
||||
P_RemoveShield(player);
|
||||
S_StartSound(toucher, sfx_shldls); // Ba-Dum! Shield loss.
|
||||
}
|
||||
else
|
||||
{
|
||||
P_PlayRinglossSound(toucher, NULL);
|
||||
if (toucher->health > 10)
|
||||
toucher->health -= 10;
|
||||
else
|
||||
toucher->health = 1;
|
||||
player->health = toucher->health;
|
||||
}
|
||||
|
||||
P_DoPlayerPain(player, special, NULL);
|
||||
P_DamageMobj(toucher, special, special, 1);
|
||||
return;
|
||||
case MT_EGGMOBILE2_POGO:
|
||||
// sanity checks
|
||||
@@ -1614,9 +1499,6 @@ void P_KillMobj(mobj_t *target, mobj_t *inflictor, mobj_t *source)
|
||||
mobj_t *mo;
|
||||
int ms;
|
||||
|
||||
if (!useNightsSS && G_IsSpecialStage(gamemap) && target->player && sstimer > 6)
|
||||
sstimer = 6; // Just let P_Ticker take care of the rest.
|
||||
|
||||
if (target->flags & (MF_ENEMY|MF_BOSS))
|
||||
target->momx = target->momy = target->momz = 0;
|
||||
|
||||
@@ -1720,20 +1602,6 @@ void P_KillMobj(mobj_t *target, mobj_t *inflictor, mobj_t *source)
|
||||
target->flags |= MF_NOBLOCKMAP|MF_NOCLIPHEIGHT;
|
||||
P_SetThingPosition(target);
|
||||
|
||||
if (!target->player->bot && !G_IsSpecialStage(gamemap)
|
||||
&& G_GametypeUsesLives())
|
||||
{
|
||||
target->player->lives -= 1; // Lose a life Tails 03-11-2000
|
||||
|
||||
if (target->player->lives <= 0) // Tails 03-14-2000
|
||||
{
|
||||
if (P_IsLocalPlayer(target->player)/* && target->player == &players[consoleplayer] */)
|
||||
{
|
||||
S_StopMusic(); // Stop the Music! Tails 03-14-2000
|
||||
S_ChangeMusicInternal("gmover", false); // Yousa dead now, Okieday? Tails 03-14-2000
|
||||
}
|
||||
}
|
||||
}
|
||||
target->player->playerstate = PST_DEAD;
|
||||
|
||||
if (cv_birdmusic.value && cv_fading.value && P_IsLocalPlayer(target->player))
|
||||
@@ -2252,7 +2120,7 @@ static inline boolean P_PlayerHitsPlayer(mobj_t *target, mobj_t *inflictor, mobj
|
||||
return true;
|
||||
}
|
||||
|
||||
static void P_KillPlayer(player_t *player, mobj_t *source, INT32 damage)
|
||||
static void P_KillPlayer(player_t *player, mobj_t *source)
|
||||
{
|
||||
player->pflags &= ~(PF_CARRIED|PF_SLIDING|PF_ITEMHANG|PF_MACESPIN|PF_ROPEHANG|PF_NIGHTSMODE);
|
||||
|
||||
@@ -2271,8 +2139,6 @@ static void P_KillPlayer(player_t *player, mobj_t *source, INT32 damage)
|
||||
// Get rid of emeralds
|
||||
player->powers[pw_emeralds] = 0;
|
||||
|
||||
P_ForceFeed(player, 40, 10, TICRATE, 40 + min(damage, 100)*2);
|
||||
|
||||
P_ResetPlayer(player);
|
||||
|
||||
P_SetPlayerMobjState(player->mo, player->mo->info->deathstate);
|
||||
@@ -2337,14 +2203,12 @@ void P_RemoveShield(player_t *player)
|
||||
player->powers[pw_shield] = player->powers[pw_shield] & SH_STACK;
|
||||
}
|
||||
|
||||
static void P_RingDamage(player_t *player, mobj_t *inflictor, mobj_t *source, INT32 damage)
|
||||
static void P_RingDamage(player_t *player, mobj_t *inflictor, mobj_t *source)
|
||||
{
|
||||
if (!(inflictor && ((inflictor->flags & MF_MISSILE) || inflictor->player) && player->powers[pw_super] && ALL7EMERALDS(player->powers[pw_emeralds])))
|
||||
{
|
||||
P_DoPlayerPain(player, source, inflictor);
|
||||
|
||||
P_ForceFeed(player, 40, 10, TICRATE, 40 + min(damage, 100)*2);
|
||||
|
||||
if (source && (source->type == MT_SPIKE || (source->type == MT_NULL && source->threshold == 43))) // spikes
|
||||
S_StartSound(player->mo, sfx_spkdth);
|
||||
}
|
||||
@@ -2378,10 +2242,7 @@ boolean P_DamageMobj(mobj_t *target, mobj_t *inflictor, mobj_t *source, INT32 da
|
||||
return false;
|
||||
|
||||
// well no clue but this may happen ig
|
||||
if (!target)
|
||||
return false;
|
||||
|
||||
if (target->health <= 0)
|
||||
if (!target || (target->health <= 0))
|
||||
return false;
|
||||
|
||||
// Spectator handling
|
||||
@@ -2403,6 +2264,7 @@ boolean P_DamageMobj(mobj_t *target, mobj_t *inflictor, mobj_t *source, INT32 da
|
||||
|
||||
if (P_MobjWasRemoved(target))
|
||||
return (shouldForce == 1); // mobj was removed
|
||||
|
||||
if (shouldForce == 1)
|
||||
force = true;
|
||||
else if (shouldForce == 2)
|
||||
@@ -2543,7 +2405,8 @@ boolean P_DamageMobj(mobj_t *target, mobj_t *inflictor, mobj_t *source, INT32 da
|
||||
|
||||
// Instant-Death
|
||||
if (damage == DMG_INSTAKILL)
|
||||
P_KillPlayer(player, source, damage);
|
||||
P_KillPlayer(player, source);
|
||||
|
||||
else if (player->kartstuff[k_invincibilitytimer] > 0 || player->kartstuff[k_growshrinktimer] > 0 || player->powers[pw_flashing])
|
||||
{
|
||||
if (!force) // shoulddamage bypasses all of that.
|
||||
@@ -2561,8 +2424,9 @@ boolean P_DamageMobj(mobj_t *target, mobj_t *inflictor, mobj_t *source, INT32 da
|
||||
player->kartstuff[k_sneakertimer] = 0;
|
||||
K_SpinPlayer(player, source, 1, inflictor, false);
|
||||
damage = player->mo->health - 1;
|
||||
P_RingDamage(player, inflictor, source, damage);
|
||||
P_RingDamage(player, inflictor, source);
|
||||
P_PlayerRingBurst(player, 5);
|
||||
|
||||
if (P_IsLocalPlayer(player))
|
||||
{
|
||||
P_StartQuake(5, 32<<FRACBITS, 0);
|
||||
@@ -2572,6 +2436,7 @@ boolean P_DamageMobj(mobj_t *target, mobj_t *inflictor, mobj_t *source, INT32 da
|
||||
{
|
||||
K_SpinPlayer(player, source, 0, inflictor, false);
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -2605,8 +2470,6 @@ boolean P_DamageMobj(mobj_t *target, mobj_t *inflictor, mobj_t *source, INT32 da
|
||||
|
||||
if (player->health < 0)
|
||||
player->health = 0;
|
||||
|
||||
P_ForceFeed(player, 40, 10, TICRATE, 40 + min(damage, 100)*2);
|
||||
}
|
||||
|
||||
// Killing dead. Just for kicks.
|
||||
@@ -2640,19 +2503,11 @@ boolean P_DamageMobj(mobj_t *target, mobj_t *inflictor, mobj_t *source, INT32 da
|
||||
}
|
||||
else
|
||||
{
|
||||
switch (target->type)
|
||||
{
|
||||
case MT_EGGMOBILE2: // egg slimer
|
||||
if (target->health < target->info->damage) // in pinch phase
|
||||
{
|
||||
P_SetMobjState(target, target->info->meleestate); // go to pinch pain state
|
||||
break;
|
||||
}
|
||||
/* FALLTHRU */
|
||||
default:
|
||||
// egg slimer
|
||||
if (target->type == MT_EGGMOBILE2 && (target->health < target->info->damage)) // in pinch phase
|
||||
P_SetMobjState(target, target->info->meleestate); // go to pinch pain state
|
||||
else
|
||||
P_SetMobjState(target, target->info->painstate);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if (!P_MobjWasRemoved(target))
|
||||
@@ -2664,6 +2519,7 @@ boolean P_DamageMobj(mobj_t *target, mobj_t *inflictor, mobj_t *source, INT32 da
|
||||
// if not intent on another player,
|
||||
// chase after this one
|
||||
P_SetTarget(&target->target, source);
|
||||
|
||||
if (target->state == &states[target->info->spawnstate] && target->info->seestate != S_NULL)
|
||||
{
|
||||
if (player)
|
||||
|
||||
+3
-17
@@ -158,7 +158,9 @@ extern consvar_t cv_tiltsmoothing;
|
||||
|
||||
extern consvar_t cv_actionmovie;
|
||||
|
||||
extern consvar_t cv_lookbackmom;
|
||||
extern consvar_t cv_lookbackmom[MAXSPLITSCREENPLAYERS];
|
||||
|
||||
extern consvar_t cv_verticallook[MAXSPLITSCREENPLAYERS];
|
||||
|
||||
extern fixed_t t_cam_rotate[MAXSPLITSCREENPLAYERS];
|
||||
|
||||
@@ -235,7 +237,6 @@ void P_PlayRinglossSound(mobj_t *source, mobj_t *damager);
|
||||
void P_PlayDeathSound(mobj_t *source);
|
||||
void P_PlayVictorySound(mobj_t *source);
|
||||
|
||||
|
||||
//
|
||||
// P_MOBJ
|
||||
//
|
||||
@@ -432,25 +433,11 @@ extern struct minimapinfo
|
||||
//
|
||||
// P_INTER
|
||||
//
|
||||
typedef struct BasicFF_s
|
||||
{
|
||||
INT32 ForceX; ///< The X of the Force's Vel
|
||||
INT32 ForceY; ///< The Y of the Force's Vel
|
||||
const player_t *player; ///< Player of Rumble
|
||||
//All
|
||||
UINT32 Duration; ///< The total duration of the effect, in microseconds
|
||||
INT32 Gain; ///< /The gain to be applied to the effect, in the range from 0 through 10,000.
|
||||
//All, CONSTANTFORCE �10,000 to 10,000
|
||||
INT32 Magnitude; ///< Magnitude of the effect, in the range from 0 through 10,000.
|
||||
} BasicFF_t;
|
||||
|
||||
// replace damage magic numbers with smth readable
|
||||
#define DMG_INSTAKILL 10000
|
||||
#define DMG_SPECTATOR 42000
|
||||
|
||||
void P_ForceFeed(const player_t *player, INT32 attack, INT32 fade, tic_t duration, INT32 period);
|
||||
void P_ForceConstant(const BasicFF_t *FFInfo);
|
||||
void P_RampConstant(const BasicFF_t *FFInfo, INT32 Start, INT32 End);
|
||||
void P_RemoveShield(player_t *player);
|
||||
boolean P_DamageMobj(mobj_t *target, mobj_t *inflictor, mobj_t *source, INT32 damage);
|
||||
void P_KillMobj(mobj_t *target, mobj_t *inflictor, mobj_t *source);
|
||||
@@ -487,7 +474,6 @@ boolean P_Teleport(mobj_t *thing, fixed_t x, fixed_t y, fixed_t z, angle_t angle
|
||||
boolean P_SetMobjStateNF(mobj_t *mobj, statenum_t state);
|
||||
boolean P_CheckMissileSpawn(mobj_t *th);
|
||||
void P_Thrust(mobj_t *mo, angle_t angle, fixed_t move);
|
||||
void P_DoSuperTransformation(player_t *player, boolean giverings);
|
||||
void P_ExplodeMissile(mobj_t *mo);
|
||||
void P_CheckGravity(mobj_t *mo, boolean affect);
|
||||
|
||||
|
||||
+33
-52
@@ -26,6 +26,7 @@
|
||||
#include "s_sound.h"
|
||||
#include "w_wad.h"
|
||||
#include "k_kart.h" // SRB2kart 011617
|
||||
#include "k_stats.h"
|
||||
|
||||
#include "hu_stuff.h" // SRB2kart
|
||||
#include "i_system.h" // SRB2kart
|
||||
@@ -332,11 +333,11 @@ static boolean PIT_CheckThing(mobj_t *thing)
|
||||
return true;
|
||||
|
||||
#ifdef SEENAMES
|
||||
// Do name checks all the way up here
|
||||
// So that NOTHING ELSE can see MT_NAMECHECK because it is client-side.
|
||||
// Do name checks all the way up here
|
||||
// So that NOTHING ELSE can see MT_NAMECHECK because it is client-side.
|
||||
if (tmthing->type == MT_NAMECHECK)
|
||||
{
|
||||
// Ignore things that aren't players, ignore spectators, ignore yourself.
|
||||
// Ignore things that aren't players, ignore spectators, ignore yourself.
|
||||
// (also don't bother to check that tmthing->target->player is non-NULL because we're not actually using it here.)
|
||||
if (!thing->player || thing->player->spectator || (tmthing->target && thing->player == tmthing->target->player))
|
||||
return true;
|
||||
@@ -504,17 +505,15 @@ static boolean PIT_CheckThing(mobj_t *thing)
|
||||
// check for skulls slamming into things
|
||||
if (tmthing->flags2 & MF2_SKULLFLY)
|
||||
{
|
||||
{
|
||||
// see if it went over / under
|
||||
if (tmthing->z > thing->z + thing->height)
|
||||
return true; // overhead
|
||||
if (tmthing->z + tmthing->height < thing->z)
|
||||
return true; // underneath
|
||||
// see if it went over / under
|
||||
if (tmthing->z > thing->z + thing->height)
|
||||
return true; // overhead
|
||||
if (tmthing->z + tmthing->height < thing->z)
|
||||
return true; // underneath
|
||||
|
||||
tmthing->flags2 &= ~MF2_SKULLFLY;
|
||||
tmthing->momx = tmthing->momy = tmthing->momz = 0;
|
||||
return false; // stop moving
|
||||
}
|
||||
tmthing->flags2 &= ~MF2_SKULLFLY;
|
||||
tmthing->momx = tmthing->momy = tmthing->momz = 0;
|
||||
return false; // stop moving
|
||||
}
|
||||
|
||||
// SRB2kart 011617 - Colission[sic] code for kart items //{
|
||||
@@ -542,10 +541,6 @@ static boolean PIT_CheckThing(mobj_t *thing)
|
||||
if (thing->health)
|
||||
P_KillMobj(thing, tmthing, tmthing);
|
||||
|
||||
/*if (tmthing->player && (tmthing->player->kartstuff[k_invincibilitytimer] > 0
|
||||
|| tmthing->player->kartstuff[k_growshrinktimer] > 0))
|
||||
return true;*/
|
||||
|
||||
K_KartBouncing(tmthing, thing, false, true);
|
||||
return false;
|
||||
}
|
||||
@@ -707,6 +702,8 @@ static boolean PIT_CheckThing(mobj_t *thing)
|
||||
|
||||
if (thing->type == MT_PLAYER)
|
||||
{
|
||||
K_StatPlayerSink(thing->player, P_MobjWasRemoved(tmthing->target) ? NULL : tmthing->target->player);
|
||||
|
||||
S_StartSound(NULL, sfx_bsnipe); //let all players hear it.
|
||||
HU_SetCEchoFlags(0);
|
||||
HU_SetCEchoDuration(5);
|
||||
@@ -726,7 +723,7 @@ static boolean PIT_CheckThing(mobj_t *thing)
|
||||
if (tmthing->z + tmthing->height < thing->z)
|
||||
return true; // underneath
|
||||
|
||||
if (!(thing->type == MT_PLAYER))
|
||||
if (thing->type != MT_PLAYER)
|
||||
return true;
|
||||
|
||||
if (thing->player && thing->player->powers[pw_flashing])
|
||||
@@ -974,6 +971,8 @@ static boolean PIT_CheckThing(mobj_t *thing)
|
||||
if ((thing->target == tmthing) && (thing->threshold > 0))
|
||||
return true;
|
||||
|
||||
K_StatPlayerSink(tmthing->player, P_MobjWasRemoved(thing->target) ? NULL : thing->target->player);
|
||||
|
||||
S_StartSound(NULL, sfx_cgot); //let all players hear it.
|
||||
HU_SetCEchoFlags(0);
|
||||
HU_SetCEchoDuration(5);
|
||||
@@ -1694,7 +1693,7 @@ boolean P_CheckPosition(mobj_t *thing, fixed_t x, fixed_t y)
|
||||
INT32 xl, xh, yl, yh, bx, by;
|
||||
subsector_t *newsubsec;
|
||||
boolean blockval = true;
|
||||
|
||||
|
||||
ps_checkposition_calls.value.i++;
|
||||
|
||||
I_Assert(thing != NULL);
|
||||
@@ -1744,7 +1743,7 @@ boolean P_CheckPosition(mobj_t *thing, fixed_t x, fixed_t y)
|
||||
if (!(rover->flags & FF_EXISTS))
|
||||
continue;
|
||||
|
||||
topheight = P_GetFOFTopZ(thing, newsubsec->sector, rover, x, y, NULL);
|
||||
topheight = P_GetFOFTopZ(thing, newsubsec->sector, rover, x, y, NULL);
|
||||
bottomheight = P_GetFOFBottomZ(thing, newsubsec->sector, rover, x, y, NULL);
|
||||
|
||||
if ((rover->flags & (FF_SWIMMABLE|FF_GOOWATER)) == (FF_SWIMMABLE|FF_GOOWATER) && !(thing->flags & MF_NOGRAVITY))
|
||||
@@ -1766,14 +1765,16 @@ boolean P_CheckPosition(mobj_t *thing, fixed_t x, fixed_t y)
|
||||
// Land on the top or the bottom, depending on gravity flip.
|
||||
if (!(thing->eflags & MFE_VERTICALFLIP) && thing->z >= topheight - sinklevel && thing->momz <= 0)
|
||||
{
|
||||
if (tmfloorz < topheight - sinklevel) {
|
||||
if (tmfloorz < topheight - sinklevel)
|
||||
{
|
||||
tmfloorz = topheight - sinklevel;
|
||||
tmfloorslope = *rover->t_slope;
|
||||
}
|
||||
}
|
||||
else if (thing->eflags & MFE_VERTICALFLIP && thingtop <= bottomheight + sinklevel && thing->momz >= 0)
|
||||
{
|
||||
if (tmceilingz > bottomheight + sinklevel) {
|
||||
if (tmceilingz > bottomheight + sinklevel)
|
||||
{
|
||||
tmceilingz = bottomheight + sinklevel;
|
||||
tmceilingslope = *rover->b_slope;
|
||||
}
|
||||
@@ -1795,7 +1796,8 @@ boolean P_CheckPosition(mobj_t *thing, fixed_t x, fixed_t y)
|
||||
{
|
||||
if (thing->z < topheight && bottomheight < thingtop)
|
||||
{
|
||||
if (tmfloorz < thing->z) {
|
||||
if (tmfloorz < thing->z)
|
||||
{
|
||||
tmfloorz = thing->z;
|
||||
tmfloorslope = NULL;
|
||||
}
|
||||
@@ -1815,6 +1817,7 @@ boolean P_CheckPosition(mobj_t *thing, fixed_t x, fixed_t y)
|
||||
tmfloorz = tmdropoffz = topheight;
|
||||
tmfloorslope = *rover->t_slope;
|
||||
}
|
||||
|
||||
if (bottomheight < tmceilingz && abs(delta1) >= abs(delta2)
|
||||
&& !(rover->flags & FF_PLATFORM)
|
||||
&& !(thing->type == MT_SKIM && (rover->flags & FF_SWIMMABLE)))
|
||||
@@ -2170,7 +2173,6 @@ boolean P_TryCameraMove(fixed_t x, fixed_t y, camera_t *thiscam)
|
||||
subsector_t *s;
|
||||
|
||||
boolean retval = true;
|
||||
boolean itsatwodlevel = false;
|
||||
UINT8 i;
|
||||
|
||||
floatok = false;
|
||||
@@ -2183,22 +2185,7 @@ boolean P_TryCameraMove(fixed_t x, fixed_t y, camera_t *thiscam)
|
||||
else
|
||||
s = thiscam->subsector;
|
||||
|
||||
if (twodlevel)
|
||||
itsatwodlevel = true;
|
||||
else
|
||||
{
|
||||
for (i = 0; i <= splitscreen; i++)
|
||||
{
|
||||
if (thiscam == &camera[i] && players[displayplayers[i]].mo
|
||||
&& (players[displayplayers[i]].mo->flags2 & MF2_TWOD))
|
||||
{
|
||||
itsatwodlevel = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (!itsatwodlevel && players[displayplayers[0]].mo)
|
||||
if (players[displayplayers[0]].mo)
|
||||
{
|
||||
fixed_t tryx = thiscam->x;
|
||||
fixed_t tryy = thiscam->y;
|
||||
@@ -2265,7 +2252,7 @@ boolean P_TryCameraMove(fixed_t x, fixed_t y, camera_t *thiscam)
|
||||
}
|
||||
else
|
||||
{
|
||||
tmfloorz = P_CameraGetFloorZ(thiscam, thiscam->subsector->sector, x, y, NULL);
|
||||
tmfloorz = P_CameraGetFloorZ(thiscam, thiscam->subsector->sector, x, y, NULL);
|
||||
tmceilingz = P_CameraGetCeilingZ(thiscam, thiscam->subsector->sector, x, y, NULL);
|
||||
}
|
||||
|
||||
@@ -4097,10 +4084,7 @@ void P_MapEnd(void)
|
||||
fixed_t P_FloorzAtPos(fixed_t x, fixed_t y, fixed_t z, fixed_t height)
|
||||
{
|
||||
sector_t *sec = R_PointInSubsector(x, y)->sector;
|
||||
fixed_t floorz = sec->floorheight;
|
||||
|
||||
if (sec->f_slope)
|
||||
floorz = P_GetZAt(sec->f_slope, x, y);
|
||||
fixed_t floorz = P_GetSectorFloorZAt(sec, x, y);
|
||||
|
||||
// Intercept the stupid 'fall through 3dfloors' bug Tails 03-17-2002
|
||||
if (sec->ffloors)
|
||||
@@ -4111,19 +4095,15 @@ fixed_t P_FloorzAtPos(fixed_t x, fixed_t y, fixed_t z, fixed_t height)
|
||||
for (rover = sec->ffloors; rover; rover = rover->next)
|
||||
{
|
||||
fixed_t topheight, bottomheight;
|
||||
|
||||
if (!(rover->flags & FF_EXISTS))
|
||||
continue;
|
||||
|
||||
if ((!(rover->flags & FF_SOLID || rover->flags & FF_QUICKSAND) || (rover->flags & FF_SWIMMABLE)))
|
||||
continue;
|
||||
|
||||
topheight = *rover->topheight;
|
||||
bottomheight = *rover->bottomheight;
|
||||
|
||||
if (*rover->t_slope)
|
||||
topheight = P_GetZAt(*rover->t_slope, x, y);
|
||||
if (*rover->b_slope)
|
||||
bottomheight = P_GetZAt(*rover->b_slope, x, y);
|
||||
topheight = P_GetFFloorTopZAt (rover, x, y);
|
||||
bottomheight = P_GetFFloorBottomZAt(rover, x, y);
|
||||
|
||||
if (rover->flags & FF_QUICKSAND)
|
||||
{
|
||||
@@ -4137,6 +4117,7 @@ fixed_t P_FloorzAtPos(fixed_t x, fixed_t y, fixed_t z, fixed_t height)
|
||||
|
||||
delta1 = z - (bottomheight + ((topheight - bottomheight)/2));
|
||||
delta2 = thingtop - (bottomheight + ((topheight - bottomheight)/2));
|
||||
|
||||
if (topheight > floorz && abs(delta1) < abs(delta2))
|
||||
floorz = topheight;
|
||||
}
|
||||
|
||||
+10
-26
@@ -294,50 +294,34 @@ void P_CameraLineOpening(line_t *linedef)
|
||||
// If you can see through it, why not move the camera through it too?
|
||||
if (front->camsec >= 0)
|
||||
{
|
||||
frontfloor = sectors[front->camsec].floorheight;
|
||||
frontceiling = sectors[front->camsec].ceilingheight;
|
||||
if (sectors[front->camsec].f_slope)
|
||||
frontfloor = P_GetZAt(sectors[front->camsec].f_slope, camera[0].x, camera[0].y);
|
||||
if (sectors[front->camsec].c_slope)
|
||||
frontceiling = P_GetZAt(sectors[front->camsec].c_slope, camera[0].x, camera[0].y);
|
||||
frontfloor = P_GetSectorFloorZAt (§ors[front->camsec], camera[0].x, camera[0].y);
|
||||
frontceiling = P_GetSectorCeilingZAt(§ors[front->camsec], camera[0].x, camera[0].y);
|
||||
|
||||
}
|
||||
else if (front->heightsec >= 0)
|
||||
{
|
||||
frontfloor = sectors[front->heightsec].floorheight;
|
||||
frontceiling = sectors[front->heightsec].ceilingheight;
|
||||
if (sectors[front->heightsec].f_slope)
|
||||
frontfloor = P_GetZAt(sectors[front->heightsec].f_slope, camera[0].x, camera[0].y);
|
||||
if (sectors[front->heightsec].c_slope)
|
||||
frontceiling = P_GetZAt(sectors[front->heightsec].c_slope, camera[0].x, camera[0].y);
|
||||
frontfloor = P_GetSectorFloorZAt (§ors[front->heightsec], camera[0].x, camera[0].y);
|
||||
frontceiling = P_GetSectorCeilingZAt(§ors[front->heightsec], camera[0].x, camera[0].y);
|
||||
}
|
||||
else
|
||||
{
|
||||
frontfloor = P_CameraGetFloorZ(mapcampointer, front, tmx, tmy, linedef);
|
||||
frontfloor = P_CameraGetFloorZ (mapcampointer, front, tmx, tmy, linedef);
|
||||
frontceiling = P_CameraGetCeilingZ(mapcampointer, front, tmx, tmy, linedef);
|
||||
}
|
||||
|
||||
if (back->camsec >= 0)
|
||||
{
|
||||
backfloor = sectors[back->camsec].floorheight;
|
||||
backceiling = sectors[back->camsec].ceilingheight;
|
||||
if (sectors[back->camsec].f_slope)
|
||||
frontfloor = P_GetZAt(sectors[back->camsec].f_slope, camera[0].x, camera[0].y);
|
||||
if (sectors[back->camsec].c_slope)
|
||||
frontceiling = P_GetZAt(sectors[back->camsec].c_slope, camera[0].x, camera[0].y);
|
||||
backfloor = P_GetSectorFloorZAt (§ors[back->camsec], camera[0].x, camera[0].y);
|
||||
backceiling = P_GetSectorCeilingZAt(§ors[back->camsec], camera[0].x, camera[0].y);
|
||||
}
|
||||
else if (back->heightsec >= 0)
|
||||
{
|
||||
backfloor = sectors[back->heightsec].floorheight;
|
||||
backceiling = sectors[back->heightsec].ceilingheight;
|
||||
if (sectors[back->heightsec].f_slope)
|
||||
frontfloor = P_GetZAt(sectors[back->heightsec].f_slope, camera[0].x, camera[0].y);
|
||||
if (sectors[back->heightsec].c_slope)
|
||||
frontceiling = P_GetZAt(sectors[back->heightsec].c_slope, camera[0].x, camera[0].y);
|
||||
backfloor = P_GetSectorFloorZAt (§ors[back->heightsec], camera[0].x, camera[0].y);
|
||||
backceiling = P_GetSectorCeilingZAt(§ors[back->heightsec], camera[0].x, camera[0].y);
|
||||
}
|
||||
else
|
||||
{
|
||||
backfloor = P_CameraGetFloorZ(mapcampointer, back, tmx, tmy, linedef);
|
||||
backfloor = P_CameraGetFloorZ(mapcampointer, back, tmx, tmy, linedef);
|
||||
backceiling = P_CameraGetCeilingZ(mapcampointer, back, tmx, tmy, linedef);
|
||||
}
|
||||
|
||||
|
||||
+157
-303
@@ -172,20 +172,28 @@ boolean P_SetPlayerMobjState(mobj_t *mobj, statenum_t state)
|
||||
{
|
||||
// Start flashing, since you've landed.
|
||||
player->powers[pw_flashing] = K_GetKartFlashing(player)-1;
|
||||
//P_DoPityCheck(player);
|
||||
}
|
||||
|
||||
// Set animation state
|
||||
// The pflags version of this was just as convoluted.
|
||||
// Rewriten for SRB2kart ... though I don't know what this is.
|
||||
if ((state >= S_KART_STND1 && state <= S_KART_STND2_R) || state == S_KART_SQUISH || state == S_KART_SPIN)
|
||||
player->panim = PA_IDLE;
|
||||
else if (state >= S_KART_WALK1 && state <= S_KART_WALK2_R)
|
||||
player->panim = PA_WALK;
|
||||
else if (state >= S_KART_RUN1 && state <= S_KART_DRIFT2_R)
|
||||
player->panim = PA_RUN;
|
||||
else
|
||||
player->panim = PA_ETC;
|
||||
switch(state)
|
||||
{
|
||||
case S_KART_STND1...S_KART_STND2_R:
|
||||
case S_KART_SQUISH:
|
||||
case S_KART_SPIN:
|
||||
player->panim = PA_IDLE;
|
||||
break;
|
||||
case S_KART_WALK1...S_KART_WALK2_R:
|
||||
player->panim = PA_WALK;
|
||||
break;
|
||||
case S_KART_RUN1...S_KART_DRIFT2_R:
|
||||
player->panim = PA_RUN;
|
||||
break;
|
||||
default:
|
||||
player->panim = PA_ETC;
|
||||
break;
|
||||
}
|
||||
|
||||
if (recursion++) // if recursion detected,
|
||||
memset(seenstate = tempstate, 0, sizeof tempstate); // clear state table
|
||||
@@ -494,12 +502,12 @@ static fixed_t HighestOnLine(fixed_t radius, fixed_t x, fixed_t y, line_t *line,
|
||||
/*CONS_Printf("BEFORE: v1 = %f %f %f\n",
|
||||
FIXED_TO_FLOAT(v1.x),
|
||||
FIXED_TO_FLOAT(v1.y),
|
||||
FIXED_TO_FLOAT(P_GetZAt(slope, v1.x, v1.y))
|
||||
FIXED_TO_FLOAT(P_GetSlopeZAt(slope, v1.x, v1.y))
|
||||
);
|
||||
CONS_Printf(" v2 = %f %f %f\n",
|
||||
FIXED_TO_FLOAT(v2.x),
|
||||
FIXED_TO_FLOAT(v2.y),
|
||||
FIXED_TO_FLOAT(P_GetZAt(slope, v2.x, v2.y))
|
||||
FIXED_TO_FLOAT(P_GetSlopeZAt(slope, v2.x, v2.y))
|
||||
);*/
|
||||
|
||||
if (abs(v1.x-x) > radius) {
|
||||
@@ -557,24 +565,24 @@ static fixed_t HighestOnLine(fixed_t radius, fixed_t x, fixed_t y, line_t *line,
|
||||
/*CONS_Printf("AFTER: v1 = %f %f %f\n",
|
||||
FIXED_TO_FLOAT(v1.x),
|
||||
FIXED_TO_FLOAT(v1.y),
|
||||
FIXED_TO_FLOAT(P_GetZAt(slope, v1.x, v1.y))
|
||||
FIXED_TO_FLOAT(P_GetSlopeZAt(slope, v1.x, v1.y))
|
||||
);
|
||||
CONS_Printf(" v2 = %f %f %f\n",
|
||||
FIXED_TO_FLOAT(v2.x),
|
||||
FIXED_TO_FLOAT(v2.y),
|
||||
FIXED_TO_FLOAT(P_GetZAt(slope, v2.x, v2.y))
|
||||
FIXED_TO_FLOAT(P_GetSlopeZAt(slope, v2.x, v2.y))
|
||||
);*/
|
||||
|
||||
// Return the higher of the two points
|
||||
if (actuallylowest)
|
||||
return min(
|
||||
P_GetZAt(slope, v1.x, v1.y),
|
||||
P_GetZAt(slope, v2.x, v2.y)
|
||||
P_GetSlopeZAt(slope, v1.x, v1.y),
|
||||
P_GetSlopeZAt(slope, v2.x, v2.y)
|
||||
);
|
||||
else
|
||||
return max(
|
||||
P_GetZAt(slope, v1.x, v1.y),
|
||||
P_GetZAt(slope, v2.x, v2.y)
|
||||
P_GetSlopeZAt(slope, v1.x, v1.y),
|
||||
P_GetSlopeZAt(slope, v2.x, v2.y)
|
||||
);
|
||||
}
|
||||
|
||||
@@ -582,6 +590,7 @@ fixed_t P_MobjFloorZ(mobj_t *mobj, sector_t *sector, sector_t *boundsec, fixed_t
|
||||
{
|
||||
I_Assert(mobj != NULL);
|
||||
I_Assert(sector != NULL);
|
||||
|
||||
if (sector->f_slope)
|
||||
{
|
||||
fixed_t testx, testy;
|
||||
@@ -609,7 +618,7 @@ fixed_t P_MobjFloorZ(mobj_t *mobj, sector_t *sector, sector_t *boundsec, fixed_t
|
||||
|
||||
// If the highest point is in the sector, then we have it easy! Just get the Z at that point
|
||||
if (R_PointInSubsector(testx, testy)->sector == (boundsec ? boundsec : sector))
|
||||
return P_GetZAt(slope, testx, testy);
|
||||
return P_GetSlopeZAt(slope, testx, testy);
|
||||
|
||||
// If boundsec is set, we're looking for specials. In that case, iterate over every line in this sector to find the TRUE highest/lowest point
|
||||
if (perfect)
|
||||
@@ -648,10 +657,11 @@ fixed_t P_MobjFloorZ(mobj_t *mobj, sector_t *sector, sector_t *boundsec, fixed_t
|
||||
// If we're just testing for base sector location (no collision line), just go for the center's spot...
|
||||
// It'll get fixed when we test for collision anyway, and the final result can't be lower than this
|
||||
if (line == NULL)
|
||||
return P_GetZAt(slope, x, y);
|
||||
return P_GetSlopeZAt(slope, x, y);
|
||||
|
||||
return HighestOnLine(mobj->radius, x, y, line, slope, lowest);
|
||||
} else // Well, that makes it easy. Just get the floor height
|
||||
}
|
||||
else // Well, that makes it easy. Just get the floor height
|
||||
return sector->floorheight;
|
||||
}
|
||||
|
||||
@@ -659,6 +669,7 @@ fixed_t P_MobjCeilingZ(mobj_t *mobj, sector_t *sector, sector_t *boundsec, fixed
|
||||
{
|
||||
I_Assert(mobj != NULL);
|
||||
I_Assert(sector != NULL);
|
||||
|
||||
if (sector->c_slope)
|
||||
{
|
||||
fixed_t testx, testy;
|
||||
@@ -686,7 +697,7 @@ fixed_t P_MobjCeilingZ(mobj_t *mobj, sector_t *sector, sector_t *boundsec, fixed
|
||||
|
||||
// If the highest point is in the sector, then we have it easy! Just get the Z at that point
|
||||
if (R_PointInSubsector(testx, testy)->sector == (boundsec ? boundsec : sector))
|
||||
return P_GetZAt(slope, testx, testy);
|
||||
return P_GetSlopeZAt(slope, testx, testy);
|
||||
|
||||
// If boundsec is set, we're looking for specials. In that case, iterate over every line in this sector to find the TRUE highest/lowest point
|
||||
if (perfect)
|
||||
@@ -725,10 +736,11 @@ fixed_t P_MobjCeilingZ(mobj_t *mobj, sector_t *sector, sector_t *boundsec, fixed
|
||||
// If we're just testing for base sector location (no collision line), just go for the center's spot...
|
||||
// It'll get fixed when we test for collision anyway, and the final result can't be lower than this
|
||||
if (line == NULL)
|
||||
return P_GetZAt(slope, x, y);
|
||||
return P_GetSlopeZAt(slope, x, y);
|
||||
|
||||
return HighestOnLine(mobj->radius, x, y, line, slope, lowest);
|
||||
} else // Well, that makes it easy. Just get the ceiling height
|
||||
}
|
||||
else // Well, that makes it easy. Just get the ceiling height
|
||||
return sector->ceilingheight;
|
||||
}
|
||||
|
||||
@@ -765,7 +777,7 @@ fixed_t P_CameraFloorZ(camera_t *mobj, sector_t *sector, sector_t *boundsec, fix
|
||||
|
||||
// If the highest point is in the sector, then we have it easy! Just get the Z at that point
|
||||
if (R_PointInSubsector(testx, testy)->sector == (boundsec ? boundsec : sector))
|
||||
return P_GetZAt(slope, testx, testy);
|
||||
return P_GetSlopeZAt(slope, testx, testy);
|
||||
|
||||
// If boundsec is set, we're looking for specials. In that case, iterate over every line in this sector to find the TRUE highest/lowest point
|
||||
if (perfect)
|
||||
@@ -804,10 +816,11 @@ fixed_t P_CameraFloorZ(camera_t *mobj, sector_t *sector, sector_t *boundsec, fix
|
||||
// If we're just testing for base sector location (no collision line), just go for the center's spot...
|
||||
// It'll get fixed when we test for collision anyway, and the final result can't be lower than this
|
||||
if (line == NULL)
|
||||
return P_GetZAt(slope, x, y);
|
||||
return P_GetSlopeZAt(slope, x, y);
|
||||
|
||||
return HighestOnLine(mobj->radius, x, y, line, slope, lowest);
|
||||
} else // Well, that makes it easy. Just get the floor height
|
||||
}
|
||||
else // Well, that makes it easy. Just get the floor height
|
||||
return sector->floorheight;
|
||||
}
|
||||
|
||||
@@ -843,7 +856,7 @@ fixed_t P_CameraCeilingZ(camera_t *mobj, sector_t *sector, sector_t *boundsec, f
|
||||
|
||||
// If the highest point is in the sector, then we have it easy! Just get the Z at that point
|
||||
if (R_PointInSubsector(testx, testy)->sector == (boundsec ? boundsec : sector))
|
||||
return P_GetZAt(slope, testx, testy);
|
||||
return P_GetSlopeZAt(slope, testx, testy);
|
||||
|
||||
// If boundsec is set, we're looking for specials. In that case, iterate over every line in this sector to find the TRUE highest/lowest point
|
||||
if (perfect)
|
||||
@@ -882,10 +895,11 @@ fixed_t P_CameraCeilingZ(camera_t *mobj, sector_t *sector, sector_t *boundsec, f
|
||||
// If we're just testing for base sector location (no collision line), just go for the center's spot...
|
||||
// It'll get fixed when we test for collision anyway, and the final result can't be lower than this
|
||||
if (line == NULL)
|
||||
return P_GetZAt(slope, x, y);
|
||||
return P_GetSlopeZAt(slope, x, y);
|
||||
|
||||
return HighestOnLine(mobj->radius, x, y, line, slope, lowest);
|
||||
} else // Well, that makes it easy. Just get the ceiling height
|
||||
}
|
||||
else // Well, that makes it easy. Just get the ceiling height
|
||||
return sector->ceilingheight;
|
||||
}
|
||||
static void P_PlayerFlip(mobj_t *mo)
|
||||
@@ -1110,9 +1124,6 @@ void P_CheckGravity(mobj_t *mo, boolean affect)
|
||||
}
|
||||
}
|
||||
|
||||
#define STOPSPEED (FRACUNIT)
|
||||
//#define FRICTION (ORIG_FRICTION) // 0.90625
|
||||
|
||||
//
|
||||
// P_SceneryXYFriction
|
||||
//
|
||||
@@ -1121,8 +1132,8 @@ static void P_SceneryXYFriction(mobj_t *mo, fixed_t oldx, fixed_t oldy)
|
||||
I_Assert(mo != NULL);
|
||||
I_Assert(!P_MobjWasRemoved(mo));
|
||||
|
||||
if (abs(mo->momx) < FixedMul(STOPSPEED/32, mo->scale)
|
||||
&& abs(mo->momy) < FixedMul(STOPSPEED/32, mo->scale))
|
||||
if (abs(mo->momx) < FixedMul(FRACUNIT/32, mo->scale)
|
||||
&& abs(mo->momy) < FixedMul(FRACUNIT/32, mo->scale))
|
||||
{
|
||||
mo->momx = 0;
|
||||
mo->momy = 0;
|
||||
@@ -1131,13 +1142,13 @@ static void P_SceneryXYFriction(mobj_t *mo, fixed_t oldx, fixed_t oldy)
|
||||
{
|
||||
if ((oldx == mo->x) && (oldy == mo->y)) // didn't go anywhere
|
||||
{
|
||||
mo->momx = FixedMul(mo->momx,ORIG_FRICTION);
|
||||
mo->momy = FixedMul(mo->momy,ORIG_FRICTION);
|
||||
mo->momx = FixedMul(mo->momx, ORIG_FRICTION);
|
||||
mo->momy = FixedMul(mo->momy, ORIG_FRICTION);
|
||||
}
|
||||
else
|
||||
{
|
||||
mo->momx = FixedMul(mo->momx,mo->friction);
|
||||
mo->momy = FixedMul(mo->momy,mo->friction);
|
||||
mo->momx = FixedMul(mo->momx, mo->friction);
|
||||
mo->momy = FixedMul(mo->momy, mo->friction);
|
||||
}
|
||||
|
||||
if (mo->type == MT_CANNONBALLDECOR)
|
||||
@@ -1169,12 +1180,12 @@ static void P_XYFriction(mobj_t *mo, fixed_t oldx, fixed_t oldy)
|
||||
// spinning friction
|
||||
if (player->pflags & PF_SPINNING && (player->rmomx || player->rmomy) && !(player->pflags & PF_STARTDASH))
|
||||
{
|
||||
const fixed_t ns = FixedDiv(549*ORIG_FRICTION,500*FRACUNIT); //const fixed_t ns = FixedDiv(549*FRICTION,500*FRACUNIT);
|
||||
const fixed_t ns = FixedDiv(549*ORIG_FRICTION, 500*FRACUNIT); //const fixed_t ns = FixedDiv(549*FRICTION,500*FRACUNIT);
|
||||
mo->momx = FixedMul(mo->momx, ns);
|
||||
mo->momy = FixedMul(mo->momy, ns);
|
||||
}
|
||||
else if (abs(player->rmomx) < FixedMul(STOPSPEED, mo->scale)
|
||||
&& abs(player->rmomy) < FixedMul(STOPSPEED, mo->scale)
|
||||
else if (abs(player->rmomx) < FixedMul(FRACUNIT, mo->scale)
|
||||
&& abs(player->rmomy) < FixedMul(FRACUNIT, mo->scale)
|
||||
&& (!(player->cmd.forwardmove && !(twodlevel || mo->flags2 & MF2_TWOD)) && !player->cmd.sidemove && !(player->pflags & PF_SPINNING))
|
||||
&& !(player->mo->standingslope && (!(player->mo->standingslope->flags & SL_NOPHYSICS)) && (abs(player->mo->standingslope->zdelta) >= FRACUNIT/2))
|
||||
)
|
||||
@@ -1904,9 +1915,7 @@ boolean P_CheckSolidLava(mobj_t *mo, ffloor_t *rover)
|
||||
I_Assert(mo != NULL);
|
||||
I_Assert(!P_MobjWasRemoved(mo));
|
||||
|
||||
fixed_t topheight =
|
||||
*rover->t_slope ? P_GetZAt(*rover->t_slope, mo->x, mo->y) :
|
||||
*rover->topheight;
|
||||
fixed_t topheight = P_GetFFloorTopZAt(rover, mo->x, mo->y);
|
||||
|
||||
if (rover->flags & FF_SWIMMABLE && GETSECSPECIAL(rover->master->frontsector->special, 1) == 3
|
||||
&& !(rover->master->flags & ML_BLOCKMONSTERS)
|
||||
@@ -2230,9 +2239,9 @@ static boolean P_ZMovement(mobj_t *mo)
|
||||
|
||||
if (mo->type == MT_BIGTUMBLEWEED || mo->type == MT_LITTLETUMBLEWEED)
|
||||
{
|
||||
if (abs(mom.x) < FixedMul(STOPSPEED, mo->scale)
|
||||
&& abs(mom.y) < FixedMul(STOPSPEED, mo->scale)
|
||||
&& abs(mom.z) < FixedMul(STOPSPEED*3, mo->scale))
|
||||
if (abs(mom.x) < FixedMul(FRACUNIT, mo->scale)
|
||||
&& abs(mom.y) < FixedMul(FRACUNIT, mo->scale)
|
||||
&& abs(mom.z) < FixedMul(FRACUNIT*3, mo->scale))
|
||||
{
|
||||
if (mo->flags2 & MF2_AMBUSH)
|
||||
{
|
||||
@@ -2273,9 +2282,9 @@ static boolean P_ZMovement(mobj_t *mo)
|
||||
mom.z /= 2; // Rocks not so bouncy
|
||||
|
||||
if (!mo->fuse
|
||||
&& abs(mom.x) < FixedMul(STOPSPEED*2, mo->scale)
|
||||
&& abs(mom.y) < FixedMul(STOPSPEED*2, mo->scale)
|
||||
&& abs(mom.z) < FixedMul(STOPSPEED*2*3, mo->scale))
|
||||
&& abs(mom.x) < FixedMul(FRACUNIT*2, mo->scale)
|
||||
&& abs(mom.y) < FixedMul(FRACUNIT*2, mo->scale)
|
||||
&& abs(mom.z) < FixedMul(FRACUNIT*2*3, mo->scale))
|
||||
{
|
||||
//P_RemoveMobj(mo);
|
||||
//return false;
|
||||
@@ -2285,7 +2294,7 @@ static boolean P_ZMovement(mobj_t *mo)
|
||||
else if (mo->type == MT_CANNONBALLDECOR)
|
||||
{
|
||||
mom.z /= 2;
|
||||
if (abs(mom.z) < FixedMul(STOPSPEED*3, mo->scale))
|
||||
if (abs(mom.z) < FixedMul(FRACUNIT*3, mo->scale))
|
||||
mom.z = 0;
|
||||
}
|
||||
}
|
||||
@@ -2400,9 +2409,6 @@ static void P_PlayerZMovement(mobj_t *mo)
|
||||
mo->player->viewheight -= (mo->z+mo->height) - mo->ceilingz;
|
||||
else
|
||||
mo->player->viewheight -= mo->floorz - mo->z;
|
||||
|
||||
/*mo->player->deltaviewheight =
|
||||
(FixedMul(cv_viewheight.value<<FRACBITS, mo->scale) - mo->player->viewheight)>>3;*/
|
||||
}
|
||||
|
||||
// adjust height
|
||||
@@ -2468,11 +2474,6 @@ static void P_PlayerZMovement(mobj_t *mo)
|
||||
{
|
||||
mo->pmomz = 0; // We're on a new floor, don't keep doing platform movement.
|
||||
|
||||
// Squat down. Decrease viewheight for a moment after hitting the ground (hard),
|
||||
/*if (P_MobjFlip(mo)*mo->momz < -FixedMul(8*FRACUNIT, mo->scale))
|
||||
mo->player->deltaviewheight = (P_MobjFlip(mo)*mo->momz)>>3; // make sure momz is negative
|
||||
*/
|
||||
|
||||
if (!tmfloorthing || tmfloorthing->flags & (MF_PUSHABLE|MF_MONITOR)
|
||||
|| tmfloorthing->flags2 & MF2_STANDONME || tmfloorthing->type == MT_PLAYER) // Spin Attack
|
||||
{
|
||||
@@ -2580,7 +2581,6 @@ static void P_PlayerZMovement(mobj_t *mo)
|
||||
if (!(mo->player->pflags & PF_GLIDING))
|
||||
mo->player->pflags &= ~PF_JUMPED;
|
||||
mo->player->pflags &= ~PF_THOKKED;
|
||||
//mo->player->pflags &= ~PF_GLIDING;
|
||||
mo->player->jumping = 0;
|
||||
mo->player->secondjump = 0;
|
||||
mo->player->glidetime = 0;
|
||||
@@ -2882,14 +2882,8 @@ void P_MobjCheckWater(mobj_t *mobj)
|
||||
|| ((rover->flags & FF_BLOCKOTHERS) && !mobj->player)))
|
||||
continue;
|
||||
|
||||
topheight = *rover->topheight;
|
||||
bottomheight = *rover->bottomheight;
|
||||
|
||||
if (*rover->t_slope)
|
||||
topheight = P_GetZAt(*rover->t_slope, mobj->x, mobj->y);
|
||||
|
||||
if (*rover->b_slope)
|
||||
bottomheight = P_GetZAt(*rover->b_slope, mobj->x, mobj->y);
|
||||
topheight = P_GetFFloorTopZAt(rover, mobj->x, mobj->y);
|
||||
bottomheight = P_GetFFloorBottomZAt(rover, mobj->x, mobj->y);
|
||||
|
||||
if (mobj->eflags & MFE_VERTICALFLIP)
|
||||
{
|
||||
@@ -3107,14 +3101,8 @@ static void P_SceneryCheckWater(mobj_t *mobj)
|
||||
if (!(rover->flags & FF_EXISTS) || !(rover->flags & FF_SWIMMABLE) || rover->flags & FF_BLOCKOTHERS)
|
||||
continue;
|
||||
|
||||
topheight = *rover->topheight;
|
||||
bottomheight = *rover->bottomheight;
|
||||
|
||||
if (*rover->t_slope)
|
||||
topheight = P_GetZAt(*rover->t_slope, mobj->x, mobj->y);
|
||||
|
||||
if (*rover->b_slope)
|
||||
bottomheight = P_GetZAt(*rover->b_slope, mobj->x, mobj->y);
|
||||
topheight = P_GetFFloorTopZAt(rover, mobj->x, mobj->y);
|
||||
bottomheight = P_GetFFloorBottomZAt(rover, mobj->x, mobj->y);
|
||||
|
||||
if (topheight <= mobj->z
|
||||
|| bottomheight > (mobj->z + FixedMul(mobj->info->height >> 1, mobj->scale)))
|
||||
@@ -3287,30 +3275,12 @@ void P_CalcChasePostImg(player_t *player, camera_t *thiscam)
|
||||
// Process the mobj-ish required functions of the camera
|
||||
boolean P_CameraThinker(player_t *player, camera_t *thiscam, boolean resetcalled)
|
||||
{
|
||||
boolean itsatwodlevel = false;
|
||||
UINT8 i;
|
||||
|
||||
// This can happen when joining
|
||||
if (thiscam->subsector == NULL || thiscam->subsector->sector == NULL)
|
||||
return true;
|
||||
|
||||
P_CalcChasePostImg(player, thiscam);
|
||||
|
||||
if (twodlevel)
|
||||
itsatwodlevel = true;
|
||||
else
|
||||
{
|
||||
for (i = 0; i <= splitscreen; i++)
|
||||
{
|
||||
if (thiscam == &camera[i] && players[displayplayers[i]].mo
|
||||
&& (players[displayplayers[i]].mo->flags2 & MF2_TWOD))
|
||||
{
|
||||
itsatwodlevel = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (thiscam->momx || thiscam->momy)
|
||||
{
|
||||
if (!P_TryCameraMove(thiscam->x + thiscam->momx, thiscam->y + thiscam->momy, thiscam)) // Never fails for 2D mode.
|
||||
@@ -3337,9 +3307,6 @@ boolean P_CameraThinker(player_t *player, camera_t *thiscam, boolean resetcalled
|
||||
}
|
||||
}
|
||||
|
||||
if (!itsatwodlevel)
|
||||
P_CheckCameraPosition(thiscam->x, thiscam->y, thiscam);
|
||||
|
||||
thiscam->subsector = R_PointInSubsector(thiscam->x, thiscam->y);
|
||||
thiscam->floorz = tmfloorz;
|
||||
thiscam->ceilingz = tmceilingz;
|
||||
@@ -3393,9 +3360,8 @@ boolean P_CameraThinker(player_t *player, camera_t *thiscam, boolean resetcalled
|
||||
#endif
|
||||
}
|
||||
|
||||
if (itsatwodlevel
|
||||
|| (thiscam->ceilingz - thiscam->z < thiscam->height
|
||||
&& thiscam->ceilingz >= thiscam->z))
|
||||
if (thiscam->ceilingz - thiscam->z < thiscam->height
|
||||
&& thiscam->ceilingz >= thiscam->z)
|
||||
{
|
||||
thiscam->ceilingz = thiscam->z + thiscam->height;
|
||||
thiscam->floorz = thiscam->z;
|
||||
@@ -6033,20 +5999,6 @@ static void P_KoopaThinker(mobj_t *koopa)
|
||||
//
|
||||
void P_RollPitchMobj(mobj_t* mobj)
|
||||
{
|
||||
// we dont need this in dedi do we?
|
||||
if (rendermode == render_none)
|
||||
return;
|
||||
|
||||
if (P_MobjWasRemoved(mobj))
|
||||
return;
|
||||
|
||||
if (cv_sloperoll.value != 2)
|
||||
{
|
||||
mobj->sloperoll = 0;
|
||||
mobj->slopepitch = 0;
|
||||
return;
|
||||
}
|
||||
|
||||
K_RollMobjBySlopes(mobj, mobj->standingslope);
|
||||
}
|
||||
|
||||
@@ -6058,9 +6010,6 @@ angle_t P_MobjPitchAndRoll(mobj_t *mobj)
|
||||
angle_t camang = 0;
|
||||
angle_t return_angle = 0;
|
||||
|
||||
if (!cv_sloperoll.value)
|
||||
return 0;
|
||||
|
||||
if (P_MobjWasRemoved(mobj))
|
||||
return 0;
|
||||
|
||||
@@ -6100,9 +6049,9 @@ angle_t P_MobjPitchAndRoll(mobj_t *mobj)
|
||||
}
|
||||
|
||||
return_angle = FixedMul(FINECOSINE((ang) >> ANGLETOFINESHIFT), mobj->roll)
|
||||
+ FixedMul(FINESINE((ang) >> ANGLETOFINESHIFT), mobj->pitch)
|
||||
+ FixedMul(FINECOSINE((camang) >> ANGLETOFINESHIFT), mobj->sloperoll)
|
||||
+ FixedMul(FINESINE((camang) >> ANGLETOFINESHIFT), mobj->slopepitch);
|
||||
+ FixedMul(FINESINE((ang) >> ANGLETOFINESHIFT), mobj->pitch)
|
||||
+ FixedMul(FINECOSINE((camang) >> ANGLETOFINESHIFT), mobj->sloperoll)
|
||||
+ FixedMul(FINESINE((camang) >> ANGLETOFINESHIFT), mobj->slopepitch);
|
||||
|
||||
return return_angle;
|
||||
}
|
||||
@@ -6264,11 +6213,8 @@ void P_MobjThinker(mobj_t *mobj)
|
||||
return;
|
||||
}
|
||||
|
||||
if (cv_sloperoll.value == 2 && mobj->state == &states[S_SHADOW])
|
||||
{
|
||||
mobj->slopepitch = mobj->target->slopepitch;
|
||||
mobj->sloperoll = mobj->target->sloperoll;
|
||||
}
|
||||
K_RollMobjBySlopes(mobj, mobj->target->standingslope);
|
||||
|
||||
P_AddShadow(mobj);
|
||||
break;
|
||||
//{ SRB2kart mobs
|
||||
@@ -7059,15 +7005,14 @@ void P_MobjThinker(mobj_t *mobj)
|
||||
break;
|
||||
//{ SRB2kart Items - Death States
|
||||
case MT_BANANA:
|
||||
if (cv_sloperoll.value == 2 && cv_bananthrowroll.value)
|
||||
if (cv_bananthrowroll.value)
|
||||
{
|
||||
angle_t spin = FixedMul(FixedDiv(abs(mobj->momz), 8 * mobj->scale), ANGLE_67h);
|
||||
//mobj->angle -= spin;
|
||||
|
||||
if (cv_bananthrowroll.value == 1)
|
||||
mobj->sloperoll += spin; // im lazy but this makes sure the banan goes back to upright when it lands lmao
|
||||
if (cv_bananthrowroll.value == 1 && K_CheckSlopeRollDist(mobj))
|
||||
mobj->sloperoll += (angle_t)FixedMul(FixedDiv(abs(mobj->momz), 8 * mobj->scale), ANGLE_67h); // im lazy but this makes sure the banan goes back to upright when it lands lmao
|
||||
else if (cv_bananthrowroll.value == 2)
|
||||
mobj->rollangle += spin;
|
||||
mobj->rollangle += (angle_t)FixedMul(FixedDiv(abs(mobj->momz), 8 * mobj->scale), ANGLE_67h);
|
||||
|
||||
//if (P_IsObjectOnGround(mobj) && mobj->momz * P_MobjFlip(mobj) <= 0)
|
||||
}
|
||||
@@ -7436,24 +7381,7 @@ void P_MobjThinker(mobj_t *mobj)
|
||||
P_SetTarget(&mobj->target, goalpost);
|
||||
}
|
||||
|
||||
if (G_IsSpecialStage(gamemap))
|
||||
{ // Never show the NiGHTS drone in special stages. Check ANYONE for bonustime.
|
||||
INT32 i;
|
||||
boolean bonustime = false;
|
||||
for (i = 0; i < MAXPLAYERS; i++)
|
||||
if (playeringame[i] && players[i].bonustime)
|
||||
{
|
||||
bonustime = true;
|
||||
break;
|
||||
}
|
||||
if (!bonustime)
|
||||
{
|
||||
mobj->flags &= ~MF_NOGRAVITY;
|
||||
P_SetMobjState(mobj, S_NIGHTSDRONE1);
|
||||
mobj->flags2 |= MF2_DONTDRAW;
|
||||
}
|
||||
}
|
||||
else if (mobj->tracer && mobj->tracer->player)
|
||||
if (mobj->tracer && mobj->tracer->player)
|
||||
{
|
||||
if (!(mobj->tracer->player->pflags & PF_NIGHTSMODE))
|
||||
{
|
||||
@@ -7470,35 +7398,7 @@ void P_MobjThinker(mobj_t *mobj)
|
||||
}
|
||||
else
|
||||
{
|
||||
if (G_IsSpecialStage(gamemap))
|
||||
{ // Never show the NiGHTS drone in special stages. Check ANYONE for bonustime.
|
||||
INT32 i;
|
||||
|
||||
boolean bonustime = false;
|
||||
for (i = 0; i < MAXPLAYERS; i++)
|
||||
if (playeringame[i] && players[i].bonustime)
|
||||
{
|
||||
bonustime = true;
|
||||
break;
|
||||
}
|
||||
|
||||
if (bonustime)
|
||||
{
|
||||
P_SetMobjState(mobj, S_NIGHTSDRONE_SPARKLING1);
|
||||
mobj->flags |= MF_NOGRAVITY;
|
||||
}
|
||||
else
|
||||
{
|
||||
if (mobj->target)
|
||||
{
|
||||
CONS_Debug(DBG_NIGHTSBASIC, "Removing goal post\n");
|
||||
P_RemoveMobj(mobj->target);
|
||||
P_SetTarget(&mobj->target, NULL);
|
||||
}
|
||||
mobj->flags2 |= MF2_DONTDRAW;
|
||||
}
|
||||
}
|
||||
else if (mobj->tracer && mobj->tracer->player)
|
||||
if (mobj->tracer && mobj->tracer->player)
|
||||
{
|
||||
if (mobj->target)
|
||||
{
|
||||
@@ -7814,16 +7714,15 @@ void P_MobjThinker(mobj_t *mobj)
|
||||
}
|
||||
case MT_BANANA:
|
||||
case MT_EGGMANITEM:
|
||||
if (cv_sloperoll.value == 2 && cv_bananthrowroll.value && !P_IsObjectOnGround(mobj))
|
||||
if (cv_bananthrowroll.value && !P_IsObjectOnGround(mobj))
|
||||
{
|
||||
// tilt n tumble
|
||||
angle_t spin = FixedMul(FixedDiv(mobj->momz, 8 * mobj->scale), ANGLE_67h);
|
||||
//mobj->angle += spin;
|
||||
|
||||
if (cv_bananthrowroll.value == 1)
|
||||
mobj->sloperoll -= spin; // im lazy but this makes sure the banan goes back to upright when it lands lmao
|
||||
if (cv_bananthrowroll.value == 1 && K_CheckSlopeRollDist(mobj))
|
||||
mobj->sloperoll -= (angle_t)FixedMul(FixedDiv(mobj->momz, 8 * mobj->scale), ANGLE_67h); // im lazy but this makes sure the banan goes back to upright when it lands lmao
|
||||
else if (cv_bananthrowroll.value == 2)
|
||||
mobj->rollangle -= spin;
|
||||
mobj->rollangle -= (angle_t)FixedMul(FixedDiv(mobj->momz, 8 * mobj->scale), ANGLE_67h);
|
||||
}
|
||||
|
||||
mobj->friction = ORIG_FRICTION/4;
|
||||
@@ -9403,13 +9302,8 @@ void P_SceneryThinker(mobj_t *mobj)
|
||||
// GAME SPAWN FUNCTIONS
|
||||
//
|
||||
|
||||
//
|
||||
// P_SpawnMobj
|
||||
//
|
||||
mobj_t *P_SpawnMobj(fixed_t x, fixed_t y, fixed_t z, mobjtype_t type)
|
||||
FUNCINLINE static ATTRINLINE mobj_t *P_AllocMobj(void)
|
||||
{
|
||||
const mobjinfo_t *info = &mobjinfo[type];
|
||||
state_t *st;
|
||||
mobj_t *mobj;
|
||||
|
||||
if (mobjcache != NULL)
|
||||
@@ -9423,6 +9317,20 @@ mobj_t *P_SpawnMobj(fixed_t x, fixed_t y, fixed_t z, mobjtype_t type)
|
||||
mobj = Z_Calloc(sizeof (*mobj), PU_LEVEL, NULL);
|
||||
}
|
||||
|
||||
return mobj;
|
||||
}
|
||||
|
||||
//
|
||||
// P_SpawnMobj
|
||||
//
|
||||
mobj_t *P_SpawnMobj(fixed_t x, fixed_t y, fixed_t z, mobjtype_t type)
|
||||
{
|
||||
const mobjinfo_t *info = &mobjinfo[type];
|
||||
state_t *st;
|
||||
mobj_t *mobj;
|
||||
|
||||
mobj = P_AllocMobj();
|
||||
|
||||
// this is officially a mobj, declared as soon as possible.
|
||||
mobj->thinker.function.acp1 = (actionf_p1)P_MobjThinker;
|
||||
mobj->type = type;
|
||||
@@ -9434,11 +9342,6 @@ mobj_t *P_SpawnMobj(fixed_t x, fixed_t y, fixed_t z, mobjtype_t type)
|
||||
mobj->radius = info->radius;
|
||||
mobj->height = info->height;
|
||||
mobj->flags = info->flags;
|
||||
mobj->sloperoll = 0;
|
||||
mobj->slopepitch = 0;
|
||||
|
||||
mobj->pitch_sprite = 0;
|
||||
mobj->roll_sprite = 0;
|
||||
|
||||
mobj->health = info->spawnhealth;
|
||||
|
||||
@@ -9476,12 +9379,6 @@ mobj_t *P_SpawnMobj(fixed_t x, fixed_t y, fixed_t z, mobjtype_t type)
|
||||
mobj->realxscale = mobj->realyscale = mobj->scale;
|
||||
mobj->spritexscale = mobj->realxscale;
|
||||
mobj->spriteyscale = mobj->realyscale;
|
||||
mobj->realxoffset = mobj->realyoffset = 0;
|
||||
mobj->spritexoffset = mobj->realxoffset;
|
||||
mobj->spriteyoffset = mobj->realyoffset;
|
||||
|
||||
// Funni slam sound when landing
|
||||
mobj->slamsoundtimer = 0;
|
||||
|
||||
// set subsector and/or block links
|
||||
P_SetThingPosition(mobj);
|
||||
@@ -9490,12 +9387,8 @@ mobj_t *P_SpawnMobj(fixed_t x, fixed_t y, fixed_t z, mobjtype_t type)
|
||||
// Make sure scale matches destscale immediately when spawned
|
||||
P_SetScale(mobj, mobj->destscale);
|
||||
|
||||
mobj->floorz =
|
||||
mobj->subsector->sector->f_slope ? P_GetZAt(mobj->subsector->sector->f_slope, x, y) :
|
||||
mobj->subsector->sector->floorheight;
|
||||
mobj->ceilingz =
|
||||
mobj->subsector->sector->c_slope ? P_GetZAt(mobj->subsector->sector->c_slope, x, y) :
|
||||
mobj->subsector->sector->ceilingheight;
|
||||
mobj->floorz = P_GetSectorFloorZAt(mobj->subsector->sector, x, y);
|
||||
mobj->ceilingz = P_GetSectorCeilingZAt(mobj->subsector->sector, x, y);
|
||||
|
||||
// Tells MobjCheckWater that the water height was not set.
|
||||
mobj->watertop = INT32_MAX;
|
||||
@@ -9887,16 +9780,7 @@ mobj_t *P_SpawnShadowMobj(mobj_t * caster)
|
||||
state_t *st;
|
||||
mobj_t *mobj;
|
||||
|
||||
if (mobjcache != NULL)
|
||||
{
|
||||
mobj = mobjcache;
|
||||
mobjcache = mobjcache->hnext;
|
||||
memset(mobj, 0, sizeof(*mobj));
|
||||
}
|
||||
else
|
||||
{
|
||||
mobj = Z_Calloc(sizeof (*mobj), PU_LEVEL, NULL);
|
||||
}
|
||||
mobj = P_AllocMobj();
|
||||
|
||||
// this is officially a mobj, declared as soon as possible.
|
||||
mobj->thinker.function.acp1 = (actionf_p1)P_MobjThinker;
|
||||
@@ -9946,7 +9830,6 @@ mobj_t *P_SpawnShadowMobj(mobj_t * caster)
|
||||
|
||||
// Sprite rendering
|
||||
mobj->spritexscale = mobj->spriteyscale = mobj->scale;
|
||||
mobj->spritexoffset = mobj->spriteyoffset = 0;
|
||||
|
||||
// set subsector and/or block links
|
||||
P_SetThingPosition(mobj);
|
||||
@@ -10179,6 +10062,10 @@ void P_RemoveMobj(mobj_t *mobj)
|
||||
{ // Add thinker just to delay removing it until refrences are gone.
|
||||
mobj->flags &= ~MF_NOTHINK;
|
||||
P_AddThinker((thinker_t *)mobj);
|
||||
#ifdef PARANOIA
|
||||
// Saved to avoid being scrambled like below...
|
||||
mobj->thinker.debug_mobjtype = mobj->type;
|
||||
#endif
|
||||
#ifdef SCRAMBLE_REMOVED
|
||||
// Invalidate mobj_t data to cause crashes if accessed!
|
||||
memset((UINT8 *)mobj + sizeof(thinker_t), 0xff, sizeof(mobj_t) - sizeof(thinker_t));
|
||||
@@ -10188,6 +10075,10 @@ void P_RemoveMobj(mobj_t *mobj)
|
||||
}
|
||||
else
|
||||
{
|
||||
#ifdef PARANOIA
|
||||
// Saved to avoid being scrambled like below...
|
||||
mobj->thinker.debug_mobjtype = mobj->type;
|
||||
#endif
|
||||
#ifdef SCRAMBLE_REMOVED
|
||||
// Invalidate mobj_t data to cause crashes if accessed!
|
||||
memset((UINT8 *)mobj + sizeof(thinker_t), 0xff, sizeof(mobj_t) - sizeof(thinker_t));
|
||||
@@ -10210,31 +10101,29 @@ void P_FreePrecipMobj(precipmobj_t *mobj)
|
||||
// Clearing out stuff for savegames
|
||||
void P_RemoveSavegameMobj(mobj_t *mobj)
|
||||
{
|
||||
// unlink from sector and block lists
|
||||
if (((thinker_t *)mobj)->function.acp1 == (actionf_p1)P_NullPrecipThinker)
|
||||
{
|
||||
P_UnsetPrecipThingPosition((precipmobj_t *)mobj);
|
||||
}
|
||||
else
|
||||
{
|
||||
// unlink from sector and block lists
|
||||
P_UnsetThingPosition(mobj);
|
||||
thinker_t *th = (thinker_t*)mobj;
|
||||
|
||||
// Remove touching_sectorlist from mobj.
|
||||
if (sector_list)
|
||||
{
|
||||
P_DelSeclist(sector_list);
|
||||
sector_list = NULL;
|
||||
}
|
||||
// unlink from sector and block lists
|
||||
P_UnsetThingPosition(mobj);
|
||||
|
||||
// Remove touching_sectorlist from mobj.
|
||||
if (sector_list)
|
||||
{
|
||||
P_DelSeclist(sector_list);
|
||||
sector_list = NULL;
|
||||
}
|
||||
|
||||
// stop any playing sound
|
||||
S_StopSound(mobj);
|
||||
R_RemoveMobjInterpolator(mobj);
|
||||
|
||||
// just set its reference count to 0 to not trigger the assert in P_UnlinkThinker
|
||||
if (th->references != 0)
|
||||
th->references = 0;
|
||||
|
||||
// free block
|
||||
// Here we use the same code as R_RemoveThinkerDelayed, but without reference counting (we're removing everything so it shouldn't matter) and without touching currentthinker since we aren't in P_RunThinkers
|
||||
P_UnlinkThinker((thinker_t*)mobj);
|
||||
P_UnlinkThinker(th);
|
||||
}
|
||||
|
||||
static CV_PossibleValue_t respawnitemtime_cons_t[] = {{1, "MIN"}, {300, "MAX"}, {0, NULL}};
|
||||
@@ -10285,7 +10174,7 @@ void P_SpawnPrecipitation(void)
|
||||
continue;
|
||||
|
||||
// Exists, but is too small for reasonable precipitation.
|
||||
if (!(precipsector->sector->floorheight <= precipsector->sector->ceilingheight - (32<<FRACBITS)))
|
||||
if (FixedDiv(precipsector->sector->ceilingheight - precipsector->sector->floorheight, mapobjectscale) < 64<<FRACBITS)
|
||||
continue;
|
||||
|
||||
// Don't set z properly yet...
|
||||
@@ -10520,10 +10409,6 @@ void P_RespawnSpecials(void)
|
||||
if (!cv_itemrespawn.value)
|
||||
return;
|
||||
|
||||
// Don't respawn in special stages!
|
||||
if (G_IsSpecialStage(gamemap))
|
||||
return;
|
||||
|
||||
// nothing left to respawn?
|
||||
if (iquehead == iquetail)
|
||||
return;
|
||||
@@ -10571,9 +10456,8 @@ void P_RespawnSpecials(void)
|
||||
|
||||
if (mthing->options & MTF_OBJECTFLIP)
|
||||
{
|
||||
z = (
|
||||
ss->sector->c_slope ? P_GetZAt(ss->sector->c_slope, x, y) :
|
||||
ss->sector->ceilingheight) - (mthing->options >> ZSHIFT) * FRACUNIT;
|
||||
z = P_GetSectorCeilingZAt(ss->sector, x, y) - (mthing->options >> ZSHIFT) * FRACUNIT;
|
||||
|
||||
if (mthing->options & MTF_AMBUSH
|
||||
&& (i == MT_RING || i == MT_REDTEAMRING || i == MT_BLUETEAMRING || i == MT_COIN || P_WeaponOrPanel(i)))
|
||||
z -= 24*FRACUNIT;
|
||||
@@ -10581,9 +10465,8 @@ void P_RespawnSpecials(void)
|
||||
}
|
||||
else
|
||||
{
|
||||
z = (
|
||||
ss->sector->f_slope ? P_GetZAt(ss->sector->f_slope, x, y) :
|
||||
ss->sector->floorheight) + (mthing->options >> ZSHIFT) * FRACUNIT;
|
||||
z = P_GetSectorFloorZAt(ss->sector, x, y) + (mthing->options >> ZSHIFT) * FRACUNIT;
|
||||
|
||||
if (mthing->options & MTF_AMBUSH
|
||||
&& (i == MT_RING || i == MT_REDTEAMRING || i == MT_BLUETEAMRING || i == MT_COIN || P_WeaponOrPanel(i)))
|
||||
z += 24*FRACUNIT;
|
||||
@@ -10702,7 +10585,7 @@ void P_SpawnPlayer(INT32 playernum)
|
||||
// the dead body mobj retains the skin through the 'spritedef' override).
|
||||
mobj->skin = &skins[p->skin];
|
||||
|
||||
mobj->localskin = ((p->localskin > 0) ? (p->skinlocal ? &localskins[p->localskin - 1] : &skins[p->localskin - 1]) : 0);
|
||||
mobj->localskin = (p->localskin ? K_GetPlayerSkin(p) : 0);
|
||||
mobj->skinlocal = p->skinlocal;
|
||||
|
||||
mobj->health = p->health;
|
||||
@@ -10882,14 +10765,9 @@ void P_MovePlayerToSpawn(INT32 playernum, mapthing_t *mthing)
|
||||
//spawn at the origin as a desperation move if there is no mapthing
|
||||
|
||||
// set Z height
|
||||
sector = R_PointInSubsector(x, y)->sector;
|
||||
|
||||
floor =
|
||||
sector->f_slope ? P_GetZAt(sector->f_slope, x, y) :
|
||||
sector->floorheight;
|
||||
ceiling =
|
||||
sector->c_slope ? P_GetZAt(sector->c_slope, x, y) :
|
||||
sector->ceilingheight;
|
||||
sector = R_PointInSubsector(x, y)->sector;
|
||||
floor = P_GetSectorFloorZAt(sector, x, y);
|
||||
ceiling = P_GetSectorCeilingZAt(sector, x, y);
|
||||
|
||||
if (mthing)
|
||||
{
|
||||
@@ -10957,14 +10835,11 @@ void P_MovePlayerToStarpost(INT32 playernum)
|
||||
mobj->x = p->starpostx << FRACBITS;
|
||||
mobj->y = p->starposty << FRACBITS;
|
||||
P_SetThingPosition(mobj);
|
||||
sector = R_PointInSubsector(mobj->x, mobj->y)->sector;
|
||||
|
||||
floor =
|
||||
sector->f_slope ? P_GetZAt(sector->f_slope, mobj->x, mobj->y) :
|
||||
sector->floorheight;
|
||||
ceiling =
|
||||
sector->c_slope ? P_GetZAt(sector->c_slope, mobj->x, mobj->y) :
|
||||
sector->ceilingheight;
|
||||
// set Z height
|
||||
sector = R_PointInSubsector(mobj->x, mobj->y)->sector;
|
||||
floor = P_GetSectorFloorZAt(sector, mobj->x, mobj->y);
|
||||
ceiling = P_GetSectorCeilingZAt(sector, mobj->x, mobj->y);
|
||||
|
||||
if (mobj->player->kartstuff[k_starpostflip])
|
||||
z = (p->starpostz<<FRACBITS) - FixedMul(128<<FRACBITS, mapobjectscale) - mobj->height;
|
||||
@@ -11085,9 +10960,17 @@ void P_SpawnMapThing(mapthing_t *mthing)
|
||||
// check for players specially
|
||||
if (mthing->type > 0 && mthing->type <= 32)
|
||||
{
|
||||
// save spots for respawning in network games
|
||||
if (!metalrecording)
|
||||
playerstarts[mthing->type-1] = mthing;
|
||||
if (mthing->type > MAXPLAYERS) // be wary of playerstarts size! playerstarts[MAXPLAYERS]
|
||||
{
|
||||
CONS_Alert(CONS_ERROR, "Excess player start detected %d This will crash vanilla clients!\n", mthing->type);
|
||||
}
|
||||
else
|
||||
{
|
||||
// save spots for respawning in network games
|
||||
if (!metalrecording)
|
||||
playerstarts[mthing->type-1] = mthing;
|
||||
}
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -11136,10 +11019,8 @@ void P_SpawnMapThing(mapthing_t *mthing)
|
||||
if (gametype != GT_COOP)
|
||||
return;
|
||||
|
||||
ss = R_PointInSubsector(mthing->x << FRACBITS, mthing->y << FRACBITS);
|
||||
mthing->z = (INT16)(((
|
||||
ss->sector->f_slope ? P_GetZAt(ss->sector->f_slope, mthing->x << FRACBITS, mthing->y << FRACBITS) :
|
||||
ss->sector->floorheight)>>FRACBITS) + (mthing->options >> ZSHIFT));
|
||||
ss = R_PointInSubsector((mthing->x << FRACBITS), (mthing->y << FRACBITS));
|
||||
mthing->z = (INT16)((P_GetSectorFloorZAt(ss->sector, (mthing->x << FRACBITS), (mthing->y << FRACBITS)) >> FRACBITS) + (mthing->options >> ZSHIFT));
|
||||
|
||||
if (numhuntemeralds < MAXHUNTEMERALDS)
|
||||
huntemeralds[numhuntemeralds++] = mthing;
|
||||
@@ -11237,7 +11118,7 @@ void P_SpawnMapThing(mapthing_t *mthing)
|
||||
if (i == MT_PITYTV || i == MT_GREENTV || i == MT_YELLOWTV || i == MT_BLUETV || i == MT_BLACKTV || i == MT_WHITETV)
|
||||
return; // No shields in Ultimate mode
|
||||
|
||||
if (i == MT_SUPERRINGBOX && !G_IsSpecialStage(gamemap))
|
||||
if (i == MT_SUPERRINGBOX)
|
||||
return; // No rings in Ultimate mode (except special stages)
|
||||
}
|
||||
|
||||
@@ -11253,18 +11134,14 @@ void P_SpawnMapThing(mapthing_t *mthing)
|
||||
ss = R_PointInSubsector(x, y);
|
||||
|
||||
if (i == MT_NIGHTSBUMPER)
|
||||
z = (
|
||||
ss->sector->f_slope ? P_GetZAt(ss->sector->f_slope, x, y) :
|
||||
ss->sector->floorheight) + ((mthing->options >> ZSHIFT) << FRACBITS);
|
||||
z = P_GetSectorFloorZAt(ss->sector, x, y) + ((mthing->options >> ZSHIFT) << FRACBITS);
|
||||
else if (i == MT_AXIS || i == MT_AXISTRANSFER || i == MT_AXISTRANSFERLINE)
|
||||
z = ONFLOORZ;
|
||||
else if (i == MT_SPECIALSPIKEBALL || P_WeaponOrPanel(i) || i == MT_EMERALDSPAWN || i == MT_EMMY)
|
||||
{
|
||||
if (mthing->options & MTF_OBJECTFLIP)
|
||||
{
|
||||
z = (
|
||||
ss->sector->c_slope ? P_GetZAt(ss->sector->c_slope, x, y) :
|
||||
ss->sector->ceilingheight);
|
||||
z = P_GetSectorCeilingZAt(ss->sector, x, y);
|
||||
|
||||
if (mthing->options & MTF_AMBUSH) // Special flag for rings
|
||||
z -= 24*FRACUNIT;
|
||||
@@ -11275,9 +11152,7 @@ void P_SpawnMapThing(mapthing_t *mthing)
|
||||
}
|
||||
else
|
||||
{
|
||||
z = (
|
||||
ss->sector->f_slope ? P_GetZAt(ss->sector->f_slope, x, y) :
|
||||
ss->sector->floorheight);
|
||||
z = P_GetSectorFloorZAt(ss->sector, x, y);
|
||||
|
||||
if (mthing->options & MTF_AMBUSH) // Special flag for rings
|
||||
z += 24*FRACUNIT;
|
||||
@@ -11297,13 +11172,9 @@ void P_SpawnMapThing(mapthing_t *mthing)
|
||||
|
||||
// base positions
|
||||
if (flip)
|
||||
z = (
|
||||
ss->sector->c_slope ? P_GetZAt(ss->sector->c_slope, x, y) :
|
||||
ss->sector->ceilingheight) - mobjinfo[i].height;
|
||||
z = P_GetSectorCeilingZAt(ss->sector, x, y) - mobjinfo[i].height;
|
||||
else
|
||||
z = (
|
||||
ss->sector->f_slope ? P_GetZAt(ss->sector->f_slope, x, y) :
|
||||
ss->sector->floorheight);
|
||||
z = P_GetSectorFloorZAt(ss->sector, x, y);
|
||||
|
||||
// offsetting
|
||||
if (mthing->options >> ZSHIFT)
|
||||
@@ -11529,14 +11400,9 @@ ML_NOCLIMB : Direction not controllable
|
||||
mobj->threshold = min(mthing->extrainfo, 7);
|
||||
break;
|
||||
case MT_TUBEWAYPOINT:
|
||||
{
|
||||
UINT8 sequence = mthing->angle >> 8;
|
||||
UINT8 id = mthing->angle & 255;
|
||||
mobj->health = id;
|
||||
mobj->threshold = sequence;
|
||||
P_AddWaypoint(sequence, id, mobj);
|
||||
mobj->health = mthing->angle & 255;
|
||||
mobj->threshold = mthing->angle >> 8;
|
||||
break;
|
||||
}
|
||||
case MT_NIGHTSDRONE:
|
||||
if (mthing->angle > 0)
|
||||
mobj->health = mthing->angle;
|
||||
@@ -11751,14 +11617,6 @@ ML_NOCLIMB : Direction not controllable
|
||||
mobj->health |= 1; // If ambush is set, push using XYZ
|
||||
if (mthing->options & MTF_OBJECTSPECIAL)
|
||||
mobj->health |= 2; // If object special is set, fade using XY
|
||||
|
||||
if (G_IsSpecialStage(gamemap))
|
||||
{
|
||||
if (i == MT_PUSH)
|
||||
P_SetMobjState(mobj, S_GRAVWELLGREEN);
|
||||
if (i == MT_PULL)
|
||||
P_SetMobjState(mobj, S_GRAVWELLRED);
|
||||
}
|
||||
}
|
||||
|
||||
// ignore MTF_ flags and return early
|
||||
@@ -11876,9 +11734,7 @@ void P_SpawnHoopsAndRings(mapthing_t *mthing)
|
||||
hoopcenter = P_SpawnMobj(x, y, z, MT_HOOPCENTER);
|
||||
hoopcenter->spawnpoint = mthing;
|
||||
|
||||
z +=
|
||||
sec->f_slope ? P_GetZAt(sec->f_slope, x, y) :
|
||||
sec->floorheight;
|
||||
z += P_GetSectorFloorZAt(sec, x, y);
|
||||
|
||||
hoopcenter->z = z - hoopcenter->height/2;
|
||||
|
||||
@@ -12009,9 +11865,7 @@ void P_SpawnHoopsAndRings(mapthing_t *mthing)
|
||||
hoopcenter = P_SpawnMobj(x, y, z, MT_HOOPCENTER);
|
||||
hoopcenter->spawnpoint = mthing;
|
||||
|
||||
z +=
|
||||
sec->f_slope ? P_GetZAt(sec->f_slope, x, y) :
|
||||
sec->floorheight;
|
||||
z += P_GetSectorFloorZAt(sec, x, y);
|
||||
hoopcenter->z = z - hoopcenter->height/2;
|
||||
|
||||
P_UnsetThingPosition(hoopcenter);
|
||||
|
||||
+5
-1
@@ -293,7 +293,9 @@ typedef struct mobj_s
|
||||
fixed_t spritexscale, spriteyscale;
|
||||
fixed_t spritexoffset, spriteyoffset;
|
||||
fixed_t old_spritexscale, old_spriteyscale;
|
||||
fixed_t old_spritexscale2, old_spriteyscale2;
|
||||
fixed_t old_spritexoffset, old_spriteyoffset;
|
||||
fixed_t old_spritexoffset2, old_spriteyoffset2;
|
||||
INT16 lightlevel; // Add to sector lightlevel, -255 - 255
|
||||
|
||||
fixed_t realxscale, realyscale; // funn-E streeetch
|
||||
@@ -397,7 +399,7 @@ typedef struct mobj_s
|
||||
boolean colorized; // Whether the mobj uses the rainbow colormap
|
||||
boolean mirrored; // The object's rotations will be mirrored left to right, e.g., see frame AL from the right and AR from the left
|
||||
|
||||
tic_t slamsoundtimer;
|
||||
tic_t slamsoundtimer; // Funni slam sound when landing
|
||||
|
||||
// saltyhop! hardcode edition
|
||||
boolean salty_ready;
|
||||
@@ -447,7 +449,9 @@ typedef struct precipmobj_s
|
||||
fixed_t spritexscale, spriteyscale;
|
||||
fixed_t spritexoffset, spriteyoffset;
|
||||
fixed_t old_spritexscale, old_spriteyscale;
|
||||
fixed_t old_spritexscale2, old_spriteyscale2;
|
||||
fixed_t old_spritexoffset, old_spriteyoffset;
|
||||
fixed_t old_spritexoffset2, old_spriteyoffset2;
|
||||
INT16 lightlevel; // Add to sector lightlevel, -255 - 255
|
||||
|
||||
fixed_t realxscale, realyscale; // funn-E streeetch
|
||||
|
||||
+144
-16
@@ -156,6 +156,9 @@ FUNCINLINE static ATTRINLINE void PolyObj_AddThinker(thinker_t *th)
|
||||
|
||||
th->references = 0;
|
||||
th->cachable = false; // not initialising this made the mobjcache die thx!
|
||||
#ifdef PARANOIA
|
||||
th->debug_mobjtype = MT_NULL;
|
||||
#endif
|
||||
}
|
||||
|
||||
static void FreeSideLists(void)
|
||||
@@ -848,8 +851,7 @@ static polymaplink_t *Polyobj_getLink(void)
|
||||
}
|
||||
else
|
||||
{
|
||||
l = Z_Malloc(sizeof(*l), PU_LEVEL, NULL);
|
||||
memset(l, 0, sizeof(*l));
|
||||
l = Z_Calloc(sizeof(*l), PU_LEVEL, NULL);
|
||||
}
|
||||
|
||||
return l;
|
||||
@@ -1565,8 +1567,7 @@ void Polyobj_InitLevel(void)
|
||||
{
|
||||
++numPolyObjects;
|
||||
|
||||
qitem = malloc(sizeof(mobjqitem_t));
|
||||
memset(qitem, 0, sizeof(mobjqitem_t));
|
||||
qitem = calloc(1, sizeof(mobjqitem_t));
|
||||
qitem->mo = mo;
|
||||
M_QueueInsert(&(qitem->mqitem), &spawnqueue);
|
||||
}
|
||||
@@ -1574,8 +1575,7 @@ void Polyobj_InitLevel(void)
|
||||
{
|
||||
++numAnchors;
|
||||
|
||||
qitem = malloc(sizeof(mobjqitem_t));
|
||||
memset(qitem, 0, sizeof(mobjqitem_t));
|
||||
qitem = calloc(1, sizeof(mobjqitem_t));
|
||||
qitem->mo = mo;
|
||||
M_QueueInsert(&(qitem->mqitem), &anchorqueue);
|
||||
}
|
||||
@@ -1803,12 +1803,12 @@ void T_PolyObjMove(polymove_t *th)
|
||||
//
|
||||
void T_PolyObjWaypoint(polywaypoint_t *th)
|
||||
{
|
||||
mobj_t *mo2;
|
||||
mobj_t *target = NULL;
|
||||
mobj_t *waypoint = NULL;
|
||||
mobj_t *mo2;
|
||||
thinker_t *wp;
|
||||
fixed_t adjustx, adjusty, adjustz;
|
||||
fixed_t momx, momy, momz, dist;
|
||||
thinker_t *wp;
|
||||
INT32 start;
|
||||
polyobj_t *po = Polyobj_GetForNum(th->polyObjNum);
|
||||
polyobj_t *oldpo = po;
|
||||
@@ -1825,7 +1825,7 @@ void T_PolyObjWaypoint(polywaypoint_t *th)
|
||||
#endif
|
||||
|
||||
// check for displacement due to override and reattach when possible
|
||||
if (!po->thinker)
|
||||
if (po->thinker == NULL)
|
||||
po->thinker = &th->thinker;
|
||||
|
||||
// Find out target first.
|
||||
@@ -1913,7 +1913,37 @@ void T_PolyObjWaypoint(polywaypoint_t *th)
|
||||
{
|
||||
CONS_Debug(DBG_POLYOBJ, "Looking for next waypoint...\n");
|
||||
|
||||
waypoint = (th->direction == -1) ? P_GetPreviousWaypoint(target, false) : P_GetNextWaypoint(target, false);
|
||||
// Find next waypoint
|
||||
for (wp = thinkercap.next; wp != &thinkercap; wp = wp->next)
|
||||
{
|
||||
if (wp->function.acp1 != (actionf_p1)P_MobjThinker) // Not a mobj thinker
|
||||
continue;
|
||||
|
||||
mo2 = (mobj_t *)wp;
|
||||
|
||||
if (mo2->type != MT_TUBEWAYPOINT)
|
||||
continue;
|
||||
|
||||
if (mo2->threshold != th->sequence)
|
||||
continue;
|
||||
|
||||
if (th->direction == -1)
|
||||
{
|
||||
if (mo2->health == target->health - 1)
|
||||
{
|
||||
waypoint = mo2;
|
||||
break;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if (mo2->health == target->health + 1)
|
||||
{
|
||||
waypoint = mo2;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (!waypoint && th->wrap) // If specified, wrap waypoints
|
||||
{
|
||||
@@ -1923,7 +1953,35 @@ void T_PolyObjWaypoint(polywaypoint_t *th)
|
||||
th->stophere = true;
|
||||
}
|
||||
|
||||
waypoint = (th->direction == -1) ? P_GetLastWaypoint(th->sequence) : P_GetFirstWaypoint(th->sequence);
|
||||
for (wp = thinkercap.next; wp != &thinkercap; wp = wp->next)
|
||||
{
|
||||
if (wp->function.acp1 != (actionf_p1)P_MobjThinker) // Not a mobj thinker
|
||||
continue;
|
||||
|
||||
mo2 = (mobj_t *)wp;
|
||||
|
||||
if (mo2->type != MT_TUBEWAYPOINT)
|
||||
continue;
|
||||
|
||||
if (mo2->threshold != th->sequence)
|
||||
continue;
|
||||
|
||||
if (th->direction == -1)
|
||||
{
|
||||
if (waypoint == NULL)
|
||||
waypoint = mo2;
|
||||
else if (mo2->health > waypoint->health)
|
||||
waypoint = mo2;
|
||||
}
|
||||
else
|
||||
{
|
||||
if (mo2->health == 0)
|
||||
{
|
||||
waypoint = mo2;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
else if (!waypoint && th->comeback) // Come back to the start
|
||||
{
|
||||
@@ -1932,7 +1990,36 @@ void T_PolyObjWaypoint(polywaypoint_t *th)
|
||||
if (!th->continuous)
|
||||
th->comeback = false;
|
||||
|
||||
waypoint = (th->direction == -1) ? P_GetPreviousWaypoint(target, false) : P_GetNextWaypoint(target, false);
|
||||
for (wp = thinkercap.next; wp != &thinkercap; wp = wp->next)
|
||||
{
|
||||
if (wp->function.acp1 != (actionf_p1)P_MobjThinker) // Not a mobj thinker
|
||||
continue;
|
||||
|
||||
mo2 = (mobj_t *)wp;
|
||||
|
||||
if (mo2->type != MT_TUBEWAYPOINT)
|
||||
continue;
|
||||
|
||||
if (mo2->threshold != th->sequence)
|
||||
continue;
|
||||
|
||||
if (th->direction == -1)
|
||||
{
|
||||
if (mo2->health == target->health - 1)
|
||||
{
|
||||
waypoint = mo2;
|
||||
break;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if (mo2->health == target->health + 1)
|
||||
{
|
||||
waypoint = mo2;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2382,9 +2469,11 @@ INT32 EV_DoPolyObjWaypoint(polywaypointdata_t *pwdata)
|
||||
polyobj_t *po;
|
||||
polyobj_t *oldpo;
|
||||
polywaypoint_t *th;
|
||||
mobj_t *mo2;
|
||||
mobj_t *first = NULL;
|
||||
mobj_t *last = NULL;
|
||||
mobj_t *target = NULL;
|
||||
thinker_t *wp;
|
||||
INT32 start;
|
||||
|
||||
if (!(po = Polyobj_GetForNum(pwdata->polyObjNum)))
|
||||
@@ -2410,7 +2499,10 @@ INT32 EV_DoPolyObjWaypoint(polywaypointdata_t *pwdata)
|
||||
th->polyObjNum = pwdata->polyObjNum;
|
||||
th->speed = pwdata->speed;
|
||||
th->sequence = pwdata->sequence; // Used to specify sequence #
|
||||
th->direction = pwdata->reverse ? -1 : 1;
|
||||
if (pwdata->reverse)
|
||||
th->direction = -1;
|
||||
else
|
||||
th->direction = 1;
|
||||
|
||||
th->comeback = pwdata->comeback;
|
||||
th->continuous = pwdata->continuous;
|
||||
@@ -2418,8 +2510,44 @@ INT32 EV_DoPolyObjWaypoint(polywaypointdata_t *pwdata)
|
||||
th->stophere = false;
|
||||
|
||||
// Find the first waypoint we need to use
|
||||
first = (th->direction == -1) ? P_GetLastWaypoint(th->sequence) : P_GetFirstWaypoint(th->sequence);
|
||||
last = (th->direction == -1) ? P_GetFirstWaypoint(th->sequence) : P_GetLastWaypoint(th->sequence);
|
||||
for (wp = thinkercap.next; wp != &thinkercap; wp = wp->next)
|
||||
{
|
||||
if (wp->function.acp1 != (actionf_p1)P_MobjThinker) // Not a mobj thinker
|
||||
continue;
|
||||
|
||||
mo2 = (mobj_t *)wp;
|
||||
|
||||
if (mo2->type != MT_TUBEWAYPOINT)
|
||||
continue;
|
||||
|
||||
if (mo2->threshold != th->sequence)
|
||||
continue;
|
||||
|
||||
if (th->direction == -1) // highest waypoint #
|
||||
{
|
||||
if (mo2->health == 0)
|
||||
last = mo2;
|
||||
else
|
||||
{
|
||||
if (first == NULL)
|
||||
first = mo2;
|
||||
else if (mo2->health > first->health)
|
||||
first = mo2;
|
||||
}
|
||||
}
|
||||
else // waypoint 0
|
||||
{
|
||||
if (mo2->health == 0)
|
||||
first = mo2;
|
||||
else
|
||||
{
|
||||
if (last == NULL)
|
||||
last = mo2;
|
||||
else if (mo2->health > last->health)
|
||||
last = mo2;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (!first)
|
||||
{
|
||||
@@ -2466,7 +2594,7 @@ INT32 EV_DoPolyObjWaypoint(polywaypointdata_t *pwdata)
|
||||
R_CreateInterpolator_Polyobj(&th->thinker, po);
|
||||
// T_PolyObjWaypoint is the only polyobject movement
|
||||
// that can adjust z, so we add these ones too.
|
||||
R_CreateInterpolator_SectorPlane(&th->thinker, po->lines[0]->backsector, false);
|
||||
R_CreateInterpolator_SectorPlane(&th->thinker, po->lines[0]->backsector, false);
|
||||
R_CreateInterpolator_SectorPlane(&th->thinker, po->lines[0]->backsector, true);
|
||||
|
||||
// Most other polyobject functions handle children by recursively
|
||||
|
||||
Loaded 100 of 230 files, more files were not shown because too many files have changed in this diff.
Show more
Reference in new issue
Block a user