mirror of
https://github.com/scp-fs2open/fs2open.github.com.git
synced 2026-11-07 22:56:30 -10:00
Compare commits
1329
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
c72443b83a | ||
|
|
bc9ccbbcde | ||
|
|
1fafc93186 | ||
|
|
eb71f6bf81 | ||
|
|
255ec3c779 | ||
|
|
f94ddf7a77 | ||
|
|
b5480fc314 | ||
|
|
16823d850f | ||
|
|
3f6ce50e73 | ||
|
|
2576fd2c01 | ||
|
|
3418def2e0 | ||
|
|
2a19dfa21a | ||
|
|
6d3bc3d006 | ||
|
|
bccf37689d | ||
|
|
97e74b39f9 | ||
|
|
61f538fc96 | ||
|
|
c74a0c9e97 | ||
|
|
edec7aa354 | ||
|
|
9ad97ea56f | ||
|
|
0543dcccb1 | ||
|
|
991299095c | ||
|
|
1d1d011b07 | ||
|
|
9874c1dccc | ||
|
|
55376a2424 | ||
|
|
edf0495473 | ||
|
|
a49e0db8b3 | ||
|
|
4dcdc04b52 | ||
|
|
1325c37576 | ||
|
|
3fc7b6098e | ||
|
|
d60bdcf0ff | ||
|
|
afdbf568aa | ||
|
|
386a72e566 | ||
|
|
24df8e9cae | ||
|
|
f0f8949621 | ||
|
|
335009a9a9 | ||
|
|
fccbf03cde | ||
|
|
b33637e856 | ||
|
|
741600d625 | ||
|
|
e49bdbe946 | ||
|
|
19cbd57a20 | ||
|
|
e861e5d20d | ||
|
|
7067b8ff75 | ||
|
|
1f3b94e105 | ||
|
|
419bc2ac88 | ||
|
|
a39e71fd32 | ||
|
|
b551e103d2 | ||
|
|
7adee267c4 | ||
|
|
660716a8be | ||
|
|
c427f4ab28 | ||
|
|
458dd90b81 | ||
|
|
4cd4123224 | ||
|
|
2e53d6e227 | ||
|
|
7137dd6372 | ||
|
|
b7b89337b7 | ||
|
|
5577c4e16e | ||
|
|
3ed6874cb2 | ||
|
|
e0b8abc0ba | ||
|
|
e3664152ca | ||
|
|
371c49724e | ||
|
|
b2fc33563d | ||
|
|
73c20cedd3 | ||
|
|
b51d6f84b8 | ||
|
|
7d7c87c290 | ||
|
|
cb9c66966d | ||
|
|
441ac5c066 | ||
|
|
1b65fd50a0 | ||
|
|
5d307d24f4 | ||
|
|
d06d6e6df0 | ||
|
|
e78327d879 | ||
|
|
8f42977ee8 | ||
|
|
d60c8d5f3f | ||
|
|
278a797db2 | ||
|
|
1a59a1c811 | ||
|
|
96c01e6c1e | ||
|
|
50496c8143 | ||
|
|
7d3b824428 | ||
|
|
8906c735c6 | ||
|
|
2ee839152c | ||
|
|
6be09e7157 | ||
|
|
1715b20d30 | ||
|
|
37497cb7d7 | ||
|
|
b62eba559b | ||
|
|
4fa84ee388 | ||
|
|
776f0df434 | ||
|
|
39ce7d4253 | ||
|
|
c33b54464e | ||
|
|
e3cde7086c | ||
|
|
180674154c | ||
|
|
181b758577 | ||
|
|
3f5e30b4dc | ||
|
|
15dec7e508 | ||
|
|
7e3198392b | ||
|
|
f247330e4b | ||
|
|
6c1dd85738 | ||
|
|
1a5700a0cb | ||
|
|
3584164ec0 | ||
|
|
2679f97dc2 | ||
|
|
0a041aade1 | ||
|
|
9845a1ad46 | ||
|
|
33151e956d | ||
|
|
08e565a855 | ||
|
|
fb61239f85 | ||
|
|
88ffa54ae0 | ||
|
|
5de6635111 | ||
|
|
04dc9f28cc | ||
|
|
55bdad3799 | ||
|
|
63bb60935c | ||
|
|
6d82031115 | ||
|
|
05fbb8d4de | ||
|
|
f4645e3e6c | ||
|
|
8924aa06e9 | ||
|
|
673b8f61eb | ||
|
|
f75f6af43a | ||
|
|
71a61143bf | ||
|
|
cca2a776e1 | ||
|
|
8e21aa6c88 | ||
|
|
6bb1ccc830 | ||
|
|
f6ef7c1cd6 | ||
|
|
a4c1d8f2eb | ||
|
|
20c5a86dcb | ||
|
|
ccc616fec3 | ||
|
|
07284cf221 | ||
|
|
2b4d08e842 | ||
|
|
1e3857e385 | ||
|
|
8635a8b537 | ||
|
|
762691c78f | ||
|
|
f8cb347a62 | ||
|
|
2d2df40efb | ||
|
|
f0518514a3 | ||
|
|
64104c19a8 | ||
|
|
847521b012 | ||
|
|
e6d0f9f72a | ||
|
|
1cd9d3fb04 | ||
|
|
6184ae6db6 | ||
|
|
b270ad1bb9 | ||
|
|
fbc0c79973 | ||
|
|
caf41665f4 | ||
|
|
90a2676f17 | ||
|
|
5032d06964 | ||
|
|
f9f65b0795 | ||
|
|
c9380f0091 | ||
|
|
033ba61588 | ||
|
|
09ce1f1846 | ||
|
|
6184136ffe | ||
|
|
e98fd0bab3 | ||
|
|
a1a8a53a65 | ||
|
|
38b51723e0 | ||
|
|
dc708ccbbb | ||
|
|
5206220f5a | ||
|
|
c049e7335b | ||
|
|
a05d19db6b | ||
|
|
cb65ca8655 | ||
|
|
1adb64e39d | ||
|
|
6c308037e8 | ||
|
|
706b3a7f5e | ||
|
|
4c23cd0d00 | ||
|
|
1fbeccd61e | ||
|
|
564fc9a680 | ||
|
|
688c514352 | ||
|
|
acc57397e5 | ||
|
|
e47884e0fb | ||
|
|
81bd363d6d | ||
|
|
108d60330f | ||
|
|
58575399f5 | ||
|
|
1253575a68 | ||
|
|
a1d46479d7 | ||
|
|
a4043fbf21 | ||
|
|
83b8361dcd | ||
|
|
be677937ae | ||
|
|
aebdc6328b | ||
|
|
801b808764 | ||
|
|
73d12d15a3 | ||
|
|
c9a45c9fbd | ||
|
|
ddd3a7d6fe | ||
|
|
e302f0e456 | ||
|
|
0ed147fb45 | ||
|
|
da812f9433 | ||
|
|
5e623d10b0 | ||
|
|
471c898df5 | ||
|
|
4e9f5dc754 | ||
|
|
df41bbe172 | ||
|
|
617fd6a977 | ||
|
|
54e052bc2f | ||
|
|
17c6b7cd58 | ||
|
|
f12d2395dc | ||
|
|
746fe56b32 | ||
|
|
a87af22357 | ||
|
|
4179d95975 | ||
|
|
fc6bc3a1c6 | ||
|
|
5bcc89be3a | ||
|
|
54b2eddc14 | ||
|
|
7a7abe1b3b | ||
|
|
75c69271a9 | ||
|
|
64c4e4d7b4 | ||
|
|
1159e66168 | ||
|
|
37a98b8cf8 | ||
|
|
a5b705b2c1 | ||
|
|
76b98684cc | ||
|
|
aa0de45ddb | ||
|
|
e6855a4153 | ||
|
|
f61b869c7f | ||
|
|
59d6a44db3 | ||
|
|
8dc4030dbc | ||
|
|
882467cb5a | ||
|
|
5b8410de98 | ||
|
|
79f3f08543 | ||
|
|
1bd7160461 | ||
|
|
8464e1769f | ||
|
|
975e108841 | ||
|
|
6d60bb1511 | ||
|
|
28faa9e588 | ||
|
|
3ccfbb6aac | ||
|
|
78ff02501b | ||
|
|
165124267a | ||
|
|
b9033ab2a2 | ||
|
|
102efb192c | ||
|
|
da7ec6db4d | ||
|
|
e36b5398ef | ||
|
|
335cc4a114 | ||
|
|
4b05468f3c | ||
|
|
26a500bf7c | ||
|
|
81ad6dc1b5 | ||
|
|
025c58c679 | ||
|
|
bb93319871 | ||
|
|
8f224a76a4 | ||
|
|
a640015afc | ||
|
|
82807f2760 | ||
|
|
97924c0628 | ||
|
|
680ac9175f | ||
|
|
e3c4f90287 | ||
|
|
ed2bbc35eb | ||
|
|
23aa8cb18d | ||
|
|
af2725b2b7 | ||
|
|
ca95a3c25d | ||
|
|
a9b4be5928 | ||
|
|
7691c4905e | ||
|
|
9bd4fb3ac7 | ||
|
|
49b5d9a3b7 | ||
|
|
22f14d56ea | ||
|
|
5f4568cc0e | ||
|
|
39842e7115 | ||
|
|
cb90d286e5 | ||
|
|
e4c98e8527 | ||
|
|
5d593f0df0 | ||
|
|
a045e5d266 | ||
|
|
21b8e3bb52 | ||
|
|
3aa671a211 | ||
|
|
d3ce9874a7 | ||
|
|
1cfbc24fb9 | ||
|
|
4a4486c9be | ||
|
|
a1caca08ab | ||
|
|
e32e21bcd0 | ||
|
|
3fd9b8f802 | ||
|
|
890c607ad2 | ||
|
|
e2dac4b7b4 | ||
|
|
3512fcc18e | ||
|
|
f57e346eff | ||
|
|
768e097c73 | ||
|
|
b0115a5f80 | ||
|
|
a23630346b | ||
|
|
d4d805d6ca | ||
|
|
b147ea0a21 | ||
|
|
8a2eec5b4a | ||
|
|
ee64b83aec | ||
|
|
24b58db67f | ||
|
|
2ddee36007 | ||
|
|
7e9a798101 | ||
|
|
542dc68df2 | ||
|
|
b1ac0876d4 | ||
|
|
7badc4dfd9 | ||
|
|
036aae0ee2 | ||
|
|
9cc70790c9 | ||
|
|
7d392bd61c | ||
|
|
1552e02a51 | ||
|
|
175640d60a | ||
|
|
6583066936 | ||
|
|
3c564b3210 | ||
|
|
9b7ebff53a | ||
|
|
1491d4a79a | ||
|
|
d603c463af | ||
|
|
3eb47c1867 | ||
|
|
2db4bc37f2 | ||
|
|
0f0f6377d0 | ||
|
|
8e7ad5f651 | ||
|
|
bade3c58eb | ||
|
|
85a36e6fd8 | ||
|
|
2deffc1156 | ||
|
|
82ae54a6e8 | ||
|
|
0062d2567a | ||
|
|
7972cad563 | ||
|
|
c9cff48b95 | ||
|
|
8d0624b064 | ||
|
|
236857ed37 | ||
|
|
fa57ea358a | ||
|
|
a7bf7c63de | ||
|
|
81676b7d3f | ||
|
|
e1e188a43c | ||
|
|
47286d1af2 | ||
|
|
fa10977e77 | ||
|
|
aaa80dfa6f | ||
|
|
59fa7bd544 | ||
|
|
3c8b47ccfc | ||
|
|
81d8d063c2 | ||
|
|
75471276fc | ||
|
|
89d6031c79 | ||
|
|
551d64192c | ||
|
|
661678f693 | ||
|
|
94ca29735c | ||
|
|
20f84c179a | ||
|
|
5f622094af | ||
|
|
64ad950a80 | ||
|
|
a30937b041 | ||
|
|
764e1772b0 | ||
|
|
ea549ab5a0 | ||
|
|
af22ab34d3 | ||
|
|
c8785dc093 | ||
|
|
870ad9e3ae | ||
|
|
487f769064 | ||
|
|
7604e82f05 | ||
|
|
e0defd287a | ||
|
|
a413255728 | ||
|
|
d6b0e9f566 | ||
|
|
22e6de42a4 | ||
|
|
9548002890 | ||
|
|
0334bd0c3b | ||
|
|
12b98063fb | ||
|
|
854bd5ba21 | ||
|
|
096029a88d | ||
|
|
d8ab39e261 | ||
|
|
02d15f36b7 | ||
|
|
66c9e0c136 | ||
|
|
fb29b28113 | ||
|
|
3fa03fcda0 | ||
|
|
cb8154a993 | ||
|
|
a4f793e6dc | ||
|
|
e36e9ff879 | ||
|
|
3287ff6b3a | ||
|
|
81092417bd | ||
|
|
947deb8e12 | ||
|
|
bd1aa5e455 | ||
|
|
01e4741da6 | ||
|
|
37f4587230 | ||
|
|
e11f6904b4 | ||
|
|
d74981b700 | ||
|
|
6df0a704f2 | ||
|
|
0b84c18686 | ||
|
|
7523669819 | ||
|
|
b1b8ae9668 | ||
|
|
bddf438fb6 | ||
|
|
87d07c9597 | ||
|
|
407a2356eb | ||
|
|
0c5e6c7281 | ||
|
|
2bd78eee74 | ||
|
|
256ba6f9f2 | ||
|
|
040c1f39da | ||
|
|
8f6bdcddeb | ||
|
|
ed855e6e1c | ||
|
|
33c7c4eae9 | ||
|
|
962261421e | ||
|
|
5144dba6b4 | ||
|
|
9bbebfc55e | ||
|
|
02fc2b29ca | ||
|
|
b097d3e7c2 | ||
|
|
a033f653d0 | ||
|
|
4b37433c4f | ||
|
|
002dc3a965 | ||
|
|
7da81210ea | ||
|
|
57c16bd58a | ||
|
|
13c86d9540 | ||
|
|
338d6c9aaf | ||
|
|
d59c4d44cc | ||
|
|
0e07f4414e | ||
|
|
71cf169a0a | ||
|
|
184a583a32 | ||
|
|
fd66a432f5 | ||
|
|
039359e7f2 | ||
|
|
0bb6002f0a | ||
|
|
91dbf8b751 | ||
|
|
0c6bada5d5 | ||
|
|
519e89b6fa | ||
|
|
ce7c7eb3f5 | ||
|
|
8f3342f05e | ||
|
|
6dd3158570 | ||
|
|
004fdae08f | ||
|
|
8fcb1ee789 | ||
|
|
9630d80827 | ||
|
|
e49159bd91 | ||
|
|
a13542616d | ||
|
|
1960723f88 | ||
|
|
206fbabaa5 | ||
|
|
5394b4943d | ||
|
|
69f9d9f090 | ||
|
|
1cb08e0262 | ||
|
|
154a50028b | ||
|
|
e11771980e | ||
|
|
edbec0fca9 | ||
|
|
2c268e4ec6 | ||
|
|
2a9cff4f46 | ||
|
|
9050c08bec | ||
|
|
799ebe01ce | ||
|
|
248c398ba9 | ||
|
|
96ede6f68b | ||
|
|
8177c03f3f | ||
|
|
546339c53a | ||
|
|
f790b3b0c6 | ||
|
|
bbcfe162da | ||
|
|
51efc000ab | ||
|
|
cbad1cf10f | ||
|
|
56343f0d03 | ||
|
|
67d51037ff | ||
|
|
47d82a007f | ||
|
|
036000f79c | ||
|
|
3e6fb113ee | ||
|
|
515f9fffb5 | ||
|
|
28c9512727 | ||
|
|
e9a3e457cc | ||
|
|
3637a9717c | ||
|
|
ed6637031d | ||
|
|
f5ccad9619 | ||
|
|
b10de88cf0 | ||
|
|
34a7f7d60f | ||
|
|
9d6b373781 | ||
|
|
05eb4c0617 | ||
|
|
320fd33431 | ||
|
|
22832957f3 | ||
|
|
dba2d28265 | ||
|
|
647f6a867b | ||
|
|
89d072e18c | ||
|
|
b1e7a2a1bf | ||
|
|
4849f443aa | ||
|
|
aff81fe471 | ||
|
|
26d40553b2 | ||
|
|
f876b89c24 | ||
|
|
2c8d921d64 | ||
|
|
fc52668f30 | ||
|
|
97c5a29b76 | ||
|
|
fa9bd1c446 | ||
|
|
04352920ee | ||
|
|
8111924f9b | ||
|
|
a11c69673e | ||
|
|
ee730d23c9 | ||
|
|
0b61d0bd8e | ||
|
|
0fcde305ec | ||
|
|
697c900a25 | ||
|
|
fbc9ede423 | ||
|
|
0f36c6905d | ||
|
|
1d66596bfb | ||
|
|
444874b110 | ||
|
|
b704050c21 | ||
|
|
5676dbf9bd | ||
|
|
564f31aeab | ||
|
|
0ea25e79a9 | ||
|
|
5a37992d3d | ||
|
|
3ade9ae1de | ||
|
|
f2aea8e69d | ||
|
|
5c74720265 | ||
|
|
556e9a4447 | ||
|
|
1bd8e11194 | ||
|
|
bfc34953eb | ||
|
|
1c84c54e4f | ||
|
|
d790301fab | ||
|
|
253d8a7eb1 | ||
|
|
dc3c5fb561 | ||
|
|
eb1ff0f433 | ||
|
|
30564248a6 | ||
|
|
9dfa67b64d | ||
|
|
c3c7477114 | ||
|
|
bbad1c2159 | ||
|
|
bb6e01caaf | ||
|
|
fc941e9ca8 | ||
|
|
93e8e3ab6f | ||
|
|
14eec21c68 | ||
|
|
1ceae13be2 | ||
|
|
fb20632b18 | ||
|
|
62fcbeaae8 | ||
|
|
4250751ccc | ||
|
|
0a08b6348b | ||
|
|
c789b117cf | ||
|
|
cc84210ac4 | ||
|
|
8a125ab019 | ||
|
|
a7dcda9000 | ||
|
|
bfc0948f1c | ||
|
|
75411d92bb | ||
|
|
afe29c60fe | ||
|
|
b0befdc1ba | ||
|
|
51c61b5144 | ||
|
|
6cf105b768 | ||
|
|
5fd09f8557 | ||
|
|
630ab5a3cc | ||
|
|
e28640ded0 | ||
|
|
3708f101b4 | ||
|
|
332b9fa4a4 | ||
|
|
e6aa565b42 | ||
|
|
788e28c646 | ||
|
|
6ccf4116fc | ||
|
|
c4240324fb | ||
|
|
4fc2d9c610 | ||
|
|
ccc71a8e8b | ||
|
|
7dde0a79a7 | ||
|
|
e895f86e44 | ||
|
|
31e9a0dd7d | ||
|
|
505de1b905 | ||
|
|
b82d0c579d | ||
|
|
68d2e5f0eb | ||
|
|
3c4861859b | ||
|
|
8ab5cd3085 | ||
|
|
eaa09dd862 | ||
|
|
45c8ed8926 | ||
|
|
1f6fc358f8 | ||
|
|
5b8584b892 | ||
|
|
0cdac667a3 | ||
|
|
5137787a99 | ||
|
|
ddacb8cf32 | ||
|
|
88e7c83a8e | ||
|
|
5b489da8a8 | ||
|
|
35e34ac97c | ||
|
|
1ba35d42ae | ||
|
|
409ba384b0 | ||
|
|
51c2a61d76 | ||
|
|
f1fd9f9a3d | ||
|
|
96d32b5031 | ||
|
|
21a16fbf15 | ||
|
|
76b6f954da | ||
|
|
064a07349f | ||
|
|
bcedaee793 | ||
|
|
a020095b07 | ||
|
|
a5f918a811 | ||
|
|
4e21d9ee79 | ||
|
|
7efd107bfa | ||
|
|
9f4589df65 | ||
|
|
1d2153794c | ||
|
|
4a40aad107 | ||
|
|
14f1ceec4d | ||
|
|
2f78ae308b | ||
|
|
bc788d6cb7 | ||
|
|
f1b9c15618 | ||
|
|
eab9fab9ca | ||
|
|
a6d3982c7c | ||
|
|
7852d13ce5 | ||
|
|
ad62f1d342 | ||
|
|
75ae511ae6 | ||
|
|
89ebdd9bc1 | ||
|
|
ccd6d1e619 | ||
|
|
92ace8e983 | ||
|
|
61f2e78515 | ||
|
|
ebd81d9539 | ||
|
|
d3df7ef2b1 | ||
|
|
99306be6cf | ||
|
|
6835d2bf9f | ||
|
|
3f9ce3b6a5 | ||
|
|
08067bc871 | ||
|
|
415f113f4d | ||
|
|
a5b504bb85 | ||
|
|
9f94568d2f | ||
|
|
ad4fed744e | ||
|
|
0a081fb292 | ||
|
|
efa5dc9620 | ||
|
|
bfb4db1dd4 | ||
|
|
2d56358755 | ||
|
|
d52e27dcc4 | ||
|
|
12acacbba8 | ||
|
|
3bbabea978 | ||
|
|
cdc43731af | ||
|
|
edc806897f | ||
|
|
f32a6e7ab9 | ||
|
|
2e9b2de40a | ||
|
|
69ab8c179d | ||
|
|
37657fc537 | ||
|
|
1a5a0d6a7f | ||
|
|
1a196cbd7a | ||
|
|
89a6d69e08 | ||
|
|
b59c015df2 | ||
|
|
c90db8c498 | ||
|
|
cc79554f7a | ||
|
|
3df6bb82db | ||
|
|
56a9391e31 | ||
|
|
bc5b7e6906 | ||
|
|
6dc3d67905 | ||
|
|
0d1764d42e | ||
|
|
f4f31084fa | ||
|
|
5fb98551c9 | ||
|
|
5f58aaa392 | ||
|
|
484be09275 | ||
|
|
26e65cc9e5 | ||
|
|
26bca473e2 | ||
|
|
0132e2a320 | ||
|
|
873694eae2 | ||
|
|
0b1c916352 | ||
|
|
835c4a7d0e | ||
|
|
f0c0d60a11 | ||
|
|
12f4bcfd9b | ||
|
|
30c8d09c55 | ||
|
|
53f7f493cf | ||
|
|
24b0b28f6a | ||
|
|
0af93bcceb | ||
|
|
9cb1af00aa | ||
|
|
4ef212157a | ||
|
|
3bb9b0068c | ||
|
|
09aa01db6b | ||
|
|
36cc228527 | ||
|
|
022e3324ce | ||
|
|
f41c5a2a65 | ||
|
|
d672ee885f | ||
|
|
3329285192 | ||
|
|
9df07cda5e | ||
|
|
d7eca39338 | ||
|
|
d1e6aa2b4f | ||
|
|
b7aaf2e885 | ||
|
|
0339f1ba62 | ||
|
|
1a0f2cf0e0 | ||
|
|
473090e9e0 | ||
|
|
d5a2238225 | ||
|
|
cbec552c19 | ||
|
|
032aa154de | ||
|
|
3b5ba969cc | ||
|
|
be5fdd0308 | ||
|
|
abd31038e7 | ||
|
|
902fd5efbc | ||
|
|
7db9adae00 | ||
|
|
f82a730f7e | ||
|
|
932a5230e9 | ||
|
|
81d18573aa | ||
|
|
fadd4e6d18 | ||
|
|
6484a19094 | ||
|
|
98fba0c00b | ||
|
|
f95db90cc0 | ||
|
|
2199863587 | ||
|
|
df8317f3ed | ||
|
|
cc08e986a2 | ||
|
|
65cce032d3 | ||
|
|
b8479fba88 | ||
|
|
7f22a80af6 | ||
|
|
58b8f2a33c | ||
|
|
0aec74ae29 | ||
|
|
4e6a1ae716 | ||
|
|
ebca85531c | ||
|
|
0954d4e4ee | ||
|
|
ddace0c233 | ||
|
|
7a38519a83 | ||
|
|
05d4e44c97 | ||
|
|
d4d6ab3fd7 | ||
|
|
3754bfbfdf | ||
|
|
3a5f7143a2 | ||
|
|
b2215ddf7d | ||
|
|
50feb3ed08 | ||
|
|
a6f2cc5937 | ||
|
|
545287cebf | ||
|
|
84a315d1db | ||
|
|
00c3733670 | ||
|
|
7fdfdc6134 | ||
|
|
6a69b02bbb | ||
|
|
886deddf99 | ||
|
|
360a55be63 | ||
|
|
91d25a8744 | ||
|
|
c990f44f82 | ||
|
|
0d8f6f26ce | ||
|
|
55b857f269 | ||
|
|
00fa839d1d | ||
|
|
ef3bb65d63 | ||
|
|
56ab9e02c8 | ||
|
|
cbcb053fbc | ||
|
|
b76bccb9ef | ||
|
|
a535d66fc8 | ||
|
|
be4cac366b | ||
|
|
a691e81e14 | ||
|
|
07fcd05fff | ||
|
|
9737994de5 | ||
|
|
fe1db37902 | ||
|
|
238dbc5749 | ||
|
|
cd3b543e56 | ||
|
|
b3c1441d06 | ||
|
|
fb8ffcacfd | ||
|
|
0061718de4 | ||
|
|
d7ff43a1d1 | ||
|
|
a748be2315 | ||
|
|
f56f0c471d | ||
|
|
b610b9b246 | ||
|
|
00a0b1bae7 | ||
|
|
509bd8c010 | ||
|
|
9afae0b64d | ||
|
|
0a2b97c3bc | ||
|
|
52a2ac542e | ||
|
|
9bc635e098 | ||
|
|
f824df070b | ||
|
|
afe2f2dac6 | ||
|
|
72af3059e9 | ||
|
|
51832fd563 | ||
|
|
059af731a7 | ||
|
|
b4c625c51a | ||
|
|
27d85189ea | ||
|
|
b296300365 | ||
|
|
a5bff0c192 | ||
|
|
20279838bf | ||
|
|
f0c4bf2e3a | ||
|
|
38e48bec16 | ||
|
|
e5b7d48989 | ||
|
|
6850ac6fe0 | ||
|
|
0c80c8d8c0 | ||
|
|
64c9b272e7 | ||
|
|
42ddd2fe5f | ||
|
|
692c86c8e6 | ||
|
|
ba2fe6603c | ||
|
|
71d3139d14 | ||
|
|
8d564da80c | ||
|
|
e037b08e2e | ||
|
|
1d65102292 | ||
|
|
3a69db26eb | ||
|
|
e075241e54 | ||
|
|
191194dfa7 | ||
|
|
733b020bf5 | ||
|
|
9ec178f116 | ||
|
|
fb068f6037 | ||
|
|
bb6045d762 | ||
|
|
e8bb02bed3 | ||
|
|
a6e93c7d46 | ||
|
|
1cd7744d34 | ||
|
|
fc3166ac52 | ||
|
|
3826e24da2 | ||
|
|
3ece769330 | ||
|
|
6ac1326dc8 | ||
|
|
03b26baf55 | ||
|
|
4b25b49432 | ||
|
|
721422f951 | ||
|
|
509d11c29d | ||
|
|
eb765b0c99 | ||
|
|
3d06468e2a | ||
|
|
1de9ad1ace | ||
|
|
559198a2e4 | ||
|
|
6b093f2ee9 | ||
|
|
280ceabb45 | ||
|
|
ff51e79531 | ||
|
|
9cbf944dee | ||
|
|
1ded65c3d0 | ||
|
|
c26bd197dc | ||
|
|
32b35ba62c | ||
|
|
8d5273b3c0 | ||
|
|
6a5e660ff3 | ||
|
|
aaf470f49b | ||
|
|
077dc61660 | ||
|
|
116df2e2c3 | ||
|
|
4670d5f87f | ||
|
|
f986d28c56 | ||
|
|
dba0e8b458 | ||
|
|
cf68c5970e | ||
|
|
fc140194d3 | ||
|
|
a0b040c597 | ||
|
|
89e63d60b8 | ||
|
|
24a0b05b39 | ||
|
|
89f6794a13 | ||
|
|
f625df5c38 | ||
|
|
37eadf4d16 | ||
|
|
a232a646dc | ||
|
|
40c81134ac | ||
|
|
a63e1a2ba1 | ||
|
|
f00af4d89f | ||
|
|
c697dcb926 | ||
|
|
29afbe8ef5 | ||
|
|
6f01adfb2e | ||
|
|
6a578b3fcd | ||
|
|
048d65d3ca | ||
|
|
e94511b7aa | ||
|
|
8b4f7dde77 | ||
|
|
990411fd0b | ||
|
|
bd3cd7eb18 | ||
|
|
17851dcc56 | ||
|
|
062929b8bd | ||
|
|
efce7de00d | ||
|
|
2b032a1dbc | ||
|
|
c8053d06b7 | ||
|
|
ce3755b333 | ||
|
|
313787effb | ||
|
|
578083367d | ||
|
|
e1d3838b2e | ||
|
|
1bf6f822ae | ||
|
|
081eba90e5 | ||
|
|
9487688edb | ||
|
|
2240e17413 | ||
|
|
bd0fb590ca | ||
|
|
420558d623 | ||
|
|
6061df4e65 | ||
|
|
830e523408 | ||
|
|
a21dd67d85 | ||
|
|
0319816539 | ||
|
|
9bccc64705 | ||
|
|
81fe1e3952 | ||
|
|
488a0f1da2 | ||
|
|
d0cde03a69 | ||
|
|
76f67edb36 | ||
|
|
cbeb03b2d5 | ||
|
|
ef34e5e39e | ||
|
|
7b15fe0786 | ||
|
|
fada4f514e | ||
|
|
64f046c388 | ||
|
|
d74d09554e | ||
|
|
d07673cbe1 | ||
|
|
1684b7f85e | ||
|
|
4fb6f3d459 | ||
|
|
439ea76475 | ||
|
|
529fd197d8 | ||
|
|
389a1a1a3d | ||
|
|
b3aec16833 | ||
|
|
28d04bfee4 | ||
|
|
6985b198ec | ||
|
|
1aa7af5167 | ||
|
|
d953b2e668 | ||
|
|
4fc84e61c6 | ||
|
|
92a5839bb1 | ||
|
|
b15dfcb906 | ||
|
|
cd5824073c | ||
|
|
36f7ac9ee3 | ||
|
|
5c3d7b0f64 | ||
|
|
51be6aee77 | ||
|
|
d59ee5953d | ||
|
|
3b43614ae9 | ||
|
|
930f386064 | ||
|
|
4a154e630f | ||
|
|
5412f16352 | ||
|
|
efc4d62bd0 | ||
|
|
8160cd40dc | ||
|
|
3f4861271b | ||
|
|
1ffe2629cf | ||
|
|
dc80ae0c9a | ||
|
|
87ce8a47fc | ||
|
|
c15e7ec28c | ||
|
|
aee7ee6322 | ||
|
|
6dd45acb45 | ||
|
|
3385a0a6a3 | ||
|
|
8f9fd97902 | ||
|
|
85c8c718bf | ||
|
|
4f4449958b | ||
|
|
cffdbe932f | ||
|
|
81fa44472d | ||
|
|
0388fb065c | ||
|
|
4328134c82 | ||
|
|
e1c38230af | ||
|
|
9f2a2dd4ed | ||
|
|
13837b07f7 | ||
|
|
c4ce711171 | ||
|
|
d686d28053 | ||
|
|
b260d92898 | ||
|
|
d14b8b9a79 | ||
|
|
33cd9c6233 | ||
|
|
c829808dd7 | ||
|
|
aed2b60bcf | ||
|
|
5b91bee129 | ||
|
|
1bf86532fe | ||
|
|
f5259eb6be | ||
|
|
bdc90c007b | ||
|
|
88ca967d3f | ||
|
|
9ea2ae4299 | ||
|
|
3b26eb85ae | ||
|
|
4aab4a969a | ||
|
|
0f2562a29c | ||
|
|
0450ce7621 | ||
|
|
44c4c7de76 | ||
|
|
aff0328b4f | ||
|
|
b50bd7586c | ||
|
|
d973c9e147 | ||
|
|
9e3cb6baa3 | ||
|
|
0fd43dad75 | ||
|
|
688baa2bb6 | ||
|
|
1b3af6fea6 | ||
|
|
d93f2e9d26 | ||
|
|
cacad0ba70 | ||
|
|
1b514de28e | ||
|
|
f47bbed3ef | ||
|
|
33d83fe4fe | ||
|
|
202a4077a4 | ||
|
|
7b2c992380 | ||
|
|
ce69e7179e | ||
|
|
fc6765144d | ||
|
|
ce22e3a0d4 | ||
|
|
be628af117 | ||
|
|
83d00839ed | ||
|
|
b72cf669b8 | ||
|
|
9d3dd5c322 | ||
|
|
5f39c386ef | ||
|
|
3e8278d698 | ||
|
|
37cf848f51 | ||
|
|
95f615a894 | ||
|
|
bae2d3116b | ||
|
|
542c794e72 | ||
|
|
d029b82d98 | ||
|
|
ad8064ef81 | ||
|
|
a4e12d135b | ||
|
|
053ae6d287 | ||
|
|
15bceee125 | ||
|
|
08e50885cb | ||
|
|
e6dbb28b48 | ||
|
|
1e151865d4 | ||
|
|
c2a2ef5682 | ||
|
|
3acc777afe | ||
|
|
aa7bd5bf2c | ||
|
|
ca2cd63a95 | ||
|
|
1787b95498 | ||
|
|
2586198e0e | ||
|
|
b7e76de184 | ||
|
|
f656232030 | ||
|
|
e4e3064bea | ||
|
|
f804539a15 | ||
|
|
ca9ae8bb8e | ||
|
|
767b39fbbc | ||
|
|
6d0996d90c | ||
|
|
294cf79e04 | ||
|
|
b7864cd2aa | ||
|
|
4bf5f15f72 | ||
|
|
4a0e3b4c40 | ||
|
|
3860951b6c | ||
|
|
54003a2622 | ||
|
|
b7bc60708c | ||
|
|
dc5651ab70 | ||
|
|
f12dc5478b | ||
|
|
8051bac868 | ||
|
|
d94823ef77 | ||
|
|
eda6f33d77 | ||
|
|
9db610ef2c | ||
|
|
2b8ef9e1fd | ||
|
|
1aa858a164 | ||
|
|
aae7c47748 | ||
|
|
53164a169c | ||
|
|
fe1b607214 | ||
|
|
040d157644 | ||
|
|
475155d62f | ||
|
|
85a0bda946 | ||
|
|
f2c8aa665f | ||
|
|
181098e1e4 | ||
|
|
66257146b7 | ||
|
|
60d1234abd | ||
|
|
2bac9ba5fa | ||
|
|
6e273ccd7f | ||
|
|
4885807d82 | ||
|
|
444f830fdc | ||
|
|
e98d84314a | ||
|
|
5e9fd26028 | ||
|
|
3a3e901249 | ||
|
|
1f8c1dccde | ||
|
|
0dc48f8470 | ||
|
|
83a8b2bee5 | ||
|
|
2c4fb4286c | ||
|
|
570f6dd581 | ||
|
|
b326e77574 | ||
|
|
6d6d3e99e5 | ||
|
|
c7045147f3 | ||
|
|
3495b190d4 | ||
|
|
62a7865f94 | ||
|
|
8193dbb316 | ||
|
|
95d1701794 | ||
|
|
945f655e0e | ||
|
|
11b65fe0bf | ||
|
|
6618165926 | ||
|
|
6950c69ebb | ||
|
|
b8ff93dad2 | ||
|
|
c220480075 | ||
|
|
182b297af4 | ||
|
|
a0527afd55 | ||
|
|
9283ff8227 | ||
|
|
769e98fe4c | ||
|
|
3c48d81a52 | ||
|
|
7f100c439a | ||
|
|
481ec12450 | ||
|
|
312648668c | ||
|
|
f4aa493f59 | ||
|
|
039ad64a33 | ||
|
|
c83a2ea2e8 | ||
|
|
edbedeb84a | ||
|
|
d855154fa9 | ||
|
|
7fea629121 | ||
|
|
183f0615e2 | ||
|
|
e9330b4f5f | ||
|
|
785398657c | ||
|
|
fff2d5280c | ||
|
|
cd503fd2e4 | ||
|
|
e7e046f949 | ||
|
|
6e6ff3c7c0 | ||
|
|
4f4fe00b97 | ||
|
|
98d6b6ce8b | ||
|
|
a47ac6c5ee | ||
|
|
da79469606 | ||
|
|
a93215f781 | ||
|
|
58f7fb247b | ||
|
|
aa1feb0799 | ||
|
|
833e7b1d7a | ||
|
|
b2a07f19c2 | ||
|
|
b38e153861 | ||
|
|
39188f7926 | ||
|
|
29fa74fd63 | ||
|
|
8e018c5338 | ||
|
|
0810ae08de | ||
|
|
366d409da4 | ||
|
|
2434365103 | ||
|
|
bd18c88198 | ||
|
|
6e0f9c1cd2 | ||
|
|
5311ea4f7a | ||
|
|
09dfcf559e | ||
|
|
0a9ae3eb46 | ||
|
|
7a59192bbb | ||
|
|
6a0e550aac | ||
|
|
da71e629b4 | ||
|
|
ca07a428e3 | ||
|
|
150a00a17a | ||
|
|
bdf844fc83 | ||
|
|
464d49d182 | ||
|
|
3386dc6f20 | ||
|
|
ff76a32508 | ||
|
|
6b95037dcc | ||
|
|
3cb0c72ced | ||
|
|
2cf8d0cc98 | ||
|
|
8cdabf6a23 | ||
|
|
e0605f125c | ||
|
|
911f3d647f | ||
|
|
2ca1f40d98 | ||
|
|
b5610a5005 | ||
|
|
341fdd3589 | ||
|
|
7f673c8ab6 | ||
|
|
ce6179a58f | ||
|
|
83fc90c74b | ||
|
|
8c73f39e6e | ||
|
|
8efaf28a8a | ||
|
|
8a3cc22605 | ||
|
|
fc9acb3a4d | ||
|
|
2e012969e7 | ||
|
|
84b7a06a44 | ||
|
|
8fd09be8a0 | ||
|
|
83a7e862ae | ||
|
|
85428f5eb4 | ||
|
|
e73dbd1647 | ||
|
|
b11497d075 | ||
|
|
14ed049331 | ||
|
|
00d4271550 | ||
|
|
ff22d7b9a6 | ||
|
|
ce3bb0a6a9 | ||
|
|
4c55ad45a0 | ||
|
|
3205f42dc2 | ||
|
|
610f8a2ff3 | ||
|
|
0fde8c3925 | ||
|
|
8ba1ddbbc2 | ||
|
|
3af13b603d | ||
|
|
54508b6429 | ||
|
|
b62196dc0d | ||
|
|
8eeff0e06c | ||
|
|
da9d363230 | ||
|
|
cb617b5e9f | ||
|
|
130a148816 | ||
|
|
33cae6930c | ||
|
|
6abba98455 | ||
|
|
0437f81999 | ||
|
|
4f649f1cdb | ||
|
|
e33f2e1d38 | ||
|
|
df1c50bc47 | ||
|
|
79597e9757 | ||
|
|
6447208960 | ||
|
|
c061ee6324 | ||
|
|
57c9e1ae6a | ||
|
|
60aec6f6cb | ||
|
|
418b9e06d7 | ||
|
|
d2f5575e20 | ||
|
|
8c12affa23 | ||
|
|
ca552b45f5 | ||
|
|
00bfe37cb4 | ||
|
|
2964132f7d | ||
|
|
eb739e2a9b | ||
|
|
8c2c451e8e | ||
|
|
29faabdfb3 | ||
|
|
2b251e3cb3 | ||
|
|
ed2170b2ea | ||
|
|
493d9a4280 | ||
|
|
a7e6be3368 | ||
|
|
dd3a6c2e50 | ||
|
|
97a134e51f | ||
|
|
e613f4db7d | ||
|
|
47af1ff851 | ||
|
|
4e6f525f7c | ||
|
|
b25feb69aa | ||
|
|
90bb4e3a7b | ||
|
|
39e1ed3403 | ||
|
|
45664465be | ||
|
|
1601f83a05 | ||
|
|
ae8a310e97 | ||
|
|
0d35f901b3 | ||
|
|
726036b91e | ||
|
|
c5493bb480 | ||
|
|
fda36a1476 | ||
|
|
e176132106 | ||
|
|
2c36ce39af | ||
|
|
fc6f7cbbb6 | ||
|
|
7c2eb53e62 | ||
|
|
bcf19f1256 | ||
|
|
4d6d679c7b | ||
|
|
feb6d188f7 | ||
|
|
179229fa81 | ||
|
|
ab9d2e20fb | ||
|
|
35813b5e0f | ||
|
|
eff6d402f3 | ||
|
|
3e8b62999b | ||
|
|
c56925a830 | ||
|
|
28c1286c4d | ||
|
|
2d662075c3 | ||
|
|
3247fb08d0 | ||
|
|
916fce023d | ||
|
|
b9f9afe26a | ||
|
|
335f1be322 | ||
|
|
1cc452c13e | ||
|
|
4acad3b126 | ||
|
|
923d9851b9 | ||
|
|
1192c1dafc | ||
|
|
85f50d9c94 | ||
|
|
1af0f814c9 | ||
|
|
42dc0fcc74 | ||
|
|
93639e967c | ||
|
|
3f0476a880 | ||
|
|
a92ebdc08a | ||
|
|
ee40ac7089 | ||
|
|
b883078ce8 | ||
|
|
748fe8e5dd | ||
|
|
c9003f0c9d | ||
|
|
391be952f5 | ||
|
|
49d6474237 | ||
|
|
8643fa7327 | ||
|
|
a71e527e04 | ||
|
|
8515b68c0c | ||
|
|
6393189c19 | ||
|
|
418d17b4da | ||
|
|
f6d0e7d97a | ||
|
|
3cb6cc305b | ||
|
|
5f63e86dde | ||
|
|
e8f58f5947 | ||
|
|
27e81df523 | ||
|
|
5bd09cfac5 | ||
|
|
58f38c2e1e | ||
|
|
99a06b4839 | ||
|
|
f162db5e48 | ||
|
|
1e6455c393 | ||
|
|
66c5dff14a | ||
|
|
2190fccc66 | ||
|
|
6204241b7d | ||
|
|
26e31a4cf0 | ||
|
|
421d8be977 | ||
|
|
7a505887ff | ||
|
|
3c229a9c81 | ||
|
|
4b20b46509 | ||
|
|
7e8557d564 | ||
|
|
8c3e9dcdd7 | ||
|
|
91ea6b83cf | ||
|
|
d7f54dd703 | ||
|
|
7fe5ba8db8 | ||
|
|
faa0c5e9ee | ||
|
|
61e4f739ce | ||
|
|
852a4eb3fa | ||
|
|
7975300304 | ||
|
|
58e8c23665 | ||
|
|
2fa7e8f096 | ||
|
|
037c5a06aa | ||
|
|
859405b62e | ||
|
|
2943d3f1a4 | ||
|
|
f2fb83801c | ||
|
|
74ae0a9395 | ||
|
|
aa0d424699 | ||
|
|
4fe9668fa3 | ||
|
|
0c9996c32b | ||
|
|
ad910280e7 | ||
|
|
a7c1e29bf6 | ||
|
|
2ba39e6b6d | ||
|
|
44de943a99 | ||
|
|
661b650911 | ||
|
|
badbe4a239 | ||
|
|
db781c1a7f | ||
|
|
8fb0436b42 | ||
|
|
7e696a55d2 | ||
|
|
3030e20121 | ||
|
|
9f65ab39d0 | ||
|
|
3e4cfa361d | ||
|
|
a127a8cad6 | ||
|
|
8fd0bf3f7f | ||
|
|
56f9f608be | ||
|
|
258662ff4c | ||
|
|
a0ed1ac897 | ||
|
|
136091fc68 | ||
|
|
c5cf337365 | ||
|
|
e396686570 | ||
|
|
72a082c9eb | ||
|
|
67a87a33f3 | ||
|
|
b2cff0788a | ||
|
|
fa61278c10 | ||
|
|
585a5fe64d | ||
|
|
81f7d272fd | ||
|
|
ee6cd1d204 | ||
|
|
a4c1f89720 | ||
|
|
9429770f3d | ||
|
|
2c5999b1d0 | ||
|
|
2f152ce085 | ||
|
|
3163319217 | ||
|
|
8e4f6afddd | ||
|
|
ef9ae017b5 | ||
|
|
2c626b4eec | ||
|
|
cac6737541 | ||
|
|
ab900aad1c | ||
|
|
a69566f8bd | ||
|
|
67c75304e7 | ||
|
|
6a88616f9b | ||
|
|
57f709fcec | ||
|
|
6c24aaae77 | ||
|
|
764c1ab03f | ||
|
|
cde82a9093 | ||
|
|
16229a9950 | ||
|
|
7bf700f173 | ||
|
|
742925e0d9 | ||
|
|
761de4a671 | ||
|
|
8502c66e7c | ||
|
|
dcebc4aa50 | ||
|
|
54a2a3ea5b | ||
|
|
56273906b7 | ||
|
|
9df5407dfb | ||
|
|
51b8e83d89 | ||
|
|
a44daaba35 | ||
|
|
2d832dd11e | ||
|
|
1784e880ae | ||
|
|
189f23a341 | ||
|
|
cc9109843a | ||
|
|
1deb837973 | ||
|
|
3859d16640 | ||
|
|
e68261bbf3 | ||
|
|
e2a350940a | ||
|
|
6512edec77 | ||
|
|
2910a7a6eb | ||
|
|
8efbd74cf0 | ||
|
|
05b79a41fb | ||
|
|
e24f459eaf | ||
|
|
9a5fa95c54 | ||
|
|
abfba82d48 | ||
|
|
0609d3919f | ||
|
|
f8954cc941 | ||
|
|
794a7f5bd1 | ||
|
|
762e7c3e24 | ||
|
|
165fc95411 | ||
|
|
268c2558d5 | ||
|
|
34170b1cd2 | ||
|
|
9147fc483f | ||
|
|
450bc83068 | ||
|
|
65d3d59c0f | ||
|
|
e50555c4ae | ||
|
|
e677ed7657 | ||
|
|
82c2805b36 | ||
|
|
bf13e5053e | ||
|
|
f6093feceb | ||
|
|
2ae6216c93 | ||
|
|
a237d7faad | ||
|
|
77283e9c7a | ||
|
|
f7a22d7ed0 | ||
|
|
ab1b12fdd6 | ||
|
|
d5938614c1 | ||
|
|
83bb7e144f | ||
|
|
65b1569df2 | ||
|
|
b849eec785 | ||
|
|
b883ebc038 | ||
|
|
3cfbcbe363 | ||
|
|
5255f129dc | ||
|
|
9555602823 | ||
|
|
9db390b553 | ||
|
|
48095d34e6 | ||
|
|
51a8932f7f | ||
|
|
274a32e1ac | ||
|
|
2c1d1b12cc | ||
|
|
133f059b8d | ||
|
|
fbbfef9ae2 | ||
|
|
556550fbde | ||
|
|
5dfbc6d292 | ||
|
|
4fbf65ae8b | ||
|
|
c9ec754eb6 | ||
|
|
1fe476a9e2 | ||
|
|
ffed62372f | ||
|
|
367c060749 | ||
|
|
24d16213a6 | ||
|
|
be57943a52 | ||
|
|
7a8c7cc6c2 | ||
|
|
c85904b3c5 | ||
|
|
08a1434b71 | ||
|
|
d69b7d7e0d | ||
|
|
93a5d82ca8 | ||
|
|
90c8025588 | ||
|
|
520b89408e | ||
|
|
094c5fe302 | ||
|
|
27cdf337fb | ||
|
|
f2d3763bdd | ||
|
|
96cbfb1fdf | ||
|
|
290d25d6ae | ||
|
|
9ef7aa2432 | ||
|
|
a39a7530f8 | ||
|
|
77ee6f100b | ||
|
|
88a85e4024 | ||
|
|
ce853a5f07 | ||
|
|
87b79774d1 | ||
|
|
48206c3ef8 | ||
|
|
0349240a33 | ||
|
|
135620dcf9 | ||
|
|
60a5a6bd7c | ||
|
|
5a68f6d830 | ||
|
|
aa6936a2a5 | ||
|
|
935af40c87 | ||
|
|
42d830e62f | ||
|
|
7cf5a3e085 | ||
|
|
0ce31bf471 | ||
|
|
4d90765185 | ||
|
|
7b82acb327 | ||
|
|
666e1ddeeb | ||
|
|
dd9f9ed921 | ||
|
|
47c2aa0bbc | ||
|
|
e59bb76f72 | ||
|
|
202bd3a5dc | ||
|
|
5f43e78be2 | ||
|
|
e3ca0ec5b1 | ||
|
|
464a25b457 | ||
|
|
819f53721d | ||
|
|
4e68213569 | ||
|
|
6b080df736 | ||
|
|
0bb972b141 | ||
|
|
93d88650e1 | ||
|
|
cd399f90a1 | ||
|
|
b8ba7f1466 | ||
|
|
550998e827 | ||
|
|
6da0d162b8 | ||
|
|
c620372357 | ||
|
|
0a6ab7d1f7 | ||
|
|
e8bed8f892 | ||
|
|
15f6549087 | ||
|
|
3a7307d0ce | ||
|
|
bc0c7cf4c5 | ||
|
|
5daf294f25 | ||
|
|
0bcb3f24e6 | ||
|
|
9e66027e8b |
No files matched your search
+9
-4
@@ -24,7 +24,6 @@ install-sh
|
||||
missing
|
||||
.svn
|
||||
*.layout
|
||||
projects/Xcode4/Frameworks/
|
||||
projects/Xcode/Frameworks/
|
||||
|
||||
#========
|
||||
@@ -137,7 +136,7 @@ packages/
|
||||
*.swp
|
||||
|
||||
# *.lock - this is used and abused by many editors for many different things.
|
||||
# For the main ones I use (e.g. Eclipse), it should be excluded
|
||||
# For the main ones I use (e.g. Eclipse), it should be excluded
|
||||
# from source-control, but YMMV
|
||||
|
||||
*.lock
|
||||
@@ -149,7 +148,7 @@ packages/
|
||||
|
||||
####
|
||||
# Xcode temporary files that should never be committed
|
||||
#
|
||||
#
|
||||
# NB: NIB/XIB files still exist even on Storyboard projects, so we want this...
|
||||
|
||||
*~.nib
|
||||
@@ -263,6 +262,12 @@ xcuserdata
|
||||
# .xccheckout
|
||||
#
|
||||
# Per http://stackoverflow.com/questions/18340453/should-xccheckout-files-in-xcode5-be-ignored-under-vcs
|
||||
#
|
||||
#
|
||||
|
||||
*.xccheckout
|
||||
|
||||
####
|
||||
# Documentation
|
||||
#
|
||||
documentation/doxygen/*
|
||||
!documentation/doxygen/.gitkeep
|
||||
+91
@@ -0,0 +1,91 @@
|
||||
language: cpp
|
||||
sudo: false
|
||||
addons:
|
||||
apt:
|
||||
packages:
|
||||
- libopenal-dev
|
||||
- libogg-dev
|
||||
- libvorbis-dev
|
||||
- build-essential
|
||||
- automake
|
||||
- autoconf
|
||||
- libsdl1.2-dev
|
||||
- libtheora-dev
|
||||
- libreadline6-dev
|
||||
- libpng12-dev
|
||||
- libjpeg62-dev
|
||||
- liblua5.1-0-dev
|
||||
- libjansson-dev
|
||||
- libtool
|
||||
|
||||
coverity_scan:
|
||||
project:
|
||||
name: scp-fs2open/fs2open.github.com
|
||||
description: Coverity via Travis CI
|
||||
notification_email: [email protected]
|
||||
build_command_prepend: "./autogen.sh --enable-debug"
|
||||
build_command: make -j2
|
||||
branch_pattern: coverity_scan
|
||||
|
||||
deploy:
|
||||
- provider: releases
|
||||
api_key:
|
||||
secure: "bBWEBF+r4p7kea+Lj/vHD0CCW4AsxqlLri8gT3HbsdPuKwdSNU4QLLFk9yAXmmBF2T/fe45Zk+WQrdQJjSydkpG06M7sFD22RKOYv3cLF0Bq0nEG4CpuXoGqo77oFGkA5hdU6D8W2nQTMhPuiqlvhgt3zeD/6fiyfdAztbtKNRs="
|
||||
skip_cleanup: true
|
||||
file_glob: true
|
||||
file: "/tmp/builds/*"
|
||||
on:
|
||||
condition: '"$RELEASE_BUILD" == true'
|
||||
tags: true
|
||||
|
||||
- provider: bintray
|
||||
user: asarium
|
||||
key:
|
||||
secure: "JyJIsJFxCvNjmdyG9eDIvkzXFqsJQVzXKp5BeJcn5WSdMA2Vs7dCvarJXomdwe3F3RCrdmrFYCaimiCDD6LqImrcDLzxlevzGlNUv381iFna612SJj672d8iQCgtMibIJ3HzYmgZlsaJ9YcaOuccRyQIV/TNUcwgzbsW27CPEcM="
|
||||
file: ci/bintray.json
|
||||
on:
|
||||
condition: '"$NIGHTLY_BUILD" == true'
|
||||
tags: true
|
||||
|
||||
env:
|
||||
global:
|
||||
- secure: C3wF967ZeliwwP1vC12EMIBOaC568n26Z/cPnwzn317ve59DWH3YSfPZVgvt08GzmaXITGGsJvPB+qxfGoKvQzYE4O1B73q81RpUe5pB3IhF+ThQ91VfQZIRJR5xEGJaLINUlHTTZGX5jxlkVO9wAcauVj/s3b8sQ3dvUZauPvk=
|
||||
matrix:
|
||||
include:
|
||||
- os: linux
|
||||
compiler: gcc
|
||||
env: CONFIGURATION="Debug"
|
||||
- os: linux
|
||||
compiler: clang
|
||||
env: CONFIGURATION="Debug"
|
||||
- os: osx
|
||||
compiler: clang
|
||||
env: CONFIGURATION="Debug" MACOSX_ARCH=i386
|
||||
- os: osx
|
||||
compiler: clang
|
||||
env: CONFIGURATION="Debug" MACOSX_ARCH=x86_64
|
||||
- os: linux
|
||||
compiler: gcc
|
||||
env: CONFIGURATION="Release"
|
||||
- os: linux
|
||||
compiler: clang
|
||||
env: CONFIGURATION="Release"
|
||||
- os: osx
|
||||
compiler: clang
|
||||
env: CONFIGURATION="Release" MACOSX_ARCH=i386
|
||||
- os: osx
|
||||
compiler: clang
|
||||
env: CONFIGURATION="Release" MACOSX_ARCH=x86_64
|
||||
|
||||
before_install:
|
||||
- if ([[ "${TRAVIS_JOB_NUMBER##*.}" != "1" ]] && [[ "${TRAVIS_BRANCH}" == "coverity_scan" ]]); then false ; fi
|
||||
- source "./ci/travis/check_release.sh"
|
||||
- "./ci/travis/before_install.sh"
|
||||
install:
|
||||
- "./ci/travis/install.sh"
|
||||
before_script:
|
||||
- "./ci/travis/before_script.sh"
|
||||
script:
|
||||
- if [ "$BUILD_DEPLOYMENT" = true ] ; then ./ci/travis/release.sh ; else ./ci/travis/script.sh ; fi
|
||||
before_deploy:
|
||||
- "./ci/travis/before_deploy.sh"
|
||||
+7
-10
@@ -9,16 +9,6 @@ SUBDIRS = mongoose code
|
||||
|
||||
EXTRA_DIST = \
|
||||
FS2OpenSCPReadMe.doc \
|
||||
projects/MSVC_2005/Freespace2.sln \
|
||||
projects/MSVC_2005/Freespace2.vcproj \
|
||||
projects/MSVC_2005/code.vcproj \
|
||||
projects/MSVC_6/Fred2.dsp \
|
||||
projects/MSVC_6/Freespace2.dsp \
|
||||
projects/MSVC_6/Freespace2.dsw \
|
||||
projects/MSVC_6/code.dsp \
|
||||
projects/MSVC_6/libjpeg.dsp \
|
||||
projects/MSVC_6/liblua.dsp \
|
||||
projects/MSVC_6/wxFRED2.dsp \
|
||||
projects/Xcode/English.lproj/InfoPlist.strings \
|
||||
projects/Xcode/FS2_Open.icns \
|
||||
projects/Xcode/FS2_Open.xcodeproj/project.pbxproj \
|
||||
@@ -41,6 +31,8 @@ EXTRA_PROGRAMS = cfilearchiver cfileextractor
|
||||
## Begin utilitites
|
||||
##
|
||||
|
||||
CPPSOURCES=$(wildcard code/*/*.cpp code/*/*.h)
|
||||
|
||||
# cfilearchiver -- to create VPs
|
||||
cfilearchiver_SOURCES = \
|
||||
code/cfilearchiver/cfilearchiver.cpp
|
||||
@@ -56,6 +48,11 @@ tools: cfilearchiver cfileextractor
|
||||
clean-tools:
|
||||
-test -z "$(EXTRA_PROGRAMS)" || rm -f $(EXTRA_PROGRAMS)
|
||||
|
||||
## cppcheck : check for many code issues
|
||||
cppcheck: ${CPPSOURCES}
|
||||
cppcheck ${CPPSOURCES} --enable=all --platform=unix64 \
|
||||
--std=c99 --inline-suppr --quiet
|
||||
|
||||
##
|
||||
## End utilitites
|
||||
##
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
[](https://scan.coverity.com/projects/870)
|
||||
[](https://travis-ci.org/scp-fs2open/fs2open.github.com)
|
||||
|
||||
Welcome to Freespace Open!
|
||||
|
||||
|
||||
@@ -0,0 +1,39 @@
|
||||
version: 3.7.3.{build}
|
||||
shallow_clone: true
|
||||
environment:
|
||||
matrix:
|
||||
- VisualStudioVersion: 10.0
|
||||
PlatformToolset: v100
|
||||
ProjectPath: projects/MSVC_2010
|
||||
DeployConfig: False
|
||||
- VisualStudioVersion: 12.0
|
||||
PlatformToolset: v120
|
||||
ProjectPath: projects/MSVC_2013
|
||||
DeployConfig: False
|
||||
- VisualStudioVersion: 14.0
|
||||
PlatformToolset: v140
|
||||
ProjectPath: projects/MSVC_2015
|
||||
DeployConfig: True
|
||||
build_script:
|
||||
- ps: . ./ci/appveyor/check_release.ps1
|
||||
- ps: . ./ci/appveyor/build.ps1
|
||||
test: off
|
||||
deploy:
|
||||
- provider: GitHub
|
||||
auth_token:
|
||||
secure: RWe6hwCcgBdklaYvjB62kzhKn7yDBJdqoDDKYViShaEV9HkJ75HbawsBcGBimRUu
|
||||
on:
|
||||
ReleaseBuild: true # deploy on release push only
|
||||
|
||||
- provider: BinTray
|
||||
username: asarium
|
||||
api_key:
|
||||
secure: 2lHma1ZreuB4CCE5hSdp+gqFjCMzUDj3tVJhP+D6EyF5wIVMLlwXFrISwnYu1kJi
|
||||
subject: asarium
|
||||
repo: FSO
|
||||
package: nightly
|
||||
version: $(VersionName)
|
||||
publish: true
|
||||
override: true
|
||||
on:
|
||||
NightlyBuild: true # deploy on nightly push only
|
||||
@@ -0,0 +1,25 @@
|
||||
|
||||
if ([System.Convert]::ToBoolean($env:DeployBuild)) {
|
||||
# Release build
|
||||
if (! ([System.Convert]::ToBoolean($env:DeployConfig))) {
|
||||
exit 0 # End the build
|
||||
}
|
||||
|
||||
msbuild "$env:ProjectPath/Freespace2.sln" /p:Configuration="Debug SSE2" /m /p:PlatformToolset="$($env:PlatformToolset)_xp" /verbosity:minimal
|
||||
if (! ($?)) {
|
||||
Add-AppveyorMessage "A release build failed!"
|
||||
exit 1
|
||||
}
|
||||
|
||||
msbuild "$env:ProjectPath/Freespace2.sln" /p:Configuration="Release SSE2" /m /p:PlatformToolset="$($env:PlatformToolset)_xp" /verbosity:minimal
|
||||
if (! ($?)) {
|
||||
Add-AppveyorMessage "A release build failed!"
|
||||
exit 1
|
||||
}
|
||||
|
||||
7z a "$($env:PackageName)-builds-Win32.zip" "$env:APPVEYOR_BUILD_FOLDER/$env:ProjectPath/Debug SSE2/*.exe" "$env:APPVEYOR_BUILD_FOLDER/$env:ProjectPath/Release SSE2/*.exe"
|
||||
Push-AppveyorArtifact "$($env:PackageName)-builds-Win32.zip"
|
||||
} else {
|
||||
# Standard CI build
|
||||
msbuild "$env:ProjectPath/Freespace2.vcxproj" /p:Configuration="Debug SSE2" /m /p:PlatformToolset="$env:PlatformToolset" /verbosity:minimal
|
||||
}
|
||||
@@ -0,0 +1,28 @@
|
||||
|
||||
write "$env:APPVEYOR_REPO_TAG"
|
||||
write "$env:APPVEYOR_REPO_TAG_NAME"
|
||||
|
||||
# Default values
|
||||
Set-AppveyorBuildVariable 'ReleaseBuild' 'false'
|
||||
Set-AppveyorBuildVariable 'NightlyBuild' 'false'
|
||||
Set-AppveyorBuildVariable 'DeployBuild' 'false'
|
||||
Set-AppveyorBuildVariable 'PackagePrefix' ''
|
||||
Set-AppveyorBuildVariable 'VersionName' ''
|
||||
|
||||
|
||||
if ([System.Convert]::ToBoolean($env:APPVEYOR_REPO_TAG) -And ("$env:APPVEYOR_REPO_TAG_NAME" -match "^release_(.*)")) {
|
||||
# Tag matches
|
||||
Set-AppveyorBuildVariable 'ReleaseBuild' 'true'
|
||||
Set-AppveyorBuildVariable 'PackageName' "release_$($matches[1])"
|
||||
}
|
||||
|
||||
if ([System.Convert]::ToBoolean($env:APPVEYOR_REPO_TAG) -And ("$env:APPVEYOR_REPO_TAG_NAME" -match "^nightly_(.*)")) {
|
||||
# Tag matches
|
||||
Set-AppveyorBuildVariable 'NightlyBuild' 'true'
|
||||
Set-AppveyorBuildVariable 'PackageName' "nightly_$($matches[1])"
|
||||
Set-AppveyorBuildVariable 'VersionName' "$($matches[1])"
|
||||
}
|
||||
|
||||
if ([System.Convert]::ToBoolean($env:ReleaseBuild) -Or [System.Convert]::ToBoolean($env:NightlyBuild)) {
|
||||
Set-AppveyorBuildVariable 'DeployBuild' 'true'
|
||||
}
|
||||
@@ -0,0 +1,19 @@
|
||||
{
|
||||
"package": {
|
||||
"name": "nightly",
|
||||
"repo": "FSO",
|
||||
"subject": "asarium"
|
||||
},
|
||||
|
||||
"version": {
|
||||
"name": "$VERSION_NAME"
|
||||
},
|
||||
|
||||
"files": [
|
||||
{
|
||||
"includePattern": "/tmp/builds/(.*)",
|
||||
"uploadPattern": "$1"
|
||||
}
|
||||
],
|
||||
"publish": true
|
||||
}
|
||||
Executable
+8
@@ -0,0 +1,8 @@
|
||||
#!/usr/bin/env sh
|
||||
|
||||
set -ex
|
||||
|
||||
if [ "$NIGHTLY_BUILD" = true ]; then
|
||||
echo "Fixing bintray config..."
|
||||
sed -e "s/\$VERSION_NAME/$VERSION_NAME/" ci/bintray.template.json > ci/bintray.json
|
||||
fi
|
||||
Executable
+11
@@ -0,0 +1,11 @@
|
||||
#!/usr/bin/env sh
|
||||
|
||||
set -ex
|
||||
|
||||
if [ "$TRAVIS_OS_NAME" = "linux" ]; then
|
||||
# Nothing to do here
|
||||
:
|
||||
elif [ "$TRAVIS_OS_NAME" = "osx" ]; then
|
||||
# Nothing to do here
|
||||
:
|
||||
fi
|
||||
Executable
+18
@@ -0,0 +1,18 @@
|
||||
#!/usr/bin/env sh
|
||||
|
||||
set -ex
|
||||
|
||||
if ([ "$TRAVIS_OS_NAME" = "linux" ] && [ "$BUILD_DEPLOYMENT" = false ]); then
|
||||
# Due to a bug in gcc the array bounds check isn't working correctly
|
||||
# This can be removed when gcc is updated
|
||||
AUTOGEN_CONFIG="CXXFLAGS=-Wno-array-bounds --enable-fatal-warnings --enable-generic-architecture"
|
||||
|
||||
if [ "$CONFIGURATION" = "Debug" ]; then
|
||||
AUTOGEN_CONFIG="$AUTOGEN_CONFIG --enable-debug"
|
||||
fi
|
||||
|
||||
./autogen.sh $AUTOGEN_CONFIG
|
||||
elif [ "$TRAVIS_OS_NAME" = "osx" ]; then
|
||||
cd projects/Xcode
|
||||
tar -xvzf Frameworks.tgz
|
||||
fi
|
||||
Executable
+49
@@ -0,0 +1,49 @@
|
||||
#!/usr/bin/env sh
|
||||
|
||||
RELEASE_BUILD=false
|
||||
NIGHTLY_BUILD=false
|
||||
BUILD_DEPLOYMENT=false
|
||||
VERSION_NAME=""
|
||||
PACKAGE_NAME=""
|
||||
|
||||
RELEASE_PATTERN="^release_(.*)$"
|
||||
NIGHTLY_PATTERN="^nightly_(.*)$"
|
||||
|
||||
if [[ "$TRAVIS_TAG" =~ $RELEASE_PATTERN ]]; then
|
||||
echo "This is a release tag!";
|
||||
RELEASE_BUILD=true;
|
||||
PACKAGE_NAME="release_${BASH_REMATCH[1]}";
|
||||
fi
|
||||
if [[ "$TRAVIS_TAG" =~ $NIGHTLY_PATTERN ]]; then
|
||||
echo "This is a nightly tag!";
|
||||
NIGHTLY_BUILD=true;
|
||||
VERSION_NAME="${BASH_REMATCH[1]}"
|
||||
PACKAGE_NAME="nightly_${BASH_REMATCH[1]}";
|
||||
fi
|
||||
|
||||
if ([ "$RELEASE_BUILD" = true ] || [ "$NIGHTLY_BUILD" = true ]); then
|
||||
BUILD_DEPLOYMENT=true;
|
||||
fi
|
||||
|
||||
if [[ "$BUILD_DEPLOYMENT" == true ]]; then
|
||||
if ([[ "$TRAVIS_OS_NAME" == "linux" ]] && [[ "$CC" == "clang" ]]); then
|
||||
echo "Skipping non-release compiler";
|
||||
exit 0;
|
||||
fi
|
||||
|
||||
if ([[ "$TRAVIS_OS_NAME" == "osx" ]] && [[ "$MACOSX_ARCH" == "i386" ]]); then
|
||||
echo "Skipping non-release architecture";
|
||||
exit 0;
|
||||
fi
|
||||
|
||||
if ([[ "$CONFIGURATION" == "Debug" ]]); then
|
||||
echo "Skipping non-release configuration";
|
||||
exit 0;
|
||||
fi
|
||||
fi
|
||||
|
||||
export RELEASE_BUILD
|
||||
export NIGHTLY_BUILD
|
||||
export BUILD_DEPLOYMENT
|
||||
export VERSION_NAME
|
||||
export PACKAGE_NAME
|
||||
Executable
+10
@@ -0,0 +1,10 @@
|
||||
#!/usr/bin/env sh
|
||||
|
||||
set -ex
|
||||
|
||||
if [ "$TRAVIS_OS_NAME" = "linux" ]; then
|
||||
# Nothing to do here
|
||||
:
|
||||
elif [ "$TRAVIS_OS_NAME" = "osx" ]; then
|
||||
gem install xcpretty thefox-pastebin
|
||||
fi
|
||||
Executable
+57
@@ -0,0 +1,57 @@
|
||||
#!/usr/bin/env sh
|
||||
|
||||
set -ex
|
||||
|
||||
mkdir -p /tmp/builds
|
||||
|
||||
if [ "$TRAVIS_OS_NAME" = "linux" ]; then
|
||||
# Due to a bug in gcc the array bounds check isn't working correctly
|
||||
# This can be removed when gcc is updated
|
||||
AUTOGEN_CONFIG="--enable-generic-architecture --prefix=/tmp/release"
|
||||
|
||||
# First compile the release build
|
||||
./autogen.sh $AUTOGEN_CONFIG
|
||||
|
||||
make -j4
|
||||
make install
|
||||
|
||||
make distclean
|
||||
|
||||
# Now compile debug
|
||||
./autogen.sh $AUTOGEN_CONFIG --enable-debug
|
||||
|
||||
make -j4
|
||||
make install
|
||||
|
||||
ls -al /tmp/release/bin
|
||||
|
||||
(cd /tmp/release/bin && tar -cvzf /tmp/builds/$PACKAGE_NAME-builds-Linux.tar.gz *)
|
||||
elif [ "$TRAVIS_OS_NAME" = "osx" ]; then
|
||||
cd projects/Xcode
|
||||
|
||||
mkdir /tmp/release
|
||||
|
||||
xcodebuild -project FS2_Open.xcodeproj -configuration "Release" clean build | tee release.log | xcpretty
|
||||
XCODE_RET=${PIPESTATUS[0]}
|
||||
if [ "$XCODE_RET" -ne "0" ]; then
|
||||
pastebin -e 1D -f release.log
|
||||
exit $XCODE_RET
|
||||
fi
|
||||
|
||||
ls build/Release
|
||||
(cd build/Release && cp -r *.app /tmp/release)
|
||||
|
||||
xcodebuild -project FS2_Open.xcodeproj -configuration "Debug" clean build | tee debug.log | xcpretty
|
||||
XCODE_RET=${PIPESTATUS[0]}
|
||||
if [ "$XCODE_RET" -ne "0" ]; then
|
||||
pastebin -e 1D -f debug.log
|
||||
exit $XCODE_RET
|
||||
fi
|
||||
|
||||
ls build/Debug
|
||||
(cd build/Debug && cp -r *.app /tmp/release)
|
||||
|
||||
ls -al /tmp/release
|
||||
|
||||
(cd /tmp/release && tar -cvzf /tmp/builds/$PACKAGE_NAME-builds-MacOSX.tar.gz *)
|
||||
fi
|
||||
Executable
+10
@@ -0,0 +1,10 @@
|
||||
#!/usr/bin/env sh
|
||||
|
||||
set -ex
|
||||
|
||||
if [ "$TRAVIS_OS_NAME" = "linux" ]; then
|
||||
make -j 4
|
||||
elif [ "$TRAVIS_OS_NAME" = "osx" ]; then
|
||||
cd projects/Xcode
|
||||
xcodebuild ARCHS=$MACOSX_ARCH ONLY_ACTIVE_ARCH=NO -configuration "$CONFIGURATION" | xcpretty -c && exit ${PIPESTATUS[0]}
|
||||
fi
|
||||
+4
-9
@@ -185,7 +185,7 @@ EXTRA_DIST = \
|
||||
|
||||
# D_ variants are defaults and should always be used
|
||||
# FS2_ variants are for game building and wxFRED
|
||||
AM_CXXFLAGS = @D_CFLAGS@ @FS2_CXXFLAGS@ -I../mongoose
|
||||
AM_CXXFLAGS = @D_CFLAGS@ @FS2_CXXFLAGS@ -I./$(VPATH)/../mongoose
|
||||
AM_LDFLAGS = @D_LDFLAGS@ @FS2_LDFLAGS@
|
||||
|
||||
if BUILD_WXFRED
|
||||
@@ -199,7 +199,7 @@ bin_PROGRAMS = @FS2_BINARY@
|
||||
EXTRA_PROGRAMS = fs2_open_@PACKAGE_VERSION@ \
|
||||
fs2_open_@PACKAGE_VERSION@_DEBUG \
|
||||
wxFRED2_@PACKAGE_VERSION@ \
|
||||
wxFRED2_@PACKAGE_VERSION@_DEBUG
|
||||
wxFRED2_@PACKAGE_VERSION@_DEBUG
|
||||
|
||||
###############################################################################
|
||||
##
|
||||
@@ -215,7 +215,6 @@ FS2_SOURCES = \
|
||||
ai/aigoals.cpp \
|
||||
ai/aigoals.h \
|
||||
ai/aiinternal.h \
|
||||
ai/ailocal.h \
|
||||
ai/aiturret.cpp \
|
||||
ai/ai_profiles.cpp \
|
||||
ai/ai_profiles.h \
|
||||
@@ -267,8 +266,6 @@ FS2_SOURCES = \
|
||||
debugconsole/consolecmds.cpp \
|
||||
debugconsole/consoleparse.cpp \
|
||||
debugconsole/consoleparse.h \
|
||||
debugconsole/timerbar.cpp \
|
||||
debugconsole/timerbar.h \
|
||||
exceptionhandler/exceptionhandler.cpp \
|
||||
exceptionhandler/exceptionhandler.h \
|
||||
external_dll/externalcode.h \
|
||||
@@ -343,6 +340,7 @@ FS2_SOURCES = \
|
||||
graphics/grstub.cpp \
|
||||
graphics/grstub.h \
|
||||
graphics/line.h \
|
||||
graphics/shadows.cpp \
|
||||
graphics/tmapper.h \
|
||||
hud/hud.cpp \
|
||||
hud/hud.h \
|
||||
@@ -479,14 +477,10 @@ FS2_SOURCES = \
|
||||
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 \
|
||||
@@ -501,6 +495,7 @@ FS2_SOURCES = \
|
||||
model/modelsinc.h \
|
||||
model/modeloctant.cpp \
|
||||
model/modelread.cpp \
|
||||
model/modelrender.cpp \
|
||||
nebula/neb.cpp \
|
||||
nebula/neb.h \
|
||||
nebula/neblightning.cpp \
|
||||
|
||||
+6
-7
@@ -12,12 +12,12 @@
|
||||
#ifndef _AI_H
|
||||
#define _AI_H
|
||||
|
||||
#include "globalincs/pstypes.h"
|
||||
#include "globalincs/globals.h"
|
||||
#include "globalincs/systemvars.h"
|
||||
#include "ai/ai_profiles.h"
|
||||
#include "physics/physics.h"
|
||||
#include "globalincs/globals.h"
|
||||
#include "globalincs/pstypes.h"
|
||||
#include "globalincs/systemvars.h"
|
||||
#include "object/waypoint.h"
|
||||
#include "physics/physics.h"
|
||||
|
||||
struct ship_weapon;
|
||||
class ship_subsys;
|
||||
@@ -622,7 +622,7 @@ extern void init_ai_system(void);
|
||||
extern void ai_attack_object(object *attacker, object *attacked, ship_subsys *ssp);
|
||||
extern void ai_evade_object(object *evader, object *evaded);
|
||||
extern void ai_ignore_object(object *ignorer, object *ignored, int ignore_new);
|
||||
extern void ai_ignore_wing(object *ignorer, int wingnum, int priority);
|
||||
extern void ai_ignore_wing(object *ignorer, int wingnum);
|
||||
extern void ai_dock_with_object(object *docker, int docker_index, object *dockee, int dockee_index, int dock_type);
|
||||
extern void ai_stay_still(object *still_objp, vec3d *view_pos);
|
||||
extern void ai_do_default_behavior(object *obj);
|
||||
@@ -726,8 +726,7 @@ void process_subobjects(int objnum);
|
||||
//SUSHI: Setting ai_info stuff from both ai class and ai profile
|
||||
void init_aip_from_class_and_profile(ai_info *aip, ai_class *aicp, ai_profile_t *profile);
|
||||
|
||||
//SUSHI: Updating AI aim
|
||||
void ai_update_aim(ai_info *aip, object* En_Objp);
|
||||
void ai_update_aim(ai_info *aip);
|
||||
|
||||
//SUSHI: Random evasive sidethrust
|
||||
void do_random_sidethrust(ai_info *aip, ship_info *sip);
|
||||
|
||||
+10
-6
@@ -7,13 +7,13 @@
|
||||
|
||||
|
||||
|
||||
#include "globalincs/pstypes.h"
|
||||
#include "globalincs/def_files.h"
|
||||
#include "ai/ai_profiles.h"
|
||||
#include "parse/parselo.h"
|
||||
#include "globalincs/def_files.h"
|
||||
#include "globalincs/pstypes.h"
|
||||
#include "localization/localize.h"
|
||||
#include "weapon/weapon.h"
|
||||
#include "parse/parselo.h"
|
||||
#include "ship/ship.h"
|
||||
#include "weapon/weapon.h"
|
||||
|
||||
|
||||
// global stuff
|
||||
@@ -462,12 +462,16 @@ void parse_ai_profiles_tbl(const char *filename)
|
||||
|
||||
set_flag(profile, "$strict turret-tagged-only targeting:", AIPF2_STRICT_TURRET_TAGGED_ONLY_TARGETING, AIP_FLAG2);
|
||||
|
||||
set_flag(profile, "$aspect bomb invulnerability fix:", AIPF2_ASPECT_INVULNERABILITY_FIX, AIP_FLAG2);
|
||||
|
||||
set_flag(profile, "$glide decay requires thrust:", AIPF2_GLIDE_DECAY_REQUIRES_THRUST, AIP_FLAG2);
|
||||
|
||||
profile->bay_arrive_speed_mult = 1.0f;
|
||||
profile->bay_depart_speed_mult = 1.0f;
|
||||
if (optional_string("$bay arrive start speed multiplier:")) {
|
||||
if (optional_string("$bay arrive speed multiplier:")) {
|
||||
stuff_float(&profile->bay_arrive_speed_mult);
|
||||
}
|
||||
if (optional_string("$bay depart end speed multiplier:")) {
|
||||
if (optional_string("$bay depart speed multiplier:")) {
|
||||
stuff_float(&profile->bay_depart_speed_mult);
|
||||
}
|
||||
|
||||
|
||||
@@ -9,8 +9,8 @@
|
||||
#ifndef _AI_PROFILES_H_
|
||||
#define _AI_PROFILES_H_
|
||||
|
||||
#include "globalincs/pstypes.h"
|
||||
#include "globalincs/globals.h"
|
||||
#include "globalincs/pstypes.h"
|
||||
#include "globalincs/systemvars.h"
|
||||
|
||||
// flag int defines
|
||||
@@ -66,6 +66,8 @@
|
||||
#define AIPF2_AI_GUARDS_SPECIFIC_SHIP_IN_WING (1 << 12)
|
||||
#define AIPF2_FIX_AI_PATH_ORDER_BUG (1 << 13)
|
||||
#define AIPF2_STRICT_TURRET_TAGGED_ONLY_TARGETING (1 << 14)
|
||||
#define AIPF2_ASPECT_INVULNERABILITY_FIX (1 << 15)
|
||||
#define AIPF2_GLIDE_DECAY_REQUIRES_THRUST (1 << 16)
|
||||
|
||||
// AI Path types
|
||||
#define AI_PATH_MODE_NORMAL 0
|
||||
|
||||
+14
-14
@@ -10,22 +10,23 @@
|
||||
|
||||
|
||||
#include "ai/aibig.h"
|
||||
#include "globalincs/linklist.h"
|
||||
#include "object/object.h"
|
||||
#include "ship/ship.h"
|
||||
#include "ship/afterburner.h"
|
||||
#include "freespace2/freespace.h"
|
||||
#include "weapon/weapon.h"
|
||||
#include "io/timer.h"
|
||||
#include "mission/missionparse.h"
|
||||
#include "iff_defs/iff_defs.h"
|
||||
#include "math/staticrand.h"
|
||||
#include "ai/aigoals.h"
|
||||
#include "freespace2/freespace.h"
|
||||
#include "globalincs/linklist.h"
|
||||
#include "iff_defs/iff_defs.h"
|
||||
#include "io/timer.h"
|
||||
#include "math/staticrand.h"
|
||||
#include "mission/missionparse.h"
|
||||
#include "object/object.h"
|
||||
#include "ship/afterburner.h"
|
||||
#include "ship/ship.h"
|
||||
#include "weapon/weapon.h"
|
||||
|
||||
|
||||
|
||||
#ifdef _MSC_VER
|
||||
#pragma optimize("", off)
|
||||
#pragma auto_inline(off)
|
||||
#endif
|
||||
|
||||
#define SCAN_FIGHTERS_INTERVAL 2000 // how often an AI fighter/bomber should scan for enemy fighter/bombers
|
||||
// if sitting still and pounding on a big ship. If enemy fighters are
|
||||
@@ -1238,7 +1239,7 @@ int ai_big_strafe_maybe_retreat(float dist, vec3d *target_pos)
|
||||
float dist_to_target, dist_normal_to_target, time_to_target;
|
||||
dist_to_target = vm_vec_mag_quick(&vec_to_target);
|
||||
if (vm_vec_mag_quick(&aip->big_attack_surface_normal) > 0.9) {
|
||||
dist_normal_to_target = -vm_vec_dotprod(&vec_to_target, &aip->big_attack_surface_normal);
|
||||
dist_normal_to_target = -vm_vec_dot(&vec_to_target, &aip->big_attack_surface_normal);
|
||||
} else {
|
||||
dist_normal_to_target = 0.2f * vm_vec_mag_quick(&vec_to_target);
|
||||
}
|
||||
@@ -1263,10 +1264,9 @@ int ai_big_strafe_maybe_retreat(float dist, vec3d *target_pos)
|
||||
aip->submode = AIS_STRAFE_RETREAT1;
|
||||
aip->submode_start_time = Missiontime;
|
||||
|
||||
float box_dist;
|
||||
int is_inside;
|
||||
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);
|
||||
get_world_closest_box_point_with_delta(&goal_point, En_objp, &Pl_objp->pos, &is_inside, STRAFE_RETREAT_BOX_DIST);
|
||||
|
||||
// set goal point
|
||||
aip->goal_point = goal_point;
|
||||
|
||||
+190
-222
@@ -18,61 +18,63 @@
|
||||
|
||||
|
||||
#include "ai/ai.h"
|
||||
#include "debugconsole/console.h"
|
||||
#include "globalincs/linklist.h"
|
||||
#include "object/object.h"
|
||||
#include "physics/physics.h"
|
||||
#include "ship/ship.h"
|
||||
#include "model/model.h"
|
||||
#include "render/3d.h"
|
||||
#include "playerman/player.h"
|
||||
#include "freespace2/freespace.h"
|
||||
#include "mission/missiongoals.h"
|
||||
#include "mission/missionlog.h"
|
||||
#include "io/timer.h"
|
||||
#include "ai/aigoals.h"
|
||||
#include "gamesnd/gamesnd.h"
|
||||
#include "mission/missionmessage.h"
|
||||
#include "mission/missionparse.h"
|
||||
#include "cmeasure/cmeasure.h"
|
||||
#include "math/staticrand.h"
|
||||
#include "ship/afterburner.h"
|
||||
#include "ship/shipfx.h"
|
||||
#include "ship/shiphit.h"
|
||||
#include "ai/ai_profiles.h"
|
||||
#include "ai/aibig.h"
|
||||
#include "ai/aigoals.h"
|
||||
#include "ai/aiinternal.h"
|
||||
#include "asteroid/asteroid.h"
|
||||
#include "autopilot/autopilot.h"
|
||||
#include "cmeasure/cmeasure.h"
|
||||
#include "debugconsole/console.h"
|
||||
#include "freespace2/freespace.h"
|
||||
#include "gamesequence/gamesequence.h"
|
||||
#include "gamesnd/gamesnd.h"
|
||||
#include "globalincs/linklist.h"
|
||||
#include "hud/hud.h"
|
||||
#include "hud/hudets.h"
|
||||
#include "object/objcollide.h"
|
||||
#include "object/objectshield.h"
|
||||
#include "asteroid/asteroid.h"
|
||||
#include "hud/hudlock.h"
|
||||
#include "mission/missiontraining.h"
|
||||
#include "gamesequence/gamesequence.h"
|
||||
#include "io/joy_ff.h"
|
||||
#include "localization/localize.h"
|
||||
#include "weapon/weapon.h"
|
||||
#include "weapon/flak.h"
|
||||
#include "weapon/beam.h"
|
||||
#include "weapon/swarm.h"
|
||||
#include "ship/awacs.h"
|
||||
#include "math/fvi.h"
|
||||
#include "parse/parselo.h"
|
||||
#include "object/objectdock.h"
|
||||
#include "object/deadobjectdock.h"
|
||||
#include "object/waypoint.h"
|
||||
#include "ai/aiinternal.h"
|
||||
#include "iff_defs/iff_defs.h"
|
||||
#include "io/joy_ff.h"
|
||||
#include "io/timer.h"
|
||||
#include "localization/localize.h"
|
||||
#include "math/fvi.h"
|
||||
#include "math/staticrand.h"
|
||||
#include "mission/missiongoals.h"
|
||||
#include "mission/missionlog.h"
|
||||
#include "mission/missionmessage.h"
|
||||
#include "mission/missionparse.h"
|
||||
#include "mission/missiontraining.h"
|
||||
#include "model/model.h"
|
||||
#include "network/multi.h"
|
||||
#include "network/multimsgs.h"
|
||||
#include "network/multiutil.h"
|
||||
#include "network/multi.h"
|
||||
#include "ai/ai_profiles.h"
|
||||
#include "autopilot/autopilot.h"
|
||||
#include "object/deadobjectdock.h"
|
||||
#include "object/objcollide.h"
|
||||
#include "object/object.h"
|
||||
#include "object/objectdock.h"
|
||||
#include "object/objectshield.h"
|
||||
#include "object/waypoint.h"
|
||||
#include "parse/parselo.h"
|
||||
#include "physics/physics.h"
|
||||
#include "playerman/player.h"
|
||||
#include "render/3d.h"
|
||||
#include "ship/afterburner.h"
|
||||
#include "ship/awacs.h"
|
||||
#include "ship/ship.h"
|
||||
#include "ship/shipfx.h"
|
||||
#include "ship/shiphit.h"
|
||||
#include "weapon/beam.h"
|
||||
#include "weapon/flak.h"
|
||||
#include "weapon/swarm.h"
|
||||
#include "weapon/weapon.h"
|
||||
#include <map>
|
||||
#include <limits.h>
|
||||
|
||||
|
||||
#ifdef _MSC_VER
|
||||
#pragma optimize("", off)
|
||||
#pragma auto_inline(off)
|
||||
#endif
|
||||
|
||||
#define UNINITIALIZED_VALUE -99999.9f
|
||||
|
||||
@@ -978,7 +980,7 @@ int ai_is_stealth_visible(object *viewer_objp, object *stealth_objp)
|
||||
if ( !ship_is_visible_by_team(stealth_objp, &Ships[viewer_objp->instance]) ) {
|
||||
vm_vec_sub(&vec_to_stealth, &stealth_objp->pos, &viewer_objp->pos);
|
||||
dist_to_stealth = vm_vec_mag_quick(&vec_to_stealth);
|
||||
dot_to_stealth = vm_vec_dotprod(&viewer_objp->orient.vec.fvec, &vec_to_stealth) / dist_to_stealth;
|
||||
dot_to_stealth = vm_vec_dot(&viewer_objp->orient.vec.fvec, &vec_to_stealth) / dist_to_stealth;
|
||||
|
||||
// get max dist at which stealth is visible
|
||||
max_stealth_dist = get_skill_stealth_dist_scaler() * STEALTH_MAX_VIEW_DIST;
|
||||
@@ -1537,8 +1539,8 @@ float turn_towards_tangent(object *objp, vec3d *point, float radius)
|
||||
vec3d v2g;
|
||||
|
||||
vm_vec_normalized_dir(&vec_to_point, point, &objp->pos);
|
||||
vm_vec_crossprod(&up_vec, &vec_to_point, &objp->orient.vec.fvec);
|
||||
vm_vec_crossprod(&perp_vec, &vec_to_point, &up_vec);
|
||||
vm_vec_cross(&up_vec, &vec_to_point, &objp->orient.vec.fvec);
|
||||
vm_vec_cross(&perp_vec, &vec_to_point, &up_vec);
|
||||
|
||||
vm_vec_scale_add(&perp_point, point, &vec_to_point, -radius);
|
||||
if (vm_vec_dot(&objp->orient.vec.fvec, &perp_vec) > 0.0f) {
|
||||
@@ -1561,7 +1563,7 @@ float turn_toward_tangent_with_axis(object *objp, object *center_objp, float rad
|
||||
|
||||
// find closest z of center objp
|
||||
vm_vec_sub(&sph_r_vec, &objp->pos, ¢er_objp->pos);
|
||||
center_obj_z = vm_vec_dotprod(&sph_r_vec, ¢er_objp->orient.vec.fvec);
|
||||
center_obj_z = vm_vec_dot(&sph_r_vec, ¢er_objp->orient.vec.fvec);
|
||||
|
||||
// find pt on axis with closest z
|
||||
vm_vec_scale_add(¢er_vec, ¢er_objp->pos, ¢er_objp->orient.vec.fvec, center_obj_z);
|
||||
@@ -1569,10 +1571,10 @@ float turn_toward_tangent_with_axis(object *objp, object *center_objp, float rad
|
||||
// get r_vec
|
||||
vm_vec_sub(&r_vec, &objp->pos, ¢er_vec);
|
||||
|
||||
Assert( (vm_vec_dotprod(&r_vec, ¢er_objp->orient.vec.fvec) < 0.0001));
|
||||
Assert( (vm_vec_dot(&r_vec, ¢er_objp->orient.vec.fvec) < 0.0001));
|
||||
|
||||
// get theta vec - perp to r_vec and z_vec
|
||||
vm_vec_crossprod(&theta_vec, ¢er_objp->orient.vec.fvec, &r_vec);
|
||||
vm_vec_cross(&theta_vec, ¢er_objp->orient.vec.fvec, &r_vec);
|
||||
|
||||
#ifndef NDEBUG
|
||||
float mag;
|
||||
@@ -1581,11 +1583,11 @@ float turn_toward_tangent_with_axis(object *objp, object *center_objp, float rad
|
||||
#endif
|
||||
|
||||
vec3d temp;
|
||||
vm_vec_crossprod(&temp, &r_vec, &theta_vec);
|
||||
vm_vec_cross(&temp, &r_vec, &theta_vec);
|
||||
|
||||
#ifndef NDEBUG
|
||||
float dot;
|
||||
dot = vm_vec_dotprod(&temp, ¢er_objp->orient.vec.fvec);
|
||||
dot = vm_vec_dot(&temp, ¢er_objp->orient.vec.fvec);
|
||||
Assert( dot >0.9999 && dot < 1.0001);
|
||||
#endif
|
||||
|
||||
@@ -1611,17 +1613,17 @@ void get_tangent_point(vec3d *goal_point, object *objp, vec3d *point, float radi
|
||||
vec3d up_vec, perp_vec;
|
||||
|
||||
vm_vec_normalized_dir(&vec_to_point, point, &objp->pos);
|
||||
vm_vec_crossprod(&up_vec, &vec_to_point, &objp->orient.vec.fvec);
|
||||
vm_vec_cross(&up_vec, &vec_to_point, &objp->orient.vec.fvec);
|
||||
|
||||
while (IS_VEC_NULL(&up_vec)) {
|
||||
vec3d rnd_vec;
|
||||
|
||||
vm_vec_rand_vec_quick(&rnd_vec);
|
||||
vm_vec_add2(&rnd_vec, &objp->orient.vec.fvec);
|
||||
vm_vec_crossprod(&up_vec, &vec_to_point, &rnd_vec);
|
||||
vm_vec_cross(&up_vec, &vec_to_point, &rnd_vec);
|
||||
}
|
||||
|
||||
vm_vec_crossprod(&perp_vec, &vec_to_point, &up_vec);
|
||||
vm_vec_cross(&perp_vec, &vec_to_point, &up_vec);
|
||||
vm_vec_normalize(&perp_vec);
|
||||
|
||||
vm_vec_scale_add(&perp_point, point, &vec_to_point, -radius);
|
||||
@@ -1999,11 +2001,6 @@ void evaluate_object_as_nearest_objnum(eval_nearest_objnum *eno)
|
||||
}
|
||||
|
||||
if (eno->trial_objp->flags & OF_PLAYER_SHIP){
|
||||
// Goober5000: oh dear, it looks like this was originally meant to scale
|
||||
// the distance according to skill, but as it is, the effect appears negligible.
|
||||
// I could fix it with parentheses, but we all know how quickly AI pilots
|
||||
// die usually, so the overall effect would probably be worse. So I left
|
||||
// this unchanged.
|
||||
dist *= 1.0f + (NUM_SKILL_LEVELS - Game_skill_level - 1)/NUM_SKILL_LEVELS; // Favor attacking non-players based on skill level.
|
||||
}
|
||||
|
||||
@@ -2485,7 +2482,7 @@ void ai_ignore_object(object *ignorer, object *ignored, int ignore_new)
|
||||
/**
|
||||
* Ignore some object without changing mode.
|
||||
*/
|
||||
void ai_ignore_wing(object *ignorer, int wingnum, int priority)
|
||||
void ai_ignore_wing(object *ignorer, int wingnum)
|
||||
{
|
||||
ai_info *aip;
|
||||
|
||||
@@ -2624,7 +2621,7 @@ void create_path_to_point(vec3d *curpos, vec3d *goalpos, object *curobjp, object
|
||||
void copy_xlate_model_path_points(object *objp, model_path *mp, int dir, int count, int path_num, pnode *pnp, int randomize_pnt)
|
||||
{
|
||||
polymodel *pm;
|
||||
int i, modelnum;
|
||||
int i, modelnum, model_instance_num;
|
||||
vec3d v1;
|
||||
int pp_index; // index in Path_points at which to store point, if this is a modify-in-place (pnp ! NULL)
|
||||
int start_index, finish_index;
|
||||
@@ -2649,14 +2646,12 @@ void copy_xlate_model_path_points(object *objp, model_path *mp, int dir, int cou
|
||||
|
||||
// Goober5000 - check for rotating submodels
|
||||
modelnum = Ship_info[Ships[objp->instance].ship_info_index].model_num;
|
||||
model_instance_num = Ships[objp->instance].model_instance_num;
|
||||
pm = model_get(modelnum);
|
||||
if ((mp->parent_submodel >= 0) && (pm->submodel[mp->parent_submodel].movement_type >= 0))
|
||||
{
|
||||
rotating_submodel = true;
|
||||
|
||||
// start submodel calculation
|
||||
ship_model_start(objp);
|
||||
|
||||
model_find_submodel_offset(&submodel_offset, modelnum, mp->parent_submodel);
|
||||
}
|
||||
else
|
||||
@@ -2673,7 +2668,7 @@ void copy_xlate_model_path_points(object *objp, model_path *mp, int dir, int cou
|
||||
{
|
||||
// movement... find location of point like with docking code and spark generation
|
||||
vm_vec_sub(&local_vert, &mp->verts[i].pos, &submodel_offset);
|
||||
model_find_world_point(&v1, &local_vert, modelnum, mp->parent_submodel, &objp->orient, &objp->pos);
|
||||
model_instance_find_world_point(&v1, &local_vert, model_instance_num, mp->parent_submodel, &objp->orient, &objp->pos);
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -2695,12 +2690,6 @@ void copy_xlate_model_path_points(object *objp, model_path *mp, int dir, int cou
|
||||
add_path_point(&v1, path_num, i, pp_index);
|
||||
offset++;
|
||||
}
|
||||
|
||||
// stop submodel calculation
|
||||
if (!rotating_submodel)
|
||||
{
|
||||
ship_model_stop(objp);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -2969,8 +2958,8 @@ int maybe_avoid_player(object *objp, vec3d *goal_pos)
|
||||
} else {
|
||||
vec3d tvec1;
|
||||
vm_vec_normalize(&avoid_vec);
|
||||
vm_vec_crossprod(&tvec1, &n_vec_to_goal, &avoid_vec);
|
||||
vm_vec_crossprod(&avoid_vec, &tvec1, &n_vec_to_player);
|
||||
vm_vec_cross(&tvec1, &n_vec_to_goal, &avoid_vec);
|
||||
vm_vec_cross(&avoid_vec, &tvec1, &n_vec_to_player);
|
||||
}
|
||||
|
||||
// Now, avoid_vec is a vector perpendicular to the vector to the player and the direction *objp
|
||||
@@ -3411,7 +3400,7 @@ float compute_collision_time(vec3d *targpos, vec3d *targvel, vec3d *attackpos, f
|
||||
// This function doesn't account for the fact that by the time the player
|
||||
// (or his laser) gets to the current enemy position, the enemy will have moved.
|
||||
// This is dealt with in polish_predicted_enemy_pos.
|
||||
float compute_time_to_enemy(float dist_to_enemy, object *pobjp, object *eobjp)
|
||||
float compute_time_to_enemy(float dist_to_enemy, object *pobjp)
|
||||
{
|
||||
float time_to_enemy;
|
||||
float pl_speed = pobjp->phys_info.speed;
|
||||
@@ -3493,8 +3482,12 @@ void ai_set_positions(object *pl_objp, object *en_objp, ai_info *aip, vec3d *pla
|
||||
|
||||
}
|
||||
|
||||
// --------------------------------------------------------------------------
|
||||
void ai_update_aim(ai_info *aip, object* En_Objp)
|
||||
/**
|
||||
* Updates AI aim automatically based on targetted enemy.
|
||||
*
|
||||
* @param aip Pointer to AI info
|
||||
*/
|
||||
void ai_update_aim(ai_info *aip)
|
||||
{
|
||||
if (Missiontime >= aip->next_aim_pos_time)
|
||||
{
|
||||
@@ -3647,7 +3640,7 @@ float maybe_recreate_path(object *objp, ai_info *aip, int force_recreate_flag, i
|
||||
/**
|
||||
* Set acceleration for ai_dock().
|
||||
*/
|
||||
void set_accel_for_docking(object *objp, ai_info *aip, float dot, float dot_to_next, float dist_to_next, float dist_to_goal, ship_info *sip, float max_allowed_speed)
|
||||
void set_accel_for_docking(object *objp, ai_info *aip, float dot, float dot_to_next, float dist_to_next, float dist_to_goal, ship_info *sip, float max_allowed_speed, object *gobjp)
|
||||
{
|
||||
float prev_dot_to_goal = aip->prev_dot_to_goal;
|
||||
|
||||
@@ -3662,9 +3655,55 @@ void set_accel_for_docking(object *objp, ai_info *aip, float dot, float dot_to_n
|
||||
change_acceleration(aip, -1.0f); // -1.0f means subtract off flFrametime from acceleration value in 0.0..1.0
|
||||
}
|
||||
} else {
|
||||
// If max_allowed_speed isn't set, use the ship max speed
|
||||
float max_bay_speed = sip->max_speed;
|
||||
|
||||
// Maybe gradually ramp up/down the speed of a ship flying a fighterbay path
|
||||
if (aip->mode == AIM_BAY_EMERGE || (aip->mode == AIM_BAY_DEPART && aip->path_cur != aip->path_start)) {
|
||||
ship_info *gsip = &Ship_info[Ships[gobjp->instance].ship_info_index];
|
||||
polymodel *pm = model_get(gsip->model_num);
|
||||
SCP_string pathName(pm->paths[Path_points[aip->path_start].path_num].name);
|
||||
float speed_mult = FLT_MIN;
|
||||
|
||||
if (aip->mode == AIM_BAY_EMERGE) { // Arriving
|
||||
if (gsip->pathMetadata.find(pathName) != gsip->pathMetadata.end()) {
|
||||
speed_mult = gsip->pathMetadata[pathName].arrive_speed_mult;
|
||||
}
|
||||
|
||||
if (speed_mult == FLT_MIN) {
|
||||
speed_mult = The_mission.ai_profile->bay_arrive_speed_mult;
|
||||
}
|
||||
} else { // Departing
|
||||
if (gsip->pathMetadata.find(pathName) != gsip->pathMetadata.end()) {
|
||||
speed_mult = gsip->pathMetadata[pathName].depart_speed_mult;
|
||||
}
|
||||
|
||||
if (speed_mult == FLT_MIN) {
|
||||
speed_mult = The_mission.ai_profile->bay_depart_speed_mult;
|
||||
}
|
||||
}
|
||||
|
||||
if (speed_mult != FLT_MIN && speed_mult != 1.0f) {
|
||||
// We use the distance between the first and last point on the path here; it's not accurate
|
||||
// if the path is not straight, but should be good enough usually; can be changed if necessary.
|
||||
float total_path_length = vm_vec_dist_quick(&Path_points[aip->path_start].pos, &Path_points[aip->path_start + aip->path_length - 1].pos);
|
||||
float dist_to_end;
|
||||
|
||||
if (aip->mode == AIM_BAY_EMERGE) { // Arriving
|
||||
dist_to_end = vm_vec_dist_quick(&Pl_objp->pos, &Path_points[aip->path_start].pos);
|
||||
} else { // Departing
|
||||
dist_to_end = vm_vec_dist_quick(&Pl_objp->pos, &Path_points[aip->path_start + aip->path_length - 1].pos);
|
||||
}
|
||||
|
||||
// Calculate max speed, but respect the waypoint speed cap if it's lower
|
||||
max_bay_speed = sip->max_speed * (speed_mult + (1.0f - speed_mult) * (dist_to_end / total_path_length));
|
||||
}
|
||||
}
|
||||
|
||||
// Cap speed to max_allowed_speed, if it's set
|
||||
if (max_allowed_speed <= 0)
|
||||
max_allowed_speed = sip->max_speed;
|
||||
max_allowed_speed = max_bay_speed;
|
||||
else
|
||||
max_allowed_speed = MIN(max_allowed_speed, max_bay_speed);
|
||||
|
||||
if ((aip->mode == AIM_DOCK) && (dist_to_next < 150.0f) && (aip->path_start + aip->path_length - 2 == aip->path_cur)) {
|
||||
set_accel_for_target_speed(objp, max_allowed_speed * MAX(dist_to_next/500.0f, 1.0f));
|
||||
@@ -3740,8 +3779,7 @@ void set_accel_for_docking(object *objp, ai_info *aip, float dot, float dot_to_n
|
||||
// Returns distance to goal point.
|
||||
float ai_path_0()
|
||||
{
|
||||
polymodel *pm;
|
||||
int num_paths, num_points;
|
||||
int num_points;
|
||||
float dot, dist_to_goal, dist_to_next, dot_to_next;
|
||||
ship *shipp = &Ships[Pl_objp->instance];
|
||||
ship_info *sip = &Ship_info[shipp->ship_info_index];
|
||||
@@ -3750,7 +3788,6 @@ float ai_path_0()
|
||||
float mag;
|
||||
vec3d temp_vec, *slop_vec;
|
||||
object *gobjp;
|
||||
ship *gshipp;
|
||||
vec3d *cvp, *nvp, next_vec, gcvp, gnvp; // current and next vertices in global coordinates.
|
||||
|
||||
aip = &Ai_info[Ships[Pl_objp->instance].ai_index];
|
||||
@@ -3759,11 +3796,6 @@ float ai_path_0()
|
||||
Assert(Objects[aip->goal_objnum].type == OBJ_SHIP);
|
||||
|
||||
gobjp = &Objects[aip->goal_objnum];
|
||||
gshipp = &Ships[gobjp->instance];
|
||||
|
||||
pm = model_get(Ship_info[gshipp->ship_info_index].model_num);
|
||||
num_paths = pm->n_paths;
|
||||
Assert(num_paths > 0);
|
||||
|
||||
if (aip->path_start == -1) {
|
||||
Assert(aip->goal_objnum >= 0 && aip->goal_objnum < MAX_OBJECTS);
|
||||
@@ -3855,7 +3887,7 @@ float ai_path_0()
|
||||
dot = vm_vec_dot_to_point(&nvel_vec, &Pl_objp->pos, &gcvp);
|
||||
dot_to_next = vm_vec_dot_to_point(&nvel_vec, &Pl_objp->pos, &gnvp);
|
||||
|
||||
set_accel_for_docking(Pl_objp, aip, dot, dot_to_next, dist_to_next, dist_to_goal, sip, 0);
|
||||
set_accel_for_docking(Pl_objp, aip, dot, dot_to_next, dist_to_next, dist_to_goal, sip, 0, gobjp);
|
||||
aip->prev_dot_to_goal = dot;
|
||||
|
||||
// If moving at a non-tiny velocity, detect attaining path point by its being close to
|
||||
@@ -3891,8 +3923,7 @@ float ai_path_0()
|
||||
// 1.
|
||||
float ai_path_1()
|
||||
{
|
||||
polymodel *pm;
|
||||
int num_paths, num_points;
|
||||
int num_points;
|
||||
float dot, dist_to_goal, dist_to_next, dot_to_next;
|
||||
ship *shipp = &Ships[Pl_objp->instance];
|
||||
ship_info *sip = &Ship_info[shipp->ship_info_index];
|
||||
@@ -3900,7 +3931,6 @@ float ai_path_1()
|
||||
vec3d nvel_vec;
|
||||
float mag;
|
||||
object *gobjp;
|
||||
ship *gshipp;
|
||||
vec3d *pvp, *cvp, *nvp, next_vec, gpvp, gcvp, gnvp; // previous, current and next vertices in global coordinates.
|
||||
|
||||
aip = &Ai_info[Ships[Pl_objp->instance].ai_index];
|
||||
@@ -3909,12 +3939,6 @@ float ai_path_1()
|
||||
Assert(Objects[aip->goal_objnum].type == OBJ_SHIP);
|
||||
|
||||
gobjp = &Objects[aip->goal_objnum];
|
||||
gshipp = &Ships[gobjp->instance];
|
||||
|
||||
// Get path data
|
||||
pm = model_get(Ship_info[gshipp->ship_info_index].model_num);
|
||||
num_paths = pm->n_paths;
|
||||
Assert(num_paths > 0);
|
||||
|
||||
if (aip->path_start == -1) {
|
||||
Assert(aip->goal_objnum >= 0 && aip->goal_objnum < MAX_OBJECTS);
|
||||
@@ -4016,53 +4040,7 @@ float ai_path_1()
|
||||
max_allowed_speed = (float) aip->waypoint_speed_cap;
|
||||
}
|
||||
|
||||
// Maybe gradually ramp up/down the speed of a ship flying a fighterbay path
|
||||
if (aip->mode == AIM_BAY_EMERGE || (aip->mode == AIM_BAY_DEPART && aip->path_cur != aip->path_start)) {
|
||||
SCP_string pathName(pm->paths[Path_points[aip->path_start].path_num].name);
|
||||
ship_info *gsip = &Ship_info[gshipp->ship_info_index];
|
||||
float speed_mult = 1.0f;
|
||||
|
||||
if (aip->mode == AIM_BAY_EMERGE) { // Arriving
|
||||
if (gsip->pathMetadata.find(pathName) != gsip->pathMetadata.end()) {
|
||||
speed_mult = gsip->pathMetadata[pathName].arrive_speed_mult;
|
||||
}
|
||||
|
||||
if (speed_mult == FLT_MIN) {
|
||||
speed_mult = The_mission.ai_profile->bay_arrive_speed_mult;
|
||||
}
|
||||
} else { // Departing
|
||||
if (gsip->pathMetadata.find(pathName) != gsip->pathMetadata.end()) {
|
||||
speed_mult = gsip->pathMetadata[pathName].depart_speed_mult;
|
||||
}
|
||||
|
||||
if (speed_mult == FLT_MIN) {
|
||||
speed_mult = The_mission.ai_profile->bay_depart_speed_mult;
|
||||
}
|
||||
}
|
||||
|
||||
if (speed_mult != 1.0f) {
|
||||
// We use the distance between the first and last point on the path here; it's not accurate
|
||||
// if the path is not straight, but should be good enough usually; can be changed if necessary.
|
||||
float total_path_length = vm_vec_dist_quick(&Path_points[aip->path_start].pos, &Path_points[aip->path_start + num_points - 1].pos);
|
||||
float dist_to_end;
|
||||
|
||||
if (aip->mode == AIM_BAY_EMERGE) { // Arriving
|
||||
dist_to_end = vm_vec_dist_quick(&Pl_objp->pos, &Path_points[aip->path_start].pos);
|
||||
} else { // Departing
|
||||
dist_to_end = vm_vec_dist_quick(&Pl_objp->pos, &Path_points[aip->path_start + num_points - 1].pos);
|
||||
}
|
||||
|
||||
// Calculate max speed, but respect the waypoint speed cap if it's lower
|
||||
float max_bay_speed = sip->max_speed * (speed_mult + (1.0f - speed_mult) * (dist_to_end / total_path_length));
|
||||
if (max_allowed_speed == 0.0f) {
|
||||
max_allowed_speed = max_bay_speed;
|
||||
} else {
|
||||
max_allowed_speed = MIN(max_allowed_speed, max_bay_speed);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
set_accel_for_docking(Pl_objp, aip, dot, dot_to_next, dist_to_next, dist_to_goal, sip, max_allowed_speed);
|
||||
set_accel_for_docking(Pl_objp, aip, dot, dot_to_next, dist_to_next, dist_to_goal, sip, max_allowed_speed, gobjp);
|
||||
aip->prev_dot_to_goal = dot;
|
||||
|
||||
// If moving at a non-tiny velocity, detect attaining path point by its being close to
|
||||
@@ -5247,7 +5225,7 @@ int ai_select_primary_weapon_OLD(object *objp, object *other_objp, int flags)
|
||||
ship *shipp = &Ships[objp->instance];
|
||||
ship_weapon *swp = &shipp->weapons;
|
||||
|
||||
Assert( shipp->ship_info_index >= 0 && shipp->ship_info_index < Num_ship_classes);
|
||||
Assert( shipp->ship_info_index >= 0 && shipp->ship_info_index < static_cast<int>(Ship_info.size()));
|
||||
|
||||
if (flags & WIF_PUNCTURE) {
|
||||
if (swp->current_primary_bank >= 0) {
|
||||
@@ -5336,7 +5314,7 @@ int ai_select_primary_weapon(object *objp, object *other_objp, int flags)
|
||||
return ai_select_primary_weapon_OLD(objp, other_objp, flags);
|
||||
}
|
||||
|
||||
Assert( shipp->ship_info_index >= 0 && shipp->ship_info_index < Num_ship_classes);
|
||||
Assert( shipp->ship_info_index >= 0 && shipp->ship_info_index < static_cast<int>(Ship_info.size()));
|
||||
|
||||
//made it so it only selects puncture weapons if the active goal is to disable something -Bobboau
|
||||
if ((flags & WIF_PUNCTURE) && (Ai_info[shipp->ai_index].goals[0].ai_mode & (AI_GOAL_DISARM_SHIP | AI_GOAL_DISABLE_SHIP)))
|
||||
@@ -5653,7 +5631,7 @@ int ai_fire_primary_weapon(object *objp)
|
||||
ai_info *aip;
|
||||
object *enemy_objp;
|
||||
|
||||
Assert( shipp->ship_info_index >= 0 && shipp->ship_info_index < Num_ship_classes);
|
||||
Assert( shipp->ship_info_index >= 0 && shipp->ship_info_index < static_cast<int>(Ship_info.size()));
|
||||
|
||||
aip = &Ai_info[shipp->ai_index];
|
||||
|
||||
@@ -6086,7 +6064,7 @@ int ai_fire_secondary_weapon(object *objp, int priority1, int priority2)
|
||||
shipp = &Ships[objp->instance];
|
||||
swp = &shipp->weapons;
|
||||
|
||||
Assert( shipp->ship_info_index >= 0 && shipp->ship_info_index < Num_ship_classes);
|
||||
Assert( shipp->ship_info_index >= 0 && shipp->ship_info_index < static_cast<int>(Ship_info.size()));
|
||||
|
||||
// Select secondary weapon.
|
||||
current_bank = swp->current_secondary_bank; //ai_select_secondary_weapon(objp, swp, priority1, priority2);
|
||||
@@ -6166,7 +6144,7 @@ int might_hit_teammate(object *firing_objp)
|
||||
|
||||
void render_all_ship_bay_paths(object *objp)
|
||||
{
|
||||
int i,j,color;
|
||||
int i,j,clr;
|
||||
polymodel *pm;
|
||||
model_path *mp;
|
||||
|
||||
@@ -6179,17 +6157,17 @@ void render_all_ship_bay_paths(object *objp)
|
||||
|
||||
memset(&v, 0, sizeof(v));
|
||||
|
||||
for ( i = 0; i < pm->ship_bay->num_paths; i++ ) {
|
||||
for ( i = 0; i < pm->ship_bay->num_paths; i++ ) {
|
||||
mp = &pm->paths[pm->ship_bay->path_indexes[i]];
|
||||
|
||||
for ( j = 0; j < mp->nverts; j++ ) {
|
||||
vm_vec_unrotate(&global_path_point, &mp->verts[j].pos, &objp->orient);
|
||||
vm_vec_add2(&global_path_point, &objp->pos);
|
||||
g3_rotate_vertex(&v, &global_path_point);
|
||||
color = 255 - j*50;
|
||||
if ( color < 50 )
|
||||
color = 100;
|
||||
gr_set_color(0, color, 0);
|
||||
clr = 255 - j*50;
|
||||
if ( clr < 50 )
|
||||
clr = 100;
|
||||
gr_set_color(0, clr, 0);
|
||||
|
||||
if ( j == mp->nverts-1 ) {
|
||||
gr_set_color(255, 0, 0);
|
||||
@@ -6211,7 +6189,7 @@ void render_all_ship_bay_paths(object *objp)
|
||||
*/
|
||||
void render_all_subsys_paths(object *objp)
|
||||
{
|
||||
int i,j,color;
|
||||
int i,j,clr;
|
||||
polymodel *pm;
|
||||
model_path *mp;
|
||||
|
||||
@@ -6222,7 +6200,7 @@ void render_all_subsys_paths(object *objp)
|
||||
if ( pm->ship_bay == NULL )
|
||||
return;
|
||||
|
||||
memset(&v, 0, sizeof(v));
|
||||
memset(&v, 0, sizeof(v));
|
||||
|
||||
for ( i = 0; i < pm->n_paths; i++ ) {
|
||||
mp = &pm->paths[i];
|
||||
@@ -6230,10 +6208,10 @@ void render_all_subsys_paths(object *objp)
|
||||
vm_vec_unrotate(&global_path_point, &mp->verts[j].pos, &objp->orient);
|
||||
vm_vec_add2(&global_path_point, &objp->pos);
|
||||
g3_rotate_vertex(&v, &global_path_point);
|
||||
color = 255 - j*50;
|
||||
if ( color < 50 )
|
||||
color = 100;
|
||||
gr_set_color(0, color, 0);
|
||||
clr = 255 - j*50;
|
||||
if ( clr < 50 )
|
||||
clr = 100;
|
||||
gr_set_color(0, clr, 0);
|
||||
|
||||
if ( j == mp->nverts-1 ) {
|
||||
gr_set_color(255, 0, 0);
|
||||
@@ -6267,10 +6245,9 @@ void render_path_points(object *objp)
|
||||
vec3d dock_point, global_dock_point;
|
||||
vertex v;
|
||||
|
||||
ship_model_start(&Objects[aip->goal_objnum]);
|
||||
if (pm->n_docks) {
|
||||
dock_point = pm->docking_bays[0].pnt[0];
|
||||
model_find_world_point(&global_dock_point, &dock_point, pm->id, 0, &dobjp->orient, &dobjp->pos );
|
||||
model_instance_find_world_point(&global_dock_point, &dock_point, shipp->model_instance_num, 0, &dobjp->orient, &dobjp->pos );
|
||||
g3_rotate_vertex(&v, &global_dock_point);
|
||||
gr_set_color(255, 255, 255);
|
||||
g3_draw_sphere( &v, 1.5f);
|
||||
@@ -6303,8 +6280,6 @@ void render_path_points(object *objp)
|
||||
pp++;
|
||||
}
|
||||
}
|
||||
|
||||
ship_model_stop(&Objects[aip->goal_objnum]);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -6510,7 +6485,7 @@ void set_predicted_enemy_pos(vec3d *predicted_enemy_pos, object *pobjp, vec3d *e
|
||||
vec3d temp;
|
||||
vm_vec_sub(&temp, enemy_pos, &pobjp->pos);
|
||||
vm_vec_normalize_quick(&temp);
|
||||
float dot = vm_vec_dotprod(&temp, &pobjp->orient.vec.fvec);
|
||||
float dot = vm_vec_dot(&temp, &pobjp->orient.vec.fvec);
|
||||
float st_err = 3.0f * (1.4f - dot) * (1.0f + dist / (get_skill_stealth_dist_scaler() * STEALTH_MAX_VIEW_DIST)) * (1 - aip->ai_accuracy);
|
||||
scale += st_err;
|
||||
}
|
||||
@@ -6777,11 +6752,10 @@ void attack_set_accel(ai_info *aip, ship_info *sip, float dist_to_enemy, float d
|
||||
void get_behind_ship(ai_info *aip, ship_info *sip, float dist_to_enemy)
|
||||
{
|
||||
vec3d new_pos;
|
||||
float dot;
|
||||
float dot;
|
||||
vec3d vec_from_enemy;
|
||||
float dist;
|
||||
|
||||
dist = vm_vec_normalized_dir(&vec_from_enemy, &Pl_objp->pos, &En_objp->pos);
|
||||
vm_vec_normalized_dir(&vec_from_enemy, &Pl_objp->pos, &En_objp->pos);
|
||||
|
||||
vm_vec_scale_add(&new_pos, &En_objp->pos, &En_objp->orient.vec.fvec, -100.0f); // Pick point 100 units behind.
|
||||
ai_turn_towards_vector(&new_pos, Pl_objp, flFrametime, sip->srotation_time, NULL, NULL, 0.0f, 0);
|
||||
@@ -7071,7 +7045,7 @@ void ai_stealth_find()
|
||||
// if dist is near max and dot is close to 1, accel, afterburn
|
||||
vm_vec_sub(&vec_to_enemy, &new_pos, &Pl_objp->pos);
|
||||
dist_to_enemy = vm_vec_normalize_quick(&vec_to_enemy);
|
||||
dot_to_enemy = vm_vec_dotprod(&vec_to_enemy, &Pl_objp->orient.vec.fvec);
|
||||
dot_to_enemy = vm_vec_dot(&vec_to_enemy, &Pl_objp->orient.vec.fvec);
|
||||
|
||||
// if i think i should see him ahead and i don't, set goal pos and turn around, but only if I haven't seen him for a while
|
||||
if ( (delta_time > 800) && (aip->submode_parm0 == SM_SF_AHEAD) && (dot_to_enemy > .94) && (dist_to_enemy < get_skill_stealth_dist_scaler()*STEALTH_MAX_VIEW_DIST + 50) ) {
|
||||
@@ -7080,7 +7054,7 @@ void ai_stealth_find()
|
||||
aip->submode_parm0 = SM_SF_BEHIND;
|
||||
vm_vec_sub(&vec_to_enemy, &new_pos, &Pl_objp->pos);
|
||||
dist_to_enemy = vm_vec_normalize_quick(&vec_to_enemy);
|
||||
dot_to_enemy = vm_vec_dotprod(&vec_to_enemy, &Pl_objp->orient.vec.fvec);
|
||||
dot_to_enemy = vm_vec_dot(&vec_to_enemy, &Pl_objp->orient.vec.fvec);
|
||||
}
|
||||
|
||||
if ( (dist_to_enemy > get_skill_stealth_dist_scaler()*STEALTH_MAX_VIEW_DIST) && (dot_to_enemy > 0.94f) ) { // 20 degree half angle
|
||||
@@ -7110,7 +7084,7 @@ void ai_stealth_find()
|
||||
ai_turn_towards_vector(&new_pos, Pl_objp, flFrametime, sip->srotation_time, NULL, NULL, 0.0f, 0);
|
||||
}
|
||||
|
||||
dot_from_enemy = -vm_vec_dotprod(&vec_to_enemy, &En_objp->orient.vec.fvec);
|
||||
dot_from_enemy = -vm_vec_dot(&vec_to_enemy, &En_objp->orient.vec.fvec);
|
||||
|
||||
attack_set_accel(aip, sip, dist_to_enemy, dot_to_enemy, dot_from_enemy);
|
||||
}
|
||||
@@ -7159,10 +7133,10 @@ void ai_stealth_sweep()
|
||||
}
|
||||
|
||||
// get "right" vector for box
|
||||
vm_vec_crossprod(&right, &aip->stealth_velocity, &vmd_y_vector);
|
||||
vm_vec_cross(&right, &aip->stealth_velocity, &vmd_y_vector);
|
||||
|
||||
if ( vm_vec_mag_quick(&right) < 0.01 ) {
|
||||
vm_vec_crossprod(&right, &aip->stealth_velocity, &vmd_z_vector);
|
||||
vm_vec_cross(&right, &aip->stealth_velocity, &vmd_z_vector);
|
||||
}
|
||||
|
||||
vm_vec_normalize_quick(&right);
|
||||
@@ -7171,7 +7145,7 @@ void ai_stealth_sweep()
|
||||
vm_vec_copy_normalize_quick(&forward, &aip->stealth_velocity);
|
||||
|
||||
// get "up" for box
|
||||
vm_vec_crossprod(&up, &forward, &right);
|
||||
vm_vec_cross(&up, &forward, &right);
|
||||
|
||||
// lost far away ahead (do box)
|
||||
switch(aip->submode_parm0) {
|
||||
@@ -7241,7 +7215,7 @@ void ai_stealth_sweep()
|
||||
if (dist_to_goal < 100) {
|
||||
vec3d vec_to_goal;
|
||||
vm_vec_normalized_dir(&vec_to_goal, &goal_pt, &Pl_objp->pos);
|
||||
dot = vm_vec_dotprod(&vec_to_goal, &Pl_objp->orient.vec.fvec);
|
||||
dot = vm_vec_dot(&vec_to_goal, &Pl_objp->orient.vec.fvec);
|
||||
}
|
||||
|
||||
accelerate_ship(aip, 0.8f*dot);
|
||||
@@ -7887,7 +7861,7 @@ void ai_chase_big_get_separations(object *attack_objp, object *target_objp, vec3
|
||||
vm_vec_sub(&vec_to_target, &attack_objp->pos, &target_objp->pos);
|
||||
|
||||
// find the distance between centers along forward direction of ships
|
||||
perp_dist = vm_vec_dotprod(&vec_to_target, &target_objp->orient.vec.fvec);
|
||||
perp_dist = vm_vec_dot(&vec_to_target, &target_objp->orient.vec.fvec);
|
||||
|
||||
// subtract off perp component to get "horizontal" separation vector between cylinders [ASSUMING parallel]
|
||||
vm_vec_scale_add(horz_vec_to_target, &vec_to_target, &target_objp->orient.vec.fvec, -perp_dist);
|
||||
@@ -7918,7 +7892,7 @@ void ai_chase_big_parallel_set_goal(vec3d *goal_pos, object *attack_objp, object
|
||||
r_target = MAX(temp, r_target);
|
||||
|
||||
// are we opposing (only when other ship is not moving)
|
||||
opposing = ( vm_vec_dotprod(&attack_objp->orient.vec.fvec, &target_objp->orient.vec.fvec) < 0 );
|
||||
opposing = ( vm_vec_dot(&attack_objp->orient.vec.fvec, &target_objp->orient.vec.fvec) < 0 );
|
||||
|
||||
ai_chase_big_get_separations(attack_objp, target_objp, &horz_vec_to_target, &optimal_separation, &separation);
|
||||
|
||||
@@ -7936,7 +7910,7 @@ void ai_chase_big_parallel_set_goal(vec3d *goal_pos, object *attack_objp, object
|
||||
// find the distance between centers along forward direction of ships
|
||||
vec3d vec_to_target;
|
||||
vm_vec_sub(&vec_to_target, &target_objp->pos, &attack_objp->pos);
|
||||
float perp_dist = vm_vec_dotprod(&vec_to_target, &target_objp->orient.vec.fvec);
|
||||
float perp_dist = vm_vec_dot(&vec_to_target, &target_objp->orient.vec.fvec);
|
||||
|
||||
float match_accel = 0.0f;
|
||||
float length_scale = attack_objp->radius;
|
||||
@@ -8025,10 +7999,6 @@ void ai_cruiser_chase()
|
||||
return;
|
||||
}
|
||||
|
||||
ship *eshipp;
|
||||
|
||||
eshipp = &Ships[En_objp->instance];
|
||||
|
||||
vec3d goal_pos;
|
||||
float turn_time = Ship_info[Ships[Pl_objp->instance].ship_info_index].srotation_time;
|
||||
|
||||
@@ -8090,7 +8060,7 @@ void ai_cruiser_chase()
|
||||
// moving
|
||||
if (moving) {
|
||||
// if within 90 degrees of en forward, go into parallel, otherwise circle
|
||||
if ( vm_vec_dotprod(&En_objp->orient.vec.fvec, &Pl_objp->orient.vec.fvec) > 0 ) {
|
||||
if ( vm_vec_dot(&En_objp->orient.vec.fvec, &Pl_objp->orient.vec.fvec) > 0 ) {
|
||||
aip->submode = SM_BIG_PARALLEL;
|
||||
aip->submode_start_time = Missiontime;
|
||||
}
|
||||
@@ -8110,9 +8080,9 @@ void ai_cruiser_chase()
|
||||
vec3d temp;
|
||||
float desired_sep, cur_sep;
|
||||
// we're behind the enemy ship
|
||||
if (vm_vec_dotprod(&vec_to_enemy, &En_objp->orient.vec.fvec) > 0) {
|
||||
if (vm_vec_dot(&vec_to_enemy, &En_objp->orient.vec.fvec) > 0) {
|
||||
// and we're turning toward the enemy
|
||||
if (vm_vec_dotprod(&En_objp->orient.vec.fvec, &Pl_objp->orient.vec.fvec) > 0) {
|
||||
if (vm_vec_dot(&En_objp->orient.vec.fvec, &Pl_objp->orient.vec.fvec) > 0) {
|
||||
// get separation
|
||||
ai_chase_big_get_separations(Pl_objp, En_objp, &temp, &desired_sep, &cur_sep);
|
||||
// and the separation is > 0.9 desired
|
||||
@@ -8127,9 +8097,9 @@ void ai_cruiser_chase()
|
||||
vec3d temp;
|
||||
float desired_sep, cur_sep;
|
||||
// we're behind the enemy ship
|
||||
if (vm_vec_dotprod(&vec_to_enemy, &En_objp->orient.vec.fvec) > 0) {
|
||||
if (vm_vec_dot(&vec_to_enemy, &En_objp->orient.vec.fvec) > 0) {
|
||||
// and we're turning toward the enemy
|
||||
if (vm_vec_dotprod(&En_objp->orient.vec.fvec, &Pl_objp->orient.vec.fvec) > 0) {
|
||||
if (vm_vec_dot(&En_objp->orient.vec.fvec, &Pl_objp->orient.vec.fvec) > 0) {
|
||||
// get separation
|
||||
ai_chase_big_get_separations(Pl_objp, En_objp, &temp, &desired_sep, &cur_sep);
|
||||
// and the separation is > 0.9 desired
|
||||
@@ -8142,7 +8112,7 @@ void ai_cruiser_chase()
|
||||
// in front of ship
|
||||
else {
|
||||
// and we're turning toward the enemy
|
||||
if (vm_vec_dotprod(&En_objp->orient.vec.fvec, &Pl_objp->orient.vec.fvec) < 0) {
|
||||
if (vm_vec_dot(&En_objp->orient.vec.fvec, &Pl_objp->orient.vec.fvec) < 0) {
|
||||
// get separation
|
||||
ai_chase_big_get_separations(Pl_objp, En_objp, &temp, &desired_sep, &cur_sep);
|
||||
// and the separation is > 0.9 desired
|
||||
@@ -8157,7 +8127,7 @@ void ai_cruiser_chase()
|
||||
|
||||
case SM_BIG_PARALLEL:
|
||||
// we're opposing
|
||||
if ( vm_vec_dotprod(&Pl_objp->orient.vec.fvec, &En_objp->orient.vec.fvec) < 0 ) {
|
||||
if ( vm_vec_dot(&Pl_objp->orient.vec.fvec, &En_objp->orient.vec.fvec) < 0 ) {
|
||||
// and the other ship is moving
|
||||
if (moving) {
|
||||
// and we no longer overlap
|
||||
@@ -8177,7 +8147,7 @@ void ai_cruiser_chase()
|
||||
*/
|
||||
void ai_chase()
|
||||
{
|
||||
float dist_to_enemy, time_to_enemy;
|
||||
float dist_to_enemy;
|
||||
float dot_to_enemy, dot_from_enemy, real_dot_to_enemy;
|
||||
vec3d player_pos, enemy_pos, predicted_enemy_pos, real_vec_to_enemy, predicted_vec_to_enemy;
|
||||
ship *shipp = &Ships[Pl_objp->instance];
|
||||
@@ -8258,11 +8228,10 @@ void ai_chase()
|
||||
|
||||
ai_set_positions(Pl_objp, En_objp, aip, &player_pos, &enemy_pos);
|
||||
dist_to_enemy = vm_vec_dist_quick(&player_pos, &enemy_pos);
|
||||
time_to_enemy = compute_time_to_enemy(dist_to_enemy, Pl_objp, En_objp);
|
||||
vm_vec_sub(&real_vec_to_enemy, &enemy_pos, &player_pos);
|
||||
|
||||
//Enemy position for the purpose of aiming is already calculated differently, do it explicitly here
|
||||
ai_update_aim(aip, En_objp);
|
||||
ai_update_aim(aip);
|
||||
|
||||
vm_vec_normalize(&real_vec_to_enemy);
|
||||
|
||||
@@ -9016,7 +8985,7 @@ void set_goal_dock_orient(matrix *dom, vec3d *docker_p0, vec3d *docker_p1, vec3d
|
||||
|
||||
// Pre-multiply the orientation of the source object (docker_orient) by the transpose
|
||||
// of the docking bay's orientation, ie unrotate the source object's matrix.
|
||||
vm_transpose_matrix(&m2);
|
||||
vm_transpose(&m2);
|
||||
vm_matrix_x_matrix(dom, &m3, &m2);
|
||||
}
|
||||
|
||||
@@ -9060,8 +9029,9 @@ void find_adjusted_dockpoint_info(vec3d *global_p0, vec3d *global_p1, vec3d *glo
|
||||
{
|
||||
vec3d submodel_offset;
|
||||
vec3d local_p0, local_p1;
|
||||
ship *shipp;
|
||||
|
||||
ship_model_start(objp);
|
||||
shipp = &Ships[objp->instance];
|
||||
|
||||
// calculate the dockpoint locations relative to the unrotated submodel
|
||||
model_find_submodel_offset(&submodel_offset, modelnum, submodel);
|
||||
@@ -9069,13 +9039,11 @@ void find_adjusted_dockpoint_info(vec3d *global_p0, vec3d *global_p1, vec3d *glo
|
||||
vm_vec_sub(&local_p1, &pm->docking_bays[dock_index].pnt[1], &submodel_offset);
|
||||
|
||||
// find the dynamic positions of the dockpoints
|
||||
model_find_world_point(global_p0, &local_p0, modelnum, submodel, &objp->orient, &objp->pos);
|
||||
model_find_world_point(global_p1, &local_p1, modelnum, submodel, &objp->orient, &objp->pos);
|
||||
model_instance_find_world_point(global_p0, &local_p0, shipp->model_instance_num, submodel, &objp->orient, &objp->pos);
|
||||
model_instance_find_world_point(global_p1, &local_p1, shipp->model_instance_num, submodel, &objp->orient, &objp->pos);
|
||||
|
||||
// find the normal of the first dockpoint
|
||||
model_find_world_dir(global_p0_norm, &pm->docking_bays[dock_index].norm[0], modelnum, submodel, &objp->orient, &objp->pos);
|
||||
|
||||
ship_model_stop(objp);
|
||||
model_instance_find_world_dir(global_p0_norm, &pm->docking_bays[dock_index].norm[0], shipp->model_instance_num, submodel, &objp->orient);
|
||||
}
|
||||
// use the static dockpoints
|
||||
else
|
||||
@@ -9157,23 +9125,21 @@ float dock_orient_and_approach(object *docker_objp, int docker_index, object *do
|
||||
vec3d submodel_offset;
|
||||
vec3d dockpoint_temp;
|
||||
|
||||
ship_model_start(dockee_objp);
|
||||
|
||||
// get submodel center
|
||||
model_find_submodel_offset(&submodel_offset, sip1->model_num, dockee_rotating_submodel);
|
||||
vm_vec_add(&submodel_pos, &dockee_objp->pos, &submodel_offset);
|
||||
|
||||
polymodel_instance *pmi1 = model_get_instance(Ships[dockee_objp->instance].model_instance_num);
|
||||
|
||||
// get angular velocity of dockpoint
|
||||
//WMC - hack(?) to fix bug where sii might not exist
|
||||
if(pm1->submodel[dockee_rotating_submodel].sii != NULL) {
|
||||
submodel_omega = pm1->submodel[dockee_rotating_submodel].sii->cur_turn_rate;
|
||||
if ( pmi1->submodel[dockee_rotating_submodel].sii != NULL ) {
|
||||
submodel_omega = pmi1->submodel[dockee_rotating_submodel].sii->cur_turn_rate;
|
||||
}
|
||||
|
||||
// get radius to dockpoint
|
||||
vm_vec_avg(&dockpoint_temp, &dockee_p0, &dockee_p1);
|
||||
submodel_radius = vm_vec_dist(&submodel_pos, &dockpoint_temp);
|
||||
|
||||
ship_model_stop(dockee_objp);
|
||||
}
|
||||
|
||||
// Goober5000
|
||||
@@ -9281,7 +9247,7 @@ float dock_orient_and_approach(object *docker_objp, int docker_index, object *do
|
||||
vec3d origin_docker_point, adjusted_docker_point, v_offset;
|
||||
|
||||
// find out the rotation matrix that will get us from the old to the new rotation
|
||||
vm_copy_transpose_matrix(&temp, &docker_objp->orient);
|
||||
vm_copy_transpose(&temp, &docker_objp->orient);
|
||||
vm_matrix_x_matrix(&m_offset, &temp, &dom);
|
||||
|
||||
// now find out the new docker point after being adjusted for the new orientation
|
||||
@@ -9821,7 +9787,7 @@ float get_cylinder_points(object *other_objp, object *cyl_objp, vec3d *axis_pt,
|
||||
// get point on axis and on cylinder
|
||||
// extended_cylinder_z is along extended cylinder
|
||||
// cylinder_z is capped within cylinder
|
||||
float extended_cylinder_z = vm_vec_dotprod(&r_sph, &cyl_objp->orient.vec.fvec);
|
||||
float extended_cylinder_z = vm_vec_dot(&r_sph, &cyl_objp->orient.vec.fvec);
|
||||
|
||||
// get pt on axis of extended cylinder
|
||||
vm_vec_scale_add(axis_pt, &cyl_objp->pos, &cyl_objp->orient.vec.fvec, extended_cylinder_z);
|
||||
@@ -9857,7 +9823,7 @@ void ai_big_guard()
|
||||
|
||||
// get position relative to cylinder of guard_objp
|
||||
extended_z = get_cylinder_points(Pl_objp, guard_objp, &axis_pt, &r_vec, &radius);
|
||||
vm_vec_crossprod(&theta_vec, &guard_objp->orient.vec.fvec, &r_vec);
|
||||
vm_vec_cross(&theta_vec, &guard_objp->orient.vec.fvec, &r_vec);
|
||||
|
||||
// half ships circle each way
|
||||
if (objval > 0.5f) {
|
||||
@@ -10728,7 +10694,6 @@ void ai_dock()
|
||||
// This mode means to follow the path until just before the end.
|
||||
case AIS_DOCK_1:
|
||||
{
|
||||
float dist;
|
||||
int r;
|
||||
|
||||
if ((r = maybe_dock_obstructed(Pl_objp, goal_objp, 1)) != -1) {
|
||||
@@ -10739,7 +10704,7 @@ void ai_dock()
|
||||
}
|
||||
} //else {
|
||||
{
|
||||
dist = ai_path();
|
||||
ai_path();
|
||||
|
||||
if (aip->path_cur-aip->path_start >= aip->path_length-1) { // If got this far, advance no matter what.
|
||||
aip->submode = AIS_DOCK_2;
|
||||
@@ -11870,9 +11835,8 @@ int ai_formation()
|
||||
} else {
|
||||
vec3d v2f2;
|
||||
float dot_to_f2;
|
||||
float dist_to_f2;
|
||||
|
||||
dist_to_f2 = vm_vec_normalized_dir(&v2f2, &future_goal_point_2, &Pl_objp->pos);
|
||||
vm_vec_normalized_dir(&v2f2, &future_goal_point_2, &Pl_objp->pos);
|
||||
dot_to_f2 = vm_vec_dot(&v2f2, &Pl_objp->orient.vec.fvec);
|
||||
|
||||
// Leader flying like a maniac. Don't try hard to form on wing.
|
||||
@@ -13446,7 +13410,7 @@ void ai_warp_out(object *objp)
|
||||
aip->submode_start_time = Missiontime;
|
||||
|
||||
// maybe recalculate collision pairs.
|
||||
if (ship_get_warpout_speed(objp) > ship_get_max_speed(shipp)) {
|
||||
if ((objp->flags & OF_COLLIDES) && (ship_get_warpout_speed(objp) > ship_get_max_speed(shipp))) {
|
||||
// recalculate collision pairs
|
||||
OBJ_RECALC_PAIRS(objp);
|
||||
}
|
||||
@@ -13684,7 +13648,7 @@ int aas_1(object *objp, ai_info *aip, vec3d *safe_pos)
|
||||
vec3d vec_from_exp;
|
||||
float dir = 1.0f;
|
||||
vm_vec_sub(&vec_from_exp, &objp->pos, &expected_pos);
|
||||
float dot = vm_vec_dotprod(&vec_from_exp, &weapon_objp->orient.vec.fvec);
|
||||
float dot = vm_vec_dot(&vec_from_exp, &weapon_objp->orient.vec.fvec);
|
||||
if (dot > -30) {
|
||||
// if we're already on the other side of the explosion, don't try to fly behind it
|
||||
dir = -1.0f;
|
||||
@@ -13848,18 +13812,22 @@ int ai_await_repair_frame(object *objp, ai_info *aip)
|
||||
// Maybe should only do this if they are preventing their wing from re-entering.
|
||||
void ai_maybe_self_destruct(object *objp, ai_info *aip)
|
||||
{
|
||||
Assertion(objp->type == OBJ_SHIP, "ai_maybe_self_destruct() can only be called with objects that are ships!");
|
||||
ship *shipp = &Ships[objp->instance];
|
||||
|
||||
// Some IFFs can be repaired, so no self-destruct.
|
||||
// In multiplayer, just don't self-destruct. I figured there would be a problem. -- MK, 3/19/98.
|
||||
if ((Iff_info[Ships[objp->instance].team].flags & IFFF_SUPPORT_ALLOWED) || (Game_mode & GM_MULTIPLAYER))
|
||||
if ((Iff_info[shipp->team].flags & IFFF_SUPPORT_ALLOWED) || (Game_mode & GM_MULTIPLAYER))
|
||||
return;
|
||||
|
||||
// Small ships in a wing blow themselves up after awhile if engine or weapons system has been destroyed.
|
||||
// Reason: Don't want them to prevent a re-emergence of the wing.
|
||||
// Note: Don't blow up if not in a wing for two reasons: One, won't affect re-emergence of waves and (1) disable the Dragon
|
||||
// mission would be broken.
|
||||
if ((Ship_info[Ships[objp->instance].ship_info_index].flags & SIF_SMALL_SHIP) && (Ships[objp->instance].wingnum != -1)) {
|
||||
if ((ship_get_subsystem_strength(&Ships[objp->instance], SUBSYSTEM_ENGINE) <= 0.0f) ||
|
||||
(ship_get_subsystem_strength(&Ships[objp->instance], SUBSYSTEM_WEAPONS) <= 0.0f)) {
|
||||
// Also, don't blow up the ship if it has a ship flag preventing this - Goober5000
|
||||
if ((Ship_info[shipp->ship_info_index].flags & SIF_SMALL_SHIP) && (shipp->wingnum >= 0) && !(shipp->flags2 & SF2_NO_DISABLED_SELF_DESTRUCT)) {
|
||||
if ((ship_get_subsystem_strength(shipp, SUBSYSTEM_ENGINE) <= 0.0f) ||
|
||||
(ship_get_subsystem_strength(shipp, SUBSYSTEM_WEAPONS) <= 0.0f)) {
|
||||
if (aip->self_destruct_timestamp < 0)
|
||||
aip->self_destruct_timestamp = timestamp(90 * 1000); // seconds until self-destruct
|
||||
} else {
|
||||
@@ -14131,7 +14099,7 @@ void ai_frame(int objnum)
|
||||
}
|
||||
|
||||
if ((En_objp != NULL) && (En_objp->pos.xyz.x == Pl_objp->pos.xyz.x) && (En_objp->pos.xyz.y == Pl_objp->pos.xyz.y) && (En_objp->pos.xyz.z == Pl_objp->pos.xyz.z)) {
|
||||
mprintf(("Warning: Object and its enemy have same position. Object #%i\n", OBJ_INDEX(Pl_objp)));
|
||||
mprintf(("Warning: Object and its enemy have same position. Object #" PTRDIFF_T_ARG "\n", OBJ_INDEX(Pl_objp)));
|
||||
En_objp = NULL;
|
||||
}
|
||||
|
||||
@@ -14910,7 +14878,7 @@ void big_ship_collide_recover_start(object *objp, object *big_objp, vec3d *colli
|
||||
|
||||
float max_lethality = 0.0f;
|
||||
|
||||
void ai_update_lethality(object *ship_obj, object *other_obj, float damage)
|
||||
void ai_update_lethality(object *pship_obj, object *other_obj, float damage)
|
||||
{
|
||||
// Goober5000 - stop any trickle-down errors from ship_do_damage
|
||||
Assert(other_obj);
|
||||
@@ -14919,8 +14887,8 @@ void ai_update_lethality(object *ship_obj, object *other_obj, float damage)
|
||||
return;
|
||||
}
|
||||
|
||||
Assert(ship_obj); // Goober5000
|
||||
Assert(ship_obj->type == OBJ_SHIP);
|
||||
Assert(pship_obj); // Goober5000
|
||||
Assert(pship_obj->type == OBJ_SHIP);
|
||||
Assert(other_obj->type == OBJ_WEAPON || other_obj->type == OBJ_SHOCKWAVE);
|
||||
int dont_count = FALSE;
|
||||
|
||||
@@ -14929,7 +14897,7 @@ void ai_update_lethality(object *ship_obj, object *other_obj, float damage)
|
||||
if (Objects[parent].signature == other_obj->parent_sig) {
|
||||
|
||||
// check damage done to enemy team
|
||||
if (iff_x_attacks_y(Ships[ship_obj->instance].team, Ships[Objects[parent].instance].team)) {
|
||||
if (iff_x_attacks_y(Ships[pship_obj->instance].team, Ships[Objects[parent].instance].team)) {
|
||||
|
||||
// other is weapon
|
||||
if (other_obj->type == OBJ_WEAPON) {
|
||||
|
||||
+18
-14
@@ -11,18 +11,18 @@
|
||||
|
||||
|
||||
#include "ai/aigoals.h"
|
||||
#include "parse/sexp.h"
|
||||
#include "globalincs/linklist.h"
|
||||
#include "mission/missionlog.h"
|
||||
#include "mission/missionparse.h"
|
||||
#include "object/object.h"
|
||||
#include "globalincs/linklist.h"
|
||||
#include "playerman/player.h"
|
||||
#include "network/multimsgs.h"
|
||||
#include "network/multi.h"
|
||||
#include "ship/ship.h"
|
||||
#include "weapon/weapon.h"
|
||||
#include "network/multimsgs.h"
|
||||
#include "object/object.h"
|
||||
#include "object/objectdock.h"
|
||||
#include "object/waypoint.h"
|
||||
#include "parse/sexp.h"
|
||||
#include "playerman/player.h"
|
||||
#include "ship/ship.h"
|
||||
#include "weapon/weapon.h"
|
||||
|
||||
|
||||
// all ai goals dealt with in this code are goals that are specified through
|
||||
@@ -199,12 +199,17 @@ void ai_post_process_mission()
|
||||
return;
|
||||
}
|
||||
|
||||
// function which determines is a goal is valid for a particular type of ship
|
||||
int ai_query_goal_valid( int ship, int ai_goal )
|
||||
/**
|
||||
* Determines if a goal is valid for a particular type of ship
|
||||
*
|
||||
* @param ship Ship type to test
|
||||
* @param ai_goal_type Goal type to test
|
||||
*/
|
||||
int ai_query_goal_valid( int ship, int ai_goal_type )
|
||||
{
|
||||
int accepted;
|
||||
|
||||
if (ai_goal == AI_GOAL_NONE)
|
||||
if (ai_goal_type == AI_GOAL_NONE)
|
||||
return 1; // anything can have no orders.
|
||||
|
||||
accepted = 0;
|
||||
@@ -214,7 +219,7 @@ int ai_query_goal_valid( int ship, int ai_goal )
|
||||
int ship_type = Ship_info[Ships[ship].ship_info_index].class_type;
|
||||
if(ship_type > -1)
|
||||
{
|
||||
if(ai_goal & Ship_types[ship_type].ai_valid_goals) {
|
||||
if(ai_goal_type & Ship_types[ship_type].ai_valid_goals) {
|
||||
accepted = 1;
|
||||
}
|
||||
}
|
||||
@@ -1883,9 +1888,8 @@ int ai_goal_priority_compare(const void *a, const void *b)
|
||||
// Prioritize goal list.
|
||||
// First sort on priority.
|
||||
// Then sort on time for goals of equivalent priority.
|
||||
// objnum The object number to act upon. Redundant with *aip.
|
||||
// *aip The AI info to act upon. Goals are stored at aip->goals
|
||||
void prioritize_goals(int objnum, ai_info *aip)
|
||||
void prioritize_goals(ai_info *aip)
|
||||
{
|
||||
// First sort based on priority field.
|
||||
insertion_sort(aip->goals, MAX_AI_GOALS, sizeof(ai_goal), ai_goal_priority_compare);
|
||||
@@ -2001,7 +2005,7 @@ void ai_process_mission_orders( int objnum, ai_info *aip )
|
||||
validate_mission_goals(objnum, aip);
|
||||
|
||||
// Sort the goal array by priority and other factors.
|
||||
prioritize_goals(objnum, aip);
|
||||
prioritize_goals(aip);
|
||||
|
||||
// Make sure there's a goal to pursue, else return.
|
||||
if (aip->goals[0].signature == -1) {
|
||||
|
||||
+1
-1
@@ -121,7 +121,7 @@ extern void ai_update_goal_references(ai_goal *goals, int type, const char *old_
|
||||
extern int query_referenced_in_ai_goals(ai_goal *goals, int type, const char *name);
|
||||
extern char *ai_add_dock_name(const char *str);
|
||||
|
||||
extern int ai_query_goal_valid( int ship, int ai_goal );
|
||||
extern int ai_query_goal_valid( int ship, int ai_goal_type );
|
||||
|
||||
extern void ai_add_goal_ship_internal( ai_info *aip, int goal_type, char *name, int docker_point, int dockee_point, int immediate = 1 );
|
||||
extern void ai_add_goal_wing_internal( wing *wingp, int goal_type, char *name, int immediate = 1 );
|
||||
|
||||
@@ -10,6 +10,9 @@
|
||||
#ifndef _AIINTERNAL_H
|
||||
#define _AIINTERNAL_H
|
||||
|
||||
#include "ship/ship.h"
|
||||
#include "weapon/weapon.h"
|
||||
|
||||
//Returns true if the specified object is a stealth ship, false if not
|
||||
bool is_object_stealth_ship(object* objp);
|
||||
|
||||
|
||||
@@ -1,16 +0,0 @@
|
||||
/*
|
||||
* 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 _AILOCAL_H
|
||||
#define _AILOCAL_H
|
||||
|
||||
// -- Don't put anything in here --
|
||||
// Put it in ai.h!
|
||||
|
||||
#endif
|
||||
+194
-28
@@ -1,28 +1,28 @@
|
||||
|
||||
|
||||
#include "globalincs/systemvars.h"
|
||||
#include "ship/ship.h"
|
||||
#include "weapon/weapon.h"
|
||||
#include "freespace2/freespace.h"
|
||||
#include "ai/aibig.h"
|
||||
#include "ai/aiinternal.h"
|
||||
#include "asteroid/asteroid.h"
|
||||
#include "globalincs/linklist.h"
|
||||
#include "weapon/beam.h"
|
||||
#include "weapon/swarm.h"
|
||||
#include "io/timer.h"
|
||||
#include "render/3d.h"
|
||||
#include "debugconsole/console.h"
|
||||
#include "freespace2/freespace.h"
|
||||
#include "gamesnd/gamesnd.h"
|
||||
#include "ship/shipfx.h"
|
||||
#include "network/multimsgs.h"
|
||||
#include "weapon/flak.h"
|
||||
#include "globalincs/linklist.h"
|
||||
#include "globalincs/systemvars.h"
|
||||
#include "iff_defs/iff_defs.h"
|
||||
#include "io/timer.h"
|
||||
#include "math/staticrand.h"
|
||||
#include "network/multi.h"
|
||||
#include "ai/aibig.h"
|
||||
#include "network/multimsgs.h"
|
||||
#include "object/objectdock.h"
|
||||
#include "ai/aiinternal.h" //Included last, so less includes are needed
|
||||
#include "iff_defs/iff_defs.h"
|
||||
#include "weapon/muzzleflash.h"
|
||||
#include "parse/scripting.h"
|
||||
#include "debugconsole/console.h"
|
||||
#include "render/3d.h"
|
||||
#include "ship/ship.h"
|
||||
#include "ship/shipfx.h"
|
||||
#include "weapon/beam.h"
|
||||
#include "weapon/flak.h"
|
||||
#include "weapon/muzzleflash.h"
|
||||
#include "weapon/swarm.h"
|
||||
#include "weapon/weapon.h"
|
||||
|
||||
#include <limits.h>
|
||||
|
||||
@@ -1308,6 +1308,8 @@ void ship_get_global_turret_info(object *objp, model_subsystem *tp, vec3d *gpos,
|
||||
vm_vec_unrotate(gvec, &tp->turret_norm, &objp->orient);
|
||||
}
|
||||
|
||||
void turret_ai_update_aim(ai_info *aip, object *En_Objp, ship_subsys *ss);
|
||||
|
||||
/**
|
||||
* Given an object and a turret on that object, return the actual firing point of the gun and its normal.
|
||||
*
|
||||
@@ -1332,11 +1334,59 @@ void ship_get_global_turret_gun_info(object *objp, ship_subsys *ssp, vec3d *gpos
|
||||
gun_pos = &tp->turret_firing_point[ssp->turret_next_fire_pos % tp->turret_num_firing_points];
|
||||
|
||||
//model_find_world_point(gpos, gun_pos, tp->model_num, tp->turret_gun_sobj, &objp->orient, &objp->pos );
|
||||
model_instance_find_world_point(gpos, gun_pos, tp->model_num, Ships[objp->instance].model_instance_num, tp->turret_gun_sobj, &objp->orient, &objp->pos);
|
||||
model_instance_find_world_point(gpos, gun_pos, Ships[objp->instance].model_instance_num, tp->turret_gun_sobj, &objp->orient, &objp->pos);
|
||||
|
||||
if (use_angles)
|
||||
model_instance_find_world_dir(gvec, &tp->turret_norm, tp->model_num, Ships[objp->instance].model_instance_num, tp->turret_gun_sobj, &objp->orient, &objp->pos );
|
||||
else {
|
||||
if (use_angles) {
|
||||
model_instance_find_world_dir(gvec, &tp->turret_norm, Ships[objp->instance].model_instance_num, tp->turret_gun_sobj, &objp->orient);
|
||||
} else if (tp->flags2 & MSS_FLAG2_SHARE_FIRE_DIRECTION) {
|
||||
vec3d avg, tmp_pos, tmp_target, enemy_point, turret_norm;
|
||||
vm_vec_avg_n(&avg, tp->turret_num_firing_points, tp->turret_firing_point);
|
||||
|
||||
model_instance_find_world_point(&tmp_pos, &avg, Ships[objp->instance].model_instance_num, tp->turret_gun_sobj, &objp->orient, &objp->pos);
|
||||
|
||||
if (targetp == nullptr) {
|
||||
Assertion(ssp->turret_enemy_objnum >= 0, "The turret enemy object number %d for %s on ship number %d is invalid.", ssp->turret_enemy_objnum, ssp->sub_name, ssp->parent_objnum);
|
||||
object *lep = &Objects[ssp->turret_enemy_objnum];
|
||||
|
||||
int best_weapon_tidx = turret_select_best_weapon(ssp, lep);
|
||||
|
||||
//This turret doesn't have any good weapons
|
||||
if (best_weapon_tidx < 0)
|
||||
return;
|
||||
|
||||
weapon_info *wip = get_turret_weapon_wip(&ssp->weapons, best_weapon_tidx);
|
||||
|
||||
float weapon_system_strength = ship_get_subsystem_strength(&Ships[ssp->parent_objnum], SUBSYSTEM_WEAPONS);
|
||||
|
||||
turret_ai_update_aim(&Ai_info[Ships[ssp->parent_objnum].ai_index], &Objects[ssp->turret_enemy_objnum], ssp);
|
||||
|
||||
if ((ssp->targeted_subsys != nullptr) && !(ssp->flags & SSF_NO_SS_TARGETING)) {
|
||||
vm_vec_unrotate(&enemy_point, &ssp->targeted_subsys->system_info->pnt, &Objects[ssp->turret_enemy_objnum].orient);
|
||||
vm_vec_add2(&enemy_point, &ssp->last_aim_enemy_pos);
|
||||
} else {
|
||||
if ((lep->type == OBJ_SHIP) && (Ship_info[Ships[lep->instance].ship_info_index].flags & (SIF_BIG_SHIP | SIF_HUGE_SHIP))) {
|
||||
vm_vec_unrotate(&turret_norm, &tp->turret_norm, &objp->orient);
|
||||
ai_big_pick_attack_point_turret(lep, ssp, &tmp_pos, &turret_norm, &enemy_point, MIN(wip->max_speed * wip->lifetime, wip->weapon_range), tp->turret_fov);
|
||||
}
|
||||
else {
|
||||
enemy_point = ssp->last_aim_enemy_pos;
|
||||
}
|
||||
}
|
||||
|
||||
vec3d target_moving_direction = ssp->last_aim_enemy_vel;
|
||||
|
||||
//Try to guess where the enemy will be, and store that spot in predicted_enemy_pos
|
||||
if (The_mission.ai_profile->flags & AIPF_USE_ADDITIVE_WEAPON_VELOCITY) {
|
||||
vm_vec_scale_sub2(&target_moving_direction, &objp->phys_info.vel, wip->vel_inherit_amount);
|
||||
}
|
||||
|
||||
set_predicted_enemy_pos_turret(&tmp_target, &tmp_pos, objp, &enemy_point, &target_moving_direction, wip->max_speed, ssp->turret_time_enemy_in_range * (weapon_system_strength + 1.0f) / 2.0f);
|
||||
} else {
|
||||
tmp_target = *targetp;
|
||||
}
|
||||
|
||||
vm_vec_normalized_dir(gvec, &tmp_target, &tmp_pos);
|
||||
} else {
|
||||
//vector gun_pos2;
|
||||
//vm_vec_add(&gun_pos2, gpos, gun_pos);
|
||||
vm_vec_normalized_dir(gvec, targetp, gpos);
|
||||
@@ -1377,7 +1427,7 @@ void turret_ai_update_aim(ai_info *aip, object *En_Objp, ship_subsys *ss)
|
||||
*/
|
||||
int aifft_rotate_turret(ship *shipp, int parent_objnum, ship_subsys *ss, object *objp, object *lep, vec3d *predicted_enemy_pos, vec3d *gvec)
|
||||
{
|
||||
int ret_val __attribute__((__unused__)) = 0; // to be used in future, see comment @ end of function
|
||||
int ret_val __UNUSED = 0; // to be used in future, see comment @ end of function
|
||||
|
||||
if (ss->turret_enemy_objnum != -1) {
|
||||
model_subsystem *tp = ss->system_info;
|
||||
@@ -1870,21 +1920,129 @@ bool turret_fire_weapon(int weapon_num, ship_subsys *turret, int parent_objnum,
|
||||
fire_info.turret = turret;
|
||||
|
||||
// fire a beam weapon
|
||||
beam_fire(&fire_info);
|
||||
weapon_objnum = beam_fire(&fire_info);
|
||||
|
||||
if (weapon_objnum != -1) {
|
||||
objp = &Objects[weapon_objnum];
|
||||
|
||||
parent_ship->last_fired_turret = turret;
|
||||
turret->last_fired_weapon_info_index = turret_weapon_class;
|
||||
|
||||
Script_system.SetHookObjects(4, "Ship", &Objects[parent_objnum], "Weapon", nullptr, "Beam", objp, "Target", &Objects[turret->turret_enemy_objnum]);
|
||||
Script_system.RunCondition(CHA_ONTURRETFIRED, 0, NULL, &Objects[parent_objnum]);
|
||||
Script_system.RemHookVars(4, "Ship", "Weapon", "Beam", "Target");
|
||||
}
|
||||
|
||||
turret->flags |= SSF_HAS_FIRED; //set fired flag for scripting -nike
|
||||
return true;
|
||||
}
|
||||
// don't fire swam, but set up swarm info instead
|
||||
else if ((wip->wi_flags & WIF_SWARM) || (wip->wi_flags & WIF_CORKSCREW)) {
|
||||
turret_swarm_set_up_info(parent_objnum, turret, wip, turret->turret_next_fire_pos);
|
||||
ship_weapon *swp = &turret->weapons;
|
||||
if (swp->current_secondary_bank < 0) {
|
||||
swp->current_secondary_bank = 0;
|
||||
}
|
||||
int bank_to_fire = swp->current_secondary_bank;
|
||||
if ((turret->system_info->flags2 & MSS_FLAG2_TURRET_USE_AMMO) && (swp->secondary_bank_ammo[bank_to_fire] < 0)) {
|
||||
if (!(turret->system_info->flags & MSS_FLAG_USE_MULTIPLE_GUNS)) {
|
||||
swp->current_secondary_bank++;
|
||||
if (swp->current_secondary_bank >= swp->num_secondary_banks) {
|
||||
swp->current_secondary_bank = 0;
|
||||
}
|
||||
return false;
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
} else {
|
||||
turret_swarm_set_up_info(parent_objnum, turret, wip, turret->turret_next_fire_pos);
|
||||
|
||||
turret->flags |= SSF_HAS_FIRED; //set fired flag for scripting -nike
|
||||
return true;
|
||||
turret->flags |= SSF_HAS_FIRED; //set fired flag for scripting -nike
|
||||
return true;
|
||||
}
|
||||
}
|
||||
// now do anything else
|
||||
else {
|
||||
for (int i = 0; i < wip->shots; i++) {
|
||||
if (turret->system_info->flags2 & MSS_FLAG2_TURRET_USE_AMMO) {
|
||||
ship_weapon *swp;
|
||||
swp = &turret->weapons;
|
||||
int bank_to_fire, num_slots = turret->system_info->turret_num_firing_points;
|
||||
if (wip->subtype == WP_LASER) {
|
||||
int points;
|
||||
if (swp->num_primary_banks <= 0) {
|
||||
return false;
|
||||
}
|
||||
|
||||
if (swp->current_primary_bank < 0){
|
||||
swp->current_primary_bank = 0;
|
||||
return false;
|
||||
}
|
||||
|
||||
int num_primary_banks = swp->num_primary_banks;
|
||||
|
||||
Assert(num_primary_banks > 0);
|
||||
if (num_primary_banks < 1){
|
||||
return false;
|
||||
}
|
||||
|
||||
bank_to_fire = swp->current_primary_bank;
|
||||
|
||||
if (turret->system_info->flags & MSS_FLAG_TURRET_SALVO) {
|
||||
points = num_slots;
|
||||
} else {
|
||||
points = 1;
|
||||
}
|
||||
|
||||
if (swp->primary_bank_ammo[bank_to_fire] >= 0) {
|
||||
swp->primary_bank_ammo[bank_to_fire] -= points;
|
||||
} else if (!(turret->system_info->flags & MSS_FLAG_USE_MULTIPLE_GUNS) && (swp->primary_bank_ammo[bank_to_fire] < 0)) {
|
||||
swp->current_primary_bank++;
|
||||
if (swp->current_primary_bank >= swp->num_primary_banks) {
|
||||
swp->current_primary_bank = 0;
|
||||
}
|
||||
return false;
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
else if (wip->subtype == WP_MISSILE) {
|
||||
if (swp->num_secondary_banks <= 0) {
|
||||
return false;
|
||||
}
|
||||
|
||||
if (swp->current_secondary_bank < 0){
|
||||
swp->current_secondary_bank = 0;
|
||||
return false;
|
||||
}
|
||||
|
||||
bank_to_fire = swp->current_secondary_bank;
|
||||
|
||||
int start_slot, end_slot;
|
||||
|
||||
start_slot = swp->secondary_next_slot[bank_to_fire];
|
||||
end_slot = start_slot;
|
||||
|
||||
for (int j = start_slot; j <= end_slot; j++) {
|
||||
swp->secondary_next_slot[bank_to_fire]++;
|
||||
|
||||
if (swp->secondary_next_slot[bank_to_fire] > (num_slots - 1)){
|
||||
swp->secondary_next_slot[bank_to_fire] = 0;
|
||||
}
|
||||
|
||||
if (swp->secondary_bank_ammo[bank_to_fire] >= 0) {
|
||||
swp->secondary_bank_ammo[bank_to_fire]--;
|
||||
} else if (!(turret->system_info->flags & MSS_FLAG_USE_MULTIPLE_GUNS) && (swp->secondary_bank_ammo[bank_to_fire] < 0)) {
|
||||
swp->current_secondary_bank++;
|
||||
if (swp->current_secondary_bank >= swp->num_secondary_banks) {
|
||||
swp->current_secondary_bank = 0;
|
||||
}
|
||||
return false;
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
// zookeeper - Firepoints should cycle normally between shots,
|
||||
// so we need to get the position info separately for each shot
|
||||
ship_get_global_turret_gun_info(&Objects[parent_objnum], turret, turret_pos, turret_fvec, 1, NULL);
|
||||
@@ -1905,8 +2063,9 @@ bool turret_fire_weapon(int weapon_num, ship_subsys *turret, int parent_objnum,
|
||||
// AL 1-6-97: Store pointer to turret subsystem
|
||||
wp->turret_subsys = turret;
|
||||
|
||||
Script_system.SetHookObjects(3, "Ship", &Objects[parent_objnum], "Weapon", objp, "Target", &Objects[turret->turret_enemy_objnum]);
|
||||
Script_system.SetHookObjects(4, "Ship", &Objects[parent_objnum], "Weapon", objp, "Beam", nullptr, "Target", &Objects[turret->turret_enemy_objnum]);
|
||||
Script_system.RunCondition(CHA_ONTURRETFIRED, 0, NULL, &Objects[parent_objnum]);
|
||||
Script_system.RemHookVars(4, "Ship", "Weapon", "Beam", "Target");
|
||||
|
||||
// if the gun is a flak gun
|
||||
if (wip->wi_flags & WIF_FLAK) {
|
||||
@@ -2018,6 +2177,13 @@ void turret_swarm_fire_from_turret(turret_swarm_info *tsi)
|
||||
Weapons[Objects[weapon_objnum].instance].turret_subsys = tsi->turret;
|
||||
Weapons[Objects[weapon_objnum].instance].target_num = tsi->turret->turret_enemy_objnum;
|
||||
|
||||
Ships[Objects[tsi->parent_objnum].instance].last_fired_turret = tsi->turret;
|
||||
tsi->turret->last_fired_weapon_info_index = tsi->weapon_class;
|
||||
|
||||
Script_system.SetHookObjects(4, "Ship", &Objects[tsi->parent_objnum], "Weapon", &Objects[weapon_objnum], "Beam", nullptr, "Target", &Objects[tsi->turret->turret_enemy_objnum]);
|
||||
Script_system.RunCondition(CHA_ONTURRETFIRED, 0, NULL, &Objects[tsi->parent_objnum]);
|
||||
Script_system.RemHookVars(4, "Ship", "Weapon", "Beam", "Target");
|
||||
|
||||
// muzzle flash?
|
||||
if (Weapon_info[tsi->weapon_class].muzzle_flash >= 0) {
|
||||
mflash_create(&turret_pos, &turret_fvec, &Objects[tsi->parent_objnum].phys_info, Weapon_info[tsi->weapon_class].muzzle_flash);
|
||||
@@ -2463,7 +2629,7 @@ void ai_fire_from_turret(ship *shipp, ship_subsys *ss, int parent_objnum)
|
||||
ss->turret_next_fire_pos = ffp_pos;
|
||||
}
|
||||
|
||||
ship_get_global_turret_gun_info(&Objects[parent_objnum], ss, &gpos, &gvec, use_angles, &predicted_enemy_pos);
|
||||
ship_get_global_turret_gun_info(&Objects[parent_objnum], ss, &gpos, &gvec, use_angles, &predicted_enemy_pos);
|
||||
|
||||
// Fire in the direction the turret is facing, not right at the target regardless of turret dir.
|
||||
vm_vec_sub(&v2e, &predicted_enemy_pos, &gpos);
|
||||
|
||||
+7
-10
@@ -10,15 +10,15 @@
|
||||
|
||||
|
||||
#include "anim/animplay.h"
|
||||
#include "globalincs/linklist.h"
|
||||
#include "io/timer.h"
|
||||
#include "bmpman/bmpman.h"
|
||||
#include "graphics/2d.h"
|
||||
#include "render/3d.h"
|
||||
#include "pcxutils/pcxutils.h"
|
||||
#include "anim/packunpack.h"
|
||||
#include "bmpman/bmpman.h"
|
||||
#include "cfile/cfile.h"
|
||||
#include "cmdline/cmdline.h"
|
||||
#include "globalincs/linklist.h"
|
||||
#include "graphics/2d.h"
|
||||
#include "io/timer.h"
|
||||
#include "pcxutils/pcxutils.h"
|
||||
#include "render/3d.h"
|
||||
|
||||
|
||||
|
||||
@@ -254,7 +254,7 @@ anim_instance *anim_play(anim_play_struct *aps)
|
||||
int anim_show_next_frame(anim_instance *instance, float frametime)
|
||||
{
|
||||
int bitmap_id, bitmap_flags=0, new_frame_num, frame_diff=0, i, n_frames=0,frame_save;
|
||||
float percent_through, decompress_time, render_time, time;
|
||||
float percent_through, time;
|
||||
vertex image_vertex;
|
||||
int aabitmap = 0;
|
||||
int bpp = 16;
|
||||
@@ -461,8 +461,6 @@ int anim_show_next_frame(anim_instance *instance, float frametime)
|
||||
instance->file_offset = instance->parent->file_offset;
|
||||
instance->loop_count++;
|
||||
}
|
||||
|
||||
decompress_time = f2fl(t2-t1);
|
||||
|
||||
t1 = timer_get_fixed_seconds();
|
||||
if ( frame_diff == 0 && instance->last_bitmap != -1 ) {
|
||||
@@ -514,7 +512,6 @@ int anim_show_next_frame(anim_instance *instance, float frametime)
|
||||
}
|
||||
|
||||
t2 = timer_get_fixed_seconds();
|
||||
render_time = f2fl(t2-t1);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -12,8 +12,8 @@
|
||||
#ifndef __ANIMPLAY_H__
|
||||
#define __ANIMPLAY_H__
|
||||
|
||||
#include "globalincs/pstypes.h"
|
||||
#include "cfile/cfile.h"
|
||||
#include "globalincs/pstypes.h"
|
||||
|
||||
struct anim;
|
||||
struct anim_info;
|
||||
|
||||
@@ -9,10 +9,10 @@
|
||||
|
||||
|
||||
|
||||
#include "anim/animplay.h"
|
||||
#include "anim/packunpack.h"
|
||||
#include "bmpman/bmpman.h"
|
||||
#include "graphics/2d.h"
|
||||
#include "anim/animplay.h"
|
||||
|
||||
|
||||
const int packer_code = PACKER_CODE;
|
||||
|
||||
+132
-99
@@ -10,39 +10,39 @@
|
||||
|
||||
|
||||
#include "asteroid/asteroid.h"
|
||||
#include "object/object.h"
|
||||
#include "object/objcollide.h"
|
||||
#include "freespace2/freespace.h"
|
||||
#include "io/timer.h"
|
||||
#include "render/3d.h"
|
||||
#include "debugconsole/console.h"
|
||||
#include "fireball/fireballs.h"
|
||||
#include "freespace2/freespace.h"
|
||||
#include "gamesnd/gamesnd.h"
|
||||
#include "particle/particle.h"
|
||||
#include "globalincs/compatibility.h"
|
||||
#include "globalincs/linklist.h"
|
||||
#include "globalincs/systemvars.h"
|
||||
#include "hud/hud.h"
|
||||
#include "hud/hudescort.h"
|
||||
#include "hud/hudgauges.h"
|
||||
#include "ship/shiphit.h"
|
||||
#include "math/staticrand.h"
|
||||
#include "globalincs/systemvars.h"
|
||||
#include "localization/localize.h"
|
||||
#include "stats/scoring.h"
|
||||
#include "hud/hudtarget.h"
|
||||
#include "weapon/weapon.h"
|
||||
#include "ship/ship.h"
|
||||
#include "parse/parselo.h"
|
||||
#include "iff_defs/iff_defs.h"
|
||||
#include "io/timer.h"
|
||||
#include "localization/localize.h"
|
||||
#include "math/staticrand.h"
|
||||
#include "math/vecmat.h"
|
||||
#include "model/model.h"
|
||||
#include "species_defs/species_defs.h"
|
||||
#include "iff_defs/iff_defs.h"
|
||||
#include "network/multiutil.h"
|
||||
#include "network/multimsgs.h"
|
||||
#include "network/multi.h"
|
||||
#include "network/multimsgs.h"
|
||||
#include "network/multiutil.h"
|
||||
#include "object/objcollide.h"
|
||||
#include "object/object.h"
|
||||
#include "parse/parselo.h"
|
||||
#include "parse/scripting.h"
|
||||
#include "debugconsole/console.h"
|
||||
#include "particle/particle.h"
|
||||
#include "render/3d.h"
|
||||
#include "ship/ship.h"
|
||||
#include "ship/shiphit.h"
|
||||
#include "species_defs/species_defs.h"
|
||||
#include "stats/scoring.h"
|
||||
#include "weapon/weapon.h"
|
||||
|
||||
#include <algorithm>
|
||||
#include "globalincs/compatibility.h"
|
||||
|
||||
#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
|
||||
@@ -329,6 +329,11 @@ object *asteroid_create(asteroid_field *asfieldp, int asteroid_type, int asteroi
|
||||
}
|
||||
|
||||
asp->objnum = objnum;
|
||||
asp->model_instance_num = -1;
|
||||
|
||||
if (model_get(asip->model_num[asteroid_subtype])->flags & PM_FLAG_HAS_INTRINSIC_ROTATE) {
|
||||
asp->model_instance_num = model_create_instance(false, asip->model_num[asteroid_subtype]);
|
||||
}
|
||||
|
||||
// Add to Asteroid_used_list
|
||||
asteroid_obj_list_add(objnum);
|
||||
@@ -828,10 +833,12 @@ void asteroid_delete( object * obj )
|
||||
|
||||
asp = &Asteroids[num];
|
||||
|
||||
Assert( Num_asteroids >= 0 );
|
||||
if (asp->model_instance_num >= 0)
|
||||
model_delete_instance(asp->model_instance_num);
|
||||
|
||||
asp->flags = 0;
|
||||
Num_asteroids--;
|
||||
Assert(Num_asteroids >= 0);
|
||||
|
||||
asteroid_obj_list_remove( obj );
|
||||
}
|
||||
@@ -898,7 +905,7 @@ void lerp(float *goal, float f1, float f2, float scale)
|
||||
*goal = (f2 - f1) * scale + f1;
|
||||
}
|
||||
|
||||
void asteroid_process_pre( object *objp, float frame_time)
|
||||
void asteroid_process_pre( object *objp )
|
||||
{
|
||||
if (Asteroids_enabled) {
|
||||
// Make vel chase desired_vel
|
||||
@@ -930,7 +937,7 @@ int asteroid_check_collision(object *pasteroid, object *other_obj, vec3d *hitpos
|
||||
if ( asteroid_hit_info == NULL ) {
|
||||
// asteroid weapon collision
|
||||
Assert( other_obj->type == OBJ_WEAPON );
|
||||
mc.model_instance_num = -1;
|
||||
mc.model_instance_num = Asteroids[num].model_instance_num;
|
||||
mc.model_num = Asteroid_info[Asteroids[num].asteroid_type].model_num[asteroid_subtype]; // Fill in the model to check
|
||||
model_clear_instance( mc.model_num );
|
||||
mc.orient = &pasteroid->orient; // The object's orient
|
||||
@@ -946,18 +953,18 @@ int asteroid_check_collision(object *pasteroid, object *other_obj, vec3d *hitpos
|
||||
}
|
||||
|
||||
// asteroid ship collision -- use asteroid_hit_info to calculate physics
|
||||
object *ship_obj = other_obj;
|
||||
Assert( ship_obj->type == OBJ_SHIP );
|
||||
object *pship_obj = other_obj;
|
||||
Assert( pship_obj->type == OBJ_SHIP );
|
||||
|
||||
object* heavy = asteroid_hit_info->heavy;
|
||||
object* light = asteroid_hit_info->light;
|
||||
object* lighter = asteroid_hit_info->light;
|
||||
object *heavy_obj = heavy;
|
||||
object *light_obj = light;
|
||||
object *light_obj = lighter;
|
||||
|
||||
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 );
|
||||
vm_vec_sub( &p0, &lighter->last_pos, &heavy->last_pos );
|
||||
vm_vec_sub( &p1, &lighter->pos, &heavy->pos );
|
||||
|
||||
mc.pos = &zero; // The object's position
|
||||
mc.p0 = &p0; // Point 1 of ray to check
|
||||
@@ -979,19 +986,19 @@ int asteroid_check_collision(object *pasteroid, object *other_obj, vec3d *hitpos
|
||||
// HACK - this applies to big ships warping in/out of asteroid fields - not sure what it does
|
||||
if (vm_vec_mag(&asteroid_hit_info->light_rel_vel) > 300) {
|
||||
asteroid_hit_info->collide_rotate = 0;
|
||||
vm_vec_sub( &asteroid_hit_info->light_rel_vel, &light->phys_info.vel, &heavy->phys_info.vel );
|
||||
vm_vec_sub( &asteroid_hit_info->light_rel_vel, &lighter->phys_info.vel, &heavy->phys_info.vel );
|
||||
}
|
||||
} else {
|
||||
asteroid_hit_info->collide_rotate = 0;
|
||||
vm_vec_sub( &asteroid_hit_info->light_rel_vel, &light->phys_info.vel, &heavy->phys_info.vel );
|
||||
vm_vec_sub( &asteroid_hit_info->light_rel_vel, &lighter->phys_info.vel, &heavy->phys_info.vel );
|
||||
}
|
||||
|
||||
int mc_ret_val = 0;
|
||||
|
||||
if ( asteroid_hit_info->heavy == ship_obj ) { // ship is heavier, so asteroid is sphere. Check sphere collision against ship poly model
|
||||
mc.model_instance_num = Ships[ship_obj->instance].model_instance_num;
|
||||
mc.model_num = Ship_info[Ships[ship_obj->instance].ship_info_index].model_num; // Fill in the model to check
|
||||
mc.orient = &ship_obj->orient; // The object's orient
|
||||
if ( asteroid_hit_info->heavy == pship_obj ) { // ship is heavier, so asteroid is sphere. Check sphere collision against ship poly model
|
||||
mc.model_instance_num = Ships[pship_obj->instance].model_instance_num;
|
||||
mc.model_num = Ship_info[Ships[pship_obj->instance].ship_info_index].model_num; // Fill in the model to check
|
||||
mc.orient = &pship_obj->orient; // The object's orient
|
||||
mc.radius = pasteroid->radius;
|
||||
mc.flags = (MC_CHECK_MODEL | MC_CHECK_SPHERELINE);
|
||||
|
||||
@@ -1005,7 +1012,6 @@ int asteroid_check_collision(object *pasteroid, object *other_obj, vec3d *hitpos
|
||||
mc.flags = MC_ONLY_SPHERE | MC_CHECK_SPHERELINE;
|
||||
|
||||
SCP_vector<int> submodel_vector;
|
||||
polymodel *pm;
|
||||
polymodel_instance *pmi;
|
||||
|
||||
if (model_collide(&mc)) {
|
||||
@@ -1019,8 +1025,7 @@ int asteroid_check_collision(object *pasteroid, object *other_obj, vec3d *hitpos
|
||||
model_get_rotating_submodel_list(&submodel_vector, heavy_obj);
|
||||
|
||||
// Get polymodel and turn off all rotating submodels, collide against only 1 at a time.
|
||||
pm = model_get(Ship_info[Ships[heavy_obj->instance].ship_info_index].model_num);
|
||||
pmi = model_get_instance(Ships[ship_obj->instance].model_instance_num);
|
||||
pmi = model_get_instance(Ships[heavy_obj->instance].model_instance_num);
|
||||
|
||||
// turn off all rotating submodels and test for collision
|
||||
for (size_t j=0; j<submodel_vector.size(); j++) {
|
||||
@@ -1041,10 +1046,10 @@ int asteroid_check_collision(object *pasteroid, object *other_obj, vec3d *hitpos
|
||||
|
||||
// find the start and end positions of the sphere in submodel RF
|
||||
pmi->submodel[submodel_vector[i]].angs = pmi->submodel[submodel_vector[i]].prev_angs;
|
||||
world_find_model_instance_point(&p0, &light_obj->last_pos, pm, pmi, submodel_vector[i], &heavy_obj->last_orient, &heavy_obj->last_pos);
|
||||
world_find_model_instance_point(&p0, &light_obj->last_pos, pmi, submodel_vector[i], &heavy_obj->last_orient, &heavy_obj->last_pos);
|
||||
|
||||
pmi->submodel[submodel_vector[i]].angs = copy_angles;
|
||||
world_find_model_instance_point(&p1, &light_obj->pos, pm, pmi, submodel_vector[i], &heavy_obj->orient, &heavy_obj->pos);
|
||||
world_find_model_instance_point(&p1, &light_obj->pos, pmi, submodel_vector[i], &heavy_obj->orient, &heavy_obj->pos);
|
||||
|
||||
mc.p0 = &p0;
|
||||
mc.p1 = &p1;
|
||||
@@ -1061,14 +1066,14 @@ int asteroid_check_collision(object *pasteroid, object *other_obj, vec3d *hitpos
|
||||
|
||||
// set up asteroid_hit_info for rotating submodel
|
||||
if (asteroid_hit_info->edge_hit == 0) {
|
||||
model_instance_find_obj_dir(&asteroid_hit_info->collision_normal, &mc.hit_normal, heavy_obj, mc.hit_submodel);
|
||||
model_instance_find_obj_dir(&asteroid_hit_info->collision_normal, &mc.hit_normal, Ships[heavy_obj->instance].model_instance_num, mc.hit_submodel, &heavy_obj->orient);
|
||||
}
|
||||
|
||||
// find position in submodel RF of light object at collison
|
||||
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_instance_find_world_point(&asteroid_hit_info->light_collision_cm_pos, &int_light_pos, mc.model_num, mc.model_instance_num, mc.hit_submodel, &heavy_obj->orient, &zero);
|
||||
model_instance_find_world_point(&asteroid_hit_info->light_collision_cm_pos, &int_light_pos, mc.model_instance_num, mc.hit_submodel, &heavy_obj->orient, &zero);
|
||||
}
|
||||
}
|
||||
// Don't look at this submodel again
|
||||
@@ -1093,7 +1098,7 @@ int asteroid_check_collision(object *pasteroid, object *other_obj, vec3d *hitpos
|
||||
|
||||
// get collision normal if not edge hit
|
||||
if (asteroid_hit_info->edge_hit == 0) {
|
||||
model_instance_find_obj_dir(&asteroid_hit_info->collision_normal, &mc.hit_normal, heavy_obj, mc.hit_submodel);
|
||||
model_instance_find_obj_dir(&asteroid_hit_info->collision_normal, &mc.hit_normal, Ships[heavy_obj->instance].model_instance_num, mc.hit_submodel, &heavy_obj->orient);
|
||||
}
|
||||
|
||||
// find position in submodel RF of light object at collison
|
||||
@@ -1107,11 +1112,11 @@ int asteroid_check_collision(object *pasteroid, object *other_obj, vec3d *hitpos
|
||||
|
||||
} else {
|
||||
// Asteroid is heavier obj
|
||||
mc.model_instance_num = -1;
|
||||
mc.model_instance_num = Asteroids[num].model_instance_num;
|
||||
mc.model_num = Asteroid_info[Asteroids[num].asteroid_type].model_num[asteroid_subtype]; // Fill in the model to check
|
||||
model_clear_instance( mc.model_num );
|
||||
mc.orient = &pasteroid->orient; // The object's orient
|
||||
mc.radius = model_get_core_radius(Ship_info[Ships[ship_obj->instance].ship_info_index].model_num);
|
||||
mc.radius = model_get_core_radius(Ship_info[Ships[pship_obj->instance].ship_info_index].model_num);
|
||||
|
||||
// check for collision between asteroid model and ship sphere
|
||||
mc.flags = (MC_CHECK_MODEL | MC_CHECK_SPHERELINE);
|
||||
@@ -1162,7 +1167,7 @@ int asteroid_check_collision(object *pasteroid, object *other_obj, vec3d *hitpos
|
||||
}
|
||||
}
|
||||
|
||||
void asteroid_render(object * obj)
|
||||
void asteroid_render_DEPRECATED(object * obj)
|
||||
{
|
||||
if (Asteroids_enabled) {
|
||||
int num;
|
||||
@@ -1176,7 +1181,32 @@ void asteroid_render(object * obj)
|
||||
Assert( asp->flags & AF_USED );
|
||||
|
||||
model_clear_instance( Asteroid_info[asp->asteroid_type].model_num[asp->asteroid_subtype]);
|
||||
model_render(Asteroid_info[asp->asteroid_type].model_num[asp->asteroid_subtype], &obj->orient, &obj->pos, MR_NORMAL|MR_IS_ASTEROID, OBJ_INDEX(obj) ); // Replace MR_NORMAL with 0x07 for big yellow blobs
|
||||
|
||||
model_render_DEPRECATED(Asteroid_info[asp->asteroid_type].model_num[asp->asteroid_subtype], &obj->orient, &obj->pos, MR_DEPRECATED_NORMAL|MR_DEPRECATED_IS_ASTEROID, OBJ_INDEX(obj) ); // Replace MR_NORMAL with 0x07 for big yellow blobs
|
||||
}
|
||||
}
|
||||
|
||||
void asteroid_render(object * obj, draw_list *scene)
|
||||
{
|
||||
if (Asteroids_enabled) {
|
||||
int num;
|
||||
asteroid *asp;
|
||||
|
||||
num = obj->instance;
|
||||
|
||||
Assert((num >= 0) && (num < MAX_ASTEROIDS));
|
||||
asp = &Asteroids[num];
|
||||
|
||||
Assert( asp->flags & AF_USED );
|
||||
|
||||
model_clear_instance( Asteroid_info[asp->asteroid_type].model_num[asp->asteroid_subtype]);
|
||||
|
||||
model_render_params render_info;
|
||||
|
||||
render_info.set_object_number( OBJ_INDEX(obj) );
|
||||
render_info.set_flags(MR_IS_ASTEROID);
|
||||
|
||||
model_render_queue(&render_info, scene, Asteroid_info[asp->asteroid_type].model_num[asp->asteroid_subtype], &obj->orient, &obj->pos); // Replace MR_NORMAL with 0x07 for big yellow blobs
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1330,42 +1360,42 @@ void asteroid_do_area_effect(object *asteroid_objp)
|
||||
/**
|
||||
* Upon asteroid asteroid_obj being hit. Apply damage and maybe make it break into smaller asteroids.
|
||||
*
|
||||
* @param asteroid_obj pointer to asteroid object getting hit
|
||||
* @param pasteroid_obj pointer to asteroid object getting hit
|
||||
* @param other_obj object that hit asteroid, can be NULL if asteroid hit by area effect
|
||||
* @param hitpos world position asteroid was hit, can be NULL if hit by area effect
|
||||
* @param damage amount of damage to apply to asteroid
|
||||
*/
|
||||
void asteroid_hit( object * asteroid_obj, object * other_obj, vec3d * hitpos, float damage )
|
||||
void asteroid_hit( object * pasteroid_obj, object * other_obj, vec3d * hitpos, float damage )
|
||||
{
|
||||
float explosion_life;
|
||||
asteroid *asp;
|
||||
|
||||
asp = &Asteroids[asteroid_obj->instance];
|
||||
asp = &Asteroids[pasteroid_obj->instance];
|
||||
|
||||
if (asteroid_obj->flags & OF_SHOULD_BE_DEAD){
|
||||
if (pasteroid_obj->flags & OF_SHOULD_BE_DEAD){
|
||||
return;
|
||||
}
|
||||
|
||||
if ( MULTIPLAYER_MASTER ){
|
||||
send_asteroid_hit( asteroid_obj, other_obj, hitpos, damage );
|
||||
send_asteroid_hit( pasteroid_obj, other_obj, hitpos, damage );
|
||||
}
|
||||
|
||||
asteroid_obj->hull_strength -= damage;
|
||||
pasteroid_obj->hull_strength -= damage;
|
||||
|
||||
if (asteroid_obj->hull_strength < 0.0f) {
|
||||
if (pasteroid_obj->hull_strength < 0.0f) {
|
||||
if ( asp->final_death_time <= 0 ) {
|
||||
int play_loud_collision = 0;
|
||||
|
||||
explosion_life = asteroid_create_explosion(asteroid_obj);
|
||||
explosion_life = asteroid_create_explosion(pasteroid_obj);
|
||||
|
||||
asteriod_explode_sound(asteroid_obj, asp->asteroid_type, play_loud_collision);
|
||||
asteroid_do_area_effect(asteroid_obj);
|
||||
asteriod_explode_sound(pasteroid_obj, asp->asteroid_type, play_loud_collision);
|
||||
asteroid_do_area_effect(pasteroid_obj);
|
||||
|
||||
asp->final_death_time = timestamp( fl2i(explosion_life*1000.0f)/5 ); // Wait till 30% of vclip time before breaking the asteroid up.
|
||||
if ( hitpos ) {
|
||||
asp->death_hit_pos = *hitpos;
|
||||
} else {
|
||||
asp->death_hit_pos = asteroid_obj->pos;
|
||||
asp->death_hit_pos = pasteroid_obj->pos;
|
||||
// randomize hit pos a bit, otherwise we will get a NULL vector when trying to find direction to toss child asteroids
|
||||
vec3d rand_vec;
|
||||
vm_vec_rand_vec_quick(&rand_vec);
|
||||
@@ -1384,7 +1414,7 @@ void asteroid_hit( object * asteroid_obj, object * other_obj, vec3d * hitpos, fl
|
||||
}
|
||||
|
||||
// evaluate any relevant player scoring implications
|
||||
scoring_eval_hit(asteroid_obj,other_obj);
|
||||
scoring_eval_hit(pasteroid_obj,other_obj);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -1449,21 +1479,21 @@ int asteroid_count()
|
||||
* See if asteroid should split up.
|
||||
* We delay splitting up to allow the explosion animation to play for a bit.
|
||||
*/
|
||||
void asteroid_maybe_break_up(object *asteroid_obj)
|
||||
void asteroid_maybe_break_up(object *pasteroid_obj)
|
||||
{
|
||||
asteroid *asp;
|
||||
asteroid_info *asip;
|
||||
|
||||
asp = &Asteroids[asteroid_obj->instance];
|
||||
asp = &Asteroids[pasteroid_obj->instance];
|
||||
asip = &Asteroid_info[asp->asteroid_type];
|
||||
|
||||
if ( timestamp_elapsed(asp->final_death_time) ) {
|
||||
vec3d relvec, vfh, tvec;
|
||||
|
||||
Script_system.SetHookObject("Self", asteroid_obj);
|
||||
if(!Script_system.IsConditionOverride(CHA_DEATH, asteroid_obj))
|
||||
Script_system.SetHookObject("Self", pasteroid_obj);
|
||||
if(!Script_system.IsConditionOverride(CHA_DEATH, pasteroid_obj))
|
||||
{
|
||||
asteroid_obj->flags |= OF_SHOULD_BE_DEAD;
|
||||
pasteroid_obj->flags |= OF_SHOULD_BE_DEAD;
|
||||
|
||||
// multiplayer clients won't go through the following code. asteroid_sub_create will send
|
||||
// a create packet to the client in the above named function
|
||||
@@ -1474,29 +1504,29 @@ void asteroid_maybe_break_up(object *asteroid_obj)
|
||||
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);
|
||||
asc_get_relvec(&relvec, pasteroid_obj, &asp->death_hit_pos);
|
||||
asteroid_sub_create(pasteroid_obj, ASTEROID_TYPE_SMALL, &relvec);
|
||||
|
||||
vm_vec_normalized_dir(&vfh, &asteroid_obj->pos, &asp->death_hit_pos);
|
||||
vm_vec_normalized_dir(&vfh, &pasteroid_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);
|
||||
asteroid_sub_create(pasteroid_obj, ASTEROID_TYPE_SMALL, &tvec);
|
||||
|
||||
break;
|
||||
case ASTEROID_TYPE_LARGE:
|
||||
asc_get_relvec(&relvec, asteroid_obj, &asp->death_hit_pos);
|
||||
asteroid_sub_create(asteroid_obj, ASTEROID_TYPE_MEDIUM, &relvec);
|
||||
asc_get_relvec(&relvec, pasteroid_obj, &asp->death_hit_pos);
|
||||
asteroid_sub_create(pasteroid_obj, ASTEROID_TYPE_MEDIUM, &relvec);
|
||||
|
||||
vm_vec_normalized_dir(&vfh, &asteroid_obj->pos, &asp->death_hit_pos);
|
||||
vm_vec_normalized_dir(&vfh, &pasteroid_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);
|
||||
asteroid_sub_create(pasteroid_obj, ASTEROID_TYPE_MEDIUM, &tvec);
|
||||
|
||||
while (frand() > 0.6f) {
|
||||
vec3d rvec, tvec2;
|
||||
vm_vec_rand_vec_quick(&rvec);
|
||||
vm_vec_scale_add(&tvec2, &vfh, &rvec, 0.75f);
|
||||
asteroid_sub_create(asteroid_obj, ASTEROID_TYPE_SMALL, &tvec2);
|
||||
asteroid_sub_create(pasteroid_obj, ASTEROID_TYPE_SMALL, &tvec2);
|
||||
}
|
||||
break;
|
||||
|
||||
@@ -1536,8 +1566,8 @@ void asteroid_maybe_break_up(object *asteroid_obj)
|
||||
float r = sqrt(1.0f - y*y);
|
||||
float phi = i * inc;
|
||||
|
||||
dir_vec.xyz.x = cos(phi)*r;
|
||||
dir_vec.xyz.y = sin(phi)*r;
|
||||
dir_vec.xyz.x = cosf(phi)*r;
|
||||
dir_vec.xyz.y = sinf(phi)*r;
|
||||
dir_vec.xyz.z = y;
|
||||
|
||||
// Randomize the direction a bit
|
||||
@@ -1545,24 +1575,24 @@ void asteroid_maybe_break_up(object *asteroid_obj)
|
||||
vm_vec_random_cone(&dir_vec, &tempv, (360.0f / total_roids / 2));
|
||||
|
||||
// Make the roid inherit half of the parent's velocity
|
||||
vm_vec_copy_normalize(&parent_vel, &asteroid_obj->phys_info.vel);
|
||||
vm_vec_copy_normalize(&parent_vel, &pasteroid_obj->phys_info.vel);
|
||||
vm_vec_scale(&parent_vel, 0.5f);
|
||||
|
||||
// Make the hit position affect the direction, but only a little
|
||||
vm_vec_sub(&hit_rel_vec, &asteroid_obj->pos, &asp->death_hit_pos);
|
||||
vm_vec_sub(&hit_rel_vec, &pasteroid_obj->pos, &asp->death_hit_pos);
|
||||
vm_vec_normalize(&hit_rel_vec);
|
||||
vm_vec_scale(&hit_rel_vec, 0.25f);
|
||||
|
||||
vm_vec_avg3(&final_vec, &parent_vel, &hit_rel_vec, &dir_vec);
|
||||
vm_vec_normalize(&final_vec);
|
||||
|
||||
asteroid_sub_create(asteroid_obj, roids_to_create[i], &final_vec);
|
||||
asteroid_sub_create(pasteroid_obj, roids_to_create[i], &final_vec);
|
||||
}
|
||||
}
|
||||
}
|
||||
asp->final_death_time = timestamp(-1);
|
||||
}
|
||||
Script_system.RunCondition(CHA_DEATH, '\0', NULL, asteroid_obj);
|
||||
Script_system.RunCondition(CHA_DEATH, '\0', NULL, pasteroid_obj);
|
||||
Script_system.RemHookVar("Self");
|
||||
}
|
||||
}
|
||||
@@ -1586,36 +1616,36 @@ int asteroid_get_random_in_cone(vec3d *pos, vec3d *dir, float ang, int danger)
|
||||
return -1;
|
||||
}
|
||||
|
||||
void asteroid_test_collide(object *asteroid_obj, object *ship_obj, mc_info *mc, bool lazy = false)
|
||||
void asteroid_test_collide(object *pasteroid_obj, object *pship_obj, mc_info *mc, bool lazy = false)
|
||||
{
|
||||
float asteroid_ray_dist;
|
||||
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;
|
||||
asteroid_fvec = asteroid_obj->phys_info.desired_vel;
|
||||
asteroid_ray_dist = vm_vec_mag_quick(&pasteroid_obj->phys_info.desired_vel) * ASTEROID_MIN_COLLIDE_TIME;
|
||||
asteroid_fvec = pasteroid_obj->phys_info.desired_vel;
|
||||
|
||||
if(IS_VEC_NULL_SQ_SAFE(&asteroid_fvec)){
|
||||
terminus = asteroid_obj->pos;
|
||||
terminus = pasteroid_obj->pos;
|
||||
} else {
|
||||
vm_vec_normalize(&asteroid_fvec);
|
||||
vm_vec_scale_add(&terminus, &asteroid_obj->pos, &asteroid_fvec, asteroid_ray_dist);
|
||||
vm_vec_scale_add(&terminus, &pasteroid_obj->pos, &asteroid_fvec, asteroid_ray_dist);
|
||||
}
|
||||
|
||||
Assert(ship_obj->type == OBJ_SHIP);
|
||||
Assert(pship_obj->type == OBJ_SHIP);
|
||||
|
||||
mc->model_instance_num = Ships[ship_obj->instance].model_instance_num;
|
||||
mc->model_num = Ship_info[Ships[ship_obj->instance].ship_info_index].model_num; // Fill in the model to check
|
||||
mc->orient = &ship_obj->orient; // The object's orientation
|
||||
mc->pos = &ship_obj->pos; // The object's position
|
||||
mc->p0 = &asteroid_obj->pos; // Point 1 of ray to check
|
||||
mc->model_instance_num = Ships[pship_obj->instance].model_instance_num;
|
||||
mc->model_num = Ship_info[Ships[pship_obj->instance].ship_info_index].model_num; // Fill in the model to check
|
||||
mc->orient = &pship_obj->orient; // The object's orientation
|
||||
mc->pos = &pship_obj->pos; // The object's position
|
||||
mc->p0 = &pasteroid_obj->pos; // Point 1 of ray to check
|
||||
mc->p1 = &terminus; // Point 2 of ray to check
|
||||
if (lazy) {
|
||||
mc->flags = MC_CHECK_MODEL | MC_ONLY_BOUND_BOX;
|
||||
} else {
|
||||
mc->flags = MC_CHECK_MODEL | MC_CHECK_SPHERELINE;
|
||||
}
|
||||
mc->radius = asteroid_obj->radius;
|
||||
mc->radius = pasteroid_obj->radius;
|
||||
|
||||
model_collide(mc);
|
||||
|
||||
@@ -1623,14 +1653,17 @@ void asteroid_test_collide(object *asteroid_obj, object *ship_obj, mc_info *mc,
|
||||
mc->p1 = NULL;
|
||||
}
|
||||
|
||||
// Return !0 is the asteroid will collide with the escort ship within ASTEROID_MIN_COLLIDE_TIME
|
||||
// seconds
|
||||
int asteroid_will_collide(object *asteroid_obj, object *escort_objp)
|
||||
/**
|
||||
* Test if asteroid will collide with escort ship within ASTEROID_MIN_COLLIDE_TIME seconds
|
||||
*
|
||||
* @return !0 if the asteroid will collide with the escort
|
||||
*/
|
||||
int asteroid_will_collide(object *pasteroid_obj, object *escort_objp)
|
||||
{
|
||||
mc_info mc;
|
||||
mc_info_init(&mc);
|
||||
|
||||
asteroid_test_collide(asteroid_obj, escort_objp, &mc);
|
||||
asteroid_test_collide(pasteroid_obj, escort_objp, &mc);
|
||||
|
||||
if ( !mc.num_hits ) {
|
||||
return 0;
|
||||
@@ -1714,7 +1747,7 @@ void asteroid_verify_collide_objnum(asteroid *asp)
|
||||
}
|
||||
}
|
||||
|
||||
void asteroid_process_post(object * obj, float frame_time)
|
||||
void asteroid_process_post(object * obj)
|
||||
{
|
||||
if (Asteroids_enabled) {
|
||||
int num;
|
||||
@@ -1927,7 +1960,7 @@ void asteroid_parse_tbl()
|
||||
SCP_string msg("Ignoring extra asteroid/debris '");
|
||||
msg.append(new_asteroid.name);
|
||||
msg.append("'\n");
|
||||
Warning(LOCATION, msg.c_str());
|
||||
Warning(LOCATION, "%s", msg.c_str());
|
||||
parsed_asteroids.push_back(msg);
|
||||
#endif
|
||||
}
|
||||
@@ -1974,13 +2007,13 @@ void asteroid_parse_tbl()
|
||||
iter != parsed_asteroids.end(); ++iter)
|
||||
{
|
||||
mprintf(("Asteroid.tbl as parsed:\n"));
|
||||
mprintf((iter->c_str()));
|
||||
mprintf(("%s", iter->c_str()));
|
||||
}
|
||||
#endif
|
||||
Error(LOCATION,
|
||||
"Found %d asteroids/debris when %d expected\n\n"
|
||||
"<Number expected> = <Number of species> * %d + %d generic asteroids\n"
|
||||
"%d = %d*%d + %d\n\n"
|
||||
"%d = " SIZE_T_ARG "*%d + %d\n\n"
|
||||
#ifdef NDEBUG
|
||||
"Run a debug build to see a list of all parsed asteroids\n",
|
||||
#else
|
||||
|
||||
@@ -12,13 +12,14 @@
|
||||
#ifndef __ASTEROID_H__
|
||||
#define __ASTEROID_H__
|
||||
|
||||
#include "globalincs/pstypes.h"
|
||||
#include "globalincs/globals.h" // for NAME_LENGTH
|
||||
#include "globalincs/pstypes.h"
|
||||
|
||||
|
||||
class object;
|
||||
class polymodel;
|
||||
struct collision_info_struct;
|
||||
class draw_list;
|
||||
|
||||
#define MAX_ASTEROIDS 512
|
||||
|
||||
@@ -97,6 +98,7 @@ public:
|
||||
typedef struct asteroid {
|
||||
int flags;
|
||||
int objnum;
|
||||
int model_instance_num;
|
||||
int asteroid_type; // 0..MAX_DEBRIS_TYPES
|
||||
int asteroid_subtype; // Index in asteroid_info for modelnum and modelp
|
||||
int check_for_wrap; // timestamp to check for asteroid wrapping around field
|
||||
@@ -150,12 +152,13 @@ void asteroid_init();
|
||||
void asteroid_level_init();
|
||||
void asteroid_level_close();
|
||||
void asteroid_create_all();
|
||||
void asteroid_render( object *asteroid_objp );
|
||||
void asteroid_render_DEPRECATED( object *asteroid_objp );
|
||||
void asteroid_render(object * obj, draw_list *scene);
|
||||
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);
|
||||
void asteroid_process_pre( object *asteroid_objp );
|
||||
void asteroid_process_post( object *asteroid_objp);
|
||||
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 );
|
||||
void asteroid_hit( object *pasteroid_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);
|
||||
|
||||
@@ -5,28 +5,28 @@
|
||||
|
||||
|
||||
|
||||
#include "autopilot/autopilot.h"
|
||||
#include "ai/ai.h"
|
||||
#include "ai/aigoals.h"
|
||||
#include "ship/ship.h"
|
||||
#include "object/object.h"
|
||||
#include "object/objcollide.h"
|
||||
#include "object/waypoint.h"
|
||||
#include "parse/sexp.h"
|
||||
#include "asteroid/asteroid.h"
|
||||
#include "autopilot/autopilot.h"
|
||||
#include "camera/camera.h"
|
||||
#include "cfile/cfile.h"
|
||||
#include "freespace2/freespace.h"
|
||||
#include "gamesnd/eventmusic.h"
|
||||
#include "globalincs/def_files.h"
|
||||
#include "globalincs/linklist.h"
|
||||
#include "iff_defs/iff_defs.h"
|
||||
#include "sound/audiostr.h"
|
||||
#include "mission/missiontraining.h"
|
||||
#include "mission/missionmessage.h"
|
||||
#include "io/timer.h"
|
||||
#include "gamesnd/eventmusic.h"
|
||||
#include "cfile/cfile.h"
|
||||
#include "parse/parselo.h"
|
||||
#include "globalincs/def_files.h"
|
||||
#include "localization/localize.h"
|
||||
#include "camera/camera.h"
|
||||
#include "asteroid/asteroid.h"
|
||||
#include "mission/missionmessage.h"
|
||||
#include "mission/missiontraining.h"
|
||||
#include "object/objcollide.h"
|
||||
#include "object/waypoint.h"
|
||||
#include "parse/parselo.h"
|
||||
#include "parse/sexp.h"
|
||||
#include "ship/ship.h"
|
||||
#include "sound/audiostr.h"
|
||||
|
||||
#include <map>
|
||||
|
||||
// Extern functions/variables
|
||||
@@ -243,9 +243,9 @@ bool StartAutopilot()
|
||||
if (shipp->team != Player_ship->team)
|
||||
continue;
|
||||
|
||||
Assertion((shipp->ship_info_index >= 0) && (shipp->ship_info_index < MAX_SHIP_CLASSES),
|
||||
Assertion((shipp->ship_info_index >= 0) && (shipp->ship_info_index < static_cast<int>(Ship_info.size())),
|
||||
"Ship '%s' does not have a valid pointer to a ship class. Pointer is %d, which is smaller than 0 or bigger than %d",
|
||||
shipp->ship_name, shipp->ship_info_index, MAX_SHIP_CLASSES);
|
||||
shipp->ship_name, shipp->ship_info_index, static_cast<int>(Ship_info.size()));
|
||||
ship_info *sip = &Ship_info[shipp->ship_info_index];
|
||||
|
||||
if ( !(sip->flags & SIF_SUPPORT) )
|
||||
|
||||
@@ -9,6 +9,7 @@
|
||||
|
||||
#include "globalincs/pstypes.h"
|
||||
#include "object/object.h"
|
||||
|
||||
#include <map>
|
||||
|
||||
// milliseconds between updates
|
||||
|
||||
@@ -22,34 +22,6 @@
|
||||
#endif
|
||||
|
||||
#include "bmpman/bmpman.h"
|
||||
#include "globalincs/pstypes.h"
|
||||
|
||||
// Bitmap types
|
||||
enum BM_TYPE
|
||||
{
|
||||
BM_TYPE_NONE = 0, //!< No type
|
||||
BM_TYPE_USER, //!< in-memory
|
||||
BM_TYPE_PCX, //!< PCX
|
||||
BM_TYPE_TGA, //!< 16 or 32 bit targa
|
||||
BM_TYPE_DDS, //!< generic identifier for DDS
|
||||
BM_TYPE_PNG, //!< PNG
|
||||
BM_TYPE_JPG, //!< 32 bit jpeg
|
||||
BM_TYPE_ANI, //!< in-house ANI format
|
||||
BM_TYPE_EFF, //!< specifies any type of animated image, the EFF itself is just text
|
||||
|
||||
// special types
|
||||
BM_TYPE_RENDER_TARGET_STATIC, //!< 24/32 bit setup internally as a static render target
|
||||
BM_TYPE_RENDER_TARGET_DYNAMIC, //!< 24/32 bit setup internally as a dynamic render target
|
||||
|
||||
// Compressed types (bitmap.c_type)
|
||||
BM_TYPE_DXT1, //!< 24 bit with switchable alpha
|
||||
BM_TYPE_DXT3, //!< 32 bit with 4 bit alpha
|
||||
BM_TYPE_DXT5, //!< 32 bit with 8 bit alpha
|
||||
BM_TYPE_CUBEMAP_DDS, //!< generic DDS cubemap (uncompressed cubemap surface)
|
||||
BM_TYPE_CUBEMAP_DXT1, //!< 24-bit cubemap (compressed cubemap surface)
|
||||
BM_TYPE_CUBEMAP_DXT3, //!< 32-bit cubemap (compressed cubemap surface)
|
||||
BM_TYPE_CUBEMAP_DXT5 //!< 32-bit cubemap (compressed cubemap surface)
|
||||
};
|
||||
|
||||
union bm_extra_info {
|
||||
struct {
|
||||
@@ -61,9 +33,8 @@ union bm_extra_info {
|
||||
|
||||
struct {
|
||||
// stuff for static animations
|
||||
ubyte type; //!< type for individual images
|
||||
BM_TYPE type; //!< type for individual images
|
||||
char filename[MAX_FILENAME_LEN]; //!< filename for individual images
|
||||
bool in_subdir; // Whether frames are in their own subdirectory
|
||||
} eff;
|
||||
} ani;
|
||||
|
||||
@@ -84,14 +55,14 @@ struct bitmap_entry {
|
||||
int handle; //!< Handle = id*MAX_BITMAPS + bitmapnum
|
||||
int last_used; //!< When this bitmap was last used
|
||||
|
||||
ubyte type; //!< PCX, USER, ANI, etc
|
||||
ubyte comp_type; //!< What sort of compressed type, BM_TYPE_NONE if not compressed
|
||||
BM_TYPE type; //!< PCX, USER, ANI, etc
|
||||
BM_TYPE comp_type; //!< What sort of compressed type, BM_TYPE_NONE if not compressed
|
||||
signed char ref_count; //!< Number of locks on bitmap. Can't unload unless ref_count is 0.
|
||||
|
||||
int dir_type; //!< which directory this was loaded from (to skip other locations with same name)
|
||||
|
||||
// compressed bitmap stuff (.dds) - RT please take a look at this and tell me if we really need it
|
||||
int mem_taken; //!< How much memory does this bitmap use? - UnknownPlayer
|
||||
size_t mem_taken; //!< How much memory does this bitmap use? - UnknownPlayer
|
||||
int num_mipmaps; //!< number of mipmap levels, we need to read all of them
|
||||
|
||||
// Stuff to keep track of usage
|
||||
|
||||
+502
-247
File diff suppressed because it is too large.
Load diff
+64
-33
@@ -67,6 +67,33 @@
|
||||
#define BMP_FLAG_RENDER_TARGET_DYNAMIC (1<<1) //!< Texture is a dynamic type (animation)
|
||||
#define BMP_FLAG_CUBEMAP (1<<2) //!< Texture is a cubemap
|
||||
|
||||
// Bitmap types
|
||||
enum BM_TYPE
|
||||
{
|
||||
BM_TYPE_NONE = 0, //!< No type
|
||||
BM_TYPE_USER, //!< in-memory
|
||||
BM_TYPE_PCX, //!< PCX
|
||||
BM_TYPE_TGA, //!< 16 or 32 bit targa
|
||||
BM_TYPE_DDS, //!< generic identifier for DDS
|
||||
BM_TYPE_PNG, //!< PNG
|
||||
BM_TYPE_JPG, //!< 32 bit jpeg
|
||||
BM_TYPE_ANI, //!< in-house ANI format
|
||||
BM_TYPE_EFF, //!< specifies any type of animated image, the EFF itself is just text
|
||||
|
||||
// special types
|
||||
BM_TYPE_RENDER_TARGET_STATIC, //!< 24/32 bit setup internally as a static render target
|
||||
BM_TYPE_RENDER_TARGET_DYNAMIC, //!< 24/32 bit setup internally as a dynamic render target
|
||||
|
||||
// Compressed types (bitmap.c_type)
|
||||
BM_TYPE_DXT1, //!< 24 bit with switchable alpha
|
||||
BM_TYPE_DXT3, //!< 32 bit with 4 bit alpha
|
||||
BM_TYPE_DXT5, //!< 32 bit with 8 bit alpha
|
||||
BM_TYPE_CUBEMAP_DDS, //!< generic DDS cubemap (uncompressed cubemap surface)
|
||||
BM_TYPE_CUBEMAP_DXT1, //!< 24-bit cubemap (compressed cubemap surface)
|
||||
BM_TYPE_CUBEMAP_DXT3, //!< 32-bit cubemap (compressed cubemap surface)
|
||||
BM_TYPE_CUBEMAP_DXT5 //!< 32-bit cubemap (compressed cubemap surface)
|
||||
};
|
||||
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
@@ -89,10 +116,10 @@ extern int bm_texture_ram; //!< how many bytes of textures are used.
|
||||
|
||||
extern int Bm_paging; //!< Bool type that indicates if BMPMAN is currently paging.
|
||||
|
||||
extern const ubyte bm_type_list[]; //!< List of valid bitmap types
|
||||
extern const BM_TYPE bm_type_list[]; //!< List of valid bitmap types
|
||||
extern const char *bm_ext_list[]; //!< List of extensions for those types
|
||||
extern const int BM_NUM_TYPES; //!< Calculated number of bitmap types
|
||||
extern const ubyte bm_ani_type_list[]; //!< List of valid bitmap animation types
|
||||
extern const BM_TYPE bm_ani_type_list[]; //!< List of valid bitmap animation types
|
||||
extern const char *bm_ani_ext_list[]; //!< List of extensions for those types
|
||||
extern const int BM_ANI_NUM_TYPES; //!< Calculated number of bitmap animation types
|
||||
|
||||
@@ -147,6 +174,26 @@ void *bm_malloc(int handle, int size);
|
||||
*/
|
||||
void bm_update_memory_used(int n, int size);
|
||||
|
||||
class bitmap_lookup {
|
||||
ubyte *Bitmap_data;
|
||||
|
||||
int Width;
|
||||
int Height;
|
||||
int Num_channels;
|
||||
|
||||
float map_texture_address(float address);
|
||||
public:
|
||||
bitmap_lookup(int bitmap_num);
|
||||
~bitmap_lookup();
|
||||
|
||||
bool valid();
|
||||
|
||||
float get_channel_red(float u, float v);
|
||||
float get_channel_green(float u, float v);
|
||||
float get_channel_blue(float u, float v);
|
||||
float get_channel_alpha(float u, float v);
|
||||
};
|
||||
|
||||
/**
|
||||
* @brief Loads a bitmap so we can draw with it later.
|
||||
*
|
||||
@@ -275,7 +322,7 @@ int bm_load_either(const char *filename, int *nframes = NULL, int *fps = NULL, i
|
||||
* @details Also converts the bitmap to the appropriate format specified by bpp and flags. Only lock a bitmap when you
|
||||
* need it!
|
||||
*
|
||||
* @param bitmapnum The number indexing the desired bitmap
|
||||
* @param handle The number indexing the desired bitmap
|
||||
* @param bpp The desired bpp of the bitmep
|
||||
* @param flags The desired bitmap format
|
||||
* @param nodebug
|
||||
@@ -295,7 +342,7 @@ uint bm_get_signature(int handle);
|
||||
/**
|
||||
* @brief Returns the image type of the given bitmap handle
|
||||
*/
|
||||
ubyte bm_get_type(int handle);
|
||||
BM_TYPE bm_get_type(int handle);
|
||||
|
||||
/**
|
||||
* @brief Unlocks a bitmap
|
||||
@@ -415,11 +462,6 @@ void bm_get_frame_usage(int *ntotal, int *nnew);
|
||||
*/
|
||||
int bm_reload(int bitmap_handle, const char* filename);
|
||||
|
||||
/**
|
||||
* @brief Stuffs Pathtypes with an additional path leading to a subdir of the same name as the given file (minus file extension)
|
||||
*/
|
||||
bool set_temp_subdir_pathtype(const char *filename);
|
||||
|
||||
/**
|
||||
* @brief Tells bmpman to start keeping track of what bitmaps are used where
|
||||
*/
|
||||
@@ -460,10 +502,8 @@ void bm_page_in_aabitmap(int bitmapnum, int num_frames = 1);
|
||||
* @returns 0 If the bitmap had already been released, or
|
||||
* @returns 0 If the handle is invalid, or
|
||||
* @returns 1 If successful
|
||||
*
|
||||
* @todo The return type should be a bool
|
||||
*/
|
||||
int bm_page_out(int handle);
|
||||
bool bm_page_out(int handle);
|
||||
|
||||
/**
|
||||
* @brief Sets BMPMAN's memory mode
|
||||
@@ -570,10 +610,8 @@ int bm_get_tcache_type(int handle);
|
||||
|
||||
/**
|
||||
* @brief Gets the size, in bytes, taken up by the bitmap indexed by handle
|
||||
*
|
||||
* @todo retval should be a size_t
|
||||
*/
|
||||
int bm_get_size(int handle);
|
||||
size_t bm_get_size(int handle);
|
||||
|
||||
/**
|
||||
* @brief Gets the number of mipmaps of the indexed texture
|
||||
@@ -584,10 +622,8 @@ int bm_get_num_mipmaps(int handle);
|
||||
* @brief Checks to see if the indexed bitmap has an alpha channel
|
||||
*
|
||||
* @note Currently just checks if the bitmap is 32bpp and is not a .PCX
|
||||
*
|
||||
* @todo retval should be a bool
|
||||
*/
|
||||
int bm_has_alpha_channel(int handle);
|
||||
bool bm_has_alpha_channel(int handle);
|
||||
|
||||
/**
|
||||
* @brief (DEBUG) Prints all loaded bitmaps to an outwindow
|
||||
@@ -615,29 +651,24 @@ int bm_is_render_target(int handle);
|
||||
/**
|
||||
* @brief (GR function) Calls gr_bm_set_render target for the given bitmap indexed by handle
|
||||
*
|
||||
* @returns 1 if successful, or
|
||||
* @returns 0 if unsuccessful
|
||||
*
|
||||
* @todo retval should be a bool
|
||||
* @returns true if successful, or
|
||||
* @returns false if unsuccessful
|
||||
*/
|
||||
int bm_set_render_target(int handle, int face = -1);
|
||||
bool bm_set_render_target(int handle, int face = -1);
|
||||
|
||||
/**
|
||||
* @brief Loads and parses an .EFF
|
||||
*
|
||||
* @param[in] filename The filename of the .EFF
|
||||
* @param[in] dir_type
|
||||
* @param[out] nframes (optional) If given, is set to the number of frames this .EFF has
|
||||
* @param[out] nfps (optional) If given, is set to the fps of this .EFF
|
||||
* @param[out] key (optional) If given, is set to the keyframe index of this .EFF
|
||||
* @param[out] type (optional) If given, is set to the BM_TYPE of the .EFF
|
||||
* @param[out] in_subdir (optional) If given, is set to true if the frames of this .EFF are in a subdir
|
||||
* @param[out] nframes (optional) If given, is set to the number of frames this .EFF has
|
||||
* @param[out] nfps (optional) If given, is set to the fps of this .EFF
|
||||
* @param[out] key (optional) If given, is set to the keyframe index of this .EFF
|
||||
* @param[out] type (optional) If given, is set to the BM_TYPE of the .EFF
|
||||
*
|
||||
* @returns 0 If successful,
|
||||
* @returns -1 if not successful
|
||||
*
|
||||
* @todo retval should be a bool
|
||||
* @returns true If successful
|
||||
* @returns false If not successful
|
||||
*/
|
||||
int bm_load_and_parse_eff(const char *filename, int dir_type, int *nframes, int *nfps, int *key, ubyte *type, bool *in_subdir);
|
||||
bool bm_load_and_parse_eff(const char *filename, int dir_type, int *nframes, int *nfps, int *key, BM_TYPE *type);
|
||||
|
||||
#endif
|
||||
+21
-18
@@ -1,17 +1,15 @@
|
||||
#include "camera/camera.h"
|
||||
#include "math/vecmat.h"
|
||||
#include "graphics/2d.h"
|
||||
#include "globalincs/alphacolors.h"
|
||||
#include "parse/parselo.h"
|
||||
#include "physics/physics.h" //apply_physics
|
||||
#include "globalincs/linklist.h"
|
||||
#include "globalincs/systemvars.h" //VM_FREECAMERA etc
|
||||
#include "graphics/font.h"
|
||||
#include "hud/hud.h" //hud_get_draw
|
||||
#include "math/vecmat.h"
|
||||
#include "mod_table/mod_table.h"
|
||||
#include "model/model.h" //polymodel, model_get
|
||||
#include "parse/parselo.h"
|
||||
#include "playerman/player.h" //player_get_padlock_orient
|
||||
#include "ship/ship.h" //compute_slew_matrix
|
||||
#include "graphics/font.h"
|
||||
#include "mod_table/mod_table.h"
|
||||
#include "globalincs/linklist.h"
|
||||
|
||||
//*************************IMPORTANT GLOBALS*************************
|
||||
float VIEWER_ZOOM_DEFAULT = 0.75f; // Default viewer zoom, 0.625 as per multi-lateral agreement on 3/24/97
|
||||
@@ -82,7 +80,7 @@ void camera::reset()
|
||||
|
||||
void camera::set_name(char *in_name)
|
||||
{
|
||||
if(name != NULL)
|
||||
if(in_name != NULL)
|
||||
strncpy(name, in_name, NAME_LENGTH-1);
|
||||
}
|
||||
|
||||
@@ -332,8 +330,10 @@ void camera::get_info(vec3d *position, matrix *orientation)
|
||||
eyep = get_submodel_eye(pm, object_host_submodel);
|
||||
if(eyep)
|
||||
{
|
||||
Assertion(objp->type == OBJ_SHIP, "This part of the code expects the object to be a ship");
|
||||
|
||||
vec3d c_pos_in;
|
||||
find_submodel_instance_point_normal( &c_pos_in, &host_normal, objp, eyep->parent, &eyep->pnt, &eyep->norm);
|
||||
find_submodel_instance_point_normal(&c_pos_in, &host_normal, Ships[objp->instance].model_instance_num, eyep->parent, &eyep->pnt, &eyep->norm);
|
||||
vm_vec_unrotate(&c_pos, &c_pos_in, &objp->orient);
|
||||
vm_vec_add2(&c_pos, &objp->pos);
|
||||
}
|
||||
@@ -515,8 +515,8 @@ void warp_camera::do_frame(float in_frametime)
|
||||
|
||||
float tmp_angle = frand()*PI2;
|
||||
|
||||
tmp.xyz.x = 22.0f * (float)sin(tmp_angle);
|
||||
tmp.xyz.y = -22.0f * (float)cos(tmp_angle);
|
||||
tmp.xyz.x = 22.0f * sinf(tmp_angle);
|
||||
tmp.xyz.y = -22.0f * cosf(tmp_angle);
|
||||
|
||||
this->set_velocity( &tmp, 0 );
|
||||
}
|
||||
@@ -653,20 +653,20 @@ subtitle::subtitle(int in_x_pos, int in_y_pos, const char* in_text, const char*
|
||||
|
||||
//Center it?
|
||||
if(center_x)
|
||||
image_pos.x = (gr_screen.max_w - tw)/2;
|
||||
image_pos.x = (gr_screen.center_w - tw)/2 + gr_screen.center_offset_x;
|
||||
if(center_y)
|
||||
image_pos.y = (gr_screen.max_h - th)/2;
|
||||
image_pos.y = (gr_screen.center_h - th)/2 + gr_screen.center_offset_y;
|
||||
}
|
||||
|
||||
if(in_x_pos < 0 && !center_x)
|
||||
image_pos.x += gr_screen.max_w + in_x_pos;
|
||||
image_pos.x += gr_screen.center_offset_x + gr_screen.center_w + in_x_pos;
|
||||
else if(!center_x)
|
||||
image_pos.x += in_x_pos;
|
||||
image_pos.x += gr_screen.center_offset_x + in_x_pos;
|
||||
|
||||
if(in_y_pos < 0 && !center_y)
|
||||
image_pos.y += gr_screen.max_h + in_y_pos;
|
||||
image_pos.y += gr_screen.center_offset_y + gr_screen.center_h + in_y_pos;
|
||||
else if(!center_y)
|
||||
image_pos.y += in_y_pos;
|
||||
image_pos.y += gr_screen.center_offset_y + in_y_pos;
|
||||
|
||||
image_pos.w = in_width;
|
||||
image_pos.h = in_height;
|
||||
@@ -873,6 +873,9 @@ void cam_close()
|
||||
{
|
||||
//Set Current_camera to nothing
|
||||
Current_camera = camid();
|
||||
for (auto ii = Cameras.begin(); ii != Cameras.end(); ++ii) {
|
||||
delete * ii;
|
||||
}
|
||||
Cameras.clear();
|
||||
}
|
||||
|
||||
@@ -1085,4 +1088,4 @@ eye* get_submodel_eye(polymodel *pm, int submodel_num)
|
||||
}
|
||||
}
|
||||
return NULL;
|
||||
}
|
||||
}
|
||||
@@ -2,11 +2,11 @@
|
||||
#ifndef _CAMERA_H
|
||||
#define _CAMERA_H
|
||||
|
||||
#include "graphics/2d.h"
|
||||
#include "globalincs/pstypes.h"
|
||||
#include "globalincs/globals.h"
|
||||
#include "physics/physics.h" //for avd
|
||||
#include "globalincs/pstypes.h"
|
||||
#include "graphics/2d.h"
|
||||
#include "object/object.h"
|
||||
#include "physics/physics.h" //for avd
|
||||
|
||||
#include <string>
|
||||
|
||||
|
||||
+230
-199
@@ -29,10 +29,10 @@
|
||||
#endif
|
||||
|
||||
#include "cfile/cfile.h"
|
||||
#include "parse/encrypt.h"
|
||||
#include "cfile/cfilesystem.h"
|
||||
#include "cfile/cfilearchive.h"
|
||||
#include "cfile/cfilesystem.h"
|
||||
#include "osapi/osapi.h"
|
||||
#include "parse/encrypt.h"
|
||||
|
||||
|
||||
char Cfile_root_dir[CFILE_ROOT_DIRECTORY_LEN] = "";
|
||||
@@ -86,142 +86,159 @@ cf_pathtype Pathtypes[CF_MAX_PATH_TYPES] = {
|
||||
{ CF_TYPE_INTEL_ANIMS, "data" DIR_SEPARATOR_STR "intelanims", ".pcx .ani .eff .tga .jpg .png .dds", CF_TYPE_DATA },
|
||||
{ CF_TYPE_SCRIPTS, "data" DIR_SEPARATOR_STR "scripts", ".lua .lc", CF_TYPE_DATA },
|
||||
{ CF_TYPE_FICTION, "data" DIR_SEPARATOR_STR "fiction", ".txt", CF_TYPE_DATA },
|
||||
{ CF_TYPE_TEMP_SUBDIR_LOOKUP, "", ".eff", CF_TYPE_DATA },
|
||||
};
|
||||
|
||||
|
||||
#define CFILE_STACK_MAX 8
|
||||
|
||||
int cfile_inited = 0;
|
||||
int Cfile_stack_pos = 0;
|
||||
static int Cfile_stack_pos = 0;
|
||||
|
||||
char Cfile_stack[CFILE_STACK_MAX][CFILE_ROOT_DIRECTORY_LEN];
|
||||
static char Cfile_stack[CFILE_STACK_MAX][CFILE_ROOT_DIRECTORY_LEN];
|
||||
|
||||
Cfile_block Cfile_block_list[MAX_CFILE_BLOCKS];
|
||||
CFILE Cfile_list[MAX_CFILE_BLOCKS];
|
||||
static CFILE Cfile_list[MAX_CFILE_BLOCKS];
|
||||
|
||||
const char *Cfile_cdrom_dir = NULL;
|
||||
static const char *Cfile_cdrom_dir = NULL;
|
||||
|
||||
//
|
||||
// Function prototypes for internally-called functions
|
||||
//
|
||||
int cfget_cfile_block();
|
||||
CFILE *cf_open_fill_cfblock(FILE * fp, int type);
|
||||
CFILE *cf_open_packed_cfblock(FILE *fp, int type, int offset, int size);
|
||||
static int cfget_cfile_block();
|
||||
static CFILE *cf_open_fill_cfblock(const char* source, int line, FILE * fp, int type);
|
||||
static CFILE *cf_open_packed_cfblock(const char* source, int line, FILE *fp, int type, int offset, int size);
|
||||
|
||||
#if defined _WIN32
|
||||
CFILE *cf_open_mapped_fill_cfblock(HANDLE hFile, int type);
|
||||
static CFILE *cf_open_mapped_fill_cfblock(const char* source, int line, HANDLE hFile, int type);
|
||||
#elif defined SCP_UNIX
|
||||
CFILE *cf_open_mapped_fill_cfblock(FILE *fp, int type);
|
||||
static CFILE *cf_open_mapped_fill_cfblock(const char* source, int line, FILE *fp, int type);
|
||||
#endif
|
||||
|
||||
void cf_chksum_long_init();
|
||||
static void cf_chksum_long_init();
|
||||
|
||||
void cfile_close()
|
||||
static void dump_opened_files()
|
||||
{
|
||||
for (int i = 0; i < MAX_CFILE_BLOCKS; i++) {
|
||||
auto cb = &Cfile_block_list[i];
|
||||
if (cb->type != CFILE_BLOCK_UNUSED) {
|
||||
mprintf((" %s:%d\n", cb->source_file, cb->line_num));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
static void cfile_close()
|
||||
{
|
||||
mprintf(("Still opened files:\n"));
|
||||
dump_opened_files();
|
||||
|
||||
cf_free_secondary_filelist();
|
||||
}
|
||||
|
||||
// determine if the given path is in a root directory (c:\ or c:\freespace2.exe or c:\fred2.exe etc)
|
||||
int cfile_in_root_dir(const char *exe_path)
|
||||
{
|
||||
int token_count = 0;
|
||||
char path_copy[CFILE_ROOT_DIRECTORY_LEN] = "";
|
||||
char *tok;
|
||||
|
||||
// bogus
|
||||
if(exe_path == NULL){
|
||||
return 1;
|
||||
}
|
||||
|
||||
// copy the path
|
||||
memset(path_copy, 0, CFILE_ROOT_DIRECTORY_LEN);
|
||||
strncpy(path_copy, exe_path, CFILE_ROOT_DIRECTORY_LEN - 1);
|
||||
|
||||
// count how many slashes there are in the path
|
||||
tok = strtok(path_copy, DIR_SEPARATOR_STR);
|
||||
if(tok == NULL){
|
||||
return 1;
|
||||
}
|
||||
do {
|
||||
token_count++;
|
||||
tok = strtok(NULL, DIR_SEPARATOR_STR);
|
||||
} while(tok != NULL);
|
||||
|
||||
#ifdef SCP_UNIX
|
||||
// /freespace works, / does not
|
||||
if(token_count <= 1) {
|
||||
#define MIN_NUM_PATH_COMPONENTS 2 /* Directory + file */
|
||||
#else
|
||||
// C:/freespace works, C:/ does not
|
||||
if(token_count <= 2){
|
||||
#define MIN_NUM_PATH_COMPONENTS 3 /* Drive + directory + file */
|
||||
#endif
|
||||
return 1;
|
||||
}
|
||||
|
||||
// not-root directory
|
||||
return 0;
|
||||
/**
|
||||
* @brief Determine if the given path is in the root directory
|
||||
*
|
||||
* @param exe_path Path to executable
|
||||
*
|
||||
* @return true if root directory, false if not
|
||||
*/
|
||||
static bool cfile_in_root_dir(const char *exe_path)
|
||||
{
|
||||
int new_token;
|
||||
int token_count = 0;
|
||||
const char *p = exe_path;
|
||||
|
||||
Assert(exe_path != NULL);
|
||||
|
||||
do {
|
||||
new_token = 0;
|
||||
while (*p == DIR_SEPARATOR_CHAR) {
|
||||
p++;
|
||||
}
|
||||
|
||||
while ((*p != '\0') && (*p != DIR_SEPARATOR_CHAR)) {
|
||||
new_token = 1;
|
||||
p++;
|
||||
}
|
||||
token_count += new_token;
|
||||
} while (*p != '\0');
|
||||
|
||||
return (token_count < MIN_NUM_PATH_COMPONENTS);
|
||||
}
|
||||
|
||||
// cfile_init() initializes the cfile system. Called once at application start.
|
||||
//
|
||||
// returns: success ==> 0
|
||||
// error ==> non-zero
|
||||
//
|
||||
/**
|
||||
* @brief Initialize the cfile system. Called once at application start.
|
||||
*
|
||||
* @param exe_dir Path to a file (not a directory)
|
||||
* @param cdrom_dir Path to a CD drive mount point (may be NULL)
|
||||
*
|
||||
* @return 0 On success
|
||||
* @return 1 On error
|
||||
*/
|
||||
int cfile_init(const char *exe_dir, const char *cdrom_dir)
|
||||
{
|
||||
int i;
|
||||
|
||||
// initialize encryption
|
||||
encrypt_init();
|
||||
encrypt_init(); /* initialize encryption */
|
||||
|
||||
if ( !cfile_inited ) {
|
||||
char buf[CFILE_ROOT_DIRECTORY_LEN];
|
||||
if (cfile_inited) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
cfile_inited = 1;
|
||||
char buf[CFILE_ROOT_DIRECTORY_LEN];
|
||||
|
||||
memset(buf, 0, CFILE_ROOT_DIRECTORY_LEN);
|
||||
strncpy(buf, exe_dir, CFILE_ROOT_DIRECTORY_LEN - 1);
|
||||
i = strlen(buf);
|
||||
strncpy(buf, exe_dir, CFILE_ROOT_DIRECTORY_LEN - 1);
|
||||
buf[CFILE_ROOT_DIRECTORY_LEN - 1] = '\0';
|
||||
i = strlen(buf);
|
||||
|
||||
// are we in a root directory?
|
||||
if(cfile_in_root_dir(buf)){
|
||||
MessageBox((HWND)NULL, "FreeSpace2/Fred2 cannot be run from a drive root directory!", "Error", MB_OK);
|
||||
return 1;
|
||||
}
|
||||
/* Determine if we in a root directory? */
|
||||
if (cfile_in_root_dir(buf)) {
|
||||
MessageBox((HWND)NULL,
|
||||
"FreeSpace2/Fred2 cannot be run from a drive root directory!",
|
||||
"Error", MB_OK);
|
||||
return 1;
|
||||
}
|
||||
|
||||
while (i--) {
|
||||
if (buf[i] == DIR_SEPARATOR_CHAR){
|
||||
break;
|
||||
}
|
||||
}
|
||||
// This needs to be set here because cf_build_secondary_filelist assumes it to be true
|
||||
cfile_inited = 1;
|
||||
|
||||
if (i >= 2) {
|
||||
buf[i] = 0;
|
||||
cfile_chdir(buf);
|
||||
} else {
|
||||
MessageBox((HWND)NULL, "Error trying to determine executable root directory!", "Error", MB_OK);
|
||||
return 1;
|
||||
}
|
||||
/*
|
||||
* Determine the executable's directory. Note that DIR_SEPARATOR_CHAR
|
||||
* is guaranteed to be found in the string else cfile_in_root_dir()
|
||||
* would have failed.
|
||||
*/
|
||||
|
||||
// set root directory
|
||||
strncpy(Cfile_root_dir, buf, CFILE_ROOT_DIRECTORY_LEN-1);
|
||||
char *p;
|
||||
|
||||
p = strrchr(buf, DIR_SEPARATOR_CHAR);
|
||||
*p = '\0';
|
||||
|
||||
cfile_chdir(buf);
|
||||
|
||||
// set root directory
|
||||
strncpy(Cfile_root_dir, buf, CFILE_ROOT_DIRECTORY_LEN - 1);
|
||||
#ifdef SCP_UNIX
|
||||
snprintf(Cfile_user_dir, CFILE_ROOT_DIRECTORY_LEN-1, "%s/%s/", detect_home(), Osreg_user_dir);
|
||||
snprintf(Cfile_user_dir, CFILE_ROOT_DIRECTORY_LEN - 1, "%s/%s/",
|
||||
detect_home(), Osreg_user_dir);
|
||||
#endif
|
||||
|
||||
for ( i = 0; i < MAX_CFILE_BLOCKS; i++ ) {
|
||||
Cfile_block_list[i].type = CFILE_BLOCK_UNUSED;
|
||||
}
|
||||
|
||||
// 32 bit CRC table init
|
||||
cf_chksum_long_init();
|
||||
|
||||
Cfile_cdrom_dir = cdrom_dir;
|
||||
cf_build_secondary_filelist(Cfile_cdrom_dir);
|
||||
|
||||
atexit( cfile_close );
|
||||
for (i = 0; i < MAX_CFILE_BLOCKS; i++) {
|
||||
Cfile_block_list[i].type = CFILE_BLOCK_UNUSED;
|
||||
}
|
||||
|
||||
// 32 bit CRC table init
|
||||
cf_chksum_long_init();
|
||||
|
||||
Cfile_cdrom_dir = cdrom_dir;
|
||||
cf_build_secondary_filelist(Cfile_cdrom_dir);
|
||||
|
||||
atexit(cfile_close);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -235,13 +252,13 @@ void cfile_refresh()
|
||||
|
||||
|
||||
|
||||
#ifdef _WIN32
|
||||
// Changes to a drive if valid.. 1=A, 2=B, etc
|
||||
// If flag, then changes to it.
|
||||
// Returns 0 if not-valid, 1 if valid.
|
||||
int cfile_chdrive( int DriveNum, int flag )
|
||||
{
|
||||
int Valid = 0;
|
||||
#ifdef _WIN32
|
||||
int n, org;
|
||||
|
||||
org = -1;
|
||||
@@ -257,99 +274,108 @@ int cfile_chdrive( int DriveNum, int flag )
|
||||
|
||||
if ( (!flag) && (n != org) )
|
||||
_chdrive( org );
|
||||
#endif // _WIN32
|
||||
|
||||
return Valid;
|
||||
|
||||
}
|
||||
#endif // _WIN32
|
||||
|
||||
// push current directory on a 'stack' (so we can restore it) and change the directory
|
||||
int cfile_push_chdir(int type)
|
||||
/**
|
||||
* @brief Common code for changing directory
|
||||
*
|
||||
* @param new_dir Directory to which to change
|
||||
* @param cur_dir Current directory (only used on Windows)
|
||||
*
|
||||
* @retval 0 Success
|
||||
* @retval 1 Failed to change to new directory's drive (Windows only)
|
||||
* @retval 2 Failed to change to new directory
|
||||
*/
|
||||
static int _cfile_chdir(const char *new_dir, const char *cur_dir __UNUSED)
|
||||
{
|
||||
int e;
|
||||
char dir[CFILE_ROOT_DIRECTORY_LEN];
|
||||
char OriginalDirectory[CFILE_ROOT_DIRECTORY_LEN];
|
||||
char *Path = NULL;
|
||||
char NoDir[] = "\\.";
|
||||
|
||||
_getcwd(OriginalDirectory, CFILE_ROOT_DIRECTORY_LEN-1);
|
||||
|
||||
Assert(Cfile_stack_pos < CFILE_STACK_MAX);
|
||||
|
||||
if ( Cfile_stack_pos >= CFILE_STACK_MAX )
|
||||
return -1;
|
||||
|
||||
strncpy(Cfile_stack[Cfile_stack_pos++], OriginalDirectory, CFILE_ROOT_DIRECTORY_LEN-1);
|
||||
|
||||
cf_create_default_path_string( dir, sizeof(dir)-1, type, NULL );
|
||||
int status;
|
||||
const char *path = NULL;
|
||||
const char no_dir[] = "\\.";
|
||||
|
||||
#ifdef _WIN32
|
||||
char *colon_pos = strchr(dir, ':');
|
||||
const char *colon = strchr(new_dir, ':');
|
||||
|
||||
if (colon_pos) {
|
||||
if (!cfile_chdrive( tolower(*(colon_pos - 1)) - 'a' + 1, 1))
|
||||
if (colon) {
|
||||
if (!cfile_chdrive(tolower(*(colon - 1)) - 'a' + 1, 1))
|
||||
return 1;
|
||||
|
||||
Path = colon_pos+1;
|
||||
path = colon + 1;
|
||||
} else
|
||||
#endif // _WIN32
|
||||
#endif /* _WIN32 */
|
||||
{
|
||||
Path = dir;
|
||||
path = new_dir;
|
||||
}
|
||||
|
||||
if (!(*Path)) {
|
||||
Path = NoDir;
|
||||
if (*path == '\0') {
|
||||
path = no_dir;
|
||||
}
|
||||
|
||||
// This chdir might get a critical error!
|
||||
e = _chdir( Path );
|
||||
if (e) {
|
||||
/* This chdir might get a critical error! */
|
||||
status = _chdir(path);
|
||||
if (status != 0) {
|
||||
#ifdef _WIN32
|
||||
cfile_chdrive( tolower(OriginalDirectory[0]) - 'a' + 1, 1 );
|
||||
#endif // _WIN32
|
||||
cfile_chdrive(tolower(cur_dir[0]) - 'a' + 1, 1);
|
||||
#endif /* _WIN32 */
|
||||
return 2;
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Push current directory onto a 'stack' and change to a new directory
|
||||
*
|
||||
* The current directory is pushed onto a 'stack' so that it can be easily
|
||||
* restored at a later time. The new directory is derived from @a type.
|
||||
*
|
||||
* @param type path type (CF_TYPE_xxx)
|
||||
*
|
||||
* @retval -1 'Stack' is full
|
||||
* @retval 0 Success
|
||||
* @retval 1 Failed to change to new directory's drive (Windows only)
|
||||
* @retval 2 Failed to change to new directory
|
||||
*/
|
||||
int cfile_push_chdir(int type)
|
||||
{
|
||||
char dir[CFILE_ROOT_DIRECTORY_LEN];
|
||||
char OriginalDirectory[CFILE_ROOT_DIRECTORY_LEN];
|
||||
|
||||
_getcwd(OriginalDirectory, CFILE_ROOT_DIRECTORY_LEN - 1);
|
||||
|
||||
Assert(Cfile_stack_pos < CFILE_STACK_MAX);
|
||||
|
||||
if (Cfile_stack_pos >= CFILE_STACK_MAX) {
|
||||
return -1;
|
||||
}
|
||||
|
||||
strncpy(Cfile_stack[Cfile_stack_pos++], OriginalDirectory,
|
||||
CFILE_ROOT_DIRECTORY_LEN - 1);
|
||||
|
||||
cf_create_default_path_string(dir, sizeof(dir) - 1, type, NULL);
|
||||
|
||||
return _cfile_chdir(dir, OriginalDirectory);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Change to the specified directory
|
||||
*
|
||||
* @param dir Directory
|
||||
*
|
||||
* @retval 0 Success
|
||||
* @retval 1 Failed to change to new directory's drive (Windows only)
|
||||
* @retval 2 Failed to change to new directory
|
||||
*/
|
||||
int cfile_chdir(const char *dir)
|
||||
{
|
||||
int e;
|
||||
char OriginalDirectory[CFILE_ROOT_DIRECTORY_LEN];
|
||||
const char *Path = NULL;
|
||||
char NoDir[] = "\\.";
|
||||
|
||||
_getcwd(OriginalDirectory, CFILE_ROOT_DIRECTORY_LEN-1);
|
||||
_getcwd(OriginalDirectory, CFILE_ROOT_DIRECTORY_LEN - 1);
|
||||
|
||||
#ifdef _WIN32
|
||||
const char *colon_pos = strchr(dir, ':');
|
||||
if (colon_pos) {
|
||||
if (!cfile_chdrive( tolower(*(colon_pos - 1)) - 'a' + 1, 1))
|
||||
return 1;
|
||||
|
||||
Path = colon_pos+1;
|
||||
} else
|
||||
#endif // _WIN32
|
||||
{
|
||||
Path = dir;
|
||||
}
|
||||
|
||||
if (!(*Path)) {
|
||||
Path = NoDir;
|
||||
}
|
||||
|
||||
// This chdir might get a critical error!
|
||||
e = _chdir( Path );
|
||||
if (e) {
|
||||
#ifdef _WIN32
|
||||
cfile_chdrive( tolower(OriginalDirectory[0]) - 'a' + 1, 1 );
|
||||
#endif // _WIN32
|
||||
return 2;
|
||||
}
|
||||
|
||||
return 0;
|
||||
return _cfile_chdir(dir, OriginalDirectory);
|
||||
}
|
||||
|
||||
int cfile_pop_dir()
|
||||
@@ -402,7 +428,7 @@ int cfile_flush_dir(int dir_type)
|
||||
for (unsigned int i = 0; i < globinfo.gl_pathc; i++) {
|
||||
// Determine if this is a regular file
|
||||
struct stat statbuf;
|
||||
memset(&statbuf, 0, sizeof(statbuf));
|
||||
|
||||
stat(globinfo.gl_pathv[i], &statbuf);
|
||||
if (S_ISREG(statbuf.st_mode)) {
|
||||
// delete the file
|
||||
@@ -446,34 +472,24 @@ char *cf_add_ext(const char *filename, const char *ext)
|
||||
return path;
|
||||
}
|
||||
|
||||
// Deletes a file. Returns 0 if an error occurs, 1 on success
|
||||
int cf_delete(const char *filename, int dir_type)
|
||||
/**
|
||||
* @brief Delete the specified file
|
||||
*
|
||||
* @param filename Name of file to delete
|
||||
* @param path_type Path type (CF_TYPE_xxx)
|
||||
*
|
||||
* @return 0 on failure, 1 on success
|
||||
*/
|
||||
int cf_delete(const char *filename, int path_type)
|
||||
{
|
||||
char longname[MAX_PATH_LEN];
|
||||
|
||||
Assert( CF_TYPE_SPECIFIED(dir_type) );
|
||||
Assert(CF_TYPE_SPECIFIED(path_type));
|
||||
|
||||
cf_create_default_path_string( longname, sizeof(longname)-1, dir_type, filename );
|
||||
cf_create_default_path_string(longname, sizeof(longname) - 1,
|
||||
path_type, filename);
|
||||
|
||||
FILE *fp = fopen(longname, "rb");
|
||||
if (fp) {
|
||||
// delete the file
|
||||
fclose(fp);
|
||||
if(_unlink(longname) == -1)
|
||||
{
|
||||
//ERROR - file is probably read only
|
||||
return 0;
|
||||
}
|
||||
else
|
||||
{
|
||||
return 1;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
//ERROR - file doesn't exist
|
||||
return 0;
|
||||
}
|
||||
return (_unlink(longname) != -1);
|
||||
}
|
||||
|
||||
|
||||
@@ -628,7 +644,7 @@ extern int game_cd_changed();
|
||||
// error ==> NULL
|
||||
//
|
||||
|
||||
CFILE *cfopen(const char *file_path, const char *mode, int type, int dir_type, bool localize)
|
||||
CFILE *_cfopen(const char* source, int line, const char *file_path, const char *mode, int type, int dir_type, bool localize)
|
||||
{
|
||||
/* Bobboau, what is this doing here? 31 is way too short... - Goober5000
|
||||
if( strlen(file_path) > 31 )
|
||||
@@ -713,7 +729,7 @@ CFILE *cfopen(const char *file_path, const char *mode, int type, int dir_type, b
|
||||
|
||||
FILE *fp = fopen(longname, happy_mode);
|
||||
if (fp) {
|
||||
return cf_open_fill_cfblock(fp, dir_type);
|
||||
return cf_open_fill_cfblock(source, line, fp, dir_type);
|
||||
}
|
||||
return NULL;
|
||||
}
|
||||
@@ -742,12 +758,12 @@ CFILE *cfopen(const char *file_path, const char *mode, int type, int dir_type, b
|
||||
hFile = CreateFile(longname, GENERIC_READ, FILE_SHARE_READ, NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL);
|
||||
|
||||
if (hFile != INVALID_HANDLE_VALUE) {
|
||||
return cf_open_mapped_fill_cfblock(hFile, dir_type);
|
||||
return cf_open_mapped_fill_cfblock(source, line, hFile, dir_type);
|
||||
}
|
||||
#elif defined SCP_UNIX
|
||||
FILE *fp = fopen( longname, "rb" );
|
||||
if (fp) {
|
||||
return cf_open_mapped_fill_cfblock(fp, dir_type);
|
||||
return cf_open_mapped_fill_cfblock(source, line, fp, dir_type);
|
||||
}
|
||||
#endif
|
||||
}
|
||||
@@ -759,10 +775,10 @@ CFILE *cfopen(const char *file_path, const char *mode, int type, int dir_type, b
|
||||
if ( fp ) {
|
||||
if ( offset ) {
|
||||
// Found it in a pack file
|
||||
return cf_open_packed_cfblock(fp, dir_type, offset, size );
|
||||
return cf_open_packed_cfblock(source, line, fp, dir_type, offset, size );
|
||||
} else {
|
||||
// Found it in a normal file
|
||||
return cf_open_fill_cfblock(fp, dir_type);
|
||||
return cf_open_fill_cfblock(source, line, fp, dir_type);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -783,7 +799,7 @@ CFILE *cfopen(const char *file_path, const char *mode, int type, int dir_type, b
|
||||
// returns: success ==> address of CFILE structure
|
||||
// error ==> NULL
|
||||
//
|
||||
CFILE *cfopen_special(const char *file_path, const char *mode, const int size, const int offset, int dir_type)
|
||||
CFILE *_cfopen_special(const char* source, int line, const char *file_path, const char *mode, const int size, const int offset, int dir_type)
|
||||
{
|
||||
if ( !cfile_inited) {
|
||||
Int3();
|
||||
@@ -808,10 +824,10 @@ CFILE *cfopen_special(const char *file_path, const char *mode, const int size, c
|
||||
|
||||
if ( offset ) {
|
||||
// it's in a pack file
|
||||
return cf_open_packed_cfblock(fp, dir_type, offset, size);
|
||||
return cf_open_packed_cfblock(source, line, fp, dir_type, offset, size);
|
||||
} else {
|
||||
// it's a normal file
|
||||
return cf_open_fill_cfblock(fp, dir_type);
|
||||
return cf_open_fill_cfblock(source, line, fp, dir_type);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -830,7 +846,7 @@ CFILE *ctmpfile()
|
||||
FILE *fp;
|
||||
fp = tmpfile();
|
||||
if ( fp )
|
||||
return cf_open_fill_cfblock(fp, 0);
|
||||
return cf_open_fill_cfblock(LOCATION, fp, 0);
|
||||
else
|
||||
return NULL;
|
||||
}
|
||||
@@ -843,7 +859,7 @@ CFILE *ctmpfile()
|
||||
// returns: success ==> index in Cfile_block_list[] array
|
||||
// failure ==> -1
|
||||
//
|
||||
int cfget_cfile_block()
|
||||
static int cfget_cfile_block()
|
||||
{
|
||||
int i;
|
||||
Cfile_block *cb;
|
||||
@@ -860,7 +876,13 @@ int cfget_cfile_block()
|
||||
|
||||
// If we've reached this point, a free Cfile_block could not be found
|
||||
nprintf(("Warning","A free Cfile_block could not be found.\n"));
|
||||
Assert(0); // out of free cfile blocks
|
||||
|
||||
// Dump a list of all opened files
|
||||
mprintf(("Out of cfile blocks! Currently opened files:\n"));
|
||||
dump_opened_files();
|
||||
|
||||
Assertion(false, "There are no more free cfile blocks. This means that there are too many files opened by FSO.\n"
|
||||
"This is probably caused by a programming or scripting error where a file does not get closed."); // out of free cfile blocks
|
||||
return -1;
|
||||
}
|
||||
|
||||
@@ -938,7 +960,7 @@ int cf_is_valid(CFILE *cfile)
|
||||
// returns: success ==> ptr to CFILE structure.
|
||||
// error ==> NULL
|
||||
//
|
||||
CFILE *cf_open_fill_cfblock(FILE *fp, int type)
|
||||
static CFILE *cf_open_fill_cfblock(const char* source, int line, FILE *fp, int type)
|
||||
{
|
||||
int cfile_block_index;
|
||||
|
||||
@@ -957,6 +979,9 @@ CFILE *cf_open_fill_cfblock(FILE *fp, int type)
|
||||
cfbp->fp = fp;
|
||||
cfbp->dir_type = type;
|
||||
cfbp->max_read_len = 0;
|
||||
|
||||
cfbp->source_file = source;
|
||||
cfbp->line_num = line;
|
||||
|
||||
int pos = ftell(fp);
|
||||
if(pos == -1L)
|
||||
@@ -974,7 +999,7 @@ CFILE *cf_open_fill_cfblock(FILE *fp, int type)
|
||||
// returns: success ==> ptr to CFILE structure.
|
||||
// error ==> NULL
|
||||
//
|
||||
CFILE *cf_open_packed_cfblock(FILE *fp, int type, int offset, int size)
|
||||
static CFILE *cf_open_packed_cfblock(const char* source, int line, FILE *fp, int type, int offset, int size)
|
||||
{
|
||||
// Found it in a pack file
|
||||
int cfile_block_index;
|
||||
@@ -996,6 +1021,9 @@ CFILE *cf_open_packed_cfblock(FILE *fp, int type, int offset, int size)
|
||||
cfbp->dir_type = type;
|
||||
cfbp->max_read_len = 0;
|
||||
|
||||
cfbp->source_file = source;
|
||||
cfbp->line_num = line;
|
||||
|
||||
cf_init_lowlevel_read_code(cfp,offset, size, 0 );
|
||||
|
||||
return cfp;
|
||||
@@ -1011,9 +1039,9 @@ CFILE *cf_open_packed_cfblock(FILE *fp, int type, int offset, int size)
|
||||
// returns: ptr CFILE structure.
|
||||
//
|
||||
#if defined _WIN32
|
||||
CFILE *cf_open_mapped_fill_cfblock(HANDLE hFile, int type)
|
||||
static CFILE *cf_open_mapped_fill_cfblock(const char* source, int line, HANDLE hFile, int type)
|
||||
#elif defined SCP_UNIX
|
||||
CFILE *cf_open_mapped_fill_cfblock(FILE *fp, int type)
|
||||
static CFILE *cf_open_mapped_fill_cfblock(const char* source, int line, FILE *fp, int type)
|
||||
#endif
|
||||
{
|
||||
int cfile_block_index;
|
||||
@@ -1040,6 +1068,9 @@ CFILE *cf_open_mapped_fill_cfblock(FILE *fp, int type)
|
||||
#endif
|
||||
cfbp->dir_type = type;
|
||||
|
||||
cfbp->source_file = source;
|
||||
cfbp->line_num = line;
|
||||
|
||||
cf_init_lowlevel_read_code(cfp, 0, 0, 0 );
|
||||
#if defined _WIN32
|
||||
cfbp->hMapFile = CreateFileMapping(cfbp->hInFile, NULL, PAGE_READONLY, 0, 0, NULL);
|
||||
@@ -1575,7 +1606,7 @@ char *cfgets(char *buf, int n, CFILE *cfile)
|
||||
// CRC code for mission validation. given to us by Kevin Bentley on 7/20/98. Some sort of
|
||||
// checksumming code that he wrote a while ago.
|
||||
#define CRC32_POLYNOMIAL 0xEDB88320
|
||||
uint CRCTable[256];
|
||||
static uint CRCTable[256];
|
||||
|
||||
#define CF_CHKSUM_SAMPLE_SIZE 512
|
||||
|
||||
@@ -1612,7 +1643,7 @@ uint cf_add_chksum_long(uint seed, ubyte *buffer, int size)
|
||||
return crc;
|
||||
}
|
||||
|
||||
void cf_chksum_long_init()
|
||||
static void cf_chksum_long_init()
|
||||
{
|
||||
int i, j;
|
||||
uint crc;
|
||||
@@ -1633,7 +1664,7 @@ void cf_chksum_long_init()
|
||||
|
||||
// single function convenient to use for both short and long checksums
|
||||
// NOTE : only one of chk_short or chk_long must be non-NULL (indicating which checksum to perform)
|
||||
int cf_chksum_do(CFILE *cfile, ushort *chk_short, uint *chk_long, int max_size)
|
||||
static int cf_chksum_do(CFILE *cfile, ushort *chk_short, uint *chk_long, int max_size)
|
||||
{
|
||||
ubyte cf_buffer[CF_CHKSUM_SAMPLE_SIZE];
|
||||
int is_long;
|
||||
|
||||
+7
-5
@@ -78,9 +78,8 @@ typedef struct {
|
||||
#define CF_TYPE_INTEL_ANIMS 34
|
||||
#define CF_TYPE_SCRIPTS 35
|
||||
#define CF_TYPE_FICTION 36
|
||||
#define CF_TYPE_TEMP_SUBDIR_LOOKUP 37
|
||||
|
||||
#define CF_MAX_PATH_TYPES 38 // Can be as high as you'd like //DTP; yeah but beware alot of things uses CF_MAX_PATH_TYPES
|
||||
#define CF_MAX_PATH_TYPES 37 // Can be as high as you'd like //DTP; yeah but beware alot of things uses CF_MAX_PATH_TYPES
|
||||
|
||||
|
||||
// TRUE if type is specified and valid
|
||||
@@ -115,7 +114,6 @@ extern char Cfile_user_dir[CFILE_ROOT_DIRECTORY_LEN];
|
||||
#endif
|
||||
|
||||
//================= LOW-LEVEL FUNCTIONS ==================
|
||||
// Call this once at the beginning of the program
|
||||
int cfile_init(const char *exe_dir, const char *cdrom_dir=NULL);
|
||||
|
||||
// Call this if pack files got added or removed or the
|
||||
@@ -131,11 +129,15 @@ int cf_get_dir_type(CFILE *cfile);
|
||||
|
||||
// Opens the file. If no path is given, use the extension to look into the
|
||||
// default path. If mode is NULL, delete the file.
|
||||
CFILE *cfopen(const char *filename, const char *mode, int type = CFILE_NORMAL, int dir_type = CF_TYPE_ANY, bool localize = false);
|
||||
CFILE *_cfopen(const char* source_file, int line, const char *filename, const char *mode,
|
||||
int type = CFILE_NORMAL, int dir_type = CF_TYPE_ANY, bool localize = false);
|
||||
#define cfopen(...) _cfopen(LOCATION, __VA_ARGS__) // Pass source location to the function
|
||||
|
||||
// like cfopen(), but it accepts a fully qualified path only (ie, the result of a cf_find_file_location() call)
|
||||
// NOTE: only supports reading files!!
|
||||
CFILE *cfopen_special(const char *file_path, const char *mode, const int size, const int offset, int dir_type = CF_TYPE_ANY);
|
||||
CFILE *_cfopen_special(const char* source_file, int line, const char *file_path, const char *mode,
|
||||
const int size, const int offset, int dir_type = CF_TYPE_ANY);
|
||||
#define cfopen_special(...) _cfopen_special(LOCATION, __VA_ARGS__) // Pass source location to the function
|
||||
|
||||
// Flush the open file buffer
|
||||
int cflush(CFILE *cfile);
|
||||
|
||||
@@ -39,11 +39,13 @@ typedef struct Cfile_block {
|
||||
int size; // for packed files
|
||||
|
||||
size_t max_read_len; // max read offset, for special error handling
|
||||
|
||||
const char* source_file;
|
||||
int line_num;
|
||||
} Cfile_block;
|
||||
|
||||
#define MAX_CFILE_BLOCKS 64
|
||||
extern Cfile_block Cfile_block_list[MAX_CFILE_BLOCKS];
|
||||
extern CFILE Cfile_list[MAX_CFILE_BLOCKS];
|
||||
|
||||
// Called once to setup the low-level reading code.
|
||||
void cf_init_lowlevel_read_code( CFILE * cfile, int lib_offset, int size, int pos );
|
||||
|
||||
@@ -22,8 +22,8 @@
|
||||
#include <winbase.h> /* needed for memory mapping of file functions */
|
||||
#endif
|
||||
|
||||
#include "globalincs/pstypes.h"
|
||||
#include "cfile/cfile.h"
|
||||
#include "globalincs/pstypes.h"
|
||||
|
||||
|
||||
void cf_sort_filenames( SCP_vector<SCP_string> &list, int sort, SCP_vector<file_list_info> *info )
|
||||
|
||||
+17
-16
@@ -9,13 +9,12 @@
|
||||
|
||||
|
||||
|
||||
#include "globalincs/pstypes.h"
|
||||
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#include <stdio.h>
|
||||
#include <errno.h>
|
||||
#include <sstream>
|
||||
#include <algorithm>
|
||||
|
||||
#ifdef _WIN32
|
||||
#include <io.h>
|
||||
@@ -33,13 +32,13 @@
|
||||
#include <unistd.h>
|
||||
#endif
|
||||
|
||||
#include "cmdline/cmdline.h"
|
||||
#include "cfile/cfile.h"
|
||||
#include "cfile/cfilesystem.h"
|
||||
#include "cmdline/cmdline.h"
|
||||
#include "globalincs/pstypes.h"
|
||||
#include "localization/localize.h"
|
||||
|
||||
|
||||
|
||||
#define CF_ROOTTYPE_PATH 0
|
||||
#define CF_ROOTTYPE_PACK 1
|
||||
|
||||
@@ -220,19 +219,15 @@ int cf_get_packfile_count(cf_root *root)
|
||||
}
|
||||
|
||||
// packfile sort function
|
||||
int cf_packfile_sort_func(const void *elem1, const void *elem2)
|
||||
bool cf_packfile_sort_func(const cf_root_sort &r1, const cf_root_sort &r2)
|
||||
{
|
||||
cf_root_sort *r1, *r2;
|
||||
r1 = (cf_root_sort*)elem1;
|
||||
r2 = (cf_root_sort*)elem2;
|
||||
|
||||
// if the 2 directory types are the same, do a string compare
|
||||
if(r1->cf_type == r2->cf_type){
|
||||
return stricmp(r1->path, r2->path);
|
||||
if (r1.cf_type == r2.cf_type) {
|
||||
return (stricmp(r1.path, r2.path) < 0);
|
||||
}
|
||||
|
||||
// otherwise return them in order of CF_TYPE_* precedence
|
||||
return (r1->cf_type < r2->cf_type) ? -1 : 1;
|
||||
return (r1.cf_type < r2.cf_type);
|
||||
}
|
||||
|
||||
// Go through a root and look for pack files
|
||||
@@ -341,7 +336,7 @@ void cf_build_pack_list( cf_root *root )
|
||||
Assert(root_index == temp_root_count);
|
||||
|
||||
// sort the roots
|
||||
qsort(temp_roots_sort, temp_root_count, sizeof(cf_root_sort), cf_packfile_sort_func);
|
||||
std::sort(temp_roots_sort, temp_roots_sort + temp_root_count, cf_packfile_sort_func);
|
||||
|
||||
// now insert them all into the real root list properly
|
||||
cf_root *new_root;
|
||||
@@ -670,7 +665,11 @@ void cf_search_root_pack(int root_index)
|
||||
VP_FILE_HEADER VP_header;
|
||||
|
||||
Assert( sizeof(VP_header) == 16 );
|
||||
fread(&VP_header, 1, sizeof(VP_header), fp);
|
||||
if (fread(&VP_header, sizeof(VP_header), 1, fp) != 1) {
|
||||
mprintf(("Skipping VP file ('%s') because the header could not be read...\n", root->path));
|
||||
fclose(fp);
|
||||
return;
|
||||
}
|
||||
|
||||
VP_header.version = INTEL_INT( VP_header.version ); //-V570
|
||||
VP_header.index_offset = INTEL_INT( VP_header.index_offset ); //-V570
|
||||
@@ -690,7 +689,10 @@ void cf_search_root_pack(int root_index)
|
||||
for (i=0; i<VP_header.num_files; i++ ) {
|
||||
VP_FILE find;
|
||||
|
||||
fread( &find, sizeof(VP_FILE), 1, fp );
|
||||
if (fread( &find, sizeof(VP_FILE), 1, fp ) != 1) {
|
||||
mprintf(("Failed to read file entry (currently in directory %s)!\n", search_path));
|
||||
break;
|
||||
}
|
||||
|
||||
find.offset = INTEL_INT( find.offset ); //-V570
|
||||
find.size = INTEL_INT( find.size ); //-V570
|
||||
@@ -901,7 +903,6 @@ int cf_find_file_location( const char *filespec, int pathtype, int max_out, char
|
||||
case CF_TYPE_MULTI_CACHE:
|
||||
case CF_TYPE_MISSIONS:
|
||||
case CF_TYPE_CACHE:
|
||||
case CF_TYPE_TEMP_SUBDIR_LOOKUP:
|
||||
cfs_slow_search = 1;
|
||||
break;
|
||||
|
||||
|
||||
+207
-89
@@ -12,13 +12,13 @@
|
||||
#include "camera/camera.h" //VIEWER_ZOOM_DEFAULT
|
||||
#include "cmdline/cmdline.h"
|
||||
#include "globalincs/linklist.h"
|
||||
#include "globalincs/pstypes.h"
|
||||
#include "globalincs/systemvars.h"
|
||||
#include "network/multi.h"
|
||||
#include "globalincs/version.h"
|
||||
#include "hud/hudconfig.h"
|
||||
#include "network/multi.h"
|
||||
#include "parse/scripting.h"
|
||||
#include "parse/sexp.h"
|
||||
#include "globalincs/version.h"
|
||||
#include "globalincs/pstypes.h"
|
||||
|
||||
#ifdef _WIN32
|
||||
#include <io.h>
|
||||
@@ -141,13 +141,12 @@ Flag exe_params[] =
|
||||
{ "-3dshockwave", "Enable 3D shockwaves", true, EASY_MEM_ALL_ON, EASY_DEFAULT_MEM, "Graphics", "http://www.hard-light.net/wiki/index.php/Command-Line_Reference#-3dshockwave" },
|
||||
{ "-post_process", "Enable post processing", true, EASY_ALL_ON, EASY_DEFAULT, "Graphics", "http://www.hard-light.net/wiki/index.php/Command-Line_Reference#-post_process" },
|
||||
{ "-soft_particles", "Enable soft particles", true, EASY_ALL_ON, EASY_DEFAULT, "Graphics", "http://www.hard-light.net/wiki/index.php/Command-Line_Reference#-soft_particles" },
|
||||
{ "-fxaa", "Enable FXAA anti-aliasing", true, EASY_MEM_ALL_ON, EASY_DEFAULT_MEM, "Graphics", "http://www.hard-light.net/wiki/index.php/Command-Line_Reference#-fxaa" },
|
||||
{ "-nolightshafts", "Disable lightshafts", true, EASY_DEFAULT, EASY_ALL_ON, "Graphics", "http://www.hard-light.net/wiki/index.php/Command-Line_Reference#-flightshaftsoff"},
|
||||
{ "-fxaa", "Enable FXAA anti-aliasing", true, EASY_MEM_ALL_ON, EASY_DEFAULT, "Graphics", "http://www.hard-light.net/wiki/index.php/Command-Line_Reference#-fxaa" },
|
||||
{ "-nolightshafts", "Disable lightshafts", true, EASY_DEFAULT, EASY_DEFAULT, "Graphics", "http://www.hard-light.net/wiki/index.php/Command-Line_Reference#-flightshaftsoff"},
|
||||
{ "-fb_explosions", "Enable Framebuffer Shockwaves", true, EASY_ALL_ON, EASY_DEFAULT, "Graphics", "http://www.hard-light.net/wiki/index.php/Command-Line_Reference#-fb_explosions", },
|
||||
|
||||
{ "-img2dds", "Compress non-compressed images", true, 0, EASY_DEFAULT, "Game Speed", "http://www.hard-light.net/wiki/index.php/Command-Line_Reference#-img2dds", },
|
||||
{ "-no_deferred", "Disable Deferred Lighting", true, EASY_DEFAULT_MEM, EASY_DEFAULT, "Graphics", "http://www.hard-light.net/wiki/index.php/Command-Line_Reference#-no_deferred"},
|
||||
{ "-enable_shadows", "Enable Shadows", true, EASY_MEM_ALL_ON, EASY_DEFAULT, "Graphics", "http://www.hard-light.net/wiki/index.php/Command-Line_Reference#-no_shadows"},
|
||||
{ "-no_vsync", "Disable vertical sync", true, 0, EASY_DEFAULT, "Game Speed", "http://www.hard-light.net/wiki/index.php/Command-Line_Reference#-no_vsync", },
|
||||
{ "-no_fps_capping", "Don't limit frames-per-second", true, 0, EASY_DEFAULT, "Game Speed", "http://www.hard-light.net/wiki/index.php/Command-Line_Reference#-no_fps_capping", },
|
||||
{ "-cache_bitmaps", "Cache bitmaps between missions", true, 0, EASY_DEFAULT_MEM, "Game Speed", "http://www.hard-light.net/wiki/index.php/Command-Line_Reference#-cache_bitmaps", },
|
||||
|
||||
{ "-dualscanlines", "Add another pair of scanning lines", true, 0, EASY_DEFAULT, "HUD", "http://www.hard-light.net/wiki/index.php/Command-Line_Reference#-dualscanlines", },
|
||||
@@ -166,6 +165,7 @@ Flag exe_params[] =
|
||||
{ "-snd_preload", "Preload mission game sounds", true, EASY_MEM_ALL_ON, EASY_DEFAULT_MEM, "Audio", "http://www.hard-light.net/wiki/index.php/Command-Line_Reference#-snd_preload", },
|
||||
{ "-nosound", "Disable all sound", false, 0, EASY_DEFAULT, "Audio", "http://www.hard-light.net/wiki/index.php/Command-Line_Reference#-nosound", },
|
||||
{ "-nomusic", "Disable music", false, 0, EASY_DEFAULT, "Audio", "http://www.hard-light.net/wiki/index.php/Command-Line_Reference#-nomusic", },
|
||||
{ "-no_enhanced_sound", "Disable enhanced sound", false, 0, EASY_DEFAULT, "Audio", "http://www.hard-light.net/wiki/index.php/Command-Line_Reference#-no_enhanced_sound", },
|
||||
|
||||
{ "-standalone", "Run as standalone server", false, 0, EASY_DEFAULT, "Multiplayer", "http://www.hard-light.net/wiki/index.php/Command-Line_Reference#-standalone", },
|
||||
{ "-startgame", "Skip mainhall and start hosting", false, 0, EASY_DEFAULT, "Multiplayer", "http://www.hard-light.net/wiki/index.php/Command-Line_Reference#-startgame", },
|
||||
@@ -181,14 +181,12 @@ Flag exe_params[] =
|
||||
{ "-noparseerrors", "Disable parsing errors", true, 0, EASY_DEFAULT, "Troubleshoot", "http://www.hard-light.net/wiki/index.php/Command-Line_Reference#-noparseerrors", },
|
||||
{ "-query_speech", "Check if this build has speech", true, 0, EASY_DEFAULT, "Troubleshoot", "http://www.hard-light.net/wiki/index.php/Command-Line_Reference#-query_speech", },
|
||||
{ "-novbo", "Disable OpenGL VBO", true, 0, EASY_DEFAULT, "Troubleshoot", "http://www.hard-light.net/wiki/index.php/Command-Line_Reference#-novbo", },
|
||||
{ "-noibx", "Don't use cached index buffers (IBX)", true, 0, EASY_DEFAULT, "Troubleshoot", "http://www.hard-light.net/wiki/index.php/Command-Line_Reference#-noibx", },
|
||||
{ "-loadallweps", "Load all weapons, even those not used", true, 0, EASY_DEFAULT, "Troubleshoot", "http://www.hard-light.net/wiki/index.php/Command-Line_Reference#-loadallweps", },
|
||||
{ "-disable_fbo", "Disable OpenGL RenderTargets", true, 0, EASY_DEFAULT, "Troubleshoot", "http://www.hard-light.net/wiki/index.php/Command-Line_Reference#-disable_fbo", },
|
||||
{ "-disable_pbo", "Disable OpenGL Pixel Buffer Objects", true, 0, EASY_DEFAULT, "Troubleshoot", "http://www.hard-light.net/wiki/index.php/Command-Line_Reference#-disable_pbo", },
|
||||
{ "-no_glsl", "Disable GLSL (shader) support", true, 0, EASY_DEFAULT, "Troubleshoot", "http://www.hard-light.net/wiki/index.php/Command-Line_Reference#-no_glsl", },
|
||||
{ "-ati_swap", "Fix colour issues on some ATI cards", true, 0, EASY_DEFAULT, "Troubleshoot", "http://www.hard-light.net/wiki/index.php/Command-Line_Reference#-ati_swap", },
|
||||
{ "-no_3d_sound", "Use only 2D/stereo for sound effects", true, 0, EASY_DEFAULT, "Troubleshoot", "http://www.hard-light.net/wiki/index.php/Command-Line_Reference#-no_3d_sound", },
|
||||
{ "-disable_glsl_model","Don't use shaders for model rendering", true, 0, EASY_DEFAULT, "Troubleshoot", "http://www.hard-light.net/wiki/index.php/Command-Line_Reference#-disable_glsl_model", },
|
||||
{ "-mipmap", "Enable mipmapping", true, 0, EASY_DEFAULT_MEM, "Troubleshoot", "http://www.hard-light.net/wiki/index.php/Command-Line_Reference#-mipmap", },
|
||||
#ifndef SCP_UNIX
|
||||
{ "-disable_di_mouse", "Don't use DirectInput for mouse control", true, 0, EASY_DEFAULT, "Troubleshoot", "http://www.hard-light.net/wiki/index.php/Command-Line_Reference#-disable_di_mouse", },
|
||||
@@ -196,6 +194,12 @@ Flag exe_params[] =
|
||||
{ "-use_gldrawelements","Don't use glDrawRangeElements", true, 0, EASY_DEFAULT, "Troubleshoot", "http://www.hard-light.net/wiki/index.php/Command-Line_Reference#-use_gldrawelements", },
|
||||
{ "-old_collision", "Use old collision detection system", true, EASY_DEFAULT, EASY_ALL_ON, "Troubleshoot", "http://www.hard-light.net/wiki/index.php/Command-Line_Reference#-old_collision", },
|
||||
{ "-gl_finish", "Fix input lag on some ATI+Linux systems", true, 0, EASY_DEFAULT, "Troubleshoot", "http://www.hard-light.net/wiki/index.php/Command-Line_Reference#-gl_finish", },
|
||||
{ "-no_batching", "Disable batched model rendering", true, 0, EASY_DEFAULT, "Troubleshoot", "", },
|
||||
{ "-no_geo_effects", "Disable geometry shader for effects", true, 0, EASY_DEFAULT, "Troubleshoot", "", },
|
||||
{ "-set_cpu_affinity", "Sets processor affinity to config value", true, 0, EASY_DEFAULT, "Troubleshoot", "", },
|
||||
#ifdef WIN32
|
||||
{ "-fix_registry", "Use a different registry path", true, 0, EASY_DEFAULT, "Troubleshoot", "", },
|
||||
#endif
|
||||
|
||||
{ "-ingame_join", "Allow in-game joining", true, 0, EASY_DEFAULT, "Experimental", "http://www.hard-light.net/wiki/index.php/Command-Line_Reference#-ingame_join", },
|
||||
{ "-voicer", "Enable voice recognition", true, 0, EASY_DEFAULT, "Experimental", "http://www.hard-light.net/wiki/index.php/Command-Line_Reference#-voicer", },
|
||||
@@ -227,6 +231,7 @@ Flag exe_params[] =
|
||||
{ "-profile_frame_time", "Profile engine subsystems", true, 0, EASY_DEFAULT, "Dev Tool", "http://www.hard-light.net/wiki/index.php/Command-Line_Reference#-profile_frame_timings", },
|
||||
{ "-profile_write_file", "Write profiling information to file", true, 0, EASY_DEFAULT, "Dev Tool", "http://www.hard-light.net/wiki/index.php/Command-Line_Reference#-profile_write_file", },
|
||||
{ "-no_unfocused_pause","Don't pause if the window isn't focused", true, 0, EASY_DEFAULT, "Dev Tool", "http://www.hard-light.net/wiki/index.php/Command-Line_Reference#-no_unfocused_pause", },
|
||||
{ "-benchmark_mode", "Puts the game into benchmark mode", true, 0, EASY_DEFAULT, "Dev Tool", "http://www.hard-light.net/wiki/index.php/Command-Line_Reference#-benchmark_mode", },
|
||||
};
|
||||
|
||||
// forward declaration
|
||||
@@ -243,6 +248,7 @@ cmdline_parm allowbelow_arg("-allowbelow", "Ranks below this can join multi", AT
|
||||
cmdline_parm standalone_arg("-standalone", NULL, AT_NONE);
|
||||
cmdline_parm nosound_arg("-nosound", NULL, AT_NONE); // Cmdline_freespace_no_sound
|
||||
cmdline_parm nomusic_arg("-nomusic", NULL, AT_NONE); // Cmdline_freespace_no_music
|
||||
cmdline_parm noenhancedsound_arg("-no_enhanced_sound", NULL, AT_NONE); // Cmdline_no_enhanced_sound
|
||||
cmdline_parm startgame_arg("-startgame", NULL, AT_NONE); // Cmdline_start_netgame
|
||||
cmdline_parm gameclosed_arg("-closed", NULL, AT_NONE); // Cmdline_closed_game
|
||||
cmdline_parm gamerestricted_arg("-restricted", NULL, AT_NONE); // Cmdline_restricted_game
|
||||
@@ -305,6 +311,10 @@ cmdline_parm fxaa_preset_arg("-fxaa_preset", "FXAA quality (0-9), requires -post
|
||||
cmdline_parm fb_explosions_arg("-fb_explosions", NULL, AT_NONE);
|
||||
cmdline_parm flightshaftsoff_arg("-nolightshafts", NULL, AT_NONE);
|
||||
cmdline_parm brieflighting_arg("-brief_lighting", NULL, AT_NONE);
|
||||
cmdline_parm no_batching("-no_batching", NULL, AT_NONE);
|
||||
cmdline_parm shadow_quality_arg("-shadow_quality", NULL, AT_INT);
|
||||
cmdline_parm enable_shadows_arg("-enable_shadows", NULL, AT_NONE);
|
||||
cmdline_parm no_deferred_lighting_arg("-no_deferred", NULL, AT_NONE); // Cmdline_no_deferred
|
||||
|
||||
float Cmdline_clip_dist = Default_min_draw_distance;
|
||||
float Cmdline_fov = 0.75f;
|
||||
@@ -328,17 +338,18 @@ bool Cmdline_fxaa = false;
|
||||
int Cmdline_fxaa_preset = 6;
|
||||
extern int Fxaa_preset_last_frame;
|
||||
bool Cmdline_fb_explosions = 0;
|
||||
bool Cmdline_no_batching = false;
|
||||
extern bool ls_force_off;
|
||||
bool Cmdline_brief_lighting = 0;
|
||||
int Cmdline_shadow_quality = 0;
|
||||
int Cmdline_no_deferred_lighting = 0;
|
||||
|
||||
// Game Speed related
|
||||
cmdline_parm cache_bitmaps_arg("-cache_bitmaps", NULL, AT_NONE); // Cmdline_cache_bitmaps
|
||||
cmdline_parm img2dds_arg("-img2dds", NULL, AT_NONE); // Cmdline_img2dds
|
||||
cmdline_parm no_fpscap("-no_fps_capping", "Don't limit frames-per-second", AT_NONE); // Cmdline_NoFPSCap
|
||||
cmdline_parm no_vsync_arg("-no_vsync", NULL, AT_NONE); // Cmdline_no_vsync
|
||||
|
||||
int Cmdline_cache_bitmaps = 0; // caching of bitmaps between missions (faster loads, can hit swap on reload with <512 Meg RAM though) - taylor
|
||||
int Cmdline_img2dds = 0;
|
||||
int Cmdline_NoFPSCap = 0; // Disable FPS capping - kazan
|
||||
int Cmdline_no_vsync = 0;
|
||||
|
||||
@@ -378,6 +389,7 @@ cmdline_parm voice_recognition_arg("-voicer", NULL, AT_NONE); // Cmdline_voice_r
|
||||
int Cmdline_query_speech = 0;
|
||||
int Cmdline_snd_preload = 0; // preload game sounds during mission load
|
||||
int Cmdline_voice_recognition = 0;
|
||||
int Cmdline_no_enhanced_sound = 0;
|
||||
|
||||
// MOD related
|
||||
cmdline_parm mod_arg("-mod", "List of folders to overwrite/add-to the default data", AT_STRING, true); // Cmdline_mod -- DTP modsupport
|
||||
@@ -402,7 +414,6 @@ int Cmdline_objupd = 3; // client object updates on LAN by default
|
||||
// Troubleshooting
|
||||
cmdline_parm loadallweapons_arg("-loadallweps", NULL, AT_NONE); // Cmdline_load_all_weapons
|
||||
cmdline_parm htl_arg("-nohtl", NULL, AT_NONE); // Cmdline_nohtl -- don't use HT&L
|
||||
cmdline_parm noibx_arg("-noibx", NULL, AT_NONE); // Cmdline_noibx
|
||||
cmdline_parm nomovies_arg("-nomovies", NULL, AT_NONE); // Cmdline_nomovies -- Allows video streaming
|
||||
cmdline_parm no_set_gamma_arg("-no_set_gamma", NULL, AT_NONE); // Cmdline_no_set_gamma
|
||||
cmdline_parm no_vbo_arg("-novbo", NULL, AT_NONE); // Cmdline_novbo
|
||||
@@ -412,16 +423,19 @@ cmdline_parm noglsl_arg("-no_glsl", NULL, AT_NONE); // Cmdline_noglsl -- disa
|
||||
cmdline_parm mipmap_arg("-mipmap", NULL, AT_NONE); // Cmdline_mipmap
|
||||
cmdline_parm atiswap_arg("-ati_swap", NULL, AT_NONE); // Cmdline_atiswap - Fix ATI color swap issue for screenshots.
|
||||
cmdline_parm no3dsound_arg("-no_3d_sound", NULL, AT_NONE); // Cmdline_no_3d_sound - Disable use of full 3D sounds
|
||||
cmdline_parm no_glsl_models_arg("-disable_glsl_model", NULL, AT_NONE); // Cmdline_no_glsl_model_rendering -- switches model rendering to fixed pipeline
|
||||
cmdline_parm no_di_mouse_arg("-disable_di_mouse", "Disable DirectInput mouse code (Windows only)", AT_NONE); // Cmdline_no_di_mouse -- Disables directinput use for mouse control
|
||||
cmdline_parm no_drawrangeelements("-use_gldrawelements", NULL, AT_NONE); // Cmdline_drawelements -- Uses glDrawElements instead of glDrawRangeElements
|
||||
cmdline_parm keyboard_layout("-keyboard_layout", "Specify keyboard layout (qwertz or azerty)", AT_STRING);
|
||||
cmdline_parm old_collision_system("-old_collision", NULL, AT_NONE); // Cmdline_old_collision_sys
|
||||
cmdline_parm gl_finish ("-gl_finish", NULL, AT_NONE);
|
||||
cmdline_parm no_geo_sdr_effects("-no_geo_effects", NULL, AT_NONE);
|
||||
cmdline_parm set_cpu_affinity("-set_cpu_affinity", NULL, AT_NONE);
|
||||
#ifdef WIN32
|
||||
cmdline_parm fix_registry("-fix_registry", NULL, AT_NONE);
|
||||
#endif
|
||||
|
||||
int Cmdline_load_all_weapons = 0;
|
||||
int Cmdline_nohtl = 0;
|
||||
int Cmdline_noibx = 0;
|
||||
int Cmdline_nomovies = 0;
|
||||
int Cmdline_no_set_gamma = 0;
|
||||
int Cmdline_novbo = 0; // turn off OGL VBO support, troubleshooting
|
||||
@@ -430,11 +444,15 @@ int Cmdline_no_pbo = 0;
|
||||
int Cmdline_noglsl = 0;
|
||||
int Cmdline_ati_color_swap = 0;
|
||||
int Cmdline_no_3d_sound = 0;
|
||||
int Cmdline_no_glsl_model_rendering = 0;
|
||||
int Cmdline_no_di_mouse = 0;
|
||||
int Cmdline_drawelements = 0;
|
||||
char* Cmdline_keyboard_layout = NULL;
|
||||
bool Cmdline_gl_finish = false;
|
||||
bool Cmdline_no_geo_sdr_effects = false;
|
||||
bool Cmdline_set_cpu_affinity = false;
|
||||
#ifdef WIN32
|
||||
bool Cmdline_alternate_registry_path = false;
|
||||
#endif
|
||||
|
||||
// Developer/Testing related
|
||||
cmdline_parm start_mission_arg("-start_mission", "Skip mainhall and run this mission", AT_STRING); // Cmdline_start_mission
|
||||
@@ -454,6 +472,7 @@ cmdline_parm debug_window_arg("-debug_window", NULL, AT_NONE); // Cmdline_debug_
|
||||
cmdline_parm window_arg("-window", NULL, AT_NONE); // Cmdline_window
|
||||
cmdline_parm fullscreen_window_arg("-fullscreen_window", "Fullscreen/borderless window (Windows only)", AT_NONE);
|
||||
cmdline_parm res_arg("-res", "Resolution, formatted like 1600x900", AT_STRING);
|
||||
cmdline_parm center_res_arg("-center_res", "Resolution of center monitor, formatted like 1600x900", AT_STRING);
|
||||
cmdline_parm verify_vps_arg("-verify_vps", NULL, AT_NONE); // Cmdline_verify_vps -- spew VP crcs to vp_crcs.txt
|
||||
cmdline_parm parse_cmdline_only(PARSE_COMMAND_LINE_STRING, "Ignore any cmdline_fso.cfg files", AT_NONE);
|
||||
#ifdef SCP_UNIX
|
||||
@@ -463,6 +482,8 @@ cmdline_parm reparse_mainhall_arg("-reparse_mainhall", NULL, AT_NONE); //Cmdline
|
||||
cmdline_parm frame_profile_arg("-profile_frame_time", NULL, AT_NONE); //Cmdline_frame_profile
|
||||
cmdline_parm frame_profile_write_file("-profile_write_file", NULL, AT_NONE); // Cmdline_profile_write_file
|
||||
cmdline_parm no_unfocused_pause_arg("-no_unfocused_pause", NULL, AT_NONE); //Cmdline_no_unfocus_pause
|
||||
cmdline_parm benchmark_mode_arg("-benchmark_mode", NULL, AT_NONE); //Cmdline_benchmark_mode
|
||||
|
||||
|
||||
char *Cmdline_start_mission = NULL;
|
||||
int Cmdline_old_collision_sys = 0;
|
||||
@@ -481,6 +502,7 @@ int Cmdline_debug_window = 0;
|
||||
int Cmdline_window = 0;
|
||||
int Cmdline_fullscreen_window = 0;
|
||||
char *Cmdline_res = 0;
|
||||
char *Cmdline_center_res = 0;
|
||||
int Cmdline_verify_vps = 0;
|
||||
#ifdef SCP_UNIX
|
||||
int Cmdline_no_grab = 0;
|
||||
@@ -489,6 +511,7 @@ int Cmdline_reparse_mainhall = 0;
|
||||
bool Cmdline_frame_profile = false;
|
||||
bool Cmdline_profile_write_file = false;
|
||||
bool Cmdline_no_unfocus_pause = false;
|
||||
bool Cmdline_benchmark_mode = false;
|
||||
|
||||
// Other
|
||||
cmdline_parm get_flags_arg("-get_flags", "Output the launcher flags file", AT_NONE);
|
||||
@@ -832,20 +855,21 @@ void os_init_cmdline(char *cmdline)
|
||||
size_t len = filelength( fileno(fp) ) + 2;
|
||||
buf = new char [len];
|
||||
|
||||
fgets(buf, len-1, fp);
|
||||
|
||||
// replace the newline character with a NULL
|
||||
if ( (p = strrchr(buf, '\n')) != NULL ) {
|
||||
*p = '\0';
|
||||
}
|
||||
if (fgets(buf, len-1, fp) != nullptr)
|
||||
{
|
||||
// replace the newline character with a NULL
|
||||
if ( (p = strrchr(buf, '\n')) != NULL ) {
|
||||
*p = '\0';
|
||||
}
|
||||
|
||||
#ifdef SCP_UNIX
|
||||
// append a space for the os_parse_parms() check
|
||||
strcat_s(buf, len, " ");
|
||||
// append a space for the os_parse_parms() check
|
||||
strcat_s(buf, len, " ");
|
||||
#endif
|
||||
|
||||
os_parse_parms(buf);
|
||||
os_validate_parms(buf);
|
||||
os_parse_parms(buf);
|
||||
os_validate_parms(buf);
|
||||
}
|
||||
delete [] buf;
|
||||
fclose(fp);
|
||||
}
|
||||
@@ -870,18 +894,20 @@ void os_init_cmdline(char *cmdline)
|
||||
size_t len = filelength( fileno(fp) ) + 2;
|
||||
buf = new char [len];
|
||||
|
||||
fgets(buf, len-1, fp);
|
||||
if (fgets(buf, len-1, fp) != nullptr)
|
||||
{
|
||||
// replace the newline character with a NULL
|
||||
if ( (p = strrchr(buf, '\n')) != NULL ) {
|
||||
*p = '\0';
|
||||
}
|
||||
|
||||
// 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_s(buf, len, " ");
|
||||
|
||||
os_parse_parms(buf);
|
||||
os_validate_parms(buf);
|
||||
}
|
||||
|
||||
// append a space for the os_parse_parms() check
|
||||
strcat_s(buf, len, " ");
|
||||
|
||||
os_parse_parms(buf);
|
||||
os_validate_parms(buf);
|
||||
delete [] buf;
|
||||
fclose(fp);
|
||||
}
|
||||
@@ -1016,6 +1042,100 @@ char *cmdline_parm::str()
|
||||
return args;
|
||||
}
|
||||
|
||||
#ifdef SCP_UNIX
|
||||
// Return a vector with all filesystem names of "parent/dir" relative to parent.
|
||||
// dir must not contain a slash.
|
||||
static SCP_vector<SCP_string> unix_get_single_dir_names(SCP_string parent, SCP_string dir)
|
||||
{
|
||||
SCP_vector<SCP_string> ret;
|
||||
|
||||
DIR *dp;
|
||||
if ((dp = opendir(parent.c_str())) == NULL) {
|
||||
Warning(LOCATION, "Can't open directory '%s' when searching mod paths. Ignoring. errno=%d", parent.c_str(), errno);
|
||||
return ret;
|
||||
}
|
||||
|
||||
dirent *dirp;
|
||||
while ((dirp = readdir(dp)) != NULL) {
|
||||
if (!stricmp(dirp->d_name, dir.c_str())) {
|
||||
ret.push_back(dirp->d_name);
|
||||
}
|
||||
}
|
||||
(void)closedir(dp);
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
// Return a vector with all filesystem names of "parent/dir" relative to parent.
|
||||
// Recurses to deal with slashes in dir.
|
||||
static SCP_vector<SCP_string> unix_get_dir_names(SCP_string parent, SCP_string dir)
|
||||
{
|
||||
size_t slash = dir.find_first_of("/\\");
|
||||
|
||||
// no subdirectories, no need to recurse
|
||||
if (slash == std::string::npos) {
|
||||
return unix_get_single_dir_names(parent, dir);
|
||||
}
|
||||
|
||||
// get the names of the first component of dir
|
||||
SCP_vector<SCP_string> this_dir_names = unix_get_single_dir_names(parent, dir.substr(0, slash));
|
||||
|
||||
SCP_string rest = dir.substr(slash + 1);
|
||||
|
||||
SCP_vector<SCP_string> ret;
|
||||
|
||||
// search for the rest of dir in each of these
|
||||
SCP_vector<SCP_string>::iterator ii, end = this_dir_names.end();
|
||||
for (ii = this_dir_names.begin(); ii != end; ++ii) {
|
||||
SCP_string this_dir_path = parent + "/" + *ii;
|
||||
SCP_vector<SCP_string> mod_path = unix_get_dir_names(this_dir_path, rest);
|
||||
|
||||
// add all found paths relative to parent
|
||||
SCP_vector<SCP_string>::iterator ii2, end2 = mod_path.end();
|
||||
for (ii2 = mod_path.begin(); ii2 != end2; ++ii2) {
|
||||
ret.push_back(*ii + "/" + *ii2);
|
||||
}
|
||||
}
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
// For case sensitive filesystems (e.g. Linux/BSD) perform case-insensitive dir matches.
|
||||
static void handle_unix_modlist(char **modlist, int *len)
|
||||
{
|
||||
// search filesystem for given paths
|
||||
SCP_vector<SCP_string> mod_paths;
|
||||
for (char *cur_mod = strtok(*modlist, ","); cur_mod != NULL; cur_mod = strtok(NULL, ","))
|
||||
{
|
||||
SCP_vector<SCP_string> this_mod_paths = unix_get_dir_names(".", cur_mod);
|
||||
if (this_mod_paths.empty()) {
|
||||
ReleaseWarning(LOCATION, "Can't find mod '%s'. Ignoring.", cur_mod);
|
||||
}
|
||||
mod_paths.insert(mod_paths.end(), this_mod_paths.begin(), this_mod_paths.end());
|
||||
}
|
||||
|
||||
// create new char[] to replace modlist
|
||||
size_t total_len = 0;
|
||||
SCP_vector<SCP_string>::iterator ii, end = mod_paths.end();
|
||||
for (ii = mod_paths.begin(); ii != end; ++ii) {
|
||||
total_len += ii->length() + 1;
|
||||
}
|
||||
|
||||
char *new_modlist = new char[total_len + 1];
|
||||
memset(new_modlist, 0, total_len + 1);
|
||||
end = mod_paths.end();
|
||||
for (ii = mod_paths.begin(); ii != end; ++ii) {
|
||||
strcat_s(new_modlist, total_len + 1, ii->c_str());
|
||||
strcat_s(new_modlist, total_len + 1, ","); // replace later with NUL
|
||||
}
|
||||
|
||||
// make the rest of the modlist manipulation unaware that anything happened here
|
||||
delete [] *modlist;
|
||||
*modlist = new_modlist;
|
||||
*len = total_len;
|
||||
}
|
||||
#endif /* SCP_UNIX */
|
||||
|
||||
// external entry point into this modules
|
||||
|
||||
bool SetCmdlineParams()
|
||||
@@ -1150,6 +1270,11 @@ bool SetCmdlineParams()
|
||||
Cmdline_freespace_no_music = 1;
|
||||
}
|
||||
|
||||
// Disable enhanced sound
|
||||
if (noenhancedsound_arg.found()) {
|
||||
Cmdline_no_enhanced_sound = 1;
|
||||
}
|
||||
|
||||
// should we start a network game
|
||||
if ( startgame_arg.found() ) {
|
||||
Cmdline_use_last_pilot = 1;
|
||||
@@ -1247,6 +1372,9 @@ bool SetCmdlineParams()
|
||||
if(res_arg.found()){
|
||||
Cmdline_res = res_arg.str();
|
||||
}
|
||||
if(center_res_arg.found()){
|
||||
Cmdline_center_res = center_res_arg.str();
|
||||
}
|
||||
if(almission_arg.found()){//DTP for autoload mission // developer oritentated
|
||||
Cmdline_almission = almission_arg.str();
|
||||
Cmdline_use_last_pilot = 1;
|
||||
@@ -1290,47 +1418,8 @@ bool SetCmdlineParams()
|
||||
strcpy_s(modlist, len+2, Cmdline_mod);
|
||||
|
||||
#ifdef SCP_UNIX
|
||||
// for case sensitive filesystems (e.g. Linux/BSD) perform case-insensitive dir matches
|
||||
DIR *dp;
|
||||
dirent *dirp;
|
||||
char *cur_pos, *temp;
|
||||
char cur_dir[CF_MAX_PATHNAME_LENGTH], delim[] = ",";
|
||||
SCP_vector<SCP_string> temp_modlist;
|
||||
size_t total_len = 0;
|
||||
|
||||
if ( !_getcwd(cur_dir, CF_MAX_PATHNAME_LENGTH ) ) {
|
||||
Error(LOCATION, "Can't get current working directory -- %d", errno );
|
||||
}
|
||||
|
||||
for (cur_pos = strtok(modlist, delim); cur_pos != NULL; cur_pos = strtok(NULL, delim))
|
||||
{
|
||||
if ((dp = opendir(cur_dir)) == NULL) {
|
||||
Error(LOCATION, "Can't open directory '%s' -- %d", cur_dir, errno );
|
||||
}
|
||||
|
||||
while ((dirp = readdir(dp)) != NULL) {
|
||||
if (!stricmp(dirp->d_name, cur_pos)) {
|
||||
temp_modlist.push_back(dirp->d_name);
|
||||
total_len += (strlen(dirp->d_name) + 1);
|
||||
}
|
||||
}
|
||||
(void)closedir(dp);
|
||||
}
|
||||
|
||||
// create new char[] to replace modlist
|
||||
char *new_modlist = new char[total_len+1];
|
||||
memset( new_modlist, 0, total_len + 1 );
|
||||
SCP_vector<SCP_string>::iterator ii, end = temp_modlist.end();
|
||||
for (ii = temp_modlist.begin(); ii != end; ++ii) {
|
||||
strcat_s(new_modlist, total_len+1, ii->c_str());
|
||||
strcat_s(new_modlist, total_len+1, ","); // replace later with NUL
|
||||
}
|
||||
|
||||
// make the rest of the function unaware that anything happened here
|
||||
temp = modlist;
|
||||
modlist = new_modlist;
|
||||
delete [] temp;
|
||||
len = total_len;
|
||||
// handle case-insensitive searching
|
||||
handle_unix_modlist(&modlist, &len);
|
||||
#endif
|
||||
|
||||
// null terminate each individual
|
||||
@@ -1456,10 +1545,6 @@ bool SetCmdlineParams()
|
||||
Cmdline_noglsl = 1;
|
||||
}
|
||||
|
||||
if (no_glsl_models_arg.found() ) {
|
||||
Cmdline_no_glsl_model_rendering = 1;
|
||||
}
|
||||
|
||||
if (fxaa_arg.found() ) {
|
||||
Cmdline_fxaa = true;
|
||||
|
||||
@@ -1474,9 +1559,6 @@ bool SetCmdlineParams()
|
||||
Cmdline_no_di_mouse = 1;
|
||||
}
|
||||
|
||||
if ( img2dds_arg.found() )
|
||||
Cmdline_img2dds = 1;
|
||||
|
||||
if ( glow_arg.found() )
|
||||
Cmdline_glow = 0;
|
||||
|
||||
@@ -1486,8 +1568,8 @@ bool SetCmdlineParams()
|
||||
if ( ship_choice_3d_arg.found() )
|
||||
Cmdline_ship_choice_3d = 1;
|
||||
|
||||
if ( weapon_choice_3d_arg.found() )
|
||||
Cmdline_weapon_choice_3d = 1;
|
||||
if ( weapon_choice_3d_arg.found() )
|
||||
Cmdline_weapon_choice_3d = 1;
|
||||
|
||||
if ( show_mem_usage_arg.found() )
|
||||
Cmdline_show_mem_usage = 1;
|
||||
@@ -1534,6 +1616,22 @@ bool SetCmdlineParams()
|
||||
Cmdline_gl_finish = true;
|
||||
}
|
||||
|
||||
if ( no_geo_sdr_effects.found() )
|
||||
{
|
||||
Cmdline_no_geo_sdr_effects = true;
|
||||
}
|
||||
|
||||
if (set_cpu_affinity.found())
|
||||
{
|
||||
Cmdline_set_cpu_affinity = true;
|
||||
}
|
||||
|
||||
#ifdef WIN32
|
||||
if (fix_registry.found()) {
|
||||
Cmdline_alternate_registry_path = true;
|
||||
}
|
||||
#endif
|
||||
|
||||
if ( snd_preload_arg.found() )
|
||||
{
|
||||
Cmdline_snd_preload = 1;
|
||||
@@ -1560,10 +1658,6 @@ bool SetCmdlineParams()
|
||||
if(dis_weapons.found())
|
||||
Cmdline_dis_weapons = 1;
|
||||
|
||||
if ( noibx_arg.found() ) {
|
||||
Cmdline_noibx = 1;
|
||||
}
|
||||
|
||||
if ( no_fbo_arg.found() ) {
|
||||
Cmdline_no_fbo = 1;
|
||||
}
|
||||
@@ -1616,6 +1710,11 @@ bool SetCmdlineParams()
|
||||
Cmdline_fb_explosions = 1;
|
||||
}
|
||||
|
||||
if ( no_batching.found() )
|
||||
{
|
||||
Cmdline_no_batching = true;
|
||||
}
|
||||
|
||||
if ( brieflighting_arg.found() )
|
||||
{
|
||||
Cmdline_brief_lighting = 1;
|
||||
@@ -1641,6 +1740,20 @@ bool SetCmdlineParams()
|
||||
Cmdline_reparse_mainhall = 1;
|
||||
}
|
||||
|
||||
if( enable_shadows_arg.found() )
|
||||
{
|
||||
Cmdline_shadow_quality = 2;
|
||||
if( shadow_quality_arg.found() )
|
||||
{
|
||||
Cmdline_shadow_quality = shadow_quality_arg.get_int();
|
||||
}
|
||||
}
|
||||
|
||||
if( no_deferred_lighting_arg.found() )
|
||||
{
|
||||
Cmdline_no_deferred_lighting = 1;
|
||||
}
|
||||
|
||||
if (frame_profile_arg.found() )
|
||||
{
|
||||
Cmdline_frame_profile = true;
|
||||
@@ -1656,6 +1769,11 @@ bool SetCmdlineParams()
|
||||
{
|
||||
Cmdline_no_unfocus_pause = true;
|
||||
}
|
||||
|
||||
if (benchmark_mode_arg.found())
|
||||
{
|
||||
Cmdline_benchmark_mode = true;
|
||||
}
|
||||
|
||||
//Deprecated flags - CommanderDJ
|
||||
if( deprecated_spec_arg.found() )
|
||||
|
||||
+11
-3
@@ -48,6 +48,7 @@ extern int Cmdline_use_last_pilot;
|
||||
extern int Cmdline_window;
|
||||
extern int Cmdline_fullscreen_window;
|
||||
extern char *Cmdline_res;
|
||||
extern char *Cmdline_center_res;
|
||||
|
||||
|
||||
// FSO OPTIONS -------------------------------------------------
|
||||
@@ -76,10 +77,12 @@ extern int Cmdline_bloom_intensity;
|
||||
extern bool Cmdline_fxaa;
|
||||
extern int Cmdline_fxaa_preset;
|
||||
extern bool Cmdline_fb_explosions;
|
||||
extern bool Cmdline_no_batching;
|
||||
extern int Cmdline_shadow_quality;
|
||||
extern int Cmdline_no_deferred_lighting;
|
||||
|
||||
// Game Speed related
|
||||
extern int Cmdline_cache_bitmaps;
|
||||
extern int Cmdline_img2dds;
|
||||
extern int Cmdline_NoFPSCap;
|
||||
extern int Cmdline_no_vsync;
|
||||
|
||||
@@ -102,6 +105,7 @@ extern int Cmdline_stretch_menu;
|
||||
extern int Cmdline_query_speech;
|
||||
extern int Cmdline_snd_preload;
|
||||
extern int Cmdline_voice_recognition;
|
||||
extern int Cmdline_no_enhanced_sound;
|
||||
|
||||
// MOD related
|
||||
extern char *Cmdline_mod; // DTP for mod support
|
||||
@@ -116,7 +120,6 @@ extern int Cmdline_objupd;
|
||||
// Troubleshooting
|
||||
extern int Cmdline_load_all_weapons;
|
||||
extern int Cmdline_nohtl;
|
||||
extern int Cmdline_noibx;
|
||||
extern int Cmdline_nomovies; // WMC Toggles movie playing support
|
||||
extern int Cmdline_no_set_gamma;
|
||||
extern int Cmdline_novbo;
|
||||
@@ -126,11 +129,15 @@ extern int Cmdline_noglsl;
|
||||
extern int Cmdline_mipmap;
|
||||
extern int Cmdline_ati_color_swap;
|
||||
extern int Cmdline_no_3d_sound;
|
||||
extern int Cmdline_no_glsl_model_rendering;
|
||||
extern int Cmdline_no_di_mouse;
|
||||
extern int Cmdline_drawelements;
|
||||
extern char* Cmdline_keyboard_layout;
|
||||
extern bool Cmdline_gl_finish;
|
||||
extern bool Cmdline_no_geo_sdr_effects;
|
||||
extern bool Cmdline_set_cpu_affinity;
|
||||
#ifdef WIN32
|
||||
extern bool Cmdline_alternate_registry_path;
|
||||
#endif
|
||||
|
||||
// Developer/Testing related
|
||||
extern char *Cmdline_start_mission;
|
||||
@@ -155,5 +162,6 @@ extern int Cmdline_reparse_mainhall;
|
||||
extern bool Cmdline_frame_profile;
|
||||
extern bool Cmdline_profile_write_file;
|
||||
extern bool Cmdline_no_unfocus_pause;
|
||||
extern bool Cmdline_benchmark_mode;
|
||||
|
||||
#endif
|
||||
@@ -10,17 +10,18 @@
|
||||
|
||||
|
||||
#include "cmeasure/cmeasure.h"
|
||||
#include "ship/ship.h"
|
||||
#include "math/staticrand.h"
|
||||
#include "object/object.h"
|
||||
#include "weapon/weapon.h"
|
||||
#include "hud/hud.h"
|
||||
#include "gamesnd/gamesnd.h"
|
||||
#include "network/multimsgs.h"
|
||||
#include "hud/hud.h"
|
||||
#include "math/staticrand.h"
|
||||
#include "mission/missionparse.h"
|
||||
#include "network/multimsgs.h"
|
||||
#include "object/object.h"
|
||||
#include "ship/ship.h"
|
||||
#include "weapon/weapon.h"
|
||||
|
||||
int Cmeasures_homing_check = 0;
|
||||
int Countermeasures_enabled = 1; // Debug, set to 0 means no one can fire countermeasures.
|
||||
const float CMEASURE_DETONATE_DISTANCE = 40.0f;
|
||||
|
||||
//Used to set a countermeasure velocity after being launched from a ship as a countermeasure
|
||||
//ie not as a primary or secondary.
|
||||
|
||||
@@ -22,6 +22,7 @@ class object;
|
||||
// Maximum distance at which a countermeasure can be tracked
|
||||
// If this value is too large, missiles will always be tracking countermeasures.
|
||||
#define MAX_CMEASURE_TRACK_DIST 300.0f
|
||||
extern const float CMEASURE_DETONATE_DISTANCE;
|
||||
|
||||
extern int Cmeasures_homing_check;
|
||||
extern int Countermeasures_enabled;
|
||||
|
||||
@@ -10,26 +10,26 @@
|
||||
|
||||
|
||||
|
||||
#include "freespace2/freespace.h"
|
||||
#include "controlconfig/controlsconfig.h"
|
||||
#include "debugconsole/console.h"
|
||||
#include "freespace2/freespace.h"
|
||||
#include "gamehelp/contexthelp.h"
|
||||
#include "gamesequence/gamesequence.h"
|
||||
#include "gamesnd/gamesnd.h"
|
||||
#include "globalincs/alphacolors.h"
|
||||
#include "graphics/font.h"
|
||||
#include "hud/hudsquadmsg.h"
|
||||
#include "io/joy.h"
|
||||
#include "io/key.h"
|
||||
#include "io/timer.h"
|
||||
#include "ui/ui.h"
|
||||
#include "io/joy.h"
|
||||
#include "gamesnd/gamesnd.h"
|
||||
#include "missionui/missionscreencommon.h"
|
||||
#include "graphics/font.h"
|
||||
#include "pilotfile/pilotfile.h"
|
||||
#include "gamehelp/contexthelp.h"
|
||||
#include "popup/popup.h"
|
||||
#include "ui/uidefs.h"
|
||||
#include "globalincs/alphacolors.h"
|
||||
#include "network/multi_pmsg.h"
|
||||
#include "network/multiutil.h"
|
||||
#include "parse/scripting.h"
|
||||
#include "debugconsole/console.h"
|
||||
#include "pilotfile/pilotfile.h"
|
||||
#include "popup/popup.h"
|
||||
#include "ui/ui.h"
|
||||
#include "ui/uidefs.h"
|
||||
|
||||
|
||||
#ifndef NDEBUG
|
||||
@@ -393,21 +393,10 @@ int control_config_detect_axis()
|
||||
|
||||
void control_config_conflict_check()
|
||||
{
|
||||
int i, j, shift = -1, alt = -1;
|
||||
|
||||
int i, j;
|
||||
|
||||
for (i=0; i<CCFG_MAX; i++) {
|
||||
Conflicts[i].key = Conflicts[i].joy = -1;
|
||||
switch (Control_config[i].key_id) {
|
||||
case KEY_LSHIFT:
|
||||
case KEY_RSHIFT:
|
||||
shift = i;
|
||||
break;
|
||||
|
||||
case KEY_LALT:
|
||||
case KEY_RALT:
|
||||
alt = i;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
for (i=0; i<NUM_TABS; i++) {
|
||||
@@ -468,15 +457,12 @@ void control_config_conflict_check()
|
||||
// do list setup required prior to rendering and checking for the controls listing. Called when list changes
|
||||
void control_config_list_prepare()
|
||||
{
|
||||
int j, k, y, z;
|
||||
int j, y, z;
|
||||
int font_height = gr_get_font_height();
|
||||
|
||||
Num_cc_lines = y = z = 0;
|
||||
while (z < CCFG_MAX) {
|
||||
if (Control_config[z].tab == Tab && !Control_config[z].disabled) {
|
||||
k = Control_config[z].key_id;
|
||||
j = Control_config[z].joy_id;
|
||||
|
||||
if (Control_config[z].hasXSTR) {
|
||||
Cc_lines[Num_cc_lines].label = XSTR(Control_config[z].text, CONTROL_CONFIG_XSTR + z);
|
||||
} else {
|
||||
@@ -666,7 +652,7 @@ void control_config_bind_axis(int i, int axis)
|
||||
|
||||
int control_config_remove_binding()
|
||||
{
|
||||
int z, j, k;
|
||||
int z;
|
||||
config_item_undo *ptr;
|
||||
|
||||
if (Selected_line < 0) {
|
||||
@@ -696,7 +682,6 @@ int control_config_remove_binding()
|
||||
return -1;
|
||||
}
|
||||
|
||||
j = k = -1;
|
||||
ptr = get_undo_block(1);
|
||||
ptr->index[0] = z;
|
||||
ptr->list[0] = Control_config[z];
|
||||
@@ -956,9 +941,9 @@ void control_config_reset_defaults(int presetnum)
|
||||
|
||||
// Reset keyboard defaults
|
||||
for (i=0; i<CCFG_MAX; i++) {
|
||||
// Note that key_default, joy_default and text_default are NOT
|
||||
// overwritten here; they should retain the values of the first preset
|
||||
Control_config[i].text = preset[i].text;
|
||||
// Note that key_default and joy_default are NOT overwritten here;
|
||||
// they should retain the values of the first preset because
|
||||
// for example the key-pressed SEXP works off the defaults of the first preset
|
||||
Control_config[i].key_id = preset[i].key_default;
|
||||
Control_config[i].joy_id = preset[i].joy_default;
|
||||
Control_config[i].tab = preset[i].tab;
|
||||
@@ -1439,8 +1424,8 @@ void control_config_close()
|
||||
void control_config_do_frame(float frametime)
|
||||
{
|
||||
const char *str;
|
||||
char buf[256], *jptr;
|
||||
int i, j, k, w, x, y, z, len, line, conflict;
|
||||
char buf[256];
|
||||
int i, j, k, w, x, y, z, line, conflict;
|
||||
int font_height = gr_get_font_height();
|
||||
int select_tease_line = -1; // line mouse is down on, but won't be selected until button released
|
||||
static float timer = 0.0f;
|
||||
@@ -1999,7 +1984,6 @@ void control_config_do_frame(float frametime)
|
||||
k = Control_config[z].key_id;
|
||||
j = Control_config[z].joy_id;
|
||||
x = Control_list_key_x[gr_screen.res];
|
||||
jptr = NULL;
|
||||
*buf = 0;
|
||||
|
||||
if ((k < 0) && (j < 0)) {
|
||||
@@ -2026,7 +2010,6 @@ void control_config_do_frame(float frametime)
|
||||
|
||||
gr_printf_menu(x, y, buf);
|
||||
|
||||
len = strlen(buf);
|
||||
Cc_lines[line].kx = x - Control_list_coords[gr_screen.res][CONTROL_X_COORD];
|
||||
gr_get_string_size(&w, NULL, buf);
|
||||
Cc_lines[line].kw = w;
|
||||
@@ -2116,7 +2099,7 @@ void control_config_do_frame(float frametime)
|
||||
bool this_preset_matches = true;
|
||||
config_item *this_preset = Control_config_presets[i];
|
||||
|
||||
for (int j=0; j<CCFG_MAX; j++) {
|
||||
for (j=0; j<CCFG_MAX; j++) {
|
||||
if (!Control_config[j].disabled && Control_config[j].key_id != this_preset[j].key_default) {
|
||||
this_preset_matches = false;
|
||||
break;
|
||||
@@ -2204,7 +2187,7 @@ void control_check_indicate()
|
||||
#ifndef NDEBUG
|
||||
if (Show_controls_info) {
|
||||
gr_set_color_fast(&HUD_color_debug);
|
||||
gr_printf_no_resize(gr_screen.max_w - 154, 5, NOX("Ctrls checked: %d"), Control_check_count);
|
||||
gr_printf_no_resize(gr_screen.center_offset_x + gr_screen.center_w - 154, gr_screen.center_offset_y + 5, NOX("Ctrls checked: %d"), Control_check_count);
|
||||
}
|
||||
#endif
|
||||
|
||||
@@ -2246,11 +2229,11 @@ int check_control_used(int id, int key)
|
||||
|
||||
// check what current modifiers are pressed
|
||||
mask = 0;
|
||||
if (keyd_pressed[KEY_LSHIFT] || keyd_pressed[KEY_RSHIFT]) {
|
||||
if (keyd_pressed[KEY_LSHIFT] || key_down_count(KEY_LSHIFT) || keyd_pressed[KEY_RSHIFT] || key_down_count(KEY_RSHIFT)) {
|
||||
mask |= KEY_SHIFTED;
|
||||
}
|
||||
|
||||
if (keyd_pressed[KEY_LALT] || keyd_pressed[KEY_RALT]) {
|
||||
if (keyd_pressed[KEY_LALT] || key_down_count(KEY_LALT) || keyd_pressed[KEY_RALT] || key_down_count(KEY_RALT)) {
|
||||
mask |= KEY_ALTED;
|
||||
}
|
||||
|
||||
@@ -2265,7 +2248,7 @@ int check_control_used(int id, int key)
|
||||
|
||||
z &= KEY_MASK;
|
||||
|
||||
if (keyd_pressed[z]) {
|
||||
if (keyd_pressed[z] || key_down_count(z)) {
|
||||
control_used(id);
|
||||
return 1;
|
||||
}
|
||||
@@ -2274,7 +2257,8 @@ int check_control_used(int id, int key)
|
||||
return 0;
|
||||
}
|
||||
|
||||
if ((Control_config[id].key_id == key) || joy_down_count(Control_config[id].joy_id, 1) || mouse_down_count(1 << Control_config[id].joy_id)) {
|
||||
if ((Control_config[id].key_id == key) || joy_down_count(Control_config[id].joy_id, 1) ||
|
||||
((Control_config[id].joy_id >= 0) && (Control_config[id].joy_id < MOUSE_NUM_BUTTONS) && mouse_down_count(1 << Control_config[id].joy_id))) {
|
||||
//mprintf(("Key used %d", key));
|
||||
control_used(id);
|
||||
return 1;
|
||||
|
||||
@@ -8,11 +8,11 @@
|
||||
*/
|
||||
|
||||
|
||||
#include "globalincs/pstypes.h"
|
||||
|
||||
#ifndef CONTROLS_CONFIG_H
|
||||
#define CONTROLS_CONFIG_H
|
||||
|
||||
#include "globalincs/pstypes.h"
|
||||
|
||||
#define CONTROL_CONFIG_XSTR 507
|
||||
|
||||
/*!
|
||||
@@ -63,14 +63,13 @@ typedef struct config_item {
|
||||
short joy_default; //!< default joystick button bound to action
|
||||
char tab; //!< what tab (category) it belongs in
|
||||
bool hasXSTR; //!< whether we should translate this with an XSTR
|
||||
char *default_text; //!< default description of the action
|
||||
char *text; //!< describes the action in the config screen
|
||||
char type; //!< manner control should be checked in
|
||||
short key_id; //!< actual key bound to action
|
||||
short joy_id; //!< joystick button bound to action
|
||||
int used; //!< has control been used yet in mission? If so, this is the timestamp
|
||||
bool disabled; //!< whether this action should be available at all
|
||||
bool continuous_ongoing;//!< whether this action is a continuous one and is currently ongoing
|
||||
char *text; //!< overridable description of the action
|
||||
} config_item;
|
||||
|
||||
/*!
|
||||
@@ -298,6 +297,7 @@ extern char **Scan_code_text;
|
||||
extern char **Joy_button_text;
|
||||
|
||||
void control_config_common_init(); //!< initialize common control config stuff - call at game startup after localization has been initialized
|
||||
void control_config_common_close(); //!< close common control config stuff - call at game shutdown
|
||||
|
||||
void control_config_init();
|
||||
void control_config_do_frame(float frametime);
|
||||
|
||||
@@ -12,12 +12,12 @@
|
||||
|
||||
#include "cfile/cfile.h"
|
||||
#include "controlconfig/controlsconfig.h"
|
||||
#include "io/key.h"
|
||||
#include "globalincs/def_files.h"
|
||||
#include "globalincs/systemvars.h"
|
||||
#include "io/joy.h"
|
||||
#include "io/key.h"
|
||||
#include "localization/localize.h"
|
||||
#include "parse/parselo.h"
|
||||
#include "globalincs/systemvars.h"
|
||||
#include "globalincs/def_files.h"
|
||||
|
||||
// z64: These enumerations MUST equal to those in controlsconfig.cpp...
|
||||
// z64: Really need a better way than this.
|
||||
@@ -45,153 +45,153 @@ int Invert_axis_defaults[JOY_NUM_AXES] = { 0, 0, 0, 0, 0, 0 };
|
||||
//XSTR:OFF
|
||||
config_item Control_config[CCFG_MAX + 1] = {
|
||||
// targeting a ship
|
||||
{ KEY_T, -1, TARGET_TAB, true, "Target Next Ship", CC_TYPE_TRIGGER, -1, -1, 0, false, false, NULL },
|
||||
{ KEY_SHIFTED | KEY_T, -1, TARGET_TAB, true, "Target Previous Ship", CC_TYPE_TRIGGER, -1, -1, 0, false, false, NULL },
|
||||
{ KEY_H, 2, TARGET_TAB, true, "Target Next Closest Hostile Ship", CC_TYPE_TRIGGER, -1, -1, 0, false, false, NULL },
|
||||
{ KEY_SHIFTED | KEY_H, -1, TARGET_TAB, true, "Target Previous Closest Hostile Ship", CC_TYPE_TRIGGER, -1, -1, 0, false, false, NULL },
|
||||
{ KEY_ALTED | KEY_H, -1, TARGET_TAB, true, "Toggle Auto Targeting", CC_TYPE_TRIGGER, -1, -1, 0, false, false, NULL },
|
||||
{ KEY_F, -1, TARGET_TAB, true, "Target Next Closest Friendly Ship", CC_TYPE_TRIGGER, -1, -1, 0, false, false, NULL },
|
||||
{ KEY_SHIFTED | KEY_F, -1, TARGET_TAB, true, "Target Previous Closest Friendly Ship", CC_TYPE_TRIGGER, -1, -1, 0, false, false, NULL },
|
||||
{ KEY_Y, 4, TARGET_TAB, true, "Target Ship in Reticle", CC_TYPE_TRIGGER, -1, -1, 0, false, false, NULL },
|
||||
{ KEY_G, -1, TARGET_TAB, true, "Target Target's Nearest Attacker", CC_TYPE_TRIGGER, -1, -1, 0, false, false, NULL },
|
||||
{ KEY_ALTED | KEY_Y, -1, TARGET_TAB, true, "Target Last Ship to Send Transmission", CC_TYPE_TRIGGER, -1, -1, 0, false, false, NULL },
|
||||
{ KEY_ALTED | KEY_T, -1, TARGET_TAB, true, "Turn Off Targeting", CC_TYPE_TRIGGER, -1, -1, 0, false, false, NULL },
|
||||
{ KEY_T, -1, TARGET_TAB, true, "Target Next Ship", CC_TYPE_TRIGGER, -1, -1, 0, false, false },
|
||||
{ KEY_SHIFTED | KEY_T, -1, TARGET_TAB, true, "Target Previous Ship", CC_TYPE_TRIGGER, -1, -1, 0, false, false },
|
||||
{ KEY_H, 2, TARGET_TAB, true, "Target Next Closest Hostile Ship", CC_TYPE_TRIGGER, -1, -1, 0, false, false },
|
||||
{ KEY_SHIFTED | KEY_H, -1, TARGET_TAB, true, "Target Previous Closest Hostile Ship", CC_TYPE_TRIGGER, -1, -1, 0, false, false },
|
||||
{ KEY_ALTED | KEY_H, -1, TARGET_TAB, true, "Toggle Auto Targeting", CC_TYPE_TRIGGER, -1, -1, 0, false, false },
|
||||
{ KEY_F, -1, TARGET_TAB, true, "Target Next Closest Friendly Ship", CC_TYPE_TRIGGER, -1, -1, 0, false, false },
|
||||
{ KEY_SHIFTED | KEY_F, -1, TARGET_TAB, true, "Target Previous Closest Friendly Ship", CC_TYPE_TRIGGER, -1, -1, 0, false, false },
|
||||
{ KEY_Y, 4, TARGET_TAB, true, "Target Ship in Reticle", CC_TYPE_TRIGGER, -1, -1, 0, false, false },
|
||||
{ KEY_G, -1, TARGET_TAB, true, "Target Target's Nearest Attacker", CC_TYPE_TRIGGER, -1, -1, 0, false, false },
|
||||
{ KEY_ALTED | KEY_Y, -1, TARGET_TAB, true, "Target Last Ship to Send Transmission", CC_TYPE_TRIGGER, -1, -1, 0, false, false },
|
||||
{ KEY_ALTED | KEY_T, -1, TARGET_TAB, true, "Turn Off Targeting", CC_TYPE_TRIGGER, -1, -1, 0, false, false },
|
||||
|
||||
// targeting a ship's subsystem
|
||||
{ KEY_V, -1, TARGET_TAB, true, "Target Subsystem in Reticle", CC_TYPE_TRIGGER, -1, -1, 0, false, false, NULL },
|
||||
{ KEY_S, -1, TARGET_TAB, true, "Target Next Subsystem", CC_TYPE_TRIGGER, -1, -1, 0, false, false, NULL },
|
||||
{ KEY_SHIFTED | KEY_S, -1, TARGET_TAB, true, "Target Previous Subsystem", CC_TYPE_TRIGGER, -1, -1, 0, false, false, NULL },
|
||||
{ KEY_ALTED | KEY_S, -1, TARGET_TAB, true, "Turn Off Targeting of Subsystems", CC_TYPE_TRIGGER, -1, -1, 0, false, false, NULL },
|
||||
{ KEY_V, -1, TARGET_TAB, true, "Target Subsystem in Reticle", CC_TYPE_TRIGGER, -1, -1, 0, false, false },
|
||||
{ KEY_S, -1, TARGET_TAB, true, "Target Next Subsystem", CC_TYPE_TRIGGER, -1, -1, 0, false, false },
|
||||
{ KEY_SHIFTED | KEY_S, -1, TARGET_TAB, true, "Target Previous Subsystem", CC_TYPE_TRIGGER, -1, -1, 0, false, false },
|
||||
{ KEY_ALTED | KEY_S, -1, TARGET_TAB, true, "Turn Off Targeting of Subsystems", CC_TYPE_TRIGGER, -1, -1, 0, false, false },
|
||||
|
||||
// matching speed
|
||||
{ KEY_M, -1, COMPUTER_TAB, true, "Match Target Speed", CC_TYPE_TRIGGER, -1, -1, 0, false, false, NULL },
|
||||
{ KEY_ALTED | KEY_M, -1, COMPUTER_TAB, true, "Toggle Auto Speed Matching", CC_TYPE_TRIGGER, -1, -1, 0, false, false, NULL },
|
||||
{ KEY_M, -1, COMPUTER_TAB, true, "Match Target Speed", CC_TYPE_TRIGGER, -1, -1, 0, false, false },
|
||||
{ KEY_ALTED | KEY_M, -1, COMPUTER_TAB, true, "Toggle Auto Speed Matching", CC_TYPE_TRIGGER, -1, -1, 0, false, false },
|
||||
|
||||
// weapons
|
||||
{ KEY_LCTRL, 0, WEAPON_TAB, true, "Fire Primary Weapon", CC_TYPE_CONTINUOUS, -1, -1, 0, false, false, NULL },
|
||||
{ KEY_SPACEBAR, 1, WEAPON_TAB, true, "Fire Secondary Weapon", CC_TYPE_CONTINUOUS, -1, -1, 0, false, false, NULL },
|
||||
{ KEY_PERIOD, -1, WEAPON_TAB, true, "Cycle Forward Primary Weapon", CC_TYPE_TRIGGER, -1, -1, 0, false, false, NULL },
|
||||
{ KEY_COMMA, -1, WEAPON_TAB, true, "Cycle Backward Primary Weapon", CC_TYPE_TRIGGER, -1, -1, 0, false, false, NULL },
|
||||
{ KEY_DIVIDE, -1, WEAPON_TAB, true, "Cycle Secondary Weapon Bank", CC_TYPE_TRIGGER, -1, -1, 0, false, false, NULL },
|
||||
{ KEY_SHIFTED | KEY_DIVIDE, -1, WEAPON_TAB, true, "Cycle Secondary Weapon Firing Rate", CC_TYPE_TRIGGER, -1, -1, 0, false, false, NULL },
|
||||
{ KEY_X, 3, WEAPON_TAB, true, "Launch Countermeasure", CC_TYPE_TRIGGER, -1, -1, 0, false, false, NULL },
|
||||
{ KEY_LCTRL, 0, WEAPON_TAB, true, "Fire Primary Weapon", CC_TYPE_CONTINUOUS, -1, -1, 0, false, false },
|
||||
{ KEY_SPACEBAR, 1, WEAPON_TAB, true, "Fire Secondary Weapon", CC_TYPE_CONTINUOUS, -1, -1, 0, false, false },
|
||||
{ KEY_PERIOD, -1, WEAPON_TAB, true, "Cycle Forward Primary Weapon", CC_TYPE_TRIGGER, -1, -1, 0, false, false },
|
||||
{ KEY_COMMA, -1, WEAPON_TAB, true, "Cycle Backward Primary Weapon", CC_TYPE_TRIGGER, -1, -1, 0, false, false },
|
||||
{ KEY_DIVIDE, -1, WEAPON_TAB, true, "Cycle Secondary Weapon Bank", CC_TYPE_TRIGGER, -1, -1, 0, false, false },
|
||||
{ KEY_SHIFTED | KEY_DIVIDE, -1, WEAPON_TAB, true, "Cycle Secondary Weapon Firing Rate", CC_TYPE_TRIGGER, -1, -1, 0, false, false },
|
||||
{ KEY_X, 3, WEAPON_TAB, true, "Launch Countermeasure", CC_TYPE_TRIGGER, -1, -1, 0, false, false },
|
||||
|
||||
// controls
|
||||
{ KEY_A, -1, SHIP_TAB, true, "Forward Thrust", CC_TYPE_CONTINUOUS, -1, -1, 0, false, false, NULL },
|
||||
{ KEY_Z, -1, SHIP_TAB, true, "Reverse Thrust", CC_TYPE_CONTINUOUS, -1, -1, 0, false, false, NULL },
|
||||
{ KEY_PAD7, -1, SHIP_TAB, true, "Bank Left", CC_TYPE_CONTINUOUS, -1, -1, 0, false, false, NULL },
|
||||
{ KEY_PAD9, -1, SHIP_TAB, true, "Bank Right", CC_TYPE_CONTINUOUS, -1, -1, 0, false, false, NULL },
|
||||
{ KEY_PAD8, -1, SHIP_TAB, true, "Pitch Forward", CC_TYPE_CONTINUOUS, -1, -1, 0, false, false, NULL },
|
||||
{ KEY_PAD2, -1, SHIP_TAB, true, "Pitch Backward", CC_TYPE_CONTINUOUS, -1, -1, 0, false, false, NULL },
|
||||
{ KEY_PAD4, -1, SHIP_TAB, true, "Turn Left", CC_TYPE_CONTINUOUS, -1, -1, 0, false, false, NULL },
|
||||
{ KEY_PAD6, -1, SHIP_TAB, true, "Turn Right", CC_TYPE_CONTINUOUS, -1, -1, 0, false, false, NULL },
|
||||
{ KEY_A, -1, SHIP_TAB, true, "Forward Thrust", CC_TYPE_CONTINUOUS, -1, -1, 0, false, false },
|
||||
{ KEY_Z, -1, SHIP_TAB, true, "Reverse Thrust", CC_TYPE_CONTINUOUS, -1, -1, 0, false, false },
|
||||
{ KEY_PAD7, -1, SHIP_TAB, true, "Bank Left", CC_TYPE_CONTINUOUS, -1, -1, 0, false, false },
|
||||
{ KEY_PAD9, -1, SHIP_TAB, true, "Bank Right", CC_TYPE_CONTINUOUS, -1, -1, 0, false, false },
|
||||
{ KEY_PAD8, -1, SHIP_TAB, true, "Pitch Forward", CC_TYPE_CONTINUOUS, -1, -1, 0, false, false },
|
||||
{ KEY_PAD2, -1, SHIP_TAB, true, "Pitch Backward", CC_TYPE_CONTINUOUS, -1, -1, 0, false, false },
|
||||
{ KEY_PAD4, -1, SHIP_TAB, true, "Turn Left", CC_TYPE_CONTINUOUS, -1, -1, 0, false, false },
|
||||
{ KEY_PAD6, -1, SHIP_TAB, true, "Turn Right", CC_TYPE_CONTINUOUS, -1, -1, 0, false, false },
|
||||
|
||||
// throttle controls
|
||||
{ KEY_BACKSP, -1, SHIP_TAB, true, "Set Throttle to Zero", CC_TYPE_TRIGGER, -1, -1, 0, false, false, NULL },
|
||||
{ KEY_SLASH, -1, SHIP_TAB, true, "Set Throttle to Max", CC_TYPE_TRIGGER, -1, -1, 0, false, false, NULL },
|
||||
{ KEY_LBRACKET, -1, SHIP_TAB, true, "Set Throttle to One-Third", CC_TYPE_TRIGGER, -1, -1, 0, false, false, NULL },
|
||||
{ KEY_RBRACKET, -1, SHIP_TAB, true, "Set Throttle to Two-Thirds", CC_TYPE_TRIGGER, -1, -1, 0, false, false, NULL },
|
||||
{ KEY_EQUAL, -1, SHIP_TAB, true, "Increase Throttle 5 Percent", CC_TYPE_TRIGGER, -1, -1, 0, false, false, NULL },
|
||||
{ KEY_MINUS, -1, SHIP_TAB, true, "Decrease Throttle 5 Percent", CC_TYPE_TRIGGER, -1, -1, 0, false, false, NULL },
|
||||
{ KEY_BACKSP, -1, SHIP_TAB, true, "Set Throttle to Zero", CC_TYPE_TRIGGER, -1, -1, 0, false, false },
|
||||
{ KEY_SLASH, -1, SHIP_TAB, true, "Set Throttle to Max", CC_TYPE_TRIGGER, -1, -1, 0, false, false },
|
||||
{ KEY_LBRACKET, -1, SHIP_TAB, true, "Set Throttle to One-Third", CC_TYPE_TRIGGER, -1, -1, 0, false, false },
|
||||
{ KEY_RBRACKET, -1, SHIP_TAB, true, "Set Throttle to Two-Thirds", CC_TYPE_TRIGGER, -1, -1, 0, false, false },
|
||||
{ KEY_EQUAL, -1, SHIP_TAB, true, "Increase Throttle 5 Percent", CC_TYPE_TRIGGER, -1, -1, 0, false, false },
|
||||
{ KEY_MINUS, -1, SHIP_TAB, true, "Decrease Throttle 5 Percent", CC_TYPE_TRIGGER, -1, -1, 0, false, false },
|
||||
|
||||
// squadmate messaging
|
||||
{ KEY_SHIFTED | KEY_A, -1, COMPUTER_TAB, true, "Attack My Target", CC_TYPE_TRIGGER, -1, -1, 0, false, false, NULL },
|
||||
{ KEY_SHIFTED | KEY_Z, -1, COMPUTER_TAB, true, "Disarm My Target", CC_TYPE_TRIGGER, -1, -1, 0, false, false, NULL },
|
||||
{ KEY_SHIFTED | KEY_D, -1, COMPUTER_TAB, true, "Disable My Target", CC_TYPE_TRIGGER, -1, -1, 0, false, false, NULL },
|
||||
{ KEY_SHIFTED | KEY_V, -1, COMPUTER_TAB, true, "Attack My Subsystem", CC_TYPE_TRIGGER, -1, -1, 0, false, false, NULL },
|
||||
{ KEY_SHIFTED | KEY_X, -1, COMPUTER_TAB, true, "Capture My Target", CC_TYPE_TRIGGER, -1, -1, 0, false, false, NULL },
|
||||
{ KEY_SHIFTED | KEY_E, -1, COMPUTER_TAB, true, "Engage Enemy", CC_TYPE_TRIGGER, -1, -1, 0, false, false, NULL },
|
||||
{ KEY_SHIFTED | KEY_W, -1, COMPUTER_TAB, true, "Form on My Wing", CC_TYPE_TRIGGER, -1, -1, 0, false, false, NULL },
|
||||
{ KEY_SHIFTED | KEY_I, -1, COMPUTER_TAB, true, "Ignore My Target", CC_TYPE_TRIGGER, -1, -1, 0, false, false, NULL },
|
||||
{ KEY_SHIFTED | KEY_P, -1, COMPUTER_TAB, true, "Protect My Target", CC_TYPE_TRIGGER, -1, -1, 0, false, false, NULL },
|
||||
{ KEY_SHIFTED | KEY_C, -1, COMPUTER_TAB, true, "Cover Me", CC_TYPE_TRIGGER, -1, -1, 0, false, false, NULL },
|
||||
{ KEY_SHIFTED | KEY_J, -1, COMPUTER_TAB, true, "Return to Base", CC_TYPE_TRIGGER, -1, -1, 0, false, false, NULL },
|
||||
{ KEY_SHIFTED | KEY_R, -1, COMPUTER_TAB, true, "Rearm Me", CC_TYPE_TRIGGER, -1, -1, 0, false, false, NULL },
|
||||
{ KEY_SHIFTED | KEY_A, -1, COMPUTER_TAB, true, "Attack My Target", CC_TYPE_TRIGGER, -1, -1, 0, false, false },
|
||||
{ KEY_SHIFTED | KEY_Z, -1, COMPUTER_TAB, true, "Disarm My Target", CC_TYPE_TRIGGER, -1, -1, 0, false, false },
|
||||
{ KEY_SHIFTED | KEY_D, -1, COMPUTER_TAB, true, "Disable My Target", CC_TYPE_TRIGGER, -1, -1, 0, false, false },
|
||||
{ KEY_SHIFTED | KEY_V, -1, COMPUTER_TAB, true, "Attack My Subsystem", CC_TYPE_TRIGGER, -1, -1, 0, false, false },
|
||||
{ KEY_SHIFTED | KEY_X, -1, COMPUTER_TAB, true, "Capture My Target", CC_TYPE_TRIGGER, -1, -1, 0, false, false },
|
||||
{ KEY_SHIFTED | KEY_E, -1, COMPUTER_TAB, true, "Engage Enemy", CC_TYPE_TRIGGER, -1, -1, 0, false, false },
|
||||
{ KEY_SHIFTED | KEY_W, -1, COMPUTER_TAB, true, "Form on My Wing", CC_TYPE_TRIGGER, -1, -1, 0, false, false },
|
||||
{ KEY_SHIFTED | KEY_I, -1, COMPUTER_TAB, true, "Ignore My Target", CC_TYPE_TRIGGER, -1, -1, 0, false, false },
|
||||
{ KEY_SHIFTED | KEY_P, -1, COMPUTER_TAB, true, "Protect My Target", CC_TYPE_TRIGGER, -1, -1, 0, false, false },
|
||||
{ KEY_SHIFTED | KEY_C, -1, COMPUTER_TAB, true, "Cover Me", CC_TYPE_TRIGGER, -1, -1, 0, false, false },
|
||||
{ KEY_SHIFTED | KEY_J, -1, COMPUTER_TAB, true, "Return to Base", CC_TYPE_TRIGGER, -1, -1, 0, false, false },
|
||||
{ KEY_SHIFTED | KEY_R, -1, COMPUTER_TAB, true, "Rearm Me", CC_TYPE_TRIGGER, -1, -1, 0, false, false },
|
||||
|
||||
{ KEY_R, 6, TARGET_TAB, true, "Target Closest Attacking Ship", CC_TYPE_TRIGGER, -1, -1, 0, false, false, NULL },
|
||||
{ KEY_R, 6, TARGET_TAB, true, "Target Closest Attacking Ship", CC_TYPE_TRIGGER, -1, -1, 0, false, false },
|
||||
|
||||
// Views
|
||||
{ KEY_PADMULTIPLY, -1, COMPUTER_TAB, true, "Chase View", CC_TYPE_TRIGGER, -1, -1, 0, false, false, NULL },
|
||||
{ KEY_PADPERIOD, -1, COMPUTER_TAB, true, "External View", CC_TYPE_TRIGGER, -1, -1, 0, false, false, NULL },
|
||||
{ KEY_PADENTER, -1, COMPUTER_TAB, true, "Toggle External Camera Lock", CC_TYPE_TRIGGER, -1, -1, 0, false, false, NULL },
|
||||
{ KEY_PAD0, -1, COMPUTER_TAB, true, "Free Look View", CC_TYPE_CONTINUOUS, -1, -1, 0, false, false, NULL }, // Not in use anymore (Swifty)
|
||||
{ KEY_PADDIVIDE, -1, COMPUTER_TAB, true, "Current Target View", CC_TYPE_TRIGGER, -1, -1, 0, false, false, NULL },
|
||||
{ KEY_PADPLUS, -1, COMPUTER_TAB, true, "Increase View Distance", CC_TYPE_CONTINUOUS, -1, -1, 0, false, false, NULL },
|
||||
{ KEY_PADMINUS, -1, COMPUTER_TAB, true, "Decrease View Distance", CC_TYPE_CONTINUOUS, -1, -1, 0, false, false, NULL },
|
||||
{ KEY_PAD5, -1, COMPUTER_TAB, true, "Center View", CC_TYPE_CONTINUOUS, -1, -1, 0, false, false, NULL },
|
||||
{ -1, 33, COMPUTER_TAB, true, "View Up", CC_TYPE_CONTINUOUS, -1, -1, 0, false, false, NULL },
|
||||
{ -1, 32, COMPUTER_TAB, true, "View Rear", CC_TYPE_CONTINUOUS, -1, -1, 0, false, false, NULL },
|
||||
{ -1, 34, COMPUTER_TAB, true, "View Left", CC_TYPE_CONTINUOUS, -1, -1, 0, false, false, NULL },
|
||||
{ -1, 35, COMPUTER_TAB, true, "View Right", CC_TYPE_CONTINUOUS, -1, -1, 0, false, false, NULL },
|
||||
{ KEY_PADMULTIPLY, -1, COMPUTER_TAB, true, "Chase View", CC_TYPE_TRIGGER, -1, -1, 0, false, false },
|
||||
{ KEY_PADPERIOD, -1, COMPUTER_TAB, true, "External View", CC_TYPE_TRIGGER, -1, -1, 0, false, false },
|
||||
{ KEY_PADENTER, -1, COMPUTER_TAB, true, "Toggle External Camera Lock", CC_TYPE_TRIGGER, -1, -1, 0, false, false },
|
||||
{ KEY_PAD0, -1, COMPUTER_TAB, true, "Free Look View", CC_TYPE_CONTINUOUS, -1, -1, 0, false, false }, // Not in use anymore (Swifty)
|
||||
{ KEY_PADDIVIDE, -1, COMPUTER_TAB, true, "Current Target View", CC_TYPE_TRIGGER, -1, -1, 0, false, false },
|
||||
{ KEY_PADPLUS, -1, COMPUTER_TAB, true, "Increase View Distance", CC_TYPE_CONTINUOUS, -1, -1, 0, false, false },
|
||||
{ KEY_PADMINUS, -1, COMPUTER_TAB, true, "Decrease View Distance", CC_TYPE_CONTINUOUS, -1, -1, 0, false, false },
|
||||
{ KEY_PAD5, -1, COMPUTER_TAB, true, "Center View", CC_TYPE_CONTINUOUS, -1, -1, 0, false, false },
|
||||
{ -1, 33, COMPUTER_TAB, true, "View Up", CC_TYPE_CONTINUOUS, -1, -1, 0, false, false },
|
||||
{ -1, 32, COMPUTER_TAB, true, "View Rear", CC_TYPE_CONTINUOUS, -1, -1, 0, false, false },
|
||||
{ -1, 34, COMPUTER_TAB, true, "View Left", CC_TYPE_CONTINUOUS, -1, -1, 0, false, false },
|
||||
{ -1, 35, COMPUTER_TAB, true, "View Right", CC_TYPE_CONTINUOUS, -1, -1, 0, false, false },
|
||||
|
||||
{ KEY_RAPOSTRO, -1, COMPUTER_TAB, true, "Cycle Radar Range", CC_TYPE_TRIGGER, -1, -1, 0, false, false, NULL },
|
||||
{ KEY_C, -1, COMPUTER_TAB, true, "Communications Menu", CC_TYPE_TRIGGER, -1, -1, 0, false, false, NULL },
|
||||
{ -1, -1, -1, true, "Show Objectives", CC_TYPE_TRIGGER, -1, -1, 0, false, false, NULL },
|
||||
{ KEY_ALTED | KEY_J, -1, COMPUTER_TAB, true, "Enter Subspace (End Mission)", CC_TYPE_TRIGGER, -1, -1, 0, false, false, NULL },
|
||||
{ KEY_J, -1, TARGET_TAB, true, "Target Target's Target", CC_TYPE_TRIGGER, -1, -1, 0, false, false, NULL },
|
||||
{ KEY_TAB, 5, SHIP_TAB, true, "Afterburner", CC_TYPE_CONTINUOUS, -1, -1, 0, false, false, NULL },
|
||||
{ KEY_RAPOSTRO, -1, COMPUTER_TAB, true, "Cycle Radar Range", CC_TYPE_TRIGGER, -1, -1, 0, false, false },
|
||||
{ KEY_C, -1, COMPUTER_TAB, true, "Communications Menu", CC_TYPE_TRIGGER, -1, -1, 0, false, false },
|
||||
{ -1, -1, -1, true, "Show Objectives", CC_TYPE_TRIGGER, -1, -1, 0, false, false },
|
||||
{ KEY_ALTED | KEY_J, -1, COMPUTER_TAB, true, "Enter Subspace (End Mission)", CC_TYPE_TRIGGER, -1, -1, 0, false, false },
|
||||
{ KEY_J, -1, TARGET_TAB, true, "Target Target's Target", CC_TYPE_TRIGGER, -1, -1, 0, false, false },
|
||||
{ KEY_TAB, 5, SHIP_TAB, true, "Afterburner", CC_TYPE_CONTINUOUS, -1, -1, 0, false, false },
|
||||
|
||||
{ KEY_INSERT, -1, COMPUTER_TAB, true, "Increase Weapon Energy", CC_TYPE_TRIGGER, -1, -1, 0, false, false, NULL },
|
||||
{ KEY_DELETE, -1, COMPUTER_TAB, true, "Decrease Weapon Energy", CC_TYPE_TRIGGER, -1, -1, 0, false, false, NULL },
|
||||
{ KEY_HOME, -1, COMPUTER_TAB, true, "Increase Shield Energy", CC_TYPE_TRIGGER, -1, -1, 0, false, false, NULL },
|
||||
{ KEY_END, -1, COMPUTER_TAB, true, "Decrease Shield Energy", CC_TYPE_TRIGGER, -1, -1, 0, false, false, NULL },
|
||||
{ KEY_PAGEUP, -1, COMPUTER_TAB, true, "Increase Engine Energy", CC_TYPE_TRIGGER, -1, -1, 0, false, false, NULL },
|
||||
{ KEY_PAGEDOWN, -1, COMPUTER_TAB, true, "Decrease Engine Energy", CC_TYPE_TRIGGER, -1, -1, 0, false, false, NULL },
|
||||
{ KEY_ALTED | KEY_D, -1, COMPUTER_TAB, true, "Equalize Energy Settings", CC_TYPE_TRIGGER, -1, -1, 0, false, false, NULL },
|
||||
{ KEY_INSERT, -1, COMPUTER_TAB, true, "Increase Weapon Energy", CC_TYPE_TRIGGER, -1, -1, 0, false, false },
|
||||
{ KEY_DELETE, -1, COMPUTER_TAB, true, "Decrease Weapon Energy", CC_TYPE_TRIGGER, -1, -1, 0, false, false },
|
||||
{ KEY_HOME, -1, COMPUTER_TAB, true, "Increase Shield Energy", CC_TYPE_TRIGGER, -1, -1, 0, false, false },
|
||||
{ KEY_END, -1, COMPUTER_TAB, true, "Decrease Shield Energy", CC_TYPE_TRIGGER, -1, -1, 0, false, false },
|
||||
{ KEY_PAGEUP, -1, COMPUTER_TAB, true, "Increase Engine Energy", CC_TYPE_TRIGGER, -1, -1, 0, false, false },
|
||||
{ KEY_PAGEDOWN, -1, COMPUTER_TAB, true, "Decrease Engine Energy", CC_TYPE_TRIGGER, -1, -1, 0, false, false },
|
||||
{ KEY_ALTED | KEY_D, -1, COMPUTER_TAB, true, "Equalize Energy Settings", CC_TYPE_TRIGGER, -1, -1, 0, false, false },
|
||||
|
||||
{ KEY_Q, 7, COMPUTER_TAB, true, "Equalize Shields", CC_TYPE_TRIGGER, -1, -1, 0, false, false, NULL },
|
||||
{ KEY_UP, -1, COMPUTER_TAB, true, "Augment Forward Shield", CC_TYPE_TRIGGER, -1, -1, 0, false, false, NULL },
|
||||
{ KEY_DOWN, -1, COMPUTER_TAB, true, "Augment Rear Shield", CC_TYPE_TRIGGER, -1, -1, 0, false, false, NULL },
|
||||
{ KEY_LEFT, -1, COMPUTER_TAB, true, "Augment Left Shield", CC_TYPE_TRIGGER, -1, -1, 0, false, false, NULL },
|
||||
{ KEY_RIGHT, -1, COMPUTER_TAB, true, "Augment Right Shield", CC_TYPE_TRIGGER, -1, -1, 0, false, false, NULL },
|
||||
{ KEY_SCROLLOCK, -1, COMPUTER_TAB, true, "Transfer Energy Laser->Shield", CC_TYPE_TRIGGER, -1, -1, 0, false, false, NULL },
|
||||
{ KEY_SHIFTED | KEY_SCROLLOCK, -1, COMPUTER_TAB, true, "Transfer Energy Shield->Laser", CC_TYPE_TRIGGER, -1, -1, 0, false, false, NULL },
|
||||
{ KEY_Q, 7, COMPUTER_TAB, true, "Equalize Shields", CC_TYPE_TRIGGER, -1, -1, 0, false, false },
|
||||
{ KEY_UP, -1, COMPUTER_TAB, true, "Augment Forward Shield", CC_TYPE_TRIGGER, -1, -1, 0, false, false },
|
||||
{ KEY_DOWN, -1, COMPUTER_TAB, true, "Augment Rear Shield", CC_TYPE_TRIGGER, -1, -1, 0, false, false },
|
||||
{ KEY_LEFT, -1, COMPUTER_TAB, true, "Augment Left Shield", CC_TYPE_TRIGGER, -1, -1, 0, false, false },
|
||||
{ KEY_RIGHT, -1, COMPUTER_TAB, true, "Augment Right Shield", CC_TYPE_TRIGGER, -1, -1, 0, false, false },
|
||||
{ KEY_SCROLLOCK, -1, COMPUTER_TAB, true, "Transfer Energy Laser->Shield", CC_TYPE_TRIGGER, -1, -1, 0, false, false },
|
||||
{ KEY_SHIFTED | KEY_SCROLLOCK, -1, COMPUTER_TAB, true, "Transfer Energy Shield->Laser", CC_TYPE_TRIGGER, -1, -1, 0, false, false },
|
||||
// { -1, -1, -1, true, "Show Damage Popup Window" },
|
||||
|
||||
{ -1, -1, SHIP_TAB, false, "Glide When Pressed", CC_TYPE_CONTINUOUS, -1, -1, 0, false, false, NULL },
|
||||
{ -1, -1, SHIP_TAB, false, "Glide When Pressed", CC_TYPE_CONTINUOUS, -1, -1, 0, false, false },
|
||||
//Backslash -- this was a convenient place for Glide When Pressed, as Show Damage Popup isn't used
|
||||
{ -1, -1, SHIP_TAB, true, "Bank When Pressed", CC_TYPE_CONTINUOUS, -1, -1, 0, false, false, NULL },
|
||||
{ -1, -1, -1, true, "Show Nav Map", CC_TYPE_TRIGGER, -1, -1, 0, false, false, NULL },
|
||||
{ KEY_ALTED | KEY_E, -1, COMPUTER_TAB, true, "Add or Remove Escort", CC_TYPE_TRIGGER, -1, -1, 0, false, false, NULL },
|
||||
{ KEY_ALTED | KEY_SHIFTED | KEY_E, -1, COMPUTER_TAB, true, "Clear Escort List", CC_TYPE_TRIGGER, -1, -1, 0, false, false, NULL },
|
||||
{ KEY_E, -1, TARGET_TAB, true, "Target Next Escort Ship", CC_TYPE_TRIGGER, -1, -1, 0, false, false, NULL },
|
||||
{ KEY_ALTED | KEY_R, -1, TARGET_TAB, true, "Target Closest Repair Ship", CC_TYPE_TRIGGER, -1, -1, 0, false, false, NULL },
|
||||
{ -1, -1, SHIP_TAB, true, "Bank When Pressed", CC_TYPE_CONTINUOUS, -1, -1, 0, false, false },
|
||||
{ -1, -1, -1, true, "Show Nav Map", CC_TYPE_TRIGGER, -1, -1, 0, false, false },
|
||||
{ KEY_ALTED | KEY_E, -1, COMPUTER_TAB, true, "Add or Remove Escort", CC_TYPE_TRIGGER, -1, -1, 0, false, false },
|
||||
{ KEY_ALTED | KEY_SHIFTED | KEY_E, -1, COMPUTER_TAB, true, "Clear Escort List", CC_TYPE_TRIGGER, -1, -1, 0, false, false },
|
||||
{ KEY_E, -1, TARGET_TAB, true, "Target Next Escort Ship", CC_TYPE_TRIGGER, -1, -1, 0, false, false },
|
||||
{ KEY_ALTED | KEY_R, -1, TARGET_TAB, true, "Target Closest Repair Ship", CC_TYPE_TRIGGER, -1, -1, 0, false, false },
|
||||
|
||||
{ KEY_U, -1, TARGET_TAB, true, "Target Next Uninspected Cargo", CC_TYPE_TRIGGER, -1, -1, 0, false, false, NULL },
|
||||
{ KEY_SHIFTED | KEY_U, -1, TARGET_TAB, true, "Target Previous Uninspected Cargo", CC_TYPE_TRIGGER, -1, -1, 0, false, false, NULL },
|
||||
{ KEY_N, -1, TARGET_TAB, true, "Target Newest Ship in Area", CC_TYPE_TRIGGER, -1, -1, 0, false, false, NULL },
|
||||
{ KEY_K, -1, TARGET_TAB, true, "Target Next Live Turret", CC_TYPE_TRIGGER, -1, -1, 0, false, false, NULL },
|
||||
{ KEY_SHIFTED | KEY_K, -1, TARGET_TAB, true, "Target Previous Live Turret", CC_TYPE_TRIGGER, -1, -1, 0, false, false, NULL },
|
||||
{ KEY_U, -1, TARGET_TAB, true, "Target Next Uninspected Cargo", CC_TYPE_TRIGGER, -1, -1, 0, false, false },
|
||||
{ KEY_SHIFTED | KEY_U, -1, TARGET_TAB, true, "Target Previous Uninspected Cargo", CC_TYPE_TRIGGER, -1, -1, 0, false, false },
|
||||
{ KEY_N, -1, TARGET_TAB, true, "Target Newest Ship in Area", CC_TYPE_TRIGGER, -1, -1, 0, false, false },
|
||||
{ KEY_K, -1, TARGET_TAB, true, "Target Next Live Turret", CC_TYPE_TRIGGER, -1, -1, 0, false, false },
|
||||
{ KEY_SHIFTED | KEY_K, -1, TARGET_TAB, true, "Target Previous Live Turret", CC_TYPE_TRIGGER, -1, -1, 0, false, false },
|
||||
|
||||
{ KEY_B, -1, TARGET_TAB, true, "Target Next Hostile Bomb or Bomber", CC_TYPE_TRIGGER, -1, -1, 0, false, false, NULL },
|
||||
{ KEY_SHIFTED | KEY_B, -1, TARGET_TAB, true, "Target Previous Hostile Bomb or Bomber", CC_TYPE_TRIGGER, -1, -1, 0, false, false, NULL },
|
||||
{ KEY_B, -1, TARGET_TAB, true, "Target Next Hostile Bomb or Bomber", CC_TYPE_TRIGGER, -1, -1, 0, false, false },
|
||||
{ KEY_SHIFTED | KEY_B, -1, TARGET_TAB, true, "Target Previous Hostile Bomb or Bomber", CC_TYPE_TRIGGER, -1, -1, 0, false, false },
|
||||
|
||||
// multiplayer messaging keys
|
||||
{ KEY_1, -1, COMPUTER_TAB, true, "(Multiplayer) Message All", CC_TYPE_TRIGGER, -1, -1, 0, false, false, NULL },
|
||||
{ KEY_2, -1, COMPUTER_TAB, true, "(Multiplayer) Message Friendly", CC_TYPE_TRIGGER, -1, -1, 0, false, false, NULL },
|
||||
{ KEY_3, -1, COMPUTER_TAB, true, "(Multiplayer) Message Hostile", CC_TYPE_TRIGGER, -1, -1, 0, false, false, NULL },
|
||||
{ KEY_4, -1, COMPUTER_TAB, true, "(Multiplayer) Message Target", CC_TYPE_TRIGGER, -1, -1, 0, false, false, NULL },
|
||||
{ KEY_ALTED | KEY_X, -1, COMPUTER_TAB, true, "(Multiplayer) Observer Zoom to Target", CC_TYPE_TRIGGER, -1, -1, 0, false, false, NULL },
|
||||
{ KEY_SHIFTED | KEY_PERIOD, -1, COMPUTER_TAB, true, "Increase Time Compression", CC_TYPE_TRIGGER, -1, -1, 0, false, false, NULL },
|
||||
{ KEY_SHIFTED | KEY_COMMA, -1, COMPUTER_TAB, true, "Decrease Time Compression", CC_TYPE_TRIGGER, -1, -1, 0, false, false, NULL },
|
||||
{ KEY_L, -1, COMPUTER_TAB, true, "Toggle High HUD Contrast", CC_TYPE_TRIGGER, -1, -1, 0, false, false, NULL },
|
||||
{ KEY_SHIFTED | KEY_N, -1, COMPUTER_TAB, true, "(Multiplayer) Toggle Network Info", CC_TYPE_TRIGGER, -1, -1, 0, false, false, NULL },
|
||||
{ KEY_SHIFTED | KEY_END, -1, COMPUTER_TAB, true, "(Multiplayer) Self Destruct", CC_TYPE_TRIGGER, -1, -1, 0, false, false, NULL },
|
||||
{ KEY_1, -1, COMPUTER_TAB, true, "(Multiplayer) Message All", CC_TYPE_TRIGGER, -1, -1, 0, false, false },
|
||||
{ KEY_2, -1, COMPUTER_TAB, true, "(Multiplayer) Message Friendly", CC_TYPE_TRIGGER, -1, -1, 0, false, false },
|
||||
{ KEY_3, -1, COMPUTER_TAB, true, "(Multiplayer) Message Hostile", CC_TYPE_TRIGGER, -1, -1, 0, false, false },
|
||||
{ KEY_4, -1, COMPUTER_TAB, true, "(Multiplayer) Message Target", CC_TYPE_TRIGGER, -1, -1, 0, false, false },
|
||||
{ KEY_ALTED | KEY_X, -1, COMPUTER_TAB, true, "(Multiplayer) Observer Zoom to Target", CC_TYPE_TRIGGER, -1, -1, 0, false, false },
|
||||
{ KEY_SHIFTED | KEY_PERIOD, -1, COMPUTER_TAB, true, "Increase Time Compression", CC_TYPE_TRIGGER, -1, -1, 0, false, false },
|
||||
{ KEY_SHIFTED | KEY_COMMA, -1, COMPUTER_TAB, true, "Decrease Time Compression", CC_TYPE_TRIGGER, -1, -1, 0, false, false },
|
||||
{ KEY_L, -1, COMPUTER_TAB, true, "Toggle High HUD Contrast", CC_TYPE_TRIGGER, -1, -1, 0, false, false },
|
||||
{ KEY_SHIFTED | KEY_N, -1, COMPUTER_TAB, true, "(Multiplayer) Toggle Network Info", CC_TYPE_TRIGGER, -1, -1, 0, false, false },
|
||||
{ KEY_SHIFTED | KEY_END, -1, COMPUTER_TAB, true, "(Multiplayer) Self Destruct", CC_TYPE_TRIGGER, -1, -1, 0, false, false },
|
||||
|
||||
// Misc
|
||||
{ KEY_SHIFTED | KEY_O, -1, COMPUTER_TAB, true, "Toggle HUD", CC_TYPE_TRIGGER, -1, -1, 0, false, false, NULL },
|
||||
{ KEY_SHIFTED | KEY_3, -1, SHIP_TAB, true, "Right Thrust", CC_TYPE_CONTINUOUS, -1, -1, 0, false, false, NULL },
|
||||
{ KEY_SHIFTED | KEY_1, -1, SHIP_TAB, true, "Left Thrust", CC_TYPE_CONTINUOUS, -1, -1, 0, false, false, NULL },
|
||||
{ KEY_SHIFTED | KEY_PADPLUS, -1, SHIP_TAB, true, "Up Thrust", CC_TYPE_CONTINUOUS, -1, -1, 0, false, false, NULL },
|
||||
{ KEY_SHIFTED | KEY_PADENTER, -1, SHIP_TAB, true, "Down Thrust", CC_TYPE_CONTINUOUS, -1, -1, 0, false, false, NULL },
|
||||
{ KEY_ALTED | KEY_SHIFTED | KEY_Q, -1, COMPUTER_TAB, true, "Toggle HUD Wireframe Target View", CC_TYPE_TRIGGER, -1, -1, 0, false, false, NULL },
|
||||
{ -1, -1, COMPUTER_TAB, false, "Top-Down View", CC_TYPE_TRIGGER, -1, -1, 0, false, false, NULL },
|
||||
{ -1, -1, COMPUTER_TAB, false, "Target Padlock View", CC_TYPE_TRIGGER, -1, -1, 0, false, false, NULL }, // (Swifty) Toggle for VM_TRACK
|
||||
{ KEY_SHIFTED | KEY_O, -1, COMPUTER_TAB, true, "Toggle HUD", CC_TYPE_TRIGGER, -1, -1, 0, false, false },
|
||||
{ KEY_SHIFTED | KEY_3, -1, SHIP_TAB, true, "Right Thrust", CC_TYPE_CONTINUOUS, -1, -1, 0, false, false },
|
||||
{ KEY_SHIFTED | KEY_1, -1, SHIP_TAB, true, "Left Thrust", CC_TYPE_CONTINUOUS, -1, -1, 0, false, false },
|
||||
{ KEY_SHIFTED | KEY_PADPLUS, -1, SHIP_TAB, true, "Up Thrust", CC_TYPE_CONTINUOUS, -1, -1, 0, false, false },
|
||||
{ KEY_SHIFTED | KEY_PADENTER, -1, SHIP_TAB, true, "Down Thrust", CC_TYPE_CONTINUOUS, -1, -1, 0, false, false },
|
||||
{ KEY_ALTED | KEY_SHIFTED | KEY_Q, -1, COMPUTER_TAB, true, "Toggle HUD Wireframe Target View", CC_TYPE_TRIGGER, -1, -1, 0, false, false },
|
||||
{ -1, -1, COMPUTER_TAB, false, "Top-Down View", CC_TYPE_TRIGGER, -1, -1, 0, false, false },
|
||||
{ -1, -1, COMPUTER_TAB, false, "Target Padlock View", CC_TYPE_TRIGGER, -1, -1, 0, false, false }, // (Swifty) Toggle for VM_TRACK
|
||||
// Auto Navigation Systen
|
||||
{ KEY_ALTED | KEY_A, -1, COMPUTER_TAB, false, "Toggle Auto Pilot", CC_TYPE_TRIGGER, -1, -1, 0, false, false, NULL },
|
||||
{ KEY_ALTED | KEY_N, -1, COMPUTER_TAB, false, "Cycle Nav Points", CC_TYPE_TRIGGER, -1, -1, 0, false, false, NULL },
|
||||
{ KEY_ALTED | KEY_G, -1, SHIP_TAB, false, "Toggle Gliding", CC_TYPE_TRIGGER, -1, -1, 0, false, false, NULL },
|
||||
{ KEY_O, -1, WEAPON_TAB, false, "Cycle Primary Weapon Firing Rate", CC_TYPE_TRIGGER, -1, -1, 0, false, false, NULL },
|
||||
{ KEY_ALTED | KEY_A, -1, COMPUTER_TAB, false, "Toggle Auto Pilot", CC_TYPE_TRIGGER, -1, -1, 0, false, false },
|
||||
{ KEY_ALTED | KEY_N, -1, COMPUTER_TAB, false, "Cycle Nav Points", CC_TYPE_TRIGGER, -1, -1, 0, false, false },
|
||||
{ KEY_ALTED | KEY_G, -1, SHIP_TAB, false, "Toggle Gliding", CC_TYPE_TRIGGER, -1, -1, 0, false, false },
|
||||
{ KEY_O, -1, WEAPON_TAB, false, "Cycle Primary Weapon Firing Rate", CC_TYPE_TRIGGER, -1, -1, 0, false, false },
|
||||
{ -1, -1, -1, false, "", CC_TYPE_TRIGGER, -1, -1, 0, false, false }
|
||||
};
|
||||
|
||||
@@ -592,9 +592,6 @@ void control_config_common_init()
|
||||
for (int i=0; i<CCFG_MAX; i++) {
|
||||
Control_config[i].disabled = false;
|
||||
Control_config[i].continuous_ongoing = false;
|
||||
|
||||
// init the overridable description with a copy of the default
|
||||
Control_config[i].text = strdup(Control_config[i].default_text);
|
||||
}
|
||||
|
||||
control_config_common_load_overrides();
|
||||
@@ -613,6 +610,16 @@ void control_config_common_init()
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* @brief close any common control config stuff, called at game_shutdown()
|
||||
*/
|
||||
void control_config_common_close()
|
||||
{
|
||||
// only need to worry control presets for now
|
||||
for (auto ii = Control_config_presets.cbegin(); ii != Control_config_presets.cend(); ++ii) {
|
||||
delete[] * ii;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
#include <map>
|
||||
@@ -834,7 +841,7 @@ void control_config_common_load_overrides()
|
||||
for (size_t i = 0; i < cCntrlAryLength; ++i) {
|
||||
config_item& r_ccConfig = cfg_preset[i];
|
||||
|
||||
if (!strcmp(szTempBuffer, r_ccConfig.default_text)) {
|
||||
if (!strcmp(szTempBuffer, r_ccConfig.text)) {
|
||||
/**
|
||||
* short key_default;
|
||||
* short joy_default;
|
||||
@@ -845,11 +852,6 @@ void control_config_common_load_overrides()
|
||||
|
||||
int iTemp;
|
||||
|
||||
if (optional_string("$New Name:")) {
|
||||
stuff_string(szTempBuffer, F_NAME, iBufferLength);
|
||||
r_ccConfig.text = strdup(szTempBuffer);
|
||||
}
|
||||
|
||||
if (optional_string("$Key Default:")) {
|
||||
if (optional_string("NONE")) {
|
||||
r_ccConfig.key_default = (short)-1;
|
||||
@@ -897,6 +899,9 @@ void control_config_common_load_overrides()
|
||||
if (optional_string("+Disable")) {
|
||||
r_ccConfig.disabled = true;
|
||||
}
|
||||
if (optional_string("$Disable:")) {
|
||||
stuff_boolean(&r_ccConfig.disabled);
|
||||
}
|
||||
|
||||
// Nerf the buffer now.
|
||||
szTempBuffer[0] = '\0';
|
||||
|
||||
@@ -10,17 +10,17 @@
|
||||
|
||||
|
||||
#include "cutscene/cutscenes.h"
|
||||
#include "ui/ui.h"
|
||||
#include "gamesnd/gamesnd.h"
|
||||
#include "gamesequence/gamesequence.h"
|
||||
#include "freespace2/freespace.h"
|
||||
#include "io/key.h"
|
||||
#include "movie.h"
|
||||
#include "popup/popup.h"
|
||||
#include "menuui/mainhallmenu.h"
|
||||
#include "gamesequence/gamesequence.h"
|
||||
#include "gamesnd/gamesnd.h"
|
||||
#include "globalincs/alphacolors.h"
|
||||
#include "io/key.h"
|
||||
#include "localization/localize.h"
|
||||
#include "menuui/mainhallmenu.h"
|
||||
#include "movie.h"
|
||||
#include "parse/parselo.h"
|
||||
#include "popup/popup.h"
|
||||
#include "ui/ui.h"
|
||||
|
||||
|
||||
extern int Cmdline_nomovies;
|
||||
|
||||
@@ -15,7 +15,7 @@ static void genLoopkupTable();
|
||||
|
||||
void decodeFrame16(ubyte *pFrame, ubyte *pMap, int mapRemain, unsigned char *pData, int dataRemain)
|
||||
{
|
||||
ubyte *pOrig, *pOffData, *pEnd, op;
|
||||
ubyte *pOrig, *pOffData, op;
|
||||
ushort offset;
|
||||
int length = 0, i, j, xb, yb;
|
||||
|
||||
@@ -32,7 +32,6 @@ void decodeFrame16(ubyte *pFrame, ubyte *pMap, int mapRemain, unsigned char *pDa
|
||||
offset = pData[0]|(pData[1]<<8);
|
||||
|
||||
pOffData = pData + offset;
|
||||
pEnd = pData + offset;
|
||||
|
||||
pData += 2;
|
||||
|
||||
@@ -55,7 +54,8 @@ void decodeFrame16(ubyte *pFrame, ubyte *pMap, int mapRemain, unsigned char *pDa
|
||||
}
|
||||
|
||||
if ((length-(pData-pOrig)) != 0) {
|
||||
nprintf(("MVE", "DEBUG: junk left over: %d,%d,%d\n", (pData-pOrig), length, (length-(pData-pOrig))));
|
||||
nprintf(("MVE", "DEBUG: junk left over: " PTRDIFF_T_ARG ",%d," PTRDIFF_T_ARG "\n",
|
||||
(pData-pOrig), length, (length-(pData-pOrig))));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -13,15 +13,15 @@
|
||||
#include <windows.h>
|
||||
#endif
|
||||
|
||||
#include "graphics/2d.h"
|
||||
#include "globalincs/systemvars.h"
|
||||
#include "cutscene/movie.h"
|
||||
#include "osapi/osapi.h"
|
||||
#include "cmdline/cmdline.h"
|
||||
#include "cfile/cfile.h"
|
||||
#include "cmdline/cmdline.h"
|
||||
#include "cutscene/cutscenes.h" // cutscene_mark_viewable()
|
||||
#include "cutscene/movie.h"
|
||||
#include "cutscene/mvelib.h"
|
||||
#include "cutscene/oggplayer.h"
|
||||
#include "globalincs/systemvars.h"
|
||||
#include "graphics/2d.h"
|
||||
#include "osapi/osapi.h"
|
||||
|
||||
extern int Game_mode;
|
||||
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
|
||||
|
||||
#include "globalincs/pstypes.h"
|
||||
#include "cutscene/mvelib.h"
|
||||
#include "cfile/cfile.h"
|
||||
#include "cutscene/mvelib.h"
|
||||
#include "globalincs/pstypes.h"
|
||||
|
||||
|
||||
static const char MVE_HEADER[] = "Interplay MVE File\x1A";
|
||||
|
||||
+23
-42
@@ -6,21 +6,21 @@
|
||||
#include <sys/time.h>
|
||||
#endif
|
||||
|
||||
#include "bmpman/bmpman.h"
|
||||
#include "cutscene/movie.h"
|
||||
#include "cutscene/mvelib.h"
|
||||
#include "globalincs/pstypes.h"
|
||||
#include "graphics/2d.h"
|
||||
#include "graphics/gropengl.h"
|
||||
#include "graphics/gropengltexture.h"
|
||||
#include "graphics/gropengldraw.h"
|
||||
#include "graphics/gropenglextension.h"
|
||||
#include "graphics/gropenglstate.h"
|
||||
|
||||
#include "globalincs/pstypes.h"
|
||||
#include "cutscene/mvelib.h"
|
||||
#include "cutscene/movie.h"
|
||||
#include "graphics/2d.h"
|
||||
#include "graphics/gropengltexture.h"
|
||||
#include "io/key.h"
|
||||
#include "osapi/osapi.h"
|
||||
#include "io/timer.h"
|
||||
#include "sound/sound.h"
|
||||
#include "osapi/osapi.h"
|
||||
#include "sound/openal.h"
|
||||
#include "bmpman/bmpman.h"
|
||||
#include "sound/sound.h"
|
||||
|
||||
|
||||
extern int Cmdline_noscalevid;
|
||||
@@ -228,7 +228,7 @@ void mve_audio_createbuf(ubyte minor, ubyte *data)
|
||||
return;
|
||||
}
|
||||
|
||||
int flags, desired_buffer, sample_rate;
|
||||
int flags, sample_rate;
|
||||
|
||||
mas = (mve_audio_t *) vm_malloc ( sizeof(mve_audio_t) );
|
||||
memset(mas, 0, sizeof(mve_audio_t));
|
||||
@@ -237,7 +237,6 @@ void mve_audio_createbuf(ubyte minor, ubyte *data)
|
||||
|
||||
flags = mve_get_ushort(data + 2);
|
||||
sample_rate = mve_get_ushort(data + 4);
|
||||
desired_buffer = mve_get_int(data + 6);
|
||||
|
||||
mas->channels = (flags & 0x0001) ? 2 : 1;
|
||||
mas->bitsize = (flags & 0x0002) ? 16 : 8;
|
||||
@@ -419,16 +418,10 @@ int mve_video_createbuf(ubyte minor, ubyte *data)
|
||||
}
|
||||
|
||||
short w, h;
|
||||
short count, truecolor;
|
||||
short truecolor;
|
||||
w = mve_get_short(data);
|
||||
h = mve_get_short(data+2);
|
||||
|
||||
if (minor > 0) {
|
||||
count = mve_get_short(data+4);
|
||||
} else {
|
||||
count = 1;
|
||||
}
|
||||
|
||||
if (minor > 1) {
|
||||
truecolor = mve_get_short(data+6);
|
||||
} else {
|
||||
@@ -459,13 +452,13 @@ int mve_video_createbuf(ubyte minor, ubyte *data)
|
||||
if (gr_screen.mode == GR_OPENGL) {
|
||||
GLfloat scale_by = 1.0f;
|
||||
|
||||
float screen_ratio = (float)gr_screen.max_w / (float)gr_screen.max_h;
|
||||
float screen_ratio = (float)gr_screen.center_w / (float)gr_screen.center_h;
|
||||
float movie_ratio = (float)g_width / (float)g_height;
|
||||
|
||||
if (screen_ratio > movie_ratio) {
|
||||
scale_by = (float)gr_screen.max_h / (float)g_height;
|
||||
scale_by = (float)gr_screen.center_h / (float)g_height;
|
||||
} else {
|
||||
scale_by = (float)gr_screen.max_w / (float)g_width;
|
||||
scale_by = (float)gr_screen.center_w / (float)g_width;
|
||||
}
|
||||
|
||||
// don't bother setting anything if we aren't going to need it
|
||||
@@ -479,12 +472,12 @@ int mve_video_createbuf(ubyte minor, ubyte *data)
|
||||
}
|
||||
|
||||
if (mve_scale_video) {
|
||||
g_screenX = ((ceil((gr_screen.max_w / scale_by) - 0.5f) - g_width) / 2);
|
||||
g_screenY = ((ceil((gr_screen.max_h / scale_by) - 0.5f) - g_height) / 2);
|
||||
g_screenX = ((ceil((gr_screen.center_w / scale_by) - 0.5f) - g_width) / 2) + ceil((gr_screen.center_offset_x / scale_by) - 0.5f);
|
||||
g_screenY = ((ceil((gr_screen.center_h / scale_by) - 0.5f) - g_height) / 2) + ceil((gr_screen.center_offset_y / scale_by) - 0.5f);
|
||||
} else {
|
||||
// centers on 1024x768, fills on 640x480
|
||||
g_screenX = ((float)(gr_screen.max_w - g_width) / 2.0f);
|
||||
g_screenY = ((float)(gr_screen.max_h - g_height) / 2.0f);
|
||||
g_screenX = ((float)(gr_screen.center_w - g_width) / 2.0f) + gr_screen.center_offset_x;
|
||||
g_screenY = ((float)(gr_screen.center_h - g_height) / 2.0f) + gr_screen.center_offset_y;
|
||||
}
|
||||
|
||||
// set additional values for screen width/height and UV coords
|
||||
@@ -518,12 +511,12 @@ int mve_video_createbuf(ubyte minor, ubyte *data)
|
||||
|
||||
GL_state.Array.BindArrayBuffer(0);
|
||||
|
||||
GL_state.Array.EnableClientVertex();
|
||||
GL_state.Array.VertexPointer(2, GL_FLOAT, sizeof(glVertices[0]), glVertices);
|
||||
vertex_layout vertex_def;
|
||||
|
||||
GL_state.Array.SetActiveClientUnit(0);
|
||||
GL_state.Array.EnableClientTexture();
|
||||
GL_state.Array.TexPointer(2, GL_FLOAT, sizeof(glVertices[0]), &(glVertices[0][2]));
|
||||
vertex_def.add_vertex_component(vertex_format_data::POSITION2, sizeof(glVertices[0]), glVertices);
|
||||
vertex_def.add_vertex_component(vertex_format_data::TEX_COORD, sizeof(glVertices[0]), &(glVertices[0][2]));
|
||||
|
||||
opengl_bind_vertex_layout(vertex_def);
|
||||
}
|
||||
|
||||
return 1;
|
||||
@@ -725,18 +718,9 @@ void mve_video_codemap(ubyte *data, int len)
|
||||
|
||||
void mve_video_data(ubyte *data, int len)
|
||||
{
|
||||
short nFrameHot, nFrameCold;
|
||||
short nXoffset, nYoffset;
|
||||
short nXsize, nYsize;
|
||||
ushort nFlags;
|
||||
ubyte *temp;
|
||||
|
||||
nFrameHot = mve_get_short(data);
|
||||
nFrameCold = mve_get_short(data+2);
|
||||
nXoffset = mve_get_short(data+4);
|
||||
nYoffset = mve_get_short(data+6);
|
||||
nXsize = mve_get_short(data+8);
|
||||
nYsize = mve_get_short(data+10);
|
||||
nFlags = mve_get_ushort(data+12);
|
||||
|
||||
if (nFlags & 1) {
|
||||
@@ -797,9 +781,6 @@ void mve_play(MVESTREAM *mve)
|
||||
void mve_shutdown()
|
||||
{
|
||||
if (gr_screen.mode == GR_OPENGL) {
|
||||
GL_state.Array.DisableClientVertex();
|
||||
GL_state.Array.DisableClientTexture();
|
||||
|
||||
if (mve_scale_video) {
|
||||
glMatrixMode(GL_MODELVIEW);
|
||||
glPopMatrix();
|
||||
|
||||
+31
-76
@@ -9,22 +9,23 @@
|
||||
#include <errno.h>
|
||||
#endif
|
||||
|
||||
#include "globalincs/pstypes.h"
|
||||
#include "globalincs/def_files.h"
|
||||
#include "bmpman/bmpman.h"
|
||||
#include "cfile/cfile.h"
|
||||
#include "cutscene/oggplayer.h"
|
||||
#include "globalincs/def_files.h"
|
||||
#include "globalincs/pstypes.h"
|
||||
#include "graphics/2d.h"
|
||||
#include "graphics/gropengl.h"
|
||||
#include "graphics/gropengltexture.h"
|
||||
#include "graphics/gropengldraw.h"
|
||||
#include "graphics/gropenglextension.h"
|
||||
#include "graphics/gropenglshader.h"
|
||||
#include "graphics/gropenglstate.h"
|
||||
#include "graphics/2d.h"
|
||||
#include "graphics/gropengltexture.h"
|
||||
#include "io/key.h"
|
||||
#include "osapi/osapi.h"
|
||||
#include "sound/sound.h"
|
||||
#include "sound/openal.h"
|
||||
#include "bmpman/bmpman.h"
|
||||
#include "cutscene/oggplayer.h"
|
||||
#include "io/timer.h"
|
||||
#include "osapi/osapi.h"
|
||||
#include "sound/openal.h"
|
||||
#include "sound/sound.h"
|
||||
|
||||
#include "theora/theora.h"
|
||||
#include "vorbis/codec.h"
|
||||
@@ -331,8 +332,6 @@ static void OGG_video_init(theora_info *tinfo)
|
||||
{
|
||||
float scale_by = 0.0f;
|
||||
|
||||
GLhandleARB shader_id = 0;
|
||||
|
||||
if (video_inited)
|
||||
return;
|
||||
|
||||
@@ -346,7 +345,7 @@ static void OGG_video_init(theora_info *tinfo)
|
||||
opengl_set_texture_target(GL_TEXTURE_2D);
|
||||
opengl_tcache_get_adjusted_texture_size(g_screenWidth, g_screenHeight, &wp2, &hp2);
|
||||
|
||||
if(!Use_GLSL)
|
||||
if(!is_minimum_GLSL_version())
|
||||
use_shaders = false;
|
||||
|
||||
if(use_shaders) {
|
||||
@@ -365,52 +364,11 @@ static void OGG_video_init(theora_info *tinfo)
|
||||
return;
|
||||
}
|
||||
|
||||
char *vert = NULL, *frag = NULL;
|
||||
opengl_shader_t new_shader;
|
||||
|
||||
// choose appropriate files
|
||||
char *vert_name = "video-v.sdr";
|
||||
char *frag_name = "video-f.sdr";
|
||||
int sdr_handle = gr_maybe_create_shader(SDR_TYPE_VIDEO_PROCESS, 0);
|
||||
|
||||
mprintf(("Compiling video-processing shader ... \n"));
|
||||
|
||||
// read vertex shader
|
||||
CFILE *cf_shader = cfopen(vert_name, "rt", CFILE_NORMAL, CF_TYPE_EFFECTS);
|
||||
|
||||
if (cf_shader != NULL) {
|
||||
int len = cfilelength(cf_shader);
|
||||
vert = (char*) vm_malloc(len + 1);
|
||||
cfread(vert, len + 1, 1, cf_shader);
|
||||
cfclose(cf_shader);
|
||||
} else {
|
||||
mprintf((" Loading built-in default shader for: %s\n", vert_name));
|
||||
vert = defaults_get_file(vert_name);
|
||||
}
|
||||
|
||||
if(!vert)
|
||||
use_shaders = false;
|
||||
|
||||
// read fragment shader
|
||||
cf_shader = cfopen(frag_name, "rt", CFILE_NORMAL, CF_TYPE_EFFECTS);
|
||||
|
||||
if (cf_shader != NULL) {
|
||||
int len = cfilelength(cf_shader);
|
||||
frag = (char*) vm_malloc(len + 1);
|
||||
cfread(frag, len + 1, 1, cf_shader);
|
||||
cfclose(cf_shader);
|
||||
} else {
|
||||
mprintf((" Loading built-in default shader for: %s\n", frag_name));
|
||||
frag = defaults_get_file(frag_name);
|
||||
}
|
||||
|
||||
if(!vert)
|
||||
use_shaders = false;
|
||||
Verify( vert != NULL );
|
||||
Verify( frag != NULL );
|
||||
|
||||
shader_id = opengl_shader_create(vert, frag);
|
||||
vglUseProgramObjectARB(shader_id);
|
||||
if (!shader_id)
|
||||
if ( sdr_handle >= 0)
|
||||
opengl_shader_set_current(sdr_handle);
|
||||
else
|
||||
use_shaders = false;
|
||||
}
|
||||
|
||||
@@ -477,13 +435,13 @@ static void OGG_video_init(theora_info *tinfo)
|
||||
// NOTE: using NULL instead of pixelbuf crashes some drivers, but then so does pixelbuf
|
||||
glTexImage2D(GL_state.Texture.GetTarget(), 0, GL_LUMINANCE8, 1024, 1024, 0, GL_LUMINANCE, GL_UNSIGNED_BYTE, NULL);
|
||||
}
|
||||
float screen_ratio = (float)gr_screen.max_w / (float)gr_screen.max_h;
|
||||
float screen_ratio = (float)gr_screen.center_w / (float)gr_screen.center_h;
|
||||
float movie_ratio = (float)g_screenWidth / (float)g_screenHeight;
|
||||
|
||||
if (screen_ratio > movie_ratio)
|
||||
scale_by = (float)gr_screen.max_h / (float)g_screenHeight;
|
||||
scale_by = (float)gr_screen.center_h / (float)g_screenHeight;
|
||||
else
|
||||
scale_by = (float)gr_screen.max_w / (float)g_screenWidth;
|
||||
scale_by = (float)gr_screen.center_w / (float)g_screenWidth;
|
||||
|
||||
// don't bother setting anything if we aren't going to need it
|
||||
if (!Cmdline_noscalevid && (scale_by != 1.0f)) {
|
||||
@@ -512,12 +470,12 @@ static void OGG_video_init(theora_info *tinfo)
|
||||
|
||||
|
||||
if (scale_video) {
|
||||
g_screenX = ((fl2i(gr_screen.max_w / scale_by + 0.5f) - g_screenWidth) / 2);
|
||||
g_screenY = ((fl2i(gr_screen.max_h / scale_by + 0.5f) - g_screenHeight) / 2);
|
||||
g_screenX = ((fl2i(gr_screen.center_w / scale_by + 0.5f) - g_screenWidth) / 2) + fl2i(gr_screen.center_offset_x / scale_by + 0.5f);
|
||||
g_screenY = ((fl2i(gr_screen.center_h / scale_by + 0.5f) - g_screenHeight) / 2) + fl2i(gr_screen.center_offset_y / scale_by + 0.5f);
|
||||
} else {
|
||||
// centers on 1024x768, fills on 640x480
|
||||
g_screenX = ((gr_screen.max_w - g_screenWidth) / 2);
|
||||
g_screenY = ((gr_screen.max_h - g_screenHeight) / 2);
|
||||
g_screenX = ((gr_screen.center_w - g_screenWidth) / 2) + gr_screen.center_offset_x;
|
||||
g_screenY = ((gr_screen.center_h - g_screenHeight) / 2) + gr_screen.center_offset_y;
|
||||
}
|
||||
|
||||
// set additional values for screen width/height and UV coords
|
||||
@@ -532,9 +490,9 @@ static void OGG_video_init(theora_info *tinfo)
|
||||
gl_screenU = i2fl(tinfo->frame_width-1) / i2fl(2048) ;
|
||||
gl_screenV = i2fl(tinfo->frame_height-1) / i2fl(2048);
|
||||
GL_state.Texture.SetShaderMode(GL_TRUE);
|
||||
vglUniform1iARB( vglGetUniformLocationARB(shader_id, "ytex"), 0 );
|
||||
vglUniform1iARB( vglGetUniformLocationARB(shader_id, "utex"), 1 );
|
||||
vglUniform1iARB( vglGetUniformLocationARB(shader_id, "vtex"), 2 );
|
||||
GL_state.Uniform.setUniformi("ytex", 0);
|
||||
GL_state.Uniform.setUniformi("utex", 1);
|
||||
GL_state.Uniform.setUniformi("vtex", 2);
|
||||
}
|
||||
|
||||
glVertices[0][0] = (GLfloat)g_screenX;
|
||||
@@ -559,12 +517,12 @@ static void OGG_video_init(theora_info *tinfo)
|
||||
|
||||
GL_state.Array.BindArrayBuffer(0);
|
||||
|
||||
GL_state.Array.EnableClientVertex();
|
||||
GL_state.Array.VertexPointer(2, GL_FLOAT, sizeof(glVertices[0]), glVertices);
|
||||
vertex_layout vert_def;
|
||||
|
||||
GL_state.Array.SetActiveClientUnit(0);
|
||||
GL_state.Array.EnableClientTexture();
|
||||
GL_state.Array.TexPointer(2, GL_FLOAT, sizeof(glVertices[0]), &(glVertices[0][2]));
|
||||
vert_def.add_vertex_component(vertex_format_data::POSITION2, sizeof(glVertices[0]), glVertices);
|
||||
vert_def.add_vertex_component(vertex_format_data::TEX_COORD, sizeof(glVertices[0]), &(glVertices[0][2]));
|
||||
|
||||
opengl_bind_vertex_layout(vert_def);
|
||||
}
|
||||
if(!use_shaders && tinfo->frame_height > 450) {
|
||||
mprintf(("VIDEO: No shader support and hd video is beeing played this can get choppy."));
|
||||
@@ -579,9 +537,6 @@ static void OGG_video_close()
|
||||
}
|
||||
|
||||
if (gr_screen.mode == GR_OPENGL) {
|
||||
GL_state.Array.DisableClientVertex();
|
||||
GL_state.Array.DisableClientTexture();
|
||||
|
||||
if (scale_video) {
|
||||
glMatrixMode(GL_MODELVIEW);
|
||||
glPopMatrix();
|
||||
@@ -604,7 +559,7 @@ static void OGG_video_close()
|
||||
ytex = utex = vtex = 0;
|
||||
GLtex = 0;
|
||||
GL_state.Texture.SetShaderMode(GL_FALSE);
|
||||
opengl_shader_set_current( 0 );
|
||||
opengl_shader_set_current();
|
||||
}
|
||||
|
||||
if (pixelbuf != NULL) {
|
||||
|
||||
@@ -36,7 +36,7 @@ int dds_read_header(const char *filename, CFILE *img_cfp, int *width, int *heigh
|
||||
int retval = DDS_ERROR_NONE;
|
||||
int ct = DDS_UNCOMPRESSED;
|
||||
int bits = 0;
|
||||
int i, trash, is_cubemap = 0;
|
||||
int i, is_cubemap = 0;
|
||||
int d_width = 0, d_height = 0, d_depth = 0, d_size = 0;
|
||||
|
||||
|
||||
@@ -80,7 +80,7 @@ int dds_read_header(const char *filename, CFILE *img_cfp, int *width, int *heigh
|
||||
|
||||
// skip over the crap we don't care about
|
||||
for (i = 0; i < 11; i++)
|
||||
trash = cfread_uint(ddsfile);
|
||||
cfread_uint(ddsfile);
|
||||
|
||||
dds_header.ddpfPixelFormat.dwSize = cfread_uint(ddsfile);
|
||||
dds_header.ddpfPixelFormat.dwFlags = cfread_uint(ddsfile);
|
||||
|
||||
+93
-40
@@ -9,26 +9,26 @@
|
||||
|
||||
|
||||
|
||||
#include "cmdline/cmdline.h"
|
||||
#include "debris/debris.h"
|
||||
#include "render/3d.h"
|
||||
#include "fireball/fireballs.h"
|
||||
#include "radar/radar.h"
|
||||
#include "gamesnd/gamesnd.h"
|
||||
#include "object/objectsnd.h"
|
||||
#include "globalincs/linklist.h"
|
||||
#include "particle/particle.h"
|
||||
#include "freespace2/freespace.h"
|
||||
#include "object/objcollide.h"
|
||||
#include "gamesnd/gamesnd.h"
|
||||
#include "globalincs/linklist.h"
|
||||
#include "io/timer.h"
|
||||
#include "species_defs/species_defs.h"
|
||||
#include "ship/ship.h"
|
||||
#include "ship/shipfx.h"
|
||||
#include "radar/radarsetup.h"
|
||||
#include "network/multi.h"
|
||||
#include "network/multimsgs.h"
|
||||
#include "network/multiutil.h"
|
||||
#include "object/objcollide.h"
|
||||
#include "object/objectsnd.h"
|
||||
#include "particle/particle.h"
|
||||
#include "radar/radar.h"
|
||||
#include "radar/radarsetup.h"
|
||||
#include "render/3d.h"
|
||||
#include "ship/ship.h"
|
||||
#include "ship/shipfx.h"
|
||||
#include "species_defs/species_defs.h"
|
||||
#include "weapon/weapon.h"
|
||||
#include "cmdline/cmdline.h"
|
||||
|
||||
#define MAX_LIFE 10.0f
|
||||
#define MIN_RADIUS_FOR_PERSISTANT_DEBRIS 50 // ship radius at which debris from it becomes persistant
|
||||
@@ -147,7 +147,7 @@ MONITOR(NumHullDebrisRend)
|
||||
/**
|
||||
* Render debris
|
||||
*/
|
||||
void debris_render(object * obj)
|
||||
void debris_render_DEPRECATED(object * obj)
|
||||
{
|
||||
int i, num, swapped;
|
||||
polymodel *pm;
|
||||
@@ -191,10 +191,10 @@ void debris_render(object * obj)
|
||||
|
||||
if ( db->is_hull ) {
|
||||
MONITOR_INC(NumHullDebrisRend,1);
|
||||
submodel_render( db->model_num, db->submodel_num, &obj->orient, &obj->pos );
|
||||
submodel_render_DEPRECATED( db->model_num, db->submodel_num, &obj->orient, &obj->pos );
|
||||
} else {
|
||||
MONITOR_INC(NumSmallDebrisRend,1);
|
||||
submodel_render( db->model_num, db->submodel_num, &obj->orient, &obj->pos, MR_NO_LIGHTING );
|
||||
submodel_render_DEPRECATED( db->model_num, db->submodel_num, &obj->orient, &obj->pos, MR_NO_LIGHTING );
|
||||
}
|
||||
|
||||
if (tbase != NULL && (swapped!=-1) && pm) {
|
||||
@@ -563,6 +563,7 @@ object *debris_create(object *source_obj, int model_num, int submodel_num, vec3d
|
||||
db->is_hull = hull_flag;
|
||||
db->source_objnum = parent_objnum;
|
||||
db->source_sig = source_obj->signature;
|
||||
db->damage_type_idx = shipp->debris_damage_type_idx;
|
||||
db->ship_info_index = shipp->ship_info_index;
|
||||
db->team = shipp->team;
|
||||
db->fire_timeout = 0; // if not changed, timestamp_elapsed() will return false
|
||||
@@ -703,7 +704,7 @@ object *debris_create(object *source_obj, int model_num, int submodel_num, vec3d
|
||||
// displacement fromt the center of the parent object to the center of the debris piece
|
||||
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_cross ( &vel_from_rotvel, &world_rotvel, &to_center );
|
||||
vm_vec_scale ( &vel_from_rotvel, DEBRIS_ROTVEL_SCALE);
|
||||
|
||||
vm_vec_add (&obj->phys_info.vel, &radial_vel, &source_obj->phys_info.vel);
|
||||
@@ -843,18 +844,18 @@ int debris_check_collision(object *pdebris, object *other_obj, vec3d *hitpos, co
|
||||
}
|
||||
|
||||
// debris ship collision -- use debris_hit_info to calculate physics
|
||||
object *ship_obj = other_obj;
|
||||
Assert( ship_obj->type == OBJ_SHIP );
|
||||
object *pship_obj = other_obj;
|
||||
Assert( pship_obj->type == OBJ_SHIP );
|
||||
|
||||
object *heavy = debris_hit_info->heavy;
|
||||
object *light = debris_hit_info->light;
|
||||
object *lighter = debris_hit_info->light;
|
||||
object *heavy_obj = heavy;
|
||||
object *light_obj = light;
|
||||
object *light_obj = lighter;
|
||||
|
||||
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);
|
||||
vm_vec_sub(&p0, &lighter->last_pos, &heavy->last_pos);
|
||||
vm_vec_sub(&p1, &lighter->pos, &heavy->pos);
|
||||
|
||||
mc.pos = &zero; // The object's position
|
||||
mc.p0 = &p0; // Point 1 of ray to check
|
||||
@@ -875,15 +876,15 @@ int debris_check_collision(object *pdebris, object *other_obj, vec3d *hitpos, co
|
||||
vm_vec_scale(&debris_hit_info->light_rel_vel, 1/flFrametime);
|
||||
} else {
|
||||
debris_hit_info->collide_rotate = 0;
|
||||
vm_vec_sub(&debris_hit_info->light_rel_vel, &light->phys_info.vel, &heavy->phys_info.vel);
|
||||
vm_vec_sub(&debris_hit_info->light_rel_vel, &lighter->phys_info.vel, &heavy->phys_info.vel);
|
||||
}
|
||||
|
||||
int mc_ret_val = 0;
|
||||
|
||||
if ( debris_hit_info->heavy == ship_obj ) { // ship is heavier, so debris is sphere. Check sphere collision against ship poly model
|
||||
mc.model_instance_num = Ships[ship_obj->instance].model_instance_num;
|
||||
mc.model_num = Ship_info[Ships[ship_obj->instance].ship_info_index].model_num; // Fill in the model to check
|
||||
mc.orient = &ship_obj->orient; // The object's orient
|
||||
if ( debris_hit_info->heavy == pship_obj ) { // ship is heavier, so debris is sphere. Check sphere collision against ship poly model
|
||||
mc.model_instance_num = Ships[pship_obj->instance].model_instance_num;
|
||||
mc.model_num = Ship_info[Ships[pship_obj->instance].ship_info_index].model_num; // Fill in the model to check
|
||||
mc.orient = &pship_obj->orient; // The object's orient
|
||||
mc.radius = pdebris->radius;
|
||||
mc.flags = (MC_CHECK_MODEL | MC_CHECK_SPHERELINE);
|
||||
|
||||
@@ -897,11 +898,8 @@ int debris_check_collision(object *pdebris, object *other_obj, vec3d *hitpos, co
|
||||
mc.flags = MC_ONLY_SPHERE | MC_CHECK_SPHERELINE;
|
||||
|
||||
SCP_vector<int> submodel_vector;
|
||||
polymodel *pm;
|
||||
polymodel_instance *pmi;
|
||||
|
||||
ship_model_start(ship_obj);
|
||||
|
||||
if (model_collide(&mc)) {
|
||||
|
||||
// Set earliest hit time
|
||||
@@ -915,7 +913,6 @@ int debris_check_collision(object *pdebris, object *other_obj, vec3d *hitpos, co
|
||||
model_get_rotating_submodel_list(&submodel_vector, heavy_obj);
|
||||
|
||||
// Get polymodel and turn off all rotating submodels, collide against only 1 at a time.
|
||||
pm = model_get(Ship_info[Ships[heavy_obj->instance].ship_info_index].model_num);
|
||||
pmi = model_get_instance(Ships[heavy_obj->instance].model_instance_num);
|
||||
|
||||
// turn off all rotating submodels and test for collision
|
||||
@@ -926,8 +923,8 @@ int debris_check_collision(object *pdebris, object *other_obj, vec3d *hitpos, co
|
||||
// reset flags to check MC_CHECK_MODEL | MC_CHECK_SPHERELINE and maybe MC_CHECK_INVISIBLE_FACES and MC_SUBMODEL_INSTANCE
|
||||
mc.flags = copy_flags | MC_SUBMODEL_INSTANCE;
|
||||
|
||||
if (Ship_info[Ships[ship_obj->instance].ship_info_index].collision_lod > -1) {
|
||||
mc.lod = Ship_info[Ships[ship_obj->instance].ship_info_index].collision_lod;
|
||||
if (Ship_info[Ships[pship_obj->instance].ship_info_index].collision_lod > -1) {
|
||||
mc.lod = Ship_info[Ships[pship_obj->instance].ship_info_index].collision_lod;
|
||||
}
|
||||
|
||||
// check each submodel in turn
|
||||
@@ -940,10 +937,10 @@ int debris_check_collision(object *pdebris, object *other_obj, vec3d *hitpos, co
|
||||
|
||||
// find the start and end positions of the sphere in submodel RF
|
||||
pmi->submodel[*smv].angs = pmi->submodel[*smv].prev_angs;
|
||||
world_find_model_instance_point(&p0, &light_obj->last_pos, pm, pmi, *smv, &heavy_obj->last_orient, &heavy_obj->last_pos);
|
||||
world_find_model_instance_point(&p0, &light_obj->last_pos, pmi, *smv, &heavy_obj->last_orient, &heavy_obj->last_pos);
|
||||
|
||||
pmi->submodel[*smv].angs = copy_angles;
|
||||
world_find_model_instance_point(&p1, &light_obj->pos, pm, pmi, *smv, &heavy_obj->orient, &heavy_obj->pos);
|
||||
world_find_model_instance_point(&p1, &light_obj->pos, pmi, *smv, &heavy_obj->orient, &heavy_obj->pos);
|
||||
|
||||
mc.p0 = &p0;
|
||||
mc.p1 = &p1;
|
||||
@@ -957,18 +954,18 @@ int debris_check_collision(object *pdebris, object *other_obj, vec3d *hitpos, co
|
||||
|
||||
// set up debris_hit_info common
|
||||
set_hit_struct_info(debris_hit_info, &mc, SUBMODEL_ROT_HIT);
|
||||
model_instance_find_world_point(&debris_hit_info->hit_pos, &mc.hit_point, mc.model_num, mc.model_instance_num, mc.hit_submodel, &heavy_obj->orient, &zero);
|
||||
model_instance_find_world_point(&debris_hit_info->hit_pos, &mc.hit_point, mc.model_instance_num, mc.hit_submodel, &heavy_obj->orient, &zero);
|
||||
|
||||
// set up debris_hit_info for rotating submodel
|
||||
if (debris_hit_info->edge_hit == 0) {
|
||||
model_instance_find_obj_dir(&debris_hit_info->collision_normal, &mc.hit_normal, heavy_obj, mc.hit_submodel);
|
||||
model_instance_find_obj_dir(&debris_hit_info->collision_normal, &mc.hit_normal, mc.model_instance_num, mc.hit_submodel, &heavy_obj->orient);
|
||||
}
|
||||
|
||||
// find position in submodel RF of light object at collison
|
||||
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_instance_find_world_point(&debris_hit_info->light_collision_cm_pos, &int_light_pos, mc.model_num, mc.model_instance_num, mc.hit_submodel, &heavy_obj->orient, &zero);
|
||||
model_instance_find_world_point(&debris_hit_info->light_collision_cm_pos, &int_light_pos, mc.model_instance_num, mc.hit_submodel, &heavy_obj->orient, &zero);
|
||||
}
|
||||
}
|
||||
// Don't look at this submodel again
|
||||
@@ -992,7 +989,7 @@ int debris_check_collision(object *pdebris, object *other_obj, vec3d *hitpos, co
|
||||
|
||||
// get collision normal if not edge hit
|
||||
if (debris_hit_info->edge_hit == 0) {
|
||||
model_instance_find_obj_dir(&debris_hit_info->collision_normal, &mc.hit_normal, heavy_obj, mc.hit_submodel);
|
||||
model_instance_find_obj_dir(&debris_hit_info->collision_normal, &mc.hit_normal, Ships[heavy_obj->instance].model_instance_num, mc.hit_submodel, &heavy_obj->orient);
|
||||
}
|
||||
|
||||
// find position in submodel RF of light object at collison
|
||||
@@ -1011,7 +1008,7 @@ int debris_check_collision(object *pdebris, object *other_obj, vec3d *hitpos, co
|
||||
mc.submodel_num = Debris[num].submodel_num;
|
||||
model_clear_instance( mc.model_num );
|
||||
mc.orient = &pdebris->orient; // The object's orient
|
||||
mc.radius = model_get_core_radius(Ship_info[Ships[ship_obj->instance].ship_info_index].model_num);
|
||||
mc.radius = model_get_core_radius(Ship_info[Ships[pship_obj->instance].ship_info_index].model_num);
|
||||
|
||||
// check for collision between debris model and ship sphere
|
||||
mc.flags = (MC_CHECK_MODEL | MC_SUBMODEL | MC_CHECK_SPHERELINE);
|
||||
@@ -1098,3 +1095,59 @@ void calc_debris_physics_properties( physics_info *pi, vec3d *mins, vec3d *maxs
|
||||
pi->I_body_inv.vec.fvec.xyz.y = 0.0f;
|
||||
pi->I_body_inv.vec.fvec.xyz.z = 12.0f / (pi->mass * (dx*dx + dy*dy));
|
||||
}
|
||||
|
||||
void debris_render(object * obj, draw_list *scene)
|
||||
{
|
||||
int i, num, swapped;
|
||||
polymodel *pm;
|
||||
debris *db;
|
||||
|
||||
|
||||
swapped = -1;
|
||||
pm = NULL;
|
||||
num = obj->instance;
|
||||
|
||||
Assert(num >= 0 && num < MAX_DEBRIS_PIECES);
|
||||
db = &Debris[num];
|
||||
|
||||
Assert(db->flags & DEBRIS_USED);
|
||||
|
||||
texture_info *tbase = NULL;
|
||||
|
||||
model_clear_instance( db->model_num );
|
||||
|
||||
// Swap in a different texture depending on the species
|
||||
if (db->species >= 0)
|
||||
{
|
||||
pm = model_get( db->model_num );
|
||||
|
||||
//WMC - Someday, we should have glowing debris.
|
||||
if ( pm != NULL && (pm->n_textures == 1) ) {
|
||||
tbase = &pm->maps[0].textures[TM_BASE_TYPE];
|
||||
swapped = tbase->GetTexture();
|
||||
tbase->SetTexture(Species_info[db->species].debris_texture.bitmap_id);
|
||||
}
|
||||
}
|
||||
|
||||
// Only render electrical arcs if within 500m of the eye (for a 10m piece)
|
||||
if ( vm_vec_dist_quick( &obj->pos, &Eye_position ) < obj->radius*50.0f ) {
|
||||
for (i=0; i<MAX_DEBRIS_ARCS; i++ ) {
|
||||
if ( timestamp_valid( db->arc_timestamp[i] ) ) {
|
||||
model_add_arc( db->model_num, db->submodel_num, &db->arc_pts[i][0], &db->arc_pts[i][1], MARC_TYPE_NORMAL );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
model_render_params render_info;
|
||||
|
||||
if ( !db->is_hull ) {
|
||||
render_info.set_flags(MR_NO_LIGHTING);
|
||||
}
|
||||
|
||||
MONITOR_INC(NumHullDebrisRend,1);
|
||||
submodel_render_queue( &render_info, scene, db->model_num, db->submodel_num, &obj->orient, &obj->pos );
|
||||
|
||||
if (tbase != NULL && (swapped!=-1) && pm) {
|
||||
tbase->SetTexture(swapped);
|
||||
}
|
||||
}
|
||||
@@ -16,6 +16,7 @@
|
||||
|
||||
class object;
|
||||
struct CFILE;
|
||||
class draw_list;
|
||||
|
||||
#define MAX_DEBRIS_ARCS 8 // Must be less than MAX_ARC_EFFECTS in model.h
|
||||
|
||||
@@ -24,6 +25,7 @@ typedef struct debris {
|
||||
int flags; // See DEBRIS_??? defines
|
||||
int source_objnum; // What object this came from
|
||||
int source_sig; // Signature of the source object
|
||||
int damage_type_idx; // Damage type of this debris
|
||||
int ship_info_index; // Ship info index of the ship type debris came from
|
||||
int team; // Team of the ship where the debris came from
|
||||
int objnum; // What object this is linked to
|
||||
@@ -61,7 +63,8 @@ extern int Num_debris_pieces;
|
||||
struct collision_info_struct;
|
||||
|
||||
void debris_init();
|
||||
void debris_render( object * obj );
|
||||
void debris_render_DEPRECATED( object * obj );
|
||||
void debris_render(object * obj, draw_list *scene);
|
||||
void debris_delete( object * obj );
|
||||
void debris_process_post( object * obj, float frame_time);
|
||||
object *debris_create( object * source_obj, int model_num, int submodel_num, vec3d *pos, vec3d *exp_center, int hull_flag, float exp_force );
|
||||
|
||||
@@ -9,15 +9,12 @@
|
||||
|
||||
|
||||
#include "debugconsole/console.h"
|
||||
#include "debugconsole/consoleparse.h"
|
||||
#include "globalincs/alphacolors.h"
|
||||
#include "globalincs/pstypes.h"
|
||||
#include "globalincs/version.h"
|
||||
#include "globalincs/vmallocator.h"
|
||||
#include "graphics/2d.h"
|
||||
#include "graphics/font.h"
|
||||
#include "io/timer.h"
|
||||
#include "io/key.h"
|
||||
#include "io/timer.h"
|
||||
#include "osapi/osapi.h"
|
||||
|
||||
#include <algorithm>
|
||||
@@ -104,7 +101,8 @@ void dc_draw(bool show_prompt);
|
||||
/**
|
||||
* Draws the cursor
|
||||
* @param [in] cmd_string The formatted command string displayed by dc_draw_window
|
||||
* @param [in] x y The x and y screen position of the command string
|
||||
* @param [in] x The x screen position of the command string
|
||||
* @param [in] y The y screen position of the command string
|
||||
*/
|
||||
void dc_draw_cursor( SCP_string &cmd_string, int x, int y );
|
||||
|
||||
@@ -189,7 +187,7 @@ void dc_draw(bool show_prompt = FALSE)
|
||||
gr_clear();
|
||||
gr_set_font(dc_font);
|
||||
gr_set_color_fast( &Color_bright );
|
||||
gr_string( 0x8000, 3, dc_title.c_str(), GR_RESIZE_NONE );
|
||||
gr_string( 0x8000, gr_screen.center_offset_y + 3, dc_title.c_str(), GR_RESIZE_NONE );
|
||||
|
||||
gr_set_color_fast( &Color_normal );
|
||||
|
||||
@@ -209,7 +207,7 @@ void dc_draw_cursor( SCP_string &cmd_string, int x, int y )
|
||||
|
||||
w %= (DCOLS * Current_font->w);
|
||||
//gr_string( w, debug_y*16, "_" );
|
||||
gr_rect((x + (w + 1)), (y + (h + 1)), 2, Current_font->h, GR_RESIZE_NONE);
|
||||
gr_rect(gr_screen.center_offset_x + (x + (w + 1)), gr_screen.center_offset_y + (y + (h + 1)), 2, Current_font->h, GR_RESIZE_NONE);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -245,7 +243,7 @@ void dc_draw_window(bool show_prompt)
|
||||
// Draw the buffer strings
|
||||
for (i = 0; i < buffer_lines; ++i) {
|
||||
if ((i + dc_scroll_y) < dc_buffer.size()) {
|
||||
gr_string(0, ((i * row_height) + row_height), dc_buffer[i + dc_scroll_y].substr(dc_scroll_x).c_str(), GR_RESIZE_NONE);
|
||||
gr_string(gr_screen.center_offset_x, gr_screen.center_offset_y + ((i * row_height) + row_height), dc_buffer[i + dc_scroll_y].substr(dc_scroll_x).c_str(), GR_RESIZE_NONE);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -263,7 +261,7 @@ void dc_draw_window(bool show_prompt)
|
||||
++j;
|
||||
}
|
||||
}
|
||||
gr_string(0, ((i * row_height) + row_height), out_str.c_str(), GR_RESIZE_NONE);
|
||||
gr_string(gr_screen.center_offset_x, gr_screen.center_offset_y + ((i * row_height) + row_height), out_str.c_str(), GR_RESIZE_NONE);
|
||||
|
||||
dc_draw_cursor(out_str, 0, ((i * row_height)));
|
||||
gr_set_color_fast(&Color_normal);
|
||||
@@ -284,8 +282,8 @@ void dc_init(void)
|
||||
col_width = Current_font->w; // Col/Character width, in pixels
|
||||
dc_scroll_x = 0;
|
||||
dc_scroll_y = 0;
|
||||
DCOLS = (gr_screen.max_w / col_width) - 1; // Subtract as needed. Windowed mode has some quirks with the resolution
|
||||
DROWS = (gr_screen.max_h / row_height) - 2;
|
||||
DCOLS = (gr_screen.center_w / col_width) - 1; // Subtract as needed. Windowed mode has some quirks with the resolution
|
||||
DROWS = (gr_screen.center_h / row_height) - 2;
|
||||
DBCOLS = DCOLS;
|
||||
DBROWS = 2 * DROWS;
|
||||
|
||||
@@ -391,7 +389,7 @@ void dc_putc(char c)
|
||||
temp_str.push_back(c);
|
||||
gr_get_string_size(&w, NULL, temp_str.c_str());
|
||||
|
||||
if ((temp_str.size() >= DBCOLS) || (w > gr_screen.max_w)) {
|
||||
if ((temp_str.size() >= DBCOLS) || (w > gr_screen.center_w)) {
|
||||
c = '\n';
|
||||
|
||||
} else {
|
||||
@@ -415,7 +413,7 @@ void dc_putc(char c)
|
||||
temp_str.append(i, ' ');
|
||||
gr_get_string_size(&w, NULL, temp_str.c_str());
|
||||
|
||||
if ((temp_str.size() >= DBCOLS) || (w > gr_screen.max_w)) {
|
||||
if ((temp_str.size() >= DBCOLS) || (w > gr_screen.center_w)) {
|
||||
c = '\n';
|
||||
|
||||
} else {
|
||||
@@ -458,7 +456,7 @@ void dc_putc(char c)
|
||||
temp_str.push_back(c);
|
||||
gr_get_string_size(&w, NULL, temp_str.c_str());
|
||||
|
||||
if ((temp_str.size() >= DBCOLS) || (w > gr_screen.max_w)) {
|
||||
if ((temp_str.size() >= DBCOLS) || (w > gr_screen.center_w)) {
|
||||
/**
|
||||
* Word wrapping
|
||||
* Save the word, clear the line of the word, push new line with the word on it
|
||||
|
||||
@@ -19,8 +19,6 @@
|
||||
|
||||
#include "debugconsole/console.h"
|
||||
#include "debugconsole/consoleparse.h"
|
||||
#include "globalincs/pstypes.h"
|
||||
#include "globalincs/vmallocator.h"
|
||||
#include "io/key.h"
|
||||
|
||||
#include <algorithm>
|
||||
|
||||
@@ -12,10 +12,8 @@
|
||||
// @todo Make a fast version of the parse_long, parse_ulong, etc. That just checks the first 1-3 characters. The fast version will be used in retail builds while the slow/safe version will be in debug's
|
||||
// @todo Maybe make parser functions case-insensitive
|
||||
////////////////
|
||||
#include "debugconsole/consoleparse.h"
|
||||
|
||||
#include "debugconsole/console.h"
|
||||
#include "globalincs/pstypes.h"
|
||||
#include "debugconsole/consoleparse.h"
|
||||
#include "parse/parselo.h"
|
||||
|
||||
#include <algorithm>
|
||||
@@ -90,7 +88,7 @@ void dc_get_token_no_advance(SCP_string &out_str);
|
||||
* @param[in] ch Points to the start of the string to parse
|
||||
* @param[in] type The expected type. is thrown along with ch when an unexpected/malformed float is found
|
||||
*
|
||||
* @ret The value of the parsed token
|
||||
* @return The value of the parsed token
|
||||
* @details
|
||||
* The returned double may be cast to a single-precision float, but be sure to check it before doing so!
|
||||
*/
|
||||
@@ -1067,7 +1065,7 @@ void dc_stuff_float(float *f)
|
||||
value_d = dc_parse_double(token.c_str(), DCT_FLOAT); // Parse and convert
|
||||
|
||||
// Stuff value if within bounds
|
||||
if ((abs(value_d) < FLT_MAX) && (abs(value_d) > FLT_MIN)) {
|
||||
if ((std::abs(value_d) < FLT_MAX) && (std::abs(value_d) > FLT_MIN)) {
|
||||
*f = static_cast<float>(value_d);
|
||||
} else {
|
||||
throw errParse(token.c_str(), DCT_FLOAT);
|
||||
|
||||
@@ -14,6 +14,7 @@
|
||||
* @details A lot of functions here are blatently copied from parselo.h :D
|
||||
*/
|
||||
|
||||
#include "debugconsole/console.h"
|
||||
#include "globalincs/pstypes.h"
|
||||
|
||||
#include <cstdarg>
|
||||
|
||||
@@ -1,239 +0,0 @@
|
||||
/*
|
||||
* Code created by Thomas Whittaker (RT) for a FreeSpace 2 source code project
|
||||
*
|
||||
* You may not sell or otherwise commercially exploit the source or things you
|
||||
* created based on the source.
|
||||
*
|
||||
*/
|
||||
|
||||
/*
|
||||
* This module is intended as a debug tool to measure the speed of blocks of code and display
|
||||
* that information as coloured bars across the top of the screen.
|
||||
*
|
||||
* This allows interactive measuring of components of the code, very useful for optimisztion.
|
||||
*/
|
||||
|
||||
#ifdef _WIN32
|
||||
#include <windows.h>
|
||||
#include <winbase.h>
|
||||
#endif
|
||||
|
||||
#include "timerbar.h"
|
||||
#include "globalincs/pstypes.h"
|
||||
|
||||
|
||||
// Internal structure for handling frame data
|
||||
typedef struct
|
||||
{
|
||||
LARGE_INTEGER start_value;
|
||||
LARGE_INTEGER total_value;
|
||||
|
||||
LARGE_INTEGER average;
|
||||
LARGE_INTEGER frame_total;
|
||||
|
||||
} timerbar_profile;
|
||||
|
||||
timerbar_profile profiles[MAX_NUM_TIMERBARS];
|
||||
int timerbar_current_profile = 0;
|
||||
|
||||
LARGE_INTEGER timerbar_ultimate_start_value;
|
||||
LARGE_INTEGER timerbar_last_start_value;
|
||||
|
||||
// Data needed for push and pop functionality
|
||||
const int MAX_TB_STACK_SIZE = 100;
|
||||
|
||||
int timerbar_stack[MAX_TB_STACK_SIZE];
|
||||
int timerbar_current_stack_layer = 0;
|
||||
|
||||
/**
|
||||
* Pssst, hey, you. Ya wanna timerbar? Real cheap.
|
||||
*
|
||||
* @param value Index count value (?)
|
||||
*/
|
||||
void timerbar_push(int value)
|
||||
{
|
||||
if(timerbar_current_stack_layer >= MAX_TB_STACK_SIZE)
|
||||
{
|
||||
// To many pushs, this must be a bug
|
||||
// Someone is letting code miss the pops, check for early retuns
|
||||
Assert(!(timerbar_current_stack_layer >= MAX_TB_STACK_SIZE));
|
||||
return;
|
||||
}
|
||||
|
||||
timerbar_stack[timerbar_current_stack_layer] = timerbar_current_profile;
|
||||
timerbar_current_stack_layer++;
|
||||
|
||||
timerbar_switch_type(value);
|
||||
}
|
||||
|
||||
/*
|
||||
*/
|
||||
void timerbar_pop()
|
||||
{
|
||||
timerbar_current_stack_layer--;
|
||||
if(timerbar_current_stack_layer < 0)
|
||||
{
|
||||
Assert(!(timerbar_current_stack_layer < 0));
|
||||
timerbar_current_stack_layer = 0;
|
||||
return;
|
||||
}
|
||||
|
||||
timerbar_switch_type(timerbar_stack[timerbar_current_stack_layer]);
|
||||
}
|
||||
|
||||
/**
|
||||
* This pointer holds the draw function to use or NULL
|
||||
*
|
||||
* @param colour Colour index (>=0)
|
||||
* @param x Coordinate position
|
||||
* @param y Coordinate position
|
||||
* @param w element width
|
||||
* @param h element height
|
||||
*/
|
||||
void (*draw_func_ptr)(int colour, float x, float y, float w, float h) = NULL;
|
||||
|
||||
/*
|
||||
*/
|
||||
void timerbar_start_frame()
|
||||
{
|
||||
timerbar_current_stack_layer = 0;
|
||||
timerbar_current_profile = 0;
|
||||
|
||||
if(QueryPerformanceCounter(&timerbar_ultimate_start_value) == FALSE)
|
||||
{
|
||||
// DBUGFILE_OUTPUT_0("QueryPerformanceCounter not supported by hardware");
|
||||
draw_func_ptr = NULL;
|
||||
}
|
||||
|
||||
timerbar_last_start_value = timerbar_ultimate_start_value;
|
||||
|
||||
}
|
||||
|
||||
// Constants need for timerbar_conv_and_draw calculations
|
||||
const int WIDTH = 480;
|
||||
const float WIDTHF = ((float) WIDTH) * 1.01f;
|
||||
|
||||
/**
|
||||
* Internal conversion function to convert draw data into bars for the screen
|
||||
*
|
||||
* @param colour Colour index (>=0)
|
||||
* @param xpos X position to start bar on
|
||||
* @param xwidth Width of bar
|
||||
* @param yrow Index of row bar belongs to
|
||||
*/
|
||||
void timerbar_conv_and_draw(int colour, int xpos, int xwidth, int yrow)
|
||||
{
|
||||
float fxpos = (float) xpos;
|
||||
float fxwidth = (float) xwidth;
|
||||
|
||||
draw_func_ptr(colour,
|
||||
fxpos / WIDTHF,
|
||||
yrow * 0.01f,
|
||||
fxwidth / WIDTHF,
|
||||
0.005f);
|
||||
}
|
||||
|
||||
/*
|
||||
*/
|
||||
void timerbar_end_frame()
|
||||
{
|
||||
// Now we want to draw the bars
|
||||
if(draw_func_ptr == NULL)
|
||||
{
|
||||
// we have not been given a draw function so we are going to have to quit
|
||||
return;
|
||||
}
|
||||
|
||||
timerbar_switch_type(-1);
|
||||
|
||||
int last_xpos = 0;
|
||||
int y_pos = 0;
|
||||
|
||||
|
||||
for(int i = 0; i < MAX_NUM_TIMERBARS; i++)
|
||||
{
|
||||
// Nothing to render this frame
|
||||
if(profiles[i].frame_total.QuadPart == 0)
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
int xsize = (int) profiles[i].frame_total.QuadPart / 90;
|
||||
|
||||
// break condition in else
|
||||
while(1)
|
||||
{
|
||||
// if bar runs over
|
||||
if(last_xpos + xsize > WIDTH)
|
||||
{
|
||||
int rem_len = WIDTH - last_xpos;
|
||||
|
||||
// Draw from current position to the end of the bar
|
||||
timerbar_conv_and_draw(i, last_xpos, rem_len, y_pos);
|
||||
|
||||
xsize -= rem_len;
|
||||
last_xpos = 0;
|
||||
y_pos++;
|
||||
}
|
||||
else
|
||||
{
|
||||
// Draw whats left and break for the next bar
|
||||
timerbar_conv_and_draw(i,last_xpos, xsize, y_pos);
|
||||
|
||||
last_xpos += xsize;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
// reset for next frame
|
||||
profiles[i].frame_total.QuadPart = 0;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Not entirely sure what this does.
|
||||
*
|
||||
* @param num Probably a pretend boolean
|
||||
*/
|
||||
void timerbar_switch_type(int num)
|
||||
{
|
||||
if(num >= MAX_NUM_TIMERBARS)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
// Calculate old profile's total
|
||||
LARGE_INTEGER now;
|
||||
if(QueryPerformanceCounter(&now) == FALSE)
|
||||
{
|
||||
// DBUGFILE_OUTPUT_0("QueryPerformanceCounter not supported by hardware");
|
||||
}
|
||||
|
||||
profiles[timerbar_current_profile].frame_total.QuadPart +=
|
||||
(now.QuadPart - timerbar_last_start_value.QuadPart);
|
||||
|
||||
if(num != -1)
|
||||
{
|
||||
// Switch to new profile
|
||||
timerbar_current_profile = num;
|
||||
}
|
||||
|
||||
// Update time to count from
|
||||
if(QueryPerformanceCounter(&timerbar_last_start_value) == FALSE)
|
||||
{
|
||||
// DBUGFILE_OUTPUT_0("QueryPerformanceCounter not supported by hardware");
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Clears the instance of the timer bar
|
||||
*
|
||||
* Look at the parameters for "void (*draw_func_ptr)"
|
||||
* They directly equate the new_draw_func_ptr, but we can't
|
||||
* place params for a double stuffed function like this.
|
||||
*/
|
||||
void timerbar_set_draw_func(void (*new_draw_func_ptr)(int colour, float x, float y, float w, float h))
|
||||
{
|
||||
draw_func_ptr = new_draw_func_ptr;
|
||||
}
|
||||
|
||||
@@ -1,30 +0,0 @@
|
||||
/*
|
||||
* Code created by Thomas Whittaker (RT) for a FreeSpace 2 source code project
|
||||
*
|
||||
* You may not sell or otherwise commercially exploit the source or things you
|
||||
* created based on the source.
|
||||
*
|
||||
*/
|
||||
|
||||
|
||||
|
||||
#ifndef _TIMERBAR_HEADER_
|
||||
#define _TIMERBAR_HEADER_
|
||||
|
||||
const int MAX_NUM_TIMERBARS = 20;
|
||||
|
||||
#include "cmdline/cmdline.h"
|
||||
|
||||
// These functions should never be used directly, always use macros below
|
||||
void timerbar_start_frame();
|
||||
void timerbar_end_frame();
|
||||
void timerbar_set_draw_func(void (*new_draw_func_ptr)(int colour, float x, float y, float w, float h));
|
||||
|
||||
void timerbar_push(int value);
|
||||
void timerbar_pop();
|
||||
|
||||
// This function shouldnt not be used any more or it will break push and pop calls
|
||||
void timerbar_switch_type(int num);
|
||||
|
||||
#endif
|
||||
|
||||
@@ -9,18 +9,17 @@
|
||||
|
||||
|
||||
|
||||
#include "asteroid/asteroid.h"
|
||||
#include "cmdline/cmdline.h"
|
||||
#include "fireball/fireballs.h"
|
||||
#include "gamesnd/gamesnd.h"
|
||||
#include "graphics/tmapper.h"
|
||||
#include "render/3d.h"
|
||||
#include "localization/localize.h"
|
||||
#include "model/model.h"
|
||||
#include "object/object.h"
|
||||
#include "ship/ship.h"
|
||||
#include "gamesnd/gamesnd.h"
|
||||
#include "localization/localize.h"
|
||||
#include "cmdline/cmdline.h"
|
||||
#include "parse/parselo.h"
|
||||
#include "globalincs/pstypes.h"
|
||||
#include "asteroid/asteroid.h"
|
||||
#include "render/3d.h"
|
||||
#include "ship/ship.h"
|
||||
|
||||
#include <stdlib.h>
|
||||
|
||||
@@ -76,7 +75,7 @@ void fireball_play_warphole_open_sound(int ship_class, fireball *fb)
|
||||
|
||||
if(fb->warp_open_sound_index > -1) {
|
||||
sound_index = fb->warp_open_sound_index;
|
||||
} else if((ship_class >= 0) && (ship_class < Num_ship_classes)){
|
||||
} else if ((ship_class >= 0) && (ship_class < static_cast<int>(Ship_info.size()))) {
|
||||
if ( Ship_info[ship_class].flags & SIF_HUGE_SHIP ) {
|
||||
sound_index = SND_CAPITAL_WARP_IN;
|
||||
fb->flags |= FBF_WARP_CAPITAL_SIZE;
|
||||
@@ -375,7 +374,7 @@ void fireball_init()
|
||||
|
||||
MONITOR( NumFireballsRend )
|
||||
|
||||
void fireball_render(object * obj)
|
||||
void fireball_render_DEPRECATED(object * obj)
|
||||
{
|
||||
int num;
|
||||
vertex p;
|
||||
@@ -1052,3 +1051,74 @@ float fireball_wormhole_intensity( object *obj )
|
||||
}
|
||||
return rad;
|
||||
}
|
||||
|
||||
void fireball_render(object* obj, draw_list *scene)
|
||||
{
|
||||
int num;
|
||||
vertex p;
|
||||
fireball *fb;
|
||||
|
||||
MONITOR_INC( NumFireballsRend, 1 );
|
||||
|
||||
num = obj->instance;
|
||||
fb = &Fireballs[num];
|
||||
|
||||
if ( Fireballs[num].current_bitmap < 0 )
|
||||
return;
|
||||
|
||||
if ( Cmdline_nohtl ) {
|
||||
g3_rotate_vertex(&p, &obj->pos );
|
||||
} else {
|
||||
g3_transfer_vertex(&p, &obj->pos);
|
||||
}
|
||||
|
||||
switch ( fb->fireball_render_type ) {
|
||||
|
||||
case FIREBALL_MEDIUM_EXPLOSION: {
|
||||
batch_add_bitmap (
|
||||
Fireballs[num].current_bitmap,
|
||||
TMAP_FLAG_TEXTURED | TMAP_HTL_3D_UNLIT | TMAP_FLAG_SOFT_QUAD,
|
||||
&p,
|
||||
fb->orient,
|
||||
obj->radius
|
||||
);
|
||||
}
|
||||
break;
|
||||
|
||||
case FIREBALL_LARGE_EXPLOSION: {
|
||||
// Make the big explosions rotate with the viewer.
|
||||
batch_add_bitmap_rotated (
|
||||
Fireballs[num].current_bitmap,
|
||||
TMAP_FLAG_TEXTURED | TMAP_HTL_3D_UNLIT | TMAP_FLAG_SOFT_QUAD,
|
||||
&p,
|
||||
(i2fl(fb->orient)*PI)/180.0f,
|
||||
obj->radius
|
||||
);
|
||||
}
|
||||
break;
|
||||
|
||||
case FIREBALL_WARP_EFFECT: {
|
||||
float percent_life = fb->time_elapsed / fb->total_time;
|
||||
|
||||
float rad;
|
||||
|
||||
// Code to make effect grow/shrink.
|
||||
float t = fb->time_elapsed;
|
||||
|
||||
if ( t < WARPHOLE_GROW_TIME ) {
|
||||
rad = (float)pow(t/WARPHOLE_GROW_TIME,0.4f)*obj->radius;
|
||||
} else if ( t < fb->total_time - WARPHOLE_GROW_TIME ) {
|
||||
rad = obj->radius;
|
||||
} else {
|
||||
rad = (float)pow((fb->total_time - t)/WARPHOLE_GROW_TIME,0.4f)*obj->radius;
|
||||
}
|
||||
|
||||
warpin_queue_render(scene, obj, &obj->orient, &obj->pos, Fireballs[num].current_bitmap, rad, percent_life, obj->radius, (Fireballs[num].flags & FBF_WARP_3D) );
|
||||
}
|
||||
break;
|
||||
|
||||
|
||||
default:
|
||||
Int3();
|
||||
}
|
||||
}
|
||||
@@ -13,6 +13,7 @@
|
||||
#define _FIREBALLS_H
|
||||
|
||||
#include "globalincs/pstypes.h"
|
||||
#include "model/modelrender.h"
|
||||
|
||||
class object;
|
||||
class ship_info;
|
||||
@@ -76,7 +77,8 @@ typedef struct fireball {
|
||||
// end move
|
||||
|
||||
void fireball_init();
|
||||
void fireball_render(object * obj);
|
||||
void fireball_render_DEPRECATED(object * obj);
|
||||
void fireball_render(object* obj, draw_list *scene);
|
||||
void fireball_delete( object * obj );
|
||||
void fireball_process_post(object * obj, float frame_time);
|
||||
|
||||
@@ -114,6 +116,8 @@ float fireball_wormhole_intensity( object *obj );
|
||||
// internal function to draw warp grid.
|
||||
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 void warpin_queue_render(draw_list *scene, object *obj, matrix *orient, vec3d *pos, int texture_bitmap_num, float radius, float life_percent, float max_radius, int warp_3d);
|
||||
|
||||
extern int Warp_model;
|
||||
|
||||
// Goober5000
|
||||
|
||||
+179
-15
@@ -10,17 +10,15 @@
|
||||
|
||||
|
||||
|
||||
#include "math/vecmat.h"
|
||||
#include "graphics/tmapper.h"
|
||||
#include "render/3d.h"
|
||||
#include "fireball/fireballs.h"
|
||||
#include "mission/missionparse.h"
|
||||
#include "nebula/neb.h"
|
||||
#include "globalincs/pstypes.h"
|
||||
#include "model/model.h"
|
||||
#include "ship/ship.h"
|
||||
#include "cmdline/cmdline.h"
|
||||
|
||||
#include "globalincs/pstypes.h"
|
||||
#include "graphics/tmapper.h"
|
||||
#include "math/vecmat.h"
|
||||
#include "mission/missionparse.h"
|
||||
#include "model/model.h"
|
||||
#include "nebula/neb.h"
|
||||
#include "render/3d.h"
|
||||
#include "ship/ship.h"
|
||||
|
||||
extern int Warp_model;
|
||||
extern int Warp_glow_bitmap;
|
||||
@@ -47,6 +45,25 @@ void draw_face( vertex *v1, vertex *v2, vertex *v3 )
|
||||
|
||||
}
|
||||
|
||||
void warpin_batch_draw_face( int texture, vertex *v1, vertex *v2, vertex *v3 )
|
||||
{
|
||||
vec3d norm;
|
||||
vertex vertlist[3];
|
||||
|
||||
vm_vec_perp(&norm,&v1->world, &v2->world, &v3->world);
|
||||
if ( vm_vec_dot(&norm, &v1->world ) >= 0.0 ) {
|
||||
vertlist[0] = *v3;
|
||||
vertlist[1] = *v2;
|
||||
vertlist[2] = *v1;
|
||||
} else {
|
||||
vertlist[0] = *v1;
|
||||
vertlist[1] = *v2;
|
||||
vertlist[2] = *v3;
|
||||
}
|
||||
|
||||
batch_add_tri(texture, TMAP_FLAG_TEXTURED | TMAP_HTL_3D_UNLIT, vertlist, 1.0f);
|
||||
}
|
||||
|
||||
void warpin_render(object *obj, matrix *orient, vec3d *pos, int texture_bitmap_num, float radius, float life_percent, float max_radius, int warp_3d)
|
||||
{
|
||||
vec3d center;
|
||||
@@ -109,15 +126,18 @@ void warpin_render(object *obj, matrix *orient, vec3d *pos, int texture_bitmap_n
|
||||
}
|
||||
|
||||
if ( (Warp_model >= 0) && (warp_3d || Cmdline_3dwarp) ) {
|
||||
float scale = radius / 25.0f;
|
||||
model_set_warp_globals(scale, scale, scale, texture_bitmap_num, (radius/max_radius) );
|
||||
model_render_params render_info;
|
||||
|
||||
vec3d scale;
|
||||
scale.xyz.z = scale.xyz.y = scale.xyz.x = radius / 25.0f;
|
||||
render_info.set_warp_params(texture_bitmap_num, radius/max_radius, scale);
|
||||
|
||||
float dist = vm_vec_dist_quick( pos, &Eye_position );
|
||||
model_set_detail_level((int)(dist / (radius * 10.0f)));
|
||||
render_info.set_detail_level_lock((int)(dist / (radius * 10.0f)));
|
||||
|
||||
model_render( Warp_model, orient, pos, MR_LOCK_DETAIL | MR_NO_LIGHTING | MR_NORMAL | MR_NO_FOGGING | MR_NO_CULL );
|
||||
render_info.set_flags(MR_NO_LIGHTING | MR_NORMAL | MR_NO_FOGGING | MR_NO_CULL | MR_NO_BATCH);
|
||||
|
||||
model_set_warp_globals();
|
||||
model_render_immediate( &render_info, Warp_model, orient, pos );
|
||||
} else {
|
||||
float Grid_depth = radius/2.5f;
|
||||
|
||||
@@ -197,3 +217,147 @@ void warpin_render(object *obj, matrix *orient, vec3d *pos, int texture_bitmap_n
|
||||
|
||||
gr_zbuffer_set( saved_gr_zbuffering );
|
||||
}
|
||||
|
||||
void warpin_queue_render(draw_list *scene, object *obj, matrix *orient, vec3d *pos, int texture_bitmap_num, float radius, float life_percent, float max_radius, int warp_3d)
|
||||
{
|
||||
vec3d center;
|
||||
vec3d vecs[5];
|
||||
vertex verts[5];
|
||||
|
||||
vm_vec_scale_add( ¢er, pos, &orient->vec.fvec, -(max_radius/2.5f)/3.0f );
|
||||
|
||||
|
||||
if (Warp_glow_bitmap >= 0) {
|
||||
float r = radius;
|
||||
bool render_it = true;
|
||||
|
||||
#define OUT_PERCENT1 0.80f
|
||||
#define OUT_PERCENT2 0.90f
|
||||
|
||||
#define IN_PERCENT1 0.10f
|
||||
#define IN_PERCENT2 0.20f
|
||||
|
||||
if (Cmdline_warp_flash)
|
||||
{
|
||||
if ( (life_percent >= IN_PERCENT1) && (life_percent < IN_PERCENT2) ) {
|
||||
r *= (life_percent - IN_PERCENT1) / (IN_PERCENT2 - IN_PERCENT1);
|
||||
//render_it = true;
|
||||
} else if ( (life_percent >= OUT_PERCENT1) && (life_percent < OUT_PERCENT2) ) {
|
||||
r *= (OUT_PERCENT2 - life_percent) / (OUT_PERCENT2 - OUT_PERCENT1);
|
||||
//render_it = true;
|
||||
}
|
||||
}
|
||||
|
||||
if (render_it) {
|
||||
// Add in noise
|
||||
int noise_frame = fl2i(Missiontime/15.0f) % NOISE_NUM_FRAMES;
|
||||
|
||||
r *= (0.40f + Noise[noise_frame] * 0.30f);
|
||||
|
||||
// Bobboau's warp thingie, toggled by cmdline
|
||||
if (Cmdline_warp_flash) {
|
||||
r += powf((2.0f * life_percent) - 1.0f, 24.0f) * max_radius * 1.5f;
|
||||
}
|
||||
|
||||
vecs[4] = center;
|
||||
verts[4].texture_position.u = 0.5f; verts[4].texture_position.v = 0.5f;
|
||||
|
||||
if (Cmdline_nohtl) {
|
||||
g3_rotate_vertex( &verts[4], &vecs[4] );
|
||||
} else {
|
||||
g3_transfer_vertex( &verts[4], &vecs[4] );
|
||||
}
|
||||
|
||||
float alpha = (The_mission.flags & MISSION_FLAG_FULLNEB) ? (1.0f - neb2_get_fog_intensity(obj)) : 1.0f;
|
||||
|
||||
batch_add_bitmap(Warp_glow_bitmap, TMAP_FLAG_TEXTURED | TMAP_HTL_3D_UNLIT, &verts[4], 0, r, alpha);
|
||||
}
|
||||
}
|
||||
|
||||
if ( (Warp_model >= 0) && (warp_3d || Cmdline_3dwarp) ) {
|
||||
model_render_params render_info;
|
||||
|
||||
float scale = radius / 25.0f;
|
||||
|
||||
vec3d warp_scale;
|
||||
|
||||
warp_scale.xyz.x = warp_scale.xyz.y = warp_scale.xyz.z = scale;
|
||||
|
||||
float dist = vm_vec_dist_quick( pos, &Eye_position );
|
||||
|
||||
render_info.set_warp_params(texture_bitmap_num, radius/max_radius, warp_scale);
|
||||
render_info.set_detail_level_lock((int)(dist / (radius * 10.0f)));
|
||||
render_info.set_flags(MR_NO_LIGHTING | MR_NORMAL | MR_NO_FOGGING | MR_NO_CULL | MR_NO_BATCH);
|
||||
|
||||
model_render_queue( &render_info, scene, Warp_model, orient, pos);
|
||||
} else {
|
||||
float Grid_depth = radius/2.5f;
|
||||
|
||||
// gr_set_bitmap( texture_bitmap_num, GR_ALPHABLEND_FILTER, GR_BITBLT_MODE_NORMAL, 1.0f );
|
||||
|
||||
vm_vec_scale_add( &vecs[0], ¢er, &orient->vec.uvec, radius );
|
||||
vm_vec_scale_add2( &vecs[0], &orient->vec.rvec, -radius );
|
||||
vm_vec_scale_add2( &vecs[0], &orient->vec.fvec, Grid_depth );
|
||||
|
||||
vm_vec_scale_add( &vecs[1], ¢er, &orient->vec.uvec, radius );
|
||||
vm_vec_scale_add2( &vecs[1], &orient->vec.rvec, radius );
|
||||
vm_vec_scale_add2( &vecs[1], &orient->vec.fvec, Grid_depth );
|
||||
|
||||
vm_vec_scale_add( &vecs[2], ¢er, &orient->vec.uvec, -radius );
|
||||
vm_vec_scale_add2( &vecs[2], &orient->vec.rvec, radius );
|
||||
vm_vec_scale_add2( &vecs[2], &orient->vec.fvec, Grid_depth );
|
||||
|
||||
vm_vec_scale_add( &vecs[3], ¢er, &orient->vec.uvec, -radius );
|
||||
vm_vec_scale_add2( &vecs[3], &orient->vec.rvec, -radius );
|
||||
vm_vec_scale_add2( &vecs[3], &orient->vec.fvec, Grid_depth );
|
||||
|
||||
// vm_vec_scale_add( &vecs[4], ¢er, &orient->vec.fvec, -Grid_depth );
|
||||
vecs[4] = center;
|
||||
|
||||
verts[0].texture_position.u = 0.01f;
|
||||
verts[0].texture_position.v = 0.01f;
|
||||
|
||||
verts[1].texture_position.u = 0.99f;
|
||||
verts[1].texture_position.v = 0.01f;
|
||||
|
||||
verts[2].texture_position.u = 0.99f;
|
||||
verts[2].texture_position.v = 0.99f;
|
||||
|
||||
verts[3].texture_position.u = 0.01f;
|
||||
verts[3].texture_position.v = 0.99f;
|
||||
|
||||
verts[4].texture_position.u = 0.5f;
|
||||
verts[4].texture_position.v = 0.5f;
|
||||
|
||||
if (Cmdline_nohtl) {
|
||||
g3_rotate_vertex( &verts[0], &vecs[0] );
|
||||
g3_rotate_vertex( &verts[1], &vecs[1] );
|
||||
g3_rotate_vertex( &verts[2], &vecs[2] );
|
||||
g3_rotate_vertex( &verts[3], &vecs[3] );
|
||||
g3_rotate_vertex( &verts[4], &vecs[4] );
|
||||
} else {
|
||||
g3_transfer_vertex( &verts[0], &vecs[0] );
|
||||
g3_transfer_vertex( &verts[1], &vecs[1] );
|
||||
g3_transfer_vertex( &verts[2], &vecs[2] );
|
||||
g3_transfer_vertex( &verts[3], &vecs[3] );
|
||||
g3_transfer_vertex( &verts[4], &vecs[4] );
|
||||
}
|
||||
|
||||
warpin_batch_draw_face( texture_bitmap_num, &verts[0], &verts[4], &verts[1] );
|
||||
warpin_batch_draw_face( texture_bitmap_num, &verts[1], &verts[4], &verts[2] );
|
||||
warpin_batch_draw_face( texture_bitmap_num, &verts[4], &verts[3], &verts[2] );
|
||||
warpin_batch_draw_face( texture_bitmap_num, &verts[0], &verts[3], &verts[4] );
|
||||
}
|
||||
|
||||
if (Warp_ball_bitmap > -1 && Cmdline_warp_flash == 1) {
|
||||
//flash_ball warp_ball(20, .1f,.25f, &vmd_z_vector, &vmd_zero_vector, 4.0f, 0.5f);
|
||||
flash_ball warp_ball(20, .1f,.25f, &orient->vec.fvec, pos, 4.0f, 0.5f);
|
||||
|
||||
float adg = (2.0f * life_percent) - 1.0f;
|
||||
float pct = (powf(adg, 4.0f) - powf(adg, 128.0f)) * 4.0f;
|
||||
|
||||
if (pct > 0.00001f) {
|
||||
warp_ball.render(Warp_ball_bitmap, max_radius * pct * 0.5f, adg * adg, adg * adg * 6.0f);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -124,14 +124,14 @@ BOOL AltShipClassDlg::OnInitDialog()
|
||||
m_set_from_ship_class.AddString("Set From Variable");
|
||||
}
|
||||
count = 0;
|
||||
for (i=0; i<Num_ship_classes; i++)
|
||||
for (auto it = Ship_info.cbegin(); it != Ship_info.cend(); ++it)
|
||||
{
|
||||
if (player_ships_only && !(Ship_info[i].flags & SIF_PLAYER_SHIP)) {
|
||||
if (player_ships_only && !(it->flags & SIF_PLAYER_SHIP)) {
|
||||
continue;
|
||||
}
|
||||
|
||||
ship_class_indices[count++] = i;
|
||||
m_set_from_ship_class.AddString(Ship_info[i].name);
|
||||
ship_class_indices[count++] = std::distance(Ship_info.cbegin(), it);
|
||||
m_set_from_ship_class.AddString(it->name);
|
||||
}
|
||||
m_set_from_ship_class.SetCurSel(num_string_variables?1:0); // Set to the first ship class
|
||||
|
||||
|
||||
@@ -59,10 +59,27 @@ BOOL FictionViewerDlg::OnInitDialog()
|
||||
box->AddString(Spooled_music[i].name);
|
||||
}
|
||||
|
||||
// init variables
|
||||
m_story_file = _T(fiction_file());
|
||||
m_font_file = _T(fiction_font());
|
||||
m_voice_file = _T(fiction_voice());
|
||||
// make sure we have at least one stage
|
||||
if (Fiction_viewer_stages.empty())
|
||||
{
|
||||
fiction_viewer_stage stage;
|
||||
memset(&stage, 0, sizeof(fiction_viewer_stage));
|
||||
stage.formula = Locked_sexp_true;
|
||||
|
||||
Fiction_viewer_stages.push_back(stage);
|
||||
}
|
||||
else if (Fiction_viewer_stages.size() > 1)
|
||||
{
|
||||
MessageBox("You have multiple fiction viewer stages defined for this mission. At present, FRED will only allow you to edit the first stage.");
|
||||
}
|
||||
|
||||
// init fields based on first fiction viewer stage
|
||||
fiction_viewer_stage *stagep = &Fiction_viewer_stages.at(0);
|
||||
m_story_file = _T(stagep->story_filename);
|
||||
m_font_file = _T(stagep->font_filename);
|
||||
m_voice_file = _T(stagep->voice_filename);
|
||||
|
||||
// music is managed through the mission
|
||||
m_fiction_music = Mission_music[SCORE_FICTION_VIEWER] + 1;
|
||||
|
||||
CDialog::OnInitDialog();
|
||||
@@ -74,9 +91,15 @@ void FictionViewerDlg::OnOK()
|
||||
{
|
||||
UpdateData(TRUE);
|
||||
|
||||
// load it up
|
||||
fiction_viewer_reset();
|
||||
fiction_viewer_load((const char *)(LPCSTR)m_story_file, (const char *)(LPCSTR)m_font_file, (const char *)(LPCSTR)m_voice_file);
|
||||
// store the fields in the data structure
|
||||
fiction_viewer_stage *stagep = &Fiction_viewer_stages.at(0);
|
||||
strcpy_s(stagep->story_filename, (LPCSTR)m_story_file);
|
||||
strcpy_s(stagep->font_filename, (LPCSTR)m_font_file);
|
||||
strcpy_s(stagep->voice_filename, (LPCSTR)m_voice_file);
|
||||
|
||||
// if we don't have a story file, remove this stage (stage 0)
|
||||
if (strlen(stagep->story_filename) == 0)
|
||||
Fiction_viewer_stages.erase(Fiction_viewer_stages.begin());
|
||||
|
||||
// set music
|
||||
Mission_music[SCORE_FICTION_VIEWER] = m_fiction_music - 1;
|
||||
@@ -114,6 +137,8 @@ void FictionViewerDlg::OnClose()
|
||||
|
||||
int FictionViewerDlg::query_modified()
|
||||
{
|
||||
return strcmp(m_story_file, fiction_file()) || strcmp(m_font_file, fiction_font()) ||
|
||||
strcmp(m_voice_file, fiction_voice()) || m_fiction_music != (Mission_music[SCORE_FICTION_VIEWER] + 1);
|
||||
fiction_viewer_stage *stagep = &Fiction_viewer_stages.at(0);
|
||||
|
||||
return strcmp(m_story_file, stagep->story_filename) || strcmp(m_font_file, stagep->font_filename) ||
|
||||
strcmp(m_voice_file, stagep->voice_filename) || m_fiction_music != (Mission_music[SCORE_FICTION_VIEWER] + 1);
|
||||
}
|
||||
@@ -22,6 +22,9 @@ public:
|
||||
// Dialog Data
|
||||
//{{AFX_DATA(FictionViewerDlg)
|
||||
enum { IDD = IDD_FICTION_VIEWER };
|
||||
CString m_fiction_background_640;
|
||||
CString m_fiction_background_1024;
|
||||
int m_fiction_ui;
|
||||
CString m_story_file;
|
||||
CString m_font_file;
|
||||
CString m_voice_file;
|
||||
|
||||
@@ -440,7 +440,7 @@ void asteroid_editor::update_init()
|
||||
for (k = 0; k < MAX_ACTIVE_DEBRIS_TYPES; k++)
|
||||
{
|
||||
box_index = ((CComboBox*)GetDlgItem(Dlg_id[k]))->AddString("None");
|
||||
((CComboBox*)GetDlgItem(Dlg_id[k]))->SetItemData(box_index, -1);
|
||||
((CComboBox*)GetDlgItem(Dlg_id[k]))->SetItemData(box_index, static_cast<DWORD_PTR>(-1));
|
||||
}
|
||||
|
||||
// now add each kind of debris to each box
|
||||
|
||||
+12
-12
@@ -229,17 +229,17 @@ void bg_bitmap_dlg::create()
|
||||
|
||||
angles skybox_angles;
|
||||
vm_extract_angles_matrix(&skybox_angles, &The_mission.skybox_orientation);
|
||||
m_skybox_pitch = (int) fl_degrees(skybox_angles.p);
|
||||
m_skybox_bank = (int) fl_degrees(skybox_angles.b);
|
||||
m_skybox_heading = (int) fl_degrees(skybox_angles.h);
|
||||
m_skybox_pitch = fl2ir(fl_degrees(skybox_angles.p));
|
||||
m_skybox_bank = fl2ir(fl_degrees(skybox_angles.b));
|
||||
m_skybox_heading = fl2ir(fl_degrees(skybox_angles.h));
|
||||
|
||||
//make sure angle values are in the 0-359 degree range
|
||||
if (m_skybox_pitch < 0)
|
||||
m_skybox_pitch = m_skybox_pitch + 359;
|
||||
m_skybox_pitch = m_skybox_pitch + 360;
|
||||
if (m_skybox_bank < 0)
|
||||
m_skybox_bank = m_skybox_bank + 359;
|
||||
m_skybox_bank = m_skybox_bank + 360;
|
||||
if (m_skybox_heading < 0)
|
||||
m_skybox_heading = m_skybox_heading + 359;
|
||||
m_skybox_heading = m_skybox_heading + 360;
|
||||
|
||||
|
||||
for(i=0; i<MAX_NEB2_BITMAPS; i++){
|
||||
@@ -730,9 +730,9 @@ void bg_bitmap_dlg::OnSunChange()
|
||||
starfield_list_entry *sle = &background->suns[s_index];
|
||||
|
||||
s_name = CString(sle->filename);
|
||||
s_pitch = (int) (fl_degrees(sle->ang.p) + delta);
|
||||
s_bank = (int) (fl_degrees(sle->ang.b) + delta);
|
||||
s_heading = (int) (fl_degrees(sle->ang.h) + delta);
|
||||
s_pitch = fl2ir(fl_degrees(sle->ang.p) + delta);
|
||||
s_bank = fl2ir(fl_degrees(sle->ang.b) + delta);
|
||||
s_heading = fl2ir(fl_degrees(sle->ang.h) + delta);
|
||||
s_scale = sle->scale_x;
|
||||
|
||||
// stuff back into the controls
|
||||
@@ -894,9 +894,9 @@ void bg_bitmap_dlg::OnBitmapChange()
|
||||
starfield_list_entry *sle = &background->bitmaps[b_index];
|
||||
|
||||
b_name = CString(sle->filename);
|
||||
b_pitch = (int) (fl_degrees(sle->ang.p) + delta);
|
||||
b_bank = (int) (fl_degrees(sle->ang.b) + delta);
|
||||
b_heading = (int) (fl_degrees(sle->ang.h) + delta);
|
||||
b_pitch = fl2ir(fl_degrees(sle->ang.p) + delta);
|
||||
b_bank = fl2ir(fl_degrees(sle->ang.b) + delta);
|
||||
b_heading = fl2ir(fl_degrees(sle->ang.h) + delta);
|
||||
b_scale_x = sle->scale_x;
|
||||
b_scale_y = sle->scale_y;
|
||||
b_div_x = sle->div_x;
|
||||
|
||||
@@ -196,8 +196,8 @@ void briefing_editor_dlg::create()
|
||||
box->AddString(Iff_info[i].iff_name);
|
||||
|
||||
box = (CComboBox *) GetDlgItem(IDC_SHIP_TYPE);
|
||||
for (i=0; i<Num_ship_classes; i++)
|
||||
box->AddString(Ship_info[i].name);
|
||||
for (auto it = Ship_info.cbegin(); it != Ship_info.cend(); ++it)
|
||||
box->AddString(it->name);
|
||||
|
||||
box = (CComboBox *) GetDlgItem(IDC_BRIEFING_MUSIC);
|
||||
box->AddString("None");
|
||||
@@ -1127,11 +1127,11 @@ void briefing_editor_dlg::OnMakeIcon()
|
||||
else if(jnp != Jump_nodes.end()){
|
||||
// find the first navbuoy
|
||||
iconp->ship_class = -1;
|
||||
for (int i = 0; i < Num_ship_classes; i++)
|
||||
for (auto it = Ship_info.cbegin(); it != Ship_info.cend(); ++it)
|
||||
{
|
||||
if (Ship_info[i].flags & SIF_NAVBUOY)
|
||||
if (it->flags & SIF_NAVBUOY)
|
||||
{
|
||||
iconp->ship_class = i;
|
||||
iconp->ship_class = std::distance(Ship_info.cbegin(), it);
|
||||
break;
|
||||
}
|
||||
}
|
||||
@@ -1141,11 +1141,11 @@ void briefing_editor_dlg::OnMakeIcon()
|
||||
else {
|
||||
// find the first navbuoy
|
||||
iconp->ship_class = -1;
|
||||
for (int i = 0; i < Num_ship_classes; i++)
|
||||
for (auto it = Ship_info.cbegin(); it != Ship_info.cend(); ++it)
|
||||
{
|
||||
if (Ship_info[i].flags & SIF_NAVBUOY)
|
||||
if (it->flags & SIF_NAVBUOY)
|
||||
{
|
||||
iconp->ship_class = i;
|
||||
iconp->ship_class = std::distance(Ship_info.cbegin(), it);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -672,6 +672,10 @@ void event_editor::OnButtonNewEvent()
|
||||
return;
|
||||
}
|
||||
|
||||
// before we do anything, we must check and save off any data from the current event (e.g
|
||||
// the repeat count and interval count)
|
||||
save();
|
||||
|
||||
reset_event(m_num_events++, TVI_LAST);
|
||||
}
|
||||
|
||||
@@ -685,6 +689,11 @@ void event_editor::OnInsert()
|
||||
return;
|
||||
}
|
||||
|
||||
// before we do anything, we must check and save off any data from the current event (e.g
|
||||
// the repeat count and interval count)
|
||||
save();
|
||||
|
||||
|
||||
if(cur_event < 0 || m_num_events == 0)
|
||||
{
|
||||
//There are no events yet, so just create one
|
||||
@@ -750,6 +759,8 @@ void event_editor::reset_event(int num, HTREEITEM after)
|
||||
m_event_tree.item_index = index;
|
||||
m_event_tree.add_operator("do-nothing");
|
||||
|
||||
update_cur_event();
|
||||
|
||||
m_event_tree.SelectItem(h);
|
||||
// GetDlgItem(IDC_CHAIN_DELAY) -> EnableWindow(FALSE);
|
||||
if (num >= MAX_MISSION_EVENTS){
|
||||
@@ -1299,7 +1310,7 @@ void event_editor::OnDeleteMsg()
|
||||
char buf[256];
|
||||
|
||||
// handle this case somewhat gracefully
|
||||
Assert((m_cur_msg >= 0) && (m_cur_msg < m_num_messages));
|
||||
Assertion((m_cur_msg >= -1) && (m_cur_msg < m_num_messages), "Unexpected m_cur_msg value (%d); expected either -1, or between 0-%d. Get a coder!\n", m_cur_msg, m_num_messages - 1);
|
||||
if((m_cur_msg < 0) || (m_cur_msg >= m_num_messages)){
|
||||
return;
|
||||
}
|
||||
|
||||
+95
-97
@@ -18,13 +18,11 @@
|
||||
#undef APSTUDIO_READONLY_SYMBOLS
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
// English (U.S.) resources
|
||||
// English (United States) resources
|
||||
|
||||
#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENU)
|
||||
#ifdef _WIN32
|
||||
LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US
|
||||
#pragma code_page(1252)
|
||||
#endif //_WIN32
|
||||
|
||||
#ifdef APSTUDIO_INVOKED
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
@@ -116,7 +114,7 @@ IDB_DATA_95 BITMAP "res\\data95.bmp"
|
||||
// Toolbar
|
||||
//
|
||||
|
||||
IDR_MAINFRAME TOOLBAR 23, 23
|
||||
IDR_MAINFRAME TOOLBAR 23, 23
|
||||
BEGIN
|
||||
BUTTON ID_SELECT
|
||||
BUTTON ID_SELECT_AND_MOVE
|
||||
@@ -152,7 +150,7 @@ END
|
||||
// Menu
|
||||
//
|
||||
|
||||
IDR_MAINMENU MENU
|
||||
IDR_MAINMENU MENU
|
||||
BEGIN
|
||||
POPUP "&File"
|
||||
BEGIN
|
||||
@@ -334,7 +332,7 @@ BEGIN
|
||||
END
|
||||
END
|
||||
|
||||
IDR_MENU_SHIP_POPUP MENU
|
||||
IDR_MENU_SHIP_POPUP MENU
|
||||
BEGIN
|
||||
POPUP "Properties"
|
||||
BEGIN
|
||||
@@ -344,7 +342,7 @@ BEGIN
|
||||
END
|
||||
END
|
||||
|
||||
IDR_MENU_EDIT_POPUP MENU
|
||||
IDR_MENU_EDIT_POPUP MENU
|
||||
BEGIN
|
||||
POPUP "EDIT"
|
||||
BEGIN
|
||||
@@ -369,7 +367,7 @@ BEGIN
|
||||
END
|
||||
END
|
||||
|
||||
IDR_MENU_CAMPAIGN MENU
|
||||
IDR_MENU_CAMPAIGN MENU
|
||||
BEGIN
|
||||
POPUP "&File"
|
||||
BEGIN
|
||||
@@ -391,7 +389,7 @@ BEGIN
|
||||
END
|
||||
END
|
||||
|
||||
IDR_MENU_EDIT_SEXP_TREE MENU
|
||||
IDR_MENU_EDIT_SEXP_TREE MENU
|
||||
BEGIN
|
||||
POPUP "Edit sexp tree"
|
||||
BEGIN
|
||||
@@ -441,7 +439,7 @@ BEGIN
|
||||
END
|
||||
END
|
||||
|
||||
IDR_WING_EDIT_MENU MENU
|
||||
IDR_WING_EDIT_MENU MENU
|
||||
BEGIN
|
||||
POPUP "&Select Wing"
|
||||
BEGIN
|
||||
@@ -449,7 +447,7 @@ BEGIN
|
||||
END
|
||||
END
|
||||
|
||||
IDR_SHIP_EDIT_MENU MENU
|
||||
IDR_SHIP_EDIT_MENU MENU
|
||||
BEGIN
|
||||
POPUP "&Select Ship"
|
||||
BEGIN
|
||||
@@ -457,7 +455,7 @@ BEGIN
|
||||
END
|
||||
END
|
||||
|
||||
IDR_PLAYER_EDIT_MENU MENU
|
||||
IDR_PLAYER_EDIT_MENU MENU
|
||||
BEGIN
|
||||
POPUP "Select Team"
|
||||
BEGIN
|
||||
@@ -470,7 +468,7 @@ BEGIN
|
||||
END
|
||||
END
|
||||
|
||||
IDR_WAYPOINT_PATH_EDIT_MENU MENU
|
||||
IDR_WAYPOINT_PATH_EDIT_MENU MENU
|
||||
BEGIN
|
||||
POPUP "&Select Waypoint Path"
|
||||
BEGIN
|
||||
@@ -478,7 +476,7 @@ BEGIN
|
||||
END
|
||||
END
|
||||
|
||||
IDR_ASTEROID_FIELD_MENU MENU
|
||||
IDR_ASTEROID_FIELD_MENU MENU
|
||||
BEGIN
|
||||
POPUP "Select Field"
|
||||
BEGIN
|
||||
@@ -486,7 +484,7 @@ BEGIN
|
||||
END
|
||||
END
|
||||
|
||||
IDR_CPGN_VIEW_OFF MENU
|
||||
IDR_CPGN_VIEW_OFF MENU
|
||||
BEGIN
|
||||
POPUP "Blah"
|
||||
BEGIN
|
||||
@@ -495,7 +493,7 @@ BEGIN
|
||||
END
|
||||
END
|
||||
|
||||
IDR_CPGN_VIEW_ON MENU
|
||||
IDR_CPGN_VIEW_ON MENU
|
||||
BEGIN
|
||||
POPUP "Blah"
|
||||
BEGIN
|
||||
@@ -511,7 +509,7 @@ END
|
||||
// Accelerator
|
||||
//
|
||||
|
||||
IDR_MAINFRAME ACCELERATORS
|
||||
IDR_MAINFRAME ACCELERATORS
|
||||
BEGIN
|
||||
"1", ID_SPEED1, VIRTKEY, NOINVERT
|
||||
"1", ID_GROUP1, VIRTKEY, CONTROL, NOINVERT
|
||||
@@ -602,7 +600,7 @@ BEGIN
|
||||
"Z", ID_ZOOM_EXTENTS, VIRTKEY, SHIFT, NOINVERT
|
||||
END
|
||||
|
||||
IDR_ACC_CAMPAIGN ACCELERATORS
|
||||
IDR_ACC_CAMPAIGN ACCELERATORS
|
||||
BEGIN
|
||||
"H", ID_ERROR_CHECKER, VIRTKEY, ALT, NOINVERT
|
||||
"N", ID_CPGN_FILE_NEW, VIRTKEY, CONTROL, NOINVERT
|
||||
@@ -617,13 +615,13 @@ END
|
||||
// Dialog
|
||||
//
|
||||
|
||||
IDD_ABOUTBOX DIALOG 0, 0, 284, 89
|
||||
IDD_ABOUTBOX DIALOG 0, 0, 284, 89
|
||||
STYLE DS_SETFONT | DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU
|
||||
CAPTION "About FRED2"
|
||||
FONT 8, "MS Sans Serif"
|
||||
BEGIN
|
||||
ICON IDR_MAINFRAME,IDC_STATIC,10,17,20,20,SS_REALSIZEIMAGE
|
||||
LTEXT "FRED2_OPEN - FreeSpace Editor, Version 3.7.3 OpenGL",IDC_STATIC,39,8,184,10,SS_NOPREFIX
|
||||
LTEXT "FRED2_OPEN - FreeSpace Editor, Version 3.7.5 OpenGL",IDC_STATIC,39,8,184,10,SS_NOPREFIX
|
||||
LTEXT "Copyright © 1999 Volition, Inc. All Rights Reserved",IDC_STATIC,39,17,164,8
|
||||
DEFPUSHBUTTON "OK",IDOK,229,7,48,14,WS_GROUP
|
||||
LTEXT """Fred2 is the omega of all giant unwieldy pieces of code. Its big, its horrifying, and it just doesn't care. View it at your own risk."" - Dave Baranec",IDC_STATIC,39,62,238,20
|
||||
@@ -698,7 +696,7 @@ BEGIN
|
||||
GROUPBOX "Message Properties",IDC_STATIC,7,184,184,60
|
||||
END
|
||||
|
||||
IDD_SHIP_GOALS_EDITOR DIALOG 0, 0, 412, 221
|
||||
IDD_SHIP_GOALS_EDITOR DIALOG 0, 0, 412, 221
|
||||
STYLE DS_SETFONT | DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU
|
||||
CAPTION "Initial Orders"
|
||||
FONT 8, "MS Sans Serif"
|
||||
@@ -882,7 +880,7 @@ BEGIN
|
||||
CONTROL "Mission End to Mainhall",IDC_END_TO_MAINHALL,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,326,190,142,10
|
||||
END
|
||||
|
||||
IDD_PREFERENCES DIALOG 0, 0, 333, 81
|
||||
IDD_PREFERENCES DIALOG 0, 0, 333, 81
|
||||
STYLE DS_SETFONT | DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU
|
||||
CAPTION "Preferences"
|
||||
FONT 8, "MS Sans Serif"
|
||||
@@ -1017,7 +1015,7 @@ BEGIN
|
||||
LTEXT "Missile bank 4",IDC_STATIC,232,64,46,8
|
||||
END
|
||||
|
||||
IDD_SHIP_MARKINGS DIALOG 0, 0, 252, 140
|
||||
IDD_SHIP_MARKINGS DIALOG 0, 0, 252, 140
|
||||
STYLE DS_SETFONT | DS_MODALFRAME | WS_MINIMIZEBOX | WS_MAXIMIZEBOX | WS_POPUP | WS_CAPTION
|
||||
CAPTION "Ship Markings"
|
||||
FONT 8, "MS Sans Serif"
|
||||
@@ -1042,7 +1040,7 @@ BEGIN
|
||||
EDITTEXT IDC_GOAL_SCORE,293,82,73,14,ES_AUTOHSCROLL | ES_NUMBER
|
||||
COMBOBOX IDC_OBJ_TEAM,293,98,73,71,CBS_DROPDOWNLIST | CBS_SORT | WS_VSCROLL | WS_TABSTOP
|
||||
CONTROL "Objective Invalid",IDC_GOAL_INVALID,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,239,117,69,10
|
||||
CONTROL "Don't Play Completion Sound",IDC_NO_MUSIC,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,239,127,107,10
|
||||
CONTROL "Don't Play Completion Music",IDC_NO_MUSIC,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,239,127,107,10
|
||||
PUSHBUTTON "New Obj.",IDC_BUTTON_NEW_GOAL,233,146,44,14,0,WS_EX_STATICEDGE,HIDC_BUTTON_NEW_GOAL
|
||||
PUSHBUTTON "OK",ID_OK,281,146,44,14
|
||||
PUSHBUTTON "Cancel",IDCANCEL,329,146,44,14
|
||||
@@ -1150,7 +1148,7 @@ BEGIN
|
||||
PUSHBUTTON "Restrict Departure Paths",IDC_RESTRICT_DEPARTURE,160,223,121,14,0,WS_EX_STATICEDGE
|
||||
END
|
||||
|
||||
IDD_OPERATOR_ARGUMENT_TYPES DIALOG 0, 0, 235, 50
|
||||
IDD_OPERATOR_ARGUMENT_TYPES DIALOG 0, 0, 235, 50
|
||||
STYLE DS_SETFONT | DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU
|
||||
CAPTION "Select Argument Types"
|
||||
FONT 8, "MS Sans Serif"
|
||||
@@ -1199,7 +1197,7 @@ BEGIN
|
||||
LTEXT "Set Amount From Variable",IDC_STATIC,179,234,93,10
|
||||
END
|
||||
|
||||
IDD_ORIENT_EDITOR DIALOG 0, 0, 229, 119
|
||||
IDD_ORIENT_EDITOR DIALOG 0, 0, 229, 119
|
||||
STYLE DS_SETFONT | DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU
|
||||
CAPTION "Object Orientation Editor"
|
||||
FONT 8, "MS Sans Serif"
|
||||
@@ -1421,7 +1419,7 @@ BEGIN
|
||||
LTEXT "Delay After Arrival",IDC_STATIC,7,99,57,8
|
||||
END
|
||||
|
||||
IDD_REINFORCEMENT_SELECT DIALOG 0, 0, 156, 132
|
||||
IDD_REINFORCEMENT_SELECT DIALOG 0, 0, 156, 132
|
||||
STYLE DS_SETFONT | DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU
|
||||
CAPTION "Select Reinforcement Unit"
|
||||
FONT 8, "MS Sans Serif"
|
||||
@@ -1431,7 +1429,7 @@ BEGIN
|
||||
PUSHBUTTON "Cancel",IDCANCEL,99,111,50,14
|
||||
END
|
||||
|
||||
IDD_WAYPOINT_PATH_EDITOR DIALOG 0, 0, 145, 29
|
||||
IDD_WAYPOINT_PATH_EDITOR DIALOG 0, 0, 145, 29
|
||||
STYLE DS_SETFONT | DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU
|
||||
CAPTION "Waypoint Path/Jump Node Editor"
|
||||
MENU IDR_WAYPOINT_PATH_EDIT_MENU
|
||||
@@ -1441,7 +1439,7 @@ BEGIN
|
||||
EDITTEXT IDC_NAME,32,7,106,14,ES_AUTOHSCROLL
|
||||
END
|
||||
|
||||
IDD_WING_CREATE DIALOG 0, 0, 119, 68
|
||||
IDD_WING_CREATE DIALOG 0, 0, 119, 68
|
||||
STYLE DS_SETFONT | DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU
|
||||
CAPTION "Create Wing"
|
||||
FONT 8, "MS Sans Serif"
|
||||
@@ -1492,7 +1490,7 @@ BEGIN
|
||||
LTEXT "Team Color Setting:",IDC_STATIC,16,308,66,8
|
||||
END
|
||||
|
||||
IDD_ASTEROID_EDITOR DIALOG 0, 0, 376, 210
|
||||
IDD_ASTEROID_EDITOR DIALOG 0, 0, 376, 210
|
||||
STYLE DS_SETFONT | DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU
|
||||
CAPTION "Debris Field Editor"
|
||||
FONT 8, "MS Sans Serif"
|
||||
@@ -1590,7 +1588,7 @@ BEGIN
|
||||
LTEXT "Debriefing persona index",IDC_STATIC,148,176,79,8
|
||||
END
|
||||
|
||||
IDD_TEXT_VIEW DIALOG 0, 0, 324, 285
|
||||
IDD_TEXT_VIEW DIALOG 0, 0, 324, 285
|
||||
STYLE DS_SETFONT | DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU
|
||||
CAPTION "Ship TBL Data"
|
||||
FONT 8, "MS Sans Serif"
|
||||
@@ -1655,7 +1653,7 @@ BEGIN
|
||||
CONTROL "Use Cargo Icon",IDC_USE_CARGO_ICON,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,233,394,65,10
|
||||
END
|
||||
|
||||
IDD_IGNORE_ORDERS DIALOG 0, 0, 120, 217
|
||||
IDD_IGNORE_ORDERS DIALOG 0, 0, 120, 217
|
||||
STYLE DS_SETFONT | DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU
|
||||
CAPTION "Ignore Orders"
|
||||
FONT 8, "MS Sans Serif"
|
||||
@@ -1705,7 +1703,7 @@ BEGIN
|
||||
COMBOBOX IDC_FAILED_MISSION_TRACK,445,294,80,180,CBS_DROPDOWNLIST | WS_VSCROLL | WS_TABSTOP
|
||||
END
|
||||
|
||||
IDD_ADJUST_GRID DIALOG 0, 0, 153, 94
|
||||
IDD_ADJUST_GRID DIALOG 0, 0, 153, 94
|
||||
STYLE DS_SETFONT | DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU
|
||||
CAPTION "Adjust Grid"
|
||||
FONT 8, "MS Sans Serif"
|
||||
@@ -1727,7 +1725,7 @@ BEGIN
|
||||
LTEXT "X Level",IDC_STATIC,69,50,25,8
|
||||
END
|
||||
|
||||
IDD_SHIELD_SYS DIALOG 0, 0, 192, 106
|
||||
IDD_SHIELD_SYS DIALOG 0, 0, 192, 106
|
||||
STYLE DS_SETFONT | DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU
|
||||
CAPTION "Shield System Editor"
|
||||
FONT 8, "MS Sans Serif"
|
||||
@@ -1744,7 +1742,7 @@ BEGIN
|
||||
PUSHBUTTON "Cancel",IDCANCEL,134,86,50,14
|
||||
END
|
||||
|
||||
IDD_INITIAL_SHIPS DIALOG 0, 0, 127, 210
|
||||
IDD_INITIAL_SHIPS DIALOG 0, 0, 127, 210
|
||||
STYLE DS_SETFONT | DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU
|
||||
CAPTION "Initial Ships Allowed"
|
||||
FONT 8, "MS Sans Serif"
|
||||
@@ -1834,13 +1832,15 @@ BEGIN
|
||||
CONTROL "Laser Protect Ship",IDC_LASER_PROTECT_SHIP,"Button",BS_3STATE | WS_TABSTOP,12,110,80,8
|
||||
CONTROL "Missile Protect Ship",IDC_MISSILE_PROTECT_SHIP,"Button",BS_3STATE | WS_TABSTOP,12,118,80,8
|
||||
GROUPBOX "Turret Threats",IDC_STATIC,7,83,102,48
|
||||
CONTROL "Does Not Move",IDC_IMMOBILE,"Button",BS_3STATE | WS_TABSTOP,7,274,66,10
|
||||
CONTROL "Cloaked",IDC_CLOAKED,"Button",BS_3STATE | WS_TABSTOP,165,167,42,10
|
||||
CONTROL "Scramble Messages",IDC_SCRAMBLE_MESSAGES,"Button",BS_3STATE | WS_TABSTOP,165,177,79,10
|
||||
CONTROL "No Collisions",IDC_NO_COLLIDE,"Button",BS_3STATE | WS_TABSTOP,165,188,66,10
|
||||
END
|
||||
|
||||
IDD_ADD_VARIABLE DIALOG 0, 0, 422, 102
|
||||
CONTROL "Does Not Move",IDC_IMMOBILE,"Button",BS_3STATE | WS_TABSTOP,7,274,66,10
|
||||
CONTROL "Cloaked",IDC_CLOAKED,"Button",BS_3STATE | WS_TABSTOP,165,167,42,10
|
||||
CONTROL "Scramble Messages",IDC_SCRAMBLE_MESSAGES,"Button",BS_3STATE | WS_TABSTOP,165,177,79,10
|
||||
CONTROL "No Collisions",IDC_NO_COLLIDE,"Button",BS_3STATE | WS_TABSTOP,165,188,66,10
|
||||
CONTROL "No Disabled Self-Destruct",IDC_NO_DISABLED_SELF_DESTRUCT,
|
||||
"Button",BS_3STATE | WS_TABSTOP,165,199,114,10
|
||||
END
|
||||
|
||||
IDD_ADD_VARIABLE DIALOG 0, 0, 422, 102
|
||||
STYLE DS_SETFONT | DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU
|
||||
CAPTION "Add Variable"
|
||||
FONT 8, "MS Sans Serif"
|
||||
@@ -1860,7 +1860,7 @@ BEGIN
|
||||
CONTROL "Network-Variable",IDC_TYPE_NETWORK_VARIABLE,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,137,71,84,11
|
||||
END
|
||||
|
||||
IDD_MODIFY_VARIABLE DIALOG 0, 0, 422, 102
|
||||
IDD_MODIFY_VARIABLE DIALOG 0, 0, 422, 102
|
||||
STYLE DS_SETFONT | DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU
|
||||
CAPTION "Modify Variable"
|
||||
FONT 8, "MS Sans Serif"
|
||||
@@ -1882,7 +1882,7 @@ BEGIN
|
||||
CONTROL "Network-Variable",IDC_TYPE_NETWORK_VARIABLE,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,138,72,84,11
|
||||
END
|
||||
|
||||
IDD_SPECIAL_DAMAGE DIALOG 0, 0, 234, 129
|
||||
IDD_SPECIAL_DAMAGE DIALOG 0, 0, 234, 129
|
||||
STYLE DS_SETFONT | DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU
|
||||
CAPTION "Special Explosion"
|
||||
FONT 8, "MS Sans Serif"
|
||||
@@ -1908,7 +1908,7 @@ BEGIN
|
||||
LTEXT "Duration (msecs):",IDC_STATIC,30,111,56,8
|
||||
END
|
||||
|
||||
IDD_DUMP_STATS DIALOG 0, 0, 577, 375
|
||||
IDD_DUMP_STATS DIALOG 0, 0, 577, 375
|
||||
STYLE DS_SETFONT | DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU
|
||||
CAPTION "Mission Stats"
|
||||
FONT 8, "MS Sans Serif"
|
||||
@@ -1918,7 +1918,7 @@ BEGIN
|
||||
EDITTEXT IDC_STATS_TEXT,7,7,563,333,ES_MULTILINE | ES_AUTOHSCROLL | ES_READONLY | ES_WANTRETURN | ES_NUMBER | WS_VSCROLL
|
||||
END
|
||||
|
||||
IDD_SHIP_TEXTURES DIALOG 0, 0, 296, 56
|
||||
IDD_SHIP_TEXTURES DIALOG 0, 0, 296, 56
|
||||
STYLE DS_SETFONT | DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU
|
||||
CAPTION "Ship Texture Replace"
|
||||
FONT 8, "MS Sans Serif"
|
||||
@@ -1928,10 +1928,10 @@ BEGIN
|
||||
PUSHBUTTON "Cancel",IDCANCEL,239,35,50,14
|
||||
LTEXT "Old texture:",IDC_LABEL1,7,7,44,9
|
||||
LTEXT "New texture:",IDC_LABEL2,152,7,44,9
|
||||
COMBOBOX IDC_OLD_TEXTURE_LIST,7,16,137,85,CBS_DROPDOWNLIST | WS_VSCROLL | WS_TABSTOP
|
||||
COMBOBOX IDC_OLD_TEXTURE_LIST,7,16,137,85,CBS_DROPDOWNLIST | WS_VSCROLL | WS_TABSTOP
|
||||
END
|
||||
|
||||
IDD_SPECIAL_HITPOINTS DIALOG 0, 0, 234, 85
|
||||
IDD_SPECIAL_HITPOINTS DIALOG 0, 0, 234, 85
|
||||
STYLE DS_SETFONT | DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU
|
||||
CAPTION "Special Hitpoints"
|
||||
FONT 8, "MS Sans Serif"
|
||||
@@ -1948,7 +1948,7 @@ BEGIN
|
||||
"Button",BS_AUTOCHECKBOX | WS_TABSTOP,7,7,106,10
|
||||
END
|
||||
|
||||
IDD_SET_GLOBAL_SHIP_FLAGS DIALOG 0, 0, 114, 79
|
||||
IDD_SET_GLOBAL_SHIP_FLAGS DIALOG 0, 0, 114, 79
|
||||
STYLE DS_SETFONT | DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU
|
||||
CAPTION "Set Global Ship Flags"
|
||||
FONT 8, "MS Sans Serif"
|
||||
@@ -1959,7 +1959,7 @@ BEGIN
|
||||
PUSHBUTTON "Global Affected-By-Gravity",IDC_AFFECTED_BY_GRAVITY,7,58,100,14
|
||||
END
|
||||
|
||||
IDD_VOICE_MANAGER DIALOG 0, 0, 407, 218
|
||||
IDD_VOICE_MANAGER DIALOG 0, 0, 407, 218
|
||||
STYLE DS_SETFONT | DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU
|
||||
CAPTION "Voice Acting Manager"
|
||||
FONT 8, "MS Sans Serif"
|
||||
@@ -2004,7 +2004,7 @@ BEGIN
|
||||
"Button",BS_AUTOCHECKBOX | BS_TOP | BS_MULTILINE | WS_TABSTOP,166,159,100,19
|
||||
END
|
||||
|
||||
IDD_BRIEFING_PERSONAS DIALOG 0, 0, 320, 201
|
||||
IDD_BRIEFING_PERSONAS DIALOG 0, 0, 320, 201
|
||||
STYLE DS_SETFONT | DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU
|
||||
CAPTION "Dialog"
|
||||
FONT 8, "MS Sans Serif"
|
||||
@@ -2013,7 +2013,7 @@ BEGIN
|
||||
PUSHBUTTON "Cancel",IDCANCEL,263,24,50,14
|
||||
END
|
||||
|
||||
IDD_CUSTOM_WING_NAMES DIALOG 0, 0, 390, 54
|
||||
IDD_CUSTOM_WING_NAMES DIALOG 0, 0, 390, 54
|
||||
STYLE DS_SETFONT | DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU
|
||||
CAPTION "Custom Wing Names"
|
||||
FONT 8, "MS Sans Serif"
|
||||
@@ -2035,7 +2035,7 @@ BEGIN
|
||||
PUSHBUTTON "Cancel",IDCANCEL,333,24,50,14
|
||||
END
|
||||
|
||||
IDD_RESTRICT_PATHS DIALOG 0, 0, 241, 87
|
||||
IDD_RESTRICT_PATHS DIALOG 0, 0, 241, 87
|
||||
STYLE DS_SETFONT | DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU
|
||||
CAPTION "Restrict Paths"
|
||||
FONT 8, "MS Sans Serif"
|
||||
@@ -2046,7 +2046,7 @@ BEGIN
|
||||
LTEXT "Restrict departure paths to the following:",IDC_RESTRICT_PATHS_LABEL,7,7,127,11
|
||||
END
|
||||
|
||||
IDD_BACKGROUND_CHOOSER DIALOG 0, 0, 152, 45
|
||||
IDD_BACKGROUND_CHOOSER DIALOG 0, 0, 152, 45
|
||||
STYLE DS_SETFONT | DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU
|
||||
CAPTION "Choose a background"
|
||||
FONT 8, "MS Sans Serif"
|
||||
@@ -2103,8 +2103,8 @@ END
|
||||
//
|
||||
|
||||
VS_VERSION_INFO VERSIONINFO
|
||||
FILEVERSION 3,7,1,000000
|
||||
PRODUCTVERSION 3,7,1,000000
|
||||
FILEVERSION 3,7,5,0
|
||||
PRODUCTVERSION 3,7,5,0
|
||||
FILEFLAGSMASK 0x3fL
|
||||
#ifdef _DEBUG
|
||||
FILEFLAGS 0x1L
|
||||
@@ -2121,12 +2121,12 @@ BEGIN
|
||||
BEGIN
|
||||
VALUE "CompanyName", "Volition Inc."
|
||||
VALUE "FileDescription", "Fred 2 Open"
|
||||
VALUE "FileVersion", "3.7.3.000000"
|
||||
VALUE "FileVersion", "3.7.5.000000"
|
||||
VALUE "InternalName", "Fred 2 Open"
|
||||
VALUE "LegalCopyright", "Copyright © 1998"
|
||||
VALUE "OriginalFilename", "fred2.exe"
|
||||
VALUE "ProductName", "Fred 2 Open"
|
||||
VALUE "ProductVersion", "3.7.3"
|
||||
VALUE "ProductVersion", "3.7.5"
|
||||
END
|
||||
END
|
||||
BLOCK "VarFileInfo"
|
||||
@@ -2142,7 +2142,7 @@ END
|
||||
//
|
||||
|
||||
#ifdef APSTUDIO_INVOKED
|
||||
GUIDELINES DESIGNINFO
|
||||
GUIDELINES DESIGNINFO
|
||||
BEGIN
|
||||
IDD_ABOUTBOX, DIALOG
|
||||
BEGIN
|
||||
@@ -2696,19 +2696,19 @@ IDC_CURSOR2 CURSOR "res\\cursor2.cur"
|
||||
// String Table
|
||||
//
|
||||
|
||||
STRINGTABLE
|
||||
STRINGTABLE
|
||||
BEGIN
|
||||
IDR_MAINFRAME "FRED2_OPEN 3.7.3 - FreeSpace2 Mission Editor\nUntitled\nFRED2\nFreeSpace2 Missions (*.fs2)\n.fs2\nFreeSpace2Mission\nFreeSpace2 Mission"
|
||||
IDR_MAINFRAME "FRED2_OPEN 3.7.5 - FreeSpace2 Mission Editor\nUntitled\nFRED2\nFreeSpace2 Missions (*.fs2)\n.fs2\nFreeSpace2Mission\nFreeSpace2 Mission"
|
||||
END
|
||||
|
||||
STRINGTABLE
|
||||
STRINGTABLE
|
||||
BEGIN
|
||||
AFX_IDS_APP_TITLE "FRED2"
|
||||
AFX_IDS_IDLEMESSAGE "For Help, press F1"
|
||||
AFX_IDS_HELPMODEMESSAGE "Select an object on which to get Help"
|
||||
END
|
||||
|
||||
STRINGTABLE
|
||||
STRINGTABLE
|
||||
BEGIN
|
||||
ID_FILE_NEW "Create a new campaign\nNew"
|
||||
ID_FILE_OPEN "Open an existing campaign\nOpen"
|
||||
@@ -2721,7 +2721,7 @@ BEGIN
|
||||
ID_FILE_PRINT_PREVIEW "Display full pages\nPrint Preview"
|
||||
END
|
||||
|
||||
STRINGTABLE
|
||||
STRINGTABLE
|
||||
BEGIN
|
||||
ID_APP_ABOUT "Display program information, version number and copyright\nAbout"
|
||||
ID_APP_EXIT "Exit the campaign editor\nExit"
|
||||
@@ -2732,7 +2732,7 @@ BEGIN
|
||||
ID_HELP "Display help for current task or command\nHelp"
|
||||
END
|
||||
|
||||
STRINGTABLE
|
||||
STRINGTABLE
|
||||
BEGIN
|
||||
ID_FILE_MRU_FILE1 "Open this document"
|
||||
ID_FILE_MRU_FILE2 "Open this document"
|
||||
@@ -2752,18 +2752,18 @@ BEGIN
|
||||
ID_FILE_MRU_FILE16 "Open this document"
|
||||
END
|
||||
|
||||
STRINGTABLE
|
||||
STRINGTABLE
|
||||
BEGIN
|
||||
ID_NEXT_PANE "Switch to the next window pane\nNext Pane"
|
||||
ID_PREV_PANE "Switch back to the previous window pane\nPrevious Pane"
|
||||
END
|
||||
|
||||
STRINGTABLE
|
||||
STRINGTABLE
|
||||
BEGIN
|
||||
ID_WINDOW_SPLIT "Split the active window into panes\nSplit"
|
||||
END
|
||||
|
||||
STRINGTABLE
|
||||
STRINGTABLE
|
||||
BEGIN
|
||||
ID_EDIT_CLEAR "Erase the selection\nErase"
|
||||
ID_EDIT_CLEAR_ALL "Erase everything\nErase All"
|
||||
@@ -2778,13 +2778,13 @@ BEGIN
|
||||
ID_EDIT_REDO "Redo the previously undone action\nRedo"
|
||||
END
|
||||
|
||||
STRINGTABLE
|
||||
STRINGTABLE
|
||||
BEGIN
|
||||
ID_VIEW_TOOLBAR "Show or hide the toolbar\nToggle ToolBar"
|
||||
ID_VIEW_STATUS_BAR "Show or hide the status bar\nToggle StatusBar"
|
||||
END
|
||||
|
||||
STRINGTABLE
|
||||
STRINGTABLE
|
||||
BEGIN
|
||||
AFX_IDS_SCSIZE "Change the window size"
|
||||
AFX_IDS_SCMOVE "Change the window position"
|
||||
@@ -2795,24 +2795,24 @@ BEGIN
|
||||
AFX_IDS_SCCLOSE "Close the active window and prompts to save the documents"
|
||||
END
|
||||
|
||||
STRINGTABLE
|
||||
STRINGTABLE
|
||||
BEGIN
|
||||
AFX_IDS_SCRESTORE "Restore the window to normal size"
|
||||
AFX_IDS_SCTASKLIST "Activate Task List"
|
||||
END
|
||||
|
||||
STRINGTABLE
|
||||
STRINGTABLE
|
||||
BEGIN
|
||||
AFX_IDS_PREVIEW_CLOSE "Close print preview mode\nCancel Preview"
|
||||
END
|
||||
|
||||
STRINGTABLE
|
||||
STRINGTABLE
|
||||
BEGIN
|
||||
ID_FILE_MISSIONNOTES "Displays designer notes and mission properties\nMission Specs"
|
||||
ID_SELECT "Select objects mode\nSelect (S)"
|
||||
END
|
||||
|
||||
STRINGTABLE
|
||||
STRINGTABLE
|
||||
BEGIN
|
||||
ID_VIEW_FIGHTERS "Show/Hide Fighter objects"
|
||||
ID_VIEW_CAPITALSHIPS "Show/Hide Capital Ship objects"
|
||||
@@ -2830,7 +2830,7 @@ BEGIN
|
||||
ID_EDITORS_SHIPS "Open ship editor dialog window to edit ship"
|
||||
END
|
||||
|
||||
STRINGTABLE
|
||||
STRINGTABLE
|
||||
BEGIN
|
||||
ID_EDITORS_GOALS "Activates Mission Goal Editor\nMission Goal Editor"
|
||||
ID_EDITORS_WAYPOINTS "Activates Waypoint Editor\nWaypoint Editor"
|
||||
@@ -2841,7 +2841,7 @@ BEGIN
|
||||
ID_PROPERTIES_ONE "This is Mike's prompt!"
|
||||
END
|
||||
|
||||
STRINGTABLE
|
||||
STRINGTABLE
|
||||
BEGIN
|
||||
ID_INDICATOR_EXT "EXT"
|
||||
ID_INDICATOR_CAPS "CAP"
|
||||
@@ -2855,7 +2855,7 @@ BEGIN
|
||||
ID_INDICATOR_MODIFIED "MODIFIED"
|
||||
END
|
||||
|
||||
STRINGTABLE
|
||||
STRINGTABLE
|
||||
BEGIN
|
||||
ID_MISCSTUFF_SHOWSHIPSASICONS "This is the (help?) prompt!"
|
||||
ID_EDIT_POPUP_SHOW_SHIP_MODELS
|
||||
@@ -2864,7 +2864,7 @@ BEGIN
|
||||
"Display ship names and ship types for visible ships"
|
||||
END
|
||||
|
||||
STRINGTABLE
|
||||
STRINGTABLE
|
||||
BEGIN
|
||||
ID_ADD_MISSION_TIME "Evaluates to elapsed time into mission in seconds"
|
||||
ID_ADD_EQUALS "Evaluates to true if numbers or objects are the same"
|
||||
@@ -2879,7 +2879,7 @@ BEGIN
|
||||
ID_ADD_FALSE "Evaluates to a boolean value of false"
|
||||
END
|
||||
|
||||
STRINGTABLE
|
||||
STRINGTABLE
|
||||
BEGIN
|
||||
ID_EDIT_POPUP_SHOW_COMPASS
|
||||
"Display a 3 dimentional compass in the upper right corner of window"
|
||||
@@ -2893,7 +2893,7 @@ BEGIN
|
||||
ID_ADD_MINUS "Evaluates to difference between first subexpression and remaining subexpressions"
|
||||
END
|
||||
|
||||
STRINGTABLE
|
||||
STRINGTABLE
|
||||
BEGIN
|
||||
ID_SHOW_GRID_POSITIONS "Show position on grid for all visible objects"
|
||||
ID_SHOW_COORDINATES "Display the coordinates of objects/waypoints."
|
||||
@@ -2908,7 +2908,7 @@ BEGIN
|
||||
ID_DISSOLVE_WING "Remove selected ships from Wing(s)\nRemove from Wing"
|
||||
END
|
||||
|
||||
STRINGTABLE
|
||||
STRINGTABLE
|
||||
BEGIN
|
||||
ID_SELECT_AND_MOVE "Select and Move objects\nSelect and Move (M)"
|
||||
ID_SELECT_AND_ROTATE "Select and Rotate objects\nSelect and Rotate (R)"
|
||||
@@ -2923,7 +2923,7 @@ BEGIN
|
||||
ID_FIND_DISTANCE "Find Distance between two objects\nFind Distance"
|
||||
END
|
||||
|
||||
STRINGTABLE
|
||||
STRINGTABLE
|
||||
BEGIN
|
||||
ID_BUTTON32944 "Constrain to YZ axis\nYZ Constraint"
|
||||
ID_BUTTON32945 "Constrain to XY axis\nXY Constraint"
|
||||
@@ -2938,27 +2938,27 @@ BEGIN
|
||||
ID_SHOW_HORIZON "Show the horizon line"
|
||||
END
|
||||
|
||||
STRINGTABLE
|
||||
STRINGTABLE
|
||||
BEGIN
|
||||
ID_EDITORS_PLAYER "Edit loadout information for all teams"
|
||||
END
|
||||
|
||||
STRINGTABLE
|
||||
STRINGTABLE
|
||||
BEGIN
|
||||
ID_REVERT "Revert changes by reloading mission from last save\nRevert"
|
||||
END
|
||||
|
||||
STRINGTABLE
|
||||
STRINGTABLE
|
||||
BEGIN
|
||||
ID_ERROR_CHECKER "Checks campaign for errors"
|
||||
END
|
||||
|
||||
STRINGTABLE
|
||||
STRINGTABLE
|
||||
BEGIN
|
||||
ID_LOOKAT_OBJ "Rotate camera around selected object\nRotate around object (Ctrl+V)"
|
||||
END
|
||||
|
||||
STRINGTABLE
|
||||
STRINGTABLE
|
||||
BEGIN
|
||||
ID_EDITORS_ADJUST_GRID "Adjust the orientation and level of the grid."
|
||||
ID_EDITORS_SHIELD_SYS "Editor for availability of shield system for ships."
|
||||
@@ -2966,7 +2966,7 @@ BEGIN
|
||||
ID_MARK_WING "Mark entire wing selected object is a member of."
|
||||
END
|
||||
|
||||
STRINGTABLE
|
||||
STRINGTABLE
|
||||
BEGIN
|
||||
ID_CONTROL_OBJ "Movement keys control marked objects instead of camera."
|
||||
ID_CHECKOUT "Checks out the mission from Source Safe"
|
||||
@@ -2974,37 +2974,35 @@ BEGIN
|
||||
ID_AA_GRIDLINES "Toggle Gridlines being drawn anti-aliased or not."
|
||||
END
|
||||
|
||||
STRINGTABLE
|
||||
STRINGTABLE
|
||||
BEGIN
|
||||
ID_FORMAT_FS2_OPEN "Save missions with SCP features"
|
||||
ID_FORMAT_FS2_RETAIL "Save missions compatible with FS2 retail"
|
||||
ID_FORMAT_FS1 "Save missions compatible with FS1 retail"
|
||||
END
|
||||
|
||||
STRINGTABLE
|
||||
STRINGTABLE
|
||||
BEGIN
|
||||
ID_FORMAT_FS1_RETAIL "Save missions compatible with FS1 retail"
|
||||
END
|
||||
|
||||
#endif // English (U.S.) resources
|
||||
#endif // English (United States) resources
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
// English (U.K.) resources
|
||||
// English (United Kingdom) resources
|
||||
|
||||
#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENG)
|
||||
#ifdef _WIN32
|
||||
LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_UK
|
||||
#pragma code_page(1252)
|
||||
#endif //_WIN32
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// Dialog
|
||||
//
|
||||
|
||||
IDD_ALT_SHIP_CLASS DIALOG 0, 0, 312, 212
|
||||
IDD_ALT_SHIP_CLASS DIALOG 0, 0, 312, 212
|
||||
STYLE DS_SETFONT | DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU
|
||||
CAPTION "Alternate Ship Class Editor"
|
||||
FONT 8, "MS Sans Serif"
|
||||
@@ -3031,7 +3029,7 @@ END
|
||||
//
|
||||
|
||||
#ifdef APSTUDIO_INVOKED
|
||||
GUIDELINES DESIGNINFO
|
||||
GUIDELINES DESIGNINFO
|
||||
BEGIN
|
||||
IDD_ALT_SHIP_CLASS, DIALOG
|
||||
BEGIN
|
||||
@@ -3043,7 +3041,7 @@ BEGIN
|
||||
END
|
||||
#endif // APSTUDIO_INVOKED
|
||||
|
||||
#endif // English (U.K.) resources
|
||||
#endif // English (United Kingdom) resources
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
|
||||
|
||||
@@ -25,7 +25,6 @@
|
||||
#include "object/object.h"
|
||||
#include "editor.h"
|
||||
#include "ai/ai.h"
|
||||
#include "ai/ailocal.h"
|
||||
#include "cfile/cfile.h"
|
||||
|
||||
#include "cfile/cfilesystem.h"
|
||||
|
||||
@@ -12,7 +12,6 @@
|
||||
#ifndef _FREDDOC_H
|
||||
#define _FREDDOC_H
|
||||
|
||||
#include "ai/ailocal.h"
|
||||
#include "MissionSave.h"
|
||||
|
||||
#define MISSION_BACKUP_NAME "Backup"
|
||||
|
||||
+43
-37
@@ -34,7 +34,6 @@
|
||||
#include "model/model.h"
|
||||
#include "palman/palman.h"
|
||||
#include "editor.h"
|
||||
#include "ai/ailocal.h"
|
||||
#include "ship/ship.h"
|
||||
#include "cfile/cfile.h"
|
||||
#include "mission/missionparse.h"
|
||||
@@ -141,8 +140,7 @@ color colour_yellow;
|
||||
|
||||
void fred_enable_htl()
|
||||
{
|
||||
if (!Briefing_dialog) gr_set_proj_matrix( (4.0f/9.0f) * PI * FRED_DEFAULT_HTL_FOV, gr_screen.aspect*(float)gr_screen.clip_width/(float)gr_screen.clip_height, 1.0f, FRED_DEAFULT_HTL_DRAW_DIST);
|
||||
if (Briefing_dialog) gr_set_proj_matrix( Briefing_window_FOV, gr_screen.aspect*(float)gr_screen.clip_width/(float)gr_screen.clip_height, 1.0f, FRED_DEAFULT_HTL_DRAW_DIST);
|
||||
gr_set_proj_matrix((4.0f/9.0f) * PI * (Briefing_dialog ? Briefing_window_FOV : FRED_DEFAULT_HTL_FOV), gr_screen.aspect*(float)gr_screen.clip_width/(float)gr_screen.clip_height, 1.0f, FRED_DEAFULT_HTL_DRAW_DIST);
|
||||
gr_set_view_matrix(&Eye_position, &Eye_matrix);
|
||||
}
|
||||
|
||||
@@ -702,6 +700,7 @@ void render_one_model_briefing_screen(object *objp)
|
||||
void render_one_model_nohtl(object *objp)
|
||||
{
|
||||
int j, z;
|
||||
uint debug_flags = 0;
|
||||
object *o2;
|
||||
|
||||
Assert(objp->type != OBJ_NONE);
|
||||
@@ -755,11 +754,11 @@ void render_one_model_nohtl(object *objp)
|
||||
}
|
||||
|
||||
if(Show_dock_points){
|
||||
j |= MR_BAY_PATHS;
|
||||
debug_flags |= MR_DEBUG_BAY_PATHS;
|
||||
}
|
||||
|
||||
if(Show_paths_fred){
|
||||
j |= MR_SHOW_PATHS;
|
||||
debug_flags |= MR_DEBUG_PATHS;
|
||||
}
|
||||
|
||||
z = objp->instance;
|
||||
@@ -768,12 +767,19 @@ void render_one_model_nohtl(object *objp)
|
||||
|
||||
// if (!viewpoint || OBJ_INDEX(objp) != cur_object_index)
|
||||
{
|
||||
model_render_params render_info;
|
||||
|
||||
if (Fred_outline) {
|
||||
model_set_outline_color(Fred_outline >> 16, (Fred_outline >> 8) & 0xff, Fred_outline & 0xff);
|
||||
model_render(Ship_info[Ships[z].ship_info_index].model_num, &objp->orient, &objp->pos, j | MR_SHOW_OUTLINE, -1, -1, Ships[z].ship_replacement_textures);
|
||||
render_info.set_flags(j | MR_SHOW_OUTLINE | MR_NO_TEXTURING | MR_NO_LIGHTING);
|
||||
render_info.set_color(Fred_outline >> 16, (Fred_outline >> 8) & 0xff, Fred_outline & 0xff);
|
||||
} else {
|
||||
model_render(Ship_info[Ships[z].ship_info_index].model_num, &objp->orient, &objp->pos, j, -1, -1, Ships[z].ship_replacement_textures);
|
||||
render_info.set_flags(j);
|
||||
}
|
||||
|
||||
render_info.set_debug_flags(debug_flags);
|
||||
render_info.set_replacement_textures(Ships[z].ship_replacement_textures);
|
||||
|
||||
model_render_immediate(&render_info, Ship_info[Ships[z].ship_info_index].model_num, &objp->orient, &objp->pos);
|
||||
}
|
||||
|
||||
} else {
|
||||
@@ -831,6 +837,7 @@ void render_one_model_nohtl(object *objp)
|
||||
void render_one_model_htl(object *objp)
|
||||
{
|
||||
int j, z;
|
||||
uint debug_flags = 0;
|
||||
object *o2;
|
||||
|
||||
Assert(objp->type != OBJ_NONE);
|
||||
@@ -878,18 +885,15 @@ void render_one_model_htl(object *objp)
|
||||
// build flags
|
||||
if ((Show_ship_models || Show_outlines) && ((objp->type == OBJ_SHIP) || (objp->type == OBJ_START))){
|
||||
g3_start_instance_matrix(&Eye_position, &Eye_matrix, 0);
|
||||
if (Show_ship_models){
|
||||
j = MR_NORMAL;
|
||||
} else {
|
||||
j = MR_NO_POLYS;
|
||||
}
|
||||
|
||||
j = MR_NORMAL;
|
||||
|
||||
if(Show_dock_points){
|
||||
j |= MR_BAY_PATHS;
|
||||
debug_flags |= MR_DEBUG_BAY_PATHS;
|
||||
}
|
||||
|
||||
if(Show_paths_fred){
|
||||
j |= MR_SHOW_PATHS;
|
||||
debug_flags |= MR_DEBUG_PATHS;
|
||||
}
|
||||
|
||||
z = objp->instance;
|
||||
@@ -905,13 +909,23 @@ void render_one_model_htl(object *objp)
|
||||
j |= MR_FULL_DETAIL;
|
||||
}
|
||||
|
||||
model_render_params render_info;
|
||||
|
||||
render_info.set_debug_flags(debug_flags);
|
||||
render_info.set_replacement_textures(Ships[z].ship_replacement_textures);
|
||||
|
||||
if (Fred_outline) {
|
||||
model_set_outline_color(Fred_outline >> 16, (Fred_outline >> 8) & 0xff, Fred_outline & 0xff);
|
||||
j |= MR_SHOW_OUTLINE_HTL;
|
||||
render_info.set_color(Fred_outline >> 16, (Fred_outline >> 8) & 0xff, Fred_outline & 0xff);
|
||||
render_info.set_flags(j | MR_SHOW_OUTLINE_HTL | MR_NO_LIGHTING | MR_NO_POLYS | MR_NO_TEXTURING);
|
||||
model_render_immediate(&render_info, Ship_info[Ships[z].ship_info_index].model_num, &objp->orient, &objp->pos);
|
||||
}
|
||||
|
||||
g3_done_instance(0);
|
||||
model_render(Ship_info[Ships[z].ship_info_index].model_num, &objp->orient, &objp->pos, j, -1, -1, Ships[z].ship_replacement_textures);
|
||||
|
||||
if ( Show_ship_models ) {
|
||||
render_info.set_flags(j);
|
||||
model_render_immediate(&render_info, Ship_info[Ships[z].ship_info_index].model_num, &objp->orient, &objp->pos);
|
||||
}
|
||||
} else {
|
||||
int r = 0, g = 0, b = 0;
|
||||
|
||||
@@ -1126,7 +1140,7 @@ void draw_orient_sphere(object *obj, int r, int g, int b)
|
||||
|
||||
if ((obj->type != OBJ_WAYPOINT) && (obj->type != OBJ_POINT))
|
||||
{
|
||||
flag = (vm_vec_dotprod(&eye_orient.vec.fvec, &obj->orient.vec.fvec) < 0.0f);
|
||||
flag = (vm_vec_dot(&eye_orient.vec.fvec, &obj->orient.vec.fvec) < 0.0f);
|
||||
v1 = v2 = obj->pos;
|
||||
vm_vec_scale_add2(&v1, &obj->orient.vec.fvec, size);
|
||||
vm_vec_scale_add2(&v2, &obj->orient.vec.fvec, size * 1.5f);
|
||||
@@ -1162,7 +1176,7 @@ void draw_orient_sphere2(int col, object *obj, int r, int g, int b)
|
||||
|
||||
if ((obj->type != OBJ_WAYPOINT) && (obj->type != OBJ_POINT))
|
||||
{
|
||||
flag = (vm_vec_dotprod(&eye_orient.vec.fvec, &obj->orient.vec.fvec) < 0.0f);
|
||||
flag = (vm_vec_dot(&eye_orient.vec.fvec, &obj->orient.vec.fvec) < 0.0f);
|
||||
|
||||
v1 = v2 = obj->pos;
|
||||
vm_vec_scale_add2(&v1, &obj->orient.vec.fvec, size);
|
||||
@@ -1359,11 +1373,11 @@ void process_controls(vec3d *pos, matrix *orient, float frametime, int key, int
|
||||
|
||||
vm_angles_2_matrix(&rotmat, &rotangs);
|
||||
if (rotangs.h && Universal_heading)
|
||||
vm_transpose_matrix(orient);
|
||||
vm_transpose(orient);
|
||||
vm_matrix_x_matrix(&newmat, orient, &rotmat);
|
||||
*orient = newmat;
|
||||
if (rotangs.h && Universal_heading)
|
||||
vm_transpose_matrix(orient);
|
||||
vm_transpose(orient);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1489,11 +1503,7 @@ void render_frame()
|
||||
gr_set_font(FONT1);
|
||||
light_reset();
|
||||
|
||||
if (Briefing_dialog) {
|
||||
g3_set_view_matrix(&eye_pos, &eye_orient, Briefing_window_FOV);
|
||||
} else {
|
||||
g3_set_view_matrix(&eye_pos, &eye_orient, 0.5f);
|
||||
}
|
||||
g3_set_view_matrix(&eye_pos, &eye_orient, (Briefing_dialog ? Briefing_window_FOV : FRED_DEFAULT_HTL_FOV));
|
||||
Viewer_pos = eye_pos; // for starfield code
|
||||
|
||||
fred_enable_htl();
|
||||
@@ -1598,11 +1608,7 @@ void render_frame()
|
||||
gr_set_clip(0, 0, True_rw, True_rh);
|
||||
|
||||
g3_start_frame(0); // ** Accounted for
|
||||
if (Briefing_dialog) {
|
||||
g3_set_view_matrix(&eye_pos, &eye_orient, Briefing_window_FOV);
|
||||
} else {
|
||||
g3_set_view_matrix(&eye_pos, &eye_orient, 0.5f);
|
||||
}
|
||||
g3_set_view_matrix(&eye_pos, &eye_orient, (Briefing_dialog ? Briefing_window_FOV : FRED_DEFAULT_HTL_FOV));
|
||||
}
|
||||
|
||||
void game_do_frame()
|
||||
@@ -1653,7 +1659,7 @@ void game_do_frame()
|
||||
leader = &Objects[cur_object_index];
|
||||
leader_old_pos = leader->pos; // save original position
|
||||
leader_orient = leader->orient; // save original orientation
|
||||
vm_copy_transpose_matrix(&leader_transpose, &leader_orient);
|
||||
vm_copy_transpose(&leader_transpose, &leader_orient);
|
||||
|
||||
process_controls(&leader->pos, &leader->orient, f2fl(Frametime), key);
|
||||
vm_vec_sub(&delta_pos, &leader->pos, &leader_old_pos); // get position change
|
||||
@@ -1670,7 +1676,7 @@ void game_do_frame()
|
||||
|
||||
// change rotation matrix to rotate in opposite direction. This rotation
|
||||
// matrix is what the leader ship has rotated by.
|
||||
vm_copy_transpose_matrix(&rot_trans, &view_physics.last_rotmat);
|
||||
vm_copy_transpose(&rot_trans, &view_physics.last_rotmat);
|
||||
|
||||
// get point relative to our point of rotation (make POR the origin). Since
|
||||
// only the leader has been moved yet, and not the objects, we have to use
|
||||
@@ -2021,7 +2027,7 @@ void render_compass(void)
|
||||
|
||||
v.xyz.x = 1.0f;
|
||||
v.xyz.y = v.xyz.z = 0.0f;
|
||||
if (vm_vec_dotprod(&eye, &v) < 0.0f)
|
||||
if (vm_vec_dot(&eye, &v) < 0.0f)
|
||||
gr_set_color(159, 20, 20);
|
||||
else
|
||||
gr_set_color(255, 32, 32);
|
||||
@@ -2029,7 +2035,7 @@ void render_compass(void)
|
||||
|
||||
v.xyz.y = 1.0f;
|
||||
v.xyz.x = v.xyz.z = 0.0f;
|
||||
if (vm_vec_dotprod(&eye, &v) < 0.0f)
|
||||
if (vm_vec_dot(&eye, &v) < 0.0f)
|
||||
gr_set_color(20, 159, 20);
|
||||
else
|
||||
gr_set_color(32, 255, 32);
|
||||
@@ -2037,7 +2043,7 @@ void render_compass(void)
|
||||
|
||||
v.xyz.z = 1.0f;
|
||||
v.xyz.x = v.xyz.y = 0.0f;
|
||||
if (vm_vec_dotprod(&eye, &v) < 0.0f)
|
||||
if (vm_vec_dot(&eye, &v) < 0.0f)
|
||||
gr_set_color(20, 20, 159);
|
||||
else
|
||||
gr_set_color(32, 32, 255);
|
||||
|
||||
@@ -230,7 +230,7 @@ void set_time_compression(float multiplier, float change_time){}
|
||||
fix game_get_overall_frametime() { return 0; }
|
||||
|
||||
//WMC
|
||||
void game_level_init(int seed){}
|
||||
void game_level_init(){}
|
||||
void game_post_level_init(){}
|
||||
camid game_render_frame_setup(){return camid();}
|
||||
void game_render_frame(camid cid){}
|
||||
|
||||
@@ -27,7 +27,6 @@
|
||||
#include "math/fvi.h" // For find_plane_line_intersection
|
||||
#include "math/vecmat.h"
|
||||
#include "io/key.h"
|
||||
#include "ai/ailocal.h"
|
||||
#include "ai/ai.h"
|
||||
#include "ai/aigoals.h"
|
||||
#include "ship/ship.h" // for ship names
|
||||
@@ -774,7 +773,7 @@ int drag_rotate_objects()
|
||||
|
||||
leader = &Objects[cur_object_index];
|
||||
leader_orient = leader->orient; // save original orientation
|
||||
vm_copy_transpose_matrix(&leader_transpose, &leader_orient);
|
||||
vm_copy_transpose(&leader_transpose, &leader_orient);
|
||||
|
||||
vm_angles_2_matrix(&rotmat, &a);
|
||||
vm_matrix_x_matrix(&newmat, &leader->orient, &rotmat);
|
||||
@@ -790,7 +789,7 @@ int drag_rotate_objects()
|
||||
|
||||
// change rotation matrix to rotate in opposite direction. This rotation
|
||||
// matrix is what the leader ship has rotated by.
|
||||
vm_copy_transpose_matrix(&rot_trans, &rotmat);
|
||||
vm_copy_transpose(&rot_trans, &rotmat);
|
||||
|
||||
// get point relative to our point of rotation (make POR the origin).
|
||||
vm_vec_sub(&tmpv1, &objp->pos, &leader->pos);
|
||||
@@ -1468,9 +1467,9 @@ void CFREDView::OnContextMenu(CWnd* /*pWnd*/, CPoint point)
|
||||
(UINT) species_submenu[i].m_hMenu, Species_info[i].species_name);
|
||||
}
|
||||
|
||||
for (i=0; i<Num_ship_classes; i++)
|
||||
species_submenu[Ship_info[i].species].AppendMenu(MF_STRING |
|
||||
MF_ENABLED, SHIP_TYPES + i, Ship_info[i].name);
|
||||
for (auto it = Ship_info.cbegin(); it != Ship_info.cend(); ++it)
|
||||
species_submenu[it->species].AppendMenu(MF_STRING |
|
||||
MF_ENABLED, SHIP_TYPES + i, it->name);
|
||||
|
||||
pPopup->AppendMenu(MF_STRING | MF_POPUP | MF_ENABLED,
|
||||
(UINT) shipPopup.m_hMenu, "New Object Type");
|
||||
@@ -1620,7 +1619,7 @@ BOOL CFREDView::OnCmdMsg(UINT nID, int nCode, void* pExtra, AFX_CMDHANDLERINFO*
|
||||
int id = (int) nID;
|
||||
|
||||
if (!pHandlerInfo) {
|
||||
if ((id >= SHIP_TYPES) && (id < SHIP_TYPES + Num_ship_classes + 3)) {
|
||||
if ((id >= SHIP_TYPES) && (id < SHIP_TYPES + static_cast<int>(Ship_info.size()) + 3)) {
|
||||
if (nCode == CN_COMMAND) {
|
||||
cur_model_index = id - SHIP_TYPES;
|
||||
m_new_ship_type_combo_box.SetCurSelNEW(cur_model_index);
|
||||
@@ -2454,7 +2453,7 @@ int CFREDView::global_error_check()
|
||||
}
|
||||
|
||||
z = Ships[i].ship_info_index;
|
||||
if ((z < 0) || (z >= Num_ship_classes)){
|
||||
if ((z < 0) || (z >= static_cast<int>(Ship_info.size()))){
|
||||
return internal_error("A ship has an illegal class");
|
||||
}
|
||||
|
||||
|
||||
+11
-10
@@ -55,7 +55,7 @@ END_MESSAGE_MAP()
|
||||
|
||||
BOOL InitialShips::OnInitDialog()
|
||||
{
|
||||
int i, j;
|
||||
int i;
|
||||
|
||||
CDialog::OnInitDialog();
|
||||
|
||||
@@ -63,12 +63,13 @@ BOOL InitialShips::OnInitDialog()
|
||||
// change the window text, get the index into the array, and check the box for either the ships
|
||||
// or weapons
|
||||
if ( m_initial_items == INITIAL_SHIPS ) {
|
||||
for ( i = 0; i < Num_ship_classes; i++ ) {
|
||||
if ( Ship_info[i].flags & SIF_PLAYER_SHIP ) {
|
||||
m_initial_list.AddString( Ship_info[i].name );
|
||||
for ( auto it = Ship_info.cbegin(); it != Ship_info.cend(); ++it ) {
|
||||
if ( it->flags & SIF_PLAYER_SHIP ) {
|
||||
i = std::distance(Ship_info.cbegin(), it);
|
||||
m_initial_list.AddString( it->name );
|
||||
if ( Campaign.ships_allowed[i] ) {
|
||||
m_initial_list.SetCheck(m_list_count, 1);
|
||||
} else if ( (strlen(Campaign.filename) == 0) && strstr(Ship_info[i].name, "Myrmidon") ) { //-V805
|
||||
} else if ( (strlen(Campaign.filename) == 0) && strstr(it->name, "Myrmidon") ) { //-V805
|
||||
m_initial_list.SetCheck(m_list_count, 1);
|
||||
} else {
|
||||
m_initial_list.SetCheck(m_list_count, 0);
|
||||
@@ -86,11 +87,11 @@ BOOL InitialShips::OnInitDialog()
|
||||
int allowed_weapons[MAX_WEAPON_TYPES];
|
||||
|
||||
memset( allowed_weapons, 0, sizeof(allowed_weapons) );
|
||||
for (i = 0; i < Num_ship_classes; i++ ) {
|
||||
if ( Ship_info[i].flags & SIF_PLAYER_SHIP ) {
|
||||
for ( j = 0; j < MAX_WEAPON_TYPES; j++ ) {
|
||||
if ( Ship_info[i].allowed_weapons[j] )
|
||||
allowed_weapons[j] = 1;
|
||||
for (auto it = Ship_info.cbegin(); it != Ship_info.cend(); ++it) {
|
||||
if ( it->flags & SIF_PLAYER_SHIP ) {
|
||||
for ( i = 0; i < MAX_WEAPON_TYPES; i++ ) {
|
||||
if ( it->allowed_weapons[i] )
|
||||
allowed_weapons[i] = 1;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -848,7 +848,7 @@ void initial_status::list_dockees(int dock_types)
|
||||
|
||||
// add "nothing"
|
||||
z = cboDockees->AddString("Nothing");
|
||||
cboDockees->SetItemData(z, -1);
|
||||
cboDockees->SetItemData(z, static_cast<DWORD_PTR>(-1));
|
||||
|
||||
// add ships
|
||||
for (object *objp = GET_FIRST(&obj_used_list); objp != END_OF_LIST(&obj_used_list); objp = GET_NEXT(objp))
|
||||
|
||||
+9
-10
@@ -344,7 +344,6 @@ void CMainFrame::OnClose()
|
||||
|
||||
void CMainFrame::init_tools()
|
||||
{
|
||||
int i;
|
||||
//int highest_terran_index;
|
||||
//char ship_name[256];
|
||||
//int ship_index;
|
||||
@@ -359,14 +358,14 @@ void CMainFrame::init_tools()
|
||||
return;
|
||||
}
|
||||
|
||||
for (i=0; i<Num_ship_classes; i++){
|
||||
for (auto it = Ship_info.cbegin(); it != Ship_info.cend(); ++it){
|
||||
// don't add the pirate ship
|
||||
if(Ship_info[i].flags & SIF_NO_FRED){
|
||||
if(it->flags & SIF_NO_FRED){
|
||||
m_new_ship_type_combo_box.AddString("");
|
||||
continue;
|
||||
}
|
||||
|
||||
m_new_ship_type_combo_box.AddString(Ship_info[i].name);
|
||||
m_new_ship_type_combo_box.AddString(it->name);
|
||||
}
|
||||
|
||||
// m_new_ship_type_combo_box.AddString("Player Start");
|
||||
@@ -407,7 +406,7 @@ void color_combo_box::DrawItem(LPDRAWITEMSTRUCT lpDrawItemStruct)
|
||||
CDC* pDC = CDC::FromHandle(lpDrawItemStruct->hDC);
|
||||
|
||||
// I think we need to do a lookup by ship name here
|
||||
if(lpDrawItemStruct->itemID >= (uint)Num_ship_classes){
|
||||
if(lpDrawItemStruct->itemID >= Ship_info.size()){
|
||||
z = lpDrawItemStruct->itemID;
|
||||
} else {
|
||||
memset(ship_name, 0, 256);
|
||||
@@ -423,7 +422,7 @@ void color_combo_box::DrawItem(LPDRAWITEMSTRUCT lpDrawItemStruct)
|
||||
COLORREF newTextColor = RGB(0x80, 0x80, 0x80); // light gray
|
||||
if (!fDisabled)
|
||||
{
|
||||
if (z >= Num_ship_classes)
|
||||
if (z >= static_cast<int>(Ship_info.size()))
|
||||
newTextColor = RGB(0, 0, 0);
|
||||
else
|
||||
{
|
||||
@@ -498,7 +497,7 @@ void color_combo_box::MeasureItem(LPMEASUREITEMSTRUCT)
|
||||
|
||||
int color_combo_box::SetCurSelNEW(int model_index)
|
||||
{
|
||||
if((model_index < 0) || (model_index >= Num_ship_classes)){
|
||||
if((model_index < 0) || (model_index >= static_cast<int>(Ship_info.size()))){
|
||||
return SetCurSel(model_index);
|
||||
}
|
||||
|
||||
@@ -513,9 +512,9 @@ int color_combo_box::GetCurSelNEW()
|
||||
char ship_name[256];
|
||||
char *hmmm = ship_name;
|
||||
|
||||
// see if we have a special item (>= Num_ship_classes)
|
||||
// see if we have a special item (>= Ship_info.size())
|
||||
cur_sel = GetCurSel();
|
||||
if(cur_sel >= Num_ship_classes){
|
||||
if(cur_sel >= static_cast<int>(Ship_info.size())){
|
||||
return cur_sel;
|
||||
}
|
||||
|
||||
@@ -525,7 +524,7 @@ int color_combo_box::GetCurSelNEW()
|
||||
return CB_ERR;
|
||||
}
|
||||
ship_info = ship_info_lookup(ship_name);
|
||||
if((ship_info < 0) || (ship_info >= Num_ship_classes)){
|
||||
if((ship_info < 0) || (ship_info >= static_cast<int>(Ship_info.size()))){
|
||||
return CB_ERR;
|
||||
}
|
||||
return ship_info;
|
||||
|
||||
@@ -15,7 +15,6 @@
|
||||
#include "FREDDoc.h"
|
||||
#include "FREDView.h"
|
||||
#include "FredRender.h"
|
||||
#include "ai/ailocal.h"
|
||||
#include "ai/aigoals.h"
|
||||
#include "ship/ship.h"
|
||||
#include "globalincs/linklist.h"
|
||||
@@ -136,6 +135,7 @@ int query_ship_name_duplicate(int ship);
|
||||
char *reg_read_string( char *section, char *name, char *default_value );
|
||||
|
||||
extern int Nmodel_num;
|
||||
extern int Nmodel_instance_num;
|
||||
extern matrix Nmodel_orient;
|
||||
extern int Nmodel_bitmap;
|
||||
|
||||
@@ -410,6 +410,7 @@ bool fred_init()
|
||||
armor_init();
|
||||
weapon_init();
|
||||
parse_medal_tbl(); // get medal names for sexpression usage
|
||||
glowpoint_init();
|
||||
ship_init();
|
||||
parse_init();
|
||||
techroom_intel_init();
|
||||
@@ -443,9 +444,9 @@ bool fred_init()
|
||||
// Get the default player ship
|
||||
Default_player_model = cur_model_index = get_default_player_ship_index();
|
||||
|
||||
Id_select_type_start = Num_ship_classes + 2;
|
||||
Id_select_type_jump_node = Num_ship_classes + 1;
|
||||
Id_select_type_waypoint = Num_ship_classes;
|
||||
Id_select_type_start = Ship_info.size() + 2;
|
||||
Id_select_type_jump_node = Ship_info.size() + 1;
|
||||
Id_select_type_waypoint = Ship_info.size();
|
||||
Fred_main_wnd -> init_tools();
|
||||
return true;
|
||||
}
|
||||
@@ -718,9 +719,9 @@ int create_object(vec3d *pos, int waypoint_instance)
|
||||
obj = create_player(Player_starts, pos, NULL, Default_player_model);
|
||||
|
||||
} else if (cur_model_index == Id_select_type_jump_node) {
|
||||
CJumpNode* jnp = new CJumpNode(pos);
|
||||
obj = jnp->GetSCPObjectNumber();
|
||||
Jump_nodes.push_back(*jnp);
|
||||
CJumpNode jnp(pos);
|
||||
obj = jnp.GetSCPObjectNumber();
|
||||
Jump_nodes.push_back(std::move(jnp));
|
||||
} else if(Ship_info[cur_model_index].flags & SIF_NO_FRED){
|
||||
obj = -1;
|
||||
} else { // creating a ship
|
||||
@@ -885,7 +886,7 @@ void clear_mission()
|
||||
// of ships for all teams
|
||||
for (i=0; i<MAX_TVT_TEAMS; i++) {
|
||||
count = 0;
|
||||
for ( j = 0; j < MAX_SHIP_CLASSES; j++ ) {
|
||||
for ( j = 0; j < static_cast<int>(Ship_info.size()); j++ ) {
|
||||
if (Ship_info[j].flags & SIF_DEFAULT_PLAYER_SHIP) {
|
||||
Team_data[i].ship_list[count] = j;
|
||||
strcpy_s(Team_data[i].ship_list_variables[count], "");
|
||||
@@ -955,6 +956,7 @@ void clear_mission()
|
||||
|
||||
Nmodel_flags = DEFAULT_NMODEL_FLAGS;
|
||||
Nmodel_num = -1;
|
||||
Nmodel_instance_num = -1;
|
||||
vm_set_identity(&Nmodel_orient);
|
||||
Nmodel_bitmap = -1;
|
||||
|
||||
|
||||
@@ -297,6 +297,8 @@ int CMessageEditorDlg::find_event()
|
||||
|
||||
for (i=0; i<Num_mission_events; i++) {
|
||||
node = Mission_events[i].formula;
|
||||
Assertion(node >= 0, "Can't have a formula point to sexp node -1!");
|
||||
|
||||
if ( get_operator_const(CTEXT(node)) == OP_WHEN || get_operator_const(CTEXT(node)) == OP_EVERY_TIME
|
||||
|| get_operator_const(CTEXT(node)) == OP_WHEN_ARGUMENT || get_operator_const(CTEXT(node)) == OP_EVERY_TIME_ARGUMENT
|
||||
|| get_operator_const(CTEXT(node)) == OP_IF_THEN_ELSE || get_operator_const(CTEXT(node)) == OP_PERFORM_ACTIONS )
|
||||
|
||||
+135
-138
@@ -96,30 +96,20 @@ void CFred_mission_save::convert_special_tags_to_retail()
|
||||
}
|
||||
}
|
||||
|
||||
int CFred_mission_save::save_mission_file(char *pathname)
|
||||
void CFred_mission_save::save_mission_internal(const char *pathname)
|
||||
{
|
||||
char backup_name[256], savepath[MAX_PATH_LEN], *p;
|
||||
CTime t;
|
||||
|
||||
t = CTime::GetCurrentTime();
|
||||
strcpy_s(The_mission.modified, t.Format("%x at %X"));
|
||||
|
||||
strcpy_s(savepath, "");
|
||||
p = strrchr(pathname, '\\');
|
||||
if ( p ) {
|
||||
*p = '\0';
|
||||
strcpy_s(savepath, pathname);
|
||||
*p = '\\';
|
||||
strcat_s(savepath, "\\");
|
||||
}
|
||||
strcat_s(savepath, "saving.xxx");
|
||||
|
||||
reset_parse();
|
||||
fred_parse_flag = 0;
|
||||
fp = cfopen(savepath, "wt", CFILE_NORMAL);
|
||||
fp = cfopen(pathname, "wt", CFILE_NORMAL, CF_TYPE_MISSIONS);
|
||||
if (!fp) {
|
||||
nprintf(("Error", "Can't open mission file to save.\n"));
|
||||
return -1;
|
||||
err = -1;
|
||||
return;
|
||||
}
|
||||
|
||||
// Goober5000
|
||||
@@ -174,10 +164,27 @@ int CFred_mission_save::save_mission_file(char *pathname)
|
||||
}
|
||||
|
||||
cfclose(fp);
|
||||
if (err) {
|
||||
if (err)
|
||||
mprintf(("Mission saving error code #%d\n", err));
|
||||
}
|
||||
|
||||
} else {
|
||||
int CFred_mission_save::save_mission_file(char *pathname)
|
||||
{
|
||||
char backup_name[256], savepath[MAX_PATH_LEN], *p;
|
||||
|
||||
strcpy_s(savepath, "");
|
||||
p = strrchr(pathname, '\\');
|
||||
if ( p ) {
|
||||
*p = '\0';
|
||||
strcpy_s(savepath, pathname);
|
||||
*p = '\\';
|
||||
strcat_s(savepath, "\\");
|
||||
}
|
||||
strcat_s(savepath, "saving.xxx");
|
||||
|
||||
save_mission_internal(savepath);
|
||||
|
||||
if (!err) {
|
||||
strcpy_s(backup_name, pathname);
|
||||
if (backup_name[strlen(backup_name) - 4] == '.')
|
||||
backup_name[strlen(backup_name) - 4] = 0;
|
||||
@@ -196,10 +203,6 @@ int CFred_mission_save::autosave_mission_file(char *pathname)
|
||||
{
|
||||
char backup_name[256], name2[256];
|
||||
int i, len;
|
||||
CTime t;
|
||||
|
||||
t = CTime::GetCurrentTime();
|
||||
strcpy_s(The_mission.modified, t.Format("%x at %X"));
|
||||
|
||||
len = strlen(pathname);
|
||||
strcpy_s(backup_name, pathname);
|
||||
@@ -213,68 +216,8 @@ int CFred_mission_save::autosave_mission_file(char *pathname)
|
||||
}
|
||||
|
||||
strcpy(backup_name + len, ".001");
|
||||
reset_parse();
|
||||
fred_parse_flag = 0;
|
||||
fp = cfopen(backup_name, "wt", CFILE_NORMAL, CF_TYPE_MISSIONS);
|
||||
if (!fp) {
|
||||
nprintf(("Error", "Can't open mission file to save.\n"));
|
||||
return -1;
|
||||
}
|
||||
|
||||
// Goober5000
|
||||
convert_special_tags_to_retail();
|
||||
|
||||
if (save_mission_info())
|
||||
err = -2;
|
||||
else if (save_plot_info())
|
||||
err = -3;
|
||||
else if (save_variables())
|
||||
err = -3;
|
||||
// else if (save_briefing_info())
|
||||
// err = -4;
|
||||
else if (save_fiction())
|
||||
err = -3;
|
||||
else if (save_cutscenes())
|
||||
err = -4;
|
||||
else if (save_cmd_briefs())
|
||||
err = -4;
|
||||
else if (save_briefing())
|
||||
err = -4;
|
||||
else if (save_debriefing())
|
||||
err = -5;
|
||||
else if (save_players())
|
||||
err = -6;
|
||||
else if (save_objects())
|
||||
err = -7;
|
||||
else if (save_wings())
|
||||
err = -8;
|
||||
else if (save_events())
|
||||
err = -9;
|
||||
else if (save_goals())
|
||||
err = -10;
|
||||
else if (save_waypoints())
|
||||
err = -11;
|
||||
else if (save_messages())
|
||||
err = -12;
|
||||
else if (save_reinforcements())
|
||||
err = -13;
|
||||
else if (save_bitmaps())
|
||||
err = -14;
|
||||
else if (save_asteroid_fields())
|
||||
err = -15;
|
||||
else if (save_music())
|
||||
err = -16;
|
||||
else {
|
||||
required_string_fred("#End");
|
||||
parse_comments(2);
|
||||
token_found = NULL;
|
||||
parse_comments();
|
||||
fout("\n");
|
||||
}
|
||||
|
||||
cfclose(fp);
|
||||
if (err)
|
||||
mprintf(("Mission saving error code #%d\n", err));
|
||||
save_mission_internal(backup_name);
|
||||
|
||||
return err;
|
||||
}
|
||||
@@ -535,19 +478,7 @@ int CFred_mission_save::save_mission_info()
|
||||
}
|
||||
}
|
||||
|
||||
// Phreak's loading screen stuff
|
||||
if (Format_fs2_open != FSO_FORMAT_RETAIL) //-V581
|
||||
{
|
||||
if (strlen(The_mission.loading_screen[GR_640]) > 0) //-V805
|
||||
{
|
||||
fout("\n\n$Load Screen 640:\t%s",The_mission.loading_screen[GR_640]);
|
||||
}
|
||||
|
||||
if (strlen(The_mission.loading_screen[GR_1024]) > 0) //-V805
|
||||
{
|
||||
fout("\n$Load Screen 1024:\t%s",The_mission.loading_screen[GR_1024]);
|
||||
}
|
||||
}
|
||||
save_custom_bitmap("$Load Screen 640:", "$Load Screen 1024:", The_mission.loading_screen[GR_640], The_mission.loading_screen[GR_1024], 1);
|
||||
|
||||
// Phreak's skybox stuff
|
||||
if (strlen(The_mission.skybox_model) > 0) //-V805
|
||||
@@ -773,40 +704,74 @@ int CFred_mission_save::save_fiction()
|
||||
if (Format_fs2_open != FSO_FORMAT_RETAIL)
|
||||
{
|
||||
if (optional_string_fred("#Fiction Viewer"))
|
||||
parse_comments();
|
||||
parse_comments(2);
|
||||
else
|
||||
fout("\n\n#Fiction Viewer");
|
||||
|
||||
fout("\n");
|
||||
|
||||
// save file
|
||||
required_string_fred("$File:");
|
||||
parse_comments();
|
||||
fout(" %s", fiction_file());
|
||||
|
||||
// save font
|
||||
if (strlen(fiction_font()) > 0) //-V805
|
||||
// we have multiple stages now, so save them all
|
||||
for (SCP_vector<fiction_viewer_stage>::iterator stage = Fiction_viewer_stages.begin(); stage != Fiction_viewer_stages.end(); ++stage)
|
||||
{
|
||||
if (optional_string_fred("$Font:"))
|
||||
parse_comments();
|
||||
else
|
||||
fout("\n$Font:");
|
||||
fout(" %s", fiction_font());
|
||||
}
|
||||
else
|
||||
optional_string_fred("$Font:");
|
||||
fout("\n");
|
||||
|
||||
// save voice
|
||||
if (strlen(fiction_voice()) > 0) //-V805
|
||||
{
|
||||
if (optional_string_fred("$Voice:"))
|
||||
parse_comments();
|
||||
// save file
|
||||
required_string_fred("$File:");
|
||||
parse_comments();
|
||||
fout(" %s", stage->story_filename);
|
||||
|
||||
// save font
|
||||
if (strlen(stage->font_filename) > 0) //-V805
|
||||
{
|
||||
if (optional_string_fred("$Font:"))
|
||||
parse_comments();
|
||||
else
|
||||
fout("\n$Font:");
|
||||
fout(" %s", stage->font_filename);
|
||||
}
|
||||
else
|
||||
fout("\n$Voice:");
|
||||
fout(" %s", fiction_voice());
|
||||
optional_string_fred("$Font:");
|
||||
|
||||
// save voice
|
||||
if (strlen(stage->voice_filename) > 0) //-V805
|
||||
{
|
||||
if (optional_string_fred("$Voice:"))
|
||||
parse_comments();
|
||||
else
|
||||
fout("\n$Voice:");
|
||||
fout(" %s", stage->voice_filename);
|
||||
}
|
||||
else
|
||||
optional_string_fred("$Voice:");
|
||||
|
||||
// save UI
|
||||
if (strlen(stage->ui_name) > 0)
|
||||
{
|
||||
if (optional_string_fred("$UI:"))
|
||||
parse_comments();
|
||||
else
|
||||
fout("\n$UI:");
|
||||
fout(" %s", stage->ui_name);
|
||||
}
|
||||
else
|
||||
optional_string_fred("$UI:");
|
||||
|
||||
// save background
|
||||
save_custom_bitmap("$Background 640:", "$Background 1024:", stage->background[GR_640], stage->background[GR_1024]);
|
||||
|
||||
// save sexp formula if we have one
|
||||
if (stage->formula >= 0 && stage->formula != Locked_sexp_true)
|
||||
{
|
||||
SCP_string sexp_out;
|
||||
convert_sexp_to_string(sexp_out, stage->formula, SEXP_SAVE_MODE);
|
||||
|
||||
if (optional_string_fred("$Formula:"))
|
||||
parse_comments();
|
||||
else
|
||||
fout("\n$Formula:");
|
||||
fout(" %s", sexp_out.c_str());
|
||||
}
|
||||
else
|
||||
optional_string_fred("$Formula:");
|
||||
}
|
||||
else
|
||||
optional_string_fred("$Voice:");
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -830,6 +795,8 @@ int CFred_mission_save::save_cmd_brief()
|
||||
if (The_mission.game_type & MISSION_TYPE_MULTI)
|
||||
return err; // no command briefings allowed in multiplayer missions.
|
||||
|
||||
save_custom_bitmap("$Background 640:", "$Background 1024:", Cur_cmd_brief->background[GR_640], Cur_cmd_brief->background[GR_1024], 1);
|
||||
|
||||
for (stage=0; stage<Cur_cmd_brief->num_stages; stage++) {
|
||||
required_string_fred("$Stage Text:");
|
||||
parse_comments(2);
|
||||
@@ -883,6 +850,10 @@ int CFred_mission_save::save_briefing()
|
||||
required_string_fred("$start_briefing");
|
||||
parse_comments();
|
||||
|
||||
save_custom_bitmap("$briefing_background_640:", "$briefing_background_1024:", Briefings[nb].background[GR_640], Briefings[nb].background[GR_1024]);
|
||||
save_custom_bitmap("$ship_select_background_640:", "$ship_select_background_1024:", Briefings[nb].ship_select_background[GR_640], Briefings[nb].ship_select_background[GR_1024]);
|
||||
save_custom_bitmap("$weapon_select_background_640:", "$weapon_select_background_1024:", Briefings[nb].weapon_select_background[GR_640], Briefings[nb].weapon_select_background[GR_1024]);
|
||||
|
||||
Assert(Briefings[nb].num_stages <= MAX_BRIEF_STAGES);
|
||||
required_string_fred("$num_stages:");
|
||||
parse_comments();
|
||||
@@ -1055,6 +1026,8 @@ int CFred_mission_save::save_debriefing()
|
||||
required_string_fred("#Debriefing_info");
|
||||
parse_comments(2);
|
||||
|
||||
save_custom_bitmap("$Background 640:", "$Background 1024:", Debriefing->background[GR_640], Debriefing->background[GR_1024], 1);
|
||||
|
||||
required_string_fred("$Num stages:");
|
||||
parse_comments(2);
|
||||
fout(" %d", Debriefing->num_stages);
|
||||
@@ -1751,6 +1724,8 @@ int CFred_mission_save::save_objects()
|
||||
fout(" \"scramble-messages\"");
|
||||
if (!(objp->flags & OF_COLLIDES))
|
||||
fout(" \"no-collide\"");
|
||||
if (shipp->flags2 & SF2_NO_DISABLED_SELF_DESTRUCT)
|
||||
fout(" \"no-disabled-self-destruct\"");
|
||||
fout(" )");
|
||||
}
|
||||
// -----------------------------------------------------------
|
||||
@@ -2849,6 +2824,11 @@ void CFred_mission_save::parse_comments(int newlines)
|
||||
}
|
||||
|
||||
while (*raw_ptr != EOF_CHAR) {
|
||||
// state values (as far as I could figure out):
|
||||
// 0 - raw_ptr not inside comment
|
||||
// 1 - raw_ptr inside /**/ comment
|
||||
// 2 - raw_ptr inside ; (newline-delimited) comment
|
||||
// 3,4 - raw_ptr inside ;; (FSO version) comment
|
||||
if (!state) {
|
||||
if (token_found && (*raw_ptr == *token_found))
|
||||
if (!strnicmp(raw_ptr, token_found, strlen(token_found))) {
|
||||
@@ -2903,11 +2883,6 @@ void CFred_mission_save::parse_comments(int newlines)
|
||||
}
|
||||
}
|
||||
|
||||
if ((*raw_ptr == '/') && (raw_ptr[1] == '/')) {
|
||||
comment_start = raw_ptr;
|
||||
state = 2;
|
||||
}
|
||||
|
||||
if (*raw_ptr == '\n')
|
||||
flag = 1;
|
||||
|
||||
@@ -2951,22 +2926,22 @@ void CFred_mission_save::parse_comments(int newlines)
|
||||
if (first_comment && !flag)
|
||||
fout("\t\t");
|
||||
|
||||
state = raw_ptr[2];
|
||||
const char tmp = raw_ptr[2];
|
||||
raw_ptr[2] = 0;
|
||||
fout("%s", comment_start);
|
||||
raw_ptr[2] = (char)state;
|
||||
raw_ptr[2] = tmp;
|
||||
state = first_comment = flag = 0;
|
||||
}
|
||||
|
||||
if ( (*raw_ptr == ';') && (raw_ptr[1] == ';') && (state == 3) ) {
|
||||
state = raw_ptr[2];
|
||||
const char tmp = raw_ptr[2];
|
||||
raw_ptr[2] = 0;
|
||||
if (version_added)
|
||||
fso_comment_pop();
|
||||
else
|
||||
version_added = true;
|
||||
fso_comment_push(comment_start);
|
||||
raw_ptr[2] = (char)state;
|
||||
raw_ptr[2] = tmp;
|
||||
state = first_comment = flag = 0;
|
||||
raw_ptr++;
|
||||
}
|
||||
@@ -3002,7 +2977,7 @@ int CFred_mission_save::fout_version(char *format, ...)
|
||||
str_scp.append(fso_ver_comment.back().c_str());
|
||||
str_scp.append(" ");
|
||||
|
||||
cfputs(const_cast<char*>(str_scp.c_str()), fp);
|
||||
cfputs(str_scp.c_str(), fp);
|
||||
|
||||
str_scp = "";
|
||||
}
|
||||
@@ -3029,7 +3004,7 @@ int CFred_mission_save::fout_version(char *format, ...)
|
||||
if (first_line) {
|
||||
first_line = false;
|
||||
} else {
|
||||
cfputs(const_cast<char*>(fso_ver_comment.back().c_str()), fp);
|
||||
cfputs(fso_ver_comment.back().c_str(), fp);
|
||||
cfputs(" ", fp);
|
||||
}
|
||||
|
||||
@@ -3041,7 +3016,7 @@ int CFred_mission_save::fout_version(char *format, ...)
|
||||
if (first_line) {
|
||||
first_line = false;
|
||||
} else {
|
||||
cfputs(const_cast<char*>(fso_ver_comment.back().c_str()), fp);
|
||||
cfputs(fso_ver_comment.back().c_str(), fp);
|
||||
cfputs(" ", fp);
|
||||
}
|
||||
|
||||
@@ -3055,7 +3030,7 @@ int CFred_mission_save::fout_version(char *format, ...)
|
||||
|
||||
// be sure to account for any ending elements too
|
||||
if ( strlen(str_p) ) {
|
||||
cfputs(const_cast<char*>(fso_ver_comment.back().c_str()), fp);
|
||||
cfputs(fso_ver_comment.back().c_str(), fp);
|
||||
cfputs(" ", fp);
|
||||
cfputs(str_p, fp);
|
||||
}
|
||||
@@ -3084,7 +3059,7 @@ int CFred_mission_save::fout(char *format, ...)
|
||||
vsprintf(str, format, args);
|
||||
va_end(args);
|
||||
|
||||
cfputs(const_cast<char*>(str.c_str()), fp);
|
||||
cfputs(str.c_str(), fp);
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -3149,7 +3124,7 @@ int CFred_mission_save::fout_ext(char *pre_str, char *format, ...)
|
||||
if (first_line) {
|
||||
first_line = false;
|
||||
} else {
|
||||
cfputs(const_cast<char*>(fso_ver_comment.back().c_str()), fp);
|
||||
cfputs(fso_ver_comment.back().c_str(), fp);
|
||||
cfputs(" ", fp);
|
||||
}
|
||||
|
||||
@@ -3161,7 +3136,7 @@ int CFred_mission_save::fout_ext(char *pre_str, char *format, ...)
|
||||
if (first_line) {
|
||||
first_line = false;
|
||||
} else {
|
||||
cfputs(const_cast<char*>(fso_ver_comment.back().c_str()), fp);
|
||||
cfputs(fso_ver_comment.back().c_str(), fp);
|
||||
cfputs(" ", fp);
|
||||
}
|
||||
|
||||
@@ -3175,7 +3150,7 @@ int CFred_mission_save::fout_ext(char *pre_str, char *format, ...)
|
||||
|
||||
// be sure to account for any ending elements too
|
||||
if ( strlen(str_p) ) {
|
||||
cfputs(const_cast<char*>(fso_ver_comment.back().c_str()), fp);
|
||||
cfputs(fso_ver_comment.back().c_str(), fp);
|
||||
cfputs(" ", fp);
|
||||
cfputs(str_p, fp);
|
||||
}
|
||||
@@ -3883,6 +3858,28 @@ int CFred_mission_save::save_music()
|
||||
return err;
|
||||
}
|
||||
|
||||
void CFred_mission_save::save_custom_bitmap(const char *expected_string_640, const char *expected_string_1024, const char *string_field_640, const char *string_field_1024, int blank_lines)
|
||||
{
|
||||
if (Format_fs2_open != FSO_FORMAT_RETAIL)
|
||||
{
|
||||
if ((*string_field_640 != '\0') || (*string_field_1024 != '\0'))
|
||||
{
|
||||
while (blank_lines-- > 0)
|
||||
fout("\n");
|
||||
}
|
||||
|
||||
if (*string_field_640 != '\0')
|
||||
{
|
||||
fout("\n%s %s", expected_string_640, string_field_640);
|
||||
}
|
||||
|
||||
if (*string_field_1024 != '\0')
|
||||
{
|
||||
fout("\n%s %s", expected_string_1024, string_field_1024);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void CFred_mission_save::save_turret_info(ship_subsys *ptr, int ship)
|
||||
{
|
||||
int i, z;
|
||||
|
||||
@@ -15,7 +15,6 @@
|
||||
#include <stdio.h>
|
||||
#include "mission/missionparse.h"
|
||||
#include "parse/parselo.h"
|
||||
#include "ai/ailocal.h"
|
||||
#include "ai/ai.h"
|
||||
#include "cfile/cfile.h"
|
||||
#include "ship/ship.h"
|
||||
@@ -57,11 +56,15 @@ private:
|
||||
int save_music();
|
||||
void save_campaign_sexp(int node, int link);
|
||||
void save_single_dock_instance(ship *shipp, dock_instance *dock_ptr);
|
||||
|
||||
void save_custom_bitmap(const char *expected_string_640, const char *expected_string_1024, const char *string_field_640, const char *string_field_1024, int blank_lines = 0);
|
||||
|
||||
void convert_special_tags_to_retail(char *text, int max_len);
|
||||
void convert_special_tags_to_retail(SCP_string &text);
|
||||
void convert_special_tags_to_retail();
|
||||
|
||||
void save_mission_internal(const char *pathname);
|
||||
|
||||
public:
|
||||
void save_turret_info(ship_subsys *ptr, int ship);
|
||||
int save_bitmaps();
|
||||
|
||||
@@ -283,9 +283,10 @@ void player_start_editor::reset_controls()
|
||||
// create a checklistbox for each "player" ship type
|
||||
m_ship_list.ResetContent();
|
||||
ct = 0;
|
||||
for (i=0; i<Num_ship_classes; i++) {
|
||||
if (Ship_info[i].flags & SIF_PLAYER_SHIP) {
|
||||
m_ship_list.AddString(Ship_info[i].name);
|
||||
for (auto it = Ship_info.cbegin(); it != Ship_info.cend(); ++it) {
|
||||
if (it->flags & SIF_PLAYER_SHIP) {
|
||||
i = std::distance(Ship_info.cbegin(), it);
|
||||
m_ship_list.AddString(it->name);
|
||||
|
||||
// if the ship currently has pool entries or was set by a variable, check it
|
||||
if((static_ship_pool[selected_team][i] > 0) || (static_ship_variable_pool[selected_team][i] != -1)) {
|
||||
@@ -808,7 +809,7 @@ void player_start_editor::OnOK()
|
||||
|
||||
// Now we deal with the loadout ships that are statically assigned by class
|
||||
|
||||
for(idx=0; idx<Num_ship_classes; idx++) {
|
||||
for (idx = 0; idx < static_cast<int>(Ship_info.size()); idx++) {
|
||||
// if we have ships here
|
||||
if(static_ship_pool[i][idx] > 0 || static_ship_variable_pool[i][idx] > -1) {
|
||||
Team_data[i].ship_list[num_choices] = idx;
|
||||
|
||||
@@ -1180,6 +1180,7 @@
|
||||
#define IDC_MISSION_LOG_1ST_TRIGGER 1641
|
||||
#define IDC_MISSION_LOG_LAST_TRIGGER 1642
|
||||
#define IDC_NO_COLLIDE 1643
|
||||
#define IDC_NO_DISABLED_SELF_DESTRUCT 1644
|
||||
#define ID_FILE_MISSIONNOTES 32771
|
||||
#define ID_DUPLICATE 32774
|
||||
#define ID_VIEW_ROTATE 32775
|
||||
|
||||
Regular → Executable
+8
-11
@@ -2797,7 +2797,7 @@ int sexp_tree::query_default_argument_available(int op, int i)
|
||||
return (sexp_variable_count() > 0) ? 1 : 0;
|
||||
|
||||
case OPF_SSM_CLASS:
|
||||
return (Ssm_info_count > 0) ? 1 : 0;
|
||||
return (Ssm_info.size() > 0) ? 1 : 0;
|
||||
|
||||
case OPF_MISSION_MOOD:
|
||||
return Builtin_moods.empty() ? 0 : 1;
|
||||
@@ -5040,16 +5040,15 @@ sexp_list_item *sexp_tree::get_listing_opf_ai_class()
|
||||
|
||||
sexp_list_item *sexp_tree::get_listing_opf_support_ship_class()
|
||||
{
|
||||
int i;
|
||||
sexp_list_item head;
|
||||
|
||||
head.add_data("<species support ship class>");
|
||||
|
||||
for (i=0; i<Num_ship_classes; i++)
|
||||
for (auto it = Ship_info.cbegin(); it != Ship_info.cend(); ++it)
|
||||
{
|
||||
if (Ship_info[i].flags & SIF_SUPPORT)
|
||||
if (it->flags & SIF_SUPPORT)
|
||||
{
|
||||
head.add_data(Ship_info[i].name);
|
||||
head.add_data(it->name);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -5058,12 +5057,11 @@ sexp_list_item *sexp_tree::get_listing_opf_support_ship_class()
|
||||
|
||||
sexp_list_item *sexp_tree::get_listing_opf_ssm_class()
|
||||
{
|
||||
int i;
|
||||
sexp_list_item head;
|
||||
|
||||
for (i=0; i<Ssm_info_count; i++)
|
||||
for (auto it = Ssm_info.cbegin(); it != Ssm_info.cend(); ++it)
|
||||
{
|
||||
head.add_data(Ssm_info[i].name);
|
||||
head.add_data(it->name);
|
||||
}
|
||||
|
||||
return head.next;
|
||||
@@ -5698,11 +5696,10 @@ sexp_list_item *sexp_tree::get_listing_opf_intel_name()
|
||||
|
||||
sexp_list_item *sexp_tree::get_listing_opf_ship_class_name()
|
||||
{
|
||||
int i;
|
||||
sexp_list_item head;
|
||||
|
||||
for (i=0; i<Num_ship_classes; i++)
|
||||
head.add_data(Ship_info[i].name);
|
||||
for (auto it = Ship_info.cbegin(); it != Ship_info.cend(); ++it)
|
||||
head.add_data(it->name);
|
||||
|
||||
return head.next;
|
||||
}
|
||||
|
||||
@@ -87,8 +87,8 @@ BOOL shield_sys_dlg::OnInitDialog()
|
||||
|
||||
box = (CComboBox *) GetDlgItem(IDC_TYPE);
|
||||
box->ResetContent();
|
||||
for (i=0; i<Num_ship_classes; i++)
|
||||
box->AddString(Ship_info[i].name);
|
||||
for (auto it = Ship_info.cbegin(); it != Ship_info.cend(); ++it)
|
||||
box->AddString(it->name);
|
||||
|
||||
box = (CComboBox *) GetDlgItem(IDC_TEAM);
|
||||
box->ResetContent();
|
||||
|
||||
@@ -17,7 +17,6 @@
|
||||
#include "render/3d.h"
|
||||
#include "physics/physics.h"
|
||||
#include "editor.h"
|
||||
#include "ai/ailocal.h"
|
||||
#include "ai/aigoals.h"
|
||||
#include "parse/parselo.h"
|
||||
#include "Management.h"
|
||||
@@ -264,8 +263,8 @@ BOOL CShipEditorDlg::Create()
|
||||
|
||||
ptr = (CComboBox *) GetDlgItem(IDC_SHIP_CLASS);
|
||||
ptr->ResetContent();
|
||||
for (i=0; i<Num_ship_classes; i++){
|
||||
ptr->AddString(Ship_info[i].name);
|
||||
for (auto it = Ship_info.cbegin(); it != Ship_info.end(); ++it){
|
||||
ptr->AddString(it->name);
|
||||
}
|
||||
|
||||
ptr = (CComboBox *) GetDlgItem(IDC_AI_CLASS);
|
||||
@@ -587,7 +586,7 @@ void CShipEditorDlg::initialize_data(int full_update)
|
||||
m_score.init(Ships[i].score);
|
||||
m_assist_score.init((int)(Ships[i].assist_score_pct*100));
|
||||
|
||||
m_persona = Ships[i].persona_index + 1;
|
||||
m_persona = Ships[i].persona_index;
|
||||
|
||||
// we use final_death_time member of ship structure for holding the amount of time before a mission
|
||||
// to destroy this ship
|
||||
@@ -625,8 +624,8 @@ void CShipEditorDlg::initialize_data(int full_update)
|
||||
m_hotkey = -1;
|
||||
}
|
||||
|
||||
if ( Ships[i].persona_index != (m_persona-1) ){
|
||||
m_persona = -1;
|
||||
if ( Ships[i].persona_index != m_persona ){
|
||||
m_persona = -2;
|
||||
}
|
||||
|
||||
if (Ships[i].wingnum != wing){
|
||||
@@ -678,6 +677,16 @@ void CShipEditorDlg::initialize_data(int full_update)
|
||||
}
|
||||
}
|
||||
|
||||
m_persona++;
|
||||
if (m_persona > 0) {
|
||||
int persona_index = 0;
|
||||
for (int i = 0; i < m_persona; i++) {
|
||||
if (Personas[i].flags & PERSONA_FLAG_WINGMAN)
|
||||
persona_index++;
|
||||
}
|
||||
m_persona = persona_index;
|
||||
}
|
||||
|
||||
} else { // no ships selected, 0 or more player ships selected
|
||||
if (player_count > 1) { // multiple player ships selected
|
||||
Assert(base_player >= 0);
|
||||
|
||||
+48
-18
@@ -74,9 +74,10 @@ void ship_flags_dlg::DoDataExchange(CDataExchange* pDX)
|
||||
DDX_Control(pDX, IDC_HIDE_SHIP_NAME, m_hide_ship_name);
|
||||
DDX_Control(pDX, IDC_DISABLE_ETS, m_disable_ets);
|
||||
DDX_Control(pDX, IDC_CLOAKED, m_cloaked);
|
||||
DDX_Control(pDX, IDC_NO_COLLIDE, m_no_collide);
|
||||
DDX_Control(pDX, IDC_SET_CLASS_DYNAMICALLY, m_set_class_dynamically);
|
||||
DDX_Control(pDX, IDC_SCRAMBLE_MESSAGES, m_scramble_messages);
|
||||
DDX_Control(pDX, IDC_NO_COLLIDE, m_no_collide);
|
||||
DDX_Control(pDX, IDC_NO_DISABLED_SELF_DESTRUCT, m_no_disabled_self_destruct);
|
||||
//}}AFX_DATA_MAP
|
||||
|
||||
if (pDX->m_bSaveAndValidate) { // get dialog control values
|
||||
@@ -142,6 +143,7 @@ BEGIN_MESSAGE_MAP(ship_flags_dlg, CDialog)
|
||||
ON_BN_CLICKED(IDC_CLOAKED, OnCloaked)
|
||||
ON_BN_CLICKED(IDC_SCRAMBLE_MESSAGES, OnScrambleMessages)
|
||||
ON_BN_CLICKED(IDC_NO_COLLIDE, OnNoCollide)
|
||||
ON_BN_CLICKED(IDC_NO_DISABLED_SELF_DESTRUCT, OnNoDisabledSelfDestruct)
|
||||
//}}AFX_MSG_MAP
|
||||
END_MESSAGE_MAP()
|
||||
|
||||
@@ -162,7 +164,7 @@ BOOL ship_flags_dlg::OnInitDialog()
|
||||
int hidden_from_sensors = 0, primitive_sensors = 0, no_subspace_drive = 0, affected_by_gravity = 0;
|
||||
int toggle_subsystem_scanning = 0, scannable = 0, kamikaze = 0, no_dynamic = 0, red_alert_carry = 0;
|
||||
int special_warpin = 0, disable_messages = 0, guardian = 0, vaporize = 0, stealth = 0, friendly_stealth_invisible = 0;
|
||||
int no_death_scream = 0, always_death_scream = 0, scramble_messages = 0;
|
||||
int no_death_scream = 0, always_death_scream = 0, scramble_messages = 0, no_disabled_self_destruct = 0;
|
||||
int nav_carry = 0, nav_needslink = 0, hide_ship_name = 0, set_class_dynamically = 0, no_ets = 0, cloaked = 0, no_collide = 0;
|
||||
|
||||
object *objp;
|
||||
@@ -213,6 +215,7 @@ BOOL ship_flags_dlg::OnInitDialog()
|
||||
cloaked = (shipp->flags2 & SF2_CLOAKED) ? 1 : 0;
|
||||
scramble_messages = (shipp->flags2 & SF2_SCRAMBLE_MESSAGES) ? 1 : 0;
|
||||
no_collide = (objp->flags & OF_COLLIDES) ? 0 : 1;
|
||||
no_disabled_self_destruct = (shipp->flags2 & SF2_NO_DISABLED_SELF_DESTRUCT) ? 1 : 0;
|
||||
|
||||
destroy_before_mission = (shipp->flags & SF_KILL_BEFORE_MISSION) ? 1 : 0;
|
||||
m_destroy_value.init(shipp->final_death_time);
|
||||
@@ -274,6 +277,7 @@ BOOL ship_flags_dlg::OnInitDialog()
|
||||
cloaked = tristate_set(shipp->flags2 & SF2_CLOAKED, cloaked);
|
||||
scramble_messages = tristate_set(shipp->flags2 & SF2_SCRAMBLE_MESSAGES, scramble_messages);
|
||||
no_collide = tristate_set(!(objp->flags & OF_COLLIDES), no_collide);
|
||||
no_disabled_self_destruct = tristate_set(shipp->flags2 & SF2_NO_DISABLED_SELF_DESTRUCT, no_disabled_self_destruct);
|
||||
|
||||
// check the final death time and set the internal variable according to whether or not
|
||||
// the final_death_time is set. Also, the value in the edit box must be set if all the
|
||||
@@ -349,6 +353,7 @@ BOOL ship_flags_dlg::OnInitDialog()
|
||||
m_cloaked.SetCheck(cloaked);
|
||||
m_scramble_messages.SetCheck(scramble_messages);
|
||||
m_no_collide.SetCheck(no_collide);
|
||||
m_no_disabled_self_destruct.SetCheck(no_disabled_self_destruct);
|
||||
|
||||
m_kdamage.setup(IDC_KDAMAGE, this);
|
||||
m_destroy_value.setup(IDC_DESTROY_VALUE, this);
|
||||
@@ -966,22 +971,6 @@ void ship_flags_dlg::update_ship(int shipnum)
|
||||
break;
|
||||
}
|
||||
|
||||
switch (m_no_collide.GetCheck()) {
|
||||
case 1:
|
||||
if ( objp->flags & OF_COLLIDES )
|
||||
set_modified();
|
||||
|
||||
objp->flags &= ~OF_COLLIDES;
|
||||
break;
|
||||
|
||||
case 0:
|
||||
if (!(objp->flags & OF_COLLIDES))
|
||||
set_modified();
|
||||
|
||||
objp->flags |= OF_COLLIDES;
|
||||
break;
|
||||
}
|
||||
|
||||
switch (m_guardian.GetCheck()) {
|
||||
case 1:
|
||||
if ( !(shipp->ship_guardian_threshold) )
|
||||
@@ -1062,6 +1051,38 @@ void ship_flags_dlg::update_ship(int shipnum)
|
||||
break;
|
||||
}
|
||||
|
||||
switch (m_no_collide.GetCheck()) {
|
||||
case 1:
|
||||
if (objp->flags & OF_COLLIDES)
|
||||
set_modified();
|
||||
|
||||
objp->flags &= ~OF_COLLIDES;
|
||||
break;
|
||||
|
||||
case 0:
|
||||
if (!(objp->flags & OF_COLLIDES))
|
||||
set_modified();
|
||||
|
||||
objp->flags |= OF_COLLIDES;
|
||||
break;
|
||||
}
|
||||
|
||||
switch (m_no_disabled_self_destruct.GetCheck()) {
|
||||
case 1:
|
||||
if (!(shipp->flags2 & SF2_NO_DISABLED_SELF_DESTRUCT))
|
||||
set_modified();
|
||||
|
||||
shipp->flags2 |= SF2_NO_DISABLED_SELF_DESTRUCT;
|
||||
break;
|
||||
|
||||
case 0:
|
||||
if (shipp->flags2 & SF2_NO_DISABLED_SELF_DESTRUCT)
|
||||
set_modified();
|
||||
|
||||
shipp->flags2 &= ~SF2_NO_DISABLED_SELF_DESTRUCT;
|
||||
break;
|
||||
}
|
||||
|
||||
|
||||
shipp->respawn_priority = 0;
|
||||
if(The_mission.game_type & MISSION_TYPE_MULTI) {
|
||||
@@ -1440,3 +1461,12 @@ void ship_flags_dlg::OnNoCollide()
|
||||
m_no_collide.SetCheck(1);
|
||||
}
|
||||
}
|
||||
|
||||
void ship_flags_dlg::OnNoDisabledSelfDestruct()
|
||||
{
|
||||
if (m_no_disabled_self_destruct.GetCheck() == 1) {
|
||||
m_no_disabled_self_destruct.SetCheck(0);
|
||||
} else {
|
||||
m_no_disabled_self_destruct.SetCheck(1);
|
||||
}
|
||||
}
|
||||
@@ -65,9 +65,10 @@ public:
|
||||
CButton m_hide_ship_name;
|
||||
CButton m_disable_ets;
|
||||
CButton m_cloaked;
|
||||
CButton m_no_collide;
|
||||
CButton m_set_class_dynamically;
|
||||
CButton m_scramble_messages;
|
||||
CButton m_no_collide;
|
||||
CButton m_no_disabled_self_destruct;
|
||||
|
||||
CSpinButtonCtrl m_destroy_spin;
|
||||
numeric_edit_control m_kdamage;
|
||||
@@ -128,6 +129,7 @@ protected:
|
||||
afx_msg void OnCloaked();
|
||||
afx_msg void OnScrambleMessages();
|
||||
afx_msg void OnNoCollide();
|
||||
afx_msg void OnNoDisabledSelfDestruct();
|
||||
//}}AFX_MSG
|
||||
DECLARE_MESSAGE_MAP()
|
||||
};
|
||||
@@ -718,7 +718,7 @@ int VoiceActingManager::fout(char *format, ...)
|
||||
vsprintf(str, format, args);
|
||||
va_end(args);
|
||||
|
||||
cfputs(const_cast<char*>(str.c_str()), fp);
|
||||
cfputs(str.c_str(), fp);
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
@@ -87,7 +87,11 @@ void WeaponEditorDlg::DoDataExchange(CDataExchange* pDX)
|
||||
if (pDX->m_bSaveAndValidate) {
|
||||
GetDlgItem(IDC_AMMO1)->GetWindowText(str);
|
||||
if (save_number((char *) (LPCSTR) str, &m_ammo1)) {
|
||||
m_ammo_max1 = (m_missile1 <= 0) ? 0 : get_max_ammo_count_for_bank(m_ship_class, 0, m_missile1 + First_secondary_index - 1);
|
||||
if (m_missile1 <= 0) {
|
||||
m_ammo_max1 = 0;
|
||||
} else {
|
||||
m_ammo_max1 = (m_cur_item == 0) ? get_max_ammo_count_for_bank(m_ship_class, 0, m_missile1 + First_secondary_index - 1) : get_max_ammo_count_for_turret_bank(cur_weapon, 0, m_missile1 + First_secondary_index - 1);
|
||||
}
|
||||
if (m_ammo1 < 0)
|
||||
m_ammo1 = 0;
|
||||
if (m_ammo1 > m_ammo_max1)
|
||||
@@ -96,7 +100,11 @@ void WeaponEditorDlg::DoDataExchange(CDataExchange* pDX)
|
||||
|
||||
GetDlgItem(IDC_AMMO2)->GetWindowText(str);
|
||||
if (save_number((char *) (LPCSTR) str, &m_ammo2)) {
|
||||
m_ammo_max2 = (m_missile2 <= 0) ? 0 : get_max_ammo_count_for_bank(m_ship_class, 1, m_missile2 + First_secondary_index - 1);
|
||||
if (m_missile2 <= 0) {
|
||||
m_ammo_max2 = 0;
|
||||
} else {
|
||||
m_ammo_max2 = (m_cur_item == 0) ? get_max_ammo_count_for_bank(m_ship_class, 1, m_missile2 + First_secondary_index - 1) : get_max_ammo_count_for_turret_bank(cur_weapon, 1, m_missile2 + First_secondary_index - 1);
|
||||
}
|
||||
if (m_ammo2 < 0)
|
||||
m_ammo2 = 0;
|
||||
if (m_ammo2 > m_ammo_max2)
|
||||
@@ -105,7 +113,11 @@ void WeaponEditorDlg::DoDataExchange(CDataExchange* pDX)
|
||||
|
||||
GetDlgItem(IDC_AMMO3)->GetWindowText(str);
|
||||
if (save_number((char *) (LPCSTR) str, &m_ammo3)) {
|
||||
m_ammo_max3 = (m_missile3 <= 0) ? 0 : get_max_ammo_count_for_bank(m_ship_class, 2, m_missile3 + First_secondary_index - 1);
|
||||
if (m_missile3 <= 0) {
|
||||
m_ammo_max3 = 0;
|
||||
} else {
|
||||
m_ammo_max3 = (m_cur_item == 0) ? get_max_ammo_count_for_bank(m_ship_class, 2, m_missile3 + First_secondary_index - 1) : get_max_ammo_count_for_turret_bank(cur_weapon, 2, m_missile3 + First_secondary_index - 1);
|
||||
}
|
||||
if (m_ammo3 < 0)
|
||||
m_ammo3 = 0;
|
||||
if (m_ammo3 > m_ammo_max3)
|
||||
@@ -114,7 +126,11 @@ void WeaponEditorDlg::DoDataExchange(CDataExchange* pDX)
|
||||
|
||||
GetDlgItem(IDC_AMMO4)->GetWindowText(str);
|
||||
if (save_number((char *) (LPCSTR) str, &m_ammo4)) {
|
||||
m_ammo_max4 = (m_missile4 <= 0) ? 0 : get_max_ammo_count_for_bank(m_ship_class, 3, m_missile4 + First_secondary_index - 1);
|
||||
if (m_missile4 <= 0) {
|
||||
m_ammo_max4 = 0;
|
||||
} else {
|
||||
m_ammo_max4 = (m_cur_item == 0) ? get_max_ammo_count_for_bank(m_ship_class, 3, m_missile4 + First_secondary_index - 1) : get_max_ammo_count_for_turret_bank(cur_weapon, 3, m_missile4 + First_secondary_index - 1);
|
||||
}
|
||||
if (m_ammo4 < 0)
|
||||
m_ammo4 = 0;
|
||||
if (m_ammo4 > m_ammo_max4)
|
||||
@@ -403,7 +419,11 @@ void WeaponEditorDlg::change_selection()
|
||||
if (cur_weapon->num_secondary_banks > 0) {
|
||||
m_missile1 = cur_weapon->secondary_bank_weapons[0] + 1;
|
||||
if (m_missile1 > 0) {
|
||||
m_ammo_max1 = get_max_ammo_count_for_bank(m_ship_class, 0, m_missile1 - 1);
|
||||
if (m_cur_item == 0) {
|
||||
m_ammo_max1 = get_max_ammo_count_for_bank(m_ship_class, 0, m_missile1 - 1);
|
||||
} else {
|
||||
m_ammo_max1 = get_max_ammo_count_for_turret_bank(cur_weapon, 0, m_missile1 - 1);
|
||||
}
|
||||
if (cur_weapon->secondary_bank_ammo[0] != BLANK_FIELD)
|
||||
m_ammo1 = cur_weapon->secondary_bank_ammo[0] * m_ammo_max1 / 100;
|
||||
m_missile1 -= First_secondary_index;
|
||||
@@ -422,7 +442,11 @@ void WeaponEditorDlg::change_selection()
|
||||
if (cur_weapon->num_secondary_banks > 1) {
|
||||
m_missile2 = cur_weapon->secondary_bank_weapons[1] + 1;
|
||||
if (m_missile2 > 0) {
|
||||
m_ammo_max2 = get_max_ammo_count_for_bank(m_ship_class, 1, m_missile2 - 1);
|
||||
if (m_cur_item == 0) {
|
||||
m_ammo_max2 = get_max_ammo_count_for_bank(m_ship_class, 1, m_missile2 - 1);
|
||||
} else {
|
||||
m_ammo_max2 = get_max_ammo_count_for_turret_bank(cur_weapon, 1, m_missile2 - 1);
|
||||
}
|
||||
if (cur_weapon->secondary_bank_ammo[1] != BLANK_FIELD)
|
||||
m_ammo2 = cur_weapon->secondary_bank_ammo[1] * m_ammo_max2 / 100;
|
||||
m_missile2 -= First_secondary_index;
|
||||
@@ -441,7 +465,11 @@ void WeaponEditorDlg::change_selection()
|
||||
if (cur_weapon->num_secondary_banks > 2) {
|
||||
m_missile3 = cur_weapon->secondary_bank_weapons[2] + 1;
|
||||
if (m_missile3 > 0) {
|
||||
m_ammo_max3 = get_max_ammo_count_for_bank(m_ship_class, 2, m_missile3 - 1);
|
||||
if (m_cur_item == 0) {
|
||||
m_ammo_max3 = get_max_ammo_count_for_bank(m_ship_class, 2, m_missile3 - 1);
|
||||
} else {
|
||||
m_ammo_max3 = get_max_ammo_count_for_turret_bank(cur_weapon, 2, m_missile3 - 1);
|
||||
}
|
||||
if (cur_weapon->secondary_bank_ammo[2] != BLANK_FIELD)
|
||||
m_ammo3 = cur_weapon->secondary_bank_ammo[2] * m_ammo_max3 / 100;
|
||||
m_missile3 -= First_secondary_index;
|
||||
@@ -460,7 +488,11 @@ void WeaponEditorDlg::change_selection()
|
||||
if (cur_weapon->num_secondary_banks > 3) {
|
||||
m_missile4 = cur_weapon->secondary_bank_weapons[3] + 1;
|
||||
if (m_missile4 > 0) {
|
||||
m_ammo_max4 = get_max_ammo_count_for_bank(m_ship_class, 3, m_missile4 - 1);
|
||||
if (m_cur_item == 0) {
|
||||
m_ammo_max4 = get_max_ammo_count_for_bank(m_ship_class, 3, m_missile4 - 1);
|
||||
} else {
|
||||
m_ammo_max4 = get_max_ammo_count_for_turret_bank(cur_weapon, 3, m_missile4 - 1);
|
||||
}
|
||||
if (cur_weapon->secondary_bank_ammo[3] != BLANK_FIELD)
|
||||
m_ammo4 = cur_weapon->secondary_bank_ammo[3] * m_ammo_max4 / 100;
|
||||
m_missile4 -= First_secondary_index;
|
||||
@@ -553,7 +585,11 @@ void WeaponEditorDlg::OnSelchangeMissile1()
|
||||
{
|
||||
UpdateData(TRUE);
|
||||
UpdateData(TRUE);
|
||||
m_ammo_max1 = get_max_ammo_count_for_bank(m_ship_class, 0, m_missile1 + First_secondary_index - 1);
|
||||
if (m_cur_item == 0) {
|
||||
m_ammo_max1 = get_max_ammo_count_for_bank(m_ship_class, 0, m_missile1 + First_secondary_index - 1);
|
||||
} else {
|
||||
m_ammo_max1 = get_max_ammo_count_for_turret_bank(cur_weapon, 0, m_missile1 + First_secondary_index - 1);
|
||||
}
|
||||
m_ammo1 = m_ammo_max1 ? (m_ammo_max1) : 0;
|
||||
change_selection();
|
||||
}
|
||||
@@ -562,7 +598,11 @@ void WeaponEditorDlg::OnSelchangeMissile2()
|
||||
{
|
||||
UpdateData(TRUE);
|
||||
UpdateData(TRUE);
|
||||
m_ammo_max2 = get_max_ammo_count_for_bank(m_ship_class, 0, m_missile2 + First_secondary_index - 1);
|
||||
if (m_cur_item == 0) {
|
||||
m_ammo_max2 = get_max_ammo_count_for_bank(m_ship_class, 1, m_missile2 + First_secondary_index - 1);
|
||||
} else {
|
||||
m_ammo_max2 = get_max_ammo_count_for_turret_bank(cur_weapon, 1, m_missile2 + First_secondary_index - 1);
|
||||
}
|
||||
m_ammo2 = m_ammo_max2 ? (m_ammo_max2) : 0;
|
||||
change_selection();
|
||||
}
|
||||
@@ -571,7 +611,11 @@ void WeaponEditorDlg::OnSelchangeMissile3()
|
||||
{
|
||||
UpdateData(TRUE);
|
||||
UpdateData(TRUE);
|
||||
m_ammo_max3 = get_max_ammo_count_for_bank(m_ship_class, 0, m_missile3 + First_secondary_index - 1);
|
||||
if (m_cur_item == 0) {
|
||||
m_ammo_max3 = get_max_ammo_count_for_bank(m_ship_class, 2, m_missile3 + First_secondary_index - 1);
|
||||
} else {
|
||||
m_ammo_max3 = get_max_ammo_count_for_turret_bank(cur_weapon, 2, m_missile3 + First_secondary_index - 1);
|
||||
}
|
||||
m_ammo3 = m_ammo_max3 ? (m_ammo_max3) : 0;
|
||||
change_selection();
|
||||
}
|
||||
@@ -580,7 +624,11 @@ void WeaponEditorDlg::OnSelchangeMissile4()
|
||||
{
|
||||
UpdateData(TRUE);
|
||||
UpdateData(TRUE);
|
||||
m_ammo_max4 = get_max_ammo_count_for_bank(m_ship_class, 0, m_missile4 + First_secondary_index - 1);
|
||||
if (m_cur_item == 0) {
|
||||
m_ammo_max4 = get_max_ammo_count_for_bank(m_ship_class, 3, m_missile4 + First_secondary_index - 1);
|
||||
} else {
|
||||
m_ammo_max4 = get_max_ammo_count_for_turret_bank(cur_weapon, 3, m_missile4 + First_secondary_index - 1);
|
||||
}
|
||||
m_ammo4 = m_ammo_max4 ? (m_ammo_max4) : 0;
|
||||
change_selection();
|
||||
}
|
||||
@@ -17,7 +17,6 @@
|
||||
#include "physics/physics.h"
|
||||
#include "object/object.h"
|
||||
#include "editor.h"
|
||||
#include "ai/ailocal.h"
|
||||
#include "ship/ship.h"
|
||||
#include "math/vecmat.h"
|
||||
#include "Management.h"
|
||||
|
||||
+10
-11
@@ -405,7 +405,7 @@ void wing_editor::initialize_data_safe(int full_update)
|
||||
for (i=0; i<Wings[cur_wing].wave_count; i++)
|
||||
ptr->AddString(Ships[Wings[cur_wing].ship_index[i]].ship_name);
|
||||
|
||||
m_threshold_spin.SetRange(0, (short) Wings[cur_wing].wave_count - 1);
|
||||
m_threshold_spin.SetRange(0, static_cast<short>(calc_max_wave_treshold()));
|
||||
for (i=0; i<Num_reinforcements; i++)
|
||||
if (!stricmp(Reinforcements[i].name, Wings[cur_wing].name))
|
||||
break;
|
||||
@@ -754,16 +754,8 @@ void wing_editor::update_data_safe()
|
||||
if (cur_wing < 0)
|
||||
return;
|
||||
|
||||
if (m_threshold >= Wings[cur_wing].wave_count) {
|
||||
m_threshold = Wings[cur_wing].wave_count - 1;
|
||||
if (!bypass_errors) {
|
||||
sprintf(buf, "Wave threshold is set too high. Value has been lowered to %d", (int) m_threshold);
|
||||
MessageBox(buf);
|
||||
}
|
||||
}
|
||||
|
||||
if (m_threshold + Wings[cur_wing].wave_count > MAX_SHIPS_PER_WING) {
|
||||
m_threshold = MAX_SHIPS_PER_WING - Wings[cur_wing].wave_count;
|
||||
if (m_threshold > calc_max_wave_treshold()) {
|
||||
m_threshold = calc_max_wave_treshold();
|
||||
if (!bypass_errors) {
|
||||
sprintf(buf, "Wave threshold is set too high. Value has been lowered to %d", (int) m_threshold);
|
||||
MessageBox(buf);
|
||||
@@ -1359,4 +1351,11 @@ void wing_editor::OnRestrictDeparture()
|
||||
dlg.m_path_mask = &Wings[cur_wing].departure_path_mask;
|
||||
|
||||
dlg.DoModal();
|
||||
}
|
||||
|
||||
int wing_editor::calc_max_wave_treshold()
|
||||
{
|
||||
const int treshold1 = Wings[cur_wing].wave_count - 1; // At least 1 ship must have died before allowing respawn
|
||||
const int treshold2 = MAX_SHIPS_PER_WING - Wings[cur_wing].wave_count; // Maximum MAX_SHIPS_PER_WING ships can be alive at any given time
|
||||
return min(treshold1, treshold2);
|
||||
}
|
||||
@@ -106,4 +106,7 @@ protected:
|
||||
afx_msg void OnRestrictDeparture();
|
||||
//}}AFX_MSG
|
||||
DECLARE_MESSAGE_MAP()
|
||||
|
||||
// Aux functions
|
||||
int calc_max_wave_treshold();
|
||||
};
|
||||
Loaded 100 of 527 files, more files were not shown because too many files have changed in this diff.
Show more
Reference in new issue
Block a user