mirror of
https://github.com/OpenTTD/OpenTTD.git
synced 2025-08-13 17:49:10 +00:00
Compare commits
711 Commits
0.6.0-beta
...
0.6.2-RC2
Author | SHA1 | Date | |
---|---|---|---|
|
633b054830 | ||
|
22cda2f1b8 | ||
|
a0f6275c3a | ||
|
c29c7f7932 | ||
|
6097389437 | ||
|
bafea078f2 | ||
|
5c97e3307c | ||
|
3cd7a5959f | ||
|
7da596b92d | ||
|
fbbd7bef6d | ||
|
b95eb99c55 | ||
|
a68eee5f31 | ||
|
4f76d929c6 | ||
|
94ae5be42a | ||
|
808f15e43f | ||
|
71144d1a98 | ||
|
44a476c946 | ||
|
76a2221dbb | ||
|
966c2fe4b9 | ||
|
f4d1d082ab | ||
|
391127bfaf | ||
|
ee7bad769f | ||
|
9e966f9cd0 | ||
|
942a752e2a | ||
|
9e03a7b23a | ||
|
e114133d18 | ||
|
9241c4649d | ||
|
f126c2e66f | ||
|
c973bd87ce | ||
|
4cb6a89e81 | ||
|
7bf1737a66 | ||
|
fb0afc9cca | ||
|
9f65c1b8f0 | ||
|
1a495b0b1c | ||
|
5294075ad4 | ||
|
ed4ae53e8a | ||
|
c53f9fc2a2 | ||
|
cbd426059e | ||
|
624549464f | ||
|
1f9dce4697 | ||
|
185c30b6bf | ||
|
8df7a53652 | ||
|
9d47454105 | ||
|
f65b925744 | ||
|
4094e9b495 | ||
|
389d89ea49 | ||
|
292cfc56f6 | ||
|
f0538b4b62 | ||
|
5d747802f2 | ||
|
9dffdaca0d | ||
|
55dcd4f94d | ||
|
ac4ec8c2d2 | ||
ab7542e912 | |||
|
031c9da01c | ||
d27ab363a7 | |||
|
faa1483ee6 | ||
|
a887b79f90 | ||
|
985dbaa093 | ||
|
fbf70d53ec | ||
|
2b86efea74 | ||
|
e2ec1e7032 | ||
|
a6cba39750 | ||
e27de79990 | |||
|
013d7db19f | ||
|
1abd2bd700 | ||
|
756e0d9b6e | ||
058724b768 | |||
|
89e9bbfa98 | ||
|
bfae49aeb2 | ||
|
5db7288ea9 | ||
|
f8bae50bf5 | ||
|
9a96f89646 | ||
d205e53392 | |||
|
902320d7cb | ||
|
84385f187b | ||
|
761224a4f6 | ||
|
7056428d15 | ||
|
ec59843136 | ||
|
51bbf0c84f | ||
|
220b2a1ae1 | ||
|
82e340c325 | ||
|
2c74f39273 | ||
|
08f0179916 | ||
|
8f556828f0 | ||
|
1976d2d37c | ||
|
442efcffb0 | ||
b4a51cd28d | |||
|
cd411ab75a | ||
f08cf32216 | |||
|
a6ee46a5a0 | ||
bc8ad5c743 | |||
|
266dd80f6c | ||
9674ff71de | |||
3907ac518b | |||
e1cc80b01c | |||
|
6e3ae628fc | ||
6bb37edfb6 | |||
|
b64f637c72 | ||
|
cf0e6d4cb4 | ||
5049fbb081 | |||
|
56ed79e448 | ||
|
620695587d | ||
|
8dacca9a71 | ||
|
c4e023bd6e | ||
|
9973b7fb64 | ||
f87b1df566 | |||
3bba6e4abd | |||
9ccce57438 | |||
6bdc8e5fae | |||
034649e7f5 | |||
|
35fd0dfd4e | ||
|
86a4d377b1 | ||
|
35195bb2bc | ||
|
459fd42e1d | ||
6aea2454c8 | |||
926f5d548d | |||
|
8f47b642b6 | ||
|
46a3508f50 | ||
|
202f1046f6 | ||
|
7c14dedeb6 | ||
|
92254bda01 | ||
|
7e74fca7d8 | ||
|
68aaeec3a8 | ||
|
0a92b3366c | ||
|
3764aa5134 | ||
|
62d9bf8d0f | ||
|
4a4be744b6 | ||
|
e41df385d7 | ||
|
93b3a66678 | ||
|
c2f3e0e326 | ||
|
27284db36f | ||
|
f352512c8d | ||
|
ed1e402960 | ||
|
747f57bcec | ||
|
8290a798fc | ||
|
089969e1ca | ||
|
e821b3a9b8 | ||
dda6cab17a | |||
|
c0544563a6 | ||
577b0cc260 | |||
|
1b73417e5f | ||
79b6b9cb66 | |||
|
db9d5a909f | ||
|
1e74834441 | ||
e90cf8509a | |||
|
a47b4631ea | ||
|
767e1cc37e | ||
|
b7993793c8 | ||
9e65157548 | |||
|
a190606f2e | ||
|
e95a85315c | ||
|
73a6525129 | ||
|
f5929d413b | ||
|
ca46154068 | ||
|
0e9e94a94b | ||
|
2b8d1bcb51 | ||
|
169ac7c91d | ||
|
595d9357c3 | ||
|
b4b5c09ff9 | ||
|
6e9b952623 | ||
|
adf1227290 | ||
|
578e833284 | ||
|
0821df8537 | ||
|
0cdf2b525f | ||
a4c14fb442 | |||
|
509b3a3247 | ||
|
c7a8080c3a | ||
|
29125c0e68 | ||
|
a0a225ab02 | ||
a0fda5b969 | |||
b3f304cde3 | |||
06de1215c1 | |||
db0eb9570c | |||
|
38969fe46d | ||
|
d75cccf5d5 | ||
|
6bf44158c5 | ||
|
505951e9fa | ||
|
8b56e7544e | ||
|
291931bf50 | ||
|
16e23a75fe | ||
7394b9d030 | |||
|
13781ec11b | ||
|
ebe03109ad | ||
|
4b7a812e55 | ||
|
058f39fe18 | ||
|
e7173d3ba4 | ||
|
245fccf22d | ||
|
b8f8d0ca51 | ||
|
b4f58ebae4 | ||
|
044ca2bbf6 | ||
|
3e70ee6ed7 | ||
|
a5f99154b7 | ||
|
a40d761d7f | ||
|
fd0f57a794 | ||
|
cedca22c60 | ||
|
ef354e074f | ||
|
65a13a3022 | ||
ac5433a924 | |||
d1c741db4c | |||
|
4164d2488f | ||
|
43c0f7ea8e | ||
|
739b118c6b | ||
859d768bb7 | |||
|
bb81de3c4c | ||
3371d02449 | |||
|
539c635efd | ||
|
81b3652f37 | ||
|
a0ddc43e92 | ||
b7cd791988 | |||
|
fd51465c8b | ||
|
480036254b | ||
|
0d1e4237cf | ||
|
507728f46b | ||
df7327b453 | |||
|
6bb9c474dd | ||
|
c95ff294fb | ||
63e306006b | |||
|
c2bad6d22c | ||
|
23bae896c9 | ||
4d0c443953 | |||
9f6fd72c09 | |||
592e22cc3a | |||
e76f7c9359 | |||
|
f4334301e8 | ||
|
b0b929ce42 | ||
|
42b305661b | ||
|
f19eca0905 | ||
f175e46208 | |||
|
cc2b8b574a | ||
|
1011ac353b | ||
fb6accfcb7 | |||
|
4f0e6ab0ea | ||
|
d8b3526840 | ||
|
9a50fcd281 | ||
|
9e0a93d286 | ||
|
8a768652c8 | ||
|
4e839aacf6 | ||
|
e075cf5500 | ||
|
ad933e1ddb | ||
|
a86921da41 | ||
|
9deab65bae | ||
|
efe831934a | ||
|
d9af979d6a | ||
|
e3301db213 | ||
|
802c949755 | ||
|
221494bd3f | ||
|
cebb86777a | ||
|
a782ab3903 | ||
|
cf9447c15b | ||
|
9343ad44fd | ||
|
8195e57fd4 | ||
|
e2de86f951 | ||
|
731137678c | ||
|
7b9efcea21 | ||
|
2173b03144 | ||
|
bf15bc9c57 | ||
|
30a8c150d0 | ||
|
034150c199 | ||
|
b68f398cac | ||
1bcc1927b1 | |||
|
431c3ce3c1 | ||
|
8a3f6830a3 | ||
|
eb0d50aaff | ||
a187d92d87 | |||
|
8606e70819 | ||
|
c0c9b80db3 | ||
|
918591c05b | ||
|
7860d8d18a | ||
|
e95e887772 | ||
|
94f4217984 | ||
|
5049ff8e8e | ||
f29c748d4c | |||
|
62b3520e51 | ||
|
80daad8d4d | ||
|
3003986e67 | ||
|
c261218cf5 | ||
|
146779b158 | ||
|
23c669fe50 | ||
|
dbfdc5df94 | ||
|
b35611dae3 | ||
|
5e7c8012ec | ||
|
04ef38ec60 | ||
|
2a2aa1d22a | ||
|
b206e50f80 | ||
a528dc89c7 | |||
|
2588879c6d | ||
|
20e9abed47 | ||
|
0ca3977af8 | ||
|
1e51090e74 | ||
|
90973cdcef | ||
|
612ba5c787 | ||
|
f3663fd25c | ||
1d891a8b15 | |||
|
7cf2c83462 | ||
|
fc4f6dcfb1 | ||
7a78a1b51a | |||
|
525409b0fc | ||
67782add11 | |||
|
45b79bc9f1 | ||
|
803a1e2353 | ||
|
6537d13c8a | ||
e0849acc5a | |||
be548ee224 | |||
|
f3ecaf796e | ||
|
a1c543e064 | ||
|
fe9891c8ec | ||
|
ef35cefddc | ||
|
2ef11e0b8b | ||
|
bc1542d483 | ||
|
1608d67030 | ||
|
a2b35067dd | ||
|
caf7e8655c | ||
|
953c3cb6df | ||
|
46589fa827 | ||
1cdee354b4 | |||
|
94aa04948c | ||
|
44f4ebffed | ||
|
be6737a2db | ||
fb8973c64a | |||
|
a736e8500a | ||
|
9c4cb84c03 | ||
|
7cf4f09c26 | ||
|
cda0e9f91c | ||
|
379f89fc7e | ||
b20d220333 | |||
|
02f774793b | ||
|
fdd71514b2 | ||
|
1629699094 | ||
|
c9a9103566 | ||
|
3b2145aafe | ||
|
fde33b5547 | ||
1a9b741e43 | |||
|
d3c7a35d22 | ||
|
abc6e70447 | ||
|
a1b98cda59 | ||
|
a9031cc5f5 | ||
|
0253b1d02a | ||
|
c8ba8d930b | ||
|
c5b81c9382 | ||
|
21eef65e77 | ||
0847def759 | |||
|
7b29dcde3c | ||
97a1cbdfa1 | |||
c6656d6b2f | |||
2fc2188127 | |||
c99eb9e456 | |||
|
d3990083d3 | ||
18431dd9f8 | |||
|
e214e03c28 | ||
|
b329781ab2 | ||
|
6f6708e844 | ||
|
d11aeb118c | ||
eeeeeb9336 | |||
|
e99c34bef4 | ||
|
bbdc5a9314 | ||
|
4991dcecc7 | ||
|
44d085af6c | ||
|
1fc0c0d2dc | ||
|
bd0c853e27 | ||
|
da754951f1 | ||
|
79aa7247c0 | ||
|
5f9a877376 | ||
697b07c99c | |||
9c65bcea7d | |||
|
541247c830 | ||
|
5a7c903770 | ||
|
b5641ae0f2 | ||
|
e40944f8e0 | ||
|
4cb91fa591 | ||
b718cae67d | |||
|
9c16461c29 | ||
|
d6eaf1a11a | ||
|
4a3e135086 | ||
|
0b888ccc00 | ||
9515328962 | |||
|
a31ebdb2be | ||
e35cf20a23 | |||
0f966a316a | |||
ff0891426f | |||
|
983fdb8a4f | ||
da53070a38 | |||
|
3a423a8747 | ||
39f6173401 | |||
|
49d2087d7f | ||
|
b99c83246b | ||
|
7d1e3086b8 | ||
|
96a18d859f | ||
|
59ec5e62ce | ||
30bac58bde | |||
ffec79bbcf | |||
|
9444eb4484 | ||
ca1b3e7b4e | |||
|
0a6425926b | ||
|
f23e71f22f | ||
|
000117aa19 | ||
9ca929c812 | |||
|
ffb9ca164e | ||
|
2c5c97346b | ||
|
3423032dbb | ||
|
90a770250f | ||
|
e91230415d | ||
|
2f6ee3a4a1 | ||
a580c8d059 | |||
4a2f7db99b | |||
|
aa0412e0bc | ||
02c9484ebb | |||
|
1712a8a0e1 | ||
|
730dda867b | ||
14416791af | |||
|
600046f3d7 | ||
b6d0684826 | |||
70025a149d | |||
|
22a7b95c10 | ||
|
1d59439166 | ||
68707808c0 | |||
|
b7f50533c2 | ||
|
0b3db1a92d | ||
307b0e8e7a | |||
ada41b7b3f | |||
|
8d077b16d8 | ||
ac0fa7f69f | |||
|
822242f411 | ||
35135222b5 | |||
|
17c9ea9ca3 | ||
6d3aa07a24 | |||
d80e04d6f6 | |||
|
44a4ff835d | ||
ad54075acc | |||
c313676c66 | |||
|
c74cf439fa | ||
|
35f3421842 | ||
|
c579bffed2 | ||
|
978a7ca56a | ||
|
4f31704e2e | ||
|
f37174f0e2 | ||
a9c71ce375 | |||
68fc3b35da | |||
f788298209 | |||
|
f5d72cc84c | ||
|
08c01e64b8 | ||
|
3d61a1adc5 | ||
|
f658b79e15 | ||
|
69c18efdca | ||
4d9a9bf6ff | |||
bc438a3033 | |||
|
c8178d43c1 | ||
|
ac7bc24b0e | ||
69cb009075 | |||
330ec8bdd6 | |||
abac83795d | |||
019ffe29b8 | |||
|
692fbb3c05 | ||
|
5659cbe6fe | ||
|
beb1b07f5f | ||
|
2817e5425b | ||
|
7a66d5e21d | ||
|
77a20eae43 | ||
|
9556623281 | ||
|
40a7ace4fa | ||
|
ef112812c6 | ||
|
6891bc2011 | ||
|
576f8ad93e | ||
ab7cb0804d | |||
|
245f05a7cc | ||
932c586dfe | |||
|
26c621945d | ||
|
0078fd1699 | ||
ea6535c864 | |||
68a3df82b9 | |||
2723128ba9 | |||
|
c1108bd293 | ||
|
af59eb2543 | ||
|
8c13852373 | ||
1bcca5aae2 | |||
|
57ecf117c9 | ||
|
277ec663cb | ||
|
e789ee83ab | ||
ea808b2bfa | |||
bf0a7ae4fb | |||
e4c05f8d78 | |||
|
7beb63a93b | ||
027112e1fe | |||
|
bfc4d80c8e | ||
|
7d2d4314ec | ||
|
311c14c9f5 | ||
|
933aea42cb | ||
|
48861a9fae | ||
|
392d59f6a9 | ||
|
3ca95f2a85 | ||
|
27e5deb719 | ||
|
e281180d06 | ||
|
ef219245af | ||
|
8da51e5eb2 | ||
|
dc87b05e8c | ||
|
2f9aab3217 | ||
|
5c4150d304 | ||
|
b0c34f4d62 | ||
|
cc52a56052 | ||
|
079abbd04b | ||
|
d4e6a6bf57 | ||
|
a78d73805f | ||
|
aa1d429d7f | ||
|
853ca6386e | ||
c7debf7908 | |||
e677814a4b | |||
ab8382c0db | |||
|
a222fe2e86 | ||
|
704a75871a | ||
|
712d4b6259 | ||
|
ac528411df | ||
cbbc53e8f8 | |||
|
ed727f9a64 | ||
|
a4c1280945 | ||
|
79e0a48c42 | ||
|
cbe7e5d668 | ||
|
4d04077156 | ||
|
04f936c2c6 | ||
|
e5d33482b4 | ||
|
a1266da782 | ||
|
40ef636f43 | ||
|
1b936179ca | ||
|
3976bb987d | ||
|
930f875c51 | ||
|
0181678cde | ||
d30321d2af | |||
|
f44a9a5d5b | ||
|
6c954cad5f | ||
|
998d7644f6 | ||
82fe2885ab | |||
|
6375ea065b | ||
|
f67b5798a0 | ||
|
785572ea32 | ||
|
d133edd026 | ||
|
46650c54b6 | ||
|
b4337eba83 | ||
a27a240b87 | |||
|
ebb6259057 | ||
a01fc4c142 | |||
|
b4b3190b62 | ||
|
0e517fe023 | ||
931e6ea49d | |||
|
cd92981e9f | ||
ce2104ed47 | |||
814f47a3cc | |||
352f13dad1 | |||
4479c06e2d | |||
77717563e1 | |||
|
2832a6cafb | ||
|
eced1fb4ae | ||
|
a3ccdcea36 | ||
|
38115acf5a | ||
|
a8a3a7e3f2 | ||
|
b0ac283aec | ||
|
64fc2ade9e | ||
|
119b03ea70 | ||
|
acc7c9eb01 | ||
7be2160cfb | |||
|
fd330ce743 | ||
|
aeff6e5761 | ||
|
f7a293f074 | ||
|
f9a592cfdd | ||
|
279bfad275 | ||
|
f8f86420f8 | ||
|
e165aad4db | ||
|
91be5d7531 | ||
5d837282ee | |||
|
7302d8c88b | ||
9299f76af4 | |||
6a13067931 | |||
|
6b37ab36ea | ||
1cd2c3d517 | |||
3182cbb332 | |||
|
23fab42b2f | ||
|
c59ea520a7 | ||
|
b0ef12e0e9 | ||
|
8f94ac8f03 | ||
|
72afdb8d34 | ||
|
42bddcf723 | ||
|
aebcd80088 | ||
|
7e4b7e3ad4 | ||
|
6ce70b17ca | ||
|
ade37de6c6 | ||
|
6f7f4adffc | ||
|
19f8990f64 | ||
fa83291a76 | |||
47082fec5c | |||
|
9a2547b5a7 | ||
c94a6b8c78 | |||
47d23eb003 | |||
24784b7e0d | |||
|
f0e9c0cfc9 | ||
aab495604a | |||
|
3dd61f423a | ||
a8611311ac | |||
a967a7287f | |||
7031358cff | |||
|
d8f4a80b0a | ||
75472cbc16 | |||
|
b1be9f0137 | ||
|
8ee1faca6c | ||
|
31e2ed8b4c | ||
|
1a70eed58c | ||
|
566a24d6ee | ||
|
892e231aad | ||
|
a3b19fd50c | ||
06d578d07e | |||
|
e5e75bd8f8 | ||
|
6ae9302708 | ||
|
108ab3b910 | ||
|
c87f20ff37 | ||
|
8e1f21e29b | ||
|
e9a039b845 | ||
|
5087a6cdd7 | ||
|
e2efaaff87 | ||
|
e67ed0a808 | ||
|
6196fa01ab | ||
|
2ecb31ae3f | ||
|
6e1cae5256 | ||
|
38f0e422ac | ||
|
384503e7d3 | ||
|
4e66f5a04b | ||
|
0b1d3e43e5 | ||
|
c124792fd2 | ||
|
b9046c97fb | ||
|
2786d789a1 | ||
|
aac835171e | ||
|
6cb68b9144 | ||
|
59d6c5e157 | ||
|
0bd93f5c37 | ||
|
87bd412885 | ||
|
7963963d98 | ||
|
b3f6c0734b | ||
|
429521a7d1 | ||
|
bf98e25e43 | ||
|
e2f79f0eb5 | ||
|
17d1b522bc | ||
|
22f79df328 | ||
|
da5d3a7b3b | ||
|
451abbecb1 | ||
|
970fd6220a | ||
|
a773d45885 | ||
|
82d240e300 | ||
|
8f0e68285b | ||
|
a7d54cf946 | ||
|
6a9e77e079 | ||
|
1b53dbf9cc | ||
|
18e96ab49f | ||
|
9e9cfe6e59 | ||
|
65754b8d12 | ||
|
433a9f3c09 | ||
|
01e20c9140 | ||
|
d5c4ba8246 | ||
|
a6b1526c13 | ||
|
30c0d6da99 | ||
|
4a80cf8482 | ||
|
5b49e75453 | ||
|
d582aea639 | ||
|
8896bea306 | ||
|
a9dafdff48 | ||
|
b8196d36e7 | ||
|
7db6c7db38 | ||
|
e4ef359f47 | ||
|
df0c6eb2b9 | ||
|
f56a354d31 | ||
|
5dc1fcea04 | ||
|
c26a265f21 | ||
|
805ac40280 | ||
|
0b08f7370d | ||
|
bda9d4a236 | ||
|
61dcdbf0e0 | ||
|
6f526fd2e1 | ||
|
2885c66060 | ||
|
93c3e0d6ad | ||
|
9ecda0a97a | ||
|
85b52f6a64 | ||
|
145517fb8e | ||
|
0730b9afc1 | ||
|
3bba097bb3 | ||
|
ff7ff890f9 | ||
|
5e062d3f15 | ||
|
3cee0abdba | ||
|
ec90ce7e98 | ||
|
acf6e08f78 | ||
|
cbcfcb3bf4 | ||
|
214d25905a | ||
|
701e9d27fc | ||
|
d0ad7688f2 | ||
|
4b22e57b33 | ||
|
46724104fe | ||
|
828c242291 | ||
|
5992187a85 | ||
|
4b7f8f04a3 | ||
|
dedb15786c | ||
|
ea1ae563c7 | ||
|
2921e7482b | ||
|
a0f2366e40 | ||
|
98d18c5337 | ||
|
1a8afc5fb4 | ||
|
1d9c27e235 | ||
|
5acc147c1c | ||
|
e0646af976 | ||
|
ed54703db8 | ||
|
78ae599790 | ||
|
a5bcce4fc8 | ||
|
a85c832919 | ||
|
359c9aea3f | ||
|
fb1d768924 | ||
|
6f73382317 | ||
|
a1dbb10c26 | ||
|
ac7c79f039 | ||
|
9124331b0d |
11
.gitignore
vendored
Normal file
11
.gitignore
vendored
Normal file
@@ -0,0 +1,11 @@
|
||||
Makefile*
|
||||
bin/*
|
||||
!bin/data/chars.grf
|
||||
!bin/data/openttdd.grf
|
||||
!bin/data/openttdw.grf
|
||||
!bin/data/opntitle.grf
|
||||
!bin/scenario/README
|
||||
!bin/scripts*
|
||||
config.*
|
||||
objs/*
|
||||
src/rev.cpp
|
12
BUGS
12
BUGS
@@ -1,12 +0,0 @@
|
||||
/* $Id$ */
|
||||
|
||||
KNOWN BUGS / PROBLEMS:
|
||||
|
||||
bridges:
|
||||
- Clearing tiles which may not have a bridge above can cause random bridge pieces to appear, which leads to crash in the long run
|
||||
|
||||
electrified rails:
|
||||
Normal and elrail depots look the same. Use 'X' (transparent buildings)
|
||||
to distinguish between them
|
||||
Missing curors / icons for construction (currently using the conventional ones)
|
||||
|
@@ -22,7 +22,6 @@ INSTALL_DIR = !!INSTALL_DIR!!
|
||||
INSTALL_BINARY_DIR = "$(INSTALL_DIR)/"!!BINARY_DIR!!
|
||||
INSTALL_ICON_DIR = "$(INSTALL_DIR)/"!!ICON_DIR!!
|
||||
INSTALL_DATA_DIR = "$(INSTALL_DIR)/"!!DATA_DIR!!
|
||||
INSTALL_PERSONAL_DIR = !!PERSONAL_DIR!!
|
||||
TTD = !!TTD!!
|
||||
TTDS = $(SRC_DIRS:%=%/$(TTD))
|
||||
OS = !!OS!!
|
||||
@@ -79,7 +78,7 @@ ifeq ($(shell if test -f config.cache; then echo 1; fi), 1)
|
||||
@echo " Going to reconfigure with last known settings..."
|
||||
@echo "----------------"
|
||||
# Make sure we don't lock config.cache
|
||||
@$(shell cat config.cache) || exit 1
|
||||
@$(shell cat config.cache | sed 's/\\ /\\\\ /g') || exit 1
|
||||
@echo "----------------"
|
||||
@echo "Reconfig done. Now compiling..."
|
||||
@echo "----------------"
|
||||
@@ -271,10 +270,5 @@ install: bundle
|
||||
$(Q)install -m 644 "$(BUNDLE_DIR)/data/"* "$(INSTALL_DATA_DIR)/data"
|
||||
$(Q)install -m 644 "$(BUNDLE_DIR)/docs/"* "$(INSTALL_DATA_DIR)/docs"
|
||||
$(Q)install -m 644 "$(BUNDLE_DIR)/media/"* "$(INSTALL_ICON_DIR)"
|
||||
ifdef INSTALL_PERSONAL_DIR
|
||||
$(Q)mkdir -p ~/"$(INSTALL_PERSONAL_DIR)"
|
||||
$(Q)cp -R "$(BUNDLE_DIR)/scenario" ~/"$(INSTALL_PERSONAL_DIR)"
|
||||
else
|
||||
$(Q)cp -R "$(BUNDLE_DIR)/scenario" "$(INSTALL_DATA_DIR)"
|
||||
endif # INSTALL_PERSONAL_DIR
|
||||
endif # OSXAPP
|
||||
|
@@ -36,7 +36,7 @@ RES := $(shell mkdir -p $(BIN_DIR)/lang )
|
||||
|
||||
all: table/strings.h $(LANGS)
|
||||
|
||||
strgen.o: $(SRC_DIR)/strgen/strgen.cpp endian_host.h
|
||||
strgen.o: $(SRC_DIR)/strgen/strgen.cpp endian_host.h $(SRC_DIR)/table/control_codes.h
|
||||
$(E) '$(STAGE) Compiling $(<:$(SRC_DIR)/%.cpp=%.cpp)'
|
||||
$(Q)$(CXX_BUILD) $(CFLAGS_BUILD) -DSTRGEN -c -o $@ $<
|
||||
|
||||
@@ -44,13 +44,17 @@ string.o: $(SRC_DIR)/string.cpp endian_host.h
|
||||
$(E) '$(STAGE) Compiling $(<:$(SRC_DIR)/%.cpp=%.cpp)'
|
||||
$(Q)$(CXX_BUILD) $(CFLAGS_BUILD) -DSTRGEN -c -o $@ $<
|
||||
|
||||
alloc_func.o: $(SRC_DIR)/core/alloc_func.cpp endian_host.h
|
||||
$(E) '$(STAGE) Compiling $(<:$(SRC_DIR)/%.cpp=%.cpp)'
|
||||
$(Q)$(CXX_BUILD) $(CFLAGS_BUILD) -DSTRGEN -c -o $@ $<
|
||||
|
||||
lang/english.txt: $(LANG_DIR)/english.txt
|
||||
$(Q)mkdir -p lang
|
||||
$(Q)cp $(LANG_DIR)/english.txt lang/english.txt
|
||||
|
||||
$(STRGEN): string.o strgen.o
|
||||
$(STRGEN): alloc_func.o string.o strgen.o
|
||||
$(E) '$(STAGE) Compiling and Linking $@'
|
||||
$(Q)$(CXX_BUILD) string.o strgen.o -o $@
|
||||
$(Q)$(CXX_BUILD) $^ -o $@
|
||||
|
||||
table/strings.h: lang/english.txt $(STRGEN)
|
||||
$(E) '$(STAGE) Generating $@'
|
||||
|
Binary file not shown.
Binary file not shown.
Binary file not shown.
365
changelog.txt
365
changelog.txt
@@ -1,3 +1,368 @@
|
||||
0.6.2-RC2 (2008-07-25)
|
||||
------------------------------------------------------------------------
|
||||
- Fix: Building through the wrong side of a drive through station was allowed [FS#2166] (r13822)
|
||||
- Fix: Check for vehicle length changes outside a depot (callback 0x11) and give a warning about that [FS#2150] (r13816)
|
||||
- Fix: Several minor memory leaks. They only happened once per game (r13809, 13810)
|
||||
- Fix: Checking for train waiting at other side of two-way signal was broken [FS#2162] (r13806)
|
||||
- Fix: Some revision checking code was unintentionally disabled (r13776)
|
||||
- Fix: Enforce the validity of a NetworkAction (chat packet) issued by a client (r13775)
|
||||
- Fix: Selecting non-full length vehicles in the depot gui would place the "mouse pointer" out of the center of the vehicle making it hard to "aim" [FS#2147] (r13759)
|
||||
- Fix: NewGRF rail continuation would always mark a tunnel on the same axis as connected, even when the tunnel faces the wrong direction (r13734)
|
||||
- Fix: Assumption that non-north tiles of a house do not have the 1x1 building bit set was flawed with some NewGRFs. This caused the amount of houses to differ, which causes the town radii to differ, which causes desyncs when towns are expanded (r13729)
|
||||
- Fix: Possible desync on the autorenew settings 20+ game years (i.e. 4.5+ hours) after a company was started (r13718)
|
||||
- Fix: Any player could construct new companies [FS#2144] (r13716)
|
||||
- Fix: Remove the unique_id from the message that a client has joined as it is only exposes the unique_id more than needed (r13714)
|
||||
- Fix: Possible crash on creating a network packet (r13713)
|
||||
- Fix: Enforce the length restrictions of company and president name in the commands too (r13712)
|
||||
|
||||
|
||||
0.6.2-RC1 (2008-07-16)
|
||||
------------------------------------------------------------------------
|
||||
- Fix: Possible buffer overflow in string truncation code (r13700)
|
||||
- Fix: Handle SETX(Y) properly when truncating a string instead of ignoring it and returning a too long string (r13699)
|
||||
- Fix: In some cases the (sound) mixer could overflow causing artefacts in the sound [FS#2120] (r13695)
|
||||
- Fix: Do not rely on .tar files always ending with a block of zeros (r13693)
|
||||
- Fix: Make sure a command is ran in the context of autoreplace or not (r13691)
|
||||
- Fix: In the case that elrails and 'realistic' acceleration are disabled all electrified engines would have no power on load, until the vehicle got turned around, loaded or got into a depot [FS#2102]- Fix: Saving TTD imported games in recession failed due to wrong (and unneeded) type conversions in the saveload code [FS#2131] (r13679)
|
||||
- Fix: Inactive companies from old (TTD) saves could be marked active in some cases, which then loads garbage in their statistics and such [FS#2126] (r13676)
|
||||
- Fix: Memory leak when NewGRFs got forcefully disabled and they defined GOTO labels (r13675)
|
||||
- Fix: Crash when drawing a non-real sprite caused by NewGRF interference [FS#2127] (r13674)
|
||||
- Fix: Desync when building electrified trains on a dedicated server that was started with electrification disabled [FS#2122] (r13673)
|
||||
- Fix: Bus/truck forgetting go-to-depot order when entering a non-drivethrough road stop [FS#2117] (r13664)
|
||||
- Fix: Server crashing when banning the rconning client (r13661)
|
||||
- Fix: Signals were not updated correctly when a player removed a non-existing track piece (r13626)
|
||||
- Fix: Crash when one tries to raise the nothern corner of MP_VOID tiles (i.e. the southern corner of the tiles on the southern map edge) in the scenario editor [FS#2106] (r13624)
|
||||
- Fix: Only the front of a RV would be considered when determining to what cargos a vehicle can be refitted instead of all cargos [FS#2109] (r13622)
|
||||
- Fix: If the first bridge can not be build for a given length, then none of the other bridges can. Effectively meaning that if someone replaces the first bridge with a bridge that can be only 3 tiles longs then only other bridges that can be 3 tiles long will be buildable, but only if they are 3 tiles long [FS#2100] (r13611)
|
||||
- Fix: Signal states could be propagated through waypoints built in orthogonal axis (r13589)
|
||||
- Fix: [OSX] 10.5 failed to switch to fullscreen (r13584)
|
||||
- Fix: RVs continueing onto next DT station when they are build adjacent to them [FS#2040] (r13581)
|
||||
- Fix: Disable static NewGRFs when non-static NewGRFs query them in the context of network games. This makes it impossible for static NewGRFs to disable non-static NewGRFs and 'bad' things happening because the non-static NewGRF doesn't know about the static NewGRF (r13576)
|
||||
- Fix: Properly count number of non-north housetiles [FS#2083] (r13518)
|
||||
- Fix: Incorrect usage of strtoul (r13508)
|
||||
- Fix: Clear the memory for the new AI during the loading of a savegame so it does not try to execute commands generated in a different savegame, which could be resulting in the AI trying to give orders to stations that do not exist (r13505)
|
||||
- Fix: Drawing of zoomed out partial sprites could cause deadlocks or crashes (r13502)
|
||||
- Fix: First determine where to *exactly* build a house before asking a NewGRF whether the location is good instead of possibly moving the house a tile after the NewGRF said the location is good (r13489)
|
||||
- Fix: Track was not removed on company bankrupcy when there was a ship on lower halftile (r13488)
|
||||
- Fix: Let ships also navigate on half-tile sloped watery rail tiles (r13485)
|
||||
- Fix: Division by zero when one would press 'd' (skip order) when there's no order (r13409)
|
||||
- Fix: Do not crash when resolving vehicle sprite groups with zero sprites (r13397)
|
||||
- Fix: In the purchase list, CB36 for capacity was not called for the first part of rail and road vehicles (r13385)
|
||||
- Fix: Loading of very old OpenTTD savegames was broken (r13373)
|
||||
|
||||
|
||||
0.6.1 (2008-06-01)
|
||||
------------------------------------------------------------------------
|
||||
- Fix: Industry tiles would sometimes tell they need a 'level' slope when they do not want the slope (r13348)
|
||||
- Fix: Attempts to make the old AI perform better (r13217, r13221, r13222)
|
||||
|
||||
|
||||
0.6.1-RC2 (2008-05-21)
|
||||
------------------------------------------------------------------------
|
||||
- Fix: Do not send rcon commands of the server to the first client but do directly execute those on the server (r13137)
|
||||
- Fix: For multiheaded engines, halve power and running cost when used instead of when loading, to allow callback values to work properly (r13074)
|
||||
- Fix: Loading of TTDP savegames with rivers in them [FS#2005] (r13066)
|
||||
- Fix: Update build industry window when raw_industry_construction setting is modified (r13060)
|
||||
- Fix: Revert changes to multihead engine weight -- the original values were correct (r13023)
|
||||
- Fix: Debugging was not possible with MSVC 2008 (r12996)
|
||||
- Fix: List used for sorting GRFs was not freed (r12993)
|
||||
- Fix: Default difficulty settings were different to TTD's original settings [FS#1977] (r12951)
|
||||
- Fix: All vehicles would be available when an original scenario would be played [FS#1982] (r12948)
|
||||
- Fix: Keep only first 15 bits for non failed callback results (r12947)
|
||||
- Fix: Reading/modifying invalid data under some circumstances (r12943)
|
||||
- Fix: Minor errors related to industries accepted/produced cargo (r12933)
|
||||
- Fix: Town rating was affected even after the test run (r12920)
|
||||
- Fix: Flood road tiles even when there are road works in progress [FS#1965] (r12919)
|
||||
- Fix: Do not initialize Station struct with tile=0, buoys will never change that value [FS#1960] (r12915)
|
||||
- Fix: Game crash when a spectator/server tried to show an engine with no owner when a NewGRF requested a specific variable (r12914)
|
||||
- Fix: Report reverse sprite status (FD/FE) to NewGRF for manually toggled vehicles (r12910)
|
||||
- Fix: Vehicles going twice to a depot when the automatic service interfered with the current order [FS#1985] (r12629)
|
||||
|
||||
|
||||
0.6.1-RC1 (2008-04-26)
|
||||
------------------------------------------------------------------------
|
||||
- Fix: Vehicle groups, engine replacement rules and player/company names were not properly reset/freed after bankrupt (r12906)
|
||||
- Fix: Remove trams from savegames saved in OTTD without tram support, it is better than to simply crash [FS#1953] (r12904)
|
||||
- Fix: GCC on FreeBSD does not support -dumpmachine causing configure to fail. Use g++ instead [FS#1928] (r12876)
|
||||
- Fix: Make the town rating tests use less memory and much quicker (r12859)
|
||||
- Fix: Usage of AutoPtr made (trying to) build stuff very (time) expensive (r12857, r12855)
|
||||
- Fix: Ensure that prop 25 is set for all vehicles in the consist before other properties as it could cause desyncs (r12856)
|
||||
- Fix: Too much catenary was drawn about tunnel entrances, middle bridge pieces and non-rail station tiles (r12853, r12852)
|
||||
- Fix: Use YAPF for fairly old savegames from before YAPF was introduced (r12845)
|
||||
- Fix: The industry tick trigger should only be triggered once every 256 ticks, not every tick... Also bail out of the triggers a little earlier if you know they are not going to happen anyway (r12844)
|
||||
- Fix: Inconsistent use of 8/15-bitness of NewGRF callback results with respect to TTDP's implementation of the specification (r12819, r12818, r12759)
|
||||
- Fix: Possible out of bounds array access (r12809)
|
||||
- Fix: Enforce autorenew values range in command (r12808)
|
||||
- Fix: Vehicles could break down during loading and keep loading. The intention of the break down code is not to break down when having zero speed, therefor break downs now do not happen when loading [FS#1938] (r12795)
|
||||
- Fix: [OSX] In some rare cases when using an uncalibrated monitor the system colour space could not be retrieved. Show an error when this happens instead of just trying an assertion (r12776)
|
||||
- Fix: Slope checking for NewGRFs failed (r12759)
|
||||
- Fix: Check the TILE_NOT_SLOPED flag of the _north_ tile of multi-tile houses to decide if autoslope is allowed (r12717)
|
||||
- Fix: Do not move windows below the toolbar on resizes unless they would go behind the toolbar [FS#1904] (r12714)
|
||||
- Fix: Increase default sound buffer size only for Vista [FS#1914] (r12708)
|
||||
- Fix: Do not crash very hard on unrecognised savegames, just go back to the intro menu instead (r12707)
|
||||
- Fix: In some cases a news messages would not be shown [FS#1906] (r12683)
|
||||
- Fix: Removing road pieces from a town gave you twice the intended penalty [FS#1920] (r12682)
|
||||
- Fix: When a road vehicle has a tram only stop multiple times in a row in it's orders, only the first one would be skipped [FS#1918] (r12678)
|
||||
- Fix: Colour remaps on station sprites only worked for company colours [FS#1902] (r12674)
|
||||
- Fix: Remove buggy buoys at tile 0 from old TTDP savegames (r12642)
|
||||
- Fix: Possible NULL pointer dereference when reading some NewGRF data [FS#1913] (r12637)
|
||||
- Fix: Infinite loop in case your compiler decides that enums are unsigned by default (r12622)
|
||||
- Fix: The convert signal button disallowed signal dragging when the signal GUI was closed (r12577)
|
||||
- Fix: Binding to a specific IP could cause OpenTTD to not register properly with the masterserver if one has multiple external interfaces (r12574)
|
||||
- Fix: min() has 32bit arguments, clamping of 64bit values did not work (r12572)
|
||||
- Fix: Towns could not terraform when inflation rised terraform prices enough (r12564)
|
||||
- Fix: Do not affect town rating change by the order in which we examine stations (r12561)
|
||||
- Fix: Redraw the signal GUI when the signal drag density changes in the patch settings and vice versa (r12553)
|
||||
- Fix: Do not install scenarios into the current user's homedir when running 'make install', that is silly. Simply always install scenarios system wide instead (r12542)
|
||||
|
||||
|
||||
0.6.0 (2008-04-01)
|
||||
------------------------------------------------------------------------
|
||||
- Fix: Final formatting of some string codes from NewGRFs was not done correctly [FS#1889] (r12488)
|
||||
- Fix: Timetable times for aircraft were always doubled [FS#1883] (r12477)
|
||||
- Fix: Remove broken endian-dependent code and unnecessary rgb to bgr swapping [FS#1880] (r12453)
|
||||
- Fix: Do not 'disable' the drawing of autorail overlays when the tile is 'error'-marked (red pulsating selection) [FS#1871] (r12439)
|
||||
- Fix: Plural rule for Icelandic was wrong (r12417)
|
||||
|
||||
|
||||
0.6.0-RC1 (2008-03-26)
|
||||
------------------------------------------------------------------------
|
||||
- Feature: Show whether a town is a "city" in the town description title bar (r12391)
|
||||
- Feature: Increase house animation frame number from 32 to 128 (r12347)
|
||||
- Fix: Loading of TTD savegames (r12399, r12401)
|
||||
- Fix: Vehicle lists related to stations not closed when the station is deleted [FS#1872] (r12393)
|
||||
- Fix: Trams failing to turn on bridge heads/tunnel entrances [FS#1851] (r123890)
|
||||
- Fix: Train could break apart when reversed while partially in a depot [FS#1841] (r12386, r12384)
|
||||
- Fix: Non-breaking spaces should not be broken (r12385)
|
||||
- Fix: Check return of AfterLoadGame for success or failure when loading TTD games [FS#1860] (r12383)
|
||||
- Fix: Use 'items' unit for batteries, fizzy drinks, toys and bubbles in total cargo tab [FS#1864] (r12382)
|
||||
- Fix: The number of houses wasn't computed right [FS#1835, FS#1535] (r12381)
|
||||
- Fix: Update train acceleration and max speed after setting cached value to ensure the correct max speed is used with disabled real acceleration (r12380)
|
||||
- Fix: Refresh vehicle details window when cached values are updated (r12378)
|
||||
- Fix: Set cached value for vehicle property 25 before other cached values [FS#1854] (r12377)
|
||||
- Fix: Don't close a dropmenu when clicking on a dropdown widget (r12374)
|
||||
- Fix: win32 music driver fails if path is too long or if containing non-latin chars [FS#1849] (r12373, r12372)
|
||||
- Fix: Do not let window hide behind the main toolbar after resizing the screen [FS#1823] (r12371)
|
||||
- Fix: Close language drop down when parent window is clicked/closed [FS#1853] (r12370)
|
||||
- Fix: Reset train speed limits when _patches.realistic_acceleration changes (r12369)
|
||||
- Fix: Commands were sent to clients waiting for map download causing 'executing command from the past' error [FS#1650] (r12367)
|
||||
- Fix: Do not allow building 'zero' road bits (r12363)
|
||||
- Fix: Randomize variable 8F only once per callback 28 (r12362)
|
||||
- Fix: openttdd.grf was using the wrong colours for glyphs due to a grfcodec bug (fixed in grfcodec 0.9.10 r1837) (r12360)
|
||||
- Fix: Some callback-results were treated as 8 bit, when they were 15 bit, and vice versa (r12352, r12358)
|
||||
- Fix: Do not try to flood water tile [FS#1836] (r12350)
|
||||
- Fix: NTP skipped junction just after bridge end (r12348)
|
||||
- Fix: Remove duplicated and inconsistent code wrt. autoreplace with rules in both vehicles' group and ALL_GROUP [FS#1748, FS#1825] (r12346)
|
||||
- Fix: Don't try to restore backupped timetable when timetabling is disabled [FS#1828] (r12345)
|
||||
- Fix: Slow helicopters never got the 'chance' to finish the landing routine (r12343)
|
||||
- Fix: GRM buffer for cargos was incorrect size [FS#1827] (r12341)
|
||||
- Fix: Recalculate cached train data after clearing reversing flag when entering depot (r12339)
|
||||
|
||||
|
||||
0.6.0-beta5 (2008-03-04)
|
||||
------------------------------------------------------------------------
|
||||
- Feature: Vehicle variable FE bit 5, 6 and 8 [FS#1812] (r12331, r12330)
|
||||
- Feature: Support loading full range of 0xD0xx NewGRF strings which includes 0xD000 to 0xD3FF (r12316)
|
||||
- Feature: Ability to change aircraft speed factor, from so called 'realistic' (matching other vehicles) (1/1) to original TTD speed (1/4) (r12293, r12294)
|
||||
- Change: Update readme about where openttd looks for files (r12321)
|
||||
- Fix: Don't pause/unpause the game when showing load/save windows when the game is paused due to missing GRFs [FS#1733] (r12336)
|
||||
- Fix: Disallow building level crossings over one-way roads as this allowed competitors to remove the one-way state [FS#1819] (r12329)
|
||||
- Fix: Wrong Y pillar specified for girder with arch bridge (r12328)
|
||||
- Fix: Vehicles could be sorted in a wrong order when a vehicle name changed - cached name was not invalidated (r12324)
|
||||
- Fix: Vehicle sorting by name was broken, it was comparing the same string (when caching was not used) [FS#1821] (r12323)
|
||||
- Fix: Endian issue when saving/loading group owner (r12322)
|
||||
- Fix: Wrong transparency options could be saved after toggling all [FS#1817] (r12320)
|
||||
- Fix: Map string IDs that are embedded from other strings [FS#1815] (r12317)
|
||||
- Fix: Include prop 25 data for all train parts, not just those that carry cargo (r12314)
|
||||
- Fix: YAPF and NTP did not apply penalty for uphill tracks on steep slopes (r12313)
|
||||
- Fix: Restore timetable from backupped orders and add group ID to the backup [FS#1549] (r12296)
|
||||
- Fix: Do not draw trees nor lamps between tram tracks (r12290) [FS#1807]
|
||||
- Fix: [Win32] Do not create save dir on install (r12269)
|
||||
- Fix: Autoreplace did not update vehicle index for timetable window [FS#1805] (r12261)
|
||||
- Fix: GetProductionAroundTiles() may fail if only the second production slot exists (r12258)
|
||||
- Fix: Town variables 0x9E to 0xAD (company ratings) returned wrong values (r12247)
|
||||
- Fix: Typo resulting in no players are given the engine preview offer (r12244)
|
||||
- Fix: Mac OSX bundle display name should be 'OpenTTD' [FS#1798] (r12234)
|
||||
- Fix: [NewGRF] Support using any base price for rail and road vehicles' running cost, show running cost of wagons if available (r12209)
|
||||
- Fix: When loading a savegame fails, do not start creating a new game, just go straight back to the intro screen (r12202)
|
||||
- Fix: Force AI to build rail or road instead of bridges if possible, so it doesn't build bridges everywhere (r12200)
|
||||
- Fix: "Transparent buildings" now only toggles buildings, so show tick when buildings are transparent [FS#1789] (r12198)
|
||||
- Fix: Show correct last year profit when the train had negative income [FS#1788] (r12197)
|
||||
- Fix: There can be oil rigs at map borders, do not set water class for them [FS#1787] (r12195)
|
||||
- Fix: Do not start overtaking if the RV reaches wrong-way one-way-road in the next tiles (r12191)
|
||||
- Fix: Assert when trying to play tile sound at NW border of map (placing buyos, leveling land) [FS#1784] (r12186)
|
||||
- Fix: Take into account possible loan when AI is deciding which bridge to build, so it won't build wooden bridges everytime (r12184)
|
||||
|
||||
|
||||
0.6.0-beta4 (2008-02-18)
|
||||
------------------------------------------------------------------------
|
||||
- Feature: Allow buttons to resize in NewGRF settings window (r12172)
|
||||
- Feature: Change colour of autorail and autoroad selection when Ctrl is pressed (r12167)
|
||||
- Feature: Separate catenary transparency settings from building transparency settings (r12103)
|
||||
- Feature: Allow locking individual transparency settings so they will not be changed by pressing 'x' (r12102)
|
||||
- Feature: Add some missing VarAction2 variables (r12124)
|
||||
- Feature: Make snow appear on rail tiles dependant on track height, not on height of the lowest part of the tile (r12098)
|
||||
- Feature: [NewGRF] Specify the purchase, rail and road description of a bridge (r12069)
|
||||
- Feature: [NewGRF] Add support for var 12, Variational Action 2 (r12045)
|
||||
- Feature: Allow trees on shore (r12029)
|
||||
- Feature: Invisible trees are now separate from the building concept (r12022)
|
||||
- Feature: Add support for passenger engine designation for AI-use, NewGRF property 0x08 for trains (r12019)
|
||||
- Feature: Show all cargo sources (en-route from) in the station view cargo waiting list instead of just one (r11990)
|
||||
- Feature: [NewGRF] Resizable industry view window on callback 3A (r11987)
|
||||
- Feature: [NewGRF] Implement var 8F (random bits) during callback 28 [FS#1697] (r11985)
|
||||
- Feature: [NewGRF] Add support for Action 0D, var 13: informations about current map size (r11961)
|
||||
- Feature: Support Action5 type 0D (newwater) (r11947)
|
||||
- Feature: Allow building bridge heads on more slopes (r11937)
|
||||
- Feature: [NewGRF] Add support for Rivers. Rivers can currently only be placed with-in the scenario editor (r11926,r11938,r11949,r12071)
|
||||
- Feature: Generate.vbs script to allow project files generation for users unable to run generate bash script (r12123)
|
||||
- Feature: Sort the strings in languages dropdown (r11886)
|
||||
- Codechange: Drop MSVC 2003 support (r11979)
|
||||
- Fix: Test purchase list loading/loaded sprites instead of unconditionally returning a possibly non-existant sprite (r12180)
|
||||
- Fix: Return correct bridge price for AI when DC_QUERY_COST is set [FS#609] (r12171)
|
||||
- Fix: When drag&drop mode was cancelled by keyboard input, depot/group window wasn't updated [FS#337] (r12166)
|
||||
- Fix: Buffer overflow when drawing scrolling news [FS#1652, FS#1773] (r12165)
|
||||
- Fix: If a train is 'stopping' when entering a depot, do not let it leave again [FS#1705] (r12163)
|
||||
- Fix: Towns shouldn't build over houses owned by another town [FS#1757] (r12162)
|
||||
- Fix: Towns will no longer build houses > 1x1 there where should be road (with 2x2, 3x3 grid town layouts) (r12161)
|
||||
- Fix: Remove the arbitrary limit of 64 waypoints per town [FS#1744] (r12160)
|
||||
- Fix: Chance16I was now biased towards zero - round to nearest now (r12156)
|
||||
- Fix: Adjust aircraft slowing algorithm (r12144)
|
||||
- Fix: Callback 0x3D always gets a cargobit in var 0x18, independent of grf version [FS#1766] (r12142)
|
||||
- Fix: Do not allow adding tram to rail-road crossing when there is a vehicle on it (r12138)
|
||||
- Fix: Show cargo capacity for articulated vehicles correctly in the purchase list. Multiple cargo types can also now been shown [FS#1769] (r12137)
|
||||
- Fix: With mammoth trains disabled, maximum train length was limited to 9 (r12131)
|
||||
- Fix: Use tile index 0 for planes in the air, so it cannot have an invalid tile index [FS#1745] (r12109)
|
||||
- Fix: X/Y axis swap for station tiles in GetNearbyTile() was wrong way around [FS#1753]( r12108)
|
||||
- Fix: Loading older savegames fixes (r12096,r12097)
|
||||
- Fix: When a company bankrupts, remove drive-through road stops, ship depots and buoys too. Update owners of water and road [FS#1703] (r12095)
|
||||
- Fix: Do not set station owner for buoys when merging company (r12093)
|
||||
- Fix: Keep production level within delimited boundaries, while using var result 0D/0E and than multiplying/dividing it [FS#1755] (r12092)
|
||||
- Fix: Assert when loading savegame with wrong tiletype at south map borders (r12088)
|
||||
- Fix: Check overrides only for industries when mapping newgrf entities to 'real' entities [FS#1747] (r12086)
|
||||
- Fix: Update waypoint signs when changing language (r12080)
|
||||
- Fix: Use search paths when opening console scripts (r12079)
|
||||
- Fix: When reusing a renamed deleted waypoint, keep the new name (r12076)
|
||||
- Fix: Make docks at sea flood neighboured tiles (r12072)
|
||||
- Fix: Possible deadlock when there are no houses available to build at given tile (r12062)
|
||||
- Fix: Houses with zero probability could be built (r12062)
|
||||
- Fix: Do not clear tiles when the town won't be able to build any buildings anyway (r12060)
|
||||
- Fix: Allow building 2x2 building on slopes if not explicitly forbidden (r12060)
|
||||
- Fix: It was possible to build 2x1 and 1x2 buildings on slopes even if it was not allowed (r12060)
|
||||
- Fix: Teach NPF where road vehicles and trams can reverse (r12058)
|
||||
- Fix: Ships can drive through opponents' ship depots (r12058)
|
||||
- Fix: Slowdown train when approaching 90deg turn when 90deg turns are forbidden (r12057)
|
||||
- Fix: Enable YAPF to start searching inside a wormhole [FS#1704] (r12056)
|
||||
- Fix: Another way to fix AI trying to build road through depots (r12055)
|
||||
- Fix: The cargo translation table was loaded at the right time, but all the other global variables were now loaded too early [FS#1737] (r12052)
|
||||
- Fix: Random_func broke for desync debug (r12050)
|
||||
- Fix: Memset on multibyte array with wrong byte count (r12049)
|
||||
- Fix: Crash when centering on a vehicle (aircraft) that is outside of the map [FS#1741] (r12044)
|
||||
- Fix: Allow building transmitters and lighthouses on tree tiles [FS#1736] (r12043)
|
||||
- Fix: Reimplement how rivers and canals are stored in the map, allowing the sea/river/canal status to also be stored for buoys, docks, locks and depots. All these are now allowed on rivers and removal of them will revert to the original water type [FS#1676] (r12042)
|
||||
- Fix: Change ownership of or remove statues when merging/bankrupting companies (r12038)
|
||||
- Fix: For station tiles, only get road types for road stops (r12036)
|
||||
- Fix: Teach YAPF where trams can reverse, and where not [FS#1702] (r12035)
|
||||
- Fix: Do not show train speed as zero after loading paused game (r12033)
|
||||
- Fix: When removing a statue, remove town statue flag for the statue owner, not current player (r12032)
|
||||
- Fix: Prevent towns from removing or claiming ownership of player owned tiles when growing [FS#1689,FS#1719] (r12031)
|
||||
- Fix: In one case trees could spread under bridges (r12024)
|
||||
- Fix: Put a better suited text in the quit-dialog [FS#1690] (r12023)
|
||||
- Fix: Restore initial intent on the invisible tree while transparent building patch setting [FS#1721] (r12018)
|
||||
- Fix: When you have more than 9 network interfaces you'll enter the wonderfull world of overflows (r12017)
|
||||
- Fix: Better work on strings in regard to gender [FS#1716] (r12015)
|
||||
- Fix: Lighthouses and transmitters were never supposed to be build on a slope (r12014)
|
||||
- Fix: When modifying watered tiles, mark neighboured canals and rivers dirty in more cases (r12013)
|
||||
- Fix: Enable TownRatingTestMode during cost estimation with 'shift'-key (r12012)
|
||||
- Fix: Do not consider one-corner-raised-shores to be watered tiles from all sides [FS#1701] (r12011)
|
||||
- Fix: Avoid loading sample.cat if it 'looks' incorrect, and avoid later null pointer dereferences by moving volume lookup deeper [FS#1707] (r12009)
|
||||
- Fix: Possible reading from an invalid pointer [FS#1717] (r12005)
|
||||
- Fix: When skipping Action 11 or 12, also skip belonging sprites (r12001)
|
||||
- Fix: Do entrance-slope-check for every tile of railstations (r11999)
|
||||
- Fix: Possible remote assert by setting bit 6 of p1 for CMD_REMOVE_ROAD [FS#1692] (r11998)
|
||||
- Fix: Update train statusbar when stopping from zero speed [FS#1706] (r11996)
|
||||
- Fix: Resize station/roadstop/dock/airport construction windows if cargo acceptance list is too long (r11993)
|
||||
- Fix: When building two rail stations close to each other (with control) so they looked like one long track trains would see them as one (r11992)
|
||||
- Fix: Resize autoreplace window to fit purchase information text if it is too large (r11989)
|
||||
- Fix: Build system ignored changes to table/control_codes.h which require strgen to be rebuilt (r11986)
|
||||
- Fix: Also draw corner shores under rail tracks (r11984)
|
||||
- Fix: Use unicode glyph mapping to fix up missing/shuffled sprites in original data files instead of shuffling or skipping sprites directly [FS#1698] (r11981)
|
||||
- Fix: Industries using results 0D/0E on callback cb29/35 were a bit too eager to close down (r11976)
|
||||
- Fix: Shore and sea tiles under bridges were converted to canals in old savegames [FS#1684] (r11974)
|
||||
- Fix: Use grass tiles for corner shores, if shores got replaced by ActionA [FS#1683] (r11973)
|
||||
- Fix: Old AI shouldn't build fast planes with a small airport in orders(r11972)
|
||||
- Fix: MP_ROAD can have railbits too - OPF searching over rail of diffen t owner behind crossing (r11967)
|
||||
- Fix: OPF was searching through depots and normal road stops [FS#1403, FS#1506] (r11966)
|
||||
- Fix: Tropic zone data was returned incorrectly [FS#1685] (r11964)
|
||||
- Fix: NewAI couldn't build any road vehicles when there were any tram grfs loaded (r11958)
|
||||
- Fix: Disallow building locks and docks on rapids [FS#1675] (r11956)
|
||||
- Fix: Do not allow modifying roadbits when other roadtypes would need different foundation (r11953)
|
||||
- Fix: Loading of very old savegames was broken (r11951)
|
||||
- Fix: Slope detection of bridge ramps. Helps YAPF and Trolly (r11946)
|
||||
- Fix: FileExists() failed for non latin paths (win32) (r11945)
|
||||
- Fix: Allow building drive-through road/tram stops at road/tram track that has no owner (r11944)
|
||||
- Fix: 'BRIDGE_TOO_LOW_FOR_TERRAIN'-check was wrong for steep slopes (r11936)
|
||||
- Fix: [Autoreplace] Single to dualhead locomotive replacefailed when player had enough money to replace and refit one but not enough to refit the last one as well [FS#1624] (r11929)
|
||||
- Fix: [Autoreplace] Autoreplace could refit train engines to the wrong cargo type if the old engine had no cargo capacity and the new one had (r11928)
|
||||
- Fix: Loading old, pre savegame version 2, savegames (r11925)
|
||||
- Fix: AI was reading wrong tile slope while building road bridge (r11917)
|
||||
- Fix: set correctly crossing state after train reversal, train leaving crossing, train crash (r11900)
|
||||
- Fix: Segmentation faults/wrong frees due uninitialized memory in the AI [FS#1658] (r11887)
|
||||
- Fix: Assert when trying to remove rail from a house or industry tile [FS#1663,FS#1665-6-7-8,FS#1680,FS#1686-7-8 FS#1715 FS#1742 FS#1771 FS#1776](r11883)
|
||||
- Fix: Crash in MP in vehicle group window if the currently selected group is deleted by another player (r11878)
|
||||
- Fix: Another way to crash competitors' train in a station (r11877)
|
||||
- Fix: Automatically sending aircraft to depot for autoreplace/renew is now triggered by the correct conditions (r11875)
|
||||
- Fix: EngineHasReplacementForPlayer() didn't look in ALL_GROUP (r11872)
|
||||
- Fix: Do not update signals after each tile when building/removing a large block of track/signals/station [FS#1074] (r11871)
|
||||
- Fix: Slow down train when approaching tile we can't enter in more cases (r11870)
|
||||
- Fix: Do not make crossing red when we can't enter it in any case (r11870)
|
||||
|
||||
|
||||
0.6.0-beta3 (2008-01-16)
|
||||
------------------------------------------------------------------------
|
||||
- Feature: Replaced fixed size custom name array. Names are now attached to their object directly and there is no limit to the amount of names (r11822)
|
||||
- Feature: Add drag-n-drop support to the raise/lower land tools. Land is raised/lowered at the start and the rest of the area levelled to match (r11759)
|
||||
- Feature: Add support for NewGRF's train 'tilt' flag. Trains with tilt capability (specific details are per NewGRF set) will be given a 20% speed limit bonus on curves (r11741)
|
||||
- Feature: Added sorting for cost, running costs and speed to road vehicles and ships build windows (r11710)
|
||||
- Feature: List neutral stations where the player has service in the station list too (r11670)
|
||||
- Feature: Check whether (some) characters are missing in the current 'font' for the 'currently' chosen language and give a warning when that does happen (r11646)
|
||||
- Feature: Support shore replacement via Action 5 (r11726)
|
||||
- Fix: When two NewGRFs 'fight' to define the same cargo it could happen that the strings are defined by one cargo and the 'action2' by another and when one assumes that both come from the same NewGRF [FS#1559] (r11862)
|
||||
- Fix: Recompute town population when removing a 'newhouses' grf, or when loading a game with missing 'newhouses' grfs [FS#1335] (r11855)
|
||||
- Fix: Road vehicle count was incorrect in network lobby window (r11844)
|
||||
- Fix: Mark dirty canal tile even in diagonal direction from flooded tile, draw correctly canal next to half flooded rail tile (r11843, r11838)
|
||||
- Fix: At least one instance of dmusic driver is needed for it to be registered and usable (r11826)
|
||||
- Fix: An articulated road vehicle could split up when it turned around at a corner and then would enter a drive through station at the next tile [FS#1627] (r11825)
|
||||
- Fix: Switch _screen to the output buffer and disable usage of 32bpp-anim animation buffer during giant screenshots [FS#1602] (r11813)
|
||||
- Fix: Do not crash trains when leaving depot to a very long track [FS#716] (r11802)
|
||||
- Fix: Take town rating into account when testing if a command can be executed [FS#1616] (r11795)
|
||||
- Fix: Reversing a train when loading at a station with an adjacent station in the same axis crashed [FS#1632] (r11794)
|
||||
- Fix: Group names got not deallocated in the command test run [FS#1614] (r11743)
|
||||
- Fix: Run window tick events when paused, so that news pop-ups and the about window still progress. For other windows the events are ignored when paused [FS#1319] (r11742)
|
||||
- Fix: Modify and possibly discard key events for code points in the unicode private use area [FS#1610] (r11740)
|
||||
- Fix: Set the new scroll position after zooming in instead of before, as the zoom will cancel it out [FS#1609] (r11739)
|
||||
- Fix: Do not reset loading indicator IDs when only reloading NewGRFs [FS#1574] (r11735)
|
||||
- Fix: Elrail merge gave elrail, monorail & maglev unintended speed bonuses for curves, as the bonus was based on the railtype index. The bonus is now specified by a property of the railtype (r11732)
|
||||
- Fix: Clear sprite override data before performing NewGRF wagon attach callback. This stopped the callback working for autoreplace and when moving wagons from train to train in a depot [FS#1582] ( r11731)
|
||||
- Fix: If there are no houses that can be build in a specific year yet, force the houses with the earliest introduction year to be available [FS#1577] (r11727)
|
||||
- Fix: Make it impossible (for users) to circumvent the length checking of the NewGRF 'allow wagon attach' callback by moving several wagons at a time (r11724)
|
||||
- Fix: Do not put more than one Random() in function calls because parameter evaluation order is not guaranteed in the C++ standard [FS#1561] (r11716)
|
||||
- Fix: Do not allow player inauguration date on scenarios to be bigger than current year [FS#1569] (r11714)
|
||||
- Fix: Add more house string id ranges to MapGRFStringID so NewGRFs use the proper string ids (r11712)
|
||||
- Fix: Do not allow refitting flooded (destroyed) vehicles (r11707)
|
||||
- Fix: Trains could have sprites with wrong direction when reversing, also was inconsistent with save/load process [FS#1557] (r11705)
|
||||
- Fix: When removing buoys, return to water or canal depending on their owner (r11666)
|
||||
- Fix: Animation informations should not be copied from original industry tile spec, while doing an action 00, industry tile, prop 08 (r11665)
|
||||
- Fix: Do not allow modifying non-uniform stations when non-uniform stations are disabled [FS#1563] (r11659)
|
||||
- Fix: 'Initialised' NewGRFs could still be deactivated in the later 'activation' pass (r11650)
|
||||
- Fix: Vehicles were still followed when sold [FS#1541] (r11632)
|
||||
- Fix: Many viewports could crash the scenario editor [FS#1527] (r11629)
|
||||
- Fix: Popping from text reference stack must be done in a precise order. But some compiler (MSVC) over optimised it and inverted this order [FS#1532] (r11627)
|
||||
- Fix: There were still some cases where one could not build a tram track, but the tram could become blocked [FS#1525] (r11621)
|
||||
- Fix: Do not make crossing red behind depot the train is entering [FS#1531] (r11619)
|
||||
- Fix: Buoys are just waypoints, so don't allow load/unload/transfert for them (r11618)
|
||||
- Fix: Sometimes large values could go off the chart [FS#1526] (r11616)
|
||||
- Fix: Temperate banks can only be built in towns (over a house) (r11615)
|
||||
|
||||
|
||||
0.6.0-beta2 (2007-12-09)
|
||||
------------------------------------------------------------------------
|
||||
|
289
config.lib
289
config.lib
@@ -5,7 +5,7 @@ log() {
|
||||
}
|
||||
|
||||
set_default() {
|
||||
released_version="0.6.0-beta2"
|
||||
released_version="0.6.2-RC2"
|
||||
|
||||
ignore_extra_parameters="0"
|
||||
# We set all kinds of defaults for params. Later on the user can override
|
||||
@@ -30,20 +30,22 @@ set_default() {
|
||||
data_dir="share/games/openttd"
|
||||
icon_dir="share/pixmaps"
|
||||
personal_dir="1"
|
||||
shared_dir="1"
|
||||
install_dir="/"
|
||||
enable_debug="0"
|
||||
enable_desync_debug="0"
|
||||
enable_profiling="0"
|
||||
enable_dedicated="0"
|
||||
enable_network="1"
|
||||
enable_static="1"
|
||||
enable_translator="0"
|
||||
enable_unicode="1"
|
||||
enable_assert="1"
|
||||
enable_strip="1"
|
||||
enable_strip="0"
|
||||
enable_universal="1"
|
||||
enable_osx_g5="0"
|
||||
enable_unicode="1"
|
||||
with_distcc="1"
|
||||
with_ccache="1"
|
||||
enable_cocoa_quartz="1"
|
||||
enable_cocoa_quickdraw="1"
|
||||
with_osx_sysroot="1"
|
||||
with_application_bundle="1"
|
||||
with_sdl="1"
|
||||
@@ -61,8 +63,66 @@ set_default() {
|
||||
with_fontconfig="1"
|
||||
with_psp_config="1"
|
||||
with_threads="1"
|
||||
with_distcc="1"
|
||||
with_ccache="1"
|
||||
|
||||
save_params_array="build host cc_build cc_host cxx_build cxx_host windres strip awk lipo os cpu_type revision endian config_log prefix_dir binary_dir data_dir icon_dir personal_dir install_dir enable_debug enable_profiling enable_dedicated enable_network enable_static enable_translator enable_assert enable_strip with_distcc with_osx_sysroot enable_universal enable_osx_g5 enable_unicode with_application_bundle with_sdl with_cocoa with_zlib with_png with_makedepend with_direct_music with_sort with_iconv with_midi with_midi_arg with_libtimidity with_freetype with_fontconfig with_psp_config with_threads CC CXX CFLAGS LDFLAGS"
|
||||
save_params_array="
|
||||
build
|
||||
host
|
||||
cc_build
|
||||
cc_host
|
||||
cxx_build
|
||||
cxx_host
|
||||
windres
|
||||
strip
|
||||
lipo
|
||||
awk
|
||||
os
|
||||
endian
|
||||
cpu_type
|
||||
revision
|
||||
config_log
|
||||
prefix_dir
|
||||
binary_dir
|
||||
data_dir
|
||||
icon_dir
|
||||
personal_dir
|
||||
shared_dir
|
||||
install_dir
|
||||
enable_debug
|
||||
enable_desync_debug
|
||||
enable_profiling
|
||||
enable_dedicated
|
||||
enable_network
|
||||
enable_static
|
||||
enable_translator
|
||||
enable_unicode
|
||||
enable_assert
|
||||
enable_strip
|
||||
enable_universal
|
||||
enable_osx_g5
|
||||
enable_cocoa_quartz
|
||||
enable_cocoa_quickdraw
|
||||
with_osx_sysroot
|
||||
with_application_bundle
|
||||
with_sdl
|
||||
with_cocoa
|
||||
with_zlib
|
||||
with_png
|
||||
with_makedepend
|
||||
with_direct_music
|
||||
with_sort
|
||||
with_iconv
|
||||
with_midi
|
||||
with_midi_arg
|
||||
with_libtimidity
|
||||
with_freetype
|
||||
with_fontconfig
|
||||
with_psp_config
|
||||
with_threads
|
||||
with_distcc
|
||||
with_ccache
|
||||
CC CXX CFLAGS LDFLAGS"
|
||||
}
|
||||
|
||||
detect_params() {
|
||||
@@ -135,6 +195,10 @@ detect_params() {
|
||||
--personal-dir=*) personal_dir="$optarg";;
|
||||
--without-personal-dir) personal_dir="";;
|
||||
|
||||
--shared-dir) prevp_p="shared-dir";;
|
||||
--shared-dir=*) shared_dir="$optarg";;
|
||||
--without-shared-dir) shared_dir="";;
|
||||
|
||||
--install-dir) prevp_p="install-dir";;
|
||||
--install-dir=*) install_dir="$optarg";;
|
||||
|
||||
@@ -142,6 +206,8 @@ detect_params() {
|
||||
|
||||
--enable-debug) enable_debug="1";;
|
||||
--enable-debug=*) enable_debug="$optarg";;
|
||||
--enable-desync-debug) enable_desync_debug="1";;
|
||||
--enable-desync-debug=*) enable_desync_debug="$optarg";;
|
||||
--enable-profiling) enable_profiling="1";;
|
||||
--enable-profiling=*) enable_profiling="$optarg";;
|
||||
--enable-dedicated) enable_dedicated="1";;
|
||||
@@ -170,6 +236,13 @@ detect_params() {
|
||||
--enable-unicode) enable_unicode="2";;
|
||||
--enable-unicode=*) enable_unicode="$optarg";;
|
||||
|
||||
--disable-cocoa-quartz) enable_cocoa_quartz="0";;
|
||||
--enable-cocoa-quartz) enable_cocoa_quartz="2";;
|
||||
--enable-cocoa-quartz=*) enable_cocoa_quartz="$optarg";;
|
||||
--disable-cocoa-quickdraw) enable_cocoa_quickdraw="0";;
|
||||
--enable-cocoa-quickdraw) enable_cocoa_quickdraw="2";;
|
||||
--enable-cocoa-quickdraw=*) enable_cocoa_quickdraw="$optarg";;
|
||||
|
||||
--with-sdl) with_sdl="2";;
|
||||
--without-sdl) with_sdl="0";;
|
||||
--with-sdl=*) with_sdl="$optarg";;
|
||||
@@ -337,13 +410,20 @@ check_params() {
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# enable_desync_debug should be between 0 and 3
|
||||
if [ -z "`echo $enable_desync_debug | egrep '^[012]$'`" ]; then
|
||||
echo "configure: error: invalid option --enable-desync-debug=$enable_desync_debug"
|
||||
echo " Available options are: --enable-desync-debug[=012]"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
detect_awk
|
||||
|
||||
detect_os
|
||||
|
||||
check_build
|
||||
check_host
|
||||
|
||||
detect_os
|
||||
|
||||
# We might enable universal builds always on OSX targets.. but currently we don't
|
||||
# if [ "$enable_universal" = "1" ] && [ "$os" != "OSX" ]; then
|
||||
if [ "$enable_universal" = "1" ]; then
|
||||
@@ -376,7 +456,7 @@ check_params() {
|
||||
detect_cputype
|
||||
|
||||
if [ "$enable_static" = "1" ]; then
|
||||
if [ "$os" = "MINGW" ] || [ "$os" = "CYGWIN" ] || [ "$os" = "MORPHOS" ] || [ "$os" = "OSX" ]; then
|
||||
if [ "$os" = "MINGW" ] || [ "$os" = "CYGWIN" ] || [ "$os" = "MORPHOS" ]; then
|
||||
enable_static="2"
|
||||
else
|
||||
enable_static="0"
|
||||
@@ -419,6 +499,17 @@ check_params() {
|
||||
log 1 "using debug level... level $enable_debug"
|
||||
fi
|
||||
|
||||
if [ "$enable_desync_debug" = "0" ]; then
|
||||
log 1 "using desync debug level... no"
|
||||
else
|
||||
log 1 "using desync debug level... level $enable_desync_debug"
|
||||
log 1 "WARNING: desync debug functions slow down the game considerably."
|
||||
log 1 "WARNING: use only when you are instructed to do so"
|
||||
log 1 " or when you know what you are doing."
|
||||
|
||||
sleep 5
|
||||
fi
|
||||
|
||||
detect_sdl
|
||||
detect_cocoa
|
||||
|
||||
@@ -544,7 +635,7 @@ check_params() {
|
||||
distcc="$with_distcc"
|
||||
fi
|
||||
if [ "$with_distcc" != "0" ]; then
|
||||
res="`$distcc --version 2>/dev/null | head -n 1 | cut -b 0-6`"
|
||||
res="`$distcc --version 2>/dev/null | head -n 1 | cut -b 1-6`"
|
||||
if [ "$res" != "distcc" ]; then
|
||||
distcc=""
|
||||
log 1 "checking distcc... no"
|
||||
@@ -573,7 +664,7 @@ check_params() {
|
||||
ccache="$with_ccache"
|
||||
fi
|
||||
if [ "$with_ccache" != "0" ]; then
|
||||
res="`$ccache --version 2>/dev/null | head -n 1 | cut -b 0-6`"
|
||||
res="`$ccache --version 2>/dev/null | head -n 1 | cut -b 1-6`"
|
||||
if [ "$res" != "ccache" ]; then
|
||||
ccache=""
|
||||
log 1 "checking ccache... no"
|
||||
@@ -729,6 +820,15 @@ check_params() {
|
||||
fi
|
||||
fi
|
||||
|
||||
if [ "$shared_dir" = "1" ]; then
|
||||
# we are using default values
|
||||
if [ "$os" = "OSX" ]; then
|
||||
shared_dir="/Library/Application\\\\ Support/OpenTTD"
|
||||
else
|
||||
shared_dir=""
|
||||
fi
|
||||
fi
|
||||
|
||||
if [ -n "$personal_dir" ]
|
||||
then
|
||||
log 1 "personal home directory... $personal_dir"
|
||||
@@ -736,6 +836,13 @@ check_params() {
|
||||
log 1 "personal home directory... none"
|
||||
fi
|
||||
|
||||
if [ -n "$shared_dir" ]
|
||||
then
|
||||
log 1 "shared data directory... $shared_dir"
|
||||
else
|
||||
log 1 "shared data directory... none"
|
||||
fi
|
||||
|
||||
if [ -n "$install_dir" ]
|
||||
then
|
||||
log 1 "installation directory... $install_dir"
|
||||
@@ -799,60 +906,70 @@ make_cflags_and_ldflags() {
|
||||
CFLAGS="$CFLAGS -DNO_THREADS"
|
||||
fi
|
||||
|
||||
# Enable some things only for certain GCC versions
|
||||
cc_version=`$cc_host -dumpversion | cut -c 1,3`
|
||||
if [ `echo $cc_host | cut -c 1-3` = "icc" ]; then
|
||||
# Enable some things only for certain ICC versions
|
||||
cc_version=`$cc_host -dumpversion | cut -c 1-4`
|
||||
|
||||
if [ $cc_version -ge 29 ]; then
|
||||
CFLAGS="$CFLAGS -Wall -Wno-multichar -Wsign-compare -Wundef"
|
||||
CFLAGS="$CFLAGS -Wwrite-strings -Wpointer-arith"
|
||||
CFLAGS="$CFLAGS -Wno-uninitialized"
|
||||
|
||||
CC_CFLAGS="$CC_CFLAGS -Wstrict-prototypes"
|
||||
fi
|
||||
if [ "$cc_version" = "10.1" ]; then
|
||||
CFLAGS="$CFLAGS -Wno-multichar"
|
||||
fi
|
||||
else
|
||||
# Enable some things only for certain GCC versions
|
||||
cc_version=`$cc_host -dumpversion | cut -c 1,3`
|
||||
|
||||
gcc295=""
|
||||
if [ "$cc_version" = 29 ]; then
|
||||
# Make sure we mark GCC 2.95 flag for Makefile.src.in, as we
|
||||
# need a lovely hack there to make it compile correctly.
|
||||
gcc295="1"
|
||||
fi
|
||||
if [ $cc_version -ge 29 ]; then
|
||||
CFLAGS="$CFLAGS -Wall -Wno-multichar -Wsign-compare -Wundef"
|
||||
CFLAGS="$CFLAGS -Wwrite-strings -Wpointer-arith"
|
||||
CFLAGS="$CFLAGS -Wno-uninitialized"
|
||||
|
||||
if [ $cc_version -ge 30 ]; then
|
||||
CFLAGS="$CFLAGS -W -Wno-unused-parameter"
|
||||
fi
|
||||
CC_CFLAGS="$CC_CFLAGS -Wstrict-prototypes"
|
||||
fi
|
||||
|
||||
if [ $cc_version -ge 34 ]; then
|
||||
CC_CFLAGS="$CC_CFLAGS -Wdeclaration-after-statement -Wold-style-definition"
|
||||
fi
|
||||
gcc295=""
|
||||
if [ "$cc_version" = 29 ]; then
|
||||
# Make sure we mark GCC 2.95 flag for Makefile.src.in, as we
|
||||
# need a lovely hack there to make it compile correctly.
|
||||
gcc295="1"
|
||||
fi
|
||||
|
||||
if [ "$os" = "CYGWIN" ]; then
|
||||
CFLAGS="$CFLAGS -mwin32"
|
||||
LDFLAGS="$LDFLAGS -mwin32"
|
||||
fi
|
||||
if [ "$os" = "MINGW" ] || [ "$os" = "CYGWIN" ]; then
|
||||
CFLAGS="$CFLAGS -mno-cygwin"
|
||||
LDFLAGS="$LDFLAGS -mno-cygwin"
|
||||
fi
|
||||
if [ $cc_version -ge 30 ]; then
|
||||
CFLAGS="$CFLAGS -W -Wno-unused-parameter"
|
||||
fi
|
||||
|
||||
if [ "$os" = "CYGWIN" ] || [ "$os" = "MINGW" ]; then
|
||||
LDFLAGS="$LDFLAGS -Wl,--subsystem,windows"
|
||||
LIBS="$LIBS -lws2_32 -lwinmm -lgdi32 -ldxguid -lole32"
|
||||
fi
|
||||
if [ $cc_version -ge 34 ]; then
|
||||
CC_CFLAGS="$CC_CFLAGS -Wdeclaration-after-statement -Wold-style-definition"
|
||||
fi
|
||||
|
||||
# GCC 4.0+ complains about that we break strict-aliasing.
|
||||
# On most places we don't see how to fix it, and it doesn't
|
||||
# break anything. So disable strict-aliasing to make the
|
||||
# compiler all happy.
|
||||
if [ $cc_version -ge 40 ]; then
|
||||
CFLAGS="$CFLAGS -fno-strict-aliasing"
|
||||
fi
|
||||
if [ "$os" = "CYGWIN" ]; then
|
||||
CFLAGS="$CFLAGS -mwin32"
|
||||
LDFLAGS="$LDFLAGS -mwin32"
|
||||
fi
|
||||
if [ "$os" = "MINGW" ] || [ "$os" = "CYGWIN" ]; then
|
||||
CFLAGS="$CFLAGS -mno-cygwin"
|
||||
LDFLAGS="$LDFLAGS -mno-cygwin"
|
||||
fi
|
||||
|
||||
# GCC 4.2+ automatically assumes that signed overflows do
|
||||
# not occur in signed arithmetics, whereas we are not
|
||||
# sure that they will not happen. It furthermore complains
|
||||
# about it's own optimized code in some places.
|
||||
if [ $cc_version -ge 42 ]; then
|
||||
CFLAGS="$CFLAGS -fno-strict-overflow"
|
||||
if [ "$os" = "CYGWIN" ] || [ "$os" = "MINGW" ]; then
|
||||
LDFLAGS="$LDFLAGS -Wl,--subsystem,windows"
|
||||
LIBS="$LIBS -lws2_32 -lwinmm -lgdi32 -ldxguid -lole32"
|
||||
fi
|
||||
|
||||
# GCC 4.0+ complains about that we break strict-aliasing.
|
||||
# On most places we don't see how to fix it, and it doesn't
|
||||
# break anything. So disable strict-aliasing to make the
|
||||
# compiler all happy.
|
||||
if [ $cc_version -ge 40 ]; then
|
||||
CFLAGS="$CFLAGS -fno-strict-aliasing"
|
||||
fi
|
||||
|
||||
# GCC 4.2+ automatically assumes that signed overflows do
|
||||
# not occur in signed arithmetics, whereas we are not
|
||||
# sure that they will not happen. It furthermore complains
|
||||
# about it's own optimized code in some places.
|
||||
if [ $cc_version -ge 42 ]; then
|
||||
CFLAGS="$CFLAGS -fno-strict-overflow"
|
||||
fi
|
||||
fi
|
||||
|
||||
if [ "$os" != "CYGWIN" ] && [ "$os" != "FREEBSD" ] && [ "$os" != "OPENBSD" ] && [ "$os" != "MINGW" ] && [ "$os" != "MORPHOS" ] && [ "$os" != "OSX" ] && [ "$os" != "WINCE" ] && [ "$os" != "PSP" ] && [ "$os" != "OS2" ]; then
|
||||
@@ -922,6 +1039,14 @@ make_cflags_and_ldflags() {
|
||||
if [ "$with_cocoa" != "0" ]; then
|
||||
CFLAGS="$CFLAGS -DWITH_COCOA"
|
||||
LIBS="$LIBS -F/System/Library/Frameworks -framework Cocoa -framework Carbon -framework AudioUnit"
|
||||
|
||||
if [ "$enable_cocoa_quartz" != "0" ]; then
|
||||
CFLAGS="$CFLAGS -DENABLE_COCOA_QUARTZ"
|
||||
fi
|
||||
|
||||
if [ "$enable_cocoa_quickdraw" != "0" ]; then
|
||||
CFLAGS="$CFLAGS -DENABLE_COCOA_QUICKDRAW"
|
||||
fi
|
||||
fi
|
||||
|
||||
if [ "$with_zlib" != "0" ]; then
|
||||
@@ -1052,6 +1177,13 @@ make_cflags_and_ldflags() {
|
||||
CFLAGS="$CFLAGS -DNDEBUG"
|
||||
fi
|
||||
|
||||
if [ "$enable_desync_debug" = "1" ]; then
|
||||
CFLAGS="$CFLAGS -DDEBUG_DUMP_COMMANDS"
|
||||
fi
|
||||
if [ "$enable_desync_debug" = "2" ]; then
|
||||
CFLAGS="$CFLAGS -DRANDOM_DEBUG"
|
||||
fi
|
||||
|
||||
if [ "$enable_osx_g5" != "0" ]; then
|
||||
CFLAGS="$CFLAGS -mtune=970 -mcpu=970 -mpowerpc-gpopt"
|
||||
fi
|
||||
@@ -1065,6 +1197,10 @@ make_cflags_and_ldflags() {
|
||||
CFLAGS="$CFLAGS -DWITH_PERSONAL_DIR -DPERSONAL_DIR=\\\\\"$personal_dir\\\\\""
|
||||
fi
|
||||
|
||||
if [ -n "$shared_dir" ]; then
|
||||
CFLAGS="$CFLAGS -DWITH_SHARED_DIR -DSHARED_DIR=\\\\\"$shared_dir\\\\\""
|
||||
fi
|
||||
|
||||
CFLAGS="$CFLAGS -DGLOBAL_DATA_DIR=\\\\\"$prefix_dir/$data_dir\\\\\""
|
||||
|
||||
log 1 "using CFLAGS... $CFLAGS $CC_CFLAGS"
|
||||
@@ -1211,13 +1347,26 @@ check_compiler() {
|
||||
}
|
||||
|
||||
check_build() {
|
||||
check_compiler "build system type" "cc_build" "$build" "$cc_build" "$CC" "gcc" "cc" "0" "-dumpmachine"
|
||||
if [ "$os" = "FREEBSD" ]; then
|
||||
# FreeBSD's C compiler does not support dump machine.
|
||||
# However, removing C support is not possible because PSP must be linked with the C compiler.
|
||||
check_compiler "build system type" "cc_build" "$build" "$cc_build" "$CXX" "g++" "c++" "0" "-dumpmachine"
|
||||
else
|
||||
check_compiler "build system type" "cc_build" "$build" "$cc_build" "$CC" "gcc" "cc" "0" "-dumpmachine"
|
||||
fi
|
||||
}
|
||||
|
||||
check_host() {
|
||||
# By default the host is the build
|
||||
if [ -z "$host" ]; then host="$build"; fi
|
||||
check_compiler "host system type" "cc_host" "$host" "$cc_host" "$CC" "gcc" "cc" "0" "-dumpmachine"
|
||||
|
||||
if [ "$os" = "FREEBSD" ]; then
|
||||
# FreeBSD's C compiler does not support dump machine.
|
||||
# However, removing C support is not possible because PSP must be linked with the C compiler.
|
||||
check_compiler "host system type" "cc_host" "$host" "$cc_host" "$CXX" "g++" "c++" "0" "-dumpmachine"
|
||||
else
|
||||
check_compiler "host system type" "cc_host" "$host" "$cc_host" "$CC" "gcc" "cc" "0" "-dumpmachine"
|
||||
fi
|
||||
}
|
||||
|
||||
check_cxx_build() {
|
||||
@@ -1524,6 +1673,19 @@ detect_cocoa() {
|
||||
fi
|
||||
|
||||
log 1 "checking COCOA... found"
|
||||
|
||||
|
||||
if [ "$enable_cocoa_quartz" != "0" ]; then
|
||||
log 1 "checking whether to enable the Quartz window subdriver... yes"
|
||||
else
|
||||
log 1 "checking whether to enable the Quartz window subdriver... no"
|
||||
fi
|
||||
|
||||
if [ "$enable_cocoa_quickdraw" != "0" ]; then
|
||||
log 1 "checking whether to enable the Quickdraw window subdriver... yes"
|
||||
else
|
||||
log 1 "checking whether to enable the Quickdraw window subdriver... no"
|
||||
fi
|
||||
}
|
||||
|
||||
detect_library() {
|
||||
@@ -2022,6 +2184,7 @@ make_sed() {
|
||||
s#!!DATA_DIR!!#$prefix_dir/$data_dir#g;
|
||||
s#!!ICON_DIR!!#$prefix_dir/$icon_dir#g;
|
||||
s#!!PERSONAL_DIR!!#$personal_dir#g;
|
||||
s#!!SHARED_DIR!!#$shared_dir#g;
|
||||
s#!!INSTALL_DIR!!#$install_dir#g;
|
||||
s#!!STRGEN!!#$STRGEN#g;
|
||||
s#!!ENDIAN_CHECK!!#$ENDIAN_CHECK#g;
|
||||
@@ -2162,12 +2325,16 @@ showhelp() {
|
||||
echo " [share/games/openttd]"
|
||||
echo " --icon-dir=dir location of icons. Will be prefixed"
|
||||
echo " with the prefix-dir [share/pixmaps]"
|
||||
echo " --personal-dir=dir location of the personal directory [.openttd]"
|
||||
echo " --personal-dir=dir location of the personal directory"
|
||||
echo " [os-dependent default]"
|
||||
echo " --shared-dir=dir location of shared data files"
|
||||
echo " [os-dependent default]"
|
||||
echo " --install-dir=dir specifies the root to install to."
|
||||
echo " Useful to install into jails [/]"
|
||||
echo ""
|
||||
echo "Features and packages:"
|
||||
echo " --enable-debug[=LVL] enable debug-mode (LVL=[0123], 0 is release)"
|
||||
echo " --enable_desync_debug=[LVL] enable desync debug options (LVL=[012], 0 is none"
|
||||
echo " --enable-profiling enables profiling"
|
||||
echo " --enable-dedicated compile a dedicated server (without video)"
|
||||
echo " --enable-static enable static compile (doesn't work for"
|
||||
@@ -2175,11 +2342,13 @@ showhelp() {
|
||||
echo " --enable-translator enable extra output for translators"
|
||||
echo " --enable-universal enable universal builds (OSX ONLY)"
|
||||
echo " --enable-osx-g5 enables optimalizations for G5 (OSX ONLY)"
|
||||
echo " --disable-cocoa-quartz disable the quartz window mode driver for Cocoa (OSX ONLY)"
|
||||
echo " --disable-cocoa-quickdraw disable the quickdraw window mode driver for Cocoa (OSX ONLY)"
|
||||
echo " --disable-unicode disable unicode support to build win9x"
|
||||
echo " version (Win32 ONLY)"
|
||||
echo " --disable-network disable network support"
|
||||
echo " --disable-assert disable asserts (continue on errors)"
|
||||
echo " --disable-strip disable any possible stripping"
|
||||
echo " --enable-strip enable any possible stripping"
|
||||
echo " --without-osx-sysroot disable the automatic adding of sysroot "
|
||||
echo " (OSX ONLY)"
|
||||
echo " --without-application-bundle disable generation of application bundle"
|
||||
|
4
configure
vendored
4
configure
vendored
@@ -31,13 +31,13 @@ LANG_DIR="$SRC_DIR/lang"
|
||||
MEDIA_DIR="$ROOT_DIR/media"
|
||||
SOURCE_LIST="$ROOT_DIR/source.list"
|
||||
|
||||
if [ "$1" = "--reconfig" ]; then
|
||||
if [ "$1" = "--reconfig" ] || [ "$1" = "--reconfigure" ]; then
|
||||
if ! [ -f "config.cache" ]; then
|
||||
echo "can't reconfigure, because never configured before"
|
||||
exit 1
|
||||
fi
|
||||
# Make sure we don't lock config.cache
|
||||
cat config.cache > cache.tmp
|
||||
cat config.cache | sed 's/\\ /\\\\ /g' > cache.tmp
|
||||
sh cache.tmp
|
||||
rm -f cache.tmp
|
||||
exit $?
|
||||
|
@@ -6,11 +6,11 @@ PLEASE READ THE ENTIRE DOCUMENT BEFORE DOING ANY ACTUAL CHANGES!!
|
||||
|
||||
SUPPORTED MSVC COMPILERS
|
||||
------------------------
|
||||
OpenTTD includes projects for MSVC 2003.NET and MSVC 2005.NET. Both will
|
||||
OpenTTD includes projects for MSVC 2005.NET and MSVC 2008.NET. Both will
|
||||
compile out of the box, providing you have the required libraries/headers;
|
||||
which ones, see below. There is no support for VS6, you are therefore
|
||||
strongly encouraged to either upgrade to MSVC 2005 Express (free) or use GCC.
|
||||
MSVC 2002 probably works as well, but it has not been tested.
|
||||
which ones, see below. There is no support for VS6 or MSVC 2002, or
|
||||
MSVC 2003.NET. You are therefore strongly encouraged to either upgrade to
|
||||
MSVC 2005 Express (free) or use GCC.
|
||||
|
||||
|
||||
1) REQUIRED FILES
|
||||
@@ -74,20 +74,6 @@ NOTE: make sure that the directory for the DirectX SDK is the first one in the
|
||||
list, above all others, otherwise compilation will most likely fail!!
|
||||
|
||||
|
||||
2.3) DEBUGGING - WORKING DIRECTORY (MSVC 2003 ONLY!)
|
||||
----------------------------------------------------
|
||||
The very first time you check out and compile OpenTTD with Visual Studio 2003, running
|
||||
the binary will complain about missing files. You need to go into and change a setting
|
||||
|
||||
OpenTTD > Project > Properties > Configuration (All Configurations) > ...
|
||||
Configuration Properties > Debugging >
|
||||
|
||||
* Working Directory: ..\bin
|
||||
|
||||
VS 2005 works out of the box because Microsoft allowed a user to supply a humanly-
|
||||
readable defaults file (openttd_vs80.vcproj.user), whereas 2003 is braindead.
|
||||
|
||||
|
||||
3) TTD GRAPHICS FILES
|
||||
---------------------
|
||||
Copy the following files from Transport Tycoon Deluxe to the bin/data folder
|
||||
@@ -102,12 +88,12 @@ Copy the following files from Transport Tycoon Deluxe to the bin/data folder
|
||||
|
||||
4) COMPILING
|
||||
------------
|
||||
Open trunk/openttd[_vs80].sln
|
||||
Open trunk/openttd_vs[89]0.sln
|
||||
Set the build mode to 'Release' in
|
||||
Build > Configuration manager > Active solution configuration > select "Release"
|
||||
Compile...
|
||||
|
||||
If everything works well the binary should be in trunk/objs/[Win32]/Release/openttd.exe
|
||||
If everything works well the binary should be in trunk/objs/Win[32|64]/Release/openttd.exe
|
||||
|
||||
|
||||
5) EDITING, CHANGING SOURCE CODE
|
||||
@@ -126,4 +112,4 @@ to ask about reasons; or just wait. The problem will most likely solve itself
|
||||
within a few days as the problem is noticed and fixed.
|
||||
|
||||
An up-to-date version of this README can be found on the wiki:
|
||||
http://wiki.openttd.org/index.php/MicrosoftVisualCExpress
|
||||
http://wiki.openttd.org/index.php/MicrosoftVisualCExpress
|
||||
|
File diff suppressed because it is too large
Load Diff
@@ -6,6 +6,7 @@
|
||||
<title>OpenTTD Landscape Internals - #2</title>
|
||||
<style type="text/css">
|
||||
span.abuse { font-family: "Courier New", Courier, mono; background-color: rgb(255, 58, 31); }
|
||||
span.option{ font-family: "Courier New", Courier, mono; background-color: rgb(255,255, 30); }
|
||||
span.free { font-family: "Courier New", Courier, mono; background-color: rgb(30, 178, 54); }
|
||||
span.used { font-family: "Courier New", Courier, mono; }
|
||||
td.bits { white-space: nowrap; text-align: center; font-family: "Courier New", Courier, mono; }
|
||||
@@ -22,7 +23,8 @@ the array so you can quickly see what is used and what is not.
|
||||
<ul>
|
||||
<li><span style="font-weight: bold;"><span class="free">O</span></span> - bit is free</li>
|
||||
<li><span style="font-weight: bold;"><span class="used">X</span></span> - bit is used</li>
|
||||
<li><span style="font-weight: bold;"><span class="abuse"> </span></span> - bit of attribute is abused for different purposes</li>
|
||||
<li><span style="font-weight: bold;"><span class="abuse"> </span></span> - bit of attribute is abused for different purposes, i.e. other bits define the actual meaning.</li>
|
||||
<li><span style="font-weight: bold;"><span class="option">~</span></span> - bit is accessed, but does not really have a meaning (e.g. owner of clear land is always OWNER_NONE)</li>
|
||||
</ul>
|
||||
<p>
|
||||
<ul>
|
||||
@@ -64,7 +66,7 @@ the array so you can quickly see what is used and what is not.
|
||||
<td rowspan="2">0</td>
|
||||
<td class="caption">ground</td>
|
||||
<td class="bits">XXXX XXXX</td>
|
||||
<td class="bits">XXXX XXXX</td>
|
||||
<td class="bits"><span class="option">~~~~ ~~~~</span></td>
|
||||
<td class="bits"><span class="free">OOOO OOOO OOOO OOOO</span></td>
|
||||
<td class="bits"><span class="free">OOOO OOOO</span></td>
|
||||
<td class="bits">XXXX XX<span class="free">OO</span></td>
|
||||
@@ -75,23 +77,34 @@ the array so you can quickly see what is used and what is not.
|
||||
<tr>
|
||||
<td class="caption">farmland</td>
|
||||
<td class="bits">-inherit-</td>
|
||||
<td class="bits">-inherit-</td>
|
||||
<td class="bits"><span class="option">~~~~ ~~~~</span></td>
|
||||
<td class="bits">XXXX XXXX XXXX XXXX</td>
|
||||
<td class="bits"><span class="free">OOOO</span> XXXX</td>
|
||||
<td class="bits">-inherit-</td>
|
||||
<td class="bits"><span class="free">OOO</span>X XXXX</td>
|
||||
<td class="bits">-inherit-</td>
|
||||
<td class="bits">XX<span class="free">OO OO</span>XX</td>
|
||||
<td class="bits"><span class="free">OOOO OOOO</span></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td rowspan=3>1</td>
|
||||
<td rowspan=4>1</td>
|
||||
<td class="caption">rail</td>
|
||||
<td class="bits">XXXX XXXX</td>
|
||||
<td class="bits"><span class="option">~~~</span>X XXXX</td>
|
||||
<td class="bits"><span class="free">OOOO OOOO OOOO OOOO</span></td>
|
||||
<td class="bits"><span class="free">OOOO</span> <span class="option">~~</span>XX</td>
|
||||
<td class="bits"><span class="free">OOOO</span> XXXX</td>
|
||||
<td class="bits">XXXX XXXX</td>
|
||||
<td class="bits">XX<span class="free">OO OO</span>XX</td>
|
||||
<td class="bits"><span class="free">OOOO OOOO</span></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="caption">rail with signals</td>
|
||||
<td class="bits">-inherit-</td>
|
||||
<td class="bits">-inherit-</td>
|
||||
<td class="bits"><span class="free">OOOO OOOO O</span>XXX <span class="free">O</span>XXX</td>
|
||||
<td class="bits">XXXX <span class="option">~~</span>XX</td>
|
||||
<td class="bits">XXXX XXXX</td>
|
||||
<td class="bits">XXXX XXXX</td>
|
||||
<td class="bits">XXXX XXXX</td>
|
||||
<td class="bits">-inherit-</td>
|
||||
<td class="bits">XX<span class="free">OO OO</span>XX</td>
|
||||
<td class="bits"><span class="free">OOOO OOOO</span></td>
|
||||
</tr>
|
||||
@@ -100,9 +113,9 @@ the array so you can quickly see what is used and what is not.
|
||||
<td class="bits">-inherit-</td>
|
||||
<td class="bits">-inherit-</td>
|
||||
<td class="bits"><span class="free">OOOO OOOO OOOO OOOO</span></td>
|
||||
<td class="bits"><span class="free">OOOO</span> <span class="option">~~</span>XX</td>
|
||||
<td class="bits"><span class="free">OOOO</span> XXXX</td>
|
||||
<td class="bits"><span class="free">OOOO</span> XXXX</td>
|
||||
<td class="bits">XX<span class="free">OO O</span>XXX</td>
|
||||
<td class="bits">XX<span class="free">OO OO</span>XX</td>
|
||||
<td class="bits">XX<span class="free">OO OO</span>XX</td>
|
||||
<td class="bits"><span class="free">OOOO OOOO</span></td>
|
||||
</tr>
|
||||
@@ -111,9 +124,9 @@ the array so you can quickly see what is used and what is not.
|
||||
<td class="bits">-inherit-</td>
|
||||
<td class="bits">-inherit-</td>
|
||||
<td class="bits">XXXX XXXX XXXX XXXX</td>
|
||||
<td class="bits"><span class="free">OOOO</span> <span class="option">~~</span>XX</td>
|
||||
<td class="bits"><span class="free">OOOO</span> XXXX</td>
|
||||
<td class="bits"><span class="free">OOOO</span> XXXX</td>
|
||||
<td class="bits">XX<span class="free">OO O</span>XXX</td>
|
||||
<td class="bits">XX<span class="free">OO OOO</span>X</td>
|
||||
<td class="bits">XX<span class="free">OO OO</span>XX</td>
|
||||
<td class="bits"><span class="free">OOOO OOOO</span></td>
|
||||
</tr>
|
||||
@@ -121,7 +134,7 @@ the array so you can quickly see what is used and what is not.
|
||||
<td rowspan=3>2</td>
|
||||
<td class="caption">road</td>
|
||||
<td class="bits">XXXX XXXX</td>
|
||||
<td class="bits">XXXX XXXX</td>
|
||||
<td class="bits"><span class="option">~~~</span>X XXXX</td>
|
||||
<td class="bits">XXXX XXXX XXXX XXXX</td>
|
||||
<td class="bits">XXXX XXXX</td>
|
||||
<td class="bits">XXXX XXXX</td>
|
||||
@@ -134,11 +147,11 @@ the array so you can quickly see what is used and what is not.
|
||||
<td class="bits">-inherit-</td>
|
||||
<td class="bits">-inherit-</td>
|
||||
<td class="bits">-inherit-</td>
|
||||
<td class="bits">XXXX XXXX</td>
|
||||
<td class="bits">XXXX <span class="option">~~</span>XX</td>
|
||||
<td class="bits"><span class="free">O</span>XXX XXXX</td>
|
||||
<td class="bits">XX<span class="free">OO</span> XXXX</td>
|
||||
<td class="bits">XX<span class="free">OO OO</span>XX</td>
|
||||
<td class="bits">XXXX XXXX</td>
|
||||
<td class="bits">-inherit-</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="caption">road depot</td>
|
||||
@@ -147,7 +160,7 @@ the array so you can quickly see what is used and what is not.
|
||||
<td class="bits"><span class="free">OOOO OOOO OOOO OOOO</span></td>
|
||||
<td class="bits">X<span class="free">OOO OOOO</span></td>
|
||||
<td class="bits"><span class="free">OOOO OOOO</span></td>
|
||||
<td class="bits">XX<span class="free">OO</span> XXXX</td>
|
||||
<td class="bits">XX<span class="free">OO OO</span>XX</td>
|
||||
<td class="bits">XX<span class="free">OO OO</span>XX</td>
|
||||
<td class="bits">XXX<span class="free">O OOOO</span></td>
|
||||
</tr>
|
||||
@@ -157,45 +170,122 @@ the array so you can quickly see what is used and what is not.
|
||||
<td class="bits">XXXX XXXX</td>
|
||||
<td class="bits">XXXX XXXX</td>
|
||||
<td class="bits">XXXX XXXX XXXX XXXX</td>
|
||||
<td class="bits">XX<span class="free">O</span>X XXXX</td>
|
||||
<td class="bits">XXX<span class="option">~ ~~</span>XX</td>
|
||||
<td class="bits">XXXX XXXX</td>
|
||||
<td class="bits">XX<span class="abuse">XX XXXX</span></td>
|
||||
<td class="bits">XXX<span class="abuse">X XXXX</span></td>
|
||||
<td class="bits"><span class="abuse">XXXX XX</span>XX</td>
|
||||
<td class="bits"><span class="abuse">X</span>XX<span class="abuse">X XXX</span>X</td>
|
||||
<td class="bits">XXXX <span class="abuse">XXXX</span></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>4</td>
|
||||
<td class="caption">trees</td>
|
||||
<td class="bits">XXXX XXXX</td>
|
||||
<td class="bits">XXXX XXXX</td>
|
||||
<td class="bits"><span class="option">~~~~ ~~~~</span></td>
|
||||
<td class="bits"><span class="free">OOOO OOOO</span> XXXX XXXX</td>
|
||||
<td class="bits">XXXX XXXX</td>
|
||||
<td class="bits"><span class="option">~~</span>XX XXXX</td>
|
||||
<td class="bits">XXXX XX<span class="free">OO</span></td>
|
||||
<td class="bits">XX<span class="free">OO O</span>XXX</td>
|
||||
<td class="bits"><span class="free">OOOO OO</span>XX</td>
|
||||
<td class="bits"><span class="free">OOOO OOOO</span></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>5</td>
|
||||
<td class="caption">station</td>
|
||||
<td class="bits">XXXX XXXX</td>
|
||||
<td rowspan=6>5</td>
|
||||
<td class="caption">rail station</td>
|
||||
<td class="bits">XXXX XXXX</td>
|
||||
<td class="bits"><span class="option">~~~</span>X XXXX</td>
|
||||
<td class="bits">XXXX XXXX XXXX XXXX</td>
|
||||
<td class="bits">XXXX <span class="option">~~</span>XX</td>
|
||||
<td class="bits">XXXX XXXX</td>
|
||||
<td class="bits">XXXX XXXX</td>
|
||||
<td class="bits">XXXX XXXX</td>
|
||||
<td class="bits"><span class="free">OO</span>XX X<span class="free">O</span>XX</td>
|
||||
<td class="bits"><span class="free">OOOO OOOO</span></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="caption">road stop</td>
|
||||
<td class="bits">-inherit-</td>
|
||||
<td class="bits">-inherit-</td>
|
||||
<td class="bits">-inherit-</td>
|
||||
<td class="bits"><span class="free">OOOO O</span>XXX</td>
|
||||
<td class="bits"><span class="option">~~~~ ~~~~</span></td>
|
||||
<td class="bits"><span class="option">~~~~ ~</span>XXX</td>
|
||||
<td class="bits"><span class="free">OO</span>XX XXXX</td>
|
||||
<td class="bits"><span class="free">OOOO OOOO</span></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>6</td>
|
||||
<td class="caption">water</td>
|
||||
<td class="bits">XXXX XXXX</td>
|
||||
<td class="bits">XXXX XXXX</td>
|
||||
<td class="bits"><span class="free">OOOO OOOO OOOO OOOO</span></td>
|
||||
<td class="caption">dock</td>
|
||||
<td class="bits">-inherit-</td>
|
||||
<td class="bits">-inherit-</td>
|
||||
<td class="bits">-inherit-</td>
|
||||
<td class="bits"><span class="free">OOOO OO</span>XX</td>
|
||||
<td class="bits"><span class="option">~~~~ ~~~~</span></td>
|
||||
<td class="bits"><span class="option">~~~~ ~</span>XXX</td>
|
||||
<td class="bits"><span class="free">OO</span>XX X<span class="free">O</span>XX</td>
|
||||
<td class="bits"><span class="free">OOOO OOOO</span></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="caption">airport</td>
|
||||
<td class="bits">-inherit-</td>
|
||||
<td class="bits">-inherit-</td>
|
||||
<td class="bits">-inherit-</td>
|
||||
<td class="bits"><span class="free">OOOO OOOO</span></td>
|
||||
<td class="bits"><span class="option">~~~~ ~~~~</span></td>
|
||||
<td class="bits">XXXX XXXX</td>
|
||||
<td class="bits"><span class="free">OO</span>XX X<span class="free">O</span>XX</td>
|
||||
<td class="bits"><span class="free">OOOO OOOO</span></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="caption">buoy</td>
|
||||
<td class="bits">-inherit-</td>
|
||||
<td class="bits">-inherit-</td>
|
||||
<td class="bits">-inherit-</td>
|
||||
<td class="bits"><span class="free">OOOO OO</span>XX</td>
|
||||
<td class="bits"><span class="option">~~~~ ~~~~</span></td>
|
||||
<td class="bits"><span class="option">~~~~ ~~~~</span></td>
|
||||
<td class="bits"><span class="free">OO</span>XX X<span class="free">O</span>XX</td>
|
||||
<td class="bits"><span class="free">OOOO OOOO</span></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="caption">oilrig</td>
|
||||
<td class="bits">-inherit-</td>
|
||||
<td class="bits">-inherit-</td>
|
||||
<td class="bits">-inherit-</td>
|
||||
<td class="bits"><span class="free">OOOO OOOO</span></td>
|
||||
<td class="bits"><span class="option">~~~~ ~~~~</span></td>
|
||||
<td class="bits"><span class="option">~~~~ ~~~~</span></td>
|
||||
<td class="bits"><span class="free">OO</span>XX X<span class="free">O</span>XX</td>
|
||||
<td class="bits"><span class="free">OOOO OOOO</span></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td rowspan=3>6</td>
|
||||
<td class="caption">sea, shore</td>
|
||||
<td class="bits">XXXX XXXX</td>
|
||||
<td class="bits"><span class="option">~~~</span>X XXXX</td>
|
||||
<td class="bits"><span class="free">OOOO OOOO OOOO OOOO</span></td>
|
||||
<td class="bits"><span class="free">OOOO OO</span>XX</td>
|
||||
<td class="bits"><span class="free">OOOO OOOO</span></td>
|
||||
<td class="bits">X<span class="option">~~</span>X XXXX</td>
|
||||
<td class="bits">XX<span class="free">OO OO</span>XX</td>
|
||||
<td class="bits"><span class="free">OOOO OOOO</span></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="caption">canal, river</td>
|
||||
<td class="bits">-inherit-</td>
|
||||
<td class="bits">-inherit-</td>
|
||||
<td class="bits"><span class="free">OOOO OOOO OOOO OOOO</span></td>
|
||||
<td class="bits"><span class="free">OOOO OO</span>XX</td>
|
||||
<td class="bits">XXXX XXXX</td>
|
||||
<td class="bits">-inherit-</td>
|
||||
<td class="bits">XX<span class="free">OO OO</span>XX</td>
|
||||
<td class="bits"><span class="free">OOOO OOOO</span></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="caption">shipdepot</td>
|
||||
<td class="bits">-inherit-</td>
|
||||
<td class="bits">-inherit-</td>
|
||||
<td class="bits"><span class="free">OOOO OOOO OOOO OOOO</span></td>
|
||||
<td class="bits"><span class="free">OOOO OO</span>XX</td>
|
||||
<td class="bits"><span class="free">OOOO OOOO</span></td>
|
||||
<td class="bits">-inherit-</td>
|
||||
<td class="bits">XX<span class="free">OO OO</span>XX</td>
|
||||
<td class="bits"><span class="free">OOOO OOOO</span></td>
|
||||
</tr>
|
||||
@@ -203,7 +293,7 @@ the array so you can quickly see what is used and what is not.
|
||||
<td>8</td>
|
||||
<td class="caption">industry</td>
|
||||
<td class="bits">XXXX XXXX</td>
|
||||
<td class="bits"><span class="abuse">X</span><span class="free">OO</span><span class="abuse">X
|
||||
<td class="bits">X<span class="free">OOO</span> <span class="abuse">
|
||||
XXXX</span></td>
|
||||
<td class="bits">XXXX XXXX XXXX XXXX</td>
|
||||
<td class="bits">XXXX XXXX</td>
|
||||
@@ -216,35 +306,45 @@ the array so you can quickly see what is used and what is not.
|
||||
<td rowspan=2>9</td>
|
||||
<td class="caption">tunnel entrance</td>
|
||||
<td class="bits">XXXX XXXX</td>
|
||||
<td class="bits">XXXX XXXX</td>
|
||||
<td class="bits"><span class="option">~~~</span>X XXXX</td>
|
||||
<td class="bits"><span class="free">OOOO OOOO OOOO OOOO</span></td>
|
||||
<td class="bits"><span class="free">OOOO</span> XXXX</td>
|
||||
<td class="bits"><span class="free">OOOO</span> <span class="option">~</span><span class="abuse">XXX</span></td>
|
||||
<td class="bits">X<span class="free">OOO OOOO</span></td>
|
||||
<td class="bits">X<span class="free">OOO</span> XXXX</td>
|
||||
<td class="bits">X<span class="free">OOO</span> <span class="option">~</span>XXX</td>
|
||||
<td class="bits">XX<span class="free">OO OO</span>XX</td>
|
||||
<td class="bits"><span class="free">OOOO OOOO</span></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>bridge ramp</td>
|
||||
<td class="bits">XXXX XXXX</td>
|
||||
<td class="bits">XXXX XXXX</td>
|
||||
<td class="bits"><span class="free">OOOO OOOO</span> <span class="abuse">XXXX</span>
|
||||
<span class="free">OOOO</span></td>
|
||||
<td class="bits"><span class="free">OOOO</span> XXXX</td>
|
||||
<td class="bits">-inherit-</td>
|
||||
<td class="bits">-inherit-</td>
|
||||
<td class="bits"><span class="free">OOOO OOOO</span> XXXX <span class="free">OOOO</span></td>
|
||||
<td class="bits"><span class="free">OOOO</span> <span class="option">~</span><span class="abuse">XXX</span></td>
|
||||
<td class="bits">X<span class="free">OOO OOOO</span></td>
|
||||
<td class="bits">X<span class="free">OOO</span> XXXX</td>
|
||||
<td class="bits">X<span class="free">OOO</span> <span class="option">~</span>XXX</td>
|
||||
<td class="bits">XX<span class="free">OO OO</span>XX</td>
|
||||
<td class="bits"><span class="free">OOOO OOOO</span></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>A</td>
|
||||
<td rowspan=2>A</td>
|
||||
<td class="caption">unmovables</td>
|
||||
<td class="bits">XXXX XXXX</td>
|
||||
<td class="bits">XXXX XXXX</td>
|
||||
<td class="bits"><span class="option">~~~</span>X XXXX</td>
|
||||
<td class="bits"><span class="free">OOOO OOOO OOOO OOOO</span></td>
|
||||
<td class="bits"><span class="free">OOOO OOOO</span></td>
|
||||
<td class="bits"><span class="free">OOOO OOOO</span></td>
|
||||
<td class="bits">XXXX XXXX</td>
|
||||
<td class="bits">X<span class="option">~~</span>X XXXX</td>
|
||||
<td class="bits">XX<span class="free">OO OO</span>XX</td>
|
||||
<td class="bits"><span class="free">OOOO OOOO</span></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="caption">company statue</td>
|
||||
<td class="bits">-inherit-</td>
|
||||
<td class="bits">-inherit-</td>
|
||||
<td class="bits">XXXX XXXX XXXX XXXX</td>
|
||||
<td class="bits"><span class="free">OOOO OOOO</span></td>
|
||||
<td class="bits"><span class="free">OOOO OOOO</span></td>
|
||||
<td class="bits">-inherit-</td>
|
||||
<td class="bits">XX<span class="free">OO OO</span>XX</td>
|
||||
<td class="bits"><span class="free">OOOO OOOO</span></td>
|
||||
</tr>
|
||||
|
@@ -1,28 +1,37 @@
|
||||
.\" Hey, EMACS: -*- nroff -*-
|
||||
.\" Please adjust this date whenever revising the manpage.
|
||||
.Dd Sep 15, 2007
|
||||
.Dd Jul 20, 2008
|
||||
.Dt OPENTTD 6
|
||||
.Sh NAME
|
||||
.Nm openttd
|
||||
.Nd An open source clone of the Microprose game "Transport Tycoon Deluxe"
|
||||
.Sh SYNOPSIS
|
||||
.Nm
|
||||
.Op Fl Defhi
|
||||
.Op Fl Defhix
|
||||
.Op Fl G Ar seed
|
||||
.Op Fl b Ar blitter
|
||||
.Op Fl d Ar [level | cat=lvl[, ...]]
|
||||
.Op Fl c Ar config_file
|
||||
.Op Fl g Ar [savegame]
|
||||
.Op Fl l Ar host[:port]
|
||||
.Op Fl n Ar host[:port][#player]
|
||||
.Op Fl r Ar widthxheight
|
||||
.Op Fl t Ar date
|
||||
.Op Fl m Ar driver
|
||||
.Op Fl s Ar driver
|
||||
.Op Fl v Ar driver
|
||||
.Op Fl b Ar blitter
|
||||
.Sh OPTIONS
|
||||
.Bl -tag -width ".Fl n Ar host[:port][#player]"
|
||||
.It Fl D
|
||||
.It Fl D Ar [host][:port]
|
||||
Start a dedicated server
|
||||
.It Fl G Ar seed
|
||||
Seed the pseudo random number generator
|
||||
.It Fl b Ar blitter
|
||||
Set the blitter, see
|
||||
.Fl h
|
||||
.It Fl c Ar config_file
|
||||
Use 'config_file' instead of 'openttd.cfg'
|
||||
.It Fl d Ar [level]
|
||||
Set debug verbosity for all categories to
|
||||
.Ar level
|
||||
@@ -42,6 +51,9 @@ at start or start a new game if omitted
|
||||
Display a summary of all options and available drivers
|
||||
.It Fl i
|
||||
Force to use the DOS palette (use this if you see a lot of magenta)
|
||||
.It Fl l Ar host[:port]
|
||||
Redirect DEBUG(), See
|
||||
.Fl D
|
||||
.It Fl m Ar driver
|
||||
Set the music driver, see
|
||||
.Fl h
|
||||
@@ -57,6 +69,8 @@ Set the starting date
|
||||
.It Fl v Ar driver
|
||||
Set the video driver, see
|
||||
.Fl h
|
||||
.It Fl x
|
||||
Do not automatically save to config file on exit
|
||||
.El
|
||||
.Sh SEE ALSO
|
||||
http://wiki.openttd.org/, http://www.openttd.org
|
||||
|
@@ -11,21 +11,26 @@ by the number below on http://bugs.openttd.org.
|
||||
If the bug report is closed, it has been fixed, which then can be verified
|
||||
in the latest SVN version of /trunk.
|
||||
|
||||
Bugs for 0.6.0-beta1
|
||||
Bugs for 0.6.2-RC2
|
||||
------------------------------------------------------------------------
|
||||
URL: http://bugs.openttd.org
|
||||
|
||||
- 1519 Full screen issues in windows
|
||||
- 1495 Long vehicles block multistop station
|
||||
- 1487 Ending_year is never written to
|
||||
- 2129 Strings from message boxes could sometimes change (e.g. the screenshot filename)
|
||||
- 2085 Vehicle list of shared vehicles without orders not possible
|
||||
- 1944 Road vehicles not picking empty drivethrough platform
|
||||
- 1923 Unique names not always enforced
|
||||
- 1890 Airplanes copy helipcopters goto heliport order
|
||||
- 1885 Almost all unserved industries die in big maps
|
||||
- 1858 Industry legend in small map overwrites buttons
|
||||
- 1852 Minor tram reversing glitches
|
||||
- 1802 Path with space in configure fails
|
||||
- 1793 Inconsistent travel time for fast trains
|
||||
- 1762 Strange Autoreplace behaviour
|
||||
- 1752 User input is not checked
|
||||
- 1693 Removing road does not reset owner
|
||||
- 1473 Train not going to available platform
|
||||
- 1404 Spinner widget interprets one click as many
|
||||
- 1386 Mac OS X fails to compile out of the box on 10.5
|
||||
- 1264 Autoreplace for multiple NewGRF DMU sets fails
|
||||
- 1200 Illegal names skip comparisons for uniquity
|
||||
- 1141 [OSX] Not smooth moving map with touchpad
|
||||
- 1109 [OSX] Choppy mouse cursor movement in fullscreen mode
|
||||
- 1074 Large slowdown when building tracks
|
||||
- 1140 [OSX] Not smooth moving map with touchpad
|
||||
- 1072 Text overflows in several windows
|
||||
- 716 Train crash in depot with long long tracks
|
||||
- 119 Clipping problems with vehicles on slopes
|
||||
|
@@ -1,8 +1,62 @@
|
||||
openttd (0.6~svn) unstable; urgency=low
|
||||
openttd (0.6.2~RC2-1) unstable; urgency=low
|
||||
|
||||
* Unreleased SVN version. Versioned to allow normal upgrades to released versions.
|
||||
* New upstream release.
|
||||
|
||||
-- Matthijs Kooijman <m.kooijman@student.utwente.nl> Mon, 26 Feb 2007 21:07:05 +0100
|
||||
-- Matthijs Kooijman <m.kooijman@student.utwente.nl> Fri, 25 Jul 2008 22:00:00 +0200
|
||||
|
||||
openttd (0.6.2~RC1-1) unstable; urgency=low
|
||||
|
||||
* New upstream release.
|
||||
|
||||
-- Matthijs Kooijman <m.kooijman@student.utwente.nl> Wed, 16 Jul 2008 19:45:00 +0200
|
||||
|
||||
openttd (0.6.1-1) unstable; urgency=low
|
||||
|
||||
* New upstream release.
|
||||
|
||||
-- Matthijs Kooijman <m.kooijman@student.utwente.nl> Sun, 01 Jun 2008 15:35:00 +0200
|
||||
|
||||
openttd (0.6.1~RC2-1) unstable; urgency=low
|
||||
|
||||
* New upstream release.
|
||||
|
||||
-- Matthijs Kooijman <m.kooijman@student.utwente.nl> Wed, 21 May 2008 00:05:00 +0200
|
||||
|
||||
openttd (0.6.1~RC1-1) unstable; urgency=low
|
||||
|
||||
* New upstream release.
|
||||
|
||||
-- Matthijs Kooijman <m.kooijman@student.utwente.nl> Sat, 26 Apr 2008 22:55:00 +0200
|
||||
|
||||
openttd (0.6.0-1) unstable; urgency=low
|
||||
|
||||
* New upstream release.
|
||||
|
||||
-- Matthijs Kooijman <m.kooijman@student.utwente.nl> Tue, 01 Apr 2008 13:33:37 +0100
|
||||
|
||||
openttd (0.6.0~RC1-1) unstable; urgency=low
|
||||
|
||||
* New upstream release.
|
||||
|
||||
-- Matthijs Kooijman <m.kooijman@student.utwente.nl> Wed, 26 Mar 2008 15:51:40 +0100
|
||||
|
||||
openttd (0.6.0~beta5-1) unstable; urgency=low
|
||||
|
||||
* New upstream release.
|
||||
|
||||
-- Matthijs Kooijman <m.kooijman@student.utwente.nl> Mon, 04 Mar 2008 18:06:31 +0100
|
||||
|
||||
openttd (0.6.0~beta4-1) unstable; urgency=low
|
||||
|
||||
* New upstream release.
|
||||
|
||||
-- Matthijs Kooijman <m.kooijman@student.utwente.nl> Mon, 18 Feb 2008 20:09:29 +0100
|
||||
|
||||
openttd (0.6.0~beta3-1) unstable; urgency=low
|
||||
|
||||
* New upstream release.
|
||||
|
||||
-- Matthijs Kooijman <m.kooijman@student.utwente.nl> Tue, 16 Jan 2008 21:40:07 +0100
|
||||
|
||||
openttd (0.6.0~beta2-1) unstable; urgency=low
|
||||
|
||||
|
@@ -19,7 +19,7 @@ echo "<?xml version=\"1.0\" encoding=\"UTF-8\"?>
|
||||
<key>CFBundleDevelopmentRegion</key>
|
||||
<string>English</string>
|
||||
<key>CFBundleDisplayName</key>
|
||||
<string>Open Transport Tycoon</string>
|
||||
<string>OpenTTD</string>
|
||||
<key>CFBundleExecutable</key>
|
||||
<string>openttd</string>
|
||||
<key>CFBundleGetInfoString</key>
|
||||
|
@@ -1,9 +0,0 @@
|
||||
You require the data files of the original Transport Tycoon Deluxe
|
||||
for Windows to play the game. You have to manually copy the following
|
||||
files to %{_gamesdatadir}/openttd/data/
|
||||
sample.cat
|
||||
trg1r.grf
|
||||
trgcr.grf
|
||||
trghr.grf
|
||||
trgir.grf
|
||||
trgtr.grf
|
@@ -1,146 +0,0 @@
|
||||
#------------------------------------------------------------------------------
|
||||
# openttd.spec
|
||||
# This SPEC file controls the building of custom OpenTTD RPM
|
||||
# packages.
|
||||
#------------------------------------------------------------------------------
|
||||
|
||||
%define name openttd
|
||||
%define version 0.5.0
|
||||
%define release 1mdk
|
||||
|
||||
#------------------------------------------------------------------------------
|
||||
# Prologue information
|
||||
#------------------------------------------------------------------------------
|
||||
Name: %{name}
|
||||
Version: %{version}
|
||||
Release: %{release}
|
||||
Summary: An open source clone of the Microprose game "Transport Tycoon Deluxe"
|
||||
Group: Games/Strategy
|
||||
License: GPL
|
||||
|
||||
URL: http://www.openttd.org
|
||||
|
||||
Source: %{name}-%{version}.tar.gz
|
||||
Packager: Dominik Scherer <dominik@openttd.com>
|
||||
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-buildroot
|
||||
BuildRequires: libSDL1.2-devel >= 1.2.7
|
||||
BuildRequires: libpng3-devel >= 1.2.5
|
||||
BuildRequires: zlib1-devel >= 1.2.1
|
||||
|
||||
#------------------------------------------------------------------------------
|
||||
# Description
|
||||
#------------------------------------------------------------------------------
|
||||
%description
|
||||
An enhanced open source clone of the Microprose game "Transport Tycoon Deluxe".
|
||||
You require the data files of the original Transport Tycoon Deluxe
|
||||
for Windows to play the game. You have to MANUALLY copy them to the
|
||||
game data directory!
|
||||
|
||||
#------------------------------------------------------------------------------
|
||||
# install scripts
|
||||
#------------------------------------------------------------------------------
|
||||
%prep
|
||||
rm -rf $RPM_BUILD_ROOT
|
||||
%setup
|
||||
|
||||
%build
|
||||
make BINARY_DIR=%{_gamesbindir} PREFIX=%{_gamesdatadir} DATA_DIR=openttd INSTALL_DIR=%{_gamesdatadir}/openttd/ USE_HOMEDIR=1 PERSONAL_DIR=.openttd INSTALL=1 RELEASE=%{version}
|
||||
|
||||
%install
|
||||
mkdir -p $RPM_BUILD_ROOT%{_gamesbindir}
|
||||
mkdir -p $RPM_BUILD_ROOT%{_gamesdatadir}/openttd/lang
|
||||
mkdir -p $RPM_BUILD_ROOT%{_gamesdatadir}/openttd/data
|
||||
mkdir -p $RPM_BUILD_ROOT%{_gamesdatadir}/openttd/scenario
|
||||
|
||||
cp ./openttd $RPM_BUILD_ROOT%{_gamesbindir}/
|
||||
cp -r ./lang/*.lng $RPM_BUILD_ROOT%{_gamesdatadir}/openttd/lang/
|
||||
cp -r ./data/*.grf $RPM_BUILD_ROOT%{_gamesdatadir}/openttd/data/
|
||||
cp -r ./scenario/*.scn $RPM_BUILD_ROOT%{_gamesdatadir}/openttd/scenario/
|
||||
cp -r ./data/opntitle.dat $RPM_BUILD_ROOT%{_gamesdatadir}/openttd/data/
|
||||
|
||||
# icon
|
||||
install -m644 media/openttd.32.png -D $RPM_BUILD_ROOT%{_miconsdir}/%{name}.png
|
||||
install -m644 media/openttd.64.png -D $RPM_BUILD_ROOT%{_iconsdir}/%{name}.png
|
||||
install -m644 media/openttd.128.png -D $RPM_BUILD_ROOT%{_liconsdir}/%{name}.png
|
||||
|
||||
# menu entry
|
||||
mkdir -p $RPM_BUILD_ROOT/%{_menudir}
|
||||
cat << EOF > $RPM_BUILD_ROOT/%{_menudir}/%{name}
|
||||
?package(%{name}):command="%{_gamesbindir}/openttd" icon="%{name}.png" \
|
||||
needs="X11" section="Amusement/Strategy" title="OpenTTD" \
|
||||
longtitle="%{Summary}"
|
||||
EOF
|
||||
|
||||
%clean
|
||||
rm -rf $RPM_BUILD_ROOT
|
||||
|
||||
%post
|
||||
%{update_menus}
|
||||
|
||||
%postun
|
||||
%{clean_menus}
|
||||
|
||||
#------------------------------------------------------------------------------
|
||||
# Files listing.
|
||||
#------------------------------------------------------------------------------
|
||||
%files
|
||||
%defattr(-,root,root,0755)
|
||||
%{_gamesbindir}/openttd
|
||||
|
||||
%{_gamesdatadir}/openttd/lang/american.lng
|
||||
%{_gamesdatadir}/openttd/lang/catalan.lng
|
||||
%{_gamesdatadir}/openttd/lang/czech.lng
|
||||
%{_gamesdatadir}/openttd/lang/danish.lng
|
||||
%{_gamesdatadir}/openttd/lang/dutch.lng
|
||||
%{_gamesdatadir}/openttd/lang/english.lng
|
||||
%{_gamesdatadir}/openttd/lang/finnish.lng
|
||||
%{_gamesdatadir}/openttd/lang/french.lng
|
||||
%{_gamesdatadir}/openttd/lang/galician.lng
|
||||
%{_gamesdatadir}/openttd/lang/german.lng
|
||||
%{_gamesdatadir}/openttd/lang/hungarian.lng
|
||||
%{_gamesdatadir}/openttd/lang/icelandic.lng
|
||||
%{_gamesdatadir}/openttd/lang/italian.lng
|
||||
%{_gamesdatadir}/openttd/lang/norwegian.lng
|
||||
%{_gamesdatadir}/openttd/lang/origveh.lng
|
||||
%{_gamesdatadir}/openttd/lang/polish.lng
|
||||
%{_gamesdatadir}/openttd/lang/portuguese.lng
|
||||
%{_gamesdatadir}/openttd/lang/romanian.lng
|
||||
%{_gamesdatadir}/openttd/lang/slovak.lng
|
||||
%{_gamesdatadir}/openttd/lang/spanish.lng
|
||||
%{_gamesdatadir}/openttd/lang/swedish.lng
|
||||
|
||||
%{_gamesdatadir}/openttd/data/autorail.grf
|
||||
%{_gamesdatadir}/openttd/data/canalsw.grf
|
||||
%{_gamesdatadir}/openttd/data/openttd.grf
|
||||
%{_gamesdatadir}/openttd/data/opntitle.dat
|
||||
%{_gamesdatadir}/openttd/data/signalsw.grf
|
||||
%{_gamesdatadir}/openttd/data/trkfoundw.grf
|
||||
|
||||
"%{_gamesdatadir}/openttd/scenario/Linkgame Islands 2004.scn"
|
||||
"%{_gamesdatadir}/openttd/scenario/Mountain Pass.scn"
|
||||
"%{_gamesdatadir}/openttd/scenario/Volcano City.scn"
|
||||
|
||||
%{_menudir}/%{name}
|
||||
%{_iconsdir}/*.png
|
||||
%{_miconsdir}/*.png
|
||||
%{_liconsdir}/*.png
|
||||
|
||||
%doc changelog.txt readme.txt COPYING os/linux/README.urpmi
|
||||
|
||||
#------------------------------------------------------------------------------
|
||||
# Change Log
|
||||
#------------------------------------------------------------------------------
|
||||
%changelog
|
||||
* Sun Jan 23 2005 Dominik Scherer <dominik@openttd.com> 0.3.6-1mdk
|
||||
- Upgraded to 0.3.6
|
||||
- Structured and commented the spec file a bit (inspired by ScummVM)
|
||||
|
||||
* Fri Dec 24 2004 Dominik Scherer <dominik@openttd.com> 0.3.5-1mdk
|
||||
- Upgraded to 0.3.5
|
||||
- Added a warning message about the additional required files (only displayed when installing via urpmi)
|
||||
|
||||
* Wed Sep 15 2004 Dominik Scherer <> 0.3.4-1mdk
|
||||
- Upgraded to 0.3.4
|
||||
|
||||
* Wed Jul 31 2004 Dominik Scherer <> 0.3.3-1mdk
|
||||
- Initial release
|
75
os/rpm/openttd.spec
Normal file
75
os/rpm/openttd.spec
Normal file
@@ -0,0 +1,75 @@
|
||||
#
|
||||
# spec file for package openttd (trunk)
|
||||
#
|
||||
# Copyright (c) 2007 The OpenTTD team.
|
||||
# This file and all modifications and additions to the pristine
|
||||
# package are under the same license as the package itself
|
||||
#
|
||||
Name: openttd
|
||||
Version: svn
|
||||
Release: head
|
||||
Group: Applications/Games
|
||||
Source: %{name}-%{version}-%{release}.tar.gz
|
||||
License: GPL
|
||||
URL: http://www.openttd.org
|
||||
Packager: Denis Burlaka <burlaka@yandex.ru>
|
||||
Summary: OpenTTD is an Open Source clone of Chris Sawyer's Transport Tycoon Deluxe
|
||||
Requires: SDL zlib libpng freetype2 fontconfig
|
||||
BuildRequires: gcc SDL-devel zlib-devel libpng-devel fontconfig-devel
|
||||
%if %{_vendor}=="suse"
|
||||
BuildRequires: freetype2-devel
|
||||
%endif
|
||||
%if %{_vendor}=="fedora"
|
||||
BuildRequires: freetype-devel
|
||||
%endif
|
||||
%if %{_vendor}=="mandriva"
|
||||
BuildRequires: libfreetype6-devel
|
||||
%endif
|
||||
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-buildroot
|
||||
Prefix: /usr
|
||||
|
||||
%description
|
||||
OpenTTD is a clone of the Microprose game "Transport Tycoon Deluxe", a popular game originally written by Chris Sawyer. It attempts to mimic the original game as closely as possible while extending it with new features.
|
||||
|
||||
OpenTTD is licensed under the GNU General Public License version 2.0. For more information, see the file 'COPYING' included with every release and source download of the game.
|
||||
|
||||
%prep
|
||||
%setup
|
||||
|
||||
%build
|
||||
./configure --prefix-dir=%{prefix} --binary-dir=bin --install-dir="$RPM_BUILD_ROOT"
|
||||
make
|
||||
|
||||
%install
|
||||
make ROOT="$RPM_BUILD_ROOT" install
|
||||
|
||||
mkdir -p $RPM_BUILD_ROOT/%{_datadir}/applications
|
||||
cat << EOF > $RPM_BUILD_ROOT/%{_datadir}/applications/%{name}.desktop
|
||||
[Desktop Entry]
|
||||
Categories=Games;
|
||||
Encoding=UTF-8
|
||||
Exec=/usr/bin/openttd
|
||||
Name=OpenTTD
|
||||
Icon=openttd.32
|
||||
Terminal=false
|
||||
Type=Application
|
||||
EOF
|
||||
|
||||
%clean
|
||||
rm -Rf "$RPM_BUILD_ROOT"
|
||||
|
||||
%files
|
||||
%dir %{_datadir}/games/%{name}
|
||||
%dir %{_datadir}/games/%{name}/lang
|
||||
%dir %{_datadir}/games/%{name}/data
|
||||
%dir %{_datadir}/games/%{name}/gm
|
||||
%dir %{_datadir}/games/%{name}/docs
|
||||
%dir %{_datadir}/pixmaps
|
||||
%defattr(644, root, games, 755)
|
||||
%attr(755, root, games) %{_bindir}/%{name}
|
||||
%{_datadir}/games/%{name}/lang/*
|
||||
%{_datadir}/games/%{name}/data/*
|
||||
%{_datadir}/games/%{name}/docs/*
|
||||
%{_datadir}/pixmaps/*
|
||||
%{_datadir}/applications/%{name}.desktop
|
||||
|
Binary file not shown.
@@ -1,9 +1,9 @@
|
||||
!define APPNAME "OpenTTD" ; Define application name
|
||||
!define APPVERSION "0.6.0" ; Define application version
|
||||
!define INSTALLERVERSION 40 ; NEED TO UPDATE THIS FOR EVERY RELEASE!!!
|
||||
!define APPVERSION "0.6.2" ; Define application version
|
||||
!define INSTALLERVERSION 50 ; NEED TO UPDATE THIS FOR EVERY RELEASE!!!
|
||||
|
||||
!define APPURLLINK "http://www.openttd.org"
|
||||
!define APPNAMEANDVERSION "${APPNAME} ${APPVERSION}-beta1"
|
||||
!define APPNAMEANDVERSION "${APPNAME} ${APPVERSION}"
|
||||
!define APPVERSIONINTERNAL "${APPVERSION}.0" ; Needs to be of the format X.X.X.X
|
||||
|
||||
!define MUI_ICON "..\..\..\media\openttd.ico"
|
||||
@@ -97,8 +97,6 @@ Section "!OpenTTD" Section1
|
||||
; Overwrite files by default, but don't complain on failure
|
||||
SetOverwrite try
|
||||
|
||||
; Make savegame folder
|
||||
SetOutPath "$INSTDIR\save"
|
||||
; Define root variable relative to installer
|
||||
!define PATH_ROOT "..\..\..\"
|
||||
|
||||
|
83
projects/determineversion.vbs
Normal file → Executable file
83
projects/determineversion.vbs
Normal file → Executable file
@@ -53,6 +53,43 @@ Sub UpdateFiles(version)
|
||||
UpdateFile revision, version, cur_date, "../src/ottdres.rc"
|
||||
End Sub
|
||||
|
||||
Function ReadRegistryKey(shive, subkey, valuename, architecture)
|
||||
Dim hiveKey, objCtx, objLocator, objServices, objReg, Inparams, Outparams
|
||||
|
||||
' First, get the Registry Provider for the requested architecture
|
||||
Set objCtx = CreateObject("WbemScripting.SWbemNamedValueSet")
|
||||
objCtx.Add "__ProviderArchitecture", architecture ' Must be 64 of 32
|
||||
Set objLocator = CreateObject("Wbemscripting.SWbemLocator")
|
||||
Set objServices = objLocator.ConnectServer("","root\default","","",,,,objCtx)
|
||||
Set objReg = objServices.Get("StdRegProv")
|
||||
|
||||
' Check the hive and give it the right value
|
||||
Select Case shive
|
||||
Case "HKCR", "HKEY_CLASSES_ROOT"
|
||||
hiveKey = &h80000000
|
||||
Case "HKCU", "HKEY_CURRENT_USER"
|
||||
hiveKey = &H80000001
|
||||
Case "HKLM", "HKEY_LOCAL_MACHINE"
|
||||
hiveKey = &h80000002
|
||||
Case "HKU", "HKEY_USERS"
|
||||
hiveKey = &h80000003
|
||||
Case "HKCC", "HKEY_CURRENT_CONFIG"
|
||||
hiveKey = &h80000005
|
||||
Case "HKDD", "HKEY_DYN_DATA" ' Only valid for Windows 95/98
|
||||
hiveKey = &h80000006
|
||||
Case Else
|
||||
MsgBox "Hive not valid (ReadRegistryKey)"
|
||||
End Select
|
||||
|
||||
Set Inparams = objReg.Methods_("GetStringValue").Inparameters
|
||||
Inparams.Hdefkey = hiveKey
|
||||
Inparams.Ssubkeyname = subkey
|
||||
Inparams.Svaluename = valuename
|
||||
Set Outparams = objReg.ExecMethod_("GetStringValue", Inparams,,objCtx)
|
||||
|
||||
ReadRegistryKey = Outparams.SValue
|
||||
End Function
|
||||
|
||||
Function DetermineSVNVersion()
|
||||
Dim WshShell, version, url, oExec, line
|
||||
Set WshShell = CreateObject("WScript.Shell")
|
||||
@@ -61,27 +98,35 @@ Function DetermineSVNVersion()
|
||||
' Try TortoiseSVN
|
||||
' Get the directory where TortoiseSVN (should) reside(s)
|
||||
Dim sTortoise
|
||||
sTortoise = WshShell.RegRead("HKLM\SOFTWARE\TortoiseSVN\Directory")
|
||||
' First, try with 32-bit architecture
|
||||
sTortoise = ReadRegistryKey("HKLM", "SOFTWARE\TortoiseSVN", "Directory", 32)
|
||||
If sTortoise = Nothing Then
|
||||
' No 32-bit version of TortoiseSVN installed, try 64-bit version (doesn't hurt on 32-bit machines, it returns nothing or is ignored)
|
||||
sTortoise = ReadRegistryKey("HKLM", "SOFTWARE\TortoiseSVN", "Directory", 64)
|
||||
End If
|
||||
|
||||
Dim file
|
||||
' Write some "magic" to a temporary file so we can acquire the svn revision/state
|
||||
Set file = FSO.CreateTextFile("tsvn_tmp", -1, 0)
|
||||
file.WriteLine "r$WCREV$$WCMODS?M:$"
|
||||
file.WriteLine "$WCURL$"
|
||||
file.Close
|
||||
Set oExec = WshShell.Exec(sTortoise & "\bin\SubWCRev.exe ../src tsvn_tmp tsvn_tmp")
|
||||
' Wait till the application is finished ...
|
||||
Do
|
||||
OExec.StdOut.ReadLine()
|
||||
Loop While Not OExec.StdOut.atEndOfStream
|
||||
' If TortoiseSVN is installed, try to get the revision number
|
||||
If sTortoise <> Nothing Then
|
||||
Dim file
|
||||
' Write some "magic" to a temporary file so we can acquire the svn revision/state
|
||||
Set file = FSO.CreateTextFile("tsvn_tmp", -1, 0)
|
||||
file.WriteLine "r$WCREV$$WCMODS?M:$"
|
||||
file.WriteLine "$WCURL$"
|
||||
file.Close
|
||||
Set oExec = WshShell.Exec(sTortoise & "\bin\SubWCRev.exe ../src tsvn_tmp tsvn_tmp")
|
||||
' Wait till the application is finished ...
|
||||
Do
|
||||
OExec.StdOut.ReadLine()
|
||||
Loop While Not OExec.StdOut.atEndOfStream
|
||||
|
||||
Set file = FSO.OpenTextFile("tsvn_tmp", 1, 0, 0)
|
||||
version = file.ReadLine
|
||||
url = file.ReadLine
|
||||
file.Close
|
||||
Set file = FSO.OpenTextFile("tsvn_tmp", 1, 0, 0)
|
||||
version = file.ReadLine
|
||||
url = file.ReadLine
|
||||
file.Close
|
||||
|
||||
Set file = FSO.GetFile("tsvn_tmp")
|
||||
file.Delete
|
||||
Set file = FSO.GetFile("tsvn_tmp")
|
||||
file.Delete
|
||||
End If
|
||||
|
||||
' Looks like there is no TortoiseSVN installed either. Then we don't know it.
|
||||
If InStr(version, "$") Then
|
||||
@@ -194,7 +239,7 @@ Function IsCachedVersion(version)
|
||||
End Function
|
||||
|
||||
Dim version
|
||||
version = "0.6.0-beta2"
|
||||
version = "0.6.2-RC2"
|
||||
If Not (IsCachedVersion(version) And FSO.FileExists("../src/rev.cpp") And FSO.FileExists("../src/ottdres.rc")) Then
|
||||
UpdateFiles version
|
||||
End If
|
||||
|
@@ -25,13 +25,6 @@ fi
|
||||
# langs_vs80.vcproj is for MSVC 2005
|
||||
# strgen_vs80.vcproj is for MSVC 2005
|
||||
|
||||
# openttd.sln is for MSVC 2003
|
||||
# openttd.vcproj is for MSVC 2003
|
||||
# langs.vcproj is for MSVC 2003
|
||||
# strgen.vcproj is for MSVC 2003
|
||||
|
||||
# openttd.tgt is for WatCom
|
||||
|
||||
|
||||
|
||||
# First, collect the list of Windows files
|
||||
@@ -110,7 +103,7 @@ load_main_data() {
|
||||
|
||||
print " <Filter";
|
||||
print " Name=\\""$0"\\"";
|
||||
print " Filter=\\"\\">";
|
||||
print " >";
|
||||
}
|
||||
|
||||
next;
|
||||
@@ -121,7 +114,8 @@ load_main_data() {
|
||||
gsub(" ", "", $0);
|
||||
gsub("/", "\\\\", $0);
|
||||
print " <File";
|
||||
print " RelativePath=\\".\\\\'$file_prefix'"$0"\\">";
|
||||
print " RelativePath=\\".\\\\'$file_prefix'"$0"\\"";
|
||||
print " >";
|
||||
print " </File>";
|
||||
}
|
||||
}
|
||||
@@ -138,15 +132,18 @@ load_lang_data() {
|
||||
i=`basename $i | sed s/.txt$//g`
|
||||
RES="$RES
|
||||
<File
|
||||
RelativePath=\"..\\src\\lang\\"$i".txt\">
|
||||
RelativePath=\"..\\src\\lang\\"$i".txt\"
|
||||
>
|
||||
<FileConfiguration
|
||||
Name=\"Debug|Win32\">
|
||||
Name=\"Debug|Win32\"
|
||||
>
|
||||
<Tool
|
||||
Name=\"VCCustomBuildTool\"
|
||||
Description=\"Generating "$i" language file\"
|
||||
CommandLine=\"..\\objs\\strgen\\strgen.exe -s ..\\src\\lang -d ..\\bin\\lang "\$(InputPath)"
\"
|
||||
AdditionalDependencies=\"\"
|
||||
Outputs=\"..\\bin\\lang\\"$i".lng\"/>
|
||||
Outputs=\"..\\bin\\lang\\"$i".lng\"
|
||||
/>
|
||||
</FileConfiguration>
|
||||
</File>"
|
||||
done
|
||||
@@ -165,22 +162,7 @@ generate() {
|
||||
}
|
||||
' > "$ROOT_DIR/projects/$2"
|
||||
|
||||
# The files-list
|
||||
echo "$1" | awk -v type="$3" '
|
||||
/
/ {
|
||||
if (type == "msvc2003") gsub("
", "\n", $0);
|
||||
}
|
||||
/Filter="">/ {
|
||||
if (type == "msvc2005") gsub("Filter=\"\">", ">", $0);
|
||||
}
|
||||
/"\/>/ {
|
||||
if (type == "msvc2005") gsub("/>", "\n" substr($0, 1, index($0, $1) - 2) "/>", $0);
|
||||
}
|
||||
/">/ {
|
||||
if (type == "msvc2005") gsub(">", "\n" substr($0, 1, index($0, $1) - 1) ">", $0);
|
||||
}
|
||||
{ print $0 }
|
||||
' >> "$ROOT_DIR/projects/$2"
|
||||
echo "$1" >> "$ROOT_DIR/projects/$2"
|
||||
|
||||
# Everything below the !!FILES!! marker
|
||||
cat "$ROOT_DIR/projects/$2".in | tr '\r' '\n' | awk '
|
||||
@@ -199,9 +181,7 @@ safety_check "$ROOT_DIR/source.list"
|
||||
load_main_data "$ROOT_DIR/source.list" openttd
|
||||
load_lang_data "$ROOT_DIR/src/lang/*.txt" lang
|
||||
|
||||
generate "$openttd" "openttd.vcproj" "msvc2003"
|
||||
generate "$openttd" "openttd_vs80.vcproj" "msvc2005"
|
||||
generate "$openttd" "openttd_vs90.vcproj" "msvc2005"
|
||||
generate "$lang" "langs.vcproj" "msvc2003"
|
||||
generate "$lang" "langs_vs80.vcproj" "msvc2005"
|
||||
generate "$lang" "langs_vs90.vcproj" "msvc2005"
|
||||
generate "$openttd" "openttd_vs80.vcproj"
|
||||
generate "$openttd" "openttd_vs90.vcproj"
|
||||
generate "$lang" "langs_vs80.vcproj"
|
||||
generate "$lang" "langs_vs90.vcproj"
|
||||
|
183
projects/generate.vbs
Executable file
183
projects/generate.vbs
Executable file
@@ -0,0 +1,183 @@
|
||||
Option Explicit
|
||||
|
||||
Dim FSO
|
||||
Set FSO = CreateObject("Scripting.FileSystemObject")
|
||||
|
||||
' openttd_vs90.sln is for MSVC 2008
|
||||
' openttd_vs90.vcproj is for MSVC 2008
|
||||
' langs_vs90.vcproj is for MSVC 2008
|
||||
' strgen_vs90.vcproj is for MSVC 2008
|
||||
|
||||
' openttd_vs80.sln is for MSVC 2005
|
||||
' openttd_vs80.vcproj is for MSVC 2005
|
||||
' langs_vs80.vcproj is for MSVC 2005
|
||||
' strgen_vs80.vcproj is for MSVC 2005
|
||||
|
||||
Sub safety_check(filename)
|
||||
Dim file, line, regexp, list
|
||||
|
||||
' Define regexp
|
||||
Set regexp = New RegExp
|
||||
regexp.Pattern = "#|ottdres.rc|win32.cpp|win32_v.cpp"
|
||||
regexp.Global = True
|
||||
|
||||
' We use a dictionary to check duplicates
|
||||
Set list = CreateObject("Scripting.Dictionary")
|
||||
|
||||
Set file = FSO.OpenTextFile(filename, 1, 0, 0)
|
||||
While Not file.AtEndOfStream
|
||||
line = Replace(file.ReadLine, Chr(9), "") ' Remove tabs
|
||||
If Len(line) > 0 And Not regexp.Test(line) Then
|
||||
line = FSO.GetFileName(line)
|
||||
if list.Exists(line) Then
|
||||
WScript.Echo " !! ERROR !!" _
|
||||
& vbCrLf & "" _
|
||||
& vbCrLf & "The filename '" & line & "' is already used in this project." _
|
||||
& vbCrLf & "Because MSVC uses one single directory for all object files, it" _
|
||||
& vbCrLf & "cannot handle filenames with the same name inside the same project." _
|
||||
& vbCrLf & "Please rename either one of the file and try generating again." _
|
||||
& vbCrLf & "" _
|
||||
& vbCrLf & " !! ERROR !!"
|
||||
WScript.Quit(1)
|
||||
End If
|
||||
list.Add line, line
|
||||
End If
|
||||
Wend
|
||||
file.Close
|
||||
End Sub
|
||||
|
||||
Function load_main_data(filename)
|
||||
Dim res, file, line, deep, skip, first_time
|
||||
res = ""
|
||||
' Read the source.list and process it
|
||||
Set file = FSO.OpenTextFile(filename, 1, 0, 0)
|
||||
While Not file.AtEndOfStream
|
||||
line = Replace(file.ReadLine, Chr(9), "") ' Remove tabs
|
||||
If Len(line) > 0 Then
|
||||
Select Case Split(line, " ")(0)
|
||||
Case "#end"
|
||||
If deep = skip Then skip = skip - 1
|
||||
deep = deep - 1
|
||||
Case "#else"
|
||||
If deep = skip Then
|
||||
skip = skip - 1
|
||||
ElseIf deep - 1 = skip Then
|
||||
skip = skip + 1
|
||||
End If
|
||||
Case "#if"
|
||||
line = Replace(line, "#if ", "")
|
||||
If deep = skip And ( _
|
||||
line = "SDL" Or _
|
||||
line = "PNG" Or _
|
||||
line = "WIN32" Or _
|
||||
line = "MSVC" Or _
|
||||
line = "DIRECTMUSIC" Or _
|
||||
line = "NO_THREADS" _
|
||||
) Then skip = skip + 1
|
||||
deep = deep + 1
|
||||
Case "#"
|
||||
if deep = skip Then
|
||||
line = Replace(line, "# ", "")
|
||||
if first_time <> 0 Then
|
||||
res = res & " </Filter>" & vbCrLf
|
||||
Else
|
||||
first_time = 1
|
||||
End If
|
||||
res = res & _
|
||||
" <Filter" & vbCrLf & _
|
||||
" Name=" & Chr(34) & line & Chr(34) & vbCrLf & _
|
||||
" >" & vbCrLf
|
||||
End If
|
||||
Case Else
|
||||
If deep = skip Then
|
||||
line = Replace(line, "/" ,"\")
|
||||
res = res & _
|
||||
" <File" & vbCrLf & _
|
||||
" RelativePath=" & Chr(34) & ".\..\src\" & line & Chr(34) & vbCrLf & _
|
||||
" >" & vbCrLf & _
|
||||
" </File>" & vbCrLf
|
||||
End If
|
||||
End Select
|
||||
End If
|
||||
Wend
|
||||
res = res & " </Filter>"
|
||||
file.Close()
|
||||
load_main_data = res
|
||||
End Function
|
||||
|
||||
Function load_lang_data(dir)
|
||||
Dim res, folder, file
|
||||
res = ""
|
||||
Set folder = FSO.GetFolder(dir)
|
||||
For Each file In folder.Files
|
||||
file = FSO.GetFileName(file)
|
||||
If FSO.GetExtensionName(file) = "txt" Then
|
||||
file = Left(file, Len(file) - 4)
|
||||
res = res _
|
||||
& vbCrLf & " <File" _
|
||||
& vbCrLf & " RelativePath=" & Chr(34) & "..\src\lang\" & file & ".txt" & Chr(34) _
|
||||
& vbCrLf & " >" _
|
||||
& vbCrLf & " <FileConfiguration" _
|
||||
& vbCrLf & " Name=" & Chr(34) & "Debug|Win32" & Chr(34) _
|
||||
& vbCrLf & " >" _
|
||||
& vbCrLf & " <Tool" _
|
||||
& vbCrLf & " Name=" & Chr(34) & "VCCustomBuildTool" & Chr(34) _
|
||||
& vbCrLf & " Description=" & Chr(34) & "Generating " & file & " language file" & Chr(34) _
|
||||
& vbCrLf & " CommandLine=" & Chr(34) & "..\objs\strgen\strgen.exe -s ..\src\lang -d ..\bin\lang "$(InputPath)"
" & Chr(34) _
|
||||
& vbCrLf & " AdditionalDependencies=" & Chr(34) & Chr(34) _
|
||||
& vbCrLf & " Outputs=" & Chr(34) & "..\bin\lang\" & file & ".lng" & Chr(34) _
|
||||
& vbCrLf & " />" _
|
||||
& vbCrLf & " </FileConfiguration>" _
|
||||
& vbCrLf & " </File>"
|
||||
End If
|
||||
Next
|
||||
load_lang_data = res
|
||||
End Function
|
||||
|
||||
Sub generate(data, dest)
|
||||
Dim srcfile, destfile, line
|
||||
WScript.Echo "Generating " & FSO.GetFileName(dest) & "..."
|
||||
Set srcfile = FSO.OpenTextFile(dest & ".in", 1, 0, 0)
|
||||
Set destfile = FSO.CreateTextFile(dest, -1, 0)
|
||||
|
||||
' Everything above the !!FILES!! marker
|
||||
line = srcfile.ReadLine()
|
||||
While line <> "!!FILES!!"
|
||||
If len(line) > 0 Then destfile.WriteLine(line)
|
||||
line = srcfile.ReadLine()
|
||||
Wend
|
||||
|
||||
' Our generated content
|
||||
destfile.WriteLine(data)
|
||||
|
||||
' Everything below the !!FILES!! marker
|
||||
While Not srcfile.AtEndOfStream
|
||||
line = srcfile.ReadLine()
|
||||
If len(line) > 0 Then destfile.WriteLine(line)
|
||||
Wend
|
||||
srcfile.Close()
|
||||
destfile.Close()
|
||||
End Sub
|
||||
|
||||
Dim ROOT_DIR
|
||||
ROOT_DIR = FSO.GetFolder("..").Path
|
||||
If Not FSO.FileExists(ROOT_DIR & "/source.list") Then
|
||||
ROOT_DIR = FSO.GetFolder(".").Path
|
||||
End If
|
||||
If Not FSO.FileExists(ROOT_DIR & "/source.list") Then
|
||||
WScript.Echo "Can't find source.list, needed in order to make this run." _
|
||||
& vbCrLf & "Please go to either the project dir, or the root dir of a clean SVN checkout."
|
||||
WScript.Quit(1)
|
||||
End If
|
||||
|
||||
safety_check ROOT_DIR & "/source.list"
|
||||
|
||||
Dim openttd
|
||||
openttd = load_main_data(ROOT_DIR &"/source.list")
|
||||
generate openttd, ROOT_DIR & "/projects/openttd_vs80.vcproj"
|
||||
generate openttd, ROOT_DIR & "/projects/openttd_vs90.vcproj"
|
||||
|
||||
Dim lang
|
||||
lang = load_lang_data(ROOT_DIR & "/src/lang")
|
||||
generate lang, ROOT_DIR & "/projects/langs_vs80.vcproj"
|
||||
generate lang, ROOT_DIR & "/projects/langs_vs90.vcproj"
|
@@ -1,538 +0,0 @@
|
||||
<?xml version="1.0" encoding="Windows-1252"?>
|
||||
<VisualStudioProject
|
||||
ProjectType="Visual C++"
|
||||
Version="7.10"
|
||||
Name="langs"
|
||||
ProjectGUID="{0F066B23-18DF-4284-8265-F4A5E7E3B966}"
|
||||
RootNamespace="langs"
|
||||
SccProjectName=""
|
||||
SccLocalPath=""
|
||||
Keyword="MakeFileProj">
|
||||
<Platforms>
|
||||
<Platform
|
||||
Name="Win32"/>
|
||||
</Platforms>
|
||||
<Configurations>
|
||||
<Configuration
|
||||
Name="Debug|Win32"
|
||||
OutputDirectory="..\bin\lang\"
|
||||
IntermediateDirectory="..\objs\langs\"
|
||||
ConfigurationType="10"
|
||||
UseOfMFC="0"
|
||||
ATLMinimizesCRunTimeLibraryUsage="FALSE">
|
||||
<Tool
|
||||
Name="VCCustomBuildTool"/>
|
||||
<Tool
|
||||
Name="VCMIDLTool"
|
||||
TypeLibraryName="./langs.tlb"
|
||||
HeaderFileName=""/>
|
||||
<Tool
|
||||
Name="VCPostBuildEventTool"/>
|
||||
<Tool
|
||||
Name="VCPreBuildEventTool"
|
||||
Description="Generating strings.h"
|
||||
CommandLine="..\objs\strgen\strgen.exe -s ..\src\lang -d ..\objs\langs\table"/>
|
||||
</Configuration>
|
||||
</Configurations>
|
||||
<References>
|
||||
</References>
|
||||
<Files>
|
||||
|
||||
<File
|
||||
RelativePath="..\src\lang\afrikaans.txt">
|
||||
<FileConfiguration
|
||||
Name="Debug|Win32">
|
||||
<Tool
|
||||
Name="VCCustomBuildTool"
|
||||
Description="Generating afrikaans language file"
|
||||
CommandLine="..\objs\strgen\strgen.exe -s ..\src\lang -d ..\bin\lang "$(InputPath)"
|
||||
"
|
||||
AdditionalDependencies=""
|
||||
Outputs="..\bin\lang\afrikaans.lng"/>
|
||||
</FileConfiguration>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\src\lang\american.txt">
|
||||
<FileConfiguration
|
||||
Name="Debug|Win32">
|
||||
<Tool
|
||||
Name="VCCustomBuildTool"
|
||||
Description="Generating american language file"
|
||||
CommandLine="..\objs\strgen\strgen.exe -s ..\src\lang -d ..\bin\lang "$(InputPath)"
|
||||
"
|
||||
AdditionalDependencies=""
|
||||
Outputs="..\bin\lang\american.lng"/>
|
||||
</FileConfiguration>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\src\lang\brazilian_portuguese.txt">
|
||||
<FileConfiguration
|
||||
Name="Debug|Win32">
|
||||
<Tool
|
||||
Name="VCCustomBuildTool"
|
||||
Description="Generating brazilian_portuguese language file"
|
||||
CommandLine="..\objs\strgen\strgen.exe -s ..\src\lang -d ..\bin\lang "$(InputPath)"
|
||||
"
|
||||
AdditionalDependencies=""
|
||||
Outputs="..\bin\lang\brazilian_portuguese.lng"/>
|
||||
</FileConfiguration>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\src\lang\bulgarian.txt">
|
||||
<FileConfiguration
|
||||
Name="Debug|Win32">
|
||||
<Tool
|
||||
Name="VCCustomBuildTool"
|
||||
Description="Generating bulgarian language file"
|
||||
CommandLine="..\objs\strgen\strgen.exe -s ..\src\lang -d ..\bin\lang "$(InputPath)"
|
||||
"
|
||||
AdditionalDependencies=""
|
||||
Outputs="..\bin\lang\bulgarian.lng"/>
|
||||
</FileConfiguration>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\src\lang\catalan.txt">
|
||||
<FileConfiguration
|
||||
Name="Debug|Win32">
|
||||
<Tool
|
||||
Name="VCCustomBuildTool"
|
||||
Description="Generating catalan language file"
|
||||
CommandLine="..\objs\strgen\strgen.exe -s ..\src\lang -d ..\bin\lang "$(InputPath)"
|
||||
"
|
||||
AdditionalDependencies=""
|
||||
Outputs="..\bin\lang\catalan.lng"/>
|
||||
</FileConfiguration>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\src\lang\croatian.txt">
|
||||
<FileConfiguration
|
||||
Name="Debug|Win32">
|
||||
<Tool
|
||||
Name="VCCustomBuildTool"
|
||||
Description="Generating croatian language file"
|
||||
CommandLine="..\objs\strgen\strgen.exe -s ..\src\lang -d ..\bin\lang "$(InputPath)"
|
||||
"
|
||||
AdditionalDependencies=""
|
||||
Outputs="..\bin\lang\croatian.lng"/>
|
||||
</FileConfiguration>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\src\lang\czech.txt">
|
||||
<FileConfiguration
|
||||
Name="Debug|Win32">
|
||||
<Tool
|
||||
Name="VCCustomBuildTool"
|
||||
Description="Generating czech language file"
|
||||
CommandLine="..\objs\strgen\strgen.exe -s ..\src\lang -d ..\bin\lang "$(InputPath)"
|
||||
"
|
||||
AdditionalDependencies=""
|
||||
Outputs="..\bin\lang\czech.lng"/>
|
||||
</FileConfiguration>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\src\lang\danish.txt">
|
||||
<FileConfiguration
|
||||
Name="Debug|Win32">
|
||||
<Tool
|
||||
Name="VCCustomBuildTool"
|
||||
Description="Generating danish language file"
|
||||
CommandLine="..\objs\strgen\strgen.exe -s ..\src\lang -d ..\bin\lang "$(InputPath)"
|
||||
"
|
||||
AdditionalDependencies=""
|
||||
Outputs="..\bin\lang\danish.lng"/>
|
||||
</FileConfiguration>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\src\lang\dutch.txt">
|
||||
<FileConfiguration
|
||||
Name="Debug|Win32">
|
||||
<Tool
|
||||
Name="VCCustomBuildTool"
|
||||
Description="Generating dutch language file"
|
||||
CommandLine="..\objs\strgen\strgen.exe -s ..\src\lang -d ..\bin\lang "$(InputPath)"
|
||||
"
|
||||
AdditionalDependencies=""
|
||||
Outputs="..\bin\lang\dutch.lng"/>
|
||||
</FileConfiguration>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\src\lang\english.txt">
|
||||
<FileConfiguration
|
||||
Name="Debug|Win32">
|
||||
<Tool
|
||||
Name="VCCustomBuildTool"
|
||||
Description="Generating english language file"
|
||||
CommandLine="..\objs\strgen\strgen.exe -s ..\src\lang -d ..\bin\lang "$(InputPath)"
|
||||
"
|
||||
AdditionalDependencies=""
|
||||
Outputs="..\bin\lang\english.lng"/>
|
||||
</FileConfiguration>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\src\lang\esperanto.txt">
|
||||
<FileConfiguration
|
||||
Name="Debug|Win32">
|
||||
<Tool
|
||||
Name="VCCustomBuildTool"
|
||||
Description="Generating esperanto language file"
|
||||
CommandLine="..\objs\strgen\strgen.exe -s ..\src\lang -d ..\bin\lang "$(InputPath)"
|
||||
"
|
||||
AdditionalDependencies=""
|
||||
Outputs="..\bin\lang\esperanto.lng"/>
|
||||
</FileConfiguration>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\src\lang\estonian.txt">
|
||||
<FileConfiguration
|
||||
Name="Debug|Win32">
|
||||
<Tool
|
||||
Name="VCCustomBuildTool"
|
||||
Description="Generating estonian language file"
|
||||
CommandLine="..\objs\strgen\strgen.exe -s ..\src\lang -d ..\bin\lang "$(InputPath)"
|
||||
"
|
||||
AdditionalDependencies=""
|
||||
Outputs="..\bin\lang\estonian.lng"/>
|
||||
</FileConfiguration>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\src\lang\finnish.txt">
|
||||
<FileConfiguration
|
||||
Name="Debug|Win32">
|
||||
<Tool
|
||||
Name="VCCustomBuildTool"
|
||||
Description="Generating finnish language file"
|
||||
CommandLine="..\objs\strgen\strgen.exe -s ..\src\lang -d ..\bin\lang "$(InputPath)"
|
||||
"
|
||||
AdditionalDependencies=""
|
||||
Outputs="..\bin\lang\finnish.lng"/>
|
||||
</FileConfiguration>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\src\lang\french.txt">
|
||||
<FileConfiguration
|
||||
Name="Debug|Win32">
|
||||
<Tool
|
||||
Name="VCCustomBuildTool"
|
||||
Description="Generating french language file"
|
||||
CommandLine="..\objs\strgen\strgen.exe -s ..\src\lang -d ..\bin\lang "$(InputPath)"
|
||||
"
|
||||
AdditionalDependencies=""
|
||||
Outputs="..\bin\lang\french.lng"/>
|
||||
</FileConfiguration>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\src\lang\galician.txt">
|
||||
<FileConfiguration
|
||||
Name="Debug|Win32">
|
||||
<Tool
|
||||
Name="VCCustomBuildTool"
|
||||
Description="Generating galician language file"
|
||||
CommandLine="..\objs\strgen\strgen.exe -s ..\src\lang -d ..\bin\lang "$(InputPath)"
|
||||
"
|
||||
AdditionalDependencies=""
|
||||
Outputs="..\bin\lang\galician.lng"/>
|
||||
</FileConfiguration>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\src\lang\german.txt">
|
||||
<FileConfiguration
|
||||
Name="Debug|Win32">
|
||||
<Tool
|
||||
Name="VCCustomBuildTool"
|
||||
Description="Generating german language file"
|
||||
CommandLine="..\objs\strgen\strgen.exe -s ..\src\lang -d ..\bin\lang "$(InputPath)"
|
||||
"
|
||||
AdditionalDependencies=""
|
||||
Outputs="..\bin\lang\german.lng"/>
|
||||
</FileConfiguration>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\src\lang\hungarian.txt">
|
||||
<FileConfiguration
|
||||
Name="Debug|Win32">
|
||||
<Tool
|
||||
Name="VCCustomBuildTool"
|
||||
Description="Generating hungarian language file"
|
||||
CommandLine="..\objs\strgen\strgen.exe -s ..\src\lang -d ..\bin\lang "$(InputPath)"
|
||||
"
|
||||
AdditionalDependencies=""
|
||||
Outputs="..\bin\lang\hungarian.lng"/>
|
||||
</FileConfiguration>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\src\lang\icelandic.txt">
|
||||
<FileConfiguration
|
||||
Name="Debug|Win32">
|
||||
<Tool
|
||||
Name="VCCustomBuildTool"
|
||||
Description="Generating icelandic language file"
|
||||
CommandLine="..\objs\strgen\strgen.exe -s ..\src\lang -d ..\bin\lang "$(InputPath)"
|
||||
"
|
||||
AdditionalDependencies=""
|
||||
Outputs="..\bin\lang\icelandic.lng"/>
|
||||
</FileConfiguration>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\src\lang\italian.txt">
|
||||
<FileConfiguration
|
||||
Name="Debug|Win32">
|
||||
<Tool
|
||||
Name="VCCustomBuildTool"
|
||||
Description="Generating italian language file"
|
||||
CommandLine="..\objs\strgen\strgen.exe -s ..\src\lang -d ..\bin\lang "$(InputPath)"
|
||||
"
|
||||
AdditionalDependencies=""
|
||||
Outputs="..\bin\lang\italian.lng"/>
|
||||
</FileConfiguration>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\src\lang\japanese.txt">
|
||||
<FileConfiguration
|
||||
Name="Debug|Win32">
|
||||
<Tool
|
||||
Name="VCCustomBuildTool"
|
||||
Description="Generating japanese language file"
|
||||
CommandLine="..\objs\strgen\strgen.exe -s ..\src\lang -d ..\bin\lang "$(InputPath)"
|
||||
"
|
||||
AdditionalDependencies=""
|
||||
Outputs="..\bin\lang\japanese.lng"/>
|
||||
</FileConfiguration>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\src\lang\korean.txt">
|
||||
<FileConfiguration
|
||||
Name="Debug|Win32">
|
||||
<Tool
|
||||
Name="VCCustomBuildTool"
|
||||
Description="Generating korean language file"
|
||||
CommandLine="..\objs\strgen\strgen.exe -s ..\src\lang -d ..\bin\lang "$(InputPath)"
|
||||
"
|
||||
AdditionalDependencies=""
|
||||
Outputs="..\bin\lang\korean.lng"/>
|
||||
</FileConfiguration>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\src\lang\lithuanian.txt">
|
||||
<FileConfiguration
|
||||
Name="Debug|Win32">
|
||||
<Tool
|
||||
Name="VCCustomBuildTool"
|
||||
Description="Generating lithuanian language file"
|
||||
CommandLine="..\objs\strgen\strgen.exe -s ..\src\lang -d ..\bin\lang "$(InputPath)"
|
||||
"
|
||||
AdditionalDependencies=""
|
||||
Outputs="..\bin\lang\lithuanian.lng"/>
|
||||
</FileConfiguration>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\src\lang\norwegian_bokmal.txt">
|
||||
<FileConfiguration
|
||||
Name="Debug|Win32">
|
||||
<Tool
|
||||
Name="VCCustomBuildTool"
|
||||
Description="Generating norwegian_bokmal language file"
|
||||
CommandLine="..\objs\strgen\strgen.exe -s ..\src\lang -d ..\bin\lang "$(InputPath)"
|
||||
"
|
||||
AdditionalDependencies=""
|
||||
Outputs="..\bin\lang\norwegian_bokmal.lng"/>
|
||||
</FileConfiguration>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\src\lang\norwegian_nynorsk.txt">
|
||||
<FileConfiguration
|
||||
Name="Debug|Win32">
|
||||
<Tool
|
||||
Name="VCCustomBuildTool"
|
||||
Description="Generating norwegian_nynorsk language file"
|
||||
CommandLine="..\objs\strgen\strgen.exe -s ..\src\lang -d ..\bin\lang "$(InputPath)"
|
||||
"
|
||||
AdditionalDependencies=""
|
||||
Outputs="..\bin\lang\norwegian_nynorsk.lng"/>
|
||||
</FileConfiguration>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\src\lang\origveh.txt">
|
||||
<FileConfiguration
|
||||
Name="Debug|Win32">
|
||||
<Tool
|
||||
Name="VCCustomBuildTool"
|
||||
Description="Generating origveh language file"
|
||||
CommandLine="..\objs\strgen\strgen.exe -s ..\src\lang -d ..\bin\lang "$(InputPath)"
|
||||
"
|
||||
AdditionalDependencies=""
|
||||
Outputs="..\bin\lang\origveh.lng"/>
|
||||
</FileConfiguration>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\src\lang\piglatin.txt">
|
||||
<FileConfiguration
|
||||
Name="Debug|Win32">
|
||||
<Tool
|
||||
Name="VCCustomBuildTool"
|
||||
Description="Generating piglatin language file"
|
||||
CommandLine="..\objs\strgen\strgen.exe -s ..\src\lang -d ..\bin\lang "$(InputPath)"
|
||||
"
|
||||
AdditionalDependencies=""
|
||||
Outputs="..\bin\lang\piglatin.lng"/>
|
||||
</FileConfiguration>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\src\lang\polish.txt">
|
||||
<FileConfiguration
|
||||
Name="Debug|Win32">
|
||||
<Tool
|
||||
Name="VCCustomBuildTool"
|
||||
Description="Generating polish language file"
|
||||
CommandLine="..\objs\strgen\strgen.exe -s ..\src\lang -d ..\bin\lang "$(InputPath)"
|
||||
"
|
||||
AdditionalDependencies=""
|
||||
Outputs="..\bin\lang\polish.lng"/>
|
||||
</FileConfiguration>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\src\lang\portuguese.txt">
|
||||
<FileConfiguration
|
||||
Name="Debug|Win32">
|
||||
<Tool
|
||||
Name="VCCustomBuildTool"
|
||||
Description="Generating portuguese language file"
|
||||
CommandLine="..\objs\strgen\strgen.exe -s ..\src\lang -d ..\bin\lang "$(InputPath)"
|
||||
"
|
||||
AdditionalDependencies=""
|
||||
Outputs="..\bin\lang\portuguese.lng"/>
|
||||
</FileConfiguration>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\src\lang\romanian.txt">
|
||||
<FileConfiguration
|
||||
Name="Debug|Win32">
|
||||
<Tool
|
||||
Name="VCCustomBuildTool"
|
||||
Description="Generating romanian language file"
|
||||
CommandLine="..\objs\strgen\strgen.exe -s ..\src\lang -d ..\bin\lang "$(InputPath)"
|
||||
"
|
||||
AdditionalDependencies=""
|
||||
Outputs="..\bin\lang\romanian.lng"/>
|
||||
</FileConfiguration>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\src\lang\russian.txt">
|
||||
<FileConfiguration
|
||||
Name="Debug|Win32">
|
||||
<Tool
|
||||
Name="VCCustomBuildTool"
|
||||
Description="Generating russian language file"
|
||||
CommandLine="..\objs\strgen\strgen.exe -s ..\src\lang -d ..\bin\lang "$(InputPath)"
|
||||
"
|
||||
AdditionalDependencies=""
|
||||
Outputs="..\bin\lang\russian.lng"/>
|
||||
</FileConfiguration>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\src\lang\simplified_chinese.txt">
|
||||
<FileConfiguration
|
||||
Name="Debug|Win32">
|
||||
<Tool
|
||||
Name="VCCustomBuildTool"
|
||||
Description="Generating simplified_chinese language file"
|
||||
CommandLine="..\objs\strgen\strgen.exe -s ..\src\lang -d ..\bin\lang "$(InputPath)"
|
||||
"
|
||||
AdditionalDependencies=""
|
||||
Outputs="..\bin\lang\simplified_chinese.lng"/>
|
||||
</FileConfiguration>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\src\lang\slovak.txt">
|
||||
<FileConfiguration
|
||||
Name="Debug|Win32">
|
||||
<Tool
|
||||
Name="VCCustomBuildTool"
|
||||
Description="Generating slovak language file"
|
||||
CommandLine="..\objs\strgen\strgen.exe -s ..\src\lang -d ..\bin\lang "$(InputPath)"
|
||||
"
|
||||
AdditionalDependencies=""
|
||||
Outputs="..\bin\lang\slovak.lng"/>
|
||||
</FileConfiguration>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\src\lang\slovenian.txt">
|
||||
<FileConfiguration
|
||||
Name="Debug|Win32">
|
||||
<Tool
|
||||
Name="VCCustomBuildTool"
|
||||
Description="Generating slovenian language file"
|
||||
CommandLine="..\objs\strgen\strgen.exe -s ..\src\lang -d ..\bin\lang "$(InputPath)"
|
||||
"
|
||||
AdditionalDependencies=""
|
||||
Outputs="..\bin\lang\slovenian.lng"/>
|
||||
</FileConfiguration>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\src\lang\spanish.txt">
|
||||
<FileConfiguration
|
||||
Name="Debug|Win32">
|
||||
<Tool
|
||||
Name="VCCustomBuildTool"
|
||||
Description="Generating spanish language file"
|
||||
CommandLine="..\objs\strgen\strgen.exe -s ..\src\lang -d ..\bin\lang "$(InputPath)"
|
||||
"
|
||||
AdditionalDependencies=""
|
||||
Outputs="..\bin\lang\spanish.lng"/>
|
||||
</FileConfiguration>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\src\lang\swedish.txt">
|
||||
<FileConfiguration
|
||||
Name="Debug|Win32">
|
||||
<Tool
|
||||
Name="VCCustomBuildTool"
|
||||
Description="Generating swedish language file"
|
||||
CommandLine="..\objs\strgen\strgen.exe -s ..\src\lang -d ..\bin\lang "$(InputPath)"
|
||||
"
|
||||
AdditionalDependencies=""
|
||||
Outputs="..\bin\lang\swedish.lng"/>
|
||||
</FileConfiguration>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\src\lang\traditional_chinese.txt">
|
||||
<FileConfiguration
|
||||
Name="Debug|Win32">
|
||||
<Tool
|
||||
Name="VCCustomBuildTool"
|
||||
Description="Generating traditional_chinese language file"
|
||||
CommandLine="..\objs\strgen\strgen.exe -s ..\src\lang -d ..\bin\lang "$(InputPath)"
|
||||
"
|
||||
AdditionalDependencies=""
|
||||
Outputs="..\bin\lang\traditional_chinese.lng"/>
|
||||
</FileConfiguration>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\src\lang\turkish.txt">
|
||||
<FileConfiguration
|
||||
Name="Debug|Win32">
|
||||
<Tool
|
||||
Name="VCCustomBuildTool"
|
||||
Description="Generating turkish language file"
|
||||
CommandLine="..\objs\strgen\strgen.exe -s ..\src\lang -d ..\bin\lang "$(InputPath)"
|
||||
"
|
||||
AdditionalDependencies=""
|
||||
Outputs="..\bin\lang\turkish.lng"/>
|
||||
</FileConfiguration>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\src\lang\ukrainian.txt">
|
||||
<FileConfiguration
|
||||
Name="Debug|Win32">
|
||||
<Tool
|
||||
Name="VCCustomBuildTool"
|
||||
Description="Generating ukrainian language file"
|
||||
CommandLine="..\objs\strgen\strgen.exe -s ..\src\lang -d ..\bin\lang "$(InputPath)"
|
||||
"
|
||||
AdditionalDependencies=""
|
||||
Outputs="..\bin\lang\ukrainian.lng"/>
|
||||
</FileConfiguration>
|
||||
</File>
|
||||
</Files>
|
||||
<Globals>
|
||||
</Globals>
|
||||
</VisualStudioProject>
|
@@ -1,44 +0,0 @@
|
||||
<?xml version="1.0" encoding="Windows-1252"?>
|
||||
<VisualStudioProject
|
||||
ProjectType="Visual C++"
|
||||
Version="7.10"
|
||||
Name="langs"
|
||||
ProjectGUID="{0F066B23-18DF-4284-8265-F4A5E7E3B966}"
|
||||
RootNamespace="langs"
|
||||
SccProjectName=""
|
||||
SccLocalPath=""
|
||||
Keyword="MakeFileProj">
|
||||
<Platforms>
|
||||
<Platform
|
||||
Name="Win32"/>
|
||||
</Platforms>
|
||||
<Configurations>
|
||||
<Configuration
|
||||
Name="Debug|Win32"
|
||||
OutputDirectory="..\bin\lang\"
|
||||
IntermediateDirectory="..\objs\langs\"
|
||||
ConfigurationType="10"
|
||||
UseOfMFC="0"
|
||||
ATLMinimizesCRunTimeLibraryUsage="FALSE">
|
||||
<Tool
|
||||
Name="VCCustomBuildTool"/>
|
||||
<Tool
|
||||
Name="VCMIDLTool"
|
||||
TypeLibraryName="./langs.tlb"
|
||||
HeaderFileName=""/>
|
||||
<Tool
|
||||
Name="VCPostBuildEventTool"/>
|
||||
<Tool
|
||||
Name="VCPreBuildEventTool"
|
||||
Description="Generating strings.h"
|
||||
CommandLine="..\objs\strgen\strgen.exe -s ..\src\lang -d ..\objs\langs\table"/>
|
||||
</Configuration>
|
||||
</Configurations>
|
||||
<References>
|
||||
</References>
|
||||
<Files>
|
||||
!!FILES!!
|
||||
</Files>
|
||||
<Globals>
|
||||
</Globals>
|
||||
</VisualStudioProject>
|
@@ -61,21 +61,6 @@
|
||||
/>
|
||||
</FileConfiguration>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\src\lang\american.txt"
|
||||
>
|
||||
<FileConfiguration
|
||||
Name="Debug|Win32"
|
||||
>
|
||||
<Tool
|
||||
Name="VCCustomBuildTool"
|
||||
Description="Generating american language file"
|
||||
CommandLine="..\objs\strgen\strgen.exe -s ..\src\lang -d ..\bin\lang "$(InputPath)"
"
|
||||
AdditionalDependencies=""
|
||||
Outputs="..\bin\lang\american.lng"
|
||||
/>
|
||||
</FileConfiguration>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\src\lang\brazilian_portuguese.txt"
|
||||
>
|
||||
@@ -196,6 +181,21 @@
|
||||
/>
|
||||
</FileConfiguration>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\src\lang\english_US.txt"
|
||||
>
|
||||
<FileConfiguration
|
||||
Name="Debug|Win32"
|
||||
>
|
||||
<Tool
|
||||
Name="VCCustomBuildTool"
|
||||
Description="Generating english_US language file"
|
||||
CommandLine="..\objs\strgen\strgen.exe -s ..\src\lang -d ..\bin\lang "$(InputPath)"
"
|
||||
AdditionalDependencies=""
|
||||
Outputs="..\bin\lang\english_US.lng"
|
||||
/>
|
||||
</FileConfiguration>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\src\lang\esperanto.txt"
|
||||
>
|
||||
|
@@ -62,21 +62,6 @@
|
||||
/>
|
||||
</FileConfiguration>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\src\lang\american.txt"
|
||||
>
|
||||
<FileConfiguration
|
||||
Name="Debug|Win32"
|
||||
>
|
||||
<Tool
|
||||
Name="VCCustomBuildTool"
|
||||
Description="Generating american language file"
|
||||
CommandLine="..\objs\strgen\strgen.exe -s ..\src\lang -d ..\bin\lang "$(InputPath)"
"
|
||||
AdditionalDependencies=""
|
||||
Outputs="..\bin\lang\american.lng"
|
||||
/>
|
||||
</FileConfiguration>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\src\lang\brazilian_portuguese.txt"
|
||||
>
|
||||
@@ -197,6 +182,21 @@
|
||||
/>
|
||||
</FileConfiguration>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\src\lang\english_US.txt"
|
||||
>
|
||||
<FileConfiguration
|
||||
Name="Debug|Win32"
|
||||
>
|
||||
<Tool
|
||||
Name="VCCustomBuildTool"
|
||||
Description="Generating english_US language file"
|
||||
CommandLine="..\objs\strgen\strgen.exe -s ..\src\lang -d ..\bin\lang "$(InputPath)"
"
|
||||
AdditionalDependencies=""
|
||||
Outputs="..\bin\lang\english_US.lng"
|
||||
/>
|
||||
</FileConfiguration>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\src\lang\esperanto.txt"
|
||||
>
|
||||
|
@@ -1,43 +0,0 @@
|
||||
Microsoft Visual Studio Solution File, Format Version 8.00
|
||||
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "openttd", "openttd.vcproj", "{668328A0-B40E-4CDB-BD72-D0064424414A}"
|
||||
ProjectSection(ProjectDependencies) = postProject
|
||||
{0F066B23-18DF-4284-8265-F4A5E7E3B966} = {0F066B23-18DF-4284-8265-F4A5E7E3B966}
|
||||
{A133A442-BD0A-4ADE-B117-AD7545E4BDD1} = {A133A442-BD0A-4ADE-B117-AD7545E4BDD1}
|
||||
EndProjectSection
|
||||
EndProject
|
||||
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "strgen", "strgen.vcproj", "{A133A442-BD0A-4ADE-B117-AD7545E4BDD1}"
|
||||
ProjectSection(ProjectDependencies) = postProject
|
||||
EndProjectSection
|
||||
EndProject
|
||||
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "langs", "langs.vcproj", "{0F066B23-18DF-4284-8265-F4A5E7E3B966}"
|
||||
ProjectSection(ProjectDependencies) = postProject
|
||||
{A133A442-BD0A-4ADE-B117-AD7545E4BDD1} = {A133A442-BD0A-4ADE-B117-AD7545E4BDD1}
|
||||
EndProjectSection
|
||||
EndProject
|
||||
Global
|
||||
GlobalSection(SolutionConfiguration) = preSolution
|
||||
Debug = Debug
|
||||
Release = Release
|
||||
EndGlobalSection
|
||||
GlobalSection(ProjectConfiguration) = postSolution
|
||||
{668328A0-B40E-4CDB-BD72-D0064424414A}.Debug.ActiveCfg = Debug|Win32
|
||||
{668328A0-B40E-4CDB-BD72-D0064424414A}.Debug.Build.0 = Debug|Win32
|
||||
{668328A0-B40E-4CDB-BD72-D0064424414A}.Release.ActiveCfg = Release|Win32
|
||||
{668328A0-B40E-4CDB-BD72-D0064424414A}.Release.Build.0 = Release|Win32
|
||||
{A133A442-BD0A-4ADE-B117-AD7545E4BDD1}.Debug.ActiveCfg = Release|Win32
|
||||
{A133A442-BD0A-4ADE-B117-AD7545E4BDD1}.Debug.Build.0 = Release|Win32
|
||||
{A133A442-BD0A-4ADE-B117-AD7545E4BDD1}.Release.ActiveCfg = Release|Win32
|
||||
{A133A442-BD0A-4ADE-B117-AD7545E4BDD1}.Release.Build.0 = Release|Win32
|
||||
{0F066B23-18DF-4284-8265-F4A5E7E3B966}.Debug.ActiveCfg = Debug|Win32
|
||||
{0F066B23-18DF-4284-8265-F4A5E7E3B966}.Debug.Build.0 = Debug|Win32
|
||||
{0F066B23-18DF-4284-8265-F4A5E7E3B966}.Release.ActiveCfg = Debug|Win32
|
||||
{0F066B23-18DF-4284-8265-F4A5E7E3B966}.Release.Build.0 = Debug|Win32
|
||||
EndGlobalSection
|
||||
GlobalSection(ExtensibilityGlobals) = postSolution
|
||||
EndGlobalSection
|
||||
GlobalSection(ExtensibilityAddIns) = postSolution
|
||||
EndGlobalSection
|
||||
GlobalSection(DPCodeReviewSolutionGUID) = preSolution
|
||||
DPCodeReviewSolutionGUID = {00000000-0000-0000-0000-000000000000}
|
||||
EndGlobalSection
|
||||
EndGlobal
|
2667
projects/openttd.tgt
2667
projects/openttd.tgt
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
@@ -1,177 +0,0 @@
|
||||
<?xml version="1.0" encoding="Windows-1252"?>
|
||||
<VisualStudioProject
|
||||
ProjectType="Visual C++"
|
||||
Version="7.10"
|
||||
Name="openttd"
|
||||
RootNamespace="openttd"
|
||||
SccProjectName=""
|
||||
SccLocalPath="">
|
||||
<Platforms>
|
||||
<Platform
|
||||
Name="Win32"/>
|
||||
</Platforms>
|
||||
<Configurations>
|
||||
<Configuration
|
||||
Name="Release|Win32"
|
||||
OutputDirectory="..\objs\$(PlatformName)\$(ConfigurationName)"
|
||||
IntermediateDirectory="..\objs\$(PlatformName)\$(ConfigurationName)"
|
||||
ConfigurationType="1"
|
||||
UseOfMFC="0"
|
||||
ATLMinimizesCRunTimeLibraryUsage="FALSE"
|
||||
CharacterSet="1"
|
||||
WholeProgramOptimization="TRUE">
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
Optimization="3"
|
||||
GlobalOptimizations="TRUE"
|
||||
InlineFunctionExpansion="2"
|
||||
EnableIntrinsicFunctions="TRUE"
|
||||
FavorSizeOrSpeed="2"
|
||||
OmitFramePointers="TRUE"
|
||||
OptimizeForProcessor="1"
|
||||
AdditionalIncludeDirectories="..\objs\langs"
|
||||
PreprocessorDefinitions="WIN32;NDEBUG;_CONSOLE;WIN32_EXCEPTION_TRACKER;WIN32_ENABLE_DIRECTMUSIC_SUPPORT;WITH_ZLIB;WITH_PNG;WITH_FREETYPE;ENABLE_NETWORK;WITH_PERSONAL_DIR;PERSONAL_DIR=\"OpenTTD\";WITH_ASSERT"
|
||||
StringPooling="TRUE"
|
||||
ExceptionHandling="TRUE"
|
||||
RuntimeLibrary="0"
|
||||
StructMemberAlignment="3"
|
||||
BufferSecurityCheck="FALSE"
|
||||
EnableFunctionLevelLinking="TRUE"
|
||||
DefaultCharIsUnsigned="TRUE"
|
||||
UsePrecompiledHeader="0"
|
||||
PrecompiledHeaderThrough=""
|
||||
PrecompiledHeaderFile=""
|
||||
AssemblerOutput="2"
|
||||
AssemblerListingLocation="$(IntDir)/"
|
||||
ObjectFile="$(IntDir)/"
|
||||
ProgramDataBaseFileName="$(IntDir)/$(TargetName).pdb"
|
||||
BrowseInformation="1"
|
||||
BrowseInformationFile="$(IntDir)/"
|
||||
WarningLevel="3"
|
||||
WarnAsError="TRUE"
|
||||
SuppressStartupBanner="TRUE"
|
||||
DebugInformationFormat="3"
|
||||
CallingConvention="1"
|
||||
CompileAs="0"/>
|
||||
<Tool
|
||||
Name="VCCustomBuildTool"/>
|
||||
<Tool
|
||||
Name="VCLinkerTool"
|
||||
AdditionalDependencies="winmm.lib ws2_32.lib libpng.lib zlibstat.lib dxguid.lib libfreetype2.lib"
|
||||
LinkIncremental="1"
|
||||
SuppressStartupBanner="TRUE"
|
||||
IgnoreDefaultLibraryNames=""
|
||||
GenerateDebugInformation="TRUE"
|
||||
SubSystem="2"
|
||||
OptimizeReferences="2"
|
||||
OptimizeForWindows98="1"
|
||||
TargetMachine="1"/>
|
||||
<Tool
|
||||
Name="VCMIDLTool"
|
||||
TypeLibraryName=".\Release/openttd.tlb"
|
||||
HeaderFileName=""/>
|
||||
<Tool
|
||||
Name="VCPostBuildEventTool"/>
|
||||
<Tool
|
||||
Name="VCPreBuildEventTool"
|
||||
Description="Determining version number"
|
||||
CommandLine=""$(InputDir)/determineversion.vbs""/>
|
||||
<Tool
|
||||
Name="VCPreLinkEventTool"/>
|
||||
<Tool
|
||||
Name="VCResourceCompilerTool"
|
||||
PreprocessorDefinitions="NDEBUG"
|
||||
Culture="1053"/>
|
||||
<Tool
|
||||
Name="VCWebServiceProxyGeneratorTool"/>
|
||||
<Tool
|
||||
Name="VCXMLDataGeneratorTool"/>
|
||||
<Tool
|
||||
Name="VCWebDeploymentTool"/>
|
||||
<Tool
|
||||
Name="VCManagedWrapperGeneratorTool"/>
|
||||
<Tool
|
||||
Name="VCAuxiliaryManagedWrapperGeneratorTool"/>
|
||||
</Configuration>
|
||||
<Configuration
|
||||
Name="Debug|Win32"
|
||||
OutputDirectory="..\objs\$(PlatformName)\$(ConfigurationName)\"
|
||||
IntermediateDirectory="..\objs\$(PlatformName)\$(ConfigurationName)\"
|
||||
ConfigurationType="1"
|
||||
UseOfMFC="0"
|
||||
ATLMinimizesCRunTimeLibraryUsage="FALSE"
|
||||
CharacterSet="1">
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
Optimization="0"
|
||||
AdditionalIncludeDirectories="..\objs\langs"
|
||||
PreprocessorDefinitions="WIN32;_DEBUG;_CONSOLE;WIN32_ENABLE_DIRECTMUSIC_SUPPORT;WITH_ZLIB;WITH_PNG;WITH_FREETYPE;ENABLE_NETWORK;WITH_PERSONAL_DIR;PERSONAL_DIR=\"OpenTTD\""
|
||||
BasicRuntimeChecks="3"
|
||||
RuntimeLibrary="1"
|
||||
UsePrecompiledHeader="0"
|
||||
AssemblerListingLocation="$(IntDir)/"
|
||||
ObjectFile="$(IntDir)/"
|
||||
ProgramDataBaseFileName="$(IntDir)/$(TargetName).pdb"
|
||||
WarningLevel="3"
|
||||
WarnAsError="TRUE"
|
||||
SuppressStartupBanner="TRUE"
|
||||
Detect64BitPortabilityProblems="FALSE"
|
||||
DebugInformationFormat="4"
|
||||
CallingConvention="1"
|
||||
CompileAs="0"/>
|
||||
<Tool
|
||||
Name="VCCustomBuildTool"/>
|
||||
<Tool
|
||||
Name="VCLinkerTool"
|
||||
AdditionalDependencies="unicows.lib winmm.lib ws2_32.lib libpng.lib zlibstat.lib dxguid.lib libfreetype2.lib"
|
||||
LinkIncremental="0"
|
||||
SuppressStartupBanner="TRUE"
|
||||
IgnoreDefaultLibraryNames="LIBCMT.lib"
|
||||
GenerateDebugInformation="TRUE"
|
||||
SubSystem="2"
|
||||
TargetMachine="1"/>
|
||||
<Tool
|
||||
Name="VCMIDLTool"
|
||||
TypeLibraryName=".\Debug/openttd.tlb"
|
||||
HeaderFileName=""/>
|
||||
<Tool
|
||||
Name="VCPostBuildEventTool"/>
|
||||
<Tool
|
||||
Name="VCPreBuildEventTool"
|
||||
Description="Determining version number"
|
||||
CommandLine=""$(InputDir)/determineversion.vbs""/>
|
||||
<Tool
|
||||
Name="VCPreLinkEventTool"/>
|
||||
<Tool
|
||||
Name="VCResourceCompilerTool"
|
||||
PreprocessorDefinitions="_DEBUG"
|
||||
Culture="1053"/>
|
||||
<Tool
|
||||
Name="VCWebServiceProxyGeneratorTool"/>
|
||||
<Tool
|
||||
Name="VCXMLDataGeneratorTool"/>
|
||||
<Tool
|
||||
Name="VCWebDeploymentTool"/>
|
||||
<Tool
|
||||
Name="VCManagedWrapperGeneratorTool"/>
|
||||
<Tool
|
||||
Name="VCAuxiliaryManagedWrapperGeneratorTool"/>
|
||||
</Configuration>
|
||||
</Configurations>
|
||||
<References>
|
||||
</References>
|
||||
<Files>
|
||||
!!FILES!!
|
||||
<File
|
||||
RelativePath=".\..\media\mainicon.ico">
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\..\media\openttd.ico">
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\..\readme.txt">
|
||||
</File>
|
||||
</Files>
|
||||
<Globals>
|
||||
</Globals>
|
||||
</VisualStudioProject>
|
@@ -455,6 +455,10 @@
|
||||
RelativePath=".\..\src\airport.cpp"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\..\src\core\alloc_func.cpp"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\..\src\articulated_vehicles.cpp"
|
||||
>
|
||||
@@ -467,6 +471,10 @@
|
||||
RelativePath=".\..\src\aystar.cpp"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\..\src\core\bitmath_func.cpp"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\..\src\bmp.cpp"
|
||||
>
|
||||
@@ -495,14 +503,6 @@
|
||||
RelativePath=".\..\src\console_cmds.cpp"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\..\src\core\bitmath_func.cpp"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\..\src\core\random_func.cpp"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\..\src\currency.cpp"
|
||||
>
|
||||
@@ -527,6 +527,10 @@
|
||||
RelativePath=".\..\src\driver.cpp"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\..\src\widgets\dropdown.cpp"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\..\src\economy.cpp"
|
||||
>
|
||||
@@ -667,6 +671,10 @@
|
||||
RelativePath=".\..\src\rail.cpp"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\..\src\core\random_func.cpp"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\..\src\rev.cpp"
|
||||
>
|
||||
@@ -691,6 +699,10 @@
|
||||
RelativePath=".\..\src\settings.cpp"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\..\src\signal.cpp"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\..\src\signs.cpp"
|
||||
>
|
||||
@@ -728,7 +740,7 @@
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\..\src\tile.cpp"
|
||||
RelativePath=".\..\src\tile_map.cpp"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
@@ -771,10 +783,30 @@
|
||||
RelativePath=".\..\src\airport_movement.h"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\..\src\core\alloc_func.hpp"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\..\src\articulated_vehicles.h"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\..\src\autoreplace_base.h"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\..\src\autoreplace_func.h"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\..\src\autoreplace_gui.h"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\..\src\autoreplace_type.h"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\..\src\autoslope.h"
|
||||
>
|
||||
@@ -783,10 +815,26 @@
|
||||
RelativePath=".\..\src\aystar.h"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\..\src\core\bitmath_func.hpp"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\..\src\bmp.h"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\..\src\bridge.h"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\..\src\callback_table.h"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\..\src\cargo_type.h"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\..\src\cargopacket.h"
|
||||
>
|
||||
@@ -796,31 +844,31 @@
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\..\src\command.h"
|
||||
RelativePath=".\..\src\cmd_helper.h"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\..\src\command_func.h"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\..\src\command_type.h"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\..\src\console.h"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\..\src\core\bitmath_func.hpp"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\..\src\core\math_func.hpp"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\..\src\core\random_func.hpp"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\..\src\currency.h"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\..\src\date.h"
|
||||
RelativePath=".\..\src\date_func.h"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\..\src\date_type.h"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
@@ -836,7 +884,11 @@
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\..\src\direction.h"
|
||||
RelativePath=".\..\src\direction_func.h"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\..\src\direction_type.h"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
@@ -848,13 +900,33 @@
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\..\src\economy.h"
|
||||
RelativePath=".\..\src\widgets\dropdown_func.h"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\..\src\widgets\dropdown_type.h"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\..\src\economy_func.h"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\..\src\economy_type.h"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\..\src\core\endian_func.hpp"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\..\src\engine.h"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\..\src\core\enum_type.hpp"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\..\src\fileio.h"
|
||||
>
|
||||
@@ -876,7 +948,15 @@
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\..\src\gfx.h"
|
||||
RelativePath=".\..\src\core\geometry_type.hpp"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\..\src\gfx_func.h"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\..\src\gfx_type.h"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
@@ -887,6 +967,10 @@
|
||||
RelativePath=".\..\src\group.h"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\..\src\group_gui.h"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\..\src\gui.h"
|
||||
>
|
||||
@@ -896,11 +980,11 @@
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\..\src\helpers.hpp"
|
||||
RelativePath=".\..\src\industry.h"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\..\src\industry.h"
|
||||
RelativePath=".\..\src\industry_type.h"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
@@ -912,11 +996,7 @@
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\..\src\macros.h"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\..\src\map.h"
|
||||
RelativePath=".\..\src\core\math_func.hpp"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
@@ -951,6 +1031,10 @@
|
||||
RelativePath=".\..\src\network\network_gui.h"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\..\src\network\network_internal.h"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\..\src\network\network_server.h"
|
||||
>
|
||||
@@ -987,6 +1071,10 @@
|
||||
RelativePath=".\..\src\newgrf_engine.h"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\..\src\newgrf_generic.h"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\..\src\newgrf_house.h"
|
||||
>
|
||||
@@ -1055,18 +1143,38 @@
|
||||
RelativePath=".\..\src\openttd.h"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\..\src\order.h"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\..\src\core\overflowsafe_type.hpp"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\..\src\pathfind.h"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\..\src\player.h"
|
||||
RelativePath=".\..\src\player_base.h"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\..\src\player_face.h"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\..\src\player_func.h"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\..\src\player_gui.h"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\..\src\player_type.h"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\..\src\queue.h"
|
||||
>
|
||||
@@ -1075,10 +1183,42 @@
|
||||
RelativePath=".\..\src\rail.h"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\..\src\rail_gui.h"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\..\src\rail_type.h"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\..\src\core\random_func.hpp"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\..\src\road_cmd.h"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\..\src\road_func.h"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\..\src\road_gui.h"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\..\src\road_internal.h"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\..\src\road_type.h"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\..\src\roadveh.h"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\..\src\saveload.h"
|
||||
>
|
||||
@@ -1096,7 +1236,23 @@
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\..\src\settings.h"
|
||||
RelativePath=".\..\src\settings_func.h"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\..\src\settings_internal.h"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\..\src\settings_type.h"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\..\src\ship.h"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\..\src\signal_func.h"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
@@ -1104,11 +1260,19 @@
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\..\src\slope.h"
|
||||
RelativePath=".\..\src\slope_func.h"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\..\src\sound.h"
|
||||
RelativePath=".\..\src\slope_type.h"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\..\src\sound_func.h"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\..\src\sound_type.h"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
@@ -1132,7 +1296,27 @@
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\..\src\string.h"
|
||||
RelativePath=".\..\src\string_func.h"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\..\src\string_type.h"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\..\src\strings_func.h"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\..\src\strings_type.h"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\..\src\terraform_gui.h"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\..\src\textbuf_gui.h"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
@@ -1148,7 +1332,11 @@
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\..\src\tile.h"
|
||||
RelativePath=".\..\src\tile_cmd.h"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\..\src\tile_type.h"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
@@ -1159,6 +1347,18 @@
|
||||
RelativePath=".\..\src\town.h"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\..\src\town_type.h"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\..\src\track_func.h"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\..\src\track_type.h"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\..\src\train.h"
|
||||
>
|
||||
@@ -1171,12 +1371,24 @@
|
||||
RelativePath=".\..\src\transparency_gui.h"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\..\src\tunnelbridge.h"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\..\src\unmovable.h"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\..\src\variables.h"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\..\src\vehicle.h"
|
||||
RelativePath=".\..\src\vehicle_base.h"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\..\src\vehicle_func.h"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
@@ -1184,7 +1396,7 @@
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\..\src\viewport.h"
|
||||
RelativePath=".\..\src\vehicle_type.h"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
@@ -1204,11 +1416,23 @@
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\..\src\window.h"
|
||||
RelativePath=".\..\src\window_func.h"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\..\src\zoom.hpp"
|
||||
RelativePath=".\..\src\window_gui.h"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\..\src\window_type.h"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\..\src\zoom_func.h"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\..\src\zoom_type.h"
|
||||
>
|
||||
</File>
|
||||
</Filter>
|
||||
@@ -1415,6 +1639,10 @@
|
||||
RelativePath=".\..\src\station_cmd.cpp"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\..\src\terraform_cmd.cpp"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\..\src\timetable_cmd.cpp"
|
||||
>
|
||||
@@ -1504,7 +1732,7 @@
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\..\src\table\roadveh.h"
|
||||
RelativePath=".\..\src\table\roadveh_movement.h"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
@@ -1723,6 +1951,10 @@
|
||||
RelativePath=".\..\src\newgrf_engine.cpp"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\..\src\newgrf_generic.cpp"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\..\src\newgrf_house.cpp"
|
||||
>
|
||||
@@ -1799,6 +2031,10 @@
|
||||
RelativePath=".\..\src\station_map.h"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\..\src\tile_map.h"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\..\src\town_map.h"
|
||||
>
|
||||
@@ -1815,6 +2051,10 @@
|
||||
RelativePath=".\..\src\tunnel_map.h"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\..\src\tunnelbridge_map.h"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\..\src\unmovable_map.h"
|
||||
>
|
||||
@@ -1835,14 +2075,6 @@
|
||||
RelativePath=".\..\src\misc\array.hpp"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\..\src\misc\autocopyptr.hpp"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\..\src\misc\autoptr.hpp"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\..\src\misc\binaryheap.hpp"
|
||||
>
|
||||
@@ -1935,10 +2167,6 @@
|
||||
<Filter
|
||||
Name="YAPF"
|
||||
>
|
||||
<File
|
||||
RelativePath=".\..\src\yapf\follow_track.cpp"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\..\src\yapf\follow_track.hpp"
|
||||
>
|
||||
@@ -1963,10 +2191,6 @@
|
||||
RelativePath=".\..\src\yapf\yapf_base.hpp"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\..\src\yapf\yapf_common.cpp"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\..\src\yapf\yapf_common.hpp"
|
||||
>
|
||||
|
@@ -452,6 +452,10 @@
|
||||
RelativePath=".\..\src\airport.cpp"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\..\src\core\alloc_func.cpp"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\..\src\articulated_vehicles.cpp"
|
||||
>
|
||||
@@ -464,6 +468,10 @@
|
||||
RelativePath=".\..\src\aystar.cpp"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\..\src\core\bitmath_func.cpp"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\..\src\bmp.cpp"
|
||||
>
|
||||
@@ -492,14 +500,6 @@
|
||||
RelativePath=".\..\src\console_cmds.cpp"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\..\src\core\bitmath_func.cpp"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\..\src\core\random_func.cpp"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\..\src\currency.cpp"
|
||||
>
|
||||
@@ -524,6 +524,10 @@
|
||||
RelativePath=".\..\src\driver.cpp"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\..\src\widgets\dropdown.cpp"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\..\src\economy.cpp"
|
||||
>
|
||||
@@ -664,6 +668,10 @@
|
||||
RelativePath=".\..\src\rail.cpp"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\..\src\core\random_func.cpp"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\..\src\rev.cpp"
|
||||
>
|
||||
@@ -688,6 +696,10 @@
|
||||
RelativePath=".\..\src\settings.cpp"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\..\src\signal.cpp"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\..\src\signs.cpp"
|
||||
>
|
||||
@@ -725,7 +737,7 @@
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\..\src\tile.cpp"
|
||||
RelativePath=".\..\src\tile_map.cpp"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
@@ -768,10 +780,30 @@
|
||||
RelativePath=".\..\src\airport_movement.h"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\..\src\core\alloc_func.hpp"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\..\src\articulated_vehicles.h"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\..\src\autoreplace_base.h"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\..\src\autoreplace_func.h"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\..\src\autoreplace_gui.h"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\..\src\autoreplace_type.h"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\..\src\autoslope.h"
|
||||
>
|
||||
@@ -780,10 +812,26 @@
|
||||
RelativePath=".\..\src\aystar.h"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\..\src\core\bitmath_func.hpp"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\..\src\bmp.h"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\..\src\bridge.h"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\..\src\callback_table.h"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\..\src\cargo_type.h"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\..\src\cargopacket.h"
|
||||
>
|
||||
@@ -793,31 +841,31 @@
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\..\src\command.h"
|
||||
RelativePath=".\..\src\cmd_helper.h"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\..\src\command_func.h"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\..\src\command_type.h"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\..\src\console.h"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\..\src\core\bitmath_func.hpp"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\..\src\core\math_func.hpp"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\..\src\core\random_func.hpp"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\..\src\currency.h"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\..\src\date.h"
|
||||
RelativePath=".\..\src\date_func.h"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\..\src\date_type.h"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
@@ -833,7 +881,11 @@
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\..\src\direction.h"
|
||||
RelativePath=".\..\src\direction_func.h"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\..\src\direction_type.h"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
@@ -845,13 +897,33 @@
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\..\src\economy.h"
|
||||
RelativePath=".\..\src\widgets\dropdown_func.h"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\..\src\widgets\dropdown_type.h"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\..\src\economy_func.h"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\..\src\economy_type.h"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\..\src\core\endian_func.hpp"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\..\src\engine.h"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\..\src\core\enum_type.hpp"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\..\src\fileio.h"
|
||||
>
|
||||
@@ -873,7 +945,15 @@
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\..\src\gfx.h"
|
||||
RelativePath=".\..\src\core\geometry_type.hpp"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\..\src\gfx_func.h"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\..\src\gfx_type.h"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
@@ -884,6 +964,10 @@
|
||||
RelativePath=".\..\src\group.h"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\..\src\group_gui.h"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\..\src\gui.h"
|
||||
>
|
||||
@@ -893,11 +977,11 @@
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\..\src\helpers.hpp"
|
||||
RelativePath=".\..\src\industry.h"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\..\src\industry.h"
|
||||
RelativePath=".\..\src\industry_type.h"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
@@ -909,11 +993,7 @@
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\..\src\macros.h"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\..\src\map.h"
|
||||
RelativePath=".\..\src\core\math_func.hpp"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
@@ -948,6 +1028,10 @@
|
||||
RelativePath=".\..\src\network\network_gui.h"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\..\src\network\network_internal.h"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\..\src\network\network_server.h"
|
||||
>
|
||||
@@ -984,6 +1068,10 @@
|
||||
RelativePath=".\..\src\newgrf_engine.h"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\..\src\newgrf_generic.h"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\..\src\newgrf_house.h"
|
||||
>
|
||||
@@ -1052,18 +1140,38 @@
|
||||
RelativePath=".\..\src\openttd.h"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\..\src\order.h"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\..\src\core\overflowsafe_type.hpp"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\..\src\pathfind.h"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\..\src\player.h"
|
||||
RelativePath=".\..\src\player_base.h"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\..\src\player_face.h"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\..\src\player_func.h"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\..\src\player_gui.h"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\..\src\player_type.h"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\..\src\queue.h"
|
||||
>
|
||||
@@ -1072,10 +1180,42 @@
|
||||
RelativePath=".\..\src\rail.h"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\..\src\rail_gui.h"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\..\src\rail_type.h"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\..\src\core\random_func.hpp"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\..\src\road_cmd.h"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\..\src\road_func.h"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\..\src\road_gui.h"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\..\src\road_internal.h"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\..\src\road_type.h"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\..\src\roadveh.h"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\..\src\saveload.h"
|
||||
>
|
||||
@@ -1093,7 +1233,23 @@
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\..\src\settings.h"
|
||||
RelativePath=".\..\src\settings_func.h"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\..\src\settings_internal.h"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\..\src\settings_type.h"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\..\src\ship.h"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\..\src\signal_func.h"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
@@ -1101,11 +1257,19 @@
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\..\src\slope.h"
|
||||
RelativePath=".\..\src\slope_func.h"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\..\src\sound.h"
|
||||
RelativePath=".\..\src\slope_type.h"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\..\src\sound_func.h"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\..\src\sound_type.h"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
@@ -1129,7 +1293,27 @@
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\..\src\string.h"
|
||||
RelativePath=".\..\src\string_func.h"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\..\src\string_type.h"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\..\src\strings_func.h"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\..\src\strings_type.h"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\..\src\terraform_gui.h"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\..\src\textbuf_gui.h"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
@@ -1145,7 +1329,11 @@
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\..\src\tile.h"
|
||||
RelativePath=".\..\src\tile_cmd.h"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\..\src\tile_type.h"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
@@ -1156,6 +1344,18 @@
|
||||
RelativePath=".\..\src\town.h"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\..\src\town_type.h"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\..\src\track_func.h"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\..\src\track_type.h"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\..\src\train.h"
|
||||
>
|
||||
@@ -1168,12 +1368,24 @@
|
||||
RelativePath=".\..\src\transparency_gui.h"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\..\src\tunnelbridge.h"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\..\src\unmovable.h"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\..\src\variables.h"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\..\src\vehicle.h"
|
||||
RelativePath=".\..\src\vehicle_base.h"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\..\src\vehicle_func.h"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
@@ -1181,7 +1393,7 @@
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\..\src\viewport.h"
|
||||
RelativePath=".\..\src\vehicle_type.h"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
@@ -1201,11 +1413,23 @@
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\..\src\window.h"
|
||||
RelativePath=".\..\src\window_func.h"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\..\src\zoom.hpp"
|
||||
RelativePath=".\..\src\window_gui.h"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\..\src\window_type.h"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\..\src\zoom_func.h"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\..\src\zoom_type.h"
|
||||
>
|
||||
</File>
|
||||
</Filter>
|
||||
@@ -1412,6 +1636,10 @@
|
||||
RelativePath=".\..\src\station_cmd.cpp"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\..\src\terraform_cmd.cpp"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\..\src\timetable_cmd.cpp"
|
||||
>
|
||||
@@ -1501,7 +1729,7 @@
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\..\src\table\roadveh.h"
|
||||
RelativePath=".\..\src\table\roadveh_movement.h"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
@@ -1720,6 +1948,10 @@
|
||||
RelativePath=".\..\src\newgrf_engine.cpp"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\..\src\newgrf_generic.cpp"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\..\src\newgrf_house.cpp"
|
||||
>
|
||||
@@ -1796,6 +2028,10 @@
|
||||
RelativePath=".\..\src\station_map.h"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\..\src\tile_map.h"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\..\src\town_map.h"
|
||||
>
|
||||
@@ -1812,6 +2048,10 @@
|
||||
RelativePath=".\..\src\tunnel_map.h"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\..\src\tunnelbridge_map.h"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\..\src\unmovable_map.h"
|
||||
>
|
||||
@@ -1832,14 +2072,6 @@
|
||||
RelativePath=".\..\src\misc\array.hpp"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\..\src\misc\autocopyptr.hpp"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\..\src\misc\autoptr.hpp"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\..\src\misc\binaryheap.hpp"
|
||||
>
|
||||
@@ -1932,10 +2164,6 @@
|
||||
<Filter
|
||||
Name="YAPF"
|
||||
>
|
||||
<File
|
||||
RelativePath=".\..\src\yapf\follow_track.cpp"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\..\src\yapf\follow_track.hpp"
|
||||
>
|
||||
@@ -1960,10 +2188,6 @@
|
||||
RelativePath=".\..\src\yapf\yapf_base.hpp"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\..\src\yapf\yapf_common.cpp"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\..\src\yapf\yapf_common.hpp"
|
||||
>
|
||||
|
37
projects/openttd_vs90.vcproj.user
Normal file
37
projects/openttd_vs90.vcproj.user
Normal file
@@ -0,0 +1,37 @@
|
||||
<?xml version="1.0" encoding="Windows-1252"?>
|
||||
<VisualStudioUserFile
|
||||
ProjectType="Visual C++"
|
||||
Version="9.00"
|
||||
ShowAllFiles="false"
|
||||
>
|
||||
<Configurations>
|
||||
<Configuration
|
||||
Name="Release|Win32"
|
||||
>
|
||||
<DebugSettings
|
||||
WorkingDirectory="..\bin"
|
||||
/>
|
||||
</Configuration>
|
||||
<Configuration
|
||||
Name="Debug|Win32"
|
||||
>
|
||||
<DebugSettings
|
||||
WorkingDirectory="..\bin"
|
||||
/>
|
||||
</Configuration>
|
||||
<Configuration
|
||||
Name="Release|x64"
|
||||
>
|
||||
<DebugSettings
|
||||
WorkingDirectory="..\bin"
|
||||
/>
|
||||
</Configuration>
|
||||
<Configuration
|
||||
Name="Debug|x64"
|
||||
>
|
||||
<DebugSettings
|
||||
WorkingDirectory="..\bin"
|
||||
/>
|
||||
</Configuration>
|
||||
</Configurations>
|
||||
</VisualStudioUserFile>
|
@@ -1,101 +0,0 @@
|
||||
<?xml version="1.0" encoding="Windows-1252"?>
|
||||
<VisualStudioProject
|
||||
ProjectType="Visual C++"
|
||||
Version="7.10"
|
||||
Name="strgen"
|
||||
RootNamespace="strgen"
|
||||
SccProjectName=""
|
||||
SccLocalPath="">
|
||||
<Platforms>
|
||||
<Platform
|
||||
Name="Win32"/>
|
||||
</Platforms>
|
||||
<Configurations>
|
||||
<Configuration
|
||||
Name="Release|Win32"
|
||||
OutputDirectory="..\objs\strgen\"
|
||||
IntermediateDirectory="..\objs\strgen\"
|
||||
ConfigurationType="1"
|
||||
UseOfMFC="0"
|
||||
ATLMinimizesCRunTimeLibraryUsage="FALSE"
|
||||
CharacterSet="2">
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
Optimization="1"
|
||||
GlobalOptimizations="TRUE"
|
||||
FavorSizeOrSpeed="2"
|
||||
PreprocessorDefinitions="STRGEN;WIN32;NDEBUG;_CONSOLE"
|
||||
BasicRuntimeChecks="0"
|
||||
RuntimeLibrary="5"
|
||||
PrecompiledHeaderFile=""
|
||||
AssemblerOutput="2"
|
||||
AssemblerListingLocation="$(IntDir)"
|
||||
ObjectFile="$(IntDir)"
|
||||
ProgramDataBaseFileName="$(IntDir)\$(TargetName).pdb"
|
||||
WarningLevel="3"
|
||||
WarnAsError="TRUE"
|
||||
SuppressStartupBanner="TRUE"
|
||||
DebugInformationFormat="3"/>
|
||||
<Tool
|
||||
Name="VCCustomBuildTool"/>
|
||||
<Tool
|
||||
Name="VCLinkerTool"
|
||||
OutputFile="$(IntDir)\strgen.exe"
|
||||
LinkIncremental="1"
|
||||
SuppressStartupBanner="TRUE"
|
||||
GenerateDebugInformation="TRUE"
|
||||
ProgramDatabaseFile="$(IntDir)\strgen.pdb"
|
||||
SubSystem="1"
|
||||
TargetMachine="1"/>
|
||||
<Tool
|
||||
Name="VCMIDLTool"
|
||||
TypeLibraryName=".\Debug/strgen.tlb"
|
||||
HeaderFileName=""/>
|
||||
<Tool
|
||||
Name="VCPostBuildEventTool"/>
|
||||
<Tool
|
||||
Name="VCPreBuildEventTool"/>
|
||||
<Tool
|
||||
Name="VCPreLinkEventTool"/>
|
||||
<Tool
|
||||
Name="VCResourceCompilerTool"
|
||||
PreprocessorDefinitions="_DEBUG"
|
||||
Culture="1053"/>
|
||||
<Tool
|
||||
Name="VCWebServiceProxyGeneratorTool"/>
|
||||
<Tool
|
||||
Name="VCXMLDataGeneratorTool"/>
|
||||
<Tool
|
||||
Name="VCWebDeploymentTool"/>
|
||||
<Tool
|
||||
Name="VCManagedWrapperGeneratorTool"/>
|
||||
<Tool
|
||||
Name="VCAuxiliaryManagedWrapperGeneratorTool"/>
|
||||
</Configuration>
|
||||
</Configurations>
|
||||
<References>
|
||||
</References>
|
||||
<Files>
|
||||
<Filter
|
||||
Name="Source Files"
|
||||
Filter="cpp;c;cxx;rc;def;r;odl;idl;hpj;bat">
|
||||
<File
|
||||
RelativePath="..\src\strgen\strgen.cpp">
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\src\string.cpp">
|
||||
</File>
|
||||
</Filter>
|
||||
<File
|
||||
RelativePath="..\src\macros.h">
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\src\stdafx.h">
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\src\string.h">
|
||||
</File>
|
||||
</Files>
|
||||
<Globals>
|
||||
</Globals>
|
||||
</VisualStudioProject>
|
@@ -112,6 +112,10 @@
|
||||
Name="Source Files"
|
||||
Filter="cpp;c;cxx;rc;def;r;odl;idl;hpj;bat"
|
||||
>
|
||||
<File
|
||||
RelativePath="..\src\core\alloc_func.cpp"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\src\strgen\strgen.cpp"
|
||||
>
|
||||
@@ -122,7 +126,19 @@
|
||||
</File>
|
||||
</Filter>
|
||||
<File
|
||||
RelativePath="..\src\macros.h"
|
||||
RelativePath="..\src\core\alloc_func.hpp"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\src\table\control_codes.h"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\src\debug.h"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\src\core\endian_func.hpp"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
|
@@ -112,6 +112,10 @@
|
||||
Name="Source Files"
|
||||
Filter="cpp;c;cxx;rc;def;r;odl;idl;hpj;bat"
|
||||
>
|
||||
<File
|
||||
RelativePath="..\src\core\alloc_func.cpp"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\src\strgen\strgen.cpp"
|
||||
>
|
||||
@@ -122,7 +126,19 @@
|
||||
</File>
|
||||
</Filter>
|
||||
<File
|
||||
RelativePath="..\src\macros.h"
|
||||
RelativePath="..\src\core\alloc_func.hpp"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\src\table\control_codes.h"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\src\debug.h"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\src\core\endian_func.hpp"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
|
144
readme.txt
144
readme.txt
@@ -1,6 +1,6 @@
|
||||
OpenTTD README
|
||||
Last updated: 2007-12-09
|
||||
Release version: 0.6.0-beta2
|
||||
Last updated: 2008-07-25
|
||||
Release version: 0.6.2-RC2
|
||||
------------------------------------------------------------------------
|
||||
|
||||
|
||||
@@ -11,6 +11,9 @@ Table of Contents:
|
||||
* 2.1 Reporting Bugs
|
||||
3.0) Supported Platforms
|
||||
4.0) Installing and running OpenTTD
|
||||
* 4.1 (Required) 3rd party files
|
||||
* 4.2 OpenTTD directories
|
||||
* 4.3 Portable Installations (External Media)
|
||||
5.0) OpenTTD features
|
||||
6.0) Configuration File
|
||||
7.0) Compiling
|
||||
@@ -88,25 +91,100 @@ archive which you have to extract to a directory where you want OpenTTD to
|
||||
be installed, or you have downloaded an installer, which will automatically
|
||||
extract OpenTTD in the given directory.
|
||||
|
||||
Before you run OpenTTD, you need to put the game's datafiles into the data/
|
||||
subdirectory. You need the following files from the original version
|
||||
of TTD as OpenTTD makes use of the original TTD artwork. The Windows
|
||||
installer optionally can copy these files from your Transport Tycoon Deluxe
|
||||
CD-ROM.
|
||||
OpenTTD looks in multiple locations to find the required data files (described
|
||||
in section 4.2). Installing any 3rd party files into a "shared" location has
|
||||
the advantage that you only need to do this step once, rather than copying the
|
||||
data files into all OpenTTD versions you have.
|
||||
Savegames, screenshots, etc are saved relative to the config file (openttd.cfg)
|
||||
currently being used. This means that if you use a config file in one of the
|
||||
shared directories, savegames will reside in the save/ directory next to the
|
||||
openttd.cfg file there.
|
||||
If you want savegames and screenshots in the directory where the OpenTTD binary
|
||||
resides, simply have your config file in that location. But if you remove this
|
||||
config file, savegames will still be in this directory (see notes in section 4.2)
|
||||
|
||||
4.1) (Required) 3rd party files:
|
||||
---- ---------------------------
|
||||
|
||||
Before you run OpenTTD, you need to put the game's datafiles into a data/
|
||||
directory which can be located in various places addressed in the following
|
||||
section.
|
||||
As OpenTTD makes use of the original TTD artwork you will need the files listed
|
||||
below, which you can find on a Transport Tycoon Deluxe CD-ROM.
|
||||
The Windows installer optionally can copy these files from that CD-ROM.
|
||||
|
||||
List of the required files:
|
||||
sample.cat
|
||||
trg1r.grf
|
||||
trgcr.grf
|
||||
trghr.grf
|
||||
trgir.grf
|
||||
trgtr.grf
|
||||
- sample.cat
|
||||
- trg1r.grf
|
||||
- trgcr.grf
|
||||
- trghr.grf
|
||||
- trgir.grf
|
||||
- trgtr.grf
|
||||
|
||||
(Alternatively you can use the TTD GRF files from the DOS version: TRG1.GRF,
|
||||
TRGC.GRF, TRGH.GRF, TRGI.GRF, TRGT.GRF.
|
||||
Alternatively you can use the TTD GRF files from the DOS version:
|
||||
- TRG1.GRF
|
||||
- TRGC.GRF
|
||||
- TRGH.GRF
|
||||
- TRGI.GRF
|
||||
- TRGT.GRF
|
||||
|
||||
If you want music you need to copy the gm/ folder from Windows TTD into your
|
||||
OpenTTD folder, not your data folder.
|
||||
If you want the TTD music, copy the gm/ folder from the Windows version
|
||||
of TTD to your OpenTTD folder (not your data folder - also explained in
|
||||
the following sections).
|
||||
|
||||
Do NOT copy files included with OpenTTD into "shared" directories (explained in
|
||||
the following sections) as sooner or later you will run into graphical glitches
|
||||
when using other versions of the game.
|
||||
|
||||
4.2) OpenTTD directories
|
||||
---- -------------------------------
|
||||
|
||||
The TTD artwork files listed in the section 4.1 "(Required) 3rd party files"
|
||||
can be placed in a few different locations:
|
||||
1. The current working directory (from where you started OpenTTD)
|
||||
2. Your personal directory
|
||||
Windows: C:\Documents and Settings\<username>\My Documents\OpenTTD
|
||||
Mac OSX: ~/Documents/OpenTTD
|
||||
Linux: ~/.openttd
|
||||
3. The shared directory
|
||||
Windows: C:\Documents and Settings\All Users\Documents\OpenTTD
|
||||
Mac OSX: /Library/Application Support/OpenTTD
|
||||
Linux: not available
|
||||
4. The binary directory (where the OpenTTD executable is)
|
||||
Windows: C:\Program Files\OpenTTD
|
||||
Linux: /usr/games
|
||||
5. The installation directory (Linux only)
|
||||
Linux: /usr/share/games/openttd
|
||||
6. The application bundle (Mac OSX only)
|
||||
It includes the OTTD files (grf+lng) and it will work as long as they aren't touched
|
||||
|
||||
Notes:
|
||||
- Linux in the previous list means .deb, but most paths should be similar for others.
|
||||
- The previous search order is also used for newgrfs and openttd.cfg.
|
||||
- If openttd.cfg is not found, then it will be created using the 2, 4, 1, 3, 5 order.
|
||||
- Savegames will be relative to the config file only if there is no save/
|
||||
directory in paths with higher priority than the config file path, but
|
||||
autosaves and screenshots will always be relative to the config file.
|
||||
|
||||
The prefered setup:
|
||||
Place 3rd party files in shared directory (or in personal directory if you don't
|
||||
have write access on shared directory) and have your openttd.cfg config file in
|
||||
personal directory (where the game will then also place savegames and screenshots).
|
||||
|
||||
|
||||
4.3) Portable Installations (External Media):
|
||||
---- ----------------------------------------
|
||||
|
||||
You can install OpenTTD on external media so you can take it with you, i.e.
|
||||
using a USB key, or a USB HDD, etc.
|
||||
Create a directory where you shall store the game in (i.e. OpenTTD/).
|
||||
Copy the binary (OpenTTD.exe, OpenTTD.app, openttd, etc), data/ and your
|
||||
openttd.cfg to this directory.
|
||||
You can copy binaries for any operating system into this directory, which will
|
||||
allow you to play the game on nearly any computer you can attach the external
|
||||
media to.
|
||||
As always - additional grf files are stored in the data/ dir (for details,
|
||||
again, see section 4.1).
|
||||
|
||||
|
||||
5.0) OpenTTD features:
|
||||
@@ -281,30 +359,36 @@ put them in the data/ folder and you're set to go.
|
||||
X.X) Credits:
|
||||
---- --------
|
||||
The OpenTTD team (in alphabetical order):
|
||||
Jean-Francois Claeys (Belugas) - In training, not yet specialized
|
||||
Bjarni Corfitzen (Bjarni) - Mac OS X port, coder
|
||||
Matthijs Kooijman (blathijs) - Pathfinder-guru
|
||||
Victor Fischer (Celestar) - Programming everywhere you need him to
|
||||
Tamás Faragó (Darkvater) - Lead programmer
|
||||
Loïc Guilloux (glx) - In training, not yet specialized
|
||||
Jean-Francois Claeys (Belugas) - GUI, newindustries and more
|
||||
Bjarni Corfitzen (Bjarni) - MacOSX port, coder and vehicles
|
||||
Matthijs Kooijman (blathijs) - Pathfinder-guru, pool rework
|
||||
Loïc Guilloux (glx) - General coding
|
||||
Christoph Elsenhans (frosch) - General coding
|
||||
Jaroslav Mazanec (KUDr) - YAPG (Yet Another Pathfinder God) ;)
|
||||
Kerekes Miham (MiHaMiX) - Maintainer of translator service, and host of nightlies
|
||||
Owen Rudge (orudge) - Contributor, forum host, OS/2 port
|
||||
Peter Nelson (peter1138) - Spiritual descendant from newgrf gods
|
||||
Remko Bijker (Rubidium) - THE desync hunter
|
||||
Jonathan Coome (Maedhros) - High priest of the newGRF Temple
|
||||
Attila Bán (MiHaMiX) - WebTranslator, Nightlies, Wiki and bugtracker host
|
||||
Owen Rudge (orudge) - Forum host, OS/2 port
|
||||
Peter Nelson (peter1138) - Spiritual descendant from newGRF gods
|
||||
Remko Bijker (Rubidium) - Lead coder and way more
|
||||
Benedikt Brüggemeier (skidd13) - Bug fixer and code reworker
|
||||
Zdenek Sojka (SmatZ) - Bug finder and fixer
|
||||
|
||||
Inactive Developers:
|
||||
Victor Fischer (Celestar) - Programming everywhere you need him to
|
||||
Tamás Faragó (Darkvater) - Ex-Lead coder
|
||||
Christoph Mallon (Tron) - Programmer, code correctness police
|
||||
|
||||
Retired Developers:
|
||||
Dominik Scherer (dominik81) - Lead programmer, GUI expert (0.3.0 - 0.3.6)
|
||||
Patric Stout (TrueLight) - Programmer, webhoster (0.3 - pre0.6)
|
||||
Ludvig Strigeus (ludde) - OpenTTD author, main coder (0.1 - 0.3.3)
|
||||
Serge Paquet (vurlix) - Assistant project manager, coder (0.1 - 0.3.3)
|
||||
Dominik Scherer (dominik81) - Lead programmer, GUI expert (0.3.0 - 0.3.6)
|
||||
Patric Stout (TrueLight) - Programmer, webhoster (0.3 - pre0.6)
|
||||
|
||||
Thanks to:
|
||||
Josef Drexler - For his great work on TTDPatch.
|
||||
Marcin Grzegorczyk - For his TTDPatch work and documentation of TTD internals and graphics (signals and track foundations)
|
||||
Petr Baudis (pasky) - Many patches, newgrf support, etc.
|
||||
Simon Sasburg (HackyKid) - For the many bugfixes he has blessed us with (and future PBS)
|
||||
Simon Sasburg (HackyKid) - For the many bugfixes he has blessed us with
|
||||
Stefan Meißner (sign_de) - For his work on the console
|
||||
Mike Ragsdale - OpenTTD installer
|
||||
Cian Duffy (MYOB) - BeOS port / manual writing
|
||||
|
114
source.list
114
source.list
@@ -1,8 +1,10 @@
|
||||
# Source Files
|
||||
airport.cpp
|
||||
core/alloc_func.cpp
|
||||
articulated_vehicles.cpp
|
||||
autoreplace_cmd.cpp
|
||||
aystar.cpp
|
||||
core/bitmath_func.cpp
|
||||
bmp.cpp
|
||||
callback_table.cpp
|
||||
cargopacket.cpp
|
||||
@@ -10,14 +12,13 @@ cargotype.cpp
|
||||
command.cpp
|
||||
console.cpp
|
||||
console_cmds.cpp
|
||||
core/bitmath_func.cpp
|
||||
core/random_func.cpp
|
||||
currency.cpp
|
||||
date.cpp
|
||||
debug.cpp
|
||||
dedicated.cpp
|
||||
depot.cpp
|
||||
driver.cpp
|
||||
widgets/dropdown.cpp
|
||||
economy.cpp
|
||||
elrail.cpp
|
||||
engine.cpp
|
||||
@@ -58,6 +59,7 @@ pathfind.cpp
|
||||
players.cpp
|
||||
queue.cpp
|
||||
rail.cpp
|
||||
core/random_func.cpp
|
||||
rev.cpp
|
||||
road.cpp
|
||||
saveload.cpp
|
||||
@@ -66,6 +68,7 @@ screenshot.cpp
|
||||
sdl.cpp
|
||||
#end
|
||||
settings.cpp
|
||||
signal.cpp
|
||||
signs.cpp
|
||||
sound.cpp
|
||||
spritecache.cpp
|
||||
@@ -75,7 +78,7 @@ strings.cpp
|
||||
texteff.cpp
|
||||
tgp.cpp
|
||||
thread.cpp
|
||||
tile.cpp
|
||||
tile_map.cpp
|
||||
#if WIN32
|
||||
#else
|
||||
#if WINCE
|
||||
@@ -101,43 +104,60 @@ window.cpp
|
||||
aircraft.h
|
||||
airport.h
|
||||
airport_movement.h
|
||||
core/alloc_func.hpp
|
||||
articulated_vehicles.h
|
||||
autoreplace_base.h
|
||||
autoreplace_func.h
|
||||
autoreplace_gui.h
|
||||
autoreplace_type.h
|
||||
autoslope.h
|
||||
aystar.h
|
||||
core/bitmath_func.hpp
|
||||
bmp.h
|
||||
bridge.h
|
||||
callback_table.h
|
||||
cargo_type.h
|
||||
cargopacket.h
|
||||
cargotype.h
|
||||
command.h
|
||||
cmd_helper.h
|
||||
command_func.h
|
||||
command_type.h
|
||||
console.h
|
||||
core/bitmath_func.hpp
|
||||
core/math_func.hpp
|
||||
core/random_func.hpp
|
||||
currency.h
|
||||
date.h
|
||||
date_func.h
|
||||
date_type.h
|
||||
debug.h
|
||||
video/dedicated_v.h
|
||||
depot.h
|
||||
direction.h
|
||||
direction_func.h
|
||||
direction_type.h
|
||||
music/dmusic.h
|
||||
driver.h
|
||||
economy.h
|
||||
widgets/dropdown_func.h
|
||||
widgets/dropdown_type.h
|
||||
economy_func.h
|
||||
economy_type.h
|
||||
core/endian_func.hpp
|
||||
engine.h
|
||||
core/enum_type.hpp
|
||||
fileio.h
|
||||
fios.h
|
||||
fontcache.h
|
||||
functions.h
|
||||
genworld.h
|
||||
gfx.h
|
||||
core/geometry_type.hpp
|
||||
gfx_func.h
|
||||
gfx_type.h
|
||||
gfxinit.h
|
||||
group.h
|
||||
group_gui.h
|
||||
gui.h
|
||||
heightmap.h
|
||||
helpers.hpp
|
||||
industry.h
|
||||
industry_type.h
|
||||
landscape.h
|
||||
livery.h
|
||||
macros.h
|
||||
map.h
|
||||
core/math_func.hpp
|
||||
md5.h
|
||||
mixer.h
|
||||
music.h
|
||||
@@ -146,6 +166,7 @@ network/network_client.h
|
||||
network/network_data.h
|
||||
network/network_gamelist.h
|
||||
network/network_gui.h
|
||||
network/network_internal.h
|
||||
network/network_server.h
|
||||
network/network_udp.h
|
||||
newgrf.h
|
||||
@@ -155,6 +176,7 @@ newgrf_cargo.h
|
||||
newgrf_commons.h
|
||||
newgrf_config.h
|
||||
newgrf_engine.h
|
||||
newgrf_generic.h
|
||||
newgrf_house.h
|
||||
newgrf_industries.h
|
||||
newgrf_industrytiles.h
|
||||
@@ -172,45 +194,79 @@ sound/null_s.h
|
||||
video/null_v.h
|
||||
oldpool.h
|
||||
openttd.h
|
||||
order.h
|
||||
core/overflowsafe_type.hpp
|
||||
pathfind.h
|
||||
player.h
|
||||
player_base.h
|
||||
player_face.h
|
||||
player_func.h
|
||||
player_gui.h
|
||||
player_type.h
|
||||
queue.h
|
||||
rail.h
|
||||
rail_gui.h
|
||||
rail_type.h
|
||||
core/random_func.hpp
|
||||
road_cmd.h
|
||||
road_func.h
|
||||
road_gui.h
|
||||
road_internal.h
|
||||
road_type.h
|
||||
roadveh.h
|
||||
saveload.h
|
||||
screenshot.h
|
||||
sound/sdl_s.h
|
||||
video/sdl_v.h
|
||||
settings.h
|
||||
settings_func.h
|
||||
settings_internal.h
|
||||
settings_type.h
|
||||
ship.h
|
||||
signal_func.h
|
||||
signs.h
|
||||
slope.h
|
||||
sound.h
|
||||
slope_func.h
|
||||
slope_type.h
|
||||
sound_func.h
|
||||
sound_type.h
|
||||
sprite.h
|
||||
spritecache.h
|
||||
station.h
|
||||
station_gui.h
|
||||
stdafx.h
|
||||
string.h
|
||||
string_func.h
|
||||
string_type.h
|
||||
strings_func.h
|
||||
strings_type.h
|
||||
terraform_gui.h
|
||||
textbuf_gui.h
|
||||
texteff.hpp
|
||||
tgp.h
|
||||
thread.h
|
||||
tile.h
|
||||
tile_cmd.h
|
||||
tile_type.h
|
||||
timetable.h
|
||||
town.h
|
||||
town_type.h
|
||||
track_func.h
|
||||
track_type.h
|
||||
train.h
|
||||
transparency.h
|
||||
transparency_gui.h
|
||||
tunnelbridge.h
|
||||
unmovable.h
|
||||
variables.h
|
||||
vehicle.h
|
||||
vehicle_base.h
|
||||
vehicle_func.h
|
||||
vehicle_gui.h
|
||||
viewport.h
|
||||
vehicle_type.h
|
||||
waypoint.h
|
||||
music/win32_m.h
|
||||
sound/win32_s.h
|
||||
video/win32_v.h
|
||||
window.h
|
||||
zoom.hpp
|
||||
window_func.h
|
||||
window_gui.h
|
||||
window_type.h
|
||||
zoom_func.h
|
||||
zoom_type.h
|
||||
|
||||
# GUI Source Code
|
||||
aircraft_gui.cpp
|
||||
@@ -264,6 +320,7 @@ road_cmd.cpp
|
||||
roadveh_cmd.cpp
|
||||
ship_cmd.cpp
|
||||
station_cmd.cpp
|
||||
terraform_cmd.cpp
|
||||
timetable_cmd.cpp
|
||||
town_cmd.cpp
|
||||
train_cmd.cpp
|
||||
@@ -287,7 +344,7 @@ table/landscape_sprite.h
|
||||
table/namegen.h
|
||||
table/palettes.h
|
||||
table/road_land.h
|
||||
table/roadveh.h
|
||||
table/roadveh_movement.h
|
||||
table/sprites.h
|
||||
table/station_land.h
|
||||
../objs/langs/table/strings.h
|
||||
@@ -349,6 +406,7 @@ newgrf_cargo.cpp
|
||||
newgrf_commons.cpp
|
||||
newgrf_config.cpp
|
||||
newgrf_engine.cpp
|
||||
newgrf_generic.cpp
|
||||
newgrf_house.cpp
|
||||
newgrf_industries.cpp
|
||||
newgrf_industrytiles.cpp
|
||||
@@ -369,18 +427,18 @@ rail_map.h
|
||||
road_map.cpp
|
||||
road_map.h
|
||||
station_map.h
|
||||
tile_map.h
|
||||
town_map.h
|
||||
tree_map.h
|
||||
tunnel_map.cpp
|
||||
tunnel_map.h
|
||||
tunnelbridge_map.h
|
||||
unmovable_map.h
|
||||
void_map.h
|
||||
water_map.h
|
||||
|
||||
# Misc
|
||||
misc/array.hpp
|
||||
misc/autocopyptr.hpp
|
||||
misc/autoptr.hpp
|
||||
misc/binaryheap.hpp
|
||||
misc/blob.hpp
|
||||
misc/countedptr.hpp
|
||||
@@ -406,14 +464,12 @@ network/core/udp.cpp
|
||||
network/core/udp.h
|
||||
|
||||
# YAPF
|
||||
yapf/follow_track.cpp
|
||||
yapf/follow_track.hpp
|
||||
yapf/nodelist.hpp
|
||||
yapf/track_dir.hpp
|
||||
yapf/yapf.h
|
||||
yapf/yapf.hpp
|
||||
yapf/yapf_base.hpp
|
||||
yapf/yapf_common.cpp
|
||||
yapf/yapf_common.hpp
|
||||
yapf/yapf_costbase.hpp
|
||||
yapf/yapf_costcache.hpp
|
||||
|
@@ -3,11 +3,18 @@
|
||||
#include "../stdafx.h"
|
||||
#include "../openttd.h"
|
||||
#include "../variables.h"
|
||||
#include "../command.h"
|
||||
#include "../command_func.h"
|
||||
#include "../network/network.h"
|
||||
#include "../helpers.hpp"
|
||||
#include "../core/alloc_func.hpp"
|
||||
#include "../player_func.h"
|
||||
#include "../player_base.h"
|
||||
#include "ai.h"
|
||||
#include "default/default.h"
|
||||
#include "trolly/trolly.h"
|
||||
#include "../signal_func.h"
|
||||
|
||||
AIStruct _ai;
|
||||
AIPlayer _ai_player[MAX_PLAYERS];
|
||||
|
||||
/**
|
||||
* Dequeues commands put in the queue via AI_PutCommandInQueue.
|
||||
@@ -45,7 +52,7 @@ static void AI_DequeueCommands(PlayerID player)
|
||||
* Needed for SP; we need to delay DoCommand with 1 tick, because else events
|
||||
* will make infinite loops (AIScript).
|
||||
*/
|
||||
static void AI_PutCommandInQueue(PlayerID player, TileIndex tile, uint32 p1, uint32 p2, uint procc, CommandCallback* callback)
|
||||
static void AI_PutCommandInQueue(PlayerID player, TileIndex tile, uint32 p1, uint32 p2, uint32 procc, CommandCallback* callback)
|
||||
{
|
||||
AICommand *com;
|
||||
|
||||
@@ -81,7 +88,7 @@ static void AI_PutCommandInQueue(PlayerID player, TileIndex tile, uint32 p1, uin
|
||||
/**
|
||||
* Executes a raw DoCommand for the AI.
|
||||
*/
|
||||
CommandCost AI_DoCommandCc(TileIndex tile, uint32 p1, uint32 p2, uint32 flags, uint procc, CommandCallback* callback)
|
||||
CommandCost AI_DoCommandCc(TileIndex tile, uint32 p1, uint32 p2, uint32 flags, uint32 procc, CommandCallback* callback)
|
||||
{
|
||||
PlayerID old_lp;
|
||||
CommandCost res;
|
||||
@@ -104,10 +111,6 @@ CommandCost AI_DoCommandCc(TileIndex tile, uint32 p1, uint32 p2, uint32 flags, u
|
||||
/* Restore _cmd_text */
|
||||
_cmd_text = tmp_cmdtext;
|
||||
|
||||
/* If we did a DC_EXEC, and the command did not return an error, execute it
|
||||
* over the network */
|
||||
if (flags & DC_NO_WATER) procc |= CMD_NO_WATER;
|
||||
|
||||
/* NetworkSend_Command needs _local_player to be set correctly, so
|
||||
* adjust it, and put it back right after the function */
|
||||
old_lp = _local_player;
|
||||
@@ -134,7 +137,7 @@ CommandCost AI_DoCommandCc(TileIndex tile, uint32 p1, uint32 p2, uint32 flags, u
|
||||
}
|
||||
|
||||
|
||||
CommandCost AI_DoCommand(TileIndex tile, uint32 p1, uint32 p2, uint32 flags, uint procc)
|
||||
CommandCost AI_DoCommand(TileIndex tile, uint32 p1, uint32 p2, uint32 flags, uint32 procc)
|
||||
{
|
||||
return AI_DoCommandCc(tile, p1, p2, flags, procc, NULL);
|
||||
}
|
||||
@@ -158,6 +161,9 @@ static void AI_RunTick(PlayerID player)
|
||||
AiDoGameLoop(p);
|
||||
_is_old_ai_player = false;
|
||||
}
|
||||
|
||||
/* AI could change some track, so update signals */
|
||||
UpdateSignalsInBuffer();
|
||||
}
|
||||
|
||||
|
||||
@@ -218,6 +224,13 @@ void AI_PlayerDied(PlayerID player)
|
||||
{
|
||||
/* Called if this AI died */
|
||||
_ai_player[player].active = false;
|
||||
|
||||
if (_players_ainew[player].pathfinder == NULL) return;
|
||||
|
||||
AyStarMain_Free(_players_ainew[player].pathfinder);
|
||||
delete _players_ainew[player].pathfinder;
|
||||
_players_ainew[player].pathfinder = NULL;
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -239,9 +252,5 @@ void AI_Initialize()
|
||||
*/
|
||||
void AI_Uninitialize()
|
||||
{
|
||||
const Player* p;
|
||||
|
||||
FOR_ALL_PLAYERS(p) {
|
||||
if (p->is_active && p->is_ai) AI_PlayerDied(p->index);
|
||||
}
|
||||
for (PlayerID p = PLAYER_FIRST; p < MAX_PLAYERS; p++) AI_PlayerDied(p);
|
||||
}
|
||||
|
14
src/ai/ai.h
14
src/ai/ai.h
@@ -1,10 +1,12 @@
|
||||
/* $Id$ */
|
||||
|
||||
#ifndef AI_H
|
||||
#define AI_H
|
||||
|
||||
#include "../functions.h"
|
||||
#include "../network/network.h"
|
||||
#include "../player.h"
|
||||
#include "../command.h"
|
||||
#include "../command_type.h"
|
||||
#include "../core/random_func.hpp"
|
||||
#include "../settings_type.h"
|
||||
|
||||
/* How DoCommands look like for an AI */
|
||||
struct AICommand {
|
||||
@@ -12,7 +14,7 @@ struct AICommand {
|
||||
uint32 p1;
|
||||
uint32 p2;
|
||||
uint32 procc;
|
||||
CommandCallback* callback;
|
||||
CommandCallback *callback;
|
||||
|
||||
char *text;
|
||||
uint uid;
|
||||
@@ -34,8 +36,8 @@ struct AIStruct {
|
||||
uint tick; ///< The current tick (something like _frame_counter, only for AIs)
|
||||
};
|
||||
|
||||
VARDEF AIStruct _ai;
|
||||
VARDEF AIPlayer _ai_player[MAX_PLAYERS];
|
||||
extern AIStruct _ai;
|
||||
extern AIPlayer _ai_player[MAX_PLAYERS];
|
||||
|
||||
// ai.c
|
||||
void AI_StartNewAI(PlayerID player);
|
||||
|
File diff suppressed because it is too large
Load Diff
@@ -3,6 +3,66 @@
|
||||
#ifndef DEFAULT_H
|
||||
#define DEFAULT_H
|
||||
|
||||
#include "../../direction_type.h"
|
||||
#include "../../vehicle_type.h"
|
||||
#include "../../rail_type.h"
|
||||
|
||||
void AiDoGameLoop(Player*);
|
||||
void SaveLoad_AI(PlayerID id);
|
||||
|
||||
struct AiBuildRec {
|
||||
TileIndex spec_tile;
|
||||
TileIndex use_tile;
|
||||
byte rand_rng;
|
||||
byte cur_building_rule;
|
||||
byte unk6;
|
||||
byte unk7;
|
||||
byte buildcmd_a;
|
||||
byte buildcmd_b;
|
||||
byte direction;
|
||||
CargoID cargo;
|
||||
};
|
||||
|
||||
struct PlayerAI {
|
||||
byte state;
|
||||
byte tick; ///< Used to determine how often to move
|
||||
uint32 state_counter; ///< Can hold tile index!
|
||||
uint16 timeout_counter;
|
||||
|
||||
byte state_mode;
|
||||
byte banned_tile_count;
|
||||
RailTypeByte railtype_to_use;
|
||||
|
||||
CargoID cargo_type;
|
||||
byte num_wagons;
|
||||
byte build_kind;
|
||||
byte num_build_rec;
|
||||
byte num_loco_to_build;
|
||||
byte num_want_fullload;
|
||||
|
||||
byte route_type_mask;
|
||||
|
||||
TileIndex start_tile_a;
|
||||
TileIndex cur_tile_a;
|
||||
DiagDirectionByte cur_dir_a;
|
||||
DiagDirectionByte start_dir_a;
|
||||
|
||||
TileIndex start_tile_b;
|
||||
TileIndex cur_tile_b;
|
||||
DiagDirectionByte cur_dir_b;
|
||||
DiagDirectionByte start_dir_b;
|
||||
|
||||
Vehicle *cur_veh; ///< only used by some states
|
||||
|
||||
AiBuildRec src, dst, mid1, mid2;
|
||||
|
||||
VehicleID wagon_list[9];
|
||||
byte order_list_blocks[20];
|
||||
|
||||
TileIndex banned_tiles[16];
|
||||
byte banned_val[16];
|
||||
};
|
||||
|
||||
extern PlayerAI _players_ai[MAX_PLAYERS];
|
||||
|
||||
#endif
|
||||
|
@@ -3,18 +3,20 @@
|
||||
#include "../../stdafx.h"
|
||||
#include "../../openttd.h"
|
||||
#include "../../debug.h"
|
||||
#include "../../functions.h"
|
||||
#include "../../map.h"
|
||||
#include "../../road_map.h"
|
||||
#include "../../tile.h"
|
||||
#include "../../vehicle.h"
|
||||
#include "../../command.h"
|
||||
#include "../../command_func.h"
|
||||
#include "trolly.h"
|
||||
#include "../../engine.h"
|
||||
#include "../../station.h"
|
||||
#include "../../variables.h"
|
||||
#include "../../bridge.h"
|
||||
#include "../../vehicle_func.h"
|
||||
#include "../../vehicle_base.h"
|
||||
#include "../../player_base.h"
|
||||
#include "../../player_func.h"
|
||||
#include "../ai.h"
|
||||
#include "../../tunnelbridge.h"
|
||||
|
||||
|
||||
// Build HQ
|
||||
// Params:
|
||||
@@ -58,7 +60,7 @@ CommandCost AiNew_Build_Bridge(Player *p, TileIndex tile_a, TileIndex tile_b, by
|
||||
int bridge_type, bridge_len, type, type2;
|
||||
|
||||
// Find a good bridgetype (the best money can buy)
|
||||
bridge_len = GetBridgeLength(tile_a, tile_b);
|
||||
bridge_len = GetTunnelBridgeLength(tile_a, tile_b);
|
||||
type = type2 = 0;
|
||||
for (bridge_type = MAX_BRIDGES-1; bridge_type >= 0; bridge_type--) {
|
||||
if (CheckBridge_Stuff(bridge_type, bridge_len)) {
|
||||
@@ -72,7 +74,7 @@ CommandCost AiNew_Build_Bridge(Player *p, TileIndex tile_a, TileIndex tile_b, by
|
||||
if (type2 == 0 && type != 0) type2 = type;
|
||||
|
||||
// Now, simply, build the bridge!
|
||||
if (p->ainew.tbt == AI_TRAIN) {
|
||||
if (_players_ainew[p->index].tbt == AI_TRAIN) {
|
||||
return AI_DoCommand(tile_a, tile_b, (0x00 << 8) + type2, flag | DC_AUTO, CMD_BUILD_BRIDGE);
|
||||
} else {
|
||||
return AI_DoCommand(tile_a, tile_b, ((0x80 | ROADTYPES_ROAD) << 8) + type2, flag | DC_AUTO, CMD_BUILD_BRIDGE);
|
||||
@@ -146,7 +148,7 @@ CommandCost AiNew_Build_RoutePart(Player *p, Ai_PathFinderInfo *PathFinderInfo,
|
||||
res = AI_DoCommand(route[part], 0, dir, flag, CMD_BUILD_SINGLE_RAIL);
|
||||
if (CmdFailed(res)) {
|
||||
// Problem.. let's just abort it all!
|
||||
p->ainew.state = AI_STATE_NOTHING;
|
||||
_players_ainew[p->index].state = AI_STATE_NOTHING;
|
||||
return CommandCost();
|
||||
}
|
||||
cost.AddCost(res);
|
||||
@@ -202,7 +204,7 @@ CommandCost AiNew_Build_RoutePart(Player *p, Ai_PathFinderInfo *PathFinderInfo,
|
||||
if (CmdFailed(res) && flag == DC_EXEC && !IsTileType(route[part], MP_ROAD) && !EnsureNoVehicleOnGround(route[part])) {
|
||||
// Problem.. let's just abort it all!
|
||||
DEBUG(ai, 0, "[BuidPath] route building failed at tile 0x%X, aborting", route[part]);
|
||||
p->ainew.state = AI_STATE_NOTHING;
|
||||
_players_ainew[p->index].state = AI_STATE_NOTHING;
|
||||
return CommandCost();
|
||||
}
|
||||
|
||||
@@ -228,36 +230,35 @@ CommandCost AiNew_Build_RoutePart(Player *p, Ai_PathFinderInfo *PathFinderInfo,
|
||||
// It returns INVALID_ENGINE if not suitable engine is found
|
||||
EngineID AiNew_PickVehicle(Player *p)
|
||||
{
|
||||
if (p->ainew.tbt == AI_TRAIN) {
|
||||
if (_players_ainew[p->index].tbt == AI_TRAIN) {
|
||||
// Not supported yet
|
||||
return INVALID_ENGINE;
|
||||
} else {
|
||||
EngineID best_veh_index = INVALID_ENGINE;
|
||||
int32 best_veh_rating = 0;
|
||||
EngineID start = ROAD_ENGINES_INDEX;
|
||||
EngineID end = ROAD_ENGINES_INDEX + NUM_ROAD_ENGINES;
|
||||
EngineID i;
|
||||
|
||||
/* Loop through all road vehicles */
|
||||
for (i = start; i != end; i++) {
|
||||
FOR_ALL_ENGINEIDS_OF_TYPE(i, VEH_ROAD) {
|
||||
const RoadVehicleInfo *rvi = RoadVehInfo(i);
|
||||
const Engine* e = GetEngine(i);
|
||||
int32 rating;
|
||||
CommandCost ret;
|
||||
|
||||
/* Skip vehicles which can't take our cargo type */
|
||||
if (rvi->cargo_type != p->ainew.cargo && !CanRefitTo(i, p->ainew.cargo)) continue;
|
||||
if (rvi->cargo_type != _players_ainew[p->index].cargo && !CanRefitTo(i, _players_ainew[p->index].cargo)) continue;
|
||||
|
||||
/* Skip trams */
|
||||
if (HasBit(EngInfo(i)->misc_flags, EF_ROAD_TRAM)) continue;
|
||||
|
||||
// Is it availiable?
|
||||
// Also, check if the reliability of the vehicle is above the AI_VEHICLE_MIN_RELIABILTY
|
||||
if (!HasBit(e->player_avail, _current_player) || e->reliability * 100 < AI_VEHICLE_MIN_RELIABILTY << 16) continue;
|
||||
|
||||
/* Rate and compare the engine by speed & capacity */
|
||||
rating = rvi->max_speed * rvi->capacity;
|
||||
int rating = rvi->max_speed * rvi->capacity;
|
||||
if (rating <= best_veh_rating) continue;
|
||||
|
||||
// Can we build it?
|
||||
ret = AI_DoCommand(0, i, 0, DC_QUERY_COST, CMD_BUILD_ROAD_VEH);
|
||||
CommandCost ret = AI_DoCommand(0, i, 0, DC_QUERY_COST, CMD_BUILD_ROAD_VEH);
|
||||
if (CmdFailed(ret)) continue;
|
||||
|
||||
best_veh_rating = rating;
|
||||
@@ -274,20 +275,20 @@ void CcAI(bool success, TileIndex tile, uint32 p1, uint32 p2)
|
||||
Player* p = GetPlayer(_current_player);
|
||||
|
||||
if (success) {
|
||||
p->ainew.state = AI_STATE_GIVE_ORDERS;
|
||||
p->ainew.veh_id = _new_vehicle_id;
|
||||
_players_ainew[p->index].state = AI_STATE_GIVE_ORDERS;
|
||||
_players_ainew[p->index].veh_id = _new_vehicle_id;
|
||||
|
||||
if (GetVehicle(p->ainew.veh_id)->cargo_type != p->ainew.cargo) {
|
||||
if (GetVehicle(_players_ainew[p->index].veh_id)->cargo_type != _players_ainew[p->index].cargo) {
|
||||
/* Cargo type doesn't match, so refit it */
|
||||
if (CmdFailed(DoCommand(tile, p->ainew.veh_id, p->ainew.cargo, DC_EXEC, CMD_REFIT_ROAD_VEH))) {
|
||||
if (CmdFailed(DoCommand(tile, _players_ainew[p->index].veh_id, _players_ainew[p->index].cargo, DC_EXEC, CMD_REFIT_ROAD_VEH))) {
|
||||
/* Refit failed, so sell the vehicle */
|
||||
DoCommand(tile, p->ainew.veh_id, 0, DC_EXEC, CMD_SELL_ROAD_VEH);
|
||||
p->ainew.state = AI_STATE_NOTHING;
|
||||
DoCommand(tile, _players_ainew[p->index].veh_id, 0, DC_EXEC, CMD_SELL_ROAD_VEH);
|
||||
_players_ainew[p->index].state = AI_STATE_NOTHING;
|
||||
}
|
||||
}
|
||||
} else {
|
||||
/* XXX this should be handled more gracefully */
|
||||
p->ainew.state = AI_STATE_NOTHING;
|
||||
_players_ainew[p->index].state = AI_STATE_NOTHING;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -298,7 +299,7 @@ CommandCost AiNew_Build_Vehicle(Player *p, TileIndex tile, byte flag)
|
||||
EngineID i = AiNew_PickVehicle(p);
|
||||
|
||||
if (i == INVALID_ENGINE) return CMD_ERROR;
|
||||
if (p->ainew.tbt == AI_TRAIN) return CMD_ERROR;
|
||||
if (_players_ainew[p->index].tbt == AI_TRAIN) return CMD_ERROR;
|
||||
|
||||
if (flag & DC_EXEC) {
|
||||
return AI_DoCommandCc(tile, i, 0, flag, CMD_BUILD_ROAD_VEH, CcAI);
|
||||
@@ -310,7 +311,7 @@ CommandCost AiNew_Build_Vehicle(Player *p, TileIndex tile, byte flag)
|
||||
CommandCost AiNew_Build_Depot(Player* p, TileIndex tile, DiagDirection direction, byte flag)
|
||||
{
|
||||
CommandCost ret, ret2;
|
||||
if (p->ainew.tbt == AI_TRAIN) {
|
||||
if (_players_ainew[p->index].tbt == AI_TRAIN) {
|
||||
return AI_DoCommand(tile, 0, direction, flag | DC_AUTO | DC_NO_WATER, CMD_BUILD_TRAIN_DEPOT);
|
||||
} else {
|
||||
ret = AI_DoCommand(tile, direction, 0, flag | DC_AUTO | DC_NO_WATER, CMD_BUILD_ROAD_DEPOT);
|
||||
|
@@ -4,15 +4,18 @@
|
||||
#include "../../openttd.h"
|
||||
#include "../../bridge_map.h"
|
||||
#include "../../debug.h"
|
||||
#include "../../functions.h"
|
||||
#include "../../map.h"
|
||||
#include "../../tile.h"
|
||||
#include "../../command.h"
|
||||
#include "../../command_func.h"
|
||||
#include "trolly.h"
|
||||
#include "../../depot.h"
|
||||
#include "../../tunnel_map.h"
|
||||
#include "../../bridge.h"
|
||||
#include "../../tunnelbridge_map.h"
|
||||
#include "../ai.h"
|
||||
#include "../../variables.h"
|
||||
#include "../../player_base.h"
|
||||
#include "../../player_func.h"
|
||||
#include "../../tunnelbridge.h"
|
||||
|
||||
|
||||
#define TEST_STATION_NO_DIR 0xFF
|
||||
|
||||
@@ -27,14 +30,14 @@ static bool TestCanBuildStationHere(TileIndex tile, byte dir)
|
||||
// TODO: currently we only allow spots that can be access from al 4 directions...
|
||||
// should be fixed!!!
|
||||
for (dir = 0; dir < 4; dir++) {
|
||||
ret = AiNew_Build_Station(p, p->ainew.tbt, tile, 1, 1, dir, DC_QUERY_COST);
|
||||
ret = AiNew_Build_Station(p, _players_ainew[p->index].tbt, tile, 1, 1, dir, DC_QUERY_COST);
|
||||
if (CmdSucceeded(ret)) return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
// return true if command succeeded, so the inverse of CmdFailed()
|
||||
return CmdSucceeded(AiNew_Build_Station(p, p->ainew.tbt, tile, 1, 1, dir, DC_QUERY_COST));
|
||||
return CmdSucceeded(AiNew_Build_Station(p, _players_ainew[p->index].tbt, tile, 1, 1, dir, DC_QUERY_COST));
|
||||
}
|
||||
|
||||
|
||||
@@ -43,10 +46,7 @@ static bool IsRoad(TileIndex tile)
|
||||
return
|
||||
// MP_ROAD, but not a road depot?
|
||||
(IsTileType(tile, MP_ROAD) && !IsTileDepotType(tile, TRANSPORT_ROAD)) ||
|
||||
(IsTileType(tile, MP_TUNNELBRIDGE) && (
|
||||
(IsTunnel(tile) && GetTunnelTransportType(tile) == TRANSPORT_ROAD) ||
|
||||
(IsBridge(tile) && GetBridgeTransportType(tile) == TRANSPORT_ROAD)
|
||||
));
|
||||
(IsTileType(tile, MP_TUNNELBRIDGE) && GetTunnelBridgeTransportType(tile) == TRANSPORT_ROAD);
|
||||
}
|
||||
|
||||
|
||||
@@ -234,11 +234,7 @@ static void AyStar_AiPathFinder_GetNeighbours(AyStar *aystar, OpenListNode *curr
|
||||
// If the next step is a bridge, we have to enter it the right way
|
||||
if (!PathFinderInfo->rail_or_road && IsRoad(atile)) {
|
||||
if (IsTileType(atile, MP_TUNNELBRIDGE)) {
|
||||
if (IsTunnel(atile)) {
|
||||
if (GetTunnelDirection(atile) != i) continue;
|
||||
} else {
|
||||
if (GetBridgeRampDirection(atile) != i) continue;
|
||||
}
|
||||
if (GetTunnelBridgeDirection(atile) != i) continue;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -325,7 +321,7 @@ static void AyStar_AiPathFinder_GetNeighbours(AyStar *aystar, OpenListNode *curr
|
||||
new_tile += TileOffsByDiagDir(dir);
|
||||
|
||||
// Precheck, is the length allowed?
|
||||
if (!CheckBridge_Stuff(0, GetBridgeLength(tile, new_tile))) break;
|
||||
if (!CheckBridge_Stuff(0, GetTunnelBridgeLength(tile, new_tile))) break;
|
||||
|
||||
// Check if we hit the station-tile.. we don't like that!
|
||||
if (TILES_BETWEEN(new_tile, PathFinderInfo->end_tile_tl, PathFinderInfo->end_tile_br)) break;
|
||||
@@ -345,14 +341,11 @@ static void AyStar_AiPathFinder_GetNeighbours(AyStar *aystar, OpenListNode *curr
|
||||
// Next, check for tunnels!
|
||||
// Tunnels can only be built on slopes corresponding to the direction
|
||||
// For now, we check both sides for this tile.. terraforming gives fuzzy result
|
||||
if ((dir == DIAGDIR_NE && tileh == SLOPE_NE) ||
|
||||
(dir == DIAGDIR_SE && tileh == SLOPE_SE) ||
|
||||
(dir == DIAGDIR_SW && tileh == SLOPE_SW) ||
|
||||
(dir == DIAGDIR_NW && tileh == SLOPE_NW)) {
|
||||
if (tileh == InclinedSlope(dir)) {
|
||||
// Now simply check if a tunnel can be build
|
||||
ret = AI_DoCommand(tile, (PathFinderInfo->rail_or_road?0:0x200), 0, DC_AUTO, CMD_BUILD_TUNNEL);
|
||||
tileh = GetTileSlope(_build_tunnel_endtile, NULL);
|
||||
if (CmdSucceeded(ret) && (tileh == SLOPE_SW || tileh == SLOPE_SE || tileh == SLOPE_NW || tileh == SLOPE_NE)) {
|
||||
if (CmdSucceeded(ret) && IsInclinedSlope(tileh)) {
|
||||
aystar->neighbours[aystar->num_neighbours].tile = _build_tunnel_endtile;
|
||||
aystar->neighbours[aystar->num_neighbours].user_data[0] = AI_PATHFINDER_FLAG_TUNNEL + (dir << 8);
|
||||
aystar->neighbours[aystar->num_neighbours++].direction = 0;
|
||||
@@ -364,10 +357,6 @@ static void AyStar_AiPathFinder_GetNeighbours(AyStar *aystar, OpenListNode *curr
|
||||
|
||||
extern Foundation GetRailFoundation(Slope tileh, TrackBits bits); // XXX function declaration in .c
|
||||
extern Foundation GetRoadFoundation(Slope tileh, RoadBits bits); // XXX function declaration in .c
|
||||
extern Foundation GetBridgeFoundation(Slope tileh, Axis); // XXX function declaration in .c
|
||||
enum BridgeFoundation {
|
||||
BRIDGE_NO_FOUNDATION = 1 << 0 | 1 << 3 | 1 << 6 | 1 << 9 | 1 << 12,
|
||||
};
|
||||
|
||||
// The most important function: it calculates the g-value
|
||||
static int32 AyStar_AiPathFinder_CalculateG(AyStar *aystar, AyStarNode *current, OpenListNode *parent)
|
||||
@@ -410,8 +399,7 @@ static int32 AyStar_AiPathFinder_CalculateG(AyStar *aystar, AyStarNode *current,
|
||||
if (parent->path.node.user_data[0] == 0 && current->user_data[0] == 0) {
|
||||
if (PathFinderInfo->rail_or_road) {
|
||||
Foundation f = GetRailFoundation(parent_tileh, (TrackBits)(1 << AiNew_GetRailDirection(parent->path.parent->node.tile, parent->path.node.tile, current->tile)));
|
||||
// Maybe is BRIDGE_NO_FOUNDATION a bit strange here, but it contains just the right information..
|
||||
if (IsInclinedFoundation(f) || (!IsFoundation(f) && HasBit(BRIDGE_NO_FOUNDATION, parent_tileh))) {
|
||||
if (IsInclinedFoundation(f) || (!IsFoundation(f) && IsInclinedSlope(parent_tileh))) {
|
||||
res += AI_PATHFINDER_TILE_GOES_UP_PENALTY;
|
||||
} else {
|
||||
res += AI_PATHFINDER_FOUNDATION_PENALTY;
|
||||
@@ -419,7 +407,7 @@ static int32 AyStar_AiPathFinder_CalculateG(AyStar *aystar, AyStarNode *current,
|
||||
} else {
|
||||
if (!IsRoad(parent->path.node.tile) || !IsTileType(parent->path.node.tile, MP_TUNNELBRIDGE)) {
|
||||
Foundation f = GetRoadFoundation(parent_tileh, (RoadBits)AiNew_GetRoadDirection(parent->path.parent->node.tile, parent->path.node.tile, current->tile));
|
||||
if (IsInclinedFoundation(f) || (!IsFoundation(f) && HasBit(BRIDGE_NO_FOUNDATION, parent_tileh))) {
|
||||
if (IsInclinedFoundation(f) || (!IsFoundation(f) && IsInclinedSlope(parent_tileh))) {
|
||||
res += AI_PATHFINDER_TILE_GOES_UP_PENALTY;
|
||||
} else {
|
||||
res += AI_PATHFINDER_FOUNDATION_PENALTY;
|
||||
@@ -434,29 +422,19 @@ static int32 AyStar_AiPathFinder_CalculateG(AyStar *aystar, AyStarNode *current,
|
||||
int r;
|
||||
// Tunnels are very expensive when build on long routes..
|
||||
// Ironicly, we are using BridgeCode here ;)
|
||||
r = AI_PATHFINDER_TUNNEL_PENALTY * GetBridgeLength(current->tile, parent->path.node.tile);
|
||||
r = AI_PATHFINDER_TUNNEL_PENALTY * GetTunnelBridgeLength(current->tile, parent->path.node.tile);
|
||||
res += r + (r >> 8);
|
||||
}
|
||||
|
||||
// Are we part of a bridge?
|
||||
if ((AI_PATHFINDER_FLAG_BRIDGE & current->user_data[0]) != 0) {
|
||||
// That means for every length a penalty
|
||||
res += AI_PATHFINDER_BRIDGE_PENALTY * GetBridgeLength(current->tile, parent->path.node.tile);
|
||||
res += AI_PATHFINDER_BRIDGE_PENALTY * GetTunnelBridgeLength(current->tile, parent->path.node.tile);
|
||||
// Check if we are going up or down, first for the starting point
|
||||
// In user_data[0] is at the 8th bit the direction
|
||||
if (!HasBit(BRIDGE_NO_FOUNDATION, parent_tileh)) {
|
||||
if (IsLeveledFoundation(GetBridgeFoundation(parent_tileh, (Axis)((current->user_data[0] >> 8) & 1)))) {
|
||||
res += AI_PATHFINDER_BRIDGE_GOES_UP_PENALTY;
|
||||
}
|
||||
}
|
||||
if (!HasBridgeFlatRamp(parent_tileh, (Axis)((current->user_data[0] >> 8) & 1))) res += AI_PATHFINDER_BRIDGE_GOES_UP_PENALTY;
|
||||
// Second for the end point
|
||||
if (!HasBit(BRIDGE_NO_FOUNDATION, tileh)) {
|
||||
if (IsLeveledFoundation(GetBridgeFoundation(tileh, (Axis)((current->user_data[0] >> 8) & 1)))) {
|
||||
res += AI_PATHFINDER_BRIDGE_GOES_UP_PENALTY;
|
||||
}
|
||||
}
|
||||
if (parent_tileh == SLOPE_FLAT) res += AI_PATHFINDER_BRIDGE_GOES_UP_PENALTY;
|
||||
if (tileh == SLOPE_FLAT) res += AI_PATHFINDER_BRIDGE_GOES_UP_PENALTY;
|
||||
if (!HasBridgeFlatRamp(tileh, (Axis)((current->user_data[0] >> 8) & 1))) res += AI_PATHFINDER_BRIDGE_GOES_UP_PENALTY;
|
||||
}
|
||||
|
||||
// To prevent the AI from taking the fastest way in tiles, but not the fastest way
|
||||
|
@@ -3,9 +3,10 @@
|
||||
#include "../../stdafx.h"
|
||||
#include "../../openttd.h"
|
||||
#include "../../debug.h"
|
||||
#include "../../map.h"
|
||||
#include "../../map_func.h"
|
||||
#include "../../vehicle_base.h"
|
||||
#include "../../player_base.h"
|
||||
#include "trolly.h"
|
||||
#include "../../vehicle.h"
|
||||
|
||||
int AiNew_GetRailDirection(TileIndex tile_a, TileIndex tile_b, TileIndex tile_c)
|
||||
{
|
||||
@@ -80,8 +81,8 @@ uint AiNew_GetSpecialVehicleFlag(Player* p, Vehicle* v)
|
||||
uint i;
|
||||
|
||||
for (i = 0; i < AI_MAX_SPECIAL_VEHICLES; i++) {
|
||||
if (p->ainew.special_vehicles[i].veh_id == v->index) {
|
||||
return p->ainew.special_vehicles[i].flag;
|
||||
if (_players_ainew[p->index].special_vehicles[i].veh_id == v->index) {
|
||||
return _players_ainew[p->index].special_vehicles[i].flag;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -96,13 +97,13 @@ bool AiNew_SetSpecialVehicleFlag(Player* p, Vehicle* v, uint flag)
|
||||
uint i;
|
||||
|
||||
for (i = 0; i < AI_MAX_SPECIAL_VEHICLES; i++) {
|
||||
if (p->ainew.special_vehicles[i].veh_id == v->index) {
|
||||
p->ainew.special_vehicles[i].flag |= flag;
|
||||
if (_players_ainew[p->index].special_vehicles[i].veh_id == v->index) {
|
||||
_players_ainew[p->index].special_vehicles[i].flag |= flag;
|
||||
return true;
|
||||
}
|
||||
if (new_id == -1 &&
|
||||
p->ainew.special_vehicles[i].veh_id == 0 &&
|
||||
p->ainew.special_vehicles[i].flag == 0) {
|
||||
_players_ainew[p->index].special_vehicles[i].veh_id == 0 &&
|
||||
_players_ainew[p->index].special_vehicles[i].flag == 0) {
|
||||
new_id = i;
|
||||
}
|
||||
}
|
||||
@@ -112,7 +113,7 @@ bool AiNew_SetSpecialVehicleFlag(Player* p, Vehicle* v, uint flag)
|
||||
DEBUG(ai, 1, "special_vehicles list is too small");
|
||||
return false;
|
||||
}
|
||||
p->ainew.special_vehicles[new_id].veh_id = v->index;
|
||||
p->ainew.special_vehicles[new_id].flag = flag;
|
||||
_players_ainew[p->index].special_vehicles[new_id].veh_id = v->index;
|
||||
_players_ainew[p->index].special_vehicles[new_id].flag = flag;
|
||||
return true;
|
||||
}
|
||||
|
File diff suppressed because it is too large
Load Diff
@@ -4,7 +4,9 @@
|
||||
#define AI_TROLLY_H
|
||||
|
||||
#include "../../aystar.h"
|
||||
#include "../../player.h"
|
||||
#include "../../player_type.h"
|
||||
#include "../../vehicle_type.h"
|
||||
#include "../../date_type.h"
|
||||
|
||||
/*
|
||||
* These defines can be altered to change the behavoir of the AI
|
||||
@@ -239,6 +241,22 @@ typedef void AiNew_StateFunction(Player *p);
|
||||
// ai_new.c
|
||||
void AiNewDoGameLoop(Player *p);
|
||||
|
||||
struct Ai_PathFinderInfo {
|
||||
TileIndex start_tile_tl; ///< tl = top-left
|
||||
TileIndex start_tile_br; ///< br = bottom-right
|
||||
TileIndex end_tile_tl; ///< tl = top-left
|
||||
TileIndex end_tile_br; ///< br = bottom-right
|
||||
DiagDirection start_direction; ///< 0 to 3 or AI_PATHFINDER_NO_DIRECTION
|
||||
DiagDirection end_direction; ///< 0 to 3 or AI_PATHFINDER_NO_DIRECTION
|
||||
|
||||
TileIndex route[500];
|
||||
byte route_extra[500]; ///< Some extra information about the route like bridge/tunnel
|
||||
int route_length;
|
||||
int position; ///< Current position in the build-path, needed to build the path
|
||||
|
||||
bool rail_or_road; ///< true = rail, false = road
|
||||
};
|
||||
|
||||
// ai_pathfinder.c
|
||||
AyStar *new_AyStar_AiPathFinder(int max_tiles_around, Ai_PathFinderInfo *PathFinderInfo);
|
||||
void clean_AyStar_AiPathFinder(AyStar *aystar, Ai_PathFinderInfo *PathFinderInfo);
|
||||
@@ -259,4 +277,64 @@ EngineID AiNew_PickVehicle(Player *p);
|
||||
CommandCost AiNew_Build_Vehicle(Player *p, TileIndex tile, byte flag);
|
||||
CommandCost AiNew_Build_Depot(Player* p, TileIndex tile, DiagDirection direction, byte flag);
|
||||
|
||||
/* The amount of memory reserved for the AI-special-vehicles */
|
||||
#define AI_MAX_SPECIAL_VEHICLES 100
|
||||
|
||||
struct Ai_SpecialVehicle {
|
||||
VehicleID veh_id;
|
||||
uint32 flag;
|
||||
};
|
||||
|
||||
struct PlayerAiNew {
|
||||
uint8 state;
|
||||
uint tick;
|
||||
uint idle;
|
||||
|
||||
int temp; ///< A value used in more than one function, but it just temporary
|
||||
///< The use is pretty simple: with this we can 'think' about stuff
|
||||
///< in more than one tick, and more than one AI. A static will not
|
||||
///< do, because they are not saved. This way, the AI is almost human ;)
|
||||
int counter; ///< For the same reason as temp, we have counter. It can count how
|
||||
///< long we are trying something, and just abort if it takes too long
|
||||
|
||||
/* Pathfinder stuff */
|
||||
Ai_PathFinderInfo path_info;
|
||||
AyStar *pathfinder;
|
||||
|
||||
/* Route stuff */
|
||||
|
||||
CargoID cargo;
|
||||
byte tbt; ///< train/bus/truck 0/1/2 AI_TRAIN/AI_BUS/AI_TRUCK
|
||||
Money new_cost;
|
||||
|
||||
byte action;
|
||||
|
||||
int last_id; ///< here is stored the last id of the searched city/industry
|
||||
Date last_vehiclecheck_date; // Used in CheckVehicle
|
||||
Ai_SpecialVehicle special_vehicles[AI_MAX_SPECIAL_VEHICLES]; ///< Some vehicles have some special flags
|
||||
|
||||
TileIndex from_tile;
|
||||
TileIndex to_tile;
|
||||
|
||||
DiagDirectionByte from_direction;
|
||||
DiagDirectionByte to_direction;
|
||||
|
||||
bool from_deliver; ///< True if this is the station that GIVES cargo
|
||||
bool to_deliver;
|
||||
|
||||
TileIndex depot_tile;
|
||||
DiagDirectionByte depot_direction;
|
||||
|
||||
byte amount_veh; ///< How many vehicles we are going to build in this route
|
||||
byte cur_veh; ///< How many vehicles did we bought?
|
||||
VehicleID veh_id; ///< Used when bought a vehicle
|
||||
VehicleID veh_main_id; ///< The ID of the first vehicle, for shared copy
|
||||
|
||||
int from_ic; ///< ic = industry/city. This is the ID of them
|
||||
byte from_type; ///< AI_NO_TYPE/AI_CITY/AI_INDUSTRY
|
||||
int to_ic;
|
||||
byte to_type;
|
||||
};
|
||||
extern PlayerAiNew _players_ainew[MAX_PLAYERS];
|
||||
|
||||
#endif /* AI_TROLLY_H */
|
||||
|
@@ -6,9 +6,8 @@
|
||||
#define AIRCRAFT_H
|
||||
|
||||
#include "station_map.h"
|
||||
#include "vehicle.h"
|
||||
#include "vehicle_base.h"
|
||||
#include "engine.h"
|
||||
#include "variables.h"
|
||||
|
||||
/** An aircraft can be one ot those types */
|
||||
enum AircraftSubType {
|
||||
@@ -125,6 +124,7 @@ struct Aircraft : public Vehicle {
|
||||
Money GetRunningCost() const { return AircraftVehInfo(this->engine_type)->running_cost * _price.aircraft_running; }
|
||||
bool IsInDepot() const { return (this->vehstatus & VS_HIDDEN) != 0 && IsHangarTile(this->tile); }
|
||||
void Tick();
|
||||
void OnNewDay();
|
||||
};
|
||||
|
||||
#endif /* AIRCRAFT_H */
|
||||
|
@@ -7,33 +7,38 @@
|
||||
#include "openttd.h"
|
||||
#include "aircraft.h"
|
||||
#include "debug.h"
|
||||
#include "functions.h"
|
||||
#include "landscape.h"
|
||||
#include "station_map.h"
|
||||
#include "strings.h"
|
||||
#include "table/strings.h"
|
||||
#include "map.h"
|
||||
#include "tile.h"
|
||||
#include "vehicle.h"
|
||||
#include "timetable.h"
|
||||
#include "depot.h"
|
||||
#include "engine.h"
|
||||
#include "command.h"
|
||||
#include "station.h"
|
||||
#include "news.h"
|
||||
#include "sound.h"
|
||||
#include "player.h"
|
||||
#include "aircraft.h"
|
||||
#include "airport.h"
|
||||
#include "vehicle_gui.h"
|
||||
#include "table/sprites.h"
|
||||
#include "newgrf_engine.h"
|
||||
#include "newgrf_callbacks.h"
|
||||
#include "newgrf_text.h"
|
||||
#include "newgrf_sound.h"
|
||||
#include "date.h"
|
||||
#include "spritecache.h"
|
||||
#include "cargotype.h"
|
||||
#include "strings_func.h"
|
||||
#include "command_func.h"
|
||||
#include "window_func.h"
|
||||
#include "date_func.h"
|
||||
#include "vehicle_func.h"
|
||||
#include "sound_func.h"
|
||||
#include "functions.h"
|
||||
#include "variables.h"
|
||||
#include "autoreplace_func.h"
|
||||
#include "autoreplace_gui.h"
|
||||
#include "gfx_func.h"
|
||||
#include "player_func.h"
|
||||
#include "settings_type.h"
|
||||
|
||||
#include "table/strings.h"
|
||||
#include "table/sprites.h"
|
||||
|
||||
void Aircraft::UpdateDeltaXY(Direction direction)
|
||||
{
|
||||
@@ -162,7 +167,7 @@ int Aircraft::GetImage(Direction direction) const
|
||||
int sprite = GetCustomVehicleSprite(this, direction);
|
||||
|
||||
if (sprite != 0) return sprite;
|
||||
spritenum = orig_aircraft_vehicle_info[this->engine_type - AIRCRAFT_ENGINES_INDEX].image_index;
|
||||
spritenum = _orig_aircraft_vehicle_info[this->engine_type - AIRCRAFT_ENGINES_INDEX].image_index;
|
||||
}
|
||||
return direction + _aircraft_sprite[spritenum];
|
||||
}
|
||||
@@ -185,15 +190,17 @@ void DrawAircraftEngine(int x, int y, EngineID engine, SpriteID pal)
|
||||
{
|
||||
const AircraftVehicleInfo* avi = AircraftVehInfo(engine);
|
||||
int spritenum = avi->image_index;
|
||||
SpriteID sprite = (6 + _aircraft_sprite[spritenum]);
|
||||
SpriteID sprite = 0;
|
||||
|
||||
if (is_custom_sprite(spritenum)) {
|
||||
sprite = GetCustomVehicleIcon(engine, DIR_W);
|
||||
if (sprite == 0) {
|
||||
spritenum = orig_aircraft_vehicle_info[engine - AIRCRAFT_ENGINES_INDEX].image_index;
|
||||
sprite = (6 + _aircraft_sprite[spritenum]);
|
||||
spritenum = _orig_aircraft_vehicle_info[engine - AIRCRAFT_ENGINES_INDEX].image_index;
|
||||
}
|
||||
}
|
||||
if (sprite == 0) {
|
||||
sprite = 6 + _aircraft_sprite[spritenum];
|
||||
}
|
||||
|
||||
DrawSprite(sprite, pal, x, y);
|
||||
|
||||
@@ -218,7 +225,7 @@ void GetAircraftSpriteSize(EngineID engine, uint &width, uint &height)
|
||||
if (is_custom_sprite(spritenum)) {
|
||||
sprite = GetCustomVehicleIcon(engine, DIR_W);
|
||||
if (sprite == 0) {
|
||||
spritenum = orig_aircraft_vehicle_info[engine - AIRCRAFT_ENGINES_INDEX].image_index;
|
||||
spritenum = _orig_aircraft_vehicle_info[engine - AIRCRAFT_ENGINES_INDEX].image_index;
|
||||
sprite = (6 + _aircraft_sprite[spritenum]);
|
||||
}
|
||||
}
|
||||
@@ -231,7 +238,7 @@ void GetAircraftSpriteSize(EngineID engine, uint &width, uint &height)
|
||||
|
||||
static CommandCost EstimateAircraftCost(EngineID engine, const AircraftVehicleInfo *avi)
|
||||
{
|
||||
return CommandCost(GetEngineProperty(engine, 0x0B, avi->base_cost) * (_price.aircraft_base >> 3) >> 5);
|
||||
return CommandCost(EXPENSES_NEW_VEHICLES, GetEngineProperty(engine, 0x0B, avi->base_cost) * (_price.aircraft_base >> 3) >> 5);
|
||||
}
|
||||
|
||||
|
||||
@@ -264,7 +271,7 @@ uint16 AircraftDefaultCargoCapacity(CargoID cid, const AircraftVehicleInfo *avi)
|
||||
* @param tile tile of depot where aircraft is built
|
||||
* @param flags for command
|
||||
* @param p1 aircraft type being built (engine)
|
||||
* @param p2 bit 0 when set, the unitnumber will be 0, otherwise it will be a free number
|
||||
* @param p2 unused
|
||||
* return result of operation. Could be cost, error
|
||||
*/
|
||||
CommandCost CmdBuildAircraft(TileIndex tile, uint32 flags, uint32 p1, uint32 p2)
|
||||
@@ -279,8 +286,6 @@ CommandCost CmdBuildAircraft(TileIndex tile, uint32 flags, uint32 p1, uint32 p2)
|
||||
|
||||
if (!IsHangarTile(tile) || !IsTileOwner(tile, _current_player)) return CMD_ERROR;
|
||||
|
||||
SET_EXPENSES_TYPE(EXPENSES_NEW_VEHICLES);
|
||||
|
||||
/* Prevent building aircraft types at places which can't handle them */
|
||||
if (!CanAircraftUseStation(p1, tile)) return CMD_ERROR;
|
||||
|
||||
@@ -291,7 +296,7 @@ CommandCost CmdBuildAircraft(TileIndex tile, uint32 flags, uint32 p1, uint32 p2)
|
||||
return_cmd_error(STR_00E1_TOO_MANY_VEHICLES_IN_GAME);
|
||||
}
|
||||
|
||||
UnitID unit_num = HasBit(p2, 0) ? 0 : GetFreeUnitNumber(VEH_AIRCRAFT);
|
||||
UnitID unit_num = (flags & DC_AUTOREPLACE) ? 0 : GetFreeUnitNumber(VEH_AIRCRAFT);
|
||||
if (unit_num > _patches.max_aircraft)
|
||||
return_cmd_error(STR_00E1_TOO_MANY_VEHICLES_IN_GAME);
|
||||
|
||||
@@ -318,6 +323,8 @@ CommandCost CmdBuildAircraft(TileIndex tile, uint32 flags, uint32 p1, uint32 p2)
|
||||
u->z_pos = GetSlopeZ(x, y);
|
||||
v->z_pos = u->z_pos + 1;
|
||||
|
||||
v->running_ticks = 0;
|
||||
|
||||
// u->delta_x = u->delta_y = 0;
|
||||
|
||||
v->vehstatus = VS_HIDDEN | VS_STOPPED | VS_DEFPAL;
|
||||
@@ -334,7 +341,7 @@ CommandCost CmdBuildAircraft(TileIndex tile, uint32 flags, uint32 p1, uint32 p2)
|
||||
|
||||
v->cargo_subtype = 0;
|
||||
|
||||
v->string_id = STR_SV_AIRCRAFT_NAME;
|
||||
v->name = NULL;
|
||||
// v->next_order_param = v->next_order = 0;
|
||||
|
||||
// v->load_unload_time_rem = 0;
|
||||
@@ -489,9 +496,7 @@ CommandCost CmdSellAircraft(TileIndex tile, uint32 flags, uint32 p1, uint32 p2)
|
||||
|
||||
if (HASBITS(v->vehstatus, VS_CRASHED)) return_cmd_error(STR_CAN_T_SELL_DESTROYED_VEHICLE);
|
||||
|
||||
SET_EXPENSES_TYPE(EXPENSES_NEW_VEHICLES);
|
||||
|
||||
CommandCost ret(-v->value);
|
||||
CommandCost ret(EXPENSES_NEW_VEHICLES, -v->value);
|
||||
|
||||
if (flags & DC_EXEC) {
|
||||
// Invalidate depot
|
||||
@@ -524,7 +529,7 @@ CommandCost CmdStartStopAircraft(TileIndex tile, uint32 flags, uint32 p1, uint32
|
||||
/* Check if this aircraft can be started/stopped. The callback will fail or
|
||||
* return 0xFF if it can. */
|
||||
uint16 callback = GetVehicleCallback(CBID_VEHICLE_START_STOP_CHECK, 0, 0, v->engine_type, v);
|
||||
if (callback != CALLBACK_FAILED && callback != 0xFF) {
|
||||
if (callback != CALLBACK_FAILED && GB(callback, 0, 8) != 0xFF) {
|
||||
StringID error = GetGRFStringID(GetEngineGRFID(v->engine_type), 0xD000 + callback);
|
||||
return_cmd_error(error);
|
||||
}
|
||||
@@ -536,7 +541,7 @@ CommandCost CmdStartStopAircraft(TileIndex tile, uint32 flags, uint32 p1, uint32
|
||||
|
||||
v->vehstatus ^= VS_STOPPED;
|
||||
v->cur_speed = 0;
|
||||
InvalidateWindowWidget(WC_VEHICLE_VIEW, v->index, STATUS_BAR);
|
||||
InvalidateWindowWidget(WC_VEHICLE_VIEW, v->index, VVW_WIDGET_START_STOP_VEH);
|
||||
InvalidateWindow(WC_VEHICLE_DEPOT, v->tile);
|
||||
InvalidateWindowClasses(WC_AIRCRAFT_LIST);
|
||||
}
|
||||
@@ -568,24 +573,24 @@ CommandCost CmdSendAircraftToHangar(TileIndex tile, uint32 flags, uint32 p1, uin
|
||||
if (v->type != VEH_AIRCRAFT || !CheckOwnership(v->owner) || v->IsInDepot()) return CMD_ERROR;
|
||||
|
||||
if (v->current_order.type == OT_GOTO_DEPOT && !(p2 & DEPOT_LOCATE_HANGAR)) {
|
||||
if (!!(p2 & DEPOT_SERVICE) == HasBit(v->current_order.flags, OFB_HALT_IN_DEPOT)) {
|
||||
if (!!(p2 & DEPOT_SERVICE) == HasBit(v->current_order.flags, OF_HALT_IN_DEPOT)) {
|
||||
/* We called with a different DEPOT_SERVICE setting.
|
||||
* Now we change the setting to apply the new one and let the vehicle head for the same hangar.
|
||||
* Note: the if is (true for requesting service == true for ordered to stop in hangar) */
|
||||
if (flags & DC_EXEC) {
|
||||
ClrBit(v->current_order.flags, OFB_PART_OF_ORDERS);
|
||||
ToggleBit(v->current_order.flags, OFB_HALT_IN_DEPOT);
|
||||
InvalidateWindowWidget(WC_VEHICLE_VIEW, v->index, STATUS_BAR);
|
||||
ClrBit(v->current_order.flags, OF_PART_OF_ORDERS);
|
||||
ToggleBit(v->current_order.flags, OF_HALT_IN_DEPOT);
|
||||
InvalidateWindowWidget(WC_VEHICLE_VIEW, v->index, VVW_WIDGET_START_STOP_VEH);
|
||||
}
|
||||
return CommandCost();
|
||||
}
|
||||
|
||||
if (p2 & DEPOT_DONT_CANCEL) return CMD_ERROR; // Requested no cancelation of hangar orders
|
||||
if (flags & DC_EXEC) {
|
||||
if (v->current_order.flags & OF_UNLOAD) v->cur_order_index++;
|
||||
if (v->current_order.flags & OFB_UNLOAD) v->cur_order_index++;
|
||||
v->current_order.type = OT_DUMMY;
|
||||
v->current_order.flags = 0;
|
||||
InvalidateWindowWidget(WC_VEHICLE_VIEW, v->index, STATUS_BAR);
|
||||
InvalidateWindowWidget(WC_VEHICLE_VIEW, v->index, VVW_WIDGET_START_STOP_VEH);
|
||||
}
|
||||
} else {
|
||||
bool next_airport_has_hangar = true;
|
||||
@@ -605,11 +610,11 @@ CommandCost CmdSendAircraftToHangar(TileIndex tile, uint32 flags, uint32 p1, uin
|
||||
if (v->current_order.type == OT_LOADING) v->LeaveStation();
|
||||
|
||||
v->current_order.type = OT_GOTO_DEPOT;
|
||||
v->current_order.flags = OF_NON_STOP;
|
||||
if (!(p2 & DEPOT_SERVICE)) SetBit(v->current_order.flags, OFB_HALT_IN_DEPOT);
|
||||
v->current_order.flags = OFB_NON_STOP;
|
||||
if (!(p2 & DEPOT_SERVICE)) SetBit(v->current_order.flags, OF_HALT_IN_DEPOT);
|
||||
v->current_order.refit_cargo = CT_INVALID;
|
||||
v->current_order.dest = next_airport_index;
|
||||
InvalidateWindowWidget(WC_VEHICLE_VIEW, v->index, STATUS_BAR);
|
||||
InvalidateWindowWidget(WC_VEHICLE_VIEW, v->index, VVW_WIDGET_START_STOP_VEH);
|
||||
if (v->u.air.state == FLYING && !next_airport_has_hangar) {
|
||||
/* The aircraft is now heading for a different hangar than the next in the orders */
|
||||
AircraftNextAirportPos_and_Order(v);
|
||||
@@ -641,13 +646,12 @@ CommandCost CmdRefitAircraft(TileIndex tile, uint32 flags, uint32 p1, uint32 p2)
|
||||
|
||||
if (v->type != VEH_AIRCRAFT || !CheckOwnership(v->owner)) return CMD_ERROR;
|
||||
if (!v->IsStoppedInDepot()) return_cmd_error(STR_A01B_AIRCRAFT_MUST_BE_STOPPED);
|
||||
if (v->vehstatus & VS_CRASHED) return_cmd_error(STR_CAN_T_REFIT_DESTROYED_VEHICLE);
|
||||
|
||||
/* Check cargo */
|
||||
CargoID new_cid = GB(p2, 0, 8);
|
||||
if (new_cid >= NUM_CARGO || !CanRefitTo(v->engine_type, new_cid)) return CMD_ERROR;
|
||||
|
||||
SET_EXPENSES_TYPE(EXPENSES_AIRCRAFT_RUN);
|
||||
|
||||
/* Check the refit capacity callback */
|
||||
uint16 callback = CALLBACK_FAILED;
|
||||
if (HasBit(EngInfo(v->engine_type)->callbackmask, CBM_VEHICLE_REFIT_CAPACITY)) {
|
||||
@@ -702,7 +706,7 @@ CommandCost CmdRefitAircraft(TileIndex tile, uint32 flags, uint32 p1, uint32 p2)
|
||||
|
||||
static void CheckIfAircraftNeedsService(Vehicle *v)
|
||||
{
|
||||
if (_patches.servint_aircraft == 0 || !VehicleNeedsService(v)) return;
|
||||
if (_patches.servint_aircraft == 0 || !v->NeedsAutomaticServicing()) return;
|
||||
if (v->IsInDepot()) {
|
||||
VehicleServiceInDepot(v);
|
||||
return;
|
||||
@@ -714,37 +718,37 @@ static void CheckIfAircraftNeedsService(Vehicle *v)
|
||||
// printf("targetairport = %d, st->index = %d\n", v->u.air.targetairport, st->index);
|
||||
// v->u.air.targetairport = st->index;
|
||||
v->current_order.type = OT_GOTO_DEPOT;
|
||||
v->current_order.flags = OF_NON_STOP;
|
||||
InvalidateWindowWidget(WC_VEHICLE_VIEW, v->index, STATUS_BAR);
|
||||
v->current_order.flags = OFB_NON_STOP;
|
||||
InvalidateWindowWidget(WC_VEHICLE_VIEW, v->index, VVW_WIDGET_START_STOP_VEH);
|
||||
} else if (v->current_order.type == OT_GOTO_DEPOT) {
|
||||
v->current_order.type = OT_DUMMY;
|
||||
v->current_order.flags = 0;
|
||||
InvalidateWindowWidget(WC_VEHICLE_VIEW, v->index, STATUS_BAR);
|
||||
InvalidateWindowWidget(WC_VEHICLE_VIEW, v->index, VVW_WIDGET_START_STOP_VEH);
|
||||
}
|
||||
}
|
||||
|
||||
void OnNewDay_Aircraft(Vehicle *v)
|
||||
void Aircraft::OnNewDay()
|
||||
{
|
||||
if (!IsNormalAircraft(v)) return;
|
||||
if (!IsNormalAircraft(this)) return;
|
||||
|
||||
if ((++v->day_counter & 7) == 0) DecreaseVehicleValue(v);
|
||||
if ((++this->day_counter & 7) == 0) DecreaseVehicleValue(this);
|
||||
|
||||
CheckOrders(v);
|
||||
CheckOrders(this);
|
||||
|
||||
CheckVehicleBreakdown(v);
|
||||
AgeVehicle(v);
|
||||
CheckIfAircraftNeedsService(v);
|
||||
CheckVehicleBreakdown(this);
|
||||
AgeVehicle(this);
|
||||
CheckIfAircraftNeedsService(this);
|
||||
|
||||
if (v->vehstatus & VS_STOPPED) return;
|
||||
if (this->running_ticks == 0) return;
|
||||
|
||||
CommandCost cost = CommandCost(GetVehicleProperty(v, 0x0E, AircraftVehInfo(v->engine_type)->running_cost) * _price.aircraft_running / 364);
|
||||
CommandCost cost(EXPENSES_AIRCRAFT_RUN, GetVehicleProperty(this, 0x0E, AircraftVehInfo(this->engine_type)->running_cost) * _price.aircraft_running * this->running_ticks / (364 * DAY_TICKS));
|
||||
|
||||
v->profit_this_year -= cost.GetCost() >> 8;
|
||||
this->profit_this_year -= cost.GetCost();
|
||||
this->running_ticks = 0;
|
||||
|
||||
SET_EXPENSES_TYPE(EXPENSES_AIRCRAFT_RUN);
|
||||
SubtractMoneyFromPlayerFract(v->owner, cost);
|
||||
SubtractMoneyFromPlayerFract(this->owner, cost);
|
||||
|
||||
InvalidateWindow(WC_VEHICLE_DETAILS, v->index);
|
||||
InvalidateWindow(WC_VEHICLE_DETAILS, this->index);
|
||||
InvalidateWindowClasses(WC_AIRCRAFT_LIST);
|
||||
}
|
||||
|
||||
@@ -922,6 +926,10 @@ static int UpdateAircraftSpeed(Vehicle *v, uint speed_limit = SPEED_LIMIT_NONE,
|
||||
uint spd = v->acceleration * 16;
|
||||
byte t;
|
||||
|
||||
/* Adjust speed limits by plane speed factor to prevent taxiing
|
||||
* and take-off speeds being too low. */
|
||||
speed_limit *= _patches.plane_speed;
|
||||
|
||||
if (v->u.air.cached_max_speed < speed_limit) {
|
||||
if (v->cur_speed < speed_limit) hard_limit = false;
|
||||
speed_limit = v->u.air.cached_max_speed;
|
||||
@@ -931,7 +939,15 @@ static int UpdateAircraftSpeed(Vehicle *v, uint speed_limit = SPEED_LIMIT_NONE,
|
||||
|
||||
v->subspeed = (t=v->subspeed) + (byte)spd;
|
||||
|
||||
if (!hard_limit && v->cur_speed > speed_limit) speed_limit = v->cur_speed - (v->cur_speed / 48);
|
||||
/* Aircraft's current speed is used twice so that very fast planes are
|
||||
* forced to slow down rapidly in the short distance needed. The magic
|
||||
* value 16384 was determined to give similar results to the old speed/48
|
||||
* method at slower speeds. This also results in less reduction at slow
|
||||
* speeds to that aircraft do not get to taxi speed straight after
|
||||
* touchdown. */
|
||||
if (!hard_limit && v->cur_speed > speed_limit) {
|
||||
speed_limit = v->cur_speed - max(1, ((v->cur_speed * v->cur_speed) / 16384) / _patches.plane_speed);
|
||||
}
|
||||
|
||||
spd = min(v->cur_speed + (spd >> 8) + (v->subspeed < t), speed_limit);
|
||||
|
||||
@@ -942,9 +958,12 @@ static int UpdateAircraftSpeed(Vehicle *v, uint speed_limit = SPEED_LIMIT_NONE,
|
||||
if (spd != v->cur_speed) {
|
||||
v->cur_speed = spd;
|
||||
if (_patches.vehicle_speed)
|
||||
InvalidateWindowWidget(WC_VEHICLE_VIEW, v->index, STATUS_BAR);
|
||||
InvalidateWindowWidget(WC_VEHICLE_VIEW, v->index, VVW_WIDGET_START_STOP_VEH);
|
||||
}
|
||||
|
||||
/* Adjust distance moved by plane speed setting */
|
||||
if (_patches.plane_speed > 1) spd /= _patches.plane_speed;
|
||||
|
||||
if (!(v->direction & 1)) spd = spd * 3 / 4;
|
||||
|
||||
spd += v->progress;
|
||||
@@ -1088,34 +1107,36 @@ static bool AircraftController(Vehicle *v)
|
||||
|
||||
/* Helicopter landing. */
|
||||
if (amd->flag & AMED_HELI_LOWER) {
|
||||
count = UpdateAircraftSpeed(v);
|
||||
if (count > 0) {
|
||||
if (st->airport_tile == 0) {
|
||||
/* FIXME - AircraftController -> if station no longer exists, do not land
|
||||
* helicopter will circle until sign disappears, then go to next order
|
||||
* what to do when it is the only order left, right now it just stays in 1 place */
|
||||
v->u.air.state = FLYING;
|
||||
UpdateAircraftCache(v);
|
||||
AircraftNextAirportPos_and_Order(v);
|
||||
return false;
|
||||
}
|
||||
if (st->airport_tile == 0) {
|
||||
/* FIXME - AircraftController -> if station no longer exists, do not land
|
||||
* helicopter will circle until sign disappears, then go to next order
|
||||
* what to do when it is the only order left, right now it just stays in 1 place */
|
||||
v->u.air.state = FLYING;
|
||||
UpdateAircraftCache(v);
|
||||
AircraftNextAirportPos_and_Order(v);
|
||||
return false;
|
||||
}
|
||||
|
||||
/* Vehicle is now at the airport. */
|
||||
v->tile = st->airport_tile;
|
||||
/* Vehicle is now at the airport. */
|
||||
v->tile = st->airport_tile;
|
||||
|
||||
/* Find altitude of landing position. */
|
||||
int z = GetSlopeZ(x, y) + 1 + afc->delta_z;
|
||||
/* Find altitude of landing position. */
|
||||
int z = GetSlopeZ(x, y) + 1 + afc->delta_z;
|
||||
|
||||
if (z == v->z_pos) {
|
||||
Vehicle *u = v->Next()->Next();
|
||||
if (z == v->z_pos) {
|
||||
Vehicle *u = v->Next()->Next();
|
||||
|
||||
/* Increase speed of rotors. When speed is 80, we've landed. */
|
||||
if (u->cur_speed >= 80) return true;
|
||||
u->cur_speed += 4;
|
||||
} else if (v->z_pos > z) {
|
||||
SetAircraftPosition(v, v->x_pos, v->y_pos, max(v->z_pos - count, z));
|
||||
} else {
|
||||
SetAircraftPosition(v, v->x_pos, v->y_pos, min(v->z_pos + count, z));
|
||||
/* Increase speed of rotors. When speed is 80, we've landed. */
|
||||
if (u->cur_speed >= 80) return true;
|
||||
u->cur_speed += 4;
|
||||
} else {
|
||||
count = UpdateAircraftSpeed(v);
|
||||
if (count > 0) {
|
||||
if (v->z_pos > z) {
|
||||
SetAircraftPosition(v, v->x_pos, v->y_pos, max(v->z_pos - count, z));
|
||||
} else {
|
||||
SetAircraftPosition(v, v->x_pos, v->y_pos, min(v->z_pos + count, z));
|
||||
}
|
||||
}
|
||||
}
|
||||
return false;
|
||||
@@ -1195,7 +1216,7 @@ static bool AircraftController(Vehicle *v)
|
||||
|
||||
v->tile = gp.new_tile;
|
||||
/* If vehicle is in the air, use tile coordinate 0. */
|
||||
// if (amd->flag & (AMED_TAKEOFF | AMED_SLOWTURN | AMED_LAND)) v->tile = 0;
|
||||
if (amd->flag & (AMED_TAKEOFF | AMED_SLOWTURN | AMED_LAND)) v->tile = 0;
|
||||
|
||||
/* Adjust Z for land or takeoff? */
|
||||
uint z = v->z_pos;
|
||||
@@ -1289,8 +1310,7 @@ static void HandleCrashedAircraft(Vehicle *v)
|
||||
CLRBITS(st->airport_flags, RUNWAY_IN_OUT_block); // commuter airport
|
||||
CLRBITS(st->airport_flags, RUNWAY_IN2_block); // intercontinental
|
||||
|
||||
BeginVehicleMove(v);
|
||||
EndVehicleMove(v);
|
||||
MarkSingleVehicleDirty(v);
|
||||
|
||||
DoDeleteAircraft(v);
|
||||
}
|
||||
@@ -1348,9 +1368,9 @@ static void ProcessAircraftOrder(Vehicle *v)
|
||||
{
|
||||
switch (v->current_order.type) {
|
||||
case OT_GOTO_DEPOT:
|
||||
if (!(v->current_order.flags & OF_PART_OF_ORDERS)) return;
|
||||
if (v->current_order.flags & OF_SERVICE_IF_NEEDED &&
|
||||
!VehicleNeedsService(v)) {
|
||||
if (!(v->current_order.flags & OFB_PART_OF_ORDERS)) return;
|
||||
if (v->current_order.flags & OFB_SERVICE_IF_NEEDED &&
|
||||
!v->NeedsServicing()) {
|
||||
UpdateVehicleTimetable(v, true);
|
||||
v->cur_order_index++;
|
||||
}
|
||||
@@ -1418,7 +1438,7 @@ void Aircraft::MarkDirty()
|
||||
{
|
||||
this->cur_image = this->GetImage(this->direction);
|
||||
if (this->subtype == AIR_HELICOPTER) this->Next()->Next()->cur_image = GetRotorImage(this);
|
||||
MarkAllViewportsDirty(this->left_coord, this->top_coord, this->right_coord + 1, this->bottom_coord + 1);
|
||||
MarkSingleVehicleDirty(this);
|
||||
}
|
||||
|
||||
static void CrashAirplane(Vehicle *v)
|
||||
@@ -1550,6 +1570,45 @@ static void AircraftLeaveHangar(Vehicle *v)
|
||||
InvalidateWindowClasses(WC_AIRCRAFT_LIST);
|
||||
}
|
||||
|
||||
/** Checks if an aircraft should head towards a hangar because it needs replacement
|
||||
* @param *v the vehicle to test
|
||||
* @return true if the aircraft should head towards a hangar
|
||||
*/
|
||||
static inline bool CheckSendAircraftToHangarForReplacement(const Vehicle *v)
|
||||
{
|
||||
EngineID new_engine;
|
||||
Player *p = GetPlayer(v->owner);
|
||||
|
||||
if (VehicleHasDepotOrders(v)) return false; // The aircraft will end up in the hangar eventually on it's own
|
||||
|
||||
new_engine = EngineReplacementForPlayer(p, v->engine_type, v->group_id);
|
||||
|
||||
if (new_engine == INVALID_ENGINE) {
|
||||
/* There is no autoreplace assigned to this EngineID so we will set it to renew to the same type if needed */
|
||||
new_engine = v->engine_type;
|
||||
|
||||
if (!v->NeedsAutorenewing(p)) {
|
||||
/* No need to replace the aircraft */
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
if (!HasBit(GetEngine(new_engine)->player_avail, v->owner)) {
|
||||
/* Engine is not buildable anymore */
|
||||
return false;
|
||||
}
|
||||
|
||||
if (p->player_money < (p->engine_renew_money + (2 * DoCommand(0, new_engine, 0, DC_QUERY_COST, CMD_BUILD_AIRCRAFT).GetCost()))) {
|
||||
/* We lack enough money to request the replacement right away.
|
||||
* We want 2*(the price of the new vehicle) and not looking at the value of the vehicle we are going to sell.
|
||||
* The reason is that we don't want to send a whole lot of vehicles to the hangars when we only have enough money to replace a single one.
|
||||
* Remember this happens in the background so the user can't stop this. */
|
||||
return false;
|
||||
}
|
||||
|
||||
/* We found no reason NOT to send the aircraft to a hangar so we will send it there at once */
|
||||
return true;
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
/////////////////// AIRCRAFT MOVEMENT SCHEME ////////////////////////////////
|
||||
@@ -1678,22 +1737,16 @@ static void AircraftEventHandler_EndTakeOff(Vehicle *v, const AirportFTAClass *a
|
||||
|
||||
static void AircraftEventHandler_HeliTakeOff(Vehicle *v, const AirportFTAClass *apc)
|
||||
{
|
||||
const Player* p = GetPlayer(v->owner);
|
||||
v->u.air.state = FLYING;
|
||||
v->UpdateDeltaXY(INVALID_DIR);
|
||||
|
||||
/* get the next position to go to, differs per airport */
|
||||
AircraftNextAirportPos_and_Order(v);
|
||||
|
||||
/* check if the aircraft needs to be replaced or renewed and send it to a hangar if needed
|
||||
* unless it is due for renewal but the engine is no longer available */
|
||||
if (v->owner == _local_player && (
|
||||
EngineHasReplacementForPlayer(p, v->engine_type, v->group_id) ||
|
||||
((p->engine_renew && v->age - v->max_age > p->engine_renew_months * 30) &&
|
||||
HasBit(GetEngine(v->engine_type)->player_avail, _local_player))
|
||||
)) {
|
||||
_current_player = _local_player;
|
||||
DoCommandP(v->tile, v->index, DEPOT_SERVICE | DEPOT_LOCATE_HANGAR, NULL, CMD_SEND_AIRCRAFT_TO_HANGAR | CMD_SHOW_NO_ERROR);
|
||||
/* Send the helicopter to a hangar if needed for replacement */
|
||||
if (CheckSendAircraftToHangarForReplacement(v)) {
|
||||
_current_player = v->owner;
|
||||
DoCommand(v->tile, v->index, DEPOT_SERVICE | DEPOT_LOCATE_HANGAR, DC_EXEC, CMD_SEND_AIRCRAFT_TO_HANGAR);
|
||||
_current_player = OWNER_NONE;
|
||||
}
|
||||
}
|
||||
@@ -1743,16 +1796,10 @@ static void AircraftEventHandler_Landing(Vehicle *v, const AirportFTAClass *apc)
|
||||
AircraftLandAirplane(v); // maybe crash airplane
|
||||
|
||||
/* check if the aircraft needs to be replaced or renewed and send it to a hangar if needed */
|
||||
if (v->current_order.type != OT_GOTO_DEPOT && v->owner == _local_player) {
|
||||
/* only the vehicle owner needs to calculate the rest (locally) */
|
||||
const Player* p = GetPlayer(v->owner);
|
||||
if (EngineHasReplacementForPlayer(p, v->engine_type, v->group_id) ||
|
||||
(p->engine_renew && v->age - v->max_age > (p->engine_renew_months * 30))) {
|
||||
/* send the aircraft to the hangar at next airport */
|
||||
_current_player = _local_player;
|
||||
DoCommandP(v->tile, v->index, DEPOT_SERVICE, NULL, CMD_SEND_AIRCRAFT_TO_HANGAR | CMD_SHOW_NO_ERROR);
|
||||
_current_player = OWNER_NONE;
|
||||
}
|
||||
if (CheckSendAircraftToHangarForReplacement(v)) {
|
||||
_current_player = v->owner;
|
||||
DoCommand(v->tile, v->index, DEPOT_SERVICE, DC_EXEC, CMD_SEND_AIRCRAFT_TO_HANGAR);
|
||||
_current_player = OWNER_NONE;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2090,7 +2137,6 @@ static bool AirportFindFreeHelipad(Vehicle *v, const AirportFTAClass *apc)
|
||||
static void AircraftEventHandler(Vehicle *v, int loop)
|
||||
{
|
||||
v->tick_counter++;
|
||||
v->current_order_time++;
|
||||
|
||||
if (v->vehstatus & VS_CRASHED) {
|
||||
HandleCrashedAircraft(v);
|
||||
@@ -2104,7 +2150,7 @@ static void AircraftEventHandler(Vehicle *v, int loop)
|
||||
if (v->breakdown_ctr <= 2) {
|
||||
HandleBrokenAircraft(v);
|
||||
} else {
|
||||
v->breakdown_ctr--;
|
||||
if (v->current_order.type != OT_LOADING) v->breakdown_ctr--;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2121,10 +2167,14 @@ void Aircraft::Tick()
|
||||
{
|
||||
if (!IsNormalAircraft(this)) return;
|
||||
|
||||
if (!(this->vehstatus & VS_STOPPED)) this->running_ticks++;
|
||||
|
||||
if (this->subtype == AIR_HELICOPTER) HelicopterTickHandler(this);
|
||||
|
||||
AgeAircraftCargo(this);
|
||||
|
||||
this->current_order_time++;
|
||||
|
||||
for (uint i = 0; i != 2; i++) {
|
||||
AircraftEventHandler(this, i);
|
||||
if (this->type != VEH_AIRCRAFT) // In case it was deleted
|
||||
|
@@ -6,22 +6,17 @@
|
||||
#include "openttd.h"
|
||||
#include "aircraft.h"
|
||||
#include "debug.h"
|
||||
#include "functions.h"
|
||||
#include "table/sprites.h"
|
||||
#include "table/strings.h"
|
||||
#include "strings.h"
|
||||
#include "map.h"
|
||||
#include "window.h"
|
||||
#include "gui.h"
|
||||
#include "vehicle.h"
|
||||
#include "gfx.h"
|
||||
#include "command.h"
|
||||
#include "engine.h"
|
||||
#include "viewport.h"
|
||||
#include "player.h"
|
||||
#include "depot.h"
|
||||
#include "vehicle_gui.h"
|
||||
#include "newgrf_engine.h"
|
||||
#include "strings_func.h"
|
||||
#include "vehicle_func.h"
|
||||
#include "gfx_func.h"
|
||||
|
||||
#include "table/sprites.h"
|
||||
#include "table/strings.h"
|
||||
|
||||
/**
|
||||
* Draw the details for the given vehicle at the position (x,y)
|
||||
|
@@ -5,13 +5,12 @@
|
||||
#include "stdafx.h"
|
||||
#include "openttd.h"
|
||||
#include "debug.h"
|
||||
#include "map.h"
|
||||
#include "airport.h"
|
||||
#include "macros.h"
|
||||
#include "variables.h"
|
||||
#include "airport_movement.h"
|
||||
#include "date.h"
|
||||
#include "helpers.hpp"
|
||||
#include "core/bitmath_func.hpp"
|
||||
#include "core/alloc_func.hpp"
|
||||
#include "date_func.h"
|
||||
#include "settings_type.h"
|
||||
|
||||
/* Uncomment this to print out a full report of the airport-structure
|
||||
* You should either use
|
||||
|
@@ -5,7 +5,8 @@
|
||||
#ifndef AIRPORT_H
|
||||
#define AIRPORT_H
|
||||
|
||||
#include "direction.h"
|
||||
#include "direction_type.h"
|
||||
#include "map_type.h"
|
||||
|
||||
enum {MAX_TERMINALS = 10};
|
||||
enum {MAX_HELIPADS = 4};
|
||||
|
@@ -4,20 +4,23 @@
|
||||
|
||||
#include "stdafx.h"
|
||||
#include "openttd.h"
|
||||
#include "table/sprites.h"
|
||||
#include "table/strings.h"
|
||||
#include "functions.h"
|
||||
#include "map.h"
|
||||
#include "window.h"
|
||||
#include "window_gui.h"
|
||||
#include "gui.h"
|
||||
#include "viewport.h"
|
||||
#include "gfx.h"
|
||||
#include "sound.h"
|
||||
#include "command.h"
|
||||
#include "vehicle.h"
|
||||
#include "station_gui.h"
|
||||
#include "terraform_gui.h"
|
||||
#include "command_func.h"
|
||||
#include "station.h"
|
||||
#include "airport.h"
|
||||
#include "depot.h"
|
||||
#include "sound_func.h"
|
||||
#include "window_func.h"
|
||||
#include "settings_type.h"
|
||||
#include "viewport_func.h"
|
||||
#include "gfx_func.h"
|
||||
#include "player_func.h"
|
||||
|
||||
#include "table/sprites.h"
|
||||
#include "table/strings.h"
|
||||
|
||||
static byte _selected_airport_type;
|
||||
|
||||
@@ -176,14 +179,19 @@ static void BuildAirportPickerWndProc(Window *w, WindowEvent *e)
|
||||
airport = GetAirport(_selected_airport_type);
|
||||
SetTileSelectSize(airport->size_x, airport->size_y);
|
||||
|
||||
int rad = _patches.modified_catchment ? airport->catchment : 4;
|
||||
int rad = _patches.modified_catchment ? airport->catchment : (uint)CA_UNMODIFIED;
|
||||
|
||||
if (_station_show_coverage) SetTileSelectBigSize(-rad, -rad, 2 * rad, 2 * rad);
|
||||
|
||||
DrawWindowWidgets(w);
|
||||
// strings such as 'Size' and 'Coverage Area'
|
||||
// 'Coverage Area'
|
||||
DrawStationCoverageAreaText(2, 206, SCT_ALL, rad);
|
||||
int text_end = DrawStationCoverageAreaText(2, 206, SCT_ALL, rad) + 4;
|
||||
if (text_end > w->widget[6].bottom) {
|
||||
SetWindowDirty(w);
|
||||
ResizeWindowForWidget(w, 6, 0, text_end - w->widget[6].bottom);
|
||||
SetWindowDirty(w);
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
|
@@ -4,15 +4,13 @@
|
||||
|
||||
#include "stdafx.h"
|
||||
#include "openttd.h"
|
||||
#include "functions.h"
|
||||
#include "command.h"
|
||||
#include "vehicle.h"
|
||||
#include "articulated_vehicles.h"
|
||||
#include "engine.h"
|
||||
#include "train.h"
|
||||
#include "roadveh.h"
|
||||
#include "newgrf_callbacks.h"
|
||||
#include "newgrf_engine.h"
|
||||
#include "vehicle_func.h"
|
||||
|
||||
|
||||
uint CountArticulatedParts(EngineID engine_type, bool purchase_window)
|
||||
@@ -28,7 +26,7 @@ uint CountArticulatedParts(EngineID engine_type, bool purchase_window)
|
||||
uint i;
|
||||
for (i = 1; i < MAX_UVALUE(EngineID); i++) {
|
||||
uint16 callback = GetVehicleCallback(CBID_VEHICLE_ARTIC_ENGINE, i, 0, engine_type, v);
|
||||
if (callback == CALLBACK_FAILED || callback == 0xFF) break;
|
||||
if (callback == CALLBACK_FAILED || GB(callback, 0, 8) == 0xFF) break;
|
||||
}
|
||||
|
||||
delete v;
|
||||
@@ -36,6 +34,42 @@ uint CountArticulatedParts(EngineID engine_type, bool purchase_window)
|
||||
return i - 1;
|
||||
}
|
||||
|
||||
|
||||
uint16 *GetCapacityOfArticulatedParts(EngineID engine, VehicleType type)
|
||||
{
|
||||
static uint16 capacity[NUM_CARGO];
|
||||
memset(capacity, 0, sizeof(capacity));
|
||||
|
||||
if (type == VEH_TRAIN) {
|
||||
const RailVehicleInfo *rvi = RailVehInfo(engine);
|
||||
capacity[rvi->cargo_type] = GetEngineProperty(engine, 0x14, rvi->capacity);
|
||||
if (rvi->railveh_type == RAILVEH_MULTIHEAD) capacity[rvi->cargo_type] += rvi->capacity;
|
||||
} else if (type == VEH_ROAD) {
|
||||
const RoadVehicleInfo *rvi = RoadVehInfo(engine);
|
||||
capacity[rvi->cargo_type] = GetEngineProperty(engine, 0x0F, rvi->capacity);
|
||||
}
|
||||
|
||||
if (!HasBit(EngInfo(engine)->callbackmask, CBM_VEHICLE_ARTIC_ENGINE)) return capacity;
|
||||
|
||||
for (uint i = 1; i < MAX_UVALUE(EngineID); i++) {
|
||||
uint16 callback = GetVehicleCallback(CBID_VEHICLE_ARTIC_ENGINE, i, 0, engine, NULL);
|
||||
if (callback == CALLBACK_FAILED || GB(callback, 0, 8) == 0xFF) break;
|
||||
|
||||
EngineID artic_engine = GetFirstEngineOfType(type) + GB(callback, 0, 7);
|
||||
|
||||
if (type == VEH_TRAIN) {
|
||||
const RailVehicleInfo *rvi = RailVehInfo(artic_engine);
|
||||
capacity[rvi->cargo_type] += GetEngineProperty(artic_engine, 0x14, rvi->capacity);
|
||||
} else if (type == VEH_ROAD) {
|
||||
const RoadVehicleInfo *rvi = RoadVehInfo(artic_engine);
|
||||
capacity[rvi->cargo_type] += GetEngineProperty(artic_engine, 0x0F, rvi->capacity);
|
||||
}
|
||||
}
|
||||
|
||||
return capacity;
|
||||
}
|
||||
|
||||
|
||||
void AddArticulatedParts(Vehicle **vl, VehicleType type)
|
||||
{
|
||||
const Vehicle *v = vl[0];
|
||||
@@ -45,7 +79,7 @@ void AddArticulatedParts(Vehicle **vl, VehicleType type)
|
||||
|
||||
for (uint i = 1; i < MAX_UVALUE(EngineID); i++) {
|
||||
uint16 callback = GetVehicleCallback(CBID_VEHICLE_ARTIC_ENGINE, i, 0, v->engine_type, v);
|
||||
if (callback == CALLBACK_FAILED || callback == 0xFF) return;
|
||||
if (callback == CALLBACK_FAILED || GB(callback, 0, 8) == 0xFF) return;
|
||||
|
||||
/* Attempt to use pre-allocated vehicles until they run out. This can happen
|
||||
* if the callback returns different values depending on the cargo type. */
|
||||
|
@@ -5,7 +5,10 @@
|
||||
#ifndef ARTICULATED_VEHICLES_H
|
||||
#define ARTICULATED_VEHICLES_H
|
||||
|
||||
#include "vehicle_type.h"
|
||||
|
||||
uint CountArticulatedParts(EngineID engine_type, bool purchase_window);
|
||||
uint16 *GetCapacityOfArticulatedParts(EngineID engine, VehicleType type);
|
||||
void AddArticulatedParts(Vehicle **vl, VehicleType type);
|
||||
|
||||
#endif /* ARTICULATED_VEHICLES_H */
|
||||
|
38
src/autoreplace_base.h
Normal file
38
src/autoreplace_base.h
Normal file
@@ -0,0 +1,38 @@
|
||||
/* $Id$ */
|
||||
|
||||
/** @file autoreplace_base.h Base class for autoreplaces/autorenews. */
|
||||
|
||||
#ifndef AUTOREPLACE_BASE_H
|
||||
#define AUTOREPLACE_BASE_H
|
||||
|
||||
#include "oldpool.h"
|
||||
#include "autoreplace_type.h"
|
||||
|
||||
/**
|
||||
* Memory pool for engine renew elements. DO NOT USE outside of engine.c. Is
|
||||
* placed here so the only exception to this rule, the saveload code, can use
|
||||
* it.
|
||||
*/
|
||||
DECLARE_OLD_POOL(EngineRenew, EngineRenew, 3, 8000)
|
||||
|
||||
/**
|
||||
* Struct to store engine replacements. DO NOT USE outside of engine.c. Is
|
||||
* placed here so the only exception to this rule, the saveload code, can use
|
||||
* it.
|
||||
*/
|
||||
struct EngineRenew : PoolItem<EngineRenew, EngineRenewID, &_EngineRenew_pool> {
|
||||
EngineID from;
|
||||
EngineID to;
|
||||
EngineRenew *next;
|
||||
GroupID group_id;
|
||||
|
||||
EngineRenew(EngineID from = INVALID_ENGINE, EngineID to = INVALID_ENGINE) : from(from), to(to), next(NULL) {}
|
||||
~EngineRenew() { this->from = INVALID_ENGINE; }
|
||||
|
||||
inline bool IsValid() const { return this->from != INVALID_ENGINE; }
|
||||
};
|
||||
|
||||
#define FOR_ALL_ENGINE_RENEWS_FROM(er, start) for (er = GetEngineRenew(start); er != NULL; er = (er->index + 1U < GetEngineRenewPoolSize()) ? GetEngineRenew(er->index + 1U) : NULL) if (er->IsValid())
|
||||
#define FOR_ALL_ENGINE_RENEWS(er) FOR_ALL_ENGINE_RENEWS_FROM(er, 0)
|
||||
|
||||
#endif /* AUTOREPLACE_BASE_H */
|
@@ -4,11 +4,8 @@
|
||||
#include "openttd.h"
|
||||
#include "roadveh.h"
|
||||
#include "ship.h"
|
||||
#include "table/strings.h"
|
||||
#include "functions.h"
|
||||
#include "news.h"
|
||||
#include "command.h"
|
||||
#include "player.h"
|
||||
#include "player_func.h"
|
||||
#include "engine.h"
|
||||
#include "debug.h"
|
||||
#include "vehicle_gui.h"
|
||||
@@ -17,7 +14,16 @@
|
||||
#include "aircraft.h"
|
||||
#include "cargotype.h"
|
||||
#include "group.h"
|
||||
#include "strings.h"
|
||||
#include "order.h"
|
||||
#include "strings_func.h"
|
||||
#include "command_func.h"
|
||||
#include "vehicle_func.h"
|
||||
#include "functions.h"
|
||||
#include "variables.h"
|
||||
#include "autoreplace_func.h"
|
||||
#include "articulated_vehicles.h"
|
||||
|
||||
#include "table/strings.h"
|
||||
|
||||
|
||||
/*
|
||||
@@ -52,7 +58,7 @@ static void MoveVehicleCargo(Vehicle *dest, Vehicle *source)
|
||||
* the complete train, which is without the weight of cargo we just
|
||||
* moved back into some (of the) new wagon(s).
|
||||
*/
|
||||
if (dest->type == VEH_TRAIN) TrainConsistChanged(dest->First());
|
||||
if (dest->type == VEH_TRAIN) TrainConsistChanged(dest->First(), true);
|
||||
}
|
||||
|
||||
static bool VerifyAutoreplaceRefitForOrders(const Vehicle *v, const EngineID engine_type)
|
||||
@@ -89,7 +95,7 @@ static CargoID GetNewCargoTypeForReplace(Vehicle *v, EngineID engine_type)
|
||||
|
||||
if (new_cargo_type == CT_INVALID) return CT_NO_REFIT; // Don't try to refit an engine with no cargo capacity
|
||||
|
||||
if (v->cargo_type == new_cargo_type || CanRefitTo(engine_type, v->cargo_type)) {
|
||||
if (v->cargo_cap != 0 && (v->cargo_type == new_cargo_type || CanRefitTo(engine_type, v->cargo_type))) {
|
||||
if (VerifyAutoreplaceRefitForOrders(v, engine_type)) {
|
||||
return v->cargo_type == new_cargo_type ? (CargoID)CT_NO_REFIT : v->cargo_type;
|
||||
} else {
|
||||
@@ -121,7 +127,7 @@ static CargoID GetNewCargoTypeForReplace(Vehicle *v, EngineID engine_type)
|
||||
* @param flags is the flags to use when calling DoCommand(). Mainly DC_EXEC counts
|
||||
* @return value is cost of the replacement or CMD_ERROR
|
||||
*/
|
||||
static CommandCost ReplaceVehicle(Vehicle **w, byte flags, Money total_cost)
|
||||
static CommandCost ReplaceVehicle(Vehicle **w, uint32 flags, Money total_cost)
|
||||
{
|
||||
CommandCost cost;
|
||||
CommandCost sell_value;
|
||||
@@ -131,21 +137,12 @@ static CommandCost ReplaceVehicle(Vehicle **w, byte flags, Money total_cost)
|
||||
const UnitID cached_unitnumber = old_v->unitnumber;
|
||||
bool new_front = false;
|
||||
Vehicle *new_v = NULL;
|
||||
char vehicle_name[32];
|
||||
char *vehicle_name = NULL;
|
||||
CargoID replacement_cargo_type;
|
||||
|
||||
/* If the vehicle belongs to a group, check if the group is protected from the global autoreplace.
|
||||
* If not, chek if an global auto replacement is defined */
|
||||
new_engine_type = (IsValidGroupID(old_v->group_id) && GetGroup(old_v->group_id)->replace_protection) ?
|
||||
INVALID_ENGINE :
|
||||
EngineReplacementForPlayer(p, old_v->engine_type, ALL_GROUP);
|
||||
|
||||
/* If we don't set new_egnine_type previously, we try to check if an autoreplacement was defined
|
||||
* for the group and the engine_type of the vehicle */
|
||||
if (new_engine_type == INVALID_ENGINE && !IsAllGroupID(old_v->group_id)) {
|
||||
new_engine_type = EngineReplacementForPlayer(p, old_v->engine_type, old_v->group_id);
|
||||
}
|
||||
|
||||
/* Check if there is a autoreplacement set for the vehicle */
|
||||
new_engine_type = EngineReplacementForPlayer(p, old_v->engine_type, old_v->group_id);
|
||||
/* if not, just renew to the same type */
|
||||
if (new_engine_type == INVALID_ENGINE) new_engine_type = old_v->engine_type;
|
||||
|
||||
replacement_cargo_type = GetNewCargoTypeForReplace(old_v, new_engine_type);
|
||||
@@ -158,12 +155,10 @@ static CommandCost ReplaceVehicle(Vehicle **w, byte flags, Money total_cost)
|
||||
/* We give the player a loan of the same amount as the sell value.
|
||||
* This is needed in case he needs the income from the sale to build the new vehicle.
|
||||
* We take it back if building fails or when we really sell the old engine */
|
||||
SET_EXPENSES_TYPE(EXPENSES_NEW_VEHICLES);
|
||||
SubtractMoneyFromPlayer(sell_value);
|
||||
|
||||
cost = DoCommand(old_v->tile, new_engine_type, 3, flags, GetCmdBuildVeh(old_v));
|
||||
cost = DoCommand(old_v->tile, new_engine_type, 0, flags | DC_AUTOREPLACE, GetCmdBuildVeh(old_v));
|
||||
if (CmdFailed(cost)) {
|
||||
SET_EXPENSES_TYPE(EXPENSES_NEW_VEHICLES);
|
||||
/* Take back the money we just gave the player */
|
||||
sell_value.MultiplyCost(-1);
|
||||
SubtractMoneyFromPlayer(sell_value);
|
||||
@@ -173,7 +168,10 @@ static CommandCost ReplaceVehicle(Vehicle **w, byte flags, Money total_cost)
|
||||
if (replacement_cargo_type != CT_NO_REFIT) {
|
||||
/* add refit cost */
|
||||
CommandCost refit_cost = GetRefitCost(new_engine_type);
|
||||
if (old_v->type == VEH_TRAIN && IsMultiheaded(old_v)) refit_cost.AddCost(refit_cost); // pay for both ends
|
||||
if (old_v->type == VEH_TRAIN && RailVehInfo(new_engine_type)->railveh_type == RAILVEH_MULTIHEAD) {
|
||||
/* Since it's a dualheaded engine we have to pay once more because the rear end is being refitted too. */
|
||||
refit_cost.AddCost(refit_cost);
|
||||
}
|
||||
cost.AddCost(refit_cost);
|
||||
}
|
||||
|
||||
@@ -209,7 +207,7 @@ static CommandCost ReplaceVehicle(Vehicle **w, byte flags, Money total_cost)
|
||||
DoCommand(0, (front->index << 16) | new_v->index, 1, DC_EXEC, CMD_MOVE_RAIL_VEHICLE);
|
||||
} else {
|
||||
// copy/clone the orders
|
||||
DoCommand(0, (old_v->index << 16) | new_v->index, IsOrderListShared(old_v) ? CO_SHARE : CO_COPY, DC_EXEC, CMD_CLONE_ORDER);
|
||||
DoCommand(0, (old_v->index << 16) | new_v->index, old_v->IsOrderListShared() ? CO_SHARE : CO_COPY, DC_EXEC, CMD_CLONE_ORDER);
|
||||
new_v->cur_order_index = old_v->cur_order_index;
|
||||
ChangeVehicleViewWindow(old_v, new_v);
|
||||
new_v->profit_this_year = old_v->profit_this_year;
|
||||
@@ -239,12 +237,7 @@ static CommandCost ReplaceVehicle(Vehicle **w, byte flags, Money total_cost)
|
||||
MoveVehicleCargo(new_v->type == VEH_TRAIN ? new_v->First() : new_v, old_v);
|
||||
|
||||
// Get the name of the old vehicle if it has a custom name.
|
||||
if (!IsCustomName(old_v->string_id)) {
|
||||
vehicle_name[0] = '\0';
|
||||
} else {
|
||||
SetDParam(0, old_v->index);
|
||||
GetString(vehicle_name, STR_VEHICLE_NAME, lastof(vehicle_name));
|
||||
}
|
||||
if (old_v->name != NULL) vehicle_name = strdup(old_v->name);
|
||||
} else { // flags & DC_EXEC not set
|
||||
CommandCost tmp_move;
|
||||
|
||||
@@ -253,7 +246,7 @@ static CommandCost ReplaceVehicle(Vehicle **w, byte flags, Money total_cost)
|
||||
if (next_veh != NULL) {
|
||||
/* Verify that the wagons can be placed on the engine in question.
|
||||
* This is done by building an engine, test if the wagons can be added and then sell the test engine. */
|
||||
DoCommand(old_v->tile, new_engine_type, 3, DC_EXEC, GetCmdBuildVeh(old_v));
|
||||
DoCommand(old_v->tile, new_engine_type, 0, DC_EXEC | DC_AUTOREPLACE, GetCmdBuildVeh(old_v));
|
||||
Vehicle *temp = GetVehicle(_new_vehicle_id);
|
||||
tmp_move = DoCommand(0, (temp->index << 16) | next_veh->index, 1, 0, CMD_MOVE_RAIL_VEHICLE);
|
||||
DoCommand(0, temp->index, 0, DC_EXEC, GetCmdSellVeh(old_v));
|
||||
@@ -263,7 +256,6 @@ static CommandCost ReplaceVehicle(Vehicle **w, byte flags, Money total_cost)
|
||||
/* Ensure that the player will not end up having negative money while autoreplacing
|
||||
* This is needed because the only other check is done after the income from selling the old vehicle is substracted from the cost */
|
||||
if (CmdFailed(tmp_move) || p->player_money < (cost.GetCost() + total_cost)) {
|
||||
SET_EXPENSES_TYPE(EXPENSES_NEW_VEHICLES);
|
||||
/* Pay back the loan */
|
||||
sell_value.MultiplyCost(-1);
|
||||
SubtractMoneyFromPlayer(sell_value);
|
||||
@@ -273,7 +265,6 @@ static CommandCost ReplaceVehicle(Vehicle **w, byte flags, Money total_cost)
|
||||
|
||||
/* Take back the money we just gave the player just before building the vehicle
|
||||
* The player will get the same amount now that the sale actually takes place */
|
||||
SET_EXPENSES_TYPE(EXPENSES_NEW_VEHICLES);
|
||||
sell_value.MultiplyCost(-1);
|
||||
SubtractMoneyFromPlayer(sell_value);
|
||||
|
||||
@@ -286,9 +277,10 @@ static CommandCost ReplaceVehicle(Vehicle **w, byte flags, Money total_cost)
|
||||
}
|
||||
|
||||
/* Transfer the name of the old vehicle */
|
||||
if ((flags & DC_EXEC) && vehicle_name[0] != '\0') {
|
||||
if ((flags & DC_EXEC) && vehicle_name != NULL) {
|
||||
_cmd_text = vehicle_name;
|
||||
DoCommand(0, new_v->index, 0, DC_EXEC, CMD_NAME_VEHICLE);
|
||||
free(vehicle_name);
|
||||
}
|
||||
|
||||
return cost;
|
||||
@@ -333,7 +325,7 @@ CommandCost MaybeReplaceVehicle(Vehicle *v, bool check, bool display_costs)
|
||||
v->leave_depot_instantly = false;
|
||||
|
||||
for (;;) {
|
||||
cost = CommandCost();
|
||||
cost = CommandCost(EXPENSES_NEW_VEHICLES);
|
||||
w = v;
|
||||
do {
|
||||
if (w->type == VEH_TRAIN && IsRearDualheaded(w)) {
|
||||
@@ -342,25 +334,9 @@ CommandCost MaybeReplaceVehicle(Vehicle *v, bool check, bool display_costs)
|
||||
}
|
||||
|
||||
// check if the vehicle should be replaced
|
||||
if (!p->engine_renew ||
|
||||
w->age - w->max_age < (p->engine_renew_months * 30) || // replace if engine is too old
|
||||
if (!w->NeedsAutorenewing(p) || // replace if engine is too old
|
||||
w->max_age == 0) { // rail cars got a max age of 0
|
||||
/* If the vehicle belongs to a group, check if the group is protected from the global autoreplace.
|
||||
If not, chek if an global auto remplacement is defined */
|
||||
if (IsValidGroupID(w->group_id)) {
|
||||
if (!EngineHasReplacementForPlayer(p, w->engine_type, w->group_id) && (
|
||||
GetGroup(w->group_id)->replace_protection ||
|
||||
!EngineHasReplacementForPlayer(p, w->engine_type, ALL_GROUP))) {
|
||||
continue;
|
||||
}
|
||||
} else if (IsDefaultGroupID(w->group_id)) {
|
||||
if (!EngineHasReplacementForPlayer(p, w->engine_type, DEFAULT_GROUP) &&
|
||||
!EngineHasReplacementForPlayer(p, w->engine_type, ALL_GROUP)) {
|
||||
continue;
|
||||
}
|
||||
} else if (!EngineHasReplacementForPlayer(p, w->engine_type, ALL_GROUP)) {
|
||||
continue;
|
||||
}
|
||||
if (!EngineHasReplacementForPlayer(p, w->engine_type, w->group_id)) continue;
|
||||
}
|
||||
|
||||
/* Now replace the vehicle */
|
||||
|
103
src/autoreplace_func.h
Normal file
103
src/autoreplace_func.h
Normal file
@@ -0,0 +1,103 @@
|
||||
/* $Id$ */
|
||||
|
||||
/** @file autoreplace_func.h Functions related to autoreplacing. */
|
||||
|
||||
#ifndef AUTOREPLACE_FUNC_H
|
||||
#define AUTOREPLACE_FUNC_H
|
||||
|
||||
#include "autoreplace_type.h"
|
||||
#include "player_base.h"
|
||||
|
||||
/**
|
||||
* Remove all engine replacement settings for the player.
|
||||
* @param erl The renewlist for a given player.
|
||||
* @return The new renewlist for the player.
|
||||
*/
|
||||
void RemoveAllEngineReplacement(EngineRenewList *erl);
|
||||
|
||||
/**
|
||||
* Retrieve the engine replacement in a given renewlist for an original engine type.
|
||||
* @param erl The renewlist to search in.
|
||||
* @param engine Engine type to be replaced.
|
||||
* @return The engine type to replace with, or INVALID_ENGINE if no
|
||||
* replacement is in the list.
|
||||
*/
|
||||
EngineID EngineReplacement(EngineRenewList erl, EngineID engine, GroupID group);
|
||||
|
||||
/**
|
||||
* Add an engine replacement to the given renewlist.
|
||||
* @param erl The renewlist to add to.
|
||||
* @param old_engine The original engine type.
|
||||
* @param new_engine The replacement engine type.
|
||||
* @param flags The calling command flags.
|
||||
* @return 0 on success, CMD_ERROR on failure.
|
||||
*/
|
||||
CommandCost AddEngineReplacement(EngineRenewList *erl, EngineID old_engine, EngineID new_engine, GroupID group, uint32 flags);
|
||||
|
||||
/**
|
||||
* Remove an engine replacement from a given renewlist.
|
||||
* @param erl The renewlist from which to remove the replacement
|
||||
* @param engine The original engine type.
|
||||
* @param flags The calling command flags.
|
||||
* @return 0 on success, CMD_ERROR on failure.
|
||||
*/
|
||||
CommandCost RemoveEngineReplacement(EngineRenewList *erl, EngineID engine, GroupID group, uint32 flags);
|
||||
|
||||
/**
|
||||
* Remove all engine replacement settings for the given player.
|
||||
* @param p Player.
|
||||
*/
|
||||
static inline void RemoveAllEngineReplacementForPlayer(Player *p)
|
||||
{
|
||||
RemoveAllEngineReplacement(&p->engine_renew_list);
|
||||
}
|
||||
|
||||
/**
|
||||
* Retrieve the engine replacement for the given player and original engine type.
|
||||
* @param p Player.
|
||||
* @param engine Engine type.
|
||||
* @return The engine type to replace with, or INVALID_ENGINE if no
|
||||
* replacement is in the list.
|
||||
*/
|
||||
static inline EngineID EngineReplacementForPlayer(const Player *p, EngineID engine, GroupID group)
|
||||
{
|
||||
return EngineReplacement(p->engine_renew_list, engine, group);
|
||||
}
|
||||
|
||||
/**
|
||||
* Check if a player has a replacement set up for the given engine.
|
||||
* @param p Player.
|
||||
* @param engine Engine type to be replaced.
|
||||
* @return true if a replacement was set up, false otherwise.
|
||||
*/
|
||||
static inline bool EngineHasReplacementForPlayer(const Player *p, EngineID engine, GroupID group)
|
||||
{
|
||||
return EngineReplacementForPlayer(p, engine, group) != INVALID_ENGINE;
|
||||
}
|
||||
|
||||
/**
|
||||
* Add an engine replacement for the player.
|
||||
* @param p Player.
|
||||
* @param old_engine The original engine type.
|
||||
* @param new_engine The replacement engine type.
|
||||
* @param flags The calling command flags.
|
||||
* @return 0 on success, CMD_ERROR on failure.
|
||||
*/
|
||||
static inline CommandCost AddEngineReplacementForPlayer(Player *p, EngineID old_engine, EngineID new_engine, GroupID group, uint32 flags)
|
||||
{
|
||||
return AddEngineReplacement(&p->engine_renew_list, old_engine, new_engine, group, flags);
|
||||
}
|
||||
|
||||
/**
|
||||
* Remove an engine replacement for the player.
|
||||
* @param p Player.
|
||||
* @param engine The original engine type.
|
||||
* @param flags The calling command flags.
|
||||
* @return 0 on success, CMD_ERROR on failure.
|
||||
*/
|
||||
static inline CommandCost RemoveEngineReplacementForPlayer(Player *p, EngineID engine, GroupID group, uint32 flags)
|
||||
{
|
||||
return RemoveEngineReplacement(&p->engine_renew_list, engine, group, flags);
|
||||
}
|
||||
|
||||
#endif /* AUTOREPLACE_FUNC_H */
|
@@ -5,18 +5,23 @@
|
||||
#include "stdafx.h"
|
||||
#include "openttd.h"
|
||||
#include "debug.h"
|
||||
#include "functions.h"
|
||||
#include "table/sprites.h"
|
||||
#include "table/strings.h"
|
||||
#include "strings.h"
|
||||
#include "window.h"
|
||||
#include "gui.h"
|
||||
#include "command.h"
|
||||
#include "command_func.h"
|
||||
#include "variables.h"
|
||||
#include "vehicle_gui.h"
|
||||
#include "newgrf_engine.h"
|
||||
#include "group.h"
|
||||
#include "rail.h"
|
||||
#include "strings_func.h"
|
||||
#include "window_func.h"
|
||||
#include "vehicle_func.h"
|
||||
#include "autoreplace_func.h"
|
||||
#include "gfx_func.h"
|
||||
#include "player_func.h"
|
||||
#include "widgets/dropdown_func.h"
|
||||
|
||||
#include "table/sprites.h"
|
||||
#include "table/strings.h"
|
||||
|
||||
static RailType _railtype_selected_in_replace_gui;
|
||||
|
||||
@@ -31,6 +36,33 @@ static const StringID _rail_types_list[] = {
|
||||
INVALID_STRING_ID
|
||||
};
|
||||
|
||||
enum ReplaceVehicleWindowWidgets {
|
||||
RVW_WIDGET_LEFT_DETAILS = 3,
|
||||
RVW_WIDGET_START_REPLACE,
|
||||
RVW_WIDGET_INFO_TAB,
|
||||
RVW_WIDGET_STOP_REPLACE,
|
||||
RVW_WIDGET_LEFT_MATRIX,
|
||||
RVW_WIDGET_LEFT_SCROLLBAR,
|
||||
RVW_WIDGET_RIGHT_MATRIX,
|
||||
RVW_WIDGET_RIGHT_SCROLLBAR,
|
||||
RVW_WIDGET_RIGHT_DETAILS,
|
||||
|
||||
RVW_WIDGET_TRAIN_ENGINEWAGON_TOGGLE,
|
||||
RVW_WIDGET_TRAIN_FLUFF_LEFT,
|
||||
RVW_WIDGET_TRAIN_RAILTYPE_DROPDOWN,
|
||||
RVW_WIDGET_TRAIN_FLUFF_RIGHT,
|
||||
RVW_WIDGET_TRAIN_WAGONREMOVE_TOGGLE,
|
||||
};
|
||||
|
||||
static int CDECL TrainEngineNumberSorter(const void *a, const void *b)
|
||||
{
|
||||
const EngineID va = *(const EngineID*)a;
|
||||
const EngineID vb = *(const EngineID*)b;
|
||||
int r = ListPositionOfEngine(va) - ListPositionOfEngine(vb);
|
||||
|
||||
return r;
|
||||
}
|
||||
|
||||
/* General Vehicle GUI based procedures that are independent of vehicle types */
|
||||
void InitializeVehiclesGuiList()
|
||||
{
|
||||
@@ -48,7 +80,7 @@ void InitializeVehiclesGuiList()
|
||||
void InvalidateAutoreplaceWindow(EngineID e, GroupID id_g)
|
||||
{
|
||||
Player *p = GetPlayer(_local_player);
|
||||
byte type = GetEngine(e)->type;
|
||||
VehicleType type = GetEngine(e)->type;
|
||||
uint num_engines = GetGroupNumEngines(_local_player, id_g, e);
|
||||
|
||||
if (num_engines == 0 || p->num_engines[e] == 0) {
|
||||
@@ -143,7 +175,7 @@ static void GenerateReplaceVehList(Window *w, bool draw_left)
|
||||
{
|
||||
EngineID e;
|
||||
EngineID selected_engine = INVALID_ENGINE;
|
||||
byte type = w->window_number;
|
||||
VehicleType type = (VehicleType)w->window_number;
|
||||
byte i = draw_left ? 0 : 1;
|
||||
|
||||
EngineList *list = &WP(w, replaceveh_d).list[i];
|
||||
@@ -172,6 +204,7 @@ static void GenerateReplaceVehList(Window *w, bool draw_left)
|
||||
if (e == WP(w, replaceveh_d).sel_engine[i]) selected_engine = e; // The selected engine is still in the list
|
||||
}
|
||||
WP(w, replaceveh_d).sel_engine[i] = selected_engine; // update which engine we selected (the same or none, if it's not in the list anymore)
|
||||
if (type == VEH_TRAIN) EngList_Sort(list, &TrainEngineNumberSorter);
|
||||
}
|
||||
|
||||
/** Generate the lists
|
||||
@@ -240,7 +273,7 @@ static void ReplaceVehicleWndProc(Window *w, WindowEvent *e)
|
||||
|
||||
Player *p = GetPlayer(_local_player);
|
||||
EngineID selected_id[2];
|
||||
const GroupID selected_group = WP(w,replaceveh_d).sel_group;
|
||||
const GroupID selected_group = WP(w, replaceveh_d).sel_group;
|
||||
|
||||
selected_id[0] = WP(w, replaceveh_d).sel_engine[0];
|
||||
selected_id[1] = WP(w, replaceveh_d).sel_engine[1];
|
||||
@@ -249,7 +282,7 @@ static void ReplaceVehicleWndProc(Window *w, WindowEvent *e)
|
||||
* Either list is empty
|
||||
* or The selected replacement engine has a replacement (to prevent loops)
|
||||
* or The right list (new replacement) has the existing replacement vehicle selected */
|
||||
w->SetWidgetDisabledState(4,
|
||||
w->SetWidgetDisabledState(RVW_WIDGET_START_REPLACE,
|
||||
selected_id[0] == INVALID_ENGINE ||
|
||||
selected_id[1] == INVALID_ENGINE ||
|
||||
EngineReplacementForPlayer(p, selected_id[1], selected_group) != INVALID_ENGINE ||
|
||||
@@ -258,7 +291,7 @@ static void ReplaceVehicleWndProc(Window *w, WindowEvent *e)
|
||||
/* Disable the "Stop Replacing" button if:
|
||||
* The left list (existing vehicle) is empty
|
||||
* or The selected vehicle has no replacement set up */
|
||||
w->SetWidgetDisabledState(6,
|
||||
w->SetWidgetDisabledState(RVW_WIDGET_STOP_REPLACE,
|
||||
selected_id[0] == INVALID_ENGINE ||
|
||||
!EngineHasReplacementForPlayer(p, selected_id[0], selected_group));
|
||||
|
||||
@@ -273,18 +306,18 @@ static void ReplaceVehicleWndProc(Window *w, WindowEvent *e)
|
||||
SetDParam(2, WP(w, replaceveh_d).wagon_btnstate ? STR_ENGINES : STR_WAGONS);
|
||||
|
||||
/* sets the colour of that art thing */
|
||||
w->widget[13].color = _player_colors[_local_player];
|
||||
w->widget[16].color = _player_colors[_local_player];
|
||||
w->widget[RVW_WIDGET_TRAIN_FLUFF_LEFT].color = _player_colors[_local_player];
|
||||
w->widget[RVW_WIDGET_TRAIN_FLUFF_RIGHT].color = _player_colors[_local_player];
|
||||
}
|
||||
|
||||
if (w->window_number == VEH_TRAIN) {
|
||||
/* Show the selected railtype in the pulldown menu */
|
||||
RailType railtype = _railtype_selected_in_replace_gui;
|
||||
w->widget[RVW_WIDGET_TRAIN_RAILTYPE_DROPDOWN].data = _rail_types_list[railtype];
|
||||
}
|
||||
|
||||
DrawWindowWidgets(w);
|
||||
|
||||
if (w->window_number == VEH_TRAIN) {
|
||||
/* Draw the selected railtype in the pulldown menu */
|
||||
RailType railtype = _railtype_selected_in_replace_gui;
|
||||
DrawString(157, w->widget[14].top + 1, _rail_types_list[railtype], TC_BLACK);
|
||||
}
|
||||
|
||||
/* sets up the string for the vehicle that is being replaced to */
|
||||
if (selected_id[0] != INVALID_ENGINE) {
|
||||
if (!EngineHasReplacementForPlayer(p, selected_id[0], selected_group)) {
|
||||
@@ -297,22 +330,28 @@ static void ReplaceVehicleWndProc(Window *w, WindowEvent *e)
|
||||
SetDParam(0, STR_NOT_REPLACING_VEHICLE_SELECTED);
|
||||
}
|
||||
|
||||
DrawString(145, w->widget[5].top + 1, STR_02BD, TC_BLACK);
|
||||
DrawString(145, w->widget[RVW_WIDGET_INFO_TAB].top + 1, STR_02BD, TC_BLACK);
|
||||
|
||||
/* Draw the lists */
|
||||
for(byte i = 0; i < 2; i++) {
|
||||
uint16 x = i == 0 ? 2 : 230; // at what X offset
|
||||
uint widget = (i == 0) ? RVW_WIDGET_LEFT_MATRIX : RVW_WIDGET_RIGHT_MATRIX;
|
||||
EngineList list = WP(w, replaceveh_d).list[i]; // which list to draw
|
||||
EngineID start = i == 0 ? w->vscroll.pos : w->vscroll2.pos; // what is the offset for the start (scrolling)
|
||||
EngineID end = min((i == 0 ? w->vscroll.cap : w->vscroll2.cap) + start, EngList_Count(&list));
|
||||
|
||||
/* Do the actual drawing */
|
||||
DrawEngineList((VehicleType)w->window_number, x, 15, list, start, end, WP(w, replaceveh_d).sel_engine[i], i == 0, selected_group);
|
||||
DrawEngineList((VehicleType)w->window_number, w->widget[widget].left + 2, w->widget[widget].top + 1, list, start, end, WP(w, replaceveh_d).sel_engine[i], i == 0, selected_group);
|
||||
|
||||
/* Also draw the details if an engine is selected */
|
||||
if (WP(w, replaceveh_d).sel_engine[i] != INVALID_ENGINE) {
|
||||
const Widget *wi = &w->widget[i == 0 ? 3 : 11];
|
||||
DrawVehiclePurchaseInfo(wi->left + 2, wi->top + 1, wi->right - wi->left - 2, WP(w, replaceveh_d).sel_engine[i]);
|
||||
const Widget *wi = &w->widget[i == 0 ? RVW_WIDGET_LEFT_DETAILS : RVW_WIDGET_RIGHT_DETAILS];
|
||||
int text_end = DrawVehiclePurchaseInfo(wi->left + 2, wi->top + 1, wi->right - wi->left - 2, WP(w, replaceveh_d).sel_engine[i]);
|
||||
|
||||
if (text_end > wi->bottom) {
|
||||
SetWindowDirty(w);
|
||||
ResizeWindowForWidget(w, i == 0 ? RVW_WIDGET_LEFT_DETAILS : RVW_WIDGET_RIGHT_DETAILS, 0, text_end - wi->bottom);
|
||||
SetWindowDirty(w);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -320,39 +359,38 @@ static void ReplaceVehicleWndProc(Window *w, WindowEvent *e)
|
||||
|
||||
case WE_CLICK: {
|
||||
switch (e->we.click.widget) {
|
||||
case 12:
|
||||
case RVW_WIDGET_TRAIN_ENGINEWAGON_TOGGLE:
|
||||
WP(w, replaceveh_d).wagon_btnstate = !(WP(w, replaceveh_d).wagon_btnstate);
|
||||
WP(w, replaceveh_d).update_left = true;
|
||||
WP(w, replaceveh_d).init_lists = true;
|
||||
SetWindowDirty(w);
|
||||
break;
|
||||
|
||||
case 14:
|
||||
case 15: /* Railtype selection dropdown menu */
|
||||
ShowDropDownMenu(w, _rail_types_list, _railtype_selected_in_replace_gui, 15, 0, ~GetPlayer(_local_player)->avail_railtypes);
|
||||
case RVW_WIDGET_TRAIN_RAILTYPE_DROPDOWN: /* Railtype selection dropdown menu */
|
||||
ShowDropDownMenu(w, _rail_types_list, _railtype_selected_in_replace_gui, RVW_WIDGET_TRAIN_RAILTYPE_DROPDOWN, 0, ~GetPlayer(_local_player)->avail_railtypes);
|
||||
break;
|
||||
|
||||
case 17: /* toggle renew_keep_length */
|
||||
case RVW_WIDGET_TRAIN_WAGONREMOVE_TOGGLE: /* toggle renew_keep_length */
|
||||
DoCommandP(0, 5, GetPlayer(_local_player)->renew_keep_length ? 0 : 1, NULL, CMD_SET_AUTOREPLACE);
|
||||
break;
|
||||
|
||||
case 4: { /* Start replacing */
|
||||
case RVW_WIDGET_START_REPLACE: { /* Start replacing */
|
||||
EngineID veh_from = WP(w, replaceveh_d).sel_engine[0];
|
||||
EngineID veh_to = WP(w, replaceveh_d).sel_engine[1];
|
||||
DoCommandP(0, 3 + (WP(w, replaceveh_d).sel_group << 16) , veh_from + (veh_to << 16), NULL, CMD_SET_AUTOREPLACE);
|
||||
} break;
|
||||
|
||||
case 6: { /* Stop replacing */
|
||||
case RVW_WIDGET_STOP_REPLACE: { /* Stop replacing */
|
||||
EngineID veh_from = WP(w, replaceveh_d).sel_engine[0];
|
||||
DoCommandP(0, 3 + (WP(w, replaceveh_d).sel_group << 16), veh_from + (INVALID_ENGINE << 16), NULL, CMD_SET_AUTOREPLACE);
|
||||
} break;
|
||||
|
||||
case 7:
|
||||
case 9: {
|
||||
case RVW_WIDGET_LEFT_MATRIX:
|
||||
case RVW_WIDGET_RIGHT_MATRIX: {
|
||||
uint i = (e->we.click.pt.y - 14) / w->resize.step_height;
|
||||
uint16 click_scroll_pos = e->we.click.widget == 7 ? w->vscroll.pos : w->vscroll2.pos;
|
||||
uint16 click_scroll_cap = e->we.click.widget == 7 ? w->vscroll.cap : w->vscroll2.cap;
|
||||
byte click_side = e->we.click.widget == 7 ? 0 : 1;
|
||||
uint16 click_scroll_pos = e->we.click.widget == RVW_WIDGET_LEFT_MATRIX ? w->vscroll.pos : w->vscroll2.pos;
|
||||
uint16 click_scroll_cap = e->we.click.widget == RVW_WIDGET_LEFT_MATRIX ? w->vscroll.cap : w->vscroll2.cap;
|
||||
byte click_side = e->we.click.widget == RVW_WIDGET_LEFT_MATRIX ? 0 : 1;
|
||||
uint16 engine_count = EngList_Count(&WP(w, replaceveh_d).list[click_side]);
|
||||
|
||||
if (i < click_scroll_cap) {
|
||||
@@ -390,8 +428,8 @@ static void ReplaceVehicleWndProc(Window *w, WindowEvent *e)
|
||||
w->vscroll.cap += e->we.sizing.diff.y / (int)w->resize.step_height;
|
||||
w->vscroll2.cap += e->we.sizing.diff.y / (int)w->resize.step_height;
|
||||
|
||||
w->widget[7].data = (w->vscroll.cap << 8) + 1;
|
||||
w->widget[9].data = (w->vscroll2.cap << 8) + 1;
|
||||
w->widget[RVW_WIDGET_LEFT_MATRIX].data = (w->vscroll.cap << 8) + 1;
|
||||
w->widget[RVW_WIDGET_RIGHT_MATRIX].data = (w->vscroll2.cap << 8) + 1;
|
||||
break;
|
||||
|
||||
case WE_INVALIDATE_DATA:
|
||||
@@ -423,8 +461,7 @@ static const Widget _replace_rail_vehicle_widgets[] = {
|
||||
// train specific stuff
|
||||
{ WWT_PUSHTXTBTN, RESIZE_TB, 14, 0, 138, 228, 239, STR_REPLACE_ENGINE_WAGON_SELECT, STR_REPLACE_ENGINE_WAGON_SELECT_HELP}, // widget 12
|
||||
{ WWT_PANEL, RESIZE_TB, 14, 139, 153, 240, 251, 0x0, STR_NULL},
|
||||
{ WWT_PANEL, RESIZE_TB, 14, 154, 277, 240, 251, 0x0, STR_REPLACE_HELP_RAILTYPE},
|
||||
{ WWT_TEXTBTN, RESIZE_TB, 14, 278, 289, 240, 251, STR_0225, STR_REPLACE_HELP_RAILTYPE},
|
||||
{ WWT_DROPDOWN, RESIZE_TB, 14, 154, 289, 240, 251, 0x0, STR_REPLACE_HELP_RAILTYPE},
|
||||
{ WWT_PANEL, RESIZE_TB, 14, 290, 305, 240, 251, 0x0, STR_NULL},
|
||||
{ WWT_PUSHTXTBTN, RESIZE_TB, 14, 317, 455, 228, 239, STR_REPLACE_REMOVE_WAGON, STR_REPLACE_REMOVE_WAGON_HELP},
|
||||
// end of train specific stuff
|
||||
@@ -491,38 +528,6 @@ static const WindowDesc _replace_ship_aircraft_vehicle_desc = {
|
||||
};
|
||||
|
||||
|
||||
void ShowReplaceVehicleWindow(VehicleType vehicletype)
|
||||
{
|
||||
Window *w;
|
||||
|
||||
DeleteWindowById(WC_REPLACE_VEHICLE, vehicletype);
|
||||
|
||||
switch (vehicletype) {
|
||||
case VEH_TRAIN:
|
||||
w = AllocateWindowDescFront(&_replace_rail_vehicle_desc, vehicletype);
|
||||
w->vscroll.cap = 8;
|
||||
w->resize.step_height = 14;
|
||||
WP(w, replaceveh_d).wagon_btnstate = true;
|
||||
break;
|
||||
case VEH_ROAD:
|
||||
w = AllocateWindowDescFront(&_replace_road_vehicle_desc, vehicletype);
|
||||
w->vscroll.cap = 8;
|
||||
w->resize.step_height = 14;
|
||||
break;
|
||||
case VEH_SHIP:
|
||||
case VEH_AIRCRAFT:
|
||||
w = AllocateWindowDescFront(&_replace_ship_aircraft_vehicle_desc, vehicletype);
|
||||
w->vscroll.cap = 4;
|
||||
w->resize.step_height = 24;
|
||||
break;
|
||||
default: return;
|
||||
}
|
||||
|
||||
w->caption_color = _local_player;
|
||||
w->vscroll2.cap = w->vscroll.cap; // these two are always the same
|
||||
WP(w, replaceveh_d).sel_group = DEFAULT_GROUP;
|
||||
}
|
||||
|
||||
void ShowReplaceGroupVehicleWindow(GroupID id_g, VehicleType vehicletype)
|
||||
{
|
||||
Window *w;
|
||||
|
18
src/autoreplace_gui.h
Normal file
18
src/autoreplace_gui.h
Normal file
@@ -0,0 +1,18 @@
|
||||
/* $Id$ */
|
||||
|
||||
/** @file autoreplace_gui.h Functions related to the autoreplace GUIs*/
|
||||
|
||||
#ifndef AUTOREPLACE_GUI_H
|
||||
#define AUTOREPLACE_GUI_H
|
||||
|
||||
#include "vehicle_type.h"
|
||||
|
||||
/**
|
||||
* When an engine is made buildable or is removed from being buildable, add/remove it from the build/autoreplace lists
|
||||
* @param type The type of engine
|
||||
*/
|
||||
void AddRemoveEngineFromAutoreplaceAndBuildWindows(VehicleType type);
|
||||
void InvalidateAutoreplaceWindow(EngineID e, GroupID id_g);
|
||||
void ShowReplaceGroupVehicleWindow(GroupID group, VehicleType veh);
|
||||
|
||||
#endif /* AUTOREPLACE_GUI_H */
|
15
src/autoreplace_type.h
Normal file
15
src/autoreplace_type.h
Normal file
@@ -0,0 +1,15 @@
|
||||
/* $Id$ */
|
||||
|
||||
/** @file autoreplace_type.h Types related to autoreplacing. */
|
||||
|
||||
#ifndef AUTOREPLACE_TYPE_H
|
||||
#define AUTOREPLACE_TYPE_H
|
||||
|
||||
struct EngineRenew;
|
||||
|
||||
/**
|
||||
* A list to group EngineRenew directives together (such as per-player).
|
||||
*/
|
||||
typedef EngineRenew* EngineRenewList;
|
||||
|
||||
#endif /* AUTOREPLACE_TYPE_H */
|
@@ -6,6 +6,8 @@
|
||||
#define AUTOSLOPE_H
|
||||
|
||||
#include "depot.h"
|
||||
#include "settings_type.h"
|
||||
#include "player_func.h"
|
||||
|
||||
/**
|
||||
* Autoslope check for tiles with an entrance on an edge.
|
||||
|
@@ -21,7 +21,7 @@
|
||||
#include "stdafx.h"
|
||||
#include "openttd.h"
|
||||
#include "aystar.h"
|
||||
#include "helpers.hpp"
|
||||
#include "core/alloc_func.hpp"
|
||||
|
||||
int _aystar_stats_open_size;
|
||||
int _aystar_stats_closed_size;
|
||||
|
@@ -12,6 +12,7 @@
|
||||
#define AYSTAR_H
|
||||
|
||||
#include "queue.h"
|
||||
#include "tile_type.h"
|
||||
|
||||
//#define AYSTAR_DEBUG
|
||||
enum {
|
||||
|
@@ -1,16 +1,20 @@
|
||||
/* $Id$ */
|
||||
|
||||
#include "../stdafx.h"
|
||||
#include "../zoom.hpp"
|
||||
#include "../gfx.h"
|
||||
#include "../core/alloc_func.hpp"
|
||||
#include "../gfx_func.h"
|
||||
#include "../zoom_func.h"
|
||||
#include "../debug.h"
|
||||
#include "../table/sprites.h"
|
||||
#include "../video/video_driver.hpp"
|
||||
#include "32bpp_anim.hpp"
|
||||
|
||||
#include "../table/sprites.h"
|
||||
|
||||
static FBlitter_32bppAnim iFBlitter_32bppAnim;
|
||||
|
||||
void Blitter_32bppAnim::Draw(Blitter::BlitterParams *bp, BlitterMode mode, ZoomLevel zoom)
|
||||
{
|
||||
if (bp->dst < _screen.dst_ptr || bp->dst > (uint32 *)_screen.dst_ptr + _screen.width * _screen.height) {
|
||||
if (_screen_disable_anim) {
|
||||
/* This means our output is not to the screen, so we can't be doing any animation stuff, so use our parent Draw() */
|
||||
Blitter_32bppOptimized::Draw(bp, mode, zoom);
|
||||
return;
|
||||
@@ -95,6 +99,12 @@ void Blitter_32bppAnim::Draw(Blitter::BlitterParams *bp, BlitterMode mode, ZoomL
|
||||
|
||||
void Blitter_32bppAnim::DrawColorMappingRect(void *dst, int width, int height, int pal)
|
||||
{
|
||||
if (_screen_disable_anim) {
|
||||
/* This means our output is not to the screen, so we can't be doing any animation stuff, so use our parent DrawColorMappingRect() */
|
||||
Blitter_32bppOptimized::DrawColorMappingRect(dst, width, height, pal);
|
||||
return;
|
||||
}
|
||||
|
||||
uint32 *udst = (uint32 *)dst;
|
||||
uint8 *anim;
|
||||
|
||||
@@ -133,7 +143,9 @@ void Blitter_32bppAnim::DrawColorMappingRect(void *dst, int width, int height, i
|
||||
void Blitter_32bppAnim::SetPixel(void *video, int x, int y, uint8 color)
|
||||
{
|
||||
*((uint32 *)video + x + y * _screen.pitch) = LookupColourInPalette(color);
|
||||
/* Set the color in the anim-buffer too */
|
||||
|
||||
/* Set the color in the anim-buffer too, if we are rendering to the screen */
|
||||
if (_screen_disable_anim) return;
|
||||
this->anim_buf[((uint32 *)video - (uint32 *)_screen.dst_ptr) + x + y * this->anim_buf_width] = color;
|
||||
}
|
||||
|
||||
@@ -142,13 +154,20 @@ void Blitter_32bppAnim::SetPixelIfEmpty(void *video, int x, int y, uint8 color)
|
||||
uint32 *dst = (uint32 *)video + x + y * _screen.pitch;
|
||||
if (*dst == 0) {
|
||||
*dst = LookupColourInPalette(color);
|
||||
/* Set the color in the anim-buffer too */
|
||||
/* Set the color in the anim-buffer too, if we are rendering to the screen */
|
||||
if (_screen_disable_anim) return;
|
||||
this->anim_buf[((uint32 *)video - (uint32 *)_screen.dst_ptr) + x + y * this->anim_buf_width] = color;
|
||||
}
|
||||
}
|
||||
|
||||
void Blitter_32bppAnim::DrawRect(void *video, int width, int height, uint8 color)
|
||||
{
|
||||
if (_screen_disable_anim) {
|
||||
/* This means our output is not to the screen, so we can't be doing any animation stuff, so use our parent DrawRect() */
|
||||
Blitter_32bppOptimized::DrawRect(video, width, height, color);
|
||||
return;
|
||||
}
|
||||
|
||||
uint32 color32 = LookupColourInPalette(color);
|
||||
uint8 *anim_line;
|
||||
|
||||
@@ -172,6 +191,7 @@ void Blitter_32bppAnim::DrawRect(void *video, int width, int height, uint8 color
|
||||
|
||||
void Blitter_32bppAnim::CopyFromBuffer(void *video, const void *src, int width, int height)
|
||||
{
|
||||
assert(!_screen_disable_anim);
|
||||
assert(video >= _screen.dst_ptr && video <= (uint32 *)_screen.dst_ptr + _screen.width + _screen.height * _screen.pitch);
|
||||
uint32 *dst = (uint32 *)video;
|
||||
uint32 *usrc = (uint32 *)src;
|
||||
@@ -195,6 +215,7 @@ void Blitter_32bppAnim::CopyFromBuffer(void *video, const void *src, int width,
|
||||
|
||||
void Blitter_32bppAnim::CopyToBuffer(const void *video, void *dst, int width, int height)
|
||||
{
|
||||
assert(!_screen_disable_anim);
|
||||
assert(video >= _screen.dst_ptr && video <= (uint32 *)_screen.dst_ptr + _screen.width + _screen.height * _screen.pitch);
|
||||
uint32 *udst = (uint32 *)dst;
|
||||
uint32 *src = (uint32 *)video;
|
||||
@@ -217,6 +238,8 @@ void Blitter_32bppAnim::CopyToBuffer(const void *video, void *dst, int width, in
|
||||
|
||||
void Blitter_32bppAnim::ScrollBuffer(void *video, int &left, int &top, int &width, int &height, int scroll_x, int scroll_y)
|
||||
{
|
||||
assert(!_screen_disable_anim);
|
||||
assert(video >= _screen.dst_ptr && video <= (uint32 *)_screen.dst_ptr + _screen.width + _screen.height * _screen.pitch);
|
||||
uint8 *dst, *src;
|
||||
|
||||
/* We need to scroll the anim-buffer too */
|
||||
@@ -265,6 +288,7 @@ int Blitter_32bppAnim::BufferSize(int width, int height)
|
||||
|
||||
void Blitter_32bppAnim::PaletteAnimate(uint start, uint count)
|
||||
{
|
||||
assert(!_screen_disable_anim);
|
||||
uint8 *anim = this->anim_buf;
|
||||
|
||||
/* Never repaint the transparency pixel */
|
||||
|
@@ -1,5 +1,7 @@
|
||||
/* $Id$ */
|
||||
|
||||
#include "../stdafx.h"
|
||||
#include "../gfx.h"
|
||||
#include "../gfx_func.h"
|
||||
#include "32bpp_base.hpp"
|
||||
|
||||
void *Blitter_32bppBase::MoveTo(const void *video, int x, int y)
|
||||
|
@@ -6,6 +6,7 @@
|
||||
#define BLITTER_32BPP_BASE_HPP
|
||||
|
||||
#include "base.hpp"
|
||||
#include "../core/bitmath_func.hpp"
|
||||
|
||||
class Blitter_32bppBase : public Blitter {
|
||||
public:
|
||||
|
@@ -1,8 +1,9 @@
|
||||
/* $Id$ */
|
||||
|
||||
#include "../stdafx.h"
|
||||
#include "../zoom.hpp"
|
||||
#include "../gfx.h"
|
||||
#include "../zoom_func.h"
|
||||
#include "../gfx_func.h"
|
||||
#include "../debug.h"
|
||||
#include "../table/sprites.h"
|
||||
#include "32bpp_optimized.hpp"
|
||||
|
||||
static FBlitter_32bppOptimized iFBlitter_32bppOptimized;
|
||||
|
@@ -1,10 +1,13 @@
|
||||
/* $Id$ */
|
||||
|
||||
#include "../stdafx.h"
|
||||
#include "../zoom.hpp"
|
||||
#include "../gfx.h"
|
||||
#include "../gfx_func.h"
|
||||
#include "../zoom_func.h"
|
||||
#include "../debug.h"
|
||||
#include "../table/sprites.h"
|
||||
#include "32bpp_simple.hpp"
|
||||
|
||||
#include "../table/sprites.h"
|
||||
|
||||
static FBlitter_32bppSimple iFBlitter_32bppSimple;
|
||||
|
||||
void Blitter_32bppSimple::Draw(Blitter::BlitterParams *bp, BlitterMode mode, ZoomLevel zoom)
|
||||
|
@@ -1,5 +1,7 @@
|
||||
/* $Id$ */
|
||||
|
||||
#include "../stdafx.h"
|
||||
#include "../gfx.h"
|
||||
#include "../gfx_func.h"
|
||||
#include "8bpp_base.hpp"
|
||||
|
||||
void Blitter_8bppBase::DrawColorMappingRect(void *dst, int width, int height, int pal)
|
||||
|
@@ -3,9 +3,8 @@
|
||||
/** @file 8bpp_debug.cpp */
|
||||
|
||||
#include "../stdafx.h"
|
||||
#include "../zoom.hpp"
|
||||
#include "../gfx.h"
|
||||
#include "../functions.h"
|
||||
#include "../zoom_func.h"
|
||||
#include "../core/random_func.hpp"
|
||||
#include "8bpp_debug.hpp"
|
||||
|
||||
static FBlitter_8bppDebug iFBlitter_8bppDebug;
|
||||
|
@@ -3,9 +3,9 @@
|
||||
/** @file 8bpp_optimized.cpp */
|
||||
|
||||
#include "../stdafx.h"
|
||||
#include "../zoom.hpp"
|
||||
#include "../gfx.h"
|
||||
#include "../zoom_func.h"
|
||||
#include "../debug.h"
|
||||
#include "../core/alloc_func.hpp"
|
||||
#include "8bpp_optimized.hpp"
|
||||
|
||||
static FBlitter_8bppOptimized iFBlitter_8bppOptimized;
|
||||
@@ -17,7 +17,7 @@ void Blitter_8bppOptimized::Draw(Blitter::BlitterParams *bp, BlitterMode mode, Z
|
||||
uint offset = 0;
|
||||
|
||||
/* Find the offset of this zoom-level */
|
||||
offset = ((const uint8 *)bp->sprite)[(int)zoom * 2] | ((const byte *)bp->sprite)[(int)zoom * 2 + 1] << 8;
|
||||
offset = ((const uint8 *)bp->sprite)[(int)(zoom - ZOOM_LVL_BEGIN) * 2] | ((const byte *)bp->sprite)[(int)(zoom - ZOOM_LVL_BEGIN) * 2 + 1] << 8;
|
||||
|
||||
/* Find where to start reading in the source sprite */
|
||||
src = (const uint8 *)bp->sprite + offset;
|
||||
@@ -110,9 +110,9 @@ Sprite *Blitter_8bppOptimized::Encode(SpriteLoader::Sprite *sprite, Blitter::All
|
||||
uint index = 0;
|
||||
|
||||
/* Make memory for all zoom-levels */
|
||||
memory += (int)ZOOM_LVL_END * sizeof(uint16);
|
||||
for (int i = 0; i < (int)ZOOM_LVL_END; i++) {
|
||||
memory += UnScaleByZoom(sprite->height, (ZoomLevel)i) * UnScaleByZoom(sprite->width, (ZoomLevel)i);
|
||||
memory += (int)(ZOOM_LVL_END - ZOOM_LVL_BEGIN) * sizeof(uint16);
|
||||
for (ZoomLevel i = ZOOM_LVL_BEGIN; i < ZOOM_LVL_END; i++) {
|
||||
memory += UnScaleByZoom(sprite->height, i) * UnScaleByZoom(sprite->width, i);
|
||||
index += 2;
|
||||
}
|
||||
|
||||
@@ -121,7 +121,7 @@ Sprite *Blitter_8bppOptimized::Encode(SpriteLoader::Sprite *sprite, Blitter::All
|
||||
temp_dst = MallocT<byte>(memory);
|
||||
|
||||
/* Make the sprites per zoom-level */
|
||||
for (int i = 0; i < (int)ZOOM_LVL_END; i++) {
|
||||
for (ZoomLevel i = ZOOM_LVL_BEGIN; i < ZOOM_LVL_END; i++) {
|
||||
/* Store the scaled image */
|
||||
const SpriteLoader::CommonPixel *src;
|
||||
|
||||
@@ -131,19 +131,19 @@ Sprite *Blitter_8bppOptimized::Encode(SpriteLoader::Sprite *sprite, Blitter::All
|
||||
|
||||
byte *dst = &temp_dst[index];
|
||||
|
||||
for (int y = 0; y < UnScaleByZoom(sprite->height, (ZoomLevel)i); y++) {
|
||||
for (int y = 0; y < UnScaleByZoom(sprite->height, i); y++) {
|
||||
uint trans = 0;
|
||||
uint pixels = 0;
|
||||
uint last_color = 0;
|
||||
uint count_index = 0;
|
||||
uint rx = 0;
|
||||
src = &sprite->data[ScaleByZoom(y, (ZoomLevel)i) * sprite->width];
|
||||
src = &sprite->data[ScaleByZoom(y, i) * sprite->width];
|
||||
|
||||
for (int x = 0; x < UnScaleByZoom(sprite->width, (ZoomLevel)i); x++) {
|
||||
for (int x = 0; x < UnScaleByZoom(sprite->width, i); x++) {
|
||||
uint color = 0;
|
||||
|
||||
/* Get the color keeping in mind the zoom-level */
|
||||
for (int j = 0; j < ScaleByZoom(1, (ZoomLevel)i); j++) {
|
||||
for (int j = 0; j < ScaleByZoom(1, i); j++) {
|
||||
if (src->m != 0) color = src->m;
|
||||
src++;
|
||||
rx++;
|
||||
|
@@ -3,8 +3,7 @@
|
||||
/** @file 8bpp_simple.cpp */
|
||||
|
||||
#include "../stdafx.h"
|
||||
#include "../zoom.hpp"
|
||||
#include "../gfx.h"
|
||||
#include "../zoom_func.h"
|
||||
#include "8bpp_simple.hpp"
|
||||
|
||||
static FBlitter_8bppSimple iFBlitter_8bppSimple;
|
||||
|
@@ -5,6 +5,7 @@
|
||||
|
||||
#include "../spritecache.h"
|
||||
#include "../spriteloader/spriteloader.hpp"
|
||||
#include "../zoom_type.h"
|
||||
|
||||
enum BlitterMode {
|
||||
BM_NORMAL,
|
||||
|
@@ -4,8 +4,8 @@
|
||||
#define BLITTER_FACTORY_HPP
|
||||
|
||||
#include "base.hpp"
|
||||
#include "../string.h"
|
||||
#include "../debug.h"
|
||||
#include "../string_func.h"
|
||||
#include <string>
|
||||
#include <map>
|
||||
|
||||
@@ -65,6 +65,13 @@ public:
|
||||
{
|
||||
const char *default_blitter = "8bpp-optimized";
|
||||
|
||||
#if defined(__APPLE__)
|
||||
/* MacOS X 10.5 removed 8bpp fullscreen support.
|
||||
* Because of this we will pick 32bpp by default */
|
||||
if (MacOSVersionIsAtLeast(10, 5, 0)) {
|
||||
default_blitter = "32bpp-anim";
|
||||
}
|
||||
#endif /* defined(__APPLE__) */
|
||||
if (GetBlitters().size() == 0) return NULL;
|
||||
const char *bname = (StrEmpty(name)) ? default_blitter : name;
|
||||
|
||||
@@ -130,4 +137,6 @@ public:
|
||||
const char *GetName();
|
||||
};
|
||||
|
||||
extern char _ini_blitter[32];
|
||||
|
||||
#endif /* BLITTER_FACTORY_HPP */
|
||||
|
@@ -1,5 +1,8 @@
|
||||
/* $Id$ */
|
||||
|
||||
/** @file null.cpp A blitter that doesn't blit. */
|
||||
|
||||
#include "../stdafx.h"
|
||||
#include "../variables.h"
|
||||
#include "null.hpp"
|
||||
|
||||
static FBlitter_Null iFBlitter_Null;
|
||||
|
@@ -3,11 +3,9 @@
|
||||
/** @file bmp.cpp */
|
||||
|
||||
#include "stdafx.h"
|
||||
#include "openttd.h"
|
||||
#include "gfx.h"
|
||||
#include "bmp.h"
|
||||
#include "macros.h"
|
||||
#include "helpers.hpp"
|
||||
#include "core/bitmath_func.hpp"
|
||||
#include "core/alloc_func.hpp"
|
||||
|
||||
void BmpInitializeBuffer(BmpBuffer *buffer, FILE *file)
|
||||
{
|
||||
|
@@ -5,6 +5,8 @@
|
||||
#ifndef BMP_H
|
||||
#define BMP_H
|
||||
|
||||
#include "gfx_type.h"
|
||||
|
||||
struct BmpInfo {
|
||||
uint32 offset; ///< offset of bitmap data from .bmp file begining
|
||||
uint32 width; ///< bitmap width
|
||||
|
40
src/bridge.h
40
src/bridge.h
@@ -5,31 +5,38 @@
|
||||
#ifndef BRIDGE_H
|
||||
#define BRIDGE_H
|
||||
|
||||
#include "gfx_type.h"
|
||||
#include "direction_type.h"
|
||||
#include "tile_cmd.h"
|
||||
|
||||
enum {
|
||||
MAX_BRIDGES = 13
|
||||
};
|
||||
|
||||
typedef uint BridgeType;
|
||||
|
||||
/** Struct containing information about a single bridge type
|
||||
*/
|
||||
struct Bridge {
|
||||
Year avail_year; ///< the year in which the bridge becomes available
|
||||
byte min_length; ///< the minimum length of the bridge (not counting start and end tile)
|
||||
byte max_length; ///< the maximum length of the bridge (not counting start and end tile)
|
||||
uint16 price; ///< the relative price of the bridge
|
||||
uint16 speed; ///< maximum travel speed
|
||||
SpriteID sprite; ///< the sprite which is used in the GUI
|
||||
SpriteID pal; ///< the palette which is used in the GUI
|
||||
StringID material; ///< the string that contains the bridge description
|
||||
PalSpriteID **sprite_table; ///< table of sprites for drawing the bridge
|
||||
byte flags; ///< bit 0 set: disable drawing of far pillars.
|
||||
struct BridgeSpec {
|
||||
Year avail_year; ///< the year where it becomes available
|
||||
byte min_length; ///< the minimum length (not counting start and end tile)
|
||||
byte max_length; ///< the maximum length (not counting start and end tile)
|
||||
uint16 price; ///< the price multiplier
|
||||
uint16 speed; ///< maximum travel speed
|
||||
SpriteID sprite; ///< the sprite which is used in the GUI
|
||||
SpriteID pal; ///< the palette which is used in the GUI
|
||||
StringID material; ///< the string that contains the bridge description
|
||||
StringID transport_name[2]; ///< description of the bridge, when built for road or rail
|
||||
PalSpriteID **sprite_table; ///< table of sprites for drawing the bridge
|
||||
byte flags; ///< bit 0 set: disable drawing of far pillars.
|
||||
};
|
||||
|
||||
extern const Bridge orig_bridge[MAX_BRIDGES];
|
||||
extern Bridge _bridge[MAX_BRIDGES];
|
||||
extern BridgeSpec _bridge[MAX_BRIDGES];
|
||||
|
||||
Foundation GetBridgeFoundation(Slope tileh, Axis axis);
|
||||
bool HasBridgeFlatRamp(Slope tileh, Axis axis);
|
||||
|
||||
static inline const Bridge *GetBridge(uint i)
|
||||
static inline const BridgeSpec *GetBridgeSpec(BridgeType i)
|
||||
{
|
||||
assert(i < lengthof(_bridge));
|
||||
return &_bridge[i];
|
||||
@@ -37,4 +44,9 @@ static inline const Bridge *GetBridge(uint i)
|
||||
|
||||
void DrawBridgeMiddle(const TileInfo *ti);
|
||||
|
||||
bool CheckBridge_Stuff(BridgeType bridge_type, uint bridge_len, uint32 flags = 0);
|
||||
int CalcBridgeLenCostFactor(int x);
|
||||
|
||||
void ResetBridges();
|
||||
|
||||
#endif /* BRIDGE_H */
|
||||
|
@@ -4,26 +4,29 @@
|
||||
|
||||
#include "stdafx.h"
|
||||
#include "openttd.h"
|
||||
#include "table/strings.h"
|
||||
#include "strings.h"
|
||||
#include "functions.h"
|
||||
#include "map.h"
|
||||
#include "window.h"
|
||||
#include "gui.h"
|
||||
#include "viewport.h"
|
||||
#include "gfx.h"
|
||||
#include "command.h"
|
||||
#include "sound.h"
|
||||
#include "window_gui.h"
|
||||
#include "command_func.h"
|
||||
#include "economy_func.h"
|
||||
#include "variables.h"
|
||||
#include "bridge.h"
|
||||
#include "strings_func.h"
|
||||
#include "window_func.h"
|
||||
#include "sound_func.h"
|
||||
#include "map_func.h"
|
||||
#include "viewport_func.h"
|
||||
#include "gfx_func.h"
|
||||
#include "tunnelbridge.h"
|
||||
|
||||
#include "table/strings.h"
|
||||
|
||||
static struct BridgeData {
|
||||
uint8 last_size;
|
||||
uint count;
|
||||
TileIndex start_tile;
|
||||
TileIndex end_tile;
|
||||
uint8 type;
|
||||
uint8 indexes[MAX_BRIDGES];
|
||||
uint32 type; ///< Data type for the bridge. Bit 16,15 = transport type, 14..8 = road/rail pieces, 7..0 = type of bridge
|
||||
BridgeType indexes[MAX_BRIDGES];
|
||||
Money costs[MAX_BRIDGES];
|
||||
|
||||
BridgeData()
|
||||
@@ -41,7 +44,7 @@ static void BuildBridge(Window *w, int i)
|
||||
{
|
||||
DeleteWindow(w);
|
||||
DoCommandP(_bridgedata.end_tile, _bridgedata.start_tile,
|
||||
_bridgedata.indexes[i] | (_bridgedata.type << 8), CcBuildBridge,
|
||||
_bridgedata.type | _bridgedata.indexes[i], CcBuildBridge,
|
||||
CMD_BUILD_BRIDGE | CMD_MSG(STR_5015_CAN_T_BUILD_BRIDGE_HERE));
|
||||
}
|
||||
|
||||
@@ -76,7 +79,7 @@ static void BuildBridgeWndProc(Window *w, WindowEvent *e)
|
||||
|
||||
uint y = 15;
|
||||
for (uint i = 0; (i < w->vscroll.cap) && ((i + w->vscroll.pos) < _bridgedata.count); i++) {
|
||||
const Bridge *b = &_bridge[_bridgedata.indexes[i + w->vscroll.pos]];
|
||||
const BridgeSpec *b = GetBridgeSpec(_bridgedata.indexes[i + w->vscroll.pos]);
|
||||
|
||||
SetDParam(2, _bridgedata.costs[i + w->vscroll.pos]);
|
||||
SetDParam(1, b->speed * 10 / 16);
|
||||
@@ -140,38 +143,18 @@ static const WindowDesc _build_bridge_desc = {
|
||||
BuildBridgeWndProc
|
||||
};
|
||||
|
||||
/* Widget definition for the road bridge selection window */
|
||||
static const Widget _build_road_bridge_widgets[] = {
|
||||
{ WWT_CLOSEBOX, RESIZE_NONE, 7, 0, 10, 0, 13, STR_00C5, STR_018B_CLOSE_WINDOW}, // BBSW_CLOSEBOX
|
||||
{ WWT_CAPTION, RESIZE_NONE, 7, 11, 199, 0, 13, STR_1803_SELECT_ROAD_BRIDGE, STR_018C_WINDOW_TITLE_DRAG_THIS}, // BBSW_CAPTION
|
||||
{ WWT_MATRIX, RESIZE_BOTTOM, 7, 0, 187, 14, 101, 0x401, STR_101F_BRIDGE_SELECTION_CLICK}, // BBSW_BRIDGE_LIST
|
||||
{ WWT_SCROLLBAR, RESIZE_BOTTOM, 7, 188, 199, 14, 89, 0x0, STR_0190_SCROLL_BAR_SCROLLS_LIST}, // BBSW_SCROLLBAR
|
||||
{ WWT_RESIZEBOX, RESIZE_TB, 7, 188, 199, 90, 101, 0x0, STR_RESIZE_BUTTON}, // BBSW_RESIZEBOX
|
||||
{ WIDGETS_END},
|
||||
};
|
||||
|
||||
/* Window definition for the road bridge selection window */
|
||||
static const WindowDesc _build_road_bridge_desc = {
|
||||
WDP_AUTO, WDP_AUTO, 200, 102, 200, 102,
|
||||
WC_BUILD_BRIDGE, WC_BUILD_TOOLBAR,
|
||||
WDF_STD_TOOLTIPS | WDF_STD_BTN | WDF_DEF_WIDGET | WDF_RESIZABLE,
|
||||
_build_road_bridge_widgets,
|
||||
BuildBridgeWndProc
|
||||
};
|
||||
|
||||
|
||||
void ShowBuildBridgeWindow(TileIndex start, TileIndex end, byte bridge_type)
|
||||
void ShowBuildBridgeWindow(TileIndex start, TileIndex end, TransportType transport_type, byte bridge_type)
|
||||
{
|
||||
DeleteWindowById(WC_BUILD_BRIDGE, 0);
|
||||
|
||||
_bridgedata.type = bridge_type;
|
||||
_bridgedata.type = (transport_type << 15) | (bridge_type << 8); //prepare the parameter for use only once
|
||||
_bridgedata.start_tile = start;
|
||||
_bridgedata.end_tile = end;
|
||||
|
||||
/* only query bridge building possibility once, result is the same for all bridges!
|
||||
* returns CMD_ERROR on failure, and price on success */
|
||||
StringID errmsg = INVALID_STRING_ID;
|
||||
CommandCost ret = DoCommand(end, start, (bridge_type << 8), DC_AUTO | DC_QUERY_COST, CMD_BUILD_BRIDGE);
|
||||
CommandCost ret = DoCommand(end, start, _bridgedata.type, DC_AUTO | DC_QUERY_COST, CMD_BUILD_BRIDGE);
|
||||
|
||||
uint8 j = 0;
|
||||
if (CmdFailed(ret)) {
|
||||
@@ -180,19 +163,19 @@ void ShowBuildBridgeWindow(TileIndex start, TileIndex end, byte bridge_type)
|
||||
/* check which bridges can be built
|
||||
* get absolute bridge length
|
||||
* length of the middle parts of the bridge */
|
||||
const uint bridge_len = GetBridgeLength(start, end);
|
||||
const uint bridge_len = GetTunnelBridgeLength(start, end);
|
||||
/* total length of bridge */
|
||||
const uint tot_bridgedata_len = CalcBridgeLenCostFactor(bridge_len + 2);
|
||||
|
||||
/* loop for all bridgetypes */
|
||||
for (bridge_type = 0; bridge_type != MAX_BRIDGES; bridge_type++) {
|
||||
if (CheckBridge_Stuff(bridge_type, bridge_len)) {
|
||||
for (BridgeType brd_type = 0; brd_type != MAX_BRIDGES; brd_type++) {
|
||||
if (CheckBridge_Stuff(brd_type, bridge_len)) {
|
||||
/* bridge is accepted, add to list */
|
||||
const Bridge *b = &_bridge[bridge_type];
|
||||
const BridgeSpec *b = GetBridgeSpec(brd_type);
|
||||
/* Add to terraforming & bulldozing costs the cost of the
|
||||
* bridge itself (not computed with DC_QUERY_COST) */
|
||||
_bridgedata.costs[j] = ret.GetCost() + (((int64)tot_bridgedata_len * _price.build_bridge * b->price) >> 8);
|
||||
_bridgedata.indexes[j] = bridge_type;
|
||||
_bridgedata.indexes[j] = brd_type;
|
||||
j++;
|
||||
}
|
||||
}
|
||||
@@ -201,7 +184,9 @@ void ShowBuildBridgeWindow(TileIndex start, TileIndex end, byte bridge_type)
|
||||
}
|
||||
|
||||
if (j != 0) {
|
||||
AllocateWindowDesc((_bridgedata.type & 0x80) ? &_build_road_bridge_desc : &_build_bridge_desc);
|
||||
Window *w = AllocateWindowDesc(&_build_bridge_desc);
|
||||
/* Change the data, or the caption of the gui. Set it to road or rail, accordingly */
|
||||
w->widget[BBSW_CAPTION].data = (transport_type == TRANSPORT_ROAD) ? STR_1803_SELECT_ROAD_BRIDGE : STR_100D_SELECT_RAIL_BRIDGE;
|
||||
} else {
|
||||
ShowErrorMessage(errmsg, STR_5015_CAN_T_BUILD_BRIDGE_HERE, TileX(end) * TILE_SIZE, TileY(end) * TILE_SIZE);
|
||||
}
|
||||
|
@@ -8,6 +8,7 @@
|
||||
#include "bridge.h"
|
||||
#include "variables.h"
|
||||
#include "landscape.h"
|
||||
#include "tunnelbridge_map.h"
|
||||
|
||||
|
||||
TileIndex GetBridgeEnd(TileIndex tile, DiagDirection dir)
|
||||
@@ -17,7 +18,7 @@ TileIndex GetBridgeEnd(TileIndex tile, DiagDirection dir)
|
||||
dir = ReverseDiagDir(dir);
|
||||
do {
|
||||
tile += delta;
|
||||
} while (!IsBridgeTile(tile) || GetBridgeRampDirection(tile) != dir);
|
||||
} while (!IsBridgeTile(tile) || GetTunnelBridgeDirection(tile) != dir);
|
||||
|
||||
return tile;
|
||||
}
|
||||
@@ -38,14 +39,14 @@ TileIndex GetSouthernBridgeEnd(TileIndex t)
|
||||
TileIndex GetOtherBridgeEnd(TileIndex tile)
|
||||
{
|
||||
assert(IsBridgeTile(tile));
|
||||
return GetBridgeEnd(tile, GetBridgeRampDirection(tile));
|
||||
return GetBridgeEnd(tile, GetTunnelBridgeDirection(tile));
|
||||
}
|
||||
|
||||
uint GetBridgeHeight(TileIndex t)
|
||||
{
|
||||
uint h;
|
||||
Slope tileh = GetTileSlope(t, &h);
|
||||
Foundation f = GetBridgeFoundation(tileh, DiagDirToAxis(GetBridgeRampDirection(t)));
|
||||
Foundation f = GetBridgeFoundation(tileh, DiagDirToAxis(GetTunnelBridgeDirection(t)));
|
||||
|
||||
/* one height level extra for the ramp */
|
||||
return h + TILE_HEIGHT + ApplyFoundationToSlope(f, &tileh);
|
||||
|
@@ -5,12 +5,10 @@
|
||||
#ifndef BRIDGE_MAP_H
|
||||
#define BRIDGE_MAP_H
|
||||
|
||||
#include "direction.h"
|
||||
#include "macros.h"
|
||||
#include "map.h"
|
||||
#include "rail.h"
|
||||
#include "direction_func.h"
|
||||
#include "rail_type.h"
|
||||
#include "road_map.h"
|
||||
#include "tile.h"
|
||||
#include "bridge.h"
|
||||
|
||||
|
||||
/**
|
||||
@@ -64,33 +62,18 @@ static inline bool IsBridgeAbove(TileIndex t)
|
||||
return GB(_m[t].m6, 6, 2) != 0;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Determines the type of bridge on a tile
|
||||
* @param t The tile to analyze
|
||||
* @pre IsBridgeTile(t)
|
||||
* @return The bridge type
|
||||
*/
|
||||
static inline uint GetBridgeType(TileIndex t)
|
||||
static inline BridgeType GetBridgeType(TileIndex t)
|
||||
{
|
||||
assert(IsBridgeTile(t));
|
||||
return GB(_m[t].m2, 4, 4);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Get the direction pointing onto the bridge
|
||||
* @param t The tile to analyze
|
||||
* @pre IsBridgeTile(t)
|
||||
* @return the above mentionned direction
|
||||
*/
|
||||
static inline DiagDirection GetBridgeRampDirection(TileIndex t)
|
||||
{
|
||||
assert(IsBridgeTile(t));
|
||||
return (DiagDirection)GB(_m[t].m5, 0, 2);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Get the axis of the bridge that goes over the tile. Not the axis or the ramp.
|
||||
* @param t The tile to analyze
|
||||
@@ -103,45 +86,6 @@ static inline Axis GetBridgeAxis(TileIndex t)
|
||||
return (Axis)(GB(_m[t].m6, 6, 2) - 1);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Get the transport type of the bridge's ramp.
|
||||
* @param t The ramp tile to analyze
|
||||
* @pre IsBridgeTile(t)
|
||||
* @return the transport type of the bridge
|
||||
*/
|
||||
static inline TransportType GetBridgeTransportType(TileIndex t)
|
||||
{
|
||||
assert(IsBridgeTile(t));
|
||||
return (TransportType)GB(_m[t].m5, 2, 2);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Does the bridge ramp lie in a snow or desert area?
|
||||
* @param t The ramp tile to analyze
|
||||
* @pre IsBridgeTile(t)
|
||||
* @return true if and only if in a snow or desert area
|
||||
*/
|
||||
static inline bool HasBridgeSnowOrDesert(TileIndex t)
|
||||
{
|
||||
assert(IsBridgeTile(t));
|
||||
return HasBit(_m[t].m4, 7);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Sets whether the bridge ramp lies in a snow or desert area.
|
||||
* @param t The ramp tile to set (un)make a snow/desert area
|
||||
* @param snow_or_desert Make (true) or unmake the tile a snow/desert area
|
||||
* @pre IsBridgeTile(t)
|
||||
*/
|
||||
static inline void SetBridgeSnowOrDesert(TileIndex t, bool snow_or_desert)
|
||||
{
|
||||
assert(IsBridgeTile(t));
|
||||
SB(_m[t].m4, 7, 1, snow_or_desert);
|
||||
}
|
||||
|
||||
/**
|
||||
* Finds the end of a bridge in the specified direction starting at a middle tile
|
||||
* @param t the bridge tile to find the bridge ramp for
|
||||
@@ -187,7 +131,6 @@ static inline void ClearSingleBridgeMiddle(TileIndex t, Axis a)
|
||||
ClrBit(_m[t].m6, 6 + a);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Removes bridges from the given, that is bridges along the X and Y axis.
|
||||
* @param t the tile to remove the bridge from
|
||||
@@ -221,7 +164,7 @@ static inline void SetBridgeMiddle(TileIndex t, Axis a)
|
||||
* @param rt the road or rail type
|
||||
* @note this function should not be called directly.
|
||||
*/
|
||||
static inline void MakeBridgeRamp(TileIndex t, Owner o, uint bridgetype, DiagDirection d, TransportType tt, uint rt)
|
||||
static inline void MakeBridgeRamp(TileIndex t, Owner o, BridgeType bridgetype, DiagDirection d, TransportType tt, uint rt)
|
||||
{
|
||||
SetTileType(t, MP_TUNNELBRIDGE);
|
||||
SetTileOwner(t, o);
|
||||
@@ -239,7 +182,7 @@ static inline void MakeBridgeRamp(TileIndex t, Owner o, uint bridgetype, DiagDir
|
||||
* @param d the direction this ramp must be facing
|
||||
* @param r the road type of the bridge
|
||||
*/
|
||||
static inline void MakeRoadBridgeRamp(TileIndex t, Owner o, uint bridgetype, DiagDirection d, RoadTypes r)
|
||||
static inline void MakeRoadBridgeRamp(TileIndex t, Owner o, BridgeType bridgetype, DiagDirection d, RoadTypes r)
|
||||
{
|
||||
MakeBridgeRamp(t, o, bridgetype, d, TRANSPORT_ROAD, r);
|
||||
}
|
||||
@@ -252,7 +195,7 @@ static inline void MakeRoadBridgeRamp(TileIndex t, Owner o, uint bridgetype, Dia
|
||||
* @param d the direction this ramp must be facing
|
||||
* @param r the rail type of the bridge
|
||||
*/
|
||||
static inline void MakeRailBridgeRamp(TileIndex t, Owner o, uint bridgetype, DiagDirection d, RailType r)
|
||||
static inline void MakeRailBridgeRamp(TileIndex t, Owner o, BridgeType bridgetype, DiagDirection d, RailType r)
|
||||
{
|
||||
MakeBridgeRamp(t, o, bridgetype, d, TRANSPORT_RAIL, r);
|
||||
}
|
||||
|
@@ -9,34 +9,52 @@
|
||||
#include "ship.h"
|
||||
#include "aircraft.h"
|
||||
#include "debug.h"
|
||||
#include "functions.h"
|
||||
#include "table/sprites.h"
|
||||
#include "table/strings.h"
|
||||
#include "window.h"
|
||||
#include "gui.h"
|
||||
#include "vehicle.h"
|
||||
#include "articulated_vehicles.h"
|
||||
#include "gfx.h"
|
||||
#include "textbuf_gui.h"
|
||||
#include "station.h"
|
||||
#include "command.h"
|
||||
#include "command_func.h"
|
||||
#include "engine.h"
|
||||
#include "player.h"
|
||||
#include "player_func.h"
|
||||
#include "depot.h"
|
||||
#include "airport.h"
|
||||
#include "vehicle_gui.h"
|
||||
#include "newgrf_engine.h"
|
||||
#include "date.h"
|
||||
#include "strings.h"
|
||||
#include "cargotype.h"
|
||||
#include "group.h"
|
||||
#include "road_map.h"
|
||||
#include "strings_func.h"
|
||||
#include "window_func.h"
|
||||
#include "date_func.h"
|
||||
#include "vehicle_func.h"
|
||||
#include "settings_type.h"
|
||||
#include "gfx_func.h"
|
||||
#include "widgets/dropdown_func.h"
|
||||
|
||||
#include "table/sprites.h"
|
||||
#include "table/strings.h"
|
||||
|
||||
struct buildvehicle_d {
|
||||
VehicleType vehicle_type;
|
||||
union {
|
||||
RailTypeByte railtype;
|
||||
AirportFTAClass::Flags flags;
|
||||
RoadTypes roadtypes;
|
||||
} filter;
|
||||
byte sel_index; ///< deprecated value, used for 'unified' ship and road
|
||||
bool descending_sort_order;
|
||||
byte sort_criteria;
|
||||
bool regenerate_list;
|
||||
EngineID sel_engine;
|
||||
EngineID rename_engine;
|
||||
EngineList eng_list;
|
||||
};
|
||||
assert_compile(WINDOW_CUSTOM_SIZE >= sizeof(buildvehicle_d));
|
||||
|
||||
enum BuildVehicleWidgets {
|
||||
BUILD_VEHICLE_WIDGET_CLOSEBOX = 0,
|
||||
BUILD_VEHICLE_WIDGET_CAPTION,
|
||||
BUILD_VEHICLE_WIDGET_SORT_ASSENDING_DESCENDING,
|
||||
BUILD_VEHICLE_WIDGET_SORT_TEXT,
|
||||
BUILD_VEHICLE_WIDGET_SORT_DROPDOWN,
|
||||
BUILD_VEHICLE_WIDGET_LIST,
|
||||
BUILD_VEHICLE_WIDGET_SCROLLBAR,
|
||||
@@ -51,8 +69,7 @@ static const Widget _build_vehicle_widgets[] = {
|
||||
{ WWT_CLOSEBOX, RESIZE_NONE, 14, 0, 10, 0, 13, STR_00C5, STR_018B_CLOSE_WINDOW },
|
||||
{ WWT_CAPTION, RESIZE_RIGHT, 14, 11, 239, 0, 13, 0x0, STR_018C_WINDOW_TITLE_DRAG_THIS },
|
||||
{ WWT_PUSHTXTBTN, RESIZE_NONE, 14, 0, 80, 14, 25, STR_SORT_BY, STR_SORT_ORDER_TIP},
|
||||
{ WWT_PANEL, RESIZE_RIGHT, 14, 81, 227, 14, 25, 0x0, STR_SORT_CRITERIA_TIP},
|
||||
{ WWT_TEXTBTN, RESIZE_LR, 14, 228, 239, 14, 25, STR_0225, STR_SORT_CRITERIA_TIP},
|
||||
{ WWT_DROPDOWN, RESIZE_RIGHT, 14, 81, 239, 14, 25, 0x0, STR_SORT_CRITERIA_TIP},
|
||||
{ WWT_MATRIX, RESIZE_RB, 14, 0, 227, 26, 39, 0x101, STR_NULL },
|
||||
{ WWT_SCROLLBAR, RESIZE_LRB, 14, 228, 239, 26, 39, 0x0, STR_0190_SCROLL_BAR_SCROLLS_LIST },
|
||||
{ WWT_PANEL, RESIZE_RTB, 14, 0, 239, 40, 161, 0x0, STR_NULL },
|
||||
@@ -64,9 +81,11 @@ static const Widget _build_vehicle_widgets[] = {
|
||||
};
|
||||
|
||||
/* Setup widget strings to fit the different types of vehicles */
|
||||
static void SetupWindowStrings(Window *w, byte type)
|
||||
static void SetupWindowStrings(Window *w, VehicleType type)
|
||||
{
|
||||
switch (type) {
|
||||
default: NOT_REACHED();
|
||||
|
||||
case VEH_TRAIN:
|
||||
w->widget[BUILD_VEHICLE_WIDGET_CAPTION].data = STR_JUST_STRING;
|
||||
w->widget[BUILD_VEHICLE_WIDGET_LIST].tooltips = STR_8843_TRAIN_VEHICLE_SELECTION;
|
||||
@@ -75,6 +94,7 @@ static void SetupWindowStrings(Window *w, byte type)
|
||||
w->widget[BUILD_VEHICLE_WIDGET_RENAME].data = STR_8820_RENAME;
|
||||
w->widget[BUILD_VEHICLE_WIDGET_RENAME].tooltips = STR_8845_RENAME_TRAIN_VEHICLE_TYPE;
|
||||
break;
|
||||
|
||||
case VEH_ROAD:
|
||||
w->widget[BUILD_VEHICLE_WIDGET_CAPTION].data = STR_9006_NEW_ROAD_VEHICLES;
|
||||
w->widget[BUILD_VEHICLE_WIDGET_LIST].tooltips = STR_9026_ROAD_VEHICLE_SELECTION;
|
||||
@@ -83,6 +103,7 @@ static void SetupWindowStrings(Window *w, byte type)
|
||||
w->widget[BUILD_VEHICLE_WIDGET_RENAME].data = STR_9034_RENAME;
|
||||
w->widget[BUILD_VEHICLE_WIDGET_RENAME].tooltips = STR_9035_RENAME_ROAD_VEHICLE_TYPE;
|
||||
break;
|
||||
|
||||
case VEH_SHIP:
|
||||
w->widget[BUILD_VEHICLE_WIDGET_CAPTION].data = STR_9808_NEW_SHIPS;
|
||||
w->widget[BUILD_VEHICLE_WIDGET_LIST].tooltips = STR_9825_SHIP_SELECTION_LIST_CLICK;
|
||||
@@ -91,6 +112,7 @@ static void SetupWindowStrings(Window *w, byte type)
|
||||
w->widget[BUILD_VEHICLE_WIDGET_RENAME].data = STR_9836_RENAME;
|
||||
w->widget[BUILD_VEHICLE_WIDGET_RENAME].tooltips = STR_9837_RENAME_SHIP_TYPE;
|
||||
break;
|
||||
|
||||
case VEH_AIRCRAFT:
|
||||
w->widget[BUILD_VEHICLE_WIDGET_CAPTION].data = STR_A005_NEW_AIRCRAFT;
|
||||
w->widget[BUILD_VEHICLE_WIDGET_LIST].tooltips = STR_A025_AIRCRAFT_SELECTION_LIST;
|
||||
@@ -196,8 +218,8 @@ static int CDECL TrainEnginePowerSorter(const void *a, const void *b)
|
||||
const RailVehicleInfo *rvi_a = RailVehInfo(*(const EngineID*)a);
|
||||
const RailVehicleInfo *rvi_b = RailVehInfo(*(const EngineID*)b);
|
||||
|
||||
int va = rvi_a->power << (rvi_a->railveh_type == RAILVEH_MULTIHEAD ? 1 : 0);
|
||||
int vb = rvi_b->power << (rvi_b->railveh_type == RAILVEH_MULTIHEAD ? 1 : 0);
|
||||
int va = rvi_a->power;
|
||||
int vb = rvi_b->power;
|
||||
int r = va - vb;
|
||||
|
||||
return _internal_sort_order ? -r : r;
|
||||
@@ -208,8 +230,8 @@ static int CDECL TrainEngineRunningCostSorter(const void *a, const void *b)
|
||||
const RailVehicleInfo *rvi_a = RailVehInfo(*(const EngineID*)a);
|
||||
const RailVehicleInfo *rvi_b = RailVehInfo(*(const EngineID*)b);
|
||||
|
||||
Money va = rvi_a->running_cost_base * _price.running_rail[rvi_a->running_cost_class] * (rvi_a->railveh_type == RAILVEH_MULTIHEAD ? 2 : 1);
|
||||
Money vb = rvi_b->running_cost_base * _price.running_rail[rvi_b->running_cost_class] * (rvi_b->railveh_type == RAILVEH_MULTIHEAD ? 2 : 1);
|
||||
Money va = rvi_a->running_cost * GetPriceByIndex(rvi_a->running_cost_class) * (rvi_a->railveh_type == RAILVEH_MULTIHEAD ? 2 : 1);
|
||||
Money vb = rvi_b->running_cost * GetPriceByIndex(rvi_b->running_cost_class) * (rvi_b->railveh_type == RAILVEH_MULTIHEAD ? 2 : 1);
|
||||
int r = ClampToI32(va - vb);
|
||||
|
||||
return _internal_sort_order ? -r : r;
|
||||
@@ -226,8 +248,8 @@ static int CDECL TrainEnginePowerVsRunningCostSorter(const void *a, const void *
|
||||
* Because of this, the return value have to be reversed as well and we return b - a instead of a - b.
|
||||
* Another thing is that both power and running costs should be doubled for multiheaded engines.
|
||||
* Since it would be multipling with 2 in both numerator and denumerator, it will even themselves out and we skip checking for multiheaded. */
|
||||
Money va = (rvi_a->running_cost_base * _price.running_rail[rvi_a->running_cost_class]) / max(1U, (uint)rvi_a->power);
|
||||
Money vb = (rvi_b->running_cost_base * _price.running_rail[rvi_b->running_cost_class]) / max(1U, (uint)rvi_b->power);
|
||||
Money va = (rvi_a->running_cost * GetPriceByIndex(rvi_a->running_cost_class)) / max(1U, (uint)rvi_a->power);
|
||||
Money vb = (rvi_b->running_cost * GetPriceByIndex(rvi_b->running_cost_class)) / max(1U, (uint)rvi_b->power);
|
||||
int r = ClampToI32(vb - va);
|
||||
|
||||
return _internal_sort_order ? -r : r;
|
||||
@@ -269,6 +291,41 @@ static int CDECL TrainEnginesThenWagonsSorter(const void *a, const void *b)
|
||||
return _internal_sort_order ? -r : r;
|
||||
}
|
||||
|
||||
/* Road vehicle sorting functions */
|
||||
static int CDECL RoadVehEngineCostSorter(const void *a, const void *b)
|
||||
{
|
||||
int va = RoadVehInfo(*(const EngineID*)a)->base_cost;
|
||||
int vb = RoadVehInfo(*(const EngineID*)b)->base_cost;
|
||||
int r = va - vb;
|
||||
|
||||
return _internal_sort_order ? -r : r;
|
||||
}
|
||||
|
||||
static int CDECL RoadVehEngineSpeedSorter(const void *a, const void *b)
|
||||
{
|
||||
int va = RoadVehInfo(*(const EngineID*)a)->max_speed;
|
||||
int vb = RoadVehInfo(*(const EngineID*)b)->max_speed;
|
||||
int r = va - vb;
|
||||
|
||||
return _internal_sort_order ? -r : r;
|
||||
}
|
||||
|
||||
static int CDECL RoadVehEngineRunningCostSorter(const void *a, const void *b)
|
||||
{
|
||||
const RoadVehicleInfo *rvi_a = RoadVehInfo(*(const EngineID*)a);
|
||||
const RoadVehicleInfo *rvi_b = RoadVehInfo(*(const EngineID*)b);
|
||||
|
||||
Money va = rvi_a->running_cost * GetPriceByIndex(rvi_a->running_cost_class);
|
||||
Money vb = rvi_b->running_cost * GetPriceByIndex(rvi_b->running_cost_class);
|
||||
int r = ClampToI32(va - vb);
|
||||
|
||||
if (r == 0) {
|
||||
/* Use EngineID to sort instead since we want consistent sorting */
|
||||
return EngineNumberSorter(a, b);
|
||||
}
|
||||
return _internal_sort_order ? -r : r;
|
||||
}
|
||||
|
||||
static int CDECL RoadVehEngineCapacitySorter(const void *a, const void *b)
|
||||
{
|
||||
int va = RoadVehInfo(*(const EngineID*)a)->capacity;
|
||||
@@ -282,6 +339,38 @@ static int CDECL RoadVehEngineCapacitySorter(const void *a, const void *b)
|
||||
return _internal_sort_order ? -r : r;
|
||||
}
|
||||
|
||||
/* Road vehicle sorting functions */
|
||||
static int CDECL ShipEngineCostSorter(const void *a, const void *b)
|
||||
{
|
||||
int va = ShipVehInfo(*(const EngineID*)a)->base_cost;
|
||||
int vb = ShipVehInfo(*(const EngineID*)b)->base_cost;
|
||||
int r = va - vb;
|
||||
|
||||
return _internal_sort_order ? -r : r;
|
||||
}
|
||||
|
||||
static int CDECL ShipEngineSpeedSorter(const void *a, const void *b)
|
||||
{
|
||||
int va = ShipVehInfo(*(const EngineID*)a)->max_speed;
|
||||
int vb = ShipVehInfo(*(const EngineID*)b)->max_speed;
|
||||
int r = va - vb;
|
||||
|
||||
return _internal_sort_order ? -r : r;
|
||||
}
|
||||
|
||||
static int CDECL ShipEngineRunningCostSorter(const void *a, const void *b)
|
||||
{
|
||||
const int va = ShipVehInfo(*(const EngineID*)a)->running_cost;
|
||||
const int vb = ShipVehInfo(*(const EngineID*)b)->running_cost;
|
||||
const int r = va - vb;
|
||||
|
||||
if (r == 0) {
|
||||
/* Use EngineID to sort instead since we want consistent sorting */
|
||||
return EngineNumberSorter(a, b);
|
||||
}
|
||||
return _internal_sort_order ? -r : r;
|
||||
}
|
||||
|
||||
static int CDECL ShipEngineCapacitySorter(const void *a, const void *b)
|
||||
{
|
||||
int va = ShipVehInfo(*(const EngineID*)a)->capacity;
|
||||
@@ -367,15 +456,21 @@ static EngList_SortTypeFunction * const _sorter[][10] = {{
|
||||
}, {
|
||||
/* Road vehicles */
|
||||
&EngineNumberSorter,
|
||||
&RoadVehEngineCostSorter,
|
||||
&RoadVehEngineSpeedSorter,
|
||||
&EngineIntroDateSorter,
|
||||
&EngineNameSorter,
|
||||
&RoadVehEngineRunningCostSorter,
|
||||
&EngineReliabilitySorter,
|
||||
&RoadVehEngineCapacitySorter,
|
||||
}, {
|
||||
/* Ships */
|
||||
&EngineNumberSorter,
|
||||
&ShipEngineCostSorter,
|
||||
&ShipEngineSpeedSorter,
|
||||
&EngineIntroDateSorter,
|
||||
&EngineNameSorter,
|
||||
&ShipEngineRunningCostSorter,
|
||||
&EngineReliabilitySorter,
|
||||
&ShipEngineCapacitySorter,
|
||||
}, {
|
||||
@@ -406,16 +501,22 @@ static const StringID _sort_listing[][11] = {{
|
||||
}, {
|
||||
/* Road vehicles */
|
||||
STR_ENGINE_SORT_ENGINE_ID,
|
||||
STR_ENGINE_SORT_COST,
|
||||
STR_SORT_BY_MAX_SPEED,
|
||||
STR_ENGINE_SORT_INTRO_DATE,
|
||||
STR_SORT_BY_DROPDOWN_NAME,
|
||||
STR_ENGINE_SORT_RUNNING_COST,
|
||||
STR_SORT_BY_RELIABILITY,
|
||||
STR_ENGINE_SORT_CARGO_CAPACITY,
|
||||
INVALID_STRING_ID
|
||||
}, {
|
||||
/* Ships */
|
||||
STR_ENGINE_SORT_ENGINE_ID,
|
||||
STR_ENGINE_SORT_COST,
|
||||
STR_SORT_BY_MAX_SPEED,
|
||||
STR_ENGINE_SORT_INTRO_DATE,
|
||||
STR_SORT_BY_DROPDOWN_NAME,
|
||||
STR_ENGINE_SORT_RUNNING_COST,
|
||||
STR_SORT_BY_RELIABILITY,
|
||||
STR_ENGINE_SORT_CARGO_CAPACITY,
|
||||
INVALID_STRING_ID
|
||||
@@ -432,6 +533,26 @@ static const StringID _sort_listing[][11] = {{
|
||||
INVALID_STRING_ID
|
||||
}};
|
||||
|
||||
static int DrawCargoCapacityInfo(int x, int y, EngineID engine, VehicleType type, bool refittable)
|
||||
{
|
||||
uint16 *cap = GetCapacityOfArticulatedParts(engine, type);
|
||||
|
||||
for (uint c = 0; c < NUM_CARGO; c++) {
|
||||
if (cap[c] == 0) continue;
|
||||
|
||||
SetDParam(0, c);
|
||||
SetDParam(1, cap[c]);
|
||||
SetDParam(2, refittable ? STR_9842_REFITTABLE : STR_EMPTY);
|
||||
DrawString(x, y, STR_PURCHASE_INFO_CAPACITY, TC_FROMSTRING);
|
||||
y += 10;
|
||||
|
||||
/* Only show as refittable once */
|
||||
refittable = false;
|
||||
}
|
||||
|
||||
return y;
|
||||
}
|
||||
|
||||
/* Draw rail wagon specific details */
|
||||
static int DrawRailWagonPurchaseInfo(int x, int y, EngineID engine_number, const RailVehicleInfo *rvi)
|
||||
{
|
||||
@@ -456,6 +577,14 @@ static int DrawRailWagonPurchaseInfo(int x, int y, EngineID engine_number, const
|
||||
y += 10;
|
||||
}
|
||||
}
|
||||
|
||||
/* Running cost */
|
||||
if (rvi->running_cost_class != 0xFF) {
|
||||
SetDParam(0, GetEngineProperty(engine_number, 0x0D, rvi->running_cost) * GetPriceByIndex(rvi->running_cost_class) >> 8);
|
||||
DrawString(x, y, STR_PURCHASE_INFO_RUNNINGCOST, TC_FROMSTRING);
|
||||
y += 10;
|
||||
}
|
||||
|
||||
return y;
|
||||
}
|
||||
|
||||
@@ -473,7 +602,7 @@ static int DrawRailEnginePurchaseInfo(int x, int y, EngineID engine_number, cons
|
||||
|
||||
/* Max speed - Engine power */
|
||||
SetDParam(0, GetEngineProperty(engine_number, 0x09, rvi->max_speed) * 10 / 16);
|
||||
SetDParam(1, GetEngineProperty(engine_number, 0x0B, rvi->power) << multihead);
|
||||
SetDParam(1, GetEngineProperty(engine_number, 0x0B, rvi->power));
|
||||
DrawString(x, y, STR_PURCHASE_INFO_SPEED_POWER, TC_FROMSTRING);
|
||||
y += 10;
|
||||
|
||||
@@ -485,9 +614,11 @@ static int DrawRailEnginePurchaseInfo(int x, int y, EngineID engine_number, cons
|
||||
}
|
||||
|
||||
/* Running cost */
|
||||
SetDParam(0, (GetEngineProperty(engine_number, 0x0D, rvi->running_cost_base) * _price.running_rail[rvi->running_cost_class] >> 8) << multihead);
|
||||
DrawString(x, y, STR_PURCHASE_INFO_RUNNINGCOST, TC_FROMSTRING);
|
||||
y += 10;
|
||||
if (rvi->running_cost_class != 0xFF) {
|
||||
SetDParam(0, GetEngineProperty(engine_number, 0x0D, rvi->running_cost) * GetPriceByIndex(rvi->running_cost_class) >> 8);
|
||||
DrawString(x, y, STR_PURCHASE_INFO_RUNNINGCOST, TC_FROMSTRING);
|
||||
y += 10;
|
||||
}
|
||||
|
||||
/* Powered wagons power - Powered wagons extra weight */
|
||||
if (rvi->pow_wag_power != 0) {
|
||||
@@ -512,18 +643,12 @@ static int DrawRoadVehPurchaseInfo(int x, int y, EngineID engine_number, const R
|
||||
y += 10;
|
||||
|
||||
/* Running cost */
|
||||
SetDParam(0, rvi->running_cost * _price.roadveh_running >> 8);
|
||||
SetDParam(0, rvi->running_cost * GetPriceByIndex(rvi->running_cost_class) >> 8);
|
||||
DrawString(x, y, STR_PURCHASE_INFO_RUNNINGCOST, TC_FROMSTRING);
|
||||
y += 10;
|
||||
|
||||
/* Cargo type + capacity */
|
||||
SetDParam(0, rvi->cargo_type);
|
||||
SetDParam(1, GetEngineProperty(engine_number, 0x0F, rvi->capacity));
|
||||
SetDParam(2, refittable ? STR_9842_REFITTABLE : STR_EMPTY);
|
||||
DrawString(x, y, STR_PURCHASE_INFO_CAPACITY, TC_FROMSTRING);
|
||||
y += 10;
|
||||
|
||||
return y;
|
||||
return DrawCargoCapacityInfo(x, y, engine_number, VEH_ROAD, refittable);
|
||||
}
|
||||
|
||||
/* Draw ship specific details */
|
||||
@@ -614,20 +739,18 @@ int DrawVehiclePurchaseInfo(int x, int y, uint w, EngineID engine_number)
|
||||
}
|
||||
|
||||
/* Cargo type + capacity, or N/A */
|
||||
if (rvi->capacity == 0) {
|
||||
int new_y = DrawCargoCapacityInfo(x, y, engine_number, VEH_TRAIN, refitable);
|
||||
|
||||
if (new_y == y) {
|
||||
SetDParam(0, CT_INVALID);
|
||||
SetDParam(2, STR_EMPTY);
|
||||
DrawString(x, y, STR_PURCHASE_INFO_CAPACITY, TC_FROMSTRING);
|
||||
y += 10;
|
||||
} else {
|
||||
int multihead = (rvi->railveh_type == RAILVEH_MULTIHEAD ? 1 : 0);
|
||||
|
||||
SetDParam(0, rvi->cargo_type);
|
||||
SetDParam(1, (capacity * (CountArticulatedParts(engine_number, true) + 1)) << multihead);
|
||||
SetDParam(2, refitable ? STR_9842_REFITTABLE : STR_EMPTY);
|
||||
y = new_y;
|
||||
}
|
||||
DrawString(x, y, STR_PURCHASE_INFO_CAPACITY, TC_FROMSTRING);
|
||||
y += 10;
|
||||
}
|
||||
break;
|
||||
}
|
||||
case VEH_ROAD:
|
||||
y = DrawRoadVehPurchaseInfo(x, y, engine_number, RoadVehInfo(engine_number));
|
||||
refitable = true;
|
||||
@@ -667,7 +790,7 @@ int DrawVehiclePurchaseInfo(int x, int y, uint w, EngineID engine_number)
|
||||
/* Figure out what train EngineIDs to put in the list */
|
||||
static void GenerateBuildTrainList(Window *w)
|
||||
{
|
||||
EngineID eid, sel_id;
|
||||
EngineID sel_id = INVALID_ENGINE;
|
||||
int num_engines = 0;
|
||||
int num_wagons = 0;
|
||||
buildvehicle_d *bv = &WP(w, buildvehicle_d);
|
||||
@@ -680,7 +803,8 @@ static void GenerateBuildTrainList(Window *w)
|
||||
* Also check to see if the previously selected engine is still available,
|
||||
* and if not, reset selection to INVALID_ENGINE. This could be the case
|
||||
* when engines become obsolete and are removed */
|
||||
for (sel_id = INVALID_ENGINE, eid = 0; eid < NUM_TRAIN_ENGINES; eid++) {
|
||||
EngineID eid;
|
||||
FOR_ALL_ENGINEIDS_OF_TYPE(eid, VEH_TRAIN) {
|
||||
const RailVehicleInfo *rvi = RailVehInfo(eid);
|
||||
|
||||
if (bv->filter.railtype != RAILTYPE_END && !HasPowerOnRail(rvi->railtype, bv->filter.railtype)) continue;
|
||||
@@ -713,14 +837,13 @@ static void GenerateBuildTrainList(Window *w)
|
||||
/* Figure out what road vehicle EngineIDs to put in the list */
|
||||
static void GenerateBuildRoadVehList(Window *w)
|
||||
{
|
||||
EngineID eid, sel_id;
|
||||
EngineID sel_id = INVALID_ENGINE;
|
||||
buildvehicle_d *bv = &WP(w, buildvehicle_d);
|
||||
|
||||
EngList_RemoveAll(&bv->eng_list);
|
||||
|
||||
sel_id = INVALID_ENGINE;
|
||||
|
||||
for (eid = ROAD_ENGINES_INDEX; eid < ROAD_ENGINES_INDEX + NUM_ROAD_ENGINES; eid++) {
|
||||
EngineID eid;
|
||||
FOR_ALL_ENGINEIDS_OF_TYPE(eid, VEH_ROAD) {
|
||||
if (!IsEngineBuildable(eid, VEH_ROAD, _local_player)) continue;
|
||||
if (!HasBit(bv->filter.roadtypes, HasBit(EngInfo(eid)->misc_flags, EF_ROAD_TRAM) ? ROADTYPE_TRAM : ROADTYPE_ROAD)) continue;
|
||||
EngList_Add(&bv->eng_list, eid);
|
||||
@@ -733,14 +856,13 @@ static void GenerateBuildRoadVehList(Window *w)
|
||||
/* Figure out what ship EngineIDs to put in the list */
|
||||
static void GenerateBuildShipList(Window *w)
|
||||
{
|
||||
EngineID eid, sel_id;
|
||||
EngineID sel_id = INVALID_ENGINE;
|
||||
buildvehicle_d *bv = &WP(w, buildvehicle_d);
|
||||
|
||||
EngList_RemoveAll(&bv->eng_list);
|
||||
|
||||
sel_id = INVALID_ENGINE;
|
||||
|
||||
for (eid = SHIP_ENGINES_INDEX; eid < SHIP_ENGINES_INDEX + NUM_SHIP_ENGINES; eid++) {
|
||||
EngineID eid;
|
||||
FOR_ALL_ENGINEIDS_OF_TYPE(eid, VEH_SHIP) {
|
||||
if (!IsEngineBuildable(eid, VEH_SHIP, _local_player)) continue;
|
||||
EngList_Add(&bv->eng_list, eid);
|
||||
|
||||
@@ -752,7 +874,7 @@ static void GenerateBuildShipList(Window *w)
|
||||
/* Figure out what aircraft EngineIDs to put in the list */
|
||||
static void GenerateBuildAircraftList(Window *w)
|
||||
{
|
||||
EngineID eid, sel_id;
|
||||
EngineID sel_id = INVALID_ENGINE;
|
||||
buildvehicle_d *bv = &WP(w, buildvehicle_d);
|
||||
|
||||
EngList_RemoveAll(&bv->eng_list);
|
||||
@@ -761,8 +883,8 @@ static void GenerateBuildAircraftList(Window *w)
|
||||
* Also check to see if the previously selected plane is still available,
|
||||
* and if not, reset selection to INVALID_ENGINE. This could be the case
|
||||
* when planes become obsolete and are removed */
|
||||
sel_id = INVALID_ENGINE;
|
||||
for (eid = AIRCRAFT_ENGINES_INDEX; eid < AIRCRAFT_ENGINES_INDEX + NUM_AIRCRAFT_ENGINES; eid++) {
|
||||
EngineID eid;
|
||||
FOR_ALL_ENGINEIDS_OF_TYPE(eid, VEH_AIRCRAFT) {
|
||||
if (!IsEngineBuildable(eid, VEH_AIRCRAFT, _local_player)) continue;
|
||||
/* First VEH_END window_numbers are fake to allow a window open for all different types at once */
|
||||
if (w->window_number > VEH_END && !CanAircraftUseStation(eid, w->window_number)) continue;
|
||||
@@ -798,7 +920,7 @@ static void GenerateBuildList(Window *w)
|
||||
EngList_Sort(&bv->eng_list, _sorter[bv->vehicle_type][bv->sort_criteria]);
|
||||
}
|
||||
|
||||
static void DrawVehicleEngine(byte type, int x, int y, EngineID engine, SpriteID pal)
|
||||
static void DrawVehicleEngine(VehicleType type, int x, int y, EngineID engine, SpriteID pal)
|
||||
{
|
||||
switch (type) {
|
||||
case VEH_TRAIN: DrawTrainEngine( x, y, engine, pal); break;
|
||||
@@ -866,23 +988,6 @@ void DrawEngineList(VehicleType type, int x, int y, const EngineList eng_list, u
|
||||
}
|
||||
}
|
||||
|
||||
static void ExpandPurchaseInfoWidget(Window *w, int expand_by)
|
||||
{
|
||||
Widget *wi = &w->widget[BUILD_VEHICLE_WIDGET_PANEL];
|
||||
|
||||
SetWindowDirty(w);
|
||||
wi->bottom += expand_by;
|
||||
|
||||
for (uint i = BUILD_VEHICLE_WIDGET_BUILD; i < BUILD_VEHICLE_WIDGET_END; i++) {
|
||||
wi = &w->widget[i];
|
||||
wi->top += expand_by;
|
||||
wi->bottom += expand_by;
|
||||
}
|
||||
|
||||
w->height += expand_by;
|
||||
SetWindowDirty(w);
|
||||
}
|
||||
|
||||
static void DrawBuildVehicleWindow(Window *w)
|
||||
{
|
||||
const buildvehicle_d *bv = &WP(w, buildvehicle_d);
|
||||
@@ -892,19 +997,26 @@ static void DrawBuildVehicleWindow(Window *w)
|
||||
|
||||
SetVScrollCount(w, EngList_Count(&bv->eng_list));
|
||||
SetDParam(0, bv->filter.railtype + STR_881C_NEW_RAIL_VEHICLES); // This should only affect rail vehicles
|
||||
|
||||
/* Set text of sort by dropdown */
|
||||
w->widget[BUILD_VEHICLE_WIDGET_SORT_DROPDOWN].data = _sort_listing[bv->vehicle_type][bv->sort_criteria];
|
||||
|
||||
DrawWindowWidgets(w);
|
||||
|
||||
DrawEngineList(bv->vehicle_type, 2, 27, bv->eng_list, w->vscroll.pos, max, bv->sel_engine, false, DEFAULT_GROUP);
|
||||
DrawEngineList(bv->vehicle_type, w->widget[BUILD_VEHICLE_WIDGET_LIST].left + 2, w->widget[BUILD_VEHICLE_WIDGET_LIST].top + 1, bv->eng_list, w->vscroll.pos, max, bv->sel_engine, false, DEFAULT_GROUP);
|
||||
|
||||
if (bv->sel_engine != INVALID_ENGINE) {
|
||||
const Widget *wi = &w->widget[BUILD_VEHICLE_WIDGET_PANEL];
|
||||
int text_end = DrawVehiclePurchaseInfo(2, wi->top + 1, wi->right - wi->left - 2, bv->sel_engine);
|
||||
|
||||
if (text_end > wi->bottom) ExpandPurchaseInfoWidget(w, text_end - wi->bottom);
|
||||
if (text_end > wi->bottom) {
|
||||
SetWindowDirty(w);
|
||||
ResizeWindowForWidget(w, BUILD_VEHICLE_WIDGET_PANEL, 0, text_end - wi->bottom);
|
||||
SetWindowDirty(w);
|
||||
}
|
||||
}
|
||||
|
||||
DrawString(85, 15, _sort_listing[bv->vehicle_type][bv->sort_criteria], TC_BLACK);
|
||||
DoDrawString(bv->descending_sort_order ? DOWNARROW : UPARROW, 69, 15, TC_BLACK);
|
||||
DrawSortButtonState(w, BUILD_VEHICLE_WIDGET_SORT_ASSENDING_DESCENDING, bv->descending_sort_order ? SBS_DOWN : SBS_UP);
|
||||
}
|
||||
|
||||
static void BuildVehicleClickEvent(Window *w, WindowEvent *e)
|
||||
@@ -920,14 +1032,14 @@ static void BuildVehicleClickEvent(Window *w, WindowEvent *e)
|
||||
break;
|
||||
|
||||
case BUILD_VEHICLE_WIDGET_LIST: {
|
||||
uint i = (e->we.click.pt.y - 26) / GetVehicleListHeight(bv->vehicle_type) + w->vscroll.pos;
|
||||
uint i = (e->we.click.pt.y - w->widget[BUILD_VEHICLE_WIDGET_LIST].top) / GetVehicleListHeight(bv->vehicle_type) + w->vscroll.pos;
|
||||
uint num_items = EngList_Count(&bv->eng_list);
|
||||
bv->sel_engine = (i < num_items) ? bv->eng_list[i] : INVALID_ENGINE;
|
||||
SetWindowDirty(w);
|
||||
break;
|
||||
}
|
||||
|
||||
case BUILD_VEHICLE_WIDGET_SORT_TEXT: case BUILD_VEHICLE_WIDGET_SORT_DROPDOWN: // Select sorting criteria dropdown menu
|
||||
case BUILD_VEHICLE_WIDGET_SORT_DROPDOWN: // Select sorting criteria dropdown menu
|
||||
ShowDropDownMenu(w, _sort_listing[bv->vehicle_type], bv->sort_criteria, BUILD_VEHICLE_WIDGET_SORT_DROPDOWN, 0, 0);
|
||||
break;
|
||||
|
||||
|
@@ -5,7 +5,6 @@
|
||||
#include "stdafx.h"
|
||||
#include "openttd.h"
|
||||
#include "callback_table.h"
|
||||
#include "functions.h"
|
||||
|
||||
/* If you add a callback for DoCommandP, also add the callback in here
|
||||
* see below for the full list!
|
||||
|
@@ -5,7 +5,7 @@
|
||||
#ifndef CALLBACK_TABLE_H
|
||||
#define CALLBACK_TABLE_H
|
||||
|
||||
#include "command.h"
|
||||
#include "command_type.h"
|
||||
|
||||
extern CommandCallback *_callback_table[];
|
||||
extern const int _callback_table_count;
|
||||
|
59
src/cargo_type.h
Normal file
59
src/cargo_type.h
Normal file
@@ -0,0 +1,59 @@
|
||||
/* $Id$ */
|
||||
|
||||
/** @file cargo_type.h Types related to cargos... */
|
||||
|
||||
#ifndef CARGO_TYPE_H
|
||||
#define CARGO_TYPE_H
|
||||
|
||||
typedef byte CargoID;
|
||||
|
||||
enum {
|
||||
// Temperate
|
||||
CT_PASSENGERS = 0,
|
||||
CT_COAL = 1,
|
||||
CT_MAIL = 2,
|
||||
CT_OIL = 3,
|
||||
CT_LIVESTOCK = 4,
|
||||
CT_GOODS = 5,
|
||||
CT_GRAIN = 6,
|
||||
CT_WOOD = 7,
|
||||
CT_IRON_ORE = 8,
|
||||
CT_STEEL = 9,
|
||||
CT_VALUABLES = 10,
|
||||
|
||||
// Arctic
|
||||
CT_WHEAT = 6,
|
||||
CT_HILLY_UNUSED = 8,
|
||||
CT_PAPER = 9,
|
||||
CT_GOLD = 10,
|
||||
CT_FOOD = 11,
|
||||
|
||||
// Tropic
|
||||
CT_RUBBER = 1,
|
||||
CT_FRUIT = 4,
|
||||
CT_MAIZE = 6,
|
||||
CT_COPPER_ORE = 8,
|
||||
CT_WATER = 9,
|
||||
CT_DIAMONDS = 10,
|
||||
|
||||
// Toyland
|
||||
CT_SUGAR = 1,
|
||||
CT_TOYS = 3,
|
||||
CT_BATTERIES = 4,
|
||||
CT_CANDY = 5,
|
||||
CT_TOFFEE = 6,
|
||||
CT_COLA = 7,
|
||||
CT_COTTON_CANDY = 8,
|
||||
CT_BUBBLES = 9,
|
||||
CT_PLASTIC = 10,
|
||||
CT_FIZZY_DRINKS = 11,
|
||||
|
||||
NUM_CARGO = 32,
|
||||
|
||||
CT_NO_REFIT = 0xFE,
|
||||
CT_INVALID = 0xFF
|
||||
};
|
||||
|
||||
typedef uint AcceptedCargo[NUM_CARGO];
|
||||
|
||||
#endif /* OPENTTD_H */
|
@@ -37,7 +37,7 @@ CargoPacket::~CargoPacket()
|
||||
this->count = 0;
|
||||
}
|
||||
|
||||
bool CargoPacket::SameSource(CargoPacket *cp)
|
||||
bool CargoPacket::SameSource(const CargoPacket *cp) const
|
||||
{
|
||||
return this->source_xy == cp->source_xy && this->days_in_transit == cp->days_in_transit && this->paid_for == cp->paid_for;
|
||||
}
|
||||
|
@@ -1,10 +1,12 @@
|
||||
/* $Id$ */
|
||||
|
||||
/** @file cargotype.h */
|
||||
/** @file cargopacket.h */
|
||||
|
||||
#ifndef CARGOPACKET_H
|
||||
#define CARGOPACKET_H
|
||||
|
||||
#include "economy_type.h"
|
||||
#include "tile_type.h"
|
||||
#include <list>
|
||||
|
||||
typedef uint32 CargoPacketID;
|
||||
@@ -51,7 +53,7 @@ struct CargoPacket : PoolItem<CargoPacket, CargoPacketID, &_CargoPacket_pool> {
|
||||
* @param cp the cargo packet to compare to
|
||||
* @return true if and only if days_in_transit and source_xy are equal
|
||||
*/
|
||||
bool SameSource(CargoPacket *cp);
|
||||
bool SameSource(const CargoPacket *cp) const;
|
||||
};
|
||||
|
||||
/**
|
||||
|
@@ -4,12 +4,12 @@
|
||||
|
||||
#include "stdafx.h"
|
||||
#include "openttd.h"
|
||||
#include "macros.h"
|
||||
#include "table/sprites.h"
|
||||
#include "table/strings.h"
|
||||
#include "newgrf_cargo.h"
|
||||
#include "cargotype.h"
|
||||
#include "core/bitmath_func.hpp"
|
||||
|
||||
#include "table/sprites.h"
|
||||
#include "table/strings.h"
|
||||
#include "table/cargo_const.h"
|
||||
|
||||
CargoSpec _cargo[NUM_CARGO];
|
||||
@@ -37,7 +37,7 @@ void SetupCargoForClimate(LandscapeID l)
|
||||
if (cl < lengthof(_default_cargo)) {
|
||||
/* Copy the indexed cargo */
|
||||
_cargo[i] = _default_cargo[cl];
|
||||
SetBit(_cargo_mask, i);
|
||||
if (_cargo[i].bitnum != INVALID_CARGO) SetBit(_cargo_mask, i);
|
||||
continue;
|
||||
}
|
||||
|
||||
|
@@ -5,6 +5,9 @@
|
||||
#ifndef CARGOTYPE_H
|
||||
#define CARGOTYPE_H
|
||||
|
||||
#include "cargo_type.h"
|
||||
#include "gfx_type.h"
|
||||
#include "newgrf_string_type.h"
|
||||
|
||||
typedef uint32 CargoLabel;
|
||||
|
||||
@@ -33,11 +36,11 @@ struct CargoSpec {
|
||||
uint16 multipliertowngrowth;
|
||||
uint8 callback_mask;
|
||||
|
||||
StringID name;
|
||||
StringID name_single;
|
||||
StringID units_volume;
|
||||
StringID quantifier;
|
||||
StringID abbrev;
|
||||
GRFMappedStringID name;
|
||||
GRFMappedStringID name_single;
|
||||
GRFMappedStringID units_volume;
|
||||
GRFMappedStringID quantifier;
|
||||
GRFMappedStringID abbrev;
|
||||
|
||||
SpriteID sprite;
|
||||
|
||||
|
@@ -5,442 +5,23 @@
|
||||
#include "stdafx.h"
|
||||
#include "openttd.h"
|
||||
#include "clear_map.h"
|
||||
#include "rail_map.h"
|
||||
#include "table/strings.h"
|
||||
#include "functions.h"
|
||||
#include "map.h"
|
||||
#include "player.h"
|
||||
#include "tile.h"
|
||||
#include "viewport.h"
|
||||
#include "command.h"
|
||||
#include "tunnel_map.h"
|
||||
#include "bridge_map.h"
|
||||
#include "command_func.h"
|
||||
#include "bridge.h"
|
||||
#include "landscape.h"
|
||||
#include "variables.h"
|
||||
#include "table/sprites.h"
|
||||
#include "unmovable_map.h"
|
||||
#include "genworld.h"
|
||||
#include "industry.h"
|
||||
#include "water_map.h"
|
||||
|
||||
/*
|
||||
* In one terraforming command all four corners of a initial tile can be raised/lowered (though this is not available to the player).
|
||||
* The maximal amount of height modifications is archieved when raising a complete flat land from sea level to MAX_TILE_HEIGHT or vice versa.
|
||||
* This affects all corners with a manhatten distance smaller than MAX_TILE_HEIGHT to one of the initial 4 corners.
|
||||
* Their maximal amount is computed to 4 * \sum_{i=1}^{h_max} i = 2 * h_max * (h_max + 1).
|
||||
*/
|
||||
static const int TERRAFORMER_MODHEIGHT_SIZE = 2 * MAX_TILE_HEIGHT * (MAX_TILE_HEIGHT + 1);
|
||||
|
||||
/*
|
||||
* The maximal amount of affected tiles (i.e. the tiles that incident with one of the corners above, is computed similiar to
|
||||
* 1 + 4 * \sum_{i=1}^{h_max} (i+1) = 1 + 2 * h_max + (h_max + 3).
|
||||
*/
|
||||
static const int TERRAFORMER_TILE_TABLE_SIZE = 1 + 2 * MAX_TILE_HEIGHT * (MAX_TILE_HEIGHT + 3);
|
||||
|
||||
struct TerraformerHeightMod {
|
||||
TileIndex tile; ///< Referenced tile.
|
||||
byte height; ///< New TileHeight (height of north corner) of the tile.
|
||||
};
|
||||
|
||||
struct TerraformerState {
|
||||
int modheight_count; ///< amount of entries in "modheight".
|
||||
int tile_table_count; ///< amount of entries in "tile_table".
|
||||
|
||||
/**
|
||||
* Dirty tiles, i.e.\ at least one corner changed.
|
||||
*
|
||||
* This array contains the tiles which are or will be marked as dirty.
|
||||
*
|
||||
* @ingroup dirty
|
||||
*/
|
||||
TileIndex tile_table[TERRAFORMER_TILE_TABLE_SIZE];
|
||||
TerraformerHeightMod modheight[TERRAFORMER_MODHEIGHT_SIZE]; ///< Height modifications.
|
||||
};
|
||||
|
||||
/**
|
||||
* Gets the TileHeight (height of north corner) of a tile as of current terraforming progress.
|
||||
*
|
||||
* @param ts TerraformerState.
|
||||
* @param tile Tile.
|
||||
* @return TileHeight.
|
||||
*/
|
||||
static int TerraformGetHeightOfTile(TerraformerState *ts, TileIndex tile)
|
||||
{
|
||||
TerraformerHeightMod *mod = ts->modheight;
|
||||
int count;
|
||||
|
||||
for (count = ts->modheight_count; count != 0; count--, mod++) {
|
||||
if (mod->tile == tile) return mod->height;
|
||||
}
|
||||
|
||||
/* TileHeight unchanged so far, read value from map. */
|
||||
return TileHeight(tile);
|
||||
}
|
||||
|
||||
/**
|
||||
* Stores the TileHeight (height of north corner) of a tile in a TerraformerState.
|
||||
*
|
||||
* @param ts TerraformerState.
|
||||
* @param tile Tile.
|
||||
* @param height New TileHeight.
|
||||
*/
|
||||
static void TerraformSetHeightOfTile(TerraformerState *ts, TileIndex tile, int height)
|
||||
{
|
||||
/* Find tile in the "modheight" table.
|
||||
* Note: In a normal user-terraform command the tile will not be found in the "modheight" table.
|
||||
* But during house- or industry-construction multiple corners can be terraformed at once. */
|
||||
TerraformerHeightMod *mod = ts->modheight;
|
||||
int count = ts->modheight_count;
|
||||
while ((count > 0) && (mod->tile != tile)) {
|
||||
mod++;
|
||||
count--;
|
||||
}
|
||||
|
||||
/* New entry? */
|
||||
if (count == 0) {
|
||||
assert(ts->modheight_count < TERRAFORMER_MODHEIGHT_SIZE);
|
||||
ts->modheight_count++;
|
||||
}
|
||||
|
||||
/* Finally store the new value */
|
||||
mod->tile = tile;
|
||||
mod->height = (byte)height;
|
||||
}
|
||||
|
||||
/**
|
||||
* Adds a tile to the "tile_table" in a TerraformerState.
|
||||
*
|
||||
* @param ts TerraformerState.
|
||||
* @param tile Tile.
|
||||
* @ingroup dirty
|
||||
*/
|
||||
static void TerraformAddDirtyTile(TerraformerState *ts, TileIndex tile)
|
||||
{
|
||||
int count;
|
||||
TileIndex *t;
|
||||
|
||||
count = ts->tile_table_count;
|
||||
|
||||
for (t = ts->tile_table; count != 0; count--, t++) {
|
||||
if (*t == tile) return;
|
||||
}
|
||||
|
||||
assert(ts->tile_table_count < TERRAFORMER_TILE_TABLE_SIZE);
|
||||
|
||||
ts->tile_table[ts->tile_table_count++] = tile;
|
||||
}
|
||||
|
||||
/**
|
||||
* Adds all tiles that incident with the north corner of a specific tile to the "tile_table" in a TerraformerState.
|
||||
*
|
||||
* @param ts TerraformerState.
|
||||
* @param tile Tile.
|
||||
* @ingroup dirty
|
||||
*/
|
||||
static void TerraformAddDirtyTileAround(TerraformerState *ts, TileIndex tile)
|
||||
{
|
||||
TerraformAddDirtyTile(ts, tile + TileDiffXY( 0, -1));
|
||||
TerraformAddDirtyTile(ts, tile + TileDiffXY(-1, -1));
|
||||
TerraformAddDirtyTile(ts, tile + TileDiffXY(-1, 0));
|
||||
TerraformAddDirtyTile(ts, tile);
|
||||
}
|
||||
|
||||
/**
|
||||
* Terraform the north corner of a tile to a specific height.
|
||||
*
|
||||
* @param ts TerraformerState.
|
||||
* @param tile Tile.
|
||||
* @param height Aimed height.
|
||||
* @param return Error code or cost.
|
||||
*/
|
||||
static CommandCost TerraformTileHeight(TerraformerState *ts, TileIndex tile, int height)
|
||||
{
|
||||
CommandCost total_cost = CommandCost();
|
||||
|
||||
assert(tile < MapSize());
|
||||
|
||||
/* Check range of destination height */
|
||||
if (height < 0) return_cmd_error(STR_1003_ALREADY_AT_SEA_LEVEL);
|
||||
if (height > MAX_TILE_HEIGHT) return_cmd_error(STR_1004_TOO_HIGH);
|
||||
|
||||
/*
|
||||
* Check if the terraforming has any effect.
|
||||
* This can only be true, if multiple corners of the start-tile are terraformed (i.e. the terraforming is done by towns/industries etc.).
|
||||
* In this case the terraforming should fail. (Don't know why.)
|
||||
*/
|
||||
if (height == TerraformGetHeightOfTile(ts, tile)) return CMD_ERROR;
|
||||
|
||||
/* Check "too close to edge of map" */
|
||||
uint x = TileX(tile);
|
||||
uint y = TileY(tile);
|
||||
if ((x <= 1) || (y <= 1) || (x >= MapMaxX() - 1) || (y >= MapMaxY() - 1)) {
|
||||
/*
|
||||
* Determine a sensible error tile
|
||||
* Note: If x and y are both zero this will disable the error tile. (Tile 0 cannot be highlighted :( )
|
||||
*/
|
||||
if ((x == 1) && (y != 0)) x = 0;
|
||||
if ((y == 1) && (x != 0)) y = 0;
|
||||
_terraform_err_tile = TileXY(x, y);
|
||||
return_cmd_error(STR_0002_TOO_CLOSE_TO_EDGE_OF_MAP);
|
||||
}
|
||||
|
||||
/* Mark incident tiles, that are involved in the terraforming */
|
||||
TerraformAddDirtyTileAround(ts, tile);
|
||||
|
||||
/* Store the height modification */
|
||||
TerraformSetHeightOfTile(ts, tile, height);
|
||||
|
||||
/* Increment cost */
|
||||
total_cost.AddCost(_price.terraform);
|
||||
|
||||
/* Recurse to neighboured corners if height difference is larger than 1 */
|
||||
{
|
||||
const TileIndexDiffC *ttm;
|
||||
|
||||
static const TileIndexDiffC _terraform_tilepos[] = {
|
||||
{ 1, 0}, // move to tile in SE
|
||||
{-2, 0}, // undo last move, and move to tile in NW
|
||||
{ 1, 1}, // undo last move, and move to tile in SW
|
||||
{ 0, -2} // undo last move, and move to tile in NE
|
||||
};
|
||||
|
||||
for (ttm = _terraform_tilepos; ttm != endof(_terraform_tilepos); ttm++) {
|
||||
tile += ToTileIndexDiff(*ttm);
|
||||
|
||||
/* Get TileHeight of neighboured tile as of current terraform progress */
|
||||
int r = TerraformGetHeightOfTile(ts, tile);
|
||||
int height_diff = height - r;
|
||||
|
||||
/* Is the height difference to the neighboured corner greater than 1? */
|
||||
if (abs(height_diff) > 1) {
|
||||
/* Terraform the neighboured corner. The resulting height difference should be 1. */
|
||||
height_diff += (height_diff < 0 ? 1 : -1);
|
||||
CommandCost cost = TerraformTileHeight(ts, tile, r + height_diff);
|
||||
if (CmdFailed(cost)) return cost;
|
||||
total_cost.AddCost(cost);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return total_cost;
|
||||
}
|
||||
|
||||
/** Terraform land
|
||||
* @param tile tile to terraform
|
||||
* @param flags for this command type
|
||||
* @param p1 corners to terraform (SLOPE_xxx)
|
||||
* @param p2 direction; eg up (non-zero) or down (zero)
|
||||
* @return error or cost of terraforming
|
||||
*/
|
||||
CommandCost CmdTerraformLand(TileIndex tile, uint32 flags, uint32 p1, uint32 p2)
|
||||
{
|
||||
TerraformerState ts;
|
||||
CommandCost total_cost = CommandCost();
|
||||
int direction = (p2 != 0 ? 1 : -1);
|
||||
|
||||
SET_EXPENSES_TYPE(EXPENSES_CONSTRUCTION);
|
||||
|
||||
_terraform_err_tile = 0;
|
||||
|
||||
ts.modheight_count = ts.tile_table_count = 0;
|
||||
|
||||
/* Make an extra check for map-bounds cause we add tiles to the originating tile */
|
||||
if (tile + TileDiffXY(1, 1) >= MapSize()) return CMD_ERROR;
|
||||
|
||||
/* Compute the costs and the terraforming result in a model of the landscape */
|
||||
if ((p1 & SLOPE_W) != 0) {
|
||||
TileIndex t = tile + TileDiffXY(1, 0);
|
||||
CommandCost cost = TerraformTileHeight(&ts, t, TileHeight(t) + direction);
|
||||
if (CmdFailed(cost)) return cost;
|
||||
total_cost.AddCost(cost);
|
||||
}
|
||||
|
||||
if ((p1 & SLOPE_S) != 0) {
|
||||
TileIndex t = tile + TileDiffXY(1, 1);
|
||||
CommandCost cost = TerraformTileHeight(&ts, t, TileHeight(t) + direction);
|
||||
if (CmdFailed(cost)) return cost;
|
||||
total_cost.AddCost(cost);
|
||||
}
|
||||
|
||||
if ((p1 & SLOPE_E) != 0) {
|
||||
TileIndex t = tile + TileDiffXY(0, 1);
|
||||
CommandCost cost = TerraformTileHeight(&ts, t, TileHeight(t) + direction);
|
||||
if (CmdFailed(cost)) return cost;
|
||||
total_cost.AddCost(cost);
|
||||
}
|
||||
|
||||
if ((p1 & SLOPE_N) != 0) {
|
||||
TileIndex t = tile + TileDiffXY(0, 0);
|
||||
CommandCost cost = TerraformTileHeight(&ts, t, TileHeight(t) + direction);
|
||||
if (CmdFailed(cost)) return cost;
|
||||
total_cost.AddCost(cost);
|
||||
}
|
||||
|
||||
/* Check if the terraforming is valid wrt. tunnels, bridges and objects on the surface */
|
||||
{
|
||||
int count;
|
||||
TileIndex *ti = ts.tile_table;
|
||||
|
||||
for (count = ts.tile_table_count; count != 0; count--, ti++) {
|
||||
TileIndex tile = *ti;
|
||||
|
||||
/* Find new heights of tile corners */
|
||||
uint z_N = TerraformGetHeightOfTile(&ts, tile + TileDiffXY(0, 0));
|
||||
uint z_W = TerraformGetHeightOfTile(&ts, tile + TileDiffXY(1, 0));
|
||||
uint z_S = TerraformGetHeightOfTile(&ts, tile + TileDiffXY(1, 1));
|
||||
uint z_E = TerraformGetHeightOfTile(&ts, tile + TileDiffXY(0, 1));
|
||||
|
||||
/* Find min and max height of tile */
|
||||
uint z_min = min(min(z_N, z_W), min(z_S, z_E));
|
||||
uint z_max = max(max(z_N, z_W), max(z_S, z_E));
|
||||
|
||||
/* Compute tile slope */
|
||||
uint tileh = (z_max > z_min + 1 ? SLOPE_STEEP : SLOPE_FLAT);
|
||||
if (z_W > z_min) tileh += SLOPE_W;
|
||||
if (z_S > z_min) tileh += SLOPE_S;
|
||||
if (z_E > z_min) tileh += SLOPE_E;
|
||||
if (z_N > z_min) tileh += SLOPE_N;
|
||||
|
||||
/* Check if bridge would take damage */
|
||||
if (direction == 1 && MayHaveBridgeAbove(tile) && IsBridgeAbove(tile) &&
|
||||
GetBridgeHeight(GetSouthernBridgeEnd(tile)) <= z_max * TILE_HEIGHT) {
|
||||
_terraform_err_tile = tile; // highlight the tile under the bridge
|
||||
return_cmd_error(STR_5007_MUST_DEMOLISH_BRIDGE_FIRST);
|
||||
}
|
||||
/* Check if tunnel would take damage */
|
||||
if (direction == -1 && IsTunnelInWay(tile, z_min * TILE_HEIGHT)) {
|
||||
_terraform_err_tile = tile; // highlight the tile above the tunnel
|
||||
return_cmd_error(STR_1002_EXCAVATION_WOULD_DAMAGE);
|
||||
}
|
||||
/* Check tiletype-specific things, and add extra-cost */
|
||||
CommandCost cost = _tile_type_procs[GetTileType(tile)]->terraform_tile_proc(tile, flags | DC_AUTO, z_min * TILE_HEIGHT, (Slope) tileh);
|
||||
if (CmdFailed(cost)) {
|
||||
_terraform_err_tile = tile;
|
||||
return cost;
|
||||
}
|
||||
total_cost.AddCost(cost);
|
||||
}
|
||||
}
|
||||
|
||||
if (flags & DC_EXEC) {
|
||||
/* change the height */
|
||||
{
|
||||
int count;
|
||||
TerraformerHeightMod *mod;
|
||||
|
||||
mod = ts.modheight;
|
||||
for (count = ts.modheight_count; count != 0; count--, mod++) {
|
||||
TileIndex til = mod->tile;
|
||||
|
||||
SetTileHeight(til, mod->height);
|
||||
}
|
||||
}
|
||||
|
||||
/* finally mark the dirty tiles dirty */
|
||||
{
|
||||
int count;
|
||||
TileIndex *ti = ts.tile_table;
|
||||
for (count = ts.tile_table_count; count != 0; count--, ti++) {
|
||||
MarkTileDirtyByTile(*ti);
|
||||
}
|
||||
}
|
||||
}
|
||||
return total_cost;
|
||||
}
|
||||
|
||||
|
||||
/** Levels a selected (rectangle) area of land
|
||||
* @param tile end tile of area-drag
|
||||
* @param flags for this command type
|
||||
* @param p1 start tile of area drag
|
||||
* @param p2 unused
|
||||
* @return error or cost of terraforming
|
||||
*/
|
||||
CommandCost CmdLevelLand(TileIndex tile, uint32 flags, uint32 p1, uint32 p2)
|
||||
{
|
||||
int size_x, size_y;
|
||||
int ex;
|
||||
int ey;
|
||||
int sx, sy;
|
||||
uint h, curh;
|
||||
CommandCost money;
|
||||
CommandCost ret;
|
||||
CommandCost cost;
|
||||
|
||||
if (p1 >= MapSize()) return CMD_ERROR;
|
||||
|
||||
SET_EXPENSES_TYPE(EXPENSES_CONSTRUCTION);
|
||||
|
||||
/* remember level height */
|
||||
h = TileHeight(p1);
|
||||
|
||||
/* make sure sx,sy are smaller than ex,ey */
|
||||
ex = TileX(tile);
|
||||
ey = TileY(tile);
|
||||
sx = TileX(p1);
|
||||
sy = TileY(p1);
|
||||
if (ex < sx) Swap(ex, sx);
|
||||
if (ey < sy) Swap(ey, sy);
|
||||
tile = TileXY(sx, sy);
|
||||
|
||||
size_x = ex - sx + 1;
|
||||
size_y = ey - sy + 1;
|
||||
|
||||
money.AddCost(GetAvailableMoneyForCommand());
|
||||
|
||||
BEGIN_TILE_LOOP(tile2, size_x, size_y, tile) {
|
||||
curh = TileHeight(tile2);
|
||||
while (curh != h) {
|
||||
ret = DoCommand(tile2, SLOPE_N, (curh > h) ? 0 : 1, flags & ~DC_EXEC, CMD_TERRAFORM_LAND);
|
||||
if (CmdFailed(ret)) break;
|
||||
|
||||
if (flags & DC_EXEC) {
|
||||
money.AddCost(-ret.GetCost());
|
||||
if (money.GetCost() < 0) {
|
||||
_additional_cash_required = ret.GetCost();
|
||||
return cost;
|
||||
}
|
||||
DoCommand(tile2, SLOPE_N, (curh > h) ? 0 : 1, flags, CMD_TERRAFORM_LAND);
|
||||
}
|
||||
|
||||
cost.AddCost(ret);
|
||||
curh += (curh > h) ? -1 : 1;
|
||||
}
|
||||
} END_TILE_LOOP(tile2, size_x, size_y, tile)
|
||||
|
||||
return (cost.GetCost() == 0) ? CMD_ERROR : cost;
|
||||
}
|
||||
|
||||
/** Purchase a land area. Actually you only purchase one tile, so
|
||||
* the name is a bit confusing ;p
|
||||
* @param tile the tile the player is purchasing
|
||||
* @param flags for this command type
|
||||
* @param p1 unused
|
||||
* @param p2 unused
|
||||
* @return error of cost of operation
|
||||
*/
|
||||
CommandCost CmdPurchaseLandArea(TileIndex tile, uint32 flags, uint32 p1, uint32 p2)
|
||||
{
|
||||
CommandCost cost;
|
||||
|
||||
SET_EXPENSES_TYPE(EXPENSES_CONSTRUCTION);
|
||||
|
||||
if (IsOwnedLandTile(tile) && IsTileOwner(tile, _current_player)) {
|
||||
return_cmd_error(STR_5807_YOU_ALREADY_OWN_IT);
|
||||
}
|
||||
|
||||
cost = DoCommand(tile, 0, 0, flags, CMD_LANDSCAPE_CLEAR);
|
||||
if (CmdFailed(cost)) return CMD_ERROR;
|
||||
|
||||
if (flags & DC_EXEC) {
|
||||
MakeOwnedLand(tile, _current_player);
|
||||
MarkTileDirtyByTile(tile);
|
||||
}
|
||||
|
||||
return cost.AddCost(_price.clear_roughland * 10);
|
||||
}
|
||||
|
||||
#include "tile_cmd.h"
|
||||
#include "functions.h"
|
||||
#include "economy_func.h"
|
||||
#include "viewport_func.h"
|
||||
#include "settings_type.h"
|
||||
|
||||
#include "table/strings.h"
|
||||
#include "table/sprites.h"
|
||||
#include "table/clear_land.h"
|
||||
|
||||
static CommandCost ClearTile_Clear(TileIndex tile, byte flags)
|
||||
{
|
||||
@@ -452,7 +33,7 @@ static CommandCost ClearTile_Clear(TileIndex tile, byte flags)
|
||||
&_price.clear_roughland,
|
||||
&_price.clear_roughland,
|
||||
};
|
||||
CommandCost price;
|
||||
CommandCost price(EXPENSES_CONSTRUCTION);
|
||||
|
||||
if (!IsClearGround(tile, CLEAR_GRASS) || GetClearDensity(tile) != 0) {
|
||||
price.AddCost(*clear_price_table[GetClearGround(tile)]);
|
||||
@@ -463,33 +44,6 @@ static CommandCost ClearTile_Clear(TileIndex tile, byte flags)
|
||||
return price;
|
||||
}
|
||||
|
||||
/** Sell a land area. Actually you only sell one tile, so
|
||||
* the name is a bit confusing ;p
|
||||
* @param tile the tile the player is selling
|
||||
* @param flags for this command type
|
||||
* @param p1 unused
|
||||
* @param p2 unused
|
||||
* @return error or cost of operation
|
||||
*/
|
||||
CommandCost CmdSellLandArea(TileIndex tile, uint32 flags, uint32 p1, uint32 p2)
|
||||
{
|
||||
SET_EXPENSES_TYPE(EXPENSES_CONSTRUCTION);
|
||||
|
||||
if (!IsOwnedLandTile(tile)) return CMD_ERROR;
|
||||
if (!CheckTileOwnership(tile) && _current_player != OWNER_WATER) return CMD_ERROR;
|
||||
|
||||
|
||||
if (!EnsureNoVehicleOnGround(tile)) return CMD_ERROR;
|
||||
|
||||
if (flags & DC_EXEC) DoClearSquare(tile);
|
||||
|
||||
return CommandCost(- _price.clear_roughland * 2);
|
||||
}
|
||||
|
||||
|
||||
#include "table/clear_land.h"
|
||||
|
||||
|
||||
void DrawClearLandTile(const TileInfo *ti, byte set)
|
||||
{
|
||||
DrawGroundSprite(SPR_FLAT_BARE_LAND + _tileh_to_sprite[ti->tileh] + set * 19, PAL_NONE);
|
||||
@@ -761,7 +315,7 @@ static void ClickTile_Clear(TileIndex tile)
|
||||
/* not used */
|
||||
}
|
||||
|
||||
static uint32 GetTileTrackStatus_Clear(TileIndex tile, TransportType mode, uint sub_mode)
|
||||
static TrackStatus GetTileTrackStatus_Clear(TileIndex tile, TransportType mode, uint sub_mode, DiagDirection side)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
@@ -5,9 +5,8 @@
|
||||
#ifndef CLEAR_MAP_H
|
||||
#define CLEAR_MAP_H
|
||||
|
||||
#include "macros.h"
|
||||
#include "tile.h"
|
||||
#include "bridge_map.h"
|
||||
#include "industry_type.h"
|
||||
|
||||
/**
|
||||
* Ground types. Valid densities in comments after the enum.
|
||||
|
@@ -3,13 +3,12 @@
|
||||
#ifndef CMD_HELPER_H
|
||||
#define CMD_HELPER_H
|
||||
|
||||
#include "direction.h"
|
||||
#include "macros.h"
|
||||
#include "road.h"
|
||||
#include "direction_type.h"
|
||||
#include "road_type.h"
|
||||
|
||||
|
||||
template<uint N> static inline void ExtractValid();
|
||||
template<> static inline void ExtractValid<1>() {}
|
||||
template<> inline void ExtractValid<1>() {}
|
||||
|
||||
|
||||
template<typename T> struct ExtractBits;
|
||||
|
305
src/command.cpp
305
src/command.cpp
@@ -4,20 +4,28 @@
|
||||
|
||||
#include "stdafx.h"
|
||||
#include "openttd.h"
|
||||
#include "table/strings.h"
|
||||
#include "strings.h"
|
||||
#include "functions.h"
|
||||
#include "landscape.h"
|
||||
#include "map.h"
|
||||
#include "tile_map.h"
|
||||
#include "gui.h"
|
||||
#include "command.h"
|
||||
#include "player.h"
|
||||
#include "command_func.h"
|
||||
#include "network/network.h"
|
||||
#include "variables.h"
|
||||
#include "genworld.h"
|
||||
#include "newgrf_storage.h"
|
||||
#include "strings_func.h"
|
||||
#include "gfx_func.h"
|
||||
#include "functions.h"
|
||||
#include "town.h"
|
||||
#include "date_func.h"
|
||||
#include "debug.h"
|
||||
#include "player_func.h"
|
||||
#include "player_base.h"
|
||||
#include "signal_func.h"
|
||||
|
||||
#include "table/strings.h"
|
||||
|
||||
const char *_cmd_text = NULL;
|
||||
StringID _error_message;
|
||||
|
||||
/**
|
||||
* Helper macro to define the header of all command handler macros.
|
||||
@@ -201,160 +209,145 @@ DEF_COMMAND(CmdAutofillTimetable);
|
||||
* as the value from the CMD_* enums.
|
||||
*/
|
||||
static const Command _command_proc_table[] = {
|
||||
{CmdBuildRailroadTrack, CMD_AUTO}, /* 0, CMD_BUILD_RAILROAD_TRACK */
|
||||
{CmdRemoveRailroadTrack, CMD_AUTO}, /* 1, CMD_REMOVE_RAILROAD_TRACK */
|
||||
{CmdBuildSingleRail, CMD_AUTO}, /* 2, CMD_BUILD_SINGLE_RAIL */
|
||||
{CmdRemoveSingleRail, CMD_AUTO}, /* 3, CMD_REMOVE_SINGLE_RAIL */
|
||||
{CmdLandscapeClear, 0}, /* 4, CMD_LANDSCAPE_CLEAR */
|
||||
{CmdBuildBridge, CMD_AUTO}, /* 5, CMD_BUILD_BRIDGE */
|
||||
{CmdBuildRailroadStation, CMD_AUTO}, /* 6, CMD_BUILD_RAILROAD_STATION */
|
||||
{CmdBuildTrainDepot, CMD_AUTO}, /* 7, CMD_BUILD_TRAIN_DEPOT */
|
||||
{CmdBuildSingleSignal, CMD_AUTO}, /* 8, CMD_BUILD_SIGNALS */
|
||||
{CmdRemoveSingleSignal, CMD_AUTO}, /* 9, CMD_REMOVE_SIGNALS */
|
||||
{CmdTerraformLand, CMD_AUTO}, /* 10, CMD_TERRAFORM_LAND */
|
||||
{CmdPurchaseLandArea, CMD_AUTO}, /* 11, CMD_PURCHASE_LAND_AREA */
|
||||
{CmdSellLandArea, 0}, /* 12, CMD_SELL_LAND_AREA */
|
||||
{CmdBuildTunnel, CMD_AUTO}, /* 13, CMD_BUILD_TUNNEL */
|
||||
{CmdRemoveFromRailroadStation, 0}, /* 14, CMD_REMOVE_FROM_RAILROAD_STATION */
|
||||
{CmdConvertRail, 0}, /* 15, CMD_CONVERT_RAILD */
|
||||
{CmdBuildTrainWaypoint, 0}, /* 16, CMD_BUILD_TRAIN_WAYPOINT */
|
||||
{CmdRenameWaypoint, 0}, /* 17, CMD_RENAME_WAYPOINT */
|
||||
{CmdRemoveTrainWaypoint, 0}, /* 18, CMD_REMOVE_TRAIN_WAYPOINT */
|
||||
{NULL, 0}, /* 19, unused */
|
||||
{NULL, 0}, /* 20, unused */
|
||||
{CmdBuildRoadStop, CMD_AUTO}, /* 21, CMD_BUILD_ROAD_STOP */
|
||||
{CmdRemoveRoadStop, 0}, /* 22, CMD_REMOVE_ROAD_STOP */
|
||||
{CmdBuildLongRoad, CMD_AUTO}, /* 23, CMD_BUILD_LONG_ROAD */
|
||||
{CmdRemoveLongRoad, CMD_AUTO}, /* 24, CMD_REMOVE_LONG_ROAD */
|
||||
{CmdBuildRoad, 0}, /* 25, CMD_BUILD_ROAD */
|
||||
{CmdRemoveRoad, 0}, /* 26, CMD_REMOVE_ROAD */
|
||||
{CmdBuildRoadDepot, CMD_AUTO}, /* 27, CMD_BUILD_ROAD_DEPOT */
|
||||
{NULL, 0}, /* 28, unused */
|
||||
{CmdBuildAirport, CMD_AUTO}, /* 29, CMD_BUILD_AIRPORT */
|
||||
{CmdBuildDock, CMD_AUTO}, /* 30, CMD_BUILD_DOCK */
|
||||
{CmdBuildShipDepot, CMD_AUTO}, /* 31, CMD_BUILD_SHIP_DEPOT */
|
||||
{CmdBuildBuoy, CMD_AUTO}, /* 32, CMD_BUILD_BUOY */
|
||||
{CmdPlantTree, CMD_AUTO}, /* 33, CMD_PLANT_TREE */
|
||||
{CmdBuildRailVehicle, 0}, /* 34, CMD_BUILD_RAIL_VEHICLE */
|
||||
{CmdMoveRailVehicle, 0}, /* 35, CMD_MOVE_RAIL_VEHICLE */
|
||||
{CmdStartStopTrain, 0}, /* 36, CMD_START_STOP_TRAIN */
|
||||
{NULL, 0}, /* 37, unused */
|
||||
{CmdSellRailWagon, 0}, /* 38, CMD_SELL_RAIL_WAGON */
|
||||
{CmdSendTrainToDepot, 0}, /* 39, CMD_SEND_TRAIN_TO_DEPOT */
|
||||
{CmdForceTrainProceed, 0}, /* 40, CMD_FORCE_TRAIN_PROCEED */
|
||||
{CmdReverseTrainDirection, 0}, /* 41, CMD_REVERSE_TRAIN_DIRECTION */
|
||||
{CmdBuildRailroadTrack, CMD_AUTO}, /* CMD_BUILD_RAILROAD_TRACK */
|
||||
{CmdRemoveRailroadTrack, CMD_AUTO}, /* CMD_REMOVE_RAILROAD_TRACK */
|
||||
{CmdBuildSingleRail, CMD_AUTO}, /* CMD_BUILD_SINGLE_RAIL */
|
||||
{CmdRemoveSingleRail, CMD_AUTO}, /* CMD_REMOVE_SINGLE_RAIL */
|
||||
{CmdLandscapeClear, 0}, /* CMD_LANDSCAPE_CLEAR */
|
||||
{CmdBuildBridge, CMD_AUTO}, /* CMD_BUILD_BRIDGE */
|
||||
{CmdBuildRailroadStation, CMD_AUTO}, /* CMD_BUILD_RAILROAD_STATION */
|
||||
{CmdBuildTrainDepot, CMD_AUTO}, /* CMD_BUILD_TRAIN_DEPOT */
|
||||
{CmdBuildSingleSignal, CMD_AUTO}, /* CMD_BUILD_SIGNALS */
|
||||
{CmdRemoveSingleSignal, CMD_AUTO}, /* CMD_REMOVE_SIGNALS */
|
||||
{CmdTerraformLand, CMD_AUTO}, /* CMD_TERRAFORM_LAND */
|
||||
{CmdPurchaseLandArea, CMD_AUTO}, /* CMD_PURCHASE_LAND_AREA */
|
||||
{CmdSellLandArea, 0}, /* CMD_SELL_LAND_AREA */
|
||||
{CmdBuildTunnel, CMD_AUTO}, /* CMD_BUILD_TUNNEL */
|
||||
{CmdRemoveFromRailroadStation, 0}, /* CMD_REMOVE_FROM_RAILROAD_STATION */
|
||||
{CmdConvertRail, 0}, /* CMD_CONVERT_RAILD */
|
||||
{CmdBuildTrainWaypoint, 0}, /* CMD_BUILD_TRAIN_WAYPOINT */
|
||||
{CmdRenameWaypoint, 0}, /* CMD_RENAME_WAYPOINT */
|
||||
{CmdRemoveTrainWaypoint, 0}, /* CMD_REMOVE_TRAIN_WAYPOINT */
|
||||
|
||||
{CmdModifyOrder, 0}, /* 42, CMD_MODIFY_ORDER */
|
||||
{CmdSkipToOrder, 0}, /* 43, CMD_SKIP_TO_ORDER */
|
||||
{CmdDeleteOrder, 0}, /* 44, CMD_DELETE_ORDER */
|
||||
{CmdInsertOrder, 0}, /* 45, CMD_INSERT_ORDER */
|
||||
{CmdBuildRoadStop, CMD_AUTO}, /* CMD_BUILD_ROAD_STOP */
|
||||
{CmdRemoveRoadStop, 0}, /* CMD_REMOVE_ROAD_STOP */
|
||||
{CmdBuildLongRoad, CMD_AUTO}, /* CMD_BUILD_LONG_ROAD */
|
||||
{CmdRemoveLongRoad, CMD_AUTO}, /* CMD_REMOVE_LONG_ROAD */
|
||||
{CmdBuildRoad, 0}, /* CMD_BUILD_ROAD */
|
||||
{CmdRemoveRoad, 0}, /* CMD_REMOVE_ROAD */
|
||||
{CmdBuildRoadDepot, CMD_AUTO}, /* CMD_BUILD_ROAD_DEPOT */
|
||||
|
||||
{CmdChangeServiceInt, 0}, /* 46, CMD_CHANGE_SERVICE_INT */
|
||||
{CmdBuildAirport, CMD_AUTO}, /* CMD_BUILD_AIRPORT */
|
||||
{CmdBuildDock, CMD_AUTO}, /* CMD_BUILD_DOCK */
|
||||
{CmdBuildShipDepot, CMD_AUTO}, /* CMD_BUILD_SHIP_DEPOT */
|
||||
{CmdBuildBuoy, CMD_AUTO}, /* CMD_BUILD_BUOY */
|
||||
{CmdPlantTree, CMD_AUTO}, /* CMD_PLANT_TREE */
|
||||
{CmdBuildRailVehicle, 0}, /* CMD_BUILD_RAIL_VEHICLE */
|
||||
{CmdMoveRailVehicle, 0}, /* CMD_MOVE_RAIL_VEHICLE */
|
||||
{CmdStartStopTrain, 0}, /* CMD_START_STOP_TRAIN */
|
||||
|
||||
{CmdBuildIndustry, 0}, /* 47, CMD_BUILD_INDUSTRY */
|
||||
{CmdBuildCompanyHQ, CMD_AUTO}, /* 48, CMD_BUILD_COMPANY_HQ */
|
||||
{CmdSetPlayerFace, 0}, /* 49, CMD_SET_PLAYER_FACE */
|
||||
{CmdSetPlayerColor, 0}, /* 50, CMD_SET_PLAYER_COLOR */
|
||||
{CmdSellRailWagon, 0}, /* CMD_SELL_RAIL_WAGON */
|
||||
{CmdSendTrainToDepot, 0}, /* CMD_SEND_TRAIN_TO_DEPOT */
|
||||
{CmdForceTrainProceed, 0}, /* CMD_FORCE_TRAIN_PROCEED */
|
||||
{CmdReverseTrainDirection, 0}, /* CMD_REVERSE_TRAIN_DIRECTION */
|
||||
|
||||
{CmdIncreaseLoan, 0}, /* 51, CMD_INCREASE_LOAN */
|
||||
{CmdDecreaseLoan, 0}, /* 52, CMD_DECREASE_LOAN */
|
||||
{CmdModifyOrder, 0}, /* CMD_MODIFY_ORDER */
|
||||
{CmdSkipToOrder, 0}, /* CMD_SKIP_TO_ORDER */
|
||||
{CmdDeleteOrder, 0}, /* CMD_DELETE_ORDER */
|
||||
{CmdInsertOrder, 0}, /* CMD_INSERT_ORDER */
|
||||
|
||||
{CmdWantEnginePreview, 0}, /* 53, CMD_WANT_ENGINE_PREVIEW */
|
||||
{CmdChangeServiceInt, 0}, /* CMD_CHANGE_SERVICE_INT */
|
||||
|
||||
{CmdNameVehicle, 0}, /* 54, CMD_NAME_VEHICLE */
|
||||
{CmdRenameEngine, 0}, /* 55, CMD_RENAME_ENGINE */
|
||||
{CmdBuildIndustry, 0}, /* CMD_BUILD_INDUSTRY */
|
||||
{CmdBuildCompanyHQ, CMD_AUTO}, /* CMD_BUILD_COMPANY_HQ */
|
||||
{CmdSetPlayerFace, 0}, /* CMD_SET_PLAYER_FACE */
|
||||
{CmdSetPlayerColor, 0}, /* CMD_SET_PLAYER_COLOR */
|
||||
|
||||
{CmdChangeCompanyName, 0}, /* 56, CMD_CHANGE_COMPANY_NAME */
|
||||
{CmdChangePresidentName, 0}, /* 57, CMD_CHANGE_PRESIDENT_NAME */
|
||||
{CmdIncreaseLoan, 0}, /* CMD_INCREASE_LOAN */
|
||||
{CmdDecreaseLoan, 0}, /* CMD_DECREASE_LOAN */
|
||||
|
||||
{CmdRenameStation, 0}, /* 58, CMD_RENAME_STATION */
|
||||
{CmdWantEnginePreview, 0}, /* CMD_WANT_ENGINE_PREVIEW */
|
||||
|
||||
{CmdSellAircraft, 0}, /* 59, CMD_SELL_AIRCRAFT */
|
||||
{CmdStartStopAircraft, 0}, /* 60, CMD_START_STOP_AIRCRAFT */
|
||||
{CmdNameVehicle, 0}, /* CMD_NAME_VEHICLE */
|
||||
{CmdRenameEngine, 0}, /* CMD_RENAME_ENGINE */
|
||||
|
||||
{CmdBuildAircraft, 0}, /* 61, CMD_BUILD_AIRCRAFT */
|
||||
{CmdSendAircraftToHangar, 0}, /* 62, CMD_SEND_AIRCRAFT_TO_HANGAR */
|
||||
{NULL, 0}, /* 63, unused */
|
||||
{CmdRefitAircraft, 0}, /* 64, CMD_REFIT_AIRCRAFT */
|
||||
{CmdChangeCompanyName, 0}, /* CMD_CHANGE_COMPANY_NAME */
|
||||
{CmdChangePresidentName, 0}, /* CMD_CHANGE_PRESIDENT_NAME */
|
||||
|
||||
{CmdPlaceSign, 0}, /* 65, CMD_PLACE_SIGN */
|
||||
{CmdRenameSign, 0}, /* 66, CMD_RENAME_SIGN */
|
||||
{CmdRenameStation, 0}, /* CMD_RENAME_STATION */
|
||||
|
||||
{CmdBuildRoadVeh, 0}, /* 67, CMD_BUILD_ROAD_VEH */
|
||||
{CmdStartStopRoadVeh, 0}, /* 68, CMD_START_STOP_ROADVEH */
|
||||
{CmdSellRoadVeh, 0}, /* 69, CMD_SELL_ROAD_VEH */
|
||||
{CmdSendRoadVehToDepot, 0}, /* 70, CMD_SEND_ROADVEH_TO_DEPOT */
|
||||
{CmdTurnRoadVeh, 0}, /* 71, CMD_TURN_ROADVEH */
|
||||
{CmdRefitRoadVeh, 0}, /* 72, CMD_REFIT_ROAD_VEH */
|
||||
{CmdSellAircraft, 0}, /* CMD_SELL_AIRCRAFT */
|
||||
{CmdStartStopAircraft, 0}, /* CMD_START_STOP_AIRCRAFT */
|
||||
|
||||
{CmdPause, CMD_SERVER}, /* 73, CMD_PAUSE */
|
||||
{CmdBuildAircraft, 0}, /* CMD_BUILD_AIRCRAFT */
|
||||
{CmdSendAircraftToHangar, 0}, /* CMD_SEND_AIRCRAFT_TO_HANGAR */
|
||||
{CmdRefitAircraft, 0}, /* CMD_REFIT_AIRCRAFT */
|
||||
|
||||
{CmdBuyShareInCompany, 0}, /* 74, CMD_BUY_SHARE_IN_COMPANY */
|
||||
{CmdSellShareInCompany, 0}, /* 75, CMD_SELL_SHARE_IN_COMPANY */
|
||||
{CmdBuyCompany, 0}, /* 76, CMD_BUY_COMANY */
|
||||
{CmdPlaceSign, 0}, /* CMD_PLACE_SIGN */
|
||||
{CmdRenameSign, 0}, /* CMD_RENAME_SIGN */
|
||||
|
||||
{CmdBuildTown, CMD_OFFLINE}, /* 77, CMD_BUILD_TOWN */
|
||||
{NULL, 0}, /* 78, unused */
|
||||
{NULL, 0}, /* 79, unused */
|
||||
{CmdRenameTown, CMD_SERVER}, /* 80, CMD_RENAME_TOWN */
|
||||
{CmdDoTownAction, 0}, /* 81, CMD_DO_TOWN_ACTION */
|
||||
{CmdBuildRoadVeh, 0}, /* CMD_BUILD_ROAD_VEH */
|
||||
{CmdStartStopRoadVeh, 0}, /* CMD_START_STOP_ROADVEH */
|
||||
{CmdSellRoadVeh, 0}, /* CMD_SELL_ROAD_VEH */
|
||||
{CmdSendRoadVehToDepot, 0}, /* CMD_SEND_ROADVEH_TO_DEPOT */
|
||||
{CmdTurnRoadVeh, 0}, /* CMD_TURN_ROADVEH */
|
||||
{CmdRefitRoadVeh, 0}, /* CMD_REFIT_ROAD_VEH */
|
||||
|
||||
{CmdSetRoadDriveSide, CMD_SERVER}, /* 82, CMD_SET_ROAD_DRIVE_SIDE */
|
||||
{NULL, 0}, /* 83, unused */
|
||||
{NULL, 0}, /* 84, unused */
|
||||
{CmdChangeDifficultyLevel, CMD_SERVER}, /* 85, CMD_CHANGE_DIFFICULTY_LEVEL */
|
||||
{CmdPause, CMD_SERVER}, /* CMD_PAUSE */
|
||||
|
||||
{CmdStartStopShip, 0}, /* 86, CMD_START_STOP_SHIP */
|
||||
{CmdSellShip, 0}, /* 87, CMD_SELL_SHIP */
|
||||
{CmdBuildShip, 0}, /* 88, CMD_BUILD_SHIP */
|
||||
{CmdSendShipToDepot, 0}, /* 89, CMD_SEND_SHIP_TO_DEPOT */
|
||||
{NULL, 0}, /* 90, unused */
|
||||
{CmdRefitShip, 0}, /* 91, CMD_REFIT_SHIP */
|
||||
{CmdBuyShareInCompany, 0}, /* CMD_BUY_SHARE_IN_COMPANY */
|
||||
{CmdSellShareInCompany, 0}, /* CMD_SELL_SHARE_IN_COMPANY */
|
||||
{CmdBuyCompany, 0}, /* CMD_BUY_COMANY */
|
||||
|
||||
{NULL, 0}, /* 92, unused */
|
||||
{NULL, 0}, /* 93, unused */
|
||||
{NULL, 0}, /* 94, unused */
|
||||
{NULL, 0}, /* 95, unused */
|
||||
{NULL, 0}, /* 96, unused */
|
||||
{NULL, 0}, /* 97, unused */
|
||||
{CmdBuildTown, CMD_OFFLINE}, /* CMD_BUILD_TOWN */
|
||||
{CmdRenameTown, CMD_SERVER}, /* CMD_RENAME_TOWN */
|
||||
{CmdDoTownAction, 0}, /* CMD_DO_TOWN_ACTION */
|
||||
|
||||
{CmdOrderRefit, 0}, /* 98, CMD_ORDER_REFIT */
|
||||
{CmdCloneOrder, 0}, /* 99, CMD_CLONE_ORDER */
|
||||
{CmdSetRoadDriveSide, CMD_SERVER}, /* CMD_SET_ROAD_DRIVE_SIDE */
|
||||
{CmdChangeDifficultyLevel, CMD_SERVER}, /* CMD_CHANGE_DIFFICULTY_LEVEL */
|
||||
|
||||
{CmdClearArea, 0}, /* 100, CMD_CLEAR_AREA */
|
||||
{NULL, 0}, /* 101, unused */
|
||||
{CmdStartStopShip, 0}, /* CMD_START_STOP_SHIP */
|
||||
{CmdSellShip, 0}, /* CMD_SELL_SHIP */
|
||||
{CmdBuildShip, 0}, /* CMD_BUILD_SHIP */
|
||||
{CmdSendShipToDepot, 0}, /* CMD_SEND_SHIP_TO_DEPOT */
|
||||
{CmdRefitShip, 0}, /* CMD_REFIT_SHIP */
|
||||
|
||||
{CmdMoneyCheat, CMD_OFFLINE}, /* 102, CMD_MONEY_CHEAT */
|
||||
{CmdBuildCanal, CMD_AUTO}, /* 103, CMD_BUILD_CANAL */
|
||||
{CmdPlayerCtrl, 0}, /* 104, CMD_PLAYER_CTRL */
|
||||
{CmdOrderRefit, 0}, /* CMD_ORDER_REFIT */
|
||||
{CmdCloneOrder, 0}, /* CMD_CLONE_ORDER */
|
||||
|
||||
{CmdLevelLand, CMD_AUTO}, /* 105, CMD_LEVEL_LAND */
|
||||
{CmdClearArea, 0}, /* CMD_CLEAR_AREA */
|
||||
|
||||
{CmdRefitRailVehicle, 0}, /* 106, CMD_REFIT_RAIL_VEHICLE */
|
||||
{CmdRestoreOrderIndex, 0}, /* 107, CMD_RESTORE_ORDER_INDEX */
|
||||
{CmdBuildLock, CMD_AUTO}, /* 108, CMD_BUILD_LOCK */
|
||||
{NULL, 0}, /* 109, unused */
|
||||
{CmdBuildSignalTrack, CMD_AUTO}, /* 110, CMD_BUILD_SIGNAL_TRACK */
|
||||
{CmdRemoveSignalTrack, CMD_AUTO}, /* 111, CMD_REMOVE_SIGNAL_TRACK */
|
||||
{NULL, 0}, /* 112, unused */
|
||||
{CmdGiveMoney, 0}, /* 113, CMD_GIVE_MONEY */
|
||||
{CmdChangePatchSetting, CMD_SERVER}, /* 114, CMD_CHANGE_PATCH_SETTING */
|
||||
{CmdSetAutoReplace, 0}, /* 115, CMD_SET_AUTOREPLACE */
|
||||
{CmdCloneVehicle, 0}, /* 116, CMD_CLONE_VEHICLE */
|
||||
{CmdMassStartStopVehicle, 0}, /* 117, CMD_MASS_START_STOP */
|
||||
{CmdDepotSellAllVehicles, 0}, /* 118, CMD_DEPOT_SELL_ALL_VEHICLES */
|
||||
{CmdDepotMassAutoReplace, 0}, /* 119, CMD_DEPOT_MASS_AUTOREPLACE */
|
||||
{CmdCreateGroup, 0}, /* 120, CMD_CREATE_GROUP */
|
||||
{CmdDeleteGroup, 0}, /* 121, CMD_DELETE_GROUP */
|
||||
{CmdRenameGroup, 0}, /* 122, CMD_RENAME_GROUP */
|
||||
{CmdAddVehicleGroup, 0}, /* 123, CMD_ADD_VEHICLE_GROUP */
|
||||
{CmdAddSharedVehicleGroup, 0}, /* 124, CMD_ADD_SHARE_VEHICLE_GROUP */
|
||||
{CmdRemoveAllVehiclesGroup, 0}, /* 125, CMD_REMOVE_ALL_VEHICLES_GROUP */
|
||||
{CmdSetGroupReplaceProtection, 0}, /* 126, CMD_SET_GROUP_REPLACE_PROTECTION */
|
||||
{CmdMoveOrder, 0}, /* 127, CMD_MOVE_ORDER */
|
||||
{CmdChangeTimetable, 0}, /* 128, CMD_CHANGE_TIMETABLE */
|
||||
{CmdSetVehicleOnTime, 0}, /* 129, CMD_SET_VEHICLE_ON_TIME */
|
||||
{CmdAutofillTimetable, 0}, /* 130, CMD_AUTOFILL_TIMETABLE */
|
||||
{CmdMoneyCheat, CMD_OFFLINE}, /* CMD_MONEY_CHEAT */
|
||||
{CmdBuildCanal, CMD_AUTO}, /* CMD_BUILD_CANAL */
|
||||
{CmdPlayerCtrl, 0}, /* CMD_PLAYER_CTRL */
|
||||
|
||||
{CmdLevelLand, CMD_AUTO}, /* CMD_LEVEL_LAND */
|
||||
|
||||
{CmdRefitRailVehicle, 0}, /* CMD_REFIT_RAIL_VEHICLE */
|
||||
{CmdRestoreOrderIndex, 0}, /* CMD_RESTORE_ORDER_INDEX */
|
||||
{CmdBuildLock, CMD_AUTO}, /* CMD_BUILD_LOCK */
|
||||
|
||||
{CmdBuildSignalTrack, CMD_AUTO}, /* CMD_BUILD_SIGNAL_TRACK */
|
||||
{CmdRemoveSignalTrack, CMD_AUTO}, /* CMD_REMOVE_SIGNAL_TRACK */
|
||||
|
||||
{CmdGiveMoney, 0}, /* CMD_GIVE_MONEY */
|
||||
{CmdChangePatchSetting, CMD_SERVER}, /* CMD_CHANGE_PATCH_SETTING */
|
||||
{CmdSetAutoReplace, 0}, /* CMD_SET_AUTOREPLACE */
|
||||
{CmdCloneVehicle, 0}, /* CMD_CLONE_VEHICLE */
|
||||
{CmdMassStartStopVehicle, 0}, /* CMD_MASS_START_STOP */
|
||||
{CmdDepotSellAllVehicles, 0}, /* CMD_DEPOT_SELL_ALL_VEHICLES */
|
||||
{CmdDepotMassAutoReplace, 0}, /* CMD_DEPOT_MASS_AUTOREPLACE */
|
||||
{CmdCreateGroup, 0}, /* CMD_CREATE_GROUP */
|
||||
{CmdDeleteGroup, 0}, /* CMD_DELETE_GROUP */
|
||||
{CmdRenameGroup, 0}, /* CMD_RENAME_GROUP */
|
||||
{CmdAddVehicleGroup, 0}, /* CMD_ADD_VEHICLE_GROUP */
|
||||
{CmdAddSharedVehicleGroup, 0}, /* CMD_ADD_SHARE_VEHICLE_GROUP */
|
||||
{CmdRemoveAllVehiclesGroup, 0}, /* CMD_REMOVE_ALL_VEHICLES_GROUP */
|
||||
{CmdSetGroupReplaceProtection, 0}, /* CMD_SET_GROUP_REPLACE_PROTECTION */
|
||||
{CmdMoveOrder, 0}, /* CMD_MOVE_ORDER */
|
||||
{CmdChangeTimetable, 0}, /* CMD_CHANGE_TIMETABLE */
|
||||
{CmdSetVehicleOnTime, 0}, /* CMD_SET_VEHICLE_ON_TIME */
|
||||
{CmdAutofillTimetable, 0}, /* CMD_AUTOFILL_TIMETABLE */
|
||||
};
|
||||
|
||||
/*!
|
||||
@@ -387,7 +380,7 @@ byte GetCommandFlags(uint cmd)
|
||||
return _command_proc_table[cmd & 0xFF].flags;
|
||||
}
|
||||
|
||||
static int _docommand_recursive;
|
||||
static int _docommand_recursive = 0;
|
||||
|
||||
/*!
|
||||
* This function executes a given command with the parameters from the #CommandProc parameter list.
|
||||
@@ -400,13 +393,13 @@ static int _docommand_recursive;
|
||||
* @param procc The command-id to execute (a value of the CMD_* enums)
|
||||
* @see CommandProc
|
||||
*/
|
||||
CommandCost DoCommand(TileIndex tile, uint32 p1, uint32 p2, uint32 flags, uint procc)
|
||||
CommandCost DoCommand(TileIndex tile, uint32 p1, uint32 p2, uint32 flags, uint32 procc)
|
||||
{
|
||||
CommandCost res;
|
||||
CommandProc *proc;
|
||||
|
||||
/* Do not even think about executing out-of-bounds tile-commands */
|
||||
if (tile >= MapSize() || IsTileType(tile, MP_VOID)) {
|
||||
if (!IsValidTile(tile)) {
|
||||
_cmd_text = NULL;
|
||||
return CMD_ERROR;
|
||||
}
|
||||
@@ -418,8 +411,10 @@ CommandCost DoCommand(TileIndex tile, uint32 p1, uint32 p2, uint32 flags, uint p
|
||||
_docommand_recursive++;
|
||||
|
||||
/* only execute the test call if it's toplevel, or we're not execing. */
|
||||
if (_docommand_recursive == 1 || !(flags & DC_EXEC) || (flags & DC_FORCETEST) ) {
|
||||
if (_docommand_recursive == 1 || !(flags & DC_EXEC) ) {
|
||||
SetTownRatingTestMode(true);
|
||||
res = proc(tile, flags & ~DC_EXEC, p1, p2);
|
||||
SetTownRatingTestMode(false);
|
||||
if (CmdFailed(res)) {
|
||||
res.SetGlobalErrorMessage();
|
||||
goto error;
|
||||
@@ -427,6 +422,7 @@ CommandCost DoCommand(TileIndex tile, uint32 p1, uint32 p2, uint32 flags, uint p
|
||||
|
||||
if (_docommand_recursive == 1 &&
|
||||
!(flags & DC_QUERY_COST) &&
|
||||
!(flags & DC_BANKRUPT) &&
|
||||
res.GetCost() != 0 &&
|
||||
!CheckPlayerHasMoney(res)) {
|
||||
goto error;
|
||||
@@ -440,7 +436,7 @@ CommandCost DoCommand(TileIndex tile, uint32 p1, uint32 p2, uint32 flags, uint p
|
||||
}
|
||||
|
||||
/* Execute the command here. All cost-relevant functions set the expenses type
|
||||
* themselves with "SET_EXPENSES_TYPE(...);" at the beginning of the function */
|
||||
* themselves to the cost object at some point */
|
||||
res = proc(tile, flags, p1, p2);
|
||||
if (CmdFailed(res)) {
|
||||
res.SetGlobalErrorMessage();
|
||||
@@ -451,7 +447,7 @@ error:
|
||||
}
|
||||
|
||||
/* if toplevel, subtract the money. */
|
||||
if (--_docommand_recursive == 0) {
|
||||
if (--_docommand_recursive == 0 && !(flags & DC_BANKRUPT)) {
|
||||
SubtractMoneyFromPlayer(res);
|
||||
/* XXX - Old AI hack which doesn't use DoCommandDP; update last build coord of player */
|
||||
if (tile != 0 && IsValidPlayer(_current_player)) {
|
||||
@@ -503,7 +499,7 @@ bool DoCommandP(TileIndex tile, uint32 p1, uint32 p2, CommandCallback *callback,
|
||||
int y = TileY(tile) * TILE_SIZE;
|
||||
|
||||
/* Do not even think about executing out-of-bounds tile-commands */
|
||||
if (tile >= MapSize() || IsTileType(tile, MP_VOID)) {
|
||||
if (!IsValidTile(tile)) {
|
||||
_cmd_text = NULL;
|
||||
return false;
|
||||
}
|
||||
@@ -539,7 +535,7 @@ bool DoCommandP(TileIndex tile, uint32 p1, uint32 p2, CommandCallback *callback,
|
||||
* e.g.: if you demolish a whole town, the dryrun would say okay.
|
||||
* but by really destroying, your rating drops and at a certain point
|
||||
* it will fail. so res and res2 are different
|
||||
* CMD_REMOVE_ROAD: This command has special local authority
|
||||
* CMD_REMOVE_LONG_ROAD: This command has special local authority
|
||||
* restrictions which may cause the test run to fail (the previous
|
||||
* road fragments still stay there and the town won't let you
|
||||
* disconnect the road system), but the exec will succeed and this
|
||||
@@ -549,9 +545,7 @@ bool DoCommandP(TileIndex tile, uint32 p1, uint32 p2, CommandCallback *callback,
|
||||
* estimate the cost of cloning a vehicle. */
|
||||
notest =
|
||||
(cmd & 0xFF) == CMD_CLEAR_AREA ||
|
||||
(cmd & 0xFF) == CMD_CONVERT_RAIL ||
|
||||
(cmd & 0xFF) == CMD_LEVEL_LAND ||
|
||||
(cmd & 0xFF) == CMD_REMOVE_ROAD ||
|
||||
(cmd & 0xFF) == CMD_REMOVE_LONG_ROAD ||
|
||||
(cmd & 0xFF) == CMD_CLONE_VEHICLE;
|
||||
|
||||
@@ -564,7 +558,9 @@ bool DoCommandP(TileIndex tile, uint32 p1, uint32 p2, CommandCallback *callback,
|
||||
!(cmd & (CMD_NETWORK_COMMAND | CMD_SHOW_NO_ERROR)) &&
|
||||
(cmd & 0xFF) != CMD_PAUSE) {
|
||||
/* estimate the cost. */
|
||||
SetTownRatingTestMode(true);
|
||||
res = proc(tile, flags, p1, p2);
|
||||
SetTownRatingTestMode(false);
|
||||
if (CmdFailed(res)) {
|
||||
res.SetGlobalErrorMessage();
|
||||
ShowErrorMessage(_error_message, error_part1, x, y);
|
||||
@@ -581,7 +577,9 @@ bool DoCommandP(TileIndex tile, uint32 p1, uint32 p2, CommandCallback *callback,
|
||||
|
||||
if (!((cmd & CMD_NO_TEST_IF_IN_NETWORK) && _networking)) {
|
||||
/* first test if the command can be executed. */
|
||||
SetTownRatingTestMode(true);
|
||||
res = proc(tile, flags, p1, p2);
|
||||
SetTownRatingTestMode(false);
|
||||
if (CmdFailed(res)) {
|
||||
res.SetGlobalErrorMessage();
|
||||
goto show_error;
|
||||
@@ -609,9 +607,7 @@ bool DoCommandP(TileIndex tile, uint32 p1, uint32 p2, CommandCallback *callback,
|
||||
return true;
|
||||
}
|
||||
#endif /* ENABLE_NETWORK */
|
||||
#ifdef DEBUG_DUMP_COMMANDS
|
||||
debug_dump_commands("ddc:cmd:%d;%d;%d;%d;%d;%d;%d;%s\n", _date, _date_fract, (int)_current_player, tile, p1, p2, cmd, _cmd_text);
|
||||
#endif /* DUMP_COMMANDS */
|
||||
DebugDumpCommands("ddc:cmd:%d;%d;%d;%d;%d;%d;%d;%s\n", _date, _date_fract, (int)_current_player, tile, p1, p2, cmd, _cmd_text);
|
||||
|
||||
/* update last build coordinate of player. */
|
||||
if (tile != 0 && IsValidPlayer(_current_player)) {
|
||||
@@ -620,7 +616,6 @@ bool DoCommandP(TileIndex tile, uint32 p1, uint32 p2, CommandCallback *callback,
|
||||
|
||||
/* Actually try and execute the command. If no cost-type is given
|
||||
* use the construction one */
|
||||
_yearly_expenses_type = EXPENSES_CONSTRUCTION;
|
||||
res2 = proc(tile, flags | DC_EXEC, p1, p2);
|
||||
|
||||
/* If notest is on, it means the result of the test can be different than
|
||||
@@ -636,6 +631,9 @@ bool DoCommandP(TileIndex tile, uint32 p1, uint32 p2, CommandCallback *callback,
|
||||
|
||||
SubtractMoneyFromPlayer(res2);
|
||||
|
||||
/* update signals if needed */
|
||||
UpdateSignalsInBuffer();
|
||||
|
||||
if (IsLocalPlayer() && _game_mode != GM_EDITOR) {
|
||||
if (res2.GetCost() != 0 && tile != 0) ShowCostOrIncomeAnimation(x, y, GetSlopeZ(x, y), res2.GetCost());
|
||||
if (_additional_cash_required != 0) {
|
||||
@@ -695,6 +693,11 @@ Money CommandCost::GetCost() const
|
||||
return this->cost;
|
||||
}
|
||||
|
||||
ExpensesType CommandCost::GetExpensesType() const
|
||||
{
|
||||
return this->expense_type;
|
||||
}
|
||||
|
||||
void CommandCost::SetGlobalErrorMessage() const
|
||||
{
|
||||
extern StringID _error_message;
|
||||
|
350
src/command.h
350
src/command.h
@@ -1,350 +0,0 @@
|
||||
/* $Id$ */
|
||||
|
||||
/** @file command.h */
|
||||
|
||||
#ifndef COMMAND_H
|
||||
#define COMMAND_H
|
||||
|
||||
/**
|
||||
* List of commands.
|
||||
*
|
||||
* This enum defines all possible commands which can be executed to the game
|
||||
* engine. Observing the game like the query-tool or checking the profit of a
|
||||
* vehicle don't result in a command which should be executed in the engine
|
||||
* nor send to the server in a network game.
|
||||
*
|
||||
* @see _command_proc_table
|
||||
*/
|
||||
enum {
|
||||
CMD_BUILD_RAILROAD_TRACK = 0, ///< build a rail track
|
||||
CMD_REMOVE_RAILROAD_TRACK = 1, ///< remove a rail track
|
||||
CMD_BUILD_SINGLE_RAIL = 2, ///< build a single rail track
|
||||
CMD_REMOVE_SINGLE_RAIL = 3, ///< remove a single rail track
|
||||
CMD_LANDSCAPE_CLEAR = 4, ///< demolish a tile
|
||||
CMD_BUILD_BRIDGE = 5, ///< build a bridge
|
||||
CMD_BUILD_RAILROAD_STATION = 6, ///< build a railroad station
|
||||
CMD_BUILD_TRAIN_DEPOT = 7, ///< build a train depot
|
||||
CMD_BUILD_SIGNALS = 8, ///< build a signal
|
||||
CMD_REMOVE_SIGNALS = 9, ///< remove a signal
|
||||
CMD_TERRAFORM_LAND = 10, ///< terraform a tile
|
||||
CMD_PURCHASE_LAND_AREA = 11, ///< purchase a tile
|
||||
CMD_SELL_LAND_AREA = 12, ///< sell a bought tile before
|
||||
CMD_BUILD_TUNNEL = 13, ///< build a tunnel
|
||||
|
||||
CMD_REMOVE_FROM_RAILROAD_STATION = 14, ///< remove a tile station
|
||||
CMD_CONVERT_RAIL = 15, ///< convert a rail type
|
||||
|
||||
CMD_BUILD_TRAIN_WAYPOINT = 16, ///< build a waypoint
|
||||
CMD_RENAME_WAYPOINT = 17, ///< rename a waypoint
|
||||
CMD_REMOVE_TRAIN_WAYPOINT = 18, ///< remove a waypoint
|
||||
|
||||
CMD_BUILD_ROAD_STOP = 21, ///< build a road stop
|
||||
CMD_REMOVE_ROAD_STOP = 22, ///< remove a road stop
|
||||
CMD_BUILD_LONG_ROAD = 23, ///< build a complete road (not a "half" one)
|
||||
CMD_REMOVE_LONG_ROAD = 24, ///< remove a complete road (not a "half" one)
|
||||
CMD_BUILD_ROAD = 25, ///< build a "half" road
|
||||
CMD_REMOVE_ROAD = 26, ///< remove a "half" road
|
||||
CMD_BUILD_ROAD_DEPOT = 27, ///< build a road depot
|
||||
|
||||
CMD_BUILD_AIRPORT = 29, ///< build an airport
|
||||
|
||||
CMD_BUILD_DOCK = 30, ///< build a dock
|
||||
|
||||
CMD_BUILD_SHIP_DEPOT = 31, ///< build a ship depot
|
||||
CMD_BUILD_BUOY = 32, ///< build a buoy
|
||||
|
||||
CMD_PLANT_TREE = 33, ///< plant a tree
|
||||
|
||||
CMD_BUILD_RAIL_VEHICLE = 34, ///< build a rail vehicle
|
||||
CMD_MOVE_RAIL_VEHICLE = 35, ///< move a rail vehicle (in the depot)
|
||||
|
||||
CMD_START_STOP_TRAIN = 36, ///< start or stop a train
|
||||
|
||||
CMD_SELL_RAIL_WAGON = 38, ///< sell a rail wagon
|
||||
|
||||
CMD_SEND_TRAIN_TO_DEPOT = 39, ///< send a train to a depot
|
||||
CMD_FORCE_TRAIN_PROCEED = 40, ///< proceed a train to pass a red signal
|
||||
CMD_REVERSE_TRAIN_DIRECTION = 41, ///< turn a train around
|
||||
|
||||
CMD_MODIFY_ORDER = 42, ///< modify an order (like set full-load)
|
||||
CMD_SKIP_TO_ORDER = 43, ///< skip an order to the next of specific one
|
||||
CMD_DELETE_ORDER = 44, ///< delete an order
|
||||
CMD_INSERT_ORDER = 45, ///< insert a new order
|
||||
|
||||
CMD_CHANGE_SERVICE_INT = 46, ///< change the server interval of a vehicle
|
||||
|
||||
CMD_BUILD_INDUSTRY = 47, ///< build a new industry
|
||||
|
||||
CMD_BUILD_COMPANY_HQ = 48, ///< build the company headquarter
|
||||
CMD_SET_PLAYER_FACE = 49, ///< set the face of the player/company
|
||||
CMD_SET_PLAYER_COLOR = 50, ///< set the color of the player/company
|
||||
|
||||
CMD_INCREASE_LOAN = 51, ///< increase the loan from the bank
|
||||
CMD_DECREASE_LOAN = 52, ///< decrease the loan from the bank
|
||||
|
||||
CMD_WANT_ENGINE_PREVIEW = 53, ///< confirm the preview of an engine
|
||||
|
||||
CMD_NAME_VEHICLE = 54, ///< rename a whole vehicle
|
||||
CMD_RENAME_ENGINE = 55, ///< rename a engine (in the engine list)
|
||||
CMD_CHANGE_COMPANY_NAME = 56, ///< change the company name
|
||||
CMD_CHANGE_PRESIDENT_NAME = 57, ///< change the president name
|
||||
CMD_RENAME_STATION = 58, ///< rename a station
|
||||
|
||||
CMD_SELL_AIRCRAFT = 59, ///< sell an aircraft
|
||||
CMD_START_STOP_AIRCRAFT = 60, ///< start/stop an aircraft
|
||||
CMD_BUILD_AIRCRAFT = 61, ///< build an aircraft
|
||||
CMD_SEND_AIRCRAFT_TO_HANGAR = 62, ///< send an aircraft to a hanger
|
||||
CMD_REFIT_AIRCRAFT = 64, ///< refit the cargo space of an aircraft
|
||||
|
||||
CMD_PLACE_SIGN = 65, ///< place a sign
|
||||
CMD_RENAME_SIGN = 66, ///< rename a sign
|
||||
|
||||
CMD_BUILD_ROAD_VEH = 67, ///< build a road vehicle
|
||||
CMD_START_STOP_ROADVEH = 68, ///< start/stop a road vehicle
|
||||
CMD_SELL_ROAD_VEH = 69, ///< sell a road vehicle
|
||||
CMD_SEND_ROADVEH_TO_DEPOT = 70, ///< send a road vehicle to the depot
|
||||
CMD_TURN_ROADVEH = 71, ///< turn a road vehicle around
|
||||
CMD_REFIT_ROAD_VEH = 72, ///< refit the cargo space of a road vehicle
|
||||
|
||||
CMD_PAUSE = 73, ///< pause the game
|
||||
|
||||
CMD_BUY_SHARE_IN_COMPANY = 74, ///< buy a share from a company
|
||||
CMD_SELL_SHARE_IN_COMPANY = 75, ///< sell a share from a company
|
||||
CMD_BUY_COMPANY = 76, ///< buy a company which is bankrupt
|
||||
|
||||
CMD_BUILD_TOWN = 77, ///< build a town
|
||||
|
||||
CMD_RENAME_TOWN = 80, ///< rename a town
|
||||
CMD_DO_TOWN_ACTION = 81, ///< do a action from the town detail window (like advertises or bribe)
|
||||
|
||||
CMD_SET_ROAD_DRIVE_SIDE = 82, ///< set the side where the road vehicles drive
|
||||
|
||||
CMD_CHANGE_DIFFICULTY_LEVEL = 85, ///< change the difficult of a game (each setting for it own)
|
||||
|
||||
CMD_START_STOP_SHIP = 86, ///< start/stop a ship
|
||||
CMD_SELL_SHIP = 87, ///< sell a ship
|
||||
CMD_BUILD_SHIP = 88, ///< build a new ship
|
||||
CMD_SEND_SHIP_TO_DEPOT = 89, ///< send a ship to a depot
|
||||
CMD_REFIT_SHIP = 91, ///< refit the cargo space of a ship
|
||||
|
||||
CMD_ORDER_REFIT = 98, ///< change the refit informaction of an order (for "goto depot" )
|
||||
CMD_CLONE_ORDER = 99, ///< clone (and share) an order
|
||||
CMD_CLEAR_AREA = 100, ///< clear an area
|
||||
|
||||
CMD_MONEY_CHEAT = 102, ///< do the money cheat
|
||||
CMD_BUILD_CANAL = 103, ///< build a canal
|
||||
|
||||
CMD_PLAYER_CTRL = 104, ///< used in multiplayer to create a new player etc.
|
||||
CMD_LEVEL_LAND = 105, ///< level land
|
||||
|
||||
CMD_REFIT_RAIL_VEHICLE = 106, ///< refit the cargo space of a train
|
||||
CMD_RESTORE_ORDER_INDEX = 107, ///< restore vehicle order-index and service interval
|
||||
CMD_BUILD_LOCK = 108, ///< build a lock
|
||||
|
||||
CMD_BUILD_SIGNAL_TRACK = 110, ///< add signals along a track (by dragging)
|
||||
CMD_REMOVE_SIGNAL_TRACK = 111, ///< remove signals along a track (by dragging)
|
||||
|
||||
CMD_GIVE_MONEY = 113, ///< give money to an other player
|
||||
CMD_CHANGE_PATCH_SETTING = 114, ///< change a patch setting
|
||||
|
||||
CMD_SET_AUTOREPLACE = 115, ///< set an autoreplace entry
|
||||
|
||||
CMD_CLONE_VEHICLE = 116, ///< clone a vehicle
|
||||
CMD_MASS_START_STOP = 117, ///< start/stop all vehicles (in a depot)
|
||||
CMD_DEPOT_SELL_ALL_VEHICLES = 118, ///< sell all vehicles which are in a given depot
|
||||
CMD_DEPOT_MASS_AUTOREPLACE = 119, ///< force the autoreplace to take action in a given depot
|
||||
|
||||
CMD_CREATE_GROUP = 120, ///< create a new group
|
||||
CMD_DELETE_GROUP = 121, ///< delete a group
|
||||
CMD_RENAME_GROUP = 122, ///< rename a group
|
||||
CMD_ADD_VEHICLE_GROUP = 123, ///< add a vehicle to a group
|
||||
CMD_ADD_SHARED_VEHICLE_GROUP = 124, ///< add all other shared vehicles to a group which are missing
|
||||
CMD_REMOVE_ALL_VEHICLES_GROUP = 125, ///< remove all vehicles from a group
|
||||
CMD_SET_GROUP_REPLACE_PROTECTION = 126, ///< set the autoreplace-protection for a group
|
||||
|
||||
CMD_MOVE_ORDER = 127, ///< move an order
|
||||
CMD_CHANGE_TIMETABLE = 128, ///< change the timetable for a vehicle
|
||||
CMD_SET_VEHICLE_ON_TIME = 129, ///< set the vehicle on time feature (timetable)
|
||||
CMD_AUTOFILL_TIMETABLE = 130, ///< autofill the timetable
|
||||
};
|
||||
|
||||
/**
|
||||
* List of flags for a command.
|
||||
*
|
||||
* This enums defines some flags which can be used for the commands.
|
||||
*/
|
||||
enum {
|
||||
DC_EXEC = 0x01, ///< execute the given command
|
||||
DC_AUTO = 0x02, ///< don't allow building on structures
|
||||
DC_QUERY_COST = 0x04, ///< query cost only, don't build.
|
||||
DC_NO_WATER = 0x08, ///< don't allow building on water
|
||||
DC_NO_RAIL_OVERLAP = 0x10, ///< don't allow overlap of rails (used in buildrail)
|
||||
DC_AI_BUILDING = 0x20, ///< special building rules for AI
|
||||
DC_NO_TOWN_RATING = 0x40, ///< town rating does not disallow you from building
|
||||
DC_FORCETEST = 0x80, ///< force test too.
|
||||
};
|
||||
|
||||
/**
|
||||
* Used to combine a StringID with the command.
|
||||
*
|
||||
* This macro can be used to add a StringID (the error message to show) on a command-id
|
||||
* (CMD_xxx). Use the binary or-operator "|" to combine the command with the result from
|
||||
* this macro.
|
||||
*
|
||||
* @param x The StringID to combine with a command-id
|
||||
*/
|
||||
#define CMD_MSG(x) ((x) << 16)
|
||||
|
||||
/**
|
||||
* Defines some flags.
|
||||
*
|
||||
* This enumeration defines some flags which are binary-or'ed on a command.
|
||||
*/
|
||||
enum {
|
||||
CMD_NO_WATER = 0x0400, ///< dont build on water
|
||||
CMD_NETWORK_COMMAND = 0x0800, ///< execute the command without sending it on the network
|
||||
CMD_NO_TEST_IF_IN_NETWORK = 0x1000, ///< When enabled, the command will bypass the no-DC_EXEC round if in network
|
||||
CMD_SHOW_NO_ERROR = 0x2000, ///< do not show the error message
|
||||
};
|
||||
|
||||
/**
|
||||
* Command flags for the command table _command_proc_table.
|
||||
*
|
||||
* This enumeration defines flags for the _command_proc_table.
|
||||
*/
|
||||
enum {
|
||||
CMD_SERVER = 0x1, ///< the command can only be initiated by the server
|
||||
CMD_OFFLINE = 0x2, ///< the command cannot be executed in a multiplayer game; single-player only
|
||||
CMD_AUTO = 0x4, ///< set the DC_AUTO flag on this command
|
||||
};
|
||||
|
||||
/**
|
||||
* Defines the callback type for all command handler functions.
|
||||
*
|
||||
* This type defines the function header for all functions which handles a CMD_* command.
|
||||
* A command handler use the parameters to act according to the meaning of the command.
|
||||
* The tile parameter defines the tile to perform an action on.
|
||||
* The flag parameter is filled with flags from the DC_* enumeration. The parameters
|
||||
* p1 and p2 are filled with parameters for the command like "which road type", "which
|
||||
* order" or "direction". Each function should mentioned in there doxygen comments
|
||||
* the usage of these parameters.
|
||||
*
|
||||
* @param tile The tile to apply a command on
|
||||
* @param flags Flags for the command, from the DC_* enumeration
|
||||
* @param p1 Additional data for the command
|
||||
* @param p2 Additional data for the command
|
||||
* @return The CommandCost of the command, which can be succeeded or failed.
|
||||
*/
|
||||
typedef CommandCost CommandProc(TileIndex tile, uint32 flags, uint32 p1, uint32 p2);
|
||||
|
||||
/**
|
||||
* Define a command with the flags which belongs to it.
|
||||
*
|
||||
* This struct connect a command handler function with the flags created with
|
||||
* the #CMD_AUTO, #CMD_OFFLINE and #CMD_SERVER values.
|
||||
*/
|
||||
struct Command {
|
||||
CommandProc *proc;
|
||||
byte flags;
|
||||
};
|
||||
|
||||
/**
|
||||
* Checks if a command failes.
|
||||
*
|
||||
* As you see the parameter is not a command but the return value of a command,
|
||||
* the CommandCost class. This function checks if the command executed by
|
||||
* the CommandProc function failed and returns true if it does.
|
||||
*
|
||||
* @param cost The return value of a CommandProc call
|
||||
* @return true if the command failes
|
||||
* @see CmdSucceded
|
||||
*/
|
||||
static inline bool CmdFailed(CommandCost cost) { return cost.Failed(); }
|
||||
|
||||
/**
|
||||
* Checks if a command succeeded.
|
||||
*
|
||||
* As #CmdFailed this function checks if a command succeeded
|
||||
*
|
||||
* @param cost The return value of a CommandProc call
|
||||
* @return true if the command succeeded
|
||||
* @see CmdSucceeded
|
||||
*/
|
||||
static inline bool CmdSucceeded(CommandCost cost) { return cost.Succeeded(); }
|
||||
|
||||
/**
|
||||
* Define a default return value for a failed command.
|
||||
*
|
||||
* This variable contains a CommandCost object with is declared as "failed".
|
||||
* Other functions just need to return this error if there is an error,
|
||||
* which doesn't need to specific by a StringID.
|
||||
*/
|
||||
static const CommandCost CMD_ERROR = CommandCost(INVALID_STRING_ID);
|
||||
|
||||
/**
|
||||
* Returns from a function with a specific StringID as error.
|
||||
*
|
||||
* This macro is used to return from a function. The parameter contains the
|
||||
* StringID which will be returned.
|
||||
*
|
||||
* @param errcode The StringID to return
|
||||
*/
|
||||
#define return_cmd_error(errcode) return CommandCost(errcode);
|
||||
|
||||
/* command.cpp */
|
||||
/**
|
||||
* Define a callback function for the client, after the command is finished.
|
||||
*
|
||||
* Functions of this type are called after the command is finished. The parameters
|
||||
* are from the #CommandProc callback type. The boolean parameter indicates if the
|
||||
* command succeeded or failed.
|
||||
*
|
||||
* @param success If the command succeeded or not.
|
||||
* @param tile The tile of the command action
|
||||
* @param p1 Additional data of the command
|
||||
* @param p1 Additional data of the command
|
||||
* @see CommandProc
|
||||
*/
|
||||
typedef void CommandCallback(bool success, TileIndex tile, uint32 p1, uint32 p2);
|
||||
|
||||
/**
|
||||
* Execute a command
|
||||
*/
|
||||
CommandCost DoCommand(TileIndex tile, uint32 p1, uint32 p2, uint32 flags, uint procc);
|
||||
|
||||
/**
|
||||
* Execute a network safe DoCommand function
|
||||
*/
|
||||
bool DoCommandP(TileIndex tile, uint32 p1, uint32 p2, CommandCallback *callback, uint32 cmd, bool my_cmd = true);
|
||||
|
||||
#ifdef ENABLE_NETWORK
|
||||
|
||||
/**
|
||||
* Send a command over the network
|
||||
*/
|
||||
void NetworkSend_Command(TileIndex tile, uint32 p1, uint32 p2, uint32 cmd, CommandCallback *callback);
|
||||
#endif /* ENABLE_NETWORK */
|
||||
|
||||
/**
|
||||
* Text, which gets sent with a command
|
||||
*
|
||||
* This variable contains a string (be specific a pointer of the first
|
||||
* char of this string) which will be send with a command. This is
|
||||
* used for user input data like names or chat messages.
|
||||
*/
|
||||
extern const char *_cmd_text;
|
||||
|
||||
/**
|
||||
* Checks if a integer value belongs to a command.
|
||||
*/
|
||||
bool IsValidCommand(uint cmd);
|
||||
/**
|
||||
* Returns the flags from a given command.
|
||||
*/
|
||||
byte GetCommandFlags(uint cmd);
|
||||
/**
|
||||
* Returns the current money available which can be used for a command.
|
||||
*/
|
||||
Money GetAvailableMoneyForCommand();
|
||||
|
||||
#endif /* COMMAND_H */
|
95
src/command_func.h
Normal file
95
src/command_func.h
Normal file
@@ -0,0 +1,95 @@
|
||||
/* $Id$ */
|
||||
|
||||
/** @file command_func.h Functions related to commands. */
|
||||
|
||||
#ifndef COMMAND_FUNC_H
|
||||
#define COMMAND_FUNC_H
|
||||
|
||||
#include "command_type.h"
|
||||
|
||||
/**
|
||||
* Checks if a command failes.
|
||||
*
|
||||
* As you see the parameter is not a command but the return value of a command,
|
||||
* the CommandCost class. This function checks if the command executed by
|
||||
* the CommandProc function failed and returns true if it does.
|
||||
*
|
||||
* @param cost The return value of a CommandProc call
|
||||
* @return true if the command failes
|
||||
* @see CmdSucceded
|
||||
*/
|
||||
static inline bool CmdFailed(CommandCost cost) { return cost.Failed(); }
|
||||
|
||||
/**
|
||||
* Checks if a command succeeded.
|
||||
*
|
||||
* As #CmdFailed this function checks if a command succeeded
|
||||
*
|
||||
* @param cost The return value of a CommandProc call
|
||||
* @return true if the command succeeded
|
||||
* @see CmdSucceeded
|
||||
*/
|
||||
static inline bool CmdSucceeded(CommandCost cost) { return cost.Succeeded(); }
|
||||
|
||||
/**
|
||||
* Define a default return value for a failed command.
|
||||
*
|
||||
* This variable contains a CommandCost object with is declared as "failed".
|
||||
* Other functions just need to return this error if there is an error,
|
||||
* which doesn't need to specific by a StringID.
|
||||
*/
|
||||
static const CommandCost CMD_ERROR = CommandCost(INVALID_STRING_ID);
|
||||
|
||||
/**
|
||||
* Returns from a function with a specific StringID as error.
|
||||
*
|
||||
* This macro is used to return from a function. The parameter contains the
|
||||
* StringID which will be returned.
|
||||
*
|
||||
* @param errcode The StringID to return
|
||||
*/
|
||||
#define return_cmd_error(errcode) return CommandCost(errcode);
|
||||
|
||||
/**
|
||||
* Execute a command
|
||||
*/
|
||||
CommandCost DoCommand(TileIndex tile, uint32 p1, uint32 p2, uint32 flags, uint32 procc);
|
||||
|
||||
/**
|
||||
* Execute a network safe DoCommand function
|
||||
*/
|
||||
bool DoCommandP(TileIndex tile, uint32 p1, uint32 p2, CommandCallback *callback, uint32 cmd, bool my_cmd = true);
|
||||
|
||||
#ifdef ENABLE_NETWORK
|
||||
|
||||
/**
|
||||
* Send a command over the network
|
||||
*/
|
||||
void NetworkSend_Command(TileIndex tile, uint32 p1, uint32 p2, uint32 cmd, CommandCallback *callback);
|
||||
#endif /* ENABLE_NETWORK */
|
||||
|
||||
/**
|
||||
* Text, which gets sent with a command
|
||||
*
|
||||
* This variable contains a string (be specific a pointer of the first
|
||||
* char of this string) which will be send with a command. This is
|
||||
* used for user input data like names or chat messages.
|
||||
*/
|
||||
extern const char *_cmd_text;
|
||||
extern Money _additional_cash_required;
|
||||
extern StringID _error_message;
|
||||
|
||||
/**
|
||||
* Checks if a integer value belongs to a command.
|
||||
*/
|
||||
bool IsValidCommand(uint32 cmd);
|
||||
/**
|
||||
* Returns the flags from a given command.
|
||||
*/
|
||||
byte GetCommandFlags(uint32 cmd);
|
||||
/**
|
||||
* Returns the current money available which can be used for a command.
|
||||
*/
|
||||
Money GetAvailableMoneyForCommand();
|
||||
|
||||
#endif /* COMMAND_FUNC_H */
|
357
src/command_type.h
Normal file
357
src/command_type.h
Normal file
@@ -0,0 +1,357 @@
|
||||
/* $Id$ */
|
||||
|
||||
/** @file command_type.h Types related to commands. */
|
||||
|
||||
#ifndef COMMAND_TYPE_H
|
||||
#define COMMAND_TYPE_H
|
||||
|
||||
#include "economy_type.h"
|
||||
#include "strings_type.h"
|
||||
#include "tile_type.h"
|
||||
|
||||
/**
|
||||
* Common return value for all commands. Wraps the cost and
|
||||
* a possible error message/state together.
|
||||
*/
|
||||
class CommandCost {
|
||||
ExpensesType expense_type; ///< the type of expence as shown on the finances view
|
||||
Money cost; ///< The cost of this action
|
||||
StringID message; ///< Warning message for when success is unset
|
||||
bool success; ///< Whether the comment went fine up to this moment
|
||||
|
||||
public:
|
||||
/**
|
||||
* Creates a command cost return with no cost and no error
|
||||
*/
|
||||
CommandCost() : expense_type(INVALID_EXPENSES), cost(0), message(INVALID_STRING_ID), success(true) {}
|
||||
|
||||
/**
|
||||
* Creates a command return value the is failed with the given message
|
||||
*/
|
||||
CommandCost(StringID msg) : expense_type(INVALID_EXPENSES), cost(0), message(msg), success(false) {}
|
||||
|
||||
/**
|
||||
* Creates a command cost with given expense type and start cost of 0
|
||||
* @param ex_t the expense type
|
||||
*/
|
||||
CommandCost(ExpensesType ex_t) : expense_type(ex_t), cost(0), message(INVALID_STRING_ID), success(true) {}
|
||||
|
||||
/**
|
||||
* Creates a command return value with the given start cost and expense type
|
||||
* @param ex_t the expense type
|
||||
* @param cst the initial cost of this command
|
||||
*/
|
||||
CommandCost(ExpensesType ex_t, Money cst) : expense_type(ex_t), cost(cst), message(INVALID_STRING_ID), success(true) {}
|
||||
|
||||
/**
|
||||
* Adds the cost of the given command return value to this cost.
|
||||
* Also takes a possible error message when it is set.
|
||||
* @param ret the command to add the cost of.
|
||||
* @return this class.
|
||||
*/
|
||||
CommandCost AddCost(CommandCost ret);
|
||||
|
||||
/**
|
||||
* Adds the given cost to the cost of the command.
|
||||
* @param cost the cost to add
|
||||
* @return this class.
|
||||
*/
|
||||
CommandCost AddCost(Money cost);
|
||||
|
||||
/**
|
||||
* Multiplies the cost of the command by the given factor.
|
||||
* @param cost factor to multiply the costs with
|
||||
* @return this class
|
||||
*/
|
||||
CommandCost MultiplyCost(int factor);
|
||||
|
||||
/**
|
||||
* The costs as made up to this moment
|
||||
* @return the costs
|
||||
*/
|
||||
Money GetCost() const;
|
||||
|
||||
/**
|
||||
* The expense type of the cost
|
||||
* @return the expense type
|
||||
*/
|
||||
ExpensesType GetExpensesType() const;
|
||||
|
||||
/**
|
||||
* Sets the global error message *if* this class has one.
|
||||
*/
|
||||
void SetGlobalErrorMessage() const;
|
||||
|
||||
/**
|
||||
* Did this command succeed?
|
||||
* @return true if and only if it succeeded
|
||||
*/
|
||||
bool Succeeded() const;
|
||||
|
||||
/**
|
||||
* Did this command fail?
|
||||
* @return true if and only if it failed
|
||||
*/
|
||||
bool Failed() const;
|
||||
};
|
||||
|
||||
/**
|
||||
* List of commands.
|
||||
*
|
||||
* This enum defines all possible commands which can be executed to the game
|
||||
* engine. Observing the game like the query-tool or checking the profit of a
|
||||
* vehicle don't result in a command which should be executed in the engine
|
||||
* nor send to the server in a network game.
|
||||
*
|
||||
* @see _command_proc_table
|
||||
*/
|
||||
enum {
|
||||
CMD_BUILD_RAILROAD_TRACK, ///< build a rail track
|
||||
CMD_REMOVE_RAILROAD_TRACK, ///< remove a rail track
|
||||
CMD_BUILD_SINGLE_RAIL, ///< build a single rail track
|
||||
CMD_REMOVE_SINGLE_RAIL, ///< remove a single rail track
|
||||
CMD_LANDSCAPE_CLEAR, ///< demolish a tile
|
||||
CMD_BUILD_BRIDGE, ///< build a bridge
|
||||
CMD_BUILD_RAILROAD_STATION, ///< build a railroad station
|
||||
CMD_BUILD_TRAIN_DEPOT, ///< build a train depot
|
||||
CMD_BUILD_SIGNALS, ///< build a signal
|
||||
CMD_REMOVE_SIGNALS, ///< remove a signal
|
||||
CMD_TERRAFORM_LAND, ///< terraform a tile
|
||||
CMD_PURCHASE_LAND_AREA, ///< purchase a tile
|
||||
CMD_SELL_LAND_AREA, ///< sell a bought tile before
|
||||
CMD_BUILD_TUNNEL, ///< build a tunnel
|
||||
|
||||
CMD_REMOVE_FROM_RAILROAD_STATION, ///< remove a tile station
|
||||
CMD_CONVERT_RAIL, ///< convert a rail type
|
||||
|
||||
CMD_BUILD_TRAIN_WAYPOINT, ///< build a waypoint
|
||||
CMD_RENAME_WAYPOINT, ///< rename a waypoint
|
||||
CMD_REMOVE_TRAIN_WAYPOINT, ///< remove a waypoint
|
||||
|
||||
CMD_BUILD_ROAD_STOP, ///< build a road stop
|
||||
CMD_REMOVE_ROAD_STOP, ///< remove a road stop
|
||||
CMD_BUILD_LONG_ROAD, ///< build a complete road (not a "half" one)
|
||||
CMD_REMOVE_LONG_ROAD, ///< remove a complete road (not a "half" one)
|
||||
CMD_BUILD_ROAD, ///< build a "half" road
|
||||
CMD_REMOVE_ROAD, ///< remove a "half" road
|
||||
CMD_BUILD_ROAD_DEPOT, ///< build a road depot
|
||||
|
||||
CMD_BUILD_AIRPORT, ///< build an airport
|
||||
|
||||
CMD_BUILD_DOCK, ///< build a dock
|
||||
|
||||
CMD_BUILD_SHIP_DEPOT, ///< build a ship depot
|
||||
CMD_BUILD_BUOY, ///< build a buoy
|
||||
|
||||
CMD_PLANT_TREE, ///< plant a tree
|
||||
|
||||
CMD_BUILD_RAIL_VEHICLE, ///< build a rail vehicle
|
||||
CMD_MOVE_RAIL_VEHICLE, ///< move a rail vehicle (in the depot)
|
||||
|
||||
CMD_START_STOP_TRAIN, ///< start or stop a train
|
||||
|
||||
CMD_SELL_RAIL_WAGON, ///< sell a rail wagon
|
||||
|
||||
CMD_SEND_TRAIN_TO_DEPOT, ///< send a train to a depot
|
||||
CMD_FORCE_TRAIN_PROCEED, ///< proceed a train to pass a red signal
|
||||
CMD_REVERSE_TRAIN_DIRECTION, ///< turn a train around
|
||||
|
||||
CMD_MODIFY_ORDER, ///< modify an order (like set full-load)
|
||||
CMD_SKIP_TO_ORDER, ///< skip an order to the next of specific one
|
||||
CMD_DELETE_ORDER, ///< delete an order
|
||||
CMD_INSERT_ORDER, ///< insert a new order
|
||||
|
||||
CMD_CHANGE_SERVICE_INT, ///< change the server interval of a vehicle
|
||||
|
||||
CMD_BUILD_INDUSTRY, ///< build a new industry
|
||||
|
||||
CMD_BUILD_COMPANY_HQ, ///< build the company headquarter
|
||||
CMD_SET_PLAYER_FACE, ///< set the face of the player/company
|
||||
CMD_SET_PLAYER_COLOR, ///< set the color of the player/company
|
||||
|
||||
CMD_INCREASE_LOAN, ///< increase the loan from the bank
|
||||
CMD_DECREASE_LOAN, ///< decrease the loan from the bank
|
||||
|
||||
CMD_WANT_ENGINE_PREVIEW, ///< confirm the preview of an engine
|
||||
|
||||
CMD_NAME_VEHICLE, ///< rename a whole vehicle
|
||||
CMD_RENAME_ENGINE, ///< rename a engine (in the engine list)
|
||||
CMD_CHANGE_COMPANY_NAME, ///< change the company name
|
||||
CMD_CHANGE_PRESIDENT_NAME, ///< change the president name
|
||||
CMD_RENAME_STATION, ///< rename a station
|
||||
|
||||
CMD_SELL_AIRCRAFT, ///< sell an aircraft
|
||||
CMD_START_STOP_AIRCRAFT, ///< start/stop an aircraft
|
||||
CMD_BUILD_AIRCRAFT, ///< build an aircraft
|
||||
CMD_SEND_AIRCRAFT_TO_HANGAR, ///< send an aircraft to a hanger
|
||||
CMD_REFIT_AIRCRAFT, ///< refit the cargo space of an aircraft
|
||||
|
||||
CMD_PLACE_SIGN, ///< place a sign
|
||||
CMD_RENAME_SIGN, ///< rename a sign
|
||||
|
||||
CMD_BUILD_ROAD_VEH, ///< build a road vehicle
|
||||
CMD_START_STOP_ROADVEH, ///< start/stop a road vehicle
|
||||
CMD_SELL_ROAD_VEH, ///< sell a road vehicle
|
||||
CMD_SEND_ROADVEH_TO_DEPOT, ///< send a road vehicle to the depot
|
||||
CMD_TURN_ROADVEH, ///< turn a road vehicle around
|
||||
CMD_REFIT_ROAD_VEH, ///< refit the cargo space of a road vehicle
|
||||
|
||||
CMD_PAUSE, ///< pause the game
|
||||
|
||||
CMD_BUY_SHARE_IN_COMPANY, ///< buy a share from a company
|
||||
CMD_SELL_SHARE_IN_COMPANY, ///< sell a share from a company
|
||||
CMD_BUY_COMPANY, ///< buy a company which is bankrupt
|
||||
|
||||
CMD_BUILD_TOWN, ///< build a town
|
||||
|
||||
CMD_RENAME_TOWN, ///< rename a town
|
||||
CMD_DO_TOWN_ACTION, ///< do a action from the town detail window (like advertises or bribe)
|
||||
|
||||
CMD_SET_ROAD_DRIVE_SIDE, ///< set the side where the road vehicles drive
|
||||
|
||||
CMD_CHANGE_DIFFICULTY_LEVEL, ///< change the difficult of a game (each setting for it own)
|
||||
|
||||
CMD_START_STOP_SHIP, ///< start/stop a ship
|
||||
CMD_SELL_SHIP, ///< sell a ship
|
||||
CMD_BUILD_SHIP, ///< build a new ship
|
||||
CMD_SEND_SHIP_TO_DEPOT, ///< send a ship to a depot
|
||||
CMD_REFIT_SHIP, ///< refit the cargo space of a ship
|
||||
|
||||
CMD_ORDER_REFIT, ///< change the refit informaction of an order (for "goto depot" )
|
||||
CMD_CLONE_ORDER, ///< clone (and share) an order
|
||||
CMD_CLEAR_AREA, ///< clear an area
|
||||
|
||||
CMD_MONEY_CHEAT, ///< do the money cheat
|
||||
CMD_BUILD_CANAL, ///< build a canal
|
||||
|
||||
CMD_PLAYER_CTRL, ///< used in multiplayer to create a new player etc.
|
||||
CMD_LEVEL_LAND, ///< level land
|
||||
|
||||
CMD_REFIT_RAIL_VEHICLE, ///< refit the cargo space of a train
|
||||
CMD_RESTORE_ORDER_INDEX, ///< restore vehicle order-index and service interval
|
||||
CMD_BUILD_LOCK, ///< build a lock
|
||||
|
||||
CMD_BUILD_SIGNAL_TRACK, ///< add signals along a track (by dragging)
|
||||
CMD_REMOVE_SIGNAL_TRACK, ///< remove signals along a track (by dragging)
|
||||
|
||||
CMD_GIVE_MONEY, ///< give money to an other player
|
||||
CMD_CHANGE_PATCH_SETTING, ///< change a patch setting
|
||||
|
||||
CMD_SET_AUTOREPLACE, ///< set an autoreplace entry
|
||||
|
||||
CMD_CLONE_VEHICLE, ///< clone a vehicle
|
||||
CMD_MASS_START_STOP, ///< start/stop all vehicles (in a depot)
|
||||
CMD_DEPOT_SELL_ALL_VEHICLES, ///< sell all vehicles which are in a given depot
|
||||
CMD_DEPOT_MASS_AUTOREPLACE, ///< force the autoreplace to take action in a given depot
|
||||
|
||||
CMD_CREATE_GROUP, ///< create a new group
|
||||
CMD_DELETE_GROUP, ///< delete a group
|
||||
CMD_RENAME_GROUP, ///< rename a group
|
||||
CMD_ADD_VEHICLE_GROUP, ///< add a vehicle to a group
|
||||
CMD_ADD_SHARED_VEHICLE_GROUP, ///< add all other shared vehicles to a group which are missing
|
||||
CMD_REMOVE_ALL_VEHICLES_GROUP, ///< remove all vehicles from a group
|
||||
CMD_SET_GROUP_REPLACE_PROTECTION, ///< set the autoreplace-protection for a group
|
||||
|
||||
CMD_MOVE_ORDER, ///< move an order
|
||||
CMD_CHANGE_TIMETABLE, ///< change the timetable for a vehicle
|
||||
CMD_SET_VEHICLE_ON_TIME, ///< set the vehicle on time feature (timetable)
|
||||
CMD_AUTOFILL_TIMETABLE, ///< autofill the timetable
|
||||
};
|
||||
|
||||
/**
|
||||
* List of flags for a command.
|
||||
*
|
||||
* This enums defines some flags which can be used for the commands.
|
||||
*/
|
||||
enum {
|
||||
DC_EXEC = 0x001, ///< execute the given command
|
||||
DC_AUTO = 0x002, ///< don't allow building on structures
|
||||
DC_QUERY_COST = 0x004, ///< query cost only, don't build.
|
||||
DC_NO_WATER = 0x008, ///< don't allow building on water
|
||||
DC_NO_RAIL_OVERLAP = 0x010, ///< don't allow overlap of rails (used in buildrail)
|
||||
DC_AI_BUILDING = 0x020, ///< special building rules for AI
|
||||
DC_NO_TOWN_RATING = 0x040, ///< town rating does not disallow you from building
|
||||
DC_BANKRUPT = 0x080, ///< company bankrupts, skip money check, skip vehicle on tile check in some cases
|
||||
DC_AUTOREPLACE = 0x100, ///< autoreplace/autorenew is in progress
|
||||
};
|
||||
|
||||
/**
|
||||
* Used to combine a StringID with the command.
|
||||
*
|
||||
* This macro can be used to add a StringID (the error message to show) on a command-id
|
||||
* (CMD_xxx). Use the binary or-operator "|" to combine the command with the result from
|
||||
* this macro.
|
||||
*
|
||||
* @param x The StringID to combine with a command-id
|
||||
*/
|
||||
#define CMD_MSG(x) ((x) << 16)
|
||||
|
||||
/**
|
||||
* Defines some flags.
|
||||
*
|
||||
* This enumeration defines some flags which are binary-or'ed on a command.
|
||||
*/
|
||||
enum {
|
||||
CMD_NO_WATER = 0x0400, ///< dont build on water
|
||||
CMD_NETWORK_COMMAND = 0x0800, ///< execute the command without sending it on the network
|
||||
CMD_NO_TEST_IF_IN_NETWORK = 0x1000, ///< When enabled, the command will bypass the no-DC_EXEC round if in network
|
||||
CMD_SHOW_NO_ERROR = 0x2000, ///< do not show the error message
|
||||
};
|
||||
|
||||
/**
|
||||
* Command flags for the command table _command_proc_table.
|
||||
*
|
||||
* This enumeration defines flags for the _command_proc_table.
|
||||
*/
|
||||
enum {
|
||||
CMD_SERVER = 0x1, ///< the command can only be initiated by the server
|
||||
CMD_OFFLINE = 0x2, ///< the command cannot be executed in a multiplayer game; single-player only
|
||||
CMD_AUTO = 0x4, ///< set the DC_AUTO flag on this command
|
||||
};
|
||||
|
||||
/**
|
||||
* Defines the callback type for all command handler functions.
|
||||
*
|
||||
* This type defines the function header for all functions which handles a CMD_* command.
|
||||
* A command handler use the parameters to act according to the meaning of the command.
|
||||
* The tile parameter defines the tile to perform an action on.
|
||||
* The flag parameter is filled with flags from the DC_* enumeration. The parameters
|
||||
* p1 and p2 are filled with parameters for the command like "which road type", "which
|
||||
* order" or "direction". Each function should mentioned in there doxygen comments
|
||||
* the usage of these parameters.
|
||||
*
|
||||
* @param tile The tile to apply a command on
|
||||
* @param flags Flags for the command, from the DC_* enumeration
|
||||
* @param p1 Additional data for the command
|
||||
* @param p2 Additional data for the command
|
||||
* @return The CommandCost of the command, which can be succeeded or failed.
|
||||
*/
|
||||
typedef CommandCost CommandProc(TileIndex tile, uint32 flags, uint32 p1, uint32 p2);
|
||||
|
||||
/**
|
||||
* Define a command with the flags which belongs to it.
|
||||
*
|
||||
* This struct connect a command handler function with the flags created with
|
||||
* the #CMD_AUTO, #CMD_OFFLINE and #CMD_SERVER values.
|
||||
*/
|
||||
struct Command {
|
||||
CommandProc *proc;
|
||||
byte flags;
|
||||
};
|
||||
|
||||
/**
|
||||
* Define a callback function for the client, after the command is finished.
|
||||
*
|
||||
* Functions of this type are called after the command is finished. The parameters
|
||||
* are from the #CommandProc callback type. The boolean parameter indicates if the
|
||||
* command succeeded or failed.
|
||||
*
|
||||
* @param success If the command succeeded or not.
|
||||
* @param tile The tile of the command action
|
||||
* @param p1 Additional data of the command
|
||||
* @param p1 Additional data of the command
|
||||
* @see CommandProc
|
||||
*/
|
||||
typedef void CommandCallback(bool success, TileIndex tile, uint32 p1, uint32 p2);
|
||||
|
||||
#endif /* COMMAND_TYPE_H */
|
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user