Compare commits
2564
Commits
nomobjshadows
...
v8.2
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
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 | ||
|
|
8c8fe976d7 | ||
|
|
8c43857bd3 | ||
|
|
380c8f65c8 | ||
|
|
5ec0af62d9 | ||
|
|
3762b18159 | ||
|
|
b6de9e03d7 | ||
|
|
486f386f35 | ||
|
|
848d84147f | ||
|
|
a980784771 | ||
|
|
0f675661a6 | ||
|
|
30deff7697 | ||
|
|
21c267b319 | ||
|
|
cce363c8c8 | ||
|
|
944d8187ba | ||
|
|
c9b3459a48 | ||
|
|
ec0a1a97e0 | ||
|
|
dd81b2cc41 | ||
|
|
7d58887138 | ||
|
|
a79f2fa90a | ||
|
|
473c70fd70 | ||
|
|
bbd967adad | ||
|
|
f55fdbf630 | ||
|
|
6b23c70e37 | ||
|
|
1d4e6ca825 | ||
|
|
deeae1ef56 | ||
|
|
ed87c40d13 | ||
|
|
ac28e587e2 | ||
|
|
55d2d2cce4 | ||
|
|
f3d5c3f698 | ||
|
|
d92ba0987b | ||
|
|
c081349f9b | ||
|
|
88b78a5bf7 | ||
|
|
cf9e7ff37b | ||
|
|
8775e5abc1 | ||
|
|
9b3fde7a19 | ||
|
|
fe6b5a83f8 | ||
|
|
e39a9c190a | ||
|
|
30fff79bd0 | ||
|
|
7781237c56 | ||
|
|
288bcbd419 | ||
|
|
51408010e8 | ||
|
|
7aeaf76062 | ||
|
|
4465b05bc8 | ||
|
|
537aa30cfe | ||
|
|
e16ef100b8 | ||
|
|
a277d70ce2 | ||
|
|
6932a52463 | ||
|
|
a686b29a7a | ||
|
|
c133f0d751 | ||
|
|
5ff125a429 | ||
|
|
b8cab84d2a | ||
|
|
d2975d2dcb | ||
|
|
e802ecf0b5 | ||
|
|
71378285b2 | ||
|
|
ffe9a89552 | ||
|
|
ac9926eb17 | ||
|
|
0b57389dcd | ||
|
|
e2b42b1647 | ||
|
|
ad39ade286 | ||
|
|
0ed21a171d | ||
|
|
ad65e3e968 | ||
|
|
d55d7e0efc | ||
|
|
ec7fa833d5 | ||
|
|
2e6c1d9df4 | ||
|
|
7d55c46979 | ||
|
|
af2b22e91f | ||
|
|
e983174559 | ||
|
|
006bda5bfc | ||
|
|
148b76f4a3 | ||
|
|
422e63a93d | ||
|
|
2aff0ed03a | ||
|
|
341d592001 | ||
|
|
568890e9b3 | ||
|
|
a1e9cacb9f | ||
|
|
a258379a3b | ||
|
|
3bde3b04ae | ||
|
|
9e070a6516 | ||
|
|
8d9c6ec65f | ||
|
|
ec263086d8 | ||
|
|
06ccb4f7b0 | ||
|
|
95daa7eacc | ||
|
|
d18afa1781 | ||
|
|
883c382a1d | ||
|
|
c82eb25628 | ||
|
|
8c0294898e | ||
|
|
d09c8bb8fd | ||
|
|
d397a07d96 | ||
|
|
96f842fd96 | ||
|
|
105b3f37eb | ||
|
|
24387b50bd | ||
|
|
0c4661c2a7 | ||
|
|
178c942dc6 | ||
|
|
47d41e2c2a | ||
|
|
4d7c223565 | ||
|
|
e3af2b0d58 | ||
|
|
f4ed9b43cd | ||
|
|
55cd0fa08f | ||
|
|
8cce4f3ccf | ||
|
|
1e21f6a378 | ||
|
|
a0af6f2461 | ||
|
|
390e3db25d | ||
|
|
3d9bb65e62 | ||
|
|
4f88a97739 | ||
|
|
de977167ca | ||
|
|
84028f52d8 | ||
|
|
f693ca8333 | ||
|
|
64dd17d75d | ||
|
|
b3ce832753 | ||
|
|
b9c89b381b | ||
|
|
c8a0a2bdae | ||
|
|
84d3d0d891 | ||
|
|
fe42f1bd3e | ||
|
|
b5803e8787 | ||
|
|
9f7aca5fe3 | ||
|
|
ac8e25865e | ||
|
|
02b411f7ee | ||
|
|
9dee892244 | ||
|
|
e5d832a642 | ||
|
|
b069c2cb3e | ||
|
|
7235f9864e | ||
|
|
e4e1f0c645 | ||
|
|
54747c6b53 | ||
|
|
9ed242cde2 | ||
|
|
9bcfe63e3e | ||
|
|
b38460473d | ||
|
|
fd77beabe1 | ||
|
|
5dfab42fcf | ||
|
|
72d94b77ac | ||
|
|
54d73206ca | ||
|
|
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 | ||
|
|
8f342110c9 | ||
|
|
980d59c9be | ||
|
|
6d977ea949 | ||
|
|
e723948756 | ||
|
|
d95e3c6e04 | ||
|
|
7fdf986df4 | ||
|
|
6b049ad86d | ||
|
|
a0fc6f7e22 | ||
|
|
d0890c45e2 | ||
|
|
93b3926008 | ||
|
|
3fe94b68a3 | ||
|
|
34f5a58692 | ||
|
|
b605c8e654 | ||
|
|
95df997198 | ||
|
|
51ba4f1ec8 | ||
|
|
1af9903439 | ||
|
|
457186fe40 | ||
|
|
b4269cba3e | ||
|
|
70a985e274 | ||
|
|
f15f24914d | ||
|
|
a30aad04da | ||
|
|
ad74af426b | ||
|
|
75d69dc90d | ||
|
|
115eea3828 | ||
|
|
7322d553ba | ||
|
|
5bf24e10b2 | ||
|
|
10f1507366 | ||
|
|
badb8c7914 | ||
|
|
13b2f6534e | ||
|
|
c78ecd8453 | ||
|
|
b61e29ef0f | ||
|
|
ca555e7ea6 | ||
|
|
a1f254a0bc | ||
|
|
a9429caf09 | ||
|
|
7bf50c69e2 | ||
|
|
fcd8cfc4d5 | ||
|
|
9efd24e376 | ||
|
|
5b0a662b40 | ||
|
|
255c8437d7 | ||
|
|
83b242a727 | ||
|
|
4ef6c2ea34 | ||
|
|
29b93f63f7 | ||
|
|
a403d96204 | ||
|
|
c1a187084d | ||
|
|
7808dc5740 | ||
|
|
4417eabdc7 | ||
|
|
119b18521f | ||
|
|
ccefafd172 | ||
|
|
a75bf1b2bb | ||
|
|
15a0b9ab93 | ||
|
|
9bed58a863 | ||
|
|
19dd5ddbae | ||
|
|
8cd636c213 | ||
|
|
d156b716f6 | ||
|
|
3f910824e8 | ||
|
|
3509b05d1e | ||
|
|
164bd18234 | ||
|
|
1eae8c6ea3 | ||
|
|
14881e968a | ||
|
|
fcc9cdcaef | ||
|
|
b32785f88c | ||
|
|
8c9808b2d6 | ||
|
|
5f0b2b0604 | ||
|
|
a80f520c38 | ||
|
|
34c517defc | ||
|
|
d5a762f35c | ||
|
|
ab6ec6d11e | ||
|
|
c8a629d8a5 | ||
|
|
71805500ca | ||
|
|
5e7c12dac7 | ||
|
|
29817d6627 | ||
|
|
c010b7319e | ||
|
|
27b190cadf | ||
|
|
e1a02a0729 | ||
|
|
eb512022e0 | ||
|
|
0aec9a85bb | ||
|
|
c1743eb18d | ||
|
|
ccd2855e01 | ||
|
|
d3338f5d81 | ||
|
|
73ea95ae61 | ||
|
|
6532dacbb1 | ||
|
|
b42338ea38 | ||
|
|
8f07f183dd | ||
|
|
e66aedaaa1 | ||
|
|
affa366f7d | ||
|
|
7d62b330d0 | ||
|
|
9ac9db0fe0 | ||
|
|
b398dacf29 | ||
|
|
1b610242bc | ||
|
|
a6a53f6b9c | ||
|
|
be58dd19c1 | ||
|
|
0d2a1bac36 | ||
|
|
f67815b0d3 | ||
|
|
d4c986fb84 | ||
|
|
b24a7e3faf | ||
|
|
18a78e2892 | ||
|
|
323fbb4713 | ||
|
|
bd6b699a1e | ||
|
|
4795af29ea | ||
|
|
f76a62b7d2 | ||
|
|
da7d200d92 | ||
|
|
2de44e7563 | ||
|
|
f30cdc1933 | ||
|
|
f9ccacf118 | ||
|
|
6ed7e26d86 | ||
|
|
91856ea145 | ||
|
|
5b6b0f09e1 | ||
|
|
291677d0cf | ||
|
|
ccc1c07930 | ||
|
|
d39e9447f3 | ||
|
|
cd44e2d80c | ||
|
|
36a1662afb | ||
|
|
88d5ca0b8a | ||
|
|
15eee102fd | ||
|
|
ce00aef8b1 | ||
|
|
c7a24199c7 | ||
|
|
0db2aebfda | ||
|
|
7ec00a279c | ||
|
|
6e81cdcb01 | ||
|
|
2a05f630b3 | ||
|
|
bf9b738a0f | ||
|
|
50fced2867 | ||
|
|
6276243cc4 | ||
|
|
22c48f19ba | ||
|
|
9872640e77 | ||
|
|
80f7ddfb31 | ||
|
|
5215fa4747 | ||
|
|
7016b77ee8 | ||
|
|
5edb0d0e3d | ||
|
|
a2c1fa5e23 | ||
|
|
520f92e892 | ||
|
|
305d408e02 | ||
|
|
8ccb747dcd | ||
|
|
a1d5a2e1f9 | ||
|
|
2f56487290 | ||
|
|
2ebf66b99c | ||
|
|
881da033b8 | ||
|
|
1e972cbb65 | ||
|
|
bab120235d | ||
|
|
36404fd93d | ||
|
|
3b90038b62 | ||
|
|
40660f2379 | ||
|
|
7ab7193592 | ||
|
|
1fabc14ac9 | ||
|
|
d9492eee28 | ||
|
|
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 | ||
|
|
0dd4f3b3d3 | ||
|
|
ccc0189e70 | ||
|
|
8543636576 | ||
|
|
b09025df08 | ||
|
|
39c747e430 | ||
|
|
2104822cac | ||
|
|
bcf713932a | ||
|
|
6d671b6576 | ||
|
|
b7345107d7 | ||
|
|
9cdfdf9bda | ||
|
|
42f200aabd | ||
|
|
f8853ae902 | ||
|
|
061201c0de | ||
|
|
f11dab363f | ||
|
|
48dd50afe4 | ||
|
|
49cefa92e2 | ||
|
|
352e71d9e9 | ||
|
|
2b13af2367 | ||
|
|
2296ef0987 | ||
|
|
30f11e4e46 | ||
|
|
97a5c15c36 | ||
|
|
43dbaf7004 | ||
|
|
55bb65034f | ||
|
|
57ebb297c0 | ||
|
|
a513f10296 | ||
|
|
a1074852dd | ||
|
|
5f546a3df8 | ||
|
|
986c19ef6e | ||
|
|
bea7ad5876 | ||
|
|
b1fa124032 | ||
|
|
a15de64160 | ||
|
|
af3a23ce66 | ||
|
|
b55c654a81 | ||
|
|
b97841b6fd | ||
|
|
ac64428abb | ||
|
|
1857ce5113 | ||
|
|
f4f3f6e29c | ||
|
|
9354a0ab88 | ||
|
|
6ef9c0b305 | ||
|
|
6b951d2773 | ||
|
|
064e9d58af | ||
|
|
1d5092cf22 | ||
|
|
861d35e8d3 | ||
|
|
f92c519d05 | ||
|
|
ecd3ad40ae | ||
|
|
6d94ff8d1f | ||
|
|
fad3c2bbdf | ||
|
|
46c53ea679 | ||
|
|
062caa8f53 | ||
|
|
f6a39fea4b | ||
|
|
bfabdb7b6a | ||
|
|
ea82f89b53 | ||
|
|
7f9edddbcc | ||
|
|
23443b2632 | ||
|
|
114eab952b | ||
|
|
883cd3f516 | ||
|
|
a3e2d3ec71 | ||
|
|
7213f0dd5d | ||
|
|
f8472721ee | ||
|
|
9634bc99bd | ||
|
|
81a0ba08bd | ||
|
|
12f5bd141d | ||
|
|
6e2b7e534b | ||
|
|
3bbdd1ea72 | ||
|
|
2b09e74dcf | ||
|
|
543365f296 | ||
|
|
da3bf945cb | ||
|
|
4e311ca279 | ||
|
|
18c449a9ed | ||
|
|
d7293ef41d | ||
|
|
5dc76d07ec | ||
|
|
ebfafd7b6e | ||
|
|
24ca9fdafa | ||
|
|
8cdb920f54 | ||
|
|
cccf6449f9 | ||
|
|
88c8860548 | ||
|
|
85a64a6c14 | ||
|
|
d7c3cf7d3e | ||
|
|
9bd2da04e2 | ||
|
|
56563507b6 | ||
|
|
fa98b06dba | ||
|
|
a763d85122 | ||
|
|
db8b1ca0a3 | ||
|
|
5106c391bb | ||
|
|
0c2e285d2e | ||
|
|
f7df80f763 | ||
|
|
676265a92a | ||
|
|
f9ee18584e | ||
|
|
3d394bb621 | ||
|
|
913c0f4ae7 | ||
|
|
04bf086a9e | ||
|
|
2a25328ce0 | ||
|
|
af7393832a | ||
|
|
516bea6e8a | ||
|
|
82bd65eebd | ||
|
|
44b6c53452 | ||
|
|
28b294f48a | ||
|
|
56ed32d094 | ||
|
|
60d81037fd | ||
|
|
8abe40cc81 | ||
|
|
cd9df8065d | ||
|
|
b6d50da809 | ||
|
|
383cc71bb3 | ||
|
|
d75c16bab5 | ||
|
|
8efdbe40e4 | ||
|
|
ada779a97d | ||
|
|
37d28464ea | ||
|
|
816ad7c2fc | ||
|
|
c4d1f9c6a2 | ||
|
|
33e1cfc2ba | ||
|
|
bce9990826 | ||
|
|
923e0500df | ||
|
|
017646e704 | ||
|
|
4900177e8c | ||
|
|
ed97d28254 | ||
|
|
15185e0450 | ||
|
|
a29f8d5f38 | ||
|
|
8dc2d22996 | ||
|
|
4d355f99c0 | ||
|
|
aa0bf396e7 | ||
|
|
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 | ||
|
|
1db9bcd6c9 | ||
|
|
6f7a52a6a6 | ||
|
|
2c3ff3a628 | ||
|
|
976c74d694 | ||
|
|
e3adcfb62e | ||
|
|
cd76cc0e9f | ||
|
|
e2e356d0c2 | ||
|
|
bb7c217ccc | ||
|
|
cd3e664e6a | ||
|
|
e7d3e03169 | ||
|
|
591a2e5dbb | ||
|
|
4e4871fe93 | ||
|
|
6d1b754db5 | ||
|
|
cae9b754bc | ||
|
|
46e0c88280 | ||
|
|
4942db2806 | ||
|
|
b5be515b9b | ||
|
|
51067f2802 | ||
|
|
62a65c5c1d | ||
|
|
b9e23113c8 | ||
|
|
50f1a61182 | ||
|
|
ed9adfae68 | ||
|
|
cb4ef15c77 | ||
|
|
e4e18f0a62 | ||
|
|
ab8cbcb450 | ||
|
|
4103fac605 | ||
|
|
0a58797f78 | ||
|
|
5db7f5f2e7 | ||
|
|
47a3de8fe1 | ||
|
|
2b725560cc | ||
|
|
9f9cb833f0 | ||
|
|
f88290d34e | ||
|
|
157ff2df4f | ||
|
|
a9117573fb | ||
|
|
cea28c591f | ||
|
|
b963146faa | ||
|
|
181c948e86 | ||
|
|
d3b8e11783 | ||
|
|
b3b19eff49 | ||
|
|
d09d2dcffd | ||
|
|
c5fddbbb69 | ||
|
|
2ef360a7ac | ||
|
|
509d26f938 | ||
|
|
5a9efff87c | ||
|
|
24a93d107a | ||
|
|
67aa31439b | ||
|
|
26902b4565 | ||
|
|
e320aff5dc | ||
|
|
3f971fbab1 | ||
|
|
f24ce61cc9 | ||
|
|
137be1c7fa | ||
|
|
039018ddc9 | ||
|
|
bef784b32a | ||
|
|
eaad3ebeac | ||
|
|
af8637f8a4 | ||
|
|
ba5ec70669 | ||
|
|
503f20a7f4 | ||
|
|
1237b553f7 | ||
|
|
86c89a47da | ||
|
|
ff895f3251 | ||
|
|
b40cb3331a | ||
|
|
88025040c3 | ||
|
|
130c1aba67 | ||
|
|
e7c0cda77f | ||
|
|
a07c2f4c32 | ||
|
|
99e64388ba | ||
|
|
96b7a4efe6 | ||
|
|
124b2ff431 | ||
|
|
c1ec72e606 | ||
|
|
ef1faf9f68 | ||
|
|
02595b9ea6 | ||
|
|
c1514635b0 | ||
|
|
e5e7205c95 | ||
|
|
f8d1bf0811 | ||
|
|
a1f185b0f0 | ||
|
|
8981ae3117 | ||
|
|
2a948ca4c2 | ||
|
|
8ff0524bbc | ||
|
|
e749c9764c | ||
|
|
d9f0c55fee | ||
|
|
69a6adf0a8 | ||
|
|
ab064c90dd | ||
|
|
50d2bf5d8d | ||
|
|
d39fd5bb5c | ||
|
|
817df662da | ||
|
|
d093b461d6 | ||
|
|
5cc756f853 | ||
|
|
07c443598b | ||
|
|
3c6116255b | ||
|
|
5689e3815a | ||
|
|
9bf6a72621 | ||
|
|
2e02aa16bb | ||
|
|
1a9865ebc4 | ||
|
|
8e7fddd6b0 | ||
|
|
ac8f6455ff | ||
|
|
3c268c8cbd | ||
|
|
a11227b15a | ||
|
|
10b56e7b4f | ||
|
|
f52db71ec6 | ||
|
|
38b52b826a | ||
|
|
bc1f21961c | ||
|
|
0e1f843f50 | ||
|
|
2a5d1fb84a | ||
|
|
3b0d0dcd0c | ||
|
|
f92cf3df4f | ||
|
|
274c9904e6 | ||
|
|
44ee017dee | ||
|
|
1416650c9d | ||
|
|
4acf6d336b | ||
|
|
dd7a861280 | ||
|
|
bbb4893857 | ||
|
|
3054c2366e | ||
|
|
51e367a61d | ||
|
|
165803c95c | ||
|
|
d01ed38895 | ||
|
|
f9e9b423dd | ||
|
|
cdfef0f884 | ||
|
|
ddc8e4a29e | ||
|
|
f576f39bc6 | ||
|
|
f74cd97c4b | ||
|
|
bb91d8e1e3 | ||
|
|
ee8fd22f36 | ||
|
|
c0d4599a35 | ||
|
|
24a7d4b82d | ||
|
|
5c5a5e200e | ||
|
|
864d747e3b | ||
|
|
d623820833 | ||
|
|
a9be6a54ff | ||
|
|
d41b6c185a | ||
|
|
3b60cb2bcd | ||
|
|
fe3ff15539 | ||
|
|
f5018f628a | ||
|
|
03e45f4590 | ||
|
|
ce31ceda65 | ||
|
|
aa00419198 | ||
|
|
fd5575ace5 | ||
|
|
c8737bd43f | ||
|
|
2e31e08522 | ||
|
|
1412805503 | ||
|
|
eff6b31ee8 | ||
|
|
03259aeca0 | ||
|
|
812e269195 | ||
|
|
dbb5c1482b | ||
|
|
afa66d0418 | ||
|
|
7177b396e0 | ||
|
|
e796f7e81f | ||
|
|
006fde8fea | ||
|
|
8499ca358b | ||
|
|
890779713a | ||
|
|
63b8cc1104 | ||
|
|
c4c995a9a3 | ||
|
|
511105beb3 | ||
|
|
718fe7e8ae | ||
|
|
258447c17b | ||
|
|
1d8be20962 | ||
|
|
a90c51ec0f | ||
|
|
077076532f | ||
|
|
e1bf657a05 | ||
|
|
7ca2051f84 | ||
|
|
8ff5cc7cbb | ||
|
|
bca4af201d | ||
|
|
9af243177f | ||
|
|
ca3c2bf70a | ||
|
|
ce5fc9715d | ||
|
|
606a50047c | ||
|
|
b58c0705fc | ||
|
|
92649a393d | ||
|
|
98db1a5757 | ||
|
|
841c226732 | ||
|
|
7e8c8f4bb7 | ||
|
|
ebedca82f3 | ||
|
|
e06b61e8d2 | ||
|
|
e2e703540e | ||
|
|
e53c6bb4da | ||
|
|
8fa3a73fb2 | ||
|
|
5c8b318a93 | ||
|
|
029907a87a | ||
|
|
56cff59438 | ||
|
|
2f4a113685 | ||
|
|
f512a08051 | ||
|
|
cb223d7ddf | ||
|
|
96a4bf3464 | ||
|
|
338bcf0d2d | ||
|
|
8cb7396f33 | ||
|
|
b69bb85003 | ||
|
|
729a74a561 | ||
|
|
5f0d47ca88 | ||
|
|
f9b1071539 | ||
|
|
7d47834e55 | ||
|
|
2e1120dc50 | ||
|
|
64a2fe1410 | ||
|
|
caa09cbcfb | ||
|
|
ba4329e623 | ||
|
|
575e46c3db | ||
|
|
45237c9298 | ||
|
|
7de32c74e6 | ||
|
|
01b942e1fc | ||
|
|
3388d35fe0 | ||
|
|
2f014bb505 | ||
|
|
f9f7090b63 | ||
|
|
0bc95e4b5e | ||
|
|
250b41612e | ||
|
|
c5b70ccc4a | ||
|
|
8b94aded16 | ||
|
|
e105d8f51e | ||
|
|
54ed725061 | ||
|
|
5844330301 | ||
|
|
d1c80dfd9b | ||
|
|
b2097e2f93 | ||
|
|
7386a2f40f | ||
|
|
5a1ecb55b8 | ||
|
|
b05d7d09cf | ||
|
|
30dc0abc25 | ||
|
|
a7a6e9edfc | ||
|
|
854cb7ee49 | ||
|
|
f7ca8fb943 | ||
|
|
dc0423f97e | ||
|
|
af968f1868 | ||
|
|
2cc73cc52a | ||
|
|
28109dfb39 | ||
|
|
2912994e6b | ||
|
|
6d6d5996d7 | ||
|
|
54fda32591 | ||
|
|
5d44b44558 | ||
|
|
e321d759c0 | ||
|
|
bb3a65f8ff | ||
|
|
8da59dc288 | ||
|
|
bd433e0776 | ||
|
|
fc9644f448 | ||
|
|
1558970064 | ||
|
|
991dd55049 | ||
|
|
8f0c5fb508 | ||
|
|
5e1d43b5af | ||
|
|
487018f146 | ||
|
|
3ade8b09c5 | ||
|
|
3180221a42 | ||
|
|
9c37a8472e | ||
|
|
136d9143e7 | ||
|
|
4aad4887fd | ||
|
|
dfee1cc490 | ||
|
|
ffc7832ec7 | ||
|
|
3910e66905 | ||
|
|
6fcfb9cf36 | ||
|
|
83d2ade699 | ||
|
|
fef98e478d | ||
|
|
f7ba260717 | ||
|
|
82f9f2f73f | ||
|
|
e649690f6a | ||
|
|
182500c2d2 | ||
|
|
aca48d45b3 | ||
|
|
783682251f | ||
|
|
b2823c81e4 | ||
|
|
7465e1ae4b | ||
|
|
743d1a0e86 | ||
|
|
761df3f2cf | ||
|
|
6f3443232e | ||
|
|
588dac343e | ||
|
|
aa222b6861 | ||
|
|
6d01ec4c55 | ||
|
|
f72c64d7d1 | ||
|
|
92a3e974b0 | ||
|
|
7d6cce5881 | ||
|
|
17f6f1cd4c | ||
|
|
4b856fba2a | ||
|
|
3a8e4e065e | ||
|
|
43f9bd5239 | ||
|
|
6f5a0b9a3f | ||
|
|
ecf55e64ae | ||
|
|
cd566ac9c0 | ||
|
|
b3323b7c2d | ||
|
|
70e64d9471 | ||
|
|
cbc3f8e917 | ||
|
|
55dfdc723f | ||
|
|
6101ded74a | ||
|
|
0d49bbfa7a | ||
|
|
f6d83c17bd | ||
|
|
ac90a0973d | ||
|
|
27d6447a83 | ||
|
|
f195c61200 | ||
|
|
20044fa6a7 | ||
|
|
26480882c8 | ||
|
|
b23020435f | ||
|
|
267e2be69b | ||
|
|
b9428360c0 | ||
|
|
2112be8ef7 | ||
|
|
e5ee978eb2 | ||
|
|
55fd31894b | ||
|
|
189d9adef5 | ||
|
|
44288a5865 | ||
|
|
66f89fb4ad | ||
|
|
eceb671ea8 | ||
|
|
a15615a229 | ||
|
|
8e10bcc739 | ||
|
|
22e65cd5e7 | ||
|
|
72383520cb | ||
|
|
38ef55b869 | ||
|
|
55c7dd860c | ||
|
|
ecefd1d3ee | ||
|
|
0cdd0ca583 | ||
|
|
31a0122cd1 | ||
|
|
6777cd2a9c | ||
|
|
649373ff51 | ||
|
|
ca09a5dd46 | ||
|
|
11546cd906 | ||
|
|
4110130ca7 | ||
|
|
6b9900ad4e | ||
|
|
97e6222176 | ||
|
|
3d39f50388 | ||
|
|
eef56a7c82 | ||
|
|
8853666645 | ||
|
|
a379764076 | ||
|
|
edd1cc6059 | ||
|
|
f355b2269c | ||
|
|
03280db377 | ||
|
|
86aeff5547 | ||
|
|
b5b2062efa | ||
|
|
b51731d675 | ||
|
|
229e8d9592 | ||
|
|
da9c19bba4 | ||
|
|
3156851554 | ||
|
|
a19cb5f2bc | ||
|
|
2639f94dff | ||
|
|
2c769f8043 | ||
|
|
332f7db32f | ||
|
|
3381f6af3a | ||
|
|
45d33b951c | ||
|
|
1922b32799 | ||
|
|
6bb72c363f | ||
|
|
378382f3ad | ||
|
|
7e09493cf2 | ||
|
|
5c6bd1a043 | ||
|
|
dcdd5e8f2d | ||
|
|
126fce9119 | ||
|
|
a3b3f91f8d | ||
|
|
69568378ec | ||
|
|
0b5879ffb3 | ||
|
|
0bd2c6220d | ||
|
|
a434ce2080 | ||
|
|
8776b36bb0 | ||
|
|
9bde946c55 | ||
|
|
c74898b970 | ||
|
|
f0f2314639 | ||
|
|
c8193380e7 | ||
|
|
e38580c9c2 | ||
|
|
edf38cef33 | ||
|
|
a700ec32fd | ||
|
|
7dcd5f41ec | ||
|
|
c46ff7daff | ||
|
|
d2ca916043 | ||
|
|
09e901b31b | ||
|
|
01208a858d | ||
|
|
c379db831c | ||
|
|
d478a8a8b4 | ||
|
|
4418653edb | ||
|
|
1d9bcaa786 | ||
|
|
8bd943eb71 | ||
|
|
39535e9bf8 | ||
|
|
db90142c4b | ||
|
|
63bd3374be | ||
|
|
7a232c8f5d | ||
|
|
b24c59ce55 | ||
|
|
34f9dd9ea2 | ||
|
|
0290c738e1 | ||
|
|
0acb8e6a63 | ||
|
|
27bfd0078c | ||
|
|
a98ab3d823 | ||
|
|
bbf4de4f5e | ||
|
|
4d3fba2bd0 | ||
|
|
83cc7015bf | ||
|
|
f20297b5dd | ||
|
|
b4521643b2 | ||
|
|
dfe151ccb1 | ||
|
|
67a75730d0 | ||
|
|
d12369f6f4 | ||
|
|
4a7ce87ac2 | ||
|
|
d8b36ef0da | ||
|
|
1341ec80bf | ||
|
|
9882291828 | ||
|
|
aa4fa1e42e | ||
|
|
8a641d3e37 | ||
|
|
317f5f8d48 | ||
|
|
98f136e747 | ||
|
|
94792fe571 | ||
|
|
92c0ddd068 | ||
|
|
6a43f0a09d | ||
|
|
4f037896db | ||
|
|
494a87feea | ||
|
|
4a3af6bc8a | ||
|
|
0c7851bd26 | ||
|
|
5b46ae2eb9 | ||
|
|
2034eedbe4 | ||
|
|
fde4f64b83 | ||
|
|
404927c53c | ||
|
|
e0796b0cf1 | ||
|
|
8df8749a9c | ||
|
|
1c2fb14f45 | ||
|
|
4a2354ab26 | ||
|
|
82f70ff75e | ||
|
|
46b2d5fbcd | ||
|
|
be8cd85bfe | ||
|
|
7c4eefe8ee | ||
|
|
19d6e30889 | ||
|
|
23b2e35dbd | ||
|
|
a576ddf0e4 | ||
|
|
df63b3ece0 | ||
|
|
3174d8fb1c | ||
|
|
bed0e65548 | ||
|
|
1357978596 | ||
|
|
c5765c20bc | ||
|
|
174af34115 | ||
|
|
52cd614613 | ||
|
|
5c3711bcc8 | ||
|
|
db04046cb3 | ||
|
|
5ec48f72e0 | ||
|
|
31aef1d200 | ||
|
|
4aaa2c6fed | ||
|
|
5d3c84327d | ||
|
|
909307f5ce | ||
|
|
7c7582f09b | ||
|
|
6f6dff4897 | ||
|
|
8611e70ba3 | ||
|
|
7edce19c9c | ||
|
|
de52b1663d | ||
|
|
eb1feba304 | ||
|
|
9df6368558 | ||
|
|
0a6092b738 | ||
|
|
6b852822a5 | ||
|
|
b4cde98526 | ||
|
|
5f0f1966a8 | ||
|
|
dbadee987c | ||
|
|
995943d84d | ||
|
|
7a1c6bd9e4 | ||
|
|
d8fe3920b1 | ||
|
|
75af036fcf | ||
|
|
accc9890df | ||
|
|
a920556feb | ||
|
|
351cb4a1ac | ||
|
|
764a5f3e0a | ||
|
|
cb97973b1c | ||
|
|
331f09cdd9 | ||
|
|
939084d57b | ||
|
|
1cbfc71fc6 | ||
|
|
7b550200f0 | ||
|
|
d41a2adce7 | ||
|
|
665a11fa2b | ||
|
|
1a49b161cc | ||
|
|
521b53dc09 | ||
|
|
2c94ae8bb4 | ||
|
|
ebbedc558d | ||
|
|
0065c3d610 | ||
|
|
99e4870a52 | ||
|
|
13ad27bc90 | ||
|
|
7ae361cb7c | ||
|
|
0e1bfbb0b5 | ||
|
|
3dec352245 | ||
|
|
8e273a1f19 | ||
|
|
1ab20814e9 | ||
|
|
0325ba4c0a | ||
|
|
b348bff7a8 | ||
|
|
37649a0d3c | ||
|
|
f3d1bf1106 | ||
|
|
93311c628e | ||
|
|
b5e43ed73b | ||
|
|
f8dfc954a0 | ||
|
|
7ac2ba90b1 | ||
|
|
f869393da4 | ||
|
|
dbe5f8a4ba | ||
|
|
a05c38b1fe | ||
|
|
91b6143f15 | ||
|
|
0eaedd4b5e | ||
|
|
727a31fdb5 | ||
|
|
3b64263dc6 | ||
|
|
83b6a63f13 | ||
|
|
6ccece4603 | ||
|
|
f6f6600118 | ||
|
|
04c0bf2f17 | ||
|
|
4da9c5ac07 | ||
|
|
97cae4de59 | ||
|
|
9d1bef9ab9 | ||
|
|
4bd2ba4d13 | ||
|
|
ab0a3cde78 | ||
|
|
72f9e4485e | ||
|
|
87c536b698 | ||
|
|
ac03bad282 | ||
|
|
9efdcc1f34 | ||
|
|
f26a965ea9 | ||
|
|
5c7bd954a2 | ||
|
|
184cb8ba19 | ||
|
|
1d324a2d94 | ||
|
|
eeeb3440c2 | ||
|
|
a1c965584e | ||
|
|
e5b4905a12 | ||
|
|
f64ba96962 | ||
|
|
0eec77d8b3 | ||
|
|
7efbe2213a | ||
|
|
ffa25d1690 | ||
|
|
74088c1d26 | ||
|
|
b03e74c366 | ||
|
|
cd9ee7d139 | ||
|
|
3080f2953d | ||
|
|
f7c7dae3a5 | ||
|
|
3f16f42adf | ||
|
|
feeb2d0f1a | ||
|
|
4c680808c1 | ||
|
|
13a5909c3f | ||
|
|
40be4d25a5 | ||
|
|
d84f887be8 | ||
|
|
009d851b58 | ||
|
|
6d5e6add9b | ||
|
|
62f7915e97 | ||
|
|
7b2e763d07 | ||
|
|
bc29d77aff | ||
|
|
8db2e646db | ||
|
|
3b2e207b6b | ||
|
|
f061d66a16 | ||
|
|
8c295e8d5f | ||
|
|
c1b771fdc8 | ||
|
|
e5b12ece35 | ||
|
|
43c99f8851 | ||
|
|
7304988071 | ||
|
|
d0b0a7490a | ||
|
|
de4bcec782 | ||
|
|
0e843c2a96 | ||
|
|
9abd34baa3 | ||
|
|
4fca31049f | ||
|
|
13f6b62dc0 | ||
|
|
3a5b282b9b | ||
|
|
d763456655 | ||
|
|
b23fa084f1 | ||
|
|
216acf083a | ||
|
|
686a9f7237 | ||
|
|
5a206822c5 | ||
|
|
9805b03533 | ||
|
|
d519f9cf06 | ||
|
|
6265d0e38e | ||
|
|
55d9d64910 | ||
|
|
e2a651e553 | ||
|
|
e4343f0935 | ||
|
|
68090a55e1 | ||
|
|
00bdd684ed | ||
|
|
f4e498e559 | ||
|
|
39c33b1f59 | ||
|
|
55acbb208e | ||
|
|
208f96535e | ||
|
|
64bda53a78 | ||
|
|
e016777331 | ||
|
|
508cab4a0d | ||
|
|
b779be3574 | ||
|
|
fddcebc2d2 | ||
|
|
91c5dc3c19 | ||
|
|
9401eb1591 | ||
|
|
521bb88cda | ||
|
|
c1765258b2 | ||
|
|
6afcb06e08 | ||
|
|
1ae5bb9d27 | ||
|
|
252cd5cde5 | ||
|
|
12558740a4 | ||
|
|
e1fbe8d657 | ||
|
|
b29a3ecfba | ||
|
|
bd3a5ac284 | ||
|
|
7de8b2d881 | ||
|
|
3139dff6ba | ||
|
|
c4211045f2 | ||
|
|
6633dfe1e2 | ||
|
|
9e2a48cae1 | ||
|
|
43f8a0213a | ||
|
|
975978ca9c | ||
|
|
dad630f3eb | ||
|
|
11f8b974df | ||
|
|
00773a0c10 | ||
|
|
6f6066906e | ||
|
|
7730b69ef4 | ||
|
|
e3084cc28e | ||
|
|
b784fc58d0 | ||
|
|
8baa972bb2 | ||
|
|
3b2251017c | ||
|
|
f0e7dace72 | ||
|
|
4a837d3339 | ||
|
|
a2aa43e7fc | ||
|
|
3c0899263f | ||
|
|
91bb601ecb | ||
|
|
1bd0c5d9bf | ||
|
|
8b76426825 | ||
|
|
85464921ba | ||
|
|
9b6034853f | ||
|
|
0ab732c9b2 | ||
|
|
8662648ef5 | ||
|
|
51808b8ced | ||
|
|
2a7e442544 | ||
|
|
dbdd5b8b6e | ||
|
|
b8483376c4 | ||
|
|
70105ccefc | ||
|
|
3a9082a694 | ||
|
|
82c18be717 | ||
|
|
0d39c2a0f6 | ||
|
|
4240af23cf | ||
|
|
80697046d5 | ||
|
|
765dd72b38 | ||
|
|
403b60240f | ||
|
|
f973e6cd72 | ||
|
|
5aff1acea8 | ||
|
|
9e07ca0007 | ||
|
|
df97bef4b5 | ||
|
|
b402738428 | ||
|
|
2de9a6bb94 | ||
|
|
fb0c88cf55 | ||
|
|
1f6096e3ff | ||
|
|
a4e6b5d177 | ||
|
|
4477f5ab93 | ||
|
|
11992d2e08 | ||
|
|
802979b81d | ||
|
|
06d0f5b95b | ||
|
|
da06c84aa4 | ||
|
|
ecae607b59 | ||
|
|
f26717954e | ||
|
|
a4080980ec | ||
|
|
3db21bf778 | ||
|
|
66518ced75 | ||
|
|
5598526f52 | ||
|
|
14ec6e0674 | ||
|
|
549112822a | ||
|
|
e1cb858d9a | ||
|
|
1659c2e753 | ||
|
|
e2222f66a9 | ||
|
|
8a15b5e640 | ||
|
|
f499b11113 | ||
|
|
bec632800d | ||
|
|
a14c2f59b8 | ||
|
|
e66d215dd3 | ||
|
|
809ae20558 | ||
|
|
7b26ecb5f5 | ||
|
|
0c2ccc56cd | ||
|
|
525681b5a5 | ||
|
|
c9a3dfcac9 | ||
|
|
a05aab1c7b | ||
|
|
7dfc638305 | ||
|
|
3585969285 | ||
|
|
3361ebe3c5 | ||
|
|
ebfd7f3e4e | ||
|
|
be49bd167b | ||
|
|
13e9e41890 | ||
|
|
e6eec622c8 | ||
|
|
501b8b7bf5 | ||
|
|
99d78d62fb | ||
|
|
1d5758f5d2 | ||
|
|
fad1916259 | ||
|
|
1bff103e53 | ||
|
|
68013b96d6 | ||
|
|
0c687539fb | ||
|
|
0bf0441f49 | ||
|
|
0c66ac97e8 | ||
|
|
8c261dba73 | ||
|
|
6e3b6cb0c1 | ||
|
|
11155cc609 | ||
|
|
e2c8a773be | ||
|
|
6816c6dd19 | ||
|
|
b9e26a7e2f | ||
|
|
a5baa052e2 | ||
|
|
31d8fe4459 | ||
|
|
71021982ed | ||
|
|
4d9c1f7a65 | ||
|
|
406e9dcaf2 | ||
|
|
d3b0d845eb | ||
|
|
335b977cd4 | ||
|
|
3554c91b2b | ||
|
|
460dab0342 | ||
|
|
fb9b04c192 | ||
|
|
38abb4c9e4 | ||
|
|
fc469d6433 | ||
|
|
478d809620 | ||
|
|
52f1d727c0 | ||
|
|
80a29dc5a1 | ||
|
|
f4703be2ca | ||
|
|
7c78cf067c | ||
|
|
54cbfbe699 | ||
|
|
05f454157f | ||
|
|
c451f0f1a6 | ||
|
|
35b85bec36 | ||
|
|
b0c64be31d | ||
|
|
d09a28e3da | ||
|
|
550c66b25b | ||
|
|
dfec9e24f3 | ||
|
|
5a7c481f69 | ||
|
|
2350889445 | ||
|
|
990854e176 | ||
|
|
076e84ed24 | ||
|
|
8c727b979c | ||
|
|
60de48ad65 | ||
|
|
2fd1abce5c | ||
|
|
691a61de72 | ||
|
|
22164031fe | ||
|
|
cb50144624 | ||
|
|
3a153c3abe | ||
|
|
d22645e56a | ||
|
|
08fe3beef1 | ||
|
|
2c54c92e14 | ||
|
|
c127cd9016 | ||
|
|
9cb790ac23 | ||
|
|
c2c7381bc1 | ||
|
|
1e4eeb2bcf | ||
|
|
b1f99f8d2f | ||
|
|
acd9763b9d | ||
|
|
f752da7d03 | ||
|
|
7ddcf6d0d4 | ||
|
|
b21776183e | ||
|
|
9c0dcac5c6 | ||
|
|
1b75d8b8e2 | ||
|
|
9f2167ac3c | ||
|
|
145e305494 | ||
|
|
8f4d185ea6 | ||
|
|
4b5ff6be5d | ||
|
|
d27ef85b9e | ||
|
|
1ac210c2fc | ||
|
|
878b7f4b43 | ||
|
|
7cbac66935 | ||
|
|
7e09223e6e | ||
|
|
b4e1be5bee | ||
|
|
d3e5e236ac | ||
|
|
238ce98c44 | ||
|
|
2824e5d850 | ||
|
|
cd154d5748 | ||
|
|
c0a8153a10 | ||
|
|
3433fc7651 | ||
|
|
22d1ee8f60 | ||
|
|
5155958ade | ||
|
|
5fdd486bab | ||
|
|
4672037bcd | ||
|
|
2281b82b5a | ||
|
|
3fe096c7d4 | ||
|
|
dd3ca0e161 | ||
|
|
d8da78f900 | ||
|
|
9325e7be8f | ||
|
|
f3f94bf80e | ||
|
|
506dc2455a | ||
|
|
94d6ee15b5 | ||
|
|
2d918d32a1 | ||
|
|
dd516b573b | ||
|
|
de9698efc8 | ||
|
|
14b026f04b | ||
|
|
9dd45440c0 | ||
|
|
c59e8387ca | ||
|
|
772ad9f04f | ||
|
|
6053c2c619 | ||
|
|
a515b133c5 | ||
|
|
240dae9a1a | ||
|
|
b8a703233a | ||
|
|
bf44c95d00 | ||
|
|
c3dd1755dc | ||
|
|
b6e766ee44 | ||
|
|
5437040b78 | ||
|
|
c786569981 | ||
|
|
7064b14539 | ||
|
|
f275ae98f5 | ||
|
|
ef07d89e29 | ||
|
|
b9bbd45e15 | ||
|
|
2bda27b80d | ||
|
|
e9cfff8165 | ||
|
|
6ebf90cc50 | ||
|
|
ea00bebb04 | ||
|
|
b862d835a5 | ||
|
|
d6602747ae | ||
|
|
9f79429d03 | ||
|
|
5ff0c09868 | ||
|
|
ad1c3e63a4 | ||
|
|
24dd6ba675 | ||
|
|
85f036a45b | ||
|
|
6f8342b9a8 | ||
|
|
c5c6f6b820 | ||
|
|
3d472c34a1 | ||
|
|
63ca366bd8 | ||
|
|
e9e888ab7f | ||
|
|
5ea55b3e3a | ||
|
|
8b1797927a | ||
|
|
05a98964fb | ||
|
|
8cbf798de8 | ||
|
|
9314a24cb2 | ||
|
|
1153d477ee | ||
|
|
d63b158966 | ||
|
|
f23202545b | ||
|
|
19b1683e61 | ||
|
|
d029107e75 | ||
|
|
bc97e0b703 | ||
|
|
037f45df1e | ||
|
|
0eeb6758f4 | ||
|
|
f47c663f79 | ||
|
|
6f9d41eadb | ||
|
|
1b512edc56 | ||
|
|
884a6da2bd | ||
|
|
7a3d958fc1 | ||
|
|
7223581539 | ||
|
|
664bd2de3f | ||
|
|
63568e3861 | ||
|
|
5279192102 | ||
|
|
f149d058a1 | ||
|
|
0c8516d33a | ||
|
|
970251ced3 | ||
|
|
651f9637fc | ||
|
|
dba7a7dc3c | ||
|
|
393c0be407 | ||
|
|
36c5c9939b | ||
|
|
5e9ea2429b | ||
|
|
613e32194f | ||
|
|
81a14995da | ||
|
|
4267ac9a8d | ||
|
|
bcf72cc0e8 | ||
|
|
9a1e96fb99 | ||
|
|
bdcbf12246 | ||
|
|
894b843ccb | ||
|
|
4a9d67521f | ||
|
|
a353dceaa3 | ||
|
|
802dd2608e | ||
|
|
ebc4bf4b45 | ||
|
|
906828fadb | ||
|
|
e35612a6f6 | ||
|
|
f4e0272db9 | ||
|
|
5ecfc5e09d | ||
|
|
927b819bc8 | ||
|
|
857731e89f | ||
|
|
24fed58c81 | ||
|
|
57cef86ca1 | ||
|
|
0f91e18fce | ||
|
|
c01a0147f2 | ||
|
|
d695b6d51a | ||
|
|
3d1e4a93fd | ||
|
|
54d9a98090 | ||
|
|
6a5d36c57a | ||
|
|
86ea7dde40 | ||
|
|
7f709aee53 | ||
|
|
4df7bcd87f | ||
|
|
81d415c5ba | ||
|
|
de1b801bda | ||
|
|
2c665fef6f | ||
|
|
c6fbf405bf | ||
|
|
7076c35521 | ||
|
|
86ed1b709e | ||
|
|
0be25bd362 | ||
|
|
d30c96e8cb | ||
|
|
0af52ba3ae | ||
|
|
fbe97556de | ||
|
|
7a6f43bece | ||
|
|
afca521fe5 | ||
|
|
bfd61893a1 | ||
|
|
72d374786f | ||
|
|
d3e2875c94 | ||
|
|
eb40eec4c1 | ||
|
|
1daac9a124 | ||
|
|
991f1b17dd | ||
|
|
38f3e48aed | ||
|
|
9a9aa75684 | ||
|
|
d1b023c8c8 | ||
|
|
0d6faed3d5 | ||
|
|
b3750f78ff | ||
|
|
82f96dd080 | ||
|
|
d640ce06d7 | ||
|
|
b8fb74fef3 | ||
|
|
ab4bbbff72 | ||
|
|
4180949307 | ||
|
|
e68ff858f2 | ||
|
|
4cf4d49f48 | ||
|
|
a19c4dc5e5 | ||
|
|
d37505ff06 | ||
|
|
7f6ce1f299 | ||
|
|
262a84aac6 | ||
|
|
3f12ebb2bd | ||
|
|
b58fcf331c | ||
|
|
b978645c28 | ||
|
|
fe51278295 | ||
|
|
c3fb84981e | ||
|
|
919aad4f30 | ||
|
|
818e6046b7 | ||
|
|
59a99f4c21 | ||
|
|
f01d2a0ba6 | ||
|
|
8df0a2d059 | ||
|
|
d7ed91af1d | ||
|
|
081dcc021b | ||
|
|
70ebd0d475 | ||
|
|
02bbb38606 | ||
|
|
d00014ea59 | ||
|
|
210d6ac8ac | ||
|
|
55248e7fcf | ||
|
|
cb94235ac1 | ||
|
|
d0c50c49a7 | ||
|
|
7f1217b2ab | ||
|
|
3b01393a71 | ||
|
|
23b36b5074 | ||
|
|
2e7f0721b9 | ||
|
|
4927e55c7e | ||
|
|
c51d33fa6e | ||
|
|
8630d8cd47 | ||
|
|
659243baa1 | ||
|
|
b6a84c1646 | ||
|
|
c33afa4a3b | ||
|
|
1428c3c2bf | ||
|
|
aa0cbfda74 | ||
|
|
9d13ff3c9f | ||
|
|
e47c13b7ac | ||
|
|
3f5b96bd45 | ||
|
|
63c1372c34 | ||
|
|
8b915f9ac1 | ||
|
|
f3a18a0655 | ||
|
|
e8351d44b6 | ||
|
|
297af069cb | ||
|
|
baa5d6630d | ||
|
|
0c30730ef6 | ||
|
|
ef763487a5 | ||
|
|
03f5ac87fa | ||
|
|
c82148fafc | ||
|
|
d1346dee53 | ||
|
|
6722b43244 | ||
|
|
b2cac97106 | ||
|
|
cfdbf1f4ad | ||
|
|
48a00ba911 | ||
|
|
4b1102357a | ||
|
|
e3b0204b2c | ||
|
|
a2799ddcca | ||
|
|
76198f61de | ||
|
|
c3ce75055a | ||
|
|
90d64c4e15 | ||
|
|
595648a2b3 | ||
|
|
8e799ddd74 | ||
|
|
a754e9c08a | ||
|
|
112c9398e7 | ||
|
|
ccd691548e | ||
|
|
afd7b85005 | ||
|
|
f9e1cdb940 | ||
|
|
63fe657c7d | ||
|
|
ff2006ad74 | ||
|
|
55c9c7297f | ||
|
|
4b083ee72e | ||
|
|
6574ec2fb9 | ||
|
|
f54bb349b5 | ||
|
|
6f1252e27d | ||
|
|
7d65b5369f | ||
|
|
4877c81728 | ||
|
|
5cb207edfa | ||
|
|
fc39a0dedf | ||
|
|
0b3e7240a8 | ||
|
|
f32c346534 | ||
|
|
3165004d0e | ||
|
|
ec3b1cf130 | ||
|
|
a0437713bf | ||
|
|
96f7ff550c | ||
|
|
837216d78e | ||
|
|
dfb6006f9c | ||
|
|
fb0765a5f3 | ||
|
|
2e8769496f | ||
|
|
bdb39fcd8d | ||
|
|
31516c7987 | ||
|
|
b985ce06a2 | ||
|
|
12d6546062 | ||
|
|
fb71da3627 | ||
|
|
a90ffff320 | ||
|
|
9abf2bca75 | ||
|
|
3db6770dfd | ||
|
|
3a951576ee | ||
|
|
6b0d67ac36 | ||
|
|
d06b8ac398 | ||
|
|
67435ebf9e | ||
|
|
2ee29630fb | ||
|
|
7fa21e9aea | ||
|
|
b4b206f575 | ||
|
|
f363663b3e | ||
|
|
42d957e21b | ||
|
|
07f9756bc8 | ||
|
|
e958e43b49 | ||
|
|
0d150e4b08 | ||
|
|
0deff73a46 | ||
|
|
bf67c6b1d0 | ||
|
|
f1cf370680 | ||
|
|
affa23040b | ||
|
|
a15cefc80f | ||
|
|
5cf00d903b | ||
|
|
b24caf397a | ||
|
|
f051e33a0c | ||
|
|
ff2b28ac73 | ||
|
|
e2367d26d1 | ||
|
|
e1a65add5d | ||
|
|
913426bfdb | ||
|
|
d7b0726e42 | ||
|
|
cadb67e6c9 | ||
|
|
564838a439 | ||
|
|
4554bcc565 | ||
|
|
fd48335688 | ||
|
|
222f56d1b2 | ||
|
|
b71870f57b | ||
|
|
01c9632025 | ||
|
|
1533e13d68 | ||
|
|
89965ad718 | ||
|
|
eb74f3525a | ||
|
|
536f88dee0 | ||
|
|
2622ba286e | ||
|
|
a1d490cb49 | ||
|
|
b357c09171 | ||
|
|
48e71afec1 | ||
|
|
1c6fce9339 | ||
|
|
96551d3b75 | ||
|
|
7a832df4d3 | ||
|
|
c3b6121968 | ||
|
|
b3b2b65c5f | ||
|
|
47a805ede7 | ||
|
|
7a3ccec38d | ||
|
|
d8da0a11a2 | ||
|
|
d5c3332635 | ||
|
|
0137f2254d | ||
|
|
206d562f3f | ||
|
|
63f649724e | ||
|
|
da769ce524 | ||
|
|
2e99636bb0 | ||
|
|
ff7f68f5b4 | ||
|
|
14eec0c902 | ||
|
|
b064c534d8 | ||
|
|
e7c0f322ee | ||
|
|
725754c427 | ||
|
|
9a6c0a0280 | ||
|
|
26d8c05ce7 | ||
|
|
91a9f20af7 | ||
|
|
90745d91aa | ||
|
|
0dbae34998 | ||
|
|
eec93b8013 | ||
|
|
cfe3f01b32 | ||
|
|
df10262ebb | ||
|
|
a87ac3e35e | ||
|
|
b71d9d2e68 | ||
|
|
43452e1af4 | ||
|
|
a4706e0785 | ||
|
|
c921ab463c | ||
|
|
892816dadf | ||
|
|
cc44a5785d | ||
|
|
172d2bf545 | ||
|
|
e7e1fd711e | ||
|
|
7493b3d2ab | ||
|
|
ba5459eeb6 | ||
|
|
31370741f2 | ||
|
|
0bd9c696df | ||
|
|
c14af4a136 | ||
|
|
8dfa841a7b | ||
|
|
a6de843c75 | ||
|
|
0bb1efcd50 | ||
|
|
26e8c2ca2b | ||
|
|
12ffca7374 | ||
|
|
e187f73044 | ||
|
|
6ecf65d83a | ||
|
|
231c173545 | ||
|
|
f12b7fd772 | ||
|
|
14ea041c72 | ||
|
|
6fb804292c | ||
|
|
f77f7361a9 | ||
|
|
d6d19d5dab | ||
|
|
8074bfacb6 | ||
|
|
f5f7b99479 | ||
|
|
f0a8c27829 | ||
|
|
30024f2341 | ||
|
|
ff0dcafeea | ||
|
|
8580451bce | ||
|
|
d867868854 | ||
|
|
b1644d4817 | ||
|
|
a9a3a04379 | ||
|
|
3aa55ee9c3 | ||
|
|
8cfc8a5492 | ||
|
|
3f1c8db362 | ||
|
|
0d999d7a70 | ||
|
|
8bc081d937 | ||
|
|
42eb8d1af5 | ||
|
|
1a810bc923 | ||
|
|
065572ef64 | ||
|
|
e88702e10c | ||
|
|
ee2d934525 | ||
|
|
2a3a33226e | ||
|
|
539315710c | ||
|
|
191a6ca76f | ||
|
|
7ac9f0cbef | ||
|
|
5f7bf4164d | ||
|
|
43690c9b2c | ||
|
|
02c14bfa5c | ||
|
|
0544811c7d | ||
|
|
e079bac283 | ||
|
|
862f1fce2c | ||
|
|
5aeb78f2a5 | ||
|
|
cb42bc581b | ||
|
|
5fc9410b59 | ||
|
|
84d3ee7170 | ||
|
|
accef8f1e1 | ||
|
|
4a8edff694 | ||
|
|
aac3b8d025 | ||
|
|
4034658e44 | ||
|
|
7d4898dd8b | ||
|
|
71fe6ec9da | ||
|
|
075097c219 | ||
|
|
f70ec60ae4 | ||
|
|
aeafd46f24 | ||
|
|
5f57044118 | ||
|
|
65006c11d3 | ||
|
|
76bc184f6c | ||
|
|
dd39a444f2 | ||
|
|
1a16012a5c | ||
|
|
c49aae8d49 | ||
|
|
d5dc52d3d3 | ||
|
|
4f1f1ede97 | ||
|
|
c98b896fc8 | ||
|
|
3714735c2a | ||
|
|
025cc093db | ||
|
|
924d79c20d | ||
|
|
0926f68776 | ||
|
|
26f3806b3c | ||
|
|
d628320c8d | ||
|
|
41fc4c7cfd | ||
|
|
1c8ca2b110 | ||
|
|
241d107485 | ||
|
|
8d0601c2ad | ||
|
|
31118254a0 | ||
|
|
85a1636776 | ||
|
|
3b227932e9 | ||
|
|
ff591bce04 | ||
|
|
c3a03d89c4 | ||
|
|
dd405532af | ||
|
|
677cdc77e4 | ||
|
|
f9463d8efa | ||
|
|
77c9badeca | ||
|
|
926287eb97 | ||
|
|
7a91b19962 | ||
|
|
c148ff5a05 | ||
|
|
ef7e658f9d | ||
|
|
0e9b9d15ea | ||
|
|
dd2d437a21 | ||
|
|
b9779d4dba | ||
|
|
1d40d8c4ef | ||
|
|
847b1f5cb7 | ||
|
|
9448a98573 | ||
|
|
14bce36b95 | ||
|
|
ba4c54004a | ||
|
|
9fdfc09229 | ||
|
|
b19bc7d77e | ||
|
|
58815ae9c4 | ||
|
|
0b12c9b5a8 | ||
|
|
863abe86ca | ||
|
|
f54d2fb0fe | ||
|
|
8824ba3824 | ||
|
|
8a8db796be | ||
|
|
4f532b766f | ||
|
|
e175a4e00b | ||
|
|
473e843142 | ||
|
|
ef8e71cb11 | ||
|
|
ea985151dd | ||
|
|
62fae0ad8b | ||
|
|
f9210ee3bc | ||
|
|
d5101dd0b2 | ||
|
|
2a7940bfd1 | ||
|
|
047d38daab | ||
|
|
2d61f5c861 | ||
|
|
750f305c46 | ||
|
|
51b79e58d3 | ||
|
|
915b4e9d15 | ||
|
|
c9c0c06763 | ||
|
|
406037dabe | ||
|
|
d9affe2331 | ||
|
|
6df675523f | ||
|
|
65e66e8ace | ||
|
|
5efb0c7136 | ||
|
|
1793340474 | ||
|
|
d10db6d1d2 | ||
|
|
9eefbcea72 | ||
|
|
d56b70a8e7 | ||
|
|
54ebb9dfec | ||
|
|
43b6597ec0 | ||
|
|
b7d887d610 | ||
|
|
ff9b35ab45 | ||
|
|
20b5175180 | ||
|
|
596c8e2ecc | ||
|
|
94218a6549 | ||
|
|
2d36f798e7 | ||
|
|
853004dad9 | ||
|
|
0cc86430ca | ||
|
|
8760886f57 | ||
|
|
821669d03d | ||
|
|
17f8996afc | ||
|
|
7ef4eedd06 | ||
|
|
df6a31767e | ||
|
|
882a3b7824 | ||
|
|
94ddd01427 | ||
|
|
e614decae0 | ||
|
|
e0f46ea80d | ||
|
|
3391018606 | ||
|
|
61fd11f7cd | ||
|
|
4a469aebdc | ||
|
|
341815c0ed | ||
|
|
5830270bda | ||
|
|
8a1ff58dff | ||
|
|
0523d98a1c | ||
|
|
983af4e7a1 | ||
|
|
f8bec7296c | ||
|
|
2be4bd3d6a | ||
|
|
7d74296604 | ||
|
|
0504a355d2 | ||
|
|
036df817f1 | ||
|
|
ba331caff6 | ||
|
|
e2ac9708cb | ||
|
|
783ce7bada | ||
|
|
594931e07e | ||
|
|
3e245d49d8 | ||
|
|
76ed4aae12 | ||
|
|
565f36d4b7 | ||
|
|
75a94b050d | ||
|
|
91fac0880d | ||
|
|
42fa29f78b | ||
|
|
28d8e84d6b | ||
|
|
c11d925580 | ||
|
|
d7c1b12dbd | ||
|
|
e2c3d5b20d | ||
|
|
8581d87e41 | ||
|
|
fe853d4bee | ||
|
|
b8038130b8 | ||
|
|
31c5d8d67c | ||
|
|
a2f4430378 | ||
|
|
a8e4f6e2ea | ||
|
|
aac89f270b | ||
|
|
9022e02ccd | ||
|
|
5ddd2e4fbc | ||
|
|
3b500add73 | ||
|
|
4a6635f8a8 | ||
|
|
af6393af50 | ||
|
|
6a14543e9e | ||
|
|
3d827570e6 | ||
|
|
9f8eb07442 | ||
|
|
31c64b63de | ||
|
|
cf5c0ca5f7 | ||
|
|
f0d91a9708 | ||
|
|
0f94a26dc6 | ||
|
|
cded0af061 | ||
|
|
fffa7e44c5 | ||
|
|
a38aee7fe3 | ||
|
|
4d03fa06e1 | ||
|
|
dcd470b2e1 | ||
|
|
2259ef3f71 | ||
|
|
af18e2b7d1 | ||
|
|
9e8d79f246 | ||
|
|
5b480be6dc | ||
|
|
54d897fc33 | ||
|
|
cfebe422d3 | ||
|
|
fcc5c13274 | ||
|
|
707448193b | ||
|
|
84a1f86037 | ||
|
|
b2129011c2 | ||
|
|
9d359ef8c5 | ||
|
|
87a2b74a88 | ||
|
|
d5388e8dad | ||
|
|
fe7677c5c8 | ||
|
|
f36ac0bb4b | ||
|
|
d24bcc9fd7 | ||
|
|
daf8151a32 | ||
|
|
b432491d34 | ||
|
|
1313b4c112 | ||
|
|
164d7399d2 | ||
|
|
87176cfd0b | ||
|
|
bab96b73e0 | ||
|
|
f10db3900a | ||
|
|
7d4b1d0852 | ||
|
|
6ab99218f2 | ||
|
|
1959edf357 | ||
|
|
6fc2681b34 | ||
|
|
02dcf85c46 | ||
|
|
89f0521cce | ||
|
|
35029e826f | ||
|
|
f6c170b53c | ||
|
|
7991a5ce5e | ||
|
|
3973851dd2 | ||
|
|
f6361e29bd | ||
|
|
9f8db631f0 | ||
|
|
ada1de7ad6 | ||
|
|
ac55d473e7 | ||
|
|
2100f11af7 | ||
|
|
ea1b5cd1a9 | ||
|
|
e100fff230 | ||
|
|
5393ac526a | ||
|
|
808f7baf53 | ||
|
|
35f54822be | ||
|
|
94714fe571 | ||
|
|
5bdf8698bd | ||
|
|
2398e60e89 | ||
|
|
b4e563bfd6 | ||
|
|
a56ce09923 | ||
|
|
68c7a6bd93 | ||
|
|
b4612d6bd4 | ||
|
|
c2cfc96d87 | ||
|
|
8db99291ac | ||
|
|
c9aa764444 | ||
|
|
ee4869993d | ||
|
|
0758cf39c2 | ||
|
|
bb0c777cac | ||
|
|
0bd2c49dae | ||
|
|
d25c6fa0b2 | ||
|
|
8f2d36aab0 | ||
|
|
6c764a8487 | ||
|
|
dd6056a07a | ||
|
|
a83d364ba7 | ||
|
|
9c4b2b0abf | ||
|
|
4235801ae4 | ||
|
|
6791f2e883 | ||
|
|
caeec35c66 | ||
|
|
7b95df150a | ||
|
|
852651cefe | ||
|
|
22b9915ad7 | ||
|
|
0f994a0676 | ||
|
|
5d68fd690b | ||
|
|
c55bc6db4d | ||
|
|
a77d8b4762 | ||
|
|
23596d2516 | ||
|
|
352b958da1 | ||
|
|
e9f2ef1422 | ||
|
|
7baa711744 | ||
|
|
65e274a65f | ||
|
|
a874691bce | ||
|
|
d60d101e75 | ||
|
|
8d9a648dce | ||
|
|
2332cc76ee | ||
|
|
5c3a2bf5be | ||
|
|
5e2b50c49e | ||
|
|
3a56bf2bb5 | ||
|
|
3f4afb604a | ||
|
|
77a2976d05 | ||
|
|
0eda508cf6 | ||
|
|
4301e0f750 | ||
|
|
c5eb81c26a | ||
|
|
47d3cf3e62 | ||
|
|
41dc34efe8 | ||
|
|
4acbca4c8f | ||
|
|
11329d5794 | ||
|
|
b0880607d4 | ||
|
|
2afa18bbdd | ||
|
|
acad230daa | ||
|
|
49fcf3e486 | ||
|
|
acb0144742 | ||
|
|
6efc8fdad3 | ||
|
|
c75e6ba63c | ||
|
|
7bd1808c88 | ||
|
|
fe8e00895a | ||
|
|
9dc5e3d338 | ||
|
|
694c1ad808 | ||
|
|
754b028623 | ||
|
|
4423fb300f | ||
|
|
5c7d9327e3 | ||
|
|
cd72bce3cb | ||
|
|
64ef0465d5 | ||
|
|
fe6ad4f762 | ||
|
|
4b69b39d39 | ||
|
|
a6fc237c88 | ||
|
|
2448a0b735 | ||
|
|
685220140a | ||
|
|
99779629d0 | ||
|
|
9fceabed8f | ||
|
|
e11363db3a | ||
|
|
023cade51d | ||
|
|
d675b98330 | ||
|
|
b3f16e935d | ||
|
|
5b9e179017 | ||
|
|
6f53263107 | ||
|
|
fd797436fa | ||
|
|
96ee117657 | ||
|
|
8b60fb6b6c | ||
|
|
67542d3cf1 | ||
|
|
41e97ffa79 | ||
|
|
ffcff99a79 | ||
|
|
48bcaacada | ||
|
|
01b060b0fe | ||
|
|
51ce092a6a | ||
|
|
d09e02721b | ||
|
|
88b81aa28b | ||
|
|
84c4f4f428 | ||
|
|
ab5bc92a95 | ||
|
|
b44dd3edf0 | ||
|
|
80498a78ea | ||
|
|
40663eb2b5 | ||
|
|
dca2827154 | ||
|
|
eec069b4e8 | ||
|
|
26eedc3341 | ||
|
|
b19cefee3c | ||
|
|
fb54b969d1 | ||
|
|
034724b03e | ||
|
|
b80762eaf5 | ||
|
|
d5258786e5 | ||
|
|
9bfe2d3138 | ||
|
|
ae3b3f750d | ||
|
|
f83090e299 | ||
|
|
3e4f497cbc | ||
|
|
ce2398fdb7 | ||
|
|
f545cce6fe | ||
|
|
f614725fcb | ||
|
|
59e4f9ce4a | ||
|
|
dff6b15263 | ||
|
|
977ee8ccfc | ||
|
|
161815e6fb | ||
|
|
8dda864909 | ||
|
|
f6f9542d6e | ||
|
|
6655c0d881 | ||
|
|
98c8176d59 | ||
|
|
2e7f64458d | ||
|
|
d6a9cdc452 | ||
|
|
17dbe77cd3 | ||
|
|
4b71d9a48d | ||
|
|
1f41cb9a3f | ||
|
|
c6351c6c53 | ||
|
|
283218f2d6 | ||
|
|
4de22e9d66 | ||
|
|
b4a737d910 | ||
|
|
0f2c17324a | ||
|
|
6a1b10eaf9 | ||
|
|
824211c2f6 | ||
|
|
02d115f119 | ||
|
|
b44617413b | ||
|
|
c447f25e0a | ||
|
|
34ce92d9fa | ||
|
|
7ad5dc61ac | ||
|
|
7072332ab7 | ||
|
|
60e933eb00 | ||
|
|
43e3d07acb | ||
|
|
228252ee6f | ||
|
|
56a919eb60 | ||
|
|
bfcb906b12 | ||
|
|
b94776063f | ||
|
|
3f412373bc | ||
|
|
e7d1858052 | ||
|
|
bd106308fc | ||
|
|
6ec96b37bd | ||
|
|
3653786e14 | ||
|
|
5824d9e803 | ||
|
|
3ad3cdfa38 | ||
|
|
efcd1df365 | ||
|
|
aef62c45de | ||
|
|
94bd1cb37b | ||
|
|
f7bf3fe510 | ||
|
|
a771ebf0e8 | ||
|
|
6b4d02ae99 | ||
|
|
3e6cab1ec9 | ||
|
|
147c59c26b | ||
|
|
db6f76d12d | ||
|
|
86950c26d0 | ||
|
|
e1d4f10223 | ||
|
|
01c1ae42a1 | ||
|
|
550871f576 | ||
|
|
56fcca1f6b | ||
|
|
930bde785c | ||
|
|
13aadc41ff | ||
|
|
ea4998f666 | ||
|
|
6f0e92e0d1 | ||
|
|
a4085cb155 | ||
|
|
b7e77e10b6 | ||
|
|
8f195530b5 | ||
|
|
048ccf52b0 | ||
|
|
df9ad5a31f | ||
|
|
0b3284e23c | ||
|
|
36d598440a | ||
|
|
9cc42e6430 | ||
|
|
3f5c19bffd | ||
|
|
800dbf5e78 | ||
|
|
2b5db9ff3f | ||
|
|
b07c8848ca | ||
|
|
9bff8dd91f | ||
|
|
19eee66c39 | ||
|
|
fbf7be8808 | ||
|
|
fcda4c1188 | ||
|
|
deae234afa | ||
|
|
82e33fd4e4 | ||
|
|
15914c2f25 | ||
|
|
da64d3ccbf | ||
|
|
79a5d174a5 | ||
|
|
295d9768ce | ||
|
|
9490b1235d | ||
|
|
55eb984ccd | ||
|
|
4b1a82e14e | ||
|
|
3c224923e9 | ||
|
|
2c4f5a68b9 | ||
|
|
d324c917ad | ||
|
|
bd8ff77fe0 | ||
|
|
35d40e1d37 | ||
|
|
e9e281fd2a | ||
|
|
2437c5a19a | ||
|
|
b9b4de929d | ||
|
|
28fc55b653 | ||
|
|
8f4df0ceca | ||
|
|
ecde8a5e8b | ||
|
|
715b106c9e | ||
|
|
2114afa536 | ||
|
|
c78816a8d1 | ||
|
|
28516c4833 | ||
|
|
837ed3535d | ||
|
|
bcb332e88f | ||
|
|
f4be7a8034 | ||
|
|
e69413f1e8 | ||
|
|
ee6dcfc678 | ||
|
|
d4370a1811 | ||
|
|
babf4ca06a | ||
|
|
ccf0905469 | ||
|
|
970130e02b | ||
|
|
6088fa5134 | ||
|
|
33bc484d69 | ||
|
|
6bf113d0ff | ||
|
|
630d910a9e | ||
|
|
3c70963f56 | ||
|
|
4c4f6f6d80 | ||
|
|
f949fa54af | ||
|
|
17a5c6ed06 | ||
|
|
e6359663b1 | ||
|
|
405cef6a01 | ||
|
|
d4886f8923 | ||
|
|
c5ec61baa5 | ||
|
|
7a9ffa7ee8 | ||
|
|
5ff665a073 | ||
|
|
3d4e078a90 | ||
|
|
8ef613ef9b | ||
|
|
988a672dea | ||
|
|
cca9c51315 | ||
|
|
18aa3689d9 | ||
|
|
59ab6572b1 | ||
|
|
b6cf933159 | ||
|
|
48f36ca8f3 | ||
|
|
fea89de037 | ||
|
|
e2f1dd1ce8 | ||
|
|
48ac3353cb | ||
|
|
63015c3a93 | ||
|
|
c7bd402e54 | ||
|
|
0c6f9b6cc1 | ||
|
|
b5d7b84c1e | ||
|
|
cbbde8dea5 | ||
|
|
58dd0b7591 | ||
|
|
d9f2535402 | ||
|
|
66eb201466 | ||
|
|
edbf20d975 | ||
|
|
711d7dcfcc | ||
|
|
219979e20b | ||
|
|
27917a0e85 | ||
|
|
4b4b2d5cbc | ||
|
|
8d968d7f89 | ||
|
|
9090a5cd73 | ||
|
|
59a50994b8 | ||
|
|
ac99a6ac3c | ||
|
|
fa2257ad3b | ||
|
|
66ce0871bc | ||
|
|
c59564723c | ||
|
|
606717d253 | ||
|
|
f73e84e0ad | ||
|
|
fc01453544 | ||
|
|
d37a1c799f | ||
|
|
3456ef96a7 | ||
|
|
40143375fc | ||
|
|
7f34a1d83e | ||
|
|
2316c117b1 | ||
|
|
31b7482c3a | ||
|
|
0974625769 | ||
|
|
266f5149b5 | ||
|
|
008a9b9b3f | ||
|
|
ec2fd5b38f | ||
|
|
d449a1b714 | ||
|
|
0bd5ca5e3f | ||
|
|
06248e5388 | ||
|
|
9c5a0ed7ee | ||
|
|
b199354167 | ||
|
|
74ce725e3d | ||
|
|
3d5e033158 | ||
|
|
ca58c1dee2 | ||
|
|
d51a69b052 | ||
|
|
1a96d96837 | ||
|
|
2e7cd51ff8 | ||
|
|
112716dae5 | ||
|
|
c13e780f29 | ||
|
|
c35887f5ee | ||
|
|
2f55c10ce3 | ||
|
|
0068312ce3 | ||
|
|
ea49d92932 | ||
|
|
efe7dd23b6 | ||
|
|
3a1a58bcfc | ||
|
|
953862f133 | ||
|
|
41eb2ee969 | ||
|
|
225ecce676 | ||
|
|
335b10a694 | ||
|
|
967220178c | ||
|
|
be7461ad51 | ||
|
|
5af7cf850a | ||
|
|
86395d4d8b | ||
|
|
3412bb5380 | ||
|
|
d66e7e660d | ||
|
|
07d631e320 | ||
|
|
6ffb50530d | ||
|
|
bd7103d109 | ||
|
|
4abc2ab5bd | ||
|
|
f8a8b8ac6e | ||
|
|
cfe6e08168 | ||
|
|
5139259037 | ||
|
|
1503daf02b | ||
|
|
4246e42948 | ||
|
|
9b3eaa6fe8 | ||
|
|
716685d809 | ||
|
|
dd72871ba6 | ||
|
|
ea510f95b8 | ||
|
|
9de3db7c97 | ||
|
|
0e927ce4bd | ||
|
|
1747ebf481 | ||
|
|
da9d57a624 | ||
|
|
086d0113c5 | ||
|
|
8cf6050d10 | ||
|
|
b310168c12 |
No files matched your search
Executable
+346
@@ -0,0 +1,346 @@
|
||||
#!/bin/bash
|
||||
set -e # Enable auto-exit for debugging :))
|
||||
|
||||
# Make Linux AppImage program data
|
||||
# https://docs.appimage.org/reference/appdir.html
|
||||
|
||||
# PWD: {repo_root}/build
|
||||
# See deployer.sh for usage
|
||||
|
||||
# Terminal stuff
|
||||
RESET="$(tput sgr0)" #"\e[0m" # Resets terminal colors
|
||||
|
||||
# Colors for various information types
|
||||
FAILURE="$(tput setaf 1)" #"\e[91m"
|
||||
SUCCESS="$(tput setaf 2)" #"\e[92m"
|
||||
NOTICE="$(tput setaf 3)" #"\e[93m"
|
||||
VERBOSE="$(tput setaf 4)" #"\e[94m"
|
||||
|
||||
verbosity=0 # By default don't print anything unless it's *ultra* important.
|
||||
quiet=0 # Also don't print anything if they supplied the quiet argument
|
||||
|
||||
# URL from which to download appimagetool if there isn't one available in your $PATH
|
||||
# at time of writing only aarch64, armhf, i686, and x86_64 versions are available via this method
|
||||
# in those cases, and honestly even outside of those cases, it's better to just put a working one in your $PATH yourself..
|
||||
url="https://github.com/AppImage/AppImageKit/releases/download/continuous/appimagetool-$(uname -m).AppImage"
|
||||
|
||||
# A whitelist of libraries to include into SRB2's AppImage if SRB2 is dynamically linked.
|
||||
# please don't add a newline at the end of this or i will cry :(
|
||||
libraryWhitelist="
|
||||
libbacktrace
|
||||
libnsl
|
||||
libSDL2
|
||||
libSDL2_mixer
|
||||
libgme
|
||||
libopenmpt
|
||||
libpng
|
||||
libfluidsynth
|
||||
libpulse
|
||||
libmodplug
|
||||
libvorbisfile
|
||||
libopusfile
|
||||
libFLAC
|
||||
libmad
|
||||
libmpg123
|
||||
libvorbis
|
||||
libpulsecommon
|
||||
libsndfile
|
||||
libsndio
|
||||
libogg
|
||||
libvorbisenc
|
||||
libjson
|
||||
libreadline
|
||||
libwrap
|
||||
libtinfo
|
||||
libtirpc
|
||||
libpng16"
|
||||
|
||||
# these kinda look like macros don't they
|
||||
function print { (( "$quiet" == 0 )) && echo "$@" || :; } # echo if not quiet
|
||||
function coloredText { printf "$1"; print "${@:2}"; printf "$RESET"; } # use print to inherit quiet
|
||||
function success { coloredText "$SUCCESS" "$@"; } # use coloredText to inherit quiet
|
||||
function important { coloredText "$NOTICE" "$@"; } # use coloredText to inherit quiet
|
||||
function verboseOnly { (( "$verbosity" >= $1 )) && (coloredText "$VERBOSE" "${@:2}") || :; } # use coloredText to inherit quiet
|
||||
|
||||
# Parses an argument with a single dash
|
||||
function parseSingleDashArg() {
|
||||
while read -n 1 char; do
|
||||
if [[ "$char" == '-' || "$char" == '' ]]; then
|
||||
:
|
||||
elif [[ "$char" == 'h' ]]; then
|
||||
helppassed=1
|
||||
elif [[ "$char" == 'q' ]]; then
|
||||
quiet=1
|
||||
elif [[ "$char" == 'v' ]]; then
|
||||
verbosity="$((verbosity + 1))"
|
||||
elif [[ "$char" == 'd' ]]; then
|
||||
dry=1
|
||||
elif [[ "$char" == 's' ]]; then
|
||||
small=1
|
||||
else
|
||||
echo "$0: invalid option -- '$1'"
|
||||
echo "Try '$0 --help' for more information."
|
||||
return 1
|
||||
fi
|
||||
done <<<"$1"
|
||||
}
|
||||
|
||||
# Simple help argument checker.
|
||||
currentarg=1; # Which argument is --help...
|
||||
|
||||
# For $arg in the argument array...
|
||||
for arg in "$@"; do
|
||||
# Is it a help argument?
|
||||
if [[ "$arg" == "--help" ]]; then
|
||||
helppassed=1; # Help is passed, set $helppassed!
|
||||
set -- "${@:1:$currentarg-1}" "${@:$currentarg+1}" # Remove argument from list
|
||||
elif [[ "$arg" == "--quiet" ]]; then
|
||||
quiet=1
|
||||
set -- "${@:1:$currentarg-1}" "${@:$currentarg+1}"
|
||||
elif [[ "$arg" == "--verbose" ]]; then
|
||||
verbosity="$((verbosity + 1))" # Increase verbosity!
|
||||
set -- "${@:1:$currentarg-1}" "${@:$currentarg+1}"
|
||||
elif [[ "$arg" == "--dry" ]]; then
|
||||
dry=1; # Show parameters instead of using them.
|
||||
set -- "${@:1:$currentarg-1}" "${@:$currentarg+1}"
|
||||
elif [[ "$arg" == "--small" ]]; then
|
||||
small=1; # Don't copy assets to save on bandwidth.
|
||||
set -- "${@:1:$currentarg-1}" "${@:$currentarg+1}"
|
||||
elif [[ ! "$arg" == *'--'* && "$arg" == *'-'* ]]; then
|
||||
parseSingleDashArg "$arg"
|
||||
|
||||
if [[ "$?" == 0 ]]; then
|
||||
set -- "${@:1:$currentarg-1}" "${@:$currentarg+1}" # Remove argument from list
|
||||
fi
|
||||
elif [[ $arg == *'--'* ]]; then
|
||||
print "$0: invalid option -- '$1'"
|
||||
print "Try '$0 --help' for more information."
|
||||
return 1
|
||||
else
|
||||
currentarg="$((currentarg+1))" # Increment current argument number otherwise...
|
||||
fi
|
||||
done
|
||||
|
||||
important "SRB2Kart AppImage Packager v1.0 modified for kart by NepDisk."
|
||||
important "Orignal for SRB2 my mazmazz and Golden."
|
||||
|
||||
# Get root directory from the full path of this script.
|
||||
__ROOT_DIR="$3"
|
||||
|
||||
if [[ -z "$3" ]]; then
|
||||
# finds out where this script is and goes to that directory and goes up one for the root
|
||||
|
||||
scriptdir="$(dirname "${BASH_SOURCE[0]}")"
|
||||
scriptbase="$(basename "${BASH_SOURCE[0]}")"
|
||||
|
||||
__ROOT_DIR="$(cd "$scriptdir" && pwd -P)"
|
||||
fi
|
||||
|
||||
# If it starts with '.', put the current working directory behind it so things work.
|
||||
if [[ "$__ROOT_DIR" == '.' || "$__ROOT_DIR" == '..' ]]; then
|
||||
__ROOT_DIR="$PWD/$__ROOT_DIR"
|
||||
fi
|
||||
|
||||
# Set up defaults
|
||||
__PROGRAM_NAME="${PROGRAM_NAME:-"SRB2Kart Saturn"}"
|
||||
__PROGRAM_DESCRIPTION="${PROGRAM_DESCRIPTION:-"Modded version of SRB2kart with more features."}"
|
||||
__PROGRAM_FILENAME="${PROGRAM_FILENAME:-"lsdl2srb2kart"}"
|
||||
__PROGRAM_ASSETS="${PROGRAM_ASSETS:-"$__ROOT_DIR/assets/installer"}"
|
||||
|
||||
__BUILD_DIR="${1:-"$__ROOT_DIR/bin"}"
|
||||
__OUTPUT_FILENAME="${2:-"$__PROGRAM_FILENAME.AppImage"}"
|
||||
|
||||
__APPIMAGETOOL="${4:-"appimagetool"}"
|
||||
|
||||
if (! command -v "$__APPIMAGETOOL" &> /dev/null); then
|
||||
__APPIMAGETOOL=
|
||||
fi
|
||||
|
||||
# Stuff that prints and exits.
|
||||
|
||||
# Prints setup text using method given by arguments.
|
||||
# Example: printSetup "print" # print "Setup for AppImage...
|
||||
function printSetup {
|
||||
$@ "Setup for AppImage in BUILD_DIR: '$__BUILD_DIR'..."
|
||||
$@ "With the OUTPUT_FILENAME: '$__OUTPUT_FILENAME'"
|
||||
$@ "And SRB2 Repository Root ROOT_DIR: '$__ROOT_DIR'"
|
||||
$@ "Using APPIMAGETOOL: '$([ -z "$__APPIMAGETOOL" ] && echo '(download)' || echo $__APPIMAGETOOL)'"
|
||||
$@ ""
|
||||
$@ "This should be run from a Makefile or from the directory of the build. If it is not, then change to that directory or specify that directory as an argument."
|
||||
$@ "If ROOT_DIR isn't SRB2's repository root, specify that as an argument too."
|
||||
$@ "Make must have built the program before you run this script."
|
||||
$@ ""
|
||||
$@ "Make sure these Environment Variables are correct."
|
||||
$@ "If not, then enter: export PROGRAM_VARIABLE=value"
|
||||
$@ "PROGRAM_NAME: $__PROGRAM_NAME"
|
||||
$@ "PROGRAM_DESCRIPTION: $__PROGRAM_DESCRIPTION"
|
||||
$@ "PROGRAM_FILENAME: $__PROGRAM_FILENAME"
|
||||
$@ "PROGRAM_ASSETS: $__PROGRAM_ASSETS"
|
||||
}
|
||||
|
||||
if [[ "$helppassed" ]]; then
|
||||
print "Usage: $(basename "$0") [OPTION]... [BUILD_DIR] [OUTPUT_NAME] [ROOT_DIR] [APPIMAGETOOL]"
|
||||
print "Packages a SRB2 binary into an AppImage."
|
||||
print "OPTIONs may be included anywhere within the arguments."
|
||||
print ""
|
||||
print "Arguments:"
|
||||
print " -h, --help display this help and exit."
|
||||
print " -q, --quiet don't display any text."
|
||||
print " -v, --verbose make commands more verbose, will always print."
|
||||
print " -s, --small don't copy SRB2 assets to save on bandwidth."
|
||||
print " parameters regardless of --dry."
|
||||
print " -d, --dry print parameters and exit."
|
||||
print ""
|
||||
if (( "$verbosity" > 0 )) || [[ "$dry" ]]; then
|
||||
printSetup "print"
|
||||
else
|
||||
print "This should be run from a Makefile or from the directory of the build."
|
||||
print "Make must have built the program before you run this script."
|
||||
fi
|
||||
exit;
|
||||
fi
|
||||
|
||||
if (( "$verbosity" > 0 )) || [[ "$dry" ]]; then
|
||||
printSetup "verboseOnly" "0"
|
||||
verboseOnly 0 ""
|
||||
|
||||
if [[ "$dry" ]]; then
|
||||
set -n # Enable debug mode and verbose for dry run.
|
||||
fi
|
||||
fi
|
||||
|
||||
# End stuff that prints and exits.
|
||||
|
||||
if (( "$verbosity" >= 4 )); then
|
||||
set -v # Really verbose? Print *everything*!
|
||||
fi
|
||||
|
||||
# Define AppDir structure
|
||||
mkdir -p "$__BUILD_DIR/AppDir/usr/bin"
|
||||
mkdir -p "$__BUILD_DIR/AppDir/lib"
|
||||
mkdir -p "$__BUILD_DIR/AppDir/usr/share/applications"
|
||||
mkdir -p "$__BUILD_DIR/AppDir/usr/share/icons/hicolor/256x256/apps"
|
||||
|
||||
# Copy program data
|
||||
if [[ ! $small ]]; then
|
||||
verboseOnly 1 "Packaging program assets..."
|
||||
cp -r "$__PROGRAM_ASSETS"/* "$__BUILD_DIR/AppDir/usr/bin/"
|
||||
cp -r "$__BUILD_DIR/$__PROGRAM_FILENAME" "$__BUILD_DIR/AppDir/usr/bin"
|
||||
else
|
||||
verboseOnly 1 "Skipping program asset packing, --small or -s passed..."
|
||||
fi
|
||||
|
||||
verboseOnly 1 "Packaging SRB2..."
|
||||
verboseOnly 1 "Assuming executable name $__PROGRAM_FILENAME"
|
||||
cp -r "$__BUILD_DIR/$__PROGRAM_FILENAME" "$__BUILD_DIR/AppDir/usr/bin"
|
||||
|
||||
# Copy required dependencies, but only if the program is dynamically linked.
|
||||
verboseOnly 1 "Testing if this build is dynamically linked..."
|
||||
|
||||
set +e # Disable auto-exit for ldd.
|
||||
|
||||
srb2Libraries="$(ldd "$__BUILD_DIR/$__PROGRAM_FILENAME")"
|
||||
exitcode="$?"
|
||||
|
||||
set -e # Enable it again!
|
||||
|
||||
if (( $exitcode == 0 )); then
|
||||
verboseOnly 1 "This build *is* dynamically linked! Packaging dependencies."
|
||||
|
||||
# read the dynamic libraries of srb2, trim off beginning whitespace, and get the third field seperated by spaces
|
||||
# this gives us a newline-seperated list of libraries with their full paths.
|
||||
srb2Libraries="$(echo "$srb2Libraries" | cut -f 2 | cut -d ' ' -f 3)"
|
||||
|
||||
# remove any extraneous newlines around the string
|
||||
libraryWhitelist="$(echo $libraryWhitelist | head -c -1 | tr ' ' '\n')"
|
||||
|
||||
# replace e.g. 'abc' with '(/abc\b)', and replace newlines with '|'.
|
||||
# this converts it into a grep regular expression to check for any whitelisted library names.
|
||||
libraryWhitelist="$(printf "%s" "$libraryWhitelist" | sed 's|.*|(/\0\\b)|' | tr '\n' '|')"
|
||||
|
||||
# grab only the entries that match the regex
|
||||
__LDD_LIST="$(printf "%s" "$srb2Libraries" | grep -E "$libraryWhitelist")"
|
||||
|
||||
# use echo to convert the newline-seperated list into an argument list
|
||||
__LDD_LIST="$(echo $__LDD_LIST)"
|
||||
|
||||
# read into an array because i can't be bothered iterating the lines of a string today
|
||||
# there's so many other things in this file that'd need to be adjusted to be POSIX-compliant anyway
|
||||
IFS=' ' read -r -a paths <<< "$__LDD_LIST"
|
||||
|
||||
for path in "${paths[@]}"; do
|
||||
if [ -f "$path" ]; then
|
||||
verboseOnly 2 "Packaging dependency $(basename "$path")..."
|
||||
cp "$path" $__BUILD_DIR/AppDir/lib/
|
||||
else
|
||||
verboseOnly 2 "Dependency $(basename "$path") not found"
|
||||
fi
|
||||
done
|
||||
else
|
||||
verboseOnly 1 "This SRB2 build is statically linked, skipping dependency packing."
|
||||
fi
|
||||
|
||||
cd "$__BUILD_DIR/AppDir"
|
||||
|
||||
# Copy icons
|
||||
verboseOnly 1 "Packaging resources..."
|
||||
cp "$__ROOT_DIR/srb2.png" "./usr/share/icons/hicolor/256x256/apps/$__PROGRAM_FILENAME.png"
|
||||
ln -sf "./usr/share/icons/hicolor/256x256/apps/$__PROGRAM_FILENAME.png" "./.DirIcon"
|
||||
ln -sf "./usr/share/icons/hicolor/256x256/apps/$__PROGRAM_FILENAME.png" "./$__PROGRAM_FILENAME.png"
|
||||
|
||||
# Make desktop descriptor
|
||||
cat > "./usr/share/applications/$__PROGRAM_FILENAME.desktop" <<EOF
|
||||
[Desktop Entry]
|
||||
Type=Application
|
||||
Name=$__PROGRAM_NAME
|
||||
Comment=$__PROGRAM_DESCRIPTION
|
||||
Icon=$__PROGRAM_FILENAME
|
||||
Exec=AppRun %F
|
||||
Categories=Game;
|
||||
EOF
|
||||
|
||||
ln -sf "./usr/share/applications/$__PROGRAM_FILENAME.desktop" "./$__PROGRAM_FILENAME.desktop"
|
||||
|
||||
# Make entry point
|
||||
echo -e '#!'"$(dirname "$SHELL")/sh" > ./AppRun
|
||||
echo -e 'HERE="$(dirname "$(readlink -f "${0}")")"' >> ./AppRun
|
||||
echo -e 'SRB2WADDIR=$HERE/usr/bin LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$HERE/lib exec $HERE/usr/bin/'"$__PROGRAM_FILENAME"' "$@"' >> ./AppRun
|
||||
chmod +x ./AppRun
|
||||
|
||||
cd .. # now in $__BUILD_DIR
|
||||
|
||||
# Package AppImage
|
||||
if [ -z "$__APPIMAGETOOL" ]; then
|
||||
verboseOnly 1 "No valid appimagetool path given or detected, downloading appimagetool..."
|
||||
|
||||
# Print notice for internet connection.
|
||||
important "If the command hangs here, check your internet connection, or download appimagetool and add it to your \$PATH and try compiling again."
|
||||
|
||||
(( "$verbosity" >= 3 )) && wget "$url" || wget -q "$url"
|
||||
|
||||
APPIMAGETOOL="./$(basename "$url")"
|
||||
chmod a+x "$APPIMAGETOOL"
|
||||
else
|
||||
verboseOnly 1 "appimagetool path given or detected, no download required."
|
||||
APPIMAGETOOL="$__APPIMAGETOOL"
|
||||
fi
|
||||
|
||||
verboseOnly 1 "Packing AppImage $__OUTPUT_FILENAME"
|
||||
|
||||
if (( verbosity >= 3 )); then
|
||||
"$APPIMAGETOOL" ./AppDir "$__OUTPUT_FILENAME"
|
||||
elif (( verbosity >= 2 )); then
|
||||
"$APPIMAGETOOL" ./AppDir "$__OUTPUT_FILENAME" >/dev/null
|
||||
else
|
||||
"$APPIMAGETOOL" ./AppDir "$__OUTPUT_FILENAME" >/dev/null 2>&1
|
||||
fi
|
||||
|
||||
success "AppImage ready!"
|
||||
verboseOnly 1 "Cleaning up files..."
|
||||
rm -r ./AppDir
|
||||
|
||||
if [ -z "$__APPIMAGETOOL" ]; then
|
||||
rm "$APPIMAGETOOL"
|
||||
fi
|
||||
|
||||
cd "$__ROOT_DIR" # snap back to reality
|
||||
+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
|
||||
|
||||
+42
@@ -28,6 +28,10 @@ exist.
|
||||
Returns the values of the given HUD item's `xoffset`/`yoffset` cvars.
|
||||
Available for any HUD item with offset cvars.
|
||||
|
||||
## patch = v.cachePatchRotated(name, rollangle)
|
||||
Like v.cachePatch, it caches a new patch with the corresponding name. Unlike v.cachePatch, however,
|
||||
a rollangle can be supplied to the function so that it returns a rotated patch instead.
|
||||
|
||||
## x, y, flags = v.getDrawInfo(item)
|
||||
|
||||
Returns the X, Y and flags where the given HUD item will be drawn for the current displayplayer.
|
||||
@@ -130,3 +134,41 @@ if rawget(_G, "S_StopSoundByNum") ~= nil then
|
||||
... -- Can use it
|
||||
end
|
||||
```
|
||||
## addHook("ServerJoin", function())
|
||||
|
||||
ServerJoin hook called when client joins server (starting a listen server also calls it for host).
|
||||
Generally it was made to make loading custom config files less hacky, but can be used for anything else too.
|
||||
|
||||
## player.viewrollangle field
|
||||
|
||||
Returns player's current view roll angle for the Screen Tilting feature, useful for HUD elements.
|
||||
|
||||
## G_SetPlayerGamepadIndicatorColor(player, skincolor)
|
||||
|
||||
Set a custom color for Supported Gamepads with RGB LED functionality.
|
||||
To be used with Displayplayers.
|
||||
Only takes Skincolors.
|
||||
Best to be used in a Loop to ensure the color wont get overwritten by the game.
|
||||
|
||||
## G_PlayerDeviceRumble(player, low_strength, high_strength, -optional- duration)
|
||||
|
||||
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)
|
||||
|
||||
Add optional `damager` argument (should be `mobj_t`), which causes hurt sound also play for damager
|
||||
if `karthitemdialog` option is enabled
|
||||
|
||||
## K_PlayHitEmSound(mobj, victim)
|
||||
|
||||
Add optional `victim` argument (should be a player's `mobj_t`), which causes "hit em" sound to be
|
||||
delayed and played for victim too if `karthitemdialog` option is enabled
|
||||
@@ -0,0 +1,8 @@
|
||||
ifdef SILENT
|
||||
MAKEFLAGS+=--no-print-directory
|
||||
endif
|
||||
|
||||
all :
|
||||
|
||||
% ::
|
||||
@$(MAKE) -C src $(MAKECMDGOALS)
|
||||
@@ -76,7 +76,7 @@ Crashlogs now contain alot more informations. and even more if your build has de
|
||||
Also allows 64bit Windows builds to produce Crashlogs!
|
||||
|
||||
## MISC
|
||||
- Bird's Camara Tilting feature is no longer turned on by default
|
||||
- Bird's Camera Tilting feature is no longer turned on by default
|
||||
- Bird's warning on the title screen has been removed
|
||||
|
||||
## Bugs
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -1 +1 @@
|
||||
/lsdlsrb2
|
||||
/lsdl2srb2kart
|
||||
+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
|
||||
}
|
||||
|
||||
+2
-1
@@ -1,2 +1,3 @@
|
||||
/cscope.out
|
||||
/srb2wii
|
||||
*.json
|
||||
*.idx
|
||||
@@ -28,6 +28,7 @@ LOCAL_SRC_FILES := am_map.c \
|
||||
m_cheat.c \
|
||||
m_fixed.c \
|
||||
m_menu.c \
|
||||
m_textinput.c \
|
||||
m_misc.c \
|
||||
m_queue.c \
|
||||
m_random.c \
|
||||
|
||||
+561
-551
File diff suppressed because it is too large.
Load diff
+73
-122
@@ -31,18 +31,6 @@
|
||||
# compile all HW render and 3D sound DLLs for the set
|
||||
# opengl_dll
|
||||
# Pure Mingw only, compile OpenGL HW render DLL
|
||||
# minigl_dll
|
||||
# Pure Mingw only, compile MiniGL HW render DLL
|
||||
# ds3d_dll
|
||||
# Pure Mingw only, compile DirectX DirectSound HW sound DLL
|
||||
# fmod_dll
|
||||
# Pure Mingw only, compile FMOD HW sound DLL
|
||||
# openal_dll
|
||||
# Pure Mingw only, compile OpenAL HW sound DLL
|
||||
# fmod_so
|
||||
# Non-Mingw, compile FMOD HW sound SO
|
||||
# openal_so
|
||||
# Non-Mingw, compile OpenAL HW sound SO
|
||||
#
|
||||
#
|
||||
# Addon:
|
||||
@@ -69,10 +57,7 @@
|
||||
# Compile without SDL_Mixer, add 'NOMIXER=1'
|
||||
# Compile without BSD API, add 'NONET=1'
|
||||
# Compile without IPX/SPX, add 'NOIPX=1'
|
||||
# Compile Mingw/SDL with S_DS3S, add 'DS3D=1'
|
||||
# Compile without libopenmpt, add 'NOOPENMPT=1'
|
||||
# Compile with S_FMOD3D, add 'FMOD=1' (WIP)
|
||||
# Compile with S_OPENAL, add 'OPENAL=1' (WIP)
|
||||
# To link with the whole SDL_Image lib to load Icons, add 'SDL_IMAGE=1' but it isn't not realy needed
|
||||
# To link with SDLMain to hide console or make on a console-less binary, add 'SDLMAIN=1'
|
||||
#
|
||||
@@ -83,7 +68,6 @@ ALL_SYSTEMS=\
|
||||
LINUX64\
|
||||
MINGW64\
|
||||
HAIKU\
|
||||
DUMMY\
|
||||
MINGW\
|
||||
UNIX\
|
||||
LINUX\
|
||||
@@ -96,16 +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
|
||||
|
||||
system:=$(shell uname -s)
|
||||
|
||||
ifeq ($(system),Linux)
|
||||
@@ -129,6 +116,7 @@ else # if you on the *nix
|
||||
endif
|
||||
endif
|
||||
|
||||
NOUPX=1
|
||||
|
||||
# SRB2 data files
|
||||
D_DIR?=../bin/Resources
|
||||
@@ -169,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
|
||||
@@ -205,6 +182,15 @@ USE_FBO_OGL=1
|
||||
endif
|
||||
endif
|
||||
|
||||
ifndef NONET
|
||||
ifndef NOSATURNJOIN
|
||||
DOSATURNJOIN=1
|
||||
endif
|
||||
ifndef NOSATURNPAK
|
||||
DOSATURNPAK=1
|
||||
endif
|
||||
endif
|
||||
|
||||
ifdef MINGW
|
||||
include win32/Makefile.cfg
|
||||
endif #ifdef MINGW
|
||||
@@ -215,6 +201,7 @@ endif
|
||||
|
||||
ifdef LINUX
|
||||
UNIXCOMMON=1
|
||||
NOOBJDUMP=1
|
||||
ifndef NOGME
|
||||
HAVE_LIBGME=1
|
||||
endif
|
||||
@@ -278,8 +265,8 @@ ifdef NOHW
|
||||
OPTS+=-DNOHW
|
||||
else
|
||||
OPTS+=-DHWRENDER
|
||||
OBJS+=$(OBJDIR)/hw_bsp.o $(OBJDIR)/hw_draw.o $(OBJDIR)/hw_light.o \
|
||||
$(OBJDIR)/hw_main.o $(OBJDIR)/hw_clip.o $(OBJDIR)/hw_md2.o $(OBJDIR)/hw_cache.o \
|
||||
OBJS+=$(OBJDIR)/hw_bsp.o $(OBJDIR)/hw_draw.o \
|
||||
$(OBJDIR)/hw_main.o $(OBJDIR)/hw_clip.o $(OBJDIR)/hw_md2.o $(OBJDIR)/hw_cache.o $(OBJDIR)/hw_portal.o\
|
||||
$(OBJDIR)/hw_md2load.o $(OBJDIR)/hw_md3load.o $(OBJDIR)/hw_model.o $(OBJDIR)/u_list.o $(OBJDIR)/hw_batching.o $(OBJDIR)/hw_shaders.o
|
||||
endif
|
||||
|
||||
@@ -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
|
||||
@@ -384,6 +375,15 @@ OPTS+=-DUSE_FBO_OGL
|
||||
endif
|
||||
endif
|
||||
|
||||
ifndef NONET
|
||||
ifndef NOSATURNJOIN
|
||||
OPTS+=-DDOSATURNJOIN
|
||||
endif
|
||||
ifndef NOSATURNPAK
|
||||
OPTS+=-DDOSATURNPAK
|
||||
endif
|
||||
endif
|
||||
|
||||
ifdef HAVE_MINIUPNPC
|
||||
ifdef NONET
|
||||
HAVE_MINIUPNPC=''
|
||||
@@ -439,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
|
||||
@@ -492,7 +509,9 @@ OBJS:=$(i_main_o) \
|
||||
$(OBJDIR)/hu_stuff.o \
|
||||
$(OBJDIR)/y_inter.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 \
|
||||
@@ -502,6 +521,7 @@ OBJS:=$(i_main_o) \
|
||||
$(OBJDIR)/m_fixed.o \
|
||||
$(OBJDIR)/m_menu.o \
|
||||
$(OBJDIR)/m_misc.o \
|
||||
$(OBJDIR)/m_textinput.o \
|
||||
$(OBJDIR)/m_perfstats.o \
|
||||
$(OBJDIR)/m_random.o \
|
||||
$(OBJDIR)/m_queue.o \
|
||||
@@ -534,7 +554,9 @@ 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 \
|
||||
$(OBJDIR)/v_video.o \
|
||||
$(OBJDIR)/s_sound.o \
|
||||
@@ -576,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
|
||||
@@ -591,7 +609,7 @@ else
|
||||
-$(.)../comptime.sh .
|
||||
endif
|
||||
|
||||
clean:
|
||||
clean: cleandep
|
||||
$(REMOVE) *~ *.flc
|
||||
$(REMOVE) $(OBJDIR)/*.o
|
||||
|
||||
@@ -630,6 +648,17 @@ ifndef NOUPX
|
||||
-$(UPX) $(UPX_OPTS) $(BIN)/$(EXENAME)
|
||||
endif
|
||||
endif
|
||||
|
||||
ifdef APPIMAGE
|
||||
@echo Building AppImage...
|
||||
ifdef APPIMAGE_NOASSETS
|
||||
$(.)../AppImage_build.sh --small --quiet $(BIN)/
|
||||
else
|
||||
$(.)../AppImage_build.sh -q $(BIN)/
|
||||
endif
|
||||
@echo AppImage build complete, please look for $(EXENAME).AppImage in $(BIN)
|
||||
endif
|
||||
|
||||
@echo Build is done, please look for $(EXENAME) in $(BIN), \(checking for post steps\)
|
||||
|
||||
reobjdump:
|
||||
@@ -650,7 +679,7 @@ else
|
||||
dll : opengl_dll
|
||||
endif
|
||||
ifdef MINGW
|
||||
all_dll: opengl_dll ds3d_dll fmod_dll openal_dll
|
||||
all_dll: opengl_dll
|
||||
|
||||
opengl_dll: $(BIN)/r_opengl.dll
|
||||
$(BIN)/r_opengl.dll: $(OBJDIR)/ogl_win.o $(OBJDIR)/r_opengl.o
|
||||
@@ -660,55 +689,24 @@ $(BIN)/r_opengl.dll: $(OBJDIR)/ogl_win.o $(OBJDIR)/r_opengl.o
|
||||
ifndef NOUPX
|
||||
-$(UPX) $(UPX_OPTS) $@
|
||||
endif
|
||||
|
||||
ds3d_dll: $(BIN)/s_ds3d.dll
|
||||
$(BIN)/s_ds3d.dll: $(OBJDIR)/s_ds3d.o
|
||||
@echo Linking S_DS3d.dll...
|
||||
$(CC) --shared $^ -o $@ -g -Wl,--add-stdcall-alias -ldsound -luuid
|
||||
|
||||
fmod_dll: $(BIN)/s_fmod.dll
|
||||
$(BIN)/s_fmod.dll: $(OBJDIR)/s_fmod.o
|
||||
-$(MKDIR) $(BIN)
|
||||
@echo Linking S_FMOD.dll...
|
||||
$(CC) --shared $^ -o $@ -g -Wl,--add-stdcall-alias -lfmod
|
||||
|
||||
openal_dll: $(BIN)/s_openal.dll
|
||||
$(BIN)/s_openal.dll: $(OBJDIR)/s_openal.o
|
||||
-$(MKDIR) $(BIN)
|
||||
@echo Linking S_OpenAL.dll...
|
||||
$(CC) --shared $^ -o $@ -g -Wl,--add-stdcall-alias -lopenal32
|
||||
else
|
||||
all_dll: fmod_so openal_so
|
||||
|
||||
fmod_so: $(BIN)/s_fmod.so
|
||||
$(BIN)/s_fmod.so: $(OBJDIR)/s_fmod.o
|
||||
-$(MKDIR) $(BIN)
|
||||
@echo Linking S_FMOD.so...
|
||||
$(CC) --shared $^ -o $@ -g --nostartfiles -lm -lfmod
|
||||
|
||||
openal_so: $(BIN)/s_openal.so
|
||||
$(BIN)/s_openal.so: $(OBJDIR)/s_openal.o
|
||||
-$(MKDIR) $(BIN)
|
||||
@echo Linking S_OpenAL.so...
|
||||
$(CC) --shared $^ -o $@ -g --nostartfiles -lm -lopenal
|
||||
endif
|
||||
|
||||
else
|
||||
ifdef SDL
|
||||
ifdef MINGW
|
||||
$(OBJDIR)/r_opengl.o: hardware/r_opengl/r_opengl.c hardware/r_opengl/r_opengl.h \
|
||||
doomdef.h doomtype.h g_state.h m_swap.h hardware/hw_drv.h screen.h \
|
||||
doomdef.h doomtype.h g_state.h m_swap.h hardware/hw_gl.h screen.h \
|
||||
command.h hardware/hw_data.h hardware/hw_defs.h hardware/hw_md2.h \
|
||||
hardware/hw_glob.h hardware/hw_main.h hardware/hw_clip.h \
|
||||
hardware/hw_glob.h hardware/hw_main.h hardware/hw_clip.h hardware/hw_portal.h\
|
||||
hardware/hw_md2load.h hardware/hw_md3load.h hardware/hw_model.h hardware/u_list.h \
|
||||
am_map.h d_event.h d_player.h p_pspr.h m_fixed.h tables.h info.h d_think.h \
|
||||
p_mobj.h doomdata.h d_ticcmd.h r_defs.h hardware/hw_dll.h
|
||||
$(CC) $(CFLAGS) $(WFLAGS) -c $< -o $@
|
||||
else
|
||||
$(OBJDIR)/r_opengl.o: hardware/r_opengl/r_opengl.c hardware/r_opengl/r_opengl.h \
|
||||
doomdef.h doomtype.h g_state.h m_swap.h hardware/hw_drv.h screen.h \
|
||||
doomdef.h doomtype.h g_state.h m_swap.h hardware/hw_gl.h screen.h \
|
||||
command.h hardware/hw_data.h hardware/hw_defs.h hardware/hw_md2.h \
|
||||
hardware/hw_glob.h hardware/hw_main.h hardware/hw_clip.h \
|
||||
hardware/hw_glob.h hardware/hw_main.h hardware/hw_clip.h hardware/hw_portal.h \
|
||||
hardware/hw_md2load.h hardware/hw_md3load.h hardware/hw_model.h hardware/u_list.h \
|
||||
am_map.h d_event.h d_player.h p_pspr.h m_fixed.h tables.h info.h d_think.h \
|
||||
p_mobj.h doomdata.h d_ticcmd.h r_defs.h hardware/hw_dll.h
|
||||
@@ -720,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"
|
||||
@@ -776,55 +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 STATICHS
|
||||
$(OBJDIR)/s_openal.o: hardware/s_openal/s_openal.c hardware/hw3dsdrv.h \
|
||||
hardware/hw_dll.h
|
||||
$(CC) $(CFLAGS) $(WFLAGS) -c $< -o $@
|
||||
|
||||
$(OBJDIR)/s_fmod.o: hardware/s_fmod/s_fmod.c hardware/hw3dsdrv.h \
|
||||
hardware/hw_dll.h
|
||||
$(CC) $(CFLAGS) $(WFLAGS) -c $< -o $@
|
||||
|
||||
ifdef MINGW
|
||||
$(OBJDIR)/s_ds3d.o: hardware/s_ds3d/s_ds3d.c hardware/hw3dsdrv.h \
|
||||
hardware/hw_dll.h
|
||||
$(CC) $(CFLAGS) $(WFLAGS) -c $< -o $@
|
||||
endif
|
||||
else
|
||||
|
||||
$(OBJDIR)/s_fmod.o: hardware/s_fmod/s_fmod.c hardware/hw3dsdrv.h \
|
||||
hardware/hw_dll.h
|
||||
$(CC) $(ARCHOPTS) -Os -o $(OBJDIR)/s_fmod.o -DHW3SOUND -DUNIXCOMMON -shared -nostartfiles -c hardware/s_fmod/s_fmod.c
|
||||
|
||||
$(OBJDIR)/s_openal.o: hardware/s_openal/s_openal.c hardware/hw3dsdrv.h \
|
||||
hardware/hw_dll.h
|
||||
$(CC) $(ARCHOPTS) -Os -o $(OBJDIR)/s_openal.o -DHW3SOUND -DUNIXCOMMON -shared -nostartfiles -c hardware/s_openal/s_openal.c
|
||||
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
|
||||
|
||||
#############################################################
|
||||
|
||||
+25
-18
@@ -12,7 +12,8 @@
|
||||
# to avoid a false positive with the version detection...
|
||||
|
||||
SUPPORTED_GCC_VERSIONS:=\
|
||||
141 14\
|
||||
151 150 15\
|
||||
142 141 140 14\
|
||||
132 131 130 13\
|
||||
123 122 121 120 12\
|
||||
114 113 112 111 110 11\
|
||||
@@ -24,7 +25,7 @@ SUPPORTED_GCC_VERSIONS:=\
|
||||
55 54 53 52 51 50\
|
||||
49 48 47 46 45 44 43 42 41 40
|
||||
|
||||
LATEST_GCC_VERSION=14.1
|
||||
LATEST_GCC_VERSION=14.2.1
|
||||
|
||||
# gcc or g++
|
||||
ifdef PREFIX
|
||||
@@ -78,12 +79,32 @@ ifeq (,$(filter GCC%,$(.VARIABLES)))
|
||||
endif
|
||||
endif
|
||||
|
||||
ifdef GCC141
|
||||
ifdef GCC151
|
||||
GCC150=1
|
||||
endif
|
||||
|
||||
ifdef GCC15
|
||||
GCC150=1
|
||||
endif
|
||||
|
||||
ifdef GCC150
|
||||
GCC142=1
|
||||
endif
|
||||
|
||||
ifdef GCC142
|
||||
GCC141=1
|
||||
endif
|
||||
|
||||
ifdef GCC141
|
||||
GCC140=1
|
||||
endif
|
||||
|
||||
ifdef GCC14
|
||||
GCC14=1
|
||||
GCC140=1
|
||||
endif
|
||||
|
||||
ifdef GCC140
|
||||
GCC132=1
|
||||
endif
|
||||
|
||||
ifdef GCC132
|
||||
@@ -437,9 +458,6 @@ endif
|
||||
ifdef GCC44
|
||||
WFLAGS+=-Wno-error=array-bounds
|
||||
endif
|
||||
ifdef GCC45
|
||||
opts+=-fwrapv
|
||||
endif
|
||||
ifdef GCC46
|
||||
WFLAGS+=-Wno-error=suggest-attribute=noreturn
|
||||
endif
|
||||
@@ -464,7 +482,6 @@ ifdef GCC81
|
||||
WFLAGS+=-Wno-error=multistatement-macros
|
||||
endif
|
||||
|
||||
|
||||
#indicate platform and what interface use with
|
||||
ifndef LINUX
|
||||
ifndef FREEBSD
|
||||
@@ -472,7 +489,6 @@ ifndef CYGWIN32
|
||||
ifndef MINGW
|
||||
ifndef MINGW64
|
||||
ifndef SDL
|
||||
ifndef DUMMY
|
||||
$(error No interface or platform flag defined)
|
||||
endif
|
||||
endif
|
||||
@@ -480,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
|
||||
@@ -505,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
|
||||
@@ -556,7 +566,6 @@ endif
|
||||
endif
|
||||
endif
|
||||
endif
|
||||
endif
|
||||
|
||||
ifdef ARCHNAME
|
||||
OBJDIR:=$(OBJDIR)/$(ARCHNAME)
|
||||
@@ -571,7 +580,6 @@ ifdef SDL
|
||||
OBJDIR:=$(OBJDIR)/SDL
|
||||
endif
|
||||
|
||||
ifndef DUMMY
|
||||
ifdef DEBUGMODE
|
||||
OBJDIR:=$(OBJDIR)/Debug
|
||||
BIN:=$(BIN)/Debug
|
||||
@@ -579,4 +587,3 @@ else
|
||||
OBJDIR:=$(OBJDIR)/Release
|
||||
BIN:=$(BIN)/Release
|
||||
endif
|
||||
endif
|
||||
+467
-134
@@ -1,8 +1,10 @@
|
||||
// SONIC ROBO BLAST 2
|
||||
// SONIC ROBO BLAST 2 KART
|
||||
//-----------------------------------------------------------------------------
|
||||
// Copyright (C) 1993-1996 by id Software, Inc.
|
||||
// Copyright (C) 1998-2000 by DooM Legacy Team.
|
||||
// Copyright (C) 1999-2018 by Sonic Team Junior.
|
||||
// Copyright (C) 2024 by Vivian "toastergrl" Grannell.
|
||||
// Copyright (C) 2024 by Kart Krew.
|
||||
// Copyright (C) 2020 by Sonic Team Junior.
|
||||
// Copyright (C) 2000 by DooM Legacy Team.
|
||||
//
|
||||
// This program is free software distributed under the
|
||||
// terms of the GNU General Public License, version 2.
|
||||
@@ -33,36 +35,31 @@ static const UINT8 GRAYSRANGE = 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;
|
||||
|
||||
static const UINT8 NOCLIMBREDS = 248;
|
||||
static const UINT8 NOCLIMBREDRANGE = 8;
|
||||
static const UINT8 NOCLIMBGRAYS = 204;
|
||||
static const UINT8 NOCLIMBBROWNS = (2*16);
|
||||
static const UINT8 NOCLIMBYELLOWS = (11*16);
|
||||
|
||||
// Automap colors
|
||||
#define BACKGROUND DBLACK
|
||||
#define WALLCOLORS (REDS + REDRANGE/2)
|
||||
#define WALLRANGE (REDRANGE/2)
|
||||
#define NOCLIMBWALLCOLORS (NOCLIMBREDS + NOCLIMBREDRANGE/2)
|
||||
#define NOCLIMBWALLRANGE (NOCLIMBREDRANGE/2)
|
||||
#define THOKWALLCOLORS REDS
|
||||
#define THOKWALLRANGE REDRANGE
|
||||
#define NOCLIMBTHOKWALLCOLORS NOCLIMBREDS
|
||||
#define NOCLIMBTHOKWALLRANGE NOCLIMBREDRANGE
|
||||
#define TSWALLCOLORS GRAYS
|
||||
#define TSWALLRANGE GRAYSRANGE
|
||||
#define NOCLIMBTSWALLCOLORS NOCLIMBGRAYS
|
||||
#define TSWALLCOLORS DWHITE
|
||||
#define TSFINISHLINE (GREENS + 2)
|
||||
#define TSFOFINFO (BLUES + 4)
|
||||
#define FDWALLCOLORS BROWNS
|
||||
#define NOCLIMBFDWALLCOLORS NOCLIMBBROWNS
|
||||
#define CDWALLCOLORS YELLOWS
|
||||
#define NOCLIMBCDWALLCOLORS NOCLIMBYELLOWS
|
||||
#define THINGCOLORS GREENS
|
||||
#define GRIDCOLORS (GRAYS + GRAYSRANGE/2)
|
||||
#define XHAIRCOLORS GRAYS
|
||||
|
||||
// Automap passes
|
||||
#define PASS_SOLID 1
|
||||
#define PASS_INTANGIBLE 2
|
||||
#define PASS_FOF 4
|
||||
|
||||
// controls
|
||||
#define AM_PANUPKEY KEY_UPARROW
|
||||
#define AM_PANDOWNKEY KEY_DOWNARROW
|
||||
@@ -110,11 +107,6 @@ typedef struct
|
||||
mpoint_t a, b;
|
||||
} mline_t;
|
||||
|
||||
typedef struct
|
||||
{
|
||||
fixed_t slp, islp;
|
||||
} islope_t;
|
||||
|
||||
//
|
||||
// The vector graphics for the automap.
|
||||
// A line drawing of the player pointing right,
|
||||
@@ -136,16 +128,14 @@ static const mline_t player_arrow[] = {
|
||||
#undef R
|
||||
#define NUMPLYRLINES (sizeof (player_arrow)/sizeof (mline_t))
|
||||
|
||||
#if 0
|
||||
#define R (FRACUNIT)
|
||||
static mline_t triangle_guy[] = {
|
||||
{ { (fixed_t)-.867f*R, (fixed_t)-.5f*R }, { (fixed_t) .867f*R, (fixed_t)-.5f*R } },
|
||||
{ { (fixed_t) .867f*R, (fixed_t)-.5f*R }, { (fixed_t) 0, (fixed_t) R } },
|
||||
{ { (fixed_t) 0, (fixed_t) R }, { (fixed_t)-.867f*R, (fixed_t)-.5f*R } }
|
||||
static const mline_t cross_mark[] =
|
||||
{
|
||||
{ { -R, 0 }, { R, 0} },
|
||||
{ { 0, -R }, { 0, R } },
|
||||
};
|
||||
#undef R
|
||||
#define NUMTRIANGLEGUYLINES (sizeof (triangle_guy)/sizeof (mline_t))
|
||||
#endif
|
||||
#define NUMCROSSMARKLINES (sizeof(cross_mark)/sizeof(mline_t))
|
||||
|
||||
#define R (FRACUNIT)
|
||||
static const mline_t thintriangle_guy[] = {
|
||||
@@ -162,10 +152,14 @@ static boolean draw_grid = false;
|
||||
boolean automapactive = false;
|
||||
boolean am_recalc = false; //added : 05-02-98 : true when screen size changes
|
||||
static boolean am_stopped = true;
|
||||
static boolean am_minigen = false;
|
||||
|
||||
static UINT8 *am_buf = NULL;
|
||||
|
||||
static INT32 f_x, f_y; // location of window on screen (always zero for both)
|
||||
static INT32 f_w, f_h; // size of window on screen (always the screen width and height respectively)
|
||||
|
||||
static boolean m_keydown[4]; // which window panning keys are being pressed down?
|
||||
static mpoint_t m_paninc; // how far the window pans each tic (map coords)
|
||||
static fixed_t mtof_zoommul; // how far the window zooms in each tic (map coords)
|
||||
static fixed_t ftom_zoommul; // how far the window zooms in each tic (fb coords)
|
||||
@@ -205,12 +199,13 @@ static fixed_t scale_ftom;
|
||||
|
||||
static player_t *plr; // the player represented by an arrow
|
||||
|
||||
static INT32 followplayer = true; // specifies whether to follow the player around
|
||||
static boolean followplayer = true; // specifies whether to follow the player around
|
||||
|
||||
// function for drawing lines, depends on rendermode
|
||||
typedef void (*AMDRAWFLINEFUNC) (const fline_t *fl, INT32 color);
|
||||
static AMDRAWFLINEFUNC AM_drawFline;
|
||||
|
||||
static void AM_drawPixel(INT32 xx, INT32 yy, INT32 cc);
|
||||
static void AM_drawFline_soft(const fline_t *fl, INT32 color);
|
||||
|
||||
static void AM_activateNewScale(void)
|
||||
@@ -260,28 +255,15 @@ static inline void AM_restoreScaleAndLoc(void)
|
||||
*/
|
||||
static void AM_findMinMaxBoundaries(void)
|
||||
{
|
||||
size_t i;
|
||||
fixed_t a;
|
||||
fixed_t b;
|
||||
fixed_t a, b;
|
||||
|
||||
min_x = min_y = +INT32_MAX;
|
||||
max_x = max_y = -INT32_MAX;
|
||||
min_x = minimapinfo.min_x << MAPBITS;
|
||||
max_x = minimapinfo.max_x << MAPBITS;
|
||||
min_y = minimapinfo.min_y << MAPBITS;
|
||||
max_y = minimapinfo.max_y << MAPBITS;
|
||||
|
||||
for (i = 0; i < numvertexes; i++)
|
||||
{
|
||||
if (vertexes[i].x < min_x)
|
||||
min_x = vertexes[i].x;
|
||||
else if (vertexes[i].x > max_x)
|
||||
max_x = vertexes[i].x;
|
||||
|
||||
if (vertexes[i].y < min_y)
|
||||
min_y = vertexes[i].y;
|
||||
else if (vertexes[i].y > max_y)
|
||||
max_y = vertexes[i].y;
|
||||
}
|
||||
|
||||
max_w = (max_x >>= FRACTOMAPBITS) - (min_x >>= FRACTOMAPBITS);
|
||||
max_h = (max_y >>= FRACTOMAPBITS) - (min_y >>= FRACTOMAPBITS);
|
||||
max_w = minimapinfo.map_w << MAPBITS;
|
||||
max_h = minimapinfo.map_h << MAPBITS;
|
||||
|
||||
a = FixedDiv(f_w<<FRACBITS, max_w);
|
||||
b = FixedDiv(f_h<<FRACBITS, max_h);
|
||||
@@ -350,22 +332,23 @@ static void AM_initVariables(void)
|
||||
old_m_h = m_h;
|
||||
}
|
||||
|
||||
//
|
||||
// Called when the screen size changes.
|
||||
//
|
||||
static void AM_FrameBufferInit(void)
|
||||
{
|
||||
f_x = f_y = 0;
|
||||
f_w = vid.width;
|
||||
f_h = vid.height;
|
||||
am_buf = screens[0];
|
||||
}
|
||||
|
||||
//
|
||||
// should be called at the start of every level
|
||||
// right now, i figure it out myself
|
||||
//
|
||||
static void AM_LevelInit(void)
|
||||
{
|
||||
f_x = f_y = 0;
|
||||
f_w = vid.width;
|
||||
f_h = vid.height;
|
||||
|
||||
AM_drawFline = AM_drawFline_soft;
|
||||
#ifdef HWRENDER
|
||||
if (rendermode == render_opengl)
|
||||
AM_drawFline = HWR_drawAMline;
|
||||
#endif
|
||||
|
||||
AM_findMinMaxBoundaries();
|
||||
scale_mtof = FixedDiv(min_scale_mtof*10, 7*FRACUNIT);
|
||||
if (scale_mtof > max_scale_mtof)
|
||||
@@ -387,7 +370,7 @@ void AM_Stop(void)
|
||||
*
|
||||
* \sa AM_Stop
|
||||
*/
|
||||
static inline void AM_Start(void)
|
||||
void AM_Start(void)
|
||||
{
|
||||
static INT32 lastlevel = -1;
|
||||
|
||||
@@ -396,8 +379,12 @@ static inline void AM_Start(void)
|
||||
am_stopped = false;
|
||||
if (lastlevel != gamemap || am_recalc) // screen size changed
|
||||
{
|
||||
AM_LevelInit();
|
||||
lastlevel = gamemap;
|
||||
AM_FrameBufferInit();
|
||||
if (lastlevel != gamemap)
|
||||
{
|
||||
AM_LevelInit();
|
||||
lastlevel = gamemap;
|
||||
}
|
||||
am_recalc = false;
|
||||
}
|
||||
AM_initVariables();
|
||||
@@ -423,6 +410,28 @@ static void AM_maxOutWindowScale(void)
|
||||
AM_activateNewScale();
|
||||
}
|
||||
|
||||
//
|
||||
// set window panning
|
||||
//
|
||||
static void AM_setWindowPanning(void)
|
||||
{
|
||||
// up and down
|
||||
if (m_keydown[2]) // pan up
|
||||
m_paninc.y = FTOM(F_PANINC);
|
||||
else if (m_keydown[3]) // pan down
|
||||
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);
|
||||
else if (m_keydown[1]) // pan left
|
||||
m_paninc.x = -FTOM(F_PANINC);
|
||||
else
|
||||
m_paninc.x = 0;
|
||||
}
|
||||
|
||||
/** Responds to user inputs in automap mode.
|
||||
*
|
||||
* \param ev Event to possibly respond to.
|
||||
@@ -455,35 +464,49 @@ boolean AM_Responder(event_t *ev)
|
||||
{
|
||||
case AM_PANRIGHTKEY: // pan right
|
||||
if (!followplayer)
|
||||
m_paninc.x = FTOM(F_PANINC);
|
||||
{
|
||||
m_keydown[0] = true;
|
||||
AM_setWindowPanning();
|
||||
}
|
||||
else
|
||||
rc = false;
|
||||
break;
|
||||
case AM_PANLEFTKEY: // pan left
|
||||
if (!followplayer)
|
||||
m_paninc.x = -FTOM(F_PANINC);
|
||||
{
|
||||
m_keydown[1] = true;
|
||||
AM_setWindowPanning();
|
||||
}
|
||||
else
|
||||
rc = false;
|
||||
break;
|
||||
case AM_PANUPKEY: // pan up
|
||||
if (!followplayer)
|
||||
m_paninc.y = FTOM(F_PANINC);
|
||||
{
|
||||
m_keydown[2] = true;
|
||||
AM_setWindowPanning();
|
||||
}
|
||||
else
|
||||
rc = false;
|
||||
break;
|
||||
case AM_PANDOWNKEY: // pan down
|
||||
if (!followplayer)
|
||||
m_paninc.y = -FTOM(F_PANINC);
|
||||
{
|
||||
m_keydown[3] = true;
|
||||
AM_setWindowPanning();
|
||||
}
|
||||
else
|
||||
rc = false;
|
||||
break;
|
||||
case AM_ZOOMOUTKEY: // zoom out
|
||||
mtof_zoommul = M_ZOOMOUT;
|
||||
ftom_zoommul = M_ZOOMIN;
|
||||
AM_setWindowPanning();
|
||||
break;
|
||||
case AM_ZOOMINKEY: // zoom in
|
||||
mtof_zoommul = M_ZOOMIN;
|
||||
ftom_zoommul = M_ZOOMOUT;
|
||||
AM_setWindowPanning();
|
||||
break;
|
||||
case AM_TOGGLEKEY:
|
||||
AM_Stop();
|
||||
@@ -497,6 +520,7 @@ boolean AM_Responder(event_t *ev)
|
||||
}
|
||||
else
|
||||
AM_restoreScaleAndLoc();
|
||||
AM_setWindowPanning();
|
||||
break;
|
||||
case AM_FOLLOWKEY:
|
||||
followplayer = !followplayer;
|
||||
@@ -516,14 +540,32 @@ boolean AM_Responder(event_t *ev)
|
||||
switch (ev->data1)
|
||||
{
|
||||
case AM_PANRIGHTKEY:
|
||||
if (!followplayer)
|
||||
{
|
||||
m_keydown[0] = false;
|
||||
AM_setWindowPanning();
|
||||
}
|
||||
break;
|
||||
case AM_PANLEFTKEY:
|
||||
if (!followplayer)
|
||||
m_paninc.x = 0;
|
||||
{
|
||||
m_keydown[1] = false;
|
||||
AM_setWindowPanning();
|
||||
}
|
||||
break;
|
||||
case AM_PANUPKEY:
|
||||
if (!followplayer)
|
||||
{
|
||||
m_keydown[2] = false;
|
||||
AM_setWindowPanning();
|
||||
}
|
||||
break;
|
||||
case AM_PANDOWNKEY:
|
||||
if (!followplayer)
|
||||
m_paninc.y = 0;
|
||||
{
|
||||
m_keydown[3] = false;
|
||||
AM_setWindowPanning();
|
||||
}
|
||||
break;
|
||||
case AM_ZOOMOUTKEY:
|
||||
case AM_ZOOMINKEY:
|
||||
@@ -724,6 +766,16 @@ static boolean AM_clipMline(const mline_t *ml, fline_t *fl)
|
||||
}
|
||||
#undef DOOUTCODE
|
||||
|
||||
//
|
||||
// Draws a pixel.
|
||||
//
|
||||
static void AM_drawPixel(INT32 xx, INT32 yy, INT32 cc)
|
||||
{
|
||||
if (xx < 0 || yy < 0 || xx >= f_w || yy >= f_h)
|
||||
return; // off the screen
|
||||
am_buf[(yy*f_w) + xx] = cc;
|
||||
}
|
||||
|
||||
//
|
||||
// Classic Bresenham w/ whatever optimizations needed for speed
|
||||
//
|
||||
@@ -745,8 +797,6 @@ static void AM_drawFline_soft(const fline_t *fl, INT32 color)
|
||||
}
|
||||
#endif
|
||||
|
||||
#define PUTDOT(xx,yy,cc) V_DrawFill(xx,yy,1,1,cc|V_NOSCALESTART);
|
||||
|
||||
dx = fl->b.x - fl->a.x;
|
||||
ax = 2 * (dx < 0 ? -dx : dx);
|
||||
sx = dx < 0 ? -1 : 1;
|
||||
@@ -763,7 +813,7 @@ static void AM_drawFline_soft(const fline_t *fl, INT32 color)
|
||||
d = ay - ax/2;
|
||||
for (;;)
|
||||
{
|
||||
PUTDOT(x, y, color)
|
||||
AM_drawPixel(x, y, color);
|
||||
if (x == fl->b.x)
|
||||
return;
|
||||
if (d >= 0)
|
||||
@@ -780,7 +830,7 @@ static void AM_drawFline_soft(const fline_t *fl, INT32 color)
|
||||
d = ax - ay/2;
|
||||
for (;;)
|
||||
{
|
||||
PUTDOT(x, y, color)
|
||||
AM_drawPixel(x, y, color);
|
||||
if (y == fl->b.y)
|
||||
return;
|
||||
if (d >= 0)
|
||||
@@ -792,8 +842,6 @@ static void AM_drawFline_soft(const fline_t *fl, INT32 color)
|
||||
d += ax;
|
||||
}
|
||||
}
|
||||
|
||||
#undef PUTDOT
|
||||
}
|
||||
|
||||
//
|
||||
@@ -815,17 +863,18 @@ static void AM_drawGrid(INT32 color)
|
||||
fixed_t x, y;
|
||||
fixed_t start, end;
|
||||
mline_t ml;
|
||||
fixed_t gridsize = (MAPBLOCKUNITS<<MAPBITS);
|
||||
|
||||
// Figure out start of vertical gridlines
|
||||
start = m_x;
|
||||
if ((start - bmaporgx) % (MAPBLOCKUNITS<<FRACBITS))
|
||||
start += (MAPBLOCKUNITS<<FRACBITS) - ((start - bmaporgx) % (MAPBLOCKUNITS<<FRACBITS));
|
||||
if ((start - (bmaporgx>>FRACTOMAPBITS)) % gridsize)
|
||||
start += gridsize - ((start - (bmaporgx>>FRACTOMAPBITS)) % gridsize);
|
||||
end = m_x + m_w;
|
||||
|
||||
// draw vertical gridlines
|
||||
ml.a.y = m_y;
|
||||
ml.b.y = m_y + m_h;
|
||||
for (x = start; x < end; x += (MAPBLOCKUNITS<<FRACBITS))
|
||||
for (x = start; x < end; x += gridsize)
|
||||
{
|
||||
ml.a.x = x;
|
||||
ml.b.x = x;
|
||||
@@ -834,14 +883,14 @@ static void AM_drawGrid(INT32 color)
|
||||
|
||||
// Figure out start of horizontal gridlines
|
||||
start = m_y;
|
||||
if ((start - bmaporgy) % (MAPBLOCKUNITS<<FRACBITS))
|
||||
start += (MAPBLOCKUNITS<<FRACBITS) - ((start - bmaporgy) % (MAPBLOCKUNITS<<FRACBITS));
|
||||
if ((start - (bmaporgy>>FRACTOMAPBITS)) % gridsize)
|
||||
start += gridsize - ((start - (bmaporgy>>FRACTOMAPBITS)) % gridsize);
|
||||
end = m_y + m_h;
|
||||
|
||||
// draw horizontal gridlines
|
||||
ml.a.x = m_x;
|
||||
ml.b.x = m_x + m_w;
|
||||
for (y = start; y < end; y += (MAPBLOCKUNITS<<FRACBITS))
|
||||
for (y = start; y < end; y += gridsize)
|
||||
{
|
||||
ml.a.y = y;
|
||||
ml.b.y = y;
|
||||
@@ -849,14 +898,118 @@ 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) \
|
||||
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)
|
||||
continue;
|
||||
if (rovb1 != secb1)
|
||||
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;
|
||||
}
|
||||
return rover;
|
||||
}
|
||||
|
||||
//
|
||||
// Determines visible lines, draws them.
|
||||
// This is LineDef based, not LineSeg based.
|
||||
//
|
||||
static inline void AM_drawWalls(void)
|
||||
static void AM_drawWalls(UINT8 pass)
|
||||
{
|
||||
size_t i;
|
||||
static mline_t l;
|
||||
const fixed_t maxstep = FixedMul(MAXSTEPMOVE, mapobjectscale)>>FRACBITS;
|
||||
fixed_t frontf1,frontf2, frontc1, frontc2; // front floor/ceiling ends
|
||||
fixed_t backf1 = 0, backf2 = 0, backc1 = 0, backc2 = 0; // back floor ceiling ends
|
||||
|
||||
@@ -866,74 +1019,142 @@ static inline void AM_drawWalls(void)
|
||||
l.a.y = lines[i].v1->y >> FRACTOMAPBITS;
|
||||
l.b.x = lines[i].v2->x >> FRACTOMAPBITS;
|
||||
l.b.y = lines[i].v2->y >> FRACTOMAPBITS;
|
||||
#define SLOPEPARAMS(slope, end1, end2, normalheight) \
|
||||
if (slope) { \
|
||||
end1 = P_GetZAt(slope, lines[i].v1->x, lines[i].v1->y); \
|
||||
end2 = P_GetZAt(slope, lines[i].v2->x, lines[i].v2->y); \
|
||||
} else \
|
||||
end1 = end2 = normalheight;
|
||||
|
||||
SLOPEPARAMS(lines[i].frontsector->f_slope, frontf1, frontf2, lines[i].frontsector->floorheight)
|
||||
SLOPEPARAMS(lines[i].frontsector->c_slope, frontc1, frontc2, lines[i].frontsector->ceilingheight)
|
||||
if (lines[i].backsector) {
|
||||
SLOPEPARAMS(lines[i].backsector->f_slope, backf1, backf2, lines[i].backsector->floorheight)
|
||||
SLOPEPARAMS(lines[i].backsector->c_slope, backc1, backc2, lines[i].backsector->ceilingheight)
|
||||
}
|
||||
#undef SLOPEPARAMS
|
||||
|
||||
if (!lines[i].backsector) // 1-sided
|
||||
{
|
||||
if (lines[i].flags & ML_NOCLIMB)
|
||||
AM_drawMline(&l, NOCLIMBWALLCOLORS);
|
||||
else
|
||||
if (!(pass & PASS_SOLID))
|
||||
;
|
||||
else if (frontf1 != frontc1 || frontf2 != frontc2 || lines[i].frontsector->f_slope)
|
||||
{
|
||||
AM_drawMline(&l, TSWALLCOLORS);
|
||||
}
|
||||
else if (!am_minigen)
|
||||
{
|
||||
AM_drawMline(&l, WALLCOLORS);
|
||||
}
|
||||
continue;
|
||||
}
|
||||
else if ((backf1 == backc1 && backf2 == backc2) // Back is thok barrier
|
||||
|
||||
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
|
||||
{
|
||||
if (backf1 == backc1 && backf2 == backc2
|
||||
&& frontf1 == frontc1 && frontf2 == frontc2) // BOTH are thok barriers
|
||||
{
|
||||
if (lines[i].flags & ML_NOCLIMB)
|
||||
AM_drawMline(&l, NOCLIMBTSWALLCOLORS);
|
||||
else
|
||||
AM_drawMline(&l, TSWALLCOLORS);
|
||||
if (!am_minigen && (pass & PASS_INTANGIBLE))
|
||||
{
|
||||
AM_drawMline(&l, GRIDCOLORS);
|
||||
}
|
||||
}
|
||||
else
|
||||
else if (pass & PASS_SOLID)
|
||||
{
|
||||
if (lines[i].flags & ML_NOCLIMB)
|
||||
AM_drawMline(&l, NOCLIMBTHOKWALLCOLORS);
|
||||
else
|
||||
AM_drawMline(&l, THOKWALLCOLORS);
|
||||
AM_drawMline(&l, TSWALLCOLORS);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if (lines[i].flags & ML_NOCLIMB) {
|
||||
if (backf1 != frontf1 || backf2 != frontf2) {
|
||||
AM_drawMline(&l, NOCLIMBFDWALLCOLORS); // floor level change
|
||||
}
|
||||
else if (backc1 != frontc1 || backc2 != frontc2) {
|
||||
AM_drawMline(&l, NOCLIMBCDWALLCOLORS); // ceiling level change
|
||||
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_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 (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)
|
||||
AM_drawMline(&l, FDWALLCOLORS); // floorlevel change
|
||||
}
|
||||
else if (backc1 != frontc1 || backc2 != frontc2)
|
||||
{
|
||||
if (!(pass & PASS_INTANGIBLE))
|
||||
;
|
||||
else if (abs(backc1 - frontc1) < maxstep
|
||||
|| abs(backc2 - frontc2) < maxstep)
|
||||
{
|
||||
AM_drawMline(&l, CDWALLCOLORS); // ceilinglevel change
|
||||
}
|
||||
else
|
||||
AM_drawMline(&l, NOCLIMBTSWALLCOLORS);
|
||||
{
|
||||
AM_drawMline(&l, GRIDCOLORS); // ceiling-wall, not likely to be a course boundary but flagged up just in case
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if (backf1 != frontf1 || backf2 != frontf2) {
|
||||
AM_drawMline(&l, FDWALLCOLORS); // floor level change
|
||||
ffloor_t *rover = NULL;
|
||||
|
||||
if (lines[i].frontsector->ffloors || lines[i].backsector->ffloors)
|
||||
{
|
||||
if (lines[i].backsector->ffloors == NULL)
|
||||
{
|
||||
// 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);
|
||||
}
|
||||
}
|
||||
else if (backc1 != frontc1 || backc2 != frontc2) {
|
||||
AM_drawMline(&l, CDWALLCOLORS); // ceiling level change
|
||||
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
|
||||
}
|
||||
else
|
||||
AM_drawMline(&l, TSWALLCOLORS);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#undef SLOPEPARAMS
|
||||
|
||||
//
|
||||
// Rotation in 2D.
|
||||
// Used to rotate player arrow line character.
|
||||
@@ -1004,23 +1225,19 @@ static inline void AM_drawPlayers(void)
|
||||
player_t *p;
|
||||
INT32 color = GREENS;
|
||||
|
||||
if (!multiplayer)
|
||||
{
|
||||
AM_drawLineCharacter(player_arrow, NUMPLYRLINES, 0, 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;
|
||||
|
||||
p = &players[i];
|
||||
if (p->skincolor > 0)
|
||||
color = R_GetTranslationColormap(TC_DEFAULT, p->skincolor, GTC_CACHE)[GREENS + 8];
|
||||
|
||||
AM_drawLineCharacter(player_arrow, NUMPLYRLINES, 0, p->mo->angle, color, p->mo->x, p->mo->y);
|
||||
AM_drawLineCharacter(player_arrow, NUMPLYRLINES, 16<<FRACBITS, p->mo->angle, color, p->mo->x, p->mo->y);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1034,19 +1251,65 @@ 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;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/** Draws the crosshair, actually just a dot in software mode.
|
||||
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;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/** Draws the crosshair.
|
||||
*
|
||||
* \param color Color for the crosshair.
|
||||
*/
|
||||
static inline void AM_drawCrosshair(UINT8 color)
|
||||
{
|
||||
V_DrawFill(f_w/2 + f_x, f_h/2 + f_y, 1, 1, color|V_NOSCALESTART);
|
||||
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);
|
||||
}
|
||||
}
|
||||
|
||||
/** Draws the automap.
|
||||
@@ -1056,11 +1319,81 @@ void AM_Drawer(void)
|
||||
if (!automapactive)
|
||||
return;
|
||||
|
||||
AM_drawFline = AM_drawFline_soft;
|
||||
#ifdef HWRENDER
|
||||
if (rendermode == render_opengl)
|
||||
AM_drawFline = HWR_drawAMline;
|
||||
#endif
|
||||
|
||||
AM_clearFB(BACKGROUND);
|
||||
if (draw_grid) AM_drawGrid(GRIDCOLORS);
|
||||
AM_drawWalls();
|
||||
AM_drawPlayers();
|
||||
AM_drawWalls(PASS_FOF|PASS_INTANGIBLE|PASS_SOLID);
|
||||
AM_drawThings(THINGCOLORS);
|
||||
AM_drawPlayers();
|
||||
|
||||
AM_drawCrosshair(XHAIRCOLORS);
|
||||
if (!followplayer) AM_drawCrosshair(XHAIRCOLORS);
|
||||
}
|
||||
|
||||
minigen_t *AM_MinimapGenerate(INT32 mul)
|
||||
{
|
||||
static minigen_t ret = {0};
|
||||
|
||||
if (automapactive)
|
||||
return NULL;
|
||||
|
||||
am_minigen = true;
|
||||
|
||||
AM_drawFline = AM_drawFline_soft; // yes, even in GL
|
||||
|
||||
//AM_FrameBufferInit();
|
||||
f_x = f_y = 0;
|
||||
ret.w = f_w = minimapinfo.minimap_w * mul;
|
||||
ret.h = f_h = minimapinfo.minimap_h * mul;
|
||||
am_buf = ret.buf = NULL;
|
||||
|
||||
//AM_LevelInit();
|
||||
AM_findMinMaxBoundaries();
|
||||
scale_mtof = min_scale_mtof - (min_scale_mtof/20);
|
||||
scale_ftom = FixedDiv(FRACUNIT, scale_mtof);
|
||||
|
||||
//AM_initVariables();
|
||||
f_oldloc.x = INT32_MAX;
|
||||
|
||||
m_paninc.x = m_paninc.y = 0;
|
||||
ftom_zoommul = FRACUNIT;
|
||||
mtof_zoommul = FRACUNIT;
|
||||
|
||||
m_w = FTOM(f_w);
|
||||
m_h = FTOM(f_h);
|
||||
|
||||
//AM_changeWindowLoc();
|
||||
m_x = min_x - FixedMul(m_w, FRACUNIT/40);
|
||||
m_y = min_y - FixedMul(m_h, FRACUNIT/40);
|
||||
m_x2 = m_x + m_w;
|
||||
m_y2 = m_y + m_h;
|
||||
|
||||
// for saving & restoring
|
||||
old_m_x = m_x;
|
||||
old_m_y = m_y;
|
||||
old_m_w = m_w;
|
||||
old_m_h = m_h;
|
||||
|
||||
am_buf = ret.buf = malloc((f_w*f_h));
|
||||
|
||||
if (ret.buf == NULL)
|
||||
return NULL;
|
||||
|
||||
//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);
|
||||
|
||||
am_buf = NULL;
|
||||
am_recalc = true;
|
||||
|
||||
am_minigen = false;
|
||||
|
||||
return &ret;
|
||||
}
|
||||
+17
-8
@@ -1,8 +1,10 @@
|
||||
// SONIC ROBO BLAST 2
|
||||
// SONIC ROBO BLAST 2 KART
|
||||
//-----------------------------------------------------------------------------
|
||||
// Copyright (C) 1993-1996 by id Software, Inc.
|
||||
// Copyright (C) 1998-2000 by DooM Legacy Team.
|
||||
// Copyright (C) 1999-2018 by Sonic Team Junior.
|
||||
// Copyright (C) 2024 by Vivian "toastergrl" Grannell.
|
||||
// Copyright (C) 2024 by Kart Krew.
|
||||
// Copyright (C) 2020 by Sonic Team Junior.
|
||||
// Copyright (C) 2000 by DooM Legacy Team.
|
||||
//
|
||||
// This program is free software distributed under the
|
||||
// terms of the GNU General Public License, version 2.
|
||||
@@ -26,11 +28,6 @@ typedef struct
|
||||
fpoint_t a, b;
|
||||
} fline_t;
|
||||
|
||||
// Used by ST StatusBar stuff.
|
||||
#define AM_MSGHEADER (('a'<<24)+('m'<<16))
|
||||
#define AM_MSGENTERED (AM_MSGHEADER | ('e'<<8))
|
||||
#define AM_MSGEXITED (AM_MSGHEADER | ('x'<<8))
|
||||
|
||||
extern boolean am_recalc; // true if screen size changes
|
||||
extern boolean automapactive; // In AutoMap mode?
|
||||
|
||||
@@ -43,7 +40,19 @@ void AM_Ticker(void);
|
||||
// Called by main loop, instead of view drawer if automap is active.
|
||||
void AM_Drawer(void);
|
||||
|
||||
// Enables the automap.
|
||||
void AM_Start(void);
|
||||
|
||||
// Called to force the automap to quit if the level is completed while it is up.
|
||||
void AM_Stop(void);
|
||||
|
||||
typedef struct
|
||||
{
|
||||
INT32 w, h;
|
||||
UINT8 *buf;
|
||||
} minigen_t;
|
||||
|
||||
// Minimap generation
|
||||
minigen_t *AM_MinimapGenerate(INT32 mul);
|
||||
|
||||
#endif
|
||||
@@ -184,8 +184,6 @@ void I_OutputMsg(const char *fmt, ...)
|
||||
|
||||
void I_StartupMouse(void){}
|
||||
|
||||
void I_StartupMouse2(void){}
|
||||
|
||||
void I_StartupKeyboard(void){}
|
||||
|
||||
INT32 I_GetKey(void)
|
||||
@@ -242,8 +240,6 @@ void I_GetJoystickEvents(void){}
|
||||
|
||||
void I_GetJoystick2Events(void){}
|
||||
|
||||
void I_GetMouseEvents(void){}
|
||||
|
||||
char *I_GetEnv(const char *name)
|
||||
{
|
||||
LOGW("I_GetEnv() called?!");
|
||||
|
||||
+2
-5
@@ -36,7 +36,7 @@ static inline void B_BuildTailsTiccmd(mobj_t *sonic, mobj_t *tails, ticcmd_t *cm
|
||||
return;
|
||||
|
||||
// Lua can handle it!
|
||||
if (LUAh_BotAI(sonic, tails, cmd))
|
||||
if (LUA_HookBotAI(sonic, tails, cmd))
|
||||
return;
|
||||
|
||||
if (tails->player->pflags & (PF_MACESPIN|PF_ITEMHANG))
|
||||
@@ -118,11 +118,8 @@ void B_BuildTiccmd(player_t *player, ticcmd_t *cmd)
|
||||
return;
|
||||
}
|
||||
|
||||
// Bot AI isn't programmed in analog.
|
||||
//CV_SetValue(&cv_analog2, false);
|
||||
|
||||
// Let Lua scripts build ticcmds
|
||||
if (LUAh_BotTiccmd(player, cmd))
|
||||
if (LUA_HookTiccmd(player, cmd, HOOK(BotTiccmd)))
|
||||
return;
|
||||
|
||||
// We don't have any main character AI, sorry. D:
|
||||
|
||||
+28
-23
@@ -1,7 +1,7 @@
|
||||
// SONIC ROBO BLAST 2
|
||||
//-----------------------------------------------------------------------------
|
||||
// Copyright (C) 1998-2000 by DooM Legacy Team.
|
||||
// Copyright (C) 1999-2018 by Sonic Team Junior.
|
||||
// Copyright (C) 1999-2024 by Sonic Team Junior.
|
||||
//
|
||||
// This program is free software distributed under the
|
||||
// terms of the GNU General Public License, version 2.
|
||||
@@ -11,6 +11,9 @@
|
||||
/// \brief Macros to read/write from/to a UINT8 *,
|
||||
/// used for packet creation and such
|
||||
|
||||
#ifndef __BYTEPTR_H__
|
||||
#define __BYTEPTR_H__
|
||||
|
||||
#if defined (__alpha__) || defined (__arm__) || defined (__mips__) || defined (__ia64__) || defined (__clang__)
|
||||
#define DEALIGNED
|
||||
#endif
|
||||
@@ -150,7 +153,7 @@ FUNCINLINE static ATTRINLINE UINT32 readulong(void *ptr)
|
||||
|
||||
#undef DEALIGNED
|
||||
|
||||
#define WRITESTRINGN(p, s, n) ({ \
|
||||
#define WRITESTRINGN(p, s, n) do { \
|
||||
size_t tmp_i; \
|
||||
\
|
||||
for (tmp_i = 0; tmp_i < n && s[tmp_i] != '\0'; tmp_i++) \
|
||||
@@ -158,70 +161,72 @@ FUNCINLINE static ATTRINLINE UINT32 readulong(void *ptr)
|
||||
\
|
||||
if (tmp_i < n) \
|
||||
WRITECHAR(p, '\0'); \
|
||||
})
|
||||
} while (0)
|
||||
|
||||
#define WRITESTRINGL(p, s, n) ({ \
|
||||
#define WRITESTRINGL(p, s, n) do { \
|
||||
size_t tmp_i; \
|
||||
\
|
||||
for (tmp_i = 0; tmp_i < n - 1 && s[tmp_i] != '\0'; tmp_i++) \
|
||||
WRITECHAR(p, s[tmp_i]); \
|
||||
\
|
||||
WRITECHAR(p, '\0'); \
|
||||
})
|
||||
} while (0)
|
||||
|
||||
#define WRITESTRING(p, s) ({ \
|
||||
#define WRITESTRING(p, s) do { \
|
||||
size_t tmp_i; \
|
||||
\
|
||||
for (tmp_i = 0; s[tmp_i] != '\0'; tmp_i++) \
|
||||
WRITECHAR(p, s[tmp_i]); \
|
||||
\
|
||||
WRITECHAR(p, '\0'); \
|
||||
})
|
||||
} while (0)
|
||||
|
||||
#define WRITEMEM(p, s, n) ({ \
|
||||
memcpy(p, s, n); \
|
||||
p += n; \
|
||||
})
|
||||
#define WRITEMEM(p, s, n) do { \
|
||||
memcpy(p, s, n); \
|
||||
p += n; \
|
||||
} while (0)
|
||||
|
||||
#define SKIPSTRING(p) while (READCHAR(p) != '\0')
|
||||
|
||||
#define SKIPSTRINGN(p, n) ({ \
|
||||
#define SKIPSTRINGN(p, n) do { \
|
||||
size_t tmp_i = 0; \
|
||||
\
|
||||
while (tmp_i < n && READCHAR(p) != '\0') \
|
||||
tmp_i++; \
|
||||
})
|
||||
} while (0)
|
||||
|
||||
#define SKIPSTRINGL(p, n) SKIPSTRINGN(p, n)
|
||||
|
||||
#define READSTRINGN(p, s, n) ({ \
|
||||
#define READSTRINGN(p, s, n) do { \
|
||||
size_t tmp_i = 0; \
|
||||
\
|
||||
while (tmp_i < n && (s[tmp_i] = READCHAR(p)) != '\0') \
|
||||
tmp_i++; \
|
||||
\
|
||||
s[tmp_i] = '\0'; \
|
||||
})
|
||||
} while (0)
|
||||
|
||||
#define READSTRINGL(p, s, n) ({ \
|
||||
#define READSTRINGL(p, s, n) do { \
|
||||
size_t tmp_i = 0; \
|
||||
\
|
||||
while (tmp_i < n - 1 && (s[tmp_i] = READCHAR(p)) != '\0') \
|
||||
tmp_i++; \
|
||||
\
|
||||
s[tmp_i] = '\0'; \
|
||||
})
|
||||
} while (0)
|
||||
|
||||
#define READSTRING(p, s) ({ \
|
||||
#define READSTRING(p, s) do { \
|
||||
size_t tmp_i = 0; \
|
||||
\
|
||||
while ((s[tmp_i] = READCHAR(p)) != '\0') \
|
||||
tmp_i++; \
|
||||
\
|
||||
s[tmp_i] = '\0'; \
|
||||
})
|
||||
} while (0)
|
||||
|
||||
#define READMEM(p, s, n) ({ \
|
||||
memcpy(s, p, n); \
|
||||
p += n; \
|
||||
})
|
||||
#define READMEM(p, s, n) do { \
|
||||
memcpy(s, p, n); \
|
||||
p += n; \
|
||||
} while (0)
|
||||
|
||||
#endif // __BYTEPTR_H__
|
||||
+3
-16
@@ -628,7 +628,7 @@ static void COM_ExecuteString(char *ptext)
|
||||
|
||||
// check cvars
|
||||
// Hurdler: added at Ebola's request ;)
|
||||
// (don't flood the console in software mode with bad gr_xxx command)
|
||||
// (don't flood the console in software mode with bad gl_xxx command)
|
||||
if (!CV_Command() && con_destlines)
|
||||
CONS_Printf(M_GetText("Unknown command '%s'\n"), COM_Argv(0));
|
||||
}
|
||||
@@ -1493,11 +1493,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 +1984,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 +2041,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))
|
||||
|
||||
+98
-287
@@ -32,6 +32,7 @@
|
||||
#include "i_threads.h"
|
||||
#include "d_main.h"
|
||||
#include "m_menu.h"
|
||||
#include "m_textinput.h"
|
||||
#include "filesrch.h"
|
||||
|
||||
#ifdef HWRENDER
|
||||
@@ -43,8 +44,12 @@
|
||||
#ifdef HAVE_THREADS
|
||||
I_mutex con_mutex;
|
||||
|
||||
# define Lock_state() I_lock_mutex(&con_mutex)
|
||||
# define Unlock_state() I_unlock_mutex(con_mutex)
|
||||
// g_in_exiting_signal_handler is an evil hack
|
||||
// to avoid infinite SIGABRT recursion in the signal handler
|
||||
// due to poisoned locks or mach-o kernel not supporting locks in signals
|
||||
// or something like that. idk
|
||||
# define Lock_state() if (!g_in_exiting_signal_handler) { I_lock_mutex(&con_mutex); }
|
||||
# define Unlock_state() if (!g_in_exiting_signal_handler) { I_unlock_mutex(con_mutex); }
|
||||
#else/*HAVE_THREADS*/
|
||||
# define Lock_state()
|
||||
# define Unlock_state()
|
||||
@@ -93,9 +98,7 @@ static char inputlines[32][CON_MAXPROMPTCHARS]; // hold last 32 prompt lines
|
||||
|
||||
static INT32 inputline; // current input line number
|
||||
static INT32 inputhist; // line number of history input line to restore
|
||||
static size_t input_cur; // position of cursor in line
|
||||
static size_t input_sel; // position of selection marker (I.E.: anything between this and input_cur is "selected")
|
||||
static size_t input_len; // length of current line, used to bound cursor and such
|
||||
static textinput_t input;
|
||||
// notice: input does NOT include the "$" at the start of the line. - 11/3/16
|
||||
|
||||
// protos.
|
||||
@@ -272,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++)
|
||||
@@ -454,7 +456,8 @@ static void CON_InputInit(void)
|
||||
// prepare the first prompt line
|
||||
memset(inputlines, 0, sizeof (inputlines));
|
||||
inputline = 0;
|
||||
input_cur = input_sel = input_len = 0;
|
||||
|
||||
M_TextInputInit(&input, inputlines[inputline], CON_MAXPROMPTCHARS);
|
||||
|
||||
Unlock_state();
|
||||
}
|
||||
@@ -604,7 +607,7 @@ static void CON_MoveConsole(void)
|
||||
}
|
||||
|
||||
// Not instant - Increment fracmovement fractionally
|
||||
fracmovement += FixedMul(cons_speed.value*vid.fdupy, renderdeltatics);
|
||||
fracmovement += FixedMul(cons_speed.value*vid.fdupy, (cv_uncappedhud.value ? renderdeltatics : FRACUNIT));
|
||||
|
||||
if (con_curlines < con_destlines) // Move the console downwards
|
||||
{
|
||||
@@ -617,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();
|
||||
@@ -631,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)
|
||||
@@ -798,113 +801,6 @@ void CON_Ticker(void)
|
||||
Unlock_state();
|
||||
}
|
||||
|
||||
//
|
||||
// ----
|
||||
//
|
||||
// Shortcuts for adding and deleting characters, strings, and sections
|
||||
// Necessary due to moving cursor
|
||||
//
|
||||
|
||||
static void CON_InputClear(void)
|
||||
{
|
||||
Lock_state();
|
||||
|
||||
memset(inputlines[inputline], 0, CON_MAXPROMPTCHARS);
|
||||
input_cur = input_sel = input_len = 0;
|
||||
|
||||
Unlock_state();
|
||||
}
|
||||
|
||||
static void CON_InputSetString(const char *c)
|
||||
{
|
||||
Lock_state();
|
||||
|
||||
memset(inputlines[inputline], 0, CON_MAXPROMPTCHARS);
|
||||
strcpy(inputlines[inputline], c);
|
||||
input_cur = input_sel = input_len = strlen(c);
|
||||
|
||||
Unlock_state();
|
||||
}
|
||||
|
||||
static void CON_InputAddString(const char *c)
|
||||
{
|
||||
size_t csize = strlen(c);
|
||||
|
||||
Lock_state();
|
||||
|
||||
if (input_len + csize > CON_MAXPROMPTCHARS-1)
|
||||
{
|
||||
Unlock_state();
|
||||
return;
|
||||
}
|
||||
if (input_cur != input_len)
|
||||
memmove(&inputlines[inputline][input_cur+csize], &inputlines[inputline][input_cur], input_len-input_cur);
|
||||
memcpy(&inputlines[inputline][input_cur], c, csize);
|
||||
input_len += csize;
|
||||
input_sel = (input_cur += csize);
|
||||
|
||||
Unlock_state();
|
||||
}
|
||||
|
||||
static void CON_InputDelSelection(void)
|
||||
{
|
||||
size_t start, end, len;
|
||||
|
||||
Lock_state();
|
||||
|
||||
if (input_cur > input_sel)
|
||||
{
|
||||
start = input_sel;
|
||||
end = input_cur;
|
||||
}
|
||||
else
|
||||
{
|
||||
start = input_cur;
|
||||
end = input_sel;
|
||||
}
|
||||
len = (end - start);
|
||||
|
||||
if (end != input_len)
|
||||
memmove(&inputlines[inputline][start], &inputlines[inputline][end], input_len-end);
|
||||
memset(&inputlines[inputline][input_len - len], 0, len);
|
||||
|
||||
input_len -= len;
|
||||
input_sel = input_cur = start;
|
||||
|
||||
Unlock_state();
|
||||
}
|
||||
|
||||
static void CON_InputAddChar(char c)
|
||||
{
|
||||
if (input_len >= CON_MAXPROMPTCHARS-1)
|
||||
return;
|
||||
|
||||
Lock_state();
|
||||
|
||||
if (input_cur != input_len)
|
||||
memmove(&inputlines[inputline][input_cur+1], &inputlines[inputline][input_cur], input_len-input_cur);
|
||||
inputlines[inputline][input_cur++] = c;
|
||||
inputlines[inputline][++input_len] = 0;
|
||||
input_sel = input_cur;
|
||||
|
||||
Unlock_state();
|
||||
}
|
||||
|
||||
static void CON_InputDelChar(void)
|
||||
{
|
||||
if (!input_cur)
|
||||
return;
|
||||
|
||||
Lock_state();
|
||||
|
||||
if (input_cur != input_len)
|
||||
memmove(&inputlines[inputline][input_cur-1], &inputlines[inputline][input_cur], input_len-input_cur);
|
||||
inputlines[inputline][--input_len] = 0;
|
||||
input_sel = --input_cur;
|
||||
|
||||
Unlock_state();
|
||||
}
|
||||
|
||||
//
|
||||
// ----
|
||||
//
|
||||
@@ -930,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;
|
||||
}
|
||||
@@ -948,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;
|
||||
}
|
||||
|
||||
@@ -956,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;
|
||||
@@ -985,6 +881,10 @@ boolean CON_Responder(event_t *ev)
|
||||
}
|
||||
}
|
||||
|
||||
Lock_state();
|
||||
M_TextInputHandle(&input, key);
|
||||
Unlock_state();
|
||||
|
||||
// Always eat ctrl/shift/alt if console open, so the menu doesn't get ideas
|
||||
if (key == KEY_LSHIFT || key == KEY_RSHIFT
|
||||
|| key == KEY_LCTRL || key == KEY_RCTRL
|
||||
@@ -997,12 +897,11 @@ boolean CON_Responder(event_t *ev)
|
||||
// show all cvars/commands that match what we have inputted
|
||||
if (key == KEY_TAB)
|
||||
{
|
||||
|
||||
if (!completion[0])
|
||||
{
|
||||
if (!input_len || input_len >= 40 || strchr(inputlines[inputline], ' '))
|
||||
if (!input.length || input.length >= 40 || strchr(input.buffer, ' '))
|
||||
return true;
|
||||
strcpy(completion, inputlines[inputline]);
|
||||
strcpy(completion, input.buffer);
|
||||
comskips = varskips = 0;
|
||||
}
|
||||
|
||||
@@ -1023,42 +922,9 @@ boolean CON_Responder(event_t *ev)
|
||||
return true;
|
||||
}
|
||||
|
||||
if (key == 'x' || key == 'X')
|
||||
{
|
||||
if (input_sel > input_cur)
|
||||
I_ClipboardCopy(&inputlines[inputline][input_cur], input_sel-input_cur);
|
||||
else
|
||||
I_ClipboardCopy(&inputlines[inputline][input_sel], input_cur-input_sel);
|
||||
CON_InputDelSelection();
|
||||
// Those are already handled in M_TextInputHandle, but they do extra logic... Maybe textinput_t should have some sort of callbacks?
|
||||
if (key == 'x' || key == 'X' || key == 'v' || key == 'V')
|
||||
completion[0] = 0;
|
||||
return true;
|
||||
}
|
||||
else if (key == 'c' || key == 'C')
|
||||
{
|
||||
if (input_sel > input_cur)
|
||||
I_ClipboardCopy(&inputlines[inputline][input_cur], input_sel-input_cur);
|
||||
else
|
||||
I_ClipboardCopy(&inputlines[inputline][input_sel], input_cur-input_sel);
|
||||
return true;
|
||||
}
|
||||
else if (key == 'v' || key == 'V')
|
||||
{
|
||||
const char *paste = I_ClipboardPaste();
|
||||
if (input_sel != input_cur)
|
||||
CON_InputDelSelection();
|
||||
if (paste != NULL)
|
||||
CON_InputAddString(paste);
|
||||
completion[0] = 0;
|
||||
return true;
|
||||
}
|
||||
|
||||
// Select all
|
||||
if (key == 'a' || key == 'A')
|
||||
{
|
||||
input_sel = 0;
|
||||
input_cur = input_len;
|
||||
return true;
|
||||
}
|
||||
|
||||
// ...why shouldn't it eat the key? if it doesn't, it just means you
|
||||
// can control Sonic from the console, which is silly
|
||||
@@ -1073,9 +939,9 @@ boolean CON_Responder(event_t *ev)
|
||||
// remember typing for several completions (a-la-4dos)
|
||||
if (!completion[0])
|
||||
{
|
||||
if (!input_len || input_len >= 40 || strchr(inputlines[inputline], ' '))
|
||||
if (!input.length || input.length >= 40 || strchr(input.buffer, ' '))
|
||||
return true;
|
||||
strcpy(completion, inputlines[inputline]);
|
||||
strcpy(completion, input.buffer);
|
||||
comskips = varskips = 0;
|
||||
}
|
||||
else
|
||||
@@ -1106,7 +972,11 @@ boolean CON_Responder(event_t *ev)
|
||||
cmd = CV_CompleteVar(completion, varskips);
|
||||
|
||||
if (cmd)
|
||||
CON_InputSetString(va("%s ", cmd));
|
||||
{
|
||||
Lock_state();
|
||||
M_TextInputSetString(&input, va("%s ", cmd));
|
||||
Unlock_state();
|
||||
}
|
||||
else
|
||||
{
|
||||
if (comskips > 0)
|
||||
@@ -1132,37 +1002,6 @@ boolean CON_Responder(event_t *ev)
|
||||
return true;
|
||||
}
|
||||
|
||||
if (key == KEY_LEFTARROW)
|
||||
{
|
||||
if (input_cur != 0)
|
||||
--input_cur;
|
||||
if (!shiftdown)
|
||||
input_sel = input_cur;
|
||||
return true;
|
||||
}
|
||||
else if (key == KEY_RIGHTARROW)
|
||||
{
|
||||
if (input_cur < input_len)
|
||||
++input_cur;
|
||||
if (!shiftdown)
|
||||
input_sel = input_cur;
|
||||
return true;
|
||||
}
|
||||
else if (key == KEY_HOME)
|
||||
{
|
||||
input_cur = 0;
|
||||
if (!shiftdown)
|
||||
input_sel = input_cur;
|
||||
return true;
|
||||
}
|
||||
else if (key == KEY_END)
|
||||
{
|
||||
input_cur = input_len;
|
||||
if (!shiftdown)
|
||||
input_sel = input_cur;
|
||||
return true;
|
||||
}
|
||||
|
||||
// At this point we're messing with input
|
||||
// Clear completion
|
||||
completion[0] = 0;
|
||||
@@ -1170,45 +1009,29 @@ boolean CON_Responder(event_t *ev)
|
||||
// command enter
|
||||
if (key == KEY_ENTER)
|
||||
{
|
||||
if (!input_len)
|
||||
if (!input.length)
|
||||
return true;
|
||||
|
||||
// push the command
|
||||
COM_BufAddText(inputlines[inputline]);
|
||||
COM_BufAddText(input.buffer);
|
||||
COM_BufAddText("\n");
|
||||
|
||||
CONS_Printf("\x86""%c""\x80""%s\n", CON_PROMPTCHAR, inputlines[inputline]);
|
||||
|
||||
Lock_state();
|
||||
|
||||
// Only add command to history if it differs from previous one
|
||||
if (strcmp(inputlines[inputline], inputlines[(inputline-1) & 31]))
|
||||
if (strcmp(input.buffer, inputlines[(inputline-1) & 31]))
|
||||
{
|
||||
inputline = (inputline+1) & 31;
|
||||
M_TextInputInit(&input, inputlines[inputline], CON_MAXPROMPTCHARS);
|
||||
}
|
||||
|
||||
inputhist = inputline;
|
||||
CON_InputClear();
|
||||
M_TextInputClear(&input);
|
||||
|
||||
return true;
|
||||
}
|
||||
Unlock_state();
|
||||
|
||||
// backspace and delete command prompt
|
||||
if (input_sel != input_cur)
|
||||
{
|
||||
if (key == KEY_BACKSPACE || key == KEY_DEL)
|
||||
{
|
||||
CON_InputDelSelection();
|
||||
return true;
|
||||
}
|
||||
}
|
||||
else if (key == KEY_BACKSPACE)
|
||||
{
|
||||
CON_InputDelChar();
|
||||
return true;
|
||||
}
|
||||
else if (key == KEY_DEL)
|
||||
{
|
||||
if (input_cur == input_len)
|
||||
return true;
|
||||
++input_cur;
|
||||
CON_InputDelChar();
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -1225,7 +1048,9 @@ boolean CON_Responder(event_t *ev)
|
||||
if (inputhist == inputline)
|
||||
inputhist = (inputline + 1) & 31;
|
||||
|
||||
CON_InputSetString(inputlines[inputhist]);
|
||||
Lock_state();
|
||||
M_TextInputSetString(&input, inputlines[inputhist]);
|
||||
Unlock_state();
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -1239,41 +1064,16 @@ boolean CON_Responder(event_t *ev)
|
||||
while (inputhist != inputline && !inputlines[inputhist][0]);
|
||||
|
||||
// back to currentline
|
||||
Lock_state();
|
||||
if (inputhist == inputline)
|
||||
CON_InputClear();
|
||||
M_TextInputClear(&input);
|
||||
else
|
||||
CON_InputSetString(inputlines[inputhist]);
|
||||
M_TextInputSetString(&input, inputlines[inputhist]);
|
||||
Unlock_state();
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
// allow people to use keypad in console (good for typing IP addresses) - Calum
|
||||
if (key >= KEY_KEYPAD7 && key <= KEY_KPADDEL)
|
||||
{
|
||||
char keypad_translation[] = {'7','8','9','-',
|
||||
'4','5','6','+',
|
||||
'1','2','3',
|
||||
'0','.'};
|
||||
|
||||
key = keypad_translation[key - KEY_KEYPAD7];
|
||||
}
|
||||
else if (key == KEY_KPADSLASH)
|
||||
key = '/';
|
||||
|
||||
// same capslock code as hu_stuff.c's HU_responder. Check there for details.
|
||||
key = CON_ShiftChar(key);
|
||||
|
||||
// enter a char into the command prompt
|
||||
if (key < 32 || key > 127)
|
||||
return true;
|
||||
|
||||
// add key to cmd line here
|
||||
if (key >= 'A' && key <= 'Z' && !(shiftdown ^ capslock)) //this is only really necessary for dedicated servers
|
||||
key = key + 'a' - 'A';
|
||||
|
||||
if (input_sel != input_cur)
|
||||
CON_InputDelSelection();
|
||||
CON_InputAddChar(key);
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -1435,7 +1235,7 @@ void CONS_Printf(const char *fmt, ...)
|
||||
txt = malloc(8192);
|
||||
|
||||
va_start(argptr, fmt);
|
||||
vsprintf(txt, fmt, argptr);
|
||||
vsnprintf(txt, 8192, fmt, argptr);
|
||||
va_end(argptr);
|
||||
|
||||
// echo console prints to log file
|
||||
@@ -1443,7 +1243,7 @@ void CONS_Printf(const char *fmt, ...)
|
||||
|
||||
if (con_started)
|
||||
CON_Print(txt);
|
||||
|
||||
|
||||
CON_LogMessage(txt);
|
||||
|
||||
Lock_state();
|
||||
@@ -1533,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();
|
||||
}
|
||||
}
|
||||
|
||||
//======================================================================
|
||||
@@ -1555,16 +1360,16 @@ static void CON_DrawInput(void)
|
||||
|
||||
clen = con_width-13;
|
||||
|
||||
if (input_len <= clen)
|
||||
if (input.length <= clen)
|
||||
{
|
||||
c = 0;
|
||||
clen = input_len;
|
||||
clen = input.length;
|
||||
}
|
||||
else // input line scrolls left if it gets too long
|
||||
{
|
||||
clen -= 2; // There will always be some extra truncation -- but where is what we'll find out
|
||||
|
||||
if (input_cur <= clen/2)
|
||||
if (input.cursor <= clen/2)
|
||||
{
|
||||
// Close enough to right edge to show all
|
||||
c = 0;
|
||||
@@ -1575,15 +1380,15 @@ static void CON_DrawInput(void)
|
||||
{
|
||||
// Cursor in the middle (or right side) of input
|
||||
// Move over for the ellipsis
|
||||
c = input_cur - (clen/2) + 2;
|
||||
c = input.cursor - (clen/2) + 2;
|
||||
x += charwidth*2;
|
||||
lellip = 1;
|
||||
|
||||
if (c + clen >= input_len)
|
||||
if (c + clen >= input.length)
|
||||
{
|
||||
// Cursor in the right side of input
|
||||
// We were too far over, so move back
|
||||
c = input_len - clen;
|
||||
c = input.length - clen;
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -1597,7 +1402,7 @@ static void CON_DrawInput(void)
|
||||
if (lellip)
|
||||
{
|
||||
x -= charwidth*3;
|
||||
if (input_sel < c)
|
||||
if (input.select < c)
|
||||
V_DrawFill(x, y, charwidth*3, (10 * con_scalefactor), 107 | V_NOSCALESTART);
|
||||
for (i = 0; i < 3; ++i, x += charwidth)
|
||||
V_DrawCharacter(x, y, '.' | cv_constextsize.value | V_GRAYMAP | V_NOSCALESTART, !cv_allcaps.value);
|
||||
@@ -1607,7 +1412,7 @@ static void CON_DrawInput(void)
|
||||
|
||||
for (cend = c + clen; c < cend; ++c, x += charwidth)
|
||||
{
|
||||
if ((input_sel > c && input_cur <= c) || (input_sel <= c && input_cur > c))
|
||||
if ((input.select > c && input.cursor <= c) || (input.select <= c && input.cursor > c))
|
||||
{
|
||||
V_DrawFill(x, y, charwidth, (10 * con_scalefactor), 107 | V_NOSCALESTART);
|
||||
V_DrawCharacter(x, y, p[c] | cv_constextsize.value | V_YELLOWMAP | V_NOSCALESTART, !cv_allcaps.value);
|
||||
@@ -1615,14 +1420,14 @@ static void CON_DrawInput(void)
|
||||
else
|
||||
V_DrawCharacter(x, y, p[c] | cv_constextsize.value | V_NOSCALESTART, !cv_allcaps.value);
|
||||
|
||||
if (c == input_cur && con_tick >= 4)
|
||||
if (c == input.cursor && con_tick >= 4)
|
||||
V_DrawCharacter(x, y + (con_scalefactor*2), '_' | cv_constextsize.value | V_NOSCALESTART, !cv_allcaps.value);
|
||||
}
|
||||
if (cend == input_cur && con_tick >= 4)
|
||||
if (cend == input.cursor && con_tick >= 4)
|
||||
V_DrawCharacter(x, y + (con_scalefactor*2), '_' | cv_constextsize.value | V_NOSCALESTART, !cv_allcaps.value);
|
||||
if (rellip)
|
||||
{
|
||||
if (input_sel > cend)
|
||||
if (input.select > cend)
|
||||
V_DrawFill(x, y, charwidth*3, (10 * con_scalefactor), 107 | V_NOSCALESTART);
|
||||
for (i = 0; i < 3; ++i, x += charwidth)
|
||||
V_DrawCharacter(x, y, '.' | cv_constextsize.value | V_GRAYMAP | V_NOSCALESTART, !cv_allcaps.value);
|
||||
@@ -1665,12 +1470,15 @@ static void CON_DrawHudlines(void)
|
||||
{
|
||||
charflags = (*p & 0x7f) << V_CHARCOLORSHIFT;
|
||||
p++;
|
||||
c++;
|
||||
}
|
||||
if (c >= con_width)
|
||||
break;
|
||||
if (*p < HU_FONTSTART)
|
||||
;//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);
|
||||
}
|
||||
}
|
||||
@@ -1705,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);
|
||||
@@ -1745,7 +1553,10 @@ static void CON_DrawConsole(void)
|
||||
{
|
||||
charflags = (*p & 0x7f) << V_CHARCOLORSHIFT;
|
||||
p++;
|
||||
c++;
|
||||
}
|
||||
if (c >= con_width)
|
||||
break;
|
||||
V_DrawCharacter(x, y, (INT32)(*p) | charflags | cv_constextsize.value | V_NOSCALESTART, !cv_allcaps.value);
|
||||
}
|
||||
}
|
||||
@@ -1770,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();
|
||||
|
||||
+1059
-644
File diff suppressed because it is too large.
Load diff
+49
-8
@@ -41,6 +41,15 @@ applications may follow different packet versions.
|
||||
#define BACKUPTICS 32
|
||||
#define TICQUEUE 512 // more than enough for most timeouts....
|
||||
#define MAXTEXTCMD 256
|
||||
|
||||
// No. of tics your controls can be delayed by.
|
||||
|
||||
// TODO: Instead of storing a ton of extra cmds for gentlemens' delay,
|
||||
// keep them in a linked-list, with timestamps to discard everything that's older than already sent.
|
||||
// That will support any amount of lag, and be less wasteful for clients who don't use it.
|
||||
// This just works as a quick implementation.
|
||||
#define MAXGENTLEMENDELAY TICRATE
|
||||
|
||||
//
|
||||
// Packet structure
|
||||
//
|
||||
@@ -98,6 +107,15 @@ typedef enum
|
||||
PT_MOREFILESNEEDED, // Server, to client: "you need these (+ more on top of those)"
|
||||
|
||||
PT_PING, // Packet sent to tell clients the other client's latency to server.
|
||||
|
||||
#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!
|
||||
|
||||
PT_ISSATURN, // Saturn specific identifier packet
|
||||
#endif
|
||||
|
||||
NUMPACKETTYPE
|
||||
} packettype_t;
|
||||
|
||||
@@ -363,6 +381,9 @@ typedef struct
|
||||
UINT8 subversion; // Contains build version
|
||||
UINT8 localplayers; // number of splitscreen players
|
||||
UINT8 mode;
|
||||
#ifdef SATURNJOIN
|
||||
UINT8 issaturn;
|
||||
#endif
|
||||
} ATTRPACK clientconfig_pak;
|
||||
|
||||
#define SV_SPEEDMASK 0x03 // used to send kartspeed
|
||||
@@ -372,6 +393,7 @@ typedef struct
|
||||
#define MAXSERVERNAME 32
|
||||
#define MAXFILENEEDED 915
|
||||
#define MAX_MIRROR_LENGTH 256
|
||||
|
||||
// This packet is too large
|
||||
typedef struct
|
||||
{
|
||||
@@ -563,26 +585,38 @@ extern UINT32 realpingtable[MAXPLAYERS];
|
||||
extern UINT32 playerpingtable[MAXPLAYERS];
|
||||
extern tic_t servermaxping;
|
||||
|
||||
extern boolean server_lagless;
|
||||
extern tic_t simulated_lag;
|
||||
extern tic_t lowest_lag;
|
||||
extern consvar_t cv_mindelay, cv_gentlemens;
|
||||
|
||||
extern consvar_t
|
||||
#ifdef VANILLAJOINNEXTROUND
|
||||
cv_joinnextround,
|
||||
#endif
|
||||
cv_netticbuffer, cv_allownewplayer, cv_joinrefusemessage, cv_maxplayers, cv_resynchattempts, cv_blamecfail, cv_maxsend, cv_noticedownload, cv_downloadspeed;
|
||||
cv_netticbuffer, cv_allownewplayer,
|
||||
#ifdef SATURNJOIN
|
||||
cv_allownewsaturnplayer,
|
||||
#endif
|
||||
cv_joinrefusemessage, cv_maxplayers, cv_resynchattempts,
|
||||
#ifdef SATURNPAK
|
||||
cv_resynchcooldown, cv_gamestateattempts,
|
||||
#endif
|
||||
cv_blamecfail, cv_maxsend, cv_noticedownload, cv_downloadspeed;
|
||||
|
||||
extern consvar_t cv_connectawaittime;
|
||||
|
||||
extern consvar_t cv_discordinvites;
|
||||
|
||||
// Used in d_net, the only dependence
|
||||
tic_t ExpandTics(INT32 low, tic_t basetic);
|
||||
//tic_t ExpandTics(INT32 low, tic_t basetic);
|
||||
void D_ClientServerInit(void);
|
||||
|
||||
// Initialise the other field
|
||||
void RegisterNetXCmd(netxcmd_t id, void (*cmd_f)(UINT8 **p, INT32 playernum));
|
||||
void SendNetXCmd(netxcmd_t id, const void *param, size_t nparam);
|
||||
void SendNetXCmd2(netxcmd_t id, const void *param, size_t nparam); // splitsreen player
|
||||
void SendNetXCmd3(netxcmd_t id, const void *param, size_t nparam); // splitsreen3 player
|
||||
void SendNetXCmd4(netxcmd_t id, const void *param, size_t nparam); // splitsreen4 player
|
||||
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);
|
||||
@@ -601,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);
|
||||
|
||||
@@ -626,13 +663,17 @@ extern char motd[254], server_context[8];
|
||||
extern UINT8 playernode[MAXPLAYERS];
|
||||
|
||||
INT32 D_NumPlayers(void);
|
||||
|
||||
void D_ResetTiccmds(void);
|
||||
|
||||
tic_t GetLag(INT32 node);
|
||||
UINT8 GetFreeXCmdSize(void);
|
||||
//UINT8 GetFreeXCmdSize(UINT8 playerid);
|
||||
|
||||
extern UINT8 hu_resynching;
|
||||
extern UINT8 hu_stopped; // kart, true when the game is stopped for players due to a disconnecting or connecting player
|
||||
#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
|
||||
|
||||
typedef struct rewind_s {
|
||||
UINT8 savebuffer[(768*1024)];
|
||||
|
||||
@@ -25,7 +25,6 @@ typedef enum
|
||||
ev_console,
|
||||
ev_mouse,
|
||||
ev_joystick,
|
||||
ev_mouse2,
|
||||
ev_joystick2,
|
||||
ev_joystick3,
|
||||
ev_joystick4,
|
||||
|
||||
+490
-266
File diff suppressed because it is too large.
Load diff
+30
-14
@@ -17,38 +17,54 @@
|
||||
#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
|
||||
extern boolean usehome; //Alam: which path?
|
||||
extern const char *pandf; //Alam: how to path?
|
||||
extern char srb2path[256]; //Alam: SRB2's Home
|
||||
|
||||
// extra graphic patches for saturn specific thingies
|
||||
extern boolean found_extra_kart; // for use in k_kart.c
|
||||
extern boolean found_extra2_kart; // for use in k_kart.c
|
||||
extern boolean found_extra3_kart; // for use in k_kart.c
|
||||
|
||||
extern boolean xtra_speedo; // extra speedometer check
|
||||
extern boolean xtra_speedo_clr; // extra speedometer colour check
|
||||
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 clr_hud; // colour hud check
|
||||
extern boolean big_lap; // bigger lap counter
|
||||
extern boolean big_lap_color; // bigger lap counter but colour
|
||||
extern boolean kartzspeedo; // kartZ speedo
|
||||
extern boolean statdp; // stat display for extended player setup
|
||||
extern boolean nametaggfx; // Nametag stuffs
|
||||
extern boolean driftgaugegfx;
|
||||
extern boolean xtra_speedo; // extra speedometer check
|
||||
extern boolean xtra_speedo_clr; // extra speedometer colour check
|
||||
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 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
|
||||
extern boolean autoloading;
|
||||
extern boolean autoloaded;
|
||||
extern boolean postautoloaded;
|
||||
|
||||
void D_AddPostloadFiles(void);
|
||||
|
||||
extern char *autoloadwadfilespost[MAX_WADFILES];
|
||||
extern char *autoloadwadfiles[MAX_WADFILES];
|
||||
|
||||
// the infinite loop of D_SRB2Loop() called from win_main for windows version
|
||||
void D_SRB2Loop(void) FUNCNORETURN;
|
||||
|
||||
+81
-105
@@ -64,16 +64,11 @@ static doomdata_t reboundstore[MAXREBOUND];
|
||||
static INT16 reboundsize[MAXREBOUND];
|
||||
static INT32 rebound_head, rebound_tail;
|
||||
|
||||
/// \brief bandwith of netgame
|
||||
INT32 net_bandwidth;
|
||||
|
||||
/// \brief max length per packet
|
||||
INT16 hardware_MAXPACKETLENGTH;
|
||||
|
||||
boolean (*I_NetGet)(void) = NULL;
|
||||
void (*I_NetSend)(void) = NULL;
|
||||
boolean (*I_NetCanSend)(void) = NULL;
|
||||
boolean (*I_NetCanGet)(void) = NULL;
|
||||
void (*I_NetCloseSocket)(void) = NULL;
|
||||
void (*I_NetFreeNodenum)(INT32 nodenum) = NULL;
|
||||
SINT8 (*I_NetMakeNodewPort)(const char *address, const char* port) = NULL;
|
||||
@@ -114,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
|
||||
@@ -225,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;
|
||||
@@ -237,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
|
||||
@@ -254,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;
|
||||
@@ -273,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)
|
||||
{
|
||||
@@ -325,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);
|
||||
}
|
||||
@@ -340,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
|
||||
@@ -354,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));
|
||||
@@ -364,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));
|
||||
@@ -371,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;
|
||||
|
||||
@@ -388,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)
|
||||
{
|
||||
@@ -403,6 +376,7 @@ static boolean Processackpak(void)
|
||||
nextfirstack = 1;
|
||||
change = true;
|
||||
}
|
||||
|
||||
if (i == node->acktosend_tail)
|
||||
{
|
||||
node->acktosend[node->acktosend_tail] = 0;
|
||||
@@ -424,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;
|
||||
@@ -460,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])
|
||||
@@ -476,6 +454,9 @@ static void GotAcks(void)
|
||||
ackpak[i].senttime--; // hurry up
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
@@ -510,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))
|
||||
@@ -562,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;
|
||||
@@ -587,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;
|
||||
@@ -605,8 +590,10 @@ static boolean Net_AllAcksReceived(void)
|
||||
INT32 i;
|
||||
|
||||
for (i = 0; i < MAXACKPACKETS; i++)
|
||||
{
|
||||
if (ackpak[i].acknum)
|
||||
return false;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
@@ -626,6 +613,7 @@ void Net_WaitAllAckReceived(UINT32 timeout)
|
||||
timeout = tictac + timeout*NEWTICRATE;
|
||||
|
||||
HGetPacket();
|
||||
|
||||
while (timeout > I_GetTime() && !Net_AllAcksReceived())
|
||||
{
|
||||
while (tictac == I_GetTime())
|
||||
@@ -633,6 +621,7 @@ void Net_WaitAllAckReceived(UINT32 timeout)
|
||||
I_Sleep(cv_sleep.value);
|
||||
I_UpdateTime(cv_timescale.value);
|
||||
}
|
||||
|
||||
tictac = I_GetTime();
|
||||
HGetPacket();
|
||||
Net_AckTicker();
|
||||
@@ -643,6 +632,7 @@ void Net_WaitAllAckReceived(UINT32 timeout)
|
||||
static void InitNode(node_t *node)
|
||||
{
|
||||
node->acktosend_head = node->acktosend_tail = 0;
|
||||
memset(node->acktosend, 0, sizeof(node->acktosend));
|
||||
node->firstacktosend = 0;
|
||||
node->nextacknum = 1;
|
||||
node->remotefirstack = 0;
|
||||
@@ -672,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
|
||||
}
|
||||
|
||||
@@ -723,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)
|
||||
@@ -730,6 +722,7 @@ void Net_CloseConnection(INT32 node)
|
||||
else
|
||||
ackpak[i].acknum = 0;
|
||||
}
|
||||
}
|
||||
|
||||
InitNode(&nodes[node]);
|
||||
SV_AbortSendFiles(node);
|
||||
@@ -746,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);
|
||||
@@ -763,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)
|
||||
@@ -782,6 +775,8 @@ static void fprintfstring(char *s, size_t len)
|
||||
}
|
||||
fprintf(debugfile, "%c", s[i]);
|
||||
}
|
||||
}
|
||||
|
||||
if (mode)
|
||||
fprintf(debugfile, "]");
|
||||
}
|
||||
@@ -793,7 +788,7 @@ static void fprintfstringnewline(char *s, size_t len)
|
||||
}
|
||||
|
||||
/// \warning Keep this up-to-date if you add/remove/rename packet types
|
||||
static const char *packettypename[NUMPACKETTYPE] =
|
||||
const char *packettypename[NUMPACKETTYPE] =
|
||||
{
|
||||
"NOTHING",
|
||||
"SERVERCFG",
|
||||
@@ -836,13 +831,30 @@ static const char *packettypename[NUMPACKETTYPE] =
|
||||
"MOREFILESNEEDED",
|
||||
|
||||
"PING"
|
||||
#ifdef SATURNPAK
|
||||
,
|
||||
|
||||
"WILLRESENDGAMESTATE",
|
||||
"CANRECEIVEGAMESTATE",
|
||||
"RECEIVEDGAMESTATE",
|
||||
|
||||
"ISSATURN" // special packet to identify saturn clients
|
||||
#endif
|
||||
};
|
||||
|
||||
const char *Net_GetPacketName(UINT8 packettype)
|
||||
{
|
||||
if (packettype >= NUMPACKETTYPE)
|
||||
return "UNKNOWN";
|
||||
|
||||
return packettypename[packettype];
|
||||
}
|
||||
|
||||
static void DebugPrintpacket(const char *header)
|
||||
{
|
||||
fprintf(debugfile, "%-12s (node %d,ack %d,ackret %d,size %d) type(%d) : %s\n",
|
||||
header, doomcom->remotenode, netbuffer->ack, netbuffer->ackreturn, doomcom->datalength,
|
||||
netbuffer->packettype, packettypename[netbuffer->packettype]);
|
||||
netbuffer->packettype, Net_GetPacketName(netbuffer->packettype));
|
||||
|
||||
switch (netbuffer->packettype)
|
||||
{
|
||||
@@ -1021,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)
|
||||
@@ -1056,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");
|
||||
@@ -1070,17 +1084,10 @@ boolean HSendPacket(INT32 node, boolean reliable, UINT8 acknum, size_t packetlen
|
||||
netbuffer->ackreturn = GetAcktosend(node);
|
||||
else
|
||||
netbuffer->ackreturn = 0;
|
||||
|
||||
if (reliable)
|
||||
{
|
||||
if (I_NetCanSend && !I_NetCanSend())
|
||||
{
|
||||
if (netbuffer->packettype < PT_CANFAIL)
|
||||
GetFreeAcknum(&netbuffer->ack, true);
|
||||
|
||||
DEBFILE("HSendPacket: Out of bandwidth\n");
|
||||
return false;
|
||||
}
|
||||
else if (!GetFreeAcknum(&netbuffer->ack, false))
|
||||
if (!GetFreeAcknum(&netbuffer->ack))
|
||||
return false;
|
||||
}
|
||||
else
|
||||
@@ -1152,7 +1159,6 @@ boolean HGetPacket(void)
|
||||
|
||||
while(true)
|
||||
{
|
||||
//nodejustjoined = I_NetGet();
|
||||
I_NetGet();
|
||||
|
||||
if (doomcom->remotenode == -1) // No packet received
|
||||
@@ -1181,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)
|
||||
@@ -1208,7 +1199,7 @@ boolean HGetPacket(void)
|
||||
}
|
||||
break;
|
||||
}
|
||||
#endif // ndef NONET
|
||||
#endif // ifndef NONET
|
||||
|
||||
return true;
|
||||
}
|
||||
@@ -1232,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);
|
||||
@@ -1280,13 +1272,12 @@ boolean D_CheckNetGame(void)
|
||||
|
||||
I_NetGet = Internal_Get;
|
||||
I_NetSend = Internal_Send;
|
||||
I_NetCanSend = NULL;
|
||||
I_NetCloseSocket = NULL;
|
||||
I_NetFreeNodenum = Internal_FreeNodenum;
|
||||
I_NetMakeNodewPort = NULL;
|
||||
|
||||
hardware_MAXPACKETLENGTH = MAXPACKETLENGTH;
|
||||
net_bandwidth = 30000;
|
||||
|
||||
// I_InitNetwork sets doomcom and netgame
|
||||
// check and initialize the network driver
|
||||
multiplayer = false;
|
||||
@@ -1317,21 +1308,6 @@ boolean D_CheckNetGame(void)
|
||||
CONS_Printf(M_GetText("Set extratics to %d\n"), doomcom->extratics);
|
||||
}
|
||||
|
||||
if (M_CheckParm("-bandwidth"))
|
||||
{
|
||||
if (M_IsNextParm())
|
||||
{
|
||||
net_bandwidth = atoi(M_GetNextParm());
|
||||
if (net_bandwidth < 1000)
|
||||
net_bandwidth = 1000;
|
||||
if (net_bandwidth > 100000)
|
||||
hardware_MAXPACKETLENGTH = MAXPACKETLENGTH;
|
||||
CONS_Printf(M_GetText("Network bandwidth set to %d\n"), net_bandwidth);
|
||||
}
|
||||
else
|
||||
I_Error("usage: -bandwidth <byte_per_sec>");
|
||||
}
|
||||
|
||||
software_MAXPACKETLENGTH = hardware_MAXPACKETLENGTH;
|
||||
if (M_CheckParm("-packetsize"))
|
||||
{
|
||||
@@ -1357,9 +1333,9 @@ boolean D_CheckNetGame(void)
|
||||
I_Error("Too many nodes (%d), max:%d", doomcom->numnodes, MAXNETNODES);
|
||||
|
||||
netbuffer = (doomdata_t *)(void *)&doomcom->data;
|
||||
#ifdef HOLEPUNCH
|
||||
#ifdef HOLEPUNCH
|
||||
holepunchpacket = (holepunch_t *)(void *)&doomcom->data;
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#ifdef DEBUGFILE
|
||||
if (M_CheckParm("-debugfile"))
|
||||
@@ -1421,6 +1397,7 @@ void Command_Ping_f(void)
|
||||
INT32 i;
|
||||
|
||||
pingc = 0;
|
||||
|
||||
for (i = 1; i < MAXPLAYERS; ++i)
|
||||
{
|
||||
if (playeringame[i])
|
||||
@@ -1453,13 +1430,13 @@ void Command_Ping_f(void)
|
||||
}
|
||||
}
|
||||
|
||||
if (f_width < 10) f_width = 1;
|
||||
if (f_width < 10) f_width = 1;
|
||||
else if (f_width < 100) f_width = 2;
|
||||
else f_width = 3;
|
||||
else f_width = 3;
|
||||
|
||||
if (ms_width < 10) ms_width = 1;
|
||||
if (ms_width < 10) ms_width = 1;
|
||||
else if (ms_width < 100) ms_width = 2;
|
||||
else ms_width = 3;
|
||||
else ms_width = 3;
|
||||
|
||||
qsort(pingv, pingc, sizeof (struct pingcell), &pingcellcmp);
|
||||
|
||||
@@ -1498,7 +1475,6 @@ void D_CloseConnection(void)
|
||||
|
||||
I_NetGet = Internal_Get;
|
||||
I_NetSend = Internal_Send;
|
||||
I_NetCanSend = NULL;
|
||||
I_NetCloseSocket = NULL;
|
||||
I_NetFreeNodenum = Internal_FreeNodenum;
|
||||
I_NetMakeNodewPort = NULL;
|
||||
|
||||
+2
-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
|
||||
@@ -65,5 +63,6 @@ void Net_ConnectionTimeout(INT32 node);
|
||||
void Net_AbortPacketType(UINT8 packettype);
|
||||
void Net_SendAcks(INT32 node);
|
||||
void Net_WaitAllAckReceived(UINT32 timeout);
|
||||
const char *Net_GetPacketName(UINT8 packettype);
|
||||
|
||||
#endif
|
||||
+497
-607
File diff suppressed because it is too large.
Load diff
+10
-20
@@ -43,25 +43,12 @@ extern consvar_t cv_seenames, cv_allowseenames;
|
||||
extern consvar_t cv_usemouse;
|
||||
//WTF
|
||||
extern consvar_t cv_mouseturn;
|
||||
extern consvar_t cv_usejoystick;
|
||||
extern consvar_t cv_usejoystick2;
|
||||
extern consvar_t cv_usejoystick3;
|
||||
extern consvar_t cv_usejoystick4;
|
||||
extern consvar_t cv_usejoystick[4]; //MAXSPLITSCREENPLAYERS
|
||||
#ifdef LJOYSTICK
|
||||
extern consvar_t cv_joyport;
|
||||
extern consvar_t cv_joyport2;
|
||||
#endif
|
||||
extern consvar_t cv_joyscale;
|
||||
extern consvar_t cv_joyscale2;
|
||||
extern consvar_t cv_joyscale3;
|
||||
extern consvar_t cv_joyscale4;
|
||||
|
||||
// splitscreen with second mouse
|
||||
extern consvar_t cv_mouse2port;
|
||||
extern consvar_t cv_usemouse2;
|
||||
#if defined (__unix__) || defined (__APPLE__) || defined (UNIXCOMMON)
|
||||
extern consvar_t cv_mouse2opt;
|
||||
#endif
|
||||
extern consvar_t cv_joyscale[4]; //MAXSPLITSCREENPLAYERS
|
||||
|
||||
// normally in p_mobj but the .h is not read
|
||||
extern consvar_t cv_itemrespawntime;
|
||||
@@ -128,6 +115,7 @@ extern consvar_t cv_kartvoterulechanges;
|
||||
extern consvar_t cv_kartgametypepreference;
|
||||
extern consvar_t cv_kartspeedometer;
|
||||
extern consvar_t cv_kartvoices;
|
||||
extern consvar_t cv_karthitemdialog;
|
||||
|
||||
extern consvar_t cv_karteliminatelast;
|
||||
|
||||
@@ -161,10 +149,12 @@ 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;
|
||||
extern consvar_t cv_luaimmersion;
|
||||
extern consvar_t cv_fakelocalskin;
|
||||
extern consvar_t cv_showlocalskinmenus;
|
||||
@@ -183,9 +173,7 @@ extern consvar_t cv_nametagdist;
|
||||
extern consvar_t cv_showownnametag;
|
||||
extern consvar_t cv_smallnametags;
|
||||
extern consvar_t cv_nametagrestat;
|
||||
extern consvar_t cv_nametaghop;
|
||||
extern consvar_t cv_nametagscore;
|
||||
extern consvar_t cv_shownametagfinish;
|
||||
extern consvar_t cv_shownametagspectator;
|
||||
|
||||
#define SKINSELECTSPIN_PAIN 25
|
||||
@@ -201,12 +189,16 @@ extern consvar_t cv_ps_thinkframe_page;
|
||||
extern consvar_t cv_ps_samplesize;
|
||||
extern consvar_t cv_ps_descriptor;
|
||||
|
||||
extern consvar_t cv_director, cv_kartdebugdirector, cv_showdirectorhud;
|
||||
|
||||
extern consvar_t cv_showtrackaddon;
|
||||
|
||||
extern consvar_t cv_showspecstuff;
|
||||
|
||||
extern consvar_t cv_betainterscreen;
|
||||
|
||||
extern consvar_t cv_laglesscam;
|
||||
|
||||
typedef enum
|
||||
{
|
||||
SKINMENUTYPE_SCROLL = 0,
|
||||
@@ -304,8 +296,6 @@ typedef union {
|
||||
#pragma pack()
|
||||
#endif
|
||||
|
||||
extern tic_t driftsparkGrowTimer[16];
|
||||
|
||||
// add game commands, needs cleanup
|
||||
void D_RegisterServerCommands(void);
|
||||
void D_RegisterClientCommands(void);
|
||||
|
||||
+112
-62
@@ -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)
|
||||
int curlprogress_callbackx(void *clientp, curl_off_t dltotal, curl_off_t dlnow, curl_off_t ultotal, curl_off_t ulnow);
|
||||
#define XFERINFOFUNCTION
|
||||
#if (LIBCURL_VERSION_MAJOR <= 7) && (LIBCURL_VERSION_MINOR < 35)
|
||||
static int curlprogress_callback(void *clientp, double dltotal, double dlnow, double ultotal, double ulnow);
|
||||
#else
|
||||
int curlprogress_callback(void *clientp, double dltotal, double dlnow, double ultotal, double ulnow);
|
||||
static int curlprogress_callbackx(void *clientp, curl_off_t dltotal, curl_off_t dlnow, curl_off_t ultotal, curl_off_t ulnow);
|
||||
#define XFERINFOFUNCTION
|
||||
#endif
|
||||
#endif
|
||||
|
||||
@@ -111,26 +111,17 @@ static fileused_t transferFiles[UINT8_MAX + 1];
|
||||
// Receiver structure
|
||||
INT32 fileneedednum; // Number of files needed to join the server
|
||||
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;
|
||||
@@ -221,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
|
||||
@@ -232,8 +224,12 @@ void D_ParseFileneeded(INT32 fileneedednum_parm, UINT8 *fileneededstr, UINT16 fi
|
||||
|
||||
void CL_PrepareDownloadSaveGame(const char *tmpsave)
|
||||
{
|
||||
#ifdef CLIENT_LOADINGSCREEN
|
||||
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);
|
||||
@@ -548,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
|
||||
@@ -658,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)
|
||||
@@ -743,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;
|
||||
@@ -864,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;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -970,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;
|
||||
}
|
||||
@@ -991,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)
|
||||
@@ -1010,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)
|
||||
@@ -1041,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)
|
||||
{
|
||||
@@ -1049,7 +1046,7 @@ void Got_Filetxpak(void)
|
||||
}
|
||||
|
||||
#ifdef CLIENT_LOADINGSCREEN
|
||||
lastfilenum = filenum;
|
||||
filedownload.current = filenum;
|
||||
#endif
|
||||
}
|
||||
|
||||
@@ -1198,31 +1195,57 @@ 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
|
||||
int curlprogress_callbackx(void *clientp, curl_off_t dltotal, curl_off_t dlnow, curl_off_t ultotal, curl_off_t ulnow)
|
||||
static int curlprogress_callbackx(void *clientp, curl_off_t dltotal, curl_off_t dlnow, curl_off_t ultotal, curl_off_t ulnow)
|
||||
{
|
||||
time_t curtime;
|
||||
|
||||
(void)clientp;
|
||||
(void)ultotal;
|
||||
(void)ulnow; // Function prototype requires these but we won't use, so just discard
|
||||
curl_dlnow = dlnow;
|
||||
curl_dltotal = dltotal;
|
||||
getbytes = curl_dlnow / (time(NULL) - curl_starttime); // To-do: Make this more accurate???
|
||||
|
||||
curtime = time(NULL);
|
||||
|
||||
curl_dlnow = (UINT32)dlnow;
|
||||
curl_dltotal = (UINT32)dltotal;
|
||||
|
||||
if (curtime > curl_starttime)
|
||||
{
|
||||
getbytes = ((double)dlnow) / (curtime - curl_starttime); // To-do: Make this more accurate???
|
||||
}
|
||||
else
|
||||
{
|
||||
getbytes = 0;
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
#else
|
||||
int curlprogress_callback(void *clientp, double dltotal, double dlnow, double ultotal, double ulnow)
|
||||
static int curlprogress_callback(void *clientp, double dltotal, double dlnow, double ultotal, double ulnow)
|
||||
{
|
||||
time_t curtime;
|
||||
|
||||
(void)clientp;
|
||||
(void)ultotal;
|
||||
(void)ulnow; // Function prototype requires these but we won't use, so just discard
|
||||
curl_dlnow = dlnow;
|
||||
curl_dltotal = dltotal;
|
||||
getbytes = curl_dlnow / (time(NULL) - curl_starttime); // To-do: Make this more accurate???
|
||||
|
||||
curtime = time(NULL);
|
||||
|
||||
curl_dlnow = (UINT32)dlnow;
|
||||
curl_dltotal = (UINT32)dltotal;
|
||||
|
||||
if (curtime > curl_starttime)
|
||||
{
|
||||
getbytes = ((double)dlnow) / (curtime - curl_starttime); // To-do: Make this more accurate???
|
||||
}
|
||||
else
|
||||
{
|
||||
getbytes = 0;
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
#endif
|
||||
@@ -1258,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.
|
||||
@@ -1283,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);
|
||||
@@ -1293,25 +1331,34 @@ 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);
|
||||
I_unlock_mutex(downloadmutex);
|
||||
}
|
||||
|
||||
void CURLGetFile(void)
|
||||
{
|
||||
I_lock_mutex(&downloadmutex);
|
||||
CURLMcode mc; /* return code used by curl_multi_wait() */
|
||||
CURLcode easyres; /* Return from easy interface */
|
||||
CURLMsg *m; /* for picking up messages with the transfer status */
|
||||
@@ -1319,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)
|
||||
{
|
||||
@@ -1336,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;
|
||||
}
|
||||
@@ -1349,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);
|
||||
|
||||
@@ -1361,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);
|
||||
@@ -1374,36 +1422,38 @@ 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);
|
||||
}
|
||||
|
||||
HTTP_login *
|
||||
|
||||
+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;
|
||||
|
||||
|
||||
+32
-10
@@ -347,6 +347,25 @@ typedef enum
|
||||
RW_RAIL = 32
|
||||
} ringweapons_t;
|
||||
|
||||
// enum for saved lap times
|
||||
typedef enum
|
||||
{
|
||||
LAP_CUR,
|
||||
LAP_BEST,
|
||||
LAP_LAST,
|
||||
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
|
||||
// ========================================================================
|
||||
@@ -393,9 +412,8 @@ 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
|
||||
INT32 sliptidemem;
|
||||
angle_t sliproll;
|
||||
|
||||
INT16 lturn_max[MAXPREDICTTICS]; // What's the expected turn value for full-left for a number of frames back (to account for netgame latency)?
|
||||
@@ -465,6 +483,7 @@ typedef struct player_s
|
||||
INT16 numboxes; // Number of item boxes obtained for Race Mode
|
||||
INT16 totalring; // Total number of rings obtained for Race Mode
|
||||
tic_t realtime; // integer replacement for leveltime
|
||||
tic_t laptime[LAP__MAX];
|
||||
UINT8 laps; // Number of laps (optional)
|
||||
|
||||
////////////////////
|
||||
@@ -537,15 +556,18 @@ typedef struct player_s
|
||||
tic_t grieftime;
|
||||
UINT8 griefstrikes;
|
||||
|
||||
UINT8 splitscreenindex;
|
||||
#ifdef HWRENDER
|
||||
fixed_t fovadd; // adjust FOV for hw rendering
|
||||
#endif
|
||||
tic_t hitemtimer;
|
||||
UINT8 hitemvictim;
|
||||
|
||||
struct {
|
||||
angle_t aiming, awayviewaiming, frameangle;
|
||||
angle_t viewrollangle;
|
||||
} lerp;
|
||||
UINT8 splitscreenindex;
|
||||
|
||||
tic_t driftsparkGrowTimer;
|
||||
|
||||
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;
|
||||
|
||||
#endif
|
||||
@@ -17,6 +17,8 @@
|
||||
#ifndef __D_THINK__
|
||||
#define __D_THINK__
|
||||
|
||||
#include "doomdef.h"
|
||||
|
||||
#ifdef __GNUG__
|
||||
#pragma interface
|
||||
#endif
|
||||
@@ -49,6 +51,11 @@ typedef struct thinker_s
|
||||
// killough 11/98: count of how many other objects reference
|
||||
// this one using pointers. Used for garbage collection.
|
||||
INT32 references;
|
||||
boolean cachable;
|
||||
#ifdef PARANOIA
|
||||
INT32 debug_mobjtype;
|
||||
tic_t debug_time;
|
||||
#endif
|
||||
} thinker_t;
|
||||
|
||||
#endif
|
||||
+152
-197
File diff suppressed because it is too large.
Load diff
+19
-12
@@ -14,20 +14,26 @@
|
||||
#define __DEHACKED_H__
|
||||
|
||||
#include "m_fixed.h" // for get_number
|
||||
#include "info.h"
|
||||
|
||||
typedef enum
|
||||
{
|
||||
UNDO_NONE = 0x00,
|
||||
UNDO_NEWLINE = 0x01,
|
||||
UNDO_SPACE = 0x02,
|
||||
UNDO_CUTLINE = 0x04,
|
||||
UNDO_HEADER = 0x07,
|
||||
UNDO_ENDTEXT = 0x08,
|
||||
UNDO_TODO = 0,
|
||||
UNDO_DONE = 0,
|
||||
} undotype_f;
|
||||
// Free slot names
|
||||
// The crazy word-reading stuff uses these.
|
||||
extern char *FREE_STATES[NUMSTATEFREESLOTS];
|
||||
extern char *FREE_MOBJS[NUMMOBJFREESLOTS];
|
||||
extern UINT8 used_spr[(NUMSPRITEFREESLOTS / 8) + 1]; // Bitwise flag for sprite freeslot in use! I would use ceil() here if I could, but it only saves 1 byte of memory anyway.
|
||||
|
||||
#define DEH_WriteUndoline(a,b,c)
|
||||
extern const char *const STATE_LIST[];
|
||||
extern const char *const MOBJTYPE_LIST[];
|
||||
extern const char *const MOBJFLAG_LIST[];
|
||||
extern const char *const MOBJFLAG2_LIST[]; // \tMF2_(\S+).*// (.+) --> \t"\1", // \2
|
||||
extern const char *const MOBJEFLAG_LIST[];
|
||||
extern const char *const MAPTHINGFLAG_LIST[4];
|
||||
extern const char *const PLAYERFLAG_LIST[];
|
||||
extern const char *const ML_LIST[]; // Linedef flags
|
||||
extern const char *COLOR_ENUMS[];
|
||||
extern const char *const POWERS_LIST[];
|
||||
extern const char *const KARTSTUFF_LIST[];
|
||||
extern const char *const HUDITEMS_LIST[];
|
||||
|
||||
void DEH_LoadDehackedLump(lumpnum_t lumpnum);
|
||||
void DEH_LoadDehackedLumpPwad(UINT16 wad, UINT16 lump);
|
||||
@@ -41,6 +47,7 @@ fixed_t get_number(const char *word);
|
||||
boolean LUA_SetLuaAction(void *state, const char *actiontocompare);
|
||||
const char *LUA_GetActionName(void *action);
|
||||
void LUA_SetActionByName(void *state, const char *actiontocompare);
|
||||
enum actionnum LUA_GetActionNumByName(const char *actiontocompare);
|
||||
|
||||
extern boolean deh_loaded;
|
||||
|
||||
|
||||
+60
-24
@@ -21,7 +21,6 @@
|
||||
#define SOUND_DUMMY 0
|
||||
#define SOUND_SDL 1
|
||||
#define SOUND_MIXER 2
|
||||
#define SOUND_FMOD 3
|
||||
|
||||
#ifndef SOUND
|
||||
#ifdef HAVE_SDL
|
||||
@@ -29,9 +28,6 @@
|
||||
// Use Mixer interface?
|
||||
#ifdef HAVE_MIXER
|
||||
#define SOUND SOUND_MIXER
|
||||
#ifdef HW3SOUND
|
||||
#undef HW3SOUND
|
||||
#endif
|
||||
#endif
|
||||
|
||||
// Use generic SDL interface.
|
||||
@@ -40,18 +36,8 @@
|
||||
#endif
|
||||
|
||||
#else // No SDL.
|
||||
|
||||
// Use FMOD?
|
||||
#ifdef HAVE_FMOD
|
||||
#define SOUND SOUND_FMOD
|
||||
#ifdef HW3SOUND
|
||||
#undef HW3SOUND
|
||||
#endif
|
||||
#else
|
||||
// No more interfaces. :(
|
||||
#define SOUND SOUND_DUMMY
|
||||
#endif
|
||||
|
||||
// No more interfaces. :(
|
||||
#define SOUND SOUND_DUMMY
|
||||
#endif
|
||||
#endif
|
||||
|
||||
@@ -127,13 +113,8 @@ extern char logfilename[1024];
|
||||
#else
|
||||
#define VERSION 1 // Game version
|
||||
#define SUBVERSION 6 // more precise version number
|
||||
#ifndef USE_FBO_OGL
|
||||
#define VERSIONSTRING "Saturn v6.2 "
|
||||
#define VERSIONSTRINGW L"Saturn v6.2"
|
||||
#else
|
||||
#define VERSIONSTRING "Saturn v6.2 - FBO "
|
||||
#define VERSIONSTRINGW L"Saturn v6.2 - FBO"
|
||||
#endif
|
||||
#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!
|
||||
@@ -211,6 +192,7 @@ extern char logfilename[1024];
|
||||
|
||||
#define MAXPLAYERS 16
|
||||
#define MAXSKINS 255
|
||||
#define MAXLOCALSKINS 32
|
||||
#define PLAYERSMASK (MAXPLAYERS-1)
|
||||
#define MAXPLAYERNAME 21
|
||||
|
||||
@@ -473,7 +455,12 @@ void M_StartupLocale(void);
|
||||
// M_GetText function that just returns the string.
|
||||
#define M_GetText(x) (x)
|
||||
#endif
|
||||
void *M_Memcpy(void* dest, const void* src, size_t n);
|
||||
|
||||
FUNCINLINE static ATTRINLINE void *M_Memcpy(void *dest, const void *src, size_t n)
|
||||
{
|
||||
return memcpy(dest, src, n);
|
||||
}
|
||||
|
||||
char *va(const char *format, ...) FUNCPRINTF;
|
||||
char *M_GetToken(const char *inputString);
|
||||
char *sizeu1(size_t num);
|
||||
@@ -521,12 +508,31 @@ extern boolean capslock;
|
||||
// i_system.c, replace getchar() once the keyboard has been appropriated
|
||||
INT32 I_GetKey(void);
|
||||
|
||||
/* http://www.cse.yorku.ca/~oz/hash.html */
|
||||
static inline
|
||||
UINT32 quickncasehash (const char *p, size_t n)
|
||||
{
|
||||
size_t i = 0;
|
||||
UINT32 x = 5381;
|
||||
|
||||
while (i < n && p[i])
|
||||
{
|
||||
x = (x * 33) ^ tolower(p[i]);
|
||||
i++;
|
||||
}
|
||||
|
||||
return x;
|
||||
}
|
||||
|
||||
#ifndef min // Double-Check with WATTCP-32's cdefs.h
|
||||
#define min(x, y) (((x) < (y)) ? (x) : (y))
|
||||
#endif
|
||||
#ifndef max // Double-Check with WATTCP-32's cdefs.h
|
||||
#define max(x, y) (((x) > (y)) ? (x) : (y))
|
||||
#endif
|
||||
#ifndef CLAMP
|
||||
#define CLAMP(x, y, z) ((x) < (y) ? (y) : ((x) > (z) ? (z) : (x)))
|
||||
#endif
|
||||
|
||||
#ifndef M_PIl
|
||||
#define M_PIl 3.1415926535897932384626433832795029L
|
||||
@@ -541,6 +547,19 @@ INT32 I_GetKey(void);
|
||||
#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__))
|
||||
@@ -563,6 +582,23 @@ extern const char *compdate, *comptime, *comprevision, *compbranch;
|
||||
// None of these that are disabled in the normal build are guaranteed to work perfectly
|
||||
// Compile them at your own risk!
|
||||
|
||||
#ifndef NONET
|
||||
//-- SATURN __
|
||||
/// 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
|
||||
|
||||
/// Server detection for if a connecting client is on Saturn.
|
||||
/// This also enables gamestate resynching between Saturn servers and clients
|
||||
/// Like SRB2 and RR does
|
||||
#ifdef DOSATURNPAK
|
||||
#define SATURNPAK
|
||||
#endif
|
||||
//-- <( ̄︶ ̄)> __
|
||||
#endif
|
||||
|
||||
/// Undefine to use the new method of Gamma correction see colour cube in v_video.c
|
||||
#define BACKWARDSCOMPATCORRECTION
|
||||
|
||||
|
||||
+39
-16
@@ -30,16 +30,26 @@
|
||||
// =============================
|
||||
|
||||
// Selected by user.
|
||||
extern INT16 gamemap;
|
||||
extern char mapmusname[7];
|
||||
extern UINT16 mapmusflags;
|
||||
extern UINT32 mapmusposition;
|
||||
extern UINT32 mapmusresume;
|
||||
|
||||
typedef struct
|
||||
{
|
||||
char name[7]; // Music name, up to 6-character name
|
||||
void *data; // Music lump
|
||||
UINT16 flags; // Track and reset bit
|
||||
boolean looping; // Is this music looping?
|
||||
UINT32 position; // Position to jump to
|
||||
UINT32 resume; // Saved Position when music was stopped
|
||||
UINT32 fadeinms; // Fade in time in ms (used for queue)
|
||||
} music_t;
|
||||
|
||||
extern music_t mapmusic;
|
||||
|
||||
#define MUSIC_TRACKMASK 0x0FFF // ----************
|
||||
#define MUSIC_RELOADRESET 0x8000 // *---------------
|
||||
#define MUSIC_FORCERESET 0x4000 // -*--------------
|
||||
// Use other bits if necessary.
|
||||
|
||||
extern INT16 gamemap;
|
||||
extern INT16 maptol;
|
||||
extern UINT8 globalweather;
|
||||
extern INT32 curWeather;
|
||||
@@ -112,7 +122,6 @@ extern UINT8 window_notinfocus; // are we in focus? (backend independant -- hand
|
||||
extern boolean nodrawers;
|
||||
extern boolean noblit;
|
||||
extern boolean lastdraw;
|
||||
extern postimg_t postimgtype[MAXSPLITSCREENPLAYERS];
|
||||
extern INT32 postimgparam[MAXSPLITSCREENPLAYERS];
|
||||
|
||||
extern INT32 viewwindowx, viewwindowy;
|
||||
@@ -192,7 +201,7 @@ extern struct quake
|
||||
// camera offsets and duration
|
||||
fixed_t x,y,z;
|
||||
angle_t roll;
|
||||
UINT16 time;
|
||||
tic_t time;
|
||||
|
||||
// location, radius, and intensity...
|
||||
mappoint_t *epicenter;
|
||||
@@ -213,6 +222,15 @@ typedef struct
|
||||
char value[256]; // 255 usable characters. If this seriously isn't enough then wtf.
|
||||
} customoption_t;
|
||||
|
||||
typedef struct
|
||||
{
|
||||
boolean use_custom_light;
|
||||
UINT8 light_contrast; ///< Range of wall lighting. 0 is no lighting.
|
||||
SINT8 sprite_backlight; ///< Subtract from wall lighting for sprites only.
|
||||
boolean use_light_angle; ///< When false, wall lighting is evenly distributed. When true, wall lighting is directional.
|
||||
angle_t light_angle; ///< Angle of directional wall lighting.
|
||||
} mapheader_lighting_t;
|
||||
|
||||
/** Map header information.
|
||||
*/
|
||||
typedef struct
|
||||
@@ -226,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.
|
||||
@@ -258,7 +276,11 @@ 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
|
||||
boolean use_encore_lighting; ///< Whether to use separate Encore lighting
|
||||
|
||||
// Music stuff.
|
||||
UINT32 musinterfadeout; ///< Fade out level music on intermission screen in milliseconds
|
||||
@@ -339,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.
|
||||
@@ -455,6 +474,14 @@ extern tic_t racecountdown, exitcountdown;
|
||||
extern fixed_t gravity;
|
||||
extern fixed_t mapobjectscale;
|
||||
|
||||
extern struct maplighting
|
||||
{
|
||||
UINT8 contrast;
|
||||
SINT8 backlight;
|
||||
boolean directional;
|
||||
angle_t angle;
|
||||
} maplighting;
|
||||
|
||||
//for CTF balancing
|
||||
extern INT16 autobalance;
|
||||
extern INT16 teamscramble;
|
||||
@@ -483,7 +510,6 @@ extern boolean startedInFreePlay;
|
||||
|
||||
extern boolean legitimateexit;
|
||||
extern boolean comebackshowninfo;
|
||||
extern tic_t curlap, bestlap;
|
||||
|
||||
extern INT16 votelevels[4][2];
|
||||
extern SINT8 votes[MAXPLAYERS];
|
||||
@@ -530,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;
|
||||
|
||||
+27
-11
@@ -342,17 +342,6 @@ union FColorRGBA
|
||||
} ATTRPACK;
|
||||
typedef union FColorRGBA RGBA_t;
|
||||
|
||||
typedef enum
|
||||
{
|
||||
postimg_none,
|
||||
postimg_water,
|
||||
postimg_motion,
|
||||
postimg_flip,
|
||||
postimg_heat,
|
||||
postimg_mirror,
|
||||
postimg_mirrorflip
|
||||
} postimg_t;
|
||||
|
||||
typedef UINT32 lumpnum_t; // 16 : 16 unsigned long (wad num: lump num)
|
||||
#define LUMPERROR UINT32_MAX
|
||||
|
||||
@@ -367,6 +356,33 @@ typedef UINT32 tic_t;
|
||||
#define UINT2RGBA(a) (UINT32)((a&0xff)<<24)|((a&0xff00)<<8)|((a&0xff0000)>>8)|(((UINT32)a&0xff000000)>>24)
|
||||
#endif
|
||||
|
||||
#define TOSTR(x) #x
|
||||
|
||||
typedef UINT8 bitarray_t;
|
||||
|
||||
#define BIT_ARRAY_SIZE(n) (((n) + 7) >> 3)
|
||||
|
||||
static inline int
|
||||
in_bit_array (const bitarray_t * const array, const int value)
|
||||
{
|
||||
return (array[value >> 3] & (1<<(value & 7)));
|
||||
}
|
||||
|
||||
static inline void
|
||||
set_bit_array (bitarray_t * const array, const int value)
|
||||
{
|
||||
array[value >> 3] |= (1<<(value & 7));
|
||||
}
|
||||
|
||||
static inline void
|
||||
unset_bit_array (bitarray_t * const array, const int value)
|
||||
{
|
||||
array[value >> 3] &= ~(1<<(value & 7));
|
||||
}
|
||||
|
||||
#define intsign(n) \
|
||||
((n) < 0 ? -1 : (n) > 0 ? 1 : 0)
|
||||
|
||||
typedef UINT64 precise_t;
|
||||
|
||||
#endif //__DOOMTYPE__
|
||||
@@ -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,178 +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_StartupMouse2(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){}
|
||||
|
||||
void I_GetMouseEvents(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){}
|
||||
|
||||
+41
-37
@@ -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_GetHudUncap() * scrollspeed))/16;
|
||||
anim2 = (SHORT(pat2->width)<<FRACBITS) - ((((finalecount * scrollspeed) % (SHORT(pat2->width)*16))<<FRACBITS) + (R_GetHudUncap() * 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
|
||||
@@ -996,7 +1000,7 @@ void F_TitleScreenDrawer(void)
|
||||
if (finalecount >= 20)
|
||||
V_DrawSmallScaledPatch(84, 87, 0, ttkart);
|
||||
else if (finalecount >= 10)
|
||||
V_DrawSciencePatch((84<<FRACBITS) - 18*(((20 - finalecount)<<FRACBITS) - R_GetHudUncap()), 87<<FRACBITS, 0, ttkart, FRACUNIT/2);
|
||||
V_DrawSciencePatch((84<<FRACBITS) - 18*(((20 - finalecount)<<FRACBITS) - R_GetMenuUncap()), 87<<FRACBITS, 0, ttkart, FRACUNIT/2);
|
||||
}
|
||||
else if (finalecount < 52)
|
||||
{
|
||||
@@ -1006,14 +1010,14 @@ void F_TitleScreenDrawer(void)
|
||||
else
|
||||
{
|
||||
INT32 transval = 0;
|
||||
|
||||
|
||||
if (finalecount <= (50+(9<<1)))
|
||||
transval = (finalecount - 50)>>1;
|
||||
|
||||
F_SkyScroll(titlescrollspeed);
|
||||
|
||||
V_DrawSciencePatch(0, -40*FixedDiv(((finalecount % 70)<<FRACBITS) + R_GetHudUncap(), 70<<FRACBITS), V_SNAPTOTOP|V_SNAPTOLEFT, ttcheckers, FRACUNIT);
|
||||
V_DrawSciencePatch(280<<FRACBITS, -(40<<FRACBITS) + 40*FixedDiv(((finalecount % 70)<<FRACBITS) + R_GetHudUncap(), 70<<FRACBITS), V_SNAPTOTOP|V_SNAPTORIGHT, ttcheckers, FRACUNIT);
|
||||
V_DrawSciencePatch(0, -40*FixedDiv(((finalecount % 70)<<FRACBITS) + R_GetMenuUncap(), 70<<FRACBITS), V_SNAPTOTOP|V_SNAPTOLEFT, ttcheckers, FRACUNIT);
|
||||
V_DrawSciencePatch(280<<FRACBITS, -(40<<FRACBITS) + 40*FixedDiv(((finalecount % 70)<<FRACBITS) + R_GetMenuUncap(), 70<<FRACBITS), V_SNAPTOTOP|V_SNAPTORIGHT, ttcheckers, FRACUNIT);
|
||||
|
||||
if (transval)
|
||||
V_DrawFadeScreen(120, 10 - transval);
|
||||
@@ -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)
|
||||
|
||||
+1
-1
@@ -273,7 +273,7 @@ static void F_DoWipe(fademask_t *fademask)
|
||||
else
|
||||
{
|
||||
// pointer to transtable that this mask would use
|
||||
transtbl = transtables + ((9 - *mask)<<FF_TRANSSHIFT);
|
||||
transtbl = R_GetTranslucencyTable((9 - *mask) + 1);
|
||||
|
||||
// DRAWING LOOP
|
||||
while (draw_linestogo--)
|
||||
|
||||
+20
-17
@@ -37,7 +37,6 @@
|
||||
#include <tchar.h>
|
||||
|
||||
#define SUFFIX "*"
|
||||
#define SLASH "\\"
|
||||
#define S_ISDIR(m) (((m) & S_IFMT) == S_IFDIR)
|
||||
|
||||
#ifndef INVALID_FILE_ATTRIBUTES
|
||||
@@ -135,7 +134,7 @@ opendir (const CHAR *szPath)
|
||||
/* Allocate enough space to store DIR structure and the complete
|
||||
* directory path given. */
|
||||
nd = (DIR *) malloc (sizeof (DIR) + (strlen(szFullPath) + strlen (SLASH) +
|
||||
strlen(SUFFIX) + 1) * sizeof (CHAR));
|
||||
strlen(PATHSEP) + 1) * sizeof (CHAR));
|
||||
|
||||
if (!nd)
|
||||
{
|
||||
@@ -149,10 +148,9 @@ opendir (const CHAR *szPath)
|
||||
|
||||
/* Add on a slash if the path does not end with one. */
|
||||
if (nd->dd_name[0] != '\0' &&
|
||||
nd->dd_name[strlen (nd->dd_name) - 1] != '/' &&
|
||||
nd->dd_name[strlen (nd->dd_name) - 1] != '\\')
|
||||
nd->dd_name[strlen (nd->dd_name) - 1] != PATHSEP[0])
|
||||
{
|
||||
strcat (nd->dd_name, SLASH);
|
||||
strcat (nd->dd_name, PATHSEP);
|
||||
}
|
||||
|
||||
/* Add on the search pattern */
|
||||
@@ -329,7 +327,8 @@ char menupath[1024];
|
||||
size_t menupathindex[menudepth];
|
||||
size_t menudepthleft = menudepth;
|
||||
|
||||
char menusearch[MAXSTRINGLENGTH+1];
|
||||
char menusearchbuf[MAXSTRINGLENGTH+1];
|
||||
textinput_t menusearch;
|
||||
|
||||
char **dirmenu, **coredirmenu; // core only local for this file
|
||||
size_t sizedirmenu, sizecoredirmenu; // ditto
|
||||
@@ -382,9 +381,9 @@ filestatus_t filesearch(char *filename, const char *startpath, const UINT8 *want
|
||||
return FS_NOTFOUND;
|
||||
}
|
||||
|
||||
if (searchpath[searchpathindex[depthleft]-2] != '/')
|
||||
if (searchpath[searchpathindex[depthleft]-2] != PATHSEP[0])
|
||||
{
|
||||
searchpath[searchpathindex[depthleft]-1] = '/';
|
||||
searchpath[searchpathindex[depthleft]-1] = PATHSEP[0];
|
||||
searchpath[searchpathindex[depthleft]] = 0;
|
||||
}
|
||||
else
|
||||
@@ -392,7 +391,7 @@ filestatus_t filesearch(char *filename, const char *startpath, const UINT8 *want
|
||||
|
||||
while ((!found) && (depthleft < maxsearchdepth))
|
||||
{
|
||||
searchpath[searchpathindex[depthleft]]=0;
|
||||
searchpath[searchpathindex[depthleft]] = 0;
|
||||
dent = readdir(dirhandle[depthleft]);
|
||||
|
||||
if (!dent)
|
||||
@@ -419,7 +418,7 @@ filestatus_t filesearch(char *filename, const char *startpath, const UINT8 *want
|
||||
if (S_ISDIR(fsstat.st_mode))
|
||||
dent->d_type = DT_DIR;
|
||||
else if (S_ISLNK(fsstat.st_mode))
|
||||
dent->d_type = DT_LNK;
|
||||
dent->d_type = DT_LNK;
|
||||
}
|
||||
|
||||
// Symlinks aren't always directory symlinks. Dunno if this would resolve recursive
|
||||
@@ -447,8 +446,8 @@ filestatus_t filesearch(char *filename, const char *startpath, const UINT8 *want
|
||||
depthleft++;
|
||||
}
|
||||
|
||||
searchpath[searchpathindex[depthleft]-1]='/';
|
||||
searchpath[searchpathindex[depthleft]]=0;
|
||||
searchpath[searchpathindex[depthleft]-1] = PATHSEP[0];
|
||||
searchpath[searchpathindex[depthleft]] = 0;
|
||||
}
|
||||
else if (!strcasecmp(searchname, dent->d_name))
|
||||
{
|
||||
@@ -499,7 +498,7 @@ static boolean filemenucmp(char *haystack, char *needle)
|
||||
strupr(localhaystack);
|
||||
if (cv_addons_search_type.value)
|
||||
return (strstr(localhaystack, needle) != 0);
|
||||
return (!strncmp(localhaystack, needle, menusearch[0]));
|
||||
return (!strncmp(localhaystack, needle, menusearch.length));
|
||||
}
|
||||
|
||||
void closefilemenu(boolean validsize)
|
||||
@@ -565,7 +564,7 @@ void searchfilemenu(char *tempname)
|
||||
|
||||
first = (((UINT8)(coredirmenu[0][DIR_TYPE]) == EXT_UP) ? 1 : 0); // skip UP...
|
||||
|
||||
if (!menusearch[0])
|
||||
if (!menusearch.length)
|
||||
{
|
||||
if (dirmenu)
|
||||
Z_Free(dirmenu);
|
||||
@@ -592,7 +591,7 @@ void searchfilemenu(char *tempname)
|
||||
return;
|
||||
}
|
||||
|
||||
strcpy(localmenusearch, menusearch+1);
|
||||
strcpy(localmenusearch, menusearch.buffer);
|
||||
if (!cv_addons_search_case.value)
|
||||
strupr(localmenusearch);
|
||||
|
||||
@@ -654,7 +653,7 @@ boolean preparefilemenu(boolean samedepth, boolean replayhut)
|
||||
tempname = Z_StrDup(dirmenu[dir_on[menudepthleft]]+DIR_STRING); // don't need to I_Error if can't make - not important, just QoL
|
||||
}
|
||||
else
|
||||
menusearch[0] = menusearch[1] = 0; // clear search
|
||||
M_TextInputInit(&menusearch, menusearchbuf, MAXSTRINGLENGTH+1);
|
||||
|
||||
if (!(dirhandle = opendir(menupath))) // get directory
|
||||
{
|
||||
@@ -662,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]);
|
||||
@@ -798,7 +801,7 @@ boolean preparefilemenu(boolean samedepth, boolean replayhut)
|
||||
}
|
||||
else if (ext == EXT_TXT)
|
||||
{
|
||||
if (!strcmp(dent->d_name, "log.txt") || !strcmp(dent->d_name, "errorlog.txt"))
|
||||
if (!strncmp(dent->d_name, "log-", 4) || !strcmp(dent->d_name, "errorlog.txt"))
|
||||
ext |= EXT_LOADED;
|
||||
}
|
||||
|
||||
|
||||
+3
-1
@@ -7,6 +7,7 @@
|
||||
#include "doomdef.h"
|
||||
#include "d_netfil.h"
|
||||
#include "m_menu.h" // MAXSTRINGLENGTH
|
||||
#include "m_textinput.h"
|
||||
|
||||
extern consvar_t cv_addons_option, cv_addons_folder, cv_addons_md5, cv_addons_showall, cv_addons_search_case, cv_addons_search_type;
|
||||
|
||||
@@ -34,7 +35,8 @@ extern char menupath[1024];
|
||||
extern size_t menupathindex[menudepth];
|
||||
extern size_t menudepthleft;
|
||||
|
||||
extern char menusearch[MAXSTRINGLENGTH+1];
|
||||
extern char menusearchbuf[MAXSTRINGLENGTH+1];
|
||||
extern textinput_t menusearch;
|
||||
|
||||
extern char **dirmenu;
|
||||
extern size_t sizedirmenu;
|
||||
|
||||
+1378
-1670
File diff suppressed because it is too large.
Load diff
+93
-49
@@ -17,6 +17,8 @@
|
||||
#include "doomdef.h"
|
||||
#include "doomstat.h"
|
||||
#include "d_event.h"
|
||||
#include "p_saveg.h"
|
||||
#include "m_textinput.h"
|
||||
|
||||
extern char gamedatafilename[64];
|
||||
extern char timeattackfolder[64];
|
||||
@@ -32,18 +34,20 @@ extern INT32 player_name_changes[MAXPLAYERS];
|
||||
extern player_t players[MAXPLAYERS];
|
||||
extern boolean playeringame[MAXPLAYERS];
|
||||
|
||||
extern UINT8 *demo_p;
|
||||
extern savebuffer_t demobuf;
|
||||
|
||||
// ======================================
|
||||
// DEMO playback/recording related stuff.
|
||||
// ======================================
|
||||
|
||||
// demoplaying back and demo recording
|
||||
extern consvar_t cv_recordmultiplayerdemos, cv_netdemosyncquality, cv_maxdemosize;
|
||||
extern consvar_t cv_recordmultiplayerdemos, cv_netdemosyncquality, cv_maxdemosize, cv_demochangemap;
|
||||
extern consvar_t cv_demodateformat;
|
||||
|
||||
// Publicly-accessible demo vars
|
||||
struct demovars_s {
|
||||
char titlename[65];
|
||||
textinput_t titlenameinput;
|
||||
boolean recording, playback, timing;
|
||||
UINT16 version; // Current file format of the demo being played
|
||||
boolean title; // Title Screen demo can be cancelled by any key
|
||||
@@ -63,9 +67,6 @@ struct demovars_s {
|
||||
DSM_WILLSAVE,
|
||||
DSM_SAVED
|
||||
} savemode;
|
||||
|
||||
boolean freecam;
|
||||
|
||||
};
|
||||
|
||||
extern struct demovars_s demo;
|
||||
@@ -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;
|
||||
@@ -115,15 +118,24 @@ extern consvar_t cv_songcredits;
|
||||
extern consvar_t cv_showfreeplay;
|
||||
extern consvar_t cv_growmusic, cv_supermusic;
|
||||
extern consvar_t cv_pauseifunfocused;
|
||||
//extern consvar_t cv_crosshair, cv_crosshair2, cv_crosshair3, cv_crosshair4;
|
||||
extern consvar_t cv_invertmouse/*, cv_alwaysfreelook, cv_chasefreelook, cv_mousemove*/;
|
||||
extern consvar_t cv_invertmouse2/*, cv_alwaysfreelook2, cv_chasefreelook2, cv_mousemove2*/;
|
||||
extern consvar_t cv_useranalog, cv_useranalog2, cv_useranalog3, cv_useranalog4;
|
||||
extern consvar_t cv_analog, cv_analog2, cv_analog3, cv_analog4;
|
||||
extern consvar_t cv_turnaxis,cv_moveaxis,cv_brakeaxis,cv_aimaxis,cv_lookaxis,cv_fireaxis,cv_driftaxis,cv_lookbackaxis,cv_custom1axis,cv_custom2axis,cv_custom3axis,cv_xdeadzone,cv_ydeadzone;
|
||||
extern consvar_t cv_turnaxis2,cv_moveaxis2,cv_brakeaxis2,cv_aimaxis2,cv_lookaxis2,cv_fireaxis2,cv_driftaxis2,cv_lookbackaxis2,cv_custom1axis2,cv_custom2axis2,cv_custom3axis2,cv_xdeadzone2,cv_ydeadzone2;
|
||||
extern consvar_t cv_turnaxis3,cv_moveaxis3,cv_brakeaxis3,cv_aimaxis3,cv_lookaxis3,cv_fireaxis3,cv_driftaxis3,cv_lookbackaxis3,cv_custom1axis3,cv_custom2axis3,cv_custom3axis3,cv_xdeadzone3,cv_ydeadzone3;
|
||||
extern consvar_t cv_turnaxis4,cv_moveaxis4,cv_brakeaxis4,cv_aimaxis4,cv_lookaxis4,cv_fireaxis4,cv_driftaxis4,cv_lookbackaxis4,cv_custom1axis4,cv_custom2axis4,cv_custom3axis4,cv_xdeadzone4,cv_ydeadzone4;
|
||||
extern consvar_t cv_invertmouse;
|
||||
|
||||
extern consvar_t cv_turnaxis[MAXSPLITSCREENPLAYERS];
|
||||
extern consvar_t cv_moveaxis[MAXSPLITSCREENPLAYERS];
|
||||
extern consvar_t cv_camturnaxis[MAXSPLITSCREENPLAYERS];
|
||||
extern consvar_t cv_camstrafeaxis[MAXSPLITSCREENPLAYERS];
|
||||
extern consvar_t cv_brakeaxis[MAXSPLITSCREENPLAYERS];
|
||||
extern consvar_t cv_aimaxis[MAXSPLITSCREENPLAYERS];
|
||||
extern consvar_t cv_lookaxis[MAXSPLITSCREENPLAYERS];
|
||||
extern consvar_t cv_lookbackaxis[MAXSPLITSCREENPLAYERS];
|
||||
extern consvar_t cv_fireaxis[MAXSPLITSCREENPLAYERS];
|
||||
extern consvar_t cv_driftaxis[MAXSPLITSCREENPLAYERS];
|
||||
extern consvar_t cv_custom1axis[MAXSPLITSCREENPLAYERS];
|
||||
extern consvar_t cv_custom2axis[MAXSPLITSCREENPLAYERS];
|
||||
extern consvar_t cv_custom3axis[MAXSPLITSCREENPLAYERS];
|
||||
extern consvar_t cv_xdeadzone[MAXSPLITSCREENPLAYERS];
|
||||
extern consvar_t cv_ydeadzone[MAXSPLITSCREENPLAYERS];
|
||||
|
||||
extern consvar_t cv_ghost_besttime, cv_ghost_bestlap, cv_ghost_last, cv_ghost_guest, cv_ghost_staff;
|
||||
|
||||
// Hud offsets
|
||||
@@ -137,38 +149,47 @@ extern consvar_t cv_##name##_yoffset;
|
||||
DECL_HUD_OFFSET_X(name)\
|
||||
DECL_HUD_OFFSET_Y(name)
|
||||
|
||||
DECL_HUD_OFFSET(item); // Item box
|
||||
DECL_HUD_OFFSET(time); // Time
|
||||
DECL_HUD_OFFSET(laps); // Number of laps
|
||||
DECL_HUD_OFFSET(dnft); // Countdown (did not finish timer)
|
||||
DECL_HUD_OFFSET(speed); // Speedometer
|
||||
DECL_HUD_OFFSET(posi); // Position in race
|
||||
DECL_HUD_OFFSET(face); // Mini rankings
|
||||
DECL_HUD_OFFSET(stcd); // Starting countdown
|
||||
DECL_HUD_OFFSET(item); // Item box
|
||||
DECL_HUD_OFFSET(time); // Time
|
||||
DECL_HUD_OFFSET(laps); // Number of laps
|
||||
DECL_HUD_OFFSET(dnft); // Countdown (did not finish timer)
|
||||
DECL_HUD_OFFSET(speed); // Speedometer
|
||||
DECL_HUD_OFFSET(posi); // Position in race
|
||||
DECL_HUD_OFFSET(wheel); // RA Wheel
|
||||
DECL_HUD_OFFSET(face); // Mini rankings
|
||||
DECL_HUD_OFFSET(stcd); // Starting countdown
|
||||
DECL_HUD_OFFSET_Y(chek); // Check gfx
|
||||
DECL_HUD_OFFSET(mini); // Minimap
|
||||
DECL_HUD_OFFSET(want); // Wanted
|
||||
DECL_HUD_OFFSET(stat); // Stats
|
||||
DECL_HUD_OFFSET(mini); // Minimap
|
||||
DECL_HUD_OFFSET(want); // Wanted
|
||||
DECL_HUD_OFFSET(stat); // Stats
|
||||
|
||||
#undef DECL_HUD_OFFSET
|
||||
#undef DECL_HUD_OFFSET_X
|
||||
#undef DECL_HUD_OFFSET_Y
|
||||
|
||||
extern consvar_t cv_showinput;
|
||||
extern consvar_t cv_posanim;
|
||||
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;
|
||||
extern consvar_t cv_sloperoll;
|
||||
extern consvar_t cv_spriteroll;
|
||||
extern consvar_t cv_sliptideroll;
|
||||
extern consvar_t cv_slamsound;
|
||||
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;
|
||||
|
||||
@@ -181,6 +202,8 @@ typedef enum
|
||||
AXISNONE = 0,
|
||||
AXISTURN,
|
||||
AXISMOVE,
|
||||
AXISCAMTURN,
|
||||
AXISCAMSTRAFE,
|
||||
AXISBRAKE,
|
||||
AXISAIM,
|
||||
AXISLOOK,
|
||||
@@ -262,9 +285,9 @@ void G_SpawnPlayer(INT32 playernum, boolean starpost);
|
||||
// A normal game starts at map 1, but a warp test can start elsewhere
|
||||
void G_DeferedInitNew(boolean pencoremode, const char *mapname, INT32 pickedchar,
|
||||
UINT8 ssplayers, boolean FLS);
|
||||
void G_DoLoadLevel(boolean resetplayer);
|
||||
|
||||
void G_LoadDemoInfo(menudemo_t *pdemo);
|
||||
void G_LoadDemoTitle(menudemo_t *pdemo); // For use in replay search feature
|
||||
void G_DeferedPlayDemo(const char *demo);
|
||||
|
||||
// Can be called by the startup code or M_Responder, calls P_SetupLevel.
|
||||
@@ -351,6 +374,7 @@ extern demoghost *ghosts;
|
||||
#define DFILE_ERROR_CANNOTLOAD 0x04 // Files are missing and cannot be loaded.
|
||||
#define DFILE_ERROR_EXTRAFILES 0x05 // Extra files outside of the replay's file list are loaded.
|
||||
|
||||
void G_ResetDemoRecording(void);
|
||||
void G_DoPlayDemo(char *defdemoname);
|
||||
void G_TimeDemo(const char *name);
|
||||
void G_AddGhost(char *defdemoname);
|
||||
@@ -364,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);
|
||||
@@ -403,7 +435,6 @@ void G_SetRetryFlag(void);
|
||||
void G_ClearRetryFlag(void);
|
||||
boolean G_GetRetryFlag(void);
|
||||
|
||||
|
||||
void G_LoadGameData(void);
|
||||
void G_LoadGameSettings(void);
|
||||
|
||||
@@ -414,25 +445,36 @@ void G_SetGamestate(gamestate_t newstate);
|
||||
|
||||
// Gamedata record shit
|
||||
void G_AllocMainRecordData(INT16 i);
|
||||
//void G_AllocNightsRecordData(INT16 i);
|
||||
void G_ClearRecords(void);
|
||||
|
||||
//UINT32 G_GetBestScore(INT16 map);
|
||||
tic_t G_GetBestTime(INT16 map);
|
||||
//tic_t G_GetBestLap(INT16 map);
|
||||
//UINT16 G_GetBestRings(INT16 map);
|
||||
//UINT32 G_GetBestNightsScore(INT16 map, UINT8 mare);
|
||||
//tic_t G_GetBestNightsTime(INT16 map, UINT8 mare);
|
||||
//UINT8 G_GetBestNightsGrade(INT16 map, UINT8 mare);
|
||||
|
||||
//void G_AddTempNightsRecords(UINT32 pscore, tic_t ptime, UINT8 mare);
|
||||
//void G_SetNightsRecords(void);
|
||||
// Time utility functions
|
||||
|
||||
FUNCMATH INT32 G_TicsToHours(tic_t tics);
|
||||
FUNCMATH INT32 G_TicsToMinutes(tic_t tics, boolean full);
|
||||
FUNCMATH INT32 G_TicsToSeconds(tic_t tics);
|
||||
FUNCMATH INT32 G_TicsToCentiseconds(tic_t tics);
|
||||
FUNCMATH INT32 G_TicsToMilliseconds(tic_t tics);
|
||||
FUNCINLINE static ATTRINLINE FUNCMATH INT32 G_TicsToHours(tic_t tics)
|
||||
{
|
||||
return tics/(3600*TICRATE);
|
||||
}
|
||||
|
||||
FUNCINLINE static ATTRINLINE FUNCMATH INT32 G_TicsToMinutes(tic_t tics, boolean full)
|
||||
{
|
||||
return full ? (tics/(60*TICRATE)) : (tics/(60*TICRATE)%60);
|
||||
}
|
||||
|
||||
FUNCINLINE static ATTRINLINE FUNCMATH INT32 G_TicsToSeconds(tic_t tics)
|
||||
{
|
||||
return (tics/TICRATE)%60;
|
||||
}
|
||||
|
||||
FUNCINLINE static ATTRINLINE FUNCMATH INT32 G_TicsToCentiseconds(tic_t tics)
|
||||
{
|
||||
return (INT32)((tics%TICRATE) * (100.00f/TICRATE));
|
||||
}
|
||||
|
||||
FUNCINLINE static ATTRINLINE FUNCMATH INT32 G_TicsToMilliseconds(tic_t tics)
|
||||
{
|
||||
return (INT32)((tics%TICRATE) * (1000.00f/TICRATE));
|
||||
}
|
||||
|
||||
// Don't split up TOL handling
|
||||
INT16 G_TOLFlag(INT32 pgametype);
|
||||
@@ -440,4 +482,6 @@ INT16 G_TOLFlag(INT32 pgametype);
|
||||
INT16 G_RandMap(INT16 tolflags, INT16 pprevmap, boolean ignorebuffer, UINT8 maphell, boolean callagainsoon, INT16 *extbuffer);
|
||||
void G_AddMapToBuffer(INT16 map);
|
||||
|
||||
void G_FixCamera(UINT8 view);
|
||||
|
||||
#endif
|
||||
+298
-167
@@ -14,11 +14,19 @@
|
||||
#include "doomdef.h"
|
||||
#include "doomstat.h"
|
||||
#include "g_input.h"
|
||||
#include "g_game.h"
|
||||
#include "keys.h"
|
||||
#include "hu_stuff.h" // need HUFONT start & end
|
||||
#include "d_net.h"
|
||||
#include "console.h"
|
||||
|
||||
#include "m_menu.h"
|
||||
|
||||
#include "i_system.h"
|
||||
#include "i_video.h"
|
||||
#include "r_draw.h"
|
||||
#include "v_video.h"
|
||||
|
||||
#define MAXMOUSESENSITIVITY 100 // sensitivity steps
|
||||
|
||||
static CV_PossibleValue_t mousesens_cons_t[] = {{1, "MIN"}, {MAXMOUSESENSITIVITY, "MAX"}, {0, NULL}};
|
||||
@@ -27,17 +35,84 @@ static CV_PossibleValue_t turnsmooth_cons_t[] = {{2, "Slow"}, {1, "Fast"}, {0, "
|
||||
|
||||
// mouse values are used once
|
||||
consvar_t cv_mousesens = {"mousesens", "20", CV_SAVE, mousesens_cons_t, NULL, 0, NULL, NULL, 0, 0, NULL};
|
||||
consvar_t cv_mousesens2 = {"mousesens2", "20", CV_SAVE, mousesens_cons_t, NULL, 0, NULL, NULL, 0, 0, NULL};
|
||||
consvar_t cv_mouseysens = {"mouseysens", "20", CV_SAVE, mousesens_cons_t, NULL, 0, NULL, NULL, 0, 0, NULL};
|
||||
consvar_t cv_mouseysens2 = {"mouseysens2", "20", CV_SAVE, mousesens_cons_t, NULL, 0, NULL, NULL, 0, 0, NULL};
|
||||
consvar_t cv_controlperkey = {"controlperkey", "One", CV_SAVE, onecontrolperkey_cons_t, NULL, 0, NULL, NULL, 0, 0, NULL};
|
||||
consvar_t cv_turnsmooth = {"turnsmoothing", "Slow", CV_SAVE, turnsmooth_cons_t, NULL, 0, NULL, NULL, 0, 0, NULL};
|
||||
|
||||
static void G_ResetPlayerDeviceRumble(INT32 player);
|
||||
static void rumble_off_handle(void);
|
||||
static void rumble_off_handle2(void);
|
||||
static void rumble_off_handle3(void);
|
||||
static void rumble_off_handle4(void);
|
||||
|
||||
static void G_ResetPlayerGamepadIndicatorColor(INT32 player);
|
||||
static void led_off_handle(void);
|
||||
static void led_off_handle2(void);
|
||||
static void led_off_handle3(void);
|
||||
static void led_off_handle4(void);
|
||||
|
||||
consvar_t cv_rumble[MAXSPLITSCREENPLAYERS] = {
|
||||
{"rumble", "Off", CV_SAVE|CV_CALL|CV_NOINIT, CV_OnOff, rumble_off_handle, 0, NULL, NULL, 0, 0, NULL},
|
||||
{"rumble2", "Off", CV_SAVE|CV_CALL|CV_NOINIT, CV_OnOff, rumble_off_handle2, 0, NULL, NULL, 0, 0, NULL},
|
||||
{"rumble3", "Off", CV_SAVE|CV_CALL|CV_NOINIT, CV_OnOff, rumble_off_handle3, 0, NULL, NULL, 0, 0, NULL},
|
||||
{"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", "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)
|
||||
G_ResetPlayerDeviceRumble(0);
|
||||
}
|
||||
|
||||
static void rumble_off_handle2(void)
|
||||
{
|
||||
if (!cv_rumble[1].value)
|
||||
G_ResetPlayerDeviceRumble(1);
|
||||
}
|
||||
|
||||
static void rumble_off_handle3(void)
|
||||
{
|
||||
if (!cv_rumble[2].value)
|
||||
G_ResetPlayerDeviceRumble(2);
|
||||
}
|
||||
|
||||
static void rumble_off_handle4(void)
|
||||
{
|
||||
if (!cv_rumble[3].value)
|
||||
G_ResetPlayerDeviceRumble(3);
|
||||
}
|
||||
|
||||
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);
|
||||
}
|
||||
|
||||
INT32 mousex, mousey;
|
||||
INT32 mlooky; // like mousey but with a custom sensitivity for mlook
|
||||
|
||||
INT32 mouse2x, mouse2y, mlook2y;
|
||||
|
||||
// joystick values are repeated
|
||||
INT32 joyxmove[JOYAXISSET], joyymove[JOYAXISSET], joy2xmove[JOYAXISSET], joy2ymove[JOYAXISSET],
|
||||
joy3xmove[JOYAXISSET], joy3ymove[JOYAXISSET], joy4xmove[JOYAXISSET], joy4ymove[JOYAXISSET];
|
||||
@@ -46,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
|
||||
{
|
||||
@@ -59,7 +131,6 @@ typedef struct
|
||||
} dclick_t;
|
||||
static dclick_t mousedclicks[MOUSEBUTTONS];
|
||||
static dclick_t joydclicks[JOYBUTTONS + JOYHATS*4];
|
||||
static dclick_t mouse2dclicks[MOUSEBUTTONS];
|
||||
static dclick_t joy2dclicks[JOYBUTTONS + JOYHATS*4];
|
||||
static dclick_t joy3dclicks[JOYBUTTONS + JOYHATS*4];
|
||||
static dclick_t joy4dclicks[JOYBUTTONS + JOYHATS*4];
|
||||
@@ -144,14 +215,6 @@ void G_MapEventsToControls(event_t *ev)
|
||||
if (ev->data3 != INT32_MAX) joy4ymove[i] = ev->data3;
|
||||
break;
|
||||
|
||||
case ev_mouse2: // buttons are virtual keys
|
||||
if (menuactive || CON_Ready() || chat_on)
|
||||
break;
|
||||
mouse2x = (INT32)(ev->data2*((cv_mousesens2.value*cv_mousesens2.value)/110.0f + 0.1f));
|
||||
mouse2y = (INT32)(ev->data3*((cv_mousesens2.value*cv_mousesens2.value)/110.0f + 0.1f));
|
||||
mlook2y = (INT32)(ev->data3*((cv_mouseysens2.value*cv_mousesens2.value)/110.0f + 0.1f));
|
||||
break;
|
||||
|
||||
default:
|
||||
break;
|
||||
}
|
||||
@@ -169,12 +232,6 @@ void G_MapEventsToControls(event_t *ev)
|
||||
gamekeydown[KEY_DBLJOY1+i] = flag;
|
||||
}
|
||||
|
||||
for (i = 0; i < MOUSEBUTTONS; i++)
|
||||
{
|
||||
flag = G_CheckDoubleClick(gamekeydown[KEY_2MOUSE1+i], &mouse2dclicks[i]);
|
||||
gamekeydown[KEY_DBL2MOUSE1+i] = flag;
|
||||
}
|
||||
|
||||
for (i = 0; i < JOYBUTTONS + JOYHATS*4; i++)
|
||||
{
|
||||
flag = G_CheckDoubleClick(gamekeydown[KEY_2JOY1+i], &joy2dclicks[i]);
|
||||
@@ -194,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.
|
||||
//
|
||||
@@ -312,18 +389,8 @@ static keyname_t keynames[] =
|
||||
{KEY_MOUSE1+5,"MOUSE6"},
|
||||
{KEY_MOUSE1+6,"MOUSE7"},
|
||||
{KEY_MOUSE1+7,"MOUSE8"},
|
||||
{KEY_2MOUSE1+0,"SEC_MOUSE2"}, // BP: sorry my mouse handler swap button 1 and 2
|
||||
{KEY_2MOUSE1+1,"SEC_MOUSE1"},
|
||||
{KEY_2MOUSE1+2,"SEC_MOUSE3"},
|
||||
{KEY_2MOUSE1+3,"SEC_MOUSE4"},
|
||||
{KEY_2MOUSE1+4,"SEC_MOUSE5"},
|
||||
{KEY_2MOUSE1+5,"SEC_MOUSE6"},
|
||||
{KEY_2MOUSE1+6,"SEC_MOUSE7"},
|
||||
{KEY_2MOUSE1+7,"SEC_MOUSE8"},
|
||||
{KEY_MOUSEWHEELUP, "Wheel 1 UP"},
|
||||
{KEY_MOUSEWHEELDOWN, "Wheel 1 Down"},
|
||||
{KEY_2MOUSEWHEELUP, "Wheel 2 UP"},
|
||||
{KEY_2MOUSEWHEELDOWN, "Wheel 2 Down"},
|
||||
|
||||
{KEY_JOY1+0, "JOY1"},
|
||||
{KEY_JOY1+1, "JOY2"},
|
||||
@@ -334,7 +401,7 @@ static keyname_t keynames[] =
|
||||
{KEY_JOY1+6, "JOY7"},
|
||||
{KEY_JOY1+7, "JOY8"},
|
||||
{KEY_JOY1+8, "JOY9"},
|
||||
|
||||
|
||||
#if !defined (NOMOREJOYBTN_1S)
|
||||
// we use up to 32 buttons in DirectInput
|
||||
{KEY_JOY1+9, "JOY10"},
|
||||
@@ -387,14 +454,6 @@ static keyname_t keynames[] =
|
||||
{KEY_DBLMOUSE1+5, "DBLMOUSE6"},
|
||||
{KEY_DBLMOUSE1+6, "DBLMOUSE7"},
|
||||
{KEY_DBLMOUSE1+7, "DBLMOUSE8"},
|
||||
{KEY_DBL2MOUSE1+0, "DBLSEC_MOUSE2"}, // BP: sorry my mouse handler swap button 1 and 2
|
||||
{KEY_DBL2MOUSE1+1, "DBLSEC_MOUSE1"},
|
||||
{KEY_DBL2MOUSE1+2, "DBLSEC_MOUSE3"},
|
||||
{KEY_DBL2MOUSE1+3, "DBLSEC_MOUSE4"},
|
||||
{KEY_DBL2MOUSE1+4, "DBLSEC_MOUSE5"},
|
||||
{KEY_DBL2MOUSE1+5, "DBLSEC_MOUSE6"},
|
||||
{KEY_DBL2MOUSE1+6, "DBLSEC_MOUSE7"},
|
||||
{KEY_DBL2MOUSE1+7, "DBLSEC_MOUSE8"},
|
||||
|
||||
{KEY_DBLJOY1+0, "DBLJOY1"},
|
||||
{KEY_DBLJOY1+1, "DBLJOY2"},
|
||||
@@ -779,7 +838,6 @@ static keyname_t keynames[] =
|
||||
{KEY_DBL4HAT1+13, "DBLFOR_HATDOWN4"},
|
||||
{KEY_DBL4HAT1+14, "DBLFOR_HATLEFT4"},
|
||||
{KEY_DBL4HAT1+15, "DBLFOR_HATRIGHT4"},
|
||||
|
||||
};
|
||||
|
||||
static const char *gamecontrolname[num_gamecontrols] =
|
||||
@@ -812,10 +870,109 @@ static const char *gamecontrolname[num_gamecontrols] =
|
||||
"custom1",
|
||||
"custom2",
|
||||
"custom3",
|
||||
"director",
|
||||
"freecam",
|
||||
"camfloat",
|
||||
"camsink",
|
||||
"strafeleft",
|
||||
"straferight",
|
||||
};
|
||||
|
||||
#define NUMKEYNAMES (sizeof (keynames)/sizeof (keyname_t))
|
||||
|
||||
#include "k_kart.h"
|
||||
|
||||
UINT16 G_GetSkinColor(INT32 playernum)
|
||||
{
|
||||
if (gamestate == GS_LEVEL)
|
||||
{
|
||||
player_t *player = &players[displayplayers[playernum]];
|
||||
|
||||
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;
|
||||
}
|
||||
}
|
||||
|
||||
// otherwise just fallback to whatever the cvar is
|
||||
switch (playernum)
|
||||
{
|
||||
case 0:
|
||||
return cv_playercolor.value;
|
||||
case 1:
|
||||
return cv_playercolor2.value;
|
||||
case 2:
|
||||
return cv_playercolor3.value;
|
||||
case 3:
|
||||
return cv_playercolor4.value;
|
||||
default:
|
||||
return 0;
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
void G_SetPlayerGamepadIndicatorColor(INT32 playernum, UINT16 color)
|
||||
{
|
||||
UINT16 skincolor;
|
||||
byteColor_t byte_color;
|
||||
|
||||
I_Assert(playernum >= 0 && playernum < MAXSPLITSCREENPLAYERS);
|
||||
|
||||
if (cv_gamepadled[playernum].value == 0)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
skincolor = color ? color : G_GetSkinColor(playernum);
|
||||
byte_color = V_GetColor(colortranslations[skincolor][8]).s;
|
||||
|
||||
I_SetGamepadIndicatorColor(playernum, byte_color.red, byte_color.green, byte_color.blue);
|
||||
}
|
||||
|
||||
static void G_ResetPlayerGamepadIndicatorColor(INT32 playernum)
|
||||
{
|
||||
if (cv_gamepadled[playernum].value == 0)
|
||||
{
|
||||
I_SetGamepadIndicatorColor(playernum, 0, 0, 255);
|
||||
}
|
||||
else
|
||||
G_SetPlayerGamepadIndicatorColor(playernum, 0);
|
||||
}
|
||||
|
||||
static void G_ResetPlayerDeviceRumble(INT32 playernum)
|
||||
{
|
||||
I_GamepadRumble(playernum, 0, 0, 0);
|
||||
}
|
||||
|
||||
void G_ResetAllDeviceRumbles(void)
|
||||
{
|
||||
int i;
|
||||
|
||||
for (i = 0; i < MAXSPLITSCREENPLAYERS; i++)
|
||||
{
|
||||
I_GamepadRumble(i, 0, 0, 0);
|
||||
}
|
||||
}
|
||||
|
||||
void G_PlayerDeviceRumble(INT32 playernum, UINT16 low_strength, UINT16 high_strength, UINT32 duration)
|
||||
{
|
||||
I_Assert(playernum >= 0 && playernum < MAXSPLITSCREENPLAYERS);
|
||||
|
||||
if (cv_rumble[playernum].value == 0)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
I_GamepadRumble(playernum, low_strength, high_strength, duration);
|
||||
}
|
||||
|
||||
//
|
||||
// Detach any keys associated to the given game control
|
||||
// - pass the pointer to the gamecontrol table for the player being edited
|
||||
@@ -827,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);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -872,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')
|
||||
@@ -891,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;
|
||||
}
|
||||
|
||||
@@ -1196,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;
|
||||
@@ -1263,7 +1394,7 @@ void Command_Setcontrol_f(void)
|
||||
return;
|
||||
}
|
||||
|
||||
setcontrol(gamecontrol);
|
||||
setcontrol(gamecontrol[0]);
|
||||
}
|
||||
|
||||
void Command_Setcontrol2_f(void)
|
||||
@@ -1278,7 +1409,7 @@ void Command_Setcontrol2_f(void)
|
||||
return;
|
||||
}
|
||||
|
||||
setcontrol(gamecontrolbis);
|
||||
setcontrol(gamecontrol[1]);
|
||||
}
|
||||
|
||||
void Command_Setcontrol3_f(void)
|
||||
@@ -1293,7 +1424,7 @@ void Command_Setcontrol3_f(void)
|
||||
return;
|
||||
}
|
||||
|
||||
setcontrol(gamecontrol3);
|
||||
setcontrol(gamecontrol[2]);
|
||||
}
|
||||
|
||||
void Command_Setcontrol4_f(void)
|
||||
@@ -1308,5 +1439,5 @@ void Command_Setcontrol4_f(void)
|
||||
return;
|
||||
}
|
||||
|
||||
setcontrol(gamecontrol4);
|
||||
setcontrol(gamecontrol[3]);
|
||||
}
|
||||
+24
-17
@@ -15,6 +15,7 @@
|
||||
#define __G_INPUT__
|
||||
|
||||
#include "d_event.h"
|
||||
#include "doomstat.h"
|
||||
#include "keys.h"
|
||||
#include "command.h"
|
||||
|
||||
@@ -40,12 +41,10 @@ typedef enum
|
||||
KEY_DBLJOY1 = KEY_DBLMOUSE1 + MOUSEBUTTONS,
|
||||
KEY_DBLHAT1 = KEY_DBLJOY1 + JOYBUTTONS,
|
||||
|
||||
KEY_2MOUSE1 = KEY_DBLHAT1 + JOYHATS*4,
|
||||
KEY_2JOY1 = KEY_2MOUSE1 + MOUSEBUTTONS,
|
||||
KEY_2JOY1 = KEY_DBLHAT1 + MOUSEBUTTONS,
|
||||
KEY_2HAT1 = KEY_2JOY1 + JOYBUTTONS,
|
||||
|
||||
KEY_DBL2MOUSE1 = KEY_2HAT1 + JOYHATS*4,
|
||||
KEY_DBL2JOY1 = KEY_DBL2MOUSE1 + MOUSEBUTTONS,
|
||||
KEY_DBL2JOY1 = KEY_2HAT1 + MOUSEBUTTONS,
|
||||
KEY_DBL2HAT1 = KEY_DBL2JOY1 + JOYBUTTONS,
|
||||
|
||||
KEY_3JOY1 = KEY_DBL2HAT1 + JOYHATS*4,
|
||||
@@ -62,10 +61,8 @@ typedef enum
|
||||
|
||||
KEY_MOUSEWHEELUP = KEY_DBL4HAT1 + JOYHATS*4,
|
||||
KEY_MOUSEWHEELDOWN = KEY_MOUSEWHEELUP + 1,
|
||||
KEY_2MOUSEWHEELUP = KEY_MOUSEWHEELDOWN + 1,
|
||||
KEY_2MOUSEWHEELDOWN = KEY_2MOUSEWHEELUP + 1,
|
||||
|
||||
NUMINPUTS = KEY_2MOUSEWHEELDOWN + 1,
|
||||
NUMINPUTS = KEY_MOUSEWHEELDOWN + 1,
|
||||
} key_input_e;
|
||||
|
||||
typedef enum
|
||||
@@ -98,17 +95,23 @@ typedef enum
|
||||
gc_custom1, // Lua scriptable
|
||||
gc_custom2, // Lua scriptable
|
||||
gc_custom3, // Lua scriptable
|
||||
gc_director,
|
||||
gc_freecam, // Toggle for freecam while ingame
|
||||
gc_camfloat, // alternative button for raising cam
|
||||
gc_camsink, // alternative button for sinking
|
||||
gc_strafeleft,
|
||||
gc_straferight,
|
||||
num_gamecontrols
|
||||
} gamecontrols_e;
|
||||
|
||||
// mouse values are used once
|
||||
extern consvar_t cv_mousesens, cv_mouseysens;
|
||||
extern consvar_t cv_mousesens2, cv_mouseysens2;
|
||||
extern consvar_t cv_controlperkey, cv_turnsmooth;
|
||||
extern consvar_t cv_rumble[MAXSPLITSCREENPLAYERS];
|
||||
extern consvar_t cv_gamepadled[MAXSPLITSCREENPLAYERS];
|
||||
|
||||
extern INT32 mousex, mousey;
|
||||
extern INT32 mlooky; //mousey with mlookSensitivity
|
||||
extern INT32 mouse2x, mouse2y, mlook2y;
|
||||
|
||||
extern INT32 joyxmove[JOYAXISSET], joyymove[JOYAXISSET], joy2xmove[JOYAXISSET], joy2ymove[JOYAXISSET],
|
||||
joy3xmove[JOYAXISSET], joy3ymove[JOYAXISSET], joy4xmove[JOYAXISSET], joy4ymove[JOYAXISSET];
|
||||
@@ -117,20 +120,24 @@ 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
|
||||
|
||||
UINT16 G_GetSkinColor(INT32 playernum);
|
||||
void G_SetPlayerGamepadIndicatorColor(INT32 playernum, UINT16 color);
|
||||
void G_ResetAllDeviceRumbles(void);
|
||||
void G_PlayerDeviceRumble(INT32 playernum, UINT16 low_strength, UINT16 high_strength, UINT32 duration);
|
||||
|
||||
// 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);
|
||||
|
||||
@@ -1,85 +0,0 @@
|
||||
// Emacs style mode select -*- C++ -*-
|
||||
//-----------------------------------------------------------------------------
|
||||
//
|
||||
// Copyright (C) 2001 by DooM Legacy Team.
|
||||
//
|
||||
// This program is free software; you can redistribute it and/or
|
||||
// modify it under the terms of the GNU General Public License
|
||||
// as published by the Free Software Foundation; either version 2
|
||||
// of the License, or (at your option) any later version.
|
||||
//
|
||||
// This program is distributed in the hope that it will be useful,
|
||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
// GNU General Public License for more details.
|
||||
//
|
||||
//-----------------------------------------------------------------------------
|
||||
/// \file
|
||||
/// \brief 3D sound import/export prototypes for low-level hardware interface
|
||||
|
||||
#ifndef __HW_3DS_DRV_H__
|
||||
#define __HW_3DS_DRV_H__
|
||||
|
||||
// Use standart hardware API
|
||||
#include "hw_dll.h"
|
||||
#include "hws_data.h"
|
||||
|
||||
#if defined (HAVE_SDL) || !defined (HWD)
|
||||
EXPORT void HWRAPI(Shutdown) (void);
|
||||
#endif
|
||||
|
||||
// Use standart Init and Shutdown functions
|
||||
|
||||
EXPORT INT32 HWRAPI (Startup) (I_Error_t FatalErrorFunction, snddev_t *snd_dev);
|
||||
EXPORT u_int HWRAPI (AddSfx) (sfx_data_t *sfx);
|
||||
EXPORT INT32 HWRAPI (AddSource) (source3D_data_t *src, u_int sfxhandle);
|
||||
EXPORT INT32 HWRAPI (StartSource) (INT32 handle);
|
||||
EXPORT void HWRAPI (StopSource) (INT32 handle);
|
||||
EXPORT INT32 HWRAPI (GetHW3DSVersion) (void);
|
||||
EXPORT void HWRAPI (BeginFrameUpdate) (void);
|
||||
EXPORT void HWRAPI (EndFrameUpdate) (void);
|
||||
EXPORT INT32 HWRAPI (IsPlaying) (INT32 handle);
|
||||
EXPORT void HWRAPI (UpdateListener) (listener_data_t *data, INT32 num);
|
||||
EXPORT void HWRAPI (UpdateSourceParms) (INT32 handle, INT32 vol, INT32 sep);
|
||||
EXPORT void HWRAPI (SetGlobalSfxVolume) (INT32 volume);
|
||||
EXPORT INT32 HWRAPI (SetCone) (INT32 handle, cone_def_t *cone_def);
|
||||
EXPORT void HWRAPI (Update3DSource) (INT32 handle, source3D_pos_t *data);
|
||||
EXPORT INT32 HWRAPI (ReloadSource) (INT32 handle, u_int sfxhandle);
|
||||
EXPORT void HWRAPI (KillSource) (INT32 handle);
|
||||
EXPORT void HWRAPI (KillSfx) (u_int sfxhandle);
|
||||
EXPORT void HWRAPI (GetHW3DSTitle) (char *buf, size_t size);
|
||||
|
||||
|
||||
#if !defined (_CREATE_DLL_)
|
||||
|
||||
struct hardware3ds_s
|
||||
{
|
||||
Startup pfnStartup;
|
||||
AddSfx pfnAddSfx;
|
||||
AddSource pfnAddSource;
|
||||
StartSource pfnStartSource;
|
||||
StopSource pfnStopSource;
|
||||
GetHW3DSVersion pfnGetHW3DSVersion;
|
||||
BeginFrameUpdate pfnBeginFrameUpdate;
|
||||
EndFrameUpdate pfnEndFrameUpdate;
|
||||
IsPlaying pfnIsPlaying;
|
||||
UpdateListener pfnUpdateListener;
|
||||
UpdateSourceParms pfnUpdateSourceParms;
|
||||
SetGlobalSfxVolume pfnSetGlobalSfxVolume;
|
||||
SetCone pfnSetCone;
|
||||
Update3DSource pfnUpdate3DSource;
|
||||
ReloadSource pfnReloadSource;
|
||||
KillSource pfnKillSource;
|
||||
KillSfx pfnKillSfx;
|
||||
Shutdown pfnShutdown;
|
||||
GetHW3DSTitle pfnGetHW3DSTitle;
|
||||
};
|
||||
|
||||
extern struct hardware3ds_s hw3ds_driver;
|
||||
|
||||
#define HW3DS hw3ds_driver
|
||||
|
||||
|
||||
#endif // _CREATE_DLL_
|
||||
|
||||
#endif // __HW_3DS_DRV_H__
|
||||
@@ -1,996 +0,0 @@
|
||||
// Emacs style mode select -*- C++ -*-
|
||||
//-----------------------------------------------------------------------------
|
||||
//
|
||||
// Copyright (C) 2001 by DooM Legacy Team.
|
||||
//
|
||||
// This program is free software; you can redistribute it and/or
|
||||
// modify it under the terms of the GNU General Public License
|
||||
// as published by the Free Software Foundation; either version 2
|
||||
// of the License, or (at your option) any later version.
|
||||
//
|
||||
// This program is distributed in the hope that it will be useful,
|
||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
// GNU General Public License for more details.
|
||||
//-----------------------------------------------------------------------------
|
||||
/// \file
|
||||
/// \brief Hardware 3D sound general code
|
||||
|
||||
#include "../doomdef.h"
|
||||
|
||||
#ifdef HW3SOUND
|
||||
|
||||
#include "../i_sound.h"
|
||||
#include "../s_sound.h"
|
||||
#include "../w_wad.h"
|
||||
#include "../z_zone.h"
|
||||
#include "../g_game.h"
|
||||
#include "../tables.h"
|
||||
#include "../sounds.h"
|
||||
#include "../r_main.h"
|
||||
#include "../r_things.h"
|
||||
#include "../m_random.h"
|
||||
#include "../p_local.h"
|
||||
#include "hw3dsdrv.h"
|
||||
#include "hw3sound.h"
|
||||
|
||||
#define ANGLE2DEG(x) (((double)(x)) / ((double)ANGLE_45/45))
|
||||
#define NORM_PITCH 128
|
||||
#define NORM_PRIORITY 64
|
||||
#define NORM_SEP 128
|
||||
#if 1
|
||||
#define TPS(x) (x)
|
||||
#else //Alam_GBC: MPS, not MPF!
|
||||
#define TPS(x) ((float)(x)/(float)TICRATE)
|
||||
#endif
|
||||
|
||||
struct hardware3ds_s hw3ds_driver;
|
||||
|
||||
|
||||
typedef struct source_s
|
||||
{
|
||||
sfxinfo_t *sfxinfo;
|
||||
const void *origin;
|
||||
INT32 handle; // Internal source handle
|
||||
channel_type_t type; // Sound type (attack, scream, etc)
|
||||
} source_t;
|
||||
|
||||
|
||||
typedef struct ambient_sdata_s
|
||||
{
|
||||
source3D_data_t left;
|
||||
source3D_data_t right;
|
||||
} ambient_sdata_t;
|
||||
|
||||
|
||||
typedef struct ambient_source_s
|
||||
{
|
||||
source_t left;
|
||||
source_t right;
|
||||
} ambient_source_t;
|
||||
|
||||
// Static sources
|
||||
// This sources always creates
|
||||
static source_t p_attack_source; // Player attack source
|
||||
static source_t p_attack_source2; // Player2 attack source
|
||||
static source_t p_scream_source; // Player scream source
|
||||
static source_t p_scream_source2; // Player2 scream source
|
||||
|
||||
|
||||
static ambient_source_t ambient_source; // Ambinet sound sources
|
||||
|
||||
// abuse???
|
||||
//static source3D_data_t p_attack_sdata; // ?? Now just holds precalculated player attack source data
|
||||
//static source3D_data_t p_default_sdata;// ?? ---- // ---- // ---- // ---- player scream source data
|
||||
|
||||
static ambient_sdata_t ambient_sdata; // Precalculated datas of an ambient sound sources
|
||||
|
||||
// Stack of dynamic sources
|
||||
static source_t *sources = NULL; // Much like original channels
|
||||
static INT32 num_sources = 0;
|
||||
|
||||
// Current mode of 3D sound system
|
||||
// Default is original (stereo) mode
|
||||
INT32 hws_mode = HWS_DEFAULT_MODE;
|
||||
|
||||
//=============================================================================
|
||||
void HW3S_SetSourcesNum(void)
|
||||
{
|
||||
INT32 i;
|
||||
|
||||
// Allocating the internal channels for mixing
|
||||
// (the maximum number of sounds rendered
|
||||
// simultaneously) within zone memory.
|
||||
if (sources)
|
||||
HW3S_StopSounds();
|
||||
Z_Free(sources);
|
||||
|
||||
if (cv_numChannels.value <= STATIC_SOURCES_NUM)
|
||||
I_Error("HW3S_SetSourcesNum: Number of sound sources cannot be less than %d\n", STATIC_SOURCES_NUM + 1);
|
||||
|
||||
num_sources = cv_numChannels.value - STATIC_SOURCES_NUM;
|
||||
|
||||
sources = (source_t *) Z_Malloc(num_sources * sizeof (*sources), PU_STATIC, 0);
|
||||
|
||||
// Free all channels for use
|
||||
for (i = 0; i < num_sources; i++)
|
||||
{
|
||||
sources[i].sfxinfo = NULL;
|
||||
sources[i].type = CT_NORMAL;
|
||||
sources[i].handle = -1;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
//=============================================================================
|
||||
static void HW3S_KillSource(INT32 snum)
|
||||
{
|
||||
source_t * s = &sources[snum];
|
||||
|
||||
if (s->sfxinfo)
|
||||
{
|
||||
HW3DS.pfnStopSource(s->handle);
|
||||
HW3DS.pfnKillSource(s->handle);
|
||||
s->handle = -1;
|
||||
s->sfxinfo->usefulness--;
|
||||
s->origin = NULL;
|
||||
s->sfxinfo = NULL;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
//=============================================================================
|
||||
/*
|
||||
static void HW3S_StopSource(INT32 snum)
|
||||
{
|
||||
source_t * s = &sources[snum];
|
||||
|
||||
if (s->sfxinfo)
|
||||
{
|
||||
// stop the sound playing
|
||||
HW3DS.pfnStopSource(s->handle);
|
||||
}
|
||||
}
|
||||
*/
|
||||
|
||||
|
||||
//=============================================================================
|
||||
void HW3S_StopSound(void *origin)
|
||||
{
|
||||
INT32 snum;
|
||||
|
||||
for (snum = 0; snum < num_sources; snum++)
|
||||
{
|
||||
if (sources[snum].sfxinfo && sources[snum].origin == origin)
|
||||
{
|
||||
HW3S_KillSource(snum);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void HW3S_StopSoundByID(void *origin, sfxenum_t sfx_id)
|
||||
{
|
||||
INT32 snum;
|
||||
|
||||
for (snum = 0; snum < num_sources; snum++)
|
||||
{
|
||||
if (sources[snum].sfxinfo == &S_sfx[sfx_id] && sources[snum].origin == origin)
|
||||
{
|
||||
HW3S_KillSource(snum);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void HW3S_StopSoundByNum(sfxenum_t sfxnum)
|
||||
{
|
||||
INT32 snum;
|
||||
|
||||
for (snum = 0; snum < num_sources; snum++)
|
||||
{
|
||||
if (sources[snum].sfxinfo == &S_sfx[sfxnum])
|
||||
{
|
||||
HW3S_KillSource(snum);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//=============================================================================
|
||||
void HW3S_StopSounds(void)
|
||||
{
|
||||
INT32 snum;
|
||||
|
||||
// kill all playing sounds at start of level
|
||||
// (trust me - a good idea)
|
||||
for (snum = 0; snum < num_sources; snum++)
|
||||
if (sources[snum].sfxinfo)
|
||||
HW3S_KillSource(snum);
|
||||
|
||||
// Also stop all static sources
|
||||
HW3DS.pfnStopSource(p_attack_source.handle);
|
||||
HW3DS.pfnStopSource(p_attack_source2.handle);
|
||||
HW3DS.pfnStopSource(p_scream_source.handle);
|
||||
HW3DS.pfnStopSource(p_scream_source2.handle);
|
||||
HW3DS.pfnStopSource(ambient_source.left.handle);
|
||||
HW3DS.pfnStopSource(ambient_source.right.handle);
|
||||
}
|
||||
|
||||
|
||||
//=============================================================================
|
||||
static INT32 HW3S_GetSource(const void *origin, sfxinfo_t *sfxinfo, boolean splitsound)
|
||||
{
|
||||
//
|
||||
// If none available, return -1. Otherwise source #.
|
||||
// source number to use
|
||||
|
||||
INT32 snum;
|
||||
source_t * src;
|
||||
INT32 sep = NORM_SEP, pitch = NORM_PITCH, volume = 255;
|
||||
|
||||
(void)splitsound;
|
||||
|
||||
// Find an open source
|
||||
for (snum = 0, src = sources; snum < num_sources; src++, snum++)
|
||||
{
|
||||
if (!src->sfxinfo)
|
||||
break;
|
||||
|
||||
#if 0
|
||||
if (origin && src->origin == origin)
|
||||
{
|
||||
HW3S_KillSource(snum);
|
||||
break;
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
#if 0
|
||||
// Check to see if it is audible
|
||||
if (origin && origin != listenmobj)
|
||||
{
|
||||
INT32 rc;
|
||||
rc = S_AdjustSoundParams(listenmobj, origin, &volume, &sep, &pitch, sfxinfo);
|
||||
if (!rc)
|
||||
return -1;
|
||||
}
|
||||
#else
|
||||
(void)origin;
|
||||
(void)pitch;
|
||||
(void)volume;
|
||||
(void)sep;
|
||||
#endif
|
||||
|
||||
// None available
|
||||
if (snum == num_sources)
|
||||
{
|
||||
// Look for lower priority
|
||||
for (snum = 0, src = sources; snum < num_sources; src++, snum++)
|
||||
if (src->sfxinfo->priority <= sfxinfo->priority)
|
||||
break;
|
||||
|
||||
if (snum == num_sources)
|
||||
{
|
||||
// No lower priority. Sorry, Charlie.
|
||||
return -1;
|
||||
}
|
||||
else
|
||||
{
|
||||
// Otherwise, kick out lower priority
|
||||
HW3S_KillSource(snum);
|
||||
}
|
||||
}
|
||||
return snum;
|
||||
}
|
||||
|
||||
|
||||
//=============================================================================
|
||||
static void HW3S_FillSourceParameters
|
||||
(const mobj_t *origin,
|
||||
source3D_data_t *data,
|
||||
channel_type_t c_type)
|
||||
{
|
||||
fixed_t x = 0, y = 0, z = 0;
|
||||
|
||||
data->max_distance = MAX_DISTANCE;
|
||||
data->min_distance = MIN_DISTANCE;
|
||||
|
||||
if (origin && origin != players[displayplayers[0]].mo)
|
||||
{
|
||||
data->head_relative = false;
|
||||
|
||||
data->pos.momx = TPS(FIXED_TO_FLOAT(origin->momx));
|
||||
data->pos.momy = TPS(FIXED_TO_FLOAT(origin->momy));
|
||||
data->pos.momz = TPS(FIXED_TO_FLOAT(origin->momz));
|
||||
|
||||
x = origin->x;
|
||||
y = origin->y;
|
||||
z = origin->z;
|
||||
|
||||
if (c_type == CT_ATTACK)
|
||||
{
|
||||
const angle_t an = origin->angle >> ANGLETOFINESHIFT;
|
||||
x += FixedMul(16*FRACUNIT, FINECOSINE(an));
|
||||
y += FixedMul(16*FRACUNIT, FINESINE(an));
|
||||
z += origin->height >> 1;
|
||||
}
|
||||
|
||||
else if (c_type == CT_SCREAM)
|
||||
z += origin->height - (5 * FRACUNIT);
|
||||
}
|
||||
else
|
||||
{
|
||||
data->head_relative = true;
|
||||
|
||||
data->pos.momx = 0.0f;
|
||||
data->pos.momy = 0.0f;
|
||||
data->pos.momz = 0.0f;
|
||||
}
|
||||
data->pos.x = FIXED_TO_FLOAT(x);
|
||||
data->pos.y = FIXED_TO_FLOAT(y);
|
||||
data->pos.z = FIXED_TO_FLOAT(z);
|
||||
}
|
||||
|
||||
#define HEADER_SIZE 8
|
||||
//==============================================================
|
||||
/*
|
||||
static void make_outphase_sfx(void *dest, void *src, INT32 size)
|
||||
{
|
||||
SINT8 *s = (SINT8 *)src + HEADER_SIZE, *d = (SINT8 *)dest + HEADER_SIZE;
|
||||
|
||||
M_Memcpy(dest, src, HEADER_SIZE);
|
||||
size -= HEADER_SIZE;
|
||||
|
||||
while (size--)
|
||||
*d++ = -(*s++);
|
||||
}
|
||||
*/
|
||||
|
||||
//INT32 HW3S_Start3DSound(const void *origin, source3D_data_t *source_parm, cone_def_t *cone_parm, channel_type_t channel, INT32 sfx_id, INT32 vol, INT32 pitch);
|
||||
//=============================================================================
|
||||
INT32 HW3S_I_StartSound(const void *origin_p, source3D_data_t *source_parm, channel_type_t c_type, sfxenum_t sfx_id, INT32 volume, INT32 pitch, INT32 sep)
|
||||
{
|
||||
sfxinfo_t *sfx;
|
||||
const mobj_t *origin = (const mobj_t *)origin_p;
|
||||
source3D_data_t source3d_data;
|
||||
INT32 s_num = 0;
|
||||
source_t *source = NULL;
|
||||
mobj_t *listenmobj = players[displayplayers[0]].mo; // TODO: Kart 4P does not support sounds properly here
|
||||
mobj_t *listenmobj2 = NULL;
|
||||
|
||||
if (splitscreen) listenmobj2 = players[displayplayers[1]].mo;
|
||||
|
||||
if (sound_disabled)
|
||||
return -1;
|
||||
|
||||
sfx = &S_sfx[sfx_id];
|
||||
|
||||
if (sfx->skinsound!=-1 && origin && origin->skin)
|
||||
{
|
||||
// it redirect player sound to the sound in the skin table
|
||||
sfx_id = ((skin_t *)origin->skin)->soundsid[sfx->skinsound];
|
||||
sfx = &S_sfx[sfx_id];
|
||||
}
|
||||
|
||||
if (!sfx->data)
|
||||
sfx->data = HW3S_GetSfx(sfx);
|
||||
|
||||
// judgecutor 08-16-2002
|
||||
// Sound pitching for both Doom and Heretic
|
||||
#if 0
|
||||
if (cv_rndsoundpitch.value)
|
||||
{
|
||||
/*if (gamemode != heretic)
|
||||
{
|
||||
if (sfx_id >= sfx_sawup && sfx_id <= sfx_sawhit)
|
||||
pitch += 8 - (M_RandomByte()&15);
|
||||
else if (sfx_id != sfx_itemup && sfx_id != sfx_tink)
|
||||
pitch += 16 - (M_RandomByte()&31);
|
||||
}
|
||||
else*/
|
||||
pitch = 128 + (M_RandomByte() & 7) - (M_RandomByte() & 7);
|
||||
}
|
||||
#endif
|
||||
|
||||
if (pitch < 0)
|
||||
pitch = NORMAL_PITCH;
|
||||
|
||||
if (pitch > 255)
|
||||
pitch = 255;
|
||||
|
||||
if (sep < 0)
|
||||
sep = 128;
|
||||
|
||||
if (splitscreen && listenmobj2) // Copy the sound for the split player
|
||||
{
|
||||
if (c_type != CT_NORMAL && origin && (origin == listenmobj2))
|
||||
{
|
||||
if (c_type == CT_ATTACK)
|
||||
{
|
||||
if (origin == listenmobj2)
|
||||
source = &p_attack_source;
|
||||
else
|
||||
source = &p_attack_source2;
|
||||
}
|
||||
else
|
||||
{
|
||||
if (origin == listenmobj2)
|
||||
source = &p_scream_source;
|
||||
else
|
||||
source = &p_scream_source2;
|
||||
}
|
||||
|
||||
if (source->sfxinfo != sfx)
|
||||
{
|
||||
HW3DS.pfnStopSource(source->handle);
|
||||
source->handle = HW3DS.pfnReloadSource(source->handle, sfx->volume);
|
||||
//I_OutputMsg("PlayerSound data reloaded\n");
|
||||
}
|
||||
}
|
||||
else if (c_type == CT_AMBIENT)
|
||||
{
|
||||
// sfx_data_t outphased_sfx;
|
||||
|
||||
if (ambient_source.left.sfxinfo != sfx)
|
||||
{
|
||||
HW3DS.pfnStopSource(ambient_source.left.handle);
|
||||
HW3DS.pfnStopSource(ambient_source.right.handle);
|
||||
|
||||
// judgecutor:
|
||||
// Outphased sfx's temporarily not used!!!
|
||||
/*
|
||||
outphased_sfx.data = Z_Malloc(sfx_data.length, PU_STATIC, 0);
|
||||
make_outphase_sfx(outphased_sfx.data, sfx_data.data, sfx_data.length);
|
||||
outphased_sfx.length = sfx_data.length;
|
||||
outphased_sfx.id = sfx_data.id;
|
||||
*/
|
||||
ambient_source.left.handle = HW3DS.pfnReloadSource(ambient_source.left.handle, (u_int)sfx->length);
|
||||
//ambient_source.right.handle = HW3DS.pfnReloadSource(ambient_source.right.handle, &outphased_sfx);
|
||||
ambient_source.right.handle = HW3DS.pfnReloadSource(ambient_source.right.handle, (u_int)sfx->length);
|
||||
ambient_source.left.sfxinfo = ambient_source.right.sfxinfo = sfx;
|
||||
//Z_Free(outphased_sfx.data);
|
||||
}
|
||||
|
||||
HW3DS.pfnUpdateSourceParms(ambient_source.left.handle, volume, -1);
|
||||
HW3DS.pfnUpdateSourceParms(ambient_source.right.handle, volume, -1);
|
||||
|
||||
if (sfx->usefulness++ < 0)
|
||||
sfx->usefulness = -1;
|
||||
|
||||
// Ambient sound is special case
|
||||
HW3DS.pfnStartSource(ambient_source.left.handle);
|
||||
HW3DS.pfnStartSource(ambient_source.right.handle);
|
||||
}
|
||||
else
|
||||
{
|
||||
s_num = HW3S_GetSource(origin, sfx, true);
|
||||
|
||||
if (s_num < 0)
|
||||
{
|
||||
//I_OutputMsg("No free source, aborting\n");
|
||||
return -1;
|
||||
}
|
||||
|
||||
source = &sources[s_num];
|
||||
|
||||
if (origin && c_type == CT_NORMAL)
|
||||
{
|
||||
if (!source_parm)
|
||||
{
|
||||
source_parm = &source3d_data;
|
||||
source3d_data.permanent = 0;
|
||||
HW3S_FillSourceParameters(origin, source_parm, c_type);
|
||||
}
|
||||
|
||||
source->handle = HW3DS.pfnAddSource(source_parm, (u_int)sfx->length);
|
||||
}
|
||||
else
|
||||
source->handle = HW3DS.pfnAddSource(NULL, (u_int)sfx->length);
|
||||
}
|
||||
|
||||
// increase the usefulness
|
||||
if (sfx->usefulness++ < 0)
|
||||
sfx->usefulness = -1;
|
||||
|
||||
source->sfxinfo = sfx;
|
||||
source->origin = origin;
|
||||
HW3DS.pfnStartSource(source->handle);
|
||||
}
|
||||
|
||||
if (c_type != CT_NORMAL && origin && (origin == listenmobj))
|
||||
{
|
||||
if (c_type == CT_ATTACK)
|
||||
{
|
||||
if (origin == listenmobj)
|
||||
source = &p_attack_source;
|
||||
else
|
||||
source = &p_attack_source2;
|
||||
}
|
||||
else
|
||||
{
|
||||
if (origin == listenmobj)
|
||||
source = &p_scream_source;
|
||||
else
|
||||
source = &p_scream_source2;
|
||||
}
|
||||
|
||||
if (source->sfxinfo != sfx)
|
||||
{
|
||||
HW3DS.pfnStopSource(source->handle);
|
||||
source->handle = HW3DS.pfnReloadSource(source->handle, sfx->volume);
|
||||
//I_OutputMsg("PlayerSound data reloaded\n");
|
||||
}
|
||||
}
|
||||
else if (c_type == CT_AMBIENT)
|
||||
{
|
||||
// sfx_data_t outphased_sfx;
|
||||
|
||||
if (ambient_source.left.sfxinfo != sfx)
|
||||
{
|
||||
HW3DS.pfnStopSource(ambient_source.left.handle);
|
||||
HW3DS.pfnStopSource(ambient_source.right.handle);
|
||||
|
||||
// judgecutor:
|
||||
// Outphased sfx's temporarily not used!!!
|
||||
/*
|
||||
outphased_sfx.data = Z_Malloc(sfx_data.length, PU_STATIC, 0);
|
||||
make_outphase_sfx(outphased_sfx.data, sfx_data.data, sfx_data.length);
|
||||
outphased_sfx.length = sfx_data.length;
|
||||
outphased_sfx.id = sfx_data.id;
|
||||
*/
|
||||
ambient_source.left.handle = HW3DS.pfnReloadSource(ambient_source.left.handle, (u_int)sfx->length);
|
||||
//ambient_source.right.handle = HW3DS.pfnReloadSource(ambient_source.right.handle, &outphased_sfx);
|
||||
ambient_source.right.handle = HW3DS.pfnReloadSource(ambient_source.right.handle, (u_int)sfx->length);
|
||||
ambient_source.left.sfxinfo = ambient_source.right.sfxinfo = sfx;
|
||||
//Z_Free(outphased_sfx.data);
|
||||
}
|
||||
|
||||
HW3DS.pfnUpdateSourceParms(ambient_source.left.handle, volume, -1);
|
||||
HW3DS.pfnUpdateSourceParms(ambient_source.right.handle, volume, -1);
|
||||
|
||||
if (sfx->usefulness++ < 0)
|
||||
sfx->usefulness = -1;
|
||||
|
||||
// Ambient sound is special case
|
||||
HW3DS.pfnStartSource(ambient_source.left.handle);
|
||||
HW3DS.pfnStartSource(ambient_source.right.handle);
|
||||
return -1;
|
||||
}
|
||||
else
|
||||
{
|
||||
s_num = HW3S_GetSource(origin, sfx, false);
|
||||
|
||||
if (s_num < 0)
|
||||
{
|
||||
//I_OutputMsg("No free source, aborting\n");
|
||||
return -1;
|
||||
}
|
||||
|
||||
source = &sources[s_num];
|
||||
|
||||
if (origin && c_type == CT_NORMAL)
|
||||
{
|
||||
if (!source_parm)
|
||||
{
|
||||
source_parm = &source3d_data;
|
||||
source3d_data.permanent = 0;
|
||||
HW3S_FillSourceParameters(origin, source_parm, c_type);
|
||||
}
|
||||
|
||||
source->handle = HW3DS.pfnAddSource(source_parm, (u_int)sfx->length);
|
||||
}
|
||||
else
|
||||
source->handle = HW3DS.pfnAddSource(NULL, (u_int)sfx->length);
|
||||
|
||||
}
|
||||
|
||||
// increase the usefulness
|
||||
if (sfx->usefulness++ < 0)
|
||||
sfx->usefulness = -1;
|
||||
|
||||
source->sfxinfo = sfx;
|
||||
source->origin = origin;
|
||||
HW3DS.pfnStartSource(source->handle);
|
||||
return s_num;
|
||||
|
||||
}
|
||||
|
||||
|
||||
// Start normal sound
|
||||
//=============================================================================
|
||||
void HW3S_StartSound(const void *origin, sfxenum_t sfx_id)
|
||||
{
|
||||
HW3S_I_StartSound(origin, NULL, CT_NORMAL, sfx_id, 255, NORMAL_PITCH, NORMAL_SEP);
|
||||
}
|
||||
|
||||
|
||||
//=============================================================================
|
||||
void S_StartAttackSound(const void *origin, sfxenum_t sfx_id)
|
||||
{
|
||||
if (hws_mode != HWS_DEFAULT_MODE)
|
||||
HW3S_I_StartSound(origin, NULL, CT_ATTACK, sfx_id, 255, NORMAL_PITCH, NORMAL_SEP);
|
||||
else
|
||||
S_StartSound(origin, sfx_id);
|
||||
}
|
||||
|
||||
void S_StartScreamSound(const void *origin, sfxenum_t sfx_id)
|
||||
{
|
||||
if (hws_mode != HWS_DEFAULT_MODE)
|
||||
HW3S_I_StartSound(origin, NULL, CT_SCREAM, sfx_id, 255, NORMAL_PITCH, NORMAL_SEP);
|
||||
else
|
||||
S_StartSound(origin, sfx_id);
|
||||
}
|
||||
|
||||
#if 0 /// NOTE: not used
|
||||
void S_StartAmbientSound(sfxenum_t sfx_id, INT32 volume)
|
||||
{
|
||||
if (hws_mode != HWS_DEFAULT_MODE)
|
||||
{
|
||||
volume += 30;
|
||||
if (volume > 255)
|
||||
volume = 255;
|
||||
|
||||
HW3S_I_StartSound(NULL, NULL, CT_AMBIENT, sfx_id, volume, NORMAL_PITCH, NORMAL_SEP);
|
||||
}
|
||||
else
|
||||
S_StartSoundAtVolume(NULL, sfx_id, volume);
|
||||
}
|
||||
#endif
|
||||
|
||||
FUNCMATH static inline float AmbientPos(angle_t an)
|
||||
{
|
||||
const fixed_t fm = FixedMul(FLOAT_TO_FIXED(MIN_DISTANCE), FINESINE(an>>ANGLETOFINESHIFT));
|
||||
return FIXED_TO_FLOAT(fm);
|
||||
}
|
||||
|
||||
|
||||
//=============================================================================
|
||||
INT32 HW3S_Init(I_Error_t FatalErrorFunction, snddev_t *snd_dev)
|
||||
{
|
||||
INT32 succ;
|
||||
source3D_data_t source_data;
|
||||
|
||||
if (HW3DS.pfnStartup(FatalErrorFunction, snd_dev))
|
||||
{
|
||||
// Attack source
|
||||
source_data.head_relative = 1;
|
||||
source_data.pos.x = 0.0f;
|
||||
source_data.pos.y = 16.0f;
|
||||
source_data.pos.z = -FIXED_TO_FLOAT(mobjinfo[MT_PLAYER].height >> 1);
|
||||
source_data.pos.momx = 0.0f;
|
||||
source_data.pos.momy = 0.0f;
|
||||
source_data.pos.momz = 0.0f;
|
||||
source_data.min_distance = MIN_DISTANCE;
|
||||
source_data.max_distance = MAX_DISTANCE;
|
||||
source_data.permanent = 1;
|
||||
|
||||
p_attack_source.sfxinfo = NULL;
|
||||
|
||||
M_Memcpy(&p_attack_source2, &p_attack_source, sizeof (source_t));
|
||||
|
||||
p_attack_source.handle = HW3DS.pfnAddSource(&source_data, sfx_None);
|
||||
p_attack_source2.handle = HW3DS.pfnAddSource(&source_data, sfx_None);
|
||||
|
||||
// Scream source
|
||||
source_data.pos.y = 0;
|
||||
source_data.pos.z = 0;
|
||||
|
||||
p_scream_source.sfxinfo = NULL;
|
||||
|
||||
M_Memcpy(&p_scream_source2, &p_scream_source, sizeof (source_t));
|
||||
|
||||
p_scream_source.handle = HW3DS.pfnAddSource(&source_data, sfx_None);
|
||||
p_scream_source2.handle = HW3DS.pfnAddSource(&source_data, sfx_None);
|
||||
|
||||
//FIXED_TO_FLOAT(mobjinfo[MT_PLAYER].height - (5 * FRACUNIT));
|
||||
|
||||
// Ambient sources (left and right) at 210 and 330 degree
|
||||
// relative to listener
|
||||
memset(&ambient_sdata, 0, sizeof (ambient_sdata));
|
||||
|
||||
ambient_sdata.left.head_relative = 1;
|
||||
ambient_sdata.left.pos.x = ambient_sdata.left.pos.y = AmbientPos(ANG210);
|
||||
ambient_sdata.left.max_distance = MAX_DISTANCE;
|
||||
ambient_sdata.left.min_distance = MIN_DISTANCE;
|
||||
|
||||
ambient_sdata.left.permanent = 1;
|
||||
|
||||
M_Memcpy(&ambient_sdata.right, &ambient_sdata.left, sizeof (source3D_data_t));
|
||||
|
||||
ambient_sdata.right.pos.x = -ambient_sdata.left.pos.x;
|
||||
ambient_source.left.handle = HW3DS.pfnAddSource(&ambient_sdata.left, sfx_None);
|
||||
ambient_source.right.handle = HW3DS.pfnAddSource(&ambient_sdata.right, sfx_None);
|
||||
|
||||
succ = p_attack_source.handle > -1 && p_scream_source.handle > -1 &&
|
||||
p_attack_source2.handle > -1 && p_scream_source2.handle > -1 &&
|
||||
ambient_source.left.handle > -1 && ambient_source.right.handle > -1;
|
||||
|
||||
//I_OutputMsg("Player handles: attack %d, default %d\n", p_attack_source.handle, p_scream_source.handle);
|
||||
return succ;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
//=============================================================================
|
||||
INT32 HW3S_GetVersion(void)
|
||||
{
|
||||
return HW3DS.pfnGetHW3DSVersion();
|
||||
}
|
||||
|
||||
|
||||
//=============================================================================
|
||||
void HW3S_BeginFrameUpdate(void)
|
||||
{
|
||||
if (hws_mode != HWS_DEFAULT_MODE)
|
||||
HW3DS.pfnBeginFrameUpdate();
|
||||
}
|
||||
|
||||
|
||||
//=============================================================================
|
||||
void HW3S_EndFrameUpdate(void)
|
||||
{
|
||||
if (hws_mode != HWS_DEFAULT_MODE)
|
||||
HW3DS.pfnEndFrameUpdate();
|
||||
}
|
||||
|
||||
|
||||
|
||||
//=============================================================================
|
||||
INT32 HW3S_SoundIsPlaying(INT32 handle)
|
||||
{
|
||||
return HW3DS.pfnIsPlaying(handle);
|
||||
}
|
||||
|
||||
INT32 HW3S_OriginPlaying(void *origin)
|
||||
{
|
||||
INT32 snum;
|
||||
|
||||
if (!origin)
|
||||
return 0;
|
||||
for (snum = 0; snum < num_sources; snum++)
|
||||
if (sources[snum].origin == origin)
|
||||
return 1;
|
||||
return 0;
|
||||
}
|
||||
|
||||
INT32 HW3S_IdPlaying(sfxenum_t id)
|
||||
{
|
||||
INT32 snum;
|
||||
for (snum = 0; snum < num_sources; snum++)
|
||||
if ((size_t)(sources[snum].sfxinfo - S_sfx) == (size_t)id)
|
||||
return 1;
|
||||
return 0;
|
||||
}
|
||||
|
||||
INT32 HW3S_SoundPlaying(void *origin, sfxenum_t id)
|
||||
{
|
||||
INT32 snum;
|
||||
|
||||
if (!origin)
|
||||
return 0;
|
||||
|
||||
for (snum = 0; snum < num_sources; snum++)
|
||||
{
|
||||
if (sources[snum].origin == origin
|
||||
&& (size_t)(sources[snum].sfxinfo - S_sfx) == (size_t)id)
|
||||
return 1;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
//=============================================================================
|
||||
static void HW3S_UpdateListener(mobj_t *listener)
|
||||
{
|
||||
listener_data_t data;
|
||||
|
||||
if (!listener || !listener->player)
|
||||
return;
|
||||
|
||||
if (camera.chase)
|
||||
{
|
||||
data.x = FIXED_TO_FLOAT(camera.x);
|
||||
data.y = FIXED_TO_FLOAT(camera.y);
|
||||
data.z = FIXED_TO_FLOAT(camera.z + camera.height - (5 * FRACUNIT));
|
||||
|
||||
data.f_angle = ANGLE2DEG(camera.angle);
|
||||
data.h_angle = ANGLE2DEG(camera.aiming);
|
||||
|
||||
data.momx = TPS(FIXED_TO_FLOAT(camera.momx));
|
||||
data.momy = TPS(FIXED_TO_FLOAT(camera.momy));
|
||||
data.momz = TPS(FIXED_TO_FLOAT(camera.momz));
|
||||
}
|
||||
else
|
||||
{
|
||||
data.x = FIXED_TO_FLOAT(listener->x);
|
||||
data.y = FIXED_TO_FLOAT(listener->y);
|
||||
data.z = FIXED_TO_FLOAT(listener->z + listener->height - (5 * FRACUNIT));
|
||||
|
||||
data.f_angle = ANGLE2DEG(listener->angle);
|
||||
data.h_angle = ANGLE2DEG(listener->player->aiming);
|
||||
|
||||
data.momx = TPS(FIXED_TO_FLOAT(listener->momx));
|
||||
data.momy = TPS(FIXED_TO_FLOAT(listener->momy));
|
||||
data.momz = TPS(FIXED_TO_FLOAT(listener->momz));
|
||||
}
|
||||
HW3DS.pfnUpdateListener(&data, 1);
|
||||
}
|
||||
|
||||
static void HW3S_UpdateListener2(mobj_t *listener)
|
||||
{
|
||||
listener_data_t data;
|
||||
|
||||
if (!listener || !listener->player)
|
||||
{
|
||||
HW3DS.pfnUpdateListener(NULL, 2);
|
||||
return;
|
||||
}
|
||||
|
||||
if (camera2.chase)
|
||||
{
|
||||
data.x = FIXED_TO_FLOAT(camera2.x);
|
||||
data.y = FIXED_TO_FLOAT(camera2.y);
|
||||
data.z = FIXED_TO_FLOAT(camera2.z + camera2.height - (5 * FRACUNIT));
|
||||
|
||||
data.f_angle = ANGLE2DEG(camera2.angle);
|
||||
data.h_angle = ANGLE2DEG(camera2.aiming);
|
||||
|
||||
data.momx = TPS(FIXED_TO_FLOAT(camera2.momx));
|
||||
data.momy = TPS(FIXED_TO_FLOAT(camera2.momy));
|
||||
data.momz = TPS(FIXED_TO_FLOAT(camera2.momz));
|
||||
}
|
||||
else
|
||||
{
|
||||
data.x = FIXED_TO_FLOAT(listener->x);
|
||||
data.y = FIXED_TO_FLOAT(listener->y);
|
||||
data.z = FIXED_TO_FLOAT(listener->z + listener->height - (5 * FRACUNIT));
|
||||
|
||||
data.f_angle = ANGLE2DEG(listener->angle);
|
||||
data.h_angle = ANGLE2DEG(listener->player->aiming);
|
||||
|
||||
data.momx = TPS(FIXED_TO_FLOAT(listener->momx));
|
||||
data.momy = TPS(FIXED_TO_FLOAT(listener->momy));
|
||||
data.momz = TPS(FIXED_TO_FLOAT(listener->momz));
|
||||
}
|
||||
|
||||
HW3DS.pfnUpdateListener(&data, 2);
|
||||
}
|
||||
|
||||
void HW3S_SetSfxVolume(INT32 volume)
|
||||
{
|
||||
HW3DS.pfnSetGlobalSfxVolume(volume);
|
||||
}
|
||||
|
||||
|
||||
static void HW3S_Update3DSource(source_t *src)
|
||||
{
|
||||
source3D_data_t data;
|
||||
data.permanent = 0;
|
||||
HW3S_FillSourceParameters(src->origin, &data, src->type);
|
||||
HW3DS.pfnUpdate3DSource(src->handle, &data.pos);
|
||||
|
||||
}
|
||||
|
||||
void HW3S_UpdateSources(void)
|
||||
{
|
||||
mobj_t *listener = players[displayplayers[0]].mo;
|
||||
mobj_t *listener2 = NULL;
|
||||
source_t *src;
|
||||
INT32 audible, snum, volume, sep, pitch;
|
||||
|
||||
if (splitscreen) listener2 = players[displayplayers[1]].mo;
|
||||
|
||||
HW3S_UpdateListener2(listener2);
|
||||
HW3S_UpdateListener(listener);
|
||||
|
||||
for (snum = 0, src = sources; snum < num_sources; src++, snum++)
|
||||
{
|
||||
if (src->sfxinfo)
|
||||
{
|
||||
#if 0
|
||||
if (HW3DS.pfnIsPlaying(src->handle))
|
||||
{
|
||||
if (src->origin)
|
||||
{
|
||||
// initialize parameters
|
||||
volume = 255; // 8 bits internal volume precision
|
||||
pitch = NORM_PITCH;
|
||||
sep = NORM_SEP;
|
||||
|
||||
// check non-local sounds for distance clipping
|
||||
// or modify their params
|
||||
if (src->origin && listener != src->origin && !(listener2 && src->origin == listener2))
|
||||
{
|
||||
INT32 audible2;
|
||||
INT32 volume2 = volume, sep2 = sep, pitch2 = pitch;
|
||||
audible = S_AdjustSoundParams(listener, src->origin, &volume, &sep, &pitch,
|
||||
src->sfxinfo);
|
||||
|
||||
if (listener2)
|
||||
{
|
||||
audible2 = S_AdjustSoundParams(listener2,
|
||||
src->origin, &volume2, &sep2, &pitch2, src->sfxinfo);
|
||||
if (audible2 && (!audible || (audible && volume2 > volume)))
|
||||
{
|
||||
audible = true;
|
||||
volume = volume2;
|
||||
sep = sep2;
|
||||
pitch = pitch2;
|
||||
}
|
||||
}
|
||||
|
||||
if (audible)
|
||||
HW3S_Update3DSource(src); // Update positional sources
|
||||
else
|
||||
HW3S_KillSource(snum); //Kill it!
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
// Source allocated but stopped. Kill.
|
||||
HW3S_KillSource(snum);
|
||||
}
|
||||
#else
|
||||
if (src->origin && listener != src->origin && !(listener2 && src->origin == listener2))
|
||||
HW3S_Update3DSource(src); // Update positional sources
|
||||
(void)pitch;
|
||||
(void)sep;
|
||||
(void)volume;
|
||||
(void)audible;
|
||||
#endif
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void HW3S_Shutdown(void)
|
||||
{
|
||||
HW3DS.pfnShutdown();
|
||||
}
|
||||
|
||||
void *HW3S_GetSfx(sfxinfo_t *sfx)
|
||||
{
|
||||
sfx_data_t sfx_data;
|
||||
|
||||
if (sfx->lumpnum == LUMPERROR)
|
||||
sfx->lumpnum = S_GetSfxLumpNum (sfx);
|
||||
|
||||
sfx_data.length = W_LumpLength(sfx->lumpnum);
|
||||
sfx_data.data = Z_Malloc(sfx_data.length, PU_SOUND, &sfx->data);
|
||||
W_ReadLump(sfx->lumpnum, sfx_data.data);
|
||||
sfx_data.priority = sfx->priority;
|
||||
|
||||
sfx->length = HW3DS.pfnAddSfx(&sfx_data);
|
||||
|
||||
Z_ChangeTag(sfx->data, PU_CACHE);
|
||||
|
||||
return sfx_data.data;
|
||||
}
|
||||
|
||||
void HW3S_FreeSfx(sfxinfo_t *sfx)
|
||||
{
|
||||
INT32 snum;
|
||||
|
||||
for (snum = 0; snum < num_sources; snum++)
|
||||
{
|
||||
if (sources[snum].sfxinfo == sfx)
|
||||
{
|
||||
HW3S_KillSource(snum);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if (sfx->length > 0)
|
||||
HW3DS.pfnKillSfx((u_int)sfx->length);
|
||||
sfx->length = 0;
|
||||
|
||||
sfx->lumpnum = LUMPERROR;
|
||||
|
||||
Z_Free(sfx->data);
|
||||
sfx->data = NULL;
|
||||
}
|
||||
|
||||
#endif
|
||||
@@ -1,106 +0,0 @@
|
||||
// Emacs style mode select -*- C++ -*-
|
||||
//-----------------------------------------------------------------------------
|
||||
//
|
||||
// Copyright (C) 2001 by DooM Legacy Team.
|
||||
//
|
||||
// This program is free software; you can redistribute it and/or
|
||||
// modify it under the terms of the GNU General Public License
|
||||
// as published by the Free Software Foundation; either version 2
|
||||
// of the License, or (at your option) any later version.
|
||||
//
|
||||
// This program is distributed in the hope that it will be useful,
|
||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
// GNU General Public License for more details.
|
||||
//
|
||||
//-----------------------------------------------------------------------------
|
||||
/// \file
|
||||
/// \brief High-level functions of hardware 3D sound
|
||||
|
||||
#ifndef __HW3_SOUND_H__
|
||||
#define __HW3_SOUND_H__
|
||||
|
||||
#ifdef HW3SOUND
|
||||
#include "hws_data.h"
|
||||
//#include "../s_sound.h"
|
||||
//#include "../p_mobj.h"
|
||||
|
||||
// Default sound mode (original stereo mode)
|
||||
enum
|
||||
{
|
||||
HWS_DEFAULT_MODE = 0,
|
||||
HWS_DS3D,
|
||||
HWS_OTHER,
|
||||
HWS_FMOD3D,
|
||||
HWS_OPENAL,
|
||||
};
|
||||
|
||||
typedef enum
|
||||
{
|
||||
CT_NORMAL = 0,
|
||||
CT_ATTACK,
|
||||
CT_SCREAM,
|
||||
CT_AMBIENT,
|
||||
} channel_type_t;
|
||||
|
||||
extern INT32 hws_mode; // Current sound mode
|
||||
|
||||
#if defined (HW3DS) || defined (DOXYGEN)
|
||||
INT32 HW3S_Init(I_Error_t FatalErrorFunction, snddev_t *snd_dev);
|
||||
#endif
|
||||
void HW3S_Shutdown(void);
|
||||
INT32 HW3S_GetVersion(void);
|
||||
|
||||
// Common case - start 3D or 2D source
|
||||
void HW3S_StartSound(const void *origin, sfxenum_t sfx_id);
|
||||
|
||||
// Special cases of 3D sources
|
||||
void S_StartAmbientSound(sfxenum_t sfx_id, INT32 volume);
|
||||
void S_StartAttackSound(const void *origin, sfxenum_t sfx_id);
|
||||
void S_StartScreamSound(const void *origin, sfxenum_t sfx_id);
|
||||
|
||||
// Starts 3D sound with specified parameters
|
||||
// origin - for object movement tracking. NULL are possible value (no movement tracking)
|
||||
// source_parm - 3D source parameters (position etc.)
|
||||
// cone_parm - 3D source cone parameters. NULL are possible value (default cone will be used)
|
||||
// channel -
|
||||
// sfx_id - sfx id
|
||||
// vol - sound volume
|
||||
// pitch - sound pitching value
|
||||
// Returns: - sound id
|
||||
INT32 HW3S_I_StartSound(const void *origin, source3D_data_t *source_parm, channel_type_t channel, sfxenum_t sfx_id, INT32 vol, INT32 pitch, INT32 sep);
|
||||
void HW3S_StopSoundByID(void *origin, sfxenum_t sfx_id);
|
||||
void HW3S_StopSoundByNum(sfxenum_t sfxnum);
|
||||
void HW3S_StopSound(void *origin);
|
||||
void HW3S_StopSounds(void);
|
||||
|
||||
void HW3S_BeginFrameUpdate(void);
|
||||
void HW3S_EndFrameUpdate(void);
|
||||
|
||||
void HW3S_UpdateSources(void);
|
||||
|
||||
void HW3S_SetSfxVolume(INT32 volume);
|
||||
|
||||
// Utility functions
|
||||
INT32 HW3S_SoundIsPlaying(INT32 handle);
|
||||
void HW3S_SetSourcesNum(void);
|
||||
|
||||
INT32 HW3S_OriginPlaying(void *origin);
|
||||
INT32 HW3S_IdPlaying(sfxenum_t id);
|
||||
INT32 HW3S_SoundPlaying(void *origin, sfxenum_t id);
|
||||
|
||||
void *HW3S_GetSfx(sfxinfo_t *sfx);
|
||||
void HW3S_FreeSfx(sfxinfo_t *sfx);
|
||||
|
||||
#else // HW3SOUND
|
||||
|
||||
//#define S_StartAmbientSound(i,v) S_StartSoundAtVolume(NULL, i, v)
|
||||
#define S_StartAttackSound S_StartSound
|
||||
#define S_StartScreamSound S_StartSound
|
||||
|
||||
#endif // HW3SOUND
|
||||
|
||||
INT32 S_AdjustSoundParams(const mobj_t *listener, const mobj_t *source,
|
||||
INT32 *vol, INT32 *sep, INT32 *pitch, sfxinfo_t *sfxinfo);
|
||||
|
||||
#endif // __HW3_SOUND_H__
|
||||
+129
-117
@@ -15,8 +15,9 @@
|
||||
#include "hw_main.h"
|
||||
#include "../i_system.h"
|
||||
|
||||
#include "../qs22j.h"
|
||||
#include "../doomdef.h"
|
||||
|
||||
#include "../qs22j.h"
|
||||
|
||||
// The texture for the next polygon given to HWR_ProcessPolygon.
|
||||
// Set with HWR_SetCurrentTexture.
|
||||
@@ -35,7 +36,7 @@ int finalVertexArrayAllocSize = 65536;
|
||||
|
||||
PolygonArrayEntry* polygonArray = NULL;// contains the polygon data from DrawPolygon, waiting to be processed
|
||||
int polygonArraySize = 0;
|
||||
UINT32* polygonIndexArray = NULL;// contains sorting pointers for polygonArray
|
||||
PolygonArrayEntry **polygonArraySorted = NULL;// contains sorted pointers to polygonArray
|
||||
int polygonArrayAllocSize = 65536;
|
||||
|
||||
FOutVector* unsortedVertexArray = NULL;// contains unsorted vertices and texture coordinates from DrawPolygon
|
||||
@@ -46,35 +47,37 @@ int unsortedVertexArrayAllocSize = 65536;
|
||||
// Call HWR_RenderBatches to render all the collected geometry.
|
||||
void HWR_StartBatching(void)
|
||||
{
|
||||
if (currently_batching)
|
||||
I_Error("Repeat call to HWR_StartBatching without HWR_RenderBatches");
|
||||
if (currently_batching)
|
||||
{
|
||||
I_Error("Repeat call to HWR_StartBatching without HWR_RenderBatches");
|
||||
}
|
||||
|
||||
// init arrays if that has not been done yet
|
||||
// init arrays if that has not been done yet
|
||||
if (!finalVertexArray)
|
||||
{
|
||||
finalVertexArray = malloc(finalVertexArrayAllocSize * sizeof(FOutVector));
|
||||
finalVertexIndexArray = malloc(finalVertexArrayAllocSize * 3 * sizeof(UINT32));
|
||||
polygonArray = malloc(polygonArrayAllocSize * sizeof(PolygonArrayEntry));
|
||||
polygonIndexArray = malloc(polygonArrayAllocSize * sizeof(UINT32));
|
||||
polygonArraySorted = malloc(polygonArrayAllocSize * sizeof(PolygonArrayEntry *));
|
||||
unsortedVertexArray = malloc(unsortedVertexArrayAllocSize * sizeof(FOutVector));
|
||||
}
|
||||
|
||||
currently_batching = true;
|
||||
currently_batching = true;
|
||||
}
|
||||
|
||||
// This replaces the direct calls to pfnSetTexture in cases where batching is available.
|
||||
// This replaces the direct calls to GL_SetTexture in cases where batching is available.
|
||||
// The texture selection is saved for the next HWR_ProcessPolygon call.
|
||||
// Doing this was easier than getting a texture pointer to HWR_ProcessPolygon.
|
||||
void HWR_SetCurrentTexture(GLMipmap_t *texture)
|
||||
{
|
||||
if (currently_batching)
|
||||
{
|
||||
current_texture = texture;
|
||||
}
|
||||
else
|
||||
{
|
||||
HWD.pfnSetTexture(texture);
|
||||
}
|
||||
if (currently_batching)
|
||||
{
|
||||
current_texture = texture;
|
||||
}
|
||||
else
|
||||
{
|
||||
GL_SetTexture(texture);
|
||||
}
|
||||
}
|
||||
|
||||
// If batching is enabled, this function collects the polygon data and the chosen texture
|
||||
@@ -82,10 +85,13 @@ void HWR_SetCurrentTexture(GLMipmap_t *texture)
|
||||
// render the polygon immediately.
|
||||
void HWR_ProcessPolygon(FSurfaceInfo *pSurf, FOutVector *pOutVerts, FUINT iNumPts, FBITFIELD PolyFlags, int shader_target, boolean horizonSpecial)
|
||||
{
|
||||
if (currently_batching)
|
||||
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;
|
||||
@@ -96,8 +102,8 @@ void HWR_ProcessPolygon(FSurfaceInfo *pSurf, FOutVector *pOutVerts, FUINT iNumPt
|
||||
free(polygonArray);
|
||||
polygonArray = new_array;
|
||||
// also need to redo the index array, dont need to copy it though
|
||||
free(polygonIndexArray);
|
||||
polygonIndexArray = malloc(polygonArrayAllocSize * sizeof(UINT32));
|
||||
free(polygonArraySorted);
|
||||
polygonArraySorted = malloc(polygonArrayAllocSize * sizeof(PolygonArrayEntry *));
|
||||
}
|
||||
|
||||
while (unsortedVertexArraySize + (int)iNumPts > unsortedVertexArrayAllocSize)
|
||||
@@ -127,40 +133,30 @@ void HWR_ProcessPolygon(FSurfaceInfo *pSurf, FOutVector *pOutVerts, FUINT iNumPt
|
||||
}
|
||||
else
|
||||
{
|
||||
HWD.pfnSetShader((shader_target != SHADER_NONE) ? HWR_GetShaderFromTarget(shader_target) : shader_target);
|
||||
HWD.pfnDrawPolygon(pSurf, pOutVerts, iNumPts, PolyFlags);
|
||||
GL_SetShader((shader_target != SHADER_NONE) ? HWR_GetShaderFromTarget(shader_target) : shader_target);
|
||||
GL_DrawPolygon(pSurf, pOutVerts, iNumPts, PolyFlags);
|
||||
}
|
||||
}
|
||||
|
||||
static int comparePolygons(const void *p1, const void *p2)
|
||||
{
|
||||
unsigned int index1 = *(const unsigned int*)p1;
|
||||
unsigned int index2 = *(const unsigned int*)p2;
|
||||
PolygonArrayEntry* poly1 = &polygonArray[index1];
|
||||
PolygonArrayEntry* poly2 = &polygonArray[index2];
|
||||
PolygonArrayEntry *poly1 = *(PolygonArrayEntry *const *)p1;
|
||||
PolygonArrayEntry *poly2 = *(PolygonArrayEntry *const *)p2;
|
||||
int diff;
|
||||
INT64 diff64;
|
||||
UINT32 downloaded1 = 0;
|
||||
UINT32 downloaded2 = 0;
|
||||
|
||||
int shader1 = poly1->shader;
|
||||
int shader2 = poly2->shader;
|
||||
// make skywalls and horizon lines first in order
|
||||
if (poly1->polyFlags & PF_NoTexture || poly1->horizonSpecial)
|
||||
shader1 = -1;
|
||||
if (poly2->polyFlags & PF_NoTexture || poly2->horizonSpecial)
|
||||
shader2 = -1;
|
||||
diff = shader1 - shader2;
|
||||
if (diff != 0) return diff;
|
||||
int shader1 = (poly1->polyFlags & PF_NoTexture || poly1->horizonSpecial) ? -1 : poly1->shader;
|
||||
int shader2 = (poly2->polyFlags & PF_NoTexture || poly2->horizonSpecial) ? -1 : poly2->shader;
|
||||
|
||||
// skywalls and horizon lines must retain their order for horizon lines to work
|
||||
if (shader1 == -1 && shader2 == -1)
|
||||
return index1 - index2;
|
||||
return poly1 - poly2;
|
||||
|
||||
if (poly1->texture)
|
||||
downloaded1 = poly1->texture->downloaded; // there should be a opengl texture name here, usable for comparisons
|
||||
if (poly2->texture)
|
||||
downloaded2 = poly2->texture->downloaded;
|
||||
diff = shader1 - shader2;
|
||||
if (diff != 0) return diff;
|
||||
|
||||
UINT32 downloaded1 = poly1->texture ? poly1->texture->downloaded : 0; // there should be a opengl texture name here, usable for comparisons
|
||||
UINT32 downloaded2 = poly2->texture ? poly2->texture->downloaded : 0;
|
||||
diff64 = downloaded1 - downloaded2;
|
||||
if (diff64 != 0) return diff64;
|
||||
|
||||
@@ -179,33 +175,29 @@ static int comparePolygons(const void *p1, const void *p2)
|
||||
diff = poly1->surf.LightInfo.fade_start - poly2->surf.LightInfo.fade_start;
|
||||
if (diff != 0) return diff;
|
||||
diff = poly1->surf.LightInfo.fade_end - poly2->surf.LightInfo.fade_end;
|
||||
if (diff != 0) return diff;
|
||||
|
||||
diff = poly1->surf.LightInfo.directional - poly2->surf.LightInfo.directional;
|
||||
|
||||
return diff;
|
||||
}
|
||||
|
||||
static int comparePolygonsNoShaders(const void *p1, const void *p2)
|
||||
{
|
||||
unsigned int index1 = *(const unsigned int*)p1;
|
||||
unsigned int index2 = *(const unsigned int*)p2;
|
||||
PolygonArrayEntry* poly1 = &polygonArray[index1];
|
||||
PolygonArrayEntry* poly2 = &polygonArray[index2];
|
||||
PolygonArrayEntry *poly1 = *(PolygonArrayEntry *const *)p1;
|
||||
PolygonArrayEntry *poly2 = *(PolygonArrayEntry *const *)p2;
|
||||
int diff;
|
||||
INT64 diff64;
|
||||
|
||||
GLMipmap_t *texture1 = poly1->texture;
|
||||
GLMipmap_t *texture2 = poly2->texture;
|
||||
UINT32 downloaded1 = 0;
|
||||
UINT32 downloaded2 = 0;
|
||||
if (poly1->polyFlags & PF_NoTexture || poly1->horizonSpecial)
|
||||
texture1 = NULL;
|
||||
if (poly2->polyFlags & PF_NoTexture || poly2->horizonSpecial)
|
||||
texture2 = NULL;
|
||||
if (texture1)
|
||||
downloaded1 = texture1->downloaded; // there should be a opengl texture name here, usable for comparisons
|
||||
if (texture2)
|
||||
downloaded2 = texture2->downloaded;
|
||||
GLMipmap_t *texture1 = (poly1->polyFlags & PF_NoTexture || poly1->horizonSpecial) ? NULL : poly1->texture;
|
||||
GLMipmap_t *texture2 = (poly2->polyFlags & PF_NoTexture || poly2->horizonSpecial) ? NULL : poly2->texture;
|
||||
|
||||
// skywalls and horizon lines must retain their order for horizon lines to work
|
||||
if (!texture1 && !texture2)
|
||||
return index1 - index2;
|
||||
return poly1 - poly2;
|
||||
|
||||
UINT32 downloaded1 = texture1 ? texture1->downloaded : 0; // there should be a opengl texture name here, usable for comparisons
|
||||
UINT32 downloaded2 = texture2 ? texture2->downloaded : 0;
|
||||
diff64 = downloaded1 - downloaded2;
|
||||
if (diff64 != 0) return diff64;
|
||||
|
||||
@@ -222,14 +214,14 @@ static int comparePolygonsNoShaders(const void *p1, const void *p2)
|
||||
// the rendering backend to draw them.
|
||||
void HWR_RenderBatches(void)
|
||||
{
|
||||
int finalVertexWritePos = 0;// position in finalVertexArray
|
||||
int finalVertexWritePos = 0;// position in finalVertexArray
|
||||
int finalIndexWritePos = 0;// position in finalVertexIndexArray
|
||||
|
||||
int polygonReadPos = 0;// position in polygonIndexArray
|
||||
int polygonReadPos = 0;// position in polygonArraySorted
|
||||
|
||||
int currentShader;
|
||||
int nextShader = 0;
|
||||
GLMipmap_t *currentTexture;
|
||||
GLMipmap_t *currentTexture = NULL;
|
||||
GLMipmap_t *nextTexture = NULL;
|
||||
FBITFIELD currentPolyFlags = 0;
|
||||
FBITFIELD nextPolyFlags = 0;
|
||||
@@ -238,14 +230,18 @@ void HWR_RenderBatches(void)
|
||||
|
||||
int i;
|
||||
|
||||
if (!currently_batching)
|
||||
if (!currently_batching)
|
||||
{
|
||||
I_Error("HWR_RenderBatches called without starting batching");
|
||||
}
|
||||
|
||||
nextSurfaceInfo.LightInfo.fade_end = 0;
|
||||
nextSurfaceInfo.LightInfo.fade_start = 0;
|
||||
nextSurfaceInfo.LightInfo.light_level = 0;
|
||||
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
|
||||
@@ -253,24 +249,27 @@ 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;
|
||||
ps_hw_numshaders.value.i = ps_hw_numtextures.value.i
|
||||
= ps_hw_numpolyflags.value.i = ps_hw_numcolors.value.i = 1;
|
||||
// init polygonIndexArray
|
||||
|
||||
// init polygonArraySorted
|
||||
for (i = 0; i < polygonArraySize; i++)
|
||||
{
|
||||
polygonIndexArray[i] = i;
|
||||
polygonArraySorted[i] = &polygonArray[i];
|
||||
}
|
||||
|
||||
// sort polygons
|
||||
PS_START_TIMING(ps_hw_batchsorttime);
|
||||
if (cv_grshaders.value && gr_shadersavailable)
|
||||
qs22j(polygonIndexArray, polygonArraySize, sizeof(unsigned int), comparePolygons);
|
||||
if (cv_glshaders.value && gl_shadersavailable)
|
||||
qs22j(polygonArraySorted, polygonArraySize, sizeof(PolygonArrayEntry *), comparePolygons);
|
||||
else
|
||||
qs22j(polygonIndexArray, polygonArraySize, sizeof(unsigned int), comparePolygonsNoShaders);
|
||||
qs22j(polygonArraySorted, polygonArraySize, sizeof(PolygonArrayEntry *), comparePolygonsNoShaders);
|
||||
PS_STOP_TIMING(ps_hw_batchsorttime);
|
||||
|
||||
// sort order
|
||||
// 1. shader
|
||||
// 2. texture
|
||||
@@ -280,26 +279,26 @@ void HWR_RenderBatches(void)
|
||||
|
||||
PS_START_TIMING(ps_hw_batchdrawtime);
|
||||
|
||||
currentShader = polygonArray[polygonIndexArray[0]].shader;
|
||||
currentTexture = polygonArray[polygonIndexArray[0]].texture;
|
||||
currentPolyFlags = polygonArray[polygonIndexArray[0]].polyFlags;
|
||||
currentSurfaceInfo = polygonArray[polygonIndexArray[0]].surf;
|
||||
currentShader = polygonArraySorted[0]->shader;
|
||||
currentTexture = polygonArraySorted[0]->texture;
|
||||
currentPolyFlags = polygonArraySorted[0]->polyFlags;
|
||||
currentSurfaceInfo = polygonArraySorted[0]->surf;
|
||||
// For now, will sort and track the colors. Vertex attributes could be used instead of uniforms
|
||||
// and a color array could replace the color calls.
|
||||
|
||||
// set state for first batch
|
||||
|
||||
if (cv_grshaders.value && gr_shadersavailable)
|
||||
if (cv_glshaders.value && gl_shadersavailable)
|
||||
{
|
||||
HWD.pfnSetShader(currentShader);
|
||||
GL_SetShader(currentShader);
|
||||
}
|
||||
|
||||
if (currentPolyFlags & PF_NoTexture)
|
||||
currentTexture = NULL;
|
||||
else
|
||||
HWD.pfnSetTexture(currentTexture);
|
||||
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;
|
||||
@@ -322,8 +321,8 @@ void HWR_RenderBatches(void)
|
||||
// reset write pos
|
||||
// repeat loop
|
||||
|
||||
int index = polygonIndexArray[polygonReadPos++];
|
||||
int numVerts = polygonArray[index].numVerts;
|
||||
PolygonArrayEntry *entry = polygonArraySorted[polygonReadPos++];
|
||||
int numVerts = entry->numVerts;
|
||||
// before writing, check if there is enough room
|
||||
// using 'while' instead of 'if' here makes sure that there will *always* be enough room.
|
||||
// probably never will this loop run more than once though
|
||||
@@ -344,7 +343,7 @@ void HWR_RenderBatches(void)
|
||||
finalVertexIndexArray = new_index_array;
|
||||
}
|
||||
// write the vertices of the polygon
|
||||
memcpy(&finalVertexArray[finalVertexWritePos], &unsortedVertexArray[polygonArray[index].vertsIndex],
|
||||
memcpy(&finalVertexArray[finalVertexWritePos], &unsortedVertexArray[entry->vertsIndex],
|
||||
numVerts * sizeof(FOutVector));
|
||||
// write the indexes, pointing to the fan vertexes but in triangles format
|
||||
firstIndex = finalVertexWritePos;
|
||||
@@ -364,36 +363,42 @@ void HWR_RenderBatches(void)
|
||||
else
|
||||
{
|
||||
// check if a state change is required, set the change bools and next vars
|
||||
int nextIndex = polygonIndexArray[polygonReadPos];
|
||||
nextShader = polygonArray[nextIndex].shader;
|
||||
nextTexture = polygonArray[nextIndex].texture;
|
||||
nextPolyFlags = polygonArray[nextIndex].polyFlags;
|
||||
nextSurfaceInfo = polygonArray[nextIndex].surf;
|
||||
PolygonArrayEntry *nextEntry = polygonArraySorted[polygonReadPos];
|
||||
nextShader = nextEntry->shader;
|
||||
nextTexture = nextEntry->texture;
|
||||
nextPolyFlags = nextEntry->polyFlags;
|
||||
nextSurfaceInfo = nextEntry->surf;
|
||||
|
||||
if (nextPolyFlags & PF_NoTexture)
|
||||
nextTexture = 0;
|
||||
if (currentShader != nextShader && cv_grshaders.value && gr_shadersavailable)
|
||||
|
||||
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_grshaders.value && gr_shadersavailable)
|
||||
|
||||
if (cv_glshaders.value && gl_shadersavailable)
|
||||
{
|
||||
if (currentSurfaceInfo.PolyColor.rgba != nextSurfaceInfo.PolyColor.rgba ||
|
||||
currentSurfaceInfo.TintColor.rgba != nextSurfaceInfo.TintColor.rgba ||
|
||||
currentSurfaceInfo.FadeColor.rgba != nextSurfaceInfo.FadeColor.rgba ||
|
||||
currentSurfaceInfo.LightInfo.light_level != nextSurfaceInfo.LightInfo.light_level ||
|
||||
currentSurfaceInfo.LightInfo.fade_start != nextSurfaceInfo.LightInfo.fade_start ||
|
||||
currentSurfaceInfo.LightInfo.fade_end != nextSurfaceInfo.LightInfo.fade_end)
|
||||
currentSurfaceInfo.LightInfo.fade_end != nextSurfaceInfo.LightInfo.fade_end ||
|
||||
currentSurfaceInfo.LightInfo.directional != nextSurfaceInfo.LightInfo.directional)
|
||||
{
|
||||
changeState = true;
|
||||
changeSurfaceInfo = true;
|
||||
@@ -412,7 +417,7 @@ void HWR_RenderBatches(void)
|
||||
if (changeState || stopFlag)
|
||||
{
|
||||
// execute draw call
|
||||
HWD.pfnDrawIndexedTriangles(¤tSurfaceInfo, finalVertexArray, finalIndexWritePos, currentPolyFlags, finalVertexIndexArray);
|
||||
GL_DrawIndexedTriangles(¤tSurfaceInfo, finalVertexArray, finalIndexWritePos, currentPolyFlags, finalVertexIndexArray);
|
||||
// update stats
|
||||
ps_hw_numcalls.value.i++;
|
||||
ps_hw_numverts.value.i += finalIndexWritePos;
|
||||
@@ -420,44 +425,52 @@ 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 (changeShader)
|
||||
if (changeState)
|
||||
{
|
||||
HWD.pfnSetShader(nextShader);
|
||||
currentShader = nextShader;
|
||||
changeShader = false;
|
||||
if (changeShader)
|
||||
{
|
||||
GL_SetShader(nextShader);
|
||||
currentShader = nextShader;
|
||||
changeShader = false;
|
||||
|
||||
ps_hw_numshaders.value.i++;
|
||||
}
|
||||
if (changeTexture)
|
||||
{
|
||||
// texture should be already ready for use from calls to SetTexture during batch collection
|
||||
HWD.pfnSetTexture(nextTexture);
|
||||
currentTexture = nextTexture;
|
||||
changeTexture = false;
|
||||
ps_hw_numshaders.value.i++;
|
||||
}
|
||||
|
||||
ps_hw_numtextures.value.i++;
|
||||
}
|
||||
if (changePolyFlags)
|
||||
{
|
||||
currentPolyFlags = nextPolyFlags;
|
||||
changePolyFlags = false;
|
||||
if (changeTexture)
|
||||
{
|
||||
// texture should be already ready for use from calls to GL_SetTexture during batch collection
|
||||
GL_SetTexture(nextTexture);
|
||||
currentTexture = nextTexture;
|
||||
changeTexture = false;
|
||||
|
||||
ps_hw_numpolyflags.value.i++;
|
||||
}
|
||||
if (changeSurfaceInfo)
|
||||
{
|
||||
currentSurfaceInfo = nextSurfaceInfo;
|
||||
changeSurfaceInfo = false;
|
||||
ps_hw_numtextures.value.i++;
|
||||
}
|
||||
|
||||
ps_hw_numcolors.value.i++;
|
||||
if (changePolyFlags)
|
||||
{
|
||||
currentPolyFlags = nextPolyFlags;
|
||||
changePolyFlags = false;
|
||||
|
||||
ps_hw_numpolyflags.value.i++;
|
||||
}
|
||||
|
||||
if (changeSurfaceInfo)
|
||||
{
|
||||
currentSurfaceInfo = nextSurfaceInfo;
|
||||
changeSurfaceInfo = false;
|
||||
|
||||
ps_hw_numcolors.value.i++;
|
||||
}
|
||||
// and that should be it?
|
||||
}
|
||||
// and that should be it?
|
||||
}
|
||||
// reset the arrays (set sizes to 0)
|
||||
polygonArraySize = 0;
|
||||
@@ -466,5 +479,4 @@ void HWR_RenderBatches(void)
|
||||
PS_STOP_TIMING(ps_hw_batchdrawtime);
|
||||
}
|
||||
|
||||
|
||||
#endif // HWRENDER
|
||||
@@ -15,9 +15,11 @@
|
||||
|
||||
#include "hw_defs.h"
|
||||
#include "hw_data.h"
|
||||
#include "hw_drv.h"
|
||||
#include "hw_gl.h"
|
||||
|
||||
typedef struct
|
||||
extern boolean currently_batching;
|
||||
|
||||
typedef struct
|
||||
{
|
||||
FSurfaceInfo surf;// surf also has its own polyflags for some reason, but it seems unused
|
||||
unsigned int vertsIndex;// location of verts in unsortedVertexArray
|
||||
|
||||
+29
-19
@@ -46,7 +46,7 @@ typedef struct
|
||||
|
||||
// when loading the map, this is set to true if portals are found.
|
||||
// if no portals are found, the portal scanning phase can be skipped while rendering, saving a bit of time.
|
||||
boolean gr_maphasportals = false;
|
||||
boolean gl_maphasportals = false;
|
||||
|
||||
// ==========================================================================
|
||||
// FLOOR & CEILING CONVEX POLYS GENERATION
|
||||
@@ -369,18 +369,18 @@ 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 (!gr_maphasportals && line->special == 40 && lseg->side == 0)
|
||||
if (!gl_maphasportals && line->special == 40 && lseg->side == 0)
|
||||
{
|
||||
// Find the other side!
|
||||
INT32 line2 = P_FindSpecialLineFromTag(40, line->tag, -1);
|
||||
if (line == &lines[line2])
|
||||
line2 = P_FindSpecialLineFromTag(40, line->tag, line2);
|
||||
if (line2 >= 0) // found it!
|
||||
gr_maphasportals = 1;
|
||||
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);
|
||||
@@ -667,9 +667,15 @@ static boolean PointInSeg(polyvertex_t *a,polyvertex_t *v1,polyvertex_t *v2)
|
||||
// v1 = origine
|
||||
ax= v2->x-v1->x;
|
||||
ay= v2->y-v1->y;
|
||||
norm = (float)hypot(ax, ay);
|
||||
ax /= norm;
|
||||
ay /= norm;
|
||||
norm = hypotf(ax, ay);
|
||||
#pragma GCC diagnostic push
|
||||
#pragma GCC diagnostic ignored "-Wfloat-equal"
|
||||
if (norm != 0) // yes, this can be exactly 0
|
||||
#pragma GCC diagnostic pop
|
||||
{
|
||||
ax /= norm;
|
||||
ay /= norm;
|
||||
}
|
||||
bx = a->x-v1->x;
|
||||
by = a->y-v1->y;
|
||||
//d = a.b
|
||||
@@ -762,7 +768,7 @@ static INT32 SolveTProblem(void)
|
||||
INT32 i;
|
||||
size_t l;
|
||||
|
||||
if (cv_grsolvetjoin.value == 0)
|
||||
if (cv_glsolvetjoin.value == 0)
|
||||
return 0;
|
||||
|
||||
CONS_Debug(DBG_RENDER, "Solving T-joins. This may take a while. Please wait...\n");
|
||||
@@ -772,9 +778,11 @@ static INT32 SolveTProblem(void)
|
||||
for (l = 0; l < addsubsector; l++)
|
||||
{
|
||||
p = extrasubsectors[l].planepoly;
|
||||
if (p)
|
||||
for (i = 0; i < p->numpts; i++)
|
||||
SearchSegInBSP((INT32)numnodes-1, &p->pts[i], p);
|
||||
if (!p)
|
||||
continue;
|
||||
|
||||
for (i = 0; i < p->numpts; i++)
|
||||
SearchSegInBSP((INT32)numnodes-1, &p->pts[i], p);
|
||||
}
|
||||
//CONS_Debug(DBG_RENDER, "numsplitpoly %d\n", numsplitpoly);
|
||||
return numsplitpoly;
|
||||
@@ -802,8 +810,10 @@ static void AdjustSegs(void)
|
||||
count = subsectors[i].numlines;
|
||||
lseg = &segs[subsectors[i].firstline];
|
||||
p = extrasubsectors[i].planepoly;
|
||||
//if (!p)
|
||||
//continue;
|
||||
|
||||
if (!p)
|
||||
continue;
|
||||
|
||||
for (; count--; lseg++)
|
||||
{
|
||||
float distv1,distv2,tmp;
|
||||
@@ -895,7 +905,7 @@ void HWR_CreatePlanePolygons(INT32 bspnum)
|
||||
#endif
|
||||
|
||||
// reset the portal flag
|
||||
gr_maphasportals = 0;
|
||||
gl_maphasportals = 0;
|
||||
|
||||
// find min/max boundaries of map
|
||||
//CONS_Debug(DBG_RENDER, "Looking for boundaries of map...\n");
|
||||
@@ -913,9 +923,9 @@ void HWR_CreatePlanePolygons(INT32 bspnum)
|
||||
I_Error("couldn't malloc extrasubsectors totsubsectors %s\n", sizeu1(totsubsectors));
|
||||
|
||||
// allocate table for back to front drawing of subsectors
|
||||
/*gr_drawsubsectors = (INT16 *)malloc(sizeof (*gr_drawsubsectors) * totsubsectors);
|
||||
if (!gr_drawsubsectors)
|
||||
I_Error("couldn't malloc gr_drawsubsectors\n");*/
|
||||
/*gl_drawsubsectors = (INT16 *)malloc(sizeof (*gl_drawsubsectors) * totsubsectors);
|
||||
if (!gl_drawsubsectors)
|
||||
I_Error("couldn't malloc gl_drawsubsectors\n");*/
|
||||
|
||||
// number of the first new subsector that might be added
|
||||
addsubsector = numsubsectors;
|
||||
|
||||
+639
-296
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;
|
||||
@@ -333,20 +331,20 @@ angle_t gld_FrustumAngle(angle_t tiltangle)
|
||||
|
||||
// ok, this is a gross hack that barely works...
|
||||
// but at least it doesn't overestimate too much...
|
||||
clipfov = atan(1 / projMatrix[0]) * 360 / M_PI;
|
||||
clipfov = atan(1 / projMatrix[0]) * 360.0f / M_PIl;
|
||||
floatangle = 2.0f + (45.0f + (tilt / 1.9f)) * clipfov / 90.0f;
|
||||
if (floatangle >= 180.0)
|
||||
return 0xffffffff;
|
||||
a1 = ANG1 * (int)floatangle;
|
||||
a1 = (angle_t)xs_CRoundToInt(ANG1 * floatangle);
|
||||
return a1;
|
||||
}
|
||||
|
||||
|
||||
// SRB2CB I don't think used any of this stuff, let's disable for now since SRB2 probably doesn't want it either
|
||||
// compiler complains about (p)glGetFloatv anyway, in case anyone wants this
|
||||
// only r_opengl.c can use the base gl funcs as it turns out, that's a problem for whoever wants sphere frustum checks
|
||||
// btw to renable define HAVE_SPHEREFRUSTRUM in hw_clip.h
|
||||
#ifdef HAVE_SPHEREFRUSTRUM
|
||||
|
||||
//
|
||||
// gld_FrustumSetup
|
||||
//
|
||||
@@ -458,4 +456,4 @@ boolean gld_SphereInFrustum(float x, float y, float z, float radius)
|
||||
}
|
||||
return true;
|
||||
}
|
||||
#endif
|
||||
#endif
|
||||
+29
-34
@@ -23,63 +23,58 @@
|
||||
|
||||
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;
|
||||
|
||||
// data holds the address of the graphics data cached in heap memory
|
||||
// NULL if the texture is not in Doom heap cache.
|
||||
// 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
|
||||
{
|
||||
GLTextureFormat_t format;
|
||||
void *data;
|
||||
// for UpdateTexture
|
||||
GLTextureFormat_t format;
|
||||
void *data;
|
||||
|
||||
UINT32 flags;
|
||||
UINT16 width, height;
|
||||
UINT32 downloaded; // tex_downloaded
|
||||
UINT32 flags;
|
||||
UINT16 width, height;
|
||||
UINT32 downloaded; // The GPU has this texture.
|
||||
|
||||
struct GLMipmap_s *nextmipmap;
|
||||
struct GLMipmap_s *nextcolormap;
|
||||
const UINT8 *colormap;
|
||||
struct GLMipmap_s *nextcolormap;
|
||||
struct GLColormap_s *colormap;
|
||||
};
|
||||
typedef struct GLMipmap_s GLMipmap_t;
|
||||
|
||||
//
|
||||
// Doom texture info, as cached for hardware rendering
|
||||
// Level textures, as cached for hardware rendering.
|
||||
//
|
||||
struct GLMapTexture_s
|
||||
{
|
||||
GLMipmap_t mipmap;
|
||||
float scaleX; //used for scaling textures on walls
|
||||
float scaleX; //used for scaling textures on walls
|
||||
float scaleY;
|
||||
};
|
||||
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;
|
||||
|
||||
|
||||
+75
-46
@@ -121,44 +121,33 @@ typedef struct
|
||||
poly_t *planepoly; // the generated convex polygon
|
||||
} extrasubsector_t;
|
||||
|
||||
//here lies gr_vissprite
|
||||
|
||||
// Kart features
|
||||
#define USE_FTRANSFORM_ANGLEZ
|
||||
#define USE_FTRANSFORM_MIRROR
|
||||
|
||||
// Vanilla features
|
||||
//#define USE_MODEL_NEXTFRAME
|
||||
|
||||
typedef struct
|
||||
{
|
||||
FLOAT x,y,z; // position
|
||||
#ifdef USE_FTRANSFORM_ANGLEZ
|
||||
FLOAT anglex,angley,anglez; // aimingangle / viewangle
|
||||
FLOAT anglex2,anglez2; // secondaries
|
||||
#else
|
||||
FLOAT anglex,angley; // aimingangle / viewangle
|
||||
FLOAT anglex2; // secondaries
|
||||
#endif
|
||||
FLOAT scalex,scaley,scalez;
|
||||
FLOAT spritexscale,spriteyscale;
|
||||
FLOAT fovxangle, fovyangle;
|
||||
FLOAT anglex, angley, anglez; // aimingangle / viewangle
|
||||
FLOAT scalex, scaley, scalez;
|
||||
FLOAT fovangle;
|
||||
UINT8 splitscreen;
|
||||
boolean flip; // screenflip
|
||||
boolean roll;
|
||||
boolean rollmodel;
|
||||
SINT8 rollflip;
|
||||
FLOAT rollangle;
|
||||
UINT8 rotaxis;
|
||||
FLOAT centerx, centery;
|
||||
#ifdef USE_FTRANSFORM_MIRROR
|
||||
boolean mirror; // SRB2Kart: Encore Mode
|
||||
boolean mirrorflip; // Encore Mode with Flipcam
|
||||
#endif
|
||||
FLOAT rollx, rollz;
|
||||
UINT8 fliptype;
|
||||
boolean shearing; // 14042019
|
||||
angle_t viewaiming; // 17052019
|
||||
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
|
||||
{
|
||||
@@ -166,6 +155,41 @@ typedef struct
|
||||
FLOAT s,t;
|
||||
} FOutVector;
|
||||
|
||||
typedef struct vbo_vertex_s
|
||||
{
|
||||
float x, y, z;
|
||||
float u, v;
|
||||
unsigned char r, g, b, a;
|
||||
} gl_skyvertex_t;
|
||||
|
||||
typedef enum gl_skyloopmode_e
|
||||
{
|
||||
HWD_SKYLOOP_FAN,
|
||||
HWD_SKYLOOP_STRIP
|
||||
} gl_skyloopmode_t;
|
||||
|
||||
typedef struct
|
||||
{
|
||||
gl_skyloopmode_t mode;
|
||||
int vertexcount;
|
||||
int vertexindex;
|
||||
boolean use_texture;
|
||||
} gl_skyloopdef_t;
|
||||
|
||||
typedef struct
|
||||
{
|
||||
unsigned int vbo;
|
||||
int rows, columns;
|
||||
int loopcount;
|
||||
|
||||
int detail, vertex_count;
|
||||
int texture, width, height;
|
||||
boolean rebuild; // VBO needs to be rebuilt
|
||||
|
||||
gl_skyloopdef_t *loops;
|
||||
gl_skyvertex_t *data;
|
||||
} gl_sky_t;
|
||||
|
||||
// Shader targets used to render specific types of geometry.
|
||||
// A shader target is resolved to an actual shader with HWR_GetShaderFromTarget.
|
||||
// The shader returned may be a base shader or a custom shader.
|
||||
@@ -174,9 +198,8 @@ enum
|
||||
SHADER_NONE = -1,
|
||||
SHADER_FLOOR = 0,
|
||||
SHADER_WALL,
|
||||
SHADER_SPRITECLIPHACK,
|
||||
SHADER_MODEL,
|
||||
SHADER_SPRITE,
|
||||
SHADER_MODEL,
|
||||
SHADER_WATER,
|
||||
SHADER_FOG,
|
||||
SHADER_SKY,
|
||||
@@ -204,7 +227,6 @@ enum hwdshaderstage
|
||||
|
||||
typedef enum hwdshaderstage hwdshaderstage_t;
|
||||
|
||||
|
||||
// ==========================================================================
|
||||
// RENDER MODES
|
||||
// ==========================================================================
|
||||
@@ -215,22 +237,22 @@ enum EPolyFlags
|
||||
{
|
||||
// the first 5 are mutually exclusive
|
||||
|
||||
PF_Masked = 0x00000001, // Poly is alpha scaled and 0 alpha pels are discarded (holes in texture)
|
||||
PF_Masked = 0x00000001, // Poly is alpha scaled and 0 alpha pixels are discarded (holes in texture)
|
||||
PF_Translucent = 0x00000002, // Poly is transparent, alpha = level of transparency
|
||||
PF_Additive = 0x00000004, // Poly is added to the frame buffer
|
||||
PF_Environment = 0x00000008, // Poly should be drawn environment mapped.
|
||||
// Hurdler: used for text drawing
|
||||
PF_Substractive = 0x00000010, // for splat
|
||||
PF_NoAlphaTest = 0x00000020, // hiden param
|
||||
PF_Fog = 0x00000040, // Fog blocks
|
||||
PF_Blending = (PF_Environment|PF_Additive|PF_Translucent|PF_Masked|PF_Substractive|PF_Fog)&~PF_NoAlphaTest,
|
||||
PF_Environment = 0x00000004, // Poly should be drawn environment mapped. (Hurdler: used for text drawing)
|
||||
PF_Additive = 0x00000008, // Source blending factor is additive.
|
||||
PF_Subtractive = 0x00000010, // Subtractive color blending
|
||||
PF_ReverseSubtract = 0x00000020, // Reverse subtract, used in wall splats (decals)
|
||||
PF_Multiplicative = 0x00000040, // Multiplicative color blending
|
||||
PF_Fog = 0x20000000, // Fog blocks
|
||||
PF_NoAlphaTest = 0x40000000, // Disables alpha testing
|
||||
PF_Blending = (PF_Masked|PF_Translucent|PF_Environment|PF_Additive|PF_Subtractive|PF_ReverseSubtract|PF_Multiplicative|PF_Fog) & ~PF_NoAlphaTest,
|
||||
|
||||
// other flag bits
|
||||
|
||||
PF_Occlude = 0x00000100, // Update the depth buffer
|
||||
PF_NoDepthTest = 0x00000200, // Disable the depth test mode
|
||||
PF_Invisible = 0x00000400, // Disable write to color buffer
|
||||
PF_Decal = 0x00000800, // Enable polygon offset
|
||||
PF_Occlude = 0x00000100, // Updates the depth buffer
|
||||
PF_NoDepthTest = 0x00000200, // Disables the depth test mode
|
||||
PF_Invisible = 0x00000400, // Disables write to color buffer
|
||||
PF_Decal = 0x00000800, // Enables polygon offset
|
||||
PF_Modulated = 0x00001000, // Modulation (multiply output with constant RGBA)
|
||||
// When set, pass the color constant into the FSurfaceInfo -> FlatColor
|
||||
PF_NoTexture = 0x00002000, // Disable texture
|
||||
@@ -239,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
|
||||
@@ -272,6 +295,7 @@ struct FLightInfo
|
||||
FUINT light_level;
|
||||
FUINT fade_start;
|
||||
FUINT fade_end;
|
||||
boolean directional;
|
||||
};
|
||||
typedef struct FLightInfo FLightInfo;
|
||||
|
||||
@@ -289,14 +313,11 @@ typedef struct FSurfaceInfo FSurfaceInfo;
|
||||
|
||||
enum hwdsetspecialstate
|
||||
{
|
||||
#ifdef USE_FBO_OGL
|
||||
HWD_SET_FRAMEBUFFER,
|
||||
#endif
|
||||
HWD_SET_SHADERS,
|
||||
|
||||
HWD_SET_TEXTUREFILTERMODE,
|
||||
HWD_SET_TEXTUREANISOTROPICMODE,
|
||||
|
||||
|
||||
HWD_SET_MSAA,
|
||||
|
||||
HWD_SET_SCREEN_TEXTURES,
|
||||
@@ -304,6 +325,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;
|
||||
@@ -313,6 +336,11 @@ typedef enum hwdsetspecialstate hwdspecialstate_t;
|
||||
enum hwdshaderinfo
|
||||
{
|
||||
HWD_SHADERINFO_LEVELTIME = 1,
|
||||
HWD_SHADERINFO_LIGHT_X,
|
||||
HWD_SHADERINFO_LIGHT_Y,
|
||||
HWD_SHADERINFO_LIGHT_Z,
|
||||
HWD_SHADERINFO_LIGHT_CONTRAST,
|
||||
HWD_SHADERINFO_LIGHT_BACKLIGHT,
|
||||
};
|
||||
|
||||
typedef enum hwdshaderinfo hwdshaderinfo_t;
|
||||
@@ -346,6 +374,7 @@ enum hwdscreentexture
|
||||
HWD_SCREENTEXTURE_WIPE_END, // destination image for the wipe/fade effect
|
||||
HWD_SCREENTEXTURE_GENERIC1, // underwater/heat effect, intermission background
|
||||
HWD_SCREENTEXTURE_GENERIC2, // palette-based colormap fade, final screen texture
|
||||
HWD_SCREENTEXTURE_VHS,
|
||||
NUMSCREENTEXTURES, // (generic3 is unused if palette rendering is disabled)
|
||||
};
|
||||
typedef enum hwdscreentexture hwdscreentexture_t;
|
||||
|
||||
+192
-171
@@ -18,9 +18,10 @@
|
||||
#include "../doomdef.h"
|
||||
|
||||
#ifdef HWRENDER
|
||||
|
||||
#include "hw_main.h"
|
||||
#include "hw_glob.h"
|
||||
#include "hw_drv.h"
|
||||
#include "hw_gl.h"
|
||||
|
||||
#include "../m_misc.h" //FIL_WriteFile()
|
||||
#include "../r_draw.h" //viewborderlump
|
||||
@@ -61,16 +62,20 @@ static UINT8 softwaretranstogl[11] = { 0, 25, 51, 76,102,127,153,178,204,229
|
||||
static UINT8 softwaretranstogl_hi[11] = { 0, 51,102,153,204,255,255,255,255,255,255};
|
||||
static UINT8 softwaretranstogl_lo[11] = { 0, 12, 24, 36, 48, 60, 71, 83, 95,111,127};
|
||||
|
||||
static const float FLOATBASEVIDWIDTH = (float)BASEVIDWIDTH;
|
||||
static const float FLOATBASEVIDHEIGHT = (float)BASEVIDHEIGHT;
|
||||
|
||||
//
|
||||
// -----------------+
|
||||
// HWR_DrawPatch : Draw a 'tile' graphic
|
||||
// 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
|
||||
// | /|
|
||||
@@ -83,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)
|
||||
{
|
||||
@@ -102,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;
|
||||
|
||||
@@ -122,16 +128,18 @@ void HWR_DrawPatch(GLPatch_t *gpatch, INT32 x, INT32 y, INT32 option)
|
||||
flags |= PF_ForceWrapY;
|
||||
|
||||
// clip it since it is used for bunny scroll in doom I
|
||||
HWD.pfnDrawPolygon(NULL, v, 4, flags);
|
||||
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)
|
||||
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;
|
||||
float cx = FIXED_TO_FLOAT(x);
|
||||
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
|
||||
// | /|
|
||||
@@ -142,12 +150,17 @@ void HWR_DrawStretchyFixedPatch(GLPatch_t *gpatch, fixed_t x, fixed_t y, fixed_t
|
||||
if (alphalevel >= 10 && alphalevel < 13)
|
||||
return;
|
||||
|
||||
const float fvw = (float)vid.width;
|
||||
const float fvh = (float)vid.height;
|
||||
|
||||
// make patch ready in hardware cache
|
||||
if (!colormap)
|
||||
HWR_GetPatch(gpatch);
|
||||
else
|
||||
HWR_GetMappedPatch(gpatch, colormap);
|
||||
|
||||
hwrPatch = ((GLPatch_t *)gpatch->hardware);
|
||||
|
||||
dupx = (float)vid.dupx;
|
||||
dupy = (float)vid.dupy;
|
||||
|
||||
@@ -178,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
|
||||
{
|
||||
@@ -212,56 +225,46 @@ 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((float)vid.width - (float)BASEVIDWIDTH * dupx) > 1.0E-36f)
|
||||
if (fabsf(fvw - FLOATBASEVIDWIDTH * dupx) > 1.0E-36f)
|
||||
{
|
||||
if (option & V_SNAPTORIGHT)
|
||||
cx += ((float)vid.width - ((float)BASEVIDWIDTH * dupx));
|
||||
cx += (fvw - (FLOATBASEVIDWIDTH * dupx));
|
||||
else if (!(option & V_SNAPTOLEFT))
|
||||
cx += ((float)vid.width - ((float)BASEVIDWIDTH * dupx))/2;
|
||||
cx += (fvw - (FLOATBASEVIDWIDTH * dupx))/2;
|
||||
}
|
||||
if (fabsf((float)vid.height - (float)BASEVIDHEIGHT * dupy) > 1.0E-36f)
|
||||
if (fabsf(fvh - FLOATBASEVIDHEIGHT * dupy) > 1.0E-36f)
|
||||
{
|
||||
if ((option & (V_SPLITSCREEN|V_SNAPTOTOP)) == (V_SPLITSCREEN|V_SNAPTOTOP))
|
||||
cy += ((float)vid.height/2 - ((float)BASEVIDHEIGHT/2 * dupy));
|
||||
cy += (fvh/2 - (FLOATBASEVIDHEIGHT/2 * dupy));
|
||||
else if (option & V_SNAPTOBOTTOM)
|
||||
cy += ((float)vid.height - ((float)BASEVIDHEIGHT * dupy));
|
||||
cy += (fvh - (FLOATBASEVIDHEIGHT * dupy));
|
||||
else if (!(option & V_SNAPTOTOP))
|
||||
cy += ((float)vid.height - ((float)BASEVIDHEIGHT * dupy))/2;
|
||||
cy += (fvh - (FLOATBASEVIDHEIGHT * dupy))/2;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
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 + (cx / (vid.width/2));
|
||||
cy = 1 - (cy / (vid.height/2));
|
||||
cx = -1.0f + (cx / (fvw / 2.0f));
|
||||
cy = 1.0f - (cy / (fvh / 2.0f));
|
||||
|
||||
// fwidth and fheight are similar
|
||||
fwidth /= vid.width / 2;
|
||||
fheight /= vid.height / 2;
|
||||
fwidth /= fvw / 2.0f;
|
||||
fheight /= fvh / 2.0f;
|
||||
|
||||
// set the polygon vertices to the right positions
|
||||
v[0].x = v[3].x = cx;
|
||||
@@ -274,48 +277,54 @@ 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;
|
||||
|
||||
flags = PF_Translucent|PF_NoDepthTest;
|
||||
// clip it since it is used for bunny scroll in doom I
|
||||
if (blendmode)
|
||||
flags = HWR_GetBlendModeFlag(blendmode+1)|PF_NoDepthTest;
|
||||
else
|
||||
flags = PF_Translucent|PF_NoDepthTest;
|
||||
|
||||
if (option & V_WRAPX)
|
||||
flags |= PF_ForceWrapX;
|
||||
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];
|
||||
else Surf.PolyColor.s.alpha = softwaretranstogl[10-alphalevel];
|
||||
|
||||
flags |= PF_Modulated;
|
||||
HWD.pfnDrawPolygon(&Surf, v, 4, flags);
|
||||
GL_DrawPolygon(&Surf, v, 4, flags);
|
||||
}
|
||||
else
|
||||
HWD.pfnDrawPolygon(NULL, v, 4, flags);
|
||||
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
|
||||
// | /|
|
||||
@@ -326,8 +335,12 @@ void HWR_DrawCroppedPatch(GLPatch_t *gpatch, fixed_t x, fixed_t y, fixed_t pscal
|
||||
if (alphalevel >= 10 && alphalevel < 13)
|
||||
return;
|
||||
|
||||
const float fvw = (float)vid.width;
|
||||
const float fvh = (float)vid.height;
|
||||
|
||||
// make patch ready in hardware cache
|
||||
HWR_GetPatch(gpatch);
|
||||
hwrPatch = ((GLPatch_t *)gpatch->hardware);
|
||||
|
||||
dupx = (float)vid.dupx;
|
||||
dupy = (float)vid.dupy;
|
||||
@@ -350,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))
|
||||
{
|
||||
@@ -363,34 +376,32 @@ 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((float)vid.width - (float)BASEVIDWIDTH * dupx) > 1.0E-36f)
|
||||
if (fabsf(fvw - FLOATBASEVIDWIDTH * dupx) > 1.0E-36f)
|
||||
{
|
||||
if (option & V_SNAPTORIGHT)
|
||||
cx += ((float)vid.width - ((float)BASEVIDWIDTH * dupx));
|
||||
cx += (fvw - (FLOATBASEVIDWIDTH * dupx));
|
||||
else if (!(option & V_SNAPTOLEFT))
|
||||
cx += ((float)vid.width - ((float)BASEVIDWIDTH * dupx))/2;
|
||||
cx += (fvw - (FLOATBASEVIDWIDTH * dupx))/2;
|
||||
}
|
||||
if (fabsf((float)vid.height - (float)BASEVIDHEIGHT * dupy) > 1.0E-36f)
|
||||
if (fabsf(fvh - FLOATBASEVIDHEIGHT * dupy) > 1.0E-36f)
|
||||
{
|
||||
if ((option & (V_SPLITSCREEN|V_SNAPTOTOP)) == (V_SPLITSCREEN|V_SNAPTOTOP))
|
||||
cy += ((float)vid.height/2 - ((float)BASEVIDHEIGHT/2 * dupy));
|
||||
cy += (fvh/2 - (FLOATBASEVIDHEIGHT/2 * dupy));
|
||||
else if (option & V_SNAPTOBOTTOM)
|
||||
cy += ((float)vid.height - ((float)BASEVIDHEIGHT * dupy));
|
||||
cy += (fvh - (FLOATBASEVIDHEIGHT * dupy));
|
||||
else if (!(option & V_SNAPTOTOP))
|
||||
cy += ((float)vid.height - ((float)BASEVIDHEIGHT * dupy))/2;
|
||||
cy += (fvh - (FLOATBASEVIDHEIGHT * dupy))/2;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -404,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)
|
||||
{
|
||||
@@ -422,12 +433,12 @@ 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 + (cx / (vid.width/2));
|
||||
cy = 1 - (cy / (vid.height/2));
|
||||
cx = -1.0f + (cx / (fvw / 2.0f));
|
||||
cy = 1.0f - (cy / (fvh / 2.0f));
|
||||
|
||||
// fwidth and fheight are similar
|
||||
fwidth /= vid.width / 2;
|
||||
fheight /= vid.height / 2;
|
||||
fwidth /= fvw / 2.0f;
|
||||
fheight /= fvh / 2.0f;
|
||||
|
||||
// set the polygon vertices to the right positions
|
||||
v[0].x = v[3].x = cx;
|
||||
@@ -438,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;
|
||||
|
||||
@@ -455,15 +466,17 @@ void HWR_DrawCroppedPatch(GLPatch_t *gpatch, fixed_t x, fixed_t y, fixed_t pscal
|
||||
{
|
||||
FSurfaceInfo Surf;
|
||||
Surf.PolyColor.s.red = Surf.PolyColor.s.green = Surf.PolyColor.s.blue = 0xff;
|
||||
|
||||
if (alphalevel == 13) Surf.PolyColor.s.alpha = softwaretranstogl_lo[cv_translucenthud.value];
|
||||
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;
|
||||
HWD.pfnDrawPolygon(&Surf, v, 4, flags);
|
||||
GL_DrawPolygon(&Surf, v, 4, flags);
|
||||
}
|
||||
else
|
||||
HWD.pfnDrawPolygon(NULL, v, 4, flags);
|
||||
GL_DrawPolygon(NULL, v, 4, flags);
|
||||
}
|
||||
|
||||
// ==========================================================================
|
||||
@@ -539,7 +552,7 @@ void HWR_DrawFlatFill (INT32 x, INT32 y, INT32 w, INT32 h, lumpnum_t flatlumpnum
|
||||
// BTW, I see we put 0 for PFs, and If I'm right, that
|
||||
// means we take the previous PFs as default
|
||||
// how can we be sure they are ok?
|
||||
HWD.pfnDrawPolygon(NULL, v, 4, PF_NoDepthTest); //PF_Translucent);
|
||||
GL_DrawPolygon(NULL, v, 4, PF_NoDepthTest); //PF_Translucent);
|
||||
}
|
||||
|
||||
|
||||
@@ -552,33 +565,33 @@ void HWR_DrawFlatFill (INT32 x, INT32 y, INT32 w, INT32 h, lumpnum_t flatlumpnum
|
||||
// 0--1
|
||||
void HWR_FadeScreenMenuBack(UINT16 color, UINT8 strength)
|
||||
{
|
||||
FOutVector v[4];
|
||||
FSurfaceInfo Surf;
|
||||
FOutVector v[4];
|
||||
FSurfaceInfo Surf;
|
||||
FBITFIELD poly_flags = PF_NoTexture|PF_Modulated|PF_NoDepthTest;
|
||||
|
||||
v[0].x = v[3].x = -1.0f;
|
||||
v[2].x = v[1].x = 1.0f;
|
||||
v[0].y = v[1].y = -1.0f;
|
||||
v[2].y = v[3].y = 1.0f;
|
||||
v[0].z = v[1].z = v[2].z = v[3].z = 1.0f;
|
||||
v[0].x = v[3].x = -1.0f;
|
||||
v[2].x = v[1].x = 1.0f;
|
||||
v[0].y = v[1].y = -1.0f;
|
||||
v[2].y = v[3].y = 1.0f;
|
||||
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 = 1.0f;
|
||||
v[0].t = v[1].t = 1.0f;
|
||||
v[2].t = v[3].t = 0.0f;
|
||||
v[0].s = v[3].s = 0.0f;
|
||||
v[2].s = v[1].s = 1.0f;
|
||||
v[0].t = v[1].t = 1.0f;
|
||||
v[2].t = v[3].t = 0.0f;
|
||||
|
||||
if (color & 0xFF00) // Do COLORMAP fade.
|
||||
{
|
||||
if (HWR_ShouldUsePaletteRendering() && cv_grscreentextures.value)
|
||||
if (color & 0xFF00) // Do COLORMAP fade.
|
||||
{
|
||||
if (HWR_ShouldUsePaletteRendering() && cv_glscreentextures.value)
|
||||
{
|
||||
const hwdscreentexture_t scr_tex = HWD_SCREENTEXTURE_GENERIC2;
|
||||
|
||||
Surf.LightTableId = HWR_GetLightTableID(NULL);
|
||||
Surf.LightInfo.light_level = strength;
|
||||
HWD.pfnMakeScreenTexture(scr_tex);
|
||||
HWD.pfnSetShader(HWR_GetShaderFromTarget(SHADER_UI_COLORMAP_FADE));
|
||||
HWD.pfnDrawScreenTexture(scr_tex, &Surf, PF_ColorMapped|PF_NoDepthTest);
|
||||
HWD.pfnUnSetShader();
|
||||
GL_MakeScreenTexture(scr_tex);
|
||||
GL_SetShader(HWR_GetShaderFromTarget(SHADER_UI_COLORMAP_FADE));
|
||||
GL_DrawScreenTexture(scr_tex, &Surf, PF_ColorMapped|PF_NoDepthTest);
|
||||
GL_UnSetShader();
|
||||
|
||||
return;
|
||||
}
|
||||
@@ -588,21 +601,21 @@ void HWR_FadeScreenMenuBack(UINT16 color, UINT8 strength)
|
||||
Surf.PolyColor.s.alpha = (strength*8);
|
||||
poly_flags |= PF_Translucent;
|
||||
}
|
||||
}
|
||||
else // Do TRANSMAP** fade.
|
||||
{
|
||||
}
|
||||
else // Do TRANSMAP** fade.
|
||||
{
|
||||
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);
|
||||
|
||||
poly_flags |= PF_Translucent;
|
||||
}
|
||||
|
||||
HWD.pfnDrawPolygon(&Surf, v, 4, poly_flags);
|
||||
poly_flags |= PF_Translucent;
|
||||
}
|
||||
|
||||
GL_DrawPolygon(&Surf, v, 4, poly_flags);
|
||||
}
|
||||
|
||||
// Draw the console background with translucency support
|
||||
@@ -629,7 +642,7 @@ void HWR_DrawConsoleBack(UINT32 color, INT32 height)
|
||||
Surf.PolyColor.rgba = UINT2RGBA(color);
|
||||
Surf.PolyColor.s.alpha = 0x80;
|
||||
|
||||
HWD.pfnDrawPolygon(&Surf, v, 4, PF_NoTexture|PF_Modulated|PF_Translucent|PF_NoDepthTest);
|
||||
GL_DrawPolygon(&Surf, v, 4, PF_NoTexture|PF_Modulated|PF_Translucent|PF_NoDepthTest);
|
||||
}
|
||||
|
||||
|
||||
@@ -650,19 +663,19 @@ void HWR_DrawViewBorder(INT32 clearlines)
|
||||
INT32 top, side;
|
||||
INT32 baseviewwidth, baseviewheight;
|
||||
INT32 basewindowx, basewindowy;
|
||||
GLPatch_t *patch;
|
||||
patch_t *patch;
|
||||
|
||||
// if (gr_viewwidth == vid.width)
|
||||
// if (gl_viewwidth == vid.width)
|
||||
// return;
|
||||
|
||||
if (!clearlines)
|
||||
clearlines = BASEVIDHEIGHT; // refresh all
|
||||
|
||||
// calc view size based on original game resolution
|
||||
baseviewwidth = FixedInt(FixedDiv(FLOAT_TO_FIXED(gr_viewwidth), vid.fdupx)); //(cv_viewsize.value * BASEVIDWIDTH/10)&~7;
|
||||
baseviewheight = FixedInt(FixedDiv(FLOAT_TO_FIXED(gr_viewheight), vid.fdupy));
|
||||
top = FixedInt(FixedDiv(FLOAT_TO_FIXED(gr_baseviewwindowy), vid.fdupy));
|
||||
side = FixedInt(FixedDiv(FLOAT_TO_FIXED(gr_baseviewwindowx), vid.fdupx));
|
||||
baseviewwidth = FixedInt(FixedDiv(FLOAT_TO_FIXED(gl_viewwidth), vid.fdupx)); //(cv_viewsize.value * BASEVIDWIDTH/10)&~7;
|
||||
baseviewheight = FixedInt(FixedDiv(FLOAT_TO_FIXED(gl_viewheight), vid.fdupy));
|
||||
top = FixedInt(FixedDiv(FLOAT_TO_FIXED(gl_baseviewwindowy), vid.fdupy));
|
||||
side = FixedInt(FixedDiv(FLOAT_TO_FIXED(gl_baseviewwindowx), vid.fdupx));
|
||||
|
||||
// top
|
||||
HWR_DrawFlatFill(0, 0,
|
||||
@@ -699,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);
|
||||
@@ -708,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);
|
||||
@@ -717,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)
|
||||
{
|
||||
@@ -729,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)
|
||||
{
|
||||
@@ -741,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);
|
||||
}
|
||||
@@ -776,16 +789,16 @@ void HWR_drawAMline(const fline_t *fl, INT32 color)
|
||||
F2DCoord v1, v2;
|
||||
RGBA_t color_rgba;
|
||||
RGBA_t *palette = HWR_GetTexturePalette();
|
||||
|
||||
|
||||
color_rgba = palette[color&0xFF];
|
||||
|
||||
|
||||
v1.x = ((float)fl->a.x-(vid.width/2.0f))*(2.0f/vid.width);
|
||||
v1.y = ((float)fl->a.y-(vid.height/2.0f))*(2.0f/vid.height);
|
||||
|
||||
v2.x = ((float)fl->b.x-(vid.width/2.0f))*(2.0f/vid.width);
|
||||
v2.y = ((float)fl->b.y-(vid.height/2.0f))*(2.0f/vid.height);
|
||||
|
||||
HWD.pfnDraw2DLine(&v1, &v2, color_rgba);
|
||||
GL_Draw2DLine(&v1, &v2, color_rgba);
|
||||
}
|
||||
|
||||
// -----------------+
|
||||
@@ -810,6 +823,9 @@ void HWR_DrawDiag(INT32 x, INT32 y, INT32 wh, INT32 color)
|
||||
fy = (float)y;
|
||||
fw = fh = (float)wh;
|
||||
|
||||
const float fvw = (float)vid.width;
|
||||
const float fvh = (float)vid.height;
|
||||
|
||||
if (!(color & V_NOSCALESTART))
|
||||
{
|
||||
float dupx = (float)vid.dupx, dupy = (float)vid.dupy;
|
||||
@@ -819,20 +835,20 @@ void HWR_DrawDiag(INT32 x, INT32 y, INT32 wh, INT32 color)
|
||||
fw *= dupx;
|
||||
fh *= dupy;
|
||||
|
||||
if (fabsf((float)vid.width - ((float)BASEVIDWIDTH * dupx)) > 1.0E-36f)
|
||||
if (fabsf(fvw - (FLOATBASEVIDWIDTH * dupx)) > 1.0E-36f)
|
||||
{
|
||||
if (color & V_SNAPTORIGHT)
|
||||
fx += ((float)vid.width - ((float)BASEVIDWIDTH * dupx));
|
||||
fx += (fvw - (FLOATBASEVIDWIDTH * dupx));
|
||||
else if (!(color & V_SNAPTOLEFT))
|
||||
fx += ((float)vid.width - ((float)BASEVIDWIDTH * dupx)) / 2;
|
||||
fx += (fvw - (FLOATBASEVIDWIDTH * dupx)) / 2;
|
||||
}
|
||||
if (fabsf((float)vid.height - ((float)BASEVIDHEIGHT * dupy)) > 1.0E-36f)
|
||||
if (fabsf(fvh - (FLOATBASEVIDHEIGHT * dupy)) > 1.0E-36f)
|
||||
{
|
||||
// same thing here
|
||||
if (color & V_SNAPTOBOTTOM)
|
||||
fy += ((float)vid.height - ((float)BASEVIDHEIGHT * dupy));
|
||||
fy += (fvh - (FLOATBASEVIDHEIGHT * dupy));
|
||||
else if (!(color & V_SNAPTOTOP))
|
||||
fy += ((float)vid.height - ((float)BASEVIDHEIGHT * dupy)) / 2;
|
||||
fy += (fvh - (FLOATBASEVIDHEIGHT * dupy)) / 2;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -853,16 +869,16 @@ void HWR_DrawDiag(INT32 x, INT32 y, INT32 wh, INT32 color)
|
||||
return;
|
||||
if (fx + fw > vid.width)
|
||||
{
|
||||
fwait = fw - ((float)vid.width - fx);
|
||||
fw = (float)vid.width - fx;
|
||||
fwait = fw - (fvw- fx);
|
||||
fw = fvw - fx;
|
||||
}
|
||||
if (fy + fh > vid.height)
|
||||
fh = (float)vid.height - fy;
|
||||
fh = fvh - fy;
|
||||
|
||||
fx = -1 + fx / (vid.width / 2);
|
||||
fy = 1 - fy / (vid.height / 2);
|
||||
fw = fw / (vid.width / 2);
|
||||
fh = fh / (vid.height / 2);
|
||||
fx = -1.0f + fx / (fvw / 2.0f);
|
||||
fy = 1.0f - fy / (fvh / 2.0f);
|
||||
fw = fw / (fvw / 2.0f);
|
||||
fh = fh / (fvh / 2.0f);
|
||||
|
||||
v[0].x = v[3].x = fx;
|
||||
v[2].x = v[1].x = fx + fw;
|
||||
@@ -879,7 +895,7 @@ void HWR_DrawDiag(INT32 x, INT32 y, INT32 wh, INT32 color)
|
||||
|
||||
Surf.PolyColor = palette[color&0xFF];
|
||||
|
||||
HWD.pfnDrawPolygon(&Surf, v, 4,
|
||||
GL_DrawPolygon(&Surf, v, 4,
|
||||
PF_Modulated|PF_NoTexture|PF_NoDepthTest);
|
||||
}
|
||||
|
||||
@@ -906,6 +922,9 @@ void HWR_DrawConsoleFill(INT32 x, INT32 y, INT32 w, INT32 h, UINT32 color, INT32
|
||||
fw = (float)w;
|
||||
fh = (float)h;
|
||||
|
||||
const float fvw = (float)vid.width;
|
||||
const float fvh = (float)vid.height;
|
||||
|
||||
if (!(options & V_NOSCALESTART))
|
||||
{
|
||||
float dupx = (float)vid.dupx, dupy = (float)vid.dupy;
|
||||
@@ -918,7 +937,7 @@ void HWR_DrawConsoleFill(INT32 x, INT32 y, INT32 w, INT32 h, UINT32 color, INT32
|
||||
clearColour.green = (float)rgbaColour.s.green / 255;
|
||||
clearColour.blue = (float)rgbaColour.s.blue / 255;
|
||||
clearColour.alpha = 1;
|
||||
HWD.pfnClearBuffer(true, false, false, &clearColour);
|
||||
GL_ClearBuffer(true, false, false, &clearColour);
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -927,25 +946,25 @@ void HWR_DrawConsoleFill(INT32 x, INT32 y, INT32 w, INT32 h, UINT32 color, INT32
|
||||
fw *= dupx;
|
||||
fh *= dupy;
|
||||
|
||||
if (fabsf((float)vid.width - ((float)BASEVIDWIDTH * dupx)) > 1.0E-36f)
|
||||
if (fabsf(fvw - (FLOATBASEVIDWIDTH * dupx)) > 1.0E-36f)
|
||||
{
|
||||
if (options & V_SNAPTORIGHT)
|
||||
fx += ((float)vid.width - ((float)BASEVIDWIDTH * dupx));
|
||||
fx += (fvw - (FLOATBASEVIDWIDTH * dupx));
|
||||
else if (!(options & V_SNAPTOLEFT))
|
||||
fx += ((float)vid.width - ((float)BASEVIDWIDTH * dupx)) / 2;
|
||||
fx += (fvw - (FLOATBASEVIDWIDTH * dupx)) / 2;
|
||||
}
|
||||
if (fabsf((float)vid.height - ((float)BASEVIDHEIGHT * dupy)) > 1.0E-36f)
|
||||
if (fabsf(fvh - (FLOATBASEVIDHEIGHT * dupy)) > 1.0E-36f)
|
||||
{
|
||||
// same thing here
|
||||
if (options & V_SNAPTOBOTTOM)
|
||||
fy += ((float)vid.height - ((float)BASEVIDHEIGHT * dupy));
|
||||
fy += (fvh - (FLOATBASEVIDHEIGHT * dupy));
|
||||
else if (!(options & V_SNAPTOTOP))
|
||||
fy += ((float)vid.height - ((float)BASEVIDHEIGHT * dupy)) / 2;
|
||||
fy += (fvh - (FLOATBASEVIDHEIGHT * dupy)) / 2;
|
||||
}
|
||||
if (options & V_SPLITSCREEN)
|
||||
fy += ((float)BASEVIDHEIGHT * dupy)/2;
|
||||
fy += (FLOATBASEVIDHEIGHT * dupy)/2;
|
||||
if (options & V_HORZSCREEN)
|
||||
fx += ((float)BASEVIDWIDTH * dupx)/2;
|
||||
fx += (FLOATBASEVIDWIDTH * dupx)/2;
|
||||
|
||||
}
|
||||
|
||||
@@ -965,14 +984,14 @@ void HWR_DrawConsoleFill(INT32 x, INT32 y, INT32 w, INT32 h, UINT32 color, INT32
|
||||
if (fw <= 0 || fh <= 0)
|
||||
return;
|
||||
if (fx + fw > vid.width)
|
||||
fw = (float)vid.width - fx;
|
||||
fw = fvw - fx;
|
||||
if (fy + fh > vid.height)
|
||||
fh = (float)vid.height - fy;
|
||||
fh = fvh - fy;
|
||||
|
||||
fx = -1 + fx / (vid.width / 2);
|
||||
fy = 1 - fy / (vid.height / 2);
|
||||
fw = fw / (vid.width / 2);
|
||||
fh = fh / (vid.height / 2);
|
||||
fx = -1.0f + fx / (fvw / 2.0f);
|
||||
fy = 1.0f - fy / (fvh / 2.0f);
|
||||
fw = fw / (fvw / 2.0f);
|
||||
fh = fh / (fvh / 2.0f);
|
||||
|
||||
v[0].x = v[3].x = fx;
|
||||
v[2].x = v[1].x = fx + fw;
|
||||
@@ -989,7 +1008,7 @@ void HWR_DrawConsoleFill(INT32 x, INT32 y, INT32 w, INT32 h, UINT32 color, INT32
|
||||
Surf.PolyColor.rgba = UINT2RGBA(color);
|
||||
Surf.PolyColor.s.alpha = 0x80;
|
||||
|
||||
HWD.pfnDrawPolygon(&Surf, v, 4, PF_NoTexture|PF_Modulated|PF_Translucent|PF_NoDepthTest);
|
||||
GL_DrawPolygon(&Surf, v, 4, PF_NoTexture|PF_Modulated|PF_Translucent|PF_NoDepthTest);
|
||||
}
|
||||
|
||||
// -----------------+
|
||||
@@ -1017,6 +1036,9 @@ void HWR_DrawFill(INT32 x, INT32 y, INT32 w, INT32 h, INT32 color)
|
||||
fw = (float)w;
|
||||
fh = (float)h;
|
||||
|
||||
const float fvw = (float)vid.width;
|
||||
const float fvh = (float)vid.height;
|
||||
|
||||
if (!(color & V_NOSCALESTART))
|
||||
{
|
||||
float dupx = (float)vid.dupx, dupy = (float)vid.dupy;
|
||||
@@ -1029,7 +1051,7 @@ void HWR_DrawFill(INT32 x, INT32 y, INT32 w, INT32 h, INT32 color)
|
||||
clearColour.green = (float)rgbaColour.s.green / 255;
|
||||
clearColour.blue = (float)rgbaColour.s.blue / 255;
|
||||
clearColour.alpha = 1;
|
||||
HWD.pfnClearBuffer(true, false, false, &clearColour);
|
||||
GL_ClearBuffer(true, false, false, &clearColour);
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -1038,26 +1060,25 @@ void HWR_DrawFill(INT32 x, INT32 y, INT32 w, INT32 h, INT32 color)
|
||||
fw *= dupx;
|
||||
fh *= dupy;
|
||||
|
||||
if (fabsf((float)vid.width - (float)BASEVIDWIDTH * dupx) > 1.0E-36f)
|
||||
if (fabsf(fvw - FLOATBASEVIDWIDTH * dupx) > 1.0E-36f)
|
||||
{
|
||||
if (color & V_SNAPTORIGHT)
|
||||
fx += ((float)vid.width - ((float)BASEVIDWIDTH * dupx));
|
||||
fx += (fvw - (FLOATBASEVIDWIDTH * dupx));
|
||||
else if (!(color & V_SNAPTOLEFT))
|
||||
fx += ((float)vid.width - ((float)BASEVIDWIDTH * dupx)) / 2;
|
||||
fx += (fvw - (FLOATBASEVIDWIDTH * dupx)) / 2;
|
||||
}
|
||||
if (fabsf((float)vid.height - (float)BASEVIDHEIGHT * dupy) > 1.0E-36f)
|
||||
if (fabsf(fvh - FLOATBASEVIDHEIGHT * dupy) > 1.0E-36f)
|
||||
{
|
||||
// same thing here
|
||||
if (color & V_SNAPTOBOTTOM)
|
||||
fy += ((float)vid.height - ((float)BASEVIDHEIGHT * dupy));
|
||||
fy += (fvh - (FLOATBASEVIDHEIGHT * dupy));
|
||||
else if (!(color & V_SNAPTOTOP))
|
||||
fy += ((float)vid.height - ((float)BASEVIDHEIGHT * dupy)) / 2;
|
||||
fy += (fvh - (FLOATBASEVIDHEIGHT * dupy)) / 2;
|
||||
}
|
||||
if (color & V_SPLITSCREEN)
|
||||
fy += ((float)BASEVIDHEIGHT * dupy)/2;
|
||||
fy += (FLOATBASEVIDHEIGHT * dupy)/2;
|
||||
if (color & V_HORZSCREEN)
|
||||
fx += ((float)BASEVIDWIDTH * dupx)/2;
|
||||
|
||||
fx += (FLOATBASEVIDWIDTH * dupx)/2;
|
||||
}
|
||||
|
||||
if (fx >= vid.width || fy >= vid.height)
|
||||
@@ -1076,14 +1097,14 @@ void HWR_DrawFill(INT32 x, INT32 y, INT32 w, INT32 h, INT32 color)
|
||||
if (fw <= 0 || fh <= 0)
|
||||
return;
|
||||
if (fx + fw > vid.width)
|
||||
fw = (float)vid.width - fx;
|
||||
fw = fvw - fx;
|
||||
if (fy + fh > vid.height)
|
||||
fh = (float)vid.height - fy;
|
||||
fh = fvh - fy;
|
||||
|
||||
fx = -1 + fx / (vid.width / 2);
|
||||
fy = 1 - fy / (vid.height / 2);
|
||||
fw = fw / (vid.width / 2);
|
||||
fh = fh / (vid.height / 2);
|
||||
fx = -1.0f + fx / (fvw / 2.0f);
|
||||
fy = 1.0f - fy / (fvh / 2.0f);
|
||||
fw = fw / (fvw / 2.0f);
|
||||
fh = fh / (fvh / 2.0f);
|
||||
|
||||
v[0].x = v[3].x = fx;
|
||||
v[2].x = v[1].x = fx + fw;
|
||||
@@ -1107,7 +1128,7 @@ void HWR_DrawFill(INT32 x, INT32 y, INT32 w, INT32 h, INT32 color)
|
||||
else Surf.PolyColor.s.alpha = softwaretranstogl[10-alphalevel];
|
||||
}
|
||||
|
||||
HWD.pfnDrawPolygon(&Surf, v, 4, PF_NoTexture|PF_Modulated|PF_Translucent|PF_NoDepthTest);
|
||||
GL_DrawPolygon(&Surf, v, 4, PF_NoTexture|PF_Modulated|PF_Translucent|PF_NoDepthTest);
|
||||
}
|
||||
|
||||
#ifdef HAVE_PNG
|
||||
@@ -1126,7 +1147,7 @@ void HWR_DrawFill(INT32 x, INT32 y, INT32 w, INT32 h, INT32 color)
|
||||
#define _FILE_OFFSET_BITS 0
|
||||
#endif
|
||||
|
||||
#include "png.h"
|
||||
#include "png.h"
|
||||
#ifdef PNG_WRITE_SUPPORTED
|
||||
#define USE_PNG // PNG is only used if write is supported (see ../m_misc.c)
|
||||
#endif
|
||||
@@ -1191,7 +1212,7 @@ UINT8 *HWR_GetScreenshot(void)
|
||||
return NULL;
|
||||
|
||||
// returns 24bit 888 RGB
|
||||
HWD.pfnReadScreenTexture(HWD_SCREENTEXTURE_GENERIC2, (void *)buf);
|
||||
GL_ReadScreenTexture(HWD_SCREENTEXTURE_GENERIC2, (void *)buf);
|
||||
return buf;
|
||||
}
|
||||
|
||||
@@ -1207,7 +1228,7 @@ boolean HWR_Screenshot(const char *pathname)
|
||||
}
|
||||
|
||||
// returns 24bit 888 RGB
|
||||
HWD.pfnReadScreenTexture(HWD_SCREENTEXTURE_GENERIC2, (void *)buf);
|
||||
GL_ReadScreenTexture(HWD_SCREENTEXTURE_GENERIC2, (void *)buf);
|
||||
|
||||
#ifdef USE_PNG
|
||||
ret = M_SavePNG(pathname, buf, vid.width, vid.height, NULL);
|
||||
|
||||
@@ -1,142 +0,0 @@
|
||||
// SONIC ROBO BLAST 2
|
||||
//-----------------------------------------------------------------------------
|
||||
// Copyright (C) 1993-1996 by id Software, Inc.
|
||||
// Copyright (C) 1998-2000 by DooM Legacy Team.
|
||||
// Copyright (C) 1999-2019 by Sonic Team Junior.
|
||||
//
|
||||
// This program is free software distributed under the
|
||||
// terms of the GNU General Public License, version 2.
|
||||
// See the 'LICENSE' file for more details.
|
||||
//-----------------------------------------------------------------------------
|
||||
/// \file
|
||||
/// \brief imports/exports for the GPU hardware low-level interface API
|
||||
|
||||
#ifndef __HWR_DRV_H__
|
||||
#define __HWR_DRV_H__
|
||||
|
||||
// this must be here 19991024 by Kin
|
||||
#include "../screen.h"
|
||||
#include "hw_data.h"
|
||||
#include "hw_defs.h"
|
||||
#include "hw_md2.h"
|
||||
|
||||
#include "hw_dll.h"
|
||||
#include "../doomdef.h"
|
||||
|
||||
// ==========================================================================
|
||||
// STANDARD DLL EXPORTS
|
||||
// ==========================================================================
|
||||
|
||||
EXPORT boolean HWRAPI(Init) (void);
|
||||
EXPORT void HWRAPI(SetupGLInfo) (void);
|
||||
EXPORT void HWRAPI(SetTexturePalette) (RGBA_t *ppal);
|
||||
EXPORT void HWRAPI(FinishUpdate) (INT32 waitvbl);
|
||||
EXPORT void HWRAPI(Draw2DLine) (F2DCoord *v1, F2DCoord *v2, RGBA_t Color);
|
||||
EXPORT void HWRAPI(DrawPolygon) (FSurfaceInfo *pSurf, FOutVector *pOutVerts, FUINT iNumPts, FBITFIELD PolyFlags);
|
||||
EXPORT void HWRAPI(DrawIndexedTriangles) (FSurfaceInfo *pSurf, FOutVector *pOutVerts, FUINT iNumPts, FBITFIELD PolyFlags, unsigned int *IndexArray);
|
||||
EXPORT void HWRAPI(SetBlend) (FBITFIELD PolyFlags);
|
||||
EXPORT void HWRAPI(ClearBuffer) (FBOOLEAN ColorMask, FBOOLEAN DepthMask, FBOOLEAN StencilMask, FRGBAFloat *ClearColor);
|
||||
EXPORT void HWRAPI(SetTexture) (GLMipmap_t *TexInfo);
|
||||
EXPORT void HWRAPI(UpdateTexture) (GLMipmap_t *TexInfo);
|
||||
EXPORT void HWRAPI(DeleteTexture) (GLMipmap_t *TexInfo);
|
||||
EXPORT void HWRAPI(ReadScreenTexture) (int tex, UINT16 *dst_data);
|
||||
EXPORT void HWRAPI(GClipRect) (INT32 minx, INT32 miny, INT32 maxx, INT32 maxy, float nearclip, float farclip);
|
||||
EXPORT void HWRAPI(ClearMipMapCache) (void);
|
||||
|
||||
//Hurdler: added for backward compatibility
|
||||
EXPORT void HWRAPI(SetSpecialState) (hwdspecialstate_t IdState, INT32 Value);
|
||||
|
||||
//Hurdler: added for new development
|
||||
|
||||
EXPORT void HWRAPI(DrawModel) (model_t *model, INT32 frameIndex, float duration, float tics, INT32 nextFrameIndex, FTransform *pos, float hscale, float vscale, UINT8 flipped, UINT8 hflipped, FSurfaceInfo *Surface);
|
||||
|
||||
EXPORT void HWRAPI(CreateModelVBOs) (model_t *model);
|
||||
EXPORT void HWRAPI(SetTransform) (FTransform *stransform);
|
||||
EXPORT INT32 HWRAPI(GetTextureUsed) (void);
|
||||
|
||||
EXPORT void HWRAPI(RenderSkyDome) (INT32 tex, INT32 texture_width, INT32 texture_height, FTransform transform);
|
||||
|
||||
EXPORT void HWRAPI(FlushScreenTextures) (void);
|
||||
EXPORT void HWRAPI(DoScreenWipe) (int wipeStart, int wipeEnd);
|
||||
EXPORT void HWRAPI(DrawScreenTexture) (int tex, FSurfaceInfo *surf, FBITFIELD polyflags);
|
||||
EXPORT void HWRAPI(MakeScreenTexture) (int tex);
|
||||
EXPORT void HWRAPI(DrawScreenFinalTexture) (int tex, INT32 width, INT32 height);
|
||||
|
||||
EXPORT void HWRAPI(RenderVhsEffect) (fixed_t upbary, fixed_t downbary, UINT8 updistort, UINT8 downdistort, UINT8 barsize);
|
||||
|
||||
#define SCREENVERTS 10
|
||||
EXPORT void HWRAPI(PostImgRedraw) (float points[SCREENVERTS][SCREENVERTS][2]);
|
||||
|
||||
// jimita
|
||||
EXPORT boolean HWRAPI(InitShaders) (void);
|
||||
EXPORT void HWRAPI(LoadShader) (int slot, char *code, hwdshaderstage_t stage);
|
||||
EXPORT boolean HWRAPI(CompileShader) (int slot);
|
||||
EXPORT void HWRAPI(SetShader) (int slot);
|
||||
EXPORT void HWRAPI(UnSetShader) (void);
|
||||
|
||||
EXPORT void HWRAPI(SetShaderInfo) (hwdshaderinfo_t info, INT32 value);
|
||||
|
||||
EXPORT void HWRAPI(SetPaletteLookup)(UINT8 *lut);
|
||||
EXPORT UINT32 HWRAPI(CreateLightTable)(RGBA_t *hw_lighttable);
|
||||
EXPORT void HWRAPI(ClearLightTables)(void);
|
||||
EXPORT void HWRAPI(SetScreenPalette)(RGBA_t *palette);
|
||||
|
||||
// ==========================================================================
|
||||
// HWR DRIVER OBJECT, FOR CLIENT PROGRAM
|
||||
// ==========================================================================
|
||||
|
||||
#if !defined (_CREATE_DLL_)
|
||||
|
||||
struct hwdriver_s
|
||||
{
|
||||
Init pfnInit;
|
||||
SetupGLInfo pfnSetupGLInfo;
|
||||
SetTexturePalette pfnSetTexturePalette;
|
||||
FinishUpdate pfnFinishUpdate;
|
||||
Draw2DLine pfnDraw2DLine;
|
||||
DrawPolygon pfnDrawPolygon;
|
||||
DrawIndexedTriangles pfnDrawIndexedTriangles;
|
||||
SetBlend pfnSetBlend;
|
||||
ClearBuffer pfnClearBuffer;
|
||||
SetTexture pfnSetTexture;
|
||||
UpdateTexture pfnUpdateTexture;
|
||||
DeleteTexture pfnDeleteTexture;
|
||||
ReadScreenTexture pfnReadScreenTexture;
|
||||
GClipRect pfnGClipRect;
|
||||
ClearMipMapCache pfnClearMipMapCache;
|
||||
SetSpecialState pfnSetSpecialState;
|
||||
DrawModel pfnDrawModel;
|
||||
CreateModelVBOs pfnCreateModelVBOs;
|
||||
SetTransform pfnSetTransform;
|
||||
GetTextureUsed pfnGetTextureUsed;
|
||||
PostImgRedraw pfnPostImgRedraw;
|
||||
FlushScreenTextures pfnFlushScreenTextures;
|
||||
DoScreenWipe pfnDoScreenWipe;
|
||||
DrawScreenTexture pfnDrawScreenTexture;
|
||||
MakeScreenTexture pfnMakeScreenTexture;
|
||||
RenderVhsEffect pfnRenderVhsEffect;
|
||||
DrawScreenFinalTexture pfnDrawScreenFinalTexture;
|
||||
|
||||
RenderSkyDome pfnRenderSkyDome;
|
||||
|
||||
InitShaders pfnInitShaders;
|
||||
LoadShader pfnLoadShader;
|
||||
CompileShader pfnCompileShader;
|
||||
SetShader pfnSetShader;
|
||||
UnSetShader pfnUnSetShader;
|
||||
|
||||
SetShaderInfo pfnSetShaderInfo;
|
||||
|
||||
SetPaletteLookup pfnSetPaletteLookup;
|
||||
CreateLightTable pfnCreateLightTable;
|
||||
ClearLightTables pfnClearLightTables;
|
||||
SetScreenPalette pfnSetScreenPalette;
|
||||
};
|
||||
|
||||
extern struct hwdriver_s hwdriver;
|
||||
|
||||
#define HWD hwdriver
|
||||
|
||||
#endif //not defined _CREATE_DLL_
|
||||
|
||||
#endif //__HWR_DRV_H__
|
||||
@@ -0,0 +1,79 @@
|
||||
// SONIC ROBO BLAST 2 Kart
|
||||
//-----------------------------------------------------------------------------
|
||||
// Copyright (C) 2020 by Jaime "Lactozilla" Passos.
|
||||
// Copyright (C) 2020 by Sonic Team Junior.
|
||||
//
|
||||
// This program is free software distributed under the
|
||||
// terms of the GNU General Public License, version 2.
|
||||
// See the 'LICENSE' file for more details.
|
||||
//-----------------------------------------------------------------------------
|
||||
/// \file hw_gl.h
|
||||
/// \brief OpenGL low-level interface API
|
||||
|
||||
#ifndef __HWR_GL_H__
|
||||
#define __HWR_GL_H__
|
||||
|
||||
#include "../screen.h"
|
||||
|
||||
#include "hw_data.h"
|
||||
#include "hw_defs.h"
|
||||
#include "hw_md2.h"
|
||||
|
||||
#define SCREENVERTS 10
|
||||
|
||||
boolean GL_Init(void);
|
||||
void SetupGLInfo(void);
|
||||
|
||||
void GL_SetSpecialState(hwdspecialstate_t IdState, INT32 Value);
|
||||
void GL_SetTransform(FTransform *stransform);
|
||||
void GL_SetBlend(FBITFIELD PolyFlags);
|
||||
void GL_SetPalette(RGBA_t *palette);
|
||||
void GL_ClearBuffer(FBOOLEAN ColorMask, FBOOLEAN DepthMask, FBOOLEAN StencilMask, FRGBAFloat * ClearColor);
|
||||
|
||||
void GL_DrawPolygon(FSurfaceInfo *pSurf, FOutVector *pOutVerts, FUINT iNumPts, FBITFIELD PolyFlags);
|
||||
void GL_DrawIndexedTriangles(FSurfaceInfo *pSurf, FOutVector *pOutVerts, FUINT iNumPts, FBITFIELD PolyFlags, unsigned int *IndexArray);
|
||||
void GL_Draw2DLine(F2DCoord *v1, F2DCoord *v2, RGBA_t Color);
|
||||
|
||||
void GL_DrawModelEx(model_t *model, INT32 frameIndex, float duration, float tics, INT32 nextFrameIndex, FTransform *pos, float hscale, float vscale, UINT8 flipped, UINT8 hflipped, FSurfaceInfo *Surface);
|
||||
#define GL_DrawModel(model, frameIndex, duration, tics, nextFrameIndex, pos, hscale, vscale, flipped, hflipped, Surface) GL_DrawModelEx(model, frameIndex, duration, tics, nextFrameIndex, pos, hscale, vscale, flipped, hflipped, Surface)
|
||||
|
||||
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);
|
||||
|
||||
void GL_Flush(void);
|
||||
#define GL_ClearMipMapCache GL_Flush
|
||||
|
||||
INT32 GL_GetTextureUsed(void);
|
||||
|
||||
void GL_CreateModelVBOs(model_t *model);
|
||||
|
||||
void GL_ReadScreenTexture(int tex, UINT16 *dst_data);
|
||||
void GL_GClipRect(INT32 minx, INT32 miny, INT32 maxx, INT32 maxy, float nearclip, float farclip);
|
||||
|
||||
void GL_MakeScreenTexture(int tex);
|
||||
void GL_FlushScreenTextures(void);
|
||||
|
||||
void GL_DrawScreenTexture(int tex, FSurfaceInfo *surf, FBITFIELD polyflags);
|
||||
void GL_DoScreenWipe(int wipeStart, int wipeEnd);
|
||||
void GL_RenderVhsEffect(fixed_t upbary, fixed_t downbary, UINT8 updistort, UINT8 downdistort, UINT8 barsize);
|
||||
void GL_DrawScreenFinalTexture(int tex, INT32 width, INT32 height, boolean useshader);
|
||||
|
||||
void GL_PostImgRedraw(float points[SCREENVERTS][SCREENVERTS][2]);
|
||||
|
||||
boolean GL_InitShaders(void);
|
||||
void GL_LoadShader(int slot, char *code, hwdshaderstage_t stage);
|
||||
boolean GL_CompileShader(int slot);
|
||||
void GL_SetShader(int slot);
|
||||
void GL_UnSetShader(void);
|
||||
|
||||
void GL_SetShaderInfo(hwdshaderinfo_t info, INT32 value);
|
||||
|
||||
void GL_SetPaletteLookup(UINT8 *lut);
|
||||
UINT32 GL_CreateLightTable(RGBA_t *hw_lighttable);
|
||||
void GL_ClearLightTables(void);
|
||||
void GL_SetScreenPalette(RGBA_t *palette);
|
||||
|
||||
#endif // __HWR_GL_H__
|
||||
+30
-25
@@ -23,17 +23,16 @@
|
||||
|
||||
// needed for sprite rendering
|
||||
// equivalent of the software renderer's vissprites
|
||||
typedef struct gr_vissprite_s
|
||||
typedef struct gl_vissprite_s
|
||||
{
|
||||
float x1, x2;
|
||||
float z1, z2;
|
||||
float gz, gzt;
|
||||
float tz, ty;
|
||||
float tz;
|
||||
float scale;
|
||||
float spritexscale, spriteyscale;
|
||||
float spritexoffset, spriteyoffset;
|
||||
UINT32 renderflags;
|
||||
GLPatch_t *gpatch;
|
||||
patch_t *gpatch;
|
||||
boolean flip;
|
||||
UINT8 translucency; //alpha level 0-255
|
||||
mobj_t *mobj;
|
||||
@@ -42,7 +41,9 @@ typedef struct gr_vissprite_s
|
||||
//Hurdler: 25/04/2000: now support colormap in hardware mode
|
||||
UINT8 *colormap;
|
||||
INT32 dispoffset; // copy of info->dispoffset, affects ordering but not drawing
|
||||
} gr_vissprite_t;
|
||||
} gl_vissprite_t;
|
||||
|
||||
void HWR_ObjectLightLevelPost(gl_vissprite_t *spr, const sector_t *sector, INT32 *lightlevel, boolean model);
|
||||
|
||||
// --------
|
||||
// hw_bsp.c
|
||||
@@ -50,31 +51,43 @@ typedef struct gr_vissprite_s
|
||||
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 *grPatch, GLMipmap_t *grMipmap, 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
|
||||
@@ -82,14 +95,6 @@ void HWR_GetFadeMask(lumpnum_t fademasklumpnum);
|
||||
extern INT32 patchformat;
|
||||
extern INT32 textureformat;
|
||||
|
||||
// --------
|
||||
// hw_main.c // originally hw_drawnodes.c from HWPortal branch
|
||||
// --------
|
||||
void HWR_AddTransparentWall(FOutVector *wallVerts, FSurfaceInfo *pSurf, INT32 texnum, boolean noencore, FBITFIELD blend, boolean fogwall, INT32 lightlevel, extracolormap_t *wallcolormap);
|
||||
void HWR_AddTransparentFloor(lumpnum_t lumpnum, extrasubsector_t *xsub, boolean isceiling, fixed_t fixedheight, INT32 lightlevel, INT32 alpha, sector_t *FOFSector, FBITFIELD blend, boolean fogplane, extracolormap_t *planecolormap);
|
||||
void HWR_AddTransparentPolyobjectFloor(lumpnum_t lumpnum, polyobj_t *polysector, boolean isceiling, fixed_t fixedheight,
|
||||
INT32 lightlevel, INT32 alpha, sector_t *FOFSector, FBITFIELD blend, extracolormap_t *planecolormap);
|
||||
|
||||
// --------
|
||||
// hw_shaders.c
|
||||
// --------
|
||||
|
||||
@@ -1,27 +0,0 @@
|
||||
// SONIC ROBO BLAST 2
|
||||
//-----------------------------------------------------------------------------
|
||||
// Copyright (C) 1993-1996 by id Software, Inc.
|
||||
// Copyright (C) 1998-2000 by DooM Legacy Team.
|
||||
// Copyright (C) 1999-2019 by Sonic Team Junior.
|
||||
//
|
||||
// This program is free software distributed under the
|
||||
// terms of the GNU General Public License, version 2.
|
||||
// See the 'LICENSE' file for more details.
|
||||
//-----------------------------------------------------------------------------
|
||||
/// \file
|
||||
|
||||
#include "../doomdef.h"
|
||||
|
||||
#ifdef HWRENDER
|
||||
#include "hw_light.h"
|
||||
#include "hw_drv.h"
|
||||
#include "../i_video.h"
|
||||
#include "../z_zone.h"
|
||||
#include "../m_random.h"
|
||||
#include "../m_bbox.h"
|
||||
#include "../w_wad.h"
|
||||
#include "../r_state.h"
|
||||
#include "../r_main.h"
|
||||
#include "../p_local.h"
|
||||
|
||||
#endif // HWRENDER
|
||||
@@ -1,20 +0,0 @@
|
||||
// SONIC ROBO BLAST 2
|
||||
//-----------------------------------------------------------------------------
|
||||
// Copyright (C) 1993-1996 by id Software, Inc.
|
||||
// Copyright (C) 1998-2000 by DooM Legacy Team.
|
||||
// Copyright (C) 1999-2019 by Sonic Team Junior.
|
||||
//
|
||||
// This program is free software distributed under the
|
||||
// terms of the GNU General Public License, version 2.
|
||||
// See the 'LICENSE' file for more details.
|
||||
//-----------------------------------------------------------------------------
|
||||
/// \file
|
||||
/// \brief Dynamic lighting & coronas add on by Hurdler
|
||||
|
||||
#ifndef _HW_LIGHTS_
|
||||
#define _HW_LIGHTS_
|
||||
|
||||
#include "hw_glob.h"
|
||||
#include "hw_defs.h"
|
||||
|
||||
#endif
|
||||
+2498
-2701
File diff suppressed because it is too large.
Load diff
+124
-84
@@ -20,14 +20,17 @@
|
||||
#ifndef __HWR_MAIN_H__
|
||||
#define __HWR_MAIN_H__
|
||||
|
||||
#include "hw_gl.h"
|
||||
#include "hw_glob.h"
|
||||
#include "hw_data.h"
|
||||
#include "hw_defs.h"
|
||||
#include "hw_portal.h"
|
||||
|
||||
#include "../am_map.h"
|
||||
#include "../d_player.h"
|
||||
#include "../r_defs.h"
|
||||
#include "../m_perfstats.h"
|
||||
#include "../v_video.h"
|
||||
|
||||
#define GLENCORE
|
||||
|
||||
@@ -35,15 +38,32 @@
|
||||
void HWR_Startup(void);
|
||||
void HWR_Shutdown(void);
|
||||
|
||||
extern float gr_viewwidth, gr_viewheight, gr_baseviewwindowx, gr_baseviewwindowy;
|
||||
extern float gl_viewwidth, gl_viewheight, gl_baseviewwindowx, gl_baseviewwindowy;
|
||||
|
||||
extern float gr_basewindowcenterx, gr_basewindowcentery;
|
||||
extern float gl_basewindowcenterx, gl_basewindowcentery;
|
||||
|
||||
extern unsigned msaa;
|
||||
extern boolean a2c;
|
||||
|
||||
extern FTransform atransform;
|
||||
extern float gr_viewsin, gr_viewcos;
|
||||
extern float gl_viewsin, gl_viewcos;
|
||||
|
||||
extern boolean gl_drawing_stencil;
|
||||
|
||||
extern seg_t *gl_curline;
|
||||
extern side_t *gl_sidedef;
|
||||
extern line_t *gl_linedef;
|
||||
extern sector_t *gl_frontsector;
|
||||
extern sector_t *gl_backsector;
|
||||
|
||||
enum
|
||||
{
|
||||
HWR_STENCIL_NORMAL,
|
||||
HWR_STENCIL_BEGIN,
|
||||
HWR_STENCIL_REVERSE,
|
||||
HWR_STENCIL_DEPTH,
|
||||
HWR_STENCIL_SKY
|
||||
};
|
||||
|
||||
// Performance stats
|
||||
extern ps_metric_t ps_hw_nodesorttime;
|
||||
@@ -62,12 +82,12 @@ extern ps_metric_t ps_hw_numcolors;
|
||||
extern ps_metric_t ps_hw_batchsorttime;
|
||||
extern ps_metric_t ps_hw_batchdrawtime;
|
||||
|
||||
extern boolean gr_shadersavailable;
|
||||
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);
|
||||
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);
|
||||
@@ -81,109 +101,129 @@ UINT8 *HWR_GetScreenshot(void);
|
||||
boolean HWR_Screenshot(const char *lbmname);
|
||||
|
||||
// hw_main.c
|
||||
void HWR_RenderFrame(INT32 viewnumber, player_t *player, boolean skybox);
|
||||
void HWR_RenderPlayerView(INT32 viewnumber, player_t *player);
|
||||
void HWR_SetViewSize(void);
|
||||
void HWR_AddCommands(void);
|
||||
void HWR_SetTransform(float fpov, player_t *player);
|
||||
void HWR_ClearClipper(void);
|
||||
|
||||
boolean HWR_UseShader(void);
|
||||
boolean HWR_ShouldUsePaletteRendering(void);
|
||||
boolean HWR_PalRenderFlashpal(void);
|
||||
void HWR_TogglePaletteRendering(void);
|
||||
void HWR_RenderPlayerView(void);
|
||||
void HWR_RenderViewpoint(gl_portal_t *rootportal, const float fpov, player_t *player, int stencil_level, boolean allow_portals);
|
||||
|
||||
void HWR_ClearSkyDome(void);
|
||||
void HWR_BuildSkyDome(void);
|
||||
|
||||
void HWR_SetTransform(float fpov);
|
||||
void HWR_ClearClipper(void);
|
||||
void HWR_SetStencilState(int state, int level);
|
||||
|
||||
// My original intention was to split hw_main.c
|
||||
// into files like hw_bsp.c, hw_sprites.c...
|
||||
|
||||
// hw_main.c: Lighting and fog
|
||||
void HWR_Lighting(FSurfaceInfo *Surface, INT32 light_level, extracolormap_t *colormap);
|
||||
UINT8 HWR_FogBlockAlpha(INT32 light, extracolormap_t *colormap); // Let's see if this can work
|
||||
void HWR_Lighting(FSurfaceInfo *Surface, INT32 light_level, extracolormap_t *colormap, const boolean directional);
|
||||
|
||||
UINT8 HWR_GetTranstableAlpha(INT32 transtablenum);
|
||||
FBITFIELD HWR_GetBlendModeFlag(INT32 ast);
|
||||
FBITFIELD HWR_SurfaceBlend(INT32 style, INT32 transtablenum, FSurfaceInfo *pSurf);
|
||||
FBITFIELD HWR_TranstableToAlpha(INT32 transtablenum, FSurfaceInfo *pSurf);
|
||||
|
||||
// Get amount of memory used by gpu textures in bytes
|
||||
INT32 HWR_GetTextureUsed(void);
|
||||
// Get amount of memory used by gpu textures in bytes;
|
||||
FUNCINLINE static ATTRINLINE INT32 HWR_GetTextureUsed(void)
|
||||
{
|
||||
return GL_GetTextureUsed();
|
||||
}
|
||||
|
||||
// hw_main.c: Post-rendering
|
||||
void HWR_DoPostProcessor(player_t *player);
|
||||
void HWR_StartScreenWipe(void);
|
||||
void HWR_EndScreenWipe(void);
|
||||
void HWR_DrawIntermissionBG(void);
|
||||
void HWR_DoWipe(UINT8 wipenum, UINT8 scrnnum);
|
||||
void HWR_RenderVhsEffect(fixed_t upbary, fixed_t downbary, UINT8 updistort, UINT8 downdistort, UINT8 barsize);
|
||||
void HWR_MakeScreenFinalTexture(void);
|
||||
void HWR_DrawScreenFinalTexture(INT32 width, INT32 height);
|
||||
|
||||
// hw_main.c: Planes
|
||||
void HWR_RenderPlane(subsector_t *subsector, extrasubsector_t *xsub, boolean isceiling, fixed_t fixedheight, FBITFIELD PolyFlags, INT32 lightlevel, lumpnum_t lumpnum, sector_t *FOFsector, UINT8 alpha, extracolormap_t *planecolormap);
|
||||
void HWR_AddTransparentFloor(lumpnum_t lumpnum, extrasubsector_t *xsub, boolean isceiling, fixed_t fixedheight, INT32 lightlevel, INT32 alpha, sector_t *FOFSector, FBITFIELD blend, boolean fogplane, extracolormap_t *planecolormap);
|
||||
FUNCINLINE static ATTRINLINE void HWR_StartScreenWipe(void)
|
||||
{
|
||||
GL_MakeScreenTexture(HWD_SCREENTEXTURE_WIPE_START);
|
||||
}
|
||||
|
||||
void HWR_RenderPolyObjectPlane(polyobj_t *polysector, boolean isceiling, fixed_t fixedheight, FBITFIELD blendmode, UINT8 lightlevel, lumpnum_t lumpnum, sector_t *FOFsector, UINT8 alpha, extracolormap_t *planecolormap);
|
||||
void HWR_AddPolyObjectPlanes(void);
|
||||
void HWR_AddTransparentPolyobjectFloor(lumpnum_t lumpnum, polyobj_t *polysector, boolean isceiling, fixed_t fixedheight, INT32 lightlevel, INT32 alpha, sector_t *FOFSector, FBITFIELD blend, extracolormap_t *planecolormap);
|
||||
FUNCINLINE static ATTRINLINE void HWR_EndScreenWipe(void)
|
||||
{
|
||||
GL_MakeScreenTexture(HWD_SCREENTEXTURE_WIPE_END);
|
||||
}
|
||||
|
||||
FUNCINLINE static ATTRINLINE void HWR_DrawIntermissionBG(void)
|
||||
{
|
||||
GL_DrawScreenTexture(HWD_SCREENTEXTURE_GENERIC1, NULL, 0);
|
||||
}
|
||||
|
||||
FUNCINLINE static ATTRINLINE void HWR_RenderVhsEffect(fixed_t upbary, fixed_t downbary, UINT8 updistort, UINT8 downdistort, UINT8 barsize)
|
||||
{
|
||||
GL_RenderVhsEffect(upbary, downbary, updistort, downdistort, barsize);
|
||||
}
|
||||
|
||||
FUNCINLINE static ATTRINLINE void HWR_MakeScreenFinalTexture(void)
|
||||
{
|
||||
GL_MakeScreenTexture(HWD_SCREENTEXTURE_GENERIC2);
|
||||
}
|
||||
|
||||
FUNCINLINE static ATTRINLINE void HWR_DrawScreenFinalTexture(INT32 width, INT32 height, boolean useshader)
|
||||
{
|
||||
GL_DrawScreenFinalTexture(HWD_SCREENTEXTURE_GENERIC2, width, height, useshader);
|
||||
}
|
||||
|
||||
// hw_main.c: Segs
|
||||
void HWR_ProcessSeg(void); // Sort of like GLWall::Process in GZDoom
|
||||
void HWR_RenderWall(FOutVector *wallVerts, FSurfaceInfo *pSurf, FBITFIELD blend, boolean fogwall, INT32 lightlevel, extracolormap_t *wallcolormap);
|
||||
void HWR_ProjectWall(FOutVector *wallVerts, FSurfaceInfo *pSurf, FBITFIELD blendmode, INT32 lightlevel, extracolormap_t *wallcolormap);
|
||||
void HWR_AddTransparentWall(FOutVector *wallVerts, FSurfaceInfo * pSurf, INT32 texnum, boolean noencore, FBITFIELD blend, boolean fogwall, INT32 lightlevel, extracolormap_t *wallcolormap);
|
||||
// moved HWR_SplitWall to hw_main.c
|
||||
void HWR_DrawSkyWall(FOutVector *wallVerts, FSurfaceInfo *Surf);
|
||||
void HWR_DrawSkyBackground(float fpov);
|
||||
|
||||
void HWR_AddPolyObjectSegs(void);
|
||||
|
||||
// hw_main.c: Sprites
|
||||
void HWR_AddSprites(sector_t *sec);
|
||||
void HWR_ProjectSprite(mobj_t *thing);
|
||||
void HWR_ProjectPrecipitationSprite(precipmobj_t *thing);
|
||||
void HWR_DrawSprites(void);
|
||||
|
||||
// hw_bsp.c
|
||||
void HWR_CreatePlanePolygons(INT32 bspnum);
|
||||
extern boolean gr_maphasportals;
|
||||
|
||||
// hw_cache.c
|
||||
void HWR_LoadTextures(size_t pnumtextures);
|
||||
RGBA_t *HWR_GetTexturePalette(void);
|
||||
|
||||
void HWR_SetShaderState(void);
|
||||
extern boolean gl_maphasportals;
|
||||
|
||||
// Console variables
|
||||
extern consvar_t cv_grshaders;
|
||||
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_grframebuffer;
|
||||
extern consvar_t cv_glframebuffer;
|
||||
#endif
|
||||
extern consvar_t cv_grfofcut;
|
||||
extern consvar_t cv_fofzfightfix;
|
||||
extern consvar_t cv_splitwallfix;
|
||||
extern consvar_t cv_slopepegfix;
|
||||
extern consvar_t cv_grshearing;
|
||||
extern consvar_t cv_grfov;
|
||||
extern consvar_t cv_grmdls;
|
||||
extern consvar_t cv_grfog;
|
||||
extern consvar_t cv_grfogdensity;
|
||||
extern consvar_t cv_grfiltermode;
|
||||
extern consvar_t cv_granisotropicmode;
|
||||
extern consvar_t cv_grcorrecttricks;
|
||||
extern consvar_t cv_grfovchange;
|
||||
extern consvar_t cv_grsolvetjoin;
|
||||
extern consvar_t cv_grspritebillboarding;
|
||||
extern consvar_t cv_grfakecontrast;
|
||||
extern consvar_t cv_grslopecontrast;
|
||||
extern consvar_t cv_grhorizonlines;
|
||||
extern consvar_t cv_grfallbackplayermodel;
|
||||
extern consvar_t cv_grbatching;
|
||||
extern consvar_t cv_grrenderdistance;
|
||||
extern consvar_t cv_grpaletterendering;
|
||||
extern consvar_t cv_grpalettedepth;
|
||||
extern consvar_t cv_grflashpal;
|
||||
extern consvar_t cv_grscreentextures;
|
||||
extern consvar_t cv_grportals;
|
||||
extern consvar_t cv_nostencil;
|
||||
extern consvar_t cv_secbright;
|
||||
|
||||
extern CV_PossibleValue_t granisotropicmode_cons_t[];
|
||||
extern consvar_t cv_glmdls;
|
||||
extern consvar_t cv_glfallbackplayermodel;
|
||||
|
||||
extern consvar_t cv_glspritebillboarding;
|
||||
extern consvar_t cv_glshearing;
|
||||
|
||||
extern consvar_t cv_glfakecontrast;
|
||||
extern consvar_t cv_glslopecontrast;
|
||||
|
||||
extern consvar_t cv_glshaders;
|
||||
|
||||
extern consvar_t cv_gllightdither;
|
||||
extern consvar_t cv_glsecbright;
|
||||
|
||||
extern consvar_t cv_glfiltermode;
|
||||
extern consvar_t cv_glanisotropicmode;
|
||||
|
||||
extern consvar_t cv_glsolvetjoin;
|
||||
|
||||
extern consvar_t cv_glbatching;
|
||||
|
||||
extern consvar_t cv_glrenderdistance;
|
||||
|
||||
extern consvar_t cv_glhorizonlines;
|
||||
extern consvar_t cv_glportals;
|
||||
|
||||
extern consvar_t cv_glpaletterendering;
|
||||
extern consvar_t cv_glpalettedepth;
|
||||
extern consvar_t cv_glflashpal;
|
||||
|
||||
FUNCINLINE static ATTRINLINE boolean HWR_UseShader(void)
|
||||
{
|
||||
return (cv_glshaders.value && gl_shadersavailable);
|
||||
}
|
||||
|
||||
FUNCINLINE static ATTRINLINE boolean HWR_ShouldUsePaletteRendering(void)
|
||||
{
|
||||
return (cv_glpaletterendering.value && (pLocalPalette != NULL) && HWR_UseShader());
|
||||
}
|
||||
|
||||
FUNCINLINE static ATTRINLINE boolean HWR_PalRenderFlashpal(void)
|
||||
{
|
||||
return (HWR_ShouldUsePaletteRendering() && cv_glflashpal.value);
|
||||
}
|
||||
|
||||
#endif
|
||||
+243
-237
@@ -25,13 +25,14 @@
|
||||
#include "../doomstat.h"
|
||||
|
||||
#ifdef HWRENDER
|
||||
#include "hw_drv.h"
|
||||
#include "hw_light.h"
|
||||
|
||||
#include "hw_gl.h"
|
||||
#include "hw_md2.h"
|
||||
#include "../d_main.h"
|
||||
#include "../r_bsp.h"
|
||||
#include "../r_fps.h"
|
||||
#include "../r_main.h"
|
||||
#include "../p_setup.h"
|
||||
#include "../m_misc.h"
|
||||
#include "../w_wad.h"
|
||||
#include "../z_zone.h"
|
||||
@@ -44,8 +45,8 @@
|
||||
|
||||
#include "hw_main.h"
|
||||
#include "../v_video.h"
|
||||
#ifdef HAVE_PNG
|
||||
|
||||
#ifdef HAVE_PNG
|
||||
#ifndef _MSC_VER
|
||||
#ifndef _LARGEFILE64_SOURCE
|
||||
#define _LARGEFILE64_SOURCE
|
||||
@@ -75,7 +76,7 @@
|
||||
|
||||
md2_t md2_models[NUMSPRITES];
|
||||
md2_t md2_playermodels[MAXSKINS];
|
||||
md2_t md2_localplayermodels[MAXSKINS];
|
||||
md2_t md2_localplayermodels[MAXLOCALSKINS];
|
||||
|
||||
|
||||
/*
|
||||
@@ -148,7 +149,7 @@ static void PNG_warn(png_structp PNG, png_const_charp pngtext)
|
||||
CONS_Debug(DBG_RENDER, "libpng warning at %p: %s", PNG, pngtext);
|
||||
}
|
||||
|
||||
static GLTextureFormat_t PNG_Load(const char *filename, int *w, int *h, GLPatch_t *grpatch)
|
||||
static GLTextureFormat_t PNG_Load(const char *filename, int *w, int *h, GLPatch_t *glpatch)
|
||||
{
|
||||
png_structp png_ptr;
|
||||
png_infop png_info_ptr;
|
||||
@@ -202,7 +203,7 @@ static GLTextureFormat_t PNG_Load(const char *filename, int *w, int *h, GLPatch_
|
||||
//CONS_Debug(DBG_RENDER, "libpng load error on %s\n", filename);
|
||||
png_destroy_read_struct(&png_ptr, &png_info_ptr, NULL);
|
||||
fclose(png_FILE);
|
||||
Z_Free(grpatch->mipmap->data);
|
||||
Z_Free(glpatch->mipmap->data);
|
||||
return 0;
|
||||
}
|
||||
#ifdef USE_FAR_KEYWORD
|
||||
@@ -243,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, &grpatch->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;
|
||||
@@ -283,7 +284,7 @@ typedef struct
|
||||
} PcxHeader;
|
||||
|
||||
static GLTextureFormat_t PCX_Load(const char *filename, int *w, int *h,
|
||||
GLPatch_t *grpatch)
|
||||
GLPatch_t *glpatch)
|
||||
{
|
||||
PcxHeader header;
|
||||
#define PALSIZE 768
|
||||
@@ -323,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, &grpatch->mipmap->data);
|
||||
image = Z_Malloc(pw*ph*4, PU_HWRMODELTEXTURE, &glpatch->mipmap->data);
|
||||
|
||||
if (fread(palette, sizeof (UINT8), PALSIZE, file) != PALSIZE)
|
||||
{
|
||||
@@ -365,51 +366,56 @@ static GLTextureFormat_t PCX_Load(const char *filename, int *w, int *h,
|
||||
// -----------------+
|
||||
static void md2_loadTexture(md2_t *model)
|
||||
{
|
||||
GLPatch_t *grpatch;
|
||||
patch_t *patch;
|
||||
GLPatch_t *glPatch = NULL;
|
||||
const char *filename = model->filename;
|
||||
|
||||
if (model->grpatch)
|
||||
if (model->glpatch)
|
||||
{
|
||||
grpatch = model->grpatch;
|
||||
Z_Free(grpatch->mipmap->data);
|
||||
patch = model->glpatch;
|
||||
glPatch = (GLPatch_t *)(patch->hardware);
|
||||
if (glPatch)
|
||||
Z_Free(glPatch->mipmap->data);
|
||||
}
|
||||
else
|
||||
{
|
||||
grpatch = Z_Calloc(sizeof *grpatch, PU_HWRPATCHINFO,
|
||||
&(model->grpatch));
|
||||
grpatch->mipmap = Z_Calloc(sizeof (GLMipmap_t), PU_HWRPATCHINFO, NULL);
|
||||
}
|
||||
model->glpatch = patch = Patch_Create(NULL, 0, NULL);
|
||||
|
||||
if (!grpatch->mipmap->downloaded && !grpatch->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
|
||||
grpatch->mipmap->format = PNG_Load(filename, &w, &h, grpatch);
|
||||
if (grpatch->mipmap->format == 0)
|
||||
glPatch->mipmap->format = PNG_Load(filename, &w, &h, glPatch);
|
||||
if (glPatch->mipmap->format == 0)
|
||||
#endif
|
||||
grpatch->mipmap->format = PCX_Load(filename, &w, &h, grpatch);
|
||||
if (grpatch->mipmap->format == 0)
|
||||
glPatch->mipmap->format = PCX_Load(filename, &w, &h, glPatch);
|
||||
if (glPatch->mipmap->format == 0)
|
||||
{
|
||||
grpatch->notfound = true;// mark it so its not searched for again repeatedly
|
||||
model->notexturefile = true; // mark it so its not searched for again repeatedly
|
||||
return;
|
||||
}
|
||||
|
||||
grpatch->mipmap->downloaded = 0;
|
||||
grpatch->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;
|
||||
|
||||
grpatch->width = (INT16)w;
|
||||
grpatch->height = (INT16)h;
|
||||
grpatch->mipmap->width = (UINT16)w;
|
||||
grpatch->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 = grpatch->mipmap->data;
|
||||
image = glPatch->mipmap->data;
|
||||
size = w*h;
|
||||
while (size--)
|
||||
{
|
||||
@@ -418,8 +424,8 @@ static void md2_loadTexture(md2_t *model)
|
||||
}
|
||||
}
|
||||
}
|
||||
HWD.pfnSetTexture(grpatch->mipmap);
|
||||
HWR_UnlockCachedPatch(grpatch);
|
||||
GL_SetTexture(glPatch->mipmap);
|
||||
HWR_UnlockCachedPatch(glPatch);
|
||||
}
|
||||
|
||||
// -----------------+
|
||||
@@ -427,49 +433,56 @@ static void md2_loadTexture(md2_t *model)
|
||||
// -----------------+
|
||||
static void md2_loadBlendTexture(md2_t *model)
|
||||
{
|
||||
GLPatch_t *grpatch;
|
||||
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->blendgrpatch)
|
||||
if (model->blendglpatch)
|
||||
{
|
||||
grpatch = model->blendgrpatch;
|
||||
Z_Free(grpatch->mipmap->data);
|
||||
patch = model->blendglpatch;
|
||||
glPatch = (GLPatch_t *)(patch->hardware);
|
||||
if (glPatch)
|
||||
Z_Free(glPatch->mipmap->data);
|
||||
}
|
||||
else
|
||||
{
|
||||
grpatch = Z_Calloc(sizeof *grpatch, PU_HWRPATCHINFO,
|
||||
&(model->blendgrpatch));
|
||||
grpatch->mipmap = Z_Calloc(sizeof (GLMipmap_t), PU_HWRPATCHINFO, NULL);
|
||||
}
|
||||
model->blendglpatch = patch = Patch_Create(NULL, 0, NULL);
|
||||
|
||||
if (!grpatch->mipmap->downloaded && !grpatch->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
|
||||
grpatch->mipmap->format = PNG_Load(filename, &w, &h, grpatch);
|
||||
if (grpatch->mipmap->format == 0)
|
||||
glPatch->mipmap->format = PNG_Load(filename, &w, &h, glPatch);
|
||||
if (glPatch->mipmap->format == 0)
|
||||
#endif
|
||||
grpatch->mipmap->format = PCX_Load(filename, &w, &h, grpatch);
|
||||
if (grpatch->mipmap->format == 0)
|
||||
glPatch->mipmap->format = PCX_Load(filename, &w, &h, glPatch);
|
||||
if (glPatch->mipmap->format == 0)
|
||||
{
|
||||
grpatch->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;
|
||||
}
|
||||
|
||||
grpatch->mipmap->downloaded = 0;
|
||||
grpatch->mipmap->flags = 0;
|
||||
glPatch->mipmap->downloaded = 0;
|
||||
glPatch->mipmap->flags = 0;
|
||||
|
||||
grpatch->width = (INT16)w;
|
||||
grpatch->height = (INT16)h;
|
||||
grpatch->mipmap->width = (UINT16)w;
|
||||
grpatch->mipmap->height = (UINT16)h;
|
||||
patch->width = (INT16)w;
|
||||
patch->height = (INT16)h;
|
||||
glPatch->mipmap->width = (UINT16)w;
|
||||
glPatch->mipmap->height = (UINT16)h;
|
||||
}
|
||||
HWD.pfnSetTexture(grpatch->mipmap); // We do need to do this so that it can be cleared and knows to recreate it when necessary
|
||||
HWR_UnlockCachedPatch(grpatch);
|
||||
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);
|
||||
}
|
||||
@@ -490,15 +503,21 @@ void HWR_InitMD2(void)
|
||||
{
|
||||
md2_playermodels[s].scale = -1.0f;
|
||||
md2_playermodels[s].model = NULL;
|
||||
md2_playermodels[s].grpatch = 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;
|
||||
|
||||
}
|
||||
for (s = 0; s < MAXLOCALSKINS; s++)
|
||||
{
|
||||
md2_localplayermodels[s].scale = -1.0f;
|
||||
md2_localplayermodels[s].model = NULL;
|
||||
md2_localplayermodels[s].grpatch = 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;
|
||||
}
|
||||
@@ -506,8 +525,10 @@ void HWR_InitMD2(void)
|
||||
{
|
||||
md2_models[i].scale = -1.0f;
|
||||
md2_models[i].model = NULL;
|
||||
md2_models[i].grpatch = 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;
|
||||
}
|
||||
@@ -528,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;
|
||||
@@ -555,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;
|
||||
@@ -604,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;
|
||||
@@ -679,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 *grmip, 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;
|
||||
@@ -695,28 +706,28 @@ static void HWR_CreateBlendedTexture(GLPatch_t *gpatch, GLPatch_t *blendgpatch,
|
||||
memset(translation, 0, sizeof(translation));
|
||||
memset(cutoff, 0, sizeof(cutoff));
|
||||
|
||||
if (grmip->width == 0)
|
||||
if (glMipmap->width == 0)
|
||||
{
|
||||
grmip->width = gpatch->width;
|
||||
grmip->height = gpatch->height;
|
||||
glMipmap->width = gpatch->width;
|
||||
glMipmap->height = gpatch->height;
|
||||
|
||||
// no wrap around, no chroma key
|
||||
grmip->flags = 0;
|
||||
glMipmap->flags = 0;
|
||||
// setup the texture info
|
||||
grmip->format = GL_TEXFMT_RGBA;
|
||||
glMipmap->format = GL_TEXFMT_RGBA;
|
||||
}
|
||||
|
||||
if (grmip->data)
|
||||
if (glMipmap->data)
|
||||
{
|
||||
Z_Free(grmip->data);
|
||||
grmip->data = NULL;
|
||||
Z_Free(glMipmap->data);
|
||||
glMipmap->data = NULL;
|
||||
}
|
||||
|
||||
cur = Z_Malloc(size*4, PU_HWRCACHE, &grmip->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)
|
||||
@@ -793,10 +804,9 @@ static void HWR_CreateBlendedTexture(GLPatch_t *gpatch, GLPatch_t *blendgpatch,
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (translen > 0)
|
||||
colorbrightnesses[translen] = colorbrightnesses[translen-1];
|
||||
}
|
||||
|
||||
while (size--)
|
||||
{
|
||||
@@ -1040,29 +1050,40 @@ 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
|
||||
GLMipmap_t *grmip, *newmip;
|
||||
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
|
||||
HWD.pfnSetTexture(gpatch->mipmap);
|
||||
GL_SetTexture(glPatch->mipmap);
|
||||
return;
|
||||
}
|
||||
|
||||
// search for the mimmap
|
||||
// search for the Mipmap
|
||||
// skip the first (no colormap translated)
|
||||
for (grmip = gpatch->mipmap; grmip->nextcolormap; )
|
||||
for (glMipmap = glPatch->mipmap; glMipmap->nextcolormap; )
|
||||
{
|
||||
grmip = grmip->nextcolormap;
|
||||
if (grmip->colormap == colormap)
|
||||
glMipmap = glMipmap->nextcolormap;
|
||||
|
||||
if (glMipmap->colormap && glMipmap->colormap->source == colormap)
|
||||
{
|
||||
if (grmip->downloaded && grmip->data)
|
||||
if (glMipmap->downloaded && glMipmap->data)
|
||||
{
|
||||
HWD.pfnSetTexture(grmip); // found the colormap, set it to the correct texture
|
||||
Z_ChangeTag(grmip->data, PU_HWRCACHE_UNLOCKED);
|
||||
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;
|
||||
}
|
||||
}
|
||||
@@ -1075,26 +1096,28 @@ static void HWR_GetBlendedTexture(GLPatch_t *gpatch, GLPatch_t *blendgpatch, INT
|
||||
// (it have a liste of mipmap)
|
||||
// this malloc is cleared in HWR_FreeTextureCache
|
||||
// (...) unfortunately z_malloc fragment alot the memory :(so malloc is better
|
||||
newmip = calloc(1, sizeof (*newmip));
|
||||
if (newmip == NULL)
|
||||
I_Error("%s: Out of memory", "HWR_GetMappedPatch");
|
||||
grmip->nextcolormap = newmip;
|
||||
newmip->colormap = colormap;
|
||||
newMipmap = calloc(1, sizeof (*newMipmap));
|
||||
if (newMipmap == NULL)
|
||||
I_Error("%s: Out of memory", "HWR_GetBlendedTexture");
|
||||
glMipmap->nextcolormap = newMipmap;
|
||||
|
||||
HWR_CreateBlendedTexture(gpatch, blendgpatch, newmip, 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));
|
||||
|
||||
HWD.pfnSetTexture(newmip);
|
||||
Z_ChangeTag(newmip->data, PU_HWRCACHE_UNLOCKED);
|
||||
HWR_CreateBlendedTexture(patch, blendgpatch, newMipmap, skinnum, color);
|
||||
|
||||
GL_SetTexture(newMipmap);
|
||||
Z_ChangeTag(newMipmap->data, PU_HWRMODELTEXTURE_UNLOCKED);
|
||||
}
|
||||
|
||||
|
||||
// -----------------+
|
||||
// HWR_DrawMD2 : Draw MD2
|
||||
// :
|
||||
// Returns :
|
||||
// -----------------+
|
||||
|
||||
void HWR_DrawMD2(gr_vissprite_t *spr)
|
||||
void HWR_DrawMD2(gl_vissprite_t *spr)
|
||||
{
|
||||
md2_t *md2;
|
||||
|
||||
@@ -1104,7 +1127,7 @@ void HWR_DrawMD2(gr_vissprite_t *spr)
|
||||
FTransform p;
|
||||
FSurfaceInfo Surf;
|
||||
|
||||
if (!cv_grmdls.value)
|
||||
if (!cv_glmdls.value)
|
||||
return;
|
||||
|
||||
if (spr->precip)
|
||||
@@ -1118,7 +1141,7 @@ void HWR_DrawMD2(gr_vissprite_t *spr)
|
||||
{
|
||||
sector_t *sector = spr->mobj->subsector->sector;
|
||||
extracolormap_t *colormap = sector->extra_colormap;
|
||||
UINT8 lightlevel = 255;
|
||||
INT32 lightlevel = 255;
|
||||
|
||||
if (sector->numlights)
|
||||
{
|
||||
@@ -1141,7 +1164,9 @@ void HWR_DrawMD2(gr_vissprite_t *spr)
|
||||
colormap = sector->extra_colormap;
|
||||
}
|
||||
|
||||
HWR_Lighting(&Surf, lightlevel, colormap);
|
||||
HWR_ObjectLightLevelPost(spr, sector, &lightlevel, true);
|
||||
|
||||
HWR_Lighting(&Surf, lightlevel, colormap, P_SectorUsesDirectionalLighting(sector) && !(spr->mobj->frame & FF_FULLBRIGHT));
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -1150,7 +1175,8 @@ void HWR_DrawMD2(gr_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;
|
||||
@@ -1159,11 +1185,9 @@ void HWR_DrawMD2(gr_vissprite_t *spr)
|
||||
spritedef_t *sprdef;
|
||||
spriteframe_t *sprframe;
|
||||
spriteinfo_t *sprinfo;
|
||||
INT32 rollfactor = 0;
|
||||
angle_t ang;
|
||||
interpmobjstate_t interp;
|
||||
|
||||
if (R_UsingFrameInterpolation() && !paused && (!cv_grmaxinterpdist.value || R_QuickCamDist(spr->mobj->x, spr->mobj->y) < cv_grmaxinterpdist.value))
|
||||
if (R_UsingFrameInterpolation() && !paused && (!cv_maxinterpdist.value || R_QuickCamDist(spr->mobj->x, spr->mobj->y) < cv_maxinterpdist.value))
|
||||
{
|
||||
R_InterpolateMobjState(spr->mobj, rendertimefrac, &interp);
|
||||
}
|
||||
@@ -1178,16 +1202,34 @@ void HWR_DrawMD2(gr_vissprite_t *spr)
|
||||
//if (tics > durs)
|
||||
//durs = tics;
|
||||
|
||||
if (spr->mobj->flags2 & MF2_SHADOW)
|
||||
Surf.PolyColor.s.alpha = 0x40;
|
||||
else if (spr->mobj->frame & FF_TRANSMASK)
|
||||
HWR_TranstableToAlpha((spr->mobj->frame & FF_TRANSMASK)>>FF_TRANSSHIFT, &Surf);
|
||||
INT32 blendmode;
|
||||
if (spr->mobj->frame & FF_BLENDMASK)
|
||||
blendmode = ((spr->mobj->frame & FF_BLENDMASK) >> FF_BLENDSHIFT) + 1;
|
||||
else
|
||||
Surf.PolyColor.s.alpha = 0xFF;
|
||||
blendmode = spr->mobj->blendmode;
|
||||
|
||||
blendmode = min(AST_MODULATE, blendmode);
|
||||
|
||||
if (spr->mobj->flags2 & MF2_SHADOW)
|
||||
{
|
||||
Surf.PolyColor.s.alpha = 0x40;
|
||||
Surf.PolyFlags = HWR_GetBlendModeFlag(blendmode);
|
||||
}
|
||||
else if (spr->mobj->frame & FF_TRANSMASK)
|
||||
{
|
||||
HWR_TranstableToAlpha((spr->mobj->frame & FF_TRANSMASK)>>FF_TRANSSHIFT, &Surf);
|
||||
Surf.PolyFlags = HWR_SurfaceBlend(blendmode, (spr->mobj->frame & FF_TRANSMASK)>>FF_TRANSSHIFT, &Surf);
|
||||
}
|
||||
else
|
||||
{
|
||||
// this hack is dumb, but the blendmodes refuse to work otherwise
|
||||
Surf.PolyColor.s.alpha = (blendmode == AST_TRANSLUCENT) ? 0xFF : 0xFE;
|
||||
Surf.PolyFlags = HWR_GetBlendModeFlag(blendmode);
|
||||
}
|
||||
|
||||
// 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)
|
||||
{
|
||||
@@ -1233,7 +1275,7 @@ void HWR_DrawMD2(gr_vissprite_t *spr)
|
||||
if (md2->model)
|
||||
{
|
||||
md2_printModelInfo(md2->model);
|
||||
HWD.pfnCreateModelVBOs(md2->model);
|
||||
GL_CreateModelVBOs(md2->model);
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -1243,22 +1285,39 @@ void HWR_DrawMD2(gr_vissprite_t *spr)
|
||||
}
|
||||
}
|
||||
//Hurdler: arf, I don't like that implementation at all... too much crappy
|
||||
gpatch = md2->grpatch;
|
||||
if (!gpatch || ((!gpatch->mipmap->format || !gpatch->mipmap->downloaded) && !gpatch->notfound))
|
||||
md2_loadTexture(md2);
|
||||
gpatch = md2->grpatch; // Load it again, because it isn't being loaded into gpatch after md2_loadtexture...
|
||||
gpatch = md2->glpatch;
|
||||
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->blendgrpatch
|
||||
|| ((!((GLPatch_t *)md2->blendgrpatch)->mipmap->format || !((GLPatch_t *)md2->blendgrpatch)->mipmap->downloaded)
|
||||
&& !((GLPatch_t *)md2->blendgrpatch)->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->blendgrpatch && ((GLPatch_t *)md2->blendgrpatch)->mipmap->format
|
||||
&& gpatch->width == ((GLPatch_t *)md2->blendgrpatch)->width && gpatch->height == ((GLPatch_t *)md2->blendgrpatch)->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"
|
||||
@@ -1278,24 +1337,24 @@ void HWR_DrawMD2(gr_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->blendgrpatch, 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
|
||||
HWD.pfnSetTexture(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)
|
||||
@@ -1312,7 +1371,7 @@ void HWR_DrawMD2(gr_vissprite_t *spr)
|
||||
// Interpolate the model interpolation. (lol)
|
||||
tics -= FixedToFloat(rendertimefrac);
|
||||
|
||||
if (cv_grmdls.value == 1 && tics <= durs)
|
||||
if (cv_glmdls.value == 1 && tics <= durs)
|
||||
{
|
||||
// frames are handled differently for states with FF_ANIMATE, so get the next frame differently for the interpolation
|
||||
if (spr->mobj->frame & FF_ANIMATE)
|
||||
@@ -1339,13 +1398,13 @@ void HWR_DrawMD2(gr_vissprite_t *spr)
|
||||
p.x = FIXED_TO_FLOAT(interp.x);
|
||||
p.y = FIXED_TO_FLOAT(interp.y)+md2->offset;
|
||||
|
||||
if (spr->mobj->eflags & MFE_VERTICALFLIP)
|
||||
if (flip)
|
||||
p.z = FIXED_TO_FLOAT(interp.z + spr->mobj->height);
|
||||
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];
|
||||
|
||||
@@ -1362,112 +1421,59 @@ void HWR_DrawMD2(gr_vissprite_t *spr)
|
||||
const fixed_t anglef = AngleFixed((R_PointToAngle(interp.x, interp.y))-ANGLE_180);
|
||||
p.angley = FIXED_TO_FLOAT(anglef);
|
||||
}
|
||||
|
||||
p.rollangle = 0.0f;
|
||||
p.rollflip = 1;
|
||||
p.rotaxis = 0;
|
||||
|
||||
p.spritexscale = FIXED_TO_FLOAT(spr->mobj->spritexscale);
|
||||
p.spriteyscale = FIXED_TO_FLOAT(spr->mobj->spriteyscale);
|
||||
|
||||
angle_t sliptideroll = 0;
|
||||
|
||||
if (spr->mobj->player)
|
||||
sliptideroll = ((cv_sloperoll.value && cv_sliptideroll.value) ? spr->mobj->player->sliproll : 0);
|
||||
const angle_t sliptideroll = ((cv_sliptideroll.value && spr->mobj->player) ? spr->mobj->player->sliproll : 0);
|
||||
const SINT8 flipfactor = flip ? -1 : 1;
|
||||
|
||||
if ((spr->mobj->rollangle)||(sliptideroll && cv_sliptideroll.value))
|
||||
if (spr->mobj->rollangle || sliptideroll)
|
||||
{
|
||||
angle_t rollang = 0;
|
||||
rollfactor = ((spr->mobj->rollmodel == true) ? 1 : 0);
|
||||
angle_t rollang = sliptideroll
|
||||
? (spr->mobj->rollangle) + (sliptideroll * spr->mobj->player->kartstuff[k_aizdriftstrat])
|
||||
: (spr->mobj->rollangle);
|
||||
|
||||
rollang *= flipfactor;
|
||||
|
||||
rollang = (spr->mobj->player && sliptideroll && cv_sliptideroll.value)
|
||||
? (spr->mobj->rollangle * rollfactor) + (sliptideroll * spr->mobj->player->sliptidemem)
|
||||
: (spr->mobj->rollangle * rollfactor);
|
||||
|
||||
fixed_t anglef = AngleFixed(rollang);
|
||||
p.rollangle = FIXED_TO_FLOAT(anglef);
|
||||
p.rollmodel = (spr->mobj->rollmodel);
|
||||
p.roll = true;
|
||||
|
||||
// rotation pivot
|
||||
p.centerx = FIXED_TO_FLOAT(spr->mobj->radius/2)*(p.spritexscale);
|
||||
p.centery = FIXED_TO_FLOAT(spr->mobj->height/2)*(p.spriteyscale);
|
||||
p.rollangle = 0.0f;
|
||||
|
||||
// rotation axis
|
||||
if (sprinfo->available)
|
||||
p.rotaxis = (UINT8)(sprinfo->pivot[(spr->mobj->frame & FF_FRAMEMASK)].rotaxis);
|
||||
if (anglef)
|
||||
{
|
||||
fixed_t camAngleDiff = AngleFixed(viewangle) - FLOAT_TO_FIXED(p.angley); // dumb reconversion back, I know
|
||||
|
||||
// for NiGHTS specifically but should work everywhere else
|
||||
ang = R_PointToAngle (spr->mobj->x, spr->mobj->y) - (spr->mobj->player ? spr->mobj->player->frameangle : spr->mobj->angle);
|
||||
if ((sprframe->rotate & SRF_RIGHT) && (ang < ANGLE_180)) // See from right
|
||||
p.rollflip = 1;
|
||||
else if ((sprframe->rotate & SRF_LEFT) && (ang >= ANGLE_180)) // See from left
|
||||
p.rollflip = -1;
|
||||
p.rollangle = FIXED_TO_FLOAT(anglef);
|
||||
p.roll = true;
|
||||
|
||||
// rotation pivot
|
||||
if (sprinfo->available)
|
||||
{
|
||||
p.centerx = FIXED_TO_FLOAT(sprinfo->pivot[frame].x);
|
||||
p.centery = FIXED_TO_FLOAT(sprinfo->pivot[frame].y);
|
||||
}
|
||||
else
|
||||
{
|
||||
p.centerx = FIXED_TO_FLOAT(spr->mobj->radius/2);
|
||||
p.centery = FIXED_TO_FLOAT(spr->mobj->height/2);
|
||||
}
|
||||
|
||||
// rotation axes relative to camera
|
||||
p.rollx = FIXED_TO_FLOAT(FINECOSINE(FixedAngle(camAngleDiff) >> ANGLETOFINESHIFT));
|
||||
p.rollz = FIXED_TO_FLOAT(FINESINE(FixedAngle(camAngleDiff) >> ANGLETOFINESHIFT));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
p.anglex = 0.0f;
|
||||
p.anglex2 = 0.0f;
|
||||
#ifdef USE_FTRANSFORM_ANGLEZ
|
||||
// Slope rotation from Kart
|
||||
p.anglez = 0.0f;
|
||||
p.anglez2 = 0.0f;
|
||||
|
||||
// use secondary angles for the slope rotation
|
||||
if (spr->mobj->standingslope)
|
||||
{
|
||||
fixed_t tempz = spr->mobj->standingslope->normal.z;
|
||||
fixed_t tempy = spr->mobj->standingslope->normal.y;
|
||||
fixed_t tempx = spr->mobj->standingslope->normal.x;
|
||||
fixed_t tempangle = AngleFixed(R_PointToAngle2(0, 0, FixedSqrt(FixedMul(tempy, tempy) + FixedMul(tempz, tempz)), tempx));
|
||||
p.anglez2 = FIXED_TO_FLOAT(tempangle);
|
||||
tempangle = -AngleFixed(R_PointToAngle2(0, 0, tempz, tempy));
|
||||
p.anglex2 = FIXED_TO_FLOAT(tempangle);
|
||||
}
|
||||
else if ((spr->mobj->sloperoll || spr->mobj->slopepitch) && (!P_IsObjectOnGround(spr->mobj)) && (!paused))
|
||||
{
|
||||
SINT8 flipfactor = flip ? -1 : 1;
|
||||
|
||||
angle_t camang = R_PointToAngle(interp.x, interp.y);
|
||||
angle_t mobjang;
|
||||
|
||||
if (spr->mobj->flags & (MF_NOTHINK|MF_SCENERY))
|
||||
mobjang = spr->mobj->angle;
|
||||
else
|
||||
mobjang = interp.angle;
|
||||
|
||||
angle_t fmoang;
|
||||
fmoang = camang - mobjang;
|
||||
|
||||
// slopepitch
|
||||
p.anglex += flipfactor*FIXED_TO_FLOAT( AngleFixed(FixedMul(FINESINE((camang-fmoang) >> ANGLETOFINESHIFT), interp.slopepitch)) );
|
||||
p.anglez -= flipfactor*FIXED_TO_FLOAT( AngleFixed(FixedMul(FINECOSINE((camang-fmoang) >> ANGLETOFINESHIFT), interp.slopepitch)) );
|
||||
|
||||
// sloperoll
|
||||
p.anglex += flipfactor*FIXED_TO_FLOAT( AngleFixed(FixedMul(FINECOSINE((camang-fmoang) >> ANGLETOFINESHIFT), interp.sloperoll)) );
|
||||
p.anglez += flipfactor*FIXED_TO_FLOAT( AngleFixed(FixedMul(FINESINE((camang-fmoang) >> ANGLETOFINESHIFT), interp.sloperoll)) );
|
||||
p.roll = true;
|
||||
}
|
||||
// slope pitch and roll
|
||||
p.anglex += flipfactor*FIXED_TO_FLOAT(AngleFixed(interp.sloperoll));
|
||||
p.anglez -= flipfactor*FIXED_TO_FLOAT(AngleFixed(interp.slopepitch));
|
||||
|
||||
// pitch and roll
|
||||
if (interp.roll || interp.pitch)
|
||||
{
|
||||
SINT8 flipfactor = flip ? -1 : 1;
|
||||
p.anglex += flipfactor*FIXED_TO_FLOAT(AngleFixed(interp.roll));
|
||||
p.anglez -= flipfactor*FIXED_TO_FLOAT(AngleFixed(interp.pitch));
|
||||
p.roll = true;
|
||||
}
|
||||
#endif
|
||||
p.anglex += flipfactor*FIXED_TO_FLOAT(AngleFixed(interp.roll));
|
||||
p.anglez -= flipfactor*FIXED_TO_FLOAT(AngleFixed(interp.pitch));
|
||||
|
||||
p.flip = atransform.flip;
|
||||
#ifdef USE_FTRANSFORM_MIRROR
|
||||
p.mirror = atransform.mirror; // from Kart
|
||||
#endif
|
||||
p.fliptype = atransform.fliptype;
|
||||
|
||||
HWD.pfnSetShader(SHADER_MODEL); // model shader
|
||||
GL_SetShader(SHADER_MODEL); // model shader
|
||||
{
|
||||
SINT8 flipfactor = flip ? -1 : 1;
|
||||
|
||||
float this_scale = FIXED_TO_FLOAT(interp.scale);
|
||||
|
||||
float xs = this_scale * FIXED_TO_FLOAT(interp.spritexscale);
|
||||
@@ -1477,11 +1483,11 @@ void HWR_DrawMD2(gr_vissprite_t *spr)
|
||||
float oy = ys * flipfactor*FIXED_TO_FLOAT(interp.spriteyoffset);
|
||||
|
||||
// offset perpendicular to the camera angle
|
||||
p.x -= ox * gr_viewsin;
|
||||
p.y += ox * gr_viewcos;
|
||||
p.x -= ox * gl_viewsin;
|
||||
p.y += ox * gl_viewcos;
|
||||
p.z += oy;
|
||||
|
||||
HWD.pfnDrawModel(md2->model, frame, durs, tics, nextFrame, &p, md2->scale * xs, md2->scale * ys, flip, hflip, &Surf);
|
||||
GL_DrawModel(md2->model, frame, durs, tics, nextFrame, &p, md2->scale * xs, md2->scale * ys, flip, hflip, &Surf);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -28,8 +28,10 @@ typedef struct
|
||||
float scale;
|
||||
float offset;
|
||||
model_t *model;
|
||||
void *grpatch;
|
||||
void *blendgrpatch;
|
||||
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;
|
||||
@@ -37,10 +39,10 @@ typedef struct
|
||||
|
||||
extern md2_t md2_models[NUMSPRITES];
|
||||
extern md2_t md2_playermodels[MAXSKINS];
|
||||
extern md2_t md2_localplayermodels[MAXSKINS];
|
||||
extern md2_t md2_localplayermodels[MAXLOCALSKINS];
|
||||
|
||||
void HWR_InitMD2(void);
|
||||
void HWR_DrawMD2(gr_vissprite_t *spr);
|
||||
void HWR_DrawMD2(gl_vissprite_t *spr);
|
||||
void HWR_AddPlayerMD2(INT32 skin, boolean local);
|
||||
void HWR_AddSpriteMD2(size_t spritenum);
|
||||
|
||||
|
||||
@@ -0,0 +1,231 @@
|
||||
// SONIC ROBO BLAST 2 KART
|
||||
//-----------------------------------------------------------------------------
|
||||
// Copyright (C) 2024 by Kart Krew.
|
||||
// Copyright (C) 2020 by Sonic Team Junior.
|
||||
// Copyright (C) 2000 by DooM Legacy Team.
|
||||
// Copyright (C) 1996 by id Software, Inc.
|
||||
//
|
||||
// This program is free software distributed under the
|
||||
// terms of the GNU General Public License, version 2.
|
||||
// See the 'LICENSE' file for more details.
|
||||
//-----------------------------------------------------------------------------
|
||||
/// \file hw_portal.c
|
||||
/// \brief OpenGL renderer portals.
|
||||
|
||||
// ==========================================================================
|
||||
// Visual portals (attr. Hannu Hanhi)
|
||||
// ==========================================================================
|
||||
|
||||
#ifdef HWRENDER
|
||||
|
||||
#include "../r_portal.h"
|
||||
|
||||
#include "../z_zone.h"
|
||||
|
||||
#include "hw_clip.h"
|
||||
#include "hw_gl.h"
|
||||
#include "hw_defs.h"
|
||||
#include "hw_main.h"
|
||||
#include "hw_portal.h"
|
||||
|
||||
SINT8 gl_portal_state = GLPORTAL_OFF;
|
||||
|
||||
gl_portallist_t *currentportallist;
|
||||
|
||||
// clip the area outside the portal destination window
|
||||
void HWR_PortalClipping(gl_portal_t *portal)
|
||||
{
|
||||
gld_clipper_SafeAddClipRange(portal->angle1, portal->angle2);
|
||||
}
|
||||
|
||||
static gl_portal_t* HWR_Portal_Add (seg_t *seg)
|
||||
{
|
||||
gl_portal_t *portal = Z_Malloc(sizeof(gl_portal_t), PU_STATIC, NULL);
|
||||
|
||||
// Linked list.
|
||||
if (!currentportallist->base)
|
||||
{
|
||||
currentportallist->base = portal;
|
||||
currentportallist->cap = portal;
|
||||
}
|
||||
else
|
||||
{
|
||||
currentportallist->cap->next = portal;
|
||||
currentportallist->cap = portal;
|
||||
}
|
||||
portal->next = NULL;
|
||||
|
||||
portal->seg = seg;
|
||||
|
||||
return portal;
|
||||
}
|
||||
|
||||
void HWR_FreePortalList(gl_portallist_t freelist)
|
||||
{
|
||||
portalcullsector = NULL;
|
||||
|
||||
// free memory from portal list allocated by calls to Add2Lines
|
||||
gl_portal_t *gl_portal_temp = freelist.base;
|
||||
while (gl_portal_temp)
|
||||
{
|
||||
gl_portal_t *nextportal = gl_portal_temp->next;
|
||||
Z_Free(gl_portal_temp);
|
||||
gl_portal_temp = nextportal;
|
||||
}
|
||||
}
|
||||
|
||||
void HWR_Portal_Add2Lines(const INT32 line1, const INT32 line2, seg_t *seg)
|
||||
{
|
||||
gl_portal_t *portal = HWR_Portal_Add(seg);
|
||||
|
||||
// Offset the portal view by the linedef centers
|
||||
line_t* start = &lines[line1];
|
||||
line_t* dest = &lines[line2];
|
||||
|
||||
angle_t dangle = R_PointToAngle2(0, 0, dest->dx, dest->dy) - R_PointToAngle2(start->dx, start->dy, 0, 0);
|
||||
|
||||
fixed_t disttopoint;
|
||||
angle_t angtopoint;
|
||||
|
||||
vertex_t dest_c, start_c;
|
||||
|
||||
// looking glass center
|
||||
start_c.x = start->v1->x/2 + start->v2->x/2;
|
||||
start_c.y = start->v1->y/2 + start->v2->y/2;
|
||||
|
||||
// other side center
|
||||
dest_c.x = dest->v1->x/2 + dest->v2->x/2;
|
||||
dest_c.y = dest->v1->y/2 + dest->v2->y/2;
|
||||
|
||||
disttopoint = R_PointToDist2(start_c.x, start_c.y, viewx, viewy);
|
||||
angtopoint = R_PointToAngle2(start_c.x, start_c.y, viewx, viewy);
|
||||
angtopoint += dangle;
|
||||
|
||||
portal->viewx = dest_c.x + FixedMul(FINECOSINE(angtopoint>>ANGLETOFINESHIFT), disttopoint);
|
||||
portal->viewy = dest_c.y + FixedMul(FINESINE(angtopoint>>ANGLETOFINESHIFT), disttopoint);
|
||||
portal->viewz = viewz + dest->frontsector->floorheight - start->frontsector->floorheight;
|
||||
portal->viewangle = viewangle + dangle;
|
||||
|
||||
portal->angle1 = R_PointToAngle64(seg->v1->x, seg->v1->y) + dangle;
|
||||
portal->angle2 = R_PointToAngle64(seg->v2->x, seg->v2->y) + dangle;
|
||||
|
||||
portal->clipline = line2;
|
||||
}
|
||||
|
||||
void HWR_PortalFrame(gl_portal_t* portal)
|
||||
{
|
||||
viewx = portal->viewx;
|
||||
viewy = portal->viewy;
|
||||
viewz = portal->viewz;
|
||||
|
||||
viewangle = portal->viewangle;
|
||||
//viewsin = FINESINE(viewangle>>ANGLETOFINESHIFT);
|
||||
//viewcos = FINECOSINE(viewangle>>ANGLETOFINESHIFT);
|
||||
|
||||
if (portal->clipline != -1)
|
||||
{
|
||||
portalclipline = &lines[portal->clipline];
|
||||
portalcullsector = portalclipline->frontsector;
|
||||
viewsector = portalclipline->frontsector;
|
||||
}
|
||||
else
|
||||
{
|
||||
portalclipline = NULL;
|
||||
portalcullsector = NULL;
|
||||
viewsector = R_PointInSubsector(viewx, viewy)->sector;
|
||||
}
|
||||
}
|
||||
|
||||
// Renders a portal segment.
|
||||
static void HWR_RenderPortalSeg(gl_portal_t* portal, SINT8 state)
|
||||
{
|
||||
gl_drawing_stencil = true; // do not draw outside of the stencil buffer, idiot.
|
||||
|
||||
// set our portal state and prepare to render the seg
|
||||
HWR_SetPortalState(state);
|
||||
|
||||
gl_curline = portal->seg;
|
||||
gl_frontsector = portal->seg->frontsector;
|
||||
gl_backsector = portal->seg->backsector;
|
||||
|
||||
HWR_ProcessSeg();
|
||||
gl_drawing_stencil = false;
|
||||
|
||||
// need to work around the r_opengl PF_Invisible bug with this call
|
||||
// similarly as in the linkdraw hack in HWR_DrawSprites
|
||||
GL_SetBlend(PF_Translucent|PF_Occlude|PF_Masked);
|
||||
}
|
||||
|
||||
// Renders a single portal from the current viewpoint.
|
||||
void HWR_RenderPortal(gl_portal_t* portal, gl_portal_t* rootportal, const float fpov, player_t *player, int stencil_level)
|
||||
{
|
||||
// draw portal seg to stencil buffer with increment
|
||||
HWR_SetTransform(fpov);
|
||||
HWR_ClearClipper();
|
||||
|
||||
HWR_SetStencilState(HWR_STENCIL_BEGIN, stencil_level);
|
||||
HWR_RenderPortalSeg(portal, GLPORTAL_STENCIL);
|
||||
|
||||
// go to portal frame lmao
|
||||
HWR_PortalFrame(portal);
|
||||
// call HWR_RenderViewpoint
|
||||
HWR_RenderViewpoint(portal, fpov, player, stencil_level + 1, true);
|
||||
// return to current frame
|
||||
if (rootportal)
|
||||
HWR_PortalFrame(rootportal);
|
||||
else // current frame is not a portal frame but the main view!
|
||||
{
|
||||
R_SetupFrame(viewssnum, false);
|
||||
portalclipline = NULL;
|
||||
}
|
||||
|
||||
// remove portal seg from stencil buffer
|
||||
HWR_SetTransform(fpov);
|
||||
HWR_ClearClipper();
|
||||
|
||||
HWR_SetStencilState(HWR_STENCIL_REVERSE, stencil_level);
|
||||
HWR_RenderPortalSeg(portal, GLPORTAL_STENCIL);
|
||||
|
||||
// draw portal seg to depth buffer
|
||||
HWR_ClearClipper();
|
||||
HWR_SetStencilState(HWR_STENCIL_DEPTH, stencil_level);
|
||||
HWR_RenderPortalSeg(portal, GLPORTAL_DEPTH);
|
||||
}
|
||||
|
||||
// returns true if the point is on the correct (viewable) side of the
|
||||
// portal destination line
|
||||
boolean HWR_PortalCheckPointSide(fixed_t x, fixed_t y)
|
||||
{
|
||||
// we are checking if the point is on the viewable side of the portal exit.
|
||||
// being exactly on the portal exit line is not enough to pass the test.
|
||||
// P_PointOnLineSide could behave differently from this expectation on this case,
|
||||
// so first check if the point is precisely on the line, and then if not, check the side.
|
||||
|
||||
vertex_t closest_point;
|
||||
P_ClosestPointOnLine(x, y, portalclipline, &closest_point);
|
||||
if (closest_point.x != x || closest_point.y != y)
|
||||
{
|
||||
if (P_PointOnLineSide(x, y, portalclipline) != 1)
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
boolean HWR_PortalCheckBBox(const fixed_t *bspcoord)
|
||||
{
|
||||
if (!portalclipline)
|
||||
return true;
|
||||
|
||||
if (HWR_PortalCheckPointSide(bspcoord[BOXLEFT], bspcoord[BOXTOP]) ||
|
||||
HWR_PortalCheckPointSide(bspcoord[BOXLEFT], bspcoord[BOXBOTTOM]) ||
|
||||
HWR_PortalCheckPointSide(bspcoord[BOXRIGHT], bspcoord[BOXTOP]) ||
|
||||
HWR_PortalCheckPointSide(bspcoord[BOXRIGHT], bspcoord[BOXBOTTOM]))
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
// we did not find any reason to pass the check, so return failure
|
||||
return false;
|
||||
}
|
||||
|
||||
#endif
|
||||
@@ -0,0 +1,81 @@
|
||||
// SONIC ROBO BLAST 2
|
||||
//-----------------------------------------------------------------------------
|
||||
// Copyright (C) 1993-1996 by id Software, Inc.
|
||||
// Copyright (C) 1998-2000 by DooM Legacy Team.
|
||||
// Copyright (C) 1999-2018 by Sonic Team Junior.
|
||||
//
|
||||
// This program is free software distributed under the
|
||||
// terms of the GNU General Public License, version 2.
|
||||
// See the 'LICENSE' file for more details.
|
||||
//-----------------------------------------------------------------------------
|
||||
/// \file hw_portal.h
|
||||
/// \brief OpenGL renderer portal struct, functions, linked list extern.
|
||||
|
||||
#ifndef __HW_PORTAL__
|
||||
#define __HW_PORTAL__
|
||||
|
||||
#ifdef HWRENDER
|
||||
|
||||
#include "../doomstat.h"
|
||||
#include "../r_data.h"
|
||||
#include "../r_bsp.h"
|
||||
|
||||
/** Portal structure.
|
||||
*/
|
||||
enum
|
||||
{
|
||||
GLPORTAL_OFF,
|
||||
GLPORTAL_SEARCH,
|
||||
GLPORTAL_STENCIL,
|
||||
GLPORTAL_DEPTH,
|
||||
GLPORTAL_INSIDE,
|
||||
};
|
||||
|
||||
typedef struct gl_portal_s
|
||||
{
|
||||
struct gl_portal_s *next;
|
||||
|
||||
// Viewport.
|
||||
fixed_t viewx;
|
||||
fixed_t viewy;
|
||||
fixed_t viewz;
|
||||
angle_t viewangle;
|
||||
|
||||
seg_t *seg; // seg that is used for drawing to the stencil buffer
|
||||
INT32 clipline; // Optional clipline for line-based portals
|
||||
|
||||
// angles for the left and right edges of the portal
|
||||
// relative to the viewpoint
|
||||
angle_t angle1;
|
||||
angle_t angle2;
|
||||
} gl_portal_t;
|
||||
|
||||
typedef struct gl_portallist_s
|
||||
{
|
||||
gl_portal_t *base;
|
||||
gl_portal_t *cap;
|
||||
} gl_portallist_t;
|
||||
|
||||
extern SINT8 gl_portal_state;
|
||||
|
||||
// new thing
|
||||
extern gl_portallist_t *currentportallist;
|
||||
|
||||
static inline void HWR_SetPortalState (SINT8 state)
|
||||
{
|
||||
gl_portal_state = state;
|
||||
}
|
||||
|
||||
// Adds an entry to the clipper for portal rendering
|
||||
void HWR_PortalClipping(gl_portal_t *portal);
|
||||
|
||||
void HWR_Portal_Add2Lines(const INT32 line1, const INT32 line2, seg_t *seg);
|
||||
void HWR_PortalFrame(gl_portal_t* portal);
|
||||
void HWR_RenderPortal(gl_portal_t* portal, gl_portal_t* rootportal, const float fpov, player_t *player, int stencil_level);
|
||||
void HWR_FreePortalList(gl_portallist_t portallist);
|
||||
|
||||
boolean HWR_PortalCheckPointSide(fixed_t x, fixed_t y);
|
||||
boolean HWR_PortalCheckBBox(const fixed_t *bspcoord);
|
||||
|
||||
#endif
|
||||
#endif
|
||||
+139
-28
@@ -13,7 +13,7 @@
|
||||
|
||||
#include "hw_main.h"
|
||||
#include "hw_glob.h"
|
||||
#include "hw_drv.h"
|
||||
#include "hw_gl.h"
|
||||
#include "hw_shaders.h"
|
||||
#include "../z_zone.h"
|
||||
|
||||
@@ -25,7 +25,7 @@ static struct {
|
||||
const char *vertex;
|
||||
const char *fragment;
|
||||
} const gl_shadersources[] = {
|
||||
|
||||
|
||||
// Floor shader
|
||||
{GLSL_DEFAULT_VERTEX_SHADER, GLSL_FLOOR_FRAGMENT_SHADER},
|
||||
|
||||
@@ -35,11 +35,8 @@ static struct {
|
||||
// Sprite shader
|
||||
{GLSL_DEFAULT_VERTEX_SHADER, GLSL_WALL_FRAGMENT_SHADER},
|
||||
|
||||
// Sprite clipping hack shader (for pulling things out of the floor)
|
||||
{GLSL_SPRITECLIP_HACK_VERTEX_SHADER, GLSL_WALL_FRAGMENT_SHADER},
|
||||
|
||||
// Model shader
|
||||
{GLSL_DEFAULT_VERTEX_SHADER, GLSL_WALL_FRAGMENT_SHADER},
|
||||
{GLSL_MODEL_LIGHTING_VERTEX_SHADER, GLSL_WALL_FRAGMENT_SHADER},
|
||||
|
||||
// Water shader
|
||||
{GLSL_DEFAULT_VERTEX_SHADER, GLSL_WATER_FRAGMENT_SHADER},
|
||||
@@ -52,7 +49,7 @@ static struct {
|
||||
|
||||
// Palette postprocess shader
|
||||
{GLSL_DEFAULT_VERTEX_SHADER, GLSL_PALETTE_POSTPROCESS_FRAGMENT_SHADER},
|
||||
|
||||
|
||||
// UI colormap fade shader
|
||||
{GLSL_DEFAULT_VERTEX_SHADER, GLSL_UI_COLORMAP_FADE_FRAGMENT_SHADER},
|
||||
|
||||
@@ -82,6 +79,7 @@ static shadertarget_t gl_shadertargets[NUMSHADERTARGETS];
|
||||
#define WHITESPACE_CHARS " \t"
|
||||
|
||||
#define PALETTE_RENDERING_DEFINE "#define SRB2_PALETTE_RENDERING"
|
||||
#define LIGHT_DITHERING_DEFINE "#define SRB2_LIGHT_DITHER"
|
||||
|
||||
// Initialize shader variables and the backend's shader system. Load the base shaders.
|
||||
// Returns false if shaders cannot be used.
|
||||
@@ -89,7 +87,7 @@ boolean HWR_InitShaders(void)
|
||||
{
|
||||
int i;
|
||||
|
||||
if (!HWD.pfnInitShaders())
|
||||
if (!GL_InitShaders())
|
||||
return false;
|
||||
|
||||
for (i = 0; i < NUMSHADERTARGETS; i++)
|
||||
@@ -278,10 +276,13 @@ static char *HWR_PreprocessShader(char *original)
|
||||
|
||||
// Calculate length of modified shader.
|
||||
new_len = original_len;
|
||||
|
||||
if (cv_grpaletterendering.value)
|
||||
|
||||
if (cv_glpaletterendering.value)
|
||||
ADD_TO_LEN(PALETTE_RENDERING_DEFINE)
|
||||
|
||||
if (cv_gllightdither.value)
|
||||
ADD_TO_LEN(LIGHT_DITHERING_DEFINE)
|
||||
|
||||
#undef ADD_TO_LEN
|
||||
|
||||
#define VERSION_PART "#version "
|
||||
@@ -320,9 +321,12 @@ static char *HWR_PreprocessShader(char *original)
|
||||
}
|
||||
|
||||
// Write the defines.
|
||||
if (cv_grpaletterendering.value)
|
||||
if (cv_glpaletterendering.value)
|
||||
WRITE_DEFINE(PALETTE_RENDERING_DEFINE)
|
||||
|
||||
if (cv_gllightdither.value)
|
||||
WRITE_DEFINE(LIGHT_DITHERING_DEFINE)
|
||||
|
||||
#undef WRITE_DEFINE
|
||||
|
||||
// Write a #line directive, so compiler errors will report line numbers from the
|
||||
@@ -362,16 +366,16 @@ static void HWR_CompileShader(int index)
|
||||
{
|
||||
char *preprocessed = HWR_PreprocessShader(vertex_source);
|
||||
if (!preprocessed) return;
|
||||
HWD.pfnLoadShader(index, preprocessed, HWD_SHADERSTAGE_VERTEX);
|
||||
GL_LoadShader(index, preprocessed, HWD_SHADERSTAGE_VERTEX);
|
||||
}
|
||||
if (fragment_source)
|
||||
{
|
||||
char *preprocessed = HWR_PreprocessShader(fragment_source);
|
||||
if (!preprocessed) return;
|
||||
HWD.pfnLoadShader(index, preprocessed, HWD_SHADERSTAGE_FRAGMENT);
|
||||
GL_LoadShader(index, preprocessed, HWD_SHADERSTAGE_FRAGMENT);
|
||||
}
|
||||
|
||||
gl_shaders[index].compiled = HWD.pfnCompileShader(index);
|
||||
gl_shaders[index].compiled = GL_CompileShader(index);
|
||||
}
|
||||
|
||||
// compile or recompile shaders
|
||||
@@ -396,17 +400,18 @@ void HWR_CompileShaders(void)
|
||||
|
||||
int HWR_GetShaderFromTarget(int shader_target)
|
||||
{
|
||||
int custom_shader = gl_shadertargets[shader_target].custom_shader;
|
||||
// use custom shader if following are true
|
||||
// - custom shader exists
|
||||
// - custom shader has been compiled successfully
|
||||
// - custom shaders are enabled
|
||||
// - custom shaders are allowed by the server
|
||||
if (custom_shader != -1 && gl_shaders[custom_shader].compiled &&
|
||||
cv_grshaders.value == 1)
|
||||
return custom_shader;
|
||||
else
|
||||
return gl_shadertargets[shader_target].base_shader;
|
||||
if (cv_glshaders.value == 1)
|
||||
{
|
||||
int custom_shader = gl_shadertargets[shader_target].custom_shader;
|
||||
// use custom shader if following are true
|
||||
// - custom shader exists
|
||||
// - custom shader has been compiled successfully
|
||||
// - custom shaders are enabled
|
||||
if (custom_shader != -1 && gl_shaders[custom_shader].compiled)
|
||||
return custom_shader;
|
||||
}
|
||||
|
||||
return gl_shadertargets[shader_target].base_shader;
|
||||
}
|
||||
|
||||
static inline UINT16 HWR_FindShaderDefs(UINT16 wadnum)
|
||||
@@ -427,7 +432,6 @@ customshaderxlat_t shaderxlat[] =
|
||||
{"Flat", SHADER_FLOOR},
|
||||
{"WallTexture", SHADER_WALL},
|
||||
{"Sprite", SHADER_SPRITE},
|
||||
{"SpriteClipHack", SHADER_SPRITECLIPHACK},
|
||||
{"Model", SHADER_MODEL},
|
||||
{"WaterRipple", SHADER_WATER},
|
||||
{"Fog", SHADER_FOG},
|
||||
@@ -446,6 +450,106 @@ void HWR_LoadAllCustomShaders(void)
|
||||
HWR_LoadCustomShadersFromFile(i, W_FileHasFolders(wadfiles[i]));
|
||||
}
|
||||
|
||||
static const char version_directives[][14] = {
|
||||
"#version 330\n",
|
||||
"#version 150\n",
|
||||
"#version 140\n",
|
||||
"#version 130\n",
|
||||
"#version 120\n",
|
||||
"#version 110\n",
|
||||
};
|
||||
|
||||
static boolean HWR_VersionDirectiveExists(const char* source)
|
||||
{
|
||||
return strncmp(source, "#version", 8) == 0;
|
||||
}
|
||||
|
||||
static char* HWR_PrependVersionDirective(const char* source, UINT32 version_index)
|
||||
{
|
||||
const UINT32 version_len = sizeof(version_directives[version_index]) - 1;
|
||||
const UINT32 source_len = strlen(source);
|
||||
|
||||
char* result = Z_Malloc(source_len + version_len + 1, PU_STATIC, NULL);
|
||||
strcpy(result, version_directives[version_index]);
|
||||
strcpy(result + version_len, source);
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
static void HWR_ReplaceVersionInplace(char* shader, UINT32 version_index)
|
||||
{
|
||||
shader[9] = version_directives[version_index][9];
|
||||
shader[10] = version_directives[version_index][10];
|
||||
shader[11] = version_directives[version_index][11];
|
||||
}
|
||||
|
||||
static boolean HWR_CheckVersionDirectives(const char* vert, const char* frag)
|
||||
{
|
||||
return HWR_VersionDirectiveExists(vert) && HWR_VersionDirectiveExists(frag);
|
||||
}
|
||||
|
||||
static void HWR_TryToCompileShaderWithImplicitVersion(INT32 shader_index, INT32 shaderxlat_id)
|
||||
{
|
||||
char* vert_shader = gl_shaders[shader_index].vertex;
|
||||
char* frag_shader = gl_shaders[shader_index].fragment;
|
||||
|
||||
boolean vert_shader_version_exists = HWR_VersionDirectiveExists(vert_shader);
|
||||
boolean frag_shader_version_exists = HWR_VersionDirectiveExists(frag_shader);
|
||||
|
||||
if (!vert_shader_version_exists)
|
||||
CONS_Alert(CONS_WARNING, "HWR_LoadCustomShadersFromFile: vertex shader '%s' is missing a #version directive\n", HWR_GetShaderName(shaderxlat_id));
|
||||
|
||||
if (!frag_shader_version_exists)
|
||||
CONS_Alert(CONS_WARNING, "HWR_LoadCustomShadersFromFile: fragment shader '%s' is missing a #version directive\n", HWR_GetShaderName(shaderxlat_id));
|
||||
|
||||
// try to compile as is
|
||||
HWR_CompileShader(shader_index);
|
||||
|
||||
if (gl_shaders[shader_index].compiled)
|
||||
return;
|
||||
|
||||
// try each version directive
|
||||
for (UINT32 i = 0; i < sizeof(version_directives) / sizeof(version_directives[0]); ++i)
|
||||
{
|
||||
CONS_Alert(CONS_NOTICE, "HWR_TryToCompileShaderWithImplicitVersion: Trying %s\n", version_directives[i]);
|
||||
|
||||
if (!vert_shader_version_exists)
|
||||
{
|
||||
// first time reallocation would have to be made
|
||||
|
||||
if (i == 0)
|
||||
{
|
||||
void* old = (void*)gl_shaders[shader_index].vertex;
|
||||
vert_shader = gl_shaders[shader_index].vertex = HWR_PrependVersionDirective(vert_shader, i);
|
||||
Z_Free(old);
|
||||
}
|
||||
else
|
||||
HWR_ReplaceVersionInplace(vert_shader, i);
|
||||
}
|
||||
|
||||
if (!frag_shader_version_exists)
|
||||
{
|
||||
if (i == 0)
|
||||
{
|
||||
void* old = (void*)gl_shaders[shader_index].fragment;
|
||||
frag_shader = gl_shaders[shader_index].fragment = HWR_PrependVersionDirective(frag_shader, i);
|
||||
Z_Free(old);
|
||||
}
|
||||
else
|
||||
HWR_ReplaceVersionInplace(frag_shader, i);
|
||||
}
|
||||
|
||||
HWR_CompileShader(shader_index);
|
||||
if (gl_shaders[shader_index].compiled)
|
||||
{
|
||||
CONS_Alert(CONS_NOTICE, "HWR_TryToCompileShaderWithImplicitVersion: Compiled with %s\n",
|
||||
version_directives[i]);
|
||||
CONS_Alert(CONS_WARNING, "Implicit GLSL version is used. Correct behavior is not guaranteed\n");
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void HWR_LoadCustomShadersFromFile(UINT16 wadnum, boolean PK3)
|
||||
{
|
||||
UINT16 lump;
|
||||
@@ -458,7 +562,7 @@ void HWR_LoadCustomShadersFromFile(UINT16 wadnum, boolean PK3)
|
||||
int i;
|
||||
boolean modified_shaders[NUMSHADERTARGETS] = {0};
|
||||
|
||||
if (!gr_shadersavailable)
|
||||
if (!gl_shadersavailable)
|
||||
return;
|
||||
|
||||
lump = HWR_FindShaderDefs(wadnum);
|
||||
@@ -602,13 +706,20 @@ skip_field:
|
||||
{
|
||||
int shader_index = i + NUMSHADERTARGETS; // index to gl_shaders
|
||||
gl_shadertargets[i].custom_shader = shader_index;
|
||||
|
||||
// if only one stage (vertex/fragment) is defined, the other one
|
||||
// is copied from the base shaders.
|
||||
if (!gl_shaders[shader_index].fragment)
|
||||
gl_shaders[shader_index].fragment = Z_StrDup(gl_shadersources[i].fragment);
|
||||
|
||||
if (!gl_shaders[shader_index].vertex)
|
||||
gl_shaders[shader_index].vertex = Z_StrDup(gl_shadersources[i].vertex);
|
||||
HWR_CompileShader(shader_index);
|
||||
|
||||
if (!HWR_CheckVersionDirectives(gl_shaders[shader_index].vertex, gl_shaders[shader_index].fragment))
|
||||
HWR_TryToCompileShaderWithImplicitVersion(shader_index, i);
|
||||
else
|
||||
HWR_CompileShader(shader_index);
|
||||
|
||||
if (!gl_shaders[shader_index].compiled)
|
||||
CONS_Alert(CONS_ERROR, "HWR_LoadCustomShadersFromFile: A compilation error occured for the %s shader in file %s. See the console messages above for more information.\n", shaderxlat[i].type, wadfiles[wadnum]->filename);
|
||||
}
|
||||
|
||||
+94
-10
@@ -31,15 +31,29 @@
|
||||
"gl_ClipVertex = gl_ModelViewMatrix * gl_Vertex;\n" \
|
||||
"}\0"
|
||||
|
||||
// Sprite clipping makes me want to McFucking Die
|
||||
|
||||
#define GLSL_SPRITECLIP_HACK_VERTEX_SHADER \
|
||||
"void main(void) {\n" \
|
||||
// reinterpretation of sprite lighting for models
|
||||
// it's a combination of how it works for normal sprites & papersprites
|
||||
#define GLSL_MODEL_LIGHTING_VERTEX_SHADER \
|
||||
"uniform float lighting;\n" \
|
||||
"uniform vec3 light_dir;\n" \
|
||||
"uniform float light_contrast;\n" \
|
||||
"uniform float light_backlight;\n" \
|
||||
"void main()\n" \
|
||||
"{\n" \
|
||||
"gl_Position = gl_ProjectionMatrix * gl_ModelViewMatrix * gl_Vertex;\n" \
|
||||
"gl_FrontColor = gl_Color;\n" \
|
||||
"float light = lighting;\n" \
|
||||
"if (length(light_dir) > 0.000001) {\n" \
|
||||
"mat4 m4 = gl_ProjectionMatrix * gl_ModelViewMatrix;\n" \
|
||||
"mat3 m3 = mat3( m4[0].xyz, m4[1].xyz, m4[2].xyz );\n" \
|
||||
"float extralight = -dot(normalize(gl_Normal * m3), normalize(light_dir));\n" \
|
||||
"extralight *= light_contrast - light_backlight;\n" \
|
||||
"extralight *= lighting / 255.0;\n" \
|
||||
"light += extralight * 2.5;\n" \
|
||||
"}\n" \
|
||||
"light = clamp(light / 255.0, 0.0, 1.0);\n" \
|
||||
"gl_FrontColor = vec4(light, light, light, 1.0);\n" \
|
||||
"gl_TexCoord[0].xy = gl_MultiTexCoord0.xy;\n" \
|
||||
"gl_ClipVertex = gl_ModelViewMatrix * gl_Vertex;\n" \
|
||||
"gl_Position.z -= 80.0 / gl_Position.z;\n" \
|
||||
"}\0"
|
||||
|
||||
// ==================
|
||||
@@ -62,16 +76,55 @@
|
||||
//
|
||||
|
||||
// Include GLSL_FLOOR_FUDGES or GLSL_WALL_FUDGES or define the fudges in shaders that use this macro.
|
||||
#define GLSL_DOOM_COLORMAP_DITHER \
|
||||
"float baseValue = max(startmap * STARTMAP_FUDGE - scale * 0.5 * SCALE_FUDGE, cap);\n" \
|
||||
"float endResolutionx = scr_resolution.x;\n" \
|
||||
"float endResolutiony = scr_resolution.y;\n" \
|
||||
"if (scr_resolution.x > 1280.0) {\n" \
|
||||
"endResolutionx = scr_resolution.x * 0.5;\n" \
|
||||
"}\n" \
|
||||
"if (scr_resolution.y > 720.0) {\n" \
|
||||
"endResolutiony = scr_resolution.y * 0.5;\n" \
|
||||
"}\n" \
|
||||
"float zFactor = clamp((z - 192.0) / (6144.0 - 192.0), 0.0, 1.0);\n" \
|
||||
"int scaleFactor = int(mix(1.0, 8.0, zFactor));\n" \
|
||||
"endResolutionx = endResolutionx * scaleFactor;\n" \
|
||||
"endResolutiony = endResolutiony * scaleFactor;\n" \
|
||||
"vec2 normalizedPosition = position * vec2(endResolutionx / scr_resolution.x, endResolutiony / scr_resolution.y);\n" \
|
||||
"int x = int(mod(normalizedPosition.x, 4.0));\n" \
|
||||
"int y = int(mod(normalizedPosition.y, 4.0));\n" \
|
||||
"float bayerMatrix[4*4] = float[4*4](\n" \
|
||||
"0.0, 8.0, 2.0, 10.0,\n" \
|
||||
"12.0, 4.0, 14.0, 6.0,\n" \
|
||||
"3.0, 11.0, 1.0, 9.0,\n" \
|
||||
"15.0, 7.0, 13.0, 5.0\n" \
|
||||
");\n" \
|
||||
"#ifdef SRB2_PALETTE_RENDERING\n" \
|
||||
"float threshold = (1.0 - pow(zFactor, 2.0)) * (bayerMatrix[y*4 + x] / 11.0);\n" \
|
||||
"#else\n" \
|
||||
"float threshold = (1.0 - pow(zFactor, 2.0)) * (bayerMatrix[y*4 + x] / 16.0);\n" \
|
||||
"#endif\n" \
|
||||
"return mix(baseValue + threshold - 0.5 / 16.0, baseValue, zFactor);\n"
|
||||
|
||||
#define GLSL_DOOM_COLORMAP_NODITHER \
|
||||
"return max(startmap * STARTMAP_FUDGE - scale * 0.5 * SCALE_FUDGE, cap);\n" \
|
||||
|
||||
#define GLSL_DOOM_COLORMAP \
|
||||
"float R_DoomColormap(float light, float z)\n" \
|
||||
"uniform vec2 scr_resolution;\n" \
|
||||
"float R_DoomColormap(float light, float z, vec2 position)\n" \
|
||||
"{\n" \
|
||||
"float lightnum = clamp(light / 17.0, 0.0, 15.0);\n" \
|
||||
"float lightz = clamp(z / 16.0, 0.0, 127.0);\n" \
|
||||
"float startmap = (15.0 - lightnum) * 4.0;\n" \
|
||||
"float scale = 160.0 / (lightz + 1.0);\n" \
|
||||
"float cap = (155.0 - light) * 0.26;\n" \
|
||||
"return max(startmap * STARTMAP_FUDGE - scale * 0.5 * SCALE_FUDGE, cap);\n" \
|
||||
"#ifdef SRB2_LIGHT_DITHER\n" \
|
||||
GLSL_DOOM_COLORMAP_DITHER \
|
||||
"#else\n" \
|
||||
GLSL_DOOM_COLORMAP_NODITHER \
|
||||
"#endif\n" \
|
||||
"}\n"
|
||||
|
||||
// lighting cap adjustment:
|
||||
// first num (155.0), increase to make it start to go dark sooner
|
||||
// second num (0.26), increase to make it go dark faster
|
||||
@@ -80,7 +133,7 @@
|
||||
"float R_DoomLightingEquation(float light)\n" \
|
||||
"{\n" \
|
||||
"float z = gl_FragCoord.z / gl_FragCoord.w;\n" \
|
||||
"float colormap = floor(R_DoomColormap(light, z)) + 0.5;\n" \
|
||||
"float colormap = floor(R_DoomColormap(light, z, gl_FragCoord.xy)) + 0.5;\n" \
|
||||
"return clamp(colormap, 0.0, 31.0) / 32.0;\n" \
|
||||
"}\n"
|
||||
|
||||
@@ -106,7 +159,7 @@
|
||||
#define GLSL_PALETTE_RENDERING \
|
||||
"float tex_pal_idx = texture3D(palette_lookup_tex, vec3((texel * 63.0 + 0.5) / 64.0))[0] * 255.0;\n" \
|
||||
"float z = gl_FragCoord.z / gl_FragCoord.w;\n" \
|
||||
"float light_y = clamp(floor(R_DoomColormap(lighting, z)), 0.0, 31.0);\n" \
|
||||
"float light_y = clamp(floor(R_DoomColormap(lighting, z, gl_FragCoord.xy)), 0.0, 31.0);\n" \
|
||||
"vec2 lighttable_coord = vec2((tex_pal_idx + 0.5) / 256.0, (light_y + 0.5) / 32.0);\n" \
|
||||
"vec4 final_color = texture2D(lighttable_tex, lighttable_coord);\n" \
|
||||
"final_color.a = texel.a * poly_color.a;\n" \
|
||||
@@ -145,6 +198,26 @@
|
||||
"}\n" \
|
||||
"#endif\0"
|
||||
|
||||
#define GLSL_SOFTWARE_FRAGMENT_SHADER_NOPAL \
|
||||
"uniform sampler2D tex;\n" \
|
||||
"uniform vec4 poly_color;\n" \
|
||||
"uniform vec4 tint_color;\n" \
|
||||
"uniform vec4 fade_color;\n" \
|
||||
"uniform float lighting;\n" \
|
||||
"uniform float fade_start;\n" \
|
||||
"uniform float fade_end;\n" \
|
||||
GLSL_DOOM_COLORMAP \
|
||||
GLSL_DOOM_LIGHT_EQUATION \
|
||||
"void main(void) {\n" \
|
||||
"vec4 texel = texture2D(tex, gl_TexCoord[0].st);\n" \
|
||||
"vec4 base_color = texel * poly_color;\n" \
|
||||
"vec4 final_color = base_color;\n" \
|
||||
GLSL_SOFTWARE_TINT_EQUATION \
|
||||
GLSL_SOFTWARE_FADE_EQUATION \
|
||||
"final_color.a = texel.a * poly_color.a;\n" \
|
||||
"gl_FragColor = final_color;\n" \
|
||||
"}\n" \
|
||||
|
||||
// hand tuned adjustments for light level calculation
|
||||
#define GLSL_FLOOR_FUDGES \
|
||||
"#define STARTMAP_FUDGE 1.06\n" \
|
||||
@@ -155,11 +228,20 @@
|
||||
"#define SCALE_FUDGE 2.2\n"
|
||||
|
||||
#define GLSL_FLOOR_FRAGMENT_SHADER \
|
||||
"#version 120\n" \
|
||||
GLSL_FLOOR_FUDGES \
|
||||
GLSL_SOFTWARE_FRAGMENT_SHADER
|
||||
|
||||
// this is very backwards
|
||||
// but we wanna have the game look like vanilla does
|
||||
// oh well
|
||||
#define GLSL_WALL_FRAGMENT_SHADER \
|
||||
"#version 120\n" \
|
||||
"#ifdef SRB2_PALETTE_RENDERING\n" \
|
||||
GLSL_WALL_FUDGES \
|
||||
"#else\n" \
|
||||
GLSL_FLOOR_FUDGES \
|
||||
"#endif\n" \
|
||||
GLSL_SOFTWARE_FRAGMENT_SHADER
|
||||
|
||||
//
|
||||
@@ -177,6 +259,7 @@
|
||||
"vec4 texel = texture2D(tex, vec2(gl_TexCoord[0].s - sdistort, gl_TexCoord[0].t - cdistort));\n"
|
||||
|
||||
#define GLSL_WATER_FRAGMENT_SHADER \
|
||||
"#version 120\n" \
|
||||
GLSL_FLOOR_FUDGES \
|
||||
"const float freq = 0.025;\n" \
|
||||
"const float amp = 0.025;\n" \
|
||||
@@ -225,6 +308,7 @@
|
||||
// The floor fudges are used, but should the wall fudges be used instead? or something inbetween?
|
||||
// or separate values for floors and walls? (need to change more than this shader for that)
|
||||
#define GLSL_FOG_FRAGMENT_SHADER \
|
||||
"#version 120\n" \
|
||||
GLSL_FLOOR_FUDGES \
|
||||
"uniform vec4 tint_color;\n" \
|
||||
"uniform vec4 fade_color;\n" \
|
||||
|
||||
@@ -1,123 +0,0 @@
|
||||
// Emacs style mode select -*- C++ -*-
|
||||
//-----------------------------------------------------------------------------
|
||||
//
|
||||
// Copyright (C) 2005 by SRB2 Jr. Team.
|
||||
//
|
||||
// This program is free software; you can redistribute it and/or
|
||||
// modify it under the terms of the GNU General Public License
|
||||
// as published by the Free Software Foundation; either version 2
|
||||
// of the License, or (at your option) any later version.
|
||||
//
|
||||
// This program is distributed in the hope that it will be useful,
|
||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
// GNU General Public License for more details.
|
||||
//-----------------------------------------------------------------------------
|
||||
/// \file
|
||||
/// \brief 3D sound definitions
|
||||
|
||||
#ifndef __HWS_DATA_H__
|
||||
#define __HWS_DATA_H__
|
||||
|
||||
#define NORMAL_SEP 128
|
||||
|
||||
// abuse?
|
||||
#define STATIC_SOURCES_NUM 6 // Total number of static sources
|
||||
|
||||
#define MIN_DISTANCE 160.0f
|
||||
#define MAX_DISTANCE 1200.0f
|
||||
|
||||
typedef struct source_pos_s
|
||||
{
|
||||
double x;
|
||||
double y;
|
||||
double z;
|
||||
} source_pos_t;
|
||||
|
||||
typedef struct source3D_pos_s
|
||||
{
|
||||
float x;
|
||||
float y;
|
||||
float z;
|
||||
//float angle;
|
||||
float momx;
|
||||
float momy;
|
||||
float momz;
|
||||
|
||||
} source3D_pos_t;
|
||||
|
||||
|
||||
enum {NORMAL_PITCH = 128};
|
||||
|
||||
/*typedef struct source2D_data_s
|
||||
{
|
||||
INT32 volume;
|
||||
INT32 sep;
|
||||
|
||||
} source2D_data_t;*/
|
||||
|
||||
|
||||
// General 3D sound source description
|
||||
typedef struct source3D_data_s
|
||||
{
|
||||
float min_distance; //
|
||||
float max_distance; //
|
||||
INT32 head_relative; //
|
||||
INT32 permanent; //
|
||||
source3D_pos_t pos; // source position in 3D
|
||||
|
||||
} source3D_data_t;
|
||||
|
||||
|
||||
// Sound data
|
||||
typedef struct sfx_data_s
|
||||
{
|
||||
size_t length;
|
||||
void *data;
|
||||
INT32 priority;
|
||||
INT32 sep; // Only when source is 2D sound
|
||||
} sfx_data_t;
|
||||
|
||||
|
||||
// Sound cone (for 3D sources)
|
||||
typedef struct cone_def_s
|
||||
{
|
||||
float inner;
|
||||
float outer;
|
||||
INT32 outer_gain;
|
||||
/*float f_angle;
|
||||
float h_angle;*/
|
||||
} cone_def_t;
|
||||
|
||||
|
||||
typedef struct listener_data_s
|
||||
{
|
||||
// Listener position
|
||||
double x;
|
||||
double y;
|
||||
double z;
|
||||
|
||||
// Listener front and head orientation (degrees)
|
||||
double f_angle;
|
||||
double h_angle;
|
||||
|
||||
// Listener momentums
|
||||
double momx;
|
||||
double momy;
|
||||
double momz;
|
||||
} listener_data_t;
|
||||
|
||||
typedef struct snddev_s
|
||||
{
|
||||
INT32 sample_rate;
|
||||
INT32 bps;
|
||||
size_t numsfxs;
|
||||
|
||||
// Windows specific data
|
||||
#ifdef _WIN32
|
||||
UINT32 cooplevel;
|
||||
HWND hWnd;
|
||||
#endif
|
||||
} snddev_t;
|
||||
|
||||
#endif //__HWS_DATA_H__
|
||||
@@ -358,8 +358,8 @@ static INT32 WINAPI SetRes(viddef_t *lvid, vmode_t *pcurrentmode)
|
||||
else
|
||||
textureformatGL = GL_RGB5_A1;
|
||||
|
||||
SetModelView(lvid->width, lvid->height);
|
||||
SetStates();
|
||||
GL_SetModelView(lvid->width, lvid->height);
|
||||
GL_SetStates();
|
||||
// we need to clear the depth buffer. Very important!!!
|
||||
pglClear(GL_COLOR_BUFFER_BIT|GL_DEPTH_BUFFER_BIT);
|
||||
|
||||
@@ -526,7 +526,7 @@ EXPORT void HWRAPI(Shutdown) (void)
|
||||
// -----------------+
|
||||
// FinishUpdate : Swap front and back buffers
|
||||
// -----------------+
|
||||
EXPORT void HWRAPI(FinishUpdate) (INT32 waitvbl)
|
||||
void GL_FinishUpdate (INT32 waitvbl)
|
||||
{
|
||||
#ifdef USE_WGL_SWAP
|
||||
static INT32 oldwaitvbl = 0;
|
||||
@@ -547,23 +547,4 @@ EXPORT void HWRAPI(FinishUpdate) (INT32 waitvbl)
|
||||
|
||||
SwapBuffers(hDC);
|
||||
}
|
||||
|
||||
|
||||
// -----------------+
|
||||
// SetPalette : Set the color lookup table for paletted textures
|
||||
// : in OpenGL, we store values for conversion of paletted graphics when
|
||||
// : they are downloaded to the 3D card.
|
||||
// -----------------+
|
||||
EXPORT void HWRAPI(SetPalette) (RGBA_t *pal)
|
||||
{
|
||||
INT32 i;
|
||||
|
||||
for (i = 0; i < 256; i++)
|
||||
{
|
||||
myPaletteData[i].s.red = pal[i].s.red;
|
||||
myPaletteData[i].s.green = pal[i].s.green;
|
||||
myPaletteData[i].s.blue = pal[i].s.blue;
|
||||
myPaletteData[i].s.alpha = pal[i].s.alpha;
|
||||
}
|
||||
}
|
||||
#endif
|
||||
+657
-732
File diff suppressed because it is too large.
Load diff
@@ -43,8 +43,9 @@
|
||||
#endif
|
||||
|
||||
#define _CREATE_DLL_ // necessary for Unix AND Windows
|
||||
|
||||
#include "../../doomdef.h"
|
||||
#include "../hw_drv.h"
|
||||
#include "../hw_gl.h"
|
||||
#include "../../z_zone.h"
|
||||
|
||||
// ==========================================================================
|
||||
@@ -65,14 +66,15 @@ extern FILE *gllogstream;
|
||||
// PROTOS
|
||||
// ==========================================================================
|
||||
|
||||
boolean LoadGL(void);
|
||||
FUNCPRINTF void GL_DBG_Printf(const char *format, ...);
|
||||
|
||||
void *GetGLFunc(const char *proc);
|
||||
boolean SetupGLfunc(void);
|
||||
void SetupGLFunc4(void);
|
||||
void Flush(void);
|
||||
INT32 isExtAvailable(const char *extension, const GLubyte *start);
|
||||
void SetModelView(GLint w, GLint h);
|
||||
void SetStates(void);
|
||||
void GL_Flush(void);
|
||||
INT32 GL_isExtAvailable(const char *extension, const GLubyte *start);
|
||||
void GL_SetModelView(GLint w, GLint h);
|
||||
void GL_SetStates(void);
|
||||
|
||||
#ifndef GL_EXT_texture_filter_anisotropic
|
||||
#define GL_TEXTURE_MAX_ANISOTROPY_EXT 0x84FE
|
||||
@@ -98,21 +100,12 @@ typedef void (APIENTRY * PFNglGetIntegerv) (GLenum pname, GLint *params);
|
||||
extern PFNglGetIntegerv pglGetIntegerv;
|
||||
typedef const GLubyte* (APIENTRY * PFNglGetString) (GLenum name);
|
||||
extern PFNglGetString pglGetString;
|
||||
#if 0
|
||||
typedef void (APIENTRY * PFNglEnableClientState) (GLenum cap); // redefined in r_opengl.c
|
||||
static PFNglEnableClientState pglEnableClientState;
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#ifdef USE_FBO_OGL
|
||||
void GLFramebuffer_Generate(void);
|
||||
void GLFramebuffer_Delete(void);
|
||||
|
||||
void GLFramebuffer_GenerateAttachments(void);
|
||||
void GLFramebuffer_DeleteAttachments(void);
|
||||
|
||||
void GLFramebuffer_Enable(void);
|
||||
void GLFramebuffer_Disable(void);
|
||||
void GL_Framebuffer_Unbind(void);
|
||||
void GL_Framebuffer_Enable(void);
|
||||
void GL_Framebuffer_Disable(void);
|
||||
|
||||
extern GLuint FramebufferObject, FramebufferTexture, RenderbufferObject;
|
||||
extern GLboolean FrameBufferEnabled, RenderToFramebuffer;
|
||||
@@ -126,6 +119,8 @@ extern boolean supportFBO;
|
||||
extern const GLubyte *gl_version;
|
||||
extern const GLubyte *gl_renderer;
|
||||
extern const GLubyte *gl_extensions;
|
||||
extern const GLubyte *gl_vendor;
|
||||
extern GLuint gl_num_extensions;
|
||||
|
||||
extern int majorGL, minorGL;
|
||||
|
||||
@@ -139,7 +134,6 @@ extern boolean supportMipMap;
|
||||
/** \brief OpenGL flags for video driver
|
||||
*/
|
||||
extern INT32 oglflags;
|
||||
extern GLint textureformatGL;
|
||||
|
||||
extern GLfloat projMatrix[16];
|
||||
|
||||
|
||||
File diff suppressed because it is too large.
Load diff
@@ -1,59 +0,0 @@
|
||||
[Project]
|
||||
FileName=s_ds3d.dev
|
||||
Name=s_ds3d
|
||||
Ver=1
|
||||
IsCpp=1
|
||||
Type=3
|
||||
Compiler=-D_M_IX86=500_@@_-Wall_@@_-D_WINDOWS_@@_-Os_@@_-fno-strict-aliasing_@@_-fomit-frame-pointer_@@_
|
||||
CppCompiler=
|
||||
Includes=
|
||||
Linker=--def ../s_mingw.def_@@_-luuid_@@_-ldsound_@@_
|
||||
Libs=
|
||||
UnitCount=1
|
||||
Folders=
|
||||
ObjFiles=
|
||||
PrivateResource=
|
||||
ResourceIncludes=
|
||||
MakeIncludes=
|
||||
Icon=
|
||||
ExeOutput=C:\srb2demo2
|
||||
ObjectOutput=..\..\..\objs\Mingw\s_ds3d
|
||||
OverrideOutput=1
|
||||
OverrideOutputName=s_ds3d.dll
|
||||
HostApplication=
|
||||
CommandLine=
|
||||
IncludeVersionInfo=0
|
||||
SupportXPThemes=0
|
||||
CompilerSet=0
|
||||
CompilerSettings=00000000000000000111d0
|
||||
UseCustomMakefile=0
|
||||
CustomMakefile=
|
||||
|
||||
[Unit1]
|
||||
FileName=s_ds3d.c
|
||||
Folder=
|
||||
Compile=1
|
||||
CompileCpp=0
|
||||
Link=1
|
||||
Priority=1000
|
||||
OverrideBuildCmd=0
|
||||
BuildCmd=
|
||||
|
||||
[VersionInfo]
|
||||
Major=0
|
||||
Minor=1
|
||||
Release=1
|
||||
Build=1
|
||||
LanguageID=1033
|
||||
CharsetID=1252
|
||||
CompanyName=
|
||||
FileVersion=0.1
|
||||
FileDescription=Developed using the Dev-C++ IDE
|
||||
InternalName=
|
||||
LegalCopyright=
|
||||
LegalTrademarks=
|
||||
OriginalFilename=s_ds3d.exe
|
||||
ProductName=s_ds3d
|
||||
ProductVersion=0.1
|
||||
AutoIncBuildNr=0
|
||||
|
||||
@@ -1,99 +0,0 @@
|
||||
# Microsoft Developer Studio Project File - Name="s_ds3d" - Package Owner=<4>
|
||||
# Microsoft Developer Studio Generated Build File, Format Version 6.00
|
||||
# ** DO NOT EDIT **
|
||||
|
||||
# TARGTYPE "Win32 (x86) Dynamic-Link Library" 0x0102
|
||||
|
||||
CFG=s_ds3d - Win32 Debug
|
||||
!MESSAGE This is not a valid makefile. To build this project using NMAKE,
|
||||
!MESSAGE use the Export Makefile command and run
|
||||
!MESSAGE
|
||||
!MESSAGE NMAKE /f "s_ds3d.mak".
|
||||
!MESSAGE
|
||||
!MESSAGE You can specify a configuration when running NMAKE
|
||||
!MESSAGE by defining the macro CFG on the command line. For example:
|
||||
!MESSAGE
|
||||
!MESSAGE NMAKE /f "s_ds3d.mak" CFG="s_ds3d - Win32 Debug"
|
||||
!MESSAGE
|
||||
!MESSAGE Possible choices for configuration are:
|
||||
!MESSAGE
|
||||
!MESSAGE "s_ds3d - Win32 Release" (based on "Win32 (x86) Dynamic-Link Library")
|
||||
!MESSAGE "s_ds3d - Win32 Debug" (based on "Win32 (x86) Dynamic-Link Library")
|
||||
!MESSAGE
|
||||
|
||||
# Begin Project
|
||||
# PROP AllowPerConfigDependencies 0
|
||||
# PROP Scc_ProjName ""
|
||||
# PROP Scc_LocalPath ""
|
||||
CPP=cl.exe
|
||||
MTL=midl.exe
|
||||
RSC=rc.exe
|
||||
|
||||
!IF "$(CFG)" == "s_ds3d - Win32 Release"
|
||||
|
||||
# PROP BASE Use_MFC 0
|
||||
# PROP BASE Use_Debug_Libraries 0
|
||||
# PROP BASE Output_Dir "Release"
|
||||
# PROP BASE Intermediate_Dir "Release"
|
||||
# PROP BASE Target_Dir ""
|
||||
# PROP Use_MFC 0
|
||||
# PROP Use_Debug_Libraries 0
|
||||
# PROP Output_Dir "..\..\..\bin\VC\Release\s_ds3d"
|
||||
# PROP Intermediate_Dir "..\..\..\objs\VC\Release\s_ds3d"
|
||||
# PROP Ignore_Export_Lib 1
|
||||
# PROP Target_Dir ""
|
||||
# ADD BASE CPP /nologo /MT /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "S_DS3D_EXPORTS" /YX /FD /c
|
||||
# ADD CPP /nologo /G5 /MT /W3 /GX /Zi /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "__WIN32__" /D "__MSC__" /FD /c
|
||||
# SUBTRACT CPP /YX
|
||||
# ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /win32
|
||||
# ADD MTL /nologo /D "NDEBUG" /mktyplib203 /win32
|
||||
# ADD BASE RSC /l 0x419 /d "NDEBUG"
|
||||
# ADD RSC /l 0x40c /d "NDEBUG"
|
||||
BSC32=bscmake.exe
|
||||
# ADD BASE BSC32 /nologo
|
||||
# ADD BSC32 /nologo
|
||||
LINK32=link.exe
|
||||
# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /machine:I386
|
||||
# ADD LINK32 dsound.lib /nologo /dll /pdb:"..\..\..\bin\VC\Release\s_ds3d.pdb" /machine:I386 /out:"..\..\..\bin\VC\Release\s_ds3d.dll"
|
||||
# SUBTRACT LINK32 /pdb:none
|
||||
|
||||
!ELSEIF "$(CFG)" == "s_ds3d - Win32 Debug"
|
||||
|
||||
# PROP BASE Use_MFC 0
|
||||
# PROP BASE Use_Debug_Libraries 1
|
||||
# PROP BASE Output_Dir "Debug"
|
||||
# PROP BASE Intermediate_Dir "Debug"
|
||||
# PROP BASE Target_Dir ""
|
||||
# PROP Use_MFC 0
|
||||
# PROP Use_Debug_Libraries 1
|
||||
# PROP Output_Dir "..\..\..\bin\VC\Debug\s_ds3d"
|
||||
# PROP Intermediate_Dir "..\..\..\objs\VC\Debug\s_ds3d"
|
||||
# PROP Ignore_Export_Lib 1
|
||||
# PROP Target_Dir ""
|
||||
# ADD BASE CPP /nologo /MTd /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "S_DS3D_EXPORTS" /YX /FD /GZ /c
|
||||
# ADD CPP /nologo /MTd /W4 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "__WIN32__" /D "__MSC__" /FD /GZ /c
|
||||
# SUBTRACT CPP /YX
|
||||
# ADD BASE MTL /nologo /D "_DEBUG" /mktyplib203 /win32
|
||||
# ADD MTL /nologo /D "_DEBUG" /mktyplib203 /o "NUL" /win32
|
||||
# ADD BASE RSC /l 0x419 /d "_DEBUG"
|
||||
# ADD RSC /l 0x40c /d "_DEBUG"
|
||||
BSC32=bscmake.exe
|
||||
# ADD BASE BSC32 /nologo
|
||||
# ADD BSC32 /nologo
|
||||
LINK32=link.exe
|
||||
# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /debug /machine:I386 /pdbtype:sept
|
||||
# ADD LINK32 dsound.lib /nologo /dll /pdb:"..\..\..\bin\VC\Debug\s_ds3d.pdb" /debug /machine:I386 /out:"..\..\..\bin\VC\Debug\s_ds3d.dll" /pdbtype:sept
|
||||
# SUBTRACT LINK32 /pdb:none /incremental:no /nodefaultlib
|
||||
|
||||
!ENDIF
|
||||
|
||||
# Begin Target
|
||||
|
||||
# Name "s_ds3d - Win32 Release"
|
||||
# Name "s_ds3d - Win32 Debug"
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\s_ds3d.c
|
||||
# End Source File
|
||||
# End Target
|
||||
# End Project
|
||||
File diff suppressed because it is too large.
Load diff
@@ -1,59 +0,0 @@
|
||||
[Project]
|
||||
FileName=s_fmod.dev
|
||||
Name=s_fmod
|
||||
Ver=1
|
||||
IsCpp=1
|
||||
Type=3
|
||||
Compiler=-D_M_IX86=500_@@_-Wall_@@_-D_WINDOWS_@@_-Os_@@_-fomit-frame-pointer_@@_
|
||||
CppCompiler=
|
||||
Includes=..\..\win32\FMOD
|
||||
Linker=--def ../s_mingw.def_@@_-lfmod_@@_
|
||||
Libs=..\..\win32\FMOD
|
||||
UnitCount=1
|
||||
Folders=
|
||||
ObjFiles=
|
||||
PrivateResource=
|
||||
ResourceIncludes=
|
||||
MakeIncludes=
|
||||
Icon=
|
||||
ExeOutput=C:\srb2demo2
|
||||
ObjectOutput=..\..\..\objs\Mingw\s_fmod
|
||||
OverrideOutput=1
|
||||
OverrideOutputName=s_fmod.dll
|
||||
HostApplication=
|
||||
CommandLine=
|
||||
IncludeVersionInfo=0
|
||||
SupportXPThemes=0
|
||||
CompilerSet=0
|
||||
CompilerSettings=00000000000000000111d0
|
||||
UseCustomMakefile=0
|
||||
CustomMakefile=
|
||||
|
||||
[Unit1]
|
||||
FileName=s_fmod.c
|
||||
Folder=
|
||||
Compile=1
|
||||
CompileCpp=0
|
||||
Link=1
|
||||
Priority=1000
|
||||
OverrideBuildCmd=0
|
||||
BuildCmd=
|
||||
|
||||
[VersionInfo]
|
||||
Major=1
|
||||
Minor=0
|
||||
Release=8
|
||||
Build=42
|
||||
LanguageID=1033
|
||||
CharsetID=1252
|
||||
CompanyName=Alam Arias
|
||||
FileVersion=1.42
|
||||
FileDescription=SRB2 Sound API DLL for FMOD
|
||||
InternalName=Super FMOD!
|
||||
LegalCopyright=
|
||||
LegalTrademarks=
|
||||
OriginalFilename=s_fmod.dll
|
||||
ProductName=s_fmod
|
||||
ProductVersion=0.1
|
||||
AutoIncBuildNr=0
|
||||
|
||||
@@ -1,97 +0,0 @@
|
||||
# Microsoft Developer Studio Project File - Name="s_fmod" - Package Owner=<4>
|
||||
# Microsoft Developer Studio Generated Build File, Format Version 6.00
|
||||
# ** DO NOT EDIT **
|
||||
|
||||
# TARGTYPE "Win32 (x86) Dynamic-Link Library" 0x0102
|
||||
|
||||
CFG=s_fmod - Win32 Debug
|
||||
!MESSAGE This is not a valid makefile. To build this project using NMAKE,
|
||||
!MESSAGE use the Export Makefile command and run
|
||||
!MESSAGE
|
||||
!MESSAGE NMAKE /f "s_fmod.mak".
|
||||
!MESSAGE
|
||||
!MESSAGE You can specify a configuration when running NMAKE
|
||||
!MESSAGE by defining the macro CFG on the command line. For example:
|
||||
!MESSAGE
|
||||
!MESSAGE NMAKE /f "s_fmod.mak" CFG="s_fmod - Win32 Debug"
|
||||
!MESSAGE
|
||||
!MESSAGE Possible choices for configuration are:
|
||||
!MESSAGE
|
||||
!MESSAGE "s_fmod - Win32 Release" (based on "Win32 (x86) Dynamic-Link Library")
|
||||
!MESSAGE "s_fmod - Win32 Debug" (based on "Win32 (x86) Dynamic-Link Library")
|
||||
!MESSAGE
|
||||
|
||||
# Begin Project
|
||||
# PROP AllowPerConfigDependencies 0
|
||||
# PROP Scc_ProjName ""
|
||||
# PROP Scc_LocalPath ""
|
||||
CPP=cl.exe
|
||||
MTL=midl.exe
|
||||
RSC=rc.exe
|
||||
|
||||
!IF "$(CFG)" == "s_fmod - Win32 Release"
|
||||
|
||||
# PROP BASE Use_MFC 0
|
||||
# PROP BASE Use_Debug_Libraries 0
|
||||
# PROP BASE Output_Dir "Release"
|
||||
# PROP BASE Intermediate_Dir "Release"
|
||||
# PROP BASE Target_Dir ""
|
||||
# PROP Use_MFC 0
|
||||
# PROP Use_Debug_Libraries 0
|
||||
# PROP Output_Dir "..\..\..\bin\VC\Release\s_fmod"
|
||||
# PROP Intermediate_Dir "..\..\..\objs\VC\Release\s_fmod"
|
||||
# PROP Ignore_Export_Lib 1
|
||||
# PROP Target_Dir ""
|
||||
# ADD BASE CPP /nologo /MT /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "S_FMOD_EXPORTS" /YX /FD /c
|
||||
# ADD CPP /nologo /MT /W3 /GX /Zi /O2 /D "NDEBUG" /D "WIN32" /D "_WINDOWS" /D "__WIN32__" /D "__MSC__" /FR /FD /c
|
||||
# SUBTRACT CPP /YX
|
||||
# ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /win32
|
||||
# ADD MTL /nologo /D "NDEBUG" /mktyplib203 /win32
|
||||
# ADD BASE RSC /l 0x409 /d "NDEBUG"
|
||||
# ADD RSC /l 0x409 /d "NDEBUG"
|
||||
BSC32=bscmake.exe
|
||||
# ADD BASE BSC32 /nologo
|
||||
# ADD BSC32 /nologo
|
||||
LINK32=link.exe
|
||||
# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /machine:I386
|
||||
# ADD LINK32 fmodvc.lib /nologo /dll /pdb:"..\..\..\bin\VC\Release\s_fmod.pdb" /machine:I386 /out:"..\..\..\bin\VC\Release\s_fmod.dll"
|
||||
|
||||
!ELSEIF "$(CFG)" == "s_fmod - Win32 Debug"
|
||||
|
||||
# PROP BASE Use_MFC 0
|
||||
# PROP BASE Use_Debug_Libraries 1
|
||||
# PROP BASE Output_Dir "Debug"
|
||||
# PROP BASE Intermediate_Dir "Debug"
|
||||
# PROP BASE Target_Dir ""
|
||||
# PROP Use_MFC 0
|
||||
# PROP Use_Debug_Libraries 1
|
||||
# PROP Output_Dir "..\..\..\bin\VC\Debug\s_fmod"
|
||||
# PROP Intermediate_Dir "..\..\..\objs\VC\Debug\s_fmod"
|
||||
# PROP Ignore_Export_Lib 1
|
||||
# PROP Target_Dir ""
|
||||
# ADD BASE CPP /nologo /MTd /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "S_FMOD_EXPORTS" /YX /FD /GZ /c
|
||||
# ADD CPP /nologo /MTd /W4 /Gm /GX /ZI /Od /D "_DEBUG" /D "WIN32" /D "_WINDOWS" /D "__WIN32__" /D "__MSC__" /FR /FD /GZ /c
|
||||
# SUBTRACT CPP /YX
|
||||
# ADD BASE MTL /nologo /D "_DEBUG" /mktyplib203 /win32
|
||||
# ADD MTL /nologo /D "_DEBUG" /mktyplib203 /win32
|
||||
# ADD BASE RSC /l 0x409 /d "_DEBUG"
|
||||
# ADD RSC /l 0x409 /d "_DEBUG"
|
||||
BSC32=bscmake.exe
|
||||
# ADD BASE BSC32 /nologo
|
||||
# ADD BSC32 /nologo
|
||||
LINK32=link.exe
|
||||
# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /debug /machine:I386 /pdbtype:sept
|
||||
# ADD LINK32 fmodvc.lib /nologo /dll /pdb:"..\..\..\bin\VC\Debug\s_fmod.pdb" /debug /machine:I386 /out:"..\..\..\bin\VC\Debug\s_fmod.dll" /pdbtype:sept
|
||||
|
||||
!ENDIF
|
||||
|
||||
# Begin Target
|
||||
|
||||
# Name "s_fmod - Win32 Release"
|
||||
# Name "s_fmod - Win32 Debug"
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\s_fmod.c
|
||||
# End Source File
|
||||
# End Target
|
||||
# End Project
|
||||
@@ -1,998 +0,0 @@
|
||||
// Emacs style mode select -*- C++ -*-
|
||||
//-----------------------------------------------------------------------------
|
||||
//
|
||||
// Copyright (C) 2001 by DooM Legacy Team.
|
||||
//
|
||||
// This program is free software; you can redistribute it and/or
|
||||
// modify it under the terms of the GNU General Public License
|
||||
// as published by the Free Software Foundation; either version 2
|
||||
// of the License, or (at your option) any later version.
|
||||
//
|
||||
// This program is distributed in the hope that it will be useful,
|
||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
// GNU General Public License for more details.
|
||||
//-----------------------------------------------------------------------------
|
||||
/// \file
|
||||
/// \brief General driver for 3D sound system
|
||||
///
|
||||
/// Implementend via OpenAL API
|
||||
|
||||
#ifdef _WINDOWS
|
||||
//#define WIN32_LEAN_AND_MEAN
|
||||
#define RPC_NO_WINDOWS_H
|
||||
#include <windows.h>
|
||||
#include <stdio.h>
|
||||
FILE* logstream = NULL;
|
||||
#else
|
||||
#include <stdarg.h>
|
||||
#include <unistd.h>
|
||||
#include <sys/types.h>
|
||||
#include <sys/stat.h>
|
||||
#include <fcntl.h>
|
||||
#include <stdio.h>
|
||||
#ifndef HAVE_SDL // let not make a logstream here is we are inline the HW3D in the SDL binary
|
||||
FILE* logstream = NULL;
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#ifdef __APPLE__
|
||||
#include <al.h> //Main AL
|
||||
#include <alc.h> //Helpers
|
||||
#else
|
||||
#include <AL/al.h> //Main AL
|
||||
#include <AL/alc.h> //Helpers
|
||||
#endif
|
||||
|
||||
#define _CREATE_DLL_
|
||||
#include "../../doomdef.h"
|
||||
#include "../hw3dsdrv.h"
|
||||
|
||||
//#undef DEBUG_TO_FILE
|
||||
//#if defined ( HAVE_SDL ) && !defined ( LOGMESSAGES )
|
||||
#define DEBUG_TO_FILE
|
||||
//#endif
|
||||
|
||||
// Internal sound stack
|
||||
typedef struct stack_snd_s
|
||||
{
|
||||
ALuint ALsource;// 3D data of 3D source
|
||||
|
||||
ALint sfx_id;// Currently unused
|
||||
|
||||
ALint LRU;// Currently unused
|
||||
|
||||
ALboolean permanent;// Flag of static source
|
||||
} stack_snd_t;
|
||||
|
||||
#ifndef AL_INVALID
|
||||
#define AL_INVALID (-1)
|
||||
#endif
|
||||
|
||||
static I_Error_t I_ErrorOpenAl = NULL;
|
||||
static stack_snd_t *ALstack = NULL; // Sound stack
|
||||
static ALsizei allocated_sounds = 0; // Size of stack
|
||||
static ALsizei allocate_delta = 16;
|
||||
static ALCdevice *ALCDevice = NULL;
|
||||
static ALCcontext *ALContext = NULL;
|
||||
static ALenum ALo_Lasterror = AL_NO_ERROR;
|
||||
static ALenum ALCo_Lasterror = ALC_NO_ERROR;
|
||||
|
||||
static ALenum ALo_GetError(ALvoid)
|
||||
{
|
||||
ALo_Lasterror = alGetError();
|
||||
return ALo_Lasterror;
|
||||
}
|
||||
|
||||
static ALenum ALCo_GetError(ALvoid)
|
||||
{
|
||||
ALCo_Lasterror = alcGetError(ALCDevice);
|
||||
return ALCo_Lasterror;
|
||||
}
|
||||
|
||||
static ALfloat ALvol(ALint vol, ALsizei step)
|
||||
{
|
||||
return ((ALfloat)vol)/(ALfloat)step;
|
||||
}
|
||||
|
||||
/*
|
||||
static ALfloat Alpitch(ALint pitch)
|
||||
{
|
||||
#if 1
|
||||
pitch = NORMAL_PITCH;
|
||||
#endif
|
||||
return pitch < NORMAL_PITCH ?
|
||||
(float)(pitch + NORMAL_PITCH) / (NORMAL_PITCH * 2)
|
||||
:(float)pitch / (float)NORMAL_PITCH;
|
||||
}
|
||||
*/
|
||||
|
||||
static const ALchar *GetALErrorString(ALenum err)
|
||||
{
|
||||
switch (err)
|
||||
{
|
||||
case AL_NO_ERROR:
|
||||
return "There no error";
|
||||
break;
|
||||
|
||||
case AL_INVALID_NAME:
|
||||
return "Invalid name";
|
||||
break;
|
||||
|
||||
case AL_INVALID_ENUM:
|
||||
return "Invalid enum";
|
||||
break;
|
||||
|
||||
case AL_INVALID_VALUE:
|
||||
return "Invalid value";
|
||||
break;
|
||||
|
||||
case AL_INVALID_OPERATION:
|
||||
return "Invalid operation";
|
||||
break;
|
||||
|
||||
case AL_OUT_OF_MEMORY:
|
||||
return "Out Of Memory";
|
||||
break;
|
||||
|
||||
default:
|
||||
return alGetString(err);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
static const ALchar *GetALCErrorString(ALenum err)
|
||||
{
|
||||
switch (err)
|
||||
{
|
||||
case ALC_NO_ERROR:
|
||||
return "There no error";
|
||||
break;
|
||||
|
||||
case ALC_INVALID_DEVICE:
|
||||
return "Invalid Device";
|
||||
break;
|
||||
|
||||
case ALC_INVALID_CONTEXT:
|
||||
return "Invalid Context";
|
||||
break;
|
||||
|
||||
case ALC_INVALID_ENUM:
|
||||
return "Invalid enum";
|
||||
break;
|
||||
|
||||
case ALC_INVALID_VALUE:
|
||||
return "Invalid value";
|
||||
break;
|
||||
|
||||
case ALC_OUT_OF_MEMORY:
|
||||
return "Out Of Memory";
|
||||
break;
|
||||
|
||||
default:
|
||||
return alcGetString(ALCDevice, err);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
/***************************************************************
|
||||
*
|
||||
* DBG_Printf
|
||||
* Output error messages to debug log if DEBUG_TO_FILE is defined,
|
||||
* else do nothing
|
||||
*
|
||||
**************************************************************
|
||||
*/
|
||||
// -----------------+
|
||||
// DBG_Printf : Output error messages to debug log if DEBUG_TO_FILE is defined,
|
||||
// : else do nothing
|
||||
// Returns :
|
||||
// -----------------+
|
||||
FUNCPRINTF void DBG_Printf(const char *lpFmt, ... )
|
||||
{
|
||||
#ifdef DEBUG_TO_FILE
|
||||
char str[4096] = "";
|
||||
va_list arglist;
|
||||
|
||||
va_start(arglist, lpFmt);
|
||||
vsnprintf(str, 4096, lpFmt, arglist);
|
||||
va_end(arglist);
|
||||
if (logstream)
|
||||
fwrite(str, strlen(str), 1 , logstream);
|
||||
#else
|
||||
lpFmt = NULL;
|
||||
#endif
|
||||
}
|
||||
|
||||
/***************************************************************
|
||||
*
|
||||
* Grow internal sound stack by allocate_delta amount
|
||||
*
|
||||
***************************************************************
|
||||
*/
|
||||
static ALboolean reallocate_stack(void)
|
||||
{
|
||||
stack_snd_t *new_stack;
|
||||
if (ALstack)
|
||||
new_stack = realloc(ALstack, sizeof (stack_snd_t) * (allocated_sounds + allocate_delta));
|
||||
else
|
||||
new_stack = malloc(sizeof (stack_snd_t) * (allocate_delta));
|
||||
if (new_stack)
|
||||
{
|
||||
ALsizei clean_stack;
|
||||
ALstack = new_stack;
|
||||
memset(&ALstack[allocated_sounds], 0, allocate_delta * sizeof (stack_snd_t));
|
||||
for (clean_stack = allocated_sounds; clean_stack < allocated_sounds; clean_stack++)
|
||||
ALstack[clean_stack].ALsource = (ALuint)AL_INVALID;
|
||||
allocated_sounds += allocate_delta;
|
||||
return AL_TRUE;
|
||||
}
|
||||
return AL_FALSE;
|
||||
}
|
||||
|
||||
|
||||
/***************************************************************
|
||||
*
|
||||
* Destroys source in stack
|
||||
*
|
||||
***************************************************************
|
||||
*/
|
||||
static ALvoid kill_sound(stack_snd_t *snd)
|
||||
{
|
||||
if (alIsSource(snd->ALsource))
|
||||
alDeleteSources(1,&snd->ALsource);
|
||||
if (ALo_GetError() != AL_NO_ERROR)
|
||||
{
|
||||
DBG_Printf("%s: alDeleteSources, %s", __FUNCTION__, GetALErrorString(ALo_Lasterror));
|
||||
}
|
||||
memset(snd,0, sizeof (stack_snd_t));
|
||||
snd->ALsource = (ALuint)AL_INVALID;
|
||||
}
|
||||
|
||||
/***************************************************************
|
||||
*
|
||||
* Returns free (unused) source stack slot
|
||||
* If none available sound stack will be increased
|
||||
*
|
||||
***************************************************************
|
||||
*/
|
||||
static ALsizei find_handle(void)
|
||||
{
|
||||
ALsizei free_sfx = 0;
|
||||
stack_snd_t *snd;
|
||||
|
||||
for (snd = ALstack; free_sfx < allocated_sounds; snd++, free_sfx++)
|
||||
{
|
||||
if (snd->permanent)
|
||||
continue;
|
||||
if (snd->ALsource==(ALuint)AL_INVALID)
|
||||
break;
|
||||
if (!alIsSource(snd->ALsource))
|
||||
break;
|
||||
ALo_GetError();
|
||||
if (snd->sfx_id == 0)
|
||||
break;
|
||||
}
|
||||
|
||||
// No suitable resource found so increase sound stack
|
||||
//DBG_Printf("sfx chan %d\n", free_sfx);
|
||||
if (free_sfx == allocated_sounds)
|
||||
{
|
||||
DBG_Printf("No free or same sfx found so increase stack (currently %d srcs)\n", allocated_sounds);
|
||||
free_sfx = reallocate_stack() ? free_sfx : (ALsizei)AL_INVALID;
|
||||
}
|
||||
return free_sfx;
|
||||
}
|
||||
|
||||
static ALvoid ALSetPan(ALuint sid, INT32 sep)
|
||||
{
|
||||
ALfloat facing[3] ={0.0f, 0.0f, 0.0f}; //Alam: bad?
|
||||
const ALfloat fsep = (ALfloat)sep;
|
||||
const ALfloat nsep = (ALfloat)NORMAL_SEP;
|
||||
if (sep)
|
||||
{
|
||||
facing[0] = (ALfloat)(fsep/nsep);
|
||||
facing[2] = 1.0f;
|
||||
}
|
||||
alSourcefv(sid, AL_POSITION, facing);
|
||||
if (ALo_GetError() != AL_NO_ERROR)
|
||||
{
|
||||
DBG_Printf("%s: alSourcefv, %s", __FUNCTION__, GetALErrorString(ALo_Lasterror));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/******************************************************************************
|
||||
*
|
||||
* Initialise driver and listener
|
||||
*
|
||||
*****************************************************************************/
|
||||
EXPORT INT32 HWRAPI( Startup ) (I_Error_t FatalErrorFunction, snddev_t *snd_dev)
|
||||
{
|
||||
ALenum model = AL_INVERSE_DISTANCE_CLAMPED;
|
||||
ALCboolean inited = ALC_FALSE;
|
||||
ALCint AlSetup[8] = {ALC_FREQUENCY,22050,ALC_REFRESH,35,ALC_SYNC,AL_FALSE,ALC_INVALID,ALC_INVALID};
|
||||
#if (defined (_WIN32) || defined (_WIN64)) && 0
|
||||
const ALCubyte *ALCdriver = alcGetString(NULL,ALC_DEFAULT_DEVICE_SPECIFIER);
|
||||
const ALCubyte *DSdriver = "DirectSound";
|
||||
|
||||
if (!strcmp((const ALCbyte *)ALCdriver,"DirectSound3D")) //Alam: OpenAL's DS3D is buggy
|
||||
ALCDevice = alcOpenDevice(DSdriver); //Open DirectSound
|
||||
else //Alam: The OpenAl device
|
||||
ALCDevice = alcOpenDevice(ALCdriver); //Open Default
|
||||
#else
|
||||
ALCDevice = alcOpenDevice(alcGetString(NULL,ALC_DEFAULT_DEVICE_SPECIFIER));
|
||||
#endif
|
||||
if (ALCo_GetError() != ALC_NO_ERROR || !ALCDevice)
|
||||
{
|
||||
DBG_Printf("S_OpenAl: Error %s when opening device!\n", GetALCErrorString(ALCo_Lasterror));
|
||||
return inited;
|
||||
}
|
||||
else
|
||||
{
|
||||
DBG_Printf("Driver Name : %s\n", alcGetString(ALCDevice,ALC_DEVICE_SPECIFIER));
|
||||
DBG_Printf("Extensions : %s\n", alcGetString(ALCDevice,ALC_EXTENSIONS));
|
||||
DBG_Printf("S_OpenAl: OpenAl Device %s opened\n",alcGetString(ALCDevice, ALC_DEVICE_SPECIFIER));
|
||||
}
|
||||
|
||||
I_ErrorOpenAl = FatalErrorFunction;
|
||||
|
||||
AlSetup[1] = snd_dev->sample_rate; //ALC_FREQUENCY
|
||||
AlSetup[1] = 44100;
|
||||
AlSetup[3] = 35; //ALC_REFRESH
|
||||
|
||||
//Alam: The Environment?
|
||||
ALContext = alcCreateContext(ALCDevice,AlSetup);
|
||||
if (ALCo_GetError() != ALC_NO_ERROR || !ALContext)
|
||||
{
|
||||
DBG_Printf("S_OpenAl: Error %s when making the environment!\n",GetALCErrorString(ALCo_Lasterror));
|
||||
return inited;
|
||||
}
|
||||
else
|
||||
{
|
||||
DBG_Printf("S_OpenAl: OpenAl environment made\n");
|
||||
}
|
||||
|
||||
alcMakeContextCurrent(ALContext);
|
||||
if (ALCo_GetError() != ALC_NO_ERROR)
|
||||
{
|
||||
DBG_Printf("S_OpenAl: Error %s when setting the environment!\n",GetALCErrorString(ALCo_Lasterror));
|
||||
return inited;
|
||||
}
|
||||
else
|
||||
{
|
||||
DBG_Printf("S_OpenAl: OpenAl environment setted up\n");
|
||||
}
|
||||
|
||||
DBG_Printf("Vendor : %s\n", alGetString(AL_VENDOR));
|
||||
DBG_Printf("Renderer : %s\n", alGetString(AL_RENDERER));
|
||||
DBG_Printf("Version : %s\n", alGetString(AL_VERSION));
|
||||
DBG_Printf("Extensions : %s\n", alGetString(AL_EXTENSIONS));
|
||||
|
||||
alDopplerFactor(0.0f);
|
||||
if (ALo_GetError() != AL_NO_ERROR)
|
||||
{
|
||||
DBG_Printf("S_OpenAl: Error %s when setting Doppler Factor!\n",GetALErrorString(ALo_Lasterror));
|
||||
return inited;
|
||||
}
|
||||
else
|
||||
{
|
||||
DBG_Printf("S_OpenAl: Doppler Factor of %f setted\n", alGetDouble(AL_DOPPLER_FACTOR));
|
||||
}
|
||||
|
||||
alSpeedOfSound(600.0f);
|
||||
if (ALo_GetError() != AL_NO_ERROR)
|
||||
{
|
||||
DBG_Printf("S_OpenAl: Error %s when setting Speed of Sound!\n",GetALErrorString(ALo_Lasterror));
|
||||
return inited;
|
||||
}
|
||||
else
|
||||
{
|
||||
DBG_Printf("S_OpenAl: Speed of Sound set to %f\n", alGetDouble(AL_SPEED_OF_SOUND));
|
||||
}
|
||||
|
||||
alDistanceModel(model);
|
||||
if (ALo_GetError() != AL_NO_ERROR)
|
||||
{
|
||||
DBG_Printf("S_OpenAl: Error %s when setting Distance Model!\n",GetALErrorString(ALo_Lasterror));
|
||||
return inited;
|
||||
}
|
||||
else
|
||||
{
|
||||
//DBG_Printf("S_OpenAl: %s mode setted\n",alGetString(model));
|
||||
}
|
||||
|
||||
inited = reallocate_stack();
|
||||
|
||||
return inited;
|
||||
}
|
||||
|
||||
/******************************************************************************
|
||||
*
|
||||
* Shutdown 3D Sound
|
||||
*
|
||||
******************************************************************************/
|
||||
EXPORT void HWRAPI( Shutdown ) ( void )
|
||||
{
|
||||
ALsizei i;
|
||||
|
||||
DBG_Printf ("S_OpenAL Shutdown()\n");
|
||||
|
||||
for (i = 0; i < allocated_sounds; i++)
|
||||
{
|
||||
StopSource(i);
|
||||
kill_sound(ALstack + i);
|
||||
}
|
||||
|
||||
#if defined(linux) || defined(__linux) || defined(__linux__)
|
||||
alcMakeContextCurrent(NULL);
|
||||
//TODO:check?
|
||||
#endif
|
||||
|
||||
if (ALContext)
|
||||
{
|
||||
alcDestroyContext(ALContext);
|
||||
ALContext = NULL;
|
||||
}
|
||||
|
||||
if (ALstack)
|
||||
{
|
||||
free(ALstack);
|
||||
ALstack = NULL;
|
||||
}
|
||||
|
||||
//TODO:check?
|
||||
if (ALCDevice)
|
||||
{
|
||||
alcCloseDevice(ALCDevice);
|
||||
ALCDevice = NULL;
|
||||
}
|
||||
//TODO:check?
|
||||
}
|
||||
|
||||
#ifdef _MSC_VER
|
||||
#pragma warning(disable : 4200)
|
||||
#pragma pack(1)
|
||||
#endif
|
||||
|
||||
typedef struct
|
||||
{
|
||||
ALushort header; // 3?
|
||||
ALushort samplerate; // 11025+
|
||||
ALushort samples; // number of samples
|
||||
ALushort dummy; // 0
|
||||
ALubyte data[0]; // data;
|
||||
} ATTRPACK dssfx_t;
|
||||
|
||||
#ifdef _MSC_VER
|
||||
#pragma pack()
|
||||
#pragma warning(default : 4200)
|
||||
#endif
|
||||
|
||||
static ALsizei getfreq(ALvoid *sfxdata, size_t len)
|
||||
{
|
||||
dssfx_t *dsfx = sfxdata;
|
||||
const ALsizei freq = SHORT(dsfx->samplerate);
|
||||
|
||||
if (len <= 8)
|
||||
return 0;
|
||||
else
|
||||
return freq;
|
||||
}
|
||||
|
||||
static ALsizei makechan(ALuint sfxhandle, ALboolean perm)
|
||||
{
|
||||
ALsizei chan = find_handle();
|
||||
|
||||
if (chan == (ALsizei)AL_INVALID) return chan;
|
||||
|
||||
alGenSources(1, &ALstack[chan].ALsource);
|
||||
if (ALo_GetError() != AL_NO_ERROR || !alIsSource(ALstack[chan].ALsource))
|
||||
{
|
||||
DBG_Printf("S_OpenAl: Error %s when make an ALSource!\n",GetALErrorString(ALo_Lasterror));
|
||||
ALstack[chan].ALsource = (ALuint)AL_INVALID;
|
||||
return (ALsizei)AL_INVALID;
|
||||
}
|
||||
|
||||
ALstack[chan].permanent = perm;
|
||||
|
||||
alSourceQueueBuffers(ALstack[chan].ALsource, 1, &sfxhandle);
|
||||
if (ALo_GetError() != AL_NO_ERROR)
|
||||
{
|
||||
DBG_Printf("S_OpenAl: Error %s when queue up an alSource!\n",GetALErrorString(ALo_Lasterror));
|
||||
}
|
||||
|
||||
return chan;
|
||||
}
|
||||
|
||||
/******************************************************************************
|
||||
*
|
||||
* Creates ?D source
|
||||
*
|
||||
******************************************************************************/
|
||||
EXPORT INT32 HWRAPI ( AddSource ) (source3D_data_t *src, u_int sfxhandle)
|
||||
{
|
||||
ALsizei chan = makechan(sfxhandle, (ALboolean)(src?src->permanent:AL_FALSE));
|
||||
ALuint sid = (ALuint)AL_INVALID;
|
||||
if (chan == (ALsizei)AL_INVALID)
|
||||
return AL_INVALID;
|
||||
else
|
||||
sid = ALstack[chan].ALsource;
|
||||
|
||||
if (src) //3D
|
||||
{
|
||||
#if 0
|
||||
alSourcef(sid, AL_REFERENCE_DISTANCE, src->min_distance);
|
||||
if (ALo_GetError() != AL_NO_ERROR)
|
||||
{
|
||||
DBG_Printf("%s: AL_REFERENCE_DISTANCE, %s", __FUNCTION__, GetALErrorString(ALo_Lasterror));
|
||||
}
|
||||
|
||||
alSourcef(sid, AL_MAX_DISTANCE, src->max_distance);
|
||||
if (ALo_GetError() != AL_NO_ERROR)
|
||||
{
|
||||
DBG_Printf("%s: AL_MAX_DISTANCE, %s", __FUNCTION__, GetALErrorString(ALo_Lasterror));
|
||||
}
|
||||
#endif
|
||||
|
||||
if (src->head_relative)
|
||||
alSourcei(sid, AL_SOURCE_RELATIVE, AL_TRUE);
|
||||
else
|
||||
alSourcei(sid, AL_SOURCE_RELATIVE, AL_FALSE);
|
||||
if (ALo_GetError() != AL_NO_ERROR)
|
||||
{
|
||||
DBG_Printf("%s: AL_SOURCE_RELATIVE, %s", __FUNCTION__, GetALErrorString(ALo_Lasterror));
|
||||
}
|
||||
|
||||
alSource3f(sid, AL_POSITION, src->pos.x, src->pos.z, src->pos.y);
|
||||
if (ALo_GetError() != AL_NO_ERROR)
|
||||
{
|
||||
DBG_Printf("%s: AL_POSITION, %s", __FUNCTION__, GetALErrorString(ALo_Lasterror));
|
||||
}
|
||||
alSource3f(sid, AL_VELOCITY, src->pos.momx, src->pos.momz, src->pos.momy);
|
||||
if (ALo_GetError() != AL_NO_ERROR)
|
||||
{
|
||||
DBG_Printf("%s: AL_VELOCITY, %s", __FUNCTION__, GetALErrorString(ALo_Lasterror));
|
||||
}
|
||||
}
|
||||
else //2D
|
||||
{
|
||||
alSourcei(sid, AL_SOURCE_RELATIVE, AL_TRUE);
|
||||
if (ALo_GetError() != AL_NO_ERROR)
|
||||
{
|
||||
DBG_Printf("%s: AL_SOURCE_RELATIVE, %s", __FUNCTION__, GetALErrorString(ALo_Lasterror));
|
||||
}
|
||||
}
|
||||
|
||||
alSourcef(sid, AL_ROLLOFF_FACTOR, 0.0f);
|
||||
if (ALo_GetError() != AL_NO_ERROR)
|
||||
{
|
||||
DBG_Printf("%s: AL_ROLLOFF_FACTOR, %s", __FUNCTION__, GetALErrorString(ALo_Lasterror));
|
||||
}
|
||||
|
||||
alSourcef(sid, AL_REFERENCE_DISTANCE, 0.0f);
|
||||
if (ALo_GetError() != AL_NO_ERROR)
|
||||
{
|
||||
DBG_Printf("%s: AL_REFERENCE_DISTANC, %s", __FUNCTION__, GetALErrorString(ALo_Lasterror));
|
||||
}
|
||||
return chan;
|
||||
}
|
||||
|
||||
EXPORT INT32 HWRAPI ( StartSource ) (INT32 chan)
|
||||
{
|
||||
ALint state = AL_NONE;
|
||||
ALuint sid = (ALuint)AL_INVALID;
|
||||
|
||||
if (chan <= AL_INVALID || !alIsSource(ALstack[chan].ALsource))
|
||||
return AL_FALSE;
|
||||
else
|
||||
sid = ALstack[chan].ALsource;
|
||||
|
||||
ALo_GetError();
|
||||
|
||||
alSourcePlay(sid);
|
||||
if (ALo_GetError() != AL_NO_ERROR)
|
||||
{
|
||||
DBG_Printf("%s: alSourcePlay, %s", __FUNCTION__, GetALErrorString(ALo_Lasterror));
|
||||
}
|
||||
|
||||
alGetSourcei(sid, AL_SOURCE_STATE, &state);
|
||||
if (ALo_GetError() != AL_NO_ERROR)
|
||||
{
|
||||
DBG_Printf("%s: alGetSourcei, %s", __FUNCTION__, GetALErrorString(ALo_Lasterror));
|
||||
}
|
||||
|
||||
return (state == AL_PLAYING);
|
||||
}
|
||||
|
||||
EXPORT void HWRAPI ( StopSource) (INT32 chan)
|
||||
{
|
||||
ALuint sfxhandle = AL_NONE;
|
||||
ALuint sid = (ALuint)AL_INVALID;
|
||||
if (chan <= AL_INVALID || !alIsSource(ALstack[chan].ALsource))
|
||||
return;
|
||||
else
|
||||
sid = ALstack[chan].ALsource;
|
||||
|
||||
ALo_GetError();
|
||||
|
||||
#if 1
|
||||
alSourceQueueBuffers(sid, 1, &sfxhandle);
|
||||
if (ALo_GetError() != AL_NO_ERROR)
|
||||
{
|
||||
DBG_Printf("%s: alSourceQueueBuffers, %s", __FUNCTION__, GetALErrorString(ALo_Lasterror));
|
||||
}
|
||||
#else
|
||||
alSourceStop(sid);
|
||||
if (ALo_GetError() != AL_NO_ERROR)
|
||||
{
|
||||
DBG_Printf("%s: alSourceStop, %s", __FUNCTION__, GetALErrorString(ALo_Lasterror));
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
EXPORT INT32 HWRAPI ( GetHW3DSVersion) (void)
|
||||
{
|
||||
return VERSION;
|
||||
}
|
||||
|
||||
EXPORT void HWRAPI (BeginFrameUpdate) (void)
|
||||
{
|
||||
alcSuspendContext(ALContext);
|
||||
if (ALo_GetError() != AL_NO_ERROR)
|
||||
{
|
||||
DBG_Printf("%s: alcSuspendContext, %s", __FUNCTION__, GetALErrorString(ALo_Lasterror));
|
||||
}
|
||||
}
|
||||
|
||||
EXPORT void HWRAPI (EndFrameUpdate) (void)
|
||||
{
|
||||
alcProcessContext(ALContext);
|
||||
if (ALo_GetError() != AL_NO_ERROR)
|
||||
{
|
||||
DBG_Printf("%s: alcProcessContext, %s", __FUNCTION__, GetALErrorString(ALo_Lasterror));
|
||||
}
|
||||
}
|
||||
|
||||
EXPORT INT32 HWRAPI (IsPlaying) (INT32 chan)
|
||||
{
|
||||
ALint state = AL_NONE;
|
||||
ALuint sid = (ALuint)AL_INVALID;
|
||||
|
||||
if (chan <= AL_INVALID || !alIsSource(ALstack[chan].ALsource))
|
||||
return AL_FALSE;
|
||||
else
|
||||
sid = ALstack[chan].ALsource;
|
||||
|
||||
ALo_GetError();
|
||||
|
||||
alGetSourcei(sid, AL_SOURCE_STATE, &state);
|
||||
if (ALo_GetError() != AL_NO_ERROR)
|
||||
{
|
||||
DBG_Printf("%s: alGetSourcei, %s", __FUNCTION__, GetALErrorString(ALo_Lasterror));
|
||||
}
|
||||
|
||||
return (state == AL_PLAYING);
|
||||
}
|
||||
|
||||
/******************************************************************************
|
||||
* UpdateListener
|
||||
*
|
||||
* Set up main listener properties:
|
||||
* - position
|
||||
* - orientation
|
||||
* - velocity
|
||||
*****************************************************************************/
|
||||
EXPORT void HWRAPI (UpdateListener) (listener_data_t *data, INT32 num)
|
||||
{
|
||||
if (num != 1) return;
|
||||
|
||||
if (data)
|
||||
{
|
||||
ALfloat facing[6];
|
||||
ALdouble f_angle = 0.0;
|
||||
if (data->f_angle) f_angle = (ALdouble)((data->f_angle) / 180.0l * M_PIl);
|
||||
facing[0] = (ALfloat)cos(f_angle);
|
||||
facing[1] = 0.0f;
|
||||
facing[2] = (ALfloat)sin(f_angle);
|
||||
facing[3] = 0.0f;
|
||||
facing[4] = 1.0f;
|
||||
facing[5] = 0.0f;
|
||||
|
||||
alListener3f(AL_POSITION,(ALfloat)-data->x,(ALfloat)data->z,(ALfloat)data->y);
|
||||
if (ALo_GetError() != AL_NO_ERROR)
|
||||
{
|
||||
DBG_Printf("%s: AL_POSITIO, %s", __FUNCTION__, GetALErrorString(ALo_Lasterror));
|
||||
}
|
||||
|
||||
alListener3f(AL_VELOCITY,(ALfloat)data->momx,(ALfloat)data->momz,(ALfloat)data->momy);
|
||||
if (ALo_GetError() != AL_NO_ERROR)
|
||||
{
|
||||
DBG_Printf("%s: AL_VELOCITY, %s", __FUNCTION__, GetALErrorString(ALo_Lasterror));
|
||||
}
|
||||
|
||||
alListenerfv(AL_ORIENTATION, facing);
|
||||
if (ALo_GetError() != AL_NO_ERROR)
|
||||
{
|
||||
DBG_Printf("%s: AL_ORIENTATION, %s", __FUNCTION__, GetALErrorString(ALo_Lasterror));
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
DBG_Printf("Error: 1st listener data is missing\n");
|
||||
}
|
||||
}
|
||||
|
||||
/******************************************************************************
|
||||
*
|
||||
* Update volume for 2D source and separation (panning) of 2D source
|
||||
*
|
||||
*****************************************************************************/
|
||||
EXPORT void HWRAPI (UpdateSourceParms) (INT32 chan, INT32 vol, INT32 sep)
|
||||
{
|
||||
ALuint sid = AL_NONE;
|
||||
ALint is2d = AL_FALSE;
|
||||
if (chan > AL_INVALID && !alIsSource(ALstack[chan].ALsource))
|
||||
return;
|
||||
else
|
||||
sid = ALstack[chan].ALsource;
|
||||
|
||||
alGetSourcei(sid, AL_SOURCE_RELATIVE, &is2d);
|
||||
|
||||
if (!is2d)
|
||||
return;
|
||||
|
||||
if (vol != -1)
|
||||
{
|
||||
alSourcef(sid,AL_GAIN,ALvol(vol,256));
|
||||
if (ALo_GetError() != AL_NO_ERROR)
|
||||
{
|
||||
DBG_Printf("%s: alSourcef, %s", __FUNCTION__, GetALErrorString(ALo_Lasterror));
|
||||
}
|
||||
}
|
||||
|
||||
if (sep != -1)
|
||||
{
|
||||
ALSetPan(sid,sep-NORMAL_SEP);
|
||||
if (ALo_GetError() != AL_NO_ERROR)
|
||||
{
|
||||
DBG_Printf("%s: ALSetPan, %s", __FUNCTION__, GetALErrorString(ALo_Lasterror));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// --------------------------------------------------------------------------
|
||||
// Set the global volume for sound effects
|
||||
// --------------------------------------------------------------------------
|
||||
EXPORT void HWRAPI (SetGlobalSfxVolume) (INT32 vol)
|
||||
{
|
||||
alListenerf(AL_GAIN, ALvol(vol,32));
|
||||
if (ALo_GetError() != AL_NO_ERROR)
|
||||
{
|
||||
DBG_Printf("%s: AL_GAIN, %s", __FUNCTION__, GetALErrorString(ALo_Lasterror));
|
||||
}
|
||||
}
|
||||
|
||||
//Alam: Not Used?
|
||||
EXPORT INT32 HWRAPI (SetCone) (INT32 chan, cone_def_t *cone_def)
|
||||
{
|
||||
ALuint sid = AL_NONE;
|
||||
ALint is2d = AL_FALSE;
|
||||
if (chan > AL_INVALID && !alIsSource(ALstack[chan].ALsource))
|
||||
return AL_FALSE;
|
||||
else
|
||||
sid = ALstack[chan].ALsource;
|
||||
|
||||
alGetSourcei(sid, AL_SOURCE_RELATIVE, &is2d);
|
||||
|
||||
if(is2d || !cone_def)
|
||||
return AL_FALSE;
|
||||
|
||||
alSourcef(sid,AL_CONE_INNER_ANGLE,cone_def->inner);
|
||||
if (ALo_GetError() != AL_NO_ERROR)
|
||||
{
|
||||
DBG_Printf("%s: AL_CONE_INNER_ANGLE, %s", __FUNCTION__, GetALErrorString(ALo_Lasterror));
|
||||
}
|
||||
|
||||
alSourcef(sid,AL_CONE_OUTER_ANGLE,cone_def->outer);
|
||||
if (ALo_GetError() != AL_NO_ERROR)
|
||||
{
|
||||
DBG_Printf("%s: AL_CONE_OUTER_ANGL, %s", __FUNCTION__, GetALErrorString(ALo_Lasterror));
|
||||
}
|
||||
|
||||
alSourcei(sid,AL_CONE_OUTER_GAIN, cone_def->outer_gain);
|
||||
if (ALo_GetError() != AL_NO_ERROR)
|
||||
{
|
||||
DBG_Printf("%s: AL_CONE_OUTER_GAIN, %s", __FUNCTION__, GetALErrorString(ALo_Lasterror));
|
||||
}
|
||||
|
||||
return AL_TRUE;
|
||||
}
|
||||
|
||||
EXPORT void HWRAPI (Update3DSource) (INT32 chan, source3D_pos_t *sfx)
|
||||
{
|
||||
ALuint sid = AL_NONE;
|
||||
ALint is2d = AL_FALSE;
|
||||
if (chan > AL_INVALID && !alIsSource(ALstack[chan].ALsource))
|
||||
return;
|
||||
else
|
||||
sid = ALstack[chan].ALsource;
|
||||
|
||||
alGetSourcei(sid, AL_SOURCE_RELATIVE, &is2d);
|
||||
|
||||
if (is2d)
|
||||
return;
|
||||
|
||||
alSource3f(sid, AL_POSITION, sfx->x, sfx->z, sfx->y);
|
||||
if (ALo_GetError() != AL_NO_ERROR)
|
||||
{
|
||||
DBG_Printf("%s: AL_POSITION, %s", __FUNCTION__, GetALErrorString(ALo_Lasterror));
|
||||
}
|
||||
|
||||
alSource3f(sid, AL_VELOCITY, sfx->momx, sfx->momz, sfx->momy);
|
||||
if (ALo_GetError() != AL_NO_ERROR)
|
||||
{
|
||||
DBG_Printf("%s: AL_VELOCITY, %s", __FUNCTION__, GetALErrorString(ALo_Lasterror));
|
||||
}
|
||||
}
|
||||
|
||||
//-------------------------------------------------------------
|
||||
// Load new sound data into source
|
||||
//-------------------------------------------------------------
|
||||
EXPORT INT32 HWRAPI (ReloadSource) (INT32 chan, u_int sfxhandle)
|
||||
{
|
||||
ALuint sid;
|
||||
|
||||
if (chan <= AL_INVALID || !alIsSource(ALstack[chan].ALsource) || !alIsBuffer(sfxhandle))
|
||||
return AL_INVALID;
|
||||
else
|
||||
sid = ALstack[chan].ALsource;
|
||||
|
||||
ALo_GetError();
|
||||
|
||||
alSourceQueueBuffers(sid, 1, &sfxhandle);
|
||||
if (ALo_GetError() == AL_INVALID_OPERATION) //Alam: not needed?
|
||||
{
|
||||
alSourceStop(sid);
|
||||
alSourcei(sid, AL_BUFFER, sfxhandle);
|
||||
ALo_GetError();
|
||||
}
|
||||
if (ALo_Lasterror != AL_NO_ERROR)
|
||||
{
|
||||
DBG_Printf("%s: alSourcei, %s", __FUNCTION__, GetALErrorString(ALo_Lasterror));
|
||||
}
|
||||
|
||||
return chan;
|
||||
}
|
||||
|
||||
/******************************************************************************
|
||||
*
|
||||
* Destroy source and remove it from stack if it is a 2D source.
|
||||
* Otherwise put source into cache
|
||||
*
|
||||
*****************************************************************************/
|
||||
EXPORT void HWRAPI (KillSource) (INT32 chan)
|
||||
{
|
||||
if (chan > AL_INVALID && (ALsizei)chan <= allocated_sounds)
|
||||
kill_sound(ALstack + chan);
|
||||
}
|
||||
|
||||
EXPORT u_int HWRAPI (AddSfx) (sfx_data_t *sfx)
|
||||
{
|
||||
ALuint chan = (ALuint)AL_INVALID;
|
||||
ALsizei freq = 11025;
|
||||
ALubyte *data = NULL;
|
||||
ALsizei size = 0;
|
||||
|
||||
if (!sfx)
|
||||
return 0;
|
||||
else
|
||||
{
|
||||
data = ((ALubyte *)sfx->data)+8;
|
||||
size = (ALsizei)(sfx->length-8);
|
||||
}
|
||||
|
||||
alGenBuffers(1, &chan);
|
||||
if (ALo_GetError() != AL_NO_ERROR || !alIsBuffer(chan))
|
||||
{
|
||||
DBG_Printf("S_OpenAl: Error %s when make an ALBuffer!\n",GetALErrorString(ALo_Lasterror));
|
||||
return (u_int)AL_INVALID;
|
||||
}
|
||||
|
||||
freq = getfreq(sfx->data, sfx->length);
|
||||
|
||||
alBufferData(chan, AL_FORMAT_MONO8, data, size, freq);
|
||||
if (ALo_GetError() != AL_NO_ERROR)
|
||||
{
|
||||
DBG_Printf("S_OpenAl: Error %s when setting up a alBuffer!\n",GetALErrorString(ALo_Lasterror));
|
||||
}
|
||||
|
||||
return chan;
|
||||
}
|
||||
|
||||
EXPORT void HWRAPI (KillSfx) (u_int sfxhandle)
|
||||
{
|
||||
ALuint ALsfx = sfxhandle;
|
||||
if (!alIsBuffer(ALsfx))
|
||||
return;
|
||||
alDeleteBuffers(1, &ALsfx);
|
||||
if (ALo_GetError() == AL_INVALID_OPERATION)
|
||||
{
|
||||
// Buffer leak
|
||||
}
|
||||
else if (ALo_Lasterror != AL_NO_ERROR)
|
||||
{
|
||||
DBG_Printf("%s: alDeleteBuffers, %s", __FUNCTION__, GetALErrorString(ALo_Lasterror));
|
||||
}
|
||||
}
|
||||
|
||||
EXPORT void HWRAPI (GetHW3DSTitle) (char *buf, size_t size)
|
||||
{
|
||||
strncpy(buf, "OpenAL", size);
|
||||
}
|
||||
|
||||
|
||||
#ifdef _WINDOWS
|
||||
BOOL WINAPI DllMain(HINSTANCE hinstDLL, // handle to DLL module
|
||||
DWORD fdwReason, // reason for calling function
|
||||
LPVOID lpvReserved) // reserved
|
||||
{
|
||||
// Perform actions based on the reason for calling.
|
||||
UNREFERENCED_PARAMETER(lpvReserved);
|
||||
switch ( fdwReason )
|
||||
{
|
||||
case DLL_PROCESS_ATTACH:
|
||||
// Initialize once for each new process.
|
||||
// Return FALSE to fail DLL load.
|
||||
#ifdef DEBUG_TO_FILE
|
||||
logstream = fopen("s_openal.log", "wt");
|
||||
if (logstream == NULL)
|
||||
return FALSE;
|
||||
#endif
|
||||
DisableThreadLibraryCalls(hinstDLL);
|
||||
break;
|
||||
|
||||
case DLL_THREAD_ATTACH:
|
||||
// Do thread-specific initialization.
|
||||
break;
|
||||
|
||||
case DLL_THREAD_DETACH:
|
||||
// Do thread-specific cleanup.
|
||||
break;
|
||||
|
||||
case DLL_PROCESS_DETACH:
|
||||
// Perform any necessary cleanup.
|
||||
#ifdef DEBUG_TO_FILE
|
||||
if ( logstream)
|
||||
{
|
||||
fclose(logstream);
|
||||
logstream = NULL;
|
||||
}
|
||||
#endif
|
||||
break;
|
||||
}
|
||||
return TRUE; // Successful DLL_PROCESS_ATTACH.
|
||||
}
|
||||
#elif !defined (_WINDOWS)
|
||||
|
||||
// **************************************************************************
|
||||
// FUNCTIONS
|
||||
// **************************************************************************
|
||||
|
||||
EXPORT void _init()
|
||||
{
|
||||
#ifdef DEBUG_TO_FILE
|
||||
logstream = fopen("s_openal.log", "w+");
|
||||
#endif
|
||||
}
|
||||
|
||||
EXPORT void _fini()
|
||||
{
|
||||
#ifdef DEBUG_TO_FILE
|
||||
if (logstream)
|
||||
fclose(logstream);
|
||||
logstream = NULL;
|
||||
#endif
|
||||
}
|
||||
#endif
|
||||
|
||||
@@ -1,59 +0,0 @@
|
||||
[Project]
|
||||
FileName=s_openal.dev
|
||||
Name=s_openal
|
||||
Ver=1
|
||||
IsCpp=1
|
||||
Type=3
|
||||
Compiler=-D_M_IX86=500_@@_-Wall_@@_-fexceptions_@@_-D_WINDOWS_@@_
|
||||
CppCompiler=
|
||||
Includes=
|
||||
Linker=--def ../s_mingw.def_@@_-lopenal32_@@_
|
||||
Libs=
|
||||
UnitCount=1
|
||||
Folders=
|
||||
ObjFiles=
|
||||
PrivateResource=
|
||||
ResourceIncludes=
|
||||
MakeIncludes=
|
||||
Icon=
|
||||
ExeOutput=..\..\..\bin
|
||||
ObjectOutput=..\..\..\objs\Mingw\s_opengl
|
||||
OverrideOutput=0
|
||||
OverrideOutputName=s_openal.dll
|
||||
HostApplication=
|
||||
CommandLine=
|
||||
UseCustomMakefile=0
|
||||
CustomMakefile=
|
||||
IncludeVersionInfo=0
|
||||
SupportXPThemes=0
|
||||
CompilerSet=0
|
||||
CompilerSettings=0000000010001001001001
|
||||
|
||||
[Unit1]
|
||||
FileName=s_openal.c
|
||||
Folder=
|
||||
Compile=1
|
||||
CompileCpp=0
|
||||
Link=1
|
||||
Priority=1000
|
||||
OverrideBuildCmd=0
|
||||
BuildCmd=
|
||||
|
||||
[VersionInfo]
|
||||
Major=0
|
||||
Minor=1
|
||||
Release=1
|
||||
Build=1
|
||||
LanguageID=1033
|
||||
CharsetID=1252
|
||||
CompanyName=
|
||||
FileVersion=0.1
|
||||
FileDescription=Developed using the Dev-C++ IDE
|
||||
InternalName=
|
||||
LegalCopyright=
|
||||
LegalTrademarks=
|
||||
OriginalFilename=s_openal.dll
|
||||
ProductName=s_openal
|
||||
ProductVersion=0.1
|
||||
AutoIncBuildNr=0
|
||||
|
||||
@@ -1,98 +0,0 @@
|
||||
# Microsoft Developer Studio Project File - Name="s_openal" - Package Owner=<4>
|
||||
# Microsoft Developer Studio Generated Build File, Format Version 6.00
|
||||
# ** DO NOT EDIT **
|
||||
|
||||
# TARGTYPE "Win32 (x86) Dynamic-Link Library" 0x0102
|
||||
|
||||
CFG=s_openal - Win32 Debug
|
||||
!MESSAGE This is not a valid makefile. To build this project using NMAKE,
|
||||
!MESSAGE use the Export Makefile command and run
|
||||
!MESSAGE
|
||||
!MESSAGE NMAKE /f "s_openal.mak".
|
||||
!MESSAGE
|
||||
!MESSAGE You can specify a configuration when running NMAKE
|
||||
!MESSAGE by defining the macro CFG on the command line. For example:
|
||||
!MESSAGE
|
||||
!MESSAGE NMAKE /f "s_openal.mak" CFG="s_openal - Win32 Debug"
|
||||
!MESSAGE
|
||||
!MESSAGE Possible choices for configuration are:
|
||||
!MESSAGE
|
||||
!MESSAGE "s_openal - Win32 Release" (based on "Win32 (x86) Dynamic-Link Library")
|
||||
!MESSAGE "s_openal - Win32 Debug" (based on "Win32 (x86) Dynamic-Link Library")
|
||||
!MESSAGE
|
||||
|
||||
# Begin Project
|
||||
# PROP AllowPerConfigDependencies 0
|
||||
# PROP Scc_ProjName ""
|
||||
# PROP Scc_LocalPath ""
|
||||
CPP=cl.exe
|
||||
MTL=midl.exe
|
||||
RSC=rc.exe
|
||||
|
||||
!IF "$(CFG)" == "s_openal - Win32 Release"
|
||||
|
||||
# PROP BASE Use_MFC 0
|
||||
# PROP BASE Use_Debug_Libraries 0
|
||||
# PROP BASE Output_Dir "Release"
|
||||
# PROP BASE Intermediate_Dir "Release"
|
||||
# PROP BASE Target_Dir ""
|
||||
# PROP Use_MFC 0
|
||||
# PROP Use_Debug_Libraries 0
|
||||
# PROP Output_Dir "..\..\..\bin\VC\Release\s_openal"
|
||||
# PROP Intermediate_Dir "..\..\..\objs\VC\Release\s_openal"
|
||||
# PROP Ignore_Export_Lib 0
|
||||
# PROP Target_Dir ""
|
||||
# ADD BASE CPP /nologo /MT /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "S_OPENAL_EXPORTS" /YX /FD /c
|
||||
# ADD CPP /nologo /MT /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "__WIN32__" /D "__MSC__" /YX /FD /c
|
||||
# ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /win32
|
||||
# ADD MTL /nologo /D "NDEBUG" /win32
|
||||
# SUBTRACT MTL /mktyplib203
|
||||
# ADD BASE RSC /l 0x409 /d "NDEBUG"
|
||||
# ADD RSC /l 0x409 /d "NDEBUG"
|
||||
BSC32=bscmake.exe
|
||||
# ADD BASE BSC32 /nologo
|
||||
# ADD BSC32 /nologo
|
||||
LINK32=link.exe
|
||||
# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /machine:I386
|
||||
# ADD LINK32 OpenAL32.lib /nologo /dll /pdb:"..\..\..\bin\VC\Release\s_openal.pdb" /machine:I386 /out:"C:\srb2demo2\s_openal.dll"
|
||||
# SUBTRACT LINK32 /pdb:none
|
||||
|
||||
!ELSEIF "$(CFG)" == "s_openal - Win32 Debug"
|
||||
|
||||
# PROP BASE Use_MFC 0
|
||||
# PROP BASE Use_Debug_Libraries 1
|
||||
# PROP BASE Output_Dir "Debug"
|
||||
# PROP BASE Intermediate_Dir "Debug"
|
||||
# PROP BASE Target_Dir ""
|
||||
# PROP Use_MFC 0
|
||||
# PROP Use_Debug_Libraries 1
|
||||
# PROP Output_Dir "..\..\..\bin\VC\Debug\s_openal"
|
||||
# PROP Intermediate_Dir "..\..\..\objs\VC\Debug\s_openal"
|
||||
# PROP Ignore_Export_Lib 1
|
||||
# PROP Target_Dir ""
|
||||
# ADD BASE CPP /nologo /MTd /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "S_OPENAL_EXPORTS" /YX /FD /GZ /c
|
||||
# ADD CPP /nologo /MTd /W4 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "__WIN32__" /D "__MSC__" /D "_MBCS" /D "_USRDLL" /D "S_OPENAL_EXPORTS" /YX /FD /GZ /c
|
||||
# ADD BASE MTL /nologo /D "_DEBUG" /mktyplib203 /win32
|
||||
# ADD MTL /nologo /D "_DEBUG" /mktyplib203 /win32
|
||||
# ADD BASE RSC /l 0x409 /d "_DEBUG"
|
||||
# ADD RSC /l 0x409 /d "_DEBUG"
|
||||
BSC32=bscmake.exe
|
||||
# ADD BASE BSC32 /nologo
|
||||
# ADD BSC32 /nologo
|
||||
LINK32=link.exe
|
||||
# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /debug /machine:I386 /pdbtype:sept
|
||||
# ADD LINK32 OpenAL32.lib /nologo /dll /pdb:"..\..\..\bin\VC\Debug\s_openal.pdb" /debug /machine:I386 /out:"C:\srb2demo2\s_openaldebug.dll" /pdbtype:sept
|
||||
# SUBTRACT LINK32 /pdb:none
|
||||
|
||||
!ENDIF
|
||||
|
||||
# Begin Target
|
||||
|
||||
# Name "s_openal - Win32 Release"
|
||||
# Name "s_openal - Win32 Debug"
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\s_openal.c
|
||||
# End Source File
|
||||
# End Target
|
||||
# End Project
|
||||
+21
-16
@@ -289,7 +289,7 @@ int
|
||||
HMS_register (void)
|
||||
{
|
||||
struct HMS_buffer *hms;
|
||||
int ok;
|
||||
int okay;
|
||||
|
||||
char post[256];
|
||||
|
||||
@@ -316,23 +316,23 @@ HMS_register (void)
|
||||
|
||||
curl_easy_setopt(hms->curl, CURLOPT_POSTFIELDS, post);
|
||||
|
||||
ok = HMS_do(hms);
|
||||
okay = HMS_do(hms);
|
||||
|
||||
if (ok)
|
||||
if (okay)
|
||||
{
|
||||
hms_server_token = strdup(strtok(hms->buffer, "\n"));
|
||||
}
|
||||
|
||||
HMS_end(hms);
|
||||
|
||||
return ok;
|
||||
return okay;
|
||||
}
|
||||
|
||||
int
|
||||
HMS_unlist (void)
|
||||
{
|
||||
struct HMS_buffer *hms;
|
||||
int ok;
|
||||
int okay;
|
||||
|
||||
hms = HMS_connect("servers/%s/unlist", hms_server_token);
|
||||
|
||||
@@ -342,19 +342,19 @@ HMS_unlist (void)
|
||||
curl_easy_setopt(hms->curl, CURLOPT_POST, 1);
|
||||
curl_easy_setopt(hms->curl, CURLOPT_POSTFIELDSIZE, 0);
|
||||
|
||||
ok = HMS_do(hms);
|
||||
okay = HMS_do(hms);
|
||||
HMS_end(hms);
|
||||
|
||||
free(hms_server_token);
|
||||
|
||||
return ok;
|
||||
return okay;
|
||||
}
|
||||
|
||||
int
|
||||
HMS_update (void)
|
||||
{
|
||||
struct HMS_buffer *hms;
|
||||
int ok;
|
||||
int okay;
|
||||
|
||||
char post[256];
|
||||
|
||||
@@ -376,10 +376,10 @@ HMS_update (void)
|
||||
|
||||
curl_easy_setopt(hms->curl, CURLOPT_POSTFIELDS, post);
|
||||
|
||||
ok = HMS_do(hms);
|
||||
okay = HMS_do(hms);
|
||||
HMS_end(hms);
|
||||
|
||||
return ok;
|
||||
return okay;
|
||||
}
|
||||
|
||||
void
|
||||
@@ -488,7 +488,7 @@ int
|
||||
HMS_compare_mod_version (char *buffer, size_t buffer_size)
|
||||
{
|
||||
struct HMS_buffer *hms;
|
||||
int ok;
|
||||
int okay;
|
||||
|
||||
char *version;
|
||||
char *version_name;
|
||||
@@ -498,7 +498,7 @@ HMS_compare_mod_version (char *buffer, size_t buffer_size)
|
||||
if (! hms)
|
||||
return 0;
|
||||
|
||||
ok = 0;
|
||||
okay = 0;
|
||||
|
||||
if (HMS_do(hms))
|
||||
{
|
||||
@@ -510,16 +510,16 @@ HMS_compare_mod_version (char *buffer, size_t buffer_size)
|
||||
if (atoi(version) != MODVERSION)
|
||||
{
|
||||
strlcpy(buffer, version_name, buffer_size);
|
||||
ok = 1;
|
||||
okay = 1;
|
||||
}
|
||||
else
|
||||
ok = -1;
|
||||
okay = -1;
|
||||
}
|
||||
}
|
||||
|
||||
HMS_end(hms);
|
||||
|
||||
return ok;
|
||||
return okay;
|
||||
}
|
||||
|
||||
const char *
|
||||
@@ -532,7 +532,9 @@ HMS_fetch_rules (char *buffer, size_t buffer_size)
|
||||
if (! hms)
|
||||
return NULL;
|
||||
|
||||
if (HMS_do(hms))
|
||||
boolean okay = HMS_do(hms);
|
||||
|
||||
if (okay)
|
||||
{
|
||||
char *p = strstr(hms->buffer, "\n\n");
|
||||
|
||||
@@ -550,6 +552,9 @@ HMS_fetch_rules (char *buffer, size_t buffer_size)
|
||||
|
||||
HMS_end(hms);
|
||||
|
||||
if (!okay)
|
||||
return NULL;
|
||||
|
||||
return buffer;
|
||||
}
|
||||
|
||||
|
||||
+371
-491
File diff suppressed because it is too large.
Load diff
+2
-8
@@ -42,8 +42,6 @@
|
||||
#define CRED_FONTEND 'Z' // the last font character
|
||||
#define CRED_FONTSIZE (CRED_FONTEND - CRED_FONTSTART + 1)
|
||||
|
||||
#define HU_CROSSHAIRS 3 // maximum of 9 - see HU_Init();
|
||||
|
||||
extern char *shiftxform; // english translation shift table
|
||||
extern char english_shiftxform[];
|
||||
|
||||
@@ -90,18 +88,14 @@ extern patch_t *tallnum[10];
|
||||
extern patch_t *pingnum[10];
|
||||
extern patch_t *pinggfx[5];
|
||||
extern patch_t *ranknum[10];
|
||||
extern patch_t *nightsnum[10];
|
||||
extern patch_t *framecounter;
|
||||
extern patch_t *frameslash;
|
||||
extern patch_t *lt_font[LT_FONTSIZE];
|
||||
extern patch_t *cred_font[CRED_FONTSIZE];
|
||||
extern patch_t *emeraldpics[7];
|
||||
extern patch_t *tinyemeraldpics[7];
|
||||
extern patch_t *rflagico;
|
||||
extern patch_t *bflagico;
|
||||
extern patch_t *rmatcico;
|
||||
extern patch_t *bmatcico;
|
||||
extern patch_t *tagico;
|
||||
extern patch_t *tallminus;
|
||||
|
||||
// set true whenever the tab rankings are being shown for any reason
|
||||
@@ -125,10 +119,10 @@ void HU_Drawer(void);
|
||||
char HU_dequeueChatChar(void);
|
||||
void HU_Erase(void);
|
||||
void HU_clearChatChars(void);
|
||||
void HU_drawPing(INT32 x, INT32 y, UINT32 ping, INT32 flags); // Lat': Ping drawer for scoreboard.
|
||||
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);
|
||||
|
||||
|
||||
+1
-1
@@ -53,6 +53,6 @@ typedef struct JoyType_s JoyType_t;
|
||||
for palyer[sic] 1-4's joystick/gamepad
|
||||
*/
|
||||
|
||||
extern JoyType_t Joystick, Joystick2, Joystick3, Joystick4;
|
||||
extern JoyType_t Joystick[MAXSPLITSCREENPLAYERS];
|
||||
|
||||
#endif // __I_JOY_H__
|
||||
@@ -34,7 +34,6 @@
|
||||
#define NO_BAN_TIME (time_t)(-1)
|
||||
|
||||
extern INT16 hardware_MAXPACKETLENGTH;
|
||||
extern INT32 net_bandwidth; // in byte/s
|
||||
|
||||
#if defined(_MSC_VER)
|
||||
#pragma pack(1)
|
||||
@@ -102,18 +101,10 @@ extern holepunch_t *holepunchpacket;
|
||||
*/
|
||||
extern boolean (*I_NetGet)(void);
|
||||
|
||||
/** \brief ask to driver if there is data waiting
|
||||
*/
|
||||
extern boolean (*I_NetCanGet)(void);
|
||||
|
||||
/** \brief send packet within doomcom struct
|
||||
*/
|
||||
extern void (*I_NetSend)(void);
|
||||
|
||||
/** \brief ask to driver if all is ok to send data now
|
||||
*/
|
||||
extern boolean (*I_NetCanSend)(void);
|
||||
|
||||
/** \brief close a connection
|
||||
|
||||
\param nodenum node to be closed
|
||||
|
||||
@@ -159,7 +159,6 @@ boolean I_SetSongPosition(UINT32 position);
|
||||
UINT32 I_GetSongPosition(void);
|
||||
|
||||
void I_UpdateSongLagThreshold (void);
|
||||
void I_UpdateSongLagConditions (void);
|
||||
|
||||
/// ------------------------
|
||||
// MUSIC PLAYBACK
|
||||
|
||||
+15
-94
@@ -34,6 +34,9 @@ extern UINT8 graphics_started;
|
||||
*/
|
||||
extern UINT8 keyboard_started;
|
||||
|
||||
/** \brief Set to true when inside a signal handler that will exit the program. */
|
||||
extern boolean g_in_exiting_signal_handler;
|
||||
|
||||
/** \brief The I_GetFreeMem function
|
||||
|
||||
\param total total memory in the system
|
||||
@@ -109,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
|
||||
*/
|
||||
@@ -199,9 +131,13 @@ void I_JoyScale4(void);
|
||||
|
||||
// Called by D_SRB2Main.
|
||||
|
||||
/** \brief to startup joystick
|
||||
*/
|
||||
void I_InitJoystick(UINT8 index);
|
||||
|
||||
/** \brief to startup the first joystick
|
||||
*/
|
||||
void I_InitJoystick(void);
|
||||
void I_InitJoystick1(void);
|
||||
|
||||
/** \brief to startup the second joystick
|
||||
*/
|
||||
@@ -219,6 +155,8 @@ void I_InitJoystick4(void);
|
||||
*/
|
||||
INT32 I_NumJoys(void);
|
||||
|
||||
extern INT32 numcontrollers;
|
||||
|
||||
/** \brief The *I_GetJoyName function
|
||||
|
||||
\param joyindex which joystick
|
||||
@@ -227,6 +165,9 @@ INT32 I_NumJoys(void);
|
||||
*/
|
||||
const char *I_GetJoyName(INT32 joyindex);
|
||||
|
||||
void I_GamepadRumble(INT32 playernum, UINT16 low_strength, UINT16 high_strength, UINT32 duration);
|
||||
void I_SetGamepadIndicatorColor(INT32 playernum, UINT8 red, UINT8 green, UINT8 blue);
|
||||
|
||||
#ifndef NOMUMBLE
|
||||
#include "p_mobj.h" // mobj_t
|
||||
#include "s_sound.h" // listener_t
|
||||
@@ -239,10 +180,6 @@ void I_UpdateMumble(const mobj_t *mobj, const listener_t listener);
|
||||
*/
|
||||
void I_StartupMouse(void);
|
||||
|
||||
/** \brief Startup the second mouse
|
||||
*/
|
||||
void I_StartupMouse2(void);
|
||||
|
||||
/** \brief setup timer irq and user timer routine.
|
||||
*/
|
||||
void I_StartupTimer(void);
|
||||
@@ -301,25 +238,9 @@ INT32 I_mkdir(const char *dirname, INT32 unixright);
|
||||
*/
|
||||
const char *I_LocateWad(void);
|
||||
|
||||
/** \brief First Joystick's events
|
||||
/** \brief Joystick events
|
||||
*/
|
||||
void I_GetJoystickEvents(void);
|
||||
|
||||
/** \brief Second Joystick's events
|
||||
*/
|
||||
void I_GetJoystick2Events(void);
|
||||
|
||||
/** \brief Third Joystick's events
|
||||
*/
|
||||
void I_GetJoystick3Events(void);
|
||||
|
||||
/** \brief Fourth Joystick's events
|
||||
*/
|
||||
void I_GetJoystick4Events(void);
|
||||
|
||||
/** \brief Mouses events
|
||||
*/
|
||||
void I_GetMouseEvents(void);
|
||||
void I_GetJoystickEvents(UINT8 index);
|
||||
|
||||
char *I_GetEnv(const char *name);
|
||||
|
||||
|
||||
+180
-190
@@ -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
|
||||
@@ -100,6 +94,14 @@
|
||||
#undef ETIMEDOUT
|
||||
#endif
|
||||
#define ETIMEDOUT WSAETIMEDOUT
|
||||
#ifdef EHOSTUNREACH
|
||||
#undef EHOSTUNREACH
|
||||
#endif
|
||||
#define EHOSTUNREACH WSAEHOSTUNREACH
|
||||
#ifdef ENETUNREACH
|
||||
#undef ENETUNREACH
|
||||
#endif
|
||||
#define ENETUNREACH WSAENETUNREACH
|
||||
#ifndef IOC_VENDOR
|
||||
#define IOC_VENDOR 0x18000000
|
||||
#endif
|
||||
@@ -115,7 +117,7 @@
|
||||
#ifndef STATUS_INVALID_PARAMETER
|
||||
#define STATUS_INVALID_PARAMETER 0xC000000D
|
||||
#endif
|
||||
#endif
|
||||
#endif // USE_WINSOCK
|
||||
|
||||
typedef union
|
||||
{
|
||||
@@ -160,8 +162,6 @@ static UINT8 UPNP_support = TRUE;
|
||||
#endif
|
||||
|
||||
#include "i_addrinfo.h"
|
||||
#define SELECTTEST
|
||||
|
||||
#define DEFAULTPORT "5029"
|
||||
|
||||
#if defined (USE_WINSOCK) && !defined (NONET)
|
||||
@@ -176,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
|
||||
@@ -372,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;
|
||||
@@ -385,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)));
|
||||
@@ -586,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)
|
||||
@@ -611,7 +618,6 @@ is_external_address (UINT32 p)
|
||||
}
|
||||
}
|
||||
|
||||
#ifdef HOLEPUNCH
|
||||
static boolean hole_punch(ssize_t c)
|
||||
{
|
||||
|
||||
@@ -637,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)
|
||||
@@ -742,59 +748,6 @@ static boolean SOCK_Get(void)
|
||||
}
|
||||
#endif
|
||||
|
||||
// check if we can send (do not go over the buffer)
|
||||
#ifndef NONET
|
||||
|
||||
static fd_set masterset;
|
||||
|
||||
#ifdef SELECTTEST
|
||||
static boolean FD_CPY(fd_set *src, fd_set *dst, SOCKET_TYPE *fd, size_t len)
|
||||
{
|
||||
size_t i;
|
||||
boolean testset = false;
|
||||
FD_ZERO(dst);
|
||||
for (i = 0; i < len;i++)
|
||||
{
|
||||
if(fd[i] != (SOCKET_TYPE)ERRSOCKET &&
|
||||
FD_ISSET(fd[i], src) && !FD_ISSET(fd[i], dst)) // no checking for dups
|
||||
{
|
||||
FD_SET(fd[i], dst);
|
||||
testset = true;
|
||||
}
|
||||
}
|
||||
return testset;
|
||||
}
|
||||
|
||||
static boolean SOCK_CanSend(void)
|
||||
{
|
||||
struct timeval timeval_for_select = {0, 0};
|
||||
fd_set tset;
|
||||
int wselect;
|
||||
|
||||
if(!FD_CPY(&masterset, &tset, mysockets, mysocketses))
|
||||
return false;
|
||||
wselect = select(255, NULL, &tset, NULL, &timeval_for_select);
|
||||
if (wselect >= 1)
|
||||
return true;
|
||||
return false;
|
||||
}
|
||||
|
||||
static boolean SOCK_CanGet(void)
|
||||
{
|
||||
struct timeval timeval_for_select = {0, 0};
|
||||
fd_set tset;
|
||||
int rselect;
|
||||
|
||||
if(!FD_CPY(&masterset, &tset, mysockets, mysocketses))
|
||||
return false;
|
||||
rselect = select(255, &tset, NULL, NULL, &timeval_for_select);
|
||||
if (rselect >= 1)
|
||||
return true;
|
||||
return false;
|
||||
}
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#ifndef NONET
|
||||
static inline ssize_t SOCK_SendToAddr(SOCKET_TYPE socket, mysockaddr_t *sockaddr)
|
||||
{
|
||||
@@ -816,9 +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 || (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])
|
||||
@@ -831,34 +787,52 @@ static void SOCK_Send(void)
|
||||
for (j = 0; j < broadcastaddresses; j++)
|
||||
{
|
||||
if (myfamily[i] == broadcastaddress[j].any.sa_family)
|
||||
SOCK_SendToAddr(mysockets[i], &broadcastaddress[j]);
|
||||
{
|
||||
c = SOCK_SendToAddr(mysockets[i], &broadcastaddress[j]);
|
||||
if (c == ERRSOCKET)
|
||||
{
|
||||
e = errno;
|
||||
if (!ALLOWEDERROR(e))
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
return;
|
||||
}
|
||||
else if (nodesocket[doomcom->remotenode] == (SOCKET_TYPE)ERRSOCKET)
|
||||
{
|
||||
for (i = 0; i < mysocketses; i++)
|
||||
{
|
||||
if (myfamily[i] == clientaddress[doomcom->remotenode].any.sa_family)
|
||||
SOCK_SendToAddr(mysockets[i], &clientaddress[doomcom->remotenode]);
|
||||
{
|
||||
c = SOCK_SendToAddr(mysockets[i], &clientaddress[doomcom->remotenode]);
|
||||
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 (e != ECONNREFUSED && e != EWOULDBLOCK)
|
||||
I_Error("SOCK_Send, error sending to node %d (%s) #%u: %s", doomcom->remotenode,
|
||||
if (!ALLOWEDERROR(e))
|
||||
I_Error("SOCK_Send, error sending to node %d (%s) #%u, %s", doomcom->remotenode,
|
||||
SOCK_GetNodeAddress(doomcom->remotenode), e, strerror(e));
|
||||
}
|
||||
}
|
||||
#endif
|
||||
#undef ALLOWEDERROR
|
||||
#endif //NONET
|
||||
|
||||
#ifndef NONET
|
||||
static void SOCK_FreeNodenum(INT32 numnode)
|
||||
@@ -887,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;
|
||||
@@ -902,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
|
||||
|
||||
@@ -922,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
|
||||
@@ -939,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);
|
||||
|
||||
@@ -1010,7 +1060,6 @@ static boolean UDP_Socket(void)
|
||||
mysockets[s] = ERRSOCKET;
|
||||
for (s = 0; s < MAXNETNODES+1; s++)
|
||||
nodesocket[s] = ERRSOCKET;
|
||||
FD_ZERO(&masterset);
|
||||
s = 0;
|
||||
|
||||
memset(&hints, 0x00, sizeof (hints));
|
||||
@@ -1037,7 +1086,6 @@ static boolean UDP_Socket(void)
|
||||
mysockets[s] = UDP_Bind(runp->ai_family, runp->ai_addr, (socklen_t)runp->ai_addrlen);
|
||||
if (mysockets[s] != (SOCKET_TYPE)ERRSOCKET)
|
||||
{
|
||||
FD_SET(mysockets[s], &masterset);
|
||||
myfamily[s] = hints.ai_family;
|
||||
s++;
|
||||
}
|
||||
@@ -1058,7 +1106,6 @@ static boolean UDP_Socket(void)
|
||||
mysockets[s] = UDP_Bind(runp->ai_family, runp->ai_addr, (socklen_t)runp->ai_addrlen);
|
||||
if (mysockets[s] != (SOCKET_TYPE)ERRSOCKET)
|
||||
{
|
||||
FD_SET(mysockets[s], &masterset);
|
||||
myfamily[s] = hints.ai_family;
|
||||
s++;
|
||||
#ifdef HAVE_MINIUPNPC
|
||||
@@ -1091,7 +1138,6 @@ static boolean UDP_Socket(void)
|
||||
mysockets[s] = UDP_Bind(runp->ai_family, runp->ai_addr, (socklen_t)runp->ai_addrlen);
|
||||
if (mysockets[s] != (SOCKET_TYPE)ERRSOCKET)
|
||||
{
|
||||
FD_SET(mysockets[s], &masterset);
|
||||
myfamily[s] = hints.ai_family;
|
||||
s++;
|
||||
}
|
||||
@@ -1112,7 +1158,6 @@ static boolean UDP_Socket(void)
|
||||
mysockets[s] = UDP_Bind(runp->ai_family, runp->ai_addr, (socklen_t)runp->ai_addrlen);
|
||||
if (mysockets[s] != (SOCKET_TYPE)ERRSOCKET)
|
||||
{
|
||||
FD_SET(mysockets[s], &masterset);
|
||||
myfamily[s] = hints.ai_family;
|
||||
s++;
|
||||
}
|
||||
@@ -1133,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
|
||||
|
||||
@@ -1279,16 +1287,15 @@ boolean I_InitTcpDriver(void)
|
||||
static void SOCK_CloseSocket(void)
|
||||
{
|
||||
size_t i;
|
||||
for (i=0; i < MAXNETNODES+1; i++)
|
||||
|
||||
for (i = 0; i < mysocketses; i++)
|
||||
{
|
||||
if (mysockets[i] != (SOCKET_TYPE)ERRSOCKET
|
||||
&& FD_ISSET(mysockets[i], &masterset))
|
||||
{
|
||||
FD_CLR(mysockets[i], &masterset);
|
||||
if (mysockets[i] != (SOCKET_TYPE)ERRSOCKET)
|
||||
close(mysockets[i]);
|
||||
}
|
||||
mysockets[i] = ERRSOCKET;
|
||||
}
|
||||
|
||||
mysocketses = 0;
|
||||
}
|
||||
#endif
|
||||
|
||||
@@ -1398,9 +1405,7 @@ static void rendezvous(int size)
|
||||
|
||||
if (tic == refreshtic)
|
||||
{
|
||||
#ifdef HOLEPUNCH
|
||||
holepunchpacket->magic = hole_punch_magic;
|
||||
#endif
|
||||
sendto(mysockets[0], doomcom->data, size, 0, &rzv.any, sizeof rzv.ip4);
|
||||
}
|
||||
|
||||
@@ -1425,7 +1430,6 @@ static void SOCK_RegisterHolePunch(void)
|
||||
rendezvous(4);
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
||||
static boolean SOCK_OpenSocket(void)
|
||||
@@ -1445,13 +1449,7 @@ static boolean SOCK_OpenSocket(void)
|
||||
I_NetFreeNodenum = SOCK_FreeNodenum;
|
||||
I_NetMakeNodewPort = SOCK_NetMakeNodewPort;
|
||||
|
||||
#ifdef SELECTTEST
|
||||
// seem like not work with libsocket : (
|
||||
I_NetCanSend = SOCK_CanSend;
|
||||
I_NetCanGet = SOCK_CanGet;
|
||||
#endif
|
||||
#ifdef HOLEPUNCH
|
||||
|
||||
I_NetRequestHolePunch = SOCK_RequestHolePunch;
|
||||
I_NetRegisterHolePunch = SOCK_RegisterHolePunch;
|
||||
#endif
|
||||
@@ -1707,7 +1705,6 @@ boolean I_InitTcpNetwork(void)
|
||||
// FIXME:
|
||||
// ??? and now ?
|
||||
// server on a big modem ??? 4*isdn
|
||||
net_bandwidth = 16000;
|
||||
hardware_MAXPACKETLENGTH = INETPACKETLENGTH;
|
||||
|
||||
ret = true;
|
||||
@@ -1722,7 +1719,6 @@ boolean I_InitTcpNetwork(void)
|
||||
// server address only in ip
|
||||
if (serverhostname[0])
|
||||
{
|
||||
CV_Set(&cv_lastserver, serverhostname);
|
||||
COM_BufAddText("connect \"");
|
||||
COM_BufAddText(serverhostname);
|
||||
COM_BufAddText("\"\n");
|
||||
@@ -1732,13 +1728,9 @@ boolean I_InitTcpNetwork(void)
|
||||
}
|
||||
else
|
||||
{
|
||||
// Not quite sure if we want to save that but i'll do that for now
|
||||
CV_Set(&cv_lastserver, "any");
|
||||
|
||||
// so we're on a LAN
|
||||
COM_BufAddText("connect any\n");
|
||||
|
||||
net_bandwidth = 800000;
|
||||
hardware_MAXPACKETLENGTH = MAXPACKETLENGTH;
|
||||
}
|
||||
}
|
||||
@@ -1763,8 +1755,6 @@ boolean I_InitTcpNetwork(void)
|
||||
{
|
||||
// so we're on a LAN
|
||||
COM_BufAddText("connect any\n");
|
||||
|
||||
net_bandwidth = 800000;
|
||||
hardware_MAXPACKETLENGTH = MAXPACKETLENGTH;
|
||||
}
|
||||
}
|
||||
|
||||
+3
-3
@@ -58,10 +58,10 @@ 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)(enterprecise - oldenterprecise) / I_GetPrecisePrecision();
|
||||
elapsedseconds = (double)((INT64)enterprecise - oldenterprecise) / I_GetPrecisePrecision();
|
||||
tictimer += elapsedseconds;
|
||||
while (tictimer > 1.0/ticratescaled)
|
||||
{
|
||||
@@ -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);
|
||||
}
|
||||
}
|
||||
@@ -139,9 +139,13 @@ UINT32 I_GetRefreshRate(void);
|
||||
|
||||
boolean I_UseNativeKeyboard(void);
|
||||
|
||||
boolean I_CheckNativeRes(void);
|
||||
|
||||
#ifdef USE_FBO_OGL
|
||||
|
||||
void RefreshOGLSDLSurface(void);
|
||||
void I_DownSample(void);
|
||||
boolean UseScreenFBO(void);
|
||||
extern boolean downsample;
|
||||
#endif
|
||||
|
||||
|
||||
Loaded 100 of 308 files, more files were not shown because too many files have changed in this diff.
Show more
Reference in new issue
Block a user