Compare commits
531 Commits
1.11.0-bet
...
1.11.2
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
672f285218 | ||
|
|
f11b06ff6a | ||
|
|
f9595543ca | ||
|
|
9aa335aca3 | ||
|
|
05aed133c7 | ||
|
|
b9ea4f07e4 | ||
|
|
8b5bd34a65 | ||
|
|
72090f39ce | ||
|
|
de61dadaa9 | ||
|
|
d52a66642d | ||
|
|
d92d807e1d | ||
|
|
60f85dbc37 | ||
|
|
dbba489fcf | ||
|
|
dd70d0ad85 | ||
|
|
a8c5f8a10b | ||
|
|
ef258b1686 | ||
|
|
3265e56294 | ||
|
|
5e7f9cc22c | ||
|
|
f3b8ff0e17 | ||
|
|
c3d134793f | ||
|
|
59c356ad39 | ||
|
|
2514cf3c5c | ||
|
|
1eb20db8db | ||
|
|
32ead3aba6 | ||
|
|
cae0b46e38 | ||
|
|
4f8a2c2999 | ||
|
|
9932f4ea50 | ||
|
|
0a5a06c431 | ||
|
|
d570120e17 | ||
|
|
abbbeb752a | ||
|
|
9afe3d77e6 | ||
|
|
6362e29ad7 | ||
|
|
bc0501e96f | ||
|
|
7e6f00c85a | ||
|
|
bf07420916 | ||
|
|
21b196d5c4 | ||
|
|
26b7500f3b | ||
|
|
9a203b2b2c | ||
|
|
c3eae71778 | ||
|
|
b1d3b9544e | ||
|
|
45c866cbd1 | ||
|
|
f8f57ab46f | ||
|
|
ef48195ffa | ||
|
|
967c2ed56c | ||
|
|
037bd14ed8 | ||
|
|
8eb53fa1a0 | ||
|
|
4b14a84510 | ||
|
|
4e1b0eda94 | ||
|
|
bf727cb26a | ||
|
|
e609c936a4 | ||
|
|
59ce9b4d2f | ||
|
|
ceee558fe5 | ||
|
|
2bc7e5a8e2 | ||
|
|
8d1d271cda | ||
|
|
c454cc09b3 | ||
|
|
0be22efffc | ||
|
|
4f8b2aa003 | ||
|
|
57f01188c2 | ||
|
|
bcb6174bf3 | ||
|
|
7b56a630aa | ||
|
|
4e5be077ff | ||
|
|
7aaaa2c5f5 | ||
|
|
c9c208f78e | ||
|
|
522069d146 | ||
|
|
e379c818b3 | ||
|
|
eb5ae95c90 | ||
|
|
e8965d32d9 | ||
|
|
790b4f3076 | ||
|
|
4f0f113887 | ||
|
|
53ce868185 | ||
|
|
144ed59aef | ||
|
|
40f7d085f4 | ||
|
|
1f34264017 | ||
|
|
fa57e33dfe | ||
|
|
dee9d6dfd4 | ||
|
|
961cda50bc | ||
|
|
fe43c2d18f | ||
|
|
59406363bb | ||
|
|
cbc1d0c893 | ||
|
|
3d0c109d82 | ||
|
|
e0594d6cac | ||
|
|
51cb9e71e5 | ||
|
|
27630d255c | ||
|
|
d04423251b | ||
|
|
9e5ab59eab | ||
|
|
898c61d457 | ||
|
|
ec8abd072d | ||
|
|
0f962aaf03 | ||
|
|
eeb6e9d417 | ||
|
|
0434cc017b | ||
|
|
5905fdb26e | ||
|
|
4ffe7131cb | ||
|
|
aadc7beccc | ||
|
|
9d233bb7d4 | ||
|
|
5c6b43832c | ||
|
|
5cbbb0d17b | ||
|
|
19b3f777c4 | ||
|
|
24ddedad38 | ||
|
|
30313bb396 | ||
|
|
35aff633bd | ||
|
|
c6312a8ebf | ||
|
|
3976f2deed | ||
|
|
a7cb2d8d00 | ||
|
|
7021468ee3 | ||
|
|
d6a4b67df7 | ||
|
|
0b51290a1e | ||
|
|
3a6b811559 | ||
|
|
d02aae7a9c | ||
|
|
78285207ce | ||
|
|
300391465a | ||
|
|
306d80be49 | ||
|
|
5af537026f | ||
|
|
a8a838c24c | ||
|
|
4cfcbcfbaa | ||
|
|
34606b7cbd | ||
|
|
f0f87ee0dc | ||
|
|
9acb8f7d2c | ||
|
|
fb23ee6add | ||
|
|
1d039c86cb | ||
|
|
7c7f747ad8 | ||
|
|
bd80ec7cff | ||
|
|
935debbf6f | ||
|
|
4eac2163f5 | ||
|
|
150341ba29 | ||
|
|
183df5c981 | ||
|
|
7fb12afc4f | ||
|
|
92f966821e | ||
|
|
903bd3d750 | ||
|
|
edbae9ad6c | ||
|
|
a931a18d05 | ||
|
|
b36b1a8cf9 | ||
|
|
b8af503ff5 | ||
|
|
766b9895bf | ||
|
|
2b78c22349 | ||
|
|
4bcc3a4f3f | ||
|
|
d5b8829fb4 | ||
|
|
872d1f1396 | ||
|
|
1e905dea20 | ||
|
|
cedc5c4de8 | ||
|
|
13b1e585da | ||
|
|
6dcc7f93c3 | ||
|
|
9496990f53 | ||
|
|
d700db0e7d | ||
|
|
ae0b641768 | ||
|
|
eff2376871 | ||
|
|
3fae244f54 | ||
|
|
d77d0c9a5f | ||
|
|
0b6e84f4cf | ||
|
|
14692bf2e4 | ||
|
|
1f8bd4a8d7 | ||
|
|
10d5fc46f9 | ||
|
|
28aeedc4e7 | ||
|
|
5802f61e42 | ||
|
|
4e51cd1a03 | ||
|
|
70117d3b82 | ||
|
|
4d3b14af6f | ||
|
|
da55c7c69f | ||
|
|
2c93c3b9cb | ||
|
|
ea484bc9a6 | ||
|
|
8e6522acef | ||
|
|
3a3fb37dfe | ||
|
|
2272de80e2 | ||
|
|
38b506ecd6 | ||
|
|
df96bcf75c | ||
|
|
63f6ae30e2 | ||
|
|
87def2fd9e | ||
|
|
6c93f02ff9 | ||
|
|
ad256b5c1d | ||
|
|
74c98db1b6 | ||
|
|
217071aa1d | ||
|
|
41baf8778b | ||
|
|
c25847787e | ||
|
|
4fe222d853 | ||
|
|
22a9d921ef | ||
|
|
13011e00c6 | ||
|
|
062eeb9810 | ||
|
|
5056e963ba | ||
|
|
8230cd009d | ||
|
|
bcb3313e13 | ||
|
|
e708fb38da | ||
|
|
9c5a7d3a57 | ||
|
|
3cb2dd4889 | ||
|
|
de891238d6 | ||
|
|
f580ab4ba4 | ||
|
|
28589db664 | ||
|
|
c0b722ec46 | ||
|
|
1fb1e75038 | ||
|
|
4866e43862 | ||
|
|
14b61bfa6f | ||
|
|
afadae6d50 | ||
|
|
5426cb3baf | ||
|
|
b349ef6e71 | ||
|
|
970fedd78c | ||
|
|
098d5b2239 | ||
|
|
160a5f2fdd | ||
|
|
35a228f78f | ||
|
|
b5770acd50 | ||
|
|
47e11fa3f2 | ||
|
|
68e92d215a | ||
|
|
65f558d6df | ||
|
|
b21ba566ae | ||
|
|
9fdc881005 | ||
|
|
0464a50ab8 | ||
|
|
64a8c38d2f | ||
|
|
436cdf1fc8 | ||
|
|
ee69a0dc29 | ||
|
|
8946b41d20 | ||
|
|
e56d2c63c3 | ||
|
|
3a4a15cc93 | ||
|
|
b9eac7c6dc | ||
|
|
4610aa7ae3 | ||
|
|
56911a86ea | ||
|
|
818bee3961 | ||
|
|
3878c4781e | ||
|
|
04db99749b | ||
|
|
d3179709b1 | ||
|
|
25656a10cb | ||
|
|
ae1f7bd695 | ||
|
|
b93d7dd3cb | ||
|
|
6e2a96c133 | ||
|
|
f70aa8fabe | ||
|
|
25909b06d2 | ||
|
|
2860de7bf4 | ||
|
|
f536fd55d8 | ||
|
|
06a3c0cb26 | ||
|
|
8c6b5e52fd | ||
|
|
ac5e77ea3b | ||
|
|
879eb9c348 | ||
|
|
349dc568ea | ||
|
|
1d79f55a46 | ||
|
|
db0993f500 | ||
|
|
0243ae4654 | ||
|
|
937d60f239 | ||
|
|
95462493ef | ||
|
|
c656633bea | ||
|
|
b7a44983b4 | ||
|
|
74aa934441 | ||
|
|
d7a70c67ba | ||
|
|
a0c298a539 | ||
|
|
abac4b1758 | ||
|
|
47e899cf75 | ||
|
|
64686b53ff | ||
|
|
ef5cea0e06 | ||
|
|
cd4c8ecbf3 | ||
|
|
838fd61f29 | ||
|
|
02e7bc7e0a | ||
|
|
40505e645a | ||
|
|
25e5a92286 | ||
|
|
8bc0089fc4 | ||
|
|
2545b24118 | ||
|
|
f30f4b6892 | ||
|
|
c3dc27e37e | ||
|
|
73fd634209 | ||
|
|
2d9062bfc1 | ||
|
|
13889b6554 | ||
|
|
8d199b1bbc | ||
|
|
3677418225 | ||
|
|
6b8f9b50b9 | ||
|
|
d79398a1d5 | ||
|
|
4fd2eecb8b | ||
|
|
cd756e6f01 | ||
|
|
77854d561b | ||
|
|
1b5d1d074e | ||
|
|
dfa141818b | ||
|
|
d236c57600 | ||
|
|
ef4cec9382 | ||
|
|
54fb4c04e3 | ||
|
|
fe451b8dc7 | ||
|
|
853bfc3562 | ||
|
|
53c28a8ec9 | ||
|
|
dc7ba33b51 | ||
|
|
d068d61f3c | ||
|
|
af326753a9 | ||
|
|
3cbbaa62db | ||
|
|
9a3dbf3122 | ||
|
|
d4583fa64c | ||
|
|
9209807d66 | ||
|
|
311df31fb1 | ||
|
|
a0c1a3f736 | ||
|
|
e1e8cc3851 | ||
|
|
6a8c461e38 | ||
|
|
67d3c6aa71 | ||
|
|
c409f45ddd | ||
|
|
70e4845915 | ||
|
|
90adac8f09 | ||
|
|
58640824d1 | ||
|
|
2fd2950eb5 | ||
|
|
30ae019095 | ||
|
|
8476f12432 | ||
|
|
79c2b81ffd | ||
|
|
46e13313e4 | ||
|
|
c93c9c099e | ||
|
|
cc465efa67 | ||
|
|
b427ddce88 | ||
|
|
beeb9e0a1b | ||
|
|
4bc69fec62 | ||
|
|
b67245d71e | ||
|
|
ec9d1a6b8f | ||
|
|
06ca147a82 | ||
|
|
7af1fd3ffb | ||
|
|
b4a3bc1ffe | ||
|
|
7f55f0a264 | ||
|
|
2f25e9bdf8 | ||
|
|
421b599541 | ||
|
|
a303940372 | ||
|
|
a77b202767 | ||
|
|
e75858ce5e | ||
|
|
101e394475 | ||
|
|
0d58bc9384 | ||
|
|
6098811b49 | ||
|
|
86c309ea75 | ||
|
|
94d8acb7d0 | ||
|
|
ae7c63cc35 | ||
|
|
200be7d20c | ||
|
|
01ef44fa4f | ||
|
|
d62e302768 | ||
|
|
6bcc4884c2 | ||
|
|
d4dbb3f46e | ||
|
|
bcd15b4dd2 | ||
|
|
1e1a9f3999 | ||
|
|
3e49aff35c | ||
|
|
6776229047 | ||
|
|
70aa3b4011 | ||
|
|
e7e5316340 | ||
|
|
02e8741457 | ||
|
|
f94b2e73e1 | ||
|
|
e8fc050b6e | ||
|
|
320072c8dc | ||
|
|
821f30f735 | ||
|
|
90fd8f8cda | ||
|
|
acf59f6b68 | ||
|
|
b181859629 | ||
|
|
9a069faa01 | ||
|
|
a990c497b5 | ||
|
|
5af0cfd902 | ||
|
|
acf2ce35f7 | ||
|
|
8706c36fc0 | ||
|
|
d6b6775888 | ||
|
|
73ed748deb | ||
|
|
5ad545dcc1 | ||
|
|
3a77ade6b2 | ||
|
|
d7b96a424f | ||
|
|
ef478ade64 | ||
|
|
af4d32357c | ||
|
|
78b8fc3e4f | ||
|
|
8b90d4abe0 | ||
|
|
59e0d9618b | ||
|
|
78d96dad2a | ||
|
|
c136dd2b32 | ||
|
|
6af49b7885 | ||
|
|
80fb1c74f0 | ||
|
|
b749d6f1cb | ||
|
|
e74069e4c2 | ||
|
|
8157af6d68 | ||
|
|
3af407340e | ||
|
|
88959f5595 | ||
|
|
1d6a0c7b52 | ||
|
|
c461999b2b | ||
|
|
e1b1608dc6 | ||
|
|
d16dc22fdf | ||
|
|
5ca979b1e2 | ||
|
|
f3c192c63d | ||
|
|
61275df7da | ||
|
|
d9b4413bc9 | ||
|
|
cb95b1d2e7 | ||
|
|
058f13bdf9 | ||
|
|
0e76d965f1 | ||
|
|
7996fadb91 | ||
|
|
23d6f4eac9 | ||
|
|
ec1dd0bf61 | ||
|
|
790fa7102e | ||
|
|
761efbb457 | ||
|
|
661eb39ecc | ||
|
|
38b4ae1c0e | ||
|
|
d21442941c | ||
|
|
08821f82b6 | ||
|
|
19fdbac287 | ||
|
|
5fc983a1bb | ||
|
|
b124c49ea4 | ||
|
|
8bf8c0f251 | ||
|
|
cb8e1706b2 | ||
|
|
d3df4674f9 | ||
|
|
932abe6d5c | ||
|
|
15a0ac2735 | ||
|
|
c4df0f95ae | ||
|
|
fa170b9ace | ||
|
|
eb9b1ad68d | ||
|
|
ae7a2b9f02 | ||
|
|
c81c6e5eb7 | ||
|
|
5bfa014505 | ||
|
|
25f6851ca1 | ||
|
|
d437445c67 | ||
|
|
1f6fb8c290 | ||
|
|
96990b2ea7 | ||
|
|
7577dfa575 | ||
|
|
259c04f41c | ||
|
|
fa88cb62e1 | ||
|
|
15b99f2e7a | ||
|
|
55ed7d16f7 | ||
|
|
e059a88533 | ||
|
|
d5e18feed9 | ||
|
|
27b4d6390b | ||
|
|
8e0d48a0f6 | ||
|
|
8bd2349ab6 | ||
|
|
00c66e7096 | ||
|
|
8f5b8fd769 | ||
|
|
6de188d025 | ||
|
|
7bdb2e79ed | ||
|
|
c9bcc12265 | ||
|
|
db246b82ac | ||
|
|
d3b50b9c47 | ||
|
|
45e8b7a5bd | ||
|
|
ce06b03fac | ||
|
|
91cc414588 | ||
|
|
751f595bb6 | ||
|
|
5a1fa18509 | ||
|
|
c71d0f5e7f | ||
|
|
f513a807db | ||
|
|
4ce941bbc2 | ||
|
|
d17226910d | ||
|
|
81e47277e7 | ||
|
|
a18188ae90 | ||
|
|
6b04b7cf18 | ||
|
|
8d780e0607 | ||
|
|
f175e38666 | ||
|
|
f137b3057a | ||
|
|
33099355b8 | ||
|
|
22f5aeab07 | ||
|
|
a2c3197f42 | ||
|
|
f5555a6d26 | ||
|
|
e5c3253642 | ||
|
|
0fc763bc55 | ||
|
|
8906e9e0fd | ||
|
|
b66e977acd | ||
|
|
6755ff63e1 | ||
|
|
21a2cd7bc3 | ||
|
|
8121706b89 | ||
|
|
2b08f21625 | ||
|
|
f1fc083f2b | ||
|
|
acca56b6a5 | ||
|
|
c78e559e88 | ||
|
|
9c8721922b | ||
|
|
649ff5f9f9 | ||
|
|
43326d11d8 | ||
|
|
2a8c3a2cf6 | ||
|
|
94b76ce9a4 | ||
|
|
23389e9491 | ||
|
|
063b90b97d | ||
|
|
f4bd54fedd | ||
|
|
bd42fc94cc | ||
|
|
965ce12947 | ||
|
|
42af13c141 | ||
|
|
60f30036f1 | ||
|
|
8aaf4ea098 | ||
|
|
0eff7de659 | ||
|
|
8ced72ab10 | ||
|
|
13134f9d64 | ||
|
|
88f6c7a9f3 | ||
|
|
e6bea3961f | ||
|
|
4db7837d06 | ||
|
|
63ed3f3575 | ||
|
|
f2294851e6 | ||
|
|
c6af8f16f6 | ||
|
|
5ad1640984 | ||
|
|
2b0200d429 | ||
|
|
84636fc2af | ||
|
|
7845434270 | ||
|
|
9c9292949f | ||
|
|
0f621b4956 | ||
|
|
36ab9c64ef | ||
|
|
d9df20d102 | ||
|
|
348f322df1 | ||
|
|
f181037bed | ||
|
|
5a4d5f03b0 | ||
|
|
3ac43582c2 | ||
|
|
fa0704138d | ||
|
|
52317bb7df | ||
|
|
2e1535389a | ||
|
|
2bbef6b5cf | ||
|
|
569ce6c7b4 | ||
|
|
64e2d6b672 | ||
|
|
83ddb1501f | ||
|
|
f1f281b318 | ||
|
|
395e015282 | ||
|
|
6c8f2227cd | ||
|
|
ac2b5e57cf | ||
|
|
da4c404f3d | ||
|
|
af0acc9a75 | ||
|
|
2cbfcd2327 | ||
|
|
b927da73c1 | ||
|
|
f7ac2969ef | ||
|
|
2a6da319b2 | ||
|
|
9322b40df1 | ||
|
|
2c9084d48c | ||
|
|
4f0692c437 | ||
|
|
99448eedca | ||
|
|
a667ed945f | ||
|
|
05df7996a4 | ||
|
|
a4035af337 | ||
|
|
5b3fe4ae27 | ||
|
|
144991990e | ||
|
|
696b6990ea | ||
|
|
069fb54253 | ||
|
|
76a279ef68 | ||
|
|
7fbf705c41 | ||
|
|
1dda7d6486 | ||
|
|
0e54c32452 | ||
|
|
30e69c518b | ||
|
|
eb80fefd1d | ||
|
|
19345908cb | ||
|
|
8c37e5c526 | ||
|
|
8de325f256 | ||
|
|
e41ec5b42e | ||
|
|
678031f9b3 | ||
|
|
f31b65825f | ||
|
|
6916fc76bd | ||
|
|
a52d716c88 | ||
|
|
5ae2c1552b | ||
|
|
48698403a8 | ||
|
|
4831b4fa96 | ||
|
|
1187dc3217 | ||
|
|
3dac139b00 | ||
|
|
da78b5c130 | ||
|
|
027452fef8 | ||
|
|
67fa5a23b9 | ||
|
|
b2d9a2dc79 | ||
|
|
6b8ad5a9b1 | ||
|
|
07385c3662 | ||
|
|
485aafc1b7 | ||
|
|
b17177bd20 | ||
|
|
8fe79e153d |
133
.github/workflows/ci-build.yml
vendored
133
.github/workflows/ci-build.yml
vendored
@@ -39,7 +39,7 @@ jobs:
|
||||
|
||||
echo "::group::Build"
|
||||
echo "Running on $(nproc) cores"
|
||||
make -j$(nproc) tools
|
||||
cmake --build . -j $(nproc) --target tools
|
||||
echo "::endgroup::"
|
||||
|
||||
- name: Install GCC problem matcher
|
||||
@@ -56,7 +56,7 @@ jobs:
|
||||
|
||||
echo "::group::Build"
|
||||
echo "Running on $(nproc) cores"
|
||||
emmake make -j$(nproc)
|
||||
cmake --build . -j $(nproc)
|
||||
echo "::endgroup::"
|
||||
|
||||
linux:
|
||||
@@ -66,10 +66,18 @@ jobs:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
include:
|
||||
- compiler: clang
|
||||
cxxcompiler: clang++
|
||||
- compiler: gcc
|
||||
cxxcompiler: g++
|
||||
- compiler: clang
|
||||
cxxcompiler: clang++
|
||||
libsdl: libsdl2-dev
|
||||
- compiler: gcc
|
||||
cxxcompiler: g++
|
||||
libsdl: libsdl2-dev
|
||||
- compiler: gcc
|
||||
cxxcompiler: g++
|
||||
libsdl: libsdl1.2-dev
|
||||
- compiler: gcc
|
||||
cxxcompiler: g++
|
||||
extra-cmake-parameters: -DOPTION_DEDICATED=ON
|
||||
|
||||
runs-on: ubuntu-20.04
|
||||
env:
|
||||
@@ -88,12 +96,12 @@ jobs:
|
||||
|
||||
echo "::group::Install dependencies"
|
||||
sudo apt-get install -y --no-install-recommends \
|
||||
liballegro4-dev \
|
||||
libfontconfig-dev \
|
||||
libicu-dev \
|
||||
liblzma-dev \
|
||||
liblzo2-dev \
|
||||
libsdl1.2-dev \
|
||||
libsdl2-dev \
|
||||
${{ matrix.libsdl }} \
|
||||
zlib1g-dev \
|
||||
# EOF
|
||||
echo "::endgroup::"
|
||||
@@ -124,18 +132,18 @@ jobs:
|
||||
cd build
|
||||
|
||||
echo "::group::CMake"
|
||||
cmake ..
|
||||
cmake .. ${{ matrix.extra-cmake-parameters }}
|
||||
echo "::endgroup::"
|
||||
|
||||
echo "::group::Build"
|
||||
echo "Running on $(nproc) cores"
|
||||
make -j$(nproc)
|
||||
cmake --build . -j $(nproc)
|
||||
echo "::endgroup::"
|
||||
|
||||
- name: Test
|
||||
run: |
|
||||
cd build
|
||||
make -j$(nproc) test
|
||||
ctest -j $(nproc) --timeout 120
|
||||
|
||||
macos:
|
||||
name: Mac OS
|
||||
@@ -155,13 +163,27 @@ jobs:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v2
|
||||
|
||||
- name: Prepare vcpkg (with cache)
|
||||
uses: lukka/run-vcpkg@v6
|
||||
- name: Prepare cache key
|
||||
id: key
|
||||
run: |
|
||||
echo "::set-output name=image::$ImageOS-$ImageVersion"
|
||||
|
||||
- name: Enable vcpkg cache
|
||||
uses: actions/cache@v2
|
||||
with:
|
||||
vcpkgDirectory: '/usr/local/share/vcpkg'
|
||||
doNotUpdateVcpkg: true
|
||||
vcpkgArguments: 'freetype liblzma lzo'
|
||||
vcpkgTriplet: '${{ matrix.arch }}-osx'
|
||||
path: /usr/local/share/vcpkg/installed
|
||||
key: ${{ steps.key.outputs.image }}-vcpkg-${{ matrix.arch }}-0 # Increase the number whenever dependencies are modified
|
||||
restore-keys: |
|
||||
${{ steps.key.outputs.image }}-vcpkg-${{ matrix.arch }}
|
||||
|
||||
- name: Prepare vcpkg
|
||||
run: |
|
||||
vcpkg install --triplet=${{ matrix.arch }}-osx \
|
||||
liblzma \
|
||||
libpng \
|
||||
lzo \
|
||||
zlib \
|
||||
# EOF
|
||||
|
||||
- name: Install OpenGFX
|
||||
run: |
|
||||
@@ -196,13 +218,13 @@ jobs:
|
||||
|
||||
echo "::group::Build"
|
||||
echo "Running on $(sysctl -n hw.logicalcpu) cores"
|
||||
make -j$(sysctl -n hw.logicalcpu)
|
||||
cmake --build . -j $(sysctl -n hw.logicalcpu)
|
||||
echo "::endgroup::"
|
||||
|
||||
- name: Test
|
||||
run: |
|
||||
cd build
|
||||
make -j$(sysctl -n hw.logicalcpu) test
|
||||
ctest -j $(sysctl -n hw.logicalcpu) --timeout 120
|
||||
|
||||
windows:
|
||||
name: Windows
|
||||
@@ -210,35 +232,41 @@ jobs:
|
||||
strategy:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
include:
|
||||
- arch: x86
|
||||
- arch: x64
|
||||
os: [windows-latest, windows-2016]
|
||||
arch: [x86, x64]
|
||||
|
||||
runs-on: windows-latest
|
||||
runs-on: ${{ matrix.os }}
|
||||
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v2
|
||||
|
||||
# "restore-cache" which is done by "run-vcpkg" uses Windows tar.
|
||||
# A git clone on windows marks a few files as read-only; when Windows tar
|
||||
# tries to extract the cache over this folder, it fails, despite the files
|
||||
# being identical. This failure shows up as an warning in the logs. We
|
||||
# avoid this by simply removing the read-only mark from the git folder.
|
||||
# In other words: this is a hack!
|
||||
# See: https://github.com/lukka/run-vcpkg/issues/61
|
||||
- name: Remove read-only flag from vcpkg git folder
|
||||
- name: Prepare cache key
|
||||
id: key
|
||||
shell: powershell
|
||||
run: |
|
||||
attrib -r "c:\vcpkg\.git\*.*" /s
|
||||
# Work around caching failure with GNU tar
|
||||
New-Item -Type Junction -Path vcpkg -Target c:\vcpkg
|
||||
|
||||
- name: Prepare vcpkg (with cache)
|
||||
uses: lukka/run-vcpkg@v6
|
||||
Write-Output "::set-output name=image::$env:ImageOS-$env:ImageVersion"
|
||||
|
||||
- name: Enable vcpkg cache
|
||||
uses: actions/cache@v2
|
||||
with:
|
||||
vcpkgDirectory: 'c:/vcpkg'
|
||||
doNotUpdateVcpkg: true
|
||||
vcpkgArguments: 'liblzma libpng lzo zlib'
|
||||
vcpkgTriplet: '${{ matrix.arch }}-windows-static'
|
||||
path: vcpkg/installed
|
||||
key: ${{ steps.key.outputs.image }}-vcpkg-${{ matrix.arch }}-0 # Increase the number whenever dependencies are modified
|
||||
restore-keys: |
|
||||
${{ steps.key.outputs.image }}-vcpkg-${{ matrix.arch }}
|
||||
|
||||
- name: Prepare vcpkg
|
||||
shell: bash
|
||||
run: |
|
||||
vcpkg install --triplet=${{ matrix.arch }}-windows-static \
|
||||
liblzma \
|
||||
libpng \
|
||||
lzo \
|
||||
zlib \
|
||||
# EOF
|
||||
|
||||
- name: Install OpenGFX
|
||||
shell: bash
|
||||
@@ -259,16 +287,31 @@ jobs:
|
||||
- name: Install MSVC problem matcher
|
||||
uses: ammaraskar/msvc-problem-matcher@master
|
||||
|
||||
- name: Build
|
||||
uses: lukka/run-cmake@v3
|
||||
- name: Configure developer command prompt for ${{ matrix.arch }}
|
||||
uses: ilammy/msvc-dev-cmd@v1
|
||||
with:
|
||||
cmakeListsOrSettingsJson: CMakeListsTxtAdvanced
|
||||
useVcpkgToolchainFile: true
|
||||
buildDirectory: '${{ github.workspace }}/build'
|
||||
cmakeAppendedArgs: ' -GNinja'
|
||||
arch: ${{ matrix.arch }}
|
||||
|
||||
- name: Build
|
||||
shell: bash
|
||||
run: |
|
||||
mkdir build
|
||||
cd build
|
||||
|
||||
echo "::group::CMake"
|
||||
cmake .. \
|
||||
-GNinja \
|
||||
-DVCPKG_TARGET_TRIPLET=${{ matrix.arch }}-windows-static \
|
||||
-DCMAKE_TOOLCHAIN_FILE="c:\vcpkg\scripts\buildsystems\vcpkg.cmake" \
|
||||
# EOF
|
||||
echo "::endgroup::"
|
||||
|
||||
echo "::group::Build"
|
||||
cmake --build .
|
||||
echo "::endgroup::"
|
||||
|
||||
- name: Test
|
||||
shell: bash
|
||||
run: |
|
||||
cd ${GITHUB_WORKSPACE}/build
|
||||
ctest -C Debug
|
||||
ctest --timeout 120
|
||||
|
||||
421
.github/workflows/release.yml
vendored
421
.github/workflows/release.yml
vendored
@@ -96,7 +96,7 @@ jobs:
|
||||
TZ='UTC' date +"%Y-%m-%d %H:%M UTC" > .release_date
|
||||
cat .ottdrev | cut -f 1 -d$'\t' > .version
|
||||
|
||||
if [ $(cat .ottdrev | cut -f 6 -d$'\t') = '1' ]; then
|
||||
if [ $(cat .ottdrev | cut -f 5 -d$'\t') = '1' ]; then
|
||||
# Assume that all tags are always releases. Why else make a tag?
|
||||
IS_TAG="true"
|
||||
|
||||
@@ -230,7 +230,7 @@ jobs:
|
||||
echo "::endgroup::"
|
||||
|
||||
echo "::group::Build"
|
||||
make docs
|
||||
cmake --build . --target docs
|
||||
echo "::endgroup::"
|
||||
|
||||
- name: Create bundles
|
||||
@@ -265,7 +265,104 @@ jobs:
|
||||
retention-days: 5
|
||||
|
||||
linux:
|
||||
name: Linux
|
||||
name: Linux (Generic)
|
||||
needs: source
|
||||
|
||||
runs-on: ubuntu-20.04
|
||||
container:
|
||||
# manylinux2014 is based on CentOS 7, but already has a lot of things
|
||||
# installed and preconfigured. It makes it easier to build OpenTTD.
|
||||
image: quay.io/pypa/manylinux2014_x86_64
|
||||
|
||||
steps:
|
||||
- name: Download source
|
||||
uses: actions/download-artifact@v2
|
||||
with:
|
||||
name: internal-source
|
||||
|
||||
- name: Unpack source
|
||||
run: |
|
||||
tar -xf source.tar.gz --strip-components=1
|
||||
|
||||
- name: Install dependencies
|
||||
run: |
|
||||
echo "::group::Install dependencies"
|
||||
yum install -y \
|
||||
fontconfig-devel \
|
||||
freetype-devel \
|
||||
libicu-devel \
|
||||
libpng-devel \
|
||||
libpng-devel \
|
||||
lzo-devel \
|
||||
SDL2-devel \
|
||||
wget \
|
||||
xz-devel \
|
||||
zlib-devel \
|
||||
# EOF
|
||||
echo "::endgroup::"
|
||||
|
||||
# The yum variant of fluidsynth depends on all possible audio drivers,
|
||||
# like jack, ALSA, pulseaudio, etc. This is not really useful for us,
|
||||
# as we route the output of fluidsynth back via our sound driver, and
|
||||
# as such do not use these audio driver outputs at all. So instead,
|
||||
# we compile fluidsynth ourselves, with as little dependencies as
|
||||
# possible. This currently means it picks up SDL2, but this is fine,
|
||||
# as we need SDL2 anyway.
|
||||
echo "::group::Install fluidsynth"
|
||||
wget https://github.com/FluidSynth/fluidsynth/archive/v2.1.6.tar.gz
|
||||
tar xf v2.1.6.tar.gz
|
||||
(
|
||||
cd fluidsynth-2.1.6
|
||||
mkdir build
|
||||
cd build
|
||||
cmake .. -DCMAKE_BUILD_TYPE=RelWithDebInfo -DCMAKE_INSTALL_PREFIX=/usr
|
||||
cmake --build . -j $(nproc)
|
||||
cmake --install .
|
||||
)
|
||||
echo "::endgroup::"
|
||||
|
||||
- name: Install GCC problem matcher
|
||||
uses: ammaraskar/gcc-problem-matcher@master
|
||||
|
||||
- name: Build
|
||||
run: |
|
||||
mkdir -p build
|
||||
cd build
|
||||
|
||||
echo "::group::CMake"
|
||||
cmake ${GITHUB_WORKSPACE} \
|
||||
-DCMAKE_BUILD_TYPE=RelWithDebInfo \
|
||||
-DOPTION_PACKAGE_DEPENDENCIES=ON \
|
||||
# EOF
|
||||
echo "::endgroup::"
|
||||
|
||||
echo "::group::Build"
|
||||
echo "Running on $(nproc) cores"
|
||||
cmake --build . -j $(nproc)
|
||||
echo "::endgroup::"
|
||||
|
||||
- name: Create bundles
|
||||
run: |
|
||||
cd ${GITHUB_WORKSPACE}/build
|
||||
echo "::group::Run CPack"
|
||||
cpack
|
||||
echo "::endgroup::"
|
||||
|
||||
echo "::group::Cleanup"
|
||||
# Remove the sha256 files CPack generates; we will do this ourself at
|
||||
# the end of this workflow.
|
||||
rm -f bundles/*.sha256
|
||||
echo "::endgroup::"
|
||||
|
||||
- name: Store bundles
|
||||
uses: actions/upload-artifact@v2
|
||||
with:
|
||||
name: openttd-linux-generic
|
||||
path: build/bundles
|
||||
retention-days: 5
|
||||
|
||||
linux-distro:
|
||||
name: Linux (Distros)
|
||||
needs: source
|
||||
|
||||
if: needs.source.outputs.is_tag == 'true'
|
||||
@@ -282,6 +379,8 @@ jobs:
|
||||
bundle_name: "groovy"
|
||||
- container_image: "debian:buster"
|
||||
bundle_name: "buster"
|
||||
- container_image: "debian:bullseye"
|
||||
bundle_name: "bullseye"
|
||||
|
||||
runs-on: ubuntu-20.04
|
||||
container:
|
||||
@@ -317,7 +416,6 @@ jobs:
|
||||
liblzma-dev \
|
||||
liblzo2-dev \
|
||||
libsdl2-dev \
|
||||
libxdg-basedir-dev \
|
||||
lsb-release \
|
||||
zlib1g-dev \
|
||||
# EOF
|
||||
@@ -342,12 +440,22 @@ jobs:
|
||||
|
||||
echo "::group::Build"
|
||||
echo "Running on $(nproc) cores"
|
||||
make -j$(nproc) package
|
||||
# Ubuntu 18.04 cmake does not support -j so we pass the option to the native tool
|
||||
cmake --build . -- -j $(nproc)
|
||||
echo "::endgroup::"
|
||||
|
||||
- name: Create bundles
|
||||
run: |
|
||||
cd ${GITHUB_WORKSPACE}/build
|
||||
echo "::group::Run CPack"
|
||||
cpack
|
||||
echo "::endgroup::"
|
||||
|
||||
echo "::group::Cleanup"
|
||||
# Remove the sha256 files CPack generates; we will do this ourself at
|
||||
# the end of this workflow.
|
||||
rm -f bundles/*.sha256
|
||||
echo "::endgroup::"
|
||||
|
||||
- name: Store bundles
|
||||
uses: actions/upload-artifact@v2
|
||||
@@ -374,21 +482,42 @@ jobs:
|
||||
run: |
|
||||
tar -xf source.tar.gz --strip-components=1
|
||||
|
||||
# The following step can be removed when the build VM is updated with a revision of
|
||||
# vcpkg dating from roughly 01/01/2021 or later. At that point, `doNotUpdateVcpkg`
|
||||
# can be set to `true` and the `vcpkgGitCommitId` can be removed.
|
||||
- name: Update vcpkg
|
||||
- name: Install dependencies
|
||||
env:
|
||||
HOMEBREW_NO_AUTO_UPDATE: 1
|
||||
HOMEBREW_NO_INSTALL_CLEANUP: 1
|
||||
run: |
|
||||
cd /usr/local/share/vcpkg
|
||||
git fetch --unshallow
|
||||
brew install pandoc
|
||||
|
||||
- name: Prepare vcpkg (with cache)
|
||||
uses: lukka/run-vcpkg@v6
|
||||
- name: Prepare cache key
|
||||
id: key
|
||||
run: |
|
||||
echo "::set-output name=image::$ImageOS-$ImageVersion"
|
||||
|
||||
- name: Enable vcpkg cache
|
||||
uses: actions/cache@v2
|
||||
with:
|
||||
vcpkgDirectory: '/usr/local/share/vcpkg'
|
||||
doNotUpdateVcpkg: false
|
||||
vcpkgGitCommitId: 2a42024b53ebb512fb5dd63c523338bf26c8489c
|
||||
vcpkgArguments: 'freetype:x64-osx liblzma:x64-osx lzo:x64-osx freetype:arm64-osx liblzma:arm64-osx lzo:arm64-osx'
|
||||
path: /usr/local/share/vcpkg/installed
|
||||
key: ${{ steps.key.outputs.image }}-vcpkg-release-0 # Increase the number whenever dependencies are modified
|
||||
restore-keys: |
|
||||
${{ steps.key.outputs.image }}-vcpkg-release
|
||||
${{ steps.key.outputs.image }}-vcpkg-x64
|
||||
|
||||
- name: Prepare vcpkg
|
||||
run: |
|
||||
vcpkg install \
|
||||
liblzma:x64-osx \
|
||||
liblzma:arm64-osx \
|
||||
libpng:x64-osx \
|
||||
libpng:arm64-osx \
|
||||
lzo:x64-osx \
|
||||
lzo:arm64-osx \
|
||||
zlib:x64-osx \
|
||||
zlib:arm64-osx \
|
||||
# EOF
|
||||
|
||||
- name: Install GCC problem matcher
|
||||
uses: ammaraskar/gcc-problem-matcher@master
|
||||
|
||||
- name: Build tools
|
||||
run: |
|
||||
@@ -404,12 +533,9 @@ jobs:
|
||||
|
||||
echo "::group::Build tools"
|
||||
echo "Running on $(sysctl -n hw.logicalcpu) cores"
|
||||
make -j$(sysctl -n hw.logicalcpu) tools
|
||||
cmake --build . -j $(sysctl -n hw.logicalcpu) --target tools
|
||||
echo "::endgroup::"
|
||||
|
||||
- name: Install GCC problem matcher
|
||||
uses: ammaraskar/gcc-problem-matcher@master
|
||||
|
||||
- name: Import code signing certificates
|
||||
uses: Apple-Actions/import-codesign-certs@v1
|
||||
with:
|
||||
@@ -437,7 +563,7 @@ jobs:
|
||||
|
||||
echo "::group::Build"
|
||||
echo "Running on $(sysctl -n hw.logicalcpu) cores"
|
||||
make -j$(sysctl -n hw.logicalcpu)
|
||||
cmake --build . -j $(sysctl -n hw.logicalcpu)
|
||||
echo "::endgroup::"
|
||||
|
||||
- name: Build x64
|
||||
@@ -460,25 +586,28 @@ jobs:
|
||||
|
||||
echo "::group::Build"
|
||||
echo "Running on $(sysctl -n hw.logicalcpu) cores"
|
||||
make -j$(sysctl -n hw.logicalcpu)
|
||||
cmake --build . -j $(sysctl -n hw.logicalcpu)
|
||||
echo "::endgroup::"
|
||||
|
||||
- name: Build package
|
||||
- name: Create bundles
|
||||
run: |
|
||||
cd build-x64
|
||||
|
||||
echo "::group::Create universal binary"
|
||||
# Combine the `openttd` binaries from each build into a single file
|
||||
lipo -create -output openttd-universal ../build-*/openttd
|
||||
mv openttd-universal openttd
|
||||
|
||||
echo "::group::Build"
|
||||
echo "Running on $(sysctl -n hw.logicalcpu) cores"
|
||||
make -j$(sysctl -n hw.logicalcpu) package
|
||||
echo "::endgroup::"
|
||||
|
||||
echo "::group::Run CPack"
|
||||
cpack
|
||||
echo "::endgroup::"
|
||||
|
||||
echo "::group::Cleanup"
|
||||
# Remove the sha256 files CPack generates; we will do this ourself at
|
||||
# the end of this workflow.
|
||||
rm -f bundles/*.sha256
|
||||
echo "::endgroup::"
|
||||
|
||||
- name: Install gon
|
||||
env:
|
||||
@@ -496,6 +625,29 @@ jobs:
|
||||
cd build-x64
|
||||
../os/macosx/notarize.sh
|
||||
|
||||
- name: Build zip
|
||||
run: |
|
||||
cd build-x64
|
||||
|
||||
pushd _CPack_Packages/*/Bundle/openttd-*/
|
||||
|
||||
# Remove the Applications symlink from the staging folder
|
||||
rm -f Applications
|
||||
|
||||
# Remove the original dmg built by CPack to avoid a conflict when resolving
|
||||
# the zip_filename variable below
|
||||
rm -f ../*.dmg
|
||||
|
||||
zip_filename=(../openttd-*)
|
||||
|
||||
# Package up the existing, notarised .app into a zip file
|
||||
zip -r -9 ${zip_filename}.zip OpenTTD.app
|
||||
|
||||
popd
|
||||
|
||||
# Now move it into place to be uploaded
|
||||
mv _CPack_Packages/*/Bundle/openttd-*.zip bundles/
|
||||
|
||||
- name: Store bundles
|
||||
uses: actions/upload-artifact@v2
|
||||
with:
|
||||
@@ -512,8 +664,11 @@ jobs:
|
||||
matrix:
|
||||
include:
|
||||
- arch: x86
|
||||
host: x86
|
||||
- arch: x64
|
||||
host: x64
|
||||
- arch: arm64
|
||||
host: x64_arm64
|
||||
|
||||
runs-on: windows-latest
|
||||
|
||||
@@ -528,55 +683,111 @@ jobs:
|
||||
run: |
|
||||
tar -xf source.tar.gz --strip-components=1
|
||||
|
||||
# "restore-cache" which is done by "run-vcpkg" uses Windows tar.
|
||||
# A git clone on windows marks a few files as read-only; when Windows tar
|
||||
# tries to extract the cache over this folder, it fails, despite the files
|
||||
# being identical. This failure shows up as an warning in the logs. We
|
||||
# avoid this by simply removing the read-only mark from the git folder.
|
||||
# In other words: this is a hack!
|
||||
# See: https://github.com/lukka/run-vcpkg/issues/61
|
||||
- name: Remove read-only flag from vcpkg git folder
|
||||
- name: Install dependencies
|
||||
shell: bash
|
||||
run: |
|
||||
choco install pandoc
|
||||
|
||||
- name: Prepare cache key
|
||||
id: key
|
||||
shell: powershell
|
||||
run: |
|
||||
attrib -r "c:\vcpkg\.git\*.*" /s
|
||||
# Work around caching failure with GNU tar
|
||||
New-Item -Type Junction -Path vcpkg -Target c:\vcpkg
|
||||
|
||||
- name: Prepare vcpkg (with cache)
|
||||
uses: lukka/run-vcpkg@v6
|
||||
with:
|
||||
vcpkgDirectory: 'c:/vcpkg'
|
||||
doNotUpdateVcpkg: true
|
||||
vcpkgArguments: 'liblzma libpng lzo zlib'
|
||||
vcpkgTriplet: '${{ matrix.arch }}-windows-static'
|
||||
Write-Output "::set-output name=image::$env:ImageOS-$env:ImageVersion"
|
||||
|
||||
- name: Build tools
|
||||
uses: lukka/run-cmake@v3
|
||||
- name: Enable vcpkg cache
|
||||
uses: actions/cache@v2
|
||||
with:
|
||||
cmakeListsOrSettingsJson: CMakeListsTxtAdvanced
|
||||
useVcpkgToolchainFile: false
|
||||
buildDirectory: '${{ github.workspace }}/build-host'
|
||||
buildWithCMakeArgs: '--target tools'
|
||||
cmakeAppendedArgs: ' -GNinja -DOPTION_TOOLS_ONLY=ON -DCMAKE_BUILD_TYPE=RelWithDebInfo'
|
||||
path: vcpkg/installed
|
||||
key: ${{ steps.key.outputs.image }}-vcpkg-${{ matrix.arch }}-0 # Increase the number whenever dependencies are modified
|
||||
restore-keys: |
|
||||
${{ steps.key.outputs.image }}-vcpkg-${{ matrix.arch }}
|
||||
|
||||
- name: Prepare vcpkg
|
||||
shell: bash
|
||||
run: |
|
||||
vcpkg install --triplet=${{ matrix.arch }}-windows-static \
|
||||
liblzma \
|
||||
libpng \
|
||||
lzo \
|
||||
zlib \
|
||||
# EOF
|
||||
|
||||
- name: Install MSVC problem matcher
|
||||
uses: ammaraskar/msvc-problem-matcher@master
|
||||
|
||||
- name: Configure developer command prompt for tools
|
||||
uses: ilammy/msvc-dev-cmd@v1
|
||||
with:
|
||||
arch: x64
|
||||
|
||||
- name: Build tools
|
||||
shell: bash
|
||||
run: |
|
||||
mkdir build-host
|
||||
cd build-host
|
||||
|
||||
echo "::group::CMake"
|
||||
cmake ${GITHUB_WORKSPACE} \
|
||||
-GNinja \
|
||||
-DOPTION_TOOLS_ONLY=ON \
|
||||
-DCMAKE_BUILD_TYPE=RelWithDebInfo \
|
||||
# EOF
|
||||
echo "::endgroup::"
|
||||
|
||||
echo "::group::Build"
|
||||
cmake --build . --target tools
|
||||
echo "::endgroup::"
|
||||
|
||||
- name: Configure developer command prompt for ${{ matrix.arch }}
|
||||
uses: ilammy/msvc-dev-cmd@v1
|
||||
with:
|
||||
arch: ${{ matrix.host }}
|
||||
|
||||
- name: Build (with installer)
|
||||
if: needs.source.outputs.is_tag == 'true'
|
||||
uses: lukka/run-cmake@v3
|
||||
with:
|
||||
cmakeListsOrSettingsJson: CMakeListsTxtAdvanced
|
||||
useVcpkgToolchainFile: true
|
||||
buildDirectory: '${{ github.workspace }}/build'
|
||||
cmakeAppendedArgs: ' -GNinja -DOPTION_USE_NSIS=ON -DHOST_BINARY_DIR=${{ github.workspace }}/build-host -DCMAKE_BUILD_TYPE=RelWithDebInfo'
|
||||
shell: bash
|
||||
run: |
|
||||
mkdir build
|
||||
cd build
|
||||
|
||||
echo "::group::CMake"
|
||||
cmake ${GITHUB_WORKSPACE} \
|
||||
-GNinja \
|
||||
-DVCPKG_TARGET_TRIPLET=${{ matrix.arch }}-windows-static \
|
||||
-DCMAKE_TOOLCHAIN_FILE="c:\vcpkg\scripts\buildsystems\vcpkg.cmake" \
|
||||
-DOPTION_USE_NSIS=ON \
|
||||
-DHOST_BINARY_DIR=${GITHUB_WORKSPACE}/build-host \
|
||||
-DCMAKE_BUILD_TYPE=RelWithDebInfo \
|
||||
# EOF
|
||||
echo "::endgroup::"
|
||||
|
||||
echo "::group::Build"
|
||||
cmake --build .
|
||||
echo "::endgroup::"
|
||||
|
||||
- name: Build (without installer)
|
||||
if: needs.source.outputs.is_tag != 'true'
|
||||
uses: lukka/run-cmake@v3
|
||||
with:
|
||||
cmakeListsOrSettingsJson: CMakeListsTxtAdvanced
|
||||
useVcpkgToolchainFile: true
|
||||
buildDirectory: '${{ github.workspace }}/build'
|
||||
cmakeAppendedArgs: ' -GNinja -DHOST_BINARY_DIR=${{ github.workspace }}/build-host -DCMAKE_BUILD_TYPE=RelWithDebInfo'
|
||||
shell: bash
|
||||
run: |
|
||||
mkdir build
|
||||
cd build
|
||||
|
||||
echo "::group::CMake"
|
||||
cmake ${GITHUB_WORKSPACE} \
|
||||
-GNinja \
|
||||
-DVCPKG_TARGET_TRIPLET=${{ matrix.arch }}-windows-static \
|
||||
-DCMAKE_TOOLCHAIN_FILE="c:\vcpkg\scripts\buildsystems\vcpkg.cmake" \
|
||||
-DHOST_BINARY_DIR=${GITHUB_WORKSPACE}/build-host \
|
||||
-DCMAKE_BUILD_TYPE=RelWithDebInfo \
|
||||
# EOF
|
||||
echo "::endgroup::"
|
||||
|
||||
echo "::group::Build"
|
||||
cmake --build .
|
||||
echo "::endgroup::"
|
||||
|
||||
- name: Create bundles
|
||||
shell: bash
|
||||
@@ -606,11 +817,12 @@ jobs:
|
||||
retention-days: 5
|
||||
|
||||
upload:
|
||||
name: Upload
|
||||
name: Upload (AWS)
|
||||
needs:
|
||||
- source
|
||||
- docs
|
||||
- linux
|
||||
- linux-distro
|
||||
- macos
|
||||
- windows
|
||||
|
||||
@@ -619,7 +831,7 @@ jobs:
|
||||
# "always()" is important here, it is the keyword to use to stop skipping
|
||||
# this job if any dependency is skipped. It looks a bit silly, but it is
|
||||
# how GitHub Actions work ;)
|
||||
if: always() && needs.source.result == 'success' && needs.docs.result == 'success' && (needs.linux.result == 'success' || needs.linux.result == 'skipped') && needs.macos.result == 'success' && needs.windows.result == 'success'
|
||||
if: always() && needs.source.result == 'success' && needs.docs.result == 'success' && needs.linux.result == 'success' && (needs.linux-distro.result == 'success' || needs.linux-distro.result == 'skipped') && needs.macos.result == 'success' && needs.windows.result == 'success'
|
||||
|
||||
runs-on: ubuntu-20.04
|
||||
|
||||
@@ -654,7 +866,7 @@ jobs:
|
||||
env:
|
||||
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
|
||||
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
|
||||
AWS_REGION: ${{ secrets.AWS_REGION }}
|
||||
AWS_DEFAULT_REGION: ${{ secrets.AWS_REGION }}
|
||||
|
||||
- name: Trigger 'New OpenTTD release'
|
||||
uses: peter-evans/repository-dispatch@v1
|
||||
@@ -663,3 +875,80 @@ jobs:
|
||||
repository: OpenTTD/workflows
|
||||
event-type: ${{ needs.source.outputs.trigger_type }}
|
||||
client-payload: '{"version": "${{ needs.source.outputs.version }}", "folder": "${{ needs.source.outputs.folder }}"}'
|
||||
|
||||
upload-steam:
|
||||
name: Upload (Steam)
|
||||
needs:
|
||||
- source
|
||||
- linux
|
||||
- macos
|
||||
- windows
|
||||
|
||||
if: needs.source.outputs.trigger_type == 'new-master' || needs.source.outputs.trigger_type == 'new-tag'
|
||||
|
||||
runs-on: ubuntu-20.04
|
||||
|
||||
steps:
|
||||
- name: Download all bundles
|
||||
uses: actions/download-artifact@v2
|
||||
|
||||
- name: Setup steamcmd
|
||||
uses: CyberAndrii/setup-steamcmd@v1
|
||||
|
||||
- name: Generate Steam auth code
|
||||
id: steam-totp
|
||||
uses: CyberAndrii/steam-totp@v1
|
||||
with:
|
||||
shared_secret: ${{ secrets.STEAM_SHARED_SECRET }}
|
||||
|
||||
- name: Upload to Steam
|
||||
run: |
|
||||
echo "::group::Extracting source"
|
||||
mkdir source
|
||||
(
|
||||
cd source
|
||||
tar -xf ../internal-source/source.tar.gz --strip-components=1
|
||||
)
|
||||
echo "::endgroup::"
|
||||
|
||||
mkdir steam
|
||||
(
|
||||
cd steam
|
||||
|
||||
echo "::group::Prepare Win32"
|
||||
unzip ../openttd-windows-x86/openttd-*-windows-win32.zip
|
||||
mv openttd-*-windows-win32 steam-win32
|
||||
echo "::endgroup::"
|
||||
|
||||
echo "::group::Prepare Win64"
|
||||
unzip ../openttd-windows-x64/openttd-*-windows-win64.zip
|
||||
mv openttd-*-windows-win64 steam-win64
|
||||
echo "::endgroup::"
|
||||
|
||||
echo "::group::Prepare macOS"
|
||||
mkdir steam-macos
|
||||
(
|
||||
cd steam-macos
|
||||
unzip ../../openttd-macos-universal/openttd-*-macos-universal.zip
|
||||
)
|
||||
echo "::endgroup::"
|
||||
|
||||
echo "::group::Prepare Linux"
|
||||
tar xvf ../openttd-linux-generic/openttd-*-linux-generic-amd64.tar.xz
|
||||
mv openttd-*-linux-generic-amd64 steam-linux
|
||||
echo "::endgroup::"
|
||||
|
||||
echo "::group::Preparing build file"
|
||||
if [ "${{ needs.source.outputs.trigger_type }}" = "new-tag" ]; then
|
||||
BRANCH="testing"
|
||||
else
|
||||
BRANCH="nightly"
|
||||
fi
|
||||
cat ../source/os/steam/release.vdf | sed 's/@@DESCRIPTION@@/openttd-${{ needs.source.outputs.version }}/;s/@@BRANCH@@/'${BRANCH}'/' > release.vdf
|
||||
cat release.vdf
|
||||
echo "::endgroup::"
|
||||
|
||||
echo "::group::Upload to Steam"
|
||||
steamcmd +login ${{ secrets.STEAM_USERNAME }} ${{ secrets.STEAM_PASSWORD }} ${{ steps.steam-totp.outputs.code }} +run_app_build $(pwd)/release.vdf +quit
|
||||
echo "::endgroup::"
|
||||
)
|
||||
|
||||
124
CMakeLists.txt
124
CMakeLists.txt
@@ -1,13 +1,15 @@
|
||||
cmake_minimum_required(VERSION 3.5)
|
||||
cmake_minimum_required(VERSION 3.9)
|
||||
|
||||
if(NOT BINARY_NAME)
|
||||
set(BINARY_NAME openttd)
|
||||
endif()
|
||||
|
||||
project(${BINARY_NAME})
|
||||
project(${BINARY_NAME}
|
||||
VERSION 1.11.2
|
||||
)
|
||||
|
||||
if(CMAKE_SOURCE_DIR STREQUAL CMAKE_BINARY_DIR)
|
||||
message(FATAL_ERROR "In-source builds not allowed. Please run \"cmake ..\" from the bin directory")
|
||||
message(FATAL_ERROR "In-source builds not allowed. Please run \"cmake ..\" from the build directory. You may need to delete \"${CMAKE_SOURCE_DIR}/CMakeCache.txt\" first.")
|
||||
endif()
|
||||
|
||||
# Debug mode by default.
|
||||
@@ -23,10 +25,13 @@ set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${CMAKE_SOURCE_DIR}/cmake")
|
||||
set(CMAKE_OSX_DEPLOYMENT_TARGET 10.9)
|
||||
|
||||
# Use GNUInstallDirs to allow customisation
|
||||
# but set our own default data dir
|
||||
# but set our own default data and bin dir
|
||||
if(NOT CMAKE_INSTALL_DATADIR)
|
||||
set(CMAKE_INSTALL_DATADIR "share/games")
|
||||
endif()
|
||||
if(NOT CMAKE_INSTALL_BINDIR)
|
||||
set(CMAKE_INSTALL_BINDIR "games")
|
||||
endif()
|
||||
include(GNUInstallDirs)
|
||||
|
||||
include(Options)
|
||||
@@ -69,6 +74,9 @@ add_custom_target(find_version
|
||||
${CMAKE_COMMAND}
|
||||
-DFIND_VERSION_BINARY_DIR=${CMAKE_BINARY_DIR}/generated
|
||||
-DCPACK_BINARY_DIR=${CMAKE_BINARY_DIR}
|
||||
-DREV_MAJOR=${PROJECT_VERSION_MAJOR}
|
||||
-DREV_MINOR=${PROJECT_VERSION_MINOR}
|
||||
-DREV_BUILD=${PROJECT_VERSION_PATCH}
|
||||
-P "${CMAKE_SOURCE_DIR}/cmake/scripts/FindVersion.cmake"
|
||||
WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}
|
||||
BYPRODUCTS ${GENERATED_SOURCE_FILES}
|
||||
@@ -101,6 +109,11 @@ if(OPTION_TOOLS_ONLY)
|
||||
return()
|
||||
endif()
|
||||
|
||||
if(APPLE)
|
||||
# Avoid searching for headers in Frameworks, and libraries in LIBDIR.
|
||||
set(CMAKE_FIND_FRAMEWORK LAST)
|
||||
endif()
|
||||
|
||||
# Prefer -pthread over -lpthread, which is often the better option of the two.
|
||||
set(CMAKE_THREAD_PREFER_PTHREAD YES)
|
||||
# Make sure we have Threads available.
|
||||
@@ -111,25 +124,33 @@ find_package(LibLZMA)
|
||||
find_package(LZO)
|
||||
find_package(PNG)
|
||||
|
||||
if(NOT WIN32)
|
||||
find_package(Allegro)
|
||||
find_package(Freetype)
|
||||
if(NOT APPLE)
|
||||
find_package(SDL2)
|
||||
if(NOT SDL2_FOUND)
|
||||
find_package(SDL)
|
||||
if(NOT OPTION_DEDICATED)
|
||||
if(NOT WIN32)
|
||||
find_package(Allegro)
|
||||
if(NOT APPLE)
|
||||
find_package(Freetype)
|
||||
find_package(SDL2)
|
||||
if(NOT SDL2_FOUND)
|
||||
find_package(SDL)
|
||||
endif()
|
||||
find_package(Fluidsynth)
|
||||
find_package(Fontconfig)
|
||||
find_package(ICU OPTIONAL_COMPONENTS i18n lx)
|
||||
endif()
|
||||
find_package(Fluidsynth)
|
||||
find_package(Fontconfig)
|
||||
find_package(ICU OPTIONAL_COMPONENTS i18n lx)
|
||||
else()
|
||||
find_package(Iconv)
|
||||
|
||||
find_library(AUDIOTOOLBOX_LIBRARY AudioToolbox)
|
||||
find_library(AUDIOUNIT_LIBRARY AudioUnit)
|
||||
find_library(COCOA_LIBRARY Cocoa)
|
||||
endif()
|
||||
endif()
|
||||
if(APPLE)
|
||||
find_package(Iconv)
|
||||
|
||||
find_library(AUDIOTOOLBOX_LIBRARY AudioToolbox)
|
||||
find_library(AUDIOUNIT_LIBRARY AudioUnit)
|
||||
find_library(COCOA_LIBRARY Cocoa)
|
||||
find_library(QUARTZCORE_LIBRARY QuartzCore)
|
||||
endif()
|
||||
|
||||
if(NOT EMSCRIPTEN AND NOT OPTION_DEDICATED)
|
||||
find_package(OpenGL COMPONENTS OpenGL)
|
||||
endif()
|
||||
|
||||
if(MSVC)
|
||||
find_package(Editbin REQUIRED)
|
||||
@@ -140,19 +161,14 @@ find_package(Xaudio2)
|
||||
|
||||
find_package(Grfcodec)
|
||||
|
||||
# IPO is only properly supported from CMake 3.9. Despite the fact we are
|
||||
# CMake 3.5, still enable IPO if we detect we are 3.9+.
|
||||
if(POLICY CMP0069)
|
||||
cmake_policy(SET CMP0069 NEW)
|
||||
include(CheckIPOSupported)
|
||||
check_ipo_supported(RESULT IPO_FOUND)
|
||||
endif()
|
||||
include(CheckIPOSupported)
|
||||
check_ipo_supported(RESULT IPO_FOUND)
|
||||
|
||||
show_options()
|
||||
|
||||
if(UNIX AND NOT APPLE AND NOT OPTION_DEDICATED)
|
||||
if(NOT SDL_FOUND AND NOT SDL2_FOUND)
|
||||
message(FATAL_ERROR "SDL or SDL2 is required for this platform")
|
||||
if(NOT SDL_FOUND AND NOT SDL2_FOUND AND NOT ALLEGRO_FOUND)
|
||||
message(FATAL_ERROR "SDL, SDL2 or Allegro is required for this platform")
|
||||
endif()
|
||||
endif()
|
||||
if(APPLE)
|
||||
@@ -165,6 +181,30 @@ if(APPLE)
|
||||
if(NOT COCOA_LIBRARY)
|
||||
message(FATAL_ERROR "Cocoa is required for this platform")
|
||||
endif()
|
||||
if(NOT QUARTZCORE_LIBRARY)
|
||||
message(FATAL_ERROR "QuartzCore is required for this platform")
|
||||
endif()
|
||||
endif()
|
||||
|
||||
if(OPTION_PACKAGE_DEPENDENCIES)
|
||||
if(NOT UNIX)
|
||||
message(FATAL_ERROR "Can only package dependencies on Linux")
|
||||
endif()
|
||||
if(OPTION_INSTALL_FHS)
|
||||
message(FATAL_ERROR "Cannot install in FHS folders when we are packaging dependencies")
|
||||
endif()
|
||||
if(${CMAKE_VERSION} VERSION_LESS "3.16.0")
|
||||
message(FATAL_ERROR "OPTION_PACKAGE_DEPENDENCIES can only work with CMake 3.16+; you are using ${CMAKE_VERSION}")
|
||||
endif()
|
||||
|
||||
# If we are packaging dependencies, we do two things:
|
||||
# 1) set the RPATH to include $ORIGIN/lib; $ORIGIN (that literal string)
|
||||
# is a Linux indicator for "path where application is". In CMake, we
|
||||
# have to do this before add_executable() is executed.
|
||||
# 2) copy the libraries that we compile against to the "lib" folder.
|
||||
# This is done in InstallAndPackage.cmake.
|
||||
set(CMAKE_INSTALL_RPATH "\$ORIGIN/lib")
|
||||
set(CMAKE_BUILD_WITH_INSTALL_RPATH ON)
|
||||
endif()
|
||||
|
||||
include(SourceList)
|
||||
@@ -180,8 +220,14 @@ add_executable(openttd WIN32 ${GENERATED_SOURCE_FILES})
|
||||
set_target_properties(openttd PROPERTIES OUTPUT_NAME "${BINARY_NAME}")
|
||||
# All other files are added via target_sources()
|
||||
|
||||
if(MSVC)
|
||||
# Add DPI manifest to project; other WIN32 targets get this via ottdres.rc
|
||||
target_sources(openttd PRIVATE "${CMAKE_SOURCE_DIR}/os/windows/openttd.manifest")
|
||||
endif()
|
||||
|
||||
add_subdirectory(${CMAKE_SOURCE_DIR}/bin)
|
||||
add_subdirectory(${CMAKE_SOURCE_DIR}/src)
|
||||
add_subdirectory(${CMAKE_SOURCE_DIR}/media/baseset)
|
||||
add_subdirectory(${CMAKE_SOURCE_DIR}/media)
|
||||
|
||||
add_dependencies(openttd
|
||||
find_version)
|
||||
@@ -189,6 +235,7 @@ add_dependencies(openttd
|
||||
target_link_libraries(openttd
|
||||
openttd::languages
|
||||
openttd::settings
|
||||
openttd::media
|
||||
openttd::basesets
|
||||
openttd::script_api
|
||||
Threads::Threads
|
||||
@@ -199,7 +246,7 @@ if(IPO_FOUND)
|
||||
set_target_properties(openttd PROPERTIES INTERPROCEDURAL_OPTIMIZATION_MINSIZEREL True)
|
||||
set_target_properties(openttd PROPERTIES INTERPROCEDURAL_OPTIMIZATION_RELWITHDEBINFO True)
|
||||
endif()
|
||||
set_target_properties(openttd PROPERTIES VS_DEBUGGER_WORKING_DIRECTORY "${CMAKE_SOURCE_DIR}/bin")
|
||||
set_target_properties(openttd PROPERTIES VS_DEBUGGER_WORKING_DIRECTORY "${CMAKE_BINARY_DIR}")
|
||||
process_compile_flags()
|
||||
|
||||
include(LinkPackage)
|
||||
@@ -217,6 +264,16 @@ if(NOT OPTION_DEDICATED)
|
||||
link_package(Fontconfig TARGET Fontconfig::Fontconfig)
|
||||
link_package(ICU_lx)
|
||||
link_package(ICU_i18n)
|
||||
|
||||
if(SDL2_FOUND AND OPENGL_FOUND AND UNIX)
|
||||
# SDL2 dynamically loads OpenGL if needed, so do not link to OpenGL when
|
||||
# on Linux. For Windows, we need to link to OpenGL as we also have a win32
|
||||
# driver using it.
|
||||
add_definitions(-DWITH_OPENGL)
|
||||
message(STATUS "OpenGL found -- -DWITH_OPENGL -- (via SDL2)")
|
||||
else()
|
||||
link_package(OpenGL TARGET OpenGL::GL)
|
||||
endif()
|
||||
endif()
|
||||
|
||||
if(APPLE)
|
||||
@@ -226,6 +283,7 @@ if(APPLE)
|
||||
${AUDIOTOOLBOX_LIBRARY}
|
||||
${AUDIOUNIT_LIBRARY}
|
||||
${COCOA_LIBRARY}
|
||||
${QUARTZCORE_LIBRARY}
|
||||
)
|
||||
|
||||
add_definitions(
|
||||
@@ -313,4 +371,8 @@ endif()
|
||||
include(CreateRegression)
|
||||
create_regression()
|
||||
|
||||
if(APPLE OR WIN32)
|
||||
find_package(Pandoc)
|
||||
endif()
|
||||
|
||||
include(InstallAndPackage)
|
||||
|
||||
46
COMPILING.md
46
COMPILING.md
@@ -2,26 +2,27 @@
|
||||
|
||||
## Required/optional libraries
|
||||
|
||||
The following libraries are used by OpenTTD for:
|
||||
OpenTTD makes use of the following external libraries:
|
||||
|
||||
- zlib: (de)compressing of old (0.3.0-1.0.5) savegames, content downloads,
|
||||
- (encouraged) zlib: (de)compressing of old (0.3.0-1.0.5) savegames, content downloads,
|
||||
heightmaps
|
||||
- liblzo2: (de)compressing of old (pre 0.3.0) savegames
|
||||
- liblzma: (de)compressing of savegames (1.1.0 and later)
|
||||
- libpng: making screenshots and loading heightmaps
|
||||
- (encouraged) liblzma: (de)compressing of savegames (1.1.0 and later)
|
||||
- (encouraged) libpng: making screenshots and loading heightmaps
|
||||
- (optional) liblzo2: (de)compressing of old (pre 0.3.0) savegames
|
||||
|
||||
For Linux, the following additional libraries are used (for non-dedicated only):
|
||||
|
||||
- libSDL2: hardware access (video, sound, mouse)
|
||||
- libfreetype: loading generic fonts and rendering them
|
||||
- libfontconfig: searching for fonts, resolving font names to actual fonts
|
||||
- libicu: handling of right-to-left scripts (e.g. Arabic and Persian) and
|
||||
natural sorting of strings (Linux only)
|
||||
- libSDL2: hardware access (video, sound, mouse) (not required for Windows or macOS)
|
||||
natural sorting of strings
|
||||
|
||||
OpenTTD does not require any of the libraries to be present, but without
|
||||
liblzma you cannot open most recent savegames and without zlib you cannot
|
||||
open most older savegames or use the content downloading system.
|
||||
Without libSDL/liballegro on non-Windows and non-macOS machines you have
|
||||
no graphical user interface; you would be building a dedicated server.
|
||||
|
||||
## Windows:
|
||||
## Windows
|
||||
|
||||
You need Microsoft Visual Studio 2017 or more recent.
|
||||
|
||||
@@ -57,6 +58,9 @@ To install both the x64 (64bit) and x86 (32bit) variants (though only one is nec
|
||||
```
|
||||
|
||||
You can open the folder (as a CMake project). CMake will be detected, and you can compile from there.
|
||||
If libraries are installed but not found, you need to set VCPKG_TARGET_TRIPLET in CMake parameters.
|
||||
For Visual Studio 2017 you also need to set CMAKE_TOOLCHAIN_FILE.
|
||||
(Typical values are shown in the MSVC project file command line example)
|
||||
|
||||
Alternatively, you can create a MSVC project file via CMake. For this
|
||||
either download CMake from https://cmake.org/download/ or use the version
|
||||
@@ -73,6 +77,9 @@ in the build folder are MSVC project files. MSVC can rebuild the project
|
||||
files himself via the `ZERO_CHECK` project.
|
||||
|
||||
## All other platforms
|
||||
Minimum required version of CMake is 3.9.
|
||||
By default this produces a Debug build with assertations enabled.
|
||||
This is a far slower build than release builds.
|
||||
|
||||
```bash
|
||||
mkdir build
|
||||
@@ -84,6 +91,25 @@ make
|
||||
For more information on how to use CMake (including how to make Release builds),
|
||||
we urge you to read [their excellent manual](https://cmake.org/cmake/help/latest/guide/user-interaction/index.html).
|
||||
|
||||
## CMake Options
|
||||
|
||||
Via CMake, several options can be influenced to get different types of
|
||||
builds.
|
||||
|
||||
- `-DCMAKE_BUILD_TYPE=RelWithDebInfo`: build a release build. This is
|
||||
significant faster than a debug build, but has far less useful information
|
||||
in case of a crash.
|
||||
- `-DOPTION_DEDICATED=ON`: build OpenTTD without a GUI. Useful if you are
|
||||
running a headless server, as it requires less libraries to operate.
|
||||
- `-DOPTION_USE_ASSERTS=OFF`: disable asserts. Use with care, as assert
|
||||
statements capture early signs of trouble. Release builds have them
|
||||
disabled by default.
|
||||
- `-DOPTION_USE_THREADS=OFF`: disable the use of threads. This will block
|
||||
the interface in many places, and in general gives a worse experience of
|
||||
the game. Use with care.
|
||||
- `-DOPTION_TOOLS_ONLY=ON`: only build tools like `strgen`. Does not build
|
||||
the game itself. Useful for cross-compiling.
|
||||
|
||||
## Supported compilers
|
||||
|
||||
Every compiler that is supported by CMake and supports C++17, should be
|
||||
|
||||
20
README.md
20
README.md
@@ -46,15 +46,13 @@ OpenTTD has a [community-maintained wiki](https://wiki.openttd.org/), including
|
||||
|
||||
OpenTTD has been ported to several platforms and operating systems.
|
||||
|
||||
The currently working platforms are:
|
||||
The currently supported platforms are:
|
||||
|
||||
- FreeBSD (SDL)
|
||||
- Haiku (SDL)
|
||||
- Linux (SDL)
|
||||
- macOS (universal) (Cocoa video and sound drivers)
|
||||
- OpenBSD (SDL)
|
||||
- OS/2 (SDL)
|
||||
- Windows (Win32 GDI (faster) or SDL)
|
||||
- Linux (SDL (OpenGL and non-OpenGL))
|
||||
- macOS (universal) (Cocoa)
|
||||
- Windows (Win32 GDI / OpenGL)
|
||||
|
||||
Other platforms may also work (in particular various BSD systems), but we don't actively test or maintain these.
|
||||
|
||||
### 1.3.1) Legacy support
|
||||
Platforms, languages and compilers change.
|
||||
@@ -79,9 +77,9 @@ For some platforms, you will need to refer to [the installation guide](https://w
|
||||
The free data files, split into OpenGFX for graphics, OpenSFX for sounds and
|
||||
OpenMSX for music can be found at:
|
||||
|
||||
- https://www.openttd.org/download-opengfx for OpenGFX
|
||||
- https://www.openttd.org/download-opensfx for OpenSFX
|
||||
- https://www.openttd.org/download-openmsx for OpenMSX
|
||||
- https://www.openttd.org/downloads/opengfx-releases/ for OpenGFX
|
||||
- https://www.openttd.org/downloads/opensfx-releases/ for OpenSFX
|
||||
- https://www.openttd.org/downloads/openmsx-releases/ for OpenMSX
|
||||
|
||||
Please follow the readme of these packages about the installation procedure.
|
||||
The Windows installer can optionally download and install these packages.
|
||||
|
||||
2
bin/CMakeLists.txt
Normal file
2
bin/CMakeLists.txt
Normal file
@@ -0,0 +1,2 @@
|
||||
add_subdirectory(ai)
|
||||
add_subdirectory(game)
|
||||
39
bin/ai/CMakeLists.txt
Normal file
39
bin/ai/CMakeLists.txt
Normal file
@@ -0,0 +1,39 @@
|
||||
set(AI_COMPAT_SOURCE_FILES
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/compat_0.7.nut
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/compat_1.0.nut
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/compat_1.1.nut
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/compat_1.2.nut
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/compat_1.3.nut
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/compat_1.4.nut
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/compat_1.5.nut
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/compat_1.6.nut
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/compat_1.7.nut
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/compat_1.8.nut
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/compat_1.9.nut
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/compat_1.10.nut
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/compat_1.11.nut
|
||||
)
|
||||
|
||||
foreach(AI_COMPAT_SOURCE_FILE IN LISTS AI_COMPAT_SOURCE_FILES)
|
||||
string(REPLACE "${CMAKE_SOURCE_DIR}/bin/" "" AI_COMPAT_SOURCE_FILE_NAME "${AI_COMPAT_SOURCE_FILE}")
|
||||
string(CONCAT AI_COMPAT_BINARY_FILE "${CMAKE_BINARY_DIR}/" "${AI_COMPAT_SOURCE_FILE_NAME}")
|
||||
|
||||
add_custom_command(OUTPUT ${AI_COMPAT_BINARY_FILE}
|
||||
COMMAND ${CMAKE_COMMAND} -E copy
|
||||
${AI_COMPAT_SOURCE_FILE}
|
||||
${AI_COMPAT_BINARY_FILE}
|
||||
MAIN_DEPENDENCY ${AI_COMPAT_SOURCE_FILE}
|
||||
COMMENT "Copying ${AI_COMPAT_SOURCE_FILE_NAME}"
|
||||
)
|
||||
|
||||
list(APPEND AI_COMPAT_BINARY_FILES ${AI_COMPAT_BINARY_FILE})
|
||||
endforeach()
|
||||
|
||||
# Create a new target which copies all compat files
|
||||
add_custom_target(ai_compat_files
|
||||
DEPENDS ${AI_COMPAT_BINARY_FILES}
|
||||
)
|
||||
|
||||
add_dependencies(openttd
|
||||
ai_compat_files
|
||||
)
|
||||
36
bin/game/CMakeLists.txt
Normal file
36
bin/game/CMakeLists.txt
Normal file
@@ -0,0 +1,36 @@
|
||||
set(GS_COMPAT_SOURCE_FILES
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/compat_1.2.nut
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/compat_1.3.nut
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/compat_1.4.nut
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/compat_1.5.nut
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/compat_1.6.nut
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/compat_1.7.nut
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/compat_1.8.nut
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/compat_1.9.nut
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/compat_1.10.nut
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/compat_1.11.nut
|
||||
)
|
||||
|
||||
foreach(GS_COMPAT_SOURCE_FILE IN LISTS GS_COMPAT_SOURCE_FILES)
|
||||
string(REPLACE "${CMAKE_SOURCE_DIR}/bin/" "" GS_COMPAT_SOURCE_FILE_NAME "${GS_COMPAT_SOURCE_FILE}")
|
||||
string(CONCAT GS_COMPAT_BINARY_FILE "${CMAKE_BINARY_DIR}/" "${GS_COMPAT_SOURCE_FILE_NAME}")
|
||||
|
||||
add_custom_command(OUTPUT ${GS_COMPAT_BINARY_FILE}
|
||||
COMMAND ${CMAKE_COMMAND} -E copy
|
||||
${GS_COMPAT_SOURCE_FILE}
|
||||
${GS_COMPAT_BINARY_FILE}
|
||||
MAIN_DEPENDENCY ${GS_COMPAT_SOURCE_FILE}
|
||||
COMMENT "Copying ${GS_COMPAT_SOURCE_FILE_NAME}"
|
||||
)
|
||||
|
||||
list(APPEND GS_COMPAT_BINARY_FILES ${GS_COMPAT_BINARY_FILE})
|
||||
endforeach()
|
||||
|
||||
# Create a new target which copies all compat files
|
||||
add_custom_target(gs_compat_files
|
||||
DEPENDS ${GS_COMPAT_BINARY_FILES}
|
||||
)
|
||||
|
||||
add_dependencies(openttd
|
||||
gs_compat_files
|
||||
)
|
||||
162
changelog.txt
162
changelog.txt
@@ -1,3 +1,165 @@
|
||||
1.11.2 (2021-05-03)
|
||||
------------------------------------------------------------------------
|
||||
Change: [Win32] Limit hardware accelerated video driver to OpenGL 3.2 or higher (#9077)
|
||||
Change: More improvements to the GUI at different scales (#9075, #9102, #9107, #9133, #9174, #9183)
|
||||
Fix: Query windows could be partially drawn (#9184)
|
||||
Fix #9113: Crash when removing an airport that exists in an aircraft's orders (#9182)
|
||||
Fix #9117: [Fluidsynth] Hang when changing song (#9181)
|
||||
Fix: String validation could leave invalid UTF-8 encoded strings (#9096)
|
||||
Fix: [Network] Out-of-bounds memory access with modified servers sending too short password salts (#9176)
|
||||
Fix: Crash when extra viewport with zero height has sign in view (#9175)
|
||||
Fix #9147: Crash when taking screenshots (#9169)
|
||||
Fix #6598: [Network] Prevent crashes when (re)joining network game by falling back to main menu first (#9163)
|
||||
Fix #9152: Screenshot success popup window was treated as an error (#9159)
|
||||
Fix: Fast-forward stuttering when vsync is enabled (#9140)
|
||||
Fix: [Network, Win32] Network errors were handled badly (#9116)
|
||||
Fix: [Network] Savegame transfer could stall in rare cases (#9106)
|
||||
Fix #9097: [NewGRF] Cargo initial payment variable was being truncated (#9098)
|
||||
Fix: [NewGRF] Industry variable 66 and object variable 46 erroneously truncated the distance (#9088)
|
||||
Fix: [NewGRF] Industry variables 65 and 66 ignored the parameter, and always used the north tile (#9088)
|
||||
Fix: Do not include regression test AI in bundle (#9068, #9164)
|
||||
Fix #9062: [Win32] Version in executable was not set to current release version (#9066, #9154)
|
||||
|
||||
|
||||
1.11.1 (2021-04-18)
|
||||
------------------------------------------------------------------------
|
||||
Feature: Toggle to enable/disable vsync (#8997)
|
||||
Feature: Volume controls in the Game Options window, and better defaults (#8943)
|
||||
Add: Hotkey to focus object and rail filters (#8908)
|
||||
Add: Better plural support for Romanian (#8936)
|
||||
Change: Improve layout and spacing of several windows at different GUI scales (#9041, #9042, #9044, #9050)
|
||||
Change: [Win32] Use user UI language setting for initial language selection (#8974)
|
||||
Change: Make effect volume scale more intuitively (#8945, #8950)
|
||||
Change: Improve padding of Object & Rail station windows (#8929)
|
||||
Fix #6322: [Script] Crash when script allocates too much memory, now kills script instead (#9047)
|
||||
Fix #7513: [Script] Crash on garbage collection with misbehaving script (#9040)
|
||||
Fix #9028: [OpenGL] Crash when changing max sprite zoom level (#9032)
|
||||
Fix #8874: show a warning when a NewGRF scan is requested multiple times (#9022)
|
||||
Fix: Desync when GS unlocks railtype with wagon unlock (#9021)
|
||||
Fix #9015: [Win32] Crash on running "pwd" command in the console (#9016)
|
||||
Fix #9008: Validate starting year given on the command line (-t) (#9014)
|
||||
Fix #8878: [Network] Slow DNS queries could block the server and disconnect clients (#9013)
|
||||
Fix: Improve validation of OpenGL video driver to avoid crashes (#9007)
|
||||
Fix: Credits scrolled too slowly with larger font sizes (#8994)
|
||||
Fix #8977: Crash when altering max sprite resolution (#8993)
|
||||
Fix #8956: Industry disaster news messages showed the wrong location (#8992)
|
||||
Fix: [Win32] Font glyphs of certain widths had broken rendering (#8990)
|
||||
Fix #8930: [Win32] Duplicate text input issue for systems using IME (#8976)
|
||||
Fix: [Network] Potential stale client entries in client list (#8959)
|
||||
Fix: Graphical issues when dragging measurement tooltips (#8951)
|
||||
Fix: [Fluidsynth] Use provided default soundfont if available (#8948, #8953)
|
||||
Fix #8935: [macOS] Crash on save (#8944)
|
||||
Fix #8922: Crash when selling shared vehicles with shared vehicle window open (#8926)
|
||||
Fix: Compiling on armhf (Raspberry Pi) (#8924)
|
||||
|
||||
|
||||
1.11.0 (2021-04-01)
|
||||
------------------------------------------------------------------------
|
||||
Feature: Allow setting a custom terrain type to define highest peak (#8891)
|
||||
Feature: Auto-detect map height limit based on generated map (#8891)
|
||||
Feature: Setting to indicate desert coverage for tropic climate and snow coverage for arctic climate (replaces snow line height) (#8891)
|
||||
Add: Allow setting the highest mountain for heightmaps (#8891)
|
||||
Change: Scale exported heightmaps to highest peak and inform the user of this value (#8891)
|
||||
Change: Remove "maximum map height" from the New Game GUI (#8891)
|
||||
Fix #8803: Only auto-remove signals when rail can be built (#8904)
|
||||
Fix #8565: Stopped road vehicle displays a speed different than 0 (#8901)
|
||||
Fix #8886: Don't try to resolve folders within tars named '.' (#8893)
|
||||
Fix: Placing random trees in SE crashes the game (#8892)
|
||||
Fix #8875: Filter string in station window breaks flow in user interface (#8885)
|
||||
Fix #8871: [OpenGL] Initialize all buffers after resize and clear back buffer (#8877)
|
||||
Fix: OpenGL performance with some AMD GPUs (#8876)
|
||||
Fix: Recompute road/railtype availability after disabling the engine (#8872)
|
||||
Fix: OSK layout not scaled for 2x or 4x GUI scale (#8868)
|
||||
|
||||
|
||||
1.11.0-RC1 (2021-03-14)
|
||||
------------------------------------------------------------------------
|
||||
Feature: Option to (dis-)allow hardware accelerated video drivers (#8819)
|
||||
Feature: Option to set display refresh rate (#8813)
|
||||
Feature: Allow custom width/height of screenshot and making heightmap screenshots via console (#8804)
|
||||
Feature: Allow filtering on name in rail station window (#8706)
|
||||
Feature: Setting for highest resolution of sprites to use (#8604)
|
||||
Add: Make NewGRF Scanner / World Generation update smoother and make aborting it react faster (#8830)
|
||||
Add: Malaysia Ringgit as Currency (#8783)
|
||||
Add: "Engines only" filter in build train window (#8733)
|
||||
Change: De-limit framerate window's framerate (#8772)
|
||||
Change: Clarify what effect town interactions have (#8744)
|
||||
Change: Don't show global goals in company goal windows (#8709)
|
||||
Change: Recolour graph windows to brown (#8700)
|
||||
Fix #8855: Bootstrap could result in an empty screen when bootstrap fails (#8856)
|
||||
Fix #8851: Don't allow infinite "exec" depth in script, but limit to 10 deep (#8852)
|
||||
Fix #8647: Incorrect drawing order of tram catenary sprites (#8843)
|
||||
Fix #8711: Having gui_zoom lower than zoom_min causes a crash (#8835)
|
||||
Fix #8810: "aircraft out of fuel" news shows the wrong place (#8832)
|
||||
Fix #8833: Don't reload NewGRFs when we are shutting down (#8830)
|
||||
Fix: Scale padding between elements the same as other padding (#8829)
|
||||
Fix #8808: [OSX, OpenGL] Crash on switching blitters due to double-mapping the video buffer (#8822)
|
||||
Fix #8784: Using Alt+Enter doesn't update the fullscreen toggle visibly (#8820)
|
||||
Fix #8817: Keep NewGRF order for object class sorting (#8818)
|
||||
Fix #8809: Crash when removing airport when hangar window open (#8815)
|
||||
Fix #8799: Crash when Search Internet in Multiplayer (#8801)
|
||||
Fix #8775: [Win32] Don't create the main window when Alt-Tabbing back into fullscreen (#8792)
|
||||
Fix #8774: Black screenshots when using 40bpp-blitter (#8791)
|
||||
Fix: [OSX] Hide dock when entering fullscreen (#8789)
|
||||
Fix: Bootstrap fails to start on clean install (#8788)
|
||||
Fix: Terraform limit acts random when maxing out per_64k_frames setting (#8782)
|
||||
Fix: Max-value of fast-forward-speed-limit can be outside its storage size (#8769)
|
||||
|
||||
|
||||
1.11.0-beta2 (2021-02-28)
|
||||
------------------------------------------------------------------------
|
||||
Feature: Add setting to limit fast-forward speed (#8766)
|
||||
Feature: Significant performance improvements to all video drivers (#8605, #8652, #8660, #8685, #8702, #8703, #8707, #8726, #8740)
|
||||
Feature: Configurable display refresh-rate, default to 60fps (#8680)
|
||||
Feature: Automatically upload releases to Steam (#8644)
|
||||
Feature: Generic Linux builds (#8641)
|
||||
Feature: [GS] Allow non-question type windows to have no buttons (#8638)
|
||||
Feature: [macOS] ZIP build (#8614)
|
||||
Feature: Object class selection string filtering (#8603)
|
||||
Feature: 'Remove all industries' button in scenario editor (#8550)
|
||||
Feature: Automatic UI and font zoom levels when supported by the OS (#8537)
|
||||
Feature: [macOS] Render screen at native resolution by default for HiDPI screens (#8519)
|
||||
Feature: OpenGL video driver (#7744)
|
||||
Add: Indonesia Rupiah currency (#8616)
|
||||
Change: Improve graph period markings (#8732)
|
||||
Change: Make pathfinder account for maximum order speed, if set (#8722)
|
||||
Change: Darken graph grid lines for legibility (#8690)
|
||||
Change: Make order window hotkeys toggle for load & unload variants (#8669)
|
||||
Change: Use a more specific error message when attempting to bulldoze your own HQ (#8667)
|
||||
Change: Convert .md to .rtf for Windows/Mac packages (#8617)
|
||||
Change: Move the 'tree placer algorithm' & 'road drive side' settings to the Settings window (#8566)
|
||||
Change: Move town name generator selection to mapgen GUI (#8566)
|
||||
Change: [macOS] Native font rendering (#8518)
|
||||
Fix: Display of network lobby windows for different GUI sizes (#8765)
|
||||
Fix: Don't desync if client leaves before you finish downloading map (#8755)
|
||||
Fix: Allow estimating vehicle clone cost even if short on money (#8748)
|
||||
Fix: Don't notify twice that a client left because of a timeout (#8746)
|
||||
Fix: Vehicle cursor size did not account for the interface zoom level (#8739)
|
||||
Fix #8123: Trams on half-tiles couldn't find depots (#8738)
|
||||
Fix #8276: [NewGRF] Crash when an object's size was not set (#8719)
|
||||
Fix #8349: Close depot vehicle list windows when closing the depot window (#8717)
|
||||
Fix #8594: [NRT] Road pathfinder did not account for roadtype speed limits or lengths of tunnels/bridges (#8710)
|
||||
Fix: Whole status bar instead of money widget refreshed on money change (#8692)
|
||||
Fix: Unnecessary status bar redraws when there is no news to show (#8691)
|
||||
Fix: New orders are non-stop by default (#8689)
|
||||
Fix: Framerate window showed a slightly higher rate than actually measured (#8682)
|
||||
Fix: Autorenew failure advice due to bad refit being shown to all companies (#8681)
|
||||
Fix #8625: Wrong ending year was displayed in highscore table (#8672)
|
||||
Fix #8620: Scale spacing between date & news in history window according to font scaling (#8671)
|
||||
Fix: [Win32] Set minimum resolution for timers to 1ms (#8660)
|
||||
Fix: Mention our websites with https:// (instead of http://) (#8657)
|
||||
Fix: [Emscripten] Open links in browser (#8655)
|
||||
Fix: Don't crash when towns upgrade road tiles during expansion (#8651)
|
||||
Fix #8029: [SDL2] Blank display when under Wayland (#8648)
|
||||
Fix: Default Network Server List sorter put compatible servers in wrong order (#8626)
|
||||
Fix: Use non-pulsating red highlight for coverage (#8622)
|
||||
Fix: Center text and image in vehicle statusbar vertically (#8602)
|
||||
Fix: Don't walk out of the map when trying to build tunnels (#8600)
|
||||
Fix: Off-by-one error in desert/rainforest positioning at world gen (#8588)
|
||||
Fix #8037: Crash when restarting AI that is controlling the same company as the player (#8587)
|
||||
Fix: Stopped ships shouldn't block depots (#8578)
|
||||
|
||||
|
||||
1.11.0-beta1 (2021-01-22)
|
||||
------------------------------------------------------------------------
|
||||
Feature: [GS] Ability to set some extra text in the industry window (#8576)
|
||||
|
||||
@@ -4,20 +4,22 @@
|
||||
#
|
||||
macro(compile_flags)
|
||||
if(MSVC)
|
||||
# Switch to MT (static) instead of MD (dynamic) binary
|
||||
if(VCPKG_TARGET_TRIPLET MATCHES "-static" AND NOT VCPKG_TARGET_TRIPLET MATCHES "-md")
|
||||
# Switch to MT (static) instead of MD (dynamic) binary
|
||||
|
||||
# For MSVC two generators are available
|
||||
# - a command line generator (Ninja) using CMAKE_BUILD_TYPE to specify the
|
||||
# configuration of the build tree
|
||||
# - an IDE generator (Visual Studio) using CMAKE_CONFIGURATION_TYPES to
|
||||
# specify all configurations that will be available in the generated solution
|
||||
list(APPEND MSVC_CONFIGS "${CMAKE_BUILD_TYPE}" "${CMAKE_CONFIGURATION_TYPES}")
|
||||
# For MSVC two generators are available
|
||||
# - a command line generator (Ninja) using CMAKE_BUILD_TYPE to specify the
|
||||
# configuration of the build tree
|
||||
# - an IDE generator (Visual Studio) using CMAKE_CONFIGURATION_TYPES to
|
||||
# specify all configurations that will be available in the generated solution
|
||||
list(APPEND MSVC_CONFIGS "${CMAKE_BUILD_TYPE}" "${CMAKE_CONFIGURATION_TYPES}")
|
||||
|
||||
# Set usage of static runtime for all configurations
|
||||
foreach(MSVC_CONFIG ${MSVC_CONFIGS})
|
||||
string(TOUPPER "CMAKE_CXX_FLAGS_${MSVC_CONFIG}" MSVC_FLAGS)
|
||||
string(REPLACE "/MD" "/MT" ${MSVC_FLAGS} "${${MSVC_FLAGS}}")
|
||||
endforeach()
|
||||
# Set usage of static runtime for all configurations
|
||||
foreach(MSVC_CONFIG ${MSVC_CONFIGS})
|
||||
string(TOUPPER "CMAKE_CXX_FLAGS_${MSVC_CONFIG}" MSVC_FLAGS)
|
||||
string(REPLACE "/MD" "/MT" ${MSVC_FLAGS} "${${MSVC_FLAGS}}")
|
||||
endforeach()
|
||||
endif()
|
||||
|
||||
# "If /Zc:rvalueCast is specified, the compiler follows section 5.4 of the
|
||||
# C++11 standard". We need C++11 for the way we use threads.
|
||||
@@ -27,9 +29,6 @@ macro(compile_flags)
|
||||
# Enable multi-threaded compilation.
|
||||
add_compile_options(/MP)
|
||||
endif()
|
||||
|
||||
# Add DPI manifest to project; other WIN32 targets get this via ottdres.rc
|
||||
list(APPEND GENERATED_SOURCE_FILES "${CMAKE_SOURCE_DIR}/os/windows/openttd.manifest")
|
||||
endif()
|
||||
|
||||
# Add some -D flags for Debug builds. We cannot use add_definitions(), because
|
||||
|
||||
@@ -35,9 +35,9 @@ function(create_grf_command)
|
||||
-DNFORENUM_EXECUTABLE=${NFORENUM_EXECUTABLE}
|
||||
-DGRFCODEC_EXECUTABLE=${GRFCODEC_EXECUTABLE}
|
||||
-P ${CMAKE_SOURCE_DIR}/cmake/scripts/CreateGRF.cmake
|
||||
MAIN_DEPENDENCY ${GRF_NFO_SOURCE_FILES}
|
||||
MAIN_DEPENDENCY ${CMAKE_SOURCE_DIR}/cmake/scripts/CreateGRF.cmake
|
||||
DEPENDS ${GRF_PNG_BINARY_FILES}
|
||||
${CMAKE_SOURCE_DIR}/cmake/scripts/CreateGRF.cmake
|
||||
${GRF_NFO_SOURCE_FILES}
|
||||
WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}
|
||||
COMMENT "Generating ${GRF_SOURCE_FOLDER_NAME}.grf"
|
||||
)
|
||||
|
||||
@@ -10,8 +10,8 @@ macro(create_regression)
|
||||
# build folder before we can run the regression
|
||||
file(GLOB_RECURSE REGRESSION_SOURCE_FILES ${CMAKE_SOURCE_DIR}/regression/*)
|
||||
foreach(REGRESSION_SOURCE_FILE IN LISTS REGRESSION_SOURCE_FILES)
|
||||
string(REGEX REPLACE "^${CMAKE_SOURCE_DIR}/regression/" "${CMAKE_BINARY_DIR}/ai/" REGRESSION_BINARY_FILE "${REGRESSION_SOURCE_FILE}")
|
||||
string(REGEX REPLACE "^${CMAKE_SOURCE_DIR}/regression/" "" REGRESSION_SOURCE_FILE_NAME "${REGRESSION_SOURCE_FILE}")
|
||||
string(REPLACE "${CMAKE_SOURCE_DIR}/regression/" "" REGRESSION_SOURCE_FILE_NAME "${REGRESSION_SOURCE_FILE}")
|
||||
string(CONCAT REGRESSION_BINARY_FILE "${CMAKE_BINARY_DIR}/ai/" "${REGRESSION_SOURCE_FILE_NAME}")
|
||||
|
||||
if("${REGRESSION_SOURCE_FILE_NAME}" STREQUAL "regression.cfg")
|
||||
continue()
|
||||
|
||||
@@ -31,7 +31,7 @@ The following cache variables may also be set:
|
||||
#]=======================================================================]
|
||||
|
||||
find_package(PkgConfig QUIET)
|
||||
pkg_check_modules(PC_Allegro QUIET allegro)
|
||||
pkg_check_modules(PC_Allegro QUIET allegro<5)
|
||||
|
||||
find_path(Allegro_INCLUDE_DIR
|
||||
NAMES allegro.h
|
||||
|
||||
@@ -1,3 +1,8 @@
|
||||
# CMake provides a FindICU module since version 3.7.
|
||||
# But it doesn't use pkgconfig, doesn't set expected variables,
|
||||
# And it returns incomplete dependencies if only some modules are searched.
|
||||
|
||||
|
||||
#[=======================================================================[.rst:
|
||||
FindICU
|
||||
-------
|
||||
|
||||
3
cmake/FindPandoc.cmake
Normal file
3
cmake/FindPandoc.cmake
Normal file
@@ -0,0 +1,3 @@
|
||||
if(NOT EXISTS ${PANDOC_EXECUTABLE})
|
||||
find_program(PANDOC_EXECUTABLE pandoc)
|
||||
endif()
|
||||
@@ -26,11 +26,13 @@ install(TARGETS openttd
|
||||
install(DIRECTORY
|
||||
${CMAKE_BINARY_DIR}/lang
|
||||
${CMAKE_BINARY_DIR}/baseset
|
||||
${CMAKE_SOURCE_DIR}/bin/ai
|
||||
${CMAKE_SOURCE_DIR}/bin/game
|
||||
${CMAKE_BINARY_DIR}/ai
|
||||
${CMAKE_BINARY_DIR}/game
|
||||
${CMAKE_SOURCE_DIR}/bin/scripts
|
||||
DESTINATION ${DATA_DESTINATION_DIR}
|
||||
COMPONENT language_files)
|
||||
COMPONENT language_files
|
||||
REGEX "ai/[^\.]+$" EXCLUDE # Ignore subdirs in ai dir
|
||||
)
|
||||
|
||||
install(FILES
|
||||
${CMAKE_SOURCE_DIR}/COPYING.md
|
||||
@@ -58,8 +60,18 @@ if(OPTION_INSTALL_FHS)
|
||||
COMPONENT manual)
|
||||
endif()
|
||||
|
||||
# TODO -- Media files
|
||||
# TODO -- Menu files
|
||||
if(UNIX AND NOT APPLE)
|
||||
install(DIRECTORY
|
||||
${CMAKE_BINARY_DIR}/media/icons
|
||||
${CMAKE_BINARY_DIR}/media/pixmaps
|
||||
DESTINATION ${CMAKE_INSTALL_DATAROOTDIR}
|
||||
COMPONENT media)
|
||||
|
||||
install(FILES
|
||||
${CMAKE_BINARY_DIR}/media/${BINARY_NAME}.desktop
|
||||
DESTINATION ${CMAKE_INSTALL_DATAROOTDIR}/applications
|
||||
COMPONENT menu)
|
||||
endif()
|
||||
|
||||
if(CMAKE_SYSTEM_PROCESSOR STREQUAL "x86_64")
|
||||
set(ARCHITECTURE "amd64")
|
||||
@@ -95,7 +107,14 @@ set(CPACK_PACKAGE_HOMEPAGE_URL "https://www.openttd.org/")
|
||||
set(CPACK_PACKAGE_CONTACT "OpenTTD <info@openttd.org>")
|
||||
set(CPACK_PACKAGE_INSTALL_DIRECTORY "OpenTTD")
|
||||
set(CPACK_PACKAGE_CHECKSUM "SHA256")
|
||||
set(CPACK_RESOURCE_FILE_LICENSE "${CMAKE_SOURCE_DIR}/COPYING.md")
|
||||
|
||||
if((APPLE OR WIN32) AND EXISTS ${PANDOC_EXECUTABLE})
|
||||
execute_process(COMMAND ${PANDOC_EXECUTABLE} "${CMAKE_SOURCE_DIR}/COPYING.md" -s -o "${CMAKE_BINARY_DIR}/COPYING.rtf")
|
||||
set(CPACK_RESOURCE_FILE_LICENSE "${CMAKE_BINARY_DIR}/COPYING.rtf")
|
||||
else()
|
||||
set(CPACK_RESOURCE_FILE_LICENSE "${CMAKE_SOURCE_DIR}/COPYING.md")
|
||||
endif()
|
||||
|
||||
set(CPACK_RESOURCE_FILE_README "${CMAKE_SOURCE_DIR}/README.md")
|
||||
set(CPACK_MONOLITHIC_INSTALL YES)
|
||||
set(CPACK_PACKAGE_EXECUTABLES "openttd;OpenTTD")
|
||||
@@ -123,8 +142,12 @@ elseif(UNIX)
|
||||
# With FHS, we can create deb/rpm/... Without it, they would be horribly broken
|
||||
# and not work. The other way around is also true; with FHS they are not
|
||||
# usable, and only flat formats work.
|
||||
if(NOT OPTION_INSTALL_FHS)
|
||||
if(OPTION_PACKAGE_DEPENDENCIES)
|
||||
set(CPACK_GENERATOR "TXZ")
|
||||
set(PLATFORM "generic")
|
||||
elseif(NOT OPTION_INSTALL_FHS)
|
||||
set(CPACK_GENERATOR "TXZ")
|
||||
set(PLATFORM "unknown")
|
||||
else()
|
||||
find_program(LSB_RELEASE_EXEC lsb_release)
|
||||
execute_process(COMMAND ${LSB_RELEASE_EXEC} -is
|
||||
@@ -149,7 +172,7 @@ elseif(UNIX)
|
||||
string(REGEX MATCH "ID=(.*)" _ ${OS_RELEASE_CONTENTS})
|
||||
set(DISTRO_ID ${CMAKE_MATCH_1})
|
||||
if(DISTRO_ID STREQUAL "arch")
|
||||
set(PLATFORM "generic")
|
||||
set(PLATFORM "arch")
|
||||
set(CPACK_GENERATOR "TXZ")
|
||||
else()
|
||||
set(UNSUPPORTED_PLATFORM_NAME "Linux distribution '${DISTRO_ID}' from /etc/os-release")
|
||||
@@ -163,12 +186,39 @@ elseif(UNIX)
|
||||
set(CPACK_GENERATOR "TXZ")
|
||||
message(WARNING "Unknown ${UNSUPPORTED_PLATFORM_NAME} found for packaging; can only pack to a txz. Please consider creating a Pull Request to add support for this distribution.")
|
||||
endif()
|
||||
|
||||
set(CPACK_PACKAGE_FILE_NAME "openttd-#CPACK_PACKAGE_VERSION#-linux-${PLATFORM}-${CPACK_SYSTEM_NAME}")
|
||||
endif()
|
||||
|
||||
set(CPACK_PACKAGE_FILE_NAME "openttd-#CPACK_PACKAGE_VERSION#-linux-${PLATFORM}-${CPACK_SYSTEM_NAME}")
|
||||
|
||||
else()
|
||||
message(FATAL_ERROR "Unknown OS found for packaging; please consider creating a Pull Request to add support for this OS.")
|
||||
endif()
|
||||
|
||||
include(CPack)
|
||||
|
||||
if(OPTION_PACKAGE_DEPENDENCIES)
|
||||
# Install all dependencies we can resolve, with the exception of ones that
|
||||
# every Linux machine should have. This should make this build as generic
|
||||
# as possible, where it runs on any machine with the same or newer libc
|
||||
# than the one this is compiled with.
|
||||
# We copy these libraries into lib/ folder, so they can be found on game
|
||||
# startup. See comment in root CMakeLists.txt for how this works exactly.
|
||||
install(CODE [[
|
||||
file(GET_RUNTIME_DEPENDENCIES
|
||||
RESOLVED_DEPENDENCIES_VAR DEPENDENCIES
|
||||
UNRESOLVED_DEPENDENCIES_VAR UNRESOLVED_DEPENDENCIES
|
||||
EXECUTABLES openttd
|
||||
POST_EXCLUDE_REGEXES "ld-linux|libc.so|libdl.so|libm.so|libgcc_s.so|libpthread.so|librt.so|libstdc...so")
|
||||
file(INSTALL
|
||||
DESTINATION "${CMAKE_INSTALL_PREFIX}/lib"
|
||||
FILES ${DEPENDENCIES}
|
||||
FOLLOW_SYMLINK_CHAIN)
|
||||
|
||||
# This should not be possible, but error out when a dependency cannot
|
||||
# be resolved.
|
||||
list(LENGTH UNRESOLVED_DEPENDENCIES UNRESOLVED_LENGTH)
|
||||
if(${UNRESOLVED_LENGTH} GREATER 0)
|
||||
message(FATAL_ERROR "Unresolved dependencies: ${UNRESOLVED_DEPENDENCIES}")
|
||||
endif()
|
||||
]])
|
||||
endif()
|
||||
|
||||
@@ -16,6 +16,7 @@ source_group("Sprite loaders" REGULAR_EXPRESSION "src/spriteloader/")
|
||||
source_group("Squirrel" REGULAR_EXPRESSION "src/3rdparty/squirrel/squirrel/")
|
||||
source_group("Tables" REGULAR_EXPRESSION "src/table/")
|
||||
source_group("Video" REGULAR_EXPRESSION "src/video/")
|
||||
source_group("Video/GL" REGULAR_EXPRESSION "src/3rdparty/opengl/")
|
||||
source_group("Widgets" REGULAR_EXPRESSION "src/widgets/")
|
||||
source_group("Windows files" REGULAR_EXPRESSION "src/os/windows/|\.rc$")
|
||||
|
||||
|
||||
@@ -44,7 +44,9 @@ endfunction()
|
||||
# set_options()
|
||||
#
|
||||
function(set_options)
|
||||
if(UNIX AND NOT APPLE)
|
||||
option(OPTION_PACKAGE_DEPENDENCIES "Copy dependencies into lib/ for easy packaging (Linux only)" OFF)
|
||||
|
||||
if(UNIX AND NOT APPLE AND NOT OPTION_PACKAGE_DEPENDENCIES)
|
||||
set(DEFAULT_OPTION_INSTALL_FHS ON)
|
||||
else()
|
||||
set(DEFAULT_OPTION_INSTALL_FHS OFF)
|
||||
@@ -54,7 +56,7 @@ function(set_options)
|
||||
|
||||
option(OPTION_DEDICATED "Build dedicated server only (no GUI)" OFF)
|
||||
option(OPTION_INSTALL_FHS "Install with Filesystem Hierarchy Standard folders" ${DEFAULT_OPTION_INSTALL_FHS})
|
||||
option(OPTION_USE_ASSERTS "Use assertions; leave enabled for nightlies, betas, and RCs" ON)
|
||||
option(OPTION_USE_ASSERTS "Use assertions; leave enabled for nightlies, betas, and RCs" OFF)
|
||||
if(EMSCRIPTEN)
|
||||
# Although pthreads is supported, it is not in a way yet that is
|
||||
# useful for us.
|
||||
@@ -76,6 +78,7 @@ endfunction()
|
||||
# show_options()
|
||||
#
|
||||
function(show_options)
|
||||
message(STATUS "Option Package Dependencies - ${OPTION_PACKAGE_DEPENDENCIES}")
|
||||
message(STATUS "Option Dedicated - ${OPTION_DEDICATED}")
|
||||
message(STATUS "Option Install FHS - ${OPTION_INSTALL_FHS}")
|
||||
message(STATUS "Option Use assert - ${OPTION_USE_ASSERTS}")
|
||||
|
||||
@@ -4,6 +4,16 @@ cmake_minimum_required(VERSION 3.5)
|
||||
# Create a single baseset meta file with the correct translations.
|
||||
#
|
||||
|
||||
if(NOT BASESET_SOURCE_FILE)
|
||||
message(FATAL_ERROR "Script needs BASESET_SOURCE_FILE defined")
|
||||
endif()
|
||||
if(NOT BASESET_BINARY_FILE)
|
||||
message(FATAL_ERROR "Script needs BASESET_BINARY_FILE defined")
|
||||
endif()
|
||||
if(NOT BASESET_EXTRAGRF_FILE)
|
||||
message(FATAL_ERROR "Script needs BASESET_EXTRAGRF_FILE defined")
|
||||
endif()
|
||||
|
||||
set(ARGC 1)
|
||||
set(ARG_READ NO)
|
||||
|
||||
|
||||
@@ -39,6 +39,20 @@ foreach(NFO_LINE IN LISTS NFO_LINES)
|
||||
endif()
|
||||
endforeach()
|
||||
|
||||
execute_process(COMMAND ${NFORENUM_EXECUTABLE} -s sprites/${GRF_SOURCE_FOLDER_NAME}.nfo)
|
||||
execute_process(COMMAND ${GRFCODEC_EXECUTABLE} -n -s -e -p1 ${GRF_SOURCE_FOLDER_NAME}.grf)
|
||||
execute_process(COMMAND ${NFORENUM_EXECUTABLE} -s sprites/${GRF_SOURCE_FOLDER_NAME}.nfo RESULT_VARIABLE RESULT)
|
||||
if(RESULT)
|
||||
if(NOT RESULT MATCHES "^[0-9]*$")
|
||||
message(FATAL_ERROR "Failed to run NFORenum (${RESULT}), please check NFORENUM_EXECUTABLE variable")
|
||||
endif()
|
||||
message(FATAL_ERROR "NFORenum failed")
|
||||
endif()
|
||||
|
||||
execute_process(COMMAND ${GRFCODEC_EXECUTABLE} -n -s -e -p1 ${GRF_SOURCE_FOLDER_NAME}.grf RESULT_VARIABLE RESULT)
|
||||
if(RESULT)
|
||||
if(NOT RESULT MATCHES "^[0-9]*$")
|
||||
message(FATAL_ERROR "Failed to run GRFCodec (${RESULT}), please check GRFCODEC_EXECUTABLE variable")
|
||||
endif()
|
||||
message(FATAL_ERROR "GRFCodec failed")
|
||||
endif()
|
||||
|
||||
execute_process(COMMAND ${CMAKE_COMMAND} -E copy ${GRF_SOURCE_FOLDER_NAME}.grf ${GRF_BINARY_FILE})
|
||||
|
||||
60
cmake/scripts/Desktop.cmake
Normal file
60
cmake/scripts/Desktop.cmake
Normal file
@@ -0,0 +1,60 @@
|
||||
cmake_minimum_required(VERSION 3.5)
|
||||
|
||||
#
|
||||
# Create a desktop file with the correct translations.
|
||||
#
|
||||
|
||||
if(NOT DESKTOP_SOURCE_FILE)
|
||||
message(FATAL_ERROR "Script needs DESKTOP_SOURCE_FILE defined")
|
||||
endif()
|
||||
if(NOT DESKTOP_BINARY_FILE)
|
||||
message(FATAL_ERROR "Script needs DESKTOP_BINARY_FILE defined")
|
||||
endif()
|
||||
if(NOT BINARY_NAME)
|
||||
message(FATAL_ERROR "Script needs BINARY_NAME defined")
|
||||
endif()
|
||||
|
||||
set(ARGC 1)
|
||||
set(ARG_READ NO)
|
||||
|
||||
# Read all the arguments given to CMake; we are looking for -- and everything
|
||||
# that follows. Those are our language files.
|
||||
while(ARGC LESS CMAKE_ARGC)
|
||||
set(ARG ${CMAKE_ARGV${ARGC}})
|
||||
|
||||
if(ARG_READ)
|
||||
list(APPEND LANG_SOURCE_FILES "${ARG}")
|
||||
endif()
|
||||
|
||||
if(ARG STREQUAL "--")
|
||||
set(ARG_READ YES)
|
||||
endif()
|
||||
|
||||
math(EXPR ARGC "${ARGC} + 1")
|
||||
endwhile()
|
||||
|
||||
# Place holder format is @<ini_key>_<str_id>@
|
||||
file(STRINGS "${DESKTOP_SOURCE_FILE}" PLACE_HOLDER REGEX "^@")
|
||||
string(REGEX REPLACE "@([^_]+).*@" "\\1" INI_KEY "${PLACE_HOLDER}")
|
||||
string(REGEX REPLACE "@[^_]+_(.*)@" "\\1" STR_ID "${PLACE_HOLDER}")
|
||||
string(REGEX REPLACE "@(.*)@" "\\1" PLACE_HOLDER "${PLACE_HOLDER}")
|
||||
|
||||
# Get the translations
|
||||
foreach(LANGFILE IN LISTS LANG_SOURCE_FILES)
|
||||
file(STRINGS "${LANGFILE}" LANGLINES REGEX "^(##isocode|${STR_ID})" ENCODING UTF-8)
|
||||
string(FIND "${LANGLINES}" "${STR_ID}" HAS_STR_ID)
|
||||
if(HAS_STR_ID LESS 0)
|
||||
continue()
|
||||
endif()
|
||||
string(REGEX REPLACE "##isocode ([^;]+).*" "\\1" ISOCODE "${LANGLINES}")
|
||||
if("${ISOCODE}" STREQUAL "en_GB")
|
||||
string(REGEX REPLACE "[^:]*:(.*)" "${INI_KEY}=\\1" LANGLINES "${LANGLINES}")
|
||||
else()
|
||||
string(REGEX REPLACE "[^:]*:(.*)" "${INI_KEY}[${ISOCODE}]=\\1" LANGLINES "${LANGLINES}")
|
||||
endif()
|
||||
list(APPEND ${PLACE_HOLDER} ${LANGLINES})
|
||||
endforeach()
|
||||
list(SORT ${PLACE_HOLDER})
|
||||
string(REPLACE ";" "\n" ${PLACE_HOLDER} "${${PLACE_HOLDER}}")
|
||||
|
||||
configure_file(${DESKTOP_SOURCE_FILE} ${DESKTOP_BINARY_FILE})
|
||||
@@ -1,5 +1,15 @@
|
||||
cmake_minimum_required(VERSION 3.5)
|
||||
|
||||
if(NOT REV_MAJOR)
|
||||
set(REV_MAJOR 0)
|
||||
endif()
|
||||
if(NOT REV_MINOR)
|
||||
set(REV_MINOR 0)
|
||||
endif()
|
||||
if(NOT REV_BUILD)
|
||||
set(REV_BUILD 0)
|
||||
endif()
|
||||
|
||||
#
|
||||
# Finds the current version of the current folder.
|
||||
#
|
||||
@@ -83,7 +93,7 @@ if(GIT_FOUND AND EXISTS "${CMAKE_SOURCE_DIR}/.git")
|
||||
set(REV_ISTAG 1)
|
||||
|
||||
string(REGEX REPLACE "^[0-9.]+$" "" STABLETAG "${TAG}")
|
||||
if(NOT STABLETAG STREQUAL "")
|
||||
if(STABLETAG STREQUAL "")
|
||||
set(REV_ISSTABLETAG 1)
|
||||
else()
|
||||
set(REV_ISSTABLETAG 0)
|
||||
|
||||
@@ -53,6 +53,9 @@ string(REPLACE "0x(nil)" "0x00000000" REGRESSION_RESULT "${REGRESSION_RESULT}")
|
||||
string(REPLACE "0x0000000000000000" "0x00000000" REGRESSION_RESULT "${REGRESSION_RESULT}")
|
||||
string(REPLACE "0x0x0" "0x00000000" REGRESSION_RESULT "${REGRESSION_RESULT}")
|
||||
|
||||
# Remove timestamps if any
|
||||
string(REGEX REPLACE "\[[0-9-]+ [0-9:]+\] " "" REGRESSION_RESULT "${REGRESSION_RESULT}")
|
||||
|
||||
# Convert the output to a format that is expected (and more readable) by result.txt
|
||||
string(REPLACE "\ndbg: [script]" "\n" REGRESSION_RESULT "${REGRESSION_RESULT}")
|
||||
string(REPLACE "\n " "\nERROR: " REGRESSION_RESULT "${REGRESSION_RESULT}")
|
||||
|
||||
@@ -16,11 +16,18 @@ endif()
|
||||
set(ARGC 1)
|
||||
set(ARG_READ NO)
|
||||
|
||||
# For MSVC CMake runs this script from a batch file using || to detect errors,
|
||||
# depending on source path it may quote args, and cause cmd to not understand ||
|
||||
# and pass it as argument to ourself.
|
||||
# Read all the arguments given to CMake; we are looking for -- and everything
|
||||
# that follows. Those are our api files.
|
||||
# that follows, until ||. Those are our api files.
|
||||
while(ARGC LESS CMAKE_ARGC)
|
||||
set(ARG ${CMAKE_ARGV${ARGC}})
|
||||
|
||||
if(ARG STREQUAL "||")
|
||||
set(ARG_READ NO)
|
||||
endif()
|
||||
|
||||
if(ARG_READ)
|
||||
list(APPEND SCRIPT_API_BINARY_FILES "${ARG}")
|
||||
endif()
|
||||
|
||||
@@ -5,10 +5,14 @@
|
||||
<meta name="Description" content="Structure of OpenTTD (OTTD) landscape arrays #2">
|
||||
<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; }
|
||||
span.free { font-family: "Courier New", Courier, mono; background-color: rgb( 70, 190, 70); }
|
||||
span.usable { font-family: "Courier New", Courier, mono; background-color: rgb( 50, 150, 150); }
|
||||
span.used { font-family: "Courier New", Courier, mono; background-color: rgb(120, 120, 255); }
|
||||
span.pool { font-family: "Courier New", Courier, mono; background-color: rgb(220, 120, 255); }
|
||||
span.patch { font-family: "Courier New", Courier, mono; background-color: rgb(255, 165, 0); }
|
||||
span.abuse { font-family: "Courier New", Courier, mono; background-color: rgb(255, 100, 100); }
|
||||
span.rearrange{ font-family: "Courier New", Courier, mono; background-color: rgb(160, 160, 255); }
|
||||
|
||||
td.bits { white-space: nowrap; text-align: center; font-family: "Courier New", Courier, mono; }
|
||||
td.caption { white-space: nowrap; text-align: left; }
|
||||
td li { white-space: nowrap; text-align: left; }
|
||||
@@ -20,13 +24,7 @@
|
||||
<span style="font-weight: bold;"></span>Nine attributes hold the information about a tile.
|
||||
This can be seen in the <a href="landscape.html">Landscape</a> document. This page tries to give an overview of used and free bits of
|
||||
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, 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>
|
||||
<li><span style="font-weight: bold;">type</span> - 8 bits in size, tile class (bits 4..7), bridge (bits 2..3) tropic zone (bits 0..1, only valid in tropic climate)</li>
|
||||
<li><span style="font-weight: bold;">height</span> - 8 bits in size, stores tile height</li>
|
||||
@@ -39,6 +37,16 @@ the array so you can quickly see what is used and what is not.
|
||||
<li><span style="font-weight: bold;">m7</span> - 8 bits in size, is used for general storage</li>
|
||||
<li><span style="font-weight: bold;">m8</span> - 16 bits in size, is used for general storage</li>
|
||||
</ul>
|
||||
<p>
|
||||
<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="usable">X</span></span> - bit is used, but could be freed if needed</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="pool">X</span></span> - bit is used for an index on a pool</li>
|
||||
<li><span style="font-weight: bold;"><span class="patch">X</span></span> - bit is introduced by a patch</li>
|
||||
<li><span style="font-weight: bold;"><span class="abuse">X</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="rearrange">X</span></span> - bit is accessed, but a rearrangement of the map array could free some of these bits (probably not done for bit alignment)</li>
|
||||
</ul>
|
||||
|
||||
<table align=center border="1" cellpadding="2" cellspacing="2">
|
||||
<tbody>
|
||||
@@ -71,134 +79,103 @@ the array so you can quickly see what is used and what is not.
|
||||
<tr>
|
||||
<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="free">OOO</span><span class="option">~ ~~~~</span></td>
|
||||
<td class="bits"><span class="free">OOOO OOOO OOOO OOOO</span></td>
|
||||
<td class="bits">XXXX <span class="free">OOOO</span></td>
|
||||
<td class="bits">XXXX XX<span class="free">OO</span></td>
|
||||
<td class="bits">XXXX XXXX</td>
|
||||
<td class="bits"><span class="free">OOO</span>X XX<span class="free">OO</span></td>
|
||||
<td class="bits"><span class="free">OOOO OOOO</span></td>
|
||||
<td class="bits" rowspan=27><span class="used" title="Tile type">XXXX</span> <span class="used" title="Presence and direction of bridge above">XX</span> <span class="used" title="Tropic Zone: only meaningfull in tropic climate. It contains the definition of the available zones">XX</span></td>
|
||||
<td class="bits" rowspan=27><span class="used" title="Tile height">XXXX XXXX</span></td>
|
||||
<td class="bits" rowspan=2><span class="free">OOO</span><span class="usable" title="Owner (always OWNER_NONE)">1 OOOO</span></td>
|
||||
<td class="bits"><span class="free">OOOO OOOO OOOO OOOO</span></td>
|
||||
<td class="bits"><span class="used" title="Type of hedge on NE border">XXX</span> <span class="used" title="Snow presence">X</span><span class="free">OOOO</span></td>
|
||||
<td class="bits" rowspan=2><span class="used" title="Type of hedge on SW border">XXX</span> <span class="used" title="Type of hedge on SE border">XXX</span><span class="free">OO</span></td>
|
||||
<td class="bits" rowspan=2><span class="used" title="Update counter">XXX</span> <span class="used" title="Type: grass, rough land, rocks, fields, snow, desert">XXX</span> <span class="used" title="Density">XX</span></td><td class="bits" rowspan=2><span class="free" >OOO</span><span class="used" title="Type of hedge on NW border">X XX</span><span class="free">OO</span></td>
|
||||
<td class="bits" rowspan=2><span class="free">OOOO OOOO</span></td>
|
||||
<td class="bits" rowspan=2><span class="free">OOOO OOOO OOOO OOOO</span></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="caption">farmland</td>
|
||||
<td class="bits">-inherit-</td>
|
||||
<td class="bits">-inherit-</td>
|
||||
<td class="bits">-inherit-</td>
|
||||
<td class="bits">XXXX XXXX XXXX XXXX</td>
|
||||
<td class="bits">XXXX XXXX</td>
|
||||
<td class="bits">-inherit-</td>
|
||||
<td class="bits">-inherit-</td>
|
||||
<td class="bits"><span class="free">OOO</span>X XX<span class="free">OO</span></td>
|
||||
<td class="bits"><span class="free">OOOO OOOO</span></td>
|
||||
<td class="bits"><span class="free">OOOO OOOO OOOO OOOO</span></td>
|
||||
<td class="bits"><span class="pool" title="Industry index on pool">XXXX XXXX XXXX XXXX</span></td>
|
||||
<td class="bits"><span class="used" title="Type of hedge on NE border">XXX</span> <span class="used" title="Field production stage">XXXXX</span></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td rowspan=3>1</td>
|
||||
<td class="caption">rail</td>
|
||||
<td class="bits">XXXX XXXX</td>
|
||||
<td class="bits">XXXX XXXX</td>
|
||||
<td class="bits">X<span class="free">OO</span>X XXXX</td>
|
||||
<td class="bits"><span class="free">OOOO</span> XXXX <span class="free">OOOO OOOO</span></td>
|
||||
<td class="bits"><span class="free">OOOO OOOO</span></td>
|
||||
<td class="bits"><span class="free">OOOO</span> XXXX</td>
|
||||
<td class="bits">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"><span class="free">OOOO OOOO OO</span>XX XXXX</td>
|
||||
<td class="bits" rowspan=3><span class="used" title="Ship docking tile status (for half-tile with water)">X</span><span class="free">OO</span><span class="used" title="Owner">X XXXX</span></td>
|
||||
<td class="bits"><span class="free">OOOO</span> <span class="used" title="Reserved tracks">XXXX</span> <span class="free">OOOO OOOO</span></td>
|
||||
<td class="bits"><span class="free">OOOO OOOO</span> </td>
|
||||
<td class="bits"><span class="free">OOOO</span> <span class="used" title="Ground type: fences, snow, desert">XXXX</span></td>
|
||||
<td class="bits"><span class="used" title="Rail tile type: rail, rail with signals, depot">OO</span> <span class="used" title="Track pieces">XXXXXX</span></td>
|
||||
<td class="bits" rowspan=3><span class="free">OOOO OOOO</span></td>
|
||||
<td class="bits" rowspan=3><span class="free">OOOO OOOO</span></td>
|
||||
<td class="bits" rowspan=3><span class="free">OOOO OOOO OO</span><span class="used" title="Railway type">XX XXXX</span></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="caption">rail with signals</td>
|
||||
<td class="bits">-inherit-</td>
|
||||
<td class="bits">-inherit-</td>
|
||||
<td class="bits">-inherit-</td>
|
||||
<td class="bits"><span class="free">OOOO</span> XXXX XXXX XXXX</td>
|
||||
<td class="bits">XXXX <span class="free">OOOO</span></td>
|
||||
<td class="bits">XXXX XXXX</td>
|
||||
<td class="bits">-inherit-</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"><span class="free">OOOO</span> <span class="used" title="Reserved tracks">XXXX</span> <span class="used" title="Signal types and sempahore/lights">XXXX XXXX</span></td>
|
||||
<td class="bits"><span class="used" title="Signals present">XXXX</span> <span class="free">OOOO</span></td>
|
||||
<td class="bits"><span class="used" title="Signals colors">XXXX</span> <span class="used" title="Ground type: fences, snow, desert">XXXX</span></td>
|
||||
<td class="bits"><span class="used" title="Rail tile type: rail, rail with signals, depot">O1</span> <span class="used" title="Track pieces">XXXXXX</span></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="caption">depot</td>
|
||||
<td class="bits">-inherit-</td>
|
||||
<td class="bits">-inherit-</td>
|
||||
<td class="bits">-inherit-</td>
|
||||
<td class="bits">XXXX XXXX XXXX XXXX</td>
|
||||
<td class="bits">-inherit-</td>
|
||||
<td class="bits"><span class="free">OOOO</span> XXXX</td>
|
||||
<td class="bits">XX<span class="free">O</span>X <span class="free">OO</span>XX</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"><span class="pool" title="Depot index on pool">XXXX XXXX XXXX XXXX</span></td>
|
||||
<td class="bits"><span class="free">OOOO</span> <span class="free">OOOO</span></td>
|
||||
<td class="bits"><span class="free">OOOO</span> <span class="used" title="Ground type: fences, snow, desert (fences on depot are not valid)">XXXX</span></td>
|
||||
<td class="bits"><span class="used" title="Rail tile type: rail, rail with signals, depot">11</span><span class="free">O</span><span class="used" title="PBS reservation">X</span> <span class="free">OO</span><span class="used" title="Depot exit direction">XX</span></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<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="free">OOO</span>X XXXX</td>
|
||||
<td class="bits">XXXX XXXX XXXX XXXX</td>
|
||||
<td class="bits">XXXX XXXX</td>
|
||||
<td class="bits"><span class="free">OO</span>XX XXXX</td>
|
||||
<td class="bits">XXXX XXXX</td>
|
||||
<td class="bits"><span class="free">OO</span>XX X<span class="free">OOO</span></td>
|
||||
<td class="bits"><span class="free">OO</span>X<span class="free">O</span> XXXX</td>
|
||||
<td class="bits"><span class="free">OOOO</span> XXXX XX<span class="free">OO OOOO</span></td>
|
||||
<td class="bits"><span class="free">OOO</span><span class="used" title="Owner of road">X XXXX</span></td>
|
||||
<td class="bits" rowspan=2><span class="pool" title="Town index on pool">XXXX XXXX XXXX XXXX</span></td>
|
||||
<td class="bits"><span class="used" title="Owner of tram">XXXX</span> <span class="used" title="Tram pieces">XXXX</span></td>
|
||||
<td class="bits" rowspan=3><span class="free">OO</span><span class="used" title="Road type">XX XXXX</span></td>
|
||||
<td class="bits"><span class="used" title="Tile type: simple road (00), level crossing (01), road depot (10)">OO</span> <span class="used" title="Disallow vehicles to go a specific direction">XX</span> <span class="used" title="Road pieces">XXXX</span></td>
|
||||
<td class="bits"><span class="free">OO</span> <span class="used" title="Pavement type">XXX</span><span class="free">OOO</span></td>
|
||||
<td class="bits"><span class="free">OO</span><span class="used" title="Snow/desert present">X</span> <span class="free">O</span><span class="used" title="Roadworks counter">XXXX</span></td>
|
||||
<td class="bits" rowspan=1><span class="free">OOOO</span> <span class="used" title="Tram type">XXXX XX<span class="free">OO OOOO</span></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="caption">level crossing</td>
|
||||
<td class="bits">-inherit-</td>
|
||||
<td class="bits">-inherit-</td>
|
||||
<td class="bits">-inherit-</td>
|
||||
<td class="bits">-inherit-</td>
|
||||
<td class="bits">XXXX <span class="free">OOOO</span></td>
|
||||
<td class="bits"><span class="free">OOOO OOOO</span></td>
|
||||
<td class="bits">XXXX <span class="free">OOO</span>X</td>
|
||||
<td class="bits"><span class="free">OO</span>XX X<span class="free">OOO</span></td>
|
||||
<td class="bits"><span class="free">OO</span>XX XXXX</td>
|
||||
<td class="bits"><span class="free">OOOO</span> XXXX XXXX XXXX</td>
|
||||
<td class="bits"><span class="free">OOO</span><span class="used" title="Owner of rail track">X XXXX</span></td>
|
||||
<td class="bits"><span class="used" title="Owner of tram">XXXX</span> <span class="free">OOOO</span></td>
|
||||
<td class="bits"><span class="used" title="Tile type: simple road (00), level crossing (01), road depot (10)">O1</span> <span class="used" title="Lights are on">X</span> <span class="used" title="PBS reservation">X</span><span class="free">OOO</span><span class="used" title="Direction of the rail and roads">X</span></td>
|
||||
<td class="bits"><span class="free">OO</span> <span class="used" title="Pavement type">XXX</span><span class="free">OOO</span></td>
|
||||
<td class="bits"><span class="free">OO</span><span class="used" title="Snow/desert present">X</span> <span class="used" title="Owner of road">XXXXX</span></td>
|
||||
<td class="bits" rowspan=1><span class="free">OOOO</span> <span class="used" title="Tram type">XXXX XX</span> <span class="used" title="Railway type">XXXXXX</span></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="caption">road depot</td>
|
||||
<td class="bits">-inherit-</td>
|
||||
<td class="bits">-inherit-</td>
|
||||
<td class="bits">-inherit-</td>
|
||||
<td class="bits">-inherit-</td>
|
||||
<td class="bits">XXXX <span class="free">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">OOO</span><span class="used" title="Owner of the depot">X XXXX</span></td>
|
||||
<td class="bits"><span class="pool" title="Depot index on pool">XXXX XXXX XXXX XXXX</span></td>
|
||||
<td class="bits"><span class="usable" title="Owner of tram depot">XXXX</span> <span class="free">OOOO</span></td>
|
||||
<td class="bits"><span class="used" title="Tile type: simple road (00), level crossing (01), road depot (10)">1O</span><span class="free">OO OO</span><span class="used" title="Depot exit direction">XX</span></td>
|
||||
<td class="bits"><span class="free">OOOO OOOO</span></td>
|
||||
<td class="bits"><span class="free">OO</span>X<span class="free">O</span> XXXX</td>
|
||||
<td class="bits">-inherit-</td>
|
||||
<td class="bits"><span class="free">OO</span><span class="used" title="Snow/desert present">X</span> <span class="usable" title="Owner of road depot">XXXXX</span></td>
|
||||
<td class="bits" rowspan=1><span class="free">OOOO</span> <span class="used" title="Tram type">XXXX XX</span><span class="free">OO OOOO</span></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>3</td>
|
||||
<td class="caption">house</td>
|
||||
<td class="bits">XXXX XXXX</td>
|
||||
<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><span class="option">~ ~~</span>XX</td>
|
||||
<td class="bits">XXXX XXXX</td>
|
||||
<td class="bits">XXX<span class="abuse">X XXXX</span></td>
|
||||
<td class="bits"><span class="abuse">XXXX XX</span><span class="free">OO</span></td>
|
||||
<td class="bits">XXXX <span class="abuse">XXXX</span></td>
|
||||
<td class="bits"><span class="free">OOOO OOOO OOOO OOOO</span></td>
|
||||
<td rowspan=2>3</td>
|
||||
<td class="caption">finished house</td>
|
||||
<td class="bits" rowspan=2><span class="used" title="House random bits">XXXX XXXX</span></td>
|
||||
<td class="bits" rowspan=2><span class="pool" title="Town index on pool">XXXX XXXX XXXX XXXX</span></td>
|
||||
<td class="bits"><span class="used" title="House is complete/in construction (see m5)">1</span> <span class="used" title="House type (m4 + m3[6])">X</span><span class="free">O</span><span class="usable" title="Activated triggers (bits 2..4 don't have a meaning)">XXX</span><span class="used" title="Activated triggers (bits 2..4 don't have a meaning)">XX</span></td>
|
||||
<td class="bits" rowspan=2><span class="used" title="House type (m4 + m3[6])">XXXX XXXX</span></td>
|
||||
<td class="bits"><span class="used" title="Age in years, clamped at 255">XXXX XXXX</span></td>
|
||||
<td class="bits" rowspan=2><span class="abuse" title="Newhouses activated: periodic processing time remaining; if not, lift position for houses 04 and 05">XXXX XX</span><span class="free">OO</span></td>
|
||||
<td class="bits" rowspan=2><span class="abuse" title="If newhouses active, m7 is the current animation frame">XXXX</span> <span class="abuse" title="If newhouses active, m7 is the current animantion frame; if not, lift behaviour for houses 04 and 05">XXXX</span></td>
|
||||
<td class="bits" rowspan=2><span class="free">OOOO OOOO OOOO OOOO</span></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="caption">house under construction</td>
|
||||
<td class="bits"><span class="used" title="House is complete/in construction (see m5)">O</span> <span class="used" title="House type (m4 + m3[6])">X</span><span class="free">O</span><span class="usable" title="Activated triggers (bits 2..4 don't have a meaning)">XXX</span><span class="used" title="Activated triggers (bits 2..4 don't have a meaning)">XX</span></td>
|
||||
<td class="bits"><span class="free">OOO</span><span class="used" title="Construction stage">XX</span> <span class="used" title="Construction counter">XXX</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="free">O</span>XX<span class="option">~ ~~~~</span></td>
|
||||
<td class="bits"><span class="free">OOOO OOO</span>X XXXX XXXX</td>
|
||||
<td class="bits"><span class="option">~~</span>XX XXXX</td>
|
||||
<td class="bits"><span class="free">O</span><span class="used" title="Water class">XX</span><span class="usable" title="Owner (always OWNER_NONE)">1 OOOO</span></td>
|
||||
<td class="bits"><span class="free">OOOO OOO</span><span class="used" title="Tree ground">XXX</span> <span class="used" title="Tree density">XX</span> <span class="used" title="Tree counter">XXXX</span></td>
|
||||
<td class="bits"><span class="usable" title="Tree type unused bits">XX</span><span class="used" title="Tree type">XX XXXX</span></td>
|
||||
<td class="bits"><span class="free">OOOO OOOO</span></td>
|
||||
<td class="bits">XX<span class="free">OO O</span>XXX</td>
|
||||
<td class="bits"><span class="used" title="Number of trees on tile (+1)">XX</span><span class="free">OO O</span><span class="used" title="Tree growth">XXX</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"><span class="free">OOOO OOOO OOOO OOOO</span></td>
|
||||
@@ -206,189 +183,155 @@ the array so you can quickly see what is used and what is not.
|
||||
<tr>
|
||||
<td rowspan=7>5</td>
|
||||
<td class="caption">rail station</td>
|
||||
<td class="bits">XXXX XXXX</td>
|
||||
<td class="bits">XXXX XXXX</td>
|
||||
<td class="bits">XXXX XXXX</td>
|
||||
<td class="bits">XXXX XXXX XXXX XXXX</td>
|
||||
<td class="bits">XXXX <span class="free">OOOO</span></td>
|
||||
<td class="bits">XXXX XXXX</td>
|
||||
<td class="bits">XXXX XXXX</td>
|
||||
<td class="bits"><span class="free">OO</span>XX XX<span class="free">OO</span></td>
|
||||
<td class="bits">XXXX XXXX</td>
|
||||
<td class="bits"><span class="free">OOOO OOOO OO</span>XX XXXX</td>
|
||||
<td class="bits" rowspan=7><span class="free">O</span><span class="used" title="Water class">XX</span> <span class="used" title="Owner">XXXXX</span></td>
|
||||
<td class="bits" rowspan=7><span class="pool" title="Station index on pool">XXXX XXXX XXXX XXXX</span></td>
|
||||
<td class="bits" rowspan=2><span class="used" title="Random bits">XXXX</span> <span class="free">OOOO</span></td>
|
||||
<td class="bits" rowspan=2><span class="used" title="Custom station specifications ID">XXXX XXXX</span></td>
|
||||
<td class="bits"><span class="used" title="Graphics index">XXXX XXXX</span></td>
|
||||
<td class="bits" rowspan=2><span class="free">OO</span><span class="used" title="Station type">XXX</span> <span class="used" title="Reserved track">X</span><span class="free">OO</span></td>
|
||||
<td class="bits" rowspan=2><span class="used" title="Animation frame">XXXX XXXX</span></td>
|
||||
<td class="bits" rowspan=2><span class="free">OOOO OOOO OO</span><span class="used" title="Railway type">XX XXXX</span></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="caption">rail waypoint</td>
|
||||
<td class="bits">-inherit-</td>
|
||||
<td class="bits">-inherit-</td>
|
||||
<td class="bits">-inherit-</td>
|
||||
<td class="bits">-inherit-</td>
|
||||
<td class="bits">-inherit-</td>
|
||||
<td class="bits">-inherit-</td>
|
||||
<td class="bits">-inherit-</td>
|
||||
<td class="bits">-inherit-</td>
|
||||
<td class="bits">-inherit-</td>
|
||||
<td class="bits">-inherit-</td>
|
||||
<td class="bits"><span class="usable" title="Graphics index">OOOO OOO</span><span class="used" title="Graphics index">X</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">-inherit-</td>
|
||||
<td class="bits">XXXX <span class="free">OOOO</span></td>
|
||||
<td class="bits"><span class="free">OO</span>XX XXXX</td>
|
||||
<td class="bits"><span class="option">~~~~ ~</span>XXX</td>
|
||||
<td class="bits"><span class="free">OO</span>XX X<span class="free">OOO</span></td>
|
||||
<td class="bits"><span class="free">OOO</span>X XXXX</td>
|
||||
<td class="bits"><span class="free">OOOO</span> XXXX XX<span class="free">OO OOOO</span></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="caption">dock</td>
|
||||
<td class="bits">-inherit-</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="free">OOOO OOOO</span></td>
|
||||
<td class="bits"><span class="option">~~~~ ~</span>XXX</td>
|
||||
<td class="bits"><span class="free">OO</span>XX X<span class="free">OOO</span></td>
|
||||
<td class="bits"><span class="free">OOOO OOOO</span></td>
|
||||
<td class="bits"><span class="free">OOOO OOOO OOOO OOOO</span></td>
|
||||
<td class="bits"><span class="used" title="Owner of tram">XXXX</span> <span class="free">OOOO</span></td>
|
||||
<td class="bits"><span class="free">OO</span><span class="used" title="Roadtype for road stop">XX XXXX</span></td>
|
||||
<td class="bits"><span class="usable" title="Graphics index">OOOO O</span><span class="used" title="Graphics index: 00 (exit towards NE), 01 (exit towards SE), 02 (exit towards SW), 03 (exit towards NW), 04 (drive through X), 05 (drive through Y)">XXX</span></td>
|
||||
<td class="bits" rowspan=5><span class="free">OO</span><span class="used" title="Station type">XX X</span><span class="free">OOO</span></td>
|
||||
<td class="bits"><span class="free">OOO</span><span class="used" title="Owner of road">X XXXX</span></td>
|
||||
<td class="bits"><span class="free">OOOO</span> <span class="used" title="Tram type">XXXX XX<span class="free">OO 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">-inherit-</td>
|
||||
<td class="bits">XXXX <span class="free">OOOO</span></td>
|
||||
<td class="bits"><span class="used" title="Random bits">XXXX</span> <span class="free">OOOO</span></td>
|
||||
<td class="bits"><span class="free">OOOO OOOO</span></td>
|
||||
<td class="bits"><span class="used" title="Graphics index">XXXX XXXX</span></td>
|
||||
<td class="bits"><span class="used" title="Animation frame">XXXX XXXX</span></td>
|
||||
<td class="bits" rowspan=4><span class="free">OOOO OOOO OOOO OOOO</span></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="caption">dock</td>
|
||||
<td class="bits"><span class="free">OOOO OOOO</span></td>
|
||||
<td class="bits"><span class="free">OOOO OOOO</span></td>
|
||||
<td class="bits"><span class="usable" title="Graphics index">OOOO </span><span class="usable" title="Graphics index">O</span><span class="used" title="Graphics index">XXX</span></td>
|
||||
<td class="bits"><span class="free">OOOO OOOO</span></td>
|
||||
<td class="bits">XXXX XXXX</td>
|
||||
<td class="bits"><span class="free">OO</span>XX X<span class="free">OOO</span></td>
|
||||
<td class="bits">XXXX XXXX</td>
|
||||
<td class="bits"><span class="free">OOOO OOOO 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">-inherit-</td>
|
||||
<td class="bits"><span class="free">OOOO OOOO</span></td>
|
||||
<td class="bits"><span class="free">OOOO OOOO</span></td>
|
||||
<td class="bits"><span class="option">~~~~ ~~~~</span></td>
|
||||
<td class="bits"><span class="free">OO</span>XX X<span class="free">OOO</span></td>
|
||||
<td class="bits"><span class="usable">OOOO OOOO</span></td>
|
||||
<td class="bits"><span class="free">OOOO OOOO</span></td>
|
||||
<td class="bits"><span class="free">OOOO OOOO 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">-inherit-</td>
|
||||
<td class="bits"><span class="free">OOOO OOOO</span></td>
|
||||
<td class="bits"><span class="free">OOOO OOOO</span></td>
|
||||
<td class="bits"><span class="option">~~~~ ~~~~</span></td>
|
||||
<td class="bits"><span class="free">OO</span>XX X<span class="free">OOO</span></td>
|
||||
<td class="bits"><span class="usable">OOOO OOOO</span></td>
|
||||
<td class="bits"><span class="free">OOOO OOOO</span></td>
|
||||
<td class="bits"><span class="free">OOOO OOOO OOOO OOOO</span></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td rowspan=3>6</td>
|
||||
<td rowspan=4>6</td>
|
||||
<td class="caption">sea, shore</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">OOOO OOOO OOOO OOOO</span></td>
|
||||
<td class="bits" rowspan=4><span class="used" title="Ship docking tile status">X</span> <span class="used" title="Water class">XX</span> <span class="used" title="Owner">XXXXX</span></td>
|
||||
<td class="bits" rowspan=3><span class="free">OOOO OOOO OOOO OOOO</span></td>
|
||||
<td class="bits" rowspan=4><span class="free">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">X<span class="option">~~</span>X 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"><span class="free">OOOO OOOO OOOO OOOO</span></td>
|
||||
<td class="bits"><span class="used" title="Water tile type: coast, clear, lock, depot">O<span class="usable">OO</span>O</span> <span class="free">OOO</span><span class="used" title="Sea shore flag">X</span></td>
|
||||
<td class="bits" rowspan=4><span class="free">OOOO OOOO</span></td>
|
||||
<td class="bits" rowspan=4><span class="free">OOOO OOOO</td>
|
||||
<td class="bits" rowspan=4><span class="free">OOOO OOOO 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">-inherit-</td>
|
||||
<td class="bits"><span class="free">OOOO OOOO OOOO OOOO</span></td>
|
||||
<td class="bits"><span class="used" title="Canal/river random bits">XXXX XXXX</span></td>
|
||||
<td class="bits"><span class="used" title="Water tile type: coast, clear, lock, depot">O<span class="usable">OO</span>O</span> <span class="free">OOOO</span></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="caption">lock</td>
|
||||
<td class="bits"><span class="free">OOOO OOOO</span></td>
|
||||
<td class="bits">XXXX XXXX</td>
|
||||
<td class="bits">-inherit-</td>
|
||||
<td class="bits"><span class="free">OOOO OOOO</span></td>
|
||||
<td class="bits"><span class="free">OOOO OOOO</span></td>
|
||||
<td class="bits"><span class="free">OOOO OOOO OOOO OOOO</span></td>
|
||||
<td class="bits"><span class="used" title="Water tile type: coast, clear, lock, depot">O<span class="usable">OO</span>1</span> <span class="used" title="Lock part">XX</span> <span class="used" title="Lock orientation m5[1..0]">XX</span></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="caption">shipdepot</td>
|
||||
<td class="bits">-inherit-</td>
|
||||
<td class="bits">-inherit-</td>
|
||||
<td class="bits">-inherit-</td>
|
||||
<td class="bits">XXXX XXXX XXXX XXXX</td>
|
||||
<td class="bits"><span class="pool" title="Depot index on pool">XXXX XXXX XXXX XXXX</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">-inherit-</td>
|
||||
<td class="bits"><span class="free">OOOO OOOO</span></td>
|
||||
<td class="bits"><span class="free">OOOO OOOO</span></td>
|
||||
<td class="bits"><span class="free">OOOO OOOO OOOO OOOO</span></td>
|
||||
<td class="bits"><span class="used" title="Water tile type: coast, clear, lock, depot">1<span class="usable">OOO</span></span> <span class="free">OO</span><span class="used" title="Depot axis">X</span> <span class="used" title="Depot part">X</span></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>8</td>
|
||||
<td class="caption">industry</td>
|
||||
<td class="bits">XXXX XXXX</td>
|
||||
<td class="bits">XXXX XXXX</td>
|
||||
<td class="bits">XXX<span class="free">O</span> <span class="abuse">XXXX</span></td>
|
||||
<td class="bits">XXXX XXXX XXXX XXXX</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 XX<span class="free">OO</span></td>
|
||||
<td class="bits">XXXX XXXX</td>
|
||||
<td class="bits"><span class="free">OOOO OOOO OOOO OOOO</span></td>
|
||||
<td rowspan=2>8</td>
|
||||
<td class="caption">finished industry</td>
|
||||
<td class="bits"><span class="used" title="Completed industry">1</span> <span class="used" title="Water class">XX</span><span class="free">O</span> <span class="free">OOOO</span></td>
|
||||
<td class="bits" rowspan=2><span class="pool" title="Industry index on pool">XXXX XXXX XXXX XXXX</span></td>
|
||||
<td class="bits" rowspan=2><span class="used" title="Random bits">XXXX XXXX</span></td>
|
||||
<td class="bits" rowspan=2><span class="used" title="Animation loop">XXXX XXXX</span></td>
|
||||
<td class="bits" rowspan=2><span class="used" title="Industry graphics ID (m5 + m6[2])">XXXX XXXX</span></td>
|
||||
<td class="bits" rowspan=2><span class="free">OO</span><span class="used" title="Random triggers (NewGRF)">XXX</span> <span class="used" title="Industry graphics ID (m5 + m6[2])">X</span><span class="free">OO</span></td>
|
||||
<td class="bits" rowspan=2><span class="used" title="Animation frame">XXXX XXXX</span></td>
|
||||
<td class="bits" rowspan=2><span class="free">OOOO OOOO OOOO OOOO</span></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="caption">industry under construction</td>
|
||||
<td class="bits"><span class="used" title="Completed industry">O</span> <span class="used" title="Water class">XX</span><span class="free">O</span> <span class="used" title="If under construction, construction counter and stage of construction">XXXX</span></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<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">X<span class="free">OO</span>X XXXX</td>
|
||||
<td class="bits"><span class="free">OOOO OOOO OOOO OOOO</span></td>
|
||||
<td class="bits">XXXX <span class="free">OOOO</span></td>
|
||||
<td class="bits"><span class="free">OO</span>XX XXXX</td>
|
||||
<td class="bits">X<span class="free">OO</span>X XXXX</td>
|
||||
<td class="bits" rowspan=2><span class="used" title="Ship docking tile status (for aqueducts)">X</span><span class="free">OO</span> <span class="used" title="Owner">XXXXX</span></td>
|
||||
<td class="bits" rowspan=2><span class="free">OOOO OOOO OOOO OOOO</span></td>
|
||||
<td class="bits" rowspan=2><span class="rearrange" title="Owner of tram (road only; a rearrangement can free some of these bits)">XXXX</span> <span class="free">OOOO</span></td>
|
||||
<td class="bits" rowspan=2><span class="free">OO</span><span class="used" title="Road type">XX XXXX</span></td>
|
||||
<td class="bits"><span class="used" title="Bridge or tunnel bit">O</span><span class="free">OO</span><span class="rearrange" title="PBS reservation (rail; a rearrangement can free some of these bits)">X</span> <span class="used" title="Transport type">XX</span> <span class="used" title="Direction of the tunnel/bridge">XX</span></td>
|
||||
<td class="bits"><span class="free">OOOO OOOO</span></td>
|
||||
<td class="bits"><span class="free">OO</span>XX XXXX</td>
|
||||
<td class="bits"><span class="free">OOOO</span> XXXX XXXX XXXX</td>
|
||||
<td class="bits" rowspan=2><span class="free">OO</span><span class="used" title="Snow/desert present">X</span><span class="rearrange" title="Owner of road (road only; a rearrangement can free some of these bits)">X XXXX</span></td>
|
||||
<td class="bits" rowspan=2><span class="free">OOOO</span> <span class="used" title="Tram type">XXXX XX</span><span class="rearrange" title="Railway type (rail only; a rearrangement can free some of these bits)">XX XXXX</span></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>bridge ramp</td>
|
||||
<td class="bits">-inherit-</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">-inherit-</td>
|
||||
<td class="bits">-inherit-</td>
|
||||
<td class="bits">-inherit-</td>
|
||||
<td class="bits"><span class="free">OO</span>XX XX<span class="free">OO</span></td>
|
||||
<td class="bits">-inherit-</td>
|
||||
<td class="bits">-inherit-</td>
|
||||
<td class="bits"><span class="used" title="Bridge or tunnel bit">1</span><span class="free">OO</span><span class="rearrange" title="PBS reservation (rail; a rearrangement can free some of these bits)">X</span> <span class="used" title="Transport type">XX</span> <span class="used" title="Direction of the tunnel/bridge">XX</span></td>
|
||||
<td class="bits"><span class="free">OO</span><span class="used" title="Bridge type: wooden, steel,...">XX XX</span><span class="free">OO</span></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td rowspan=2>A</td>
|
||||
<td>A</td>
|
||||
<td class="caption">objects</td>
|
||||
<td class="bits">XXXX XXXX</td>
|
||||
<td class="bits">XXXX XXXX</td>
|
||||
<td class="bits"><span class="free">O</span>XXX XXXX</td>
|
||||
<td class="bits">XXXX XXXX XXXX XXXX</td>
|
||||
<td class="bits">XXXX XXXX</td>
|
||||
<td class="bits"><span class="free">O</span><span class="used" title="Water class">XX</span> <span class="used" title="Owner">XXXXX</span></td>
|
||||
<td class="bits"><span class="pool" title="Object index on pool (m2 + m5)">XXXX XXXX XXXX XXXX</span></td>
|
||||
<td class="bits"><span class="used" title="Random bits">XXXX XXXX</span></td>
|
||||
<td class="bits"><span class="free">OOOO OOOO</span></td>
|
||||
<td class="bits">XXXX XXXX</td>
|
||||
<td class="bits"><span class="pool" title="Object index on pool (m2 + m5)">XXXX XXXX</span></td>
|
||||
<td class="bits"><span class="free">OOOO OOOO</span></td>
|
||||
<td class="bits">XXXX XXXX</td>
|
||||
<td class="bits"><span class="free">OOOO OOOO OOOO OOOO</span></td>
|
||||
<td class="bits"><span class="used" title="Animation counter">XXXX XXXX</span></td>
|
||||
<td class="bits" rowspan=1><span class="free">OOOO OOOO OOOO OOOO</span></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td colspan=2 class="caption">bits</td>
|
||||
<td class="bits">7654 3210</td>
|
||||
<td class="bits">7654 3210</td>
|
||||
<td class="bits">7654 3210</td>
|
||||
<td class="bits">FEDC BA98 7654 3210</td>
|
||||
<td class="bits">7654 3210</td>
|
||||
<td class="bits">7654 3210</td>
|
||||
<td class="bits">7654 3210</td>
|
||||
<td class="bits">7654 3210</td>
|
||||
<td class="bits">7654 3210</td>
|
||||
<td class="bits">FEDC BA98 7654 3210</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th colspan=2>class</th>
|
||||
<th>type (8)</th>
|
||||
<th>height (8)</th>
|
||||
<th>m1 (8)</th>
|
||||
<th>m2 (16)</th>
|
||||
<th>m3 (8)</th>
|
||||
<th>m4 (8)</th>
|
||||
<th>m5 (8)</th>
|
||||
<th>m6 (8)</th>
|
||||
<th>m7 (8)</th>
|
||||
<th>m8 (16)</th>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
@@ -211,3 +211,10 @@ Last updated: 2011-02-16
|
||||
communication from an admin tool reach the programme. See section 1
|
||||
'Starting a server' further up for the ports and protocols used by OpenTTD.
|
||||
The ports can be configured in the config file.
|
||||
|
||||
- My advertising server warns a lot about getaddrinfo taking N seconds
|
||||
This could be a transient issue with your (local) DNS server, but if the
|
||||
problem persists there is likely a configuration issue in DNS resolving
|
||||
on your computer. This seems to be a common configuration issue for
|
||||
Docker instances, where the DNS resolving waits for a time out of usually
|
||||
5 seconds.
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
OpenTTD's known bugs
|
||||
Last updated: 2021-01-22
|
||||
Release version: 1.11.0-beta1
|
||||
Last updated: 2021-04-01
|
||||
Release version: 1.11.0
|
||||
------------------------------------------------------------------------
|
||||
|
||||
|
||||
@@ -364,35 +364,6 @@ Trains might not stop at platforms that are currently being changed [#5553]:
|
||||
list multiple times in a row or if there is only one station
|
||||
in theorder list (see #5684).
|
||||
|
||||
Inconsistent catchment areas [#5661]:
|
||||
Due to performance decisions the catchment area for cargo accepted by a
|
||||
station for delivery to houses or industries differs from the catchment
|
||||
area for cargo that is delivered to stations from houses or industries.
|
||||
|
||||
Conceptually they work the same, but the effect in game differs. They
|
||||
work by finding the closest destination "around" the source which is
|
||||
within a certain distance. This distance depends on the type of station,
|
||||
e.g. road stops have a smaller catchment area than large airports.
|
||||
In both cases the bounding box, the smallest rectangle that contains
|
||||
all tiles of something, is searched for the target of the cargo,
|
||||
and then spiraling outwards finding the closest tile of the target.
|
||||
|
||||
In the case of a station with two tiles spread far apart with a house
|
||||
that is within the station's bounding box, it would be possible that
|
||||
the spiraling search from the house does not reach one of the station
|
||||
tiles before the search ends, i.e. all tiles within that distance
|
||||
are searched. So the house does not deliver cargo to the station.
|
||||
On the other hand, the station will deliver cargo because the house
|
||||
falls within the bounding box, and thus search area.
|
||||
|
||||
It is possible to make these consistent, but then cargo from a house
|
||||
to a station needs to search up to 32 tiles around itself, i.e. 64
|
||||
by 64 tiles, to find all possible stations it could deliver to
|
||||
instead of 10 by 10 tiles (40 times more tiles). Alternatively the
|
||||
search from a station could be changed to use the actual tiles, but
|
||||
that would require considering checking 10 by 10 tiles for each of
|
||||
the tiles of a station, instead of just once.
|
||||
|
||||
Some houses and industries are not affected by transparency [#5817]:
|
||||
Some of the default houses and industries (f.e. the iron ore mine) are
|
||||
not affected by the transparency options. This is because the graphics
|
||||
@@ -409,3 +380,12 @@ Involuntary cargo exchange with cargodist via neutral station [#6114]:
|
||||
shared station make the order "no unload" and if you're unloading make
|
||||
it "no load". Cargodist will then figure out that it should not create
|
||||
such a route.
|
||||
|
||||
Incorrect ending year displayed in end of game newspaper [#8625]
|
||||
The ending year of the game is configurable, but the date displayed in
|
||||
the newspaper at the end of the game is part of the graphics, not text.
|
||||
So to fix this would involve fixing the graphics in every baseset,
|
||||
including the original. Additionally, basesets are free to put this
|
||||
text in different positions (which they do), making a proper solution
|
||||
to this infinitely more complex for a part of the game that fewer than
|
||||
1% of players ever see.
|
||||
|
||||
98
media/CMakeLists.txt
Normal file
98
media/CMakeLists.txt
Normal file
@@ -0,0 +1,98 @@
|
||||
add_subdirectory(baseset)
|
||||
|
||||
add_library(media
|
||||
INTERFACE
|
||||
)
|
||||
add_library(openttd::media ALIAS media)
|
||||
|
||||
if(NOT UNIX OR APPLE)
|
||||
return()
|
||||
endif()
|
||||
|
||||
set(MEDIA_PNG_SOURCE_FILES
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/openttd.16.png
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/openttd.32.png
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/openttd.48.png
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/openttd.64.png
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/openttd.128.png
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/openttd.256.png
|
||||
)
|
||||
|
||||
# Walk over all the png files, and generate a command to copy them
|
||||
foreach(MEDIA_PNG_SOURCE_FILE IN LISTS MEDIA_PNG_SOURCE_FILES)
|
||||
get_filename_component(MEDIA_PNG_FILE_NAME "${MEDIA_PNG_SOURCE_FILE}" NAME)
|
||||
string(REGEX REPLACE "[^.]+.([0-9]*).*" "${CMAKE_CURRENT_BINARY_DIR}/icons/hicolor/\\1x\\1/apps/${BINARY_NAME}.png" MEDIA_PNG_BINARY_FILE "${MEDIA_PNG_FILE_NAME}")
|
||||
|
||||
add_custom_command(OUTPUT ${MEDIA_PNG_BINARY_FILE}
|
||||
COMMAND ${CMAKE_COMMAND} -E copy
|
||||
${MEDIA_PNG_SOURCE_FILE}
|
||||
${MEDIA_PNG_BINARY_FILE}
|
||||
MAIN_DEPENDENCY ${MEDIA_PNG_SOURCE_FILE}
|
||||
WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}
|
||||
COMMENT "Copying ${MEDIA_PNG_FILE_NAME} file"
|
||||
)
|
||||
|
||||
list(APPEND MEDIA_BINARY_FILES ${MEDIA_PNG_BINARY_FILE})
|
||||
endforeach()
|
||||
|
||||
set(MEDIA_XPM_SOURCE_FILES
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/openttd.32.xpm
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/openttd.64.xpm
|
||||
)
|
||||
|
||||
# Walk over all the xpm files, and generate a command to copy them
|
||||
foreach(MEDIA_XPM_SOURCE_FILE IN LISTS MEDIA_XPM_SOURCE_FILES)
|
||||
get_filename_component(MEDIA_XPM_FILE_NAME "${MEDIA_XPM_SOURCE_FILE}" NAME)
|
||||
get_filename_component(MEDIA_XPM_FILE_EXT "${MEDIA_XPM_FILE_NAME}" EXT)
|
||||
set(MEDIA_XPM_BINARY_FILE "${CMAKE_CURRENT_BINARY_DIR}/pixmaps/${BINARY_NAME}${MEDIA_XPM_FILE_EXT}")
|
||||
|
||||
add_custom_command(OUTPUT ${MEDIA_XPM_BINARY_FILE}
|
||||
COMMAND ${CMAKE_COMMAND} -E copy
|
||||
${MEDIA_XPM_SOURCE_FILE}
|
||||
${MEDIA_XPM_BINARY_FILE}
|
||||
MAIN_DEPENDENCY ${MEDIA_XPM_SOURCE_FILE}
|
||||
WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}
|
||||
COMMENT "Copying ${MEDIA_XPM_FILE_NAME} file"
|
||||
)
|
||||
|
||||
list(APPEND MEDIA_BINARY_FILES ${MEDIA_XPM_BINARY_FILE})
|
||||
endforeach()
|
||||
|
||||
# Create a new target which copies media files
|
||||
add_custom_target(media_files
|
||||
DEPENDS
|
||||
${MEDIA_BINARY_FILES}
|
||||
)
|
||||
|
||||
add_dependencies(media
|
||||
media_files
|
||||
)
|
||||
|
||||
get_target_property(LANG_SOURCE_FILES language_files LANG_SOURCE_FILES)
|
||||
|
||||
set(DESKTOP_BINARY_NAME ${BINARY_NAME}.desktop)
|
||||
|
||||
add_custom_command_timestamp(OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/${DESKTOP_BINARY_NAME}
|
||||
COMMAND ${CMAKE_COMMAND}
|
||||
-DDESKTOP_SOURCE_FILE=${CMAKE_CURRENT_SOURCE_DIR}/openttd.desktop
|
||||
-DDESKTOP_BINARY_FILE=${CMAKE_CURRENT_BINARY_DIR}/${DESKTOP_BINARY_NAME}
|
||||
-DBINARY_NAME=${BINARY_NAME}
|
||||
-P ${CMAKE_SOURCE_DIR}/cmake/scripts/Desktop.cmake
|
||||
--
|
||||
${LANG_SOURCE_FILES}
|
||||
MAIN_DEPENDENCY ${CMAKE_CURRENT_SOURCE_DIR}/openttd.desktop
|
||||
DEPENDS ${LANG_SOURCE_FILES}
|
||||
${CMAKE_SOURCE_DIR}/cmake/scripts/Desktop.cmake
|
||||
WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}
|
||||
COMMENT "Generating desktop file"
|
||||
)
|
||||
|
||||
# Create a new target which generates desktop file
|
||||
add_custom_target_timestamp(desktop_file
|
||||
DEPENDS
|
||||
${CMAKE_CURRENT_BINARY_DIR}/${DESKTOP_BINARY_NAME}
|
||||
)
|
||||
|
||||
add_dependencies(media
|
||||
desktop_file
|
||||
)
|
||||
Binary file not shown.
@@ -2,10 +2,10 @@
|
||||
[Desktop Entry]
|
||||
Type=Application
|
||||
Version=1.0
|
||||
Name=!!MENU_NAME!!
|
||||
Icon=!!TTD!!
|
||||
Exec=!!TTD!!
|
||||
Name=OpenTTD
|
||||
Icon=${BINARY_NAME}
|
||||
Exec=${BINARY_NAME}
|
||||
Terminal=false
|
||||
Categories=!!MENU_GROUP!!
|
||||
Comment=A clone of Transport Tycoon Deluxe
|
||||
Categories=Game;
|
||||
Keywords=game;simulation;transport;tycoon;deluxe;economics;multiplayer;money;train;ship;bus;truck;aircraft;cargo;
|
||||
@Comment_STR_DESKTOP_SHORTCUT_COMMENT@
|
||||
@@ -1,11 +0,0 @@
|
||||
# This file is part of OpenTTD.
|
||||
# OpenTTD is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, version 2.
|
||||
# OpenTTD is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
|
||||
# See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with OpenTTD. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
#
|
||||
# Awk script to automatically remove duplicate Comment[i]= lines
|
||||
#
|
||||
|
||||
BEGIN { FS = "="; last = "" }
|
||||
{ if (last != $1) { print $0 }; last = $1 }
|
||||
@@ -1,13 +0,0 @@
|
||||
# This file is part of OpenTTD.
|
||||
# OpenTTD is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, version 2.
|
||||
# OpenTTD is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
|
||||
# See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with OpenTTD. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
#
|
||||
# Awk script to automatically generate a comment lines for
|
||||
# a translated desktop shortcut. If it does not exist there
|
||||
# is no output.
|
||||
#
|
||||
|
||||
/##isocode/ { lang = $2; next }
|
||||
/STR_DESKTOP_SHORTCUT_COMMENT/ { sub("^[^:]*:", "", $0); print "Comment[" lang "]=" $0; sub("_.*", "", lang); print "Comment[" lang "]=" $0; next}
|
||||
@@ -1,4 +1,4 @@
|
||||
FROM emscripten/emsdk
|
||||
FROM emscripten/emsdk:2.0.10
|
||||
|
||||
COPY emsdk-liblzma.patch /
|
||||
RUN cd /emsdk/upstream/emscripten && patch -p1 < /emsdk-liblzma.patch
|
||||
|
||||
@@ -71,6 +71,34 @@ Module.preRun.push(function() {
|
||||
* add_server("localhost", 3979); */
|
||||
}
|
||||
|
||||
var leftButtonDown = false;
|
||||
document.addEventListener("mousedown", e => {
|
||||
if (e.button == 0) {
|
||||
leftButtonDown = true;
|
||||
}
|
||||
});
|
||||
document.addEventListener("mouseup", e => {
|
||||
if (e.button == 0) {
|
||||
leftButtonDown = false;
|
||||
}
|
||||
});
|
||||
window.openttd_open_url = function(url, url_len) {
|
||||
const url_string = UTF8ToString(url, url_len);
|
||||
function openWindow() {
|
||||
document.removeEventListener("mouseup", openWindow);
|
||||
window.open(url_string, '_blank');
|
||||
}
|
||||
/* Trying to open the URL while the mouse is down results in the button getting stuck, so wait for the
|
||||
* mouse to be released before opening it. However, when OpenTTD is lagging, the mouse can get released
|
||||
* before the button click even registers, so check for that, and open the URL immediately if that's the
|
||||
* case. */
|
||||
if (leftButtonDown) {
|
||||
document.addEventListener("mouseup", openWindow);
|
||||
} else {
|
||||
openWindow();
|
||||
}
|
||||
}
|
||||
|
||||
/* https://github.com/emscripten-core/emscripten/pull/12995 implements this
|
||||
* properly. Till that time, we use a polyfill. */
|
||||
SOCKFS.websocket_sock_ops.createPeer_ = SOCKFS.websocket_sock_ops.createPeer;
|
||||
|
||||
@@ -29,5 +29,7 @@
|
||||
<string>Copyright 2004-${CURRENT_YEAR} The OpenTTD team</string>
|
||||
<key>NSPrincipalClass</key>
|
||||
<string>NSApplication</string>
|
||||
<key>NSHighResolutionCapable</key>
|
||||
<string>True</string>
|
||||
</dict>
|
||||
</plist>
|
||||
|
||||
@@ -56,3 +56,13 @@ cat <<EOF > notarize.json
|
||||
EOF
|
||||
|
||||
gon notarize.json
|
||||
|
||||
app_filename=(_CPack_Packages/*/Bundle/openttd-*/OpenTTD.app)
|
||||
|
||||
if [ "${app_filename}" = "_CPack_Packages/*/Bundle/openttd-*/OpenTTD.app" ]; then
|
||||
echo "No .app found in the _CPack_Packages directory, skipping stapling."
|
||||
exit 0
|
||||
fi;
|
||||
|
||||
# Now staple the ticket to the .app
|
||||
xcrun stapler staple "${app_filename[0]}"
|
||||
|
||||
57
os/steam/release.vdf
Normal file
57
os/steam/release.vdf
Normal file
@@ -0,0 +1,57 @@
|
||||
"AppBuild"
|
||||
{
|
||||
"AppID" "1536610"
|
||||
"Desc" "@@DESCRIPTION@@"
|
||||
|
||||
"SetLive" "@@BRANCH@@"
|
||||
|
||||
"ContentRoot" "./"
|
||||
"BuildOutput" "build/"
|
||||
|
||||
"Depots"
|
||||
{
|
||||
"1536613"
|
||||
{
|
||||
"ContentRoot" "./steam-win32"
|
||||
"FileMapping"
|
||||
{
|
||||
"LocalPath" "*"
|
||||
"DepotPath" "."
|
||||
"recursive" "1"
|
||||
}
|
||||
}
|
||||
|
||||
"1536612"
|
||||
{
|
||||
"ContentRoot" "./steam-win64"
|
||||
"FileMapping"
|
||||
{
|
||||
"LocalPath" "*"
|
||||
"DepotPath" "."
|
||||
"recursive" "1"
|
||||
}
|
||||
}
|
||||
|
||||
"1536614"
|
||||
{
|
||||
"ContentRoot" "./steam-macos"
|
||||
"FileMapping"
|
||||
{
|
||||
"LocalPath" "*"
|
||||
"DepotPath" "."
|
||||
"recursive" "1"
|
||||
}
|
||||
}
|
||||
|
||||
"1536615"
|
||||
{
|
||||
"ContentRoot" "./steam-linux"
|
||||
"FileMapping"
|
||||
{
|
||||
"LocalPath" "*"
|
||||
"DepotPath" "."
|
||||
"recursive" "1"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -7,6 +7,7 @@ class Regression extends AIInfo {
|
||||
function GetAPIVersion() { return "1.11"; }
|
||||
function GetDate() { return "2007-03-18"; }
|
||||
function CreateInstance() { return "Regression"; }
|
||||
function UseAsRandomAI() { return false; }
|
||||
}
|
||||
|
||||
RegisterAI(Regression());
|
||||
|
||||
@@ -7,6 +7,7 @@ class StationList extends AIInfo {
|
||||
function GetAPIVersion() { return "1.11"; }
|
||||
function GetDate() { return "2007-03-18"; }
|
||||
function CreateInstance() { return "StationList"; }
|
||||
function UseAsRandomAI() { return false; }
|
||||
}
|
||||
|
||||
RegisterAI(StationList());
|
||||
|
||||
1
src/3rdparty/CMakeLists.txt
vendored
1
src/3rdparty/CMakeLists.txt
vendored
@@ -1,3 +1,4 @@
|
||||
add_subdirectory(md5)
|
||||
add_subdirectory(squirrel)
|
||||
add_subdirectory(opengl)
|
||||
add_subdirectory(os2)
|
||||
|
||||
10
src/3rdparty/opengl/CMakeLists.txt
vendored
Normal file
10
src/3rdparty/opengl/CMakeLists.txt
vendored
Normal file
@@ -0,0 +1,10 @@
|
||||
add_files(
|
||||
khrplatform.h
|
||||
glext.h
|
||||
CONDITION OPENGL_FOUND
|
||||
)
|
||||
|
||||
add_files(
|
||||
wglext.h
|
||||
CONDITION WIN32 AND OPENGL_FOUND
|
||||
)
|
||||
12861
src/3rdparty/opengl/glext.h
vendored
Normal file
12861
src/3rdparty/opengl/glext.h
vendored
Normal file
File diff suppressed because it is too large
Load Diff
290
src/3rdparty/opengl/khrplatform.h
vendored
Normal file
290
src/3rdparty/opengl/khrplatform.h
vendored
Normal file
@@ -0,0 +1,290 @@
|
||||
#ifndef __khrplatform_h_
|
||||
#define __khrplatform_h_
|
||||
|
||||
/*
|
||||
** Copyright (c) 2008-2018 The Khronos Group Inc.
|
||||
**
|
||||
** Permission is hereby granted, free of charge, to any person obtaining a
|
||||
** copy of this software and/or associated documentation files (the
|
||||
** "Materials"), to deal in the Materials without restriction, including
|
||||
** without limitation the rights to use, copy, modify, merge, publish,
|
||||
** distribute, sublicense, and/or sell copies of the Materials, and to
|
||||
** permit persons to whom the Materials are furnished to do so, subject to
|
||||
** the following conditions:
|
||||
**
|
||||
** The above copyright notice and this permission notice shall be included
|
||||
** in all copies or substantial portions of the Materials.
|
||||
**
|
||||
** THE MATERIALS ARE PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
||||
** EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
||||
** MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
|
||||
** IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
|
||||
** CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
|
||||
** TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
|
||||
** MATERIALS OR THE USE OR OTHER DEALINGS IN THE MATERIALS.
|
||||
*/
|
||||
|
||||
/* Khronos platform-specific types and definitions.
|
||||
*
|
||||
* The master copy of khrplatform.h is maintained in the Khronos EGL
|
||||
* Registry repository at https://github.com/KhronosGroup/EGL-Registry
|
||||
* The last semantic modification to khrplatform.h was at commit ID:
|
||||
* 67a3e0864c2d75ea5287b9f3d2eb74a745936692
|
||||
*
|
||||
* Adopters may modify this file to suit their platform. Adopters are
|
||||
* encouraged to submit platform specific modifications to the Khronos
|
||||
* group so that they can be included in future versions of this file.
|
||||
* Please submit changes by filing pull requests or issues on
|
||||
* the EGL Registry repository linked above.
|
||||
*
|
||||
*
|
||||
* See the Implementer's Guidelines for information about where this file
|
||||
* should be located on your system and for more details of its use:
|
||||
* http://www.khronos.org/registry/implementers_guide.pdf
|
||||
*
|
||||
* This file should be included as
|
||||
* #include <KHR/khrplatform.h>
|
||||
* by Khronos client API header files that use its types and defines.
|
||||
*
|
||||
* The types in khrplatform.h should only be used to define API-specific types.
|
||||
*
|
||||
* Types defined in khrplatform.h:
|
||||
* khronos_int8_t signed 8 bit
|
||||
* khronos_uint8_t unsigned 8 bit
|
||||
* khronos_int16_t signed 16 bit
|
||||
* khronos_uint16_t unsigned 16 bit
|
||||
* khronos_int32_t signed 32 bit
|
||||
* khronos_uint32_t unsigned 32 bit
|
||||
* khronos_int64_t signed 64 bit
|
||||
* khronos_uint64_t unsigned 64 bit
|
||||
* khronos_intptr_t signed same number of bits as a pointer
|
||||
* khronos_uintptr_t unsigned same number of bits as a pointer
|
||||
* khronos_ssize_t signed size
|
||||
* khronos_usize_t unsigned size
|
||||
* khronos_float_t signed 32 bit floating point
|
||||
* khronos_time_ns_t unsigned 64 bit time in nanoseconds
|
||||
* khronos_utime_nanoseconds_t unsigned time interval or absolute time in
|
||||
* nanoseconds
|
||||
* khronos_stime_nanoseconds_t signed time interval in nanoseconds
|
||||
* khronos_boolean_enum_t enumerated boolean type. This should
|
||||
* only be used as a base type when a client API's boolean type is
|
||||
* an enum. Client APIs which use an integer or other type for
|
||||
* booleans cannot use this as the base type for their boolean.
|
||||
*
|
||||
* Tokens defined in khrplatform.h:
|
||||
*
|
||||
* KHRONOS_FALSE, KHRONOS_TRUE Enumerated boolean false/true values.
|
||||
*
|
||||
* KHRONOS_SUPPORT_INT64 is 1 if 64 bit integers are supported; otherwise 0.
|
||||
* KHRONOS_SUPPORT_FLOAT is 1 if floats are supported; otherwise 0.
|
||||
*
|
||||
* Calling convention macros defined in this file:
|
||||
* KHRONOS_APICALL
|
||||
* KHRONOS_APIENTRY
|
||||
* KHRONOS_APIATTRIBUTES
|
||||
*
|
||||
* These may be used in function prototypes as:
|
||||
*
|
||||
* KHRONOS_APICALL void KHRONOS_APIENTRY funcname(
|
||||
* int arg1,
|
||||
* int arg2) KHRONOS_APIATTRIBUTES;
|
||||
*/
|
||||
|
||||
#if defined(__SCITECH_SNAP__) && !defined(KHRONOS_STATIC)
|
||||
# define KHRONOS_STATIC 1
|
||||
#endif
|
||||
|
||||
/*-------------------------------------------------------------------------
|
||||
* Definition of KHRONOS_APICALL
|
||||
*-------------------------------------------------------------------------
|
||||
* This precedes the return type of the function in the function prototype.
|
||||
*/
|
||||
#if defined(KHRONOS_STATIC)
|
||||
/* If the preprocessor constant KHRONOS_STATIC is defined, make the
|
||||
* header compatible with static linking. */
|
||||
# define KHRONOS_APICALL
|
||||
#elif defined(_WIN32)
|
||||
# define KHRONOS_APICALL __declspec(dllimport)
|
||||
#elif defined (__SYMBIAN32__)
|
||||
# define KHRONOS_APICALL IMPORT_C
|
||||
#elif defined(__ANDROID__)
|
||||
# define KHRONOS_APICALL __attribute__((visibility("default")))
|
||||
#else
|
||||
# define KHRONOS_APICALL
|
||||
#endif
|
||||
|
||||
/*-------------------------------------------------------------------------
|
||||
* Definition of KHRONOS_APIENTRY
|
||||
*-------------------------------------------------------------------------
|
||||
* This follows the return type of the function and precedes the function
|
||||
* name in the function prototype.
|
||||
*/
|
||||
#if defined(_WIN32) && !defined(_WIN32_WCE) && !defined(__SCITECH_SNAP__)
|
||||
/* Win32 but not WinCE */
|
||||
# define KHRONOS_APIENTRY __stdcall
|
||||
#else
|
||||
# define KHRONOS_APIENTRY
|
||||
#endif
|
||||
|
||||
/*-------------------------------------------------------------------------
|
||||
* Definition of KHRONOS_APIATTRIBUTES
|
||||
*-------------------------------------------------------------------------
|
||||
* This follows the closing parenthesis of the function prototype arguments.
|
||||
*/
|
||||
#if defined (__ARMCC_2__)
|
||||
#define KHRONOS_APIATTRIBUTES __softfp
|
||||
#else
|
||||
#define KHRONOS_APIATTRIBUTES
|
||||
#endif
|
||||
|
||||
/*-------------------------------------------------------------------------
|
||||
* basic type definitions
|
||||
*-----------------------------------------------------------------------*/
|
||||
#if (defined(__STDC_VERSION__) && __STDC_VERSION__ >= 199901L) || defined(__GNUC__) || defined(__SCO__) || defined(__USLC__)
|
||||
|
||||
|
||||
/*
|
||||
* Using <stdint.h>
|
||||
*/
|
||||
#include <stdint.h>
|
||||
typedef int32_t khronos_int32_t;
|
||||
typedef uint32_t khronos_uint32_t;
|
||||
typedef int64_t khronos_int64_t;
|
||||
typedef uint64_t khronos_uint64_t;
|
||||
#define KHRONOS_SUPPORT_INT64 1
|
||||
#define KHRONOS_SUPPORT_FLOAT 1
|
||||
|
||||
#elif defined(__VMS ) || defined(__sgi)
|
||||
|
||||
/*
|
||||
* Using <inttypes.h>
|
||||
*/
|
||||
#include <inttypes.h>
|
||||
typedef int32_t khronos_int32_t;
|
||||
typedef uint32_t khronos_uint32_t;
|
||||
typedef int64_t khronos_int64_t;
|
||||
typedef uint64_t khronos_uint64_t;
|
||||
#define KHRONOS_SUPPORT_INT64 1
|
||||
#define KHRONOS_SUPPORT_FLOAT 1
|
||||
|
||||
#elif defined(_WIN32) && !defined(__SCITECH_SNAP__)
|
||||
|
||||
/*
|
||||
* Win32
|
||||
*/
|
||||
typedef __int32 khronos_int32_t;
|
||||
typedef unsigned __int32 khronos_uint32_t;
|
||||
typedef __int64 khronos_int64_t;
|
||||
typedef unsigned __int64 khronos_uint64_t;
|
||||
#define KHRONOS_SUPPORT_INT64 1
|
||||
#define KHRONOS_SUPPORT_FLOAT 1
|
||||
|
||||
#elif defined(__sun__) || defined(__digital__)
|
||||
|
||||
/*
|
||||
* Sun or Digital
|
||||
*/
|
||||
typedef int khronos_int32_t;
|
||||
typedef unsigned int khronos_uint32_t;
|
||||
#if defined(__arch64__) || defined(_LP64)
|
||||
typedef long int khronos_int64_t;
|
||||
typedef unsigned long int khronos_uint64_t;
|
||||
#else
|
||||
typedef long long int khronos_int64_t;
|
||||
typedef unsigned long long int khronos_uint64_t;
|
||||
#endif /* __arch64__ */
|
||||
#define KHRONOS_SUPPORT_INT64 1
|
||||
#define KHRONOS_SUPPORT_FLOAT 1
|
||||
|
||||
#elif 0
|
||||
|
||||
/*
|
||||
* Hypothetical platform with no float or int64 support
|
||||
*/
|
||||
typedef int khronos_int32_t;
|
||||
typedef unsigned int khronos_uint32_t;
|
||||
#define KHRONOS_SUPPORT_INT64 0
|
||||
#define KHRONOS_SUPPORT_FLOAT 0
|
||||
|
||||
#else
|
||||
|
||||
/*
|
||||
* Generic fallback
|
||||
*/
|
||||
#include <stdint.h>
|
||||
typedef int32_t khronos_int32_t;
|
||||
typedef uint32_t khronos_uint32_t;
|
||||
typedef int64_t khronos_int64_t;
|
||||
typedef uint64_t khronos_uint64_t;
|
||||
#define KHRONOS_SUPPORT_INT64 1
|
||||
#define KHRONOS_SUPPORT_FLOAT 1
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
/*
|
||||
* Types that are (so far) the same on all platforms
|
||||
*/
|
||||
typedef signed char khronos_int8_t;
|
||||
typedef unsigned char khronos_uint8_t;
|
||||
typedef signed short int khronos_int16_t;
|
||||
typedef unsigned short int khronos_uint16_t;
|
||||
|
||||
/*
|
||||
* Types that differ between LLP64 and LP64 architectures - in LLP64,
|
||||
* pointers are 64 bits, but 'long' is still 32 bits. Win64 appears
|
||||
* to be the only LLP64 architecture in current use.
|
||||
*/
|
||||
#ifdef _WIN64
|
||||
typedef signed long long int khronos_intptr_t;
|
||||
typedef unsigned long long int khronos_uintptr_t;
|
||||
typedef signed long long int khronos_ssize_t;
|
||||
typedef unsigned long long int khronos_usize_t;
|
||||
#else
|
||||
typedef signed long int khronos_intptr_t;
|
||||
typedef unsigned long int khronos_uintptr_t;
|
||||
typedef signed long int khronos_ssize_t;
|
||||
typedef unsigned long int khronos_usize_t;
|
||||
#endif
|
||||
|
||||
#if KHRONOS_SUPPORT_FLOAT
|
||||
/*
|
||||
* Float type
|
||||
*/
|
||||
typedef float khronos_float_t;
|
||||
#endif
|
||||
|
||||
#if KHRONOS_SUPPORT_INT64
|
||||
/* Time types
|
||||
*
|
||||
* These types can be used to represent a time interval in nanoseconds or
|
||||
* an absolute Unadjusted System Time. Unadjusted System Time is the number
|
||||
* of nanoseconds since some arbitrary system event (e.g. since the last
|
||||
* time the system booted). The Unadjusted System Time is an unsigned
|
||||
* 64 bit value that wraps back to 0 every 584 years. Time intervals
|
||||
* may be either signed or unsigned.
|
||||
*/
|
||||
typedef khronos_uint64_t khronos_utime_nanoseconds_t;
|
||||
typedef khronos_int64_t khronos_stime_nanoseconds_t;
|
||||
#endif
|
||||
|
||||
/*
|
||||
* Dummy value used to pad enum types to 32 bits.
|
||||
*/
|
||||
#ifndef KHRONOS_MAX_ENUM
|
||||
#define KHRONOS_MAX_ENUM 0x7FFFFFFF
|
||||
#endif
|
||||
|
||||
/*
|
||||
* Enumerated boolean type
|
||||
*
|
||||
* Values other than zero should be considered to be true. Therefore
|
||||
* comparisons should not be made against KHRONOS_TRUE.
|
||||
*/
|
||||
typedef enum {
|
||||
KHRONOS_FALSE = 0,
|
||||
KHRONOS_TRUE = 1,
|
||||
KHRONOS_BOOLEAN_ENUM_FORCE_SIZE = KHRONOS_MAX_ENUM
|
||||
} khronos_boolean_enum_t;
|
||||
|
||||
#endif /* __khrplatform_h_ */
|
||||
845
src/3rdparty/opengl/wglext.h
vendored
Normal file
845
src/3rdparty/opengl/wglext.h
vendored
Normal file
@@ -0,0 +1,845 @@
|
||||
#ifndef __wgl_wglext_h_
|
||||
#define __wgl_wglext_h_ 1
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
/*
|
||||
** Copyright 2013-2020 The Khronos Group Inc.
|
||||
** SPDX-License-Identifier: MIT
|
||||
**
|
||||
** This header is generated from the Khronos OpenGL / OpenGL ES XML
|
||||
** API Registry. The current version of the Registry, generator scripts
|
||||
** used to make the header, and the header can be found at
|
||||
** https://github.com/KhronosGroup/OpenGL-Registry
|
||||
*/
|
||||
|
||||
#if defined(_WIN32) && !defined(APIENTRY) && !defined(__CYGWIN__) && !defined(__SCITECH_SNAP__)
|
||||
#define WIN32_LEAN_AND_MEAN 1
|
||||
#include <windows.h>
|
||||
#endif
|
||||
|
||||
#define WGL_WGLEXT_VERSION 20200813
|
||||
|
||||
/* Generated C header for:
|
||||
* API: wgl
|
||||
* Versions considered: .*
|
||||
* Versions emitted: _nomatch_^
|
||||
* Default extensions included: wgl
|
||||
* Additional extensions included: _nomatch_^
|
||||
* Extensions removed: _nomatch_^
|
||||
*/
|
||||
|
||||
#ifndef WGL_ARB_buffer_region
|
||||
#define WGL_ARB_buffer_region 1
|
||||
#define WGL_FRONT_COLOR_BUFFER_BIT_ARB 0x00000001
|
||||
#define WGL_BACK_COLOR_BUFFER_BIT_ARB 0x00000002
|
||||
#define WGL_DEPTH_BUFFER_BIT_ARB 0x00000004
|
||||
#define WGL_STENCIL_BUFFER_BIT_ARB 0x00000008
|
||||
typedef HANDLE (WINAPI * PFNWGLCREATEBUFFERREGIONARBPROC) (HDC hDC, int iLayerPlane, UINT uType);
|
||||
typedef VOID (WINAPI * PFNWGLDELETEBUFFERREGIONARBPROC) (HANDLE hRegion);
|
||||
typedef BOOL (WINAPI * PFNWGLSAVEBUFFERREGIONARBPROC) (HANDLE hRegion, int x, int y, int width, int height);
|
||||
typedef BOOL (WINAPI * PFNWGLRESTOREBUFFERREGIONARBPROC) (HANDLE hRegion, int x, int y, int width, int height, int xSrc, int ySrc);
|
||||
#ifdef WGL_WGLEXT_PROTOTYPES
|
||||
HANDLE WINAPI wglCreateBufferRegionARB (HDC hDC, int iLayerPlane, UINT uType);
|
||||
VOID WINAPI wglDeleteBufferRegionARB (HANDLE hRegion);
|
||||
BOOL WINAPI wglSaveBufferRegionARB (HANDLE hRegion, int x, int y, int width, int height);
|
||||
BOOL WINAPI wglRestoreBufferRegionARB (HANDLE hRegion, int x, int y, int width, int height, int xSrc, int ySrc);
|
||||
#endif
|
||||
#endif /* WGL_ARB_buffer_region */
|
||||
|
||||
#ifndef WGL_ARB_context_flush_control
|
||||
#define WGL_ARB_context_flush_control 1
|
||||
#define WGL_CONTEXT_RELEASE_BEHAVIOR_ARB 0x2097
|
||||
#define WGL_CONTEXT_RELEASE_BEHAVIOR_NONE_ARB 0
|
||||
#define WGL_CONTEXT_RELEASE_BEHAVIOR_FLUSH_ARB 0x2098
|
||||
#endif /* WGL_ARB_context_flush_control */
|
||||
|
||||
#ifndef WGL_ARB_create_context
|
||||
#define WGL_ARB_create_context 1
|
||||
#define WGL_CONTEXT_DEBUG_BIT_ARB 0x00000001
|
||||
#define WGL_CONTEXT_FORWARD_COMPATIBLE_BIT_ARB 0x00000002
|
||||
#define WGL_CONTEXT_MAJOR_VERSION_ARB 0x2091
|
||||
#define WGL_CONTEXT_MINOR_VERSION_ARB 0x2092
|
||||
#define WGL_CONTEXT_LAYER_PLANE_ARB 0x2093
|
||||
#define WGL_CONTEXT_FLAGS_ARB 0x2094
|
||||
#define ERROR_INVALID_VERSION_ARB 0x2095
|
||||
typedef HGLRC (WINAPI * PFNWGLCREATECONTEXTATTRIBSARBPROC) (HDC hDC, HGLRC hShareContext, const int *attribList);
|
||||
#ifdef WGL_WGLEXT_PROTOTYPES
|
||||
HGLRC WINAPI wglCreateContextAttribsARB (HDC hDC, HGLRC hShareContext, const int *attribList);
|
||||
#endif
|
||||
#endif /* WGL_ARB_create_context */
|
||||
|
||||
#ifndef WGL_ARB_create_context_no_error
|
||||
#define WGL_ARB_create_context_no_error 1
|
||||
#define WGL_CONTEXT_OPENGL_NO_ERROR_ARB 0x31B3
|
||||
#endif /* WGL_ARB_create_context_no_error */
|
||||
|
||||
#ifndef WGL_ARB_create_context_profile
|
||||
#define WGL_ARB_create_context_profile 1
|
||||
#define WGL_CONTEXT_PROFILE_MASK_ARB 0x9126
|
||||
#define WGL_CONTEXT_CORE_PROFILE_BIT_ARB 0x00000001
|
||||
#define WGL_CONTEXT_COMPATIBILITY_PROFILE_BIT_ARB 0x00000002
|
||||
#define ERROR_INVALID_PROFILE_ARB 0x2096
|
||||
#endif /* WGL_ARB_create_context_profile */
|
||||
|
||||
#ifndef WGL_ARB_create_context_robustness
|
||||
#define WGL_ARB_create_context_robustness 1
|
||||
#define WGL_CONTEXT_ROBUST_ACCESS_BIT_ARB 0x00000004
|
||||
#define WGL_LOSE_CONTEXT_ON_RESET_ARB 0x8252
|
||||
#define WGL_CONTEXT_RESET_NOTIFICATION_STRATEGY_ARB 0x8256
|
||||
#define WGL_NO_RESET_NOTIFICATION_ARB 0x8261
|
||||
#endif /* WGL_ARB_create_context_robustness */
|
||||
|
||||
#ifndef WGL_ARB_extensions_string
|
||||
#define WGL_ARB_extensions_string 1
|
||||
typedef const char *(WINAPI * PFNWGLGETEXTENSIONSSTRINGARBPROC) (HDC hdc);
|
||||
#ifdef WGL_WGLEXT_PROTOTYPES
|
||||
const char *WINAPI wglGetExtensionsStringARB (HDC hdc);
|
||||
#endif
|
||||
#endif /* WGL_ARB_extensions_string */
|
||||
|
||||
#ifndef WGL_ARB_framebuffer_sRGB
|
||||
#define WGL_ARB_framebuffer_sRGB 1
|
||||
#define WGL_FRAMEBUFFER_SRGB_CAPABLE_ARB 0x20A9
|
||||
#endif /* WGL_ARB_framebuffer_sRGB */
|
||||
|
||||
#ifndef WGL_ARB_make_current_read
|
||||
#define WGL_ARB_make_current_read 1
|
||||
#define ERROR_INVALID_PIXEL_TYPE_ARB 0x2043
|
||||
#define ERROR_INCOMPATIBLE_DEVICE_CONTEXTS_ARB 0x2054
|
||||
typedef BOOL (WINAPI * PFNWGLMAKECONTEXTCURRENTARBPROC) (HDC hDrawDC, HDC hReadDC, HGLRC hglrc);
|
||||
typedef HDC (WINAPI * PFNWGLGETCURRENTREADDCARBPROC) (void);
|
||||
#ifdef WGL_WGLEXT_PROTOTYPES
|
||||
BOOL WINAPI wglMakeContextCurrentARB (HDC hDrawDC, HDC hReadDC, HGLRC hglrc);
|
||||
HDC WINAPI wglGetCurrentReadDCARB (void);
|
||||
#endif
|
||||
#endif /* WGL_ARB_make_current_read */
|
||||
|
||||
#ifndef WGL_ARB_multisample
|
||||
#define WGL_ARB_multisample 1
|
||||
#define WGL_SAMPLE_BUFFERS_ARB 0x2041
|
||||
#define WGL_SAMPLES_ARB 0x2042
|
||||
#endif /* WGL_ARB_multisample */
|
||||
|
||||
#ifndef WGL_ARB_pbuffer
|
||||
#define WGL_ARB_pbuffer 1
|
||||
DECLARE_HANDLE(HPBUFFERARB);
|
||||
#define WGL_DRAW_TO_PBUFFER_ARB 0x202D
|
||||
#define WGL_MAX_PBUFFER_PIXELS_ARB 0x202E
|
||||
#define WGL_MAX_PBUFFER_WIDTH_ARB 0x202F
|
||||
#define WGL_MAX_PBUFFER_HEIGHT_ARB 0x2030
|
||||
#define WGL_PBUFFER_LARGEST_ARB 0x2033
|
||||
#define WGL_PBUFFER_WIDTH_ARB 0x2034
|
||||
#define WGL_PBUFFER_HEIGHT_ARB 0x2035
|
||||
#define WGL_PBUFFER_LOST_ARB 0x2036
|
||||
typedef HPBUFFERARB (WINAPI * PFNWGLCREATEPBUFFERARBPROC) (HDC hDC, int iPixelFormat, int iWidth, int iHeight, const int *piAttribList);
|
||||
typedef HDC (WINAPI * PFNWGLGETPBUFFERDCARBPROC) (HPBUFFERARB hPbuffer);
|
||||
typedef int (WINAPI * PFNWGLRELEASEPBUFFERDCARBPROC) (HPBUFFERARB hPbuffer, HDC hDC);
|
||||
typedef BOOL (WINAPI * PFNWGLDESTROYPBUFFERARBPROC) (HPBUFFERARB hPbuffer);
|
||||
typedef BOOL (WINAPI * PFNWGLQUERYPBUFFERARBPROC) (HPBUFFERARB hPbuffer, int iAttribute, int *piValue);
|
||||
#ifdef WGL_WGLEXT_PROTOTYPES
|
||||
HPBUFFERARB WINAPI wglCreatePbufferARB (HDC hDC, int iPixelFormat, int iWidth, int iHeight, const int *piAttribList);
|
||||
HDC WINAPI wglGetPbufferDCARB (HPBUFFERARB hPbuffer);
|
||||
int WINAPI wglReleasePbufferDCARB (HPBUFFERARB hPbuffer, HDC hDC);
|
||||
BOOL WINAPI wglDestroyPbufferARB (HPBUFFERARB hPbuffer);
|
||||
BOOL WINAPI wglQueryPbufferARB (HPBUFFERARB hPbuffer, int iAttribute, int *piValue);
|
||||
#endif
|
||||
#endif /* WGL_ARB_pbuffer */
|
||||
|
||||
#ifndef WGL_ARB_pixel_format
|
||||
#define WGL_ARB_pixel_format 1
|
||||
#define WGL_NUMBER_PIXEL_FORMATS_ARB 0x2000
|
||||
#define WGL_DRAW_TO_WINDOW_ARB 0x2001
|
||||
#define WGL_DRAW_TO_BITMAP_ARB 0x2002
|
||||
#define WGL_ACCELERATION_ARB 0x2003
|
||||
#define WGL_NEED_PALETTE_ARB 0x2004
|
||||
#define WGL_NEED_SYSTEM_PALETTE_ARB 0x2005
|
||||
#define WGL_SWAP_LAYER_BUFFERS_ARB 0x2006
|
||||
#define WGL_SWAP_METHOD_ARB 0x2007
|
||||
#define WGL_NUMBER_OVERLAYS_ARB 0x2008
|
||||
#define WGL_NUMBER_UNDERLAYS_ARB 0x2009
|
||||
#define WGL_TRANSPARENT_ARB 0x200A
|
||||
#define WGL_TRANSPARENT_RED_VALUE_ARB 0x2037
|
||||
#define WGL_TRANSPARENT_GREEN_VALUE_ARB 0x2038
|
||||
#define WGL_TRANSPARENT_BLUE_VALUE_ARB 0x2039
|
||||
#define WGL_TRANSPARENT_ALPHA_VALUE_ARB 0x203A
|
||||
#define WGL_TRANSPARENT_INDEX_VALUE_ARB 0x203B
|
||||
#define WGL_SHARE_DEPTH_ARB 0x200C
|
||||
#define WGL_SHARE_STENCIL_ARB 0x200D
|
||||
#define WGL_SHARE_ACCUM_ARB 0x200E
|
||||
#define WGL_SUPPORT_GDI_ARB 0x200F
|
||||
#define WGL_SUPPORT_OPENGL_ARB 0x2010
|
||||
#define WGL_DOUBLE_BUFFER_ARB 0x2011
|
||||
#define WGL_STEREO_ARB 0x2012
|
||||
#define WGL_PIXEL_TYPE_ARB 0x2013
|
||||
#define WGL_COLOR_BITS_ARB 0x2014
|
||||
#define WGL_RED_BITS_ARB 0x2015
|
||||
#define WGL_RED_SHIFT_ARB 0x2016
|
||||
#define WGL_GREEN_BITS_ARB 0x2017
|
||||
#define WGL_GREEN_SHIFT_ARB 0x2018
|
||||
#define WGL_BLUE_BITS_ARB 0x2019
|
||||
#define WGL_BLUE_SHIFT_ARB 0x201A
|
||||
#define WGL_ALPHA_BITS_ARB 0x201B
|
||||
#define WGL_ALPHA_SHIFT_ARB 0x201C
|
||||
#define WGL_ACCUM_BITS_ARB 0x201D
|
||||
#define WGL_ACCUM_RED_BITS_ARB 0x201E
|
||||
#define WGL_ACCUM_GREEN_BITS_ARB 0x201F
|
||||
#define WGL_ACCUM_BLUE_BITS_ARB 0x2020
|
||||
#define WGL_ACCUM_ALPHA_BITS_ARB 0x2021
|
||||
#define WGL_DEPTH_BITS_ARB 0x2022
|
||||
#define WGL_STENCIL_BITS_ARB 0x2023
|
||||
#define WGL_AUX_BUFFERS_ARB 0x2024
|
||||
#define WGL_NO_ACCELERATION_ARB 0x2025
|
||||
#define WGL_GENERIC_ACCELERATION_ARB 0x2026
|
||||
#define WGL_FULL_ACCELERATION_ARB 0x2027
|
||||
#define WGL_SWAP_EXCHANGE_ARB 0x2028
|
||||
#define WGL_SWAP_COPY_ARB 0x2029
|
||||
#define WGL_SWAP_UNDEFINED_ARB 0x202A
|
||||
#define WGL_TYPE_RGBA_ARB 0x202B
|
||||
#define WGL_TYPE_COLORINDEX_ARB 0x202C
|
||||
typedef BOOL (WINAPI * PFNWGLGETPIXELFORMATATTRIBIVARBPROC) (HDC hdc, int iPixelFormat, int iLayerPlane, UINT nAttributes, const int *piAttributes, int *piValues);
|
||||
typedef BOOL (WINAPI * PFNWGLGETPIXELFORMATATTRIBFVARBPROC) (HDC hdc, int iPixelFormat, int iLayerPlane, UINT nAttributes, const int *piAttributes, FLOAT *pfValues);
|
||||
typedef BOOL (WINAPI * PFNWGLCHOOSEPIXELFORMATARBPROC) (HDC hdc, const int *piAttribIList, const FLOAT *pfAttribFList, UINT nMaxFormats, int *piFormats, UINT *nNumFormats);
|
||||
#ifdef WGL_WGLEXT_PROTOTYPES
|
||||
BOOL WINAPI wglGetPixelFormatAttribivARB (HDC hdc, int iPixelFormat, int iLayerPlane, UINT nAttributes, const int *piAttributes, int *piValues);
|
||||
BOOL WINAPI wglGetPixelFormatAttribfvARB (HDC hdc, int iPixelFormat, int iLayerPlane, UINT nAttributes, const int *piAttributes, FLOAT *pfValues);
|
||||
BOOL WINAPI wglChoosePixelFormatARB (HDC hdc, const int *piAttribIList, const FLOAT *pfAttribFList, UINT nMaxFormats, int *piFormats, UINT *nNumFormats);
|
||||
#endif
|
||||
#endif /* WGL_ARB_pixel_format */
|
||||
|
||||
#ifndef WGL_ARB_pixel_format_float
|
||||
#define WGL_ARB_pixel_format_float 1
|
||||
#define WGL_TYPE_RGBA_FLOAT_ARB 0x21A0
|
||||
#endif /* WGL_ARB_pixel_format_float */
|
||||
|
||||
#ifndef WGL_ARB_render_texture
|
||||
#define WGL_ARB_render_texture 1
|
||||
#define WGL_BIND_TO_TEXTURE_RGB_ARB 0x2070
|
||||
#define WGL_BIND_TO_TEXTURE_RGBA_ARB 0x2071
|
||||
#define WGL_TEXTURE_FORMAT_ARB 0x2072
|
||||
#define WGL_TEXTURE_TARGET_ARB 0x2073
|
||||
#define WGL_MIPMAP_TEXTURE_ARB 0x2074
|
||||
#define WGL_TEXTURE_RGB_ARB 0x2075
|
||||
#define WGL_TEXTURE_RGBA_ARB 0x2076
|
||||
#define WGL_NO_TEXTURE_ARB 0x2077
|
||||
#define WGL_TEXTURE_CUBE_MAP_ARB 0x2078
|
||||
#define WGL_TEXTURE_1D_ARB 0x2079
|
||||
#define WGL_TEXTURE_2D_ARB 0x207A
|
||||
#define WGL_MIPMAP_LEVEL_ARB 0x207B
|
||||
#define WGL_CUBE_MAP_FACE_ARB 0x207C
|
||||
#define WGL_TEXTURE_CUBE_MAP_POSITIVE_X_ARB 0x207D
|
||||
#define WGL_TEXTURE_CUBE_MAP_NEGATIVE_X_ARB 0x207E
|
||||
#define WGL_TEXTURE_CUBE_MAP_POSITIVE_Y_ARB 0x207F
|
||||
#define WGL_TEXTURE_CUBE_MAP_NEGATIVE_Y_ARB 0x2080
|
||||
#define WGL_TEXTURE_CUBE_MAP_POSITIVE_Z_ARB 0x2081
|
||||
#define WGL_TEXTURE_CUBE_MAP_NEGATIVE_Z_ARB 0x2082
|
||||
#define WGL_FRONT_LEFT_ARB 0x2083
|
||||
#define WGL_FRONT_RIGHT_ARB 0x2084
|
||||
#define WGL_BACK_LEFT_ARB 0x2085
|
||||
#define WGL_BACK_RIGHT_ARB 0x2086
|
||||
#define WGL_AUX0_ARB 0x2087
|
||||
#define WGL_AUX1_ARB 0x2088
|
||||
#define WGL_AUX2_ARB 0x2089
|
||||
#define WGL_AUX3_ARB 0x208A
|
||||
#define WGL_AUX4_ARB 0x208B
|
||||
#define WGL_AUX5_ARB 0x208C
|
||||
#define WGL_AUX6_ARB 0x208D
|
||||
#define WGL_AUX7_ARB 0x208E
|
||||
#define WGL_AUX8_ARB 0x208F
|
||||
#define WGL_AUX9_ARB 0x2090
|
||||
typedef BOOL (WINAPI * PFNWGLBINDTEXIMAGEARBPROC) (HPBUFFERARB hPbuffer, int iBuffer);
|
||||
typedef BOOL (WINAPI * PFNWGLRELEASETEXIMAGEARBPROC) (HPBUFFERARB hPbuffer, int iBuffer);
|
||||
typedef BOOL (WINAPI * PFNWGLSETPBUFFERATTRIBARBPROC) (HPBUFFERARB hPbuffer, const int *piAttribList);
|
||||
#ifdef WGL_WGLEXT_PROTOTYPES
|
||||
BOOL WINAPI wglBindTexImageARB (HPBUFFERARB hPbuffer, int iBuffer);
|
||||
BOOL WINAPI wglReleaseTexImageARB (HPBUFFERARB hPbuffer, int iBuffer);
|
||||
BOOL WINAPI wglSetPbufferAttribARB (HPBUFFERARB hPbuffer, const int *piAttribList);
|
||||
#endif
|
||||
#endif /* WGL_ARB_render_texture */
|
||||
|
||||
#ifndef WGL_ARB_robustness_application_isolation
|
||||
#define WGL_ARB_robustness_application_isolation 1
|
||||
#define WGL_CONTEXT_RESET_ISOLATION_BIT_ARB 0x00000008
|
||||
#endif /* WGL_ARB_robustness_application_isolation */
|
||||
|
||||
#ifndef WGL_ARB_robustness_share_group_isolation
|
||||
#define WGL_ARB_robustness_share_group_isolation 1
|
||||
#endif /* WGL_ARB_robustness_share_group_isolation */
|
||||
|
||||
#ifndef WGL_3DFX_multisample
|
||||
#define WGL_3DFX_multisample 1
|
||||
#define WGL_SAMPLE_BUFFERS_3DFX 0x2060
|
||||
#define WGL_SAMPLES_3DFX 0x2061
|
||||
#endif /* WGL_3DFX_multisample */
|
||||
|
||||
#ifndef WGL_3DL_stereo_control
|
||||
#define WGL_3DL_stereo_control 1
|
||||
#define WGL_STEREO_EMITTER_ENABLE_3DL 0x2055
|
||||
#define WGL_STEREO_EMITTER_DISABLE_3DL 0x2056
|
||||
#define WGL_STEREO_POLARITY_NORMAL_3DL 0x2057
|
||||
#define WGL_STEREO_POLARITY_INVERT_3DL 0x2058
|
||||
typedef BOOL (WINAPI * PFNWGLSETSTEREOEMITTERSTATE3DLPROC) (HDC hDC, UINT uState);
|
||||
#ifdef WGL_WGLEXT_PROTOTYPES
|
||||
BOOL WINAPI wglSetStereoEmitterState3DL (HDC hDC, UINT uState);
|
||||
#endif
|
||||
#endif /* WGL_3DL_stereo_control */
|
||||
|
||||
#ifndef WGL_AMD_gpu_association
|
||||
#define WGL_AMD_gpu_association 1
|
||||
#define WGL_GPU_VENDOR_AMD 0x1F00
|
||||
#define WGL_GPU_RENDERER_STRING_AMD 0x1F01
|
||||
#define WGL_GPU_OPENGL_VERSION_STRING_AMD 0x1F02
|
||||
#define WGL_GPU_FASTEST_TARGET_GPUS_AMD 0x21A2
|
||||
#define WGL_GPU_RAM_AMD 0x21A3
|
||||
#define WGL_GPU_CLOCK_AMD 0x21A4
|
||||
#define WGL_GPU_NUM_PIPES_AMD 0x21A5
|
||||
#define WGL_GPU_NUM_SIMD_AMD 0x21A6
|
||||
#define WGL_GPU_NUM_RB_AMD 0x21A7
|
||||
#define WGL_GPU_NUM_SPI_AMD 0x21A8
|
||||
typedef UINT (WINAPI * PFNWGLGETGPUIDSAMDPROC) (UINT maxCount, UINT *ids);
|
||||
typedef INT (WINAPI * PFNWGLGETGPUINFOAMDPROC) (UINT id, INT property, GLenum dataType, UINT size, void *data);
|
||||
typedef UINT (WINAPI * PFNWGLGETCONTEXTGPUIDAMDPROC) (HGLRC hglrc);
|
||||
typedef HGLRC (WINAPI * PFNWGLCREATEASSOCIATEDCONTEXTAMDPROC) (UINT id);
|
||||
typedef HGLRC (WINAPI * PFNWGLCREATEASSOCIATEDCONTEXTATTRIBSAMDPROC) (UINT id, HGLRC hShareContext, const int *attribList);
|
||||
typedef BOOL (WINAPI * PFNWGLDELETEASSOCIATEDCONTEXTAMDPROC) (HGLRC hglrc);
|
||||
typedef BOOL (WINAPI * PFNWGLMAKEASSOCIATEDCONTEXTCURRENTAMDPROC) (HGLRC hglrc);
|
||||
typedef HGLRC (WINAPI * PFNWGLGETCURRENTASSOCIATEDCONTEXTAMDPROC) (void);
|
||||
typedef VOID (WINAPI * PFNWGLBLITCONTEXTFRAMEBUFFERAMDPROC) (HGLRC dstCtx, GLint srcX0, GLint srcY0, GLint srcX1, GLint srcY1, GLint dstX0, GLint dstY0, GLint dstX1, GLint dstY1, GLbitfield mask, GLenum filter);
|
||||
#ifdef WGL_WGLEXT_PROTOTYPES
|
||||
UINT WINAPI wglGetGPUIDsAMD (UINT maxCount, UINT *ids);
|
||||
INT WINAPI wglGetGPUInfoAMD (UINT id, INT property, GLenum dataType, UINT size, void *data);
|
||||
UINT WINAPI wglGetContextGPUIDAMD (HGLRC hglrc);
|
||||
HGLRC WINAPI wglCreateAssociatedContextAMD (UINT id);
|
||||
HGLRC WINAPI wglCreateAssociatedContextAttribsAMD (UINT id, HGLRC hShareContext, const int *attribList);
|
||||
BOOL WINAPI wglDeleteAssociatedContextAMD (HGLRC hglrc);
|
||||
BOOL WINAPI wglMakeAssociatedContextCurrentAMD (HGLRC hglrc);
|
||||
HGLRC WINAPI wglGetCurrentAssociatedContextAMD (void);
|
||||
VOID WINAPI wglBlitContextFramebufferAMD (HGLRC dstCtx, GLint srcX0, GLint srcY0, GLint srcX1, GLint srcY1, GLint dstX0, GLint dstY0, GLint dstX1, GLint dstY1, GLbitfield mask, GLenum filter);
|
||||
#endif
|
||||
#endif /* WGL_AMD_gpu_association */
|
||||
|
||||
#ifndef WGL_ATI_pixel_format_float
|
||||
#define WGL_ATI_pixel_format_float 1
|
||||
#define WGL_TYPE_RGBA_FLOAT_ATI 0x21A0
|
||||
#endif /* WGL_ATI_pixel_format_float */
|
||||
|
||||
#ifndef WGL_ATI_render_texture_rectangle
|
||||
#define WGL_ATI_render_texture_rectangle 1
|
||||
#define WGL_TEXTURE_RECTANGLE_ATI 0x21A5
|
||||
#endif /* WGL_ATI_render_texture_rectangle */
|
||||
|
||||
#ifndef WGL_EXT_colorspace
|
||||
#define WGL_EXT_colorspace 1
|
||||
#define WGL_COLORSPACE_EXT 0x309D
|
||||
#define WGL_COLORSPACE_SRGB_EXT 0x3089
|
||||
#define WGL_COLORSPACE_LINEAR_EXT 0x308A
|
||||
#endif /* WGL_EXT_colorspace */
|
||||
|
||||
#ifndef WGL_EXT_create_context_es2_profile
|
||||
#define WGL_EXT_create_context_es2_profile 1
|
||||
#define WGL_CONTEXT_ES2_PROFILE_BIT_EXT 0x00000004
|
||||
#endif /* WGL_EXT_create_context_es2_profile */
|
||||
|
||||
#ifndef WGL_EXT_create_context_es_profile
|
||||
#define WGL_EXT_create_context_es_profile 1
|
||||
#define WGL_CONTEXT_ES_PROFILE_BIT_EXT 0x00000004
|
||||
#endif /* WGL_EXT_create_context_es_profile */
|
||||
|
||||
#ifndef WGL_EXT_depth_float
|
||||
#define WGL_EXT_depth_float 1
|
||||
#define WGL_DEPTH_FLOAT_EXT 0x2040
|
||||
#endif /* WGL_EXT_depth_float */
|
||||
|
||||
#ifndef WGL_EXT_display_color_table
|
||||
#define WGL_EXT_display_color_table 1
|
||||
typedef GLboolean (WINAPI * PFNWGLCREATEDISPLAYCOLORTABLEEXTPROC) (GLushort id);
|
||||
typedef GLboolean (WINAPI * PFNWGLLOADDISPLAYCOLORTABLEEXTPROC) (const GLushort *table, GLuint length);
|
||||
typedef GLboolean (WINAPI * PFNWGLBINDDISPLAYCOLORTABLEEXTPROC) (GLushort id);
|
||||
typedef VOID (WINAPI * PFNWGLDESTROYDISPLAYCOLORTABLEEXTPROC) (GLushort id);
|
||||
#ifdef WGL_WGLEXT_PROTOTYPES
|
||||
GLboolean WINAPI wglCreateDisplayColorTableEXT (GLushort id);
|
||||
GLboolean WINAPI wglLoadDisplayColorTableEXT (const GLushort *table, GLuint length);
|
||||
GLboolean WINAPI wglBindDisplayColorTableEXT (GLushort id);
|
||||
VOID WINAPI wglDestroyDisplayColorTableEXT (GLushort id);
|
||||
#endif
|
||||
#endif /* WGL_EXT_display_color_table */
|
||||
|
||||
#ifndef WGL_EXT_extensions_string
|
||||
#define WGL_EXT_extensions_string 1
|
||||
typedef const char *(WINAPI * PFNWGLGETEXTENSIONSSTRINGEXTPROC) (void);
|
||||
#ifdef WGL_WGLEXT_PROTOTYPES
|
||||
const char *WINAPI wglGetExtensionsStringEXT (void);
|
||||
#endif
|
||||
#endif /* WGL_EXT_extensions_string */
|
||||
|
||||
#ifndef WGL_EXT_framebuffer_sRGB
|
||||
#define WGL_EXT_framebuffer_sRGB 1
|
||||
#define WGL_FRAMEBUFFER_SRGB_CAPABLE_EXT 0x20A9
|
||||
#endif /* WGL_EXT_framebuffer_sRGB */
|
||||
|
||||
#ifndef WGL_EXT_make_current_read
|
||||
#define WGL_EXT_make_current_read 1
|
||||
#define ERROR_INVALID_PIXEL_TYPE_EXT 0x2043
|
||||
typedef BOOL (WINAPI * PFNWGLMAKECONTEXTCURRENTEXTPROC) (HDC hDrawDC, HDC hReadDC, HGLRC hglrc);
|
||||
typedef HDC (WINAPI * PFNWGLGETCURRENTREADDCEXTPROC) (void);
|
||||
#ifdef WGL_WGLEXT_PROTOTYPES
|
||||
BOOL WINAPI wglMakeContextCurrentEXT (HDC hDrawDC, HDC hReadDC, HGLRC hglrc);
|
||||
HDC WINAPI wglGetCurrentReadDCEXT (void);
|
||||
#endif
|
||||
#endif /* WGL_EXT_make_current_read */
|
||||
|
||||
#ifndef WGL_EXT_multisample
|
||||
#define WGL_EXT_multisample 1
|
||||
#define WGL_SAMPLE_BUFFERS_EXT 0x2041
|
||||
#define WGL_SAMPLES_EXT 0x2042
|
||||
#endif /* WGL_EXT_multisample */
|
||||
|
||||
#ifndef WGL_EXT_pbuffer
|
||||
#define WGL_EXT_pbuffer 1
|
||||
DECLARE_HANDLE(HPBUFFEREXT);
|
||||
#define WGL_DRAW_TO_PBUFFER_EXT 0x202D
|
||||
#define WGL_MAX_PBUFFER_PIXELS_EXT 0x202E
|
||||
#define WGL_MAX_PBUFFER_WIDTH_EXT 0x202F
|
||||
#define WGL_MAX_PBUFFER_HEIGHT_EXT 0x2030
|
||||
#define WGL_OPTIMAL_PBUFFER_WIDTH_EXT 0x2031
|
||||
#define WGL_OPTIMAL_PBUFFER_HEIGHT_EXT 0x2032
|
||||
#define WGL_PBUFFER_LARGEST_EXT 0x2033
|
||||
#define WGL_PBUFFER_WIDTH_EXT 0x2034
|
||||
#define WGL_PBUFFER_HEIGHT_EXT 0x2035
|
||||
typedef HPBUFFEREXT (WINAPI * PFNWGLCREATEPBUFFEREXTPROC) (HDC hDC, int iPixelFormat, int iWidth, int iHeight, const int *piAttribList);
|
||||
typedef HDC (WINAPI * PFNWGLGETPBUFFERDCEXTPROC) (HPBUFFEREXT hPbuffer);
|
||||
typedef int (WINAPI * PFNWGLRELEASEPBUFFERDCEXTPROC) (HPBUFFEREXT hPbuffer, HDC hDC);
|
||||
typedef BOOL (WINAPI * PFNWGLDESTROYPBUFFEREXTPROC) (HPBUFFEREXT hPbuffer);
|
||||
typedef BOOL (WINAPI * PFNWGLQUERYPBUFFEREXTPROC) (HPBUFFEREXT hPbuffer, int iAttribute, int *piValue);
|
||||
#ifdef WGL_WGLEXT_PROTOTYPES
|
||||
HPBUFFEREXT WINAPI wglCreatePbufferEXT (HDC hDC, int iPixelFormat, int iWidth, int iHeight, const int *piAttribList);
|
||||
HDC WINAPI wglGetPbufferDCEXT (HPBUFFEREXT hPbuffer);
|
||||
int WINAPI wglReleasePbufferDCEXT (HPBUFFEREXT hPbuffer, HDC hDC);
|
||||
BOOL WINAPI wglDestroyPbufferEXT (HPBUFFEREXT hPbuffer);
|
||||
BOOL WINAPI wglQueryPbufferEXT (HPBUFFEREXT hPbuffer, int iAttribute, int *piValue);
|
||||
#endif
|
||||
#endif /* WGL_EXT_pbuffer */
|
||||
|
||||
#ifndef WGL_EXT_pixel_format
|
||||
#define WGL_EXT_pixel_format 1
|
||||
#define WGL_NUMBER_PIXEL_FORMATS_EXT 0x2000
|
||||
#define WGL_DRAW_TO_WINDOW_EXT 0x2001
|
||||
#define WGL_DRAW_TO_BITMAP_EXT 0x2002
|
||||
#define WGL_ACCELERATION_EXT 0x2003
|
||||
#define WGL_NEED_PALETTE_EXT 0x2004
|
||||
#define WGL_NEED_SYSTEM_PALETTE_EXT 0x2005
|
||||
#define WGL_SWAP_LAYER_BUFFERS_EXT 0x2006
|
||||
#define WGL_SWAP_METHOD_EXT 0x2007
|
||||
#define WGL_NUMBER_OVERLAYS_EXT 0x2008
|
||||
#define WGL_NUMBER_UNDERLAYS_EXT 0x2009
|
||||
#define WGL_TRANSPARENT_EXT 0x200A
|
||||
#define WGL_TRANSPARENT_VALUE_EXT 0x200B
|
||||
#define WGL_SHARE_DEPTH_EXT 0x200C
|
||||
#define WGL_SHARE_STENCIL_EXT 0x200D
|
||||
#define WGL_SHARE_ACCUM_EXT 0x200E
|
||||
#define WGL_SUPPORT_GDI_EXT 0x200F
|
||||
#define WGL_SUPPORT_OPENGL_EXT 0x2010
|
||||
#define WGL_DOUBLE_BUFFER_EXT 0x2011
|
||||
#define WGL_STEREO_EXT 0x2012
|
||||
#define WGL_PIXEL_TYPE_EXT 0x2013
|
||||
#define WGL_COLOR_BITS_EXT 0x2014
|
||||
#define WGL_RED_BITS_EXT 0x2015
|
||||
#define WGL_RED_SHIFT_EXT 0x2016
|
||||
#define WGL_GREEN_BITS_EXT 0x2017
|
||||
#define WGL_GREEN_SHIFT_EXT 0x2018
|
||||
#define WGL_BLUE_BITS_EXT 0x2019
|
||||
#define WGL_BLUE_SHIFT_EXT 0x201A
|
||||
#define WGL_ALPHA_BITS_EXT 0x201B
|
||||
#define WGL_ALPHA_SHIFT_EXT 0x201C
|
||||
#define WGL_ACCUM_BITS_EXT 0x201D
|
||||
#define WGL_ACCUM_RED_BITS_EXT 0x201E
|
||||
#define WGL_ACCUM_GREEN_BITS_EXT 0x201F
|
||||
#define WGL_ACCUM_BLUE_BITS_EXT 0x2020
|
||||
#define WGL_ACCUM_ALPHA_BITS_EXT 0x2021
|
||||
#define WGL_DEPTH_BITS_EXT 0x2022
|
||||
#define WGL_STENCIL_BITS_EXT 0x2023
|
||||
#define WGL_AUX_BUFFERS_EXT 0x2024
|
||||
#define WGL_NO_ACCELERATION_EXT 0x2025
|
||||
#define WGL_GENERIC_ACCELERATION_EXT 0x2026
|
||||
#define WGL_FULL_ACCELERATION_EXT 0x2027
|
||||
#define WGL_SWAP_EXCHANGE_EXT 0x2028
|
||||
#define WGL_SWAP_COPY_EXT 0x2029
|
||||
#define WGL_SWAP_UNDEFINED_EXT 0x202A
|
||||
#define WGL_TYPE_RGBA_EXT 0x202B
|
||||
#define WGL_TYPE_COLORINDEX_EXT 0x202C
|
||||
typedef BOOL (WINAPI * PFNWGLGETPIXELFORMATATTRIBIVEXTPROC) (HDC hdc, int iPixelFormat, int iLayerPlane, UINT nAttributes, int *piAttributes, int *piValues);
|
||||
typedef BOOL (WINAPI * PFNWGLGETPIXELFORMATATTRIBFVEXTPROC) (HDC hdc, int iPixelFormat, int iLayerPlane, UINT nAttributes, int *piAttributes, FLOAT *pfValues);
|
||||
typedef BOOL (WINAPI * PFNWGLCHOOSEPIXELFORMATEXTPROC) (HDC hdc, const int *piAttribIList, const FLOAT *pfAttribFList, UINT nMaxFormats, int *piFormats, UINT *nNumFormats);
|
||||
#ifdef WGL_WGLEXT_PROTOTYPES
|
||||
BOOL WINAPI wglGetPixelFormatAttribivEXT (HDC hdc, int iPixelFormat, int iLayerPlane, UINT nAttributes, int *piAttributes, int *piValues);
|
||||
BOOL WINAPI wglGetPixelFormatAttribfvEXT (HDC hdc, int iPixelFormat, int iLayerPlane, UINT nAttributes, int *piAttributes, FLOAT *pfValues);
|
||||
BOOL WINAPI wglChoosePixelFormatEXT (HDC hdc, const int *piAttribIList, const FLOAT *pfAttribFList, UINT nMaxFormats, int *piFormats, UINT *nNumFormats);
|
||||
#endif
|
||||
#endif /* WGL_EXT_pixel_format */
|
||||
|
||||
#ifndef WGL_EXT_pixel_format_packed_float
|
||||
#define WGL_EXT_pixel_format_packed_float 1
|
||||
#define WGL_TYPE_RGBA_UNSIGNED_FLOAT_EXT 0x20A8
|
||||
#endif /* WGL_EXT_pixel_format_packed_float */
|
||||
|
||||
#ifndef WGL_EXT_swap_control
|
||||
#define WGL_EXT_swap_control 1
|
||||
typedef BOOL (WINAPI * PFNWGLSWAPINTERVALEXTPROC) (int interval);
|
||||
typedef int (WINAPI * PFNWGLGETSWAPINTERVALEXTPROC) (void);
|
||||
#ifdef WGL_WGLEXT_PROTOTYPES
|
||||
BOOL WINAPI wglSwapIntervalEXT (int interval);
|
||||
int WINAPI wglGetSwapIntervalEXT (void);
|
||||
#endif
|
||||
#endif /* WGL_EXT_swap_control */
|
||||
|
||||
#ifndef WGL_EXT_swap_control_tear
|
||||
#define WGL_EXT_swap_control_tear 1
|
||||
#endif /* WGL_EXT_swap_control_tear */
|
||||
|
||||
#ifndef WGL_I3D_digital_video_control
|
||||
#define WGL_I3D_digital_video_control 1
|
||||
#define WGL_DIGITAL_VIDEO_CURSOR_ALPHA_FRAMEBUFFER_I3D 0x2050
|
||||
#define WGL_DIGITAL_VIDEO_CURSOR_ALPHA_VALUE_I3D 0x2051
|
||||
#define WGL_DIGITAL_VIDEO_CURSOR_INCLUDED_I3D 0x2052
|
||||
#define WGL_DIGITAL_VIDEO_GAMMA_CORRECTED_I3D 0x2053
|
||||
typedef BOOL (WINAPI * PFNWGLGETDIGITALVIDEOPARAMETERSI3DPROC) (HDC hDC, int iAttribute, int *piValue);
|
||||
typedef BOOL (WINAPI * PFNWGLSETDIGITALVIDEOPARAMETERSI3DPROC) (HDC hDC, int iAttribute, const int *piValue);
|
||||
#ifdef WGL_WGLEXT_PROTOTYPES
|
||||
BOOL WINAPI wglGetDigitalVideoParametersI3D (HDC hDC, int iAttribute, int *piValue);
|
||||
BOOL WINAPI wglSetDigitalVideoParametersI3D (HDC hDC, int iAttribute, const int *piValue);
|
||||
#endif
|
||||
#endif /* WGL_I3D_digital_video_control */
|
||||
|
||||
#ifndef WGL_I3D_gamma
|
||||
#define WGL_I3D_gamma 1
|
||||
#define WGL_GAMMA_TABLE_SIZE_I3D 0x204E
|
||||
#define WGL_GAMMA_EXCLUDE_DESKTOP_I3D 0x204F
|
||||
typedef BOOL (WINAPI * PFNWGLGETGAMMATABLEPARAMETERSI3DPROC) (HDC hDC, int iAttribute, int *piValue);
|
||||
typedef BOOL (WINAPI * PFNWGLSETGAMMATABLEPARAMETERSI3DPROC) (HDC hDC, int iAttribute, const int *piValue);
|
||||
typedef BOOL (WINAPI * PFNWGLGETGAMMATABLEI3DPROC) (HDC hDC, int iEntries, USHORT *puRed, USHORT *puGreen, USHORT *puBlue);
|
||||
typedef BOOL (WINAPI * PFNWGLSETGAMMATABLEI3DPROC) (HDC hDC, int iEntries, const USHORT *puRed, const USHORT *puGreen, const USHORT *puBlue);
|
||||
#ifdef WGL_WGLEXT_PROTOTYPES
|
||||
BOOL WINAPI wglGetGammaTableParametersI3D (HDC hDC, int iAttribute, int *piValue);
|
||||
BOOL WINAPI wglSetGammaTableParametersI3D (HDC hDC, int iAttribute, const int *piValue);
|
||||
BOOL WINAPI wglGetGammaTableI3D (HDC hDC, int iEntries, USHORT *puRed, USHORT *puGreen, USHORT *puBlue);
|
||||
BOOL WINAPI wglSetGammaTableI3D (HDC hDC, int iEntries, const USHORT *puRed, const USHORT *puGreen, const USHORT *puBlue);
|
||||
#endif
|
||||
#endif /* WGL_I3D_gamma */
|
||||
|
||||
#ifndef WGL_I3D_genlock
|
||||
#define WGL_I3D_genlock 1
|
||||
#define WGL_GENLOCK_SOURCE_MULTIVIEW_I3D 0x2044
|
||||
#define WGL_GENLOCK_SOURCE_EXTERNAL_SYNC_I3D 0x2045
|
||||
#define WGL_GENLOCK_SOURCE_EXTERNAL_FIELD_I3D 0x2046
|
||||
#define WGL_GENLOCK_SOURCE_EXTERNAL_TTL_I3D 0x2047
|
||||
#define WGL_GENLOCK_SOURCE_DIGITAL_SYNC_I3D 0x2048
|
||||
#define WGL_GENLOCK_SOURCE_DIGITAL_FIELD_I3D 0x2049
|
||||
#define WGL_GENLOCK_SOURCE_EDGE_FALLING_I3D 0x204A
|
||||
#define WGL_GENLOCK_SOURCE_EDGE_RISING_I3D 0x204B
|
||||
#define WGL_GENLOCK_SOURCE_EDGE_BOTH_I3D 0x204C
|
||||
typedef BOOL (WINAPI * PFNWGLENABLEGENLOCKI3DPROC) (HDC hDC);
|
||||
typedef BOOL (WINAPI * PFNWGLDISABLEGENLOCKI3DPROC) (HDC hDC);
|
||||
typedef BOOL (WINAPI * PFNWGLISENABLEDGENLOCKI3DPROC) (HDC hDC, BOOL *pFlag);
|
||||
typedef BOOL (WINAPI * PFNWGLGENLOCKSOURCEI3DPROC) (HDC hDC, UINT uSource);
|
||||
typedef BOOL (WINAPI * PFNWGLGETGENLOCKSOURCEI3DPROC) (HDC hDC, UINT *uSource);
|
||||
typedef BOOL (WINAPI * PFNWGLGENLOCKSOURCEEDGEI3DPROC) (HDC hDC, UINT uEdge);
|
||||
typedef BOOL (WINAPI * PFNWGLGETGENLOCKSOURCEEDGEI3DPROC) (HDC hDC, UINT *uEdge);
|
||||
typedef BOOL (WINAPI * PFNWGLGENLOCKSAMPLERATEI3DPROC) (HDC hDC, UINT uRate);
|
||||
typedef BOOL (WINAPI * PFNWGLGETGENLOCKSAMPLERATEI3DPROC) (HDC hDC, UINT *uRate);
|
||||
typedef BOOL (WINAPI * PFNWGLGENLOCKSOURCEDELAYI3DPROC) (HDC hDC, UINT uDelay);
|
||||
typedef BOOL (WINAPI * PFNWGLGETGENLOCKSOURCEDELAYI3DPROC) (HDC hDC, UINT *uDelay);
|
||||
typedef BOOL (WINAPI * PFNWGLQUERYGENLOCKMAXSOURCEDELAYI3DPROC) (HDC hDC, UINT *uMaxLineDelay, UINT *uMaxPixelDelay);
|
||||
#ifdef WGL_WGLEXT_PROTOTYPES
|
||||
BOOL WINAPI wglEnableGenlockI3D (HDC hDC);
|
||||
BOOL WINAPI wglDisableGenlockI3D (HDC hDC);
|
||||
BOOL WINAPI wglIsEnabledGenlockI3D (HDC hDC, BOOL *pFlag);
|
||||
BOOL WINAPI wglGenlockSourceI3D (HDC hDC, UINT uSource);
|
||||
BOOL WINAPI wglGetGenlockSourceI3D (HDC hDC, UINT *uSource);
|
||||
BOOL WINAPI wglGenlockSourceEdgeI3D (HDC hDC, UINT uEdge);
|
||||
BOOL WINAPI wglGetGenlockSourceEdgeI3D (HDC hDC, UINT *uEdge);
|
||||
BOOL WINAPI wglGenlockSampleRateI3D (HDC hDC, UINT uRate);
|
||||
BOOL WINAPI wglGetGenlockSampleRateI3D (HDC hDC, UINT *uRate);
|
||||
BOOL WINAPI wglGenlockSourceDelayI3D (HDC hDC, UINT uDelay);
|
||||
BOOL WINAPI wglGetGenlockSourceDelayI3D (HDC hDC, UINT *uDelay);
|
||||
BOOL WINAPI wglQueryGenlockMaxSourceDelayI3D (HDC hDC, UINT *uMaxLineDelay, UINT *uMaxPixelDelay);
|
||||
#endif
|
||||
#endif /* WGL_I3D_genlock */
|
||||
|
||||
#ifndef WGL_I3D_image_buffer
|
||||
#define WGL_I3D_image_buffer 1
|
||||
#define WGL_IMAGE_BUFFER_MIN_ACCESS_I3D 0x00000001
|
||||
#define WGL_IMAGE_BUFFER_LOCK_I3D 0x00000002
|
||||
typedef LPVOID (WINAPI * PFNWGLCREATEIMAGEBUFFERI3DPROC) (HDC hDC, DWORD dwSize, UINT uFlags);
|
||||
typedef BOOL (WINAPI * PFNWGLDESTROYIMAGEBUFFERI3DPROC) (HDC hDC, LPVOID pAddress);
|
||||
typedef BOOL (WINAPI * PFNWGLASSOCIATEIMAGEBUFFEREVENTSI3DPROC) (HDC hDC, const HANDLE *pEvent, const LPVOID *pAddress, const DWORD *pSize, UINT count);
|
||||
typedef BOOL (WINAPI * PFNWGLRELEASEIMAGEBUFFEREVENTSI3DPROC) (HDC hDC, const LPVOID *pAddress, UINT count);
|
||||
#ifdef WGL_WGLEXT_PROTOTYPES
|
||||
LPVOID WINAPI wglCreateImageBufferI3D (HDC hDC, DWORD dwSize, UINT uFlags);
|
||||
BOOL WINAPI wglDestroyImageBufferI3D (HDC hDC, LPVOID pAddress);
|
||||
BOOL WINAPI wglAssociateImageBufferEventsI3D (HDC hDC, const HANDLE *pEvent, const LPVOID *pAddress, const DWORD *pSize, UINT count);
|
||||
BOOL WINAPI wglReleaseImageBufferEventsI3D (HDC hDC, const LPVOID *pAddress, UINT count);
|
||||
#endif
|
||||
#endif /* WGL_I3D_image_buffer */
|
||||
|
||||
#ifndef WGL_I3D_swap_frame_lock
|
||||
#define WGL_I3D_swap_frame_lock 1
|
||||
typedef BOOL (WINAPI * PFNWGLENABLEFRAMELOCKI3DPROC) (void);
|
||||
typedef BOOL (WINAPI * PFNWGLDISABLEFRAMELOCKI3DPROC) (void);
|
||||
typedef BOOL (WINAPI * PFNWGLISENABLEDFRAMELOCKI3DPROC) (BOOL *pFlag);
|
||||
typedef BOOL (WINAPI * PFNWGLQUERYFRAMELOCKMASTERI3DPROC) (BOOL *pFlag);
|
||||
#ifdef WGL_WGLEXT_PROTOTYPES
|
||||
BOOL WINAPI wglEnableFrameLockI3D (void);
|
||||
BOOL WINAPI wglDisableFrameLockI3D (void);
|
||||
BOOL WINAPI wglIsEnabledFrameLockI3D (BOOL *pFlag);
|
||||
BOOL WINAPI wglQueryFrameLockMasterI3D (BOOL *pFlag);
|
||||
#endif
|
||||
#endif /* WGL_I3D_swap_frame_lock */
|
||||
|
||||
#ifndef WGL_I3D_swap_frame_usage
|
||||
#define WGL_I3D_swap_frame_usage 1
|
||||
typedef BOOL (WINAPI * PFNWGLGETFRAMEUSAGEI3DPROC) (float *pUsage);
|
||||
typedef BOOL (WINAPI * PFNWGLBEGINFRAMETRACKINGI3DPROC) (void);
|
||||
typedef BOOL (WINAPI * PFNWGLENDFRAMETRACKINGI3DPROC) (void);
|
||||
typedef BOOL (WINAPI * PFNWGLQUERYFRAMETRACKINGI3DPROC) (DWORD *pFrameCount, DWORD *pMissedFrames, float *pLastMissedUsage);
|
||||
#ifdef WGL_WGLEXT_PROTOTYPES
|
||||
BOOL WINAPI wglGetFrameUsageI3D (float *pUsage);
|
||||
BOOL WINAPI wglBeginFrameTrackingI3D (void);
|
||||
BOOL WINAPI wglEndFrameTrackingI3D (void);
|
||||
BOOL WINAPI wglQueryFrameTrackingI3D (DWORD *pFrameCount, DWORD *pMissedFrames, float *pLastMissedUsage);
|
||||
#endif
|
||||
#endif /* WGL_I3D_swap_frame_usage */
|
||||
|
||||
#ifndef WGL_NV_DX_interop
|
||||
#define WGL_NV_DX_interop 1
|
||||
#define WGL_ACCESS_READ_ONLY_NV 0x00000000
|
||||
#define WGL_ACCESS_READ_WRITE_NV 0x00000001
|
||||
#define WGL_ACCESS_WRITE_DISCARD_NV 0x00000002
|
||||
typedef BOOL (WINAPI * PFNWGLDXSETRESOURCESHAREHANDLENVPROC) (void *dxObject, HANDLE shareHandle);
|
||||
typedef HANDLE (WINAPI * PFNWGLDXOPENDEVICENVPROC) (void *dxDevice);
|
||||
typedef BOOL (WINAPI * PFNWGLDXCLOSEDEVICENVPROC) (HANDLE hDevice);
|
||||
typedef HANDLE (WINAPI * PFNWGLDXREGISTEROBJECTNVPROC) (HANDLE hDevice, void *dxObject, GLuint name, GLenum type, GLenum access);
|
||||
typedef BOOL (WINAPI * PFNWGLDXUNREGISTEROBJECTNVPROC) (HANDLE hDevice, HANDLE hObject);
|
||||
typedef BOOL (WINAPI * PFNWGLDXOBJECTACCESSNVPROC) (HANDLE hObject, GLenum access);
|
||||
typedef BOOL (WINAPI * PFNWGLDXLOCKOBJECTSNVPROC) (HANDLE hDevice, GLint count, HANDLE *hObjects);
|
||||
typedef BOOL (WINAPI * PFNWGLDXUNLOCKOBJECTSNVPROC) (HANDLE hDevice, GLint count, HANDLE *hObjects);
|
||||
#ifdef WGL_WGLEXT_PROTOTYPES
|
||||
BOOL WINAPI wglDXSetResourceShareHandleNV (void *dxObject, HANDLE shareHandle);
|
||||
HANDLE WINAPI wglDXOpenDeviceNV (void *dxDevice);
|
||||
BOOL WINAPI wglDXCloseDeviceNV (HANDLE hDevice);
|
||||
HANDLE WINAPI wglDXRegisterObjectNV (HANDLE hDevice, void *dxObject, GLuint name, GLenum type, GLenum access);
|
||||
BOOL WINAPI wglDXUnregisterObjectNV (HANDLE hDevice, HANDLE hObject);
|
||||
BOOL WINAPI wglDXObjectAccessNV (HANDLE hObject, GLenum access);
|
||||
BOOL WINAPI wglDXLockObjectsNV (HANDLE hDevice, GLint count, HANDLE *hObjects);
|
||||
BOOL WINAPI wglDXUnlockObjectsNV (HANDLE hDevice, GLint count, HANDLE *hObjects);
|
||||
#endif
|
||||
#endif /* WGL_NV_DX_interop */
|
||||
|
||||
#ifndef WGL_NV_DX_interop2
|
||||
#define WGL_NV_DX_interop2 1
|
||||
#endif /* WGL_NV_DX_interop2 */
|
||||
|
||||
#ifndef WGL_NV_copy_image
|
||||
#define WGL_NV_copy_image 1
|
||||
typedef BOOL (WINAPI * PFNWGLCOPYIMAGESUBDATANVPROC) (HGLRC hSrcRC, GLuint srcName, GLenum srcTarget, GLint srcLevel, GLint srcX, GLint srcY, GLint srcZ, HGLRC hDstRC, GLuint dstName, GLenum dstTarget, GLint dstLevel, GLint dstX, GLint dstY, GLint dstZ, GLsizei width, GLsizei height, GLsizei depth);
|
||||
#ifdef WGL_WGLEXT_PROTOTYPES
|
||||
BOOL WINAPI wglCopyImageSubDataNV (HGLRC hSrcRC, GLuint srcName, GLenum srcTarget, GLint srcLevel, GLint srcX, GLint srcY, GLint srcZ, HGLRC hDstRC, GLuint dstName, GLenum dstTarget, GLint dstLevel, GLint dstX, GLint dstY, GLint dstZ, GLsizei width, GLsizei height, GLsizei depth);
|
||||
#endif
|
||||
#endif /* WGL_NV_copy_image */
|
||||
|
||||
#ifndef WGL_NV_delay_before_swap
|
||||
#define WGL_NV_delay_before_swap 1
|
||||
typedef BOOL (WINAPI * PFNWGLDELAYBEFORESWAPNVPROC) (HDC hDC, GLfloat seconds);
|
||||
#ifdef WGL_WGLEXT_PROTOTYPES
|
||||
BOOL WINAPI wglDelayBeforeSwapNV (HDC hDC, GLfloat seconds);
|
||||
#endif
|
||||
#endif /* WGL_NV_delay_before_swap */
|
||||
|
||||
#ifndef WGL_NV_float_buffer
|
||||
#define WGL_NV_float_buffer 1
|
||||
#define WGL_FLOAT_COMPONENTS_NV 0x20B0
|
||||
#define WGL_BIND_TO_TEXTURE_RECTANGLE_FLOAT_R_NV 0x20B1
|
||||
#define WGL_BIND_TO_TEXTURE_RECTANGLE_FLOAT_RG_NV 0x20B2
|
||||
#define WGL_BIND_TO_TEXTURE_RECTANGLE_FLOAT_RGB_NV 0x20B3
|
||||
#define WGL_BIND_TO_TEXTURE_RECTANGLE_FLOAT_RGBA_NV 0x20B4
|
||||
#define WGL_TEXTURE_FLOAT_R_NV 0x20B5
|
||||
#define WGL_TEXTURE_FLOAT_RG_NV 0x20B6
|
||||
#define WGL_TEXTURE_FLOAT_RGB_NV 0x20B7
|
||||
#define WGL_TEXTURE_FLOAT_RGBA_NV 0x20B8
|
||||
#endif /* WGL_NV_float_buffer */
|
||||
|
||||
#ifndef WGL_NV_gpu_affinity
|
||||
#define WGL_NV_gpu_affinity 1
|
||||
DECLARE_HANDLE(HGPUNV);
|
||||
struct _GPU_DEVICE {
|
||||
DWORD cb;
|
||||
CHAR DeviceName[32];
|
||||
CHAR DeviceString[128];
|
||||
DWORD Flags;
|
||||
RECT rcVirtualScreen;
|
||||
};
|
||||
typedef struct _GPU_DEVICE *PGPU_DEVICE;
|
||||
#define ERROR_INCOMPATIBLE_AFFINITY_MASKS_NV 0x20D0
|
||||
#define ERROR_MISSING_AFFINITY_MASK_NV 0x20D1
|
||||
typedef BOOL (WINAPI * PFNWGLENUMGPUSNVPROC) (UINT iGpuIndex, HGPUNV *phGpu);
|
||||
typedef BOOL (WINAPI * PFNWGLENUMGPUDEVICESNVPROC) (HGPUNV hGpu, UINT iDeviceIndex, PGPU_DEVICE lpGpuDevice);
|
||||
typedef HDC (WINAPI * PFNWGLCREATEAFFINITYDCNVPROC) (const HGPUNV *phGpuList);
|
||||
typedef BOOL (WINAPI * PFNWGLENUMGPUSFROMAFFINITYDCNVPROC) (HDC hAffinityDC, UINT iGpuIndex, HGPUNV *hGpu);
|
||||
typedef BOOL (WINAPI * PFNWGLDELETEDCNVPROC) (HDC hdc);
|
||||
#ifdef WGL_WGLEXT_PROTOTYPES
|
||||
BOOL WINAPI wglEnumGpusNV (UINT iGpuIndex, HGPUNV *phGpu);
|
||||
BOOL WINAPI wglEnumGpuDevicesNV (HGPUNV hGpu, UINT iDeviceIndex, PGPU_DEVICE lpGpuDevice);
|
||||
HDC WINAPI wglCreateAffinityDCNV (const HGPUNV *phGpuList);
|
||||
BOOL WINAPI wglEnumGpusFromAffinityDCNV (HDC hAffinityDC, UINT iGpuIndex, HGPUNV *hGpu);
|
||||
BOOL WINAPI wglDeleteDCNV (HDC hdc);
|
||||
#endif
|
||||
#endif /* WGL_NV_gpu_affinity */
|
||||
|
||||
#ifndef WGL_NV_multigpu_context
|
||||
#define WGL_NV_multigpu_context 1
|
||||
#define WGL_CONTEXT_MULTIGPU_ATTRIB_NV 0x20AA
|
||||
#define WGL_CONTEXT_MULTIGPU_ATTRIB_SINGLE_NV 0x20AB
|
||||
#define WGL_CONTEXT_MULTIGPU_ATTRIB_AFR_NV 0x20AC
|
||||
#define WGL_CONTEXT_MULTIGPU_ATTRIB_MULTICAST_NV 0x20AD
|
||||
#define WGL_CONTEXT_MULTIGPU_ATTRIB_MULTI_DISPLAY_MULTICAST_NV 0x20AE
|
||||
#endif /* WGL_NV_multigpu_context */
|
||||
|
||||
#ifndef WGL_NV_multisample_coverage
|
||||
#define WGL_NV_multisample_coverage 1
|
||||
#define WGL_COVERAGE_SAMPLES_NV 0x2042
|
||||
#define WGL_COLOR_SAMPLES_NV 0x20B9
|
||||
#endif /* WGL_NV_multisample_coverage */
|
||||
|
||||
#ifndef WGL_NV_present_video
|
||||
#define WGL_NV_present_video 1
|
||||
DECLARE_HANDLE(HVIDEOOUTPUTDEVICENV);
|
||||
#define WGL_NUM_VIDEO_SLOTS_NV 0x20F0
|
||||
typedef int (WINAPI * PFNWGLENUMERATEVIDEODEVICESNVPROC) (HDC hDc, HVIDEOOUTPUTDEVICENV *phDeviceList);
|
||||
typedef BOOL (WINAPI * PFNWGLBINDVIDEODEVICENVPROC) (HDC hDc, unsigned int uVideoSlot, HVIDEOOUTPUTDEVICENV hVideoDevice, const int *piAttribList);
|
||||
typedef BOOL (WINAPI * PFNWGLQUERYCURRENTCONTEXTNVPROC) (int iAttribute, int *piValue);
|
||||
#ifdef WGL_WGLEXT_PROTOTYPES
|
||||
int WINAPI wglEnumerateVideoDevicesNV (HDC hDc, HVIDEOOUTPUTDEVICENV *phDeviceList);
|
||||
BOOL WINAPI wglBindVideoDeviceNV (HDC hDc, unsigned int uVideoSlot, HVIDEOOUTPUTDEVICENV hVideoDevice, const int *piAttribList);
|
||||
BOOL WINAPI wglQueryCurrentContextNV (int iAttribute, int *piValue);
|
||||
#endif
|
||||
#endif /* WGL_NV_present_video */
|
||||
|
||||
#ifndef WGL_NV_render_depth_texture
|
||||
#define WGL_NV_render_depth_texture 1
|
||||
#define WGL_BIND_TO_TEXTURE_DEPTH_NV 0x20A3
|
||||
#define WGL_BIND_TO_TEXTURE_RECTANGLE_DEPTH_NV 0x20A4
|
||||
#define WGL_DEPTH_TEXTURE_FORMAT_NV 0x20A5
|
||||
#define WGL_TEXTURE_DEPTH_COMPONENT_NV 0x20A6
|
||||
#define WGL_DEPTH_COMPONENT_NV 0x20A7
|
||||
#endif /* WGL_NV_render_depth_texture */
|
||||
|
||||
#ifndef WGL_NV_render_texture_rectangle
|
||||
#define WGL_NV_render_texture_rectangle 1
|
||||
#define WGL_BIND_TO_TEXTURE_RECTANGLE_RGB_NV 0x20A0
|
||||
#define WGL_BIND_TO_TEXTURE_RECTANGLE_RGBA_NV 0x20A1
|
||||
#define WGL_TEXTURE_RECTANGLE_NV 0x20A2
|
||||
#endif /* WGL_NV_render_texture_rectangle */
|
||||
|
||||
#ifndef WGL_NV_swap_group
|
||||
#define WGL_NV_swap_group 1
|
||||
typedef BOOL (WINAPI * PFNWGLJOINSWAPGROUPNVPROC) (HDC hDC, GLuint group);
|
||||
typedef BOOL (WINAPI * PFNWGLBINDSWAPBARRIERNVPROC) (GLuint group, GLuint barrier);
|
||||
typedef BOOL (WINAPI * PFNWGLQUERYSWAPGROUPNVPROC) (HDC hDC, GLuint *group, GLuint *barrier);
|
||||
typedef BOOL (WINAPI * PFNWGLQUERYMAXSWAPGROUPSNVPROC) (HDC hDC, GLuint *maxGroups, GLuint *maxBarriers);
|
||||
typedef BOOL (WINAPI * PFNWGLQUERYFRAMECOUNTNVPROC) (HDC hDC, GLuint *count);
|
||||
typedef BOOL (WINAPI * PFNWGLRESETFRAMECOUNTNVPROC) (HDC hDC);
|
||||
#ifdef WGL_WGLEXT_PROTOTYPES
|
||||
BOOL WINAPI wglJoinSwapGroupNV (HDC hDC, GLuint group);
|
||||
BOOL WINAPI wglBindSwapBarrierNV (GLuint group, GLuint barrier);
|
||||
BOOL WINAPI wglQuerySwapGroupNV (HDC hDC, GLuint *group, GLuint *barrier);
|
||||
BOOL WINAPI wglQueryMaxSwapGroupsNV (HDC hDC, GLuint *maxGroups, GLuint *maxBarriers);
|
||||
BOOL WINAPI wglQueryFrameCountNV (HDC hDC, GLuint *count);
|
||||
BOOL WINAPI wglResetFrameCountNV (HDC hDC);
|
||||
#endif
|
||||
#endif /* WGL_NV_swap_group */
|
||||
|
||||
#ifndef WGL_NV_vertex_array_range
|
||||
#define WGL_NV_vertex_array_range 1
|
||||
typedef void *(WINAPI * PFNWGLALLOCATEMEMORYNVPROC) (GLsizei size, GLfloat readfreq, GLfloat writefreq, GLfloat priority);
|
||||
typedef void (WINAPI * PFNWGLFREEMEMORYNVPROC) (void *pointer);
|
||||
#ifdef WGL_WGLEXT_PROTOTYPES
|
||||
void *WINAPI wglAllocateMemoryNV (GLsizei size, GLfloat readfreq, GLfloat writefreq, GLfloat priority);
|
||||
void WINAPI wglFreeMemoryNV (void *pointer);
|
||||
#endif
|
||||
#endif /* WGL_NV_vertex_array_range */
|
||||
|
||||
#ifndef WGL_NV_video_capture
|
||||
#define WGL_NV_video_capture 1
|
||||
DECLARE_HANDLE(HVIDEOINPUTDEVICENV);
|
||||
#define WGL_UNIQUE_ID_NV 0x20CE
|
||||
#define WGL_NUM_VIDEO_CAPTURE_SLOTS_NV 0x20CF
|
||||
typedef BOOL (WINAPI * PFNWGLBINDVIDEOCAPTUREDEVICENVPROC) (UINT uVideoSlot, HVIDEOINPUTDEVICENV hDevice);
|
||||
typedef UINT (WINAPI * PFNWGLENUMERATEVIDEOCAPTUREDEVICESNVPROC) (HDC hDc, HVIDEOINPUTDEVICENV *phDeviceList);
|
||||
typedef BOOL (WINAPI * PFNWGLLOCKVIDEOCAPTUREDEVICENVPROC) (HDC hDc, HVIDEOINPUTDEVICENV hDevice);
|
||||
typedef BOOL (WINAPI * PFNWGLQUERYVIDEOCAPTUREDEVICENVPROC) (HDC hDc, HVIDEOINPUTDEVICENV hDevice, int iAttribute, int *piValue);
|
||||
typedef BOOL (WINAPI * PFNWGLRELEASEVIDEOCAPTUREDEVICENVPROC) (HDC hDc, HVIDEOINPUTDEVICENV hDevice);
|
||||
#ifdef WGL_WGLEXT_PROTOTYPES
|
||||
BOOL WINAPI wglBindVideoCaptureDeviceNV (UINT uVideoSlot, HVIDEOINPUTDEVICENV hDevice);
|
||||
UINT WINAPI wglEnumerateVideoCaptureDevicesNV (HDC hDc, HVIDEOINPUTDEVICENV *phDeviceList);
|
||||
BOOL WINAPI wglLockVideoCaptureDeviceNV (HDC hDc, HVIDEOINPUTDEVICENV hDevice);
|
||||
BOOL WINAPI wglQueryVideoCaptureDeviceNV (HDC hDc, HVIDEOINPUTDEVICENV hDevice, int iAttribute, int *piValue);
|
||||
BOOL WINAPI wglReleaseVideoCaptureDeviceNV (HDC hDc, HVIDEOINPUTDEVICENV hDevice);
|
||||
#endif
|
||||
#endif /* WGL_NV_video_capture */
|
||||
|
||||
#ifndef WGL_NV_video_output
|
||||
#define WGL_NV_video_output 1
|
||||
DECLARE_HANDLE(HPVIDEODEV);
|
||||
#define WGL_BIND_TO_VIDEO_RGB_NV 0x20C0
|
||||
#define WGL_BIND_TO_VIDEO_RGBA_NV 0x20C1
|
||||
#define WGL_BIND_TO_VIDEO_RGB_AND_DEPTH_NV 0x20C2
|
||||
#define WGL_VIDEO_OUT_COLOR_NV 0x20C3
|
||||
#define WGL_VIDEO_OUT_ALPHA_NV 0x20C4
|
||||
#define WGL_VIDEO_OUT_DEPTH_NV 0x20C5
|
||||
#define WGL_VIDEO_OUT_COLOR_AND_ALPHA_NV 0x20C6
|
||||
#define WGL_VIDEO_OUT_COLOR_AND_DEPTH_NV 0x20C7
|
||||
#define WGL_VIDEO_OUT_FRAME 0x20C8
|
||||
#define WGL_VIDEO_OUT_FIELD_1 0x20C9
|
||||
#define WGL_VIDEO_OUT_FIELD_2 0x20CA
|
||||
#define WGL_VIDEO_OUT_STACKED_FIELDS_1_2 0x20CB
|
||||
#define WGL_VIDEO_OUT_STACKED_FIELDS_2_1 0x20CC
|
||||
typedef BOOL (WINAPI * PFNWGLGETVIDEODEVICENVPROC) (HDC hDC, int numDevices, HPVIDEODEV *hVideoDevice);
|
||||
typedef BOOL (WINAPI * PFNWGLRELEASEVIDEODEVICENVPROC) (HPVIDEODEV hVideoDevice);
|
||||
typedef BOOL (WINAPI * PFNWGLBINDVIDEOIMAGENVPROC) (HPVIDEODEV hVideoDevice, HPBUFFERARB hPbuffer, int iVideoBuffer);
|
||||
typedef BOOL (WINAPI * PFNWGLRELEASEVIDEOIMAGENVPROC) (HPBUFFERARB hPbuffer, int iVideoBuffer);
|
||||
typedef BOOL (WINAPI * PFNWGLSENDPBUFFERTOVIDEONVPROC) (HPBUFFERARB hPbuffer, int iBufferType, unsigned long *pulCounterPbuffer, BOOL bBlock);
|
||||
typedef BOOL (WINAPI * PFNWGLGETVIDEOINFONVPROC) (HPVIDEODEV hpVideoDevice, unsigned long *pulCounterOutputPbuffer, unsigned long *pulCounterOutputVideo);
|
||||
#ifdef WGL_WGLEXT_PROTOTYPES
|
||||
BOOL WINAPI wglGetVideoDeviceNV (HDC hDC, int numDevices, HPVIDEODEV *hVideoDevice);
|
||||
BOOL WINAPI wglReleaseVideoDeviceNV (HPVIDEODEV hVideoDevice);
|
||||
BOOL WINAPI wglBindVideoImageNV (HPVIDEODEV hVideoDevice, HPBUFFERARB hPbuffer, int iVideoBuffer);
|
||||
BOOL WINAPI wglReleaseVideoImageNV (HPBUFFERARB hPbuffer, int iVideoBuffer);
|
||||
BOOL WINAPI wglSendPbufferToVideoNV (HPBUFFERARB hPbuffer, int iBufferType, unsigned long *pulCounterPbuffer, BOOL bBlock);
|
||||
BOOL WINAPI wglGetVideoInfoNV (HPVIDEODEV hpVideoDevice, unsigned long *pulCounterOutputPbuffer, unsigned long *pulCounterOutputVideo);
|
||||
#endif
|
||||
#endif /* WGL_NV_video_output */
|
||||
|
||||
#ifndef WGL_OML_sync_control
|
||||
#define WGL_OML_sync_control 1
|
||||
typedef BOOL (WINAPI * PFNWGLGETSYNCVALUESOMLPROC) (HDC hdc, INT64 *ust, INT64 *msc, INT64 *sbc);
|
||||
typedef BOOL (WINAPI * PFNWGLGETMSCRATEOMLPROC) (HDC hdc, INT32 *numerator, INT32 *denominator);
|
||||
typedef INT64 (WINAPI * PFNWGLSWAPBUFFERSMSCOMLPROC) (HDC hdc, INT64 target_msc, INT64 divisor, INT64 remainder);
|
||||
typedef INT64 (WINAPI * PFNWGLSWAPLAYERBUFFERSMSCOMLPROC) (HDC hdc, INT fuPlanes, INT64 target_msc, INT64 divisor, INT64 remainder);
|
||||
typedef BOOL (WINAPI * PFNWGLWAITFORMSCOMLPROC) (HDC hdc, INT64 target_msc, INT64 divisor, INT64 remainder, INT64 *ust, INT64 *msc, INT64 *sbc);
|
||||
typedef BOOL (WINAPI * PFNWGLWAITFORSBCOMLPROC) (HDC hdc, INT64 target_sbc, INT64 *ust, INT64 *msc, INT64 *sbc);
|
||||
#ifdef WGL_WGLEXT_PROTOTYPES
|
||||
BOOL WINAPI wglGetSyncValuesOML (HDC hdc, INT64 *ust, INT64 *msc, INT64 *sbc);
|
||||
BOOL WINAPI wglGetMscRateOML (HDC hdc, INT32 *numerator, INT32 *denominator);
|
||||
INT64 WINAPI wglSwapBuffersMscOML (HDC hdc, INT64 target_msc, INT64 divisor, INT64 remainder);
|
||||
INT64 WINAPI wglSwapLayerBuffersMscOML (HDC hdc, INT fuPlanes, INT64 target_msc, INT64 divisor, INT64 remainder);
|
||||
BOOL WINAPI wglWaitForMscOML (HDC hdc, INT64 target_msc, INT64 divisor, INT64 remainder, INT64 *ust, INT64 *msc, INT64 *sbc);
|
||||
BOOL WINAPI wglWaitForSbcOML (HDC hdc, INT64 target_sbc, INT64 *ust, INT64 *msc, INT64 *sbc);
|
||||
#endif
|
||||
#endif /* WGL_OML_sync_control */
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif
|
||||
12
src/3rdparty/squirrel/squirrel/sqarray.h
vendored
12
src/3rdparty/squirrel/squirrel/sqarray.h
vendored
@@ -17,9 +17,9 @@ public:
|
||||
return newarray;
|
||||
}
|
||||
#ifndef NO_GARBAGE_COLLECTOR
|
||||
void Mark(SQCollectable **chain);
|
||||
void EnqueueMarkObjectForChildren(SQGCMarkerQueue &queue) override;
|
||||
#endif
|
||||
void Finalize(){
|
||||
void Finalize() override {
|
||||
_values.resize(0);
|
||||
}
|
||||
bool Get(const SQInteger nidx,SQObjectPtr &val)
|
||||
@@ -78,9 +78,13 @@ public:
|
||||
ShrinkIfNeeded();
|
||||
return true;
|
||||
}
|
||||
void Release()
|
||||
void Release() override
|
||||
{
|
||||
sq_delete(this,SQArray);
|
||||
this->_sharedstate->DelayFinalFree(this);
|
||||
}
|
||||
void FinalFree() override
|
||||
{
|
||||
sq_delete(this, SQArray);
|
||||
}
|
||||
SQObjectPtrVec _values;
|
||||
};
|
||||
|
||||
18
src/3rdparty/squirrel/squirrel/sqclass.h
vendored
18
src/3rdparty/squirrel/squirrel/sqclass.h
vendored
@@ -59,7 +59,7 @@ public:
|
||||
}
|
||||
void Finalize();
|
||||
#ifndef NO_GARBAGE_COLLECTOR
|
||||
void Mark(SQCollectable ** );
|
||||
void EnqueueMarkObjectForChildren(SQGCMarkerQueue &queue);
|
||||
#endif
|
||||
SQInteger Next(const SQObjectPtr &refpos, SQObjectPtr &outkey, SQObjectPtr &outval);
|
||||
SQInstance *CreateInstance();
|
||||
@@ -126,31 +126,33 @@ public:
|
||||
}
|
||||
return false;
|
||||
}
|
||||
void Release() {
|
||||
void Release() override {
|
||||
_uiRef++;
|
||||
try {
|
||||
if (_hook) { _hook(_userpointer,0);}
|
||||
} catch (...) {
|
||||
_uiRef--;
|
||||
if (_uiRef == 0) {
|
||||
SQInteger size = _memsize;
|
||||
this->~SQInstance();
|
||||
SQ_FREE(this, size);
|
||||
this->_sharedstate->DelayFinalFree(this);
|
||||
}
|
||||
throw;
|
||||
}
|
||||
_uiRef--;
|
||||
if(_uiRef > 0) return;
|
||||
this->_sharedstate->DelayFinalFree(this);
|
||||
}
|
||||
void FinalFree() override
|
||||
{
|
||||
SQInteger size = _memsize;
|
||||
this->~SQInstance();
|
||||
SQ_FREE(this, size);
|
||||
}
|
||||
void Finalize();
|
||||
void Finalize() override;
|
||||
#ifndef NO_GARBAGE_COLLECTOR
|
||||
void Mark(SQCollectable ** );
|
||||
void EnqueueMarkObjectForChildren(SQGCMarkerQueue &queue) override;
|
||||
#endif
|
||||
bool InstanceOf(SQClass *trg);
|
||||
bool GetMetaMethod(SQVM *v,SQMetaMethod mm,SQObjectPtr &res);
|
||||
bool GetMetaMethod(SQVM *v,SQMetaMethod mm,SQObjectPtr &res) override;
|
||||
|
||||
SQClass *_class;
|
||||
SQUserPointer _userpointer;
|
||||
|
||||
6
src/3rdparty/squirrel/squirrel/sqclosure.h
vendored
6
src/3rdparty/squirrel/squirrel/sqclosure.h
vendored
@@ -32,7 +32,7 @@ public:
|
||||
bool Save(SQVM *v,SQUserPointer up,SQWRITEFUNC write);
|
||||
static bool Load(SQVM *v,SQUserPointer up,SQREADFUNC read,SQObjectPtr &ret);
|
||||
#ifndef NO_GARBAGE_COLLECTOR
|
||||
void Mark(SQCollectable **chain);
|
||||
void EnqueueMarkObjectForChildren(SQGCMarkerQueue &queue);
|
||||
void Finalize(){_outervalues.resize(0); }
|
||||
#endif
|
||||
SQObjectPtr _env;
|
||||
@@ -66,7 +66,7 @@ public:
|
||||
bool Yield(SQVM *v);
|
||||
bool Resume(SQVM *v,SQInteger target);
|
||||
#ifndef NO_GARBAGE_COLLECTOR
|
||||
void Mark(SQCollectable **chain);
|
||||
void EnqueueMarkObjectForChildren(SQGCMarkerQueue &queue);
|
||||
void Finalize(){_stack.resize(0);_closure=_null_;}
|
||||
#endif
|
||||
SQObjectPtr _closure;
|
||||
@@ -106,7 +106,7 @@ public:
|
||||
sq_delete(this,SQNativeClosure);
|
||||
}
|
||||
#ifndef NO_GARBAGE_COLLECTOR
|
||||
void Mark(SQCollectable **chain);
|
||||
void EnqueueMarkObjectForChildren(SQGCMarkerQueue &queue);
|
||||
void Finalize(){_outervalues.resize(0);}
|
||||
#endif
|
||||
SQInteger _nparamscheck;
|
||||
|
||||
@@ -836,6 +836,7 @@ public:
|
||||
SQInteger val = _fs->PopTarget();
|
||||
SQInteger key = _fs->PopTarget();
|
||||
SQInteger attrs = hasattrs ? _fs->PopTarget():-1;
|
||||
(void)attrs; // assert only
|
||||
assert((hasattrs && attrs == key-1) || !hasattrs);
|
||||
unsigned char flags = (hasattrs?NEW_SLOT_ATTRIBUTES_FLAG:0)|(isstatic?NEW_SLOT_STATIC_FLAG:0);
|
||||
SQInteger table = _fs->TopTarget(); //<<BECAUSE OF THIS NO COMMON EMIT FUNC IS POSSIBLE
|
||||
|
||||
131
src/3rdparty/squirrel/squirrel/sqobject.cpp
vendored
131
src/3rdparty/squirrel/squirrel/sqobject.cpp
vendored
@@ -486,104 +486,81 @@ bool SQFunctionProto::Load(SQVM *v,SQUserPointer up,SQREADFUNC read,SQObjectPtr
|
||||
|
||||
#ifndef NO_GARBAGE_COLLECTOR
|
||||
|
||||
#define START_MARK() if(!(_uiRef&MARK_FLAG)){ \
|
||||
_uiRef|=MARK_FLAG;
|
||||
|
||||
#define END_MARK() RemoveFromChain(&_sharedstate->_gc_chain, this); \
|
||||
AddToChain(chain, this); }
|
||||
|
||||
void SQVM::Mark(SQCollectable **chain)
|
||||
void SQVM::EnqueueMarkObjectForChildren(SQGCMarkerQueue &queue)
|
||||
{
|
||||
START_MARK()
|
||||
SQSharedState::MarkObject(_lasterror,chain);
|
||||
SQSharedState::MarkObject(_errorhandler,chain);
|
||||
SQSharedState::MarkObject(_debughook,chain);
|
||||
SQSharedState::MarkObject(_roottable, chain);
|
||||
SQSharedState::MarkObject(temp_reg, chain);
|
||||
for(SQUnsignedInteger i = 0; i < _stack.size(); i++) SQSharedState::MarkObject(_stack[i], chain);
|
||||
for(SQUnsignedInteger j = 0; j < _vargsstack.size(); j++) SQSharedState::MarkObject(_vargsstack[j], chain);
|
||||
for(SQInteger k = 0; k < _callsstacksize; k++) SQSharedState::MarkObject(_callsstack[k]._closure, chain);
|
||||
END_MARK()
|
||||
SQSharedState::EnqueueMarkObject(_lasterror,queue);
|
||||
SQSharedState::EnqueueMarkObject(_errorhandler,queue);
|
||||
SQSharedState::EnqueueMarkObject(_debughook,queue);
|
||||
SQSharedState::EnqueueMarkObject(_roottable, queue);
|
||||
SQSharedState::EnqueueMarkObject(temp_reg, queue);
|
||||
for(SQUnsignedInteger i = 0; i < _stack.size(); i++) SQSharedState::EnqueueMarkObject(_stack[i], queue);
|
||||
for(SQUnsignedInteger j = 0; j < _vargsstack.size(); j++) SQSharedState::EnqueueMarkObject(_vargsstack[j], queue);
|
||||
for(SQInteger k = 0; k < _callsstacksize; k++) SQSharedState::EnqueueMarkObject(_callsstack[k]._closure, queue);
|
||||
}
|
||||
|
||||
void SQArray::Mark(SQCollectable **chain)
|
||||
void SQArray::EnqueueMarkObjectForChildren(SQGCMarkerQueue &queue)
|
||||
{
|
||||
START_MARK()
|
||||
SQInteger len = _values.size();
|
||||
for(SQInteger i = 0;i < len; i++) SQSharedState::MarkObject(_values[i], chain);
|
||||
END_MARK()
|
||||
}
|
||||
void SQTable::Mark(SQCollectable **chain)
|
||||
{
|
||||
START_MARK()
|
||||
if(_delegate) _delegate->Mark(chain);
|
||||
SQInteger len = _numofnodes;
|
||||
for(SQInteger i = 0; i < len; i++){
|
||||
SQSharedState::MarkObject(_nodes[i].key, chain);
|
||||
SQSharedState::MarkObject(_nodes[i].val, chain);
|
||||
}
|
||||
END_MARK()
|
||||
SQInteger len = _values.size();
|
||||
for(SQInteger i = 0;i < len; i++) SQSharedState::EnqueueMarkObject(_values[i], queue);
|
||||
}
|
||||
|
||||
void SQClass::Mark(SQCollectable **chain)
|
||||
void SQTable::EnqueueMarkObjectForChildren(SQGCMarkerQueue &queue)
|
||||
{
|
||||
START_MARK()
|
||||
_members->Mark(chain);
|
||||
if(_base) _base->Mark(chain);
|
||||
SQSharedState::MarkObject(_attributes, chain);
|
||||
for(SQUnsignedInteger i =0; i< _defaultvalues.size(); i++) {
|
||||
SQSharedState::MarkObject(_defaultvalues[i].val, chain);
|
||||
SQSharedState::MarkObject(_defaultvalues[i].attrs, chain);
|
||||
}
|
||||
for(SQUnsignedInteger j =0; j< _methods.size(); j++) {
|
||||
SQSharedState::MarkObject(_methods[j].val, chain);
|
||||
SQSharedState::MarkObject(_methods[j].attrs, chain);
|
||||
}
|
||||
for(SQUnsignedInteger k =0; k< _metamethods.size(); k++) {
|
||||
SQSharedState::MarkObject(_metamethods[k], chain);
|
||||
}
|
||||
END_MARK()
|
||||
if(_delegate) queue.Enqueue(_delegate);
|
||||
SQInteger len = _numofnodes;
|
||||
for(SQInteger i = 0; i < len; i++){
|
||||
SQSharedState::EnqueueMarkObject(_nodes[i].key, queue);
|
||||
SQSharedState::EnqueueMarkObject(_nodes[i].val, queue);
|
||||
}
|
||||
}
|
||||
|
||||
void SQInstance::Mark(SQCollectable **chain)
|
||||
void SQClass::EnqueueMarkObjectForChildren(SQGCMarkerQueue &queue)
|
||||
{
|
||||
START_MARK()
|
||||
_class->Mark(chain);
|
||||
SQUnsignedInteger nvalues = _class->_defaultvalues.size();
|
||||
for(SQUnsignedInteger i =0; i< nvalues; i++) {
|
||||
SQSharedState::MarkObject(_values[i], chain);
|
||||
}
|
||||
END_MARK()
|
||||
queue.Enqueue(_members);
|
||||
if(_base) queue.Enqueue(_base);
|
||||
SQSharedState::EnqueueMarkObject(_attributes, queue);
|
||||
for(SQUnsignedInteger i =0; i< _defaultvalues.size(); i++) {
|
||||
SQSharedState::EnqueueMarkObject(_defaultvalues[i].val, queue);
|
||||
SQSharedState::EnqueueMarkObject(_defaultvalues[i].attrs, queue);
|
||||
}
|
||||
for(SQUnsignedInteger j =0; j< _methods.size(); j++) {
|
||||
SQSharedState::EnqueueMarkObject(_methods[j].val, queue);
|
||||
SQSharedState::EnqueueMarkObject(_methods[j].attrs, queue);
|
||||
}
|
||||
for(SQUnsignedInteger k =0; k< _metamethods.size(); k++) {
|
||||
SQSharedState::EnqueueMarkObject(_metamethods[k], queue);
|
||||
}
|
||||
}
|
||||
|
||||
void SQGenerator::Mark(SQCollectable **chain)
|
||||
void SQInstance::EnqueueMarkObjectForChildren(SQGCMarkerQueue &queue)
|
||||
{
|
||||
START_MARK()
|
||||
for(SQUnsignedInteger i = 0; i < _stack.size(); i++) SQSharedState::MarkObject(_stack[i], chain);
|
||||
for(SQUnsignedInteger j = 0; j < _vargsstack.size(); j++) SQSharedState::MarkObject(_vargsstack[j], chain);
|
||||
SQSharedState::MarkObject(_closure, chain);
|
||||
END_MARK()
|
||||
queue.Enqueue(_class);
|
||||
SQUnsignedInteger nvalues = _class->_defaultvalues.size();
|
||||
for(SQUnsignedInteger i =0; i< nvalues; i++) {
|
||||
SQSharedState::EnqueueMarkObject(_values[i], queue);
|
||||
}
|
||||
}
|
||||
|
||||
void SQClosure::Mark(SQCollectable **chain)
|
||||
void SQGenerator::EnqueueMarkObjectForChildren(SQGCMarkerQueue &queue)
|
||||
{
|
||||
START_MARK()
|
||||
for(SQUnsignedInteger i = 0; i < _outervalues.size(); i++) SQSharedState::MarkObject(_outervalues[i], chain);
|
||||
for(SQUnsignedInteger i = 0; i < _defaultparams.size(); i++) SQSharedState::MarkObject(_defaultparams[i], chain);
|
||||
END_MARK()
|
||||
for(SQUnsignedInteger i = 0; i < _stack.size(); i++) SQSharedState::EnqueueMarkObject(_stack[i], queue);
|
||||
for(SQUnsignedInteger j = 0; j < _vargsstack.size(); j++) SQSharedState::EnqueueMarkObject(_vargsstack[j], queue);
|
||||
SQSharedState::EnqueueMarkObject(_closure, queue);
|
||||
}
|
||||
|
||||
void SQNativeClosure::Mark(SQCollectable **chain)
|
||||
void SQClosure::EnqueueMarkObjectForChildren(SQGCMarkerQueue &queue)
|
||||
{
|
||||
START_MARK()
|
||||
for(SQUnsignedInteger i = 0; i < _outervalues.size(); i++) SQSharedState::MarkObject(_outervalues[i], chain);
|
||||
END_MARK()
|
||||
for(SQUnsignedInteger i = 0; i < _outervalues.size(); i++) SQSharedState::EnqueueMarkObject(_outervalues[i], queue);
|
||||
for(SQUnsignedInteger i = 0; i < _defaultparams.size(); i++) SQSharedState::EnqueueMarkObject(_defaultparams[i], queue);
|
||||
}
|
||||
|
||||
void SQUserData::Mark(SQCollectable **chain){
|
||||
START_MARK()
|
||||
if(_delegate) _delegate->Mark(chain);
|
||||
END_MARK()
|
||||
void SQNativeClosure::EnqueueMarkObjectForChildren(SQGCMarkerQueue &queue)
|
||||
{
|
||||
for(SQUnsignedInteger i = 0; i < _outervalues.size(); i++) SQSharedState::EnqueueMarkObject(_outervalues[i], queue);
|
||||
}
|
||||
|
||||
void SQUserData::EnqueueMarkObjectForChildren(SQGCMarkerQueue &queue){
|
||||
if(_delegate) queue.Enqueue(_delegate);
|
||||
}
|
||||
|
||||
void SQCollectable::UnMark() { _uiRef&=~MARK_FLAG; }
|
||||
|
||||
46
src/3rdparty/squirrel/squirrel/sqobject.h
vendored
46
src/3rdparty/squirrel/squirrel/sqobject.h
vendored
@@ -2,6 +2,7 @@
|
||||
#ifndef _SQOBJECT_H_
|
||||
#define _SQOBJECT_H_
|
||||
|
||||
#include <vector>
|
||||
#include "squtils.h"
|
||||
|
||||
#define SQ_CLOSURESTREAM_HEAD (('S'<<24)|('Q'<<16)|('I'<<8)|('R'))
|
||||
@@ -344,11 +345,54 @@ struct SQCollectable : public SQRefCounted {
|
||||
SQCollectable *_prev;
|
||||
SQSharedState *_sharedstate;
|
||||
virtual void Release()=0;
|
||||
virtual void Mark(SQCollectable **chain)=0;
|
||||
virtual void EnqueueMarkObjectForChildren(class SQGCMarkerQueue &queue)=0;
|
||||
void UnMark();
|
||||
virtual void Finalize()=0;
|
||||
static void AddToChain(SQCollectable **chain,SQCollectable *c);
|
||||
static void RemoveFromChain(SQCollectable **chain,SQCollectable *c);
|
||||
|
||||
/**
|
||||
* Helper to perform the final memory freeing of this instance. Since the destructor might
|
||||
* release more objects, this can cause a very deep recursion. As such, the calls to this
|
||||
* are to be done via _sharedstate->DelayFinalFree which ensures the calls to this method
|
||||
* are done in an iterative instead of recursive approach.
|
||||
*/
|
||||
virtual void FinalFree() {}
|
||||
};
|
||||
|
||||
/**
|
||||
* Helper container for state to change the garbage collection from a recursive to an iterative approach.
|
||||
* The iterative approach provides effectively a depth first search approach.
|
||||
*/
|
||||
class SQGCMarkerQueue {
|
||||
std::vector<SQCollectable*> stack; ///< The elements to still process, with the most recent elements at the back.
|
||||
public:
|
||||
/** Whether there are any elements left to process. */
|
||||
bool IsEmpty() { return this->stack.empty(); }
|
||||
|
||||
/**
|
||||
* Remove the most recently added element from the queue.
|
||||
* Removal when the queue is empty results in undefined behaviour.
|
||||
*/
|
||||
SQCollectable *Pop()
|
||||
{
|
||||
SQCollectable *collectable = this->stack.back();
|
||||
this->stack.pop_back();
|
||||
return collectable;
|
||||
}
|
||||
|
||||
/**
|
||||
* Add a collectable to the queue, but only when it has not been marked yet.
|
||||
* When adding it to the queue, the collectable will be marked, so subsequent calls
|
||||
* will not add it again.
|
||||
*/
|
||||
void Enqueue(SQCollectable *collectable)
|
||||
{
|
||||
if ((collectable->_uiRef & MARK_FLAG) == 0) {
|
||||
collectable->_uiRef |= MARK_FLAG;
|
||||
this->stack.push_back(collectable);
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
|
||||
98
src/3rdparty/squirrel/squirrel/sqstate.cpp
vendored
98
src/3rdparty/squirrel/squirrel/sqstate.cpp
vendored
@@ -99,6 +99,7 @@ SQSharedState::SQSharedState()
|
||||
_notifyallexceptions = false;
|
||||
_scratchpad=NULL;
|
||||
_scratchpadsize=0;
|
||||
_collectable_free_processing = false;
|
||||
#ifndef NO_GARBAGE_COLLECTOR
|
||||
_gc_chain=NULL;
|
||||
#endif
|
||||
@@ -226,20 +227,48 @@ SQInteger SQSharedState::GetMetaMethodIdxByName(const SQObjectPtr &name)
|
||||
return -1;
|
||||
}
|
||||
|
||||
/**
|
||||
* Helper function that is to be used instead of calling FinalFree directly on the instance,
|
||||
* so the frees can happen iteratively. This as in the FinalFree the references to any other
|
||||
* objects are released, which can cause those object to be freed yielding a potentially
|
||||
* very deep stack in case of for example a link list.
|
||||
*
|
||||
* This is done internally by a vector onto which the to be freed instances are pushed. When
|
||||
* this is called when not already processing, this method will actually call the FinalFree
|
||||
* function which might cause more elements to end up in the queue which this method then
|
||||
* picks up continueing until it has processed all instances in that queue.
|
||||
* @param collectable The collectable to (eventually) free.
|
||||
*/
|
||||
void SQSharedState::DelayFinalFree(SQCollectable *collectable)
|
||||
{
|
||||
this->_collectable_free_queue.push_back(collectable);
|
||||
|
||||
if (!this->_collectable_free_processing) {
|
||||
this->_collectable_free_processing = true;
|
||||
while (!this->_collectable_free_queue.empty()) {
|
||||
SQCollectable *collectable = this->_collectable_free_queue.back();
|
||||
this->_collectable_free_queue.pop_back();
|
||||
collectable->FinalFree();
|
||||
}
|
||||
this->_collectable_free_processing = false;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
#ifndef NO_GARBAGE_COLLECTOR
|
||||
|
||||
void SQSharedState::MarkObject(SQObjectPtr &o,SQCollectable **chain)
|
||||
void SQSharedState::EnqueueMarkObject(SQObjectPtr &o,SQGCMarkerQueue &queue)
|
||||
{
|
||||
switch(type(o)){
|
||||
case OT_TABLE:_table(o)->Mark(chain);break;
|
||||
case OT_ARRAY:_array(o)->Mark(chain);break;
|
||||
case OT_USERDATA:_userdata(o)->Mark(chain);break;
|
||||
case OT_CLOSURE:_closure(o)->Mark(chain);break;
|
||||
case OT_NATIVECLOSURE:_nativeclosure(o)->Mark(chain);break;
|
||||
case OT_GENERATOR:_generator(o)->Mark(chain);break;
|
||||
case OT_THREAD:_thread(o)->Mark(chain);break;
|
||||
case OT_CLASS:_class(o)->Mark(chain);break;
|
||||
case OT_INSTANCE:_instance(o)->Mark(chain);break;
|
||||
case OT_TABLE:queue.Enqueue(_table(o));break;
|
||||
case OT_ARRAY:queue.Enqueue(_array(o));break;
|
||||
case OT_USERDATA:queue.Enqueue(_userdata(o));break;
|
||||
case OT_CLOSURE:queue.Enqueue(_closure(o));break;
|
||||
case OT_NATIVECLOSURE:queue.Enqueue(_nativeclosure(o));break;
|
||||
case OT_GENERATOR:queue.Enqueue(_generator(o));break;
|
||||
case OT_THREAD:queue.Enqueue(_thread(o));break;
|
||||
case OT_CLASS:queue.Enqueue(_class(o));break;
|
||||
case OT_INSTANCE:queue.Enqueue(_instance(o));break;
|
||||
default: break; //shutup compiler
|
||||
}
|
||||
}
|
||||
@@ -248,25 +277,36 @@ void SQSharedState::MarkObject(SQObjectPtr &o,SQCollectable **chain)
|
||||
SQInteger SQSharedState::CollectGarbage(SQVM *vm)
|
||||
{
|
||||
SQInteger n=0;
|
||||
SQCollectable *tchain=NULL;
|
||||
SQVM *vms = _thread(_root_vm);
|
||||
|
||||
vms->Mark(&tchain);
|
||||
SQGCMarkerQueue queue;
|
||||
queue.Enqueue(vms);
|
||||
#ifdef WITH_ASSERT
|
||||
SQInteger x = _table(_thread(_root_vm)->_roottable)->CountUsed();
|
||||
_refs_table.Mark(&tchain);
|
||||
MarkObject(_registry,&tchain);
|
||||
MarkObject(_consts,&tchain);
|
||||
MarkObject(_metamethodsmap,&tchain);
|
||||
MarkObject(_table_default_delegate,&tchain);
|
||||
MarkObject(_array_default_delegate,&tchain);
|
||||
MarkObject(_string_default_delegate,&tchain);
|
||||
MarkObject(_number_default_delegate,&tchain);
|
||||
MarkObject(_generator_default_delegate,&tchain);
|
||||
MarkObject(_thread_default_delegate,&tchain);
|
||||
MarkObject(_closure_default_delegate,&tchain);
|
||||
MarkObject(_class_default_delegate,&tchain);
|
||||
MarkObject(_instance_default_delegate,&tchain);
|
||||
MarkObject(_weakref_default_delegate,&tchain);
|
||||
#endif
|
||||
_refs_table.EnqueueMarkObject(queue);
|
||||
EnqueueMarkObject(_registry,queue);
|
||||
EnqueueMarkObject(_consts,queue);
|
||||
EnqueueMarkObject(_metamethodsmap,queue);
|
||||
EnqueueMarkObject(_table_default_delegate,queue);
|
||||
EnqueueMarkObject(_array_default_delegate,queue);
|
||||
EnqueueMarkObject(_string_default_delegate,queue);
|
||||
EnqueueMarkObject(_number_default_delegate,queue);
|
||||
EnqueueMarkObject(_generator_default_delegate,queue);
|
||||
EnqueueMarkObject(_thread_default_delegate,queue);
|
||||
EnqueueMarkObject(_closure_default_delegate,queue);
|
||||
EnqueueMarkObject(_class_default_delegate,queue);
|
||||
EnqueueMarkObject(_instance_default_delegate,queue);
|
||||
EnqueueMarkObject(_weakref_default_delegate,queue);
|
||||
|
||||
SQCollectable *tchain=NULL;
|
||||
|
||||
while (!queue.IsEmpty()) {
|
||||
SQCollectable *q = queue.Pop();
|
||||
q->EnqueueMarkObjectForChildren(queue);
|
||||
SQCollectable::RemoveFromChain(&_gc_chain, q);
|
||||
SQCollectable::AddToChain(&tchain, q);
|
||||
}
|
||||
|
||||
SQCollectable *t = _gc_chain;
|
||||
SQCollectable *nx = NULL;
|
||||
@@ -289,8 +329,10 @@ SQInteger SQSharedState::CollectGarbage(SQVM *vm)
|
||||
t = t->_next;
|
||||
}
|
||||
_gc_chain = tchain;
|
||||
#ifdef WITH_ASSERT
|
||||
SQInteger z = _table(_thread(_root_vm)->_roottable)->CountUsed();
|
||||
assert(z == x);
|
||||
#endif
|
||||
return n;
|
||||
}
|
||||
#endif
|
||||
@@ -353,12 +395,12 @@ RefTable::~RefTable()
|
||||
}
|
||||
|
||||
#ifndef NO_GARBAGE_COLLECTOR
|
||||
void RefTable::Mark(SQCollectable **chain)
|
||||
void RefTable::EnqueueMarkObject(SQGCMarkerQueue &queue)
|
||||
{
|
||||
RefNode *nodes = (RefNode *)_nodes;
|
||||
for(SQUnsignedInteger n = 0; n < _numofslots; n++) {
|
||||
if(type(nodes->obj) != OT_NULL) {
|
||||
SQSharedState::MarkObject(nodes->obj,chain);
|
||||
SQSharedState::EnqueueMarkObject(nodes->obj,queue);
|
||||
}
|
||||
nodes++;
|
||||
}
|
||||
|
||||
9
src/3rdparty/squirrel/squirrel/sqstate.h
vendored
9
src/3rdparty/squirrel/squirrel/sqstate.h
vendored
@@ -34,7 +34,7 @@ struct RefTable {
|
||||
void AddRef(SQObject &obj);
|
||||
SQBool Release(SQObject &obj);
|
||||
#ifndef NO_GARBAGE_COLLECTOR
|
||||
void Mark(SQCollectable **chain);
|
||||
void EnqueueMarkObject(SQGCMarkerQueue &queue);
|
||||
#endif
|
||||
void Finalize();
|
||||
private:
|
||||
@@ -61,9 +61,10 @@ struct SQSharedState
|
||||
public:
|
||||
SQChar* GetScratchPad(SQInteger size);
|
||||
SQInteger GetMetaMethodIdxByName(const SQObjectPtr &name);
|
||||
void DelayFinalFree(SQCollectable *collectable);
|
||||
#ifndef NO_GARBAGE_COLLECTOR
|
||||
SQInteger CollectGarbage(SQVM *vm);
|
||||
static void MarkObject(SQObjectPtr &o,SQCollectable **chain);
|
||||
static void EnqueueMarkObject(SQObjectPtr &o,SQGCMarkerQueue &queue);
|
||||
#endif
|
||||
SQObjectPtrVec *_metamethods;
|
||||
SQObjectPtr _metamethodsmap;
|
||||
@@ -74,6 +75,10 @@ public:
|
||||
SQObjectPtr _registry;
|
||||
SQObjectPtr _consts;
|
||||
SQObjectPtr _constructoridx;
|
||||
/** Queue to make freeing of collectables iterative. */
|
||||
std::vector<SQCollectable *> _collectable_free_queue;
|
||||
/** Whether someone is already processing the _collectable_free_queue. */
|
||||
bool _collectable_free_processing;
|
||||
#ifndef NO_GARBAGE_COLLECTOR
|
||||
SQCollectable *_gc_chain;
|
||||
#endif
|
||||
|
||||
10
src/3rdparty/squirrel/squirrel/sqtable.h
vendored
10
src/3rdparty/squirrel/squirrel/sqtable.h
vendored
@@ -50,7 +50,7 @@ public:
|
||||
newtable->_delegate = NULL;
|
||||
return newtable;
|
||||
}
|
||||
void Finalize();
|
||||
void Finalize() override;
|
||||
SQTable *Clone();
|
||||
~SQTable()
|
||||
{
|
||||
@@ -60,7 +60,7 @@ public:
|
||||
SQ_FREE(_nodes, _numofnodes * sizeof(_HashNode));
|
||||
}
|
||||
#ifndef NO_GARBAGE_COLLECTOR
|
||||
void Mark(SQCollectable **chain);
|
||||
void EnqueueMarkObjectForChildren(SQGCMarkerQueue &queue) override;
|
||||
#endif
|
||||
inline _HashNode *_Get(const SQObjectPtr &key,SQHash hash)
|
||||
{
|
||||
@@ -81,7 +81,11 @@ public:
|
||||
|
||||
SQInteger CountUsed(){ return _usednodes;}
|
||||
void Clear();
|
||||
void Release()
|
||||
void Release() override
|
||||
{
|
||||
this->_sharedstate->DelayFinalFree(this);
|
||||
}
|
||||
void FinalFree() override
|
||||
{
|
||||
sq_delete(this, SQTable);
|
||||
}
|
||||
|
||||
2
src/3rdparty/squirrel/squirrel/squserdata.h
vendored
2
src/3rdparty/squirrel/squirrel/squserdata.h
vendored
@@ -18,7 +18,7 @@ struct SQUserData : SQDelegable
|
||||
return ud;
|
||||
}
|
||||
#ifndef NO_GARBAGE_COLLECTOR
|
||||
void Mark(SQCollectable **chain);
|
||||
void EnqueueMarkObjectForChildren(SQGCMarkerQueue &queue);
|
||||
void Finalize(){SetDelegate(NULL);}
|
||||
#endif
|
||||
void Release() {
|
||||
|
||||
16
src/3rdparty/squirrel/squirrel/sqvm.cpp
vendored
16
src/3rdparty/squirrel/squirrel/sqvm.cpp
vendored
@@ -1460,7 +1460,7 @@ bool SQVM::DeleteSlot(const SQObjectPtr &self,const SQObjectPtr &key,SQObjectPtr
|
||||
}
|
||||
}
|
||||
res = t;
|
||||
}
|
||||
}
|
||||
break;
|
||||
default:
|
||||
Raise_Error("attempt to delete a slot from a %s",GetTypeName(self));
|
||||
@@ -1471,8 +1471,8 @@ bool SQVM::DeleteSlot(const SQObjectPtr &self,const SQObjectPtr &key,SQObjectPtr
|
||||
|
||||
bool SQVM::Call(SQObjectPtr &closure,SQInteger nparams,SQInteger stackbase,SQObjectPtr &outres,SQBool raiseerror,SQBool can_suspend)
|
||||
{
|
||||
#ifdef _DEBUG
|
||||
SQInteger prevstackbase = _stackbase;
|
||||
#ifdef WITH_ASSERT
|
||||
SQInteger prevstackbase = _stackbase;
|
||||
#endif
|
||||
switch(type(closure)) {
|
||||
case OT_CLOSURE: {
|
||||
@@ -1482,13 +1482,13 @@ SQInteger prevstackbase = _stackbase;
|
||||
bool ret = Execute(closure, _top - nparams, nparams, stackbase,outres,raiseerror);
|
||||
this->_can_suspend = backup_suspend;
|
||||
return ret;
|
||||
}
|
||||
}
|
||||
break;
|
||||
case OT_NATIVECLOSURE:{
|
||||
case OT_NATIVECLOSURE: {
|
||||
bool suspend;
|
||||
return CallNative(_nativeclosure(closure), nparams, stackbase, outres,suspend);
|
||||
|
||||
}
|
||||
}
|
||||
break;
|
||||
case OT_CLASS: {
|
||||
SQObjectPtr constr;
|
||||
@@ -1499,12 +1499,12 @@ SQInteger prevstackbase = _stackbase;
|
||||
return Call(constr,nparams,stackbase,temp,raiseerror,false);
|
||||
}
|
||||
return true;
|
||||
}
|
||||
}
|
||||
break;
|
||||
default:
|
||||
return false;
|
||||
}
|
||||
#ifdef _DEBUG
|
||||
#ifdef WITH_ASSERT
|
||||
if(!_suspended) {
|
||||
assert(_stackbase == prevstackbase);
|
||||
}
|
||||
|
||||
2
src/3rdparty/squirrel/squirrel/sqvm.h
vendored
2
src/3rdparty/squirrel/squirrel/sqvm.h
vendored
@@ -113,7 +113,7 @@ public:
|
||||
#endif
|
||||
|
||||
#ifndef NO_GARBAGE_COLLECTOR
|
||||
void Mark(SQCollectable **chain);
|
||||
void EnqueueMarkObjectForChildren(SQGCMarkerQueue &queue);
|
||||
#endif
|
||||
void Finalize();
|
||||
void GrowCallStack() {
|
||||
|
||||
@@ -155,7 +155,7 @@ add_files(
|
||||
fios_gui.cpp
|
||||
fontcache.cpp
|
||||
fontcache.h
|
||||
fontdetection.cpp
|
||||
fontcache_internal.h
|
||||
fontdetection.h
|
||||
framerate_gui.cpp
|
||||
framerate_type.h
|
||||
|
||||
@@ -704,16 +704,16 @@ static const NWidgetPart _nested_ai_config_widgets[] = {
|
||||
NWidget(WWT_MATRIX, COLOUR_MAUVE, WID_AIC_GAMELIST), SetMinimalSize(288, 14), SetFill(1, 0), SetMatrixDataTip(1, 1, STR_AI_CONFIG_GAMELIST_TOOLTIP),
|
||||
EndContainer(),
|
||||
NWidget(NWID_HORIZONTAL, NC_EQUALSIZE), SetPIP(7, 0, 7),
|
||||
NWidget(WWT_PUSHTXTBTN, COLOUR_YELLOW, WID_AIC_CHANGE), SetFill(1, 0), SetMinimalSize(93, 12), SetDataTip(STR_AI_CONFIG_CHANGE, STR_AI_CONFIG_CHANGE_TOOLTIP),
|
||||
NWidget(WWT_PUSHTXTBTN, COLOUR_YELLOW, WID_AIC_CONFIGURE), SetFill(1, 0), SetMinimalSize(93, 12), SetDataTip(STR_AI_CONFIG_CONFIGURE, STR_AI_CONFIG_CONFIGURE_TOOLTIP),
|
||||
NWidget(WWT_PUSHTXTBTN, COLOUR_YELLOW, WID_AIC_CLOSE), SetFill(1, 0), SetMinimalSize(93, 12), SetDataTip(STR_AI_SETTINGS_CLOSE, STR_NULL),
|
||||
EndContainer(),
|
||||
NWidget(WWT_PUSHTXTBTN, COLOUR_YELLOW, WID_AIC_CHANGE), SetFill(1, 0), SetMinimalSize(93, 0), SetDataTip(STR_AI_CONFIG_CHANGE, STR_AI_CONFIG_CHANGE_TOOLTIP),
|
||||
NWidget(WWT_PUSHTXTBTN, COLOUR_YELLOW, WID_AIC_CONFIGURE), SetFill(1, 0), SetMinimalSize(93, 0), SetDataTip(STR_AI_CONFIG_CONFIGURE, STR_AI_CONFIG_CONFIGURE_TOOLTIP),
|
||||
NWidget(WWT_PUSHTXTBTN, COLOUR_YELLOW, WID_AIC_CLOSE), SetFill(1, 0), SetMinimalSize(93, 0), SetDataTip(STR_AI_SETTINGS_CLOSE, STR_NULL),
|
||||
EndContainer(),
|
||||
NWidget(NWID_HORIZONTAL, NC_EQUALSIZE), SetPIP(7, 0, 7),
|
||||
NWidget(WWT_PUSHTXTBTN, COLOUR_YELLOW, WID_AIC_TEXTFILE + TFT_README), SetFill(1, 0), SetResize(1, 0), SetDataTip(STR_TEXTFILE_VIEW_README, STR_NULL),
|
||||
NWidget(WWT_PUSHTXTBTN, COLOUR_YELLOW, WID_AIC_TEXTFILE + TFT_CHANGELOG), SetFill(1, 0), SetResize(1, 0), SetDataTip(STR_TEXTFILE_VIEW_CHANGELOG, STR_NULL),
|
||||
NWidget(WWT_PUSHTXTBTN, COLOUR_YELLOW, WID_AIC_TEXTFILE + TFT_LICENSE), SetFill(1, 0), SetResize(1, 0), SetDataTip(STR_TEXTFILE_VIEW_LICENCE, STR_NULL),
|
||||
EndContainer(),
|
||||
NWidget(WWT_PUSHTXTBTN, COLOUR_YELLOW, WID_AIC_CONTENT_DOWNLOAD), SetFill(1, 0), SetMinimalSize(279, 12), SetPadding(0, 7, 9, 7), SetDataTip(STR_INTRO_ONLINE_CONTENT, STR_INTRO_TOOLTIP_ONLINE_CONTENT),
|
||||
NWidget(WWT_PUSHTXTBTN, COLOUR_YELLOW, WID_AIC_CONTENT_DOWNLOAD), SetFill(1, 0), SetMinimalSize(279, 0), SetPadding(0, 7, 9, 7), SetDataTip(STR_INTRO_ONLINE_CONTENT, STR_INTRO_TOOLTIP_ONLINE_CONTENT),
|
||||
EndContainer(),
|
||||
};
|
||||
|
||||
@@ -1406,7 +1406,8 @@ struct AIDebugWindow : public Window {
|
||||
this->SetWidgetLoweredState(WID_AID_MATCH_CASE_BTN, this->case_sensitive_break_check);
|
||||
|
||||
this->SetWidgetDisabledState(WID_AID_SETTINGS, ai_debug_company == INVALID_COMPANY);
|
||||
this->SetWidgetDisabledState(WID_AID_RELOAD_TOGGLE, ai_debug_company == INVALID_COMPANY || ai_debug_company == OWNER_DEITY);
|
||||
extern CompanyID _local_company;
|
||||
this->SetWidgetDisabledState(WID_AID_RELOAD_TOGGLE, ai_debug_company == INVALID_COMPANY || ai_debug_company == OWNER_DEITY || ai_debug_company == _local_company);
|
||||
this->SetWidgetDisabledState(WID_AID_CONTINUE_BTN, ai_debug_company == INVALID_COMPANY ||
|
||||
(ai_debug_company == OWNER_DEITY ? !Game::IsPaused() : !AI::IsPaused(ai_debug_company)));
|
||||
}
|
||||
@@ -1430,7 +1431,7 @@ StringFilter AIDebugWindow::break_string_filter(&AIDebugWindow::case_sensitive_b
|
||||
/** Make a number of rows with buttons for each company for the AI debug window. */
|
||||
NWidgetBase *MakeCompanyButtonRowsAIDebug(int *biggest_index)
|
||||
{
|
||||
return MakeCompanyButtonRows(biggest_index, WID_AID_COMPANY_BUTTON_START, WID_AID_COMPANY_BUTTON_END, 8, STR_AI_DEBUG_SELECT_AI_TOOLTIP);
|
||||
return MakeCompanyButtonRows(biggest_index, WID_AID_COMPANY_BUTTON_START, WID_AID_COMPANY_BUTTON_END, COLOUR_GREY, 8, STR_AI_DEBUG_SELECT_AI_TOOLTIP);
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -909,7 +909,7 @@ static bool AircraftController(Aircraft *v)
|
||||
SoundID sfx = AircraftVehInfo(v->engine_type)->sfx;
|
||||
/* For compatibility with old NewGRF we ignore the sfx property, unless a NewGRF-defined sound is used.
|
||||
* The baseset has only one helicopter sound, so this only limits using plane or cow sounds. */
|
||||
if (sfx < ORIGINAL_SAMPLE_COUNT) sfx = SND_18_HELICOPTER;
|
||||
if (sfx < ORIGINAL_SAMPLE_COUNT) sfx = SND_18_TAKEOFF_HELICOPTER;
|
||||
SndPlayVehicleFx(sfx, v);
|
||||
}
|
||||
}
|
||||
@@ -1328,19 +1328,22 @@ static void CrashAirplane(Aircraft *v)
|
||||
v->Next()->cargo.Truncate();
|
||||
const Station *st = GetTargetAirportIfValid(v);
|
||||
StringID newsitem;
|
||||
TileIndex vt;
|
||||
if (st == nullptr) {
|
||||
newsitem = STR_NEWS_PLANE_CRASH_OUT_OF_FUEL;
|
||||
vt = TileVirtXY(v->x_pos, v->y_pos);
|
||||
} else {
|
||||
SetDParam(1, st->index);
|
||||
newsitem = STR_NEWS_AIRCRAFT_CRASH;
|
||||
vt = v->tile;
|
||||
}
|
||||
|
||||
AI::NewEvent(v->owner, new ScriptEventVehicleCrashed(v->index, v->tile, st == nullptr ? ScriptEventVehicleCrashed::CRASH_AIRCRAFT_NO_AIRPORT : ScriptEventVehicleCrashed::CRASH_PLANE_LANDING));
|
||||
Game::NewEvent(new ScriptEventVehicleCrashed(v->index, v->tile, st == nullptr ? ScriptEventVehicleCrashed::CRASH_AIRCRAFT_NO_AIRPORT : ScriptEventVehicleCrashed::CRASH_PLANE_LANDING));
|
||||
AI::NewEvent(v->owner, new ScriptEventVehicleCrashed(v->index, vt, st == nullptr ? ScriptEventVehicleCrashed::CRASH_AIRCRAFT_NO_AIRPORT : ScriptEventVehicleCrashed::CRASH_PLANE_LANDING));
|
||||
Game::NewEvent(new ScriptEventVehicleCrashed(v->index, vt, st == nullptr ? ScriptEventVehicleCrashed::CRASH_AIRCRAFT_NO_AIRPORT : ScriptEventVehicleCrashed::CRASH_PLANE_LANDING));
|
||||
|
||||
AddTileNewsItem(newsitem, NT_ACCIDENT, v->tile, nullptr, st != nullptr ? st->index : INVALID_STATION);
|
||||
AddTileNewsItem(newsitem, NT_ACCIDENT, vt, nullptr, st != nullptr ? st->index : INVALID_STATION);
|
||||
|
||||
ModifyStationRatingAround(v->tile, v->owner, -160, 30);
|
||||
ModifyStationRatingAround(vt, v->owner, -160, 30);
|
||||
if (_settings_client.sound.disaster) SndPlayVehicleFx(SND_12_EXPLOSION, v);
|
||||
}
|
||||
|
||||
|
||||
@@ -44,7 +44,7 @@ void CcBuildAirport(const CommandCost &result, TileIndex tile, uint32 p1, uint32
|
||||
{
|
||||
if (result.Failed()) return;
|
||||
|
||||
if (_settings_client.sound.confirm) SndPlayTileFx(SND_1F_SPLAT_OTHER, tile);
|
||||
if (_settings_client.sound.confirm) SndPlayTileFx(SND_1F_CONSTRUCTION_OTHER, tile);
|
||||
if (!_settings_client.gui.persistent_buildingtools) ResetObjectToPlace();
|
||||
}
|
||||
|
||||
|
||||
@@ -319,6 +319,8 @@ static CommandCost BuildReplacementVehicle(Vehicle *old_veh, Vehicle **new_vehic
|
||||
/* Does it need to be refitted */
|
||||
CargoID refit_cargo = GetNewCargoTypeForReplace(old_veh, e, part_of_chain);
|
||||
if (refit_cargo == CT_INVALID) {
|
||||
if (!IsLocalCompany()) return CommandCost();
|
||||
|
||||
SetDParam(0, old_veh->index);
|
||||
|
||||
int order_id = GetIncompatibleRefitOrderIdForAutoreplace(old_veh, e);
|
||||
@@ -595,6 +597,7 @@ static CommandCost ReplaceChain(Vehicle **chain, DoCommandFlag flags, bool wagon
|
||||
|
||||
/* Sell wagon */
|
||||
CommandCost ret = DoCommand(0, wagon->index, 0, DC_EXEC, GetCmdSellVeh(wagon));
|
||||
(void)ret; // assert only
|
||||
assert(ret.Succeeded());
|
||||
new_vehs[i] = nullptr;
|
||||
|
||||
@@ -650,6 +653,7 @@ static CommandCost ReplaceChain(Vehicle **chain, DoCommandFlag flags, bool wagon
|
||||
|
||||
for (int i = num_units - 1; i > 0; i--) {
|
||||
CommandCost ret = CmdMoveVehicle(old_vehs[i], old_head, DC_EXEC | DC_AUTOREPLACE, false);
|
||||
(void)ret; // assert only
|
||||
assert(ret.Succeeded());
|
||||
}
|
||||
}
|
||||
|
||||
@@ -81,7 +81,7 @@ class ReplaceVehicleWindow : public Window {
|
||||
bool replace_engines; ///< If \c true, engines are replaced, if \c false, wagons are replaced (only for trains).
|
||||
bool reset_sel_engine; ///< Also reset #sel_engine while updating left and/or right and no valid engine selected.
|
||||
GroupID sel_group; ///< Group selected to replace.
|
||||
int details_height; ///< Minimal needed height of the details panels (found so far).
|
||||
int details_height; ///< Minimal needed height of the details panels, in text lines (found so far).
|
||||
byte sort_criteria; ///< Criteria of sorting vehicles.
|
||||
bool descending_sort_order; ///< Order of sorting vehicles.
|
||||
bool show_hidden_engines; ///< Whether to show the hidden engines.
|
||||
@@ -229,7 +229,7 @@ public:
|
||||
this->engines[0].ForceRebuild();
|
||||
this->engines[1].ForceRebuild();
|
||||
this->reset_sel_engine = true;
|
||||
this->details_height = ((vehicletype == VEH_TRAIN) ? 10 : 9) * FONT_HEIGHT_NORMAL + WD_FRAMERECT_TOP + WD_FRAMERECT_BOTTOM;
|
||||
this->details_height = ((vehicletype == VEH_TRAIN) ? 10 : 9);
|
||||
this->sel_engine[0] = INVALID_ENGINE;
|
||||
this->sel_engine[1] = INVALID_ENGINE;
|
||||
this->show_hidden_engines = _engine_sort_show_hidden_engines[vehicletype];
|
||||
@@ -274,7 +274,7 @@ public:
|
||||
|
||||
case WID_RV_LEFT_DETAILS:
|
||||
case WID_RV_RIGHT_DETAILS:
|
||||
size->height = this->details_height;
|
||||
size->height = FONT_HEIGHT_NORMAL * this->details_height + padding.height;
|
||||
break;
|
||||
|
||||
case WID_RV_TRAIN_WAGONREMOVE_TOGGLE: {
|
||||
@@ -475,7 +475,7 @@ public:
|
||||
NWidgetBase *nwi = this->GetWidget<NWidgetBase>(side == 0 ? WID_RV_LEFT_DETAILS : WID_RV_RIGHT_DETAILS);
|
||||
int text_end = DrawVehiclePurchaseInfo(nwi->pos_x + WD_FRAMETEXT_LEFT, nwi->pos_x + nwi->current_x - WD_FRAMETEXT_RIGHT,
|
||||
nwi->pos_y + WD_FRAMERECT_TOP, this->sel_engine[side], ted);
|
||||
needed_height = std::max(needed_height, text_end - (int)nwi->pos_y + WD_FRAMERECT_BOTTOM);
|
||||
needed_height = std::max(needed_height, (text_end - (int)nwi->pos_y - WD_FRAMERECT_TOP) / FONT_HEIGHT_NORMAL);
|
||||
}
|
||||
}
|
||||
if (needed_height != this->details_height) { // Details window are not high enough, enlarge them.
|
||||
|
||||
@@ -274,7 +274,7 @@ template <class Tbase_set>
|
||||
return p;
|
||||
}
|
||||
|
||||
#include "network/network_content.h"
|
||||
#include "network/core/tcp_content_type.h"
|
||||
|
||||
template <class Tbase_set> const char *TryGetBaseSetFile(const ContentInfo *ci, bool md5sum, const Tbase_set *s)
|
||||
{
|
||||
|
||||
@@ -124,6 +124,18 @@ public:
|
||||
return ((r * 13063) + (g * 25647) + (b * 4981)) / 65536;
|
||||
}
|
||||
|
||||
/**
|
||||
* Make a colour dark grey, for specialized 32bpp remapping.
|
||||
* @param colour the colour to make dark.
|
||||
* @return the new colour, now darker.
|
||||
*/
|
||||
static inline Colour MakeDark(Colour colour)
|
||||
{
|
||||
uint8 d = MakeDark(colour.r, colour.g, colour.b);
|
||||
|
||||
return Colour(d, d, d);
|
||||
}
|
||||
|
||||
/**
|
||||
* Make a colour grey - based.
|
||||
* @param colour the colour to make grey.
|
||||
@@ -154,6 +166,16 @@ public:
|
||||
|
||||
return ReallyAdjustBrightness(colour, brightness);
|
||||
}
|
||||
|
||||
static inline uint8 GetColourBrightness(Colour colour)
|
||||
{
|
||||
uint8 rgb_max = std::max(colour.r, std::max(colour.g, colour.b));
|
||||
|
||||
/* Black pixel (8bpp or old 32bpp image), so use default value */
|
||||
if (rgb_max == 0) rgb_max = DEFAULT_BRIGHTNESS;
|
||||
|
||||
return rgb_max;
|
||||
}
|
||||
};
|
||||
|
||||
#endif /* BLITTER_32BPP_BASE_HPP */
|
||||
|
||||
@@ -24,7 +24,7 @@ static FBlitter_32bppOptimized iFBlitter_32bppOptimized;
|
||||
* @param bp further blitting parameters
|
||||
* @param zoom zoom level at which we are drawing
|
||||
*/
|
||||
template <BlitterMode mode>
|
||||
template <BlitterMode mode, bool Tpal_to_rgb>
|
||||
inline void Blitter_32bppOptimized::Draw(const Blitter::BlitterParams *bp, ZoomLevel zoom)
|
||||
{
|
||||
const SpriteData *src = (const SpriteData *)bp->sprite;
|
||||
@@ -209,18 +209,29 @@ inline void Blitter_32bppOptimized::Draw(const Blitter::BlitterParams *bp, ZoomL
|
||||
default:
|
||||
if (src_px->a == 255) {
|
||||
/* faster than memcpy(), n is usually low */
|
||||
src_n += n;
|
||||
do {
|
||||
*dst = src_px->data;
|
||||
if (Tpal_to_rgb && *src_n != 0) {
|
||||
/* Convert the mapping channel to a RGB value */
|
||||
*dst = this->AdjustBrightness(this->LookupColourInPalette(GB(*src_n, 0, 8)), GB(*src_n, 8, 8)).data;
|
||||
} else {
|
||||
*dst = src_px->data;
|
||||
}
|
||||
dst++;
|
||||
src_px++;
|
||||
src_n++;
|
||||
} while (--n != 0);
|
||||
} else {
|
||||
src_n += n;
|
||||
do {
|
||||
*dst = ComposeColourRGBANoCheck(src_px->r, src_px->g, src_px->b, src_px->a, *dst);
|
||||
if (Tpal_to_rgb && *src_n != 0) {
|
||||
/* Convert the mapping channel to a RGB value */
|
||||
Colour colour = this->AdjustBrightness(this->LookupColourInPalette(GB(*src_n, 0, 8)), GB(*src_n, 8, 8));
|
||||
*dst = ComposeColourRGBANoCheck(colour.r, colour.g, colour.b, src_px->a, *dst);
|
||||
} else {
|
||||
*dst = ComposeColourRGBANoCheck(src_px->r, src_px->g, src_px->b, src_px->a, *dst);
|
||||
}
|
||||
dst++;
|
||||
src_px++;
|
||||
src_n++;
|
||||
} while (--n != 0);
|
||||
}
|
||||
break;
|
||||
@@ -233,6 +244,22 @@ inline void Blitter_32bppOptimized::Draw(const Blitter::BlitterParams *bp, ZoomL
|
||||
}
|
||||
}
|
||||
|
||||
template <bool Tpal_to_rgb>
|
||||
void Blitter_32bppOptimized::Draw(Blitter::BlitterParams *bp, BlitterMode mode, ZoomLevel zoom)
|
||||
{
|
||||
switch (mode) {
|
||||
default: NOT_REACHED();
|
||||
case BM_NORMAL: Draw<BM_NORMAL, Tpal_to_rgb>(bp, zoom); return;
|
||||
case BM_COLOUR_REMAP: Draw<BM_COLOUR_REMAP, Tpal_to_rgb>(bp, zoom); return;
|
||||
case BM_TRANSPARENT: Draw<BM_TRANSPARENT, Tpal_to_rgb>(bp, zoom); return;
|
||||
case BM_CRASH_REMAP: Draw<BM_CRASH_REMAP, Tpal_to_rgb>(bp, zoom); return;
|
||||
case BM_BLACK_REMAP: Draw<BM_BLACK_REMAP, Tpal_to_rgb>(bp, zoom); return;
|
||||
}
|
||||
}
|
||||
|
||||
template void Blitter_32bppOptimized::Draw<true>(Blitter::BlitterParams *bp, BlitterMode mode, ZoomLevel zoom);
|
||||
template void Blitter_32bppOptimized::Draw<false>(Blitter::BlitterParams *bp, BlitterMode mode, ZoomLevel zoom);
|
||||
|
||||
/**
|
||||
* Draws a sprite to a (screen) buffer. Calls adequate templated function.
|
||||
*
|
||||
@@ -242,17 +269,10 @@ inline void Blitter_32bppOptimized::Draw(const Blitter::BlitterParams *bp, ZoomL
|
||||
*/
|
||||
void Blitter_32bppOptimized::Draw(Blitter::BlitterParams *bp, BlitterMode mode, ZoomLevel zoom)
|
||||
{
|
||||
switch (mode) {
|
||||
default: NOT_REACHED();
|
||||
case BM_NORMAL: Draw<BM_NORMAL> (bp, zoom); return;
|
||||
case BM_COLOUR_REMAP: Draw<BM_COLOUR_REMAP>(bp, zoom); return;
|
||||
case BM_TRANSPARENT: Draw<BM_TRANSPARENT> (bp, zoom); return;
|
||||
case BM_CRASH_REMAP: Draw<BM_CRASH_REMAP> (bp, zoom); return;
|
||||
case BM_BLACK_REMAP: Draw<BM_BLACK_REMAP> (bp, zoom); return;
|
||||
}
|
||||
this->Draw<false>(bp, mode, zoom);
|
||||
}
|
||||
|
||||
Sprite *Blitter_32bppOptimized::Encode(const SpriteLoader::Sprite *sprite, AllocatorProc *allocator)
|
||||
template <bool Tpal_to_rgb> Sprite *Blitter_32bppOptimized::EncodeInternal(const SpriteLoader::Sprite *sprite, AllocatorProc *allocator)
|
||||
{
|
||||
/* streams of pixels (a, r, g, b channels)
|
||||
*
|
||||
@@ -324,17 +344,23 @@ Sprite *Blitter_32bppOptimized::Encode(const SpriteLoader::Sprite *sprite, Alloc
|
||||
*dst_n = src->m;
|
||||
if (src->m != 0) {
|
||||
/* Get brightest value */
|
||||
uint8 rgb_max = std::max({src->r, src->g, src->b});
|
||||
uint8 rgb_max = std::max({ src->r, src->g, src->b });
|
||||
|
||||
/* Black pixel (8bpp or old 32bpp image), so use default value */
|
||||
if (rgb_max == 0) rgb_max = DEFAULT_BRIGHTNESS;
|
||||
*dst_n |= rgb_max << 8;
|
||||
|
||||
/* Pre-convert the mapping channel to a RGB value */
|
||||
Colour colour = this->AdjustBrightness(this->LookupColourInPalette(src->m), rgb_max);
|
||||
dst_px->r = colour.r;
|
||||
dst_px->g = colour.g;
|
||||
dst_px->b = colour.b;
|
||||
if (Tpal_to_rgb) {
|
||||
/* Pre-convert the mapping channel to a RGB value */
|
||||
Colour colour = this->AdjustBrightness(this->LookupColourInPalette(src->m), rgb_max);
|
||||
dst_px->r = colour.r;
|
||||
dst_px->g = colour.g;
|
||||
dst_px->b = colour.b;
|
||||
} else {
|
||||
dst_px->r = src->r;
|
||||
dst_px->g = src->g;
|
||||
dst_px->b = src->b;
|
||||
}
|
||||
} else {
|
||||
dst_px->r = src->r;
|
||||
dst_px->g = src->g;
|
||||
@@ -397,3 +423,11 @@ Sprite *Blitter_32bppOptimized::Encode(const SpriteLoader::Sprite *sprite, Alloc
|
||||
|
||||
return dest_sprite;
|
||||
}
|
||||
|
||||
template Sprite *Blitter_32bppOptimized::EncodeInternal<true>(const SpriteLoader::Sprite *sprite, AllocatorProc *allocator);
|
||||
template Sprite *Blitter_32bppOptimized::EncodeInternal<false>(const SpriteLoader::Sprite *sprite, AllocatorProc *allocator);
|
||||
|
||||
Sprite *Blitter_32bppOptimized::Encode(const SpriteLoader::Sprite *sprite, AllocatorProc *allocator)
|
||||
{
|
||||
return this->EncodeInternal<true>(sprite, allocator);
|
||||
}
|
||||
|
||||
@@ -26,7 +26,11 @@ public:
|
||||
|
||||
const char *GetName() override { return "32bpp-optimized"; }
|
||||
|
||||
template <BlitterMode mode> void Draw(const Blitter::BlitterParams *bp, ZoomLevel zoom);
|
||||
template <BlitterMode mode, bool Tpal_to_rgb = false> void Draw(const Blitter::BlitterParams *bp, ZoomLevel zoom);
|
||||
|
||||
protected:
|
||||
template <bool Tpal_to_rgb> void Draw(Blitter::BlitterParams *bp, BlitterMode mode, ZoomLevel zoom);
|
||||
template <bool Tpal_to_rgb> Sprite *EncodeInternal(const SpriteLoader::Sprite *sprite, AllocatorProc *allocator);
|
||||
};
|
||||
|
||||
/** Factory for the optimised 32 bpp blitter (without palette animation). */
|
||||
|
||||
@@ -43,7 +43,7 @@ typedef union ALIGN(16) um128i {
|
||||
|
||||
#define CLEAR_HIGH_BYTE_MASK _mm_setr_epi8(-1, 0, -1, 0, -1, 0, -1, 0, -1, 0, -1, 0, -1, 0, -1, 0)
|
||||
#define ALPHA_CONTROL_MASK _mm_setr_epi8( 6, 7, 6, 7, 6, 7, -1, -1, 14, 15, 14, 15, 14, 15, -1, -1)
|
||||
#define PACK_LOW_CONTROL_MASK _mm_setr_epi8( 0, 2, 4, -1, 8, 10, 12, -1, -1, -1, -1, -1, -1, -1, -1, -1)
|
||||
#define PACK_LOW_CONTROL_MASK _mm_setr_epi8( 0, 2, 4, 6, 8, 10, 12, 14, -1, -1, -1, -1, -1, -1, -1, -1)
|
||||
#define PACK_HIGH_CONTROL_MASK _mm_setr_epi8(-1, -1, -1, -1, -1, -1, -1, -1, 0, 2, 4, -1, 8, 10, 12, -1)
|
||||
#define BRIGHTNESS_LOW_CONTROL_MASK _mm_setr_epi8( 1, 2, 1, 2, 1, 2, 0, 2, 3, 2, 3, 2, 3, 2, 0, 2)
|
||||
#define BRIGHTNESS_DIV_CLEANER _mm_setr_epi8(-1, 1, -1, 1, -1, 1, -1, 0, -1, 1, -1, 1, -1, 1, -1, 0)
|
||||
|
||||
518
src/blitter/40bpp_anim.cpp
Normal file
518
src/blitter/40bpp_anim.cpp
Normal file
@@ -0,0 +1,518 @@
|
||||
/* $Id$ */
|
||||
|
||||
/*
|
||||
* This file is part of OpenTTD.
|
||||
* OpenTTD is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, version 2.
|
||||
* OpenTTD is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
|
||||
* See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with OpenTTD. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
/** @file 40bpp_optimized.cpp Implementation of the optimized 40 bpp blitter. */
|
||||
|
||||
#include "../stdafx.h"
|
||||
#include "../zoom_func.h"
|
||||
#include "../settings_type.h"
|
||||
#include "../video/video_driver.hpp"
|
||||
#include "40bpp_anim.hpp"
|
||||
#include "common.hpp"
|
||||
|
||||
#include "../table/sprites.h"
|
||||
|
||||
#include "../safeguards.h"
|
||||
|
||||
|
||||
/** Instantiation of the 40bpp with animation blitter factory. */
|
||||
static FBlitter_40bppAnim iFBlitter_40bppAnim;
|
||||
|
||||
/** Cached black value. */
|
||||
static const Colour _black_colour(0, 0, 0);
|
||||
|
||||
|
||||
void Blitter_40bppAnim::SetPixel(void *video, int x, int y, uint8 colour)
|
||||
{
|
||||
if (_screen_disable_anim) {
|
||||
Blitter_32bppOptimized::SetPixel(video, x, y, colour);
|
||||
} else {
|
||||
*((Colour *)video + x + y * _screen.pitch) = _black_colour;
|
||||
|
||||
VideoDriver::GetInstance()->GetAnimBuffer()[((uint32 *)video - (uint32 *)_screen.dst_ptr) + x + y * _screen.pitch] = colour;
|
||||
}
|
||||
}
|
||||
|
||||
void Blitter_40bppAnim::DrawRect(void *video, int width, int height, uint8 colour)
|
||||
{
|
||||
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, colour);
|
||||
return;
|
||||
}
|
||||
|
||||
assert(VideoDriver::GetInstance()->GetAnimBuffer() != nullptr);
|
||||
uint8 *anim_line = ((uint32 *)video - (uint32 *)_screen.dst_ptr) + VideoDriver::GetInstance()->GetAnimBuffer();
|
||||
|
||||
do {
|
||||
Colour *dst = (Colour *)video;
|
||||
uint8 *anim = anim_line;
|
||||
|
||||
for (int i = width; i > 0; i--) {
|
||||
*dst = _black_colour;
|
||||
*anim = colour;
|
||||
dst++;
|
||||
anim++;
|
||||
}
|
||||
video = (uint32 *)video + _screen.pitch;
|
||||
anim_line += _screen.pitch;
|
||||
} while (--height);
|
||||
}
|
||||
|
||||
void Blitter_40bppAnim::DrawLine(void *video, int x, int y, int x2, int y2, int screen_width, int screen_height, uint8 colour, int width, int dash)
|
||||
{
|
||||
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::DrawLine(video, x, y, x2, y2, screen_width, screen_height, colour, width, dash);
|
||||
return;
|
||||
}
|
||||
|
||||
assert(VideoDriver::GetInstance()->GetAnimBuffer() != nullptr);
|
||||
uint8 *anim = ((uint32 *)video - (uint32 *)_screen.dst_ptr) + VideoDriver::GetInstance()->GetAnimBuffer();
|
||||
|
||||
this->DrawLineGeneric(x, y, x2, y2, screen_width, screen_height, width, dash, [=](int x, int y) {
|
||||
*((Colour *)video + x + y * _screen.pitch) = _black_colour;
|
||||
*(anim + x + y * _screen.pitch) = colour;
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Draws a sprite to a (screen) buffer. It is templated to allow faster operation.
|
||||
*
|
||||
* @tparam mode blitter mode
|
||||
* @param bp further blitting parameters
|
||||
* @param zoom zoom level at which we are drawing
|
||||
*/
|
||||
template <BlitterMode mode>
|
||||
inline void Blitter_40bppAnim::Draw(const Blitter::BlitterParams *bp, ZoomLevel zoom)
|
||||
{
|
||||
const SpriteData *src = (const SpriteData *)bp->sprite;
|
||||
|
||||
/* src_px : each line begins with uint32 n = 'number of bytes in this line',
|
||||
* then n times is the Colour struct for this line */
|
||||
const Colour *src_px = (const Colour *)(src->data + src->offset[zoom][0]);
|
||||
/* src_n : each line begins with uint32 n = 'number of bytes in this line',
|
||||
* then interleaved stream of 'm' and 'n' channels. 'm' is remap,
|
||||
* 'n' is number of bytes with the same alpha channel class */
|
||||
const uint16 *src_n = (const uint16 *)(src->data + src->offset[zoom][1]);
|
||||
|
||||
/* skip upper lines in src_px and src_n */
|
||||
for (uint i = bp->skip_top; i != 0; i--) {
|
||||
src_px = (const Colour *)((const byte *)src_px + *(const uint32 *)src_px);
|
||||
src_n = (const uint16 *)((const byte *)src_n + *(const uint32 *)src_n);
|
||||
}
|
||||
|
||||
/* skip lines in dst */
|
||||
Colour *dst = (Colour *)bp->dst + bp->top * bp->pitch + bp->left;
|
||||
assert(VideoDriver::GetInstance()->GetAnimBuffer() != nullptr);
|
||||
uint8 *anim = VideoDriver::GetInstance()->GetAnimBuffer() + ((uint32 *)bp->dst - (uint32 *)_screen.dst_ptr) + bp->top * bp->pitch + bp->left;
|
||||
|
||||
/* store so we don't have to access it via bp everytime (compiler assumes pointer aliasing) */
|
||||
const byte *remap = bp->remap;
|
||||
|
||||
for (int y = 0; y < bp->height; y++) {
|
||||
/* next dst line begins here */
|
||||
Colour *dst_ln = dst + bp->pitch;
|
||||
uint8 *anim_ln = anim + bp->pitch;
|
||||
|
||||
/* next src line begins here */
|
||||
const Colour *src_px_ln = (const Colour *)((const byte *)src_px + *(const uint32 *)src_px);
|
||||
src_px++;
|
||||
|
||||
/* next src_n line begins here */
|
||||
const uint16 *src_n_ln = (const uint16 *)((const byte *)src_n + *(const uint32 *)src_n);
|
||||
src_n += 2;
|
||||
|
||||
/* we will end this line when we reach this point */
|
||||
Colour *dst_end = dst + bp->skip_left;
|
||||
|
||||
/* number of pixels with the same alpha channel class */
|
||||
uint n;
|
||||
|
||||
while (dst < dst_end) {
|
||||
n = *src_n++;
|
||||
|
||||
if (src_px->a == 0) {
|
||||
dst += n;
|
||||
src_px++;
|
||||
src_n++;
|
||||
|
||||
if (dst > dst_end) anim += dst - dst_end;
|
||||
} else {
|
||||
if (dst + n > dst_end) {
|
||||
uint d = dst_end - dst;
|
||||
src_px += d;
|
||||
src_n += d;
|
||||
|
||||
dst = dst_end - bp->skip_left;
|
||||
dst_end = dst + bp->width;
|
||||
|
||||
n = std::min<uint>(n - d, (uint)bp->width);
|
||||
goto draw;
|
||||
}
|
||||
dst += n;
|
||||
src_px += n;
|
||||
src_n += n;
|
||||
}
|
||||
}
|
||||
|
||||
dst -= bp->skip_left;
|
||||
dst_end -= bp->skip_left;
|
||||
|
||||
dst_end += bp->width;
|
||||
|
||||
while (dst < dst_end) {
|
||||
n = std::min<uint>(*src_n++, (uint)(dst_end - dst));
|
||||
|
||||
if (src_px->a == 0) {
|
||||
anim += n;
|
||||
dst += n;
|
||||
src_px++;
|
||||
src_n++;
|
||||
continue;
|
||||
}
|
||||
|
||||
draw:;
|
||||
|
||||
switch (mode) {
|
||||
case BM_COLOUR_REMAP:
|
||||
case BM_CRASH_REMAP:
|
||||
if (src_px->a == 255) {
|
||||
do {
|
||||
uint8 m = GB(*src_n, 0, 8);
|
||||
/* In case the m-channel is zero, only apply the crash remap by darkening the RGB colour. */
|
||||
if (m == 0) {
|
||||
*dst = mode == BM_CRASH_REMAP ? this->MakeDark(*src_px) : *src_px;
|
||||
*anim = 0;
|
||||
} else {
|
||||
uint r = remap[m];
|
||||
if (r != 0) {
|
||||
*dst = src_px->data;
|
||||
*anim = r;
|
||||
}
|
||||
}
|
||||
anim++;
|
||||
dst++;
|
||||
src_px++;
|
||||
src_n++;
|
||||
} while (--n != 0);
|
||||
} else {
|
||||
do {
|
||||
uint8 m = GB(*src_n, 0, 8);
|
||||
Colour b = this->RealizeBlendedColour(*anim, *dst);
|
||||
if (m == 0) {
|
||||
Colour c = mode == BM_CRASH_REMAP ? this->MakeDark(*src_px) : *src_px;
|
||||
*dst = this->ComposeColourRGBANoCheck(c.r, c.g, c.b, src_px->a, b);
|
||||
*anim = 0;
|
||||
} else {
|
||||
uint r = remap[m];
|
||||
if (r != 0) {
|
||||
*dst = this->ComposeColourPANoCheck(this->LookupColourInPalette(r), src_px->a, b);
|
||||
*anim = 0; // Animation colours don't work with alpha-blending.
|
||||
}
|
||||
}
|
||||
anim++;
|
||||
dst++;
|
||||
src_px++;
|
||||
src_n++;
|
||||
} while (--n != 0);
|
||||
}
|
||||
break;
|
||||
|
||||
case BM_BLACK_REMAP:
|
||||
do {
|
||||
*anim++ = 0;
|
||||
*dst++ = _black_colour;
|
||||
src_px++;
|
||||
src_n++;
|
||||
} while (--n != 0);
|
||||
break;
|
||||
|
||||
case BM_TRANSPARENT:
|
||||
/* TODO -- We make an assumption here that the remap in fact is transparency, not some colour.
|
||||
* This is never a problem with the code we produce, but newgrfs can make it fail... or at least:
|
||||
* we produce a result the newgrf maker didn't expect ;) */
|
||||
|
||||
/* Make the current colour a bit more black, so it looks like this image is transparent */
|
||||
src_n += n;
|
||||
if (src_px->a == 255) {
|
||||
src_px += n;
|
||||
do {
|
||||
/* If the anim buffer contains a color value, the image composition will
|
||||
* only look at the RGB brightness value. As such, we can simply darken the
|
||||
* RGB value to darken the anim color. */
|
||||
Colour b = *anim != 0 ? Colour(this->GetColourBrightness(*dst), 0, 0) : *dst;
|
||||
*dst = this->MakeTransparent(b, 3, 4);
|
||||
anim++;
|
||||
dst++;
|
||||
} while (--n != 0);
|
||||
} else {
|
||||
do {
|
||||
Colour b = this->RealizeBlendedColour(*anim, *dst);
|
||||
*dst = this->MakeTransparent(b, (256 * 4 - src_px->a), 256 * 4);
|
||||
*anim = 0; // Animation colours don't work with alpha-blending.
|
||||
anim++;
|
||||
dst++;
|
||||
src_px++;
|
||||
} while (--n != 0);
|
||||
}
|
||||
break;
|
||||
|
||||
default:
|
||||
if (src_px->a == 255) {
|
||||
do {
|
||||
*anim++ = GB(*src_n, 0, 8);
|
||||
*dst++ = src_px->data;
|
||||
src_px++;
|
||||
src_n++;
|
||||
} while (--n != 0);
|
||||
break;
|
||||
} else {
|
||||
do {
|
||||
uint8 m = GB(*src_n, 0, 8);
|
||||
Colour b = this->RealizeBlendedColour(*anim, *dst);
|
||||
|
||||
if (m == 0) {
|
||||
*dst = this->ComposeColourRGBANoCheck(src_px->r, src_px->g, src_px->b, src_px->a, b);
|
||||
*anim = 0;
|
||||
} else {
|
||||
*dst = this->ComposeColourPANoCheck(this->LookupColourInPalette(m), src_px->a, b);
|
||||
*anim = m;
|
||||
}
|
||||
|
||||
anim++;
|
||||
dst++;
|
||||
src_px++;
|
||||
src_n++;
|
||||
} while (--n != 0);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
dst = dst_ln;
|
||||
anim = anim_ln;
|
||||
src_px = src_px_ln;
|
||||
src_n = src_n_ln;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Draws a sprite to a (screen) buffer. Calls adequate templated function.
|
||||
*
|
||||
* @param bp further blitting parameters
|
||||
* @param mode blitter mode
|
||||
* @param zoom zoom level at which we are drawing
|
||||
*/
|
||||
void Blitter_40bppAnim::Draw(Blitter::BlitterParams *bp, BlitterMode mode, ZoomLevel zoom)
|
||||
{
|
||||
assert(_screen.dst_ptr != nullptr);
|
||||
|
||||
if (_screen_disable_anim || VideoDriver::GetInstance()->GetAnimBuffer() == nullptr) {
|
||||
/* 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<true>(bp, mode, zoom);
|
||||
return;
|
||||
}
|
||||
|
||||
switch (mode) {
|
||||
default: NOT_REACHED();
|
||||
case BM_NORMAL: Draw<BM_NORMAL> (bp, zoom); return;
|
||||
case BM_COLOUR_REMAP: Draw<BM_COLOUR_REMAP>(bp, zoom); return;
|
||||
case BM_TRANSPARENT: Draw<BM_TRANSPARENT> (bp, zoom); return;
|
||||
case BM_CRASH_REMAP: Draw<BM_CRASH_REMAP> (bp, zoom); return;
|
||||
case BM_BLACK_REMAP: Draw<BM_BLACK_REMAP> (bp, zoom); return;
|
||||
}
|
||||
}
|
||||
|
||||
void Blitter_40bppAnim::DrawColourMappingRect(void *dst, int width, int height, PaletteID 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 DrawColourMappingRect() */
|
||||
Blitter_32bppOptimized::DrawColourMappingRect(dst, width, height, pal);
|
||||
return;
|
||||
}
|
||||
|
||||
Colour *udst = (Colour *)dst;
|
||||
uint8 *anim = VideoDriver::GetInstance()->GetAnimBuffer() + ((uint32 *)dst - (uint32 *)_screen.dst_ptr);
|
||||
|
||||
if (pal == PALETTE_TO_TRANSPARENT) {
|
||||
/* If the anim buffer contains a color value, the image composition will
|
||||
* only look at the RGB brightness value. As such, we can simply darken the
|
||||
* RGB value to darken the anim color. */
|
||||
do {
|
||||
for (int i = 0; i != width; i++) {
|
||||
Colour b = *anim != 0 ? Colour(this->GetColourBrightness(*udst), 0, 0) : *udst;
|
||||
*udst = MakeTransparent(b, 154);
|
||||
udst++;
|
||||
anim++;
|
||||
}
|
||||
udst = udst - width + _screen.pitch;
|
||||
anim = anim - width + _screen.pitch;
|
||||
} while (--height);
|
||||
} else if (pal == PALETTE_NEWSPAPER) {
|
||||
const uint8 *remap = GetNonSprite(pal, ST_RECOLOUR) + 1;
|
||||
do {
|
||||
for (int i = 0; i != width; i++) {
|
||||
if (*anim == 0) *udst = MakeGrey(*udst);
|
||||
*anim = remap[*anim];
|
||||
udst++;
|
||||
anim++;
|
||||
}
|
||||
udst = udst - width + _screen.pitch;
|
||||
anim = anim - width + _screen.pitch;
|
||||
} while (--height);
|
||||
} else {
|
||||
const uint8 *remap = GetNonSprite(pal, ST_RECOLOUR) + 1;
|
||||
do {
|
||||
for (int i = 0; i != width; i++) {
|
||||
*anim = remap[*anim];
|
||||
anim++;
|
||||
}
|
||||
anim = anim - width + _screen.pitch;
|
||||
} while (--height);
|
||||
}
|
||||
}
|
||||
|
||||
Sprite *Blitter_40bppAnim::Encode(const SpriteLoader::Sprite *sprite, AllocatorProc *allocator)
|
||||
{
|
||||
return this->EncodeInternal<false>(sprite, allocator);
|
||||
}
|
||||
|
||||
|
||||
void Blitter_40bppAnim::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;
|
||||
const uint32 *usrc = (const uint32 *)src;
|
||||
|
||||
uint8 *anim_buf = VideoDriver::GetInstance()->GetAnimBuffer();
|
||||
if (anim_buf == nullptr) return;
|
||||
uint8 *anim_line = ((uint32 *)video - (uint32 *)_screen.dst_ptr) + anim_buf;
|
||||
|
||||
for (; height > 0; height--) {
|
||||
memcpy(dst, usrc, width * sizeof(uint32));
|
||||
usrc += width;
|
||||
dst += _screen.pitch;
|
||||
/* Copy back the anim-buffer */
|
||||
memcpy(anim_line, usrc, width * sizeof(uint8));
|
||||
usrc = (const uint32 *)((const uint8 *)usrc + width);
|
||||
anim_line += _screen.pitch;
|
||||
}
|
||||
}
|
||||
|
||||
void Blitter_40bppAnim::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;
|
||||
const uint32 *src = (const uint32 *)video;
|
||||
|
||||
uint8 *anim_buf = VideoDriver::GetInstance()->GetAnimBuffer();
|
||||
if (anim_buf == nullptr) return;
|
||||
const uint8 *anim_line = ((const uint32 *)video - (uint32 *)_screen.dst_ptr) + anim_buf;
|
||||
|
||||
for (; height > 0; height--) {
|
||||
memcpy(udst, src, width * sizeof(uint32));
|
||||
src += _screen.pitch;
|
||||
udst += width;
|
||||
/* Copy the anim-buffer */
|
||||
memcpy(udst, anim_line, width * sizeof(uint8));
|
||||
udst = (uint32 *)((uint8 *)udst + width);
|
||||
anim_line += _screen.pitch;
|
||||
}
|
||||
}
|
||||
|
||||
void Blitter_40bppAnim::CopyImageToBuffer(const void *video, void *dst, int width, int height, int dst_pitch)
|
||||
{
|
||||
uint8 *anim_buf = VideoDriver::GetInstance()->GetAnimBuffer();
|
||||
if (anim_buf == nullptr) {
|
||||
Blitter_32bppOptimized::CopyImageToBuffer(video, dst, width, height, dst_pitch);
|
||||
return;
|
||||
}
|
||||
|
||||
uint32 *udst = (uint32 *)dst;
|
||||
const uint32 *src = (const uint32 *)video;
|
||||
const uint8 *anim_line = ((const uint32 *)video - (uint32 *)_screen.dst_ptr) + anim_buf;
|
||||
|
||||
for (; height > 0; height--) {
|
||||
for (int x = 0; x < width; x++) {
|
||||
udst[x] = this->RealizeBlendedColour(anim_line[x], src[x]).data;
|
||||
}
|
||||
src += _screen.pitch;
|
||||
anim_line += _screen.pitch;
|
||||
udst += dst_pitch;
|
||||
}
|
||||
}
|
||||
|
||||
void Blitter_40bppAnim::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 *anim_buf = VideoDriver::GetInstance()->GetAnimBuffer();
|
||||
uint8 *dst, *src;
|
||||
|
||||
/* We need to scroll the anim-buffer too */
|
||||
if (scroll_y > 0) {
|
||||
dst = anim_buf + left + (top + height - 1) * _screen.pitch;
|
||||
src = dst - scroll_y * _screen.pitch;
|
||||
|
||||
/* Adjust left & width */
|
||||
if (scroll_x >= 0) {
|
||||
dst += scroll_x;
|
||||
} else {
|
||||
src -= scroll_x;
|
||||
}
|
||||
|
||||
uint tw = width + (scroll_x >= 0 ? -scroll_x : scroll_x);
|
||||
uint th = height - scroll_y;
|
||||
for (; th > 0; th--) {
|
||||
memcpy(dst, src, tw * sizeof(uint8));
|
||||
src -= _screen.pitch;
|
||||
dst -= _screen.pitch;
|
||||
}
|
||||
} else {
|
||||
/* Calculate pointers */
|
||||
dst = anim_buf + left + top * _screen.pitch;
|
||||
src = dst - scroll_y * _screen.pitch;
|
||||
|
||||
/* Adjust left & width */
|
||||
if (scroll_x >= 0) {
|
||||
dst += scroll_x;
|
||||
} else {
|
||||
src -= scroll_x;
|
||||
}
|
||||
|
||||
/* the y-displacement may be 0 therefore we have to use memmove,
|
||||
* because source and destination may overlap */
|
||||
uint tw = width + (scroll_x >= 0 ? -scroll_x : scroll_x);
|
||||
uint th = height + scroll_y;
|
||||
for (; th > 0; th--) {
|
||||
memmove(dst, src, tw * sizeof(uint8));
|
||||
src += _screen.pitch;
|
||||
dst += _screen.pitch;
|
||||
}
|
||||
}
|
||||
|
||||
Blitter_32bppBase::ScrollBuffer(video, left, top, width, height, scroll_x, scroll_y);
|
||||
}
|
||||
|
||||
int Blitter_40bppAnim::BufferSize(int width, int height)
|
||||
{
|
||||
return width * height * (sizeof(uint32) + sizeof(uint8));
|
||||
}
|
||||
|
||||
Blitter::PaletteAnimation Blitter_40bppAnim::UsePaletteAnimation()
|
||||
{
|
||||
return Blitter::PALETTE_ANIMATION_VIDEO_BACKEND;
|
||||
}
|
||||
|
||||
bool Blitter_40bppAnim::NeedsAnimationBuffer()
|
||||
{
|
||||
return true;
|
||||
}
|
||||
64
src/blitter/40bpp_anim.hpp
Normal file
64
src/blitter/40bpp_anim.hpp
Normal file
@@ -0,0 +1,64 @@
|
||||
/* $Id$ */
|
||||
|
||||
/*
|
||||
* This file is part of OpenTTD.
|
||||
* OpenTTD is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, version 2.
|
||||
* OpenTTD is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
|
||||
* See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with OpenTTD. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
/** @file 40bpp_optimized.hpp Optimized 40 bpp blitter. */
|
||||
|
||||
#ifndef BLITTER_40BPP_OPTIMIZED_HPP
|
||||
#define BLITTER_40BPP_OPTIMIZED_HPP
|
||||
|
||||
|
||||
#include "32bpp_optimized.hpp"
|
||||
#include "../video/video_driver.hpp"
|
||||
|
||||
/** The optimized 40 bpp blitter (for OpenGL video driver). */
|
||||
class Blitter_40bppAnim : public Blitter_32bppOptimized {
|
||||
public:
|
||||
|
||||
// void *MoveTo(void *video, int x, int y) override;
|
||||
void SetPixel(void *video, int x, int y, uint8 colour) override;
|
||||
void DrawRect(void *video, int width, int height, uint8 colour) override;
|
||||
void DrawLine(void *video, int x, int y, int x2, int y2, int screen_width, int screen_height, uint8 colour, int width, int dash) override;
|
||||
void CopyFromBuffer(void *video, const void *src, int width, int height) override;
|
||||
void CopyToBuffer(const void *video, void *dst, int width, int height) override;
|
||||
void CopyImageToBuffer(const void *video, void *dst, int width, int height, int dst_pitch) override;
|
||||
void ScrollBuffer(void *video, int &left, int &top, int &width, int &height, int scroll_x, int scroll_y) override;
|
||||
void Draw(Blitter::BlitterParams *bp, BlitterMode mode, ZoomLevel zoom) override;
|
||||
void DrawColourMappingRect(void *dst, int width, int height, PaletteID pal) override;
|
||||
Sprite *Encode(const SpriteLoader::Sprite *sprite, AllocatorProc *allocator) override;
|
||||
int BufferSize(int width, int height) override;
|
||||
Blitter::PaletteAnimation UsePaletteAnimation() override;
|
||||
bool NeedsAnimationBuffer() override;
|
||||
|
||||
const char *GetName() override { return "40bpp-anim"; }
|
||||
int GetBytesPerPixel() override { return 5; }
|
||||
|
||||
template <BlitterMode mode> void Draw(const Blitter::BlitterParams *bp, ZoomLevel zoom);
|
||||
|
||||
protected:
|
||||
static inline Colour RealizeBlendedColour(uint8 anim, Colour c)
|
||||
{
|
||||
return anim != 0 ? AdjustBrightness(LookupColourInPalette(anim), GetColourBrightness(c)) : c;
|
||||
}
|
||||
|
||||
};
|
||||
|
||||
/** Factory for the 40 bpp animated blitter (for OpenGL). */
|
||||
class FBlitter_40bppAnim : public BlitterFactory {
|
||||
protected:
|
||||
bool IsUsable() const override
|
||||
{
|
||||
return VideoDriver::GetInstance() == nullptr || VideoDriver::GetInstance()->HasAnimBuffer();
|
||||
}
|
||||
|
||||
public:
|
||||
FBlitter_40bppAnim() : BlitterFactory("40bpp-anim", "40bpp Animation Blitter (OpenGL)") {}
|
||||
Blitter *CreateInstance() override { return new Blitter_40bppAnim(); }
|
||||
};
|
||||
|
||||
#endif /* BLITTER_40BPP_OPTIMIZED_HPP */
|
||||
@@ -32,6 +32,13 @@ add_files(
|
||||
CONDITION NOT OPTION_DEDICATED AND SSE_FOUND
|
||||
)
|
||||
|
||||
add_files(
|
||||
40bpp_anim.cpp
|
||||
40bpp_anim.hpp
|
||||
CONDITION NOT OPTION_DEDICATED AND OPENGL_FOUND
|
||||
)
|
||||
|
||||
|
||||
if(CMAKE_CXX_COMPILER_ID STREQUAL "GNU" OR CMAKE_CXX_COMPILER_ID STREQUAL "Clang" OR CMAKE_CXX_COMPILER_ID STREQUAL "AppleClang")
|
||||
set_compile_flags(
|
||||
32bpp_anim_sse2.cpp
|
||||
|
||||
@@ -25,7 +25,7 @@ enum BlitterMode {
|
||||
/**
|
||||
* How all blitters should look like. Extend this class to make your own.
|
||||
*/
|
||||
class Blitter {
|
||||
class Blitter : public SpriteEncoder {
|
||||
public:
|
||||
/** Parameters related to blitting. */
|
||||
struct BlitterParams {
|
||||
@@ -58,6 +58,11 @@ public:
|
||||
*/
|
||||
virtual uint8 GetScreenDepth() = 0;
|
||||
|
||||
bool Is32BppSupported() override
|
||||
{
|
||||
return this->GetScreenDepth() > 8;
|
||||
}
|
||||
|
||||
/**
|
||||
* Draw an image to the screen, given an amount of params defined above.
|
||||
*/
|
||||
@@ -74,11 +79,6 @@ public:
|
||||
*/
|
||||
virtual void DrawColourMappingRect(void *dst, int width, int height, PaletteID pal) = 0;
|
||||
|
||||
/**
|
||||
* Convert a sprite from the loader to our own format.
|
||||
*/
|
||||
virtual Sprite *Encode(const SpriteLoader::Sprite *sprite, AllocatorProc *allocator) = 0;
|
||||
|
||||
/**
|
||||
* Move the destination pointer the requested amount x and y, keeping in mind
|
||||
* any pitch and bpp of the renderer.
|
||||
@@ -185,6 +185,14 @@ public:
|
||||
*/
|
||||
virtual Blitter::PaletteAnimation UsePaletteAnimation() = 0;
|
||||
|
||||
/**
|
||||
* Does this blitter require a separate animation buffer from the video backend?
|
||||
*/
|
||||
virtual bool NeedsAnimationBuffer()
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the name of the blitter, the same as the Factory-instance returns.
|
||||
*/
|
||||
|
||||
@@ -61,18 +61,28 @@ protected:
|
||||
name(name), description(description)
|
||||
{
|
||||
if (usable) {
|
||||
Blitters &blitters = GetBlitters();
|
||||
assert(blitters.find(this->name) == blitters.end());
|
||||
/*
|
||||
* Only add when the blitter is usable. Do not bail out or
|
||||
* do more special things since the blitters are always
|
||||
* instantiated upon start anyhow and freed upon shutdown.
|
||||
*/
|
||||
std::pair<Blitters::iterator, bool> P = GetBlitters().insert(Blitters::value_type(this->name, this));
|
||||
assert(P.second);
|
||||
blitters.insert(Blitters::value_type(this->name, this));
|
||||
} else {
|
||||
DEBUG(driver, 1, "Not registering blitter %s as it is not usable", name);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Is the blitter usable with the current drivers and hardware config?
|
||||
* @return True if the blitter can be instantiated.
|
||||
*/
|
||||
virtual bool IsUsable() const
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
public:
|
||||
virtual ~BlitterFactory()
|
||||
{
|
||||
@@ -119,7 +129,7 @@ public:
|
||||
for (; it != GetBlitters().end(); it++) {
|
||||
BlitterFactory *b = (*it).second;
|
||||
if (strcasecmp(bname, b->name.c_str()) == 0) {
|
||||
return b;
|
||||
return b->IsUsable() ? b : nullptr;
|
||||
}
|
||||
}
|
||||
return nullptr;
|
||||
|
||||
@@ -11,9 +11,10 @@
|
||||
#include "base_media_base.h"
|
||||
#include "blitter/factory.hpp"
|
||||
|
||||
#if defined(WITH_FREETYPE) || defined(WITH_UNISCRIBE)
|
||||
#if defined(WITH_FREETYPE) || defined(WITH_UNISCRIBE) || defined(WITH_COCOA)
|
||||
|
||||
#include "core/geometry_func.hpp"
|
||||
#include "error.h"
|
||||
#include "fontcache.h"
|
||||
#include "gfx_func.h"
|
||||
#include "network/network.h"
|
||||
@@ -61,8 +62,65 @@ public:
|
||||
}
|
||||
};
|
||||
|
||||
/** Nested widgets for the error window. */
|
||||
static const NWidgetPart _nested_bootstrap_errmsg_widgets[] = {
|
||||
NWidget(NWID_HORIZONTAL),
|
||||
NWidget(WWT_CAPTION, COLOUR_GREY, WID_BEM_CAPTION), SetDataTip(STR_MISSING_GRAPHICS_ERROR_TITLE, STR_NULL),
|
||||
EndContainer(),
|
||||
NWidget(WWT_PANEL, COLOUR_GREY),
|
||||
NWidget(WWT_PANEL, COLOUR_GREY, WID_BEM_MESSAGE), EndContainer(),
|
||||
NWidget(NWID_HORIZONTAL),
|
||||
NWidget(WWT_PUSHTXTBTN, COLOUR_GREY, WID_BEM_QUIT), SetDataTip(STR_MISSING_GRAPHICS_ERROR_QUIT, STR_NULL), SetFill(1, 0),
|
||||
EndContainer(),
|
||||
EndContainer(),
|
||||
};
|
||||
|
||||
/** Window description for the error window. */
|
||||
static WindowDesc _bootstrap_errmsg_desc(
|
||||
WDP_CENTER, nullptr, 0, 0,
|
||||
WC_BOOTSTRAP, WC_NONE,
|
||||
WDF_MODAL,
|
||||
_nested_bootstrap_errmsg_widgets, lengthof(_nested_bootstrap_errmsg_widgets)
|
||||
);
|
||||
|
||||
/** The window for a failed bootstrap. */
|
||||
class BootstrapErrorWindow : public Window {
|
||||
public:
|
||||
BootstrapErrorWindow() : Window(&_bootstrap_errmsg_desc)
|
||||
{
|
||||
this->InitNested(1);
|
||||
}
|
||||
|
||||
~BootstrapErrorWindow()
|
||||
{
|
||||
_exit_game = true;
|
||||
}
|
||||
|
||||
void UpdateWidgetSize(int widget, Dimension *size, const Dimension &padding, Dimension *fill, Dimension *resize) override
|
||||
{
|
||||
if (widget == WID_BEM_MESSAGE) {
|
||||
*size = GetStringBoundingBox(STR_MISSING_GRAPHICS_ERROR);
|
||||
size->height = GetStringHeight(STR_MISSING_GRAPHICS_ERROR, size->width - WD_FRAMETEXT_LEFT - WD_FRAMETEXT_RIGHT) + WD_FRAMETEXT_BOTTOM + WD_FRAMETEXT_TOP;
|
||||
}
|
||||
}
|
||||
|
||||
void DrawWidget(const Rect &r, int widget) const override
|
||||
{
|
||||
if (widget == WID_BEM_MESSAGE) {
|
||||
DrawStringMultiLine(r.left + WD_FRAMETEXT_LEFT, r.right - WD_FRAMETEXT_RIGHT, r.top + WD_FRAMETEXT_TOP, r.bottom - WD_FRAMETEXT_BOTTOM, STR_MISSING_GRAPHICS_ERROR, TC_FROMSTRING, SA_CENTER);
|
||||
}
|
||||
}
|
||||
|
||||
void OnClick(Point pt, int widget, int click_count) override
|
||||
{
|
||||
if (widget == WID_BEM_QUIT) {
|
||||
_exit_game = true;
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
/** Nested widgets for the download window. */
|
||||
static const NWidgetPart _nested_boostrap_download_status_window_widgets[] = {
|
||||
static const NWidgetPart _nested_bootstrap_download_status_window_widgets[] = {
|
||||
NWidget(WWT_CAPTION, COLOUR_GREY), SetDataTip(STR_CONTENT_DOWNLOAD_TITLE, STR_TOOLTIP_WINDOW_TITLE_DRAG_THIS),
|
||||
NWidget(WWT_PANEL, COLOUR_GREY, WID_NCDS_BACKGROUND),
|
||||
NWidget(NWID_SPACER), SetMinimalSize(350, 0), SetMinimalTextLines(3, WD_FRAMERECT_TOP + WD_FRAMERECT_BOTTOM + 30),
|
||||
@@ -74,7 +132,7 @@ static WindowDesc _bootstrap_download_status_window_desc(
|
||||
WDP_CENTER, nullptr, 0, 0,
|
||||
WC_NETWORK_STATUS_WINDOW, WC_NONE,
|
||||
WDF_MODAL,
|
||||
_nested_boostrap_download_status_window_widgets, lengthof(_nested_boostrap_download_status_window_widgets)
|
||||
_nested_bootstrap_download_status_window_widgets, lengthof(_nested_bootstrap_download_status_window_widgets)
|
||||
);
|
||||
|
||||
|
||||
@@ -86,6 +144,14 @@ public:
|
||||
{
|
||||
}
|
||||
|
||||
~BootstrapContentDownloadStatusWindow()
|
||||
{
|
||||
/* If we are not set to exit the game, it means the bootstrap failed. */
|
||||
if (!_exit_game) {
|
||||
new BootstrapErrorWindow();
|
||||
}
|
||||
}
|
||||
|
||||
void OnDownloadComplete(ContentID cid) override
|
||||
{
|
||||
/* We have completed downloading. We can trigger finding the right set now. */
|
||||
@@ -218,7 +284,7 @@ bool HandleBootstrap()
|
||||
if (BlitterFactory::GetCurrentBlitter()->GetScreenDepth() == 0) goto failure;
|
||||
|
||||
/* If there is no network or no freetype, then there is nothing we can do. Go straight to failure. */
|
||||
#if (defined(_WIN32) && defined(WITH_UNISCRIBE)) || (defined(WITH_FREETYPE) && (defined(WITH_FONTCONFIG) || defined(__APPLE__)))
|
||||
#if (defined(_WIN32) && defined(WITH_UNISCRIBE)) || (defined(WITH_FREETYPE) && (defined(WITH_FONTCONFIG) || defined(__APPLE__))) || defined(WITH_COCOA)
|
||||
if (!_network_available) goto failure;
|
||||
|
||||
/* First tell the game we're bootstrapping. */
|
||||
|
||||
@@ -61,7 +61,7 @@ typedef GUIList<BuildBridgeData> GUIBridgeList; ///< List of bridges, used in #B
|
||||
void CcBuildBridge(const CommandCost &result, TileIndex end_tile, uint32 p1, uint32 p2, uint32 cmd)
|
||||
{
|
||||
if (result.Failed()) return;
|
||||
if (_settings_client.sound.confirm) SndPlayTileFx(SND_27_BLACKSMITH_ANVIL, end_tile);
|
||||
if (_settings_client.sound.confirm) SndPlayTileFx(SND_27_CONSTRUCTION_BRIDGE, end_tile);
|
||||
|
||||
TransportType transport_type = Extract<TransportType, 15, 2>(p2);
|
||||
|
||||
|
||||
@@ -86,8 +86,9 @@ static const NWidgetPart _nested_build_vehicle_widgets[] = {
|
||||
};
|
||||
|
||||
/** Special cargo filter criteria */
|
||||
static const CargoID CF_ANY = CT_NO_REFIT; ///< Show all vehicles independent of carried cargo (i.e. no filtering)
|
||||
static const CargoID CF_NONE = CT_INVALID; ///< Show only vehicles which do not carry cargo (e.g. train engines)
|
||||
static const CargoID CF_ANY = CT_NO_REFIT; ///< Show all vehicles independent of carried cargo (i.e. no filtering)
|
||||
static const CargoID CF_NONE = CT_INVALID; ///< Show only vehicles which do not carry cargo (e.g. train engines)
|
||||
static const CargoID CF_ENGINES = CT_AUTO_REFIT; ///< Show only engines (for rail vehicles only)
|
||||
|
||||
bool _engine_sort_direction; ///< \c false = descending, \c true = ascending.
|
||||
byte _engine_sort_last_criteria[] = {0, 0, 0, 0}; ///< Last set sort criteria, for each vehicle type.
|
||||
@@ -531,16 +532,21 @@ const StringID _engine_sort_listing[][12] = {{
|
||||
INVALID_STRING_ID
|
||||
}};
|
||||
|
||||
/** Cargo filter functions */
|
||||
static bool CDECL CargoFilter(const EngineID *eid, const CargoID cid)
|
||||
/** Filters vehicles by cargo and engine (in case of rail vehicle). */
|
||||
static bool CDECL CargoAndEngineFilter(const EngineID *eid, const CargoID cid)
|
||||
{
|
||||
if (cid == CF_ANY) return true;
|
||||
CargoTypes refit_mask = GetUnionOfArticulatedRefitMasks(*eid, true) & _standard_cargo_mask;
|
||||
return (cid == CF_NONE ? refit_mask == 0 : HasBit(refit_mask, cid));
|
||||
if (cid == CF_ANY) {
|
||||
return true;
|
||||
} else if (cid == CF_ENGINES) {
|
||||
return Engine::Get(*eid)->GetPower() != 0;
|
||||
} else {
|
||||
CargoTypes refit_mask = GetUnionOfArticulatedRefitMasks(*eid, true) & _standard_cargo_mask;
|
||||
return (cid == CF_NONE ? refit_mask == 0 : HasBit(refit_mask, cid));
|
||||
}
|
||||
}
|
||||
|
||||
static GUIEngineList::FilterFunction * const _filter_funcs[] = {
|
||||
&CargoFilter,
|
||||
&CargoAndEngineFilter,
|
||||
};
|
||||
|
||||
static int DrawCargoCapacityInfo(int left, int right, int y, EngineID engine, TestedEngineDetails &te)
|
||||
@@ -1046,10 +1052,10 @@ struct BuildVehicleWindow : Window {
|
||||
EngineID sel_engine; ///< Currently selected engine, or #INVALID_ENGINE
|
||||
EngineID rename_engine; ///< Engine being renamed.
|
||||
GUIEngineList eng_list;
|
||||
CargoID cargo_filter[NUM_CARGO + 2]; ///< Available cargo filters; CargoID or CF_ANY or CF_NONE
|
||||
StringID cargo_filter_texts[NUM_CARGO + 3]; ///< Texts for filter_cargo, terminated by INVALID_STRING_ID
|
||||
CargoID cargo_filter[NUM_CARGO + 3]; ///< Available cargo filters; CargoID or CF_ANY or CF_NONE or CF_ENGINES
|
||||
StringID cargo_filter_texts[NUM_CARGO + 4]; ///< Texts for filter_cargo, terminated by INVALID_STRING_ID
|
||||
byte cargo_filter_criteria; ///< Selected cargo filter
|
||||
int details_height; ///< Minimal needed height of the details panels (found so far).
|
||||
int details_height; ///< Minimal needed height of the details panels, in text lines (found so far).
|
||||
Scrollbar *vscroll;
|
||||
TestedEngineDetails te; ///< Tested cost and capacity after refit.
|
||||
|
||||
@@ -1109,7 +1115,7 @@ struct BuildVehicleWindow : Window {
|
||||
widget->tool_tip = STR_SHOW_HIDDEN_ENGINES_VEHICLE_TRAIN_TOOLTIP + type;
|
||||
widget->SetLowered(this->show_hidden_engines);
|
||||
|
||||
this->details_height = ((this->vehicle_type == VEH_TRAIN) ? 10 : 9) * FONT_HEIGHT_NORMAL + WD_FRAMERECT_TOP + WD_FRAMERECT_BOTTOM;
|
||||
this->details_height = ((this->vehicle_type == VEH_TRAIN) ? 10 : 9);
|
||||
|
||||
this->FinishInitNested(tile == INVALID_TILE ? (int)type : tile);
|
||||
|
||||
@@ -1165,9 +1171,15 @@ struct BuildVehicleWindow : Window {
|
||||
this->cargo_filter_texts[filter_items] = STR_PURCHASE_INFO_ALL_TYPES;
|
||||
filter_items++;
|
||||
|
||||
/* Add item for vehicles not carrying anything, e.g. train engines.
|
||||
* This could also be useful for eyecandy vehicles of other types, but is likely too confusing for joe, */
|
||||
/* Specific filters for trains. */
|
||||
if (this->vehicle_type == VEH_TRAIN) {
|
||||
/* Add item for locomotives only in case of trains. */
|
||||
this->cargo_filter[filter_items] = CF_ENGINES;
|
||||
this->cargo_filter_texts[filter_items] = STR_PURCHASE_INFO_ENGINES_ONLY;
|
||||
filter_items++;
|
||||
|
||||
/* Add item for vehicles not carrying anything, e.g. train engines.
|
||||
* This could also be useful for eyecandy vehicles of other types, but is likely too confusing for joe, */
|
||||
this->cargo_filter[filter_items] = CF_NONE;
|
||||
this->cargo_filter_texts[filter_items] = STR_PURCHASE_INFO_NONE;
|
||||
filter_items++;
|
||||
@@ -1254,7 +1266,7 @@ struct BuildVehicleWindow : Window {
|
||||
bool FilterSingleEngine(EngineID eid)
|
||||
{
|
||||
CargoID filter_type = this->cargo_filter[this->cargo_filter_criteria];
|
||||
return (filter_type == CF_ANY || CargoFilter(&eid, filter_type));
|
||||
return CargoAndEngineFilter(&eid, filter_type);
|
||||
}
|
||||
|
||||
/* Figure out what train EngineIDs to put in the list */
|
||||
@@ -1460,7 +1472,7 @@ struct BuildVehicleWindow : Window {
|
||||
if (sel_eng != INVALID_ENGINE) {
|
||||
CommandCallback *callback = (this->vehicle_type == VEH_TRAIN && RailVehInfo(sel_eng)->railveh_type == RAILVEH_WAGON) ? CcBuildWagon : CcBuildPrimaryVehicle;
|
||||
CargoID cargo = this->cargo_filter[this->cargo_filter_criteria];
|
||||
if (cargo == CF_ANY) cargo = CF_NONE;
|
||||
if (cargo == CF_ANY || cargo == CF_ENGINES) cargo = CF_NONE;
|
||||
DoCommandP(this->window_number, sel_eng | (cargo << 24), 0, GetCmdBuildVeh(this->vehicle_type), callback);
|
||||
}
|
||||
break;
|
||||
@@ -1541,7 +1553,7 @@ struct BuildVehicleWindow : Window {
|
||||
break;
|
||||
|
||||
case WID_BV_PANEL:
|
||||
size->height = this->details_height;
|
||||
size->height = FONT_HEIGHT_NORMAL * this->details_height + padding.height;
|
||||
break;
|
||||
|
||||
case WID_BV_SORT_ASCENDING_DESCENDING: {
|
||||
@@ -1608,12 +1620,12 @@ struct BuildVehicleWindow : Window {
|
||||
NWidgetBase *nwi = this->GetWidget<NWidgetBase>(WID_BV_PANEL);
|
||||
int text_end = DrawVehiclePurchaseInfo(nwi->pos_x + WD_FRAMETEXT_LEFT, nwi->pos_x + nwi->current_x - WD_FRAMETEXT_RIGHT,
|
||||
nwi->pos_y + WD_FRAMERECT_TOP, this->sel_engine, this->te);
|
||||
needed_height = std::max(needed_height, text_end - (int)nwi->pos_y + WD_FRAMERECT_BOTTOM);
|
||||
needed_height = std::max(needed_height, (text_end - (int)nwi->pos_y - WD_FRAMERECT_TOP) / FONT_HEIGHT_NORMAL);
|
||||
}
|
||||
if (needed_height != this->details_height) { // Details window are not high enough, enlarge them.
|
||||
int resize = needed_height - this->details_height;
|
||||
this->details_height = needed_height;
|
||||
this->ReInit(0, resize);
|
||||
this->ReInit(0, resize * FONT_HEIGHT_NORMAL);
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -59,7 +59,7 @@ struct CargoSpec {
|
||||
uint8 rating_colour;
|
||||
uint8 weight; ///< Weight of a single unit of this cargo type in 1/16 ton (62.5 kg).
|
||||
uint16 multiplier; ///< Capacity multiplier for vehicles. (8 fractional bits)
|
||||
uint16 initial_payment;
|
||||
uint32 initial_payment; ///< Initial payment rate before inflation is applied.
|
||||
uint8 transit_days[2];
|
||||
|
||||
bool is_freight; ///< Cargo type is considered to be freight (affects train freight multiplier).
|
||||
|
||||
@@ -125,7 +125,7 @@ static int32 ClickChangeDateCheat(int32 p1, int32 p2)
|
||||
*/
|
||||
static int32 ClickChangeMaxHlCheat(int32 p1, int32 p2)
|
||||
{
|
||||
p1 = Clamp(p1, MIN_MAX_HEIGHTLEVEL, MAX_MAX_HEIGHTLEVEL);
|
||||
p1 = Clamp(p1, MIN_MAP_HEIGHT_LIMIT, MAX_MAP_HEIGHT_LIMIT);
|
||||
|
||||
/* Check if at least one mountain on the map is higher than the new value.
|
||||
* If yes, disallow the change. */
|
||||
@@ -133,18 +133,18 @@ static int32 ClickChangeMaxHlCheat(int32 p1, int32 p2)
|
||||
if ((int32)TileHeight(t) > p1) {
|
||||
ShowErrorMessage(STR_CONFIG_SETTING_TOO_HIGH_MOUNTAIN, INVALID_STRING_ID, WL_ERROR);
|
||||
/* Return old, unchanged value */
|
||||
return _settings_game.construction.max_heightlevel;
|
||||
return _settings_game.construction.map_height_limit;
|
||||
}
|
||||
}
|
||||
|
||||
/* Execute the change and reload GRF Data */
|
||||
_settings_game.construction.max_heightlevel = p1;
|
||||
_settings_game.construction.map_height_limit = p1;
|
||||
ReloadNewGRFData();
|
||||
|
||||
/* The smallmap uses an index from heightlevels to colours. Trigger rebuilding it. */
|
||||
InvalidateWindowClassesData(WC_SMALLMAP, 2);
|
||||
|
||||
return _settings_game.construction.max_heightlevel;
|
||||
return _settings_game.construction.map_height_limit;
|
||||
}
|
||||
|
||||
/** Available cheats. */
|
||||
@@ -182,14 +182,14 @@ struct CheatEntry {
|
||||
* Order matches with the values of #CheatNumbers
|
||||
*/
|
||||
static const CheatEntry _cheats_ui[] = {
|
||||
{SLE_INT32, STR_CHEAT_MONEY, &_money_cheat_amount, &_cheats.money.been_used, &ClickMoneyCheat },
|
||||
{SLE_UINT8, STR_CHEAT_CHANGE_COMPANY, &_local_company, &_cheats.switch_company.been_used, &ClickChangeCompanyCheat },
|
||||
{SLE_BOOL, STR_CHEAT_EXTRA_DYNAMITE, &_cheats.magic_bulldozer.value, &_cheats.magic_bulldozer.been_used, nullptr },
|
||||
{SLE_BOOL, STR_CHEAT_CROSSINGTUNNELS, &_cheats.crossing_tunnels.value, &_cheats.crossing_tunnels.been_used, nullptr },
|
||||
{SLE_BOOL, STR_CHEAT_NO_JETCRASH, &_cheats.no_jetcrash.value, &_cheats.no_jetcrash.been_used, nullptr },
|
||||
{SLE_BOOL, STR_CHEAT_SETUP_PROD, &_cheats.setup_prod.value, &_cheats.setup_prod.been_used, &ClickSetProdCheat },
|
||||
{SLE_UINT8, STR_CHEAT_EDIT_MAX_HL, &_settings_game.construction.max_heightlevel, &_cheats.edit_max_hl.been_used, &ClickChangeMaxHlCheat },
|
||||
{SLE_INT32, STR_CHEAT_CHANGE_DATE, &_cur_year, &_cheats.change_date.been_used, &ClickChangeDateCheat },
|
||||
{SLE_INT32, STR_CHEAT_MONEY, &_money_cheat_amount, &_cheats.money.been_used, &ClickMoneyCheat },
|
||||
{SLE_UINT8, STR_CHEAT_CHANGE_COMPANY, &_local_company, &_cheats.switch_company.been_used, &ClickChangeCompanyCheat },
|
||||
{SLE_BOOL, STR_CHEAT_EXTRA_DYNAMITE, &_cheats.magic_bulldozer.value, &_cheats.magic_bulldozer.been_used, nullptr },
|
||||
{SLE_BOOL, STR_CHEAT_CROSSINGTUNNELS, &_cheats.crossing_tunnels.value, &_cheats.crossing_tunnels.been_used, nullptr },
|
||||
{SLE_BOOL, STR_CHEAT_NO_JETCRASH, &_cheats.no_jetcrash.value, &_cheats.no_jetcrash.been_used, nullptr },
|
||||
{SLE_BOOL, STR_CHEAT_SETUP_PROD, &_cheats.setup_prod.value, &_cheats.setup_prod.been_used, &ClickSetProdCheat },
|
||||
{SLE_UINT8, STR_CHEAT_EDIT_MAX_HL, &_settings_game.construction.map_height_limit, &_cheats.edit_max_hl.been_used, &ClickChangeMaxHlCheat },
|
||||
{SLE_INT32, STR_CHEAT_CHANGE_DATE, &_cur_year, &_cheats.change_date.been_used, &ClickChangeDateCheat },
|
||||
};
|
||||
|
||||
static_assert(CHT_NUM_CHEATS == lengthof(_cheats_ui));
|
||||
|
||||
@@ -338,6 +338,7 @@ void GenerateClearTile()
|
||||
TileIndex tile_new;
|
||||
|
||||
SetClearGroundDensity(tile, CLEAR_ROCKS, 3);
|
||||
MarkTileDirtyByTile(tile);
|
||||
do {
|
||||
if (--j == 0) goto get_out;
|
||||
tile_new = tile + TileOffsByDiagDir((DiagDirection)GB(Random(), 0, 2));
|
||||
|
||||
@@ -77,7 +77,7 @@ CommandCallback CcBuildBridge;
|
||||
|
||||
/* dock_gui.cpp */
|
||||
CommandCallback CcBuildDocks;
|
||||
CommandCallback CcPlaySound_SPLAT_WATER;
|
||||
CommandCallback CcPlaySound_CONSTRUCTION_WATER;
|
||||
|
||||
/* depot_gui.cpp */
|
||||
CommandCallback CcCloneVehicle;
|
||||
@@ -98,13 +98,13 @@ CommandCallback CcPlaceSign;
|
||||
CommandCallback CcTerraform;
|
||||
|
||||
/* rail_gui.cpp */
|
||||
CommandCallback CcPlaySound_SPLAT_RAIL;
|
||||
CommandCallback CcPlaySound_CONSTRUCTION_RAIL;
|
||||
CommandCallback CcRailDepot;
|
||||
CommandCallback CcStation;
|
||||
CommandCallback CcBuildRailTunnel;
|
||||
|
||||
/* road_gui.cpp */
|
||||
CommandCallback CcPlaySound_SPLAT_OTHER;
|
||||
CommandCallback CcPlaySound_CONSTRUCTION_OTHER;
|
||||
CommandCallback CcBuildRoadTunnel;
|
||||
CommandCallback CcRoadDepot;
|
||||
CommandCallback CcRoadStop;
|
||||
|
||||
@@ -35,6 +35,7 @@
|
||||
#include "game/game.hpp"
|
||||
#include "goal_base.h"
|
||||
#include "story_base.h"
|
||||
#include "widgets/statusbar_widget.h"
|
||||
|
||||
#include "table/strings.h"
|
||||
|
||||
@@ -62,9 +63,9 @@ Company::Company(uint16 name_1, bool is_ai)
|
||||
this->name_1 = name_1;
|
||||
this->location_of_HQ = INVALID_TILE;
|
||||
this->is_ai = is_ai;
|
||||
this->terraform_limit = _settings_game.construction.terraform_frame_burst << 16;
|
||||
this->clear_limit = _settings_game.construction.clear_frame_burst << 16;
|
||||
this->tree_limit = _settings_game.construction.tree_frame_burst << 16;
|
||||
this->terraform_limit = (uint32)_settings_game.construction.terraform_frame_burst << 16;
|
||||
this->clear_limit = (uint32)_settings_game.construction.clear_frame_burst << 16;
|
||||
this->tree_limit = (uint32)_settings_game.construction.tree_frame_burst << 16;
|
||||
|
||||
for (uint j = 0; j < 4; j++) this->share_owners[j] = COMPANY_SPECTATOR;
|
||||
InvalidateWindowData(WC_PERFORMANCE_DETAIL, 0, INVALID_COMPANY);
|
||||
@@ -119,6 +120,7 @@ void SetLocalCompany(CompanyID new_company)
|
||||
/* ... and redraw the whole screen. */
|
||||
MarkWholeScreenDirty();
|
||||
InvalidateWindowClassesData(WC_SIGN_LIST, -1);
|
||||
InvalidateWindowClassesData(WC_GOALS_LIST);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -182,7 +184,7 @@ void InvalidateCompanyWindows(const Company *company)
|
||||
{
|
||||
CompanyID cid = company->index;
|
||||
|
||||
if (cid == _local_company) SetWindowDirty(WC_STATUS_BAR, 0);
|
||||
if (cid == _local_company) SetWindowWidgetDirty(WC_STATUS_BAR, 0, WID_S_RIGHT);
|
||||
SetWindowDirty(WC_FINANCES, cid);
|
||||
}
|
||||
|
||||
@@ -265,9 +267,9 @@ void SubtractMoneyFromCompanyFract(CompanyID company, const CommandCost &cst)
|
||||
void UpdateLandscapingLimits()
|
||||
{
|
||||
for (Company *c : Company::Iterate()) {
|
||||
c->terraform_limit = std::min<uint32>(c->terraform_limit + _settings_game.construction.terraform_per_64k_frames, _settings_game.construction.terraform_frame_burst << 16);
|
||||
c->clear_limit = std::min<uint32>(c->clear_limit + _settings_game.construction.clear_per_64k_frames, _settings_game.construction.clear_frame_burst << 16);
|
||||
c->tree_limit = std::min<uint32>(c->tree_limit + _settings_game.construction.tree_per_64k_frames, _settings_game.construction.tree_frame_burst << 16);
|
||||
c->terraform_limit = std::min<uint64>((uint64)c->terraform_limit + _settings_game.construction.terraform_per_64k_frames, (uint64)_settings_game.construction.terraform_frame_burst << 16);
|
||||
c->clear_limit = std::min<uint64>((uint64)c->clear_limit + _settings_game.construction.clear_per_64k_frames, (uint64)_settings_game.construction.clear_frame_burst << 16);
|
||||
c->tree_limit = std::min<uint64>((uint64)c->tree_limit + _settings_game.construction.tree_per_64k_frames, (uint64)_settings_game.construction.tree_frame_burst << 16);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -821,13 +823,6 @@ CommandCost CmdCompanyCtrl(TileIndex tile, DoCommandFlag flags, uint32 p1, uint3
|
||||
|
||||
ClientID client_id = (ClientID)p2;
|
||||
NetworkClientInfo *ci = NetworkClientInfo::GetByClientID(client_id);
|
||||
#ifndef DEBUG_DUMP_COMMANDS
|
||||
/* When replaying the client ID is not a valid client; there
|
||||
* are actually no clients at all. However, the company has to
|
||||
* be created, otherwise we cannot rerun the game properly.
|
||||
* So only allow a nullptr client info in that case. */
|
||||
if (ci == nullptr) return CommandCost();
|
||||
#endif /* NOT DEBUG_DUMP_COMMANDS */
|
||||
|
||||
/* Delete multiplayer progress bar */
|
||||
DeleteWindowById(WC_NETWORK_STATUS_WINDOW, WN_NETWORK_STATUS_WINDOW_JOIN);
|
||||
@@ -836,7 +831,9 @@ CommandCost CmdCompanyCtrl(TileIndex tile, DoCommandFlag flags, uint32 p1, uint3
|
||||
|
||||
/* A new company could not be created, revert to being a spectator */
|
||||
if (c == nullptr) {
|
||||
if (_network_server) {
|
||||
/* We check for "ci != nullptr" as a client could have left by
|
||||
* the time we execute this command. */
|
||||
if (_network_server && ci != nullptr) {
|
||||
ci->client_playas = COMPANY_SPECTATOR;
|
||||
NetworkUpdateClientInfo(ci->client_id);
|
||||
}
|
||||
@@ -863,9 +860,16 @@ CommandCost CmdCompanyCtrl(TileIndex tile, DoCommandFlag flags, uint32 p1, uint3
|
||||
}
|
||||
|
||||
case CCA_NEW_AI: { // Make a new AI company
|
||||
if (company_id != INVALID_COMPANY && company_id >= MAX_COMPANIES) return CMD_ERROR;
|
||||
|
||||
/* For network games, company deletion is delayed. */
|
||||
if (!_networking && company_id != INVALID_COMPANY && Company::IsValidID(company_id)) return CMD_ERROR;
|
||||
|
||||
if (!(flags & DC_EXEC)) return CommandCost();
|
||||
|
||||
if (company_id != INVALID_COMPANY && (company_id >= MAX_COMPANIES || Company::IsValidID(company_id))) return CMD_ERROR;
|
||||
/* For network game, just assume deletion happened. */
|
||||
assert(company_id == INVALID_COMPANY || !Company::IsValidID(company_id));
|
||||
|
||||
Company *c = DoStartupNewCompany(true, company_id);
|
||||
if (c != nullptr) NetworkServerNewCompany(c, nullptr);
|
||||
break;
|
||||
@@ -875,6 +879,9 @@ CommandCost CmdCompanyCtrl(TileIndex tile, DoCommandFlag flags, uint32 p1, uint3
|
||||
CompanyRemoveReason reason = (CompanyRemoveReason)GB(p1, 24, 8);
|
||||
if (reason >= CRR_END) return CMD_ERROR;
|
||||
|
||||
/* We can't delete the last existing company in singleplayer mode. */
|
||||
if (!_networking && Company::GetNumItems() == 1) return CMD_ERROR;
|
||||
|
||||
Company *c = Company::GetIfValid(company_id);
|
||||
if (c == nullptr) return CMD_ERROR;
|
||||
|
||||
|
||||
@@ -13,6 +13,7 @@
|
||||
#include "engine_func.h"
|
||||
#include "landscape.h"
|
||||
#include "saveload/saveload.h"
|
||||
#include "network/core/game_info.h"
|
||||
#include "network/network.h"
|
||||
#include "network/network_func.h"
|
||||
#include "network/network_base.h"
|
||||
@@ -45,7 +46,7 @@
|
||||
#include "safeguards.h"
|
||||
|
||||
/* scriptfile handling */
|
||||
static bool _script_running; ///< Script is running (used to abort execution when #ConReturn is encountered).
|
||||
static uint _script_current_depth; ///< Depth of scripts running (used to abort execution when #ConReturn is encountered).
|
||||
|
||||
/** File list storage for the console, for caching the last 'ls' command. */
|
||||
class ConsoleFileList : public FileList {
|
||||
@@ -147,7 +148,7 @@ DEF_CONSOLE_HOOK(ConHookNeedNetwork)
|
||||
}
|
||||
|
||||
/**
|
||||
* Check whether we are in single player mode.
|
||||
* Check whether we are in singleplayer mode.
|
||||
* @return True when no network is active.
|
||||
*/
|
||||
DEF_CONSOLE_HOOK(ConHookNoNetwork)
|
||||
@@ -893,7 +894,7 @@ DEF_CONSOLE_CMD(ConNetworkReconnect)
|
||||
/* Don't resolve the address first, just print it directly as it comes from the config file. */
|
||||
IConsolePrintF(CC_DEFAULT, "Reconnecting to %s:%d...", _settings_client.network.last_host, _settings_client.network.last_port);
|
||||
|
||||
NetworkClientConnectGame(NetworkAddress(_settings_client.network.last_host, _settings_client.network.last_port), playas);
|
||||
NetworkClientConnectGame(_settings_client.network.last_host, _settings_client.network.last_port, playas);
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -907,7 +908,6 @@ DEF_CONSOLE_CMD(ConNetworkConnect)
|
||||
}
|
||||
|
||||
if (argc < 2) return false;
|
||||
if (_networking) NetworkDisconnect(); // we are in network-mode, first close it!
|
||||
|
||||
const char *port = nullptr;
|
||||
const char *company = nullptr;
|
||||
@@ -935,7 +935,7 @@ DEF_CONSOLE_CMD(ConNetworkConnect)
|
||||
IConsolePrintF(CC_DEFAULT, " port: %s", port);
|
||||
}
|
||||
|
||||
NetworkClientConnectGame(NetworkAddress(ip, rport), join_as);
|
||||
NetworkClientConnectGame(ip, rport, join_as);
|
||||
|
||||
return true;
|
||||
}
|
||||
@@ -960,10 +960,16 @@ DEF_CONSOLE_CMD(ConExec)
|
||||
return true;
|
||||
}
|
||||
|
||||
_script_running = true;
|
||||
if (_script_current_depth == 11) {
|
||||
IConsoleError("Maximum 'exec' depth reached; script A is calling script B is calling script C ... more than 10 times.");
|
||||
return true;
|
||||
}
|
||||
|
||||
_script_current_depth++;
|
||||
uint script_depth = _script_current_depth;
|
||||
|
||||
char cmdline[ICON_CMDLN_SIZE];
|
||||
while (_script_running && fgets(cmdline, sizeof(cmdline), script_file) != nullptr) {
|
||||
while (fgets(cmdline, sizeof(cmdline), script_file) != nullptr) {
|
||||
/* Remove newline characters from the executing script */
|
||||
for (char *cmdptr = cmdline; *cmdptr != '\0'; cmdptr++) {
|
||||
if (*cmdptr == '\n' || *cmdptr == '\r') {
|
||||
@@ -972,13 +978,18 @@ DEF_CONSOLE_CMD(ConExec)
|
||||
}
|
||||
}
|
||||
IConsoleCmdExec(cmdline);
|
||||
/* Ensure that we are still on the same depth or that we returned via 'return'. */
|
||||
assert(_script_current_depth == script_depth || _script_current_depth == script_depth - 1);
|
||||
|
||||
/* The 'return' command was executed. */
|
||||
if (_script_current_depth == script_depth - 1) break;
|
||||
}
|
||||
|
||||
if (ferror(script_file)) {
|
||||
IConsoleError("Encountered error while trying to read from script file");
|
||||
}
|
||||
|
||||
_script_running = false;
|
||||
if (_script_current_depth == script_depth) _script_current_depth--;
|
||||
FioFCloseFile(script_file);
|
||||
return true;
|
||||
}
|
||||
@@ -990,7 +1001,7 @@ DEF_CONSOLE_CMD(ConReturn)
|
||||
return true;
|
||||
}
|
||||
|
||||
_script_running = false;
|
||||
_script_current_depth--;
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -1248,13 +1259,14 @@ DEF_CONSOLE_CMD(ConReloadAI)
|
||||
return true;
|
||||
}
|
||||
|
||||
if (Company::IsHumanID(company_id)) {
|
||||
/* In singleplayer mode the player can be in an AI company, after cheating or loading network save with an AI in first slot. */
|
||||
if (Company::IsHumanID(company_id) || company_id == _local_company) {
|
||||
IConsoleWarning("Company is not controlled by an AI.");
|
||||
return true;
|
||||
}
|
||||
|
||||
/* First kill the company of the AI, then start a new one. This should start the current AI again */
|
||||
DoCommandP(0, CCA_DELETE | company_id << 16 | CRR_MANUAL << 24, 0,CMD_COMPANY_CTRL);
|
||||
DoCommandP(0, CCA_DELETE | company_id << 16 | CRR_MANUAL << 24, 0, CMD_COMPANY_CTRL);
|
||||
DoCommandP(0, CCA_NEW_AI | company_id << 16, 0, CMD_COMPANY_CTRL);
|
||||
IConsolePrint(CC_DEFAULT, "AI reloaded.");
|
||||
|
||||
@@ -1285,6 +1297,7 @@ DEF_CONSOLE_CMD(ConStopAI)
|
||||
return true;
|
||||
}
|
||||
|
||||
/* In singleplayer mode the player can be in an AI company, after cheating or loading network save with an AI in first slot. */
|
||||
if (Company::IsHumanID(company_id) || company_id == _local_company) {
|
||||
IConsoleWarning("Company is not controlled by an AI.");
|
||||
return true;
|
||||
@@ -1338,7 +1351,9 @@ DEF_CONSOLE_CMD(ConRescanNewGRF)
|
||||
return true;
|
||||
}
|
||||
|
||||
ScanNewGRFFiles(nullptr);
|
||||
if (!RequestNewGRFScan()) {
|
||||
IConsoleWarning("NewGRF scanning is already running. Please wait until completed to run again.");
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
@@ -1407,46 +1422,80 @@ DEF_CONSOLE_CMD(ConAlias)
|
||||
DEF_CONSOLE_CMD(ConScreenShot)
|
||||
{
|
||||
if (argc == 0) {
|
||||
IConsoleHelp("Create a screenshot of the game. Usage: 'screenshot [big | giant | no_con | minimap] [file name]'");
|
||||
IConsoleHelp("'big' makes a zoomed-in screenshot of the visible area, 'giant' makes a screenshot of the "
|
||||
"whole map, 'no_con' hides the console to create the screenshot. 'big' or 'giant' "
|
||||
"screenshots are always drawn without console. "
|
||||
"'minimap' makes a top-viewed minimap screenshot of whole world which represents one tile by one pixel.");
|
||||
IConsoleHelp("Create a screenshot of the game. Usage: 'screenshot [viewport | normal | big | giant | heightmap | minimap] [no_con] [size <width> <height>] [<filename>]'");
|
||||
IConsoleHelp("'viewport' (default) makes a screenshot of the current viewport (including menus, windows, ..), "
|
||||
"'normal' makes a screenshot of the visible area, "
|
||||
"'big' makes a zoomed-in screenshot of the visible area, "
|
||||
"'giant' makes a screenshot of the whole map, "
|
||||
"'heightmap' makes a heightmap screenshot of the map that can be loaded in as heightmap, "
|
||||
"'minimap' makes a top-viewed minimap screenshot of the whole world which represents one tile by one pixel. "
|
||||
"'no_con' hides the console to create the screenshot (only useful in combination with 'viewport'). "
|
||||
"'size' sets the width and height of the viewport to make a screenshot of (only useful in combination with 'normal' or 'big').");
|
||||
return true;
|
||||
}
|
||||
|
||||
if (argc > 3) return false;
|
||||
if (argc > 7) return false;
|
||||
|
||||
ScreenshotType type = SC_VIEWPORT;
|
||||
const char *name = nullptr;
|
||||
uint32 width = 0;
|
||||
uint32 height = 0;
|
||||
std::string name{};
|
||||
uint32 arg_index = 1;
|
||||
|
||||
if (argc > 1) {
|
||||
if (strcmp(argv[1], "big") == 0) {
|
||||
/* screenshot big [filename] */
|
||||
if (argc > arg_index) {
|
||||
if (strcmp(argv[arg_index], "viewport") == 0) {
|
||||
type = SC_VIEWPORT;
|
||||
arg_index += 1;
|
||||
} else if (strcmp(argv[arg_index], "normal") == 0) {
|
||||
type = SC_DEFAULTZOOM;
|
||||
arg_index += 1;
|
||||
} else if (strcmp(argv[arg_index], "big") == 0) {
|
||||
type = SC_ZOOMEDIN;
|
||||
if (argc > 2) name = argv[2];
|
||||
} else if (strcmp(argv[1], "giant") == 0) {
|
||||
/* screenshot giant [filename] */
|
||||
arg_index += 1;
|
||||
} else if (strcmp(argv[arg_index], "giant") == 0) {
|
||||
type = SC_WORLD;
|
||||
if (argc > 2) name = argv[2];
|
||||
} else if (strcmp(argv[1], "minimap") == 0) {
|
||||
/* screenshot minimap [filename] */
|
||||
arg_index += 1;
|
||||
} else if (strcmp(argv[arg_index], "heightmap") == 0) {
|
||||
type = SC_HEIGHTMAP;
|
||||
arg_index += 1;
|
||||
} else if (strcmp(argv[arg_index], "minimap") == 0) {
|
||||
type = SC_MINIMAP;
|
||||
if (argc > 2) name = argv[2];
|
||||
} else if (strcmp(argv[1], "no_con") == 0) {
|
||||
/* screenshot no_con [filename] */
|
||||
IConsoleClose();
|
||||
if (argc > 2) name = argv[2];
|
||||
} else if (argc == 2) {
|
||||
/* screenshot filename */
|
||||
name = argv[1];
|
||||
} else {
|
||||
/* screenshot argv[1] argv[2] - invalid */
|
||||
return false;
|
||||
arg_index += 1;
|
||||
}
|
||||
}
|
||||
|
||||
MakeScreenshot(type, name);
|
||||
if (argc > arg_index && strcmp(argv[arg_index], "no_con") == 0) {
|
||||
if (type != SC_VIEWPORT) {
|
||||
IConsoleError("'no_con' can only be used in combination with 'viewport'");
|
||||
return true;
|
||||
}
|
||||
IConsoleClose();
|
||||
arg_index += 1;
|
||||
}
|
||||
|
||||
if (argc > arg_index + 2 && strcmp(argv[arg_index], "size") == 0) {
|
||||
/* size <width> <height> */
|
||||
if (type != SC_DEFAULTZOOM && type != SC_ZOOMEDIN) {
|
||||
IConsoleError("'size' can only be used in combination with 'normal' or 'big'");
|
||||
return true;
|
||||
}
|
||||
GetArgumentInteger(&width, argv[arg_index + 1]);
|
||||
GetArgumentInteger(&height, argv[arg_index + 2]);
|
||||
arg_index += 3;
|
||||
}
|
||||
|
||||
if (argc > arg_index) {
|
||||
/* Last parameter that was not one of the keywords must be the filename. */
|
||||
name = argv[arg_index];
|
||||
arg_index += 1;
|
||||
}
|
||||
|
||||
if (argc > arg_index) {
|
||||
/* We have parameters we did not process; means we misunderstood any of the above. */
|
||||
return false;
|
||||
}
|
||||
|
||||
MakeScreenshot(type, name, width, height);
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -1832,7 +1881,7 @@ DEF_CONSOLE_CMD(ConContent)
|
||||
* to download every available package on BaNaNaS. This is not in
|
||||
* the spirit of this service. Additionally, these few people were
|
||||
* good for 70% of the consumed bandwidth of BaNaNaS. */
|
||||
IConsolePrintF(CC_ERROR, "'select all' is no longer supported since 1.11");
|
||||
IConsoleError("'select all' is no longer supported since 1.11");
|
||||
} else {
|
||||
_network_content_client.Select((ContentID)atoi(argv[2]));
|
||||
}
|
||||
@@ -2134,7 +2183,7 @@ static void ConDumpRoadTypes()
|
||||
grfs.emplace(grfid, grf);
|
||||
}
|
||||
IConsolePrintF(CC_DEFAULT, " %02u %s %c%c%c%c, Flags: %c%c%c%c%c, GRF: %08X, %s",
|
||||
(uint) rt,
|
||||
(uint)rt,
|
||||
RoadTypeIsTram(rt) ? "Tram" : "Road",
|
||||
rti->label >> 24, rti->label >> 16, rti->label >> 8, rti->label,
|
||||
HasBit(rti->flags, ROTF_CATENARY) ? 'c' : '-',
|
||||
@@ -2172,7 +2221,7 @@ static void ConDumpRailTypes()
|
||||
grfs.emplace(grfid, grf);
|
||||
}
|
||||
IConsolePrintF(CC_DEFAULT, " %02u %c%c%c%c, Flags: %c%c%c%c%c%c, GRF: %08X, %s",
|
||||
(uint) rt,
|
||||
(uint)rt,
|
||||
rti->label >> 24, rti->label >> 16, rti->label >> 8, rti->label,
|
||||
HasBit(rti->flags, RTF_CATENARY) ? 'c' : '-',
|
||||
HasBit(rti->flags, RTF_NO_LEVEL_CROSSING) ? 'l' : '-',
|
||||
@@ -2215,7 +2264,7 @@ static void ConDumpCargoTypes()
|
||||
grfs.emplace(grfid, grf);
|
||||
}
|
||||
IConsolePrintF(CC_DEFAULT, " %02u Bit: %2u, Label: %c%c%c%c, Callback mask: 0x%02X, Cargo class: %c%c%c%c%c%c%c%c%c%c%c, GRF: %08X, %s",
|
||||
(uint) i,
|
||||
(uint)i,
|
||||
spec->bitnum,
|
||||
spec->label >> 24, spec->label >> 16, spec->label >> 8, spec->label,
|
||||
spec->callback_mask,
|
||||
|
||||
@@ -26,3 +26,25 @@ Dimension maxdim(const Dimension &d1, const Dimension &d2)
|
||||
d.height = std::max(d1.height, d2.height);
|
||||
return d;
|
||||
}
|
||||
|
||||
/**
|
||||
* Compute the bounding rectangle around two rectangles.
|
||||
* @param r1 First rectangle.
|
||||
* @param r2 Second rectangle.
|
||||
* @return The bounding rectangle, the smallest rectangle that contains both arguments.
|
||||
*/
|
||||
Rect BoundingRect(const Rect &r1, const Rect &r2)
|
||||
{
|
||||
/* If either the first or the second is empty, return the other. */
|
||||
if (IsEmptyRect(r1)) return r2;
|
||||
if (IsEmptyRect(r2)) return r1;
|
||||
|
||||
Rect r;
|
||||
|
||||
r.top = std::min(r1.top, r2.top);
|
||||
r.bottom = std::max(r1.bottom, r2.bottom);
|
||||
r.left = std::min(r1.left, r2.left);
|
||||
r.right = std::max(r1.right, r2.right);
|
||||
|
||||
return r;
|
||||
}
|
||||
|
||||
@@ -14,4 +14,16 @@
|
||||
|
||||
Dimension maxdim(const Dimension &d1, const Dimension &d2);
|
||||
|
||||
/**
|
||||
* Check if a rectangle is empty.
|
||||
* @param r Rectangle to check.
|
||||
* @return True if and only if the rectangle doesn't define space.
|
||||
*/
|
||||
static inline bool IsEmptyRect(const Rect &r)
|
||||
{
|
||||
return (r.left | r.top | r.right | r.bottom) == 0;
|
||||
}
|
||||
|
||||
Rect BoundingRect(const Rect &r1, const Rect &r2);
|
||||
|
||||
#endif /* GEOMETRY_FUNC_HPP */
|
||||
|
||||
@@ -82,7 +82,7 @@ struct Pool : PoolBase {
|
||||
/* Ensure Tmax_size is within the bounds of Tindex. */
|
||||
static_assert((uint64)(Tmax_size - 1) >> 8 * sizeof(Tindex) == 0);
|
||||
|
||||
static const size_t MAX_SIZE = Tmax_size; ///< Make template parameter accessible from outside
|
||||
static constexpr size_t MAX_SIZE = Tmax_size; ///< Make template parameter accessible from outside
|
||||
|
||||
const char * const name; ///< Name of this pool
|
||||
|
||||
|
||||
@@ -114,6 +114,12 @@ public:
|
||||
*/
|
||||
static void InitialiseCrashLog();
|
||||
|
||||
/**
|
||||
* Prepare crash log handler for a newly started thread.
|
||||
* @note must be implemented by all implementers of CrashLog.
|
||||
*/
|
||||
static void InitThread();
|
||||
|
||||
static void SetErrorMessage(const char *message);
|
||||
static void AfterCrashLogCleanup();
|
||||
};
|
||||
|
||||
@@ -66,6 +66,8 @@ static const CurrencySpec origin_currency_specs[CURRENCY_END] = {
|
||||
{ 8, "", CF_NOEURO, u8"\u00a5", "", 0, STR_GAME_OPTIONS_CURRENCY_CNY }, ///< chinese renminbi
|
||||
{ 10, "", CF_NOEURO, "HKD" NBSP, "", 0, STR_GAME_OPTIONS_CURRENCY_HKD }, ///< hong kong dollar
|
||||
{ 90, "", CF_NOEURO, u8"\u20b9", "", 0, STR_GAME_OPTIONS_CURRENCY_INR }, ///< Indian Rupee
|
||||
{ 19, "", CF_NOEURO, "Rp", "", 0, STR_GAME_OPTIONS_CURRENCY_IDR }, ///< Indonesian Rupiah
|
||||
{ 5, "", CF_NOEURO, "RM", "", 0, STR_GAME_OPTIONS_CURRENCY_MYR }, ///< Malaysian Ringgit
|
||||
};
|
||||
|
||||
/** Array of currencies used by the system */
|
||||
|
||||
@@ -11,6 +11,7 @@
|
||||
#define CURRENCY_H
|
||||
|
||||
#include "date_type.h"
|
||||
#include "string_func.h"
|
||||
#include "strings_type.h"
|
||||
|
||||
static const int CF_NOEURO = 0; ///< Currency never switches to the Euro (as far as known).
|
||||
@@ -62,6 +63,8 @@ enum Currencies {
|
||||
CURRENCY_CNY, ///< Chinese Renminbi
|
||||
CURRENCY_HKD, ///< Hong Kong Dollar
|
||||
CURRENCY_INR, ///< Indian Rupee
|
||||
CURRENCY_IDR, ///< Indonesian Rupiah
|
||||
CURRENCY_MYR, ///< Malaysian Ringgit
|
||||
CURRENCY_END, ///< always the last item
|
||||
};
|
||||
|
||||
@@ -83,6 +86,15 @@ struct CurrencySpec {
|
||||
*/
|
||||
byte symbol_pos;
|
||||
StringID name;
|
||||
|
||||
CurrencySpec() = default;
|
||||
|
||||
CurrencySpec(uint16 rate, const char *separator, Year to_euro, const char *prefix, const char *suffix, byte symbol_pos, StringID name) : rate(rate), to_euro(to_euro), symbol_pos(symbol_pos), name(name)
|
||||
{
|
||||
strecpy(this->separator, separator, lastof(this->separator));
|
||||
strecpy(this->prefix, prefix, lastof(this->prefix));
|
||||
strecpy(this->suffix, suffix, lastof(this->suffix));
|
||||
}
|
||||
};
|
||||
|
||||
extern CurrencySpec _currency_specs[CURRENCY_END];
|
||||
|
||||
@@ -19,6 +19,7 @@
|
||||
#include "linkgraph/linkgraph.h"
|
||||
#include "saveload/saveload.h"
|
||||
#include "newgrf_profiling.h"
|
||||
#include "widgets/statusbar_widget.h"
|
||||
|
||||
#include "safeguards.h"
|
||||
|
||||
@@ -255,7 +256,7 @@ static void OnNewDay()
|
||||
DisasterDailyLoop();
|
||||
IndustryDailyLoop();
|
||||
|
||||
SetWindowWidgetDirty(WC_STATUS_BAR, 0, 0);
|
||||
SetWindowWidgetDirty(WC_STATUS_BAR, 0, WID_S_LEFT);
|
||||
EnginesDailyLoop();
|
||||
|
||||
/* Refresh after possible snowline change */
|
||||
|
||||
@@ -45,8 +45,6 @@ int _debug_console_level;
|
||||
int _debug_random_level;
|
||||
#endif
|
||||
|
||||
uint32 _realtime_tick = 0;
|
||||
|
||||
struct DebugLevel {
|
||||
const char *name;
|
||||
int *level;
|
||||
@@ -134,7 +132,7 @@ static void debug_print(const char *dbg, const char *buf)
|
||||
char buffer[512];
|
||||
seprintf(buffer, lastof(buffer), "%sdbg: [%s] %s\n", GetLogPrefix(), dbg, buf);
|
||||
#if defined(_WIN32)
|
||||
TCHAR system_buf[512];
|
||||
wchar_t system_buf[512];
|
||||
convert_to_fs(buffer, system_buf, lengthof(system_buf), true);
|
||||
_fputts(system_buf, stderr);
|
||||
#else
|
||||
|
||||
@@ -121,7 +121,4 @@ void CDECL ShowInfoF(const char *str, ...) WARN_FORMAT(1, 2);
|
||||
|
||||
const char *GetLogPrefix();
|
||||
|
||||
/** The real time in the game. */
|
||||
extern uint32 _realtime_tick;
|
||||
|
||||
#endif /* DEBUG_H */
|
||||
|
||||
@@ -294,6 +294,7 @@ struct DepotWindow : Window {
|
||||
~DepotWindow()
|
||||
{
|
||||
DeleteWindowById(WC_BUILD_VEHICLE, this->window_number);
|
||||
DeleteWindowById(GetWindowClassForVehicleType(this->type), VehicleListIdentifier(VL_DEPOT_LIST, this->type, this->owner, this->GetDepotIndex()).Pack(), false);
|
||||
OrderBackup::Reset(this->window_number);
|
||||
}
|
||||
|
||||
@@ -423,10 +424,8 @@ struct DepotWindow : Window {
|
||||
{
|
||||
if (widget != WID_D_CAPTION) return;
|
||||
|
||||
/* locate the depot struct */
|
||||
TileIndex tile = this->window_number;
|
||||
SetDParam(0, this->type);
|
||||
SetDParam(1, (this->type == VEH_AIRCRAFT) ? GetStationIndex(tile) : GetDepotIndex(tile));
|
||||
SetDParam(1, this->GetDepotIndex());
|
||||
}
|
||||
|
||||
struct GetDepotVehiclePtData {
|
||||
@@ -809,11 +808,8 @@ struct DepotWindow : Window {
|
||||
case WID_D_SELL_ALL:
|
||||
/* Only open the confirmation window if there are anything to sell */
|
||||
if (this->vehicle_list.size() != 0 || this->wagon_list.size() != 0) {
|
||||
TileIndex tile = this->window_number;
|
||||
byte vehtype = this->type;
|
||||
|
||||
SetDParam(0, vehtype);
|
||||
SetDParam(1, (vehtype == VEH_AIRCRAFT) ? GetStationIndex(tile) : GetDepotIndex(tile));
|
||||
SetDParam(0, this->type);
|
||||
SetDParam(1, this->GetDepotIndex());
|
||||
ShowQuery(
|
||||
STR_DEPOT_CAPTION,
|
||||
STR_DEPOT_SELL_CONFIRMATION_TEXT,
|
||||
@@ -839,7 +835,7 @@ struct DepotWindow : Window {
|
||||
if (str == nullptr) return;
|
||||
|
||||
/* Do depot renaming */
|
||||
DoCommandP(0, GetDepotIndex(this->window_number), 0, CMD_RENAME_DEPOT | CMD_MSG(STR_ERROR_CAN_T_RENAME_DEPOT), nullptr, str);
|
||||
DoCommandP(0, this->GetDepotIndex(), 0, CMD_RENAME_DEPOT | CMD_MSG(STR_ERROR_CAN_T_RENAME_DEPOT), nullptr, str);
|
||||
}
|
||||
|
||||
bool OnRightClick(Point pt, int widget) override
|
||||
@@ -1076,6 +1072,16 @@ struct DepotWindow : Window {
|
||||
|
||||
return ES_NOT_HANDLED;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the DepotID of the current window.
|
||||
* In the case of airports, this is the station ID.
|
||||
* @return Depot or station ID of this window.
|
||||
*/
|
||||
inline uint16 GetDepotIndex() const
|
||||
{
|
||||
return (this->type == VEH_AIRCRAFT) ? ::GetStationIndex(this->window_number) : ::GetDepotIndex(this->window_number);
|
||||
}
|
||||
};
|
||||
|
||||
static void DepotSellAllConfirmationCallback(Window *win, bool confirmed)
|
||||
|
||||
@@ -456,7 +456,7 @@ static bool DisasterTick_Aircraft(DisasterVehicle *v, uint16 image_override, boo
|
||||
DestructIndustry(i);
|
||||
|
||||
SetDParam(0, i->town->index);
|
||||
AddTileNewsItem(news_message, NT_ACCIDENT, v->dest_tile);
|
||||
AddIndustryNewsItem(news_message, NT_ACCIDENT, i->index);
|
||||
if (_settings_client.sound.disaster) SndPlayTileFx(SND_12_EXPLOSION, i->location.tile);
|
||||
}
|
||||
} else if (v->current_order.GetDestination() == 0) {
|
||||
|
||||
@@ -42,13 +42,13 @@ void CcBuildDocks(const CommandCost &result, TileIndex tile, uint32 p1, uint32 p
|
||||
{
|
||||
if (result.Failed()) return;
|
||||
|
||||
if (_settings_client.sound.confirm) SndPlayTileFx(SND_02_SPLAT_WATER, tile);
|
||||
if (_settings_client.sound.confirm) SndPlayTileFx(SND_02_CONSTRUCTION_WATER, tile);
|
||||
if (!_settings_client.gui.persistent_buildingtools) ResetObjectToPlace();
|
||||
}
|
||||
|
||||
void CcPlaySound_SPLAT_WATER(const CommandCost &result, TileIndex tile, uint32 p1, uint32 p2, uint32 cmd)
|
||||
void CcPlaySound_CONSTRUCTION_WATER(const CommandCost &result, TileIndex tile, uint32 p1, uint32 p2, uint32 cmd)
|
||||
{
|
||||
if (result.Succeeded() && _settings_client.sound.confirm) SndPlayTileFx(SND_02_SPLAT_WATER, tile);
|
||||
if (result.Succeeded() && _settings_client.sound.confirm) SndPlayTileFx(SND_02_CONSTRUCTION_WATER, tile);
|
||||
}
|
||||
|
||||
|
||||
@@ -244,10 +244,10 @@ struct BuildDocksToolbarWindow : Window {
|
||||
GUIPlaceProcDragXY(select_proc, start_tile, end_tile);
|
||||
break;
|
||||
case DDSP_CREATE_WATER:
|
||||
DoCommandP(end_tile, start_tile, (_game_mode == GM_EDITOR && _ctrl_pressed) ? WATER_CLASS_SEA : WATER_CLASS_CANAL, CMD_BUILD_CANAL | CMD_MSG(STR_ERROR_CAN_T_BUILD_CANALS), CcPlaySound_SPLAT_WATER);
|
||||
DoCommandP(end_tile, start_tile, (_game_mode == GM_EDITOR && _ctrl_pressed) ? WATER_CLASS_SEA : WATER_CLASS_CANAL, CMD_BUILD_CANAL | CMD_MSG(STR_ERROR_CAN_T_BUILD_CANALS), CcPlaySound_CONSTRUCTION_WATER);
|
||||
break;
|
||||
case DDSP_CREATE_RIVER:
|
||||
DoCommandP(end_tile, start_tile, WATER_CLASS_RIVER, CMD_BUILD_CANAL | CMD_MSG(STR_ERROR_CAN_T_PLACE_RIVERS), CcPlaySound_SPLAT_WATER);
|
||||
DoCommandP(end_tile, start_tile, WATER_CLASS_RIVER, CMD_BUILD_CANAL | CMD_MSG(STR_ERROR_CAN_T_PLACE_RIVERS), CcPlaySound_CONSTRUCTION_WATER);
|
||||
break;
|
||||
|
||||
default: break;
|
||||
|
||||
@@ -9,10 +9,12 @@
|
||||
|
||||
#include "stdafx.h"
|
||||
#include "debug.h"
|
||||
#include "error.h"
|
||||
#include "sound/sound_driver.hpp"
|
||||
#include "music/music_driver.hpp"
|
||||
#include "video/video_driver.hpp"
|
||||
#include "string_func.h"
|
||||
#include "table/strings.h"
|
||||
#include <string>
|
||||
#include <sstream>
|
||||
|
||||
@@ -111,6 +113,8 @@ bool DriverFactoryBase::SelectDriverImpl(const std::string &name, Driver::Type t
|
||||
if (d->type != type) continue;
|
||||
if (d->priority != priority) continue;
|
||||
|
||||
if (type == Driver::DT_VIDEO && !_video_hw_accel && d->UsesHardwareAcceleration()) continue;
|
||||
|
||||
Driver *oldd = *GetActiveDriver(type);
|
||||
Driver *newd = d->CreateInstance();
|
||||
*GetActiveDriver(type) = newd;
|
||||
@@ -125,6 +129,12 @@ bool DriverFactoryBase::SelectDriverImpl(const std::string &name, Driver::Type t
|
||||
*GetActiveDriver(type) = oldd;
|
||||
DEBUG(driver, 1, "Probing %s driver '%s' failed with error: %s", GetDriverTypeName(type), d->name, err);
|
||||
delete newd;
|
||||
|
||||
if (type == Driver::DT_VIDEO && _video_hw_accel && d->UsesHardwareAcceleration()) {
|
||||
_video_hw_accel = false;
|
||||
ErrorMessageData msg(STR_VIDEO_DRIVER_ERROR, STR_VIDEO_DRIVER_ERROR_NO_HARDWARE_ACCELERATION);
|
||||
ScheduleErrorMessage(msg);
|
||||
}
|
||||
}
|
||||
}
|
||||
usererror("Couldn't find any suitable %s driver", GetDriverTypeName(type));
|
||||
@@ -211,8 +221,9 @@ DriverFactoryBase::DriverFactoryBase(Driver::Type type, int priority, const char
|
||||
strecpy(buf, GetDriverTypeName(type), lastof(buf));
|
||||
strecpy(buf + 5, name, lastof(buf));
|
||||
|
||||
std::pair<Drivers::iterator, bool> P = GetDrivers().insert(Drivers::value_type(buf, this));
|
||||
assert(P.second);
|
||||
Drivers &drivers = GetDrivers();
|
||||
assert(drivers.find(buf) == drivers.end());
|
||||
drivers.insert(Drivers::value_type(buf, this));
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -107,6 +107,15 @@ protected:
|
||||
|
||||
virtual ~DriverFactoryBase();
|
||||
|
||||
/**
|
||||
* Does the driver use hardware acceleration (video-drivers only).
|
||||
* @return True if the driver uses hardware acceleration.
|
||||
*/
|
||||
virtual bool UsesHardwareAcceleration() const
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
public:
|
||||
/**
|
||||
* Shuts down all active drivers
|
||||
|
||||
@@ -289,7 +289,7 @@ void ChangeOwnershipOfCompanyItems(Owner old_owner, Owner new_owner)
|
||||
if (_networking) NetworkClientsToSpectators(old_owner);
|
||||
if (old_owner == _local_company) {
|
||||
/* Single player cheated to AI company.
|
||||
* There are no spectators in single player, so we must pick some other company. */
|
||||
* There are no spectators in singleplayer mode, so we must pick some other company. */
|
||||
assert(!_networking);
|
||||
Backup<CompanyID> cur_company2(_current_company, FILE_LINE);
|
||||
for (const Company *c : Company::Iterate()) {
|
||||
@@ -605,7 +605,7 @@ static void CompanyCheckBankrupt(Company *c)
|
||||
default:
|
||||
case 10: {
|
||||
if (!_networking && _local_company == c->index) {
|
||||
/* If we are in offline mode, leave the company playing. Eg. there
|
||||
/* If we are in singleplayer mode, leave the company playing. Eg. there
|
||||
* is no THE-END, otherwise mark the client as spectator to make sure
|
||||
* he/she is no long in control of this company. However... when you
|
||||
* join another company (cheat) the "unowned" company can bankrupt. */
|
||||
@@ -2114,7 +2114,7 @@ CommandCost CmdBuyCompany(TileIndex tile, DoCommandFlag flags, uint32 p1, uint32
|
||||
/* Disable takeovers when not asked */
|
||||
if (!HasBit(c->bankrupt_asked, _current_company)) return CMD_ERROR;
|
||||
|
||||
/* Disable taking over the local company in single player */
|
||||
/* Disable taking over the local company in singleplayer mode */
|
||||
if (!_networking && _local_company == c->index) return CMD_ERROR;
|
||||
|
||||
/* Do not allow companies to take over themselves */
|
||||
|
||||
@@ -499,7 +499,7 @@ static bool BubbleTick(EffectVehicle *v)
|
||||
if (b->y == 4 && b->x == 1) {
|
||||
if (v->z_pos > 180 || Chance16I(1, 96, Random())) {
|
||||
v->spritenum = 5;
|
||||
if (_settings_client.sound.ambient) SndPlayVehicleFx(SND_2F_POP, v);
|
||||
if (_settings_client.sound.ambient) SndPlayVehicleFx(SND_2F_BUBBLE_GENERATOR_FAIL, v);
|
||||
}
|
||||
anim_state = 0;
|
||||
}
|
||||
@@ -508,7 +508,7 @@ static bool BubbleTick(EffectVehicle *v)
|
||||
TileIndex tile;
|
||||
|
||||
anim_state++;
|
||||
if (_settings_client.sound.ambient) SndPlayVehicleFx(SND_31_EXTRACT, v);
|
||||
if (_settings_client.sound.ambient) SndPlayVehicleFx(SND_31_BUBBLE_GENERATOR_SUCCESS, v);
|
||||
|
||||
tile = TileVirtXY(v->x_pos, v->y_pos);
|
||||
if (IsTileType(tile, MP_INDUSTRY) && GetIndustryGfx(tile) == GFX_BUBBLE_CATCHER) AddAnimatedTile(tile);
|
||||
|
||||
@@ -124,6 +124,9 @@ static TrackBits GetRailTrackBitsUniversal(TileIndex t, byte *override)
|
||||
*/
|
||||
static TrackBits MaskWireBits(TileIndex t, TrackBits tracks)
|
||||
{
|
||||
/* Single track bits are never masked out. */
|
||||
if (likely(HasAtMostOneBit(tracks))) return tracks;
|
||||
|
||||
if (!IsPlainRailTile(t)) return tracks;
|
||||
|
||||
TrackdirBits neighbour_tdb = TRACKDIR_BIT_NONE;
|
||||
|
||||
@@ -549,6 +549,7 @@ void SetupEngines()
|
||||
* in any case, and we just cleaned the pool. */
|
||||
assert(Engine::CanAllocateItem());
|
||||
const Engine *e = new Engine(eid.type, eid.internal_id);
|
||||
(void)e; // assert only
|
||||
assert(e->index == index);
|
||||
index++;
|
||||
}
|
||||
@@ -721,11 +722,9 @@ static void EnableEngineForCompany(EngineID eid, CompanyID company)
|
||||
|
||||
SetBit(e->company_avail, company);
|
||||
if (e->type == VEH_TRAIN) {
|
||||
assert(e->u.rail.railtype < RAILTYPE_END);
|
||||
c->avail_railtypes = AddDateIntroducedRailTypes(c->avail_railtypes | GetRailTypeInfo(e->u.rail.railtype)->introduces_railtypes, _date);
|
||||
c->avail_railtypes = GetCompanyRailtypes(c->index);
|
||||
} else if (e->type == VEH_ROAD) {
|
||||
assert(e->u.road.roadtype < ROADTYPE_END);
|
||||
c->avail_roadtypes = AddDateIntroducedRoadTypes(c->avail_roadtypes | GetRoadTypeInfo(e->u.road.roadtype)->introduces_roadtypes, _date);
|
||||
c->avail_roadtypes = GetCompanyRoadTypes(c->index);
|
||||
}
|
||||
|
||||
if (company == _local_company) {
|
||||
@@ -747,8 +746,14 @@ static void EnableEngineForCompany(EngineID eid, CompanyID company)
|
||||
static void DisableEngineForCompany(EngineID eid, CompanyID company)
|
||||
{
|
||||
Engine *e = Engine::Get(eid);
|
||||
Company *c = Company::Get(company);
|
||||
|
||||
ClrBit(e->company_avail, company);
|
||||
if (e->type == VEH_TRAIN) {
|
||||
c->avail_railtypes = GetCompanyRailtypes(c->index);
|
||||
} else if (e->type == VEH_ROAD) {
|
||||
c->avail_roadtypes = GetCompanyRoadTypes(c->index);
|
||||
}
|
||||
|
||||
if (company == _local_company) {
|
||||
AddRemoveEngineFromAutoreplaceAndBuildWindows(e->type);
|
||||
@@ -997,8 +1002,7 @@ static void NewVehicleAvailable(Engine *e)
|
||||
|
||||
if (e->type == VEH_TRAIN) {
|
||||
/* maybe make another rail type available */
|
||||
RailType railtype = e->u.rail.railtype;
|
||||
assert(railtype < RAILTYPE_END);
|
||||
assert(e->u.rail.railtype < RAILTYPE_END);
|
||||
for (Company *c : Company::Iterate()) c->avail_railtypes = AddDateIntroducedRailTypes(c->avail_railtypes | GetRailTypeInfo(e->u.rail.railtype)->introduces_railtypes, _date);
|
||||
} else if (e->type == VEH_ROAD) {
|
||||
/* maybe make another road type available */
|
||||
|
||||
@@ -396,6 +396,7 @@ void ShowErrorMessage(StringID summary_msg, StringID detailed_msg, WarningLevel
|
||||
|
||||
bool no_timeout = wl == WL_CRITICAL;
|
||||
|
||||
if (_game_mode == GM_BOOTSTRAP) return;
|
||||
if (_settings_client.gui.errmsg_duration == 0 && !no_timeout) return;
|
||||
|
||||
ErrorMessageData data(summary_msg, detailed_msg, no_timeout ? 0 : _settings_client.gui.errmsg_duration, x, y, textref_stack_grffile, textref_stack_size, textref_stack);
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user