mirror of
https://github.com/scp-fs2open/fs2open.github.com.git
synced 2026-11-07 22:56:30 -10:00
Compare commits
2077
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
6d1334e5a3 | ||
|
|
bbd2b65616 | ||
|
|
55d6cb4b70 | ||
|
|
fe88ab1396 | ||
|
|
4179e85caf | ||
|
|
b73dcd739b | ||
|
|
c1a82b09d6 | ||
|
|
75e8b56828 | ||
|
|
205fc23b91 | ||
|
|
49a65b4ea8 | ||
|
|
d8351b5cb9 | ||
|
|
50306334bc | ||
|
|
7e3012fec1 | ||
|
|
28b190122d | ||
|
|
caa37d9b86 | ||
|
|
8a36ebd73e | ||
|
|
8890cec34b | ||
|
|
d2bcd90e9e | ||
|
|
017d7b1cb8 | ||
|
|
fccb7eaf69 | ||
|
|
6b94ed3308 | ||
|
|
cee0940c17 | ||
|
|
5663c4933a | ||
|
|
1292005d71 | ||
|
|
598598d26c | ||
|
|
4d6d45dd76 | ||
|
|
efe030c058 | ||
|
|
8b4b35be0a | ||
|
|
f51a10c546 | ||
|
|
c1acb96dc6 | ||
|
|
0952771b72 | ||
|
|
f116ff4f58 | ||
|
|
f6c794bd85 | ||
|
|
cc72eb1d2a | ||
|
|
68265ecfc9 | ||
|
|
adb71b42b6 | ||
|
|
bd372c46ec | ||
|
|
a62183fd64 | ||
|
|
74f451ab2e | ||
|
|
f98a3ba721 | ||
|
|
33e28ed71e | ||
|
|
2518d7d7a9 | ||
|
|
391ae75979 | ||
|
|
fa1270f62d | ||
|
|
7e583ad5d6 | ||
|
|
46386e5ee0 | ||
|
|
40442a6cc4 | ||
|
|
b783360750 | ||
|
|
5507bf9c95 | ||
|
|
dcb66b4ce6 | ||
|
|
d13386b02b | ||
|
|
9f64817f7d | ||
|
|
80a248e214 | ||
|
|
6e816fc2d3 | ||
|
|
0357abd27d | ||
|
|
98ab82451e | ||
|
|
ae0211df31 | ||
|
|
a71dd6e5c5 | ||
|
|
f3d6636fb9 | ||
|
|
499bfccdf3 | ||
|
|
10b4d8ef73 | ||
|
|
f7db8ee7d1 | ||
|
|
20de684fcd | ||
|
|
0b285d1ce5 | ||
|
|
85e806405c | ||
|
|
94d2d6da1d | ||
|
|
6d83162a72 | ||
|
|
995961bd93 | ||
|
|
f9e97e03dc | ||
|
|
87363eba75 | ||
|
|
9f2bf811be | ||
|
|
49735a9631 | ||
|
|
7d7d365d9c | ||
|
|
eff4e44151 | ||
|
|
ce5aa8edfb | ||
|
|
e28c203461 | ||
|
|
87d2843cfc | ||
|
|
09e9dbec4d | ||
|
|
35309cc15a | ||
|
|
f851a3190b | ||
|
|
a646e617ff | ||
|
|
9872bd0bc3 | ||
|
|
e01b990494 | ||
|
|
1000c46fe9 | ||
|
|
73c9b0e749 | ||
|
|
421fc46b42 | ||
|
|
66fd939231 | ||
|
|
725bfc17df | ||
|
|
2cde2c8e46 | ||
|
|
9e9b151960 | ||
|
|
5c563c5cb8 | ||
|
|
b8818d6cfc | ||
|
|
a081773563 | ||
|
|
cb3401e03a | ||
|
|
222b984cc3 | ||
|
|
0fda3d1fbd | ||
|
|
4e3fb69600 | ||
|
|
0ee8aac766 | ||
|
|
ca91178cbe | ||
|
|
c619247b02 | ||
|
|
3708fb1de7 | ||
|
|
4602e63dc1 | ||
|
|
d9cf3916f4 | ||
|
|
2c6bc53193 | ||
|
|
61ccec1abd | ||
|
|
c8bc719c4c | ||
|
|
3817a704ff | ||
|
|
1a62ef0b68 | ||
|
|
d37906f041 | ||
|
|
d77c090eaf | ||
|
|
8a5dc41e2e | ||
|
|
2dd43251ec | ||
|
|
9719b83766 | ||
|
|
9fb769900b | ||
|
|
9b12500fe1 | ||
|
|
2d0bde22e4 | ||
|
|
f0b3d37762 | ||
|
|
2f1745b9c8 | ||
|
|
db06ce05c1 | ||
|
|
9e830fd82d | ||
|
|
e4dfa534f6 | ||
|
|
9ad5b3686f | ||
|
|
2bb5300132 | ||
|
|
ed4f880369 | ||
|
|
01f6ac2148 | ||
|
|
253e12878c | ||
|
|
7b18d839ca | ||
|
|
b1f5390f90 | ||
|
|
c85ed21a50 | ||
|
|
a8daa191bf | ||
|
|
95f0ce016e | ||
|
|
6328625e63 | ||
|
|
2f84efb076 | ||
|
|
1c19a2bfa5 | ||
|
|
9a494bb545 | ||
|
|
f7cc6399c4 | ||
|
|
f996cbb2c0 | ||
|
|
d4e507ad41 | ||
|
|
25d1addbed | ||
|
|
295a57cc65 | ||
|
|
c54410f177 | ||
|
|
1ffb472245 | ||
|
|
db538a19d7 | ||
|
|
ba26e4690f | ||
|
|
478543cd73 | ||
|
|
e21deb998a | ||
|
|
7cc52df168 | ||
|
|
32304b128a | ||
|
|
fe0b2855ee | ||
|
|
5398dc8206 | ||
|
|
f0b509911a | ||
|
|
a13064936a | ||
|
|
a14b57d6f5 | ||
|
|
23d5e01508 | ||
|
|
b48172ce1b | ||
|
|
64721e4407 | ||
|
|
6a2a61287d | ||
|
|
08db59549f | ||
|
|
6a02b099da | ||
|
|
e49cd4edb8 | ||
|
|
919bd0d434 | ||
|
|
d9c643bb41 | ||
|
|
1004ffcb54 | ||
|
|
d62d659bf4 | ||
|
|
81833122b8 | ||
|
|
a3ee32e28d | ||
|
|
851732e3e1 | ||
|
|
485e7fcf7e | ||
|
|
c14a21e332 | ||
|
|
55e04969c9 | ||
|
|
b8db2eb59f | ||
|
|
47edc76b69 | ||
|
|
84b8fe77d7 | ||
|
|
28fdeb4a28 | ||
|
|
197a041da5 | ||
|
|
9b657a529b | ||
|
|
3008602982 | ||
|
|
1259c46d3c | ||
|
|
67a5183ad6 | ||
|
|
61162cfd67 | ||
|
|
6a2b0110b9 | ||
|
|
43d061d4f3 | ||
|
|
344c50572a | ||
|
|
2175a959db | ||
|
|
ccd760994b | ||
|
|
775c86a894 | ||
|
|
449f1e2fe5 | ||
|
|
dc7a2d08db | ||
|
|
88d08df966 | ||
|
|
5e8c31dadd | ||
|
|
ea7c3255fc | ||
|
|
e2bc4ff920 | ||
|
|
7500378696 | ||
|
|
3921b2b079 | ||
|
|
15c5c06c7f | ||
|
|
0270ac2c0b | ||
|
|
8842fb64db | ||
|
|
578d70b7cd | ||
|
|
ea73c417ff | ||
|
|
cbf7b33393 | ||
|
|
84e6492488 | ||
|
|
d24b80f395 | ||
|
|
ef175e9271 | ||
|
|
304a1f77a1 | ||
|
|
83012fe0e9 | ||
|
|
4df1fd48c4 | ||
|
|
81480ebcbc | ||
|
|
15628c5f8b | ||
|
|
5427e73ffa | ||
|
|
97982c52d7 | ||
|
|
892fb2ea93 | ||
|
|
4de6d09b64 | ||
|
|
52d9eccb72 | ||
|
|
abed73b3c6 | ||
|
|
5f9b7064c9 | ||
|
|
148ba14b56 | ||
|
|
3abc9fc0f8 | ||
|
|
0de8af2602 | ||
|
|
7f48891579 | ||
|
|
375bad91e6 | ||
|
|
887aa98e05 | ||
|
|
8862debae8 | ||
|
|
d1b28d6c7e | ||
|
|
b4cf700de6 | ||
|
|
cb9c2520bd | ||
|
|
e2c5b17775 | ||
|
|
4a1fa4ce38 | ||
|
|
ad6698346f | ||
|
|
5db635395d | ||
|
|
960d41a0d5 | ||
|
|
457f351954 | ||
|
|
ed3eeb59e4 | ||
|
|
7bb2d44d29 | ||
|
|
c774be5da9 | ||
|
|
b213b72e04 | ||
|
|
1f3ed28920 | ||
|
|
7df06d9b99 | ||
|
|
2b4dd24535 | ||
|
|
2807196e1e | ||
|
|
1665521590 | ||
|
|
0051f2b19f | ||
|
|
8f0d5d7024 | ||
|
|
e3883f2426 | ||
|
|
f006692c72 | ||
|
|
98870cab35 | ||
|
|
7ffbec56f3 | ||
|
|
28979a738d | ||
|
|
5977a382dd | ||
|
|
125f341f10 | ||
|
|
597668dd88 | ||
|
|
7b1cf8dd59 | ||
|
|
c71c1ab1f9 | ||
|
|
85a0250f11 | ||
|
|
dc0d63e1c0 | ||
|
|
1c229c15d0 | ||
|
|
32dd6aafd5 | ||
|
|
1500870bfa | ||
|
|
063342c36b | ||
|
|
f034cb48a1 | ||
|
|
12fc5a9a32 | ||
|
|
2db4db928e | ||
|
|
e03d62eeb7 | ||
|
|
59c1d7a01e | ||
|
|
e24d75cf94 | ||
|
|
8d1c0cd5b2 | ||
|
|
bb89ede9a2 | ||
|
|
8ffc7d031f | ||
|
|
49318711ab | ||
|
|
5e415f7bd4 | ||
|
|
abb7c260b4 | ||
|
|
622f835598 | ||
|
|
039f3a26af | ||
|
|
7cfdb91770 | ||
|
|
f0b9910163 | ||
|
|
1f730b9284 | ||
|
|
90005e98fe | ||
|
|
28fbeef528 | ||
|
|
ba24fb1aee | ||
|
|
a4f4184fe0 | ||
|
|
17b8798fbe | ||
|
|
133e98a434 | ||
|
|
583024a8fa | ||
|
|
9bea5c63e6 | ||
|
|
437733a98e | ||
|
|
366980ab4a | ||
|
|
8fa5d63cb0 | ||
|
|
82d7c503d8 | ||
|
|
7aec8d2a42 | ||
|
|
edc7a3da00 | ||
|
|
e722d89389 | ||
|
|
6f481a3472 | ||
|
|
7c5d87a506 | ||
|
|
ae398ffe8b | ||
|
|
644f1120ed | ||
|
|
edc4c33208 | ||
|
|
1c55a120b8 | ||
|
|
49f283f030 | ||
|
|
c96527a320 | ||
|
|
d363f55686 | ||
|
|
0610b5e051 | ||
|
|
e02157b394 | ||
|
|
1aafce7240 | ||
|
|
a73e6686d0 | ||
|
|
75ecd13e2c | ||
|
|
b3235d9998 | ||
|
|
71cb920cab | ||
|
|
f0f3990738 | ||
|
|
a432fd8699 | ||
|
|
f66759eac1 | ||
|
|
4c8003fb8c | ||
|
|
4a8d5d19d3 | ||
|
|
97778bd8ce | ||
|
|
560ee745ea | ||
|
|
c44cb63459 | ||
|
|
f9cad9acb4 | ||
|
|
c225d664a2 | ||
|
|
78d4b21830 | ||
|
|
349a0cda5f | ||
|
|
ff36b6aa7b | ||
|
|
fdb372e5a3 | ||
|
|
7089596664 | ||
|
|
9ff37eb37e | ||
|
|
dca9ba1202 | ||
|
|
359485654f | ||
|
|
0a858b7b05 | ||
|
|
e4131e25e4 | ||
|
|
b4cc142d08 | ||
|
|
7dbcf77914 | ||
|
|
23176b03dd | ||
|
|
ff31561484 | ||
|
|
6f55648495 | ||
|
|
122ddc2134 | ||
|
|
a110e19177 | ||
|
|
c2700b4b9e | ||
|
|
6a9f82eac5 | ||
|
|
ee91e844ef | ||
|
|
5fbc8f7e23 | ||
|
|
62cfe8b61b | ||
|
|
ef6b1a12f4 | ||
|
|
f2d38d2f13 | ||
|
|
76d763cd8e | ||
|
|
35c25efdc7 | ||
|
|
8eea5e3446 | ||
|
|
1563378777 | ||
|
|
03137abad6 | ||
|
|
48af4d28a9 | ||
|
|
bc45b7c1d8 | ||
|
|
8f8afd10ff | ||
|
|
428dde26e4 | ||
|
|
2b8b24f78a | ||
|
|
33b64ccd98 | ||
|
|
7fa4c0f215 | ||
|
|
ee3624ccdb | ||
|
|
4631e6f31a | ||
|
|
3232327c9d | ||
|
|
f3bc4e0425 | ||
|
|
790810ada9 | ||
|
|
994f25cdf0 | ||
|
|
c70c6005b3 | ||
|
|
63d1922367 | ||
|
|
0c7adec15c | ||
|
|
3230a9eca9 | ||
|
|
313d75276e | ||
|
|
045e29ae29 | ||
|
|
d0bace2c57 | ||
|
|
aa61590ad3 | ||
|
|
a1569ff1c2 | ||
|
|
39ea734595 | ||
|
|
471ed14f14 | ||
|
|
2ce65069fb | ||
|
|
1270b04c97 | ||
|
|
0b959888c7 | ||
|
|
bd620e76dd | ||
|
|
6f2fc71a7c | ||
|
|
24774cf9cc | ||
|
|
79d41f9a59 | ||
|
|
6e69f08e65 | ||
|
|
529e3c47bd | ||
|
|
e01a6293d5 | ||
|
|
e63b108e61 | ||
|
|
744a53ddf0 | ||
|
|
ff0d52b1a4 | ||
|
|
fbc24176cd | ||
|
|
a7987b89be | ||
|
|
448027d119 | ||
|
|
ec269425fd | ||
|
|
7543e00581 | ||
|
|
593ff86eeb | ||
|
|
46acd73b0b | ||
|
|
7ed4e8985d | ||
|
|
151c188018 | ||
|
|
97cb2f5933 | ||
|
|
a4d6350db0 | ||
|
|
d0d7f35c76 | ||
|
|
44f837acf8 | ||
|
|
68ded37681 | ||
|
|
f959265a74 | ||
|
|
01791870bc | ||
|
|
365c12e99f | ||
|
|
d2eaea9a85 | ||
|
|
18606cfb46 | ||
|
|
658730bb4b | ||
|
|
732d7f5561 | ||
|
|
592899a5f5 | ||
|
|
a99518e88d | ||
|
|
e3c8004429 | ||
|
|
343e2537de | ||
|
|
995ce3e17f | ||
|
|
f630e1799e | ||
|
|
ae8c507d37 | ||
|
|
605b490d17 | ||
|
|
ea491e3bed | ||
|
|
159c0affaf | ||
|
|
2d7f231f47 | ||
|
|
1417a0236a | ||
|
|
f7e389eec4 | ||
|
|
4f94da464d | ||
|
|
2e35d7571c | ||
|
|
3575982079 | ||
|
|
6f93eb7ca8 | ||
|
|
4dc7881df8 | ||
|
|
131bac2b53 | ||
|
|
e030989f59 | ||
|
|
51cc8377d2 | ||
|
|
5a75bba686 | ||
|
|
d0ad20c79d | ||
|
|
1fe7c55885 | ||
|
|
f63d3a01f1 | ||
|
|
981c2e4601 | ||
|
|
fe81f39299 | ||
|
|
3460e06701 | ||
|
|
dd41824dc5 | ||
|
|
72f1bb21ab | ||
|
|
95db195410 | ||
|
|
dc2e5a8ef9 | ||
|
|
31f7d6dd34 | ||
|
|
904a63b7e5 | ||
|
|
a8713687ae | ||
|
|
5f7ce77177 | ||
|
|
75f276cff4 | ||
|
|
a35470e783 | ||
|
|
48959c177c | ||
|
|
a0e945bf21 | ||
|
|
a0305a1fc6 | ||
|
|
78f22aea2f | ||
|
|
777a5dbab0 | ||
|
|
0a72f49270 | ||
|
|
d4799821f8 | ||
|
|
b87907a3be | ||
|
|
d950a6d8da | ||
|
|
af4ce5c886 | ||
|
|
7fd2b592b4 | ||
|
|
1e4e53bf80 | ||
|
|
1745959ed7 | ||
|
|
255570da57 | ||
|
|
b24cd07398 | ||
|
|
085db31507 | ||
|
|
092315362e | ||
|
|
6a655dc469 | ||
|
|
b217d73a44 | ||
|
|
d78b715166 | ||
|
|
d55e7cc900 | ||
|
|
443c49cbf9 | ||
|
|
0cbd23c615 | ||
|
|
55f7fdc264 | ||
|
|
7241244f70 | ||
|
|
d0ed305d43 | ||
|
|
b3e0314930 | ||
|
|
41fdb1da08 | ||
|
|
3b2eee464a | ||
|
|
b6980737f0 | ||
|
|
039e34ffaa | ||
|
|
99136873c0 | ||
|
|
7516eae124 | ||
|
|
84a3455035 | ||
|
|
9b86e6966b | ||
|
|
8388a394c1 | ||
|
|
120c01f735 | ||
|
|
189e5fe678 | ||
|
|
fc35ceeffc | ||
|
|
8698cece32 | ||
|
|
30fc4cc19f | ||
|
|
17ac979ae7 | ||
|
|
e37bdddb71 | ||
|
|
be7f62118c | ||
|
|
7079b22535 | ||
|
|
8b414664c5 | ||
|
|
0b89fec44c | ||
|
|
fb90a4caaf | ||
|
|
3e633a7021 | ||
|
|
4f7a1a73c7 | ||
|
|
4dd746e46d | ||
|
|
a89a6f6186 | ||
|
|
6c822c7993 | ||
|
|
67eb07aae2 | ||
|
|
5a34ecf947 | ||
|
|
4df7becbea | ||
|
|
586190fb8e | ||
|
|
2059ed3528 | ||
|
|
fc42a097eb | ||
|
|
ba27712ccd | ||
|
|
02fb161187 | ||
|
|
826be871bc | ||
|
|
6958a3be52 | ||
|
|
6576b9bf69 | ||
|
|
77a4348695 | ||
|
|
f1f9396d4f | ||
|
|
a550f19877 | ||
|
|
aea447768f | ||
|
|
68c7b774e6 | ||
|
|
ce89e0d560 | ||
|
|
111fa9a728 | ||
|
|
001f85c695 | ||
|
|
23ab20680a | ||
|
|
aff41f6382 | ||
|
|
cdfbe82f07 | ||
|
|
8316e86843 | ||
|
|
591a76e0bd | ||
|
|
a9ba9ccea8 | ||
|
|
9d30ba0210 | ||
|
|
5f32fc582f | ||
|
|
c519d635f1 | ||
|
|
272627527b | ||
|
|
1406ef90ec | ||
|
|
fbad2dcdc0 | ||
|
|
b24d6815bc | ||
|
|
a28a052ac6 | ||
|
|
71c2ae7fca | ||
|
|
fb1d118622 | ||
|
|
1dbfce5ea7 | ||
|
|
b4e502737c | ||
|
|
bbefc0b90e | ||
|
|
fe8a8cc8e7 | ||
|
|
dbacdf939b | ||
|
|
728ee7e21f | ||
|
|
0f94de5dd8 | ||
|
|
6351a5becf | ||
|
|
881f1c6077 | ||
|
|
2dfa5cdd45 | ||
|
|
413cdab6b7 | ||
|
|
e4827d8110 | ||
|
|
7fe64c20b0 | ||
|
|
4dfb7611ed | ||
|
|
233a8c3134 | ||
|
|
885ab83dba | ||
|
|
4df106d0e6 | ||
|
|
54707bc916 | ||
|
|
0d4ab080a9 | ||
|
|
3b3aafd920 | ||
|
|
a1509554e7 | ||
|
|
3dd13913da | ||
|
|
6581a79466 | ||
|
|
f8b4ba66bc | ||
|
|
ab323f6b2a | ||
|
|
535f8fc3d6 | ||
|
|
8cba1f3939 | ||
|
|
18ddb1f6ad | ||
|
|
dc3d359393 | ||
|
|
31b5327765 | ||
|
|
622ac05c63 | ||
|
|
6319d41ab6 | ||
|
|
19ea0c5b11 | ||
|
|
9471ebced4 | ||
|
|
fbf776164b | ||
|
|
feee088277 | ||
|
|
1630965ce8 | ||
|
|
bb556e9c7f | ||
|
|
b0ec8041de | ||
|
|
9e329634b3 | ||
|
|
7843ed8770 | ||
|
|
008582fce5 | ||
|
|
8ecfbed208 | ||
|
|
851fc877d0 | ||
|
|
3ff8fff6af | ||
|
|
74ae69a49b | ||
|
|
3df75bed77 | ||
|
|
37034092d4 | ||
|
|
8e98e16796 | ||
|
|
1c2d7163c1 | ||
|
|
0e2d83529b | ||
|
|
c1bc6871c3 | ||
|
|
12c6e04b17 | ||
|
|
d2912daaac | ||
|
|
983881e398 | ||
|
|
822b4d9c01 | ||
|
|
8074a129cd | ||
|
|
844ac565ef | ||
|
|
40eeea76d8 | ||
|
|
c7b5a70830 | ||
|
|
4972df4cdf | ||
|
|
028fd5c930 | ||
|
|
1397a84db7 | ||
|
|
9523481fe2 | ||
|
|
00a413d3b0 | ||
|
|
dd6d061488 | ||
|
|
038cb865be | ||
|
|
f46914eab9 | ||
|
|
a71305bdc3 | ||
|
|
9ef30029aa | ||
|
|
69231d79ff | ||
|
|
22a4cfc835 | ||
|
|
db1c760a3c | ||
|
|
70f831bc22 | ||
|
|
c20117ef22 | ||
|
|
0e92b61ebf | ||
|
|
f36b06ee40 | ||
|
|
5739cfb2d0 | ||
|
|
7b8ff3d087 | ||
|
|
087c0be980 | ||
|
|
1f1153bc57 | ||
|
|
c54e4875bd | ||
|
|
06dc37d064 | ||
|
|
c32522129b | ||
|
|
0f50203063 | ||
|
|
50b2cd65fa | ||
|
|
a036fc3bea | ||
|
|
b2c098ee44 | ||
|
|
1f92bafc8f | ||
|
|
50baf2c401 | ||
|
|
440b39a3ee | ||
|
|
ed45cfb078 | ||
|
|
249bfeb9fe | ||
|
|
68ec71efad | ||
|
|
a42a4ec0f0 | ||
|
|
4504bea340 | ||
|
|
d395341b1c | ||
|
|
a3f509766a | ||
|
|
69130eb9fe | ||
|
|
bac63f2faf | ||
|
|
bedf8a6157 | ||
|
|
947e8b16fb | ||
|
|
fd9f14053a | ||
|
|
4821082a53 | ||
|
|
56774f66d0 | ||
|
|
76b12d5465 | ||
|
|
fcac6d58c2 | ||
|
|
f3dcea6db1 | ||
|
|
030267adf3 | ||
|
|
119a28190f | ||
|
|
dfcf412627 | ||
|
|
386efe7325 | ||
|
|
d63f7075a9 | ||
|
|
a24fde6280 | ||
|
|
c78c8c0a43 | ||
|
|
1fdfc4bca8 | ||
|
|
bf878a6322 | ||
|
|
a77e725968 | ||
|
|
e69a6f945b | ||
|
|
c6e589c31a | ||
|
|
cc62873cb3 | ||
|
|
e27299e03b | ||
|
|
c2d671deac | ||
|
|
70d2885e0b | ||
|
|
ff7451ccc0 | ||
|
|
a09aba049c | ||
|
|
6be13dc50b | ||
|
|
6b54aa9784 | ||
|
|
b5381eb23e | ||
|
|
a600ceca96 | ||
|
|
f4296903ce | ||
|
|
abeaab1602 | ||
|
|
00211ea1f0 | ||
|
|
ca97992985 | ||
|
|
8850cbcb38 | ||
|
|
382e540086 | ||
|
|
b9d5898908 | ||
|
|
20c60b021f | ||
|
|
f81a818afa | ||
|
|
58b5bae0cb | ||
|
|
69e5efdd91 | ||
|
|
811c572cf8 | ||
|
|
0c6f8bbefd | ||
|
|
a58856e0d5 | ||
|
|
9ce18ac6e5 | ||
|
|
5bdb318371 | ||
|
|
3659d10464 | ||
|
|
bf26a96691 | ||
|
|
4625702437 | ||
|
|
438f9360e1 | ||
|
|
d54288be7f | ||
|
|
3f2266581c | ||
|
|
5085b17246 | ||
|
|
ecd3f09e74 | ||
|
|
aa8a4447ef | ||
|
|
0ea465d45f | ||
|
|
6c1468d59d | ||
|
|
345a4b396d | ||
|
|
ed21106256 | ||
|
|
5b28717fec | ||
|
|
85ff0f7030 | ||
|
|
df2d335539 | ||
|
|
144429e984 | ||
|
|
9cf34e208c | ||
|
|
f64849dc72 | ||
|
|
853b8e79f3 | ||
|
|
6a6069354d | ||
|
|
d66b99c9f4 | ||
|
|
c195c0aaf2 | ||
|
|
d7f483708a | ||
|
|
333c370d71 | ||
|
|
c5222f828c | ||
|
|
a828e0e934 | ||
|
|
9c87d92c91 | ||
|
|
833e99e6a7 | ||
|
|
af3332d595 | ||
|
|
97119e182a | ||
|
|
a504a33138 | ||
|
|
cd741318d3 | ||
|
|
d0f50e30e4 | ||
|
|
2ab0a4a032 | ||
|
|
f73d8075c6 | ||
|
|
fc8e4a077e | ||
|
|
83272bbd2f | ||
|
|
153526208d | ||
|
|
d553a0d2c5 | ||
|
|
5732d2f126 | ||
|
|
88950ad717 | ||
|
|
60d1234579 | ||
|
|
74f77cf920 | ||
|
|
7192f32409 | ||
|
|
b1d397e91b | ||
|
|
42cbf081d0 | ||
|
|
ddc47ef2f2 | ||
|
|
931f4f2df6 | ||
|
|
97c87a6bf8 | ||
|
|
85386190d2 | ||
|
|
0ffcef0fc8 | ||
|
|
96645bff74 | ||
|
|
9bd125e1de | ||
|
|
5b549c7d4a | ||
|
|
550ef67140 | ||
|
|
7be677573e | ||
|
|
65bea0960c | ||
|
|
0ddb694d5c | ||
|
|
de6cadea7d | ||
|
|
fd8c41243e | ||
|
|
40193dcfa7 | ||
|
|
75d63a8bb5 | ||
|
|
5d1ca5e7c6 | ||
|
|
a685b68033 | ||
|
|
36da5e1a16 | ||
|
|
ab78ba209c | ||
|
|
4ae7263242 | ||
|
|
b1128630e4 | ||
|
|
b906b0fcce | ||
|
|
b723200206 | ||
|
|
81d967eab5 | ||
|
|
2673720ce8 | ||
|
|
03bb0c45a4 | ||
|
|
8eef49b990 | ||
|
|
40516e52a4 | ||
|
|
7a31d39759 | ||
|
|
2407f4f0d9 | ||
|
|
fa0172afb0 | ||
|
|
2952838d64 | ||
|
|
f9db9a5810 | ||
|
|
a26e7a0a49 | ||
|
|
8400768e9a | ||
|
|
a51ff7379b | ||
|
|
be4fa8cef9 | ||
|
|
8b4df0aaff | ||
|
|
85bd57fb74 | ||
|
|
3dba61c334 | ||
|
|
84d991e191 | ||
|
|
e4fd785fbd | ||
|
|
54a3a76774 | ||
|
|
8a20ab1088 | ||
|
|
2d41918dae | ||
|
|
dae81d157b | ||
|
|
a014e5227c | ||
|
|
633bca17d9 | ||
|
|
e19e89b20f | ||
|
|
9eba78035a | ||
|
|
68a26cf7d5 | ||
|
|
e3077951ca | ||
|
|
9d79b2e8d5 | ||
|
|
ecd3cddeca | ||
|
|
38de54f03a | ||
|
|
49d25dce7c | ||
|
|
e4d74ff3cb | ||
|
|
c789bf7509 | ||
|
|
ee26a8a8f6 | ||
|
|
06540c61b3 | ||
|
|
72a5f1fa53 | ||
|
|
ba13b76ffe | ||
|
|
a70d0b3144 | ||
|
|
a853432699 | ||
|
|
afa8c96236 | ||
|
|
88c4e9880b | ||
|
|
4ffaf24ab8 | ||
|
|
c2c4c1a4ea | ||
|
|
c09b89127b | ||
|
|
291215d6a9 | ||
|
|
23e73f2b0d | ||
|
|
6f7f3296e0 | ||
|
|
6c89a3310c | ||
|
|
579972dd62 | ||
|
|
c7916f4483 | ||
|
|
3dff6606f2 | ||
|
|
69ab027ecf | ||
|
|
ee175fcfd3 | ||
|
|
bf2a2cf7cc | ||
|
|
0094f97f3c | ||
|
|
77cc78e5e7 | ||
|
|
6f1eed006f | ||
|
|
5b09ed5b78 | ||
|
|
86ad73d71b | ||
|
|
5017882299 | ||
|
|
7d6f0afc73 | ||
|
|
8989ee4abf | ||
|
|
c85f1bfa4e | ||
|
|
0fe03690f8 | ||
|
|
227298f10b | ||
|
|
388fa7ac45 | ||
|
|
926c12c560 | ||
|
|
8cafc52ff3 | ||
|
|
6483947732 | ||
|
|
8b6dab73be | ||
|
|
0d8d459deb | ||
|
|
5f9778d505 | ||
|
|
a023302cbb | ||
|
|
5937327c44 | ||
|
|
f29529494c | ||
|
|
a1d0a19ec5 | ||
|
|
55635a499e | ||
|
|
582b4ea365 | ||
|
|
718e2a71ec | ||
|
|
97c909de30 | ||
|
|
0a49604e83 | ||
|
|
7a2c197144 | ||
|
|
82a82b2bae | ||
|
|
9aa9bfaaf1 | ||
|
|
134a3668ae | ||
|
|
00b0a8d148 | ||
|
|
6111162808 | ||
|
|
63d43fbfb0 | ||
|
|
6f2275c4ab | ||
|
|
55b3af43e8 | ||
|
|
144f8f3a4b | ||
|
|
0b5a25446a | ||
|
|
1ddc459df6 | ||
|
|
cfe8a03ff3 | ||
|
|
3e4f71fe29 | ||
|
|
f236be7241 | ||
|
|
18ac53bb5d | ||
|
|
ebd866660e | ||
|
|
4a4e834199 | ||
|
|
eee1d07cf5 | ||
|
|
6539724237 | ||
|
|
21bb39d102 | ||
|
|
4a93077ddf | ||
|
|
30c6e6582b | ||
|
|
b8e4e24434 | ||
|
|
926b788fc9 | ||
|
|
c425a9c12b | ||
|
|
15e395f6a4 | ||
|
|
cf35f79402 | ||
|
|
431812cd6d | ||
|
|
d0cf0ced4a | ||
|
|
a6dbf2facd | ||
|
|
56da3a6bf6 | ||
|
|
55323b32f1 | ||
|
|
49c005525e | ||
|
|
fafb5bd1e8 | ||
|
|
075fdeaa5c | ||
|
|
065ec54a46 | ||
|
|
e7eb31a0df | ||
|
|
d340b8da04 | ||
|
|
a17eca915c | ||
|
|
149629e1e2 | ||
|
|
05948719b1 | ||
|
|
c2e4c526d0 | ||
|
|
4da2a92335 | ||
|
|
65b1250353 | ||
|
|
562cf1e47a | ||
|
|
7ae710ace6 | ||
|
|
611ce79893 | ||
|
|
5ceb4a2291 | ||
|
|
4f719b2c4d | ||
|
|
4b5f47441b | ||
|
|
6b3c4a3bbe | ||
|
|
2f8c97d99d | ||
|
|
3d527efc50 | ||
|
|
7dd62135a3 | ||
|
|
4071a37ef4 | ||
|
|
dd6eea5406 | ||
|
|
840a2b37b5 | ||
|
|
762d41f41c | ||
|
|
e0b48bec6f | ||
|
|
28b3a8cffa | ||
|
|
431335b27d | ||
|
|
237ae621a4 | ||
|
|
f959999594 | ||
|
|
997d57faae | ||
|
|
1f2a891c7a | ||
|
|
911528b6d7 | ||
|
|
9b6620e21c | ||
|
|
17fc45faba | ||
|
|
59add586e3 | ||
|
|
bb472f8669 | ||
|
|
2f807f5793 | ||
|
|
a770aeab31 | ||
|
|
afa8e9b947 | ||
|
|
6c733d9f7b | ||
|
|
4474d26e5b | ||
|
|
9ca91d3518 | ||
|
|
d4823f735a | ||
|
|
4f87d063b8 | ||
|
|
eaae1243e6 | ||
|
|
3ce44dcdfa | ||
|
|
17f4291b70 | ||
|
|
31019d38a2 | ||
|
|
bca69ce180 | ||
|
|
f56c5d230e | ||
|
|
45caba7c72 | ||
|
|
0fc13dfa87 | ||
|
|
f5b60aa156 | ||
|
|
023d5ffab0 | ||
|
|
a4760e9c70 | ||
|
|
a58587d3a5 | ||
|
|
3b35a4f9c1 | ||
|
|
6ddaabcead | ||
|
|
d706747bd1 | ||
|
|
503ea74554 | ||
|
|
128a6d840f | ||
|
|
a0b4747c57 | ||
|
|
e237b9d8ba | ||
|
|
0bd342af4a | ||
|
|
1c8018a5ab | ||
|
|
5760eaf5fc | ||
|
|
ea4341a938 | ||
|
|
a410c7f132 | ||
|
|
83f954520c | ||
|
|
29963bfe39 | ||
|
|
163b45fdab | ||
|
|
73eda1ee69 | ||
|
|
2ea42c0928 | ||
|
|
af3afff65c | ||
|
|
1651717c41 | ||
|
|
71b718a3b9 | ||
|
|
c619e7b3b7 | ||
|
|
6e5ee3312d | ||
|
|
14b29354bb | ||
|
|
9460f0c613 | ||
|
|
ff083e9600 | ||
|
|
008a450cfd | ||
|
|
1e5edb91a7 | ||
|
|
863475d8d0 | ||
|
|
5194bb5f80 | ||
|
|
2c6f07a416 | ||
|
|
664c3bf797 | ||
|
|
031b923385 | ||
|
|
db75f373b3 | ||
|
|
d2badfc49e | ||
|
|
200588c3b0 | ||
|
|
5511c94080 | ||
|
|
e4460b46f3 | ||
|
|
bd3855b315 | ||
|
|
00f6a2ee32 | ||
|
|
4594df128c | ||
|
|
a3b330bdf5 | ||
|
|
01a1403f67 | ||
|
|
a09c6beb5c | ||
|
|
d589bcd911 | ||
|
|
401dbfc523 | ||
|
|
6cc7c6fcbd | ||
|
|
7e37fee039 | ||
|
|
0e2d84c60e | ||
|
|
647a03d53c | ||
|
|
97e7b62860 | ||
|
|
da03d81df6 | ||
|
|
194717b0c8 | ||
|
|
ccf5d144b5 | ||
|
|
87552b959c | ||
|
|
1a384df3ce | ||
|
|
bf0a46d3f6 | ||
|
|
e0570a7677 | ||
|
|
738c92e036 | ||
|
|
56e60218b3 | ||
|
|
0dad90aa7f | ||
|
|
9abdc3e9ae | ||
|
|
35e62e4777 | ||
|
|
aa5d98a918 | ||
|
|
6e0f31092e | ||
|
|
1c98f5954d | ||
|
|
19b5126542 | ||
|
|
b5fa66428c | ||
|
|
6a0d138a08 | ||
|
|
14804a1396 | ||
|
|
38dbeab543 | ||
|
|
41fdb82dd1 | ||
|
|
91af9dbfc0 | ||
|
|
c3cc9f8e21 | ||
|
|
1429123da4 | ||
|
|
93973d4a49 | ||
|
|
df028f3714 | ||
|
|
6937a4d1e2 | ||
|
|
19680f4ebd | ||
|
|
8a450c6b4d | ||
|
|
dacc345814 | ||
|
|
349459c502 | ||
|
|
fc9655bde3 | ||
|
|
faac91b3be | ||
|
|
eaa75f0a3f | ||
|
|
6ca850fbe6 | ||
|
|
f035fff922 | ||
|
|
625220a856 | ||
|
|
134aeb0085 | ||
|
|
7d51c61184 | ||
|
|
ec523fdf0b | ||
|
|
849e22dfff | ||
|
|
d334ab504a | ||
|
|
09f3d78d1c | ||
|
|
363313ee59 | ||
|
|
48371badfc | ||
|
|
cd3bb82030 | ||
|
|
2f0a9985de | ||
|
|
83887ad91b | ||
|
|
7c6bde8551 | ||
|
|
d355d6be5c | ||
|
|
35441575e7 | ||
|
|
92424ee0e3 | ||
|
|
bb4974a467 | ||
|
|
d5cc98338e | ||
|
|
ea30714b53 | ||
|
|
12ce22b1a4 | ||
|
|
e2865c4576 | ||
|
|
14cbcbf2ac | ||
|
|
c71f96710f | ||
|
|
f787dd331d | ||
|
|
33b42b554e | ||
|
|
5ac6b0a787 | ||
|
|
11ae968eb6 | ||
|
|
48a882755e | ||
|
|
a179aa698b | ||
|
|
a69435baa1 | ||
|
|
2f4ff28011 | ||
|
|
6cef921092 | ||
|
|
4c53554eae | ||
|
|
ec7681b75d | ||
|
|
0d46b06833 | ||
|
|
6316b4a4e4 | ||
|
|
85d7186bf6 | ||
|
|
b5ae16e463 | ||
|
|
acbb64b9b4 | ||
|
|
63af0632df | ||
|
|
60d31003cf | ||
|
|
cb22efe237 | ||
|
|
3a7f5f7320 | ||
|
|
bf2870d53b | ||
|
|
5024413d68 | ||
|
|
e418257394 | ||
|
|
4640a5eea4 | ||
|
|
c55568852b | ||
|
|
21448785ec | ||
|
|
4acd808412 | ||
|
|
806e9eefd1 | ||
|
|
4634470897 | ||
|
|
670d6a9078 | ||
|
|
1bf056b5ca | ||
|
|
3aae4e73f2 | ||
|
|
bd64ca2cb9 | ||
|
|
1c6ef1c02c | ||
|
|
1119146fcd | ||
|
|
45d5f46063 | ||
|
|
a5407aff0a | ||
|
|
be1fba0b34 | ||
|
|
d1186a73ab | ||
|
|
cb8f3dd3e2 | ||
|
|
33144fdad4 | ||
|
|
89e6af4fb5 | ||
|
|
a1c0d95647 | ||
|
|
a4dbb0ee88 | ||
|
|
a4e1bcfd2d | ||
|
|
3ad5ea54fb | ||
|
|
2b9cdc2689 | ||
|
|
5a9eee5a12 | ||
|
|
ff8edc4adc | ||
|
|
d83dbd88c4 | ||
|
|
7af6e41fa1 | ||
|
|
b3c084db06 | ||
|
|
37cdc6a4fe | ||
|
|
e9a29ac2e6 | ||
|
|
f7ffb89690 | ||
|
|
77fcc86c14 | ||
|
|
f0dddf2854 | ||
|
|
d23c3a6e4d | ||
|
|
26726238b5 | ||
|
|
51d8809a22 | ||
|
|
92e696a6ea | ||
|
|
cae2b33d34 | ||
|
|
e1ab4e4532 | ||
|
|
21fe0590ed | ||
|
|
0d76068eb8 | ||
|
|
f6faea6f81 | ||
|
|
72c34be6f9 | ||
|
|
65da0763f7 | ||
|
|
baed9715df | ||
|
|
8d2fa0418a | ||
|
|
f7dd512ba8 | ||
|
|
9c9006f55e | ||
|
|
177698e014 | ||
|
|
70834437dd | ||
|
|
a501d4b688 | ||
|
|
cb0360016d | ||
|
|
55f179db5c | ||
|
|
e8c844b32a | ||
|
|
b8fb999660 | ||
|
|
93964edfed | ||
|
|
3a89eeffc9 | ||
|
|
72ac50ca24 | ||
|
|
6f8e5b4447 | ||
|
|
64efe3e91c | ||
|
|
eda444a92b | ||
|
|
7999173fc7 | ||
|
|
a4c2329316 | ||
|
|
e2b8ce4d5d | ||
|
|
13ee198069 | ||
|
|
84e74a8abf | ||
|
|
a1903268ad | ||
|
|
f36d1802df | ||
|
|
a8beea705e | ||
|
|
0e60209a24 | ||
|
|
5187223a76 | ||
|
|
d99263ed75 | ||
|
|
eb489320e1 | ||
|
|
1b906e0369 | ||
|
|
5019375c1f | ||
|
|
3f1f149312 | ||
|
|
698f4e0e16 | ||
|
|
c089510571 | ||
|
|
e2bb83fbdb | ||
|
|
16b030459f | ||
|
|
2fbdb960f6 | ||
|
|
e80f8b391d | ||
|
|
231f9a0246 | ||
|
|
eb26a123cf | ||
|
|
2b8c618b27 | ||
|
|
7d0c23b02b | ||
|
|
1fc27844ce | ||
|
|
d6d0be0a3c | ||
|
|
94b5611023 | ||
|
|
5142d17030 | ||
|
|
6bcd42f543 | ||
|
|
d00f29b663 | ||
|
|
633d2c58e2 | ||
|
|
55d46b3801 | ||
|
|
d329ae66ae | ||
|
|
54d0d3bd2c | ||
|
|
9a50e83dce | ||
|
|
a98bc2643a | ||
|
|
3bf411f705 | ||
|
|
2d0dc11c64 | ||
|
|
30c3556abc | ||
|
|
6a3569280a | ||
|
|
76215199f1 | ||
|
|
3d8b7de265 | ||
|
|
4bc768fc32 | ||
|
|
e34938c8dc | ||
|
|
254efe0d53 | ||
|
|
cdfd1299f0 | ||
|
|
c005dc7dad | ||
|
|
9193af0210 | ||
|
|
12eef3702d | ||
|
|
480175df7d | ||
|
|
8ae9aaebf8 | ||
|
|
e7ac8a5d12 | ||
|
|
6710e15c5c | ||
|
|
f5c586edaf | ||
|
|
16163aad45 | ||
|
|
1cb372a8e7 | ||
|
|
e22820c475 | ||
|
|
9469dee1b8 | ||
|
|
71aecd3927 | ||
|
|
a8f2fb5c24 | ||
|
|
5a4a0f9710 | ||
|
|
f5bbbff05b | ||
|
|
fc0251d305 | ||
|
|
7129774def | ||
|
|
fc71fe2c0e | ||
|
|
de55362fe1 | ||
|
|
4df953f3bd | ||
|
|
a867b1979c | ||
|
|
8acb0872ac | ||
|
|
4afe186dc4 | ||
|
|
87c5d993dc | ||
|
|
a0666e9591 | ||
|
|
593285a975 | ||
|
|
7096ffbc98 | ||
|
|
490678193a | ||
|
|
3d3c197dc0 | ||
|
|
7ac03c7835 | ||
|
|
887239e1d4 | ||
|
|
ea415cce97 | ||
|
|
409e068104 | ||
|
|
b4ec7e4e34 | ||
|
|
7ad5b133ff | ||
|
|
01bc1043e4 | ||
|
|
dad23b95db | ||
|
|
23a79af4dc | ||
|
|
39bbccebfc | ||
|
|
b32d1c7fa9 | ||
|
|
b318f01819 | ||
|
|
7e8ca9a005 | ||
|
|
6f657470fe | ||
|
|
dfc59ef087 | ||
|
|
b09c3b3491 | ||
|
|
c63f80dbaf | ||
|
|
66556fe514 | ||
|
|
d4d41d8eff | ||
|
|
12d6469ee7 | ||
|
|
d0f604c81a | ||
|
|
f5f347109c | ||
|
|
4195c0e9fa | ||
|
|
f87fbdb857 | ||
|
|
d97912ce37 | ||
|
|
1b725c3ac4 | ||
|
|
ab23820319 | ||
|
|
8c7614ac34 | ||
|
|
63b9d44968 | ||
|
|
8887c8a07e | ||
|
|
8367ed5943 | ||
|
|
6ceeeb7239 | ||
|
|
1e5fe42652 | ||
|
|
b9802a0d6e | ||
|
|
343423adc2 | ||
|
|
961cfbe12e | ||
|
|
1207801f77 | ||
|
|
fd816a1a5b | ||
|
|
e086613047 | ||
|
|
c121c18b4f | ||
|
|
5e0b6a687f | ||
|
|
2ccaf8f927 | ||
|
|
c94d4bea59 | ||
|
|
7528ef0fef | ||
|
|
901e565798 | ||
|
|
7323c9e0da | ||
|
|
054bcf6dec | ||
|
|
79a01657a7 | ||
|
|
ff5ee510a3 | ||
|
|
b4f3e252d0 | ||
|
|
c10a141861 | ||
|
|
a83e3a6223 | ||
|
|
76d820d0f4 | ||
|
|
b0ece8eb3a | ||
|
|
e5f836df4b | ||
|
|
e4256a1cd3 | ||
|
|
06e8db1bf8 | ||
|
|
c84fbacb8b | ||
|
|
cba0190e05 | ||
|
|
39e9479ac8 | ||
|
|
f8f1ef779e | ||
|
|
9fccd4c2d0 | ||
|
|
8dc2c082c3 | ||
|
|
7ec25aa692 | ||
|
|
3835d0758b | ||
|
|
e4ab7f2254 | ||
|
|
abbd2a260e | ||
|
|
892cf38736 | ||
|
|
cc9afc7d3e | ||
|
|
f210455827 | ||
|
|
55f84acd98 | ||
|
|
b6f02b52cb | ||
|
|
b21ab3282d | ||
|
|
1f3318524b | ||
|
|
e2e5a24926 | ||
|
|
1120cdaa03 | ||
|
|
25c7c7c8af | ||
|
|
07a01628a0 | ||
|
|
edae245b0e | ||
|
|
fdde5a6713 | ||
|
|
28508f0be4 | ||
|
|
1502269102 | ||
|
|
d496969846 | ||
|
|
e7ee4f4ef1 | ||
|
|
7f25fcf05f | ||
|
|
4551cda108 | ||
|
|
105e95a991 | ||
|
|
2257b4efde | ||
|
|
d53c6289dc | ||
|
|
d5bc0051fb | ||
|
|
4477777cd4 | ||
|
|
d81cfcbbba | ||
|
|
42e936b6b1 | ||
|
|
f6007413de | ||
|
|
12b3ffb6b9 | ||
|
|
034f987d38 | ||
|
|
d3ca761e30 | ||
|
|
f8dcf11f99 | ||
|
|
a780021f7b | ||
|
|
f43da62c3e | ||
|
|
6487bd1ff4 | ||
|
|
bb870a6926 | ||
|
|
6216fb09da | ||
|
|
a1751c30ab | ||
|
|
98e7e86697 | ||
|
|
c488360abc | ||
|
|
c38d9601c8 | ||
|
|
aa60ef5bcc | ||
|
|
e611d3d74e | ||
|
|
24a9694494 | ||
|
|
55671189f0 | ||
|
|
8e595a903c | ||
|
|
2e49d55faf | ||
|
|
08d8e0799a | ||
|
|
5d54009c21 | ||
|
|
fcc33b856f | ||
|
|
b8d48fac23 | ||
|
|
4c27f96902 | ||
|
|
9fde027411 | ||
|
|
2af460314d | ||
|
|
a639da2973 | ||
|
|
9cbbb6fd03 | ||
|
|
20a083c859 | ||
|
|
685880a7b6 | ||
|
|
9010d21b32 | ||
|
|
841774f69f | ||
|
|
04e34810e0 | ||
|
|
dcfc77364e | ||
|
|
be2d15fc4f | ||
|
|
014e261af1 | ||
|
|
f343c2f7b1 | ||
|
|
30ae2da9cd | ||
|
|
9236bd6d7c | ||
|
|
85f05019b5 | ||
|
|
6509badc36 | ||
|
|
21856a78e5 | ||
|
|
6ee175e65d | ||
|
|
2f067ae8aa | ||
|
|
fcc38162c5 | ||
|
|
771e6b2faa | ||
|
|
28cc2957c8 | ||
|
|
1e99847291 | ||
|
|
2edd420943 | ||
|
|
852ec76549 | ||
|
|
7caf442717 | ||
|
|
e1ca009d9a | ||
|
|
5b591c2c4c | ||
|
|
55c7d0e0fc | ||
|
|
6a2cadb08f | ||
|
|
0ccb8a19dc | ||
|
|
7d87db1939 | ||
|
|
e94733df9c | ||
|
|
a69f3bd271 | ||
|
|
d7905cd06a | ||
|
|
244b9718d5 | ||
|
|
020379cf40 | ||
|
|
183587f8b4 | ||
|
|
a963f3ccc1 | ||
|
|
e540947704 | ||
|
|
b94f8cddde | ||
|
|
6fd1ef440b | ||
|
|
cd2b9d9871 | ||
|
|
eb1b936ff1 | ||
|
|
8bf7c4076b | ||
|
|
9a76ae8d12 | ||
|
|
a9dc8db3bb | ||
|
|
b99a6b6af2 | ||
|
|
397699ec31 | ||
|
|
3529db4d37 | ||
|
|
694d089fe0 | ||
|
|
de560ceb29 | ||
|
|
73c417bf70 | ||
|
|
dfc06acfd3 | ||
|
|
1b0a949dc5 | ||
|
|
4e7667842b | ||
|
|
5129749cb8 | ||
|
|
1fe6fa8b06 | ||
|
|
7034e99aa5 | ||
|
|
47e55fe686 | ||
|
|
668ddde68b | ||
|
|
ea259b8961 | ||
|
|
3428289778 | ||
|
|
12c9238f62 | ||
|
|
360060f59d | ||
|
|
720b16befb | ||
|
|
def739c279 | ||
|
|
0e9af797e5 | ||
|
|
17665a6333 | ||
|
|
58b82fefd8 | ||
|
|
66cb87e18f | ||
|
|
564fb3fd19 | ||
|
|
89fe89775c | ||
|
|
e112deb37a | ||
|
|
a6189c4fdd | ||
|
|
ff7dca2d05 | ||
|
|
d83d4098de | ||
|
|
3c2e1de05e | ||
|
|
492597e3b2 | ||
|
|
9078d2aea6 | ||
|
|
c74f634e79 | ||
|
|
72f0a923e0 | ||
|
|
23be3b5605 | ||
|
|
49491fac75 | ||
|
|
8ebf284993 | ||
|
|
0a072d7403 | ||
|
|
e862231feb | ||
|
|
f7df30b549 | ||
|
|
3f87bea143 | ||
|
|
e1dce56a56 | ||
|
|
9ae52aa90a | ||
|
|
2523a62878 | ||
|
|
1762e4a6be | ||
|
|
e691cbc995 | ||
|
|
f98f7e12be | ||
|
|
7034b6a0f0 | ||
|
|
d240e24ef1 | ||
|
|
8f497bfac7 | ||
|
|
23601fda0d | ||
|
|
278eedf7ad | ||
|
|
efe43d3466 | ||
|
|
e19577e35c | ||
|
|
42568915bd | ||
|
|
6ca2f86255 | ||
|
|
32b0a71369 | ||
|
|
2cf3e96a6b | ||
|
|
cc187b758d | ||
|
|
ea11ea8a63 | ||
|
|
33212b6499 | ||
|
|
ef1880b03a | ||
|
|
077d4b2a54 | ||
|
|
07b00e2fae | ||
|
|
018159b822 | ||
|
|
7f20e9109f | ||
|
|
2cb5a44f3e | ||
|
|
450ac81a1e | ||
|
|
dd840fe227 | ||
|
|
57772da95b | ||
|
|
e672918122 | ||
|
|
6b00a67df0 | ||
|
|
8e68228c86 | ||
|
|
0cae377b72 | ||
|
|
d343e5b73a | ||
|
|
72cb0142b2 | ||
|
|
ffdef38781 | ||
|
|
0578517f3a | ||
|
|
f994cdac45 | ||
|
|
1f16f9dc23 | ||
|
|
dbaf87c202 | ||
|
|
391c18e9e7 | ||
|
|
026e23d8ed | ||
|
|
8a579733c0 | ||
|
|
cfc99c4f23 | ||
|
|
dac33aeb71 | ||
|
|
29af6aefbc | ||
|
|
99e6883251 | ||
|
|
2513b23ad9 | ||
|
|
d64d8ce6e0 | ||
|
|
2f994399e9 | ||
|
|
ad100d79dc | ||
|
|
c11ed4873b | ||
|
|
bbc8d83f37 | ||
|
|
9e0128f705 | ||
|
|
c90c94b39f | ||
|
|
9fc627aee5 | ||
|
|
edbc336888 | ||
|
|
70ed9547a7 | ||
|
|
70ae616b0d | ||
|
|
5801e69441 | ||
|
|
d77dccf068 | ||
|
|
c157da28f6 | ||
|
|
a09b61d39e | ||
|
|
ecfd1a015f | ||
|
|
046e438380 | ||
|
|
0fd9bdff5e | ||
|
|
01e93d672c | ||
|
|
cd417c2158 | ||
|
|
2a522859ad | ||
|
|
1e6803a7fd | ||
|
|
1cf142d5d7 | ||
|
|
f1c749650c | ||
|
|
4356a59467 | ||
|
|
d3374eaabf | ||
|
|
3ce9785fde | ||
|
|
4c6e954a04 | ||
|
|
84cffa91f2 | ||
|
|
59bfbd24b1 | ||
|
|
cf61ab2454 | ||
|
|
9cb8408105 | ||
|
|
82524891f5 | ||
|
|
3b43f42ac8 | ||
|
|
aa3fe0ae83 | ||
|
|
90adfed3f4 | ||
|
|
694cab8b52 | ||
|
|
28d7008b91 | ||
|
|
baad5ab1a1 | ||
|
|
f0a1351b3d | ||
|
|
ea3b09b621 | ||
|
|
0cc2b10c45 | ||
|
|
fc0d71bd72 | ||
|
|
76dd81e73b | ||
|
|
eb1e903fbb | ||
|
|
22f7acf0fb | ||
|
|
9ccd7a9006 | ||
|
|
731f460f7d | ||
|
|
2851362007 | ||
|
|
7fe84d4e7c | ||
|
|
a5729efca3 | ||
|
|
38aa953754 | ||
|
|
ad224416de | ||
|
|
c2e8ed3074 | ||
|
|
f4821c63f2 | ||
|
|
4c0f6ab31f | ||
|
|
bbe7d70bb1 | ||
|
|
112f2cb5c8 | ||
|
|
f6bdec81fe | ||
|
|
6e93c0772a | ||
|
|
eeb0bcc3c6 | ||
|
|
5132c845b0 | ||
|
|
ea32ed86c9 | ||
|
|
2488f81b45 | ||
|
|
c40b01e40e | ||
|
|
9a4d8e46ef | ||
|
|
c9c0b38de5 | ||
|
|
591c5baca0 | ||
|
|
c9c5bdd7bb | ||
|
|
8ab51d480c | ||
|
|
cae9cec74b | ||
|
|
16a51d7bf8 | ||
|
|
a338355f78 | ||
|
|
84cec97f57 | ||
|
|
79f0e02ec2 | ||
|
|
08dd57a3f9 | ||
|
|
e30a7913b7 | ||
|
|
4d337c3fa7 | ||
|
|
5895ef7a46 | ||
|
|
9e870cd2d1 | ||
|
|
f51b8ec8bb | ||
|
|
773556dd2d | ||
|
|
ae39e8614f | ||
|
|
4ffeb7d3db | ||
|
|
f58c06b028 | ||
|
|
d865f3520c | ||
|
|
3c19786ae3 | ||
|
|
25939ab572 | ||
|
|
a5fcf64a5f | ||
|
|
562f5e7f6a | ||
|
|
3106f14f92 | ||
|
|
436276a812 | ||
|
|
1a2be91e2a | ||
|
|
0b87224e39 | ||
|
|
eff6a6efc4 | ||
|
|
edd5287f84 | ||
|
|
71f159840b | ||
|
|
854041749b | ||
|
|
a4a77744d6 | ||
|
|
dac335f3dd | ||
|
|
275ba09a3b | ||
|
|
40ab7fc0f3 | ||
|
|
3b16380936 | ||
|
|
67e18e30a7 | ||
|
|
293e984d60 | ||
|
|
35bf641cb7 | ||
|
|
c86461fd22 | ||
|
|
498edeb86e | ||
|
|
e6c7719bf4 | ||
|
|
e907a052e5 | ||
|
|
6f089c21c5 | ||
|
|
3d8ad87da9 | ||
|
|
92a0ed3c6d | ||
|
|
988b86238f | ||
|
|
f2c019adc3 | ||
|
|
bda256f095 | ||
|
|
77e48b4849 | ||
|
|
0ea85483dc | ||
|
|
54a034da9a | ||
|
|
84d249db18 | ||
|
|
5a1b5233b8 | ||
|
|
3a88ee37ed | ||
|
|
67464a2ad4 | ||
|
|
e1775947ec | ||
|
|
f18771b309 | ||
|
|
1716850f80 | ||
|
|
9ff5945744 | ||
|
|
13d91d590b | ||
|
|
4611c36631 | ||
|
|
0d5eb222a9 | ||
|
|
3508e8d309 | ||
|
|
cafe8965c1 | ||
|
|
5604bced59 | ||
|
|
08e2943edb | ||
|
|
656623be9c | ||
|
|
3ccc1da630 | ||
|
|
01c12c8010 | ||
|
|
dbd2ee4f3c | ||
|
|
84a5ae3268 | ||
|
|
949d8446f1 | ||
|
|
f7e17e90a7 | ||
|
|
f0078cc8fc | ||
|
|
833164823d | ||
|
|
77deede2de | ||
|
|
085a0aa0d4 | ||
|
|
3edcb0a519 | ||
|
|
c6ba1645a1 | ||
|
|
e1d2dfcf9e | ||
|
|
dccaa30202 | ||
|
|
e205ab47a2 | ||
|
|
a2e351779d | ||
|
|
f85ca67666 | ||
|
|
e1261c0340 | ||
|
|
89e4dc4fd5 | ||
|
|
fa480451d1 | ||
|
|
a42cf30bdb | ||
|
|
225bc96739 | ||
|
|
e15beaa7f9 | ||
|
|
fcc1ea98c4 | ||
|
|
afb0e066b0 | ||
|
|
7b5548642a | ||
|
|
5f1898c503 | ||
|
|
7854fb293f | ||
|
|
1e04df322c | ||
|
|
fb12c1df6e | ||
|
|
c4fcafccc5 | ||
|
|
cfbc2ebb46 | ||
|
|
4a85d415e5 | ||
|
|
94c2fab5b0 | ||
|
|
d6b179d3b5 | ||
|
|
32f7fd2c11 | ||
|
|
5a858562cc | ||
|
|
eb800ebbbc | ||
|
|
f3bd46dab2 | ||
|
|
b11a8c02a0 | ||
|
|
7564ecb19f | ||
|
|
65fd9ef338 | ||
|
|
aab49a95db | ||
|
|
f0110fab45 | ||
|
|
3c053feb30 | ||
|
|
68fde7a8ce | ||
|
|
abf067f708 | ||
|
|
0151279a55 | ||
|
|
633c391b4d | ||
|
|
fee9ff59ef | ||
|
|
290da64ffe | ||
|
|
46479ac3a0 | ||
|
|
016e525f62 | ||
|
|
58cb8f4a36 | ||
|
|
240c74da4e | ||
|
|
897d3f8ad5 | ||
|
|
3916653149 | ||
|
|
0baf2f7bc9 | ||
|
|
ef83ecbc05 | ||
|
|
53834ee415 | ||
|
|
7dcc40de8a | ||
|
|
edfd3fdc85 | ||
|
|
39e9cddb5f | ||
|
|
450ea5c63e | ||
|
|
36668ce6a1 | ||
|
|
8cacc9b1a0 | ||
|
|
03dd93b79d | ||
|
|
ee79809edc | ||
|
|
257675bb93 | ||
|
|
d9a01620f6 | ||
|
|
3b15d779d6 | ||
|
|
19796f7538 | ||
|
|
e594563d00 | ||
|
|
15d394edbf | ||
|
|
b07476fc96 | ||
|
|
d3e4c5c30b | ||
|
|
839be403b1 | ||
|
|
5c2c0ab09f | ||
|
|
81f8a9e375 | ||
|
|
4386cab9bc | ||
|
|
00773de340 | ||
|
|
450bd1e213 | ||
|
|
2092c2705f | ||
|
|
e592c64d8f | ||
|
|
0f275acc12 | ||
|
|
af1da198b3 | ||
|
|
e75e4b5640 | ||
|
|
9ed49694bf | ||
|
|
b0088c67ba | ||
|
|
3505a530d0 | ||
|
|
ec87a1f3ad | ||
|
|
0c9c758dbd | ||
|
|
17a9178c8b | ||
|
|
7628e19f26 | ||
|
|
97b506ca15 | ||
|
|
7c1c973917 | ||
|
|
e7340e703b | ||
|
|
1fa5e2bf54 | ||
|
|
dc12e5dd1e | ||
|
|
2c62498b62 | ||
|
|
2eb193101a | ||
|
|
11d8d11b04 | ||
|
|
37b0bd28ce | ||
|
|
13cccac317 | ||
|
|
4fce3b9610 | ||
|
|
fc22d35695 | ||
|
|
091c8b4d7e | ||
|
|
8d4512a612 | ||
|
|
c80bab1fcc | ||
|
|
ca0683ecfa | ||
|
|
31cfd8011f | ||
|
|
371f2e3869 | ||
|
|
cd48667a38 | ||
|
|
45d02246ee | ||
|
|
25e339a4d6 | ||
|
|
155f0f1cce | ||
|
|
807ee34c9d | ||
|
|
123515a33d | ||
|
|
cc741f5029 | ||
|
|
0fc5f831fc | ||
|
|
ecf181a2c7 | ||
|
|
000257bd8e | ||
|
|
30cbbfedf3 | ||
|
|
47cd793262 | ||
|
|
ed6be03aa0 | ||
|
|
afd83a21fb | ||
|
|
4a030dfb73 | ||
|
|
e4b6bc70bc | ||
|
|
fcaa985c2d | ||
|
|
3574628259 | ||
|
|
be71b9f6b5 | ||
|
|
5f5fe2b8cc | ||
|
|
5ff5467673 | ||
|
|
809b0155df | ||
|
|
1e6670c1b7 | ||
|
|
bda9f63f59 | ||
|
|
ea966211b5 | ||
|
|
1771fd2d3b | ||
|
|
7dd22631a9 | ||
|
|
7146c9f90c | ||
|
|
63a90da345 | ||
|
|
29a0e77753 | ||
|
|
1760554305 | ||
|
|
3f391d36b2 | ||
|
|
fee9efe1db | ||
|
|
c8a2551a6e | ||
|
|
9e5a3781b7 | ||
|
|
fa960dc625 | ||
|
|
364767a0b4 | ||
|
|
abdd8a6a79 | ||
|
|
15be002888 | ||
|
|
af9f703302 | ||
|
|
944981b835 | ||
|
|
f7760d69c0 | ||
|
|
b63c14fcb7 | ||
|
|
7ec2608d58 | ||
|
|
881b31f7fa | ||
|
|
6be53b57e1 | ||
|
|
13338a1c76 | ||
|
|
f843302d16 | ||
|
|
f4fe757d5d | ||
|
|
1a410e1f09 | ||
|
|
79fff22d2e | ||
|
|
e6536f612a | ||
|
|
031c50768a | ||
|
|
a805b8e293 | ||
|
|
7145251058 | ||
|
|
5a5e364bee | ||
|
|
6351a06b68 | ||
|
|
4dd27db603 | ||
|
|
d01ed806b9 | ||
|
|
2b6c194af7 | ||
|
|
87409846f0 | ||
|
|
88dca1dbea | ||
|
|
4bf29edec3 | ||
|
|
d1abacf7ae | ||
|
|
9d6126086c | ||
|
|
4c74af0b4a | ||
|
|
fb738a9319 | ||
|
|
c470ecc598 | ||
|
|
47302dd5ad | ||
|
|
431b588cef | ||
|
|
0f931f0275 | ||
|
|
0a3a0c525f | ||
|
|
c818bd61d5 | ||
|
|
3e220d87f0 | ||
|
|
58691c0d15 | ||
|
|
a59a1bbaad | ||
|
|
1d84bd94ea | ||
|
|
e777b3806e | ||
|
|
74afd2522f | ||
|
|
da831bf833 | ||
|
|
d21190d765 | ||
|
|
ae2eefeb92 | ||
|
|
c0968ba348 | ||
|
|
d469a505c4 | ||
|
|
34244e313b | ||
|
|
d77c3feef5 | ||
|
|
0fa9b99445 | ||
|
|
433688cc92 | ||
|
|
790af7d332 | ||
|
|
4fb733df43 | ||
|
|
0794d14a7a | ||
|
|
324747af39 | ||
|
|
5377b50e53 | ||
|
|
b745b8e545 | ||
|
|
cfa65cfe5c | ||
|
|
7d52af37fa | ||
|
|
d8f9376d55 | ||
|
|
2c95fa52f8 | ||
|
|
993740e06f | ||
|
|
da67b2b53c | ||
|
|
7d08fec7cc | ||
|
|
6ec2c31678 | ||
|
|
e469a54429 | ||
|
|
2352055d98 | ||
|
|
7892625474 | ||
|
|
58a1497614 | ||
|
|
76d94278a8 | ||
|
|
47b2c3cd88 | ||
|
|
1f55e87876 | ||
|
|
cdd1a0b743 | ||
|
|
f864a28bb3 | ||
|
|
993a176572 | ||
|
|
414a344f33 | ||
|
|
28848dcbc8 | ||
|
|
ea32341410 | ||
|
|
ad53507f1c | ||
|
|
8f9e7cf941 | ||
|
|
1f1339cb01 | ||
|
|
e5eafea546 | ||
|
|
373d2c201c | ||
|
|
ec63b64b1f | ||
|
|
e6da9a6d68 | ||
|
|
4fac9708ec | ||
|
|
71d4bd62b2 | ||
|
|
3e96899ace | ||
|
|
51c590c6a6 | ||
|
|
e7d1452827 | ||
|
|
137e7a8cdd | ||
|
|
77f769b328 | ||
|
|
c85cb1377b | ||
|
|
f3362d6a2f | ||
|
|
043310f88a | ||
|
|
46f524706c | ||
|
|
7b7df3caba | ||
|
|
a47ff4d7a5 | ||
|
|
70fc3119e7 | ||
|
|
830be35c58 | ||
|
|
2fff39194f | ||
|
|
fffa377d2f | ||
|
|
a819e73388 | ||
|
|
0562965e69 | ||
|
|
7928823b96 | ||
|
|
3b92333b16 | ||
|
|
7238ae9025 | ||
|
|
f6634e882c | ||
|
|
f99a3916de | ||
|
|
cc9f972e80 | ||
|
|
609da60af3 | ||
|
|
7b794ea056 | ||
|
|
3f66617c68 | ||
|
|
f8f60965a9 | ||
|
|
6f0832c6d8 | ||
|
|
33c321d328 | ||
|
|
16fdb53870 | ||
|
|
b5ab80797d | ||
|
|
1385a9c6ac | ||
|
|
a11c390fd5 | ||
|
|
a498b79b2d | ||
|
|
6a22f2443e | ||
|
|
cd2597f3a2 | ||
|
|
d32a38c267 | ||
|
|
64bcc9942e | ||
|
|
cf750429cb | ||
|
|
32843f18f8 | ||
|
|
d7bd110ffe | ||
|
|
36176b8eb4 | ||
|
|
8c94fbd199 | ||
|
|
d9e1e01afc | ||
|
|
8edec19426 | ||
|
|
5419f3b5de | ||
|
|
6df0403964 | ||
|
|
2bef522bfc | ||
|
|
4e86a928b3 | ||
|
|
254b4f6603 | ||
|
|
7373203236 | ||
|
|
55a4c34bab | ||
|
|
b060ac5928 | ||
|
|
ab27958761 | ||
|
|
dca1600f46 | ||
|
|
218ac8a0d7 | ||
|
|
cac96f1a44 | ||
|
|
55948f0db1 | ||
|
|
c80033de55 | ||
|
|
dd378506ee | ||
|
|
9e890d8df5 | ||
|
|
f4030700dc | ||
|
|
b7f924ea6b | ||
|
|
c5c4fd08e9 | ||
|
|
bf7871905e | ||
|
|
28ef47c26f | ||
|
|
7a6e12df06 | ||
|
|
97130623dc | ||
|
|
a1ad295557 | ||
|
|
ecc552eda8 | ||
|
|
56d7afd8a0 | ||
|
|
46e465b1d2 | ||
|
|
4c52cb0441 | ||
|
|
4da09ccefc | ||
|
|
389921bd48 | ||
|
|
e9f6827211 | ||
|
|
042d935a80 | ||
|
|
1f7fee5baa | ||
|
|
ff33077291 | ||
|
|
70c909302c | ||
|
|
900f57bc94 | ||
|
|
41fabe25bd | ||
|
|
1e634da6dd | ||
|
|
a4386862f5 | ||
|
|
7435ddd89b | ||
|
|
f1e5508023 | ||
|
|
0fd8e46ea2 | ||
|
|
cb4764e8d0 | ||
|
|
0c55ff682b | ||
|
|
8659222b82 | ||
|
|
64b2332534 | ||
|
|
303278228a | ||
|
|
16baec8877 | ||
|
|
0b7cc9aa9d | ||
|
|
77bc1ed93b | ||
|
|
d2969046d4 | ||
|
|
b3c67343e5 | ||
|
|
f26624902f | ||
|
|
f96196c271 | ||
|
|
f47b3c0fd0 | ||
|
|
170ac43ebe | ||
|
|
93e0b43b03 | ||
|
|
b9c9069c5a | ||
|
|
fdc9b42d14 | ||
|
|
6cb690996d | ||
|
|
eb63396934 | ||
|
|
f1aa394d29 | ||
|
|
415969fca0 | ||
|
|
dfbd9ad9d0 | ||
|
|
a50424930b | ||
|
|
9843ff7b49 | ||
|
|
7ea79b3ed4 | ||
|
|
b783b7e364 | ||
|
|
60d0011159 | ||
|
|
e730044cc1 | ||
|
|
60ea566ecc | ||
|
|
fd797419dd | ||
|
|
3a5a785f51 | ||
|
|
65564198ef | ||
|
|
def0b0ceb0 | ||
|
|
01776721ab | ||
|
|
6f7d012184 | ||
|
|
7d4d468e58 | ||
|
|
d1a870b372 | ||
|
|
680e55e493 | ||
|
|
c779bae39a | ||
|
|
5a4fafec31 | ||
|
|
cfcc94c2bb | ||
|
|
8d1c8fad7c | ||
|
|
c6cc437092 | ||
|
|
6a30e96439 | ||
|
|
95d7869aa6 | ||
|
|
95a26b87ce | ||
|
|
6c0bfdd0b7 | ||
|
|
0e19a3a614 | ||
|
|
35350315b7 | ||
|
|
8f97380d75 | ||
|
|
fe6bac98c7 | ||
|
|
77c5502b19 | ||
|
|
065eb6f1d5 | ||
|
|
103e4b2b22 | ||
|
|
cb4e5b551f | ||
|
|
c22d9a7e99 | ||
|
|
2b52cf3896 | ||
|
|
5b16bd3748 | ||
|
|
40bbe0cd39 | ||
|
|
661dc39d9c | ||
|
|
07c240e9a1 | ||
|
|
93f20cb8e4 | ||
|
|
e512f60386 | ||
|
|
59442ea786 | ||
|
|
ee8a7f67a7 | ||
|
|
c2c24787da | ||
|
|
60f69cb79b | ||
|
|
3bc70fc2c2 | ||
|
|
f09a3c0a09 | ||
|
|
f15a879898 | ||
|
|
984f3f0aa7 | ||
|
|
1559d18757 | ||
|
|
c2c0ca0eeb | ||
|
|
754c35f2f5 | ||
|
|
2bbd5a806b | ||
|
|
5891192fda | ||
|
|
5effb36530 | ||
|
|
bc72cea911 | ||
|
|
ec8886cf09 | ||
|
|
bce0cc4ca0 | ||
|
|
66eaf28ac8 | ||
|
|
d728b3d745 | ||
|
|
11426ed5a2 | ||
|
|
386abb7000 | ||
|
|
476fb7bbfc | ||
|
|
c825720ae0 | ||
|
|
6e407fff7b | ||
|
|
11b24d23aa | ||
|
|
2135e20299 | ||
|
|
123277167b | ||
|
|
4a9f85674f | ||
|
|
719579177e | ||
|
|
3f6a1f33d4 | ||
|
|
688dee73c2 | ||
|
|
5fa10d82f4 | ||
|
|
4cde77929f | ||
|
|
41f66ee2f3 | ||
|
|
2ee9db9479 | ||
|
|
f87883712e | ||
|
|
ea22ebfe09 | ||
|
|
0edd905be5 | ||
|
|
47e2ff7500 | ||
|
|
c011621363 | ||
|
|
8c47d95901 | ||
|
|
e08be40462 | ||
|
|
d7022ad67b | ||
|
|
38f435eba8 | ||
|
|
6f429c16ee | ||
|
|
dfaebd0908 | ||
|
|
d6abb06544 | ||
|
|
d950369202 | ||
|
|
745fc385e9 | ||
|
|
f02a1caced | ||
|
|
e547962d31 | ||
|
|
31fe8e2a4c | ||
|
|
1b1dc86fb6 | ||
|
|
7539390fc3 | ||
|
|
ad7b508184 | ||
|
|
0fa37a5b62 | ||
|
|
1cbfc73384 | ||
|
|
c58ae29dd5 | ||
|
|
96e442b564 | ||
|
|
e817f867af | ||
|
|
8c8c96bb89 | ||
|
|
f0e7af10bb | ||
|
|
4e44bcfdef | ||
|
|
d4cea3a9ff | ||
|
|
f06b7dfd20 | ||
|
|
6dd4f692e2 | ||
|
|
d860dc0011 | ||
|
|
d5d8e66dee | ||
|
|
ad4843b8ea | ||
|
|
3162ede091 | ||
|
|
f9e3871b3e | ||
|
|
53abc32182 | ||
|
|
39267bcb05 | ||
|
|
7398df34ec | ||
|
|
62c8792c2a | ||
|
|
e561a547a7 | ||
|
|
5128907c07 | ||
|
|
5ddef96ccc | ||
|
|
e75251141a | ||
|
|
4f419025fe | ||
|
|
c6cf69e4a3 | ||
|
|
10e444df95 | ||
|
|
eeab39d62d | ||
|
|
28e46d411b | ||
|
|
1195eb3ada | ||
|
|
5f779fae4c | ||
|
|
cdb274654e | ||
|
|
b486c02ac8 | ||
|
|
9bcb08776c | ||
|
|
d36c788e00 | ||
|
|
00bbac6ae1 | ||
|
|
40db1ce831 | ||
|
|
bbf18d5667 | ||
|
|
377f78db0f | ||
|
|
ad96da3537 | ||
|
|
db8cf9134f | ||
|
|
0d65873a0b | ||
|
|
c38ff6302d | ||
|
|
abc9a3ddb1 | ||
|
|
650c4dea46 | ||
|
|
a2d1cf8f37 | ||
|
|
23c449af6c | ||
|
|
2d548f46bf | ||
|
|
c3c4ce064c | ||
|
|
fb7a0d5257 | ||
|
|
f8351a9818 | ||
|
|
5aefddd246 | ||
|
|
facefe5872 | ||
|
|
ef794efbb3 |
No files matched your search
@@ -1,15 +0,0 @@
|
||||
# The "checkoutlist" file is used to support additional version controlled
|
||||
# administrative files in $CVSROOT/CVSROOT, such as template files.
|
||||
#
|
||||
# The first entry on a line is a filename which will be checked out from
|
||||
# the corresponding RCS file in the $CVSROOT/CVSROOT directory.
|
||||
# The remainder of the line is an error message to use if the file cannot
|
||||
# be checked out.
|
||||
#
|
||||
# File format:
|
||||
#
|
||||
# [<whitespace>]<filename><whitespace><error message><end-of-line>
|
||||
#
|
||||
# comment lines begin with '#'
|
||||
new_commit_prep Error checking out/updating CVSROOT/new_commit_prep
|
||||
new_log_accum Error checking out/updating CVSROOT/new_log_accum
|
||||
@@ -1,17 +0,0 @@
|
||||
# The "commitinfo" file is used to control pre-commit checks.
|
||||
# The filter on the right is invoked with the repository and a list
|
||||
# of files to check. A non-zero exit of the filter program will
|
||||
# cause the commit to be aborted.
|
||||
#
|
||||
# The first entry on a line is a regular expression which is tested
|
||||
# against the directory that the change is being committed to, relative
|
||||
# to the $CVSROOT. For the first match that is found, then the remainder
|
||||
# of the line is the name of the filter to run.
|
||||
#
|
||||
# If the repository name does not match any of the regular expressions in this
|
||||
# file, the "DEFAULT" line is used, if it is specified.
|
||||
#
|
||||
# If the name "ALL" appears as a regular expression it is always used
|
||||
# in addition to the first matching regex or "DEFAULT".
|
||||
DEFAULT $CVSROOT/CVSROOT/new_commit_prep
|
||||
CVSROOT $CVSROOT/CVSROOT/new_commit_prep
|
||||
@@ -1,14 +0,0 @@
|
||||
# Set this to "no" if pserver shouldn't check system users/passwords
|
||||
#SystemAuth=no
|
||||
|
||||
# Put CVS lock files in this directory rather than directly in the repository.
|
||||
#LockDir=/var/lock/cvs
|
||||
|
||||
# Set `TopLevelAdmin' to `yes' to create a CVS directory at the top
|
||||
# level of the new working directory when using the `cvs checkout'
|
||||
# command.
|
||||
#TopLevelAdmin=no
|
||||
|
||||
# Set `LogHistory' to `all' or `TOFEWGCMAR' to log all transactions to the
|
||||
# history file, or a subset as needed (ie `TMAR' logs all write operations)
|
||||
#LogHistory=TOFEWGCMAR
|
||||
@@ -1,23 +0,0 @@
|
||||
# This file affects handling of files based on their names.
|
||||
#
|
||||
# The -t/-f options allow one to treat directories of files
|
||||
# as a single file, or to transform a file in other ways on
|
||||
# its way in and out of CVS.
|
||||
#
|
||||
# The -m option specifies whether CVS attempts to merge files.
|
||||
#
|
||||
# The -k option specifies keyword expansion (e.g. -kb for binary).
|
||||
#
|
||||
# Format of wrapper file ($CVSROOT/CVSROOT/cvswrappers or .cvswrappers)
|
||||
#
|
||||
# wildcard [option value][option value]...
|
||||
#
|
||||
# where option is one of
|
||||
# -f from cvs filter value: path to filter
|
||||
# -t to cvs filter value: path to filter
|
||||
# -m update methodology value: MERGE or COPY
|
||||
# -k expansion mode value: b, o, kkv, &c
|
||||
#
|
||||
# and value is a single-quote delimited value.
|
||||
# For example:
|
||||
#*.gif -k 'b'
|
||||
@@ -1,21 +0,0 @@
|
||||
# The "editinfo" file is used to allow verification of logging
|
||||
# information. It works best when a template (as specified in the
|
||||
# rcsinfo file) is provided for the logging procedure. Given a
|
||||
# template with locations for, a bug-id number, a list of people who
|
||||
# reviewed the code before it can be checked in, and an external
|
||||
# process to catalog the differences that were code reviewed, the
|
||||
# following test can be applied to the code:
|
||||
#
|
||||
# Making sure that the entered bug-id number is correct.
|
||||
# Validating that the code that was reviewed is indeed the code being
|
||||
# checked in (using the bug-id number or a seperate review
|
||||
# number to identify this particular code set.).
|
||||
#
|
||||
# If any of the above test failed, then the commit would be aborted.
|
||||
#
|
||||
# Actions such as mailing a copy of the report to each reviewer are
|
||||
# better handled by an entry in the loginfo file.
|
||||
#
|
||||
# One thing that should be noted is the the ALL keyword is not
|
||||
# supported. There can be only one entry that matches a given
|
||||
# repository.
|
||||
@@ -1,30 +0,0 @@
|
||||
# The "loginfo" file controls where "cvs commit" log information
|
||||
# is sent. The first entry on a line is a regular expression which must match
|
||||
# the directory that the change is being made to, relative to the
|
||||
# $CVSROOT. If a match is found, then the remainder of the line is a filter
|
||||
# program that should expect log information on its standard input.
|
||||
#
|
||||
# If the repository name does not match any of the regular expressions in this
|
||||
# file, the "DEFAULT" line is used, if it is specified.
|
||||
#
|
||||
# If the name ALL appears as a regular expression it is always used
|
||||
# in addition to the first matching regex or DEFAULT.
|
||||
#
|
||||
# You may specify a format string as part of the
|
||||
# filter. The string is composed of a `%' followed
|
||||
# by a single format character, or followed by a set of format
|
||||
# characters surrounded by `{' and `}' as separators. The format
|
||||
# characters are:
|
||||
#
|
||||
# s = file name
|
||||
# V = old version number (pre-checkin)
|
||||
# v = new version number (post-checkin)
|
||||
#
|
||||
# For example:
|
||||
#DEFAULT (echo ""; id; echo %s; date; cat) >> $CVSROOT/CVSROOT/commitlog
|
||||
# or
|
||||
#DEFAULT (echo ""; id; echo %{sVv}; date; cat) >> $CVSROOT/CVSROOT/commitlog
|
||||
|
||||
DEFAULT $CVSROOT/CVSROOT/new_log_accum -m [email protected] %{sVv}
|
||||
CVSROOT $CVSROOT/CVSROOT/new_log_accum -m [email protected] %{sVv}
|
||||
|
||||
@@ -1,26 +0,0 @@
|
||||
# Three different line formats are valid:
|
||||
# key -a aliases...
|
||||
# key [options] directory
|
||||
# key [options] directory files...
|
||||
#
|
||||
# Where "options" are composed of:
|
||||
# -i prog Run "prog" on "cvs commit" from top-level of module.
|
||||
# -o prog Run "prog" on "cvs checkout" of module.
|
||||
# -e prog Run "prog" on "cvs export" of module.
|
||||
# -t prog Run "prog" on "cvs rtag" of module.
|
||||
# -u prog Run "prog" on "cvs update" of module.
|
||||
# -d dir Place module in directory "dir" instead of module name.
|
||||
# -l Top-level directory only -- do not recurse.
|
||||
#
|
||||
# NOTE: If you change any of the "Run" options above, you'll have to
|
||||
# release and re-checkout any working directories of these modules.
|
||||
#
|
||||
# And "directory" is a path to a directory relative to $CVSROOT.
|
||||
#
|
||||
# The "-a" option specifies an alias. An alias is interpreted as if
|
||||
# everything on the right of the "-a" had been typed on the command line.
|
||||
#
|
||||
# You can encode a module within a module by using the special '&'
|
||||
# character to interpose another module into the current module. This
|
||||
# can be useful for creating a module that consists of many directories
|
||||
# spread out over the entire source repository.
|
||||
@@ -1,104 +0,0 @@
|
||||
#!/usr/bin/perl -w
|
||||
#
|
||||
# Copyright (C) 2000 by Kevin L. Mitchell <[email protected]>
|
||||
#
|
||||
# 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, or (at your option)
|
||||
# any later version.
|
||||
#
|
||||
# This program is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
# GNU General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with this program; if not, write to the Free Software
|
||||
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
|
||||
# 02111-1307, USA.
|
||||
#
|
||||
# Script to store the last visited directory for newlogaccum.pl.
|
||||
#
|
||||
# $Id: new_commit_prep,v 1.1 2002-08-11 23:05:15 drevil Exp $
|
||||
|
||||
use strict;
|
||||
|
||||
# This routine removes everything in a directory
|
||||
sub clear_dir {
|
||||
my ($dir) = @_;
|
||||
my ($file);
|
||||
|
||||
opendir(DIR, $dir) || die "Cannot clear directory $dir: $!";
|
||||
while ($file = readdir(DIR)) {
|
||||
next
|
||||
if ($file eq "." || $file eq "..");
|
||||
|
||||
$file = "$dir/$file";
|
||||
|
||||
if (-d $file) {
|
||||
# It's a directory, recurse into it, then delete it.
|
||||
clear_dir($file);
|
||||
rmdir($file);
|
||||
} else {
|
||||
# It's a file, delete it.
|
||||
unlink($file);
|
||||
}
|
||||
}
|
||||
closedir(DIR);
|
||||
}
|
||||
|
||||
# This routine prepares a temporary directory, hopefully in a secure
|
||||
# fashion; it uses the process group to make secondary programs be able
|
||||
# to find it.
|
||||
sub tmpdir (;$) {
|
||||
my ($clear) = @_;
|
||||
my ($pgrp, $own, $mode, $tmpdir);
|
||||
|
||||
$pgrp = getpgrp();
|
||||
|
||||
die "Don't run $0 setuid!"
|
||||
unless ($< == $>);
|
||||
|
||||
# Decide on the directory name, using various environment variables
|
||||
$tmpdir = ($ENV{TMPDIR} || $ENV{TMP} || $ENV{TEMP} || "/tmp") .
|
||||
"/.#cvs.$pgrp";
|
||||
|
||||
# Doesn't exist, but we can't create it...
|
||||
die "Can't create temporary directory $tmpdir: $!"
|
||||
unless (-e $tmpdir || mkdir($tmpdir, 0700));
|
||||
|
||||
die "Temporary directory $tmpdir is not a directory"
|
||||
unless (-d $tmpdir);
|
||||
|
||||
# Check ownership and permissions
|
||||
(undef, undef, $mode, undef, $own, undef) = stat($tmpdir);
|
||||
|
||||
die "Temporary directory $tmpdir not owned by $< (owned by $own)"
|
||||
unless ($own == $<);
|
||||
|
||||
die "Temporary directory $tmpdir group-writable"
|
||||
if ($mode & 0020);
|
||||
die "Temporary directory $tmpdir other-writable"
|
||||
if ($mode & 0002);
|
||||
|
||||
# If we're supposed to clear the directory, do so...
|
||||
clear_dir($tmpdir)
|
||||
if ($clear);
|
||||
|
||||
return $tmpdir;
|
||||
}
|
||||
|
||||
# This routine writes a single line to a file
|
||||
sub write_line ($$) {
|
||||
my ($fname, $line) = @_;
|
||||
|
||||
open(FILE, ">$fname") || die "Cannot open file $fname for writing";
|
||||
print FILE "$line\n";
|
||||
close(FILE);
|
||||
}
|
||||
|
||||
# Create and empty the temporary directory
|
||||
my ($tmpdir) = (tmpdir(1));
|
||||
|
||||
# Store the directory name
|
||||
write_line("$tmpdir/lastdir", shift(@ARGV));
|
||||
@@ -1,757 +0,0 @@
|
||||
#!/usr/bin/perl -w
|
||||
#
|
||||
# Copyright (C) 2000 by Kevin L. Mitchell <[email protected]>
|
||||
#
|
||||
# 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, or (at your option)
|
||||
# any later version.
|
||||
#
|
||||
# This program is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
# GNU General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with this program; if not, write to the Free Software
|
||||
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
|
||||
# 02111-1307, USA.
|
||||
#
|
||||
# Script to accumulate log messages for an entire tree and send them along
|
||||
# with the diffs; deals correctly with all manner of branching (I hope)
|
||||
#
|
||||
# $Id: new_log_accum,v 1.1 2002-08-11 23:05:15 drevil Exp $
|
||||
#
|
||||
|
||||
use strict;
|
||||
|
||||
use vars qw($MAILER $CVS $debug $boundary);
|
||||
use MD5;
|
||||
|
||||
# Set this to the full path of a mailer that takes a list
|
||||
# of email addresses as arguments...
|
||||
$MAILER = "/usr/sbin/sendmail -oi -oeq";
|
||||
|
||||
# Set this to the path of the CVS binary responsible for this tree...
|
||||
$CVS = "/usr/bin/cvs";
|
||||
|
||||
# Don't touch this; use the -d command line option
|
||||
$debug = 0;
|
||||
|
||||
# This is initialized by build_mailheader()
|
||||
$boundary = '';
|
||||
|
||||
use POSIX qw(setsid);
|
||||
|
||||
# We have to dissociate from our parent, so that the CVS commit can
|
||||
# complete, before we try to extract the diffs
|
||||
sub daemonize {
|
||||
defined(my $pid = fork()) || die "Can't fork: $!";
|
||||
exit(0)
|
||||
if $pid;
|
||||
setsid() || die "Can't start a new session: $!";
|
||||
}
|
||||
|
||||
# Debugging output
|
||||
sub debug (@) {
|
||||
print STDERR @_
|
||||
if ($debug);
|
||||
}
|
||||
|
||||
# Constants used in the FSM below for parsing the log message
|
||||
sub STATE_NONE { 0 }
|
||||
sub STATE_MODIFIED { 1 }
|
||||
sub STATE_ADDED { 2 }
|
||||
sub STATE_REMOVED { 3 }
|
||||
sub STATE_LOG1 { 4 }
|
||||
sub STATE_LOG2 { 5 }
|
||||
|
||||
# This routine removes everything in a directory
|
||||
sub clear_dir {
|
||||
my ($dir) = @_;
|
||||
my ($file);
|
||||
|
||||
opendir(DIR, $dir) || die "Cannot clear directory $dir: $!";
|
||||
while ($file = readdir(DIR)) {
|
||||
next
|
||||
if ($file eq "." || $file eq "..");
|
||||
|
||||
$file = "$dir/$file";
|
||||
|
||||
if (-d $file) {
|
||||
# It's a directory, recurse into it, then delete it.
|
||||
clear_dir($file);
|
||||
rmdir($file);
|
||||
} else {
|
||||
# It's a file, delete it.
|
||||
unlink($file);
|
||||
}
|
||||
}
|
||||
closedir(DIR);
|
||||
}
|
||||
|
||||
# This routine prepares a temporary directory, hopefully in a secure
|
||||
# fashion; it uses the process group to make secondary programs be able
|
||||
# to find it.
|
||||
sub tmpdir (;$) {
|
||||
my ($clear) = @_;
|
||||
my ($pgrp, $own, $mode, $tmpdir);
|
||||
|
||||
$pgrp = getpgrp();
|
||||
|
||||
die "Don't run $0 setuid!"
|
||||
unless ($< == $>);
|
||||
|
||||
# Decide on the directory name, using various environment variables
|
||||
$tmpdir = ($ENV{TMPDIR} || $ENV{TMP} || $ENV{TEMP} || "/tmp") .
|
||||
"/.#cvs.$pgrp";
|
||||
|
||||
# Doesn't exist, but we can't create it...
|
||||
die "Can't create temporary directory $tmpdir: $!"
|
||||
unless (-e $tmpdir || mkdir($tmpdir, 0700));
|
||||
|
||||
die "Temporary directory $tmpdir is not a directory"
|
||||
unless (-d $tmpdir);
|
||||
|
||||
# Check ownership and permissions
|
||||
(undef, undef, $mode, undef, $own, undef) = stat($tmpdir);
|
||||
|
||||
die "Temporary directory $tmpdir not owned by $< (owned by $own)"
|
||||
unless ($own == $<);
|
||||
|
||||
die "Temporary directory $tmpdir group-writable"
|
||||
if ($mode & 0020);
|
||||
die "Temporary directory $tmpdir other-writable"
|
||||
if ($mode & 0002);
|
||||
|
||||
# If we're supposed to clear the directory, do so...
|
||||
clear_dir($tmpdir)
|
||||
if ($clear);
|
||||
|
||||
return $tmpdir;
|
||||
}
|
||||
|
||||
# Routine to remove the temporary directory when done
|
||||
sub cleanup_dir ($) {
|
||||
# If we're debugging, we may want to look at the contents...
|
||||
return
|
||||
if ($debug);
|
||||
|
||||
clear_dir($_[0]);
|
||||
rmdir($_[0]);
|
||||
}
|
||||
|
||||
# Retrieve a single line from a specified file
|
||||
sub get_line ($) {
|
||||
my ($fname) = @_;
|
||||
|
||||
open(FILE, "<$fname") || die "Cannot open file $fname for reading";
|
||||
my $line = <FILE>;
|
||||
close(FILE);
|
||||
|
||||
# Chomp off the \n
|
||||
chomp $line;
|
||||
|
||||
return $line;
|
||||
}
|
||||
|
||||
# Routine that only allows one value to be pushed on the array;
|
||||
# implemented by making the first element of the array a hash-reference.
|
||||
# When we add a new value, we also increment the count of an element in
|
||||
# the hash with the key being the array value...
|
||||
sub push_once (\@@) {
|
||||
my ($array, @values) = @_;
|
||||
|
||||
# If the array is empty, create our hash ref
|
||||
push @{$array}, {}
|
||||
if (@{$array} == 0);
|
||||
|
||||
foreach my $value (@values) {
|
||||
push @{$array}, $value
|
||||
if (!exists($array->[0]{$value}));
|
||||
|
||||
$array->[0]{$value}++;
|
||||
}
|
||||
|
||||
return @{$array} - 1;
|
||||
}
|
||||
|
||||
# Filter //, /./, and remove leading ./ or / from filenames
|
||||
sub fname_filter ($) {
|
||||
my ($fname) = @_;
|
||||
|
||||
$fname =~ s,//,/,g;
|
||||
$fname =~ s,/\./,/,g;
|
||||
$fname =~ s,^\.?/,,g;
|
||||
|
||||
return $fname;
|
||||
}
|
||||
|
||||
# Store file data in a temporary file
|
||||
sub names_to_file ($$@) {
|
||||
my ($fname, $dir, @names) = @_;
|
||||
|
||||
if (@names > 0) {
|
||||
open(FILE, ">>$fname") || die "Cannot open file $fname for appending";
|
||||
|
||||
# Store the directory data
|
||||
print FILE "D $dir\n";
|
||||
|
||||
foreach my $name (@names) {
|
||||
# Mark record as a file...
|
||||
print FILE "F ";
|
||||
|
||||
# Store the tag, if there is one...
|
||||
print FILE "$name->{tag}"
|
||||
if (defined($name->{tag}));
|
||||
|
||||
# Then store old revision, new revision, and file name
|
||||
print FILE ":$name->{old}:$name->{new}:$name->{file}\n";
|
||||
}
|
||||
|
||||
close(FILE);
|
||||
}
|
||||
}
|
||||
|
||||
# Retrieve file data from temporary file; updates branch tags with what it
|
||||
# reads
|
||||
sub file_to_names (\@$) {
|
||||
my ($btags, $fname) = @_;
|
||||
my ($dir) = (undef);
|
||||
my (@names) = ();
|
||||
|
||||
debug "Reading file names from $fname...\n";
|
||||
|
||||
# We may not have, say, added a file in this subdirectory...
|
||||
return ()
|
||||
if (!-e $fname);
|
||||
|
||||
open(FILE, "<$fname");
|
||||
while(<FILE>) {
|
||||
chomp;
|
||||
|
||||
# Get record type...
|
||||
my ($type, $data) = split(' ', $_, 2);
|
||||
|
||||
# ok, it's a directory, remember that...
|
||||
if ($type eq "D") {
|
||||
$dir = $data;
|
||||
|
||||
debug "Read directory $dir\n";
|
||||
|
||||
next;
|
||||
}
|
||||
|
||||
debug "Read file $data\n";
|
||||
|
||||
# Get all the information about the file
|
||||
my ($tag, $old, $new, $file) = split(':', $data);
|
||||
|
||||
# and store it all
|
||||
push(@names, { tag => $tag, old => $old, new => $new, file => $file,
|
||||
dir => $dir, name => fname_filter("$dir/$file") });
|
||||
|
||||
# Remember the tags...
|
||||
push_once(@{$btags}, $tag)
|
||||
if (defined($tag) && $tag ne "");
|
||||
}
|
||||
close(FILE);
|
||||
|
||||
return @names;
|
||||
}
|
||||
|
||||
# Create a text-formatted list of names
|
||||
sub name_to_list (\@@) {
|
||||
my ($btags, @names) = @_;
|
||||
my (@nlist, @nline) = ();
|
||||
|
||||
debug "Tags:", join(':', @{$btags}), "\n";
|
||||
|
||||
# We group them by tag
|
||||
foreach my $tag ("", @{$btags}[1..$#{$btags}]) {
|
||||
debug "Processing tag $tag...\n";
|
||||
|
||||
@nlist = ();
|
||||
|
||||
# Get a list of files by the tag...
|
||||
foreach my $name (@names) {
|
||||
debug "Processing $name->{file}...\n";
|
||||
|
||||
next
|
||||
if ($name->{tag} ne $tag);
|
||||
|
||||
debug "Pushing $name->{name} on \@nlist...\n";
|
||||
push(@nlist, $name->{name});
|
||||
}
|
||||
|
||||
# If the tag is not the empty string, list the tag...
|
||||
push(@nline, " Tag: $tag", " ")
|
||||
if ($tag ne "");
|
||||
|
||||
# Now list each file name
|
||||
foreach my $name (@nlist) {
|
||||
# indent if we run past the end of line limit
|
||||
push(@nline, " ")
|
||||
if (@nline == 0 || ($nline[$#nline] ne " " &&
|
||||
length($nline[$#nline]) + length($name) + 1 > 70));
|
||||
|
||||
# add the file name to the list
|
||||
debug "Adding $name to \@nline...\n";
|
||||
$nline[$#nline] .= " $name";
|
||||
}
|
||||
}
|
||||
|
||||
return @nline;
|
||||
}
|
||||
|
||||
# write the log message to a temporary file
|
||||
sub write_log ($@) {
|
||||
my ($fname, @text) = @_;
|
||||
|
||||
open(FILE, ">$fname") || die "Cannot open file $fname for writing";
|
||||
print FILE join("\n", @text), "\n";
|
||||
close(FILE);
|
||||
}
|
||||
|
||||
# Build the header of the commit message: CVSROOT, module name, any
|
||||
# branch tags, and the commit time
|
||||
sub build_header ($@) {
|
||||
my ($module, $subject, $mailto, @branch_tags) = @_;
|
||||
my (@text, @mailto);
|
||||
my ($sec,$min,$hour,$mday,$mon,$year,$wday,$yday,$isdst) = gmtime(time());
|
||||
my ($user, $dummy);
|
||||
my ($digest);
|
||||
|
||||
($user, $dummy, $dummy, $dummy, $dummy, $dummy, $dummy) = getpwuid($<);
|
||||
|
||||
@mailto = @{$mailto};
|
||||
|
||||
# generate a unique boundary by calculating the md5sum of the
|
||||
# current time
|
||||
$digest = new MD5;
|
||||
$digest->reset();
|
||||
$digest->add(time() . rand());
|
||||
$boundary = "----=MIME." . unpack("H*", $digest->digest());
|
||||
|
||||
# Build the mail header
|
||||
push(@text, "From: $user");
|
||||
push(@text, "To: " . join(' ', @mailto));
|
||||
push(@text, "Subject: $subject");
|
||||
push(@text, "MIME-Version: 1.0");
|
||||
push(@text, "Content-Type: multipart/mixed; boundary=\"$boundary\"");
|
||||
push(@text, "");
|
||||
push(@text, "This is a multipart message as defined by RFC2049 (MIME)");
|
||||
push(@text, "");
|
||||
push(@text, "--$boundary");
|
||||
push(@text, "Content-Type: text/plain; charset=us-ascii");
|
||||
push(@text, "Content-Disposition: inline");
|
||||
push(@text, "");
|
||||
|
||||
# Build the commit message header
|
||||
push(@text, "Commiter : $user");
|
||||
push(@text, "CVSROOT : $ENV{CVSROOT}");
|
||||
push(@text, "Module : $module");
|
||||
push(@text, "Branch tags: " . join(' ', @branch_tags[1..$#branch_tags]))
|
||||
if (@branch_tags > 0);
|
||||
push(@text, sprintf("Commit time: %04d-%02d-%02d %02d:%02d:%02d UTC",
|
||||
$year + 1900, $mon + 1, $mday, $hour, $min, $sec));
|
||||
|
||||
return @text, "";
|
||||
}
|
||||
|
||||
# Send the mail message
|
||||
sub send_mail {
|
||||
my ($mailto, $text) = @_;
|
||||
my (@mailto, @text);
|
||||
# I <heart> perl
|
||||
@mailto = @{$mailto};
|
||||
@text = @{$text};
|
||||
|
||||
open(MAIL, "|$MAILER " . join(' ', @mailto));
|
||||
push(@text, "--$boundary--", "");
|
||||
print MAIL join("\n", @text), "\n";
|
||||
close(MAIL);
|
||||
}
|
||||
|
||||
# Find the tmp directory
|
||||
my ($tmpdir) = (tmpdir());
|
||||
|
||||
my (@mailto) = ();
|
||||
my (@files) = ();
|
||||
my (@path) = ();
|
||||
my ($modname, $repdir, $dir) = (undef, undef, undef);
|
||||
|
||||
# Process command line arguments
|
||||
while (@ARGV > 0) {
|
||||
my ($arg) = (shift(@ARGV));
|
||||
|
||||
if ($arg eq '-d') {
|
||||
# Turn on debugging
|
||||
$debug++;
|
||||
} elsif ($arg eq '-M') {
|
||||
# Module name explicitly set -- XXX Not tested, use at your own risk
|
||||
die "Argument for -M missing"
|
||||
unless (@ARGV > 0);
|
||||
|
||||
$modname = shift(@ARGV);
|
||||
} elsif ($arg eq '-m') {
|
||||
# An address to mail the notification to
|
||||
die "Argument for -m missing"
|
||||
unless (@ARGV > 0);
|
||||
|
||||
push(@mailto, shift(@ARGV));
|
||||
} else {
|
||||
# the list of filenames passed by CVS--you *must* use %{sVv}!
|
||||
die "Too many arguments!"
|
||||
unless (@files == 0);
|
||||
|
||||
@files = split(" ", $arg);
|
||||
}
|
||||
}
|
||||
|
||||
die "Nobody to mail to"
|
||||
unless (@mailto > 0);
|
||||
|
||||
die "No files to process"
|
||||
unless (@files > 1);
|
||||
|
||||
# The repository directory
|
||||
$repdir = shift(@files);
|
||||
|
||||
# break it appart...
|
||||
@path = split("/", $repdir);
|
||||
|
||||
# Now we know the module name, if it wasn't explicitly set
|
||||
$modname = $path[0]
|
||||
unless (defined($modname));
|
||||
|
||||
# Figure out what our directory is
|
||||
if (@path == 1) {
|
||||
$dir = ".";
|
||||
} else {
|
||||
$dir = join("/", @path[1..$#path]);
|
||||
}
|
||||
|
||||
# append a / to it...
|
||||
$dir .= "/";
|
||||
|
||||
debug "module = $modname\n";
|
||||
debug "dir = $dir\n";
|
||||
debug "path = ", join(":", @path), "\n";
|
||||
debug "files = ", join(":", @files), "\n";
|
||||
debug "tmpdir = $tmpdir\n";
|
||||
|
||||
my (%fversions);
|
||||
|
||||
# Unless its a new directory or imported sources, create file records
|
||||
unless (defined($files[1]) && defined($files[2]) &&
|
||||
(($files[1] eq "New" && $files[2] eq "directory") ||
|
||||
($files[1] eq "Imported" && $files[2] eq "sources"))) {
|
||||
|
||||
foreach my $fname (@files) {
|
||||
# You *must* use %{sVv} in the call in loginfo!
|
||||
die "Invalid filenames"
|
||||
unless ($fname =~ /^(.*),([0-9.]+|NONE),([0-9.]+|NONE)$/);
|
||||
|
||||
$fversions{$1} = {
|
||||
old => ($2 eq "NONE" ? "0" : $2),
|
||||
new => ($3 eq "NONE" ? "0" : $3),
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
# process log message
|
||||
my ($state, $tag) = (STATE_NONE, undef);
|
||||
|
||||
my (@modified, @added, @removed, @log, @branch_tags) = ();
|
||||
|
||||
while (<STDIN>) {
|
||||
chomp;
|
||||
|
||||
debug "State $state, line:$_\n";
|
||||
|
||||
# Ignore empty space at the beginning of the log message
|
||||
next
|
||||
if ($state == STATE_LOG1 && /^\s*$/);
|
||||
|
||||
# We're done ignoring empty space
|
||||
if ($state == STATE_LOG1) {
|
||||
$state = STATE_LOG2;
|
||||
}
|
||||
|
||||
if ($state == STATE_LOG2) {
|
||||
# Don't modify the lines at all if we're processing the log message
|
||||
push(@log, $_);
|
||||
next;
|
||||
} else {
|
||||
# Strip out leading and trailing space
|
||||
s/^\s*(.*?)\s*$/$1/;
|
||||
}
|
||||
|
||||
if (/^Modified Files/) {
|
||||
# Collect list of modified files
|
||||
debug "State switching to STATE_MODIFIED\n";
|
||||
|
||||
$state = STATE_MODIFIED;
|
||||
$tag = undef;
|
||||
|
||||
next;
|
||||
|
||||
} elsif (/^Added Files/) {
|
||||
# Collect list of added files
|
||||
debug "State switching to STATE_ADDED\n";
|
||||
|
||||
$state = STATE_ADDED;
|
||||
$tag = undef;
|
||||
|
||||
next;
|
||||
|
||||
} elsif (/^Removed Files/) {
|
||||
# Collect list of removed files
|
||||
debug "State switching to STATE_REMOVED\n";
|
||||
|
||||
$state = STATE_REMOVED;
|
||||
$tag = undef;
|
||||
|
||||
next;
|
||||
|
||||
} elsif (/^Log Message/) {
|
||||
# Collect log message
|
||||
debug "State switching to STATE_LOG1\n";
|
||||
|
||||
$state = STATE_LOG1;
|
||||
$tag = undef;
|
||||
|
||||
next;
|
||||
|
||||
} elsif (/^Revision\/Branch/) {
|
||||
# Parse old-style Revision/Branch field
|
||||
debug "Found a branch tag\n";
|
||||
|
||||
/^[^:]+:\s*(.*)/;
|
||||
|
||||
push_once(@branch_tags, $1);
|
||||
|
||||
warn "Tag == $tag"
|
||||
if (defined($tag));
|
||||
|
||||
next;
|
||||
}
|
||||
|
||||
# Ignore the stuff at the top of the commit report
|
||||
next
|
||||
if ($state == STATE_NONE);
|
||||
|
||||
if (/^Tag:\s*(.*)$/) {
|
||||
# Remember the tag
|
||||
debug "Setting tag to $1\n";
|
||||
$tag = $1;
|
||||
next;
|
||||
}
|
||||
|
||||
my (@tfiles) = ();
|
||||
|
||||
# Find the file in our command line list of files
|
||||
foreach my $file (split) {
|
||||
die "Nothing known about file $file!"
|
||||
unless (exists($fversions{$file}));
|
||||
|
||||
push @tfiles, {
|
||||
file => $file,
|
||||
tag => $tag,
|
||||
old => $fversions{$file}{old},
|
||||
new => $fversions{$file}{new},
|
||||
};
|
||||
}
|
||||
|
||||
# Store the file list in the correct array
|
||||
push(@modified, @tfiles)
|
||||
if ($state == STATE_MODIFIED);
|
||||
|
||||
push(@added, @tfiles)
|
||||
if ($state == STATE_ADDED);
|
||||
|
||||
push(@removed, @tfiles)
|
||||
if ($state == STATE_REMOVED);
|
||||
}
|
||||
|
||||
# Remove trailing blank lines from the log message
|
||||
while (@log > 0 && $log[$#log] =~ /^\s*$/) {
|
||||
pop(@log);
|
||||
}
|
||||
|
||||
# If a new directory was added, we're done...
|
||||
if (defined($files[1]) && defined($files[2]) &&
|
||||
$files[1] eq "New" && $files[2] eq "directory") {
|
||||
|
||||
my (@text) = ();
|
||||
|
||||
# If there was a sticky tag for the directory, make it a branch tag
|
||||
if ($log[$#log] =~ /^--> Using per-directory sticky tag \`(.*)\'$/) {
|
||||
push_once(@branch_tags, $1);
|
||||
pop(@log);
|
||||
}
|
||||
|
||||
# Build the message...
|
||||
push(@text, build_header($modname, "Module $modname: New directory $dir",
|
||||
\@mailto, @branch_tags));
|
||||
push(@text, "Log message:", "", @log);
|
||||
|
||||
# and send it (synchronously)
|
||||
send_mail(\@mailto, \@text);
|
||||
|
||||
# Clean up after ourselves and exit.
|
||||
cleanup_dir($tmpdir);
|
||||
exit(0);
|
||||
}
|
||||
|
||||
# If an import was done, we're done...
|
||||
if (defined($files[1]) && defined($files[2]) &&
|
||||
$files[1] eq "Imported" && $files[2] eq "sources") {
|
||||
|
||||
my (@text) = ();
|
||||
|
||||
# Build the message...
|
||||
push(@text, build_header($modname, "Module $modname: Imported $dir",
|
||||
\@mailto, @branch_tags));
|
||||
push(@text, "Log message:", "", @log);
|
||||
|
||||
# and send it (synchronously)
|
||||
send_mail(\@mailto, \@text);
|
||||
|
||||
# Clean up after ourselves and exit.
|
||||
cleanup_dir($tmpdir);
|
||||
exit(0);
|
||||
}
|
||||
|
||||
debug "Searching for log file index...";
|
||||
|
||||
my ($i);
|
||||
|
||||
# Look for an empty log file or one that matches our current log message
|
||||
for ($i = 0; ; $i++) {
|
||||
my (@text);
|
||||
|
||||
# found one that doesn't exist...
|
||||
last
|
||||
if (!-e "$tmpdir/logfile.$i");
|
||||
|
||||
# read in the log file
|
||||
open(FILE, "<$tmpdir/logfile.$i");
|
||||
while (<FILE>) {
|
||||
chomp;
|
||||
push(@text, $_);
|
||||
}
|
||||
close(FILE);
|
||||
|
||||
# If the log file was empty, use it
|
||||
last
|
||||
if (@text == 0);
|
||||
|
||||
# If the log messages are identical, use that
|
||||
last
|
||||
if (join(' ', @log) eq join(' ', @text));
|
||||
}
|
||||
|
||||
debug "$tmpdir/logfile.$i\n";
|
||||
|
||||
# Store modified, added, and removed file lists, along with the log message
|
||||
names_to_file("$tmpdir/modified.$i", $dir, @modified);
|
||||
names_to_file("$tmpdir/added.$i", $dir, @added);
|
||||
names_to_file("$tmpdir/removed.$i", $dir, @removed);
|
||||
write_log("$tmpdir/logfile.$i", @log);
|
||||
|
||||
# Now check to see if we're at the end of our rope
|
||||
my ($lastdir) = (get_line("$tmpdir/lastdir"));
|
||||
|
||||
debug "Checking $ENV{CVSROOT}/$repdir against lastdir $lastdir\n";
|
||||
|
||||
# Nope, exit instead of sending a message
|
||||
exit(0)
|
||||
if ($lastdir ne "$ENV{CVSROOT}/$repdir");
|
||||
|
||||
debug "At last, we've reached the end\n";
|
||||
|
||||
# We have to daemonize and sleep so that there isn't any lock hanging
|
||||
# around when we get to the cvs rdiff below...
|
||||
daemonize();
|
||||
sleep(10);
|
||||
|
||||
# Build the mail message...
|
||||
my (@text) = ();
|
||||
@files = ();
|
||||
@branch_tags = ();
|
||||
|
||||
for ($i = 0; ; $i++) {
|
||||
# No more log files
|
||||
last
|
||||
if (!-e "$tmpdir/logfile.$i");
|
||||
|
||||
# read and insert the log message
|
||||
open(FILE, "<$tmpdir/logfile.$i");
|
||||
push(@text, "Log message:", "");
|
||||
while (<FILE>) {
|
||||
chomp;
|
||||
push(@text, $_);
|
||||
}
|
||||
push(@text, "");
|
||||
close(FILE);
|
||||
|
||||
# read modified list and list all modified files if non-empty
|
||||
@modified = file_to_names(@branch_tags, "$tmpdir/modified.$i");
|
||||
push(@text, "Modified files:", name_to_list(@branch_tags, @modified), "")
|
||||
if (@modified > 0);
|
||||
|
||||
# read added list and list all added files if non-empty
|
||||
@added = file_to_names(@branch_tags, "$tmpdir/added.$i");
|
||||
push(@text, "Added files:", name_to_list(@branch_tags, @added), "")
|
||||
if (@added > 0);
|
||||
|
||||
# read removed list and list all removed files if non-empty
|
||||
@removed = file_to_names(@branch_tags, "$tmpdir/removed.$i");
|
||||
push(@text, "Removed files:", name_to_list(@branch_tags, @removed), "")
|
||||
if (@removed > 0);
|
||||
|
||||
# remember all the files we looked at
|
||||
push(@files, @modified, @added, @removed);
|
||||
}
|
||||
|
||||
# Now that name_to_list has rebuilt our list of branch tags, we can build the
|
||||
# header and prepend it to the message
|
||||
unshift(@text, build_header($modname, "Module $modname: Change committed",
|
||||
\@mailto, @branch_tags));
|
||||
|
||||
# sort the files out for our diff
|
||||
@files = sort { $a->{name} cmp $b->{name} } @files;
|
||||
|
||||
my ($user, $filename);
|
||||
my ($sec,$min,$hour,$mday,$mon,$year,$wday,$yday,$isdst) = gmtime(time());
|
||||
$user = getpwuid($<);
|
||||
|
||||
$filename = sprintf("%s.%04d%02d%02d.%02d%02d%02d.%s.diff", $modname,
|
||||
$year + 1900, $mon + 1, $mday, $hour, $min, $sec, $user);
|
||||
|
||||
push(@text, "--$boundary");
|
||||
push(@text, "Content-Type: text/plain; name=\"$filename\"");
|
||||
push(@text, "Content-Disposition: attachment; filename=\"$filename\"");
|
||||
push(@text, "Content-Transfer-Encoding: 8bit");
|
||||
push(@text, "");
|
||||
|
||||
foreach my $file (@files) {
|
||||
debug "Diffing file $file->{name}...\n";
|
||||
|
||||
# Run cvs rdiff, extracting a diff between the old version and the new
|
||||
open(DIFF, "$CVS -Q rdiff -u -r $file->{old} -r $file->{new} " .
|
||||
"$modname/$file->{name}|");
|
||||
while (<DIFF>) {
|
||||
chomp;
|
||||
push(@text, $_);
|
||||
}
|
||||
close(DIFF);
|
||||
}
|
||||
|
||||
# send the mail...
|
||||
send_mail(\@mailto, \@text);
|
||||
|
||||
# and clean up after ourselves
|
||||
cleanup_dir($tmpdir);
|
||||
@@ -1,12 +0,0 @@
|
||||
# The "notify" file controls where notifications from watches set by
|
||||
# "cvs watch add" or "cvs edit" are sent. The first entry on a line is
|
||||
# a regular expression which is tested against the directory that the
|
||||
# change is being made to, relative to the $CVSROOT. If it matches,
|
||||
# then the remainder of the line is a filter program that should contain
|
||||
# one occurrence of %s for the user to notify, and information on its
|
||||
# standard input.
|
||||
#
|
||||
# "ALL" or "DEFAULT" can be used in place of the regular expression.
|
||||
#
|
||||
# For example:
|
||||
#ALL mail %s -s "CVS notification"
|
||||
@@ -1,9 +0,0 @@
|
||||
drevil:f76FWdDTUBG5c:fs2source
|
||||
mysterial:f7nJUwoIhmSrg:fs2source
|
||||
wmcoolmon:f7JRB.js9Q1sE:fs2source
|
||||
inquisitor:f7BVkOvwjDlWk:fs2source
|
||||
penguin:Jh.dOjaiO2jHk:fs2source
|
||||
DTP:f7M92Z/6/uep.:fs2source
|
||||
unknownplayer:f79BgAn.IzJs6:fs2source
|
||||
phreak:f7WQyGiT/jzlM:fs2source
|
||||
anonymous:oIKtWP1q6GDt6:fs2source
|
||||
@@ -1,13 +0,0 @@
|
||||
# The "rcsinfo" file is used to control templates with which the editor
|
||||
# is invoked on commit and import.
|
||||
#
|
||||
# The first entry on a line is a regular expression which is tested
|
||||
# against the directory that the change is being made to, relative to the
|
||||
# $CVSROOT. For the first match that is found, then the remainder of the
|
||||
# line is the name of the file that contains the template.
|
||||
#
|
||||
# If the repository name does not match any of the regular expressions in this
|
||||
# file, the "DEFAULT" line is used, if it is specified.
|
||||
#
|
||||
# If the name "ALL" appears as a regular expression it is always used
|
||||
# in addition to the first matching regex or "DEFAULT".
|
||||
@@ -1,20 +0,0 @@
|
||||
# The "taginfo" file is used to control pre-tag checks.
|
||||
# The filter on the right is invoked with the following arguments:
|
||||
#
|
||||
# $1 -- tagname
|
||||
# $2 -- operation "add" for tag, "mov" for tag -F, and "del" for tag -d
|
||||
# $3 -- repository
|
||||
# $4-> file revision [file revision ...]
|
||||
#
|
||||
# A non-zero exit of the filter program will cause the tag to be aborted.
|
||||
#
|
||||
# The first entry on a line is a regular expression which is tested
|
||||
# against the directory that the change is being committed to, relative
|
||||
# to the $CVSROOT. For the first match that is found, then the remainder
|
||||
# of the line is the name of the filter to run.
|
||||
#
|
||||
# If the repository name does not match any of the regular expressions in this
|
||||
# file, the "DEFAULT" line is used, if it is specified.
|
||||
#
|
||||
# If the name "ALL" appears as a regular expression it is always used
|
||||
# in addition to the first matching regex or "DEFAULT".
|
||||
@@ -1,21 +0,0 @@
|
||||
# The "verifymsg" file is used to allow verification of logging
|
||||
# information. It works best when a template (as specified in the
|
||||
# rcsinfo file) is provided for the logging procedure. Given a
|
||||
# template with locations for, a bug-id number, a list of people who
|
||||
# reviewed the code before it can be checked in, and an external
|
||||
# process to catalog the differences that were code reviewed, the
|
||||
# following test can be applied to the code:
|
||||
#
|
||||
# Making sure that the entered bug-id number is correct.
|
||||
# Validating that the code that was reviewed is indeed the code being
|
||||
# checked in (using the bug-id number or a seperate review
|
||||
# number to identify this particular code set.).
|
||||
#
|
||||
# If any of the above test failed, then the commit would be aborted.
|
||||
#
|
||||
# Actions such as mailing a copy of the report to each reviewer are
|
||||
# better handled by an entry in the loginfo file.
|
||||
#
|
||||
# One thing that should be noted is the the ALL keyword is not
|
||||
# supported. There can be only one entry that matches a given
|
||||
# repository.
|
||||
@@ -1,4 +0,0 @@
|
||||
drevil
|
||||
inquisitor
|
||||
mysterial
|
||||
penguin
|
||||
@@ -0,0 +1,25 @@
|
||||
Makefile
|
||||
Makefile.in
|
||||
configure
|
||||
FS2_Open.prj
|
||||
FS2_Open.prj.bak
|
||||
FS2_Open.pws
|
||||
.tm_project.cache
|
||||
config.guess
|
||||
config.cache
|
||||
config.log
|
||||
config.status
|
||||
config.sub
|
||||
depcomp
|
||||
install-sh
|
||||
missing
|
||||
mkinstalldirs
|
||||
autom4te*
|
||||
aclocal.m4
|
||||
Freespace2.dsp
|
||||
Freespace2.dsw
|
||||
Freespace2.ncb
|
||||
Freespace2.opt
|
||||
Freespace2.plg
|
||||
Release
|
||||
Debug
|
||||
@@ -0,0 +1,29 @@
|
||||
Original source (Freespace 2) by Volition, Inc.; see "credits.tbl"
|
||||
|
||||
Modifications by the FreeSpace Source Code Project (FSSCP)
|
||||
http://fs2source.warpcore.org
|
||||
|
||||
FS2_OPEN STAFF:
|
||||
|
||||
Project leader:
|
||||
Edward "Inquisitor" Gardner
|
||||
|
||||
Programmers:
|
||||
"Bobboau"
|
||||
Dennis "DTP" Pedersen
|
||||
Ian "Goober5000" Warfield
|
||||
Joe "Righteous1" Dowd
|
||||
Mike "penguin" Harris
|
||||
"Mysterial"
|
||||
"PhReAk"
|
||||
Thomas "Random Tiger" Whittaker
|
||||
Will "Unknown PLayer" Rousnel
|
||||
"WMCoolmon"
|
||||
|
||||
Web support:
|
||||
Icefire and the staff at Volitionwatch.com
|
||||
Alex "Thunder" Avery and the staff at Hard Light Productions
|
||||
|
||||
Special thanks to:
|
||||
Volition for making FS2 such a great game
|
||||
Dave Baranec for giving us the code and keeping us sanity checked
|
||||
@@ -0,0 +1,14 @@
|
||||
Volition Copyright (applies to original FreeSpace2 source code
|
||||
developed and released by Volition):
|
||||
|
||||
"Copyright (C) Volition, Inc. 1999. All rights reserved.
|
||||
|
||||
All source code herein is the property of Volition, Inc. You may not
|
||||
sell or otherwise commercially exploit the source or things you
|
||||
created based on the source."
|
||||
|
||||
|
||||
Modifications by members of the FreeSpace Source Code Project are
|
||||
released under whatever terms the individual authors choose, but the
|
||||
above notice continues to apply to all fs2_open code.
|
||||
|
||||
+595
-1
@@ -1,6 +1,600 @@
|
||||
ChangeLog for fs2_open. All times are UTC.
|
||||
Updated 2002-08-13 04:31
|
||||
Updated 2002-10-31 03:46
|
||||
|
||||
|
||||
2002-10-30 22:57 randomtiger
|
||||
|
||||
* code/: code.dsp (1.6.2.8), graphics/grd3d.cpp (2.2.2.18),
|
||||
graphics/grd3dinternal.h (2.1.2.7), graphics/grd3dtexture.cpp
|
||||
(2.1.2.16), model/modelinterp.cpp (2.3.2.1):
|
||||
|
||||
Changed DX8 code to not use set render and texture states if they
|
||||
are already set to that value. Disabled buffer saving and
|
||||
restoring code when windowed to stop DX8 debug runs from crashing.
|
||||
- RT
|
||||
|
||||
2002-10-30 20:22 inquisitor
|
||||
|
||||
* code/cmdline/cmdline.h (2.10):
|
||||
|
||||
Bad Committ, Rolling back
|
||||
|
||||
2002-10-30 06:29 DTP
|
||||
|
||||
* code/cfile/: cfilesystem.cpp (2.5), cfile.cpp (2.5):
|
||||
|
||||
doh!, used upper case in include, dont know how much it matters for
|
||||
*nix systems, but here it is
|
||||
|
||||
2002-10-30 06:26 DTP
|
||||
|
||||
* code/cfile/cfilesystem.cpp (2.4):
|
||||
|
||||
DTP Implemented basic VP files handling. mission and campaign files
|
||||
inside VP files found in mod dir still not supported, cheking /
|
||||
creating directories not implented either
|
||||
|
||||
2002-10-29 22:41 sesquipedalian
|
||||
|
||||
* code/parse/: sexp.cpp (2.3), sexp.h (2.3):
|
||||
|
||||
no message
|
||||
|
||||
2002-10-28 02:28 DTP
|
||||
|
||||
* code/cmdline/cmdline.h (2.9):
|
||||
|
||||
Crap, somebody may restore cmdline.h to 2 version before this.
|
||||
|
||||
2002-10-28 00:40 randomtiger
|
||||
|
||||
* code/graphics/grd3d.cpp (2.2.2.17):
|
||||
|
||||
Implemented screen saving code for restoring when drawing popups, a
|
||||
bit slow but works. - RT
|
||||
|
||||
2002-10-27 23:59 DTP
|
||||
|
||||
* code/cfile/: cfile.cpp (2.4), cfile.h (2.3):
|
||||
|
||||
DTP; started basic implementation of mod-support plain files only
|
||||
for now. fs2_open.exe -mod X will look for files in fs2/ X
|
||||
/all-legal-subdirectories. no checking/creating dirs yet.
|
||||
directories must be there.
|
||||
|
||||
2002-10-27 23:55 DTP
|
||||
|
||||
* code/cmdline/: cmdline.cpp (2.9), cmdline.h (2.8):
|
||||
|
||||
DTP; started basic implementation of mod-support plain files only
|
||||
for now. fs2_open.exe -mod X will look for files in fs2/ X
|
||||
/all-legal-subdirectories. no checking/creating dirs yet.
|
||||
directories must be there.
|
||||
|
||||
2002-10-26 09:55 unknownplayer
|
||||
|
||||
* code/: freespace2/freespace.cpp (2.6.2.5), nebula/neb.cpp
|
||||
(2.1.2.1):
|
||||
|
||||
Fixed the nebula flicker bug. Check the NO_DIRECT3D conditional
|
||||
compile sections in the future for bits of code which may cause
|
||||
problems due to hacks correcting for DirectX5 that no longer apply.
|
||||
|
||||
2002-10-26 01:24 randomtiger
|
||||
|
||||
* code/: bmpman/bmpman.cpp (2.2.2.10), bmpman/bmpman.h (2.0.2.7),
|
||||
graphics/grd3d.cpp (2.2.2.16), graphics/grd3drender.cpp (2.3.2.15),
|
||||
graphics/grd3dtexture.cpp (2.1.2.15):
|
||||
|
||||
Fixed debug bitmap compiling bug. Fixed tga bug. - RT
|
||||
|
||||
2002-10-22 23:02 randomtiger
|
||||
|
||||
* code/: cmdline/cmdline.cpp (2.8), cmdline/cmdline.h (2.7),
|
||||
debugconsole/timerbar.h (1.2), hud/hudtargetbox.cpp (2.4),
|
||||
model/modelinterp.cpp (2.5):
|
||||
|
||||
Made Phreaks alternative scanning style optional under the command
|
||||
line tag "-phreak" Fixed bug that changes HUD colour when
|
||||
targetting debris in a full nebula. - RT
|
||||
|
||||
2002-10-22 17:46 randomtiger
|
||||
|
||||
* Freespace2.dsp (1.7.2.4), code/bmpman/bmpman.cpp (2.2.2.9),
|
||||
code/bmpman/bmpman.h (2.0.2.6), code/graphics/grd3dtexture.cpp
|
||||
(2.1.2.14):
|
||||
|
||||
Fixed new TGA code texturing bug. - RT
|
||||
|
||||
2002-10-22 17:42 randomtiger
|
||||
|
||||
* code/: freespace2/freespace.cpp (2.13),
|
||||
missionui/missionpause.cpp (2.3):
|
||||
|
||||
Fixed lighting bug that caused special pause to crash on debug
|
||||
build. Also added TAB functionality for special pause that toggles
|
||||
HUD. - RT
|
||||
|
||||
2002-10-21 16:33 randomtiger
|
||||
|
||||
* code/: bmpman/bmpman.cpp (2.2.2.8), bmpman/bmpman.h (2.0.2.5),
|
||||
graphics/grd3d.cpp (2.2.2.15), graphics/grd3dinternal.h (2.1.2.6),
|
||||
graphics/grd3drender.cpp (2.3.2.14), graphics/grd3dtexture.cpp
|
||||
(2.1.2.13):
|
||||
|
||||
Added D3D only 32 bit TGA functionality. Will load a texture as big
|
||||
as your graphics card allows. Code not finished yet and will forge
|
||||
the beginnings of the new texture system. - RT
|
||||
|
||||
2002-10-20 22:21 randomtiger
|
||||
|
||||
* code/: bmpman/bmpman.cpp (2.2.2.7), graphics/grd3d.cpp
|
||||
(2.2.2.14), graphics/grd3drender.cpp (2.3.2.13), palman/palman.cpp
|
||||
(2.1.2.1):
|
||||
|
||||
Some incomplete code to handle background drawing when message
|
||||
boxes are drawn. It doesnt work but its a good base for someone to
|
||||
start from. - RT
|
||||
|
||||
2002-10-19 23:56 randomtiger
|
||||
|
||||
* code/: bmpman/bmpman.cpp (2.2.2.6), bmpman/bmpman.h (2.0.2.4),
|
||||
globalincs/pstypes.h (2.4.2.3), graphics/grd3d.cpp (2.2.2.13),
|
||||
graphics/grd3dtexture.cpp (2.1.2.12):
|
||||
|
||||
Changed generic bitmap code to allow maximum dimensions to be
|
||||
determined by 3D's engines maximum texture size query. Defaults to
|
||||
256 as it was before. Also added base code for reworking the
|
||||
texture code to be more efficient. - RT
|
||||
|
||||
2002-10-19 19:29 bobboau
|
||||
|
||||
* code/: controlconfig/controlsconfig.h (2.2),
|
||||
controlconfig/controlsconfigcommon.cpp (2.3), model/model.h (2.5),
|
||||
model/modelinterp.cpp (2.4), model/modelread.cpp (2.4),
|
||||
model/modelsinc.h (2.4), object/object.cpp (2.2), osapi/outwnd.cpp
|
||||
(2.2), physics/physics.cpp (2.2), physics/physics.h (2.2),
|
||||
playerman/playercontrol.cpp (2.2), ship/ai.h (2.2), ship/aibig.cpp
|
||||
(2.2), ship/aicode.cpp (2.8), ship/ship.cpp (2.7), ship/ship.h
|
||||
(2.4), ship/shipcontrails.cpp (2.3), ship/shipcontrails.h (2.1),
|
||||
ship/shiphit.cpp (2.6), starfield/starfield.cpp (2.3),
|
||||
weapon/beam.cpp (2.4), weapon/beam.h (2.3), weapon/weapon.h (2.2),
|
||||
weapon/weapons.cpp (2.2):
|
||||
|
||||
inital commit, trying to get most of my stuff into FSO, there
|
||||
should be most of my fighter beam, beam rendering, beam sheild hit,
|
||||
ABtrails, and ssm stuff. one thing you should be happy to know is
|
||||
the beam texture tileing is now set in the beam section section of
|
||||
the weapon table entry
|
||||
|
||||
2002-10-19 03:50 randomtiger
|
||||
|
||||
* code/: cmdline/cmdline.cpp (2.7), cmdline/cmdline.h (2.6),
|
||||
freespace2/freespace.cpp (2.12), io/keycontrol.cpp (2.4),
|
||||
menuui/readyroom.cpp (2.2), missionui/missionpause.cpp (2.2),
|
||||
missionui/missionpause.h (2.2):
|
||||
|
||||
Added special pause mode for easier action screenshots. Added new
|
||||
command line parameter for accessing all single missions in tech
|
||||
room. - RT
|
||||
|
||||
2002-10-17 20:40 randomtiger
|
||||
|
||||
* code/: controlconfig/controlsconfig.h (2.1),
|
||||
controlconfig/controlsconfigcommon.cpp (2.2), hud/hud.cpp (2.2),
|
||||
hud/hud.h (2.2), io/keycontrol.cpp (2.3),
|
||||
mission/missionmessage.cpp (2.2):
|
||||
|
||||
Added ability to remove HUD ingame on keypress shift O So I've
|
||||
added a new key to the bind list and made use of already existing
|
||||
hud removal code.
|
||||
|
||||
2002-10-16 00:41 randomtiger
|
||||
|
||||
* code/graphics/: 2d.cpp (2.3.2.8), 2d.h (2.1.2.2), grd3d.cpp
|
||||
(2.2.2.12), grd3d.h (2.0.2.4), grd3drender.cpp (2.3.2.12):
|
||||
|
||||
Fixed small bug that was stopping unactive text from displaying
|
||||
greyed out Also added ability to run FS2 DX8 in 640x480, however I
|
||||
needed to make a small change to 2d.cpp which invloved calling the
|
||||
resolution processing code after initialising the device for D3D
|
||||
only. This is because D3D8 for the moment has its own internal
|
||||
launcher. Also I added a fair bit of documentation and tidied some
|
||||
stuff up. - RT
|
||||
|
||||
2002-10-14 21:52 randomtiger
|
||||
|
||||
* code/: bmpman/bmpman.cpp (2.2.2.5), graphics/grd3d.cpp
|
||||
(2.2.2.11), graphics/grd3drender.cpp (2.3.2.11),
|
||||
graphics/grd3dtexture.cpp (2.1.2.11):
|
||||
|
||||
Finally tracked down and killed off that 8 bit alpha bug. So the
|
||||
font, HUD and 8 bit ani's now work fine. - RT
|
||||
|
||||
2002-10-14 19:49 phreak
|
||||
|
||||
* code/graphics/gropenglw32x.cpp (1.4):
|
||||
|
||||
screenshots, yay!
|
||||
|
||||
2002-10-13 21:43 phreak
|
||||
|
||||
* code/graphics/gropenglw32x.cpp (1.3):
|
||||
|
||||
further optimizations
|
||||
|
||||
2002-10-12 17:48 phreak
|
||||
|
||||
* code/graphics/gropenglw32x.cpp (1.2):
|
||||
|
||||
fixed text
|
||||
|
||||
2002-10-11 21:35 phreak
|
||||
|
||||
* code/graphics/gropenglw32.cpp (1.2):
|
||||
|
||||
dont use this one
|
||||
|
||||
2002-10-11 21:30 phreak
|
||||
|
||||
* code/graphics/: gropenglw32.cpp (1.1), gropenglw32x.cpp (1.1):
|
||||
|
||||
first run at opengl for w32, only useful in main hall, barracks and
|
||||
campaign room
|
||||
|
||||
2002-10-11 18:50 randomtiger
|
||||
|
||||
* code/graphics/: 2d.cpp (2.3.2.7), 2d.h (2.1.2.1), grd3d.cpp
|
||||
(2.2.2.10), grd3d.h (2.0.2.3), grd3dinternal.h (2.1.2.5),
|
||||
grd3drender.cpp (2.3.2.10), grd3dtexture.cpp (2.1.2.10):
|
||||
|
||||
Checked in fix for 16 bit problem, thanks to Righteous1 Removed a
|
||||
fair bit of code that was used by the 16 bit code path which no
|
||||
longer exists. 32 bit and 16 bit should now work in exactly the
|
||||
same way. - RT
|
||||
|
||||
2002-10-08 14:33 randomtiger
|
||||
|
||||
* code/: graphics/grd3d.cpp (2.2.2.9), graphics/grd3drender.cpp
|
||||
(2.3.2.9), graphics/grd3dtexture.cpp (2.1.2.9), osapi/outwnd.cpp
|
||||
(2.1.2.1):
|
||||
|
||||
OK, I've fixed the z-buffer problem. However I have abandoned
|
||||
using w-buffer for now because of problems. I think I know how to
|
||||
solve it but Im not sure it would make much difference given the
|
||||
way FS2 engine works. I have left code in there of use if anyone
|
||||
wants to turn their hand to it. However for now we just need to
|
||||
crack of the alpha problem then we will have FS2 fully wokring in
|
||||
DX8 on GF4 in 32 bit.
|
||||
|
||||
2002-10-05 16:46 randomtiger
|
||||
|
||||
* code/: code.dsp (1.10), debugconsole/timerbar.cpp (1.1),
|
||||
debugconsole/timerbar.h (1.1), freespace2/freespace.cpp (2.11),
|
||||
globalincs/systemvars.h (2.2), graphics/grd3d.cpp (2.3),
|
||||
graphics/grd3dinternal.h (2.2), graphics/grd3drender.cpp (2.4),
|
||||
menuui/credits.cpp (2.3):
|
||||
|
||||
Added us fs2_open people to the credits. Worth looking at just for
|
||||
that. Added timer bar code, by default its not compiled in. Use
|
||||
TIMEBAR_ACTIVE in project and dependancy code settings to activate.
|
||||
Added the new timebar files with the new code.
|
||||
|
||||
2002-10-04 00:48 randomtiger
|
||||
|
||||
* code/graphics/: grd3d.cpp (2.2.2.8), grd3dinternal.h (2.1.2.4),
|
||||
grd3drender.cpp (2.3.2.8), grd3dtexture.cpp (2.1.2.8):
|
||||
|
||||
Fixed video memory leaks Added code to cope with lost device, not
|
||||
tested Got rid of some DX5 stuff we definately dont need Moved some
|
||||
enum's into internal,h because gr_d3d_set_state should be able to
|
||||
be called from any dx file Cleaned up some stuff - RT
|
||||
|
||||
2002-10-03 08:32 unknownplayer
|
||||
|
||||
* code/: graphics/grd3d.cpp (2.2.2.7), graphics/grd3dtexture.cpp
|
||||
(2.1.2.7), osapi/osapi.cpp (2.2.2.2):
|
||||
|
||||
Hacked in a windowed mode so we can properly debug this without
|
||||
using monitors (although I drool at the concept of having that!)
|
||||
|
||||
2002-10-02 17:52 randomtiger
|
||||
|
||||
* code/: debugconsole/dbugfile.cpp (2.1.2.3),
|
||||
debugconsole/dbugfile.h (2.1.2.3), graphics/grd3d.cpp (2.2.2.6),
|
||||
graphics/grd3drender.cpp (2.3.2.7), graphics/grd3dtexture.cpp
|
||||
(2.1.2.6):
|
||||
|
||||
Fixed blue lighting bug. Put filtering flag set back in that I
|
||||
accidentally removed Added some new functionality to my debuging
|
||||
system - RT
|
||||
|
||||
2002-10-02 11:40 randomtiger
|
||||
|
||||
* code/: code.dsp (1.6.2.7), bmpman/bmpman.cpp (2.2.2.4),
|
||||
bmpman/bmpman.h (2.0.2.3), graphics/2d.cpp (2.3.2.6),
|
||||
graphics/grd3d.cpp (2.2.2.5), graphics/grd3d.h (2.0.2.2),
|
||||
graphics/grd3dinternal.h (2.1.2.3), graphics/grd3drender.cpp
|
||||
(2.3.2.6), graphics/grd3dtexture.cpp (2.1.2.5),
|
||||
pcxutils/pcxutils.cpp (2.1.2.2):
|
||||
|
||||
Bmpmap has been reverted to an old non d3d8 version. All d3d8 code
|
||||
is now in the proper place. PCX code is now working to an extent.
|
||||
Problems with alpha though. Ani's work slowly with alpha problems.
|
||||
Also I have done a bit of tidying - RT
|
||||
|
||||
2002-09-28 22:13 randomtiger
|
||||
|
||||
* code/: anim/animplay.cpp (2.1.2.2), bmpman/bmpman.cpp (2.2.2.3),
|
||||
graphics/grd3d.cpp (2.2.2.4), graphics/grd3dinternal.h (2.1.2.2),
|
||||
graphics/grd3drender.cpp (2.3.2.5), graphics/grd3dtexture.cpp
|
||||
(2.1.2.4), weapon/weapons.cpp (2.1.2.2):
|
||||
|
||||
Sorted out some bits and pieces. The background nebula blends now
|
||||
which is nice. – RT
|
||||
|
||||
2002-09-28 12:20 randomtiger
|
||||
|
||||
* code/graphics/: grd3d.cpp (2.2.2.3), grd3drender.cpp (2.3.2.4),
|
||||
grd3dtexture.cpp (2.1.2.3):
|
||||
|
||||
Just a tiny code change that lets stuff work in 16 bit. For some
|
||||
reason 16 bit code was taking a different code path for displaying
|
||||
textures. So until I unstand why, Im cutting off that codepath
|
||||
because it isnt easy to convert into DX8.
|
||||
|
||||
2002-09-28 00:18 randomtiger
|
||||
|
||||
* code/: bmpman/bmpman.cpp (2.2.2.2), bmpman/bmpman.h (2.0.2.2),
|
||||
graphics/grd3drender.cpp (2.3.2.3), graphics/grd3dtexture.cpp
|
||||
(2.1.2.2):
|
||||
|
||||
Did some work on trying to get textures to load from pcx, define
|
||||
TX_ATTEMPT for access to it. Converted some DX7 blending calls to
|
||||
DX8 which a fair difference to ingame visuals.
|
||||
|
||||
- RT
|
||||
|
||||
2002-09-24 18:56 randomtiger
|
||||
|
||||
* Freespace2.dsp (1.7.2.3), code/code.dsp (1.6.2.6),
|
||||
code/anim/animplay.cpp (2.1.2.1), code/bmpman/bmpman.cpp (2.2.2.1),
|
||||
code/bmpman/bmpman.h (2.0.2.1), code/cfile/cfile.cpp (2.3.2.1),
|
||||
code/cmeasure/cmeasure.cpp (2.1.2.1),
|
||||
code/controlconfig/controlsconfig.cpp (2.1.2.1),
|
||||
code/cutscene/cutscenes.cpp (2.2.2.4), code/cutscene/movie.cpp
|
||||
(2.1.2.4), code/cutscene/movie.h (2.1.2.2),
|
||||
code/debugconsole/console.cpp (2.1.2.1),
|
||||
code/debugconsole/dbugfile.cpp (2.1.2.2),
|
||||
code/debugconsole/dbugfile.h (2.1.2.2),
|
||||
code/freespace2/freespace.cpp (2.6.2.4),
|
||||
code/freespace2/freespace.rc (2.0.2.1),
|
||||
code/freespace2/freespaceresource.h (2.0.2.1),
|
||||
code/gamehelp/gameplayhelp.cpp (2.1.2.1), code/globalincs/pstypes.h
|
||||
(2.4.2.2), code/graphics/2d.cpp (2.3.2.5), code/graphics/bitblt.cpp
|
||||
(2.1.2.1), code/graphics/grd3d.cpp (2.2.2.2), code/graphics/grd3d.h
|
||||
(2.0.2.1), code/graphics/grd3dinternal.h (2.1.2.1),
|
||||
code/graphics/grd3drender.cpp (2.3.2.2),
|
||||
code/graphics/grd3dtexture.cpp (2.1.2.1),
|
||||
code/graphics/grdirectdraw.cpp (2.1.2.2), code/hud/hudconfig.cpp
|
||||
(2.2.2.1), code/hud/hudmessage.cpp (2.1.2.1),
|
||||
code/menuui/barracks.cpp (2.2.2.1), code/menuui/credits.cpp
|
||||
(2.2.2.1), code/menuui/mainhallmenu.cpp (2.3.2.4),
|
||||
code/menuui/mainhalltemp.cpp (2.1.2.1), code/menuui/optionsmenu.cpp
|
||||
(2.1.2.1), code/menuui/playermenu.cpp (2.2.2.1),
|
||||
code/menuui/readyroom.cpp (2.1.2.1), code/menuui/techmenu.cpp
|
||||
(2.1.2.1), code/menuui/trainingmenu.cpp (2.1.2.1),
|
||||
code/mission/missioncampaign.cpp (2.3.2.3),
|
||||
code/mission/missiongoals.cpp (2.1.2.1),
|
||||
code/mission/missionhotkey.cpp (2.1.2.1),
|
||||
code/mission/missionload.cpp (2.1.2.1),
|
||||
code/missionui/missionbrief.cpp (2.1.2.1),
|
||||
code/missionui/missioncmdbrief.cpp (2.1.2.1),
|
||||
code/missionui/missiondebrief.cpp (2.2.2.1),
|
||||
code/missionui/missionloopbrief.cpp (2.1.2.1),
|
||||
code/missionui/missionpause.cpp (2.1.2.1),
|
||||
code/missionui/missionshipchoice.cpp (2.1.2.1),
|
||||
code/missionui/missionweaponchoice.cpp (2.1.2.1),
|
||||
code/missionui/redalert.cpp (2.1.2.1),
|
||||
code/network/multi_dogfight.cpp (2.1.2.1),
|
||||
code/network/multi_ingame.cpp (2.1.2.1),
|
||||
code/network/multi_pinfo.cpp (2.1.2.1),
|
||||
code/network/multiteamselect.cpp (2.2.2.1),
|
||||
code/network/multiui.cpp (2.4.2.1), code/pcxutils/pcxutils.cpp
|
||||
(2.1.2.1), code/popup/popup.cpp (2.1.2.1), code/render/3ddraw.cpp
|
||||
(2.2.2.1), code/ship/ship.cpp (2.6.2.1), code/stats/medals.cpp
|
||||
(2.2.2.1), code/ui/gadget.cpp (2.1.2.1), code/weapon/weapons.cpp
|
||||
(2.1.2.1):
|
||||
|
||||
DX8 branch commit
|
||||
|
||||
This is the scub of UP's previous code with the more up to date RT
|
||||
code. For full details check previous dev e-mails
|
||||
|
||||
2002-09-20 20:09 phreak
|
||||
|
||||
* code/freespace2/freespace.cpp (2.10):
|
||||
|
||||
did glare stuff in game_sunspot_process()
|
||||
|
||||
2002-09-20 20:05 phreak
|
||||
|
||||
* code/starfield/starfield.cpp (2.2):
|
||||
|
||||
glare parser stuff in stars_init()
|
||||
|
||||
2002-09-20 20:04 phreak
|
||||
|
||||
* code/starfield/starfield.h (2.2):
|
||||
|
||||
added glare variable for ambient suns if glare is 0 then the sun
|
||||
glare whiteout is not shown when looking at the sun
|
||||
|
||||
2002-09-20 20:02 phreak
|
||||
|
||||
* code/hud/hudtarget.cpp (2.2):
|
||||
|
||||
lead indicator for dumbfire missiles
|
||||
|
||||
2002-09-20 20:01 phreak
|
||||
|
||||
* code/hud/hudtargetbox.cpp (2.3):
|
||||
|
||||
extra effects during cargo scan
|
||||
|
||||
2002-09-10 21:58 unknownplayer
|
||||
|
||||
* code/graphics/directx8/GrD3d81Stubs.cpp (1.1):
|
||||
|
||||
file GrD3d81Stubs.cpp was initially added on branch directx8.
|
||||
|
||||
2002-09-10 21:58 unknownplayer
|
||||
|
||||
* code/: freespace2/freespace.cpp (2.6.2.3), graphics/2d.cpp
|
||||
(2.3.2.4), graphics/grdirectdraw.cpp (2.1.2.1),
|
||||
graphics/directx8/GrD3D81.cpp (1.2.2.4),
|
||||
graphics/directx8/GrD3D81.h (1.1.2.4),
|
||||
graphics/directx8/GrD3d81Stubs.cpp (1.1.2.1):
|
||||
|
||||
Added the DX8 stub file, plus new CODE!
|
||||
|
||||
2002-09-08 02:36 unknownplayer
|
||||
|
||||
* code/: code.dsp (1.6.2.5), graphics/2d.cpp (2.3.2.3),
|
||||
graphics/grd3d.cpp (2.2.2.1), graphics/grd3drender.cpp (2.3.2.1),
|
||||
graphics/directx8/GrD3D81.cpp (1.2.2.3),
|
||||
graphics/directx8/GrD3D81.h (1.1.2.3):
|
||||
|
||||
Framework for the new D3DRENDER class is in place, and gr_screen
|
||||
function structures are now there too. The way it's done is
|
||||
probably kind of inefficient, but until we're further along
|
||||
actually drawing polygons we should keep it that way for
|
||||
consistency's sake.
|
||||
|
||||
2002-09-01 08:18 unknownplayer
|
||||
|
||||
* Freespace2.dsp (1.7.2.2), code/code.dsp (1.6.2.4),
|
||||
code/globalincs/pstypes.h (2.4.2.1), code/graphics/2d.cpp
|
||||
(2.3.2.2), code/graphics/directx8/GrD3D81.cpp (1.2.2.2),
|
||||
code/graphics/directx8/GrD3D81.h (1.1.2.2),
|
||||
code/menuui/mainhallmenu.cpp (2.3.2.3):
|
||||
|
||||
Started writing some code for the new DX8.1 class and hit a serious
|
||||
snag to do with window handling and DirectDraw (and possibly my
|
||||
unfamiliarity with DX). It seems we may need to make some changes
|
||||
further up the code because we no longer use DX through DD in 8.1
|
||||
and the V code did that a lot (to go fullscreen and such check out
|
||||
the device creation code)
|
||||
|
||||
2002-08-31 04:50 unknownplayer
|
||||
|
||||
* code/: code.dsp (1.6.2.3), graphics/2d.cpp (2.3.2.1),
|
||||
graphics/directx8/GrD3D81.cpp (1.2.2.1),
|
||||
graphics/directx8/GrD3D81.h (1.1.2.1):
|
||||
|
||||
Removed some older DX81 stuff I added before and changed some other
|
||||
things. I'm currently thinking that I'm going to run with putting
|
||||
everything into a specialized class with the d3d_init and
|
||||
d3d_cleanup functions as gods. (Creation / Destruction functions -
|
||||
i.e. gods :)
|
||||
|
||||
2002-08-31 04:48 unknownplayer
|
||||
|
||||
* code/graphics/directx8/grd3d81internal.h (1.2.2.1):
|
||||
|
||||
These are all officially now out of FS2 unless you have a specific
|
||||
reason to need them. I'm running with the idea that we make a C++
|
||||
class and use that as an effective way to control the code.
|
||||
Rewriting V's stuff is just insanely difficult.
|
||||
|
||||
2002-08-28 21:47 randomtiger
|
||||
|
||||
* Freespace2.dsp (1.10), code/cutscene/cutscenes.cpp (2.2.2.3),
|
||||
code/cutscene/movie.cpp (2.1.2.3):
|
||||
|
||||
Tiny change to DX branch to keep movie code optional (default off)
|
||||
|
||||
2002-08-28 12:39 randomtiger
|
||||
|
||||
* code/: code.dsp (1.6.2.2), cutscene/cutscenes.cpp (2.2.2.2),
|
||||
cutscene/movie.cpp (2.1.2.2), debugconsole/dbugfile.cpp (2.1.2.1),
|
||||
debugconsole/dbugfile.h (2.1.2.1), directx/dx8show.cpp (1.1.2.2),
|
||||
directx/dx8show.h (1.1.2.2), freespace2/freespace.cpp (2.6.2.2),
|
||||
menuui/mainhallmenu.cpp (2.3.2.2), mission/missioncampaign.cpp
|
||||
(2.3.2.2), osapi/osapi.cpp (2.2.2.1), osapi/osapi.h (2.2.2.1):
|
||||
|
||||
OK, this should be a commit to the DX branch or Im going to be in a
|
||||
lot of trouble. The movie and dx8show files have been cleaned up
|
||||
big time. My debug system is in but has NO EFFECT at all unless a
|
||||
compiler flag is turned on, check h file for details. Aside from
|
||||
that a few changes to help the movie code work properly. Works on
|
||||
most things including GF4 and Voodoo 3. However may not work
|
||||
properly on a voodoo 2. Im going to leave this as a bug for now,
|
||||
serves you right for buying voodoo!
|
||||
|
||||
2002-08-28 10:51 randomtiger
|
||||
|
||||
* code/: code.dsp (1.9), debugconsole/dbugfile.cpp (2.1),
|
||||
debugconsole/dbugfile.h (2.1), freespace2/freespace.cpp (2.9):
|
||||
|
||||
Woh! I sure as hell didnt modify all these files it says I did. I
|
||||
will put this down to the branch! Note: I did start from a fresh
|
||||
checkout!
|
||||
|
||||
2002-08-27 13:38 penguin
|
||||
|
||||
* Freespace2.dsp (1.9), code/code.dsp (1.8),
|
||||
code/cmdline/cmdline.cpp (2.6), code/cmdline/cmdline.h (2.5),
|
||||
code/cutscene/cutscenes.cpp (2.4), code/cutscene/movie.cpp (2.2),
|
||||
code/cutscene/movie.h (2.2), code/directx/DShow.h (1.2),
|
||||
code/directx/ddraw.lib (1.2), code/directx/dx8show.cpp (1.2),
|
||||
code/directx/dx8show.h (1.2), code/directx/dxguid.lib (1.2),
|
||||
code/directx/strmiids.lib (1.2), code/freespace2/freespace.cpp
|
||||
(2.8), code/menuui/mainhallmenu.cpp (2.5),
|
||||
code/mission/missioncampaign.cpp (2.5):
|
||||
|
||||
Moved DirectX8 stuff to directx8 branch; reverted to previous
|
||||
|
||||
2002-08-27 13:25 penguin
|
||||
|
||||
* code/directx/: DShow.h (1.1.2.1), ddraw.lib (1.1.2.1),
|
||||
dx8show.cpp (1.1.2.1), dx8show.h (1.1.2.1), dxguid.lib (1.1.2.1),
|
||||
strmiids.lib (1.1.2.1):
|
||||
|
||||
Moved to directx8 branch
|
||||
|
||||
2002-08-27 13:21 penguin
|
||||
|
||||
* code/: freespace2/freespace.cpp (2.6.2.1),
|
||||
menuui/mainhallmenu.cpp (2.3.2.1), mission/missioncampaign.cpp
|
||||
(2.3.2.1), code.dsp (1.6.2.1), cmdline/cmdline.cpp (2.4.2.1),
|
||||
cmdline/cmdline.h (2.3.2.1), cutscene/cutscenes.cpp (2.2.2.1),
|
||||
cutscene/movie.cpp (2.1.2.1), cutscene/movie.h (2.1.2.1),
|
||||
Freespace2.dsp (1.7.2.1):
|
||||
|
||||
Moved to directx8 branch
|
||||
|
||||
2002-08-18 19:48 randomtiger
|
||||
|
||||
* Freespace2.dsp (1.8), code/code.dsp (1.7),
|
||||
code/cmdline/cmdline.cpp (2.5), code/cmdline/cmdline.h (2.4),
|
||||
code/cutscene/cutscenes.cpp (2.3), code/cutscene/movie.cpp (2.1),
|
||||
code/cutscene/movie.h (2.1), code/directx/DShow.h (1.1),
|
||||
code/directx/ddraw.lib (1.1), code/directx/dx8show.cpp (1.1),
|
||||
code/directx/dx8show.h (1.1), code/directx/dxguid.lib (1.1),
|
||||
code/directx/strmiids.lib (1.1), code/freespace2/freespace.cpp
|
||||
(2.7), code/menuui/mainhallmenu.cpp (2.4),
|
||||
code/mission/missioncampaign.cpp (2.4):
|
||||
|
||||
Added new lib files: strmiids and ddraw to get dshow working Added
|
||||
new command line parameter to active direct show movie play:
|
||||
-dshowvid Uncommented movie_play calls and includes
|
||||
|
||||
2002-08-15 04:41 penguin
|
||||
|
||||
* code/globalincs/systemvars.h (2.1):
|
||||
|
||||
Added #include, needed for FRED
|
||||
|
||||
2002-08-13 03:40 penguin
|
||||
|
||||
|
||||
Binary file not shown.
@@ -0,0 +1,27 @@
|
||||
This is still in pretty rough form.
|
||||
|
||||
|
||||
=== for people building fs2_open:
|
||||
|
||||
Win32-MSVC:
|
||||
Use the Freespace2.dsw workspace and build within the IDE.
|
||||
|
||||
|
||||
Win32-MinGW:
|
||||
make
|
||||
|
||||
|
||||
Linux and other unix variants (NOT YET COMPLETE)
|
||||
./configure [options] (options tbd)
|
||||
make -f makefile.linux
|
||||
|
||||
|
||||
|
||||
=== for the project maintainers (people who need to
|
||||
=== keep the makefiles up to date):
|
||||
|
||||
aclocal
|
||||
autoconf
|
||||
automake
|
||||
./configure
|
||||
make
|
||||
@@ -0,0 +1,68 @@
|
||||
# Makefile.am for fs2_open (top level)
|
||||
#
|
||||
# This file uses GNU Automake to generate makefiles
|
||||
|
||||
SUBDIRS = libjpeg code
|
||||
|
||||
|
||||
EXTRA_DIST = \
|
||||
FS2OpenSCPReadMe.doc \
|
||||
projects/MSVC_2005/Freespace2.sln \
|
||||
projects/MSVC_2005/Freespace2.vcproj \
|
||||
projects/MSVC_2005/code.vcproj \
|
||||
projects/MSVC_6/Freespace2.dsp \
|
||||
projects/MSVC_6/Freespace2.dsw \
|
||||
projects/MSVC_6/code.dsp \
|
||||
projects/MSVC_6/libjpeg.dsp \
|
||||
projects/MSVC_6/wxFRED2.dsp \
|
||||
projects/anjuta1/FS2_Open.prj \
|
||||
projects/anjuta1/README
|
||||
|
||||
|
||||
# D_ variants are defaults and should always be used
|
||||
AM_CXXFLAGS = -I./code @D_CFLAGS@
|
||||
AM_LDFLAGS = @D_LDFLAGS@
|
||||
|
||||
EXTRA_PROGRAMS = cfilearchiver cfileextractor cryptstring scramble
|
||||
|
||||
###############################################################################
|
||||
##
|
||||
## Begin utilitites
|
||||
##
|
||||
|
||||
# cfilearchiver -- to create VPs
|
||||
cfilearchiver_SOURCES = \
|
||||
code/cfilearchiver/cfilearchiver.cpp
|
||||
|
||||
# cfileextractor -- to extract files from VPs
|
||||
cfileextractor_SOURCES = \
|
||||
code/cfileextractor/cfileextractor.cpp
|
||||
|
||||
# cryptstring -- to encrypt strings that are used as cheat codes
|
||||
cryptstring_SOURCES = \
|
||||
code/cryptstring/cryptstring.cpp
|
||||
|
||||
# scramble -- to encrypt tables
|
||||
scramble_SOURCES = \
|
||||
code/parse/encrypt.cpp \
|
||||
code/scramble/scramble.cpp \
|
||||
code/scramble/scramble.h
|
||||
|
||||
|
||||
# catch all to build utilitites
|
||||
tools: cfilearchiver cfileextractor cryptstring scramble
|
||||
|
||||
|
||||
# cleaning
|
||||
clean-tools:
|
||||
-test -z "$(EXTRA_PROGRAMS)" || rm -f $(EXTRA_PROGRAMS)
|
||||
|
||||
##
|
||||
## End utilitites
|
||||
##
|
||||
###############################################################################
|
||||
|
||||
|
||||
# make sure we get this stuff cleaned up
|
||||
clean-generic: clean-tools
|
||||
|
||||
@@ -0,0 +1,3 @@
|
||||
This file is required to keep autoconf/automake from complaining.
|
||||
|
||||
See the ChangeLog for what's new.
|
||||
+6
-79
@@ -1,81 +1,8 @@
|
||||
README for fs2_open, Release 0.1
|
||||
|
||||
WARNINGS:
|
||||
========
|
||||
This is very much an pre-alpha build. Don't expect too much from it!
|
||||
|
||||
In particular, do not run this in the same directory as existing pilot
|
||||
files or anything else that you don't want to get destroyed...
|
||||
|
||||
I have tried to modify as little code as possible to keep the existing
|
||||
Windows code from breaking, but I have not verified that this code
|
||||
will still work on Windows. Some changes may be necessary.
|
||||
|
||||
There are occasional crashes and segfaults from time to time.
|
||||
|
||||
All of this was tested on my system only. I don't know if any
|
||||
assumptions about my hardware have crept into the code. I guess it
|
||||
goes without saying that this will only work on x86-based Linux
|
||||
systems :-)
|
||||
The "projects" directory contains ready projects for:
|
||||
Microsoft Visual C++ 6
|
||||
Microsoft Visual C++ 2005
|
||||
Anjuta 1 (please see README with project before using)
|
||||
|
||||
|
||||
STATUS:
|
||||
=======
|
||||
Most 2D graphics appear to be working, although very slowly.
|
||||
Improving the performance of the 2D graphic system is a high priority.
|
||||
|
||||
3D graphics are in a very primitive state right now. No texturing is
|
||||
done, so all objects (ships, lasers, explosions, etc.) look "ghostly."
|
||||
|
||||
Nebula missions do not work at all.
|
||||
|
||||
Sound, joystick, and network are all disabled.
|
||||
|
||||
|
||||
REQUIREMENTS:
|
||||
=============
|
||||
The only "non-standard" package that you will need (as far as I can
|
||||
tell) is the SDL library, available at http://www.libsdl.org I think
|
||||
SDL requires XFree86 release 4 or higher.
|
||||
|
||||
|
||||
INSTALLING:
|
||||
===========
|
||||
There is no configure script, no options, etc. -- just a Makefile. It
|
||||
is likely that you will need to adjust it to match your configuration,
|
||||
in particular the location of the SDL files.
|
||||
|
||||
If everything is right, you should be able to run 'make' from the
|
||||
fs2_open/code directory and create an 'fs2' executable.
|
||||
|
||||
|
||||
RUNNING:
|
||||
========
|
||||
The fs2 executable should be copied (or symlinked) to the same
|
||||
directory as the *.VP files. All the *.VP files that you need should
|
||||
be here -- the code isn't smart enough to look in your CD for command
|
||||
brief ANIs, etc.
|
||||
|
||||
It only runs in windowed mode, no full screen.
|
||||
|
||||
I have never run it in high-resolution mode (1024x768), so all bets
|
||||
are off if you try it.
|
||||
|
||||
There seems to be a bug in some of the 'glob' routines that scan for
|
||||
files in the 'data' directory, so you will have better results if you:
|
||||
1. Keep everything in the *.VP file (i.e., no mods)
|
||||
2. Only have one player file
|
||||
|
||||
I recommend that background graphics be turned off via the "Options"
|
||||
screen or it will look very odd. Your in-game framerate will be
|
||||
significantly higher if you turn off (or set to 'popup') as many HUD
|
||||
gauges as possible.
|
||||
|
||||
Due to the painful slowness of the 2D UI, you might need to hold the
|
||||
mouse button down a little longer to get buttons to activate.
|
||||
|
||||
===
|
||||
|
||||
Mike Harris (HLP penguin)
|
||||
02 June 2002
|
||||
|
||||
See the ChangeLog to see what's new.
|
||||
See the INSTALL file for instructions on how to build fs2_open.
|
||||
@@ -0,0 +1,382 @@
|
||||
# Configure paths for SDL
|
||||
# Sam Lantinga 9/21/99
|
||||
# stolen from Manish Singh
|
||||
# stolen back from Frank Belew
|
||||
# stolen from Manish Singh
|
||||
# Shamelessly stolen from Owen Taylor
|
||||
|
||||
dnl AM_PATH_SDL([MINIMUM-VERSION, [ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND]]])
|
||||
dnl Test for SDL, and define SDL_CFLAGS and SDL_LIBS
|
||||
dnl
|
||||
AC_DEFUN([AM_PATH_SDL],
|
||||
[dnl
|
||||
dnl Get the cflags and libraries from the sdl-config script
|
||||
dnl
|
||||
AC_ARG_WITH(sdl-prefix,[ --with-sdl-prefix=PFX Prefix where SDL is installed (optional)],
|
||||
sdl_prefix="$withval", sdl_prefix="")
|
||||
AC_ARG_WITH(sdl-exec-prefix,[ --with-sdl-exec-prefix=PFX Exec prefix where SDL is installed (optional)],
|
||||
sdl_exec_prefix="$withval", sdl_exec_prefix="")
|
||||
AC_ARG_ENABLE(sdltest, [ --disable-sdltest Do not try to compile and run a test SDL program],
|
||||
, enable_sdltest=yes)
|
||||
|
||||
if test x$sdl_exec_prefix != x ; then
|
||||
sdl_args="$sdl_args --exec-prefix=$sdl_exec_prefix"
|
||||
if test x${SDL_CONFIG+set} != xset ; then
|
||||
SDL_CONFIG=$sdl_exec_prefix/bin/sdl-config
|
||||
fi
|
||||
fi
|
||||
if test x$sdl_prefix != x ; then
|
||||
sdl_args="$sdl_args --prefix=$sdl_prefix"
|
||||
if test x${SDL_CONFIG+set} != xset ; then
|
||||
SDL_CONFIG=$sdl_prefix/bin/sdl-config
|
||||
fi
|
||||
fi
|
||||
|
||||
AC_REQUIRE([AC_CANONICAL_TARGET])
|
||||
PATH="$prefix/bin:$prefix/usr/bin:$PATH"
|
||||
AC_PATH_PROG(SDL_CONFIG, sdl-config, no, [$PATH])
|
||||
min_sdl_version=ifelse([$1], ,0.11.0,$1)
|
||||
AC_MSG_CHECKING(for SDL - version >= $min_sdl_version)
|
||||
no_sdl=""
|
||||
if test "$SDL_CONFIG" = "no" ; then
|
||||
no_sdl=yes
|
||||
else
|
||||
SDL_CFLAGS=`$SDL_CONFIG $sdlconf_args --cflags`
|
||||
SDL_LIBS=`$SDL_CONFIG $sdlconf_args --libs`
|
||||
|
||||
sdl_major_version=`$SDL_CONFIG $sdl_args --version | \
|
||||
sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\1/'`
|
||||
sdl_minor_version=`$SDL_CONFIG $sdl_args --version | \
|
||||
sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\2/'`
|
||||
sdl_micro_version=`$SDL_CONFIG $sdl_config_args --version | \
|
||||
sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\3/'`
|
||||
if test "x$enable_sdltest" = "xyes" ; then
|
||||
ac_save_CFLAGS="$CFLAGS"
|
||||
ac_save_CXXFLAGS="$CXXFLAGS"
|
||||
ac_save_LIBS="$LIBS"
|
||||
CFLAGS="$CFLAGS $SDL_CFLAGS"
|
||||
CXXFLAGS="$CXXFLAGS $SDL_CFLAGS"
|
||||
LIBS="$LIBS $SDL_LIBS"
|
||||
dnl
|
||||
dnl Now check if the installed SDL is sufficiently new. (Also sanity
|
||||
dnl checks the results of sdl-config to some extent
|
||||
dnl
|
||||
rm -f conf.sdltest
|
||||
AC_TRY_RUN([
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#include "SDL.h"
|
||||
|
||||
char*
|
||||
my_strdup (char *str)
|
||||
{
|
||||
char *new_str;
|
||||
|
||||
if (str)
|
||||
{
|
||||
new_str = (char *)malloc ((strlen (str) + 1) * sizeof(char));
|
||||
strcpy (new_str, str);
|
||||
}
|
||||
else
|
||||
new_str = NULL;
|
||||
|
||||
return new_str;
|
||||
}
|
||||
|
||||
int main (int argc, char *argv[])
|
||||
{
|
||||
int major, minor, micro;
|
||||
char *tmp_version;
|
||||
|
||||
/* This hangs on some systems (?)
|
||||
system ("touch conf.sdltest");
|
||||
*/
|
||||
{ FILE *fp = fopen("conf.sdltest", "a"); if ( fp ) fclose(fp); }
|
||||
|
||||
/* HP/UX 9 (%@#!) writes to sscanf strings */
|
||||
tmp_version = my_strdup("$min_sdl_version");
|
||||
if (sscanf(tmp_version, "%d.%d.%d", &major, &minor, µ) != 3) {
|
||||
printf("%s, bad version string\n", "$min_sdl_version");
|
||||
exit(1);
|
||||
}
|
||||
|
||||
if (($sdl_major_version > major) ||
|
||||
(($sdl_major_version == major) && ($sdl_minor_version > minor)) ||
|
||||
(($sdl_major_version == major) && ($sdl_minor_version == minor) && ($sdl_micro_version >= micro)))
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
else
|
||||
{
|
||||
printf("\n*** 'sdl-config --version' returned %d.%d.%d, but the minimum version\n", $sdl_major_version, $sdl_minor_version, $sdl_micro_version);
|
||||
printf("*** of SDL required is %d.%d.%d. If sdl-config is correct, then it is\n", major, minor, micro);
|
||||
printf("*** best to upgrade to the required version.\n");
|
||||
printf("*** If sdl-config was wrong, set the environment variable SDL_CONFIG\n");
|
||||
printf("*** to point to the correct copy of sdl-config, and remove the file\n");
|
||||
printf("*** config.cache before re-running configure\n");
|
||||
return 1;
|
||||
}
|
||||
}
|
||||
|
||||
],, no_sdl=yes,[echo $ac_n "cross compiling; assumed OK... $ac_c"])
|
||||
CFLAGS="$ac_save_CFLAGS"
|
||||
CXXFLAGS="$ac_save_CXXFLAGS"
|
||||
LIBS="$ac_save_LIBS"
|
||||
fi
|
||||
fi
|
||||
if test "x$no_sdl" = x ; then
|
||||
AC_MSG_RESULT(yes)
|
||||
ifelse([$2], , :, [$2])
|
||||
else
|
||||
AC_MSG_RESULT(no)
|
||||
if test "$SDL_CONFIG" = "no" ; then
|
||||
echo "*** The sdl-config script installed by SDL could not be found"
|
||||
echo "*** If SDL was installed in PREFIX, make sure PREFIX/bin is in"
|
||||
echo "*** your path, or set the SDL_CONFIG environment variable to the"
|
||||
echo "*** full path to sdl-config."
|
||||
else
|
||||
if test -f conf.sdltest ; then
|
||||
:
|
||||
else
|
||||
echo "*** Could not run SDL test program, checking why..."
|
||||
CFLAGS="$CFLAGS $SDL_CFLAGS"
|
||||
CXXFLAGS="$CXXFLAGS $SDL_CFLAGS"
|
||||
LIBS="$LIBS $SDL_LIBS"
|
||||
AC_TRY_LINK([
|
||||
#include <stdio.h>
|
||||
#include "SDL.h"
|
||||
|
||||
int main(int argc, char *argv[])
|
||||
{ return 0; }
|
||||
#undef main
|
||||
#define main K_and_R_C_main
|
||||
], [ return 0; ],
|
||||
[ echo "*** The test program compiled, but did not run. This usually means"
|
||||
echo "*** that the run-time linker is not finding SDL or finding the wrong"
|
||||
echo "*** version of SDL. If it is not finding SDL, you'll need to set your"
|
||||
echo "*** LD_LIBRARY_PATH environment variable, or edit /etc/ld.so.conf to point"
|
||||
echo "*** to the installed location Also, make sure you have run ldconfig if that"
|
||||
echo "*** is required on your system"
|
||||
echo "***"
|
||||
echo "*** If you have an old version installed, it is best to remove it, although"
|
||||
echo "*** you may also be able to get things to work by modifying LD_LIBRARY_PATH"],
|
||||
[ echo "*** The test program failed to compile or link. See the file config.log for the"
|
||||
echo "*** exact error that occured. This usually means SDL was incorrectly installed"
|
||||
echo "*** or that you have moved SDL since it was installed. In the latter case, you"
|
||||
echo "*** may want to edit the sdl-config script: $SDL_CONFIG" ])
|
||||
CFLAGS="$ac_save_CFLAGS"
|
||||
CXXFLAGS="$ac_save_CXXFLAGS"
|
||||
LIBS="$ac_save_LIBS"
|
||||
fi
|
||||
fi
|
||||
SDL_CFLAGS=""
|
||||
SDL_LIBS=""
|
||||
ifelse([$3], , :, [$3])
|
||||
fi
|
||||
AC_SUBST(SDL_CFLAGS)
|
||||
AC_SUBST(SDL_LIBS)
|
||||
rm -f conf.sdltest
|
||||
])
|
||||
|
||||
|
||||
dnl ---------------------------------------------------------------------------
|
||||
dnl Macros for wxWindows detection. Typically used in configure.in as:
|
||||
dnl
|
||||
dnl AC_ARG_ENABLE(...)
|
||||
dnl AC_ARG_WITH(...)
|
||||
dnl ...
|
||||
dnl AM_OPTIONS_WXCONFIG
|
||||
dnl ...
|
||||
dnl ...
|
||||
dnl AM_PATH_WXCONFIG(2.3.4, wxWin=1)
|
||||
dnl if test "$wxWin" != 1; then
|
||||
dnl AC_MSG_ERROR([
|
||||
dnl wxWindows must be installed on your system
|
||||
dnl but wx-config script couldn't be found.
|
||||
dnl
|
||||
dnl Please check that wx-config is in path, the directory
|
||||
dnl where wxWindows libraries are installed (returned by
|
||||
dnl 'wx-config --libs' command) is in LD_LIBRARY_PATH or
|
||||
dnl equivalent variable and wxWindows version is 2.3.4 or above.
|
||||
dnl ])
|
||||
dnl fi
|
||||
dnl CPPFLAGS="$CPPFLAGS $WX_CPPFLAGS"
|
||||
dnl CXXFLAGS="$CXXFLAGS $WX_CXXFLAGS_ONLY"
|
||||
dnl CFLAGS="$CFLAGS $WX_CFLAGS_ONLY"
|
||||
dnl
|
||||
dnl LDFLAGS="$LDFLAGS $WX_LIBS"
|
||||
dnl ---------------------------------------------------------------------------
|
||||
|
||||
dnl ---------------------------------------------------------------------------
|
||||
dnl AM_OPTIONS_WXCONFIG
|
||||
dnl
|
||||
dnl adds support for --wx-prefix, --wx-exec-prefix and --wx-config
|
||||
dnl command line options
|
||||
dnl ---------------------------------------------------------------------------
|
||||
|
||||
AC_DEFUN([AM_OPTIONS_WXCONFIG],
|
||||
[
|
||||
AC_ARG_WITH(wx-prefix, [ --with-wx-prefix=PREFIX Prefix where wxWindows is installed (optional)],
|
||||
wx_config_prefix="$withval", wx_config_prefix="")
|
||||
AC_ARG_WITH(wx-exec-prefix,[ --with-wx-exec-prefix=PREFIX Exec prefix where wxWindows is installed (optional)],
|
||||
wx_config_exec_prefix="$withval", wx_config_exec_prefix="")
|
||||
AC_ARG_WITH(wx-config,[ --with-wx-config=CONFIG wx-config script to use (optional)],
|
||||
wx_config_name="$withval", wx_config_name="")
|
||||
])
|
||||
|
||||
dnl ---------------------------------------------------------------------------
|
||||
dnl AM_PATH_WXCONFIG(VERSION, [ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND]])
|
||||
dnl
|
||||
dnl Test for wxWindows, and define WX_C*FLAGS, WX_LIBS and WX_LIBS_STATIC
|
||||
dnl (the latter is for static linking against wxWindows). Set WX_CONFIG_NAME
|
||||
dnl environment variable to override the default name of the wx-config script
|
||||
dnl to use. Set WX_CONFIG_PATH to specify the full path to wx-config - in this
|
||||
dnl case the macro won't even waste time on tests for its existence.
|
||||
dnl ---------------------------------------------------------------------------
|
||||
|
||||
dnl
|
||||
dnl Get the cflags and libraries from the wx-config script
|
||||
dnl
|
||||
AC_DEFUN([AM_PATH_WXCONFIG],
|
||||
[
|
||||
dnl do we have wx-config name: it can be wx-config or wxd-config or ...
|
||||
if test x${WX_CONFIG_NAME+set} != xset ; then
|
||||
WX_CONFIG_NAME=wx-config
|
||||
fi
|
||||
if test "x$wx_config_name" != x ; then
|
||||
WX_CONFIG_NAME="$wx_config_name"
|
||||
fi
|
||||
|
||||
dnl deal with optional prefixes
|
||||
if test x$wx_config_exec_prefix != x ; then
|
||||
wx_config_args="$wx_config_args --exec-prefix=$wx_config_exec_prefix"
|
||||
WX_LOOKUP_PATH="$wx_config_exec_prefix/bin"
|
||||
fi
|
||||
if test x$wx_config_prefix != x ; then
|
||||
wx_config_args="$wx_config_args --prefix=$wx_config_prefix"
|
||||
WX_LOOKUP_PATH="$WX_LOOKUP_PATH:$wx_config_prefix/bin"
|
||||
fi
|
||||
|
||||
dnl don't search the PATH if WX_CONFIG_NAME is absolute filename
|
||||
if test -x "$WX_CONFIG_NAME" ; then
|
||||
AC_MSG_CHECKING(for wx-config)
|
||||
WX_CONFIG_PATH="$WX_CONFIG_NAME"
|
||||
AC_MSG_RESULT($WX_CONFIG_PATH)
|
||||
else
|
||||
AC_PATH_PROG(WX_CONFIG_PATH, $WX_CONFIG_NAME, no, "$WX_LOOKUP_PATH:$PATH")
|
||||
fi
|
||||
|
||||
if test "$WX_CONFIG_PATH" != "no" ; then
|
||||
WX_VERSION=""
|
||||
no_wx=""
|
||||
|
||||
min_wx_version=ifelse([$1], ,2.2.1,$1)
|
||||
AC_MSG_CHECKING(for wxWindows version >= $min_wx_version)
|
||||
|
||||
WX_CONFIG_WITH_ARGS="$WX_CONFIG_PATH $wx_config_args"
|
||||
|
||||
WX_VERSION=`$WX_CONFIG_WITH_ARGS --version`
|
||||
wx_config_major_version=`echo $WX_VERSION | \
|
||||
sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\1/'`
|
||||
wx_config_minor_version=`echo $WX_VERSION | \
|
||||
sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\2/'`
|
||||
wx_config_micro_version=`echo $WX_VERSION | \
|
||||
sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\3/'`
|
||||
|
||||
wx_requested_major_version=`echo $min_wx_version | \
|
||||
sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\1/'`
|
||||
wx_requested_minor_version=`echo $min_wx_version | \
|
||||
sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\2/'`
|
||||
wx_requested_micro_version=`echo $min_wx_version | \
|
||||
sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\3/'`
|
||||
|
||||
wx_ver_ok=""
|
||||
if test $wx_config_major_version -gt $wx_requested_major_version; then
|
||||
wx_ver_ok=yes
|
||||
else
|
||||
if test $wx_config_major_version -eq $wx_requested_major_version; then
|
||||
if test $wx_config_minor_version -gt $wx_requested_minor_version; then
|
||||
wx_ver_ok=yes
|
||||
else
|
||||
if test $wx_config_minor_version -eq $wx_requested_minor_version; then
|
||||
if test $wx_config_micro_version -ge $wx_requested_micro_version; then
|
||||
wx_ver_ok=yes
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
|
||||
if test "x$wx_ver_ok" = x ; then
|
||||
no_wx=yes
|
||||
else
|
||||
WX_LIBS=`$WX_CONFIG_WITH_ARGS --libs`
|
||||
WX_LIBS_STATIC=`$WX_CONFIG_WITH_ARGS --static --libs`
|
||||
|
||||
dnl starting with version 2.2.6 wx-config has --cppflags argument
|
||||
wx_has_cppflags=""
|
||||
if test $wx_config_major_version -gt 2; then
|
||||
wx_has_cppflags=yes
|
||||
else
|
||||
if test $wx_config_major_version -eq 2; then
|
||||
if test $wx_config_minor_version -gt 2; then
|
||||
wx_has_cppflags=yes
|
||||
else
|
||||
if test $wx_config_minor_version -eq 2; then
|
||||
if test $wx_config_micro_version -ge 6; then
|
||||
wx_has_cppflags=yes
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
|
||||
if test "x$wx_has_cppflags" = x ; then
|
||||
dnl no choice but to define all flags like CFLAGS
|
||||
WX_CFLAGS=`$WX_CONFIG_WITH_ARGS --cflags`
|
||||
WX_CPPFLAGS=$WX_CFLAGS
|
||||
WX_CXXFLAGS=$WX_CFLAGS
|
||||
|
||||
WX_CFLAGS_ONLY=$WX_CFLAGS
|
||||
WX_CXXFLAGS_ONLY=$WX_CFLAGS
|
||||
else
|
||||
dnl we have CPPFLAGS included in CFLAGS included in CXXFLAGS
|
||||
WX_CPPFLAGS=`$WX_CONFIG_WITH_ARGS --cppflags`
|
||||
WX_CXXFLAGS=`$WX_CONFIG_WITH_ARGS --cxxflags`
|
||||
WX_CFLAGS=`$WX_CONFIG_WITH_ARGS --cflags`
|
||||
|
||||
WX_CFLAGS_ONLY=`echo $WX_CFLAGS | sed "s@^$WX_CPPFLAGS *@@"`
|
||||
WX_CXXFLAGS_ONLY=`echo $WX_CXXFLAGS | sed "s@^$WX_CFLAGS *@@"`
|
||||
fi
|
||||
fi
|
||||
|
||||
if test "x$no_wx" = x ; then
|
||||
AC_MSG_RESULT(yes (version $WX_VERSION))
|
||||
ifelse([$2], , :, [$2])
|
||||
else
|
||||
if test "x$WX_VERSION" = x; then
|
||||
dnl no wx-config at all
|
||||
AC_MSG_RESULT(no)
|
||||
else
|
||||
AC_MSG_RESULT(no (version $WX_VERSION is not new enough))
|
||||
fi
|
||||
|
||||
WX_CFLAGS=""
|
||||
WX_CPPFLAGS=""
|
||||
WX_CXXFLAGS=""
|
||||
WX_LIBS=""
|
||||
WX_LIBS_STATIC=""
|
||||
ifelse([$3], , :, [$3])
|
||||
fi
|
||||
fi
|
||||
|
||||
AC_SUBST(WX_CPPFLAGS)
|
||||
AC_SUBST(WX_CFLAGS)
|
||||
AC_SUBST(WX_CXXFLAGS)
|
||||
AC_SUBST(WX_CFLAGS_ONLY)
|
||||
AC_SUBST(WX_CXXFLAGS_ONLY)
|
||||
AC_SUBST(WX_LIBS)
|
||||
AC_SUBST(WX_LIBS_STATIC)
|
||||
AC_SUBST(WX_VERSION)
|
||||
])
|
||||
Executable
+137
@@ -0,0 +1,137 @@
|
||||
#!/bin/sh
|
||||
# Run this to generate all the initial makefiles, etc.
|
||||
|
||||
srcdir=`dirname $0`
|
||||
PKG_NAME="fs2_open"
|
||||
|
||||
# check the version of a package
|
||||
check_version() {
|
||||
COMMAND=$1
|
||||
MAJOR=$2
|
||||
MINOR=$3
|
||||
MICRO=$4
|
||||
|
||||
($COMMAND --version) </dev/null >/dev/null 2>&1 || return 1
|
||||
|
||||
ver=`$COMMAND --version|head -n 1|sed 's/^.*) //'|sed 's/ (.*)//'`
|
||||
major=`echo $ver | cut -d. -f1 | sed s/[a-zA-Z\-].*//g`
|
||||
minor=`echo $ver | cut -d. -f2 | sed s/[a-zA-Z\-].*//g`
|
||||
micro=`echo $ver | cut -d. -f3 | sed s/[a-zA-Z\-].*//g`
|
||||
test -z "$major" && major=0
|
||||
test -z "$minor" && minor=0
|
||||
test -z "$micro" && micro=0
|
||||
|
||||
fail=0
|
||||
if [ ! "$major" -gt "$MAJOR" ]; then
|
||||
if [ "$major" -lt "$MAJOR" ]; then
|
||||
fail=1
|
||||
elif [ ! "$minor" -gt "$MINOR" ]; then
|
||||
if [ "$minor" -lt "$MINOR" ]; then
|
||||
fail=1
|
||||
elif [ "$micro" -lt "$MICRO" ]; then
|
||||
fail=1
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
|
||||
return "$fail"
|
||||
}
|
||||
|
||||
AUTOMAKE=
|
||||
ACLOCAL=
|
||||
DIE=0
|
||||
|
||||
(autoconf --version) < /dev/null > /dev/null 2>&1 || {
|
||||
echo
|
||||
echo "**Error**: You must have \`autoconf' installed to."
|
||||
echo "Download the appropriate package for your distribution,"
|
||||
echo "or get the source tarball at ftp://ftp.gnu.org/pub/gnu/"
|
||||
DIE=1
|
||||
}
|
||||
|
||||
for AM in automake-1.9 automake-1.8 automake-1.7 automake-1.6 automake; do
|
||||
(check_version "$AM" 1 6 1) && {
|
||||
AUTOMAKE="$AM"
|
||||
break
|
||||
}
|
||||
done
|
||||
|
||||
if [ -z "$AUTOMAKE" ]; then
|
||||
echo
|
||||
echo "**Error**: You must have \`automake' version 1.6.1 or greater"
|
||||
echo "installed to compile $PKG_NAME. Download the appropriate package"
|
||||
echo "for your distribution, or get the source tarball at"
|
||||
echo "ftp://ftp.gnu.org/pub/gnu/"
|
||||
DIE=1
|
||||
fi
|
||||
|
||||
# if no automake, don't bother testing for aclocal
|
||||
test -z "$AUTOMAKE" || {
|
||||
for ACL in aclocal-1.9 aclocal-1.8 aclocal-1.7 aclocal-1.6 aclocal; do
|
||||
(check_version "$ACL" 1 6 1) && {
|
||||
ACLOCAL="$ACL"
|
||||
break
|
||||
}
|
||||
done
|
||||
|
||||
if [ -z "$ACLOCAL" ]; then
|
||||
echo
|
||||
echo "**Error**: Missing \`aclocal'. The version of \`automake'"
|
||||
echo "installed seems to be outdated. Get a recent package from"
|
||||
echo "ftp://ftp.gnu.org/pub/gnu/"
|
||||
DIE=1
|
||||
fi
|
||||
}
|
||||
|
||||
if test "$DIE" -eq 1; then
|
||||
exit 1
|
||||
fi
|
||||
|
||||
if test -z "$*"; then
|
||||
echo "**Warning**: I am going to run \`configure' with no arguments."
|
||||
echo "If you wish to pass any to it, please specify them on the"
|
||||
echo \`$0\'" command line."
|
||||
echo
|
||||
fi
|
||||
|
||||
case $CC in
|
||||
xlc )
|
||||
am_opt=--include-deps;;
|
||||
esac
|
||||
|
||||
for coin in `find $srcdir -name configure.ac -print`
|
||||
do
|
||||
dr=`dirname $coin`
|
||||
if test -f $dr/NO-AUTO-GEN; then
|
||||
echo skipping $dr -- flagged as no auto-gen
|
||||
else
|
||||
echo processing $dr
|
||||
macrodirs=`sed -n -e 's,AM_ACLOCAL_INCLUDE(\(.*\)),\1,gp' < $coin`
|
||||
( cd $dr
|
||||
aclocalinclude="$ACLOCAL_FLAGS"
|
||||
for k in $macrodirs; do
|
||||
if test -d $k; then
|
||||
aclocalinclude="$aclocalinclude -I $k"
|
||||
##else
|
||||
## echo "**Warning**: No such directory \`$k'. Ignored."
|
||||
fi
|
||||
done
|
||||
echo "Running $ACLOCAL $aclocalinclude ..."
|
||||
"$ACLOCAL" $aclocalinclude
|
||||
echo "Running $AUTOMAKE --add-missing --copy --foreign $am_opt ..."
|
||||
"$AUTOMAKE" --add-missing --copy --foreign $am_opt
|
||||
echo "Running autoconf..."
|
||||
autoconf
|
||||
)
|
||||
fi
|
||||
done
|
||||
|
||||
#conf_flags="--enable-maintainer-mode --enable-compile-warnings" #--enable-iso-c
|
||||
|
||||
if test x$NOCONFIGURE = x; then
|
||||
echo Running $srcdir/configure $conf_flags "$@" ...
|
||||
$srcdir/configure $conf_flags "$@" \
|
||||
&& echo Now type \`make\' to compile $PKG_NAME.
|
||||
else
|
||||
echo Skipping configure process.
|
||||
fi
|
||||
@@ -0,0 +1,5 @@
|
||||
Makefile
|
||||
Makefile.in
|
||||
fs2_open_d
|
||||
fs2_open_r
|
||||
.deps
|
||||
@@ -1,700 +0,0 @@
|
||||
TARGET = fs2
|
||||
|
||||
ifeq ($(USE_SOUND), 1)
|
||||
SOUND_DEF=
|
||||
SOUND_OBJS= \
|
||||
gamesnd/eventmusic.o \
|
||||
gamesnd/gamesnd.o \
|
||||
object/objectsnd.o \
|
||||
sound/acm.o \
|
||||
sound/audiostr.o \
|
||||
sound/ds.o \
|
||||
sound/ds3d.o \
|
||||
sound/dscap.o \
|
||||
sound/midifile.o \
|
||||
sound/rbaudio.o \
|
||||
sound/rtvoice.o \
|
||||
sound/sound.o \
|
||||
sound/winmidi.o \
|
||||
sound/winmidi_base.o \
|
||||
vcodec/codec1.o
|
||||
else
|
||||
SOUND_DEF=-DNO_SOUND
|
||||
SOUND_OBJS=
|
||||
endif # USE_SOUND
|
||||
|
||||
|
||||
ifeq ($(USE_JOYSTICK), 1)
|
||||
JOYSTICK_DEF=
|
||||
JOYSTICK_OBJS= \
|
||||
io/joy.o \
|
||||
io/joy_ff.o \
|
||||
io/swff_lib.o
|
||||
else
|
||||
JOYSTICK_DEF=-DNO_JOYSTICK
|
||||
JOYSTICK_OBJS=
|
||||
endif # USE_JOYSTICK
|
||||
|
||||
|
||||
ifeq ($(USE_NETWORK), 1)
|
||||
# no support for standalone server yet... (UI is Win32 specific)
|
||||
NETWORK_DEF=-DNO_STANDALONE
|
||||
NETWORK_OBJS= \
|
||||
hud/hudobserver.o \
|
||||
network/multi.o \
|
||||
network/multimsgs.o \
|
||||
network/multiteamselect.o \
|
||||
network/multiui.o \
|
||||
network/multiutil.o \
|
||||
network/multi_campaign.o \
|
||||
network/multi_data.o \
|
||||
network/multi_dogfight.o \
|
||||
network/multi_endgame.o \
|
||||
network/multi_ingame.o \
|
||||
network/multi_kick.o \
|
||||
network/multi_log.o \
|
||||
network/multi_obj.o \
|
||||
network/multi_observer.o \
|
||||
network/multi_options.o \
|
||||
network/multi_pause.o \
|
||||
network/multi_pinfo.o \
|
||||
network/multi_ping.o \
|
||||
network/multi_pmsg.o \
|
||||
network/multi_rate.o \
|
||||
network/multi_respawn.o \
|
||||
network/multi_team.o \
|
||||
network/multi_voice.o \
|
||||
network/multi_xfer.o \
|
||||
network/psnet.o \
|
||||
network/psnet2.o \
|
||||
menuui/optionsmenumulti.o \
|
||||
missionui/chatbox.o
|
||||
#
|
||||
# Network/stand_gui.o
|
||||
#
|
||||
else
|
||||
NETWORK_DEF=-DNO_NETWORK -DNO_STANDALONE
|
||||
NETWORK_OBJS=
|
||||
endif # USE_NETWORK
|
||||
|
||||
|
||||
ifeq ($(USE_OPENGL), 0)
|
||||
OPENGL_DEF=
|
||||
else
|
||||
OPENGL_DEF=-DUSE_OPENGL
|
||||
endif # USE_OPENGL
|
||||
|
||||
|
||||
LDFLAGS = -g
|
||||
LDLIBS = -L/usr/X11R6/lib -lSDL -lGL -lGLU -lpthread
|
||||
|
||||
CXXFLAGS = \
|
||||
-g \
|
||||
-I/usr/local/include/SDL \
|
||||
-I. \
|
||||
-fno-exceptions \
|
||||
-D_DEBUG -DNO_CD_CHECK -UNDEBUG \
|
||||
-DNO_DIRECT3D $(SOUND_DEF) $(JOYSTICK_DEF) $(NETWORK_DEF) $(OPENGL_DEF)
|
||||
|
||||
ANIM_OBJFILES = \
|
||||
anim/animplay.o \
|
||||
anim/packunpack.o
|
||||
|
||||
ASTEROID_OBJFILES = \
|
||||
asteroid/asteroid.o
|
||||
|
||||
BMPMAN_OBJFILES = \
|
||||
bmpman/bmpman.o
|
||||
|
||||
CFILE_OBJFILES = \
|
||||
cfile/cfile.o \
|
||||
cfile/cfilearchive.o \
|
||||
cfile/cfilelist.o \
|
||||
cfile/cfilesystem.o
|
||||
|
||||
CMDLINE_OBJFILES = \
|
||||
cmdline/cmdline.o
|
||||
|
||||
CMEASURE_OBJFILES = \
|
||||
cmeasure/cmeasure.o
|
||||
|
||||
CONTROLCONFIG_OBJFILES = \
|
||||
controlconfig/controlsconfig.o \
|
||||
controlconfig/controlsconfigcommon.o
|
||||
|
||||
CUTSCENE_OBJFILES = \
|
||||
cutscene/cutscenes.o
|
||||
|
||||
DEBRIS_OBJFILES = \
|
||||
debris/debris.o
|
||||
|
||||
DEBUGCONSOLE_OBJFILES = \
|
||||
debugconsole/console.o
|
||||
|
||||
DEMO_OBJFILES = \
|
||||
demo/demo.o
|
||||
|
||||
EXCEPTIONHANDLER_OBJFILES = \
|
||||
exceptionhandler/exceptionhandler.o
|
||||
|
||||
FIREBALL_OBJFILES = \
|
||||
fireball/fireballs.o \
|
||||
fireball/warpineffect.o
|
||||
|
||||
GAMEHELP_OBJFILES = \
|
||||
gamehelp/contexthelp.o \
|
||||
gamehelp/gameplayhelp.o
|
||||
|
||||
GAMESEQUENCE_OBJFILES = \
|
||||
gamesequence/gamesequence.o
|
||||
|
||||
# gamesnd/eventmusic.o
|
||||
# gamesnd/gamesnd.o
|
||||
GAMESND_OBJFILES =
|
||||
|
||||
# glide/glide.o
|
||||
GLIDE_OBJFILES =
|
||||
|
||||
# globalincs/windebug.o
|
||||
GLOBALINCS_OBJFILES = \
|
||||
globalincs/alphacolors.o \
|
||||
globalincs/crypt.o \
|
||||
globalincs/systemvars.o \
|
||||
globalincs/version.o
|
||||
|
||||
# graphics/grd3d.o
|
||||
# graphics/grd3drender.o
|
||||
# graphics/grd3dtexture.o
|
||||
# graphics/grdirectdraw.o
|
||||
# graphics/grglide.o
|
||||
# graphics/grglidetexture.o
|
||||
# graphics/grsoft.o
|
||||
# graphics/scaler.o
|
||||
# graphics/tmapgenericscans.o
|
||||
# graphics/tmapscantiled128x128.o
|
||||
# graphics/tmapscantiled16x16.o
|
||||
# graphics/tmapscantiled256x256.o
|
||||
# graphics/tmapscantiled32x32.o
|
||||
# graphics/tmapscantiled64x64.o
|
||||
# graphics/tmapscanline.o
|
||||
# graphics/tmapper.o
|
||||
GRAPHICS_OBJFILES = \
|
||||
graphics/2d.o \
|
||||
graphics/aaline.o \
|
||||
graphics/bitblt.o \
|
||||
graphics/circle.o \
|
||||
graphics/colors.o \
|
||||
graphics/font.o \
|
||||
graphics/gradient.o \
|
||||
graphics/gropengl.o \
|
||||
graphics/grzbuffer.o \
|
||||
graphics/line.o \
|
||||
graphics/pixel.o \
|
||||
graphics/rect.o \
|
||||
graphics/shade.o
|
||||
|
||||
# hud/hudobserver.o
|
||||
HUD_OBJFILES = \
|
||||
hud/hud.o \
|
||||
hud/hudartillery.o \
|
||||
hud/hudbrackets.o \
|
||||
hud/hudconfig.o \
|
||||
hud/hudescort.o \
|
||||
hud/hudets.o \
|
||||
hud/hudlock.o \
|
||||
hud/hudmessage.o \
|
||||
hud/hudreticle.o \
|
||||
hud/hudshield.o \
|
||||
hud/hudsquadmsg.o \
|
||||
hud/hudtarget.o \
|
||||
hud/hudtargetbox.o \
|
||||
hud/hudwingmanstatus.o
|
||||
|
||||
INETFILE_OBJFILES = \
|
||||
inetfile/cftp.o \
|
||||
inetfile/chttpget.o \
|
||||
inetfile/inetgetfile.o
|
||||
|
||||
# io/joy.o
|
||||
# io/joy_ff.o
|
||||
# io/swff_lib.o
|
||||
IO_OBJFILES = \
|
||||
io/key.o \
|
||||
io/keycontrol.o \
|
||||
io/mouse.o \
|
||||
io/timer.o \
|
||||
io/xmouse.o
|
||||
|
||||
JUMPNODE_OBJFILES = \
|
||||
jumpnode/jumpnode.o
|
||||
|
||||
LIGHTING_OBJFILES = \
|
||||
lighting/lighting.o
|
||||
|
||||
LOCALIZATION_OBJFILES = \
|
||||
localization/fhash.o \
|
||||
localization/localize.o
|
||||
|
||||
MATH_OBJFILES = \
|
||||
math/fix.o \
|
||||
math/floating.o \
|
||||
math/fvi.o \
|
||||
math/spline.o \
|
||||
math/staticrand.o \
|
||||
math/vecmat.o
|
||||
|
||||
# menuui/optionsmenumulti.o
|
||||
MENUUI_OBJFILES = \
|
||||
menuui/barracks.o \
|
||||
menuui/credits.o \
|
||||
menuui/fishtank.o \
|
||||
menuui/mainhallmenu.o \
|
||||
menuui/mainhalltemp.o \
|
||||
menuui/optionsmenu.o \
|
||||
menuui/playermenu.o \
|
||||
menuui/readyroom.o \
|
||||
menuui/snazzyui.o \
|
||||
menuui/techmenu.o \
|
||||
menuui/trainingmenu.o
|
||||
|
||||
MISSION_OBJFILES = \
|
||||
mission/missionbriefcommon.o \
|
||||
mission/missioncampaign.o \
|
||||
mission/missiongoals.o \
|
||||
mission/missiongrid.o \
|
||||
mission/missionhotkey.o \
|
||||
mission/missionload.o \
|
||||
mission/missionlog.o \
|
||||
mission/missionmessage.o \
|
||||
mission/missionparse.o \
|
||||
mission/missiontraining.o
|
||||
|
||||
# missionui/chatbox.o
|
||||
MISSIONUI_OBJFILES = \
|
||||
missionui/missionbrief.o \
|
||||
missionui/missioncmdbrief.o \
|
||||
missionui/missiondebrief.o \
|
||||
missionui/missionloopbrief.o \
|
||||
missionui/missionpause.o \
|
||||
missionui/missionrecommend.o \
|
||||
missionui/missionscreencommon.o \
|
||||
missionui/missionshipchoice.o \
|
||||
missionui/missionstats.o \
|
||||
missionui/missionweaponchoice.o \
|
||||
missionui/redalert.o
|
||||
|
||||
MODEL_OBJFILES = \
|
||||
model/modelcollide.o \
|
||||
model/modelinterp.o \
|
||||
model/modeloctant.o \
|
||||
model/modelread.o
|
||||
|
||||
NEBULA_OBJFILES = \
|
||||
nebula/neb.o \
|
||||
nebula/neblightning.o
|
||||
|
||||
# network/multi.o
|
||||
# network/multi_campaign.o
|
||||
# network/multi_data.o
|
||||
# network/multi_dogfight.o
|
||||
# network/multi_endgame.o
|
||||
# network/multi_ingame.o
|
||||
# network/multi_kick.o
|
||||
# network/multi_log.o
|
||||
# network/multimsgs.o
|
||||
# network/multi_obj.o
|
||||
# network/multi_observer.o
|
||||
# network/multi_oo.o
|
||||
# network/multi_options.o
|
||||
# network/multi_pause.o
|
||||
# network/multi_pinfo.o
|
||||
# network/multi_ping.o
|
||||
# network/multi_pmsg.o
|
||||
# network/multi_rate.o
|
||||
# network/multi_respawn.o
|
||||
# network/multi_team.o
|
||||
# network/multi_update.o
|
||||
# network/multi_voice.o
|
||||
# network/multi_xfer.o
|
||||
# network/multilag.o
|
||||
# network/multiteamselect.o
|
||||
# network/multiui.o
|
||||
# network/psnet.o
|
||||
# network/psnet2.o
|
||||
# network/stand_gui.o
|
||||
NETWORK_OBJFILES = \
|
||||
network/multiutil.o
|
||||
|
||||
# object/objectsnd.o
|
||||
OBJECT_OBJFILES = \
|
||||
object/collidedebrisship.o \
|
||||
object/collidedebrisweapon.o \
|
||||
object/collideshipship.o \
|
||||
object/collideshipweapon.o \
|
||||
object/collideweaponweapon.o \
|
||||
object/objcollide.o \
|
||||
object/object.o \
|
||||
object/objectsort.o
|
||||
|
||||
OBSERVER_OBJFILES = \
|
||||
observer/observer.o
|
||||
|
||||
OSAPI_OBJFILES = \
|
||||
osapi/osapi_unix.o \
|
||||
osapi/osregistry_unix.o \
|
||||
osapi/outwnd_unix.o
|
||||
|
||||
PALMAN_OBJFILES = \
|
||||
palman/palman.o
|
||||
|
||||
PARSE_OBJFILES = \
|
||||
parse/encrypt.o \
|
||||
parse/parselo.o \
|
||||
parse/sexp.o
|
||||
|
||||
PARTICLE_OBJFILES = \
|
||||
particle/particle.o
|
||||
|
||||
PCXUTILS_OBJFILES = \
|
||||
pcxutils/pcxutils.o
|
||||
|
||||
PHYSICS_OBJFILES = \
|
||||
physics/physics.o
|
||||
|
||||
PLAYERMAN_OBJFILES = \
|
||||
playerman/managepilot.o \
|
||||
playerman/playercontrol.o
|
||||
|
||||
POPUP_OBJFILES = \
|
||||
popup/popup.o \
|
||||
popup/popupdead.o
|
||||
|
||||
RADAR_OBJFILES = \
|
||||
radar/radar.o
|
||||
|
||||
RENDER_OBJFILES = \
|
||||
render/3dclipper.o \
|
||||
render/3ddraw.o \
|
||||
render/3dlaser.o \
|
||||
render/3dmath.o \
|
||||
render/3dsetup.o
|
||||
|
||||
SHIP_OBJFILES = \
|
||||
ship/afterburner.o \
|
||||
ship/ai.o \
|
||||
ship/aibig.o \
|
||||
ship/aicode.o \
|
||||
ship/aigoals.o \
|
||||
ship/awacs.o \
|
||||
ship/shield.o \
|
||||
ship/ship.o \
|
||||
ship/shipcontrails.o \
|
||||
ship/shipfx.o \
|
||||
ship/shiphit.o
|
||||
|
||||
SOUND_OBJFILES = \
|
||||
sound/acm.o \
|
||||
sound/audiostr.o \
|
||||
sound/ds.o \
|
||||
sound/ds3d.o \
|
||||
sound/dscap.o \
|
||||
sound/midifile.o \
|
||||
sound/rbaudio.o \
|
||||
sound/rtvoice.o \
|
||||
sound/sound.o \
|
||||
sound/winmidi.o \
|
||||
sound/winmidi_base.o
|
||||
|
||||
STARFIELD_OBJFILES = \
|
||||
starfield/nebula.o \
|
||||
starfield/starfield.o \
|
||||
starfield/supernova.o
|
||||
|
||||
STATS_OBJFILES = \
|
||||
stats/medals.o \
|
||||
stats/scoring.o \
|
||||
stats/stats.o
|
||||
|
||||
TGAUTILS_OBJFILES = \
|
||||
tgautils/tgautils.o
|
||||
|
||||
UI_OBJFILES = \
|
||||
ui/button.o \
|
||||
ui/checkbox.o \
|
||||
ui/gadget.o \
|
||||
ui/icon.o \
|
||||
ui/inputbox.o \
|
||||
ui/keytrap.o \
|
||||
ui/listbox.o \
|
||||
ui/radio.o \
|
||||
ui/scroll.o \
|
||||
ui/slider.o \
|
||||
ui/slider2.o \
|
||||
ui/uidraw.o \
|
||||
ui/uimouse.o \
|
||||
ui/window.o
|
||||
|
||||
VCODEC_OBJFILES = \
|
||||
vcodec/codec1.o
|
||||
|
||||
WEAPON_OBJFILES = \
|
||||
weapon/beam.o \
|
||||
weapon/corkscrew.o \
|
||||
weapon/emp.o \
|
||||
weapon/flak.o \
|
||||
weapon/muzzleflash.o \
|
||||
weapon/shockwave.o \
|
||||
weapon/swarm.o \
|
||||
weapon/trails.o \
|
||||
weapon/weapons.o
|
||||
|
||||
# SOUND_OBJFILES
|
||||
# INETFILE_OBJFILES
|
||||
# EXCEPTIONHANDLER_OBJFILES
|
||||
OBJFILES = \
|
||||
ANIM_OBJFILES \
|
||||
ASTEROID_OBJFILES \
|
||||
BMPMAN_OBJFILES \
|
||||
CFILE_OBJFILES \
|
||||
CMDLINE_OBJFILES \
|
||||
CMEASURE_OBJFILES \
|
||||
CONTROLCONFIG_OBJFILES \
|
||||
CUTSCENE_OBJFILES \
|
||||
DEBRIS_OBJFILES \
|
||||
DEBUGCONSOLE_OBJFILES \
|
||||
FIREBALL_OBJFILES \
|
||||
GAMEHELP_OBJFILES \
|
||||
GAMESEQUENCE_OBJFILES \
|
||||
GAMESND_OBJFILES \
|
||||
GLIDE_OBJFILES \
|
||||
GLOBALINCS_OBJFILES \
|
||||
GRAPHICS_OBJFILES \
|
||||
HUD_OBJFILES \
|
||||
IO_OBJFILES \
|
||||
JUMPNODE_OBJFILES \
|
||||
LIGHTING_OBJFILES \
|
||||
MATH_OBJFILES \
|
||||
MENUUI_OBJFILES \
|
||||
MISSION_OBJFILES \
|
||||
MISSIONUI_OBJFILES \
|
||||
MODEL_OBJFILES \
|
||||
NETWORK_OBJFILES \
|
||||
OBJECT_OBJFILES \
|
||||
OBSERVER_OBJFILES \
|
||||
OSAPI_OBJFILES \
|
||||
PALMAN_OBJFILES \
|
||||
PARSE_OBJFILES \
|
||||
PARTICLE_OBJFILES \
|
||||
PCXUTILS_OBJFILES \
|
||||
PHYSICS_OBJFILES \
|
||||
PLAYERMAN_OBJFILES \
|
||||
POPUP_OBJFILES \
|
||||
RADAR_OBJFILES \
|
||||
RENDER_OBJFILES \
|
||||
SHIP_OBJFILES \
|
||||
STARFIELD_OBJFILES \
|
||||
STATS_OBJFILES \
|
||||
UI_OBJFILES \
|
||||
VCODEC_OBJFILES \
|
||||
WEAPON_OBJFILES \
|
||||
NEBULA_OBJFILES \
|
||||
LOCALIZATION_OBJFILES \
|
||||
TGAUTILS_OBJFILES \
|
||||
DEMO_OBJFILES
|
||||
|
||||
# SOUND_OBJFILES
|
||||
# INETFILE_OBJFILES
|
||||
# EXCEPTIONHANDLER_OBJFILES
|
||||
LIB_OBJFILES = \
|
||||
$(ANIM_OBJFILES) \
|
||||
$(ASTEROID_OBJFILES) \
|
||||
$(BMPMAN_OBJFILES) \
|
||||
$(CFILE_OBJFILES) \
|
||||
$(CMDLINE_OBJFILES) \
|
||||
$(CMEASURE_OBJFILES) \
|
||||
$(CONTROLCONFIG_OBJFILES) \
|
||||
$(CUTSCENE_OBJFILES) \
|
||||
$(DEBRIS_OBJFILES) \
|
||||
$(DEBUGCONSOLE_OBJFILES) \
|
||||
$(FIREBALL_OBJFILES) \
|
||||
$(GAMEHELP_OBJFILES) \
|
||||
$(GAMESEQUENCE_OBJFILES) \
|
||||
$(GAMESND_OBJFILES) \
|
||||
$(GLIDE_OBJFILES) \
|
||||
$(GLOBALINCS_OBJFILES) \
|
||||
$(GRAPHICS_OBJFILES) \
|
||||
$(HUD_OBJFILES) \
|
||||
$(IO_OBJFILES) \
|
||||
$(JUMPNODE_OBJFILES) \
|
||||
$(LIGHTING_OBJFILES) \
|
||||
$(MATH_OBJFILES) \
|
||||
$(MENUUI_OBJFILES) \
|
||||
$(MISSION_OBJFILES) \
|
||||
$(MISSIONUI_OBJFILES) \
|
||||
$(MODEL_OBJFILES) \
|
||||
$(NETWORK_OBJFILES) \
|
||||
$(OBJECT_OBJFILES) \
|
||||
$(OBSERVER_OBJFILES) \
|
||||
$(OSAPI_OBJFILES) \
|
||||
$(PALMAN_OBJFILES) \
|
||||
$(PARSE_OBJFILES) \
|
||||
$(PARTICLE_OBJFILES) \
|
||||
$(PCXUTILS_OBJFILES) \
|
||||
$(PHYSICS_OBJFILES) \
|
||||
$(PLAYERMAN_OBJFILES) \
|
||||
$(POPUP_OBJFILES) \
|
||||
$(RADAR_OBJFILES) \
|
||||
$(RENDER_OBJFILES) \
|
||||
$(SHIP_OBJFILES) \
|
||||
$(STARFIELD_OBJFILES) \
|
||||
$(STATS_OBJFILES) \
|
||||
$(UI_OBJFILES) \
|
||||
$(VCODEC_OBJFILES) \
|
||||
$(WEAPON_OBJFILES) \
|
||||
$(NEBULA_OBJFILES) \
|
||||
$(LOCALIZATION_OBJFILES) \
|
||||
$(TGAUTILS_OBJFILES) \
|
||||
$(DEMO_OBJFILES) \
|
||||
$(SOUND_OBJS) \
|
||||
$(JOYSTICK_OBJS) \
|
||||
$(NETWORK_OBJS)
|
||||
|
||||
FREESPACE2_OBJFILES = \
|
||||
freespace2/freespace.o \
|
||||
freespace2/levelpaging.o
|
||||
|
||||
STUB_OBJFILES = \
|
||||
windows_stub/stubs.o
|
||||
|
||||
# ==============================
|
||||
.PHONY: all clean code \
|
||||
ANIM_OBJFILES \
|
||||
ASTEROID_OBJFILES \
|
||||
BMPMAN_OBJFILES \
|
||||
CMDLINE_OBJFILES \
|
||||
CMEASURE_OBJFILES \
|
||||
CONTROLCONFIG_OBJFILES \
|
||||
CUTSCENE_OBJFILES \
|
||||
DEBRIS_OBJFILES \
|
||||
DEBUGCONSOLE_OBJFILES \
|
||||
FIREBALL_OBJFILES \
|
||||
GAMEHELP_OBJFILES \
|
||||
GAMESEQUENCE_OBJFILES \
|
||||
GAMESND_OBJFILES \
|
||||
GLIDE_OBJFILES \
|
||||
GLOBALINCS_OBJFILES \
|
||||
GRAPHICS_OBJFILES \
|
||||
HUD_OBJFILES \
|
||||
IO_OBJFILES \
|
||||
JUMPNODE_OBJFILES \
|
||||
LIGHTING_OBJFILES \
|
||||
MATH_OBJFILES \
|
||||
MENUUI_OBJFILES \
|
||||
MISSION_OBJFILES \
|
||||
MISSIONUI_OBJFILES \
|
||||
MODEL_OBJFILES \
|
||||
OBJECT_OBJFILES \
|
||||
OBSERVER_OBJFILES \
|
||||
OSAPI_OBJFILES \
|
||||
PALMAN_OBJFILES \
|
||||
PARSE_OBJFILES \
|
||||
PARTICLE_OBJFILES \
|
||||
PCXUTILS_OBJFILES \
|
||||
PHYSICS_OBJFILES \
|
||||
PLAYERMAN_OBJFILES \
|
||||
POPUP_OBJFILES \
|
||||
RADAR_OBJFILES \
|
||||
RENDER_OBJFILES \
|
||||
SHIP_OBJFILES \
|
||||
SOUND_OBJFILES \
|
||||
STARFIELD_OBJFILES \
|
||||
STATS_OBJFILES \
|
||||
UI_OBJFILES \
|
||||
VCODEC_OBJFILES \
|
||||
WEAPON_OBJFILES \
|
||||
NEBULA_OBJFILES \
|
||||
LOCALIZATION_OBJFILES \
|
||||
TGAUTILS_OBJFILES \
|
||||
DEMO_OBJFILES \
|
||||
INETFILE_OBJFILES \
|
||||
EXCEPTIONHANDLER_OBJFILES \
|
||||
NETWORK_OBJFILES
|
||||
|
||||
.cpp.o:
|
||||
$(CXX) $(CXXFLAGS) -c -o $@ $<
|
||||
|
||||
|
||||
all: $(TARGET)
|
||||
|
||||
clean:
|
||||
rm -f $(TARGET) libcode.a core *.o *~
|
||||
find -name *.o -exec rm {} \;
|
||||
find -name *~ -exec rm {} \;
|
||||
|
||||
code: libcode.a
|
||||
|
||||
|
||||
# ==============================
|
||||
libcode.a: $(LIB_OBJFILES)
|
||||
$(AR) -r $@ $(LIB_OBJFILES)
|
||||
# $(CXX) -o $@ $(LIB_OBJFILES)
|
||||
|
||||
fs2: libcode.a $(FREESPACE2_OBJFILES) $(STUB_OBJFILES)
|
||||
$(CXX) $(LDFLAGS) -o $@ $(FREESPACE2_OBJFILES) $(STUB_OBJFILES) $(LDLIBS) -L. -lcode
|
||||
|
||||
|
||||
# exceptions to the rule...
|
||||
freespace2/freespace.o: freespace2/freespace.cpp
|
||||
$(CXX) $(CXXFLAGS) -fexceptions -c -o $@ $<
|
||||
|
||||
ANIM_OBJFILES: $(ANIM_OBJFILES)
|
||||
ASTEROID_OBJFILES: $(ASTEROID_OBJFILES)
|
||||
BMPMAN_OBJFILES: $(BMPMAN_OBJFILES)
|
||||
CMDLINE_OBJFILES: $(CMDLINE_OBJFILES)
|
||||
CMEASURE_OBJFILES: $(CMEASURE_OBJFILES)
|
||||
CONTROLCONFIG_OBJFILES: $(CONTROLCONFIG_OBJFILES)
|
||||
CUTSCENE_OBJFILES: $(CUTSCENE_OBJFILES)
|
||||
DEBRIS_OBJFILES: $(DEBRIS_OBJFILES)
|
||||
DEBUGCONSOLE_OBJFILES: $(DEBUGCONSOLE_OBJFILES)
|
||||
FIREBALL_OBJFILES: $(FIREBALL_OBJFILES)
|
||||
GAMEHELP_OBJFILES: $(GAMEHELP_OBJFILES)
|
||||
GAMESEQUENCE_OBJFILES: $(GAMESEQUENCE_OBJFILES)
|
||||
GAMESND_OBJFILES: $(GAMESND_OBJFILES)
|
||||
GLIDE_OBJFILES: $(GLIDE_OBJFILES)
|
||||
GLOBALINCS_OBJFILES: $(GLOBALINCS_OBJFILES)
|
||||
GRAPHICS_OBJFILES: $(GRAPHICS_OBJFILES)
|
||||
HUD_OBJFILES: $(HUD_OBJFILES)
|
||||
IO_OBJFILES: $(IO_OBJFILES)
|
||||
JUMPNODE_OBJFILES: $(JUMPNODE_OBJFILES)
|
||||
LIGHTING_OBJFILES: $(LIGHTING_OBJFILES)
|
||||
MATH_OBJFILES: $(MATH_OBJFILES)
|
||||
MENUUI_OBJFILES: $(MENUUI_OBJFILES)
|
||||
MISSION_OBJFILES: $(MISSION_OBJFILES)
|
||||
MISSIONUI_OBJFILES: $(MISSIONUI_OBJFILES)
|
||||
MODEL_OBJFILES: $(MODEL_OBJFILES)
|
||||
OBJECT_OBJFILES: $(OBJECT_OBJFILES)
|
||||
OBSERVER_OBJFILES: $(OBSERVER_OBJFILES)
|
||||
OSAPI_OBJFILES: $(OSAPI_OBJFILES)
|
||||
PALMAN_OBJFILES: $(PALMAN_OBJFILES)
|
||||
PARSE_OBJFILES: $(PARSE_OBJFILES)
|
||||
PARTICLE_OBJFILES: $(PARTICLE_OBJFILES)
|
||||
PCXUTILS_OBJFILES: $(PCXUTILS_OBJFILES)
|
||||
PHYSICS_OBJFILES: $(PHYSICS_OBJFILES)
|
||||
PLAYERMAN_OBJFILES: $(PLAYERMAN_OBJFILES)
|
||||
POPUP_OBJFILES: $(POPUP_OBJFILES)
|
||||
RADAR_OBJFILES: $(RADAR_OBJFILES)
|
||||
RENDER_OBJFILES: $(RENDER_OBJFILES)
|
||||
SHIP_OBJFILES: $(SHIP_OBJFILES)
|
||||
SOUND_OBJFILES: $(SOUND_OBJFILES)
|
||||
STARFIELD_OBJFILES: $(STARFIELD_OBJFILES)
|
||||
STATS_OBJFILES: $(STATS_OBJFILES)
|
||||
UI_OBJFILES: $(UI_OBJFILES)
|
||||
VCODEC_OBJFILES: $(VCODEC_OBJFILES)
|
||||
WEAPON_OBJFILES: $(WEAPON_OBJFILES)
|
||||
NEBULA_OBJFILES: $(NEBULA_OBJFILES)
|
||||
LOCALIZATION_OBJFILES: $(LOCALIZATION_OBJFILES)
|
||||
TGAUTILS_OBJFILES: $(TGAUTILS_OBJFILES)
|
||||
DEMO_OBJFILES: $(DEMO_OBJFILES)
|
||||
INETFILE_OBJFILES: $(INETFILE_OBJFILES)
|
||||
EXCEPTIONHANDLER_OBJFILES: $(EXCEPTIONHANDLER_OBJFILES)
|
||||
NETWORK_OBJFILES: $(NETWORK_OBJFILES)
|
||||
@@ -0,0 +1,672 @@
|
||||
## code/Makefile.am for fs2_open
|
||||
##
|
||||
## $Id: Makefile.am,v 1.20 2005-07-18 03:37:35 taylor Exp $
|
||||
|
||||
|
||||
EXTRA_DIST = \
|
||||
freespace2/app_icon.ico \
|
||||
freespace2/freespace.rc \
|
||||
freespace2/freespaceresource.h \
|
||||
freespace2/goal_com.bmp \
|
||||
freespace2/goal_fail.bmp \
|
||||
freespace2/goal_inc.bmp \
|
||||
freespace2/goal_none.bmp \
|
||||
freespace2/goal_ord.bmp \
|
||||
wxfred2/res/FRED.ico \
|
||||
wxfred2/wxfred.xrc
|
||||
|
||||
|
||||
# D_ variants are defaults and should always be used
|
||||
# FS2_ variants are for game building and wxFRED
|
||||
AM_CXXFLAGS = @D_CFLAGS@ @FS2_CXXFLAGS@
|
||||
AM_LDFLAGS = @D_LDFLAGS@ @FS2_LDFLAGS@
|
||||
|
||||
noinst_LIBRARIES = libcode.a
|
||||
noinst_PROGRAMS = @FS2_BINARY@
|
||||
|
||||
EXTRA_PROGRAMS = fs2_open_r fs2_open_d wxFRED2_r wxFRED2_d
|
||||
|
||||
###############################################################################
|
||||
##
|
||||
## Begin CORE library
|
||||
##
|
||||
|
||||
FS2_SOURCES = \
|
||||
ai/ai.cpp \
|
||||
ai/ai.h \
|
||||
ai/aibig.cpp \
|
||||
ai/aibig.h \
|
||||
ai/aicode.cpp \
|
||||
ai/aigoals.cpp \
|
||||
ai/aigoals.h \
|
||||
ai/aiinternal.h \
|
||||
ai/ailocal.h \
|
||||
ai/aiturret.cpp \
|
||||
anim/animplay.cpp \
|
||||
anim/animplay.h \
|
||||
anim/packunpack.cpp \
|
||||
anim/packunpack.h \
|
||||
asteroid/asteroid.cpp \
|
||||
asteroid/asteroid.h \
|
||||
autopilot/autopilot.cpp \
|
||||
autopilot/autopilot.h \
|
||||
bmpman/bm_internal.h \
|
||||
bmpman/bmpman.cpp \
|
||||
bmpman/bmpman.h \
|
||||
camera/camera.cpp \
|
||||
camera/camera.h \
|
||||
cfile/cfile.cpp \
|
||||
cfile/cfile.h \
|
||||
cfile/cfilearchive.cpp \
|
||||
cfile/cfilearchive.h \
|
||||
cfile/cfilelist.cpp \
|
||||
cfile/cfilesystem.cpp \
|
||||
cfile/cfilesystem.h \
|
||||
cmdline/cmdline.cpp \
|
||||
cmdline/cmdline.h \
|
||||
cmeasure/cmeasure.cpp \
|
||||
cmeasure/cmeasure.h \
|
||||
controlconfig/controlsconfig.cpp \
|
||||
controlconfig/controlsconfig.h \
|
||||
controlconfig/controlsconfigcommon.cpp \
|
||||
cutscene/cutscenes.cpp \
|
||||
cutscene/cutscenes.h \
|
||||
cutscene/movie.cpp \
|
||||
cutscene/movie.h \
|
||||
ddsutils/ddsutils.cpp \
|
||||
ddsutils/ddsutils.h \
|
||||
debris/debris.cpp \
|
||||
debris/debris.h \
|
||||
debugconsole/console.cpp \
|
||||
debugconsole/dbugfile.h \
|
||||
debugconsole/timerbar.cpp \
|
||||
debugconsole/timerbar.h \
|
||||
decals/decals.cpp \
|
||||
decals/decals.h \
|
||||
demo/demo.cpp \
|
||||
demo/demo.h \
|
||||
exceptionhandler/exceptionhandler.cpp \
|
||||
exceptionhandler/exceptionhandler.h \
|
||||
fireball/fireballs.cpp \
|
||||
fireball/fireballs.h \
|
||||
fireball/warpineffect.cpp \
|
||||
fs2open_pxo/Client.cpp \
|
||||
fs2open_pxo/Client.h \
|
||||
fs2open_pxo/TCP_Client.cpp \
|
||||
fs2open_pxo/TCP_Socket.cpp \
|
||||
fs2open_pxo/TCP_Socket.h \
|
||||
fs2open_pxo/protocol.h \
|
||||
fs2open_pxo/udpsocket.cpp \
|
||||
fs2open_pxo/udpsocket.h \
|
||||
gamehelp/contexthelp.cpp \
|
||||
gamehelp/contexthelp.h \
|
||||
gamehelp/gameplayhelp.cpp \
|
||||
gamehelp/gameplayhelp.h \
|
||||
gamesequence/gamesequence.cpp \
|
||||
gamesequence/gamesequence.h \
|
||||
globalincs/alphacolors.cpp \
|
||||
globalincs/alphacolors.h \
|
||||
globalincs/crypt.cpp \
|
||||
globalincs/crypt.h \
|
||||
globalincs/globals.h \
|
||||
globalincs/linklist.h \
|
||||
globalincs/pstypes.h \
|
||||
globalincs/systemvars.cpp \
|
||||
globalincs/systemvars.h \
|
||||
globalincs/version.cpp \
|
||||
globalincs/version.h \
|
||||
graphics/2d.cpp \
|
||||
graphics/2d.h \
|
||||
graphics/font.cpp \
|
||||
graphics/font.h \
|
||||
graphics/grbatch.cpp \
|
||||
graphics/grbatch.h \
|
||||
graphics/grinternal.h \
|
||||
graphics/gropengl.cpp \
|
||||
graphics/gropengl.h \
|
||||
graphics/gropenglbmpman.cpp \
|
||||
graphics/gropenglbmpman.h \
|
||||
graphics/gropenglextension.cpp \
|
||||
graphics/gropenglextension.h \
|
||||
graphics/gropengllight.cpp \
|
||||
graphics/gropengllight.h \
|
||||
graphics/gropengltexture.cpp \
|
||||
graphics/gropengltexture.h \
|
||||
graphics/gropengltnl.cpp \
|
||||
graphics/gropengltnl.h \
|
||||
graphics/grstub.h \
|
||||
graphics/grzbuffer.cpp \
|
||||
graphics/grzbuffer.h \
|
||||
graphics/line.h \
|
||||
graphics/tmapper.h \
|
||||
hud/hud.cpp \
|
||||
hud/hud.h \
|
||||
hud/hudartillery.cpp \
|
||||
hud/hudartillery.h \
|
||||
hud/hudbrackets.cpp \
|
||||
hud/hudbrackets.h \
|
||||
hud/hudconfig.cpp \
|
||||
hud/hudconfig.h \
|
||||
hud/hudescort.cpp \
|
||||
hud/hudescort.h \
|
||||
hud/hudets.cpp \
|
||||
hud/hudets.h \
|
||||
hud/hudgauges.h \
|
||||
hud/hudlock.cpp \
|
||||
hud/hudlock.h \
|
||||
hud/hudmessage.cpp \
|
||||
hud/hudmessage.h \
|
||||
hud/hudnavigation.cpp \
|
||||
hud/hudnavigation.h \
|
||||
hud/hudobserver.cpp \
|
||||
hud/hudobserver.h \
|
||||
hud/hudparse.cpp \
|
||||
hud/hudparse.h \
|
||||
hud/hudresource.h \
|
||||
hud/hudreticle.cpp \
|
||||
hud/hudreticle.h \
|
||||
hud/hudshield.cpp \
|
||||
hud/hudshield.h \
|
||||
hud/hudsquadmsg.cpp \
|
||||
hud/hudsquadmsg.h \
|
||||
hud/hudtarget.cpp \
|
||||
hud/hudtarget.h \
|
||||
hud/hudtargetbox.cpp \
|
||||
hud/hudtargetbox.h \
|
||||
hud/hudwingmanstatus.cpp \
|
||||
hud/hudwingmanstatus.h \
|
||||
io/key.cpp \
|
||||
io/key.h \
|
||||
io/keycontrol.cpp \
|
||||
io/keycontrol.h \
|
||||
io/mouse.cpp \
|
||||
io/mouse.h \
|
||||
io/timer.cpp \
|
||||
io/timer.h \
|
||||
irc/irc.cpp \
|
||||
irc/irc.h \
|
||||
jpgutils/jpgutils.cpp \
|
||||
jpgutils/jpgutils.h \
|
||||
jumpnode/jumpnode.cpp \
|
||||
jumpnode/jumpnode.h \
|
||||
lab/lab.cpp \
|
||||
lab/lab.h \
|
||||
lab/wmcgui.cpp \
|
||||
lab/wmcgui.h \
|
||||
lighting/lighting.cpp \
|
||||
lighting/lighting.h \
|
||||
localization/fhash.cpp \
|
||||
localization/fhash.h \
|
||||
localization/localize.cpp \
|
||||
localization/localize.h \
|
||||
math/bitarray.h \
|
||||
math/fix.cpp \
|
||||
math/fix.h \
|
||||
math/floating.cpp \
|
||||
math/floating.h \
|
||||
math/fvi.cpp \
|
||||
math/fvi.h \
|
||||
math/spline.cpp \
|
||||
math/spline.h \
|
||||
math/staticrand.cpp \
|
||||
math/staticrand.h \
|
||||
math/vecmat.cpp \
|
||||
math/vecmat.h \
|
||||
menuui/barracks.cpp \
|
||||
menuui/barracks.h \
|
||||
menuui/credits.cpp \
|
||||
menuui/credits.h \
|
||||
menuui/fishtank.cpp \
|
||||
menuui/fishtank.h \
|
||||
menuui/mainhallmenu.cpp \
|
||||
menuui/mainhallmenu.h \
|
||||
menuui/mainhalltemp.cpp \
|
||||
menuui/mainhalltemp.h \
|
||||
menuui/optionsmenu.cpp \
|
||||
menuui/optionsmenu.h \
|
||||
menuui/optionsmenumulti.cpp \
|
||||
menuui/optionsmenumulti.h \
|
||||
menuui/playermenu.cpp \
|
||||
menuui/playermenu.h \
|
||||
menuui/readyroom.cpp \
|
||||
menuui/readyroom.h \
|
||||
menuui/snazzyui.cpp \
|
||||
menuui/snazzyui.h \
|
||||
menuui/storybook.cpp \
|
||||
menuui/storybook.h \
|
||||
menuui/techmenu.cpp \
|
||||
menuui/techmenu.h \
|
||||
menuui/trainingmenu.cpp \
|
||||
menuui/trainingmenu.h \
|
||||
mission/missionbriefcommon.cpp \
|
||||
mission/missionbriefcommon.h \
|
||||
mission/missioncampaign.cpp \
|
||||
mission/missioncampaign.h \
|
||||
mission/missiongoals.cpp \
|
||||
mission/missiongoals.h \
|
||||
mission/missiongrid.cpp \
|
||||
mission/missiongrid.h \
|
||||
mission/missionhotkey.cpp \
|
||||
mission/missionhotkey.h \
|
||||
mission/missionload.cpp \
|
||||
mission/missionload.h \
|
||||
mission/missionlog.cpp \
|
||||
mission/missionlog.h \
|
||||
mission/missionmessage.cpp \
|
||||
mission/missionmessage.h \
|
||||
mission/missionparse.cpp \
|
||||
mission/missionparse.h \
|
||||
mission/missiontraining.cpp \
|
||||
mission/missiontraining.h \
|
||||
missionui/chatbox.cpp \
|
||||
missionui/chatbox.h \
|
||||
missionui/missionbrief.cpp \
|
||||
missionui/missionbrief.h \
|
||||
missionui/missioncmdbrief.cpp \
|
||||
missionui/missioncmdbrief.h \
|
||||
missionui/missiondebrief.cpp \
|
||||
missionui/missiondebrief.h \
|
||||
missionui/missionloopbrief.cpp \
|
||||
missionui/missionloopbrief.h \
|
||||
missionui/missionpause.cpp \
|
||||
missionui/missionpause.h \
|
||||
missionui/missionrecommend.cpp \
|
||||
missionui/missionrecommend.h \
|
||||
missionui/missionscreencommon.cpp \
|
||||
missionui/missionscreencommon.h \
|
||||
missionui/missionshipchoice.cpp \
|
||||
missionui/missionshipchoice.h \
|
||||
missionui/missionstats.cpp \
|
||||
missionui/missionstats.h \
|
||||
missionui/missionweaponchoice.cpp \
|
||||
missionui/missionweaponchoice.h \
|
||||
missionui/redalert.cpp \
|
||||
missionui/redalert.h \
|
||||
model/model.h \
|
||||
model/modelcollide.cpp \
|
||||
model/modelinterp.cpp \
|
||||
model/modelsinc.h \
|
||||
model/modeloctant.cpp \
|
||||
model/modelread.cpp \
|
||||
nebula/neb.cpp \
|
||||
nebula/neb.h \
|
||||
nebula/neblightning.cpp \
|
||||
nebula/neblightning.h \
|
||||
network/fs2ox.cpp \
|
||||
network/fs2ox.h \
|
||||
network/multi.cpp \
|
||||
network/multi.h \
|
||||
network/multilag.h \
|
||||
network/multimsgs.cpp \
|
||||
network/multimsgs.h \
|
||||
network/multiteamselect.cpp \
|
||||
network/multiteamselect.h \
|
||||
network/multiui.cpp \
|
||||
network/multiui.h \
|
||||
network/multiutil.cpp \
|
||||
network/multiutil.h \
|
||||
network/multi_campaign.cpp \
|
||||
network/multi_campaign.h \
|
||||
network/multi_data.cpp \
|
||||
network/multi_data.h \
|
||||
network/multi_dogfight.cpp \
|
||||
network/multi_dogfight.h \
|
||||
network/multi_endgame.cpp \
|
||||
network/multi_endgame.h \
|
||||
network/multi_ingame.cpp \
|
||||
network/multi_ingame.h \
|
||||
network/multi_kick.cpp \
|
||||
network/multi_kick.h \
|
||||
network/multi_log.cpp \
|
||||
network/multi_log.h \
|
||||
network/multi_obj.cpp \
|
||||
network/multi_obj.h \
|
||||
network/multi_observer.cpp \
|
||||
network/multi_observer.h \
|
||||
network/multi_oo.h \
|
||||
network/multi_options.cpp \
|
||||
network/multi_options.h \
|
||||
network/multi_pause.cpp \
|
||||
network/multi_pause.h \
|
||||
network/multi_pinfo.cpp \
|
||||
network/multi_pinfo.h \
|
||||
network/multi_ping.cpp \
|
||||
network/multi_ping.h \
|
||||
network/multi_pmsg.cpp \
|
||||
network/multi_pmsg.h \
|
||||
network/multi_rate.cpp \
|
||||
network/multi_rate.h \
|
||||
network/multi_respawn.cpp \
|
||||
network/multi_respawn.h \
|
||||
network/multi_team.cpp \
|
||||
network/multi_team.h \
|
||||
network/multi_update.h \
|
||||
network/multi_voice.cpp \
|
||||
network/multi_voice.h \
|
||||
network/multi_xfer.cpp \
|
||||
network/multi_xfer.h \
|
||||
network/psnet.cpp \
|
||||
network/psnet.h \
|
||||
network/psnet2.cpp \
|
||||
network/psnet2.h \
|
||||
object/collidedebrisship.cpp \
|
||||
object/collidedebrisweapon.cpp \
|
||||
object/collideshipship.cpp \
|
||||
object/collideshipweapon.cpp \
|
||||
object/collideweaponweapon.cpp \
|
||||
object/objcollide.cpp \
|
||||
object/objcollide.h \
|
||||
object/objectdock.cpp \
|
||||
object/objectdock.h \
|
||||
object/object.cpp \
|
||||
object/object.h \
|
||||
object/objectsort.cpp \
|
||||
observer/observer.cpp \
|
||||
observer/observer.h \
|
||||
palman/palman.cpp \
|
||||
palman/palman.h \
|
||||
parse/encrypt.cpp \
|
||||
parse/encrypt.h \
|
||||
parse/parselo.cpp \
|
||||
parse/parselo.h \
|
||||
parse/sexp.cpp \
|
||||
parse/sexp.h \
|
||||
particle/particle.cpp \
|
||||
particle/particle.h \
|
||||
pcxutils/pcxutils.cpp \
|
||||
pcxutils/pcxutils.h \
|
||||
physics/physics.cpp \
|
||||
physics/physics.h \
|
||||
playerman/managepilot.cpp \
|
||||
playerman/managepilot.h \
|
||||
playerman/player.h \
|
||||
playerman/playercontrol.cpp \
|
||||
popup/popup.cpp \
|
||||
popup/popup.h \
|
||||
popup/popupdead.cpp \
|
||||
popup/popupdead.h \
|
||||
radar/radar.cpp \
|
||||
radar/radar.h \
|
||||
radar/radarorb.cpp \
|
||||
radar/radarorb.h \
|
||||
radar/radarsetup.cpp \
|
||||
radar/radarsetup.h \
|
||||
render/3d.h \
|
||||
render/3dclipper.cpp \
|
||||
render/3ddraw.cpp \
|
||||
render/3dinternal.h \
|
||||
render/3dlaser.cpp \
|
||||
render/3dmath.cpp \
|
||||
render/3dsetup.cpp \
|
||||
ship/afterburner.cpp \
|
||||
ship/afterburner.h \
|
||||
ship/awacs.cpp \
|
||||
ship/awacs.h \
|
||||
ship/shield.cpp \
|
||||
ship/ship.cpp \
|
||||
ship/ship.h \
|
||||
ship/shipcontrails.cpp \
|
||||
ship/shipcontrails.h \
|
||||
ship/shipfx.cpp \
|
||||
ship/shipfx.h \
|
||||
ship/shiphit.cpp \
|
||||
ship/shiphit.h \
|
||||
ship/subsysdamage.h \
|
||||
species_defs/species_defs.cpp \
|
||||
species_defs/species_defs.h \
|
||||
starfield/nebula.cpp \
|
||||
starfield/nebula.h \
|
||||
starfield/starfield.cpp \
|
||||
starfield/starfield.h \
|
||||
starfield/supernova.cpp \
|
||||
starfield/supernova.h \
|
||||
stats/medals.cpp \
|
||||
stats/medals.h \
|
||||
stats/scoring.cpp \
|
||||
stats/scoring.h \
|
||||
stats/stats.cpp \
|
||||
stats/stats.h \
|
||||
tgautils/tgautils.cpp \
|
||||
tgautils/tgautils.h \
|
||||
ui/button.cpp \
|
||||
ui/checkbox.cpp \
|
||||
ui/gadget.cpp \
|
||||
ui/icon.cpp \
|
||||
ui/inputbox.cpp \
|
||||
ui/keytrap.cpp \
|
||||
ui/listbox.cpp \
|
||||
ui/radio.cpp \
|
||||
ui/scroll.cpp \
|
||||
ui/slider.cpp \
|
||||
ui/slider2.cpp \
|
||||
ui/ui.h \
|
||||
ui/uidefs.h \
|
||||
ui/uidraw.cpp \
|
||||
ui/uimouse.cpp \
|
||||
ui/window.cpp \
|
||||
weapon/beam.cpp \
|
||||
weapon/beam.h \
|
||||
weapon/corkscrew.cpp \
|
||||
weapon/corkscrew.h \
|
||||
weapon/emp.cpp \
|
||||
weapon/emp.h \
|
||||
weapon/flak.cpp \
|
||||
weapon/flak.h \
|
||||
weapon/muzzleflash.cpp \
|
||||
weapon/muzzleflash.h \
|
||||
weapon/shockwave.cpp \
|
||||
weapon/shockwave.h \
|
||||
weapon/swarm.cpp \
|
||||
weapon/swarm.h \
|
||||
weapon/trails.cpp \
|
||||
weapon/trails.h \
|
||||
weapon/weapons.cpp \
|
||||
weapon/weapon.h
|
||||
|
||||
## conditional includes follow:
|
||||
|
||||
## joystic support sources
|
||||
if FS2_OS_WIN32
|
||||
JOY_SOURCES = \
|
||||
io/joy.cpp \
|
||||
io/joy.h \
|
||||
io/joy_ff.cpp \
|
||||
io/joy_ff.h \
|
||||
io/sw_error.hpp \
|
||||
io/sw_force.h \
|
||||
io/sw_guid.hpp \
|
||||
io/swff_lib.cpp
|
||||
endif
|
||||
|
||||
if FS2_OS_UNIX
|
||||
JOY_SOURCES = \
|
||||
io/joy.h \
|
||||
io/joy-unix.cpp
|
||||
endif
|
||||
|
||||
## networking support sources
|
||||
if FS2_OS_WIN32
|
||||
FS2_SOURCES += \
|
||||
network/multilag.cpp \
|
||||
network/stand_gui.cpp \
|
||||
network/stand_gui.h
|
||||
endif
|
||||
|
||||
if FS2_OS_UNIX
|
||||
FS2_SOURCES += \
|
||||
network/stand_gui-unix.cpp \
|
||||
network/stand_gui.h
|
||||
endif
|
||||
|
||||
## sound support sources
|
||||
if FS2_SOUND
|
||||
SOUND_SOURCES = \
|
||||
gamesnd/eventmusic.cpp \
|
||||
gamesnd/eventmusic.h \
|
||||
gamesnd/gamesnd.cpp \
|
||||
gamesnd/gamesnd.h \
|
||||
object/objectsnd.cpp \
|
||||
object/objectsnd.h \
|
||||
sound/ogg/ogg.cpp \
|
||||
sound/ogg/ogg.h \
|
||||
sound/audiostr-openal.cpp \
|
||||
sound/audiostr.cpp \
|
||||
sound/audiostr.h \
|
||||
sound/acm-openal.cpp \
|
||||
sound/acm.cpp \
|
||||
sound/acm.h \
|
||||
sound/ds.cpp \
|
||||
sound/ds.h \
|
||||
sound/ds3d.cpp \
|
||||
sound/ds3d.h \
|
||||
sound/midifile.cpp \
|
||||
sound/midifile.h \
|
||||
sound/midiseq.h \
|
||||
sound/rbaudio.cpp \
|
||||
sound/rbaudio.h \
|
||||
sound/rtvoice.cpp \
|
||||
sound/rtvoice.h \
|
||||
sound/sound.cpp \
|
||||
sound/sound.h \
|
||||
sound/winmidi.cpp \
|
||||
sound/winmidi.h \
|
||||
sound/winmidi_base.cpp \
|
||||
vcodec/codec1.cpp \
|
||||
vcodec/codec1.h \
|
||||
sound/fsspeech.cpp \
|
||||
sound/fsspeech.h \
|
||||
sound/speech.cpp \
|
||||
sound/speech.h
|
||||
|
||||
if FS2_OS_WIN32
|
||||
SOUND_SOURCES += \
|
||||
sound/dscap.cpp \
|
||||
sound/dscap.h
|
||||
endif
|
||||
|
||||
endif
|
||||
|
||||
## Win32-specific sources
|
||||
if FS2_OS_WIN32
|
||||
WIN32_SOURCES = \
|
||||
directx/dx8show.cpp \
|
||||
directx/dx8show.h \
|
||||
directx/vasync.h \
|
||||
directx/vd3dtypes.h \
|
||||
directx/vddraw.h \
|
||||
directx/vdinput.h \
|
||||
directx/vdplay.h \
|
||||
directx/vdplobby.h \
|
||||
directx/vdsetup.h \
|
||||
directx/vdsound.h \
|
||||
directx/vdvp.h \
|
||||
globalincs/windebug.cpp \
|
||||
graphics/gl/GLAUX.H \
|
||||
graphics/gl/GLU.H \
|
||||
graphics/gl/Gl.h \
|
||||
graphics/gl/Glext.h \
|
||||
graphics/gl/wglext.h \
|
||||
graphics/GrD3DParticle.cpp \
|
||||
graphics/GrD3DParticle.h \
|
||||
graphics/GrD3DStateBlock.cpp \
|
||||
graphics/grd3d.cpp \
|
||||
graphics/grd3d.h \
|
||||
graphics/grd3dbatch.cpp \
|
||||
graphics/grd3dbatch.h \
|
||||
graphics/grd3dcalls.cpp \
|
||||
graphics/grd3dbmpman.cpp \
|
||||
graphics/grd3dbmpman.h \
|
||||
graphics/grd3dinternal.h \
|
||||
graphics/grd3dlight.cpp \
|
||||
graphics/grd3dlight.h \
|
||||
graphics/grd3drender.cpp \
|
||||
graphics/grd3dsetup.cpp \
|
||||
graphics/grd3dsetup.h \
|
||||
graphics/grd3dtexture.cpp \
|
||||
osapi/monopub.h \
|
||||
osapi/osapi.cpp \
|
||||
osapi/osapi.h \
|
||||
osapi/osregistry.cpp \
|
||||
osapi/osregistry.h \
|
||||
osapi/outwnd.cpp \
|
||||
osapi/outwnd.h
|
||||
endif
|
||||
|
||||
## Unix-specific sources
|
||||
if FS2_OS_UNIX
|
||||
UNIX_SOURCES = \
|
||||
osapi/osapi_unix.cpp \
|
||||
osapi/osapi.h \
|
||||
osapi/osregistry_unix.cpp \
|
||||
osapi/osregistry.h \
|
||||
osapi/outwnd_unix.cpp \
|
||||
osapi/outwnd.h \
|
||||
windows_stub/stubs.cpp \
|
||||
windows_stub/config.h
|
||||
endif
|
||||
|
||||
|
||||
## libcode.a
|
||||
libcode_a_SOURCES = ${FS2_SOURCES} ${JOY_SOURCES} ${SOUND_SOURCES} \
|
||||
${WIN32_SOURCES} ${UNIX_SOURCES}
|
||||
|
||||
##
|
||||
## End CODE library
|
||||
##
|
||||
###############################################################################
|
||||
|
||||
###############################################################################
|
||||
##
|
||||
## Begin MAIN fs2 binary
|
||||
##
|
||||
|
||||
FS2OPEN_SOURCES = \
|
||||
freespace2/freespace.cpp \
|
||||
freespace2/freespace.h \
|
||||
freespace2/levelpaging.cpp \
|
||||
freespace2/levelpaging.h
|
||||
|
||||
fs2_open_d_SOURCES = \
|
||||
${FS2OPEN_SOURCES} \
|
||||
${PLATFORM_SOURCES}
|
||||
|
||||
fs2_open_r_SOURCES = \
|
||||
${FS2OPEN_SOURCES} \
|
||||
${PLATFORM_SOURCES}
|
||||
|
||||
fs2_open_d_LDADD = libcode.a ../libjpeg/libjpeg.a
|
||||
fs2_open_r_LDADD = libcode.a ../libjpeg/libjpeg.a
|
||||
|
||||
##
|
||||
## End MAIN binary
|
||||
##
|
||||
###############################################################################
|
||||
|
||||
###############################################################################
|
||||
##
|
||||
## Begin wxFRED2 binary
|
||||
##
|
||||
|
||||
wxFRED_SOURCES = \
|
||||
wxfred2/wxfred2.cpp \
|
||||
wxfred2/wxfred2.h \
|
||||
wxfred2/fredframe.cpp \
|
||||
wxfred2/fredframe.h \
|
||||
wxfred2/wxfred_xrc.cpp \
|
||||
wxfred2/wxfred_xrc.h
|
||||
|
||||
wxFRED2_d_SOURCES = \
|
||||
${wxFRED_SOURCES} \
|
||||
${PLATFORM_SOURCES}
|
||||
|
||||
wxFRED2_r_SOURCES = \
|
||||
${wxFRED_SOURCES} \
|
||||
${PLATFORM_SOURCES}
|
||||
|
||||
wxFRED2_d_LDADD = libcode.a ../libjpeg/libjpeg.a
|
||||
wxFRED2_r_LDADD = libcode.a ../libjpeg/libjpeg.a
|
||||
|
||||
##
|
||||
## End wxFRED2 binary
|
||||
##
|
||||
###############################################################################
|
||||
@@ -11,17 +11,11 @@
|
||||
// ai slots and linking them to ships.
|
||||
// See AiCode.cpp for the actual AI code.
|
||||
|
||||
#include "globalincs/pstypes.h"
|
||||
#include "ai/ai.h"
|
||||
#include "object/object.h"
|
||||
#include "physics/physics.h"
|
||||
#include "math/vecmat.h"
|
||||
#include "ship/ship.h"
|
||||
#include "model/model.h"
|
||||
#include "graphics/2d.h"
|
||||
#include "render/3d.h"
|
||||
#include "ship/ai.h"
|
||||
#include "math/floating.h"
|
||||
#include "ship/ailocal.h"
|
||||
|
||||
|
||||
|
||||
int Total_goal_ship_names = 0;
|
||||
char Goal_ship_names[MAX_GOAL_SHIP_NAMES][NAME_LENGTH];
|
||||
@@ -9,11 +9,116 @@
|
||||
|
||||
/*
|
||||
* $Logfile: /Freespace2/code/Ship/ai.h $
|
||||
* $Revision: 2.1 $
|
||||
* $Date: 2002-08-01 01:41:09 $
|
||||
* $Author: penguin $
|
||||
* $Revision: 1.7 $
|
||||
* $Date: 2005-07-27 17:22:22 $
|
||||
* $Author: Goober5000 $
|
||||
*
|
||||
* $Log: not supported by cvs2svn $
|
||||
* Revision 1.6 2005/07/25 03:13:24 Goober5000
|
||||
* various code cleanups, tweaks, and fixes; most notably the MISSION_FLAG_USE_NEW_AI
|
||||
* should now be added to all places where it is needed (except the turret code, which I still
|
||||
* have to to review)
|
||||
* --Goober5000
|
||||
*
|
||||
* Revision 1.5 2005/07/24 20:12:55 Goober5000
|
||||
* cleaned up some rotating submodel code
|
||||
* --Goober5000
|
||||
*
|
||||
* Revision 1.4 2005/07/22 09:19:39 wmcoolmon
|
||||
* Dynamic AI Class number commit. KNOWN BUG: When AI_CLASS_INCREMENT is hit and vm_realloc is called, memory corruption seems to
|
||||
* result. Not at all sure what causes this; if this can't be resolved soon, we can always treat _INCREMENT like _MAX
|
||||
*
|
||||
* Revision 1.3 2005/07/13 02:50:48 Goober5000
|
||||
* remove PreProcDefine #includes in FS2
|
||||
* --Goober5000
|
||||
*
|
||||
* Revision 1.2 2005/04/05 05:53:13 taylor
|
||||
* s/vector/vec3d/g, better support for different compilers (Jens Granseuer)
|
||||
*
|
||||
* Revision 1.1 2005/03/25 06:45:12 wmcoolmon
|
||||
* Initial AI code move commit - note that aigoals.cpp has some escape characters in it, I'm not sure if this is really a problem.
|
||||
*
|
||||
* Revision 2.21 2005/02/20 23:13:00 wmcoolmon
|
||||
* Trails stuff, moved ship docking func declaration so FRED could get to it.
|
||||
*
|
||||
* Revision 2.20 2005/01/28 09:01:04 Goober5000
|
||||
* finished implementing docking to a rotating submodel
|
||||
* --Goober5000
|
||||
*
|
||||
* Revision 2.19 2005/01/27 11:26:23 Goober5000
|
||||
* dock points on rotating submodels is *almost* working
|
||||
* --Goober5000
|
||||
*
|
||||
* Revision 2.18 2005/01/13 03:33:07 Goober5000
|
||||
* hmm, rolled back one of my clarifications since it caused things to get messed up
|
||||
* --Goober5000
|
||||
*
|
||||
* Revision 2.17 2005/01/11 21:38:48 Goober5000
|
||||
* multiple ship docking :)
|
||||
* don't tell anyone yet... check the SCP internal
|
||||
* --Goober500
|
||||
*
|
||||
* Revision 2.16 2004/08/11 05:06:33 Kazan
|
||||
* added preprocdefines.h to prevent what happened with fred -- make sure to make all fred2 headers include this file as the _first_ include -- i have already modified fs2 files to do this
|
||||
*
|
||||
* Revision 2.15 2004/07/25 00:31:30 Kazan
|
||||
* i have absolutely nothing to say about that subject
|
||||
*
|
||||
* Revision 2.14 2004/03/05 09:01:51 Goober5000
|
||||
* Uber pass at reducing #includes
|
||||
* --Goober5000
|
||||
*
|
||||
* Revision 2.13 2004/01/26 23:07:43 phreak
|
||||
* bumped MAX_AI_CLASSES to 30 if INF_BUILD is defined
|
||||
*
|
||||
* Revision 2.12 2003/11/11 02:15:40 Goober5000
|
||||
* ubercommit - basically spelling and language fixes with some additional
|
||||
* warnings disabled
|
||||
* --Goober5000
|
||||
*
|
||||
* Revision 2.11 2003/09/13 06:02:03 Goober5000
|
||||
* clean rollback of all of argv's stuff
|
||||
* --Goober5000
|
||||
*
|
||||
* Revision 2.9 2003/03/30 04:34:37 Goober5000
|
||||
* preliminary work on ai facing sexp
|
||||
* --Goober5000
|
||||
*
|
||||
* Revision 2.8 2003/01/19 22:20:22 Goober5000
|
||||
* fixed a bunch of bugs -- the support ship sexp, the "no-subspace-drive" flag,
|
||||
* and departure into hangars should now all work properly
|
||||
* --Goober5000
|
||||
*
|
||||
* Revision 2.7 2003/01/19 07:02:15 Goober5000
|
||||
* fixed a bunch of bugs - "no-subspace-drive" should now work properly for
|
||||
* all ships, and all ships who have their departure anchor set to a capital ship
|
||||
* should exit to that ship when told to depart
|
||||
* --Goober5000
|
||||
*
|
||||
* Revision 2.6 2003/01/07 20:06:44 Goober5000
|
||||
* added ai-chase-any-except sexp
|
||||
* --Goober5000
|
||||
*
|
||||
* Revision 2.5 2003/01/06 22:57:23 Goober5000
|
||||
* implemented keep-safe-distance
|
||||
* --Goober5000
|
||||
*
|
||||
* Revision 2.4 2003/01/03 21:58:07 Goober5000
|
||||
* Fixed some minor bugs, and added a primitive-sensors flag, where if a ship
|
||||
* has primitive sensors it can't target anything and objects don't appear
|
||||
* on radar if they're outside a certain range. This range can be modified
|
||||
* via the sexp primitive-sensors-set-range.
|
||||
* --Goober5000
|
||||
*
|
||||
* Revision 2.3 2002/12/10 05:43:33 Goober5000
|
||||
* Full-fledged ballistic primary support added! Try it and see! :)
|
||||
*
|
||||
* Revision 2.2 2002/10/19 19:29:28 bobboau
|
||||
* inital commit, trying to get most of my stuff into FSO, there should be most of my fighter beam, beam rendering, beam shield hit, ABtrails, and ssm stuff. one thing you should be happy to know is the beam texture tileing is now set in the beam section section of the weapon table entry
|
||||
*
|
||||
* Revision 2.1 2002/08/01 01:41:09 penguin
|
||||
* The big include file move
|
||||
*
|
||||
* Revision 2.0 2002/06/03 04:02:28 penguin
|
||||
* Warpcore CVS sync
|
||||
*
|
||||
@@ -160,40 +265,44 @@
|
||||
#define _AI_H
|
||||
|
||||
#include "globalincs/pstypes.h"
|
||||
#include "object/object.h"
|
||||
#include "parse/parselo.h"
|
||||
#include "cfile/cfile.h"
|
||||
#include "globalincs/globals.h"
|
||||
#include "globalincs/systemvars.h"
|
||||
|
||||
struct ship_weapon;
|
||||
struct ship_subsys;
|
||||
struct object;
|
||||
|
||||
#define AI_DEFAULT_CLASS 3 // default AI class for new ships (Fred)
|
||||
|
||||
#define AIF_FORMATION_WING (1 << 0) // Fly in formation as part of wing.
|
||||
#define AIF_AWAITING_REPAIR (1 << 1) // Awaiting a repair ship.
|
||||
#define AIF_BEING_REPAIRED (1 << 2) // Currently docked with repair ship.
|
||||
#define AIF_REPAIRING (1 << 3) // Repairing a ship (or going to repair a ship)
|
||||
#define AIF_DOCKED (1 << 4) // this object docked with something else
|
||||
#define AIF_SEEK_LOCK (1 << 5) // set if should focus on gaining aspect lock, not hitting with lasers
|
||||
#define AIF_FORMATION_OBJECT (1 << 6) // Fly in formation off a specific object.
|
||||
#define AIF_TEMPORARY_IGNORE (1 << 7) // Means current ignore_objnum is only temporary, not an order from the player.
|
||||
#define AIF_USE_EXIT_PATH (1 << 8) // Used by path code, to flag path as an exit path
|
||||
#define AIF_USE_STATIC_PATH (1 << 9) // Used by path code, use fixed path, don't try to recreate
|
||||
#define AIF_TARGET_COLLISION (1 << 10) // Collided with aip->target_objnum last frame. Avoid that ship for half a second or so.
|
||||
#define AIF_UNLOAD_SECONDARIES (1 << 11) // Fire secondaries as fast as possible!
|
||||
#define AIF_ON_SUBSYS_PATH (1 << 12) // Current path leads to a subsystem
|
||||
#define AIF_AVOID_SHOCKWAVE_SHIP (1 << 13) // Avoid an existing shockwave from a ship.
|
||||
#define AIF_AVOID_SHOCKWAVE_WEAPON (1 << 14) // Avoid an expected shockwave from a weapon. shockwave_object field contains object index.
|
||||
#define AIF_AVOID_SHOCKWAVE_STARTED (1 << 15) // Already started avoiding shockwave, don't keep deciding whether to avoid.
|
||||
#define AIF_ATTACK_SLOWLY (1 << 16) // Move slowly while attacking.
|
||||
#define AIF_REPAIR_OBSTRUCTED (1 << 17) // Ship wants to be repaired, but path is obstructed.
|
||||
#define AIF_KAMIKAZE (1 << 18) // Crash into target
|
||||
#define AIF_NO_DYNAMIC (1 << 19) // Not allowed to get dynamic goals
|
||||
#define AIF_AVOIDING_SMALL_SHIP (1 << 20) // Avoiding a player ship.
|
||||
#define AIF_AVOIDING_BIG_SHIP (1 << 21) // Avoiding a large ship.
|
||||
#define AIF_BIG_SHIP_COLLIDE_RECOVER_1 (1 << 22) // Collided into a big ship. Recovering by flying away.
|
||||
#define AIF_BIG_SHIP_COLLIDE_RECOVER_2 (1 << 23) // Collided into a big ship. Fly towards big ship sphere perimeter.
|
||||
#define AIF_STEALTH_PURSIUT (1 << 24) // Ai is trying to fight stealth ship
|
||||
#define AIF_FORMATION_WING (1 << 0) // Fly in formation as part of wing.
|
||||
#define AIF_AWAITING_REPAIR (1 << 1) // Awaiting a repair ship.
|
||||
#define AIF_BEING_REPAIRED (1 << 2) // Currently docked with repair ship.
|
||||
#define AIF_REPAIRING (1 << 3) // Repairing a ship (or going to repair a ship)
|
||||
#define AIF_SEEK_LOCK (1 << 4) // set if should focus on gaining aspect lock, not hitting with lasers
|
||||
#define AIF_FORMATION_OBJECT (1 << 5) // Fly in formation off a specific object.
|
||||
#define AIF_TEMPORARY_IGNORE (1 << 6) // Means current ignore_objnum is only temporary, not an order from the player.
|
||||
#define AIF_USE_EXIT_PATH (1 << 7) // Used by path code, to flag path as an exit path
|
||||
#define AIF_USE_STATIC_PATH (1 << 8) // Used by path code, use fixed path, don't try to recreate
|
||||
#define AIF_TARGET_COLLISION (1 << 9) // Collided with aip->target_objnum last frame. Avoid that ship for half a second or so.
|
||||
#define AIF_UNLOAD_SECONDARIES (1 << 10) // Fire secondaries as fast as possible!
|
||||
#define AIF_ON_SUBSYS_PATH (1 << 11) // Current path leads to a subsystem
|
||||
#define AIF_AVOID_SHOCKWAVE_SHIP (1 << 12) // Avoid an existing shockwave from a ship.
|
||||
#define AIF_AVOID_SHOCKWAVE_WEAPON (1 << 13) // Avoid an expected shockwave from a weapon. shockwave_object field contains object index.
|
||||
#define AIF_AVOID_SHOCKWAVE_STARTED (1 << 14) // Already started avoiding shockwave, don't keep deciding whether to avoid.
|
||||
#define AIF_ATTACK_SLOWLY (1 << 15) // Move slowly while attacking.
|
||||
#define AIF_REPAIR_OBSTRUCTED (1 << 16) // Ship wants to be repaired, but path is obstructed.
|
||||
#define AIF_KAMIKAZE (1 << 17) // Crash into target
|
||||
#define AIF_NO_DYNAMIC (1 << 18) // Not allowed to get dynamic goals
|
||||
#define AIF_AVOIDING_SMALL_SHIP (1 << 19) // Avoiding a player ship.
|
||||
#define AIF_AVOIDING_BIG_SHIP (1 << 20) // Avoiding a large ship.
|
||||
#define AIF_BIG_SHIP_COLLIDE_RECOVER_1 (1 << 21) // Collided into a big ship. Recovering by flying away.
|
||||
#define AIF_BIG_SHIP_COLLIDE_RECOVER_2 (1 << 22) // Collided into a big ship. Fly towards big ship sphere perimeter.
|
||||
#define AIF_STEALTH_PURSUIT (1 << 23) // Ai is trying to fight stealth ship
|
||||
|
||||
#define AIF_AVOID_SHOCKWAVE (AIF_AVOID_SHOCKWAVE_SHIP | AIF_AVOID_SHOCKWAVE_WEAPON)
|
||||
// Goober5000
|
||||
#define AIF_UNLOAD_PRIMARIES (1 << 24) // Fire primaries as fast as possible!
|
||||
|
||||
#define AIF_AVOID_SHOCKWAVE (AIF_AVOID_SHOCKWAVE_SHIP | AIF_AVOID_SHOCKWAVE_WEAPON)
|
||||
#define AIF_FORMATION (AIF_FORMATION_WING | AIF_FORMATION_OBJECT)
|
||||
|
||||
// dock_orient_and_approach() modes.
|
||||
@@ -209,14 +318,14 @@
|
||||
#define AIDO_DOCK_NOW 2 // Immediately move into dock position. For ships that start mission docked.
|
||||
#define AIDO_UNDOCK 3 // Set goal of undocking with object.
|
||||
|
||||
#define MAX_AI_GOALS 5
|
||||
|
||||
// Submodes for seeking safety.
|
||||
#define AISS_1 41 // Pick a spot to fly to.
|
||||
#define AISS_2 42 // Flying to spot.
|
||||
#define AISS_3 43 // Gotten near spot, fly about there.
|
||||
#define AISS_1a 44 // Pick a new nearby spot because we are endangered, then go to AISS_2
|
||||
|
||||
#define MAX_AI_GOALS 5
|
||||
|
||||
// types of ai goals -- tyese types will help us to determination on which goals should
|
||||
// have priority over others (i.e. when a player issues a goal to a wing, then a seperate
|
||||
// goal to a ship in that wing). We would probably use this type in conjunction with
|
||||
@@ -228,21 +337,31 @@
|
||||
#define AIG_TYPE_DYNAMIC 5 // created on the fly
|
||||
|
||||
// flags for AI_GOALS
|
||||
#define AIGF_DOCKER_NAME_VALID (1<<0) // when set, name field for docker is valid
|
||||
#define AIGF_DOCKEE_NAME_VALID (1<<1) // when set, name field for dockee is valid
|
||||
#define AIGF_DOCKER_INDEX_VALID (1<<0) // when set, index field for docker is valid
|
||||
#define AIGF_DOCKEE_INDEX_VALID (1<<1) // when set, index field for dockee is valid
|
||||
#define AIGF_GOAL_ON_HOLD (1<<2) // when set, this goal cannot currently be satisfied, although it could be in the future
|
||||
#define AIGF_SUBSYS_NAME_VALID (1<<3) // when set, the subsystem name (for a destroy subsystem goal) is valid, and stored in docker.name field!!
|
||||
#define AIGF_SUBSYS_NEEDS_FIXUP (1<<3) // when set, the subsystem index (for a destroy subsystem goal) is invalid and must be gotten from the subsys name stored in docker.name field!!
|
||||
#define AIGF_GOAL_OVERRIDE (1<<4) // paired with AIG_TYPE_DYNAMIC to mean this goal overrides any other goal
|
||||
#define AIGF_PURGE (1<<5) // purge this goal next time we process
|
||||
#define AIGF_GOALS_PURGED (1<<6) // this goal has already caused other goals to get purged
|
||||
#define AIGF_DOCK_SOUND_PLAYED (1<<7) // Goober5000 - replacement for AL's hack ;)
|
||||
|
||||
#define AIGF_DOCK_INDEXES_VALID (AIGF_DOCKER_INDEX_VALID|AIGF_DOCKEE_INDEX_VALID)
|
||||
|
||||
// Flags to ai_turn_towards_vector().
|
||||
#define AITTV_FAST (1<<0) // Turn fast, not slowed down based on skill level.
|
||||
#define AITTV_VIA_SEXP (1<<1) // Goober5000 - via sexp
|
||||
#define AITTV_IGNORE_BANK (1<<2) // Goober5000 - ignore bank when turning
|
||||
|
||||
#define KAMIKAZE_HULL_ON_DEATH -1000.0f // Hull strength ship gets set to if it crash-dies.
|
||||
|
||||
// Goober5000, currently only used for the ai-chase-any-except behavior. This can never go
|
||||
// above 32, because 32 is the maximum number of bits possible in a unit data type. If you
|
||||
// need more, you're out of luck - you'll have to add a second special object array. :)
|
||||
#define MAX_SPECIAL_OBJECTS 32
|
||||
|
||||
// structure for AI goals
|
||||
typedef struct ai_goals {
|
||||
typedef struct ai_goal {
|
||||
int signature; // Unique identifier. All goals ever created (per mission) have a unique signature.
|
||||
int ai_mode; // one of the AIM_* modes for this goal
|
||||
int ai_submode; // maybe need a submode
|
||||
@@ -255,7 +374,16 @@ typedef struct ai_goals {
|
||||
int wp_index; // index into waypoints list of waypoints that this ship might fly.
|
||||
int weapon_signature; // signature of weapon this ship might be chasing. Paired with above value to get target.
|
||||
|
||||
// Goober5000
|
||||
char *special_object[MAX_SPECIAL_OBJECTS]; // name of ship (or wing) that this goal acts upon
|
||||
int special_object_num[MAX_SPECIAL_OBJECTS]; // index of ship or wing in Ship[] or Wing[]
|
||||
int special_object_index[MAX_SPECIAL_OBJECTS]; // index of special_object in Goal_ship_names[][]
|
||||
uint special_object_flags;
|
||||
int num_special_objects;
|
||||
|
||||
// unions for docking stuff.
|
||||
// (AIGF_DOCKER_INDEX_VALID and AIGF_DOCKEE_INDEX_VALID tell us to use indexes; otherwise we use names)
|
||||
// these are the dockpoints used on the docker and dockee ships, not the ships themselves
|
||||
union {
|
||||
char *name;
|
||||
int index;
|
||||
@@ -268,9 +396,6 @@ typedef struct ai_goals {
|
||||
|
||||
} ai_goal;
|
||||
|
||||
#include "ship/ship.h" // ai_goal must be declared before including this.
|
||||
|
||||
#define MAX_AI_CLASSES 10
|
||||
#define MAX_GOAL_SHIP_NAMES 100
|
||||
|
||||
#define AIM_CHASE 0
|
||||
@@ -294,8 +419,9 @@ typedef struct ai_goals {
|
||||
#define AIM_BAY_DEPART 18 // Departing to a fighter bay, following path to do so
|
||||
#define AIM_SENTRYGUN 19 // AI mode for sentry guns only (floating turrets)
|
||||
#define AIM_WARP_OUT 20 // Commence warp out sequence. Point in legal direction. Then call John's code.
|
||||
#define AIM_FLY_TO_SHIP 21 // [Kazan] Fly to a ship, doesn't matter if it's hostile or friendly -- for Autopilot usage
|
||||
|
||||
#define MAX_AI_BEHAVIORS 21 // Number of AIM_xxxx types
|
||||
#define MAX_AI_BEHAVIORS 22 // Number of AIM_xxxx types
|
||||
|
||||
#define MAX_WAYPOINTS_PER_LIST 20
|
||||
#define MAX_WAYPOINT_LISTS 32
|
||||
@@ -308,7 +434,7 @@ typedef struct waypoint_list {
|
||||
char name[NAME_LENGTH];
|
||||
int count;
|
||||
char flags[MAX_WAYPOINTS_PER_LIST];
|
||||
vector waypoints[MAX_WAYPOINTS_PER_LIST];
|
||||
vec3d waypoints[MAX_WAYPOINTS_PER_LIST];
|
||||
} waypoint_list;
|
||||
|
||||
#define AI_GOAL_NONE -1
|
||||
@@ -348,7 +474,7 @@ typedef struct ai_class {
|
||||
#define AIS_DOCK_1 22
|
||||
#define AIS_DOCK_2 23
|
||||
#define AIS_DOCK_3 24
|
||||
#define AIS_DOCK_3A 25
|
||||
//#define AIS_DOCK_3A 25
|
||||
#define AIS_DOCK_4 26 // Only for rearm/repair.
|
||||
#define AIS_DOCK_4A 27 // Only for not rearm/repair. MK, 7/15/97
|
||||
#define AIS_UNDOCK_0 30
|
||||
@@ -384,6 +510,7 @@ typedef struct ai_class {
|
||||
#define AIS_WARP_3 302
|
||||
#define AIS_WARP_4 303
|
||||
#define AIS_WARP_5 304
|
||||
#define AIS_DEPART_TO_BAY 305
|
||||
|
||||
// A node on a path.
|
||||
// Contains global location of point.
|
||||
@@ -391,7 +518,7 @@ typedef struct ai_class {
|
||||
// This hook is used to extract information on the point such as whether it is
|
||||
// protected by turrets.
|
||||
typedef struct pnode {
|
||||
vector pos;
|
||||
vec3d pos;
|
||||
int path_num; // path number from polymodel, ie in polymodel, paths[path_num]
|
||||
int path_index; // index in original model path of point, ie in model_path, use verts[path_index]
|
||||
} pnode;
|
||||
@@ -417,14 +544,15 @@ typedef struct ai_info {
|
||||
int stealth_last_cheat_visible_stamp; // when within 100m, always update pos and velocity, with error increasing for increasing time from last legal visible
|
||||
int stealth_last_visible_stamp;
|
||||
float stealth_sweep_box_size;
|
||||
vector stealth_last_pos;
|
||||
vector stealth_velocity;
|
||||
vec3d stealth_last_pos;
|
||||
vec3d stealth_velocity;
|
||||
|
||||
float previous_dot_to_enemy; // dot(fvec, vec_to_enemy) last frame
|
||||
float target_time; // Amount of time continuously targeting this ship.
|
||||
|
||||
int enemy_wing; // When picking an enemy wing, only allow to be in enemy_wing, unless == -1, in which case don't care.
|
||||
int attacker_objnum;
|
||||
|
||||
int goal_objnum; // mode specific goal. In DOCK, ship to dock with.
|
||||
int goal_signature;
|
||||
|
||||
@@ -442,7 +570,7 @@ typedef struct ai_info {
|
||||
int wp_index; // waypoint index in list
|
||||
int wp_flags; // waypoint flags, see WPF_xxxx
|
||||
int wp_dir; // 1 or -1, amount to add to get to next waypoint index.
|
||||
char waypoint_speed_cap; // -1 no cap, otherwise cap
|
||||
int waypoint_speed_cap; // -1 no cap, otherwise cap - changed to int by Goober5000
|
||||
|
||||
// Path following information
|
||||
int path_start; // Index into global array, start of path.
|
||||
@@ -453,7 +581,7 @@ typedef struct ai_info {
|
||||
int path_objnum; // Object of interest. It's model contains the path.
|
||||
int path_goal_obj_hash; // Hash value of goal object when global path created.
|
||||
fix path_next_create_time; // Next time at which we'll create a global path.
|
||||
vector path_create_pos; // Object's position at time of global path creation.
|
||||
vec3d path_create_pos; // Object's position at time of global path creation.
|
||||
matrix path_create_orient; // Object's orientation at time of global path creation.
|
||||
int mp_index; // Model path index. Index in polymodel:model_paths
|
||||
fix path_next_check_time; // Last time checked to see if would collide with model.
|
||||
@@ -474,7 +602,7 @@ typedef struct ai_info {
|
||||
int active_goal; // index of active goal, -1 if none, AI_ACTIVE_GOAL_DYNAMIC if dynamic (runtime-created) goal
|
||||
int goal_check_time; // timer used for processing goals for this ai object
|
||||
|
||||
vector last_predicted_enemy_pos; // Where he thought enemy was last time.
|
||||
vec3d last_predicted_enemy_pos; // Where he thought enemy was last time.
|
||||
float time_enemy_in_range; // Amount of time enemy continuously in "sight", near crosshair.
|
||||
fix last_attack_time; // Missiontime of last time this ship attacked its enemy.
|
||||
fix last_hit_time; // Missiontime of last time this ship was hit by anyone.
|
||||
@@ -485,8 +613,8 @@ typedef struct ai_info {
|
||||
fix resume_goal_time; // Time at which to resume interrupted goal, if nothing else intervenes.
|
||||
float prev_accel; // Acceleration last frame.
|
||||
float prev_dot_to_goal; // dot of fvec to goal last frame, used to see if making progress towards goal.
|
||||
vector goal_point; // Used in AIM_SAFETY, AIM_STILL and in circling.
|
||||
vector prev_goal_point; // Previous location of goal point, used at least for evading.
|
||||
vec3d goal_point; // Used in AIM_SAFETY, AIM_STILL and in circling.
|
||||
vec3d prev_goal_point; // Previous location of goal point, used at least for evading.
|
||||
float ai_accuracy, ai_evasion, ai_courage, ai_patience;
|
||||
union {
|
||||
float lead_scale; // Amount to lead current opponent by.
|
||||
@@ -501,15 +629,15 @@ typedef struct ai_info {
|
||||
|
||||
// ship_subsys *targeted_subobject; // subsystem to attack
|
||||
// int attack_subsystem_parent; // objnum of the object containing the attack_subsystem
|
||||
int dock_index; // index of docking point to use when docking.
|
||||
int dockee_index; // index of dock point on other ship.
|
||||
int dock_path_index; // index of docking path to use when docking.
|
||||
int dock_objnum; // objnum of ship we are docked with.
|
||||
int dock_signature; // Signature of repair object.
|
||||
|
||||
// Goober5000
|
||||
int support_ship_objnum; // objnum of support ship docking with us, or (if we're a support ship) object we're docking to
|
||||
int support_ship_signature; // signature of the same
|
||||
|
||||
int danger_weapon_objnum; // Closest objnum of weapon fired at this ship.
|
||||
int danger_weapon_signature; // Signature of object danger_weapon_objnum.
|
||||
|
||||
vector guard_vec; // vector to object being guarded, only used in AIS_GUARD_STATIC submode
|
||||
vec3d guard_vec; // vector to object being guarded, only used in AIS_GUARD_STATIC submode
|
||||
int nearest_locked_object; // Nearest locked object.
|
||||
float nearest_locked_distance; // Distance to nearest locked object.
|
||||
|
||||
@@ -524,6 +652,7 @@ typedef struct ai_info {
|
||||
int last_target;
|
||||
|
||||
int rearm_first_missile; // flag to show that reloading of missilies hasn't begun yet
|
||||
int rearm_first_ballistic_primary; // flag to show that reloading of ballistic primaries hasn't begun yet
|
||||
int rearm_release_delay; // timestamp used to delay separation of ships after rearm complete
|
||||
|
||||
fix afterburner_stop_time; // Missiontime to turn off afterburner
|
||||
@@ -547,19 +676,19 @@ typedef struct ai_info {
|
||||
int ok_to_target_timestamp; // Time at which this ship can dynamically target.
|
||||
|
||||
float kamikaze_damage; // some damage value used to produce a shockwave from a kamikaze ship
|
||||
vector big_attack_point; // Global point this ship is attacking on a big ship.
|
||||
vector big_attack_surface_normal; // Surface normal at ship at big_attack_point;
|
||||
vec3d big_attack_point; // Global point this ship is attacking on a big ship.
|
||||
vec3d big_attack_surface_normal; // Surface normal at ship at big_attack_point;
|
||||
int pick_big_attack_point_timestamp; // timestamp at which to pick a new point to attack on a big ship.
|
||||
|
||||
// Note: These three avoid_XX terms are shared between the code that avoids small (only player now) and large ships
|
||||
// The bits in ai_flags determine which is occurring. AIF_AVOID_SMALL_SHIP, AIF_AVOID_BIG_SHIP
|
||||
int avoid_ship_num; // object index of small ship to avoid
|
||||
vector avoid_goal_point; // point to aim at when avoiding a ship
|
||||
vec3d avoid_goal_point; // point to aim at when avoiding a ship
|
||||
fix avoid_check_timestamp; // timestamp at which to next check for having to avoid ship
|
||||
|
||||
vector big_collision_normal; // Global normal of collision with big ship. Helps find direction to fly away from big ship. Set for each collision.
|
||||
vector big_recover_pos_1; // Global point to fly towards when recovering from collision with a big ship, stage 1.
|
||||
vector big_recover_pos_2; // Global point to fly towards when recovering from collision with a big ship, stage 2.
|
||||
vec3d big_collision_normal; // Global normal of collision with big ship. Helps find direction to fly away from big ship. Set for each collision.
|
||||
vec3d big_recover_pos_1; // Global point to fly towards when recovering from collision with a big ship, stage 1.
|
||||
vec3d big_recover_pos_2; // Global point to fly towards when recovering from collision with a big ship, stage 2.
|
||||
int big_recover_timestamp; // timestamp at which it's OK to re-enter stage 1.
|
||||
|
||||
int abort_rearm_timestamp; // time at which this rearm should be aborted in a multiplayer game.
|
||||
@@ -568,7 +697,7 @@ typedef struct ai_info {
|
||||
int artillery_objnum; // object currently being targeted for artillery lock/attack
|
||||
int artillery_sig; // artillery object signature
|
||||
float artillery_lock_time; // how long we've been locked onto this guy
|
||||
vector artillery_lock_pos; // base position of the lock point on (in model's frame of reference)
|
||||
vec3d artillery_lock_pos; // base position of the lock point on (in model's frame of reference)
|
||||
float lethality; // measure of how dangerous ship is to enemy BIG|HUGE ships (likelyhood of targeting)
|
||||
} ai_info;
|
||||
|
||||
@@ -597,8 +726,8 @@ extern ai_info *Player_ai;
|
||||
|
||||
extern int Waypoints_created; // externed since needed for save/restore
|
||||
|
||||
extern ai_class Ai_classes[];
|
||||
extern char *Ai_class_names[];
|
||||
extern ai_class *Ai_classes;
|
||||
extern char** Ai_class_names;
|
||||
|
||||
extern int Num_ai_classes;
|
||||
extern int Ai_firing_enabled;
|
||||
@@ -636,18 +765,18 @@ extern waypoint_list Waypoint_lists[MAX_WAYPOINT_LISTS];
|
||||
extern int Num_waypoint_lists;
|
||||
|
||||
extern void init_ai_system(void);
|
||||
extern void ai_attack_object(object *attacker, object *attacked, int priority, ship_subsys *ssp);
|
||||
extern void ai_attack_object(object *attacker, object *attacked, int priority, ship_subsys *ssp, int except = 0);
|
||||
extern void ai_evade_object(object *evader, object *evaded, int priority);
|
||||
extern void ai_ignore_object(object *ignorer, object *ignored, int priority);
|
||||
extern void ai_ignore_wing(object *ignorer, int wingnum, int priority);
|
||||
extern void ai_dock_with_object(object *docker, object *dockee, int priority, int dock_type, int docker_index, int dockee_index);
|
||||
extern void ai_stay_still(object *still_objp, vector *view_pos);
|
||||
extern void ai_dock_with_object(object *docker, int docker_index, object *dockee, int dockee_index, int priority, int dock_type);
|
||||
extern void ai_stay_still(object *still_objp, vec3d *view_pos);
|
||||
extern void ai_set_default_behavior(object *obj, int classnum);
|
||||
extern void ai_do_default_behavior(object *obj);
|
||||
extern void ai_start_waypoints(object *objp, int waypoint_list_index, int wp_flags);
|
||||
extern void ai_ship_hit(object *objp_ship, object *hit_objp, vector *hitpos, int shield_quadrant, vector *hit_normal);
|
||||
extern void ai_ship_hit(object *objp_ship, object *hit_objp, vec3d *hitpos, int shield_quadrant, vec3d *hit_normal);
|
||||
extern void ai_ship_destroy(int shipnum, int method);
|
||||
extern void ai_turn_towards_vector(vector *dest, object *objp, float frametime, float turn_time, vector *slide_vec, vector *rel_pos, float bank_override, int flags, vector *rvec = NULL);
|
||||
extern void ai_turn_towards_vector(vec3d *dest, object *objp, float frametime, float turn_time, vec3d *slide_vec, vec3d *rel_pos, float bank_override, int flags, vec3d *rvec = NULL, int sexp_flags = 0);
|
||||
extern void init_ai_object(int objnum);
|
||||
extern void ai_init(void); // Call this one to parse ai.tbl.
|
||||
extern void ai_level_init(void); // Call before each level to reset AI
|
||||
@@ -656,66 +785,66 @@ extern int ai_set_attack_subsystem(object *objp, int subnum);
|
||||
extern int ai_issue_rearm_request(object *requester_objp); // Object requests rearm/repair.
|
||||
extern int ai_abort_rearm_request(object *requester_objp); // Object aborts rearm/repair.
|
||||
extern void ai_do_repair_frame(object *objp, ai_info *aip, float frametime); // Repair a ship object, player or AI.
|
||||
extern float dock_orient_and_approach(object *objp, object *dobjp, int dock_mode); // Move to a position relative to a dock bay using thrusters.
|
||||
extern void ai_update_danger_weapon(int objnum, int weapon_objnum);
|
||||
|
||||
// called externally from MissionParse.cpp to position ships in wings upon arrival into the
|
||||
// mission.
|
||||
extern void get_absolute_wing_pos( vector *result_pos, object *leader_objp, int wing_index, int formation_object_flag);
|
||||
extern void get_absolute_wing_pos( vec3d *result_pos, object *leader_objp, int wing_index, int formation_object_flag);
|
||||
|
||||
|
||||
// Interface from goals code to AI. Set ship to guard. *objp guards *other_objp
|
||||
extern void ai_set_guard_object(object *objp, object *other_objp);
|
||||
extern void ai_set_evade_object(object *objp, object *other_objp);
|
||||
extern void ai_set_guard_wing(object *objp, int wingnum);
|
||||
extern void ai_warp_out(object *objp, vector *vp);
|
||||
extern void ai_warp_out(object *objp, vec3d *vp);
|
||||
extern void ai_attack_wing(object *attacker, int wingnum, int priority);
|
||||
extern void ai_deathroll_start(object *ship_obj);
|
||||
extern void ai_fly_in_formation(int wing_num); // Force wing to fly in formation.
|
||||
extern void ai_disband_formation(int wing_num); // Force wing to disband formation flying.
|
||||
extern object *ai_find_docked_object( object *objp ); // returns object that objp is docked to
|
||||
extern int set_target_objnum(ai_info *aip, int objnum);
|
||||
extern void ai_form_on_wing(object *objp, object *goal_objp);
|
||||
extern void ai_do_stay_near(object *objp, object *other_obj, float dist);
|
||||
extern ship_subsys *set_targeted_subsys(ai_info *aip, ship_subsys *new_subsys, int parent_objnum);
|
||||
extern void ai_rearm_repair( object *objp, object *goal_objp, int priority, int docker_index, int dockee_index );
|
||||
extern void ai_rearm_repair( object *objp, int docker_index, object *goal_objp, int dockee_index, int priority );
|
||||
extern void ai_add_rearm_goal( object *requester_objp, object *support_objp );
|
||||
extern void create_model_path(object *pl_objp, object *mobjp, int path_num, int subsys_path=0);
|
||||
|
||||
// Goober5000
|
||||
extern void ai_do_safety(object *objp);
|
||||
|
||||
// used to get path info for fighter bay emerging and departing
|
||||
int ai_acquire_emerge_path(object *pl_objp, int parent_objnum, vector *pos, vector *fvec);
|
||||
int ai_acquire_emerge_path(object *pl_objp, int parent_objnum, vec3d *pos, vec3d *fvec);
|
||||
int ai_acquire_depart_path(object *pl_objp, int parent_objnum);
|
||||
|
||||
// used by AiBig.cpp
|
||||
extern void ai_set_positions(object *pl_objp, object *en_objp, ai_info *aip, vector *player_pos, vector *enemy_pos);
|
||||
extern void ai_set_positions(object *pl_objp, object *en_objp, ai_info *aip, vec3d *player_pos, vec3d *enemy_pos);
|
||||
extern void accelerate_ship(ai_info *aip, float accel);
|
||||
extern void turn_away_from_point(object *objp, vector *point, float bank_override);
|
||||
extern void turn_away_from_point(object *objp, vec3d *point, float bank_override);
|
||||
extern float ai_endangered_by_weapon(ai_info *aip);
|
||||
extern void update_aspect_lock_information(ai_info *aip, vector *vec_to_enemy, float dist_to_enemy, float enemy_radius);
|
||||
extern void update_aspect_lock_information(ai_info *aip, vec3d *vec_to_enemy, float dist_to_enemy, float enemy_radius);
|
||||
extern void ai_chase_ct();
|
||||
extern void ai_find_path(object *pl_objp, int objnum, int path_num, int exit_flag, int subsys_path=0);
|
||||
extern float ai_path();
|
||||
extern void evade_weapon();
|
||||
extern int might_collide_with_ship(object *obj1, object *obj2, float dot_to_enemy, float dist_to_enemy, float duration);
|
||||
extern void ai_fire_primary_weapon(object *objp);
|
||||
extern int ai_fire_primary_weapon(object *objp); //changed to return weather it fired-Bobboau
|
||||
extern int ai_fire_secondary_weapon(object *objp, int priority1 = -1, int priority2 = -1);
|
||||
extern float ai_get_weapon_dist(ship_weapon *swp);
|
||||
extern void turn_towards_point(object *objp, vector *point, vector *slide_vec, float bank_override);
|
||||
extern void turn_towards_point(object *objp, vec3d *point, vec3d *slide_vec, float bank_override);
|
||||
extern int ai_maybe_fire_afterburner(object *objp, ai_info *aip);
|
||||
extern void set_predicted_enemy_pos(vector *predicted_enemy_pos, object *pobjp, object *eobjp, ai_info *aip);
|
||||
extern void set_predicted_enemy_pos(vec3d *predicted_enemy_pos, object *pobjp, object *eobjp, ai_info *aip);
|
||||
|
||||
extern int is_instructor(object *objp);
|
||||
extern int find_enemy(int objnum, float range, int max_attackers);
|
||||
extern int find_enemy(int objnum, float range, int max_attackers, int except = 0);
|
||||
|
||||
float ai_get_weapon_speed(ship_weapon *swp);
|
||||
void set_predicted_enemy_pos_turret(vector *predicted_enemy_pos, vector *gun_pos, object *pobjp, vector *enemy_pos, vector *enemy_vel, float weapon_speed, float time_enemy_in_range);
|
||||
void ai_turret_select_default_weapon(ship_subsys *turret);
|
||||
void set_predicted_enemy_pos_turret(vec3d *predicted_enemy_pos, vec3d *gun_pos, object *pobjp, vec3d *enemy_pos, vec3d *enemy_vel, float weapon_speed, float time_enemy_in_range);
|
||||
|
||||
// function to change rearm status for ai ships (called from sexpression code)
|
||||
extern void ai_set_rearm_status( int team, int new_status );
|
||||
extern void ai_good_secondary_time( int team, int weapon_index, int num_weapons, char *shipname );
|
||||
|
||||
extern void ai_do_objects_docked_stuff( object *docker, object *dockee );
|
||||
extern void ai_do_objects_docked_stuff(object *docker, int docker_point, object *dockee, int dockee_point);
|
||||
extern void ai_do_objects_undocked_stuff( object *docker, object *dockee );
|
||||
extern void ai_do_objects_repairing_stuff( object *repaired_obj, object *repair_obj, int how );
|
||||
|
||||
@@ -723,4 +852,17 @@ extern int find_danger_weapon(object *sobjp, float dtime, float *atime, float do
|
||||
|
||||
void ai_set_mode_warp_out(object *objp, ai_info *aip);
|
||||
|
||||
// prototyped by Goober5000
|
||||
int get_nearest_objnum(int objnum, int enemy_team_mask, int enemy_wing, float range, int max_attackers, int except = 0);
|
||||
|
||||
// moved to header file by Goober5000
|
||||
void ai_announce_ship_dying(object *dying_objp);
|
||||
|
||||
// added by kazan
|
||||
void ai_start_fly_to_ship(object *objp, int shipnum);
|
||||
void ai_fly_to_ship();
|
||||
|
||||
//Moved declaration here for player ship -WMC
|
||||
void process_subobjects(int objnum);
|
||||
|
||||
#endif
|
||||
@@ -9,13 +9,82 @@
|
||||
|
||||
/*
|
||||
* $Logfile: /Freespace2/code/Ship/AiBig.cpp $
|
||||
* $Revision: 2.1 $
|
||||
* $Date: 2002-08-01 01:41:09 $
|
||||
* $Author: penguin $
|
||||
* $Revision: 1.6 $
|
||||
* $Date: 2005-09-01 04:14:03 $
|
||||
* $Author: taylor $
|
||||
*
|
||||
* C module for AI code related to large ships
|
||||
*
|
||||
* $Log: not supported by cvs2svn $
|
||||
* Revision 1.5 2005/07/27 18:27:49 Goober5000
|
||||
* verified that submode_start_time is updated whenever submode is changed
|
||||
* --Goober5000
|
||||
*
|
||||
* Revision 1.4 2005/07/25 05:23:33 Goober5000
|
||||
* whoops
|
||||
* --Goober5000
|
||||
*
|
||||
* Revision 1.3 2005/07/25 03:13:23 Goober5000
|
||||
* various code cleanups, tweaks, and fixes; most notably the MISSION_FLAG_USE_NEW_AI
|
||||
* should now be added to all places where it is needed (except the turret code, which I still
|
||||
* have to to review)
|
||||
* --Goober5000
|
||||
*
|
||||
* Revision 1.2 2005/04/05 05:53:13 taylor
|
||||
* s/vector/vec3d/g, better support for different compilers (Jens Granseuer)
|
||||
*
|
||||
* Revision 1.1 2005/03/25 06:45:12 wmcoolmon
|
||||
* Initial AI code move commit - note that aigoals.cpp has some escape characters in it, I'm not sure if this is really a problem.
|
||||
*
|
||||
* Revision 2.12 2005/03/10 08:00:14 taylor
|
||||
* change min/max to MIN/MAX to fix GCC problems
|
||||
* add lab stuff to Makefile
|
||||
* build unbreakage for everything that's not MSVC++ 6
|
||||
* lots of warning fixes
|
||||
* fix OpenGL rendering problem with ship insignias
|
||||
* no Warnings() in non-debug mode for Linux (like Windows)
|
||||
* some campaign savefile fixage to stop reverting everyones data
|
||||
*
|
||||
* Revision 2.11 2004/11/27 10:49:14 taylor
|
||||
* make sure the old behavior still applies to everything that's not a beam
|
||||
*
|
||||
* Revision 2.10 2004/07/26 20:47:50 Kazan
|
||||
* remove MCD complete
|
||||
*
|
||||
* Revision 2.9 2004/07/12 16:33:04 Kazan
|
||||
* MCD - define _MCD_CHECK to use memory tracking
|
||||
*
|
||||
* Revision 2.8 2004/03/05 09:01:51 Goober5000
|
||||
* Uber pass at reducing #includes
|
||||
* --Goober5000
|
||||
*
|
||||
* Revision 2.7 2003/11/11 02:15:40 Goober5000
|
||||
* ubercommit - basically spelling and language fixes with some additional
|
||||
* warnings disabled
|
||||
* --Goober5000
|
||||
*
|
||||
* Revision 2.6 2003/06/25 03:16:32 phreak
|
||||
* changed around ai code to take into account a limited lock range for local ssms
|
||||
*
|
||||
* Revision 2.5 2003/06/11 03:03:16 phreak
|
||||
* the ai can now use local ssms. they are able to use them at *very* long range
|
||||
*
|
||||
* Revision 2.4 2003/03/20 08:24:45 unknownplayer
|
||||
* Modified the command line options so they are all in lower-case characters.
|
||||
* Made a slight AI adjustment to how ships choose to attack turrets (they now have a 25% chance of attacking a beam turret which has fired at them from another ship)
|
||||
*
|
||||
* Revision 2.3 2003/01/15 07:09:09 Goober5000
|
||||
* changed most references to modelnum to use ship instead of ship_info --
|
||||
* this will help with the change-model sexp and any other instances of model
|
||||
* changing
|
||||
* --Goober5000
|
||||
*
|
||||
* Revision 2.2 2002/10/19 19:29:28 bobboau
|
||||
* inital commit, trying to get most of my stuff into FSO, there should be most of my fighter beam, beam rendering, beam shield hit, ABtrails, and ssm stuff. one thing you should be happy to know is the beam texture tileing is now set in the beam section section of the weapon table entry
|
||||
*
|
||||
* Revision 2.1 2002/08/01 01:41:09 penguin
|
||||
* The big include file move
|
||||
*
|
||||
* Revision 2.0 2002/06/03 04:02:28 penguin
|
||||
* Warpcore CVS sync
|
||||
*
|
||||
@@ -337,39 +406,18 @@
|
||||
* $NoKeywords: $
|
||||
*/
|
||||
|
||||
#include "globalincs/pstypes.h"
|
||||
#include "math/fix.h"
|
||||
#include "ai/aibig.h"
|
||||
#include "globalincs/linklist.h"
|
||||
#include "object/object.h"
|
||||
#include "physics/physics.h"
|
||||
#include "math/vecmat.h"
|
||||
#include "ship/ship.h"
|
||||
#include "model/model.h"
|
||||
#include "graphics/2d.h"
|
||||
#include "render/3d.h"
|
||||
#include "ship/ai.h"
|
||||
#include "ship/aibig.h"
|
||||
#include "math/floating.h"
|
||||
#include "playerman/player.h"
|
||||
#include "ship/afterburner.h"
|
||||
#include "freespace2/freespace.h"
|
||||
#include "weapon/weapon.h"
|
||||
#include "mission/missiongoals.h"
|
||||
#include "mission/missionlog.h"
|
||||
#include "io/timer.h"
|
||||
#include "sound/sound.h"
|
||||
#include "ship/aigoals.h"
|
||||
#include "gamesnd/gamesnd.h"
|
||||
#include "hud/hudmessage.h"
|
||||
#include "mission/missionmessage.h"
|
||||
#include "cmeasure/cmeasure.h"
|
||||
#include "math/staticrand.h"
|
||||
#include "network/multimsgs.h"
|
||||
#include "ship/afterburner.h"
|
||||
#include "hud/hudets.h"
|
||||
#include "ship/shipfx.h"
|
||||
#include "ship/shiphit.h"
|
||||
#include "mission/missionparse.h"
|
||||
|
||||
|
||||
|
||||
#pragma optimize("", off)
|
||||
#pragma auto_inline(off)
|
||||
|
||||
@@ -401,13 +449,13 @@
|
||||
|
||||
// forward declarations
|
||||
void ai_big_evade_ship();
|
||||
void ai_big_chase_attack(ai_info *aip, ship_info *sip, vector *enemy_pos, float dist_to_enemy);
|
||||
void ai_big_chase_attack(ai_info *aip, ship_info *sip, vec3d *enemy_pos, float dist_to_enemy, int modelnum);
|
||||
void ai_big_avoid_ship();
|
||||
int ai_big_maybe_follow_subsys_path(int do_dot_check=1);
|
||||
|
||||
extern int model_which_octant_distant_many( vector *pnt, int model_num,matrix *model_orient, vector * model_pos, polymodel **pm, int *octs);
|
||||
extern void compute_desired_rvec(vector *rvec, vector *goal_pos, vector *cur_pos);
|
||||
extern void big_ship_collide_recover_start(object *objp, object *big_objp, vector *collide_pos, vector *collision_normal);
|
||||
extern int model_which_octant_distant_many( vec3d *pnt, int model_num,matrix *model_orient, vec3d * model_pos, polymodel **pm, int *octs);
|
||||
extern void compute_desired_rvec(vec3d *rvec, vec3d *goal_pos, vec3d *cur_pos);
|
||||
extern void big_ship_collide_recover_start(object *objp, object *big_objp, vec3d *collide_pos, vec3d *collision_normal);
|
||||
|
||||
|
||||
// Called by ai_big_pick_attack_point.
|
||||
@@ -415,11 +463,11 @@ extern void big_ship_collide_recover_start(object *objp, object *big_objp, vecto
|
||||
// If truly_random flag set (haha), then generate a pretty random number. Otherwise, generate a static rand which
|
||||
// tends to not change from frame to frame.
|
||||
// Try four times and choose nearest point to increase chance of getting a good point.
|
||||
void ai_bpap(object *objp, vector *attacker_objp_pos, vector *attacker_objp_fvec, vector *attack_point, vector *local_attack_point, float fov, float weapon_travel_dist, vector *surface_normal)
|
||||
void ai_bpap(object *objp, vec3d *attacker_objp_pos, vec3d *attacker_objp_fvec, vec3d *attack_point, vec3d *local_attack_point, float fov, float weapon_travel_dist, vec3d *surface_normal)
|
||||
{
|
||||
float nearest_dist;
|
||||
vector result_point, best_point;
|
||||
vector rel_point;
|
||||
vec3d result_point, best_point;
|
||||
vec3d rel_point;
|
||||
int num_tries;
|
||||
model_octant *octp;
|
||||
polymodel *pm;
|
||||
@@ -459,7 +507,7 @@ void ai_bpap(object *objp, vector *attacker_objp_pos, vector *attacker_objp_fvec
|
||||
for (i=0; i<num_tries; i++) {
|
||||
int index;
|
||||
float dist, dot;
|
||||
vector v2p;
|
||||
vec3d v2p;
|
||||
|
||||
index = (int) (frand() * (octp->nverts));
|
||||
|
||||
@@ -492,7 +540,7 @@ done_1:
|
||||
// If no collision, cast to (0,0,0) [center of big ship]** [best_point initialized to 000]
|
||||
|
||||
// do in world coords to get attack point, then translate to local for local_attack_point
|
||||
vector attack_dir, end_point, temp;
|
||||
vec3d attack_dir, end_point, temp;
|
||||
float dist;
|
||||
dist = vm_vec_normalized_dir(&attack_dir, attack_point, attacker_objp_pos);
|
||||
|
||||
@@ -533,14 +581,14 @@ done_1:
|
||||
//
|
||||
// Note: Default value for fov is 1.0f 1.0f means don't use fov parameter.
|
||||
// If fov != 1.0f, try up to four times to find a point that's in the field of view.
|
||||
void ai_big_pick_attack_point_turret(object *objp, ship_subsys *ssp, vector *gpos, vector *gvec, vector *attack_point, float fov, float weapon_travel_dist)
|
||||
void ai_big_pick_attack_point_turret(object *objp, ship_subsys *ssp, vec3d *gpos, vec3d *gvec, vec3d *attack_point, float fov, float weapon_travel_dist)
|
||||
{
|
||||
if (!timestamp_elapsed(ssp->turret_pick_big_attack_point_timestamp)) {
|
||||
vector result_point;
|
||||
vec3d result_point;
|
||||
vm_vec_unrotate(&result_point, &ssp->turret_big_attack_point, &objp->orient);
|
||||
vm_vec_add(attack_point, &result_point, &objp->pos);
|
||||
} else {
|
||||
vector local_attack_point;
|
||||
vec3d local_attack_point;
|
||||
ssp->turret_pick_big_attack_point_timestamp = timestamp(2000 + (int) (frand()*500.0f));
|
||||
ai_bpap(objp, gpos, gvec, attack_point, &local_attack_point, fov, weapon_travel_dist, NULL);
|
||||
ssp->turret_big_attack_point = local_attack_point;
|
||||
@@ -553,19 +601,19 @@ void ai_big_pick_attack_point_turret(object *objp, ship_subsys *ssp, vector *gpo
|
||||
// Note: Default value for fov is 1.0f 1.0f means don't use fov parameter.
|
||||
// If fov != 1.0f, try up to four times to find a point that's in the field of view.
|
||||
// Note, attacker_objp can be a ship or a weapon.
|
||||
void ai_big_pick_attack_point(object *objp, object *attacker_objp, vector *attack_point, float fov)
|
||||
void ai_big_pick_attack_point(object *objp, object *attacker_objp, vec3d *attack_point, float fov)
|
||||
{
|
||||
Assert(objp->instance > -1);
|
||||
Assert(objp->type == OBJ_SHIP);
|
||||
|
||||
vector local_attack_point;
|
||||
vec3d local_attack_point;
|
||||
|
||||
switch (attacker_objp->type) {
|
||||
case OBJ_SHIP: {
|
||||
ai_info *attacker_aip;
|
||||
attacker_aip = &Ai_info[Ships[attacker_objp->instance].ai_index];
|
||||
if (!timestamp_elapsed(attacker_aip->pick_big_attack_point_timestamp)) {
|
||||
vector result_point;
|
||||
vec3d result_point;
|
||||
|
||||
vm_vec_unrotate(&result_point, &attacker_aip->big_attack_point, &objp->orient);
|
||||
vm_vec_add(attack_point, &result_point, &objp->pos);
|
||||
@@ -580,7 +628,7 @@ void ai_big_pick_attack_point(object *objp, object *attacker_objp, vector *attac
|
||||
weapon *wp = &Weapons[attacker_objp->instance];
|
||||
|
||||
if (!timestamp_elapsed(wp->pick_big_attack_point_timestamp)) {
|
||||
vector result_point;
|
||||
vec3d result_point;
|
||||
|
||||
vm_vec_unrotate(&result_point, &wp->big_attack_point, &objp->orient);
|
||||
vm_vec_add(attack_point, &result_point, &objp->pos);
|
||||
@@ -594,7 +642,7 @@ void ai_big_pick_attack_point(object *objp, object *attacker_objp, vector *attac
|
||||
}
|
||||
|
||||
// checks valid line to target
|
||||
vector surface_normal;
|
||||
vec3d surface_normal;
|
||||
ai_bpap(objp, &attacker_objp->pos, &attacker_objp->orient.vec.fvec, attack_point, &local_attack_point, fov, 99999.9f, &surface_normal);
|
||||
|
||||
switch (attacker_objp->type) {
|
||||
@@ -624,11 +672,11 @@ void ai_big_pick_attack_point(object *objp, object *attacker_objp, vector *attac
|
||||
// Handler for SM_EVADE submode ( called from ai_big_chase() )
|
||||
void ai_big_evade_ship()
|
||||
{
|
||||
vector player_pos, enemy_pos;
|
||||
vec3d player_pos, enemy_pos;
|
||||
float dist;
|
||||
ship *shipp = &Ships[Pl_objp->instance];
|
||||
ai_info *aip = &Ai_info[shipp->ai_index];
|
||||
vector randvec, semi_enemy_pos;
|
||||
vec3d randvec, semi_enemy_pos;
|
||||
|
||||
ai_set_positions(Pl_objp, En_objp, aip, &player_pos, &enemy_pos);
|
||||
|
||||
@@ -645,7 +693,7 @@ void ai_big_evade_ship()
|
||||
turn_away_from_point(Pl_objp, &semi_enemy_pos, 0.0f);
|
||||
|
||||
float box_dist;
|
||||
vector box_vec;
|
||||
vec3d box_vec;
|
||||
int is_inside;
|
||||
box_dist = get_world_closest_box_point_with_delta(&box_vec, En_objp, &player_pos, &is_inside, EVADE_BOX_BASE_DISTANCE);
|
||||
if (box_dist > EVADE_BOX_BASE_DISTANCE) {
|
||||
@@ -714,7 +762,7 @@ int ai_big_maybe_follow_subsys_path(int do_dot_check)
|
||||
// only check for subsystem sight every N milliseconds
|
||||
checked_sight = 0;
|
||||
if ( timestamp_elapsed(aip->path_subsystem_next_check) ) {
|
||||
vector geye, gsubpos;
|
||||
vec3d geye, gsubpos;
|
||||
eye *ep;
|
||||
|
||||
aip->path_subsystem_next_check = timestamp(1500);
|
||||
@@ -731,7 +779,7 @@ int ai_big_maybe_follow_subsys_path(int do_dot_check)
|
||||
|
||||
// Calc dot between subsys normal (based on using path info), and subsys_to_eye vector. This is
|
||||
// useful later when we want to decide whether we have a realistic line-of-sight to the subsystem.
|
||||
vector subsys_normal, subsys_to_eye;
|
||||
vec3d subsys_normal, subsys_to_eye;
|
||||
if ( do_dot_check ) {
|
||||
if ( !ship_return_subsys_path_normal(&Ships[target_objp->instance], aip->targeted_subsys, &gsubpos, &subsys_normal) ) {
|
||||
vm_vec_normalized_dir(&subsys_to_eye, &geye, &gsubpos);
|
||||
@@ -800,6 +848,7 @@ int ai_big_maybe_follow_subsys_path(int do_dot_check)
|
||||
aip->previous_mode = aip->mode;
|
||||
aip->mode = AIM_NONE;
|
||||
aip->submode = -1;
|
||||
aip->submode_start_time = Missiontime;
|
||||
return 1;
|
||||
}
|
||||
ai_path();
|
||||
@@ -859,11 +908,11 @@ int ai_big_maybe_start_strafe(ai_info *aip, ship_info *sip)
|
||||
}
|
||||
|
||||
// ATTACK submode handler for chase mode.
|
||||
void ai_big_chase_attack(ai_info *aip, ship_info *sip, vector *enemy_pos, float dist_to_enemy)
|
||||
void ai_big_chase_attack(ai_info *aip, ship_info *sip, vec3d *enemy_pos, float dist_to_enemy, int modelnum)
|
||||
{
|
||||
int start_bank;
|
||||
float dot_to_enemy, time_to_hit;
|
||||
polymodel *po = model_get( sip->modelnum );
|
||||
polymodel *po = model_get( modelnum );
|
||||
|
||||
// Maybe evade an incoming weapon.
|
||||
if (((time_to_hit = ai_endangered_by_weapon(aip)) < 4.0f) && (time_to_hit >= 0.0f)) {
|
||||
@@ -877,7 +926,7 @@ void ai_big_chase_attack(ai_info *aip, ship_info *sip, vector *enemy_pos, float
|
||||
for ( objp = GET_FIRST(&obj_used_list); objp !=END_OF_LIST(&obj_used_list); objp = GET_NEXT(objp) ) {
|
||||
if ((objp->type == OBJ_WEAPON) && (Weapons[objp->instance].team != Ships[Pl_objp->instance].team))
|
||||
if (Weapon_info[objp->instance].subtype == WP_LASER) {
|
||||
vector in_vec;
|
||||
vec3d in_vec;
|
||||
float dist;
|
||||
|
||||
vm_vec_sub(&in_vec, &objp->pos, &Pl_objp->pos);
|
||||
@@ -916,7 +965,7 @@ void ai_big_chase_attack(ai_info *aip, ship_info *sip, vector *enemy_pos, float
|
||||
return;
|
||||
}
|
||||
|
||||
vector *rel_pos, vec_to_enemy;
|
||||
vec3d *rel_pos, vec_to_enemy;
|
||||
float weapon_travel_dist;
|
||||
|
||||
start_bank = Ships[aip->shipnum].weapons.current_primary_bank;
|
||||
@@ -929,7 +978,7 @@ void ai_big_chase_attack(ai_info *aip, ship_info *sip, vector *enemy_pos, float
|
||||
dist_to_enemy = vm_vec_normalized_dir(&vec_to_enemy, enemy_pos, &Pl_objp->pos);
|
||||
dot_to_enemy = vm_vec_dot(&vec_to_enemy, &Pl_objp->orient.vec.fvec);
|
||||
|
||||
vector rvec_vec, *rvec = &rvec_vec;
|
||||
vec3d rvec_vec, *rvec = &rvec_vec;
|
||||
|
||||
if (dist_to_enemy > 500.0f)
|
||||
compute_desired_rvec(rvec, enemy_pos, &Pl_objp->pos);
|
||||
@@ -946,7 +995,7 @@ void ai_big_chase_attack(ai_info *aip, ship_info *sip, vector *enemy_pos, float
|
||||
accelerate_ship(aip, 1.0f);
|
||||
else {
|
||||
// AL 12-31-97: Move at least as quickly as your target is moving...
|
||||
accelerate_ship(aip, max(1.0f - dot_to_enemy, Objects[aip->target_objnum].phys_info.fspeed/sip->max_speed));
|
||||
accelerate_ship(aip, MAX(1.0f - dot_to_enemy, Objects[aip->target_objnum].phys_info.fspeed/sip->max_speed));
|
||||
}
|
||||
|
||||
} else {
|
||||
@@ -984,7 +1033,7 @@ void ai_big_chase_ct()
|
||||
extern void ai_select_secondary_weapon(object *objp, ship_weapon *swp, int priority1 = -1, int priority2 = -1);
|
||||
extern float set_secondary_fire_delay(ai_info *aip, ship *shipp, weapon_info *swip);
|
||||
extern void ai_choose_secondary_weapon(object *objp, ai_info *aip, object *en_objp);
|
||||
extern int maybe_avoid_big_ship(object *objp, object *ignore_objp, ai_info *aip, vector *goal_point, float delta_time);
|
||||
extern int maybe_avoid_big_ship(object *objp, object *ignore_objp, ai_info *aip, vec3d *goal_point, float delta_time);
|
||||
|
||||
extern void maybe_cheat_fire_synaptic(object *objp, ai_info *aip);
|
||||
|
||||
@@ -993,20 +1042,21 @@ extern void maybe_cheat_fire_synaptic(object *objp, ai_info *aip);
|
||||
// dist_to_enemy => distance (in m) to attack point on current target
|
||||
// dot_to_enemy => dot product between fvec of Pl_objp and vector from Pl_objp to attack point
|
||||
//
|
||||
void ai_big_maybe_fire_weapons(float dist_to_enemy, float dot_to_enemy, vector *firing_pos, vector *enemy_pos, vector *enemy_vel)
|
||||
void ai_big_maybe_fire_weapons(float dist_to_enemy, float dot_to_enemy, vec3d *firing_pos, vec3d *enemy_pos, vec3d *enemy_vel)
|
||||
{
|
||||
ai_info *aip;
|
||||
ship_weapon *swp;
|
||||
int has_fired = -1;
|
||||
|
||||
aip = &Ai_info[Ships[Pl_objp->instance].ai_index];
|
||||
swp = &Ships[Pl_objp->instance].weapons;
|
||||
|
||||
if (dot_to_enemy > 0.95f - 0.5f * En_objp->radius/max(1.0f, En_objp->radius + dist_to_enemy)) {
|
||||
if (dot_to_enemy > 0.95f - 0.5f * En_objp->radius/MAX(1.0f, En_objp->radius + dist_to_enemy)) {
|
||||
aip->time_enemy_in_range += flFrametime;
|
||||
|
||||
// Chance of hitting ship is based on dot product of firing ship's forward vector with vector to ship
|
||||
// and also the size of the target relative to distance to target.
|
||||
if (dot_to_enemy > max(0.5f, 0.90f + aip->ai_accuracy/10.0f - En_objp->radius/max(1.0f,dist_to_enemy))) {
|
||||
if (dot_to_enemy > MAX(0.5f, 0.90f + aip->ai_accuracy/10.0f - En_objp->radius/MAX(1.0f,dist_to_enemy))) {
|
||||
|
||||
ship *temp_shipp;
|
||||
temp_shipp = &Ships[Pl_objp->instance];
|
||||
@@ -1016,8 +1066,13 @@ void ai_big_maybe_fire_weapons(float dist_to_enemy, float dot_to_enemy, vector *
|
||||
Assert(tswp->current_primary_bank < tswp->num_primary_banks);
|
||||
weapon_info *wip = &Weapon_info[tswp->primary_bank_weapons[tswp->current_primary_bank]];
|
||||
|
||||
if (dist_to_enemy < wip->max_speed * wip->lifetime)
|
||||
ai_fire_primary_weapon(Pl_objp);
|
||||
if (dist_to_enemy < MIN((wip->max_speed * wip->lifetime), wip->weapon_range)){
|
||||
has_fired = 1;
|
||||
if(! ai_fire_primary_weapon(Pl_objp)){
|
||||
has_fired = -1;
|
||||
// ship_stop_fire_primary(Pl_objp);
|
||||
}
|
||||
}
|
||||
|
||||
int priority1, priority2;
|
||||
|
||||
@@ -1046,8 +1101,11 @@ void ai_big_maybe_fire_weapons(float dist_to_enemy, float dot_to_enemy, vector *
|
||||
}
|
||||
|
||||
if (timestamp_elapsed(swp->next_secondary_fire_stamp[current_bank])) {
|
||||
|
||||
float firing_range = swip->max_speed * swip->lifetime;
|
||||
float firing_range;
|
||||
if (swip->wi_flags2 & WIF2_LOCAL_SSM)
|
||||
firing_range=swip->lssm_lock_range;
|
||||
else
|
||||
firing_range = MIN((swip->max_speed * swip->lifetime), swip->weapon_range);
|
||||
// reduce firing range of secondaries in nebula
|
||||
extern int Nebula_sec_range;
|
||||
if ((The_mission.flags & MISSION_FLAG_FULLNEB) && Nebula_sec_range) {
|
||||
@@ -1081,6 +1139,11 @@ void ai_big_maybe_fire_weapons(float dist_to_enemy, float dot_to_enemy, vector *
|
||||
} else {
|
||||
aip->time_enemy_in_range *= (1.0f - flFrametime);
|
||||
}
|
||||
|
||||
if(has_fired == -1){ //stuff that hapens when the ship stops fireing
|
||||
ship_stop_fire_primary(Pl_objp);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
// switch ai ship into chase mode
|
||||
@@ -1092,18 +1155,18 @@ void ai_big_switch_to_chase_mode(ai_info *aip)
|
||||
aip->submode_start_time = Missiontime;
|
||||
}
|
||||
|
||||
extern int ai_big_strafe_maybe_retreat(float dist, vector *target_pos);
|
||||
extern int ai_big_strafe_maybe_retreat(float dist, vec3d *target_pos);
|
||||
|
||||
// Make object Pl_objp chase object En_objp, which is a big ship, not a small ship.
|
||||
void ai_big_chase()
|
||||
{
|
||||
float dist_to_enemy, dot_to_enemy;
|
||||
vector player_pos, enemy_pos, vec_to_enemy;
|
||||
vec3d player_pos, enemy_pos, vec_to_enemy;
|
||||
ship_info *sip = &Ship_info[Ships[Pl_objp->instance].ship_info_index];
|
||||
ship *shipp = &Ships[Pl_objp->instance];
|
||||
ai_info *aip = &Ai_info[shipp->ai_index];
|
||||
int enemy_ship_type;
|
||||
vector predicted_enemy_pos;
|
||||
vec3d predicted_enemy_pos;
|
||||
|
||||
Assert(aip->mode == AIM_CHASE);
|
||||
|
||||
@@ -1134,8 +1197,9 @@ void ai_big_chase()
|
||||
if (aip->ai_flags & AIF_TARGET_COLLISION) {
|
||||
if ( ai_big_strafe_maybe_retreat(dist_to_enemy, &enemy_pos) ) {
|
||||
aip->mode = AIM_STRAFE;
|
||||
aip->submode = AIS_STRAFE_AVOID;
|
||||
aip->submode_parm0 = Missiontime; // use parm0 as time strafe mode entered
|
||||
aip->submode = AIS_STRAFE_AVOID;
|
||||
aip->submode_start_time = Missiontime;
|
||||
return;
|
||||
}
|
||||
}
|
||||
@@ -1201,7 +1265,7 @@ void ai_big_chase()
|
||||
case SM_ATTACK:
|
||||
case SM_SUPER_ATTACK:
|
||||
case SM_ATTACK_FOREVER:
|
||||
ai_big_chase_attack(aip, sip, &enemy_pos, dist_to_enemy);
|
||||
ai_big_chase_attack(aip, sip, &enemy_pos, dist_to_enemy, shipp->modelnum);
|
||||
break;
|
||||
|
||||
case SM_EVADE:
|
||||
@@ -1219,6 +1283,7 @@ void ai_big_chase()
|
||||
default:
|
||||
aip->last_attack_time = Missiontime;
|
||||
aip->submode = SM_ATTACK;
|
||||
aip->submode_start_time = Missiontime;
|
||||
break;
|
||||
}
|
||||
|
||||
@@ -1252,9 +1317,9 @@ void ai_big_chase()
|
||||
// mprintf(("normal dist; %.1f, time: %.1f\n", dist_normal_to_enemy, time_to_enemy));
|
||||
// }
|
||||
|
||||
// since we're not in strafe and we may get a bad normal, cap dist_normal_to_enemy as min(0.3*dist_to_enemy, self)
|
||||
// since we're not in strafe and we may get a bad normal, cap dist_normal_to_enemy as MIN(0.3*dist_to_enemy, self)
|
||||
// this will allow us to get closer on a bad normal
|
||||
dist_normal_to_enemy = max(0.3f*dist_to_enemy, dist_normal_to_enemy);
|
||||
dist_normal_to_enemy = MAX(0.3f*dist_to_enemy, dist_normal_to_enemy);
|
||||
|
||||
if (dist_to_enemy < ATTACK_COLLIDE_BASE_DIST) {
|
||||
// within 50m or 1sec
|
||||
@@ -1275,7 +1340,7 @@ void ai_big_chase()
|
||||
}
|
||||
}
|
||||
|
||||
float speed_dist = max(0.0f, (Pl_objp->phys_info.speed-50) * 2);
|
||||
float speed_dist = MAX(0.0f, (Pl_objp->phys_info.speed-50) * 2);
|
||||
if ((dist_normal_to_enemy < ATTACK_COLLIDE_AVOID_DIST + speed_dist) || (time_to_enemy < ATTACK_COLLIDE_AVOID_TIME) ) {
|
||||
// get away, simulate crsh recovery (don't use avoid)
|
||||
// accelerate_ship(aip, -1.0f);
|
||||
@@ -1334,8 +1399,8 @@ void ai_big_chase()
|
||||
|
||||
if (box_dist > 300) {
|
||||
aip->submode = SM_ATTACK;
|
||||
aip->last_attack_time = Missiontime;
|
||||
aip->submode_start_time = Missiontime;
|
||||
aip->last_attack_time = Missiontime;
|
||||
}
|
||||
}
|
||||
break;
|
||||
@@ -1347,8 +1412,8 @@ void ai_big_chase()
|
||||
aip->submode_start_time = Missiontime;
|
||||
} else {
|
||||
aip->submode = SM_ATTACK;
|
||||
aip->last_attack_time = Missiontime;
|
||||
aip->submode_start_time = Missiontime;
|
||||
aip->last_attack_time = Missiontime;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1364,8 +1429,8 @@ void ai_big_chase()
|
||||
|
||||
default:
|
||||
aip->submode = SM_ATTACK;
|
||||
aip->last_attack_time = Missiontime;
|
||||
aip->submode_start_time = Missiontime;
|
||||
aip->last_attack_time = Missiontime;
|
||||
}
|
||||
|
||||
//
|
||||
@@ -1394,9 +1459,9 @@ void ai_big_ship(object *objp)
|
||||
// dist => distance from Pl_objp front to attack point
|
||||
// dot => dot of Pl_objp fvec and vector to attack point
|
||||
// fire_pos => world pos from which firing
|
||||
void ai_big_attack_get_data(vector *enemy_pos, float *dist_to_enemy, float *dot_to_enemy)
|
||||
void ai_big_attack_get_data(vec3d *enemy_pos, float *dist_to_enemy, float *dot_to_enemy)
|
||||
{
|
||||
vector player_pos, vec_to_enemy, predicted_enemy_pos;
|
||||
vec3d player_pos, vec_to_enemy, predicted_enemy_pos;
|
||||
ship *shipp = &Ships[Pl_objp->instance];
|
||||
ai_info *aip = &Ai_info[shipp->ai_index];
|
||||
ship_info *esip = &Ship_info[Ships[En_objp->instance].ship_info_index];
|
||||
@@ -1431,8 +1496,8 @@ void ai_big_attack_get_data(vector *enemy_pos, float *dist_to_enemy, float *dot_
|
||||
if ((*dot_to_enemy < 0.25f) || (aip->target_time < 1.0f) || (aip->ai_flags & AIF_SEEK_LOCK)) {
|
||||
predicted_enemy_pos=*enemy_pos;
|
||||
} else {
|
||||
vector gun_pos, pnt;
|
||||
polymodel *po = model_get( Ship_info[shipp->ship_info_index].modelnum );
|
||||
vec3d gun_pos, pnt;
|
||||
polymodel *po = model_get( shipp->modelnum );
|
||||
float weapon_speed;
|
||||
|
||||
// Compute position of gun in absolute space and use that as fire position.
|
||||
@@ -1453,12 +1518,12 @@ void ai_big_attack_get_data(vector *enemy_pos, float *dist_to_enemy, float *dot_
|
||||
|
||||
// check to see if Pl_objp has gotten too close to attacking point.. if so, break off by entering
|
||||
// AIS_STRAFE_RETREAT
|
||||
int ai_big_strafe_maybe_retreat(float dist, vector *target_pos)
|
||||
int ai_big_strafe_maybe_retreat(float dist, vec3d *target_pos)
|
||||
{
|
||||
ai_info *aip;
|
||||
aip = &Ai_info[Ships[Pl_objp->instance].ai_index];
|
||||
|
||||
vector vec_to_target;
|
||||
vec3d vec_to_target;
|
||||
vm_vec_sub(&vec_to_target, target_pos, &Pl_objp->pos);
|
||||
|
||||
float dist_to_target, dist_normal_to_target, time_to_target;
|
||||
@@ -1469,11 +1534,11 @@ int ai_big_strafe_maybe_retreat(float dist, vector *target_pos)
|
||||
dist_normal_to_target = 0.2f * vm_vec_mag_quick(&vec_to_target);
|
||||
}
|
||||
|
||||
dist_normal_to_target = max(0.2f*dist_to_target, dist_normal_to_target);
|
||||
dist_normal_to_target = MAX(0.2f*dist_to_target, dist_normal_to_target);
|
||||
time_to_target = dist_normal_to_target / Pl_objp->phys_info.speed;
|
||||
|
||||
// add distance penalty for going too fast
|
||||
float speed_to_dist_penalty = max(0.0f, (Pl_objp->phys_info.speed-50));
|
||||
float speed_to_dist_penalty = MAX(0.0f, (Pl_objp->phys_info.speed-50));
|
||||
|
||||
//if ((dot_to_enemy > 1.0f - 0.1f * En_objp->radius/(dist_to_enemy + 1.0f)) && (Pl_objp->phys_info.speed > dist_to_enemy/5.0f))
|
||||
|
||||
@@ -1491,7 +1556,7 @@ int ai_big_strafe_maybe_retreat(float dist, vector *target_pos)
|
||||
|
||||
float box_dist;
|
||||
int is_inside;
|
||||
vector goal_point;
|
||||
vec3d goal_point;
|
||||
box_dist = get_world_closest_box_point_with_delta(&goal_point, En_objp, &Pl_objp->pos, &is_inside, STRAFE_RETREAT_BOX_DIST);
|
||||
|
||||
// set goal point
|
||||
@@ -1513,8 +1578,8 @@ int ai_big_strafe_maybe_retreat(float dist, vector *target_pos)
|
||||
void ai_big_strafe_attack()
|
||||
{
|
||||
ai_info *aip;
|
||||
vector target_pos;
|
||||
vector rand_vec;
|
||||
vec3d target_pos;
|
||||
vec3d rand_vec;
|
||||
float target_dist, target_dot, accel, t;
|
||||
object *target_objp;
|
||||
|
||||
@@ -1616,7 +1681,7 @@ void ai_big_strafe_attack()
|
||||
void ai_big_strafe_avoid()
|
||||
{
|
||||
ai_info *aip;
|
||||
vector target_pos;
|
||||
vec3d target_pos;
|
||||
float target_dist, target_dot;
|
||||
fix mode_time;
|
||||
|
||||
@@ -1643,7 +1708,7 @@ void ai_big_strafe_retreat1()
|
||||
{
|
||||
float dist;
|
||||
ai_info *aip;
|
||||
vector rand_vec;
|
||||
vec3d rand_vec;
|
||||
|
||||
aip = &Ai_info[Ships[Pl_objp->instance].ai_index];
|
||||
|
||||
@@ -1889,15 +1954,27 @@ void ai_big_strafe_maybe_attack_turret(object *ship_objp, object *weapon_objp)
|
||||
return;
|
||||
}
|
||||
|
||||
// Only attack turret if it sits on current target
|
||||
Assert(weapon_objp->parent >= 0 && weapon_objp->parent < MAX_OBJECTS);
|
||||
parent_objp = &Objects[weapon_objp->parent];
|
||||
if ( (parent_objp->signature != weapon_objp->parent_sig) || (parent_objp->type != OBJ_SHIP) ) {
|
||||
return;
|
||||
}
|
||||
|
||||
// UnknownPlayer : Decide whether or not this weapon was a beam, in which case it might be a good
|
||||
// idea to go after it even if its not on the current target. This is randomized so
|
||||
// the ai will not always go after different ships firing beams at them.
|
||||
// Approx 1/4 chance we'll go after the other ship's beam.
|
||||
|
||||
if ( aip->target_objnum != OBJ_INDEX(parent_objp) ) {
|
||||
return;
|
||||
bool attack_turret_on_different_ship = (The_mission.flags & MISSION_FLAG_USE_NEW_AI)
|
||||
&& (Weapon_info[weapon_objp->instance].wi_flags & WIF_BEAM) && (frand()*100 < 25.0f);
|
||||
|
||||
// unless we're making an exception, we should only attack a turret if it sits on the current target
|
||||
if ( !attack_turret_on_different_ship )
|
||||
{
|
||||
if ( (parent_objp->signature != weapon_objp->parent_sig) || (parent_objp->type != OBJ_SHIP) ) {
|
||||
return;
|
||||
}
|
||||
|
||||
if ( aip->target_objnum != OBJ_INDEX(parent_objp) ) {
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
// attack the turret
|
||||
@@ -9,13 +9,29 @@
|
||||
|
||||
/*
|
||||
* $Logfile: /Freespace2/code/Ship/AiBig.h $
|
||||
* $Revision: 2.0 $
|
||||
* $Date: 2002-06-03 04:02:28 $
|
||||
* $Author: penguin $
|
||||
* $Revision: 1.3 $
|
||||
* $Date: 2005-07-13 02:50:48 $
|
||||
* $Author: Goober5000 $
|
||||
*
|
||||
* Header file for AI code related to large ships
|
||||
*
|
||||
* $Log: not supported by cvs2svn $
|
||||
* Revision 1.2 2005/04/05 05:53:13 taylor
|
||||
* s/vector/vec3d/g, better support for different compilers (Jens Granseuer)
|
||||
*
|
||||
* Revision 1.1 2005/03/25 06:45:12 wmcoolmon
|
||||
* Initial AI code move commit - note that aigoals.cpp has some escape characters in it, I'm not sure if this is really a problem.
|
||||
*
|
||||
* Revision 2.2 2004/08/11 05:06:34 Kazan
|
||||
* added preprocdefines.h to prevent what happened with fred -- make sure to make all fred2 headers include this file as the _first_ include -- i have already modified fs2 files to do this
|
||||
*
|
||||
* Revision 2.1 2004/03/05 09:01:51 Goober5000
|
||||
* Uber pass at reducing #includes
|
||||
* --Goober5000
|
||||
*
|
||||
* Revision 2.0 2002/06/03 04:02:28 penguin
|
||||
* Warpcore CVS sync
|
||||
*
|
||||
* Revision 1.1 2002/05/02 18:03:12 mharris
|
||||
* Initial checkin - converted filenames and includes to lower case
|
||||
*
|
||||
@@ -67,10 +83,14 @@
|
||||
* $NoKeywords: $
|
||||
*/
|
||||
|
||||
|
||||
#ifndef __AIBIG_H__
|
||||
#define __AIBIG_H__
|
||||
|
||||
struct object;
|
||||
struct ai_info;
|
||||
struct vec3d;
|
||||
struct ship_subsys;
|
||||
|
||||
void ai_big_ship(object *objp);
|
||||
void ai_big_chase();
|
||||
void ai_big_subsys_path_cleanup(ai_info *aip);
|
||||
@@ -79,8 +99,8 @@ void ai_big_subsys_path_cleanup(ai_info *aip);
|
||||
void ai_big_strafe();
|
||||
int ai_big_maybe_enter_strafe_mode(object *objp, int weapon_objnum, int consider_target_only=0);
|
||||
void ai_big_strafe_maybe_attack_turret(object *ship_objp, object *weapon_objp);
|
||||
void ai_big_pick_attack_point(object *objp, object *attacker_objp, vector *attack_point, float fov=1.0f);
|
||||
void ai_big_pick_attack_point_turret(object *objp, ship_subsys *ssp, vector *gpos, vector *gvec, vector *attack_point, float weapon_travel_dist, float fov=1.0f);
|
||||
void ai_big_pick_attack_point(object *objp, object *attacker_objp, vec3d *attack_point, float fov=1.0f);
|
||||
void ai_big_pick_attack_point_turret(object *objp, ship_subsys *ssp, vec3d *gpos, vec3d *gvec, vec3d *attack_point, float weapon_travel_dist, float fov=1.0f);
|
||||
|
||||
|
||||
#endif
|
||||
File diff suppressed because it is too large.
Load diff
File diff suppressed because it is too large.
Load diff
@@ -9,13 +9,38 @@
|
||||
|
||||
/*
|
||||
* $Logfile: /Freespace2/code/Ship/AiGoals.h $
|
||||
* $Revision: 2.1 $
|
||||
* $Date: 2002-08-01 01:41:10 $
|
||||
* $Author: penguin $
|
||||
* $Revision: 1.2 $
|
||||
* $Date: 2005-07-13 02:50:48 $
|
||||
* $Author: Goober5000 $
|
||||
*
|
||||
* <insert description of file here>
|
||||
*
|
||||
* $Log: not supported by cvs2svn $
|
||||
* Revision 1.1 2005/03/25 06:45:13 wmcoolmon
|
||||
* Initial AI code move commit - note that aigoals.cpp has some escape characters in it, I'm not sure if this is really a problem.
|
||||
*
|
||||
* Revision 2.6 2004/08/11 05:06:34 Kazan
|
||||
* added preprocdefines.h to prevent what happened with fred -- make sure to make all fred2 headers include this file as the _first_ include -- i have already modified fs2 files to do this
|
||||
*
|
||||
* Revision 2.5 2004/07/25 00:31:31 Kazan
|
||||
* i have absolutely nothing to say about that subject
|
||||
*
|
||||
* Revision 2.4 2004/03/05 09:01:52 Goober5000
|
||||
* Uber pass at reducing #includes
|
||||
* --Goober5000
|
||||
*
|
||||
* Revision 2.3 2003/01/07 20:06:44 Goober5000
|
||||
* added ai-chase-any-except sexp
|
||||
* --Goober5000
|
||||
*
|
||||
* Revision 2.2 2003/01/06 21:52:58 Goober5000
|
||||
* allowed fighters and bombers to accept the stay-near-ship and
|
||||
* keep-safe-distance orders
|
||||
* --Goober5000
|
||||
*
|
||||
* Revision 2.1 2002/08/01 01:41:10 penguin
|
||||
* The big include file move
|
||||
*
|
||||
* Revision 2.0 2002/06/03 04:02:28 penguin
|
||||
* Warpcore CVS sync
|
||||
*
|
||||
@@ -142,8 +167,11 @@
|
||||
#ifndef _AIGOALS_H
|
||||
#define _AIGOALS_H
|
||||
|
||||
#include "ship/ai.h"
|
||||
#include "cfile/cfile.h"
|
||||
#include "globalincs/globals.h"
|
||||
|
||||
struct wing;
|
||||
struct ai_info;
|
||||
struct ai_goal;
|
||||
|
||||
// macros for goals which get set via sexpressions in the mission code
|
||||
|
||||
@@ -177,21 +205,34 @@
|
||||
#define AI_GOAL_PLAY_DEAD (1<<21)
|
||||
#define AI_GOAL_CHASE_WEAPON (1<<22)
|
||||
|
||||
|
||||
// Goober5000: new goals go here
|
||||
|
||||
// Goober5000: this new goal is special: it doesn't take the usual kind of argument; it takes
|
||||
// many arguments, requiring a modification to the ai_goal data type. Therefore, I didn't
|
||||
// add it to ai_update_goal_references() or ai_query_goal_references(). I also didn't add it
|
||||
// to the list in Fred\Management.cpp, because it can't be specified as an initial order - it
|
||||
// can only be specified through a sexp.
|
||||
#define AI_GOAL_CHASE_ANY_EXCEPT (1<<23) // hey Hoffoss! I added a new goal! :p
|
||||
|
||||
#define AI_GOAL_FLY_TO_SHIP (1<<24) // kazan
|
||||
|
||||
// now the masks for ship types
|
||||
|
||||
#define AI_GOAL_ACCEPT_FIGHTER ( AI_GOAL_CHASE | AI_GOAL_WAYPOINTS | AI_GOAL_WAYPOINTS_ONCE | AI_GOAL_WARP | AI_GOAL_DESTROY_SUBSYSTEM | AI_GOAL_CHASE_WING | AI_GOAL_GUARD | AI_GOAL_DISABLE_SHIP | AI_GOAL_DISARM_SHIP | AI_GOAL_CHASE_ANY | AI_GOAL_IGNORE | AI_GOAL_GUARD_WING | AI_GOAL_EVADE_SHIP | AI_GOAL_STAY_STILL | AI_GOAL_PLAY_DEAD)
|
||||
#define AI_GOAL_ACCEPT_BOMBER ( AI_GOAL_ACCEPT_FIGHTER )
|
||||
#define AI_GOAL_ACCEPT_STEALTH ( AI_GOAL_ACCEPT_FIGHTER )
|
||||
#define AI_GOAL_ACCEPT_TRANSPORT ( AI_GOAL_CHASE | AI_GOAL_CHASE_WING | AI_GOAL_DOCK | AI_GOAL_WAYPOINTS | AI_GOAL_WAYPOINTS_ONCE | AI_GOAL_WARP | AI_GOAL_UNDOCK | AI_GOAL_STAY_STILL | AI_GOAL_PLAY_DEAD)
|
||||
#define AI_GOAL_ACCEPT_FREIGHTER ( AI_GOAL_ACCEPT_TRANSPORT )
|
||||
#define AI_GOAL_ACCEPT_CRUISER ( AI_GOAL_ACCEPT_FREIGHTER )
|
||||
#define AI_GOAL_ACCEPT_CORVETTE ( AI_GOAL_ACCEPT_CRUISER )
|
||||
#define AI_GOAL_ACCEPT_GAS_MINER ( AI_GOAL_ACCEPT_CRUISER )
|
||||
#define AI_GOAL_ACCEPT_AWACS ( AI_GOAL_ACCEPT_CRUISER )
|
||||
#define AI_GOAL_ACCEPT_CAPITAL ( AI_GOAL_ACCEPT_CRUISER & ~(AI_GOAL_DOCK | AI_GOAL_UNDOCK) )
|
||||
#define AI_GOAL_ACCEPT_SUPERCAP ( AI_GOAL_ACCEPT_CAPITAL )
|
||||
#define AI_GOAL_ACCEPT_SUPPORT ( AI_GOAL_DOCK | AI_GOAL_UNDOCK | AI_GOAL_WAYPOINTS | AI_GOAL_WAYPOINTS_ONCE | AI_GOAL_STAY_NEAR_SHIP | AI_GOAL_KEEP_SAFE_DISTANCE | AI_GOAL_STAY_STILL | AI_GOAL_PLAY_DEAD)
|
||||
#define AI_GOAL_ACCEPT_ESCAPEPOD ( AI_GOAL_ACCEPT_TRANSPORT )
|
||||
// Goober5000: added AI_GOAL_STAY_NEAR_SHIP and AI_GOAL_KEEP_SAFE_DISTANCE as valid for fighters
|
||||
#define AI_GOAL_ACCEPT_FIGHTER ( AI_GOAL_FLY_TO_SHIP | AI_GOAL_CHASE | AI_GOAL_WAYPOINTS | AI_GOAL_WAYPOINTS_ONCE | AI_GOAL_WARP | AI_GOAL_DESTROY_SUBSYSTEM | AI_GOAL_CHASE_WING | AI_GOAL_GUARD | AI_GOAL_DISABLE_SHIP | AI_GOAL_DISARM_SHIP | AI_GOAL_CHASE_ANY | AI_GOAL_IGNORE | AI_GOAL_GUARD_WING | AI_GOAL_EVADE_SHIP | AI_GOAL_STAY_STILL | AI_GOAL_PLAY_DEAD | AI_GOAL_STAY_NEAR_SHIP | AI_GOAL_KEEP_SAFE_DISTANCE | AI_GOAL_CHASE_ANY_EXCEPT )
|
||||
#define AI_GOAL_ACCEPT_BOMBER ( AI_GOAL_FLY_TO_SHIP | AI_GOAL_ACCEPT_FIGHTER | AI_GOAL_STAY_NEAR_SHIP )
|
||||
#define AI_GOAL_ACCEPT_STEALTH ( AI_GOAL_FLY_TO_SHIP | AI_GOAL_ACCEPT_FIGHTER | AI_GOAL_STAY_NEAR_SHIP )
|
||||
#define AI_GOAL_ACCEPT_TRANSPORT ( AI_GOAL_FLY_TO_SHIP | AI_GOAL_CHASE | AI_GOAL_CHASE_WING | AI_GOAL_DOCK | AI_GOAL_WAYPOINTS | AI_GOAL_WAYPOINTS_ONCE | AI_GOAL_WARP | AI_GOAL_UNDOCK | AI_GOAL_STAY_STILL | AI_GOAL_PLAY_DEAD| AI_GOAL_STAY_NEAR_SHIP )
|
||||
#define AI_GOAL_ACCEPT_FREIGHTER ( AI_GOAL_FLY_TO_SHIP | AI_GOAL_ACCEPT_TRANSPORT | AI_GOAL_STAY_NEAR_SHIP )
|
||||
#define AI_GOAL_ACCEPT_CRUISER ( AI_GOAL_FLY_TO_SHIP | AI_GOAL_ACCEPT_FREIGHTER | AI_GOAL_STAY_NEAR_SHIP )
|
||||
#define AI_GOAL_ACCEPT_CORVETTE ( AI_GOAL_FLY_TO_SHIP | AI_GOAL_ACCEPT_CRUISER | AI_GOAL_STAY_NEAR_SHIP )
|
||||
#define AI_GOAL_ACCEPT_GAS_MINER ( AI_GOAL_FLY_TO_SHIP | AI_GOAL_ACCEPT_CRUISER | AI_GOAL_STAY_NEAR_SHIP )
|
||||
#define AI_GOAL_ACCEPT_AWACS ( AI_GOAL_FLY_TO_SHIP | AI_GOAL_ACCEPT_CRUISER | AI_GOAL_STAY_NEAR_SHIP )
|
||||
#define AI_GOAL_ACCEPT_CAPITAL ( AI_GOAL_FLY_TO_SHIP | AI_GOAL_ACCEPT_CRUISER & ~(AI_GOAL_DOCK | AI_GOAL_UNDOCK) | AI_GOAL_STAY_NEAR_SHIP )
|
||||
#define AI_GOAL_ACCEPT_SUPERCAP ( AI_GOAL_FLY_TO_SHIP | AI_GOAL_ACCEPT_CAPITAL | AI_GOAL_STAY_NEAR_SHIP )
|
||||
#define AI_GOAL_ACCEPT_SUPPORT ( AI_GOAL_FLY_TO_SHIP | AI_GOAL_DOCK | AI_GOAL_UNDOCK | AI_GOAL_WAYPOINTS | AI_GOAL_WAYPOINTS_ONCE | AI_GOAL_STAY_NEAR_SHIP | AI_GOAL_KEEP_SAFE_DISTANCE | AI_GOAL_STAY_STILL | AI_GOAL_PLAY_DEAD)
|
||||
#define AI_GOAL_ACCEPT_ESCAPEPOD ( AI_GOAL_FLY_TO_SHIP | AI_GOAL_ACCEPT_TRANSPORT| AI_GOAL_STAY_NEAR_SHIP )
|
||||
|
||||
#define MAX_AI_DOCK_NAMES 25
|
||||
|
||||
@@ -0,0 +1,34 @@
|
||||
/*
|
||||
* Copyright (C) Volition, Inc. 1999. All rights reserved.
|
||||
*
|
||||
* All source code herein is the property of Volition, Inc. You may not sell
|
||||
* or otherwise commercially exploit the source or things you created based on the
|
||||
* source.
|
||||
*
|
||||
*/
|
||||
|
||||
#ifndef _AIINTERNAL_H
|
||||
#define _AIINTERNAL_H
|
||||
|
||||
//Returns the enemy team mask for the specified subobject
|
||||
int get_enemy_team_mask(int objnum);
|
||||
|
||||
//Returns true if the specified object is a stealth ship, false if not
|
||||
bool is_object_stealth_ship(object* objp);
|
||||
|
||||
//Number of live turrets on the object attacking
|
||||
int num_turrets_attacking(object *turret_parent, int target_objnum);
|
||||
|
||||
//Determine whether an object is targetable within a nebula (checks for stealth)
|
||||
int object_is_targetable(object *target, ship *viewer);
|
||||
|
||||
//Returns the number of enemy fighters within threshold of pos.
|
||||
int num_nearby_fighters(int enemy_team_mask, vec3d *pos, float threshold);
|
||||
|
||||
//Returns true if OK for *aip to fire its current weapon at its current target.
|
||||
int check_ok_to_fire(int objnum, int target_objnum, weapon_info *wip);
|
||||
|
||||
//Does all the stuff needed to aim and fire a turret.
|
||||
void ai_fire_from_turret(ship *shipp, ship_subsys *ss, int parent_objnum);
|
||||
|
||||
#endif
|
||||
File renamed without changes.
File diff suppressed because it is too large.
Load diff
+142
-31
@@ -9,13 +9,102 @@
|
||||
|
||||
/*
|
||||
* $Logfile: /Freespace2/code/Anim/AnimPlay.cpp $
|
||||
* $Revision: 2.1 $
|
||||
* $Date: 2002-08-01 01:41:04 $
|
||||
* $Author: penguin $
|
||||
* $Revision: 2.17 $
|
||||
* $Date: 2005-05-28 19:40:59 $
|
||||
* $Author: taylor $
|
||||
*
|
||||
* C module for playing back anim files
|
||||
*
|
||||
* $Log: not supported by cvs2svn $
|
||||
* Revision 2.16 2005/05/23 05:58:31 taylor
|
||||
* quick catch for some corrupted anis, only a partial fix but it will do until something
|
||||
* a bit more heavy duty comes along in the near future
|
||||
*
|
||||
* Revision 2.15 2005/05/12 17:49:10 taylor
|
||||
* use vm_malloc(), vm_free(), vm_realloc(), vm_strdup() rather than system named macros
|
||||
* fixes various problems and is past time to make the switch
|
||||
*
|
||||
* Revision 2.14 2005/01/30 12:50:08 taylor
|
||||
* merge with Linux/OSX tree - p0130
|
||||
*
|
||||
* Revision 2.13 2004/12/20 20:18:30 fryday
|
||||
* Commented out ATL dependencies (And changed one macro to an swprintf instead)
|
||||
* Tiny change in animplay ( pow(2.0, ...) instead of pow(2, ...)) because VS2K5
|
||||
* throws an ambiguity error over that.
|
||||
*
|
||||
* Revision 2.12 2004/10/09 17:58:48 taylor
|
||||
* one more try to fix the memory leak and end-of-mission crash for talking head anis
|
||||
*
|
||||
* Revision 2.11 2004/07/26 20:47:23 Kazan
|
||||
* remove MCD complete
|
||||
*
|
||||
* Revision 2.10 2004/07/17 18:46:06 taylor
|
||||
* various OGL and memory leak fixes
|
||||
*
|
||||
* Revision 2.9 2004/07/12 16:32:41 Kazan
|
||||
* MCD - define _MCD_CHECK to use memory tracking
|
||||
*
|
||||
* Revision 2.8 2004/03/05 09:01:52 Goober5000
|
||||
* Uber pass at reducing #includes
|
||||
* --Goober5000
|
||||
*
|
||||
* Revision 2.7 2004/02/16 11:47:31 randomtiger
|
||||
* Removed a lot of files that we dont need anymore.
|
||||
* Changed htl to be on by default, command now -nohtl
|
||||
* Changed D3D to use a 2D vertex for 2D operations which should cut down on redundant data having to go though the system.
|
||||
* Added small change to all -start_mission flag to take you to any mission by filename, very useful for testing.
|
||||
* Removed old dshow code and took away timerbar compile flag condition since it uses a runtime flag now.
|
||||
*
|
||||
* Revision 2.6 2004/02/14 00:18:29 randomtiger
|
||||
* Please note that from now on OGL will only run with a registry set by Launcher v4. See forum for details.
|
||||
* OK, these changes effect a lot of file, I suggest everyone updates ASAP:
|
||||
* Removal of many files from project.
|
||||
* Removal of meanless Gr_bitmap_poly variable.
|
||||
* Removal of glide, directdraw, software modules all links to them, and all code specific to those paths.
|
||||
* Removal of redundant Fred paths that arent needed for Fred OGL.
|
||||
* Have seriously tidied the graphics initialisation code and added generic non standard mode functionality.
|
||||
* Fixed many D3D non standard mode bugs and brought OGL up to the same level.
|
||||
* Removed texture section support for D3D8, voodoo 2 and 3 cards will no longer run under fs2_open in D3D, same goes for any card with a maximum texture size less than 1024.
|
||||
*
|
||||
* Revision 2.5 2003/12/08 22:30:02 randomtiger
|
||||
* Put render state and other direct D3D calls repetition check back in, provides speed boost.
|
||||
* Fixed bug that caused fullscreen only crash with DXT textures
|
||||
* Put dithering back in for tgas and jpgs
|
||||
*
|
||||
* Revision 2.4 2003/11/29 10:52:08 randomtiger
|
||||
* Turned off D3D file mapping, its using too much memory which may be hurting older systems and doesnt seem to be providing much of a speed benifit.
|
||||
* Added stats command for ingame stats on memory usage.
|
||||
* Trys to play intro.mve and intro.avi, just to be safe since its not set by table.
|
||||
* Added fix for fonts wrapping round in non standard hi res modes.
|
||||
* Changed D3D mipmapping to a good value to suit htl mode.
|
||||
* Added new fog colour method which makes use of the bitmap, making this htl feature backcompatible again.
|
||||
*
|
||||
* Revision 2.3 2003/11/11 02:15:41 Goober5000
|
||||
* ubercommit - basically spelling and language fixes with some additional
|
||||
* warnings disabled
|
||||
* --Goober5000
|
||||
*
|
||||
* Revision 2.2 2003/03/18 10:07:00 unknownplayer
|
||||
* The big DX/main line merge. This has been uploaded to the main CVS since I can't manage to get it to upload to the DX branch. Apologies to all who may be affected adversely, but I'll work to debug it as fast as I can.
|
||||
*
|
||||
* Revision 2.1.2.3 2002/11/04 21:24:59 randomtiger
|
||||
*
|
||||
* When running in D3D all ani's are memory mapped for speed, this takes up more memory but stops gametime locking of textures which D3D8 hates.
|
||||
* Added new command line tag Cmdline_d3dlowmem for people who dont want to make use of this because they have no memory.
|
||||
* Cleaned up some more texture stuff enabled console debug for D3D.
|
||||
*
|
||||
* Revision 2.1.2.2 2002/09/28 22:13:42 randomtiger
|
||||
* Sorted out some bits and pieces. The background nebula blends now which is nice. – RT
|
||||
*
|
||||
* Revision 2.1.2.1 2002/09/24 18:56:40 randomtiger
|
||||
* DX8 branch commit
|
||||
*
|
||||
* This is the scub of UP's previous code with the more up to date RT code.
|
||||
* For full details check previous dev e-mails
|
||||
*
|
||||
* Revision 2.1 2002/08/01 01:41:04 penguin
|
||||
* The big include file move
|
||||
*
|
||||
* Revision 2.0 2002/06/03 04:02:21 penguin
|
||||
* Warpcore CVS sync
|
||||
*
|
||||
@@ -66,7 +155,7 @@
|
||||
* 34 4/27/98 3:36p Dave
|
||||
*
|
||||
* 33 3/25/98 8:43p Hoffoss
|
||||
* Changed anim_play() to not be so damn complex when you try and call it.
|
||||
* Changed anim_play() to not be so complex when you try and call it.
|
||||
*
|
||||
* 32 2/05/98 9:21p John
|
||||
* Some new Direct3D code. Added code to monitor a ton of stuff in the
|
||||
@@ -187,10 +276,12 @@
|
||||
#include "bmpman/bmpman.h"
|
||||
#include "graphics/2d.h"
|
||||
#include "render/3d.h"
|
||||
#include "graphics/grinternal.h"
|
||||
#include "pcxutils/pcxutils.h"
|
||||
#include "anim/packunpack.h"
|
||||
#include "cfile/cfile.h"
|
||||
#include "cmdline/cmdline.h"
|
||||
|
||||
|
||||
|
||||
static color Color_xparent;
|
||||
|
||||
@@ -363,7 +454,7 @@ anim_instance *anim_play(anim_play_struct *aps)
|
||||
if ( anim_instance_is_streamed(instance) ) {
|
||||
instance->file_offset = instance->parent->file_offset;
|
||||
}
|
||||
instance->frame = (ubyte *) malloc(instance->parent->width * instance->parent->height * 2);
|
||||
instance->frame = (ubyte *) vm_malloc(instance->parent->width * instance->parent->height * 2);
|
||||
Assert( instance->frame != NULL );
|
||||
instance->time_elapsed = 0.0f;
|
||||
instance->stop_at = aps->stop_at;
|
||||
@@ -448,6 +539,7 @@ anim_instance *anim_play(anim_play_struct *aps)
|
||||
// input: instance => pointer to animation instance
|
||||
// frametime => time elapsed since last call, in seconds
|
||||
//
|
||||
|
||||
int anim_show_next_frame(anim_instance *instance, float frametime)
|
||||
{
|
||||
int bitmap_id, bitmap_flags=0, new_frame_num, frame_diff=0, i, n_frames=0,frame_save;
|
||||
@@ -465,6 +557,7 @@ int anim_show_next_frame(anim_instance *instance, float frametime)
|
||||
n_frames = instance->stop_at - instance->start_at + 1;
|
||||
else if(instance->direction == ANIM_DIRECT_REVERSE)
|
||||
n_frames = instance->start_at - instance->stop_at + 1;
|
||||
|
||||
time = n_frames / i2fl(instance->parent->fps);
|
||||
|
||||
percent_through = instance->time_elapsed / time;
|
||||
@@ -609,12 +702,10 @@ int anim_show_next_frame(anim_instance *instance, float frametime)
|
||||
}
|
||||
|
||||
ubyte *temp = NULL;
|
||||
int temp_file_offset = 0;
|
||||
int temp_file_offset = -1;
|
||||
|
||||
// if we're using bitmap polys
|
||||
if(Gr_bitmap_poly){
|
||||
BM_SELECT_TEX_FORMAT();
|
||||
}
|
||||
BM_SELECT_TEX_FORMAT();
|
||||
|
||||
if ( anim_instance_is_streamed(instance) ) {
|
||||
if ( instance->xlate_pal ){
|
||||
@@ -633,6 +724,14 @@ int anim_show_next_frame(anim_instance *instance, float frametime)
|
||||
// always go back to screen format
|
||||
BM_SELECT_SCREEN_FORMAT();
|
||||
|
||||
// see if we had an error during decode (corrupted anim stream)
|
||||
if ( (temp == NULL) && (temp_file_offset < 0) ) {
|
||||
mprintf(("ANI: Fatal ERROR at frame %i!! Aborting playback of \"%s\"...\n", instance->frame_num, instance->parent->name));
|
||||
|
||||
// return -1 to end all playing of this anim instanc
|
||||
return -1;
|
||||
}
|
||||
|
||||
if(instance->direction == ANIM_DIRECT_FORWARD){
|
||||
if ( anim_instance_is_streamed(instance) ) {
|
||||
instance->file_offset = temp_file_offset;
|
||||
@@ -693,9 +792,9 @@ int anim_show_next_frame(anim_instance *instance, float frametime)
|
||||
else {
|
||||
g3_rotate_vertex(&image_vertex,instance->world_pos);
|
||||
Assert(instance->radius != 0.0f);
|
||||
g3_draw_bitmap(&image_vertex, 0, instance->radius*1.5f, TMAP_FLAG_TEXTURED );
|
||||
g3_draw_bitmap(&image_vertex, 0, instance->radius*1.5f, TMAP_FLAG_TEXTURED | TMAP_HTL_2D);
|
||||
}
|
||||
|
||||
|
||||
//bm_release(bitmap_id);
|
||||
instance->last_bitmap = bitmap_id;
|
||||
}
|
||||
@@ -734,8 +833,10 @@ int anim_stop_playing(anim_instance* instance)
|
||||
void anim_release_render_instance(anim_instance* instance)
|
||||
{
|
||||
Assert( instance != NULL );
|
||||
Assert(instance->frame);
|
||||
free(instance->frame);
|
||||
|
||||
if (instance->frame != NULL)
|
||||
vm_free(instance->frame);
|
||||
|
||||
instance->frame = NULL;
|
||||
instance->parent->instance_count--;
|
||||
|
||||
@@ -844,7 +945,7 @@ void anim_read_header(anim *ptr, CFILE *fp)
|
||||
floor_pow++;
|
||||
}
|
||||
|
||||
int floor_size = (int) pow(2, floor_pow);
|
||||
int floor_size = (int) pow(2.0, floor_pow);
|
||||
int diff = ptr->height - floor_size;
|
||||
float waste = 100.0f * float((floor_size - diff))/(2.0f *(float)floor_size);
|
||||
|
||||
@@ -857,6 +958,7 @@ void anim_read_header(anim *ptr, CFILE *fp)
|
||||
|
||||
ptr->total_frames = cfread_short(fp);
|
||||
cfread(&ptr->packer_code, 1, 1, fp);
|
||||
ptr->packer_code = INTEL_SHORT(ptr->packer_code);
|
||||
cfread(&ptr->palette, 256, 3, fp);
|
||||
ptr->num_keys = cfread_short(fp);
|
||||
|
||||
@@ -891,7 +993,9 @@ anim *anim_load(char *real_filename, int file_mapped)
|
||||
int count,idx;
|
||||
char name[_MAX_PATH];
|
||||
|
||||
// file_mapped = 0;
|
||||
if(Cmdline_cache_ani) {
|
||||
file_mapped = PAGE_FROM_MEM;
|
||||
}
|
||||
|
||||
Assert ( real_filename != NULL );
|
||||
|
||||
@@ -915,7 +1019,7 @@ anim *anim_load(char *real_filename, int file_mapped)
|
||||
if ( !fp )
|
||||
return NULL;
|
||||
|
||||
ptr = (anim *) malloc(sizeof(anim));
|
||||
ptr = (anim *) vm_malloc(sizeof(anim));
|
||||
Assert(ptr);
|
||||
|
||||
ptr->flags = 0;
|
||||
@@ -933,7 +1037,7 @@ anim *anim_load(char *real_filename, int file_mapped)
|
||||
anim_read_header(ptr, fp);
|
||||
|
||||
if(ptr->num_keys > 0){
|
||||
ptr->keys = (key_frame*)malloc(sizeof(key_frame) * ptr->num_keys);
|
||||
ptr->keys = (key_frame*)vm_malloc(sizeof(key_frame) * ptr->num_keys);
|
||||
Assert(ptr->keys != NULL);
|
||||
}
|
||||
|
||||
@@ -944,12 +1048,14 @@ anim *anim_load(char *real_filename, int file_mapped)
|
||||
ptr->keys[idx].frame_num = 0;
|
||||
cfread(&ptr->keys[idx].frame_num, 2, 1, fp);
|
||||
cfread(&ptr->keys[idx].offset, 4, 1, fp);
|
||||
ptr->keys[idx].frame_num = INTEL_INT( ptr->keys[idx].frame_num );
|
||||
ptr->keys[idx].offset = INTEL_INT( ptr->keys[idx].offset );
|
||||
}
|
||||
|
||||
/*prev_keyp = &ptr->keys;
|
||||
count = ptr->num_keys;
|
||||
while (count--) {
|
||||
keyp = (key_frame *) malloc(sizeof(key_frame));
|
||||
keyp = (key_frame *) vm_malloc(sizeof(key_frame));
|
||||
keyp->next = *prev_keyp;
|
||||
*prev_keyp = keyp;
|
||||
prev_keyp = &keyp->next;
|
||||
@@ -959,10 +1065,11 @@ anim *anim_load(char *real_filename, int file_mapped)
|
||||
cfread(&keyp->offset, 4, 1, fp);
|
||||
}*/
|
||||
cfread(&count, 4, 1, fp); // size of compressed data
|
||||
count = INTEL_INT( count );
|
||||
|
||||
ptr->cfile_ptr = NULL;
|
||||
|
||||
if ( file_mapped ) {
|
||||
if ( file_mapped == PAGE_FROM_MEM) {
|
||||
// Try mapping the file to memory
|
||||
ptr->flags |= ANF_MEM_MAPPED;
|
||||
ptr->cfile_ptr = cfopen(name, "rb", CFILE_MEMORY_MAPPED);
|
||||
@@ -989,7 +1096,7 @@ anim *anim_load(char *real_filename, int file_mapped)
|
||||
if ( ptr->flags & ANF_STREAMED ) {
|
||||
ptr->data = NULL;
|
||||
ptr->cache_file_offset = ptr->file_offset;
|
||||
ptr->cache = (ubyte*)malloc(ANI_STREAM_CACHE_SIZE+2);
|
||||
ptr->cache = (ubyte*)vm_malloc(ANI_STREAM_CACHE_SIZE+2);
|
||||
Assert(ptr->cache);
|
||||
cfseek(ptr->cfile_ptr, offset, CF_SEEK_SET);
|
||||
cfread(ptr->cache, ANI_STREAM_CACHE_SIZE, 1, ptr->cfile_ptr);
|
||||
@@ -1000,7 +1107,7 @@ anim *anim_load(char *real_filename, int file_mapped)
|
||||
// Not a memory mapped file (or streamed)
|
||||
ptr->flags &= ~ANF_MEM_MAPPED;
|
||||
ptr->flags &= ~ANF_STREAMED;
|
||||
ptr->data = (ubyte *) malloc(count);
|
||||
ptr->data = (ubyte *) vm_malloc(count);
|
||||
ptr->file_offset = -1;
|
||||
cfread(ptr->data, count, 1, fp);
|
||||
}
|
||||
@@ -1036,7 +1143,7 @@ int anim_free(anim *ptr)
|
||||
}
|
||||
|
||||
if ( !list )
|
||||
return -1;
|
||||
return -2;
|
||||
|
||||
// only free when ref_count is 0
|
||||
ptr->ref_count--;
|
||||
@@ -1048,23 +1155,27 @@ int anim_free(anim *ptr)
|
||||
return -1;
|
||||
|
||||
if(ptr->keys != NULL){
|
||||
free(ptr->keys);
|
||||
vm_free(ptr->keys);
|
||||
ptr->keys = NULL;
|
||||
}
|
||||
|
||||
if ( ptr->flags & (ANF_MEM_MAPPED|ANF_STREAMED) ) {
|
||||
cfclose(ptr->cfile_ptr);
|
||||
if ( ptr->cache ) {
|
||||
free(ptr->cache);
|
||||
vm_free(ptr->cache);
|
||||
ptr->cache = NULL;
|
||||
}
|
||||
}
|
||||
else {
|
||||
Assert(ptr->data);
|
||||
free(ptr->data);
|
||||
if ( ptr->data ) {
|
||||
vm_free(ptr->data);
|
||||
ptr->data = NULL;
|
||||
}
|
||||
}
|
||||
|
||||
*prev_anim = ptr->next;
|
||||
free(ptr);
|
||||
vm_free(ptr);
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -1132,7 +1243,7 @@ int anim_write_frames_out(char *filename)
|
||||
|
||||
ai = init_anim_instance(source_anim, 16);
|
||||
|
||||
row_data = (ubyte**)malloc((source_anim->height+1) * 4);
|
||||
row_data = (ubyte**)vm_malloc((source_anim->height+1) * 4);
|
||||
|
||||
for ( i = 0; i < source_anim->total_frames; i++ ) {
|
||||
anim_get_next_raw_buffer(ai, 0, 0, 16);
|
||||
@@ -1155,7 +1266,7 @@ int anim_write_frames_out(char *filename)
|
||||
|
||||
}
|
||||
printf("\n");
|
||||
free(row_data);
|
||||
vm_free(row_data);
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -1188,7 +1299,7 @@ void anim_display_info(char *real_filename)
|
||||
|
||||
anim_read_header(&A, fp);
|
||||
// read the keyframe frame nums and offsets
|
||||
key_frame_nums = (int*)malloc(sizeof(int)*A.num_keys);
|
||||
key_frame_nums = (int*)vm_malloc(sizeof(int)*A.num_keys);
|
||||
Assert(key_frame_nums != NULL);
|
||||
for ( i = 0; i < A.num_keys; i++ ) {
|
||||
key_frame_nums[i] = 0;
|
||||
@@ -1229,7 +1340,7 @@ void anim_display_info(char *real_filename)
|
||||
printf("ac version: %d\n", A.version);
|
||||
|
||||
if ( key_frame_nums != NULL ) {
|
||||
free(key_frame_nums);
|
||||
vm_free(key_frame_nums);
|
||||
}
|
||||
|
||||
cfclose(fp);
|
||||
|
||||
@@ -9,13 +9,32 @@
|
||||
|
||||
/*
|
||||
* $Logfile: /Freespace2/code/Anim/AnimPlay.h $
|
||||
* $Revision: 2.1 $
|
||||
* $Date: 2002-08-01 01:41:04 $
|
||||
* $Author: penguin $
|
||||
* $Revision: 2.6 $
|
||||
* $Date: 2005-07-13 02:50:48 $
|
||||
* $Author: Goober5000 $
|
||||
*
|
||||
* Header file for playing back anim files
|
||||
*
|
||||
* $Log: not supported by cvs2svn $
|
||||
* Revision 2.5 2005/04/05 05:53:14 taylor
|
||||
* s/vector/vec3d/g, better support for different compilers (Jens Granseuer)
|
||||
*
|
||||
* Revision 2.4 2004/08/11 05:06:18 Kazan
|
||||
* added preprocdefines.h to prevent what happened with fred -- make sure to make all fred2 headers include this file as the _first_ include -- i have already modified fs2 files to do this
|
||||
*
|
||||
* Revision 2.3 2003/12/08 22:30:02 randomtiger
|
||||
* Put render state and other direct D3D calls repetition check back in, provides speed boost.
|
||||
* Fixed bug that caused fullscreen only crash with DXT textures
|
||||
* Put dithering back in for tgas and jpgs
|
||||
*
|
||||
* Revision 2.2 2003/11/11 02:15:41 Goober5000
|
||||
* ubercommit - basically spelling and language fixes with some additional
|
||||
* warnings disabled
|
||||
* --Goober5000
|
||||
*
|
||||
* Revision 2.1 2002/08/01 01:41:04 penguin
|
||||
* The big include file move
|
||||
*
|
||||
* Revision 2.0 2002/06/03 04:02:21 penguin
|
||||
* Warpcore CVS sync
|
||||
*
|
||||
@@ -41,7 +60,7 @@
|
||||
* 10 4/27/98 3:36p Dave
|
||||
*
|
||||
* 9 3/25/98 8:43p Hoffoss
|
||||
* Changed anim_play() to not be so damn complex when you try and call it.
|
||||
* Changed anim_play() to not be so complex when you try and call it.
|
||||
*
|
||||
* 8 12/24/97 8:57p Lawrance
|
||||
* Added anim_ignore_next_frametime()
|
||||
@@ -117,7 +136,7 @@ typedef struct {
|
||||
int start_at;
|
||||
int stop_at;
|
||||
int screen_id;
|
||||
vector *world_pos;
|
||||
vec3d *world_pos;
|
||||
float radius;
|
||||
int framerate_independent;
|
||||
void *color;
|
||||
@@ -126,6 +145,13 @@ typedef struct {
|
||||
int ping_pong;
|
||||
} anim_play_struct;
|
||||
|
||||
enum
|
||||
{
|
||||
PAGE_FROM_MEM = 0,
|
||||
PAGE_FROM_DISK = 1,
|
||||
PAGE_FROM_DISK_FORCED = 2,
|
||||
};
|
||||
|
||||
extern int Anim_paused;
|
||||
|
||||
void anim_init();
|
||||
@@ -140,7 +166,7 @@ int anim_stop_playing(anim_instance* anim_instance);
|
||||
int anim_show_next_frame(anim_instance *instance, float frametime);
|
||||
void anim_release_all_instances(int screen_id = 0);
|
||||
void anim_release_render_instance(anim_instance* instance);
|
||||
anim *anim_load(char *name, int file_mapped = 0);
|
||||
anim *anim_load(char *name, int file_mapped = PAGE_FROM_MEM);
|
||||
int anim_free(anim *ptr);
|
||||
int anim_playing(anim_instance *ai);
|
||||
int anim_write_frames_out(char *filename);
|
||||
|
||||
@@ -9,15 +9,70 @@
|
||||
|
||||
/*
|
||||
* $Logfile: /Freespace2/code/Anim/PackUnpack.cpp $
|
||||
* $Revision: 2.1 $
|
||||
* $Date: 2002-08-01 01:41:04 $
|
||||
* $Author: penguin $
|
||||
* $Revision: 2.10 $
|
||||
* $Date: 2005-05-24 03:13:36 $
|
||||
* $Author: taylor $
|
||||
*
|
||||
* Code for handling packing and unpacking in Hoffoss's RLE format, used for
|
||||
* Anim files. Also handles Anim loading, creating Anim instances (for
|
||||
* utilizing an Anim), and getting getting frames of the Anim.
|
||||
*
|
||||
* $Log: not supported by cvs2svn $
|
||||
* Revision 2.9 2005/05/23 05:58:31 taylor
|
||||
* quick catch for some corrupted anis, only a partial fix but it will do until something
|
||||
* a bit more heavy duty comes along in the near future
|
||||
*
|
||||
* Revision 2.8 2005/05/12 17:49:10 taylor
|
||||
* use vm_malloc(), vm_free(), vm_realloc(), vm_strdup() rather than system named macros
|
||||
* fixes various problems and is past time to make the switch
|
||||
*
|
||||
* Revision 2.7 2004/07/26 20:47:23 Kazan
|
||||
* remove MCD complete
|
||||
*
|
||||
* Revision 2.6 2004/07/12 16:32:41 Kazan
|
||||
* MCD - define _MCD_CHECK to use memory tracking
|
||||
*
|
||||
* Revision 2.5 2004/03/05 09:01:53 Goober5000
|
||||
* Uber pass at reducing #includes
|
||||
* --Goober5000
|
||||
*
|
||||
* Revision 2.4 2004/02/14 00:18:29 randomtiger
|
||||
* Please note that from now on OGL will only run with a registry set by Launcher v4. See forum for details.
|
||||
* OK, these changes effect a lot of file, I suggest everyone updates ASAP:
|
||||
* Removal of many files from project.
|
||||
* Removal of meanless Gr_bitmap_poly variable.
|
||||
* Removal of glide, directdraw, software modules all links to them, and all code specific to those paths.
|
||||
* Removal of redundant Fred paths that arent needed for Fred OGL.
|
||||
* Have seriously tidied the graphics initialisation code and added generic non standard mode functionality.
|
||||
* Fixed many D3D non standard mode bugs and brought OGL up to the same level.
|
||||
* Removed texture section support for D3D8, voodoo 2 and 3 cards will no longer run under fs2_open in D3D, same goes for any card with a maximum texture size less than 1024.
|
||||
*
|
||||
* Revision 2.3 2003/10/24 17:35:04 randomtiger
|
||||
* Implemented support for 32bit TGA and JPG for D3D
|
||||
* Also 32 bit PCX, but it still has some bugs to be worked out
|
||||
* Moved convert_24_to_16 out of the bitmap pfunction structures and into packunpack.cpp because thats the only place that uses it.
|
||||
*
|
||||
* Revision 2.2 2003/03/18 10:07:00 unknownplayer
|
||||
* The big DX/main line merge. This has been uploaded to the main CVS since I can't manage to get it to upload to the DX branch. Apologies to all who may be affected adversely, but I'll work to debug it as fast as I can.
|
||||
*
|
||||
* Revision 2.1.2.1 2002/11/04 03:02:27 randomtiger
|
||||
*
|
||||
* I have made some fairly drastic changes to the bumpman system. Now functionality can be engine dependant.
|
||||
* This is so D3D8 can call its own loading code that will allow good efficient loading and use of textures that it desparately needs without
|
||||
* turning bumpman.cpp into a total hook infested nightmare. Note the new bumpman code is still relying on a few of the of the old functions and all of the old bumpman arrays.
|
||||
*
|
||||
* I have done this by adding to the gr_screen list of function pointers that are set up by the engines init functions.
|
||||
* I have named the define calls the same name as the original 'bm_' functions so that I havent had to change names all through the code.
|
||||
*
|
||||
* Rolled back to an old version of bumpman and made a few changes.
|
||||
* Added new files: grd3dbumpman.cpp and .h
|
||||
* Moved the bitmap init function to after the 3D engine is initialised
|
||||
* Added includes where needed
|
||||
* Disabled (for now) the D3D8 TGA loading - RT
|
||||
*
|
||||
* Revision 2.1 2002/08/01 01:41:04 penguin
|
||||
* The big include file move
|
||||
*
|
||||
* Revision 2.0 2002/06/03 04:02:21 penguin
|
||||
* Warpcore CVS sync
|
||||
*
|
||||
@@ -152,12 +207,13 @@
|
||||
* $NoKeywords: $
|
||||
*/
|
||||
|
||||
#include "graphics/grinternal.h"
|
||||
#include "anim/packunpack.h"
|
||||
#include "bmpman/bmpman.h"
|
||||
#include "palman/palman.h"
|
||||
#include "graphics/2d.h"
|
||||
#include "anim/animplay.h"
|
||||
#include "anim/packunpack.h"
|
||||
|
||||
|
||||
|
||||
|
||||
int packer_code = PACKER_CODE;
|
||||
int transparent_code = 254;
|
||||
@@ -191,7 +247,7 @@ anim_instance *init_anim_instance(anim *ptr, int bpp)
|
||||
}
|
||||
|
||||
ptr->instance_count++;
|
||||
inst = (anim_instance *) malloc(sizeof(anim_instance));
|
||||
inst = (anim_instance *) vm_malloc(sizeof(anim_instance));
|
||||
Assert(inst);
|
||||
inst->frame_num = -1;
|
||||
inst->last_frame_num = -1;
|
||||
@@ -202,9 +258,9 @@ anim_instance *init_anim_instance(anim *ptr, int bpp)
|
||||
inst->aa_color = NULL;
|
||||
|
||||
if(bpp == 16){
|
||||
inst->frame = (ubyte *) malloc(inst->parent->width * inst->parent->height * 2);
|
||||
inst->frame = (ubyte *) vm_malloc(inst->parent->width * inst->parent->height * 2);
|
||||
} else {
|
||||
inst->frame = (ubyte *) malloc(inst->parent->width * inst->parent->height);
|
||||
inst->frame = (ubyte *) vm_malloc(inst->parent->width * inst->parent->height);
|
||||
}
|
||||
return inst;
|
||||
}
|
||||
@@ -212,14 +268,14 @@ anim_instance *init_anim_instance(anim *ptr, int bpp)
|
||||
void free_anim_instance(anim_instance *inst)
|
||||
{
|
||||
Assert(inst->frame);
|
||||
free(inst->frame);
|
||||
vm_free(inst->frame);
|
||||
inst->frame = NULL;
|
||||
inst->parent->instance_count--;
|
||||
inst->parent = NULL;
|
||||
inst->data = NULL;
|
||||
inst->file_offset = -1;
|
||||
|
||||
free(inst);
|
||||
vm_free(inst);
|
||||
}
|
||||
|
||||
int anim_get_next_frame(anim_instance *inst)
|
||||
@@ -260,10 +316,7 @@ int anim_get_next_frame(anim_instance *inst)
|
||||
|
||||
anim_check_for_palette_change(inst);
|
||||
|
||||
// if we're using bitmap polys
|
||||
if(Gr_bitmap_poly){
|
||||
BM_SELECT_TEX_FORMAT();
|
||||
}
|
||||
BM_SELECT_TEX_FORMAT();
|
||||
|
||||
if ( anim_instance_is_streamed(inst) ) {
|
||||
inst->file_offset = unpack_frame_from_file(inst, inst->frame, inst->parent->width*inst->parent->height, inst->parent->palette_translation, aabitmap, bpp);
|
||||
@@ -775,6 +828,15 @@ int pack_frame(ubyte *frame, ubyte *frame2, ubyte *save, long size, long max, in
|
||||
return packed_size;
|
||||
}
|
||||
|
||||
// convert a 24 bit value to a 16 bit value
|
||||
void convert_24_to_16(int bit_24, ushort *bit_16)
|
||||
{
|
||||
ubyte *pixel = (ubyte*)&bit_24;
|
||||
ubyte alpha = 1;
|
||||
|
||||
bm_set_components((ubyte*)bit_16, (ubyte*)&pixel[0], (ubyte*)&pixel[1], (ubyte*)&pixel[2], &alpha);
|
||||
}
|
||||
|
||||
// unpack a pixel given the passed index and the anim_instance's palette, return bytes stuffed
|
||||
int unpack_pixel(anim_instance *ai, ubyte *data, ubyte pix, int aabitmap, int bpp)
|
||||
{
|
||||
@@ -809,7 +871,7 @@ int unpack_pixel(anim_instance *ai, ubyte *data, ubyte pix, int aabitmap, int bp
|
||||
memcpy(&bit_24, &ai->parent->palette[pix * 3], 3);
|
||||
|
||||
// convert to 16 bit
|
||||
bm_24_to_16(bit_24, &bit_16);
|
||||
convert_24_to_16(bit_24, &bit_16);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -863,7 +925,7 @@ int unpack_pixel_count(anim_instance *ai, ubyte *data, ubyte pix, int count, int
|
||||
memcpy(&bit_24, &ai->parent->palette[pix * 3], 3);
|
||||
|
||||
// convert to 16 bit
|
||||
bm_24_to_16(bit_24, &bit_16);
|
||||
convert_24_to_16(bit_24, &bit_16);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -954,6 +1016,9 @@ ubyte *unpack_frame(anim_instance *ai, ubyte *ptr, ubyte *frame, int size, ubyte
|
||||
count = value & (~STD_RLE_CODE);
|
||||
value = *ptr++;
|
||||
|
||||
if (count > size)
|
||||
count = size;
|
||||
|
||||
size -= count;
|
||||
Assert(size >= 0);
|
||||
|
||||
@@ -1040,6 +1105,9 @@ ubyte *unpack_frame(anim_instance *ai, ubyte *ptr, ubyte *frame, int size, ubyte
|
||||
count = value & (~STD_RLE_CODE);
|
||||
value = *ptr++;
|
||||
|
||||
if (count > size)
|
||||
count = size;
|
||||
|
||||
size -= count;
|
||||
Assert(size >= 0);
|
||||
|
||||
@@ -1058,7 +1126,8 @@ ubyte *unpack_frame(anim_instance *ai, ubyte *ptr, ubyte *frame, int size, ubyte
|
||||
}
|
||||
}
|
||||
else {
|
||||
Assert(0); // unknown packing method
|
||||
// Assert(0); // unknown packing method
|
||||
return NULL;
|
||||
}
|
||||
|
||||
return ptr;
|
||||
@@ -1140,6 +1209,9 @@ int unpack_frame_from_file(anim_instance *ai, ubyte *frame, int size, ubyte *pal
|
||||
value = anim_instance_get_byte(ai,offset);
|
||||
offset++;
|
||||
|
||||
if (count > size)
|
||||
count = size;
|
||||
|
||||
size -= count;
|
||||
Assert(size >= 0);
|
||||
|
||||
@@ -1230,6 +1302,9 @@ int unpack_frame_from_file(anim_instance *ai, ubyte *frame, int size, ubyte *pal
|
||||
value = anim_instance_get_byte(ai,offset);
|
||||
offset++;
|
||||
|
||||
if (count > size)
|
||||
count = size;
|
||||
|
||||
size -= count;
|
||||
Assert(size >= 0);
|
||||
|
||||
@@ -1248,7 +1323,8 @@ int unpack_frame_from_file(anim_instance *ai, ubyte *frame, int size, ubyte *pal
|
||||
}
|
||||
}
|
||||
else {
|
||||
Int3(); // unknown packing method
|
||||
// Int3(); // unknown packing method
|
||||
return -1;
|
||||
}
|
||||
|
||||
return ai->file_offset + offset;
|
||||
|
||||
@@ -9,15 +9,28 @@
|
||||
|
||||
/*
|
||||
* $Logfile: /Freespace2/code/Anim/PackUnpack.h $
|
||||
* $Revision: 2.1 $
|
||||
* $Date: 2002-08-01 01:41:04 $
|
||||
* $Author: penguin $
|
||||
* $Revision: 2.5 $
|
||||
* $Date: 2005-07-13 02:50:48 $
|
||||
* $Author: Goober5000 $
|
||||
*
|
||||
* Code for handling packing and unpacking in Hoffoss's RLE format, used for
|
||||
* Anim files. Also handles Anim loading, creating Anim instances (for
|
||||
* utilizing an Anim), and getting getting frames of the Anim.
|
||||
*
|
||||
* $Log: not supported by cvs2svn $
|
||||
* Revision 2.4 2005/04/05 05:53:14 taylor
|
||||
* s/vector/vec3d/g, better support for different compilers (Jens Granseuer)
|
||||
*
|
||||
* Revision 2.3 2004/08/11 05:06:18 Kazan
|
||||
* added preprocdefines.h to prevent what happened with fred -- make sure to make all fred2 headers include this file as the _first_ include -- i have already modified fs2 files to do this
|
||||
*
|
||||
* Revision 2.2 2004/03/05 09:01:53 Goober5000
|
||||
* Uber pass at reducing #includes
|
||||
* --Goober5000
|
||||
*
|
||||
* Revision 2.1 2002/08/01 01:41:04 penguin
|
||||
* The big include file move
|
||||
*
|
||||
* Revision 2.0 2002/06/03 04:02:21 penguin
|
||||
* Warpcore CVS sync
|
||||
*
|
||||
@@ -201,7 +214,7 @@ typedef struct anim {
|
||||
int file_offset; // file offset to start of frame data
|
||||
int cache_file_offset;
|
||||
ubyte *cache;
|
||||
} anim_t;
|
||||
} anim;
|
||||
|
||||
// the direction to play the anim (forwards or backwards)
|
||||
#define ANIM_DIRECT_FORWARD 0
|
||||
@@ -210,7 +223,7 @@ typedef struct anim {
|
||||
typedef struct anim_instance {
|
||||
anim_instance *next, *prev;
|
||||
int x,y; // coordinates anim is played at (top left corner of anim)
|
||||
vector *world_pos; // world (x,y,z) position of explosion
|
||||
vec3d *world_pos; // world (x,y,z) position of explosion
|
||||
float radius; // radius of image, needed for scaling
|
||||
int frame_num; // current frame, or last frame if between frames (first frame is 0)
|
||||
int last_frame_num;// last frame rendered
|
||||
@@ -233,7 +246,7 @@ typedef struct anim_instance {
|
||||
int paused; // pause the anim
|
||||
int file_offset; // current offset into frame (like data, put offset into file)
|
||||
int loop_count; // starts at 0, and is incremented each time it loops
|
||||
} anim_instance_t;
|
||||
} anim_instance;
|
||||
|
||||
extern int packer_code;
|
||||
|
||||
|
||||
+176
-155
@@ -9,13 +9,85 @@
|
||||
|
||||
/*
|
||||
* $Logfile: /Freespace2/code/Asteroid/Asteroid.cpp $
|
||||
* $Revision: 2.1 $
|
||||
* $Date: 2002-08-01 01:41:04 $
|
||||
* $Author: penguin $
|
||||
* $Revision: 2.20 $
|
||||
* $Date: 2005-07-22 10:18:36 $
|
||||
* $Author: Goober5000 $
|
||||
*
|
||||
* C module for asteroid code
|
||||
*
|
||||
* $Log: not supported by cvs2svn $
|
||||
* Revision 2.19 2005/07/13 02:50:48 Goober5000
|
||||
* remove PreProcDefine #includes in FS2
|
||||
* --Goober5000
|
||||
*
|
||||
* Revision 2.18 2005/07/13 02:01:28 Goober5000
|
||||
* fixed a bunch of "issues" caused by me with the species stuff
|
||||
* --Goober5000
|
||||
*
|
||||
* Revision 2.17 2005/07/13 00:44:20 Goober5000
|
||||
* improved species support and removed need for #define
|
||||
* --Goober5000
|
||||
*
|
||||
* Revision 2.16 2005/06/01 09:34:59 taylor
|
||||
* newline fix
|
||||
*
|
||||
* Revision 2.15 2005/04/28 05:29:28 wmcoolmon
|
||||
* Removed FS2_DEMO defines that looked like they wouldn't cause the universe to collapse
|
||||
*
|
||||
* Revision 2.14 2005/04/28 01:32:57 wmcoolmon
|
||||
* Switch stuff_string_white to stuff_string (I don't see why _white was used in the first place)
|
||||
*
|
||||
* Revision 2.13 2005/04/15 11:41:28 taylor
|
||||
* stupid <expletive-delete> terminal, I <expletive-deleted> <expletive-deleted>!!!
|
||||
*
|
||||
* Revision 2.12 2005/04/15 11:36:55 taylor
|
||||
* new GCC = new warning messages, yippeeee!!
|
||||
*
|
||||
* Revision 2.11 2005/04/05 05:53:14 taylor
|
||||
* s/vector/vec3d/g, better support for different compilers (Jens Granseuer)
|
||||
*
|
||||
* Revision 2.10 2005/03/02 21:24:43 taylor
|
||||
* more network/inferno goodness for Windows, takes care of a few warnings too
|
||||
*
|
||||
* Revision 2.9 2004/07/26 20:47:23 Kazan
|
||||
* remove MCD complete
|
||||
*
|
||||
* Revision 2.8 2004/07/12 16:32:41 Kazan
|
||||
* MCD - define _MCD_CHECK to use memory tracking
|
||||
*
|
||||
* Revision 2.7 2004/03/31 05:42:25 Goober5000
|
||||
* got rid of all those nasty warnings from xlocale and so forth; also added comments
|
||||
* for #pragma warning disable to indicate the message being disabled
|
||||
* --Goober5000
|
||||
*
|
||||
* Revision 2.6 2004/03/05 09:01:53 Goober5000
|
||||
* Uber pass at reducing #includes
|
||||
* --Goober5000
|
||||
*
|
||||
* Revision 2.5 2004/02/14 00:18:29 randomtiger
|
||||
* Please note that from now on OGL will only run with a registry set by Launcher v4. See forum for details.
|
||||
* OK, these changes effect a lot of file, I suggest everyone updates ASAP:
|
||||
* Removal of many files from project.
|
||||
* Removal of meanless Gr_bitmap_poly variable.
|
||||
* Removal of glide, directdraw, software modules all links to them, and all code specific to those paths.
|
||||
* Removal of redundant Fred paths that arent needed for Fred OGL.
|
||||
* Have seriously tidied the graphics initialisation code and added generic non standard mode functionality.
|
||||
* Fixed many D3D non standard mode bugs and brought OGL up to the same level.
|
||||
* Removed texture section support for D3D8, voodoo 2 and 3 cards will no longer run under fs2_open in D3D, same goes for any card with a maximum texture size less than 1024.
|
||||
*
|
||||
* Revision 2.4 2003/11/17 06:52:51 bobboau
|
||||
* got assert to work again
|
||||
*
|
||||
* Revision 2.3 2003/10/15 22:03:23 Kazan
|
||||
* Da Species Update :D
|
||||
*
|
||||
* Revision 2.2 2003/04/29 01:03:22 Goober5000
|
||||
* implemented the custom hitpoints mod
|
||||
* --Goober5000
|
||||
*
|
||||
* Revision 2.1 2002/08/01 01:41:04 penguin
|
||||
* The big include file move
|
||||
*
|
||||
* Revision 2.0 2002/06/03 04:02:21 penguin
|
||||
* Warpcore CVS sync
|
||||
*
|
||||
@@ -266,6 +338,7 @@
|
||||
* $NoKeywords: $
|
||||
*/
|
||||
|
||||
|
||||
#include "asteroid/asteroid.h"
|
||||
#include "object/object.h"
|
||||
#include "object/objcollide.h"
|
||||
@@ -274,16 +347,22 @@
|
||||
#include "render/3d.h"
|
||||
#include "fireball/fireballs.h"
|
||||
#include "gamesnd/gamesnd.h"
|
||||
#include "bmpman/bmpman.h"
|
||||
#include "particle/particle.h"
|
||||
#include "globalincs/linklist.h"
|
||||
#include "hud/hud.h"
|
||||
#include "hud/hudescort.h"
|
||||
#include "hud/hudgauges.h"
|
||||
#include "ship/shiphit.h"
|
||||
#include "math/staticrand.h"
|
||||
#include "globalincs/systemvars.h"
|
||||
#include "localization/localize.h"
|
||||
#include "stats/scoring.h"
|
||||
#include "hud/hudtarget.h"
|
||||
#include "weapon/weapon.h"
|
||||
#include "ship/ship.h"
|
||||
#include "parse/parselo.h"
|
||||
#include "math/vecmat.h"
|
||||
#include "model/model.h"
|
||||
|
||||
#ifndef NO_NETWORK
|
||||
#include "network/multiutil.h"
|
||||
@@ -291,34 +370,15 @@
|
||||
#include "network/multi.h"
|
||||
#endif
|
||||
|
||||
#ifndef FS2_DEMO
|
||||
|
||||
//WMC - we want asteroid ability with demo!!
|
||||
//#ifndef FS2_DEMO
|
||||
|
||||
#define ASTEROID_OBJ_USED (1<<0) // flag used in asteroid_obj struct
|
||||
#define MAX_ASTEROID_OBJS MAX_ASTEROIDS // max number of asteroids tracked in asteroid list
|
||||
asteroid_obj Asteroid_objs[MAX_ASTEROID_OBJS]; // array used to store asteroid object indexes
|
||||
asteroid_obj Asteroid_obj_list; // head of linked list of asteroid_obj structs
|
||||
|
||||
// Asteroid editor requires first set of entries to be "None" and then "Asteroid XXX"
|
||||
// Any changes to this will require changes to the asteroid editor
|
||||
debris_struct Field_debris_info[] = {
|
||||
-1, "None",
|
||||
ASTEROID_TYPE_SMALL, "Asteroid Small",
|
||||
ASTEROID_TYPE_MEDIUM, "Asteroid Medium",
|
||||
ASTEROID_TYPE_BIG, "Asteroid Large",
|
||||
|
||||
DEBRIS_TERRAN_SMALL, "Terran Small",
|
||||
DEBRIS_TERRAN_MEDIUM, "Terran Medium",
|
||||
DEBRIS_TERRAN_LARGE, "Terran Large",
|
||||
|
||||
DEBRIS_VASUDAN_SMALL, "Vasudan Small",
|
||||
DEBRIS_VASUDAN_MEDIUM, "Vasudan Medium",
|
||||
DEBRIS_VASUDAN_LARGE, "Vasudan Large",
|
||||
|
||||
DEBRIS_SHIVAN_SMALL, "Shivan Small",
|
||||
DEBRIS_SHIVAN_MEDIUM, "Shivan Medium",
|
||||
DEBRIS_SHIVAN_LARGE, "Shivan Large"
|
||||
};
|
||||
|
||||
// used for randomly generating debris type when there are multiple sizes.
|
||||
#define SMALL_DEBRIS_WEIGHT 8
|
||||
#define MEDIUM_DEBRIS_WEIGHT 4
|
||||
@@ -424,7 +484,7 @@ float asteroid_cap_speed(int asteroid_info_index, float speed)
|
||||
// Returns whether position is inside inner bounding volume
|
||||
// sum together the following: 1 inside x, 2 inside y, 4 inside z
|
||||
// inside only when sum = 7
|
||||
int asteroid_in_inner_bound_with_axes(asteroid_field *asfieldp, vector *pos, float delta)
|
||||
int asteroid_in_inner_bound_with_axes(asteroid_field *asfieldp, vec3d *pos, float delta)
|
||||
{
|
||||
Assert(asfieldp->has_inner_bound);
|
||||
|
||||
@@ -446,7 +506,7 @@ int asteroid_in_inner_bound_with_axes(asteroid_field *asfieldp, vector *pos, flo
|
||||
|
||||
// check if asteroid is within inner bound
|
||||
// return 0 if not inside or no inner bound, 1 if inside inner bound
|
||||
int asteroid_in_inner_bound(asteroid_field *asfieldp, vector *pos, float delta) {
|
||||
int asteroid_in_inner_bound(asteroid_field *asfieldp, vec3d *pos, float delta) {
|
||||
|
||||
if (!asfieldp->has_inner_bound) {
|
||||
return 0;
|
||||
@@ -457,7 +517,7 @@ int asteroid_in_inner_bound(asteroid_field *asfieldp, vector *pos, float delta)
|
||||
|
||||
// repositions asteroid outside the inner box on all 3 axes
|
||||
// moves to the other side of the inner box a distance delta from edge of box
|
||||
void inner_bound_pos_fixup(asteroid_field *asfieldp, vector *pos)
|
||||
void inner_bound_pos_fixup(asteroid_field *asfieldp, vec3d *pos)
|
||||
{
|
||||
if (!asteroid_in_inner_bound(asfieldp, pos, 0)) {
|
||||
return;
|
||||
@@ -488,7 +548,7 @@ object *asteroid_create(asteroid_field *asfieldp, int asteroid_type, int asteroi
|
||||
object *objp;
|
||||
asteroid *asp;
|
||||
asteroid_info *asip;
|
||||
vector pos, delta_bound;
|
||||
vec3d pos, delta_bound;
|
||||
angles angs;
|
||||
float radius;
|
||||
ushort signature;
|
||||
@@ -603,7 +663,7 @@ object *asteroid_create(asteroid_field *asfieldp, int asteroid_type, int asteroi
|
||||
radius = 1.0f;
|
||||
}
|
||||
|
||||
vector rotvel;
|
||||
vec3d rotvel;
|
||||
if ( Game_mode & GM_NORMAL ) {
|
||||
vm_vec_rand_vec_quick(&rotvel);
|
||||
vm_vec_scale(&rotvel, frand()/4.0f + 0.1f);
|
||||
@@ -644,7 +704,7 @@ object *asteroid_create(asteroid_field *asfieldp, int asteroid_type, int asteroi
|
||||
objp->phys_info.I_body_inv.vec.rvec.xyz.x = 1.0f / (objp->phys_info.mass*asip->modelp[asteroid_subtype]->rad);
|
||||
objp->phys_info.I_body_inv.vec.uvec.xyz.y = objp->phys_info.I_body_inv.vec.rvec.xyz.x;
|
||||
objp->phys_info.I_body_inv.vec.fvec.xyz.z = objp->phys_info.I_body_inv.vec.rvec.xyz.x;
|
||||
objp->hull_strength = asip->initial_hull_strength * (0.8f + (float)Game_skill_level/NUM_SKILL_LEVELS)/2.0f;
|
||||
objp->hull_strength = asip->initial_asteroid_strength * (0.8f + (float)Game_skill_level/NUM_SKILL_LEVELS)/2.0f;
|
||||
|
||||
// ensure vel is valid
|
||||
Assert( !vm_is_vec_nan(&objp->phys_info.vel) );
|
||||
@@ -656,7 +716,7 @@ object *asteroid_create(asteroid_field *asfieldp, int asteroid_type, int asteroi
|
||||
}
|
||||
|
||||
// Create asteroids when parent_objp blows up.
|
||||
void asteroid_sub_create(object *parent_objp, int asteroid_type, vector *relvec)
|
||||
void asteroid_sub_create(object *parent_objp, int asteroid_type, vec3d *relvec)
|
||||
{
|
||||
object *new_objp;
|
||||
float speed;
|
||||
@@ -745,30 +805,16 @@ int get_debris_from_same_group(int index) {
|
||||
// the weight is then used to determine the frequencty of different sizes of ship debris
|
||||
int get_debris_weight(int ship_debris_index)
|
||||
{
|
||||
switch (ship_debris_index) {
|
||||
case DEBRIS_TERRAN_SMALL:
|
||||
case DEBRIS_VASUDAN_SMALL:
|
||||
case DEBRIS_SHIVAN_SMALL:
|
||||
if (ship_debris_index % 3 == 0)
|
||||
return SMALL_DEBRIS_WEIGHT;
|
||||
break;
|
||||
|
||||
case DEBRIS_TERRAN_MEDIUM:
|
||||
case DEBRIS_VASUDAN_MEDIUM:
|
||||
case DEBRIS_SHIVAN_MEDIUM:
|
||||
if (ship_debris_index % 3 == 1)
|
||||
return MEDIUM_DEBRIS_WEIGHT;
|
||||
break;
|
||||
|
||||
case DEBRIS_TERRAN_LARGE:
|
||||
case DEBRIS_VASUDAN_LARGE:
|
||||
case DEBRIS_SHIVAN_LARGE:
|
||||
if (ship_debris_index % 3 == 2)
|
||||
return LARGE_DEBRIS_WEIGHT;
|
||||
break;
|
||||
|
||||
default:
|
||||
Int3();
|
||||
return 1;
|
||||
break;
|
||||
}
|
||||
//Int3();
|
||||
return 1;
|
||||
}
|
||||
|
||||
// Create all the asteroids for the mission, called from
|
||||
@@ -974,8 +1020,8 @@ int asteroid_is_targeted(object *objp)
|
||||
// Create an asteroid that will hit object *objp in delta_time seconds
|
||||
void asteroid_aim_at_target(object *objp, object *asteroid_objp, float delta_time)
|
||||
{
|
||||
vector predicted_center_pos;
|
||||
vector rand_vec;
|
||||
vec3d predicted_center_pos;
|
||||
vec3d rand_vec;
|
||||
float speed;
|
||||
|
||||
vm_vec_scale_add(&predicted_center_pos, &objp->pos, &objp->phys_info.vel, delta_time);
|
||||
@@ -1080,7 +1126,7 @@ void asteroid_maybe_reposition(object *objp, asteroid_field *asfieldp)
|
||||
}
|
||||
|
||||
if ( asteroid_should_wrap(objp, asfieldp) ) {
|
||||
vector vec_to_asteroid, old_asteroid_pos, old_vel;
|
||||
vec3d vec_to_asteroid, old_asteroid_pos, old_vel;
|
||||
float dot, dist;
|
||||
|
||||
old_asteroid_pos = objp->pos;
|
||||
@@ -1138,7 +1184,7 @@ void lerp(float *goal, float f1, float f2, float scale)
|
||||
void asteroid_process_pre( object *objp, float frame_time)
|
||||
{
|
||||
if (Asteroids_enabled) {
|
||||
vector *v, *vv;
|
||||
vec3d *v, *vv;
|
||||
|
||||
v = &objp->phys_info.vel;
|
||||
vv = &objp->phys_info.desired_vel;
|
||||
@@ -1153,8 +1199,8 @@ void asteroid_process_pre( object *objp, float frame_time)
|
||||
}
|
||||
|
||||
#pragma warning ( push )
|
||||
#pragma warning ( disable : 4701 )
|
||||
int asteroid_check_collision(object *pasteroid, object *other_obj, vector *hitpos, collision_info_struct *asteroid_hit_info)
|
||||
#pragma warning ( disable : 4701 ) // possible use of variable without initialization
|
||||
int asteroid_check_collision(object *pasteroid, object *other_obj, vec3d *hitpos, collision_info_struct *asteroid_hit_info)
|
||||
{
|
||||
if (!Asteroids_enabled) {
|
||||
return 0;
|
||||
@@ -1198,7 +1244,7 @@ int asteroid_check_collision(object *pasteroid, object *other_obj, vector *hitpo
|
||||
object *heavy_obj = heavy;
|
||||
object *light_obj = light;
|
||||
|
||||
vector zero, p0, p1;
|
||||
vec3d zero, p0, p1;
|
||||
vm_vec_zero( &zero );
|
||||
vm_vec_sub( &p0, &light->last_pos, &heavy->last_pos );
|
||||
vm_vec_sub( &p1, &light->pos, &heavy->pos );
|
||||
@@ -1208,7 +1254,7 @@ int asteroid_check_collision(object *pasteroid, object *other_obj, vector *hitpo
|
||||
mc.p1 = &p1; // Point 2 of ray to check
|
||||
|
||||
// find the light object's position in the heavy object's reference frame at last frame and also in this frame.
|
||||
vector p0_temp, p0_rotated;
|
||||
vec3d p0_temp, p0_rotated;
|
||||
|
||||
// Collision detection from rotation enabled if at rotaion is less than 30 degree in frame
|
||||
// This should account for all ships
|
||||
@@ -1241,7 +1287,7 @@ int asteroid_check_collision(object *pasteroid, object *other_obj, vector *hitpo
|
||||
|
||||
// copy important data
|
||||
int copy_flags = mc.flags; // make a copy of start end positions of sphere in big ship RF
|
||||
vector copy_p0, copy_p1;
|
||||
vec3d copy_p0, copy_p1;
|
||||
copy_p0 = *mc.p0;
|
||||
copy_p1 = *mc.p1;
|
||||
|
||||
@@ -1312,7 +1358,7 @@ int asteroid_check_collision(object *pasteroid, object *other_obj, vector *hitpo
|
||||
}
|
||||
|
||||
// find position in submodel RF of light object at collison
|
||||
vector int_light_pos, diff;
|
||||
vec3d int_light_pos, diff;
|
||||
vm_vec_sub(&diff, mc.p1, mc.p0);
|
||||
vm_vec_scale_add(&int_light_pos, mc.p0, &diff, mc.hit_dist);
|
||||
model_find_world_point(&asteroid_hit_info->light_collision_cm_pos, &int_light_pos, mc.model_num, mc.hit_submodel, &heavy_obj->orient, &zero);
|
||||
@@ -1344,7 +1390,7 @@ int asteroid_check_collision(object *pasteroid, object *other_obj, vector *hitpo
|
||||
}
|
||||
|
||||
// find position in submodel RF of light object at collison
|
||||
vector diff;
|
||||
vec3d diff;
|
||||
vm_vec_sub(&diff, mc.p1, mc.p0);
|
||||
vm_vec_scale_add(&asteroid_hit_info->light_collision_cm_pos, mc.p0, &diff, mc.hit_dist);
|
||||
|
||||
@@ -1375,7 +1421,7 @@ int asteroid_check_collision(object *pasteroid, object *other_obj, vector *hitpo
|
||||
}
|
||||
|
||||
// find position in submodel RF of light object at collison
|
||||
vector diff;
|
||||
vec3d diff;
|
||||
vm_vec_sub(&diff, mc.p1, mc.p0);
|
||||
vm_vec_scale_add(&asteroid_hit_info->light_collision_cm_pos, mc.p0, &diff, mc.hit_dist);
|
||||
|
||||
@@ -1433,9 +1479,9 @@ void asteroid_render(object * obj)
|
||||
}
|
||||
|
||||
// Create a normalized vector generally in the direction from *hitpos to other_obj->pos
|
||||
void asc_get_relvec(vector *relvec, object *other_obj, vector *hitpos)
|
||||
void asc_get_relvec(vec3d *relvec, object *other_obj, vec3d *hitpos)
|
||||
{
|
||||
vector tvec, rand_vec;
|
||||
vec3d tvec, rand_vec;
|
||||
int count = 0;
|
||||
|
||||
vm_vec_normalized_dir(&tvec, &other_obj->pos, hitpos);
|
||||
@@ -1498,30 +1544,15 @@ void asteriod_explode_sound(object *objp, int type, int play_loud)
|
||||
int sound_index = -1;
|
||||
float range_factor = 1.0f; // how many times sound should traver farther than normal
|
||||
|
||||
switch (type) {
|
||||
case ASTEROID_TYPE_SMALL:
|
||||
case ASTEROID_TYPE_MEDIUM:
|
||||
case DEBRIS_TERRAN_SMALL:
|
||||
case DEBRIS_TERRAN_MEDIUM:
|
||||
case DEBRIS_VASUDAN_SMALL:
|
||||
case DEBRIS_VASUDAN_MEDIUM:
|
||||
case DEBRIS_SHIVAN_SMALL:
|
||||
case DEBRIS_SHIVAN_MEDIUM:
|
||||
if (type % 3 <= 1)
|
||||
{
|
||||
sound_index = SND_ASTEROID_EXPLODE_SMALL;
|
||||
range_factor = 5.0f;
|
||||
break;
|
||||
|
||||
case ASTEROID_TYPE_BIG:
|
||||
case DEBRIS_TERRAN_LARGE:
|
||||
case DEBRIS_VASUDAN_LARGE:
|
||||
case DEBRIS_SHIVAN_LARGE:
|
||||
range_factor = 5.0;
|
||||
}
|
||||
else
|
||||
{
|
||||
sound_index = SND_ASTEROID_EXPLODE_BIG;
|
||||
range_factor = 10.0f;
|
||||
break;
|
||||
|
||||
default:
|
||||
Int3();
|
||||
return;
|
||||
}
|
||||
|
||||
Assert(sound_index != -1);
|
||||
@@ -1575,7 +1606,7 @@ void asteroid_do_area_effect(object *asteroid_objp)
|
||||
// other_obj => object that hit asteroid, can be NULL if asteroid hit by area effect
|
||||
// hitpos => world position asteroid was hit, can be NULL if hit by area effect
|
||||
// damage => amount of damage to apply to asteroid
|
||||
void asteroid_hit( object * asteroid_obj, object * other_obj, vector * hitpos, float damage )
|
||||
void asteroid_hit( object * asteroid_obj, object * other_obj, vec3d * hitpos, float damage )
|
||||
{
|
||||
float explosion_life;
|
||||
asteroid *asp;
|
||||
@@ -1613,7 +1644,7 @@ void asteroid_hit( object * asteroid_obj, object * other_obj, vector * hitpos, f
|
||||
} else {
|
||||
asp->death_hit_pos = asteroid_obj->pos;
|
||||
// randomize hit pos a bit, otherwise we will get a NULL vector when trying to find direction to toss child asteroids
|
||||
vector rand_vec;
|
||||
vec3d rand_vec;
|
||||
vm_vec_rand_vec_quick(&rand_vec);
|
||||
vm_vec_add2(&asp->death_hit_pos, &rand_vec);
|
||||
}
|
||||
@@ -1719,7 +1750,7 @@ void asteroid_maybe_break_up(object *asteroid_obj)
|
||||
asp = &Asteroids[asteroid_obj->instance];
|
||||
|
||||
if ( timestamp_elapsed(asp->final_death_time) ) {
|
||||
vector relvec, vfh, tvec;
|
||||
vec3d relvec, vfh, tvec;
|
||||
|
||||
asteroid_obj->flags |= OF_SHOULD_BE_DEAD;
|
||||
|
||||
@@ -1728,51 +1759,43 @@ void asteroid_maybe_break_up(object *asteroid_obj)
|
||||
#ifndef NO_NETWORK
|
||||
if ( !MULTIPLAYER_CLIENT ) {
|
||||
#endif
|
||||
switch (asp->type) {
|
||||
case ASTEROID_TYPE_SMALL:
|
||||
break;
|
||||
case ASTEROID_TYPE_MEDIUM:
|
||||
asc_get_relvec(&relvec, asteroid_obj, &asp->death_hit_pos);
|
||||
asteroid_sub_create(asteroid_obj, ASTEROID_TYPE_SMALL, &relvec);
|
||||
|
||||
vm_vec_normalized_dir(&vfh, &asteroid_obj->pos, &asp->death_hit_pos);
|
||||
vm_vec_copy_scale(&tvec, &vfh, 2.0f);
|
||||
vm_vec_sub2(&tvec, &relvec);
|
||||
asteroid_sub_create(asteroid_obj, ASTEROID_TYPE_SMALL, &tvec);
|
||||
|
||||
break;
|
||||
case ASTEROID_TYPE_BIG:
|
||||
asc_get_relvec(&relvec, asteroid_obj, &asp->death_hit_pos);
|
||||
asteroid_sub_create(asteroid_obj, ASTEROID_TYPE_MEDIUM, &relvec);
|
||||
|
||||
vm_vec_normalized_dir(&vfh, &asteroid_obj->pos, &asp->death_hit_pos);
|
||||
vm_vec_copy_scale(&tvec, &vfh, 2.0f);
|
||||
vm_vec_sub2(&tvec, &relvec);
|
||||
asteroid_sub_create(asteroid_obj, ASTEROID_TYPE_MEDIUM, &tvec);
|
||||
|
||||
while (frand() > 0.6f) {
|
||||
vector rvec, tvec2;
|
||||
vm_vec_rand_vec_quick(&rvec);
|
||||
vm_vec_scale_add(&tvec2, &vfh, &rvec, 0.75f);
|
||||
asteroid_sub_create(asteroid_obj, ASTEROID_TYPE_SMALL, &tvec2);
|
||||
if (asp->type <= ASTEROID_TYPE_BIG) // 3
|
||||
// if this isn't true it's just debris, and debris doesn't break up
|
||||
{
|
||||
switch (asp->type) {
|
||||
case ASTEROID_TYPE_SMALL:
|
||||
break;
|
||||
case ASTEROID_TYPE_MEDIUM:
|
||||
asc_get_relvec(&relvec, asteroid_obj, &asp->death_hit_pos);
|
||||
asteroid_sub_create(asteroid_obj, ASTEROID_TYPE_SMALL, &relvec);
|
||||
|
||||
vm_vec_normalized_dir(&vfh, &asteroid_obj->pos, &asp->death_hit_pos);
|
||||
vm_vec_copy_scale(&tvec, &vfh, 2.0f);
|
||||
vm_vec_sub2(&tvec, &relvec);
|
||||
asteroid_sub_create(asteroid_obj, ASTEROID_TYPE_SMALL, &tvec);
|
||||
|
||||
break;
|
||||
case ASTEROID_TYPE_BIG:
|
||||
asc_get_relvec(&relvec, asteroid_obj, &asp->death_hit_pos);
|
||||
asteroid_sub_create(asteroid_obj, ASTEROID_TYPE_MEDIUM, &relvec);
|
||||
|
||||
vm_vec_normalized_dir(&vfh, &asteroid_obj->pos, &asp->death_hit_pos);
|
||||
vm_vec_copy_scale(&tvec, &vfh, 2.0f);
|
||||
vm_vec_sub2(&tvec, &relvec);
|
||||
asteroid_sub_create(asteroid_obj, ASTEROID_TYPE_MEDIUM, &tvec);
|
||||
|
||||
while (frand() > 0.6f) {
|
||||
vec3d rvec, tvec2;
|
||||
vm_vec_rand_vec_quick(&rvec);
|
||||
vm_vec_scale_add(&tvec2, &vfh, &rvec, 0.75f);
|
||||
asteroid_sub_create(asteroid_obj, ASTEROID_TYPE_SMALL, &tvec2);
|
||||
}
|
||||
break;
|
||||
|
||||
default: // this isn't going to happen.. really
|
||||
break;
|
||||
}
|
||||
|
||||
break;
|
||||
|
||||
// ship debris does not break up
|
||||
case DEBRIS_TERRAN_SMALL:
|
||||
case DEBRIS_TERRAN_MEDIUM:
|
||||
case DEBRIS_TERRAN_LARGE:
|
||||
case DEBRIS_VASUDAN_SMALL:
|
||||
case DEBRIS_VASUDAN_MEDIUM:
|
||||
case DEBRIS_VASUDAN_LARGE:
|
||||
case DEBRIS_SHIVAN_SMALL:
|
||||
case DEBRIS_SHIVAN_MEDIUM:
|
||||
case DEBRIS_SHIVAN_LARGE:
|
||||
break;
|
||||
|
||||
default:
|
||||
Int3();
|
||||
}
|
||||
#ifndef NO_NETWORK
|
||||
}
|
||||
@@ -1782,10 +1805,10 @@ void asteroid_maybe_break_up(object *asteroid_obj)
|
||||
}
|
||||
}
|
||||
|
||||
int asteroid_get_random_in_cone(vector *pos, vector *dir, float ang, int danger)
|
||||
int asteroid_get_random_in_cone(vec3d *pos, vec3d *dir, float ang, int danger)
|
||||
{
|
||||
int idx;
|
||||
vector asteroid_dir;
|
||||
vec3d asteroid_dir;
|
||||
|
||||
// just pick the first asteroid which satisfies our condition
|
||||
for(idx=0; idx<Num_asteroids; idx++){
|
||||
@@ -1804,7 +1827,7 @@ int asteroid_get_random_in_cone(vector *pos, vector *dir, float ang, int danger)
|
||||
void asteroid_test_collide(object *asteroid_obj, object *ship_obj, mc_info *mc)
|
||||
{
|
||||
float asteroid_ray_dist;
|
||||
vector asteroid_fvec, terminus;
|
||||
vec3d asteroid_fvec, terminus;
|
||||
|
||||
// See if ray from asteroid intersects bounding box of escort ship
|
||||
asteroid_ray_dist = vm_vec_mag_quick(&asteroid_obj->phys_info.desired_vel) * ASTEROID_MIN_COLLIDE_TIME;
|
||||
@@ -1991,20 +2014,20 @@ void asteroid_parse_section()
|
||||
stuff_string(asip->name, F_NAME, NULL);
|
||||
|
||||
required_string( "$POF file1:" );
|
||||
stuff_string_white( asip->pof_files[0] );
|
||||
stuff_string(asip->pof_files[0], F_NAME, NULL);
|
||||
|
||||
required_string( "$POF file2:" );
|
||||
stuff_string_white( asip->pof_files[1] );
|
||||
stuff_string(asip->pof_files[1], F_NAME, NULL);
|
||||
|
||||
if ( (strstr(asip->name,"Asteroid") != NULL) || (strstr(asip->name, "asteroid") != NULL) ) {
|
||||
required_string( "$POF file3:" );
|
||||
stuff_string_white( asip->pof_files[2] );
|
||||
stuff_string(asip->pof_files[2], F_NAME, NULL);
|
||||
}
|
||||
|
||||
asip->num_detail_levels = 0;
|
||||
|
||||
required_string("$Detail distance:");
|
||||
asip->num_detail_levels = stuff_int_list(asip->detail_distance, MAX_SHIP_DETAIL_LEVELS, RAW_INTEGER_TYPE);
|
||||
asip->num_detail_levels = stuff_int_list(asip->detail_distance, MAX_ASTEROID_DETAIL_LEVELS, RAW_INTEGER_TYPE);
|
||||
|
||||
required_string("$Max Speed:");
|
||||
stuff_float(&asip->max_speed);
|
||||
@@ -2022,9 +2045,9 @@ void asteroid_parse_section()
|
||||
stuff_float(&asip->blast);
|
||||
|
||||
required_string("$Hitpoints:");
|
||||
stuff_float(&asip->initial_hull_strength);
|
||||
stuff_float(&asip->initial_asteroid_strength);
|
||||
}
|
||||
|
||||
extern int True_NumSpecies;
|
||||
// read in data from asteroid.tbl into Asteroid_info[] array
|
||||
void asteroid_parse_tbl()
|
||||
{
|
||||
@@ -2040,8 +2063,11 @@ void asteroid_parse_tbl()
|
||||
|
||||
required_string("#Asteroid Types");
|
||||
|
||||
// total we're expecting
|
||||
int Total_asteroid_types = ((True_NumSpecies + 1) * 3);
|
||||
|
||||
while (required_string_either("#End","$Name:")) {
|
||||
Assert( Num_asteroid_types < MAX_DEBRIS_TYPES );
|
||||
Assert( Num_asteroid_types < Total_asteroid_types );
|
||||
asteroid_parse_section();
|
||||
Num_asteroid_types++;
|
||||
}
|
||||
@@ -2049,7 +2075,7 @@ void asteroid_parse_tbl()
|
||||
required_string("#End");
|
||||
|
||||
// check all read in
|
||||
Assert(Num_asteroid_types == MAX_DEBRIS_TYPES);
|
||||
Assert(Num_asteroid_types == Total_asteroid_types);
|
||||
|
||||
Asteroid_impact_explosion_ani = -1;
|
||||
required_string("$Impact Explosion:");
|
||||
@@ -2263,14 +2289,8 @@ void asteroid_page_in()
|
||||
for (j=0; j<asip->modelp[k]->n_textures; j++ ) {
|
||||
int bitmap_num = asip->modelp[k]->original_textures[j];
|
||||
|
||||
|
||||
// if we're in Glide (and maybe later with D3D), use nondarkening textures
|
||||
if ( bitmap_num > -1 ) {
|
||||
if(gr_screen.mode == GR_GLIDE){
|
||||
bm_page_in_nondarkening_texture( bitmap_num );
|
||||
} else {
|
||||
bm_page_in_texture( bitmap_num );
|
||||
}
|
||||
bm_page_in_texture( bitmap_num );
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2278,7 +2298,7 @@ void asteroid_page_in()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
#else
|
||||
|
||||
// stubbed out functions not used in the demo
|
||||
@@ -2290,8 +2310,8 @@ void asteroid_render( object *asteroid_objp ) {}
|
||||
void asteroid_delete( object *asteroid_objp ) {}
|
||||
void asteroid_process_pre( object *asteroid_objp, float frame_time) {}
|
||||
void asteroid_process_post( object *asteroid_objp, float frame_time) {}
|
||||
int asteroid_check_collision( object *asteroid_objp, object * other_obj, vector * hitpos, collision_info_struct *asteroid_hit_info ) {return 0;}
|
||||
void asteroid_hit( object *asteroid_objp, object *other_objp, vector *hitpos, float damage ) {}
|
||||
int asteroid_check_collision( object *asteroid_objp, object * other_obj, vec3d * hitpos, collision_info_struct *asteroid_hit_info ) {return 0;}
|
||||
void asteroid_hit( object *asteroid_objp, object *other_objp, vec3d *hitpos, float damage ) {}
|
||||
void asteroid_save_restore(CFILE *fp) {}
|
||||
int asteroid_count() {return 0;}
|
||||
int asteroid_collide_objnum(object *asteroid_objp) {return 0;}
|
||||
@@ -2299,8 +2319,9 @@ float asteroid_time_to_impact(object *asteroid_objp) {return 0.0f;}
|
||||
void asteroid_show_brackets() {}
|
||||
void asteroid_target_closest_danger() {}
|
||||
void asteroid_page_in() {}
|
||||
void asteroid_sub_create(object *parent_objp, int asteroid_type, vector *relvec) {}
|
||||
void asteroid_sub_create(object *parent_objp, int asteroid_type, vec3d *relvec) {}
|
||||
void asteroid_frame() {}
|
||||
|
||||
|
||||
#endif
|
||||
*/
|
||||
@@ -9,13 +9,41 @@
|
||||
|
||||
/*
|
||||
* $Logfile: /Freespace2/code/Asteroid/Asteroid.h $
|
||||
* $Revision: 2.1 $
|
||||
* $Date: 2002-08-01 01:41:04 $
|
||||
* $Author: penguin $
|
||||
* $Revision: 2.9 $
|
||||
* $Date: 2005-07-13 02:50:48 $
|
||||
* $Author: Goober5000 $
|
||||
*
|
||||
* Header file for asteroids
|
||||
*
|
||||
* $Log: not supported by cvs2svn $
|
||||
* Revision 2.8 2005/07/13 02:01:28 Goober5000
|
||||
* fixed a bunch of "issues" caused by me with the species stuff
|
||||
* --Goober5000
|
||||
*
|
||||
* Revision 2.7 2005/07/13 00:44:20 Goober5000
|
||||
* improved species support and removed need for #define
|
||||
* --Goober5000
|
||||
*
|
||||
* Revision 2.6 2005/04/05 05:53:14 taylor
|
||||
* s/vector/vec3d/g, better support for different compilers (Jens Granseuer)
|
||||
*
|
||||
* Revision 2.5 2004/08/11 05:06:18 Kazan
|
||||
* added preprocdefines.h to prevent what happened with fred -- make sure to make all fred2 headers include this file as the _first_ include -- i have already modified fs2 files to do this
|
||||
*
|
||||
* Revision 2.4 2004/03/05 09:01:53 Goober5000
|
||||
* Uber pass at reducing #includes
|
||||
* --Goober5000
|
||||
*
|
||||
* Revision 2.3 2003/10/15 22:03:23 Kazan
|
||||
* Da Species Update :D
|
||||
*
|
||||
* Revision 2.2 2003/04/29 01:03:22 Goober5000
|
||||
* implemented the custom hitpoints mod
|
||||
* --Goober5000
|
||||
*
|
||||
* Revision 2.1 2002/08/01 01:41:04 penguin
|
||||
* The big include file move
|
||||
*
|
||||
* Revision 2.0 2002/06/03 04:02:21 penguin
|
||||
* Warpcore CVS sync
|
||||
*
|
||||
@@ -125,8 +153,8 @@
|
||||
#ifndef __ASTEROID_H__
|
||||
#define __ASTEROID_H__
|
||||
|
||||
#include "ship/ship.h"
|
||||
#include "parse/parselo.h" // for NAME_LENGTH
|
||||
#include "globalincs/pstypes.h"
|
||||
#include "globalincs/globals.h" // for NAME_LENGTH
|
||||
|
||||
struct object;
|
||||
struct polymodel;
|
||||
@@ -134,29 +162,14 @@ struct collision_info_struct;
|
||||
|
||||
#define MAX_ASTEROIDS 256
|
||||
|
||||
// DEBRIS TYPES
|
||||
#define MAX_DEBRIS_TYPES 12
|
||||
#define ASTEROID_TYPE_SMALL 0
|
||||
#define ASTEROID_TYPE_MEDIUM 1
|
||||
#define ASTEROID_TYPE_BIG 2
|
||||
//
|
||||
#define DEBRIS_TERRAN_SMALL 3
|
||||
#define DEBRIS_TERRAN_MEDIUM 4
|
||||
#define DEBRIS_TERRAN_LARGE 5
|
||||
//
|
||||
#define DEBRIS_VASUDAN_SMALL 6
|
||||
#define DEBRIS_VASUDAN_MEDIUM 7
|
||||
#define DEBRIS_VASUDAN_LARGE 8
|
||||
//
|
||||
#define DEBRIS_SHIVAN_SMALL 9
|
||||
#define DEBRIS_SHIVAN_MEDIUM 10
|
||||
#define DEBRIS_SHIVAN_LARGE 11
|
||||
// END DEBRIS TYPES
|
||||
#define ASTEROID_TYPE_MEDIUM 1
|
||||
#define ASTEROID_TYPE_BIG 2
|
||||
|
||||
// This is for the asteroid types plus DEBRIS_X_Y
|
||||
// (X is each species and Y is SMALL, MEDIUM, and LARGE)
|
||||
#define MAX_DEBRIS_TYPES ((MAX_SPECIES + 1) * 3)
|
||||
|
||||
typedef struct debris_struct {
|
||||
int index;
|
||||
char *name;
|
||||
} debris_struct;
|
||||
|
||||
// Data structure to track the active asteroids
|
||||
typedef struct asteroid_obj {
|
||||
@@ -166,23 +179,24 @@ typedef struct asteroid_obj {
|
||||
extern asteroid_obj Asteroid_obj_list;
|
||||
|
||||
|
||||
extern debris_struct Field_debris_info[];
|
||||
|
||||
#define MAX_ASTEROID_POFS 3 // Max number of POFs per asteroid type
|
||||
|
||||
#define AF_USED (1<<0) // Set means used.
|
||||
|
||||
// Goober5000 - currently same as MAX_SHIP_DETAIL_LEVELS (put here to avoid an #include)
|
||||
#define MAX_ASTEROID_DETAIL_LEVELS 5
|
||||
|
||||
typedef struct asteroid_info {
|
||||
char name[NAME_LENGTH]; // name for the asteroid
|
||||
char pof_files[MAX_ASTEROID_POFS][NAME_LENGTH]; // POF files to load/associate with ship
|
||||
int num_detail_levels; // number of detail levels for this ship
|
||||
int detail_distance[MAX_SHIP_DETAIL_LEVELS]; // distance to change detail levels at
|
||||
int detail_distance[MAX_ASTEROID_DETAIL_LEVELS]; // distance to change detail levels at
|
||||
float max_speed; // cap on speed for asteroid
|
||||
float inner_rad; // radius within which maximum area effect damage is applied
|
||||
float outer_rad; // radius at which no area effect damage is applied
|
||||
float damage; // maximum damage applied from area effect explosion
|
||||
float blast; // maximum blast impulse from area effect explosion
|
||||
float initial_hull_strength; // starting strength of asteroid
|
||||
float initial_asteroid_strength; // starting strength of asteroid
|
||||
polymodel *modelp[MAX_ASTEROID_POFS];
|
||||
int model_num[MAX_ASTEROID_POFS];
|
||||
} asteroid_info;
|
||||
@@ -197,15 +211,10 @@ typedef struct asteroid {
|
||||
int final_death_time; // timestamp to swap in new models after explosion starts
|
||||
int collide_objnum; // set to objnum that asteroid will be impacting soon
|
||||
int collide_objsig; // object signature corresponding to collide_objnum
|
||||
vector death_hit_pos; // hit pos that caused death
|
||||
vec3d death_hit_pos; // hit pos that caused death
|
||||
int target_objnum; // Yes, hah! Asteroids can have targets. See asteroid_aim_at_target().
|
||||
} asteroid;
|
||||
|
||||
// TYPEDEF FOR SPECIES OF DEBRIS - BITFIELD
|
||||
#define DS_TERRAN 0x01
|
||||
#define DS_VASUDAN 0x02
|
||||
#define DS_SHIVAN 0x04
|
||||
|
||||
// TYPEDEF FOR DEBRIS TYPE
|
||||
typedef enum {
|
||||
DG_ASTEROID,
|
||||
@@ -221,12 +230,12 @@ typedef enum {
|
||||
#define MAX_ACTIVE_DEBRIS_TYPES 3
|
||||
|
||||
typedef struct asteroid_field {
|
||||
vector min_bound; // Minimum range of field.
|
||||
vector max_bound; // Maximum range of field.
|
||||
vec3d min_bound; // Minimum range of field.
|
||||
vec3d max_bound; // Maximum range of field.
|
||||
int has_inner_bound;
|
||||
vector inner_min_bound;
|
||||
vector inner_max_bound;
|
||||
vector vel; // Average asteroid moves at this velocity.
|
||||
vec3d inner_min_bound;
|
||||
vec3d inner_max_bound;
|
||||
vec3d vel; // Average asteroid moves at this velocity.
|
||||
float speed; // Average speed of field
|
||||
int num_initial_asteroids; // Number of asteroids at creation.
|
||||
field_type_t field_type; // active throws and wraps, passive does not
|
||||
@@ -250,17 +259,17 @@ void asteroid_render( object *asteroid_objp );
|
||||
void asteroid_delete( object *asteroid_objp );
|
||||
void asteroid_process_pre( object *asteroid_objp, float frame_time);
|
||||
void asteroid_process_post( object *asteroid_objp, float frame_time);
|
||||
int asteroid_check_collision( object *asteroid_objp, object * other_obj, vector * hitpos, collision_info_struct *asteroid_hit_info=NULL );
|
||||
void asteroid_hit( object *asteroid_objp, object *other_objp, vector *hitpos, float damage );
|
||||
int asteroid_check_collision( object *asteroid_objp, object * other_obj, vec3d * hitpos, collision_info_struct *asteroid_hit_info=NULL );
|
||||
void asteroid_hit( object *asteroid_objp, object *other_objp, vec3d *hitpos, float damage );
|
||||
int asteroid_count();
|
||||
int asteroid_collide_objnum(object *asteroid_objp);
|
||||
float asteroid_time_to_impact(object *asteroid_objp);
|
||||
void asteroid_show_brackets();
|
||||
void asteroid_target_closest_danger();
|
||||
int asteroid_get_random_in_cone(vector *pos, vector *dir, float ang, int danger = 0);
|
||||
int asteroid_get_random_in_cone(vec3d *pos, vec3d *dir, float ang, int danger = 0);
|
||||
|
||||
// need to extern for multiplayer
|
||||
void asteroid_sub_create(object *parent_objp, int asteroid_type, vector *relvec);
|
||||
void asteroid_sub_create(object *parent_objp, int asteroid_type, vec3d *relvec);
|
||||
|
||||
void asteroid_frame();
|
||||
|
||||
|
||||
@@ -0,0 +1,839 @@
|
||||
// Autopilot.cpp
|
||||
// Derek Meek
|
||||
// 4-30-2004
|
||||
|
||||
/*
|
||||
* $Logfile: /Freespace2/code/Autopilot/Autopilot.cpp $
|
||||
* $Revision: 1.22 $
|
||||
* $Date: 2005-08-23 09:18:08 $
|
||||
* $Author: Goober5000 $
|
||||
*
|
||||
* $Log: not supported by cvs2svn $
|
||||
* Revision 1.21 2005/07/23 16:25:32 Goober5000
|
||||
* remove an extraneous extern
|
||||
* --Goober5000
|
||||
*
|
||||
* Revision 1.20 2005/07/13 02:30:52 Goober5000
|
||||
* removed autopilot #define
|
||||
* --Goober5000
|
||||
*
|
||||
* Revision 1.19 2005/04/19 23:03:42 wmcoolmon
|
||||
* Lock time compression when autopilot is engaged
|
||||
*
|
||||
* Revision 1.18 2005/04/05 05:53:14 taylor
|
||||
* s/vector/vec3d/g, better support for different compilers (Jens Granseuer)
|
||||
*
|
||||
* Revision 1.17 2005/03/25 06:57:32 wmcoolmon
|
||||
* Big, massive, codebase commit. I have not removed the old ai files as the ones I uploaded aren't up-to-date (But should work with the rest of the codebase)
|
||||
*
|
||||
* Revision 1.16 2005/03/03 06:05:26 wmcoolmon
|
||||
* Merge of WMC's codebase. "Features and bugs, making Goober say "Grr!", as release would be stalled now for two months for sure"
|
||||
*
|
||||
* Revision 1.15 2005/01/31 23:27:51 taylor
|
||||
* merge with Linux/OSX tree - p0131-2
|
||||
*
|
||||
* Revision 1.14 2004/10/03 21:41:10 Kazan
|
||||
* Autopilot convergence collision fix for ai_fly_to_ship() and ai_waypoints() -- mathematically expensive, only usable by autopilot
|
||||
*
|
||||
* Revision 1.13 2004/09/28 22:51:41 Kazan
|
||||
* fix autopilot formation bug
|
||||
*
|
||||
* Revision 1.12 2004/09/28 19:54:31 Kazan
|
||||
* | is binary or, || is boolean or - please use the right one
|
||||
* autopilot velocity ramping biasing
|
||||
* made debugged+k kill guardianed ships
|
||||
*
|
||||
* Revision 1.11 2004/07/29 23:41:21 Kazan
|
||||
* bugfixes
|
||||
*
|
||||
* Revision 1.10 2004/07/27 18:52:10 Kazan
|
||||
* squished another
|
||||
*
|
||||
* Revision 1.9 2004/07/27 18:04:09 Kazan
|
||||
* i love it when bugs go crunch (autopilot ai fixup)
|
||||
*
|
||||
* Revision 1.8 2004/07/26 20:47:24 Kazan
|
||||
* remove MCD complete
|
||||
*
|
||||
* Revision 1.7 2004/07/26 17:54:04 Kazan
|
||||
* Autopilot system completed -- i am dropping plans for GUI nav map
|
||||
* Fixed FPS counter during time compression
|
||||
*
|
||||
* Revision 1.6 2004/07/25 19:27:51 Kazan
|
||||
* only disable afterburning during AIM_WAYPOINTS and AIM_FLY_TO_SHIP while AutoPilotEngaged
|
||||
*
|
||||
* Revision 1.5 2004/07/25 18:46:28 Kazan
|
||||
* -fred_no_warn has become -no_warn and applies to both fred and fs2
|
||||
* added new ai directive (last commit) and disabled afterburners while performing AIM_WAYPOINTS or AIM_FLY_TO_SHIP
|
||||
* fixed player ship speed bug w/ player-use-ai, now stays in formation correctly and manages speed
|
||||
* made -radar_reduce ignore itself if no parameter is given (ignoring launcher bug)
|
||||
*
|
||||
* Revision 1.4 2004/07/25 00:31:27 Kazan
|
||||
* i have absolutely nothing to say about that subject
|
||||
*
|
||||
* Revision 1.3 2004/07/12 16:32:42 Kazan
|
||||
* MCD - define _MCD_CHECK to use memory tracking
|
||||
*
|
||||
* Revision 1.2 2004/07/01 16:38:18 Kazan
|
||||
* working on autonav
|
||||
*
|
||||
* Revision 1.1 2004/05/07 23:50:14 Kazan
|
||||
* Sorry Guys!
|
||||
*
|
||||
*
|
||||
*
|
||||
*
|
||||
*/
|
||||
|
||||
|
||||
#include "autopilot/autopilot.h"
|
||||
#include "ai/ai.h"
|
||||
#include "ai/aigoals.h"
|
||||
#include "ship/ship.h"
|
||||
#include "object/object.h"
|
||||
#include "parse/sexp.h"
|
||||
#include "freespace2/freespace.h"
|
||||
|
||||
|
||||
|
||||
// Extern functions/variables
|
||||
extern int Player_use_ai;
|
||||
extern int sexp_distance2(int obj1, char *subj);
|
||||
|
||||
|
||||
// Module variables
|
||||
bool AutoPilotEngaged;
|
||||
int CurrentNav;
|
||||
float ramp_bias;
|
||||
NavPoint Navs[MAX_NAVPOINTS];
|
||||
|
||||
// used for ramping time compression;
|
||||
int start_dist;
|
||||
|
||||
// ********************************************************************************************
|
||||
|
||||
void autopilot_ai_waypoint_goal_fixup(ai_goal* aigp)
|
||||
{
|
||||
// this function sets wp_index properly;
|
||||
for (int i = 0; i < Num_waypoint_lists; i++)
|
||||
{
|
||||
if (!stricmp(aigp->ship_name, Waypoint_lists[i].name))
|
||||
{
|
||||
aigp->wp_index = i;
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// ********************************************************************************************
|
||||
bool Sel_NextNav()
|
||||
{
|
||||
if (AutoPilotEngaged)
|
||||
return false;
|
||||
|
||||
int i;
|
||||
if (CurrentNav == -1)
|
||||
{
|
||||
for (i = 0; i < MAX_NAVPOINTS; i++)
|
||||
{
|
||||
if (Navs[i].flags & NP_VALIDTYPE && !(Navs[i].flags & NP_NOSELECT))
|
||||
{
|
||||
CurrentNav=i;
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
for (i = CurrentNav+1; i < MAX_NAVPOINTS+CurrentNav; i++)
|
||||
{
|
||||
if (Navs[i%MAX_NAVPOINTS].flags & NP_VALIDTYPE && !(Navs[i%MAX_NAVPOINTS].flags & NP_NOSELECT))
|
||||
{
|
||||
if (i != CurrentNav)
|
||||
{
|
||||
CurrentNav=i%MAX_NAVPOINTS;
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
// ********************************************************************************************
|
||||
vec3d NavPoint::GetPosition()
|
||||
{
|
||||
vec3d position;
|
||||
|
||||
if (flags & NP_WAYPOINT)
|
||||
{
|
||||
position = ((waypoint_list*)target_obj)->waypoints[waypoint_num-1];
|
||||
}
|
||||
else
|
||||
{
|
||||
position = Objects[((ship*)target_obj)->objnum].pos;
|
||||
}
|
||||
|
||||
return position;
|
||||
}
|
||||
|
||||
char* NavPoint::GetInteralName()
|
||||
{
|
||||
char *NavName;
|
||||
char strtmp[3];
|
||||
|
||||
if (flags & NP_WAYPOINT)
|
||||
{
|
||||
NavName = new char[strlen(((waypoint_list*)target_obj)->name)+5];
|
||||
memset(NavName, 0, strlen(((waypoint_list*)target_obj)->name)+5);
|
||||
strcpy(NavName, ((waypoint_list*)target_obj)->name);
|
||||
|
||||
strcat(NavName, ":");
|
||||
strcat(NavName, itoa(waypoint_num, strtmp, 10));
|
||||
}
|
||||
else
|
||||
{
|
||||
NavName = new char[strlen(((ship*)target_obj)->ship_name)+1];
|
||||
memset(NavName, 0, strlen(((ship*)target_obj)->ship_name)+1);
|
||||
strcpy(NavName, ((ship*)target_obj)->ship_name);
|
||||
}
|
||||
|
||||
return NavName;
|
||||
}
|
||||
|
||||
// ********************************************************************************************
|
||||
// Tell us is autopilot is allow
|
||||
// This needs:
|
||||
// * Nav point selected
|
||||
// * No enemies within X distance
|
||||
// * Destination > 1,000 meters away
|
||||
bool CanAutopilot()
|
||||
{
|
||||
bool CanAuto = true;
|
||||
CanAuto = CanAuto && CurrentNav != -1;
|
||||
|
||||
int dist = sexp_distance2(Player_ship->objnum, "<any hostile>");
|
||||
|
||||
CanAuto = CanAuto && (5000 <= dist || dist == SEXP_NAN);
|
||||
|
||||
|
||||
if (CanAuto) // protect against no currentNav
|
||||
{
|
||||
char *name = Navs[CurrentNav].GetInteralName();
|
||||
CanAuto = CanAuto && (1000 <= sexp_distance2(Player_ship->objnum, name));
|
||||
delete[] name;
|
||||
}
|
||||
|
||||
return CanAuto;
|
||||
}
|
||||
|
||||
// ********************************************************************************************
|
||||
// Engages autopilot
|
||||
// This does:
|
||||
// * Control switched from player to AI
|
||||
// * Time compression to 32x
|
||||
// * Lock time compression -WMC
|
||||
// * Tell AI to fly to targetted Nav Point (for all nav-status wings/ships)
|
||||
// * Sets max waypoint speed to the best-speed of the slowest ship tagged
|
||||
void StartAutopilot()
|
||||
{
|
||||
if (!CanAutopilot())
|
||||
return;
|
||||
|
||||
AutoPilotEngaged = true;
|
||||
|
||||
Player_use_ai = 1;
|
||||
set_time_compression(1);
|
||||
lock_time_compression(true);
|
||||
|
||||
// determine speed cap
|
||||
int i,j;
|
||||
float speed_cap = 1000000.0; // 1m is a safe starting point
|
||||
|
||||
for (i = 0; i < MAX_SHIPS; i++)
|
||||
{
|
||||
if (Ships[i].objnum != -1 &&
|
||||
(Ships[i].flags2 & SF2_NAVPOINT_CARRY ||
|
||||
(Ships[i].wingnum != -1 && Wings[Ships[i].wingnum].flags & WF_NAV_CARRY)
|
||||
)
|
||||
)
|
||||
{
|
||||
if (speed_cap > Ship_info[Ships[i].ship_info_index].max_vel.xyz.z)
|
||||
speed_cap = Ship_info[Ships[i].ship_info_index].max_vel.xyz.z;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// damp speed_cap to 90% of actual -- to make sure ships stay in formation
|
||||
speed_cap = 0.90f * speed_cap;
|
||||
ramp_bias = speed_cap/50.0f;
|
||||
|
||||
// assign ship goals
|
||||
// when assigning goals to individual ships only do so if Ships[shipnum].wingnum != -1
|
||||
// we will assign wing goals below
|
||||
|
||||
|
||||
for (i = 0; i < MAX_SHIPS; i++)
|
||||
{
|
||||
if (Ships[i].objnum != -1 &&
|
||||
(Ships[i].flags2 & SF2_NAVPOINT_CARRY ||
|
||||
(Ships[i].wingnum != -1 && Wings[Ships[i].wingnum].flags & WF_NAV_CARRY)
|
||||
)
|
||||
)
|
||||
{
|
||||
|
||||
// clear the ship goals and cap the waypoint speed
|
||||
ai_clear_ship_goals(&Ai_info[Ships[i].ai_index]);
|
||||
Ai_info[Ships[i].ai_index].waypoint_speed_cap = (int)speed_cap;
|
||||
|
||||
|
||||
// if they're not part of a wing set their goal
|
||||
if (Ships[i].wingnum == -1)
|
||||
{
|
||||
if (Navs[CurrentNav].flags & NP_WAYPOINT)
|
||||
{
|
||||
|
||||
ai_add_ship_goal_player( AIG_TYPE_PLAYER_WING, AI_GOAL_WAYPOINTS_ONCE, -1, ((waypoint_list*)Navs[CurrentNav].target_obj)->name, &Ai_info[Ships[i].ai_index] );
|
||||
|
||||
//fixup has to wait until after wing goals
|
||||
}
|
||||
else
|
||||
{
|
||||
ai_add_ship_goal_player( AIG_TYPE_PLAYER_WING, AI_GOAL_FLY_TO_SHIP, -1, ((ship*)Navs[CurrentNav].target_obj)->ship_name, &Ai_info[Ships[i].ai_index] );
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// assign wing goals
|
||||
for (i = 0; i < MAX_WINGS; i++)
|
||||
{
|
||||
if (Wings[i].flags & WF_NAV_CARRY )
|
||||
{
|
||||
//ai_add_ship_goal_player( int type, int mode, int submode, char *shipname, ai_info *aip );
|
||||
|
||||
//ai_add_wing_goal_player( AIG_TYPE_PLAYER_WING, AI_GOAL_STAY_NEAR_SHIP, 0, target_shipname, wingnum );
|
||||
//ai_add_wing_goal_player( AIG_TYPE_PLAYER_WING, AI_GOAL_WAYPOINTS_ONCE, 0, target_shipname, wingnum );
|
||||
//ai_clear_ship_goals( &(Ai_info[Ships[num].ai_index]) );
|
||||
|
||||
ai_clear_wing_goals( i );
|
||||
if (Navs[CurrentNav].flags & NP_WAYPOINT)
|
||||
{
|
||||
|
||||
ai_add_wing_goal_player( AIG_TYPE_PLAYER_WING, AI_GOAL_WAYPOINTS_ONCE, AIF_FORMATION_WING, ((waypoint_list*)Navs[CurrentNav].target_obj)->name, i );
|
||||
|
||||
|
||||
// "fix up" the goal
|
||||
for (j = 0; j < MAX_AI_GOALS; j++)
|
||||
{
|
||||
if (Wings[i].ai_goals[j].ai_mode == AI_GOAL_WAYPOINTS_ONCE ||
|
||||
Wings[i].ai_goals[j].ai_mode == AIM_WAYPOINTS )
|
||||
{
|
||||
autopilot_ai_waypoint_goal_fixup(&(Wings[i].ai_goals[j]));
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
ai_add_wing_goal_player( AIG_TYPE_PLAYER_WING, AI_GOAL_FLY_TO_SHIP, AIF_FORMATION_WING, ((ship*)Navs[CurrentNav].target_obj)->ship_name, i );
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// fixup has to go down here because ships are assigned goals during wing goals as well
|
||||
for (i = 0; i < MAX_SHIPS; i++)
|
||||
{
|
||||
if (Ships[i].objnum != -1)
|
||||
{
|
||||
if (Ships[i].flags2 & SF2_NAVPOINT_CARRY ||
|
||||
(Ships[i].wingnum != -1 && Wings[Ships[i].wingnum].flags & WF_NAV_CARRY))
|
||||
for (j = 0; j < MAX_AI_GOALS; j++)
|
||||
{
|
||||
if (Ai_info[Ships[i].ai_index].goals[j].ai_mode == AI_GOAL_WAYPOINTS_ONCE ||
|
||||
Ai_info[Ships[i].ai_index].goals[j].ai_mode == AIM_WAYPOINTS)
|
||||
{
|
||||
autopilot_ai_waypoint_goal_fixup( &(Ai_info[Ships[i].ai_index].goals[j]) );
|
||||
|
||||
|
||||
// formation fixup
|
||||
//ai_form_on_wing(&Objects[Ships[i].objnum], &Objects[Player_ship->objnum]);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
start_dist = DistanceTo(CurrentNav);
|
||||
|
||||
}
|
||||
|
||||
// ********************************************************************************************
|
||||
// Checks if autopilot should automatically die
|
||||
// Returns true if:
|
||||
// * Targetted waypoint < 10,000 meters away
|
||||
// * Enemy < 10,000 meters
|
||||
bool Autopilot_AutoDiable()
|
||||
{
|
||||
return !CanAutopilot();
|
||||
}
|
||||
|
||||
// ********************************************************************************************
|
||||
// Disengages autopilot
|
||||
// this does:
|
||||
// * Time compression to 1x
|
||||
// * Delete AI nav goal
|
||||
// * Control switched from AI to player
|
||||
void EndAutoPilot()
|
||||
{
|
||||
AutoPilotEngaged = false;
|
||||
|
||||
set_time_compression(1);
|
||||
lock_time_compression(false);
|
||||
Player_use_ai = 0;
|
||||
//Clear AI Goals
|
||||
|
||||
// assign ship goals
|
||||
// when assigning goals to individual ships only do so if Ships[shipnum].wingnum != -1
|
||||
// we will assign wing goals below
|
||||
int i,j;
|
||||
|
||||
for (i = 0; i < MAX_SHIPS; i++)
|
||||
|
||||
{
|
||||
if (Ships[i].objnum != -1 &&
|
||||
(
|
||||
Ships[i].flags2 & SF2_NAVPOINT_CARRY ||
|
||||
(Ships[i].wingnum != -1 && Wings[Ships[i].wingnum].flags & WF_NAV_CARRY )
|
||||
)
|
||||
)
|
||||
{
|
||||
Ai_info[Ships[i].ai_index].waypoint_speed_cap = -1; // uncap their speed
|
||||
|
||||
// old "dumb" routine
|
||||
//ai_clear_ship_goals( &(Ai_info[Ships[i].ai_index]) );
|
||||
for (j = 0; j < MAX_AI_GOALS; j++)
|
||||
{
|
||||
if (Ai_info[Ships[i].ai_index].goals[j].ai_mode == AI_GOAL_WAYPOINTS_ONCE ||
|
||||
Ai_info[Ships[i].ai_index].goals[j].ai_mode == AI_GOAL_FLY_TO_SHIP ||
|
||||
Ai_info[Ships[i].ai_index].goals[j].ai_mode == AIM_WAYPOINTS ||
|
||||
Ai_info[Ships[i].ai_index].goals[j].ai_mode == AIM_FLY_TO_SHIP)
|
||||
{
|
||||
ai_remove_ship_goal( &(Ai_info[Ships[i].ai_index]), j );
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// assign wing goals
|
||||
for (i = 0; i < MAX_WINGS; i++)
|
||||
{
|
||||
if (Wings[i].flags & WF_NAV_CARRY )
|
||||
{
|
||||
// old "dumb" routine
|
||||
//ai_clear_wing_goals( i );
|
||||
for (j = 0; j < MAX_AI_GOALS; j++)
|
||||
{
|
||||
if (Wings[i].ai_goals[j].ai_mode == AI_GOAL_WAYPOINTS_ONCE ||
|
||||
Wings[i].ai_goals[j].ai_mode == AI_GOAL_FLY_TO_SHIP ||
|
||||
Wings[i].ai_goals[j].ai_mode == AIM_WAYPOINTS ||
|
||||
Wings[i].ai_goals[j].ai_mode == AIM_FLY_TO_SHIP)
|
||||
{
|
||||
Wings[i].ai_goals[j].ai_mode = AI_GOAL_NONE;
|
||||
Wings[i].ai_goals[j].signature = -1;
|
||||
Wings[i].ai_goals[j].priority = -1;
|
||||
Wings[i].ai_goals[j].flags = 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// ********************************************************************************************
|
||||
// Checks for changes every NPS_TICKRATE milliseconds
|
||||
// Checks:
|
||||
// * if we've gotten close enough to a nav point for it to be counted as "Visited"
|
||||
// * If we're current AutoNavigating it checks if we need to autodisengage
|
||||
void NavSystem_Do()
|
||||
{
|
||||
static unsigned int last_update = 0;
|
||||
|
||||
if (clock () - last_update > NPS_TICKRATE)
|
||||
{
|
||||
if (AutoPilotEngaged)
|
||||
if (Autopilot_AutoDiable())
|
||||
EndAutoPilot();
|
||||
|
||||
// check if a NavPoints target has left, delete it if so
|
||||
int i;
|
||||
|
||||
for (i = 0; i < MAX_NAVPOINTS; i++)
|
||||
{
|
||||
if ((Navs[i].flags & NP_SHIP) && (Navs[i].target_obj != NULL))
|
||||
{
|
||||
if (((ship*)Navs[i].target_obj)->objnum == -1)
|
||||
DelNavPoint(i);
|
||||
}
|
||||
}
|
||||
|
||||
// check if we're reached a Node
|
||||
for (i = 0; i < MAX_NAVPOINTS; i++)
|
||||
{
|
||||
if (Navs[i].target_obj != NULL)
|
||||
{
|
||||
if (Navs[i].flags & NP_VALIDTYPE && DistanceTo(i) < 1000)
|
||||
Navs[i].flags |= NP_VISITED;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// ramp time compression
|
||||
if (AutoPilotEngaged)
|
||||
{
|
||||
int dstfrm_start = start_dist - DistanceTo(CurrentNav);
|
||||
|
||||
// Ramp UP time compression
|
||||
if (dstfrm_start < (3500*ramp_bias))
|
||||
{
|
||||
|
||||
if (dstfrm_start >= (3000*ramp_bias) && DistanceTo(CurrentNav) > 30000)
|
||||
set_time_compression(64);
|
||||
else if (dstfrm_start >= (2000*ramp_bias))
|
||||
set_time_compression(32);
|
||||
else if (dstfrm_start >= (1600*ramp_bias))
|
||||
set_time_compression(16);
|
||||
else if (dstfrm_start >= (1200*ramp_bias))
|
||||
set_time_compression(8);
|
||||
else if (dstfrm_start >= (800*ramp_bias))
|
||||
set_time_compression(4);
|
||||
else if (dstfrm_start >= (400*ramp_bias))
|
||||
set_time_compression(2);
|
||||
}
|
||||
|
||||
// Ramp DOWN time compression
|
||||
if (DistanceTo(CurrentNav) <= (7000*ramp_bias))
|
||||
{
|
||||
int dist = DistanceTo(CurrentNav);
|
||||
if (dist >= (5000*ramp_bias))
|
||||
set_time_compression(32);
|
||||
else if (dist >= (4000*ramp_bias))
|
||||
set_time_compression(16);
|
||||
else if (dist >= (3000*ramp_bias))
|
||||
set_time_compression(8);
|
||||
else if (dist >= (2000*ramp_bias))
|
||||
set_time_compression(4);
|
||||
else if (dist >= (1000*ramp_bias))
|
||||
set_time_compression(2);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// ********************************************************************************************
|
||||
// Inits the Nav System
|
||||
void NavSystem_Init()
|
||||
{
|
||||
memset((char *)&Navs, 0, sizeof(Navs));
|
||||
AutoPilotEngaged = false;
|
||||
CurrentNav = -1;
|
||||
}
|
||||
|
||||
// ********************************************************************************************
|
||||
// Finds a Nav point by name
|
||||
int FindNav(char *Nav)
|
||||
{
|
||||
for (int i = 0; i < MAX_NAVPOINTS; i++)
|
||||
{
|
||||
if (!stricmp(Navs[i].NavName, Nav))
|
||||
return i;
|
||||
}
|
||||
|
||||
return -1;
|
||||
}
|
||||
|
||||
// ********************************************************************************************
|
||||
// Set A Nav point to "ZERO"
|
||||
void ZeroNav(int i)
|
||||
{
|
||||
memset((char *)&Navs[i], 0, sizeof(NavPoint));
|
||||
}
|
||||
|
||||
// ********************************************************************************************
|
||||
// Removes a Nav
|
||||
bool DelNavPoint(char *Nav)
|
||||
{
|
||||
int n = FindNav(Nav);
|
||||
|
||||
return DelNavPoint(n);
|
||||
|
||||
}
|
||||
|
||||
|
||||
bool DelNavPoint(int nav)
|
||||
{
|
||||
if (nav != -1)
|
||||
{
|
||||
if (nav != MAX_NAVPOINTS-1)
|
||||
{
|
||||
for (int i = nav; i < MAX_NAVPOINTS-1; i++)
|
||||
{
|
||||
Navs[nav] = Navs[nav+1];
|
||||
}
|
||||
|
||||
}
|
||||
ZeroNav(MAX_NAVPOINTS-1);
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
// ********************************************************************************************
|
||||
// adds a Nav
|
||||
bool AddNav_Ship(char *Nav, char *TargetName, int flags)
|
||||
{
|
||||
// find an empty nav - should be the end
|
||||
|
||||
int empty = -1;
|
||||
int i;
|
||||
|
||||
for (i = 0; i < MAX_NAVPOINTS && empty == -1; i++)
|
||||
{
|
||||
if (Navs[i].flags == 0)
|
||||
empty = i;
|
||||
}
|
||||
|
||||
if (empty == -1) // no empty navpoint slots
|
||||
return false;
|
||||
|
||||
// Create the NavPoint struct
|
||||
NavPoint tnav;
|
||||
|
||||
strncpy(tnav.NavName, Nav, 32);
|
||||
tnav.flags = NP_SHIP | flags;
|
||||
|
||||
Assert(!(tnav.flags & NP_WAYPOINT));
|
||||
|
||||
|
||||
for (i = 0; i < MAX_SHIPS; i++)
|
||||
{
|
||||
if (Ships[i].objnum != -1 && !stricmp(TargetName, Ships[i].ship_name))
|
||||
{
|
||||
tnav.target_obj = (void *)&Ships[i];
|
||||
}
|
||||
}
|
||||
|
||||
tnav.waypoint_num = 0; // unused for NP_SHIP
|
||||
|
||||
|
||||
// copy it into it's location
|
||||
Navs[empty] = tnav;
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
bool AddNav_Waypoint(char *Nav, char *WP_Path, int node, int flags)
|
||||
{
|
||||
// find an empty nav - should be the end
|
||||
|
||||
int empty = -1;
|
||||
int i;
|
||||
|
||||
if (node == 0)
|
||||
node = 1;
|
||||
|
||||
for (i = 0; i < MAX_NAVPOINTS && empty == -1; i++)
|
||||
{
|
||||
if (Navs[i].flags == 0)
|
||||
empty = i;
|
||||
}
|
||||
|
||||
if (empty == -1) // no empty navpoint slots
|
||||
return false;
|
||||
|
||||
// Create the NavPoint struct
|
||||
NavPoint tnav;
|
||||
|
||||
strncpy(tnav.NavName, Nav, 32);
|
||||
tnav.flags = NP_WAYPOINT | flags;
|
||||
|
||||
Assert(!(tnav.flags & NP_SHIP));
|
||||
|
||||
|
||||
for (i = 0; i < Num_waypoint_lists; i++)
|
||||
{
|
||||
if (!stricmp(WP_Path, Waypoint_lists[i].name))
|
||||
{
|
||||
tnav.target_obj = (void *)&Waypoint_lists[i];
|
||||
}
|
||||
}
|
||||
|
||||
tnav.waypoint_num = node;
|
||||
|
||||
// copy it into it's location
|
||||
Navs[empty] = tnav;
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
// ********************************************************************************************
|
||||
//Change Flags
|
||||
bool Nav_Alt_Flags(char *Nav, int flags)
|
||||
{
|
||||
flags &= ~NP_VALIDTYPE; //clear the NP_SHIP and NP_WAYPOINT bits, make sure they haven't been set
|
||||
|
||||
int nav = FindNav(Nav);
|
||||
|
||||
if (nav != -1)
|
||||
{
|
||||
Navs[nav].flags &= NP_VALIDTYPE; // Clear all bits BUT NP_SHIP or NO_WAYPOINT
|
||||
Navs[nav].flags |= flags; // merge
|
||||
}
|
||||
|
||||
return (nav != -1);
|
||||
}
|
||||
|
||||
//Get Flags
|
||||
int Nav_Get_Flags(char *Nav)
|
||||
{
|
||||
int flags = 0;
|
||||
|
||||
int nav = FindNav(Nav);
|
||||
|
||||
if (nav != -1)
|
||||
flags = Navs[nav].flags;
|
||||
|
||||
return flags;
|
||||
}
|
||||
|
||||
// ********************************************************************************************
|
||||
// Sexp Accessors
|
||||
|
||||
//Generic
|
||||
bool Nav_Set_Flag(char *Nav, int flag)
|
||||
{
|
||||
Assert(!(flag & NP_VALIDTYPE));
|
||||
int nav = FindNav(Nav);
|
||||
|
||||
if (nav != -1)
|
||||
{
|
||||
Navs[nav].flags |= flag;
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
//+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|
||||
|
||||
bool Nav_UnSet_Flag(char *Nav, int flag)
|
||||
{
|
||||
Assert(!(flag & NP_VALIDTYPE));
|
||||
|
||||
int nav = FindNav(Nav);
|
||||
|
||||
if (nav != -1)
|
||||
{
|
||||
Navs[nav].flags &= ~flag;
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
//+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|
||||
//Named
|
||||
bool Nav_Set_Hidden(char *Nav)
|
||||
{
|
||||
return Nav_Set_Flag(Nav, NP_HIDDEN);
|
||||
|
||||
}
|
||||
|
||||
//+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|
||||
|
||||
bool Nav_Set_NoAccess(char *Nav)
|
||||
{
|
||||
return Nav_Set_Flag(Nav, NP_NOACCESS);
|
||||
}
|
||||
|
||||
//+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|
||||
|
||||
bool Nav_Set_Visited(char *Nav)
|
||||
{
|
||||
|
||||
return Nav_Set_Flag(Nav, NP_VISITED);
|
||||
}
|
||||
|
||||
//+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|
||||
|
||||
bool Nav_UnSet_Hidden(char *Nav)
|
||||
{
|
||||
return Nav_UnSet_Flag(Nav, NP_HIDDEN);
|
||||
}
|
||||
|
||||
//+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|
||||
|
||||
bool Nav_UnSet_NoAccess(char *Nav)
|
||||
{
|
||||
return Nav_UnSet_Flag(Nav, NP_NOACCESS);
|
||||
}
|
||||
|
||||
//+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|
||||
|
||||
bool Nav_UnSet_Visited(char *Nav)
|
||||
{
|
||||
return Nav_UnSet_Flag(Nav, NP_VISITED);
|
||||
}
|
||||
|
||||
|
||||
|
||||
//+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|
||||
|
||||
|
||||
unsigned int DistanceTo(char *nav)
|
||||
{
|
||||
int n = FindNav(nav);
|
||||
|
||||
return DistanceTo(n);
|
||||
}
|
||||
|
||||
unsigned int DistanceTo(int nav)
|
||||
{
|
||||
if (nav > MAX_NAVPOINTS && nav < 0)
|
||||
return 0xFFFFFFFF;
|
||||
|
||||
char *name = Navs[nav].GetInteralName();
|
||||
|
||||
if (name == NULL)
|
||||
return 0xFFFFFFFF;
|
||||
|
||||
int distance = sexp_distance2(Player_ship->objnum, name);
|
||||
delete[] name;
|
||||
|
||||
if (distance == SEXP_NAN)
|
||||
return 0xFFFFFFFF;
|
||||
return distance;
|
||||
}
|
||||
|
||||
//+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|
||||
|
||||
bool IsVisited(char *nav)
|
||||
{
|
||||
int n = FindNav(nav);
|
||||
|
||||
return IsVisited(n);
|
||||
}
|
||||
|
||||
bool IsVisited(int nav)
|
||||
{
|
||||
if (nav > MAX_NAVPOINTS && nav < 0)
|
||||
return 0;
|
||||
|
||||
if (Navs[nav].flags & NP_VISITED)
|
||||
return 1;
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -0,0 +1,152 @@
|
||||
// Autopilot.h
|
||||
// Derek Meek
|
||||
// 4-30-2004
|
||||
|
||||
/*
|
||||
* $Logfile: /Freespace2/code/Autopilot/Autopilot.h $
|
||||
* $Revision: 1.8 $
|
||||
* $Date: 2005-07-13 02:50:49 $
|
||||
* $Author: Goober5000 $
|
||||
*
|
||||
* $Log: not supported by cvs2svn $
|
||||
* Revision 1.7 2005/04/05 05:53:14 taylor
|
||||
* s/vector/vec3d/g, better support for different compilers (Jens Granseuer)
|
||||
*
|
||||
* Revision 1.6 2004/08/11 05:06:18 Kazan
|
||||
* added preprocdefines.h to prevent what happened with fred -- make sure to make all fred2 headers include this file as the _first_ include -- i have already modified fs2 files to do this
|
||||
*
|
||||
* Revision 1.5 2004/07/27 18:52:10 Kazan
|
||||
* squished another
|
||||
*
|
||||
* Revision 1.4 2004/07/25 19:27:51 Kazan
|
||||
* only disable afterburning during AIM_WAYPOINTS and AIM_FLY_TO_SHIP while AutoPilotEngaged
|
||||
*
|
||||
* Revision 1.3 2004/07/25 00:31:27 Kazan
|
||||
* i have absolutely nothing to say about that subject
|
||||
*
|
||||
* Revision 1.2 2004/07/01 16:38:18 Kazan
|
||||
* working on autonav
|
||||
*
|
||||
* Revision 1.1 2004/05/07 23:50:14 Kazan
|
||||
* Sorry Guys!
|
||||
*
|
||||
*
|
||||
*
|
||||
*
|
||||
*/
|
||||
|
||||
#if !defined(_AUTOPILOT_H_)
|
||||
#define _AUTOPILOT_H_
|
||||
|
||||
#include "globalincs/pstypes.h"
|
||||
|
||||
// milliseconds between updates
|
||||
#define NPS_TICKRATE 250
|
||||
|
||||
#define MAX_NAVPOINTS 8
|
||||
|
||||
#define NP_WAYPOINT 0x0001 // Nav Point is bound to the poistion of a single node of a waypoint path
|
||||
#define NP_SHIP 0x0002 // Nav Point is bound to the poisiton of a certain ship
|
||||
#define NP_HIDDEN 0x0004 // Nav Point doesn't show on map and isn't selectable
|
||||
#define NP_NOACCESS 0x0008 // Nav Point isn't selectable
|
||||
#define NP_VISITED 0x0100 // Whether we've been within 1,000 meters of this waypoint
|
||||
|
||||
#define NP_NOSELECT ( NP_HIDDEN | NP_NOACCESS )
|
||||
#define NP_VALIDTYPE ( NP_WAYPOINT | NP_SHIP )
|
||||
|
||||
struct NavPoint
|
||||
{
|
||||
char NavName[32];
|
||||
int flags;
|
||||
|
||||
void *target_obj;
|
||||
int waypoint_num; //only used when flags & NP_WAYPOINT
|
||||
|
||||
vec3d GetPosition();
|
||||
char* GetInteralName();
|
||||
};
|
||||
|
||||
extern bool AutoPilotEngaged;
|
||||
extern int CurrentNav;
|
||||
extern NavPoint Navs[MAX_NAVPOINTS];
|
||||
|
||||
// Cycles through the NavPoint List
|
||||
bool Sel_NextNav();
|
||||
|
||||
|
||||
// Tell us is autopilot is allow
|
||||
// This needs:
|
||||
// * Nav point selected
|
||||
// * No enemies within 5,000 meters
|
||||
// * Destination > 1,000 meters away
|
||||
bool CanAutopilot();
|
||||
|
||||
// Engages autopilot
|
||||
// This does:
|
||||
// * Control switched from player to AI
|
||||
// * Time compression to 32x
|
||||
// * Tell AI to fly to targetted Nav Point (for all nav-status wings/ships)
|
||||
// * Sets max waypoint speed to the best-speed of the slowest ship tagged
|
||||
void StartAutopilot();
|
||||
|
||||
// Checks if autopilot should automatically die
|
||||
// Returns true if:
|
||||
// * Targetted waypoint < 1,000 meters away
|
||||
// * Enemy < 5,000 meters
|
||||
bool Autopilot_AutoDiable();
|
||||
|
||||
// Disengages autopilot
|
||||
// this does:
|
||||
// * Time compression to 1x
|
||||
// * Delete AI nav goal
|
||||
// * Control switched from AI to player
|
||||
void EndAutoPilot();
|
||||
|
||||
|
||||
// Checks for changes every NPS_TICKRATE milliseconds
|
||||
// Checks:
|
||||
// * if we've gotten close enough to a nav point for it to be counted as "Visited"
|
||||
// * If we're current AutoNavigating it checks if we need to autodisengage
|
||||
void NavSystem_Do();
|
||||
|
||||
|
||||
// Inits the Nav System
|
||||
void NavSystem_Init();
|
||||
|
||||
// Finds a Nav point by name
|
||||
int FindNav(char *Nav);
|
||||
|
||||
// Set A Nav point to "ZERO"
|
||||
void ZeroNav(int i);
|
||||
|
||||
// Removes a Nav
|
||||
bool DelNavPoint(char *Nav);
|
||||
bool DelNavPoint(int nav);
|
||||
|
||||
// adds a Nav
|
||||
bool AddNav_Ship(char *Nav, char *TargetName, int flags);
|
||||
bool AddNav_Waypoint(char *Nav, char *WP_Path, int node, int flags);
|
||||
|
||||
//Change Flags
|
||||
bool Nav_Alt_Flags(char *Nav, int flags);
|
||||
|
||||
// Sexp Accessors
|
||||
bool Nav_Set_Flag(char *Nav, int flag);
|
||||
bool Nav_UnSet_Flag(char *Nav, int flag);
|
||||
|
||||
bool Nav_Set_Hidden(char *Nav);
|
||||
bool Nav_Set_NoAccess(char *Nav);
|
||||
bool Nav_Set_Visited(char *Nav);
|
||||
|
||||
bool Nav_UnSet_Hidden(char *Nav);
|
||||
bool Nav_UnSet_NoAccess(char *Nav);
|
||||
bool Nav_UnSet_Visited(char *Nav);
|
||||
|
||||
// Useful functions
|
||||
unsigned int DistanceTo(char *nav);
|
||||
unsigned int DistanceTo(int nav);
|
||||
|
||||
bool IsVisited(char *nav);
|
||||
bool IsVisited(int nav);
|
||||
#endif
|
||||
|
||||
@@ -0,0 +1,140 @@
|
||||
/*
|
||||
* Copyright (C) Volition, Inc. 1999. All rights reserved.
|
||||
*
|
||||
* All source code herein is the property of Volition, Inc. You may not sell
|
||||
* or otherwise commercially exploit the source or things you created based on the
|
||||
* source.
|
||||
*
|
||||
*/
|
||||
|
||||
/*
|
||||
* $Logfile: /Freespace2/code/bmpman/bm_internal.h $
|
||||
* $Revision: 2.3 $
|
||||
* $Date: 2005-04-21 15:49:20 $
|
||||
* $Author: taylor $
|
||||
*
|
||||
* bmpman info that's internal to bmpman related files only
|
||||
*
|
||||
* $Log: not supported by cvs2svn $
|
||||
* Revision 2.2 2005/03/03 14:29:37 bobboau
|
||||
* fixed a small error from my earlier commit.
|
||||
*
|
||||
* Revision 2.1 2004/11/23 00:10:06 taylor
|
||||
* try and protect the bitmap_entry stuff a bit better
|
||||
* fix the transparent support ship, again, but correctly this time
|
||||
*
|
||||
*
|
||||
* $NoKeywords: $
|
||||
*/
|
||||
|
||||
|
||||
#ifndef __BM_INTERNAL_H__
|
||||
#define __BM_INTERNAL_H__
|
||||
|
||||
|
||||
// extra check to make sure this stuff doesn't end up in normal files
|
||||
// don't use any of this unless BMPMAN_INTERNAL is defined
|
||||
#ifdef BMPMAN_INTERNAL
|
||||
|
||||
#include "globalincs/pstypes.h"
|
||||
#include "bmpman/bmpman.h"
|
||||
|
||||
|
||||
// keep this defined to use per-ship nondarkening pixels
|
||||
#define BMPMAN_SPECIAL_NONDARK
|
||||
|
||||
|
||||
#define BM_TYPE_NONE 0
|
||||
#define BM_TYPE_PCX 1
|
||||
#define BM_TYPE_USER 2
|
||||
#define BM_TYPE_ANI 3 // in-house ANI format
|
||||
#define BM_TYPE_EFF 4 // specifies any type of animated image, the EFF itself is just text
|
||||
|
||||
#define BM_TYPE_32_BIT_FORMATS 5 // everything after this could/should be 24/32-bit
|
||||
#define BM_TYPE_TGA 6 // 16 or 32 bit targa
|
||||
#define BM_TYPE_DDS 7 // generic identifier for DDS
|
||||
#define BM_TYPE_DXT1 8 // 24 bit with switchable alpha (compressed)
|
||||
#define BM_TYPE_DXT3 9 // 32 bit with 4 bit alpha (compressed)
|
||||
#define BM_TYPE_DXT5 10 // 32 bit with 8 bit alpha (compressed)
|
||||
#define BM_TYPE_JPG 11 // 32 bit jpeg
|
||||
#define BM_TYPE_RENDER_TARGET 12 // 32 bit setup internaly as a render target
|
||||
|
||||
|
||||
/// Moved from cpp file ///////////////////
|
||||
// Consider these 'protected' structures and functions that should only be used by special bitmap functions
|
||||
typedef struct bm_extra_info {
|
||||
struct {
|
||||
// Stuff needed for animations
|
||||
int first_frame; // used for animations -- points to index of first frame
|
||||
ubyte num_frames; // used for animation -- number of frames in the animation
|
||||
ubyte fps; // used for animation -- frames per second
|
||||
} ani;
|
||||
struct {
|
||||
// Stuff needed for user bitmaps
|
||||
void *data; // For user bitmaps, this is where the data comes from
|
||||
ubyte bpp; // For user bitmaps, this is what format the data is
|
||||
ubyte flags; // Flags passed to bm_create
|
||||
} user;
|
||||
struct {
|
||||
// Stuff for static animations
|
||||
ubyte type; // type for individual images
|
||||
char filename[MAX_FILENAME_LEN]; // filename for individual images
|
||||
} eff;
|
||||
} bm_extra_info;
|
||||
|
||||
|
||||
typedef struct bitmap_entry {
|
||||
// identification
|
||||
char filename[MAX_FILENAME_LEN]; // filename for this bitmap
|
||||
|
||||
uint signature; // a unique signature identifying the data
|
||||
uint palette_checksum; // checksum used to be sure bitmap is in current palette
|
||||
int handle; // Handle = id*MAX_BITMAPS + bitmapnum
|
||||
int last_used; // When this bitmap was last used
|
||||
|
||||
ubyte type; // PCX, USER, ANI, etc
|
||||
signed char ref_count; // Number of locks on bitmap. Can't unload unless ref_count is 0.
|
||||
|
||||
int dir_type; // which directory this was loaded from (to skip other locations with same name)
|
||||
|
||||
// compressed bitmap stuff (.dds) - RT please take a look at this and tell me if we really need it
|
||||
int mem_taken; // How much memory does this bitmap use? - UnknownPlayer
|
||||
int num_mipmaps; // number of mipmap levels, we need to read all of them
|
||||
|
||||
// Stuff to keep track of usage
|
||||
ubyte preloaded; // If set, then this was loaded from the lst file
|
||||
int preload_count; // how many times this gets used in game, for unlocking
|
||||
ubyte used_flags; // What flags it was accessed thru
|
||||
int load_count;
|
||||
|
||||
// Bitmap info
|
||||
bitmap bm;
|
||||
|
||||
// Data for animations and user bitmaps
|
||||
bm_extra_info info;
|
||||
|
||||
#ifdef BMPMAN_NDEBUG
|
||||
// bookeeping
|
||||
ubyte used_last_frame; // If set, then it was used last frame
|
||||
ubyte used_this_frame; // If set, then it was used this frame
|
||||
int data_size; // How much data this bitmap uses
|
||||
int used_count; // How many times it was accessed
|
||||
#endif
|
||||
} bitmap_entry;
|
||||
|
||||
extern bitmap_entry bm_bitmaps[MAX_BITMAPS];
|
||||
|
||||
|
||||
// image specific lock functions
|
||||
void bm_lock_ani( int handle, int bitmapnum, bitmap_entry *be, bitmap *bmp, ubyte bpp, ubyte flags );
|
||||
void bm_lock_dds( int handle, int bitmapnum, bitmap_entry *be, bitmap *bmp, ubyte bpp, ubyte flags );
|
||||
void bm_lock_jpg( int handle, int bitmapnum, bitmap_entry *be, bitmap *bmp, ubyte bpp, ubyte flags );
|
||||
void bm_lock_pcx( int handle, int bitmapnum, bitmap_entry *be, bitmap *bmp, ubyte bpp, ubyte flags );
|
||||
void bm_lock_tga( int handle, int bitmapnum, bitmap_entry *be, bitmap *bmp, ubyte bpp, ubyte flags );
|
||||
void bm_lock_user( int handle, int bitmapnum, bitmap_entry *be, bitmap *bmp, ubyte bpp, ubyte flags );
|
||||
|
||||
|
||||
#endif // BMPMAN_INTERNAL
|
||||
|
||||
#endif // __BM_INTERNAL_H__
|
||||
|
||||
+1510
-634
File diff suppressed because it is too large.
Load diff
+263
-22
@@ -9,13 +9,205 @@
|
||||
|
||||
/*
|
||||
* $Logfile: /Freespace2/code/Bmpman/BmpMan.h $
|
||||
* $Revision: 2.0 $
|
||||
* $Date: 2002-06-03 04:02:21 $
|
||||
* $Author: penguin $
|
||||
*
|
||||
* $Revision: 2.25 $
|
||||
* $Date: 2005-08-20 20:34:49 $
|
||||
* $Author: taylor $
|
||||
*
|
||||
* Prototypes for Bitmap Manager functions
|
||||
*
|
||||
* $Log: not supported by cvs2svn $
|
||||
* Revision 2.24 2005/07/13 02:50:49 Goober5000
|
||||
* remove PreProcDefine #includes in FS2
|
||||
* --Goober5000
|
||||
*
|
||||
* Revision 2.23 2005/06/19 02:28:55 taylor
|
||||
* add a _fast version of bm_unload() to be used in modelinterp and future graphics API code
|
||||
* clean up some modelinterp code to not use memcpy() everywhere so it's more platform compatible and matches old code (Jens Granseuer)
|
||||
* NaN check to catch shards-of-death and prevent hitting an Assert() (Jens Granseuer)
|
||||
* fix jumpnode code to catch model errors and close a memory leak
|
||||
* make the call to bm_unload_all() after model_free_all() since we will get bmpman screwups otherwise
|
||||
* don't show hardware sound RAM when using OpenAL build, it will always be 0
|
||||
* print top-right memory figures in debug builds slighly further over when 1024+ res
|
||||
*
|
||||
* Revision 2.22 2005/04/24 12:56:42 taylor
|
||||
* really are too many changes here:
|
||||
* - remove all bitmap section support and fix problems with previous attempt
|
||||
* ( code/bmpman/bmpman.cpp, code/bmpman/bmpman.h, code/globalincs/pstypes.h,
|
||||
* code/graphics/2d.cpp, code/graphics/2d.h code/graphics/grd3dbmpman.cpp,
|
||||
* code/graphics/grd3dinternal.h, code/graphics/grd3drender.cpp, code/graphics/grd3dtexture.cpp,
|
||||
* code/graphics/grinternal.h, code/graphics/gropengl.cpp, code/graphics/gropengl.h,
|
||||
* code/graphics/gropengllight.cpp, code/graphics/gropengltexture.cpp, code/graphics/gropengltexture.h,
|
||||
* code/graphics/tmapper.h, code/network/multi_pinfo.cpp, code/radar/radarorb.cpp
|
||||
* code/render/3ddraw.cpp )
|
||||
* - use CLAMP() define in gropengl.h for gropengllight instead of single clamp() function
|
||||
* - remove some old/outdated code from gropengl.cpp and gropengltexture.cpp
|
||||
*
|
||||
* Revision 2.21 2005/04/21 15:49:20 taylor
|
||||
* update of bmpman and model bitmap management, well tested but things may get a bit bumpy
|
||||
* - use VM_* macros for bmpman since it didn't seem to register the memory correctly (temporary)
|
||||
* - a little "stupid" fix for dds bitmap reading
|
||||
* - fix it so that memory is released properly on bitmap read errors
|
||||
* - some cleanup to model texture loading
|
||||
* - allow model textures to get released rather than just unloaded, saves bitmap slots
|
||||
* - bump MAX_BITMAPS to 4750, should be able to decrease after public testing of new code
|
||||
*
|
||||
* Revision 2.20 2005/03/07 13:10:19 bobboau
|
||||
* commit of render target code, d3d should be totaly functional,
|
||||
* OGL still needs implementation.
|
||||
*
|
||||
* Revision 2.19 2005/02/10 14:38:50 taylor
|
||||
* fix an issue with bm_set_components()
|
||||
* abs is for ints fabsf is for floats (camera.cpp)
|
||||
* make the in-cockpit stuff OGL friendly
|
||||
*
|
||||
* Revision 2.18 2004/11/23 00:10:06 taylor
|
||||
* try and protect the bitmap_entry stuff a bit better
|
||||
* fix the transparent support ship, again, but correctly this time
|
||||
*
|
||||
* Revision 2.17 2004/11/21 15:59:45 Kazan
|
||||
* conflict res
|
||||
*
|
||||
* Revision 2.16 2004/10/31 21:26:27 taylor
|
||||
* bmpman merge, EFF animation support, better page in stuff, dozen or so smaller fixes and cleanup
|
||||
*
|
||||
* Revision 2.15 2004/10/06 22:02:54 Kazan
|
||||
* interface corruption fix - thanks taylor (MAX_BITMAPS upped to 7000)
|
||||
*
|
||||
* Revision 2.14 2004/08/11 05:06:18 Kazan
|
||||
* added preprocdefines.h to prevent what happened with fred -- make sure to make all fred2 headers include this file as the _first_ include -- i have already modified fs2 files to do this
|
||||
*
|
||||
* Revision 2.13 2004/05/06 22:35:26 taylor
|
||||
* DDS mipmap reading, remove unneeded bm_unlock() during page in
|
||||
*
|
||||
* Revision 2.12 2004/04/01 15:31:20 taylor
|
||||
* don't use interface anis as ship textures
|
||||
*
|
||||
* Revision 2.11 2004/03/05 09:01:54 Goober5000
|
||||
* Uber pass at reducing #includes
|
||||
* --Goober5000
|
||||
*
|
||||
* Revision 2.10 2003/12/04 20:39:08 randomtiger
|
||||
* Added DDS image support for D3D
|
||||
* Added new command flag '-ship_choice_3d' to activate 3D models instead of ani's in ship choice, feature now off by default
|
||||
* Hopefully have fixed D3D text batching bug that caused old values to appear
|
||||
* Added Hud_target_object_factor variable to control 3D object sizes of zoom in HUD target
|
||||
* Fixed jump nodes not showing
|
||||
*
|
||||
* Revision 2.9 2003/11/19 20:37:22 randomtiger
|
||||
* Almost fully working 32 bit pcx, use -pcx32 flag to activate.
|
||||
* Made some commandline variables fit the naming standard.
|
||||
* Changed timerbar system not to run pushes and pops if its not in use.
|
||||
* Put in a note about not uncommenting asserts.
|
||||
* Fixed up a lot of missing POP's on early returns?
|
||||
* Perhaps the motivation for Assert functionality getting commented out?
|
||||
* Fixed up some bad asserts.
|
||||
* Changed nebula poofs to render in 2D in htl, it makes it look how it used to in non htl. (neb.cpp,1248)
|
||||
* Before the poofs were creating a nasty stripe effect where they intersected with ships hulls.
|
||||
* Put in a special check for the signs of that D3D init bug I need to lock down.
|
||||
*
|
||||
* Revision 2.8 2003/11/07 18:31:01 randomtiger
|
||||
* Fixed a nohtl call to htl funcs (crash with NULL pointer)
|
||||
* Fixed a bug with 32bit PCX code.
|
||||
* Fixed a bug in the d3d_string batch system that was messing up screen shaking.
|
||||
* Added a couple of checks to try and stop timerbar push and pop overloads, check returns missing pops if you use the system.
|
||||
* Put in a higher res icon until we get something better sorted out.
|
||||
*
|
||||
* Revision 2.7 2003/10/24 17:35:04 randomtiger
|
||||
* Implemented support for 32bit TGA and JPG for D3D
|
||||
* Also 32 bit PCX, but it still has some bugs to be worked out
|
||||
* Moved convert_24_to_16 out of the bitmap pfunction structures and into packunpack.cpp because thats the only place that uses it.
|
||||
*
|
||||
* Revision 2.6 2003/08/16 03:52:22 bobboau
|
||||
* update for the specmapping code includeing
|
||||
* suport for seperate specular levels on lights and
|
||||
* optional strings for the stars table
|
||||
* code has been made more organised,
|
||||
* though there seems to be a bug in the state selecting code
|
||||
* resulting in the HUD being rendered incorectly
|
||||
* and specmapping failing ocasionaly
|
||||
*
|
||||
* Revision 2.5 2003/08/12 03:18:32 bobboau
|
||||
* Specular 'shine' mapping;
|
||||
* useing a phong lighting model I have made specular highlights
|
||||
* that are mapped to the model,
|
||||
* rendering them is still slow, but they look real purdy
|
||||
*
|
||||
* also 4 new (untested) comand lines, the XX is a floating point value
|
||||
* -spec_exp XX
|
||||
* the n value, you can set this from 0 to 200 (actualy more than that, but this is the recomended range), it will make the highlights bigger or smaller, defalt is 16.0 so start playing around there
|
||||
* -spec_point XX
|
||||
* -spec_static XX
|
||||
* -spec_tube XX
|
||||
* these are factors for the three diferent types of lights that FS uses, defalt is 1.0,
|
||||
* static is the local stars,
|
||||
* point is weapons/explosions/warp in/outs,
|
||||
* tube is beam weapons,
|
||||
* for thouse of you who think any of these lights are too bright you can configure them you're self for personal satisfaction
|
||||
*
|
||||
* Revision 2.4 2003/03/18 10:07:00 unknownplayer
|
||||
* The big DX/main line merge. This has been uploaded to the main CVS since I can't manage to get it to upload to the DX branch. Apologies to all who may be affected adversely, but I'll work to debug it as fast as I can.
|
||||
*
|
||||
* Revision 2.3 2003/01/19 01:07:41 bobboau
|
||||
* redid the way glowmaps are handeled, you now must set the global int GLOWMAP (no longer an array) before you render a poly that uses a glow map then set GLOWMAP to -1 when you're done with, fixed a few other misc bugs it
|
||||
*
|
||||
* Revision 2.2 2003/01/18 19:55:16 phreak
|
||||
* fixed around the bmpman system to now accept compressed textures
|
||||
*
|
||||
* Revision 2.1 2003/01/05 23:41:50 bobboau
|
||||
* disabled decals (for now), removed the warp ray thingys,
|
||||
* made some better error mesages while parseing weapons and ships tbls,
|
||||
* and... oh ya, added glow mapping
|
||||
*
|
||||
* Revision 2.0.2.10 2002/11/04 21:24:59 randomtiger
|
||||
*
|
||||
* When running in D3D all ani's are memory mapped for speed, this takes up more memory but stops gametime locking of textures which D3D8 hates.
|
||||
* Added new command line tag Cmdline_d3dlowmem for people who dont want to make use of this because they have no memory.
|
||||
* Cleaned up some more texture stuff enabled console debug for D3D.
|
||||
*
|
||||
* Revision 2.0.2.9 2002/11/04 16:04:20 randomtiger
|
||||
*
|
||||
* Tided up some bumpman stuff and added a few function points to gr_screen. - RT
|
||||
*
|
||||
* Revision 2.0.2.8 2002/11/04 03:02:28 randomtiger
|
||||
*
|
||||
* I have made some fairly drastic changes to the bumpman system. Now functionality can be engine dependant.
|
||||
* This is so D3D8 can call its own loading code that will allow good efficient loading and use of textures that it desparately needs without
|
||||
* turning bumpman.cpp into a total hook infested nightmare. Note the new bumpman code is still relying on a few of the of the old functions and all of the old bumpman arrays.
|
||||
*
|
||||
* I have done this by adding to the gr_screen list of function pointers that are set up by the engines init functions.
|
||||
* I have named the define calls the same name as the original 'bm_' functions so that I havent had to change names all through the code.
|
||||
*
|
||||
* Rolled back to an old version of bumpman and made a few changes.
|
||||
* Added new files: grd3dbumpman.cpp and .h
|
||||
* Moved the bitmap init function to after the 3D engine is initialised
|
||||
* Added includes where needed
|
||||
* Disabled (for now) the D3D8 TGA loading - RT
|
||||
*
|
||||
* Revision 2.0.2.7 2002/10/26 01:24:22 randomtiger
|
||||
* Fixed debug bitmap compiling bug.
|
||||
* Fixed tga bug. - RT
|
||||
*
|
||||
* Revision 2.0.2.6 2002/10/22 17:46:17 randomtiger
|
||||
* Fixed new TGA code texturing bug. - RT
|
||||
*
|
||||
* Revision 2.0.2.5 2002/10/21 16:33:40 randomtiger
|
||||
* Added D3D only 32 bit TGA functionality. Will load a texture as big as your graphics card allows. Code not finished yet and will forge the beginnings of the new texture system. - RT
|
||||
*
|
||||
* Revision 2.0.2.4 2002/10/19 23:56:39 randomtiger
|
||||
* Changed generic bitmap code to allow maximum dimensions to be determined by 3D's engines maximum texture size query.
|
||||
* Defaults to 256 as it was before. Also added base code for reworking the texture code to be more efficient. - RT
|
||||
*
|
||||
* Revision 2.0.2.3 2002/10/02 11:40:19 randomtiger
|
||||
* Bmpmap has been reverted to an old non d3d8 version.
|
||||
* All d3d8 code is now in the proper place.
|
||||
* PCX code is now working to an extent. Problems with alpha though.
|
||||
* Ani's work slowly with alpha problems.
|
||||
* Also I have done a bit of tidying - RT
|
||||
*
|
||||
* Revision 2.0 2002/06/03 04:02:21 penguin
|
||||
* Warpcore CVS sync
|
||||
*
|
||||
* Revision 1.1 2002/05/02 18:03:04 mharris
|
||||
* Initial checkin - converted filenames and includes to lower case
|
||||
*
|
||||
@@ -154,17 +346,54 @@
|
||||
#ifndef _BMPMAN_H
|
||||
#define _BMPMAN_H
|
||||
|
||||
#ifdef FS2_DEMO
|
||||
#define MAX_BITMAPS 3500
|
||||
#else
|
||||
#define MAX_BITMAPS 3500 // How many bitmaps the game can handle
|
||||
#include "globalincs/pstypes.h"
|
||||
#include "cfile/cfile.h"
|
||||
|
||||
#ifndef NDEBUG
|
||||
#define BMPMAN_NDEBUG
|
||||
#endif
|
||||
|
||||
|
||||
// this is causing problems - let's UP IT -- Kazan
|
||||
// bumped from 3500 to 4500 2004/09/21 - taylor
|
||||
// bumped to 4750 2005/02/03 - taylor
|
||||
//#define MAX_BITMAPS 3500 // How many bitmaps the game can handle
|
||||
#define MAX_BITMAPS 4750 // How many bitmaps the game can handle
|
||||
// NOTE: MAX_BITMAPS shouldn't need to be bumped again. With the fixed bm_release() and it's
|
||||
// proper use even the largest missions should stay under this number. With the largest retail
|
||||
// missions and wasteful content we should still have about 20% of the slots free. If it still
|
||||
// goes over then it's something the artists need to fix. For instance the Terran Mara fighter,
|
||||
// with -spec and -glow and using the Shinepack, needs 117 bitmap slots alone. 111 of those is
|
||||
// just for the glowmaps. This number can be greatly reduced if the number of ani frames for
|
||||
// another LOD than LOD0 has fewer or no ani frames. A 37 frame glow ani for LOD2 is little
|
||||
// more than a waste of resources. Future reports of texture corruption should be initially
|
||||
// approached with content as the cause and not code. If anything we could/should reduce
|
||||
// MAX_BITMAPS in the future. Where it's at now should accomidate even the largest mods.
|
||||
// -- Taylor
|
||||
|
||||
|
||||
// 16 bit pixel formats
|
||||
#define BM_PIXEL_FORMAT_ARGB 0 // for glide - can assume certain things, like 1555 LFB writes, whee!
|
||||
#define BM_PIXEL_FORMAT_D3D 1 // d3d - card dependant. booo!
|
||||
#define BM_PIXEL_FORMAT_ARGB_D3D 2 // this card has nice 1555 textures like Glide - ahhhhh!
|
||||
|
||||
|
||||
extern int bm_inited;
|
||||
|
||||
extern int Bm_paging;
|
||||
|
||||
void bm_init();
|
||||
|
||||
void bm_close();
|
||||
|
||||
int bm_get_cache_slot( int bitmap_id, int separate_ani_frames );
|
||||
|
||||
int bm_get_next_handle();
|
||||
|
||||
void *bm_malloc(int n, int size);
|
||||
|
||||
void bm_update_memory_used(int n, int size);
|
||||
|
||||
// 16 bit pixel formats
|
||||
extern int Bm_pixel_format;
|
||||
|
||||
@@ -197,7 +426,11 @@ int bm_create( int bpp, int w, int h, void * data, int flags = 0);
|
||||
// Frees up a bitmap's data, but bitmap number 'n' can
|
||||
// still be used, it will just have to be paged in next
|
||||
// time it is locked.
|
||||
int bm_unload( int n );
|
||||
int bm_unload( int n, bool = false );
|
||||
|
||||
// like bm_unload() except that it's safe to use to free data without worrying about
|
||||
// load_count so it's safe to use in relation to bm_release() and in gr_*_texture functions
|
||||
int bm_unload_fast( int n, bool = false );
|
||||
|
||||
// Frees up a bitmap's data, and it's slot, so bitmap
|
||||
// number 'n' cannot be used anymore, and bm_load or
|
||||
@@ -208,7 +441,7 @@ void bm_release(int n);
|
||||
// It returns a negative number if it couldn't load
|
||||
// the bitmap. On success, it returns the bitmap
|
||||
// number of the first frame and nframes is set.
|
||||
extern int bm_load_animation( char * filename, int * nframes, int *fps = NULL, int can_drop_frames = 0 );
|
||||
extern int bm_load_animation( char * filename, int * nframes, int *fps = NULL, int can_drop_frames = 0, int dir_type = CF_TYPE_ANY );
|
||||
|
||||
// This locks down a bitmap and returns a pointer to a bitmap
|
||||
// that can be accessed until you call bm_unlock. Only lock
|
||||
@@ -225,24 +458,24 @@ extern uint bm_get_signature( int bitmapnum);
|
||||
extern void bm_unlock( int bitmapnum );
|
||||
|
||||
// Gets info. w,h,or flags,nframes or fps can be NULL if you don't care.
|
||||
extern void bm_get_info( int bitmapnum, int *w=NULL, int * h=NULL, ubyte * flags=NULL, int *nframes=NULL, int *fps=NULL, bitmap_section_info **sections = NULL );
|
||||
extern void bm_get_info( int bitmapnum, int *w=NULL, int * h=NULL, ubyte * flags=NULL, int *nframes=NULL, int *fps=NULL );
|
||||
|
||||
// get filename
|
||||
extern void bm_get_filename(int bitmapnum, char *filename);
|
||||
extern void bm_get_filename(int bitmapnum, char *filename);
|
||||
|
||||
// resyncs all the bitmap palette
|
||||
extern void bm_update();
|
||||
|
||||
// call to load all data for all bitmaps that have been requested to be loaded
|
||||
extern void bm_load_all();
|
||||
extern void bm_gfx_load_all();
|
||||
extern void bm_unload_all();
|
||||
|
||||
// call to get the palette for a bitmap
|
||||
extern void bm_get_palette(int n, ubyte *pal, char *name);
|
||||
void bm_get_palette(int n, ubyte *pal, char *name);
|
||||
|
||||
// Hacked function to get a pixel from a bitmap.
|
||||
// Only works good in 8bpp mode.
|
||||
void bm_get_pixel( int bitmap, float u, float v, ubyte *r, ubyte *g, ubyte *b );
|
||||
void bm_gfx_get_pixel( int bitmap, float u, float v, ubyte *r, ubyte *g, ubyte *b );
|
||||
|
||||
// Returns number of bytes of bitmaps locked this frame
|
||||
// ntotal = number of bytes of bitmaps locked this frame
|
||||
@@ -317,6 +550,9 @@ void bm_page_in_xparent_texture( int bitmapnum, int num_frames=1 );
|
||||
// If num_frames is passed, assume this is an animation
|
||||
void bm_page_in_aabitmap( int bitmapnum, int num_frames=1 );
|
||||
|
||||
// unload a texture that was paged in
|
||||
int bm_page_out( int handle );
|
||||
|
||||
//
|
||||
// Mode: 0 = High memory
|
||||
// 1 = Low memory ( every other frame of ani's)
|
||||
@@ -329,11 +565,9 @@ void BM_SELECT_SCREEN_FORMAT();
|
||||
void BM_SELECT_TEX_FORMAT();
|
||||
void BM_SELECT_ALPHA_TEX_FORMAT();
|
||||
|
||||
// convert a 24 bit value to a 16 bit value
|
||||
void bm_24_to_16(int bit_24, ushort *bit_16);
|
||||
|
||||
// set the rgba components of a pixel, any of the parameters can be NULL
|
||||
extern void (*bm_set_components)(ubyte *pixel, ubyte *r, ubyte *g, ubyte *b, ubyte *a);
|
||||
extern void (*bm_set_components_32)(ubyte *pixel, ubyte *r, ubyte *g, ubyte *b, ubyte *a);
|
||||
void bm_set_components_argb(ubyte *pixel, ubyte *r, ubyte *g, ubyte *b, ubyte *a);
|
||||
void bm_set_components_d3d(ubyte *pixel, ubyte *r, ubyte *g, ubyte *b, ubyte *a);
|
||||
void bm_set_components_argb_d3d_16_screen(ubyte *pixel, ubyte *r, ubyte *g, ubyte *b, ubyte *a);
|
||||
@@ -344,11 +578,18 @@ void bm_set_components_argb_d3d_32_tex(ubyte *pixel, ubyte *r, ubyte *g, ubyte *
|
||||
// get the rgba components of a pixel, any of the parameters can be NULL
|
||||
void bm_get_components(ubyte *pixel, ubyte *r, ubyte *g, ubyte *b, ubyte *a);
|
||||
|
||||
//============================================================================
|
||||
// section info stuff
|
||||
//============================================================================
|
||||
extern int GLOWMAP; //this holds a reference to a map that is a fully lit version of it's index -Bobboau
|
||||
extern int SPECMAP; //this holds a reference to a map that is for specular mapping -Bobboau
|
||||
extern int ENVMAP; //this holds a reference to a map that is for environment mapping -Bobboau
|
||||
|
||||
// given a bitmap and a section, return the size (w, h)
|
||||
void bm_get_section_size(int bitmapnum, int sx, int sy, int *w, int *h);
|
||||
int bm_is_compressed(int num);
|
||||
int bm_get_tcache_type(int num);
|
||||
int bm_get_size(int num);
|
||||
int bm_get_num_mipmaps(int num);
|
||||
|
||||
void bm_print_bitmaps();
|
||||
|
||||
int bm_make_render_target( int &x_res, int &y_res, int flags );
|
||||
bool bm_is_render_target(int bitmap_id);
|
||||
bool bm_set_render_target(int handle, int face = -1);
|
||||
#endif
|
||||
@@ -0,0 +1,485 @@
|
||||
#include "camera/camera.h"
|
||||
#include "math/vecmat.h"
|
||||
#include "graphics/2d.h"
|
||||
#include "globalincs/alphacolors.h"
|
||||
#include "parse/parselo.h"
|
||||
|
||||
//Some global vars
|
||||
std::vector<subtitle> Subtitles;
|
||||
std::vector<camera> Cameras;
|
||||
//Preset cameras
|
||||
camera* Free_camera = NULL;
|
||||
|
||||
//This is where the camera class beings! :D
|
||||
camera::camera()
|
||||
{
|
||||
//These are our two pointers, new'd and delete'd only by this class
|
||||
desired_position = NULL;
|
||||
desired_orientation = NULL;
|
||||
|
||||
reset();
|
||||
}
|
||||
|
||||
camera::~camera()
|
||||
{
|
||||
//Cleanup
|
||||
if(desired_position != NULL)
|
||||
delete desired_position;
|
||||
|
||||
if(desired_orientation != NULL)
|
||||
delete desired_orientation;
|
||||
}
|
||||
|
||||
void camera::reset()
|
||||
{
|
||||
position = vmd_zero_vector;
|
||||
|
||||
if(desired_position != NULL)
|
||||
{
|
||||
delete desired_position;
|
||||
desired_position = NULL;
|
||||
}
|
||||
|
||||
translation_velocity = translation_vel_limit = translation_acc_limit = vmd_zero_vector;
|
||||
|
||||
vm_set_identity(&orientation);
|
||||
|
||||
if(desired_orientation != NULL)
|
||||
{
|
||||
delete desired_orientation;
|
||||
desired_orientation = NULL;
|
||||
}
|
||||
rotation_rate = rotation_vel_limit = rotation_acc_limit = vmd_zero_vector;
|
||||
}
|
||||
|
||||
void camera::set_position(vec3d *in_position, float in_translation_time, float in_translation_acceleration_time)
|
||||
{
|
||||
position = *in_position;
|
||||
}
|
||||
|
||||
void camera::set_translation_velocity(vec3d *in_velocity)
|
||||
{
|
||||
if(in_velocity == NULL)
|
||||
translation_velocity = *in_velocity;
|
||||
else
|
||||
vm_vec_zero(&translation_velocity);
|
||||
}
|
||||
|
||||
#define square(a) (a*a)
|
||||
void camera::set_rotation(matrix *in_orientation, float in_rotation_time, float in_rotation_acceleration_time)
|
||||
{
|
||||
if(in_rotation_time > 0.0f || in_rotation_acceleration_time > 0.0f)
|
||||
{
|
||||
//Safeties
|
||||
if(in_rotation_acceleration_time <= 0.0f)
|
||||
in_rotation_acceleration_time = 1.0f;
|
||||
if(in_rotation_time <= 0.0f)
|
||||
in_rotation_time = 3.0f;
|
||||
if(in_rotation_acceleration_time*2.0f > in_rotation_time)
|
||||
in_rotation_acceleration_time = in_rotation_time/2.0f;
|
||||
|
||||
//Get the angles in radians
|
||||
angles curr_orientation, new_orientation;
|
||||
vm_extract_angles_matrix(&curr_orientation, &orientation);
|
||||
vm_extract_angles_matrix(&new_orientation, in_orientation);
|
||||
|
||||
//Find the distance
|
||||
angles d;
|
||||
d.p = new_orientation.p - curr_orientation.p;
|
||||
d.b = new_orientation.b - curr_orientation.b;
|
||||
d.h = new_orientation.h - curr_orientation.h;
|
||||
/*d.p = curr_orientation.p - new_orientation.p;
|
||||
d.b = curr_orientation.b - new_orientation.b;
|
||||
d.h = curr_orientation.h - new_orientation.h;*/
|
||||
|
||||
/*ad_dist = -(V/At)square((At));
|
||||
|
||||
((Xf - Xo) - ad_dist)/V*/
|
||||
|
||||
/*v.p = (-(in_rotation_time - 2.0f*(in_rotation_acceleration_time)) + sqrt(square(in_rotation_time-2.0f*(in_rotation_acceleration_time))) + 4.0f*(curr_orientation.p - new_orientation.p))/2;
|
||||
v.b = (-(in_rotation_time - 2.0f*(in_rotation_acceleration_time)) + sqrt(square(in_rotation_time-2.0f*(in_rotation_acceleration_time))) + 4.0f*(curr_orientation.b - new_orientation.b))/2;
|
||||
v.h = (-(in_rotation_time - 2.0f*(in_rotation_acceleration_time)) + sqrt(square(in_rotation_time-2.0f*(in_rotation_acceleration_time))) + 4.0f*(curr_orientation.h - new_orientation.h))/2;*/
|
||||
/*v.p = (new_orientation.p - curr_orientation.p)/(in_rotation_time - in_rotation_acceleration_time);
|
||||
v.b = (new_orientation.p - curr_orientation.p)/(in_rotation_time - in_rotation_acceleration_time);
|
||||
v.h = (new_orientation.p - curr_orientation.p)/(in_rotation_time - in_rotation_acceleration_time);*/
|
||||
|
||||
/*
|
||||
angles *U = &rotation_rate;
|
||||
|
||||
float At = in_rotation_acceleration_time;
|
||||
float t = in_rotation_time; //- 2.0f*At*/
|
||||
/*v.p = ((d.p/At - U->p)/t);
|
||||
v.b = ((d.b/At - U->b)/t);
|
||||
v.h = ((d.h/At - U->h)/t);*/
|
||||
/*v.p = ((d.p - U->p*At)/t);
|
||||
v.b = ((d.b - U->b*At)/t);
|
||||
v.h = ((d.h - U->h*At)/t);*/
|
||||
|
||||
//Set the desired orientation
|
||||
if(desired_orientation == NULL)
|
||||
desired_orientation = new matrix;
|
||||
|
||||
if(in_orientation != NULL)
|
||||
*desired_orientation = *in_orientation;
|
||||
else
|
||||
vm_set_identity(desired_orientation);
|
||||
|
||||
//Calculate the maximum acceleration speed
|
||||
rotation_acc_limit.xyz.z = fabsf(d.p / ((in_rotation_time * in_rotation_acceleration_time) - square(in_rotation_acceleration_time)));
|
||||
rotation_acc_limit.xyz.x = fabsf(d.b / ((in_rotation_time * in_rotation_acceleration_time) - square(in_rotation_acceleration_time)));
|
||||
rotation_acc_limit.xyz.y = fabsf(d.h / ((in_rotation_time * in_rotation_acceleration_time) - square(in_rotation_acceleration_time)));
|
||||
|
||||
//Calculate the maximum velocity
|
||||
rotation_vel_limit.xyz.x = fabsf(rotation_acc_limit.xyz.x * in_rotation_acceleration_time);
|
||||
rotation_vel_limit.xyz.y = fabsf(rotation_acc_limit.xyz.y * in_rotation_acceleration_time);
|
||||
rotation_vel_limit.xyz.z = fabsf(rotation_acc_limit.xyz.z * in_rotation_acceleration_time);
|
||||
|
||||
//rotation_rate_delta_time = rotation_rate_delta_time_left = in_rotation_acceleration_time;
|
||||
//rotation_rate_decel_time_til = in_rotation_time - in_rotation_acceleration_time;
|
||||
|
||||
//set_rotation_rate(&v, in_rotation_acceleration_time);
|
||||
|
||||
//rotation_rate_decel_time_til = in_rotation_time - in_rotation_acceleration_time;
|
||||
}
|
||||
else
|
||||
{
|
||||
if(in_orientation != NULL)
|
||||
orientation = *in_orientation;
|
||||
else
|
||||
vm_set_identity(&orientation);
|
||||
|
||||
set_rotation_velocity(NULL);
|
||||
}
|
||||
}
|
||||
|
||||
void camera::set_rotation(angles *in_angles, float in_rotation_time, float in_rotation_acceleration_time)
|
||||
{
|
||||
matrix temp_matrix = IDENTITY_MATRIX;
|
||||
|
||||
if(in_angles != NULL)
|
||||
vm_angles_2_matrix(&temp_matrix, in_angles);
|
||||
|
||||
set_rotation(&temp_matrix, in_rotation_time, in_rotation_acceleration_time);
|
||||
}
|
||||
|
||||
void camera::set_rotation_facing(vec3d *in_target, float in_rotation_time, float in_rotation_acceleration_time)
|
||||
{
|
||||
matrix temp_matrix = IDENTITY_MATRIX;
|
||||
|
||||
if(in_target != NULL)
|
||||
{
|
||||
vec3d targetvec;
|
||||
vm_vec_normalized_dir(&targetvec, in_target, &position);
|
||||
vm_vector_2_matrix(&temp_matrix, &targetvec, NULL, NULL);
|
||||
}
|
||||
|
||||
set_rotation(&temp_matrix, in_rotation_time, in_rotation_acceleration_time);
|
||||
}
|
||||
|
||||
void camera::set_rotation_velocity(vec3d *in_rotation_rate)
|
||||
{
|
||||
if(in_rotation_rate != NULL)
|
||||
rotation_rate = *in_rotation_rate;
|
||||
else
|
||||
vm_vec_zero(&rotation_rate);
|
||||
|
||||
/*if(in_rotation_rate == NULL)
|
||||
{
|
||||
rotation_rate.p = rotation_rate.b = rotation_rate.h = 0.0f;
|
||||
|
||||
rotation_rate_delta_time = rotation_rate_delta_time_left = in_rotation_acceleration_time = 0.0f;
|
||||
rotation_rate_decel_time_til = -1.0f;
|
||||
return;
|
||||
}
|
||||
|
||||
rotation_rate_delta_time = rotation_rate_delta_time_left = in_rotation_acceleration_time;
|
||||
rotation_rate_decel_time_til = -1.0f;
|
||||
|
||||
rotation_rate_delta.p = in_rotation_rate->p / in_rotation_acceleration_time;
|
||||
rotation_rate_delta.b = in_rotation_rate->b / in_rotation_acceleration_time;
|
||||
rotation_rate_delta.h = in_rotation_rate->h / in_rotation_acceleration_time;*/
|
||||
}
|
||||
|
||||
void camera::do_frame(float in_frametime)
|
||||
{
|
||||
//float frametime, rot_frametime, trans_frametime;
|
||||
//DO ROTATION STUFF
|
||||
if(desired_orientation != NULL)
|
||||
{
|
||||
matrix ori_out;
|
||||
vec3d vel_out;
|
||||
|
||||
vm_matrix_interpolate(desired_orientation, &orientation, &rotation_rate, in_frametime, &ori_out, &vel_out, &rotation_vel_limit, &rotation_acc_limit, 1);
|
||||
orientation = ori_out;
|
||||
rotation_rate = vel_out;
|
||||
|
||||
//TODO: Make this "if(*desired_orienation == orientation)"
|
||||
//Note that this means we are finished rotating
|
||||
if(vel_out.xyz.x == 0.0f && vel_out.xyz.y == 0.0f && vel_out.xyz.z == 0.0f)
|
||||
{
|
||||
delete desired_orientation;
|
||||
desired_orientation = NULL;
|
||||
rotation_rate = rotation_vel_limit = rotation_acc_limit = vmd_zero_vector;
|
||||
}
|
||||
}
|
||||
else if(rotation_rate.xyz.x || rotation_rate.xyz.y || rotation_rate.xyz.z)
|
||||
{
|
||||
//TODO: Make this right.
|
||||
angles new_orientation;
|
||||
vm_angles_2_matrix(&orientation, &new_orientation);
|
||||
new_orientation.p += rotation_rate.xyz.z;
|
||||
new_orientation.b += rotation_rate.xyz.x;
|
||||
new_orientation.h += rotation_rate.xyz.y;
|
||||
vm_angles_2_matrix(&orientation, &new_orientation);
|
||||
}
|
||||
|
||||
/* rot_frametime = trans_frametime = in_frametime;
|
||||
|
||||
do
|
||||
{
|
||||
frametime = rot_frametime;
|
||||
if(rotation_rate_delta_time_left || rotation_rate_decel_time_til > 0.0f)
|
||||
{
|
||||
if(frametime > rotation_rate_delta_time_left && rotation_rate_delta_time_left)
|
||||
frametime = rotation_rate_delta_time_left;
|
||||
if(frametime > rotation_rate_decel_time_til && rotation_rate_decel_time_til > 0.0f)
|
||||
frametime = rotation_rate_decel_time_til;
|
||||
|
||||
if(rotation_rate_delta_time_left)
|
||||
{
|
||||
rotation_rate.p += (rotation_rate_delta.p) * frametime;
|
||||
rotation_rate.b += (rotation_rate_delta.b) * frametime;
|
||||
rotation_rate.h += (rotation_rate_delta.h) * frametime;
|
||||
}
|
||||
|
||||
//mprintf(("DX:%f DY:%f DZ:%f",rotation_rate_delta.p,rotation_rate_delta.b,rotation_rate_delta.h));
|
||||
//mprintf(( " X:%f", rotation_rate.p));
|
||||
//mprintf(( " Y:%f", rotation_rate.b));
|
||||
//mprintf(( " Z:%f\n", rotation_rate.h));
|
||||
|
||||
if(rotation_rate_delta_time_left)
|
||||
{
|
||||
rotation_rate_delta_time_left -= frametime;
|
||||
}
|
||||
if(rotation_rate_decel_time_til > 0.0f)
|
||||
{
|
||||
rotation_rate_decel_time_til -= frametime;
|
||||
if(rotation_rate_decel_time_til == 0.0f)
|
||||
{
|
||||
rotation_rate_delta.p *= -1.0f;
|
||||
rotation_rate_delta.b *= -1.0f;
|
||||
rotation_rate_delta.h *= -1.0f;
|
||||
|
||||
rotation_rate_delta_time_left = rotation_rate_delta_time;
|
||||
rotation_rate_decel_time_til = -1.0f;
|
||||
}
|
||||
}
|
||||
}
|
||||
rot_frametime -= frametime;
|
||||
} while(rot_frametime);*/
|
||||
|
||||
//DO TRANSLATION STUFF
|
||||
// float frametime = in_frametime;
|
||||
/*if(translation_time_left)
|
||||
{
|
||||
if(in_frametime > translation_time_left)
|
||||
frametime = translation_time_left;
|
||||
else
|
||||
frametime = in_frametime;
|
||||
|
||||
vm_vec_scale_add2(&translation_velocity, &translation_velocity_delta, frametime);
|
||||
|
||||
translation_time_left -= frametime;
|
||||
}*/
|
||||
|
||||
vm_vec_scale_add2(&position, &translation_velocity, in_frametime);
|
||||
}
|
||||
|
||||
#define MAX_SUBTITLE_LINES 10
|
||||
subtitle::subtitle(int in_x_pos, int in_y_pos, char* in_text, float in_display_time, char* in_imageanim, float in_fade_time, color *in_text_color, bool center_x, bool center_y, int in_width)
|
||||
{
|
||||
//Setup text
|
||||
int len = strlen(in_text);
|
||||
if(len == 0)
|
||||
return;
|
||||
|
||||
int num_text_lines;
|
||||
char *text_line_ptrs[MAX_SUBTITLE_LINES];
|
||||
int text_line_lens[MAX_SUBTITLE_LINES];
|
||||
num_text_lines = split_str(in_text, in_width, text_line_lens, text_line_ptrs, MAX_SUBTITLE_LINES);
|
||||
std::string temp_str;
|
||||
for(int i = 0; i < num_text_lines; i++)
|
||||
{
|
||||
temp_str.assign(text_line_ptrs[i], text_line_lens[i]);
|
||||
text_lines.push_back(temp_str);
|
||||
}
|
||||
|
||||
//Setup text color
|
||||
if(in_text_color)
|
||||
text_color = *in_text_color;
|
||||
else
|
||||
gr_init_alphacolor(&text_color, 255, 255, 255, 255);
|
||||
|
||||
//Setup display and fade time
|
||||
display_time = fl_abs(in_display_time);
|
||||
fade_time = fl_abs(in_fade_time);
|
||||
|
||||
//Setup image
|
||||
image_id = -1;
|
||||
if(in_imageanim != NULL)
|
||||
{
|
||||
len = strlen(in_imageanim);
|
||||
if(len != 0 && len < MAX_FILENAME_LEN)
|
||||
{
|
||||
image_id = bm_load(in_imageanim);
|
||||
if(image_id != -1)
|
||||
strcpy(imageanim, in_imageanim);
|
||||
}
|
||||
}
|
||||
|
||||
//Setup pos
|
||||
int w=0, h=0, tw=0, th=0;
|
||||
image_pos[0] = 0;
|
||||
image_pos[1] = 0;
|
||||
if(center_x || center_y)
|
||||
{
|
||||
//Get text size
|
||||
for(int i = 0; i < num_text_lines; i++)
|
||||
{
|
||||
gr_get_string_size(&w, &h, text_line_ptrs[i], text_line_lens[i]);
|
||||
|
||||
if(w > tw)
|
||||
tw = w;
|
||||
|
||||
th += h;
|
||||
}
|
||||
|
||||
//Get image size
|
||||
if(image_id != -1)
|
||||
{
|
||||
bm_get_info(image_id, &w, &h);
|
||||
tw += w;
|
||||
if(h > th)
|
||||
th = h;
|
||||
}
|
||||
|
||||
//Center it?
|
||||
if(center_x)
|
||||
image_pos[0] = (gr_screen.max_w - tw)/2;
|
||||
if(center_y)
|
||||
image_pos[0] = (gr_screen.max_h - th)/2;
|
||||
}
|
||||
if(in_x_pos < 0 && !center_x)
|
||||
image_pos[0] += gr_screen.max_w + in_x_pos;
|
||||
else
|
||||
image_pos[0] += in_x_pos;
|
||||
|
||||
if(in_y_pos < 0 && !center_y)
|
||||
image_pos[1] += gr_screen.max_h + in_y_pos;
|
||||
else
|
||||
image_pos[1] += in_y_pos;
|
||||
|
||||
if(image_id != -1)
|
||||
text_pos[0] = image_pos[0] + w; //Still set from bm_get_info call
|
||||
else
|
||||
text_pos[0] = image_pos[0];
|
||||
text_pos[1] = image_pos[1];
|
||||
|
||||
time_displayed = 0.0f;
|
||||
time_displayed_end = 2.0f*fade_time + display_time;
|
||||
}
|
||||
void subtitle::do_frame(float frametime)
|
||||
{
|
||||
//Figure out how much alpha
|
||||
if(time_displayed < fade_time)
|
||||
{
|
||||
text_color.alpha = (ubyte)fl2i(255.0f*(time_displayed/fade_time));
|
||||
}
|
||||
else if(time_displayed > time_displayed_end)
|
||||
{
|
||||
//We're finished
|
||||
if(image_id != -1)
|
||||
{
|
||||
bm_unload(image_id);
|
||||
image_id = -1;
|
||||
}
|
||||
return;
|
||||
}
|
||||
else if((time_displayed - fade_time) > display_time)
|
||||
{
|
||||
text_color.alpha = (ubyte)fl2i(255.0f*(1-(time_displayed - fade_time - display_time)/fade_time));
|
||||
}
|
||||
else
|
||||
{
|
||||
text_color.alpha = 255;
|
||||
}
|
||||
|
||||
gr_set_color_fast(&text_color);
|
||||
|
||||
int font_height = gr_get_font_height();
|
||||
int y = text_pos[1];
|
||||
|
||||
for(unsigned int i = 0; i < text_lines.size(); i++)
|
||||
{
|
||||
gr_string(text_pos[0], y, (char*)text_lines[i].c_str(), false);
|
||||
y += font_height;
|
||||
}
|
||||
|
||||
if(image_id != -1)
|
||||
{
|
||||
gr_set_bitmap(image_id, GR_ALPHABLEND_FILTER, GR_BITBLT_MODE_NORMAL, text_color.alpha/255.0f);
|
||||
gr_bitmap(image_pos[0], image_pos[1], false);
|
||||
}
|
||||
|
||||
time_displayed += frametime;
|
||||
}
|
||||
subtitle::~subtitle()
|
||||
{
|
||||
if(image_id != -1)
|
||||
bm_unload(image_id);
|
||||
}
|
||||
|
||||
void cameras_init()
|
||||
{
|
||||
camera handy_camera;
|
||||
|
||||
//Preset cameras
|
||||
Cameras.push_back(handy_camera);
|
||||
Free_camera = &Cameras[Cameras.size()-1];
|
||||
}
|
||||
|
||||
void cameras_close()
|
||||
{
|
||||
Cameras.clear();
|
||||
|
||||
//Preset cameras
|
||||
Free_camera = NULL;
|
||||
}
|
||||
|
||||
void cameras_do_frame(float frametime)
|
||||
{
|
||||
unsigned int i,size=Cameras.size();
|
||||
for(i = 0; i < size; i++)
|
||||
{
|
||||
Cameras[i].do_frame(frametime);
|
||||
}
|
||||
}
|
||||
|
||||
void subtitles_init()
|
||||
{
|
||||
//Do nothing!!
|
||||
}
|
||||
|
||||
void subtitles_close()
|
||||
{
|
||||
Subtitles.clear();
|
||||
}
|
||||
|
||||
void subtitles_do_frame(float frametime)
|
||||
{
|
||||
unsigned int i,size=Subtitles.size();
|
||||
for(i = 0; i < size; i++)
|
||||
{
|
||||
Subtitles[i].do_frame(frametime);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,88 @@
|
||||
|
||||
#ifndef _CAMERA_H
|
||||
#define _CAMERA_H
|
||||
|
||||
#include <string>
|
||||
#include <vector>
|
||||
|
||||
#include "globalincs/pstypes.h"
|
||||
#include "graphics/2d.h"
|
||||
|
||||
class camera
|
||||
{
|
||||
private:
|
||||
vec3d position;
|
||||
vec3d *desired_position; //NULL unless we're trying to move somewhere
|
||||
vec3d translation_velocity;
|
||||
vec3d translation_vel_limit;
|
||||
vec3d translation_acc_limit;
|
||||
|
||||
matrix orientation;
|
||||
matrix *desired_orientation; //NULL unless we're trying to point somewhere
|
||||
vec3d rotation_rate;
|
||||
vec3d rotation_vel_limit;
|
||||
vec3d rotation_acc_limit;
|
||||
public:
|
||||
camera();
|
||||
~camera();
|
||||
void reset();
|
||||
|
||||
//Set
|
||||
void set_position(vec3d *in_position, float in_translation_time = 0.0f, float in_translation_acceleration_time = 0.0f);
|
||||
void set_translation_velocity(vec3d *in_velocity);
|
||||
void set_rotation(matrix *in_orientation, float in_rotation_time = 0.0f, float in_rotation_acceleration_time = 0.0f);
|
||||
void set_rotation(angles *in_angles, float in_rotation_time = 0.0f, float in_rotation_acceleration_time = 0.0f);
|
||||
void set_rotation_facing(vec3d *in_target, float in_rotation_time = 0.0f, float in_rotation_acceleration_time = 0.0f);
|
||||
void set_rotation_velocity(vec3d *in_rotation_rate);
|
||||
|
||||
//Get
|
||||
//These return values should never ever be changed, I do this in the interest of speed.
|
||||
vec3d *get_position() {return &position;}
|
||||
matrix *get_orientation() {return &orientation;}
|
||||
|
||||
//Do
|
||||
void do_frame(float in_frametime);
|
||||
};
|
||||
|
||||
class subtitle
|
||||
{
|
||||
private:
|
||||
std::vector<std::string> text_lines;
|
||||
int text_pos[2];
|
||||
|
||||
float display_time;
|
||||
float fade_time;
|
||||
color text_color;
|
||||
|
||||
//Done with set
|
||||
char imageanim[MAX_FILENAME_LEN];
|
||||
int image_id;
|
||||
int image_pos[2];
|
||||
|
||||
//Time this has been displayed
|
||||
float time_displayed;
|
||||
|
||||
//When to end it
|
||||
float time_displayed_end;
|
||||
public:
|
||||
subtitle(int in_x_pos, int in_y_pos, char* in_text, float in_display_time, char* in_imageanim = NULL, float in_fade_time = 0.0f, color *in_text_color = NULL, bool center_x = false, bool center_y = false, int in_width = 200);
|
||||
~subtitle();
|
||||
|
||||
void do_frame(float frametime);
|
||||
};
|
||||
|
||||
//Some global stuff
|
||||
extern std::vector<subtitle> Subtitles;
|
||||
extern std::vector<camera> Cameras;
|
||||
//Preset cameras
|
||||
extern camera* Free_camera;
|
||||
|
||||
//Helpful functions
|
||||
void cameras_init();
|
||||
void cameras_close();
|
||||
void cameras_do_frame(float frametime);
|
||||
void subtitles_init();
|
||||
void subtitles_close();
|
||||
void subtitles_do_frame(float frametime);
|
||||
|
||||
#endif // _CAMERA_H
|
||||
+179
-71
@@ -9,13 +9,109 @@
|
||||
|
||||
/*
|
||||
* $Logfile: /Freespace2/code/CFile/cfile.cpp $
|
||||
* $Revision: 2.3 $
|
||||
* $Date: 2002-08-01 01:41:04 $
|
||||
* $Author: penguin $
|
||||
* $Revision: 2.30 $
|
||||
* $Date: 2005-04-19 06:22:20 $
|
||||
* $Author: taylor $
|
||||
*
|
||||
* Utilities for operating on files
|
||||
*
|
||||
* $Log: not supported by cvs2svn $
|
||||
* Revision 2.29 2005/04/05 05:53:14 taylor
|
||||
* s/vector/vec3d/g, better support for different compilers (Jens Granseuer)
|
||||
*
|
||||
* Revision 2.28 2005/03/02 03:13:00 taylor
|
||||
* that one should never have slipped passed me (Linux specific)
|
||||
*
|
||||
* Revision 2.27 2005/01/30 18:32:41 taylor
|
||||
* merge with Linux/OSX tree - p0130
|
||||
* remove extra brace in cfile.cpp
|
||||
*
|
||||
* Revision 2.26 2005/01/30 12:50:08 taylor
|
||||
* merge with Linux/OSX tree - p0130
|
||||
*
|
||||
* Revision 2.25 2005/01/09 21:40:07 wmcoolmon
|
||||
* Fix for music directory parent
|
||||
*
|
||||
* Revision 2.24 2004/12/25 00:22:54 wmcoolmon
|
||||
* Added .ogg in proper directories
|
||||
*
|
||||
* Revision 2.23 2004/10/31 21:29:00 taylor
|
||||
* EFF animation support
|
||||
*
|
||||
* Revision 2.22 2004/10/09 18:08:33 taylor
|
||||
* almost forgot this for the IBX stuff
|
||||
*
|
||||
* Revision 2.21 2004/07/26 20:47:25 Kazan
|
||||
* remove MCD complete
|
||||
*
|
||||
* Revision 2.20 2004/07/17 09:03:29 taylor
|
||||
* make sure avi and mpg movies get added to file cache
|
||||
*
|
||||
* Revision 2.19 2004/07/12 16:32:42 Kazan
|
||||
* MCD - define _MCD_CHECK to use memory tracking
|
||||
*
|
||||
* Revision 2.18 2004/06/22 23:14:09 wmcoolmon
|
||||
* Nonworking OGG support for sound (not music) added, disabled load-only-used-weapons code, modification to sound system registry code.
|
||||
* OGG code has been commented out, so you don't need the SDK yet.
|
||||
*
|
||||
* Revision 2.17 2004/05/26 02:29:44 wmcoolmon
|
||||
* Scratch that - .tbm is a better extension
|
||||
*
|
||||
* Revision 2.16 2004/05/26 02:26:14 wmcoolmon
|
||||
* Added table chunk extension
|
||||
*
|
||||
* Revision 2.15 2004/05/06 22:12:14 taylor
|
||||
* make sure JPG and DDS files are added to the file cache for maps and effects
|
||||
*
|
||||
* Revision 2.14 2004/03/05 09:01:54 Goober5000
|
||||
* Uber pass at reducing #includes
|
||||
* --Goober5000
|
||||
*
|
||||
* Revision 2.13 2004/02/04 09:02:45 Goober5000
|
||||
* got rid of unnecessary double semicolons
|
||||
* --Goober5000
|
||||
*
|
||||
* Revision 2.12 2003/08/27 01:36:22 Goober5000
|
||||
* fixed a strange thing that Bobboau inexplicably put in
|
||||
* --Goober5000
|
||||
*
|
||||
* Revision 2.11 2003/08/25 04:39:17 Goober5000
|
||||
* fixed unreachable code
|
||||
* --Goober5000
|
||||
*
|
||||
* Revision 2.10 2003/08/22 07:35:07 bobboau
|
||||
* specular code should be bugless now,
|
||||
* cell shadeing has been added activated via the comand line '-cell',
|
||||
* 3D shockwave models, and a transparency method I'm calling edge and center alpha that could be usefull for other things, ask for details
|
||||
*
|
||||
* Revision 2.9 2003/08/20 08:12:08 wmcoolmon
|
||||
* Made cfile_delete return 0 on failure, 1 on success
|
||||
*
|
||||
* Revision 2.8 2003/03/18 10:07:00 unknownplayer
|
||||
* The big DX/main line merge. This has been uploaded to the main CVS since I can't manage to get it to upload to the DX branch. Apologies to all who may be affected adversely, but I'll work to debug it as fast as I can.
|
||||
*
|
||||
* Revision 2.7 2002/11/10 16:29:53 DTP
|
||||
* -DTP reworked mod support,
|
||||
*
|
||||
* Revision 2.6 2002/11/04 08:32:38 DTP
|
||||
* Made sure, that VP and Plain files dont get added twice to the search order. Side-effect of Mod support.
|
||||
*
|
||||
* Revision 2.5 2002/10/30 06:31:05 DTP
|
||||
* doh!, used upper case in include, dont know how much it matters for *nix systems, but here it is
|
||||
*
|
||||
* Revision 2.4 2002/10/27 23:59:28 DTP
|
||||
* DTP; started basic implementation of mod-support
|
||||
* plain files only for now. fs2_open.exe -mod X will look for files in fs2/ X /all-legal-subdirectories. no checking/creating dirs yet. directories must be there.
|
||||
*
|
||||
* Revision 2.3.2.1 2002/09/24 18:56:41 randomtiger
|
||||
* DX8 branch commit
|
||||
*
|
||||
* This is the scub of UP's previous code with the more up to date RT code.
|
||||
* For full details check previous dev e-mails
|
||||
*
|
||||
* Revision 2.3 2002/08/01 01:41:04 penguin
|
||||
* The big include file move
|
||||
*
|
||||
* Revision 2.2 2002/07/29 19:04:48 penguin
|
||||
* added #ifdef _WIN32 around windows-specific system headers
|
||||
*
|
||||
@@ -200,23 +296,24 @@
|
||||
#include <winbase.h> /* needed for memory mapping of file functions */
|
||||
#endif
|
||||
|
||||
#ifdef unix
|
||||
#ifdef SCP_UNIX
|
||||
#include <sys/stat.h>
|
||||
#include <glob.h>
|
||||
#include <sys/mman.h>
|
||||
#endif
|
||||
|
||||
#include "globalincs/pstypes.h"
|
||||
#include "cfile/cfile.h"
|
||||
#include "parse/encrypt.h"
|
||||
//#include "outwnd.h"
|
||||
//#include "vecmat.h"
|
||||
//#include "timer.h"
|
||||
#include "cfile/cfilesystem.h"
|
||||
#include "cfile/cfilearchive.h"
|
||||
#include "osapi/osapi.h"
|
||||
|
||||
|
||||
|
||||
char Cfile_root_dir[CFILE_ROOT_DIRECTORY_LEN] = "";
|
||||
#ifdef SCP_UNIX
|
||||
char Cfile_user_dir[CFILE_ROOT_DIRECTORY_LEN] = "";
|
||||
#endif
|
||||
|
||||
// During cfile_init, verify that Pathtypes[n].index == n for each item
|
||||
// Each path must have a valid parent that can be tracable all the way back to the root
|
||||
@@ -228,34 +325,34 @@ cf_pathtype Pathtypes[CF_MAX_PATH_TYPES] = {
|
||||
// What type this is Path Extensions Parent type
|
||||
{ CF_TYPE_INVALID, NULL, NULL, CF_TYPE_INVALID },
|
||||
// Root must be index 1!!
|
||||
{ CF_TYPE_ROOT, "", ".mve", CF_TYPE_ROOT },
|
||||
{ CF_TYPE_ROOT, "", ".mve .avi .mpg", CF_TYPE_ROOT },
|
||||
{ CF_TYPE_DATA, "data", ".cfg .log .txt", CF_TYPE_ROOT },
|
||||
{ CF_TYPE_MAPS, "data" DIR_SEPARATOR_STR "maps", ".pcx .ani .tga", CF_TYPE_DATA },
|
||||
{ CF_TYPE_MAPS, "data" DIR_SEPARATOR_STR "maps", ".pcx .ani .eff .tga .jpg .dds", CF_TYPE_DATA },
|
||||
{ CF_TYPE_TEXT, "data" DIR_SEPARATOR_STR "text", ".txt .net", CF_TYPE_DATA },
|
||||
{ CF_TYPE_MISSIONS, "data" DIR_SEPARATOR_STR "missions", ".fs2 .fc2 .ntl .ssv", CF_TYPE_DATA },
|
||||
{ CF_TYPE_MODELS, "data" DIR_SEPARATOR_STR "models", ".pof", CF_TYPE_DATA },
|
||||
{ CF_TYPE_TABLES, "data" DIR_SEPARATOR_STR "tables", ".tbl", CF_TYPE_DATA },
|
||||
{ CF_TYPE_SOUNDS, "data" DIR_SEPARATOR_STR "sounds", ".wav", CF_TYPE_DATA },
|
||||
{ CF_TYPE_SOUNDS_8B22K, "data" DIR_SEPARATOR_STR "sounds" DIR_SEPARATOR_STR "8b22k", ".wav", CF_TYPE_SOUNDS },
|
||||
{ CF_TYPE_SOUNDS_16B11K, "data" DIR_SEPARATOR_STR "sounds" DIR_SEPARATOR_STR "16b11k", ".wav", CF_TYPE_SOUNDS },
|
||||
{ CF_TYPE_TABLES, "data" DIR_SEPARATOR_STR "tables", ".tbl .tbm", CF_TYPE_DATA },
|
||||
{ CF_TYPE_SOUNDS, "data" DIR_SEPARATOR_STR "sounds", ".wav .ogg", CF_TYPE_DATA },
|
||||
{ CF_TYPE_SOUNDS_8B22K, "data" DIR_SEPARATOR_STR "sounds" DIR_SEPARATOR_STR "8b22k", ".wav .ogg", CF_TYPE_SOUNDS },
|
||||
{ CF_TYPE_SOUNDS_16B11K, "data" DIR_SEPARATOR_STR "sounds" DIR_SEPARATOR_STR "16b11k", ".wav .ogg", CF_TYPE_SOUNDS },
|
||||
{ CF_TYPE_VOICE, "data" DIR_SEPARATOR_STR "voice", "", CF_TYPE_DATA },
|
||||
{ CF_TYPE_VOICE_BRIEFINGS, "data" DIR_SEPARATOR_STR "voice" DIR_SEPARATOR_STR "briefing", ".wav", CF_TYPE_VOICE },
|
||||
{ CF_TYPE_VOICE_CMD_BRIEF, "data" DIR_SEPARATOR_STR "voice" DIR_SEPARATOR_STR "command_briefings", ".wav", CF_TYPE_VOICE },
|
||||
{ CF_TYPE_VOICE_DEBRIEFINGS, "data" DIR_SEPARATOR_STR "voice" DIR_SEPARATOR_STR "debriefing", ".wav", CF_TYPE_VOICE },
|
||||
{ CF_TYPE_VOICE_PERSONAS, "data" DIR_SEPARATOR_STR "voice" DIR_SEPARATOR_STR "personas", ".wav", CF_TYPE_VOICE },
|
||||
{ CF_TYPE_VOICE_SPECIAL, "data" DIR_SEPARATOR_STR "voice" DIR_SEPARATOR_STR "special", ".wav", CF_TYPE_VOICE },
|
||||
{ CF_TYPE_VOICE_TRAINING, "data" DIR_SEPARATOR_STR "voice" DIR_SEPARATOR_STR "training", ".wav", CF_TYPE_VOICE },
|
||||
{ CF_TYPE_MUSIC, "data" DIR_SEPARATOR_STR "music", ".wav", CF_TYPE_VOICE },
|
||||
{ CF_TYPE_MOVIES, "data" DIR_SEPARATOR_STR "movies", ".mve .msb", CF_TYPE_DATA },
|
||||
{ CF_TYPE_VOICE_BRIEFINGS, "data" DIR_SEPARATOR_STR "voice" DIR_SEPARATOR_STR "briefing", ".wav .ogg", CF_TYPE_VOICE },
|
||||
{ CF_TYPE_VOICE_CMD_BRIEF, "data" DIR_SEPARATOR_STR "voice" DIR_SEPARATOR_STR "command_briefings", ".wav .ogg", CF_TYPE_VOICE },
|
||||
{ CF_TYPE_VOICE_DEBRIEFINGS, "data" DIR_SEPARATOR_STR "voice" DIR_SEPARATOR_STR "debriefing", ".wav .ogg", CF_TYPE_VOICE },
|
||||
{ CF_TYPE_VOICE_PERSONAS, "data" DIR_SEPARATOR_STR "voice" DIR_SEPARATOR_STR "personas", ".wav .ogg", CF_TYPE_VOICE },
|
||||
{ CF_TYPE_VOICE_SPECIAL, "data" DIR_SEPARATOR_STR "voice" DIR_SEPARATOR_STR "special", ".wav .ogg", CF_TYPE_VOICE },
|
||||
{ CF_TYPE_VOICE_TRAINING, "data" DIR_SEPARATOR_STR "voice" DIR_SEPARATOR_STR "training", ".wav .ogg", CF_TYPE_VOICE },
|
||||
{ CF_TYPE_MUSIC, "data" DIR_SEPARATOR_STR "music", ".wav .ogg", CF_TYPE_DATA },
|
||||
{ CF_TYPE_MOVIES, "data" DIR_SEPARATOR_STR "movies", ".mve .msb .avi .mpg", CF_TYPE_DATA },
|
||||
{ CF_TYPE_INTERFACE, "data" DIR_SEPARATOR_STR "interface", ".pcx .ani .tga", CF_TYPE_DATA },
|
||||
{ CF_TYPE_FONT, "data" DIR_SEPARATOR_STR "fonts", ".vf", CF_TYPE_DATA },
|
||||
{ CF_TYPE_EFFECTS, "data" DIR_SEPARATOR_STR "effects", ".ani .pcx .neb .tga", CF_TYPE_DATA },
|
||||
{ CF_TYPE_EFFECTS, "data" DIR_SEPARATOR_STR "effects", ".ani .eff .pcx .neb .tga .jpg .dds", CF_TYPE_DATA },
|
||||
{ CF_TYPE_HUD, "data" DIR_SEPARATOR_STR "hud", ".ani .pcx .tga", CF_TYPE_DATA },
|
||||
{ CF_TYPE_PLAYER_MAIN, "data" DIR_SEPARATOR_STR "players", "", CF_TYPE_DATA },
|
||||
{ CF_TYPE_PLAYER_IMAGES_MAIN, "data" DIR_SEPARATOR_STR "players" DIR_SEPARATOR_STR "images", ".pcx", CF_TYPE_PLAYER_MAIN },
|
||||
{ CF_TYPE_CACHE, "data" DIR_SEPARATOR_STR "cache", ".clr .tmp", CF_TYPE_DATA }, //clr=cached color
|
||||
{ CF_TYPE_CACHE, "data" DIR_SEPARATOR_STR "cache", ".clr .tmp .ibx", CF_TYPE_DATA }, //clr=cached color
|
||||
{ CF_TYPE_PLAYERS, "data" DIR_SEPARATOR_STR "players", ".hcf", CF_TYPE_DATA },
|
||||
{ CF_TYPE_SINGLE_PLAYERS, "data" DIR_SEPARATOR_STR "players" DIR_SEPARATOR_STR "single", ".plr .csg .css", CF_TYPE_PLAYERS },
|
||||
{ CF_TYPE_SINGLE_PLAYERS, "data" DIR_SEPARATOR_STR "players" DIR_SEPARATOR_STR "single", ".pl2 .cs2 .plr .csg .css", CF_TYPE_PLAYERS },
|
||||
{ CF_TYPE_MULTI_PLAYERS, "data" DIR_SEPARATOR_STR "players" DIR_SEPARATOR_STR "multi", ".plr", CF_TYPE_DATA },
|
||||
{ CF_TYPE_MULTI_CACHE, "data" DIR_SEPARATOR_STR "multidata", ".pcx .fs2", CF_TYPE_DATA },
|
||||
{ CF_TYPE_CONFIG, "data" DIR_SEPARATOR_STR "config", ".cfg", CF_TYPE_DATA },
|
||||
@@ -287,7 +384,7 @@ CFILE *cf_open_packed_cfblock(FILE *fp, int type, int offset, int size);
|
||||
|
||||
#if defined _WIN32
|
||||
CFILE *cf_open_mapped_fill_cfblock(HANDLE hFile, int type);
|
||||
#elif defined unix
|
||||
#elif defined SCP_UNIX
|
||||
CFILE *cf_open_mapped_fill_cfblock(FILE *fp, int type);
|
||||
#endif
|
||||
|
||||
@@ -355,11 +452,7 @@ int cfile_init(char *exe_dir, char *cdrom_dir)
|
||||
|
||||
// are we in a root directory?
|
||||
if(cfile_in_root_dir(buf)){
|
||||
#if defined _WIN32
|
||||
MessageBox((HWND)NULL, "Freespace2/Fred2 cannot be run from a drive root directory!", "Error", MB_OK);
|
||||
#elif defined unix
|
||||
fprintf(stderr, "Error: Freespace2/Fred2 cannot be run from a drive root directory!\n");
|
||||
#endif
|
||||
return 1;
|
||||
}
|
||||
|
||||
@@ -373,16 +466,15 @@ int cfile_init(char *exe_dir, char *cdrom_dir)
|
||||
buf[i] = 0;
|
||||
cfile_chdir(buf);
|
||||
} else {
|
||||
#if defined _WIN32
|
||||
MessageBox((HWND)NULL, "Error trying to determine executable root directory!", "Error", MB_OK);
|
||||
#elif defined unix
|
||||
fprintf(stderr, "Error trying to determine executable root directory!\n");
|
||||
#endif
|
||||
return 1;
|
||||
}
|
||||
|
||||
// set root directory
|
||||
strncpy(Cfile_root_dir, buf, CFILE_ROOT_DIRECTORY_LEN-1);
|
||||
#ifdef SCP_UNIX
|
||||
snprintf(Cfile_user_dir, MAX_PATH, "%s/%s/", detect_home(), Osreg_user_dir);
|
||||
#endif
|
||||
|
||||
for ( i = 0; i < MAX_CFILE_BLOCKS; i++ ) {
|
||||
Cfile_block_list[i].type = CFILE_BLOCK_UNUSED;
|
||||
@@ -442,7 +534,7 @@ int cfile_push_chdir(int type)
|
||||
int e;
|
||||
char dir[128];
|
||||
char OriginalDirectory[128];
|
||||
char *Drive, *Path;
|
||||
char *Drive = NULL, *Path = NULL;
|
||||
char NoDir[] = "\\.";
|
||||
|
||||
_getcwd(OriginalDirectory, 127);
|
||||
@@ -486,7 +578,7 @@ int cfile_chdir(char *dir)
|
||||
{
|
||||
int e;
|
||||
char OriginalDirectory[128];
|
||||
char *Drive, *Path;
|
||||
char *Drive = NULL, *Path = NULL;
|
||||
char NoDir[] = "\\.";
|
||||
|
||||
_getcwd(OriginalDirectory, 127);
|
||||
@@ -531,7 +623,6 @@ int cfile_pop_dir()
|
||||
// NOTE : WILL NOT DELETE READ-ONLY FILES
|
||||
int cfile_flush_dir(int dir_type)
|
||||
{
|
||||
int find_handle;
|
||||
int del_count;
|
||||
|
||||
Assert( CF_TYPE_SPECIFIED(dir_type) );
|
||||
@@ -544,6 +635,7 @@ int cfile_flush_dir(int dir_type)
|
||||
// proceed to delete the files
|
||||
del_count = 0;
|
||||
#if defined _WIN32
|
||||
int find_handle;
|
||||
_finddata_t find;
|
||||
find_handle = _findfirst( "*", &find );
|
||||
if (find_handle != -1) {
|
||||
@@ -558,7 +650,7 @@ int cfile_flush_dir(int dir_type)
|
||||
} while (!_findnext(find_handle, &find));
|
||||
_findclose( find_handle );
|
||||
}
|
||||
#elif defined unix
|
||||
#elif defined SCP_UNIX
|
||||
glob_t globinfo;
|
||||
memset(&globinfo, 0, sizeof(globinfo));
|
||||
int status = glob("*", 0, NULL, &globinfo);
|
||||
@@ -610,8 +702,8 @@ char *cf_add_ext(char *filename, char *ext)
|
||||
return path;
|
||||
}
|
||||
|
||||
// Deletes a file.
|
||||
void cf_delete( char *filename, int dir_type )
|
||||
// Deletes a file. Returns 0 if an error occurs, 1 on success
|
||||
int cf_delete( char *filename, int dir_type )
|
||||
{
|
||||
char longname[MAX_PATH_LEN];
|
||||
|
||||
@@ -623,9 +715,21 @@ void cf_delete( char *filename, int dir_type )
|
||||
if (fp) {
|
||||
// delete the file
|
||||
fclose(fp);
|
||||
_unlink(longname);
|
||||
if(_unlink(longname) == -1)
|
||||
{
|
||||
//ERROR - file is probably read only
|
||||
return 0;
|
||||
}
|
||||
else
|
||||
{
|
||||
return 1;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
//ERROR - file doesn't exist
|
||||
return 0;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -653,8 +757,9 @@ int cf_exist( char *filename, int dir_type )
|
||||
|
||||
FILE *fp = fopen(longname, "rb");
|
||||
if (fp) {
|
||||
return 1;
|
||||
// Goober5000 - these were switched, causing the fclose to be unreachable
|
||||
fclose(fp);
|
||||
return 1;
|
||||
}
|
||||
|
||||
return 0;
|
||||
@@ -762,18 +867,12 @@ extern int game_cd_changed();
|
||||
|
||||
CFILE *cfopen(char *file_path, char *mode, int type, int dir_type, bool localize)
|
||||
{
|
||||
/* Bobboau, what is this doing here? 31 is way too short... - Goober5000
|
||||
if( strlen(file_path) > 31 )
|
||||
Error(LOCATION, "file name %s too long, \nmust be less than 31 charicters", file_path);*/
|
||||
|
||||
char longname[_MAX_PATH];
|
||||
|
||||
// nprintf(("CFILE", "CFILE -- trying to open %s\n", file_path ));
|
||||
// #if !defined(MULTIPLAYER_BETA_BUILD) && !defined(FS2_DEMO)
|
||||
|
||||
// we no longer need to do this, and on machines with crappy-ass drivers it can slow things down horribly.
|
||||
#if 0
|
||||
if ( game_cd_changed() ) {
|
||||
cfile_refresh();
|
||||
}
|
||||
#endif
|
||||
|
||||
//================================================
|
||||
// Check that all the parameters make sense
|
||||
Assert(file_path && strlen(file_path));
|
||||
@@ -791,7 +890,11 @@ CFILE *cfopen(char *file_path, char *mode, int type, int dir_type, bool localize
|
||||
|
||||
if ( strchr(mode,'w') ) {
|
||||
// For write-only files, require a full path or a path type
|
||||
if ( strpbrk(file_path,"/\\:") ) {
|
||||
#ifdef SCP_UNIX
|
||||
if ( strpbrk(file_path, "/") ) {
|
||||
#else
|
||||
if ( strpbrk(file_path,"/\\:") ) {
|
||||
#endif
|
||||
// Full path given?
|
||||
strcpy(longname, file_path );
|
||||
} else {
|
||||
@@ -839,7 +942,7 @@ CFILE *cfopen(char *file_path, char *mode, int type, int dir_type, bool localize
|
||||
if (hFile != INVALID_HANDLE_VALUE) {
|
||||
return cf_open_mapped_fill_cfblock(hFile, dir_type);
|
||||
}
|
||||
#elif defined unix
|
||||
#elif defined SCP_UNIX
|
||||
FILE *fp = fopen( longname, "rb" );
|
||||
if (fp) {
|
||||
return cf_open_mapped_fill_cfblock(fp, dir_type);
|
||||
@@ -942,9 +1045,13 @@ int cfclose( CFILE * cfile )
|
||||
result = CloseHandle(cb->hMapFile);
|
||||
Assert(result); // Ensure file handle is closed properly
|
||||
result = 0;
|
||||
#elif defined unix
|
||||
result = munmap(cb->data, cb->data_length);
|
||||
Assert(result);
|
||||
#elif defined SCP_UNIX
|
||||
// FIXME: result is wrong after munmap() but it is successful
|
||||
//result = munmap(cb->data, cb->data_length);
|
||||
//Assert(result);
|
||||
munmap(cb->data, cb->data_length);
|
||||
if ( cb->fp != NULL)
|
||||
result = fclose(cb->fp);
|
||||
#endif
|
||||
|
||||
} else if ( cb->fp != NULL ) {
|
||||
@@ -973,25 +1080,20 @@ CFILE *cf_open_fill_cfblock(FILE *fp, int type)
|
||||
|
||||
cfile_block_index = cfget_cfile_block();
|
||||
if ( cfile_block_index == -1 ) {
|
||||
fclose(fp);
|
||||
return NULL;
|
||||
} else {
|
||||
CFILE *cfp;
|
||||
Cfile_block *cfbp;
|
||||
cfbp = &Cfile_block_list[cfile_block_index];
|
||||
cfp = &Cfile_list[cfile_block_index];;
|
||||
cfp = &Cfile_list[cfile_block_index];
|
||||
cfp->id = cfile_block_index;
|
||||
cfp->version = 0;
|
||||
cfbp->data = NULL;
|
||||
cfbp->fp = fp;
|
||||
cfbp->dir_type = type;
|
||||
|
||||
#if defined _WIN32
|
||||
cf_init_lowlevel_read_code(cfp,0,filelength(fileno(fp)) );
|
||||
#elif defined unix
|
||||
struct stat statbuf;
|
||||
fstat(fileno(fp), &statbuf);
|
||||
cf_init_lowlevel_read_code(cfp, 0, statbuf.st_size );
|
||||
#endif
|
||||
|
||||
return cfp;
|
||||
}
|
||||
@@ -1011,6 +1113,7 @@ CFILE *cf_open_packed_cfblock(FILE *fp, int type, int offset, int size)
|
||||
|
||||
cfile_block_index = cfget_cfile_block();
|
||||
if ( cfile_block_index == -1 ) {
|
||||
fclose(fp);
|
||||
return NULL;
|
||||
} else {
|
||||
CFILE *cfp;
|
||||
@@ -1040,7 +1143,7 @@ CFILE *cf_open_packed_cfblock(FILE *fp, int type, int offset, int size)
|
||||
//
|
||||
#if defined _WIN32
|
||||
CFILE *cf_open_mapped_fill_cfblock(HANDLE hFile, int type)
|
||||
#elif defined unix
|
||||
#elif defined SCP_UNIX
|
||||
CFILE *cf_open_mapped_fill_cfblock(FILE *fp, int type)
|
||||
#endif
|
||||
{
|
||||
@@ -1048,6 +1151,9 @@ CFILE *cf_open_mapped_fill_cfblock(FILE *fp, int type)
|
||||
|
||||
cfile_block_index = cfget_cfile_block();
|
||||
if ( cfile_block_index == -1 ) {
|
||||
#ifdef SCP_UNIX
|
||||
fclose(fp);
|
||||
#endif
|
||||
return NULL;
|
||||
}
|
||||
else {
|
||||
@@ -1073,8 +1179,9 @@ CFILE *cf_open_mapped_fill_cfblock(FILE *fp, int type)
|
||||
|
||||
cfbp->data = (ubyte*)MapViewOfFile(cfbp->hMapFile, FILE_MAP_READ, 0, 0, 0);
|
||||
Assert( cfbp->data != NULL );
|
||||
#elif defined unix
|
||||
#elif defined SCP_UNIX
|
||||
cfbp->fp = fp;
|
||||
cfbp->data_length = filelength( fileno(fp) );
|
||||
cfbp->data = mmap(NULL, // start
|
||||
cfbp->data_length, // length
|
||||
PROT_READ, // prot
|
||||
@@ -1132,7 +1239,7 @@ float cfread_float(CFILE *file, int ver, float deflt)
|
||||
if (cfread( &f, sizeof(f), 1, file) != 1)
|
||||
return deflt;
|
||||
|
||||
// i = INTEL_INT(i); // hmm, not sure what to do here
|
||||
f = INTEL_FLOAT(&f);
|
||||
return f;
|
||||
}
|
||||
|
||||
@@ -1205,7 +1312,7 @@ ubyte cfread_ubyte(CFILE *file, int ver, ubyte deflt)
|
||||
return b;
|
||||
}
|
||||
|
||||
void cfread_vector(vector *vec, CFILE *file, int ver, vector *deflt)
|
||||
void cfread_vector(vec3d *vec, CFILE *file, int ver, vec3d *deflt)
|
||||
{
|
||||
if (file->version < ver) {
|
||||
if (deflt)
|
||||
@@ -1278,7 +1385,7 @@ void cfread_string_len(char *buf,int n, CFILE *file)
|
||||
|
||||
int cfwrite_float(float f, CFILE *file)
|
||||
{
|
||||
// i = INTEL_INT(i); // hmm, not sure what to do here
|
||||
f = INTEL_FLOAT(&f);
|
||||
return cfwrite(&f, sizeof(f), 1, file);
|
||||
}
|
||||
|
||||
@@ -1311,7 +1418,7 @@ int cfwrite_ubyte(ubyte b, CFILE *file)
|
||||
return cfwrite(&b, sizeof(b), 1, file);
|
||||
}
|
||||
|
||||
int cfwrite_vector(vector *vec, CFILE *file)
|
||||
int cfwrite_vector(vec3d *vec, CFILE *file)
|
||||
{
|
||||
if(!cfwrite_float(vec->xyz.x, file)){
|
||||
return 0;
|
||||
@@ -1768,3 +1875,4 @@ int cflush(CFILE *cfile)
|
||||
|
||||
|
||||
|
||||
|
||||
+71
-34
@@ -9,13 +9,44 @@
|
||||
|
||||
/*
|
||||
* $Logfile: /Freespace2/code/CFile/cfile.h $
|
||||
* $Revision: 2.2 $
|
||||
* $Date: 2002-08-01 01:41:04 $
|
||||
* $Author: penguin $
|
||||
* $Revision: 2.12 $
|
||||
* $Date: 2005-07-13 02:50:49 $
|
||||
* $Author: Goober5000 $
|
||||
*
|
||||
* <insert description of file here>
|
||||
*
|
||||
* $Log: not supported by cvs2svn $
|
||||
* Revision 2.11 2005/04/05 05:53:14 taylor
|
||||
* s/vector/vec3d/g, better support for different compilers (Jens Granseuer)
|
||||
*
|
||||
* Revision 2.10 2005/01/30 12:50:08 taylor
|
||||
* merge with Linux/OSX tree - p0130
|
||||
*
|
||||
* Revision 2.9 2004/08/11 05:06:19 Kazan
|
||||
* added preprocdefines.h to prevent what happened with fred -- make sure to make all fred2 headers include this file as the _first_ include -- i have already modified fs2 files to do this
|
||||
*
|
||||
* Revision 2.8 2004/05/26 21:02:26 wmcoolmon
|
||||
* Added weapons_expl modular table, updated cfilesystem to work with modular tables, fixed loading order, fixed ship loading error messages
|
||||
*
|
||||
* Revision 2.7 2003/08/20 08:12:08 wmcoolmon
|
||||
* Made cfile_delete return 0 on failure, 1 on success
|
||||
*
|
||||
* Revision 2.6 2002/11/10 16:29:53 DTP
|
||||
* -DTP reworked mod support,
|
||||
*
|
||||
* Revision 2.5 2002/11/02 23:06:59 DTP
|
||||
* DOh,uhmm, define error again, this is getting to me.
|
||||
*
|
||||
* Revision 2.4 2002/11/02 23:04:46 DTP
|
||||
* DOh, fixed that define, learn to count DTP :)
|
||||
*
|
||||
* Revision 2.3 2002/10/27 23:59:28 DTP
|
||||
* DTP; started basic implementation of mod-support
|
||||
* plain files only for now. fs2_open.exe -mod X will look for files in fs2/ X /all-legal-subdirectories. no checking/creating dirs yet. directories must be there.
|
||||
*
|
||||
* Revision 2.2 2002/08/01 01:41:04 penguin
|
||||
* The big include file move
|
||||
*
|
||||
* Revision 2.1 2002/07/07 19:55:58 penguin
|
||||
* Back-port to MSVC
|
||||
*
|
||||
@@ -343,13 +374,14 @@
|
||||
#ifndef __CFILE_H__
|
||||
#define __CFILE_H__
|
||||
|
||||
|
||||
#include <time.h>
|
||||
#include "globalincs/pstypes.h"
|
||||
|
||||
#if defined _WIN32
|
||||
#define DIR_SEPARATOR_CHAR '\\'
|
||||
#define DIR_SEPARATOR_STR "\\"
|
||||
#elif defined unix
|
||||
#elif defined SCP_UNIX
|
||||
#define DIR_SEPARATOR_CHAR '/'
|
||||
#define DIR_SEPARATOR_STR "/"
|
||||
#else
|
||||
@@ -378,44 +410,45 @@ typedef struct {
|
||||
|
||||
#define CF_TYPE_ANY -1 // Used to check in any directory
|
||||
|
||||
#define CF_TYPE_INVALID 0
|
||||
#define CF_TYPE_ROOT 1 // Root must be 1!!
|
||||
#define CF_TYPE_DATA 2
|
||||
#define CF_TYPE_MAPS 3
|
||||
#define CF_TYPE_TEXT 4
|
||||
#define CF_TYPE_MISSIONS 5
|
||||
#define CF_TYPE_MODELS 6
|
||||
#define CF_TYPE_TABLES 7
|
||||
#define CF_TYPE_SOUNDS 8
|
||||
#define CF_TYPE_SOUNDS_8B22K 9
|
||||
#define CF_TYPE_SOUNDS_16B11K 10
|
||||
#define CF_TYPE_VOICE 11
|
||||
#define CF_TYPE_INVALID 0
|
||||
#define CF_TYPE_ROOT 1 // Root must be 1!!
|
||||
#define CF_TYPE_DATA 2
|
||||
#define CF_TYPE_MAPS 3
|
||||
#define CF_TYPE_TEXT 4
|
||||
#define CF_TYPE_MISSIONS 5
|
||||
#define CF_TYPE_MODELS 6
|
||||
#define CF_TYPE_TABLES 7
|
||||
#define CF_TYPE_SOUNDS 8
|
||||
#define CF_TYPE_SOUNDS_8B22K 9
|
||||
#define CF_TYPE_SOUNDS_16B11K 10
|
||||
#define CF_TYPE_VOICE 11
|
||||
#define CF_TYPE_VOICE_BRIEFINGS 12
|
||||
#define CF_TYPE_VOICE_CMD_BRIEF 13
|
||||
#define CF_TYPE_VOICE_DEBRIEFINGS 14
|
||||
#define CF_TYPE_VOICE_PERSONAS 15
|
||||
#define CF_TYPE_VOICE_SPECIAL 16
|
||||
#define CF_TYPE_VOICE_SPECIAL 16
|
||||
#define CF_TYPE_VOICE_TRAINING 17
|
||||
#define CF_TYPE_MUSIC 18
|
||||
#define CF_TYPE_MOVIES 19
|
||||
#define CF_TYPE_INTERFACE 20
|
||||
#define CF_TYPE_FONT 21
|
||||
#define CF_TYPE_EFFECTS 22
|
||||
#define CF_TYPE_HUD 23
|
||||
#define CF_TYPE_MUSIC 18
|
||||
#define CF_TYPE_MOVIES 19
|
||||
#define CF_TYPE_INTERFACE 20
|
||||
#define CF_TYPE_FONT 21
|
||||
#define CF_TYPE_EFFECTS 22
|
||||
#define CF_TYPE_HUD 23
|
||||
#define CF_TYPE_PLAYER_MAIN 24
|
||||
#define CF_TYPE_PLAYER_IMAGES_MAIN 25
|
||||
#define CF_TYPE_CACHE 26
|
||||
#define CF_TYPE_PLAYERS 27
|
||||
#define CF_TYPE_CACHE 26
|
||||
#define CF_TYPE_PLAYERS 27
|
||||
#define CF_TYPE_SINGLE_PLAYERS 28
|
||||
#define CF_TYPE_MULTI_PLAYERS 29
|
||||
#define CF_TYPE_MULTI_PLAYERS 29
|
||||
#define CF_TYPE_MULTI_CACHE 30
|
||||
#define CF_TYPE_CONFIG 31
|
||||
#define CF_TYPE_CONFIG 31
|
||||
#define CF_TYPE_SQUAD_IMAGES_MAIN 32
|
||||
#define CF_TYPE_DEMOS 33
|
||||
#define CF_TYPE_CBANIMS 34
|
||||
#define CF_TYPE_DEMOS 33
|
||||
#define CF_TYPE_CBANIMS 34
|
||||
#define CF_TYPE_INTEL_ANIMS 35
|
||||
|
||||
#define CF_MAX_PATH_TYPES 36 // Can be as high as you'd like
|
||||
#define CF_MAX_PATH_TYPES 36 // Can be as high as you'd like //DTP; yeah but beware alot of things uses CF_MAX_PATH_TYPES
|
||||
|
||||
|
||||
// TRUE if type is specified and valid
|
||||
#define CF_TYPE_SPECIFIED(path_type) (((path_type)>CF_TYPE_INVALID) && ((path_type)<CF_MAX_PATH_TYPES))
|
||||
@@ -427,6 +460,7 @@ typedef struct {
|
||||
#define CF_SORT_NONE 0
|
||||
#define CF_SORT_NAME 1
|
||||
#define CF_SORT_TIME 2
|
||||
#define CF_SORT_REVERSE 3
|
||||
|
||||
#define cfread_fix(file) (fix)cfread_int(file)
|
||||
#define cfwrite_fix(i,file) cfwrite_int(i,file)
|
||||
@@ -438,6 +472,9 @@ extern int (*Get_file_list_filter)(char *filename);
|
||||
// cfile directory. valid after cfile_init() returns successfully
|
||||
#define CFILE_ROOT_DIRECTORY_LEN 256
|
||||
extern char Cfile_root_dir[CFILE_ROOT_DIRECTORY_LEN];
|
||||
#ifdef SCP_UNIX
|
||||
extern char Cfile_user_dir[CFILE_ROOT_DIRECTORY_LEN];
|
||||
#endif
|
||||
|
||||
//================= LOW-LEVEL FUNCTIONS ==================
|
||||
// Call this once at the beginning of the program
|
||||
@@ -465,8 +502,8 @@ int cflush(CFILE *cfile);
|
||||
// open a file. Once set, you can use minimum version numbers with the read functions.
|
||||
void cf_set_version( CFILE * cfile, int version );
|
||||
|
||||
// Deletes a file.
|
||||
void cf_delete( char *filename, int dir_type );
|
||||
// Deletes a file. Returns 0 on error, 1 if successful
|
||||
int cf_delete( char *filename, int dir_type );
|
||||
|
||||
// Same as _access function to read a file's access bits
|
||||
int cf_access( char *filename, int dir_type, int mode );
|
||||
@@ -569,7 +606,7 @@ ushort cfread_ushort(CFILE *file, int ver = 0, ushort deflt = 0);
|
||||
int cfread_int(CFILE *file, int ver = 0, int deflt = 0);
|
||||
uint cfread_uint(CFILE *file, int ver = 0, uint deflt = 0);
|
||||
float cfread_float(CFILE *file, int ver = 0, float deflt = 0.0f);
|
||||
void cfread_vector(vector *vec, CFILE *file, int ver = 0, vector *deflt = NULL);
|
||||
void cfread_vector(vec3d *vec, CFILE *file, int ver = 0, vec3d *deflt = NULL);
|
||||
void cfread_angles(angles *ang, CFILE *file, int ver = 0, angles *deflt = NULL);
|
||||
|
||||
// Reads variable length, null-termined string. Will only read up
|
||||
@@ -587,7 +624,7 @@ int cfwrite_uint(uint i, CFILE *file);
|
||||
int cfwrite_short(short s, CFILE *file);
|
||||
int cfwrite_ushort(ushort s, CFILE *file);
|
||||
int cfwrite_ubyte(ubyte u, CFILE *file);
|
||||
int cfwrite_vector(vector *vec, CFILE *file);
|
||||
int cfwrite_vector(vec3d *vec, CFILE *file);
|
||||
int cfwrite_angles(angles *ang, CFILE *file);
|
||||
|
||||
// writes variable length, null-termined string.
|
||||
|
||||
@@ -9,14 +9,31 @@
|
||||
|
||||
/*
|
||||
* $Logfile: /Freespace2/code/CFile/CfileArchive.cpp $
|
||||
* $Revision: 2.2 $
|
||||
* $Date: 2002-08-01 01:41:04 $
|
||||
* $Author: penguin $
|
||||
* $Revision: 2.7 $
|
||||
* $Date: 2005-07-24 18:31:17 $
|
||||
* $Author: taylor $
|
||||
*
|
||||
* Low-level code for reading data out of large archive files or normal files. All
|
||||
* reads/seeks come through here.
|
||||
*
|
||||
* $Log: not supported by cvs2svn $
|
||||
* Revision 2.6 2004/07/26 20:47:25 Kazan
|
||||
* remove MCD complete
|
||||
*
|
||||
* Revision 2.5 2004/07/12 16:32:42 Kazan
|
||||
* MCD - define _MCD_CHECK to use memory tracking
|
||||
*
|
||||
* Revision 2.4 2004/03/05 09:01:54 Goober5000
|
||||
* Uber pass at reducing #includes
|
||||
* --Goober5000
|
||||
*
|
||||
* Revision 2.3 2003/03/19 09:05:25 Goober5000
|
||||
* more housecleaning, this time for debug warnings
|
||||
* --Goober5000
|
||||
*
|
||||
* Revision 2.2 2002/08/01 01:41:04 penguin
|
||||
* The big include file move
|
||||
*
|
||||
* Revision 2.1 2002/07/29 19:17:21 penguin
|
||||
* added #ifdef _WIN32 around windows-specific system headers
|
||||
*
|
||||
@@ -93,10 +110,11 @@
|
||||
#include <winbase.h> /* needed for memory mapping of file functions */
|
||||
#endif
|
||||
|
||||
#include "globalincs/pstypes.h"
|
||||
#include "cfile/cfile.h"
|
||||
#include "cfile/cfilearchive.h"
|
||||
|
||||
|
||||
|
||||
#define CHECK_POSITION
|
||||
|
||||
// Called once to setup the low-level reading code.
|
||||
@@ -119,7 +137,8 @@ void cf_init_lowlevel_read_code( CFILE * cfile, int offset, int size )
|
||||
}
|
||||
|
||||
#if defined(CHECK_POSITION) && !defined(NDEBUG)
|
||||
int raw_position = ftell(cb->fp) - cb->lib_offset;
|
||||
int raw_position;
|
||||
raw_position = ftell(cb->fp) - cb->lib_offset;
|
||||
Assert(raw_position == cb->raw_position);
|
||||
#endif
|
||||
}
|
||||
@@ -151,8 +170,9 @@ int cfeof(CFILE *cfile)
|
||||
Assert(cb->fp != NULL);
|
||||
|
||||
#if defined(CHECK_POSITION) && !defined(NDEBUG)
|
||||
int raw_position = ftell(cb->fp) - cb->lib_offset;
|
||||
Assert(raw_position == cb->raw_position);
|
||||
int raw_position;
|
||||
raw_position = ftell(cb->fp) - cb->lib_offset;
|
||||
Assert(raw_position == cb->raw_position);
|
||||
#endif
|
||||
|
||||
if (cb->raw_position >= cb->size ) {
|
||||
@@ -182,8 +202,9 @@ int cftell( CFILE * cfile )
|
||||
Assert(cb->fp != NULL);
|
||||
|
||||
#if defined(CHECK_POSITION) && !defined(NDEBUG)
|
||||
int raw_position = ftell(cb->fp) - cb->lib_offset;
|
||||
Assert(raw_position == cb->raw_position);
|
||||
int raw_position;
|
||||
raw_position = ftell(cb->fp) - cb->lib_offset;
|
||||
Assert(raw_position == cb->raw_position);
|
||||
#endif
|
||||
|
||||
return cb->raw_position;
|
||||
@@ -231,7 +252,8 @@ int cfseek( CFILE *cfile, int offset, int where )
|
||||
cb->raw_position = goal_position - cb->lib_offset;
|
||||
|
||||
#if defined(CHECK_POSITION) && !defined(NDEBUG)
|
||||
int tmp_offset = ftell(cb->fp) - cb->lib_offset;
|
||||
int tmp_offset;
|
||||
tmp_offset = (int)ftell(cb->fp) - cb->lib_offset;
|
||||
Assert(tmp_offset==cb->raw_position);
|
||||
#endif
|
||||
|
||||
@@ -277,7 +299,8 @@ int cfread(void *buf, int elsize, int nelem, CFILE *cfile)
|
||||
}
|
||||
|
||||
#if defined(CHECK_POSITION) && !defined(NDEBUG)
|
||||
int tmp_offset = ftell(cb->fp) - cb->lib_offset;
|
||||
int tmp_offset;
|
||||
tmp_offset = ftell(cb->fp) - cb->lib_offset;
|
||||
Assert(tmp_offset==cb->raw_position);
|
||||
#endif
|
||||
|
||||
|
||||
@@ -9,14 +9,20 @@
|
||||
|
||||
/*
|
||||
* $Logfile: /Freespace2/code/CFile/CfileArchive.h $
|
||||
* $Revision: 2.1 $
|
||||
* $Date: 2002-07-07 19:55:58 $
|
||||
* $Author: penguin $
|
||||
* $Revision: 2.3 $
|
||||
* $Date: 2005-07-13 02:50:49 $
|
||||
* $Author: Goober5000 $
|
||||
*
|
||||
* External def's for CfileArchive.cpp. This should only be used
|
||||
* internally by cfile stuff.
|
||||
*
|
||||
* $Log: not supported by cvs2svn $
|
||||
* Revision 2.2 2004/08/11 05:06:19 Kazan
|
||||
* added preprocdefines.h to prevent what happened with fred -- make sure to make all fred2 headers include this file as the _first_ include -- i have already modified fs2 files to do this
|
||||
*
|
||||
* Revision 2.1 2002/07/07 19:55:58 penguin
|
||||
* Back-port to MSVC
|
||||
*
|
||||
* Revision 2.0 2002/06/03 04:02:21 penguin
|
||||
* Warpcore CVS sync
|
||||
*
|
||||
|
||||
@@ -9,13 +9,25 @@
|
||||
|
||||
/*
|
||||
* $Logfile: /Freespace2/code/CFile/CfileList.cpp $
|
||||
* $Revision: 2.2 $
|
||||
* $Date: 2002-08-01 01:41:04 $
|
||||
* $Author: penguin $
|
||||
* $Revision: 2.6 $
|
||||
* $Date: 2005-01-31 23:27:51 $
|
||||
* $Author: taylor $
|
||||
*
|
||||
* Code for doing directory lists and sorts
|
||||
*
|
||||
* $Log: not supported by cvs2svn $
|
||||
* Revision 2.5 2004/07/26 20:47:25 Kazan
|
||||
* remove MCD complete
|
||||
*
|
||||
* Revision 2.4 2004/07/17 09:26:00 taylor
|
||||
* add CF_SORT_REVERSE to real sort routine, makes CF_SORT_TIME work again
|
||||
*
|
||||
* Revision 2.3 2004/07/12 16:32:42 Kazan
|
||||
* MCD - define _MCD_CHECK to use memory tracking
|
||||
*
|
||||
* Revision 2.2 2002/08/01 01:41:04 penguin
|
||||
* The big include file move
|
||||
*
|
||||
* Revision 2.1 2002/07/29 19:37:21 penguin
|
||||
* added #ifdef _WIN32 around windows-specific system headers
|
||||
*
|
||||
@@ -74,6 +86,9 @@
|
||||
#include "globalincs/pstypes.h"
|
||||
#include "cfile/cfile.h"
|
||||
|
||||
|
||||
|
||||
|
||||
// Sorts a list of filenames using the specified sorting method (CF_SORT_*).
|
||||
// n = number of filenames in list to sort
|
||||
// list = list of filenames to be sorted
|
||||
@@ -141,6 +156,22 @@ void cf_sort_filenames( int n, char **list, int sort, file_list_info *info )
|
||||
incr /= 2;
|
||||
}
|
||||
|
||||
return;
|
||||
|
||||
} else if (sort == CF_SORT_REVERSE) {
|
||||
incr = n / 2;
|
||||
char buffer[MAX_FILENAME_LEN];
|
||||
|
||||
for (i = 0; i < incr; i++) {
|
||||
t = list[n - 1 - i];
|
||||
|
||||
if ( stricmp(list[i], t) > 0 ) {
|
||||
strcpy(buffer, list[i]);
|
||||
strcpy(list[i], t);
|
||||
strcpy(t, buffer);
|
||||
}
|
||||
}
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -148,6 +179,8 @@ void cf_sort_filenames( int n, char **list, int sort, file_list_info *info )
|
||||
}
|
||||
|
||||
|
||||
#if (0) // these aren't used anywhere now
|
||||
|
||||
// cf_compress - Do Run Length Compression on a block of data. Targa format.
|
||||
//
|
||||
// Usage:
|
||||
@@ -317,6 +350,8 @@ int cf_decompress(char *out, char *in )
|
||||
|
||||
}
|
||||
|
||||
#endif // 0
|
||||
|
||||
|
||||
// cfread() reads from a file and decompresses it
|
||||
//
|
||||
|
||||
+551
-222
File diff suppressed because it is too large.
Load diff
@@ -9,9 +9,9 @@
|
||||
|
||||
/*
|
||||
* $Logfile: /Freespace2/code/CFile/CfileSystem.h $
|
||||
* $Revision: 2.0 $
|
||||
* $Date: 2002-06-03 04:02:21 $
|
||||
* $Author: penguin $
|
||||
* $Revision: 2.3 $
|
||||
* $Date: 2005-07-13 02:50:49 $
|
||||
* $Author: Goober5000 $
|
||||
*
|
||||
* Functions to keep track of and find files that can exist
|
||||
* on the harddrive, cd-rom, or in a pack file on either of those.
|
||||
@@ -20,6 +20,16 @@
|
||||
* all those locations, inherently enforcing precedence orders.
|
||||
*
|
||||
* $Log: not supported by cvs2svn $
|
||||
* Revision 2.2 2004/08/11 05:06:19 Kazan
|
||||
* added preprocdefines.h to prevent what happened with fred -- make sure to make all fred2 headers include this file as the _first_ include -- i have already modified fs2 files to do this
|
||||
*
|
||||
* Revision 2.1 2004/03/05 09:01:54 Goober5000
|
||||
* Uber pass at reducing #includes
|
||||
* --Goober5000
|
||||
*
|
||||
* Revision 2.0 2002/06/03 04:02:21 penguin
|
||||
* Warpcore CVS sync
|
||||
*
|
||||
* Revision 1.1 2002/05/02 18:03:04 mharris
|
||||
* Initial checkin - converted filenames and includes to lower case
|
||||
*
|
||||
@@ -46,6 +56,8 @@
|
||||
#ifndef _CFILESYSTEM_H
|
||||
#define _CFILESYSTEM_H
|
||||
|
||||
#include "cfile/cfile.h"
|
||||
|
||||
// Builds a list of all the files
|
||||
void cf_build_secondary_filelist( char *cdrom_path );
|
||||
void cf_free_secondary_filelist();
|
||||
|
||||
@@ -9,13 +9,23 @@
|
||||
|
||||
/*
|
||||
* $Logfile: /Freespace2/code/Cfilearchiver/CfileArchiver.cpp $
|
||||
* $Revision: 2.0 $
|
||||
* $Date: 2002-06-03 04:02:21 $
|
||||
* $Author: penguin $
|
||||
* $Revision: 2.3 $
|
||||
* $Date: 2005-09-08 00:09:31 $
|
||||
* $Author: taylor $
|
||||
*
|
||||
* Program to create an archive file for use with cfile stuff
|
||||
*
|
||||
* $Log: not supported by cvs2svn $
|
||||
* Revision 2.2 2005/01/30 12:50:08 taylor
|
||||
* merge with Linux/OSX tree - p0130
|
||||
*
|
||||
* Revision 2.1 2003/11/16 09:42:37 Goober5000
|
||||
* clarified and pruned debug spew messages
|
||||
* --Goober5000
|
||||
*
|
||||
* Revision 2.0 2002/06/03 04:02:21 penguin
|
||||
* Warpcore CVS sync
|
||||
*
|
||||
* Revision 1.1 2002/05/02 18:03:04 mharris
|
||||
* Initial checkin - converted filenames and includes to lower case
|
||||
*
|
||||
@@ -27,15 +37,28 @@
|
||||
|
||||
#include <stdlib.h>
|
||||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
#ifdef _WIN32
|
||||
#include <direct.h>
|
||||
#include <io.h>
|
||||
#include <string.h>
|
||||
#include <conio.h>
|
||||
#else
|
||||
#include <dirent.h>
|
||||
#include <unistd.h>
|
||||
#include <sys/stat.h>
|
||||
#include <sys/types.h>
|
||||
#endif
|
||||
|
||||
#include "globalincs/pstypes.h"
|
||||
#include "cfile/cfile.h"
|
||||
|
||||
static int data_error;
|
||||
static int no_dir;
|
||||
|
||||
unsigned int Total_size=16; // Start with size of header
|
||||
unsigned int Num_files =0;
|
||||
FILE * fp_out = NULL;
|
||||
FILE * fp_out_hdr = NULL;
|
||||
FILE *fp_out = NULL;
|
||||
FILE *fp_out_hdr = NULL;
|
||||
|
||||
typedef struct vp_header {
|
||||
char id[4];
|
||||
@@ -79,7 +102,7 @@ int write_index(char *hf, char *df)
|
||||
return 1;
|
||||
}
|
||||
|
||||
void pack_file( char *filespec, char *filename, int filesize, time_t time_write )
|
||||
void pack_file( char *filespec, char *filename, int filesize, _fs_time_t time_write )
|
||||
{
|
||||
char path[1024];
|
||||
|
||||
@@ -107,13 +130,15 @@ void pack_file( char *filespec, char *filename, int filesize, time_t time_write
|
||||
fwrite( &Total_size, 1, 4, fp_out_hdr );
|
||||
fwrite( &filesize, 1, 4, fp_out_hdr );
|
||||
fwrite( &path, 1, 32, fp_out_hdr );
|
||||
fwrite( &time_write, 1, sizeof(time_t), fp_out_hdr);
|
||||
fwrite( &time_write, 1, sizeof(_fs_time_t), fp_out_hdr);
|
||||
|
||||
Total_size += filesize;
|
||||
Num_files++;
|
||||
printf( "Packing %s\\%s...", filespec, filename );
|
||||
|
||||
sprintf( path, "%s\\%s", filespec, filename );
|
||||
printf( "Packing %s%s%s...", filespec, DIR_SEPARATOR_STR, filename );
|
||||
|
||||
sprintf( path, "%s%s%s", filespec, DIR_SEPARATOR_STR, filename );
|
||||
|
||||
|
||||
FILE *fp = fopen( path, "rb" );
|
||||
|
||||
@@ -150,7 +175,7 @@ void add_directory( char * dirname)
|
||||
int i = 0;
|
||||
fwrite(&i, 1, 4, fp_out_hdr);
|
||||
// strip out any directories that this dir is a subdir of
|
||||
while ((tmpptr = strchr(pathptr, '\\')) != NULL) {
|
||||
while ((tmpptr = strchr(pathptr, DIR_SEPARATOR_CHAR)) != NULL) {
|
||||
pathptr = tmpptr+1;
|
||||
}
|
||||
fwrite(pathptr, 1, 32, fp_out_hdr);
|
||||
@@ -160,8 +185,10 @@ void add_directory( char * dirname)
|
||||
|
||||
void pack_directory( char * filespec)
|
||||
{
|
||||
#ifdef _WIN32
|
||||
int find_handle;
|
||||
_finddata_t find;
|
||||
#endif
|
||||
char tmp[512];
|
||||
char tmp1[512];
|
||||
|
||||
@@ -181,12 +208,21 @@ void pack_directory( char * filespec)
|
||||
}
|
||||
*/
|
||||
|
||||
char *ts;
|
||||
|
||||
// strip trailing slash
|
||||
ts = filespec+(strlen(filespec)-1);
|
||||
while(*ts == DIR_SEPARATOR_CHAR && ts > filespec)
|
||||
*ts = '\0';
|
||||
|
||||
strcpy( tmp1, filespec );
|
||||
|
||||
add_directory(filespec);
|
||||
strcat( tmp1, "\\*.*" );
|
||||
strcat( tmp1, DIR_SEPARATOR_STR"*.*" );
|
||||
|
||||
printf( "In dir '%s'\n", tmp1 );
|
||||
|
||||
#ifdef _WIN32
|
||||
find_handle = _findfirst( tmp1, &find );
|
||||
if( find_handle != -1 ) {
|
||||
if ( find.attrib & _A_SUBDIR ) {
|
||||
@@ -214,10 +250,95 @@ void pack_directory( char * filespec)
|
||||
}
|
||||
}
|
||||
}
|
||||
#else
|
||||
DIR *dirp;
|
||||
struct dirent *dir;
|
||||
|
||||
dirp = opendir (filespec);
|
||||
if ( dirp ) {
|
||||
while ((dir = readdir(dirp)) != NULL) {
|
||||
|
||||
char fn[MAX_PATH];
|
||||
snprintf(fn, MAX_PATH-1, "%s/%s", filespec, dir->d_name);
|
||||
fn[MAX_PATH-1] = 0;
|
||||
|
||||
struct stat buf;
|
||||
if (stat(fn, &buf) == -1) {
|
||||
continue;
|
||||
}
|
||||
|
||||
if ( (strcmp(dir->d_name, ".") == 0) || (strcmp(dir->d_name, "..") == 0) ) {
|
||||
continue;
|
||||
}
|
||||
|
||||
if (S_ISDIR(buf.st_mode)) {
|
||||
strcpy( tmp, filespec );
|
||||
strcat( tmp, "/" );
|
||||
strcat( tmp, dir->d_name );
|
||||
pack_directory(tmp);
|
||||
} else {
|
||||
pack_file( filespec, dir->d_name, buf.st_size, buf.st_mtime );
|
||||
}
|
||||
}
|
||||
closedir(dirp);
|
||||
} else {
|
||||
printf("Error: Source directory does not exist!\n");
|
||||
no_dir = 1;
|
||||
}
|
||||
#endif
|
||||
add_directory("..");
|
||||
}
|
||||
|
||||
int verify_directory( char *filespec )
|
||||
{
|
||||
char *ts;
|
||||
char *dd;
|
||||
|
||||
// strip trailing '/'
|
||||
ts = filespec+(strlen(filespec)-1);
|
||||
while(*ts == DIR_SEPARATOR_CHAR && ts > filespec)
|
||||
*ts = '\0';
|
||||
|
||||
// make sure last directory is named "data", ignoring case
|
||||
dd = filespec+(strlen(filespec)-4);
|
||||
if ( stricmp( dd, "data" ) )
|
||||
data_error = 1;
|
||||
|
||||
return data_error;
|
||||
}
|
||||
|
||||
void print_instructions()
|
||||
{
|
||||
printf( "Creates a vp archive out of a FreeSpace data tree.\n\n" );
|
||||
printf( "Usage: cfilearchiver archive_name src_dir\n");
|
||||
printf( "Example: cfilearchiver freespace /tmp/freespace/data\n\n");
|
||||
printf( "Directory structure options:\n" );
|
||||
printf( " Effects (.ani .pcx .neb .tga)\n" );
|
||||
printf( " Fonts (.vf)\n" );
|
||||
printf( " Hud (.ani .pcx .tga\n" );
|
||||
printf( " Interface (.pcx .ani .tga)\n" );
|
||||
printf( " Maps (.pcx .ani .tga)\n" );
|
||||
printf( " Missions (.ntl .ssv), FS1(.fsm .fsc), FS2(.fs2 .fc2)\n" );
|
||||
printf( " Models (.pof)\n" );
|
||||
printf( " Music (.wav)\n" );
|
||||
printf( " Sounds/8b22k (.wav)\n" );
|
||||
printf( " Sounds/16b11k (.wav)\n" );
|
||||
printf( " Tables (.tbl)\n" );
|
||||
printf( " Voice/Briefing (.wav)\n" );
|
||||
printf( " Voice/Command briefings (.wav)\n" );
|
||||
printf( " Voice/Debriefing (.wav)\n" );
|
||||
printf( " Voice/Personas (.wav)\n" );
|
||||
printf( " Voice/Special (.wav)\n" );
|
||||
printf( " Voice/Training (.wav)\n" );
|
||||
|
||||
exit(0);
|
||||
}
|
||||
|
||||
// we end up #include'ing SDL.h which on Windows and Mac will redfine main() which is something
|
||||
// that we don't want since we don't actually link against SDL, this solves the problem...
|
||||
#ifdef main
|
||||
#undef main
|
||||
#endif
|
||||
|
||||
int main(int argc, char *argv[] )
|
||||
{
|
||||
@@ -225,12 +346,16 @@ int main(int argc, char *argv[] )
|
||||
char *p;
|
||||
|
||||
if ( argc < 3 ) {
|
||||
#ifdef _WIN32
|
||||
printf( "Usage: %s archive_name src_dir\n", argv[0] );
|
||||
printf( "Example: %s freespace c:\\freespace\\data\n", argv[0] );
|
||||
printf( "Creates an archive named freespace out of the\nfreespace data tree\n" );
|
||||
printf( "Press any key to exit...\n" );
|
||||
getch();
|
||||
return 1;
|
||||
#else
|
||||
print_instructions();
|
||||
#endif
|
||||
}
|
||||
|
||||
strcpy( archive, argv[1] );
|
||||
@@ -246,23 +371,40 @@ int main(int argc, char *argv[] )
|
||||
fp_out = fopen( archive_dat, "wb" );
|
||||
if ( !fp_out ) {
|
||||
printf( "Couldn't open '%s'!\n", archive_dat );
|
||||
#ifdef _WIN32
|
||||
printf( "Press any key to exit...\n" );
|
||||
getch();
|
||||
return 1;
|
||||
#else
|
||||
exit(1);
|
||||
#endif
|
||||
}
|
||||
|
||||
fp_out_hdr = fopen( archive_hdr, "wb" );
|
||||
if ( !fp_out_hdr ) {
|
||||
printf( "Couldn't open '%s'!\n", archive_hdr );
|
||||
#ifdef _WIN32
|
||||
printf( "Press any key to exit...\n" );
|
||||
getch();
|
||||
return 1;
|
||||
#else
|
||||
exit(2);
|
||||
#endif
|
||||
}
|
||||
|
||||
if ( verify_directory( argv[2] ) != 0 ) {
|
||||
printf("Warning! Last directory must be named \"data\" (not case sensitive)\n");
|
||||
exit(3);
|
||||
}
|
||||
|
||||
write_header();
|
||||
|
||||
pack_directory( argv[2] );
|
||||
|
||||
// in case the directory doesn't exist
|
||||
if ( no_dir )
|
||||
exit(4);
|
||||
|
||||
write_header();
|
||||
|
||||
fclose(fp_out);
|
||||
@@ -272,8 +414,10 @@ int main(int argc, char *argv[] )
|
||||
|
||||
if (!write_index(archive_hdr, archive_dat)) {
|
||||
printf("Error appending index!\n");
|
||||
#ifdef _WIN32
|
||||
printf("Press any key to exit...\n");
|
||||
getch();
|
||||
#endif
|
||||
return 1;
|
||||
}
|
||||
|
||||
|
||||
@@ -0,0 +1,476 @@
|
||||
/*
|
||||
* Copyright (C) 2005 Taylor Richards
|
||||
*
|
||||
*/
|
||||
|
||||
/*
|
||||
* $Logfile: /Freespace2/code/cfileextractor/cfileextractor.cpp $
|
||||
* $Revision: 1.6 $
|
||||
* $Date: 2005-09-08 05:04:15 $
|
||||
* $Author: taylor $
|
||||
*
|
||||
* Cross-platform cmdline extractor for VP files
|
||||
*
|
||||
* $Log: not supported by cvs2svn $
|
||||
* Revision 1.5 2005/09/08 00:09:31 taylor
|
||||
* fix building/linking of command line tools under Linux/OSX
|
||||
* add tools as targets to OSX project file
|
||||
*
|
||||
* Revision 1.4 2005/05/24 20:52:10 taylor
|
||||
* make sure that we recursively create directories for Linux/OSX
|
||||
* replace older recursive mkdir method in cfileextractor with new method
|
||||
*
|
||||
* Revision 1.3 2005/05/24 03:12:27 taylor
|
||||
* get command sanity check right, fixes lowercase on extract too
|
||||
*
|
||||
* Revision 1.2 2005/05/18 01:57:54 taylor
|
||||
* a few help text adjustments and fix some compiler warnings
|
||||
*
|
||||
* Revision 1.1 2005/05/17 21:00:57 taylor
|
||||
* Initial import of cfileextractor, still needs some work but does what it needs to
|
||||
*
|
||||
*
|
||||
* $NoKeywords: $
|
||||
*/
|
||||
|
||||
#include <vector>
|
||||
#include <iostream>
|
||||
#include <cstdlib>
|
||||
#include <cstdio>
|
||||
#include <cstring>
|
||||
#include <ctime>
|
||||
|
||||
#ifdef _WIN32
|
||||
#include <direct.h>
|
||||
#else
|
||||
#include <unistd.h>
|
||||
#endif
|
||||
|
||||
#include <sys/stat.h>
|
||||
#include <sys/types.h>
|
||||
#include <errno.h>
|
||||
|
||||
#include "globalincs/pstypes.h"
|
||||
#include "cfile/cfile.h"
|
||||
|
||||
|
||||
// /////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// GLOBAL FUNCTIONS AND VARIABLES
|
||||
//
|
||||
|
||||
// right out of pstypes.h but we don't want to use the INTEL_INT macro here
|
||||
// since it would require SDL which isn't used on WIN32 platforms
|
||||
#if BYTE_ORDER == BIG_ENDIAN
|
||||
#define INT_SWAP(x) ( \
|
||||
(x << 24) | \
|
||||
(((ulong)x) >> 24) | \
|
||||
((x & 0x0000ff00) << 8) | \
|
||||
((x & 0x00ff0000) >> 8) \
|
||||
)
|
||||
#else
|
||||
#define INT_SWAP(x) (x)
|
||||
#endif
|
||||
|
||||
FILE *fp_in = NULL;
|
||||
FILE *fp_out = NULL;
|
||||
|
||||
#define BLOCK_SIZE (1024*1024)
|
||||
|
||||
char tmp_data[BLOCK_SIZE]; // 1 MB
|
||||
|
||||
static int have_index = 0;
|
||||
static int have_header = 0;
|
||||
|
||||
#define ERR_NO_FP_IN 0
|
||||
#define ERR_NO_FP_OUT 1
|
||||
#define ERR_INVALID_VP 2
|
||||
#define ERR_NO_INDEX 3
|
||||
#define ERR_NO_HEADER 4
|
||||
|
||||
typedef struct vp_header {
|
||||
char id[4]; // 'VPVP'
|
||||
int version;
|
||||
int index_offset; // offset where the file index starts, also a total file data size count
|
||||
int num_files; // number of files, including each step in the directory structure
|
||||
} vp_header;
|
||||
|
||||
vp_header VP_Header;
|
||||
|
||||
typedef struct vp_fileinfo {
|
||||
// stuff that is actually written to the VP
|
||||
int offset; // offset of where this file is in the VP
|
||||
int file_size; // size of file
|
||||
char file_name[CF_MAX_FILENAME_LENGTH]; // filename
|
||||
_fs_time_t write_time; // date/time in _fs_time_t type (a 32-bit version of time_t)
|
||||
|
||||
// not in the VP
|
||||
char file_path[CF_MAX_PATHNAME_LENGTH]; // file path, generated here and not actually in the VP on a per file basis
|
||||
|
||||
vp_fileinfo() {
|
||||
offset = 0;
|
||||
file_size = 0;
|
||||
file_name[0] = '\0';
|
||||
file_path[0] = '\0';
|
||||
write_time = 0;
|
||||
}
|
||||
|
||||
~vp_fileinfo() {}
|
||||
} vp_fileinfo;
|
||||
|
||||
std::vector<vp_fileinfo> VP_FileInfo;
|
||||
|
||||
// just like strlwr() but without actually including it here
|
||||
void lowercase(char *s)
|
||||
{
|
||||
if (s == NULL)
|
||||
return;
|
||||
|
||||
while (*s) {
|
||||
*s = tolower(*s);
|
||||
s++;
|
||||
}
|
||||
}
|
||||
|
||||
//
|
||||
// /////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
// /////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// The useful stuff...
|
||||
//
|
||||
|
||||
void print_error(int err)
|
||||
{
|
||||
switch (err) {
|
||||
case ERR_NO_FP_IN:
|
||||
printf("ERROR: The input file (fp_in) is NULL! Exiting...\n");
|
||||
break;
|
||||
case ERR_NO_FP_OUT:
|
||||
printf("ERROR: The output file (fp_out) is NULL! Exiting...\n");
|
||||
break;
|
||||
case ERR_INVALID_VP:
|
||||
printf("ERROR: The specified VP file is invalid! Exiting...\n");
|
||||
break;
|
||||
case ERR_NO_INDEX:
|
||||
printf("ERROR: No file index is available! Exiting...\n");
|
||||
break;
|
||||
case ERR_NO_HEADER:
|
||||
printf("ERROR: No file header is available! Exiting...\n");
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
exit(1);
|
||||
}
|
||||
|
||||
void read_header()
|
||||
{
|
||||
fseek(fp_in, 0, SEEK_SET);
|
||||
fread(&VP_Header.id, 1, 4, fp_in);
|
||||
fread(&VP_Header.version, 1, sizeof(int), fp_in);
|
||||
fread(&VP_Header.index_offset, 1, sizeof(int), fp_in);
|
||||
fread(&VP_Header.num_files, 1, sizeof(int), fp_in);
|
||||
|
||||
VP_Header.version = INT_SWAP(VP_Header.version);
|
||||
VP_Header.index_offset = INT_SWAP(VP_Header.index_offset);
|
||||
VP_Header.num_files = INT_SWAP(VP_Header.num_files);
|
||||
|
||||
// check for a valid id (VPVP)
|
||||
if ( (VP_Header.id[0] != 'V') && (VP_Header.id[1] != 'P') && (VP_Header.id[2] != 'V') && (VP_Header.id[3] != 'P') )
|
||||
print_error(ERR_INVALID_VP);
|
||||
|
||||
// the index_offset needs to be greater than the size of vp_header at the very least and there should be at least one file
|
||||
if ( !(VP_Header.index_offset > (int)sizeof(vp_header)) || !(VP_Header.num_files > 1) )
|
||||
print_error(ERR_INVALID_VP);
|
||||
|
||||
|
||||
have_header = 1;
|
||||
}
|
||||
|
||||
void read_index(int lc = 0)
|
||||
{
|
||||
if (fp_in == NULL)
|
||||
print_error(ERR_NO_FP_IN);
|
||||
else if (!have_header)
|
||||
print_error(ERR_NO_HEADER);
|
||||
|
||||
int i;
|
||||
char path[CF_MAX_PATHNAME_LENGTH];
|
||||
|
||||
fseek(fp_in, VP_Header.index_offset, SEEK_SET);
|
||||
|
||||
memset(path, 0, CF_MAX_PATHNAME_LENGTH);
|
||||
|
||||
for ( i = 0; i < VP_Header.num_files; i++) {
|
||||
vp_fileinfo vpinfo;
|
||||
|
||||
fread(&vpinfo.offset, 1, sizeof(int), fp_in);
|
||||
fread(&vpinfo.file_size, 1, sizeof(int), fp_in);
|
||||
fread(&vpinfo.file_name, 1, CF_MAX_FILENAME_LENGTH, fp_in);
|
||||
fread(&vpinfo.write_time, 1, sizeof(_fs_time_t), fp_in);
|
||||
|
||||
vpinfo.offset = INT_SWAP(vpinfo.offset);
|
||||
vpinfo.file_size = INT_SWAP(vpinfo.file_size);
|
||||
vpinfo.write_time = INT_SWAP(vpinfo.write_time);
|
||||
|
||||
// check if it's a directory and if so then create a path to use for files
|
||||
if (vpinfo.file_size == 0) {
|
||||
// if we get a ".." then drop down in the path
|
||||
if (!strcmp(vpinfo.file_name, "..")) {
|
||||
char *s = strrchr(path, DIR_SEPARATOR_CHAR);
|
||||
|
||||
if (s)
|
||||
*s = '\0';
|
||||
|
||||
// skip, we don't want to add the ".." to the path
|
||||
continue;
|
||||
}
|
||||
|
||||
// don't add the very first directory separator character, easier to clean later
|
||||
if (path[0] != 0)
|
||||
strcat( path, DIR_SEPARATOR_STR );
|
||||
|
||||
// always make directory names lower case for ease of use
|
||||
lowercase( vpinfo.file_name );
|
||||
|
||||
strcat( path, vpinfo.file_name );
|
||||
} // it's a file then
|
||||
else {
|
||||
// lowercase the filename if wanted
|
||||
if (lc == 1)
|
||||
lowercase( vpinfo.file_name );
|
||||
|
||||
strcpy( vpinfo.file_path, path );
|
||||
VP_FileInfo.push_back(vpinfo);
|
||||
}
|
||||
}
|
||||
|
||||
have_index = 1;
|
||||
}
|
||||
|
||||
void extract_all_files(char *file)
|
||||
{
|
||||
if (fp_in == NULL)
|
||||
print_error(ERR_NO_FP_IN);
|
||||
else if (!have_header)
|
||||
print_error(ERR_NO_HEADER);
|
||||
else if (!have_index)
|
||||
print_error(ERR_NO_INDEX);
|
||||
|
||||
int status, m_error, nbytes, nbytes_remaining;
|
||||
char path[CF_MAX_PATHNAME_LENGTH+CF_MAX_FILENAME_LENGTH+1]; // path length + filename length + extra NULL
|
||||
char *c;
|
||||
|
||||
printf("VP file extractor - version 0.01\n");
|
||||
printf("\n");
|
||||
printf("Extracting: %s...\n", file);
|
||||
|
||||
for (uint i = 0; i < VP_FileInfo.size(); i++) {
|
||||
// save the file path to a temp location and recursively make the needed directories
|
||||
sprintf(path, "%s%s", VP_FileInfo[i].file_path, DIR_SEPARATOR_STR);
|
||||
|
||||
c = &path[0];
|
||||
|
||||
while (c++) {
|
||||
c = strchr(c, DIR_SEPARATOR_CHAR);
|
||||
|
||||
if (c) {
|
||||
*c = '\0'; // NULL at DIR_SEP char
|
||||
|
||||
#ifdef _WIN32
|
||||
status = _mkdir(path);
|
||||
#else
|
||||
status = mkdir(path, 0777);
|
||||
#endif
|
||||
|
||||
m_error = errno;
|
||||
|
||||
if (status && (m_error != EEXIST) ) {
|
||||
printf("Cannot mkdir %s: %s\n", VP_FileInfo[i].file_path, strerror(m_error));
|
||||
continue;
|
||||
}
|
||||
|
||||
*c = DIR_SEPARATOR_CHAR; // replace DIR_SEP char
|
||||
}
|
||||
}
|
||||
|
||||
// start writing out the file
|
||||
fseek(fp_in, VP_FileInfo[i].offset, SEEK_SET);
|
||||
|
||||
sprintf(path, "%s%s%s", VP_FileInfo[i].file_path, DIR_SEPARATOR_STR, VP_FileInfo[i].file_name);
|
||||
fp_out = fopen(path, "wb");
|
||||
|
||||
printf(" %s ... ", path);
|
||||
|
||||
if (fp_out == NULL) {
|
||||
printf("can't create file!\n");
|
||||
continue;
|
||||
}
|
||||
|
||||
nbytes_remaining = VP_FileInfo[i].file_size;
|
||||
|
||||
while ( nbytes_remaining > 0 ) {
|
||||
nbytes = fread( tmp_data, 1, MIN(BLOCK_SIZE, nbytes_remaining), fp_in );
|
||||
|
||||
if (nbytes > 0) {
|
||||
fwrite( tmp_data, 1, nbytes, fp_out );
|
||||
nbytes_remaining -= nbytes;
|
||||
}
|
||||
}
|
||||
|
||||
printf("done!\n");
|
||||
|
||||
fclose(fp_out);
|
||||
fp_out = NULL;
|
||||
}
|
||||
|
||||
printf("\n");
|
||||
}
|
||||
|
||||
// TODO: the formatting of this is a bit loco but I don't care enough to make it better...
|
||||
void list_all_files(char *file)
|
||||
{
|
||||
char out_time[20];
|
||||
float one_k = 1024.0f;
|
||||
float one_m = 1048576.0f;
|
||||
char m;
|
||||
float div_by;
|
||||
time_t plat_time;
|
||||
|
||||
// if we don't have an index then bail
|
||||
if (!have_index)
|
||||
print_error(ERR_NO_INDEX);
|
||||
|
||||
|
||||
printf("VP file extractor - version 0.01\n");
|
||||
printf("\n");
|
||||
printf("%s:\n", file);
|
||||
printf("\n");
|
||||
|
||||
printf(" Name Size Offset Date/Time Path\n");
|
||||
printf("-------------------------------------------------------------------------------\n");
|
||||
for (uint i = 0; i < VP_FileInfo.size(); i++) {
|
||||
plat_time = VP_FileInfo[i].write_time; // gets rid of some platform strangeness this way
|
||||
strftime(out_time, 32, "%F %H:%M", localtime(&plat_time)); // YYYY-mm-dd HH:mm (ISO 8601 date format, 24-hr time)
|
||||
|
||||
if (VP_FileInfo[i].file_size > (int)one_m) {
|
||||
m = 'M';
|
||||
div_by = one_m;
|
||||
} else {
|
||||
m = 'K';
|
||||
div_by = one_k;
|
||||
}
|
||||
|
||||
int len = strlen( VP_FileInfo[i].file_name );
|
||||
printf("%s %*.1f%c %10i %18s %3s%s\n", VP_FileInfo[i].file_name, 33 - len, (float)VP_FileInfo[i].file_size/div_by, m, VP_FileInfo[i].offset, out_time, DIR_SEPARATOR_STR, VP_FileInfo[i].file_path);
|
||||
}
|
||||
|
||||
printf("\n");
|
||||
|
||||
// we use the vector size here since VP_Header.num_files would include each entry
|
||||
// in the directory tree as well as individual files and that artificially inflates
|
||||
// the number of files that we show or would extract
|
||||
printf("Total files: %i\n", (int)VP_FileInfo.size());
|
||||
|
||||
// yeah, I'm just that cheap
|
||||
if (VP_Header.index_offset > (int)one_m) {
|
||||
m = 'M';
|
||||
div_by = one_m;
|
||||
} else {
|
||||
m = 'K';
|
||||
div_by = one_k;
|
||||
}
|
||||
|
||||
printf("Total size: %.1f%c\n", (float)VP_Header.index_offset/div_by, m);
|
||||
|
||||
printf("\n");
|
||||
}
|
||||
|
||||
void help()
|
||||
{
|
||||
printf("VP file extractor - version 0.5\n");
|
||||
printf("\n");
|
||||
printf("Usage: cfileextractor [-x | -l] [-L] <vp_filename>\n");
|
||||
printf("\n");
|
||||
printf(" Commands (only one at the time):\n");
|
||||
printf(" -x | --extract Extract all files into current directory.\n");
|
||||
printf(" -l | --list List all files in VP archive.\n");
|
||||
printf(" -h | --help Show this help text.\n");
|
||||
printf("\n");
|
||||
printf(" Options:\n");
|
||||
printf(" -L | --lowercase Force all filenames to be lower case.\n");
|
||||
printf("\n");
|
||||
printf(" (No command specified will list all files in the VP archive.)\n");
|
||||
printf("\n");
|
||||
}
|
||||
|
||||
// we end up #include'ing SDL.h which on Windows and Mac will redfine main() which is something
|
||||
// that we don't want since we don't actually link against SDL, this solves the problem...
|
||||
#ifdef main
|
||||
#undef main
|
||||
#endif
|
||||
|
||||
int main(int argc, char *argv[])
|
||||
{
|
||||
int extract = 0, lc = 0, list = 0;
|
||||
|
||||
if (argc < 2) {
|
||||
help();
|
||||
return 0;
|
||||
}
|
||||
|
||||
if (!strcmp(argv[1], "-h") || !strcmp(argv[1], "--help")) {
|
||||
help();
|
||||
return 0;
|
||||
}
|
||||
|
||||
// the last option should always be the VP file that we want
|
||||
fp_in = fopen(argv[argc-1], "rb");
|
||||
|
||||
if (fp_in == NULL)
|
||||
print_error(ERR_NO_FP_IN);
|
||||
|
||||
// if the header is invalid then read_header() should exit us out
|
||||
read_header();
|
||||
|
||||
// TODO: add filter based extraction
|
||||
for (int i = 1; i < argc-1; i++) {
|
||||
if (!strcmp(argv[i], "-x") || !strcmp(argv[i], "--extract")) {
|
||||
if (list) {
|
||||
help();
|
||||
exit(0);
|
||||
}
|
||||
extract = 1;
|
||||
} else if (!strcmp(argv[i], "-L") || !strcmp(argv[i], "--lowercase")) {
|
||||
lc = 1;
|
||||
} else if (!strcmp(argv[i], "-l") || !strcmp(argv[i], "--list")) {
|
||||
if (extract) {
|
||||
help();
|
||||
exit(0);
|
||||
}
|
||||
list = 1;
|
||||
} else {
|
||||
help();
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
||||
// read the file index, make all filenames lowercase if wanted
|
||||
read_index( lc );
|
||||
|
||||
if (extract) {
|
||||
extract_all_files( argv[argc-1] );
|
||||
return 0;
|
||||
} else if (list) {
|
||||
list_all_files( argv[argc-1] );
|
||||
return 0;
|
||||
} else {
|
||||
// if only -L is specified or no command is specified then just list files
|
||||
list_all_files( argv[argc-1] );
|
||||
return 0;
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
+1545
-53
File diff suppressed because it is too large.
Load diff
@@ -5,15 +5,336 @@
|
||||
* or otherwise commercially exploit the source or things you created based on the
|
||||
* source.
|
||||
*
|
||||
|
||||
*/
|
||||
|
||||
/*
|
||||
* $Logfile: /Freespace2/code/Cmdline/cmdline.h $
|
||||
* $Revision: 2.3 $
|
||||
* $Date: 2002-08-07 00:44:13 $
|
||||
* $Author: DTP $
|
||||
|
||||
* $Revision: 2.73 $
|
||||
* $Date: 2005-07-25 05:24:16 $
|
||||
* $Author: Goober5000 $
|
||||
*
|
||||
* $Log: not supported by cvs2svn $
|
||||
* Revision 2.72 2005/07/13 02:50:49 Goober5000
|
||||
* remove PreProcDefine #includes in FS2
|
||||
* --Goober5000
|
||||
*
|
||||
* Revision 2.71 2005/07/07 16:32:33 taylor
|
||||
* compiler warning fixes
|
||||
* add -noibx troubleshooting cmdline option to disable use of IBX files
|
||||
* don't try to set thuster object number is only one thruster bank is specified (default method should go into affect)
|
||||
*
|
||||
* Revision 2.70 2005/06/29 18:46:13 taylor
|
||||
* add option to not scale up movies to fit window/screen, default is to scale
|
||||
* (arguably not a bug but I said I would get it in before 3.6.5 and forgot)
|
||||
*
|
||||
* Revision 2.69 2005/03/13 23:07:35 taylor
|
||||
* enable 32-bit to 16-bit TGA conversion with -tga16 cmdline option (experimental)
|
||||
* fix crash when upgrading from original campaign stats file to current
|
||||
*
|
||||
* Revision 2.68 2005/02/16 10:00:13 wmcoolmon
|
||||
* "-ingame" command line option
|
||||
*
|
||||
* Revision 2.67 2005/01/30 12:50:08 taylor
|
||||
* merge with Linux/OSX tree - p0130
|
||||
*
|
||||
* Revision 2.66 2005/01/29 16:30:46 phreak
|
||||
* smart shield command line stuff. this will be changed in the future, but i want people to test it.
|
||||
* -phreak
|
||||
*
|
||||
* Revision 2.65 2005/01/21 08:29:04 taylor
|
||||
* add -rlm cmdline option to switch to local viewpoint lighting calculations (OGL only for now)
|
||||
*
|
||||
* Revision 2.64 2004/12/24 19:36:12 Goober5000
|
||||
* resorted command-line options and added an option for WMC's ballistic gauge
|
||||
* --Goober5000
|
||||
*
|
||||
* Revision 2.63 2004/11/23 19:29:13 taylor
|
||||
* fix 2d warp in D3D, add cmdline option for 3d warp
|
||||
*
|
||||
* Revision 2.62 2004/09/10 13:51:20 et1
|
||||
* Command line option for TBP for warp stuff, "-tbpwarpeffects"
|
||||
*
|
||||
* Revision 2.61 2004/08/11 05:06:19 Kazan
|
||||
* added preprocdefines.h to prevent what happened with fred -- make sure to make all fred2 headers include this file as the _first_ include -- i have already modified fs2 files to do this
|
||||
*
|
||||
* Revision 2.60 2004/08/02 22:40:59 phreak
|
||||
* added -orbradar to enable orb rendering for the radar
|
||||
*
|
||||
* Revision 2.59 2004/08/01 02:31:18 phreak
|
||||
* -phreak command line changed to -dualscanlines
|
||||
*
|
||||
* Revision 2.58 2004/07/25 18:46:28 Kazan
|
||||
* -fred_no_warn has become -no_warn and applies to both fred and fs2
|
||||
* added new ai directive (last commit) and disabled afterburners while performing AIM_WAYPOINTS or AIM_FLY_TO_SHIP
|
||||
* fixed player ship speed bug w/ player-use-ai, now stays in formation correctly and manages speed
|
||||
* made -radar_reduce ignore itself if no parameter is given (ignoring launcher bug)
|
||||
*
|
||||
* Revision 2.57 2004/07/05 05:09:15 bobboau
|
||||
* FVF code, only the data that is needed is sent off to the card,,
|
||||
* OGL can take advantage of this if they want but it won't break
|
||||
* anything if they don't. also state block code has been implemented,
|
||||
* that's totaly internal to D3D no high level code is involved.
|
||||
*
|
||||
* Revision 2.56 2004/06/19 22:15:48 wmcoolmon
|
||||
* Added -nomotion debris command line option; also re-ordered categories.
|
||||
*
|
||||
* Revision 2.55 2004/06/06 12:25:19 randomtiger
|
||||
* Added new compression option -pcx32dds, build posted in RSB forum.
|
||||
* Changed flag because of launcher bug, have fixed launcher bug, will distribute later.
|
||||
* Also removed experimental flag from launcher flag list, stupid people were reporting bugs on unfinished code.
|
||||
*
|
||||
* Revision 2.54 2004/04/26 18:23:47 Kazan
|
||||
* -no_fps_capping
|
||||
*
|
||||
* Revision 2.53 2004/04/26 00:23:26 taylor
|
||||
* novbo and snd_preload cmdline options, fix moddir getting appended space
|
||||
*
|
||||
* Revision 2.52 2004/04/18 19:39:12 randomtiger
|
||||
* Added -2d_poof command which allows access to 2D poof rendering
|
||||
* Added -radar_reduce to launcher flag description structure
|
||||
*
|
||||
* Revision 2.51 2004/04/03 18:11:20 Kazan
|
||||
* FRED fixes
|
||||
*
|
||||
* Revision 2.50 2004/03/20 14:47:12 randomtiger
|
||||
* Added base for a general dynamic batching solution.
|
||||
* Fixed NO_DSHOW_CODE code path bug.
|
||||
*
|
||||
* Revision 2.49 2004/03/19 14:51:54 randomtiger
|
||||
* New command line parameter: -d3d_lesstmem causes D3D to bypass V's secondry texture system.
|
||||
*
|
||||
* Revision 2.48 2004/03/19 11:44:04 randomtiger
|
||||
* Removed -d3d_notmanaged param.
|
||||
* Tided D3D texture code. Merged remaining section code into the rest of the system.
|
||||
* Prepared for removal of code causing waste of memory for secondry store of textures.
|
||||
*
|
||||
* Revision 2.47 2004/02/27 04:09:55 bobboau
|
||||
* fixed a Z buffer error in HTL submodel rendering,
|
||||
* and glow points,
|
||||
* and other stuff
|
||||
*
|
||||
* Revision 2.46 2004/02/16 11:47:31 randomtiger
|
||||
* Removed a lot of files that we dont need anymore.
|
||||
* Changed htl to be on by default, command now -nohtl
|
||||
* Changed D3D to use a 2D vertex for 2D operations which should cut down on redundant data having to go though the system.
|
||||
* Added small change to all -start_mission flag to take you to any mission by filename, very useful for testing.
|
||||
* Removed old dshow code and took away timerbar compile flag condition since it uses a runtime flag now.
|
||||
*
|
||||
* Revision 2.45 2004/01/29 01:34:00 randomtiger
|
||||
* Added malloc montoring system, use -show_mem_usage, debug exes only to get an ingame list of heap usage.
|
||||
* Also added -d3d_notmanaged flag to activate non managed D3D path, in experimental stage.
|
||||
*
|
||||
* Revision 2.44 2004/01/24 14:31:27 randomtiger
|
||||
* Added the D3D particle code, its not bugfree but works perfectly on my card and helps with the framerate.
|
||||
* Its optional and off by default, use -d3d_particle to activiate.
|
||||
* Also bumped up D3D ambient light setting, it was way too dark.
|
||||
* Its now set to something similar to the original game.
|
||||
*
|
||||
* Revision 2.43 2003/12/08 22:30:02 randomtiger
|
||||
* Put render state and other direct D3D calls repetition check back in, provides speed boost.
|
||||
* Fixed bug that caused fullscreen only crash with DXT textures
|
||||
* Put dithering back in for tgas and jpgs
|
||||
*
|
||||
* Revision 2.42 2003/12/04 20:39:09 randomtiger
|
||||
* Added DDS image support for D3D
|
||||
* Added new command flag '-ship_choice_3d' to activate 3D models instead of ani's in ship choice, feature now off by default
|
||||
* Hopefully have fixed D3D text batching bug that caused old values to appear
|
||||
* Added Hud_target_object_factor variable to control 3D object sizes of zoom in HUD target
|
||||
* Fixed jump nodes not showing
|
||||
*
|
||||
* Revision 2.41 2003/12/03 19:27:00 randomtiger
|
||||
* Changed -t32 flag to -jpgtga
|
||||
* Added -query_flag to identify builds with speech not compiled and other problems
|
||||
* Now loads up launcher if videocard reg entry not found
|
||||
* Now offers to go online to download launcher if its not present
|
||||
* Changed target view not to use lower res texture, hi res one is already chached so might as well use it
|
||||
*
|
||||
* Revision 2.40 2003/11/29 10:52:09 randomtiger
|
||||
* Turned off D3D file mapping, its using too much memory which may be hurting older systems and doesnt seem to be providing much of a speed benifit.
|
||||
* Added stats command for ingame stats on memory usage.
|
||||
* Trys to play intro.mve and intro.avi, just to be safe since its not set by table.
|
||||
* Added fix for fonts wrapping round in non standard hi res modes.
|
||||
* Changed D3D mipmapping to a good value to suit htl mode.
|
||||
* Added new fog colour method which makes use of the bitmap, making this htl feature backcompatible again.
|
||||
*
|
||||
* Revision 2.39 2003/11/19 20:37:23 randomtiger
|
||||
* Almost fully working 32 bit pcx, use -pcx32 flag to activate.
|
||||
* Made some commandline variables fit the naming standard.
|
||||
* Changed timerbar system not to run pushes and pops if its not in use.
|
||||
* Put in a note about not uncommenting asserts.
|
||||
* Fixed up a lot of missing POP's on early returns?
|
||||
* Perhaps the motivation for Assert functionality getting commented out?
|
||||
* Fixed up some bad asserts.
|
||||
* Changed nebula poofs to render in 2D in htl, it makes it look how it used to in non htl. (neb.cpp,1248)
|
||||
* Before the poofs were creating a nasty stripe effect where they intersected with ships hulls.
|
||||
* Put in a special check for the signs of that D3D init bug I need to lock down.
|
||||
*
|
||||
* Revision 2.38 2003/11/15 18:09:33 randomtiger
|
||||
* Put TGA and JPG stuff on -t32 flag
|
||||
* Put 32 bit PCX stuff on -pcx32 (still has bugs)
|
||||
* Added multisample checking on device initialisation
|
||||
* Changed unrecognised parameter message (as requested) to be more user friendly
|
||||
* Speech now chooses voice based on reg value set by launcher v3.1
|
||||
*
|
||||
* Revision 2.37 2003/11/09 06:31:38 Kazan
|
||||
* a couple of htl functions being called in nonhtl (ie NULL functions) problems fixed
|
||||
* conflicts in cmdline and timerbar.h log entries
|
||||
* cvs stopped acting like it was on crack obviously
|
||||
*
|
||||
* Revision 2.36 2003/11/09 04:09:18 Goober5000
|
||||
* edited for language
|
||||
* --Goober5000
|
||||
*
|
||||
* Revision 2.35 2003/11/08 22:25:47 Kazan
|
||||
* Timerbar was enabled in both release and debug - so i made it a command line option "-timerbar"
|
||||
* DONT MESS WITH OTHER PEOPLES INCLUDE PATHS
|
||||
* DONT MESS WITH EXEC NAMES (leave it fs2_open_r and fs2_open_d) or paths!
|
||||
*
|
||||
* Revision 2.34 2003/11/03 18:07:26 randomtiger
|
||||
* Added -d3d_no_vsync command to make turning off vsync optional.
|
||||
* Removed 32bit command, it doesnt do anything.
|
||||
* Made aa multisample reg check safe.
|
||||
*
|
||||
* Revision 2.33 2003/10/27 23:04:20 randomtiger
|
||||
* Added -no_set_gamma flags
|
||||
* Fixed up some more non standard res stuff
|
||||
* Improved selection of device type, this includes using a pure device when allowed which means dev should not use Get* functions in D3D
|
||||
* Made fade in credits work
|
||||
* Stopped a call to gr_reser_lighting() in non htl mode when the pointer was NULL, was causing a crash loading a fogged level
|
||||
* Deleted directx8 directory content, has never been needed.
|
||||
*
|
||||
* Revision 2.32 2003/10/24 17:35:04 randomtiger
|
||||
* Implemented support for 32bit TGA and JPG for D3D
|
||||
* Also 32 bit PCX, but it still has some bugs to be worked out
|
||||
* Moved convert_24_to_16 out of the bitmap pfunction structures and into packunpack.cpp because thats the only place that uses it.
|
||||
*
|
||||
* Revision 2.31 2003/10/17 17:18:42 randomtiger
|
||||
* Big restructure for D3D and new modules grd3dlight and grd3dsetup
|
||||
*
|
||||
* Revision 2.30 2003/10/12 03:41:37 Kazan
|
||||
* #Kazan# FS2NetD client code gone multithreaded, some Fred2 Open -mod stuff [obvious code.lib] including a change in cmdline.cpp, changed Stick's "-nohtl" to "-htl" - HTL is _OFF_ by default here (Bobboau and I decided this was a better idea for now)
|
||||
*
|
||||
* Revision 2.29 2003/09/25 21:12:22 Kazan
|
||||
* ##Kazan## FS2NetD Completed! Just needs some thorough bug checking (i don't think there are any serious bugs)
|
||||
* Also D3D8 Screenshots work now.
|
||||
*
|
||||
* Revision 2.28 2003/09/23 02:42:52 Kazan
|
||||
* ##KAZAN## - FS2NetD Support! (FS2 Open PXO) -- Game Server Listing, and mission validation completed - stats storing to come - needs fs2open_pxo.cfg file [VP-able]
|
||||
*
|
||||
* Revision 2.27 2003/09/14 19:00:02 wmcoolmon
|
||||
* Changed "nospec" and "cell" to "Cmdline_nospec" and "Cmdline_cell"
|
||||
*
|
||||
* Revision 2.26 2003/09/14 18:32:24 wmcoolmon
|
||||
* Added "-safeloading" command line parameter, which uses old fs2_retail-style loading code -C
|
||||
*
|
||||
* Revision 2.25 2003/09/13 06:02:05 Goober5000
|
||||
* clean rollback of all of argv's stuff
|
||||
* --Goober5000
|
||||
*
|
||||
* Revision 2.23 2003/08/22 07:35:08 bobboau
|
||||
* specular code should be bugless now,
|
||||
* cell shadeing has been added activated via the comand line '-cell',
|
||||
* 3D shockwave models, and a transparency method I'm calling edge and center alpha that could be usefull for other things, ask for details
|
||||
*
|
||||
* Revision 2.22 2003/08/21 20:54:37 randomtiger
|
||||
* Fixed switching - RT
|
||||
*
|
||||
* Revision 2.21 2003/08/12 03:18:33 bobboau
|
||||
* Specular 'shine' mapping;
|
||||
* useing a phong lighting model I have made specular highlights
|
||||
* that are mapped to the model,
|
||||
* rendering them is still slow, but they look real purdy
|
||||
*
|
||||
* also 4 new (untested) comand lines, the XX is a floating point value
|
||||
* -spec_exp XX
|
||||
* the n value, you can set this from 0 to 200 (actualy more than that, but this is the recomended range), it will make the highlights bigger or smaller, defalt is 16.0 so start playing around there
|
||||
* -spec_point XX
|
||||
* -spec_static XX
|
||||
* -spec_tube XX
|
||||
* these are factors for the three diferent types of lights that FS uses, defalt is 1.0,
|
||||
* static is the local stars,
|
||||
* point is weapons/explosions/warp in/outs,
|
||||
* tube is beam weapons,
|
||||
* for thouse of you who think any of these lights are too bright you can configure them you're self for personal satisfaction
|
||||
*
|
||||
* Revision 2.20 2003/08/09 06:07:23 bobboau
|
||||
* slightly better implementation of the new zbuffer thing, it now checks only three diferent formats defalting to the 16 bit if neither the 24 or 32 bit versions are suported
|
||||
*
|
||||
* Revision 2.19 2003/03/29 09:42:05 Goober5000
|
||||
* made beams default shield piercing again
|
||||
* also added a beam no pierce command line flag
|
||||
* and fixed something else which I forgot :P
|
||||
* --Goober5000
|
||||
*
|
||||
* Revision 2.18 2003/03/18 10:07:00 unknownplayer
|
||||
* The big DX/main line merge. This has been uploaded to the main CVS since I can't manage to get it to upload to the DX branch. Apologies to all who may be affected adversely, but I'll work to debug it as fast as I can.
|
||||
*
|
||||
* Revision 2.17 2003/02/22 04:13:17 wmcoolmon
|
||||
* Added "-dshowvid" command-line option, which must be set in order for movies to play.
|
||||
*
|
||||
* Revision 2.16 2002/12/21 13:39:25 DTP
|
||||
* did bit more house keeping. modfied Phreaks fps cmdline a bit, so that we dont have to specific build code.libs for fred, but can use the same code.lib for both fs2_open.exe and fred2_open.exe
|
||||
*
|
||||
* Revision 2.15 2002/12/17 03:08:18 DTP
|
||||
* fix to Show_framerate. seems it will call an unresolved external error during fred builds. modified my ifndefs a bit, dsw modified to include preprocessor tag FRED.
|
||||
*
|
||||
* Revision 2.14 2002/12/17 02:22:34 DTP
|
||||
* wrong name :)
|
||||
*
|
||||
* Revision 2.13 2002/12/17 02:21:06 DTP
|
||||
* cleaned up after phreak :). it will make a mess in debug builds. added a couple of ifndef _debugs.
|
||||
*
|
||||
* Revision 2.12 2002/11/10 16:30:53 DTP
|
||||
* -DTP reworked mod support,
|
||||
*
|
||||
* Revision 2.11 2002/10/31 21:14:16 DTP
|
||||
* DTP Quickly added something needed to cmdline.h, since otherwise we can not compile the code as it misses some externals. Thought a rollback rolled all back.
|
||||
*
|
||||
* Revision 2.10 2002/10/30 20:22:30 inquisitor
|
||||
* Bad Committ, Rolling back
|
||||
*
|
||||
* Revision 2.7 2002/10/22 23:02:39 randomtiger
|
||||
* Made Phreaks alternative scanning style optional under the command line tag "-phreak"
|
||||
* Fixed bug that changes HUD colour when targetting debris in a full nebula. - RT
|
||||
*
|
||||
* Revision 2.6 2002/10/19 03:50:28 randomtiger
|
||||
* Added special pause mode for easier action screenshots.
|
||||
* Added new command line parameter for accessing all single missions in tech room. - RT
|
||||
*
|
||||
* Revision 2.5 2002/08/27 13:38:57 penguin
|
||||
* Moved DirectX8 stuff to directx8 branch; reverted to previous
|
||||
*
|
||||
* Revision 2.3.2.4 2002/11/10 11:32:29 randomtiger
|
||||
*
|
||||
* Made D3D8 mipmapping optional on command line flag -d3dmipmip, off by default.
|
||||
* When on is now less blury. - RT
|
||||
*
|
||||
* Revision 2.3.2.3 2002/11/04 23:53:24 randomtiger
|
||||
*
|
||||
* Added new command line parameter -d3dlauncher which brings up the launcher.
|
||||
* This is needed since FS2 DX8 now stores the last successful details in the registry and
|
||||
* uses them to choose the adapter and mode to run in unless its windowed or they are not set.
|
||||
* Added some code for Antialiasing but it messes up the font but hopefully that can be fixed later. - RT
|
||||
*
|
||||
* Revision 2.3.2.2 2002/11/04 21:24:59 randomtiger
|
||||
*
|
||||
* When running in D3D all ani's are memory mapped for speed, this takes up more memory but stops gametime locking of textures which D3D8 hates.
|
||||
* Added new command line tag Cmdline_d3dlowmem for people who dont want to make use of this because they have no memory.
|
||||
* Cleaned up some more texture stuff enabled console debug for D3D.
|
||||
*
|
||||
* Revision 2.3.2.1 2002/08/27 13:19:02 penguin
|
||||
* Moved to directx8 branch
|
||||
*
|
||||
* Revision 2.4 2002/08/18 19:48:28 randomtiger
|
||||
* Added new lib files: strmiids and ddraw to get dshow working
|
||||
* Added new command line parameter to active direct show movie play: -dshowvid
|
||||
* Uncommented movie_play calls and includes
|
||||
*
|
||||
* Revision 2.3 2002/08/07 00:44:13 DTP
|
||||
* Implented -GF4FIX commandline switch
|
||||
*
|
||||
* Revision 2.2 2002/07/29 06:35:15 DTP
|
||||
* added -almission commandline arguement, will autoload mission i.e fs2_open.exe -almission kickass will autoload kickass.fs2 which should be a multiplayer mission.
|
||||
*
|
||||
@@ -159,7 +480,6 @@
|
||||
*
|
||||
* $NoKeywords: $
|
||||
*/
|
||||
|
||||
#ifndef FS_CMDLINE_HEADER_FILE
|
||||
#define FS_CMDLINE_HEADER_FILE
|
||||
|
||||
@@ -169,6 +489,7 @@ int parse_cmdline(char *cmdline);
|
||||
int parse_cmdline(int argc, char *argv[]);
|
||||
#endif
|
||||
|
||||
int fred2_parse_cmdline(int argc, char *argv[]);
|
||||
// COMMAND LINE SETTINGS
|
||||
// This section is for reference by all the *_init() functions. For example, the multiplayer init function
|
||||
// could check to see if (int Cmdline_multi_stream_chat_to_file) has been set by the command line parser.
|
||||
@@ -195,13 +516,90 @@ extern int Cmdline_multi_log;
|
||||
extern int Cmdline_server_firing;
|
||||
extern int Cmdline_client_dodamage;
|
||||
extern int Cmdline_spew_pof_info;
|
||||
extern int Cmdline_force_32bit;
|
||||
extern int Cmdline_mouse_coords;
|
||||
extern int Cmdline_timeout;
|
||||
extern int Cmdline_SpewMission_CRCs;
|
||||
extern int Cmdline_SpewTable_CRCs;
|
||||
|
||||
extern int Cmdline_window;
|
||||
extern char *Cmdline_almission; //DTP for autoload mission
|
||||
extern int Cmdline_gf4fix; //DTP for Random tigers GF4fix.
|
||||
extern int Cmdline_allslev;
|
||||
extern int Cmdline_dualscanlines;
|
||||
extern int Cmdline_dnoshowvid; //WMC Toggles movie playing support
|
||||
extern int Cmdline_noscalevid; // disables fit-to-window for movies - taylor
|
||||
extern char *Cmdline_mod; //DTP for mod support
|
||||
extern int Cmdline_show_fps;//DTP moved here because it is the correct place for it to be.
|
||||
extern int Cmdline_show_stats;
|
||||
extern int Cmdline_safeloading;
|
||||
extern int Cmdline_nospec;
|
||||
extern int Cmdline_orb_radar;
|
||||
extern int Cmdline_TBPWarpEffects; // TBP warp effects -Et1
|
||||
|
||||
extern int Cmdline_cache_ani;
|
||||
extern int Cmdline_d3dmipmap;
|
||||
|
||||
extern int Cmdline_beams_no_pierce_shields; // Goober5000
|
||||
extern float Cmdline_fov;
|
||||
|
||||
extern float static_light_factor;
|
||||
extern float static_tube_factor;
|
||||
extern float static_point_factor;
|
||||
extern double specular_exponent_value;
|
||||
|
||||
extern int Cmdline_cell;
|
||||
extern int Cmdline_nohtl;
|
||||
extern int Cmdline_dxt;
|
||||
extern int Cmdline_jpgtga;
|
||||
extern int Cmdline_no_set_gamma;
|
||||
extern int Cmdline_d3d_no_vsync;
|
||||
extern int Cmdline_pcx32;
|
||||
extern int Cmdline_pcx32dds;
|
||||
extern int Cmdline_nomotiondebris;
|
||||
extern int Cmdline_rlm;
|
||||
extern int Cmdline_noibx;
|
||||
|
||||
#ifdef SCP_UNIX
|
||||
extern int Cmdline_no_grab;
|
||||
#endif
|
||||
|
||||
extern int Cmdline_noglow;
|
||||
extern int Cmdline_timerbar;
|
||||
extern int Cmdline_query_speech;
|
||||
extern int Cmdline_ship_choice_3d;
|
||||
extern int Cmdline_d3d_particle;
|
||||
|
||||
extern int Cmdline_ambient_factor;
|
||||
extern int Cmdline_show_mem_usage;
|
||||
extern int Cmdline_rt;
|
||||
extern int Cmdline_ingamejoin;
|
||||
extern char *Cmdline_start_mission;
|
||||
|
||||
extern int Cmdline_d3d_lesstmem;
|
||||
extern int Cmdline_batch_3dunlit;
|
||||
|
||||
extern int Cmdline_2d_poof;
|
||||
extern int Cmdline_3dwarp;
|
||||
|
||||
extern int Cmdline_FRED2_htl;
|
||||
extern int CmdLine_NoWarn;
|
||||
|
||||
extern int Cmdline_novbo;
|
||||
extern int Cmdline_snd_preload;
|
||||
extern int Cmdline_NoFPSCap;
|
||||
|
||||
extern float Cmdline_max_subdivide;
|
||||
|
||||
extern int Cmdline_alpha_env;
|
||||
extern int Cmdline_env;
|
||||
extern int Cmdline_decals;
|
||||
|
||||
extern int Cmdline_ballistic_gauge;
|
||||
extern int Cmdline_smart_shields;
|
||||
|
||||
extern int Cmdline_tga16;
|
||||
|
||||
extern int Cmdline_wcsaga;
|
||||
|
||||
//extern char FreeSpace_Directory[]; // allievating a cfilesystem problem caused by fred -- Kazan
|
||||
#endif
|
||||
@@ -9,13 +9,35 @@
|
||||
|
||||
/*
|
||||
* $Logfile: /Freespace2/code/CMeasure/CMeasure.cpp $
|
||||
* $Revision: 2.1 $
|
||||
* $Date: 2002-08-01 01:41:04 $
|
||||
* $Author: penguin $
|
||||
* $Revision: 2.6 $
|
||||
* $Date: 2005-04-05 05:53:15 $
|
||||
* $Author: taylor $
|
||||
*
|
||||
* Counter measures. Created by Mike Kulas, May 12, 1997.
|
||||
*
|
||||
* $Log: not supported by cvs2svn $
|
||||
* Revision 2.5 2004/07/26 20:47:25 Kazan
|
||||
* remove MCD complete
|
||||
*
|
||||
* Revision 2.4 2004/07/12 16:32:43 Kazan
|
||||
* MCD - define _MCD_CHECK to use memory tracking
|
||||
*
|
||||
* Revision 2.3 2004/03/05 09:01:57 Goober5000
|
||||
* Uber pass at reducing #includes
|
||||
* --Goober5000
|
||||
*
|
||||
* Revision 2.2 2003/03/18 10:07:00 unknownplayer
|
||||
* The big DX/main line merge. This has been uploaded to the main CVS since I can't manage to get it to upload to the DX branch. Apologies to all who may be affected adversely, but I'll work to debug it as fast as I can.
|
||||
*
|
||||
* Revision 2.1.2.1 2002/09/24 18:56:41 randomtiger
|
||||
* DX8 branch commit
|
||||
*
|
||||
* This is the scub of UP's previous code with the more up to date RT code.
|
||||
* For full details check previous dev e-mails
|
||||
*
|
||||
* Revision 2.1 2002/08/01 01:41:04 penguin
|
||||
* The big include file move
|
||||
*
|
||||
* Revision 2.0 2002/06/03 04:02:21 penguin
|
||||
* Warpcore CVS sync
|
||||
*
|
||||
@@ -208,26 +230,15 @@
|
||||
* $NoKeywords: $
|
||||
*/
|
||||
|
||||
#include "globalincs/pstypes.h"
|
||||
#include "globalincs/systemvars.h"
|
||||
#include "cmeasure/cmeasure.h"
|
||||
#include "freespace2/freespace.h"
|
||||
#include "math/vecmat.h"
|
||||
#include "graphics/2d.h"
|
||||
#include "render/3d.h"
|
||||
#include "model/model.h"
|
||||
#include "physics/physics.h"
|
||||
#include "math/floating.h"
|
||||
#include "model/model.h"
|
||||
#include "ship/ship.h"
|
||||
#include "io/timer.h"
|
||||
#include "fireball/fireballs.h"
|
||||
#include "radar/radar.h"
|
||||
#include "mission/missionparse.h" // For MAX_SPECIES_NAMES
|
||||
#include "gamesnd/gamesnd.h"
|
||||
#include "object/objectsnd.h"
|
||||
#include "sound/sound.h"
|
||||
#include "math/staticrand.h"
|
||||
#include "object/object.h"
|
||||
|
||||
|
||||
|
||||
cmeasure_info Cmeasure_info[MAX_CMEASURE_TYPES];
|
||||
cmeasure Cmeasures[MAX_CMEASURES];
|
||||
@@ -243,27 +254,9 @@ void cmeasure_init()
|
||||
{
|
||||
int i;
|
||||
|
||||
if ( !Cmeasure_inited ) {
|
||||
if ( !Cmeasure_inited )
|
||||
Cmeasure_inited = 1;
|
||||
|
||||
/* // Do all the processing that happens only once
|
||||
if ( Debris_model < 0 ) {
|
||||
if (Debris_model>-1) {
|
||||
polymodel * pm;
|
||||
pm = model_get(Debris_model);
|
||||
Debris_num_submodels = pm->n_models;
|
||||
}
|
||||
}
|
||||
|
||||
for (i=0; i<MAX_SPECIES_NAMES; i++ ) {
|
||||
Debris_textures[i] = bm_load( Debris_texture_files[i] );
|
||||
if ( Debris_textures[i] < 0 ) {
|
||||
Warning( LOCATION, "Couldn't load species %d debris\ntexture, '%s'\n", i, Debris_texture_files[i] );
|
||||
}
|
||||
}
|
||||
*/
|
||||
}
|
||||
|
||||
// Reset everything between levels
|
||||
Num_cmeasures = 0;
|
||||
|
||||
@@ -379,7 +372,7 @@ float Skill_level_cmeasure_life_scale[NUM_SKILL_LEVELS] = {3.0f, 2.0f, 1.5f, 1.2
|
||||
// creates one countermeasure. A ship fires 1 of these per launch. rand_val is used
|
||||
// in multiplayer. If -1, then create a random number. If non-negative, use this
|
||||
// number for static_rand functions
|
||||
int cmeasure_create( object * source_obj, vector * pos, int cm_type, int rand_val )
|
||||
int cmeasure_create( object * source_obj, vec3d * pos, int cm_type, int rand_val )
|
||||
{
|
||||
int n, objnum, parent_objnum, arand;
|
||||
object * obj;
|
||||
@@ -449,7 +442,7 @@ int cmeasure_create( object * source_obj, vector * pos, int cm_type, int rand_va
|
||||
|
||||
Num_cmeasures++;
|
||||
|
||||
vector vel, rand_vec;
|
||||
vec3d vel, rand_vec;
|
||||
|
||||
vm_vec_scale_add(&vel, &source_obj->phys_info.vel, &source_obj->orient.vec.fvec, -25.0f);
|
||||
|
||||
|
||||
@@ -9,13 +9,26 @@
|
||||
|
||||
/*
|
||||
* $Logfile: /Freespace2/code/CMeasure/CMeasure.h $
|
||||
* $Revision: 2.1 $
|
||||
* $Date: 2002-08-01 01:41:04 $
|
||||
* $Author: penguin $
|
||||
* $Revision: 2.5 $
|
||||
* $Date: 2005-07-13 02:50:50 $
|
||||
* $Author: Goober5000 $
|
||||
*
|
||||
* Counter measures. Created by Mike Kulas, May 12, 1997.
|
||||
*
|
||||
* $Log: not supported by cvs2svn $
|
||||
* Revision 2.4 2005/04/05 05:53:15 taylor
|
||||
* s/vector/vec3d/g, better support for different compilers (Jens Granseuer)
|
||||
*
|
||||
* Revision 2.3 2004/08/11 05:06:19 Kazan
|
||||
* added preprocdefines.h to prevent what happened with fred -- make sure to make all fred2 headers include this file as the _first_ include -- i have already modified fs2 files to do this
|
||||
*
|
||||
* Revision 2.2 2004/03/05 09:01:57 Goober5000
|
||||
* Uber pass at reducing #includes
|
||||
* --Goober5000
|
||||
*
|
||||
* Revision 2.1 2002/08/01 01:41:04 penguin
|
||||
* The big include file move
|
||||
*
|
||||
* Revision 2.0 2002/06/03 04:02:21 penguin
|
||||
* Warpcore CVS sync
|
||||
*
|
||||
@@ -115,8 +128,10 @@
|
||||
#ifndef _CMEASURE_H
|
||||
#define _CMEASURE_H
|
||||
|
||||
#include "parse/parselo.h"
|
||||
#include "object/object.h"
|
||||
#include "globalincs/globals.h"
|
||||
|
||||
struct object;
|
||||
struct vec3d;
|
||||
|
||||
#define MAX_CMEASURES 64
|
||||
|
||||
@@ -167,7 +182,7 @@ extern void cmeasure_render( object * obj );
|
||||
extern void cmeasure_delete( object * obj );
|
||||
extern void cmeasure_process_pre( object * obj, float frame_time);
|
||||
extern void cmeasure_process_post( object * obj, float frame_time);
|
||||
extern int cmeasure_create( object * source_obj, vector *pos, int cm_type, int rand_val = -1 );
|
||||
extern int cmeasure_create( object * source_obj, vec3d *pos, int cm_type, int rand_val = -1 );
|
||||
extern void cmeasure_select_next(object *objp);
|
||||
|
||||
#endif // _CMEASURE_H
|
||||
@@ -9,13 +9,75 @@
|
||||
|
||||
/*
|
||||
* $Logfile: /Freespace2/code/ControlConfig/ControlsConfig.cpp $
|
||||
* $Revision: 2.1 $
|
||||
* $Date: 2002-08-01 01:41:04 $
|
||||
* $Author: penguin $
|
||||
* $Revision: 2.17 $
|
||||
* $Date: 2005-07-22 10:18:37 $
|
||||
* $Author: Goober5000 $
|
||||
*
|
||||
* C module for keyboard, joystick and mouse configuration
|
||||
*
|
||||
* $Log: not supported by cvs2svn $
|
||||
* Revision 2.16 2005/07/13 02:50:50 Goober5000
|
||||
* remove PreProcDefine #includes in FS2
|
||||
* --Goober5000
|
||||
*
|
||||
* Revision 2.15 2005/07/07 16:36:57 taylor
|
||||
* various compiler warning fixes (some of these from dizzy)
|
||||
*
|
||||
* Revision 2.14 2005/07/02 19:42:14 taylor
|
||||
* ton of non-standard resolution fixes
|
||||
*
|
||||
* Revision 2.13 2005/05/12 17:49:11 taylor
|
||||
* use vm_malloc(), vm_free(), vm_realloc(), vm_strdup() rather than system named macros
|
||||
* fixes various problems and is past time to make the switch
|
||||
*
|
||||
* Revision 2.12 2005/04/28 05:29:28 wmcoolmon
|
||||
* Removed FS2_DEMO defines that looked like they wouldn't cause the universe to collapse
|
||||
*
|
||||
* Revision 2.11 2005/04/17 05:38:28 taylor
|
||||
* updated Linux joystick code that's a bit less insane speed wise
|
||||
* remove ability to build without joystick support, no reason to keep it around
|
||||
* fix unusable warning flag with libjpeg building
|
||||
*
|
||||
* Revision 2.10 2005/03/02 21:24:43 taylor
|
||||
* more network/inferno goodness for Windows, takes care of a few warnings too
|
||||
*
|
||||
* Revision 2.9 2004/07/29 19:37:50 Kazan
|
||||
* unbug the JS bug i caused --- kazan
|
||||
*
|
||||
* Revision 2.8 2004/07/26 20:47:26 Kazan
|
||||
* remove MCD complete
|
||||
*
|
||||
* Revision 2.7 2004/07/25 00:31:28 Kazan
|
||||
* i have absolutely nothing to say about that subject
|
||||
*
|
||||
* Revision 2.6 2004/07/12 16:32:43 Kazan
|
||||
* MCD - define _MCD_CHECK to use memory tracking
|
||||
*
|
||||
* Revision 2.5 2004/03/05 09:01:58 Goober5000
|
||||
* Uber pass at reducing #includes
|
||||
* --Goober5000
|
||||
*
|
||||
* Revision 2.4 2003/11/11 02:15:43 Goober5000
|
||||
* ubercommit - basically spelling and language fixes with some additional
|
||||
* warnings disabled
|
||||
* --Goober5000
|
||||
*
|
||||
* Revision 2.3 2003/04/05 11:09:21 Goober5000
|
||||
* fixed some fiddly bits with scrolling and ui stuff
|
||||
* --Goober5000
|
||||
*
|
||||
* Revision 2.2 2003/03/18 10:07:00 unknownplayer
|
||||
* The big DX/main line merge. This has been uploaded to the main CVS since I can't manage to get it to upload to the DX branch. Apologies to all who may be affected adversely, but I'll work to debug it as fast as I can.
|
||||
*
|
||||
* Revision 2.1.2.1 2002/09/24 18:56:41 randomtiger
|
||||
* DX8 branch commit
|
||||
*
|
||||
* This is the scub of UP's previous code with the more up to date RT code.
|
||||
* For full details check previous dev e-mails
|
||||
*
|
||||
* Revision 2.1 2002/08/01 01:41:04 penguin
|
||||
* The big include file move
|
||||
*
|
||||
* Revision 2.0 2002/06/03 04:02:21 penguin
|
||||
* Warpcore CVS sync
|
||||
*
|
||||
@@ -108,7 +170,7 @@
|
||||
*
|
||||
* 51 5/19/98 12:56p Hoffoss
|
||||
* Added some code to help prevent triple-clicking for binding the mouse
|
||||
* button to an action (why the hell people triple click is beyond me,
|
||||
* button to an action (why people triple click is beyond me,
|
||||
* though).
|
||||
*
|
||||
* 50 5/19/98 11:11a Lawrance
|
||||
@@ -303,24 +365,18 @@
|
||||
*
|
||||
*/
|
||||
|
||||
|
||||
#include "freespace2/freespace.h"
|
||||
#include "controlconfig/controlsconfig.h"
|
||||
#include "gamesequence/gamesequence.h"
|
||||
#include "playerman/player.h"
|
||||
#include "graphics/2d.h"
|
||||
#include "hud/hudsquadmsg.h"
|
||||
#include "io/key.h"
|
||||
#include "io/timer.h"
|
||||
#include "math.h"
|
||||
#include "io/mouse.h"
|
||||
#include "ui/ui.h"
|
||||
#include "io/joy.h"
|
||||
#include "bmpman/bmpman.h"
|
||||
#include "sound/sound.h"
|
||||
#include "gamesnd/gamesnd.h"
|
||||
#include "missionui/missionscreencommon.h"
|
||||
#include "graphics/font.h"
|
||||
#include "hud/hud.h"
|
||||
#include "playerman/managepilot.h"
|
||||
#include "gamehelp/contexthelp.h"
|
||||
#include "popup/popup.h"
|
||||
@@ -332,6 +388,12 @@
|
||||
#include "network/multiutil.h"
|
||||
#endif
|
||||
|
||||
#ifndef NDEBUG
|
||||
#include "hud/hud.h"
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
#define NUM_SYSTEM_KEYS 14
|
||||
#define NUM_BUTTONS 19
|
||||
#define NUM_TABS 4
|
||||
@@ -415,7 +477,7 @@ int Conflict_warning_coords[GR_NUM_RESOLUTIONS][2] = {
|
||||
int Conflict_stamp = -1;
|
||||
int Conflict_bright = 0;
|
||||
|
||||
#define LIST_BUTTONS_MAX 40
|
||||
#define LIST_BUTTONS_MAX 42
|
||||
#define JOY_AXIS 0x80000
|
||||
|
||||
static int Num_cc_lines;
|
||||
@@ -700,6 +762,8 @@ int control_config_detect_axis()
|
||||
|
||||
int control_config_valid_action(int n)
|
||||
{
|
||||
//WMC - Invalid_demo_keys is never even filled!!
|
||||
/*
|
||||
#ifdef FS2_DEMO
|
||||
int i;
|
||||
|
||||
@@ -707,7 +771,7 @@ int control_config_valid_action(int n)
|
||||
if (n == Invalid_demo_keys[i])
|
||||
return 0;
|
||||
#endif
|
||||
|
||||
*/
|
||||
return 1;
|
||||
}
|
||||
|
||||
@@ -813,7 +877,13 @@ void control_config_list_prepare()
|
||||
if ((Control_config[z].tab == Tab) && control_config_valid_action(z)) {
|
||||
k = Control_config[z].key_id;
|
||||
j = Control_config[z].joy_id;
|
||||
Cc_lines[Num_cc_lines].label = XSTR(Control_config[z].text, CONTROL_CONFIG_XSTR + z);
|
||||
|
||||
if (Control_config[z].hasXSTR)
|
||||
Cc_lines[Num_cc_lines].label = XSTR(Control_config[z].text, CONTROL_CONFIG_XSTR + z);
|
||||
else
|
||||
Cc_lines[Num_cc_lines].label = Control_config[z].text;
|
||||
|
||||
|
||||
Cc_lines[Num_cc_lines].cc_index = z;
|
||||
Cc_lines[Num_cc_lines++].y = y;
|
||||
y += font_height + 2;
|
||||
@@ -853,16 +923,16 @@ config_item_undo *get_undo_block(int size)
|
||||
{
|
||||
config_item_undo *ptr;
|
||||
|
||||
ptr = (config_item_undo *) malloc( sizeof(config_item_undo) );
|
||||
ptr = (config_item_undo *) vm_malloc( sizeof(config_item_undo) );
|
||||
Assert(ptr);
|
||||
ptr->next = Config_item_undo;
|
||||
Config_item_undo = ptr;
|
||||
|
||||
ptr->size = size;
|
||||
if (size) {
|
||||
ptr->index = (int *) malloc( sizeof(int) * size );
|
||||
ptr->index = (int *) vm_malloc( sizeof(int) * size );
|
||||
Assert(ptr->index);
|
||||
ptr->list = (config_item *) malloc( sizeof(config_item) * size );
|
||||
ptr->list = (config_item *) vm_malloc( sizeof(config_item) * size );
|
||||
Assert(ptr->list);
|
||||
|
||||
} else {
|
||||
@@ -884,11 +954,11 @@ void free_undo_block()
|
||||
|
||||
Config_item_undo = ptr->next;
|
||||
if (ptr->size) {
|
||||
free(ptr->list);
|
||||
free(ptr->index);
|
||||
vm_free(ptr->list);
|
||||
vm_free(ptr->index);
|
||||
}
|
||||
|
||||
free(ptr);
|
||||
vm_free(ptr);
|
||||
}
|
||||
|
||||
// undo the most recent binding changes
|
||||
@@ -947,8 +1017,9 @@ void control_config_save_axis_undo(int axis)
|
||||
config_item_undo *ptr;
|
||||
config_item item;
|
||||
|
||||
memset( &item, 0, sizeof(config_item) );
|
||||
|
||||
item.joy_id = (short) Axis_map_to[axis];
|
||||
item.used = 0;
|
||||
item.used = Invert_axis[axis];
|
||||
|
||||
ptr = get_undo_block(1);
|
||||
@@ -1064,6 +1135,8 @@ int control_config_clear_other()
|
||||
ptr = get_undo_block(total);
|
||||
for (i=j=0; i<NUM_JOY_AXIS_ACTIONS; i++)
|
||||
if ((Axis_map_to[i] == Axis_map_to[z]) && (i != z)) {
|
||||
memset( &item, 0, sizeof(config_item) );
|
||||
|
||||
item.joy_id = (short) Axis_map_to[i];
|
||||
item.used = Invert_axis[i];
|
||||
|
||||
@@ -1152,15 +1225,12 @@ int control_config_clear_all()
|
||||
return 0;
|
||||
}
|
||||
|
||||
#ifndef NO_JOYSTICK
|
||||
extern Joy_info joystick;
|
||||
#endif
|
||||
|
||||
int control_config_axis_default(int axis)
|
||||
{
|
||||
Assert(axis >= 0);
|
||||
|
||||
#ifndef NO_JOYSTICK
|
||||
if ( axis > 1 ) {
|
||||
if (Axis_map_to_defaults[axis] < 0)
|
||||
return -1;
|
||||
@@ -1170,9 +1240,6 @@ int control_config_axis_default(int axis)
|
||||
}
|
||||
|
||||
return Axis_map_to_defaults[axis];
|
||||
#else
|
||||
return -1;
|
||||
#endif
|
||||
}
|
||||
|
||||
int control_config_do_reset()
|
||||
@@ -1207,6 +1274,8 @@ int control_config_do_reset()
|
||||
|
||||
for (i=0; i<NUM_JOY_AXIS_ACTIONS; i++)
|
||||
if ((Axis_map_to[i] != control_config_axis_default(i)) || (Invert_axis[i] != Invert_axis_defaults[i])) {
|
||||
memset( &item, 0, sizeof(config_item) );
|
||||
|
||||
item.joy_id = (short) Axis_map_to[i];
|
||||
item.used = Invert_axis[i];
|
||||
|
||||
@@ -1544,7 +1613,7 @@ void control_config_init()
|
||||
Control_config_backup[i] = Control_config[i];
|
||||
|
||||
common_set_interface_palette(NOX("ControlConfigPalette")); // set the interface palette
|
||||
Ui_window.create(0, 0, gr_screen.max_w, gr_screen.max_h, 0);
|
||||
Ui_window.create(0, 0, gr_screen.max_w_unscaled, gr_screen.max_h_unscaled, 0);
|
||||
Ui_window.set_mask_bmap(Conflict_background_bitmap_mask_fname[gr_screen.res]);
|
||||
Ui_window.tooltip_handler = control_config_tooltip_handler;
|
||||
|
||||
@@ -1609,26 +1678,26 @@ void control_config_init()
|
||||
control_config_conflict_check();
|
||||
|
||||
// setup strings
|
||||
Joy_axis_action_text[0] = strdup(XSTR("Turn (Yaw) Axis", 1016));
|
||||
Joy_axis_action_text[1] = strdup(XSTR("Pitch Axis", 1017));
|
||||
Joy_axis_action_text[2] = strdup(XSTR("Bank Axis", 1018));
|
||||
Joy_axis_action_text[3] = strdup(XSTR("Absolute Throttle Axis", 1019));
|
||||
Joy_axis_action_text[4] = strdup(XSTR("Relative Throttle Axis", 1020));
|
||||
Joy_axis_text[0] = strdup(XSTR("Joystick/Mouse X Axis", 1021));
|
||||
Joy_axis_text[1] = strdup(XSTR("Joystick/Mouse Y Axis", 1022));
|
||||
Joy_axis_text[2] = strdup(XSTR("Joystick Z Axis", 1023));
|
||||
Joy_axis_text[3] = strdup(XSTR("Joystick rX Axis", 1024));
|
||||
Joy_axis_text[4] = strdup(XSTR("Joystick rY Axis", 1025));
|
||||
Joy_axis_text[5] = strdup(XSTR("Joystick rZ Axis", 1026));
|
||||
Mouse_button_text[0] = strdup("");
|
||||
Mouse_button_text[1] = strdup(XSTR("Left Button", 1027));
|
||||
Mouse_button_text[2] = strdup(XSTR("Right Button", 1028));
|
||||
Mouse_button_text[3] = strdup(XSTR("Mid Button", 1029));
|
||||
Mouse_button_text[4] = strdup("");
|
||||
Mouse_axis_text[0] = strdup(XSTR("L/R", 1030));
|
||||
Mouse_axis_text[1] = strdup(XSTR("U/B", 1031));
|
||||
Invert_text[0] = strdup(XSTR("N", 1032));
|
||||
Invert_text[1] = strdup(XSTR("Y", 1033));
|
||||
Joy_axis_action_text[0] = vm_strdup(XSTR("Turn (Yaw) Axis", 1016));
|
||||
Joy_axis_action_text[1] = vm_strdup(XSTR("Pitch Axis", 1017));
|
||||
Joy_axis_action_text[2] = vm_strdup(XSTR("Bank Axis", 1018));
|
||||
Joy_axis_action_text[3] = vm_strdup(XSTR("Absolute Throttle Axis", 1019));
|
||||
Joy_axis_action_text[4] = vm_strdup(XSTR("Relative Throttle Axis", 1020));
|
||||
Joy_axis_text[0] = vm_strdup(XSTR("Joystick/Mouse X Axis", 1021));
|
||||
Joy_axis_text[1] = vm_strdup(XSTR("Joystick/Mouse Y Axis", 1022));
|
||||
Joy_axis_text[2] = vm_strdup(XSTR("Joystick Z Axis", 1023));
|
||||
Joy_axis_text[3] = vm_strdup(XSTR("Joystick rX Axis", 1024));
|
||||
Joy_axis_text[4] = vm_strdup(XSTR("Joystick rY Axis", 1025));
|
||||
Joy_axis_text[5] = vm_strdup(XSTR("Joystick rZ Axis", 1026));
|
||||
Mouse_button_text[0] = vm_strdup("");
|
||||
Mouse_button_text[1] = vm_strdup(XSTR("Left Button", 1027));
|
||||
Mouse_button_text[2] = vm_strdup(XSTR("Right Button", 1028));
|
||||
Mouse_button_text[3] = vm_strdup(XSTR("Mid Button", 1029));
|
||||
Mouse_button_text[4] = vm_strdup("");
|
||||
Mouse_axis_text[0] = vm_strdup(XSTR("L/R", 1030));
|
||||
Mouse_axis_text[1] = vm_strdup(XSTR("U/B", 1031));
|
||||
Invert_text[0] = vm_strdup(XSTR("N", 1032));
|
||||
Invert_text[1] = vm_strdup(XSTR("Y", 1033));
|
||||
|
||||
control_config_list_prepare();
|
||||
}
|
||||
@@ -1645,7 +1714,7 @@ void control_config_close()
|
||||
help_overlay_unload(CONTROL_CONFIG_OVERLAY);
|
||||
|
||||
if (Background_bitmap){
|
||||
bm_unload(Background_bitmap);
|
||||
bm_release(Background_bitmap);
|
||||
}
|
||||
|
||||
Ui_window.destroy();
|
||||
@@ -1657,31 +1726,31 @@ void control_config_close()
|
||||
// free strings
|
||||
for(idx=0; idx<NUM_JOY_AXIS_ACTIONS; idx++){
|
||||
if(Joy_axis_action_text[idx] != NULL){
|
||||
free(Joy_axis_action_text[idx]);
|
||||
vm_free(Joy_axis_action_text[idx]);
|
||||
Joy_axis_action_text[idx] = NULL;
|
||||
}
|
||||
}
|
||||
for(idx=0; idx<NUM_AXIS_TEXT; idx++){
|
||||
if(Joy_axis_text[idx] != NULL){
|
||||
free(Joy_axis_text[idx]);
|
||||
vm_free(Joy_axis_text[idx]);
|
||||
Joy_axis_text[idx] = NULL;
|
||||
}
|
||||
}
|
||||
for(idx=0; idx<NUM_MOUSE_TEXT; idx++){
|
||||
if(Mouse_button_text[idx] != NULL){
|
||||
free(Mouse_button_text[idx]);
|
||||
vm_free(Mouse_button_text[idx]);
|
||||
Mouse_button_text[idx] = NULL;
|
||||
}
|
||||
}
|
||||
for(idx=0; idx<NUM_MOUSE_AXIS_TEXT; idx++){
|
||||
if(Mouse_axis_text[idx] != NULL){
|
||||
free(Mouse_axis_text[idx]);
|
||||
vm_free(Mouse_axis_text[idx]);
|
||||
Mouse_axis_text[idx] = NULL;
|
||||
}
|
||||
}
|
||||
for(idx=0; idx<NUM_INVERT_TEXT; idx++){
|
||||
if(Invert_text[idx] != NULL){
|
||||
free(Invert_text[idx]);
|
||||
vm_free(Invert_text[idx]);
|
||||
Invert_text[idx] = NULL;
|
||||
}
|
||||
}
|
||||
@@ -2176,7 +2245,11 @@ void control_config_do_frame(float frametime)
|
||||
gr_get_string_size(&w, NULL, str);
|
||||
gr_printf(x - w / 2, y - font_height, str);
|
||||
|
||||
strcpy(buf, XSTR(Control_config[i].text, CONTROL_CONFIG_XSTR + i));
|
||||
if (Control_config[i].hasXSTR)
|
||||
strcpy(buf, XSTR(Control_config[i].text, CONTROL_CONFIG_XSTR + i));
|
||||
else
|
||||
strcpy(buf, Control_config[i].text);
|
||||
|
||||
gr_force_fit_string(buf, 255, Conflict_wnd_coords[gr_screen.res][CONTROL_W_COORD]);
|
||||
gr_get_string_size(&w, NULL, buf);
|
||||
gr_printf(x - w / 2, y, buf);
|
||||
@@ -2448,6 +2521,7 @@ int check_control(int id, int key)
|
||||
}
|
||||
|
||||
if ((Control_config[id].key_id == key) || joy_down_count(Control_config[id].joy_id, 1) || mouse_down_count(1 << Control_config[id].joy_id)) {
|
||||
//mprintf(("Key used %d", key));
|
||||
control_used(id);
|
||||
return 1;
|
||||
}
|
||||
|
||||
@@ -9,13 +9,58 @@
|
||||
|
||||
/*
|
||||
* $Logfile: /Freespace2/code/ControlConfig/ControlsConfig.h $
|
||||
* $Revision: 2.0 $
|
||||
* $Date: 2002-06-03 04:02:21 $
|
||||
* $Author: penguin $
|
||||
* $Revision: 2.13 $
|
||||
* $Date: 2005-07-13 02:50:50 $
|
||||
* $Author: Goober5000 $
|
||||
*
|
||||
* Header file for keyboard, joystick and mouse configuration
|
||||
*
|
||||
* $Log: not supported by cvs2svn $
|
||||
* Revision 2.12 2005/07/13 02:30:52 Goober5000
|
||||
* removed autopilot #define
|
||||
* --Goober5000
|
||||
*
|
||||
* Revision 2.11 2005/03/03 06:05:27 wmcoolmon
|
||||
* Merge of WMC's codebase. "Features and bugs, making Goober say "Grr!", as release would be stalled now for two months for sure"
|
||||
*
|
||||
* Revision 2.10 2005/01/16 22:39:08 wmcoolmon
|
||||
* Added VM_TOPDOWN view; Added 2D mission mode, add 16384 to mission +Flags to use.
|
||||
*
|
||||
* Revision 2.9 2004/08/11 05:06:19 Kazan
|
||||
* added preprocdefines.h to prevent what happened with fred -- make sure to make all fred2 headers include this file as the _first_ include -- i have already modified fs2 files to do this
|
||||
*
|
||||
* Revision 2.8 2004/07/25 00:31:28 Kazan
|
||||
* i have absolutely nothing to say about that subject
|
||||
*
|
||||
* Revision 2.7 2004/05/03 21:22:19 Kazan
|
||||
* Abandon strdup() usage for mod list processing - it was acting odd and causing crashing on free()
|
||||
* Fix condition where alt_tab_pause() would flipout and trigger failed assert if game minimizes during startup (like it does a lot during debug)
|
||||
* Nav Point / Auto Pilot code (All disabled via #ifdefs)
|
||||
*
|
||||
* Revision 2.6 2004/04/06 03:09:01 phreak
|
||||
* added a control config option for the wireframe hud targetbox i enabled ages ago
|
||||
*
|
||||
* Revision 2.5 2003/11/11 02:15:43 Goober5000
|
||||
* ubercommit - basically spelling and language fixes with some additional
|
||||
* warnings disabled
|
||||
* --Goober5000
|
||||
*
|
||||
* Revision 2.4 2002/12/02 23:52:02 Goober5000
|
||||
* fixed misspelling
|
||||
*
|
||||
* Revision 2.3 2002/12/02 20:47:28 Goober5000
|
||||
* fixed misspelling of "category" as "catagory"
|
||||
*
|
||||
* Revision 2.2 2002/10/19 19:29:27 bobboau
|
||||
* inital commit, trying to get most of my stuff into FSO, there should be most of my fighter beam, beam rendering, beam shield hit, ABtrails, and ssm stuff. one thing you should be happy to know is the beam texture tileing is now set in the beam section section of the weapon table entry
|
||||
*
|
||||
* Revision 2.1 2002/10/17 20:40:50 randomtiger
|
||||
* Added ability to remove HUD ingame on keypress shift O
|
||||
* So I've added a new key to the bind list and made use of already existing hud removal code.
|
||||
*
|
||||
* Revision 2.0 2002/06/03 04:02:21 penguin
|
||||
* Warpcore CVS sync
|
||||
*
|
||||
* Revision 1.1 2002/05/02 18:03:04 mharris
|
||||
* Initial checkin - converted filenames and includes to lower case
|
||||
*
|
||||
@@ -292,7 +337,8 @@
|
||||
typedef struct config_item {
|
||||
short key_default; // default key bound to action
|
||||
short joy_default; // default joystick button bound to action
|
||||
char tab; // what tab (catagory) it belongs in
|
||||
char tab; // what tab (category) it belongs in
|
||||
bool hasXSTR; // whether we should translate this with an XSTR
|
||||
char *text; // describes the action in the config screen
|
||||
char type; // manner control should be checked in
|
||||
short key_id; // actual key bound to action
|
||||
@@ -309,28 +355,28 @@ typedef struct config_item {
|
||||
|
||||
#define TARGET_NEXT 0
|
||||
#define TARGET_PREV 1
|
||||
#define TARGET_NEXT_CLOSEST_HOSTILE 2
|
||||
#define TARGET_PREV_CLOSEST_HOSTILE 3
|
||||
#define TARGET_NEXT_CLOSEST_HOSTILE 2
|
||||
#define TARGET_PREV_CLOSEST_HOSTILE 3
|
||||
#define TOGGLE_AUTO_TARGETING 4
|
||||
#define TARGET_NEXT_CLOSEST_FRIENDLY 5
|
||||
#define TARGET_PREV_CLOSEST_FRIENDLY 6
|
||||
#define TARGET_SHIP_IN_RETICLE 7
|
||||
#define TARGET_CLOSEST_SHIP_ATTACKING_TARGET 8
|
||||
#define TARGET_LAST_TRANMISSION_SENDER 9
|
||||
#define STOP_TARGETING_SHIP 10
|
||||
#define TARGET_NEXT_CLOSEST_FRIENDLY 5
|
||||
#define TARGET_PREV_CLOSEST_FRIENDLY 6
|
||||
#define TARGET_SHIP_IN_RETICLE 7
|
||||
#define TARGET_CLOSEST_SHIP_ATTACKING_TARGET 8
|
||||
#define TARGET_LAST_TRANMISSION_SENDER 9
|
||||
#define STOP_TARGETING_SHIP 10
|
||||
|
||||
// targeting a ship's subsystem
|
||||
#define TARGET_SUBOBJECT_IN_RETICLE 11
|
||||
#define TARGET_SUBOBJECT_IN_RETICLE 11
|
||||
#define TARGET_NEXT_SUBOBJECT 12
|
||||
#define TARGET_PREV_SUBOBJECT 13
|
||||
#define STOP_TARGETING_SUBSYSTEM 14
|
||||
|
||||
// speed matching
|
||||
#define MATCH_TARGET_SPEED 15
|
||||
#define TOGGLE_AUTO_MATCH_TARGET_SPEED 16
|
||||
#define TOGGLE_AUTO_MATCH_TARGET_SPEED 16
|
||||
|
||||
// weapons
|
||||
#define FIRE_PRIMARY 17
|
||||
#define FIRE_PRIMARY 17
|
||||
#define FIRE_SECONDARY 18
|
||||
#define CYCLE_NEXT_PRIMARY 19
|
||||
#define CYCLE_PREV_PRIMARY 20
|
||||
@@ -341,19 +387,19 @@ typedef struct config_item {
|
||||
// controls
|
||||
#define FORWARD_THRUST 24
|
||||
#define REVERSE_THRUST 25
|
||||
#define BANK_LEFT 26
|
||||
#define BANK_LEFT 26
|
||||
#define BANK_RIGHT 27
|
||||
#define PITCH_FORWARD 28
|
||||
#define PITCH_BACK 29
|
||||
#define YAW_LEFT 30
|
||||
#define YAW_RIGHT 31
|
||||
#define YAW_LEFT 30
|
||||
#define YAW_RIGHT 31
|
||||
|
||||
// throttle control
|
||||
#define ZERO_THROTTLE 32
|
||||
#define MAX_THROTTLE 33
|
||||
#define MAX_THROTTLE 33
|
||||
#define ONE_THIRD_THROTTLE 34
|
||||
#define TWO_THIRDS_THROTTLE 35
|
||||
#define PLUS_5_PERCENT_THROTTLE 36
|
||||
#define TWO_THIRDS_THROTTLE 35
|
||||
#define PLUS_5_PERCENT_THROTTLE 36
|
||||
#define MINUS_5_PERCENT_THROTTLE 37
|
||||
|
||||
// squadmate messaging keys
|
||||
@@ -363,27 +409,27 @@ typedef struct config_item {
|
||||
#define ATTACK_SUBSYSTEM_MESSAGE 41
|
||||
#define CAPTURE_MESSAGE 42
|
||||
#define ENGAGE_MESSAGE 43
|
||||
#define FORM_MESSAGE 44
|
||||
#define FORM_MESSAGE 44
|
||||
#define IGNORE_MESSAGE 45
|
||||
#define PROTECT_MESSAGE 46
|
||||
#define COVER_MESSAGE 47
|
||||
#define WARP_MESSAGE 48
|
||||
#define WARP_MESSAGE 48
|
||||
#define REARM_MESSAGE 49
|
||||
|
||||
#define TARGET_CLOSEST_SHIP_ATTACKING_SELF 50
|
||||
#define TARGET_CLOSEST_SHIP_ATTACKING_SELF 50
|
||||
|
||||
// Views
|
||||
#define VIEW_CHASE 51
|
||||
#define VIEW_EXTERNAL 52
|
||||
#define VIEW_EXTERNAL_TOGGLE_CAMERA_LOCK 53
|
||||
#define VIEW_SLEW 54
|
||||
#define VIEW_EXTERNAL_TOGGLE_CAMERA_LOCK 53
|
||||
#define VIEW_SLEW 54
|
||||
#define VIEW_OTHER_SHIP 55
|
||||
#define VIEW_DIST_INCREASE 56
|
||||
#define VIEW_DIST_DECREASE 57
|
||||
#define VIEW_CENTER 58
|
||||
#define PADLOCK_UP 59
|
||||
#define PADLOCK_DOWN 60
|
||||
#define PADLOCK_LEFT 61
|
||||
#define PADLOCK_DOWN 60
|
||||
#define PADLOCK_LEFT 61
|
||||
#define PADLOCK_RIGHT 62
|
||||
|
||||
|
||||
@@ -400,53 +446,66 @@ typedef struct config_item {
|
||||
#define DECREASE_SHIELD 72
|
||||
#define INCREASE_ENGINE 73
|
||||
#define DECREASE_ENGINE 74
|
||||
#define ETS_EQUALIZE 75
|
||||
#define ETS_EQUALIZE 75
|
||||
#define SHIELD_EQUALIZE 76
|
||||
#define SHIELD_XFER_TOP 77
|
||||
#define SHIELD_XFER_BOTTOM 78
|
||||
#define SHIELD_XFER_LEFT 79
|
||||
#define SHIELD_XFER_RIGHT 80
|
||||
|
||||
#define XFER_SHIELD 81
|
||||
#define XFER_SHIELD 81
|
||||
#define XFER_LASER 82
|
||||
#define SHOW_DAMAGE_POPUP 83 // AL: this binding should be removing next time the controls are reorganized
|
||||
|
||||
#define BANK_WHEN_PRESSED 84
|
||||
#define SHOW_NAVMAP 85
|
||||
#define ADD_REMOVE_ESCORT 86
|
||||
#define ESCORT_CLEAR 87
|
||||
#define TARGET_NEXT_ESCORT_SHIP 88
|
||||
#define ESCORT_CLEAR 87
|
||||
#define TARGET_NEXT_ESCORT_SHIP 88
|
||||
|
||||
#define TARGET_CLOSEST_REPAIR_SHIP 89
|
||||
#define TARGET_NEXT_UNINSPECTED_CARGO 90
|
||||
#define TARGET_PREV_UNINSPECTED_CARGO 91
|
||||
#define TARGET_CLOSEST_REPAIR_SHIP 89
|
||||
#define TARGET_NEXT_UNINSPECTED_CARGO 90
|
||||
#define TARGET_PREV_UNINSPECTED_CARGO 91
|
||||
#define TARGET_NEWEST_SHIP 92
|
||||
#define TARGET_NEXT_LIVE_TURRET 93
|
||||
#define TARGET_PREV_LIVE_TURRET 94
|
||||
#define TARGET_NEXT_LIVE_TURRET 93
|
||||
#define TARGET_PREV_LIVE_TURRET 94
|
||||
|
||||
#define TARGET_NEXT_BOMB 95
|
||||
#define TARGET_PREV_BOMB 96
|
||||
|
||||
// multiplayer messaging keys
|
||||
#define MULTI_MESSAGE_ALL 97
|
||||
#define MULTI_MESSAGE_FRIENDLY 98
|
||||
#define MULTI_MESSAGE_FRIENDLY 98
|
||||
#define MULTI_MESSAGE_HOSTILE 99
|
||||
#define MULTI_MESSAGE_TARGET 100
|
||||
|
||||
// multiplayer misc keys
|
||||
#define MULTI_OBSERVER_ZOOM_TO 101
|
||||
#define MULTI_OBSERVER_ZOOM_TO 101
|
||||
|
||||
#define TIME_SPEED_UP 102
|
||||
#define TIME_SLOW_DOWN 103
|
||||
|
||||
#define TOGGLE_HUD_CONTRAST 104
|
||||
#define TOGGLE_HUD_CONTRAST 104
|
||||
|
||||
#define MULTI_TOGGLE_NETINFO 105
|
||||
|
||||
#define MULTI_SELF_DESTRUCT 106
|
||||
#define MULTI_SELF_DESTRUCT 106
|
||||
|
||||
#define TOGGLE_HUD 107
|
||||
#define RIGHT_SLIDE_THRUST 108
|
||||
#define LEFT_SLIDE_THRUST 109
|
||||
#define UP_SLIDE_THRUST 110
|
||||
#define DOWN_SLIDE_THRUST 111
|
||||
#define HUD_TARGETBOX_TOGGLE_WIREFRAME 112
|
||||
#define VIEW_TOPDOWN 113
|
||||
#define VIEW_TRACK_TARGET 114
|
||||
|
||||
//AutoPilot - Kazan
|
||||
#define AUTO_PILOT_TOGGLE 115
|
||||
#define NAV_CYCLE 116
|
||||
|
||||
// this should be the total number of control action defines above (or last define + 1)
|
||||
#define CCFG_MAX 107
|
||||
#define CCFG_MAX 117
|
||||
|
||||
extern int Failed_key_index;
|
||||
extern int Invert_heading;
|
||||
|
||||
@@ -9,13 +9,51 @@
|
||||
|
||||
/*
|
||||
* $Logfile: /Freespace2/code/ControlConfig/ControlsConfigCommon.cpp $
|
||||
* $Revision: 2.1 $
|
||||
* $Date: 2002-08-01 01:41:04 $
|
||||
* $Author: penguin $
|
||||
* $Revision: 2.12 $
|
||||
* $Date: 2005-07-13 02:30:52 $
|
||||
* $Author: Goober5000 $
|
||||
*
|
||||
* C module for keyboard, joystick and mouse configuration common stuff (between Fred and FreeSpace)
|
||||
*
|
||||
* $Log: not supported by cvs2svn $
|
||||
* Revision 2.11 2005/03/03 06:05:27 wmcoolmon
|
||||
* Merge of WMC's codebase. "Features and bugs, making Goober say "Grr!", as release would be stalled now for two months for sure"
|
||||
*
|
||||
* Revision 2.10 2005/01/16 22:39:08 wmcoolmon
|
||||
* Added VM_TOPDOWN view; Added 2D mission mode, add 16384 to mission +Flags to use.
|
||||
*
|
||||
* Revision 2.9 2004/07/26 20:47:26 Kazan
|
||||
* remove MCD complete
|
||||
*
|
||||
* Revision 2.8 2004/07/25 00:31:28 Kazan
|
||||
* i have absolutely nothing to say about that subject
|
||||
*
|
||||
* Revision 2.7 2004/07/12 16:32:43 Kazan
|
||||
* MCD - define _MCD_CHECK to use memory tracking
|
||||
*
|
||||
* Revision 2.6 2004/05/03 21:22:19 Kazan
|
||||
* Abandon strdup() usage for mod list processing - it was acting odd and causing crashing on free()
|
||||
* Fix condition where alt_tab_pause() would flipout and trigger failed assert if game minimizes during startup (like it does a lot during debug)
|
||||
* Nav Point / Auto Pilot code (All disabled via #ifdefs)
|
||||
*
|
||||
* Revision 2.5 2004/04/06 03:09:01 phreak
|
||||
* added a control config option for the wireframe hud targetbox i enabled ages ago
|
||||
*
|
||||
* Revision 2.4 2003/11/11 02:15:43 Goober5000
|
||||
* ubercommit - basically spelling and language fixes with some additional
|
||||
* warnings disabled
|
||||
* --Goober5000
|
||||
*
|
||||
* Revision 2.3 2002/10/19 19:29:27 bobboau
|
||||
* inital commit, trying to get most of my stuff into FSO, there should be most of my fighter beam, beam rendering, beam shield hit, ABtrails, and ssm stuff. one thing you should be happy to know is the beam texture tileing is now set in the beam section section of the weapon table entry
|
||||
*
|
||||
* Revision 2.2 2002/10/17 20:40:50 randomtiger
|
||||
* Added ability to remove HUD ingame on keypress shift O
|
||||
* So I've added a new key to the bind list and made use of already existing hud removal code.
|
||||
*
|
||||
* Revision 2.1 2002/08/01 01:41:04 penguin
|
||||
* The big include file move
|
||||
*
|
||||
* Revision 2.0 2002/06/03 04:02:21 penguin
|
||||
* Warpcore CVS sync
|
||||
*
|
||||
@@ -30,7 +68,7 @@
|
||||
* minor key name change in german
|
||||
*
|
||||
* 12 10/29/99 6:10p Jefff
|
||||
* squashed the damned y/z german issues once and for all
|
||||
* squashed the y/z german issues once and for all
|
||||
*
|
||||
* 11 10/28/99 11:16p Jefff
|
||||
* Changed some german key names. Made key translations always use the
|
||||
@@ -380,6 +418,7 @@
|
||||
#include "io/joy.h"
|
||||
#include "localization/localize.h"
|
||||
|
||||
|
||||
#define TARGET_TAB 0
|
||||
#define SHIP_TAB 1
|
||||
#define WEAPON_TAB 2
|
||||
@@ -402,141 +441,155 @@ int Invert_axis_defaults[JOY_NUM_AXES] = { 0, 0, 0, 0, 0, 0 };
|
||||
//XSTR:OFF
|
||||
config_item Control_config[CCFG_MAX + 1] = {
|
||||
// targeting a ship
|
||||
{ KEY_T, -1, TARGET_TAB, "Target Next Ship" },
|
||||
{ KEY_SHIFTED | KEY_T, -1, TARGET_TAB, "Target Previous Ship" },
|
||||
{ KEY_H, 2, TARGET_TAB, "Target Next Closest Hostile Ship" },
|
||||
{ KEY_SHIFTED | KEY_H, -1, TARGET_TAB, "Target Previous Closest Hostile Ship" },
|
||||
{ KEY_ALTED | KEY_H, -1, TARGET_TAB, "Toggle Auto Targeting" },
|
||||
{ KEY_F, -1, TARGET_TAB, "Target Next Closest Friendly Ship" },
|
||||
{ KEY_SHIFTED | KEY_F, -1, TARGET_TAB, "Target Previous Closest Friendly Ship" },
|
||||
{ KEY_Y, 4, TARGET_TAB, "Target Ship in Reticle" },
|
||||
{ KEY_G, -1, TARGET_TAB, "Target Target's Nearest Attacker" },
|
||||
{ KEY_ALTED | KEY_Y, -1, TARGET_TAB, "Target Last Ship to Send Transmission" },
|
||||
{ KEY_ALTED | KEY_T, -1, TARGET_TAB, "Turn Off Auto-Targeting" },
|
||||
{ KEY_T, -1, TARGET_TAB, true, "Target Next Ship" },
|
||||
{ KEY_SHIFTED | KEY_T, -1, TARGET_TAB, true, "Target Previous Ship" },
|
||||
{ KEY_H, 2, TARGET_TAB, true, "Target Next Closest Hostile Ship" },
|
||||
{ KEY_SHIFTED | KEY_H, -1, TARGET_TAB, true, "Target Previous Closest Hostile Ship" },
|
||||
{ KEY_ALTED | KEY_H, -1, TARGET_TAB, true, "Toggle Auto Targeting" },
|
||||
{ KEY_F, -1, TARGET_TAB, true, "Target Next Closest Friendly Ship" },
|
||||
{ KEY_SHIFTED | KEY_F, -1, TARGET_TAB, true, "Target Previous Closest Friendly Ship" },
|
||||
{ KEY_Y, 4, TARGET_TAB, true, "Target Ship in Reticle" },
|
||||
{ KEY_G, -1, TARGET_TAB, true, "Target Target's Nearest Attacker" },
|
||||
{ KEY_ALTED | KEY_Y, -1, TARGET_TAB, true, "Target Last Ship to Send Transmission" },
|
||||
{ KEY_ALTED | KEY_T, -1, TARGET_TAB, true, "Turn Off Auto-Targeting" },
|
||||
|
||||
// targeting a ship's subsystem
|
||||
{ KEY_V, -1, TARGET_TAB, "Target Subsystem in Reticle" },
|
||||
{ KEY_S, -1, TARGET_TAB, "Target Next Subsystem" },
|
||||
{ KEY_SHIFTED | KEY_S, -1, TARGET_TAB, "Target Previous Subsystem" },
|
||||
{ KEY_ALTED | KEY_S, -1, TARGET_TAB, "Turn Off Auto-Targeting of Subsystems" },
|
||||
{ KEY_V, -1, TARGET_TAB, true, "Target Subsystem in Reticle" },
|
||||
{ KEY_S, -1, TARGET_TAB, true, "Target Next Subsystem" },
|
||||
{ KEY_SHIFTED | KEY_S, -1, TARGET_TAB, true, "Target Previous Subsystem" },
|
||||
{ KEY_ALTED | KEY_S, -1, TARGET_TAB, true, "Turn Off Auto-Targeting of Subsystems" },
|
||||
|
||||
// matching speed
|
||||
{ KEY_M, -1, COMPUTER_TAB, "Match Target Speed" },
|
||||
{ KEY_ALTED | KEY_M, -1, COMPUTER_TAB, "Toggle Auto Speed Matching" },
|
||||
{ KEY_M, -1, COMPUTER_TAB, true, "Match Target Speed" },
|
||||
{ KEY_ALTED | KEY_M, -1, COMPUTER_TAB, true, "Toggle Auto Speed Matching" },
|
||||
|
||||
// weapons
|
||||
{ KEY_LCTRL, 0, WEAPON_TAB, "Fire Primary Weapon", CC_TYPE_CONTINUOUS },
|
||||
{ KEY_SPACEBAR, 1, WEAPON_TAB, "Fire Secondary Weapon", CC_TYPE_CONTINUOUS },
|
||||
{ KEY_PERIOD, -1, WEAPON_TAB, "Cycle Forward Primary Weapon" },
|
||||
{ KEY_COMMA, -1, WEAPON_TAB, "Cycle Backward Primary Weapon" },
|
||||
{ KEY_DIVIDE, -1, WEAPON_TAB, "Cycle Secondary Weapon Bank" },
|
||||
{ KEY_SHIFTED | KEY_DIVIDE, -1, WEAPON_TAB, "Cycle Secondary Weapon Firing Rate" },
|
||||
{ KEY_X, 3, WEAPON_TAB, "Launch Countermeasure" },
|
||||
{ KEY_LCTRL, 0, WEAPON_TAB, true, "Fire Primary Weapon", CC_TYPE_CONTINUOUS },
|
||||
{ KEY_SPACEBAR, 1, WEAPON_TAB, true, "Fire Secondary Weapon", CC_TYPE_CONTINUOUS },
|
||||
{ KEY_PERIOD, -1, WEAPON_TAB, true, "Cycle Forward Primary Weapon" },
|
||||
{ KEY_COMMA, -1, WEAPON_TAB, true, "Cycle Backward Primary Weapon" },
|
||||
{ KEY_DIVIDE, -1, WEAPON_TAB, true, "Cycle Secondary Weapon Bank" },
|
||||
{ KEY_SHIFTED | KEY_DIVIDE, -1, WEAPON_TAB, true, "Cycle Secondary Weapon Firing Rate" },
|
||||
{ KEY_X, 3, WEAPON_TAB, true, "Launch Countermeasure" },
|
||||
|
||||
// controls
|
||||
{ KEY_A, -1, SHIP_TAB, "Forward Thrust", CC_TYPE_CONTINUOUS },
|
||||
{ KEY_Z, -1, SHIP_TAB, "Reverse Thrust", CC_TYPE_CONTINUOUS },
|
||||
{ KEY_PAD7, -1, SHIP_TAB, "Bank Left", CC_TYPE_CONTINUOUS },
|
||||
{ KEY_PAD9, -1, SHIP_TAB, "Bank Right", CC_TYPE_CONTINUOUS },
|
||||
{ KEY_PAD8, -1, SHIP_TAB, "Pitch Forward", CC_TYPE_CONTINUOUS },
|
||||
{ KEY_PAD2, -1, SHIP_TAB, "Pitch Backward", CC_TYPE_CONTINUOUS },
|
||||
{ KEY_PAD4, -1, SHIP_TAB, "Turn Left", CC_TYPE_CONTINUOUS },
|
||||
{ KEY_PAD6, -1, SHIP_TAB, "Turn Right", CC_TYPE_CONTINUOUS },
|
||||
{ KEY_A, -1, SHIP_TAB, true, "Forward Thrust", CC_TYPE_CONTINUOUS },
|
||||
{ KEY_Z, -1, SHIP_TAB, true, "Reverse Thrust", CC_TYPE_CONTINUOUS },
|
||||
{ KEY_PAD7, -1, SHIP_TAB, true, "Bank Left", CC_TYPE_CONTINUOUS },
|
||||
{ KEY_PAD9, -1, SHIP_TAB, true, "Bank Right", CC_TYPE_CONTINUOUS },
|
||||
{ KEY_PAD8, -1, SHIP_TAB, true, "Pitch Forward", CC_TYPE_CONTINUOUS },
|
||||
{ KEY_PAD2, -1, SHIP_TAB, true, "Pitch Backward", CC_TYPE_CONTINUOUS },
|
||||
{ KEY_PAD4, -1, SHIP_TAB, true, "Turn Left", CC_TYPE_CONTINUOUS },
|
||||
{ KEY_PAD6, -1, SHIP_TAB, true, "Turn Right", CC_TYPE_CONTINUOUS },
|
||||
|
||||
// throttle controls
|
||||
{ KEY_BACKSP, -1, SHIP_TAB, "Set Throttle to Zero" },
|
||||
{ KEY_SLASH, -1, SHIP_TAB, "Set Throttle to Max" },
|
||||
{ KEY_LBRACKET, -1, SHIP_TAB, "Set Throttle to One-Third" },
|
||||
{ KEY_RBRACKET, -1, SHIP_TAB, "Set Throttle to Two-Thirds" },
|
||||
{ KEY_EQUAL, -1, SHIP_TAB, "Increase Throttle 5 Percent" },
|
||||
{ KEY_MINUS, -1, SHIP_TAB, "Decrease Throttle 5 Percent" },
|
||||
{ KEY_BACKSP, -1, SHIP_TAB, true, "Set Throttle to Zero" },
|
||||
{ KEY_SLASH, -1, SHIP_TAB, true, "Set Throttle to Max" },
|
||||
{ KEY_LBRACKET, -1, SHIP_TAB, true, "Set Throttle to One-Third" },
|
||||
{ KEY_RBRACKET, -1, SHIP_TAB, true, "Set Throttle to Two-Thirds" },
|
||||
{ KEY_EQUAL, -1, SHIP_TAB, true, "Increase Throttle 5 Percent" },
|
||||
{ KEY_MINUS, -1, SHIP_TAB, true, "Decrease Throttle 5 Percent" },
|
||||
|
||||
// squadmate messaging
|
||||
{ KEY_SHIFTED | KEY_A, -1, COMPUTER_TAB, "Attack My Target" },
|
||||
{ KEY_SHIFTED | KEY_Z, -1, COMPUTER_TAB, "Disarm My Target" },
|
||||
{ KEY_SHIFTED | KEY_D, -1, COMPUTER_TAB, "Disable My Target" },
|
||||
{ KEY_SHIFTED | KEY_V, -1, COMPUTER_TAB, "Attack my Subsystem" },
|
||||
{ KEY_SHIFTED | KEY_X, -1, COMPUTER_TAB, "Capture My Target" },
|
||||
{ KEY_SHIFTED | KEY_E, -1, COMPUTER_TAB, "Engage Enemy" },
|
||||
{ KEY_SHIFTED | KEY_W, -1, COMPUTER_TAB, "Form on my Wing" },
|
||||
{ KEY_SHIFTED | KEY_I, -1, COMPUTER_TAB, "Ignore my Target" },
|
||||
{ KEY_SHIFTED | KEY_P, -1, COMPUTER_TAB, "Protect my Target" },
|
||||
{ KEY_SHIFTED | KEY_C, -1, COMPUTER_TAB, "Cover me" },
|
||||
{ KEY_SHIFTED | KEY_J, -1, COMPUTER_TAB, "Return to base" },
|
||||
{ KEY_SHIFTED | KEY_R, -1, COMPUTER_TAB, "Rearm me" },
|
||||
{ KEY_SHIFTED | KEY_A, -1, COMPUTER_TAB, true, "Attack My Target" },
|
||||
{ KEY_SHIFTED | KEY_Z, -1, COMPUTER_TAB, true, "Disarm My Target" },
|
||||
{ KEY_SHIFTED | KEY_D, -1, COMPUTER_TAB, true, "Disable My Target" },
|
||||
{ KEY_SHIFTED | KEY_V, -1, COMPUTER_TAB, true, "Attack my Subsystem" },
|
||||
{ KEY_SHIFTED | KEY_X, -1, COMPUTER_TAB, true, "Capture My Target" },
|
||||
{ KEY_SHIFTED | KEY_E, -1, COMPUTER_TAB, true, "Engage Enemy" },
|
||||
{ KEY_SHIFTED | KEY_W, -1, COMPUTER_TAB, true, "Form on my Wing" },
|
||||
{ KEY_SHIFTED | KEY_I, -1, COMPUTER_TAB, true, "Ignore my Target" },
|
||||
{ KEY_SHIFTED | KEY_P, -1, COMPUTER_TAB, true, "Protect my Target" },
|
||||
{ KEY_SHIFTED | KEY_C, -1, COMPUTER_TAB, true, "Cover me" },
|
||||
{ KEY_SHIFTED | KEY_J, -1, COMPUTER_TAB, true, "Return to base" },
|
||||
{ KEY_SHIFTED | KEY_R, -1, COMPUTER_TAB, true, "Rearm me" },
|
||||
|
||||
{ KEY_R, 6, TARGET_TAB, "Target Closest Attacking Ship" },
|
||||
{ KEY_R, 6, TARGET_TAB, true, "Target Closest Attacking Ship" },
|
||||
|
||||
// Views
|
||||
{ KEY_PADMULTIPLY, -1, COMPUTER_TAB, "Chase View" },
|
||||
{ KEY_PADPERIOD, -1, COMPUTER_TAB, "External View"},
|
||||
{ KEY_PADENTER, -1, COMPUTER_TAB, "Toggle External Camera Lock"},
|
||||
{ KEY_PAD0, -1, COMPUTER_TAB, "Free Look View", CC_TYPE_CONTINUOUS },
|
||||
{ KEY_PADDIVIDE, -1, COMPUTER_TAB, "Current Target View" },
|
||||
{ KEY_PADPLUS, -1, COMPUTER_TAB, "Increase View Distance", CC_TYPE_CONTINUOUS },
|
||||
{ KEY_PADMINUS, -1, COMPUTER_TAB, "Decrease View Distance", CC_TYPE_CONTINUOUS },
|
||||
{ KEY_PAD5, -1, COMPUTER_TAB, "Center View", CC_TYPE_CONTINUOUS },
|
||||
{ -1, 33, COMPUTER_TAB, "View Up", CC_TYPE_CONTINUOUS },
|
||||
{ -1, 32, COMPUTER_TAB, "View Rear", CC_TYPE_CONTINUOUS },
|
||||
{ -1, 34, COMPUTER_TAB, "View Left", CC_TYPE_CONTINUOUS },
|
||||
{ -1, 35, COMPUTER_TAB, "View Right", CC_TYPE_CONTINUOUS },
|
||||
{ KEY_PADMULTIPLY, -1, COMPUTER_TAB, true, "Chase View" },
|
||||
{ KEY_PADPERIOD, -1, COMPUTER_TAB, true, "External View"},
|
||||
{ KEY_PADENTER, -1, COMPUTER_TAB, true, "Toggle External Camera Lock"},
|
||||
{ KEY_PAD0, -1, COMPUTER_TAB, true, "Free Look View", CC_TYPE_CONTINUOUS },
|
||||
{ KEY_PADDIVIDE, -1, COMPUTER_TAB, true, "Current Target View" },
|
||||
{ KEY_PADPLUS, -1, COMPUTER_TAB, true, "Increase View Distance", CC_TYPE_CONTINUOUS },
|
||||
{ KEY_PADMINUS, -1, COMPUTER_TAB, true, "Decrease View Distance", CC_TYPE_CONTINUOUS },
|
||||
{ KEY_PAD5, -1, COMPUTER_TAB, true, "Center View", CC_TYPE_CONTINUOUS },
|
||||
{ -1, 33, COMPUTER_TAB, true, "View Up", CC_TYPE_CONTINUOUS },
|
||||
{ -1, 32, COMPUTER_TAB, true, "View Rear", CC_TYPE_CONTINUOUS },
|
||||
{ -1, 34, COMPUTER_TAB, true, "View Left", CC_TYPE_CONTINUOUS },
|
||||
{ -1, 35, COMPUTER_TAB, true, "View Right", CC_TYPE_CONTINUOUS },
|
||||
|
||||
{ KEY_RAPOSTRO, -1, COMPUTER_TAB, "Cycle Radar Range" },
|
||||
{ KEY_C, -1, COMPUTER_TAB, "Communications Menu" },
|
||||
{ -1, -1, -1, "Show Objectives" },
|
||||
{ KEY_ALTED | KEY_J, -1, COMPUTER_TAB, "Enter Subspace (End Mission)" },
|
||||
{ KEY_J, -1, TARGET_TAB, "Target Target's Target" },
|
||||
{ KEY_TAB, 5, SHIP_TAB, "Afterburner", CC_TYPE_CONTINUOUS },
|
||||
{ KEY_RAPOSTRO, -1, COMPUTER_TAB, true, "Cycle Radar Range" },
|
||||
{ KEY_C, -1, COMPUTER_TAB, true, "Communications Menu" },
|
||||
{ -1, -1, -1, true, "Show Objectives" },
|
||||
{ KEY_ALTED | KEY_J, -1, COMPUTER_TAB, true, "Enter Subspace (End Mission)" },
|
||||
{ KEY_J, -1, TARGET_TAB, true, "Target Target's Target" },
|
||||
{ KEY_TAB, 5, SHIP_TAB, true, "Afterburner", CC_TYPE_CONTINUOUS },
|
||||
|
||||
{ KEY_INSERT, -1, COMPUTER_TAB, "Increase Weapon Energy" },
|
||||
{ KEY_DELETE, -1, COMPUTER_TAB, "Decrease Weapon Energy" },
|
||||
{ KEY_HOME, -1, COMPUTER_TAB, "Increase Shield Energy" },
|
||||
{ KEY_END, -1, COMPUTER_TAB, "Decrease Shield Energy" },
|
||||
{ KEY_PAGEUP, -1, COMPUTER_TAB, "Increase Engine Energy" },
|
||||
{ KEY_PAGEDOWN, -1, COMPUTER_TAB, "Decrease Engine Energy" },
|
||||
{ KEY_ALTED | KEY_D, -1, COMPUTER_TAB, "Equalize Energy Settings" },
|
||||
{ KEY_INSERT, -1, COMPUTER_TAB, true, "Increase Weapon Energy" },
|
||||
{ KEY_DELETE, -1, COMPUTER_TAB, true, "Decrease Weapon Energy" },
|
||||
{ KEY_HOME, -1, COMPUTER_TAB, true, "Increase Shield Energy" },
|
||||
{ KEY_END, -1, COMPUTER_TAB, true, "Decrease Shield Energy" },
|
||||
{ KEY_PAGEUP, -1, COMPUTER_TAB, true, "Increase Engine Energy" },
|
||||
{ KEY_PAGEDOWN, -1, COMPUTER_TAB, true, "Decrease Engine Energy" },
|
||||
{ KEY_ALTED | KEY_D, -1, COMPUTER_TAB, true, "Equalize Energy Settings" },
|
||||
|
||||
{ KEY_Q, 7, COMPUTER_TAB, "Equalize Shield" },
|
||||
{ KEY_UP, -1, COMPUTER_TAB, "Augment Forward Shield" },
|
||||
{ KEY_DOWN, -1, COMPUTER_TAB, "Augment Rear Shield" },
|
||||
{ KEY_LEFT, -1, COMPUTER_TAB, "Augment Left Shield" },
|
||||
{ KEY_RIGHT, -1, COMPUTER_TAB, "Augment Right Shield" },
|
||||
{ KEY_SCROLLOCK, -1, COMPUTER_TAB, "Transfer Energy Laser->Shield" },
|
||||
{ KEY_SHIFTED | KEY_SCROLLOCK, -1, COMPUTER_TAB, "Transfer Energy Shield->Laser" },
|
||||
{ -1, -1, -1, "Show Damage Popup Window" },
|
||||
{ KEY_Q, 7, COMPUTER_TAB, true, "Equalize Shield" },
|
||||
{ KEY_UP, -1, COMPUTER_TAB, true, "Augment Forward Shield" },
|
||||
{ KEY_DOWN, -1, COMPUTER_TAB, true, "Augment Rear Shield" },
|
||||
{ KEY_LEFT, -1, COMPUTER_TAB, true, "Augment Left Shield" },
|
||||
{ KEY_RIGHT, -1, COMPUTER_TAB, true, "Augment Right Shield" },
|
||||
{ KEY_SCROLLOCK, -1, COMPUTER_TAB, true, "Transfer Energy Laser->Shield" },
|
||||
{ KEY_SHIFTED | KEY_SCROLLOCK, -1, COMPUTER_TAB, true, "Transfer Energy Shield->Laser" },
|
||||
{ -1, -1, -1, true, "Show Damage Popup Window" },
|
||||
|
||||
{ -1, -1, SHIP_TAB, "Bank When Pressed", CC_TYPE_CONTINUOUS },
|
||||
{ -1, -1, -1, "Show NavMap" },
|
||||
{ KEY_ALTED | KEY_E, -1, COMPUTER_TAB, "Add or Remove Escort" },
|
||||
{ KEY_ALTED | KEY_SHIFTED | KEY_E, -1, COMPUTER_TAB, "Clear Escort List" },
|
||||
{ KEY_E, -1, TARGET_TAB, "Target Next Escort Ship" },
|
||||
{ KEY_ALTED | KEY_R, -1, TARGET_TAB, "Target Closest Repair Ship" },
|
||||
{ -1, -1, SHIP_TAB, true, "Bank When Pressed", CC_TYPE_CONTINUOUS },
|
||||
{ -1, -1, -1, true, "Show NavMap" },
|
||||
{ KEY_ALTED | KEY_E, -1, COMPUTER_TAB, true, "Add or Remove Escort" },
|
||||
{ KEY_ALTED | KEY_SHIFTED | KEY_E, -1, COMPUTER_TAB, true, "Clear Escort List" },
|
||||
{ KEY_E, -1, TARGET_TAB, true, "Target Next Escort Ship" },
|
||||
{ KEY_ALTED | KEY_R, -1, TARGET_TAB, true, "Target Closest Repair Ship" },
|
||||
|
||||
{ KEY_U, -1, TARGET_TAB, "Target Next Uninspected Cargo" },
|
||||
{ KEY_SHIFTED | KEY_U, -1, TARGET_TAB, "Target Previous Uninspected Cargo" },
|
||||
{ KEY_N, -1, TARGET_TAB, "Target Newest Ship In Area" },
|
||||
{ KEY_K, -1, TARGET_TAB, "Target Next Live Turret" },
|
||||
{ KEY_SHIFTED | KEY_K, -1, TARGET_TAB, "Target Previous Live Turret" },
|
||||
{ KEY_U, -1, TARGET_TAB, true, "Target Next Uninspected Cargo" },
|
||||
{ KEY_SHIFTED | KEY_U, -1, TARGET_TAB, true, "Target Previous Uninspected Cargo" },
|
||||
{ KEY_N, -1, TARGET_TAB, true, "Target Newest Ship In Area" },
|
||||
{ KEY_K, -1, TARGET_TAB, true, "Target Next Live Turret" },
|
||||
{ KEY_SHIFTED | KEY_K, -1, TARGET_TAB, true, "Target Previous Live Turret" },
|
||||
|
||||
{ KEY_B, -1, TARGET_TAB, "Target Next Hostile Bomb or Bomber" },
|
||||
{ KEY_SHIFTED | KEY_B, -1, TARGET_TAB, "Target Previous Hostile Bomb or Bomber" },
|
||||
{ KEY_B, -1, TARGET_TAB, true, "Target Next Hostile Bomb or Bomber" },
|
||||
{ KEY_SHIFTED | KEY_B, -1, TARGET_TAB, true, "Target Previous Hostile Bomb or Bomber" },
|
||||
|
||||
// multiplayer messaging keys
|
||||
{ KEY_1, -1, COMPUTER_TAB, "(Multiplayer) Message All", CC_TYPE_CONTINUOUS },
|
||||
{ KEY_2, -1, COMPUTER_TAB, "(Multiplayer) Message Friendly", CC_TYPE_CONTINUOUS },
|
||||
{ KEY_3, -1, COMPUTER_TAB, "(Multiplayer) Message Hostile", CC_TYPE_CONTINUOUS },
|
||||
{ KEY_4, -1, COMPUTER_TAB, "(Multiplayer) Message Target", CC_TYPE_CONTINUOUS },
|
||||
{ KEY_ALTED | KEY_X, -1, COMPUTER_TAB, "(Multiplayer) Observer zoom to target"},
|
||||
{ KEY_1, -1, COMPUTER_TAB, true, "(Multiplayer) Message All", CC_TYPE_CONTINUOUS },
|
||||
{ KEY_2, -1, COMPUTER_TAB, true, "(Multiplayer) Message Friendly", CC_TYPE_CONTINUOUS },
|
||||
{ KEY_3, -1, COMPUTER_TAB, true, "(Multiplayer) Message Hostile", CC_TYPE_CONTINUOUS },
|
||||
{ KEY_4, -1, COMPUTER_TAB, true, "(Multiplayer) Message Target", CC_TYPE_CONTINUOUS },
|
||||
{ KEY_ALTED | KEY_X, -1, COMPUTER_TAB, true, "(Multiplayer) Observer zoom to target"},
|
||||
|
||||
{ KEY_SHIFTED | KEY_PERIOD, -1, COMPUTER_TAB, "Increase time compression" },
|
||||
{ KEY_SHIFTED | KEY_COMMA, -1, COMPUTER_TAB, "Decrease time compression" },
|
||||
{ KEY_SHIFTED | KEY_PERIOD, -1, COMPUTER_TAB, true, "Increase time compression" },
|
||||
{ KEY_SHIFTED | KEY_COMMA, -1, COMPUTER_TAB, true, "Decrease time compression" },
|
||||
|
||||
{ KEY_L, -1, COMPUTER_TAB, "Toggle high HUD contrast" },
|
||||
{ KEY_L, -1, COMPUTER_TAB, true, "Toggle high HUD contrast" },
|
||||
|
||||
{ KEY_SHIFTED | KEY_N, -1, COMPUTER_TAB, "(Multiplayer) Toggle network info"},
|
||||
{ KEY_SHIFTED | KEY_END, -1, COMPUTER_TAB, "(Multiplayer) Self destruct"},
|
||||
{ KEY_SHIFTED | KEY_N, -1, COMPUTER_TAB, true, "(Multiplayer) Toggle network info"},
|
||||
{ KEY_SHIFTED | KEY_END, -1, COMPUTER_TAB, true, "(Multiplayer) Self destruct"},
|
||||
|
||||
{ -1, -1, -1, "" }
|
||||
// Misc
|
||||
{ KEY_SHIFTED | KEY_O, -1, COMPUTER_TAB, true, "Toggle HUD"},
|
||||
{ KEY_SHIFTED | KEY_3, -1, SHIP_TAB, true, "Right Thrust", CC_TYPE_CONTINUOUS},
|
||||
{ KEY_SHIFTED | KEY_1, -1, SHIP_TAB, true, "Left Thrust", CC_TYPE_CONTINUOUS},
|
||||
{ KEY_SHIFTED | KEY_PADPLUS, -1, SHIP_TAB, true, "Up Thrust", CC_TYPE_CONTINUOUS},
|
||||
{ KEY_SHIFTED | KEY_PADENTER, -1, SHIP_TAB, true, "Down Thrust", CC_TYPE_CONTINUOUS},
|
||||
{ KEY_ALTED | KEY_SHIFTED | KEY_Q, -1, COMPUTER_TAB, true, "Toggle HUD Wireframe Targetbox"},
|
||||
{ -1, -1, COMPUTER_TAB, false, "Top-down View"},
|
||||
{ -1, -1, COMPUTER_TAB, false, "Track targeted object", CC_TYPE_CONTINUOUS},
|
||||
|
||||
// Auto Navigation Systen
|
||||
{ KEY_ALTED | KEY_A, -1, COMPUTER_TAB, false, "Toggle Auto Pilot"},
|
||||
{ KEY_ALTED | KEY_N, -1, COMPUTER_TAB, false, "Cycle Nav Points"},
|
||||
|
||||
{ -1, -1, -1, false, "" }
|
||||
};
|
||||
|
||||
char *Scan_code_text_german[] = {
|
||||
|
||||
@@ -9,13 +9,16 @@
|
||||
|
||||
/*
|
||||
* $Logfile: /Freespace2/code/Cryptstring/cryptstring.cpp $
|
||||
* $Revision: 2.1 $
|
||||
* $Date: 2002-08-01 01:41:04 $
|
||||
* $Author: penguin $
|
||||
* $Revision: 2.2 $
|
||||
* $Date: 2005-09-08 00:09:32 $
|
||||
* $Author: taylor $
|
||||
*
|
||||
* Applet for crypting strings.
|
||||
*
|
||||
* $Log: not supported by cvs2svn $
|
||||
* Revision 2.1 2002/08/01 01:41:04 penguin
|
||||
* The big include file move
|
||||
*
|
||||
* Revision 2.0 2002/06/03 04:02:21 penguin
|
||||
* Warpcore CVS sync
|
||||
*
|
||||
@@ -33,6 +36,13 @@
|
||||
#include <string.h>
|
||||
#include "globalincs/crypt.h"
|
||||
|
||||
|
||||
// we end up #include'ing SDL.h which on Windows and Mac will redfine main() which is something
|
||||
// that we don't want since we don't actually link against SDL, this solves the problem...
|
||||
#ifdef main
|
||||
#undef main
|
||||
#endif
|
||||
|
||||
int main(int argc, char **argv)
|
||||
{
|
||||
int i;
|
||||
|
||||
@@ -9,13 +9,88 @@
|
||||
|
||||
/*
|
||||
* $Logfile: /Freespace2/code/Cutscene/Cutscenes.cpp $
|
||||
* $Revision: 2.2 $
|
||||
* $Date: 2002-08-01 01:41:04 $
|
||||
* $Author: penguin $
|
||||
* $Revision: 2.17 $
|
||||
* $Date: 2005-07-02 19:42:14 $
|
||||
* $Author: taylor $
|
||||
* $Revision: 2.17 $
|
||||
* $Date: 2005-07-02 19:42:14 $
|
||||
* $Author: taylor $
|
||||
*
|
||||
* Code for the cutscenes viewer screen
|
||||
*
|
||||
* $Log: not supported by cvs2svn $
|
||||
* Revision 2.16 2005/05/12 17:49:11 taylor
|
||||
* use vm_malloc(), vm_free(), vm_realloc(), vm_strdup() rather than system named macros
|
||||
* fixes various problems and is past time to make the switch
|
||||
*
|
||||
* Revision 2.15 2005/02/23 04:51:55 taylor
|
||||
* some bm_unload() -> bm_release() changes to save bmpman slots
|
||||
*
|
||||
* Revision 2.14 2005/01/31 23:27:51 taylor
|
||||
* merge with Linux/OSX tree - p0131-2
|
||||
*
|
||||
* Revision 2.13 2004/07/26 20:47:26 Kazan
|
||||
* remove MCD complete
|
||||
*
|
||||
* Revision 2.12 2004/07/12 16:32:43 Kazan
|
||||
* MCD - define _MCD_CHECK to use memory tracking
|
||||
*
|
||||
* Revision 2.11 2004/04/26 13:11:11 taylor
|
||||
* mark view cutscenes ignoring extension and file case
|
||||
*
|
||||
* Revision 2.10 2004/03/05 09:01:58 Goober5000
|
||||
* Uber pass at reducing #includes
|
||||
* --Goober5000
|
||||
*
|
||||
* Revision 2.9 2004/02/20 04:29:53 bobboau
|
||||
* pluged memory leaks,
|
||||
* 3D HTL lasers (they work perfictly)
|
||||
* and posably fixed Turnsky's shinemap bug
|
||||
*
|
||||
* Revision 2.8 2004/01/24 15:52:25 randomtiger
|
||||
* I have submitted the new movie playing code despite the fact in D3D it sometimes plays behind the main window.
|
||||
* In OGL it works perfectly and in both API's it doesnt switch to the desktop anymore so hopefully people will not experience the crashes etc that the old system used to suffer from.
|
||||
*
|
||||
* Revision 2.7 2003/08/21 20:54:38 randomtiger
|
||||
* Fixed switching - RT
|
||||
*
|
||||
* Revision 2.6 2003/07/15 02:58:08 phreak
|
||||
* the cutscene section in the techroom does not append *.mve onto a filename
|
||||
*
|
||||
* Revision 2.5 2003/03/18 10:07:01 unknownplayer
|
||||
* The big DX/main line merge. This has been uploaded to the main CVS since I can't manage to get it to upload to the DX branch. Apologies to all who may be affected adversely, but I'll work to debug it as fast as I can.
|
||||
*
|
||||
* Revision 2.4 2002/08/27 13:38:57 penguin
|
||||
* Moved DirectX8 stuff to directx8 branch; reverted to previous
|
||||
*
|
||||
* Revision 2.2.2.4 2002/09/24 18:56:41 randomtiger
|
||||
* DX8 branch commit
|
||||
*
|
||||
* This is the scub of UP's previous code with the more up to date RT code.
|
||||
* For full details check previous dev e-mails
|
||||
*
|
||||
* Revision 2.2.2.3 2002/08/28 21:47:02 randomtiger
|
||||
* Tiny change to DX branch to keep movie code optional (default off)
|
||||
*
|
||||
* Revision 2.2.2.2 2002/08/28 12:39:35 randomtiger
|
||||
* OK, this should be a commit to the DX branch or Im going to be in a lot of trouble.
|
||||
* The movie and dx8show files have been cleaned up big time.
|
||||
* My debug system is in but has NO EFFECT at all unless a compiler flag is turned on, check h file for details.
|
||||
* Aside from that a few changes to help the movie code work properly.
|
||||
* Works on most things including GF4 and Voodoo 3. However may not work properly on a voodoo 2.
|
||||
* Im going to leave this as a bug for now, serves you right for buying voodoo!
|
||||
*
|
||||
* Revision 2.2.2.1 2002/08/27 13:19:26 penguin
|
||||
* Moved to directx8 branch
|
||||
*
|
||||
* Revision 2.3 2002/08/18 19:48:29 randomtiger
|
||||
* Added new lib files: strmiids and ddraw to get dshow working
|
||||
* Added new command line parameter to active direct show movie play: -dshowvid
|
||||
* Uncommented movie_play calls and includes
|
||||
*
|
||||
* Revision 2.2 2002/08/01 01:41:04 penguin
|
||||
* The big include file move
|
||||
*
|
||||
* Revision 2.1 2002/07/07 19:55:58 penguin
|
||||
* Back-port to MSVC
|
||||
*
|
||||
@@ -152,17 +227,17 @@
|
||||
|
||||
#include "cutscene/cutscenes.h"
|
||||
#include "ui/ui.h"
|
||||
#include "cfile/cfile.h"
|
||||
#include "gamesnd/gamesnd.h"
|
||||
#include "gamesequence/gamesequence.h"
|
||||
#include "freespace2/freespace.h"
|
||||
#include "io/key.h"
|
||||
#include "bmpman/bmpman.h"
|
||||
// #include "movie.h"
|
||||
#include "movie.h"
|
||||
#include "popup/popup.h"
|
||||
#include "menuui/mainhallmenu.h"
|
||||
#include "globalincs/alphacolors.h"
|
||||
#include "localization/localize.h"
|
||||
#include "parse/parselo.h"
|
||||
|
||||
|
||||
char *Cutscene_bitmap_name[GR_NUM_RESOLUTIONS] = {
|
||||
"ViewFootage",
|
||||
@@ -179,10 +254,15 @@ int Description_index;
|
||||
cutscene_info Cutscenes[MAX_CUTSCENES];
|
||||
|
||||
//extern int All_movies_enabled; // If set, all movies may be viewed. Keyed off cheat code.
|
||||
void cutsceen_close(){
|
||||
for(int i = 0; i<MAX_CUTSCENES; i++)
|
||||
if(Cutscenes[i].description)vm_free(Cutscenes[i].description);
|
||||
}
|
||||
|
||||
// initialization stuff for cutscenes
|
||||
void cutscene_init()
|
||||
{
|
||||
atexit(cutsceen_close);
|
||||
char buf[MULTITEXT_LENGTH];
|
||||
int rval;
|
||||
|
||||
@@ -210,7 +290,7 @@ void cutscene_init()
|
||||
stuff_string(buf, F_MULTITEXT, NULL);
|
||||
drop_white_space(buf);
|
||||
compact_multitext_string(buf);
|
||||
Cutscenes[Num_cutscenes].description = strdup(buf);
|
||||
Cutscenes[Num_cutscenes].description = vm_strdup(buf);
|
||||
required_string("$cd:");
|
||||
stuff_int( &Cutscenes[Num_cutscenes].cd );
|
||||
|
||||
@@ -229,7 +309,6 @@ void cutscene_init()
|
||||
// returns -1 on failure.
|
||||
int cutscenes_get_cd_num( char *filename )
|
||||
{
|
||||
#ifdef _WIN32
|
||||
#if defined(OEM_BUILD)
|
||||
return 0; // only 1 cd for OEM
|
||||
#else
|
||||
@@ -243,18 +322,34 @@ int cutscenes_get_cd_num( char *filename )
|
||||
|
||||
return -1;
|
||||
#endif // defined(OEM_BUILD)
|
||||
#else // !WIN32
|
||||
return -1;
|
||||
#endif // ifdef WIN32
|
||||
}
|
||||
|
||||
// marks a cutscene as viewable
|
||||
void cutscene_mark_viewable(char *filename)
|
||||
{
|
||||
int i;
|
||||
char cut_file[MAX_FILENAME_LEN];
|
||||
char file[MAX_FILENAME_LEN];
|
||||
|
||||
Assert(filename);
|
||||
|
||||
// strip off extension
|
||||
strcpy( file, filename );
|
||||
char *p = strchr( file, '.' );
|
||||
if ( p ) {
|
||||
*p = 0;
|
||||
}
|
||||
|
||||
// change to lower case
|
||||
strlwr(file);
|
||||
|
||||
for (i = 0; i < Num_cutscenes; i++ ) {
|
||||
if ( !stricmp(Cutscenes[i].filename, filename) ) {
|
||||
// change the cutscene file name to lower case
|
||||
strcpy(cut_file, Cutscenes[i].filename);
|
||||
strlwr(cut_file);
|
||||
|
||||
// see if the stripped filename matches the cutscene filename
|
||||
if ( strstr(cut_file, file) != NULL ) {
|
||||
Cutscenes_viewable |= (1<<i);
|
||||
return;
|
||||
}
|
||||
@@ -275,7 +370,7 @@ void cutscene_mark_viewable(char *filename)
|
||||
|
||||
static int Num_files;
|
||||
static int Cutscene_list[MAX_CUTSCENES];
|
||||
static int Stats_scroll_offset;
|
||||
//static int Stats_scroll_offset; // not used - taylor
|
||||
static int Selected_line = 0; // line that is currently selected for binding
|
||||
static int Scroll_offset;
|
||||
static int Background_bitmap;
|
||||
@@ -363,7 +458,6 @@ static char *Text_lines[MAX_TEXT_LINES];
|
||||
|
||||
int cutscenes_validate_cd(char *mve_name, int prompt_for_cd)
|
||||
{
|
||||
#ifdef _WIN32
|
||||
int cd_present = 0;
|
||||
int cd_drive_num;
|
||||
int cd_mve_is_on;
|
||||
@@ -422,7 +516,7 @@ int cutscenes_validate_cd(char *mve_name, int prompt_for_cd)
|
||||
if ( num_attempts++ > 5 ) {
|
||||
cd_present = 0;
|
||||
break;
|
||||
}
|
||||
}
|
||||
#else
|
||||
cd_present = 0;
|
||||
break;
|
||||
@@ -430,33 +524,31 @@ int cutscenes_validate_cd(char *mve_name, int prompt_for_cd)
|
||||
|
||||
}
|
||||
|
||||
return cd_present;
|
||||
#else // !WIN32
|
||||
return 0;
|
||||
#endif // ifdef WIN32
|
||||
return cd_present;
|
||||
}
|
||||
|
||||
void cutscenes_screen_play()
|
||||
{
|
||||
char name[MAX_FILENAME_LEN], *full_name;
|
||||
char name[MAX_FILENAME_LEN]; // *full_name
|
||||
int which_cutscene;
|
||||
|
||||
Assert( (Selected_line >= 0) && (Selected_line < Num_files) );
|
||||
which_cutscene = Cutscene_list[Selected_line];
|
||||
|
||||
strcpy(name, Cutscenes[which_cutscene].filename );
|
||||
full_name = cf_add_ext(name, NOX(".mve"));
|
||||
// full_name = cf_add_ext(name, NOX(".mve"));
|
||||
|
||||
main_hall_stop_music();
|
||||
int rval = movie_play(name);
|
||||
main_hall_start_music();
|
||||
|
||||
// no soup for you!
|
||||
/*
|
||||
int rval = movie_play(full_name);
|
||||
if ( !rval ) {
|
||||
char str[256];
|
||||
|
||||
sprintf(str, XSTR( "Unable to play movie %s.", 204), Cutscenes[which_cutscene].name );
|
||||
popup(0, 1, POPUP_OK, str );
|
||||
}
|
||||
*/
|
||||
|
||||
}
|
||||
|
||||
void cutscenes_screen_scroll_line_up()
|
||||
@@ -570,7 +662,7 @@ void cutscenes_screen_init()
|
||||
int i;
|
||||
ui_button_info *b;
|
||||
|
||||
Ui_window.create(0, 0, gr_screen.max_w, gr_screen.max_h, 0);
|
||||
Ui_window.create(0, 0, gr_screen.max_w_unscaled, gr_screen.max_h_unscaled, 0);
|
||||
Ui_window.set_mask_bmap(Cutscene_mask_name[gr_screen.res]);
|
||||
|
||||
for (i=0; i<NUM_BUTTONS; i++) {
|
||||
@@ -623,7 +715,7 @@ void cutscenes_screen_init()
|
||||
void cutscenes_screen_close()
|
||||
{
|
||||
if (Background_bitmap)
|
||||
bm_unload(Background_bitmap);
|
||||
bm_release(Background_bitmap);
|
||||
|
||||
Ui_window.destroy();
|
||||
}
|
||||
|
||||
@@ -9,13 +9,23 @@
|
||||
|
||||
/*
|
||||
* $Logfile: /Freespace2/code/Cutscene/Cutscenes.h $
|
||||
* $Revision: 2.1 $
|
||||
* $Date: 2002-08-01 01:41:04 $
|
||||
* $Author: penguin $
|
||||
* $Revision: 2.4 $
|
||||
* $Date: 2005-07-13 02:50:50 $
|
||||
* $Author: Goober5000 $
|
||||
*
|
||||
* Code for the cutscenes viewer screen
|
||||
*
|
||||
* $Log: not supported by cvs2svn $
|
||||
* Revision 2.3 2004/08/11 05:06:20 Kazan
|
||||
* added preprocdefines.h to prevent what happened with fred -- make sure to make all fred2 headers include this file as the _first_ include -- i have already modified fs2 files to do this
|
||||
*
|
||||
* Revision 2.2 2004/03/05 09:01:58 Goober5000
|
||||
* Uber pass at reducing #includes
|
||||
* --Goober5000
|
||||
*
|
||||
* Revision 2.1 2002/08/01 01:41:04 penguin
|
||||
* The big include file move
|
||||
*
|
||||
* Revision 2.0 2002/06/03 04:02:21 penguin
|
||||
* Warpcore CVS sync
|
||||
*
|
||||
@@ -53,7 +63,8 @@
|
||||
#ifndef _FREESPACE_CUTSCENES_SCREEN_HEADER_FILE
|
||||
#define _FREESPACE_CUTSCENES_SCREEN_HEADER_FILE
|
||||
|
||||
#include "parse/parselo.h"
|
||||
#include "globalincs/globals.h"
|
||||
#include "globalincs/pstypes.h"
|
||||
|
||||
#define MAX_CUTSCENES 10
|
||||
|
||||
|
||||
@@ -0,0 +1,262 @@
|
||||
/*
|
||||
* Copyright (C) Volition, Inc. 1999. All rights reserved.
|
||||
*
|
||||
* All source code herein is the property of Volition, Inc. You may not sell
|
||||
* or otherwise commercially exploit the source or things you created based on the
|
||||
* source.
|
||||
*
|
||||
*/
|
||||
|
||||
/*
|
||||
* $Logfile: /Freespace2/code/cutscene/movie.cpp $
|
||||
* $Revision: 2.26 $
|
||||
* $Date: 2005-05-12 17:37:48 $
|
||||
* $Author: taylor $
|
||||
*
|
||||
* movie player code
|
||||
*
|
||||
* $Log: not supported by cvs2svn $
|
||||
* Revision 2.25 2005/04/24 06:52:23 wmcoolmon
|
||||
* Enabled movies in windowed mode; if this causes problems for people, they can always use -dnoshowvid
|
||||
*
|
||||
* Revision 2.24 2005/02/05 00:30:49 taylor
|
||||
* fix a few things post merge
|
||||
*
|
||||
* Revision 2.23 2004/11/27 10:42:18 taylor
|
||||
* this should get movies working again in D3D and help OGL too
|
||||
*
|
||||
* Revision 2.22 2004/07/26 20:47:26 Kazan
|
||||
* remove MCD complete
|
||||
*
|
||||
* Revision 2.21 2004/07/12 16:32:43 Kazan
|
||||
* MCD - define _MCD_CHECK to use memory tracking
|
||||
*
|
||||
* Revision 2.20 2004/04/26 13:09:20 taylor
|
||||
* cvs log header, mark cutscenes viewable for later, gr_flip() to fix OGL white flash
|
||||
*
|
||||
*
|
||||
*
|
||||
* $NoKeywords: $
|
||||
*/
|
||||
|
||||
#ifdef _WIN32
|
||||
#include <windows.h>
|
||||
#include "directx/dx8show.h"
|
||||
#include "graphics/grd3dinternal.h"
|
||||
#endif
|
||||
|
||||
#include "cutscene/movie.h"
|
||||
#include "osapi/osapi.h"
|
||||
#include "cmdline/cmdline.h"
|
||||
#include "debugconsole/dbugfile.h"
|
||||
#include "cfile/cfile.h"
|
||||
#include "cutscene/cutscenes.h" // cutscene_mark_viewable()
|
||||
#include "freespace2/freespace.h" // for Game_mode, etc.
|
||||
|
||||
|
||||
|
||||
// This module links freespace movie calls to the actual API calls the play the movie.
|
||||
// This module handles all the different requires of OS and gfx API and finding the file to play
|
||||
|
||||
void process_messages()
|
||||
{
|
||||
#ifdef _WIN32
|
||||
MSG msg;
|
||||
while(PeekMessage(&msg, (HWND) os_get_window(), 0, 0, PM_REMOVE))
|
||||
{
|
||||
TranslateMessage(&msg);
|
||||
DispatchMessage(&msg);
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
|
||||
// filename - file to search for
|
||||
// out_name - output, full path to file
|
||||
// returns non-zero if file is found
|
||||
int movie_find(char *filename, char *out_name)
|
||||
{
|
||||
char full_path[MAX_PATH];
|
||||
char tmp_name[MAX_PATH];
|
||||
char search_name[MAX_PATH];
|
||||
int i, size, offset = 0;
|
||||
const int NUM_EXT = 2;
|
||||
const char *movie_ext[NUM_EXT] = { ".avi", ".mpg" };
|
||||
|
||||
if (out_name == NULL) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
// remove extension
|
||||
strcpy( tmp_name, filename );
|
||||
char *p = strchr( tmp_name, '.' );
|
||||
if ( p ) {
|
||||
*p = 0;
|
||||
}
|
||||
|
||||
for (i=0; i<NUM_EXT; i++) {
|
||||
strcpy( search_name, tmp_name );
|
||||
strcat( search_name, movie_ext[i] );
|
||||
|
||||
// try and find the file
|
||||
if ( cf_find_file_location(search_name, CF_TYPE_ANY, full_path, &size, &offset, 0) ) {
|
||||
// if it's not in a packfile then we're done
|
||||
if (offset == 0) {
|
||||
strcpy( out_name, full_path );
|
||||
return 1;
|
||||
}
|
||||
}
|
||||
|
||||
// clear old string
|
||||
strcpy( search_name, "" );
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
// Play one movie
|
||||
bool movie_play(char *name)
|
||||
{
|
||||
// mark the movie as viewable to the player when in a campaign
|
||||
// do this before anything else so that we're sure the movie is available
|
||||
// to the player even if it's not going to play right now
|
||||
if (Game_mode & GM_CAMPAIGN_MODE) {
|
||||
cutscene_mark_viewable(name);
|
||||
}
|
||||
|
||||
extern int Is_standalone;
|
||||
if(Is_standalone) return false;
|
||||
if(Cmdline_dnoshowvid) return false;
|
||||
//Commented this out since we have dnoshowvid -WMC
|
||||
//if(Cmdline_window) return false;
|
||||
|
||||
char full_name[MAX_PATH];
|
||||
int rc = 0;
|
||||
|
||||
rc = movie_find(name, full_name);
|
||||
|
||||
if (!rc) {
|
||||
DBUGFILE_OUTPUT_1("MOVIE ERROR: Cant open movie file %s", name);
|
||||
return false;
|
||||
} else {
|
||||
DBUGFILE_OUTPUT_1("About to play: %s", full_name);
|
||||
}
|
||||
|
||||
#ifdef _WIN32
|
||||
process_messages();
|
||||
|
||||
// This is a bit of a hack but it works nicely
|
||||
if(gr_screen.mode == GR_DIRECT3D)
|
||||
{
|
||||
GlobalD3DVars::D3D_activate = 0;
|
||||
GlobalD3DVars::lpD3DDevice->EndScene();
|
||||
GlobalD3DVars::lpD3DDevice->Present(NULL,NULL,NULL,NULL);
|
||||
// d3d_lost_device();
|
||||
}
|
||||
|
||||
// reset the gr_* stuff before trying to play a movie
|
||||
gr_flip(); // in the case of D3D this should recover the device
|
||||
gr_clear();
|
||||
gr_flip(); // need an extra flip here to cycle in the clear'd buffer
|
||||
|
||||
// This clears the screen
|
||||
InvalidateRect((HWND) os_get_window(), NULL, TRUE);
|
||||
PAINTSTRUCT paint_info;
|
||||
HDC clear_hdc = BeginPaint((HWND) os_get_window(),&paint_info);
|
||||
|
||||
if(clear_hdc)
|
||||
{
|
||||
|
||||
POINT points[4] = {
|
||||
{0,0},
|
||||
{gr_screen.max_w,0},
|
||||
{gr_screen.max_w, gr_screen.max_h},
|
||||
{0, gr_screen.max_h}};
|
||||
|
||||
HBRUSH hBrush = CreateSolidBrush(0x00000000);
|
||||
HBRUSH hOldBrush = (HBRUSH)SelectObject(clear_hdc, hBrush);
|
||||
SelectObject(clear_hdc, hBrush);
|
||||
|
||||
Polygon(clear_hdc, points, 4);
|
||||
|
||||
SelectObject(clear_hdc, hOldBrush);
|
||||
DeleteObject(hBrush);
|
||||
|
||||
EndPaint((HWND) os_get_window(),&paint_info);
|
||||
}
|
||||
|
||||
process_messages();
|
||||
|
||||
if(OpenClip((HWND) os_get_window(), full_name))
|
||||
{
|
||||
|
||||
do
|
||||
{
|
||||
// Give system threads time to run (and don't sample user input madly)
|
||||
Sleep(100);
|
||||
|
||||
MSG msg;
|
||||
while(PeekMessage(&msg, (HWND) os_get_window(), 0, 0, PM_REMOVE))
|
||||
{
|
||||
TranslateMessage(&msg);
|
||||
|
||||
|
||||
if(msg.message == WM_ERASEBKGND)
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
PassMsgToVideoWindow((HWND) os_get_window(), msg.message, msg.wParam, msg.lParam);
|
||||
|
||||
if(msg.message == WM_PAINT)
|
||||
{
|
||||
}
|
||||
|
||||
if(msg.message != WM_KEYDOWN)
|
||||
{
|
||||
// DefWindowProc((HWND) os_get_window(), msg.message, msg.wParam, msg.lParam);
|
||||
DispatchMessage(&msg);
|
||||
continue;
|
||||
}
|
||||
|
||||
switch(msg.wParam )
|
||||
{
|
||||
// Quits movie if escape, space or return is pressed
|
||||
case VK_ESCAPE:
|
||||
case VK_SPACE:
|
||||
case VK_RETURN:
|
||||
{
|
||||
// Terminate movie playback early
|
||||
CloseClip((HWND) os_get_window());
|
||||
GlobalD3DVars::D3D_activate = 1;
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
// Stream bit of the movie then handle windows messages
|
||||
while(dx8show_stream_movie() == false);
|
||||
|
||||
}
|
||||
|
||||
// We finished playing the movie
|
||||
CloseClip((HWND) os_get_window());
|
||||
|
||||
if (gr_screen.mode == GR_DIRECT3D) {
|
||||
GlobalD3DVars::D3D_activate = 1;
|
||||
}
|
||||
#else
|
||||
STUB_FUNCTION;
|
||||
#endif
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
bool movie_play_two(char *name1, char *name2)
|
||||
{
|
||||
bool result1 = movie_play(name1);
|
||||
process_messages();
|
||||
bool result2 = movie_play(name2);
|
||||
|
||||
return result1 && result2;
|
||||
}
|
||||
@@ -0,0 +1,8 @@
|
||||
|
||||
#ifndef _MOVIE_HEADER_FILE
|
||||
#define _MOVIE_HEADER_FILE
|
||||
|
||||
bool movie_play(char *name);
|
||||
bool movie_play_two(char *name1, char *name2);
|
||||
|
||||
#endif
|
||||
@@ -0,0 +1,227 @@
|
||||
#include "ddsutils/ddsutils.h"
|
||||
#include "cfile/cfile.h"
|
||||
|
||||
|
||||
|
||||
int Texture_compression_enabled=0;
|
||||
|
||||
|
||||
int dds_read_header(char *filename, CFILE *img_cfp, int *width, int *height, int *bpp, int *compression_type, int *levels, int *size)
|
||||
{
|
||||
DDSURFACEDESC2 dds_header;
|
||||
int code = 0;
|
||||
CFILE *ddsfile;
|
||||
char real_name[MAX_FILENAME_LEN];
|
||||
int retval = DDS_ERROR_NONE;
|
||||
int ct = DDS_UNCOMPRESSED;
|
||||
int bits = 0;
|
||||
int trash;
|
||||
|
||||
if (img_cfp == NULL) {
|
||||
// this better not happen.. ever
|
||||
Assert(filename != NULL);
|
||||
|
||||
// make sure there is an extension
|
||||
strcpy(real_name, filename);
|
||||
char *p = strchr(real_name, '.');
|
||||
if (p) { *p=0; }
|
||||
strcat(real_name, ".dds");
|
||||
|
||||
// try to open the file
|
||||
ddsfile = cfopen(real_name, "rb");
|
||||
|
||||
// file not found
|
||||
if (ddsfile == NULL)
|
||||
return DDS_ERROR_INVALID_FILENAME;
|
||||
} else {
|
||||
ddsfile = img_cfp;
|
||||
}
|
||||
|
||||
// read the code
|
||||
code = cfread_int(ddsfile);
|
||||
|
||||
// check it
|
||||
if (code != DDS_FILECODE)
|
||||
return DDS_ERROR_BAD_HEADER;
|
||||
|
||||
// read header variables
|
||||
dds_header.dwSize = cfread_uint(ddsfile); //INTEL_INT( dds_header.dwSize );
|
||||
dds_header.dwFlags = cfread_uint(ddsfile); //INTEL_INT( dds_header.dwFlags );
|
||||
dds_header.dwHeight = cfread_uint(ddsfile); //INTEL_INT( dds_header.dwHeight );
|
||||
dds_header.dwWidth = cfread_uint(ddsfile); //INTEL_INT( dds_header.dwWidth );
|
||||
dds_header.dwPitchOrLinearSize = cfread_uint(ddsfile); //INTEL_INT( dds_header.dwPitchOrLinearSize );
|
||||
dds_header.dwDepth = cfread_uint(ddsfile); //INTEL_INT( dds_header.dwDepth);
|
||||
dds_header.dwMipMapCount = cfread_uint(ddsfile); //INTEL_INT( dds_header.dwMipMapCount );
|
||||
|
||||
// skip over the crap we don't care about
|
||||
for (int i = 0; i < 11; i++)
|
||||
trash = cfread_uint(ddsfile);
|
||||
|
||||
dds_header.ddpfPixelFormat.dwSize = cfread_uint(ddsfile); //INTEL_INT( dds_header.ddpfPixelFormat.dwSize );
|
||||
dds_header.ddpfPixelFormat.dwFlags = cfread_uint(ddsfile); //INTEL_INT( dds_header.ddpfPixelFormat.dwFlags );
|
||||
dds_header.ddpfPixelFormat.dwFourCC = cfread_uint(ddsfile); //INTEL_INT( dds_header.ddpfPixelFormat.dwFourCC );
|
||||
dds_header.ddpfPixelFormat.dwRGBBitCount = cfread_uint(ddsfile); //INTEL_INT( dds_header.ddpfPixelFormat.dwRGBBitCount );
|
||||
dds_header.ddpfPixelFormat.dwRBitMask = cfread_uint(ddsfile); //INTEL_INT( dds_header.ddpfPixelFormat.dwRBitMask );
|
||||
dds_header.ddpfPixelFormat.dwGBitMask = cfread_uint(ddsfile); //INTEL_INT( dds_header.ddpfPixelFormat.dwGBitMask );
|
||||
dds_header.ddpfPixelFormat.dwBBitMask = cfread_uint(ddsfile); //INTEL_INT( dds_header.ddpfPixelFormat.dwBBitMask );
|
||||
dds_header.ddpfPixelFormat.dwRGBAlphaBitMask = cfread_uint(ddsfile); //INTEL_INT( dds_header.ddpfPixelFormat.dwRGBAlphaBitMask );
|
||||
|
||||
// calculate the type and size of the data
|
||||
if (dds_header.ddpfPixelFormat.dwFlags & DDPF_FOURCC) {
|
||||
// did I mention lately that I hate Microsoft?
|
||||
// this is here to fix the situation where Microsoft doesn't follow their own docs
|
||||
if ( dds_header.dwPitchOrLinearSize <= 0 ) {
|
||||
if (dds_header.dwDepth == 0)
|
||||
dds_header.dwDepth = 1;
|
||||
|
||||
// calculate the block size, mult by 8 for DXT1, 16 for DXT3 & 5
|
||||
*size = ((dds_header.dwWidth + 3)/4) * ((dds_header.dwHeight + 3)/4) * ((dds_header.dwDepth + 3)/4) * ((dds_header.ddpfPixelFormat.dwFourCC == FOURCC_DXT1) ? 8 : 16);
|
||||
} else {
|
||||
*size = dds_header.dwMipMapCount > 1 ? dds_header.dwPitchOrLinearSize * 2 : dds_header.dwPitchOrLinearSize;
|
||||
}
|
||||
|
||||
switch (dds_header.ddpfPixelFormat.dwFourCC) {
|
||||
case FOURCC_DXT1:
|
||||
bits=24;
|
||||
ct=DDS_DXT1;
|
||||
break;
|
||||
|
||||
case FOURCC_DXT3:
|
||||
bits=32;
|
||||
ct=DDS_DXT3;
|
||||
break;
|
||||
|
||||
case FOURCC_DXT5:
|
||||
bits=32;
|
||||
ct=DDS_DXT5;
|
||||
break;
|
||||
|
||||
// dxt2 and dxt4 aren't supported
|
||||
case FOURCC_DXT2:
|
||||
case FOURCC_DXT4:
|
||||
retval = DDS_ERROR_INVALID_FORMAT;
|
||||
ct = DDS_DXT_INVALID;
|
||||
break;
|
||||
|
||||
// none of the above
|
||||
default:
|
||||
retval = DDS_ERROR_UNSUPPORTED;
|
||||
ct = DDS_DXT_INVALID;
|
||||
break;
|
||||
}
|
||||
} else if (dds_header.ddpfPixelFormat.dwFlags & DDPF_RGB) {
|
||||
if (dds_header.dwDepth == 0)
|
||||
dds_header.dwDepth = 1;
|
||||
|
||||
*size = dds_header.dwWidth * dds_header.dwHeight * dds_header.dwDepth * (dds_header.ddpfPixelFormat.dwRGBBitCount / 8);
|
||||
|
||||
bits = dds_header.ddpfPixelFormat.dwRGBBitCount;
|
||||
ct = DDS_UNCOMPRESSED;
|
||||
} else {
|
||||
// it's not a readable format
|
||||
retval = DDS_ERROR_UNSUPPORTED;
|
||||
}
|
||||
|
||||
// stuff important info
|
||||
if (bpp)
|
||||
*bpp = bits;
|
||||
|
||||
if (compression_type)
|
||||
*compression_type = ct;
|
||||
|
||||
if (width)
|
||||
*width = dds_header.dwWidth;
|
||||
|
||||
if (height)
|
||||
*height = dds_header.dwHeight;
|
||||
|
||||
if (levels)
|
||||
*levels = dds_header.dwMipMapCount;
|
||||
|
||||
if (img_cfp == NULL) {
|
||||
// close file and return
|
||||
cfclose(ddsfile);
|
||||
ddsfile = NULL;
|
||||
}
|
||||
|
||||
return retval;
|
||||
}
|
||||
|
||||
//reads pixel info from a dds file
|
||||
int dds_read_bitmap(char *filename, ubyte *data, ubyte *bpp)
|
||||
{
|
||||
int retval;
|
||||
int w,h,ct,lvl;
|
||||
int size = 0, bits = 0;
|
||||
CFILE *cfp;
|
||||
char real_name[MAX_FILENAME_LEN];
|
||||
|
||||
// this better not happen.. ever
|
||||
Assert(filename != NULL);
|
||||
|
||||
// make sure there is an extension
|
||||
strcpy(real_name, filename);
|
||||
char *p = strchr(real_name, '.');
|
||||
if (p) { *p = 0; }
|
||||
strcat(real_name, ".dds");
|
||||
|
||||
// open it up and go to the data section
|
||||
cfp = cfopen(real_name, "rb");
|
||||
|
||||
// just in case
|
||||
if (cfp == NULL)
|
||||
return DDS_ERROR_INVALID_FILENAME;
|
||||
|
||||
// read the header -- if its at this stage, it should be legal.
|
||||
retval = dds_read_header(real_name, cfp, &w, &h, &bits, &ct, &lvl, &size);
|
||||
Assert(retval == DDS_ERROR_NONE);
|
||||
|
||||
// this really shouldn't be needed but better safe than sorry
|
||||
if (retval != DDS_ERROR_NONE) {
|
||||
return retval;
|
||||
}
|
||||
|
||||
cfseek(cfp, DDS_OFFSET, CF_SEEK_SET);
|
||||
|
||||
// read in the data
|
||||
cfread(data, 1, size, cfp);
|
||||
|
||||
if (bpp)
|
||||
*bpp = (ubyte)bits;
|
||||
|
||||
// we look done here
|
||||
cfclose(cfp);
|
||||
|
||||
return DDS_ERROR_NONE;
|
||||
}
|
||||
|
||||
//returns string representation of DDS_** error code
|
||||
const char *dds_error_string(int code)
|
||||
{
|
||||
switch (code)
|
||||
{
|
||||
case DDS_ERROR_NONE:
|
||||
return "No error";
|
||||
|
||||
case DDS_ERROR_NO_MEM:
|
||||
return "Insufficient memory";
|
||||
|
||||
case DDS_ERROR_INVALID_FILENAME:
|
||||
return "File not found";
|
||||
|
||||
case DDS_ERROR_BAD_HEADER:
|
||||
return "Filecode did not equal \"DDS \"";
|
||||
|
||||
case DDS_ERROR_INVALID_FORMAT:
|
||||
return "File was compressed, but it was DXT2 or DXT4";
|
||||
|
||||
case DDS_ERROR_UNSUPPORTED:
|
||||
return "*.DDS files must be uncompressed or use DXT1, DXT3, or DXT5 compression";
|
||||
|
||||
default:
|
||||
return "Abort, retry, fail?";
|
||||
}
|
||||
|
||||
//get a warning otherwise
|
||||
return "Abort, retry, fail?";
|
||||
}
|
||||
@@ -0,0 +1,90 @@
|
||||
//header file to load .dds files
|
||||
//these use dxtc texture compression
|
||||
|
||||
#ifndef __DDS_H
|
||||
#define __DDS_H
|
||||
|
||||
#include "globalincs/pstypes.h"
|
||||
#ifdef _WIN32
|
||||
#include "directx/vddraw.h"
|
||||
#endif
|
||||
|
||||
struct CFILE;
|
||||
|
||||
#define DDS_ERROR_NONE 0 //everything went fine
|
||||
#define DDS_ERROR_INVALID_FILENAME 1 //bad filename
|
||||
#define DDS_ERROR_NO_MEM 2 //not enough mem to load
|
||||
#define DDS_ERROR_UNSUPPORTED 3 //not a readable format
|
||||
#define DDS_ERROR_INVALID_FORMAT 4 //can only use dxtc1, dxtc3, dxtc5
|
||||
#define DDS_ERROR_BAD_HEADER 5 //header was not "DDS "
|
||||
|
||||
|
||||
#define DDS_DXT_INVALID -1
|
||||
#define DDS_UNCOMPRESSED 0
|
||||
#define DDS_DXT1 1
|
||||
#define DDS_DXT3 3
|
||||
#define DDS_DXT5 5
|
||||
|
||||
#ifndef MAKEFOURCC
|
||||
#define MAKEFOURCC(ch0, ch1, ch2, ch3) \
|
||||
((DWORD)(BYTE)(ch0) | ((DWORD)(BYTE)(ch1) << 8) | \
|
||||
((DWORD)(BYTE)(ch2) << 16) | ((DWORD)(BYTE)(ch3) << 24 ))
|
||||
#endif //defined(MAKEFOURCC)
|
||||
|
||||
// FOURCC codes for DX compressed-texture pixel formats
|
||||
#define FOURCC_DXT1 (MAKEFOURCC('D','X','T','1'))
|
||||
#define FOURCC_DXT2 (MAKEFOURCC('D','X','T','2'))
|
||||
#define FOURCC_DXT3 (MAKEFOURCC('D','X','T','3'))
|
||||
#define FOURCC_DXT4 (MAKEFOURCC('D','X','T','4'))
|
||||
#define FOURCC_DXT5 (MAKEFOURCC('D','X','T','5'))
|
||||
|
||||
#define DDS_FILECODE 0x20534444 // "DDS " in file
|
||||
|
||||
#ifndef DUMMYUNIONNAMEN
|
||||
#if defined(__cplusplus) || !defined(NONAMELESSUNION)
|
||||
#define DUMMYUNIONNAMEN(n)
|
||||
#else
|
||||
#define DUMMYUNIONNAMEN(n) u##n
|
||||
#endif
|
||||
#endif
|
||||
|
||||
//these structures are the headers for a dds file
|
||||
typedef struct _DDSCAPS2
|
||||
{
|
||||
DWORD dwCaps1;
|
||||
DWORD dwCaps2;
|
||||
DWORD Reserved[2];
|
||||
} DDSCAPS2;
|
||||
|
||||
typedef struct _DDSURFACEDESC2
|
||||
{
|
||||
DWORD dwSize; // size of the DDSURFACEDESC structure
|
||||
DWORD dwFlags; // determines what fields are valid
|
||||
DWORD dwHeight; // height of surface to be created
|
||||
DWORD dwWidth; // width of input surface
|
||||
DWORD dwPitchOrLinearSize;
|
||||
DWORD dwDepth;
|
||||
DWORD dwMipMapCount;
|
||||
DWORD dwReserved1[11];
|
||||
DDPIXELFORMAT ddpfPixelFormat;
|
||||
DDSCAPS2 ddsCaps; // direct draw surface capabilities
|
||||
DWORD dwReserved2;
|
||||
} DDSURFACEDESC2, FAR* LPDDSURFACEDESC2;
|
||||
|
||||
#define DDS_OFFSET 4+sizeof(DDSURFACEDESC2) //place where the data starts -- should be 128
|
||||
|
||||
//reads a dds header
|
||||
//returns one of the error values
|
||||
//'compression_type' comes back as one of the DDS_DXTC* defines
|
||||
int dds_read_header(char *filename, CFILE *img_cfp = NULL, int *width = 0, int *height = 0, int *bpp = 0, int *compression_type = 0, int *levels = 0, int *size = 0);
|
||||
|
||||
//reads bitmap
|
||||
//size of the data it stored in size
|
||||
int dds_read_bitmap(char *filename, ubyte *data, ubyte *bpp = NULL);
|
||||
|
||||
//returns a string from a DDS error code
|
||||
const char* dds_error_string(int code);
|
||||
|
||||
extern int Texture_compression_enabled;
|
||||
|
||||
#endif //__DDS_H
|
||||
@@ -9,13 +9,72 @@
|
||||
|
||||
/*
|
||||
* $Logfile: /Freespace2/code/Debris/Debris.cpp $
|
||||
* $Revision: 2.1 $
|
||||
* $Date: 2002-08-01 01:41:04 $
|
||||
* $Author: penguin $
|
||||
* $Revision: 2.17 $
|
||||
* $Date: 2005-07-22 10:18:37 $
|
||||
* $Author: Goober5000 $
|
||||
*
|
||||
* Code for the pieces of exploding object debris.
|
||||
*
|
||||
* $Log: not supported by cvs2svn $
|
||||
* Revision 2.16 2005/07/13 02:50:51 Goober5000
|
||||
* remove PreProcDefine #includes in FS2
|
||||
* --Goober5000
|
||||
*
|
||||
* Revision 2.15 2005/07/13 02:01:28 Goober5000
|
||||
* fixed a bunch of "issues" caused by me with the species stuff
|
||||
* --Goober5000
|
||||
*
|
||||
* Revision 2.14 2005/07/13 00:44:21 Goober5000
|
||||
* improved species support and removed need for #define
|
||||
* --Goober5000
|
||||
*
|
||||
* Revision 2.13 2005/04/05 05:53:15 taylor
|
||||
* s/vector/vec3d/g, better support for different compilers (Jens Granseuer)
|
||||
*
|
||||
* Revision 2.12 2005/03/27 12:28:32 Goober5000
|
||||
* clarified max hull/shield strength names and added ship guardian thresholds
|
||||
* --Goober5000
|
||||
*
|
||||
* Revision 2.11 2005/03/02 21:24:43 taylor
|
||||
* more network/inferno goodness for Windows, takes care of a few warnings too
|
||||
*
|
||||
* Revision 2.10 2005/01/30 09:27:39 Goober5000
|
||||
* nitpicked some boolean tests, and fixed two small bugs
|
||||
* --Goober5000
|
||||
*
|
||||
* Revision 2.9 2004/07/26 20:47:26 Kazan
|
||||
* remove MCD complete
|
||||
*
|
||||
* Revision 2.8 2004/07/12 16:32:44 Kazan
|
||||
* MCD - define _MCD_CHECK to use memory tracking
|
||||
*
|
||||
* Revision 2.7 2004/07/01 01:52:20 phreak
|
||||
* function pointer radar update.
|
||||
* will enable us to make different radar styles that we can switch between
|
||||
*
|
||||
* Revision 2.6 2004/03/31 05:42:26 Goober5000
|
||||
* got rid of all those nasty warnings from xlocale and so forth; also added comments
|
||||
* for #pragma warning disable to indicate the message being disabled
|
||||
* --Goober5000
|
||||
*
|
||||
* Revision 2.5 2004/03/05 09:01:59 Goober5000
|
||||
* Uber pass at reducing #includes
|
||||
* --Goober5000
|
||||
*
|
||||
* Revision 2.4 2003/10/15 22:03:24 Kazan
|
||||
* Da Species Update :D
|
||||
*
|
||||
* Revision 2.3 2003/04/29 01:03:22 Goober5000
|
||||
* implemented the custom hitpoints mod
|
||||
* --Goober5000
|
||||
*
|
||||
* Revision 2.2 2003/03/19 12:29:01 unknownplayer
|
||||
* Woohoo! Killed two birds with one stone!
|
||||
* Fixed the 'black screen around dialog boxes' problem and also the much more serious freezing problem experienced by Goober5000. It wasn't a crash, just an infinite loop. DX8 merge is GO! once again :)
|
||||
*
|
||||
* Revision 2.1 2002/08/01 01:41:04 penguin
|
||||
* The big include file move
|
||||
*
|
||||
* Revision 2.0 2002/06/03 04:02:21 penguin
|
||||
* Warpcore CVS sync
|
||||
*
|
||||
@@ -220,21 +279,21 @@
|
||||
* $NoKeywords: $
|
||||
*/
|
||||
|
||||
#include "render/3d.h"
|
||||
#include "bmpman/bmpman.h"
|
||||
#include "object/object.h"
|
||||
|
||||
#include "debris/debris.h"
|
||||
#include "render/3d.h"
|
||||
#include "fireball/fireballs.h"
|
||||
#include "radar/radar.h"
|
||||
#include "mission/missionparse.h" // For MAX_SPECIES_NAMES
|
||||
#include "gamesnd/gamesnd.h"
|
||||
#include "object/objectsnd.h"
|
||||
#include "globalincs/linklist.h"
|
||||
#include "globalincs/systemvars.h"
|
||||
#include "particle/particle.h"
|
||||
#include "freespace2/freespace.h"
|
||||
#include "object/objcollide.h"
|
||||
#include "io/timer.h"
|
||||
#include "species_defs/species_defs.h"
|
||||
#include "ship/ship.h"
|
||||
#include "radar/radarsetup.h"
|
||||
|
||||
#ifndef NO_NETWORK
|
||||
#include "network/multi.h"
|
||||
@@ -242,6 +301,9 @@
|
||||
#include "network/multiutil.h"
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
|
||||
#define MAX_LIFE 10.0f
|
||||
#define MIN_RADIUS_FOR_PERSISTANT_DEBRIS 50 // ship radius at which debris from it becomes persistant
|
||||
#define DEBRIS_SOUND_DELAY 2000 // time to start debris sound after created
|
||||
@@ -259,13 +321,11 @@ int Debris_inited = 0;
|
||||
int Debris_model = -1;
|
||||
int Debris_vaporize_model = -1;
|
||||
int Debris_num_submodels = 0;
|
||||
char * Debris_texture_files[MAX_SPECIES_NAMES] = {
|
||||
NOX("debris01a"), // Terran
|
||||
NOX("debris01b"), // Species B
|
||||
NOX("debris01c"), // Shivan
|
||||
};
|
||||
|
||||
int Debris_textures[MAX_SPECIES_NAMES];
|
||||
char Debris_texture_files[MAX_SPECIES][FILESPEC_LENGTH];
|
||||
|
||||
|
||||
int Debris_textures[MAX_SPECIES];
|
||||
|
||||
#define MAX_DEBRIS_DIST 10000.0f // Debris goes away if it's this far away.
|
||||
#define DEBRIS_DISTANCE_CHECK_TIME (10*1000) // Check every 10 seconds.
|
||||
@@ -338,7 +398,7 @@ void debris_page_in()
|
||||
int i;
|
||||
|
||||
Debris_model = model_load( NOX("debris01.pof"), 0, NULL );
|
||||
if (Debris_model>-1) {
|
||||
if (Debris_model >= 0) {
|
||||
polymodel * pm;
|
||||
pm = model_get(Debris_model);
|
||||
Debris_num_submodels = pm->n_models;
|
||||
@@ -346,7 +406,7 @@ void debris_page_in()
|
||||
|
||||
Debris_vaporize_model = model_load( NOX("debris02.pof"), 0, NULL );
|
||||
|
||||
for (i=0; i<MAX_SPECIES_NAMES; i++ ) {
|
||||
for (i=0; i<True_NumSpecies; i++ ) {
|
||||
nprintf(( "Paging", "Paging in debris texture '%s'\n", Debris_texture_files[i] ));
|
||||
Debris_textures[i] = bm_load( Debris_texture_files[i] );
|
||||
if ( Debris_textures[i] < 0 ) {
|
||||
@@ -381,7 +441,7 @@ void debris_render(object * obj)
|
||||
Assert( db->flags & DEBRIS_USED );
|
||||
|
||||
// Swap in a different texture depending on the species
|
||||
if ( (db->species > -1) && (db->species < MAX_SPECIES_NAMES) ) {
|
||||
if ( (db->species > -1) && (db->species < MAX_SPECIES) ) {
|
||||
|
||||
pm = model_get( db->model_num );
|
||||
|
||||
@@ -547,7 +607,7 @@ void debris_process_post(object * obj, float frame_time)
|
||||
|
||||
int n, n_arcs = ((rand()>>5) % 3)+1; // Create 1-3 sparks
|
||||
|
||||
vector v1, v2, v3, v4;
|
||||
vec3d v1, v2, v3, v4;
|
||||
submodel_get_two_random_points( db->model_num, db->submodel_num, &v1, &v2 );
|
||||
submodel_get_two_random_points( db->model_num, db->submodel_num, &v3, &v4 );
|
||||
|
||||
@@ -590,7 +650,7 @@ void debris_process_post(object * obj, float frame_time)
|
||||
|
||||
// rotate v2 out of local coordinates into world.
|
||||
// Use v2 since it is used in every bolt. See above switch().
|
||||
vector snd_pos;
|
||||
vec3d snd_pos;
|
||||
vm_vec_unrotate(&snd_pos, &v2, &obj->orient);
|
||||
vm_vec_add2(&snd_pos, &obj->pos );
|
||||
|
||||
@@ -627,7 +687,7 @@ void debris_process_post(object * obj, float frame_time)
|
||||
// Maybe move a vertex.... 20% of the time maybe?
|
||||
int mr = myrand();
|
||||
if ( mr < RAND_MAX/5 ) {
|
||||
vector v1, v2;
|
||||
vec3d v1, v2;
|
||||
submodel_get_two_random_points( db->model_num, db->submodel_num, &v1, &v2 );
|
||||
db->arc_pts[i][mr % 2] = v1;
|
||||
}
|
||||
@@ -663,7 +723,7 @@ int debris_find_oldest()
|
||||
}
|
||||
|
||||
#define DEBRIS_ROTVEL_SCALE 5.0f
|
||||
void calc_debris_physics_properties( physics_info *pi, vector *min, vector *max );
|
||||
void calc_debris_physics_properties( physics_info *pi, vec3d *min, vec3d *max );
|
||||
// ---------------------------------------------------------------------------------------
|
||||
// debris_create()
|
||||
//
|
||||
@@ -671,7 +731,7 @@ void calc_debris_physics_properties( physics_info *pi, vector *min, vector *max
|
||||
//
|
||||
// exp_force: Explosion force, used to assign velocity to pieces.
|
||||
// 1.0f assigns velocity like before. 2.0f assigns twice as much to non-inherited part of velocity
|
||||
object *debris_create(object *source_obj, int model_num, int submodel_num, vector *pos, vector *exp_center, int hull_flag, float exp_force)
|
||||
object *debris_create(object *source_obj, int model_num, int submodel_num, vec3d *pos, vec3d *exp_center, int hull_flag, float exp_force)
|
||||
{
|
||||
int i, n, objnum, parent_objnum;
|
||||
object *obj;
|
||||
@@ -746,7 +806,7 @@ object *debris_create(object *source_obj, int model_num, int submodel_num, vecto
|
||||
|
||||
for (i=0; i<MAX_DEBRIS_ARCS; i++ ) {
|
||||
db->arc_timestamp[i] = timestamp(-1);
|
||||
// vector arc_pts[MAX_DEBRIS_ARCS][2]; // The endpoints of each arc
|
||||
// vec3d arc_pts[MAX_DEBRIS_ARCS][2]; // The endpoints of each arc
|
||||
}
|
||||
|
||||
if ( db->is_hull ) {
|
||||
@@ -803,13 +863,13 @@ object *debris_create(object *source_obj, int model_num, int submodel_num, vecto
|
||||
// -- No long need shield: bset_shield_strength(obj, 100.0f); // Hey! Set to some meaningful value!
|
||||
|
||||
if (source_obj->type == OBJ_SHIP) {
|
||||
obj->hull_strength = Ship_info[Ships[source_obj->instance].ship_info_index].initial_hull_strength/8.0f;
|
||||
obj->hull_strength = Ships[source_obj->instance].ship_max_hull_strength/8.0f;
|
||||
} else
|
||||
obj->hull_strength = 10.0f;
|
||||
|
||||
Num_debris_pieces++;
|
||||
|
||||
vector rotvel, radial_vel, to_center;
|
||||
vec3d rotvel, radial_vel, to_center;
|
||||
|
||||
if ( exp_center )
|
||||
vm_vec_sub( &to_center,pos, exp_center );
|
||||
@@ -825,7 +885,7 @@ object *debris_create(object *source_obj, int model_num, int submodel_num, vecto
|
||||
|
||||
// set up physics mass and I_inv for hull debris pieces
|
||||
pm = model_get(model_num);
|
||||
vector *min, *max;
|
||||
vec3d *min, *max;
|
||||
min = &pm->submodel[submodel_num].min;
|
||||
max = &pm->submodel[submodel_num].max;
|
||||
calc_debris_physics_properties( &obj->phys_info, min, max );
|
||||
@@ -864,7 +924,7 @@ object *debris_create(object *source_obj, int model_num, int submodel_num, vecto
|
||||
// DA: here we need to vel_from_rot = w x to_center, where w is world is unrotated to world coords and offset is the
|
||||
// displacement fromt the center of the parent object to the center of the debris piece
|
||||
|
||||
vector world_rotvel, vel_from_rotvel;
|
||||
vec3d world_rotvel, vel_from_rotvel;
|
||||
vm_vec_unrotate ( &world_rotvel, &source_obj->phys_info.rotvel, &source_obj->orient );
|
||||
vm_vec_crossprod ( &vel_from_rotvel, &world_rotvel, &to_center );
|
||||
vm_vec_scale ( &vel_from_rotvel, DEBRIS_ROTVEL_SCALE);
|
||||
@@ -941,7 +1001,7 @@ object *debris_create(object *source_obj, int model_num, int submodel_num, vecto
|
||||
// Alas, poor debris_obj got whacked. Fortunately, we know who did it, where and how hard, so we
|
||||
// can do something about it.
|
||||
//
|
||||
void debris_hit(object *debris_obj, object *other_obj, vector *hitpos, float damage)
|
||||
void debris_hit(object *debris_obj, object *other_obj, vec3d *hitpos, float damage)
|
||||
{
|
||||
debris *debris_p = &Debris[debris_obj->instance];
|
||||
|
||||
@@ -953,7 +1013,7 @@ void debris_hit(object *debris_obj, object *other_obj, vector *hitpos, float dam
|
||||
pe.pos = *hitpos; // Where the particles emit from
|
||||
pe.vel = debris_obj->phys_info.vel; // Initial velocity of all the particles
|
||||
|
||||
vector tmp_norm;
|
||||
vec3d tmp_norm;
|
||||
vm_vec_sub( &tmp_norm, hitpos, &debris_obj->pos );
|
||||
vm_vec_normalize_safe(&tmp_norm);
|
||||
|
||||
@@ -1006,8 +1066,8 @@ void debris_hit(object *debris_obj, object *other_obj, vector *hitpos, float dam
|
||||
// Return true if hit, else return false.
|
||||
//
|
||||
#pragma warning ( push )
|
||||
#pragma warning ( disable : 4701 )
|
||||
int debris_check_collision(object *pdebris, object *other_obj, vector *hitpos, collision_info_struct *debris_hit_info)
|
||||
#pragma warning ( disable : 4701 ) // possible use of variable without initialization
|
||||
int debris_check_collision(object *pdebris, object *other_obj, vec3d *hitpos, collision_info_struct *debris_hit_info)
|
||||
{
|
||||
mc_info mc;
|
||||
int num;
|
||||
@@ -1048,7 +1108,7 @@ int debris_check_collision(object *pdebris, object *other_obj, vector *hitpos, c
|
||||
object *heavy_obj = heavy;
|
||||
object *light_obj = light;
|
||||
|
||||
vector zero, p0, p1;
|
||||
vec3d zero, p0, p1;
|
||||
vm_vec_zero(&zero);
|
||||
vm_vec_sub(&p0, &light->last_pos, &heavy->last_pos);
|
||||
vm_vec_sub(&p1, &light->pos, &heavy->pos);
|
||||
@@ -1058,7 +1118,7 @@ int debris_check_collision(object *pdebris, object *other_obj, vector *hitpos, c
|
||||
mc.p1 = &p1; // Point 2 of ray to check
|
||||
|
||||
// find the light object's position in the heavy object's reference frame at last frame and also in this frame.
|
||||
vector p0_temp, p0_rotated;
|
||||
vec3d p0_temp, p0_rotated;
|
||||
|
||||
// Collision detection from rotation enabled if at rotaion is less than 30 degree in frame
|
||||
// This should account for all ships
|
||||
@@ -1085,7 +1145,7 @@ int debris_check_collision(object *pdebris, object *other_obj, vector *hitpos, c
|
||||
|
||||
// copy important data
|
||||
int copy_flags = mc.flags; // make a copy of start end positions of sphere in big ship RF
|
||||
vector copy_p0, copy_p1;
|
||||
vec3d copy_p0, copy_p1;
|
||||
copy_p0 = *mc.p0;
|
||||
copy_p1 = *mc.p1;
|
||||
|
||||
@@ -1156,7 +1216,7 @@ int debris_check_collision(object *pdebris, object *other_obj, vector *hitpos, c
|
||||
}
|
||||
|
||||
// find position in submodel RF of light object at collison
|
||||
vector int_light_pos, diff;
|
||||
vec3d int_light_pos, diff;
|
||||
vm_vec_sub(&diff, mc.p1, mc.p0);
|
||||
vm_vec_scale_add(&int_light_pos, mc.p0, &diff, mc.hit_dist);
|
||||
model_find_world_point(&debris_hit_info->light_collision_cm_pos, &int_light_pos, mc.model_num, mc.hit_submodel, &heavy_obj->orient, &zero);
|
||||
@@ -1188,7 +1248,7 @@ int debris_check_collision(object *pdebris, object *other_obj, vector *hitpos, c
|
||||
}
|
||||
|
||||
// find position in submodel RF of light object at collison
|
||||
vector diff;
|
||||
vec3d diff;
|
||||
vm_vec_sub(&diff, mc.p1, mc.p0);
|
||||
vm_vec_scale_add(&debris_hit_info->light_collision_cm_pos, mc.p0, &diff, mc.hit_dist);
|
||||
|
||||
@@ -1220,7 +1280,7 @@ int debris_check_collision(object *pdebris, object *other_obj, vector *hitpos, c
|
||||
}
|
||||
|
||||
// find position in submodel RF of light object at collison
|
||||
vector diff;
|
||||
vec3d diff;
|
||||
vm_vec_sub(&diff, mc.p1, mc.p0);
|
||||
vm_vec_scale_add(&debris_hit_info->light_collision_cm_pos, mc.p0, &diff, mc.hit_dist);
|
||||
|
||||
@@ -1270,7 +1330,7 @@ int debris_get_team(object *objp)
|
||||
}
|
||||
|
||||
// fills in debris physics properties when created, specifically mass and moment of inertia
|
||||
void calc_debris_physics_properties( physics_info *pi, vector *mins, vector *maxs )
|
||||
void calc_debris_physics_properties( physics_info *pi, vec3d *mins, vec3d *maxs )
|
||||
{
|
||||
float dx, dy, dz, mass;
|
||||
dx = maxs->xyz.x - mins->xyz.x;
|
||||
|
||||
@@ -9,13 +9,29 @@
|
||||
|
||||
/*
|
||||
* $Logfile: /Freespace2/code/Debris/Debris.h $
|
||||
* $Revision: 2.0 $
|
||||
* $Date: 2002-06-03 04:02:21 $
|
||||
* $Author: penguin $
|
||||
* $Revision: 2.5 $
|
||||
* $Date: 2005-07-13 02:50:51 $
|
||||
* $Author: Goober5000 $
|
||||
*
|
||||
* Code for the pieces of exploding object debris.
|
||||
*
|
||||
* $Log: not supported by cvs2svn $
|
||||
* Revision 2.4 2005/04/28 05:29:29 wmcoolmon
|
||||
* Removed FS2_DEMO defines that looked like they wouldn't cause the universe to collapse
|
||||
*
|
||||
* Revision 2.3 2005/04/05 05:53:15 taylor
|
||||
* s/vector/vec3d/g, better support for different compilers (Jens Granseuer)
|
||||
*
|
||||
* Revision 2.2 2004/08/11 05:06:20 Kazan
|
||||
* added preprocdefines.h to prevent what happened with fred -- make sure to make all fred2 headers include this file as the _first_ include -- i have already modified fs2 files to do this
|
||||
*
|
||||
* Revision 2.1 2004/03/05 09:01:59 Goober5000
|
||||
* Uber pass at reducing #includes
|
||||
* --Goober5000
|
||||
*
|
||||
* Revision 2.0 2002/06/03 04:02:21 penguin
|
||||
* Warpcore CVS sync
|
||||
*
|
||||
* Revision 1.1 2002/05/02 18:03:04 mharris
|
||||
* Initial checkin - converted filenames and includes to lower case
|
||||
*
|
||||
@@ -141,6 +157,8 @@
|
||||
#ifndef _DEBRIS_H
|
||||
#define _DEBRIS_H
|
||||
|
||||
#include "globalincs/pstypes.h"
|
||||
|
||||
struct object;
|
||||
struct CFILE;
|
||||
|
||||
@@ -165,7 +183,7 @@ typedef struct debris {
|
||||
fix time_started; // time when debris was created
|
||||
int next_distance_check; // timestamp to determine whether to delete this piece of debris.
|
||||
|
||||
vector arc_pts[MAX_DEBRIS_ARCS][2]; // The endpoints of each arc
|
||||
vec3d arc_pts[MAX_DEBRIS_ARCS][2]; // The endpoints of each arc
|
||||
int arc_timestamp[MAX_DEBRIS_ARCS]; // When this times out, the spark goes away. -1 is not used
|
||||
int arc_frequency; // Starts at 0, gets bigger
|
||||
|
||||
@@ -177,11 +195,7 @@ typedef struct debris {
|
||||
#define DEBRIS_EXPIRE (1<<1) // debris can expire (ie hull chunks from small ships)
|
||||
|
||||
|
||||
#ifdef FS2_DEMO
|
||||
#define MAX_DEBRIS_PIECES 48
|
||||
#else
|
||||
#define MAX_DEBRIS_PIECES 64
|
||||
#endif
|
||||
#define MAX_DEBRIS_PIECES 64
|
||||
|
||||
extern debris Debris[MAX_DEBRIS_PIECES];
|
||||
|
||||
@@ -194,9 +208,9 @@ void debris_render( object * obj );
|
||||
void debris_delete( object * obj );
|
||||
void debris_process_pre( object * obj, float frame_time);
|
||||
void debris_process_post( object * obj, float frame_time);
|
||||
object *debris_create( object * source_obj, int model_num, int submodel_num, vector *pos, vector *exp_center, int hull_flag, float exp_force );
|
||||
int debris_check_collision( object * obj, object * other_obj, vector * hitpos, collision_info_struct *debris_hit_info=NULL );
|
||||
void debris_hit( object * debris_obj, object * other_obj, vector * hitpos, float damage );
|
||||
object *debris_create( object * source_obj, int model_num, int submodel_num, vec3d *pos, vec3d *exp_center, int hull_flag, float exp_force );
|
||||
int debris_check_collision( object * obj, object * other_obj, vec3d * hitpos, collision_info_struct *debris_hit_info=NULL );
|
||||
void debris_hit( object * debris_obj, object * other_obj, vec3d * hitpos, float damage );
|
||||
int debris_get_team(object *objp);
|
||||
void debris_clear_expired_flag(debris *db);
|
||||
|
||||
|
||||
@@ -9,13 +9,35 @@
|
||||
|
||||
/*
|
||||
* $Logfile: /Freespace2/code/DebugConsole/Console.cpp $
|
||||
* $Revision: 2.1 $
|
||||
* $Date: 2002-08-01 01:41:04 $
|
||||
* $Author: penguin $
|
||||
* $Revision: 2.6 $
|
||||
* $Date: 2005-04-25 00:07:22 $
|
||||
* $Author: wmcoolmon $
|
||||
*
|
||||
* Routines for managing the debug console window.
|
||||
*
|
||||
* $Log: not supported by cvs2svn $
|
||||
* Revision 2.5 2004/07/26 20:47:27 Kazan
|
||||
* remove MCD complete
|
||||
*
|
||||
* Revision 2.4 2004/07/12 16:32:44 Kazan
|
||||
* MCD - define _MCD_CHECK to use memory tracking
|
||||
*
|
||||
* Revision 2.3 2004/03/05 09:01:58 Goober5000
|
||||
* Uber pass at reducing #includes
|
||||
* --Goober5000
|
||||
*
|
||||
* Revision 2.2 2003/03/18 10:07:01 unknownplayer
|
||||
* The big DX/main line merge. This has been uploaded to the main CVS since I can't manage to get it to upload to the DX branch. Apologies to all who may be affected adversely, but I'll work to debug it as fast as I can.
|
||||
*
|
||||
* Revision 2.1.2.1 2002/09/24 18:56:41 randomtiger
|
||||
* DX8 branch commit
|
||||
*
|
||||
* This is the scub of UP's previous code with the more up to date RT code.
|
||||
* For full details check previous dev e-mails
|
||||
*
|
||||
* Revision 2.1 2002/08/01 01:41:04 penguin
|
||||
* The big include file move
|
||||
*
|
||||
* Revision 2.0 2002/06/03 04:02:21 penguin
|
||||
* Warpcore CVS sync
|
||||
*
|
||||
@@ -105,13 +127,13 @@
|
||||
#include <string.h>
|
||||
|
||||
#include "globalincs/pstypes.h"
|
||||
#include "freespace2/freespace.h"
|
||||
#include "graphics/font.h"
|
||||
#include "io/timer.h"
|
||||
#include "graphics/2d.h"
|
||||
#include "io/key.h"
|
||||
#include "globalincs/alphacolors.h"
|
||||
#include "osapi/osapi.h"
|
||||
#include "debugconsole/dbugfile.h"
|
||||
|
||||
|
||||
#define MAX_COMMANDS 300
|
||||
|
||||
@@ -610,7 +632,7 @@ void debug_output( char c )
|
||||
|
||||
void dc_printf(char *format, ...)
|
||||
{
|
||||
char tmp[DCOLS*2];
|
||||
char tmp[DCOLS*DROWS];
|
||||
va_list args;
|
||||
|
||||
va_start(args, format);
|
||||
@@ -618,7 +640,7 @@ void dc_printf(char *format, ...)
|
||||
va_end(args);
|
||||
|
||||
char *p = tmp;
|
||||
while( *p ) {
|
||||
while( *p != '\0' ) {
|
||||
debug_output(*p);
|
||||
p++;
|
||||
}
|
||||
|
||||
@@ -0,0 +1,408 @@
|
||||
#ifdef _WIN32
|
||||
#include <windows.h>
|
||||
#endif
|
||||
|
||||
#include <time.h>
|
||||
#include <stdio.h>
|
||||
#include <sys/types.h>
|
||||
#include <sys/timeb.h>
|
||||
|
||||
#include "dbugfile.h"
|
||||
|
||||
|
||||
|
||||
#pragma warning(disable:4711) // function selected for inlining
|
||||
|
||||
int dbugfile_counters[MAX_COUNTERS];
|
||||
bool dbugfile_init_var = false;
|
||||
|
||||
char dbugfile_filename[512];
|
||||
|
||||
void dbugfile_output(char *buffer)
|
||||
{
|
||||
if(dbugfile_init_var == false)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
FILE *fp = fopen(dbugfile_filename, "a");
|
||||
|
||||
if(fp == NULL)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
fwrite(buffer, sizeof(char) * strlen(buffer), 1, fp);
|
||||
|
||||
fclose(fp);
|
||||
}
|
||||
|
||||
void dbugfile_init()
|
||||
{
|
||||
// Clear the counters
|
||||
memset(dbugfile_counters, 0, sizeof(int) * MAX_COUNTERS);
|
||||
|
||||
char big_buffer[1000];
|
||||
char temp_buff[512];
|
||||
|
||||
dbugfile_filename[0] = '\0';
|
||||
|
||||
#ifdef _WIN32
|
||||
|
||||
char path[MAX_PATH];
|
||||
|
||||
GetCurrentDirectory(MAX_PATH, path);
|
||||
|
||||
int path_len = strlen(path);
|
||||
if(path[path_len - 1] != '\\')
|
||||
{
|
||||
path[path_len] = '\\';
|
||||
path[path_len + 1] = '\0';
|
||||
}
|
||||
|
||||
strcpy(dbugfile_filename, path);
|
||||
|
||||
#endif
|
||||
|
||||
strcat(dbugfile_filename, "DBUG-");
|
||||
strcpy(big_buffer, "DBUGFILE Active: ");
|
||||
|
||||
#ifdef _WIN32
|
||||
{
|
||||
unsigned long len = 512;
|
||||
GetUserName(temp_buff, &len);
|
||||
|
||||
strcat(dbugfile_filename, temp_buff);
|
||||
strcat(big_buffer, temp_buff);
|
||||
|
||||
strcat(dbugfile_filename, "-");
|
||||
strcat(big_buffer, " ");
|
||||
}
|
||||
#endif
|
||||
|
||||
_tzset();
|
||||
|
||||
// Display operating system-style date and time.
|
||||
_strdate( temp_buff);
|
||||
strcat(dbugfile_filename, "D(");
|
||||
strcat(dbugfile_filename,temp_buff);
|
||||
strcat(big_buffer,temp_buff);
|
||||
|
||||
strcat(dbugfile_filename, ") T(");
|
||||
strcat(big_buffer, " ");
|
||||
|
||||
_strtime( temp_buff);
|
||||
strcat(dbugfile_filename,temp_buff);
|
||||
strcat(big_buffer,temp_buff);
|
||||
|
||||
strcat(dbugfile_filename, ").txt");
|
||||
strcat(big_buffer, "\n");
|
||||
|
||||
// Remove invalid slash chars
|
||||
int len = strlen(dbugfile_filename);
|
||||
while(len >= 2)
|
||||
{
|
||||
if(dbugfile_filename[len] == '/' || dbugfile_filename[len] == ':')
|
||||
{
|
||||
dbugfile_filename[len] = '-';
|
||||
}
|
||||
len--;
|
||||
}
|
||||
|
||||
// open file
|
||||
// Uncomment this to see where the file is going
|
||||
//MessageBox(NULL, dbugfile_filename, "das", MB_OK);
|
||||
FILE *fp = fopen(dbugfile_filename, "w");
|
||||
|
||||
if(fp == NULL)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
fwrite(big_buffer, sizeof(char) * strlen(big_buffer), 1, fp);
|
||||
|
||||
#ifdef _WIN32
|
||||
|
||||
// detect OS type
|
||||
|
||||
OSVERSIONINFO version_info;
|
||||
version_info.dwOSVersionInfoSize = sizeof(OSVERSIONINFO);
|
||||
|
||||
if(GetVersionEx(&version_info) != false)
|
||||
{
|
||||
char *error = "Error in detecting OS version";
|
||||
char *version = error;
|
||||
|
||||
switch(version_info.dwMajorVersion)
|
||||
{
|
||||
case 4:
|
||||
{
|
||||
if(version_info.dwMinorVersion == 0)
|
||||
{
|
||||
version = "Windows 95";
|
||||
}
|
||||
else if(version_info.dwMinorVersion == 10)
|
||||
{
|
||||
version = "Windows 98";
|
||||
}
|
||||
else if(version_info.dwMinorVersion == 90)
|
||||
{
|
||||
version = "Windows Me";
|
||||
}
|
||||
break;
|
||||
}
|
||||
case 5:
|
||||
{
|
||||
if(version_info.dwMinorVersion == 0)
|
||||
{
|
||||
version = "Windows 2000";
|
||||
}
|
||||
else if(version_info.dwMinorVersion == 1)
|
||||
{
|
||||
version = "Windows XP";
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
char *release_type = NULL;
|
||||
#ifdef _DEBUG
|
||||
release_type = "Debug";
|
||||
#else
|
||||
release_type = "Release";
|
||||
#endif
|
||||
sprintf(big_buffer, "OS: %s %s, ", version, release_type);
|
||||
}
|
||||
|
||||
fwrite(big_buffer, sizeof(char) * strlen(big_buffer), 1, fp);
|
||||
|
||||
char exe_name[MAX_PATH];
|
||||
|
||||
GetModuleFileName(NULL, exe_name, MAX_PATH);
|
||||
strcat(exe_name, "\n");
|
||||
fwrite(exe_name, sizeof(char) * strlen(exe_name), 1, fp);
|
||||
|
||||
|
||||
#endif
|
||||
|
||||
fclose(fp);
|
||||
|
||||
dbugfile_init_var = true;
|
||||
}
|
||||
|
||||
void dbugfile_deinit()
|
||||
{
|
||||
dbugfile_output("Normal end");
|
||||
dbugfile_init_var = false;
|
||||
}
|
||||
|
||||
void dbugfile_sprintf(int line, char *file, const char *format, ...)
|
||||
{
|
||||
if(dbugfile_init_var == false)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
// find last slash (for PC) to crop file path
|
||||
char *ptr = strrchr(file, '\\');
|
||||
|
||||
if(ptr == NULL)
|
||||
{
|
||||
ptr = file;
|
||||
}
|
||||
else
|
||||
{
|
||||
ptr++;
|
||||
}
|
||||
|
||||
char buffer[1000];
|
||||
int i = sprintf(buffer, "[%s,%4d] ", ptr, line);
|
||||
|
||||
va_list ap;
|
||||
char *p, *sval;
|
||||
long ival;
|
||||
double dval;
|
||||
|
||||
// Add each extra parameter to string
|
||||
va_start(ap, format);
|
||||
|
||||
for(p = (char *) format; *p; p++)
|
||||
{
|
||||
if(*p != '%')
|
||||
{
|
||||
*(buffer + i) = *p;
|
||||
i++;
|
||||
continue;
|
||||
}
|
||||
|
||||
p++;
|
||||
|
||||
switch(*p)
|
||||
{
|
||||
case 'd':
|
||||
{
|
||||
ival = va_arg(ap, int);
|
||||
i += sprintf(buffer+i,"%d", ival);
|
||||
break;
|
||||
}
|
||||
case 'c':
|
||||
{
|
||||
ival = va_arg(ap, char);
|
||||
buffer[i] = (char) ival;
|
||||
i++;
|
||||
break;
|
||||
}
|
||||
case 'x':
|
||||
{
|
||||
ival = va_arg(ap, int);
|
||||
i += sprintf(buffer+i,"%x", ival);
|
||||
break;
|
||||
}
|
||||
|
||||
case 'f':
|
||||
{
|
||||
dval = va_arg(ap, double);
|
||||
i += sprintf(buffer+i,"%f", dval);
|
||||
break;
|
||||
}
|
||||
case 's':
|
||||
{
|
||||
for(sval = va_arg(ap, char *); *sval; sval++)
|
||||
{
|
||||
*(buffer + i++) = *sval;
|
||||
}
|
||||
break;
|
||||
}
|
||||
default:
|
||||
{
|
||||
i += sprintf(buffer+i,"N/A: %%%c", *p);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
va_end(ap);
|
||||
|
||||
i += sprintf(buffer + i, "\n");
|
||||
|
||||
dbugfile_output(buffer);
|
||||
}
|
||||
|
||||
void dbugfile_print_matrix_4x4(int line, char *file, float *matrix, char *text)
|
||||
{
|
||||
if(dbugfile_init_var == false)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
if(matrix == NULL)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
// find last slash (for PC) to crop file path
|
||||
char *ptr = strrchr(file, '\\');
|
||||
|
||||
if(ptr == NULL)
|
||||
{
|
||||
ptr = file;
|
||||
}
|
||||
else
|
||||
{
|
||||
ptr++;
|
||||
}
|
||||
|
||||
if(text == NULL)
|
||||
{
|
||||
text = "";
|
||||
}
|
||||
|
||||
char buffer[1000];
|
||||
|
||||
sprintf(buffer,"[%s,%4d] Matrix %s:\n"
|
||||
"%f %f %f %f\n"
|
||||
"%f %f %f %f\n"
|
||||
"%f %f %f %f\n"
|
||||
"%f %f %f %f\n",
|
||||
ptr,line, text,
|
||||
matrix[0],
|
||||
matrix[1],
|
||||
matrix[2],
|
||||
matrix[3],
|
||||
matrix[4],
|
||||
matrix[5],
|
||||
matrix[6],
|
||||
matrix[7],
|
||||
matrix[8],
|
||||
matrix[9],
|
||||
matrix[10],
|
||||
matrix[11],
|
||||
matrix[12],
|
||||
matrix[13],
|
||||
matrix[14],
|
||||
matrix[15]);
|
||||
|
||||
dbugfile_output(buffer);
|
||||
}
|
||||
|
||||
void dbugfile_print_matrix_3x3(int line, char *file, float *matrix, char *text)
|
||||
{
|
||||
if(dbugfile_init_var == false)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
if(matrix == NULL)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
// find last slash (for PC) to crop file path
|
||||
char *ptr = strrchr(file, '\\');
|
||||
|
||||
if(ptr == NULL)
|
||||
{
|
||||
ptr = file;
|
||||
}
|
||||
else
|
||||
{
|
||||
ptr++;
|
||||
}
|
||||
|
||||
if(text == NULL)
|
||||
{
|
||||
text = "";
|
||||
}
|
||||
|
||||
char buffer[1000];
|
||||
|
||||
sprintf(buffer,"[%s,%4d] Matrix %s:\n"
|
||||
"%f %f %f\n"
|
||||
"%f %f %f\n"
|
||||
"%f %f %f\n",
|
||||
ptr,line, text,
|
||||
matrix[0],
|
||||
matrix[1],
|
||||
matrix[2],
|
||||
matrix[3],
|
||||
matrix[4],
|
||||
matrix[5],
|
||||
matrix[6],
|
||||
matrix[7],
|
||||
matrix[8]);
|
||||
|
||||
dbugfile_output(buffer);
|
||||
}
|
||||
|
||||
void dbugfile_print_counter(int line, char *file, int counter_num, char *string)
|
||||
{
|
||||
char buffer[1000];
|
||||
strcpy(buffer, string);
|
||||
strcat(buffer, " %d");
|
||||
|
||||
dbugfile_sprintf(line, file, buffer, dbugfile_counters[counter_num]);
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -0,0 +1,66 @@
|
||||
|
||||
#ifndef _DBUGFILE_HEADER_
|
||||
#define _DBUGFILE_HEADER_
|
||||
|
||||
#define MAX_COUNTERS 10
|
||||
|
||||
void dbugfile_init();
|
||||
void dbugfile_deinit();
|
||||
void dbugfile_sprintf(int line, char *file, const char *format, ...);
|
||||
void dbugfile_print_matrix_3x3(int line, char *file, float *matrix, char *text);
|
||||
void dbugfile_print_matrix_4x4(int line, char *file, float *matrix, char *text);
|
||||
void dbugfile_print_counter(int line, char *file, int counter_num, char *string);
|
||||
|
||||
#ifdef DBUGFILE_ACTIVE
|
||||
|
||||
#define DBUGFILE_INIT() dbugfile_init();
|
||||
#define DBUGFILE_DEINIT() dbugfile_deinit();
|
||||
|
||||
#define DBUGFILE_OUTPUT_0(t) dbugfile_sprintf(__LINE__, __FILE__, t);
|
||||
#define DBUGFILE_OUTPUT_1(t,a) dbugfile_sprintf(__LINE__, __FILE__, t,a);
|
||||
#define DBUGFILE_OUTPUT_2(t,a,b) dbugfile_sprintf(__LINE__, __FILE__, t,a,b);
|
||||
#define DBUGFILE_OUTPUT_3(t,a,b,c) dbugfile_sprintf(__LINE__, __FILE__, t,a,b,c);
|
||||
#define DBUGFILE_OUTPUT_4(t,a,b,c,d) dbugfile_sprintf(__LINE__, __FILE__, t,a,b,c,d);
|
||||
#define DBUGFILE_OUTPUT_5(t,a,b,c,d,e) dbugfile_sprintf(__LINE__, __FILE__, t,a,b,c,d,e);
|
||||
#define DBUGFILE_OUTPUT_6(t,a,b,c,d,e,f) dbugfile_sprintf(__LINE__, __FILE__, t,a,b,c,d,e,f);
|
||||
#define DBUGFILE_OUTPUT_7(t,a,b,c,d,e,f,g) dbugfile_sprintf(__LINE__, __FILE__, t,a,b,c,d,e,f,g);
|
||||
#define DBUGFILE_OUTPUT_8(t,a,b,c,d,e,f,g,h) dbugfile_sprintf(__LINE__, __FILE__, t,a,b,c,d,e,f,g,h);
|
||||
#define DBUGFILE_OUTPUT_9(t,a,b,c,d,e,f,g,h,i) dbugfile_sprintf(__LINE__, __FILE__, t,a,b,c,d,e,f,g,h,i);
|
||||
|
||||
#define DBUGFILE_OUTPUT_MATRIX_3X3(m,t) dbugfile_print_matrix_3x3(__LINE__, __FILE__, m,t);
|
||||
#define DBUGFILE_OUTPUT_MATRIX_4X4(m,t) dbugfile_print_matrix_4x4(__LINE__, __FILE__, m,t);
|
||||
|
||||
extern int dbugfile_counters[MAX_COUNTERS];
|
||||
#define DBUGFILE_INC_COUNTER(n) if(n < MAX_COUNTERS) dbugfile_counters[n]++;
|
||||
#define DBUGFILE_DEC_COUNTER(n) if(n < MAX_COUNTERS) dbugfile_counters[n]--;
|
||||
|
||||
#define DBUGFILE_OUTPUT_COUNTER(n,s) dbugfile_print_counter(__LINE__, __FILE__, n, s);
|
||||
|
||||
#else
|
||||
|
||||
#define DBUGFILE_INIT() ;
|
||||
#define DBUGFILE_DEINIT() ;
|
||||
|
||||
#define DBUGFILE_OUTPUT_0(t) ;
|
||||
#define DBUGFILE_OUTPUT_1(t,a) ;
|
||||
#define DBUGFILE_OUTPUT_2(t,a,b) ;
|
||||
#define DBUGFILE_OUTPUT_3(t,a,b,c) ;
|
||||
#define DBUGFILE_OUTPUT_4(t,a,b,c,d) ;
|
||||
#define DBUGFILE_OUTPUT_5(t,a,b,c,d,e) ;
|
||||
#define DBUGFILE_OUTPUT_6(t,a,b,c,d,e,f) ;
|
||||
#define DBUGFILE_OUTPUT_7(t,a,b,c,d,e,f,g) ;
|
||||
#define DBUGFILE_OUTPUT_8(t,a,b,c,d,e,f,g,h) ;
|
||||
#define DBUGFILE_OUTPUT_9(t,a,b,c,d,e,f,g,h,i) ;
|
||||
|
||||
#define DBUGFILE_OUTPUT_MATRIX_3X3(m,t) ;
|
||||
#define DBUGFILE_OUTPUT_MATRIX_4X4(m,t) ;
|
||||
|
||||
#define DBUGFILE_INC_COUNTER(n) ;
|
||||
#define DBUGFILE_DEC_COUNTER(n) ;
|
||||
|
||||
#define DBUGFILE_OUTPUT_COUNTER(n,s) ;
|
||||
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
||||
@@ -0,0 +1,226 @@
|
||||
/*
|
||||
* Code created by Thomas Whittaker (RT) for a Freespace 2 source code project
|
||||
*
|
||||
* You may not sell or otherwise commercially exploit the source or things you
|
||||
* created based on the source.
|
||||
*
|
||||
*/
|
||||
|
||||
/*
|
||||
* This module is intended as a debug tool to measure the speed of blocks of code and display
|
||||
* that information as coloured bars across the top of the screen.
|
||||
*
|
||||
* This allows interactive measuring of components of the code, very useful for optimisztion.
|
||||
*/
|
||||
|
||||
#ifdef _WIN32
|
||||
#include <windows.h>
|
||||
#include <winbase.h>
|
||||
#endif
|
||||
|
||||
#include "timerbar.h"
|
||||
#include "globalincs/pstypes.h"
|
||||
|
||||
|
||||
// Internal structure for handling frame data
|
||||
typedef struct
|
||||
{
|
||||
LARGE_INTEGER start_value;
|
||||
LARGE_INTEGER total_value;
|
||||
|
||||
LARGE_INTEGER average;
|
||||
LARGE_INTEGER frame_total;
|
||||
|
||||
} timerbar_profile;
|
||||
|
||||
timerbar_profile profiles[MAX_NUM_TIMERBARS];
|
||||
int timerbar_current_profile = 0;
|
||||
|
||||
LARGE_INTEGER timerbar_ultimate_start_value;
|
||||
LARGE_INTEGER timerbar_last_start_value;
|
||||
|
||||
// Data needed for push and pop functionality
|
||||
const int MAX_TB_STACK_SIZE = 100;
|
||||
|
||||
int timerbar_stack[MAX_TB_STACK_SIZE];
|
||||
int timerbar_current_stack_layer = 0;
|
||||
|
||||
/*
|
||||
*
|
||||
*
|
||||
*
|
||||
*/
|
||||
void timerbar_push(int value)
|
||||
{
|
||||
if(timerbar_current_stack_layer >= MAX_TB_STACK_SIZE)
|
||||
{
|
||||
// To many pushs, this must be a bug
|
||||
// Someone is letting code miss the pops, check for early retuns
|
||||
Assert(!(timerbar_current_stack_layer >= MAX_TB_STACK_SIZE));
|
||||
return;
|
||||
}
|
||||
|
||||
timerbar_stack[timerbar_current_stack_layer] = timerbar_current_profile;
|
||||
timerbar_current_stack_layer++;
|
||||
|
||||
timerbar_switch_type(value);
|
||||
}
|
||||
|
||||
/*
|
||||
*
|
||||
*
|
||||
*
|
||||
*/
|
||||
void timerbar_pop()
|
||||
{
|
||||
timerbar_current_stack_layer--;
|
||||
if(timerbar_current_stack_layer < 0)
|
||||
{
|
||||
Assert(!(timerbar_current_stack_layer < 0));
|
||||
timerbar_current_stack_layer = 0;
|
||||
return;
|
||||
}
|
||||
|
||||
timerbar_switch_type(timerbar_stack[timerbar_current_stack_layer]);
|
||||
}
|
||||
|
||||
// This pointer holds the draw function to use or NULL
|
||||
void (*draw_func_ptr)(int colour, float x, float y, float w, float h) = NULL;
|
||||
|
||||
void timerbar_start_frame()
|
||||
{
|
||||
timerbar_current_stack_layer = 0;
|
||||
timerbar_current_profile = 0;
|
||||
|
||||
if(QueryPerformanceCounter(&timerbar_ultimate_start_value) == FALSE)
|
||||
{
|
||||
// DBUGFILE_OUTPUT_0("QueryPerformanceCounter not supported by hardware");
|
||||
draw_func_ptr = NULL;
|
||||
}
|
||||
|
||||
timerbar_last_start_value = timerbar_ultimate_start_value;
|
||||
|
||||
}
|
||||
|
||||
// Constants need for timerbar_conv_and_draw calculations
|
||||
const int WIDTH = 480;
|
||||
const float WIDTHF = ((float) WIDTH) * 1.01f;
|
||||
|
||||
/**
|
||||
* Internal conversion function to convert draw data into bars for the screen
|
||||
*
|
||||
* @param int colour - colour index (>=0)
|
||||
* @param int xpos - x position to start bar on
|
||||
* @param int xwidth - width of bar
|
||||
* @param int yrow - Index of row bar belongs to
|
||||
*/
|
||||
void timerbar_conv_and_draw(int colour, int xpos, int xwidth, int yrow)
|
||||
{
|
||||
float fxpos = (float) xpos;
|
||||
float fxwidth = (float) xwidth;
|
||||
|
||||
draw_func_ptr(colour,
|
||||
fxpos / WIDTHF,
|
||||
yrow * 0.01f,
|
||||
fxwidth / WIDTHF,
|
||||
0.005f);
|
||||
}
|
||||
|
||||
void timerbar_end_frame()
|
||||
{
|
||||
// Now we want to draw the bars
|
||||
if(draw_func_ptr == NULL)
|
||||
{
|
||||
// we have not been given a draw function so we are going to have to quit
|
||||
return;
|
||||
}
|
||||
|
||||
timerbar_switch_type(-1);
|
||||
|
||||
int last_xpos = 0;
|
||||
int y_pos = 0;
|
||||
|
||||
|
||||
for(int i = 0; i < MAX_NUM_TIMERBARS; i++)
|
||||
{
|
||||
// Nothing to render this frame
|
||||
if(profiles[i].frame_total.QuadPart == 0)
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
int xsize = (int) profiles[i].frame_total.QuadPart / 90;
|
||||
|
||||
// break condition in else
|
||||
while(1)
|
||||
{
|
||||
// if bar runs over
|
||||
if(last_xpos + xsize > WIDTH)
|
||||
{
|
||||
int rem_len = WIDTH - last_xpos;
|
||||
|
||||
// Draw from current position to the end of the bar
|
||||
timerbar_conv_and_draw(i, last_xpos, rem_len, y_pos);
|
||||
|
||||
xsize -= rem_len;
|
||||
last_xpos = 0;
|
||||
y_pos++;
|
||||
}
|
||||
else
|
||||
{
|
||||
// Draw whats left and break for the next bar
|
||||
timerbar_conv_and_draw(i,last_xpos, xsize, y_pos);
|
||||
|
||||
last_xpos += xsize;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
// reset for next frame
|
||||
profiles[i].frame_total.QuadPart = 0;
|
||||
}
|
||||
}
|
||||
|
||||
void timerbar_switch_type(int num)
|
||||
{
|
||||
if(num >= MAX_NUM_TIMERBARS)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
// Calculate old profile's total
|
||||
LARGE_INTEGER now;
|
||||
if(QueryPerformanceCounter(&now) == FALSE)
|
||||
{
|
||||
// DBUGFILE_OUTPUT_0("QueryPerformanceCounter not supported by hardware");
|
||||
}
|
||||
|
||||
profiles[timerbar_current_profile].frame_total.QuadPart +=
|
||||
(now.QuadPart - timerbar_last_start_value.QuadPart);
|
||||
|
||||
if(num != -1)
|
||||
{
|
||||
// Switch to new profile
|
||||
timerbar_current_profile = num;
|
||||
}
|
||||
|
||||
// Update time to count from
|
||||
if(QueryPerformanceCounter(&timerbar_last_start_value) == FALSE)
|
||||
{
|
||||
// DBUGFILE_OUTPUT_0("QueryPerformanceCounter not supported by hardware");
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @param void (*new_draw_func_ptr)(int colour, float x, float y, float w, float h) - pointer to draw function
|
||||
*
|
||||
* Sets the draw function used to output the timer data, designed to be generic allowing any API
|
||||
* to take advantage of this module. Set to NULL to disable drawing.
|
||||
*
|
||||
* By default the draw function is set to NULL
|
||||
*/
|
||||
void timerbar_set_draw_func(void (*new_draw_func_ptr)(int colour, float x, float y, float w, float h))
|
||||
{
|
||||
draw_func_ptr = new_draw_func_ptr;
|
||||
}
|
||||
|
||||
@@ -0,0 +1,83 @@
|
||||
/*
|
||||
* Code created by Thomas Whittaker (RT) for a Freespace 2 source code project
|
||||
*
|
||||
* You may not sell or otherwise commercially exploit the source or things you
|
||||
* created based on the source.
|
||||
*
|
||||
*/
|
||||
|
||||
/*
|
||||
* $Logfile: /Freespace2/code/debugconsole/timerbar.h $
|
||||
* $Revision: 1.10 $
|
||||
* $Date: 2005-07-13 02:50:50 $
|
||||
* $Author: Goober5000 $
|
||||
*
|
||||
* $Log: not supported by cvs2svn $
|
||||
* Revision 1.9 2004/08/11 05:06:20 Kazan
|
||||
* added preprocdefines.h to prevent what happened with fred -- make sure to make all fred2 headers include this file as the _first_ include -- i have already modified fs2 files to do this
|
||||
*
|
||||
* Revision 1.8 2004/02/16 11:47:31 randomtiger
|
||||
* Removed a lot of files that we dont need anymore.
|
||||
* Changed htl to be on by default, command now -nohtl
|
||||
* Changed D3D to use a 2D vertex for 2D operations which should cut down on redundant data having to go though the system.
|
||||
* Added small change to all -start_mission flag to take you to any mission by filename, very useful for testing.
|
||||
* Removed old dshow code and took away timerbar compile flag condition since it uses a runtime flag now.
|
||||
*
|
||||
* Revision 1.7 2003/11/19 20:37:23 randomtiger
|
||||
* Almost fully working 32 bit pcx, use -pcx32 flag to activate.
|
||||
* Made some commandline variables fit the naming standard.
|
||||
* Changed timerbar system not to run pushes and pops if its not in use.
|
||||
* Put in a note about not uncommenting asserts.
|
||||
* Fixed up a lot of missing POP's on early returns?
|
||||
* Perhaps the motivation for Assert functionality getting commented out?
|
||||
* Fixed up some bad asserts.
|
||||
* Changed nebula poofs to render in 2D in htl, it makes it look how it used to in non htl. (neb.cpp,1248)
|
||||
* Before the poofs were creating a nasty stripe effect where they intersected with ships hulls.
|
||||
* Put in a special check for the signs of that D3D init bug I need to lock down.
|
||||
*
|
||||
* Revision 1.6 2003/11/09 06:31:39 Kazan
|
||||
* a couple of htl functions being called in nonhtl (ie NULL functions) problems fixed
|
||||
* conflicts in cmdline and timerbar.h log entries
|
||||
* cvs stopped acting like it was on crack obviously
|
||||
*
|
||||
* Revision 1.5 2003/11/09 04:09:17 Goober5000
|
||||
* edited for language
|
||||
* --Goober5000
|
||||
*
|
||||
* Revision 1.4 2003/11/08 22:25:47 Kazan
|
||||
* Timerbar was enabled in both release and debug - so i made it a command line option "-timerbar"
|
||||
* DONT MESS WITH OTHER PEOPLES INCLUDE PATHS
|
||||
* DONT MESS WITH EXEC NAMES (leave it fs2_open_r and fs2_open_d) or paths!
|
||||
*
|
||||
*
|
||||
* $NoKeywords: $
|
||||
*/
|
||||
|
||||
#ifndef _TIMERBAR_HEADER_
|
||||
#define _TIMERBAR_HEADER_
|
||||
|
||||
const int MAX_NUM_TIMERBARS = 20;
|
||||
|
||||
#include "cmdline/cmdline.h"
|
||||
|
||||
// These functions should never be used directly, always use macros below
|
||||
void timerbar_start_frame();
|
||||
void timerbar_end_frame();
|
||||
void timerbar_set_draw_func(void (*new_draw_func_ptr)(int colour, float x, float y, float w, float h));
|
||||
|
||||
void timerbar_push(int value);
|
||||
void timerbar_pop();
|
||||
|
||||
// This function shouldnt not be used any more or it will break push and pop calls
|
||||
void timerbar_switch_type(int num);
|
||||
|
||||
#define TIMERBAR_SET_DRAW_FUNC(f) if (Cmdline_timerbar) timerbar_set_draw_func(f);
|
||||
#define TIMERBAR_START_FRAME() if (Cmdline_timerbar) timerbar_start_frame();
|
||||
#define TIMERBAR_END_FRAME() if (Cmdline_timerbar) timerbar_end_frame();
|
||||
#define TIMERBAR_SWITCH_TYPE(n) if (Cmdline_timerbar) timerbar_switch_type(n);
|
||||
|
||||
#define TIMERBAR_PUSH(v) if (Cmdline_timerbar) timerbar_push(v);
|
||||
#define TIMERBAR_POP() if (Cmdline_timerbar) timerbar_pop();
|
||||
|
||||
#endif
|
||||
|
||||
File diff suppressed because it is too large.
Load diff
@@ -0,0 +1,108 @@
|
||||
//header file for making decals-Bobboau
|
||||
|
||||
|
||||
#ifndef _DECAL_H
|
||||
#define _DECAL_H
|
||||
|
||||
|
||||
#include "object/object.h"
|
||||
|
||||
#define MAX_DECAL_POLY 40
|
||||
#define MAX_DECAL_POLY_POINT 10
|
||||
#define MAX_DECAL_DEFPOINTS 10000
|
||||
#define MAX_DECAL_POINT 10
|
||||
#define MAX_SHIP_DECALS 25
|
||||
#define MAX_GLOBAL_DECAL_POLYS 11000
|
||||
#define QUICKFIND_SUBDIVISION 100
|
||||
#define QUICKFIND_SEGMENT_LENGTH (MAX_GLOBAL_DECAL_POLYS/QUICKFIND_SUBDIVISION)
|
||||
#define MAX_GLOBAL_DECALS 5000
|
||||
|
||||
#include "globalincs/pstypes.h"
|
||||
//#include "ship/ship.h"
|
||||
|
||||
#define DP_EOF 0
|
||||
#define DP_DEFPOINTS 1
|
||||
#define DP_FLATPOLY 2
|
||||
#define DP_TMAPPOLY 3
|
||||
#define DP_SORTNORM 4
|
||||
#define DP_BOUNDBOX 5
|
||||
|
||||
struct decal;
|
||||
struct decal_list;
|
||||
struct decal_list_controle;
|
||||
|
||||
struct decal_poly{
|
||||
vec3d norm[3];
|
||||
vertex point[3];
|
||||
decal_poly *next;
|
||||
decal* parent;
|
||||
int idx;
|
||||
};
|
||||
|
||||
struct decal{
|
||||
int n_poly;
|
||||
int timestamp; //when this decal was created
|
||||
int burn_time; //how long it takes for the glow texture to fade
|
||||
int vertex_buffer_start; //were is the start of this decal's polys in the vertex buffer
|
||||
decal_poly* poly;
|
||||
decal_poly* add_poly();
|
||||
decal_poly* get_last_poly();
|
||||
void remove_last_poly();
|
||||
decal_list_controle *parent;
|
||||
};
|
||||
|
||||
struct decal_list{
|
||||
decal dec;
|
||||
decal_list *next;
|
||||
};
|
||||
|
||||
struct decal_item{
|
||||
decal_list dec;
|
||||
bool used;
|
||||
};
|
||||
|
||||
struct decal_list_controle{
|
||||
int n_decals;
|
||||
int buffer;
|
||||
int texture;
|
||||
int n_poly;
|
||||
int burn_texture;
|
||||
int glow_texture;
|
||||
bool modifyed;
|
||||
decal_list *d_list;
|
||||
decal_list *end;
|
||||
decal_list *add_new();
|
||||
void trim();
|
||||
void clear();
|
||||
~decal_list_controle();
|
||||
decal_list_controle();
|
||||
};
|
||||
|
||||
struct decal_system{
|
||||
decal_list_controle *decals;
|
||||
int n_decal_textures;
|
||||
bool decals_modified;
|
||||
int max_decals;
|
||||
decal_system():decals(NULL),n_decal_textures(0),decals_modified(false){};
|
||||
};
|
||||
|
||||
|
||||
//this is used to give all the data to the generation data to the functions that make them
|
||||
|
||||
struct decal_point{
|
||||
vec3d pnt;
|
||||
matrix orient;
|
||||
float radius;
|
||||
};
|
||||
|
||||
int decal_create(object * obj, decal_point *point, int subobject, int texture, int backfaced_texture = -1, int glow_texture = -1, int burn_texture = -1, int burn_time = 1000);//makes the decal
|
||||
|
||||
int decal_create_simple(object * obj, decal_point *point, int texture);//makes a simple non-clipped decal
|
||||
|
||||
void decal_render_all(object * obj); //renders all decals
|
||||
|
||||
int decal_create_sub(void *model_ptr);
|
||||
|
||||
void clear_decals(decal_system *system);
|
||||
|
||||
#endif
|
||||
+31
-12
@@ -9,12 +9,31 @@
|
||||
|
||||
/*
|
||||
* $Logfile: /Freespace2/code/Demo/Demo.cpp $
|
||||
* $Revision: 2.2 $
|
||||
* $Date: 2002-08-01 01:41:04 $
|
||||
* $Author: penguin $
|
||||
* $Revision: 2.8 $
|
||||
* $Date: 2005-05-12 17:49:11 $
|
||||
* $Author: taylor $
|
||||
*
|
||||
*
|
||||
* $Log: not supported by cvs2svn $
|
||||
* Revision 2.7 2005/04/05 05:53:15 taylor
|
||||
* s/vector/vec3d/g, better support for different compilers (Jens Granseuer)
|
||||
*
|
||||
* Revision 2.6 2005/01/31 23:27:52 taylor
|
||||
* merge with Linux/OSX tree - p0131-2
|
||||
*
|
||||
* Revision 2.5 2004/07/26 20:47:27 Kazan
|
||||
* remove MCD complete
|
||||
*
|
||||
* Revision 2.4 2004/07/12 16:32:45 Kazan
|
||||
* MCD - define _MCD_CHECK to use memory tracking
|
||||
*
|
||||
* Revision 2.3 2004/03/05 09:01:59 Goober5000
|
||||
* Uber pass at reducing #includes
|
||||
* --Goober5000
|
||||
*
|
||||
* Revision 2.2 2002/08/01 01:41:04 penguin
|
||||
* The big include file move
|
||||
*
|
||||
* Revision 2.1 2002/07/07 19:55:58 penguin
|
||||
* Back-port to MSVC
|
||||
*
|
||||
@@ -47,21 +66,21 @@
|
||||
* $NoKeywords: $
|
||||
*/
|
||||
|
||||
#include "globalincs/pstypes.h"
|
||||
#include "demo/demo.h"
|
||||
#include "mission/missionload.h"
|
||||
#include "ship/ship.h"
|
||||
#include "weapon/weapon.h"
|
||||
#include "globalincs/linklist.h"
|
||||
#include "freespace2/freespace.h"
|
||||
#include "object/object.h"
|
||||
#include "io/timer.h"
|
||||
#include "gamesequence/gamesequence.h"
|
||||
#include "globalincs/systemvars.h"
|
||||
#include "cfile/cfile.h"
|
||||
#include "mission/missionmessage.h"
|
||||
#include "mission/missionparse.h"
|
||||
#include "ship/shipfx.h"
|
||||
#include "ship/shiphit.h"
|
||||
#include "cfile/cfile.h"
|
||||
|
||||
|
||||
|
||||
// -----------------------------------------------------------------------------------------------------------------------------
|
||||
// DEMO DEFINES/VARS
|
||||
@@ -138,7 +157,7 @@ int Demo_error = DEMO_ERROR_NONE;
|
||||
#define DEMO_BYTE(vl) do { DEMO_DATA(vl, sizeof(char)); } while(0)
|
||||
#define DEMO_UBYTE(vl) do { DEMO_DATA(vl, sizeof(ubyte)); } while(0)
|
||||
#define DEMO_FLOAT(vl) do { DEMO_DATA(vl, sizeof(float)); } while(0)
|
||||
#define DEMO_VECTOR(vl) do { DEMO_DATA(vl, sizeof(vector)); } while(0)
|
||||
#define DEMO_VECTOR(vl) do { DEMO_DATA(vl, sizeof(vec3d)); } while(0)
|
||||
#define DEMO_MATRIX(vl) do { DEMO_DATA(vl, sizeof(matrix)); } while(0)
|
||||
#define DEMO_STRING(vl) do { int stlen; if(Game_mode & GM_DEMO_RECORD){ stlen = strlen(vl); if(stlen <= 0){ break; } DEMO_DATA(stlen, sizeof(ushort)); DEMO_DATA(*vl, strlen(vl)); } else { ushort len = 0; DEMO_USHORT(len); DEMO_DATA(*vl, len); vl[len] = '\0'; } } while(0)
|
||||
|
||||
@@ -285,7 +304,7 @@ int demo_start_record(char *file)
|
||||
char full_name[MAX_FILENAME_LEN] = "";
|
||||
|
||||
// try and allocate the buffer
|
||||
Demo_buf = (char*)malloc(DEMO_BUF_SIZE);
|
||||
Demo_buf = (char*)vm_malloc(DEMO_BUF_SIZE);
|
||||
if(Demo_buf == NULL){
|
||||
DEMO_ERROR(DEMO_ERROR_DISK_ACCESS);
|
||||
return 0;
|
||||
@@ -329,7 +348,7 @@ int demo_start_playback(char *file)
|
||||
char full_name[MAX_FILENAME_LEN] = "";
|
||||
|
||||
// try and allocate the buffer
|
||||
Demo_buf = (char*)malloc(DEMO_BUF_SIZE);
|
||||
Demo_buf = (char*)vm_malloc(DEMO_BUF_SIZE);
|
||||
if(Demo_buf == NULL){
|
||||
DEMO_ERROR(DEMO_ERROR_DISK_ACCESS);
|
||||
return 0;
|
||||
@@ -379,7 +398,7 @@ void demo_close()
|
||||
|
||||
// free the buffer
|
||||
if(Demo_buf != NULL){
|
||||
free(Demo_buf);
|
||||
vm_free(Demo_buf);
|
||||
Demo_buf = NULL;
|
||||
}
|
||||
|
||||
@@ -817,7 +836,7 @@ int demo_playback_seek_sub(int frame_size)
|
||||
ushort obj_count = 0;
|
||||
int obj_sig = 0;
|
||||
ubyte team = 0;
|
||||
vector obj_pos = vmd_zero_vector;
|
||||
vec3d obj_pos = vmd_zero_vector;
|
||||
matrix obj_orient = vmd_identity_matrix;
|
||||
float obj_fthrust = 0;
|
||||
int ship_index = 0;
|
||||
|
||||
@@ -9,12 +9,18 @@
|
||||
|
||||
/*
|
||||
* $Logfile: /Freespace2/code/Demo/Demo.h $
|
||||
* $Revision: 2.0 $
|
||||
* $Date: 2002-06-03 04:02:21 $
|
||||
* $Author: penguin $
|
||||
* $Revision: 2.2 $
|
||||
* $Date: 2005-07-13 02:50:51 $
|
||||
* $Author: Goober5000 $
|
||||
*
|
||||
*
|
||||
* $Log: not supported by cvs2svn $
|
||||
* Revision 2.1 2004/08/11 05:06:21 Kazan
|
||||
* added preprocdefines.h to prevent what happened with fred -- make sure to make all fred2 headers include this file as the _first_ include -- i have already modified fs2 files to do this
|
||||
*
|
||||
* Revision 2.0 2002/06/03 04:02:21 penguin
|
||||
* Warpcore CVS sync
|
||||
*
|
||||
* Revision 1.1 2002/05/02 18:03:04 mharris
|
||||
* Initial checkin - converted filenames and includes to lower case
|
||||
*
|
||||
@@ -31,6 +37,7 @@
|
||||
* $NoKeywords: $
|
||||
*/
|
||||
|
||||
|
||||
#ifndef _FS2_DEMO_SYSTEM_HEADER_FILE
|
||||
#define _FS2_DEMO_SYSTEM_HEADER_FILE
|
||||
|
||||
|
||||
@@ -0,0 +1,341 @@
|
||||
#include <dshow.h>
|
||||
#include <stdio.h>
|
||||
|
||||
#include "osapi/osapi.h"
|
||||
#include "directx/dx8show.h"
|
||||
#include "debugconsole/dbugfile.h"
|
||||
#include "graphics/2d.h"
|
||||
|
||||
#include <commctrl.h>
|
||||
#include <commdlg.h>
|
||||
#include <tchar.h>
|
||||
//#include <atlbase.h> // No dependecy on ATL!!!
|
||||
|
||||
|
||||
|
||||
enum PLAYSTATE {Stopped, Paused, Running, Init};
|
||||
void Msg(TCHAR *szFormat, ...);
|
||||
|
||||
// Local
|
||||
HRESULT InitPlayerWindow(HWND ghApp);
|
||||
HRESULT InitVideoWindow(HWND ghApp, long w, long h);
|
||||
bool HandleGraphEvent(void);
|
||||
void CheckVisibility(void);
|
||||
void CloseInterfaces(void);
|
||||
|
||||
//
|
||||
// Constants
|
||||
//
|
||||
#define VOLUME_FULL 0L
|
||||
#define VOLUME_SILENCE -10000L
|
||||
|
||||
#define WM_GRAPHNOTIFY WM_USER
|
||||
|
||||
char error_buffer[512];
|
||||
char *ParseDShowError(HRESULT hr)
|
||||
{
|
||||
#ifndef NDEBUG
|
||||
AMGetErrorText(hr, error_buffer, 512);
|
||||
return error_buffer;
|
||||
#else
|
||||
return "DShow error";
|
||||
#endif
|
||||
}
|
||||
|
||||
//
|
||||
// Macros
|
||||
//
|
||||
#define SAFE_RELEASE(x) { if (x) x->Release(); x = NULL; }
|
||||
|
||||
#define JIF(x) if (FAILED(hr=(x))) \
|
||||
{Msg(TEXT("FAILED(hr=0x%x) in ") TEXT(#x) " (%s) " TEXT("\n"), hr, ParseDShowError(hr)); return hr;}
|
||||
|
||||
#define LIF(x) if (FAILED(hr=(x))) \
|
||||
{Msg(TEXT("FAILED(hr=0x%x) in ") TEXT(#x) TEXT("\n"), hr);}
|
||||
|
||||
//
|
||||
// Global data
|
||||
//
|
||||
BOOL g_bAudioOnly=FALSE;
|
||||
LONG g_lVolume=VOLUME_FULL;
|
||||
DWORD g_dwGraphRegister=0;
|
||||
PLAYSTATE g_psCurrent=Stopped;
|
||||
|
||||
// DirectShow interfaces
|
||||
IGraphBuilder *pGB = NULL;
|
||||
IMediaControl *pMC = NULL;
|
||||
IMediaEventEx *pME = NULL;
|
||||
IVideoWindow *pVW = NULL;
|
||||
IBasicAudio *pBA = NULL;
|
||||
IBasicVideo *pBV = NULL;
|
||||
IMediaSeeking *pMS = NULL;
|
||||
IMediaPosition *pMP = NULL;
|
||||
|
||||
void PassMsgToVideoWindow(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam)
|
||||
{
|
||||
if (pVW)
|
||||
pVW->NotifyOwnerMessage((long) hWnd, message, wParam, lParam);
|
||||
}
|
||||
|
||||
void SetCurrentState(PLAYSTATE state)
|
||||
{
|
||||
g_psCurrent = state;
|
||||
}
|
||||
|
||||
PLAYSTATE GetCurrentState()
|
||||
{
|
||||
return g_psCurrent;
|
||||
}
|
||||
|
||||
BOOL IsAudioOnly()
|
||||
{
|
||||
return g_bAudioOnly;
|
||||
}
|
||||
|
||||
HRESULT PlayMovieInWindow(HWND ghApp, LPTSTR szFile)
|
||||
{
|
||||
// USES_CONVERSION;
|
||||
WCHAR wFile[MAX_PATH];
|
||||
HRESULT hr;
|
||||
|
||||
// Clear open dialog remnants before calling RenderFile()
|
||||
UpdateWindow(ghApp);
|
||||
|
||||
// Convert filename to wide character string
|
||||
// wcscpy(wFile, T2W(szFile)); // requires ATL
|
||||
swprintf(wFile, L"%S", szFile); // Uses libc to convert instead
|
||||
|
||||
// Get the interface for DirectShow's GraphBuilder
|
||||
JIF(CoCreateInstance(CLSID_FilterGraph, NULL, CLSCTX_INPROC_SERVER,
|
||||
IID_IGraphBuilder, (void **)&pGB));
|
||||
|
||||
if(SUCCEEDED(hr))
|
||||
{
|
||||
HRESULT load_attempt = pGB->RenderFile(wFile, NULL);
|
||||
|
||||
// Have the graph builder construct its the appropriate graph automatically
|
||||
if(FAILED(load_attempt))
|
||||
{
|
||||
return load_attempt;
|
||||
}
|
||||
|
||||
// QueryInterface for DirectShow interfaces
|
||||
JIF(pGB->QueryInterface(IID_IMediaControl, (void **)&pMC));
|
||||
JIF(pGB->QueryInterface(IID_IMediaEventEx, (void **)&pME));
|
||||
JIF(pGB->QueryInterface(IID_IMediaSeeking, (void **)&pMS));
|
||||
JIF(pGB->QueryInterface(IID_IMediaPosition, (void **)&pMP));
|
||||
|
||||
// Query for video interfaces, which may not be relevant for audio files
|
||||
JIF(pGB->QueryInterface(IID_IVideoWindow, (void **)&pVW));
|
||||
JIF(pGB->QueryInterface(IID_IBasicVideo, (void **)&pBV));
|
||||
|
||||
// Query for audio interfaces, which may not be relevant for video-only files
|
||||
JIF(pGB->QueryInterface(IID_IBasicAudio, (void **)&pBA));
|
||||
|
||||
// Is this an audio-only file (no video component)?
|
||||
CheckVisibility();
|
||||
|
||||
// Have the graph signal event via window callbacks for performance
|
||||
JIF(pME->SetNotifyWindow((OAHWND)ghApp, WM_GRAPHNOTIFY, 0));
|
||||
|
||||
long width, height;
|
||||
pBV->get_VideoWidth(&width);
|
||||
pBV->get_VideoHeight(&height);
|
||||
|
||||
JIF(InitVideoWindow(ghApp,width, height));
|
||||
|
||||
if (!g_bAudioOnly)
|
||||
{
|
||||
JIF(pVW->put_Owner((OAHWND)ghApp));
|
||||
JIF(pVW->put_WindowStyle(WS_CHILD | WS_CLIPSIBLINGS | WS_CLIPCHILDREN | WS_VISIBLE));
|
||||
JIF(pVW->SetWindowForeground(OATRUE));
|
||||
}
|
||||
|
||||
// Run the graph to play the media file
|
||||
JIF(pMC->Run());
|
||||
g_psCurrent=Running;
|
||||
}
|
||||
|
||||
return hr;
|
||||
}
|
||||
|
||||
extern int Cmdline_window;
|
||||
extern int Cmdline_noscalevid;
|
||||
HRESULT InitVideoWindow(HWND ghApp, long video_w, long video_h)
|
||||
{
|
||||
HRESULT hr = S_OK;
|
||||
RECT rect;
|
||||
|
||||
GetClientRect(ghApp, &rect);
|
||||
|
||||
int screen_w = rect.right;
|
||||
int screen_h = rect.bottom;
|
||||
|
||||
int video_rescale_w;
|
||||
int video_rescale_h;
|
||||
|
||||
if (Cmdline_noscalevid && (video_w < screen_w) && (video_h < screen_h)) {
|
||||
video_rescale_w = video_w;
|
||||
video_rescale_h = video_h;
|
||||
} else {
|
||||
video_rescale_w = (video_w * screen_w) / video_w;
|
||||
video_rescale_h = (video_rescale_w * video_h) / video_w;
|
||||
}
|
||||
|
||||
int extra_w = (screen_w - video_rescale_w) / 2;
|
||||
int extra_h = (screen_h - video_rescale_h) / 2;
|
||||
|
||||
if (Cmdline_window)
|
||||
{
|
||||
rect.right += GetSystemMetrics(SM_CXFIXEDFRAME) * 2;
|
||||
rect.bottom += 2 * GetSystemMetrics(SM_CYFIXEDFRAME) + GetSystemMetrics(SM_CYCAPTION);
|
||||
}
|
||||
|
||||
if(SetWindowPos(ghApp, 0, 0, 0, rect.right, rect.bottom, SWP_NOMOVE | SWP_NOOWNERZORDER) == FALSE) {
|
||||
|
||||
MessageBox(ghApp,"Failed SetWindowPos","Error", MB_OK);
|
||||
}
|
||||
|
||||
JIF(pVW->SetWindowPosition(extra_w, extra_h, video_rescale_w, video_rescale_h));
|
||||
return hr;
|
||||
}
|
||||
|
||||
void CheckVisibility(void)
|
||||
{
|
||||
long lVisible;
|
||||
HRESULT hr;
|
||||
|
||||
if ((!pVW) || (!pBV))
|
||||
{
|
||||
// Audio-only files have no video interfaces. This might also
|
||||
// be a file whose video component uses an unknown video codec.
|
||||
g_bAudioOnly = TRUE;
|
||||
return;
|
||||
}
|
||||
else
|
||||
{
|
||||
// Clear the global flag
|
||||
g_bAudioOnly = FALSE;
|
||||
}
|
||||
|
||||
hr = pVW->get_Visible(&lVisible);
|
||||
if (FAILED(hr))
|
||||
{
|
||||
|
||||
// If this is an audio-only clip, get_Visible() won't work.
|
||||
//
|
||||
// Also, if this video is encoded with an unsupported codec,
|
||||
// we won't see any video, although the audio will work if it is
|
||||
// of a supported format.
|
||||
//
|
||||
if (hr == E_NOINTERFACE)
|
||||
{
|
||||
g_bAudioOnly = TRUE;
|
||||
}
|
||||
else
|
||||
{
|
||||
Msg(TEXT("Failed(%08lx) in pVW->get_Visible()!\r\n"), hr);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
bool OpenClip(HWND ghApp, char *g_szFileName)
|
||||
{
|
||||
// Reset status variables
|
||||
g_psCurrent = Stopped;
|
||||
g_lVolume = VOLUME_FULL;
|
||||
|
||||
// Start playing the media file
|
||||
HRESULT hr = PlayMovieInWindow(ghApp, g_szFileName);
|
||||
|
||||
// If we couldn't play the clip, clean up
|
||||
if (FAILED(hr)) {
|
||||
CloseClip(ghApp);
|
||||
return false;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
void CloseClip(HWND ghApp)
|
||||
{
|
||||
HRESULT hr;
|
||||
|
||||
// Stop media playback
|
||||
if(pMC)
|
||||
hr = pMC->Stop();
|
||||
|
||||
// Clear global flags
|
||||
g_psCurrent = Stopped;
|
||||
g_bAudioOnly = TRUE;
|
||||
|
||||
// Free DirectShow interfaces
|
||||
CloseInterfaces();
|
||||
|
||||
// No current media state
|
||||
g_psCurrent = Init;
|
||||
}
|
||||
|
||||
|
||||
void CloseInterfaces(void)
|
||||
{
|
||||
// Relinquish ownership (IMPORTANT!) after hiding video window
|
||||
if(pVW)
|
||||
pVW->put_Visible(OAFALSE);
|
||||
|
||||
// Disable event callbacks
|
||||
if (pME)
|
||||
pME->SetNotifyWindow((OAHWND)NULL, 0, 0);
|
||||
|
||||
// Release and zero DirectShow interfaces
|
||||
SAFE_RELEASE(pME);
|
||||
SAFE_RELEASE(pMS);
|
||||
SAFE_RELEASE(pMP);
|
||||
SAFE_RELEASE(pMC);
|
||||
SAFE_RELEASE(pBA);
|
||||
SAFE_RELEASE(pBV);
|
||||
SAFE_RELEASE(pVW);
|
||||
SAFE_RELEASE(pGB);
|
||||
}
|
||||
|
||||
void Msg(TCHAR *szFormat, ...)
|
||||
{
|
||||
TCHAR szBuffer[512]; // Large buffer for very long filenames (like HTTP)
|
||||
|
||||
// Format the input string
|
||||
va_list pArgs;
|
||||
va_start(pArgs, szFormat);
|
||||
_vstprintf(szBuffer, szFormat, pArgs);
|
||||
va_end(pArgs);
|
||||
|
||||
// Display a message box with the formatted string
|
||||
MessageBox(NULL, szBuffer, TEXT("PlayWnd Sample"), MB_OK);
|
||||
}
|
||||
|
||||
// returns true when finished
|
||||
bool dx8show_stream_movie(void)
|
||||
{
|
||||
LONG evCode, evParam1, evParam2;
|
||||
HRESULT hr=S_OK;
|
||||
|
||||
// Make sure that we don't access the media event interface
|
||||
// after it has already been released.
|
||||
if (!pME) {
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
// Process all queued events
|
||||
while(SUCCEEDED(pME->GetEvent(&evCode, &evParam1,&evParam2, 0))) {
|
||||
// Free memory associated with callback, since we're not using it
|
||||
hr = pME->FreeEventParams(evCode, evParam1, evParam2);
|
||||
|
||||
// If this is the end of the clip, reset to beginning
|
||||
if(EC_COMPLETE == evCode)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -0,0 +1,11 @@
|
||||
|
||||
#ifndef _DX8SHOW_HEADER_FILE
|
||||
#define _DX8SHOW_HEADER_FILE
|
||||
|
||||
bool OpenClip(HWND ghApp, char *g_szFileName);
|
||||
void CloseClip(HWND ghApp);
|
||||
bool dx8show_stream_movie(void);
|
||||
void PassMsgToVideoWindow(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam);
|
||||
|
||||
#endif
|
||||
|
||||
Binary file not shown.
Binary file not shown.
@@ -5,6 +5,7 @@
|
||||
* File: async.h
|
||||
* Content: AsyncData object include file
|
||||
***************************************************************************/
|
||||
|
||||
#ifndef __ASYNC_INCLUDED__
|
||||
#define __ASYNC_INCLUDED__
|
||||
|
||||
|
||||
@@ -1,896 +0,0 @@
|
||||
/*==========================================================================;
|
||||
*
|
||||
* Copyright (C) 1995-1997 Microsoft Corporation. All Rights Reserved.
|
||||
*
|
||||
* File: d3d.h
|
||||
* Content: Direct3D include file
|
||||
*
|
||||
***************************************************************************/
|
||||
|
||||
#ifndef _D3D_H_
|
||||
#define _D3D_H_
|
||||
|
||||
#include <stdlib.h>
|
||||
|
||||
#ifdef _WIN32
|
||||
#define COM_NO_WINDOWS_H
|
||||
#include <objbase.h>
|
||||
#else
|
||||
#include "d3dcom.h"
|
||||
#endif
|
||||
|
||||
#ifdef _WIN32
|
||||
#define D3DAPI WINAPI
|
||||
#else
|
||||
#define D3DAPI
|
||||
#endif
|
||||
|
||||
/*
|
||||
* Interface IID's
|
||||
*/
|
||||
#if defined( _WIN32 ) && !defined( _NO_COM)
|
||||
DEFINE_GUID( IID_IDirect3D, 0x3BBA0080,0x2421,0x11CF,0xA3,0x1A,0x00,0xAA,0x00,0xB9,0x33,0x56 );
|
||||
DEFINE_GUID( IID_IDirect3D2, 0x6aae1ec1,0x662a,0x11d0,0x88,0x9d,0x00,0xaa,0x00,0xbb,0xb7,0x6a);
|
||||
|
||||
DEFINE_GUID( IID_IDirect3DRampDevice, 0xF2086B20,0x259F,0x11CF,0xA3,0x1A,0x00,0xAA,0x00,0xB9,0x33,0x56 );
|
||||
DEFINE_GUID( IID_IDirect3DRGBDevice, 0xA4665C60,0x2673,0x11CF,0xA3,0x1A,0x00,0xAA,0x00,0xB9,0x33,0x56 );
|
||||
DEFINE_GUID( IID_IDirect3DHALDevice, 0x84E63dE0,0x46AA,0x11CF,0x81,0x6F,0x00,0x00,0xC0,0x20,0x15,0x6E );
|
||||
DEFINE_GUID( IID_IDirect3DMMXDevice, 0x881949a1,0xd6f3,0x11d0,0x89,0xab,0x00,0xa0,0xc9,0x05,0x41,0x29 );
|
||||
|
||||
DEFINE_GUID( IID_IDirect3DDevice, 0x64108800,0x957d,0X11d0,0x89,0xab,0x00,0xa0,0xc9,0x05,0x41,0x29 );
|
||||
DEFINE_GUID( IID_IDirect3DDevice2, 0x93281501, 0x8cf8, 0x11d0, 0x89, 0xab, 0x0, 0xa0, 0xc9, 0x5, 0x41, 0x29);
|
||||
DEFINE_GUID( IID_IDirect3DTexture, 0x2CDCD9E0,0x25A0,0x11CF,0xA3,0x1A,0x00,0xAA,0x00,0xB9,0x33,0x56 );
|
||||
DEFINE_GUID( IID_IDirect3DTexture2, 0x93281502, 0x8cf8, 0x11d0, 0x89, 0xab, 0x0, 0xa0, 0xc9, 0x5, 0x41, 0x29);
|
||||
DEFINE_GUID( IID_IDirect3DLight, 0x4417C142,0x33AD,0x11CF,0x81,0x6F,0x00,0x00,0xC0,0x20,0x15,0x6E );
|
||||
DEFINE_GUID( IID_IDirect3DMaterial, 0x4417C144,0x33AD,0x11CF,0x81,0x6F,0x00,0x00,0xC0,0x20,0x15,0x6E );
|
||||
DEFINE_GUID( IID_IDirect3DMaterial2, 0x93281503, 0x8cf8, 0x11d0, 0x89, 0xab, 0x0, 0xa0, 0xc9, 0x5, 0x41, 0x29);
|
||||
DEFINE_GUID( IID_IDirect3DExecuteBuffer,0x4417C145,0x33AD,0x11CF,0x81,0x6F,0x00,0x00,0xC0,0x20,0x15,0x6E );
|
||||
DEFINE_GUID( IID_IDirect3DViewport, 0x4417C146,0x33AD,0x11CF,0x81,0x6F,0x00,0x00,0xC0,0x20,0x15,0x6E );
|
||||
DEFINE_GUID( IID_IDirect3DViewport2, 0x93281500, 0x8cf8, 0x11d0, 0x89, 0xab, 0x0, 0xa0, 0xc9, 0x5, 0x41, 0x29);
|
||||
#endif
|
||||
|
||||
/*
|
||||
* Data structures
|
||||
*/
|
||||
#ifdef __cplusplus
|
||||
|
||||
/* 'struct' not 'class' per the way DECLARE_INTERFACE_ is defined */
|
||||
struct IDirect3D;
|
||||
struct IDirect3D2;
|
||||
struct IDirect3DDevice;
|
||||
struct IDirect3DDevice2;
|
||||
struct IDirect3DExecuteBuffer;
|
||||
struct IDirect3DLight;
|
||||
struct IDirect3DMaterial;
|
||||
struct IDirect3DMaterial2;
|
||||
struct IDirect3DTexture;
|
||||
struct IDirect3DTexture2;
|
||||
struct IDirect3DViewport;
|
||||
struct IDirect3DViewport2;
|
||||
typedef struct IDirect3D *LPDIRECT3D;
|
||||
typedef struct IDirect3D2 *LPDIRECT3D2;
|
||||
typedef struct IDirect3DDevice *LPDIRECT3DDEVICE;
|
||||
typedef struct IDirect3DDevice2 *LPDIRECT3DDEVICE2;
|
||||
typedef struct IDirect3DExecuteBuffer *LPDIRECT3DEXECUTEBUFFER;
|
||||
typedef struct IDirect3DLight *LPDIRECT3DLIGHT;
|
||||
typedef struct IDirect3DMaterial *LPDIRECT3DMATERIAL;
|
||||
typedef struct IDirect3DMaterial2 *LPDIRECT3DMATERIAL2;
|
||||
typedef struct IDirect3DTexture *LPDIRECT3DTEXTURE;
|
||||
typedef struct IDirect3DTexture2 *LPDIRECT3DTEXTURE2;
|
||||
typedef struct IDirect3DViewport *LPDIRECT3DVIEWPORT;
|
||||
typedef struct IDirect3DViewport2 *LPDIRECT3DVIEWPORT2;
|
||||
|
||||
#else
|
||||
|
||||
typedef struct IDirect3D *LPDIRECT3D;
|
||||
typedef struct IDirect3D2 *LPDIRECT3D2;
|
||||
typedef struct IDirect3DDevice *LPDIRECT3DDEVICE;
|
||||
typedef struct IDirect3DDevice2 *LPDIRECT3DDEVICE2;
|
||||
typedef struct IDirect3DExecuteBuffer *LPDIRECT3DEXECUTEBUFFER;
|
||||
typedef struct IDirect3DLight *LPDIRECT3DLIGHT;
|
||||
typedef struct IDirect3DMaterial *LPDIRECT3DMATERIAL;
|
||||
typedef struct IDirect3DMaterial2 *LPDIRECT3DMATERIAL2;
|
||||
typedef struct IDirect3DTexture *LPDIRECT3DTEXTURE;
|
||||
typedef struct IDirect3DTexture2 *LPDIRECT3DTEXTURE2;
|
||||
typedef struct IDirect3DViewport *LPDIRECT3DVIEWPORT;
|
||||
typedef struct IDirect3DViewport2 *LPDIRECT3DVIEWPORT2;
|
||||
|
||||
#endif
|
||||
|
||||
#include "directx/vd3dtypes.h"
|
||||
#include "directx/vd3dcaps.h"
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
/*
|
||||
* IDirect3D
|
||||
*/
|
||||
#undef INTERFACE
|
||||
#define INTERFACE IDirect3D
|
||||
DECLARE_INTERFACE_(IDirect3D, IUnknown)
|
||||
{
|
||||
/*** IUnknown methods ***/
|
||||
STDMETHOD(QueryInterface) (THIS_ REFIID riid, LPVOID* ppvObj) PURE;
|
||||
STDMETHOD_(ULONG, AddRef) (THIS) PURE;
|
||||
STDMETHOD_(ULONG, Release) (THIS) PURE;
|
||||
/*** IDirect3D methods ***/
|
||||
STDMETHOD(Initialize) (THIS_ REFIID) PURE;
|
||||
STDMETHOD(EnumDevices)(THIS_ LPD3DENUMDEVICESCALLBACK, LPVOID) PURE;
|
||||
STDMETHOD(CreateLight) (THIS_ LPDIRECT3DLIGHT*, IUnknown*) PURE;
|
||||
STDMETHOD(CreateMaterial) (THIS_ LPDIRECT3DMATERIAL*, IUnknown*) PURE;
|
||||
STDMETHOD(CreateViewport) (THIS_ LPDIRECT3DVIEWPORT*, IUnknown*) PURE;
|
||||
STDMETHOD(FindDevice)(THIS_ LPD3DFINDDEVICESEARCH, LPD3DFINDDEVICERESULT) PURE;
|
||||
};
|
||||
|
||||
#if !defined(__cplusplus) || defined(CINTERFACE)
|
||||
#define IDirect3D_QueryInterface(p, a, b) (p)->lpVtbl->QueryInterface(p, a, b)
|
||||
#define IDirect3D_AddRef(p) (p)->lpVtbl->AddRef(p)
|
||||
#define IDirect3D_Release(p) (p)->lpVtbl->Release(p)
|
||||
#define IDirect3D_Initialize(p, a) (p)->lpVtbl->Initialize(p, a)
|
||||
#define IDirect3D_EnumDevices(p, a, b) (p)->lpVtbl->EnumDevices(p, a, b)
|
||||
#define IDirect3D_CreateLight(p, a, b) (p)->lpVtbl->CreateLight(p, a, b)
|
||||
#define IDirect3D_CreateMaterial(p, a, b) (p)->lpVtbl->CreateMaterial(p, a, b)
|
||||
#define IDirect3D_CreateViewport(p, a, b) (p)->lpVtbl->CreateViewport(p, a, b)
|
||||
#define IDirect3D_FindDevice(p, a, b) (p)->lpVtbl->FindDevice(p, a, b)
|
||||
#else
|
||||
#define IDirect3D_QueryInterface(p, a, b) (p)->QueryInterface(a, b)
|
||||
#define IDirect3D_AddRef(p) (p)->AddRef()
|
||||
#define IDirect3D_Release(p) (p)->Release()
|
||||
#define IDirect3D_Initialize(p, a) (p)->Initialize(a)
|
||||
#define IDirect3D_EnumDevices(p, a, b) (p)->EnumDevices(a, b)
|
||||
#define IDirect3D_CreateLight(p, a, b) (p)->CreateLight(a, b)
|
||||
#define IDirect3D_CreateMaterial(p, a, b) (p)->CreateMaterial(a, b)
|
||||
#define IDirect3D_CreateViewport(p, a, b) (p)->CreateViewport(a, b)
|
||||
#define IDirect3D_FindDevice(p, a, b) (p)->FindDevice(a, b)
|
||||
#endif
|
||||
|
||||
/*
|
||||
* IDirect3D2
|
||||
*/
|
||||
#undef INTERFACE
|
||||
#define INTERFACE IDirect3D2
|
||||
DECLARE_INTERFACE_(IDirect3D2, IUnknown)
|
||||
{
|
||||
/*** IUnknown methods ***/
|
||||
STDMETHOD(QueryInterface) (THIS_ REFIID riid, LPVOID* ppvObj) PURE;
|
||||
STDMETHOD_(ULONG, AddRef) (THIS) PURE;
|
||||
STDMETHOD_(ULONG, Release) (THIS) PURE;
|
||||
/*** IDirect3D methods ***/
|
||||
STDMETHOD(EnumDevices)(THIS_ LPD3DENUMDEVICESCALLBACK, LPVOID) PURE;
|
||||
STDMETHOD(CreateLight) (THIS_ LPDIRECT3DLIGHT*, IUnknown*) PURE;
|
||||
STDMETHOD(CreateMaterial) (THIS_ LPDIRECT3DMATERIAL2*, IUnknown*) PURE;
|
||||
STDMETHOD(CreateViewport) (THIS_ LPDIRECT3DVIEWPORT2*, IUnknown*) PURE;
|
||||
STDMETHOD(FindDevice)(THIS_ LPD3DFINDDEVICESEARCH, LPD3DFINDDEVICERESULT) PURE;
|
||||
|
||||
STDMETHOD(CreateDevice)(THIS_ REFCLSID, LPDIRECTDRAWSURFACE, LPDIRECT3DDEVICE2 *) PURE;
|
||||
|
||||
};
|
||||
|
||||
#if !defined(__cplusplus) || defined(CINTERFACE)
|
||||
#define IDirect3D2_QueryInterface(p, a, b) (p)->lpVtbl->QueryInterface(p, a, b)
|
||||
#define IDirect3D2_AddRef(p) (p)->lpVtbl->AddRef(p)
|
||||
#define IDirect3D2_Release(p) (p)->lpVtbl->Release(p)
|
||||
#define IDirect3D2_EnumDevices(p, a, b) (p)->lpVtbl->EnumDevices(p, a, b)
|
||||
#define IDirect3D2_CreateLight(p, a, b) (p)->lpVtbl->CreateLight(p, a, b)
|
||||
#define IDirect3D2_CreateMaterial(p, a, b) (p)->lpVtbl->CreateMaterial(p, a, b)
|
||||
#define IDirect3D2_CreateViewport(p, a, b) (p)->lpVtbl->CreateViewport(p, a, b)
|
||||
#define IDirect3D2_FindDevice(p, a, b) (p)->lpVtbl->FindDevice(p, a, b)
|
||||
#define IDirect3D2_CreateDevice(p, a, b, c) (p)->lpVtbl->CreateDevice(p, a, b, c)
|
||||
#else
|
||||
#define IDirect3D2_QueryInterface(p, a, b) (p)->QueryInterface(a, b)
|
||||
#define IDirect3D2_AddRef(p) (p)->AddRef()
|
||||
#define IDirect3D2_Release(p) (p)->Release()
|
||||
#define IDirect3D2_EnumDevices(p, a, b) (p)->EnumDevices(a, b)
|
||||
#define IDirect3D2_CreateLight(p, a, b) (p)->CreateLight(a, b)
|
||||
#define IDirect3D2_CreateMaterial(p, a, b) (p)->CreateMaterial(a, b)
|
||||
#define IDirect3D2_CreateViewport(p, a, b) (p)->CreateViewport(a, b)
|
||||
#define IDirect3D2_FindDevice(p, a, b) (p)->FindDevice(a, b)
|
||||
#define IDirect3D2_CreateDevice(p, a, b, c) (p)->CreateDevice(a, b, c)
|
||||
#endif
|
||||
|
||||
/*
|
||||
* IDirect3DDevice
|
||||
*/
|
||||
#undef INTERFACE
|
||||
#define INTERFACE IDirect3DDevice
|
||||
DECLARE_INTERFACE_(IDirect3DDevice, IUnknown)
|
||||
{
|
||||
/*** IUnknown methods ***/
|
||||
STDMETHOD(QueryInterface) (THIS_ REFIID riid, LPVOID* ppvObj) PURE;
|
||||
STDMETHOD_(ULONG, AddRef) (THIS) PURE;
|
||||
STDMETHOD_(ULONG, Release) (THIS) PURE;
|
||||
/*** IDirect3DDevice methods ***/
|
||||
STDMETHOD(Initialize) (THIS_ LPDIRECT3D, LPGUID, LPD3DDEVICEDESC) PURE;
|
||||
STDMETHOD(GetCaps) (THIS_ LPD3DDEVICEDESC, LPD3DDEVICEDESC) PURE;
|
||||
STDMETHOD(SwapTextureHandles) (THIS_ LPDIRECT3DTEXTURE, LPDIRECT3DTEXTURE) PURE;
|
||||
STDMETHOD(CreateExecuteBuffer) (THIS_ LPD3DEXECUTEBUFFERDESC, LPDIRECT3DEXECUTEBUFFER*, IUnknown*) PURE;
|
||||
STDMETHOD(GetStats) (THIS_ LPD3DSTATS) PURE;
|
||||
STDMETHOD(Execute) (THIS_ LPDIRECT3DEXECUTEBUFFER, LPDIRECT3DVIEWPORT, DWORD) PURE;
|
||||
STDMETHOD(AddViewport) (THIS_ LPDIRECT3DVIEWPORT) PURE;
|
||||
STDMETHOD(DeleteViewport) (THIS_ LPDIRECT3DVIEWPORT) PURE;
|
||||
STDMETHOD(NextViewport) (THIS_ LPDIRECT3DVIEWPORT, LPDIRECT3DVIEWPORT*, DWORD) PURE;
|
||||
STDMETHOD(Pick) (THIS_ LPDIRECT3DEXECUTEBUFFER, LPDIRECT3DVIEWPORT, DWORD, LPD3DRECT) PURE;
|
||||
STDMETHOD(GetPickRecords)(THIS_ LPDWORD, LPD3DPICKRECORD) PURE;
|
||||
STDMETHOD(EnumTextureFormats) (THIS_ LPD3DENUMTEXTUREFORMATSCALLBACK, LPVOID) PURE;
|
||||
STDMETHOD(CreateMatrix) (THIS_ LPD3DMATRIXHANDLE) PURE;
|
||||
STDMETHOD(SetMatrix) (THIS_ D3DMATRIXHANDLE, const LPD3DMATRIX) PURE;
|
||||
STDMETHOD(GetMatrix) (THIS_ D3DMATRIXHANDLE, LPD3DMATRIX) PURE;
|
||||
STDMETHOD(DeleteMatrix) (THIS_ D3DMATRIXHANDLE) PURE;
|
||||
STDMETHOD_(HRESULT, BeginScene) (THIS) PURE;
|
||||
STDMETHOD_(HRESULT, EndScene) (THIS) PURE;
|
||||
STDMETHOD(GetDirect3D) (THIS_ LPDIRECT3D*) PURE;
|
||||
};
|
||||
|
||||
#if !defined(__cplusplus) || defined(CINTERFACE)
|
||||
#define IDirect3DDevice_QueryInterface(p, a, b) (p)->lpVtbl->QueryInterface(p, a, b)
|
||||
#define IDirect3DDevice_AddRef(p) (p)->lpVtbl->AddRef(p)
|
||||
#define IDirect3DDevice_Release(p) (p)->lpVtbl->Release(p)
|
||||
#define IDirect3DDevice_Initialize(p, a, b, c) (p)->lpVtbl->Initialize(p, a, b, c)
|
||||
#define IDirect3DDevice_GetCaps(p, a, b) (p)->lpVtbl->GetCaps(p, a, b)
|
||||
#define IDirect3DDevice_SwapTextureHandles(p, a, b) (p)->lpVtbl->SwapTextureHandles(p, a, b)
|
||||
#define IDirect3DDevice_CreateExecuteBuffer(p, a, b, c) (p)->lpVtbl->CreateExecuteBuffer(p, a, b, c)
|
||||
#define IDirect3DDevice_GetStats(p, a) (p)->lpVtbl->GetStats(p, a)
|
||||
#define IDirect3DDevice_Execute(p, a, b, c) (p)->lpVtbl->Execute(p, a, b, c)
|
||||
#define IDirect3DDevice_AddViewport(p, a) (p)->lpVtbl->AddViewport(p, a)
|
||||
#define IDirect3DDevice_DeleteViewport(p, a) (p)->lpVtbl->DeleteViewport(p, a)
|
||||
#define IDirect3DDevice_NextViewport(p, a, b) (p)->lpVtbl->NextViewport(p, a, b)
|
||||
#define IDirect3DDevice_Pick(p, a, b, c, d) (p)->lpVtbl->Pick(p, a, b, c, d)
|
||||
#define IDirect3DDevice_GetPickRecords(p, a, b) (p)->lpVtbl->GetPickRecords(p, a, b)
|
||||
#define IDirect3DDevice_EnumTextureFormats(p, a, b) (p)->lpVtbl->EnumTextureFormats(p, a, b)
|
||||
#define IDirect3DDevice_CreateMatrix(p, a) (p)->lpVtbl->CreateMatrix(p, a)
|
||||
#define IDirect3DDevice_SetMatrix(p, a, b) (p)->lpVtbl->SetMatrix(p, a, b)
|
||||
#define IDirect3DDevice_GetMatrix(p, a, b) (p)->lpVtbl->GetMatrix(p, a, b)
|
||||
#define IDirect3DDevice_DeleteMatrix(p, a) (p)->lpVtbl->DeleteMatrix(p, a)
|
||||
#define IDirect3DDevice_BeginScene(p) (p)->lpVtbl->BeginScene(p)
|
||||
#define IDirect3DDevice_EndScene(p) (p)->lpVtbl->EndScene(p)
|
||||
#define IDirect3DDevice_GetDirect3D(p, a) (p)->lpVtbl->GetDirect3D(p, a)
|
||||
#else
|
||||
#define IDirect3DDevice_QueryInterface(p, a, b) (p)->QueryInterface(a, b)
|
||||
#define IDirect3DDevice_AddRef(p) (p)->AddRef()
|
||||
#define IDirect3DDevice_Release(p) (p)->Release()
|
||||
#define IDirect3DDevice_Initialize(p, a, b, c) (p)->Initialize(a, b, c)
|
||||
#define IDirect3DDevice_GetCaps(p, a, b) (p)->GetCaps(a, b)
|
||||
#define IDirect3DDevice_SwapTextureHandles(p, a, b) (p)->SwapTextureHandles(a, b)
|
||||
#define IDirect3DDevice_CreateExecuteBuffer(p, a, b, c) (p)->CreateExecuteBuffer(a, b, c)
|
||||
#define IDirect3DDevice_GetStats(p, a) (p)->GetStats(a)
|
||||
#define IDirect3DDevice_Execute(p, a, b, c) (p)->Execute(a, b, c)
|
||||
#define IDirect3DDevice_AddViewport(p, a) (p)->AddViewport(a)
|
||||
#define IDirect3DDevice_DeleteViewport(p, a) (p)->DeleteViewport(a)
|
||||
#define IDirect3DDevice_NextViewport(p, a, b) (p)->NextViewport(a, b)
|
||||
#define IDirect3DDevice_Pick(p, a, b, c, d) (p)->Pick(a, b, c, d)
|
||||
#define IDirect3DDevice_GetPickRecords(p, a, b) (p)->GetPickRecords(a, b)
|
||||
#define IDirect3DDevice_EnumTextureFormats(p, a, b) (p)->EnumTextureFormats(a, b)
|
||||
#define IDirect3DDevice_CreateMatrix(p, a) (p)->CreateMatrix(a)
|
||||
#define IDirect3DDevice_SetMatrix(p, a, b) (p)->SetMatrix(a, b)
|
||||
#define IDirect3DDevice_GetMatrix(p, a, b) (p)->GetMatrix(a, b)
|
||||
#define IDirect3DDevice_DeleteMatrix(p, a) (p)->DeleteMatrix(a)
|
||||
#define IDirect3DDevice_BeginScene(p) (p)->BeginScene()
|
||||
#define IDirect3DDevice_EndScene(p) (p)->EndScene()
|
||||
#define IDirect3DDevice_GetDirect3D(p, a) (p)->GetDirect3D(a)
|
||||
#endif
|
||||
|
||||
/*
|
||||
* IDirect3DDevice2
|
||||
*/
|
||||
#undef INTERFACE
|
||||
#define INTERFACE IDirect3DDevice2
|
||||
DECLARE_INTERFACE_(IDirect3DDevice2, IUnknown)
|
||||
{
|
||||
/*** IUnknown methods ***/
|
||||
STDMETHOD(QueryInterface) (THIS_ REFIID riid, LPVOID* ppvObj) PURE;
|
||||
STDMETHOD_(ULONG, AddRef) (THIS) PURE;
|
||||
STDMETHOD_(ULONG, Release) (THIS) PURE;
|
||||
/*** IDirect3DDevice2 methods ***/
|
||||
STDMETHOD(GetCaps) (THIS_ LPD3DDEVICEDESC, LPD3DDEVICEDESC) PURE;
|
||||
STDMETHOD(SwapTextureHandles) (THIS_ LPDIRECT3DTEXTURE2, LPDIRECT3DTEXTURE2) PURE;
|
||||
STDMETHOD(GetStats) (THIS_ LPD3DSTATS) PURE;
|
||||
STDMETHOD(AddViewport) (THIS_ LPDIRECT3DVIEWPORT2) PURE;
|
||||
STDMETHOD(DeleteViewport) (THIS_ LPDIRECT3DVIEWPORT2) PURE;
|
||||
STDMETHOD(NextViewport) (THIS_ LPDIRECT3DVIEWPORT2, LPDIRECT3DVIEWPORT2*, DWORD) PURE;
|
||||
STDMETHOD(EnumTextureFormats) (THIS_ LPD3DENUMTEXTUREFORMATSCALLBACK, LPVOID) PURE;
|
||||
STDMETHOD_(HRESULT, BeginScene) (THIS) PURE;
|
||||
STDMETHOD_(HRESULT, EndScene) (THIS) PURE;
|
||||
STDMETHOD(GetDirect3D) (THIS_ LPDIRECT3D2*) PURE;
|
||||
|
||||
/*** DrawPrimitive API ***/
|
||||
STDMETHOD(SetCurrentViewport) (THIS_ LPDIRECT3DVIEWPORT2) PURE;
|
||||
STDMETHOD(GetCurrentViewport) (THIS_ LPDIRECT3DVIEWPORT2 *) PURE;
|
||||
|
||||
STDMETHOD(SetRenderTarget) (THIS_ LPDIRECTDRAWSURFACE, DWORD) PURE;
|
||||
STDMETHOD(GetRenderTarget) (THIS_ LPDIRECTDRAWSURFACE *) PURE;
|
||||
|
||||
STDMETHOD(Begin) (THIS_ D3DPRIMITIVETYPE, D3DVERTEXTYPE, DWORD) PURE;
|
||||
STDMETHOD(BeginIndexed) (THIS_ D3DPRIMITIVETYPE, D3DVERTEXTYPE, LPVOID, DWORD, DWORD) PURE;
|
||||
STDMETHOD(Vertex) (THIS_ LPVOID) PURE;
|
||||
STDMETHOD(Index) (THIS_ WORD) PURE;
|
||||
STDMETHOD(End) (THIS_ DWORD) PURE;
|
||||
|
||||
STDMETHOD(GetRenderState) (THIS_ D3DRENDERSTATETYPE, LPDWORD) PURE;
|
||||
STDMETHOD(SetRenderState) (THIS_ D3DRENDERSTATETYPE, DWORD) PURE;
|
||||
STDMETHOD(GetLightState) (THIS_ D3DLIGHTSTATETYPE, LPDWORD) PURE;
|
||||
STDMETHOD(SetLightState) (THIS_ D3DLIGHTSTATETYPE, DWORD) PURE;
|
||||
STDMETHOD(SetTransform) (THIS_ D3DTRANSFORMSTATETYPE, LPD3DMATRIX) PURE;
|
||||
STDMETHOD(GetTransform) (THIS_ D3DTRANSFORMSTATETYPE, LPD3DMATRIX) PURE;
|
||||
STDMETHOD(MultiplyTransform) (THIS_ D3DTRANSFORMSTATETYPE, LPD3DMATRIX) PURE;
|
||||
|
||||
STDMETHOD(DrawPrimitive) (THIS_ D3DPRIMITIVETYPE, D3DVERTEXTYPE, LPVOID, DWORD, DWORD) PURE;
|
||||
STDMETHOD(DrawIndexedPrimitive) (THIS_ D3DPRIMITIVETYPE, D3DVERTEXTYPE, LPVOID, DWORD, LPWORD, DWORD, DWORD) PURE;
|
||||
|
||||
STDMETHOD(SetClipStatus) (THIS_ LPD3DCLIPSTATUS) PURE;
|
||||
STDMETHOD(GetClipStatus) (THIS_ LPD3DCLIPSTATUS) PURE;
|
||||
};
|
||||
|
||||
#if !defined(__cplusplus) || defined(CINTERFACE)
|
||||
#define IDirect3DDevice2_QueryInterface(p, a, b) (p)->lpVtbl->QueryInterface(p, a, b)
|
||||
#define IDirect3DDevice2_AddRef(p) (p)->lpVtbl->AddRef(p)
|
||||
#define IDirect3DDevice2_Release(p) (p)->lpVtbl->Release(p)
|
||||
#define IDirect3DDevice2_GetCaps(p, a, b) (p)->lpVtbl->GetCaps(p, a, b)
|
||||
#define IDirect3DDevice2_SwapTextureHandles(p, a, b) (p)->lpVtbl->SwapTextureHandles(p, a, b)
|
||||
#define IDirect3DDevice2_GetStats(p, a) (p)->lpVtbl->CreateViewport(p, a)
|
||||
#define IDirect3DDevice2_AddViewport(p, a) (p)->lpVtbl->AddViewport(p, a)
|
||||
#define IDirect3DDevice2_DeleteViewport(p, a) (p)->lpVtbl->DeleteViewport(p, a)
|
||||
#define IDirect3DDevice2_NextViewport(p, a, b) (p)->lpVtbl->NextViewport(p, a, b)
|
||||
#define IDirect3DDevice2_EnumTextureFormats(p, a, b) (p)->lpVtbl->EnumTextureFormats(p, a, b)
|
||||
#define IDirect3DDevice2_BeginScene(p) (p)->lpVtbl->BeginScene(p)
|
||||
#define IDirect3DDevice2_EndScene(p) (p)->lpVtbl->EndScene(p)
|
||||
#define IDirect3DDevice2_GetDirect3D(p, a) (p)->lpVtbl->GetDirect3D(p, a)
|
||||
|
||||
#define IDirect3DDevice2_SetCurrentViewport(p, a) (p)->lpVtbl->SetCurrentViewport(p, a)
|
||||
#define IDirect3DDevice2_GetCurrentViewport(p, a) (p)->lpVtbl->GetCurrentViewport(p, a)
|
||||
|
||||
#define IDirect3DDevice2_SetRenderTarget(p, a, b) (p)->lpVtbl->SetRenderTarget(p, a, b)
|
||||
#define IDirect3DDevice2_GetRenderTarget(p, a) (p)->lpVtbl->GetRenderTarget(p, a)
|
||||
|
||||
#define IDirect3DDevice2_Begin(p, a, b, c) (p)->lpVtbl->Begin(p, a, b, c)
|
||||
#define IDirect3DDevice2_BeginIndexed(p, a, b, c, d, e) (p)->lpVtbl->Begin(p, a, b, c, d, e)
|
||||
#define IDirect3DDevice2_Vertex(p, a) (p)->lpVtbl->Vertex(p, a)
|
||||
#define IDirect3DDevice2_Index(p, a) (p)->lpVtbl->Index(p, a)
|
||||
#define IDirect3DDevice2_End(p, a) (p)->lpVtbl->End(p, a)
|
||||
|
||||
#define IDirect3DDevice2_GetRenderState(p, a, b) (p)->lpVtbl->GetRenderState(p, a, b)
|
||||
#define IDirect3DDevice2_SetRenderState(p, a, b) (p)->lpVtbl->SetRenderState(p, a, b)
|
||||
#define IDirect3DDevice2_GetLightState(p, a, b) (p)->lpVtbl->GetLightState(p, a, b)
|
||||
#define IDirect3DDevice2_SetLightState(p, a, b) (p)->lpVtbl->SetLightState(p, a, b)
|
||||
#define IDirect3DDevice2_SetTransform(p, a, b) (p)->lpVtbl->SetTransform(p, a, b)
|
||||
#define IDirect3DDevice2_GetTransform(p, a, b) (p)->lpVtbl->GetTransform(p, a, b)
|
||||
#define IDirect3DDevice2_MultiplyTransform(p, a, b) (p)->lpVtbl->MultiplyTransform(p, a, b)
|
||||
|
||||
#define IDirect3DDevice2_DrawPrimitive(p, a, b, c, d, e) (p)->lpVtbl->DrawPrimitive(p, a, b, c, d, e)
|
||||
#define IDirect3DDevice2_DrawIndexedPrimitive(p, a, b, c, d, e, f, g) \
|
||||
(p)->lpVtbl->DrawIndexedPrimitive(p, a, b, c, d, e, f, g)
|
||||
#define IDirect3DDevice2_SetClipStatus(p, a) (p)->lpVtbl->SetClipStatus(p, a)
|
||||
#define IDirect3DDevice2_GetClipStatus(p, a) (p)->lpVtbl->GetClipStatus(p, a)
|
||||
#else
|
||||
#define IDirect3DDevice2_QueryInterface(p, a, b) (p)->QueryInterface(a, b)
|
||||
#define IDirect3DDevice2_AddRef(p) (p)->AddRef()
|
||||
#define IDirect3DDevice2_Release(p) (p)->Release()
|
||||
#define IDirect3DDevice2_GetCaps(p, a, b) (p)->GetCaps(a, b)
|
||||
#define IDirect3DDevice2_SwapTextureHandles(p, a, b) (p)->SwapTextureHandles(a, b)
|
||||
#define IDirect3DDevice2_GetStats(p, a) (p)->CreateViewport(a)
|
||||
#define IDirect3DDevice2_AddViewport(p, a) (p)->AddViewport(a)
|
||||
#define IDirect3DDevice2_DeleteViewport(p, a) (p)->DeleteViewport(a)
|
||||
#define IDirect3DDevice2_NextViewport(p, a, b) (p)->NextViewport(a, b)
|
||||
#define IDirect3DDevice2_EnumTextureFormats(p, a, b) (p)->EnumTextureFormats(a, b)
|
||||
#define IDirect3DDevice2_BeginScene(p) (p)->BeginScene()
|
||||
#define IDirect3DDevice2_EndScene(p) (p)->EndScene()
|
||||
#define IDirect3DDevice2_GetDirect3D(p, a) (p)->GetDirect3D(a)
|
||||
|
||||
#define IDirect3DDevice2_SetCurrentViewport(p, a) (p)->SetCurrentViewport(a)
|
||||
#define IDirect3DDevice2_GetCurrentViewport(p, a) (p)->GetCurrentViewport(a)
|
||||
|
||||
#define IDirect3DDevice2_SetRenderTarget(p, a, b) (p)->SetRenderTarget(a, b)
|
||||
#define IDirect3DDevice2_GetRenderTarget(p, a) (p)->GetRenderTarget(a)
|
||||
|
||||
#define IDirect3DDevice2_Begin(p, a, b, c) (p)->Begin(a, b, c)
|
||||
#define IDirect3DDevice2_BeginIndexed(p, a, b, c, d, e) (p)->Begin(a, b, c, d, e)
|
||||
#define IDirect3DDevice2_Vertex(p, a) (p)->Vertex(a)
|
||||
#define IDirect3DDevice2_Index(p, a) (p)->Index(a)
|
||||
#define IDirect3DDevice2_End(p, a) (p)->End(a)
|
||||
|
||||
#define IDirect3DDevice2_GetRenderState(p, a, b) (p)->GetRenderState(a, b)
|
||||
#define IDirect3DDevice2_SetRenderState(p, a, b) (p)->SetRenderState(a, b)
|
||||
#define IDirect3DDevice2_GetLightState(p, a, b) (p)->GetLightState(a, b)
|
||||
#define IDirect3DDevice2_SetLightState(p, a, b) (p)->SetLightState(a, b)
|
||||
#define IDirect3DDevice2_SetTransform(p, a, b) (p)->SetTransform(a, b)
|
||||
#define IDirect3DDevice2_GetTransform(p, a, b) (p)->GetTransform(a, b)
|
||||
#define IDirect3DDevice2_MultiplyTransform(p, a, b) (p)->MultiplyTransform(a, b)
|
||||
|
||||
#define IDirect3DDevice2_DrawPrimitive(p, a, b, c, d, e) (p)->DrawPrimitive(a, b, c, d, e)
|
||||
#define IDirect3DDevice2_DrawIndexedPrimitive(p, a, b, c, d, e, f, g) \
|
||||
(p)->DrawIndexedPrimitive(a, b, c, d, e, f, g)
|
||||
#define IDirect3DDevice2_SetClipStatus(p, a) (p)->SetClipStatus(a)
|
||||
#define IDirect3DDevice2_GetClipStatus(p, a) (p)->GetClipStatus(a)
|
||||
|
||||
#endif
|
||||
|
||||
/*
|
||||
* IDirect3DExecuteBuffer
|
||||
*/
|
||||
#undef INTERFACE
|
||||
#define INTERFACE IDirect3DExecuteBuffer
|
||||
DECLARE_INTERFACE_(IDirect3DExecuteBuffer, IUnknown)
|
||||
{
|
||||
/*** IUnknown methods ***/
|
||||
STDMETHOD(QueryInterface) (THIS_ REFIID riid, LPVOID* ppvObj) PURE;
|
||||
STDMETHOD_(ULONG, AddRef) (THIS) PURE;
|
||||
STDMETHOD_(ULONG, Release) (THIS) PURE;
|
||||
/*** IDirect3DExecuteBuffer methods ***/
|
||||
STDMETHOD(Initialize) (THIS_ LPDIRECT3DDEVICE, LPD3DEXECUTEBUFFERDESC) PURE;
|
||||
STDMETHOD(Lock) (THIS_ LPD3DEXECUTEBUFFERDESC) PURE;
|
||||
STDMETHOD_(HRESULT, Unlock) (THIS) PURE;
|
||||
STDMETHOD(SetExecuteData) (THIS_ LPD3DEXECUTEDATA) PURE;
|
||||
STDMETHOD(GetExecuteData) (THIS_ LPD3DEXECUTEDATA) PURE;
|
||||
STDMETHOD(Validate) (THIS_ LPDWORD, LPD3DVALIDATECALLBACK, LPVOID, DWORD) PURE;
|
||||
STDMETHOD(Optimize) (THIS_ DWORD) PURE;
|
||||
};
|
||||
|
||||
#if !defined(__cplusplus) || defined(CINTERFACE)
|
||||
#define IDirect3DExecuteBuffer_QueryInterface(p, a, b) (p)->lpVtbl->QueryInterface(p, a, b)
|
||||
#define IDirect3DExecuteBuffer_AddRef(p) (p)->lpVtbl->AddRef(p)
|
||||
#define IDirect3DExecuteBuffer_Release(p) (p)->lpVtbl->Release(p)
|
||||
#define IDirect3DExecuteBuffer_Initialize(p, a, b) (p)->lpVtbl->Initialize(p, a, b)
|
||||
#define IDirect3DExecuteBuffer_Lock(p, a) (p)->lpVtbl->Lock(p, a)
|
||||
#define IDirect3DExecuteBuffer_Unlock(p) (p)->lpVtbl->Unlock(p)
|
||||
#define IDirect3DExecuteBuffer_SetExecuteData(p, a) (p)->lpVtbl->SetExecuteData(p, a)
|
||||
#define IDirect3DExecuteBuffer_GetExecuteData(p, a) (p)->lpVtbl->GetExecuteData(p, a)
|
||||
#define IDirect3DExecuteBuffer_Validate(p, a, b, c, d) (p)->lpVtbl->Validate(p, a, b, c, d)
|
||||
#define IDirect3DExecuteBuffer_Optimize(p, a) (p)->lpVtbl->Optimize(p, a)
|
||||
#else
|
||||
#define IDirect3DExecuteBuffer_QueryInterface(p, a, b) (p)->QueryInterface(a, b)
|
||||
#define IDirect3DExecuteBuffer_AddRef(p) (p)->AddRef()
|
||||
#define IDirect3DExecuteBuffer_Release(p) (p)->Release()
|
||||
#define IDirect3DExecuteBuffer_Initialize(p, a, b) (p)->Initialize(a, b)
|
||||
#define IDirect3DExecuteBuffer_Lock(p, a) (p)->Lock(a)
|
||||
#define IDirect3DExecuteBuffer_Unlock(p) (p)->Unlock()
|
||||
#define IDirect3DExecuteBuffer_SetExecuteData(p, a) (p)->SetExecuteData(a)
|
||||
#define IDirect3DExecuteBuffer_GetExecuteData(p, a) (p)->GetExecuteData(a)
|
||||
#define IDirect3DExecuteBuffer_Validate(p, a, b, c, d) (p)->Validate(a, b, c, d)
|
||||
#define IDirect3DExecuteBuffer_Optimize(p, a) (p)->Optimize(a)
|
||||
#endif
|
||||
|
||||
/*
|
||||
* IDirect3DLight
|
||||
*/
|
||||
#undef INTERFACE
|
||||
#define INTERFACE IDirect3DLight
|
||||
DECLARE_INTERFACE_(IDirect3DLight, IUnknown)
|
||||
{
|
||||
/*** IUnknown methods ***/
|
||||
STDMETHOD(QueryInterface) (THIS_ REFIID riid, LPVOID* ppvObj) PURE;
|
||||
STDMETHOD_(ULONG, AddRef) (THIS) PURE;
|
||||
STDMETHOD_(ULONG, Release) (THIS) PURE;
|
||||
/*** IDirect3DLight methods ***/
|
||||
STDMETHOD(Initialize) (THIS_ LPDIRECT3D) PURE;
|
||||
STDMETHOD(SetLight) (THIS_ LPD3DLIGHT) PURE;
|
||||
STDMETHOD(GetLight) (THIS_ LPD3DLIGHT) PURE;
|
||||
};
|
||||
|
||||
#if !defined(__cplusplus) || defined(CINTERFACE)
|
||||
#define IDirect3DLight_QueryInterface(p, a, b) (p)->lpVtbl->QueryInterface(p, a, b)
|
||||
#define IDirect3DLight_AddRef(p) (p)->lpVtbl->AddRef(p)
|
||||
#define IDirect3DLight_Release(p) (p)->lpVtbl->Release(p)
|
||||
#define IDirect3DLight_Initialize(p, a) (p)->lpVtbl->Initialize(p, a)
|
||||
#define IDirect3DLight_SetLight(p, a) (p)->lpVtbl->SetLight(p, a)
|
||||
#define IDirect3DLight_GetLight(p, a) (p)->lpVtbl->GetLight(p, a)
|
||||
#else
|
||||
#define IDirect3DLight_QueryInterface(p, a, b) (p)->QueryInterface(a, b)
|
||||
#define IDirect3DLight_AddRef(p) (p)->AddRef()
|
||||
#define IDirect3DLight_Release(p) (p)->Release()
|
||||
#define IDirect3DLight_Initialize(p, a) (p)->Initialize(a)
|
||||
#define IDirect3DLight_SetLight(p, a) (p)->SetLight(a)
|
||||
#define IDirect3DLight_GetLight(p, a) (p)->GetLight(a)
|
||||
#endif
|
||||
|
||||
/*
|
||||
* IDirect3DMaterial
|
||||
*/
|
||||
#undef INTERFACE
|
||||
#define INTERFACE IDirect3DMaterial
|
||||
DECLARE_INTERFACE_(IDirect3DMaterial, IUnknown)
|
||||
{
|
||||
/*** IUnknown methods ***/
|
||||
STDMETHOD(QueryInterface) (THIS_ REFIID riid, LPVOID* ppvObj) PURE;
|
||||
STDMETHOD_(ULONG, AddRef) (THIS) PURE;
|
||||
STDMETHOD_(ULONG, Release) (THIS) PURE;
|
||||
/*** IDirect3DMaterial methods ***/
|
||||
STDMETHOD(Initialize) (THIS_ LPDIRECT3D) PURE;
|
||||
STDMETHOD(SetMaterial) (THIS_ LPD3DMATERIAL) PURE;
|
||||
STDMETHOD(GetMaterial) (THIS_ LPD3DMATERIAL) PURE;
|
||||
STDMETHOD(GetHandle) (THIS_ LPDIRECT3DDEVICE, LPD3DMATERIALHANDLE) PURE;
|
||||
STDMETHOD_(HRESULT, Reserve) (THIS) PURE;
|
||||
STDMETHOD_(HRESULT, Unreserve) (THIS) PURE;
|
||||
};
|
||||
|
||||
#if !defined(__cplusplus) || defined(CINTERFACE)
|
||||
#define IDirect3DMaterial_QueryInterface(p, a, b) (p)->lpVtbl->QueryInterface(p, a, b)
|
||||
#define IDirect3DMaterial_AddRef(p) (p)->lpVtbl->AddRef(p)
|
||||
#define IDirect3DMaterial_Release(p) (p)->lpVtbl->Release(p)
|
||||
#define IDirect3DMaterial_Initialize(p, a) (p)->lpVtbl->Initialize(p, a)
|
||||
#define IDirect3DMaterial_SetMaterial(p, a) (p)->lpVtbl->SetMaterial(p, a)
|
||||
#define IDirect3DMaterial_GetMaterial(p, a) (p)->lpVtbl->GetMaterial(p, a)
|
||||
#define IDirect3DMaterial_GetHandle(p, a, b) (p)->lpVtbl->GetHandle(p, a, b)
|
||||
#define IDirect3DMaterial_Reserve(p) (p)->lpVtbl->Reserve(p)
|
||||
#define IDirect3DMaterial_Unreserve(p) (p)->lpVtbl->Unreserve(p)
|
||||
#else
|
||||
#define IDirect3DMaterial_QueryInterface(p, a, b) (p)->QueryInterface(a, b)
|
||||
#define IDirect3DMaterial_AddRef(p) (p)->AddRef()
|
||||
#define IDirect3DMaterial_Release(p) (p)->Release()
|
||||
#define IDirect3DMaterial_Initialize(p, a) (p)->Initialize(a)
|
||||
#define IDirect3DMaterial_SetMaterial(p, a) (p)->SetMaterial(a)
|
||||
#define IDirect3DMaterial_GetMaterial(p, a) (p)->GetMaterial(a)
|
||||
#define IDirect3DMaterial_GetHandle(p, a, b) (p)->GetHandle(a, b)
|
||||
#define IDirect3DMaterial_Reserve(p) (p)->Reserve()
|
||||
#define IDirect3DMaterial_Unreserve(p) (p)->Unreserve()
|
||||
#endif
|
||||
|
||||
/*
|
||||
* IDirect3DMaterial2
|
||||
*/
|
||||
#undef INTERFACE
|
||||
#define INTERFACE IDirect3DMaterial2
|
||||
DECLARE_INTERFACE_(IDirect3DMaterial2, IUnknown)
|
||||
{
|
||||
/*** IUnknown methods ***/
|
||||
STDMETHOD(QueryInterface) (THIS_ REFIID riid, LPVOID* ppvObj) PURE;
|
||||
STDMETHOD_(ULONG, AddRef) (THIS) PURE;
|
||||
STDMETHOD_(ULONG, Release) (THIS) PURE;
|
||||
/*** IDirect3DMaterial2 methods ***/
|
||||
STDMETHOD(SetMaterial) (THIS_ LPD3DMATERIAL) PURE;
|
||||
STDMETHOD(GetMaterial) (THIS_ LPD3DMATERIAL) PURE;
|
||||
STDMETHOD(GetHandle) (THIS_ LPDIRECT3DDEVICE2, LPD3DMATERIALHANDLE) PURE;
|
||||
};
|
||||
|
||||
#if !defined(__cplusplus) || defined(CINTERFACE)
|
||||
#define IDirect3DMaterial2_QueryInterface(p, a, b) (p)->lpVtbl->QueryInterface(p, a, b)
|
||||
#define IDirect3DMaterial2_AddRef(p) (p)->lpVtbl->AddRef(p)
|
||||
#define IDirect3DMaterial2_Release(p) (p)->lpVtbl->Release(p)
|
||||
#define IDirect3DMaterial2_SetMaterial(p, a) (p)->lpVtbl->SetMaterial(p, a)
|
||||
#define IDirect3DMaterial2_GetMaterial(p, a) (p)->lpVtbl->GetMaterial(p, a)
|
||||
#define IDirect3DMaterial2_GetHandle(p, a, b) (p)->lpVtbl->GetHandle(p, a, b)
|
||||
#else
|
||||
#define IDirect3DMaterial2_QueryInterface(p, a, b) (p)->QueryInterface(a, b)
|
||||
#define IDirect3DMaterial2_AddRef(p) (p)->AddRef()
|
||||
#define IDirect3DMaterial2_Release(p) (p)->Release()
|
||||
#define IDirect3DMaterial2_SetMaterial(p, a) (p)->SetMaterial(a)
|
||||
#define IDirect3DMaterial2_GetMaterial(p, a) (p)->GetMaterial(a)
|
||||
#define IDirect3DMaterial2_GetHandle(p, a, b) (p)->GetHandle(a, b)
|
||||
#endif
|
||||
|
||||
/*
|
||||
* IDirect3DTexture
|
||||
*/
|
||||
#undef INTERFACE
|
||||
#define INTERFACE IDirect3DTexture
|
||||
DECLARE_INTERFACE_(IDirect3DTexture, IUnknown)
|
||||
{
|
||||
/*** IUnknown methods ***/
|
||||
STDMETHOD(QueryInterface) (THIS_ REFIID riid, LPVOID* ppvObj) PURE;
|
||||
STDMETHOD_(ULONG, AddRef) (THIS) PURE;
|
||||
STDMETHOD_(ULONG, Release) (THIS) PURE;
|
||||
/*** IDirect3DTexture methods ***/
|
||||
STDMETHOD(Initialize) (THIS_ LPDIRECT3DDEVICE, LPDIRECTDRAWSURFACE) PURE;
|
||||
STDMETHOD(GetHandle) (THIS_ LPDIRECT3DDEVICE, LPD3DTEXTUREHANDLE) PURE;
|
||||
STDMETHOD(PaletteChanged) (THIS_ DWORD, DWORD) PURE;
|
||||
STDMETHOD(Load) (THIS_ LPDIRECT3DTEXTURE) PURE;
|
||||
STDMETHOD_(HRESULT, Unload) (THIS) PURE;
|
||||
};
|
||||
|
||||
#if !defined(__cplusplus) || defined(CINTERFACE)
|
||||
#define IDirect3DTexture_QueryInterface(p, a, b) (p)->lpVtbl->QueryInterface(p, a, b)
|
||||
#define IDirect3DTexture_AddRef(p) (p)->lpVtbl->AddRef(p)
|
||||
#define IDirect3DTexture_Release(p) (p)->lpVtbl->Release(p)
|
||||
#define IDirect3DTexture_Initialize(p, a, b) (p)->lpVtbl->Initialize(p, a, b)
|
||||
#define IDirect3DTexture_GetHandle(p, a, b) (p)->lpVtbl->GetHandle(p, a, b)
|
||||
#define IDirect3DTexture_PaletteChanged(p, a, b) (p)->lpVtbl->PaletteChanged(p, a, b)
|
||||
#define IDirect3DTexture_Load(p, a) (p)->lpVtbl->Load(p, a)
|
||||
#define IDirect3DTexture_Unload(p) (p)->lpVtbl->Unload(p)
|
||||
#else
|
||||
#define IDirect3DTexture_QueryInterface(p, a, b) (p)->QueryInterface(a, b)
|
||||
#define IDirect3DTexture_AddRef(p) (p)->AddRef()
|
||||
#define IDirect3DTexture_Release(p) (p)->Release()
|
||||
#define IDirect3DTexture_Initialize(p, a, b) (p)->Initialize(a, b)
|
||||
#define IDirect3DTexture_GetHandle(p, a, b) (p)->GetHandle(a, b)
|
||||
#define IDirect3DTexture_PaletteChanged(p, a, b) (p)->PaletteChanged(a, b)
|
||||
#define IDirect3DTexture_Load(p, a) (p)->Load(a)
|
||||
#define IDirect3DTexture_Unload(p) (p)->Unload()
|
||||
#endif
|
||||
|
||||
/*
|
||||
* IDirect3DTexture2
|
||||
*/
|
||||
#undef INTERFACE
|
||||
#define INTERFACE IDirect3DTexture2
|
||||
DECLARE_INTERFACE_(IDirect3DTexture2, IUnknown)
|
||||
{
|
||||
/*** IUnknown methods ***/
|
||||
STDMETHOD(QueryInterface) (THIS_ REFIID riid, LPVOID* ppvObj) PURE;
|
||||
STDMETHOD_(ULONG, AddRef) (THIS) PURE;
|
||||
STDMETHOD_(ULONG, Release) (THIS) PURE;
|
||||
/*** IDirect3DTexture2 methods ***/
|
||||
STDMETHOD(GetHandle) (THIS_ LPDIRECT3DDEVICE2, LPD3DTEXTUREHANDLE) PURE;
|
||||
STDMETHOD(PaletteChanged) (THIS_ DWORD, DWORD) PURE;
|
||||
STDMETHOD(Load) (THIS_ LPDIRECT3DTEXTURE2) PURE;
|
||||
};
|
||||
|
||||
#if !defined(__cplusplus) || defined(CINTERFACE)
|
||||
#define IDirect3DTexture2_QueryInterface(p, a, b) (p)->lpVtbl->QueryInterface(p, a, b)
|
||||
#define IDirect3DTexture2_AddRef(p) (p)->lpVtbl->AddRef(p)
|
||||
#define IDirect3DTexture2_Release(p) (p)->lpVtbl->Release(p)
|
||||
#define IDirect3DTexture2_GetHandle(p, a, b) (p)->lpVtbl->GetHandle(p, a, b)
|
||||
#define IDirect3DTexture2_PaletteChanged(p, a, b) (p)->lpVtbl->PaletteChanged(p, a, b)
|
||||
#define IDirect3DTexture2_Load(p, a) (p)->lpVtbl->Load(p, a)
|
||||
#else
|
||||
#define IDirect3DTexture2_QueryInterface(p, a, b) (p)->QueryInterface(a, b)
|
||||
#define IDirect3DTexture2_AddRef(p) (p)->AddRef()
|
||||
#define IDirect3DTexture2_Release(p) (p)->Release()
|
||||
#define IDirect3DTexture2_GetHandle(p, a, b) (p)->GetHandle(a, b)
|
||||
#define IDirect3DTexture2_PaletteChanged(p, a, b) (p)->PaletteChanged(a, b)
|
||||
#define IDirect3DTexture2_Load(p, a) (p)->Load(a)
|
||||
#endif
|
||||
|
||||
/*
|
||||
* IDirect3DViewport
|
||||
*/
|
||||
#undef INTERFACE
|
||||
#define INTERFACE IDirect3DViewport
|
||||
DECLARE_INTERFACE_(IDirect3DViewport, IUnknown)
|
||||
{
|
||||
/*** IUnknown methods ***/
|
||||
STDMETHOD(QueryInterface) (THIS_ REFIID riid, LPVOID* ppvObj) PURE;
|
||||
STDMETHOD_(ULONG, AddRef) (THIS) PURE;
|
||||
STDMETHOD_(ULONG, Release) (THIS) PURE;
|
||||
/*** IDirect3DViewport methods ***/
|
||||
STDMETHOD(Initialize) (THIS_ LPDIRECT3D) PURE;
|
||||
STDMETHOD(GetViewport) (THIS_ LPD3DVIEWPORT) PURE;
|
||||
STDMETHOD(SetViewport) (THIS_ LPD3DVIEWPORT) PURE;
|
||||
STDMETHOD(TransformVertices) (THIS_ DWORD, LPD3DTRANSFORMDATA, DWORD, LPDWORD) PURE;
|
||||
STDMETHOD(LightElements) (THIS_ DWORD, LPD3DLIGHTDATA) PURE;
|
||||
STDMETHOD(SetBackground) (THIS_ D3DMATERIALHANDLE) PURE;
|
||||
STDMETHOD(GetBackground) (THIS_ LPD3DMATERIALHANDLE, LPBOOL) PURE;
|
||||
STDMETHOD(SetBackgroundDepth) (THIS_ LPDIRECTDRAWSURFACE) PURE;
|
||||
STDMETHOD(GetBackgroundDepth) (THIS_ LPDIRECTDRAWSURFACE*, LPBOOL) PURE;
|
||||
STDMETHOD(Clear) (THIS_ DWORD, LPD3DRECT, DWORD) PURE;
|
||||
STDMETHOD(AddLight) (THIS_ LPDIRECT3DLIGHT) PURE;
|
||||
STDMETHOD(DeleteLight) (THIS_ LPDIRECT3DLIGHT) PURE;
|
||||
STDMETHOD(NextLight) (THIS_ LPDIRECT3DLIGHT, LPDIRECT3DLIGHT*, DWORD) PURE;
|
||||
};
|
||||
|
||||
#if !defined(__cplusplus) || defined(CINTERFACE)
|
||||
#define IDirect3DViewport_QueryInterface(p, a, b) (p)->lpVtbl->QueryInterface(p, a, b)
|
||||
#define IDirect3DViewport_AddRef(p) (p)->lpVtbl->AddRef(p)
|
||||
#define IDirect3DViewport_Release(p) (p)->lpVtbl->Release(p)
|
||||
#define IDirect3DViewport_Initialize(p, a) (p)->lpVtbl->Initialize(p, a)
|
||||
#define IDirect3DViewport_GetViewport(p, a) (p)->lpVtbl->GetViewport(p, a)
|
||||
#define IDirect3DViewport_SetViewport(p, a) (p)->lpVtbl->SetViewport(p, a)
|
||||
#define IDirect3DViewport_TransformVertices(p, a, b, c, d) (p)->lpVtbl->TransformVertices(p, a, b, c, d)
|
||||
#define IDirect3DViewport_LightElements(p, a, b) (p)->lpVtbl->LightElements(p, a, b)
|
||||
#define IDirect3DViewport_SetBackground(p, a) (p)->lpVtbl->SetBackground(p, a)
|
||||
#define IDirect3DViewport_GetBackground(p, a, b) (p)->lpVtbl->GetBackground(p, a, b)
|
||||
#define IDirect3DViewport_SetBackgroundDepth(p, a) (p)->lpVtbl->SetBackgroundDepth(p, a)
|
||||
#define IDirect3DViewport_GetBackgroundDepth(p, a, b) (p)->lpVtbl->GetBackgroundDepth(p, a, b)
|
||||
#define IDirect3DViewport_Clear(p, a, b, c) (p)->lpVtbl->Clear(p, a, b, c)
|
||||
#define IDirect3DViewport_AddLight(p, a) (p)->lpVtbl->AddLight(p, a)
|
||||
#define IDirect3DViewport_DeleteLight(p, a) (p)->lpVtbl->DeleteLight(p, a)
|
||||
#define IDirect3DViewport_NextLight(p, a, b, c) (p)->lpVtbl->NextLight(p, a, b, c)
|
||||
#else
|
||||
#define IDirect3DViewport_QueryInterface(p, a, b) (p)->QueryInterface(a, b)
|
||||
#define IDirect3DViewport_AddRef(p) (p)->AddRef()
|
||||
#define IDirect3DViewport_Release(p) (p)->Release()
|
||||
#define IDirect3DViewport_Initialize(p, a) (p)->Initialize(a)
|
||||
#define IDirect3DViewport_GetViewport(p, a) (p)->GetViewport(a)
|
||||
#define IDirect3DViewport_SetViewport(p, a) (p)->SetViewport(a)
|
||||
#define IDirect3DViewport_TransformVertices(p, a, b, c, d) (p)->TransformVertices(a, b, c, d)
|
||||
#define IDirect3DViewport_LightElements(p, a, b) (p)->LightElements(a, b)
|
||||
#define IDirect3DViewport_SetBackground(p, a) (p)->SetBackground(a)
|
||||
#define IDirect3DViewport_GetBackground(p, a, b) (p)->GetBackground(a, b)
|
||||
#define IDirect3DViewport_SetBackgroundDepth(p, a) (p)->SetBackgroundDepth(a)
|
||||
#define IDirect3DViewport_GetBackgroundDepth(p, a, b) (p)->GetBackgroundDepth(a, b)
|
||||
#define IDirect3DViewport_Clear(p, a, b, c) (p)->Clear(a, b, c)
|
||||
#define IDirect3DViewport_AddLight(p, a) (p)->AddLight(a)
|
||||
#define IDirect3DViewport_DeleteLight(p, a) (p)->DeleteLight(a)
|
||||
#define IDirect3DViewport_NextLight(p, a, b, c) (p)->NextLight(a, b, c)
|
||||
#endif
|
||||
|
||||
/*
|
||||
* IDirect3DViewport2
|
||||
*/
|
||||
#undef INTERFACE
|
||||
#define INTERFACE IDirect3DViewport2
|
||||
DECLARE_INTERFACE_(IDirect3DViewport2, IDirect3DViewport)
|
||||
{
|
||||
/*** IUnknown methods ***/
|
||||
STDMETHOD(QueryInterface) (THIS_ REFIID riid, LPVOID* ppvObj) PURE;
|
||||
STDMETHOD_(ULONG, AddRef) (THIS) PURE;
|
||||
STDMETHOD_(ULONG, Release) (THIS) PURE;
|
||||
/*** IDirect3DViewport methods ***/
|
||||
STDMETHOD(Initialize) (THIS_ LPDIRECT3D) PURE;
|
||||
STDMETHOD(GetViewport) (THIS_ LPD3DVIEWPORT) PURE;
|
||||
STDMETHOD(SetViewport) (THIS_ LPD3DVIEWPORT) PURE;
|
||||
STDMETHOD(TransformVertices) (THIS_ DWORD, LPD3DTRANSFORMDATA, DWORD, LPDWORD) PURE;
|
||||
STDMETHOD(LightElements) (THIS_ DWORD, LPD3DLIGHTDATA) PURE;
|
||||
STDMETHOD(SetBackground) (THIS_ D3DMATERIALHANDLE) PURE;
|
||||
STDMETHOD(GetBackground) (THIS_ LPD3DMATERIALHANDLE, LPBOOL) PURE;
|
||||
STDMETHOD(SetBackgroundDepth) (THIS_ LPDIRECTDRAWSURFACE) PURE;
|
||||
STDMETHOD(GetBackgroundDepth) (THIS_ LPDIRECTDRAWSURFACE*, LPBOOL) PURE;
|
||||
STDMETHOD(Clear) (THIS_ DWORD, LPD3DRECT, DWORD) PURE;
|
||||
STDMETHOD(AddLight) (THIS_ LPDIRECT3DLIGHT) PURE;
|
||||
STDMETHOD(DeleteLight) (THIS_ LPDIRECT3DLIGHT) PURE;
|
||||
STDMETHOD(NextLight) (THIS_ LPDIRECT3DLIGHT, LPDIRECT3DLIGHT*, DWORD) PURE;
|
||||
/*** IDirect3DViewport2 methods ***/
|
||||
STDMETHOD(GetViewport2) (THIS_ LPD3DVIEWPORT2) PURE;
|
||||
STDMETHOD(SetViewport2) (THIS_ LPD3DVIEWPORT2) PURE;
|
||||
};
|
||||
|
||||
#if !defined(__cplusplus) || defined(CINTERFACE)
|
||||
#define IDirect3DViewport2_QueryInterface(p, a, b) (p)->lpVtbl->QueryInterface(p, a, b)
|
||||
#define IDirect3DViewport2_AddRef(p) (p)->lpVtbl->AddRef(p)
|
||||
#define IDirect3DViewport2_Release(p) (p)->lpVtbl->Release(p)
|
||||
#define IDirect3DViewport2_Initialize(p, a) (p)->lpVtbl->Initialize(p, a)
|
||||
#define IDirect3DViewport2_GetViewport(p, a) (p)->lpVtbl->GetViewport(p, a)
|
||||
#define IDirect3DViewport2_SetViewport(p, a) (p)->lpVtbl->SetViewport(p, a)
|
||||
#define IDirect3DViewport2_TransformVertices(p, a, b, c, d) (p)->lpVtbl->TransformVertices(p, a, b, c, d)
|
||||
#define IDirect3DViewport2_LightElements(p, a, b) (p)->lpVtbl->LightElements(p, a, b)
|
||||
#define IDirect3DViewport2_SetBackground(p, a) (p)->lpVtbl->SetBackground(p, a)
|
||||
#define IDirect3DViewport2_GetBackground(p, a, b) (p)->lpVtbl->GetBackground(p, a, b)
|
||||
#define IDirect3DViewport2_SetBackgroundDepth(p, a) (p)->lpVtbl->SetBackgroundDepth(p, a)
|
||||
#define IDirect3DViewport2_GetBackgroundDepth(p, a, b) (p)->lpVtbl->GetBackgroundDepth(p, a, b)
|
||||
#define IDirect3DViewport2_Clear(p, a, b, c) (p)->lpVtbl->Clear(p, a, b, c)
|
||||
#define IDirect3DViewport2_AddLight(p, a) (p)->lpVtbl->AddLight(p, a)
|
||||
#define IDirect3DViewport2_DeleteLight(p, a) (p)->lpVtbl->DeleteLight(p, a)
|
||||
#define IDirect3DViewport2_NextLight(p, a, b, c) (p)->lpVtbl->NextLight(p, a, b, c)
|
||||
#define IDirect3DViewport2_GetViewport2(p, a) (p)->lpVtbl->GetViewport2(p, a)
|
||||
#define IDirect3DViewport2_SetViewport2(p, a) (p)->lpVtbl->SetViewport2(p, a)
|
||||
#else
|
||||
#define IDirect3DViewport2_QueryInterface(p, a, b) (p)->QueryInterface(a, b)
|
||||
#define IDirect3DViewport2_AddRef(p) (p)->AddRef()
|
||||
#define IDirect3DViewport2_Release(p) (p)->Release()
|
||||
#define IDirect3DViewport2_Initialize(p, a) (p)->Initialize(a)
|
||||
#define IDirect3DViewport2_GetViewport(p, a) (p)->GetViewport(a)
|
||||
#define IDirect3DViewport2_SetViewport(p, a) (p)->SetViewport(a)
|
||||
#define IDirect3DViewport2_TransformVertices(p, a, b, c, d) (p)->TransformVertices(a, b, c, d)
|
||||
#define IDirect3DViewport2_LightElements(p, a, b) (p)->LightElements(a, b)
|
||||
#define IDirect3DViewport2_SetBackground(p, a) (p)->SetBackground(a)
|
||||
#define IDirect3DViewport2_GetBackground(p, a, b) (p)->GetBackground(a, b)
|
||||
#define IDirect3DViewport2_SetBackgroundDepth(p, a) (p)->SetBackgroundDepth(a)
|
||||
#define IDirect3DViewport2_GetBackgroundDepth(p, a, b) (p)->GetBackgroundDepth(a, b)
|
||||
#define IDirect3DViewport2_Clear(p, a, b, c) (p)->Clear(a, b, c)
|
||||
#define IDirect3DViewport2_AddLight(p, a) (p)->AddLight(a)
|
||||
#define IDirect3DViewport2_DeleteLight(p, a) (p)->DeleteLight(a)
|
||||
#define IDirect3DViewport2_NextLight(p, a, b, c) (p)->NextLight(a, b, c)
|
||||
#define IDirect3DViewport2_GetViewport2(p, a) (p)->GetViewport2(a)
|
||||
#define IDirect3DViewport2_SetViewport2(p, a) (p)->SetViewport2(a)
|
||||
#endif
|
||||
|
||||
|
||||
/****************************************************************************
|
||||
*
|
||||
* Flags for IDirect3DDevice::NextViewport
|
||||
*
|
||||
****************************************************************************/
|
||||
|
||||
/*
|
||||
* Return the next viewport
|
||||
*/
|
||||
#define D3DNEXT_NEXT 0x00000001l
|
||||
|
||||
/*
|
||||
* Return the first viewport
|
||||
*/
|
||||
#define D3DNEXT_HEAD 0x00000002l
|
||||
|
||||
/*
|
||||
* Return the last viewport
|
||||
*/
|
||||
#define D3DNEXT_TAIL 0x00000004l
|
||||
|
||||
|
||||
/****************************************************************************
|
||||
*
|
||||
* Flags for DrawPrimitive/DrawIndexedPrimitive
|
||||
* Also valid for Begin/BeginIndexed
|
||||
*
|
||||
****************************************************************************/
|
||||
|
||||
/*
|
||||
* Wait until the device is ready to draw the primitive
|
||||
* This will cause DP to not return DDERR_WASSTILLDRAWING
|
||||
*/
|
||||
#define D3DDP_WAIT 0x00000001l
|
||||
|
||||
|
||||
/*
|
||||
* Hint that the primitives have been clipped by the application.
|
||||
*/
|
||||
#define D3DDP_DONOTCLIP 0x00000004l
|
||||
|
||||
/*
|
||||
* Hint that the extents need not be updated.
|
||||
*/
|
||||
#define D3DDP_DONOTUPDATEEXTENTS 0x00000008l
|
||||
|
||||
/*
|
||||
* Direct3D Errors
|
||||
* DirectDraw error codes are used when errors not specified here.
|
||||
*/
|
||||
#define D3D_OK DD_OK
|
||||
#define D3DERR_BADMAJORVERSION MAKE_DDHRESULT(700)
|
||||
#define D3DERR_BADMINORVERSION MAKE_DDHRESULT(701)
|
||||
|
||||
/*
|
||||
* An invalid device was requested by the application.
|
||||
*/
|
||||
#define D3DERR_INVALID_DEVICE MAKE_DDHRESULT(705)
|
||||
#define D3DERR_INITFAILED MAKE_DDHRESULT(706)
|
||||
|
||||
/*
|
||||
* SetRenderTarget attempted on a device that was
|
||||
* QI'd off the render target.
|
||||
*/
|
||||
#define D3DERR_DEVICEAGGREGATED MAKE_DDHRESULT(707)
|
||||
|
||||
#define D3DERR_EXECUTE_CREATE_FAILED MAKE_DDHRESULT(710)
|
||||
#define D3DERR_EXECUTE_DESTROY_FAILED MAKE_DDHRESULT(711)
|
||||
#define D3DERR_EXECUTE_LOCK_FAILED MAKE_DDHRESULT(712)
|
||||
#define D3DERR_EXECUTE_UNLOCK_FAILED MAKE_DDHRESULT(713)
|
||||
#define D3DERR_EXECUTE_LOCKED MAKE_DDHRESULT(714)
|
||||
#define D3DERR_EXECUTE_NOT_LOCKED MAKE_DDHRESULT(715)
|
||||
|
||||
#define D3DERR_EXECUTE_FAILED MAKE_DDHRESULT(716)
|
||||
#define D3DERR_EXECUTE_CLIPPED_FAILED MAKE_DDHRESULT(717)
|
||||
|
||||
#define D3DERR_TEXTURE_NO_SUPPORT MAKE_DDHRESULT(720)
|
||||
#define D3DERR_TEXTURE_CREATE_FAILED MAKE_DDHRESULT(721)
|
||||
#define D3DERR_TEXTURE_DESTROY_FAILED MAKE_DDHRESULT(722)
|
||||
#define D3DERR_TEXTURE_LOCK_FAILED MAKE_DDHRESULT(723)
|
||||
#define D3DERR_TEXTURE_UNLOCK_FAILED MAKE_DDHRESULT(724)
|
||||
#define D3DERR_TEXTURE_LOAD_FAILED MAKE_DDHRESULT(725)
|
||||
#define D3DERR_TEXTURE_SWAP_FAILED MAKE_DDHRESULT(726)
|
||||
#define D3DERR_TEXTURE_LOCKED MAKE_DDHRESULT(727)
|
||||
#define D3DERR_TEXTURE_NOT_LOCKED MAKE_DDHRESULT(728)
|
||||
#define D3DERR_TEXTURE_GETSURF_FAILED MAKE_DDHRESULT(729)
|
||||
|
||||
#define D3DERR_MATRIX_CREATE_FAILED MAKE_DDHRESULT(730)
|
||||
#define D3DERR_MATRIX_DESTROY_FAILED MAKE_DDHRESULT(731)
|
||||
#define D3DERR_MATRIX_SETDATA_FAILED MAKE_DDHRESULT(732)
|
||||
#define D3DERR_MATRIX_GETDATA_FAILED MAKE_DDHRESULT(733)
|
||||
#define D3DERR_SETVIEWPORTDATA_FAILED MAKE_DDHRESULT(734)
|
||||
|
||||
#define D3DERR_INVALIDCURRENTVIEWPORT MAKE_DDHRESULT(735)
|
||||
#define D3DERR_INVALIDPRIMITIVETYPE MAKE_DDHRESULT(736)
|
||||
#define D3DERR_INVALIDVERTEXTYPE MAKE_DDHRESULT(737)
|
||||
#define D3DERR_TEXTURE_BADSIZE MAKE_DDHRESULT(738)
|
||||
#define D3DERR_INVALIDRAMPTEXTURE MAKE_DDHRESULT(739)
|
||||
|
||||
#define D3DERR_MATERIAL_CREATE_FAILED MAKE_DDHRESULT(740)
|
||||
#define D3DERR_MATERIAL_DESTROY_FAILED MAKE_DDHRESULT(741)
|
||||
#define D3DERR_MATERIAL_SETDATA_FAILED MAKE_DDHRESULT(742)
|
||||
#define D3DERR_MATERIAL_GETDATA_FAILED MAKE_DDHRESULT(743)
|
||||
#define D3DERR_INVALIDPALETTE MAKE_DDHRESULT(744)
|
||||
|
||||
#define D3DERR_ZBUFF_NEEDS_SYSTEMMEMORY MAKE_DDHRESULT(745)
|
||||
#define D3DERR_ZBUFF_NEEDS_VIDEOMEMORY MAKE_DDHRESULT(746)
|
||||
#define D3DERR_SURFACENOTINVIDMEM MAKE_DDHRESULT(747)
|
||||
|
||||
#define D3DERR_LIGHT_SET_FAILED MAKE_DDHRESULT(750)
|
||||
#define D3DERR_LIGHTHASVIEWPORT MAKE_DDHRESULT(751)
|
||||
#define D3DERR_LIGHTNOTINTHISVIEWPORT MAKE_DDHRESULT(752)
|
||||
|
||||
#define D3DERR_SCENE_IN_SCENE MAKE_DDHRESULT(760)
|
||||
#define D3DERR_SCENE_NOT_IN_SCENE MAKE_DDHRESULT(761)
|
||||
#define D3DERR_SCENE_BEGIN_FAILED MAKE_DDHRESULT(762)
|
||||
#define D3DERR_SCENE_END_FAILED MAKE_DDHRESULT(763)
|
||||
|
||||
#define D3DERR_INBEGIN MAKE_DDHRESULT(770)
|
||||
#define D3DERR_NOTINBEGIN MAKE_DDHRESULT(771)
|
||||
#define D3DERR_NOVIEWPORTS MAKE_DDHRESULT(772)
|
||||
#define D3DERR_VIEWPORTDATANOTSET MAKE_DDHRESULT(773)
|
||||
#define D3DERR_VIEWPORTHASNODEVICE MAKE_DDHRESULT(774)
|
||||
#define D3DERR_NOCURRENTVIEWPORT MAKE_DDHRESULT(775)
|
||||
|
||||
#ifdef __cplusplus
|
||||
};
|
||||
#endif
|
||||
|
||||
#endif /* _D3D_H_ */
|
||||
@@ -1,313 +0,0 @@
|
||||
/*==========================================================================;
|
||||
*
|
||||
* Copyright (C) 1995-1997 Microsoft Corporation. All Rights Reserved.
|
||||
*
|
||||
* File: d3dcaps.h
|
||||
* Content: Direct3D capabilities include file
|
||||
*
|
||||
***************************************************************************/
|
||||
|
||||
#ifndef _D3DCAPS_H
|
||||
#define _D3DCAPS_H
|
||||
|
||||
/*
|
||||
* Pull in DirectDraw include file automatically:
|
||||
*/
|
||||
#include "directx/vddraw.h"
|
||||
|
||||
#pragma pack(4)
|
||||
|
||||
/* Description of capabilities of transform */
|
||||
|
||||
typedef struct _D3DTRANSFORMCAPS {
|
||||
DWORD dwSize;
|
||||
DWORD dwCaps;
|
||||
} D3DTRANSFORMCAPS, *LPD3DTRANSFORMCAPS;
|
||||
|
||||
#define D3DTRANSFORMCAPS_CLIP 0x00000001L /* Will clip whilst transforming */
|
||||
|
||||
/* Description of capabilities of lighting */
|
||||
|
||||
typedef struct _D3DLIGHTINGCAPS {
|
||||
DWORD dwSize;
|
||||
DWORD dwCaps; /* Lighting caps */
|
||||
DWORD dwLightingModel; /* Lighting model - RGB or mono */
|
||||
DWORD dwNumLights; /* Number of lights that can be handled */
|
||||
} D3DLIGHTINGCAPS, *LPD3DLIGHTINGCAPS;
|
||||
|
||||
#define D3DLIGHTINGMODEL_RGB 0x00000001L
|
||||
#define D3DLIGHTINGMODEL_MONO 0x00000002L
|
||||
|
||||
#define D3DLIGHTCAPS_POINT 0x00000001L /* Point lights supported */
|
||||
#define D3DLIGHTCAPS_SPOT 0x00000002L /* Spot lights supported */
|
||||
#define D3DLIGHTCAPS_DIRECTIONAL 0x00000004L /* Directional lights supported */
|
||||
#define D3DLIGHTCAPS_PARALLELPOINT 0x00000008L /* Parallel point lights supported */
|
||||
|
||||
/* Description of capabilities for each primitive type */
|
||||
|
||||
typedef struct _D3DPrimCaps {
|
||||
DWORD dwSize;
|
||||
DWORD dwMiscCaps; /* Capability flags */
|
||||
DWORD dwRasterCaps;
|
||||
DWORD dwZCmpCaps;
|
||||
DWORD dwSrcBlendCaps;
|
||||
DWORD dwDestBlendCaps;
|
||||
DWORD dwAlphaCmpCaps;
|
||||
DWORD dwShadeCaps;
|
||||
DWORD dwTextureCaps;
|
||||
DWORD dwTextureFilterCaps;
|
||||
DWORD dwTextureBlendCaps;
|
||||
DWORD dwTextureAddressCaps;
|
||||
DWORD dwStippleWidth; /* maximum width and height of */
|
||||
DWORD dwStippleHeight; /* of supported stipple (up to 32x32) */
|
||||
} D3DPRIMCAPS, *LPD3DPRIMCAPS;
|
||||
|
||||
/* D3DPRIMCAPS dwMiscCaps */
|
||||
|
||||
#define D3DPMISCCAPS_MASKPLANES 0x00000001L
|
||||
#define D3DPMISCCAPS_MASKZ 0x00000002L
|
||||
#define D3DPMISCCAPS_LINEPATTERNREP 0x00000004L
|
||||
#define D3DPMISCCAPS_CONFORMANT 0x00000008L
|
||||
#define D3DPMISCCAPS_CULLNONE 0x00000010L
|
||||
#define D3DPMISCCAPS_CULLCW 0x00000020L
|
||||
#define D3DPMISCCAPS_CULLCCW 0x00000040L
|
||||
|
||||
/* D3DPRIMCAPS dwRasterCaps */
|
||||
|
||||
#define D3DPRASTERCAPS_DITHER 0x00000001L
|
||||
#define D3DPRASTERCAPS_ROP2 0x00000002L
|
||||
#define D3DPRASTERCAPS_XOR 0x00000004L
|
||||
#define D3DPRASTERCAPS_PAT 0x00000008L
|
||||
#define D3DPRASTERCAPS_ZTEST 0x00000010L
|
||||
#define D3DPRASTERCAPS_SUBPIXEL 0x00000020L
|
||||
#define D3DPRASTERCAPS_SUBPIXELX 0x00000040L
|
||||
#define D3DPRASTERCAPS_FOGVERTEX 0x00000080L
|
||||
#define D3DPRASTERCAPS_FOGTABLE 0x00000100L
|
||||
#define D3DPRASTERCAPS_STIPPLE 0x00000200L
|
||||
#define D3DPRASTERCAPS_ANTIALIASSORTDEPENDENT 0x00000400L
|
||||
#define D3DPRASTERCAPS_ANTIALIASSORTINDEPENDENT 0x00000800L
|
||||
#define D3DPRASTERCAPS_ANTIALIASEDGES 0x00001000L
|
||||
#define D3DPRASTERCAPS_MIPMAPLODBIAS 0x00002000L
|
||||
#define D3DPRASTERCAPS_ZBIAS 0x00004000L
|
||||
#define D3DPRASTERCAPS_ZBUFFERLESSHSR 0x00008000L
|
||||
#define D3DPRASTERCAPS_FOGRANGE 0x00010000L
|
||||
#define D3DPRASTERCAPS_ANISOTROPY 0x00020000L
|
||||
|
||||
/* D3DPRIMCAPS dwZCmpCaps, dwAlphaCmpCaps */
|
||||
|
||||
#define D3DPCMPCAPS_NEVER 0x00000001L
|
||||
#define D3DPCMPCAPS_LESS 0x00000002L
|
||||
#define D3DPCMPCAPS_EQUAL 0x00000004L
|
||||
#define D3DPCMPCAPS_LESSEQUAL 0x00000008L
|
||||
#define D3DPCMPCAPS_GREATER 0x00000010L
|
||||
#define D3DPCMPCAPS_NOTEQUAL 0x00000020L
|
||||
#define D3DPCMPCAPS_GREATEREQUAL 0x00000040L
|
||||
#define D3DPCMPCAPS_ALWAYS 0x00000080L
|
||||
|
||||
/* D3DPRIMCAPS dwSourceBlendCaps, dwDestBlendCaps */
|
||||
|
||||
#define D3DPBLENDCAPS_ZERO 0x00000001L
|
||||
#define D3DPBLENDCAPS_ONE 0x00000002L
|
||||
#define D3DPBLENDCAPS_SRCCOLOR 0x00000004L
|
||||
#define D3DPBLENDCAPS_INVSRCCOLOR 0x00000008L
|
||||
#define D3DPBLENDCAPS_SRCALPHA 0x00000010L
|
||||
#define D3DPBLENDCAPS_INVSRCALPHA 0x00000020L
|
||||
#define D3DPBLENDCAPS_DESTALPHA 0x00000040L
|
||||
#define D3DPBLENDCAPS_INVDESTALPHA 0x00000080L
|
||||
#define D3DPBLENDCAPS_DESTCOLOR 0x00000100L
|
||||
#define D3DPBLENDCAPS_INVDESTCOLOR 0x00000200L
|
||||
#define D3DPBLENDCAPS_SRCALPHASAT 0x00000400L
|
||||
#define D3DPBLENDCAPS_BOTHSRCALPHA 0x00000800L
|
||||
#define D3DPBLENDCAPS_BOTHINVSRCALPHA 0x00001000L
|
||||
|
||||
/* D3DPRIMCAPS dwShadeCaps */
|
||||
|
||||
#define D3DPSHADECAPS_COLORFLATMONO 0x00000001L
|
||||
#define D3DPSHADECAPS_COLORFLATRGB 0x00000002L
|
||||
#define D3DPSHADECAPS_COLORGOURAUDMONO 0x00000004L
|
||||
#define D3DPSHADECAPS_COLORGOURAUDRGB 0x00000008L
|
||||
#define D3DPSHADECAPS_COLORPHONGMONO 0x00000010L
|
||||
#define D3DPSHADECAPS_COLORPHONGRGB 0x00000020L
|
||||
|
||||
#define D3DPSHADECAPS_SPECULARFLATMONO 0x00000040L
|
||||
#define D3DPSHADECAPS_SPECULARFLATRGB 0x00000080L
|
||||
#define D3DPSHADECAPS_SPECULARGOURAUDMONO 0x00000100L
|
||||
#define D3DPSHADECAPS_SPECULARGOURAUDRGB 0x00000200L
|
||||
#define D3DPSHADECAPS_SPECULARPHONGMONO 0x00000400L
|
||||
#define D3DPSHADECAPS_SPECULARPHONGRGB 0x00000800L
|
||||
|
||||
#define D3DPSHADECAPS_ALPHAFLATBLEND 0x00001000L
|
||||
#define D3DPSHADECAPS_ALPHAFLATSTIPPLED 0x00002000L
|
||||
#define D3DPSHADECAPS_ALPHAGOURAUDBLEND 0x00004000L
|
||||
#define D3DPSHADECAPS_ALPHAGOURAUDSTIPPLED 0x00008000L
|
||||
#define D3DPSHADECAPS_ALPHAPHONGBLEND 0x00010000L
|
||||
#define D3DPSHADECAPS_ALPHAPHONGSTIPPLED 0x00020000L
|
||||
|
||||
#define D3DPSHADECAPS_FOGFLAT 0x00040000L
|
||||
#define D3DPSHADECAPS_FOGGOURAUD 0x00080000L
|
||||
#define D3DPSHADECAPS_FOGPHONG 0x00100000L
|
||||
|
||||
/* D3DPRIMCAPS dwTextureCaps */
|
||||
|
||||
#define D3DPTEXTURECAPS_PERSPECTIVE 0x00000001L
|
||||
#define D3DPTEXTURECAPS_POW2 0x00000002L
|
||||
#define D3DPTEXTURECAPS_ALPHA 0x00000004L
|
||||
#define D3DPTEXTURECAPS_TRANSPARENCY 0x00000008L
|
||||
#define D3DPTEXTURECAPS_BORDER 0x00000010L
|
||||
#define D3DPTEXTURECAPS_SQUAREONLY 0x00000020L
|
||||
|
||||
/* D3DPRIMCAPS dwTextureFilterCaps */
|
||||
|
||||
#define D3DPTFILTERCAPS_NEAREST 0x00000001L
|
||||
#define D3DPTFILTERCAPS_LINEAR 0x00000002L
|
||||
#define D3DPTFILTERCAPS_MIPNEAREST 0x00000004L
|
||||
#define D3DPTFILTERCAPS_MIPLINEAR 0x00000008L
|
||||
#define D3DPTFILTERCAPS_LINEARMIPNEAREST 0x00000010L
|
||||
#define D3DPTFILTERCAPS_LINEARMIPLINEAR 0x00000020L
|
||||
|
||||
/* D3DPRIMCAPS dwTextureBlendCaps */
|
||||
|
||||
#define D3DPTBLENDCAPS_DECAL 0x00000001L
|
||||
#define D3DPTBLENDCAPS_MODULATE 0x00000002L
|
||||
#define D3DPTBLENDCAPS_DECALALPHA 0x00000004L
|
||||
#define D3DPTBLENDCAPS_MODULATEALPHA 0x00000008L
|
||||
#define D3DPTBLENDCAPS_DECALMASK 0x00000010L
|
||||
#define D3DPTBLENDCAPS_MODULATEMASK 0x00000020L
|
||||
#define D3DPTBLENDCAPS_COPY 0x00000040L
|
||||
#define D3DPTBLENDCAPS_ADD 0x00000080L
|
||||
|
||||
/* D3DPRIMCAPS dwTextureAddressCaps */
|
||||
#define D3DPTADDRESSCAPS_WRAP 0x00000001L
|
||||
#define D3DPTADDRESSCAPS_MIRROR 0x00000002L
|
||||
#define D3DPTADDRESSCAPS_CLAMP 0x00000004L
|
||||
#define D3DPTADDRESSCAPS_BORDER 0x00000008L
|
||||
#define D3DPTADDRESSCAPS_INDEPENDENTUV 0x00000010L
|
||||
|
||||
/*
|
||||
* Description for a device.
|
||||
* This is used to describe a device that is to be created or to query
|
||||
* the current device.
|
||||
*/
|
||||
typedef struct _D3DDeviceDesc {
|
||||
DWORD dwSize; /* Size of D3DDEVICEDESC structure */
|
||||
DWORD dwFlags; /* Indicates which fields have valid data */
|
||||
D3DCOLORMODEL dcmColorModel; /* Color model of device */
|
||||
DWORD dwDevCaps; /* Capabilities of device */
|
||||
D3DTRANSFORMCAPS dtcTransformCaps; /* Capabilities of transform */
|
||||
BOOL bClipping; /* Device can do 3D clipping */
|
||||
D3DLIGHTINGCAPS dlcLightingCaps; /* Capabilities of lighting */
|
||||
D3DPRIMCAPS dpcLineCaps;
|
||||
D3DPRIMCAPS dpcTriCaps;
|
||||
DWORD dwDeviceRenderBitDepth; /* One of DDBB_8, 16, etc.. */
|
||||
DWORD dwDeviceZBufferBitDepth;/* One of DDBD_16, 32, etc.. */
|
||||
DWORD dwMaxBufferSize; /* Maximum execute buffer size */
|
||||
DWORD dwMaxVertexCount; /* Maximum vertex count */
|
||||
// *** New fields for DX5 *** //
|
||||
|
||||
// Width and height caps are 0 for legacy HALs.
|
||||
DWORD dwMinTextureWidth, dwMinTextureHeight;
|
||||
DWORD dwMaxTextureWidth, dwMaxTextureHeight;
|
||||
DWORD dwMinStippleWidth, dwMaxStippleWidth;
|
||||
DWORD dwMinStippleHeight, dwMaxStippleHeight;
|
||||
} D3DDEVICEDESC, *LPD3DDEVICEDESC;
|
||||
|
||||
#define D3DDEVICEDESCSIZE (sizeof(D3DDEVICEDESC))
|
||||
|
||||
typedef HRESULT (FAR PASCAL * LPD3DENUMDEVICESCALLBACK)(LPGUID lpGuid, LPSTR lpDeviceDescription, LPSTR lpDeviceName, LPD3DDEVICEDESC, LPD3DDEVICEDESC, LPVOID);
|
||||
|
||||
/* D3DDEVICEDESC dwFlags indicating valid fields */
|
||||
|
||||
#define D3DDD_COLORMODEL 0x00000001L /* dcmColorModel is valid */
|
||||
#define D3DDD_DEVCAPS 0x00000002L /* dwDevCaps is valid */
|
||||
#define D3DDD_TRANSFORMCAPS 0x00000004L /* dtcTransformCaps is valid */
|
||||
#define D3DDD_LIGHTINGCAPS 0x00000008L /* dlcLightingCaps is valid */
|
||||
#define D3DDD_BCLIPPING 0x00000010L /* bClipping is valid */
|
||||
#define D3DDD_LINECAPS 0x00000020L /* dpcLineCaps is valid */
|
||||
#define D3DDD_TRICAPS 0x00000040L /* dpcTriCaps is valid */
|
||||
#define D3DDD_DEVICERENDERBITDEPTH 0x00000080L /* dwDeviceRenderBitDepth is valid */
|
||||
#define D3DDD_DEVICEZBUFFERBITDEPTH 0x00000100L /* dwDeviceZBufferBitDepth is valid */
|
||||
#define D3DDD_MAXBUFFERSIZE 0x00000200L /* dwMaxBufferSize is valid */
|
||||
#define D3DDD_MAXVERTEXCOUNT 0x00000400L /* dwMaxVertexCount is valid */
|
||||
|
||||
/* D3DDEVICEDESC dwDevCaps flags */
|
||||
|
||||
#define D3DDEVCAPS_FLOATTLVERTEX 0x00000001L /* Device accepts floating point */
|
||||
/* for post-transform vertex data */
|
||||
#define D3DDEVCAPS_SORTINCREASINGZ 0x00000002L /* Device needs data sorted for increasing Z*/
|
||||
#define D3DDEVCAPS_SORTDECREASINGZ 0X00000004L /* Device needs data sorted for decreasing Z*/
|
||||
#define D3DDEVCAPS_SORTEXACT 0x00000008L /* Device needs data sorted exactly */
|
||||
|
||||
#define D3DDEVCAPS_EXECUTESYSTEMMEMORY 0x00000010L /* Device can use execute buffers from system memory */
|
||||
#define D3DDEVCAPS_EXECUTEVIDEOMEMORY 0x00000020L /* Device can use execute buffers from video memory */
|
||||
#define D3DDEVCAPS_TLVERTEXSYSTEMMEMORY 0x00000040L /* Device can use TL buffers from system memory */
|
||||
#define D3DDEVCAPS_TLVERTEXVIDEOMEMORY 0x00000080L /* Device can use TL buffers from video memory */
|
||||
#define D3DDEVCAPS_TEXTURESYSTEMMEMORY 0x00000100L /* Device can texture from system memory */
|
||||
#define D3DDEVCAPS_TEXTUREVIDEOMEMORY 0x00000200L /* Device can texture from device memory */
|
||||
#define D3DDEVCAPS_DRAWPRIMTLVERTEX 0x00000400L /* Device can draw TLVERTEX primitives */
|
||||
#define D3DDEVCAPS_CANRENDERAFTERFLIP 0x00000800L /* Device can render without waiting for flip to complete */
|
||||
#define D3DDEVCAPS_TEXTURENONLOCALVIDMEM 0x00001000L /* Device can texture from nonlocal video memory */
|
||||
|
||||
#define D3DFDS_COLORMODEL 0x00000001L /* Match color model */
|
||||
#define D3DFDS_GUID 0x00000002L /* Match guid */
|
||||
#define D3DFDS_HARDWARE 0x00000004L /* Match hardware/software */
|
||||
#define D3DFDS_TRIANGLES 0x00000008L /* Match in triCaps */
|
||||
#define D3DFDS_LINES 0x00000010L /* Match in lineCaps */
|
||||
#define D3DFDS_MISCCAPS 0x00000020L /* Match primCaps.dwMiscCaps */
|
||||
#define D3DFDS_RASTERCAPS 0x00000040L /* Match primCaps.dwRasterCaps */
|
||||
#define D3DFDS_ZCMPCAPS 0x00000080L /* Match primCaps.dwZCmpCaps */
|
||||
#define D3DFDS_ALPHACMPCAPS 0x00000100L /* Match primCaps.dwAlphaCmpCaps */
|
||||
#define D3DFDS_SRCBLENDCAPS 0x00000200L /* Match primCaps.dwSourceBlendCaps */
|
||||
#define D3DFDS_DSTBLENDCAPS 0x00000400L /* Match primCaps.dwDestBlendCaps */
|
||||
#define D3DFDS_SHADECAPS 0x00000800L /* Match primCaps.dwShadeCaps */
|
||||
#define D3DFDS_TEXTURECAPS 0x00001000L /* Match primCaps.dwTextureCaps */
|
||||
#define D3DFDS_TEXTUREFILTERCAPS 0x00002000L /* Match primCaps.dwTextureFilterCaps */
|
||||
#define D3DFDS_TEXTUREBLENDCAPS 0x00004000L /* Match primCaps.dwTextureBlendCaps */
|
||||
#define D3DFDS_TEXTUREADDRESSCAPS 0x00008000L /* Match primCaps.dwTextureBlendCaps */
|
||||
|
||||
/*
|
||||
* FindDevice arguments
|
||||
*/
|
||||
typedef struct _D3DFINDDEVICESEARCH {
|
||||
DWORD dwSize;
|
||||
DWORD dwFlags;
|
||||
BOOL bHardware;
|
||||
D3DCOLORMODEL dcmColorModel;
|
||||
GUID guid;
|
||||
DWORD dwCaps;
|
||||
D3DPRIMCAPS dpcPrimCaps;
|
||||
} D3DFINDDEVICESEARCH, *LPD3DFINDDEVICESEARCH;
|
||||
|
||||
typedef struct _D3DFINDDEVICERESULT {
|
||||
DWORD dwSize;
|
||||
GUID guid; /* guid which matched */
|
||||
D3DDEVICEDESC ddHwDesc; /* hardware D3DDEVICEDESC */
|
||||
D3DDEVICEDESC ddSwDesc; /* software D3DDEVICEDESC */
|
||||
} D3DFINDDEVICERESULT, *LPD3DFINDDEVICERESULT;
|
||||
|
||||
|
||||
/*
|
||||
* Description of execute buffer.
|
||||
*/
|
||||
typedef struct _D3DExecuteBufferDesc {
|
||||
DWORD dwSize; /* size of this structure */
|
||||
DWORD dwFlags; /* flags indicating which fields are valid */
|
||||
DWORD dwCaps; /* capabilities of execute buffer */
|
||||
DWORD dwBufferSize; /* size of execute buffer data */
|
||||
LPVOID lpData; /* pointer to actual data */
|
||||
} D3DEXECUTEBUFFERDESC, *LPD3DEXECUTEBUFFERDESC;
|
||||
|
||||
/* D3DEXECUTEBUFFER dwFlags indicating valid fields */
|
||||
|
||||
#define D3DDEB_BUFSIZE 0x00000001l /* buffer size valid */
|
||||
#define D3DDEB_CAPS 0x00000002l /* caps valid */
|
||||
#define D3DDEB_LPDATA 0x00000004l /* lpData valid */
|
||||
|
||||
/* D3DEXECUTEBUFFER dwCaps */
|
||||
|
||||
#define D3DDEBCAPS_SYSTEMMEMORY 0x00000001l /* buffer in system memory */
|
||||
#define D3DDEBCAPS_VIDEOMEMORY 0x00000002l /* buffer in device memory */
|
||||
#define D3DDEBCAPS_MEM (D3DDEBCAPS_SYSTEMMEMORY|D3DDEBCAPS_VIDEOMEMORY)
|
||||
|
||||
#pragma pack()
|
||||
|
||||
#endif /* _D3DCAPS_H_ */
|
||||
@@ -1,793 +0,0 @@
|
||||
/*==========================================================================;
|
||||
*
|
||||
* Copyright (C) 1995-1997 Microsoft Corporation. All Rights Reserved.
|
||||
*
|
||||
* File: d3di.h
|
||||
* Content: Direct3D internal include file
|
||||
*@@BEGIN_MSINTERNAL
|
||||
*
|
||||
* $Id: vd3di.h,v 2.2 2002-08-01 01:41:04 penguin Exp $
|
||||
*
|
||||
* History:
|
||||
* Date By Reason
|
||||
* ==== == ======
|
||||
* 05/11/95 stevela Initial rev with this header.
|
||||
* 11/11/95 stevela Light code changed.
|
||||
* 21/11/95 colinmc Made Direct3D aggregatable
|
||||
* (so it can be QI'd off DirectDraw).
|
||||
* 23/11/95 colinmc Made Direct3D textures and devices aggregatable
|
||||
* (QI'd off DirectDrawSurfaces).
|
||||
* 07/12/95 stevela Merged in Colin's changes.
|
||||
* 10/12/95 stevela Removed AGGREGATE_D3D.
|
||||
* Removed Validate macros from here. Now in d3dpr.h
|
||||
* 02/03/96 colinmc Minor build fix
|
||||
* 17/04/96 stevela Use ddraw.h externally and ddrawp.h internally
|
||||
*@@END_MSINTERNAL
|
||||
*
|
||||
***************************************************************************/
|
||||
|
||||
#ifndef _D3DI_H
|
||||
#define _D3DI_H
|
||||
|
||||
//@@BEGIN_MSINTERNAL
|
||||
#include "vddrawp.h"
|
||||
#if 0
|
||||
//@@END_MSINTERNAL
|
||||
#include "directx/vddraw.h"
|
||||
//@@BEGIN_MSINTERNAL
|
||||
#endif
|
||||
//@@END_MSINTERNAL
|
||||
#include "directx/vd3d.h"
|
||||
|
||||
// @@BEGIN_MSINTERNAL
|
||||
#if !defined(BUILD_RLAPI) && !defined(BUILD_DDDDK)
|
||||
#include "vddrawi.h"
|
||||
|
||||
#include "rlreg.h"
|
||||
#include "lists.h"
|
||||
#include "object/object.h"
|
||||
|
||||
|
||||
/*
|
||||
INDEX_BATCH_SCALE is the constant which is used by DrawIndexedPrim
|
||||
to deterimine if the number of primitives being drawn is small
|
||||
relative to the number of vertices being passed. If it is then
|
||||
the prims are dereferenced in batches and sent to DrawPrim.
|
||||
*/
|
||||
#define INDEX_BATCH_SCALE 2
|
||||
|
||||
/*
|
||||
typedef D3DCOLORMODEL D3DCOLORMODEL;
|
||||
|
||||
#define D3DCOLOR_RAMP D3DCOLOR_RAMP
|
||||
#define D3DCOLOR_RGB D3DCOLOR_RGB
|
||||
#define D3D_COLORMODEL D3D_COLORMODEL
|
||||
*/
|
||||
#endif /* !BUILD_RLAPI */
|
||||
// @@END_MSINTERNAL
|
||||
|
||||
typedef DWORD D3DI_BUFFERHANDLE, *LPD3DI_BUFFERHANDLE;
|
||||
|
||||
/*
|
||||
* Internal version of executedata
|
||||
*/
|
||||
typedef struct _D3DI_ExecuteData {
|
||||
DWORD dwSize;
|
||||
D3DI_BUFFERHANDLE dwHandle; /* Handle allocated by driver */
|
||||
DWORD dwVertexOffset;
|
||||
DWORD dwVertexCount;
|
||||
DWORD dwInstructionOffset;
|
||||
DWORD dwInstructionLength;
|
||||
DWORD dwHVertexOffset;
|
||||
D3DSTATUS dsStatus; /* Status after execute */
|
||||
} D3DI_EXECUTEDATA, *LPD3DI_EXECUTEDATA;
|
||||
|
||||
/*
|
||||
* Internal version of lightdata and constants for flags
|
||||
*/
|
||||
|
||||
#define D3DLIGHTI_ATT0_IS_NONZERO (0x00010000)
|
||||
#define D3DLIGHTI_ATT1_IS_NONZERO (0x00020000)
|
||||
#define D3DLIGHTI_ATT2_IS_NONZERO (0x00040000)
|
||||
#define D3DLIGHTI_LINEAR_FALLOFF (0x00080000)
|
||||
#define D3DLIGHTI_UNIT_SCALE (0x00100000)
|
||||
#define D3DLIGHTI_LIGHT_AT_EYE (0x00200000)
|
||||
|
||||
typedef struct _D3DI_LIGHT {
|
||||
D3DLIGHTTYPE type;
|
||||
DWORD version; /* matches number on D3DLIGHT struct */
|
||||
BOOL valid;
|
||||
D3DVALUE red, green, blue, shade;
|
||||
D3DVECTOR position;
|
||||
D3DVECTOR model_position;
|
||||
D3DVECTOR direction;
|
||||
D3DVECTOR model_direction;
|
||||
D3DVECTOR halfway;
|
||||
D3DVECTOR model_eye; /* direction from eye in model space */
|
||||
D3DVECTOR model_scale; /* model scale for proper range computations */
|
||||
D3DVALUE range;
|
||||
D3DVALUE range_squared;
|
||||
D3DVALUE falloff;
|
||||
D3DVALUE attenuation0;
|
||||
D3DVALUE attenuation1;
|
||||
D3DVALUE attenuation2;
|
||||
D3DVALUE cos_theta_by_2;
|
||||
D3DVALUE cos_phi_by_2;
|
||||
DWORD flags;
|
||||
} D3DI_LIGHT, *LPD3DI_LIGHT;
|
||||
|
||||
// @@BEGIN_MSINTERNAL
|
||||
#if !defined(BUILD_RLAPI) && !defined(BUILD_DDDDK)
|
||||
#ifndef BUILD_HEL
|
||||
#ifdef BUILD_D3D_LAYER
|
||||
#include "driver.h"
|
||||
#endif
|
||||
|
||||
typedef struct IUnknownVtbl D3DUNKNOWNCALLBACKS, *LPD3DUNKNOWNCALLBACKS;
|
||||
typedef struct ID3DObjectVtbl D3DOBJECTVTBL, *LPD3DOBJECTVTBL;
|
||||
typedef struct IDirect3DVtbl DIRECT3DCALLBACKS, *LPDIRECT3DCALLBACKS;
|
||||
typedef struct IDirect3D2Vtbl DIRECT3D2CALLBACKS, *LPDIRECT3D2CALLBACKS;
|
||||
typedef struct IDirect3DDeviceVtbl DIRECT3DDEVICECALLBACKS, *LPDIRECT3DDEVICECALLBACKS;
|
||||
typedef struct IDirect3DDevice2Vtbl DIRECT3DDEVICE2CALLBACKS, *LPDIRECT3DDEVICE2CALLBACKS;
|
||||
typedef struct IDirect3DExecuteBufferVtbl DIRECT3DEXECUTEBUFFERCALLBACKS, *LPDIRECT3DEXECUTEBUFFERCALLBACKS;
|
||||
typedef struct IDirect3DLightVtbl DIRECT3DLIGHTCALLBACKS, *LPDIRECT3DLIGHTCALLBACKS;
|
||||
typedef struct IDirect3DMaterialVtbl DIRECT3DMATERIALCALLBACKS, *LPDIRECT3DMATERIALCALLBACKS;
|
||||
typedef struct IDirect3DMaterial2Vtbl DIRECT3DMATERIAL2CALLBACKS, *LPDIRECT3DMATERIAL2CALLBACKS;
|
||||
typedef struct IDirect3DTextureVtbl DIRECT3DTEXTURECALLBACKS, *LPDIRECT3DTEXTURECALLBACKS;
|
||||
typedef struct IDirect3DTexture2Vtbl DIRECT3DTEXTURE2CALLBACKS, *LPDIRECT3DTEXTURE2CALLBACKS;
|
||||
typedef struct IDirect3DViewport2Vtbl DIRECT3DVIEWPORT2CALLBACKS, *LPDIRECT3DVIEWPORT2CALLBACKS;
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
typedef struct _DIRECT3DI *LPDIRECT3DI;
|
||||
typedef struct _DIRECT3DDEVICEI *LPDIRECT3DDEVICEI;
|
||||
typedef struct _DIRECT3DEXECUTEBUFFERI *LPDIRECT3DEXECUTEBUFFERI;
|
||||
typedef struct _DIRECT3DLIGHTI *LPDIRECT3DLIGHTI;
|
||||
typedef struct _DIRECT3DMATERIALI *LPDIRECT3DMATERIALI;
|
||||
typedef struct _DIRECT3DTEXTUREI *LPDIRECT3DTEXTUREI;
|
||||
typedef struct _DIRECT3DVIEWPORTI *LPDIRECT3DVIEWPORTI;
|
||||
|
||||
/*
|
||||
* If we have an aggregate Direct3D we need a structure to
|
||||
* represent an interface distinct from the underlying
|
||||
* object. This is that structure. None of this would be necessary
|
||||
* in C++
|
||||
*/
|
||||
typedef struct _DIRECT3DUNKNOWNI
|
||||
{
|
||||
LPD3DUNKNOWNCALLBACKS lpVtbl;
|
||||
LPDIRECT3DI lpObj;
|
||||
} DIRECT3DUNKNOWNI;
|
||||
typedef struct _DIRECT3DUNKNOWNI *LPDIRECT3DUNKNOWNI;
|
||||
|
||||
typedef struct _DIRECT3DOLDI
|
||||
{
|
||||
LPDIRECT3DCALLBACKS lpVtbl;
|
||||
LPDIRECT3DI lpObj;
|
||||
} DIRECT3DOLDI;
|
||||
typedef struct _DIRECT3DOLDI *LPDIRECT3DOLDI;
|
||||
|
||||
/*
|
||||
* Internal version of Direct3D object; it has data after the vtable
|
||||
*/
|
||||
typedef struct _DIRECT3DI
|
||||
{
|
||||
/*** Object Interface ***/
|
||||
LPDIRECT3D2CALLBACKS lpVtbl; /* Pointer to callbacks */
|
||||
int refCnt; /* Reference count object */
|
||||
|
||||
/*** Object Relations ***/
|
||||
/* Devices */
|
||||
int numDevs;/* Number of devices */
|
||||
LIST_ROOT(_devices, _DIRECT3DDEVICEI) devices;
|
||||
/* Associated IDirect3DDevices */
|
||||
|
||||
/* Viewports */
|
||||
int numViewports; /* Number of viewports */
|
||||
LIST_ROOT(_viewports, _DIRECT3DVIEWPORTI) viewports;
|
||||
/* Created IDirect3DViewports */
|
||||
|
||||
/* Lights */
|
||||
int numLights; /* Number of lights */
|
||||
LIST_ROOT(_lights, _DIRECT3DLIGHTI) lights;
|
||||
/* Created IDirect3DLights */
|
||||
|
||||
/* Materials */
|
||||
int numMaterials; /* Number of materials */
|
||||
LIST_ROOT(_materials, _DIRECT3DMATERIALI) materials;
|
||||
/* Created IDirect3DMaterials */
|
||||
|
||||
/*** Object Data ***/
|
||||
unsigned long v_next; /* id of next viewport to be created */
|
||||
RLDDIRegistry* lpReg; /* Registry */
|
||||
|
||||
/*
|
||||
* DirectDraw Interface
|
||||
*/
|
||||
LPDDRAWI_DIRECTDRAW_INT lpDDInt;
|
||||
|
||||
/*
|
||||
* The special IUnknown interface for the aggregate that does
|
||||
* not punt to the parent object.
|
||||
*/
|
||||
LPUNKNOWN lpOwningIUnknown; /* The owning IUnknown */
|
||||
DIRECT3DUNKNOWNI lpThisIUnknown; /* Our IUnknown interface */
|
||||
DIRECT3DOLDI lpThisIDirect3D; /* Our IDirect3D interface */
|
||||
|
||||
DWORD dwVersion; /* 1 for legacy D3D, 2 for D3D2 */
|
||||
} DIRECT3DI;
|
||||
|
||||
/*
|
||||
* If we have an aggreate Direct3DDevice we need a structure to
|
||||
* represent an interface distinct from the underlying
|
||||
* object. This is that structure.
|
||||
*/
|
||||
typedef struct _DIRECT3DDEVICEUNKNOWNI
|
||||
{
|
||||
LPDIRECT3DDEVICE2CALLBACKS lpVtbl;
|
||||
LPDIRECT3DDEVICEI lpObj;
|
||||
} DIRECT3DDEVICEUNKNOWNI;
|
||||
typedef struct _DIRECT3DDEVICEUNKNOWNI *LPDIRECT3DDEVICEUNKNOWNI;
|
||||
|
||||
typedef struct _DIRECT3DDEVICEOLDI
|
||||
{
|
||||
LPDIRECT3DDEVICECALLBACKS lpVtbl;
|
||||
LPDIRECT3DDEVICEI lpObj;
|
||||
} DIRECT3DDEVICEOLDI;
|
||||
typedef struct _DIRECT3DDEVICEOLDI *LPDIRECT3DDEVICEOLDI;
|
||||
|
||||
/*
|
||||
* Internal version of Direct3DDevice object; it has data after the vtable
|
||||
*/
|
||||
|
||||
#include "vd3dhal.h"
|
||||
|
||||
typedef RLDDIDriver* (*RLDDIDDrawCreateDriverFn)(
|
||||
LPDDRAWI_DIRECTDRAW_INT lpDDInt,
|
||||
LPDIRECTDRAWSURFACE lpDDS,
|
||||
LPDIRECTDRAWSURFACE lpZ,
|
||||
LPDIRECTDRAWPALETTE lpPal,
|
||||
LPDIRECT3DDEVICEI);
|
||||
|
||||
typedef HRESULT (*RLDDIGetCapsFn)(LPD3DDEVICEDESC*, LPD3DDEVICEDESC*);
|
||||
typedef void (*RLDDIInitFn)(RLDDIMallocFn, RLDDIReallocFn, RLDDIFreeFn, RLDDIRaiseFn, RLDDIValue**, int, int);
|
||||
typedef void (*RLDDIPushDriverFn)(RLDDIDriverStack*, RLDDIDriver*);
|
||||
typedef void (*RLDDIPopDriverFn)(RLDDIDriverStack*);
|
||||
|
||||
struct _RLDDIGenRasDriver;
|
||||
typedef struct _RLDDIGenRasDriver* LPRLDDIGENRASDRIVER;
|
||||
struct _RLDDIDDrawDriver;
|
||||
typedef struct _RLDDIDDrawDriver* LPRLDDIDDRAWDRIVER;
|
||||
|
||||
struct _RLDDITransformDriver;
|
||||
typedef struct _RLDDITransformDriver* LPRLDDITRANSFORMDRIVER;
|
||||
|
||||
typedef HRESULT (*PFNLOCKTEXTURE)(LPRLDDIGENRASDRIVER driver);
|
||||
typedef void (*PFNUNLOCKTEXTURE)(LPRLDDIGENRASDRIVER driver);
|
||||
typedef int (*PFNSETFILLPARAMS)(LPRLDDIGENRASDRIVER driver, D3DSTATE* in_params,
|
||||
int count);
|
||||
typedef HRESULT (*PFNREALLOCALIGNED)(void** p_inout, size_t size);
|
||||
typedef HRESULT (*PFNMALLOCALIGNED)(void** p_inout, size_t size);
|
||||
typedef HRESULT (*PFNFREEALIGNED)(void* p_inout);
|
||||
typedef HRESULT (*PFNDRVSETRENDERTARGET)(LPDIRECTDRAWSURFACE, LPDIRECTDRAWSURFACE,
|
||||
LPDIRECTDRAWPALETTE, LPDIRECT3DDEVICEI);
|
||||
typedef HRESULT (*PFNDOFLUSHBEGINEND)(LPDIRECT3DDEVICE2, DWORD);
|
||||
typedef HRESULT (*PFNDRAWPRIMITIVES)(LPDIRECT3DDEVICEI, LPD3DTLVERTEX, LPVOID, LPD3DINSTRUCTION, DWORD);
|
||||
|
||||
|
||||
typedef struct _D3DI_TEXTUREBLOCK
|
||||
{
|
||||
LIST_MEMBER(_D3DI_TEXTUREBLOCK) list;
|
||||
/* Next block in IDirect3DTexture */
|
||||
LIST_MEMBER(_D3DI_TEXTUREBLOCK) devList;
|
||||
/* Next block in IDirect3DDevice */
|
||||
LPDIRECT3DDEVICEI lpD3DDeviceI;
|
||||
LPDIRECT3DTEXTUREI lpD3DTextureI;
|
||||
D3DTEXTUREHANDLE hTex;
|
||||
/* texture handle */
|
||||
} D3DI_TEXTUREBLOCK;
|
||||
typedef struct _D3DI_TEXTUREBLOCK *LPD3DI_TEXTUREBLOCK;
|
||||
|
||||
typedef struct _D3DI_MATERIALBLOCK
|
||||
{
|
||||
LIST_MEMBER(_D3DI_MATERIALBLOCK) list;
|
||||
/* Next block in IDirect3DMaterial */
|
||||
LIST_MEMBER(_D3DI_MATERIALBLOCK) devList;
|
||||
/* Next block in IDirect3DDevice */
|
||||
LPDIRECT3DDEVICEI lpD3DDeviceI;
|
||||
LPDIRECT3DMATERIALI lpD3DMaterialI;
|
||||
D3DMATERIALHANDLE hMat;
|
||||
/* material handle */
|
||||
} D3DI_MATERIALBLOCK;
|
||||
typedef struct _D3DI_MATERIALBLOCK *LPD3DI_MATERIALBLOCK;
|
||||
|
||||
#define D3D_RSTATEBUF_SIZE 128
|
||||
#define D3D_MAX_RSTATES 96 /* Last render state ID + 1 */
|
||||
#define D3D_MAX_MMX_VERTICES 1024
|
||||
|
||||
extern DWORD dwD3DTriBatchSize, dwTriBatchSize, dwLineBatchSize;
|
||||
extern DWORD dwHWBufferSize, dwHWMaxTris;
|
||||
extern DWORD dwHWFewVertices;
|
||||
|
||||
typedef struct _D3DHAL_DRAWPRIMCOUNTS *LPD3DHAL_DRAWPRIMCOUNTS;
|
||||
|
||||
// Legacy HAL batching is done with these structs.
|
||||
typedef struct _D3DI_HWCOUNTS {
|
||||
WORD wNumStateChanges; // Number of state changes batched
|
||||
WORD wNumVertices; // Number of vertices in tri list
|
||||
WORD wNumTriangles; // Number of triangles in tri list
|
||||
} D3DI_HWCOUNTS, *LPD3DI_HWCOUNTS;
|
||||
|
||||
typedef struct _DIRECT3DDEVICEI
|
||||
{
|
||||
/*** Object Interface ***/
|
||||
LPDIRECT3DDEVICE2CALLBACKS lpVtbl; /* Pointer to callbacks */
|
||||
int refCnt; /* Reference count */
|
||||
|
||||
/*** Object Relations ***/
|
||||
LPDIRECT3DI lpDirect3DI; /* parent */
|
||||
LIST_MEMBER(_DIRECT3DDEVICEI)list; /* Next device IDirect3D */
|
||||
|
||||
/* Textures */
|
||||
LIST_ROOT(_textures, _D3DI_TEXTUREBLOCK) texBlocks;
|
||||
/* Ref to created IDirect3DTextures */
|
||||
|
||||
/* Execute buffers */
|
||||
LIST_ROOT(_buffers, _DIRECT3DEXECUTEBUFFERI) buffers;
|
||||
/* Created IDirect3DExecuteBuffers */
|
||||
|
||||
/* Viewports */
|
||||
int numViewports;
|
||||
CIRCLE_QUEUE_ROOT(_dviewports, _DIRECT3DVIEWPORTI) viewports;
|
||||
/* Associated IDirect3DViewports */
|
||||
LPDIRECT3DVIEWPORT2 lpCurrentViewport;
|
||||
|
||||
/* Materials */
|
||||
LIST_ROOT(_dmmaterials, _D3DI_MATERIALBLOCK) matBlocks;
|
||||
/* Ref to associated IDirect3DMaterials */
|
||||
|
||||
/*** Object Data ***/
|
||||
/* Private interfaces */
|
||||
LPD3DOBJECTVTBL lpClassVtbl; /* Private Vtbl */
|
||||
LPD3DOBJECTVTBL lpObjVtbl; /* Private Vtbl */
|
||||
|
||||
LPD3DHAL_CALLBACKS lpD3DHALCallbacks; /* HW specific */
|
||||
LPD3DHAL_GLOBALDRIVERDATA lpD3DHALGlobalDriverData; /* HW specific */
|
||||
|
||||
/* Viewports */
|
||||
unsigned long v_id; /* ID of last viewport rendered */
|
||||
|
||||
/* Lights */
|
||||
int numLights;
|
||||
/* This indicates the maximum number
|
||||
of lights that have been set in
|
||||
the device. */
|
||||
|
||||
/* Device characteristics */
|
||||
int age;
|
||||
int width;
|
||||
int height;
|
||||
int depth;
|
||||
unsigned long red_mask, green_mask, blue_mask;
|
||||
|
||||
int dither;
|
||||
int ramp_size; /* SW specific */
|
||||
D3DCOLORMODEL color_model;
|
||||
int wireframe_options;
|
||||
D3DTEXTUREFILTER texture_quality;
|
||||
D3DVALUE gamma;
|
||||
unsigned char gamma_table[256];
|
||||
int aspectx, aspecty;
|
||||
D3DVALUE perspective_tolerance;
|
||||
|
||||
/* Library information */
|
||||
#ifdef _WIN32
|
||||
HINSTANCE hDrvDll;
|
||||
char dllname[MAXPATH];
|
||||
char base[256];
|
||||
#endif
|
||||
#ifdef SHLIB
|
||||
void* so;
|
||||
#endif
|
||||
|
||||
/* Are we in a scene? */
|
||||
BOOL bInScene;
|
||||
|
||||
/* Our Device type */
|
||||
GUID guid;
|
||||
|
||||
/* GetCaps function from the library */
|
||||
RLDDIGetCapsFn GetCapsFn;
|
||||
|
||||
/* Functions required to build driver */
|
||||
RLDDIInitFn RLDDIInit;
|
||||
RLDDIPushDriverFn RLDDIPushDriver;
|
||||
RLDDIPopDriverFn RLDDIPopDriver;
|
||||
RLDDIDDrawCreateDriverFn RLDDIDDrawCreateDriver;
|
||||
|
||||
/* Device description */
|
||||
D3DDEVICEDESC d3dHWDevDesc;
|
||||
D3DDEVICEDESC d3dHELDevDesc;
|
||||
|
||||
/* Driver stack */
|
||||
RLDDIDriverStack* stack;
|
||||
|
||||
/*
|
||||
* The special IUnknown interface for the aggregate that does
|
||||
* not punt to the parent object.
|
||||
*/
|
||||
LPUNKNOWN lpOwningIUnknown; /* The owning IUnknown */
|
||||
DIRECT3DDEVICEUNKNOWNI lpThisIUnknown; /* Our IUnknown interface */
|
||||
DIRECT3DDEVICEOLDI lpThisID3DDev; /* Our IDirect3DDevice interface */
|
||||
|
||||
LPD3DHAL_CALLBACKS2 lpD3DHALCallbacks2; /* HW specific */
|
||||
|
||||
/*
|
||||
* Renderstate cache for DrawPrimitive
|
||||
*/
|
||||
WORD wRStateBufLevel;
|
||||
D3DSTATE renStateBuf[D3D_RSTATEBUF_SIZE];
|
||||
|
||||
/* Pointers to drivers used by DrawPrimitive */
|
||||
LPRLDDIGENRASDRIVER rasDriver; /* SW specific */
|
||||
LPRLDDITRANSFORMDRIVER xfmDriver; /* Assumed to be NULL for HW */
|
||||
LPRLDDIDDRAWDRIVER drawDriver; /* Assumed to be NULL for HW */
|
||||
|
||||
/*
|
||||
* Pointers to functions used by DrawPrim&Begin/End
|
||||
*/
|
||||
|
||||
PFNLOCKTEXTURE pfnLockTexture; /* SW specific */
|
||||
PFNUNLOCKTEXTURE pfnUnlockTexture; /* SW specific */
|
||||
PFNSETFILLPARAMS pfnSetFillParams; /* SW specific */
|
||||
PFNREALLOCALIGNED pfnReallocAligned; /* SW specific */
|
||||
PFNDRVSETRENDERTARGET pfnDrvSetRenderTarget; /* SW specific */
|
||||
HRESULT (*pfnFlushStates)(struct _DIRECT3DDEVICEI*);
|
||||
PFNDOFLUSHBEGINEND pfnDoFlushBeginEnd;
|
||||
PFNDRAWPRIMITIVES pfnDrawPrimitives;
|
||||
|
||||
/* Are we between Begin/End? */
|
||||
BOOL bInBegin;
|
||||
D3DVERTEXTYPE vtVertexType;
|
||||
D3DPRIMITIVETYPE ptPrimitiveType;
|
||||
CRITICAL_SECTION BeginEndCSect;
|
||||
|
||||
// max number of vertices
|
||||
#define BEGIN_DATA_BLOCK_SIZE 256
|
||||
|
||||
LPVOID lpvVertexBatch;
|
||||
WORD *lpIndexBatch;
|
||||
|
||||
// lpvVertexData is non-NULL if we are InBegin and indexed.
|
||||
LPVOID lpvVertexData;
|
||||
DWORD dwNumVertices;
|
||||
DWORD dwMaxVertexCount; // current number of vertices there is space for
|
||||
WORD *lpVertexIndices;
|
||||
DWORD dwNumIndices;
|
||||
DWORD dwMaxIndexCount; // current number of indices there is space for
|
||||
|
||||
DWORD dwFlags;
|
||||
WORD wFlushed;
|
||||
|
||||
/*
|
||||
* DrawPrimitives batching
|
||||
*/
|
||||
|
||||
|
||||
// Buffer to put DrawPrimitives stuff into
|
||||
// Used for both legacy and DrawPrimitive HALs
|
||||
WORD *lpwDPBuffer;
|
||||
WORD *lpwDPBufferAlloced;
|
||||
|
||||
/* Legacy HALs */
|
||||
// pointer to current prim counts struct
|
||||
LPD3DHAL_DRAWPRIMCOUNTS lpDPPrimCounts;
|
||||
|
||||
// Buffer of counts structures that keep track of the
|
||||
// number of render states and vertices buffered
|
||||
LPD3DI_HWCOUNTS lpHWCounts;
|
||||
|
||||
// Buffer of triangle structures.
|
||||
LPD3DTRIANGLE lpHWTris;
|
||||
|
||||
// Buffer of interleaved render states and primitives.
|
||||
LPD3DTLVERTEX lpHWVertices;
|
||||
|
||||
// Byte offset into lpHWVertices. This gets incremented
|
||||
// by 8 when a render state is batched and by 32*dwNumVertices
|
||||
// when a primitive is batched.
|
||||
DWORD dwHWOffset;
|
||||
|
||||
// Max value of dwHWOffset. Used to decide whether to flush.
|
||||
DWORD dwHWMaxOffset;
|
||||
|
||||
// Index into lpHWTris.
|
||||
DWORD dwHWTriIndex;
|
||||
|
||||
// Number of counts structures used so far. This actually
|
||||
// gives the number of primitives batched and the index of
|
||||
// the counts structure to batch render states into.
|
||||
DWORD dwHWNumCounts;
|
||||
|
||||
/* DrawPrimitive-aware HALs */
|
||||
|
||||
// Byte offset into buffer (we are currently
|
||||
// using the device's wTriIndex)
|
||||
DWORD dwDPOffset;
|
||||
|
||||
// Maximum offset. If dwDPOffset exceeds this, it is
|
||||
// time to flush.
|
||||
DWORD dwDPMaxOffset;
|
||||
|
||||
WORD *wTriIndex;
|
||||
|
||||
// buffers for TL and H vertices
|
||||
LPD3DTLVERTEX lpTLVbuf;
|
||||
LPD3DHVERTEX lpHVbuf;
|
||||
DWORD dwVbufSize;
|
||||
|
||||
LPD3DHAL_D3DEXTENDEDCAPS lpD3DExtendedCaps; /* HW specific */
|
||||
|
||||
} DIRECT3DDEVICEI;
|
||||
|
||||
/*
|
||||
* Internal version of Direct3DExecuteBuffer object;
|
||||
* it has data after the vtable
|
||||
*/
|
||||
typedef struct _DIRECT3DEXECUTEBUFFERI
|
||||
{
|
||||
/*** Object Interface ***/
|
||||
LPDIRECT3DEXECUTEBUFFERCALLBACKS lpVtbl; /* Pointer to callbacks */
|
||||
int refCnt; /* Reference count */
|
||||
|
||||
/*** Object Relations ***/
|
||||
LPDIRECT3DDEVICEI lpD3DDeviceI; /* Parent */
|
||||
LIST_MEMBER(_DIRECT3DEXECUTEBUFFERI)list;
|
||||
/* Next buffer in IDirect3D */
|
||||
|
||||
/*** Object Data ***/
|
||||
DWORD pid; /* Process locking execute buffer */
|
||||
D3DEXECUTEBUFFERDESC debDesc;
|
||||
/* Description of the buffer */
|
||||
D3DEXECUTEDATA exData; /* Execute Data */
|
||||
BOOL locked; /* Is the buffer locked */
|
||||
|
||||
D3DI_BUFFERHANDLE hBuf;
|
||||
/* Execute buffer handle */
|
||||
} DIRECT3DEXECUTEBUFFERI;
|
||||
|
||||
/*
|
||||
* Internal version of Direct3DLight object;
|
||||
* it has data after the vtable
|
||||
*/
|
||||
typedef struct _DIRECT3DLIGHTI
|
||||
{
|
||||
/*** Object Interface ***/
|
||||
LPDIRECT3DLIGHTCALLBACKS lpVtbl; /* Pointer to callbacks */
|
||||
int refCnt; /* Reference count */
|
||||
|
||||
/*** Object Relations ***/
|
||||
LPDIRECT3DI lpDirect3DI; /* Parent */
|
||||
LIST_MEMBER(_DIRECT3DLIGHTI)list;
|
||||
/* Next light in IDirect3D */
|
||||
|
||||
LPDIRECT3DVIEWPORTI lpD3DViewportI; /* Guardian */
|
||||
CIRCLE_QUEUE_MEMBER(_DIRECT3DLIGHTI)light_list;
|
||||
/* Next light in IDirect3DViewport */
|
||||
|
||||
/*** Object Data ***/
|
||||
D3DLIGHT2 dlLight;/* Data describing light */
|
||||
D3DI_LIGHT diLightData;
|
||||
/* Internal representation of light */
|
||||
} DIRECT3DLIGHTI;
|
||||
|
||||
typedef struct _DIRECT3DMATERIALOLDI
|
||||
{
|
||||
LPDIRECT3DMATERIALCALLBACKS lpVtbl;
|
||||
LPDIRECT3DMATERIALI lpObj;
|
||||
} DIRECT3DMATERIALOLDI, *LPDIRECT3DMATERIALOLDI;
|
||||
|
||||
/*
|
||||
* Internal version of Direct3DMaterial object;
|
||||
* it has data after the vtable
|
||||
*/
|
||||
typedef struct _DIRECT3DMATERIALI
|
||||
{
|
||||
/*** Object Interface ***/
|
||||
LPDIRECT3DMATERIAL2CALLBACKS lpVtbl; /* Pointer to callbacks */
|
||||
int refCnt; /* Reference count */
|
||||
|
||||
/*** Object Relations ***/
|
||||
LPDIRECT3DI lpDirect3DI; /* Parent */
|
||||
DIRECT3DMATERIALOLDI lpThisID3DMat; /* Our IDirect3DMaterial interface */
|
||||
LIST_MEMBER(_DIRECT3DMATERIALI)list;
|
||||
/* Next MATERIAL in IDirect3D */
|
||||
|
||||
LIST_ROOT(_mblocks, _D3DI_MATERIALBLOCK)blocks;
|
||||
/* devices we're associated with */
|
||||
|
||||
/*** Object Data ***/
|
||||
D3DMATERIAL dmMaterial; /* Data describing material */
|
||||
BOOL bRes; /* Is this material reserved in the driver */
|
||||
} DIRECT3DMATERIALI;
|
||||
|
||||
/*
|
||||
* If we have an aggreate Direct3DTexture we need a structure
|
||||
* to represent an unknown interface distinct from the underlying
|
||||
* object. This is that structure.
|
||||
*/
|
||||
typedef struct _DIRECT3DTEXTUREUNKNOWNI
|
||||
{
|
||||
LPDIRECT3DTEXTURECALLBACKS lpVtbl;
|
||||
LPDIRECT3DTEXTUREI lpObj;
|
||||
} DIRECT3DTEXTUREUNKNOWNI;
|
||||
typedef struct _DIRECT3DTEXTUREUNKNOWNI *LPDIRECT3DTEXTUREUNKNOWNI;
|
||||
|
||||
typedef struct _DIRECT3DTEXTUREOLDI
|
||||
{
|
||||
LPDIRECT3DTEXTURECALLBACKS lpVtbl;
|
||||
LPDIRECT3DTEXTUREI lpObj;
|
||||
} DIRECT3DTEXTUREOLDI, *LPDIRECT3DTEXTUREOLDI;
|
||||
|
||||
/*
|
||||
* Internal version of Direct3DTexture object; it has data after the vtable
|
||||
*/
|
||||
typedef struct _DIRECT3DTEXTUREI
|
||||
{
|
||||
/*** Object Interface ***/
|
||||
LPDIRECT3DTEXTURE2CALLBACKS lpVtbl; /* Pointer to callbacks */
|
||||
int refCnt; /* Reference count */
|
||||
|
||||
|
||||
/*** Object Relations ***/
|
||||
LIST_ROOT(_blocks, _D3DI_TEXTUREBLOCK) blocks;
|
||||
/* Devices we're associated with */
|
||||
|
||||
/*** Object Data ***/
|
||||
LPDIRECTDRAWSURFACE lpDDS;
|
||||
|
||||
/*
|
||||
* The special IUnknown interface for the aggregate that does
|
||||
* not punt to the parent object.
|
||||
*/
|
||||
LPUNKNOWN lpOwningIUnknown; /* The owning IUnknown */
|
||||
DIRECT3DTEXTUREUNKNOWNI lpThisIUnknown; /* Our IUnknown interface */
|
||||
DIRECT3DTEXTUREOLDI lpThisID3DTex; /* Our IDirect3DTexture interface */
|
||||
BOOL bIsPalettized;
|
||||
|
||||
} DIRECT3DTEXTUREI;
|
||||
|
||||
/*
|
||||
* Internal version of Direct3DViewport object; it has data after the vtable
|
||||
*/
|
||||
typedef struct _DIRECT3DVIEWPORTI
|
||||
{
|
||||
/*** Object Interface ***/
|
||||
LPDIRECT3DVIEWPORT2CALLBACKS lpVtbl; /* Pointer to callbacks */
|
||||
int refCnt; /* Reference count */
|
||||
|
||||
/*** Object Relations */
|
||||
LPDIRECT3DI lpDirect3DI; /* Parent */
|
||||
LIST_MEMBER(_DIRECT3DVIEWPORTI)list;
|
||||
/* Next viewport in IDirect3D */
|
||||
|
||||
LPDIRECT3DDEVICEI lpD3DDeviceI; /* Guardian */
|
||||
CIRCLE_QUEUE_MEMBER(_DIRECT3DVIEWPORTI)vw_list;
|
||||
/* Next viewport in IDirect3DDevice */
|
||||
|
||||
/* Lights */
|
||||
int numLights;
|
||||
CIRCLE_QUEUE_ROOT(_dlights, _DIRECT3DLIGHTI) lights;
|
||||
/* Associated IDirect3DLights */
|
||||
|
||||
/*** Object Data ***/
|
||||
unsigned long v_id; /* Id for this viewport */
|
||||
D3DVIEWPORT2 v_data;
|
||||
BOOL v_data_is_set;
|
||||
|
||||
BOOL have_background;
|
||||
D3DMATERIALHANDLE background;
|
||||
/* Background material */
|
||||
BOOL have_depth;
|
||||
LPDIRECTDRAWSURFACE depth; /* Background depth */
|
||||
|
||||
BOOL bLightsChanged;
|
||||
/* Have the lights changed since they
|
||||
were last collected? */
|
||||
DWORD clrCount; /* Number of rects allocated */
|
||||
LPD3DRECT clrRects; /* Rects used for clearing */
|
||||
} DIRECT3DVIEWPORTI;
|
||||
|
||||
/*
|
||||
* Picking stuff.
|
||||
*/
|
||||
typedef struct _D3DI_PICKDATA {
|
||||
D3DI_EXECUTEDATA* exe;
|
||||
D3DPICKRECORD* records;
|
||||
int pick_count;
|
||||
D3DRECT pick;
|
||||
} D3DI_PICKDATA, *LPD3DI_PICKDATA;
|
||||
|
||||
/*
|
||||
* Direct3D memory allocation
|
||||
*/
|
||||
|
||||
/*
|
||||
* Register a set of functions to be used in place of malloc, realloc
|
||||
* and free for memory allocation. The functions D3DMalloc, D3DRealloc
|
||||
* and D3DFree will use these functions. The default is to use the
|
||||
* ANSI C library routines malloc, realloc and free.
|
||||
*/
|
||||
typedef LPVOID (*D3DMALLOCFUNCTION)(size_t);
|
||||
typedef LPVOID (*D3DREALLOCFUNCTION)(LPVOID, size_t);
|
||||
typedef VOID (*D3DFREEFUNCTION)(LPVOID);
|
||||
|
||||
/*
|
||||
* Allocate size bytes of memory and return a pointer to it in *p_return.
|
||||
* Returns D3DERR_BADALLOC with *p_return unchanged if the allocation fails.
|
||||
*/
|
||||
extern __declspec (dllexport) HRESULT D3DAPI D3DMalloc(LPVOID* p_return, size_t size);
|
||||
|
||||
/*
|
||||
* Change the size of an allocated block of memory. A pointer to the
|
||||
* block is passed in in *p_inout. If *p_inout is NULL then a new
|
||||
* block is allocated. If the reallocation is successful, *p_inout is
|
||||
* changed to point to the new block. If the allocation fails,
|
||||
* *p_inout is unchanged and D3DERR_BADALLOC is returned.
|
||||
*/
|
||||
HRESULT D3DAPI D3DRealloc(LPVOID* p_inout, size_t size);
|
||||
|
||||
/*
|
||||
* Free a block of memory previously allocated with D3DMalloc or
|
||||
* D3DRealloc.
|
||||
*/
|
||||
extern __declspec (dllexport) VOID D3DAPI D3DFree(LPVOID p);
|
||||
|
||||
/*
|
||||
* Used for raising errors from the driver.
|
||||
*/
|
||||
HRESULT D3DAPI D3DRaise(HRESULT);
|
||||
|
||||
/*
|
||||
* Convert RLDDI error codes to D3D error codes
|
||||
*/
|
||||
#define RLDDITOD3DERR(_errcode) (RLDDIToD3DErrors[_errcode])
|
||||
extern HRESULT RLDDIToD3DErrors[];
|
||||
|
||||
/*
|
||||
* maths
|
||||
*/
|
||||
#if 1 /* defined(STACK_CALL) && defined(__WATCOMC__) */
|
||||
D3DVALUE D3DIPow(D3DVALUE, D3DVALUE);
|
||||
#else
|
||||
#define D3DIPow(v,p) DTOVAL(pow(VALTOD(v), VALTOD(p)))
|
||||
#endif
|
||||
|
||||
/*
|
||||
* Light utils
|
||||
*/
|
||||
void D3DI_DeviceMarkLightEnd(LPDIRECT3DDEVICEI, int);
|
||||
void D3DI_UpdateLightInternal(LPDIRECT3DLIGHTI);
|
||||
void D3DI_VectorNormalise12(LPD3DVECTOR v);
|
||||
D3DTEXTUREHANDLE D3DI_FindTextureHandle(LPDIRECT3DTEXTUREI, LPDIRECT3DDEVICEI);
|
||||
void D3DI_SetTextureHandle(LPDIRECT3DTEXTUREI, LPDIRECT3DDEVICEI, D3DTEXTUREHANDLE);
|
||||
void D3DI_RemoveTextureBlock(LPD3DI_TEXTUREBLOCK);
|
||||
void D3DI_RemoveMaterialBlock(LPD3DI_MATERIALBLOCK);
|
||||
|
||||
extern BOOL D3DI_isHALValid(LPD3DHAL_CALLBACKS);
|
||||
|
||||
#ifdef BUILD_D3D_LAYER
|
||||
extern RLDDIValue* RLDDIFInvSqrtTable;
|
||||
#endif
|
||||
|
||||
#ifdef __cplusplus
|
||||
};
|
||||
#endif
|
||||
|
||||
#endif /* BUILD_HEL */
|
||||
#endif /* !BUILD_RLAPI */
|
||||
// @@END_MSINTERNAL
|
||||
|
||||
#endif /* _D3DI_H */
|
||||
@@ -1,229 +0,0 @@
|
||||
/*==========================================================================;
|
||||
*
|
||||
* Copyright (C) 1995-1997 Microsoft Corporation. All Rights Reserved.
|
||||
*
|
||||
* File: d3drm.h
|
||||
* Content: Direct3DRM include file
|
||||
*
|
||||
***************************************************************************/
|
||||
|
||||
#ifndef __D3DRM_H__
|
||||
#define __D3DRM_H__
|
||||
|
||||
#include "directx/vddraw.h"
|
||||
#include "directx/vd3drmobj.h"
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
struct IDirect3DRM;
|
||||
#endif
|
||||
|
||||
|
||||
DEFINE_GUID(IID_IDirect3DRM, 0x2bc49361, 0x8327, 0x11cf, 0xac, 0x4a, 0x0, 0x0, 0xc0, 0x38, 0x25, 0xa1);
|
||||
DEFINE_GUID(IID_IDirect3DRM2, 0x4516ecc8, 0x8f20, 0x11d0, 0x9b, 0x6d, 0x00, 0x00, 0xc0, 0x78, 0x1b, 0xc3);
|
||||
WIN_TYPES(IDirect3DRM, DIRECT3DRM);
|
||||
WIN_TYPES(IDirect3DRM2, DIRECT3DRM2);
|
||||
|
||||
|
||||
/* Create a Direct3DRM API */
|
||||
STDAPI Direct3DRMCreate(LPDIRECT3DRM FAR *lplpDirect3DRM);
|
||||
|
||||
#undef INTERFACE
|
||||
#define INTERFACE IDirect3DRM
|
||||
|
||||
DECLARE_INTERFACE_(IDirect3DRM, IUnknown)
|
||||
{
|
||||
IUNKNOWN_METHODS(PURE);
|
||||
|
||||
STDMETHOD(CreateObject)
|
||||
(THIS_ REFCLSID rclsid, LPUNKNOWN pUnkOuter, REFIID riid, LPVOID FAR* ppv) PURE;
|
||||
STDMETHOD(CreateFrame) (THIS_ LPDIRECT3DRMFRAME, LPDIRECT3DRMFRAME *) PURE;
|
||||
STDMETHOD(CreateMesh) (THIS_ LPDIRECT3DRMMESH *) PURE;
|
||||
STDMETHOD(CreateMeshBuilder)(THIS_ LPDIRECT3DRMMESHBUILDER *) PURE;
|
||||
STDMETHOD(CreateFace) (THIS_ LPDIRECT3DRMFACE *) PURE;
|
||||
STDMETHOD(CreateAnimation) (THIS_ LPDIRECT3DRMANIMATION *) PURE;
|
||||
STDMETHOD(CreateAnimationSet)(THIS_ LPDIRECT3DRMANIMATIONSET *) PURE;
|
||||
STDMETHOD(CreateTexture) (THIS_ LPD3DRMIMAGE, LPDIRECT3DRMTEXTURE *) PURE;
|
||||
STDMETHOD(CreateLight) (THIS_ D3DRMLIGHTTYPE, D3DCOLOR, LPDIRECT3DRMLIGHT *) PURE;
|
||||
STDMETHOD(CreateLightRGB)
|
||||
(THIS_ D3DRMLIGHTTYPE, D3DVALUE, D3DVALUE, D3DVALUE, LPDIRECT3DRMLIGHT *) PURE;
|
||||
STDMETHOD(CreateMaterial) (THIS_ D3DVALUE, LPDIRECT3DRMMATERIAL *) PURE;
|
||||
STDMETHOD(CreateDevice) (THIS_ DWORD, DWORD, LPDIRECT3DRMDEVICE *) PURE;
|
||||
|
||||
/* Create a Windows Device using DirectDraw surfaces */
|
||||
STDMETHOD(CreateDeviceFromSurface)
|
||||
( THIS_ LPGUID lpGUID, LPDIRECTDRAW lpDD,
|
||||
LPDIRECTDRAWSURFACE lpDDSBack, LPDIRECT3DRMDEVICE *
|
||||
) PURE;
|
||||
|
||||
/* Create a Windows Device using D3D objects */
|
||||
STDMETHOD(CreateDeviceFromD3D)
|
||||
( THIS_ LPDIRECT3D lpD3D, LPDIRECT3DDEVICE lpD3DDev,
|
||||
LPDIRECT3DRMDEVICE *
|
||||
) PURE;
|
||||
|
||||
STDMETHOD(CreateDeviceFromClipper)
|
||||
( THIS_ LPDIRECTDRAWCLIPPER lpDDClipper, LPGUID lpGUID,
|
||||
int width, int height, LPDIRECT3DRMDEVICE *) PURE;
|
||||
|
||||
STDMETHOD(CreateTextureFromSurface)(THIS_ LPDIRECTDRAWSURFACE lpDDS, LPDIRECT3DRMTEXTURE *) PURE;
|
||||
|
||||
STDMETHOD(CreateShadow)
|
||||
( THIS_ LPDIRECT3DRMVISUAL, LPDIRECT3DRMLIGHT,
|
||||
D3DVALUE px, D3DVALUE py, D3DVALUE pz,
|
||||
D3DVALUE nx, D3DVALUE ny, D3DVALUE nz,
|
||||
LPDIRECT3DRMVISUAL *
|
||||
) PURE;
|
||||
STDMETHOD(CreateViewport)
|
||||
( THIS_ LPDIRECT3DRMDEVICE, LPDIRECT3DRMFRAME, DWORD, DWORD,
|
||||
DWORD, DWORD, LPDIRECT3DRMVIEWPORT *
|
||||
) PURE;
|
||||
STDMETHOD(CreateWrap)
|
||||
( THIS_ D3DRMWRAPTYPE, LPDIRECT3DRMFRAME,
|
||||
D3DVALUE ox, D3DVALUE oy, D3DVALUE oz,
|
||||
D3DVALUE dx, D3DVALUE dy, D3DVALUE dz,
|
||||
D3DVALUE ux, D3DVALUE uy, D3DVALUE uz,
|
||||
D3DVALUE ou, D3DVALUE ov,
|
||||
D3DVALUE su, D3DVALUE sv,
|
||||
LPDIRECT3DRMWRAP *
|
||||
) PURE;
|
||||
STDMETHOD(CreateUserVisual) (THIS_ D3DRMUSERVISUALCALLBACK, LPVOID lPArg, LPDIRECT3DRMUSERVISUAL *) PURE;
|
||||
STDMETHOD(LoadTexture) (THIS_ const char *, LPDIRECT3DRMTEXTURE *) PURE;
|
||||
STDMETHOD(LoadTextureFromResource) (THIS_ HRSRC rs, LPDIRECT3DRMTEXTURE *) PURE;
|
||||
|
||||
STDMETHOD(SetSearchPath) (THIS_ LPCSTR) PURE;
|
||||
STDMETHOD(AddSearchPath) (THIS_ LPCSTR) PURE;
|
||||
STDMETHOD(GetSearchPath) (THIS_ DWORD *size_return, LPSTR path_return) PURE;
|
||||
STDMETHOD(SetDefaultTextureColors)(THIS_ DWORD) PURE;
|
||||
STDMETHOD(SetDefaultTextureShades)(THIS_ DWORD) PURE;
|
||||
|
||||
STDMETHOD(GetDevices) (THIS_ LPDIRECT3DRMDEVICEARRAY *) PURE;
|
||||
STDMETHOD(GetNamedObject) (THIS_ const char *, LPDIRECT3DRMOBJECT *) PURE;
|
||||
|
||||
STDMETHOD(EnumerateObjects) (THIS_ D3DRMOBJECTCALLBACK, LPVOID) PURE;
|
||||
|
||||
STDMETHOD(Load)
|
||||
( THIS_ LPVOID, LPVOID, LPIID *, DWORD, D3DRMLOADOPTIONS,
|
||||
D3DRMLOADCALLBACK, LPVOID, D3DRMLOADTEXTURECALLBACK, LPVOID,
|
||||
LPDIRECT3DRMFRAME
|
||||
) PURE;
|
||||
STDMETHOD(Tick) (THIS_ D3DVALUE) PURE;
|
||||
};
|
||||
|
||||
#undef INTERFACE
|
||||
#define INTERFACE IDirect3DRM2
|
||||
|
||||
DECLARE_INTERFACE_(IDirect3DRM2, IUnknown)
|
||||
{
|
||||
IUNKNOWN_METHODS(PURE);
|
||||
|
||||
STDMETHOD(CreateObject)
|
||||
(THIS_ REFCLSID rclsid, LPUNKNOWN pUnkOuter, REFIID riid, LPVOID FAR* ppv) PURE;
|
||||
STDMETHOD(CreateFrame) (THIS_ LPDIRECT3DRMFRAME, LPDIRECT3DRMFRAME2 *) PURE;
|
||||
STDMETHOD(CreateMesh) (THIS_ LPDIRECT3DRMMESH *) PURE;
|
||||
STDMETHOD(CreateMeshBuilder)(THIS_ LPDIRECT3DRMMESHBUILDER2 *) PURE;
|
||||
STDMETHOD(CreateFace) (THIS_ LPDIRECT3DRMFACE *) PURE;
|
||||
STDMETHOD(CreateAnimation) (THIS_ LPDIRECT3DRMANIMATION *) PURE;
|
||||
STDMETHOD(CreateAnimationSet)(THIS_ LPDIRECT3DRMANIMATIONSET *) PURE;
|
||||
STDMETHOD(CreateTexture) (THIS_ LPD3DRMIMAGE, LPDIRECT3DRMTEXTURE2 *) PURE;
|
||||
STDMETHOD(CreateLight) (THIS_ D3DRMLIGHTTYPE, D3DCOLOR, LPDIRECT3DRMLIGHT *) PURE;
|
||||
STDMETHOD(CreateLightRGB)
|
||||
(THIS_ D3DRMLIGHTTYPE, D3DVALUE, D3DVALUE, D3DVALUE, LPDIRECT3DRMLIGHT *) PURE;
|
||||
STDMETHOD(CreateMaterial) (THIS_ D3DVALUE, LPDIRECT3DRMMATERIAL *) PURE;
|
||||
STDMETHOD(CreateDevice) (THIS_ DWORD, DWORD, LPDIRECT3DRMDEVICE2 *) PURE;
|
||||
|
||||
/* Create a Windows Device using DirectDraw surfaces */
|
||||
STDMETHOD(CreateDeviceFromSurface)
|
||||
( THIS_ LPGUID lpGUID, LPDIRECTDRAW lpDD,
|
||||
LPDIRECTDRAWSURFACE lpDDSBack, LPDIRECT3DRMDEVICE2 *
|
||||
) PURE;
|
||||
|
||||
/* Create a Windows Device using D3D objects */
|
||||
STDMETHOD(CreateDeviceFromD3D)
|
||||
( THIS_ LPDIRECT3D2 lpD3D, LPDIRECT3DDEVICE2 lpD3DDev,
|
||||
LPDIRECT3DRMDEVICE2 *
|
||||
) PURE;
|
||||
|
||||
STDMETHOD(CreateDeviceFromClipper)
|
||||
( THIS_ LPDIRECTDRAWCLIPPER lpDDClipper, LPGUID lpGUID,
|
||||
int width, int height, LPDIRECT3DRMDEVICE2 *) PURE;
|
||||
|
||||
STDMETHOD(CreateTextureFromSurface)(THIS_ LPDIRECTDRAWSURFACE lpDDS, LPDIRECT3DRMTEXTURE2 *) PURE;
|
||||
|
||||
STDMETHOD(CreateShadow)
|
||||
( THIS_ LPDIRECT3DRMVISUAL, LPDIRECT3DRMLIGHT,
|
||||
D3DVALUE px, D3DVALUE py, D3DVALUE pz,
|
||||
D3DVALUE nx, D3DVALUE ny, D3DVALUE nz,
|
||||
LPDIRECT3DRMVISUAL *
|
||||
) PURE;
|
||||
STDMETHOD(CreateViewport)
|
||||
( THIS_ LPDIRECT3DRMDEVICE, LPDIRECT3DRMFRAME, DWORD, DWORD,
|
||||
DWORD, DWORD, LPDIRECT3DRMVIEWPORT *
|
||||
) PURE;
|
||||
STDMETHOD(CreateWrap)
|
||||
( THIS_ D3DRMWRAPTYPE, LPDIRECT3DRMFRAME,
|
||||
D3DVALUE ox, D3DVALUE oy, D3DVALUE oz,
|
||||
D3DVALUE dx, D3DVALUE dy, D3DVALUE dz,
|
||||
D3DVALUE ux, D3DVALUE uy, D3DVALUE uz,
|
||||
D3DVALUE ou, D3DVALUE ov,
|
||||
D3DVALUE su, D3DVALUE sv,
|
||||
LPDIRECT3DRMWRAP *
|
||||
) PURE;
|
||||
STDMETHOD(CreateUserVisual) (THIS_ D3DRMUSERVISUALCALLBACK, LPVOID lPArg, LPDIRECT3DRMUSERVISUAL *) PURE;
|
||||
STDMETHOD(LoadTexture) (THIS_ const char *, LPDIRECT3DRMTEXTURE2 *) PURE;
|
||||
STDMETHOD(LoadTextureFromResource) (THIS_ HMODULE hModule, LPCTSTR strName, LPCTSTR strType, LPDIRECT3DRMTEXTURE2 *) PURE;
|
||||
|
||||
STDMETHOD(SetSearchPath) (THIS_ LPCSTR) PURE;
|
||||
STDMETHOD(AddSearchPath) (THIS_ LPCSTR) PURE;
|
||||
STDMETHOD(GetSearchPath) (THIS_ DWORD *size_return, LPSTR path_return) PURE;
|
||||
STDMETHOD(SetDefaultTextureColors)(THIS_ DWORD) PURE;
|
||||
STDMETHOD(SetDefaultTextureShades)(THIS_ DWORD) PURE;
|
||||
|
||||
STDMETHOD(GetDevices) (THIS_ LPDIRECT3DRMDEVICEARRAY *) PURE;
|
||||
STDMETHOD(GetNamedObject) (THIS_ const char *, LPDIRECT3DRMOBJECT *) PURE;
|
||||
|
||||
STDMETHOD(EnumerateObjects) (THIS_ D3DRMOBJECTCALLBACK, LPVOID) PURE;
|
||||
|
||||
STDMETHOD(Load)
|
||||
( THIS_ LPVOID, LPVOID, LPIID *, DWORD, D3DRMLOADOPTIONS,
|
||||
D3DRMLOADCALLBACK, LPVOID, D3DRMLOADTEXTURECALLBACK, LPVOID,
|
||||
LPDIRECT3DRMFRAME
|
||||
) PURE;
|
||||
STDMETHOD(Tick) (THIS_ D3DVALUE) PURE;
|
||||
|
||||
STDMETHOD(CreateProgressiveMesh)(THIS_ LPDIRECT3DRMPROGRESSIVEMESH *) PURE;
|
||||
};
|
||||
|
||||
#define D3DRM_OK DD_OK
|
||||
#define D3DRMERR_BADOBJECT MAKE_DDHRESULT(781)
|
||||
#define D3DRMERR_BADTYPE MAKE_DDHRESULT(782)
|
||||
#define D3DRMERR_BADALLOC MAKE_DDHRESULT(783)
|
||||
#define D3DRMERR_FACEUSED MAKE_DDHRESULT(784)
|
||||
#define D3DRMERR_NOTFOUND MAKE_DDHRESULT(785)
|
||||
#define D3DRMERR_NOTDONEYET MAKE_DDHRESULT(786)
|
||||
#define D3DRMERR_FILENOTFOUND MAKE_DDHRESULT(787)
|
||||
#define D3DRMERR_BADFILE MAKE_DDHRESULT(788)
|
||||
#define D3DRMERR_BADDEVICE MAKE_DDHRESULT(789)
|
||||
#define D3DRMERR_BADVALUE MAKE_DDHRESULT(790)
|
||||
#define D3DRMERR_BADMAJORVERSION MAKE_DDHRESULT(791)
|
||||
#define D3DRMERR_BADMINORVERSION MAKE_DDHRESULT(792)
|
||||
#define D3DRMERR_UNABLETOEXECUTE MAKE_DDHRESULT(793)
|
||||
#define D3DRMERR_LIBRARYNOTFOUND MAKE_DDHRESULT(794)
|
||||
#define D3DRMERR_INVALIDLIBRARY MAKE_DDHRESULT(795)
|
||||
#define D3DRMERR_PENDING MAKE_DDHRESULT(796)
|
||||
#define D3DRMERR_NOTENOUGHDATA MAKE_DDHRESULT(797)
|
||||
#define D3DRMERR_REQUESTTOOLARGE MAKE_DDHRESULT(798)
|
||||
#define D3DRMERR_REQUESTTOOSMALL MAKE_DDHRESULT(799)
|
||||
#define D3DRMERR_CONNECTIONLOST MAKE_DDHRESULT(800)
|
||||
#define D3DRMERR_LOADABORTED MAKE_DDHRESULT(801)
|
||||
#define D3DRMERR_NOINTERNET MAKE_DDHRESULT(802)
|
||||
#define D3DRMERR_BADCACHEFILE MAKE_DDHRESULT(803)
|
||||
#define D3DRMERR_BOXNOTSET MAKE_DDHRESULT(804)
|
||||
#define D3DRMERR_BADPMDATA MAKE_DDHRESULT(805)
|
||||
|
||||
#ifdef __cplusplus
|
||||
};
|
||||
#endif
|
||||
|
||||
#endif /* _D3DRMAPI_H_ */
|
||||
|
||||
@@ -1,472 +0,0 @@
|
||||
/*==========================================================================;
|
||||
*
|
||||
* Copyright (C) 1995-1997 Microsoft Corporation. All Rights Reserved.
|
||||
*
|
||||
* File: d3drm.h
|
||||
* Content: Direct3DRM include file
|
||||
*
|
||||
***************************************************************************/
|
||||
|
||||
#ifndef __D3DRMDEFS_H__
|
||||
#define __D3DRMDEFS_H__
|
||||
|
||||
#include <stddef.h>
|
||||
#include "directx/vd3dtypes.h"
|
||||
|
||||
#ifdef _WIN32
|
||||
#define D3DRMAPI __stdcall
|
||||
#else
|
||||
#define D3DRMAPI
|
||||
#endif
|
||||
|
||||
#if defined(__cplusplus)
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
#ifndef TRUE
|
||||
#define FALSE 0
|
||||
#define TRUE 1
|
||||
#endif
|
||||
|
||||
typedef struct _D3DRMVECTOR4D
|
||||
{ D3DVALUE x, y, z, w;
|
||||
} D3DRMVECTOR4D, *LPD3DRMVECTOR4D;
|
||||
|
||||
typedef D3DVALUE D3DRMMATRIX4D[4][4];
|
||||
|
||||
typedef struct _D3DRMQUATERNION
|
||||
{ D3DVALUE s;
|
||||
D3DVECTOR v;
|
||||
} D3DRMQUATERNION, *LPD3DRMQUATERNION;
|
||||
|
||||
typedef struct _D3DRMRAY
|
||||
{ D3DVECTOR dvDir;
|
||||
D3DVECTOR dvPos;
|
||||
} D3DRMRAY, *LPD3DRMRAY;
|
||||
|
||||
typedef struct _D3DRMBOX
|
||||
{ D3DVECTOR min, max;
|
||||
} D3DRMBOX, *LPD3DRMBOX;
|
||||
|
||||
typedef void (*D3DRMWRAPCALLBACK)
|
||||
(LPD3DVECTOR, int* u, int* v, LPD3DVECTOR a, LPD3DVECTOR b, LPVOID);
|
||||
|
||||
typedef enum _D3DRMLIGHTTYPE
|
||||
{ D3DRMLIGHT_AMBIENT,
|
||||
D3DRMLIGHT_POINT,
|
||||
D3DRMLIGHT_SPOT,
|
||||
D3DRMLIGHT_DIRECTIONAL,
|
||||
D3DRMLIGHT_PARALLELPOINT
|
||||
} D3DRMLIGHTTYPE, *LPD3DRMLIGHTTYPE;
|
||||
|
||||
typedef enum _D3DRMSHADEMODE {
|
||||
D3DRMSHADE_FLAT = 0,
|
||||
D3DRMSHADE_GOURAUD = 1,
|
||||
D3DRMSHADE_PHONG = 2,
|
||||
|
||||
D3DRMSHADE_MASK = 7,
|
||||
D3DRMSHADE_MAX = 8
|
||||
} D3DRMSHADEMODE, *LPD3DRMSHADEMODE;
|
||||
|
||||
typedef enum _D3DRMLIGHTMODE {
|
||||
D3DRMLIGHT_OFF = 0 * D3DRMSHADE_MAX,
|
||||
D3DRMLIGHT_ON = 1 * D3DRMSHADE_MAX,
|
||||
|
||||
D3DRMLIGHT_MASK = 7 * D3DRMSHADE_MAX,
|
||||
D3DRMLIGHT_MAX = 8 * D3DRMSHADE_MAX
|
||||
} D3DRMLIGHTMODE, *LPD3DRMLIGHTMODE;
|
||||
|
||||
typedef enum _D3DRMFILLMODE {
|
||||
D3DRMFILL_POINTS = 0 * D3DRMLIGHT_MAX,
|
||||
D3DRMFILL_WIREFRAME = 1 * D3DRMLIGHT_MAX,
|
||||
D3DRMFILL_SOLID = 2 * D3DRMLIGHT_MAX,
|
||||
|
||||
D3DRMFILL_MASK = 7 * D3DRMLIGHT_MAX,
|
||||
D3DRMFILL_MAX = 8 * D3DRMLIGHT_MAX
|
||||
} D3DRMFILLMODE, *LPD3DRMFILLMODE;
|
||||
|
||||
typedef DWORD D3DRMRENDERQUALITY, *LPD3DRMRENDERQUALITY;
|
||||
|
||||
#define D3DRMRENDER_WIREFRAME (D3DRMSHADE_FLAT+D3DRMLIGHT_OFF+D3DRMFILL_WIREFRAME)
|
||||
#define D3DRMRENDER_UNLITFLAT (D3DRMSHADE_FLAT+D3DRMLIGHT_OFF+D3DRMFILL_SOLID)
|
||||
#define D3DRMRENDER_FLAT (D3DRMSHADE_FLAT+D3DRMLIGHT_ON+D3DRMFILL_SOLID)
|
||||
#define D3DRMRENDER_GOURAUD (D3DRMSHADE_GOURAUD+D3DRMLIGHT_ON+D3DRMFILL_SOLID)
|
||||
#define D3DRMRENDER_PHONG (D3DRMSHADE_PHONG+D3DRMLIGHT_ON+D3DRMFILL_SOLID)
|
||||
|
||||
#define D3DRMRENDERMODE_BLENDEDTRANSPARENCY 1
|
||||
#define D3DRMRENDERMODE_SORTEDTRANSPARENCY 2
|
||||
|
||||
typedef enum _D3DRMTEXTUREQUALITY
|
||||
{ D3DRMTEXTURE_NEAREST, /* choose nearest texel */
|
||||
D3DRMTEXTURE_LINEAR, /* interpolate 4 texels */
|
||||
D3DRMTEXTURE_MIPNEAREST, /* nearest texel in nearest mipmap */
|
||||
D3DRMTEXTURE_MIPLINEAR, /* interpolate 2 texels from 2 mipmaps */
|
||||
D3DRMTEXTURE_LINEARMIPNEAREST, /* interpolate 4 texels in nearest mipmap */
|
||||
D3DRMTEXTURE_LINEARMIPLINEAR /* interpolate 8 texels from 2 mipmaps */
|
||||
} D3DRMTEXTUREQUALITY, *LPD3DRMTEXTUREQUALITY;
|
||||
|
||||
typedef enum _D3DRMCOMBINETYPE
|
||||
{ D3DRMCOMBINE_REPLACE,
|
||||
D3DRMCOMBINE_BEFORE,
|
||||
D3DRMCOMBINE_AFTER
|
||||
} D3DRMCOMBINETYPE, *LPD3DRMCOMBINETYPE;
|
||||
|
||||
typedef D3DCOLORMODEL D3DRMCOLORMODEL, *LPD3DRMCOLORMODEL;
|
||||
|
||||
typedef enum _D3DRMPALETTEFLAGS
|
||||
{ D3DRMPALETTE_FREE, /* renderer may use this entry freely */
|
||||
D3DRMPALETTE_READONLY, /* fixed but may be used by renderer */
|
||||
D3DRMPALETTE_RESERVED /* may not be used by renderer */
|
||||
} D3DRMPALETTEFLAGS, *LPD3DRMPALETTEFLAGS;
|
||||
|
||||
typedef struct _D3DRMPALETTEENTRY
|
||||
{ unsigned char red; /* 0 .. 255 */
|
||||
unsigned char green; /* 0 .. 255 */
|
||||
unsigned char blue; /* 0 .. 255 */
|
||||
unsigned char flags; /* one of D3DRMPALETTEFLAGS */
|
||||
} D3DRMPALETTEENTRY, *LPD3DRMPALETTEENTRY;
|
||||
|
||||
typedef struct _D3DRMIMAGE
|
||||
{ int width, height; /* width and height in pixels */
|
||||
int aspectx, aspecty; /* aspect ratio for non-square pixels */
|
||||
int depth; /* bits per pixel */
|
||||
int rgb; /* if false, pixels are indices into a
|
||||
palette otherwise, pixels encode
|
||||
RGB values. */
|
||||
int bytes_per_line; /* number of bytes of memory for a
|
||||
scanline. This must be a multiple
|
||||
of 4. */
|
||||
void* buffer1; /* memory to render into (first buffer). */
|
||||
void* buffer2; /* second rendering buffer for double
|
||||
buffering, set to NULL for single
|
||||
buffering. */
|
||||
unsigned long red_mask;
|
||||
unsigned long green_mask;
|
||||
unsigned long blue_mask;
|
||||
unsigned long alpha_mask; /* if rgb is true, these are masks for
|
||||
the red, green and blue parts of a
|
||||
pixel. Otherwise, these are masks
|
||||
for the significant bits of the
|
||||
red, green and blue elements in the
|
||||
palette. For instance, most SVGA
|
||||
displays use 64 intensities of red,
|
||||
green and blue, so the masks should
|
||||
all be set to 0xfc. */
|
||||
int palette_size; /* number of entries in palette */
|
||||
D3DRMPALETTEENTRY* palette; /* description of the palette (only if
|
||||
rgb is false). Must be (1<<depth)
|
||||
elements. */
|
||||
} D3DRMIMAGE, *LPD3DRMIMAGE;
|
||||
|
||||
typedef enum _D3DRMWRAPTYPE
|
||||
{ D3DRMWRAP_FLAT,
|
||||
D3DRMWRAP_CYLINDER,
|
||||
D3DRMWRAP_SPHERE,
|
||||
D3DRMWRAP_CHROME
|
||||
} D3DRMWRAPTYPE, *LPD3DRMWRAPTYPE;
|
||||
|
||||
#define D3DRMWIREFRAME_CULL 1 /* cull backfaces */
|
||||
#define D3DRMWIREFRAME_HIDDENLINE 2 /* lines are obscured by closer objects */
|
||||
|
||||
typedef enum _D3DRMPROJECTIONTYPE
|
||||
{ D3DRMPROJECT_PERSPECTIVE,
|
||||
D3DRMPROJECT_ORTHOGRAPHIC,
|
||||
D3DRMPROJECT_RIGHTHANDPERSPECTIVE,
|
||||
D3DRMPROJECT_RIGHTHANDORTHOGRAPHIC
|
||||
} D3DRMPROJECTIONTYPE, *LPD3DRMPROJECTIONTYPE;
|
||||
|
||||
typedef enum _D3DRMXOFFORMAT
|
||||
{ D3DRMXOF_BINARY,
|
||||
D3DRMXOF_COMPRESSED,
|
||||
D3DRMXOF_TEXT
|
||||
} D3DRMXOFFORMAT, *LPD3DRMXOFFORMAT;
|
||||
|
||||
typedef DWORD D3DRMSAVEOPTIONS;
|
||||
#define D3DRMXOFSAVE_NORMALS 1
|
||||
#define D3DRMXOFSAVE_TEXTURECOORDINATES 2
|
||||
#define D3DRMXOFSAVE_MATERIALS 4
|
||||
#define D3DRMXOFSAVE_TEXTURENAMES 8
|
||||
#define D3DRMXOFSAVE_ALL 15
|
||||
#define D3DRMXOFSAVE_TEMPLATES 16
|
||||
#define D3DRMXOFSAVE_TEXTURETOPOLOGY 32
|
||||
|
||||
typedef enum _D3DRMCOLORSOURCE
|
||||
{ D3DRMCOLOR_FROMFACE,
|
||||
D3DRMCOLOR_FROMVERTEX
|
||||
} D3DRMCOLORSOURCE, *LPD3DRMCOLORSOURCE;
|
||||
|
||||
typedef enum _D3DRMFRAMECONSTRAINT
|
||||
{ D3DRMCONSTRAIN_Z, /* use only X and Y rotations */
|
||||
D3DRMCONSTRAIN_Y, /* use only X and Z rotations */
|
||||
D3DRMCONSTRAIN_X /* use only Y and Z rotations */
|
||||
} D3DRMFRAMECONSTRAINT, *LPD3DRMFRAMECONSTRAINT;
|
||||
|
||||
typedef enum _D3DRMMATERIALMODE
|
||||
{ D3DRMMATERIAL_FROMMESH,
|
||||
D3DRMMATERIAL_FROMPARENT,
|
||||
D3DRMMATERIAL_FROMFRAME
|
||||
} D3DRMMATERIALMODE, *LPD3DRMMATERIALMODE;
|
||||
|
||||
typedef enum _D3DRMFOGMODE
|
||||
{ D3DRMFOG_LINEAR, /* linear between start and end */
|
||||
D3DRMFOG_EXPONENTIAL, /* density * exp(-distance) */
|
||||
D3DRMFOG_EXPONENTIALSQUARED /* density * exp(-distance*distance) */
|
||||
} D3DRMFOGMODE, *LPD3DRMFOGMODE;
|
||||
|
||||
typedef enum _D3DRMZBUFFERMODE {
|
||||
D3DRMZBUFFER_FROMPARENT, /* default */
|
||||
D3DRMZBUFFER_ENABLE, /* enable zbuffering */
|
||||
D3DRMZBUFFER_DISABLE /* disable zbuffering */
|
||||
} D3DRMZBUFFERMODE, *LPD3DRMZBUFFERMODE;
|
||||
|
||||
typedef enum _D3DRMSORTMODE {
|
||||
D3DRMSORT_FROMPARENT, /* default */
|
||||
D3DRMSORT_NONE, /* don't sort child frames */
|
||||
D3DRMSORT_FRONTTOBACK, /* sort child frames front-to-back */
|
||||
D3DRMSORT_BACKTOFRONT /* sort child frames back-to-front */
|
||||
} D3DRMSORTMODE, *LPD3DRMSORTMODE;
|
||||
|
||||
/*
|
||||
* Values for flags in Frame2::AddMoveCallback.
|
||||
*/
|
||||
#define D3DRMCALLBACK_PREORDER 0
|
||||
#define D3DRMCALLBACK_POSTORDER 1
|
||||
|
||||
/*
|
||||
* Values for flags in MeshBuilder2::RayPick.
|
||||
*/
|
||||
#define D3DRMRAYPICK_ONLYBOUNDINGBOXES 1
|
||||
#define D3DRMRAYPICK_IGNOREFURTHERPRIMITIVES 2
|
||||
#define D3DRMRAYPICK_INTERPOLATEUV 4
|
||||
#define D3DRMRAYPICK_INTERPOLATECOLOR 8
|
||||
#define D3DRMRAYPICK_INTERPOLATENORMAL 0x10
|
||||
|
||||
/*
|
||||
* Values for flags in MeshBuilder2::GenerateNormals.
|
||||
*/
|
||||
#define D3DRMGENERATENORMALS_PRECOMPACT 1
|
||||
#define D3DRMGENERATENORMALS_USECREASEANGLE 2
|
||||
|
||||
typedef DWORD D3DRMANIMATIONOPTIONS;
|
||||
#define D3DRMANIMATION_OPEN 0x01L
|
||||
#define D3DRMANIMATION_CLOSED 0x02L
|
||||
#define D3DRMANIMATION_LINEARPOSITION 0x04L
|
||||
#define D3DRMANIMATION_SPLINEPOSITION 0x08L
|
||||
#define D3DRMANIMATION_SCALEANDROTATION 0x00000010L
|
||||
#define D3DRMANIMATION_POSITION 0x00000020L
|
||||
|
||||
typedef DWORD D3DRMINTERPOLATIONOPTIONS;
|
||||
#define D3DRMINTERPOLATION_OPEN 0x01L
|
||||
#define D3DRMINTERPOLATION_CLOSED 0x02L
|
||||
#define D3DRMINTERPOLATION_NEAREST 0x0100L
|
||||
#define D3DRMINTERPOLATION_LINEAR 0x04L
|
||||
#define D3DRMINTERPOLATION_SPLINE 0x08L
|
||||
#define D3DRMINTERPOLATION_VERTEXCOLOR 0x40L
|
||||
#define D3DRMINTERPOLATION_SLERPNORMALS 0x80L
|
||||
|
||||
typedef DWORD D3DRMLOADOPTIONS;
|
||||
|
||||
#define D3DRMLOAD_FROMFILE 0x00L
|
||||
#define D3DRMLOAD_FROMRESOURCE 0x01L
|
||||
#define D3DRMLOAD_FROMMEMORY 0x02L
|
||||
#define D3DRMLOAD_FROMSTREAM 0x04L
|
||||
#define D3DRMLOAD_FROMURL 0x08L
|
||||
|
||||
#define D3DRMLOAD_BYNAME 0x10L
|
||||
#define D3DRMLOAD_BYPOSITION 0x20L
|
||||
#define D3DRMLOAD_BYGUID 0x40L
|
||||
#define D3DRMLOAD_FIRST 0x80L
|
||||
|
||||
#define D3DRMLOAD_INSTANCEBYREFERENCE 0x100L
|
||||
#define D3DRMLOAD_INSTANCEBYCOPYING 0x200L
|
||||
|
||||
#define D3DRMLOAD_ASYNCHRONOUS 0x400L
|
||||
|
||||
typedef struct _D3DRMLOADRESOURCE {
|
||||
HMODULE hModule;
|
||||
LPCTSTR lpName;
|
||||
LPCTSTR lpType;
|
||||
} D3DRMLOADRESOURCE, *LPD3DRMLOADRESOURCE;
|
||||
|
||||
typedef struct _D3DRMLOADMEMORY {
|
||||
LPVOID lpMemory;
|
||||
DWORD dSize;
|
||||
} D3DRMLOADMEMORY, *LPD3DRMLOADMEMORY;
|
||||
|
||||
#define D3DRMPMESHSTATUS_VALID 0x01L
|
||||
#define D3DRMPMESHSTATUS_INTERRUPTED 0x02L
|
||||
#define D3DRMPMESHSTATUS_BASEMESHCOMPLETE 0x04L
|
||||
#define D3DRMPMESHSTATUS_COMPLETE 0x08L
|
||||
#define D3DRMPMESHSTATUS_RENDERABLE 0x10L
|
||||
|
||||
#define D3DRMPMESHEVENT_BASEMESH 0x01L
|
||||
#define D3DRMPMESHEVENT_COMPLETE 0x02L
|
||||
|
||||
typedef struct _D3DRMPMESHLOADSTATUS {
|
||||
DWORD dwSize; // Size of this structure
|
||||
DWORD dwPMeshSize; // Total Size (bytes)
|
||||
DWORD dwBaseMeshSize; // Total Size of the Base Mesh
|
||||
DWORD dwBytesLoaded; // Total bytes loaded
|
||||
DWORD dwVerticesLoaded; // Number of vertices loaded
|
||||
DWORD dwFacesLoaded; // Number of faces loaded
|
||||
HRESULT dwLoadResult; // Result of the load operation
|
||||
DWORD dwFlags;
|
||||
} D3DRMPMESHLOADSTATUS, *LPD3DRMPMESHLOADSTATUS;
|
||||
|
||||
typedef enum _D3DRMUSERVISUALREASON {
|
||||
D3DRMUSERVISUAL_CANSEE,
|
||||
D3DRMUSERVISUAL_RENDER
|
||||
} D3DRMUSERVISUALREASON, *LPD3DRMUSERVISUALREASON;
|
||||
|
||||
|
||||
typedef DWORD D3DRMMAPPING, D3DRMMAPPINGFLAG, *LPD3DRMMAPPING;
|
||||
static const D3DRMMAPPINGFLAG D3DRMMAP_WRAPU = 1;
|
||||
static const D3DRMMAPPINGFLAG D3DRMMAP_WRAPV = 2;
|
||||
static const D3DRMMAPPINGFLAG D3DRMMAP_PERSPCORRECT = 4;
|
||||
|
||||
typedef struct _D3DRMVERTEX
|
||||
{ D3DVECTOR position;
|
||||
D3DVECTOR normal;
|
||||
D3DVALUE tu, tv;
|
||||
D3DCOLOR color;
|
||||
} D3DRMVERTEX, *LPD3DRMVERTEX;
|
||||
|
||||
typedef LONG D3DRMGROUPINDEX; /* group indexes begin a 0 */
|
||||
static const D3DRMGROUPINDEX D3DRMGROUP_ALLGROUPS = -1;
|
||||
|
||||
/*
|
||||
* Create a color from three components in the range 0-1 inclusive.
|
||||
*/
|
||||
extern D3DCOLOR D3DRMAPI D3DRMCreateColorRGB(D3DVALUE red,
|
||||
D3DVALUE green,
|
||||
D3DVALUE blue);
|
||||
|
||||
/*
|
||||
* Create a color from four components in the range 0-1 inclusive.
|
||||
*/
|
||||
extern D3DCOLOR D3DRMAPI D3DRMCreateColorRGBA(D3DVALUE red,
|
||||
D3DVALUE green,
|
||||
D3DVALUE blue,
|
||||
D3DVALUE alpha);
|
||||
|
||||
/*
|
||||
* Get the red component of a color.
|
||||
*/
|
||||
extern D3DVALUE D3DRMAPI D3DRMColorGetRed(D3DCOLOR);
|
||||
|
||||
/*
|
||||
* Get the green component of a color.
|
||||
*/
|
||||
extern D3DVALUE D3DRMAPI D3DRMColorGetGreen(D3DCOLOR);
|
||||
|
||||
/*
|
||||
* Get the blue component of a color.
|
||||
*/
|
||||
extern D3DVALUE D3DRMAPI D3DRMColorGetBlue(D3DCOLOR);
|
||||
|
||||
/*
|
||||
* Get the alpha component of a color.
|
||||
*/
|
||||
extern D3DVALUE D3DRMAPI D3DRMColorGetAlpha(D3DCOLOR);
|
||||
|
||||
/*
|
||||
* Add two vectors. Returns its first argument.
|
||||
*/
|
||||
extern LPD3DVECTOR D3DRMAPI D3DRMVectorAdd(LPD3DVECTOR d,
|
||||
LPD3DVECTOR s1,
|
||||
LPD3DVECTOR s2);
|
||||
|
||||
/*
|
||||
* Subtract two vectors. Returns its first argument.
|
||||
*/
|
||||
extern LPD3DVECTOR D3DRMAPI D3DRMVectorSubtract(LPD3DVECTOR d,
|
||||
LPD3DVECTOR s1,
|
||||
LPD3DVECTOR s2);
|
||||
/*
|
||||
* Reflect a ray about a given normal. Returns its first argument.
|
||||
*/
|
||||
extern LPD3DVECTOR D3DRMAPI D3DRMVectorReflect(LPD3DVECTOR d,
|
||||
LPD3DVECTOR ray,
|
||||
LPD3DVECTOR norm);
|
||||
|
||||
/*
|
||||
* Calculate the vector cross product. Returns its first argument.
|
||||
*/
|
||||
extern LPD3DVECTOR D3DRMAPI D3DRMVectorCrossProduct(LPD3DVECTOR d,
|
||||
LPD3DVECTOR s1,
|
||||
LPD3DVECTOR s2);
|
||||
/*
|
||||
* Return the vector dot product.
|
||||
*/
|
||||
extern D3DVALUE D3DRMAPI D3DRMVectorDotProduct(LPD3DVECTOR s1,
|
||||
LPD3DVECTOR s2);
|
||||
|
||||
/*
|
||||
* Scale a vector so that its modulus is 1. Returns its argument or
|
||||
* NULL if there was an error (e.g. a zero vector was passed).
|
||||
*/
|
||||
extern LPD3DVECTOR D3DRMAPI D3DRMVectorNormalize(LPD3DVECTOR);
|
||||
#define D3DRMVectorNormalise D3DRMVectorNormalize
|
||||
|
||||
/*
|
||||
* Return the length of a vector (e.g. sqrt(x*x + y*y + z*z)).
|
||||
*/
|
||||
extern D3DVALUE D3DRMAPI D3DRMVectorModulus(LPD3DVECTOR v);
|
||||
|
||||
/*
|
||||
* Set the rotation part of a matrix to be a rotation of theta radians
|
||||
* around the given axis.
|
||||
*/
|
||||
|
||||
extern LPD3DVECTOR D3DRMAPI D3DRMVectorRotate(LPD3DVECTOR r, LPD3DVECTOR v, LPD3DVECTOR axis, D3DVALUE theta);
|
||||
|
||||
/*
|
||||
* Scale a vector uniformly in all three axes
|
||||
*/
|
||||
extern LPD3DVECTOR D3DRMAPI D3DRMVectorScale(LPD3DVECTOR d, LPD3DVECTOR s, D3DVALUE factor);
|
||||
|
||||
/*
|
||||
* Return a random unit vector
|
||||
*/
|
||||
extern LPD3DVECTOR D3DRMAPI D3DRMVectorRandom(LPD3DVECTOR d);
|
||||
|
||||
/*
|
||||
* Returns a unit quaternion that represents a rotation of theta radians
|
||||
* around the given axis.
|
||||
*/
|
||||
|
||||
extern LPD3DRMQUATERNION D3DRMAPI D3DRMQuaternionFromRotation(LPD3DRMQUATERNION quat,
|
||||
LPD3DVECTOR v,
|
||||
D3DVALUE theta);
|
||||
|
||||
/*
|
||||
* Calculate the product of two quaternions
|
||||
*/
|
||||
extern LPD3DRMQUATERNION D3DRMAPI D3DRMQuaternionMultiply(LPD3DRMQUATERNION q,
|
||||
LPD3DRMQUATERNION a,
|
||||
LPD3DRMQUATERNION b);
|
||||
|
||||
/*
|
||||
* Interpolate between two quaternions
|
||||
*/
|
||||
extern LPD3DRMQUATERNION D3DRMAPI D3DRMQuaternionSlerp(LPD3DRMQUATERNION q,
|
||||
LPD3DRMQUATERNION a,
|
||||
LPD3DRMQUATERNION b,
|
||||
D3DVALUE alpha);
|
||||
|
||||
/*
|
||||
* Calculate the matrix for the rotation that a unit quaternion represents
|
||||
*/
|
||||
extern void D3DRMAPI D3DRMMatrixFromQuaternion(D3DRMMATRIX4D dmMat, LPD3DRMQUATERNION lpDqQuat);
|
||||
|
||||
/*
|
||||
* Calculate the quaternion that corresponds to a rotation matrix
|
||||
*/
|
||||
extern LPD3DRMQUATERNION D3DRMAPI D3DRMQuaternionFromMatrix(LPD3DRMQUATERNION, D3DRMMATRIX4D);
|
||||
|
||||
|
||||
#if defined(__cplusplus)
|
||||
};
|
||||
#endif
|
||||
|
||||
#endif
|
||||
File diff suppressed because it is too large.
Load diff
@@ -1,51 +0,0 @@
|
||||
/*==========================================================================;
|
||||
*
|
||||
* Copyright (C) 1995-1997 Microsoft Corporation. All Rights Reserved.
|
||||
*
|
||||
* File: d3drm.h
|
||||
* Content: Direct3DRM include file
|
||||
*
|
||||
***************************************************************************/
|
||||
|
||||
#ifndef __D3DRMWIN_H__
|
||||
#define __D3DRMWIN_H__
|
||||
|
||||
#ifdef _WIN32
|
||||
#ifndef WIN32
|
||||
#define WIN32
|
||||
#endif
|
||||
#endif
|
||||
|
||||
|
||||
#include "directx/vd3drm.h"
|
||||
#include "directx/vddraw.h"
|
||||
#include "directx/vd3d.h"
|
||||
|
||||
/*
|
||||
* GUIDS used by Direct3DRM Windows interface
|
||||
*/
|
||||
DEFINE_GUID(IID_IDirect3DRMWinDevice, 0xc5016cc0, 0xd273, 0x11ce, 0xac, 0x48, 0x0, 0x0, 0xc0, 0x38, 0x25, 0xa1);
|
||||
|
||||
WIN_TYPES(IDirect3DRMWinDevice, DIRECT3DRMWINDEVICE);
|
||||
|
||||
#undef INTERFACE
|
||||
#define INTERFACE IDirect3DRMWinDevice
|
||||
|
||||
DECLARE_INTERFACE_(IDirect3DRMWinDevice, IDirect3DRMObject)
|
||||
{
|
||||
IUNKNOWN_METHODS(PURE);
|
||||
IDIRECT3DRMOBJECT_METHODS(PURE);
|
||||
|
||||
/*
|
||||
* IDirect3DRMWinDevice methods
|
||||
*/
|
||||
|
||||
/* Repaint the window with the last frame which was rendered. */
|
||||
STDMETHOD(HandlePaint)(THIS_ HDC hdc) PURE;
|
||||
|
||||
/* Respond to a WM_ACTIVATE message. */
|
||||
STDMETHOD(HandleActivate)(THIS_ WORD wparam) PURE;
|
||||
};
|
||||
|
||||
|
||||
#endif
|
||||
@@ -305,6 +305,14 @@ typedef struct _D3DTLVERTEX {
|
||||
D3DVALUE tv;
|
||||
D3DVALUE dvTV;
|
||||
};
|
||||
union {
|
||||
D3DVALUE env_u; /* Texture coordinates */
|
||||
D3DVALUE dvenv_U;
|
||||
};
|
||||
union {
|
||||
D3DVALUE env_v;
|
||||
D3DVALUE dvenv_V;
|
||||
};
|
||||
#if (defined __cplusplus) && (defined D3D_OVERLOADS)
|
||||
_D3DTLVERTEX() { }
|
||||
_D3DTLVERTEX(const D3DVECTOR& v, float _rhw,
|
||||
@@ -320,6 +328,7 @@ typedef struct _D3DTLVERTEX {
|
||||
/*
|
||||
* Untransformed/lit vertices
|
||||
*/
|
||||
//(D3DFVF_XYZ | D3DFVF_DIFFUSE | D3DFVF_SPECULAR | D3DFVF_TEX1)
|
||||
typedef struct _D3DLVERTEX {
|
||||
union {
|
||||
D3DVALUE x; /* Homogeneous coordinates */
|
||||
@@ -399,12 +408,21 @@ typedef struct _D3DVERTEX {
|
||||
D3DVALUE tv;
|
||||
D3DVALUE dvTV;
|
||||
};
|
||||
union {
|
||||
D3DVALUE tu2; /* Texture coordinates */
|
||||
D3DVALUE dvTU2;
|
||||
};
|
||||
union {
|
||||
D3DVALUE tv2;
|
||||
D3DVALUE dvTV2;
|
||||
};
|
||||
#if (defined __cplusplus) && (defined D3D_OVERLOADS)
|
||||
_D3DVERTEX() { }
|
||||
_D3DVERTEX(const D3DVECTOR& v, const D3DVECTOR& n, float _tu, float _tv)
|
||||
_D3DVERTEX(const D3DVECTOR& v, const D3DVECTOR& n, float _tu, float _tv, float _tu2=_tu, float _tv2=_tv)
|
||||
{ x = v.x; y = v.y; z = v.z;
|
||||
nx = n.x; ny = n.y; nz = n.z;
|
||||
tu = _tu; tv = _tv;
|
||||
tu2 = _tu2; tv2 = _tv2;
|
||||
}
|
||||
#endif
|
||||
} D3DVERTEX, *LPD3DVERTEX;
|
||||
|
||||
@@ -1,240 +0,0 @@
|
||||
|
||||
/******************************************************************
|
||||
* *
|
||||
* D3DVec.inl *
|
||||
* *
|
||||
* Float-valued 3D vector class for Direct3D. *
|
||||
* *
|
||||
* Copyright (c) 1996-1997 Microsoft Corp. All rights reserved. *
|
||||
* *
|
||||
******************************************************************/
|
||||
|
||||
#include <math.h>
|
||||
|
||||
// =====================================
|
||||
// Constructors
|
||||
// =====================================
|
||||
|
||||
inline
|
||||
_D3DVECTOR::_D3DVECTOR(D3DVALUE f)
|
||||
{
|
||||
x = y = z = f;
|
||||
}
|
||||
|
||||
inline
|
||||
_D3DVECTOR::_D3DVECTOR(D3DVALUE _x, D3DVALUE _y, D3DVALUE _z)
|
||||
{
|
||||
x = _x; y = _y; z = _z;
|
||||
}
|
||||
|
||||
inline
|
||||
_D3DVECTOR::_D3DVECTOR(const D3DVALUE f[3])
|
||||
{
|
||||
x = f[0]; y = f[1]; z = f[2];
|
||||
}
|
||||
|
||||
// =====================================
|
||||
// Access grants
|
||||
// =====================================
|
||||
|
||||
inline const D3DVALUE&
|
||||
_D3DVECTOR::operator[](int i) const
|
||||
{
|
||||
return (&x)[i];
|
||||
}
|
||||
|
||||
inline D3DVALUE&
|
||||
_D3DVECTOR::operator[](int i)
|
||||
{
|
||||
return (&x)[i];
|
||||
}
|
||||
|
||||
|
||||
// =====================================
|
||||
// Assignment operators
|
||||
// =====================================
|
||||
|
||||
inline _D3DVECTOR&
|
||||
_D3DVECTOR::operator += (const _D3DVECTOR& v)
|
||||
{
|
||||
x += v.x; y += v.y; z += v.z;
|
||||
return *this;
|
||||
}
|
||||
|
||||
inline _D3DVECTOR&
|
||||
_D3DVECTOR::operator -= (const _D3DVECTOR& v)
|
||||
{
|
||||
x -= v.x; y -= v.y; z -= v.z;
|
||||
return *this;
|
||||
}
|
||||
|
||||
inline _D3DVECTOR&
|
||||
_D3DVECTOR::operator *= (const _D3DVECTOR& v)
|
||||
{
|
||||
x *= v.x; y *= v.y; z *= v.z;
|
||||
return *this;
|
||||
}
|
||||
|
||||
inline _D3DVECTOR&
|
||||
_D3DVECTOR::operator /= (const _D3DVECTOR& v)
|
||||
{
|
||||
x /= v.x; y /= v.y; z /= v.z;
|
||||
return *this;
|
||||
}
|
||||
|
||||
inline _D3DVECTOR&
|
||||
_D3DVECTOR::operator *= (D3DVALUE s)
|
||||
{
|
||||
x *= s; y *= s; z *= s;
|
||||
return *this;
|
||||
}
|
||||
|
||||
inline _D3DVECTOR&
|
||||
_D3DVECTOR::operator /= (D3DVALUE s)
|
||||
{
|
||||
x /= s; y /= s; z /= s;
|
||||
return *this;
|
||||
}
|
||||
|
||||
inline _D3DVECTOR
|
||||
operator + (const _D3DVECTOR& v)
|
||||
{
|
||||
return v;
|
||||
}
|
||||
|
||||
inline _D3DVECTOR
|
||||
operator - (const _D3DVECTOR& v)
|
||||
{
|
||||
return _D3DVECTOR(-v.x, -v.y, -v.z);
|
||||
}
|
||||
|
||||
inline _D3DVECTOR
|
||||
operator + (const _D3DVECTOR& v1, const _D3DVECTOR& v2)
|
||||
{
|
||||
return _D3DVECTOR(v1.x+v2.x, v1.y+v2.y, v1.z+v2.z);
|
||||
}
|
||||
|
||||
inline _D3DVECTOR
|
||||
operator - (const _D3DVECTOR& v1, const _D3DVECTOR& v2)
|
||||
{
|
||||
return _D3DVECTOR(v1.x-v2.x, v1.y-v2.y, v1.z-v2.z);
|
||||
}
|
||||
|
||||
inline _D3DVECTOR
|
||||
operator * (const _D3DVECTOR& v1, const _D3DVECTOR& v2)
|
||||
{
|
||||
return _D3DVECTOR(v1.x*v2.x, v1.y*v2.y, v1.z*v2.z);
|
||||
}
|
||||
|
||||
inline _D3DVECTOR
|
||||
operator / (const _D3DVECTOR& v1, const _D3DVECTOR& v2)
|
||||
{
|
||||
return _D3DVECTOR(v1.x/v2.x, v1.y/v2.y, v1.z/v2.z);
|
||||
}
|
||||
|
||||
inline int
|
||||
operator < (const _D3DVECTOR& v1, const _D3DVECTOR& v2)
|
||||
{
|
||||
return v1[0] < v2[0] && v1[1] < v2[1] && v1[2] < v2[2];
|
||||
}
|
||||
|
||||
inline int
|
||||
operator <= (const _D3DVECTOR& v1, const _D3DVECTOR& v2)
|
||||
{
|
||||
return v1[0] <= v2[0] && v1[1] <= v2[1] && v1[2] <= v2[2];
|
||||
}
|
||||
|
||||
inline _D3DVECTOR
|
||||
operator * (const _D3DVECTOR& v, D3DVALUE s)
|
||||
{
|
||||
return _D3DVECTOR(s*v.x, s*v.y, s*v.z);
|
||||
}
|
||||
|
||||
inline _D3DVECTOR
|
||||
operator * (D3DVALUE s, const _D3DVECTOR& v)
|
||||
{
|
||||
return _D3DVECTOR(s*v.x, s*v.y, s*v.z);
|
||||
}
|
||||
|
||||
inline _D3DVECTOR
|
||||
operator / (const _D3DVECTOR& v, D3DVALUE s)
|
||||
{
|
||||
return _D3DVECTOR(v.x/s, v.y/s, v.z/s);
|
||||
}
|
||||
|
||||
inline int
|
||||
operator == (const _D3DVECTOR& v1, const _D3DVECTOR& v2)
|
||||
{
|
||||
return v1.x==v2.x && v1.y==v2.y && v1.z == v2.z;
|
||||
}
|
||||
|
||||
inline D3DVALUE
|
||||
Magnitude (const _D3DVECTOR& v)
|
||||
{
|
||||
return (D3DVALUE) sqrt(SquareMagnitude(v));
|
||||
}
|
||||
|
||||
inline D3DVALUE
|
||||
SquareMagnitude (const _D3DVECTOR& v)
|
||||
{
|
||||
return v.x*v.x + v.y*v.y + v.z*v.z;
|
||||
}
|
||||
|
||||
inline _D3DVECTOR
|
||||
Normalize (const _D3DVECTOR& v)
|
||||
{
|
||||
return v / Magnitude(v);
|
||||
}
|
||||
|
||||
inline D3DVALUE
|
||||
Min (const _D3DVECTOR& v)
|
||||
{
|
||||
D3DVALUE ret = v.x;
|
||||
if (v.y < ret) ret = v.y;
|
||||
if (v.z < ret) ret = v.z;
|
||||
return ret;
|
||||
}
|
||||
|
||||
inline D3DVALUE
|
||||
Max (const _D3DVECTOR& v)
|
||||
{
|
||||
D3DVALUE ret = v.x;
|
||||
if (ret < v.y) ret = v.y;
|
||||
if (ret < v.z) ret = v.z;
|
||||
return ret;
|
||||
}
|
||||
|
||||
inline _D3DVECTOR
|
||||
Minimize (const _D3DVECTOR& v1, const _D3DVECTOR& v2)
|
||||
{
|
||||
return _D3DVECTOR( v1[0] < v2[0] ? v1[0] : v2[0],
|
||||
v1[1] < v2[1] ? v1[1] : v2[1],
|
||||
v1[2] < v2[2] ? v1[2] : v2[2]);
|
||||
}
|
||||
|
||||
inline _D3DVECTOR
|
||||
Maximize (const _D3DVECTOR& v1, const _D3DVECTOR& v2)
|
||||
{
|
||||
return _D3DVECTOR( v1[0] > v2[0] ? v1[0] : v2[0],
|
||||
v1[1] > v2[1] ? v1[1] : v2[1],
|
||||
v1[2] > v2[2] ? v1[2] : v2[2]);
|
||||
}
|
||||
|
||||
inline D3DVALUE
|
||||
DotProduct (const _D3DVECTOR& v1, const _D3DVECTOR& v2)
|
||||
{
|
||||
return v1.x*v2.x + v1.y * v2.y + v1.z*v2.z;
|
||||
}
|
||||
|
||||
inline _D3DVECTOR
|
||||
CrossProduct (const _D3DVECTOR& v1, const _D3DVECTOR& v2)
|
||||
{
|
||||
_D3DVECTOR result;
|
||||
|
||||
result[0] = v1[1] * v2[2] - v1[2] * v2[1];
|
||||
result[1] = v1[2] * v2[0] - v1[0] * v2[2];
|
||||
result[2] = v1[0] * v2[1] - v1[1] * v2[0];
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
Loaded 100 of 780 files, more files were not shown because too many files have changed in this diff.
Show more
Reference in new issue
Block a user