mirror of
https://github.com/scp-fs2open/fs2open.github.com.git
synced 2026-11-08 07:28:22 -10:00
Compare commits
652
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
c084a432d4 | ||
|
|
5135cded94 | ||
|
|
519d1f59f8 | ||
|
|
b9be2ad85e | ||
|
|
7121a3f748 | ||
|
|
7439cf2cc3 | ||
|
|
570dc5f3de | ||
|
|
620fdbde08 | ||
|
|
fdb7e41ed4 | ||
|
|
f286363748 | ||
|
|
1520a21062 | ||
|
|
cdc831b163 | ||
|
|
18718aee74 | ||
|
|
c8a5ebe45c | ||
|
|
29dd3e1057 | ||
|
|
bca6f95621 | ||
|
|
e2010aeda1 | ||
|
|
22f3463397 | ||
|
|
283e1555ba | ||
|
|
fe8ce74037 | ||
|
|
c43fa8c9a8 | ||
|
|
5c7fce41f1 | ||
|
|
0985091f6a | ||
|
|
2da7c4e761 | ||
|
|
6f109508d0 | ||
|
|
e84919fa88 | ||
|
|
684354c8bd | ||
|
|
45c3ee0b3c | ||
|
|
89eea8e5d3 | ||
|
|
32730fc362 | ||
|
|
1c8f07b012 | ||
|
|
892f0a831a | ||
|
|
6b573bdbf6 | ||
|
|
0e9ad8623b | ||
|
|
f5edccd98f | ||
|
|
007e7118f2 | ||
|
|
ae41e355ac | ||
|
|
43d51792f2 | ||
|
|
f739a3e5c1 | ||
|
|
33c3f556a4 | ||
|
|
490464b656 | ||
|
|
d526300483 | ||
|
|
3f3b284dcf | ||
|
|
e0992ed88e | ||
|
|
3997237a11 | ||
|
|
1c12349990 | ||
|
|
5f10b68118 | ||
|
|
91edcc4b8c | ||
|
|
4139cd890c | ||
|
|
8fa96aeaf3 | ||
|
|
282ca0b0dd | ||
|
|
d3b1871837 | ||
|
|
6f7ca147dd | ||
|
|
ee391940d2 | ||
|
|
23dbfa5655 | ||
|
|
8f1f308591 | ||
|
|
cc456855e5 | ||
|
|
0853c5bf7a | ||
|
|
96de072bff | ||
|
|
2f0f2d7669 | ||
|
|
1c5a361d50 | ||
|
|
44072c026c | ||
|
|
8cb9d311d7 | ||
|
|
bdec29f247 | ||
|
|
4e1b366f9f | ||
|
|
de2d1ec602 | ||
|
|
50e365a66c | ||
|
|
a954a04cf8 | ||
|
|
030bbeb622 | ||
|
|
6b7df053fa | ||
|
|
b8c135d162 | ||
|
|
b067e1ac66 | ||
|
|
eabead6d41 | ||
|
|
ec50baa9d1 | ||
|
|
66f7bc4f50 | ||
|
|
44b7d5a4bd | ||
|
|
caebad7077 | ||
|
|
0caa65a74f | ||
|
|
ff05816e11 | ||
|
|
da326f31f6 | ||
|
|
376a01e82b | ||
|
|
dc2ce094fc | ||
|
|
74a0346e0d | ||
|
|
3b0d20aaf2 | ||
|
|
a0951f4e28 | ||
|
|
3da2b99144 | ||
|
|
c9df8a13f1 | ||
|
|
247d5c453c | ||
|
|
5b8e89f37d | ||
|
|
f6083b680a | ||
|
|
fde7fdd854 | ||
|
|
64531798e7 | ||
|
|
ecd1cfe59c | ||
|
|
638bcacb71 | ||
|
|
4fc82ba334 | ||
|
|
7ebd00e6f5 | ||
|
|
fc41984a75 | ||
|
|
45b5399f08 | ||
|
|
fe15752f5e | ||
|
|
c0a7be50b4 | ||
|
|
bb8fcd428e | ||
|
|
641aa329a5 | ||
|
|
d86332a9d9 | ||
|
|
d8e88c1644 | ||
|
|
1926d3c341 | ||
|
|
c502d9bdf7 | ||
|
|
20835adef6 | ||
|
|
af5e834250 | ||
|
|
e9051933b9 | ||
|
|
bb48ea9c61 | ||
|
|
939be80c30 | ||
|
|
732ada474b | ||
|
|
23b5320ec4 | ||
|
|
e3f67146b1 | ||
|
|
cacee6e5b8 | ||
|
|
90c6c91e4f | ||
|
|
0748ac191c | ||
|
|
98cb4b6400 | ||
|
|
48d1797009 | ||
|
|
50ea017e59 | ||
|
|
c42cd25b89 | ||
|
|
75099171ef | ||
|
|
809d11e1a8 | ||
|
|
dadc65178d | ||
|
|
52b17c3f8a | ||
|
|
28722d7402 | ||
|
|
bf4243c0b0 | ||
|
|
9dd6d9c874 | ||
|
|
53a3b2b1c7 | ||
|
|
2dc2295a59 | ||
|
|
582c144cf7 | ||
|
|
e32cadd06a | ||
|
|
ed6ac7060e | ||
|
|
7029e4a10f | ||
|
|
4d2cf1d2e0 | ||
|
|
d31b2a971b | ||
|
|
74cf0b839d | ||
|
|
7f286b726d | ||
|
|
b0da0ea404 | ||
|
|
ca301fdb04 | ||
|
|
04244ec1ee | ||
|
|
84b15afa8a | ||
|
|
a7063152b7 | ||
|
|
5f938169af | ||
|
|
8763b06c77 | ||
|
|
90a97021f5 | ||
|
|
3c6015f6b0 | ||
|
|
ca4fcc84ea | ||
|
|
94e74cb15f | ||
|
|
3daa819042 | ||
|
|
4bb31f4e1b | ||
|
|
87c5544b7b | ||
|
|
4914c4a452 | ||
|
|
0b33a44004 | ||
|
|
1f98551b12 | ||
|
|
463caecf03 | ||
|
|
2f3f061e75 | ||
|
|
0c0c4ddaef | ||
|
|
3fb2f97b43 | ||
|
|
66daf6ba24 | ||
|
|
a13b503b83 | ||
|
|
43a29b4dec | ||
|
|
1c2d8a3b47 | ||
|
|
aa0a1ae3ed | ||
|
|
1d12157a07 | ||
|
|
ae026f83ca | ||
|
|
facf17a222 | ||
|
|
bf99541c58 | ||
|
|
34391ebe21 | ||
|
|
93f71ec202 | ||
|
|
e504f6b59e | ||
|
|
133821952f | ||
|
|
d7602ec9d1 | ||
|
|
fe5dbeccaa | ||
|
|
d7e40d2bcc | ||
|
|
0251fd347f | ||
|
|
1cce2d70a3 | ||
|
|
68f5b7d524 | ||
|
|
036d5ed780 | ||
|
|
c109562c40 | ||
|
|
0334b3c287 | ||
|
|
9039081fa7 | ||
|
|
73a5ac7665 | ||
|
|
6c2e419825 | ||
|
|
c2c2042a38 | ||
|
|
da08ba5932 | ||
|
|
bc14149e84 | ||
|
|
6ceb2a276c | ||
|
|
d8537843ab | ||
|
|
539cad66e7 | ||
|
|
b042b27310 | ||
|
|
8ee447d8c2 | ||
|
|
8a36fc138c | ||
|
|
a86322c49d | ||
|
|
b19d7def54 | ||
|
|
34577df2ea | ||
|
|
b56c0d8bff | ||
|
|
48164e447d | ||
|
|
1f4867a640 | ||
|
|
648598c729 | ||
|
|
0b6a642a17 | ||
|
|
939492b981 | ||
|
|
69393f9104 | ||
|
|
3a2c680caa | ||
|
|
db71f3d550 | ||
|
|
0b2695e9e4 | ||
|
|
51bbb0c1d2 | ||
|
|
362645ce27 | ||
|
|
10ab4a00f5 | ||
|
|
5ce6c251ff | ||
|
|
a3651026b1 | ||
|
|
6f18d93a23 | ||
|
|
8e767bb613 | ||
|
|
06df419429 | ||
|
|
98bafefc32 | ||
|
|
45e34797ae | ||
|
|
9eb7884968 | ||
|
|
2bdcd1bf04 | ||
|
|
00e750c120 | ||
|
|
6b872ef93c | ||
|
|
07231d74e6 | ||
|
|
78f113e806 | ||
|
|
da05fa18c5 | ||
|
|
89576232a5 | ||
|
|
a73ccee28d | ||
|
|
15b494b765 | ||
|
|
49559c047f | ||
|
|
c6af310178 | ||
|
|
3013b76a46 | ||
|
|
b32f2856fc | ||
|
|
1fdf2876d0 | ||
|
|
790949b527 | ||
|
|
7d1acf0b08 | ||
|
|
1d9eb94726 | ||
|
|
4503fc05d5 | ||
|
|
42953b0f0d | ||
|
|
a69e6b1e8e | ||
|
|
072105a9c3 | ||
|
|
1578e4eab4 | ||
|
|
1c23d90846 | ||
|
|
bfe507a53a | ||
|
|
bf82ffdf4b | ||
|
|
0c26ad40e9 | ||
|
|
56fd6f504a | ||
|
|
2521228666 | ||
|
|
db6520c072 | ||
|
|
09f06dc1ed | ||
|
|
aee6ecb974 | ||
|
|
b06761bc66 | ||
|
|
20e78143ee | ||
|
|
861eb14865 | ||
|
|
e34e3378a2 | ||
|
|
03125df50c | ||
|
|
67613bbba0 | ||
|
|
4f5f3e859e | ||
|
|
10bec9ff00 | ||
|
|
a7e4a72622 | ||
|
|
3167623e31 | ||
|
|
c3a51296f8 | ||
|
|
084cd65e97 | ||
|
|
158448401a | ||
|
|
bc5425166c | ||
|
|
3da2bdc0ad | ||
|
|
b37c6b9052 | ||
|
|
ca3dc4277f | ||
|
|
0f65314dd9 | ||
|
|
abaa891b00 | ||
|
|
176de9e928 | ||
|
|
84fb5e7610 | ||
|
|
977a8aff91 | ||
|
|
06ead7c051 | ||
|
|
3d485af4cc | ||
|
|
7cde541390 | ||
|
|
8b7b9627ed | ||
|
|
7e2193ef2d | ||
|
|
f536b0cda2 | ||
|
|
58992cfd3a | ||
|
|
d9dfce3c25 | ||
|
|
440162ab24 | ||
|
|
c9e38fedd2 | ||
|
|
2856ae3583 | ||
|
|
bb2f19c176 | ||
|
|
d16a3fa5cf | ||
|
|
b07a3282ad | ||
|
|
83370f6219 | ||
|
|
3960af6ba5 | ||
|
|
b0edc12985 | ||
|
|
83c72ec9ae | ||
|
|
d3c5eb3894 | ||
|
|
82a53d8fef | ||
|
|
7d60ee882b | ||
|
|
f958116a64 | ||
|
|
4b51ac5987 | ||
|
|
d06a3ca72c | ||
|
|
fdf37dcb35 | ||
|
|
b825f57bf4 | ||
|
|
d664f13f97 | ||
|
|
a069eb62f9 | ||
|
|
3bc878db9a | ||
|
|
0e31be10f5 | ||
|
|
e96f9400e1 | ||
|
|
d703d61cba | ||
|
|
f00be46211 | ||
|
|
826a92745d | ||
|
|
f573706d07 | ||
|
|
9ae62e9db8 | ||
|
|
7da6276f07 | ||
|
|
c286c4c2ce | ||
|
|
820d4452d8 | ||
|
|
e8a07b6972 | ||
|
|
7ede543ca7 | ||
|
|
da1634cdc2 | ||
|
|
1183140dc2 | ||
|
|
fc29960b3b | ||
|
|
2e3f0e2f80 | ||
|
|
d9bb6625fd | ||
|
|
d2c9afc853 | ||
|
|
8535c3cbea | ||
|
|
8fdd8624e4 | ||
|
|
c294433741 | ||
|
|
e89fb04b8c | ||
|
|
de0a43940f | ||
|
|
02aab6cfdf | ||
|
|
d0bee3a3ac | ||
|
|
2049778da8 | ||
|
|
2972fdc1cf | ||
|
|
b0dfca91c5 | ||
|
|
55e5351214 | ||
|
|
2789d143bb | ||
|
|
8935075af9 | ||
|
|
90467f8f41 | ||
|
|
4d6ec5c431 | ||
|
|
9184ed4224 | ||
|
|
599313da81 | ||
|
|
f8bdfa2d0b | ||
|
|
f817538567 | ||
|
|
8bde99654f | ||
|
|
7552b50a2e | ||
|
|
f4883401e9 | ||
|
|
d223aee4e7 | ||
|
|
d6ec51235b | ||
|
|
d84231642d | ||
|
|
0f020abf3d | ||
|
|
39bd7cfdce | ||
|
|
4cad3d4fc2 | ||
|
|
0eb0cc87d1 | ||
|
|
520f8f4e04 | ||
|
|
85e955a58f | ||
|
|
c01e30e393 | ||
|
|
52f709a2db | ||
|
|
425a6e67d5 | ||
|
|
3c7c8486eb | ||
|
|
fadcaa0ca1 | ||
|
|
e885203683 | ||
|
|
013f6007f3 | ||
|
|
65ced1279d | ||
|
|
383b3b7ca9 | ||
|
|
8204de3854 | ||
|
|
c4a7a234ae | ||
|
|
8808e26f06 | ||
|
|
10150c0640 | ||
|
|
674b6cd4fb | ||
|
|
d271e33cca | ||
|
|
d340d96202 | ||
|
|
4ca589a61c | ||
|
|
4ae495437b | ||
|
|
8ed68efc34 | ||
|
|
1a8dcb1be9 | ||
|
|
821f90c5db | ||
|
|
775359c636 | ||
|
|
2d7c4de268 | ||
|
|
16b4c36cc0 | ||
|
|
0008c5bacb | ||
|
|
f518e277f1 | ||
|
|
0ff32b3f3e | ||
|
|
6abd8b0b60 | ||
|
|
903e1563ce | ||
|
|
e519646e28 | ||
|
|
4f89dd3c2f | ||
|
|
48773e3099 | ||
|
|
5f234426b1 | ||
|
|
7b2e8340c6 | ||
|
|
1d4dea29d1 | ||
|
|
bd5fef4861 | ||
|
|
1b533d5c7e | ||
|
|
c5ae4ca2b9 | ||
|
|
9abcd55f23 | ||
|
|
88fdae1863 | ||
|
|
4c9454274f | ||
|
|
4fc13dcb72 | ||
|
|
ceb592b182 | ||
|
|
54455522b2 | ||
|
|
ea021c6fe3 | ||
|
|
ccb7480b53 | ||
|
|
06a783cce4 | ||
|
|
d56ce4cb56 | ||
|
|
a93be36740 | ||
|
|
3926ee39dd | ||
|
|
44c9fc2ec9 | ||
|
|
b06f6476c9 | ||
|
|
8278007cdb | ||
|
|
c5d201ba67 | ||
|
|
30326cb67e | ||
|
|
d4c960fa13 | ||
|
|
78c7f375cc | ||
|
|
851899418e | ||
|
|
58bd966f54 | ||
|
|
5dbefc99d0 | ||
|
|
d60929cd53 | ||
|
|
fdca5ffeed | ||
|
|
9ac5c7e041 | ||
|
|
75d925e8e8 | ||
|
|
bec81ed752 | ||
|
|
0a61706368 | ||
|
|
368194a23e | ||
|
|
ff520dbfa4 | ||
|
|
e2c6fc3cc2 | ||
|
|
6d770c8bc5 | ||
|
|
6200b380d7 | ||
|
|
ea7c454e6a | ||
|
|
7d40cbb241 | ||
|
|
6c356692b2 | ||
|
|
400440ca63 | ||
|
|
5ae9623f9e | ||
|
|
166a88d4a6 | ||
|
|
0dcea8f93e | ||
|
|
4c2a3450f8 | ||
|
|
51d362e447 | ||
|
|
70b14a5c2c | ||
|
|
e9cf9ac10d | ||
|
|
990820cad8 | ||
|
|
623be80e48 | ||
|
|
6b3f5051ea | ||
|
|
7451fb36d9 | ||
|
|
9e5cd347be | ||
|
|
1f41d98e2a | ||
|
|
1c77ffe07f | ||
|
|
29b853de0c | ||
|
|
48c67b563a | ||
|
|
4ccccb526e | ||
|
|
a61324f559 | ||
|
|
a3d2ca5724 | ||
|
|
97ace6fa8c | ||
|
|
7a11e247f3 | ||
|
|
29ce72f66f | ||
|
|
a94c4e46a1 | ||
|
|
e262878add | ||
|
|
c499cfb192 | ||
|
|
2238c0af63 | ||
|
|
6a0023da4b | ||
|
|
bb19d69b7b | ||
|
|
e62b64bac8 | ||
|
|
a17f5031bf | ||
|
|
1fb194a729 | ||
|
|
f0f72b25a5 | ||
|
|
f8f9bce7da | ||
|
|
082304a4b8 | ||
|
|
6614b6cd9a | ||
|
|
3450a39e75 | ||
|
|
58ada6cf05 | ||
|
|
4369f1b555 | ||
|
|
8e94880c7f | ||
|
|
0a1bd5be5c | ||
|
|
bd9880bc9b | ||
|
|
6433181607 | ||
|
|
28ce16ba6b | ||
|
|
1b69015b50 | ||
|
|
be24f7f574 | ||
|
|
afc7c671d2 | ||
|
|
e31e68cba0 | ||
|
|
b5663cfd89 | ||
|
|
3ec94338d3 | ||
|
|
627294039f | ||
|
|
86a12c0654 | ||
|
|
c5805bcd8d | ||
|
|
601fa75d50 | ||
|
|
68df93ccff | ||
|
|
5084fdd189 | ||
|
|
256e5028a1 | ||
|
|
327ee0fccb | ||
|
|
efb3d08494 | ||
|
|
2e5da03e86 | ||
|
|
3a4bd86153 | ||
|
|
f0526e3f7c | ||
|
|
963db03f3e | ||
|
|
a8cf7f2c69 | ||
|
|
99c23b11cd | ||
|
|
8b7e99c4cb | ||
|
|
515b0062f4 | ||
|
|
ae1e0c90fa | ||
|
|
edad20d562 | ||
|
|
481be44713 | ||
|
|
d3c2b17ae9 | ||
|
|
f34e76bd55 | ||
|
|
8a388accec | ||
|
|
8379a5c1f5 | ||
|
|
aef0e1f78a | ||
|
|
4eac2e0cbc | ||
|
|
404c11e4a5 | ||
|
|
fc3ae5f93d | ||
|
|
0649f9abaa | ||
|
|
17c9547d83 | ||
|
|
5f8192d1ee | ||
|
|
2bea31dab0 | ||
|
|
a22ef2e19d | ||
|
|
cf8fa26187 | ||
|
|
ab3388f397 | ||
|
|
a80e4ba56e | ||
|
|
3a9855ac69 | ||
|
|
cced7e9e3f | ||
|
|
323debfb91 | ||
|
|
4a464b2e8e | ||
|
|
7a0a9ea475 | ||
|
|
8f619871e6 | ||
|
|
52fdb393ae | ||
|
|
9770d7f59b | ||
|
|
c1e6aca72b | ||
|
|
40d3f5d38f | ||
|
|
58a4825d9b | ||
|
|
3811eafee6 | ||
|
|
7703b27e64 | ||
|
|
18e9746792 | ||
|
|
334f392eb1 | ||
|
|
d3d6e2ea41 | ||
|
|
db1da25272 | ||
|
|
01102e14be | ||
|
|
2be44008da | ||
|
|
93effdd31b | ||
|
|
aa2cc618d3 | ||
|
|
a5d63654fc | ||
|
|
09f1de6efe | ||
|
|
b4a4d70ff4 | ||
|
|
c6c2e5b17e | ||
|
|
15c9533089 | ||
|
|
2de323eb5d | ||
|
|
2f00b3a081 | ||
|
|
6895276aea | ||
|
|
ff31bebc9c | ||
|
|
6006670439 | ||
|
|
e91ee3dd4f | ||
|
|
53ec0d45cb | ||
|
|
a34d696c29 | ||
|
|
ce57c52faf | ||
|
|
0db66e776a | ||
|
|
f9e4a4bb2a | ||
|
|
8cb39c424b | ||
|
|
15346dad16 | ||
|
|
de501fb3f1 | ||
|
|
81a827dda9 | ||
|
|
f7f537ff77 | ||
|
|
e1a0a8a2fb | ||
|
|
1cd22ba827 | ||
|
|
4f884b5035 | ||
|
|
894228cc7c | ||
|
|
8f8afbc189 | ||
|
|
f4bfec5029 | ||
|
|
c18f775962 | ||
|
|
608dcb6b44 | ||
|
|
b4b23e266b | ||
|
|
c41eef517b | ||
|
|
65e2aa88b3 | ||
|
|
fe0c6a629a | ||
|
|
730c62af81 | ||
|
|
13d4ebaceb | ||
|
|
ed6a780898 | ||
|
|
f0b9929cd3 | ||
|
|
f315caad95 | ||
|
|
b5a47e651f | ||
|
|
d49299225c | ||
|
|
3b0bb79d79 | ||
|
|
daacdc0035 | ||
|
|
39df9ef90e | ||
|
|
fc080cccbd | ||
|
|
0c07ad9d71 | ||
|
|
7d329bbbc6 | ||
|
|
17a449529f | ||
|
|
73f0addc42 | ||
|
|
0ba1583d90 | ||
|
|
2436697f2c | ||
|
|
0e10100aad | ||
|
|
60bcdefac0 | ||
|
|
5d8ac3cc11 | ||
|
|
e0bc2f188b | ||
|
|
d13bbdd534 | ||
|
|
44b09d137f | ||
|
|
4439edcb4d | ||
|
|
a9ddeda40e | ||
|
|
d606e4d952 | ||
|
|
2fa8a0bd84 | ||
|
|
f9d178d46b | ||
|
|
989235936e | ||
|
|
6df9c73a4c | ||
|
|
d794eb6e77 | ||
|
|
e5c06c9554 | ||
|
|
bc00b79922 | ||
|
|
e1e86667b3 | ||
|
|
881f787ac8 | ||
|
|
88d5bed064 | ||
|
|
d9b1659efc | ||
|
|
f6408113f2 | ||
|
|
6075c17255 | ||
|
|
da9f71dac0 | ||
|
|
03f1344794 | ||
|
|
59e9d7cb0c | ||
|
|
910595880a | ||
|
|
9f07e43455 | ||
|
|
7b8c156980 | ||
|
|
f8c11ccd2e | ||
|
|
7e36dc8afe | ||
|
|
b1ad89a9fa | ||
|
|
4d9b1a7674 | ||
|
|
72f3871b7b | ||
|
|
7906ff460a | ||
|
|
1eb1923751 | ||
|
|
6d1931bf99 | ||
|
|
f75cb1edd3 | ||
|
|
48586bc857 | ||
|
|
3adb861640 | ||
|
|
7b1f407c22 | ||
|
|
ed5b4b9b5a | ||
|
|
b63ddf08bb | ||
|
|
816d8e5415 | ||
|
|
e7e43e9466 | ||
|
|
48e630dfd1 | ||
|
|
00f2ddc8da | ||
|
|
c6d93275c2 | ||
|
|
e2ce0bea9b | ||
|
|
a98fd2cb54 | ||
|
|
5444e81fab | ||
|
|
83276a355d | ||
|
|
98606b37e4 | ||
|
|
c4a7e9694f | ||
|
|
2db1758ec2 | ||
|
|
cff070dc07 | ||
|
|
7b3ad77f36 | ||
|
|
d67e79a44b | ||
|
|
977190b358 | ||
|
|
ba3237604e | ||
|
|
d55a6632ca | ||
|
|
680cb580cd | ||
|
|
2f74940f6a | ||
|
|
72d876bd4b | ||
|
|
e22398bec8 | ||
|
|
11661db6ab | ||
|
|
6164004df3 | ||
|
|
505aa3cdd1 | ||
|
|
cfeb8da3d3 | ||
|
|
ec7945276a | ||
|
|
2bf19afb94 | ||
|
|
34b38f63fa | ||
|
|
4c7470fbf2 | ||
|
|
ef0381d29f |
No files matched your search
+16
-13
@@ -1,25 +1,27 @@
|
||||
---
|
||||
Language: Cpp
|
||||
Standard: Cpp11
|
||||
# BasedOnStyle: LLVM
|
||||
AccessModifierOffset: -2
|
||||
AlignAfterOpenBracket: Align
|
||||
AlignConsecutiveAssignments: true
|
||||
AlignConsecutiveDeclarations: false
|
||||
AlignEscapedNewlinesLeft: false
|
||||
AlignEscapedNewlines: Left
|
||||
AlignOperands: true
|
||||
AlignTrailingComments: true
|
||||
AllowAllParametersOfDeclarationOnNextLine: true
|
||||
AllowShortBlocksOnASingleLine: false
|
||||
AllowAllArgumentsOnNextLine: false
|
||||
AllowShortBlocksOnASingleLine: Never
|
||||
AllowShortCaseLabelsOnASingleLine: false
|
||||
AllowShortFunctionsOnASingleLine: All
|
||||
AllowShortIfStatementsOnASingleLine: false
|
||||
AllowShortIfStatementsOnASingleLine: Never
|
||||
AllowShortLoopsOnASingleLine: false
|
||||
AlwaysBreakAfterDefinitionReturnType: None
|
||||
AlwaysBreakAfterReturnType: None
|
||||
AlwaysBreakBeforeMultilineStrings: false
|
||||
AlwaysBreakTemplateDeclarations: true
|
||||
BinPackArguments: true
|
||||
BinPackParameters: true
|
||||
AlwaysBreakTemplateDeclarations: Yes
|
||||
BinPackArguments: false
|
||||
BinPackParameters: false
|
||||
BraceWrapping:
|
||||
AfterClass: false
|
||||
AfterControlStatement: false
|
||||
@@ -50,15 +52,17 @@ ForEachMacros: [ foreach, Q_FOREACH, BOOST_FOREACH ]
|
||||
IncludeBlocks: Regroup
|
||||
IncludeCategories:
|
||||
- Regex: '^(<.*\.(h|hh|hpp)>)$' # Includes of external libraries
|
||||
Priority: 4
|
||||
- Regex: '^(<.*>)$' # standard library includes (won't match deprecated C headers)
|
||||
Priority: 5
|
||||
- Regex: '^"[^/]*\.(h)"$' # Local includes
|
||||
- Regex: '^(<.*>)$' # standard library includes (won't match deprecated C headers)
|
||||
Priority: 6
|
||||
- Regex: '^"globalincs\/.*\.h"$' # globalincs always come first
|
||||
Priority: 1
|
||||
- Regex: '^".*\.(h)"$' # standard engine includes
|
||||
- Regex: '^"[^/]*\.(h)"$' # Local includes
|
||||
Priority: 2
|
||||
- Regex: '.*' # Catch all in case something is unhandled above
|
||||
- Regex: '^".*\.(h)"$' # standard engine includes
|
||||
Priority: 3
|
||||
- Regex: '.*' # Catch all in case something is unhandled above
|
||||
Priority: 4
|
||||
IncludeIsMainRegex: '$'
|
||||
IndentCaseLabels: false
|
||||
IndentWidth: 4
|
||||
@@ -93,8 +97,7 @@ SpacesInContainerLiterals: true
|
||||
SpacesInCStyleCastParentheses: false
|
||||
SpacesInParentheses: false
|
||||
SpacesInSquareBrackets: false
|
||||
Standard: Cpp11
|
||||
TabWidth: 4
|
||||
UseTab: ForIndentation
|
||||
UseTab: ForContinuationAndIndentation
|
||||
...
|
||||
|
||||
+4
-1
@@ -4,13 +4,16 @@ modernize-*,\
|
||||
-modernize-raw-string-literal,\
|
||||
-modernize-use-using,\
|
||||
-modernize-make-unique,\
|
||||
-modernize-use-trailing-return-type,\
|
||||
-modernize-avoid-c-arrays,\
|
||||
performance-*,\
|
||||
-performance-type-promotion-in-math-fn,\
|
||||
misc-*,\
|
||||
-misc-macro-parentheses,\
|
||||
-misc-misplaced-widening-cast,\
|
||||
-misc-static-assert,\
|
||||
-modernize-make-unique,\
|
||||
-misc-unused-parameters,\
|
||||
-misc-non-private-member-variables-in-classes,\
|
||||
"
|
||||
WarningsAsErrors: ''
|
||||
HeaderFilterRegex: 'code/.*$|freespace2/.*$|qtfred/.*$|test/src/.*$|build/.*$'
|
||||
|
||||
@@ -0,0 +1,2 @@
|
||||
/build
|
||||
/.git
|
||||
@@ -5,3 +5,7 @@ indent_style = tab
|
||||
|
||||
[*.sdr]
|
||||
indent_style = tab
|
||||
|
||||
[*.{yml,yaml}]
|
||||
indent_style = space
|
||||
indent_size = 2
|
||||
@@ -0,0 +1,7 @@
|
||||
# Default for everything
|
||||
# * text=auto
|
||||
|
||||
# For the test data and built-in files to make them consistent on all platforms
|
||||
*.tbl text eol=lf
|
||||
*.tbm text eol=lf
|
||||
*.sdr text eol=lf
|
||||
@@ -0,0 +1,130 @@
|
||||
name: Check a pull request
|
||||
|
||||
on: [pull_request]
|
||||
|
||||
jobs:
|
||||
build_linux:
|
||||
strategy:
|
||||
matrix:
|
||||
configuration: [Debug, Release]
|
||||
compiler: [gcc-5, gcc-9, clang-4.0]
|
||||
name: Linux
|
||||
runs-on: ubuntu-16.04
|
||||
steps:
|
||||
- name: Prepare Environment
|
||||
env:
|
||||
DEBIAN_FRONTEND: noninteractive
|
||||
run: |
|
||||
sudo add-apt-repository ppa:ubuntu-toolchain-r/test
|
||||
sudo add-apt-repository ppa:beineri/opt-qt571-xenial
|
||||
sudo add-apt-repository ppa:msulikowski/valgrind # For fixing a bug with valgrind 3.11 which does not recognize the rdrand instruction
|
||||
sudo apt-get -yq update
|
||||
sudo apt-get -yq install cmake ninja-build libopenal-dev libreadline6-dev libpng12-dev libjpeg62-dev liblua5.1-0-dev libjansson-dev libsdl2-dev libfreetype6-dev valgrind qt57base g++-5 g++-9 clang-4.0 clang-tidy-4.0 libc++-dev libc++abi-dev
|
||||
# Fix a header bug present in ubuntu...
|
||||
sudo ln -s /usr/include/libcxxabi/__cxxabi_config.h /usr/include/c++/v1/__cxxabi_config.h
|
||||
- uses: actions/checkout@v1
|
||||
name: Checkout
|
||||
with:
|
||||
submodules: true
|
||||
- name: Configure CMake
|
||||
env:
|
||||
CONFIGURATION: ${{ matrix.configuration }}
|
||||
COMPILER: ${{ matrix.compiler }}
|
||||
run: |
|
||||
if [ "$COMPILER" = "gcc-5" ]; then
|
||||
export CC=gcc-5
|
||||
export CXX=g++-5
|
||||
fi
|
||||
if [ "$COMPILER" = "gcc-9" ]; then
|
||||
export CC=gcc-9
|
||||
export CXX=g++-9
|
||||
fi
|
||||
if [ "$COMPILER" = "clang-4.0" ]; then
|
||||
export CC=clang-4.0
|
||||
export CXX=clang++-4.0
|
||||
fi
|
||||
|
||||
CXXFLAGS="-m64 -mtune=generic -mfpmath=sse -msse -msse2 -pipe -Wno-unknown-pragmas"
|
||||
CFLAGS="-m64 -mtune=generic -mfpmath=sse -msse -msse2 -pipe -Wno-unknown-pragmas"
|
||||
|
||||
if [[ "$CC" =~ ^clang.*$ ]]; then
|
||||
CXXFLAGS="$CXXFLAGS -stdlib=libc++"
|
||||
fi
|
||||
|
||||
mkdir build
|
||||
cd build
|
||||
|
||||
export CXXFLAGS
|
||||
export CFLAGS
|
||||
CMAKE="cmake -G Ninja -DFSO_FATAL_WARNINGS=ON $CMAKE_OPTIONS"
|
||||
eval $CMAKE -DCMAKE_BUILD_TYPE=$CONFIGURATION -DFSO_BUILD_TESTS=ON -DFSO_BUILD_INCLUDED_LIBS=ON -DFSO_BUILD_QTFRED=ON ..
|
||||
- name: Compile
|
||||
working-directory: ./build
|
||||
run: ninja -k 20 all
|
||||
- name: Run Tests
|
||||
working-directory: ./build
|
||||
env:
|
||||
CONFIGURATION: ${{ matrix.configuration }}
|
||||
run: |
|
||||
if [ "$CONFIGURATION" = "Debug" ]; then
|
||||
valgrind --leak-check=full --error-exitcode=1 --gen-suppressions=all \
|
||||
--suppressions="$GITHUB_WORKSPACE/ci/travis/valgrind.supp" ./bin/unittests --gtest_shuffle
|
||||
else
|
||||
./bin/unittests --gtest_shuffle
|
||||
fi
|
||||
build_windows:
|
||||
strategy:
|
||||
matrix:
|
||||
configuration: [Debug, Release]
|
||||
compiler: [MSVC]
|
||||
arch: [Win32, x64]
|
||||
name: Windows
|
||||
runs-on: windows-2019
|
||||
steps:
|
||||
- name: Prepare Environment
|
||||
run: choco install ninja
|
||||
- uses: actions/checkout@v1
|
||||
name: Checkout
|
||||
with:
|
||||
submodules: true
|
||||
- name: Configure CMake
|
||||
env:
|
||||
CONFIGURATION: ${{ matrix.configuration }}
|
||||
COMPILER: ${{ matrix.compiler }}
|
||||
ARCHITECTURE: ${{ matrix.arch }}
|
||||
shell: bash
|
||||
run: |
|
||||
mkdir build
|
||||
cd build
|
||||
|
||||
if [ "$COMPILER" = "MinGW" ]; then
|
||||
cmake -DFSO_USE_SPEECH="OFF" -DFSO_FATAL_WARNINGS="ON" -DFSO_USE_VOICEREC="OFF" -DFSO_BUILD_TESTS="ON" \
|
||||
-DFSO_BUILD_FRED2="OFF" -DCMAKE_BUILD_TYPE=$CONFIGURATION -G "Ninja" ..
|
||||
else
|
||||
cmake -DFSO_USE_SPEECH="ON" -DFSO_FATAL_WARNINGS="ON" -DFSO_USE_VOICEREC="OFF" -DFSO_BUILD_TESTS="ON" \
|
||||
-DMSVC_SIMD_INSTRUCTIONS=SSE2 -DFSO_BUILD_FRED2="ON" -G "Visual Studio 16 2019" -T "v142" -A "$ARCHITECTURE" ..
|
||||
fi
|
||||
- name: Compile
|
||||
working-directory: ./build
|
||||
env:
|
||||
CONFIGURATION: ${{ matrix.configuration }}
|
||||
COMPILER: ${{ matrix.compiler }}
|
||||
shell: bash
|
||||
run: |
|
||||
if [ "$COMPILER" = "MinGW" ]; then
|
||||
cmake --build . --config "$CONFIGURATION"
|
||||
else
|
||||
cmake --build . --config "$CONFIGURATION" -- /verbosity:minimal
|
||||
fi
|
||||
- name: Run Tests
|
||||
working-directory: ./build
|
||||
env:
|
||||
CONFIGURATION: ${{ matrix.configuration }}
|
||||
COMPILER: ${{ matrix.compiler }}
|
||||
shell: bash
|
||||
run: |
|
||||
if [ "$COMPILER" = "MinGW" ]; then
|
||||
./bin/unittests --gtest_shuffle
|
||||
else
|
||||
"./bin/$CONFIGURATION/unittests" --gtest_shuffle
|
||||
fi
|
||||
@@ -0,0 +1,48 @@
|
||||
name: Publish Standalone docker image
|
||||
|
||||
on:
|
||||
push:
|
||||
tags:
|
||||
- '*'
|
||||
|
||||
jobs:
|
||||
build_images:
|
||||
strategy:
|
||||
matrix:
|
||||
configuration: [FastDebug, Release]
|
||||
include:
|
||||
- configuration: FastDebug
|
||||
latest_tag: latest_debug
|
||||
nightly_tag: nightly_debug
|
||||
release_tag: release_debug
|
||||
- configuration: Release
|
||||
latest_tag: latest
|
||||
nightly_tag: nightly
|
||||
release_tag: release
|
||||
fail-fast: false
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v1
|
||||
name: Checkout
|
||||
with:
|
||||
submodules: true
|
||||
- name: Docker login
|
||||
run: echo ${{ secrets.DOCKER_ACCESSTOKEN }} | docker login -u ${{ secrets.DOCKER_USERNAME }} --password-stdin
|
||||
- name: Docker build
|
||||
run: docker build --build-arg build_type=${{ matrix.configuration }} -f docker/standalone/Dockerfile -t ${{ secrets.DOCKER_REPOSITORY }}:${{ matrix.latest_tag }} .
|
||||
|
||||
- name: Push latest tag
|
||||
run: |
|
||||
docker push ${{ secrets.DOCKER_REPOSITORY }}:${{ matrix.latest_tag }}
|
||||
|
||||
- name: Push nightly tag
|
||||
if: contains(github.ref, 'refs/tags/nightly_')
|
||||
run: |
|
||||
docker tag ${{ secrets.DOCKER_REPOSITORY }}:${{ matrix.latest_tag }} ${{ secrets.DOCKER_REPOSITORY }}:${{ matrix.nightly_tag }}
|
||||
docker push ${{ secrets.DOCKER_REPOSITORY }}:${{ matrix.nightly_tag }}
|
||||
|
||||
- name: Push release tag
|
||||
if: contains(github.ref, 'refs/tags/release_')
|
||||
run: |
|
||||
docker tag ${{ secrets.DOCKER_REPOSITORY }}:${{ matrix.latest_tag }} ${{ secrets.DOCKER_REPOSITORY }}:${{ matrix.release_tag }}
|
||||
docker push ${{ secrets.DOCKER_REPOSITORY }}:${{ matrix.release_tag }}
|
||||
@@ -257,3 +257,4 @@ CMakeSettings.json
|
||||
# This gets ignored by one of the rules above for some reason...
|
||||
!/code/scripting/lua/LuaConvert.h
|
||||
!/code/debugconsole/
|
||||
!/docker/build
|
||||
+45
-26
@@ -1,6 +1,6 @@
|
||||
language: bash
|
||||
sudo: required
|
||||
dist: trusty
|
||||
dist: xenial
|
||||
cache:
|
||||
directories:
|
||||
- $HOME/cmake-3.8
|
||||
@@ -18,7 +18,6 @@ addons:
|
||||
- libjansson-dev
|
||||
- libsdl2-dev
|
||||
- libfreetype6-dev
|
||||
- valgrind
|
||||
- qt57base
|
||||
coverity_scan:
|
||||
project:
|
||||
@@ -37,13 +36,13 @@ env:
|
||||
# These declarations set INDIEGAMES_USER and INDIEGAMES_PASSWORD for uploading nightly builds to the indiegames server
|
||||
- secure: "lUuRu8XIi8MKNf1ebOfyC4iVEpPyASojJIDWXRo2bNqEF4ILAljXdkVeXeN6H5yKCHD52cxCNTtyePIG/o3p3QEuGSVud9bDS3D7LaQicLETGGrsw3l07U49gF2OKHXGopg0MzBbZUU9QmhoFTAe8t6PV9NDuEayYCheqvTqjZg="
|
||||
- secure: "E/DHLYcPK/hBUqxBYYlUqp5sjgvIqY5A0qRHyQ4bmjsB+WB/Xx71bGCSiF7hk6lTxar1ZI1i5RAXXh9AIvNVaYAIdEOlCP+q3gvwCYuc5naZEKmkxlUCf0oEL4O9Fye93A/3VkFHuBdC1TGPYYf69m4W5r4367wWO9dPRIdWpJA="
|
||||
# These declarations set FS2DOWNLOADS_USER and FS2DOWNLOADS_PASSWORD
|
||||
- secure: "h6GbMX2jLsW1bS9fCM9fthOSJ1nfQQIRWi6EUH2p8u4NFLD5Bfi/C8JhQPKHUzyo3wvKkSHl+PsW7bgr1oXLusRwAur/dtv2N3imqvtbfIz305b00hZlsvbcYmQmUzQFSAdOGShK57JJ5aKQKccaUBP25KqB7Q+JaqBRdaMBS54="
|
||||
- secure: "fUDAPAUUaaYZy8I4zU3SJ0JcK7aw4eb6eTdaEr7LyNyTMSfPgwY6P1MrbSQC0lJNQIUQ5ffjdxE5g7D7OYpoJF9L14ni4UY8t2QASt7kmpgcYihmjeuYy8FQXgmFG8CTxiWBPKTybZJ7voQcvIvRaNG7b2wM9PMfc5lRIondB6c="
|
||||
# These declarations set DATACORDER_USER and DATACORDER_PASSWORD
|
||||
- secure: "dpBH/dDN3bmU/NFlh+2v9isNx9wX0ocoRy+W+kBXRH32sosUGp26REhMqgVRpBNP5oxPBU8ic5bEogxAYWCB+0xUygBbkxAwyMPgoA34s0OXdTCY/ofw14ni8qqV2Ffy7fQJbP/jkMURyiMHx3kBTxNv3YjxKJqLnOuOMlQLpT8="
|
||||
- secure: "tLMRBD1Ufp5iKNwlqPDVbbuczgusaXNoBJyAnPATpJq2YwlkW4j3PqP9rW5vd85+52xam2EOP20w9PoBR5J6FLdiXRu4Lf7yCEhSHFAgowVqQj8QcJpPlyXr90bM4emFGrGqpdxVwxyQ5AFhKwLuEZKsI14GYLN+UMEwpNCMing="
|
||||
deploy:
|
||||
- provider: releases
|
||||
api_key:
|
||||
secure: "Wdt4Ccefo7a0ZDjEJQJgpghh7n72FtNJuKSAPUvoz4gtEX6Ct9J8yJI1t9V3jE3CTbbLJ21/Q6eZRDfT7UfNJe5DdepoJsP9DeFhKMWqQCq+AChqQWlm0KeZAffJoJreL8vXYhnRYcLT9ceZHEH6AqwN9TPV+xJziGPISAkYNZ8="
|
||||
secure: "q619+eQTe7lv8UVphK4OIzU8Jw84KBbVkuprN2sWIubRcV3IbZr2+WahJoUMt+nyhiy3YjDYtstO2ZgkxupwnZgwGUBVIiD1c4SPuyy+HTjNMOtiVsEUHT2hf+xPAemWpTlK5HcwhMmHAOh6rt6dEj57QOg0gcmGiwD/tCbEriA="
|
||||
skip_cleanup: true
|
||||
file_glob: true
|
||||
file: "/tmp/builds/*"
|
||||
@@ -73,33 +72,43 @@ matrix:
|
||||
apt:
|
||||
sources:
|
||||
- ubuntu-toolchain-r-test
|
||||
- sourceline: 'ppa:beineri/opt-qt571-trusty'
|
||||
- sourceline: 'ppa:beineri/opt-qt571-xenial'
|
||||
packages:
|
||||
- *global_deps
|
||||
- g++-5
|
||||
- os: linux
|
||||
env: CONFIGURATION="Debug" CC=gcc-8 CXX=g++-8
|
||||
env: CONFIGURATION="Debug" CC=gcc-9 CXX=g++-9
|
||||
addons:
|
||||
apt:
|
||||
sources:
|
||||
- ubuntu-toolchain-r-test
|
||||
- sourceline: 'ppa:beineri/opt-qt571-trusty'
|
||||
- sourceline: 'ppa:beineri/opt-qt571-xenial'
|
||||
packages:
|
||||
- g++-8
|
||||
- g++-9
|
||||
- *global_deps
|
||||
- os: linux
|
||||
env: CONFIGURATION="Debug" CC=clang-4.0 CXX=clang++-4.0 CMAKE_OPTIONS="-DCMAKE_EXPORT_COMPILE_COMMANDS=ON"
|
||||
env: CONFIGURATION="Debug" CC=clang-4.0 CXX=clang++-4.0 CMAKE_OPTIONS="-DCLANG_USE_LIBCXX=ON"
|
||||
addons:
|
||||
apt:
|
||||
sources:
|
||||
- ubuntu-toolchain-r-test
|
||||
- llvm-toolchain-trusty-4.0
|
||||
- sourceline: 'ppa:beineri/opt-qt571-trusty'
|
||||
- llvm-toolchain-xenial-8
|
||||
- sourceline: 'ppa:beineri/opt-qt571-xenial'
|
||||
packages:
|
||||
- *global_deps
|
||||
- clang-4.0
|
||||
- clang-tidy-4.0
|
||||
- libc++-dev
|
||||
- libc++abi-dev
|
||||
- os: linux
|
||||
env: CONFIGURATION="Debug" CC=clang-9 CXX=clang++-9 CMAKE_OPTIONS="-DCMAKE_EXPORT_COMPILE_COMMANDS=ON"
|
||||
addons:
|
||||
apt:
|
||||
sources:
|
||||
- ubuntu-toolchain-r-test
|
||||
- sourceline: 'ppa:beineri/opt-qt571-xenial'
|
||||
packages:
|
||||
- *global_deps
|
||||
- g++-9
|
||||
script:
|
||||
- ./ci/travis/script.sh
|
||||
- ./ci/travis/clang_tidy.sh
|
||||
@@ -117,32 +126,46 @@ matrix:
|
||||
apt:
|
||||
sources:
|
||||
- ubuntu-toolchain-r-test
|
||||
- sourceline: 'ppa:beineri/opt-qt571-trusty'
|
||||
- sourceline: 'ppa:beineri/opt-qt571-xenial'
|
||||
packages:
|
||||
- *global_deps
|
||||
- g++-5
|
||||
- os: linux
|
||||
env: CONFIGURATION="Release" CC=gcc-8 CXX=g++-8
|
||||
env: CONFIGURATION="Release" CC=gcc-9 CXX=g++-9
|
||||
addons:
|
||||
apt:
|
||||
sources:
|
||||
- ubuntu-toolchain-r-test
|
||||
- sourceline: 'ppa:beineri/opt-qt571-trusty'
|
||||
- sourceline: 'ppa:beineri/opt-qt571-xenial'
|
||||
packages:
|
||||
- g++-8
|
||||
- g++-9
|
||||
- *global_deps
|
||||
- os: linux
|
||||
env: CONFIGURATION="Release" CC=clang-4.0 CXX=clang++-4.0
|
||||
env: CONFIGURATION="Release" CC=clang-4.0 CXX=clang++-4.0 CMAKE_OPTIONS="-DCLANG_USE_LIBCXX=ON"
|
||||
addons:
|
||||
apt:
|
||||
sources:
|
||||
- ubuntu-toolchain-r-test
|
||||
- llvm-toolchain-trusty-4.0
|
||||
- sourceline: 'ppa:beineri/opt-qt571-trusty'
|
||||
- llvm-toolchain-xenial-8
|
||||
- sourceline: 'ppa:beineri/opt-qt571-xenial'
|
||||
packages:
|
||||
- *global_deps
|
||||
- clang-4.0
|
||||
- libc++-dev
|
||||
- libc++abi-dev
|
||||
- os: linux
|
||||
env: CONFIGURATION="Release" CC=clang-9 CXX=clang++-9 CMAKE_OPTIONS="-DCMAKE_EXPORT_COMPILE_COMMANDS=ON"
|
||||
addons:
|
||||
apt:
|
||||
sources:
|
||||
- ubuntu-toolchain-r-test
|
||||
- sourceline: 'ppa:beineri/opt-qt571-xenial'
|
||||
packages:
|
||||
- *global_deps
|
||||
- g++-9
|
||||
script:
|
||||
- ./ci/travis/script.sh
|
||||
- ./ci/travis/clang_tidy.sh
|
||||
- os: osx
|
||||
env: CONFIGURATION="Release"
|
||||
|
||||
@@ -150,14 +173,10 @@ matrix:
|
||||
env: CONFIGURATION="Release" CMAKE_TOOLSET=v141_xp CMAKE_GENERATOR="Visual Studio 15 2017"
|
||||
- os: windows
|
||||
env: CONFIGURATION="Release" CMAKE_TOOLSET="" CMAKE_GENERATOR="Ninja"
|
||||
# As long as Windows is still experimental on Travis CI, allow failures
|
||||
# There is a GCC compiler bug with MinGW that causes compilation failures on Windows at the moment
|
||||
allow_failures:
|
||||
- os: windows
|
||||
env: CONFIGURATION="Debug" CMAKE_TOOLSET=v141_xp CMAKE_GENERATOR="Visual Studio 15 2017"
|
||||
- os: windows
|
||||
env: CONFIGURATION="Debug" CMAKE_TOOLSET="" CMAKE_GENERATOR="Ninja"
|
||||
- os: windows
|
||||
env: CONFIGURATION="Release" CMAKE_TOOLSET=v141_xp CMAKE_GENERATOR="Visual Studio 15 2017"
|
||||
- os: windows
|
||||
env: CONFIGURATION="Release" CMAKE_TOOLSET="" CMAKE_GENERATOR="Ninja"
|
||||
fast_finish: true
|
||||
|
||||
@@ -1,29 +0,0 @@
|
||||
Original source (Freespace 2) by Volition, Inc.; see "credits.tbl"
|
||||
|
||||
Modifications by the FreeSpace Source Code Project (FSSCP)
|
||||
http://fs2source.warpcore.org
|
||||
|
||||
FS2_OPEN STAFF:
|
||||
|
||||
Project leader:
|
||||
Edward "Inquisitor" Gardner
|
||||
|
||||
Programmers:
|
||||
"Bobboau"
|
||||
Dennis "DTP" Pedersen
|
||||
Ian "Goober5000" Warfield
|
||||
Joe "Righteous1" Dowd
|
||||
Mike "penguin" Harris
|
||||
"Mysterial"
|
||||
"PhReAk"
|
||||
Thomas "Random Tiger" Whittaker
|
||||
Will "Unknown PLayer" Rousnel
|
||||
"WMCoolmon"
|
||||
|
||||
Web support:
|
||||
Icefire and the staff at Volitionwatch.com
|
||||
Alex "Thunder" Avery and the staff at Hard Light Productions
|
||||
|
||||
Special thanks to:
|
||||
Volition for making FS2 such a great game
|
||||
Dave Baranec for giving us the code and keeping us sanity checked
|
||||
@@ -0,0 +1,41 @@
|
||||
## FreeSpace
|
||||
FreeSpace: The Great War (Released 1998) and FreeSpace 2 (1999) are mission-based space combat simulators, like X-Wing/TIE Fighter and Wing Commander. Among the greatest games of the genre, they were also effectively the last.
|
||||
|
||||
The FreeSpace series follows humanity and their Vasudan allies as they fight to withstand the xenocidal, enigmatic Shivans, a species of unknown origin, vast technological capability, and seemingly limitless malice.
|
||||
|
||||
## FreeSpace Open
|
||||
Thanks to Volition's generosity, we've continued development of FreeSpace 2 as FreeSpace Open, building graphical enhancements to bring the original games up to modern standards, telling new stories set in the FreeSpace universe and original worlds, and creating spectacular total conversions that let players fly in the beloved universes of Babylon 5, Battlestar Galactica, Wing Commander, and Star Wars.
|
||||
|
||||
## Hard-Light Productions
|
||||
HLP is a fan community built on love and open-source code. We're dedicated to bringing modders together and giving them a place to share their own hard work and draw inspiration from the work of others. Thanks to Volition's generosity, we've continued development of FreeSpace 2 as FreeSpace Open, building graphical enhancements to bring the original games up to modern standards, telling new stories set in the FreeSpace universe and original worlds, and creating spectacular total conversions that let players fly in the beloved universes of Babylon 5, Battlestar Galactica, Wing Commander, and Star Wars.
|
||||
Find us at:
|
||||
- Our [website](http://www.hard-light.net/) and [forums](http://www.hard-light.net/forums/)
|
||||
- [Discord](https://discord.gg/YNVP3WR)
|
||||
- [Facebook](https://www.facebook.com/groups/Hardlightproductions/)
|
||||
- [Youtube](https://www.youtube.com/channel/UCxKkd609hDtY6yNetR1iT4w)
|
||||
- [Reddit](https://www.reddit.com/r/freespace/)
|
||||
- [Twitter](https://twitter.com/hardlightpro)
|
||||
- [IRC](irc://irc.esper.net/hard-light)
|
||||
|
||||
|
||||
## How to get the game
|
||||
FreeSpace Open requires a retail installation of FreeSpace 2, which is available at the following stores:
|
||||
- [GOG.com](https://www.gog.com/game/freespace_2)
|
||||
- [Steam](https://store.steampowered.com/app/273620/Freespace_2/)
|
||||
After installing retail FS2, use [Knossos](https://fsnebula.org/knossos/) to upgrade to the most recent release of FSO. Knossos is an advanced mod manager and launcher for FSO.
|
||||
|
||||
## Improvements
|
||||
The new open source game engine has several distingushing features including:
|
||||
- Linux and Mac OS X support
|
||||
- OpenGL support
|
||||
- OpenAL audio support
|
||||
- Easy mod installation
|
||||
- OGG support
|
||||
- Hardware transform, clipping, and lighting
|
||||
|
||||
## The FreeSpace Upgrade Project
|
||||
While the SCP improves the code of the game engine to enable new and exciting features, the FreeSpace Upgrade Project (FSU) creates material that takes advantage of the improved game engine.
|
||||
The FSU improves the ships, effects, and background elements of FreeSpace 2. Every now and then these improvements are released as a pack called MediaVPs. These assorted improvements enhance the graphics of the game.
|
||||
While the best way to experience the FSU is by playing the game with it, you can watch this [comparison video](https://www.youtube.com/watch?v=RM1YC_gK-qo) between 1999 and 2019 to have an idea of how much more beautiful FSU makes the game.
|
||||
|
||||
^(Much of this content was pulled from existing sources, such as InsaneBaron's "What Is Hard Light Productions" [thread](https://www.hard-light.net/forums/index.php?topic=86650.0), the Wiki's [Getting Started article](https://wiki.hard-light.net/index.php/Getting_started) and more.)
|
||||
@@ -0,0 +1,8 @@
|
||||
Original source (Freespace 2) by Volition, Inc.; see "`credits.tbl`"
|
||||
|
||||
Modifications by the FreeSpace 2 Source Code Project [(FSO SCP)](https://www.hard-light.net/forums/index.php?board=50.0)
|
||||
[Project Contributors](https://github.com/scp-fs2open/fs2open.github.com/graphs/contributors)
|
||||
|
||||
Special thanks to:
|
||||
Volition for making FS2 such a great game
|
||||
Dave Baranec for giving us the code and keeping us sanity checked
|
||||
+9
-1
@@ -10,7 +10,7 @@ endif()
|
||||
include(cmake/util.cmake)
|
||||
|
||||
# Set a few policies
|
||||
set_policy(CMP0051 OLD)
|
||||
set_policy(CMP0051 NEW)
|
||||
set_policy(CMP0053 NEW)
|
||||
set_policy(CMP0054 NEW)
|
||||
|
||||
@@ -117,6 +117,10 @@ option(FSO_INSTALL_DEBUG_FILES "Install some debug files (currently only PDB fil
|
||||
|
||||
option(ENABLE_COTIRE "Enable cotire for faster compilation. Enabled by default." ON)
|
||||
|
||||
option(FSO_RELEASE_LOGGING "Enable logging output for release builds" OFF)
|
||||
|
||||
OPTION(FSO_BUILD_WITH_FFMPEG "Enable the usage of FFmpeg for sound and custscenes" ON)
|
||||
|
||||
MARK_AS_ADVANCED(FORCE FSO_CMAKE_DEBUG)
|
||||
MARK_AS_ADVANCED(FORCE FSO_BUILD_INCLUDED_LIBS)
|
||||
MARK_AS_ADVANCED(FORCE FSO_USE_OPENALSOFT)
|
||||
@@ -125,6 +129,8 @@ MARK_AS_ADVANCED(FORCE FSO_DEVELOPMENT_MODE)
|
||||
MARK_AS_ADVANCED(FORCE FSO_FATAL_WARNINGS)
|
||||
mark_as_advanced(FORCE FSO_INSTALL_DEBUG_FILES)
|
||||
mark_as_advanced(FORCE ENABLE_COTIRE)
|
||||
mark_as_advanced(FORCE FSO_RELEASE_LOGGING)
|
||||
mark_as_advanced(FORCE FSO_BUILD_WITH_FFMPEG)
|
||||
|
||||
# Include cotire file from https://github.com/sakra/cotire/
|
||||
include(cotire)
|
||||
@@ -197,3 +203,5 @@ ENDIF()
|
||||
message(STATUS "Building FSO tools: ${FSO_BUILD_TOOLS}")
|
||||
message(STATUS "Building qtFRED: ${FSO_BUILD_QTFRED}")
|
||||
message(STATUS "Fatal warnings: ${FSO_FATAL_WARNINGS}")
|
||||
message(STATUS "Release logging: ${FSO_RELEASE_LOGGING}")
|
||||
message(STATUS "With FFmpeg: ${FSO_BUILD_WITH_FFMPEG}")
|
||||
+128
-19
@@ -1,23 +1,131 @@
|
||||
# Changelog
|
||||
All notable changes to this project will be documented in this file.
|
||||
|
||||
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).
|
||||
|
||||
## [19.0.0] - 2020-01-25 ([Thread](https://www.hard-light.net/forums/index.php?topic=96226.0))
|
||||
### Meta
|
||||
- With this release we decided to drop the "`3.Major_revision.Minor_revision`" versioning scheme in favor of a year based scheme since the Major and Minor versions did not have much meaning anymore. Instead the scheme will now be "`<year>.<number that is incremented every release>.0`". The last 0 is still there because some of our systems expect that. It will be gone at some point.
|
||||
### Added
|
||||
- Full Unicode text support: You can now use non-ASCII characters without having to worry about special fonts and special characters. This is an opt-in mod flag.
|
||||
- Translation features for making it easier to only distribute one version of a mod which includes all languages.
|
||||
- OpenAL Soft is included by default in binary distributions of FSO now.
|
||||
- System for dynamically adding new SEXPs. With this a Lua script can expose functionality to the mission which can be used exactly the same as a standard SEXP with all the usual editing features in FRED.
|
||||
- Support for displaying decals on the surface of an object.
|
||||
- Integrated support for the [Discord Rich Presence API](https://discordapp.com/rich-presence).
|
||||
- New markup based user interface system using [libRocket](https://github.com/libRocket/libRocket).
|
||||
### Changed
|
||||
- Exposed the movie player to the scripting API for advanced display features
|
||||
- Various OpenGL optimizations for better graphics performance:
|
||||
- Animations now use texture arrays
|
||||
- Model uniforms get sent to the GPU using uniform buffers for less overhead
|
||||
- Various other minor changes
|
||||
- Converted pilot files from custom binary format to JSON
|
||||
- Replaced Blinn-Phong BRDF with GGX BRDF
|
||||
### Fixed
|
||||
- Refactored bitmap slot handling and removed the fixed upper limit on the number of bitmaps. No more bmpman corruption!
|
||||
|
||||
## [3.8.0] - 2017-08-22 ([Release Thread](https://www.hard-light.net/forums/index.php?topic=93812.0))
|
||||
### Added
|
||||
- Support for APNG animations: [APNG](https://en.wikipedia.org/wiki/APNG) is a variant of the established PNG format which allows to store animations instead of single frames in a PNG file. This change allows to use these animation files in FSO which significantly improves usability for modders since they no longer have to store all individual frames as separate images.
|
||||
- Physically-Based Rendering (PBR): This upgrade of our rendering engine allows to use [PBR](https://en.wikipedia.org/wiki/Physically_based_rendering) assets to make models look more realistic and allow more artistic freedom for modders since they have more control over how a model looks. This also added support for HDR lighting which should improve the overall graphics experience.
|
||||
- Native particle systems: Particles have always been supported by FSO but the effects that could be created by them were very limited. There were some attempts to fix this by using Lua scripting for more advanced features but that suffered from performance issues. With these new particle systems that feature has been integrated directly into the engine which should improve performance and allow for better effects in the future.
|
||||
- TrueType Font support: [TrueType](https://en.wikipedia.org/wiki/TrueType) fonts improve the text rendering capabilities of FSO by allowing to use freely scaleable font faces instead of the previous bitmap fonts.
|
||||
### Changed
|
||||
- We now use SDL2 on all platforms: SDL is a library for abstracting away the differences between different platforms. We now use SDL2 for all platforms which reduces the amount of platform-specific code tremendously and should result in better usability on all platforms. This was a major change that has been in development for several years. Here are a few key features that were added:
|
||||
- Pilot and configuration data is now stored in the correct location across all platforms (this allows to run FSO on Windows from the Program Files directory without administrator rights)
|
||||
- All platforms now use the ini files for storing settings. This fixes a lot of issues with the registry on Windows.
|
||||
- Better support for input devices. Since SDL handles keyboard, mouse and joystick input we now have better support on newer OS versions. Note: This does not mean that we support multiple joysticks (yet). There is ongoing development effort to support this but this release does not have that yet.
|
||||
- CMake build system generation: This isn't relevant for players but we are now using [CMake](https://en.wikipedia.org/wiki/CMake) for handling compiling our builds. This improves cross-platform support and allows to implement advanced compilation features across multiple platforms. Modders will like the new "FastDebug" builds which are like the previous "Debug" builds but are compiled with all the optimizations of normal Release builds. That should make modding a lot easier since you can now debug your mod with almost the same performance as a Release build.
|
||||
- Improved shield effects: Rendering of the shields is now handled by special shaders which improves the overall quality of the effects and allows more freedom for future effects.
|
||||
- Use OpenGL Core Profile for rendering: This is another major graphical upgrade which adds support for the OpenGL Core profile across all platforms (this was also made possible by the SDL2 integration). This upgrade allows us to use more modern rendering techniques and is especially useful for our Linux users who use the open-source Mesa drivers since our shaders failed to compile with those drivers. Now everyone will be able to enjoy the new graphical features added in this and previous releases. This also made some internal changes to how we handle rendering which improves the usability of our rendering engine within our code.
|
||||
- Use FFmpeg for video & audio decoding: [FFmpeg](https://www.ffmpeg.org/) is a multi-media library which exposes functionality for decoding video and audio files to their raw form so that we can use that data. Thanks to this library we can now play 1080p cutscenes without any stuttering or frame-timing issues. It also allows to use more advanced audio and video codecs such as H.264 for video or Opus for audio.
|
||||
|
||||
|
||||
## [3.7.4] - 2016-07-04 ([Release thread](http://www.hard-light.net/forums/index.php?topic=92181.0))
|
||||
### Changed
|
||||
- Major graphics update including deferred lighting and shadows
|
||||
- Enhanced sound (up to 128 channels)
|
||||
### Fixed
|
||||
- "Tons" of bugfixes
|
||||
|
||||
## [3.7.2] - 2015-04-23 ([Release thread](http://www.hard-light.net/forums/index.php?topic=89597.0))
|
||||
### Added
|
||||
- MediaVPS 2014 Support
|
||||
- Autospread on model point shields
|
||||
- WebUI based multiplayer standalone server (for non-Windows platforms)
|
||||
- Toggle subsytem scanning, scannable, cargo revealed, hidden from sensors, stealth and friendly stealth added to the `alter-ship-flag` SEXP
|
||||
- Support added to add more languages besides English, French, German and Polish, leading the way to better localization!
|
||||
- `player-is-cheating` SEXP
|
||||
- New ship flag to enable smarter AI use of afterburners. Now it can use them while flying waypoints or attacking capital ships (use the `free-afterburner-use` flag with `alter-ship-flag`)
|
||||
- Experimental configurations to make AVX builds (see [this post](http://www.hard-light.net/forums/index.php?topic=85566.0) for more explanations)
|
||||
- Frame profiling code, see what exactly is slowing down FreeSpace. (Mostly for devs or coders)
|
||||
### Changed
|
||||
- Unstretched interface screens
|
||||
- Automatically non stretched HUD gauges and simpler modder options for placing HUD gauges
|
||||
- `show-subtitle-text` can now display messages as well as raw text
|
||||
- Allow a user-specified number of credit images
|
||||
- event.log can now snapshot events checked in a frame and record the status of an event the previous time it was checked as well as the current state
|
||||
- Allow the specification of the positions of medals, callsigns and labels on the medal screen.
|
||||
- The number of medals is now dynamic!
|
||||
- `is-facing` now works for things that aren't ships (like waypoints!)
|
||||
- allowing `fade-in` and `fade-out` sexps to use any color, not just black, white and red.
|
||||
|
||||
|
||||
## [3.7.0] - 2013-08-31 ([Release thread](http://www.hard-light.net/forums/index.php?topic=85435.0))
|
||||
### Major Change
|
||||
- New Flexible Pilot Save File Code (combines single/multi pilots & allows safe switching between unfinished campaigns)
|
||||
### Changed
|
||||
- Raised the per-model debris limit to 48 (previously 32).
|
||||
- Increased the per-frame debris limit to 96 (previously 64)
|
||||
|
||||
## [3.6.18] - 2013-03-01 ([Release thread](http://www.hard-light.net/forums/index.php?topic=83889.0))
|
||||
### Fixed
|
||||
- Critical damage bug which caused heavy balance issues in the game
|
||||
|
||||
## [3.6.16] - 2013-01-31 ([Release thread](http://www.hard-light.net/forums/index.php?topic=83577.0))
|
||||
### Added
|
||||
- Diaspora TC support
|
||||
### Changed
|
||||
- Performance Improvements
|
||||
|
||||
## [3.6.14] - 2012-10-23 - ([Release thread](https://www.hard-light.net/forums/index.php?topic=82648.0))
|
||||
### Added
|
||||
- Objecttype tables support for deciding how enemies respond to ship classes when disabled
|
||||
- Allow modders to set a [mood](http://www.hard-light.net/forums/index.php?topic=81991.msg1639770#msg1639770) for builtin messages and then switch the mood for the mission on the fly using a SEXP
|
||||
- Allow modders to set the chance of builtin messages being sent, how many will be sent per mission and how long is the delay between two messages
|
||||
- Allow campaigns to be hidden in the campaign and tech rooms ([Game settings.tbl](https://wiki.hard-light.net/index.php/Game_settings.tbl#.23Ignored_Campaign_File_Names))
|
||||
- Allow mods to set a default campaign ([Game settings.tbl](https://wiki.hard-light.net/index.php/Game_settings.tbl#.24Default_Campaign_File_Name:))
|
||||
- New SEXPs
|
||||
- `set-player-orders`
|
||||
- `is-event\goal-true\false-msecs-delay`
|
||||
- `get\set-num-countermeasures`
|
||||
- `directive-value`
|
||||
- `invalidate-all-arguments`
|
||||
- `validate-all-arguments`
|
||||
- `has-primary-weapon`
|
||||
- `has-secondary-weapon`
|
||||
- [`hud-display-gauge`](http://www.hard-light.net/forums/index.php?topic=68837.msg1361711#msg1361711)
|
||||
- `get-object-speed-x`
|
||||
- `get-object-speed-y`
|
||||
- `get-object-speed-z`
|
||||
### Changed
|
||||
- Major HUD gauges overhaul
|
||||
- Split the Locked flag so that you can lock Ships or Weapons on the game loadout screen independently
|
||||
- Mixed ammo for primary and secondary weapons - [`$Substitute`](http://www.hard-light.net/wiki/index.php/Weapons.tbl#.24Substitute:) - Allows you to have a weapon that fires other weapon ammo in a specific pattern (say a Gatling gun with tracers).
|
||||
- [`show-subtitle`](https://wiki.hard-light.net/index.php/SCP_SEXPs#show-subtitle) SEXP supports custom fonts
|
||||
- The active support ship limit per side is now dynamic. See [`set-support-ship`](https://wiki.hard-light.net/index.php/SCP_SEXPs#set-support-ship) for more info.
|
||||
### Fixed
|
||||
- Various multiplayer SEXP fixes
|
||||
- `rotating-subsys-set-time` now accelerates properly
|
||||
- [Fixed a whole heap of memory, logic and coding errors](http://www.hard-light.net/forums/index.php?topic=78044.0) -- using PVS-Studio: C/C++ source code analysis and checking tool
|
||||
|
||||
----
|
||||
|
||||
## [Older Changes] - Unformatted
|
||||
```
|
||||
ChangeLog for fs2_open. All times are UTC.
|
||||
|
||||
Features: September 2013
|
||||
http://www.hard-light.net/forums/index.php?topic=85700.0
|
||||
|
||||
- show-subtitle-text can now display messages as well as raw text - Goober5000
|
||||
- toggle subsytem scanning, scannable, cargo revealed, hidden from sensors, stealth and friendly stealth added to the alter-ship-flag sexp - karajorma
|
||||
- Support added to add more languages besides English, French, German and Polish, leading the way to better localization! - karajorma
|
||||
- event.log can now snapshot events checked in a frame and record the status of an event the previous time it was checked as well as the current state - karajorma
|
||||
- added a player-is-cheating sexp - The E
|
||||
- allow a user-specified number of credit images - Goober5000
|
||||
- allow the specification of the positions of medals, callsigns and labels on the medal screen. - Goober5000
|
||||
- lua function to check if a ship is warp capable, and access to a ship's auto-aim FOV - zookeeper
|
||||
- is-facing now works for things that aren't ships (like waypoints!) - zookeeper
|
||||
- experimental configurations to make AVX builds (see this post for more explainations) - The E
|
||||
- new ship flag to enable smarter AI use of afterburners. Now it can use them while flying waypoints or attacking capital ships (use the free-afterburner-use flag with alter-ship-flag) - Admiral MS
|
||||
- the number of medals is now dynamic! - Goober5000
|
||||
- frame profiling code, see what exactly is slowing down FreeSpace. (Mostly for devs or coders) - Swifty + The E
|
||||
- allowing fade-in and fade-out sexps to use any color, not just black, white and red. - Goober5000
|
||||
|
||||
==================================================================
|
||||
( massive gap in updates, maybe this will be filled in someday...)
|
||||
==================================================================
|
||||
@@ -351,7 +459,7 @@ http://www.hard-light.net/forums/index.php?topic=85700.0
|
||||
(2.1.2.4), weapon/weapons.cpp (2.1.2.2):
|
||||
|
||||
Sorted out some bits and pieces. The background nebula blends now
|
||||
which is nice. – RT
|
||||
which is nice. – RT
|
||||
|
||||
2002-09-28 12:20 randomtiger
|
||||
|
||||
@@ -1886,3 +1994,4 @@ NOTE:
|
||||
|
||||
# generated by cvs2cl.pl
|
||||
# cvs2cl.pl -r -S --utc -f ChangeLog2
|
||||
```
|
||||
@@ -1,14 +1,15 @@
|
||||
Volition Copyright (applies to original FreeSpace2 source code
|
||||
developed and released by Volition):
|
||||
|
||||
"Copyright (C) Volition, Inc. 1999. All rights reserved.
|
||||
|
||||
All source code herein is the property of Volition, Inc. You may not
|
||||
>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."
|
||||
created based on the source.
|
||||
|
||||
|
||||
Modifications by members of the FreeSpace Source Code Project are
|
||||
released under whatever terms the individual authors choose, but the
|
||||
above notice continues to apply to all fs2_open code.
|
||||
|
||||
See [**Licensing**](https://github.com/scp-fs2open/fs2open.github.com/wiki/Licensing) for more information.
|
||||
Binary file not shown.
@@ -1,29 +0,0 @@
|
||||
This is still in pretty rough form.
|
||||
|
||||
|
||||
=== for people building fs2_open:
|
||||
|
||||
Win32-MSVC:
|
||||
Use the Freespace2.dsw workspace and build within the IDE.
|
||||
|
||||
|
||||
Win32-MinGW:
|
||||
make
|
||||
|
||||
|
||||
Linux and other unix variants (NOT YET COMPLETE)
|
||||
./configure [options]
|
||||
make
|
||||
|
||||
|
||||
|
||||
=== for the project maintainers (people who need to
|
||||
=== keep the makefiles up to date) and those building
|
||||
=== from CVS:
|
||||
|
||||
./autogen.sh (should only has to be done once)
|
||||
./configure [options]
|
||||
make
|
||||
|
||||
automake v1.6.1+ and
|
||||
autoconf v2.54+ are required
|
||||
@@ -7,36 +7,5 @@ FreeSpace2 *S*ource *C*ode *P*roject
|
||||
Building
|
||||
--
|
||||
Before you do anything, make sure you have updated your git submodules, either by running `git submodule update --init --recursive` or by cloning the repository with the `--recursive` flag.<br/>
|
||||
<br/>
|
||||
For building you will need [CMake](http://www.cmake.org/cmake/resources/software.html). Version 3.4 is required. Once you have installed CMake you should create a build directory where the project/make files should be created, **do not create them inside the source tree!**<br>
|
||||
<br>
|
||||
On Windows you can use the `cmake-gui` executable to get a nice GUI, on Unix just use `cmake`. Use the newly created directory as build directory (change to this directory on Unix) and run cmake. On Windows this can be done by clicking the `Configure` button. Choose your compiler version and hit `Generate` when configuring is done. <br>
|
||||
Depending on the makefile generator used build the `all` or `ALL_BUILD` target to compile the project.<br>
|
||||
|
||||
### Available variables to control the build
|
||||
* `FSO_BUILD_WXFRED2`: Build the wxfred2 project, requires wxWidgets
|
||||
* `FSO_FREESPACE_PATH`: Sets the path of your FreeSpace install, can be used to automatically run the generated executables with the correct working directory, this is an optional variable. By default this will use the value of the `FS2PATH` environment variable.
|
||||
* `FSO_BUILD_TOOLS`: Build some tools related to FSO
|
||||
* `CMAKE_BUILD_TYPE`: Sets the binary build type between `Debug` and `Release` (default)
|
||||
|
||||
#### Windows only variables
|
||||
* `FSO_BUILD_FRED2`: Build FRED2, requires a Visual Studio version that ships with MFC
|
||||
* `FSO_USE_SPEECH`: Build a binary with text-to-speech support
|
||||
* `FSO_USE_VOICEREC`: Build a binary with voice recognition support
|
||||
|
||||
#### Advanced variables
|
||||
You should only use these variables if you know what you're doing
|
||||
* `FSO_CMAKE_DEBUG`: Print CMake debugging informations
|
||||
* `FSO_BUILD_INCLUDED_LIBS`: Build libraries from the included source
|
||||
* `FSO_USE_OPENALSOFT`: Use [OpenALSoft](http://kcat.strangesoft.net/openal.html) for OpenAL support
|
||||
* `FSO_USE_LUAJIT`: Use [luajit](http://luajit.org/) as a replacement for lua
|
||||
* `FSO_DEVELOPMENT_MODE`: Toggles some development behavior, only use if you really need it.
|
||||
* `FSO_RUN_ARGUMENTS`: If you run an executable from within the project, these arguments will also be passed to the executable
|
||||
* `FSO_BUILD_POSTFIX`: Sets a postfix to be added to the executable name, may be useful for release candidates.
|
||||
|
||||
#### Visual Studio specific variables
|
||||
* `MSVC_USE_RUNTIME_DLL`: Use the DLL version of the runtime, experimental and not well tested.
|
||||
* `MSVC_SIMD_INSTRUCTIONS`: The instruction set the executables will be optimized for.
|
||||
|
||||
### Generating an installation package
|
||||
CMake can automatically generate installation packages of the project. To do this you will just need to run the `package` target of the build system and the package will be placed inside your build directory. On Windows you will have to install [NSIS](http://nsis.sourceforge.net/Main_Page) to use this.
|
||||
The main instructions for building can be found at our github wiki, on the [Building](https://github.com/scp-fs2open/fs2open.github.com/wiki/Building) page.
|
||||
@@ -0,0 +1,18 @@
|
||||
#Updating Documentation
|
||||
####The goal of this file is simply to offer a comprehensive checklist of things we must check when updating the documentation.
|
||||
|
||||
1. Changelog:
|
||||
- Is [Changelog.md](https://github.com/scp-fs2open/fs2open.github.com/blob/master/Changelog.md) up-to-date with the latest release?
|
||||
- Is it in the proper [Keep a Changelog](https://keepachangelog.com/en/1.0.0/) format?
|
||||
2. Build instructions:
|
||||
- If a programmer who never built FSO before read the build instruction at [Readme.md](https://github.com/scp-fs2open/fs2open.github.com/blob/master/Readme.md), would they manage to build FSO?
|
||||
- Is the information in the file up-to-date regarding other matters (such as versions of tools mentioned, links to other guides, etc.)?
|
||||
- Is the information in the [Building](https://github.com/scp-fs2open/fs2open.github.com/wiki/Building) article, and its sub-articles, still up-to-date?
|
||||
3. Forums:
|
||||
- Does the [Forum](https://www.hard-light.net/forums/index.php?board=50.0) contain enough clear information to help a new developer find their way into the up-to-date instructions?
|
||||
- Is there anything that might mislead a new developer to stumble onto old tools, dead links and/or old versions of the project?
|
||||
4. General documentation files:
|
||||
- Is the information in the following files up-to-date?
|
||||
- [About.md](https://github.com/scp-fs2open/fs2open.github.com/blob/master/About.md) (Should contain general information about FS, FS2, HLP, FSO and FSU)
|
||||
- [Authors.md](https://github.com/scp-fs2open/fs2open.github.com/blob/master/Authors.md) (Should contain information about the original developers, a way to see FSO's contributors, and special thanks to Volition and Dave Baranec)
|
||||
- [Copying.md](https://github.com/scp-fs2open/fs2open.github.com/blob/master/Copying.md) (Should contain Volition's Copyright terms and a way to check FSO's Licensing info)
|
||||
+13
-15
@@ -24,7 +24,7 @@ test_script:
|
||||
deploy:
|
||||
- provider: GitHub
|
||||
auth_token:
|
||||
secure: 3kV4efHXwRnfXzmJPRAOs8D7+MhwXUXYeayI/P5y114L09kJa6b6L70beXdW7yYr
|
||||
secure: h55Scpy+3vmo1Yb7WlSIGA4d9DRnsbzUYc2LYsQdByQHZHbqrqjBpicH0D2FFLEO
|
||||
on:
|
||||
ReleaseBuild: true # deploy on release push only
|
||||
|
||||
@@ -40,25 +40,23 @@ deploy:
|
||||
NightlyBuild: true # deploy on nightly push only
|
||||
|
||||
- provider: FTP
|
||||
protocol: ftp
|
||||
host: swc.fs2downloads.com
|
||||
username:
|
||||
secure: EXg2ADoKzMduZF90ip2Q0g==
|
||||
protocol: sftp
|
||||
host: porphyrion.feralhosting.com
|
||||
username:
|
||||
secure: 36+bVD8eJgI0BVbi7TZ4zQ==
|
||||
password:
|
||||
secure: x0LL0uY9yBAQ7JTARhQ6AA==
|
||||
folder: swc.fs2downloads.com/builds/nightly/$(VersionName)
|
||||
beta: true
|
||||
secure: CrzmDVca8AGG08iWPA1gOD4Ge06+wJ3rcBagBGclwYQ=
|
||||
folder: www/datacorder.porphyrion.feralhosting.com/public_html/builds/nightly/$(VersionName)
|
||||
on:
|
||||
NightlyBuild: true # deploy on nightly push only
|
||||
|
||||
- provider: FTP
|
||||
protocol: ftp
|
||||
host: swc.fs2downloads.com
|
||||
username:
|
||||
secure: EXg2ADoKzMduZF90ip2Q0g==
|
||||
protocol: sftp
|
||||
host: porphyrion.feralhosting.com
|
||||
username:
|
||||
secure: 36+bVD8eJgI0BVbi7TZ4zQ==
|
||||
password:
|
||||
secure: x0LL0uY9yBAQ7JTARhQ6AA==
|
||||
folder: swc.fs2downloads.com/builds/test/$(VersionName)
|
||||
beta: true
|
||||
secure: CrzmDVca8AGG08iWPA1gOD4Ge06+wJ3rcBagBGclwYQ=
|
||||
folder: www/datacorder.porphyrion.feralhosting.com/public_html/builds/test/$(VersionName)
|
||||
on:
|
||||
TestBuild: true # deploy on test build push only
|
||||
@@ -134,6 +134,7 @@ if ($DeployBuild) {
|
||||
cmake -DCMAKE_INSTALL_PREFIX="$env:APPVEYOR_BUILD_FOLDER/../install" -DFSO_USE_SPEECH="ON" `
|
||||
-DFSO_USE_VOICEREC="ON" -DMSVC_SIMD_INSTRUCTIONS="$($buildConfig.SimdType)" `
|
||||
-DQT5_INSTALL_ROOT="$($buildConfig.QtDir)" -DFSO_BUILD_QTFRED=ON `
|
||||
-DFSO_INSTALL_DEBUG_FILES="ON" `
|
||||
-G "$($buildConfig.Generator)" -T "$($buildConfig.Toolset)" ..
|
||||
|
||||
$Configs = @("Release", "FastDebug")
|
||||
@@ -145,8 +146,11 @@ if ($DeployBuild) {
|
||||
}
|
||||
}
|
||||
|
||||
7z a "$($PackageName)-builds-$($buildConfig.PackageType).zip" "$env:APPVEYOR_BUILD_FOLDER/../install/*"
|
||||
7z a -xr'!*.pdb' "$($PackageName)-builds-$($buildConfig.PackageType).zip" "$env:APPVEYOR_BUILD_FOLDER/../install/*"
|
||||
Push-AppveyorArtifact "$($PackageName)-builds-$($buildConfig.PackageType).zip"
|
||||
|
||||
7z a "$($PackageName)-debug-$($buildConfig.PackageType).7z" "$env:APPVEYOR_BUILD_FOLDER/../install/*.pdb"
|
||||
Push-AppveyorArtifact "$($PackageName)-debug-$($buildConfig.PackageType).7z"
|
||||
} else {
|
||||
cmake -DFSO_USE_SPEECH="ON" -DFSO_FATAL_WARNINGS="ON" -DFSO_USE_VOICEREC="ON" -DFSO_BUILD_TESTS="ON" -DMSVC_SIMD_INSTRUCTIONS=SSE2 `
|
||||
-DFSO_BUILD_QTFRED=ON -DQT5_INSTALL_ROOT="$env:QT_DIR" -DFSO_BUILD_FRED2="ON" `
|
||||
|
||||
@@ -3,8 +3,14 @@
|
||||
set -ex
|
||||
|
||||
if [ "$TRAVIS_OS_NAME" = "linux" ]; then
|
||||
# Nothing to do here
|
||||
:
|
||||
export DEBIAN_FRONTEND=noninteractive
|
||||
|
||||
sudo add-apt-repository -y "ppa:msulikowski/valgrind" # For fixing a bug with valgrind 3.11 which does not recognize the rdrand instruction
|
||||
|
||||
wget -O - https://apt.llvm.org/llvm-snapshot.gpg.key|sudo apt-key add -
|
||||
sudo add-apt-repository -y 'deb http://apt.llvm.org/xenial/ llvm-toolchain-xenial-9 main'
|
||||
|
||||
sudo apt-get -yq update
|
||||
elif [ "$TRAVIS_OS_NAME" = "osx" ]; then
|
||||
# Nothing to do here
|
||||
:
|
||||
|
||||
@@ -18,10 +18,6 @@ if [ "$TRAVIS_OS_NAME" = "linux" ]; then
|
||||
CXXFLAGS="-m64 -mtune=generic -mfpmath=sse -msse -msse2 -pipe -Wno-unknown-pragmas"
|
||||
CFLAGS="-m64 -mtune=generic -mfpmath=sse -msse -msse2 -pipe -Wno-unknown-pragmas"
|
||||
|
||||
if [[ "$CC" =~ ^clang.*$ ]]; then
|
||||
CXXFLAGS="$CXXFLAGS -stdlib=libc++"
|
||||
fi
|
||||
|
||||
export CXXFLAGS
|
||||
export CFLAGS
|
||||
CMAKE="cmake -G Ninja -DFSO_FATAL_WARNINGS=ON $CMAKE_OPTIONS"
|
||||
|
||||
+226
-99
@@ -2,10 +2,9 @@
|
||||
#
|
||||
#===- clang-tidy-diff.py - ClangTidy Diff Checker ------------*- python -*--===#
|
||||
#
|
||||
# The LLVM Compiler Infrastructure
|
||||
#
|
||||
# This file is distributed under the University of Illinois Open Source
|
||||
# License. See LICENSE.TXT for details.
|
||||
# Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
|
||||
# See https://llvm.org/LICENSE.txt for license information.
|
||||
# SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
|
||||
#
|
||||
#===------------------------------------------------------------------------===#
|
||||
|
||||
@@ -25,117 +24,245 @@ Example usage for git/svn users:
|
||||
"""
|
||||
|
||||
import argparse
|
||||
import glob
|
||||
import json
|
||||
import multiprocessing
|
||||
import os
|
||||
import re
|
||||
import shutil
|
||||
import subprocess
|
||||
import sys
|
||||
import tempfile
|
||||
import threading
|
||||
import traceback
|
||||
|
||||
try:
|
||||
import yaml
|
||||
except ImportError:
|
||||
yaml = None
|
||||
|
||||
is_py2 = sys.version[0] == '2'
|
||||
|
||||
if is_py2:
|
||||
import Queue as queue
|
||||
else:
|
||||
import queue as queue
|
||||
|
||||
|
||||
def run_tidy(task_queue, lock, timeout):
|
||||
watchdog = None
|
||||
while True:
|
||||
command = task_queue.get()
|
||||
try:
|
||||
proc = subprocess.Popen(command,
|
||||
stdout=subprocess.PIPE,
|
||||
stderr=subprocess.PIPE)
|
||||
|
||||
if timeout is not None:
|
||||
watchdog = threading.Timer(timeout, proc.kill)
|
||||
watchdog.start()
|
||||
|
||||
stdout, stderr = proc.communicate()
|
||||
|
||||
with lock:
|
||||
sys.stdout.write(stdout.decode('utf-8'))
|
||||
sys.stdout.flush()
|
||||
if stderr:
|
||||
sys.stderr.write(stderr.decode('utf-8'))
|
||||
sys.stderr.flush()
|
||||
except Exception as e:
|
||||
with lock:
|
||||
sys.stderr.write('Failed: ' + str(e) + ': '.join(command) + '\n')
|
||||
finally:
|
||||
with lock:
|
||||
if (not timeout is None) and (not watchdog is None):
|
||||
if not watchdog.is_alive():
|
||||
sys.stderr.write('Terminated by timeout: ' +
|
||||
' '.join(command) + '\n')
|
||||
watchdog.cancel()
|
||||
task_queue.task_done()
|
||||
|
||||
|
||||
def start_workers(max_tasks, tidy_caller, task_queue, lock, timeout):
|
||||
for _ in range(max_tasks):
|
||||
t = threading.Thread(target=tidy_caller, args=(task_queue, lock, timeout))
|
||||
t.daemon = True
|
||||
t.start()
|
||||
|
||||
def merge_replacement_files(tmpdir, mergefile):
|
||||
"""Merge all replacement files in a directory into a single file"""
|
||||
# The fixes suggested by clang-tidy >= 4.0.0 are given under
|
||||
# the top level key 'Diagnostics' in the output yaml files
|
||||
mergekey = "Diagnostics"
|
||||
merged = []
|
||||
for replacefile in glob.iglob(os.path.join(tmpdir, '*.yaml')):
|
||||
content = yaml.safe_load(open(replacefile, 'r'))
|
||||
if not content:
|
||||
continue # Skip empty files.
|
||||
merged.extend(content.get(mergekey, []))
|
||||
|
||||
if merged:
|
||||
# MainSourceFile: The key is required by the definition inside
|
||||
# include/clang/Tooling/ReplacementsYaml.h, but the value
|
||||
# is actually never used inside clang-apply-replacements,
|
||||
# so we set it to '' here.
|
||||
output = { 'MainSourceFile': '', mergekey: merged }
|
||||
with open(mergefile, 'w') as out:
|
||||
yaml.safe_dump(output, out)
|
||||
else:
|
||||
# Empty the file:
|
||||
open(mergefile, 'w').close()
|
||||
|
||||
|
||||
def main():
|
||||
parser = argparse.ArgumentParser(description=
|
||||
'Run clang-tidy against changed files, and '
|
||||
'output diagnostics only for modified '
|
||||
'lines.')
|
||||
parser.add_argument('-clang-tidy-binary', metavar='PATH',
|
||||
default='clang-tidy',
|
||||
help='path to clang-tidy binary')
|
||||
parser.add_argument('-p', metavar='NUM', default=0,
|
||||
help='strip the smallest prefix containing P slashes')
|
||||
parser.add_argument('-regex', metavar='PATTERN', default=None,
|
||||
help='custom pattern selecting file paths to check '
|
||||
'(case sensitive, overrides -iregex)')
|
||||
parser.add_argument('-iregex', metavar='PATTERN', default=
|
||||
r'.*\.(cpp|cc|c\+\+|cxx|c|cl|h|hpp|m|mm|inc)',
|
||||
help='custom pattern selecting file paths to check '
|
||||
'(case insensitive, overridden by -regex)')
|
||||
parser = argparse.ArgumentParser(description=
|
||||
'Run clang-tidy against changed files, and '
|
||||
'output diagnostics only for modified '
|
||||
'lines.')
|
||||
parser.add_argument('-clang-tidy-binary', metavar='PATH',
|
||||
default='clang-tidy',
|
||||
help='path to clang-tidy binary')
|
||||
parser.add_argument('-p', metavar='NUM', default=0,
|
||||
help='strip the smallest prefix containing P slashes')
|
||||
parser.add_argument('-regex', metavar='PATTERN', default=None,
|
||||
help='custom pattern selecting file paths to check '
|
||||
'(case sensitive, overrides -iregex)')
|
||||
parser.add_argument('-iregex', metavar='PATTERN', default=
|
||||
r'.*\.(cpp|cc|c\+\+|cxx|c|cl|h|hpp|m|mm|inc)',
|
||||
help='custom pattern selecting file paths to check '
|
||||
'(case insensitive, overridden by -regex)')
|
||||
parser.add_argument('-j', type=int, default=1,
|
||||
help='number of tidy instances to be run in parallel.')
|
||||
parser.add_argument('-timeout', type=int, default=None,
|
||||
help='timeout per each file in seconds.')
|
||||
parser.add_argument('-fix', action='store_true', default=False,
|
||||
help='apply suggested fixes')
|
||||
parser.add_argument('-checks',
|
||||
help='checks filter, when not specified, use clang-tidy '
|
||||
'default',
|
||||
default='')
|
||||
parser.add_argument('-path', dest='build_path',
|
||||
help='Path used to read a compile command database.')
|
||||
if yaml:
|
||||
parser.add_argument('-export-fixes', metavar='FILE', dest='export_fixes',
|
||||
help='Create a yaml file to store suggested fixes in, '
|
||||
'which can be applied with clang-apply-replacements.')
|
||||
parser.add_argument('-extra-arg', dest='extra_arg',
|
||||
action='append', default=[],
|
||||
help='Additional argument to append to the compiler '
|
||||
'command line.')
|
||||
parser.add_argument('-extra-arg-before', dest='extra_arg_before',
|
||||
action='append', default=[],
|
||||
help='Additional argument to prepend to the compiler '
|
||||
'command line.')
|
||||
parser.add_argument('-quiet', action='store_true', default=False,
|
||||
help='Run clang-tidy in quiet mode')
|
||||
clang_tidy_args = []
|
||||
argv = sys.argv[1:]
|
||||
if '--' in argv:
|
||||
clang_tidy_args.extend(argv[argv.index('--'):])
|
||||
argv = argv[:argv.index('--')]
|
||||
|
||||
parser.add_argument('-fix', action='store_true', default=False,
|
||||
help='apply suggested fixes')
|
||||
parser.add_argument('-checks',
|
||||
help='checks filter, when not specified, use clang-tidy '
|
||||
'default',
|
||||
default='')
|
||||
parser.add_argument('-path', dest='build_path',
|
||||
help='Path used to read a compile command database.')
|
||||
parser.add_argument('-extra-arg', dest='extra_arg',
|
||||
action='append', default=[],
|
||||
help='Additional argument to append to the compiler '
|
||||
'command line.')
|
||||
parser.add_argument('-extra-arg-before', dest='extra_arg_before',
|
||||
action='append', default=[],
|
||||
help='Additional argument to prepend to the compiler '
|
||||
'command line.')
|
||||
parser.add_argument('-quiet', action='store_true', default=False,
|
||||
help='Run clang-tidy in quiet mode')
|
||||
clang_tidy_args = []
|
||||
argv = sys.argv[1:]
|
||||
if '--' in argv:
|
||||
clang_tidy_args.extend(argv[argv.index('--'):])
|
||||
argv = argv[:argv.index('--')]
|
||||
args = parser.parse_args(argv)
|
||||
|
||||
args = parser.parse_args(argv)
|
||||
# Extract changed lines for each file.
|
||||
filename = None
|
||||
lines_by_file = {}
|
||||
for line in sys.stdin:
|
||||
match = re.search('^\+\+\+\ \"?(.*?/){%s}([^ \t\n\"]*)' % args.p, line)
|
||||
if match:
|
||||
filename = match.group(2)
|
||||
if filename is None:
|
||||
continue
|
||||
|
||||
# Extract changed lines for each file.
|
||||
filename = None
|
||||
lines_by_file = {}
|
||||
for line in sys.stdin:
|
||||
match = re.search('^\+\+\+\ \"?(.*?/){%s}([^ \t\n\"]*)' % args.p, line)
|
||||
if match:
|
||||
filename = match.group(2)
|
||||
if filename == None:
|
||||
continue
|
||||
if args.regex is not None:
|
||||
if not re.match('^%s$' % args.regex, filename):
|
||||
continue
|
||||
else:
|
||||
if not re.match('^%s$' % args.iregex, filename, re.IGNORECASE):
|
||||
continue
|
||||
|
||||
if args.regex is not None:
|
||||
if not re.match('^%s$' % args.regex, filename):
|
||||
continue
|
||||
else:
|
||||
if not re.match('^%s$' % args.iregex, filename, re.IGNORECASE):
|
||||
continue
|
||||
match = re.search('^@@.*\+(\d+)(,(\d+))?', line)
|
||||
if match:
|
||||
start_line = int(match.group(1))
|
||||
line_count = 1
|
||||
if match.group(3):
|
||||
line_count = int(match.group(3))
|
||||
if line_count == 0:
|
||||
continue
|
||||
end_line = start_line + line_count - 1
|
||||
lines_by_file.setdefault(filename, []).append([start_line, end_line])
|
||||
|
||||
match = re.search('^@@.*\+(\d+)(,(\d+))?', line)
|
||||
if match:
|
||||
start_line = int(match.group(1))
|
||||
line_count = 1
|
||||
if match.group(3):
|
||||
line_count = int(match.group(3))
|
||||
if line_count == 0:
|
||||
continue
|
||||
end_line = start_line + line_count - 1;
|
||||
lines_by_file.setdefault(filename, []).append([start_line, end_line])
|
||||
if not any(lines_by_file):
|
||||
print("No relevant changes found.")
|
||||
sys.exit(0)
|
||||
|
||||
if len(lines_by_file) == 0:
|
||||
print("No relevant changes found.")
|
||||
sys.exit(0)
|
||||
max_task_count = args.j
|
||||
if max_task_count == 0:
|
||||
max_task_count = multiprocessing.cpu_count()
|
||||
max_task_count = min(len(lines_by_file), max_task_count)
|
||||
|
||||
line_filter_json = json.dumps(
|
||||
[{"name" : name, "lines" : lines_by_file[name]} for name in lines_by_file],
|
||||
separators = (',', ':'))
|
||||
tmpdir = None
|
||||
if yaml and args.export_fixes:
|
||||
tmpdir = tempfile.mkdtemp()
|
||||
|
||||
quote = "";
|
||||
if sys.platform == 'win32':
|
||||
line_filter_json=re.sub(r'"', r'"""', line_filter_json)
|
||||
else:
|
||||
quote = "'";
|
||||
# Tasks for clang-tidy.
|
||||
task_queue = queue.Queue(max_task_count)
|
||||
# A lock for console output.
|
||||
lock = threading.Lock()
|
||||
|
||||
# Run clang-tidy on files containing changes.
|
||||
command = [args.clang_tidy_binary]
|
||||
command.append('-line-filter=' + quote + line_filter_json + quote)
|
||||
if args.fix:
|
||||
command.append('-fix')
|
||||
if args.checks != '':
|
||||
command.append('-checks=' + quote + args.checks + quote)
|
||||
if args.quiet:
|
||||
command.append('-quiet')
|
||||
if args.build_path is not None:
|
||||
command.append('-p=%s' % args.build_path)
|
||||
command.extend(lines_by_file.keys())
|
||||
for arg in args.extra_arg:
|
||||
command.append('-extra-arg=%s' % arg)
|
||||
for arg in args.extra_arg_before:
|
||||
command.append('-extra-arg-before=%s' % arg)
|
||||
command.extend(clang_tidy_args)
|
||||
# Run a pool of clang-tidy workers.
|
||||
start_workers(max_task_count, run_tidy, task_queue, lock, args.timeout)
|
||||
|
||||
# Form the common args list.
|
||||
common_clang_tidy_args = []
|
||||
if args.fix:
|
||||
common_clang_tidy_args.append('-fix')
|
||||
if args.checks != '':
|
||||
common_clang_tidy_args.append('-checks=' + args.checks)
|
||||
if args.quiet:
|
||||
common_clang_tidy_args.append('-quiet')
|
||||
if args.build_path is not None:
|
||||
common_clang_tidy_args.append('-p=%s' % args.build_path)
|
||||
for arg in args.extra_arg:
|
||||
common_clang_tidy_args.append('-extra-arg=%s' % arg)
|
||||
for arg in args.extra_arg_before:
|
||||
common_clang_tidy_args.append('-extra-arg-before=%s' % arg)
|
||||
|
||||
for name in lines_by_file:
|
||||
line_filter_json = json.dumps(
|
||||
[{"name": name, "lines": lines_by_file[name]}],
|
||||
separators=(',', ':'))
|
||||
|
||||
# Run clang-tidy on files containing changes.
|
||||
command = [args.clang_tidy_binary]
|
||||
command.append('-line-filter=' + line_filter_json)
|
||||
if yaml and args.export_fixes:
|
||||
# Get a temporary file. We immediately close the handle so clang-tidy can
|
||||
# overwrite it.
|
||||
(handle, tmp_name) = tempfile.mkstemp(suffix='.yaml', dir=tmpdir)
|
||||
os.close(handle)
|
||||
command.append('-export-fixes=' + tmp_name)
|
||||
command.extend(common_clang_tidy_args)
|
||||
command.append(name)
|
||||
command.extend(clang_tidy_args)
|
||||
|
||||
task_queue.put(command)
|
||||
|
||||
# Wait for all threads to be done.
|
||||
task_queue.join()
|
||||
|
||||
if yaml and args.export_fixes:
|
||||
print('Writing fixes to ' + args.export_fixes + ' ...')
|
||||
try:
|
||||
merge_replacement_files(tmpdir, args.export_fixes)
|
||||
except:
|
||||
sys.stderr.write('Error exporting fixes.\n')
|
||||
traceback.print_exc()
|
||||
|
||||
if tmpdir:
|
||||
shutil.rmtree(tmpdir)
|
||||
|
||||
sys.exit(subprocess.call(' '.join(command), shell=True))
|
||||
|
||||
if __name__ == '__main__':
|
||||
main()
|
||||
main()
|
||||
@@ -12,8 +12,8 @@ cd "$TRAVIS_BUILD_DIR"
|
||||
echo "Running clang-tidy on changed files"
|
||||
git diff -U0 --no-color $TRAVIS_COMMIT_RANGE | \
|
||||
$TRAVIS_BUILD_DIR/ci/travis/clang-tidy-diff.py -path "$TRAVIS_BUILD_DIR/build" -p1 \
|
||||
-regex 'code/.*$|freespace2/.*$|qtfred/.*$|test/src/.*$|build/.*$|tools/.*' \
|
||||
-clang-tidy-binary /usr/bin/clang-tidy-4.0 2>/dev/null | \
|
||||
-regex '(code|freespace2|qtfred|testsrc|build|tools)\/.*\.(cpp|h)' \
|
||||
-clang-tidy-binary /usr/bin/clang-tidy-9 -j$(nproc) -quiet 2>/dev/null | \
|
||||
tee clang-tidy-output.txt
|
||||
|
||||
if [[ -n $(grep "warning: " clang-tidy-output.txt) ]] || [[ -n $(grep "error: " clang-tidy-output.txt) ]]; then
|
||||
|
||||
@@ -77,13 +77,13 @@ cd /tmp/builds
|
||||
|
||||
for file in *; do
|
||||
if [ "$TEST_BUILD" = true ]; then
|
||||
# Upload to fs2downloads
|
||||
curl -k "ftp://swc.fs2downloads.com/swc.fs2downloads.com/builds/test/$VERSION_NAME/" --user "$FS2DOWNLOADS_USER:$FS2DOWNLOADS_PASSWORD" -T "$file" --ftp-create-dirs
|
||||
# Upload to datacorder
|
||||
curl -k "sftp://porphyrion.feralhosting.com/www/datacorder.porphyrion.feralhosting.com/public_html/builds/test/$VERSION_NAME/" --user "$DATACORDER_USER:$DATACORDER_PASSWORD" -T "$file" --ftp-create-dirs
|
||||
else
|
||||
# Upload to indiegames
|
||||
curl -k "sftp://scp.indiegames.us/~/public_html/builds/nightly/$VERSION_NAME/" --user "$INDIEGAMES_USER:$INDIEGAMES_PASSWORD" -T "$file" --ftp-create-dirs
|
||||
|
||||
# Upload to fs2downloads
|
||||
curl -k "ftp://swc.fs2downloads.com/swc.fs2downloads.com/builds/nightly/$VERSION_NAME/" --user "$FS2DOWNLOADS_USER:$FS2DOWNLOADS_PASSWORD" -T "$file" --ftp-create-dirs
|
||||
# Upload to datacorder
|
||||
curl -k "sftp://porphyrion.feralhosting.com/~/www/datacorder.porphyrion.feralhosting.com/public_html/builds/nightly/$VERSION_NAME/" --user "$DATACORDER_USER:$DATACORDER_PASSWORD" -T "$file" --ftp-create-dirs
|
||||
fi
|
||||
done
|
||||
+15
-2
@@ -1,9 +1,11 @@
|
||||
#!/usr/bin/env sh
|
||||
#!/usr/bin/env bash
|
||||
|
||||
set -ex
|
||||
|
||||
FILENAME=
|
||||
if [ "$TRAVIS_OS_NAME" = "linux" ]; then
|
||||
export DEBIAN_FRONTEND=noninteractive
|
||||
|
||||
if [ ! -d "$HOME/cmake-3.8/bin" ]; then
|
||||
# If the cache does not currently contain CMake then download and install it
|
||||
mkdir -p $HOME/cmake-3.8/
|
||||
@@ -11,7 +13,7 @@ if [ "$TRAVIS_OS_NAME" = "linux" ]; then
|
||||
wget -O /tmp/cmake.tar.gz --no-check-certificate https://cmake.org/files/v3.8/cmake-3.8.2-Linux-x86_64.tar.gz
|
||||
tar -xzf /tmp/cmake.tar.gz -C $HOME/cmake-3.8/ --strip-components=1
|
||||
fi
|
||||
export PATH=$HOME/cmake-3.8/bin:$PATH
|
||||
export PATH=$HOME/cmake-3.8/bin:$PATH
|
||||
|
||||
cd $HOME
|
||||
|
||||
@@ -22,6 +24,17 @@ if [ "$TRAVIS_OS_NAME" = "linux" ]; then
|
||||
wget -O linuxdeployqt -c "https://github.com/probonopd/linuxdeployqt/releases/download/continuous/linuxdeployqt-continuous-x86_64.AppImage" # (64-bit)
|
||||
chmod a+x ./linuxdeployqt
|
||||
fi
|
||||
|
||||
sudo apt-get -yq install valgrind
|
||||
|
||||
if [[ "$CC" = "clang-9" ]]; then
|
||||
sudo apt-get -yq install clang-9 clang-tidy-9
|
||||
fi
|
||||
|
||||
if [[ "$CC" = "clang-4.0" ]]; then
|
||||
# Fix a header bug present in ubuntu...
|
||||
sudo ln -s /usr/include/libcxxabi/__cxxabi_config.h /usr/include/c++/v1/__cxxabi_config.h
|
||||
fi
|
||||
elif [ "$TRAVIS_OS_NAME" = "osx" ]; then
|
||||
gem install xcpretty
|
||||
|
||||
|
||||
@@ -7,7 +7,6 @@ cd build
|
||||
if [ "$TRAVIS_OS_NAME" = "linux" ]; then
|
||||
ninja -k 20 all
|
||||
|
||||
|
||||
if [ "$CONFIGURATION" = "Debug" ]; then
|
||||
valgrind --leak-check=full --error-exitcode=1 --gen-suppressions=all \
|
||||
--suppressions="$TRAVIS_BUILD_DIR/ci/travis/valgrind.supp" ./bin/unittests --gtest_shuffle
|
||||
|
||||
@@ -41,3 +41,124 @@
|
||||
fun:_Z29cf_create_default_path_stringPcjiPKcbj
|
||||
...
|
||||
}
|
||||
{
|
||||
<insert_a_suppression_name_here>
|
||||
Memcheck:Leak
|
||||
match-leak-kinds: definite
|
||||
fun:_Znwm
|
||||
obj:*
|
||||
obj:*
|
||||
obj:*
|
||||
obj:/usr/lib/x86_64-linux-gnu/libSDL2-2.0.so.0.4.0
|
||||
obj:/usr/lib/x86_64-linux-gnu/libSDL2-2.0.so.0.4.0
|
||||
obj:/usr/lib/x86_64-linux-gnu/libSDL2-2.0.so.0.4.0
|
||||
fun:_Z7gr_initOSt10unique_ptrIN2os18GraphicsOperationsESt14default_deleteIS1_EEiiii
|
||||
fun:_ZN4test13FSTestFixture5SetUpEv
|
||||
fun:_ZN7testing8internal38HandleSehExceptionsInMethodIfSupportedINS_4TestEvEET0_PT_MS4_FS3_vEPKc
|
||||
fun:_ZN7testing8internal35HandleExceptionsInMethodIfSupportedINS_4TestEvEET0_PT_MS4_FS3_vEPKc
|
||||
fun:_ZN7testing4Test3RunEv
|
||||
}
|
||||
{
|
||||
<insert_a_suppression_name_here>
|
||||
Memcheck:Leak
|
||||
match-leak-kinds: definite
|
||||
fun:_Znwm
|
||||
obj:*
|
||||
obj:*
|
||||
obj:*
|
||||
obj:/usr/lib/x86_64-linux-gnu/libSDL2-2.0.so.0.4.0
|
||||
obj:/usr/lib/x86_64-linux-gnu/libSDL2-2.0.so.0.4.0
|
||||
obj:/usr/lib/x86_64-linux-gnu/libSDL2-2.0.so.0.4.0
|
||||
fun:_Z7gr_initOSt10unique_ptrIN2os18GraphicsOperationsESt14default_deleteIS1_EEiiii
|
||||
fun:_ZN4test13FSTestFixture5SetUpEv
|
||||
fun:_ZN8FontTest5SetUpEv
|
||||
fun:_ZN7testing8internal38HandleSehExceptionsInMethodIfSupportedINS_4TestEvEET0_PT_MS4_FS3_vEPKc
|
||||
fun:_ZN7testing8internal35HandleExceptionsInMethodIfSupportedINS_4TestEvEET0_PT_MS4_FS3_vEPKc
|
||||
}
|
||||
{
|
||||
<insert_a_suppression_name_here>
|
||||
Memcheck:Leak
|
||||
match-leak-kinds: definite
|
||||
fun:malloc
|
||||
fun:_Znwm
|
||||
obj:*
|
||||
obj:*
|
||||
obj:*
|
||||
obj:/usr/lib/x86_64-linux-gnu/libSDL2-2.0.so.0.4.0
|
||||
obj:/usr/lib/x86_64-linux-gnu/libSDL2-2.0.so.0.4.0
|
||||
obj:/usr/lib/x86_64-linux-gnu/libSDL2-2.0.so.0.4.0
|
||||
fun:_Z7gr_initONSt3__110unique_ptrIN2os18GraphicsOperationsENS_14default_deleteIS2_EEEEiiii
|
||||
fun:_ZN4test13FSTestFixture5SetUpEv
|
||||
fun:_ZN8FontTest5SetUpEv
|
||||
fun:_ZN7testing8internal38HandleSehExceptionsInMethodIfSupportedINS_4TestEvEET0_PT_MS4_FS3_vEPKc
|
||||
}
|
||||
{
|
||||
<insert_a_suppression_name_here>
|
||||
Memcheck:Leak
|
||||
match-leak-kinds: definite
|
||||
fun:malloc
|
||||
fun:_Znwm
|
||||
obj:*
|
||||
obj:*
|
||||
obj:*
|
||||
obj:/usr/lib/x86_64-linux-gnu/libSDL2-2.0.so.0.4.0
|
||||
obj:/usr/lib/x86_64-linux-gnu/libSDL2-2.0.so.0.4.0
|
||||
obj:/usr/lib/x86_64-linux-gnu/libSDL2-2.0.so.0.4.0
|
||||
fun:_Z7gr_initONSt3__110unique_ptrIN2os18GraphicsOperationsENS_14default_deleteIS2_EEEEiiii
|
||||
fun:_ZN4test13FSTestFixture5SetUpEv
|
||||
fun:_ZN8FontTest5SetUpEv
|
||||
fun:_ZN7testing8internal38HandleSehExceptionsInMethodIfSupportedINS_4TestEvEET0_PT_MS4_FS3_vEPKc
|
||||
}
|
||||
{
|
||||
<insert_a_suppression_name_here>
|
||||
Memcheck:Leak
|
||||
match-leak-kinds: definite
|
||||
fun:malloc
|
||||
fun:_Znwm
|
||||
obj:*
|
||||
obj:*
|
||||
obj:*
|
||||
obj:/usr/lib/x86_64-linux-gnu/libSDL2-2.0.so.0.4.0
|
||||
obj:/usr/lib/x86_64-linux-gnu/libSDL2-2.0.so.0.4.0
|
||||
obj:/usr/lib/x86_64-linux-gnu/libSDL2-2.0.so.0.4.0
|
||||
fun:_Z7gr_initONSt3__110unique_ptrIN2os18GraphicsOperationsENS_14default_deleteIS2_EEEEiiii
|
||||
fun:_ZN4test13FSTestFixture5SetUpEv
|
||||
fun:_ZN7testing8internal38HandleSehExceptionsInMethodIfSupportedINS_4TestEvEET0_PT_MS4_FS3_vEPKc
|
||||
fun:_ZN7testing8internal35HandleExceptionsInMethodIfSupportedINS_4TestEvEET0_PT_MS4_FS3_vEPKc
|
||||
}
|
||||
{
|
||||
<insert_a_suppression_name_here>
|
||||
Memcheck:Leak
|
||||
match-leak-kinds: definite
|
||||
fun:malloc
|
||||
fun:_dl_signal_error
|
||||
fun:_dl_open
|
||||
fun:dlopen_doit
|
||||
fun:_dl_catch_error
|
||||
fun:_dlerror_run
|
||||
fun:dlopen@@GLIBC_2.2.5
|
||||
obj:*
|
||||
obj:*
|
||||
fun:call_init.part.0
|
||||
fun:call_init
|
||||
fun:_dl_init
|
||||
fun:dl_open_worker
|
||||
}
|
||||
{
|
||||
<insert_a_suppression_name_here>
|
||||
Memcheck:Leak
|
||||
match-leak-kinds: definite
|
||||
fun:malloc
|
||||
fun:_dl_signal_error
|
||||
fun:_dl_open
|
||||
fun:dlopen_doit
|
||||
fun:_dl_catch_error
|
||||
fun:_dlerror_run
|
||||
fun:dlopen@@GLIBC_2.2.5
|
||||
obj:*
|
||||
obj:*
|
||||
fun:call_init.part.0
|
||||
fun:call_init
|
||||
fun:_dl_init
|
||||
fun:dl_open_worker
|
||||
}
|
||||
+1
-1
@@ -1,4 +1,4 @@
|
||||
#!/bin/sh
|
||||
HERE=$(dirname $(readlink -f "${0}"))
|
||||
export LD_LIBRARY_PATH="${HERE}"/lib:"$LD_LIBRARY_PATH"
|
||||
"${HERE}"/bin/$<TARGET_FILE_NAME:Freespace2> $@
|
||||
exec "${HERE}"/bin/$<TARGET_FILE_NAME:Freespace2> $@
|
||||
@@ -3,7 +3,7 @@ INCLUDE(util)
|
||||
|
||||
MESSAGE(STATUS "Configuring UNIX specific things and stuff...")
|
||||
|
||||
target_compile_definitions(platform INTERFACE SCP_UNIX USE_OPENAL)
|
||||
target_compile_definitions(platform INTERFACE SCP_UNIX USE_OPENAL _REENTRANT)
|
||||
|
||||
# Set RPATH
|
||||
set(CMAKE_SKIP_BUILD_RPATH TRUE)
|
||||
|
||||
@@ -8,7 +8,7 @@ SET(WIN32_LIBS
|
||||
odbccp32
|
||||
vfw32
|
||||
winmm
|
||||
wsock32
|
||||
ws2_32
|
||||
psapi
|
||||
)
|
||||
|
||||
|
||||
+10
-10
@@ -10,8 +10,8 @@ include(CheckSymbolExists)
|
||||
include(CheckCXXSymbolExists)
|
||||
include(CheckTypeSize)
|
||||
|
||||
CHECK_INCLUDE_FILE("execinfo.h" HAVE_EXECINFO_H)
|
||||
CHECK_INCLUDE_FILE_CXX("cxxabi.h" HAVE_CXXAPI_H)
|
||||
CHECK_INCLUDE_FILE("execinfo.h" SCP_HAVE_EXECINFO_H)
|
||||
CHECK_INCLUDE_FILE_CXX("cxxabi.h" SCP_HAVE_CXXAPI_H)
|
||||
|
||||
CHECK_TYPE_SIZE("max_align_t" MAX_ALIGN_T)
|
||||
|
||||
@@ -31,18 +31,18 @@ CHECK_TYPE_SIZE("U'b'" UNICODE_CHAR_LITERAL LANGUAGE CXX)
|
||||
set(CMAKE_REQUIRED_FLAGS)
|
||||
|
||||
|
||||
CHECK_FUNCTION_EXISTS(strcasecmp HAVE_STRCASECMP)
|
||||
CHECK_FUNCTION_EXISTS(strncasecmp HAVE_STRNCASECMP)
|
||||
CHECK_FUNCTION_EXISTS(strcasecmp SCP_HAVE_STRCASECMP)
|
||||
CHECK_FUNCTION_EXISTS(strncasecmp SCP_HAVE_STRNCASECMP)
|
||||
|
||||
CHECK_FUNCTION_EXISTS(_stricmp HAVE__STRICMP)
|
||||
CHECK_FUNCTION_EXISTS(_strnicmp HAVE__STRNICMP)
|
||||
CHECK_FUNCTION_EXISTS(_stricmp SCP_HAVE__STRICMP)
|
||||
CHECK_FUNCTION_EXISTS(_strnicmp SCP_HAVE__STRNICMP)
|
||||
|
||||
CHECK_FUNCTION_EXISTS(strlwr HAVE_STRLWR)
|
||||
CHECK_FUNCTION_EXISTS(strlwr SCP_HAVE_STRLWR)
|
||||
|
||||
CHECK_INCLUDE_FILE("strings.h" HAVE_STRINGS_H)
|
||||
CHECK_INCLUDE_FILE("strings.h" SCP_HAVE_STRINGS_H)
|
||||
|
||||
check_symbol_exists(snprintf "stdio.h" HAVE_SNPRINTF)
|
||||
check_symbol_exists(_snprintf "stdio.h" HAVE__SNPRINTF)
|
||||
check_symbol_exists(snprintf "stdio.h" SCP_HAVE_SNPRINTF)
|
||||
check_symbol_exists(_snprintf "stdio.h" SCP_HAVE__SNPRINTF)
|
||||
|
||||
set(PLATFORM_CHECK_HEADER "${GENERATED_SOURCE_DIR}/platformChecks.h")
|
||||
CONFIGURE_FILE(${CMAKE_CURRENT_LIST_DIR}/platformChecks.h.in "${PLATFORM_CHECK_HEADER}")
|
||||
+13
-14
@@ -3,29 +3,28 @@
|
||||
#define __PLATFORM_CHECKS_H__
|
||||
#pragma once
|
||||
|
||||
#cmakedefine HAVE_EXECINFO_H
|
||||
#cmakedefine HAVE_CXXAPI_H
|
||||
#cmakedefine HAVE_MAX_ALIGN_T
|
||||
#cmakedefine HAVE_STD_MAX_ALIGN_T
|
||||
#cmakedefine SCP_HAVE_EXECINFO_H
|
||||
#cmakedefine SCP_HAVE_CXXAPI_H
|
||||
#cmakedefine SCP_HAVE_MAX_ALIGN_T
|
||||
#cmakedefine SCP_HAVE_STD_MAX_ALIGN_T
|
||||
|
||||
#cmakedefine HAVE_STD_IS_TRIVIALLY_COPYABLE
|
||||
#cmakedefine HAVE_STD_IS_TRIVIALLY_COPYABLE_ARRAY
|
||||
#cmakedefine01 HAVE_STD_IS_TRIVIALLY_COPYABLE
|
||||
|
||||
#cmakedefine01 IS_64BIT
|
||||
|
||||
#cmakedefine01 HAVE_STRCASECMP
|
||||
#cmakedefine01 HAVE_STRNCASECMP
|
||||
#cmakedefine01 HAVE__STRICMP
|
||||
#cmakedefine01 HAVE__STRNICMP
|
||||
#cmakedefine01 SCP_HAVE_STRCASECMP
|
||||
#cmakedefine01 SCP_HAVE_STRNCASECMP
|
||||
#cmakedefine01 SCP_HAVE__STRICMP
|
||||
#cmakedefine01 SCP_HAVE__STRNICMP
|
||||
|
||||
#cmakedefine01 HAVE_STRLWR
|
||||
#cmakedefine01 SCP_HAVE_STRLWR
|
||||
|
||||
#cmakedefine01 HAVE_STRINGS_H
|
||||
#cmakedefine01 SCP_HAVE_STRINGS_H
|
||||
|
||||
#cmakedefine01 HAVE_CHAR32_T
|
||||
#cmakedefine01 HAVE_UNICODE_CHAR_LITERAL
|
||||
|
||||
#cmakedefine01 HAVE_SNPRINTF
|
||||
#cmakedefine01 HAVE__SNPRINTF
|
||||
#cmakedefine01 SCP_HAVE_SNPRINTF
|
||||
#cmakedefine01 SCP_HAVE__SNPRINTF
|
||||
|
||||
#endif // __PLATFORM_CHECKS_H__
|
||||
@@ -7,6 +7,8 @@ MESSAGE(STATUS "Doing configuration specific to clang...")
|
||||
option(CLANG_ENABLE_LEAK_CHECK "Enable -fsanitize=leak" OFF)
|
||||
option(CLANG_ENABLE_ADDRESS_SANITIZER "Enable -fsanitize=address" OFF)
|
||||
|
||||
option(CLANG_USE_LIBCXX "Use libc++" OFF)
|
||||
|
||||
# These are the default values
|
||||
set(C_BASE_FLAGS "-march=native -pipe")
|
||||
set(CXX_BASE_FLAGS "-march=native -pipe")
|
||||
@@ -19,6 +21,10 @@ if(DEFINED ENV{CFLAGS})
|
||||
set(C_BASE_FLAGS $ENV{CFLAGS})
|
||||
endif()
|
||||
|
||||
if (CLANG_USE_LIBCXX)
|
||||
set(CXX_BASE_FLAGS "${CXX_BASE_FLAGS} -stdlib=libc++")
|
||||
endif()
|
||||
|
||||
# Initialize with an empty string to make sure we always get a clean start
|
||||
set(COMPILER_FLAGS "")
|
||||
|
||||
@@ -93,6 +99,10 @@ set(CMAKE_C_FLAGS_DEBUG ${COMPILER_FLAGS_DEBUG})
|
||||
|
||||
set(CMAKE_EXE_LINKER_FLAGS "")
|
||||
|
||||
if (CLANG_USE_LIBCXX)
|
||||
set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -lc++abi")
|
||||
endif()
|
||||
|
||||
if (SANITIZE_FLAGS)
|
||||
set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} ${SANITIZE_FLAGS}")
|
||||
endif()
|
||||
|
||||
@@ -37,21 +37,23 @@ set(WARNING_FLAGS
|
||||
$<$<CONFIG:Release>:/wd4101> # In release mode there are unreferenced variables because debug needs them
|
||||
/wd4995 # "'vsprintf': name was marked as #pragma deprecated" is being caused by our custom definition of vsprintf. I have no idea what causes this or how to fix it - m!m
|
||||
/wd4723 # "potential divide by 0" is caused by some code that definitely will not divide by zero - m!m
|
||||
/wd4121 # "alignment of a member was sensitive to packing" happens in a Windows header - m!m
|
||||
)
|
||||
|
||||
target_compile_options(compiler INTERFACE ${WARNING_FLAGS})
|
||||
|
||||
# Base
|
||||
set(CMAKE_C_FLAGS "/MP /GS- /analyze- /Zc:wchar_t /errorReport:prompt /WX- /Zc:forScope /Gd /EHsc /nologo /Zm200")
|
||||
set(CMAKE_CXX_FLAGS "/MP /GS- /analyze- /Zc:wchar_t /errorReport:prompt /WX- /Zc:forScope /Gd /EHsc /nologo /Zm200")
|
||||
set(CMAKE_C_FLAGS "/MP /GS- /analyze- /Zc:wchar_t /errorReport:prompt /Zc:forScope /Gd /EHsc /nologo /Zm200")
|
||||
set(CMAKE_CXX_FLAGS "/MP /GS- /analyze- /Zc:wchar_t /errorReport:prompt /Zc:forScope /Gd /EHsc /nologo /Zm200")
|
||||
|
||||
set(CMAKE_EXE_LINKER_FLAGS "/MANIFEST /DYNAMICBASE:NO /SAFESEH:NO /ERRORREPORT:PROMPT /NOLOGO")
|
||||
set(CMAKE_STATIC_LINKER_FLAGS "")
|
||||
|
||||
# Release
|
||||
set(CMAKE_C_FLAGS_RELEASE "/GL /W2 /Gy- /Ox /Ot /Ob2 /fp:precise /GF /Oy /Oi /Zi /W3")
|
||||
set(CMAKE_CXX_FLAGS_RELEASE "/GL /W2 /Gy- /Ox /Ot /Ob2 /fp:precise /GF /Oy /Oi /Zi /W3")
|
||||
set(CMAKE_EXE_LINKER_FLAGS_RELEASE "/OPT:REF /LTCG /INCREMENTAL:NO")
|
||||
set(CMAKE_C_FLAGS_RELEASE "/GL /Gy- /Ox /Ot /Ob2 /fp:precise /GF /Oy /Oi /Zi /W3")
|
||||
set(CMAKE_CXX_FLAGS_RELEASE "/GL /Gy- /Ox /Ot /Ob2 /fp:precise /GF /Oy /Oi /Zi /W3")
|
||||
# /DEBUG:FULL so that we get PDBs which is needed for debugging crashdumps
|
||||
set(CMAKE_EXE_LINKER_FLAGS_RELEASE "/OPT:REF /LTCG /INCREMENTAL:NO /DEBUG:FULL")
|
||||
set(CMAKE_STATIC_LINKER_FLAGS_RELEASE "/LTCG")
|
||||
|
||||
globally_enable_extra_compiler_warnings()
|
||||
@@ -63,8 +65,6 @@ if (MSVC_RELEASE_DEBUGGING)
|
||||
set(CMAKE_C_FLAGS_RELEASE "${CMAKE_C_FLAGS_RELEASE} /Zo")
|
||||
set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} /Zo")
|
||||
endif()
|
||||
|
||||
set(CMAKE_EXE_LINKER_FLAGS_RELEASE "${CMAKE_EXE_LINKER_FLAGS_RELEASE} /DEBUG")
|
||||
endif()
|
||||
|
||||
IF(MSVC_USE_RUNTIME_DLL)
|
||||
|
||||
+4
-4
@@ -6,9 +6,9 @@ if (EXISTS "${PROJECT_SOURCE_DIR}/version_override.cmake")
|
||||
include("${PROJECT_SOURCE_DIR}/version_override.cmake")
|
||||
endif()
|
||||
|
||||
set_if_not_defined(FSO_VERSION_MAJOR 3)
|
||||
set_if_not_defined(FSO_VERSION_MINOR 8)
|
||||
set_if_not_defined(FSO_VERSION_BUILD 1)
|
||||
set_if_not_defined(FSO_VERSION_MAJOR 20)
|
||||
set_if_not_defined(FSO_VERSION_MINOR 1)
|
||||
set_if_not_defined(FSO_VERSION_BUILD 0)
|
||||
|
||||
# A numeric revision e.g. the CI build number
|
||||
set_if_not_defined(FSO_VERSION_REVISION 0)
|
||||
@@ -49,4 +49,4 @@ IF (NOT "${FSO_BUILD_POSTFIX}" STREQUAL "")
|
||||
ENDIF()
|
||||
|
||||
set(CONFIG_POSTFIX "$<$<CONFIG:Release>:>$<$<CONFIG:Debug>:-DEBUG>$<$<CONFIG:FastDebug>:-FASTDBG>")
|
||||
set(FSO_BINARY_SUFFIX "${FSO_BINARY_SUFFIX}${CONFIG_POSTFIX}")
|
||||
set(FSO_BINARY_SUFFIX "${FSO_BINARY_SUFFIX}${CONFIG_POSTFIX}")
|
||||
+15
-1
@@ -28,7 +28,9 @@ TARGET_LINK_LIBRARIES(code PUBLIC ${JPEG_LIBS})
|
||||
|
||||
TARGET_LINK_LIBRARIES(code PUBLIC sdl2)
|
||||
|
||||
TARGET_LINK_LIBRARIES(code PUBLIC ffmpeg)
|
||||
if (FSO_BUILD_WITH_FFMPEG)
|
||||
TARGET_LINK_LIBRARIES(code PUBLIC ffmpeg)
|
||||
endif()
|
||||
|
||||
TARGET_LINK_LIBRARIES(code PUBLIC utfcpp)
|
||||
|
||||
@@ -41,6 +43,10 @@ target_link_libraries(code PUBLIC discord-rpc)
|
||||
|
||||
target_link_libraries(code PUBLIC libRocket)
|
||||
|
||||
target_link_libraries(code PUBLIC pcp)
|
||||
|
||||
target_link_libraries(code PUBLIC vulkan-hpp)
|
||||
|
||||
enable_clang_tidy(code)
|
||||
|
||||
IF (FSO_USE_SPEECH)
|
||||
@@ -77,6 +83,14 @@ else()
|
||||
ENDIF()
|
||||
endif()
|
||||
|
||||
if (FSO_RELEASE_LOGGING)
|
||||
target_compile_definitions(code PUBLIC SCP_RELEASE_LOGGING)
|
||||
endif()
|
||||
|
||||
if (FSO_BUILD_WITH_FFMPEG)
|
||||
target_compile_definitions(code PUBLIC WITH_FFMPEG)
|
||||
endif()
|
||||
|
||||
include(util)
|
||||
configure_cotire(code)
|
||||
|
||||
|
||||
+9
-4
@@ -51,14 +51,19 @@ namespace AI {
|
||||
};
|
||||
|
||||
FLAG_LIST(Maneuver_Override_Flags) {
|
||||
Full, // Full sexp control
|
||||
Full_rot, // full sexp control over pitch/bank/heading rotation
|
||||
Roll, // Sexp forced roll maneuver
|
||||
Pitch, // Sexp forced pitch change
|
||||
Heading, // Sexp forced heading change
|
||||
Full_lat, // full control over up/side/forward movement
|
||||
Up, // vertical movement
|
||||
Sideways, // horizontal movement
|
||||
Forward, // forward movement
|
||||
Up, // Sexp forced vertical movement
|
||||
Sideways, // Sexp forced horizontal movement
|
||||
Forward, // Sexp forced forward movement
|
||||
|
||||
Dont_bank_when_turning, // maps to CIF_DONT_BANK_WHEN_TURNING
|
||||
Dont_clamp_max_velocity, // maps to CIF_DONT_CLAMP_MAX_VELOCITY
|
||||
Instantaneous_acceleration, // maps to CIF_INSTANTANEOUS_ACCELERATION
|
||||
Never_expire, // don't clear the maneuver when the timestamp is up
|
||||
|
||||
NUM_VALUES
|
||||
};
|
||||
|
||||
@@ -517,10 +517,6 @@ void parse_ai_profiles_tbl(const char *filename)
|
||||
mprintf(("TABLES: Unable to parse '%s'! Error message = %s.\n", (filename) ? filename : "<default ai_profiles.tbl>", e.what()));
|
||||
return;
|
||||
}
|
||||
|
||||
// add tbl/tbm to multiplayer validation list
|
||||
extern void fs2netd_add_table_validation(const char *tblname);
|
||||
fs2netd_add_table_validation(filename);
|
||||
}
|
||||
|
||||
void ai_profiles_init()
|
||||
|
||||
+121
-96
@@ -58,6 +58,7 @@
|
||||
#include "physics/physics.h"
|
||||
#include "playerman/player.h"
|
||||
#include "render/3d.h"
|
||||
#include "scripting/api/objs/waypoint.h"
|
||||
#include "scripting/api/objs/wing.h"
|
||||
#include "scripting/scripting.h"
|
||||
#include "ship/afterburner.h"
|
||||
@@ -1314,7 +1315,9 @@ ship_subsys *set_targeted_subsys(ai_info *aip, ship_subsys *new_subsys, int pare
|
||||
}
|
||||
|
||||
if ( aip == Player_ai ) {
|
||||
hud_lock_reset(0.5f);
|
||||
if (aip->last_subsys_target != aip->targeted_subsys) {
|
||||
hud_lock_reset(0.5f);
|
||||
}
|
||||
}
|
||||
|
||||
} else {
|
||||
@@ -4592,8 +4595,9 @@ void ai_waypoints()
|
||||
// adds scripting hook for 'On Waypoints Done' --wookieejedi
|
||||
Script_system.SetHookObject("Ship", &Objects[Ships[Pl_objp->instance].objnum]);
|
||||
Script_system.SetHookVar("Wing", 'o', scripting::api::l_Wing.Set(Ships[Pl_objp->instance].wingnum));
|
||||
Script_system.SetHookVar("Waypointlist", 'o', scripting::api::l_WaypointList.Set(scripting::api::waypointlist_h(aip->wp_list)));
|
||||
Script_system.RunCondition(CHA_ONWAYPOINTSDONE);
|
||||
Script_system.RemHookVars(2, "Ship", "Wing");
|
||||
Script_system.RemHookVars(3, "Ship", "Wing", "Waypointlist");
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -4648,7 +4652,7 @@ void ai_fly_to_ship()
|
||||
{
|
||||
if (aip->mode == AIM_FLY_TO_SHIP || aip->goals[i].ai_mode == AI_GOAL_FLY_TO_SHIP)
|
||||
{
|
||||
mprintf(("Ship '%s' told to fly to target ship '%s'",
|
||||
mprintf(("Ship '%s' told to fly to target ship '%s'\n",
|
||||
Ships[Pl_objp->instance].ship_name,
|
||||
aip->goals[i].target_name));
|
||||
}
|
||||
@@ -5222,7 +5226,7 @@ static int ai_select_primary_weapon_OLD(const object *objp, Weapon::Info_Flags f
|
||||
ship *shipp = &Ships[objp->instance];
|
||||
ship_weapon *swp = &shipp->weapons;
|
||||
|
||||
Assert( shipp->ship_info_index >= 0 && shipp->ship_info_index < static_cast<int>(Ship_info.size()));
|
||||
Assert( shipp->ship_info_index >= 0 && shipp->ship_info_index < ship_info_size());
|
||||
|
||||
if (flags == Weapon::Info_Flags::Puncture) {
|
||||
if (swp->current_primary_bank >= 0) {
|
||||
@@ -5311,16 +5315,14 @@ int ai_select_primary_weapon(object *objp, object *other_objp, Weapon::Info_Flag
|
||||
return ai_select_primary_weapon_OLD(objp, flags);
|
||||
}
|
||||
|
||||
Assert( shipp->ship_info_index >= 0 && shipp->ship_info_index < static_cast<int>(Ship_info.size()));
|
||||
Assert( shipp->ship_info_index >= 0 && shipp->ship_info_index < ship_info_size());
|
||||
|
||||
//made it so it only selects puncture weapons if the active goal is to disable something -Bobboau
|
||||
if ((flags == Weapon::Info_Flags::Puncture) && (Ai_info[shipp->ai_index].goals[0].ai_mode & (AI_GOAL_DISARM_SHIP | AI_GOAL_DISABLE_SHIP)))
|
||||
{
|
||||
if (swp->current_primary_bank >= 0)
|
||||
{
|
||||
int bank_index;
|
||||
|
||||
bank_index = swp->current_primary_bank;
|
||||
int bank_index = swp->current_primary_bank;
|
||||
|
||||
if (Weapon_info[swp->primary_bank_weapons[bank_index]].wi_flags[Weapon::Info_Flags::Puncture])
|
||||
{
|
||||
@@ -5329,11 +5331,9 @@ int ai_select_primary_weapon(object *objp, object *other_objp, Weapon::Info_Flag
|
||||
}
|
||||
for (int i=0; i<swp->num_primary_banks; i++)
|
||||
{
|
||||
int weapon_info_index;
|
||||
int weapon_info_index = swp->primary_bank_weapons[i];
|
||||
|
||||
weapon_info_index = swp->primary_bank_weapons[i];
|
||||
|
||||
if (weapon_info_index > -1)
|
||||
if (weapon_info_index >= 0)
|
||||
{
|
||||
if (Weapon_info[weapon_info_index].wi_flags[Weapon::Info_Flags::Puncture])
|
||||
{
|
||||
@@ -5344,44 +5344,51 @@ int ai_select_primary_weapon(object *objp, object *other_objp, Weapon::Info_Flag
|
||||
}
|
||||
}
|
||||
|
||||
if ( (other_objp->type == OBJ_SHIP) && (Ship_info[Ships[other_objp->instance].ship_info_index].is_big_or_huge() ) )
|
||||
auto other_is_ship = (other_objp->type == OBJ_SHIP);
|
||||
float enemy_remaining_shield = get_shield_pct(other_objp);
|
||||
|
||||
if ( other_is_ship && (Ship_info[Ships[other_objp->instance].ship_info_index].is_big_or_huge() ) )
|
||||
{
|
||||
//Check if we have a capital+ weapon on board
|
||||
for (int i = 0; i < swp->num_primary_banks; i++)
|
||||
{
|
||||
if (swp->primary_bank_weapons[i] > -1) // Make sure there is a weapon in the bank
|
||||
if (swp->primary_bank_weapons[i] >= 0) // Make sure there is a weapon in the bank
|
||||
{
|
||||
if (Weapon_info[swp->primary_bank_weapons[i]].wi_flags[Weapon::Info_Flags::Capital_plus])
|
||||
auto wip = &Weapon_info[swp->primary_bank_weapons[i]];
|
||||
if (wip->wi_flags[Weapon::Info_Flags::Capital_plus])
|
||||
{
|
||||
swp->current_primary_bank = i;
|
||||
nprintf(("AI", "%i: Ship %s selecting weapon %s (capital+) vs target %s\n", Framecount, Ships[objp->instance].ship_name, Weapon_info[swp->primary_bank_weapons[i]].name, Ships[other_objp->instance].ship_name));
|
||||
return i;
|
||||
// handle shielded big/huge ships (non FS-verse)
|
||||
// only pick capital+ if the target has no shields; or the weapon is an ok shield-breaker anyway
|
||||
if (enemy_remaining_shield <= 0.05f || (wip->shield_factor * 1.33f > wip->armor_factor))
|
||||
{
|
||||
swp->current_primary_bank = i;
|
||||
nprintf(("AI", "%i: Ship %s selecting weapon %s (capital+) vs target %s\n", Framecount, Ships[objp->instance].ship_name, wip->name, Ships[other_objp->instance].ship_name));
|
||||
return i;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
float enemy_remaining_shield = get_shield_pct(other_objp);
|
||||
|
||||
// Is the target shielded by say only 5%?
|
||||
if (enemy_remaining_shield <= 0.05f)
|
||||
{
|
||||
// Then it is safe to start using a heavy hull damage weapon such as the maxim
|
||||
int i;
|
||||
float i_hullfactor_prev = 0; // Previous weapon bank hull factor (this is the safe way to do it)
|
||||
int i_hullfactor_prev_bank = -1; // Bank which gave us this hull factor
|
||||
|
||||
// Find the weapon with the highest hull * damage / fire delay factor
|
||||
for (i = 0; i < swp->num_primary_banks; i++)
|
||||
for (int i = 0; i < swp->num_primary_banks; i++)
|
||||
{
|
||||
if (swp->primary_bank_weapons[i] > -1) // Make sure there is a weapon in the bank
|
||||
if (swp->primary_bank_weapons[i] >= 0) // Make sure there is a weapon in the bank
|
||||
{
|
||||
if ((((Weapon_info[swp->primary_bank_weapons[i]].armor_factor) * (Weapon_info[swp->primary_bank_weapons[i]].damage)) / Weapon_info[swp->primary_bank_weapons[i]].fire_wait) > i_hullfactor_prev)
|
||||
auto wip = &Weapon_info[swp->primary_bank_weapons[i]];
|
||||
if ((((wip->armor_factor) * (wip->damage)) / wip->fire_wait) > i_hullfactor_prev)
|
||||
{
|
||||
if ( !(Weapon_info[swp->primary_bank_weapons[i]].wi_flags[Weapon::Info_Flags::Capital_plus]) )
|
||||
if ( !(wip->wi_flags[Weapon::Info_Flags::Capital_plus]) )
|
||||
{
|
||||
// This weapon is the new candidate
|
||||
i_hullfactor_prev = ( ((Weapon_info[swp->primary_bank_weapons[i]].armor_factor) * (Weapon_info[swp->primary_bank_weapons[i]].damage)) / Weapon_info[swp->primary_bank_weapons[i]].fire_wait );
|
||||
i_hullfactor_prev = ( ((wip->armor_factor) * (wip->damage)) / wip->fire_wait );
|
||||
i_hullfactor_prev_bank = i;
|
||||
}
|
||||
}
|
||||
@@ -5392,7 +5399,7 @@ int ai_select_primary_weapon(object *objp, object *other_objp, Weapon::Info_Flag
|
||||
i_hullfactor_prev_bank = 0; // Just switch to the first one
|
||||
}
|
||||
swp->current_primary_bank = i_hullfactor_prev_bank; // Select the best weapon
|
||||
nprintf(("AI", "%i: Ship %s selecting weapon %s (no shields) vs target %s\n", Framecount, Ships[objp->instance].ship_name, Weapon_info[swp->primary_bank_weapons[i_hullfactor_prev_bank]].name, (other_objp->type == OBJ_SHIP ? Ships[other_objp->instance].ship_name : "non-ship") ));
|
||||
nprintf(("AI", "%i: Ship %s selecting weapon %s (no shields) vs target %s\n", Framecount, shipp->ship_name, Weapon_info[swp->primary_bank_weapons[i_hullfactor_prev_bank]].name, (other_is_ship ? Ships[other_objp->instance].ship_name : "non-ship") ));
|
||||
return i_hullfactor_prev_bank; // Return
|
||||
}
|
||||
|
||||
@@ -5401,28 +5408,23 @@ int ai_select_primary_weapon(object *objp, object *other_objp, Weapon::Info_Flag
|
||||
{
|
||||
if (swp->current_primary_bank >= 0)
|
||||
{
|
||||
int bank_index;
|
||||
auto wip = &Weapon_info[swp->primary_bank_weapons[swp->current_primary_bank]];
|
||||
|
||||
bank_index = swp->current_primary_bank;
|
||||
|
||||
if ((Weapon_info[swp->primary_bank_weapons[bank_index]].wi_flags[Weapon::Info_Flags::Pierce_shields]) && !(Weapon_info[swp->primary_bank_weapons[bank_index]].wi_flags[Weapon::Info_Flags::Capital_plus]))
|
||||
if ((wip->wi_flags[Weapon::Info_Flags::Pierce_shields]) && !(wip->wi_flags[Weapon::Info_Flags::Capital_plus]))
|
||||
{
|
||||
nprintf(("AI", "%i: Ship %s selecting weapon %s (>10%% shields)\n", Framecount, Ships[objp->instance].ship_name, Weapon_info[swp->primary_bank_weapons[bank_index]].name));
|
||||
nprintf(("AI", "%i: Ship %s selecting weapon %s (>10%% shields)\n", Framecount, shipp->ship_name, wip->name));
|
||||
return swp->current_primary_bank;
|
||||
}
|
||||
}
|
||||
for (int i=0; i<swp->num_primary_banks; i++)
|
||||
{
|
||||
int weapon_info_index;
|
||||
|
||||
weapon_info_index = swp->primary_bank_weapons[i];
|
||||
|
||||
if (weapon_info_index > -1)
|
||||
if (swp->primary_bank_weapons[i] >= 0)
|
||||
{
|
||||
if ((Weapon_info[weapon_info_index].wi_flags[Weapon::Info_Flags::Pierce_shields]) && !(Weapon_info[swp->primary_bank_weapons[i]].wi_flags[Weapon::Info_Flags::Capital_plus]))
|
||||
auto wip = &Weapon_info[swp->primary_bank_weapons[i]];
|
||||
if ((wip->wi_flags[Weapon::Info_Flags::Pierce_shields]) && !(wip->wi_flags[Weapon::Info_Flags::Capital_plus]))
|
||||
{
|
||||
swp->current_primary_bank = i;
|
||||
nprintf(("AI", "%i: Ship %s selecting weapon %s (>10%% shields)\n", Framecount, Ships[objp->instance].ship_name, Weapon_info[swp->primary_bank_weapons[i]].name));
|
||||
nprintf(("AI", "%i: Ship %s selecting weapon %s (>10%% shields)\n", Framecount, shipp->ship_name, wip->name));
|
||||
return i;
|
||||
}
|
||||
}
|
||||
@@ -5432,63 +5434,63 @@ int ai_select_primary_weapon(object *objp, object *other_objp, Weapon::Info_Flag
|
||||
// Is the target shielded by less then 50%?
|
||||
if (enemy_remaining_shield <= 0.50f)
|
||||
{
|
||||
// Should be using best balanced shield gun
|
||||
int i;
|
||||
float i_hullfactor_prev = 0; // Previous weapon bank hull factor (this is the safe way to do it)
|
||||
int i_hullfactor_prev_bank = -1; // Bank which gave us this hull factor
|
||||
// Should be using best balanced shield/hull gun
|
||||
float i_balancedfactor_prev = 0; // Previous weapon bank "balanced" factor (this is the safe way to do it)
|
||||
int i_balancedfactor_prev_bank = -1; // Bank which gave us this "balanced" factor
|
||||
// Find the weapon with the highest average hull and shield * damage / fire delay factor
|
||||
for (i = 0; i < swp->num_primary_banks; i++)
|
||||
for (int i = 0; i < swp->num_primary_banks; i++)
|
||||
{
|
||||
if (swp->primary_bank_weapons[i] > -1) // Make sure there is a weapon in the bank
|
||||
if (swp->primary_bank_weapons[i] >= 0) // Make sure there is a weapon in the bank
|
||||
{
|
||||
if ((((Weapon_info[swp->primary_bank_weapons[i]].armor_factor + Weapon_info[swp->primary_bank_weapons[i]].shield_factor) * Weapon_info[swp->primary_bank_weapons[i]].damage) / Weapon_info[swp->primary_bank_weapons[i]].fire_wait) > i_hullfactor_prev)
|
||||
auto wip = &Weapon_info[swp->primary_bank_weapons[i]];
|
||||
if ((((wip->armor_factor + wip->shield_factor) * wip->damage) / wip->fire_wait) > i_balancedfactor_prev)
|
||||
{
|
||||
if ( !(Weapon_info[swp->primary_bank_weapons[i]].wi_flags[Weapon::Info_Flags::Capital_plus]) )
|
||||
if ( !(wip->wi_flags[Weapon::Info_Flags::Capital_plus]) )
|
||||
{
|
||||
// This weapon is the new candidate
|
||||
i_hullfactor_prev = ((((Weapon_info[swp->primary_bank_weapons[i]].armor_factor + Weapon_info[swp->primary_bank_weapons[i]].shield_factor) * Weapon_info[swp->primary_bank_weapons[i]].damage) / Weapon_info[swp->primary_bank_weapons[i]].fire_wait));
|
||||
i_hullfactor_prev_bank = i;
|
||||
i_balancedfactor_prev = ((((wip->armor_factor + wip->shield_factor) * wip->damage) / wip->fire_wait));
|
||||
i_balancedfactor_prev_bank = i;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
if (i_hullfactor_prev_bank == -1) // In the unlikely instance we don't find at least 1 candidate weapon
|
||||
if (i_balancedfactor_prev_bank == -1) // In the unlikely instance we don't find at least 1 candidate weapon
|
||||
{
|
||||
i_hullfactor_prev_bank = 0; // Just switch to the first one
|
||||
i_balancedfactor_prev_bank = 0; // Just switch to the first one
|
||||
}
|
||||
swp->current_primary_bank = i_hullfactor_prev_bank; // Select the best weapon
|
||||
nprintf(("AI", "%i: Ship %s selecting weapon %s (<50%% shields)\n", Framecount, Ships[objp->instance].ship_name, Weapon_info[swp->primary_bank_weapons[i_hullfactor_prev_bank]].name));
|
||||
return i_hullfactor_prev_bank; // Return
|
||||
swp->current_primary_bank = i_balancedfactor_prev_bank; // Select the best weapon
|
||||
nprintf(("AI", "%i: Ship %s selecting weapon %s (<50%% shields)\n", Framecount, shipp->ship_name, Weapon_info[swp->primary_bank_weapons[i_balancedfactor_prev_bank]].name));
|
||||
return i_balancedfactor_prev_bank; // Return
|
||||
}
|
||||
else
|
||||
{
|
||||
// Should be using best shield destroying gun
|
||||
int i;
|
||||
float i_hullfactor_prev = 0; // Previous weapon bank hull factor (this is the safe way to do it)
|
||||
int i_hullfactor_prev_bank = -1; // Bank which gave us this hull factor
|
||||
float i_shieldfactor_prev = 0; // Previous weapon bank shield factor (this is the safe way to do it)
|
||||
int i_shieldfactor_prev_bank = -1; // Bank which gave us this shield factor
|
||||
// Find the weapon with the highest average hull and shield * damage / fire delay factor
|
||||
for (i = 0; i < swp->num_primary_banks; i++)
|
||||
for (int i = 0; i < swp->num_primary_banks; i++)
|
||||
{
|
||||
if (swp->primary_bank_weapons[i] > -1) // Make sure there is a weapon in the bank
|
||||
if (swp->primary_bank_weapons[i] >= 0) // Make sure there is a weapon in the bank
|
||||
{
|
||||
if ((((Weapon_info[swp->primary_bank_weapons[i]].shield_factor) * Weapon_info[swp->primary_bank_weapons[i]].damage) / Weapon_info[swp->primary_bank_weapons[i]].fire_wait) > i_hullfactor_prev)
|
||||
auto wip = &Weapon_info[swp->primary_bank_weapons[i]];
|
||||
if ((((wip->shield_factor) * wip->damage) / wip->fire_wait) > i_shieldfactor_prev)
|
||||
{
|
||||
if ( !(Weapon_info[swp->primary_bank_weapons[i]].wi_flags[Weapon::Info_Flags::Capital_plus]) )
|
||||
if ( !(wip->wi_flags[Weapon::Info_Flags::Capital_plus]) )
|
||||
{
|
||||
// This weapon is the new candidate
|
||||
i_hullfactor_prev = ( ((Weapon_info[swp->primary_bank_weapons[i]].shield_factor) * (Weapon_info[swp->primary_bank_weapons[i]].damage)) / Weapon_info[swp->primary_bank_weapons[i]].fire_wait );
|
||||
i_hullfactor_prev_bank = i;
|
||||
i_shieldfactor_prev = ( ((wip->shield_factor) * (wip->damage)) / wip->fire_wait );
|
||||
i_shieldfactor_prev_bank = i;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
if (i_hullfactor_prev_bank == -1) // In the unlikely instance we don't find at least 1 candidate weapon
|
||||
if (i_shieldfactor_prev_bank == -1) // In the unlikely instance we don't find at least 1 candidate weapon
|
||||
{
|
||||
i_hullfactor_prev_bank = 0; // Just switch to the first one
|
||||
i_shieldfactor_prev_bank = 0; // Just switch to the first one
|
||||
}
|
||||
swp->current_primary_bank = i_hullfactor_prev_bank; // Select the best weapon
|
||||
nprintf(("AI", "%i: Ship %s selecting weapon %s (>50%% shields)\n", Framecount, Ships[objp->instance].ship_name, Weapon_info[swp->primary_bank_weapons[i_hullfactor_prev_bank]].name));
|
||||
return i_hullfactor_prev_bank; // Return
|
||||
swp->current_primary_bank = i_shieldfactor_prev_bank; // Select the best weapon
|
||||
nprintf(("AI", "%i: Ship %s selecting weapon %s (>50%% shields)\n", Framecount, shipp->ship_name, Weapon_info[swp->primary_bank_weapons[i_shieldfactor_prev_bank]].name));
|
||||
return i_shieldfactor_prev_bank; // Return
|
||||
}
|
||||
}
|
||||
|
||||
@@ -5504,33 +5506,35 @@ void set_primary_weapon_linkage(object *objp)
|
||||
weapon_info *wip;
|
||||
|
||||
shipp = &Ships[objp->instance];
|
||||
|
||||
if (Num_weapons > (int) (MAX_WEAPONS * 0.75f)) {
|
||||
if (shipp->flags[Ship::Ship_Flags::Primary_linked]) {
|
||||
nprintf(("AI", "Frame %i, ship %s: Unlinking primaries.\n", Framecount, shipp->ship_name));
|
||||
shipp->flags.remove(Ship::Ship_Flags::Primary_linked);
|
||||
}
|
||||
return; // If low on slots, don't link.
|
||||
}
|
||||
|
||||
sip = &Ship_info[shipp->ship_info_index];
|
||||
aip = &Ai_info[shipp->ai_index];
|
||||
swp = &shipp->weapons;
|
||||
|
||||
shipp->flags.remove(Ship::Ship_Flags::Primary_linked);
|
||||
shipp->flags.remove(Ship::Ship_Flags::Primary_linked);
|
||||
|
||||
// AL: ensure target is a ship!
|
||||
if ( (aip->target_objnum != -1) && (Objects[aip->target_objnum].type == OBJ_SHIP) ) {
|
||||
// If trying to destroy a big ship (i.e., not disable/disarm), always unleash all weapons
|
||||
if ( Ship_info[Ships[Objects[aip->target_objnum].instance].ship_info_index].is_big_ship() ) {
|
||||
if ( aip->targeted_subsys == NULL ) {
|
||||
if ( aip->targeted_subsys == nullptr ) {
|
||||
if (!sip->flags[Ship::Info_Flags::No_primary_linking] ) {
|
||||
shipp->flags.set(Ship::Ship_Flags::Primary_linked);
|
||||
}
|
||||
shipp->flags.set(Ship::Ship_Flags::Secondary_dual_fire);
|
||||
shipp->flags.set(Ship::Ship_Flags::Secondary_dual_fire);
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (Num_weapons > (int) (MAX_WEAPONS * 0.75f) || sip->flags[Ship::Info_Flags::No_primary_linking]) {
|
||||
if (shipp->flags[Ship::Ship_Flags::Primary_linked])
|
||||
nprintf(("AI", "Frame %i, ship %s: Unlinking primaries.\n", Framecount, shipp->ship_name));
|
||||
shipp->flags.remove(Ship::Ship_Flags::Primary_linked);
|
||||
return; // If low on slots or primary linking disallowed, don't link.
|
||||
}
|
||||
|
||||
// AL 2-11-98: If ship has a disarm or disable goal, don't link unless both weapons are
|
||||
// puncture weapons
|
||||
if ( (aip->active_goal != AI_GOAL_NONE) && (aip->active_goal != AI_ACTIVE_GOAL_DYNAMIC) )
|
||||
@@ -5632,7 +5636,7 @@ int ai_fire_primary_weapon(object *objp)
|
||||
ai_info *aip;
|
||||
object *enemy_objp;
|
||||
|
||||
Assert( shipp->ship_info_index >= 0 && shipp->ship_info_index < static_cast<int>(Ship_info.size()));
|
||||
Assert( shipp->ship_info_index >= 0 && shipp->ship_info_index < ship_info_size());
|
||||
|
||||
aip = &Ai_info[shipp->ai_index];
|
||||
|
||||
@@ -6058,7 +6062,7 @@ int ai_fire_secondary_weapon(object *objp)
|
||||
shipp = &Ships[objp->instance];
|
||||
swp = &shipp->weapons;
|
||||
|
||||
Assert( shipp->ship_info_index >= 0 && shipp->ship_info_index < static_cast<int>(Ship_info.size()));
|
||||
Assert( shipp->ship_info_index >= 0 && shipp->ship_info_index < ship_info_size());
|
||||
|
||||
// Select secondary weapon.
|
||||
current_bank = swp->current_secondary_bank;
|
||||
@@ -10681,7 +10685,7 @@ void ai_dock()
|
||||
char *goal_dock_path_name = model_get(goal_sip->model_num)->paths[aip->mp_index].name;
|
||||
|
||||
mprintf(("Ship class %s has only %i points on dock path \"%s\". Recommended minimum number of points is 4. "\
|
||||
"Docking along that path will look strange. You may wish to edit the model.", goal_ship_class_name, aip->path_length, goal_dock_path_name));
|
||||
"Docking along that path will look strange. You may wish to edit the model.\n", goal_ship_class_name, aip->path_length, goal_dock_path_name));
|
||||
}
|
||||
|
||||
aip->submode = AIS_DOCK_1;
|
||||
@@ -14077,53 +14081,74 @@ void ai_frame(int objnum)
|
||||
}
|
||||
}
|
||||
|
||||
static void ai_control_info_check(ai_info *aip)
|
||||
static void ai_control_info_check(ai_info *aip, physics_info *pi)
|
||||
{
|
||||
if(aip->ai_override_flags.none_set())
|
||||
if (aip->ai_override_flags.none_set())
|
||||
return;
|
||||
|
||||
if(timestamp_elapsed(aip->ai_override_timestamp)) {
|
||||
if (!aip->ai_override_flags[AI::Maneuver_Override_Flags::Never_expire] && timestamp_elapsed(aip->ai_override_timestamp))
|
||||
{
|
||||
aip->ai_override_flags.reset();
|
||||
} else {
|
||||
if(aip->ai_override_flags[AI::Maneuver_Override_Flags::Full])
|
||||
}
|
||||
else
|
||||
{
|
||||
if (aip->ai_override_flags[AI::Maneuver_Override_Flags::Full_rot])
|
||||
{
|
||||
AI_ci.pitch = aip->ai_override_ci.pitch;
|
||||
AI_ci.heading = aip->ai_override_ci.heading;
|
||||
AI_ci.bank = aip->ai_override_ci.bank;
|
||||
} else {
|
||||
if(aip->ai_override_flags[AI::Maneuver_Override_Flags::Pitch])
|
||||
}
|
||||
else
|
||||
{
|
||||
if (aip->ai_override_flags[AI::Maneuver_Override_Flags::Pitch])
|
||||
{
|
||||
AI_ci.pitch = aip->ai_override_ci.pitch;
|
||||
}
|
||||
if(aip->ai_override_flags[AI::Maneuver_Override_Flags::Heading])
|
||||
if (aip->ai_override_flags[AI::Maneuver_Override_Flags::Heading])
|
||||
{
|
||||
AI_ci.heading = aip->ai_override_ci.heading;
|
||||
}
|
||||
if(aip->ai_override_flags[AI::Maneuver_Override_Flags::Roll])
|
||||
if (aip->ai_override_flags[AI::Maneuver_Override_Flags::Roll])
|
||||
{
|
||||
AI_ci.bank = aip->ai_override_ci.bank;
|
||||
}
|
||||
}
|
||||
if(aip->ai_override_flags[AI::Maneuver_Override_Flags::Full_lat])
|
||||
|
||||
if (aip->ai_override_flags[AI::Maneuver_Override_Flags::Full_lat])
|
||||
{
|
||||
AI_ci.vertical = aip->ai_override_ci.vertical;
|
||||
AI_ci.sideways = aip->ai_override_ci.sideways;
|
||||
AI_ci.forward = aip->ai_override_ci.forward;
|
||||
} else {
|
||||
if(aip->ai_override_flags[AI::Maneuver_Override_Flags::Up])
|
||||
}
|
||||
else
|
||||
{
|
||||
if (aip->ai_override_flags[AI::Maneuver_Override_Flags::Up])
|
||||
{
|
||||
AI_ci.vertical = aip->ai_override_ci.vertical;
|
||||
}
|
||||
if(aip->ai_override_flags[AI::Maneuver_Override_Flags::Sideways])
|
||||
if (aip->ai_override_flags[AI::Maneuver_Override_Flags::Sideways])
|
||||
{
|
||||
AI_ci.sideways = aip->ai_override_ci.sideways;
|
||||
}
|
||||
if(aip->ai_override_flags[AI::Maneuver_Override_Flags::Forward])
|
||||
if (aip->ai_override_flags[AI::Maneuver_Override_Flags::Forward])
|
||||
{
|
||||
AI_ci.forward = aip->ai_override_ci.forward;
|
||||
}
|
||||
}
|
||||
|
||||
if (aip->ai_override_flags[AI::Maneuver_Override_Flags::Dont_bank_when_turning])
|
||||
AI_ci.control_flags |= CIF_DONT_BANK_WHEN_TURNING;
|
||||
if (aip->ai_override_flags[AI::Maneuver_Override_Flags::Dont_clamp_max_velocity])
|
||||
AI_ci.control_flags |= CIF_DONT_CLAMP_MAX_VELOCITY;
|
||||
if (aip->ai_override_flags[AI::Maneuver_Override_Flags::Instantaneous_acceleration])
|
||||
AI_ci.control_flags |= CIF_INSTANTANEOUS_ACCELERATION;
|
||||
}
|
||||
|
||||
// set physics flag according to whether we are instantaneously accelerating
|
||||
if (AI_ci.control_flags & CIF_INSTANTANEOUS_ACCELERATION)
|
||||
pi->flags |= PF_NO_DAMP;
|
||||
else
|
||||
pi->flags &= ~PF_NO_DAMP;
|
||||
}
|
||||
|
||||
int Last_ai_obj = -1;
|
||||
@@ -14178,7 +14203,7 @@ void ai_process( object * obj, int ai_index, float frametime )
|
||||
|
||||
if (rfc == 1) {
|
||||
// Wanderer - sexp based override goes here - only if rfc is valid though
|
||||
ai_control_info_check(aip);
|
||||
ai_control_info_check(aip, &obj->phys_info);
|
||||
vec3d copy_desired_rotvel = obj->phys_info.rotvel;
|
||||
physics_read_flying_controls( &obj->orient, &obj->phys_info, &AI_ci, frametime);
|
||||
// if obj is in formation and not flight leader, don't update rotvel
|
||||
|
||||
+37
-5
@@ -21,6 +21,7 @@
|
||||
#include "object/waypoint.h"
|
||||
#include "parse/sexp.h"
|
||||
#include "playerman/player.h"
|
||||
#include "scripting/scripting.h"
|
||||
#include "ship/ship.h"
|
||||
#include "weapon/weapon.h"
|
||||
|
||||
@@ -268,6 +269,12 @@ void ai_clear_ship_goals( ai_info *aip )
|
||||
{
|
||||
ai_do_default_behavior( &Objects[Ships[aip->shipnum].objnum] );
|
||||
}
|
||||
|
||||
// add scripting hook for 'On Goals Cleared' --wookieejedi
|
||||
Script_system.SetHookObject("Ship", &Objects[Ships[aip->shipnum].objnum]);
|
||||
Script_system.RunCondition(CHA_ONGOALSCLEARED);
|
||||
Script_system.RemHookVars(1, "Ship");
|
||||
|
||||
}
|
||||
|
||||
void ai_clear_wing_goals( int wingnum )
|
||||
@@ -1369,7 +1376,7 @@ void ai_copy_mission_wing_goal( ai_goal *aigp, ai_info *aip )
|
||||
}
|
||||
|
||||
if (j >= MAX_AI_GOALS) {
|
||||
mprintf(("Unable to assign wing goal to ship %s; the ship goals are already filled to capacity", Ships[aip->shipnum].ship_name));
|
||||
mprintf(("Unable to assign wing goal to ship %s; the ship goals are already filled to capacity\n", Ships[aip->shipnum].ship_name));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1499,7 +1506,8 @@ int ai_mission_goal_achievable( int objnum, ai_goal *aigp )
|
||||
Assert ( aigp->ai_submode >= 0 );
|
||||
ssp = ship_get_indexed_subsys( &Ships[sindex], aigp->ai_submode );
|
||||
if (ssp != NULL) {
|
||||
status = mission_log_get_time( LOG_SHIP_SUBSYS_DESTROYED, aigp->target_name, ssp->system_info->subobj_name, NULL );
|
||||
// see MWA 3/20/97 comment above - instead of checking the mission log, check the current hits
|
||||
status = (ssp->current_hits <= 0.0f) ? 1 : 0;
|
||||
} else {
|
||||
// not supposed to ever happen, but could if there is a mismatch between the table and model subsystems
|
||||
nprintf(("AI", "Couldn't find subsystem %d for ship %s\n", aigp->ai_submode, Ships[sindex].ship_name));
|
||||
@@ -1509,12 +1517,36 @@ int ai_mission_goal_achievable( int objnum, ai_goal *aigp )
|
||||
}
|
||||
|
||||
case AI_GOAL_DISABLE_SHIP:
|
||||
status = mission_log_get_time( LOG_SHIP_DISABLED, aigp->target_name, NULL, NULL );
|
||||
{
|
||||
// shipnum could be -1 depending on if the ship hasn't arrived or died. only look for subsystem
|
||||
// destroyed when shipnum is valid
|
||||
sindex = ship_name_lookup(aigp->target_name);
|
||||
|
||||
// can't determine the status of this goal if ship not valid
|
||||
if (sindex < 0) {
|
||||
status = 0;
|
||||
} else {
|
||||
// see MWA 3/20/97 comment above - instead of checking the mission log, check the current hits
|
||||
status = (Ships[sindex].subsys_info[SUBSYSTEM_ENGINE].aggregate_current_hits <= 0.0f) ? 1 : 0;
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
case AI_GOAL_DISARM_SHIP:
|
||||
status = mission_log_get_time( LOG_SHIP_DISARMED, aigp->target_name, NULL, NULL );
|
||||
{
|
||||
// shipnum could be -1 depending on if the ship hasn't arrived or died. only look for subsystem
|
||||
// destroyed when shipnum is valid
|
||||
sindex = ship_name_lookup(aigp->target_name);
|
||||
|
||||
// can't determine the status of this goal if ship not valid
|
||||
if (sindex < 0) {
|
||||
status = 0;
|
||||
} else {
|
||||
// see MWA 3/20/97 comment above - instead of checking the mission log, check the current hits
|
||||
status = (Ships[sindex].subsys_info[SUBSYSTEM_TURRET].aggregate_current_hits <= 0.0f) ? 1 : 0;
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
// to guard or ignore a ship, the goal cannot continue if the ship being guarded is either destroyed
|
||||
// or has departed.
|
||||
@@ -1626,7 +1658,7 @@ int ai_mission_goal_achievable( int objnum, ai_goal *aigp )
|
||||
status = SHIP_STATUS_ARRIVED;
|
||||
}
|
||||
// goal ship is still on the arrival list
|
||||
else if ( mission_parse_get_arrival_ship(aigp->target_name) )
|
||||
else if ( mission_check_ship_yet_to_arrive(aigp->target_name) )
|
||||
{
|
||||
status = SHIP_STATUS_NOT_ARRIVED;
|
||||
}
|
||||
|
||||
+10
-7
@@ -856,11 +856,11 @@ int get_nearest_turret_objnum(int turret_parent_objnum, ship_subsys *turret_subs
|
||||
// flags for weapon types
|
||||
if (beam_flag)
|
||||
eeo.eeo_flags |= EEOF_BEAM;
|
||||
else if (flak_flag)
|
||||
if (flak_flag)
|
||||
eeo.eeo_flags |= EEOF_FLAK;
|
||||
else if (laser_flag)
|
||||
if (laser_flag)
|
||||
eeo.eeo_flags |= EEOF_LASER;
|
||||
else if (missile_flag)
|
||||
if (missile_flag)
|
||||
eeo.eeo_flags |= EEOF_MISSILE;
|
||||
|
||||
eeo.enemy_team_mask = enemy_team_mask;
|
||||
@@ -1678,7 +1678,12 @@ void turret_set_next_fire_timestamp(int weapon_num, weapon_info *wip, ship_subsy
|
||||
wait *= wip->burst_delay;
|
||||
turret->weapons.burst_counter[weapon_num]++;
|
||||
} else {
|
||||
wait *= wip->fire_wait;
|
||||
// Random fire delay (DahBlount) used in ship_fire_primary(), added here by wookieejedi to correct oversight
|
||||
if (wip->max_delay != 0.0f && wip->min_delay != 0.0f) {
|
||||
wait *= frand_range(wip->min_delay, wip->max_delay);
|
||||
} else {
|
||||
wait *= wip->fire_wait;
|
||||
}
|
||||
if ((wip->burst_shots > 0) && (wip->burst_flags[Weapon::Burst_Flags::Random_length])) {
|
||||
turret->weapons.burst_counter[weapon_num] = (myrand() % wip->burst_shots);
|
||||
} else {
|
||||
@@ -1807,7 +1812,7 @@ bool turret_fire_weapon(int weapon_num, ship_subsys *turret, int parent_objnum,
|
||||
parent_aip = &Ai_info[Ships[Objects[parent_objnum].instance].ai_index];
|
||||
parent_ship = &Ships[Objects[parent_objnum].instance];
|
||||
wip = get_turret_weapon_wip(&turret->weapons, weapon_num);
|
||||
int turret_weapon_class = WEAPON_INFO_INDEX(wip);
|
||||
int turret_weapon_class = weapon_info_get_index(wip);
|
||||
|
||||
#ifndef NDEBUG
|
||||
// moved here from check_ok_to_fire
|
||||
@@ -2726,8 +2731,6 @@ void ai_fire_from_turret(ship *shipp, ship_subsys *ss, int parent_objnum)
|
||||
|
||||
if(!something_was_ok_to_fire)
|
||||
{
|
||||
mprintf(("nothing ok to fire\n"));
|
||||
|
||||
if (ss->turret_best_weapon >= 0) {
|
||||
//Impose a penalty on turret accuracy for losing site of its goal, or just not being able to fire.
|
||||
turret_update_enemy_in_range(ss, -4*Weapon_info[ss->turret_best_weapon].fire_wait);
|
||||
|
||||
@@ -478,7 +478,7 @@ static void asteroid_load(int asteroid_info_index, int asteroid_subtype)
|
||||
}
|
||||
else
|
||||
{
|
||||
nprintf(("Warning", "For asteroid '%s', detail level mismatch (POF needs %d)", asip->name, pm->n_detail_levels));
|
||||
nprintf(("Warning", "For asteroid '%s', detail level mismatch (POF needs %d)\n", asip->name, pm->n_detail_levels));
|
||||
}
|
||||
}
|
||||
// Stuff detail level distances.
|
||||
@@ -1937,11 +1937,11 @@ static void asteroid_parse_tbl()
|
||||
if (tally != max_asteroids)
|
||||
{
|
||||
#ifndef NDEBUG
|
||||
mprintf(("Asteroid.tbl as parsed:\n"));
|
||||
for (SCP_vector<SCP_string>::iterator iter = parsed_asteroids.begin();
|
||||
iter != parsed_asteroids.end(); ++iter)
|
||||
{
|
||||
mprintf(("Asteroid.tbl as parsed:\n"));
|
||||
mprintf(("%s", iter->c_str()));
|
||||
mprintf(("%s\n", iter->c_str()));
|
||||
}
|
||||
#endif
|
||||
Error(LOCATION,
|
||||
|
||||
@@ -218,9 +218,9 @@ bool StartAutopilot()
|
||||
if (shipp->team != Player_ship->team)
|
||||
continue;
|
||||
|
||||
Assertion((shipp->ship_info_index >= 0) && (shipp->ship_info_index < static_cast<int>(Ship_info.size())),
|
||||
Assertion((shipp->ship_info_index >= 0) && (shipp->ship_info_index < 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, static_cast<int>(Ship_info.size()));
|
||||
shipp->ship_name, shipp->ship_info_index, ship_info_size());
|
||||
ship_info *sip = &Ship_info[shipp->ship_info_index];
|
||||
|
||||
if ( !(sip->flags[Ship::Info_Flags::Support]) )
|
||||
|
||||
@@ -10,12 +10,9 @@
|
||||
#define BMPMAN_NDEBUG
|
||||
#endif
|
||||
|
||||
#define WIN32_LEAN_AND_MEAN
|
||||
#define BMPMAN_INTERNAL
|
||||
|
||||
#ifdef _WIN32
|
||||
#include <windows.h>
|
||||
#endif
|
||||
|
||||
#include "anim/animplay.h"
|
||||
#include "anim/packunpack.h"
|
||||
#include "bmpman/bm_internal.h"
|
||||
|
||||
+68
-2
@@ -38,6 +38,9 @@
|
||||
|
||||
#include <limits>
|
||||
|
||||
char Cfile_root_dir[CFILE_ROOT_DIRECTORY_LEN] = "";
|
||||
char Cfile_user_dir[CFILE_ROOT_DIRECTORY_LEN] = "";
|
||||
|
||||
// During cfile_init, verify that Pathtypes[n].index == n for each item
|
||||
// Each path must have a valid parent that can be tracable all the way back to the root
|
||||
// so that we can create directories when we need to.
|
||||
@@ -100,6 +103,8 @@ static char Cfile_stack[CFILE_STACK_MAX][CFILE_ROOT_DIRECTORY_LEN];
|
||||
|
||||
std::array<CFILE, MAX_CFILE_BLOCKS> Cfile_block_list;
|
||||
|
||||
static const char *Cfile_cdrom_dir = NULL;
|
||||
|
||||
//
|
||||
// Function prototypes for internally-called functions
|
||||
//
|
||||
@@ -142,15 +147,47 @@ void cfile_close()
|
||||
#define MIN_NUM_PATH_COMPONENTS 3 /* Drive + directory + file */
|
||||
#endif
|
||||
|
||||
/**
|
||||
* @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);
|
||||
}
|
||||
|
||||
/**
|
||||
* @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 SCP_vector<cfile::ModRoot>& modRoots)
|
||||
int cfile_init(const char *exe_dir, const char *cdrom_dir)
|
||||
{
|
||||
// initialize encryption
|
||||
encrypt_init();
|
||||
@@ -159,8 +196,36 @@ int cfile_init(const SCP_vector<cfile::ModRoot>& modRoots)
|
||||
return 0;
|
||||
}
|
||||
|
||||
char buf[CFILE_ROOT_DIRECTORY_LEN];
|
||||
|
||||
strncpy(buf, exe_dir, CFILE_ROOT_DIRECTORY_LEN - 1);
|
||||
buf[CFILE_ROOT_DIRECTORY_LEN - 1] = '\0';
|
||||
|
||||
// are we in a root directory?
|
||||
if(cfile_in_root_dir(buf)){
|
||||
os::dialogs::Message(os::dialogs::MESSAGEBOX_ERROR, "FreeSpace2/Fred2 cannot be run from a drive root directory!");
|
||||
return 1;
|
||||
}
|
||||
|
||||
// This needs to be set here because cf_build_secondary_filelist assumes it to be true
|
||||
cfile_inited = 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.
|
||||
*/
|
||||
|
||||
char *p;
|
||||
|
||||
p = strrchr(buf, DIR_SEPARATOR_CHAR);
|
||||
*p = '\0';
|
||||
|
||||
cfile_chdir(buf);
|
||||
|
||||
// set root directory
|
||||
strcpy_s(Cfile_root_dir, buf);
|
||||
strcpy_s(Cfile_user_dir, os_get_config_path().c_str());
|
||||
|
||||
// Initialize the block list with proper data
|
||||
Cfile_block_list.fill({});
|
||||
@@ -168,7 +233,8 @@ int cfile_init(const SCP_vector<cfile::ModRoot>& modRoots)
|
||||
// 32 bit CRC table init
|
||||
cf_chksum_long_init();
|
||||
|
||||
cf_build_secondary_filelist(modRoots);
|
||||
Cfile_cdrom_dir = cdrom_dir;
|
||||
cf_build_secondary_filelist(Cfile_cdrom_dir);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
+7
-14
@@ -165,22 +165,11 @@ extern const char *Get_file_list_child;
|
||||
|
||||
// cfile directory. valid after cfile_init() returns successfully
|
||||
#define CFILE_ROOT_DIRECTORY_LEN 256
|
||||
|
||||
namespace cfile {
|
||||
enum class ModRootType { Unknown, Folder, Package };
|
||||
|
||||
enum class LocationType { Unknown, SecondaryMod, PrimaryMod, GameRoot };
|
||||
|
||||
struct ModRoot {
|
||||
ModRootType type = ModRootType::Unknown;
|
||||
SCP_string path;
|
||||
LocationType location_type = LocationType::Unknown;
|
||||
bool user_location = false;
|
||||
};
|
||||
} // namespace cfile
|
||||
extern char Cfile_root_dir[CFILE_ROOT_DIRECTORY_LEN];
|
||||
extern char Cfile_user_dir[CFILE_ROOT_DIRECTORY_LEN];
|
||||
|
||||
//================= LOW-LEVEL FUNCTIONS ==================
|
||||
int cfile_init(const SCP_vector<cfile::ModRoot>& modRoots);
|
||||
int cfile_init(const char *exe_dir, const char *cdrom_dir=NULL);
|
||||
void cfile_close();
|
||||
|
||||
// add an extension to a filename if it doesn't already have it
|
||||
@@ -302,6 +291,10 @@ uint cf_add_chksum_long(uint seed, ubyte *buffer, size_t size);
|
||||
#define CF_RENAME_FAIL_EXIST 2 // old name does not exist
|
||||
int cf_rename(const char *old_name, const char *name, int type = CF_TYPE_ANY );
|
||||
|
||||
// Creates the directory path if it doesn't exist. Even creates all its
|
||||
// parent paths.
|
||||
void cf_create_directory(int dir_type, uint32_t location_flags = CF_LOCATION_ALL);
|
||||
|
||||
// changes the attributes of a file
|
||||
void cf_attrib(const char *name, int set, int clear, int type);
|
||||
|
||||
|
||||
@@ -1,266 +0,0 @@
|
||||
#define _CFILE_INTERNAL
|
||||
|
||||
#include "cfilemod.h"
|
||||
#include "cfile.h"
|
||||
#include "cmdline/cmdline.h"
|
||||
#include "osapi/osapi.h"
|
||||
#include "cfilesystem.h"
|
||||
|
||||
#ifdef SCP_UNIX
|
||||
#include <glob.h>
|
||||
#include <sys/types.h>
|
||||
#include <dirent.h>
|
||||
#include <fnmatch.h>
|
||||
#include <sys/stat.h>
|
||||
#include <unistd.h>
|
||||
#include <libgen.h>
|
||||
#endif
|
||||
|
||||
namespace cfile {
|
||||
|
||||
namespace {
|
||||
|
||||
typedef struct cf_root_sort {
|
||||
SCP_string path;
|
||||
int cf_type;
|
||||
} cf_root_sort;
|
||||
|
||||
// packfile sort function
|
||||
bool cf_packfile_sort_func(const cf_root_sort& r1, const cf_root_sort& r2) {
|
||||
// if the 2 directory types are the same, do a string compare
|
||||
if (r1.cf_type == r2.cf_type) {
|
||||
return (stricmp(r1.path.c_str(), r2.path.c_str()) < 0);
|
||||
}
|
||||
|
||||
// otherwise return them in order of CF_TYPE_* precedence
|
||||
return (r1.cf_type < r2.cf_type);
|
||||
}
|
||||
|
||||
// Go through a root and look for pack files
|
||||
void build_pack_list(SCP_vector<ModRoot>& mod_roots,
|
||||
const SCP_string& search_path,
|
||||
LocationType location_type,
|
||||
bool user_location) {
|
||||
char filespec[MAX_PATH_LEN];
|
||||
|
||||
// allocate a temporary array of temporary roots so we can easily sort them
|
||||
SCP_vector<cf_root_sort> temp_roots_sort;
|
||||
|
||||
// now just setup all the root info
|
||||
for (int i = CF_TYPE_ROOT; i < CF_MAX_PATH_TYPES; i++) {
|
||||
strcpy_s(filespec, search_path.c_str());
|
||||
|
||||
if (strlen(Pathtypes[i].path)) {
|
||||
strcat_s(filespec, Pathtypes[i].path);
|
||||
|
||||
if (filespec[strlen(filespec) - 1] != DIR_SEPARATOR_CHAR)
|
||||
strcat_s(filespec, DIR_SEPARATOR_STR);
|
||||
}
|
||||
|
||||
#if defined _WIN32
|
||||
strcat_s( filespec, "*.vp" );
|
||||
|
||||
intptr_t find_handle;
|
||||
_finddata_t find;
|
||||
|
||||
find_handle = _findfirst( filespec, &find );
|
||||
|
||||
if (find_handle != -1) {
|
||||
do {
|
||||
// add the new item
|
||||
if (!(find.attrib & _A_SUBDIR)) {
|
||||
|
||||
// get a temp pointer
|
||||
rptr_sort = &temp_roots_sort[root_index++];
|
||||
|
||||
// fill in all the proper info
|
||||
strcpy_s(rptr_sort->path, root->path);
|
||||
|
||||
if(strlen(Pathtypes[i].path)) {
|
||||
|
||||
strcat_s(rptr_sort->path, Pathtypes[i].path );
|
||||
strcat_s(rptr_sort->path, DIR_SEPARATOR_STR);
|
||||
}
|
||||
|
||||
strcat_s(rptr_sort->path, find.name );
|
||||
rptr_sort->roottype = CF_ROOTTYPE_PACK;
|
||||
rptr_sort->cf_type = i;
|
||||
}
|
||||
|
||||
} while (!_findnext(find_handle, &find));
|
||||
|
||||
_findclose( find_handle );
|
||||
}
|
||||
#elif defined SCP_UNIX
|
||||
strcat_s(filespec, "*.[vV][pP]");
|
||||
glob_t globinfo;
|
||||
|
||||
memset(&globinfo, 0, sizeof(globinfo));
|
||||
|
||||
int status = glob(filespec, 0, NULL, &globinfo);
|
||||
|
||||
if (status == 0) {
|
||||
for (uint j = 0; j < globinfo.gl_pathc; j++) {
|
||||
// Determine if this is a regular file
|
||||
struct stat statbuf;
|
||||
memset(&statbuf, 0, sizeof(statbuf));
|
||||
stat(globinfo.gl_pathv[j], &statbuf);
|
||||
|
||||
if (S_ISREG(statbuf.st_mode)) {
|
||||
|
||||
cf_root_sort sort;
|
||||
|
||||
// fill in all the proper info
|
||||
sort.path = globinfo.gl_pathv[j];
|
||||
sort.cf_type = i;
|
||||
temp_roots_sort.push_back(sort);
|
||||
}
|
||||
}
|
||||
|
||||
globfree(&globinfo);
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
// sort the roots
|
||||
std::sort(temp_roots_sort.begin(), temp_roots_sort.end(), cf_packfile_sort_func);
|
||||
|
||||
// now insert them all into the real root list properly
|
||||
for (const auto& pack_root : temp_roots_sort) {
|
||||
ModRoot root;
|
||||
root.type = ModRootType::Package;
|
||||
root.path = pack_root.path;
|
||||
root.user_location = user_location;
|
||||
root.location_type = location_type;
|
||||
|
||||
mod_roots.push_back(root);
|
||||
}
|
||||
}
|
||||
|
||||
char normalize_directory_separator(char in) {
|
||||
if (in == '/') {
|
||||
return DIR_SEPARATOR_CHAR;
|
||||
}
|
||||
|
||||
return in;
|
||||
}
|
||||
|
||||
void
|
||||
add_mod_roots(SCP_vector<ModRoot>& mod_roots, const char* mod_cmdline, const SCP_string& rootDirectory, bool user_location) {
|
||||
if (mod_cmdline) {
|
||||
bool primary = true;
|
||||
for (const char* cur_pos = mod_cmdline; strlen(cur_pos) != 0; cur_pos += (strlen(cur_pos) + 1)) {
|
||||
SCP_stringstream ss;
|
||||
ss << rootDirectory;
|
||||
|
||||
if (rootDirectory.back() != DIR_SEPARATOR_CHAR) {
|
||||
ss << DIR_SEPARATOR_CHAR;
|
||||
}
|
||||
|
||||
ss << cur_pos << DIR_SEPARATOR_STR;
|
||||
|
||||
SCP_string rootPath = ss.str();
|
||||
|
||||
// normalize the path to the native path format
|
||||
std::transform(rootPath.begin(), rootPath.end(), rootPath.begin(), normalize_directory_separator);
|
||||
|
||||
ModRoot root;
|
||||
root.type = ModRootType::Folder;
|
||||
root.path = rootPath;
|
||||
root.user_location = user_location;
|
||||
|
||||
if (primary) {
|
||||
root.location_type = LocationType::PrimaryMod;
|
||||
} else {
|
||||
root.location_type = LocationType::SecondaryMod;
|
||||
}
|
||||
|
||||
mod_roots.push_back(root);
|
||||
|
||||
build_pack_list(mod_roots, rootPath, root.location_type, user_location);
|
||||
|
||||
primary = false;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
SCP_vector<ModRoot> getModRootsFromModCmdline(const SCP_string& content_root, const char* mod_cmdline) {
|
||||
SCP_vector<ModRoot> mod_roots;
|
||||
|
||||
if (os_is_legacy_mode()) {
|
||||
// =========================================================================
|
||||
#ifdef WIN32
|
||||
// Nothing to do here, Windows uses the current directory as the base
|
||||
#else
|
||||
add_mod_roots(mod_roots, mod_cmdline, os_get_legacy_user_dir(), true);
|
||||
|
||||
ModRoot root;
|
||||
root.type = ModRootType::Folder;
|
||||
root.path = os_get_legacy_user_dir();
|
||||
root.user_location = true;
|
||||
root.location_type = LocationType::GameRoot;
|
||||
|
||||
// do we already have a slash? as in the case of a root directory install
|
||||
if (root.path.back() != DIR_SEPARATOR_CHAR) {
|
||||
root.path += DIR_SEPARATOR_STR; // put trailing backslash on for easier path construction
|
||||
}
|
||||
|
||||
mod_roots.push_back(root);
|
||||
|
||||
// Next, check any VP files under the current directory.
|
||||
build_pack_list(mod_roots, root.path, root.location_type, root.user_location);
|
||||
#endif
|
||||
// =========================================================================
|
||||
} else if (!Cmdline_portable_mode) {
|
||||
// =========================================================================
|
||||
// now look for mods under the users HOME directory to use before system ones
|
||||
add_mod_roots(mod_roots, mod_cmdline, os_get_config_path(), true);
|
||||
// =========================================================================
|
||||
|
||||
// =========================================================================
|
||||
// set users HOME directory as default for loading and saving files
|
||||
ModRoot root;
|
||||
root.type = ModRootType::Folder;
|
||||
root.path = os_get_config_path();
|
||||
root.user_location = true;
|
||||
root.location_type = LocationType::GameRoot;
|
||||
|
||||
// do we already have a slash? as in the case of a root directory install
|
||||
if (root.path.back() != DIR_SEPARATOR_CHAR) {
|
||||
root.path += DIR_SEPARATOR_STR; // put trailing backslash on for easier path construction
|
||||
}
|
||||
|
||||
mod_roots.push_back(root);
|
||||
|
||||
// Next, check any VP files under the current directory.
|
||||
build_pack_list(mod_roots, root.path, root.location_type, root.user_location);
|
||||
// =========================================================================
|
||||
}
|
||||
|
||||
add_mod_roots(mod_roots, mod_cmdline, content_root, false);
|
||||
|
||||
ModRoot root;
|
||||
root.type = ModRootType::Folder;
|
||||
root.path = content_root;
|
||||
root.user_location = false;
|
||||
root.location_type = LocationType::GameRoot;
|
||||
|
||||
// do we already have a slash? as in the case of a root directory install
|
||||
if (root.path.back() != DIR_SEPARATOR_CHAR) {
|
||||
root.path += DIR_SEPARATOR_STR; // put trailing backslash on for easier path construction
|
||||
}
|
||||
|
||||
mod_roots.push_back(root);
|
||||
|
||||
//======================================================
|
||||
// Next, check any VP files under the current directory.
|
||||
build_pack_list(mod_roots, root.path, root.location_type, root.user_location);
|
||||
|
||||
return mod_roots;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -1,10 +0,0 @@
|
||||
#pragma once
|
||||
|
||||
#include "globalincs/pstypes.h"
|
||||
#include "cfile/cfile.h"
|
||||
|
||||
namespace cfile {
|
||||
|
||||
SCP_vector<ModRoot> getModRootsFromModCmdline(const SCP_string& content_root, const char* mod_cmdline);
|
||||
|
||||
}
|
||||
+394
-99
@@ -160,113 +160,379 @@ cf_root *cf_create_root()
|
||||
return &Root_blocks[block]->roots[offset];
|
||||
}
|
||||
|
||||
static bool has_mod_location(const SCP_vector<cfile::ModRoot>& modRoots)
|
||||
// return the # of packfiles which exist
|
||||
int cf_get_packfile_count(cf_root *root)
|
||||
{
|
||||
for (const auto& root : modRoots)
|
||||
SCP_string filespec;
|
||||
int i;
|
||||
int packfile_count;
|
||||
|
||||
// count up how many packfiles we're gonna have
|
||||
packfile_count = 0;
|
||||
for (i=CF_TYPE_ROOT; i<CF_MAX_PATH_TYPES; i++ )
|
||||
{
|
||||
if (root.location_type == cfile::LocationType::PrimaryMod)
|
||||
filespec = root->path;
|
||||
|
||||
if(strlen(Pathtypes[i].path))
|
||||
{
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
void cf_build_root_list(const SCP_vector<cfile::ModRoot>& modRoots)
|
||||
{
|
||||
Num_roots = 0;
|
||||
Num_path_roots = 0;
|
||||
|
||||
auto has_mod = has_mod_location(modRoots);
|
||||
|
||||
mprintf(("CFile root configuration:\n"));
|
||||
// Go through the roots specified and convert them to the internal data structure
|
||||
for (const auto& root : modRoots)
|
||||
{
|
||||
if (root.path.size() >= CF_MAX_PATHNAME_LENGTH - 1)
|
||||
{
|
||||
Error(LOCATION, "Mod root path '%s' is longer than the maximum %d!", root.path.c_str(), CF_MAX_PATHNAME_LENGTH - 1);
|
||||
return;
|
||||
}
|
||||
|
||||
auto cfile_root = cf_create_root();
|
||||
memset(cfile_root, 0, sizeof(*cfile_root));
|
||||
|
||||
strcpy_s(cfile_root->path, root.path.c_str());
|
||||
|
||||
if (root.user_location)
|
||||
{
|
||||
cfile_root->location_flags |= CF_LOCATION_ROOT_USER;
|
||||
} else {
|
||||
cfile_root->location_flags |= CF_LOCATION_ROOT_GAME;
|
||||
}
|
||||
|
||||
if (root.location_type == cfile::LocationType::SecondaryMod)
|
||||
{
|
||||
cfile_root->location_flags |= CF_LOCATION_TYPE_SECONDARY_MODS;
|
||||
} else if (root.location_type == cfile::LocationType::PrimaryMod)
|
||||
{
|
||||
cfile_root->location_flags |= CF_LOCATION_TYPE_PRIMARY_MOD;
|
||||
} else if (root.location_type == cfile::LocationType::GameRoot)
|
||||
{
|
||||
cfile_root->location_flags |= CF_LOCATION_TYPE_ROOT;
|
||||
if (!has_mod)
|
||||
filespec += Pathtypes[ i ].path;
|
||||
if ( filespec[ filespec.length( ) - 1 ] != DIR_SEPARATOR_CHAR )
|
||||
{
|
||||
// If we do not have a mod then game roots are also primary mods
|
||||
cfile_root->location_flags |= CF_LOCATION_TYPE_PRIMARY_MOD;
|
||||
}
|
||||
} else {
|
||||
UNREACHABLE("Unknown root location type!");
|
||||
}
|
||||
|
||||
switch (root.type)
|
||||
{
|
||||
case cfile::ModRootType::Folder:
|
||||
cfile_root->roottype = CF_ROOTTYPE_PATH;
|
||||
break;
|
||||
case cfile::ModRootType::Package:
|
||||
cfile_root->roottype = CF_ROOTTYPE_PACK;
|
||||
break;
|
||||
default:
|
||||
UNREACHABLE("Unknown root type!");
|
||||
break;
|
||||
}
|
||||
|
||||
if (root.type == cfile::ModRootType::Folder)
|
||||
{
|
||||
size_t path_len = strlen(cfile_root->path);
|
||||
|
||||
// do we already have a slash? as in the case of a root directory install
|
||||
if ( (path_len < (CF_MAX_PATHNAME_LENGTH-1)) && (cfile_root->path[path_len-1] != DIR_SEPARATOR_CHAR) ) {
|
||||
strcat_s(cfile_root->path, DIR_SEPARATOR_STR); // put trailing backslash on for easier path construction
|
||||
filespec += DIR_SEPARATOR_STR;
|
||||
}
|
||||
}
|
||||
|
||||
#ifndef NDEBUG
|
||||
switch (root.type)
|
||||
{
|
||||
case cfile::ModRootType::Folder:
|
||||
mprintf((" Found root folder '%s'\n", root.path.c_str()));
|
||||
break;
|
||||
case cfile::ModRootType::Package: {
|
||||
uint chksum = 0;
|
||||
cf_chksum_pack(root.path.c_str(), &chksum);
|
||||
mprintf((" Found root pack '%s' with a checksum of 0x%08x\n", root.path.c_str(), chksum));
|
||||
break;
|
||||
}
|
||||
default:
|
||||
UNREACHABLE("Unknown root type!");
|
||||
break;
|
||||
#if defined _WIN32
|
||||
filespec += "*.vp";
|
||||
|
||||
intptr_t find_handle;
|
||||
_finddata_t find;
|
||||
|
||||
find_handle = _findfirst( filespec.c_str( ), &find );
|
||||
|
||||
if (find_handle != -1) {
|
||||
do {
|
||||
if (!(find.attrib & _A_SUBDIR)) {
|
||||
packfile_count++;
|
||||
}
|
||||
|
||||
} while (!_findnext(find_handle, &find));
|
||||
|
||||
_findclose( find_handle );
|
||||
}
|
||||
#elif defined SCP_UNIX
|
||||
filespec += "*.[vV][pP]";
|
||||
|
||||
glob_t globinfo;
|
||||
memset(&globinfo, 0, sizeof(globinfo));
|
||||
int status = glob(filespec.c_str( ), 0, NULL, &globinfo);
|
||||
if (status == 0) {
|
||||
for (unsigned int j = 0; j < globinfo.gl_pathc; j++) {
|
||||
// Determine if this is a regular file
|
||||
struct stat statbuf;
|
||||
memset(&statbuf, 0, sizeof(statbuf));
|
||||
stat(globinfo.gl_pathv[j], &statbuf);
|
||||
if (S_ISREG(statbuf.st_mode)) {
|
||||
packfile_count++;
|
||||
}
|
||||
}
|
||||
globfree(&globinfo);
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
return packfile_count;
|
||||
}
|
||||
|
||||
// packfile sort function
|
||||
bool cf_packfile_sort_func(const cf_root_sort &r1, const cf_root_sort &r2)
|
||||
{
|
||||
// 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) < 0);
|
||||
}
|
||||
|
||||
// otherwise return them in order of CF_TYPE_* precedence
|
||||
return (r1.cf_type < r2.cf_type);
|
||||
}
|
||||
|
||||
// Go through a root and look for pack files
|
||||
void cf_build_pack_list( cf_root *root )
|
||||
{
|
||||
char filespec[MAX_PATH_LEN];
|
||||
int i;
|
||||
cf_root_sort *temp_roots_sort, *rptr_sort;
|
||||
int temp_root_count, root_index;
|
||||
|
||||
// determine how many packfiles there are
|
||||
temp_root_count = cf_get_packfile_count(root);
|
||||
|
||||
if (temp_root_count <= 0)
|
||||
return;
|
||||
|
||||
// allocate a temporary array of temporary roots so we can easily sort them
|
||||
temp_roots_sort = (cf_root_sort*)vm_malloc(sizeof(cf_root_sort) * temp_root_count);
|
||||
|
||||
if (temp_roots_sort == NULL) {
|
||||
Int3();
|
||||
return;
|
||||
}
|
||||
|
||||
// now just setup all the root info
|
||||
root_index = 0;
|
||||
for (i = CF_TYPE_ROOT; i < CF_MAX_PATH_TYPES; i++) {
|
||||
strcpy_s( filespec, root->path );
|
||||
|
||||
if ( strlen(Pathtypes[i].path) ) {
|
||||
strcat_s( filespec, Pathtypes[i].path );
|
||||
|
||||
if ( filespec[strlen(filespec)-1] != DIR_SEPARATOR_CHAR )
|
||||
strcat_s( filespec, DIR_SEPARATOR_STR );
|
||||
}
|
||||
|
||||
#if defined _WIN32
|
||||
strcat_s( filespec, "*.vp" );
|
||||
|
||||
intptr_t find_handle;
|
||||
_finddata_t find;
|
||||
|
||||
find_handle = _findfirst( filespec, &find );
|
||||
|
||||
if (find_handle != -1) {
|
||||
do {
|
||||
// add the new item
|
||||
if (!(find.attrib & _A_SUBDIR)) {
|
||||
Assert(root_index < temp_root_count);
|
||||
|
||||
// get a temp pointer
|
||||
rptr_sort = &temp_roots_sort[root_index++];
|
||||
|
||||
// fill in all the proper info
|
||||
strcpy_s(rptr_sort->path, root->path);
|
||||
|
||||
if(strlen(Pathtypes[i].path)) {
|
||||
|
||||
strcat_s(rptr_sort->path, Pathtypes[i].path );
|
||||
strcat_s(rptr_sort->path, DIR_SEPARATOR_STR);
|
||||
}
|
||||
|
||||
strcat_s(rptr_sort->path, find.name );
|
||||
rptr_sort->roottype = CF_ROOTTYPE_PACK;
|
||||
rptr_sort->cf_type = i;
|
||||
}
|
||||
|
||||
} while (!_findnext(find_handle, &find));
|
||||
|
||||
_findclose( find_handle );
|
||||
}
|
||||
#elif defined SCP_UNIX
|
||||
strcat_s( filespec, "*.[vV][pP]" );
|
||||
glob_t globinfo;
|
||||
|
||||
memset(&globinfo, 0, sizeof(globinfo));
|
||||
|
||||
int status = glob(filespec, 0, NULL, &globinfo);
|
||||
|
||||
if (status == 0) {
|
||||
for (uint j = 0; j < globinfo.gl_pathc; j++) {
|
||||
// Determine if this is a regular file
|
||||
struct stat statbuf;
|
||||
memset(&statbuf, 0, sizeof(statbuf));
|
||||
stat(globinfo.gl_pathv[j], &statbuf);
|
||||
|
||||
if ( S_ISREG(statbuf.st_mode) ) {
|
||||
Assert(root_index < temp_root_count);
|
||||
|
||||
// get a temp pointer
|
||||
rptr_sort = &temp_roots_sort[root_index++];
|
||||
|
||||
// fill in all the proper info
|
||||
strcpy_s(rptr_sort->path, globinfo.gl_pathv[j] );
|
||||
rptr_sort->roottype = CF_ROOTTYPE_PACK;
|
||||
rptr_sort->cf_type = i;
|
||||
}
|
||||
}
|
||||
|
||||
globfree(&globinfo);
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
// these should always be the same
|
||||
Assert(root_index == temp_root_count);
|
||||
|
||||
// sort the roots
|
||||
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
|
||||
for (i = 0; i < temp_root_count; i++) {
|
||||
auto new_root = cf_create_root();
|
||||
new_root->location_flags = root->location_flags;
|
||||
strcpy_s( new_root->path, root->path );
|
||||
|
||||
#ifndef NDEBUG
|
||||
uint chksum = 0;
|
||||
cf_chksum_pack(temp_roots_sort[i].path, &chksum);
|
||||
mprintf(("Found root pack '%s' with a checksum of 0x%08x\n", temp_roots_sort[i].path, chksum));
|
||||
#endif
|
||||
|
||||
// mwa -- 4/2/98 put in the next 2 lines because the path name needs to be there
|
||||
// to find the files.
|
||||
strcpy_s(new_root->path, temp_roots_sort[i].path);
|
||||
new_root->roottype = CF_ROOTTYPE_PACK;
|
||||
}
|
||||
|
||||
// free up the temp list
|
||||
vm_free(temp_roots_sort);
|
||||
}
|
||||
|
||||
static char normalize_directory_separator(char in)
|
||||
{
|
||||
if (in == '/')
|
||||
{
|
||||
return DIR_SEPARATOR_CHAR;
|
||||
}
|
||||
|
||||
return in;
|
||||
}
|
||||
|
||||
static void cf_add_mod_roots(const char* rootDirectory, uint32_t basic_location)
|
||||
{
|
||||
if (Cmdline_mod)
|
||||
{
|
||||
bool primary = true;
|
||||
for (const char* cur_pos=Cmdline_mod; strlen(cur_pos) != 0; cur_pos+= (strlen(cur_pos)+1))
|
||||
{
|
||||
SCP_stringstream ss;
|
||||
ss << rootDirectory;
|
||||
|
||||
if (rootDirectory[strlen(rootDirectory) - 1] != DIR_SEPARATOR_CHAR)
|
||||
{
|
||||
ss << DIR_SEPARATOR_CHAR;
|
||||
}
|
||||
|
||||
ss << cur_pos << DIR_SEPARATOR_STR;
|
||||
|
||||
SCP_string rootPath = ss.str();
|
||||
if (rootPath.size() + 1 >= CF_MAX_PATHNAME_LENGTH) {
|
||||
Error(LOCATION, "The length of mod directory path '%s' exceeds the maximum of %d!\n", rootPath.c_str(), CF_MAX_PATHNAME_LENGTH);
|
||||
}
|
||||
|
||||
// normalize the path to the native path format
|
||||
std::transform(rootPath.begin(), rootPath.end(), rootPath.begin(), normalize_directory_separator);
|
||||
|
||||
cf_root* root = cf_create_root();
|
||||
|
||||
strncpy(root->path, rootPath.c_str(), CF_MAX_PATHNAME_LENGTH-1);
|
||||
if (primary) {
|
||||
root->location_flags = basic_location | CF_LOCATION_TYPE_PRIMARY_MOD;
|
||||
} else {
|
||||
root->location_flags = basic_location | CF_LOCATION_TYPE_SECONDARY_MODS;
|
||||
}
|
||||
|
||||
root->roottype = CF_ROOTTYPE_PATH;
|
||||
cf_build_pack_list(root);
|
||||
|
||||
primary = false;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void cf_build_root_list(const char *cdrom_dir)
|
||||
{
|
||||
Num_roots = 0;
|
||||
Num_path_roots = 0;
|
||||
|
||||
cf_root *root = nullptr;
|
||||
|
||||
if (os_is_legacy_mode())
|
||||
{
|
||||
// =========================================================================
|
||||
#ifdef WIN32
|
||||
// Nothing to do here, Windows uses the current directory as the base
|
||||
#else
|
||||
cf_add_mod_roots(os_get_legacy_user_dir(), CF_LOCATION_ROOT_USER);
|
||||
|
||||
root = cf_create_root();
|
||||
strncpy(root->path, os_get_legacy_user_dir(), CF_MAX_PATHNAME_LENGTH - 1);
|
||||
|
||||
root->location_flags |= CF_LOCATION_ROOT_USER | CF_LOCATION_TYPE_ROOT;
|
||||
if (Cmdline_mod == nullptr || strlen(Cmdline_mod) <= 0) {
|
||||
// If there are no mods then the root is the primary mod
|
||||
root->location_flags |= CF_LOCATION_TYPE_PRIMARY_MOD;
|
||||
}
|
||||
|
||||
// do we already have a slash? as in the case of a root directory install
|
||||
if ((strlen(root->path) < (CF_MAX_PATHNAME_LENGTH - 1)) && (root->path[strlen(root->path) - 1] != DIR_SEPARATOR_CHAR)) {
|
||||
strcat_s(root->path, DIR_SEPARATOR_STR); // put trailing backslash on for easier path construction
|
||||
}
|
||||
root->roottype = CF_ROOTTYPE_PATH;
|
||||
|
||||
// Next, check any VP files under the current directory.
|
||||
cf_build_pack_list(root);
|
||||
#endif
|
||||
// =========================================================================
|
||||
}
|
||||
else if (!Cmdline_portable_mode)
|
||||
{
|
||||
// =========================================================================
|
||||
// now look for mods under the users HOME directory to use before system ones
|
||||
cf_add_mod_roots(Cfile_user_dir, CF_LOCATION_ROOT_USER);
|
||||
// =========================================================================
|
||||
|
||||
// =========================================================================
|
||||
// set users HOME directory as default for loading and saving files
|
||||
root = cf_create_root();
|
||||
strcpy_s(root->path, Cfile_user_dir);
|
||||
|
||||
root->location_flags |= CF_LOCATION_ROOT_USER | CF_LOCATION_TYPE_ROOT;
|
||||
if (Cmdline_mod == nullptr || strlen(Cmdline_mod) <= 0) {
|
||||
// If there are no mods then the root is the primary mod
|
||||
root->location_flags |= CF_LOCATION_TYPE_PRIMARY_MOD;
|
||||
}
|
||||
|
||||
// do we already have a slash? as in the case of a root directory install
|
||||
if ((strlen(root->path) < (CF_MAX_PATHNAME_LENGTH - 1)) && (root->path[strlen(root->path) - 1] != DIR_SEPARATOR_CHAR)) {
|
||||
strcat_s(root->path, DIR_SEPARATOR_STR); // put trailing backslash on for easier path construction
|
||||
}
|
||||
root->roottype = CF_ROOTTYPE_PATH;
|
||||
|
||||
// Next, check any VP files under the current directory.
|
||||
cf_build_pack_list(root);
|
||||
// =========================================================================
|
||||
}
|
||||
|
||||
char working_directory[CF_MAX_PATHNAME_LENGTH];
|
||||
|
||||
if ( !_getcwd(working_directory, CF_MAX_PATHNAME_LENGTH ) ) {
|
||||
Error(LOCATION, "Can't get current working directory -- %d", errno );
|
||||
}
|
||||
|
||||
cf_add_mod_roots(working_directory, CF_LOCATION_ROOT_GAME);
|
||||
|
||||
root = cf_create_root();
|
||||
|
||||
root->location_flags |= CF_LOCATION_ROOT_GAME | CF_LOCATION_TYPE_ROOT;
|
||||
if (Cmdline_mod == nullptr || strlen(Cmdline_mod) <= 0) {
|
||||
// If there are no mods then the root is the primary mod
|
||||
root->location_flags |= CF_LOCATION_TYPE_PRIMARY_MOD;
|
||||
}
|
||||
|
||||
strcpy_s(root->path, working_directory);
|
||||
|
||||
size_t path_len = strlen(root->path);
|
||||
|
||||
// do we already have a slash? as in the case of a root directory install
|
||||
if ( (path_len < (CF_MAX_PATHNAME_LENGTH-1)) && (root->path[path_len-1] != DIR_SEPARATOR_CHAR) ) {
|
||||
strcat_s(root->path, DIR_SEPARATOR_STR); // put trailing backslash on for easier path construction
|
||||
}
|
||||
|
||||
root->roottype = CF_ROOTTYPE_PATH;
|
||||
|
||||
//======================================================
|
||||
// Next, check any VP files under the current directory.
|
||||
cf_build_pack_list(root);
|
||||
|
||||
|
||||
//======================================================
|
||||
// Check the real CD if one...
|
||||
if ( cdrom_dir && (strlen(cdrom_dir) < CF_MAX_PATHNAME_LENGTH) ) {
|
||||
root = cf_create_root();
|
||||
strcpy_s( root->path, cdrom_dir );
|
||||
root->roottype = CF_ROOTTYPE_PATH;
|
||||
|
||||
//======================================================
|
||||
// Next, check any VP files in the CD-ROM directory.
|
||||
cf_build_pack_list(root);
|
||||
|
||||
}
|
||||
|
||||
// The final root is the in-memory root
|
||||
auto root = cf_create_root();
|
||||
root = cf_create_root();
|
||||
root->location_flags = CF_LOCATION_ROOT_MEMORY | CF_LOCATION_TYPE_ROOT;
|
||||
memset(root->path, 0, sizeof(root->path));
|
||||
root->roottype = CF_ROOTTYPE_MEMORY;
|
||||
|
||||
}
|
||||
|
||||
// Given a lower case list of file extensions
|
||||
@@ -290,17 +556,40 @@ void cf_search_root_path(int root_index)
|
||||
int i;
|
||||
int num_files = 0;
|
||||
|
||||
cf_root *root = cf_get_root(root_index);
|
||||
cf_root* root = cf_get_root(root_index);
|
||||
|
||||
mprintf(( "Searching root '%s' ... ", root->path ));
|
||||
mprintf(("Searching root '%s' ... ", root->path));
|
||||
|
||||
#ifndef WIN32
|
||||
try {
|
||||
auto current = root->path;
|
||||
const auto prefPathEnd = root->path + strlen(root->path);
|
||||
while (current != prefPathEnd) {
|
||||
const auto cp = utf8::next(current, prefPathEnd);
|
||||
if (cp > 127) {
|
||||
// On Windows, we currently do not support Unicode paths so catch this early and let the user
|
||||
// know
|
||||
const auto invalid_end = current;
|
||||
utf8::prior(current, root->path);
|
||||
Error(LOCATION,
|
||||
"Trying to use path \"%s\" as a data root. That path is not supported since it "
|
||||
"contains a Unicode character (%s). If possible, change this path to something that only uses "
|
||||
"ASCII characters.",
|
||||
root->path, std::string(current, invalid_end).c_str());
|
||||
}
|
||||
}
|
||||
} catch (const std::exception& e) {
|
||||
Error(LOCATION, "UTF-8 error while checking the root path \"%s\": %s", root->path, e.what());
|
||||
}
|
||||
#endif
|
||||
|
||||
char search_path[CF_MAX_PATHNAME_LENGTH];
|
||||
#ifdef SCP_UNIX
|
||||
// This map stores the mapping between a specific path type and the actual path that we use for it
|
||||
// This map stores the mapping between a specific path type and the actual path that we use for it
|
||||
SCP_unordered_map<int, SCP_string> pathTypeToRealPath;
|
||||
#endif
|
||||
|
||||
for (i=CF_TYPE_ROOT; i<CF_MAX_PATH_TYPES; i++ ) {
|
||||
for (i = CF_TYPE_ROOT; i < CF_MAX_PATH_TYPES; i++) {
|
||||
|
||||
// we don't want to add player files to the cache - taylor
|
||||
if ( (i == CF_TYPE_SINGLE_PLAYERS) || (i == CF_TYPE_MULTI_PLAYERS) ) {
|
||||
@@ -657,7 +946,7 @@ void cf_build_file_list()
|
||||
}
|
||||
|
||||
|
||||
void cf_build_secondary_filelist(const SCP_vector<cfile::ModRoot>& modRoots)
|
||||
void cf_build_secondary_filelist(const char *cdrom_dir)
|
||||
{
|
||||
int i;
|
||||
|
||||
@@ -678,7 +967,7 @@ void cf_build_secondary_filelist(const SCP_vector<cfile::ModRoot>& modRoots)
|
||||
mprintf(( "Building file index...\n" ));
|
||||
|
||||
// build the list of searchable roots
|
||||
cf_build_root_list(modRoots);
|
||||
cf_build_root_list(cdrom_dir);
|
||||
|
||||
// build the list of files themselves
|
||||
cf_build_file_list();
|
||||
@@ -1290,6 +1579,9 @@ static int cf_file_already_in_list( SCP_vector<SCP_string> &list, const char *fi
|
||||
// This one has a 'type', which is a CF_TYPE_* value. Because this specifies the directory
|
||||
// location, 'filter' only needs to be the filter itself, with no path information.
|
||||
// See above descriptions of cf_get_file_list() for more information about how it all works.
|
||||
// Note that filesystem listing is always sorted by name *before* sorting by the
|
||||
// provided sort order. This isn't strictly needed on NTFS, which always provides the list
|
||||
// sorted by name. But on mac/linux it's always needed.
|
||||
int cf_get_file_list(SCP_vector<SCP_string>& list, int pathtype, const char* filter, int sort,
|
||||
SCP_vector<file_list_info>* info, uint32_t location_flags)
|
||||
{
|
||||
@@ -1412,6 +1704,10 @@ int cf_get_file_list(SCP_vector<SCP_string>& list, int pathtype, const char* fil
|
||||
}
|
||||
#endif
|
||||
|
||||
// tcrayford: sort the filesystem listing by name by default to ensure
|
||||
// a stable order across filesystems
|
||||
cf_sort_filenames( list, CF_SORT_NAME, info );
|
||||
|
||||
bool skip_packfiles = false;
|
||||
if ( (pathtype == CF_TYPE_PLAYERS) || (pathtype == CF_TYPE_SINGLE_PLAYERS) || (pathtype == CF_TYPE_MULTI_PLAYERS) ) {
|
||||
skip_packfiles = true;
|
||||
@@ -1477,7 +1773,6 @@ int cf_get_file_list(SCP_vector<SCP_string>& list, int pathtype, const char* fil
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
if (sort != CF_SORT_NONE) {
|
||||
cf_sort_filenames( list, sort, info );
|
||||
}
|
||||
|
||||
@@ -15,7 +15,7 @@
|
||||
#include "cfile/cfile.h"
|
||||
|
||||
// Builds a list of all the files
|
||||
void cf_build_secondary_filelist(const SCP_vector<cfile::ModRoot>& modRoots);
|
||||
void cf_build_secondary_filelist( const char *cdrom_path );
|
||||
void cf_free_secondary_filelist();
|
||||
|
||||
// Internal stuff
|
||||
|
||||
+353
-467
File diff suppressed because it is too large.
Load diff
+15
-21
@@ -12,7 +12,6 @@
|
||||
#ifndef FS_CMDLINE_HEADER_FILE
|
||||
#define FS_CMDLINE_HEADER_FILE
|
||||
|
||||
#include "globalincs/pstypes.h"
|
||||
|
||||
int parse_cmdline(int argc, char *argv[]);
|
||||
|
||||
@@ -25,11 +24,11 @@ int parse_cmdline(int argc, char *argv[]);
|
||||
|
||||
|
||||
// RETAIL OPTIONS ----------------------------------------------
|
||||
extern SCP_string Cmdline_connect_addr;
|
||||
extern SCP_string Cmdline_game_name;
|
||||
extern SCP_string Cmdline_game_password;
|
||||
extern SCP_string Cmdline_rank_above;
|
||||
extern SCP_string Cmdline_rank_below;
|
||||
extern char *Cmdline_connect_addr;
|
||||
extern char *Cmdline_game_name;
|
||||
extern char *Cmdline_game_password;
|
||||
extern char *Cmdline_rank_above;
|
||||
extern char *Cmdline_rank_below;
|
||||
extern int Cmdline_cd_check;
|
||||
extern int Cmdline_client_dodamage;
|
||||
extern int Cmdline_closed_game;
|
||||
@@ -47,16 +46,14 @@ extern int Cmdline_timeout;
|
||||
extern int Cmdline_use_last_pilot;
|
||||
extern int Cmdline_window;
|
||||
extern int Cmdline_fullscreen_window;
|
||||
extern SCP_string Cmdline_res;
|
||||
extern SCP_string Cmdline_center_res;
|
||||
extern char *Cmdline_res;
|
||||
extern char *Cmdline_center_res;
|
||||
|
||||
|
||||
// FSO OPTIONS -------------------------------------------------
|
||||
|
||||
// Graphics related
|
||||
extern double specular_exponent_value;
|
||||
extern float Cmdline_clip_dist;
|
||||
extern float Cmdline_ogl_spec;
|
||||
extern float static_light_factor;
|
||||
extern float static_point_factor;
|
||||
extern float static_tube_factor;
|
||||
@@ -71,7 +68,7 @@ extern int Cmdline_enable_3d_shockwave;
|
||||
extern int Cmdline_softparticles;
|
||||
extern int Cmdline_bloom_intensity;
|
||||
extern int Cmdline_no_deferred_lighting;
|
||||
extern int Cmdline_no_emissive;
|
||||
extern int Cmdline_emissive;
|
||||
extern int Cmdline_aniso_level;
|
||||
|
||||
// Game Speed related
|
||||
@@ -97,19 +94,14 @@ extern int Cmdline_stretch_menu;
|
||||
extern int Cmdline_voice_recognition;
|
||||
extern int Cmdline_no_enhanced_sound;
|
||||
|
||||
namespace cfile {
|
||||
struct ModRoot;
|
||||
} // namespace cfile
|
||||
|
||||
// MOD related
|
||||
extern SCP_vector<cfile::ModRoot> Cmdline_mod; // DTP for mod support
|
||||
extern char *Cmdline_mod; // DTP for mod support
|
||||
// Multiplayer/Network related
|
||||
extern SCP_string Cmdline_almission; // DTP for autoload mission (for multi only)
|
||||
extern char *Cmdline_almission; // DTP for autoload mission (for multi only)
|
||||
extern int Cmdline_ingamejoin;
|
||||
extern int Cmdline_mpnoreturn;
|
||||
extern SCP_string Cmdline_spew_mission_crcs;
|
||||
extern SCP_string Cmdline_spew_table_crcs;
|
||||
extern int Cmdline_objupd;
|
||||
extern char *Cmdline_gateway_ip;
|
||||
|
||||
// Launcher related options
|
||||
extern bool Cmdline_portable_mode;
|
||||
@@ -124,7 +116,7 @@ extern int Cmdline_mipmap;
|
||||
extern int Cmdline_ati_color_swap;
|
||||
extern int Cmdline_no_3d_sound;
|
||||
extern int Cmdline_drawelements;
|
||||
extern SCP_string Cmdline_keyboard_layout;
|
||||
extern char* Cmdline_keyboard_layout;
|
||||
extern bool Cmdline_gl_finish;
|
||||
extern bool Cmdline_no_geo_sdr_effects;
|
||||
extern bool Cmdline_set_cpu_affinity;
|
||||
@@ -135,7 +127,7 @@ extern bool Cmdline_alternate_registry_path;
|
||||
#endif
|
||||
|
||||
// Developer/Testing related
|
||||
extern SCP_string Cmdline_start_mission;
|
||||
extern char *Cmdline_start_mission;
|
||||
extern int Cmdline_dis_collisions;
|
||||
extern int Cmdline_dis_weapons;
|
||||
extern bool Cmdline_output_sexp_info;
|
||||
@@ -155,5 +147,7 @@ extern bool Cmdline_json_profiling;
|
||||
extern bool Cmdline_frame_profile;
|
||||
extern bool Cmdline_show_video_info;
|
||||
extern bool Cmdline_debug_window;
|
||||
extern bool Cmdline_graphics_debug_output;
|
||||
extern bool Cmdline_log_to_stdout;
|
||||
|
||||
#endif
|
||||
@@ -1,48 +0,0 @@
|
||||
{
|
||||
"version": 1,
|
||||
"flags": {
|
||||
"-bool_option": false,
|
||||
"-number_option": 5.8,
|
||||
"-string_option": "asdf",
|
||||
"-mod": [
|
||||
{
|
||||
"type": "folder",
|
||||
"path": "/home/fso/mediavps",
|
||||
"user": true,
|
||||
"location_type": "primary_mod"
|
||||
},
|
||||
{
|
||||
"type": "folder",
|
||||
"path": "/home/fso",
|
||||
"user": true,
|
||||
"location_type": "game_root"
|
||||
},
|
||||
{
|
||||
"type": "folder",
|
||||
"path": "/path/to/fso/mediavps",
|
||||
"user": false,
|
||||
"location_type": "primary_mod"
|
||||
},
|
||||
{
|
||||
"type": "package",
|
||||
"path": "/path/to/fso/mediavps/MVPS-Z.vp",
|
||||
"location_type": "primary_mod"
|
||||
},
|
||||
{
|
||||
"type": "package",
|
||||
"path": "/path/to/fso/mediavps/MVPS-X.vp",
|
||||
"location_type": "primary_mod"
|
||||
},
|
||||
{
|
||||
"type": "folder",
|
||||
"path": "/path/to/fso",
|
||||
"location_type": "game_root"
|
||||
},
|
||||
{
|
||||
"type": "package",
|
||||
"path": "/path/to/fso/retail.vp",
|
||||
"location_type": "game_root"
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
@@ -516,7 +516,9 @@ void control_config_list_prepare()
|
||||
Num_cc_lines = y = z = 0;
|
||||
while (z < CCFG_MAX) {
|
||||
if (Control_config[z].tab == Tab && !Control_config[z].disabled) {
|
||||
if (Control_config[z].hasXSTR) {
|
||||
if (Control_config[z].indexXSTR > 1) {
|
||||
Cc_lines[Num_cc_lines].label = XSTR(Control_config[z].text, Control_config[z].indexXSTR);
|
||||
} else if (Control_config[z].indexXSTR == 1) {
|
||||
Cc_lines[Num_cc_lines].label = XSTR(Control_config[z].text, CONTROL_CONFIG_XSTR + z);
|
||||
} else {
|
||||
Cc_lines[Num_cc_lines].label = Control_config[z].text;
|
||||
@@ -999,7 +1001,7 @@ void control_config_reset_defaults(int presetnum)
|
||||
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;
|
||||
Control_config[i].hasXSTR = preset[i].hasXSTR;
|
||||
Control_config[i].indexXSTR = preset[i].indexXSTR;
|
||||
Control_config[i].type = preset[i].type;
|
||||
Control_config[i].disabled = preset[i].disabled;
|
||||
}
|
||||
@@ -1982,7 +1984,9 @@ void control_config_do_frame(float frametime)
|
||||
gr_get_string_size(&w, NULL, str);
|
||||
gr_printf_menu(x - w / 2, y - font_height, "%s", str);
|
||||
|
||||
if (Control_config[i].hasXSTR) {
|
||||
if (Control_config[i].indexXSTR > 1) {
|
||||
strcpy_s(buf, XSTR(Control_config[i].text, Control_config[i].indexXSTR));
|
||||
} else if (Control_config[i].indexXSTR == 1) {
|
||||
strcpy_s(buf, XSTR(Control_config[i].text, CONTROL_CONFIG_XSTR + i));
|
||||
} else {
|
||||
strcpy_s(buf, Control_config[i].text);
|
||||
@@ -2300,7 +2304,7 @@ int check_control_used(int id, int key)
|
||||
|
||||
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));
|
||||
//mprintf(("Key used %d\n", key));
|
||||
control_used(id);
|
||||
return 1;
|
||||
}
|
||||
|
||||
@@ -62,7 +62,7 @@ typedef struct config_item {
|
||||
short key_default; //!< default key bound to action
|
||||
short joy_default; //!< default joystick button bound to action
|
||||
char tab; //!< what tab (category) it belongs in
|
||||
bool hasXSTR; //!< whether we should translate this with an XSTR
|
||||
int indexXSTR; //!< what string index we should use to translate this with an XSTR
|
||||
const 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
|
||||
@@ -270,6 +270,15 @@ enum IoActionId {
|
||||
//!< ----------------------------
|
||||
CYCLE_PRIMARY_WEAPON_SEQUENCE =118, //!< cycle num primaries to fire at once
|
||||
|
||||
//!< @n
|
||||
//!< Custom control slots
|
||||
//!< ----------------------------
|
||||
CUSTOM_CONTROL_1 = 119,
|
||||
CUSTOM_CONTROL_2 = 120,
|
||||
CUSTOM_CONTROL_3 = 121,
|
||||
CUSTOM_CONTROL_4 = 122,
|
||||
CUSTOM_CONTROL_5 = 123,
|
||||
|
||||
/*!
|
||||
* This must always be below the last defined item
|
||||
*/
|
||||
|
||||
@@ -17,6 +17,7 @@
|
||||
#include "io/joy.h"
|
||||
#include "io/key.h"
|
||||
#include "localization/localize.h"
|
||||
#include "options/Option.h"
|
||||
#include "parse/parselo.h"
|
||||
|
||||
// z64: These enumerations MUST equal to those in controlsconfig.cpp...
|
||||
@@ -32,8 +33,29 @@ int Failed_key_index;
|
||||
|
||||
// Joystick configuration
|
||||
int Joy_dead_zone_size = 10;
|
||||
|
||||
auto DeadZoneOption =
|
||||
options::OptionBuilder<int>("Input.JoystickDeadZone", "Deadzone", "The deadzone of the selected joystick.")
|
||||
.category("Input")
|
||||
.range(0, 45)
|
||||
.level(options::ExpertLevel::Beginner)
|
||||
.default_val(10)
|
||||
.bind_to(&Joy_dead_zone_size)
|
||||
.importance(1)
|
||||
.finish();
|
||||
|
||||
int Joy_sensitivity = 9;
|
||||
|
||||
auto SensitivityOption =
|
||||
options::OptionBuilder<int>("Input.JoystickSensitivity", "Sensitivity", "The sentitivity of the selected joystick.")
|
||||
.category("Input")
|
||||
.range(0, 9)
|
||||
.level(options::ExpertLevel::Beginner)
|
||||
.default_val(9)
|
||||
.bind_to(&Joy_sensitivity)
|
||||
.importance(2)
|
||||
.finish();
|
||||
|
||||
int Invert_axis[JOY_NUM_AXES] = { 0, 0, 0, 0, 0, 0 };
|
||||
int Invert_axis_defaults[JOY_NUM_AXES] = { 0, 0, 0, 0, 0, 0 };
|
||||
|
||||
@@ -42,154 +64,159 @@ 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 },
|
||||
{ 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 },
|
||||
{ KEY_T, -1, TARGET_TAB, 1, "Target Next Ship", CC_TYPE_TRIGGER, -1, -1, 0, false, false },
|
||||
{ KEY_SHIFTED | KEY_T, -1, TARGET_TAB, 1, "Target Previous Ship", CC_TYPE_TRIGGER, -1, -1, 0, false, false },
|
||||
{ KEY_H, 2, TARGET_TAB, 1, "Target Next Closest Hostile Ship", CC_TYPE_TRIGGER, -1, -1, 0, false, false },
|
||||
{ KEY_SHIFTED | KEY_H, -1, TARGET_TAB, 1, "Target Previous Closest Hostile Ship", CC_TYPE_TRIGGER, -1, -1, 0, false, false },
|
||||
{ KEY_ALTED | KEY_H, -1, TARGET_TAB, 1, "Toggle Auto Targeting", CC_TYPE_TRIGGER, -1, -1, 0, false, false },
|
||||
{ KEY_F, -1, TARGET_TAB, 1, "Target Next Closest Friendly Ship", CC_TYPE_TRIGGER, -1, -1, 0, false, false },
|
||||
{ KEY_SHIFTED | KEY_F, -1, TARGET_TAB, 1, "Target Previous Closest Friendly Ship", CC_TYPE_TRIGGER, -1, -1, 0, false, false },
|
||||
{ KEY_Y, 4, TARGET_TAB, 1, "Target Ship in Reticle", CC_TYPE_TRIGGER, -1, -1, 0, false, false },
|
||||
{ KEY_G, -1, TARGET_TAB, 1, "Target Target's Nearest Attacker", CC_TYPE_TRIGGER, -1, -1, 0, false, false },
|
||||
{ KEY_ALTED | KEY_Y, -1, TARGET_TAB, 1, "Target Last Ship to Send Transmission", CC_TYPE_TRIGGER, -1, -1, 0, false, false },
|
||||
{ KEY_ALTED | KEY_T, -1, TARGET_TAB, 1, "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 },
|
||||
{ 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 },
|
||||
{ KEY_V, -1, TARGET_TAB, 1, "Target Subsystem in Reticle", CC_TYPE_TRIGGER, -1, -1, 0, false, false },
|
||||
{ KEY_S, -1, TARGET_TAB, 1, "Target Next Subsystem", CC_TYPE_TRIGGER, -1, -1, 0, false, false },
|
||||
{ KEY_SHIFTED | KEY_S, -1, TARGET_TAB, 1, "Target Previous Subsystem", CC_TYPE_TRIGGER, -1, -1, 0, false, false },
|
||||
{ KEY_ALTED | KEY_S, -1, TARGET_TAB, 1, "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 },
|
||||
{ KEY_ALTED | KEY_M, -1, COMPUTER_TAB, true, "Toggle Auto Speed Matching", CC_TYPE_TRIGGER, -1, -1, 0, false, false },
|
||||
{ KEY_M, -1, COMPUTER_TAB, 1, "Match Target Speed", CC_TYPE_TRIGGER, -1, -1, 0, false, false },
|
||||
{ KEY_ALTED | KEY_M, -1, COMPUTER_TAB, 1, "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 },
|
||||
{ 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 },
|
||||
{ KEY_LCTRL, 0, WEAPON_TAB, 1, "Fire Primary Weapon", CC_TYPE_CONTINUOUS, -1, -1, 0, false, false },
|
||||
{ KEY_SPACEBAR, 1, WEAPON_TAB, 1, "Fire Secondary Weapon", CC_TYPE_CONTINUOUS, -1, -1, 0, false, false },
|
||||
{ KEY_PERIOD, -1, WEAPON_TAB, 1, "Cycle Forward Primary Weapon", CC_TYPE_TRIGGER, -1, -1, 0, false, false },
|
||||
{ KEY_COMMA, -1, WEAPON_TAB, 1, "Cycle Backward Primary Weapon", CC_TYPE_TRIGGER, -1, -1, 0, false, false },
|
||||
{ KEY_DIVIDE, -1, WEAPON_TAB, 1, "Cycle Secondary Weapon Bank", CC_TYPE_TRIGGER, -1, -1, 0, false, false },
|
||||
{ KEY_SHIFTED | KEY_DIVIDE, -1, WEAPON_TAB, 1, "Cycle Secondary Weapon Firing Rate", CC_TYPE_TRIGGER, -1, -1, 0, false, false },
|
||||
{ KEY_X, 3, WEAPON_TAB, 1, "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 },
|
||||
{ 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 },
|
||||
{ KEY_A, -1, SHIP_TAB, 1, "Forward Thrust", CC_TYPE_CONTINUOUS, -1, -1, 0, false, false },
|
||||
{ KEY_Z, -1, SHIP_TAB, 1, "Reverse Thrust", CC_TYPE_CONTINUOUS, -1, -1, 0, false, false },
|
||||
{ KEY_PAD7, -1, SHIP_TAB, 1, "Bank Left", CC_TYPE_CONTINUOUS, -1, -1, 0, false, false },
|
||||
{ KEY_PAD9, -1, SHIP_TAB, 1, "Bank Right", CC_TYPE_CONTINUOUS, -1, -1, 0, false, false },
|
||||
{ KEY_PAD8, -1, SHIP_TAB, 1, "Pitch Forward", CC_TYPE_CONTINUOUS, -1, -1, 0, false, false },
|
||||
{ KEY_PAD2, -1, SHIP_TAB, 1, "Pitch Backward", CC_TYPE_CONTINUOUS, -1, -1, 0, false, false },
|
||||
{ KEY_PAD4, -1, SHIP_TAB, 1, "Turn Left", CC_TYPE_CONTINUOUS, -1, -1, 0, false, false },
|
||||
{ KEY_PAD6, -1, SHIP_TAB, 1, "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 },
|
||||
{ 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 },
|
||||
{ KEY_BACKSP, -1, SHIP_TAB, 1, "Set Throttle to Zero", CC_TYPE_TRIGGER, -1, -1, 0, false, false },
|
||||
{ KEY_SLASH, -1, SHIP_TAB, 1, "Set Throttle to Max", CC_TYPE_TRIGGER, -1, -1, 0, false, false },
|
||||
{ KEY_LBRACKET, -1, SHIP_TAB, 1, "Set Throttle to One-Third", CC_TYPE_TRIGGER, -1, -1, 0, false, false },
|
||||
{ KEY_RBRACKET, -1, SHIP_TAB, 1, "Set Throttle to Two-Thirds", CC_TYPE_TRIGGER, -1, -1, 0, false, false },
|
||||
{ KEY_EQUAL, -1, SHIP_TAB, 1, "Increase Throttle 5 Percent", CC_TYPE_TRIGGER, -1, -1, 0, false, false },
|
||||
{ KEY_MINUS, -1, SHIP_TAB, 1, "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 },
|
||||
{ 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_SHIFTED | KEY_A, -1, COMPUTER_TAB, 1, "Attack My Target", CC_TYPE_TRIGGER, -1, -1, 0, false, false },
|
||||
{ KEY_SHIFTED | KEY_Z, -1, COMPUTER_TAB, 1, "Disarm My Target", CC_TYPE_TRIGGER, -1, -1, 0, false, false },
|
||||
{ KEY_SHIFTED | KEY_D, -1, COMPUTER_TAB, 1, "Disable My Target", CC_TYPE_TRIGGER, -1, -1, 0, false, false },
|
||||
{ KEY_SHIFTED | KEY_V, -1, COMPUTER_TAB, 1, "Attack My Subsystem", CC_TYPE_TRIGGER, -1, -1, 0, false, false },
|
||||
{ KEY_SHIFTED | KEY_X, -1, COMPUTER_TAB, 1, "Capture My Target", CC_TYPE_TRIGGER, -1, -1, 0, false, false },
|
||||
{ KEY_SHIFTED | KEY_E, -1, COMPUTER_TAB, 1, "Engage Enemy", CC_TYPE_TRIGGER, -1, -1, 0, false, false },
|
||||
{ KEY_SHIFTED | KEY_W, -1, COMPUTER_TAB, 1, "Form on My Wing", CC_TYPE_TRIGGER, -1, -1, 0, false, false },
|
||||
{ KEY_SHIFTED | KEY_I, -1, COMPUTER_TAB, 1, "Ignore My Target", CC_TYPE_TRIGGER, -1, -1, 0, false, false },
|
||||
{ KEY_SHIFTED | KEY_P, -1, COMPUTER_TAB, 1, "Protect My Target", CC_TYPE_TRIGGER, -1, -1, 0, false, false },
|
||||
{ KEY_SHIFTED | KEY_C, -1, COMPUTER_TAB, 1, "Cover Me", CC_TYPE_TRIGGER, -1, -1, 0, false, false },
|
||||
{ KEY_SHIFTED | KEY_J, -1, COMPUTER_TAB, 1, "Return to Base", CC_TYPE_TRIGGER, -1, -1, 0, false, false },
|
||||
{ KEY_SHIFTED | KEY_R, -1, COMPUTER_TAB, 1, "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 },
|
||||
{ KEY_R, 6, TARGET_TAB, 1, "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 },
|
||||
{ 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_PADMULTIPLY, -1, COMPUTER_TAB, 1, "Chase View", CC_TYPE_TRIGGER, -1, -1, 0, false, false },
|
||||
{ KEY_PADPERIOD, -1, COMPUTER_TAB, 1, "External View", CC_TYPE_TRIGGER, -1, -1, 0, false, false },
|
||||
{ KEY_PADENTER, -1, COMPUTER_TAB, 1, "Toggle External Camera Lock", CC_TYPE_TRIGGER, -1, -1, 0, false, false },
|
||||
{ KEY_PAD0, -1, COMPUTER_TAB, 1, "Free Look View", CC_TYPE_CONTINUOUS, -1, -1, 0, false, false },
|
||||
{ KEY_PADDIVIDE, -1, COMPUTER_TAB, 1, "Current Target View", CC_TYPE_TRIGGER, -1, -1, 0, false, false },
|
||||
{ KEY_PADPLUS, -1, COMPUTER_TAB, 1, "Increase View Distance", CC_TYPE_CONTINUOUS, -1, -1, 0, false, false },
|
||||
{ KEY_PADMINUS, -1, COMPUTER_TAB, 1, "Decrease View Distance", CC_TYPE_CONTINUOUS, -1, -1, 0, false, false },
|
||||
{ KEY_PAD5, -1, COMPUTER_TAB, 1, "Center View", CC_TYPE_CONTINUOUS, -1, -1, 0, false, false },
|
||||
{ -1, 33, COMPUTER_TAB, 1, "View Up", CC_TYPE_CONTINUOUS, -1, -1, 0, false, false },
|
||||
{ -1, 32, COMPUTER_TAB, 1, "View Rear", CC_TYPE_CONTINUOUS, -1, -1, 0, false, false },
|
||||
{ -1, 34, COMPUTER_TAB, 1, "View Left", CC_TYPE_CONTINUOUS, -1, -1, 0, false, false },
|
||||
{ -1, 35, COMPUTER_TAB, 1, "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 },
|
||||
{ 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_RAPOSTRO, -1, COMPUTER_TAB, 1, "Cycle Radar Range", CC_TYPE_TRIGGER, -1, -1, 0, false, false },
|
||||
{ KEY_C, -1, COMPUTER_TAB, 1, "Communications Menu", CC_TYPE_TRIGGER, -1, -1, 0, false, false },
|
||||
{ -1, -1, -1, 1, "Show Objectives", CC_TYPE_TRIGGER, -1, -1, 0, false, false },
|
||||
{ KEY_ALTED | KEY_J, -1, COMPUTER_TAB, 1, "Enter Subspace (End Mission)", CC_TYPE_TRIGGER, -1, -1, 0, false, false },
|
||||
{ KEY_J, -1, TARGET_TAB, 1, "Target Target's Target", CC_TYPE_TRIGGER, -1, -1, 0, false, false },
|
||||
{ KEY_TAB, 5, SHIP_TAB, 1, "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 },
|
||||
{ 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_INSERT, -1, COMPUTER_TAB, 1, "Increase Weapon Energy", CC_TYPE_TRIGGER, -1, -1, 0, false, false },
|
||||
{ KEY_DELETE, -1, COMPUTER_TAB, 1, "Decrease Weapon Energy", CC_TYPE_TRIGGER, -1, -1, 0, false, false },
|
||||
{ KEY_HOME, -1, COMPUTER_TAB, 1, "Increase Shield Energy", CC_TYPE_TRIGGER, -1, -1, 0, false, false },
|
||||
{ KEY_END, -1, COMPUTER_TAB, 1, "Decrease Shield Energy", CC_TYPE_TRIGGER, -1, -1, 0, false, false },
|
||||
{ KEY_PAGEUP, -1, COMPUTER_TAB, 1, "Increase Engine Energy", CC_TYPE_TRIGGER, -1, -1, 0, false, false },
|
||||
{ KEY_PAGEDOWN, -1, COMPUTER_TAB, 1, "Decrease Engine Energy", CC_TYPE_TRIGGER, -1, -1, 0, false, false },
|
||||
{ KEY_ALTED | KEY_D, -1, COMPUTER_TAB, 1, "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 },
|
||||
{ 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 },
|
||||
{ KEY_Q, 7, COMPUTER_TAB, 1, "Equalize Shields", CC_TYPE_TRIGGER, -1, -1, 0, false, false },
|
||||
{ KEY_UP, -1, COMPUTER_TAB, 1, "Augment Forward Shield", CC_TYPE_TRIGGER, -1, -1, 0, false, false },
|
||||
{ KEY_DOWN, -1, COMPUTER_TAB, 1, "Augment Rear Shield", CC_TYPE_TRIGGER, -1, -1, 0, false, false },
|
||||
{ KEY_LEFT, -1, COMPUTER_TAB, 1, "Augment Left Shield", CC_TYPE_TRIGGER, -1, -1, 0, false, false },
|
||||
{ KEY_RIGHT, -1, COMPUTER_TAB, 1, "Augment Right Shield", CC_TYPE_TRIGGER, -1, -1, 0, false, false },
|
||||
{ KEY_SCROLLOCK, -1, COMPUTER_TAB, 1, "Transfer Energy Laser->Shield", CC_TYPE_TRIGGER, -1, -1, 0, false, false },
|
||||
{ KEY_SHIFTED | KEY_SCROLLOCK, -1, COMPUTER_TAB, 1, "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 },
|
||||
{ -1, -1, SHIP_TAB, 0, "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 },
|
||||
{ -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 },
|
||||
{ -1, -1, SHIP_TAB, 1, "Bank When Pressed", CC_TYPE_CONTINUOUS, -1, -1, 0, false, false },
|
||||
{ -1, -1, -1, 1, "Show Nav Map", CC_TYPE_TRIGGER, -1, -1, 0, false, false },
|
||||
{ KEY_ALTED | KEY_E, -1, COMPUTER_TAB, 1, "Add or Remove Escort", CC_TYPE_TRIGGER, -1, -1, 0, false, false },
|
||||
{ KEY_ALTED | KEY_SHIFTED | KEY_E, -1, COMPUTER_TAB, 1, "Clear Escort List", CC_TYPE_TRIGGER, -1, -1, 0, false, false },
|
||||
{ KEY_E, -1, TARGET_TAB, 1, "Target Next Escort Ship", CC_TYPE_TRIGGER, -1, -1, 0, false, false },
|
||||
{ KEY_ALTED | KEY_R, -1, TARGET_TAB, 1, "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 },
|
||||
{ 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_U, -1, TARGET_TAB, 1, "Target Next Uninspected Cargo", CC_TYPE_TRIGGER, -1, -1, 0, false, false },
|
||||
{ KEY_SHIFTED | KEY_U, -1, TARGET_TAB, 1, "Target Previous Uninspected Cargo", CC_TYPE_TRIGGER, -1, -1, 0, false, false },
|
||||
{ KEY_N, -1, TARGET_TAB, 1, "Target Newest Ship in Area", CC_TYPE_TRIGGER, -1, -1, 0, false, false },
|
||||
{ KEY_K, -1, TARGET_TAB, 1, "Target Next Live Turret", CC_TYPE_TRIGGER, -1, -1, 0, false, false },
|
||||
{ KEY_SHIFTED | KEY_K, -1, TARGET_TAB, 1, "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 },
|
||||
{ KEY_SHIFTED | KEY_B, -1, TARGET_TAB, true, "Target Previous Hostile Bomb or Bomber", CC_TYPE_TRIGGER, -1, -1, 0, false, false },
|
||||
{ KEY_B, -1, TARGET_TAB, 1, "Target Next Hostile Bomb or Bomber", CC_TYPE_TRIGGER, -1, -1, 0, false, false },
|
||||
{ KEY_SHIFTED | KEY_B, -1, TARGET_TAB, 1, "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 },
|
||||
{ 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 },
|
||||
{ KEY_1, -1, COMPUTER_TAB, 1, "(Multiplayer) Message All", CC_TYPE_TRIGGER, -1, -1, 0, false, false },
|
||||
{ KEY_2, -1, COMPUTER_TAB, 1, "(Multiplayer) Message Friendly", CC_TYPE_TRIGGER, -1, -1, 0, false, false },
|
||||
{ KEY_3, -1, COMPUTER_TAB, 1, "(Multiplayer) Message Hostile", CC_TYPE_TRIGGER, -1, -1, 0, false, false },
|
||||
{ KEY_4, -1, COMPUTER_TAB, 1, "(Multiplayer) Message Target", CC_TYPE_TRIGGER, -1, -1, 0, false, false },
|
||||
{ KEY_ALTED | KEY_X, -1, COMPUTER_TAB, 1, "(Multiplayer) Observer Zoom to Target", CC_TYPE_TRIGGER, -1, -1, 0, false, false },
|
||||
{ KEY_SHIFTED | KEY_PERIOD, -1, COMPUTER_TAB, 1, "Increase Time Compression", CC_TYPE_TRIGGER, -1, -1, 0, false, false },
|
||||
{ KEY_SHIFTED | KEY_COMMA, -1, COMPUTER_TAB, 1, "Decrease Time Compression", CC_TYPE_TRIGGER, -1, -1, 0, false, false },
|
||||
{ KEY_L, -1, COMPUTER_TAB, 1, "Toggle High HUD Contrast", CC_TYPE_TRIGGER, -1, -1, 0, false, false },
|
||||
{ KEY_SHIFTED | KEY_N, -1, COMPUTER_TAB, 1, "(Multiplayer) Toggle Network Info", CC_TYPE_TRIGGER, -1, -1, 0, false, false },
|
||||
{ KEY_SHIFTED | KEY_END, -1, COMPUTER_TAB, 1, "(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 },
|
||||
{ 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
|
||||
{ KEY_SHIFTED | KEY_O, -1, COMPUTER_TAB, 1, "Toggle HUD", CC_TYPE_TRIGGER, -1, -1, 0, false, false },
|
||||
{ KEY_SHIFTED | KEY_3, -1, SHIP_TAB, 1, "Right Thrust", CC_TYPE_CONTINUOUS, -1, -1, 0, false, false },
|
||||
{ KEY_SHIFTED | KEY_1, -1, SHIP_TAB, 1, "Left Thrust", CC_TYPE_CONTINUOUS, -1, -1, 0, false, false },
|
||||
{ KEY_SHIFTED | KEY_PADPLUS, -1, SHIP_TAB, 1, "Up Thrust", CC_TYPE_CONTINUOUS, -1, -1, 0, false, false },
|
||||
{ KEY_SHIFTED | KEY_PADENTER, -1, SHIP_TAB, 1, "Down Thrust", CC_TYPE_CONTINUOUS, -1, -1, 0, false, false },
|
||||
{ KEY_ALTED | KEY_SHIFTED | KEY_Q, -1, COMPUTER_TAB, 1, "Toggle HUD Wireframe Target View", CC_TYPE_TRIGGER, -1, -1, 0, false, false },
|
||||
{ -1, -1, COMPUTER_TAB, 0, "Top-Down View", CC_TYPE_TRIGGER, -1, -1, 0, false, false },
|
||||
{ -1, -1, COMPUTER_TAB, 0, "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 },
|
||||
{ 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 }
|
||||
{ KEY_ALTED | KEY_A, -1, COMPUTER_TAB, 0, "Toggle Auto Pilot", CC_TYPE_TRIGGER, -1, -1, 0, false, false },
|
||||
{ KEY_ALTED | KEY_N, -1, COMPUTER_TAB, 0, "Cycle Nav Points", CC_TYPE_TRIGGER, -1, -1, 0, false, false },
|
||||
{ KEY_ALTED | KEY_G, -1, SHIP_TAB, 0, "Toggle Gliding", CC_TYPE_TRIGGER, -1, -1, 0, false, false },
|
||||
{ KEY_O, -1, WEAPON_TAB, 0, "Cycle Primary Weapon Firing Rate", CC_TYPE_TRIGGER, -1, -1, 0, false, false },
|
||||
{ KEY_ALTED | KEY_SHIFTED | KEY_1, -1, COMPUTER_TAB, 0, "Custom Control 1", CC_TYPE_TRIGGER, -1, -1, 0, true, false },
|
||||
{ KEY_ALTED | KEY_SHIFTED | KEY_2, -1, COMPUTER_TAB, 0, "Custom Control 2", CC_TYPE_TRIGGER, -1, -1, 0, true, false },
|
||||
{ KEY_ALTED | KEY_SHIFTED | KEY_3, -1, COMPUTER_TAB, 0, "Custom Control 3", CC_TYPE_TRIGGER, -1, -1, 0, true, false },
|
||||
{ KEY_ALTED | KEY_SHIFTED | KEY_4, -1, COMPUTER_TAB, 0, "Custom Control 4", CC_TYPE_TRIGGER, -1, -1, 0, true, false },
|
||||
{ KEY_ALTED | KEY_SHIFTED | KEY_5, -1, COMPUTER_TAB, 0, "Custom Control 5", CC_TYPE_TRIGGER, -1, -1, 0, true, false },
|
||||
{ -1, -1, -1, 0, "", CC_TYPE_TRIGGER, -1, -1, 0, false, false }
|
||||
};
|
||||
|
||||
const char *Scan_code_text_german[] = {
|
||||
@@ -586,7 +613,6 @@ void control_config_common_load_overrides();
|
||||
void control_config_common_init()
|
||||
{
|
||||
for (int i=0; i<CCFG_MAX; i++) {
|
||||
Control_config[i].disabled = false;
|
||||
Control_config[i].continuous_ongoing = false;
|
||||
}
|
||||
|
||||
@@ -843,7 +869,7 @@ void control_config_common_load_overrides()
|
||||
* short key_default;
|
||||
* short joy_default;
|
||||
* char tab;
|
||||
* bool hasXSTR;
|
||||
* int indexXSTR;
|
||||
* char type;
|
||||
*/
|
||||
|
||||
@@ -885,7 +911,7 @@ void control_config_common_load_overrides()
|
||||
|
||||
if (optional_string("$Has XStr:")) {
|
||||
stuff_int(&iTemp);
|
||||
r_ccConfig.hasXSTR = (iTemp == 1);
|
||||
r_ccConfig.indexXSTR = iTemp;
|
||||
}
|
||||
|
||||
if (optional_string("$Type:")) {
|
||||
|
||||
@@ -83,24 +83,33 @@ void cutscene_init()
|
||||
|
||||
if (optional_string("$cd:"))
|
||||
{
|
||||
// Option isn't needed anymore. Consume the token and ignore it
|
||||
|
||||
// CD option isn't needed anymore. Consume the token and ignore it
|
||||
int junk;
|
||||
stuff_int(&junk);
|
||||
}
|
||||
|
||||
cutinfo.viewable = false;
|
||||
cutinfo.flags.reset();
|
||||
|
||||
if (isFirstCutscene)
|
||||
{
|
||||
isFirstCutscene = false;
|
||||
// The original code assumes the first movie is the intro, so always viewable
|
||||
cutinfo.viewable = true;
|
||||
// The original code assumes the first movie is the intro, so make it viewable
|
||||
cutinfo.flags.set(Cutscene::Cutscene_Flags::Viewable);
|
||||
}
|
||||
|
||||
if (optional_string("$Always Viewable:"))
|
||||
{
|
||||
stuff_boolean(&cutinfo.viewable);
|
||||
bool flag;
|
||||
stuff_boolean(&flag);
|
||||
if (flag)
|
||||
cutinfo.flags.set(Cutscene::Cutscene_Flags::Always_viewable);
|
||||
}
|
||||
if (optional_string("$Never Viewable:"))
|
||||
{
|
||||
bool flag;
|
||||
stuff_boolean(&flag);
|
||||
if (flag)
|
||||
cutinfo.flags.set(Cutscene::Cutscene_Flags::Never_viewable);
|
||||
}
|
||||
|
||||
Cutscenes.push_back(cutinfo);
|
||||
@@ -143,7 +152,7 @@ void cutscene_mark_viewable(const char* filename)
|
||||
// see if the stripped filename matches the cutscene filename
|
||||
if (strstr(cut_file, file) != NULL)
|
||||
{
|
||||
cut->viewable = true;
|
||||
cut->flags.set(Cutscene::Cutscene_Flags::Viewable);
|
||||
return;
|
||||
}
|
||||
i++;
|
||||
@@ -441,9 +450,9 @@ void cutscenes_screen_init()
|
||||
Cutscene_list.clear();
|
||||
|
||||
int u = 0;
|
||||
for (SCP_vector<cutscene_info>::iterator cut = Cutscenes.begin(); cut != Cutscenes.end(); ++cut, u++)
|
||||
for (auto cut = Cutscenes.begin(); cut != Cutscenes.end(); ++cut, ++u)
|
||||
{
|
||||
if ((*cut).viewable)
|
||||
if (cut->flags[Cutscene::Cutscene_Flags::Viewable, Cutscene::Cutscene_Flags::Always_viewable] && !cut->flags[Cutscene::Cutscene_Flags::Never_viewable])
|
||||
{
|
||||
Cutscene_list.push_back(u);
|
||||
}
|
||||
|
||||
@@ -10,15 +10,28 @@
|
||||
#ifndef _FREESPACE_CUTSCENES_SCREEN_HEADER_FILE
|
||||
#define _FREESPACE_CUTSCENES_SCREEN_HEADER_FILE
|
||||
|
||||
#include "globalincs/flagset.h"
|
||||
#include "globalincs/globals.h"
|
||||
#include "globalincs/pstypes.h"
|
||||
|
||||
namespace Cutscene
|
||||
{
|
||||
FLAG_LIST(Cutscene_Flags)
|
||||
{
|
||||
Viewable = 0,
|
||||
Always_viewable,
|
||||
Never_viewable,
|
||||
|
||||
NUM_VALUES
|
||||
};
|
||||
}
|
||||
|
||||
typedef struct cutscene_info
|
||||
{
|
||||
char filename[MAX_FILENAME_LEN];
|
||||
char name[NAME_LENGTH];
|
||||
char* description;
|
||||
bool viewable;
|
||||
flagset<Cutscene::Cutscene_Flags> flags;
|
||||
} cutscene_info;
|
||||
|
||||
extern SCP_vector<cutscene_info> Cutscenes;
|
||||
|
||||
@@ -126,7 +126,7 @@ void AudioDecoder::handleDecodedFrame(AVFrame* frame) {
|
||||
auto ret = av_samples_alloc(m_outData, &m_outLinesize, OUT_NUM_CHANNELS, m_outNumSamples,
|
||||
OUT_SAMPLE_FORMAT, 1);
|
||||
if (ret < 0) {
|
||||
mprintf(("FFMPEG: Failed to allocate samples!!!"));
|
||||
mprintf(("FFMPEG: Failed to allocate samples!!!\n"));
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
@@ -27,13 +27,15 @@ using namespace cutscene;
|
||||
|
||||
const int MAX_AUDIO_BUFFERS = 15;
|
||||
|
||||
std::unique_ptr<Decoder> findDecoder(const SCP_string& name, const PlaybackProperties& properties) {
|
||||
std::unique_ptr<Decoder> findDecoder(__UNUSED const SCP_string& name, __UNUSED const PlaybackProperties& properties) {
|
||||
#ifdef WITH_FFMPEG
|
||||
{
|
||||
std::unique_ptr<Decoder> ffmpeg(new ::cutscene::ffmpeg::FFMPEGDecoder());
|
||||
if (ffmpeg->initialize(name, properties)) {
|
||||
return ffmpeg;
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
@@ -468,10 +468,9 @@ void renderAll() {
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
graphics::decal_draw_list draw_list;
|
||||
auto mission_time = f2fl(Missiontime);
|
||||
|
||||
graphics::decal_draw_list draw_list(active_decals.size());
|
||||
for (auto& decal : active_decals) {
|
||||
int diffuse_bm = -1;
|
||||
int glow_bm = -1;
|
||||
|
||||
File diff suppressed because it is too large.
Load diff
@@ -3,9 +3,15 @@
|
||||
|
||||
in vec4 fragTexCoord;
|
||||
in vec4 fragColor;
|
||||
|
||||
out vec4 fragOut0;
|
||||
|
||||
uniform sampler2DArray baseMap;
|
||||
uniform float intensity;
|
||||
|
||||
layout (std140) uniform genericData {
|
||||
vec4 color;
|
||||
float intensity;
|
||||
};
|
||||
|
||||
void main()
|
||||
{
|
||||
|
||||
@@ -1,11 +1,20 @@
|
||||
in vec4 vertPosition;
|
||||
in vec4 vertTexCoord;
|
||||
in vec4 vertColor;
|
||||
|
||||
out vec4 fragTexCoord;
|
||||
out vec4 fragColor;
|
||||
uniform mat4 modelViewMatrix;
|
||||
uniform mat4 projMatrix;
|
||||
uniform vec4 color;
|
||||
|
||||
layout (std140) uniform matrixData {
|
||||
mat4 modelViewMatrix;
|
||||
mat4 projMatrix;
|
||||
};
|
||||
|
||||
layout (std140) uniform genericData {
|
||||
vec4 color;
|
||||
float intensity;
|
||||
};
|
||||
|
||||
void main()
|
||||
{
|
||||
fragTexCoord = vec4(vertTexCoord.xyz, 0.0);
|
||||
|
||||
@@ -1,8 +1,15 @@
|
||||
|
||||
in vec4 fragTexCoord;
|
||||
|
||||
out vec4 fragOut0;
|
||||
|
||||
uniform sampler2D bloomed;
|
||||
uniform float bloom_intensity;
|
||||
uniform int levels;
|
||||
|
||||
layout (std140) uniform genericData {
|
||||
float bloom_intensity;
|
||||
int levels;
|
||||
};
|
||||
|
||||
void main() {
|
||||
vec4 color_out = vec4(0.0, 0.0, 0.0, 1.0);
|
||||
float factor = 0.0;
|
||||
@@ -14,4 +21,4 @@ void main() {
|
||||
color_out.rgb /= factor;
|
||||
color_out.rgb *= bloom_intensity;
|
||||
fragOut0 = color_out;
|
||||
}
|
||||
}
|
||||
@@ -1,9 +1,16 @@
|
||||
out vec4 fragOut0;
|
||||
uniform float texSize;
|
||||
uniform float tapSize;
|
||||
uniform int level;
|
||||
|
||||
in vec4 fragTexCoord;
|
||||
|
||||
uniform sampler2D tex;
|
||||
|
||||
const float TapSize = 1.0;
|
||||
|
||||
layout (std140) uniform genericData {
|
||||
float texSize;
|
||||
int level;
|
||||
};
|
||||
|
||||
// Gaussian Blur
|
||||
// 2 passes required
|
||||
void main()
|
||||
@@ -20,15 +27,15 @@ void main()
|
||||
vec4 sum = textureLod(tex, fragTexCoord.xy, float(level)) * BlurWeights[0];
|
||||
#ifdef PASS_0
|
||||
for (int i = 1; i < 6; i++) {
|
||||
sum += textureLod(tex, vec2(clamp(fragTexCoord.x - float(i) * (texSize) * tapSize, 0.0, 1.0), fragTexCoord.y), float(level)) * BlurWeights[i];
|
||||
sum += textureLod(tex, vec2(clamp(fragTexCoord.x + float(i) * (texSize) * tapSize, 0.0, 1.0), fragTexCoord.y), float(level)) * BlurWeights[i];
|
||||
sum += textureLod(tex, vec2(clamp(fragTexCoord.x - float(i) * (texSize) * TapSize, 0.0, 1.0), fragTexCoord.y), float(level)) * BlurWeights[i];
|
||||
sum += textureLod(tex, vec2(clamp(fragTexCoord.x + float(i) * (texSize) * TapSize, 0.0, 1.0), fragTexCoord.y), float(level)) * BlurWeights[i];
|
||||
}
|
||||
#endif
|
||||
#ifdef PASS_1
|
||||
for (int i = 1; i < 6; i++) {
|
||||
sum += textureLod(tex, vec2(fragTexCoord.x, clamp(fragTexCoord.y - float(i) * (texSize) * tapSize, 0.0, 1.0)), float(level)) * BlurWeights[i];
|
||||
sum += textureLod(tex, vec2(fragTexCoord.x, clamp(fragTexCoord.y + float(i) * (texSize) * tapSize, 0.0, 1.0)), float(level)) * BlurWeights[i];
|
||||
sum += textureLod(tex, vec2(fragTexCoord.x, clamp(fragTexCoord.y - float(i) * (texSize) * TapSize, 0.0, 1.0)), float(level)) * BlurWeights[i];
|
||||
sum += textureLod(tex, vec2(fragTexCoord.x, clamp(fragTexCoord.y + float(i) * (texSize) * TapSize, 0.0, 1.0)), float(level)) * BlurWeights[i];
|
||||
}
|
||||
#endif
|
||||
fragOut0 = sum;
|
||||
}
|
||||
}
|
||||
@@ -6,12 +6,23 @@ in vec4 fragColor;
|
||||
out vec4 fragOut0;
|
||||
|
||||
uniform sampler2DArray baseMap;
|
||||
uniform int baseMapIndex;
|
||||
uniform int alphaTexture;
|
||||
uniform int noTexturing;
|
||||
uniform int srgb;
|
||||
uniform float intensity;
|
||||
uniform float alphaThreshold;
|
||||
|
||||
layout (std140) uniform genericData {
|
||||
mat4 modelMatrix;
|
||||
|
||||
vec4 color;
|
||||
|
||||
vec4 clipEquation;
|
||||
|
||||
int baseMapIndex;
|
||||
int alphaTexture;
|
||||
int noTexturing;
|
||||
int srgb;
|
||||
|
||||
float intensity;
|
||||
float alphaThreshold;
|
||||
bool clipEnabled;
|
||||
};
|
||||
|
||||
void main()
|
||||
{
|
||||
|
||||
@@ -0,0 +1,38 @@
|
||||
in vec4 vertPosition;
|
||||
in vec4 vertTexCoord;
|
||||
in vec4 vertColor;
|
||||
out vec4 fragTexCoord;
|
||||
out vec4 fragColor;
|
||||
|
||||
layout (std140) uniform matrixData {
|
||||
mat4 modelViewMatrix;
|
||||
mat4 projMatrix;
|
||||
};
|
||||
|
||||
layout (std140) uniform genericData {
|
||||
mat4 modelMatrix;
|
||||
|
||||
vec4 color;
|
||||
|
||||
vec4 clipEquation;
|
||||
|
||||
int baseMapIndex;
|
||||
int alphaTexture;
|
||||
int noTexturing;
|
||||
int srgb;
|
||||
|
||||
float intensity;
|
||||
float alphaThreshold;
|
||||
bool clipEnabled;
|
||||
};
|
||||
|
||||
void main()
|
||||
{
|
||||
fragTexCoord = vertTexCoord;
|
||||
fragColor = vertColor * color;
|
||||
gl_Position = projMatrix * modelViewMatrix * vertPosition;
|
||||
|
||||
if (clipEnabled) {
|
||||
gl_ClipDistance[0] = dot(clipEquation, modelMatrix * vertPosition);
|
||||
}
|
||||
}
|
||||
@@ -24,7 +24,6 @@ layout (std140) uniform globalDeferredData {
|
||||
float middist;
|
||||
float fardist;
|
||||
|
||||
float specFactor;
|
||||
float invScreenWidth;
|
||||
float invScreenHeight;
|
||||
};
|
||||
|
||||
@@ -2,8 +2,11 @@
|
||||
#include "lighting.sdr"
|
||||
|
||||
in vec4 vertPosition;
|
||||
uniform mat4 modelViewMatrix;
|
||||
uniform mat4 projMatrix;
|
||||
|
||||
layout (std140) uniform matrixData {
|
||||
mat4 modelViewMatrix;
|
||||
mat4 projMatrix;
|
||||
};
|
||||
|
||||
layout (std140) uniform lightData {
|
||||
vec3 diffuseLightColor;
|
||||
|
||||
@@ -1,13 +1,20 @@
|
||||
in vec4 fragTexCoord;
|
||||
in vec4 fragColor;
|
||||
in float fragOffset;
|
||||
|
||||
out vec4 fragOut0;
|
||||
|
||||
uniform sampler2DArray baseMap;
|
||||
uniform sampler2D depthMap;
|
||||
uniform float window_width;
|
||||
uniform float window_height;
|
||||
uniform sampler2D distMap;
|
||||
uniform sampler2D frameBuffer;
|
||||
|
||||
layout (std140) uniform genericData {
|
||||
float window_width;
|
||||
float window_height;
|
||||
float use_offset;
|
||||
};
|
||||
|
||||
void main()
|
||||
{
|
||||
vec2 depthCoord = vec2(gl_FragCoord.x / window_width, gl_FragCoord.y / window_height);
|
||||
|
||||
@@ -5,9 +5,18 @@ in float vertRadius;
|
||||
out vec4 fragTexCoord;
|
||||
out vec4 fragColor;
|
||||
out float fragOffset;
|
||||
uniform mat4 modelViewMatrix;
|
||||
uniform mat4 projMatrix;
|
||||
uniform float use_offset;
|
||||
|
||||
layout (std140) uniform matrixData {
|
||||
mat4 modelViewMatrix;
|
||||
mat4 projMatrix;
|
||||
};
|
||||
|
||||
layout (std140) uniform genericData {
|
||||
float window_width;
|
||||
float window_height;
|
||||
float use_offset;
|
||||
};
|
||||
|
||||
void main()
|
||||
{
|
||||
gl_Position = projMatrix * modelViewMatrix * vertPosition;
|
||||
|
||||
+15
-9
@@ -1,21 +1,27 @@
|
||||
|
||||
#include "gamma.sdr"
|
||||
|
||||
uniform sampler2DArray baseMap;
|
||||
uniform sampler2D depthMap;
|
||||
uniform float window_width;
|
||||
uniform float window_height;
|
||||
uniform float nearZ;
|
||||
uniform float farZ;
|
||||
uniform int linear_depth;
|
||||
uniform int srgb;
|
||||
uniform int blend_alpha;
|
||||
in float fragRadius;
|
||||
in vec4 fragPosition;
|
||||
in vec4 fragTexCoord;
|
||||
in vec4 fragColor;
|
||||
|
||||
out vec4 fragOut0;
|
||||
|
||||
uniform sampler2DArray baseMap;
|
||||
uniform sampler2D depthMap;
|
||||
|
||||
layout (std140) uniform genericData {
|
||||
float window_width;
|
||||
float window_height;
|
||||
float nearZ;
|
||||
float farZ;
|
||||
int linear_depth;
|
||||
int srgb;
|
||||
int blend_alpha;
|
||||
};
|
||||
|
||||
|
||||
void main()
|
||||
{
|
||||
vec4 fragmentColor = texture(baseMap, fragTexCoord.xyz);
|
||||
+8
-1
@@ -1,14 +1,21 @@
|
||||
layout (points) in;
|
||||
layout (triangle_strip, max_vertices = 4) out;
|
||||
|
||||
in vec3 geoUvec[];
|
||||
in float geoRadius[];
|
||||
in vec4 geoColor[];
|
||||
in float geoArrayIndex[];
|
||||
|
||||
out float fragRadius;
|
||||
out vec4 fragPosition;
|
||||
out vec4 fragTexCoord;
|
||||
out vec4 fragColor;
|
||||
uniform mat4 projMatrix;
|
||||
|
||||
layout (std140) uniform matrixData {
|
||||
mat4 modelViewMatrix;
|
||||
mat4 projMatrix;
|
||||
};
|
||||
|
||||
void main(void)
|
||||
{
|
||||
vec3 forward_vec = vec3(0.0, 0.0, 1.0);
|
||||
@@ -1,7 +1,9 @@
|
||||
|
||||
in vec4 vertPosition;
|
||||
in vec4 vertTexCoord;
|
||||
in vec4 vertColor;
|
||||
in float vertRadius;
|
||||
|
||||
#ifdef FLAG_EFFECT_GEOMETRY
|
||||
in vec3 vertUvec;
|
||||
out vec3 geoUvec;
|
||||
@@ -14,28 +16,25 @@ in float vertRadius;
|
||||
out vec4 fragTexCoord;
|
||||
out vec4 fragColor;
|
||||
#endif
|
||||
#ifdef FLAG_EFFECT_DISTORTION
|
||||
out float fragOffset;
|
||||
uniform float use_offset;
|
||||
#endif
|
||||
uniform mat4 modelViewMatrix;
|
||||
uniform mat4 projMatrix;
|
||||
|
||||
layout (std140) uniform matrixData {
|
||||
mat4 modelViewMatrix;
|
||||
mat4 projMatrix;
|
||||
};
|
||||
|
||||
void main()
|
||||
{
|
||||
#ifdef FLAG_EFFECT_GEOMETRY
|
||||
geoRadius = vertRadius;
|
||||
geoUvec = vertUvec;
|
||||
gl_Position = modelViewMatrix * vertPosition;
|
||||
geoColor = vertColor;
|
||||
geoArrayIndex = vertTexCoord.z;
|
||||
#else
|
||||
fragRadius = vertRadius;
|
||||
gl_Position = projMatrix * modelViewMatrix * vertPosition;
|
||||
fragPosition = modelViewMatrix * vertPosition;
|
||||
fragTexCoord = vec4(vertTexCoord.xyz, 0.0);
|
||||
fragColor = vertColor;
|
||||
#endif
|
||||
#ifdef FLAG_EFFECT_DISTORTION
|
||||
fragOffset = vertRadius * use_offset;
|
||||
#endif
|
||||
#ifdef FLAG_EFFECT_GEOMETRY
|
||||
geoRadius = vertRadius;
|
||||
geoUvec = vertUvec;
|
||||
gl_Position = modelViewMatrix * vertPosition;
|
||||
geoColor = vertColor;
|
||||
geoArrayIndex = vertTexCoord.z;
|
||||
#else
|
||||
fragRadius = vertRadius;
|
||||
gl_Position = projMatrix * modelViewMatrix * vertPosition;
|
||||
fragPosition = modelViewMatrix * vertPosition;
|
||||
fragTexCoord = vec4(vertTexCoord.xyz, 0.0);
|
||||
fragColor = vertColor;
|
||||
#endif
|
||||
}
|
||||
@@ -2,16 +2,20 @@
|
||||
#include "gamma.sdr"
|
||||
|
||||
in vec4 fragTexCoord;
|
||||
|
||||
out vec4 fragOut0;
|
||||
|
||||
uniform sampler2D tex;
|
||||
uniform sampler2D depth_tex;
|
||||
|
||||
uniform float fog_start;
|
||||
uniform float fog_scale;
|
||||
uniform vec3 fog_color;
|
||||
uniform float zNear;
|
||||
uniform float zFar;
|
||||
layout (std140) uniform genericData {
|
||||
vec3 fog_color;
|
||||
float fog_start;
|
||||
|
||||
float fog_scale;
|
||||
float zNear;
|
||||
float zFar;
|
||||
};
|
||||
|
||||
void main()
|
||||
{
|
||||
@@ -20,7 +24,7 @@ void main()
|
||||
// If the scene is in fog then we change the color we operate on based on the depth of the pixel
|
||||
float depth_val = texture(depth_tex, fragTexCoord.xy).x;
|
||||
// Transform depth value from [-1, 1] to [0, 1]
|
||||
float depth_normalized = 2.0 * depth_val - 1.0;
|
||||
float depth_normalized = fma(depth_val, 0.5, 0.5);
|
||||
// Now we compute the depth value in projection space using the clipping plane information
|
||||
float view_depth = 2.0 * zNear * zFar / (zFar + zNear - depth_normalized * (zFar - zNear));
|
||||
|
||||
|
||||
@@ -1,9 +1,14 @@
|
||||
|
||||
in vec4 vertPosition;
|
||||
uniform float rt_w;
|
||||
uniform float rt_h;
|
||||
|
||||
out vec2 v_rcpFrame;
|
||||
noperspective out vec2 v_pos;
|
||||
|
||||
layout (std140) uniform genericData {
|
||||
float rt_w;
|
||||
float rt_h;
|
||||
};
|
||||
|
||||
void main() {
|
||||
gl_Position = vertPosition;
|
||||
v_rcpFrame = vec2(1.0/rt_w, 1.0/rt_h);
|
||||
|
||||
@@ -8,7 +8,7 @@ const float SPEC_INTENSITY_POINT = 5.3 ;// Point light
|
||||
const float SPEC_INTENSITY_DIRECTIONAL = 3.0 ;// Directional light
|
||||
const float SPECULAR_FACTOR = 1.75;
|
||||
const float SPECULAR_ALPHA = 0.1;
|
||||
const float SPEC_FACTOR_NO_SPEC_MAP = 0.6;
|
||||
const float SPEC_FACTOR_NO_SPEC_MAP = 0.1;
|
||||
const float ENV_ALPHA_FACTOR = 0.3;
|
||||
const float GLOW_MAP_INTENSITY = 1.5;
|
||||
const float AMBIENT_LIGHT_BOOST = 1.0;
|
||||
@@ -55,4 +55,4 @@ vec3 computeLighting(vec3 specColor, vec3 light, vec3 normal, vec3 halfVec, vec3
|
||||
#else
|
||||
return SpecularGGX(specColor, light, normal, halfVec, view, gloss, fresnelFactor, dotNL);
|
||||
#endif
|
||||
}
|
||||
}
|
||||
@@ -1,13 +1,20 @@
|
||||
|
||||
in vec4 fragTexCoord;
|
||||
|
||||
out vec4 fragOut0;
|
||||
|
||||
uniform sampler2D scene;
|
||||
uniform sampler2D cockpit;
|
||||
uniform vec2 sun_pos;
|
||||
uniform float density;
|
||||
uniform float weight;
|
||||
uniform float falloff;
|
||||
uniform float intensity;
|
||||
uniform float cp_intensity;
|
||||
|
||||
layout (std140) uniform genericData {
|
||||
vec2 sun_pos;
|
||||
float density;
|
||||
float weight;
|
||||
float falloff;
|
||||
float intensity;
|
||||
float cp_intensity;
|
||||
};
|
||||
|
||||
void main()
|
||||
{
|
||||
vec2 step = vec2( fragTexCoord.st - sun_pos.xy );
|
||||
@@ -29,4 +36,4 @@ void main()
|
||||
}
|
||||
fragOut0 = sum * intensity;
|
||||
fragOut0.a = 1.0;
|
||||
}
|
||||
}
|
||||
@@ -4,9 +4,13 @@
|
||||
in vec4 fragTexCoord;
|
||||
in vec4 fragColor;
|
||||
out vec4 fragOut0;
|
||||
|
||||
uniform sampler2D baseMap;
|
||||
uniform int noTexturing;
|
||||
uniform int srgb;
|
||||
|
||||
layout (std140) uniform genericData {
|
||||
int noTexturing;
|
||||
int srgb;
|
||||
};
|
||||
|
||||
void main()
|
||||
{
|
||||
|
||||
@@ -3,21 +3,15 @@ in vec4 vertTexCoord;
|
||||
in vec4 vertColor;
|
||||
out vec4 fragTexCoord;
|
||||
out vec4 fragColor;
|
||||
uniform mat4 modelViewMatrix;
|
||||
uniform mat4 projMatrix;
|
||||
uniform vec4 color;
|
||||
|
||||
uniform mat4 modelMatrix;
|
||||
uniform bool clipEnabled;
|
||||
uniform vec4 clipEquation;
|
||||
layout (std140) uniform matrixData {
|
||||
mat4 modelViewMatrix;
|
||||
mat4 projMatrix;
|
||||
};
|
||||
|
||||
void main()
|
||||
{
|
||||
fragTexCoord = vertTexCoord;
|
||||
fragColor = vertColor * color;
|
||||
fragColor = vertColor;
|
||||
gl_Position = projMatrix * modelViewMatrix * vertPosition;
|
||||
|
||||
if (clipEnabled) {
|
||||
gl_ClipDistance[0] = dot(clipEquation, modelMatrix * vertPosition);
|
||||
}
|
||||
}
|
||||
@@ -1,36 +1,25 @@
|
||||
in vec4 fragTexCoord;
|
||||
|
||||
out vec4 fragOut0;
|
||||
|
||||
uniform sampler2D tex;
|
||||
uniform float timer;
|
||||
#ifdef FLAG_DISTORT_NOISE
|
||||
uniform float noise_amount;
|
||||
#endif
|
||||
#ifdef FLAG_SATURATION
|
||||
uniform float saturation;
|
||||
#endif
|
||||
#ifdef FLAG_BRIGHTNESS
|
||||
uniform float brightness;
|
||||
#endif
|
||||
#ifdef FLAG_CONTRAST
|
||||
uniform float contrast;
|
||||
#endif
|
||||
#ifdef FLAG_GRAIN
|
||||
uniform float film_grain;
|
||||
#endif
|
||||
#ifdef FLAG_STRIPES
|
||||
uniform float tv_stripes;
|
||||
#endif
|
||||
#ifdef FLAG_CUTOFF
|
||||
uniform float cutoff;
|
||||
#endif
|
||||
#ifdef FLAG_DITH
|
||||
uniform float dither;
|
||||
#endif
|
||||
#ifdef FLAG_TINT
|
||||
uniform vec3 tint;
|
||||
#endif
|
||||
uniform sampler2D blurred_tex;
|
||||
uniform sampler2D depth_tex;
|
||||
|
||||
layout (std140) uniform genericData {
|
||||
float timer;
|
||||
float noise_amount;
|
||||
float saturation;
|
||||
float brightness;
|
||||
|
||||
float contrast;
|
||||
float film_grain;
|
||||
float tv_stripes;
|
||||
float cutoff;
|
||||
|
||||
vec3 tint;
|
||||
float dither;
|
||||
};
|
||||
|
||||
void main()
|
||||
{
|
||||
#ifdef FLAG_DISTORT_NOISE
|
||||
|
||||
@@ -1,10 +1,8 @@
|
||||
in vec4 vertPosition;
|
||||
in vec4 vertTexCoord;
|
||||
out vec4 fragTexCoord;
|
||||
out float blurSize;
|
||||
uniform float bsize;
|
||||
void main()
|
||||
{
|
||||
fragTexCoord = vertTexCoord;
|
||||
gl_Position = vertPosition;
|
||||
}
|
||||
}
|
||||
@@ -4,9 +4,15 @@ in vec4 fragColor;
|
||||
|
||||
out vec4 fragOut0;
|
||||
|
||||
uniform bool textured;
|
||||
uniform sampler2DArray baseMap;
|
||||
uniform int baseMapIndex;
|
||||
|
||||
layout (std140) uniform genericData {
|
||||
mat4 modelViewMatrix;
|
||||
mat4 projMatrix;
|
||||
|
||||
bool textured;
|
||||
int baseMapIndex;
|
||||
};
|
||||
|
||||
void main() {
|
||||
if (textured) {
|
||||
|
||||
@@ -6,8 +6,13 @@ in vec2 vertTexCoord;
|
||||
out vec2 fragTexCoord;
|
||||
out vec4 fragColor;
|
||||
|
||||
uniform mat4 modelViewMatrix;
|
||||
uniform mat4 projMatrix;
|
||||
layout (std140) uniform genericData {
|
||||
mat4 modelViewMatrix;
|
||||
mat4 projMatrix;
|
||||
|
||||
bool textured;
|
||||
int baseMapIndex;
|
||||
};
|
||||
|
||||
void main()
|
||||
{
|
||||
|
||||
@@ -1,10 +0,0 @@
|
||||
in vec4 fragTexCoord;
|
||||
out vec4 fragOut0;
|
||||
uniform sampler2DArray shadow_map;
|
||||
//uniform sampler2D shadow_map;
|
||||
uniform int index;
|
||||
void main()
|
||||
{
|
||||
vec3 texcoord = vec3(fragTexCoord.xy, float(index));
|
||||
fragOut0 = vec4(texture(shadow_map, texcoord).rgb,1.0);
|
||||
}
|
||||
@@ -1,8 +0,0 @@
|
||||
in vec4 vertPosition;
|
||||
in vec4 vertTexCoord;
|
||||
out vec4 fragTexCoord;
|
||||
void main()
|
||||
{
|
||||
fragTexCoord = vertTexCoord;
|
||||
gl_Position = vertPosition;
|
||||
}
|
||||
@@ -1,14 +1,27 @@
|
||||
|
||||
#include "gamma.sdr"
|
||||
|
||||
const float EMISSIVE_GAIN = 2.0;
|
||||
|
||||
in vec4 fragImpactUV;
|
||||
in float fragNormOffset;
|
||||
uniform vec4 color;
|
||||
uniform sampler2DArray shieldMap;
|
||||
uniform int shieldMapIndex;
|
||||
uniform int srgb;
|
||||
|
||||
out vec4 fragOut0;
|
||||
#define EMISSIVE_GAIN 2.0
|
||||
|
||||
uniform sampler2DArray shieldMap;
|
||||
|
||||
layout (std140) uniform genericData {
|
||||
mat4 shieldModelViewMatrix;
|
||||
mat4 shieldProjMatrix;
|
||||
|
||||
vec3 hitNormal;
|
||||
int srgb;
|
||||
|
||||
vec4 color;
|
||||
|
||||
int shieldMapIndex;
|
||||
};
|
||||
|
||||
void main()
|
||||
{
|
||||
if(fragNormOffset < 0.0) discard;
|
||||
|
||||
@@ -1,12 +1,28 @@
|
||||
|
||||
in vec4 vertPosition;
|
||||
in vec3 vertNormal;
|
||||
|
||||
out vec4 fragImpactUV;
|
||||
out float fragNormOffset;
|
||||
uniform mat4 modelViewMatrix;
|
||||
uniform mat4 projMatrix;
|
||||
uniform vec3 hitNormal;
|
||||
uniform mat4 shieldModelViewMatrix;
|
||||
uniform mat4 shieldProjMatrix;
|
||||
|
||||
|
||||
layout (std140) uniform matrixData {
|
||||
mat4 modelViewMatrix;
|
||||
mat4 projMatrix;
|
||||
};
|
||||
|
||||
layout (std140) uniform genericData {
|
||||
mat4 shieldModelViewMatrix;
|
||||
mat4 shieldProjMatrix;
|
||||
|
||||
vec3 hitNormal;
|
||||
int srgb;
|
||||
|
||||
vec4 color;
|
||||
|
||||
int shieldMapIndex;
|
||||
};
|
||||
|
||||
void main()
|
||||
{
|
||||
gl_Position = projMatrix * modelViewMatrix * vertPosition;
|
||||
@@ -15,4 +31,4 @@ void main()
|
||||
fragImpactUV = shieldProjMatrix * shieldModelViewMatrix * vertPosition;
|
||||
fragImpactUV += 1.0f;
|
||||
fragImpactUV *= 0.5f;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,25 @@
|
||||
|
||||
layout (std140) uniform genericData {
|
||||
vec2 smaa_rt_metrics;
|
||||
};
|
||||
|
||||
#define SMAA_RT_METRICS vec4(1.0 / smaa_rt_metrics, smaa_rt_metrics)
|
||||
|
||||
#define SMAA_INCLUDE_VS 0
|
||||
#define SMAA_INCLUDE_PS 1
|
||||
|
||||
#include "SMAA.sdr"
|
||||
|
||||
in vec2 fragTexCoord;
|
||||
in vec2 fragPixcoord;
|
||||
in vec4 fragOffset[3];
|
||||
|
||||
out vec4 fragOut0;
|
||||
|
||||
uniform sampler2D edgesTex;
|
||||
uniform sampler2D areaTex;
|
||||
uniform sampler2D searchTex;
|
||||
|
||||
void main() {
|
||||
fragOut0 = SMAABlendingWeightCalculationPS(fragTexCoord, fragPixcoord, fragOffset, edgesTex, areaTex, searchTex, vec4(0.0));
|
||||
}
|
||||
@@ -0,0 +1,24 @@
|
||||
|
||||
layout (std140) uniform genericData {
|
||||
vec2 smaa_rt_metrics;
|
||||
};
|
||||
|
||||
#define SMAA_RT_METRICS vec4(1.0 / smaa_rt_metrics, smaa_rt_metrics)
|
||||
|
||||
#define SMAA_INCLUDE_VS 1
|
||||
#define SMAA_INCLUDE_PS 0
|
||||
|
||||
#include "SMAA.sdr"
|
||||
|
||||
in vec4 vertPosition;
|
||||
in vec2 vertTexCoord;
|
||||
|
||||
out vec2 fragTexCoord;
|
||||
out vec2 fragPixcoord;
|
||||
out vec4 fragOffset[3];
|
||||
|
||||
void main() {
|
||||
gl_Position = vertPosition;
|
||||
fragTexCoord = vertTexCoord;
|
||||
SMAABlendingWeightCalculationVS(vertTexCoord, fragPixcoord, fragOffset);
|
||||
}
|
||||
@@ -0,0 +1,22 @@
|
||||
|
||||
layout (std140) uniform genericData {
|
||||
vec2 smaa_rt_metrics;
|
||||
};
|
||||
|
||||
#define SMAA_RT_METRICS vec4(1.0 / smaa_rt_metrics, smaa_rt_metrics)
|
||||
|
||||
#define SMAA_INCLUDE_VS 0
|
||||
#define SMAA_INCLUDE_PS 1
|
||||
|
||||
#include "SMAA.sdr"
|
||||
|
||||
in vec2 fragTexCoord;
|
||||
in vec4 fragOffset[3];
|
||||
|
||||
out vec4 fragOut0;
|
||||
|
||||
uniform sampler2D colorTex;
|
||||
|
||||
void main() {
|
||||
fragOut0 = vec4(SMAALumaEdgeDetectionPS(fragTexCoord, fragOffset, colorTex), 0.0, 1.0);
|
||||
}
|
||||
@@ -0,0 +1,23 @@
|
||||
|
||||
layout (std140) uniform genericData {
|
||||
vec2 smaa_rt_metrics;
|
||||
};
|
||||
|
||||
#define SMAA_RT_METRICS vec4(1.0 / smaa_rt_metrics, smaa_rt_metrics)
|
||||
|
||||
#define SMAA_INCLUDE_VS 1
|
||||
#define SMAA_INCLUDE_PS 0
|
||||
|
||||
#include "SMAA.sdr"
|
||||
|
||||
in vec4 vertPosition;
|
||||
in vec2 vertTexCoord;
|
||||
|
||||
out vec2 fragTexCoord;
|
||||
out vec4 fragOffset[3];
|
||||
|
||||
void main() {
|
||||
gl_Position = vertPosition;
|
||||
fragTexCoord = vertTexCoord;
|
||||
SMAAEdgeDetectionVS(vertTexCoord, fragOffset);
|
||||
}
|
||||
@@ -0,0 +1,23 @@
|
||||
|
||||
layout (std140) uniform genericData {
|
||||
vec2 smaa_rt_metrics;
|
||||
};
|
||||
|
||||
#define SMAA_RT_METRICS vec4(1.0 / smaa_rt_metrics, smaa_rt_metrics)
|
||||
|
||||
#define SMAA_INCLUDE_VS 0
|
||||
#define SMAA_INCLUDE_PS 1
|
||||
|
||||
#include "SMAA.sdr"
|
||||
|
||||
in vec2 fragTexCoord;
|
||||
in vec4 fragOffset;
|
||||
|
||||
out vec4 fragOut0;
|
||||
|
||||
uniform sampler2D colorTex;
|
||||
uniform sampler2D blendTex;
|
||||
|
||||
void main() {
|
||||
fragOut0 = SMAANeighborhoodBlendingPS(fragTexCoord, fragOffset, colorTex, blendTex);
|
||||
}
|
||||
@@ -0,0 +1,23 @@
|
||||
|
||||
layout (std140) uniform genericData {
|
||||
vec2 smaa_rt_metrics;
|
||||
};
|
||||
|
||||
#define SMAA_RT_METRICS vec4(1.0 / smaa_rt_metrics, smaa_rt_metrics)
|
||||
|
||||
#define SMAA_INCLUDE_VS 1
|
||||
#define SMAA_INCLUDE_PS 0
|
||||
|
||||
#include "SMAA.sdr"
|
||||
|
||||
in vec4 vertPosition;
|
||||
in vec2 vertTexCoord;
|
||||
|
||||
out vec2 fragTexCoord;
|
||||
out vec4 fragOffset;
|
||||
|
||||
void main() {
|
||||
gl_Position = vertPosition;
|
||||
fragTexCoord = vertTexCoord;
|
||||
SMAANeighborhoodBlendingVS(vertTexCoord, fragOffset);
|
||||
}
|
||||
@@ -4,7 +4,11 @@
|
||||
in vec4 fragTexCoord;
|
||||
out vec4 fragOut0;
|
||||
uniform sampler2D tex;
|
||||
uniform float exposure;
|
||||
|
||||
layout (std140) uniform genericData {
|
||||
float exposure;
|
||||
};
|
||||
|
||||
vec3 Uncharted2Tonemapping(vec3 hdr_color)
|
||||
{
|
||||
float A = 0.15;
|
||||
|
||||
@@ -1,10 +1,14 @@
|
||||
in vec4 vertPosition;
|
||||
in vec4 vertTexCoord;
|
||||
out vec4 fragTexCoord;
|
||||
uniform mat4 modelViewMatrix;
|
||||
uniform mat4 projMatrix;
|
||||
|
||||
layout (std140) uniform matrixData {
|
||||
mat4 modelViewMatrix;
|
||||
mat4 projMatrix;
|
||||
};
|
||||
|
||||
void main()
|
||||
{
|
||||
fragTexCoord = vertTexCoord;
|
||||
gl_Position = projMatrix * modelViewMatrix * vertPosition;
|
||||
}
|
||||
}
|
||||
@@ -54,6 +54,7 @@ static auto WarpOption = options::OptionBuilder<bool>("Graphics.3dWarp", "3D War
|
||||
.bind_to(&Fireball_use_3d_warp)
|
||||
.importance(65)
|
||||
.finish();
|
||||
|
||||
/**
|
||||
* Play warp in sound for warp effect
|
||||
*/
|
||||
@@ -73,7 +74,7 @@ void fireball_play_warphole_open_sound(int ship_class, fireball *fb)
|
||||
|
||||
if(fb->warp_open_sound_index.isValid()) {
|
||||
sound_index = fb->warp_open_sound_index;
|
||||
} else if ((ship_class >= 0) && (ship_class < static_cast<int>(Ship_info.size()))) {
|
||||
} else if ((ship_class >= 0) && (ship_class < ship_info_size())) {
|
||||
if ( Ship_info[ship_class].is_huge_ship() ) {
|
||||
sound_index = gamesnd_id(GameSounds::CAPITAL_WARP_IN);
|
||||
fb->flags |= FBF_WARP_CAPITAL_SIZE;
|
||||
|
||||
Loaded 100 of 613 files, more files were not shown because too many files have changed in this diff.
Show more
Reference in new issue
Block a user