mirror of
https://github.com/scp-fs2open/fs2open.github.com.git
synced 2026-11-09 04:49:39 -10:00
Compare commits
878
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 |
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.3 2003-09-07 12:46:59 drevil Exp $
|
||||
#
|
||||
|
||||
use strict;
|
||||
|
||||
use vars qw($MAILER $CVS $debug $boundary);
|
||||
use Digest::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 Digest::MD5;
|
||||
$digest->reset();
|
||||
$digest->add(time() . rand());
|
||||
$boundary = "----=MIME." . unpack("H*", $digest->digest());
|
||||
|
||||
# Build the mail header
|
||||
push(@text, 'From: [email protected]');
|
||||
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,19 +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
|
||||
randomtiger:f7Way/xL9ic7o:fs2source
|
||||
righteous1:f7fpcXiE0Ubao:fs2source
|
||||
bobboau:f7jChSbXOIdWY:fs2source
|
||||
sesquipedalian:f75AcAOV6TM6Q:fs2source
|
||||
daveb:f7f2mVbMvbe.6:fs2source
|
||||
Goober5000:f7Fc.gHzyrOL2:fs2source
|
||||
dkharrat:f7odljbD5tm5k:fs2source
|
||||
EdrickV:f7cDahmEbbAlg:fs2source
|
||||
OldMan:f7N4NyUG5Ommw:fs2source
|
||||
komet:f7fyoBN5r.m76: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,18 +0,0 @@
|
||||
drevil
|
||||
inquisitor
|
||||
mysterial
|
||||
DTP
|
||||
randomtiger
|
||||
wmcoolmon
|
||||
unknownplayer
|
||||
phreak
|
||||
bobboau
|
||||
righteous1
|
||||
sesquipedalian
|
||||
Goober5000
|
||||
dkharrat
|
||||
daveb
|
||||
EdrickV
|
||||
OldMan
|
||||
komet
|
||||
penguin
|
||||
@@ -1,6 +1,7 @@
|
||||
Makefile
|
||||
Makefile.in
|
||||
configure
|
||||
FS2_Open.prj
|
||||
FS2_Open.prj.bak
|
||||
FS2_Open.pws
|
||||
.tm_project.cache
|
||||
@@ -15,6 +16,8 @@ missing
|
||||
mkinstalldirs
|
||||
autom4te*
|
||||
aclocal.m4
|
||||
Freespace2.dsp
|
||||
Freespace2.dsw
|
||||
Freespace2.ncb
|
||||
Freespace2.opt
|
||||
Freespace2.plg
|
||||
|
||||
@@ -1,650 +0,0 @@
|
||||
# Anjuta Version 1.2.2
|
||||
Compatibility Level: 1
|
||||
|
||||
<PROJECT_DESCRIPTION_START>
|
||||
FS2 Open: SCP<PROJECT_DESCRIPTION_END>
|
||||
<CONFIG_PROGS_START>
|
||||
<CONFIG_PROGS_END>
|
||||
<CONFIG_LIBS_START>
|
||||
<CONFIG_LIBS_END>
|
||||
<CONFIG_HEADERS_START>
|
||||
<CONFIG_HEADERS_END>
|
||||
<CONFIG_CHARACTERISTICS_START>
|
||||
<CONFIG_CHARACTERISTICS_END>
|
||||
<CONFIG_LIB_FUNCS_START>
|
||||
<CONFIG_LIB_FUNCS_END>
|
||||
<CONFIG_ADDITIONAL_START>
|
||||
<CONFIG_ADDITIONAL_END>
|
||||
<CONFIG_FILES_START>
|
||||
<CONFIG_FILES_END>
|
||||
<MAKEFILE_AM_START>
|
||||
<MAKEFILE_AM_END>
|
||||
|
||||
props.file.type=project
|
||||
|
||||
anjuta.version=1.2.2
|
||||
anjuta.compatibility.level=1
|
||||
|
||||
project.name=FS2_Open
|
||||
project.type=GENERIC
|
||||
project.target.type=EXECUTABLE
|
||||
project.version=3.6
|
||||
project.author=Taylor Richards
|
||||
project.source.target=fs2_open
|
||||
project.has.gettext=0
|
||||
project.gui.command=
|
||||
project.programming.language=C++
|
||||
project.excluded.modules=intl
|
||||
|
||||
project.config.extra.modules.before=
|
||||
project.config.extra.modules.after=
|
||||
project.config.blocked=1
|
||||
project.config.disable.overwriting=1 1 1 1 1 1 1 1 1
|
||||
|
||||
project.menu.entry=FS2_Open Version 3.6
|
||||
project.menu.group=Application
|
||||
project.menu.comment=FS2_Open Version 3.6
|
||||
project.menu.icon=
|
||||
project.menu.need.terminal=0
|
||||
|
||||
project.configure.options=
|
||||
anjuta.program.arguments=
|
||||
preferences.build.option.jobs=0
|
||||
preferences.build.option.silent=0
|
||||
preferences.build.option.autosave=0
|
||||
preferences.anjuta.make.options=-k
|
||||
preferences.make=make
|
||||
preferences.build.option.keep.going=1
|
||||
preferences.build.option.warn.undef=0
|
||||
preferences.autoformat.custom.style= -i8 -sc -bli0 -bl0 -cbi0 -ss
|
||||
preferences.indent.opening=0
|
||||
preferences.autoformat.disable=0
|
||||
preferences.indent.automatic=1
|
||||
preferences.use.tabs=1
|
||||
preferences.indent.size=4
|
||||
preferences.tabsize=4
|
||||
preferences.indent.closing=0
|
||||
|
||||
module.include.name=.
|
||||
module.include.type=
|
||||
module.include.files=\
|
||||
code/anim/animplay.h\
|
||||
code/anim/packunpack.h\
|
||||
code/demo/demo.h\
|
||||
code/asteroid/asteroid.h\
|
||||
code/bmpman/bmpman.h\
|
||||
code/cfile/cfile.h\
|
||||
code/cfile/cfilearchive.h\
|
||||
code/cfile/cfilesystem.h\
|
||||
code/cmdline/cmdline.h\
|
||||
code/cmeasure/cmeasure.h\
|
||||
code/controlconfig/controlsconfig.h\
|
||||
code/cutscene/cutscenes.h\
|
||||
code/cutscene/movie.h\
|
||||
code/ddsutils/ddsutils.h\
|
||||
code/debris/debris.h\
|
||||
code/debugconsole/dbugfile.h\
|
||||
code/debugconsole/timerbar.h\
|
||||
code/decals/decals.h\
|
||||
code/directx/dx8show.h\
|
||||
code/directx/vasync.h\
|
||||
code/directx/vd3dtypes.h\
|
||||
code/directx/vddraw.h\
|
||||
code/directx/vdinput.h\
|
||||
code/directx/vdplay.h\
|
||||
code/directx/vdplobby.h\
|
||||
code/directx/vdsetup.h\
|
||||
code/directx/vdsound.h\
|
||||
code/directx/vdvp.h\
|
||||
code/exceptionhandler/exceptionhandler.h\
|
||||
code/fireball/fireballs.h\
|
||||
code/freespace2/freespace.h\
|
||||
code/freespace2/freespaceresource.h\
|
||||
code/freespace2/levelpaging.h\
|
||||
code/gamehelp/contexthelp.h\
|
||||
code/gamehelp/gameplayhelp.h\
|
||||
code/gamesequence/gamesequence.h\
|
||||
code/gamesnd/eventmusic.h\
|
||||
code/gamesnd/gamesnd.h\
|
||||
code/globalincs/alphacolors.h\
|
||||
code/globalincs/crypt.h\
|
||||
code/globalincs/linklist.h\
|
||||
code/globalincs/pstypes.h\
|
||||
code/globalincs/systemvars.h\
|
||||
code/globalincs/version.h\
|
||||
code/graphics/2d.h\
|
||||
code/graphics/font.h\
|
||||
code/graphics/grd3d.h\
|
||||
code/graphics/grd3dbmpman.h\
|
||||
code/graphics/grd3dinternal.h\
|
||||
code/graphics/grinternal.h\
|
||||
code/graphics/gropengl.h\
|
||||
code/graphics/grzbuffer.h\
|
||||
code/graphics/line.h\
|
||||
code/graphics/tmapper.h\
|
||||
code/graphics/gl/wglext.h\
|
||||
code/graphics/gl/GLAUX.H\
|
||||
code/graphics/gl/GLU.H\
|
||||
code/graphics/gl/Gl.h\
|
||||
code/graphics/gl/Glext.h\
|
||||
code/graphics/grd3dsetup.h\
|
||||
code/graphics/grd3dlight.h\
|
||||
code/graphics/grd3dbatch.h\
|
||||
code/graphics/GrD3DParticle.h\
|
||||
code/hud/hudconfig.h\
|
||||
code/hud/hud.h\
|
||||
code/hud/hudartillery.h\
|
||||
code/hud/hudbrackets.h\
|
||||
code/hud/hudescort.h\
|
||||
code/hud/hudets.h\
|
||||
code/hud/hudgauges.h\
|
||||
code/hud/hudlock.h\
|
||||
code/hud/hudmessage.h\
|
||||
code/hud/hudobserver.h\
|
||||
code/hud/hudresource.h\
|
||||
code/hud/hudreticle.h\
|
||||
code/hud/hudshield.h\
|
||||
code/hud/hudsquadmsg.h\
|
||||
code/hud/hudtarget.h\
|
||||
code/hud/hudtargetbox.h\
|
||||
code/hud/hudwingmanstatus.h\
|
||||
code/inetfile/cftp.h\
|
||||
code/inetfile/chttpget.h\
|
||||
code/inetfile/inetgetfile.h\
|
||||
code/io/joy.h\
|
||||
code/io/joy_ff.h\
|
||||
code/io/key.h\
|
||||
code/io/keycontrol.h\
|
||||
code/io/mouse.h\
|
||||
code/io/sw_error.hpp\
|
||||
code/io/sw_force.h\
|
||||
code/io/sw_guid.hpp\
|
||||
code/io/timer.h\
|
||||
code/jumpnode/jumpnode.h\
|
||||
code/lighting/lighting.h\
|
||||
code/localization/fhash.h\
|
||||
code/localization/localize.h\
|
||||
code/math/fix.h\
|
||||
code/math/floating.h\
|
||||
code/math/fvi.h\
|
||||
code/math/spline.h\
|
||||
code/math/staticrand.h\
|
||||
code/math/vecmat.h\
|
||||
code/menuui/barracks.h\
|
||||
code/menuui/credits.h\
|
||||
code/menuui/fishtank.h\
|
||||
code/menuui/mainhallmenu.h\
|
||||
code/menuui/mainhalltemp.h\
|
||||
code/menuui/optionsmenu.h\
|
||||
code/menuui/optionsmenumulti.h\
|
||||
code/menuui/playermenu.h\
|
||||
code/menuui/readyroom.h\
|
||||
code/menuui/snazzyui.h\
|
||||
code/menuui/techmenu.h\
|
||||
code/menuui/trainingmenu.h\
|
||||
code/mission/missionbriefcommon.h\
|
||||
code/mission/missioncampaign.h\
|
||||
code/mission/missiongoals.h\
|
||||
code/mission/missiongrid.h\
|
||||
code/mission/missionhotkey.h\
|
||||
code/mission/missionload.h\
|
||||
code/mission/missionlog.h\
|
||||
code/mission/missionmessage.h\
|
||||
code/mission/missionparse.h\
|
||||
code/mission/missiontraining.h\
|
||||
code/missionui/chatbox.h\
|
||||
code/missionui/missionbrief.h\
|
||||
code/missionui/missioncmdbrief.h\
|
||||
code/missionui/missiondebrief.h\
|
||||
code/missionui/missionloopbrief.h\
|
||||
code/missionui/missionpause.h\
|
||||
code/missionui/missionrecommend.h\
|
||||
code/missionui/missionscreencommon.h\
|
||||
code/missionui/missionshipchoice.h\
|
||||
code/missionui/missionstats.h\
|
||||
code/missionui/missionweaponchoice.h\
|
||||
code/missionui/redalert.h\
|
||||
code/mm/mmreg.h\
|
||||
code/mm/msacm.h\
|
||||
code/model/modelsinc.h\
|
||||
code/model/model.h\
|
||||
code/nebula/neb.h\
|
||||
code/nebula/neblightning.h\
|
||||
code/network/fs2ox.h\
|
||||
code/network/multi.h\
|
||||
code/network/multi_campaign.h\
|
||||
code/network/multi_data.h\
|
||||
code/network/multi_dogfight.h\
|
||||
code/network/multi_endgame.h\
|
||||
code/network/multi_ingame.h\
|
||||
code/network/multi_kick.h\
|
||||
code/network/multi_log.h\
|
||||
code/network/multi_obj.h\
|
||||
code/network/multi_observer.h\
|
||||
code/network/multi_oo.h\
|
||||
code/network/multi_options.h\
|
||||
code/network/multi_pause.h\
|
||||
code/network/multi_pinfo.h\
|
||||
code/network/multi_ping.h\
|
||||
code/network/multi_pmsg.h\
|
||||
code/network/multi_rate.h\
|
||||
code/network/multi_respawn.h\
|
||||
code/network/multi_team.h\
|
||||
code/network/multi_update.h\
|
||||
code/network/multi_voice.h\
|
||||
code/network/multi_xfer.h\
|
||||
code/network/multilag.h\
|
||||
code/network/multimsgs.h\
|
||||
code/network/multiteamselect.h\
|
||||
code/network/multiui.h\
|
||||
code/network/multiutil.h\
|
||||
code/network/psnet.h\
|
||||
code/network/psnet2.h\
|
||||
code/network/stand_gui.h\
|
||||
code/object/objcollide.h\
|
||||
code/object/object.h\
|
||||
code/object/objectsnd.h\
|
||||
code/observer/observer.h\
|
||||
code/osapi/monopub.h\
|
||||
code/osapi/osapi.h\
|
||||
code/osapi/osregistry.h\
|
||||
code/osapi/outwnd.h\
|
||||
code/palman/palman.h\
|
||||
code/parse/encrypt.h\
|
||||
code/parse/parselo.h\
|
||||
code/parse/sexp.h\
|
||||
code/particle/particle.h\
|
||||
code/pcxutils/pcxutils.h\
|
||||
code/physics/physics.h\
|
||||
code/playerman/managepilot.h\
|
||||
code/playerman/player.h\
|
||||
code/popup/popup.h\
|
||||
code/popup/popupdead.h\
|
||||
code/radar/radar.h\
|
||||
code/render/3d.h\
|
||||
code/render/3dinternal.h\
|
||||
code/scramble/scramble.h\
|
||||
code/ship/afterburner.h\
|
||||
code/ship/ai.h\
|
||||
code/ship/aibig.h\
|
||||
code/ship/aigoals.h\
|
||||
code/ship/ailocal.h\
|
||||
code/ship/awacs.h\
|
||||
code/ship/ship.h\
|
||||
code/ship/shipcontrails.h\
|
||||
code/ship/shipfx.h\
|
||||
code/ship/shiphit.h\
|
||||
code/ship/subsysdamage.h\
|
||||
code/sound/acm.h\
|
||||
code/sound/audiostr.h\
|
||||
code/sound/channel.h\
|
||||
code/sound/ds.h\
|
||||
code/sound/ds3d.h\
|
||||
code/sound/dscap.h\
|
||||
code/sound/fsspeech.h\
|
||||
code/sound/midifile.h\
|
||||
code/sound/midiseq.h\
|
||||
code/sound/rbaudio.h\
|
||||
code/sound/rtvoice.h\
|
||||
code/sound/sound.h\
|
||||
code/sound/speech.h\
|
||||
code/sound/winmidi.h\
|
||||
code/starfield/nebula.h\
|
||||
code/starfield/starfield.h\
|
||||
code/starfield/supernova.h\
|
||||
code/stats/medals.h\
|
||||
code/stats/scoring.h\
|
||||
code/stats/stats.h\
|
||||
code/tgautils/tgautils.h\
|
||||
code/ui/ui.h\
|
||||
code/ui/uidefs.h\
|
||||
code/vcodec/codec1.h\
|
||||
code/weapon/beam.h\
|
||||
code/weapon/corkscrew.h\
|
||||
code/weapon/emp.h\
|
||||
code/weapon/flak.h\
|
||||
code/weapon/muzzleflash.h\
|
||||
code/weapon/shockwave.h\
|
||||
code/weapon/swarm.h\
|
||||
code/weapon/trails.h\
|
||||
code/weapon/weapon.h\
|
||||
code/windows_stub/config.h\
|
||||
code/species_defs/species_defs.h\
|
||||
code/fs2open_pxo/Client.h\
|
||||
code/fs2open_pxo/TCP_Socket.h\
|
||||
code/fs2open_pxo/protocol.h\
|
||||
code/fs2open_pxo/udpsocket.h\
|
||||
code/openil/il_func.h\
|
||||
code/globalincs/globals.h\
|
||||
code/jpgutils/jpgutils.h\
|
||||
code/graphics/grstub.h\
|
||||
code/irc/irc.h\
|
||||
code/graphics/grbatch.h\
|
||||
code/graphics/gropengltnl.h\
|
||||
code/graphics/gropengllight.h\
|
||||
code/graphics/gropenglextension.h\
|
||||
code/graphics/gropengltexture.h\
|
||||
code/autopilot/autopilot.h\
|
||||
code/hud/hudnavigation.h
|
||||
|
||||
module.source.name=.
|
||||
module.source.type=
|
||||
module.source.files=\
|
||||
code/anim/animplay.cpp\
|
||||
code/anim/packunpack.cpp\
|
||||
code/demo/demo.cpp\
|
||||
code/asteroid/asteroid.cpp\
|
||||
code/bmpman/bmpman.cpp\
|
||||
code/cfile/cfile.cpp\
|
||||
code/cfile/cfilearchive.cpp\
|
||||
code/cfile/cfilelist.cpp\
|
||||
code/cfile/cfilesystem.cpp\
|
||||
code/cfilearchiver/cfilearchiver.cpp\
|
||||
code/cmdline/cmdline.cpp\
|
||||
code/cmeasure/cmeasure.cpp\
|
||||
code/controlconfig/controlsconfig.cpp\
|
||||
code/controlconfig/controlsconfigcommon.cpp\
|
||||
code/cryptstring/cryptstring.cpp\
|
||||
code/cutscene/cutscenes.cpp\
|
||||
code/cutscene/movie.cpp\
|
||||
code/ddsutils/ddsutils.cpp\
|
||||
code/debris/debris.cpp\
|
||||
code/debugconsole/console.cpp\
|
||||
code/debugconsole/dbugfile.cpp\
|
||||
code/debugconsole/timerbar.cpp\
|
||||
code/decals/decals.cpp\
|
||||
code/directx/dx8show.cpp\
|
||||
code/exceptionhandler/exceptionhandler.cpp\
|
||||
code/fireball/fireballs.cpp\
|
||||
code/fireball/warpineffect.cpp\
|
||||
code/freespace2/freespace.cpp\
|
||||
code/freespace2/levelpaging.cpp\
|
||||
code/gamehelp/contexthelp.cpp\
|
||||
code/gamehelp/gameplayhelp.cpp\
|
||||
code/gamesequence/gamesequence.cpp\
|
||||
code/gamesnd/eventmusic.cpp\
|
||||
code/gamesnd/gamesnd.cpp\
|
||||
code/globalincs/alphacolors.cpp\
|
||||
code/globalincs/crypt.cpp\
|
||||
code/globalincs/systemvars.cpp\
|
||||
code/globalincs/version.cpp\
|
||||
code/globalincs/windebug.cpp\
|
||||
code/graphics/2d.cpp\
|
||||
code/graphics/font.cpp\
|
||||
code/graphics/grd3d.cpp\
|
||||
code/graphics/grd3dbmpman.cpp\
|
||||
code/graphics/grd3dcalls.cpp\
|
||||
code/graphics/grd3drender.cpp\
|
||||
code/graphics/grd3dtexture.cpp\
|
||||
code/graphics/gropengl.cpp\
|
||||
code/graphics/grzbuffer.cpp\
|
||||
code/graphics/grd3dsetup.cpp\
|
||||
code/graphics/grd3dlight.cpp\
|
||||
code/graphics/grd3dbatch.cpp\
|
||||
code/graphics/GrD3DParticle.cpp\
|
||||
code/hud/hud.cpp\
|
||||
code/hud/hudartillery.cpp\
|
||||
code/hud/hudbrackets.cpp\
|
||||
code/hud/hudconfig.cpp\
|
||||
code/hud/hudescort.cpp\
|
||||
code/hud/hudets.cpp\
|
||||
code/hud/hudlock.cpp\
|
||||
code/hud/hudmessage.cpp\
|
||||
code/hud/hudobserver.cpp\
|
||||
code/hud/hudresource.cpp\
|
||||
code/hud/hudreticle.cpp\
|
||||
code/hud/hudshield.cpp\
|
||||
code/hud/hudsquadmsg.cpp\
|
||||
code/hud/hudtarget.cpp\
|
||||
code/hud/hudtargetbox.cpp\
|
||||
code/hud/hudwingmanstatus.cpp\
|
||||
code/inetfile/cftp.cpp\
|
||||
code/inetfile/chttpget.cpp\
|
||||
code/inetfile/inetgetfile.cpp\
|
||||
code/io/joy_ff.cpp\
|
||||
code/io/joy.cpp\
|
||||
code/io/joy-unix.cpp\
|
||||
code/io/key.cpp\
|
||||
code/io/keycontrol.cpp\
|
||||
code/io/mouse.cpp\
|
||||
code/io/swff_lib.cpp\
|
||||
code/io/timer.cpp\
|
||||
code/io/xmouse.cpp\
|
||||
code/jumpnode/jumpnode.cpp\
|
||||
code/lighting/lighting.cpp\
|
||||
code/localization/fhash.cpp\
|
||||
code/localization/localize.cpp\
|
||||
code/math/floating.cpp\
|
||||
code/math/fix.cpp\
|
||||
code/math/fvi.cpp\
|
||||
code/math/spline.cpp\
|
||||
code/math/staticrand.cpp\
|
||||
code/math/vecmat.cpp\
|
||||
code/menuui/barracks.cpp\
|
||||
code/menuui/credits.cpp\
|
||||
code/menuui/fishtank.cpp\
|
||||
code/menuui/mainhallmenu.cpp\
|
||||
code/menuui/mainhalltemp.cpp\
|
||||
code/menuui/optionsmenu.cpp\
|
||||
code/menuui/optionsmenumulti.cpp\
|
||||
code/menuui/playermenu.cpp\
|
||||
code/menuui/readyroom.cpp\
|
||||
code/menuui/snazzyui.cpp\
|
||||
code/menuui/techmenu.cpp\
|
||||
code/menuui/trainingmenu.cpp\
|
||||
code/mission/missionbriefcommon.cpp\
|
||||
code/mission/missioncampaign.cpp\
|
||||
code/mission/missiongoals.cpp\
|
||||
code/mission/missiongrid.cpp\
|
||||
code/mission/missionhotkey.cpp\
|
||||
code/mission/missionload.cpp\
|
||||
code/mission/missionlog.cpp\
|
||||
code/mission/missionmessage.cpp\
|
||||
code/mission/missionparse.cpp\
|
||||
code/mission/missiontraining.cpp\
|
||||
code/missionui/chatbox.cpp\
|
||||
code/missionui/missionbrief.cpp\
|
||||
code/missionui/missioncmdbrief.cpp\
|
||||
code/missionui/missiondebrief.cpp\
|
||||
code/missionui/missionloopbrief.cpp\
|
||||
code/missionui/missionpause.cpp\
|
||||
code/missionui/missionrecommend.cpp\
|
||||
code/missionui/missionscreencommon.cpp\
|
||||
code/missionui/missionshipchoice.cpp\
|
||||
code/missionui/missionstats.cpp\
|
||||
code/missionui/missionweaponchoice.cpp\
|
||||
code/missionui/redalert.cpp\
|
||||
code/model/modelcollide.cpp\
|
||||
code/model/modelinterp.cpp\
|
||||
code/model/modeloctant.cpp\
|
||||
code/model/modelread.cpp\
|
||||
code/nebula/neb.cpp\
|
||||
code/nebula/neblightning.cpp\
|
||||
code/network/fs2ox.cpp\
|
||||
code/network/multi.cpp\
|
||||
code/network/multi_campaign.cpp\
|
||||
code/network/multi_data.cpp\
|
||||
code/network/multi_dogfight.cpp\
|
||||
code/network/multi_endgame.cpp\
|
||||
code/network/multi_ingame.cpp\
|
||||
code/network/multi_kick.cpp\
|
||||
code/network/multi_log.cpp\
|
||||
code/network/multi_obj.cpp\
|
||||
code/network/multi_observer.cpp\
|
||||
code/network/multi_oo.cpp\
|
||||
code/network/multi_options.cpp\
|
||||
code/network/multi_pause.cpp\
|
||||
code/network/multi_pinfo.cpp\
|
||||
code/network/multi_ping.cpp\
|
||||
code/network/multi_pmsg.cpp\
|
||||
code/network/multi_rate.cpp\
|
||||
code/network/multi_respawn.cpp\
|
||||
code/network/multi_team.cpp\
|
||||
code/network/multi_update.cpp\
|
||||
code/network/multi_voice.cpp\
|
||||
code/network/multi_xfer.cpp\
|
||||
code/network/multilag.cpp\
|
||||
code/network/multimsgs.cpp\
|
||||
code/network/multiteamselect.cpp\
|
||||
code/network/multiui.cpp\
|
||||
code/network/multiutil.cpp\
|
||||
code/network/psnet.cpp\
|
||||
code/network/psnet2.cpp\
|
||||
code/network/stand_gui.cpp\
|
||||
code/network/stand_gui-unix.cpp\
|
||||
code/object/collidedebrisship.cpp\
|
||||
code/object/collidedebrisweapon.cpp\
|
||||
code/object/collideshipship.cpp\
|
||||
code/object/collideshipweapon.cpp\
|
||||
code/object/collideweaponweapon.cpp\
|
||||
code/object/objcollide.cpp\
|
||||
code/object/object.cpp\
|
||||
code/object/objectsnd.cpp\
|
||||
code/object/objectsort.cpp\
|
||||
code/observer/observer.cpp\
|
||||
code/osapi/osapi.cpp\
|
||||
code/osapi/osapi_unix.cpp\
|
||||
code/osapi/osregistry.cpp\
|
||||
code/osapi/osregistry_unix.cpp\
|
||||
code/osapi/outwnd.cpp\
|
||||
code/osapi/outwnd_unix.cpp\
|
||||
code/palman/palman.cpp\
|
||||
code/parse/encrypt.cpp\
|
||||
code/parse/parselo.cpp\
|
||||
code/parse/sexp.cpp\
|
||||
code/particle/particle.cpp\
|
||||
code/pcxutils/pcxutils.cpp\
|
||||
code/physics/physics.cpp\
|
||||
code/playerman/managepilot.cpp\
|
||||
code/playerman/playercontrol.cpp\
|
||||
code/popup/popup.cpp\
|
||||
code/popup/popupdead.cpp\
|
||||
code/radar/radar.cpp\
|
||||
code/render/3ddraw.cpp\
|
||||
code/render/3dclipper.cpp\
|
||||
code/render/3dlaser.cpp\
|
||||
code/render/3dmath.cpp\
|
||||
code/render/3dsetup.cpp\
|
||||
code/scramble/scramble.cpp\
|
||||
code/ship/afterburner.cpp\
|
||||
code/ship/ai.cpp\
|
||||
code/ship/aibig.cpp\
|
||||
code/ship/aicode.cpp\
|
||||
code/ship/aigoals.cpp\
|
||||
code/ship/awacs.cpp\
|
||||
code/ship/shield.cpp\
|
||||
code/ship/ship.cpp\
|
||||
code/ship/shipcontrails.cpp\
|
||||
code/ship/shipfx.cpp\
|
||||
code/ship/shiphit.cpp\
|
||||
code/sound/audiostr.cpp\
|
||||
code/sound/acm.cpp\
|
||||
code/sound/ds.cpp\
|
||||
code/sound/ds3d.cpp\
|
||||
code/sound/dscap.cpp\
|
||||
code/sound/fsspeech.cpp\
|
||||
code/sound/midifile.cpp\
|
||||
code/sound/rbaudio.cpp\
|
||||
code/sound/rtvoice.cpp\
|
||||
code/sound/sound.cpp\
|
||||
code/sound/speech.cpp\
|
||||
code/sound/winmidi.cpp\
|
||||
code/sound/winmidi_base.cpp\
|
||||
code/sound/acm-unix.cpp\
|
||||
code/starfield/nebula.cpp\
|
||||
code/starfield/starfield.cpp\
|
||||
code/starfield/supernova.cpp\
|
||||
code/stats/medals.cpp\
|
||||
code/stats/scoring.cpp\
|
||||
code/stats/stats.cpp\
|
||||
code/tgautils/tgautils.cpp\
|
||||
code/ui/button.cpp\
|
||||
code/ui/checkbox.cpp\
|
||||
code/ui/gadget.cpp\
|
||||
code/ui/icon.cpp\
|
||||
code/ui/inputbox.cpp\
|
||||
code/ui/keytrap.cpp\
|
||||
code/ui/listbox.cpp\
|
||||
code/ui/radio.cpp\
|
||||
code/ui/scroll.cpp\
|
||||
code/ui/slider.cpp\
|
||||
code/ui/slider2.cpp\
|
||||
code/ui/uidraw.cpp\
|
||||
code/ui/uimouse.cpp\
|
||||
code/ui/window.cpp\
|
||||
code/vcodec/codec1.cpp\
|
||||
code/weapon/beam.cpp\
|
||||
code/weapon/corkscrew.cpp\
|
||||
code/weapon/emp.cpp\
|
||||
code/weapon/flak.cpp\
|
||||
code/weapon/muzzleflash.cpp\
|
||||
code/weapon/shockwave.cpp\
|
||||
code/weapon/swarm.cpp\
|
||||
code/weapon/trails.cpp\
|
||||
code/weapon/weapons.cpp\
|
||||
code/windows_stub/stubs.cpp\
|
||||
code/species_defs/species_defs.cpp\
|
||||
code/fs2open_pxo/Client.cpp\
|
||||
code/fs2open_pxo/TCP_Client.cpp\
|
||||
code/fs2open_pxo/TCP_Socket.cpp\
|
||||
code/fs2open_pxo/udpsocket.cpp\
|
||||
code/openil/il_func.cpp\
|
||||
code/jpgutils/jpgutils.cpp\
|
||||
code/irc/irc.cpp\
|
||||
code/graphics/grbatch.cpp\
|
||||
code/graphics/gropengltnl.cpp\
|
||||
code/graphics/gropengllight.cpp\
|
||||
code/graphics/gropenglextension.cpp\
|
||||
code/graphics/gropengltexture.cpp\
|
||||
code/sound/audiostr-unix.cpp\
|
||||
code/autopilot/autopilot.cpp\
|
||||
code/hud/hudnavigation.cpp
|
||||
|
||||
module.pixmap.name=.
|
||||
module.pixmap.type=
|
||||
module.pixmap.files=\
|
||||
code/freespace2/app_icon.ico\
|
||||
code/freespace2/goal_com.bmp\
|
||||
code/freespace2/goal_fail.bmp\
|
||||
code/freespace2/goal_inc.bmp\
|
||||
code/freespace2/goal_none.bmp\
|
||||
code/freespace2/goal_ord.bmp
|
||||
|
||||
module.data.name=.
|
||||
module.data.type=
|
||||
module.data.files=
|
||||
|
||||
module.help.name=.
|
||||
module.help.type=
|
||||
module.help.files=
|
||||
|
||||
module.doc.name=.
|
||||
module.doc.type=
|
||||
module.doc.files=\
|
||||
AUTHORS\
|
||||
ChangeLog\
|
||||
COPYING\
|
||||
INSTALL\
|
||||
NEWS\
|
||||
README
|
||||
|
||||
module.po.files=
|
||||
|
||||
compiler.options.supports=
|
||||
compiler.options.include.paths=\
|
||||
.\
|
||||
..
|
||||
compiler.options.library.paths=
|
||||
compiler.options.libraries=
|
||||
compiler.options.libraries.selected=
|
||||
compiler.options.defines=\
|
||||
HAVE_CONFIG_H
|
||||
compiler.options.defines.selected=
|
||||
compiler.options.warning.buttons=0 0 1 1 0 1 0 0 0 0 0 0 0 1 0 0
|
||||
compiler.options.optimize.buttons=0 0 1 0
|
||||
compiler.options.other.buttons=1 0
|
||||
compiler.options.other.c.flags=
|
||||
compiler.options.other.l.flags=
|
||||
compiler.options.other.l.libs=
|
||||
|
||||
project.src.paths=
|
||||
+64
-1
@@ -2,4 +2,67 @@
|
||||
#
|
||||
# This file uses GNU Automake to generate makefiles
|
||||
|
||||
SUBDIRS = code
|
||||
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
|
||||
|
||||
+5
-1
@@ -1,4 +1,8 @@
|
||||
This file is required to keep autoconf/automake from complaining.
|
||||
The "projects" directory contains ready projects for:
|
||||
Microsoft Visual C++ 6
|
||||
Microsoft Visual C++ 2005
|
||||
Anjuta 1 (please see README with project before using)
|
||||
|
||||
|
||||
See the ChangeLog to see what's new.
|
||||
See the INSTALL file for instructions on how to build fs2_open.
|
||||
@@ -178,3 +178,205 @@ int main(int argc, char *argv[])
|
||||
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)
|
||||
])
|
||||
+68
-57
@@ -2,8 +2,43 @@
|
||||
# Run this to generate all the initial makefiles, etc.
|
||||
|
||||
srcdir=`dirname $0`
|
||||
PKG_NAME="the package."
|
||||
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 || {
|
||||
@@ -14,34 +49,38 @@ DIE=0
|
||||
DIE=1
|
||||
}
|
||||
|
||||
(grep "^AM_PROG_LIBTOOL" $srcdir/configure.ac >/dev/null) && {
|
||||
(libtool --version) < /dev/null > /dev/null 2>&1 || {
|
||||
echo
|
||||
echo "**Error**: You must have \`libtool' installed."
|
||||
echo "Get ftp://ftp.gnu.org/pub/gnu/"
|
||||
echo "(or a newer version if it is available)"
|
||||
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
|
||||
|
||||
(automake --version) < /dev/null > /dev/null 2>&1 || {
|
||||
if [ -z "$AUTOMAKE" ]; then
|
||||
echo
|
||||
echo "**Error**: You must have \`automake' installed."
|
||||
echo "Get ftp://ftp.gnu.org/pub/gnu/"
|
||||
echo "(or a newer version if it is available)"
|
||||
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
|
||||
NO_AUTOMAKE=yes
|
||||
}
|
||||
|
||||
fi
|
||||
|
||||
# if no automake, don't bother testing for aclocal
|
||||
test -n "$NO_AUTOMAKE" || (aclocal --version) < /dev/null > /dev/null 2>&1 || {
|
||||
echo
|
||||
echo "**Error**: Missing \`aclocal'. The version of \`automake'"
|
||||
echo "installed doesn't appear recent enough."
|
||||
echo "Get ftp://ftp.gnu.org/pub/gnu/"
|
||||
echo "(or a newer version if it is available)"
|
||||
DIE=1
|
||||
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
|
||||
@@ -77,39 +116,11 @@ do
|
||||
## echo "**Warning**: No such directory \`$k'. Ignored."
|
||||
fi
|
||||
done
|
||||
if grep "^AM_GNU_GETTEXT" configure.ac >/dev/null; then
|
||||
if grep "sed.*POTFILES" configure.ac >/dev/null; then
|
||||
: do nothing -- we still have an old unmodified configure.ac
|
||||
else
|
||||
echo "Creating $dr/aclocal.m4 ..."
|
||||
test -r $dr/aclocal.m4 || touch $dr/aclocal.m4
|
||||
echo "Running gettextize... Ignore non-fatal messages."
|
||||
./setup-gettext
|
||||
echo "Making $dr/aclocal.m4 writable ..."
|
||||
test -r $dr/aclocal.m4 && chmod u+w $dr/aclocal.m4
|
||||
fi
|
||||
fi
|
||||
if grep "^AM_GNOME_GETTEXT" configure.ac >/dev/null; then
|
||||
echo "Creating $dr/aclocal.m4 ..."
|
||||
test -r $dr/aclocal.m4 || touch $dr/aclocal.m4
|
||||
echo "Running gettextize... Ignore non-fatal messages."
|
||||
./setup-gettext
|
||||
echo "Making $dr/aclocal.m4 writable ..."
|
||||
test -r $dr/aclocal.m4 && chmod u+w $dr/aclocal.m4
|
||||
fi
|
||||
if grep "^AM_PROG_LIBTOOL" configure.ac >/dev/null; then
|
||||
echo "Running libtoolize..."
|
||||
libtoolize --force --copy
|
||||
fi
|
||||
echo "Running aclocal $aclocalinclude ..."
|
||||
aclocal $aclocalinclude
|
||||
if grep "^AM_CONFIG_HEADER" configure.ac >/dev/null; then
|
||||
echo "Running autoheader..."
|
||||
autoheader
|
||||
fi
|
||||
echo "Running automake --gnu $am_opt ..."
|
||||
automake --add-missing --copy --gnu $am_opt
|
||||
echo "Running autoconf ..."
|
||||
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
|
||||
@@ -120,7 +131,7 @@ done
|
||||
if test x$NOCONFIGURE = x; then
|
||||
echo Running $srcdir/configure $conf_flags "$@" ...
|
||||
$srcdir/configure $conf_flags "$@" \
|
||||
&& echo Now type \`make\' to compile $PKG_NAME
|
||||
&& echo Now type \`make\' to compile $PKG_NAME.
|
||||
else
|
||||
echo Skipping configure process.
|
||||
fi
|
||||
+444
-146
@@ -1,172 +1,433 @@
|
||||
# code/Makefile.am for fs2_open
|
||||
#
|
||||
# $Id: Makefile.am,v 1.3 2004-05-24 04:10:03 taylor Exp $
|
||||
|
||||
if FS2_DEBUG
|
||||
noinst_PROGRAMS = fs2_open_d
|
||||
fs2_open_d_SOURCES = $(CODE_SOURCES)
|
||||
else
|
||||
noinst_PROGRAMS = fs2_open_r
|
||||
fs2_open_r_SOURCES = $(CODE_SOURCES)
|
||||
endif # FS2_DEBUG
|
||||
|
||||
LDADD =
|
||||
## code/Makefile.am for fs2_open
|
||||
##
|
||||
## $Id: Makefile.am,v 1.20 2005-07-18 03:37:35 taylor Exp $
|
||||
|
||||
|
||||
CODE_SOURCES = \
|
||||
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 \
|
||||
freespace2/freespace.cpp \
|
||||
freespace2/levelpaging.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/ai.cpp \
|
||||
ship/aibig.cpp \
|
||||
ship/aicode.cpp \
|
||||
ship/aigoals.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 \
|
||||
@@ -178,197 +439,234 @@ CODE_SOURCES = \
|
||||
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 \
|
||||
species_defs/species_defs.cpp
|
||||
|
||||
weapon/weapon.h
|
||||
|
||||
## conditional includes follow:
|
||||
|
||||
## joystic support sources
|
||||
if FS2_JOYSTICK
|
||||
|
||||
if FS2_OS_WIN32
|
||||
CODE_SOURCES += \
|
||||
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 # FS2_OS_WIN32
|
||||
endif
|
||||
|
||||
if FS2_OS_UNIX
|
||||
CODE_SOURCES += \
|
||||
JOY_SOURCES = \
|
||||
io/joy.h \
|
||||
io/joy-unix.cpp
|
||||
endif # FS2_OS_UNIX
|
||||
|
||||
endif # FS2_JOYSTICK
|
||||
endif
|
||||
|
||||
## networking support sources
|
||||
if FS2_NETWORKING
|
||||
CODE_SOURCES += \
|
||||
hud/hudobserver.cpp \
|
||||
irc/irc.cpp \
|
||||
network/fs2ox.cpp \
|
||||
network/multi.cpp \
|
||||
network/multimsgs.cpp \
|
||||
network/multiteamselect.cpp \
|
||||
network/multiui.cpp \
|
||||
network/multiutil.cpp \
|
||||
network/multi_campaign.cpp \
|
||||
network/multi_data.cpp \
|
||||
network/multi_dogfight.cpp \
|
||||
network/multi_endgame.cpp \
|
||||
network/multi_ingame.cpp \
|
||||
network/multi_kick.cpp \
|
||||
network/multi_log.cpp \
|
||||
network/multi_obj.cpp \
|
||||
network/multi_observer.cpp \
|
||||
network/multi_options.cpp \
|
||||
network/multi_pause.cpp \
|
||||
network/multi_pinfo.cpp \
|
||||
network/multi_ping.cpp \
|
||||
network/multi_pmsg.cpp \
|
||||
network/multi_rate.cpp \
|
||||
network/multi_respawn.cpp \
|
||||
network/multi_team.cpp \
|
||||
network/multi_voice.cpp \
|
||||
network/multi_xfer.cpp \
|
||||
network/psnet.cpp \
|
||||
network/psnet2.cpp \
|
||||
menuui/optionsmenumulti.cpp \
|
||||
missionui/chatbox.cpp \
|
||||
fs2open_pxo/Client.cpp \
|
||||
fs2open_pxo/TCP_Client.cpp \
|
||||
fs2open_pxo/TCP_Socket.cpp \
|
||||
fs2open_pxo/udpsocket.cpp
|
||||
|
||||
if FS2_OS_WIN32
|
||||
CODE_SOURCES += \
|
||||
network/stand_gui.cpp
|
||||
endif # FS2_OS_WIN32
|
||||
FS2_SOURCES += \
|
||||
network/multilag.cpp \
|
||||
network/stand_gui.cpp \
|
||||
network/stand_gui.h
|
||||
endif
|
||||
|
||||
if FS2_OS_UNIX
|
||||
CODE_SOURCES += \
|
||||
network/stand_gui-unix.cpp
|
||||
endif # FS2_OS_UNIX
|
||||
|
||||
endif # FS2_NETWORKING
|
||||
FS2_SOURCES += \
|
||||
network/stand_gui-unix.cpp \
|
||||
network/stand_gui.h
|
||||
endif
|
||||
|
||||
## sound support sources
|
||||
if FS2_SOUND
|
||||
CODE_SOURCES += \
|
||||
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/speech.cpp
|
||||
sound/fsspeech.h \
|
||||
sound/speech.cpp \
|
||||
sound/speech.h
|
||||
|
||||
if FS2_OS_WIN32
|
||||
CODE_SOURCES += \
|
||||
SOUND_SOURCES += \
|
||||
sound/dscap.cpp \
|
||||
sound/ds3d.cpp \
|
||||
sound/audiostr.cpp \
|
||||
sound/acm.cpp
|
||||
endif # FS2_OS_WIN32
|
||||
sound/dscap.h
|
||||
endif
|
||||
|
||||
if FS2_OS_UNIX
|
||||
CODE_SOURCES += \
|
||||
sound/audiostr-unix.cpp \
|
||||
sound/acm-unix.cpp
|
||||
endif # FS2_OS_UNIX
|
||||
|
||||
endif # FS2_SOUND
|
||||
endif
|
||||
|
||||
## Win32-specific sources
|
||||
if FS2_OS_WIN32
|
||||
CODE_SOURCES += \
|
||||
cutscene/movie.cpp \
|
||||
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 \
|
||||
glide/glide.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 \
|
||||
graphics/grdirectdraw.cpp \
|
||||
graphics/grglide.cpp \
|
||||
graphics/grglidetexture.cpp \
|
||||
osapi/monopub.h \
|
||||
osapi/osapi.cpp \
|
||||
osapi/osapi.h \
|
||||
osapi/osregistry.cpp \
|
||||
osapi/outwnd.cpp
|
||||
endif # FS2_OS_WIN32
|
||||
osapi/osregistry.h \
|
||||
osapi/outwnd.cpp \
|
||||
osapi/outwnd.h
|
||||
endif
|
||||
|
||||
## Unix-specific sources
|
||||
if FS2_OS_UNIX
|
||||
CODE_SOURCES += \
|
||||
io/xmouse.cpp \
|
||||
UNIX_SOURCES = \
|
||||
osapi/osapi_unix.cpp \
|
||||
osapi/osapi.h \
|
||||
osapi/osregistry_unix.cpp \
|
||||
osapi/osregistry.h \
|
||||
osapi/outwnd_unix.cpp \
|
||||
cutscene/movie.cpp \
|
||||
windows_stub/stubs.cpp
|
||||
endif # FS2_OS_UNIX
|
||||
|
||||
# Use devIL
|
||||
if FS2_DEVIL
|
||||
CODE_SOURCES += \
|
||||
openil/il_func.cpp
|
||||
endif # FS2_DEVIL
|
||||
|
||||
#if FS2_SPEECH
|
||||
#LDADD += \
|
||||
# -lFestival -lestools -lestbase -leststring -lncurses
|
||||
#endif
|
||||
|
||||
|
||||
if FS2_OS_WIN32
|
||||
## compiler flags
|
||||
# INCLUDES = -I.
|
||||
AM_CXXFLAGS = \
|
||||
-fexceptions \
|
||||
${DX8_INCLUDE} \
|
||||
${DEVIL_CFLAGS}
|
||||
|
||||
AM_LDFLAGS = \
|
||||
${DX8_LIB} \
|
||||
${DEVIL_LIBS}
|
||||
|
||||
## Win32 libraries needed
|
||||
LDADD += \
|
||||
-lgdi32 -lole32 -lwsock32 -lwinmm -lmsacm32 -lopengl32 \
|
||||
-lcomctl32 -lstrmiids -ldxguid -lddraw -ldinput
|
||||
osapi/outwnd.h \
|
||||
windows_stub/stubs.cpp \
|
||||
windows_stub/config.h
|
||||
endif
|
||||
|
||||
|
||||
if FS2_OS_UNIX
|
||||
## Unix compiler flags
|
||||
AM_CXXFLAGS = \
|
||||
-Wno-missing-braces -Wno-multichar -Wno-deprecated \
|
||||
${SDL_CFLAGS} \
|
||||
${OPENAL_CFLAGS} \
|
||||
${DEVIL_CFLAGS} \
|
||||
-fsigned-char -DNO_DIRECT3D -DUSE_OPENGL
|
||||
## libcode.a
|
||||
libcode_a_SOURCES = ${FS2_SOURCES} ${JOY_SOURCES} ${SOUND_SOURCES} \
|
||||
${WIN32_SOURCES} ${UNIX_SOURCES}
|
||||
|
||||
AM_LDFLAGS = \
|
||||
${OGL_LIBDIR} -lGL -lGLU \
|
||||
${SDL_LIBS} \
|
||||
${OPENAL_LIBS} \
|
||||
${DEVIL_LIBS}
|
||||
endif
|
||||
##
|
||||
## 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
|
||||
##
|
||||
###############################################################################
|
||||
@@ -1,67 +0,0 @@
|
||||
// Place all prepreprcoessor definitions that tuurn features on/off
|
||||
// into this file.
|
||||
// the purpose of this is to prevent what happens with FRED
|
||||
// when DECALS_ENABLED was added to code.lib
|
||||
|
||||
/*
|
||||
* $Logfile: /Freespace2/code/PreProcDefines.h $
|
||||
* $Revision: 1.5 $
|
||||
* $Date: 2004-12-05 22:01:11 $
|
||||
* $Author: bobboau $
|
||||
*
|
||||
*
|
||||
* $Log: not supported by cvs2svn $
|
||||
* Revision 1.4 2004/10/31 21:23:08 taylor
|
||||
* #define if !#defined, add USE_DEVIL and FS2_SPEECH commented out
|
||||
*
|
||||
* Revision 1.3 2004/10/06 22:02:53 Kazan
|
||||
* interface corruption fix - thanks taylor (MAX_BITMAPS upped to 7000)
|
||||
*
|
||||
* Revision 1.2 2004/08/20 05:13:07 Kazan
|
||||
* wakka wakka - fix minor booboo
|
||||
*
|
||||
* Revision 1.1 2004/08/11 05:06:17 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
|
||||
*
|
||||
*
|
||||
*/
|
||||
|
||||
#if !defined(_pre_proc_defs_h_)
|
||||
#define _pre_proc_defs_h_
|
||||
|
||||
#ifndef DECALS_ENABLED
|
||||
#define DECALS_ENABLED 1
|
||||
#endif
|
||||
|
||||
#ifndef HTL
|
||||
#define HTL 1
|
||||
#endif
|
||||
|
||||
#ifndef USE_OPENGL
|
||||
#define USE_OPENGL 1
|
||||
#endif
|
||||
|
||||
#ifndef MORE_SPECIES
|
||||
#define MORE_SPECIES 1
|
||||
#endif
|
||||
|
||||
#ifndef ENABLE_AUTO_PILOT
|
||||
#define ENABLE_AUTO_PILOT 1
|
||||
#endif
|
||||
|
||||
#ifndef _REPORT_MEM_LEAKS
|
||||
#define _REPORT_MEM_LEAKS 1
|
||||
#endif
|
||||
|
||||
|
||||
/*
|
||||
#ifndef USE_DEVIL
|
||||
#define USE_DEVIL 1
|
||||
#endif
|
||||
|
||||
#ifndef FS2_SPEECH
|
||||
#define FS2_SPEECH 1
|
||||
#endif
|
||||
*/
|
||||
|
||||
#endif // _pre_proc_defs_h_
|
||||
@@ -11,7 +11,7 @@
|
||||
// ai slots and linking them to ships.
|
||||
// See AiCode.cpp for the actual AI code.
|
||||
|
||||
#include "ship/ai.h"
|
||||
#include "ai/ai.h"
|
||||
#include "object/object.h"
|
||||
#include "ship/ship.h"
|
||||
|
||||
@@ -9,11 +9,58 @@
|
||||
|
||||
/*
|
||||
* $Logfile: /Freespace2/code/Ship/ai.h $
|
||||
* $Revision: 2.16 $
|
||||
* $Date: 2004-08-11 05:06:33 $
|
||||
* $Author: Kazan $
|
||||
* $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
|
||||
*
|
||||
@@ -214,7 +261,6 @@
|
||||
* $NoKeywords: $
|
||||
*/
|
||||
|
||||
#include "PreProcDefines.h"
|
||||
#ifndef _AI_H
|
||||
#define _AI_H
|
||||
|
||||
@@ -228,36 +274,35 @@ 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_PURSUIT (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
|
||||
|
||||
// Goober5000
|
||||
#define AIF_UNLOAD_PRIMARIES (1 << 25) // Fire primaries as fast as possible!
|
||||
#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_AVOID_SHOCKWAVE (AIF_AVOID_SHOCKWAVE_SHIP | AIF_AVOID_SHOCKWAVE_WEAPON)
|
||||
#define AIF_FORMATION (AIF_FORMATION_WING | AIF_FORMATION_OBJECT)
|
||||
|
||||
// dock_orient_and_approach() modes.
|
||||
@@ -292,13 +337,16 @@ struct object;
|
||||
#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.
|
||||
@@ -334,6 +382,8 @@ typedef struct ai_goal {
|
||||
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;
|
||||
@@ -346,11 +396,6 @@ typedef struct ai_goal {
|
||||
|
||||
} ai_goal;
|
||||
|
||||
#ifdef INF_BUILD
|
||||
#define MAX_AI_CLASSES 30
|
||||
#else
|
||||
#define MAX_AI_CLASSES 10
|
||||
#endif
|
||||
#define MAX_GOAL_SHIP_NAMES 100
|
||||
|
||||
#define AIM_CHASE 0
|
||||
@@ -389,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
|
||||
@@ -429,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
|
||||
@@ -473,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;
|
||||
@@ -499,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;
|
||||
|
||||
@@ -535,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.
|
||||
@@ -556,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.
|
||||
@@ -567,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.
|
||||
@@ -583,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.
|
||||
|
||||
@@ -630,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.
|
||||
@@ -651,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;
|
||||
|
||||
@@ -680,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;
|
||||
@@ -723,14 +769,14 @@ extern void ai_attack_object(object *attacker, object *attacked, int priority, s
|
||||
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, int sexp_flags = 0);
|
||||
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
|
||||
@@ -739,29 +785,27 @@ 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);
|
||||
|
||||
@@ -769,15 +813,15 @@ extern void create_model_path(object *pl_objp, object *mobjp, int path_num, int
|
||||
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();
|
||||
@@ -786,22 +830,21 @@ extern int might_collide_with_ship(object *obj1, object *obj2, float dot_to_enem
|
||||
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, 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 );
|
||||
|
||||
@@ -816,7 +859,10 @@ int get_nearest_objnum(int objnum, int enemy_team_mask, int enemy_wing, float ra
|
||||
void ai_announce_ship_dying(object *dying_objp);
|
||||
|
||||
// added by kazan
|
||||
void ai_start_fly_to_ship(object *objp, char *target_obj);
|
||||
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,45 @@
|
||||
|
||||
/*
|
||||
* $Logfile: /Freespace2/code/Ship/AiBig.cpp $
|
||||
* $Revision: 2.11 $
|
||||
* $Date: 2004-11-27 10:49:14 $
|
||||
* $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
|
||||
*
|
||||
@@ -374,7 +406,7 @@
|
||||
* $NoKeywords: $
|
||||
*/
|
||||
|
||||
#include "ship/aibig.h"
|
||||
#include "ai/aibig.h"
|
||||
#include "globalincs/linklist.h"
|
||||
#include "object/object.h"
|
||||
#include "ship/ship.h"
|
||||
@@ -417,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, int modelnum);
|
||||
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.
|
||||
@@ -431,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;
|
||||
@@ -475,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));
|
||||
|
||||
@@ -508,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);
|
||||
|
||||
@@ -549,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;
|
||||
@@ -569,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);
|
||||
@@ -596,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);
|
||||
@@ -610,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) {
|
||||
@@ -640,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);
|
||||
|
||||
@@ -661,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) {
|
||||
@@ -730,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);
|
||||
@@ -747,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);
|
||||
@@ -816,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();
|
||||
@@ -875,7 +908,7 @@ 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, int modelnum)
|
||||
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;
|
||||
@@ -893,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);
|
||||
@@ -932,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;
|
||||
@@ -945,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);
|
||||
@@ -962,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 {
|
||||
@@ -1000,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);
|
||||
|
||||
@@ -1009,7 +1042,7 @@ 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;
|
||||
@@ -1018,12 +1051,12 @@ void ai_big_maybe_fire_weapons(float dist_to_enemy, float dot_to_enemy, vector *
|
||||
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];
|
||||
@@ -1033,7 +1066,7 @@ 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){
|
||||
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;
|
||||
@@ -1072,7 +1105,7 @@ void ai_big_maybe_fire_weapons(float dist_to_enemy, float dot_to_enemy, vector *
|
||||
if (swip->wi_flags2 & WIF2_LOCAL_SSM)
|
||||
firing_range=swip->lssm_lock_range;
|
||||
else
|
||||
firing_range= swip->max_speed * swip->lifetime;
|
||||
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) {
|
||||
@@ -1122,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);
|
||||
|
||||
@@ -1164,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;
|
||||
}
|
||||
}
|
||||
@@ -1249,6 +1283,7 @@ void ai_big_chase()
|
||||
default:
|
||||
aip->last_attack_time = Missiontime;
|
||||
aip->submode = SM_ATTACK;
|
||||
aip->submode_start_time = Missiontime;
|
||||
break;
|
||||
}
|
||||
|
||||
@@ -1282,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
|
||||
@@ -1305,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);
|
||||
@@ -1364,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;
|
||||
@@ -1377,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;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1394,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;
|
||||
}
|
||||
|
||||
//
|
||||
@@ -1424,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];
|
||||
@@ -1461,7 +1496,7 @@ 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;
|
||||
vec3d gun_pos, pnt;
|
||||
polymodel *po = model_get( shipp->modelnum );
|
||||
float weapon_speed;
|
||||
|
||||
@@ -1483,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;
|
||||
@@ -1499,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))
|
||||
|
||||
@@ -1521,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
|
||||
@@ -1543,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;
|
||||
|
||||
@@ -1646,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;
|
||||
|
||||
@@ -1673,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];
|
||||
|
||||
@@ -1919,26 +1954,20 @@ 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];
|
||||
|
||||
// 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 ( Weapon_info[weapon_objp->instance].wi_flags & WIF_BEAM ) {
|
||||
// Approx 1/4 chance we'll go after the beam
|
||||
if (frand()*100 > 25.0f) {
|
||||
if ( (parent_objp->signature != weapon_objp->parent_sig) || (parent_objp->type != OBJ_SHIP) ) {
|
||||
return;
|
||||
}
|
||||
|
||||
if ( aip->target_objnum != OBJ_INDEX(parent_objp) ) {
|
||||
return;
|
||||
}
|
||||
}
|
||||
} else { // everything that's not a beam is handled the original way
|
||||
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;
|
||||
}
|
||||
@@ -9,13 +9,22 @@
|
||||
|
||||
/*
|
||||
* $Logfile: /Freespace2/code/Ship/AiBig.h $
|
||||
* $Revision: 2.2 $
|
||||
* $Date: 2004-08-11 05:06:34 $
|
||||
* $Author: Kazan $
|
||||
* $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
|
||||
@@ -74,13 +83,12 @@
|
||||
* $NoKeywords: $
|
||||
*/
|
||||
|
||||
#include "PreProcDefines.h"
|
||||
#ifndef __AIBIG_H__
|
||||
#define __AIBIG_H__
|
||||
|
||||
struct object;
|
||||
struct ai_info;
|
||||
struct vector;
|
||||
struct vec3d;
|
||||
struct ship_subsys;
|
||||
|
||||
void ai_big_ship(object *objp);
|
||||
@@ -91,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
@@ -9,13 +9,100 @@
|
||||
|
||||
/*
|
||||
* $Logfile: /Freespace2/code/Ship/AiGoals.cpp $
|
||||
* $Revision: 2.16 $
|
||||
* $Date: 2004-12-14 14:46:12 $
|
||||
* $Revision: 1.12 $
|
||||
* $Date: 2005-08-31 08:11:58 $
|
||||
* $Author: Goober5000 $
|
||||
*
|
||||
* File to deal with manipulating AI goals, etc.
|
||||
*
|
||||
* $Log: not supported by cvs2svn $
|
||||
* Revision 1.11 2005/08/31 08:09:51 Goober5000
|
||||
* All wings will now form on their respective leaders, not just certain starting wings.
|
||||
* If this breaks anything, the old code is commented out. You know who to yell at. ;)
|
||||
* --Goober5000
|
||||
*
|
||||
* Revision 1.10 2005/08/31 07:54:33 Goober5000
|
||||
* Wings will now form on their leader, not necessarily the player. This is to
|
||||
* account for cases where the player is not the leader of his wing. It has the
|
||||
* side effect of causing wings that arrive later in the mission to form on *their*
|
||||
* leader rather than the player, but this is probably the preferred behavior (at
|
||||
* least judging from Mike Kulas's comment of 5/9/98). This does create a
|
||||
* difference from retail AI, but it should be only cosmetic, since ships only form
|
||||
* on a wing until they are ordered (via comm or sexp) to do something else.
|
||||
* --Goober5000
|
||||
*
|
||||
* Revision 1.9 2005/08/23 09:18:08 Goober5000
|
||||
* ensure init/reset of goals works cleanly
|
||||
* --Goober5000
|
||||
*
|
||||
* Revision 1.8 2005/08/23 09:03:56 Goober5000
|
||||
* fix for bug 519
|
||||
* --Goober5000
|
||||
*
|
||||
* Revision 1.7 2005/07/27 18:27:49 Goober5000
|
||||
* verified that submode_start_time is updated whenever submode is changed
|
||||
* --Goober5000
|
||||
*
|
||||
* 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/23 18:38:47 Goober5000
|
||||
* fixed a rare but ugly (though amusing) bug
|
||||
* --Goober5000
|
||||
*
|
||||
* Revision 1.4 2005/07/22 10:18:36 Goober5000
|
||||
* CVS header tweaks
|
||||
* --Goober5000
|
||||
*
|
||||
* Revision 1.3 2005/07/13 02:50:48 Goober5000
|
||||
* remove PreProcDefine #includes in FS2
|
||||
* --Goober5000
|
||||
*
|
||||
* Revision 1.2 2005/05/11 11:38:03 Goober5000
|
||||
* fixed a docking bug
|
||||
* --Goober5000
|
||||
*
|
||||
* 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.24 2005/03/02 21:24:47 taylor
|
||||
* more network/inferno goodness for Windows, takes care of a few warnings too
|
||||
*
|
||||
* Revision 2.23 2005/01/31 10:34:39 taylor
|
||||
* merge with Linux/OSX tree - p0131
|
||||
*
|
||||
* Revision 2.22 2005/01/26 05:44:10 Goober5000
|
||||
* AHA... squashed another bug
|
||||
* --Goober5000
|
||||
*
|
||||
* Revision 2.21 2005/01/18 00:14:36 Goober5000
|
||||
* clarified a bunch of sexp stuff and fixed a bug
|
||||
* --Goober5000
|
||||
*
|
||||
* Revision 2.20 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.19 2005/01/13 01:10:33 Goober5000
|
||||
* forgot to remove a comment
|
||||
* --Goober5000
|
||||
*
|
||||
* Revision 2.18 2005/01/12 23:38:42 Goober5000
|
||||
* fixed another nasty bug
|
||||
* --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/12/14 14:46:12 Goober5000
|
||||
* allow different wing names than ABGDEZ
|
||||
* --Goober5000
|
||||
*
|
||||
* Revision 2.15 2004/07/26 20:47:51 Kazan
|
||||
* remove MCD complete
|
||||
*
|
||||
@@ -460,7 +547,7 @@
|
||||
* goal vs. ship type validity
|
||||
*
|
||||
* 91 8/12/97 9:58a Hoffoss
|
||||
* Fixed ai_update_goal_references() and query_referended_in_ai_goals().
|
||||
* Fixed ai_update_goal_references() and query_referenced_in_ai_goals().
|
||||
*
|
||||
* 90 8/12/97 8:01a Allender
|
||||
* when adding goals to wing structures, replace the oldest entry of the
|
||||
@@ -529,7 +616,8 @@
|
||||
* $NoKeywords: $
|
||||
*/
|
||||
|
||||
#include "ship/aigoals.h"
|
||||
|
||||
#include "ai/aigoals.h"
|
||||
#include "parse/sexp.h"
|
||||
#include "mission/missionlog.h"
|
||||
#include "mission/missionparse.h"
|
||||
@@ -540,8 +628,7 @@
|
||||
#include "network/multi.h"
|
||||
#include "ship/ship.h"
|
||||
#include "weapon/weapon.h"
|
||||
|
||||
// memory tracking - ALWAYS INCLUDE LAST
|
||||
#include "object/objectdock.h"
|
||||
|
||||
|
||||
// all ai goals dealt with in this code are goals that are specified through
|
||||
@@ -615,28 +702,37 @@ char *Ai_goal_text(int goal)
|
||||
|
||||
// function to maybe add the form on my wing goal for a player's starting wing. Called from below and when a
|
||||
// player wing arrives.
|
||||
// Goober5000 - made more generic
|
||||
void ai_maybe_add_form_goal( wing *wingp )
|
||||
{
|
||||
int j;
|
||||
char *wing_leader;
|
||||
|
||||
// Goober5000 - the wing leader is now not necessarily the player
|
||||
wing_leader = Ships[wingp->ship_index[wingp->special_ship]].ship_name;
|
||||
|
||||
// iterate through the ship_index list of this wing and check for orders. We will do
|
||||
// this for all ships in the wing instead of on a wing only basis in cases some ships
|
||||
// this for all ships in the wing instead of on a wing only basis in case some ships
|
||||
// in the wing actually have different orders than others
|
||||
for ( j = 0; j < wingp->current_count; j++ ) {
|
||||
ai_info *aip;
|
||||
|
||||
Assert( wingp->ship_index[j] != -1 ); // get Allender
|
||||
|
||||
// don't process wing leader
|
||||
if (j == wingp->special_ship)
|
||||
continue;
|
||||
|
||||
aip = &Ai_info[Ships[wingp->ship_index[j]].ai_index];
|
||||
|
||||
// don't process Player_ship
|
||||
if ( aip == Player_ai )
|
||||
continue;
|
||||
|
||||
// it is sufficient enough to check the first goal entry to see if it has a valid
|
||||
// goal
|
||||
// it is sufficient enough to check the first goal entry to see if it has a valid goal
|
||||
if ( aip->goals[0].ai_mode == AI_GOAL_NONE ) {
|
||||
// need to add a form on my wing goal here. Ships are always forming on the player's wing.
|
||||
ai_add_ship_goal_player( AIG_TYPE_PLAYER_SHIP, AI_GOAL_FORM_ON_WING, -1, Player_ship->ship_name, aip );
|
||||
// need to add a form on my wing goal here
|
||||
ai_add_ship_goal_player( AIG_TYPE_PLAYER_SHIP, AI_GOAL_FORM_ON_WING, -1, wing_leader, aip );
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -651,7 +747,15 @@ void ai_post_process_mission()
|
||||
// (2) if they have an order, they are free to act on it.
|
||||
//
|
||||
// So basically, we are checking for (1)
|
||||
if ( !Fred_running ) {
|
||||
if ( !Fred_running )
|
||||
{
|
||||
// Goober5000 - make all wings form on their respective leaders
|
||||
for ( i = 0; i < num_wings; i++ )
|
||||
{
|
||||
ai_maybe_add_form_goal( &Wings[i] );
|
||||
}
|
||||
|
||||
/*
|
||||
for ( i = 0; i < 1; i++ ) { // MK, 5/9/98: Used to iterate through MAX_STARTING_WINGS, but this was too many ships forming on player.
|
||||
if ( Starting_wings[i] != -1 ) {
|
||||
wing *wingp;
|
||||
@@ -662,6 +766,7 @@ void ai_post_process_mission()
|
||||
|
||||
}
|
||||
}
|
||||
*/
|
||||
}
|
||||
|
||||
// for every valid ship object, call process_mission_orders to be sure that ships start the
|
||||
@@ -788,6 +893,7 @@ void ai_remove_ship_goal( ai_info *aip, int index )
|
||||
aip->goals[index].signature = -1;
|
||||
aip->goals[index].priority = -1;
|
||||
aip->goals[index].flags = 0; // must reset the flags since not doing so will screw up goal sorting.
|
||||
|
||||
if ( index == aip->active_goal )
|
||||
aip->active_goal = AI_GOAL_NONE;
|
||||
|
||||
@@ -809,7 +915,7 @@ void ai_clear_ship_goals( ai_info *aip )
|
||||
// Dont reset player ai (and hence target)
|
||||
// Goober5000 - account for player ai
|
||||
//if ( !((Player_ship != NULL) && (&Ships[aip->shipnum] == Player_ship)) || Player_use_ai ) {
|
||||
if ( Player_ship == NULL || Player_use_ai || &Ships[aip->shipnum] != Player_ship)
|
||||
if ( (Player_ship == NULL) || (&Ships[aip->shipnum] != Player_ship) || Player_use_ai )
|
||||
{
|
||||
ai_do_default_behavior( &Objects[Ships[aip->shipnum].objnum] );
|
||||
}
|
||||
@@ -835,6 +941,7 @@ void ai_clear_wing_goals( int wingnum )
|
||||
wingp->ai_goals[i].ai_mode = AI_GOAL_NONE;
|
||||
wingp->ai_goals[i].signature = -1;
|
||||
wingp->ai_goals[i].priority = -1;
|
||||
wingp->ai_goals[i].flags = 0;
|
||||
}
|
||||
|
||||
|
||||
@@ -894,6 +1001,7 @@ void ai_mission_wing_goal_complete( int wingnum, ai_goal *remove_goalp )
|
||||
wingp->ai_goals[i].ai_mode = AI_GOAL_NONE;
|
||||
wingp->ai_goals[i].signature = -1;
|
||||
wingp->ai_goals[i].priority = -1;
|
||||
wingp->ai_goals[i].flags = 0;
|
||||
break;
|
||||
}
|
||||
}
|
||||
@@ -1038,13 +1146,61 @@ void ai_goal_purge_all_invalid_goals( ai_goal *aigp )
|
||||
ai_goal_purge_invalid_goals( aigp, Wings[i].ai_goals );
|
||||
}
|
||||
|
||||
// Goober5000
|
||||
int ai_goal_find_dockpoint(int shipnum, int dock_type)
|
||||
{
|
||||
int dock_index = -1;
|
||||
int loop_count = 0;
|
||||
|
||||
ship *shipp = &Ships[shipnum];
|
||||
object *objp = &Objects[shipp->objnum];
|
||||
|
||||
// only check 100 points for sanity's sake
|
||||
while (loop_count < 100)
|
||||
{
|
||||
dock_index = model_find_dock_index(shipp->modelnum, dock_type, dock_index+1);
|
||||
|
||||
// not found?
|
||||
if (dock_index == -1)
|
||||
{
|
||||
if (loop_count == 0)
|
||||
{
|
||||
// first time around... there are no slots fitting this description
|
||||
return -1;
|
||||
}
|
||||
else
|
||||
{
|
||||
// every slot is full
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
// we've found something... check if it's occupied
|
||||
if (dock_find_object_at_dockpoint(objp, dock_index) == NULL)
|
||||
{
|
||||
// not occupied... yay, we've found an index
|
||||
return dock_index;
|
||||
}
|
||||
|
||||
// keep track
|
||||
loop_count++;
|
||||
}
|
||||
|
||||
// insanity?
|
||||
if (loop_count >= 100)
|
||||
Warning(LOCATION, "Too many iterations while looking for a dockpoint on %s. Either there was a bug or this is an übership.\n", shipp->ship_name);
|
||||
|
||||
// if we're here, just return the first dockpoint
|
||||
return model_find_dock_index(shipp->modelnum, dock_type);
|
||||
}
|
||||
|
||||
// function to fix up dock point references for objects.
|
||||
// passed are the pointer to goal we are working with. aip if the ai_info pointer
|
||||
// of the ship with the order. aigp is a pointer to the goal (of aip) of which we are
|
||||
// fixing up the docking points
|
||||
void ai_goal_fixup_dockpoints(ai_info *aip, ai_goal *aigp)
|
||||
{
|
||||
int shipnum, dockee_index, docker_index;
|
||||
int shipnum, docker_index, dockee_index;
|
||||
|
||||
Assert ( aip->shipnum != -1 );
|
||||
shipnum = ship_name_lookup( aigp->ship_name );
|
||||
@@ -1052,24 +1208,23 @@ void ai_goal_fixup_dockpoints(ai_info *aip, ai_goal *aigp)
|
||||
dockee_index = -1;
|
||||
|
||||
// look for docking points of the appriopriate type. Use cargo docks for cargo ships.
|
||||
// use
|
||||
if ( Ship_info[Ships[shipnum].ship_info_index].flags & SIF_CARGO ) {
|
||||
docker_index = model_find_dock_index(Ships[aip->shipnum].modelnum, DOCK_TYPE_CARGO );
|
||||
dockee_index = model_find_dock_index(Ships[shipnum].modelnum, DOCK_TYPE_CARGO );
|
||||
} else if ( Ship_info[Ships[aip->shipnum].ship_info_index].flags & SIF_SUPPORT ) {
|
||||
docker_index = model_find_dock_index( Ships[aip->shipnum].modelnum, DOCK_TYPE_REARM );
|
||||
dockee_index = model_find_dock_index( Ships[shipnum].modelnum, DOCK_TYPE_REARM );
|
||||
if (Ship_info[Ships[shipnum].ship_info_index].flags & SIF_CARGO) {
|
||||
docker_index = ai_goal_find_dockpoint(aip->shipnum, DOCK_TYPE_CARGO);
|
||||
dockee_index = ai_goal_find_dockpoint(shipnum, DOCK_TYPE_CARGO);
|
||||
} else if (Ship_info[Ships[aip->shipnum].ship_info_index].flags & SIF_SUPPORT) {
|
||||
docker_index = ai_goal_find_dockpoint(aip->shipnum, DOCK_TYPE_REARM);
|
||||
dockee_index = ai_goal_find_dockpoint(shipnum, DOCK_TYPE_REARM);
|
||||
}
|
||||
|
||||
// if we didn't find dockpoints above, then we should just look for generic docking points
|
||||
if ( docker_index == -1 )
|
||||
docker_index = model_find_dock_index(Ships[aip->shipnum].modelnum, DOCK_TYPE_GENERIC );
|
||||
docker_index = ai_goal_find_dockpoint(aip->shipnum, DOCK_TYPE_GENERIC);
|
||||
if ( dockee_index == -1 )
|
||||
dockee_index = model_find_dock_index(Ships[shipnum].modelnum, DOCK_TYPE_GENERIC );
|
||||
dockee_index = ai_goal_find_dockpoint(shipnum, DOCK_TYPE_GENERIC);
|
||||
|
||||
aigp->docker.index = docker_index;
|
||||
aigp->dockee.index = dockee_index;
|
||||
aigp->flags &= ~(AIGF_DOCKER_NAME_VALID | AIGF_DOCKEE_NAME_VALID);
|
||||
aigp->flags |= AIGF_DOCK_INDEXES_VALID;
|
||||
}
|
||||
|
||||
// these functions deal with adding goals sent from the player. They are slightly different
|
||||
@@ -1111,27 +1266,36 @@ void ai_add_goal_sub_player(int type, int mode, int submode, char *shipname, ai_
|
||||
aigp->priority = PLAYER_PRIORITY_SHIP;
|
||||
}
|
||||
|
||||
int ai_goal_find_empty_slot( ai_goal *goals )
|
||||
// Goober5000 - Modified this function for clarity and to avoid returning the active goal's index
|
||||
// as the empty slot. This avoids overwriting the active goal while it's being executed. So far
|
||||
// the only time I've noticed it being a problem is during a rare situation where more than five
|
||||
// friendlies want to rearm at the same time. The support ship forgets what it's doing and flies
|
||||
// off to repair somebody while still docked. I reproduced this with retail, so it's not a bug in
|
||||
// my new docking code. :)
|
||||
int ai_goal_find_empty_slot( ai_goal *goals, int active_goal )
|
||||
{
|
||||
int gindex, empty_index, oldest_index;
|
||||
int gindex, oldest_index;
|
||||
|
||||
empty_index = -1;
|
||||
oldest_index = 0;
|
||||
for ( gindex = 0; gindex < MAX_AI_GOALS; gindex++ ) {
|
||||
if ( goals[gindex].time < goals[oldest_index].time )
|
||||
oldest_index = -1;
|
||||
for ( gindex = 0; gindex < MAX_AI_GOALS; gindex++ )
|
||||
{
|
||||
// get the index for the first unused goal
|
||||
if (goals[gindex].ai_mode == AI_GOAL_NONE)
|
||||
return gindex;
|
||||
|
||||
// if this is the active goal, don't consider it for pre-emption!!
|
||||
if (gindex == active_goal)
|
||||
continue;
|
||||
|
||||
// store the index of the oldest goal
|
||||
if (oldest_index < 0)
|
||||
oldest_index = gindex;
|
||||
else if (goals[gindex].time < goals[oldest_index].time)
|
||||
oldest_index = gindex;
|
||||
|
||||
if ( (empty_index == -1) && (goals[gindex].ai_mode == AI_GOAL_NONE) ) // get the index for this goal
|
||||
empty_index = gindex;
|
||||
}
|
||||
|
||||
// if we didn't find an empty slot, find the oldest goal and use it's slot
|
||||
if ( empty_index == -1 )
|
||||
empty_index = oldest_index;
|
||||
|
||||
Assert ( empty_index < MAX_AI_GOALS );
|
||||
|
||||
return empty_index;
|
||||
// if we didn't find an empty slot, use the oldest goal's slot
|
||||
return oldest_index;
|
||||
}
|
||||
|
||||
// adds a goal from a player to the given ship's ai_info structure. 'type' tells us if goal
|
||||
@@ -1143,7 +1307,7 @@ void ai_add_ship_goal_player( int type, int mode, int submode, char *shipname, a
|
||||
int empty_index;
|
||||
ai_goal *aigp;
|
||||
|
||||
empty_index = ai_goal_find_empty_slot( aip->goals );
|
||||
empty_index = ai_goal_find_empty_slot( aip->goals, aip->active_goal );
|
||||
|
||||
// get a pointer to the goal structure
|
||||
aigp = &aip->goals[empty_index];
|
||||
@@ -1182,13 +1346,13 @@ void ai_add_wing_goal_player( int type, int mode, int submode, char *shipname, i
|
||||
// add the sexpression index into the wing's list of goal sexpressions if
|
||||
// there are more waves to come. We use the same method here as when adding a goal to
|
||||
// a ship -- find the first empty entry. If none exists, take the oldest entry and replace it.
|
||||
empty_index = ai_goal_find_empty_slot( wingp->ai_goals );
|
||||
empty_index = ai_goal_find_empty_slot( wingp->ai_goals, -1 );
|
||||
ai_add_goal_sub_player( type, mode, submode, shipname, &wingp->ai_goals[empty_index] );
|
||||
}
|
||||
|
||||
|
||||
// common routine to add a sexpression mission goal to the appropriate goal structure.
|
||||
void ai_add_goal_sub_sexp( int sexp, int type, ai_goal *aigp )
|
||||
void ai_add_goal_sub_sexp( int sexp, int type, ai_goal *aigp, char *actor_name )
|
||||
{
|
||||
int n, node, dummy, op;
|
||||
char *text;
|
||||
@@ -1199,11 +1363,12 @@ void ai_add_goal_sub_sexp( int sexp, int type, ai_goal *aigp )
|
||||
|
||||
aigp->signature = Ai_goal_signature++;
|
||||
|
||||
aigp->ship_name = NULL;
|
||||
aigp->time = Missiontime;
|
||||
aigp->type = type;
|
||||
aigp->flags = 0;
|
||||
|
||||
op = find_operator( text );
|
||||
op = get_operator_const( text );
|
||||
|
||||
switch (op) {
|
||||
|
||||
@@ -1231,11 +1396,10 @@ void ai_add_goal_sub_sexp( int sexp, int type, ai_goal *aigp )
|
||||
case OP_AI_DESTROY_SUBSYS:
|
||||
aigp->ai_mode = AI_GOAL_DESTROY_SUBSYSTEM;
|
||||
aigp->ship_name = ai_get_goal_ship_name( CTEXT(CDR(node)), &aigp->ship_name_index );
|
||||
// store the name of the subsystem in the docker_name field for now -- this field must
|
||||
// get fixed up when the goal is valid since we need to locate the subsystem on the ship's
|
||||
// model.
|
||||
// store the name of the subsystem in the docker.name field for now -- this field must get
|
||||
// fixed up when the goal is valid since we need to locate the subsystem on the ship's model
|
||||
aigp->docker.name = ai_get_goal_ship_name(CTEXT(CDR(CDR(node))), &dummy);
|
||||
aigp->flags |= AIGF_SUBSYS_NAME_VALID;
|
||||
aigp->flags |= AIGF_SUBSYS_NEEDS_FIXUP;
|
||||
aigp->priority = atoi( CTEXT(CDR(CDR(CDR(node)))) );
|
||||
break;
|
||||
|
||||
@@ -1268,8 +1432,14 @@ void ai_add_goal_sub_sexp( int sexp, int type, ai_goal *aigp )
|
||||
break;
|
||||
|
||||
case OP_AI_UNDOCK:
|
||||
aigp->ship_name = NULL;
|
||||
aigp->priority = atoi( CTEXT(CDR(node)) );
|
||||
|
||||
// Goober5000 - optional undock with something
|
||||
if (CDR(CDR(node)) != -1)
|
||||
aigp->ship_name = ai_get_goal_ship_name( CTEXT(CDR(CDR(node))), &aigp->ship_name_index );
|
||||
else
|
||||
aigp->ship_name = NULL;
|
||||
|
||||
aigp->ai_mode = AI_GOAL_UNDOCK;
|
||||
aigp->ai_submode = AIS_UNDOCK_0;
|
||||
break;
|
||||
@@ -1284,7 +1454,7 @@ void ai_add_goal_sub_sexp( int sexp, int type, ai_goal *aigp )
|
||||
aigp->ship_name = ai_get_goal_ship_name( CTEXT(CDR(node)), &aigp->ship_name_index );
|
||||
aigp->docker.name = ai_add_dock_name(CTEXT(CDR(CDR(node))));
|
||||
aigp->dockee.name = ai_add_dock_name(CTEXT(CDR(CDR(CDR(node)))));
|
||||
aigp->flags |= ( AIGF_DOCKER_NAME_VALID | AIGF_DOCKEE_NAME_VALID );
|
||||
aigp->flags &= ~AIGF_DOCK_INDEXES_VALID;
|
||||
aigp->priority = atoi( CTEXT(CDR(CDR(CDR(CDR(node))))) );
|
||||
|
||||
aigp->ai_mode = AI_GOAL_DOCK;
|
||||
@@ -1397,6 +1567,18 @@ void ai_add_goal_sub_sexp( int sexp, int type, ai_goal *aigp )
|
||||
nprintf (("AI", "bashing sexpression priority of goal %s from %d to %d.\n", text, aigp->priority, PLAYER_PRIORITY_MIN-1));
|
||||
aigp->priority = PLAYER_PRIORITY_MIN-1;
|
||||
}
|
||||
|
||||
// Goober5000 - since none of the goals act on the actor,
|
||||
// don't assign the goal if the actor's goal target is itself
|
||||
if (aigp->ship_name != NULL && !strcmp(aigp->ship_name, actor_name))
|
||||
{
|
||||
// based on ai_remove_ship_goal, these seem to be the only statements
|
||||
// necessary to cause this goal to "never have been assigned"
|
||||
aigp->ai_mode = AI_GOAL_NONE;
|
||||
aigp->signature = -1;
|
||||
aigp->priority = -1;
|
||||
aigp->flags = 0;
|
||||
}
|
||||
}
|
||||
|
||||
// adds an ai goal for an individual ship
|
||||
@@ -1405,8 +1587,8 @@ void ai_add_ship_goal_sexp( int sexp, int type, ai_info *aip )
|
||||
{
|
||||
int gindex;
|
||||
|
||||
gindex = ai_goal_find_empty_slot( aip->goals );
|
||||
ai_add_goal_sub_sexp( sexp, type, &aip->goals[gindex] );
|
||||
gindex = ai_goal_find_empty_slot( aip->goals, aip->active_goal );
|
||||
ai_add_goal_sub_sexp( sexp, type, &aip->goals[gindex], Ships[aip->shipnum].ship_name );
|
||||
}
|
||||
|
||||
// code to add ai goals to wings.
|
||||
@@ -1415,7 +1597,7 @@ void ai_add_wing_goal_sexp(int sexp, int type, int wingnum)
|
||||
int i;
|
||||
wing *wingp = &Wings[wingnum];
|
||||
|
||||
// add the ai goal for any ship that is currently arrived in the game (only if fred isn't running
|
||||
// add the ai goal for any ship that is currently arrived in the game (only if fred isn't running)
|
||||
if ( !Fred_running ) {
|
||||
for (i = 0; i < wingp->current_count; i++) {
|
||||
int num = wingp->ship_index[i];
|
||||
@@ -1430,8 +1612,8 @@ void ai_add_wing_goal_sexp(int sexp, int type, int wingnum)
|
||||
if ((wingp->num_waves - wingp->current_wave > 0) || Fred_running) {
|
||||
int gindex;
|
||||
|
||||
gindex = ai_goal_find_empty_slot( wingp->ai_goals );
|
||||
ai_add_goal_sub_sexp( sexp, type, &wingp->ai_goals[gindex] );
|
||||
gindex = ai_goal_find_empty_slot( wingp->ai_goals, -1 );
|
||||
ai_add_goal_sub_sexp( sexp, type, &wingp->ai_goals[gindex], wingp->name );
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1449,9 +1631,18 @@ void ai_add_goal_ship_internal( ai_info *aip, int goal_type, char *name, int doc
|
||||
int gindex;
|
||||
ai_goal *aigp;
|
||||
|
||||
// find an empty slot to put this goal in.
|
||||
gindex = ai_goal_find_empty_slot( aip->goals );
|
||||
#ifndef NDEBUG
|
||||
// Goober5000 - none of the goals act on the actor, as in ai_add_goal_sub_sexp
|
||||
if (!strcmp(name, Ships[aip->shipnum].ship_name))
|
||||
{
|
||||
// not good
|
||||
Int3();
|
||||
return;
|
||||
}
|
||||
#endif
|
||||
|
||||
// find an empty slot to put this goal in.
|
||||
gindex = ai_goal_find_empty_slot( aip->goals, aip->active_goal );
|
||||
aigp = &(aip->goals[gindex]);
|
||||
|
||||
aigp->signature = Ai_goal_signature++;
|
||||
@@ -1461,6 +1652,8 @@ void ai_add_goal_ship_internal( ai_info *aip, int goal_type, char *name, int doc
|
||||
aigp->flags = AIGF_GOAL_OVERRIDE;
|
||||
|
||||
switch ( goal_type ) {
|
||||
|
||||
/* Goober5000 - this seems to not be used
|
||||
case AI_GOAL_DOCK:
|
||||
aigp->ship_name = name;
|
||||
aigp->docker.index = docker_point;
|
||||
@@ -1470,19 +1663,24 @@ void ai_add_goal_ship_internal( ai_info *aip, int goal_type, char *name, int doc
|
||||
aigp->ai_mode = AI_GOAL_DOCK;
|
||||
aigp->ai_submode = AIS_DOCK_0; // be sure to set the submode
|
||||
break;
|
||||
*/
|
||||
|
||||
case AI_GOAL_UNDOCK:
|
||||
aigp->ship_name = NULL;
|
||||
aigp->ship_name = name;
|
||||
aigp->priority = 100;
|
||||
aigp->ai_mode = AI_GOAL_UNDOCK;
|
||||
aigp->ai_submode = AIS_UNDOCK_0;
|
||||
break;
|
||||
|
||||
/* Goober5000 - this seems to not be used
|
||||
case AI_GOAL_GUARD:
|
||||
aigp->ai_mode = AI_GOAL_GUARD;
|
||||
if ( wing_name_lookup(name, 1) != -1 )
|
||||
aigp->ai_mode = AI_GOAL_GUARD_WING;
|
||||
else
|
||||
aigp->ai_mode = AI_GOAL_GUARD;
|
||||
aigp->priority = PLAYER_PRIORITY_MIN-1; // make the priority always less than what the player's is
|
||||
break;
|
||||
*/
|
||||
|
||||
case AI_GOAL_REARM_REPAIR:
|
||||
aigp->ai_mode = AI_GOAL_REARM_REPAIR;
|
||||
@@ -1495,7 +1693,7 @@ void ai_add_goal_ship_internal( ai_info *aip, int goal_type, char *name, int doc
|
||||
|
||||
default:
|
||||
Int3(); // unsupported internal goal -- see Mike K or Mark A.
|
||||
break;
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
@@ -1568,7 +1766,7 @@ int ai_mission_goal_achievable( int objnum, ai_goal *aigp )
|
||||
if (!(shipp->flags2 & SF2_NO_SUBSPACE_DRIVE))
|
||||
return AI_GOAL_ACHIEVABLE;
|
||||
|
||||
// if subspace drive, only valid if there's somewhere to depart to
|
||||
// if no subspace drive, only valid if there's somewhere to depart to
|
||||
|
||||
// locate a capital ship on the same team:
|
||||
if (ship_get_ship_with_dock_bay(shipp->team) >= 0)
|
||||
@@ -1638,9 +1836,9 @@ int ai_mission_goal_achievable( int objnum, ai_goal *aigp )
|
||||
// destroyed when shipnum is valid
|
||||
shipnum = ship_name_lookup( aigp->ship_name );
|
||||
|
||||
// can't determine the status of this goal if ship not valid or the subsystem
|
||||
// name *is* still valid (meaning we haven't found a valid index yet).
|
||||
if ( (shipnum == -1) || (aigp->flags & AIGF_SUBSYS_NAME_VALID) ) {
|
||||
// can't determine the status of this goal if ship not valid
|
||||
// or we haven't found a valid subsystem index yet
|
||||
if ( (shipnum == -1) || (aigp->flags & AIGF_SUBSYS_NEEDS_FIXUP) ) {
|
||||
status = 0;
|
||||
break;
|
||||
}
|
||||
@@ -1728,7 +1926,8 @@ int ai_mission_goal_achievable( int objnum, ai_goal *aigp )
|
||||
// determine the status of the shipname that this object is acting on. There are a couple of
|
||||
// special cases to deal with. Both the chase wing and undock commands will return from within
|
||||
// the if statement.
|
||||
if ( (aigp->ai_mode == AI_GOAL_CHASE_WING) || (aigp->ai_mode == AI_GOAL_GUARD_WING) ) {
|
||||
if ( (aigp->ai_mode == AI_GOAL_CHASE_WING) || (aigp->ai_mode == AI_GOAL_GUARD_WING) )
|
||||
{
|
||||
int num = wing_name_lookup( aigp->ship_name );
|
||||
wing *wingp = &Wings[num];
|
||||
|
||||
@@ -1738,16 +1937,32 @@ int ai_mission_goal_achievable( int objnum, ai_goal *aigp )
|
||||
return AI_GOAL_NOT_KNOWN;
|
||||
else
|
||||
return AI_GOAL_ACHIEVABLE;
|
||||
} else if ( aigp->ai_mode == AI_GOAL_UNDOCK ) {
|
||||
}
|
||||
// Goober5000 - undocking from an unspecified object is always achievable;
|
||||
// undocking from a specified object is handled below
|
||||
else if ( (aigp->ai_mode == AI_GOAL_UNDOCK) && (aigp->ship_name == NULL) )
|
||||
{
|
||||
return AI_GOAL_ACHIEVABLE;
|
||||
} else {
|
||||
}
|
||||
else
|
||||
{
|
||||
// goal ship is currently in mission
|
||||
if ( ship_name_lookup( aigp->ship_name ) != -1 )
|
||||
{
|
||||
status = SHIP_STATUS_ARRIVED;
|
||||
}
|
||||
// goal ship is still on the arrival list
|
||||
else if ( !mission_parse_ship_arrived(aigp->ship_name) )
|
||||
{
|
||||
status = SHIP_STATUS_NOT_ARRIVED;
|
||||
}
|
||||
// goal ship has left the area
|
||||
else if ( ship_find_exited_ship_by_name(aigp->ship_name) != -1 )
|
||||
{
|
||||
status = SHIP_STATUS_GONE;
|
||||
else {
|
||||
}
|
||||
else
|
||||
{
|
||||
Int3(); // get ALLENDER
|
||||
status = SHIP_STATUS_UNKNOWN;
|
||||
}
|
||||
@@ -1765,25 +1980,20 @@ int ai_mission_goal_achievable( int objnum, ai_goal *aigp )
|
||||
// this goal will get removed.
|
||||
if ( (aigp->ai_mode == AI_GOAL_DOCK) && (status == SHIP_STATUS_ARRIVED) ) {
|
||||
int index, modelnum, shipnum;
|
||||
char docker_name[NAME_LENGTH], dockee_name[NAME_LENGTH];
|
||||
|
||||
// debug code to save off the name of the dockpoints (if they exist).
|
||||
docker_name[0] = dockee_name[0] = '\0';
|
||||
if ( aigp->flags & AIGF_DOCKER_NAME_VALID ) {
|
||||
strcpy(docker_name, aigp->docker.name);
|
||||
if (!(aigp->flags & AIGF_DOCKER_INDEX_VALID)) {
|
||||
modelnum = Ships[objp->instance].modelnum;
|
||||
index = model_find_dock_name_index(modelnum, aigp->docker.name);
|
||||
aigp->docker.index = index;
|
||||
aigp->flags &= ~AIGF_DOCKER_NAME_VALID;
|
||||
aigp->flags |= AIGF_DOCKER_INDEX_VALID;
|
||||
}
|
||||
if ( aigp->flags & AIGF_DOCKEE_NAME_VALID ) {
|
||||
if (!(aigp->flags & AIGF_DOCKEE_INDEX_VALID)) {
|
||||
shipnum = ship_name_lookup(aigp->ship_name);
|
||||
if ( shipnum != -1 ) {
|
||||
strcpy(dockee_name, aigp->dockee.name);
|
||||
modelnum = Ships[shipnum].modelnum;
|
||||
index = model_find_dock_name_index(modelnum, aigp->dockee.name);
|
||||
aigp->dockee.index = index;
|
||||
aigp->flags &= ~AIGF_DOCKEE_NAME_VALID;
|
||||
aigp->flags |= AIGF_DOCKEE_INDEX_VALID;
|
||||
} else
|
||||
aigp->dockee.index = -1; // this will force code into if statement below making goal not achievable.
|
||||
}
|
||||
@@ -1792,56 +2002,78 @@ int ai_mission_goal_achievable( int objnum, ai_goal *aigp )
|
||||
return AI_GOAL_NOT_ACHIEVABLE;
|
||||
}
|
||||
|
||||
// we must also determine if this ship which is supposed to dock with something is currently
|
||||
// docked with something else. If so, then return the ON_HOLD until it is not docked anymore
|
||||
shipnum = ship_name_lookup(aigp->ship_name);
|
||||
Assert( shipnum != -1 );
|
||||
|
||||
// if ship is disabled, dont' know if it can dock or not
|
||||
// if ship is disabled, don't know if it can dock or not
|
||||
if ( Ships[objp->instance].flags & SF_DISABLED )
|
||||
return AI_GOAL_NOT_KNOWN;
|
||||
|
||||
// if the ship that I am supposed to dock with is docked with something else, then I need to put my
|
||||
// goal on hold
|
||||
// we must also determine if we're prevented from docking for any reason
|
||||
shipnum = ship_name_lookup(aigp->ship_name);
|
||||
Assert( shipnum != -1 );
|
||||
object *goal_objp = &Objects[Ships[shipnum].objnum];
|
||||
|
||||
// if the ship that I am supposed to dock with is docked with something else, then I need to put my goal on hold
|
||||
// [MK, 4/23/98: With Mark, we believe this fixes the problem of Comet refusing to warp out after docking with Omega.
|
||||
// This bug occurred only when mission goals were validated in the frame in which Comet docked, which happened about
|
||||
// once in 10-20 tries.]
|
||||
if ( Ai_info[Ships[shipnum].ai_index].ai_flags & AIF_DOCKED )
|
||||
if (aip->dock_objnum != Ships[shipnum].objnum)
|
||||
return AI_GOAL_NOT_KNOWN;
|
||||
|
||||
// if this ship is docked and needs to get docked with something else, then undock this
|
||||
// ship
|
||||
if ( aip->ai_flags & AIF_DOCKED ) {
|
||||
|
||||
// if we are trying to dock with a different ship, then force this ship to undock
|
||||
if ( aip->dock_objnum != Ships[shipnum].objnum ) {
|
||||
// if this goal isn't on hold yet, then issue the undock goal and return NOT_KNOWN
|
||||
// which will then place the goal on hold until the undocking is complete.
|
||||
if ( !(aigp->flags & AIGF_GOAL_ON_HOLD) )
|
||||
ai_add_goal_ship_internal( aip, AI_GOAL_UNDOCK, NULL, -1, -1, 0 );
|
||||
|
||||
return AI_GOAL_NOT_KNOWN;
|
||||
} else {
|
||||
// if this ship is already docked with the guy this order tells him to dock with,
|
||||
// then mark the goal as satisfied.
|
||||
// MWA 2/23/98 -- don't return anything. Since this item is a goal, the ai_dock code
|
||||
// should remove the goal!!!!
|
||||
//return AI_GOAL_SATISFIED;
|
||||
if ( object_is_docked(goal_objp) )
|
||||
{
|
||||
// if the dockpoint I need to dock to is occupied by someone other than me
|
||||
object *obstacle_objp = dock_find_object_at_dockpoint(goal_objp, aigp->dockee.index);
|
||||
if (obstacle_objp == NULL)
|
||||
{
|
||||
// nobody in the way... we're good
|
||||
}
|
||||
else if (obstacle_objp != objp)
|
||||
{
|
||||
// return NOT_KNOWN which will place the goal on hold until the dockpoint is clear
|
||||
return AI_GOAL_NOT_KNOWN;
|
||||
}
|
||||
}
|
||||
|
||||
// if this ship is docked and needs to get docked with something else, then undock this ship
|
||||
if ( object_is_docked(objp) )
|
||||
{
|
||||
// if the dockpoint I need to dock with is occupied by someone other than the guy I need to dock to
|
||||
object *obstacle_objp = dock_find_object_at_dockpoint(objp, aigp->docker.index);
|
||||
if (obstacle_objp == NULL)
|
||||
{
|
||||
// nobody in the way... we're good
|
||||
}
|
||||
else if (obstacle_objp != goal_objp)
|
||||
{
|
||||
// if this goal isn't on hold yet, then issue the undock goal
|
||||
if ( !(aigp->flags & AIGF_GOAL_ON_HOLD) )
|
||||
ai_add_goal_ship_internal( aip, AI_GOAL_UNDOCK, Ships[obstacle_objp->instance].ship_name, -1, -1, 0 );
|
||||
|
||||
// return NOT_KNOWN which will place the goal on hold until the undocking is complete.
|
||||
return AI_GOAL_NOT_KNOWN;
|
||||
}
|
||||
}
|
||||
|
||||
// Goober5000 - necessitated by the multiple ship docking
|
||||
} else if ( (aigp->ai_mode == AI_GOAL_UNDOCK) && (status == SHIP_STATUS_ARRIVED) ) {
|
||||
// Put this goal on hold if we're already undocking. Otherwise the new goal will pre-empt
|
||||
// the current goal and strange things might happen. One is that the object movement code
|
||||
// forgets the previous undocking and "re-docks" the previous goal's ship. Other problems
|
||||
// might happen too, so err on the safe side. (Yay for emergent paragraph justification!)
|
||||
if ((aip->mode == AIM_DOCK) && (aip->submode >= AIS_UNDOCK_0))
|
||||
{
|
||||
// only put it on hold if it's someone other than the guy we're undocking from right now!!
|
||||
if (aip->goal_objnum != Ships[ship_name_lookup(aigp->ship_name)].objnum)
|
||||
return AI_GOAL_NOT_KNOWN;
|
||||
}
|
||||
|
||||
} else if ( (aigp->ai_mode == AI_GOAL_DESTROY_SUBSYSTEM) && (status == SHIP_STATUS_ARRIVED) ) {
|
||||
// if the ship has arrived, and the goal is destroy subsystem, then check to see that we
|
||||
// have fixed up the subsystem name (of the subsystem to destroy) into an index into
|
||||
// the ship's subsystem list
|
||||
if ( aigp->flags & AIGF_SUBSYS_NAME_VALID ) {
|
||||
if ( aigp->flags & AIGF_SUBSYS_NEEDS_FIXUP ) {
|
||||
int shipnum;
|
||||
|
||||
shipnum = ship_name_lookup( aigp->ship_name );
|
||||
if ( shipnum != -1 ) {
|
||||
aigp->ai_submode = ship_get_subsys_index( &Ships[shipnum], aigp->docker.name );
|
||||
aigp->flags &= ~AIGF_SUBSYS_NAME_VALID;
|
||||
aigp->flags &= ~AIGF_SUBSYS_NEEDS_FIXUP;
|
||||
} else {
|
||||
Int3();
|
||||
return AI_GOAL_NOT_ACHIEVABLE; // force this goal to be invalid
|
||||
@@ -2048,7 +2280,7 @@ void validate_mission_goals(int objnum, ai_info *aip)
|
||||
|
||||
// if the active goal is a rearm/repair goal, the put all other valid goals (which are not repair goals)
|
||||
// on hold
|
||||
if ( (aip->goals[0].ai_mode == AI_GOAL_REARM_REPAIR) && (aip->ai_flags & AIF_DOCKED) ) {
|
||||
if ( (aip->goals[0].ai_mode == AI_GOAL_REARM_REPAIR) && object_is_docked(&Objects[objnum]) ) {
|
||||
for ( i = 1; i < MAX_AI_GOALS; i++ ) {
|
||||
if ( (aip->goals[i].ai_mode == AI_GOAL_NONE) || (aip->goals[i].ai_mode == AI_GOAL_REARM_REPAIR) )
|
||||
continue;
|
||||
@@ -2058,6 +2290,7 @@ void validate_mission_goals(int objnum, ai_info *aip)
|
||||
}
|
||||
|
||||
//XSTR:OFF
|
||||
/*
|
||||
static char *Goal_text[5] = {
|
||||
"EVENT_SHIP",
|
||||
"EVENT_WING",
|
||||
@@ -2065,6 +2298,7 @@ static char *Goal_text[5] = {
|
||||
"PLAYER_WING",
|
||||
"DYNAMIC",
|
||||
};
|
||||
*/
|
||||
//XSTR:ON
|
||||
|
||||
extern char *Mode_text[MAX_AI_BEHAVIORS];
|
||||
@@ -2142,8 +2376,7 @@ void ai_process_mission_orders( int objnum, ai_info *aip )
|
||||
|
||||
// Goober5000 - we may want to use AI for the player
|
||||
// AL 3-7-98: If this is a player ship, and the goal is not a formation goal, then do a quick out
|
||||
//if ( !(Player_use_ai) && (objp->flags & OF_PLAYER_SHIP) && (current_goal->ai_mode != AI_GOAL_FORM_ON_WING) ) {
|
||||
if ( !Player_use_ai && objp->flags & OF_PLAYER_SHIP)
|
||||
if ( !(Player_use_ai) && (objp->flags & OF_PLAYER_SHIP) && (current_goal->ai_mode != AI_GOAL_FORM_ON_WING) )
|
||||
{
|
||||
return;
|
||||
}
|
||||
@@ -2204,7 +2437,9 @@ void ai_process_mission_orders( int objnum, ai_info *aip )
|
||||
}
|
||||
|
||||
case AI_GOAL_FLY_TO_SHIP:
|
||||
ai_start_fly_to_ship(objp, current_goal->ship_name);
|
||||
shipnum = ship_name_lookup( current_goal->ship_name );
|
||||
Assert (shipnum != -1 ); // shouldn't get here if this is false!!!!
|
||||
ai_start_fly_to_ship(objp, shipnum);
|
||||
break;
|
||||
|
||||
case AI_GOAL_DOCK: {
|
||||
@@ -2214,10 +2449,8 @@ void ai_process_mission_orders( int objnum, ai_info *aip )
|
||||
|
||||
// be sure that we have indices for docking points here! If we ever had names, they should
|
||||
// get fixed up in goal_achievable so that the points can be checked there for validity
|
||||
Assert ( !(current_goal->flags & AIGF_DOCKER_NAME_VALID) );
|
||||
Assert ( !(current_goal->flags & AIGF_DOCKEE_NAME_VALID) );
|
||||
ai_dock_with_object( objp, other_obj, current_goal->priority, AIDO_DOCK, current_goal->docker.index, current_goal->dockee.index );
|
||||
aip->submode_start_time = Missiontime;
|
||||
Assert (current_goal->flags & AIGF_DOCK_INDEXES_VALID);
|
||||
ai_dock_with_object( objp, current_goal->docker.index, other_obj, current_goal->dockee.index, current_goal->priority, AIDO_DOCK );
|
||||
break;
|
||||
}
|
||||
|
||||
@@ -2225,7 +2458,42 @@ void ai_process_mission_orders( int objnum, ai_info *aip )
|
||||
// try to find the object which which this object is docked with. Use that object as the
|
||||
// "other object" for the undocking proceedure. If "other object" isn't found, then the undock
|
||||
// goal cannot continue. Spit out a warning and remove the goal.
|
||||
other_obj = ai_find_docked_object( objp );
|
||||
|
||||
// Goober5000 - do we have a specific ship to undock from?
|
||||
if ( current_goal->ship_name != NULL )
|
||||
{
|
||||
shipnum = ship_name_lookup( current_goal->ship_name );
|
||||
|
||||
// hmm, perhaps he was destroyed
|
||||
if (shipnum == -1)
|
||||
{
|
||||
other_obj = NULL;
|
||||
}
|
||||
// he exists... let's undock from him
|
||||
else
|
||||
{
|
||||
other_obj = &Objects[Ships[shipnum].objnum];
|
||||
}
|
||||
}
|
||||
// no specific ship
|
||||
else
|
||||
{
|
||||
// are we docked?
|
||||
if (object_is_docked(objp))
|
||||
{
|
||||
// just pick the first guy we're docked to
|
||||
other_obj = dock_get_first_docked_object( objp );
|
||||
|
||||
// and add the ship name so it displays on the HUD
|
||||
current_goal->ship_name = Ships[other_obj->instance].ship_name;
|
||||
}
|
||||
// hmm, nobody exists that we can undock from
|
||||
else
|
||||
{
|
||||
other_obj = NULL;
|
||||
}
|
||||
}
|
||||
|
||||
if ( other_obj == NULL ) {
|
||||
//Int3();
|
||||
// assume that the guy he was docked with doesn't exist anymore. (i.e. a cargo containuer
|
||||
@@ -2234,8 +2502,18 @@ void ai_process_mission_orders( int objnum, ai_info *aip )
|
||||
ai_mission_goal_complete( aip ); // mark as complete, so we can remove it and move on!!!
|
||||
break;
|
||||
}
|
||||
ai_dock_with_object( objp, other_obj, current_goal->priority, AIDO_UNDOCK, 0, 0 );
|
||||
aip->submode_start_time = Missiontime;
|
||||
|
||||
// Goober5000 - Sometimes a ship will be assigned a new goal before it can finish undocking. Later,
|
||||
// when the ship returns to this goal, it will try to resume undocking from a ship it's not attached
|
||||
// to. If this happens, remove the goal as above.
|
||||
if (!dock_check_find_direct_docked_object(objp, other_obj))
|
||||
{
|
||||
ai_mission_goal_complete( aip );
|
||||
break;
|
||||
}
|
||||
|
||||
// passing 0, 0 is okay because the undock code will figure out where to undock from
|
||||
ai_dock_with_object( objp, 0, other_obj, 0, current_goal->priority, AIDO_UNDOCK );
|
||||
break;
|
||||
|
||||
|
||||
@@ -2308,6 +2586,7 @@ void ai_process_mission_orders( int objnum, ai_info *aip )
|
||||
ai_clear_ship_goals( aip );
|
||||
aip->mode = AIM_PLAY_DEAD;
|
||||
aip->submode = -1;
|
||||
aip->submode_start_time = Missiontime;
|
||||
break;
|
||||
|
||||
case AI_GOAL_FORM_ON_WING:
|
||||
@@ -2341,7 +2620,7 @@ void ai_process_mission_orders( int objnum, ai_info *aip )
|
||||
case AI_GOAL_REARM_REPAIR:
|
||||
shipnum = ship_name_lookup( current_goal->ship_name );
|
||||
other_obj = &Objects[Ships[shipnum].objnum];
|
||||
ai_rearm_repair( objp, other_obj, current_goal->priority, current_goal->docker.index, current_goal->dockee.index );
|
||||
ai_rearm_repair( objp, current_goal->docker.index, other_obj, current_goal->dockee.index, current_goal->priority );
|
||||
break;
|
||||
|
||||
default:
|
||||
@@ -9,13 +9,19 @@
|
||||
|
||||
/*
|
||||
* $Logfile: /Freespace2/code/Ship/AiGoals.h $
|
||||
* $Revision: 2.6 $
|
||||
* $Date: 2004-08-11 05:06:34 $
|
||||
* $Author: Kazan $
|
||||
* $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
|
||||
*
|
||||
@@ -158,7 +164,6 @@
|
||||
* $NoKeywords: $
|
||||
*/
|
||||
|
||||
#include "PreProcDefines.h"
|
||||
#ifndef _AIGOALS_H
|
||||
#define _AIGOALS_H
|
||||
|
||||
@@ -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
|
||||
@@ -7,7 +7,6 @@
|
||||
*
|
||||
*/
|
||||
|
||||
#include "PreProcDefines.h"
|
||||
#ifndef _AILOCAL_H
|
||||
#define _AILOCAL_H
|
||||
|
||||
File diff suppressed because it is too large.
Load diff
@@ -9,13 +9,29 @@
|
||||
|
||||
/*
|
||||
* $Logfile: /Freespace2/code/Anim/AnimPlay.cpp $
|
||||
* $Revision: 2.13 $
|
||||
* $Date: 2004-12-20 20:18:30 $
|
||||
* $Author: fryday $
|
||||
* $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
|
||||
*
|
||||
@@ -438,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;
|
||||
@@ -686,7 +702,7 @@ 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
|
||||
BM_SELECT_TEX_FORMAT();
|
||||
@@ -708,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;
|
||||
@@ -809,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--;
|
||||
|
||||
@@ -932,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);
|
||||
|
||||
@@ -992,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;
|
||||
@@ -1010,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);
|
||||
}
|
||||
|
||||
@@ -1021,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;
|
||||
@@ -1036,6 +1065,7 @@ 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;
|
||||
|
||||
@@ -1066,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);
|
||||
@@ -1077,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);
|
||||
}
|
||||
@@ -1125,27 +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);
|
||||
if ( ptr->data ) {
|
||||
free(ptr->data);
|
||||
vm_free(ptr->data);
|
||||
ptr->data = NULL;
|
||||
}
|
||||
}
|
||||
|
||||
*prev_anim = ptr->next;
|
||||
free(ptr);
|
||||
vm_free(ptr);
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -1213,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);
|
||||
@@ -1236,7 +1266,7 @@ int anim_write_frames_out(char *filename)
|
||||
|
||||
}
|
||||
printf("\n");
|
||||
free(row_data);
|
||||
vm_free(row_data);
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -1269,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;
|
||||
@@ -1310,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,19 @@
|
||||
|
||||
/*
|
||||
* $Logfile: /Freespace2/code/Anim/AnimPlay.h $
|
||||
* $Revision: 2.4 $
|
||||
* $Date: 2004-08-11 05:06:18 $
|
||||
* $Author: Kazan $
|
||||
* $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
|
||||
@@ -112,7 +118,6 @@
|
||||
* $NoKeywords: $
|
||||
*/
|
||||
|
||||
#include "PreProcDefines.h"
|
||||
#ifndef __ANIMPLAY_H__
|
||||
#define __ANIMPLAY_H__
|
||||
|
||||
@@ -131,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;
|
||||
|
||||
@@ -9,15 +9,26 @@
|
||||
|
||||
/*
|
||||
* $Logfile: /Freespace2/code/Anim/PackUnpack.cpp $
|
||||
* $Revision: 2.7 $
|
||||
* $Date: 2004-07-26 20:47:23 $
|
||||
* $Author: Kazan $
|
||||
* $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
|
||||
*
|
||||
@@ -236,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;
|
||||
@@ -247,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;
|
||||
}
|
||||
@@ -257,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)
|
||||
@@ -1005,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);
|
||||
|
||||
@@ -1091,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);
|
||||
|
||||
@@ -1109,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;
|
||||
@@ -1191,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);
|
||||
|
||||
@@ -1281,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);
|
||||
|
||||
@@ -1299,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,21 @@
|
||||
|
||||
/*
|
||||
* $Logfile: /Freespace2/code/Anim/PackUnpack.h $
|
||||
* $Revision: 2.3 $
|
||||
* $Date: 2004-08-11 05:06:18 $
|
||||
* $Author: Kazan $
|
||||
* $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
|
||||
@@ -158,7 +164,6 @@
|
||||
#ifndef __PACKUNPACK_H__
|
||||
#define __PACKUNPACK_H__
|
||||
|
||||
#include "PreProcDefines.h"
|
||||
#include "globalincs/pstypes.h"
|
||||
|
||||
struct CFILE;
|
||||
@@ -218,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
|
||||
|
||||
@@ -9,13 +9,49 @@
|
||||
|
||||
/*
|
||||
* $Logfile: /Freespace2/code/Asteroid/Asteroid.cpp $
|
||||
* $Revision: 2.9 $
|
||||
* $Date: 2004-07-26 20:47:23 $
|
||||
* $Author: Kazan $
|
||||
* $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
|
||||
*
|
||||
@@ -302,6 +338,7 @@
|
||||
* $NoKeywords: $
|
||||
*/
|
||||
|
||||
|
||||
#include "asteroid/asteroid.h"
|
||||
#include "object/object.h"
|
||||
#include "object/objcollide.h"
|
||||
@@ -334,60 +371,14 @@
|
||||
#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",
|
||||
|
||||
#if !defined(MORE_SPECIES)
|
||||
DEBRIS_SHIVAN_LARGE, "Shivan Large"
|
||||
#else
|
||||
DEBRIS_SHIVAN_LARGE, "Shivan Large",
|
||||
|
||||
DEBRIS_ANCIENT_SMALL, "Ancient Small",
|
||||
DEBRIS_ANCIENT_MEDIUM, "Ancient Medium",
|
||||
DEBRIS_ANCIENT_LARGE, "Ancient Large",
|
||||
|
||||
DEBRIS_USER1_SMALL, "User1 Small",
|
||||
DEBRIS_USER1_MEDIUM, "User1 Medium",
|
||||
DEBRIS_USER1_LARGE, "User1 Large",
|
||||
|
||||
DEBRIS_USER2_SMALL, "User2 Small",
|
||||
DEBRIS_USER2_MEDIUM, "User2 Medium",
|
||||
DEBRIS_USER2_LARGE, "User2 Large",
|
||||
|
||||
DEBRIS_USER3_SMALL, "User3 Small",
|
||||
DEBRIS_USER3_MEDIUM, "User3 Medium",
|
||||
DEBRIS_USER3_LARGE, "User3 Large",
|
||||
|
||||
DEBRIS_USER4_SMALL, "User4 Small",
|
||||
DEBRIS_USER4_MEDIUM, "User4 Medium",
|
||||
DEBRIS_USER4_LARGE, "User4 Large",
|
||||
#endif
|
||||
};
|
||||
|
||||
// used for randomly generating debris type when there are multiple sizes.
|
||||
#define SMALL_DEBRIS_WEIGHT 8
|
||||
#define MEDIUM_DEBRIS_WEIGHT 4
|
||||
@@ -493,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);
|
||||
|
||||
@@ -515,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;
|
||||
@@ -526,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;
|
||||
@@ -557,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;
|
||||
@@ -672,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);
|
||||
@@ -725,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;
|
||||
@@ -814,8 +805,6 @@ 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)
|
||||
{
|
||||
|
||||
#if defined(MORE_SPECIES)
|
||||
if (ship_debris_index % 3 == 0)
|
||||
return SMALL_DEBRIS_WEIGHT;
|
||||
|
||||
@@ -826,32 +815,6 @@ int get_debris_weight(int ship_debris_index)
|
||||
return LARGE_DEBRIS_WEIGHT;
|
||||
//Int3();
|
||||
return 1;
|
||||
#else
|
||||
switch (ship_debris_index) {
|
||||
case DEBRIS_TERRAN_SMALL:
|
||||
case DEBRIS_VASUDAN_SMALL:
|
||||
case DEBRIS_SHIVAN_SMALL:
|
||||
return SMALL_DEBRIS_WEIGHT;
|
||||
break;
|
||||
|
||||
case DEBRIS_TERRAN_MEDIUM:
|
||||
case DEBRIS_VASUDAN_MEDIUM:
|
||||
case DEBRIS_SHIVAN_MEDIUM:
|
||||
return MEDIUM_DEBRIS_WEIGHT;
|
||||
break;
|
||||
|
||||
case DEBRIS_TERRAN_LARGE:
|
||||
case DEBRIS_VASUDAN_LARGE:
|
||||
case DEBRIS_SHIVAN_LARGE:
|
||||
return LARGE_DEBRIS_WEIGHT;
|
||||
break;
|
||||
|
||||
default:
|
||||
Int3();
|
||||
return 1;
|
||||
break;
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
// Create all the asteroids for the mission, called from
|
||||
@@ -1057,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);
|
||||
@@ -1163,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;
|
||||
@@ -1221,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;
|
||||
@@ -1237,7 +1200,7 @@ void asteroid_process_pre( object *objp, float frame_time)
|
||||
|
||||
#pragma warning ( push )
|
||||
#pragma warning ( disable : 4701 ) // possible use of variable without initialization
|
||||
int asteroid_check_collision(object *pasteroid, object *other_obj, vector *hitpos, collision_info_struct *asteroid_hit_info)
|
||||
int asteroid_check_collision(object *pasteroid, object *other_obj, vec3d *hitpos, collision_info_struct *asteroid_hit_info)
|
||||
{
|
||||
if (!Asteroids_enabled) {
|
||||
return 0;
|
||||
@@ -1281,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 );
|
||||
@@ -1291,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
|
||||
@@ -1324,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;
|
||||
|
||||
@@ -1395,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);
|
||||
@@ -1427,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);
|
||||
|
||||
@@ -1458,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);
|
||||
|
||||
@@ -1516,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);
|
||||
@@ -1581,7 +1544,6 @@ 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
|
||||
|
||||
#if defined(MORE_SPECIES)
|
||||
if (type % 3 <= 1)
|
||||
{
|
||||
sound_index = SND_ASTEROID_EXPLODE_SMALL;
|
||||
@@ -1592,33 +1554,7 @@ void asteriod_explode_sound(object *objp, int type, int play_loud)
|
||||
sound_index = SND_ASTEROID_EXPLODE_BIG;
|
||||
range_factor = 10.0f;
|
||||
}
|
||||
#else
|
||||
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:
|
||||
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:
|
||||
sound_index = SND_ASTEROID_EXPLODE_BIG;
|
||||
range_factor = 10.0f;
|
||||
break;
|
||||
|
||||
default:
|
||||
Int3();
|
||||
return;
|
||||
}
|
||||
#endif
|
||||
Assert(sound_index != -1);
|
||||
|
||||
if ( !play_loud ) {
|
||||
@@ -1670,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;
|
||||
@@ -1708,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);
|
||||
}
|
||||
@@ -1814,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;
|
||||
|
||||
@@ -1824,7 +1760,6 @@ void asteroid_maybe_break_up(object *asteroid_obj)
|
||||
if ( !MULTIPLAYER_CLIENT ) {
|
||||
#endif
|
||||
|
||||
#if defined(MORE_SPECIES)
|
||||
if (asp->type <= ASTEROID_TYPE_BIG) // 3
|
||||
// if this isn't true it's just debris, and debris doesn't break up
|
||||
{
|
||||
@@ -1851,7 +1786,7 @@ void asteroid_maybe_break_up(object *asteroid_obj)
|
||||
asteroid_sub_create(asteroid_obj, ASTEROID_TYPE_MEDIUM, &tvec);
|
||||
|
||||
while (frand() > 0.6f) {
|
||||
vector rvec, tvec2;
|
||||
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);
|
||||
@@ -1862,54 +1797,6 @@ void asteroid_maybe_break_up(object *asteroid_obj)
|
||||
break;
|
||||
}
|
||||
}
|
||||
#else
|
||||
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);
|
||||
}
|
||||
|
||||
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();
|
||||
}
|
||||
#endif
|
||||
#ifndef NO_NETWORK
|
||||
}
|
||||
#endif
|
||||
@@ -1918,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++){
|
||||
@@ -1940,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;
|
||||
@@ -2127,14 +2014,14 @@ 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;
|
||||
@@ -2176,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++;
|
||||
}
|
||||
@@ -2185,11 +2075,7 @@ void asteroid_parse_tbl()
|
||||
required_string("#End");
|
||||
|
||||
// check all read in
|
||||
#if defined(MORE_SPECIES)
|
||||
Assert(Num_asteroid_types == (True_NumSpecies + 1) * 3);//the species + normal asteroids
|
||||
#else
|
||||
Assert(Num_asteroid_types == MAX_DEBRIS_TYPES);
|
||||
#endif
|
||||
Assert(Num_asteroid_types == Total_asteroid_types);
|
||||
|
||||
Asteroid_impact_explosion_ani = -1;
|
||||
required_string("$Impact Explosion:");
|
||||
@@ -2412,7 +2298,7 @@ void asteroid_page_in()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
#else
|
||||
|
||||
// stubbed out functions not used in the demo
|
||||
@@ -2424,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;}
|
||||
@@ -2433,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,27 @@
|
||||
|
||||
/*
|
||||
* $Logfile: /Freespace2/code/Asteroid/Asteroid.h $
|
||||
* $Revision: 2.5 $
|
||||
* $Date: 2004-08-11 05:06:18 $
|
||||
* $Author: Kazan $
|
||||
* $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
|
||||
@@ -136,7 +150,6 @@
|
||||
* $NoKeywords: $
|
||||
*/
|
||||
|
||||
#include "PreProcDefines.h"
|
||||
#ifndef __ASTEROID_H__
|
||||
#define __ASTEROID_H__
|
||||
|
||||
@@ -149,79 +162,14 @@ struct collision_info_struct;
|
||||
|
||||
#define MAX_ASTEROIDS 256
|
||||
|
||||
// DEBRIS TYPES
|
||||
|
||||
|
||||
#if defined(MORE_SPECIES)
|
||||
#define DEBRIS_NAME_MASK 0x000f
|
||||
// -----------------------------------
|
||||
// Kazan Extended Species version
|
||||
// -----------------------------------
|
||||
#define MAX_DEBRIS_TYPES 27
|
||||
|
||||
#define ASTEROID_TYPE_SMALL 0
|
||||
#define ASTEROID_TYPE_MEDIUM 1
|
||||
#define ASTEROID_TYPE_BIG 2
|
||||
// terran
|
||||
#define DEBRIS_TERRAN_SMALL 3
|
||||
#define DEBRIS_TERRAN_MEDIUM 4
|
||||
#define DEBRIS_TERRAN_LARGE 5
|
||||
// vasudan
|
||||
#define DEBRIS_VASUDAN_SMALL 6
|
||||
#define DEBRIS_VASUDAN_MEDIUM 7
|
||||
#define DEBRIS_VASUDAN_LARGE 8
|
||||
// shivan
|
||||
#define DEBRIS_SHIVAN_SMALL 9
|
||||
#define DEBRIS_SHIVAN_MEDIUM 10
|
||||
#define DEBRIS_SHIVAN_LARGE 11
|
||||
// ancient
|
||||
#define DEBRIS_ANCIENT_SMALL 12
|
||||
#define DEBRIS_ANCIENT_MEDIUM 13
|
||||
#define DEBRIS_ANCIENT_LARGE 14
|
||||
// user1
|
||||
#define DEBRIS_USER1_SMALL 15
|
||||
#define DEBRIS_USER1_MEDIUM 16
|
||||
#define DEBRIS_USER1_LARGE 17
|
||||
// user2
|
||||
#define DEBRIS_USER2_SMALL 18
|
||||
#define DEBRIS_USER2_MEDIUM 19
|
||||
#define DEBRIS_USER2_LARGE 20
|
||||
// user3
|
||||
#define DEBRIS_USER3_SMALL 21
|
||||
#define DEBRIS_USER3_MEDIUM 22
|
||||
#define DEBRIS_USER3_LARGE 23
|
||||
// user4
|
||||
#define DEBRIS_USER4_SMALL 24
|
||||
#define DEBRIS_USER4_MEDIUM 25
|
||||
#define DEBRIS_USER4_LARGE 26
|
||||
#else
|
||||
// -----------------------------------
|
||||
// Old Volition Version
|
||||
// -----------------------------------
|
||||
#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
|
||||
#endif
|
||||
|
||||
typedef struct debris_struct {
|
||||
int index;
|
||||
char *name;
|
||||
} debris_struct;
|
||||
// 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)
|
||||
|
||||
|
||||
// Data structure to track the active asteroids
|
||||
typedef struct asteroid_obj {
|
||||
@@ -231,8 +179,6 @@ 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.
|
||||
@@ -265,20 +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
|
||||
#define DS_ANCIENT 0x08
|
||||
#define DS_USER1 0x10
|
||||
#define DS_USER2 0x20
|
||||
#define DS_USER3 0x40
|
||||
#define DS_USER4 0x80
|
||||
|
||||
// TYPEDEF FOR DEBRIS TYPE
|
||||
typedef enum {
|
||||
DG_ASTEROID,
|
||||
@@ -294,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
|
||||
@@ -323,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();
|
||||
|
||||
|
||||
@@ -4,11 +4,37 @@
|
||||
|
||||
/*
|
||||
* $Logfile: /Freespace2/code/Autopilot/Autopilot.cpp $
|
||||
* $Revision: 1.14 $
|
||||
* $Date: 2004-10-03 21:41:10 $
|
||||
* $Author: Kazan $
|
||||
* $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
|
||||
*
|
||||
@@ -31,7 +57,6 @@
|
||||
*
|
||||
* Revision 1.7 2004/07/26 17:54:04 Kazan
|
||||
* Autopilot system completed -- i am dropping plans for GUI nav map
|
||||
* All builds should have ENABLE_AUTO_PILOT defined from now on (.dsp's i am committing reflect this) the system will only be noticed if the mission designer brings it online by defining a nav point
|
||||
* Fixed FPS counter during time compression
|
||||
*
|
||||
* Revision 1.6 2004/07/25 19:27:51 Kazan
|
||||
@@ -61,25 +86,19 @@
|
||||
*/
|
||||
|
||||
|
||||
#include "Autopilot.h"
|
||||
#include "ship/ai.h"
|
||||
#include "ship/aigoals.h"
|
||||
#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);
|
||||
extern int ai_goal_find_empty_slot( ai_goal *goals );
|
||||
|
||||
extern fix Game_time_compression;
|
||||
|
||||
|
||||
#if defined(ENABLE_AUTO_PILOT)
|
||||
|
||||
|
||||
|
||||
// Module variables
|
||||
@@ -144,9 +163,9 @@ bool Sel_NextNav()
|
||||
|
||||
|
||||
// ********************************************************************************************
|
||||
vector NavPoint::GetPosition()
|
||||
vec3d NavPoint::GetPosition()
|
||||
{
|
||||
vector position;
|
||||
vec3d position;
|
||||
|
||||
if (flags & NP_WAYPOINT)
|
||||
{
|
||||
@@ -215,6 +234,7 @@ bool CanAutopilot()
|
||||
// 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()
|
||||
@@ -225,7 +245,8 @@ void StartAutopilot()
|
||||
AutoPilotEngaged = true;
|
||||
|
||||
Player_use_ai = 1;
|
||||
Game_time_compression = F1_0;
|
||||
set_time_compression(1);
|
||||
lock_time_compression(true);
|
||||
|
||||
// determine speed cap
|
||||
int i,j;
|
||||
@@ -369,7 +390,8 @@ void EndAutoPilot()
|
||||
{
|
||||
AutoPilotEngaged = false;
|
||||
|
||||
Game_time_compression = F1_0;
|
||||
set_time_compression(1);
|
||||
lock_time_compression(false);
|
||||
Player_use_ai = 0;
|
||||
//Clear AI Goals
|
||||
|
||||
@@ -422,6 +444,7 @@ void EndAutoPilot()
|
||||
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;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -448,7 +471,7 @@ void NavSystem_Do()
|
||||
|
||||
for (i = 0; i < MAX_NAVPOINTS; i++)
|
||||
{
|
||||
if (Navs[i].flags & NP_SHIP)
|
||||
if ((Navs[i].flags & NP_SHIP) && (Navs[i].target_obj != NULL))
|
||||
{
|
||||
if (((ship*)Navs[i].target_obj)->objnum == -1)
|
||||
DelNavPoint(i);
|
||||
@@ -458,8 +481,11 @@ void NavSystem_Do()
|
||||
// check if we're reached a Node
|
||||
for (i = 0; i < MAX_NAVPOINTS; i++)
|
||||
{
|
||||
if (Navs[i].flags & NP_VALIDTYPE && DistanceTo(i) < 1000)
|
||||
Navs[i].flags |= NP_VISITED;
|
||||
if (Navs[i].target_obj != NULL)
|
||||
{
|
||||
if (Navs[i].flags & NP_VALIDTYPE && DistanceTo(i) < 1000)
|
||||
Navs[i].flags |= NP_VISITED;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -473,17 +499,17 @@ void NavSystem_Do()
|
||||
{
|
||||
|
||||
if (dstfrm_start >= (3000*ramp_bias) && DistanceTo(CurrentNav) > 30000)
|
||||
Game_time_compression = F1_0 * 64;
|
||||
set_time_compression(64);
|
||||
else if (dstfrm_start >= (2000*ramp_bias))
|
||||
Game_time_compression = F1_0 * 32;
|
||||
set_time_compression(32);
|
||||
else if (dstfrm_start >= (1600*ramp_bias))
|
||||
Game_time_compression = F1_0 * 16;
|
||||
set_time_compression(16);
|
||||
else if (dstfrm_start >= (1200*ramp_bias))
|
||||
Game_time_compression = F1_0 * 8;
|
||||
set_time_compression(8);
|
||||
else if (dstfrm_start >= (800*ramp_bias))
|
||||
Game_time_compression = F1_0 * 4;
|
||||
set_time_compression(4);
|
||||
else if (dstfrm_start >= (400*ramp_bias))
|
||||
Game_time_compression = F1_0 * 2;
|
||||
set_time_compression(2);
|
||||
}
|
||||
|
||||
// Ramp DOWN time compression
|
||||
@@ -491,15 +517,15 @@ void NavSystem_Do()
|
||||
{
|
||||
int dist = DistanceTo(CurrentNav);
|
||||
if (dist >= (5000*ramp_bias))
|
||||
Game_time_compression = F1_0 * 32;
|
||||
set_time_compression(32);
|
||||
else if (dist >= (4000*ramp_bias))
|
||||
Game_time_compression = F1_0 * 16;
|
||||
set_time_compression(16);
|
||||
else if (dist >= (3000*ramp_bias))
|
||||
Game_time_compression = F1_0 * 8;
|
||||
set_time_compression(8);
|
||||
else if (dist >= (2000*ramp_bias))
|
||||
Game_time_compression = F1_0 * 4;
|
||||
set_time_compression(4);
|
||||
else if (dist >= (1000*ramp_bias))
|
||||
Game_time_compression = F1_0 * 2;
|
||||
set_time_compression(2);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -571,8 +597,9 @@ bool AddNav_Ship(char *Nav, char *TargetName, int flags)
|
||||
// find an empty nav - should be the end
|
||||
|
||||
int empty = -1;
|
||||
int i;
|
||||
|
||||
for (int i = 0; i < MAX_NAVPOINTS && empty == -1; i++)
|
||||
for (i = 0; i < MAX_NAVPOINTS && empty == -1; i++)
|
||||
{
|
||||
if (Navs[i].flags == 0)
|
||||
empty = i;
|
||||
@@ -613,11 +640,12 @@ 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 (int i = 0; i < MAX_NAVPOINTS && empty == -1; i++)
|
||||
for (i = 0; i < MAX_NAVPOINTS && empty == -1; i++)
|
||||
{
|
||||
if (Navs[i].flags == 0)
|
||||
empty = i;
|
||||
@@ -778,6 +806,10 @@ unsigned int DistanceTo(int nav)
|
||||
return 0xFFFFFFFF;
|
||||
|
||||
char *name = Navs[nav].GetInteralName();
|
||||
|
||||
if (name == NULL)
|
||||
return 0xFFFFFFFF;
|
||||
|
||||
int distance = sexp_distance2(Player_ship->objnum, name);
|
||||
delete[] name;
|
||||
|
||||
@@ -805,4 +837,3 @@ bool IsVisited(int nav)
|
||||
return 0;
|
||||
}
|
||||
|
||||
#endif
|
||||
@@ -4,11 +4,17 @@
|
||||
|
||||
/*
|
||||
* $Logfile: /Freespace2/code/Autopilot/Autopilot.h $
|
||||
* $Revision: 1.6 $
|
||||
* $Date: 2004-08-11 05:06:18 $
|
||||
* $Author: Kazan $
|
||||
* $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
|
||||
*
|
||||
@@ -29,7 +35,6 @@
|
||||
*
|
||||
*/
|
||||
|
||||
#include "PreProcDefines.h"
|
||||
#if !defined(_AUTOPILOT_H_)
|
||||
#define _AUTOPILOT_H_
|
||||
|
||||
@@ -57,7 +62,7 @@ struct NavPoint
|
||||
void *target_obj;
|
||||
int waypoint_num; //only used when flags & NP_WAYPOINT
|
||||
|
||||
vector GetPosition();
|
||||
vec3d GetPosition();
|
||||
char* GetInteralName();
|
||||
};
|
||||
|
||||
|
||||
@@ -9,13 +9,20 @@
|
||||
|
||||
/*
|
||||
* $Logfile: /Freespace2/code/bmpman/bm_internal.h $
|
||||
* $Revision: 2.1 $
|
||||
* $Date: 2004-11-23 00:10:06 $
|
||||
* $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: $
|
||||
*/
|
||||
@@ -50,6 +57,7 @@
|
||||
#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 ///////////////////
|
||||
@@ -97,6 +105,7 @@ typedef struct bitmap_entry {
|
||||
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;
|
||||
|
||||
+594
-274
File diff suppressed because it is too large.
Load diff
@@ -10,13 +10,61 @@
|
||||
/*
|
||||
* $Logfile: /Freespace2/code/Bmpman/BmpMan.h $
|
||||
*
|
||||
* $Revision: 2.18 $
|
||||
* $Date: 2004-11-23 00:10:06 $
|
||||
* $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
|
||||
*
|
||||
@@ -295,7 +343,6 @@
|
||||
* $NoKeywords: $
|
||||
*/
|
||||
|
||||
#include "PreProcDefines.h"
|
||||
#ifndef _BMPMAN_H
|
||||
#define _BMPMAN_H
|
||||
|
||||
@@ -309,8 +356,20 @@
|
||||
|
||||
// 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 4500 // 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
|
||||
@@ -367,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
|
||||
@@ -395,7 +458,7 @@ 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);
|
||||
@@ -488,7 +551,7 @@ void bm_page_in_xparent_texture( int bitmapnum, int num_frames=1 );
|
||||
void bm_page_in_aabitmap( int bitmapnum, int num_frames=1 );
|
||||
|
||||
// unload a texture that was paged in
|
||||
void bm_page_out( int handle );
|
||||
int bm_page_out( int handle );
|
||||
|
||||
//
|
||||
// Mode: 0 = High memory
|
||||
@@ -504,6 +567,7 @@ void BM_SELECT_ALPHA_TEX_FORMAT();
|
||||
|
||||
// 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);
|
||||
@@ -514,13 +578,6 @@ 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
|
||||
//============================================================================
|
||||
|
||||
// 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);
|
||||
|
||||
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
|
||||
@@ -532,4 +589,7 @@ 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
|
||||
@@ -9,13 +9,32 @@
|
||||
|
||||
/*
|
||||
* $Logfile: /Freespace2/code/CFile/cfile.cpp $
|
||||
* $Revision: 2.24 $
|
||||
* $Date: 2004-12-25 00:22:54 $
|
||||
* $Author: wmcoolmon $
|
||||
* $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
|
||||
*
|
||||
@@ -277,7 +296,7 @@
|
||||
#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>
|
||||
@@ -287,10 +306,14 @@
|
||||
#include "parse/encrypt.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
|
||||
@@ -319,7 +342,7 @@ cf_pathtype Pathtypes[CF_MAX_PATH_TYPES] = {
|
||||
{ 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_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 },
|
||||
@@ -329,7 +352,7 @@ cf_pathtype Pathtypes[CF_MAX_PATH_TYPES] = {
|
||||
{ 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 .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 },
|
||||
@@ -361,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
|
||||
|
||||
@@ -429,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;
|
||||
}
|
||||
|
||||
@@ -447,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;
|
||||
@@ -516,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);
|
||||
@@ -560,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);
|
||||
@@ -605,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) );
|
||||
@@ -618,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) {
|
||||
@@ -632,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);
|
||||
@@ -872,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 {
|
||||
@@ -920,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);
|
||||
@@ -1023,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 ) {
|
||||
@@ -1054,6 +1080,7 @@ 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;
|
||||
@@ -1066,13 +1093,7 @@ CFILE *cf_open_fill_cfblock(FILE *fp, int type)
|
||||
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;
|
||||
}
|
||||
@@ -1092,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;
|
||||
@@ -1121,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
|
||||
{
|
||||
@@ -1129,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 {
|
||||
@@ -1154,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
|
||||
@@ -1213,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;
|
||||
}
|
||||
|
||||
@@ -1286,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)
|
||||
@@ -1359,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);
|
||||
}
|
||||
|
||||
@@ -1392,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;
|
||||
|
||||
@@ -9,13 +9,22 @@
|
||||
|
||||
/*
|
||||
* $Logfile: /Freespace2/code/CFile/cfile.h $
|
||||
* $Revision: 2.9 $
|
||||
* $Date: 2004-08-11 05:06:19 $
|
||||
* $Author: Kazan $
|
||||
* $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
|
||||
*
|
||||
@@ -362,17 +371,17 @@
|
||||
* $NoKeywords: $
|
||||
*/
|
||||
|
||||
#include "PreProcDefines.h"
|
||||
#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
|
||||
@@ -463,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
|
||||
@@ -594,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
|
||||
@@ -612,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,17 @@
|
||||
|
||||
/*
|
||||
* $Logfile: /Freespace2/code/CFile/CfileArchive.cpp $
|
||||
* $Revision: 2.6 $
|
||||
* $Date: 2004-07-26 20:47:25 $
|
||||
* $Author: Kazan $
|
||||
* $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
|
||||
*
|
||||
@@ -250,7 +253,7 @@ int cfseek( CFILE *cfile, int offset, int where )
|
||||
|
||||
#if defined(CHECK_POSITION) && !defined(NDEBUG)
|
||||
int tmp_offset;
|
||||
tmp_offset = ftell(cb->fp) - cb->lib_offset;
|
||||
tmp_offset = (int)ftell(cb->fp) - cb->lib_offset;
|
||||
Assert(tmp_offset==cb->raw_position);
|
||||
#endif
|
||||
|
||||
|
||||
@@ -9,14 +9,17 @@
|
||||
|
||||
/*
|
||||
* $Logfile: /Freespace2/code/CFile/CfileArchive.h $
|
||||
* $Revision: 2.2 $
|
||||
* $Date: 2004-08-11 05:06:19 $
|
||||
* $Author: Kazan $
|
||||
* $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
|
||||
*
|
||||
@@ -51,7 +54,6 @@
|
||||
* $NoKeywords: $
|
||||
*/
|
||||
|
||||
#include "PreProcDefines.h"
|
||||
#ifndef _CFILEARCHIVE_H
|
||||
#define _CFILEARCHIVE_H
|
||||
|
||||
|
||||
@@ -9,13 +9,16 @@
|
||||
|
||||
/*
|
||||
* $Logfile: /Freespace2/code/CFile/CfileList.cpp $
|
||||
* $Revision: 2.5 $
|
||||
* $Date: 2004-07-26 20:47:25 $
|
||||
* $Author: Kazan $
|
||||
* $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
|
||||
*
|
||||
@@ -176,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:
|
||||
@@ -345,6 +350,8 @@ int cf_decompress(char *out, char *in )
|
||||
|
||||
}
|
||||
|
||||
#endif // 0
|
||||
|
||||
|
||||
// cfread() reads from a file and decompresses it
|
||||
//
|
||||
|
||||
@@ -9,8 +9,8 @@
|
||||
|
||||
/*
|
||||
* $Logfile: /Freespace2/code/CFile/CfileSystem.cpp $
|
||||
* $Revision: 2.24 $
|
||||
* $Date: 2004-11-21 11:27:31 $
|
||||
* $Revision: 2.26 $
|
||||
* $Date: 2005-05-12 17:49:10 $
|
||||
* $Author: taylor $
|
||||
*
|
||||
* Functions to keep track of and find files that can exist
|
||||
@@ -20,6 +20,12 @@
|
||||
* all those locations, inherently enforcing precedence orders.
|
||||
*
|
||||
* $Log: not supported by cvs2svn $
|
||||
* Revision 2.25 2005/01/30 12:50:08 taylor
|
||||
* merge with Linux/OSX tree - p0130
|
||||
*
|
||||
* Revision 2.24 2004/11/21 11:27:31 taylor
|
||||
* some 64-bit OS comaptibility fixes
|
||||
*
|
||||
* Revision 2.23 2004/10/31 21:28:38 taylor
|
||||
* support new pilot code, Linux code tree merge, don't use same pilot directory for Inferno builds
|
||||
*
|
||||
@@ -193,7 +199,6 @@
|
||||
|
||||
#ifdef SCP_UNIX
|
||||
#include <glob.h>
|
||||
#include <sys/stat.h>
|
||||
#include <sys/types.h>
|
||||
#include <dirent.h>
|
||||
#include <fnmatch.h>
|
||||
@@ -281,7 +286,7 @@ cf_file *cf_create_file()
|
||||
int offset = Num_files % CF_NUM_FILES_PER_BLOCK;
|
||||
|
||||
if ( File_blocks[block] == NULL ) {
|
||||
File_blocks[block] = (cf_file_block *)malloc( sizeof(cf_file_block) );
|
||||
File_blocks[block] = (cf_file_block *)vm_malloc( sizeof(cf_file_block) );
|
||||
Assert( File_blocks[block] != NULL);
|
||||
}
|
||||
|
||||
@@ -312,7 +317,7 @@ cf_root *cf_create_root()
|
||||
int offset = Num_roots % CF_NUM_ROOTS_PER_BLOCK;
|
||||
|
||||
if ( Root_blocks[block] == NULL ) {
|
||||
Root_blocks[block] = (cf_root_block *)malloc( sizeof(cf_root_block) );
|
||||
Root_blocks[block] = (cf_root_block *)vm_malloc( sizeof(cf_root_block) );
|
||||
Assert(Root_blocks[block] != NULL);
|
||||
}
|
||||
|
||||
@@ -413,7 +418,7 @@ void cf_build_pack_list( cf_root *root )
|
||||
}
|
||||
|
||||
// allocate a temporary array of temporary roots so we can easily sort them
|
||||
temp_roots_sort = (cf_root_sort*)malloc(sizeof(cf_root_sort) * temp_root_count);
|
||||
temp_roots_sort = (cf_root_sort*)vm_malloc(sizeof(cf_root_sort) * temp_root_count);
|
||||
if(temp_roots_sort == NULL){
|
||||
Int3();
|
||||
return;
|
||||
@@ -515,7 +520,7 @@ void cf_build_pack_list( cf_root *root )
|
||||
}
|
||||
|
||||
// free up the temp list
|
||||
free(temp_roots_sort);
|
||||
vm_free(temp_roots_sort);
|
||||
}
|
||||
|
||||
|
||||
@@ -580,7 +585,7 @@ void cf_build_root_list(char *cdrom_dir)
|
||||
{
|
||||
|
||||
//strdup was not behaving reliably
|
||||
//str_temp = strdup(cur_pos);
|
||||
//str_temp = vm_strdup(cur_pos);
|
||||
|
||||
memset(str_temp, 0, 128);
|
||||
strcpy(str_temp, cur_pos);
|
||||
@@ -614,7 +619,6 @@ void cf_build_root_list(char *cdrom_dir)
|
||||
strcat(root->path, DIR_SEPARATOR_STR); // put trailing backslash on for easier path construction
|
||||
}
|
||||
|
||||
|
||||
root->roottype = CF_ROOTTYPE_PATH;
|
||||
|
||||
// set the default path for pilot files
|
||||
@@ -855,7 +859,7 @@ void cf_search_root_pack(int root_index)
|
||||
strcpy( file->name_ext, find.filename );
|
||||
file->root_index = root_index;
|
||||
file->pathtype_index = j;
|
||||
file->write_time = find.write_time;
|
||||
file->write_time = (time_t)find.write_time;
|
||||
file->size = find.size;
|
||||
file->pack_offset = find.offset; // Mark as a packed file
|
||||
//mprintf(( "Found pack file '%s'\n", file->name_ext ));
|
||||
@@ -936,7 +940,7 @@ void cf_free_secondary_filelist()
|
||||
// Free the root blocks
|
||||
for (i=0; i<CF_MAX_ROOT_BLOCKS; i++ ) {
|
||||
if ( Root_blocks[i] ) {
|
||||
free( Root_blocks[i] );
|
||||
vm_free( Root_blocks[i] );
|
||||
Root_blocks[i] = NULL;
|
||||
}
|
||||
}
|
||||
@@ -945,7 +949,7 @@ void cf_free_secondary_filelist()
|
||||
// Init the file blocks
|
||||
for (i=0; i<CF_MAX_FILE_BLOCKS; i++ ) {
|
||||
if ( File_blocks[i] ) {
|
||||
free( File_blocks[i] );
|
||||
vm_free( File_blocks[i] );
|
||||
File_blocks[i] = NULL;
|
||||
}
|
||||
}
|
||||
@@ -1234,7 +1238,7 @@ int cf_get_file_list( int max, char **list, int pathtype, char *filter, int sort
|
||||
Assert(list);
|
||||
|
||||
if (!info && (sort == CF_SORT_TIME)) {
|
||||
info = (file_list_info *) malloc(sizeof(file_list_info) * max);
|
||||
info = (file_list_info *) vm_malloc(sizeof(file_list_info) * max);
|
||||
own_flag = 1;
|
||||
}
|
||||
|
||||
@@ -1261,7 +1265,7 @@ int cf_get_file_list( int max, char **list, int pathtype, char *filter, int sort
|
||||
else
|
||||
l = strlen(find.name);
|
||||
|
||||
list[num_files] = (char *)malloc(l + 1);
|
||||
list[num_files] = (char *)vm_malloc(l + 1);
|
||||
strncpy(list[num_files], find.name, l);
|
||||
list[num_files][l] = 0;
|
||||
if (info)
|
||||
@@ -1312,7 +1316,7 @@ int cf_get_file_list( int max, char **list, int pathtype, char *filter, int sort
|
||||
else
|
||||
l = strlen(dir->d_name);
|
||||
|
||||
list[num_files] = (char *)malloc(l + 1);
|
||||
list[num_files] = (char *)vm_malloc(l + 1);
|
||||
strncpy(list[num_files], dir->d_name, l);
|
||||
list[num_files][l] = 0;
|
||||
if (info)
|
||||
@@ -1357,7 +1361,7 @@ int cf_get_file_list( int max, char **list, int pathtype, char *filter, int sort
|
||||
else
|
||||
l = strlen(f->name_ext);
|
||||
|
||||
list[num_files] = (char *)malloc(l + 1);
|
||||
list[num_files] = (char *)vm_malloc(l + 1);
|
||||
strncpy(list[num_files], f->name_ext, l);
|
||||
list[num_files][l] = 0;
|
||||
|
||||
@@ -1377,7 +1381,7 @@ int cf_get_file_list( int max, char **list, int pathtype, char *filter, int sort
|
||||
}
|
||||
|
||||
if (own_flag) {
|
||||
free(info);
|
||||
vm_free(info);
|
||||
}
|
||||
|
||||
Get_file_list_filter = NULL;
|
||||
@@ -1428,8 +1432,10 @@ int cf_get_file_list_preallocated( int max, char arr[][MAX_FILENAME_LEN], char *
|
||||
}
|
||||
|
||||
if (!info && (sort == CF_SORT_TIME)) {
|
||||
info = (file_list_info *) malloc(sizeof(file_list_info) * max);
|
||||
own_flag = 1;
|
||||
info = (file_list_info *) vm_malloc(sizeof(file_list_info) * max);
|
||||
|
||||
if ( info )
|
||||
own_flag = 1;
|
||||
}
|
||||
|
||||
char filespec[MAX_PATH_LEN];
|
||||
@@ -1568,7 +1574,7 @@ int cf_get_file_list_preallocated( int max, char arr[][MAX_FILENAME_LEN], char *
|
||||
}
|
||||
|
||||
if (own_flag) {
|
||||
free(info);
|
||||
vm_free(info);
|
||||
}
|
||||
|
||||
Get_file_list_filter = NULL;
|
||||
|
||||
@@ -9,9 +9,9 @@
|
||||
|
||||
/*
|
||||
* $Logfile: /Freespace2/code/CFile/CfileSystem.h $
|
||||
* $Revision: 2.2 $
|
||||
* $Date: 2004-08-11 05:06:19 $
|
||||
* $Author: Kazan $
|
||||
* $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,9 @@
|
||||
* 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
|
||||
@@ -50,7 +53,6 @@
|
||||
* $NoKeywords: $
|
||||
*/
|
||||
|
||||
#include "PreProcDefines.h"
|
||||
#ifndef _CFILESYSTEM_H
|
||||
#define _CFILESYSTEM_H
|
||||
|
||||
|
||||
@@ -9,13 +9,20 @@
|
||||
|
||||
/*
|
||||
* $Logfile: /Freespace2/code/Cfilearchiver/CfileArchiver.cpp $
|
||||
* $Revision: 2.1 $
|
||||
* $Date: 2003-11-16 09:42:37 $
|
||||
* $Author: Goober5000 $
|
||||
* $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
|
||||
*
|
||||
@@ -30,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];
|
||||
@@ -82,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];
|
||||
|
||||
@@ -110,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" );
|
||||
|
||||
@@ -153,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);
|
||||
@@ -163,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];
|
||||
|
||||
@@ -184,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 ) {
|
||||
@@ -217,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[] )
|
||||
{
|
||||
@@ -228,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] );
|
||||
@@ -248,24 +370,41 @@ int main(int argc, char *argv[] )
|
||||
|
||||
fp_out = fopen( archive_dat, "wb" );
|
||||
if ( !fp_out ) {
|
||||
printf( "out1: Couldn't open '%s'!\n", archive_dat );
|
||||
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( "out2: Couldn't open '%s'!\n", archive_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);
|
||||
@@ -275,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;
|
||||
}
|
||||
@@ -9,11 +9,83 @@
|
||||
|
||||
/*
|
||||
* $Logfile: /Freespace2/code/Cmdline/cmdline.cpp $
|
||||
* $Revision: 2.88 $
|
||||
* $Date: 2004-12-24 19:36:12 $
|
||||
* $Author: Goober5000 $
|
||||
* $Revision: 2.109 $
|
||||
* $Date: 2005-09-05 09:33:08 $
|
||||
* $Author: taylor $
|
||||
*
|
||||
* $Log: not supported by cvs2svn $
|
||||
* Revision 2.108 2005/08/01 10:00:39 taylor
|
||||
* allow for both gamedir and userdir cmdline config files
|
||||
*
|
||||
* Revision 2.107 2005/07/25 05:24:16 Goober5000
|
||||
* cleaned up some command line and mission flag stuff
|
||||
* --Goober5000
|
||||
*
|
||||
* Revision 2.106 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.105 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.104 2005/05/24 07:05:49 wmcoolmon
|
||||
* Commented out -fixbugs and -nocrash in preparation for 3.6.7
|
||||
*
|
||||
* Revision 2.103 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.102 2005/05/01 07:13:59 wmcoolmon
|
||||
* -output_sexps command line
|
||||
*
|
||||
* Revision 2.101 2005/04/15 11:41:27 taylor
|
||||
* stupid <expletive-delete> terminal, I <expletive-deleted> <expletive-deleted>!!!
|
||||
*
|
||||
* Revision 2.100 2005/04/15 11:36:55 taylor
|
||||
* new GCC = new warning messages, yippeeee!!
|
||||
*
|
||||
* Revision 2.99 2005/03/25 06:57:33 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 2.98 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.97 2005/03/12 03:09:55 wmcoolmon
|
||||
* New commandline option "-noparseerrors"
|
||||
*
|
||||
* Revision 2.96 2005/03/08 03:50:19 Goober5000
|
||||
* edited for language ;)
|
||||
* --Goober5000
|
||||
*
|
||||
* Revision 2.95 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 2.94 2005/02/16 10:00:13 wmcoolmon
|
||||
* "-ingame" command line option
|
||||
*
|
||||
* Revision 2.93 2005/02/10 04:02:37 wmcoolmon
|
||||
* Addition of the -clipdist argument.
|
||||
*
|
||||
* Revision 2.92 2005/01/30 14:09:29 taylor
|
||||
* it's -nosound not -noaudio
|
||||
*
|
||||
* Revision 2.91 2005/01/30 12:50:08 taylor
|
||||
* merge with Linux/OSX tree - p0130
|
||||
*
|
||||
* Revision 2.90 2005/01/29 16:30:47 phreak
|
||||
* smart shield command line stuff. this will be changed in the future, but i want people to test it.
|
||||
* -phreak
|
||||
*
|
||||
* Revision 2.89 2005/01/21 08:29:04 taylor
|
||||
* add -rlm cmdline option to switch to local viewpoint lighting calculations (OGL only for now)
|
||||
*
|
||||
* Revision 2.88 2004/12/24 19:36:12 Goober5000
|
||||
* resorted command-line options and added an option for WMC's ballistic gauge
|
||||
* --Goober5000
|
||||
*
|
||||
* Revision 2.87 2004/12/11 09:37:17 wmcoolmon
|
||||
* Apparently I never commited -mpnoreturn...
|
||||
*
|
||||
@@ -211,7 +283,7 @@
|
||||
* Speech now chooses voice based on reg value set by launcher v3.1
|
||||
*
|
||||
* Revision 2.43 2003/11/11 03:56:10 bobboau
|
||||
* shit load of bug fixing, much of it in nebula and bitmap drawing
|
||||
* lots of bug fixing, much of it in nebula and bitmap drawing
|
||||
*
|
||||
* Revision 2.42 2003/11/09 06:31:38 Kazan
|
||||
* a couple of htl functions being called in nonhtl (ie NULL functions) problems fixed
|
||||
@@ -594,7 +666,12 @@
|
||||
* $NoKeywords: $
|
||||
*/
|
||||
|
||||
#ifdef _WIN32
|
||||
#include <direct.h>
|
||||
#elif defined(APPLE_APP)
|
||||
#include <CoreFoundation/CoreFoundation.h>
|
||||
#endif
|
||||
|
||||
#include <string.h>
|
||||
#include <stdlib.h>
|
||||
#include "globalincs/pstypes.h"
|
||||
@@ -604,7 +681,14 @@
|
||||
#include "network/multi.h"
|
||||
#include "species_defs/species_defs.h"
|
||||
#include "hud/hudconfig.h"
|
||||
//WMC - added these for show-SEXP command line
|
||||
#include <vector>
|
||||
#include "globalincs/version.h"
|
||||
#include "parse/sexp.h"
|
||||
|
||||
#ifdef SCP_UNIX
|
||||
#include "osapi/osapi.h"
|
||||
#endif
|
||||
|
||||
// variables
|
||||
class cmdline_parm {
|
||||
@@ -654,11 +738,11 @@ typedef struct
|
||||
|
||||
EasyFlag easy_flags[] =
|
||||
{
|
||||
"Custom",
|
||||
"Default FS2 (All features off)",
|
||||
"All features on",
|
||||
"High memory usage features on",
|
||||
"High memory usage features off",
|
||||
{ "Custom" },
|
||||
{ "Default FS2 (All features off)" },
|
||||
{ "All features on" },
|
||||
{ "High memory usage features on" },
|
||||
{ "High memory usage features off" }
|
||||
};
|
||||
|
||||
// DO NOT CHANGE **ANYTHING** ABOUT THIS STRUCTURE AND ITS CONTENT
|
||||
@@ -674,65 +758,81 @@ typedef struct
|
||||
|
||||
} Flag;
|
||||
|
||||
// Please group them by type, ie Graphics, gameplay etc, maximum 20 different types
|
||||
// Please group them by type, ie graphics, gameplay etc, maximum 20 different types
|
||||
Flag exe_params[] =
|
||||
{
|
||||
"-spec", "Enable specular", true, EASY_ALL_ON, EASY_DEFAULT, "Graphics", "http://dynamic4.gamespy.com/~freespace/fsdoc/index.php?pagename=Command-Line%20Reference#x2d.spec",
|
||||
"-glow", "Enable glowmaps", true, EASY_MEM_ALL_ON, EASY_DEFAULT_MEM, "Graphics", "http://dynamic4.gamespy.com/~freespace/fsdoc/index.php?pagename=Command-Line%20Reference#x2d.glow",
|
||||
"-pcx32", "Enable 32bit textures", true, EASY_MEM_ALL_ON, EASY_DEFAULT_MEM, "Graphics", "http://dynamic4.gamespy.com/~freespace/fsdoc/index.php?pagename=Command-Line%20Reference#x2d.pcx32",
|
||||
"-jpgtga", "Enable jpg,tga textures", true, EASY_MEM_ALL_ON, EASY_DEFAULT_MEM, "Graphics", "http://dynamic4.gamespy.com/~freespace/fsdoc/index.php?pagename=Command-Line%20Reference#x2d.jpgtga",
|
||||
"-d3dmipmap", "Enable mipmapping", true, EASY_MEM_ALL_ON, EASY_DEFAULT_MEM, "Graphics", "http://dynamic4.gamespy.com/~freespace/fsdoc/index.php?pagename=Command-Line%20Reference#x2d.d3dmipmap",
|
||||
"-nomotiondebris","Disable motion debris", true, EASY_ALL_ON, EASY_DEFAULT, "Graphics", "http://dynamic4.gamespy.com/~freespace/fsdoc/index.php?pagename=Command-Line%20Reference#x2d.nomotiondebris",
|
||||
"-2d_poof", "Stops fog intersect hull", true, EASY_ALL_ON, EASY_DEFAULT, "Graphics", "http://dynamic4.gamespy.com/~freespace/fsdoc/index.php?pagename=Command-Line%20Reference#x2d.2d_poof",
|
||||
"-cell", "Enable cell shading", true, 0, EASY_DEFAULT, "Graphics", "http://dynamic4.gamespy.com/~freespace/fsdoc/index.php?pagename=Command-Line%20Reference#x2d.cell",
|
||||
{ "-spec", "Enable specular", true, EASY_ALL_ON, EASY_DEFAULT, "Graphics", "http://dynamic4.gamespy.com/~freespace/fsdoc/index.php?pagename=Command-Line%20Reference#x2d.spec", },
|
||||
{ "-glow", "Enable glowmaps", true, EASY_MEM_ALL_ON, EASY_DEFAULT_MEM, "Graphics", "http://dynamic4.gamespy.com/~freespace/fsdoc/index.php?pagename=Command-Line%20Reference#x2d.glow", },
|
||||
{ "-pcx32", "Enable 32bit textures", true, EASY_MEM_ALL_ON, EASY_DEFAULT_MEM, "Graphics", "http://dynamic4.gamespy.com/~freespace/fsdoc/index.php?pagename=Command-Line%20Reference#x2d.pcx32", },
|
||||
{ "-jpgtga", "Enable jpg,tga textures", true, EASY_MEM_ALL_ON, EASY_DEFAULT_MEM, "Graphics", "http://dynamic4.gamespy.com/~freespace/fsdoc/index.php?pagename=Command-Line%20Reference#x2d.jpgtga", },
|
||||
{ "-d3dmipmap", "Enable mipmapping", true, EASY_MEM_ALL_ON, EASY_DEFAULT_MEM, "Graphics", "http://dynamic4.gamespy.com/~freespace/fsdoc/index.php?pagename=Command-Line%20Reference#x2d.d3dmipmap", },
|
||||
{ "-nomotiondebris", "Disable motion debris", true, EASY_ALL_ON, EASY_DEFAULT, "Graphics", "http://dynamic4.gamespy.com/~freespace/fsdoc/index.php?pagename=Command-Line%20Reference#x2d.nomotiondebris",},
|
||||
{ "-2d_poof", "Stops fog intersect hull", true, EASY_ALL_ON, EASY_DEFAULT, "Graphics", "http://dynamic4.gamespy.com/~freespace/fsdoc/index.php?pagename=Command-Line%20Reference#x2d.2d_poof", },
|
||||
{ "-cell", "Enable cell shading", true, 0, EASY_DEFAULT, "Graphics", "http://dynamic4.gamespy.com/~freespace/fsdoc/index.php?pagename=Command-Line%20Reference#x2d.cell", },
|
||||
{ "-rlm", "Enable more realistic lighting", true, 0, EASY_DEFAULT, "Graphics", "", },
|
||||
{ "-noscalevid", "Disable scale-to-window for movies", true, 0, EASY_DEFAULT, "Graphics", "", },
|
||||
|
||||
"-pcx2dds", "Compress pcx", true, 0, EASY_DEFAULT, "Game Speed", "",
|
||||
"-d3d_no_vsync", "Disable vertical sync", true, 0, EASY_DEFAULT, "Game Speed", "http://dynamic4.gamespy.com/~freespace/fsdoc/index.php?pagename=Command-Line%20Reference#x2d.d3d_no_vsync",
|
||||
{ "-pcx2dds", "Compress pcx", true, 0, EASY_DEFAULT, "Game Speed", "", },
|
||||
{ "-d3d_no_vsync", "Disable vertical sync", true, 0, EASY_DEFAULT, "Game Speed", "http://dynamic4.gamespy.com/~freespace/fsdoc/index.php?pagename=Command-Line%20Reference#x2d.d3d_no_vsync", },
|
||||
|
||||
"-nobeampierce", "", true, 0, EASY_DEFAULT, "Gameplay", "http://dynamic4.gamespy.com/~freespace/fsdoc/index.php?pagename=Command-Line%20Reference#x2d.nobeampierce",
|
||||
"-dualscanlines", "Another pair of scanning lines", true, 0, EASY_DEFAULT, "Gameplay", "http://dynamic4.gamespy.com/~freespace/fsdoc/index.php?pagename=Command-Line%20Reference#x2d.dualscanlines",
|
||||
"-ship_choice_3d","Use models for ship selection", true, 0, EASY_DEFAULT, "Gameplay", "http://dynamic4.gamespy.com/~freespace/fsdoc/index.php?pagename=Command-Line%20Reference#x2d.ship_choice_3d",
|
||||
"-targetinfo", "Enable info next to target", true, 0, EASY_DEFAULT, "Gameplay", "http://dynamic4.gamespy.com/~freespace/fsdoc/index.php?pagename=Command-Line%20Reference#x2d.targetinfo",
|
||||
"-orbradar", "Enables 3d radar", true, 0, EASY_DEFAULT, "Gameplay", "",
|
||||
"-3dwarp", "Enable 3d warp", true, 0, EASY_DEFAULT, "Gameplay", "",
|
||||
"-tbpwarpeffects","Enable TBP Warp Effects", true, 0, EASY_DEFAULT, "Gameplay", "", // TBP warp effects -Et1
|
||||
"-ballistic_gauge", "Enable ballistic ammo gauge", true, 0, EASY_DEFAULT, "Gameplay", "",
|
||||
{ "-dualscanlines", "Another pair of scanning lines", true, 0, EASY_DEFAULT, "HUD", "http://dynamic4.gamespy.com/~freespace/fsdoc/index.php?pagename=Command-Line%20Reference#x2d.dualscanlines", },
|
||||
{ "-targetinfo", "Enable info next to target", true, 0, EASY_DEFAULT, "HUD", "http://dynamic4.gamespy.com/~freespace/fsdoc/index.php?pagename=Command-Line%20Reference#x2d.targetinfo", },
|
||||
{ "-orbradar", "Enables 3d radar", true, 0, EASY_DEFAULT, "HUD", "", },
|
||||
{ "-ballistic_gauge", "Enable the analog ballistic ammo gauge", true, 0, EASY_DEFAULT, "HUD", "", },
|
||||
|
||||
"-snd_preload", "Preload mission game sounds", true, EASY_MEM_ALL_ON, EASY_DEFAULT_MEM, "Audio", "http://dynamic4.gamespy.com/~freespace/fsdoc/index.php?pagename=Command-Line%20Reference#x2d.snd_preload",
|
||||
"-noaudio", "Disable sound and music", false, 0, EASY_DEFAULT, "Audio", "http://dynamic4.gamespy.com/~freespace/fsdoc/index.php?pagename=Command-Line%20Reference#x2d.nosound",
|
||||
"-nomusic", "Disable music", false, 0, EASY_DEFAULT, "Audio", "http://dynamic4.gamespy.com/~freespace/fsdoc/index.php?pagename=Command-Line%20Reference#x2d.nomusic",
|
||||
{ "-nobeampierce", "Disable beams piercing shields", true, 0, EASY_DEFAULT, "Gameplay", "http://dynamic4.gamespy.com/~freespace/fsdoc/index.php?pagename=Command-Line%20Reference#x2d.nobeampierce", },
|
||||
{ "-smart_shields", "Enable Smart Shields", true, 0, EASY_DEFAULT, "Gameplay", "", },
|
||||
{ "-ship_choice_3d", "Use models for ship selection", true, 0, EASY_DEFAULT, "Gameplay", "http://dynamic4.gamespy.com/~freespace/fsdoc/index.php?pagename=Command-Line%20Reference#x2d.ship_choice_3d", },
|
||||
{ "-3dwarp", "Enable 3d warp", true, 0, EASY_DEFAULT, "Gameplay", "", },
|
||||
{ "-tbpwarpeffects", "Toggle features for The Babylon Project", true, 0, EASY_DEFAULT, "Gameplay", "", }, // TBP warp effects -Et1
|
||||
{ "-wcsaga", "Toggle features for Wing Commander Saga", true, 0, EASY_DEFAULT, "Gameplay", "", },
|
||||
|
||||
"-standalone", "", false, 0, EASY_DEFAULT, "Multi", "http://dynamic4.gamespy.com/~freespace/fsdoc/index.php?pagename=Command-Line%20Reference#x2d.standalone",
|
||||
"-startgame", "", false, 0, EASY_DEFAULT, "Multi", "http://dynamic4.gamespy.com/~freespace/fsdoc/index.php?pagename=Command-Line%20Reference#x2d.startgame",
|
||||
"-closed", "", false, 0, EASY_DEFAULT, "Multi", "http://dynamic4.gamespy.com/~freespace/fsdoc/index.php?pagename=Command-Line%20Reference#x2d.closed",
|
||||
"-restricted", "", false, 0, EASY_DEFAULT, "Multi", "http://dynamic4.gamespy.com/~freespace/fsdoc/index.php?pagename=Command-Line%20Reference#x2d.restricted",
|
||||
"-multilog", "", false, 0, EASY_DEFAULT, "Multi", "http://dynamic4.gamespy.com/~freespace/fsdoc/index.php?pagename=Command-Line%20Reference#x2d.multilog",
|
||||
"-clientdamage", "", false, 0, EASY_DEFAULT, "Multi", "http://dynamic4.gamespy.com/~freespace/fsdoc/index.php?pagename=Command-Line%20Reference#x2d.clientdamage",
|
||||
"-mpnoreturn", "Disables flight deck option", true, 0, EASY_DEFAULT, "Multi", "http://dynamic4.gamespy.com/~freespace/fsdoc/index.php/Command-Line%20Reference#-mpnoreturn",
|
||||
{ "-snd_preload", "Preload mission game sounds", true, EASY_MEM_ALL_ON, EASY_DEFAULT_MEM, "Audio", "http://dynamic4.gamespy.com/~freespace/fsdoc/index.php?pagename=Command-Line%20Reference#x2d.snd_preload", },
|
||||
{ "-nosound", "Disable sound and music", false, 0, EASY_DEFAULT, "Audio", "http://dynamic4.gamespy.com/~freespace/fsdoc/index.php?pagename=Command-Line%20Reference#x2d.nosound", },
|
||||
{ "-nomusic", "Disable music", false, 0, EASY_DEFAULT, "Audio", "http://dynamic4.gamespy.com/~freespace/fsdoc/index.php?pagename=Command-Line%20Reference#x2d.nomusic", },
|
||||
|
||||
"-oldfire", "", true, 0, EASY_DEFAULT, "Troubleshoot", "http://dynamic4.gamespy.com/~freespace/fsdoc/index.php?pagename=Command-Line%20Reference#x2d.oldfire",
|
||||
"-nohtl", "Software mode (very slow)", true, 0, EASY_DEFAULT, "Troubleshoot", "http://dynamic4.gamespy.com/~freespace/fsdoc/index.php?pagename=Command-Line%20Reference#x2d.nohtl",
|
||||
"-no_set_gamma", "Disable setting of gamma", true, 0, EASY_DEFAULT, "Troubleshoot", "",
|
||||
"-dnoshowvid", "Disable video playback", true, 0, EASY_DEFAULT, "Troubleshoot", "http://dynamic4.gamespy.com/~freespace/fsdoc/index.php?pagename=Command-Line%20Reference#x2d.dnoshowvid",
|
||||
"-safeloading", "", true, 0, EASY_DEFAULT, "Troubleshoot", "http://dynamic4.gamespy.com/~freespace/fsdoc/index.php?pagename=Command-Line%20Reference#x2d.safeloading",
|
||||
"-query_speech", "Does this build have speech?", true, 0, EASY_DEFAULT, "Troubleshoot", "http://dynamic4.gamespy.com/~freespace/fsdoc/index.php?pagename=Command-Line%20Reference#x2d.query_speech",
|
||||
"-d3d_bad_tsys", "Enable inefficient textures", false, 0, EASY_DEFAULT, "Troubleshoot", "http://dynamic4.gamespy.com/~freespace/fsdoc/index.php?pagename=Command-Line%20Reference#x2d.d3d_bad_tsys",
|
||||
"-novbo", "Disable OpenGL VBO", true, 0, EASY_DEFAULT, "Troubleshoot", "",
|
||||
{ "-standalone", "", false, 0, EASY_DEFAULT, "Multi", "http://dynamic4.gamespy.com/~freespace/fsdoc/index.php?pagename=Command-Line%20Reference#x2d.standalone", },
|
||||
{ "-startgame", "", false, 0, EASY_DEFAULT, "Multi", "http://dynamic4.gamespy.com/~freespace/fsdoc/index.php?pagename=Command-Line%20Reference#x2d.startgame", },
|
||||
{ "-closed", "", false, 0, EASY_DEFAULT, "Multi", "http://dynamic4.gamespy.com/~freespace/fsdoc/index.php?pagename=Command-Line%20Reference#x2d.closed", },
|
||||
{ "-restricted", "", false, 0, EASY_DEFAULT, "Multi", "http://dynamic4.gamespy.com/~freespace/fsdoc/index.php?pagename=Command-Line%20Reference#x2d.restricted", },
|
||||
{ "-multilog", "", false, 0, EASY_DEFAULT, "Multi", "http://dynamic4.gamespy.com/~freespace/fsdoc/index.php?pagename=Command-Line%20Reference#x2d.multilog", },
|
||||
{ "-clientdamage", "", false, 0, EASY_DEFAULT, "Multi", "http://dynamic4.gamespy.com/~freespace/fsdoc/index.php?pagename=Command-Line%20Reference#x2d.clientdamage", },
|
||||
{ "-mpnoreturn", "Disables flight deck option", true, 0, EASY_DEFAULT, "Multi", "http://dynamic4.gamespy.com/~freespace/fsdoc/index.php/Command-Line%20Reference#-mpnoreturn", },
|
||||
#ifdef WIN32
|
||||
// { "-fixbugs", "Fix bugs", true, 0, EASY_DEFAULT, "Troubleshoot", "", },
|
||||
// { "-nocrash", "Disable crashing", true, 0, EASY_DEFAULT, "Troubleshoot", "", },
|
||||
#endif
|
||||
{ "-oldfire", "", true, 0, EASY_DEFAULT, "Troubleshoot", "http://dynamic4.gamespy.com/~freespace/fsdoc/index.php?pagename=Command-Line%20Reference#x2d.oldfire", },
|
||||
{ "-nohtl", "Software mode (very slow)", true, 0, EASY_DEFAULT, "Troubleshoot", "http://dynamic4.gamespy.com/~freespace/fsdoc/index.php?pagename=Command-Line%20Reference#x2d.nohtl", },
|
||||
{ "-no_set_gamma", "Disable setting of gamma", true, 0, EASY_DEFAULT, "Troubleshoot", "", },
|
||||
{ "-dnoshowvid", "Disable video playback", true, 0, EASY_DEFAULT, "Troubleshoot", "http://dynamic4.gamespy.com/~freespace/fsdoc/index.php?pagename=Command-Line%20Reference#x2d.dnoshowvid", },
|
||||
{ "-noparseerrors", "Disable parsing errors", true, 0, EASY_DEFAULT, "Troubleshoot", "", },
|
||||
{ "-safeloading", "", true, 0, EASY_DEFAULT, "Troubleshoot", "http://dynamic4.gamespy.com/~freespace/fsdoc/index.php?pagename=Command-Line%20Reference#x2d.safeloading", },
|
||||
{ "-query_speech", "Does this build have speech?", true, 0, EASY_DEFAULT, "Troubleshoot", "http://dynamic4.gamespy.com/~freespace/fsdoc/index.php?pagename=Command-Line%20Reference#x2d.query_speech", },
|
||||
{ "-d3d_bad_tsys", "Enable inefficient textures", false, 0, EASY_DEFAULT, "Troubleshoot", "http://dynamic4.gamespy.com/~freespace/fsdoc/index.php?pagename=Command-Line%20Reference#x2d.d3d_bad_tsys", },
|
||||
{ "-novbo", "Disable OpenGL VBO", true, 0, EASY_DEFAULT, "Troubleshoot", "", },
|
||||
{ "-noibx", "Don't use cached index buffers (IBX)", true, 0, EASY_DEFAULT, "Troubleshoot", "", },
|
||||
|
||||
"-env", "environment mapping maping", true, 0, EASY_DEFAULT, "Experimental", "http://dynamic4.gamespy.com/~freespace/fsdoc/index.php?pagename=Command-Line%20Reference#x2d.env",
|
||||
"-alpha_env", "uses uses alpha for env maping", true, 0, EASY_DEFAULT, "Experimental", "http://dynamic4.gamespy.com/~freespace/fsdoc/index.php?pagename=Command-Line%20Reference#x2d.alpha_env",
|
||||
"-decals", "impact decals", true, 0, EASY_DEFAULT, "Experimental", "http://dynamic4.gamespy.com/~freespace/fsdoc/index.php?pagename=Command-Line%20Reference#x2d.decals",
|
||||
"-loadonlyused", "Loads only used weapons", true, 0, EASY_DEFAULT, "Experimental", "",
|
||||
{ "-env", "environment mapping", true, 0, EASY_DEFAULT, "Experimental", "http://dynamic4.gamespy.com/~freespace/fsdoc/index.php?pagename=Command-Line%20Reference#x2d.env", },
|
||||
{ "-alpha_env", "uses alpha for env maping", true, 0, EASY_DEFAULT, "Experimental", "http://dynamic4.gamespy.com/~freespace/fsdoc/index.php?pagename=Command-Line%20Reference#x2d.alpha_env", },
|
||||
{ "-decals", "impact decals", true, 0, EASY_DEFAULT, "Experimental", "http://dynamic4.gamespy.com/~freespace/fsdoc/index.php?pagename=Command-Line%20Reference#x2d.decals", },
|
||||
{ "-loadonlyused", "Loads only used weapons", true, 0, EASY_DEFAULT, "Experimental", "", },
|
||||
{ "-ingame_join", "Allows ingame joining", true, 0, EASY_DEFAULT, "Experimental", "", },
|
||||
{ "-tga16", "Convert 32-bit TGAs to 16-bit", true, 0, EASY_DEFAULT, "Experimental", "", },
|
||||
|
||||
"-fps", "Show frames per seconds", false, 0, EASY_DEFAULT, "Dev Tool", "http://dynamic4.gamespy.com/~freespace/fsdoc/index.php?pagename=Command-Line%20Reference#x2d.fps",
|
||||
"-window", "Run in window", true, 0, EASY_DEFAULT, "Dev Tool", "http://dynamic4.gamespy.com/~freespace/fsdoc/index.php?pagename=Command-Line%20Reference#x2d.window",
|
||||
"-timerbar", "", true, 0, EASY_DEFAULT, "Dev Tool", "http://dynamic4.gamespy.com/~freespace/fsdoc/index.php?pagename=Command-Line%20Reference#x2d.timerbar",
|
||||
"-stats", "Show statistics", true, 0, EASY_DEFAULT, "Dev Tool", "http://dynamic4.gamespy.com/~freespace/fsdoc/index.php?pagename=Command-Line%20Reference#x2d.stats",
|
||||
"-coords", "Show coordinates", false, 0, EASY_DEFAULT, "Dev Tool", "http://dynamic4.gamespy.com/~freespace/fsdoc/index.php?pagename=Command-Line%20Reference#x2d.coords",
|
||||
"-show_mem_usage","Show memory usage", true, 0, EASY_DEFAULT, "Dev Tool", "http://dynamic4.gamespy.com/~freespace/fsdoc/index.php?pagename=Command-Line%20Reference#x2d.show_mem_usage",
|
||||
"-pofspew", "", false, 0, EASY_DEFAULT, "Dev Tool", "http://dynamic4.gamespy.com/~freespace/fsdoc/index.php?pagename=Command-Line%20Reference#x2d.pofspew",
|
||||
"-tablecrcs", "", true, 0, EASY_DEFAULT, "Dev Tool", "http://dynamic4.gamespy.com/~freespace/fsdoc/index.php?pagename=Command-Line%20Reference#x2d.tablecrcs",
|
||||
"-missioncrcs", "", true, 0, EASY_DEFAULT, "Dev Tool", "http://dynamic4.gamespy.com/~freespace/fsdoc/index.php?pagename=Command-Line%20Reference#x2d.missioncrcs",
|
||||
{ "-fps", "Show frames per second on HUD", false, 0, EASY_DEFAULT, "Dev Tool", "http://dynamic4.gamespy.com/~freespace/fsdoc/index.php?pagename=Command-Line%20Reference#x2d.fps", },
|
||||
{ "-pos", "Show position of camera", false, 0, EASY_DEFAULT, "Dev Tool", "http://dynamic4.gamespy.com/~freespace/fsdoc/index.php?pagename=Command-Line%20Reference#x2d.pos", },
|
||||
{ "-window", "Run in window", true, 0, EASY_DEFAULT, "Dev Tool", "http://dynamic4.gamespy.com/~freespace/fsdoc/index.php?pagename=Command-Line%20Reference#x2d.window", },
|
||||
{ "-timerbar", "", true, 0, EASY_DEFAULT, "Dev Tool", "http://dynamic4.gamespy.com/~freespace/fsdoc/index.php?pagename=Command-Line%20Reference#x2d.timerbar", },
|
||||
{ "-stats", "Show statistics", true, 0, EASY_DEFAULT, "Dev Tool", "http://dynamic4.gamespy.com/~freespace/fsdoc/index.php?pagename=Command-Line%20Reference#x2d.stats", },
|
||||
{ "-coords", "Show coordinates", false, 0, EASY_DEFAULT, "Dev Tool", "http://dynamic4.gamespy.com/~freespace/fsdoc/index.php?pagename=Command-Line%20Reference#x2d.coords", },
|
||||
{ "-show_mem_usage", "Show memory usage", true, 0, EASY_DEFAULT, "Dev Tool", "http://dynamic4.gamespy.com/~freespace/fsdoc/index.php?pagename=Command-Line%20Reference#x2d.show_mem_usage", },
|
||||
{ "-pofspew", "", false, 0, EASY_DEFAULT, "Dev Tool", "http://dynamic4.gamespy.com/~freespace/fsdoc/index.php?pagename=Command-Line%20Reference#x2d.pofspew", },
|
||||
{ "-tablecrcs", "", true, 0, EASY_DEFAULT, "Dev Tool", "http://dynamic4.gamespy.com/~freespace/fsdoc/index.php?pagename=Command-Line%20Reference#x2d.tablecrcs", },
|
||||
{ "-missioncrcs", "", true, 0, EASY_DEFAULT, "Dev Tool", "http://dynamic4.gamespy.com/~freespace/fsdoc/index.php?pagename=Command-Line%20Reference#x2d.missioncrcs", },
|
||||
{ "-dis_collisions", "Disable collisions", true, 0, EASY_DEFAULT, "Dev Tool", "", },
|
||||
{ "-dis_weapons", "Disable weapon rendering", true, 0, EASY_DEFAULT, "Dev Tool", "", },
|
||||
{ "-output_sexps", "Outputs SEXPs to sexps.html", true, 0, EASY_DEFAULT, "Dev Tool", "", },
|
||||
};
|
||||
|
||||
// here are the command line parameters that we will be using for FreeSpace
|
||||
@@ -761,12 +861,16 @@ cmdline_parm allslev_arg("-allslev", NULL); //Give access to all single player m
|
||||
cmdline_parm dualscanlines_arg("-dualscanlines", NULL); // Change to phreaks options including new targetting code
|
||||
cmdline_parm targetinfo_arg("-targetinfo", NULL); //Adds ship name/class to right of target box -C
|
||||
cmdline_parm dnoshowvid_arg("-dnoshowvid", NULL); // Allows video streaming
|
||||
cmdline_parm noscalevid_arg("-noscalevid", NULL); // disable video scaling that fits to window
|
||||
cmdline_parm noparseerrors_arg("-noparseerrors", NULL); //turns off parsing errors -C
|
||||
cmdline_parm mod_arg("-mod", NULL); //DTP modsupport
|
||||
cmdline_parm fps_arg("-fps", NULL);
|
||||
cmdline_parm pos_arg("-pos", NULL);
|
||||
cmdline_parm cache_ani_arg("-cache_ani", NULL);
|
||||
cmdline_parm d3dmipmap_arg("-d3dmipmap", NULL);
|
||||
cmdline_parm beams_no_pierce_shields_arg("-nobeampierce", NULL); // beams do not pierce shields - Goober5000
|
||||
cmdline_parm fov_arg("-fov", NULL); // comand line FOV -Bobboau
|
||||
cmdline_parm clip_dist_arg("-clipdist", NULL);
|
||||
cmdline_parm spec_exp_arg("-spec_exp", NULL); // comand line FOV -Bobboau
|
||||
cmdline_parm spec_point_arg("-spec_point", NULL); // comand line FOV -Bobboau
|
||||
cmdline_parm spec_static_arg("-spec_static", NULL); // comand line FOV -Bobboau
|
||||
@@ -782,6 +886,9 @@ cmdline_parm cell_arg("-cell", NULL);
|
||||
cmdline_parm jpgtga_arg("-jpgtga",NULL);
|
||||
cmdline_parm no_set_gamma_arg("-no_set_gamma",NULL);
|
||||
cmdline_parm d3d_no_vsync_arg("-d3d_no_vsync", NULL);
|
||||
#ifdef SCP_UNIX
|
||||
cmdline_parm no_grab("-nograb", NULL);
|
||||
#endif
|
||||
cmdline_parm pcx32_arg("-pcx32",NULL);
|
||||
cmdline_parm pcx32dds_arg("-pcx2dds",NULL);
|
||||
cmdline_parm timerbar_arg("-timerbar", NULL);
|
||||
@@ -792,9 +899,11 @@ cmdline_parm dxt_arg("-dxt",NULL);
|
||||
cmdline_parm d3d_particle_arg("-d3d_particle",NULL);
|
||||
cmdline_parm show_mem_usage_arg("-show_mem_usage",NULL);
|
||||
cmdline_parm rt_arg("-rt",NULL);
|
||||
cmdline_parm ingamejoin_arg("-ingame", NULL);
|
||||
cmdline_parm start_mission_arg("-start_mission",NULL);
|
||||
cmdline_parm ambient_factor_arg("-ambient_factor",NULL);
|
||||
cmdline_parm get_flags_arg("-get_flags",NULL);
|
||||
cmdline_parm output_sexp_arg("-output_sexps",NULL); //WMC - outputs all SEXPs to sexps.html
|
||||
cmdline_parm d3d_lesstmem_arg("-d3d_bad_tsys",NULL);
|
||||
cmdline_parm batch_3dunlit_arg("-batch_3dunlit",NULL);
|
||||
cmdline_parm fred2_htl_arg("-fredhtl",NULL);
|
||||
@@ -807,9 +916,19 @@ cmdline_parm orb_radar("-orbradar",NULL);
|
||||
cmdline_parm TBPWarpEffects( "-tbpwarpeffects", NULL ); // TBP warp effects -Et1
|
||||
cmdline_parm use_3dwarp("-3dwarp", NULL);
|
||||
cmdline_parm ballistic_gauge("-ballistic_gauge", NULL );
|
||||
cmdline_parm use_rlm("-rlm", NULL); // more realistic lighting model - taylor
|
||||
cmdline_parm smart_shields("-smart_shields", NULL);
|
||||
cmdline_parm dis_collisions("-dis_collisions", NULL);
|
||||
cmdline_parm dis_weapons("-dis_weapons", NULL);
|
||||
cmdline_parm noibx_arg("-noibx", NULL);
|
||||
#ifdef WIN32
|
||||
cmdline_parm fix_bugs("-fixbugs", NULL);
|
||||
cmdline_parm disable_crashing("-nocrash", NULL);
|
||||
#endif
|
||||
|
||||
//Experimental
|
||||
cmdline_parm load_only_used("-loadonlyused", NULL);
|
||||
cmdline_parm tga16_arg("-tga16", NULL); // 32-bit TGA to 16-bit conversion
|
||||
|
||||
cmdline_parm poof_2d_arg("-2d_poof", NULL);
|
||||
cmdline_parm Radar_Range_Clamp("-radar_reduce", NULL);
|
||||
@@ -819,6 +938,8 @@ cmdline_parm snd_preload_arg("-snd_preload", NULL);
|
||||
|
||||
cmdline_parm no_fpscap("-no_fps_capping", NULL);
|
||||
|
||||
cmdline_parm wcsaga("-wcsaga", NULL);
|
||||
|
||||
int Cmdline_mpnoreturn = 0;
|
||||
int Cmdline_show_stats = 0;
|
||||
int Cmdline_timerbar = 0;
|
||||
@@ -853,13 +974,20 @@ int Cmdline_d3d_particle = 0;
|
||||
int Cmdline_orb_radar = 0;
|
||||
int Cmdline_TBPWarpEffects = 0; // TBP warp effects -Et1
|
||||
int Cmdline_3dwarp = 0;
|
||||
int Cmdline_smart_shields = 0;
|
||||
int Cmdline_dis_collisions = 0;
|
||||
int Cmdline_dis_weapons = 0;
|
||||
int Cmdline_noibx = 0;
|
||||
|
||||
int Cmdline_window = 0;
|
||||
int Cmdline_allslev = 0;
|
||||
int Cmdline_dualscanlines = 0;
|
||||
int Cmdline_targetinfo = 0;
|
||||
int Cmdline_dnoshowvid = 0;
|
||||
int Cmdline_noscalevid = 0;
|
||||
int Cmdline_noparseerrors = 0;
|
||||
int Cmdline_show_fps = 0;
|
||||
int Cmdline_show_pos = 0;
|
||||
int Cmdline_safeloading = 0;
|
||||
int Cmdline_nospec = 0;
|
||||
int Cmdline_noglow = 0;
|
||||
@@ -868,10 +996,15 @@ int Cmdline_dxt = 0;
|
||||
int Cmdline_cache_ani = 0;
|
||||
int Cmdline_d3dmipmap = 0;
|
||||
int Cmdline_rt = 0;
|
||||
int Cmdline_ingamejoin = 0;
|
||||
char *Cmdline_start_mission = NULL;
|
||||
int Cmdline_ambient_factor = 128;
|
||||
int Cmdline_2d_poof = 0;
|
||||
|
||||
#ifdef SCP_UNIX
|
||||
int Cmdline_no_grab = 0;
|
||||
#endif
|
||||
|
||||
// Lets keep a convention here
|
||||
int Cmdline_nohtl = 0;
|
||||
int Cmdline_jpgtga = 0;
|
||||
@@ -891,8 +1024,11 @@ int CmdLine_NoWarn = 0; // turn warnings off in FRED
|
||||
|
||||
int Cmdline_ballistic_gauge = 0; // WMCoolmon's gauge thingy
|
||||
|
||||
int Cmdline_rlm = 0; // more realistic lighting model - taylor
|
||||
|
||||
//Experimental
|
||||
int Cmdline_load_only_used;
|
||||
int Cmdline_tga16 = 0;
|
||||
|
||||
int Cmdline_novbo = 0; // turn off OGL VBO support, troubleshooting
|
||||
int Cmdline_snd_preload = 0; // preload game sounds during mission load
|
||||
@@ -905,12 +1041,16 @@ static cmdline_parm Parm_list(NULL, NULL);
|
||||
static int Parm_list_inited = 0;
|
||||
|
||||
float Cmdline_fov = 0.75f;
|
||||
float Cmdline_clip_dist = Default_min_draw_distance;
|
||||
extern float VIEWER_ZOOM_DEFAULT;
|
||||
extern float Viewer_zoom;
|
||||
|
||||
int Cmdline_cell = 0;
|
||||
int Cmdline_batch_3dunlit = 0;
|
||||
|
||||
// Goober5000
|
||||
int Cmdline_wcsaga = 0;
|
||||
|
||||
// Return true if this character is an extra char (white space and quotes)
|
||||
int is_extra_space(char ch)
|
||||
{
|
||||
@@ -1016,11 +1156,47 @@ void os_validate_parms(char *cmdline)
|
||||
}
|
||||
|
||||
if (parm_found == 0) {
|
||||
#ifdef _WIN32
|
||||
// Changed this to MessageBox, this is a user error not a developer
|
||||
char buffer[128];
|
||||
sprintf(buffer,"Unrecogzined command line parameter %s, continue?",token);
|
||||
if( MessageBox(NULL, buffer, "Warning", MB_OKCANCEL | MB_ICONQUESTION) == IDCANCEL)
|
||||
exit(0);
|
||||
#elif defined(APPLE_APP)
|
||||
CFStringRef message;
|
||||
char buffer[128];
|
||||
CFOptionFlags result;
|
||||
|
||||
snprintf(buffer, 128, "Unrecognized command line parameter, \"%s\", continue?", token);
|
||||
message = CFStringCreateWithCString(NULL, buffer, kCFStringEncodingASCII);
|
||||
|
||||
if ( CFUserNotificationDisplayAlert(0, kCFUserNotificationPlainAlertLevel, NULL, NULL, NULL, CFSTR("Unknown Command"), message, NULL, CFSTR("Quit"), NULL, &result) )
|
||||
exit(0);
|
||||
|
||||
if (result != kCFUserNotificationDefaultResponse)
|
||||
exit(0);
|
||||
#else
|
||||
// if we got a -help, --help, or -h then show the help text, otherwise so unknown option
|
||||
if ( !stricmp(token, "-help") || !stricmp(token, "--help") || !stricmp(token, "-h") ) {
|
||||
printf("FS2 Open: The Source Code Project, version %i.%i.%i\n", FS_VERSION_MAJOR, FS_VERSION_MINOR, FS_VERSION_BUILD);
|
||||
printf("Website: http://scp.indiegames.us\n");
|
||||
printf("Mantis (bug reporting): http://lore.maxgaming.net/~scp/mantis/\n\n");
|
||||
printf("Usage: fs2_open [options]\n");
|
||||
|
||||
// not the prettiest thing but the job gets done
|
||||
static const int STR_SIZE = 25; // max len of exe_params.name + 5 spaces
|
||||
int p=0, sp=0;
|
||||
while (exe_params[p].name[0] == '-') {
|
||||
sp = strlen(exe_params[p].name);
|
||||
printf(" [ %s ]%*s- %s\n", exe_params[p].name, (STR_SIZE - sp - 1), NOX(" "), exe_params[p].desc);
|
||||
p++;
|
||||
}
|
||||
} else {
|
||||
printf("Unrecognized command line parameter \"%s\". Exiting...\n", token);
|
||||
}
|
||||
printf("\n");
|
||||
exit(0);
|
||||
#endif
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1039,7 +1215,25 @@ void os_init_cmdline(char *cmdline)
|
||||
// read the cmdline.cfg file from the data folder, and pass the command line arguments to
|
||||
// the the parse_parms and validate_parms line. Read these first so anything actually on
|
||||
// the command line will take precedence
|
||||
#ifdef _WIN32
|
||||
fp = fopen("data\\cmdline_fso.cfg", "rt");
|
||||
#elif defined(APPLE_APP)
|
||||
extern char full_path[1024];
|
||||
char *c = NULL, data_path[1024];
|
||||
|
||||
c = strstr(full_path, ".app");
|
||||
if ( c != NULL ) {
|
||||
while (c && (*c != '/'))
|
||||
c--;
|
||||
|
||||
*c = '\0';
|
||||
}
|
||||
snprintf(data_path, 1024, "%s/data/cmdline_fso.cfg", full_path);
|
||||
|
||||
fp = fopen(data_path, "rt");
|
||||
#else
|
||||
fp = fopen("data/cmdline_fso.cfg", "rt");
|
||||
#endif
|
||||
|
||||
// if the file exists, get a single line, and deal with it
|
||||
if ( fp ) {
|
||||
@@ -1052,11 +1246,49 @@ void os_init_cmdline(char *cmdline)
|
||||
*p = '\0';
|
||||
}
|
||||
|
||||
#ifdef SCP_UNIX
|
||||
// append a space for the os_parse_parms() check
|
||||
strcat(buf, " ");
|
||||
#endif
|
||||
|
||||
os_parse_parms(buf);
|
||||
os_validate_parms(buf);
|
||||
fclose(fp);
|
||||
}
|
||||
|
||||
#ifdef SCP_UNIX
|
||||
// parse user specific cmdline config file (will supersede options in global file)
|
||||
char cmdname[MAX_PATH];
|
||||
|
||||
snprintf(cmdname, MAX_PATH, "%s/%s/data/cmdline_fso.cfg", detect_home(), Osreg_user_dir);
|
||||
fp = fopen(cmdname, "rt");
|
||||
|
||||
if ( !fp ) {
|
||||
// try for non "_fso", for older code versions
|
||||
snprintf(cmdname, MAX_PATH, "%s/%s/data/cmdline.cfg", detect_home(), Osreg_user_dir);
|
||||
fp = fopen(cmdname, "rt");
|
||||
}
|
||||
|
||||
// if the file exists, get a single line, and deal with it
|
||||
if ( fp ) {
|
||||
char buf[1024], *p;
|
||||
|
||||
fgets(buf, 1024, fp);
|
||||
|
||||
// replace the newline character with a NULL
|
||||
if ( (p = strrchr(buf, '\n')) != NULL ) {
|
||||
*p = '\0';
|
||||
}
|
||||
|
||||
// append a space for the os_parse_parms() check
|
||||
strcat(buf, " ");
|
||||
|
||||
os_parse_parms(buf);
|
||||
os_validate_parms(buf);
|
||||
fclose(fp);
|
||||
}
|
||||
#endif
|
||||
|
||||
os_parse_parms(cmdline);
|
||||
os_validate_parms(cmdline);
|
||||
}
|
||||
@@ -1101,6 +1333,47 @@ int cmdline_parm::found()
|
||||
return name_found;
|
||||
}
|
||||
|
||||
void output_sexp_html(int sexp_idx, FILE *fp)
|
||||
{
|
||||
if(sexp_idx < 0 || sexp_idx > Num_operators)
|
||||
return;
|
||||
|
||||
bool printed=false;
|
||||
|
||||
for(int i = 0; i < Num_sexp_help; i++)
|
||||
{
|
||||
if(Sexp_help[i].id == Operators[sexp_idx].value)
|
||||
{
|
||||
char* new_buf = new char[2*strlen(Sexp_help[i].help)];
|
||||
char* dest_ptr = new_buf;
|
||||
char* curr_ptr = Sexp_help[i].help;
|
||||
char* end_ptr = curr_ptr + strlen(Sexp_help[i].help);
|
||||
while(curr_ptr < end_ptr)
|
||||
{
|
||||
if(*curr_ptr == '\n')
|
||||
{
|
||||
strcpy(dest_ptr, "\n<br>");
|
||||
dest_ptr+=5;
|
||||
}
|
||||
else
|
||||
{
|
||||
*dest_ptr++ = *curr_ptr;
|
||||
}
|
||||
curr_ptr++;
|
||||
}
|
||||
*dest_ptr = '\0';
|
||||
|
||||
fprintf(fp, "<dt><b>%s</b></dt>\n<dd>%s</dd>\n", Operators[sexp_idx].text, new_buf);
|
||||
delete[] new_buf;
|
||||
|
||||
printed = true;
|
||||
}
|
||||
}
|
||||
|
||||
if(!printed)
|
||||
fprintf(fp, "<dt><b>%s</b></dt>\n<dd>Min arguments: %d, Max arguments: %d</dd>\n", Operators[sexp_idx].text, Operators[sexp_idx].min, Operators[sexp_idx].max);
|
||||
}
|
||||
|
||||
|
||||
// returns - the interger representation for the parameter arguement
|
||||
int cmdline_parm::get_int()
|
||||
@@ -1306,6 +1579,14 @@ bool SetCmdlineParams()
|
||||
Cmdline_dnoshowvid = 1;
|
||||
}
|
||||
|
||||
if ( noscalevid_arg.found() ) {
|
||||
Cmdline_noscalevid = 1;
|
||||
}
|
||||
|
||||
if(noparseerrors_arg.found()) {
|
||||
Cmdline_noparseerrors = 1;
|
||||
}
|
||||
|
||||
|
||||
if(mod_arg.found() ) {
|
||||
Cmdline_mod = mod_arg.str();
|
||||
@@ -1346,6 +1627,11 @@ bool SetCmdlineParams()
|
||||
Cmdline_show_fps = 1;
|
||||
}
|
||||
|
||||
if(pos_arg.found())
|
||||
{
|
||||
Cmdline_show_pos = 1;
|
||||
}
|
||||
|
||||
if ( safeloading_arg.found() ) {
|
||||
Cmdline_safeloading = 1;
|
||||
}
|
||||
@@ -1374,6 +1660,10 @@ bool SetCmdlineParams()
|
||||
Viewer_zoom = VIEWER_ZOOM_DEFAULT = Cmdline_fov = fov_arg.get_float();
|
||||
}
|
||||
|
||||
if( clip_dist_arg.found() ) {
|
||||
Min_draw_distance = Cmdline_clip_dist = clip_dist_arg.get_float();
|
||||
}
|
||||
|
||||
if (orb_radar.found())
|
||||
{
|
||||
Cmdline_orb_radar = 1;
|
||||
@@ -1441,6 +1731,13 @@ bool SetCmdlineParams()
|
||||
Cmdline_d3d_no_vsync = 1;
|
||||
}
|
||||
|
||||
#ifdef SCP_UNIX
|
||||
// no key/mouse grab
|
||||
if(no_grab.found()){
|
||||
Cmdline_no_grab = 1;
|
||||
}
|
||||
#endif
|
||||
|
||||
if(pcx32_arg.found() )
|
||||
{
|
||||
Cmdline_pcx32 = 1;
|
||||
@@ -1492,6 +1789,11 @@ bool SetCmdlineParams()
|
||||
Cmdline_rt = 1;
|
||||
}
|
||||
|
||||
if(ingamejoin_arg.found())
|
||||
{
|
||||
Cmdline_ingamejoin = 1;
|
||||
}
|
||||
|
||||
if(start_mission_arg.found())
|
||||
{
|
||||
Cmdline_start_mission = start_mission_arg.str();
|
||||
@@ -1515,8 +1817,97 @@ bool SetCmdlineParams()
|
||||
Cmdline_ambient_factor = ambient_factor_arg.get_int();
|
||||
}
|
||||
|
||||
if(output_sexp_arg.found())
|
||||
{
|
||||
extern int Num_op_menus;
|
||||
extern int Num_submenus;
|
||||
|
||||
FILE *fp = fopen("sexps.html","w");
|
||||
|
||||
if(fp == NULL)
|
||||
{
|
||||
MessageBox(NULL,"Error creating SEXP operator list", "Error", MB_OK);
|
||||
return false;
|
||||
}
|
||||
|
||||
//Header
|
||||
fprintf(fp, "<html>\n<head>\n\t<title>SEXP Output: %d.%d.%d</title>\n</head>\n", FS_VERSION_MAJOR, FS_VERSION_MINOR, FS_VERSION_BUILD);
|
||||
fputs("<body>", fp);
|
||||
fprintf(fp,"\t<h1>Sexp Output - Build %d.%d.%d</h1>\n", FS_VERSION_MAJOR, FS_VERSION_MINOR, FS_VERSION_BUILD);
|
||||
|
||||
std::vector<int> done_sexp_ids;
|
||||
int x,y,z;
|
||||
|
||||
//Output an overview
|
||||
fputs("<dl>", fp);
|
||||
for(x = 0; x < Num_op_menus; x++)
|
||||
{
|
||||
fprintf(fp, "<dt><a href=\"#%d\">%s</a></dt>", (op_menu[x].id & OP_CATEGORY_MASK), op_menu[x].name);
|
||||
for(y = 0; y < Num_submenus; y++)
|
||||
{
|
||||
if(((op_submenu[y].id & OP_CATEGORY_MASK) == op_menu[x].id))
|
||||
{
|
||||
fprintf(fp, "<dd><a href=\"#%d\">%s</a></dd>", op_submenu[y].id & (OP_CATEGORY_MASK | SUBCATEGORY_MASK), op_submenu[y].name);
|
||||
}
|
||||
}
|
||||
}
|
||||
fputs("</dl>", fp);
|
||||
|
||||
//Output the full descriptions
|
||||
fputs("<dl>", fp);
|
||||
for(x = 0; x < Num_op_menus; x++)
|
||||
{
|
||||
fprintf(fp, "<dt id=\"%d\"><h2>%s</h2></dt>\n", (op_menu[x].id & OP_CATEGORY_MASK), op_menu[x].name);
|
||||
fputs("<dd>", fp);
|
||||
fputs("<dl>", fp);
|
||||
for(y = 0; y < Num_submenus; y++)
|
||||
{
|
||||
if(((op_submenu[y].id & OP_CATEGORY_MASK) == op_menu[x].id))
|
||||
{
|
||||
fprintf(fp, "<dt id=\"%d\"><h3>%s</h3></dt>\n", op_submenu[y].id & (OP_CATEGORY_MASK | SUBCATEGORY_MASK), op_submenu[y].name);
|
||||
fputs("<dd>", fp);
|
||||
fputs("<dl>", fp);
|
||||
for(z = 0; z < Num_operators; z++)
|
||||
{
|
||||
if(((Operators[z].value & OP_CATEGORY_MASK) == op_menu[x].id)
|
||||
&& (get_subcategory(Operators[z].value) != -1)
|
||||
&& (get_subcategory(Operators[z].value) == op_submenu[y].id))
|
||||
{
|
||||
output_sexp_html(z, fp);
|
||||
}
|
||||
}
|
||||
fputs("</dl>", fp);
|
||||
fputs("</dd>", fp);
|
||||
}
|
||||
}
|
||||
for(z = 0; z < Num_operators; z++)
|
||||
{
|
||||
if(((Operators[z].value & OP_CATEGORY_MASK) == op_menu[x].id)
|
||||
&& (get_subcategory(Operators[z].value) == -1))
|
||||
{
|
||||
output_sexp_html(z, fp);
|
||||
}
|
||||
}
|
||||
fputs("</dl>", fp);
|
||||
fputs("</dd>", fp);
|
||||
}
|
||||
for(z = 0; z < Num_operators; z++)
|
||||
{
|
||||
if(!(Operators[z].value & OP_CATEGORY_MASK))
|
||||
{
|
||||
output_sexp_html(z, fp);
|
||||
}
|
||||
}
|
||||
fputs("</dl>", fp);
|
||||
fputs("</body>\n</html>\n", fp);
|
||||
|
||||
fclose(fp);
|
||||
return false;
|
||||
}
|
||||
|
||||
if(get_flags_arg.found())
|
||||
{
|
||||
mprintf(("I got to get_flags_arg.found()!!\n"));
|
||||
FILE *fp = fopen("flags.lch","w");
|
||||
|
||||
if(fp == NULL)
|
||||
@@ -1592,6 +1983,83 @@ bool SetCmdlineParams()
|
||||
Cmdline_ballistic_gauge = 0;
|
||||
}
|
||||
|
||||
if (wcsaga.found())
|
||||
{
|
||||
Cmdline_wcsaga = 1;
|
||||
}
|
||||
|
||||
if ( use_rlm.found() ) {
|
||||
Cmdline_rlm = 1;
|
||||
} else {
|
||||
Cmdline_rlm = 0;
|
||||
}
|
||||
|
||||
if ( smart_shields.found())
|
||||
{
|
||||
Cmdline_smart_shields = 1;
|
||||
}
|
||||
else
|
||||
{
|
||||
Cmdline_smart_shields = 0;
|
||||
}
|
||||
|
||||
if(dis_collisions.found())
|
||||
Cmdline_dis_collisions = 1;
|
||||
|
||||
if(dis_weapons.found())
|
||||
Cmdline_dis_weapons = 1;
|
||||
|
||||
if ( noibx_arg.found() ) {
|
||||
Cmdline_noibx = 1;
|
||||
}
|
||||
|
||||
if ( tga16_arg.found() ) {
|
||||
Cmdline_tga16 = 1;
|
||||
}
|
||||
|
||||
#ifdef WIN32
|
||||
extern uint os_get_window();
|
||||
if( fix_bugs.found() )
|
||||
{
|
||||
MessageBox((HWND)os_get_window(), "Could not get lock on RAID controller, driver may be too old. Auto-bugfixing is disabled", "FS2_Open Warning", MB_ICONWARNING);
|
||||
}
|
||||
|
||||
if( disable_crashing.found())
|
||||
{
|
||||
if(IDRETRY == MessageBox((HWND)os_get_window(), "Error: A CTD bug occured before fs2_open could initialize the anti-crashing subsystem. FS2_Open will now crash. Press retry to try to initialize the subsystem again, or cancel to give up and crash", "FS2_Open Error", MB_ICONWARNING | MB_RETRYCANCEL))
|
||||
{
|
||||
MessageBox((HWND)os_get_window(), "Sorry, it didn't really work. FS2_Open still won't start, but it will close unexpectedly. Press OK to continue closing unexpectedly.", "FS2_Open Error", MB_ICONWARNING);
|
||||
}
|
||||
else
|
||||
{
|
||||
/*char Filepath[1024];
|
||||
char* Filename;
|
||||
GetModuleFileName(hInst, Filepath, sizeof(Filepath));
|
||||
Filename = strrchr(Filepath, '\\');
|
||||
if(Filename == NULL)
|
||||
{
|
||||
Filename = strrchr(Filepath, '/');
|
||||
if(Filename == NULL)
|
||||
{
|
||||
Filename = strrchr(Filepath, ':');
|
||||
if(Filename == NULL)
|
||||
{
|
||||
Filename = Filepath;
|
||||
}
|
||||
}
|
||||
}
|
||||
strcat(Filename, " - Application Error");*/
|
||||
char Filename[128];
|
||||
strcpy(Filename, "fs2_open.exe - Application Error");
|
||||
|
||||
if(IDCANCEL == MessageBox((HWND)os_get_window(), "The instruction at \"0x00001337\" referenced memory at \"0x00000000\". The memory could not be \"read\"\n\nClick on OK to terminate the program\nClick on CANCEL to debug the program", Filename, MB_ICONERROR | MB_OKCANCEL))
|
||||
{
|
||||
MessageBox((HWND)os_get_window(), "What!? Debug something yourself? No, what you want to do is send an error report to Microsoft.", "Error", MB_ICONERROR);
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
#endif
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -1607,7 +2075,7 @@ int fred2_parse_cmdline(int argc, char *argv[])
|
||||
for (i = 1; i < argc; i++)
|
||||
arglen += strlen(argv[i]);
|
||||
if (argc > 2)
|
||||
arglen += argc - 2; // leave room for the separators
|
||||
arglen += argc + 2; // leave room for the separators
|
||||
cmdline = new char [arglen+1];
|
||||
i = 1;
|
||||
memset(cmdline, 0, arglen+1); // clear it out
|
||||
@@ -1633,32 +2101,37 @@ int parse_cmdline(char *cmdline)
|
||||
int parse_cmdline(int argc, char *argv[])
|
||||
#endif
|
||||
{
|
||||
mprintf(("I got to parse_cmdline!!\n"));
|
||||
#ifdef _WIN32
|
||||
os_init_cmdline(cmdline);
|
||||
#else
|
||||
if (argc > 1) {
|
||||
// kind of silly -- combine arg list into single string for parsing,
|
||||
// but it fits with the win32-centric existing code.
|
||||
char *cmdline = NULL;
|
||||
unsigned int arglen = 0;
|
||||
int i;
|
||||
for (i = 1; i < argc; i++)
|
||||
arglen += strlen(argv[i]);
|
||||
if (argc > 2)
|
||||
arglen += argc - 2; // leave room for the separators
|
||||
cmdline = new char [arglen+1];
|
||||
i = 1;
|
||||
strcpy(cmdline, argv[i]);
|
||||
for ( ; i < argc; i++) {
|
||||
strcat(cmdline, " ");
|
||||
strcat(cmdline, argv[i]);
|
||||
}
|
||||
os_init_cmdline(cmdline);
|
||||
delete [] cmdline;
|
||||
} else {
|
||||
// no cmdline args
|
||||
os_init_cmdline("");
|
||||
}
|
||||
#else
|
||||
char *argptr = NULL;
|
||||
int i;
|
||||
int len = 1;
|
||||
|
||||
argptr = (char *)vm_malloc(1);
|
||||
*argptr = 0;
|
||||
|
||||
for (i = 1; i < argc; i++) {
|
||||
int oldlen = len-1;
|
||||
|
||||
len += strlen(argv[i])+1;
|
||||
|
||||
argptr = (char *)vm_realloc(argptr, len);
|
||||
if (argptr == NULL) {
|
||||
fprintf(stderr, "ERROR: out of memory in parse_cmdline!\n");
|
||||
exit(1);
|
||||
}
|
||||
|
||||
strcpy(argptr+oldlen, argv[i]);
|
||||
strcat(argptr, " ");
|
||||
}
|
||||
os_init_cmdline(argptr);
|
||||
|
||||
if (argptr != NULL) {
|
||||
vm_free(argptr);
|
||||
argptr = NULL;
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
@@ -1670,4 +2143,3 @@ int parse_cmdline(int argc, char *argv[])
|
||||
}
|
||||
|
||||
//float global_scaleing_factor = 3.0f;
|
||||
|
||||
@@ -11,11 +11,45 @@
|
||||
/*
|
||||
* $Logfile: /Freespace2/code/Cmdline/cmdline.h $
|
||||
|
||||
* $Revision: 2.64 $
|
||||
* $Date: 2004-12-24 19:36:12 $
|
||||
* $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
|
||||
*
|
||||
@@ -446,7 +480,6 @@
|
||||
*
|
||||
* $NoKeywords: $
|
||||
*/
|
||||
#include "PreProcDefines.h"
|
||||
#ifndef FS_CMDLINE_HEADER_FILE
|
||||
#define FS_CMDLINE_HEADER_FILE
|
||||
|
||||
@@ -494,6 +527,7 @@ 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;
|
||||
@@ -522,6 +556,12 @@ 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;
|
||||
@@ -532,6 +572,7 @@ 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;
|
||||
@@ -554,6 +595,11 @@ 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,16 @@
|
||||
|
||||
/*
|
||||
* $Logfile: /Freespace2/code/CMeasure/CMeasure.cpp $
|
||||
* $Revision: 2.5 $
|
||||
* $Date: 2004-07-26 20:47:25 $
|
||||
* $Author: Kazan $
|
||||
* $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
|
||||
*
|
||||
@@ -369,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;
|
||||
@@ -439,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,19 @@
|
||||
|
||||
/*
|
||||
* $Logfile: /Freespace2/code/CMeasure/CMeasure.h $
|
||||
* $Revision: 2.3 $
|
||||
* $Date: 2004-08-11 05:06:19 $
|
||||
* $Author: Kazan $
|
||||
* $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
|
||||
@@ -119,14 +125,13 @@
|
||||
* $NoKeywords: $
|
||||
*/
|
||||
|
||||
#include "PreProcDefines.h"
|
||||
#ifndef _CMEASURE_H
|
||||
#define _CMEASURE_H
|
||||
|
||||
#include "globalincs/globals.h"
|
||||
|
||||
struct object;
|
||||
struct vector;
|
||||
struct vec3d;
|
||||
|
||||
#define MAX_CMEASURES 64
|
||||
|
||||
@@ -177,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,41 @@
|
||||
|
||||
/*
|
||||
* $Logfile: /Freespace2/code/ControlConfig/ControlsConfig.cpp $
|
||||
* $Revision: 2.9 $
|
||||
* $Date: 2004-07-29 19:37:50 $
|
||||
* $Author: Kazan $
|
||||
* $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
|
||||
*
|
||||
@@ -337,6 +365,7 @@
|
||||
*
|
||||
*/
|
||||
|
||||
|
||||
#include "freespace2/freespace.h"
|
||||
#include "controlconfig/controlsconfig.h"
|
||||
#include "gamesequence/gamesequence.h"
|
||||
@@ -733,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;
|
||||
|
||||
@@ -740,7 +771,7 @@ int control_config_valid_action(int n)
|
||||
if (n == Invalid_demo_keys[i])
|
||||
return 0;
|
||||
#endif
|
||||
|
||||
*/
|
||||
return 1;
|
||||
}
|
||||
|
||||
@@ -892,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 {
|
||||
@@ -923,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
|
||||
@@ -986,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);
|
||||
@@ -1103,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];
|
||||
|
||||
@@ -1191,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;
|
||||
@@ -1209,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()
|
||||
@@ -1246,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];
|
||||
|
||||
@@ -1583,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;
|
||||
|
||||
@@ -1648,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();
|
||||
}
|
||||
@@ -1684,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();
|
||||
@@ -1696,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;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -9,13 +9,26 @@
|
||||
|
||||
/*
|
||||
* $Logfile: /Freespace2/code/ControlConfig/ControlsConfig.h $
|
||||
* $Revision: 2.9 $
|
||||
* $Date: 2004-08-11 05:06:19 $
|
||||
* $Author: Kazan $
|
||||
* $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
|
||||
*
|
||||
@@ -294,7 +307,6 @@
|
||||
*
|
||||
*/
|
||||
|
||||
#include "PreProcDefines.h"
|
||||
#ifndef CONTROLS_CONFIG_H
|
||||
#define CONTROLS_CONFIG_H
|
||||
|
||||
@@ -485,18 +497,15 @@ typedef struct config_item {
|
||||
#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
|
||||
|
||||
#if defined(ENABLE_AUTO_PILOT)
|
||||
//AutoPilot - Kazan
|
||||
#define AUTO_PILOT_TOGGLE 113
|
||||
#define NAV_CYCLE 114
|
||||
#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 115
|
||||
#else
|
||||
#define CCFG_MAX 113
|
||||
|
||||
#endif
|
||||
#define CCFG_MAX 117
|
||||
|
||||
extern int Failed_key_index;
|
||||
extern int Invert_heading;
|
||||
|
||||
@@ -9,13 +9,22 @@
|
||||
|
||||
/*
|
||||
* $Logfile: /Freespace2/code/ControlConfig/ControlsConfigCommon.cpp $
|
||||
* $Revision: 2.9 $
|
||||
* $Date: 2004-07-26 20:47:26 $
|
||||
* $Author: Kazan $
|
||||
* $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
|
||||
*
|
||||
@@ -573,12 +582,12 @@ config_item Control_config[CCFG_MAX + 1] = {
|
||||
{ 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},
|
||||
|
||||
#if defined(ENABLE_AUTO_PILOT)
|
||||
// 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"},
|
||||
#endif
|
||||
|
||||
{ -1, -1, -1, false, "" }
|
||||
};
|
||||
|
||||
@@ -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,16 +9,29 @@
|
||||
|
||||
/*
|
||||
* $Logfile: /Freespace2/code/Cutscene/Cutscenes.cpp $
|
||||
* $Revision: 2.13 $
|
||||
* $Date: 2004-07-26 20:47:26 $
|
||||
* $Author: Kazan $
|
||||
* $Revision: 2.13 $
|
||||
* $Date: 2004-07-26 20:47:26 $
|
||||
* $Author: Kazan $
|
||||
* $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
|
||||
*
|
||||
@@ -243,7 +256,7 @@ 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)free(Cutscenes[i].description);
|
||||
if(Cutscenes[i].description)vm_free(Cutscenes[i].description);
|
||||
}
|
||||
|
||||
// initialization stuff for cutscenes
|
||||
@@ -277,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 );
|
||||
|
||||
@@ -296,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
|
||||
@@ -310,9 +322,6 @@ 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
|
||||
@@ -361,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;
|
||||
@@ -449,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;
|
||||
@@ -516,10 +524,7 @@ 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()
|
||||
@@ -657,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++) {
|
||||
@@ -710,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,16 @@
|
||||
|
||||
/*
|
||||
* $Logfile: /Freespace2/code/Cutscene/Cutscenes.h $
|
||||
* $Revision: 2.3 $
|
||||
* $Date: 2004-08-11 05:06:20 $
|
||||
* $Author: Kazan $
|
||||
* $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
|
||||
@@ -57,7 +60,6 @@
|
||||
* $NoKeywords: $
|
||||
*/
|
||||
|
||||
#include "PreProcDefines.h"
|
||||
#ifndef _FREESPACE_CUTSCENES_SCREEN_HEADER_FILE
|
||||
#define _FREESPACE_CUTSCENES_SCREEN_HEADER_FILE
|
||||
|
||||
|
||||
@@ -9,13 +9,22 @@
|
||||
|
||||
/*
|
||||
* $Logfile: /Freespace2/code/cutscene/movie.cpp $
|
||||
* $Revision: 2.23 $
|
||||
* $Date: 2004-11-27 10:42:18 $
|
||||
* $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
|
||||
*
|
||||
@@ -30,10 +39,13 @@
|
||||
* $NoKeywords: $
|
||||
*/
|
||||
|
||||
#ifdef _WIN32
|
||||
#include <windows.h>
|
||||
|
||||
#include "movie.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"
|
||||
@@ -45,19 +57,19 @@
|
||||
|
||||
// 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
|
||||
#ifdef _WIN32
|
||||
|
||||
void process_messages()
|
||||
{
|
||||
#ifdef _WIN32
|
||||
MSG msg;
|
||||
while(PeekMessage(&msg, (HWND) os_get_window(), 0, 0, PM_REMOVE))
|
||||
{
|
||||
TranslateMessage(&msg);
|
||||
DispatchMessage(&msg);
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
#include "graphics/grd3dinternal.h"
|
||||
|
||||
// filename - file to search for
|
||||
// out_name - output, full path to file
|
||||
@@ -115,7 +127,8 @@ bool movie_play(char *name)
|
||||
extern int Is_standalone;
|
||||
if(Is_standalone) return false;
|
||||
if(Cmdline_dnoshowvid) return false;
|
||||
if(Cmdline_window) return false;
|
||||
//Commented this out since we have dnoshowvid -WMC
|
||||
//if(Cmdline_window) return false;
|
||||
|
||||
char full_name[MAX_PATH];
|
||||
int rc = 0;
|
||||
@@ -129,6 +142,7 @@ bool movie_play(char *name)
|
||||
DBUGFILE_OUTPUT_1("About to play: %s", full_name);
|
||||
}
|
||||
|
||||
#ifdef _WIN32
|
||||
process_messages();
|
||||
|
||||
// This is a bit of a hack but it works nicely
|
||||
@@ -142,7 +156,8 @@ bool movie_play(char *name)
|
||||
|
||||
// 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_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);
|
||||
@@ -230,6 +245,9 @@ bool movie_play(char *name)
|
||||
if (gr_screen.mode == GR_DIRECT3D) {
|
||||
GlobalD3DVars::D3D_activate = 1;
|
||||
}
|
||||
#else
|
||||
STUB_FUNCTION;
|
||||
#endif
|
||||
|
||||
return true;
|
||||
}
|
||||
@@ -242,12 +260,3 @@ bool movie_play_two(char *name1, char *name2)
|
||||
|
||||
return result1 && result2;
|
||||
}
|
||||
|
||||
#else
|
||||
|
||||
// Stubs, preprocessor calls were making the win32 code more complex for no good reason.
|
||||
// Using stubs instead.
|
||||
bool movie_play(char *name) {return true;}
|
||||
bool movie_play_two(char *name1, char *name2) {return true;}
|
||||
|
||||
#endif
|
||||
@@ -1,4 +1,3 @@
|
||||
#include "PreProcDefines.h"
|
||||
|
||||
#ifndef _MOVIE_HEADER_FILE
|
||||
#define _MOVIE_HEADER_FILE
|
||||
|
||||
@@ -9,12 +9,13 @@ 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;
|
||||
char code[5];
|
||||
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
|
||||
@@ -36,23 +37,48 @@ int dds_read_header(char *filename, CFILE *img_cfp, int *width, int *height, int
|
||||
ddsfile = img_cfp;
|
||||
}
|
||||
|
||||
memset(code, 0, sizeof(code));
|
||||
|
||||
|
||||
// read the code
|
||||
cfread(code, 1, 4, ddsfile);
|
||||
code[4] = 0;
|
||||
code = cfread_int(ddsfile);
|
||||
|
||||
// check it
|
||||
if (strncmp(code, DDS_FILECODE, 4) != 0)
|
||||
if (code != DDS_FILECODE)
|
||||
return DDS_ERROR_BAD_HEADER;
|
||||
|
||||
// read the header
|
||||
cfread(&dds_header, sizeof(DDSURFACEDESC2), 1, ddsfile);
|
||||
// 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) {
|
||||
*size = dds_header.dwMipMapCount > 1 ? dds_header.dwPitchOrLinearSize * 2 : dds_header.dwPitchOrLinearSize;
|
||||
// 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:
|
||||
@@ -122,7 +148,7 @@ int dds_read_header(char *filename, CFILE *img_cfp, int *width, int *height, int
|
||||
}
|
||||
|
||||
//reads pixel info from a dds file
|
||||
int dds_read_bitmap(char *filename, ubyte **data, ubyte *bpp)
|
||||
int dds_read_bitmap(char *filename, ubyte *data, ubyte *bpp)
|
||||
{
|
||||
int retval;
|
||||
int w,h,ct,lvl;
|
||||
@@ -148,7 +174,6 @@ int dds_read_bitmap(char *filename, ubyte **data, ubyte *bpp)
|
||||
|
||||
// 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
|
||||
@@ -159,7 +184,7 @@ int dds_read_bitmap(char *filename, ubyte **data, ubyte *bpp)
|
||||
cfseek(cfp, DDS_OFFSET, CF_SEEK_SET);
|
||||
|
||||
// read in the data
|
||||
cfread(*data, 1, size, cfp);
|
||||
cfread(data, 1, size, cfp);
|
||||
|
||||
if (bpp)
|
||||
*bpp = (ubyte)bits;
|
||||
|
||||
@@ -4,7 +4,6 @@
|
||||
#ifndef __DDS_H
|
||||
#define __DDS_H
|
||||
|
||||
#include "PreProcDefines.h"
|
||||
#include "globalincs/pstypes.h"
|
||||
#ifdef _WIN32
|
||||
#include "directx/vddraw.h"
|
||||
@@ -39,7 +38,7 @@ struct CFILE;
|
||||
#define FOURCC_DXT4 (MAKEFOURCC('D','X','T','4'))
|
||||
#define FOURCC_DXT5 (MAKEFOURCC('D','X','T','5'))
|
||||
|
||||
#define DDS_FILECODE "DDS "
|
||||
#define DDS_FILECODE 0x20534444 // "DDS " in file
|
||||
|
||||
#ifndef DUMMYUNIONNAMEN
|
||||
#if defined(__cplusplus) || !defined(NONAMELESSUNION)
|
||||
@@ -81,7 +80,7 @@ int dds_read_header(char *filename, CFILE *img_cfp = NULL, int *width = 0, int *
|
||||
|
||||
//reads bitmap
|
||||
//size of the data it stored in size
|
||||
int dds_read_bitmap(char *filename, ubyte **data, ubyte *bpp);
|
||||
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);
|
||||
|
||||
@@ -9,13 +9,42 @@
|
||||
|
||||
/*
|
||||
* $Logfile: /Freespace2/code/Debris/Debris.cpp $
|
||||
* $Revision: 2.9 $
|
||||
* $Date: 2004-07-26 20:47:26 $
|
||||
* $Author: Kazan $
|
||||
* $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
|
||||
*
|
||||
@@ -250,11 +279,11 @@
|
||||
* $NoKeywords: $
|
||||
*/
|
||||
|
||||
|
||||
#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"
|
||||
@@ -293,31 +322,10 @@ int Debris_model = -1;
|
||||
int Debris_vaporize_model = -1;
|
||||
int Debris_num_submodels = 0;
|
||||
|
||||
#if defined(MORE_SPECIES)
|
||||
char Debris_texture_files[MAX_SPECIES][FILESPEC_LENGTH];
|
||||
|
||||
char Debris_texture_files[MAX_SPECIES_NAMES][MAX_DEBRIS_TNAME_LEN+1];
|
||||
|
||||
/*char * Debris_texture_files[MAX_SPECIES_NAMES] = {
|
||||
NOX("debris01a"), // Terran
|
||||
NOX("debris01b"), // Species B
|
||||
NOX("debris01c"), // Shivan
|
||||
NOX("debris01a"), // Ancient
|
||||
NOX("debris01a"), // User1
|
||||
NOX("debris01a"), // User2
|
||||
NOX("debris01a"), // User3
|
||||
NOX("debris01a"), // User4
|
||||
|
||||
};*/
|
||||
|
||||
#else
|
||||
char * Debris_texture_files[MAX_SPECIES_NAMES] = {
|
||||
NOX("debris01a"), // Terran
|
||||
NOX("debris01b"), // Species B
|
||||
NOX("debris01c"), // Shivan
|
||||
};
|
||||
#endif
|
||||
|
||||
int Debris_textures[MAX_SPECIES_NAMES];
|
||||
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.
|
||||
@@ -390,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;
|
||||
@@ -398,11 +406,7 @@ void debris_page_in()
|
||||
|
||||
Debris_vaporize_model = model_load( NOX("debris02.pof"), 0, NULL );
|
||||
|
||||
#if defined(MORE_SPECIES)
|
||||
for (i=0; i<MAX_SPECIES_NAMES && i<True_NumSpecies; i++ ) {
|
||||
#else
|
||||
for (i=0; i<MAX_SPECIES_NAMES; i++ ) {
|
||||
#endif
|
||||
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 ) {
|
||||
@@ -437,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 );
|
||||
|
||||
@@ -603,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 );
|
||||
|
||||
@@ -646,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 );
|
||||
|
||||
@@ -683,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;
|
||||
}
|
||||
@@ -719,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()
|
||||
//
|
||||
@@ -727,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;
|
||||
@@ -802,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 ) {
|
||||
@@ -859,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 = Ships[source_obj->instance].ship_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 );
|
||||
@@ -881,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 );
|
||||
@@ -920,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);
|
||||
@@ -997,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];
|
||||
|
||||
@@ -1009,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);
|
||||
|
||||
@@ -1063,7 +1067,7 @@ void debris_hit(object *debris_obj, object *other_obj, vector *hitpos, float dam
|
||||
//
|
||||
#pragma warning ( push )
|
||||
#pragma warning ( disable : 4701 ) // possible use of variable without initialization
|
||||
int debris_check_collision(object *pdebris, object *other_obj, vector *hitpos, collision_info_struct *debris_hit_info)
|
||||
int debris_check_collision(object *pdebris, object *other_obj, vec3d *hitpos, collision_info_struct *debris_hit_info)
|
||||
{
|
||||
mc_info mc;
|
||||
int num;
|
||||
@@ -1104,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);
|
||||
@@ -1114,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
|
||||
@@ -1141,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;
|
||||
|
||||
@@ -1212,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);
|
||||
@@ -1244,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);
|
||||
|
||||
@@ -1276,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);
|
||||
|
||||
@@ -1326,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,22 @@
|
||||
|
||||
/*
|
||||
* $Logfile: /Freespace2/code/Debris/Debris.h $
|
||||
* $Revision: 2.2 $
|
||||
* $Date: 2004-08-11 05:06:20 $
|
||||
* $Author: Kazan $
|
||||
* $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
|
||||
@@ -145,7 +154,6 @@
|
||||
* $NoKeywords: $
|
||||
*/
|
||||
|
||||
#include "PreProcDefines.h"
|
||||
#ifndef _DEBRIS_H
|
||||
#define _DEBRIS_H
|
||||
|
||||
@@ -175,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
|
||||
|
||||
@@ -187,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];
|
||||
|
||||
@@ -204,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,16 @@
|
||||
|
||||
/*
|
||||
* $Logfile: /Freespace2/code/DebugConsole/Console.cpp $
|
||||
* $Revision: 2.5 $
|
||||
* $Date: 2004-07-26 20:47:27 $
|
||||
* $Author: Kazan $
|
||||
* $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
|
||||
*
|
||||
@@ -629,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);
|
||||
@@ -637,7 +640,7 @@ void dc_printf(char *format, ...)
|
||||
va_end(args);
|
||||
|
||||
char *p = tmp;
|
||||
while( *p ) {
|
||||
while( *p != '\0' ) {
|
||||
debug_output(*p);
|
||||
p++;
|
||||
}
|
||||
|
||||
@@ -1,4 +1,3 @@
|
||||
#include "PreProcDefines.h"
|
||||
|
||||
#ifndef _DBUGFILE_HEADER_
|
||||
#define _DBUGFILE_HEADER_
|
||||
|
||||
@@ -16,9 +16,10 @@
|
||||
#ifdef _WIN32
|
||||
#include <windows.h>
|
||||
#include <winbase.h>
|
||||
#endif
|
||||
|
||||
#include "timerbar.h"
|
||||
#include "globalincs\pstypes.h"
|
||||
#include "globalincs/pstypes.h"
|
||||
|
||||
|
||||
// Internal structure for handling frame data
|
||||
@@ -39,7 +40,7 @@ LARGE_INTEGER timerbar_ultimate_start_value;
|
||||
LARGE_INTEGER timerbar_last_start_value;
|
||||
|
||||
// Data needed for push and pop functionality
|
||||
const MAX_TB_STACK_SIZE = 100;
|
||||
const int MAX_TB_STACK_SIZE = 100;
|
||||
|
||||
int timerbar_stack[MAX_TB_STACK_SIZE];
|
||||
int timerbar_current_stack_layer = 0;
|
||||
@@ -223,4 +224,3 @@ void timerbar_set_draw_func(void (*new_draw_func_ptr)(int colour, float x, float
|
||||
draw_func_ptr = new_draw_func_ptr;
|
||||
}
|
||||
|
||||
#endif
|
||||
@@ -8,11 +8,14 @@
|
||||
|
||||
/*
|
||||
* $Logfile: /Freespace2/code/debugconsole/timerbar.h $
|
||||
* $Revision: 1.9 $
|
||||
* $Date: 2004-08-11 05:06:20 $
|
||||
* $Author: Kazan $
|
||||
* $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
|
||||
@@ -50,7 +53,6 @@
|
||||
* $NoKeywords: $
|
||||
*/
|
||||
|
||||
#include "PreProcDefines.h"
|
||||
#ifndef _TIMERBAR_HEADER_
|
||||
#define _TIMERBAR_HEADER_
|
||||
|
||||
|
||||
+233
-191
@@ -60,7 +60,7 @@ true) as being totaly occupied
|
||||
|
||||
Debugging Functions
|
||||
there are sevral debugging functions, they check the consistency of the lists, they only work
|
||||
in debug and they are _REALY FUCKING >>_SLOW_<<_ wich is why they are all disabled, I don't
|
||||
in debug and they are _REALY >>_SLOW_<<_ wich is why they are all disabled, I don't
|
||||
even know if they still all/any work. enable at your own risk.
|
||||
|
||||
|
||||
@@ -88,7 +88,7 @@ sub functions:
|
||||
decal_create_defpoints -
|
||||
this function parses the defpoints portion of the BSP data, it allocates and set's up
|
||||
the decal_point_list and decal__poly via the decal_realc_pointlist function. it then stuffs
|
||||
decal_point_list with pointers to all of the vector defpoints within the defpoint chunck, at
|
||||
decal_point_list with pointers to all of the vec3d defpoints within the defpoint chunck, at
|
||||
the time of documantation it ignores normals.
|
||||
decal_create_sortnorm -
|
||||
this function takes care of the sortnorm chunck, it actualy ignores the sort norms them selves,
|
||||
@@ -128,8 +128,9 @@ texture for the list is set, then a call is made to render the vertex buffer.
|
||||
|
||||
*/
|
||||
|
||||
|
||||
#include "object/object.h"
|
||||
#include "globalincs\linklist.h"
|
||||
#include "globalincs/linklist.h"
|
||||
#include "decals/decals.h"
|
||||
#include "render/3d.h"
|
||||
#include "io/timer.h"
|
||||
@@ -153,34 +154,34 @@ decal_poly big_ol_decal_poly_array[MAX_GLOBAL_DECAL_POLYS];
|
||||
decal_item big_ol_decal_array[MAX_GLOBAL_DECALS];
|
||||
|
||||
/****BSP Defpoint Buffer Start****/
|
||||
vector **decal_point_list = NULL;
|
||||
vec3d **decal_point_list = NULL;
|
||||
int *decal__poly = NULL;
|
||||
//those two are used deep within the bowels of the BSP parseing code
|
||||
|
||||
int decal_points_alocated = 0;
|
||||
int decal_points_allocated = 0;
|
||||
|
||||
//model data is held in dynamic memory, it's only realocated when
|
||||
//model data is held in dynamic memory, it's only reallocated when
|
||||
|
||||
//the current buffers are too small, this free's the buffers atexit (see end of init_decals)
|
||||
void free_decal_stuff(){
|
||||
if(decal_points_alocated){
|
||||
if(decal_points_allocated){
|
||||
//if either one of these arn't NULL than someone allocated something to them
|
||||
if(decal_point_list)free(decal_point_list);
|
||||
if(decal__poly)free(decal__poly);
|
||||
if(decal_point_list)vm_free(decal_point_list);
|
||||
if(decal__poly)vm_free(decal__poly);
|
||||
}
|
||||
}
|
||||
|
||||
//will realocate the lists (_without_ saveing what was in them!)
|
||||
//will reallocate the lists (_without_ saveing what was in them!)
|
||||
//if the passed size is bigger than what is currently allocated
|
||||
void decal_realc_pointlist(int n){
|
||||
if(decal_points_alocated < n){
|
||||
if(decal_points_allocated < n){
|
||||
//if they've been allocated already free what they have
|
||||
if(decal_point_list)free(decal_point_list);
|
||||
if(decal__poly)free(decal__poly);
|
||||
if(decal_point_list)vm_free(decal_point_list);
|
||||
if(decal__poly)vm_free(decal__poly);
|
||||
//then reallocate with the new point count
|
||||
decal_point_list = (vector**) malloc(sizeof(vector *)*n);
|
||||
decal__poly = (int*) malloc(sizeof(int)*n);
|
||||
decal_points_alocated = n;
|
||||
decal_point_list = (vec3d**) vm_malloc(sizeof(vec3d *)*n);
|
||||
decal__poly = (int*) vm_malloc(sizeof(int)*n);
|
||||
decal_points_allocated = n;
|
||||
}
|
||||
}
|
||||
/****BSP Defpoint Buffer End****/
|
||||
@@ -188,8 +189,10 @@ void decal_realc_pointlist(int n){
|
||||
/****init stuff****/
|
||||
bool decals_once_init = false;
|
||||
void init_decals(){
|
||||
int i;
|
||||
|
||||
//quick find is set to be false everyware because there are no decals, and thus no polys
|
||||
for(int i = 0; i<QUICKFIND_SUBDIVISION; i++)
|
||||
for(i = 0; i<QUICKFIND_SUBDIVISION; i++)
|
||||
quick_find_array[i] = false;
|
||||
|
||||
//every poly has a pointer to it's parent (used for error checking)
|
||||
@@ -261,14 +264,14 @@ void check_ship_decals(){
|
||||
}
|
||||
}
|
||||
}
|
||||
#endif
|
||||
#endif // DECAL_DEBUGGING
|
||||
}
|
||||
|
||||
// make sure this poly is withing the list, and while you'r at it, make sure there are the corect number of polys
|
||||
bool check_decal(decal* dec, decal_poly* poly){
|
||||
#ifndef DECAL_DEBUGGING
|
||||
return true;
|
||||
#endif
|
||||
#else
|
||||
#ifndef NDEBUG
|
||||
if(dec == NULL)return (poly->next==NULL)?true:false;
|
||||
decal_poly* p = dec->poly;
|
||||
@@ -284,6 +287,7 @@ bool check_decal(decal* dec, decal_poly* poly){
|
||||
return false;
|
||||
#endif
|
||||
return true;
|
||||
#endif // DECAL_DEBUGGING
|
||||
}
|
||||
|
||||
bool decal_is_in_proper_list(decal* dec){
|
||||
@@ -315,7 +319,7 @@ bool decal_is_in_proper_list(decal* dec){
|
||||
void check_list_decals(){
|
||||
#ifndef DECAL_DEBUGGING
|
||||
return;
|
||||
#endif
|
||||
#else
|
||||
#ifndef NDEBUG
|
||||
for(int i = 0; i<MAX_GLOBAL_DECALS; i++){
|
||||
decal_item* d = &big_ol_decal_array[i];
|
||||
@@ -336,18 +340,20 @@ void check_list_decals(){
|
||||
}
|
||||
}
|
||||
#endif
|
||||
#endif // DECAL_DEBUGGING
|
||||
}
|
||||
|
||||
//looks at all pollys, and the quicklook table, makes sure everything is cosuer
|
||||
void check_poly_decals(){
|
||||
#ifndef DECAL_DEBUGGING
|
||||
return;
|
||||
#endif
|
||||
#else
|
||||
#ifndef NDEBUG
|
||||
int i;
|
||||
|
||||
for(int q = 0; q<QUICKFIND_SUBDIVISION; q++){
|
||||
//look in each quicklook segment
|
||||
for(int i = q*QUICKFIND_SEGMENT_LENGTH; i<(q+1)*QUICKFIND_SEGMENT_LENGTH; i++){
|
||||
for(i = q*QUICKFIND_SEGMENT_LENGTH; i<(q+1)*QUICKFIND_SEGMENT_LENGTH; i++){
|
||||
//in each poly within the segment make sure everything is as it should be
|
||||
if(!quick_find_array[q]){
|
||||
//make sure there is at least one free
|
||||
@@ -362,10 +368,11 @@ void check_poly_decals(){
|
||||
//the quicklook should have an empy but it doesn't!!!
|
||||
}
|
||||
|
||||
for(int i = 0; i<MAX_GLOBAL_DECAL_POLYS; i++){
|
||||
for(i = 0; i<MAX_GLOBAL_DECAL_POLYS; i++){
|
||||
Assert(check_decal(big_ol_decal_poly_array[i].parent, &big_ol_decal_poly_array[i]));
|
||||
}
|
||||
#endif
|
||||
#endif // DECAL_DEBUGGING
|
||||
}
|
||||
/****end ugly debugging functions****/
|
||||
//I feel dirty...
|
||||
@@ -378,13 +385,15 @@ void check_poly_decals(){
|
||||
//finds an available polygon (triangle)
|
||||
decal_poly* get_open_poly(){
|
||||
|
||||
int i, j;
|
||||
|
||||
check_list_decals();
|
||||
SAFEPOINT("entering get_open_poly");
|
||||
check_poly_decals();
|
||||
check_ship_decals();
|
||||
|
||||
//look through the quicklook array
|
||||
for(int i = 0; i<QUICKFIND_SUBDIVISION; i++)
|
||||
for(i = 0; i<QUICKFIND_SUBDIVISION; i++)
|
||||
if(!quick_find_array[i]) break;
|
||||
//untill you find a segment that had an empty slot (false)
|
||||
|
||||
@@ -406,7 +415,7 @@ decal_poly* get_open_poly(){
|
||||
big_ol_decal_poly_array[i].next = NULL;
|
||||
//just to make sure
|
||||
|
||||
for(int j = i+1; j<end; j++){
|
||||
for(j = i+1; j<end; j++){
|
||||
//see if there are any empties left in this segment
|
||||
//if there aren't mark this segment as full
|
||||
if(big_ol_decal_poly_array[j].parent == NULL)break;
|
||||
@@ -814,7 +823,7 @@ check_ship_decals();
|
||||
SAFEPOINT("leaveing deecal_list_controle::clear");
|
||||
};
|
||||
|
||||
decal_list_controle::decal_list_controle():n_decals(0),buffer(-1),texture(-1),d_list(NULL),end(NULL),modifyed(false){
|
||||
decal_list_controle::decal_list_controle():n_decals(0),buffer(-1),texture(-1),modifyed(false),d_list(NULL),end(NULL){
|
||||
}
|
||||
|
||||
decal_list_controle::~decal_list_controle(){
|
||||
@@ -843,19 +852,10 @@ SAFEPOINT("entering decal_find_next");
|
||||
decal_list_controle* list = find_list( system->decals, system->n_decal_textures, texture);
|
||||
if(list == NULL){
|
||||
//if it couldn't find the texture, this means we need to
|
||||
//realocate the array and add one
|
||||
decal_list_controle* old_list = system->decals;
|
||||
//save the current list
|
||||
system->decals = (decal_list_controle *) malloc(sizeof(decal_list_controle)*++system->n_decal_textures);
|
||||
//reallocate the array and add one
|
||||
system->decals = (decal_list_controle*)vm_realloc(system->decals, sizeof(decal_list_controle) * ++system->n_decal_textures);
|
||||
|
||||
if(!system->decals)Error(LOCATION, "unable to malloc new decal list");
|
||||
//reallocate
|
||||
|
||||
memcpy(system->decals, old_list, sizeof(decal_list_controle)*(system->n_decal_textures-1));
|
||||
//copy the contents of the old list into the new one
|
||||
|
||||
free(old_list);
|
||||
//free the old list
|
||||
|
||||
list = &system->decals[system->n_decal_textures-1];
|
||||
list->buffer = -1;
|
||||
@@ -919,15 +919,15 @@ check_list_decals();
|
||||
//return a pointer to the decal at the end of the list
|
||||
}
|
||||
|
||||
void clear_decals(decal_system *system){
|
||||
#ifdef DECALS_ENABLED
|
||||
void clear_decals(decal_system *system)
|
||||
{
|
||||
int i;
|
||||
if(!system->n_decal_textures)return;
|
||||
for(int i = 0; i<system->n_decal_textures; i++)system->decals[i].clear();
|
||||
for( i = 0; i<system->n_decal_textures; i++)system->decals[i].clear();
|
||||
for( i = 0; i<system->n_decal_textures; i++)Assert(!system->decals[i].n_decals);
|
||||
system->n_decal_textures = 0;
|
||||
free(system->decals);
|
||||
vm_free(system->decals);
|
||||
system->decals = NULL;
|
||||
#endif
|
||||
}
|
||||
/**********************/
|
||||
/*END DECAL MANAGEMENT*/
|
||||
@@ -935,10 +935,10 @@ void clear_decals(decal_system *system){
|
||||
|
||||
|
||||
|
||||
static vector decal_cube_point[8];
|
||||
static vector decal_cube_plane[6][2];
|
||||
static vector decal_hit_point;
|
||||
static vector decal_hit_vect;
|
||||
static vec3d decal_cube_point[8];
|
||||
static vec3d decal_cube_plane[6][2];
|
||||
static vec3d decal_hit_point;
|
||||
static vec3d decal_hit_vect;
|
||||
static float decal_hit_radius;
|
||||
static float decal_min_hit_radius;
|
||||
|
||||
@@ -959,7 +959,6 @@ static int back_faceing; //global boolian type thing telling the low level stuff
|
||||
//early simple decal creation code, I don't even know if it works,
|
||||
//saveing it becase I may have a use for this type off effect later
|
||||
int decal_create_simple(object *obj, decal_point *point, int texture){//makes a simple non-clipped decal
|
||||
#ifdef DECALS_ENABLED
|
||||
mprintf(("a decal is about to be made at %0.2f, %0.2f, %0.2f\n", point->pnt.xyz.x, point->pnt.xyz.y, point->pnt.xyz.z));
|
||||
mprintf(("orient fvec at %0.2f, %0.2f, %0.2f\n", point->orient.vec.fvec.xyz.x, point->orient.vec.fvec.xyz.y, point->orient.vec.fvec.xyz.z));
|
||||
|
||||
@@ -967,13 +966,13 @@ int decal_create_simple(object *obj, decal_point *point, int texture){//makes a
|
||||
return 0;
|
||||
}
|
||||
// vertex vert[1][2];
|
||||
// vector vec[4];
|
||||
// vec3d vec[4];
|
||||
|
||||
vector center = point->pnt;
|
||||
vec3d center = point->pnt;
|
||||
float rad = point->radius;
|
||||
if(rad <=0) rad = 10;
|
||||
mprintf(("radius %f\n",rad));
|
||||
vector plain_point[4];
|
||||
vec3d plain_point[4];
|
||||
// mprintf(("orient uvec x %0.2f %0.2f %0.2f\n", point->orient.vec.uvec.xyz.x, point->orient.vec.uvec.xyz.y, point->orient.vec.uvec.xyz.z));
|
||||
// mprintf(("orient rvec x %0.2f %0.2f %0.2f\n", point->orient.vec.rvec.xyz.x, point->orient.vec.rvec.xyz.y, point->orient.vec.rvec.xyz.z));
|
||||
// mprintf(("orient fvec x %0.2f %0.2f %0.2f\n", point->orient.vec.fvec.xyz.x, point->orient.vec.fvec.xyz.y, point->orient.vec.fvec.xyz.z));
|
||||
@@ -992,7 +991,7 @@ check_ship_decals();
|
||||
if(!dec)return 0;
|
||||
|
||||
vertex vert[4];
|
||||
vector _vert[4];
|
||||
vec3d _vert[4];
|
||||
|
||||
for(int i = 0; i<4; i++){
|
||||
vm_vec_scale_add( &_vert[i], ¢er, &plain_point[i], rad );
|
||||
@@ -1027,7 +1026,7 @@ check_ship_decals();
|
||||
|
||||
mprintf(("a decal should have been made at %0.2f %0.2f %0.2f\n", point->pnt.xyz.x, point->pnt.xyz.y, point->pnt.xyz.z));
|
||||
//Int3();
|
||||
#endif
|
||||
|
||||
return 1;
|
||||
}
|
||||
|
||||
@@ -1035,18 +1034,18 @@ check_ship_decals();
|
||||
#define duw(p) (*((uint *) (p)))
|
||||
#define dw(p) (*((int *) (p)))
|
||||
#define dwp(p) ((int *) (p))
|
||||
#define dvp(p) ((vector *) (p))
|
||||
#define dvp(p) ((vec3d *) (p))
|
||||
#define dfl(p) (*((float *) (p)))
|
||||
|
||||
|
||||
//creates a decal, returns decal index on succes, -1 on failure
|
||||
void setup_decal_cube(matrix or, vector cube_point[8]){
|
||||
void setup_decal_cube(matrix m, vec3d cube_point[8]){
|
||||
|
||||
//setting up the decal cube
|
||||
vector test_vec, temp1, temp2;
|
||||
vec3d test_vec, temp1, temp2;
|
||||
for(int i = 0; i<8; i++)decal_cube_point[i] = cube_point[i];
|
||||
|
||||
decal_orient = or;
|
||||
decal_orient = m;
|
||||
|
||||
decal_cube_plane[0][0] = cube_point[5];
|
||||
|
||||
@@ -1125,10 +1124,11 @@ mprintf(("cube set up\n"));
|
||||
/**************/
|
||||
|
||||
decal_poly *LAST_POLY;
|
||||
int decal_create(object * obj, decal_point *point, int subobject, int texture, int backfaced_texture, int glow_texture, int burn_texture, int burn_time){
|
||||
int decal_create(object * obj, decal_point *point, int subobject, int texture, int backfaced_texture, int glow_texture, int burn_texture, int burn_time)
|
||||
{
|
||||
if(!Cmdline_decals)return -1;
|
||||
// return -1;
|
||||
#ifdef DECALS_ENABLED
|
||||
|
||||
SAFEPOINT("entering create_decal");
|
||||
mprintf(("a decal is about to be made at %0.2f, %0.2f, %0.2f\n", point->pnt.xyz.x, point->pnt.xyz.y, point->pnt.xyz.z));
|
||||
|
||||
@@ -1139,12 +1139,12 @@ SAFEPOINT("entering create_decal");
|
||||
if(point->radius <= 0)return -1;
|
||||
//TIMERBAR_PUSH(TIMERBAR_GREY);
|
||||
|
||||
vector center = point->pnt;
|
||||
vec3d center = point->pnt;
|
||||
float rad = point->radius;
|
||||
if(rad <=0) rad = 1;
|
||||
mprintf(("radius %f\n",rad));
|
||||
vector plain_point[4];
|
||||
vector cube_point[8];
|
||||
vec3d plain_point[4];
|
||||
vec3d cube_point[8];
|
||||
//define the decals dimentions
|
||||
plain_point[0] = point->orient.vec.uvec;
|
||||
plain_point[1] = plain_point[0];
|
||||
@@ -1153,8 +1153,8 @@ SAFEPOINT("entering create_decal");
|
||||
plain_point[3] = plain_point[2];
|
||||
vm_vec_negate(&plain_point[3]);
|
||||
|
||||
vector topcenter;
|
||||
vector bvec = point->orient.vec.fvec;
|
||||
vec3d topcenter;
|
||||
vec3d bvec = point->orient.vec.fvec;
|
||||
vm_vec_negate(&bvec);
|
||||
vm_vec_scale_add(&topcenter, ¢er, &bvec, rad);
|
||||
|
||||
@@ -1266,11 +1266,7 @@ mprintf(("deacal defined\n"));
|
||||
check_poly_decals();
|
||||
|
||||
//TIMERBAR_POP();
|
||||
return 1;
|
||||
|
||||
#else
|
||||
return -1;
|
||||
#endif
|
||||
return 1;
|
||||
}
|
||||
//decal_model d_model;
|
||||
|
||||
@@ -1295,7 +1291,7 @@ void decal_create_defpoints(ubyte * p )
|
||||
|
||||
mprintf(("%d verts\n",nverts));
|
||||
ubyte * normcount = p+20;
|
||||
vector *src = dvp(p+offset);
|
||||
vec3d *src = dvp(p+offset);
|
||||
|
||||
//> Assert( nverts < 1200 );
|
||||
|
||||
@@ -1303,7 +1299,7 @@ void decal_create_defpoints(ubyte * p )
|
||||
|
||||
for (n=0; n<nverts; n++ ) {
|
||||
|
||||
Assert(decal_points_alocated >= n);
|
||||
Assert(decal_points_allocated >= n);
|
||||
|
||||
decal_point_list[n] = src;
|
||||
// new_decal->vert[n].xyz = src->xyz;
|
||||
@@ -1317,8 +1313,8 @@ void decal_create_defpoints(ubyte * p )
|
||||
// Sortnorms
|
||||
// +0 int id
|
||||
// +4 int size
|
||||
// +8 vector normal
|
||||
// +20 vector center
|
||||
// +8 vec3d normal
|
||||
// +20 vec3d center
|
||||
// +32 float radius
|
||||
// 36 int front offset
|
||||
// 40 int back offset
|
||||
@@ -1335,11 +1331,11 @@ void decal_create_sortnorm(ubyte * p)
|
||||
int postlist = dw(p+48);
|
||||
int onlist = dw(p+52);
|
||||
|
||||
vector *normal, *point;
|
||||
vec3d *normal, *point;
|
||||
normal = dvp(p+8);
|
||||
point = dvp(p+20);
|
||||
|
||||
vector min, max, h;
|
||||
vec3d min, max, h;
|
||||
min.xyz = dvp(p+56)->xyz;
|
||||
max.xyz = dvp(p+68)->xyz;
|
||||
min.xyz.x -= decal_hit_radius;
|
||||
@@ -1476,15 +1472,15 @@ bool check_ab(float a[3], float b[3]){
|
||||
}
|
||||
|
||||
//tells weather a sphere colides with a triangle
|
||||
bool shpere_tri_edge(vector* s_point, float rad, vertex vert[3]){
|
||||
vector n;
|
||||
bool shpere_tri_edge(vec3d* s_point, float rad, vertex vert[3]){
|
||||
vec3d n;
|
||||
float d;
|
||||
for(int i = 0; i< 3; i++){
|
||||
vector point_one;
|
||||
vec3d point_one;
|
||||
vm_vert2vec(&vert[i], &point_one);
|
||||
vector point_two;
|
||||
vec3d point_two;
|
||||
vm_vert2vec(&vert[(i+1)%3], &point_two);
|
||||
switch(vm_vec_dist_to_line(s_point, &point_one, &point_two, &n, &d)){
|
||||
switch(vm_vec_dist_to_line(s_point, &point_one, &point_two, &n, NULL)){
|
||||
// behind the line, so use the start pos
|
||||
case -1:
|
||||
d = vm_vec_dist(s_point,&point_one);
|
||||
@@ -1492,13 +1488,17 @@ bool shpere_tri_edge(vector* s_point, float rad, vertex vert[3]){
|
||||
|
||||
// use the closest point
|
||||
case 0:
|
||||
|
||||
// already calculated in vm_vec_dist_to_line(...)
|
||||
d = vm_vec_dist(s_point,&n);
|
||||
break;
|
||||
|
||||
// past the line, so use the shot pos
|
||||
case 1:
|
||||
d = vm_vec_dist(s_point,&point_two);
|
||||
break;
|
||||
default:
|
||||
d = 0.0f;
|
||||
Int3();
|
||||
break;
|
||||
}
|
||||
|
||||
Assert(d > 0);
|
||||
@@ -1507,7 +1507,7 @@ bool shpere_tri_edge(vector* s_point, float rad, vertex vert[3]){
|
||||
return false;
|
||||
}
|
||||
|
||||
bool decal_tmap_bbox(vector *test, float rad){
|
||||
bool decal_tmap_bbox(vec3d *test, float rad){
|
||||
if(fl_abs(test->xyz.x) > rad)return false;
|
||||
if(fl_abs(test->xyz.y) > rad)return false;
|
||||
if(fl_abs(test->xyz.z) > rad)return false;
|
||||
@@ -1537,8 +1537,9 @@ int decal_clip_tri(vertex in[3], vertex out[20]){
|
||||
memcpy(work, in, sizeof(vertex)*3);
|
||||
int n_verts = 0;
|
||||
int old_n_verts = 3;
|
||||
int i;
|
||||
|
||||
for(int i = 0; i<old_n_verts; i++){
|
||||
for(i = 0; i<old_n_verts; i++){
|
||||
//for each edge, in[i], in[(i+1)%3]
|
||||
if((work[i].u <= 1.0f)){
|
||||
//if the starting point is ok, copy it
|
||||
@@ -1624,8 +1625,8 @@ int decal_clip_tri(vertex in[3], vertex out[20]){
|
||||
return n_verts;
|
||||
}
|
||||
|
||||
float fvi_point_dist_plane(vector* pl_pnt, vector *pl_norm, vertex *vert){
|
||||
vector vec;
|
||||
float fvi_point_dist_plane(vec3d* pl_pnt, vec3d *pl_norm, vertex *vert){
|
||||
vec3d vec;
|
||||
vm_vert2vec(vert, &vec);
|
||||
return fvi_point_dist_plane(pl_pnt, pl_norm, &vec);
|
||||
}
|
||||
@@ -1636,7 +1637,7 @@ int decal_plane_clip_tri(vertex in[3], vertex out[20]){
|
||||
memcpy(work, in, sizeof(vertex)*3);
|
||||
int n_verts = 0;
|
||||
int old_n_verts = 3;
|
||||
vector temp, temp2, temp3;
|
||||
vec3d temp, temp2, temp3;
|
||||
|
||||
for(int p = 0; p<6; p++){
|
||||
for(int i = 0; i<old_n_verts; i++){
|
||||
@@ -1673,8 +1674,8 @@ int decal_plane_clip_tri(vertex in[3], vertex out[20]){
|
||||
// Textured Poly
|
||||
// +0 int id
|
||||
// +4 int size
|
||||
// +8 vector normal
|
||||
// +20 vector normal_point
|
||||
// +8 vec3d normal
|
||||
// +20 vec3d normal_point
|
||||
// +32 int radius
|
||||
// +36 int nverts
|
||||
// +40 int tmap_num
|
||||
@@ -1686,10 +1687,11 @@ void decal_create_tmappoly(ubyte * p)
|
||||
|
||||
|
||||
|
||||
bool clip = true;
|
||||
int i;
|
||||
int nv;
|
||||
// uv_pair uvlist[TMAP_MAX_VERTS];
|
||||
vector *points[TMAP_MAX_VERTS];
|
||||
vec3d *points[TMAP_MAX_VERTS];
|
||||
model_tmap_vert *verts;
|
||||
|
||||
nv = dw(p+36);
|
||||
@@ -1702,8 +1704,8 @@ void decal_create_tmappoly(ubyte * p)
|
||||
points[i] = decal_point_list[decal__poly[i]];
|
||||
}
|
||||
|
||||
vector *pnorm = dvp(p+8);
|
||||
vector norm = *pnorm;
|
||||
vec3d *pnorm = dvp(p+8);
|
||||
vec3d norm = *pnorm;
|
||||
vm_vec_normalize(&norm);
|
||||
|
||||
//float back = 1.0;
|
||||
@@ -1711,9 +1713,9 @@ void decal_create_tmappoly(ubyte * p)
|
||||
// if( (back_faceing == 0) && (back < 0) )return;
|
||||
|
||||
//poly culling
|
||||
vector *pcenter = (vector*)(p+20);
|
||||
vec3d *pcenter = (vec3d*)(p+20);
|
||||
float pradius = *(float*)(p+32);
|
||||
vector dir_to_dec;
|
||||
vec3d dir_to_dec;
|
||||
vm_vec_sub(&dir_to_dec, pcenter, &decal_hit_point);
|
||||
vm_vec_normalize(&dir_to_dec);
|
||||
float dot = vm_vec_dot(&decal_hit_vect, &norm);
|
||||
@@ -1731,19 +1733,19 @@ void decal_create_tmappoly(ubyte * p)
|
||||
}
|
||||
*/
|
||||
float decal_plane_dist = fl_abs(fvi_point_dist_plane(pcenter, pnorm, &decal_hit_point));
|
||||
if(decal_plane_dist > max_rad){
|
||||
if(decal_plane_dist > max_rad*1.5f){
|
||||
// TIMERBAR_POP();
|
||||
return;
|
||||
}
|
||||
|
||||
vector closest;
|
||||
vec3d closest;
|
||||
vm_project_point_onto_plane(&closest, &decal_hit_point, &norm, pcenter);
|
||||
|
||||
if(!fvi_point_face(&closest, nv, points, &norm, NULL, NULL, NULL)){
|
||||
if(clip && !fvi_point_face(&closest, nv, points, &norm, NULL, NULL, NULL)){
|
||||
// if the point isn't on the face, find the line segment it is closest to
|
||||
//and make that point the closest
|
||||
float distance = FLT_MAX, test_dist = FLT_MAX;
|
||||
vector nearest = closest, test_nearest;
|
||||
vec3d nearest = closest, test_nearest;
|
||||
for(i = 0; i<nv; i++){
|
||||
switch (vm_vec_dist_to_line(&closest,decal_point_list[decal__poly[i]],decal_point_list[decal__poly[(i+1)%nv]],&test_nearest, &test_dist)){
|
||||
case -1:
|
||||
@@ -1769,12 +1771,14 @@ void decal_create_tmappoly(ubyte * p)
|
||||
closest = nearest;
|
||||
}
|
||||
|
||||
vector local_closest;
|
||||
vec3d local_closest;
|
||||
if(clip){
|
||||
vm_vec_sub(&local_closest, &closest, &decal_hit_point);
|
||||
vector ctemp = local_closest;
|
||||
vec3d ctemp = local_closest;
|
||||
vm_vec_rotate(&local_closest,&ctemp, &decal_orient);
|
||||
}
|
||||
|
||||
bool defenately = (decal_tmap_bbox(&local_closest, decal_min_hit_radius));
|
||||
bool defenately = !clip || (decal_tmap_bbox(&local_closest, decal_min_hit_radius));
|
||||
|
||||
if(!defenately && max_rad*1.5 < vm_vec_dist(&closest, &decal_hit_point)){
|
||||
mprintf(("bugging out becase closest is out of max_rad\n"));
|
||||
@@ -1790,89 +1794,125 @@ void decal_create_tmappoly(ubyte * p)
|
||||
vertex work_poly[20];
|
||||
if(nv > 2){
|
||||
// decal_poly *poly = set_decal->get_last_poly();
|
||||
for (i=1;i<(nv-1);i++) {
|
||||
if(set_decal->n_poly >= MAX_DECAL_POLY-1){
|
||||
mprintf(("bugging out becase there are too many polys in the decal\n"));
|
||||
// TIMERBAR_POP();
|
||||
return;
|
||||
}
|
||||
|
||||
Assert(decal_points_alocated >= i%nv);
|
||||
Assert(decal_points_alocated >= (i+1)%nv);
|
||||
Assert(decal_points_alocated >= decal__poly[0]);
|
||||
Assert(decal_points_alocated >= decal__poly[i%nv]);
|
||||
Assert(decal_points_alocated >= decal__poly[(i+1)%nv]);
|
||||
|
||||
vm_vec2vert(decal_point_list[decal__poly[0]], &LAST_POLY->point[0]);
|
||||
vm_vec2vert(decal_point_list[decal__poly[i%nv]], &LAST_POLY->point[1]);
|
||||
vm_vec2vert(decal_point_list[decal__poly[(i+1)%nv]], &LAST_POLY->point[2]);
|
||||
LAST_POLY->norm[0] = norm;
|
||||
LAST_POLY->norm[1] = norm;
|
||||
LAST_POLY->norm[2] = norm;
|
||||
// set_decal->poly[set_decal->n_poly].norm = norm;
|
||||
// set_decal->n_poly++;
|
||||
int k;
|
||||
float a[3], b[3];
|
||||
for (k=0;k<3;k++) {
|
||||
vector temp;
|
||||
vm_vert2vec(&LAST_POLY->point[k], &temp);
|
||||
b[k] = (fvi_point_dist_plane(&decal_cube_plane[4][0], &decal_cube_plane[4][1], &temp) / (max_rad*3));
|
||||
a[k] = (fvi_point_dist_plane(&decal_cube_plane[5][0], &decal_cube_plane[5][1], &temp) / (max_rad*3));
|
||||
}
|
||||
for ( k=0;k<3;k++) {
|
||||
//calculate the UV coords
|
||||
vector temp;
|
||||
vm_vert2vec(&LAST_POLY->point[k], &temp);
|
||||
LAST_POLY->point[k].u = (fvi_point_dist_plane(&decal_cube_plane[0][0], &decal_cube_plane[0][1], &temp) / (min_rad*2));
|
||||
LAST_POLY->point[k].v = (fvi_point_dist_plane(&decal_cube_plane[2][0], &decal_cube_plane[2][1], &temp) / (min_rad*2));
|
||||
}
|
||||
// bool uv_passed = check_uv(LAST_POLY);
|
||||
// mprintf(("decal poly %d, vert 0 being set to %d, vert 1 %d, and vert 2 %d\n", set_decal->n_poly, new_decal->poly[set_decal->n_poly].point[0], new_decal->poly[set_decal->n_poly].point[1], new_decal->poly[set_decal->n_poly].point[2]));
|
||||
int work_n_verts = 0;;
|
||||
/*if(uv_passed)*/{
|
||||
if(pradius > max_rad){
|
||||
work_n_verts = decal_plane_clip_tri(LAST_POLY->point, work_poly);
|
||||
}else{
|
||||
memcpy(work_poly, LAST_POLY->point, sizeof(vertex)*3);
|
||||
work_n_verts = 3;
|
||||
if(clip){
|
||||
//cliped decals
|
||||
for (i=1;i<(nv-1);i++) {
|
||||
if(set_decal->n_poly >= MAX_DECAL_POLY-1){
|
||||
mprintf(("bugging out becase there are too many polys in the decal\n"));
|
||||
// TIMERBAR_POP();
|
||||
return;
|
||||
}
|
||||
for( int j = 1; j < work_n_verts-1; j++){
|
||||
|
||||
LAST_POLY->point[0] = work_poly[0];
|
||||
LAST_POLY->point[1] = work_poly[j];
|
||||
LAST_POLY->point[2] = work_poly[(j+1)%work_n_verts];
|
||||
|
||||
for ( k=0;k<3;k++) {
|
||||
//calculate the UV coords
|
||||
vector temp;
|
||||
vm_vert2vec(&LAST_POLY->point[k], &temp);
|
||||
LAST_POLY->point[k].u = (fvi_point_dist_plane(&decal_cube_plane[0][0], &decal_cube_plane[0][1], &temp) / (min_rad*2));
|
||||
LAST_POLY->point[k].v = (fvi_point_dist_plane(&decal_cube_plane[2][0], &decal_cube_plane[2][1], &temp) / (min_rad*2));
|
||||
|
||||
Assert(decal_points_allocated >= i%nv);
|
||||
Assert(decal_points_allocated >= (i+1)%nv);
|
||||
Assert(decal_points_allocated >= decal__poly[0]);
|
||||
Assert(decal_points_allocated >= decal__poly[i%nv]);
|
||||
Assert(decal_points_allocated >= decal__poly[(i+1)%nv]);
|
||||
|
||||
vm_vec2vert(decal_point_list[decal__poly[0]], &LAST_POLY->point[0]);
|
||||
vm_vec2vert(decal_point_list[decal__poly[i%nv]], &LAST_POLY->point[1]);
|
||||
vm_vec2vert(decal_point_list[decal__poly[(i+1)%nv]], &LAST_POLY->point[2]);
|
||||
LAST_POLY->norm[0] = norm;
|
||||
LAST_POLY->norm[1] = norm;
|
||||
LAST_POLY->norm[2] = norm;
|
||||
// set_decal->poly[set_decal->n_poly].norm = norm;
|
||||
// set_decal->n_poly++;
|
||||
int k;
|
||||
float a[3], b[3];
|
||||
for (k=0;k<3;k++) {
|
||||
vec3d temp;
|
||||
vm_vert2vec(&LAST_POLY->point[k], &temp);
|
||||
b[k] = (fvi_point_dist_plane(&decal_cube_plane[4][0], &decal_cube_plane[4][1], &temp) / (max_rad*3));
|
||||
a[k] = (fvi_point_dist_plane(&decal_cube_plane[5][0], &decal_cube_plane[5][1], &temp) / (max_rad*3));
|
||||
}
|
||||
for ( k=0;k<3;k++) {
|
||||
//calculate the UV coords
|
||||
vec3d temp;
|
||||
vm_vert2vec(&LAST_POLY->point[k], &temp);
|
||||
LAST_POLY->point[k].u = (fvi_point_dist_plane(&decal_cube_plane[0][0], &decal_cube_plane[0][1], &temp) / (min_rad*2));
|
||||
LAST_POLY->point[k].v = (fvi_point_dist_plane(&decal_cube_plane[2][0], &decal_cube_plane[2][1], &temp) / (min_rad*2));
|
||||
}
|
||||
// bool uv_passed = check_uv(LAST_POLY);
|
||||
// mprintf(("decal poly %d, vert 0 being set to %d, vert 1 %d, and vert 2 %d\n", set_decal->n_poly, new_decal->poly[set_decal->n_poly].point[0], new_decal->poly[set_decal->n_poly].point[1], new_decal->poly[set_decal->n_poly].point[2]));
|
||||
int work_n_verts = 0;;
|
||||
/*if(uv_passed)*/{
|
||||
if(pradius > max_rad){
|
||||
work_n_verts = decal_plane_clip_tri(LAST_POLY->point, work_poly);
|
||||
}else{
|
||||
memcpy(work_poly, LAST_POLY->point, sizeof(vertex)*3);
|
||||
work_n_verts = 3;
|
||||
}
|
||||
for( int j = 1; j < work_n_verts-1; j++){
|
||||
|
||||
LAST_POLY->point[0] = work_poly[0];
|
||||
LAST_POLY->point[1] = work_poly[j];
|
||||
LAST_POLY->point[2] = work_poly[(j+1)%work_n_verts];
|
||||
|
||||
for ( k=0;k<3;k++) {
|
||||
//calculate the UV coords
|
||||
vec3d temp;
|
||||
vm_vert2vec(&LAST_POLY->point[k], &temp);
|
||||
LAST_POLY->point[k].u = (fvi_point_dist_plane(&decal_cube_plane[0][0], &decal_cube_plane[0][1], &temp) / (min_rad*2));
|
||||
LAST_POLY->point[k].v = (fvi_point_dist_plane(&decal_cube_plane[2][0], &decal_cube_plane[2][1], &temp) / (min_rad*2));
|
||||
}
|
||||
|
||||
bool uv_passed = check_uv(LAST_POLY);
|
||||
if(defenately){
|
||||
LAST_POLY = set_decal->add_poly();
|
||||
mprintf(("there are now %d polys in the current decal\n", set_decal->n_poly));
|
||||
}else
|
||||
if(uv_passed && IS_VEC_NULL(&local_closest)){
|
||||
//if local_closest is null than the poly is coplaner to the poly that was hit,
|
||||
//only if it's UVs are out of range would it not count
|
||||
LAST_POLY = set_decal->add_poly();
|
||||
mprintf(("there are now %d polys in the current decal\n", set_decal->n_poly));
|
||||
}else
|
||||
if(uv_passed && check_ab(a,b)){
|
||||
LAST_POLY = set_decal->add_poly();
|
||||
mprintf(("there are now %d polys in the current decal\n", set_decal->n_poly));
|
||||
}/*else
|
||||
if(shpere_tri_edge(&decal_hit_point, decal_min_hit_radius, LAST_POLY->point)){
|
||||
LAST_POLY = set_decal->add_poly();
|
||||
mprintf(("there are now %d polys in the current decal, sphere colide\n", set_decal->n_poly));
|
||||
}else
|
||||
if(shpere_tri_edge(&decal_hit_point, decal_hit_radius, LAST_POLY->point)){
|
||||
LAST_POLY = set_decal->add_poly();
|
||||
mprintf(("there are now %d polys in the current decal, big sphere colide\n", set_decal->n_poly));
|
||||
}*/
|
||||
}
|
||||
}
|
||||
}
|
||||
}else{
|
||||
for (i=1;i<(nv-1);i++) {
|
||||
// for (int k=0;k<3;k++) {
|
||||
//calculate the UV coords
|
||||
vm_vec2vert(decal_point_list[decal__poly[0]], &LAST_POLY->point[0]);
|
||||
vec3d temp;
|
||||
vm_vert2vec(&LAST_POLY->point[0], &temp);
|
||||
LAST_POLY->point[0].u = (fvi_point_dist_plane(&decal_cube_plane[0][0], &decal_cube_plane[0][1], &temp) / (min_rad*2));
|
||||
LAST_POLY->point[0].v = (fvi_point_dist_plane(&decal_cube_plane[2][0], &decal_cube_plane[2][1], &temp) / (min_rad*2));
|
||||
|
||||
bool uv_passed = check_uv(LAST_POLY);
|
||||
if(defenately){
|
||||
LAST_POLY = set_decal->add_poly();
|
||||
mprintf(("there are now %d polys in the current decal\n", set_decal->n_poly));
|
||||
}else
|
||||
if(uv_passed && IS_VEC_NULL(&local_closest)){
|
||||
//if local_closest is null than the poly is coplaner to the poly that was hit,
|
||||
//only if it's UVs are out of range would it not count
|
||||
LAST_POLY = set_decal->add_poly();
|
||||
mprintf(("there are now %d polys in the current decal\n", set_decal->n_poly));
|
||||
}else
|
||||
if(uv_passed && check_ab(a,b)){
|
||||
LAST_POLY = set_decal->add_poly();
|
||||
mprintf(("there are now %d polys in the current decal\n", set_decal->n_poly));
|
||||
}/*else
|
||||
if(shpere_tri_edge(&decal_hit_point, decal_min_hit_radius, LAST_POLY->point)){
|
||||
LAST_POLY = set_decal->add_poly();
|
||||
mprintf(("there are now %d polys in the current decal, sphere colide\n", set_decal->n_poly));
|
||||
}else
|
||||
if(shpere_tri_edge(&decal_hit_point, decal_hit_radius, LAST_POLY->point)){
|
||||
LAST_POLY = set_decal->add_poly();
|
||||
mprintf(("there are now %d polys in the current decal, big sphere colide\n", set_decal->n_poly));
|
||||
}*/
|
||||
vm_vec2vert(decal_point_list[decal__poly[i]], &LAST_POLY->point[1]);
|
||||
vm_vert2vec(&LAST_POLY->point[1], &temp);
|
||||
LAST_POLY->point[1].u = (fvi_point_dist_plane(&decal_cube_plane[0][0], &decal_cube_plane[0][1], &temp) / (min_rad*2));
|
||||
LAST_POLY->point[1].v = (fvi_point_dist_plane(&decal_cube_plane[2][0], &decal_cube_plane[2][1], &temp) / (min_rad*2));
|
||||
|
||||
vm_vec2vert(decal_point_list[decal__poly[(i+1)%nv]], &LAST_POLY->point[2]);
|
||||
vm_vert2vec(&LAST_POLY->point[2], &temp);
|
||||
LAST_POLY->point[2].u = (fvi_point_dist_plane(&decal_cube_plane[0][0], &decal_cube_plane[0][1], &temp) / (min_rad*2));
|
||||
LAST_POLY->point[2].v = (fvi_point_dist_plane(&decal_cube_plane[2][0], &decal_cube_plane[2][1], &temp) / (min_rad*2));
|
||||
|
||||
// }
|
||||
bool uv_passed = check_uv(LAST_POLY);
|
||||
if(defenately){
|
||||
LAST_POLY = set_decal->add_poly();
|
||||
mprintf(("there are now %d polys in the current decal\n", set_decal->n_poly));
|
||||
}else
|
||||
if(uv_passed && IS_VEC_NULL(&local_closest)){
|
||||
//if local_closest is null than the poly is coplaner to the poly that was hit,
|
||||
//only if it's UVs are out of range would it not count
|
||||
LAST_POLY = set_decal->add_poly();
|
||||
mprintf(("there are now %d polys in the current decal\n", set_decal->n_poly));
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -2020,7 +2060,7 @@ check_poly_decals();
|
||||
if(list->buffer > -1)gr_destroy_buffer(list->buffer);
|
||||
if(dec_list.n_verts)list->buffer = gr_make_buffer(&dec_list, VERTEX_FLAG_POSITION | VERTEX_FLAG_NORMAL | VERTEX_FLAG_UV1);
|
||||
else {
|
||||
Warning(LOCATION, "no polys in the poly list!");
|
||||
//n Warning(LOCATION, "no polys in the poly list!");
|
||||
list->buffer = -1;
|
||||
}
|
||||
|
||||
@@ -2036,8 +2076,8 @@ check_poly_decals();
|
||||
}
|
||||
|
||||
/*
|
||||
void decal_render_all(object * obj){
|
||||
#ifdef DECALS_ENABLED
|
||||
void decal_render_all(object * obj)
|
||||
{
|
||||
if(obj->type != OBJ_SHIP){
|
||||
return;
|
||||
}
|
||||
@@ -2053,17 +2093,17 @@ void decal_render_all(object * obj){
|
||||
}
|
||||
gr_zbias(0);
|
||||
gr_set_texture_addressing(TMAP_ADDRESS_WRAP);
|
||||
|
||||
#endif
|
||||
}
|
||||
*/
|
||||
|
||||
extern int GLOWMAP;
|
||||
void decal_render_system(decal_system* system){
|
||||
//return;
|
||||
int i;
|
||||
|
||||
if(system->decals_modified)rebuild_decal_buffer(system);
|
||||
gr_zbias(4);
|
||||
for(int i = 0; i<system->n_decal_textures; i++){
|
||||
for(i = 0; i<system->n_decal_textures; i++){
|
||||
GLOWMAP = system->decals[i].glow_texture;
|
||||
gr_set_bitmap( system->decals[i].texture, GR_ALPHABLEND_NONE, GR_BITBLT_MODE_NORMAL, 1.0 );
|
||||
if(system->decals[i].buffer != -1){
|
||||
@@ -2086,6 +2126,8 @@ void decal_render_system(decal_system* system){
|
||||
//if it's still alive render it
|
||||
Assert(list->dec.n_poly > 0 && list->dec.vertex_buffer_start > -1);
|
||||
Assert(list->dec.vertex_buffer_start == 3*(list->dec.vertex_buffer_start/3));
|
||||
if(!list->dec.n_poly)continue;
|
||||
if(list->dec.vertex_buffer_start < 0)continue;
|
||||
float a = 1.0f - ( (float(timestamp()) - float(list->dec.timestamp)) / float(list->dec.burn_time) );
|
||||
gr_set_bitmap( system->decals[i].burn_texture, GR_ALPHABLEND_FILTER, GR_BITBLT_MODE_NORMAL, a );
|
||||
gr_render_buffer(verts_used, list->dec.n_poly, NULL);
|
||||
@@ -2104,9 +2146,9 @@ void set_submodel_instance(int model_num, int sub_model_num){
|
||||
polymodel *pm = model_get(model_num);
|
||||
|
||||
angles orient[8];//probly only need 2 or 3, but what the hell
|
||||
vector offset[8];
|
||||
vec3d offset[8];
|
||||
|
||||
while ((sub_model_num>-1) && (pm->submodel[sub_model_num].parent > -1) ) {
|
||||
while ((sub_model_num >= 0) && (pm->submodel[sub_model_num].parent >= 0) ) {
|
||||
|
||||
orient[decal_submodel_instance_depth] = pm->submodel[sub_model_num].angs;
|
||||
offset[decal_submodel_instance_depth] = pm->submodel[sub_model_num].offset;
|
||||
@@ -2128,10 +2170,11 @@ void end_submodel_instance(){
|
||||
Assert(!decal_submodel_instance_depth);
|
||||
}
|
||||
|
||||
void decal_render_all(object * obj){
|
||||
void decal_render_all(object * obj)
|
||||
{
|
||||
if(!Cmdline_decals)return;
|
||||
// return;
|
||||
#ifdef DECALS_ENABLED
|
||||
|
||||
// TIMERBAR_PUSH(TIMERBAR_DARKGREEN);
|
||||
/*check_ship_decals();
|
||||
check_list_decals();
|
||||
@@ -2177,6 +2220,5 @@ check_poly_decals();*/
|
||||
check_list_decals();
|
||||
check_poly_decals();
|
||||
*/
|
||||
#endif
|
||||
}
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
//header file for making decals-Bobboau
|
||||
|
||||
#include "PreProcDefines.h"
|
||||
|
||||
#ifndef _DECAL_H
|
||||
#define _DECAL_H
|
||||
@@ -8,8 +7,6 @@
|
||||
|
||||
#include "object/object.h"
|
||||
|
||||
//#define DECALS_ENABLED
|
||||
|
||||
#define MAX_DECAL_POLY 40
|
||||
#define MAX_DECAL_POLY_POINT 10
|
||||
#define MAX_DECAL_DEFPOINTS 10000
|
||||
@@ -35,7 +32,7 @@ struct decal_list;
|
||||
struct decal_list_controle;
|
||||
|
||||
struct decal_poly{
|
||||
vector norm[3];
|
||||
vec3d norm[3];
|
||||
vertex point[3];
|
||||
decal_poly *next;
|
||||
decal* parent;
|
||||
@@ -93,7 +90,7 @@ struct decal_system{
|
||||
//this is used to give all the data to the generation data to the functions that make them
|
||||
|
||||
struct decal_point{
|
||||
vector pnt;
|
||||
vec3d pnt;
|
||||
matrix orient;
|
||||
float radius;
|
||||
};
|
||||
|
||||
@@ -9,12 +9,21 @@
|
||||
|
||||
/*
|
||||
* $Logfile: /Freespace2/code/Demo/Demo.cpp $
|
||||
* $Revision: 2.5 $
|
||||
* $Date: 2004-07-26 20:47:27 $
|
||||
* $Author: Kazan $
|
||||
* $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
|
||||
*
|
||||
@@ -59,7 +68,7 @@
|
||||
|
||||
#include "demo/demo.h"
|
||||
#include "ship/ship.h"
|
||||
#include "Weapon/weapon.h"
|
||||
#include "weapon/weapon.h"
|
||||
#include "globalincs/linklist.h"
|
||||
#include "freespace2/freespace.h"
|
||||
#include "object/object.h"
|
||||
@@ -148,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)
|
||||
|
||||
@@ -295,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;
|
||||
@@ -339,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;
|
||||
@@ -389,7 +398,7 @@ void demo_close()
|
||||
|
||||
// free the buffer
|
||||
if(Demo_buf != NULL){
|
||||
free(Demo_buf);
|
||||
vm_free(Demo_buf);
|
||||
Demo_buf = NULL;
|
||||
}
|
||||
|
||||
@@ -827,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,15 @@
|
||||
|
||||
/*
|
||||
* $Logfile: /Freespace2/code/Demo/Demo.h $
|
||||
* $Revision: 2.1 $
|
||||
* $Date: 2004-08-11 05:06:21 $
|
||||
* $Author: Kazan $
|
||||
* $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
|
||||
*
|
||||
@@ -34,7 +37,6 @@
|
||||
* $NoKeywords: $
|
||||
*/
|
||||
|
||||
#include "PreProcDefines.h"
|
||||
|
||||
#ifndef _FS2_DEMO_SYSTEM_HEADER_FILE
|
||||
#define _FS2_DEMO_SYSTEM_HEADER_FILE
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
#include <stdio.h>
|
||||
|
||||
#include "osapi/osapi.h"
|
||||
#include "dx8show.h"
|
||||
#include "directx/dx8show.h"
|
||||
#include "debugconsole/dbugfile.h"
|
||||
#include "graphics/2d.h"
|
||||
|
||||
@@ -103,7 +103,7 @@ HRESULT PlayMovieInWindow(HWND ghApp, LPTSTR szFile)
|
||||
|
||||
// Convert filename to wide character string
|
||||
// wcscpy(wFile, T2W(szFile)); // requires ATL
|
||||
swprintf(wFile, L"%s", szFile); // Uses libc to convert instead
|
||||
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,
|
||||
@@ -159,7 +159,8 @@ HRESULT PlayMovieInWindow(HWND ghApp, LPTSTR szFile)
|
||||
return hr;
|
||||
}
|
||||
|
||||
|
||||
extern int Cmdline_window;
|
||||
extern int Cmdline_noscalevid;
|
||||
HRESULT InitVideoWindow(HWND ghApp, long video_w, long video_h)
|
||||
{
|
||||
HRESULT hr = S_OK;
|
||||
@@ -170,11 +171,25 @@ HRESULT InitVideoWindow(HWND ghApp, long video_w, long video_h)
|
||||
int screen_w = rect.right;
|
||||
int screen_h = rect.bottom;
|
||||
|
||||
int video_rescale_w = (video_w * screen_w) / video_w;
|
||||
int video_rescale_h = (video_rescale_w * video_h) / video_w;
|
||||
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) {
|
||||
|
||||
|
||||
@@ -1,4 +1,3 @@
|
||||
#include "PreProcDefines.h"
|
||||
|
||||
#ifndef _DX8SHOW_HEADER_FILE
|
||||
#define _DX8SHOW_HEADER_FILE
|
||||
|
||||
@@ -6,7 +6,6 @@
|
||||
* Content: AsyncData object include file
|
||||
***************************************************************************/
|
||||
|
||||
#include "PreProcDefines.h"
|
||||
#ifndef __ASYNC_INCLUDED__
|
||||
#define __ASYNC_INCLUDED__
|
||||
|
||||
|
||||
@@ -7,7 +7,6 @@
|
||||
*
|
||||
***************************************************************************/
|
||||
|
||||
#include "PreProcDefines.h"
|
||||
#ifndef _D3DTYPES_H_
|
||||
#define _D3DTYPES_H_
|
||||
|
||||
|
||||
@@ -7,7 +7,6 @@
|
||||
*
|
||||
***************************************************************************/
|
||||
|
||||
#include "PreProcDefines.h"
|
||||
#ifndef __DDRAW_INCLUDED__
|
||||
#define __DDRAW_INCLUDED__
|
||||
|
||||
|
||||
@@ -7,7 +7,6 @@
|
||||
*
|
||||
****************************************************************************/
|
||||
|
||||
#include "PreProcDefines.h"
|
||||
#ifndef __DINPUT_INCLUDED__
|
||||
#define __DINPUT_INCLUDED__
|
||||
|
||||
|
||||
@@ -7,7 +7,6 @@
|
||||
*
|
||||
***************************************************************************/
|
||||
|
||||
#include "PreProcDefines.h"
|
||||
#ifndef __DPLAY_INCLUDED__
|
||||
#define __DPLAY_INCLUDED__
|
||||
|
||||
|
||||
@@ -6,7 +6,6 @@
|
||||
* Content: DirectPlayLobby include file
|
||||
***************************************************************************/
|
||||
|
||||
#include "PreProcDefines.h"
|
||||
#ifndef __DPLOBBY_INCLUDED__
|
||||
#define __DPLOBBY_INCLUDED__
|
||||
|
||||
|
||||
@@ -6,7 +6,6 @@
|
||||
* Content: DirectXSetup, error codes and flags
|
||||
***************************************************************************/
|
||||
|
||||
#include "PreProcDefines.h"
|
||||
|
||||
#ifndef __DSETUP_H__
|
||||
#define __DSETUP_H__
|
||||
|
||||
@@ -7,7 +7,6 @@
|
||||
*
|
||||
**************************************************************************/
|
||||
|
||||
#include "PreProcDefines.h"
|
||||
|
||||
#ifndef __DSOUND_INCLUDED__
|
||||
#define __DSOUND_INCLUDED__
|
||||
|
||||
@@ -7,7 +7,6 @@
|
||||
*
|
||||
***************************************************************************/
|
||||
|
||||
#include "PreProcDefines.h"
|
||||
|
||||
#ifndef __DVP_INCLUDED__
|
||||
#define __DVP_INCLUDED__
|
||||
|
||||
@@ -9,13 +9,16 @@
|
||||
|
||||
/*
|
||||
* $Logfile: /Freespace2/code/ExceptionHandler/ExceptionHandler.cpp $
|
||||
* $Revision: 2.7 $
|
||||
* $Date: 2004-07-26 20:47:27 $
|
||||
* $Author: Kazan $
|
||||
* $Revision: 2.8 $
|
||||
* $Date: 2005-01-31 23:27:52 $
|
||||
* $Author: taylor $
|
||||
*
|
||||
* Main file for dealing with exception handling
|
||||
*
|
||||
* $Log: not supported by cvs2svn $
|
||||
* Revision 2.7 2004/07/26 20:47:27 Kazan
|
||||
* remove MCD complete
|
||||
*
|
||||
* Revision 2.6 2004/07/12 16:32:45 Kazan
|
||||
* MCD - define _MCD_CHECK to use memory tracking
|
||||
*
|
||||
@@ -73,11 +76,11 @@ information after crashes. See exceptionhandler.h for information
|
||||
on how to hook it in.
|
||||
*/
|
||||
|
||||
#ifdef _WIN32
|
||||
|
||||
#include <windows.h>
|
||||
|
||||
|
||||
|
||||
#pragma warning(disable:4711) // function selected for inlining
|
||||
|
||||
// --------------------
|
||||
@@ -560,3 +563,5 @@ int __cdecl RecordExceptionInfo(PEXCEPTION_POINTERS data, const char *Message)
|
||||
|
||||
return EXCEPTION_CONTINUE_SEARCH;
|
||||
}
|
||||
|
||||
#endif // _WIN32
|
||||
@@ -9,13 +9,20 @@
|
||||
|
||||
/*
|
||||
* $Logfile: /Freespace2/code/ExceptionHandler/ExceptionHandler.h $
|
||||
* $Revision: 2.2 $
|
||||
* $Date: 2004-08-11 05:06:22 $
|
||||
* $Author: Kazan $
|
||||
* $Revision: 2.4 $
|
||||
* $Date: 2005-07-13 02:50:52 $
|
||||
* $Author: Goober5000 $
|
||||
*
|
||||
* Header file for program exception handling
|
||||
*
|
||||
* $Log: not supported by cvs2svn $
|
||||
* Revision 2.3 2005/04/12 05:26:36 taylor
|
||||
* many, many compiler warning and header fixes (Jens Granseuer)
|
||||
* fix free on possible NULL in modelinterp.cpp (Jens Granseuer)
|
||||
*
|
||||
* Revision 2.2 2004/08/11 05:06:22 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
|
||||
*
|
||||
@@ -38,14 +45,12 @@
|
||||
* $NoKeywords: $
|
||||
*/
|
||||
|
||||
#include "PreProcDefines.h"
|
||||
#ifdef _MSC_VER
|
||||
#pragma once // Include this file only once
|
||||
#endif
|
||||
|
||||
#ifndef __EXCEPTION_HANDLER_H
|
||||
#define __EXCEPTION_HANDLER_H
|
||||
|
||||
|
||||
|
||||
// --------------------
|
||||
//
|
||||
// Defines
|
||||
|
||||
@@ -9,13 +9,48 @@
|
||||
|
||||
/*
|
||||
* $Logfile: /Freespace2/code/Fireball/FireBalls.cpp $
|
||||
* $Revision: 2.19 $
|
||||
* $Date: 2004-11-01 20:57:03 $
|
||||
* $Revision: 2.26 $
|
||||
* $Date: 2005-04-05 05:53:15 $
|
||||
* $Author: taylor $
|
||||
*
|
||||
* Code to move, render and otherwise deal with fireballs.
|
||||
*
|
||||
* $Log: not supported by cvs2svn $
|
||||
* Revision 2.25 2005/03/19 18:02:33 bobboau
|
||||
* added new graphic functions for state blocks
|
||||
* also added a class formanageing a new effect
|
||||
*
|
||||
* Revision 2.24 2005/03/14 03:24:25 taylor
|
||||
* speedup grow/shrink time for the warp to avoid the big size skips
|
||||
*
|
||||
* Revision 2.23 2005/03/10 08:00:02 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.22 2005/03/01 06:55:40 bobboau
|
||||
* oh, hey look I've commited something :D
|
||||
* animation system, weapon models detail box alt-tab bug, probly other stuff
|
||||
*
|
||||
* Revision 2.21 2005/02/23 05:05:39 taylor
|
||||
* compiler warning fixes (for MSVC++ 6)
|
||||
* have the warp effect only load as many LODs as will get used
|
||||
* head off strange bug in release when corrupt soundtrack number gets used
|
||||
* (will still Assert in debug)
|
||||
* don't ever try and save a campaign savefile in multi or standalone modes
|
||||
* first try at 32bit->16bit color conversion for TGA code (for TGA only ship textures)
|
||||
*
|
||||
* Revision 2.20 2005/01/30 09:27:39 Goober5000
|
||||
* nitpicked some boolean tests, and fixed two small bugs
|
||||
* --Goober5000
|
||||
*
|
||||
* Revision 2.19 2004/11/01 20:57:03 taylor
|
||||
* make use of Knossos_warp_ani_used flag - thanks Goober5000
|
||||
*
|
||||
* Revision 2.18 2004/10/31 02:26:15 Goober5000
|
||||
* whoops
|
||||
* --Goober5000
|
||||
@@ -417,12 +452,14 @@
|
||||
int Warp_model;
|
||||
int Knossos_warp_ani_used;
|
||||
|
||||
#define WARPHOLE_GROW_TIME (3.5f) // time for warphole to reach max size (also time to shrink to nothing once it begins to shrink)
|
||||
#define WARPHOLE_GROW_TIME (2.5f) // time for warphole to reach max size (also time to shrink to nothing once it begins to shrink)
|
||||
|
||||
#define MAX_FIREBALL_LOD 4
|
||||
|
||||
#define MAX_FIREBALLS 200
|
||||
|
||||
#define MAX_WARP_LOD 0
|
||||
|
||||
fireball Fireballs[MAX_FIREBALLS];
|
||||
|
||||
fireball_info Fireball_info[MAX_FIREBALL_TYPES];
|
||||
@@ -432,6 +469,7 @@ int Num_fireballs = 0;
|
||||
int fireballs_inited = 0;
|
||||
|
||||
int Warp_glow_bitmap = -1;
|
||||
int Warp_ball_bitmap = -1;
|
||||
|
||||
#define FB_INDEX(fb) (fb-Fireballs)
|
||||
|
||||
@@ -551,6 +589,10 @@ void fireball_load_data()
|
||||
fd = &Fireball_info[i];
|
||||
|
||||
for(idx=0; idx<fd->lod_count; idx++){
|
||||
// we won't use a warp effect lod greater than MAX_WARP_LOD so don't load it either
|
||||
if ( (i == FIREBALL_WARP_EFFECT) && (idx > MAX_WARP_LOD) )
|
||||
continue;
|
||||
|
||||
fd->lod[idx].bitmap_id = bm_load_animation( fd->lod[idx].filename, &fd->lod[idx].num_frames, &fd->lod[idx].fps, 1 );
|
||||
if ( fd->lod[idx].bitmap_id < 0 ) {
|
||||
Error(LOCATION, "Could not load %s anim file\n", fd->lod[idx].filename);
|
||||
@@ -561,6 +603,9 @@ void fireball_load_data()
|
||||
if ( Warp_glow_bitmap == -1 ) {
|
||||
Warp_glow_bitmap = bm_load( NOX("warpglow01") );
|
||||
}
|
||||
if ( Warp_ball_bitmap == -1 ) {
|
||||
Warp_ball_bitmap = bm_load( NOX("warpball01") );
|
||||
}
|
||||
|
||||
// polymodel Warp_pm;
|
||||
|
||||
@@ -825,7 +870,7 @@ int fireball_free_one()
|
||||
fb = &Fireballs[i];
|
||||
|
||||
// only remove the ones that aren't warp effects
|
||||
if ( (fb->objnum>-1) && fireball_is_perishable(&Objects[fb->objnum]) ) {
|
||||
if ( (fb->objnum >= 0) && fireball_is_perishable(&Objects[fb->objnum]) ) {
|
||||
|
||||
lifeleft = fb->total_time - fb->time_elapsed;
|
||||
if ( (oldest_objnum < 0) || (lifeleft < oldest_lifeleft) ) {
|
||||
@@ -941,11 +986,15 @@ float fireball_lifeleft_percent( object *obj )
|
||||
|
||||
fb = &Fireballs[num];
|
||||
|
||||
return (fb->total_time - fb->time_elapsed) / fb->total_time;
|
||||
// Assert((fb->total_time - fb->time_elapsed) / fb->total_time >=0);
|
||||
|
||||
float p = (fb->total_time - fb->time_elapsed) / fb->total_time;
|
||||
if (p < 0)p=0.0f;
|
||||
return p;
|
||||
}
|
||||
|
||||
// determine LOD to use
|
||||
int fireball_get_lod(vector *pos, fireball_info *fd, float size)
|
||||
int fireball_get_lod(vec3d *pos, fireball_info *fd, float size)
|
||||
{
|
||||
vertex v;
|
||||
int x, y, w, h, bm_size;
|
||||
@@ -974,7 +1023,7 @@ int fireball_get_lod(vector *pos, fireball_info *fd, float size)
|
||||
// if vertex is behind, find size if in front, then drop down 1 LOD
|
||||
if (v.codes & CC_BEHIND) {
|
||||
float dist = vm_vec_dist_quick(&Eye_position, pos);
|
||||
vector temp;
|
||||
vec3d temp;
|
||||
|
||||
behind = 1;
|
||||
vm_vec_scale_add(&temp, &Eye_position, &Eye_matrix.vec.fvec, dist);
|
||||
@@ -1023,11 +1072,11 @@ int fireball_get_lod(vector *pos, fireball_info *fd, float size)
|
||||
}
|
||||
|
||||
// return the best lod
|
||||
return min(ret_lod, fd->lod_count - 1);
|
||||
return MIN(ret_lod, fd->lod_count - 1);
|
||||
}
|
||||
|
||||
// Create a fireball, return object index.
|
||||
int fireball_create( vector * pos, int fireball_type, int parent_obj, float size, int reverse, vector *velocity, float warp_lifetime, int ship_class, matrix *orient_override, int low_res, int extra_flags, int warp_open_sound, int warp_close_sound)
|
||||
int fireball_create( vec3d * pos, int fireball_type, int parent_obj, float size, int reverse, vec3d *velocity, float warp_lifetime, int ship_class, matrix *orient_override, int low_res, int extra_flags, int warp_open_sound, int warp_close_sound)
|
||||
{
|
||||
int n, objnum, fb_lod;
|
||||
object *obj;
|
||||
@@ -1081,7 +1130,7 @@ int fireball_create( vector * pos, int fireball_type, int parent_obj, float size
|
||||
// change lod if low res is desired
|
||||
if (low_res) {
|
||||
fb_lod++;
|
||||
fb_lod = min(fb_lod, fd->lod_count - 1);
|
||||
fb_lod = MIN(fb_lod, fd->lod_count - 1);
|
||||
}
|
||||
|
||||
// if this is a warpout fireball, never go higher than LOD 1
|
||||
@@ -1091,7 +1140,7 @@ int fireball_create( vector * pos, int fireball_type, int parent_obj, float size
|
||||
fb_lod = 1;
|
||||
}
|
||||
*/
|
||||
fb_lod = 0;
|
||||
fb_lod = MAX_WARP_LOD;
|
||||
}
|
||||
fl = &fd->lod[fb_lod];
|
||||
|
||||
@@ -1226,6 +1275,10 @@ void fireballs_page_in()
|
||||
continue;
|
||||
|
||||
for(idx=0; idx<fd->lod_count; idx++) {
|
||||
// we won't use a warp effect lod greater than MAX_WARP_LOD so don't load it either
|
||||
if ( (i == FIREBALL_WARP_EFFECT) && (idx > MAX_WARP_LOD) )
|
||||
continue;
|
||||
|
||||
bm_page_in_texture( fd->lod[idx].bitmap_id, fd->lod[idx].num_frames );
|
||||
}
|
||||
}
|
||||
|
||||
@@ -9,13 +9,24 @@
|
||||
|
||||
/*
|
||||
* $Logfile: /Freespace2/code/Fireball/FireBalls.h $
|
||||
* $Revision: 2.11 $
|
||||
* $Date: 2004-10-31 02:04:33 $
|
||||
* $Revision: 2.14 $
|
||||
* $Date: 2005-07-13 02:50:52 $
|
||||
* $Author: Goober5000 $
|
||||
*
|
||||
* Prototypes for fireball functions
|
||||
*
|
||||
* $Log: not supported by cvs2svn $
|
||||
* 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/19 18:02:33 bobboau
|
||||
* added new graphic functions for state blocks
|
||||
* also added a class formanageing a new effect
|
||||
*
|
||||
* Revision 2.11 2004/10/31 02:04:33 Goober5000
|
||||
* added Knossos_warp_ani_used flag for taylor
|
||||
* --Goober5000
|
||||
*
|
||||
* Revision 2.10 2004/09/17 07:12:22 Goober5000
|
||||
* changed around the logic for the 3D warp effect
|
||||
* --Goober5000
|
||||
@@ -198,7 +209,6 @@
|
||||
* $NoKeywords: $
|
||||
*/
|
||||
|
||||
#include "PreProcDefines.h"
|
||||
#ifndef _FIREBALLS_H
|
||||
#define _FIREBALLS_H
|
||||
|
||||
@@ -261,7 +271,7 @@ void fireball_process_post(object * obj, float frame_time);
|
||||
// reversed is for warp_in/out effects
|
||||
// Velocity: If not NULL, the fireball will move at a constant velocity.
|
||||
// warp_lifetime: If warp_lifetime > 0.0f then makes the explosion loop so it lasts this long. Only works for warp effect
|
||||
int fireball_create(vector *pos, int fireball_type, int parent_obj, float size, int reversed=0, vector *velocity=NULL, float warp_lifetime=0.0f, int ship_class=-1, matrix *orient=NULL, int low_res=0, int extra_flags=0, int warp_open_sound=0, int warp_close_sound=0);
|
||||
int fireball_create(vec3d *pos, int fireball_type, int parent_obj, float size, int reversed=0, vec3d *velocity=NULL, float warp_lifetime=0.0f, int ship_class=-1, matrix *orient=NULL, int low_res=0, int extra_flags=0, int warp_open_sound=0, int warp_close_sound=0);
|
||||
void fireball_render_plane(int plane);
|
||||
void fireball_close();
|
||||
void fireball_level_close();
|
||||
@@ -280,8 +290,9 @@ float fireball_lifeleft( object *obj );
|
||||
float fireball_lifeleft_percent( object *obj );
|
||||
|
||||
// internal function to draw warp grid.
|
||||
extern void warpin_render(object *obj, matrix *orient, vector *pos, int texture_bitmap_num, float radius, float life_percent, float max_radius, int warp_3d = 0 );
|
||||
extern void warpin_render(object *obj, matrix *orient, vec3d *pos, int texture_bitmap_num, float radius, float life_percent, float max_radius, int warp_3d = 0 );
|
||||
extern int Warp_glow_bitmap; // Internal
|
||||
extern int Warp_ball_bitmap; // Internal
|
||||
|
||||
extern int Warp_model;
|
||||
|
||||
|
||||
@@ -9,13 +9,40 @@
|
||||
|
||||
/*
|
||||
* $Logfile: /Freespace2/code/Fireball/WarpInEffect.cpp $
|
||||
* $Revision: 2.22 $
|
||||
* $Date: 2004-11-23 19:29:13 $
|
||||
* $Revision: 2.30 $
|
||||
* $Date: 2005-08-25 22:40:02 $
|
||||
* $Author: taylor $
|
||||
*
|
||||
* Code for rendering the warp in effects for ships
|
||||
*
|
||||
* $Log: not supported by cvs2svn $
|
||||
* Revision 2.29 2005/07/25 05:24:17 Goober5000
|
||||
* cleaned up some command line and mission flag stuff
|
||||
* --Goober5000
|
||||
*
|
||||
* Revision 2.28 2005/07/23 17:27:50 Goober5000
|
||||
* remove Bobboau's extra warp thing
|
||||
* --Goober5000
|
||||
*
|
||||
* Revision 2.27 2005/05/22 22:47:19 phreak
|
||||
* compile warning fixage.
|
||||
*
|
||||
* Revision 2.26 2005/04/05 05:53:15 taylor
|
||||
* s/vector/vec3d/g, better support for different compilers (Jens Granseuer)
|
||||
*
|
||||
* Revision 2.25 2005/03/25 06:57:33 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 2.24 2005/03/19 18:02:33 bobboau
|
||||
* added new graphic functions for state blocks
|
||||
* also added a class formanageing a new effect
|
||||
*
|
||||
* Revision 2.23 2005/01/01 19:47:26 taylor
|
||||
* make use of MR_NO_FOGGING to render models without fog
|
||||
*
|
||||
* Revision 2.22 2004/11/23 19:29:13 taylor
|
||||
* fix 2d warp in D3D, add cmdline option for 3d warp
|
||||
*
|
||||
* Revision 2.21 2004/09/17 07:12:22 Goober5000
|
||||
* changed around the logic for the 3D warp effect
|
||||
* --Goober5000
|
||||
@@ -212,29 +239,31 @@
|
||||
#include "render/3d.h"
|
||||
#include "fireball/fireballs.h"
|
||||
#include "mission/missionparse.h"
|
||||
#include "Nebula/Neb.h"
|
||||
#include "nebula/neb.h"
|
||||
#include "globalincs/pstypes.h"
|
||||
#include "model/model.h"
|
||||
|
||||
|
||||
extern int Warp_model;
|
||||
extern int Cmdline_nohtl;
|
||||
extern int Cmdline_3dwarp;
|
||||
|
||||
|
||||
DCF(norm,"normalize a zero length vector")
|
||||
{
|
||||
if ( Dc_command ) {
|
||||
vector tmp = vmd_zero_vector;
|
||||
vec3d tmp = vmd_zero_vector;
|
||||
vm_vec_normalize(&tmp);
|
||||
}
|
||||
}
|
||||
|
||||
void draw_face( vertex *v1, vertex *v2, vertex *v3 )
|
||||
{
|
||||
vector norm;
|
||||
vec3d norm;
|
||||
vertex *vertlist[3];
|
||||
|
||||
vm_vec_perp(&norm,(vector *)&v1->x,(vector *)&v2->x,(vector *)&v3->x);
|
||||
if ( vm_vec_dot(&norm,(vector *)&v1->x ) >= 0.0 ) {
|
||||
vm_vec_perp(&norm,(vec3d *)&v1->x,(vec3d *)&v2->x,(vec3d *)&v3->x);
|
||||
if ( vm_vec_dot(&norm,(vec3d *)&v1->x ) >= 0.0 ) {
|
||||
vertlist[0] = v3;
|
||||
vertlist[1] = v2;
|
||||
vertlist[2] = v1;
|
||||
@@ -252,8 +281,10 @@ void draw_face( vertex *v1, vertex *v2, vertex *v3 )
|
||||
#define wR_VERTICES() do { g3_rotate_vertex(verts[0], &bottom1); g3_rotate_vertex(verts[1], &bottom2); g3_rotate_vertex(verts[2], &top2); g3_rotate_vertex(verts[3], &top1); } while(0);
|
||||
#define wP_VERTICES() do { for(idx=0; idx<4; idx++){ g3_project_vertex(verts[idx]); } } while(0);
|
||||
|
||||
void warpin_render(object *obj, matrix *orient, vector *pos, int texture_bitmap_num, float radius, float life_percent, float max_radius, int warp_3d)
|
||||
void warpin_render(object *obj, matrix *orient, vec3d *pos, int texture_bitmap_num, float radius, float life_percent, float max_radius, int warp_3d)
|
||||
{
|
||||
static flash_ball warp_ball(20, .1f,.25f, &vmd_z_vector, &vmd_zero_vector, 4.0f, 0.5f);
|
||||
|
||||
int i;
|
||||
|
||||
int saved_gr_zbuffering = gr_zbuffer_get();
|
||||
@@ -263,12 +294,12 @@ void warpin_render(object *obj, matrix *orient, vector *pos, int texture_bitmap_
|
||||
|
||||
float Grid_depth = radius/2.5f;
|
||||
|
||||
vector center;
|
||||
vec3d center;
|
||||
|
||||
vm_vec_scale_add( ¢er, pos, &orient->vec.fvec, -(max_radius/2.5f)/3.0f );
|
||||
|
||||
// Warp_Map = texture_bitmap_num;//sets the warp map, and thus sets the interp flag for this being a warpin effect
|
||||
vector vecs[5];
|
||||
vec3d vecs[5];
|
||||
vertex verts[5];
|
||||
|
||||
vecs[4] = center; //this is for the warp glow-Bobboau
|
||||
@@ -295,7 +326,7 @@ void warpin_render(object *obj, matrix *orient, vector *pos, int texture_bitmap_
|
||||
|
||||
if ( life_percent < IN_PERCENT1 ) {
|
||||
// do nothing
|
||||
render_it = 0;
|
||||
render_it = 1;
|
||||
} else if ( life_percent < IN_PERCENT2 ) {
|
||||
r *= ( life_percent-IN_PERCENT1 ) / (IN_PERCENT2-IN_PERCENT1);
|
||||
render_it = 1;
|
||||
@@ -307,7 +338,7 @@ void warpin_render(object *obj, matrix *orient, vector *pos, int texture_bitmap_
|
||||
render_it = 1;
|
||||
} else {
|
||||
// do nothing
|
||||
render_it = 0;
|
||||
render_it = 1;
|
||||
}
|
||||
|
||||
if (render_it) {
|
||||
@@ -319,34 +350,31 @@ void warpin_render(object *obj, matrix *orient, vector *pos, int texture_bitmap_
|
||||
int noise_frame = fl2i(Missiontime/15.0f) % NOISE_NUM_FRAMES;
|
||||
|
||||
r *= (0.40f + Noise[noise_frame]*0.30f);
|
||||
|
||||
g3_draw_bitmap( &verts[4], 0,r, TMAP_FLAG_TEXTURED | TMAP_HTL_3D_UNLIT );
|
||||
|
||||
//Bobboau's warp thingie; this should be an option somewhere
|
||||
//r += (float)pow((2.0f*life_percent) - 1.0f,24.0f)*max_radius*2.0f;
|
||||
|
||||
g3_draw_bitmap( &verts[4], 0, r, TMAP_FLAG_TEXTURED | TMAP_HTL_3D_UNLIT );
|
||||
gr_zbuffer_set(saved_gr_zbuffering);
|
||||
}
|
||||
}
|
||||
|
||||
if(Warp_model > -1 && (warp_3d || (The_mission.flags & MISSION_FLAG_3D_WARP_EFFECT) || Cmdline_3dwarp))
|
||||
if((Warp_model >= 0) && (warp_3d || Cmdline_3dwarp))
|
||||
{
|
||||
float model_Interp_scale_x = radius /20;
|
||||
float model_Interp_scale_y = radius /20;
|
||||
float model_Interp_scale_z = radius /20;
|
||||
float model_Interp_scale_xyz = radius / 20.0f;
|
||||
|
||||
set_warp_globals(model_Interp_scale_x, model_Interp_scale_y, model_Interp_scale_z, texture_bitmap_num, (radius/max_radius) );
|
||||
set_warp_globals(model_Interp_scale_xyz, model_Interp_scale_xyz, model_Interp_scale_xyz, texture_bitmap_num, (radius/max_radius) );
|
||||
|
||||
float dist = vm_vec_dist_quick( pos, &Eye_position );
|
||||
|
||||
model_set_detail_level((int)(dist / (radius * 10.0f)));
|
||||
gr_set_cull(0);
|
||||
model_render( Warp_model, orient, pos, MR_NO_LIGHTING | MR_NORMAL);
|
||||
model_render( Warp_model, orient, pos, MR_NO_LIGHTING | MR_NORMAL | MR_NO_FOGGING);
|
||||
gr_set_cull(1);
|
||||
|
||||
// Warp_Map = -1;//un sets the warp map
|
||||
|
||||
model_Interp_scale_x = 1.0f;
|
||||
model_Interp_scale_y = 1.0f;
|
||||
model_Interp_scale_z = 1.0f;
|
||||
|
||||
set_warp_globals(model_Interp_scale_x, model_Interp_scale_y, model_Interp_scale_z, -1, -1.0f);
|
||||
set_warp_globals(1.0f, 1.0f, 1.0f, -1, -1.0f);
|
||||
|
||||
/*
|
||||
//this is that half done effect that was pissing people off-Bobboau
|
||||
@@ -354,7 +382,7 @@ void warpin_render(object *obj, matrix *orient, vector *pos, int texture_bitmap_
|
||||
gr_set_cull(0);
|
||||
|
||||
matrix m;
|
||||
vector ray_dir;
|
||||
vec3d ray_dir;
|
||||
vm_vector_2_matrix(&m, &orient->vec.fvec, NULL, NULL);//this is the beam things that will come outof the point-Bobboau
|
||||
float angle = ANG_TO_RAD(135.0f);
|
||||
if(life_percent < 0.2f){
|
||||
@@ -363,13 +391,13 @@ void warpin_render(object *obj, matrix *orient, vector *pos, int texture_bitmap_
|
||||
for(int idx=0; idx<1; idx++){
|
||||
vm_vec_random_cone(&ray_dir, &orient->vec.fvec, angle, &m);
|
||||
mprintf(( "ray direction %f %f %f, orentation %f %f %f, angle %f\n",ray_dir.xyz.x, ray_dir.xyz.y, ray_dir.xyz.z, orient->vec.fvec.xyz.x, orient->vec.fvec.xyz.y, orient->vec.fvec.xyz.z, angle));
|
||||
vector p_temp = *pos;
|
||||
vec3d p_temp = *pos;
|
||||
vm_vec_scale_add(&p_temp, pos, &ray_dir, (max_radius * 10 * frand_range(0.75f, 0.9f)));
|
||||
mprintf(( "end %f %f %f",p_temp.xyz.x, p_temp.xyz.y, p_temp.xyz.z));
|
||||
|
||||
vertex h1[4]; // halves of a beam section
|
||||
vertex *verts[4] = { &h1[0], &h1[1], &h1[2], &h1[3] };
|
||||
vector top1, bottom1, top2, bottom2;
|
||||
vec3d top1, bottom1, top2, bottom2;
|
||||
|
||||
beam_calc_facing_pts(&top1, &bottom1, &ray_dir, pos, 1.0f, 1.0f);
|
||||
beam_calc_facing_pts(&top2, &bottom2, &ray_dir, &p_temp, 1.0f, 1.0f);
|
||||
@@ -431,6 +459,16 @@ void warpin_render(object *obj, matrix *orient, vector *pos, int texture_bitmap_
|
||||
draw_face( &verts[0], &verts[3], &verts[4] );
|
||||
gr_set_cull(1);
|
||||
}
|
||||
|
||||
if ( Warp_ball_bitmap > -1 ){
|
||||
g3_start_instance_matrix(pos,orient, true);
|
||||
gr_set_bitmap(Warp_ball_bitmap, GR_ALPHABLEND_FILTER, GR_BITBLT_MODE_NORMAL, 0.9999f);
|
||||
float adg = (2.0f*life_percent) - 1.0f;
|
||||
float pct= (float)(pow(adg,4.0f)-pow(adg,128.0f))*4.0f;
|
||||
if(pct > 0.00001f)
|
||||
warp_ball.render(max_radius*pct/2.0f,adg*adg,adg*adg*6.0f);
|
||||
g3_done_instance(true);
|
||||
}
|
||||
gr_zbuffer_set( saved_gr_zbuffering );
|
||||
}
|
||||
|
||||
+1305
-334
File diff suppressed because it is too large.
Load diff
@@ -9,13 +9,22 @@
|
||||
|
||||
/*
|
||||
* $Logfile: /Freespace2/code/FREESPACE2/FreeSpace.h $
|
||||
* $Revision: 2.4 $
|
||||
* $Date: 2004-10-31 21:31:34 $
|
||||
* $Author: taylor $
|
||||
* $Revision: 2.7 $
|
||||
* $Date: 2005-07-13 02:50:52 $
|
||||
* $Author: Goober5000 $
|
||||
*
|
||||
* FreeSpace, the game, not the project, header information.
|
||||
*
|
||||
* $Log: not supported by cvs2svn $
|
||||
* Revision 2.6 2005/06/03 06:39:26 taylor
|
||||
* better audio pause/unpause support when game window loses focus or is minimized
|
||||
*
|
||||
* Revision 2.5 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.4 2004/10/31 21:31:34 taylor
|
||||
* bump COUNT_ESTIMATE, reset time compression at the start of a mission, new pilot file support, add feature_disabled popup
|
||||
*
|
||||
* Revision 2.3 2004/08/11 05:06:22 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
|
||||
*
|
||||
@@ -155,7 +164,6 @@
|
||||
* $NoKeywords: $
|
||||
*/
|
||||
|
||||
#include "PreProcDefines.h"
|
||||
#ifndef _FREESPACE_H
|
||||
#define _FREESPACE_H
|
||||
#ifndef STAMPER_PROGRAM // because of all the dependancies, I have to do this...yuck!!! MWA 7/21/97
|
||||
@@ -196,6 +204,7 @@
|
||||
|
||||
// frametime/missiontime variables
|
||||
extern fix Frametime;
|
||||
extern float flRealframetime;
|
||||
extern float flFrametime;
|
||||
extern fix Missiontime;
|
||||
|
||||
@@ -210,6 +219,7 @@ extern int Game_mode;
|
||||
extern int Game_do_state_should_skip;
|
||||
|
||||
// time compression
|
||||
extern bool Time_compression_locked;
|
||||
extern fix Game_time_compression;
|
||||
|
||||
// Set if subspace is active this level
|
||||
@@ -273,6 +283,15 @@ int game_poll();
|
||||
// function to read keyboard stuff
|
||||
void game_process_keys();
|
||||
|
||||
// call this when you don't want the user changing time compression
|
||||
void lock_time_compression(bool is_locked);
|
||||
|
||||
// call this to set time compression properly
|
||||
void set_time_compression(float multiplier, float change_time = 0);
|
||||
|
||||
//call this to change the relative time compression (ie double it)
|
||||
void change_time_compression(float multiplier);
|
||||
|
||||
// call this to set frametime properly (once per frame)
|
||||
void game_set_frametime(int state);
|
||||
|
||||
@@ -366,9 +385,9 @@ int game_hacked_data();
|
||||
// show the oem upsell screens (end of campaign, or close of game
|
||||
void oem_upsell_show_screens();
|
||||
|
||||
// function to handle pausing the game when the game is minimized
|
||||
// called from osapi.cpp
|
||||
void alt_tab_pause();
|
||||
// calls to be executed when the game is put in or restored from minimized or inactive state
|
||||
void game_pause();
|
||||
void game_unpause();
|
||||
|
||||
#endif // endif of #ifndef STAMPER_PROGRAM
|
||||
#endif
|
||||
@@ -9,13 +9,19 @@
|
||||
|
||||
/*
|
||||
* $Logfile: /Freespace2/code/Freespace2/LevelPaging.cpp $
|
||||
* $Revision: 2.6 $
|
||||
* $Date: 2004-07-26 20:47:29 $
|
||||
* $Author: Kazan $
|
||||
* $Revision: 2.8 $
|
||||
* $Date: 2005-04-21 15:58:07 $
|
||||
* $Author: taylor $
|
||||
*
|
||||
* Code to page in all the bitmaps at the beginning of a level.
|
||||
*
|
||||
* $Log: not supported by cvs2svn $
|
||||
* Revision 2.7 2005/02/04 20:06:03 taylor
|
||||
* merge with Linux/OSX tree - p0204-2
|
||||
*
|
||||
* Revision 2.6 2004/07/26 20:47:29 Kazan
|
||||
* remove MCD complete
|
||||
*
|
||||
* Revision 2.5 2004/07/12 16:32:46 Kazan
|
||||
* MCD - define _MCD_CHECK to use memory tracking
|
||||
*
|
||||
@@ -92,17 +98,19 @@ extern void asteroid_page_in();
|
||||
extern void training_mission_page_in();
|
||||
extern void neb2_page_in();
|
||||
extern void message_pagein_mission_messages();
|
||||
extern void model_page_in_stop();
|
||||
|
||||
// Pages in all the texutures for the currently
|
||||
// loaded mission. Call game_busy() occasionally...
|
||||
void level_page_in()
|
||||
{
|
||||
|
||||
mprintf(( "Beginning level bitmap paging...\n" ));
|
||||
|
||||
if(!(Game_mode & GM_STANDALONE_SERVER)){
|
||||
bm_page_in_start();
|
||||
}
|
||||
// moved to freespace.cpp on 2005/04/18 - taylor
|
||||
// mprintf(( "Beginning level bitmap paging...\n" ));
|
||||
//
|
||||
// if(!(Game_mode & GM_STANDALONE_SERVER)){
|
||||
// bm_page_in_start();
|
||||
// }
|
||||
|
||||
// Most important ones first
|
||||
ship_page_in();
|
||||
@@ -126,6 +134,7 @@ void level_page_in()
|
||||
}
|
||||
|
||||
if(!(Game_mode & GM_STANDALONE_SERVER)){
|
||||
model_page_in_stop(); // free any loaded models that aren't used
|
||||
bm_page_in_stop();
|
||||
}
|
||||
|
||||
|
||||
@@ -9,13 +9,16 @@
|
||||
|
||||
/*
|
||||
* $Logfile: /Freespace2/code/FREESPACE2/LevelPaging.h $
|
||||
* $Revision: 2.1 $
|
||||
* $Date: 2004-08-11 05:06:22 $
|
||||
* $Author: Kazan $
|
||||
* $Revision: 2.2 $
|
||||
* $Date: 2005-07-13 02:50:52 $
|
||||
* $Author: Goober5000 $
|
||||
*
|
||||
* Code to page in all the bitmaps at the beginning of a level.
|
||||
*
|
||||
* $Log: not supported by cvs2svn $
|
||||
* Revision 2.1 2004/08/11 05:06:22 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:22 penguin
|
||||
* Warpcore CVS sync
|
||||
*
|
||||
@@ -33,7 +36,6 @@
|
||||
* $NoKeywords: $
|
||||
*/
|
||||
|
||||
#include "PreProcDefines.h"
|
||||
#ifndef _LEVELPAGING_H
|
||||
#define _LEVELPAGING_H
|
||||
|
||||
|
||||
@@ -10,12 +10,35 @@
|
||||
|
||||
/*
|
||||
* $Logfile: /Freespace2/code/fs2open_pxo/Client.cpp $
|
||||
* $Revision: 1.16 $
|
||||
* $Date: 2004-11-21 16:07:22 $
|
||||
* $Author: Kazan $
|
||||
* $Revision: 1.21 $
|
||||
* $Date: 2005-07-13 02:50:49 $
|
||||
* $Author: Goober5000 $
|
||||
*
|
||||
*
|
||||
* $Log: not supported by cvs2svn $
|
||||
* Revision 1.20 2005/03/02 21:18:18 taylor
|
||||
* better support for Inferno builds (in PreProcDefines.h now, no networking support)
|
||||
* make sure NO_NETWORK builds are as friendly on Windows as it is on Linux/OSX
|
||||
* revert a timeout in Client.h back to the original value before Linux merge
|
||||
*
|
||||
* Revision 1.19 2005/02/23 13:17:04 taylor
|
||||
* few more compiler warning fixes (didn't mean to commit iostream.h change)
|
||||
* lower warning level to 3 to stop MSVC6 from complaining about C++ headers
|
||||
*
|
||||
* Revision 1.18 2005/02/23 05:05:37 taylor
|
||||
* compiler warning fixes (for MSVC++ 6)
|
||||
* have the warp effect only load as many LODs as will get used
|
||||
* head off strange bug in release when corrupt soundtrack number gets used
|
||||
* (will still Assert in debug)
|
||||
* don't ever try and save a campaign savefile in multi or standalone modes
|
||||
* first try at 32bit->16bit color conversion for TGA code (for TGA only ship textures)
|
||||
*
|
||||
* Revision 1.17 2005/02/04 20:06:03 taylor
|
||||
* merge with Linux/OSX tree - p0204-2
|
||||
*
|
||||
* Revision 1.16 2004/11/21 16:07:22 Kazan
|
||||
* dumbbugfix
|
||||
*
|
||||
* Revision 1.15 2004/11/18 00:05:36 Goober5000
|
||||
* #pragma'd a bunch of warnings
|
||||
* --Goober5000
|
||||
@@ -61,18 +84,29 @@
|
||||
*
|
||||
*/
|
||||
|
||||
|
||||
#ifndef NO_NETWORK
|
||||
|
||||
// 4711 = function selected for automatic inline expansion
|
||||
#pragma warning(disable: 4711)
|
||||
|
||||
#include "Client.h"
|
||||
//#include "protocol.h"
|
||||
#include "udpsocket.h"
|
||||
#include <iostream>
|
||||
#include <time.h>
|
||||
|
||||
|
||||
#include "fs2open_pxo/Client.h"
|
||||
//#include "fs2open_pxo/protocol.h"
|
||||
#include "fs2open_pxo/udpsocket.h"
|
||||
#include "network/multi_log.h"
|
||||
#include "playerman/player.h"
|
||||
#include "ship/ship.h"
|
||||
|
||||
PXO_Socket FS2OpenPXO_Socket;
|
||||
|
||||
// NOTE: CLK_TCK is depreciated but available for compatibility, use CLOCKS_PER_SEC instead
|
||||
#ifndef CLK_TCK
|
||||
#define CLK_TCK CLOCKS_PER_SEC
|
||||
#endif
|
||||
|
||||
#define PXO_ADDINT(n) *((int *)cur) = (n); cur += sizeof(int);
|
||||
#define PXO_ADDSTRING(x, y) memcpy(cur, x, y); cur += y;
|
||||
@@ -97,7 +131,7 @@ int CheckSingleMission(const char* mission, unsigned int crc32, UDP_Socket &Sock
|
||||
|
||||
|
||||
if (Socket.SendPacket((char *) &checkpack, sizeof(fs2open_file_check_single), sender, port) == -1)
|
||||
return NULL;
|
||||
return -1;
|
||||
|
||||
|
||||
fs2open_fcheck_reply c_reply;
|
||||
@@ -181,7 +215,7 @@ int SendPlayerData(int SID, const char* player_name, const char* user, player *p
|
||||
|
||||
// send Packet
|
||||
if (Socket.SendPacket(PacketBuffer, packet_size, sender, port) == -1)
|
||||
return NULL;
|
||||
return -1;
|
||||
|
||||
|
||||
fs2open_pilot_updatereply u_reply;
|
||||
@@ -229,7 +263,7 @@ int GetPlayerData(int SID, const char* player_name, player *pl, const char* mast
|
||||
|
||||
// send Packet
|
||||
if (Socket.SendPacket((char *)&prq_packet, sizeof(fs2open_get_pilot), sender, port) == -1)
|
||||
return NULL;
|
||||
return -1;
|
||||
|
||||
char PacketBuffer[16384]; // 16K should be enough i think..... I HOPE!
|
||||
fs2open_pilot_reply *p_reply = (fs2open_pilot_reply *) PacketBuffer;
|
||||
@@ -471,7 +505,7 @@ void SendHeartBeat(const char* masterserver, int targetport, UDP_Socket &Socket,
|
||||
hbpack.port = port;
|
||||
|
||||
std::string ms = masterserver;
|
||||
Socket.SendPacket((char *) &hbpack, sizeof(serverlist_hb_packet), ms, targetport);
|
||||
Socket.SendPacket((char *) &hbpack, (int)sizeof(serverlist_hb_packet), ms, targetport);
|
||||
}
|
||||
|
||||
|
||||
@@ -570,4 +604,6 @@ int Ping(const char* target)
|
||||
Socket.GetPacket((char *)&rping, sizeof(fs2open_pingreply), rctp);
|
||||
|
||||
return int( float(time(0) - rping.time)/2.0 );
|
||||
}
|
||||
}
|
||||
|
||||
#endif // !NO_NETWORK
|
||||
Loaded 100 of 703 files, more files were not shown because too many files have changed in this diff.
Show more
Reference in new issue
Block a user