1
0
mirror of https://github.com/OpenTTD/OpenTTD.git synced 2025-08-13 09:39:10 +00:00

Compare commits

..

141 Commits

Author SHA1 Message Date
Rubidium
61342620bc Doc: Prepare for 14.1 release 2024-05-03 22:47:41 +02:00
Rubidium
331bb11914 Update: Backport language changes 2024-05-03 17:06:52 +02:00
Rubidium
14f745c42d Fix 2955ff3: CMake atomic check fails due to chosen compiler 2024-05-03 17:06:52 +02:00
James Addison
fd52747faf Doc: Add Apache 2.0 licensing info for CheckAtomic.cmake (#12603) 2024-05-03 17:06:52 +02:00
Fen
3bb57d47b2 Fix 2d27e8e: Update numpad keycodes for SDL2, making it usable (#12596)
* Fix 2d27e8e: Update numpad keycodes for SDL2, making it usable

* Cleanup: List sdl2 numpad mappings individually
2024-05-03 17:06:52 +02:00
3b501b5d27 Update: Backport language changes 2024-04-30 22:03:24 +01:00
060a5c0f9f Fix: Out-of-order window set up due to deferred window resize. (#12592)
Deferred window resize was being applied to the initial window resize event, resulting in some window state (e.g. scroll bar capacity) not being initialised when expected.
2024-04-30 22:03:24 +01:00
Loïc Guilloux
b659d3a4b4 Fix #12584: Improved error handling during tar scan (#12586) 2024-04-30 22:03:24 +01:00
Jonathan G Rennison
fccb5d0a29 Fix #12509: Maintain timer sort invariants when changing period 2024-04-30 22:03:24 +01:00
Jonathan G Rennison
3d6cdc52d7 Codechange: Add a priority field to TimerGameTick::TPeriod
Use this as the primary sort key for TimerGameTick::TPeriod,
to avoid container sort order changes on timer period saveload.
See: #12509
2024-04-30 22:03:24 +01:00
17ae92c50d Fix 952d111: Houses and industry tiles could accept incorrect cargo. (#12547)
Default cargo label was not cleared (set to CT_INVALID) when using older 3-slot acceptance properties for house and industry tiles.

Missed in #12053 and #12062.
2024-04-30 22:03:24 +01:00
Rubidium
aece877960 Fix 5008706: improved scenario editor tooltips in map generation stages are out of place 2024-04-30 22:03:24 +01:00
Rubidium
1897ddec41 Fix: allow only 255 league tables, as 255 is the invalid id sentinel 2024-04-30 22:03:24 +01:00
7c529cfc4b Fix #12433: Width of unit number display was too narrow. (#12534)
Digit width was counted, but ignored the thousands separator.
2024-04-30 22:03:24 +01:00
glx22
dc7a0913d2 Update: Backport language changes 2024-04-20 15:13:59 +02:00
Tyler Trahan
10ae9a7ea1 Fix: Mark vehicle status bars dirty when a vehicle leaves unbunching depot (#12516) 2024-04-20 15:13:59 +02:00
Jonathan G Rennison
fe3a0a2418 Fix #12506: Update station/industry nearby lists in BuildOilRig (#12511) 2024-04-20 15:13:59 +02:00
Patric Stout
9e7b7a477e Codechange: improve desync documentation (#12521) 2024-04-20 15:13:59 +02:00
Patric Stout
257704ae9a Codechange: skip all commands of the past during desync replay (#12520) 2024-04-20 15:13:59 +02:00
Patric Stout
cd6946c5a8 Codechange: use infinite-fast-forward when rerunning command-log (#12519) 2024-04-20 15:13:59 +02:00
Patric Stout
151e80650f Codefix: don't send desync=0 log messages to commands.log (#12517)
They are only used during replay, and you want to see those in
the console; not in the log.
2024-04-20 15:13:59 +02:00
Patric Stout
5b0b7ba354 Codechange: record cache warnings with a "warning" prefix (#12518) 2024-04-20 15:13:59 +02:00
Tyler Trahan
fa4245dcba Fix: Don't show train waiting for unbunching as waiting for free path (#12515) 2024-04-20 15:13:59 +02:00
Tyler Trahan
b5c2357dfe Fix: Smooth outliers in unbunching round trip calculations (#12513) 2024-04-20 15:13:59 +02:00
Tyler Trahan
b64cd74a0c Codefix: Don't mix signed and unsigned ints in unbunching calculations (#12514) 2024-04-20 15:13:59 +02:00
7738d507c8 Fix c38df2d58: Use VehicleID instead of pointer in map of vehicles to replace. (#12512)
This affects the sort order, VehicleID is deterministic, Vehicle * is not.
2024-04-20 15:13:59 +02:00
Paco Esteban
bb76f2e396 Codechange: Use arc4random_buf on random_func.cpp for OpenBSD 2024-04-20 15:13:59 +02:00
Koen Bussemaker
6359d5e20c Fix #12228, Fix #12231: CheckShipReverse only restricts path when it has to 2024-04-20 15:13:59 +02:00
a69cbc3b46 Add: Check that towns can build roads before generating map. (#12503) 2024-04-20 15:13:59 +02:00
Koen Bussemaker
85a21a1654 Doc: Updated Visual Studio, cpp standard and Cmake version 2024-04-20 15:13:59 +02:00
SamuXarick
6a6ab82050 Codechange: Where the ship comes from is already known
This simplifies the handling of variables.

`ChooseShipTrack` is called upon entering `tile`, and looking further back to the caller, it can be deduced that `v->tile` matches `src_tile`. With that said, `enterdir` can also be removed, as it's not used anywhere else.

`CreateRandomPath` and `GetRandomFollowUpTrackdir` is being fed `src_tile` as it's 2nd parameter. This could be eliminated, as `v` is also being passed to it. Just use `v->tile` in those functions.
2024-04-20 15:13:59 +02:00
9baff60f66 Codefix: Remove no-longer used ship special-case. (#12192)
This special-case has not been triggered since multi-tile docks were introduced.
2024-04-20 15:13:59 +02:00
Loïc Guilloux
b3c704a630 Doc: Prepare for 14.0 release (#12490)
* Doc: Prepare for 14.0 release

* Fix: applied code review

Co-authored-by: rubidium42 <rubidium42@users.noreply.github.com>

* Fix: apply suggestion

Co-authored-by: Patric Stout <github@truebrain.nl>

* Fix: Apply suggestions from code review

Co-authored-by: Patric Stout <github@truebrain.nl>

* Fix: apply suggestions

---------

Co-authored-by: Patric Stout <github@truebrain.nl>
Co-authored-by: rubidium42 <rubidium42@users.noreply.github.com>
2024-04-13 12:28:18 +00:00
glx22
a4adab31fc Update: Backport language changes 2024-04-12 21:40:34 +02:00
2fa6d79453 Fix #12477: Use std::filesystem::rename instead of Windows Shell API call. (#12478) 2024-04-12 21:40:34 +02:00
11e6d2e3d4 Fix: Signature validation did not close its file. (#12479) 2024-04-12 21:40:34 +02:00
3425aeac85 Fix: Use clear() to clear std::string. (#12471) 2024-04-12 21:40:34 +02:00
glx22
8fd30a0a17 Update: Backport language changes 2024-04-09 23:46:14 +02:00
481736fdfd Codechange: Avoid lengthof() on std::array. 2024-04-09 23:46:14 +02:00
Rubidium
40efa94d82 Codechange: let lengthof fail when anything that isn't a C-style array is passed 2024-04-09 23:46:14 +02:00
Rubidium
6a9517a4e6 Fix: do not use lengthof() for non C-style arrays 2024-04-09 23:46:14 +02:00
774ea5676f Fix: Aircraft crash counter was too low to reach ground. (#12425)
Aircraft can float above the ground when crashed as the counter limit to reach the ground is too low.

Instead reset the counter until the aircraft reaches the ground, then continue the timer.
2024-04-09 23:46:14 +02:00
75a1bc7831 Fix #12233: Mini order list overlaps vehicle group name. (#12423)
Move mini order list down one line to make room.
2024-04-09 23:46:14 +02:00
bd6acf405b Fix #12114: Viewport coords of crashed aircraft not updated when falling. (#12424)
This results in the aircraft glitching as the wrong viewport area is drawn.
2024-04-09 23:46:14 +02:00
eb730cb7f8 Fix #12395: Ensure president name widget is tall enough. (#12419) 2024-04-09 23:46:14 +02:00
0ee151623c Fix: Segfault when using -q without providing a . character. (#12418)
Use std::filesystem::path to find extension instead of strrchr.
2024-04-09 23:46:14 +02:00
Loïc Guilloux
ee2ee15a1e Fix #12415, 9c49a61, df400ef: Aircraft::tile is valid only for front vehicle (#12416) 2024-04-09 23:46:14 +02:00
680c8c20f2 Fix a29766d: Wrong scrolling dropdown list position with RTL. (#12412) 2024-04-09 23:46:14 +02:00
glx22
cd9c9afcb6 Update: Backport language changes 2024-04-02 00:02:53 +02:00
Loïc Guilloux
273b571408 Fix: [Win32] Force font mapper to only use TrueType fonts (#12406) 2024-04-02 00:02:53 +02:00
Rubidium
48f316246c Fix: server shutdown and newgame packets should be stable
The server sends shutdown and newgame (reboot) packets to any connected client.
This can be useful, so you can tell clients that are trying to join that the
server is restarting. However, that means that packets can be sent before a
version check has been done.
So, these packets should be in the stable packet range instead of the one that
is unstable and guarded by a version check.
2024-04-02 00:02:53 +02:00
Patric Stout
6bfd2b4aa9 Remove: official support for MSVC 2019 (#12254) 2024-04-01 00:20:07 +02:00
Michael Lutz
77980fa674 Update: Backport language changes 2024-04-01 00:20:07 +02:00
Patric Stout
efd0c2f542 Cleanup 69d5b9d3: actually clean up all remnants of "no-thread" builds (#12398) 2024-04-01 00:20:07 +02:00
Patric Stout
470a3bd736 Fix: "-q" displays NewGRF IDs in the wrong byte-order (#12397) 2024-04-01 00:20:07 +02:00
frosch
72fcf8b70b Fix: [Script] ScriptSubsidy::GetExpireDate should return an economy-date (#12372) 2024-04-01 00:20:07 +02:00
Michael Lutz
f596d4c10a Fix eabb9db: Drag building of road stops should not allow mixing z levels. 2024-04-01 00:20:07 +02:00
Michael Lutz
6d3c8cc601 Fix #12387, eabb9db: [NewGRF] Wrong tile offset passed to rail station CB 149 (slope check) 2024-04-01 00:20:07 +02:00
Loïc Guilloux
2d4f0872b3 Change: [CI] Always use latest stable Xcode (#12390) 2024-04-01 00:20:07 +02:00
Jonathan G Rennison
7fcc5de374 Fix #12388: Vehicle::CopyVehicleConfigAndStatistics not releasing unit number (#12389) 2024-04-01 00:20:07 +02:00
Rubidium
3b614d0650 Fix: inconsistent check for client authorized status 2024-04-01 00:20:07 +02:00
Rubidium
ffb795e52f Fix: do not send chat to clients that have not authorized yet 2024-04-01 00:20:07 +02:00
Tyler Trahan
cdb86b6ecc Fix #12268: Capitalize "Wait to unbunch" order string (#12375) 2024-04-01 00:20:07 +02:00
d60e586925 Fix #12368: Incorrect offset for click position within industry chain window. (#12370) 2024-04-01 00:20:07 +02:00
26dc82feb1 Fix 2fd9096: Label for fruit incorrectly changed to FRUI from FRUT. (#12367) 2024-04-01 00:20:07 +02:00
940b66322c Fix: Don't let CT_INVALID map to valid cargo type. (#12364) 2024-04-01 00:20:07 +02:00
glx22
d4f704d029 Change: [Script] Use economy time for ScriptDate 2024-04-01 00:20:07 +02:00
glx22
4a3d444ad6 Revert bbdbf9a: ScriptTimeMode was not the best solution for economy/calendar support 2024-04-01 00:20:07 +02:00
Rubidium
fafb9bd035 Codechange: disable asserts for release 2024-03-31 23:29:21 +02:00
Tyler Trahan
53e9a0614e Update: New title game for 14.0 2024-03-31 23:27:51 +02:00
Rubidium
f5e49c01f6 Doc: Prepare for 14.0-RC3 release 2024-03-23 15:46:49 +01:00
Rubidium
d46a5df1dd Update: Backport language changes 2024-03-23 15:32:22 +01:00
Rubidium
5212229f94 Fix: crash to desktop when attempting to join a company while not joined (yet) 2024-03-23 15:32:22 +01:00
Jonathan G Rennison
2cc5f35871 Fix #12092: Incorrect x-axis in cargo payment graph window 2024-03-23 15:32:22 +01:00
Tyler Trahan
32a94fe3eb Change: Show unbunching action in timetable window (#12351) 2024-03-23 15:32:22 +01:00
f82e5f1107 Fix #12347: Crash attempting to find catchment tiles of a station with no catchment area. (#12348) 2024-03-23 15:32:22 +01:00
merni-ns
411fe34915 Codefix: Incorrect pluralisation in last service/service interval texts (#12352) 2024-03-23 15:32:22 +01:00
Jonathan G Rennison
5f47b472cb Codechange: Reduce size of class WaterRegion
The tile patch array is 256 bytes and is not needed for the majority
of water regions, change it to be optional via std::unique_ptr
2024-03-23 15:32:22 +01:00
Jonathan G Rennison
56d5243e4a Fix #12305: Crash with large positive sprite x offset in engine preview window 2024-03-23 15:32:22 +01:00
Tyler Trahan
17076c0c05 Fix #12342: Add missing ellipsis to town generation error string (#12343) 2024-03-23 15:32:22 +01:00
Owen Rudge
60739118b7 Change: [CI] Use Azure Code Signing for Windows build 2024-03-23 15:32:22 +01:00
34e74af1af Fix #12302: Allow empty train engines to use an invalid cargo type. (#12325)
The cargo type will be forced to the first available type (usually passengers) instead of the engine being disabled.
2024-03-23 15:32:22 +01:00
frosch
48df48832e Fix #12319, 3a676a5: Some SSE blitters were broken due to ODR violations (#12322) 2024-03-23 15:32:22 +01:00
Loïc Guilloux
31ed3d4d8a Fix #12316, 268e512: Support for enum storage type in GenerateWidget.cmake (#12321) 2024-03-23 15:32:22 +01:00
Patric Stout
add23dc58c Codefix: allow preview label on PRs against release branches too (#12310) 2024-03-23 15:32:22 +01:00
Patric Stout
06e323964a Codefix f1e999ec: use RandomRange(l) instead of _random.Next(l) (#12274) 2024-03-23 15:32:22 +01:00
Jonathan G Rennison
ef14d3e361 Fix #12166: Crash when opening tram road stop build window (#12168) 2024-03-23 15:32:22 +01:00
Kuhnovic
694d6f2072 Doc: Prepare for 14.0-RC2 release (#12248)
Co-authored-by: Michael Lutz <michi@icosahedron.de>
2024-03-16 14:45:21 +01:00
Michael Lutz
e5a886a153 Update: Backport language changes 2024-03-16 14:37:57 +01:00
Patric Stout
e8b314afc2 Add: track savegame size to report with survey (#12304) 2024-03-16 14:37:57 +01:00
SamuXarick
c947f754bf Fix #12280: Allow ships 90 degree turns if only choice
If there is no path found, a random path is created which forbids 90 degrees.
Allow 90 degrees if they're the only choice.
2024-03-16 14:37:57 +01:00
SamuXarick
fcf079e287 Fix #12279: Update random path each step (#12286) 2024-03-16 14:37:57 +01:00
Michael Lutz
3d588a1760 Update: Backport language changes 2024-03-12 00:29:50 +01:00
Richard Wheeler
c5850efce3 Change: Update OpenTTD TTF fonts to v0.6
Adds missing characters for Chuvash and Serbian translations. Adds support for combining diacritics (needed for for Cyrillic es with accent) and corrects miscoded Cyrillic es with descender.
2024-03-12 00:29:50 +01:00
Patric Stout
f057f19638 Codefix: [CI] Store vcpkg outside the repository folder (#12271) 2024-03-12 00:29:50 +01:00
adbf456fc7 Change: Use (at least) standard toolbar button size for signal selection buttons. (#12265)
Signal selection buttons could be very narrow, with a very wide spacer, depending on loaded signal types and fonts.
2024-03-12 00:29:50 +01:00
Rubidium
3ea10f81a1 Fix #12255: inconsistent punctuation in English 2024-03-12 00:29:50 +01:00
Patric Stout
b4e656c253 Codechange: [CI] switch to arm64 for MacOS builds (#12242)
This creates more variety in our CI builds, increasing the odds
of us finding issues.
2024-03-12 00:29:50 +01:00
Michael Lutz
072e0b3d5e Update: Backport language changes 2024-03-11 20:40:57 +01:00
Loïc Guilloux
c8f9e6085b Fix ab315d0: Don't show "insert order" errors in the console (#12245) 2024-03-11 20:40:57 +01:00
rubidium42
f2d0fa5065 Revert #11606: Don't auto-build past tunnelbridge ends
This reverts commit 59f6c199bf.
2024-03-11 20:40:57 +01:00
Patric Stout
0ca581dde6 Change: [CI] switch MacOS to the macos-14 runner (#12237)
This runner contains a newer XCode, with better C++20 support.
2024-03-11 20:40:57 +01:00
Tyler Trahan
a3ce25b487 Fix #12010: Use economy timer for vehicle stats minimum age, not calendar (#12142) 2024-03-11 20:40:57 +01:00
Patric Stout
b4f72e6ce6 Codechange: [CI] manually install vcpkg for all targets (#12241)
From macos-14, vcpkg is no longer installed on the runner-image.
It stands to reason that this will also roll out to new images
for other OSes. To be pre-emptive about it, start using our own
cloned vcpkg for all targets.
2024-03-11 20:40:57 +01:00
Tyler Trahan
79f0bfe75e Fix #12118: When adding an unbunching order, properly check for unsafe conditions (#12136) 2024-03-11 20:40:57 +01:00
Patric Stout
2d270e65bf Codechange: [CI] use "cargo install --locked" to use pinned dependency versions (#12243)
Normally "cargo install" will use the latest dependencies, but
this causes an issue with "dump_syms". Use "--locked" makes sure
we use the dependency versions as indicated by "dump_syms", instead
of the latest version.
2024-03-11 20:40:57 +01:00
glx22
2b7e5e7ae5 Change: [Script] Match FormatString behaviour more closely 2024-03-11 20:40:57 +01:00
glx22
a5e73aac9f Fix 0858377: [Script] Don't output parameters more than once 2024-03-11 20:40:57 +01:00
Kuhnovic
df5e183461 Fix #12236: Ship pathfinder causes crash when ship is already at destination (#12238) 2024-03-11 20:40:57 +01:00
Kuhnovic
110925b6a8 Update: Developer credits (#12235) (#12235) 2024-03-11 20:40:57 +01:00
Tyler Trahan
935a2e5d53 Fix #12203: When unbunching at a depot, don't overlook implicit orders (#12220) 2024-03-11 20:40:57 +01:00
merni-ns
5176d586df Fix #12134: Use correct error messages if clearing drive-through road stops fails (#12139) 2024-03-11 20:40:57 +01:00
rubidium42
280c24143f Codefix #12162, 3105d0b: Textbuf::Assign read beyond std::string_view (#12177) 2024-03-11 20:40:57 +01:00
Loïc Guilloux
eeb655d52d Fix #12225, 977aba7: [Script] Missing AI:ResetConfig support for running AI config (#12226) 2024-03-11 20:40:57 +01:00
Loïc Guilloux
af17e6538d Remove: [Script] random_deviation from setting description table (#12221) 2024-03-11 20:40:57 +01:00
Kuhnovic
450296897f Fix #12176: Ships are circling in one place (#12181) 2024-03-11 20:40:57 +01:00
Jonathan G Rennison
24d31d4dfe Fix #12154: Incorrect calendar day lengths with minutes per year setting (#12158) 2024-03-11 20:40:57 +01:00
Patric Stout
21b4e6d348 Fix #12147: reset all saved settings to their default before loading a game (#12210) 2024-03-11 20:40:57 +01:00
Rubidium
8ecb465bc0 Fix #12076: Do not allow 'join' command on dedicated servers 2024-03-11 20:40:57 +01:00
Loïc Guilloux
a3eb42cd68 Fix #12195: Reset cursor when no Object is selected (#12207) 2024-03-11 20:40:57 +01:00
Loïc Guilloux
c15af03b69 Codechange: Don't use NOT_REACHED() when catching unhandled thread exceptions (#12199) 2024-03-11 20:40:57 +01:00
Tyler Trahan
b6a7b299a6 Fix f6dd505: Only reset unbunching departure data in the correct depot (#12155) 2024-03-11 20:40:57 +01:00
Patric Stout
0f65bef04d Fix #12196: disable "select upgrade" button when filtering 2024-03-11 20:40:57 +01:00
Patric Stout
34dda9e81a Fix #12196: always show selected content, even when filtering 2024-03-11 20:40:57 +01:00
Tyler Trahan
fb30e46a7e Update: Developer credits (#12173) 2024-03-11 20:40:57 +01:00
Loïc Guilloux
6353d3637e Fix f6dd505: Missing savegame conversion for current_order (#12188) 2024-03-11 20:40:57 +01:00
Loïc Guilloux
d970d238e1 Fix bf4b6696: [Script] Broken ScriptText circular reference detection (#12187) 2024-03-11 20:40:57 +01:00
Patric Stout
30716c476f Fix: initialize _switch_mode_time so crash-logs before first game have a realistic time (#12184) 2024-03-11 20:40:57 +01:00
b64ad26068 Change: Use bitmap for free unit ID generation. (#12165)
This improves performance of finding the next free unit number for a vehicle.

Based loosely on pool's used slot bitmap.
2024-03-11 20:40:57 +01:00
9d0c548f55 Fix d3c673e: Don't defer OnResize() after ReInit() (#12174)
Some windows resize themselves during painting and issue ReInit(). In this case deferred OnResize() causes a visible glitch as the event is handled on the next redraw.
2024-03-11 20:40:57 +01:00
Tyler Trahan
5b9aa5f176 Fix fd9e72a: Helptext for timekeeping unit setting erroneously refers to vehicle movement (#12172) 2024-03-11 20:40:57 +01:00
frosch
57e6ef244a Fix #12127, 555a379: Truncation ellipses rendered shadows even for black font without shadows (#12132) 2024-03-11 20:40:57 +01:00
Rubidium
66b71bdcc4 Revert #11993: new number format system does not and cannot work for CJK languages
There are too many intricacies that I am unaware of that are popping up after
asking whether things are right or not.
I do not want to keep playing whack-a-mole, so just revert the whole thing.

This reverts:
15be383b93
360fe8b0b6
1aa9a5c0ab
59f56941e5
7e2eefb91f
b741b2ba6f
609d0071d5
9f8fd80112
a253205b93
819c6c756e
2024-03-11 20:40:57 +01:00
Rubidium
2064750e19 Fix #12148, fca8166: Do not draw decimals when number of digits is 0 2024-03-11 20:40:57 +01:00
Jonathan G Rennison
b17f979fde Fix #12145: Incorrect date handling in date cheat in wallclock time-keeping mode 2024-03-11 20:40:57 +01:00
Jonathan G Rennison
09a342b4b4 Codefix: Off by one in TimerGameEconomy::ConvertDateToYMD wallclock mode 2024-03-11 20:40:57 +01:00
merni-ns
cfd519f265 Fix #12119: Remove red warning text when maximum loan is zero 2024-03-11 20:40:57 +01:00
Jonathan G Rennison
7457a0b7a6 Fix cb588d8d: Ordering of command per tick limit and pause mode filtering (#12126)
The command per tick limit should be applied after the pause mode filter
2024-03-11 20:40:57 +01:00
Loïc Guilloux
7258551016 Fix #12133: [Script] Don't crash when emergency saving (#12138) 2024-03-11 20:40:57 +01:00
Loïc Guilloux
1d55af92e4 Fix: [Script] Only show debug script window at the end of savegame loading (#12135) 2024-03-11 20:40:57 +01:00
Rubidium
af5c38469e Doc: Prepare for 14.0-RC1 release 2024-02-18 21:42:06 +01:00
1421 changed files with 102154 additions and 115738 deletions

View File

@@ -14,7 +14,3 @@ notifications:
pull-request:
issue:
tag-created:
workflow-run:
only:
- .github/workflows/release.yml
- .github/workflows/ci-nightly.yml

View File

@@ -50,6 +50,7 @@ Describe here
Some things are not automated, and forgotten often. This list is a reminder for the reviewers.
* The bug fix is important enough to be backported? (label: 'backport requested')
* This PR touches english.txt or translations? Check the [guidelines](https://github.com/OpenTTD/OpenTTD/blob/master/docs/eints.md)
* This PR affects the save game format? (label 'savegame upgrade')
* This PR affects the GS/AI API? (label 'needs review: Script API')
* ai_changelog.hpp, game_changelog.hpp need updating.
* The compatibility wrappers (compat_*.nut) need updating.

36
.github/changelog.py vendored
View File

@@ -1,36 +0,0 @@
import sys
"""
This script assumes changelogs use the following format:
## <major>.x (eg. "## 15.x") to indicate a major version series
### <major>.<minor>[-<suffix>] <date etc> (eg. "## 15.0 (2025-04-01)", "### 15.1-beta1 (2024-12-25)") to indicate an individual version
"""
def main():
current_version = sys.argv[1]
stable_version = current_version.split("-")[0]
major_version = current_version.split(".")[0]
# set when current version is found
current_found = False
with open("changelog.md", "r") as file:
for line in file:
if line.startswith("### "):
if not line.startswith(f"### {current_version} ") and not current_found:
# First version in changelog should be the current one
sys.stderr.write(f"Changelog doesn't start with current version ({current_version})\n")
sys.exit(1)
if not line.startswith(f"### {stable_version}"):
# Reached a previous stable version
break
if line.startswith(f"### {current_version} "):
current_found = True
elif line.startswith("## "):
if not line.startswith(f"## {major_version}.x"):
# Reached a previous major version
break
print(line.rstrip())
if __name__ == '__main__':
main()

16
.github/changelog.sh vendored Executable file
View File

@@ -0,0 +1,16 @@
#!/bin/sh
tag=$(git name-rev --name-only --tags --no-undefined HEAD 2>/dev/null | sed 's@\^0$@@')
# If we are a tag, show the part of the changelog till (but excluding) the last stable
if [ -n "$tag" ]; then
grep='^[0-9]\+\.[0-9]\+[^-]'
next=$(cat changelog.txt | grep '^[0-9]' | awk 'BEGIN { show="false" } // { if (show=="true") print $0; if ($1=="'$tag'") show="true"} ' | grep "$grep" | head -n1 | sed 's/ .*//')
cat changelog.txt | awk 'BEGIN { show="false" } /^[0-9]+.[0-9]+/ { if ($1=="'$next'") show="false"; if ($1=="'$tag'") show="true";} // { if (show=="true") print $0 }'
exit 0
fi
# In all other cases, show the git log of the last 7 days
revdate=$(git log -1 --pretty=format:"%ci")
last_week=$(date -d "$revdate -7days" +"%Y-%m-%d %H:%M")
git log --after="${last_week}" --pretty=fuller

View File

@@ -39,6 +39,7 @@ def read_language_file(filename, strings_found, errors):
skip = SkipType.NONE
length = 0
common_prefix = ""
last_tiny_string = ""
with open(filename) as fp:
for line in fp.readlines():
@@ -113,6 +114,17 @@ def read_language_file(filename, strings_found, errors):
name = line.split(":")[0].strip()
strings_defined.append(name)
# If a string ends on _TINY or _SMALL, it can be the {TINY} variant.
# Check for this by some fuzzy matching.
if name.endswith(("_SMALL", "_TINY")):
last_tiny_string = name
elif last_tiny_string:
matching_name = "_".join(last_tiny_string.split("_")[:-1])
if name == matching_name:
strings_found.add(last_tiny_string)
else:
last_tiny_string = ""
if skip == SkipType.EXTERNAL:
strings_found.add(name)
skip = SkipType.LENGTH
@@ -158,7 +170,7 @@ def scan_source_files(path, strings_found):
# Most files we can just open, but some use magic, that requires the
# G++ preprocessor before we can make sense out of it.
if new_path == "src/table/cargo_const.h":
p = subprocess.run(["g++", "-E", "-DCHECK_UNUSED_STRINGS", new_path], stdout=subprocess.PIPE)
p = subprocess.run(["g++", "-E", new_path], stdout=subprocess.PIPE)
output = p.stdout.decode()
else:
with open(new_path) as fp:

View File

@@ -1,4 +1,4 @@
name: CI - Build
name: CI
on:
pull_request:
@@ -17,22 +17,79 @@ jobs:
emscripten:
name: Emscripten
uses: ./.github/workflows/ci-emscripten.yml
secrets: inherit
runs-on: ubuntu-20.04
container:
# If you change this version, change the number in the cache step too.
image: emscripten/emsdk:3.1.42
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup cache
uses: actions/cache@v4
with:
path: /emsdk/upstream/emscripten/cache
key: 3.1.42-${{ runner.os }}
- name: Patch Emscripten to support LZMA
run: |
cd /emsdk/upstream/emscripten
patch -p1 < ${GITHUB_WORKSPACE}/os/emscripten/emsdk-liblzma.patch
- name: Build (host tools)
run: |
mkdir build-host
cd build-host
echo "::group::CMake"
cmake .. -DOPTION_TOOLS_ONLY=ON
echo "::endgroup::"
echo "::group::Build"
echo "Running on $(nproc) cores"
cmake --build . -j $(nproc) --target tools
echo "::endgroup::"
- name: Install GCC problem matcher
uses: ammaraskar/gcc-problem-matcher@master
- name: Build
run: |
mkdir build
cd build
echo "::group::CMake"
emcmake cmake .. -DHOST_BINARY_DIR=../build-host
echo "::endgroup::"
echo "::group::Build"
echo "Running on $(nproc) cores"
cmake --build . -j $(nproc) --target openttd
echo "::endgroup::"
linux:
strategy:
fail-fast: false
matrix:
include:
- name: Clang
compiler: clang
cxxcompiler: clang++
- name: Clang - Debug
compiler: clang-15
cxxcompiler: clang++-15
libraries: libsdl2-dev
- name: Clang - Release
compiler: clang-15
cxxcompiler: clang++-15
libraries: libsdl2-dev
extra-cmake-parameters: -DCMAKE_BUILD_TYPE=RelWithDebInfo -DOPTION_USE_ASSERTS=OFF
- name: GCC - SDL2
compiler: gcc
cxxcompiler: g++
libraries: libsdl2-dev
- name: GCC - SDL1.2
compiler: gcc
cxxcompiler: g++
libraries: libsdl1.2-dev
- name: GCC - Dedicated
compiler: gcc
cxxcompiler: g++
@@ -42,54 +99,332 @@ jobs:
name: Linux (${{ matrix.name }})
uses: ./.github/workflows/ci-linux.yml
secrets: inherit
runs-on: ubuntu-latest
env:
CC: ${{ matrix.compiler }}
CXX: ${{ matrix.cxxcompiler }}
with:
compiler: ${{ matrix.compiler }}
cxxcompiler: ${{ matrix.cxxcompiler }}
libraries: ${{ matrix.libraries }}
extra-cmake-parameters: ${{ matrix.extra-cmake-parameters }}
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup vcpkg caching
uses: actions/github-script@v7
with:
script: |
core.exportVariable('ACTIONS_CACHE_URL', process.env.ACTIONS_CACHE_URL || '');
core.exportVariable('ACTIONS_RUNTIME_TOKEN', process.env.ACTIONS_RUNTIME_TOKEN || '');
core.exportVariable('VCPKG_BINARY_SOURCES', 'clear;x-gha,readwrite')
- name: Install vcpkg
run: |
git clone https://github.com/microsoft/vcpkg
./vcpkg/bootstrap-vcpkg.sh -disableMetrics
- name: Install dependencies
run: |
echo "::group::Update apt"
sudo apt-get update
echo "::endgroup::"
echo "::group::Install dependencies"
sudo apt-get install -y --no-install-recommends \
liballegro4-dev \
libcurl4-openssl-dev \
libfontconfig-dev \
libharfbuzz-dev \
libicu-dev \
liblzma-dev \
liblzo2-dev \
${{ matrix.libraries }} \
zlib1g-dev \
# EOF
echo "::group::Install vcpkg dependencies"
# Disable vcpkg integration, as we mostly use system libraries.
mv vcpkg.json vcpkg-disabled.json
# We only use breakpad from vcpkg, as its CMake files
# are a bit special. So the Ubuntu's variant doesn't work.
./vcpkg/vcpkg install breakpad
echo "::endgroup::"
env:
DEBIAN_FRONTEND: noninteractive
- name: Get OpenGFX
run: |
mkdir -p ~/.local/share/openttd/baseset
cd ~/.local/share/openttd/baseset
echo "::group::Download OpenGFX"
curl -L https://cdn.openttd.org/opengfx-releases/0.6.0/opengfx-0.6.0-all.zip -o opengfx-all.zip
echo "::endgroup::"
echo "::group::Unpack OpenGFX"
unzip opengfx-all.zip
echo "::endgroup::"
rm -f opengfx-all.zip
- name: Install GCC problem matcher
uses: ammaraskar/gcc-problem-matcher@master
- name: Build
run: |
mkdir build
cd build
echo "::group::CMake"
cmake .. -DCMAKE_TOOLCHAIN_FILE=${GITHUB_WORKSPACE}/vcpkg/scripts/buildsystems/vcpkg.cmake ${{ matrix.extra-cmake-parameters }}
echo "::endgroup::"
echo "::group::Build"
echo "Running on $(nproc) cores"
cmake --build . -j $(nproc)
echo "::endgroup::"
- name: Test
run: |
(
cd build
ctest -j $(nproc) --timeout 120
)
# Re-enable vcpkg.
mv vcpkg-disabled.json vcpkg.json
# Check no tracked files have been modified.
git diff --exit-code
macos:
strategy:
fail-fast: false
matrix:
include:
- name: arm64 - Debug
arch: arm64
- arch: arm64
full_arch: arm64
extra-cmake-parameters: -DCMAKE_BUILD_TYPE=Debug
- name: arm64 - Release
arch: arm64
full_arch: arm64
extra-cmake-parameters: -DCMAKE_BUILD_TYPE=RelWithDebInfo -DOPTION_USE_ASSERTS=OFF
name: Mac OS (${{ matrix.name }})
name: Mac OS (${{ matrix.arch }})
uses: ./.github/workflows/ci-macos.yml
secrets: inherit
runs-on: macos-14
env:
MACOSX_DEPLOYMENT_TARGET: 10.13
with:
arch: ${{ matrix.arch }}
full_arch: ${{ matrix.full_arch }}
extra-cmake-parameters: ${{ matrix.extra-cmake-parameters }}
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup vcpkg caching
uses: actions/github-script@v7
with:
script: |
core.exportVariable('ACTIONS_CACHE_URL', process.env.ACTIONS_CACHE_URL || '');
core.exportVariable('ACTIONS_RUNTIME_TOKEN', process.env.ACTIONS_RUNTIME_TOKEN || '');
core.exportVariable('VCPKG_BINARY_SOURCES', 'clear;x-gha,readwrite')
- name: Install vcpkg
run: |
git clone https://github.com/microsoft/vcpkg
./vcpkg/bootstrap-vcpkg.sh -disableMetrics
- name: Install OpenGFX
run: |
mkdir -p ~/Documents/OpenTTD/baseset
cd ~/Documents/OpenTTD/baseset
echo "::group::Download OpenGFX"
curl -L https://cdn.openttd.org/opengfx-releases/0.6.0/opengfx-0.6.0-all.zip -o opengfx-all.zip
echo "::endgroup::"
echo "::group::Unpack OpenGFX"
unzip opengfx-all.zip
echo "::endgroup::"
rm -f opengfx-all.zip
- name: Install GCC problem matcher
uses: ammaraskar/gcc-problem-matcher@master
- name: Build
run: |
mkdir build
cd build
echo "::group::CMake"
cmake .. \
-DCMAKE_OSX_ARCHITECTURES=${{ matrix.full_arch }} \
-DVCPKG_TARGET_TRIPLET=${{ matrix.arch }}-osx \
-DCMAKE_TOOLCHAIN_FILE=${GITHUB_WORKSPACE}/vcpkg/scripts/buildsystems/vcpkg.cmake \
# EOF
echo "::endgroup::"
echo "::group::Build"
echo "Running on $(sysctl -n hw.logicalcpu) cores"
cmake --build . -j $(sysctl -n hw.logicalcpu)
echo "::endgroup::"
- name: Test
run: |
cd build
ctest -j $(sysctl -n hw.logicalcpu) --timeout 120
windows:
strategy:
fail-fast: false
matrix:
os: [windows-latest]
arch: [x86, x64]
name: Windows (${{ matrix.os }} / ${{ matrix.arch }})
runs-on: ${{ matrix.os }}
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup vcpkg caching
uses: actions/github-script@v7
with:
script: |
core.exportVariable('ACTIONS_CACHE_URL', process.env.ACTIONS_CACHE_URL || '');
core.exportVariable('ACTIONS_RUNTIME_TOKEN', process.env.ACTIONS_RUNTIME_TOKEN || '');
core.exportVariable('VCPKG_BINARY_SOURCES', 'clear;x-gha,readwrite')
- name: Install vcpkg
run: |
git clone https://github.com/microsoft/vcpkg
.\vcpkg\bootstrap-vcpkg.bat -disableMetrics
- name: Install OpenGFX
shell: bash
run: |
mkdir -p "C:/Users/Public/Documents/OpenTTD/baseset"
cd "C:/Users/Public/Documents/OpenTTD/baseset"
echo "::group::Download OpenGFX"
curl -L https://cdn.openttd.org/opengfx-releases/0.6.0/opengfx-0.6.0-all.zip -o opengfx-all.zip
echo "::endgroup::"
echo "::group::Unpack OpenGFX"
unzip opengfx-all.zip
echo "::endgroup::"
rm -f opengfx-all.zip
- name: Install MSVC problem matcher
uses: ammaraskar/msvc-problem-matcher@master
- name: Configure developer command prompt for ${{ matrix.arch }}
uses: ilammy/msvc-dev-cmd@v1
with:
arch: ${{ matrix.arch }}
- name: Build
shell: bash
env:
NINJA_STATUS: "[%f/%t -- %e] " # [finished_edges/total_edges -- elapsed_time], default value is "[%f/%t] "
run: |
mkdir build
cd build
echo "::group::CMake"
cmake .. \
-GNinja \
-DVCPKG_TARGET_TRIPLET=${{ matrix.arch }}-windows-static \
-DCMAKE_TOOLCHAIN_FILE="${GITHUB_WORKSPACE}\vcpkg\scripts\buildsystems\vcpkg.cmake" \
# EOF
echo "::endgroup::"
echo "::group::Build"
cmake --build .
echo "::endgroup::"
- name: Test
shell: bash
run: |
cd build
ctest --timeout 120
msys2:
strategy:
fail-fast: false
matrix:
include:
- arch: x86
- arch: x64
- msystem: MINGW64
arch: x86_64
- msystem: MINGW32
arch: i686
name: Windows (${{ matrix.arch }})
name: MinGW (${{ matrix.arch }})
uses: ./.github/workflows/ci-windows.yml
secrets: inherit
runs-on: windows-latest
with:
arch: ${{ matrix.arch }}
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup MSYS2
uses: msys2/setup-msys2@v2
with:
msystem: ${{ matrix.msystem }}
release: false
install: >-
git
make
mingw-w64-${{ matrix.arch }}-cmake
mingw-w64-${{ matrix.arch }}-gcc
mingw-w64-${{ matrix.arch }}-lzo2
mingw-w64-${{ matrix.arch }}-libpng
mingw-w64-${{ matrix.arch }}-lld
mingw-w64-${{ matrix.arch }}-ninja
- name: Install OpenGFX
shell: bash
run: |
mkdir -p "C:/Users/Public/Documents/OpenTTD/baseset"
cd "C:/Users/Public/Documents/OpenTTD/baseset"
echo "::group::Download OpenGFX"
curl -L https://cdn.openttd.org/opengfx-releases/0.6.0/opengfx-0.6.0-all.zip -o opengfx-all.zip
echo "::endgroup::"
echo "::group::Unpack OpenGFX"
unzip opengfx-all.zip
echo "::endgroup::"
rm -f opengfx-all.zip
- name: Install GCC problem matcher
uses: ammaraskar/gcc-problem-matcher@master
- name: Build
shell: msys2 {0}
env:
NINJA_STATUS: "[%f/%t -- %e] " # [finished_edges/total_edges -- elapsed_time], default value is "[%f/%t] "
run: |
mkdir build
cd build
echo "::group::CMake"
cmake .. \
-GNinja \
-DCMAKE_CXX_FLAGS="-fuse-ld=lld" \
# EOF
echo "::endgroup::"
echo "::group::Build"
cmake --build .
echo "::endgroup::"
- name: Test
shell: msys2 {0}
run: |
cd build
ctest --timeout 120
check_annotations:
name: Check Annotations
@@ -98,6 +433,7 @@ jobs:
- linux
- macos
- windows
- msys2
if: always() && github.event_name == 'pull_request'

View File

@@ -1,75 +0,0 @@
name: CI (Emscripten)
on:
workflow_call:
env:
CTEST_OUTPUT_ON_FAILURE: 1
jobs:
emscripten:
name: CI
runs-on: ubuntu-latest
container:
# If you change this version, change the numbers in the cache step,
# .github/workflows/preview-build.yml (2x) and os/emscripten/Dockerfile too.
image: emscripten/emsdk:3.1.57
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Fix dubious ownership
run: |
git config --global --add safe.directory ${GITHUB_WORKSPACE}
- name: Update to modern GCC
run: |
apt-get update
apt-get install -y gcc-12 g++-12
update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-12 100
update-alternatives --install /usr/bin/g++ g++ /usr/bin/g++-12 100
- name: Setup cache
uses: actions/cache@v4
with:
# If you change this version, change the numbers in the image configuration step,
# .github/workflows/preview-build.yml (2x) and os/emscripten/Dockerfile too.
path: /emsdk/upstream/emscripten/cache
key: 3.1.57-${{ runner.os }}
- name: Add liblzma support
run: |
cp ${GITHUB_WORKSPACE}/os/emscripten/ports/liblzma.py /emsdk/upstream/emscripten/tools/ports/contrib/
- name: Build (host tools)
run: |
mkdir build-host
cd build-host
echo "::group::CMake"
cmake .. -DOPTION_TOOLS_ONLY=ON
echo "::endgroup::"
echo "::group::Build"
echo "Running on $(nproc) cores"
cmake --build . -j $(nproc) --target tools
echo "::endgroup::"
- name: Install GCC problem matcher
uses: ammaraskar/gcc-problem-matcher@master
- name: Build
run: |
mkdir build
cd build
echo "::group::CMake"
emcmake cmake .. -DHOST_BINARY_DIR=../build-host
echo "::endgroup::"
echo "::group::Build"
echo "Running on $(nproc) cores"
cmake --build . -j $(nproc) --target openttd
echo "::endgroup::"

View File

@@ -1,126 +0,0 @@
name: CI (Linux)
on:
workflow_call:
inputs:
compiler:
required: true
type: string
cxxcompiler:
required: true
type: string
libraries:
required: true
type: string
extra-cmake-parameters:
required: true
type: string
env:
CTEST_OUTPUT_ON_FAILURE: 1
jobs:
linux:
name: CI
runs-on: ubuntu-24.04
env:
CC: ${{ inputs.compiler }}
CXX: ${{ inputs.cxxcompiler }}
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup vcpkg caching
uses: actions/github-script@v7
with:
script: |
core.exportVariable('ACTIONS_CACHE_URL', process.env.ACTIONS_CACHE_URL || '');
core.exportVariable('ACTIONS_RUNTIME_TOKEN', process.env.ACTIONS_RUNTIME_TOKEN || '');
core.exportVariable('VCPKG_BINARY_SOURCES', 'clear;x-gha,readwrite')
- name: Install vcpkg
run: |
git clone https://github.com/microsoft/vcpkg ${{ runner.temp }}/vcpkg
${{ runner.temp }}/vcpkg/bootstrap-vcpkg.sh -disableMetrics
- name: Install dependencies
run: |
echo "::group::Update apt"
sudo apt-get update
echo "::endgroup::"
echo "::group::Install dependencies"
sudo apt-get install -y --no-install-recommends \
liballegro4-dev \
libcurl4-openssl-dev \
libfontconfig-dev \
libharfbuzz-dev \
libicu-dev \
liblzma-dev \
liblzo2-dev \
libogg-dev \
libopus-dev \
libopusfile-dev \
${{ inputs.libraries }} \
zlib1g-dev \
# EOF
echo "::group::Install vcpkg dependencies"
# Disable vcpkg integration, as we mostly use system libraries.
mv vcpkg.json vcpkg-disabled.json
# We only use breakpad from vcpkg, as its CMake files
# are a bit special. So the Ubuntu's variant doesn't work.
${{ runner.temp }}/vcpkg/vcpkg install breakpad
echo "::endgroup::"
env:
DEBIAN_FRONTEND: noninteractive
- name: Get OpenGFX
run: |
mkdir -p ~/.local/share/openttd/baseset
cd ~/.local/share/openttd/baseset
echo "::group::Download OpenGFX"
curl -L https://cdn.openttd.org/opengfx-releases/0.6.0/opengfx-0.6.0-all.zip -o opengfx-all.zip
echo "::endgroup::"
echo "::group::Unpack OpenGFX"
unzip opengfx-all.zip
echo "::endgroup::"
rm -f opengfx-all.zip
- name: Install GCC problem matcher
uses: ammaraskar/gcc-problem-matcher@master
- name: Build
run: |
mkdir build
cd build
echo "::group::CMake"
cmake .. -DCMAKE_TOOLCHAIN_FILE=${{ runner.temp }}/vcpkg/scripts/buildsystems/vcpkg.cmake ${{ inputs.extra-cmake-parameters }}
echo "::endgroup::"
echo "::group::Build"
echo "Running on $(nproc) cores"
cmake --build . -j $(nproc)
echo "::endgroup::"
- name: Test
run: |
(
cd build
ctest -j $(nproc) --timeout 120
)
# Re-enable vcpkg.
mv vcpkg-disabled.json vcpkg.json
# Check no tracked files have been modified.
git diff --exit-code

View File

@@ -1,90 +0,0 @@
name: CI (MacOS)
on:
workflow_call:
inputs:
arch:
required: true
type: string
full_arch:
required: true
type: string
extra-cmake-parameters:
required: false
type: string
default: ""
env:
CTEST_OUTPUT_ON_FAILURE: 1
jobs:
macos:
name: CI
runs-on: macos-latest
env:
MACOSX_DEPLOYMENT_TARGET: 10.13
steps:
- name: Setup Xcode version
uses: maxim-lobanov/setup-xcode@v1
with:
xcode-version: latest-stable
- name: Checkout
uses: actions/checkout@v4
- name: Setup vcpkg caching
uses: actions/github-script@v7
with:
script: |
core.exportVariable('ACTIONS_CACHE_URL', process.env.ACTIONS_CACHE_URL || '');
core.exportVariable('ACTIONS_RUNTIME_TOKEN', process.env.ACTIONS_RUNTIME_TOKEN || '');
core.exportVariable('VCPKG_BINARY_SOURCES', 'clear;x-gha,readwrite')
- name: Install vcpkg
run: |
git clone https://github.com/microsoft/vcpkg ${{ runner.temp }}/vcpkg
${{ runner.temp }}/vcpkg/bootstrap-vcpkg.sh -disableMetrics
- name: Install OpenGFX
run: |
mkdir -p ~/Documents/OpenTTD/baseset
cd ~/Documents/OpenTTD/baseset
echo "::group::Download OpenGFX"
curl -L https://cdn.openttd.org/opengfx-releases/0.6.0/opengfx-0.6.0-all.zip -o opengfx-all.zip
echo "::endgroup::"
echo "::group::Unpack OpenGFX"
unzip opengfx-all.zip
echo "::endgroup::"
rm -f opengfx-all.zip
- name: Install GCC problem matcher
uses: ammaraskar/gcc-problem-matcher@master
- name: Build
run: |
mkdir build
cd build
echo "::group::CMake"
cmake .. \
-DCMAKE_OSX_ARCHITECTURES=${{ inputs.full_arch }} \
-DVCPKG_TARGET_TRIPLET=${{ inputs.arch }}-osx \
-DCMAKE_TOOLCHAIN_FILE=${{ runner.temp }}/vcpkg/scripts/buildsystems/vcpkg.cmake \
${{ inputs.extra-cmake-parameters }} \
# EOF
echo "::endgroup::"
echo "::group::Build"
echo "Running on $(sysctl -n hw.logicalcpu) cores"
cmake --build . -j $(sysctl -n hw.logicalcpu)
echo "::endgroup::"
- name: Test
run: |
cd build
ctest -j $(sysctl -n hw.logicalcpu) --timeout 120

View File

@@ -1,86 +0,0 @@
name: CI (MinGW)
on:
workflow_call:
inputs:
arch:
required: true
type: string
msystem:
required: true
type: string
env:
CTEST_OUTPUT_ON_FAILURE: 1
jobs:
mingw:
name: CI
runs-on: windows-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup MSYS2
uses: msys2/setup-msys2@v2
with:
msystem: ${{ inputs.msystem }}
release: false
install: >-
git
make
mingw-w64-${{ inputs.arch }}-cmake
mingw-w64-${{ inputs.arch }}-gcc
mingw-w64-${{ inputs.arch }}-lzo2
mingw-w64-${{ inputs.arch }}-libpng
mingw-w64-${{ inputs.arch }}-lld
mingw-w64-${{ inputs.arch }}-ninja
mingw-w64-${{ inputs.arch }}-libogg
mingw-w64-${{ inputs.arch }}-opus
mingw-w64-${{ inputs.arch }}-opusfile
- name: Install OpenGFX
shell: bash
run: |
mkdir -p "C:/Users/Public/Documents/OpenTTD/baseset"
cd "C:/Users/Public/Documents/OpenTTD/baseset"
echo "::group::Download OpenGFX"
curl -L https://cdn.openttd.org/opengfx-releases/0.6.0/opengfx-0.6.0-all.zip -o opengfx-all.zip
echo "::endgroup::"
echo "::group::Unpack OpenGFX"
unzip opengfx-all.zip
echo "::endgroup::"
rm -f opengfx-all.zip
- name: Install GCC problem matcher
uses: ammaraskar/gcc-problem-matcher@master
- name: Build
shell: msys2 {0}
env:
NINJA_STATUS: "[%f/%t -- %e] " # [finished_edges/total_edges -- elapsed_time], default value is "[%f/%t] "
run: |
mkdir build
cd build
echo "::group::CMake"
cmake .. \
-GNinja \
-DCMAKE_CXX_FLAGS="-fuse-ld=lld" \
# EOF
echo "::endgroup::"
echo "::group::Build"
cmake --build .
echo "::endgroup::"
- name: Test
shell: msys2 {0}
run: |
cd build
ctest --timeout 120

View File

@@ -1,60 +0,0 @@
name: CI - Nightly
on:
schedule:
- cron: '0 3 * * *'
workflow_dispatch:
env:
CTEST_OUTPUT_ON_FAILURE: 1
jobs:
macos:
strategy:
fail-fast: false
matrix:
include:
- arch: x64
full_arch: x86_64
name: Mac OS (${{ matrix.arch }})
uses: ./.github/workflows/ci-macos.yml
secrets: inherit
with:
arch: ${{ matrix.arch }}
full_arch: ${{ matrix.full_arch }}
mingw:
strategy:
fail-fast: false
matrix:
include:
- msystem: MINGW64
arch: x86_64
- msystem: MINGW32
arch: i686
name: MinGW (${{ matrix.arch }})
uses: ./.github/workflows/ci-mingw.yml
secrets: inherit
with:
msystem: ${{ matrix.msystem }}
arch: ${{ matrix.arch }}
check_annotations:
name: Check Annotations
needs:
- macos
- mingw
if: always()
runs-on: ubuntu-latest
steps:
- name: Check annotations
uses: OpenTTD/actions/annotation-check@v5

View File

@@ -1,84 +0,0 @@
name: CI (Windows)
on:
workflow_call:
inputs:
arch:
required: true
type: string
env:
CTEST_OUTPUT_ON_FAILURE: 1
jobs:
windows:
name: CI
runs-on: windows-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup vcpkg caching
uses: actions/github-script@v7
with:
script: |
core.exportVariable('ACTIONS_CACHE_URL', process.env.ACTIONS_CACHE_URL || '');
core.exportVariable('ACTIONS_RUNTIME_TOKEN', process.env.ACTIONS_RUNTIME_TOKEN || '');
core.exportVariable('VCPKG_BINARY_SOURCES', 'clear;x-gha,readwrite')
- name: Install vcpkg
run: |
git clone https://github.com/microsoft/vcpkg ${{ runner.temp }}\vcpkg
${{ runner.temp }}\vcpkg\bootstrap-vcpkg.bat -disableMetrics
- name: Install OpenGFX
shell: bash
run: |
mkdir -p "C:/Users/Public/Documents/OpenTTD/baseset"
cd "C:/Users/Public/Documents/OpenTTD/baseset"
echo "::group::Download OpenGFX"
curl -L https://cdn.openttd.org/opengfx-releases/0.6.0/opengfx-0.6.0-all.zip -o opengfx-all.zip
echo "::endgroup::"
echo "::group::Unpack OpenGFX"
unzip opengfx-all.zip
echo "::endgroup::"
rm -f opengfx-all.zip
- name: Install MSVC problem matcher
uses: ammaraskar/msvc-problem-matcher@master
- name: Configure developer command prompt for ${{ inputs.arch }}
uses: ilammy/msvc-dev-cmd@v1
with:
arch: ${{ inputs.arch }}
- name: Build
shell: bash
env:
NINJA_STATUS: "[%f/%t -- %e] " # [finished_edges/total_edges -- elapsed_time], default value is "[%f/%t] "
run: |
mkdir build
cd build
echo "::group::CMake"
cmake .. \
-GNinja \
-DVCPKG_TARGET_TRIPLET=${{ inputs.arch }}-windows-static \
-DCMAKE_TOOLCHAIN_FILE="${{ runner.temp }}\vcpkg\scripts\buildsystems\vcpkg.cmake" \
# EOF
echo "::endgroup::"
echo "::group::Build"
cmake --build .
echo "::endgroup::"
- name: Test
shell: bash
run: |
cd build
ctest --timeout 120

View File

@@ -26,19 +26,6 @@ jobs:
- name: Checkout
uses: actions/checkout@v4
- name: Setup vcpkg caching
uses: actions/github-script@v7
with:
script: |
core.exportVariable('ACTIONS_CACHE_URL', process.env.ACTIONS_CACHE_URL || '');
core.exportVariable('ACTIONS_RUNTIME_TOKEN', process.env.ACTIONS_RUNTIME_TOKEN || '');
core.exportVariable('VCPKG_BINARY_SOURCES', 'clear;x-gha,readwrite')
- name: Install vcpkg
run: |
git clone https://github.com/microsoft/vcpkg ${{ runner.temp }}/vcpkg
${{ runner.temp }}/vcpkg/bootstrap-vcpkg.sh -disableMetrics
- name: Install dependencies
run: |
echo "::group::Update apt"
@@ -54,49 +41,25 @@ jobs:
libicu-dev \
liblzma-dev \
liblzo2-dev \
libopus-dev \
libopusfile-dev \
libsdl2-dev \
zlib1g-dev \
# EOF
echo "::group::Install vcpkg dependencies"
# Disable vcpkg integration, as we mostly use system libraries.
mv vcpkg.json vcpkg-disabled.json
# We only use breakpad from vcpkg, as its CMake files
# are a bit special. So the Ubuntu's variant doesn't work.
${{ runner.temp }}/vcpkg/vcpkg install breakpad
echo "::endgroup::"
env:
DEBIAN_FRONTEND: noninteractive
- name: Prepare build
- name: Set number of make jobs
run: |
mkdir build
cd build
echo "::group::CMake"
cmake .. -DCMAKE_TOOLCHAIN_FILE=${{ runner.temp }}/vcpkg/scripts/buildsystems/vcpkg.cmake
echo "::endgroup::"
echo "MAKEFLAGS=-j$(nproc)" >> $GITHUB_ENV
- name: Initialize CodeQL
uses: github/codeql-action/init@v3
with:
languages: cpp
config-file: ./.github/codeql/codeql-config.yml
trap-caching: false
- name: Build
run: |
cd build
echo "::group::Build"
echo "Running on $(nproc) cores"
cmake --build . -j $(nproc)
echo "::endgroup::"
- name: Autobuild
uses: github/codeql-action/autobuild@v3
- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v3

View File

@@ -20,9 +20,8 @@ jobs:
runs-on: ubuntu-latest
container:
# If you change this version, change the numbers in the cache step,
# .github/workflows/ci-emscripten.yml (2x) and os/emscripten/Dockerfile too.
image: emscripten/emsdk:3.1.57
# If you change this version, change the number in the cache step too.
image: emscripten/emsdk:3.1.42
steps:
- name: Checkout
@@ -35,24 +34,16 @@ jobs:
git config --global --add safe.directory ${GITHUB_WORKSPACE}
git checkout -b pr${{ github.event.pull_request.number }}
- name: Update to modern GCC
run: |
apt-get update
apt-get install -y gcc-12 g++-12
update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-12 100
update-alternatives --install /usr/bin/g++ g++ /usr/bin/g++-12 100
- name: Setup cache
uses: actions/cache@v4
with:
path: /emsdk/upstream/emscripten/cache
# If you change this version, change the numbers in the image configuration step,
# .github/workflows/ci-emscripten.yml (2x) and os/emscripten/Dockerfile too.
key: 3.1.57-${{ runner.os }}
key: 3.1.42-${{ runner.os }}
- name: Add liblzma support
- name: Patch Emscripten to support LZMA
run: |
cp ${GITHUB_WORKSPACE}/os/emscripten/ports/liblzma.py /emsdk/upstream/emscripten/tools/ports/contrib/
cd /emsdk/upstream/emscripten
patch -p1 < ${GITHUB_WORKSPACE}/os/emscripten/emsdk-liblzma.patch
- name: Build (host tools)
run: |

View File

@@ -1,19 +0,0 @@
name: "Update 'work: needs rebase' label status"
on:
# So that PRs touching the same files as the push are updated
push:
# So that the `dirtyLabel` is removed if conflicts are resolve
# We recommend `pull_request_target` so that github secrets are available.
# In `pull_request` we wouldn't be able to change labels of fork PRs
pull_request_target:
types: [synchronize]
jobs:
main:
runs-on: ubuntu-latest
steps:
- name: check if prs are in need of a rebase
uses: eps1lon/actions-label-merge-conflict@v3
with:
dirtyLabel: "work: needs rebase"
repoToken: "${{ secrets.GITHUB_TOKEN }}"

View File

@@ -11,7 +11,7 @@ jobs:
docs:
name: Docs
runs-on: ubuntu-latest
runs-on: ubuntu-20.04
steps:
- name: Download source

View File

@@ -71,10 +71,10 @@ jobs:
# dependencies as possible. We do it before anything else is installed,
# to make sure it doesn't pick up on any of the drivers.
echo "::group::Install fluidsynth"
wget https://github.com/FluidSynth/fluidsynth/archive/v2.4.4.tar.gz
tar xf v2.4.4.tar.gz
wget https://github.com/FluidSynth/fluidsynth/archive/v2.3.3.tar.gz
tar xf v2.3.3.tar.gz
(
cd fluidsynth-2.4.4
cd fluidsynth-2.3.3
mkdir build
cd build
cmake .. -DCMAKE_BUILD_TYPE=RelWithDebInfo -DCMAKE_INSTALL_PREFIX=/usr

View File

@@ -12,7 +12,7 @@ jobs:
macos:
name: MacOS
runs-on: macos-latest
runs-on: macos-14
env:
MACOSX_DEPLOYMENT_TARGET: 10.13
@@ -86,7 +86,7 @@ jobs:
echo "::endgroup::"
- name: Import code signing certificates
uses: Apple-Actions/import-codesign-certs@v5
uses: Apple-Actions/import-codesign-certs@v2
with:
# The certificates in a PKCS12 file encoded as a base64 string
p12-file-base64: ${{ secrets.APPLE_DEVELOPER_CERTIFICATE_P12_BASE64 }}

View File

@@ -18,7 +18,7 @@ jobs:
source:
name: Source
runs-on: ubuntu-latest
runs-on: ubuntu-20.04
outputs:
version: ${{ steps.metadata.outputs.version }}
@@ -90,10 +90,10 @@ jobs:
- name: Generate metadata
id: metadata
shell: bash
run: |
echo "::group::Prepare metadata files"
cmake -DGENERATE_OTTDREV=1 -P cmake/scripts/FindVersion.cmake
./.github/changelog.sh > .changelog
TZ='UTC' date +"%Y-%m-%d %H:%M UTC" > .release_date
cat .ottdrev | cut -f 1 -d$'\t' > .version
@@ -103,8 +103,6 @@ jobs:
FOLDER="${{ env.FOLDER_RELEASES }}"
TRIGGER_TYPE="new-tag"
python3 ./.github/changelog.py "$(cat .version)" > .changelog
else
IS_TAG="false"
@@ -126,17 +124,10 @@ jobs:
FOLDER="${{ env.FOLDER_BRANCHES }}/${BRANCH}"
TRIGGER_TYPE="new-branch"
fi
# For nightlies / branches, use the git log of the last 7 days as changelog.
revdate=$(git log -1 --pretty=format:"%ci")
last_week=$(date -d "$revdate -7days" +"%Y-%m-%d %H:%M")
echo "## Version $(cat .version) - changes since ${last_week}" > .changelog
echo "" >> .changelog
git log --oneline --after="${last_week}" >> .changelog
fi
mkdir -p build/bundles
cp .changelog build/bundles/changelog.md
cp .changelog build/bundles/changelog.txt
cp .release_date build/bundles/released.txt
cp README.md build/bundles/README.md
echo "::endgroup::"

View File

@@ -11,7 +11,7 @@ jobs:
upload:
name: Upload (GOG)
runs-on: ubuntu-latest
runs-on: ubuntu-20.04
steps:
- name: Download source
@@ -62,10 +62,9 @@ jobs:
echo "::group::Unpack OpenGFX"
unzip opengfx-all.zip
tar xf opengfx-*.tar
echo "::endgroup::"
rm -f opengfx-all.zip opengfx-*.tar
rm -f opengfx-all.zip
- name: Install OpenMSX
shell: bash
@@ -77,7 +76,7 @@ jobs:
curl -L https://cdn.openttd.org/openmsx-releases/0.4.2/openmsx-0.4.2-all.zip -o openmsx-all.zip
echo "::endgroup::"
echo "::group::Unpack OpenMSX"
echo "::group::Unpack OpenGFX"
unzip openmsx-all.zip
tar xf openmsx-*.tar
echo "::endgroup::"

View File

@@ -14,7 +14,7 @@ jobs:
upload:
name: Upload (Steam)
runs-on: ubuntu-latest
runs-on: ubuntu-20.04
steps:
- name: Download source

View File

@@ -1,11 +1,11 @@
cmake_minimum_required(VERSION 3.17)
cmake_minimum_required(VERSION 3.16)
if(NOT BINARY_NAME)
set(BINARY_NAME openttd)
endif()
project(${BINARY_NAME}
VERSION 15.0
VERSION 14.0
LANGUAGES CXX
)
@@ -51,6 +51,9 @@ set(CMAKE_EXPORT_COMPILE_COMMANDS YES)
# An empty target for the tools
add_custom_target(tools)
include(Endian)
add_endian_definition()
include(CompileFlags)
compile_flags()
@@ -132,26 +135,26 @@ endif()
# Breakpad doesn't support emscripten.
if(NOT EMSCRIPTEN)
find_package(unofficial-breakpad NO_MODULE)
find_package(unofficial-breakpad)
endif()
if(NOT OPTION_DEDICATED)
if(WIN32)
find_package(Xaudio2)
else()
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)
if(Freetype_FOUND)
find_package(Fontconfig)
endif()
find_package(Harfbuzz)
find_package(ICU OPTIONAL_COMPONENTS i18n uc)
find_package(ICU OPTIONAL_COMPONENTS i18n)
endif()
endif()
find_package(OpusFile)
endif()
if(APPLE)
enable_language(OBJCXX)
@@ -173,6 +176,7 @@ if(MSVC)
endif()
find_package(SSE)
find_package(Xaudio2)
find_package(Grfcodec)
@@ -182,8 +186,8 @@ check_ipo_supported(RESULT IPO_FOUND)
show_options()
if(UNIX AND NOT APPLE AND NOT OPTION_DEDICATED)
if(NOT SDL2_FOUND AND NOT ALLEGRO_FOUND)
message(FATAL_ERROR "SDL2 or Allegro 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()
if(HARFBUZZ_FOUND AND NOT ICU_i18n_FOUND)
message(WARNING "HarfBuzz depends on ICU i18n to function; HarfBuzz will be disabled")
@@ -231,6 +235,8 @@ endif()
include(CTest)
include(SourceList)
# Needed by rev.cpp
include_directories(${CMAKE_SOURCE_DIR}/src)
# Needed by everything that uses Squirrel
include_directories(${CMAKE_SOURCE_DIR}/src/3rdparty/squirrel/include)
@@ -260,7 +266,6 @@ target_precompile_headers(openttd_lib
src/stdafx.h
src/core/format.hpp
)
set_source_files_properties(src/3rdparty/fmt/format.cc PROPERTIES SKIP_PRECOMPILE_HEADERS ON)
add_subdirectory(${CMAKE_SOURCE_DIR}/bin)
add_subdirectory(${CMAKE_SOURCE_DIR}/src)
@@ -300,6 +305,7 @@ if(IPO_FOUND)
set_target_properties(openttd PROPERTIES INTERPROCEDURAL_OPTIMIZATION_RELWITHDEBINFO True)
endif()
set_target_properties(openttd PROPERTIES VS_DEBUGGER_WORKING_DIRECTORY "${CMAKE_BINARY_DIR}")
process_compile_flags()
include(LinkPackage)
link_package(PNG TARGET PNG::PNG ENCOURAGED)
@@ -313,19 +319,18 @@ if(NOT WIN32 AND NOT EMSCRIPTEN)
endif()
if(NOT EMSCRIPTEN)
link_package(unofficial-breakpad TARGET unofficial::breakpad::libbreakpad_client)
link_package(unofficial-breakpad TARGET unofficial::breakpad::libbreakpad_client ENCOURAGED)
endif()
if(NOT OPTION_DEDICATED)
link_package(Fluidsynth)
link_package(SDL)
link_package(SDL2 TARGET SDL2::SDL2)
link_package(Allegro)
link_package(FREETYPE TARGET Freetype::Freetype)
link_package(Fontconfig TARGET Fontconfig::Fontconfig)
link_package(Harfbuzz TARGET harfbuzz::harfbuzz)
link_package(ICU_i18n)
link_package(ICU_uc)
link_package(OpusFile TARGET OpusFile::opusfile)
if(SDL2_FOUND AND OPENGL_FOUND AND UNIX)
# SDL2 dynamically loads OpenGL if needed, so do not link to OpenGL when
@@ -383,14 +388,13 @@ if(EMSCRIPTEN)
target_link_libraries(WASM::WASM INTERFACE "--preload-file ${CMAKE_SOURCE_DIR}/CREDITS.md@/CREDITS.md")
target_link_libraries(WASM::WASM INTERFACE "--preload-file ${CMAKE_SOURCE_DIR}/CONTRIBUTING.md@/CONTRIBUTING.md")
target_link_libraries(WASM::WASM INTERFACE "--preload-file ${CMAKE_SOURCE_DIR}/COPYING.md@/COPYING.md")
target_link_libraries(WASM::WASM INTERFACE "--preload-file ${CMAKE_SOURCE_DIR}/known-bugs.md@/known-bugs.md")
target_link_libraries(WASM::WASM INTERFACE "--preload-file ${CMAKE_SOURCE_DIR}/changelog.md@/changelog.md")
target_link_libraries(WASM::WASM INTERFACE "--preload-file ${CMAKE_SOURCE_DIR}/known-bugs.txt@/known-bugs.txt")
target_link_libraries(WASM::WASM INTERFACE "--preload-file ${CMAKE_SOURCE_DIR}/changelog.txt@/changelog.txt")
target_link_libraries(WASM::WASM INTERFACE "--preload-file ${CMAKE_SOURCE_DIR}/docs/admin_network.md@/docs/admin_network.md")
target_link_libraries(WASM::WASM INTERFACE "--preload-file ${CMAKE_SOURCE_DIR}/docs/debugging_desyncs.md@/docs/debugging_desyncs.md")
target_link_libraries(WASM::WASM INTERFACE "--preload-file ${CMAKE_SOURCE_DIR}/docs/desync.md@/docs/desync.md")
target_link_libraries(WASM::WASM INTERFACE "--preload-file ${CMAKE_SOURCE_DIR}/docs/directory_structure.md@/docs/directory_structure.md")
target_link_libraries(WASM::WASM INTERFACE "--preload-file ${CMAKE_SOURCE_DIR}/docs/eints.md@/docs/eints.md")
target_link_libraries(WASM::WASM INTERFACE "--preload-file ${CMAKE_SOURCE_DIR}/docs/fonts.md@/docs/fonts.md")
target_link_libraries(WASM::WASM INTERFACE "--preload-file ${CMAKE_SOURCE_DIR}/docs/linkgraph.md@/docs/linkgraph.md")
target_link_libraries(WASM::WASM INTERFACE "--preload-file ${CMAKE_SOURCE_DIR}/docs/logging_and_performance_metrics.md@/docs/logging_and_performance_metrics.md")
target_link_libraries(WASM::WASM INTERFACE "--preload-file ${CMAKE_SOURCE_DIR}/docs/multiplayer.md@/docs/multiplayer.md")

View File

@@ -10,8 +10,6 @@ What is simple to some might appear very complicated to others. Documentation he
* Function names use [CamelCase](http://www.wikipedia.org/wiki/Camelcase) without underscores.
* Opening curly bracket **{** for a function starts on the next line.
* Use Foo() instead of Foo(void).
* Prefer using "const" for reference and compound parameters when appropriate.
* If a member function can be a const function, make it so.
```c++
void ThisIsAFunction()
{
@@ -159,7 +157,7 @@ enum SomeEnumeration {
* Use curly braces and put the contained statements on their own lines (e.g., don't put them directly after the **if**).
* Opening curly bracket **{** stays on the first line, closing curly bracket **}** gets a line to itself (except for the **}** preceding an **else**, which should be on the same line as the **else**).
* When only a single statement is contained, the brackets can be omitted. In this case, put the single statement on the same line as the preceding keyword (**if**, **while**, etc.). Note that this is only allowed for if statements without an **else** clause.
* Non-trivial fall throughs must be documented, using a `[[fallthrough]]` attribute.
* All fall throughs must be documented, using a **FALLTHROUGH** define/macro.
* The NOT_REACHED() macro can be used in default constructs that should never be reached.
* Unconditional loops are written with **`for (;;) {`**
@@ -182,7 +180,7 @@ switch (a) {
case 1:
DoSomething();
[[fallthrough]];
FALLTHROUGH;
case 2:
DoMore();
@@ -193,7 +191,7 @@ switch (a) {
int r = 2;
DoEvenMore(a);
[[fallthrough]];
FALLTHROUGH;
}
case 4: {
@@ -250,50 +248,17 @@ Templates are a very powerful C++ tool, but they can easily confuse beginners. T
* Templates are to be documented in a very clear and verbose manner. Never assume anything in the documentation.
* the template keyword and the template layout get a separate line. typenames are either "T" or preceded by a "T", integers get a single capital letter or a descriptive name preceded by "T".
```c++
template <typename T, typename Tsomething, int N, uint8_t Tnumber_of_something>
template <typename T, typename Tsomething, int N, byte Tnumber_of_something>
int Func();
```
* If you are writing one or more template class in the dedicated header file, use file.hpp for its name instead of file.h. This will let others know that it is template library (includes also implementation), not just header with declarations.
### Code Comment Vertical Alignment
When adding code or comments to an existing formatted section, follow the existing style if possible without editing the preexisting lines.
If your addition cannot be aligned with existing code, do not align the comments with anything and use only a single space between the code and the comment.
Good:
```c++
enum Vehicle {
BUS, ///< Take the bus.
+ CAR, ///< Drive your car.
BIKE, ///< Ride your bike
+ TRAIN, ///< Catch the train.
}
```
"Car" is shorter than Bike which allows you to easily align the new comment. "Train" is longer. It is *NOT* desirable to change the vertical comment alignment of this enum.
Bad:
```c++
enum Vehicle {
- BUS, ///< Take the bus.
- BIKE, ///< Ride your bike
+ BUS, ///< Take the bus.
+ CAR, ///< Drive your car.
+ BIKE, ///< Ride your bike
+ TRAIN, ///< Catch the train.
}
```
OpenTTD used to vertically-align inline Doxygen comments as shown above. OpenTTD has since stopped strictly following this rule to keep diffs smaller and reduce pollution to the git blame history for non-functional changes.
### Other important rules
* Put a space before and after binary operators: "a + b", "a == b", "a & b", "a <<= b", etc.. Exceptions are ".", "->" and "[]" (no spaces) and "," (just space after it).
* Put parenthesis where it improves readability: "*(b++)" instead of "*b++", and "if ((a & b) && c == 2)" instead of "if (a & b && c == 2)".
* Do not put external declarations in implementation (i.e. cpp) files.
* Use const where possible.
* Do not typedef enums and structs.
* Don't treat non-flags as flags: use "if (char_pointer != nullptr && *char_pointer != '\0')", not "if (char_pointer && *char_pointer)".
* Use "free(p)" instead of "if (p != nullptr) free(p)". "free(nullptr)" doesn't hurt anyone.
@@ -483,7 +448,7 @@ Do not mention two keywords; if two apply, pick one that best represents the com
The `<details>` part starts with a capital and does not end with a dot.
Try to be descriptive to what the player will notice, not to what is actually being changed in the code.
See `changelog.md` for inspiration.
See `changelog.txt` for inspiration.
To further structure the changelog, you can add components. Example are:
* "Network" for network specific changes.

View File

@@ -12,7 +12,6 @@
- Remko Bijker (Rubidium) - Coder and way more (since 0.4.5)
- Patric Stout (TrueBrain) - NoProgrammer (since 0.3), sys op
- Tyler Trahan (2TallTyler) - General / Time Lord (since 13)
- Richard Wheeler (zephyris) - Precision pixel production (since 15)
### Inactive Developers:

View File

@@ -3,8 +3,6 @@
# 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/>.
# Doxyfile 1.9.4
#---------------------------------------------------------------------------
# Project related configuration options
#---------------------------------------------------------------------------
@@ -15,7 +13,6 @@ PROJECT_BRIEF =
PROJECT_LOGO =
OUTPUT_DIRECTORY = ${CPACK_BINARY_DIR}/docs/source/
CREATE_SUBDIRS = YES
CREATE_SUBDIRS_LEVEL = 8
ALLOW_UNICODE_NAMES = NO
OUTPUT_LANGUAGE = English
BRIEF_MEMBER_DESC = YES
@@ -38,10 +35,8 @@ STRIP_FROM_PATH = ./
STRIP_FROM_INC_PATH =
SHORT_NAMES = NO
JAVADOC_AUTOBRIEF = YES
JAVADOC_BANNER = NO
QT_AUTOBRIEF = NO
MULTILINE_CPP_IS_BRIEF = NO
PYTHON_DOCSTRING = YES
INHERIT_DOCS = YES
SEPARATE_MEMBER_PAGES = NO
TAB_SIZE = 2
@@ -50,7 +45,6 @@ OPTIMIZE_OUTPUT_FOR_C = YES
OPTIMIZE_OUTPUT_JAVA = NO
OPTIMIZE_FOR_FORTRAN = NO
OPTIMIZE_OUTPUT_VHDL = NO
OPTIMIZE_OUTPUT_SLICE = NO
EXTENSION_MAPPING =
MARKDOWN_SUPPORT = YES
TOC_INCLUDE_HEADINGS = 0
@@ -66,19 +60,16 @@ INLINE_GROUPED_CLASSES = NO
INLINE_SIMPLE_STRUCTS = NO
TYPEDEF_HIDES_STRUCT = NO
LOOKUP_CACHE_SIZE = 0
NUM_PROC_THREADS = 1
#---------------------------------------------------------------------------
# Build related configuration options
#---------------------------------------------------------------------------
EXTRACT_ALL = NO
EXTRACT_PRIVATE = YES
EXTRACT_PRIV_VIRTUAL = NO
EXTRACT_PACKAGE = NO
EXTRACT_STATIC = YES
EXTRACT_LOCAL_CLASSES = YES
EXTRACT_LOCAL_METHODS = YES
EXTRACT_ANON_NSPACES = YES
RESOLVE_UNNAMED_PARAMS = YES
HIDE_UNDOC_MEMBERS = NO
HIDE_UNDOC_CLASSES = NO
HIDE_FRIEND_COMPOUNDS = NO
@@ -87,7 +78,6 @@ INTERNAL_DOCS = NO
CASE_SENSE_NAMES = YES
HIDE_SCOPE_NAMES = NO
HIDE_COMPOUND_REFERENCE= NO
SHOW_HEADERFILE = YES
SHOW_INCLUDE_FILES = YES
SHOW_GROUPED_MEMB_INC = NO
FORCE_LOCAL_INCLUDES = NO
@@ -117,11 +107,9 @@ QUIET = NO
WARNINGS = YES
WARN_IF_UNDOCUMENTED = YES
WARN_IF_DOC_ERROR = YES
WARN_IF_INCOMPLETE_DOC = YES
WARN_NO_PARAMDOC = NO
WARN_AS_ERROR = NO
WARN_FORMAT = "$file:$line: $text"
WARN_LINE_FORMAT = "at line $line of file $file"
WARN_LOGFILE =
#---------------------------------------------------------------------------
# Configuration options related to the input files
@@ -162,10 +150,6 @@ REFERENCES_LINK_SOURCE = YES
SOURCE_TOOLTIPS = YES
USE_HTAGS = NO
VERBATIM_HEADERS = YES
CLANG_ASSISTED_PARSING = NO
CLANG_ADD_INC_PATHS = YES
CLANG_OPTIONS =
CLANG_DATABASE_PATH =
#---------------------------------------------------------------------------
# Configuration options related to the alphabetical class index
#---------------------------------------------------------------------------
@@ -191,7 +175,6 @@ HTML_DYNAMIC_SECTIONS = NO
HTML_INDEX_NUM_ENTRIES = 100
GENERATE_DOCSET = NO
DOCSET_FEEDNAME = "Doxygen generated docs"
DOCSET_FEEDURL =
DOCSET_BUNDLE_ID = org.doxygen.Project
DOCSET_PUBLISHER_ID = org.doxygen.Publisher
DOCSET_PUBLISHER_NAME = Publisher
@@ -214,17 +197,12 @@ GENERATE_ECLIPSEHELP = NO
ECLIPSE_DOC_ID = org.doxygen.Project
DISABLE_INDEX = NO
GENERATE_TREEVIEW = YES
FULL_SIDEBAR = NO
ENUM_VALUES_PER_LINE = 4
TREEVIEW_WIDTH = 250
EXT_LINKS_IN_WINDOW = NO
OBFUSCATE_EMAILS = YES
HTML_FORMULA_FORMAT = png
FORMULA_FONTSIZE = 10
FORMULA_TRANSPARENT = YES
FORMULA_MACROFILE =
USE_MATHJAX = NO
MATHJAX_VERSION = MathJax_2
MATHJAX_FORMAT = HTML-CSS
MATHJAX_RELPATH = https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.2/
MATHJAX_EXTENSIONS =
@@ -243,7 +221,6 @@ GENERATE_LATEX = NO
LATEX_OUTPUT = latex
LATEX_CMD_NAME = latex
MAKEINDEX_CMD_NAME = makeindex
LATEX_MAKEINDEX_CMD = makeindex
COMPACT_LATEX = NO
PAPER_TYPE = a4
EXTRA_PACKAGES =
@@ -255,9 +232,9 @@ PDF_HYPERLINKS = NO
USE_PDFLATEX = NO
LATEX_BATCHMODE = NO
LATEX_HIDE_INDICES = NO
LATEX_SOURCE_CODE = NO
LATEX_BIB_STYLE = plain
LATEX_TIMESTAMP = NO
LATEX_EMOJI_DIRECTORY =
#---------------------------------------------------------------------------
# Configuration options related to the RTF output
#---------------------------------------------------------------------------
@@ -267,6 +244,7 @@ COMPACT_RTF = NO
RTF_HYPERLINKS = NO
RTF_STYLESHEET_FILE =
RTF_EXTENSIONS_FILE =
RTF_SOURCE_CODE = NO
#---------------------------------------------------------------------------
# Configuration options related to the man page output
#---------------------------------------------------------------------------
@@ -281,12 +259,12 @@ MAN_LINKS = NO
GENERATE_XML = NO
XML_OUTPUT = xml
XML_PROGRAMLISTING = YES
XML_NS_MEMB_FILE_SCOPE = NO
#---------------------------------------------------------------------------
# Configuration options related to the DOCBOOK output
#---------------------------------------------------------------------------
GENERATE_DOCBOOK = NO
DOCBOOK_OUTPUT = docbook
DOCBOOK_PROGRAMLISTING = NO
#---------------------------------------------------------------------------
# Configuration options for the AutoGen Definitions output
#---------------------------------------------------------------------------
@@ -310,7 +288,7 @@ INCLUDE_FILE_PATTERNS =
PREDEFINED = WITH_ZLIB \
WITH_LZO \
WITH_LIBLZMA \
WITH_SDL2 \
WITH_SDL \
WITH_PNG \
WITH_FONTCONFIG \
WITH_FREETYPE \
@@ -333,6 +311,7 @@ EXTERNAL_PAGES = YES
#---------------------------------------------------------------------------
# Configuration options related to the dot tool
#---------------------------------------------------------------------------
CLASS_DIAGRAMS = YES
DIA_PATH =
HIDE_UNDOC_RELATIONS = YES
HAVE_DOT = NO
@@ -345,8 +324,6 @@ COLLABORATION_GRAPH = YES
GROUP_GRAPHS = YES
UML_LOOK = NO
UML_LIMIT_NUM_FIELDS = 10
DOT_UML_DETAILS = NO
DOT_WRAP_THRESHOLD = 17
TEMPLATE_RELATIONS = NO
INCLUDE_GRAPH = YES
INCLUDED_BY_GRAPH = YES
@@ -354,7 +331,6 @@ CALL_GRAPH = NO
CALLER_GRAPH = NO
GRAPHICAL_HIERARCHY = YES
DIRECTORY_GRAPH = YES
DIR_GRAPH_MAX_DEPTH = 1
DOT_IMAGE_FORMAT = png
INTERACTIVE_SVG = NO
DOT_PATH =

View File

@@ -37,10 +37,12 @@ Both 'stable' and 'nightly' versions are available for download:
OpenTTD is also available for free on [Steam](https://store.steampowered.com/app/1536610/OpenTTD/), [GOG.com](https://www.gog.com/game/openttd), and the [Microsoft Store](https://www.microsoft.com/p/openttd-official/9ncjg5rvrr1c). On some platforms OpenTTD will be available via your OS package manager or a similar service.
## 1.2) OpenTTD gameplay manual
OpenTTD has a [community-maintained wiki](https://wiki.openttd.org/), including a gameplay manual and tips.
## 1.3) Supported platforms
OpenTTD has been ported to several platforms and operating systems.
@@ -54,7 +56,6 @@ The currently supported platforms are:
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.
We'll keep support going on old platforms as long as someone is interested in supporting them, except where it means the project can't move forward to keep up with language and compiler features.
@@ -71,6 +72,7 @@ For some platforms these will be downloaded during the installation process if r
For some platforms, you will need to refer to [the installation guide](https://wiki.openttd.org/en/Manual/Installation).
### 1.4.1) Free graphics and sound files
The free data files, split into OpenGFX for graphics, OpenSFX for sounds and
@@ -83,6 +85,7 @@ OpenMSX for music can be found at:
Please follow the readme of these packages about the installation procedure.
The Windows installer can optionally download and install these packages.
### 1.4.2) Original Transport Tycoon Deluxe graphics and sound files
If you want to play with the original Transport Tycoon Deluxe data files you have to copy the data files from the CD-ROM into the baseset/ directory.
@@ -97,6 +100,7 @@ You need to copy the following files:
- trgir.grf or TRGI.GRF
- trgtr.grf or TRGT.GRF
### 1.4.3) Original Transport Tycoon Deluxe music
If you want the Transport Tycoon Deluxe music, copy the appropriate files from the original game into the baseset folder.
@@ -104,6 +108,7 @@ If you want the Transport Tycoon Deluxe music, copy the appropriate files from t
- TTD for DOS: The GM.CAT file
- Transport Tycoon Original: The GM.CAT file, but rename it to GM-TTO.CAT
## 1.5) Add-on content / mods
OpenTTD features multiple types of add-on content, which modify gameplay in different ways.
@@ -112,6 +117,7 @@ Most types of add-on content can be downloaded within OpenTTD via the 'Check Onl
Add-on content can also be installed manually, but that's more complicated; the [OpenTTD wiki](https://wiki.openttd.org/) may offer help with that, or the [OpenTTD directory structure guide](./docs/directory_structure.md).
### 1.5.1) Social Integration
OpenTTD has the ability to load plugins to integrate with Social Platforms like Steam, Discord, etc.
@@ -120,6 +126,7 @@ To enable such integration, the plugin for the specific platform has to be downl
See [OpenTTD's website](https://www.openttd.org), under Downloads, for what plugins are available.
### 1.6) OpenTTD directories
OpenTTD uses its own directory structure to store game data, add-on content etc.
@@ -130,6 +137,7 @@ For more information, see the [directory structure guide](./docs/directory_struc
If you want to compile OpenTTD from source, instructions can be found in [COMPILING.md](./COMPILING.md).
## 2.0) Contact and Community
'Official' channels
@@ -152,10 +160,12 @@ You can play OpenTTD with others, either cooperatively or competitively.
See the [multiplayer documentation](./docs/multiplayer.md) for more details.
### 2.2) Contributing to OpenTTD
We welcome contributors to OpenTTD. More information for contributors can be found in [CONTRIBUTING.md](./CONTRIBUTING.md)
### 2.3) Reporting bugs
Good bug reports are very helpful. We have a [guide to reporting bugs](./CONTRIBUTING.md#bug-reports) to help with this.
@@ -163,10 +173,12 @@ Good bug reports are very helpful. We have a [guide to reporting bugs](./CONTRI
Desyncs in multiplayer are complex to debug and report (some software development skils are required).
Instructions can be found in [debugging and reporting desyncs](./docs/debugging_desyncs.md).
### 2.4) Translating
OpenTTD is translated into many languages. Translations are added and updated via the [online translation tool](https://translator.openttd.org).
## 3.0) Licensing
OpenTTD is licensed under the GNU General Public License version 2.0.
@@ -203,6 +215,6 @@ See `src/3rdparty/openttd_social_integration_api/LICENSE` for the complete licen
The atomic datatype support detection in `cmake/3rdparty/llvm/CheckAtomic.cmake` is licensed under the Apache 2.0 license.
See `cmake/3rdparty/llvm/LICENSE.txt` for the complete license text.
## 4.0) Credits
## 4.0 Credits
See [CREDITS.md](./CREDITS.md)

View File

@@ -5,8 +5,7 @@
* 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/>.
*/
/* This file contains code to downgrade the API from 1.0 to 0.7. */
AILog.Info("0.7 API compatibility in effect:");
AILog.Info(" - AITown::GetLastMonthProduction's behaviour has slightly changed.");
AILog.Info(" - AISubsidy::GetDestination returns STATION_INVALID for awarded subsidies.");
AILog.Info(" - AISubsidy::GetSource returns STATION_INVALID for awarded subsidies.");
@@ -96,158 +95,158 @@ AIEngine.IsValidEngine <- function(engine_id)
return AIEngine.IsBuildable(engine_id);
}
AIEngine.GetNameCompat0_7 <- AIEngine.GetName;
AIEngine._GetName <- AIEngine.GetName;
AIEngine.GetName <- function(engine_id)
{
if (!AIEngine.IsBuildable(engine_id)) return null;
return AIEngine.GetNameCompat0_7(engine_id);
return AIEngine._GetName(engine_id);
}
AIEngine.GetCargoTypeCompat0_7 <- AIEngine.GetCargoType;
AIEngine._GetCargoType <- AIEngine.GetCargoType;
AIEngine.GetCargoType <- function(engine_id)
{
if (!AIEngine.IsBuildable(engine_id)) return 255;
return AIEngine.GetCargoTypeCompat0_7(engine_id);
return AIEngine._GetCargoType(engine_id);
}
AIEngine.CanRefitCargoCompat0_7 <- AIEngine.CanRefitCargo;
AIEngine._CanRefitCargo <- AIEngine.CanRefitCargo;
AIEngine.CanRefitCargo <- function(engine_id, cargo_id)
{
if (!AIEngine.IsBuildable(engine_id)) return false;
return AIEngine.CanRefitCargoCompat0_7(engine_id, cargo_id);
return AIEngine._CanRefitCargo(engine_id, cargo_id);
}
AIEngine.CanPullCargoCompat0_7 <- AIEngine.CanPullCargo;
AIEngine._CanPullCargo <- AIEngine.CanPullCargo;
AIEngine.CanPullCargo <- function(engine_id, cargo_id)
{
if (!AIEngine.IsBuildable(engine_id)) return false;
return AIEngine.CanPullCargoCompat0_7(engine_id, cargo_id);
return AIEngine._CanPullCargo(engine_id, cargo_id);
}
AIEngine.GetCapacityCompat0_7 <- AIEngine.GetCapacity;
AIEngine._GetCapacity <- AIEngine.GetCapacity;
AIEngine.GetCapacity <- function(engine_id)
{
if (!AIEngine.IsBuildable(engine_id)) return -1;
return AIEngine.GetCapacityCompat0_7(engine_id);
return AIEngine._GetCapacity(engine_id);
}
AIEngine.GetReliabilityCompat0_7 <- AIEngine.GetReliability;
AIEngine._GetReliability <- AIEngine.GetReliability;
AIEngine.GetReliability <- function(engine_id)
{
if (!AIEngine.IsBuildable(engine_id)) return -1;
return AIEngine.GetReliabilityCompat0_7(engine_id);
return AIEngine._GetReliability(engine_id);
}
AIEngine.GetMaxSpeedCompat0_7 <- AIEngine.GetMaxSpeed;
AIEngine._GetMaxSpeed <- AIEngine.GetMaxSpeed;
AIEngine.GetMaxSpeed <- function(engine_id)
{
if (!AIEngine.IsBuildable(engine_id)) return -1;
return AIEngine.GetMaxSpeedCompat0_7(engine_id);
return AIEngine._GetMaxSpeed(engine_id);
}
AIEngine.GetPriceCompat0_7 <- AIEngine.GetPrice;
AIEngine._GetPrice <- AIEngine.GetPrice;
AIEngine.GetPrice <- function(engine_id)
{
if (!AIEngine.IsBuildable(engine_id)) return -1;
return AIEngine.GetPriceCompat0_7(engine_id);
return AIEngine._GetPrice(engine_id);
}
AIEngine.GetMaxAgeCompat0_7 <- AIEngine.GetMaxAge;
AIEngine._GetMaxAge <- AIEngine.GetMaxAge;
AIEngine.GetMaxAge <- function(engine_id)
{
if (!AIEngine.IsBuildable(engine_id)) return -1;
return AIEngine.GetMaxAgeCompat0_7(engine_id);
return AIEngine._GetMaxAge(engine_id);
}
AIEngine.GetRunningCostCompat0_7 <- AIEngine.GetRunningCost;
AIEngine._GetRunningCost <- AIEngine.GetRunningCost;
AIEngine.GetRunningCost <- function(engine_id)
{
if (!AIEngine.IsBuildable(engine_id)) return -1;
return AIEngine.GetRunningCostCompat0_7(engine_id);
return AIEngine._GetRunningCost(engine_id);
}
AIEngine.GetPowerCompat0_7 <- AIEngine.GetPower;
AIEngine._GetPower <- AIEngine.GetPower;
AIEngine.GetPower <- function(engine_id)
{
if (!AIEngine.IsBuildable(engine_id)) return -1;
return AIEngine.GetPowerCompat0_7(engine_id);
return AIEngine._GetPower(engine_id);
}
AIEngine.GetWeightCompat0_7 <- AIEngine.GetWeight;
AIEngine._GetWeight <- AIEngine.GetWeight;
AIEngine.GetWeight <- function(engine_id)
{
if (!AIEngine.IsBuildable(engine_id)) return -1;
return AIEngine.GetWeightCompat0_7(engine_id);
return AIEngine._GetWeight(engine_id);
}
AIEngine.GetMaxTractiveEffortCompat0_7 <- AIEngine.GetMaxTractiveEffort;
AIEngine._GetMaxTractiveEffort <- AIEngine.GetMaxTractiveEffort;
AIEngine.GetMaxTractiveEffort <- function(engine_id)
{
if (!AIEngine.IsBuildable(engine_id)) return -1;
return AIEngine.GetMaxTractiveEffortCompat0_7(engine_id);
return AIEngine._GetMaxTractiveEffort(engine_id);
}
AIEngine.GetDesignDateCompat0_7 <- AIEngine.GetDesignDate;
AIEngine._GetDesignDate <- AIEngine.GetDesignDate;
AIEngine.GetDesignDate <- function(engine_id)
{
if (!AIEngine.IsBuildable(engine_id)) return -1;
return AIEngine.GetDesignDateCompat0_7(engine_id);
return AIEngine._GetDesignDate(engine_id);
}
AIEngine.GetVehicleTypeCompat0_7 <- AIEngine.GetVehicleType;
AIEngine._GetVehicleType <- AIEngine.GetVehicleType;
AIEngine.GetVehicleType <- function(engine_id)
{
if (!AIEngine.IsBuildable(engine_id)) return AIVehicle.VT_INVALID;
return AIEngine.GetVehicleTypeCompat0_7(engine_id);
return AIEngine._GetVehicleType(engine_id);
}
AIEngine.IsWagonCompat0_7 <- AIEngine.IsWagon;
AIEngine._IsWagon <- AIEngine.IsWagon;
AIEngine.IsWagon <- function(engine_id)
{
if (!AIEngine.IsBuildable(engine_id)) return false;
return AIEngine.IsWagonCompat0_7(engine_id);
return AIEngine._IsWagon(engine_id);
}
AIEngine.CanRunOnRailCompat0_7 <- AIEngine.CanRunOnRail;
AIEngine._CanRunOnRail <- AIEngine.CanRunOnRail;
AIEngine.CanRunOnRail <- function(engine_id, track_rail_type)
{
if (!AIEngine.IsBuildable(engine_id)) return false;
return AIEngine.CanRunOnRailCompat0_7(engine_id, track_rail_type);
return AIEngine._CanRunOnRail(engine_id, track_rail_type);
}
AIEngine.HasPowerOnRailCompat0_7 <- AIEngine.HasPowerOnRail;
AIEngine._HasPowerOnRail <- AIEngine.HasPowerOnRail;
AIEngine.HasPowerOnRail <- function(engine_id, track_rail_type)
{
if (!AIEngine.IsBuildable(engine_id)) return false;
return AIEngine.HasPowerOnRailCompat0_7(engine_id, track_rail_type);
return AIEngine._HasPowerOnRail(engine_id, track_rail_type);
}
AIEngine.GetRoadTypeCompat0_7 <- AIEngine.GetRoadType;
AIEngine._GetRoadType <- AIEngine.GetRoadType;
AIEngine.GetRoadType <- function(engine_id)
{
if (!AIEngine.IsBuildable(engine_id)) return AIRoad.ROADTYPE_INVALID;
return AIEngine.GetRoadTypeCompat0_7(engine_id);
return AIEngine._GetRoadType(engine_id);
}
AIEngine.GetRailTypeCompat0_7 <- AIEngine.GetRailType;
AIEngine._GetRailType <- AIEngine.GetRailType;
AIEngine.GetRailType <- function(engine_id)
{
if (!AIEngine.IsBuildable(engine_id)) return AIRail.RAILTYPE_INVALID;
return AIEngine.GetRailTypeCompat0_7(engine_id);
return AIEngine._GetRailType(engine_id);
}
AIEngine.IsArticulatedCompat0_7 <- AIEngine.IsArticulated;
AIEngine._IsArticulated <- AIEngine.IsArticulated;
AIEngine.IsArticulated <- function(engine_id)
{
if (!AIEngine.IsBuildable(engine_id)) return false;
return AIEngine.IsArticulatedCompat0_7(engine_id);
return AIEngine._IsArticulated(engine_id);
}
AIEngine.GetPlaneTypeCompat0_7 <- AIEngine.GetPlaneType;
AIEngine._GetPlaneType <- AIEngine.GetPlaneType;
AIEngine.GetPlaneType <- function(engine_id)
{
if (!AIEngine.IsBuildable(engine_id)) return -1;
return AIEngine.GetPlaneTypeCompat0_7(engine_id);
return AIEngine._GetPlaneType(engine_id);
}
_AIWaypointList <- AIWaypointList;
@@ -257,3 +256,139 @@ class AIWaypointList extends _AIWaypointList {
::_AIWaypointList.constructor(AIWaypoint.WAYPOINT_RAIL);
}
}
AIRoad._BuildRoadStation <- AIRoad.BuildRoadStation;
AIRoad.BuildRoadStation <- function(tile, front, road_veh_type, station_id)
{
if (AIRoad.IsRoadStationTile(tile) && AICompany.IsMine(AITile.GetOwner(tile))) return false;
return AIRoad._BuildRoadStation(tile, front, road_veh_type, station_id);
}
AIRoad._BuildDriveThroughRoadStation <- AIRoad.BuildDriveThroughRoadStation;
AIRoad.BuildDriveThroughRoadStation <- function(tile, front, road_veh_type, station_id)
{
if (AIRoad.IsRoadStationTile(tile) && AICompany.IsMine(AITile.GetOwner(tile))) return false;
return AIRoad._BuildDriveThroughRoadStation(tile, front, road_veh_type, station_id);
}
AIBridgeList.HasNext <-
AIBridgeList_Length.HasNext <-
AICargoList.HasNext <-
AICargoList_IndustryAccepting.HasNext <-
AICargoList_IndustryProducing.HasNext <-
AIDepotList.HasNext <-
AIEngineList.HasNext <-
AIGroupList.HasNext <-
AIIndustryList.HasNext <-
AIIndustryList_CargoAccepting.HasNext <-
AIIndustryList_CargoProducing.HasNext <-
AIIndustryTypeList.HasNext <-
AIList.HasNext <-
AIRailTypeList.HasNext <-
AISignList.HasNext <-
AIStationList.HasNext <-
AIStationList_Vehicle.HasNext <-
AISubsidyList.HasNext <-
AITileList.HasNext <-
AITileList_IndustryAccepting.HasNext <-
AITileList_IndustryProducing.HasNext <-
AITileList_StationType.HasNext <-
AITownList.HasNext <-
AIVehicleList.HasNext <-
AIVehicleList_DefaultGroup.HasNext <-
AIVehicleList_Group.HasNext <-
AIVehicleList_SharedOrders.HasNext <-
AIVehicleList_Station.HasNext <-
AIWaypointList.HasNext <-
AIWaypointList_Vehicle.HasNext <-
function()
{
return !this.IsEnd();
}
AIIndustry._IsCargoAccepted <- AIIndustry.IsCargoAccepted;
AIIndustry.IsCargoAccepted <- function(industry_id, cargo_id)
{
return AIIndustry._IsCargoAccepted(industry_id, cargo_id) != AIIndustry.CAS_NOT_ACCEPTED;
}
AIAbstractList <- AIList;
AIList.ChangeItem <- AIList.SetValue;
AIRail.ERR_NONUNIFORM_STATIONS_DISABLED <- 0xFFFF;
AICompany.GetCompanyValue <- function(company)
{
return AICompany.GetQuarterlyCompanyValue(company, AICompany.CURRENT_QUARTER);
}
AITown.GetLastMonthTransported <- AITown.GetLastMonthSupplied;
AIEvent.AI_ET_INVALID <- AIEvent.ET_INVALID;
AIEvent.AI_ET_TEST <- AIEvent.ET_TEST;
AIEvent.AI_ET_SUBSIDY_OFFER <- AIEvent.ET_SUBSIDY_OFFER;
AIEvent.AI_ET_SUBSIDY_OFFER_EXPIRED <- AIEvent.ET_SUBSIDY_OFFER_EXPIRED;
AIEvent.AI_ET_SUBSIDY_AWARDED <- AIEvent.ET_SUBSIDY_AWARDED;
AIEvent.AI_ET_SUBSIDY_EXPIRED <- AIEvent.ET_SUBSIDY_EXPIRED;
AIEvent.AI_ET_ENGINE_PREVIEW <- AIEvent.ET_ENGINE_PREVIEW;
AIEvent.AI_ET_COMPANY_NEW <- AIEvent.ET_COMPANY_NEW;
AIEvent.AI_ET_COMPANY_IN_TROUBLE <- AIEvent.ET_COMPANY_IN_TROUBLE;
AIEvent.AI_ET_COMPANY_MERGER <- AIEvent.ET_COMPANY_MERGER;
AIEvent.AI_ET_COMPANY_BANKRUPT <- AIEvent.ET_COMPANY_BANKRUPT;
AIEvent.AI_ET_VEHICLE_CRASHED <- AIEvent.ET_VEHICLE_CRASHED;
AIEvent.AI_ET_VEHICLE_LOST <- AIEvent.ET_VEHICLE_LOST;
AIEvent.AI_ET_VEHICLE_WAITING_IN_DEPOT <- AIEvent.ET_VEHICLE_WAITING_IN_DEPOT;
AIEvent.AI_ET_VEHICLE_UNPROFITABLE <- AIEvent.ET_VEHICLE_UNPROFITABLE;
AIEvent.AI_ET_INDUSTRY_OPEN <- AIEvent.ET_INDUSTRY_OPEN;
AIEvent.AI_ET_INDUSTRY_CLOSE <- AIEvent.ET_INDUSTRY_CLOSE;
AIEvent.AI_ET_ENGINE_AVAILABLE <- AIEvent.ET_ENGINE_AVAILABLE;
AIEvent.AI_ET_STATION_FIRST_VEHICLE <- AIEvent.ET_STATION_FIRST_VEHICLE;
AIEvent.AI_ET_DISASTER_ZEPPELINER_CRASHED <- AIEvent.ET_DISASTER_ZEPPELINER_CRASHED;
AIEvent.AI_ET_DISASTER_ZEPPELINER_CLEARED <- AIEvent.ET_DISASTER_ZEPPELINER_CLEARED;
AIOrder.AIOF_NONE <- AIOrder.OF_NONE
AIOrder.AIOF_NON_STOP_INTERMEDIATE <- AIOrder.OF_NON_STOP_INTERMEDIATE
AIOrder.AIOF_NON_STOP_DESTINATION <- AIOrder.OF_NON_STOP_DESTINATION
AIOrder.AIOF_UNLOAD <- AIOrder.OF_UNLOAD
AIOrder.AIOF_TRANSFER <- AIOrder.OF_TRANSFER
AIOrder.AIOF_NO_UNLOAD <- AIOrder.OF_NO_UNLOAD
AIOrder.AIOF_FULL_LOAD <- AIOrder.OF_FULL_LOAD
AIOrder.AIOF_FULL_LOAD_ANY <- AIOrder.OF_FULL_LOAD_ANY
AIOrder.AIOF_NO_LOAD <- AIOrder.OF_NO_LOAD
AIOrder.AIOF_SERVICE_IF_NEEDED <- AIOrder.OF_SERVICE_IF_NEEDED
AIOrder.AIOF_STOP_IN_DEPOT <- AIOrder.OF_STOP_IN_DEPOT
AIOrder.AIOF_GOTO_NEAREST_DEPOT <- AIOrder.OF_GOTO_NEAREST_DEPOT
AIOrder.AIOF_NON_STOP_FLAGS <- AIOrder.OF_NON_STOP_FLAGS
AIOrder.AIOF_UNLOAD_FLAGS <- AIOrder.OF_UNLOAD_FLAGS
AIOrder.AIOF_LOAD_FLAGS <- AIOrder.OF_LOAD_FLAGS
AIOrder.AIOF_DEPOT_FLAGS <- AIOrder.OF_DEPOT_FLAGS
AIOrder.AIOF_INVALID <- AIOrder.OF_INVALID
/* 1.9 adds a vehicle type parameter. */
AIBridge._GetName <- AIBridge.GetName;
AIBridge.GetName <- function(bridge_id)
{
return AIBridge._GetName(bridge_id, AIVehicle.VT_RAIL);
}
/* 1.9 adds parent_group_id to CreateGroup function */
AIGroup._CreateGroup <- AIGroup.CreateGroup;
AIGroup.CreateGroup <- function(vehicle_type)
{
return AIGroup._CreateGroup(vehicle_type, AIGroup.GROUP_INVALID);
}
/* 13 really checks RoadType against RoadType */
AIRoad._HasRoadType <- AIRoad.HasRoadType;
AIRoad.HasRoadType <- function(tile, road_type)
{
local list = AIRoadTypeList(AIRoad.GetRoadTramType(road_type));
foreach (rt, _ in list) {
if (AIRoad._HasRoadType(tile, rt)) {
return true;
}
}
return false;
}

View File

@@ -5,22 +5,22 @@
* 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/>.
*/
/* This file contains code to downgrade the API from 1.1 to 1.0. */
AILog.Info("1.0 API compatibility in effect.");
AIRoad.BuildRoadStationCompat1_0 <- AIRoad.BuildRoadStation;
AIRoad._BuildRoadStation <- AIRoad.BuildRoadStation;
AIRoad.BuildRoadStation <- function(tile, front, road_veh_type, station_id)
{
if (AIRoad.IsRoadStationTile(tile) && AICompany.IsMine(AITile.GetOwner(tile))) return false;
return AIRoad.BuildRoadStationCompat1_0(tile, front, road_veh_type, station_id);
return AIRoad._BuildRoadStation(tile, front, road_veh_type, station_id);
}
AIRoad.BuildDriveThroughRoadStationCompat1_0 <- AIRoad.BuildDriveThroughRoadStation;
AIRoad._BuildDriveThroughRoadStation <- AIRoad.BuildDriveThroughRoadStation;
AIRoad.BuildDriveThroughRoadStation <- function(tile, front, road_veh_type, station_id)
{
if (AIRoad.IsRoadStationTile(tile) && AICompany.IsMine(AITile.GetOwner(tile))) return false;
return AIRoad.BuildDriveThroughRoadStationCompat1_0(tile, front, road_veh_type, station_id);
return AIRoad._BuildDriveThroughRoadStation(tile, front, road_veh_type, station_id);
}
AIBridgeList.HasNext <-
@@ -59,10 +59,10 @@ function()
return !this.IsEnd();
}
AIIndustry.IsCargoAcceptedCompat1_0 <- AIIndustry.IsCargoAccepted;
AIIndustry._IsCargoAccepted <- AIIndustry.IsCargoAccepted;
AIIndustry.IsCargoAccepted <- function(industry_id, cargo_id)
{
return AIIndustry.IsCargoAcceptedCompat1_0(industry_id, cargo_id) != AIIndustry.CAS_NOT_ACCEPTED;
return AIIndustry._IsCargoAccepted(industry_id, cargo_id) != AIIndustry.CAS_NOT_ACCEPTED;
}
AIAbstractList <- AIList;
@@ -70,3 +70,77 @@ AIAbstractList <- AIList;
AIList.ChangeItem <- AIList.SetValue;
AIRail.ERR_NONUNIFORM_STATIONS_DISABLED <- 0xFFFF;
AICompany.GetCompanyValue <- function(company)
{
return AICompany.GetQuarterlyCompanyValue(company, AICompany.CURRENT_QUARTER);
}
AITown.GetLastMonthTransported <- AITown.GetLastMonthSupplied;
AIEvent.AI_ET_INVALID <- AIEvent.ET_INVALID;
AIEvent.AI_ET_TEST <- AIEvent.ET_TEST;
AIEvent.AI_ET_SUBSIDY_OFFER <- AIEvent.ET_SUBSIDY_OFFER;
AIEvent.AI_ET_SUBSIDY_OFFER_EXPIRED <- AIEvent.ET_SUBSIDY_OFFER_EXPIRED;
AIEvent.AI_ET_SUBSIDY_AWARDED <- AIEvent.ET_SUBSIDY_AWARDED;
AIEvent.AI_ET_SUBSIDY_EXPIRED <- AIEvent.ET_SUBSIDY_EXPIRED;
AIEvent.AI_ET_ENGINE_PREVIEW <- AIEvent.ET_ENGINE_PREVIEW;
AIEvent.AI_ET_COMPANY_NEW <- AIEvent.ET_COMPANY_NEW;
AIEvent.AI_ET_COMPANY_IN_TROUBLE <- AIEvent.ET_COMPANY_IN_TROUBLE;
AIEvent.AI_ET_COMPANY_ASK_MERGER <- AIEvent.ET_COMPANY_ASK_MERGER;
AIEvent.AI_ET_COMPANY_MERGER <- AIEvent.ET_COMPANY_MERGER;
AIEvent.AI_ET_COMPANY_BANKRUPT <- AIEvent.ET_COMPANY_BANKRUPT;
AIEvent.AI_ET_VEHICLE_CRASHED <- AIEvent.ET_VEHICLE_CRASHED;
AIEvent.AI_ET_VEHICLE_LOST <- AIEvent.ET_VEHICLE_LOST;
AIEvent.AI_ET_VEHICLE_WAITING_IN_DEPOT <- AIEvent.ET_VEHICLE_WAITING_IN_DEPOT;
AIEvent.AI_ET_VEHICLE_UNPROFITABLE <- AIEvent.ET_VEHICLE_UNPROFITABLE;
AIEvent.AI_ET_INDUSTRY_OPEN <- AIEvent.ET_INDUSTRY_OPEN;
AIEvent.AI_ET_INDUSTRY_CLOSE <- AIEvent.ET_INDUSTRY_CLOSE;
AIEvent.AI_ET_ENGINE_AVAILABLE <- AIEvent.ET_ENGINE_AVAILABLE;
AIEvent.AI_ET_STATION_FIRST_VEHICLE <- AIEvent.ET_STATION_FIRST_VEHICLE;
AIEvent.AI_ET_DISASTER_ZEPPELINER_CRASHED <- AIEvent.ET_DISASTER_ZEPPELINER_CRASHED;
AIEvent.AI_ET_DISASTER_ZEPPELINER_CLEARED <- AIEvent.ET_DISASTER_ZEPPELINER_CLEARED;
AIOrder.AIOF_NONE <- AIOrder.OF_NONE
AIOrder.AIOF_NON_STOP_INTERMEDIATE <- AIOrder.OF_NON_STOP_INTERMEDIATE
AIOrder.AIOF_NON_STOP_DESTINATION <- AIOrder.OF_NON_STOP_DESTINATION
AIOrder.AIOF_UNLOAD <- AIOrder.OF_UNLOAD
AIOrder.AIOF_TRANSFER <- AIOrder.OF_TRANSFER
AIOrder.AIOF_NO_UNLOAD <- AIOrder.OF_NO_UNLOAD
AIOrder.AIOF_FULL_LOAD <- AIOrder.OF_FULL_LOAD
AIOrder.AIOF_FULL_LOAD_ANY <- AIOrder.OF_FULL_LOAD_ANY
AIOrder.AIOF_NO_LOAD <- AIOrder.OF_NO_LOAD
AIOrder.AIOF_SERVICE_IF_NEEDED <- AIOrder.OF_SERVICE_IF_NEEDED
AIOrder.AIOF_STOP_IN_DEPOT <- AIOrder.OF_STOP_IN_DEPOT
AIOrder.AIOF_GOTO_NEAREST_DEPOT <- AIOrder.OF_GOTO_NEAREST_DEPOT
AIOrder.AIOF_NON_STOP_FLAGS <- AIOrder.OF_NON_STOP_FLAGS
AIOrder.AIOF_UNLOAD_FLAGS <- AIOrder.OF_UNLOAD_FLAGS
AIOrder.AIOF_LOAD_FLAGS <- AIOrder.OF_LOAD_FLAGS
AIOrder.AIOF_DEPOT_FLAGS <- AIOrder.OF_DEPOT_FLAGS
AIOrder.AIOF_INVALID <- AIOrder.OF_INVALID
/* 1.9 adds a vehicle type parameter. */
AIBridge._GetName <- AIBridge.GetName;
AIBridge.GetName <- function(bridge_id)
{
return AIBridge._GetName(bridge_id, AIVehicle.VT_RAIL);
}
/* 1.9 adds parent_group_id to CreateGroup function */
AIGroup._CreateGroup <- AIGroup.CreateGroup;
AIGroup.CreateGroup <- function(vehicle_type)
{
return AIGroup._CreateGroup(vehicle_type, AIGroup.GROUP_INVALID);
}
/* 13 really checks RoadType against RoadType */
AIRoad._HasRoadType <- AIRoad.HasRoadType;
AIRoad.HasRoadType <- function(tile, road_type)
{
local list = AIRoadTypeList(AIRoad.GetRoadTramType(road_type));
foreach (rt, _ in list) {
if (AIRoad._HasRoadType(tile, rt)) {
return true;
}
}
return false;
}

View File

@@ -5,7 +5,7 @@
* 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/>.
*/
/* This file contains code to downgrade the API from 1.2 to 1.1. */
AILog.Info("1.1 API compatibility in effect.");
AICompany.GetCompanyValue <- function(company)
{
@@ -54,3 +54,30 @@ AIOrder.AIOF_UNLOAD_FLAGS <- AIOrder.OF_UNLOAD_FLAGS
AIOrder.AIOF_LOAD_FLAGS <- AIOrder.OF_LOAD_FLAGS
AIOrder.AIOF_DEPOT_FLAGS <- AIOrder.OF_DEPOT_FLAGS
AIOrder.AIOF_INVALID <- AIOrder.OF_INVALID
/* 1.9 adds a vehicle type parameter. */
AIBridge._GetName <- AIBridge.GetName;
AIBridge.GetName <- function(bridge_id)
{
return AIBridge._GetName(bridge_id, AIVehicle.VT_RAIL);
}
/* 1.9 adds parent_group_id to CreateGroup function */
AIGroup._CreateGroup <- AIGroup.CreateGroup;
AIGroup.CreateGroup <- function(vehicle_type)
{
return AIGroup._CreateGroup(vehicle_type, AIGroup.GROUP_INVALID);
}
/* 13 really checks RoadType against RoadType */
AIRoad._HasRoadType <- AIRoad.HasRoadType;
AIRoad.HasRoadType <- function(tile, road_type)
{
local list = AIRoadTypeList(AIRoad.GetRoadTramType(road_type));
foreach (rt, _ in list) {
if (AIRoad._HasRoadType(tile, rt)) {
return true;
}
}
return false;
}

View File

@@ -5,4 +5,17 @@
* 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/>.
*/
/* This file contains code to downgrade the API from 1.11 to 1.10. */
AILog.Info("1.10 API compatibility in effect.");
/* 13 really checks RoadType against RoadType */
AIRoad._HasRoadType <- AIRoad.HasRoadType;
AIRoad.HasRoadType <- function(tile, road_type)
{
local list = AIRoadTypeList(AIRoad.GetRoadTramType(road_type));
foreach (rt, _ in list) {
if (AIRoad._HasRoadType(tile, rt)) {
return true;
}
}
return false;
}

View File

@@ -5,4 +5,17 @@
* 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/>.
*/
/* This file contains code to downgrade the API from 12 to 1.11. */
AILog.Info("1.11 API compatibility in effect.");
/* 13 really checks RoadType against RoadType */
AIRoad._HasRoadType <- AIRoad.HasRoadType;
AIRoad.HasRoadType <- function(tile, road_type)
{
local list = AIRoadTypeList(AIRoad.GetRoadTramType(road_type));
foreach (rt, _ in list) {
if (AIRoad._HasRoadType(tile, rt)) {
return true;
}
}
return false;
}

View File

@@ -5,4 +5,31 @@
* 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/>.
*/
/* This file contains code to downgrade the API from 1.3 to 1.2. */
AILog.Info("1.2 API compatibility in effect.");
/* 1.9 adds a vehicle type parameter. */
AIBridge._GetName <- AIBridge.GetName;
AIBridge.GetName <- function(bridge_id)
{
return AIBridge._GetName(bridge_id, AIVehicle.VT_RAIL);
}
/* 1.9 adds parent_group_id to CreateGroup function */
AIGroup._CreateGroup <- AIGroup.CreateGroup;
AIGroup.CreateGroup <- function(vehicle_type)
{
return AIGroup._CreateGroup(vehicle_type, AIGroup.GROUP_INVALID);
}
/* 13 really checks RoadType against RoadType */
AIRoad._HasRoadType <- AIRoad.HasRoadType;
AIRoad.HasRoadType <- function(tile, road_type)
{
local list = AIRoadTypeList(AIRoad.GetRoadTramType(road_type));
foreach (rt, _ in list) {
if (AIRoad._HasRoadType(tile, rt)) {
return true;
}
}
return false;
}

View File

@@ -5,4 +5,31 @@
* 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/>.
*/
/* This file contains code to downgrade the API from 1.4 to 1.3. */
AILog.Info("1.3 API compatibility in effect.");
/* 1.9 adds a vehicle type parameter. */
AIBridge._GetName <- AIBridge.GetName;
AIBridge.GetName <- function(bridge_id)
{
return AIBridge._GetName(bridge_id, AIVehicle.VT_RAIL);
}
/* 1.9 adds parent_group_id to CreateGroup function */
AIGroup._CreateGroup <- AIGroup.CreateGroup;
AIGroup.CreateGroup <- function(vehicle_type)
{
return AIGroup._CreateGroup(vehicle_type, AIGroup.GROUP_INVALID);
}
/* 13 really checks RoadType against RoadType */
AIRoad._HasRoadType <- AIRoad.HasRoadType;
AIRoad.HasRoadType <- function(tile, road_type)
{
local list = AIRoadTypeList(AIRoad.GetRoadTramType(road_type));
foreach (rt, _ in list) {
if (AIRoad._HasRoadType(tile, rt)) {
return true;
}
}
return false;
}

View File

@@ -5,4 +5,31 @@
* 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/>.
*/
/* This file contains code to downgrade the API from 1.5 to 1.4. */
AILog.Info("1.4 API compatibility in effect.");
/* 1.9 adds a vehicle type parameter. */
AIBridge._GetName <- AIBridge.GetName;
AIBridge.GetName <- function(bridge_id)
{
return AIBridge._GetName(bridge_id, AIVehicle.VT_RAIL);
}
/* 1.9 adds parent_group_id to CreateGroup function */
AIGroup._CreateGroup <- AIGroup.CreateGroup;
AIGroup.CreateGroup <- function(vehicle_type)
{
return AIGroup._CreateGroup(vehicle_type, AIGroup.GROUP_INVALID);
}
/* 13 really checks RoadType against RoadType */
AIRoad._HasRoadType <- AIRoad.HasRoadType;
AIRoad.HasRoadType <- function(tile, road_type)
{
local list = AIRoadTypeList(AIRoad.GetRoadTramType(road_type));
foreach (rt, _ in list) {
if (AIRoad._HasRoadType(tile, rt)) {
return true;
}
}
return false;
}

View File

@@ -5,4 +5,31 @@
* 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/>.
*/
/* This file contains code to downgrade the API from 1.6 to 1.5. */
AILog.Info("1.5 API compatibility in effect.");
/* 1.9 adds a vehicle type parameter. */
AIBridge._GetName <- AIBridge.GetName;
AIBridge.GetName <- function(bridge_id)
{
return AIBridge._GetName(bridge_id, AIVehicle.VT_RAIL);
}
/* 1.9 adds parent_group_id to CreateGroup function */
AIGroup._CreateGroup <- AIGroup.CreateGroup;
AIGroup.CreateGroup <- function(vehicle_type)
{
return AIGroup._CreateGroup(vehicle_type, AIGroup.GROUP_INVALID);
}
/* 13 really checks RoadType against RoadType */
AIRoad._HasRoadType <- AIRoad.HasRoadType;
AIRoad.HasRoadType <- function(tile, road_type)
{
local list = AIRoadTypeList(AIRoad.GetRoadTramType(road_type));
foreach (rt, _ in list) {
if (AIRoad._HasRoadType(tile, rt)) {
return true;
}
}
return false;
}

View File

@@ -5,4 +5,31 @@
* 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/>.
*/
/* This file contains code to downgrade the API from 1.7 to 1.6. */
AILog.Info("1.6 API compatibility in effect.");
/* 1.9 adds a vehicle type parameter. */
AIBridge._GetName <- AIBridge.GetName;
AIBridge.GetName <- function(bridge_id)
{
return AIBridge._GetName(bridge_id, AIVehicle.VT_RAIL);
}
/* 1.9 adds parent_group_id to CreateGroup function */
AIGroup._CreateGroup <- AIGroup.CreateGroup;
AIGroup.CreateGroup <- function(vehicle_type)
{
return AIGroup._CreateGroup(vehicle_type, AIGroup.GROUP_INVALID);
}
/* 13 really checks RoadType against RoadType */
AIRoad._HasRoadType <- AIRoad.HasRoadType;
AIRoad.HasRoadType <- function(tile, road_type)
{
local list = AIRoadTypeList(AIRoad.GetRoadTramType(road_type));
foreach (rt, _ in list) {
if (AIRoad._HasRoadType(tile, rt)) {
return true;
}
}
return false;
}

View File

@@ -5,4 +5,31 @@
* 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/>.
*/
/* This file contains code to downgrade the API from 1.8 to 1.7. */
AILog.Info("1.7 API compatibility in effect.");
/* 1.9 adds a vehicle type parameter. */
AIBridge._GetName <- AIBridge.GetName;
AIBridge.GetName <- function(bridge_id)
{
return AIBridge._GetName(bridge_id, AIVehicle.VT_RAIL);
}
/* 1.9 adds parent_group_id to CreateGroup function */
AIGroup._CreateGroup <- AIGroup.CreateGroup;
AIGroup.CreateGroup <- function(vehicle_type)
{
return AIGroup._CreateGroup(vehicle_type, AIGroup.GROUP_INVALID);
}
/* 13 really checks RoadType against RoadType */
AIRoad._HasRoadType <- AIRoad.HasRoadType;
AIRoad.HasRoadType <- function(tile, road_type)
{
local list = AIRoadTypeList(AIRoad.GetRoadTramType(road_type));
foreach (rt, _ in list) {
if (AIRoad._HasRoadType(tile, rt)) {
return true;
}
}
return false;
}

View File

@@ -5,16 +5,31 @@
* 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/>.
*/
/* This file contains code to downgrade the API from 1.9 to 1.8. */
AILog.Info("1.8 API compatibility in effect.");
AIBridge.GetNameCompat1_8 <- AIBridge.GetName;
/* 1.9 adds a vehicle type parameter. */
AIBridge._GetName <- AIBridge.GetName;
AIBridge.GetName <- function(bridge_id)
{
return AIBridge.GetNameCompat1_8(bridge_id, AIVehicle.VT_RAIL);
return AIBridge._GetName(bridge_id, AIVehicle.VT_RAIL);
}
AIGroup.CreateGroupCompat1_8 <- AIGroup.CreateGroup;
/* 1.9 adds parent_group_id to CreateGroup function */
AIGroup._CreateGroup <- AIGroup.CreateGroup;
AIGroup.CreateGroup <- function(vehicle_type)
{
return AIGroup.CreateGroupCompat1_8(vehicle_type, AIGroup.GROUP_INVALID);
return AIGroup._CreateGroup(vehicle_type, AIGroup.GROUP_INVALID);
}
/* 13 really checks RoadType against RoadType */
AIRoad._HasRoadType <- AIRoad.HasRoadType;
AIRoad.HasRoadType <- function(tile, road_type)
{
local list = AIRoadTypeList(AIRoad.GetRoadTramType(road_type));
foreach (rt, _ in list) {
if (AIRoad._HasRoadType(tile, rt)) {
return true;
}
}
return false;
}

View File

@@ -5,4 +5,17 @@
* 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/>.
*/
/* This file contains code to downgrade the API from 1.10 to 1.9. */
AILog.Info("1.9 API compatibility in effect.");
/* 13 really checks RoadType against RoadType */
AIRoad._HasRoadType <- AIRoad.HasRoadType;
AIRoad.HasRoadType <- function(tile, road_type)
{
local list = AIRoadTypeList(AIRoad.GetRoadTramType(road_type));
foreach (rt, _ in list) {
if (AIRoad._HasRoadType(tile, rt)) {
return true;
}
}
return false;
}

View File

@@ -5,14 +5,15 @@
* 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/>.
*/
/* This file contains code to downgrade the API from 13 to 12. */
AILog.Info("12 API compatibility in effect.");
AIRoad.HasRoadTypeCompat12 <- AIRoad.HasRoadType;
/* 13 really checks RoadType against RoadType */
AIRoad._HasRoadType <- AIRoad.HasRoadType;
AIRoad.HasRoadType <- function(tile, road_type)
{
local list = AIRoadTypeList(AIRoad.GetRoadTramType(road_type));
foreach (rt, _ in list) {
if (AIRoad.HasRoadTypeCompat12(tile, rt)) {
if (AIRoad._HasRoadType(tile, rt)) {
return true;
}
}

View File

@@ -5,4 +5,4 @@
* 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/>.
*/
/* This file contains code to downgrade the API from 14 to 13. */
AILog.Info("13 API compatibility in effect.");

View File

@@ -4,43 +4,3 @@
* 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/>.
*/
/* This file contains code to downgrade the API from 15 to 14. */
AIBridge.GetBridgeID <- AIBridge.GetBridgeType;
class AICompat14 {
function Text(text)
{
if (typeof text == "string") return text;
return null;
}
}
AIBaseStation.SetNameCompat14 <- AIBaseStation.SetName;
AIBaseStation.SetName <- function(id, name) { return AIBaseStation.SetNameCompat14(id, AICompat14.Text(name)); }
AICompany.SetNameCompat14 <- AICompany.SetName;
AICompany.SetName <- function(name) { return AICompany.SetNameCompat14(AICompat14.Text(name)); }
AICompany.SetPresidentNameCompat14 <- AICompany.SetPresidentName;
AICompany.SetPresidentName <- function(name) { return AICompany.SetPresidentNameCompat14(AICompat14.Text(name)); }
AIGroup.SetNameCompat14 <- AIGroup.SetName;
AIGroup.SetName <- function(id, name) { return AIGroup.SetNameCompat14(id, AICompat14.Text(name)); }
AISign.BuildSignCompat14 <- AISign.BuildSign;
AISign.BuildSign <- function(id, name) { return AISign.BuildSignCompat14(id, AICompat14.Text(name)); }
AITown.FoundTownCompat14 <- AITown.FoundTown;
AITown.FoundTown <- function(tile, size, city, layout, name) { return AITown.FoundTownCompat14(tile, size, city, layout, AICompat14.Text(name)); }
AIVehicle.SetNameCompat14 <- AIVehicle.SetName;
AIVehicle.SetName <- function(id, name) { return AIVehicle.SetNameCompat14(id, AICompat14.Text(name)); }
AIObject.constructorCompat14 <- AIObject.constructor;
foreach(name, object in CompatScriptRootTable) {
if (type(object) != "class") continue;
if (!object.rawin("constructor")) continue;
if (object.constructor != AIObject.constructorCompat14) continue;
object.constructor <- function() : (name) { AILog.Error("'" + name + "' is not instantiable"); }
}

View File

@@ -5,10 +5,24 @@
* 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/>.
*/
/* This file contains code to downgrade the API from 1.11 to 1.10. */
GSLog.Info("1.10 API compatibility in effect.");
GSCompany.ChangeBankBalanceCompat1_10 <- GSCompany.ChangeBankBalance;
/* 1.11 adds a tile parameter. */
GSCompany._ChangeBankBalance <- GSCompany.ChangeBankBalance;
GSCompany.ChangeBankBalance <- function(company, delta, expenses_type)
{
return GSCompany.ChangeBankBalanceCompat1_10(company, delta, expenses_type, GSMap.TILE_INVALID);
return GSCompany._ChangeBankBalance(company, delta, expenses_type, GSMap.TILE_INVALID);
}
/* 13 really checks RoadType against RoadType */
GSRoad._HasRoadType <- GSRoad.HasRoadType;
GSRoad.HasRoadType <- function(tile, road_type)
{
local list = GSRoadTypeList(GSRoad.GetRoadTramType(road_type));
foreach (rt, _ in list) {
if (GSRoad._HasRoadType(tile, rt)) {
return true;
}
}
return false;
}

View File

@@ -5,5 +5,17 @@
* 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/>.
*/
/* This file contains code to downgrade the API from 12 to 1.11. */
GSLog.Info("1.11 API compatibility in effect.");
/* 13 really checks RoadType against RoadType */
GSRoad._HasRoadType <- GSRoad.HasRoadType;
GSRoad.HasRoadType <- function(tile, road_type)
{
local list = GSRoadTypeList(GSRoad.GetRoadTramType(road_type));
foreach (rt, _ in list) {
if (GSRoad._HasRoadType(tile, rt)) {
return true;
}
}
return false;
}

View File

@@ -5,4 +5,46 @@
* 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/>.
*/
/* This file contains code to downgrade the API from 1.3 to 1.2. */
GSLog.Info("1.2 API compatibility in effect.");
GSTown._SetGrowthRate <- GSTown.SetGrowthRate;
GSTown.SetGrowthRate <- function(town_id, days_between_town_growth)
{
/* Growth rate 0 caused resetting the custom growth rate. While this was undocumented, it was used nevertheless (ofc). */
if (days_between_town_growth == 0) days_between_town_growth = GSTown.TOWN_GROWTH_NORMAL;
return GSTown._SetGrowthRate(town_id, days_between_town_growth);
}
/* 1.5 adds a game element reference to the news. */
GSNews._Create <- GSNews.Create;
GSNews.Create <- function(type, text, company)
{
return GSNews._Create(type, text, company, GSNews.NR_NONE, 0);
}
/* 1.9 adds a vehicle type parameter. */
GSBridge._GetName <- GSBridge.GetName;
GSBridge.GetName <- function(bridge_id)
{
return GSBridge._GetName(bridge_id, GSVehicle.VT_RAIL);
}
/* 1.11 adds a tile parameter. */
GSCompany._ChangeBankBalance <- GSCompany.ChangeBankBalance;
GSCompany.ChangeBankBalance <- function(company, delta, expenses_type)
{
return GSCompany._ChangeBankBalance(company, delta, expenses_type, GSMap.TILE_INVALID);
}
/* 13 really checks RoadType against RoadType */
GSRoad._HasRoadType <- GSRoad.HasRoadType;
GSRoad.HasRoadType <- function(tile, road_type)
{
local list = GSRoadTypeList(GSRoad.GetRoadTramType(road_type));
foreach (rt, _ in list) {
if (GSRoad._HasRoadType(tile, rt)) {
return true;
}
}
return false;
}

View File

@@ -5,12 +5,46 @@
* 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/>.
*/
/* This file contains code to downgrade the API from 1.4 to 1.3. */
GSLog.Info("1.3 API compatibility in effect.");
GSTown.SetGrowthRateCompat1_3 <- GSTown.SetGrowthRate;
GSTown._SetGrowthRate <- GSTown.SetGrowthRate;
GSTown.SetGrowthRate <- function(town_id, days_between_town_growth)
{
/* Growth rate 0 caused resetting the custom growth rate. While this was undocumented, it was used nevertheless (ofc). */
if (days_between_town_growth == 0) days_between_town_growth = GSTown.TOWN_GROWTH_NORMAL;
return GSTown.SetGrowthRateCompat1_3(town_id, days_between_town_growth);
return GSTown._SetGrowthRate(town_id, days_between_town_growth);
}
/* 1.5 adds a game element reference to the news. */
GSNews._Create <- GSNews.Create;
GSNews.Create <- function(type, text, company)
{
return GSNews._Create(type, text, company, GSNews.NR_NONE, 0);
}
/* 1.9 adds a vehicle type parameter. */
GSBridge._GetName <- GSBridge.GetName;
GSBridge.GetName <- function(bridge_id)
{
return GSBridge._GetName(bridge_id, GSVehicle.VT_RAIL);
}
/* 1.11 adds a tile parameter. */
GSCompany._ChangeBankBalance <- GSCompany.ChangeBankBalance;
GSCompany.ChangeBankBalance <- function(company, delta, expenses_type)
{
return GSCompany._ChangeBankBalance(company, delta, expenses_type, GSMap.TILE_INVALID);
}
/* 13 really checks RoadType against RoadType */
GSRoad._HasRoadType <- GSRoad.HasRoadType;
GSRoad.HasRoadType <- function(tile, road_type)
{
local list = GSRoadTypeList(GSRoad.GetRoadTramType(road_type));
foreach (rt, _ in list) {
if (GSRoad._HasRoadType(tile, rt)) {
return true;
}
}
return false;
}

View File

@@ -5,10 +5,38 @@
* 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/>.
*/
/* This file contains code to downgrade the API from 1.5 to 1.4 */
GSLog.Info("1.4 API compatibility in effect.");
GSNews.CreateCompat1_4 <- GSNews.Create;
/* 1.5 adds a game element reference to the news. */
GSNews._Create <- GSNews.Create;
GSNews.Create <- function(type, text, company)
{
return GSNews.CreateCompat1_4(type, text, company, GSNews.NR_NONE, 0);
return GSNews._Create(type, text, company, GSNews.NR_NONE, 0);
}
/* 1.9 adds a vehicle type parameter. */
GSBridge._GetName <- GSBridge.GetName;
GSBridge.GetName <- function(bridge_id)
{
return GSBridge._GetName(bridge_id, GSVehicle.VT_RAIL);
}
/* 1.11 adds a tile parameter. */
GSCompany._ChangeBankBalance <- GSCompany.ChangeBankBalance;
GSCompany.ChangeBankBalance <- function(company, delta, expenses_type)
{
return GSCompany._ChangeBankBalance(company, delta, expenses_type, GSMap.TILE_INVALID);
}
/* 13 really checks RoadType against RoadType */
GSRoad._HasRoadType <- GSRoad.HasRoadType;
GSRoad.HasRoadType <- function(tile, road_type)
{
local list = GSRoadTypeList(GSRoad.GetRoadTramType(road_type));
foreach (rt, _ in list) {
if (GSRoad._HasRoadType(tile, rt)) {
return true;
}
}
return false;
}

View File

@@ -5,4 +5,31 @@
* 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/>.
*/
/* This file contains code to downgrade the API from 1.6 to 1.5. */
GSLog.Info("1.5 API compatibility in effect.");
/* 1.9 adds a vehicle type parameter. */
GSBridge._GetName <- GSBridge.GetName;
GSBridge.GetName <- function(bridge_id)
{
return GSBridge._GetName(bridge_id, GSVehicle.VT_RAIL);
}
/* 1.11 adds a tile parameter. */
GSCompany._ChangeBankBalance <- GSCompany.ChangeBankBalance;
GSCompany.ChangeBankBalance <- function(company, delta, expenses_type)
{
return GSCompany._ChangeBankBalance(company, delta, expenses_type, GSMap.TILE_INVALID);
}
/* 13 really checks RoadType against RoadType */
GSRoad._HasRoadType <- GSRoad.HasRoadType;
GSRoad.HasRoadType <- function(tile, road_type)
{
local list = GSRoadTypeList(GSRoad.GetRoadTramType(road_type));
foreach (rt, _ in list) {
if (GSRoad._HasRoadType(tile, rt)) {
return true;
}
}
return false;
}

View File

@@ -5,4 +5,31 @@
* 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/>.
*/
/* This file contains code to downgrade the API from 1.7 to 1.6. */
GSLog.Info("1.6 API compatibility in effect.");
/* 1.9 adds a vehicle type parameter. */
GSBridge._GetName <- GSBridge.GetName;
GSBridge.GetName <- function(bridge_id)
{
return GSBridge._GetName(bridge_id, GSVehicle.VT_RAIL);
}
/* 1.11 adds a tile parameter. */
GSCompany._ChangeBankBalance <- GSCompany.ChangeBankBalance;
GSCompany.ChangeBankBalance <- function(company, delta, expenses_type)
{
return GSCompany._ChangeBankBalance(company, delta, expenses_type, GSMap.TILE_INVALID);
}
/* 13 really checks RoadType against RoadType */
GSRoad._HasRoadType <- GSRoad.HasRoadType;
GSRoad.HasRoadType <- function(tile, road_type)
{
local list = GSRoadTypeList(GSRoad.GetRoadTramType(road_type));
foreach (rt, _ in list) {
if (GSRoad._HasRoadType(tile, rt)) {
return true;
}
}
return false;
}

View File

@@ -5,4 +5,31 @@
* 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/>.
*/
/* This file contains code to downgrade the API from 1.8 to 1.7. */
GSLog.Info("1.7 API compatibility in effect.");
/* 1.9 adds a vehicle type parameter. */
GSBridge._GetName <- GSBridge.GetName;
GSBridge.GetName <- function(bridge_id)
{
return GSBridge._GetName(bridge_id, GSVehicle.VT_RAIL);
}
/* 1.11 adds a tile parameter. */
GSCompany._ChangeBankBalance <- GSCompany.ChangeBankBalance;
GSCompany.ChangeBankBalance <- function(company, delta, expenses_type)
{
return GSCompany._ChangeBankBalance(company, delta, expenses_type, GSMap.TILE_INVALID);
}
/* 13 really checks RoadType against RoadType */
GSRoad._HasRoadType <- GSRoad.HasRoadType;
GSRoad.HasRoadType <- function(tile, road_type)
{
local list = GSRoadTypeList(GSRoad.GetRoadTramType(road_type));
foreach (rt, _ in list) {
if (GSRoad._HasRoadType(tile, rt)) {
return true;
}
}
return false;
}

View File

@@ -5,10 +5,31 @@
* 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/>.
*/
/* This file contains code to downgrade the API from 1.9 to 1.8. */
GSLog.Info("1.8 API compatibility in effect.");
GSBridge.GetNameCompat1_8 <- GSBridge.GetName;
/* 1.9 adds a vehicle type parameter. */
GSBridge._GetName <- GSBridge.GetName;
GSBridge.GetName <- function(bridge_id)
{
return GSBridge.GetNameCompat1_8(bridge_id, GSVehicle.VT_RAIL);
return GSBridge._GetName(bridge_id, GSVehicle.VT_RAIL);
}
/* 1.11 adds a tile parameter. */
GSCompany._ChangeBankBalance <- GSCompany.ChangeBankBalance;
GSCompany.ChangeBankBalance <- function(company, delta, expenses_type)
{
return GSCompany._ChangeBankBalance(company, delta, expenses_type, GSMap.TILE_INVALID);
}
/* 13 really checks RoadType against RoadType */
GSRoad._HasRoadType <- GSRoad.HasRoadType;
GSRoad.HasRoadType <- function(tile, road_type)
{
local list = GSRoadTypeList(GSRoad.GetRoadTramType(road_type));
foreach (rt, _ in list) {
if (GSRoad._HasRoadType(tile, rt)) {
return true;
}
}
return false;
}

View File

@@ -5,4 +5,24 @@
* 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/>.
*/
/* This file contains code to downgrade the API from 1.10 to 1.9. */
GSLog.Info("1.9 API compatibility in effect.");
/* 1.11 adds a tile parameter. */
GSCompany._ChangeBankBalance <- GSCompany.ChangeBankBalance;
GSCompany.ChangeBankBalance <- function(company, delta, expenses_type)
{
return GSCompany._ChangeBankBalance(company, delta, expenses_type, GSMap.TILE_INVALID);
}
/* 13 really checks RoadType against RoadType */
GSRoad._HasRoadType <- GSRoad.HasRoadType;
GSRoad.HasRoadType <- function(tile, road_type)
{
local list = GSRoadTypeList(GSRoad.GetRoadTramType(road_type));
foreach (rt, _ in list) {
if (GSRoad._HasRoadType(tile, rt)) {
return true;
}
}
return false;
}

View File

@@ -5,14 +5,15 @@
* 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/>.
*/
/* This file contains code to downgrade the API from 13 to 12. */
GSLog.Info("12 API compatibility in effect.");
GSRoad.HasRoadTypeCompat12 <- GSRoad.HasRoadType;
/* 13 really checks RoadType against RoadType */
GSRoad._HasRoadType <- GSRoad.HasRoadType;
GSRoad.HasRoadType <- function(tile, road_type)
{
local list = GSRoadTypeList(GSRoad.GetRoadTramType(road_type));
foreach (rt, _ in list) {
if (GSRoad.HasRoadTypeCompat12(tile, rt)) {
if (GSRoad._HasRoadType(tile, rt)) {
return true;
}
}

View File

@@ -5,4 +5,4 @@
* 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/>.
*/
/* This file contains code to downgrade the API from 14 to 13. */
GSLog.Info("13 API compatibility in effect.");

View File

@@ -4,88 +4,3 @@
* 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/>.
*/
/* This file contains code to downgrade the API from 15 to 14. */
GSBridge.GetBridgeID <- GSBridge.GetBridgeType;
/* Emulate old GSText parameter padding behaviour */
GSText.SCRIPT_TEXT_MAX_PARAMETERS <- 20;
class GSCompat14 {
function Text(text)
{
if (typeof text == "string") return text;
if (typeof text == "instance" && text instanceof GSText) return text;
return null;
}
}
GSBaseStation.SetNameCompat14 <- GSBaseStation.SetName;
GSBaseStation.SetName <- function(id, name) { return GSBaseStation.SetNameCompat14(id, GSCompat14.Text(name)); }
GSCompany.SetNameCompat14 <- GSCompany.SetName;
GSCompany.SetName <- function(name) { return GSCompany.SetNameCompat14(GSCompat14.Text(name)); }
GSCompany.SetPresidentNameCompat14 <- GSCompany.SetPresidentName;
GSCompany.SetPresidentName <- function(name) { return GSCompany.SetPresidentNameCompat14(GSCompat14.Text(name)); }
GSGoal.NewCompat14 <- GSGoal.New;
GSGoal.New <- function(company, goal, type, dest) { return GSGoal.NewCompat14(company, GSCompat14.Text(goal), type, dest); }
GSGoal.SetTextCompat14 <- GSGoal.SetText;
GSGoal.SetText <- function(id, goal) { return GSGoal.SetTextCompat14(id, GSCompat14.Text(goal)); }
GSGoal.SetProgressCompat14 <- GSGoal.SetProgress;
GSGoal.SetProgress <- function(id, progress) { return GSGoal.SetProgressCompat14(id, GSCompat14.Text(progress)); }
GSGoal.QuestionCompat14 <- GSGoal.Question;
GSGoal.Question <- function(id, company, question, type, buttons) { return GSGoal.QuestionCompat14(id, company, GSCompat14.Text(question), type, buttons); }
GSGoal.QuestionClientCompat14 <- GSGoal.QuestionClient;
GSGoal.QuestionClient <- function(id, target, is_client, question, type, buttons) { return GSGoal.QuestionClientCompat14(id, target, is_client, GSCompat14.Text(question), type, buttons); }
GSGroup.SetNameCompat14 <- GSGroup.SetName;
GSGroup.SetName <- function(id, name) { return GSGroup.SetNameCompat14(id, GSCompat14.Text(name)); }
GSIndustry.SetTextCompat14 <- GSIndustry.SetText;
GSIndustry.SetText <- function(id, text) { return GSIndustry.SetTextCompat14(id, GSCompat14.Text(text)); }
GSIndustry.SetProductionLevelCompat14 <- GSIndustry.SetProductionLevel;
GSIndustry.SetProductionLevel <- function(id, level, news, text) { return GSIndustry.SetProductionLevelCompat14(id, level, news, GSCompat14.Text(text)); }
GSLeagueTable.NewCompat14 <- GSLeagueTable.New;
GSLeagueTable.New <- function(title, header, footer) { return GSLeagueTable.NewCompat14(GSCompat14.Text(title), GSCompat14.Text(header), GSCompat14.Text(footer)); }
GSLeagueTable.NewElementCompat14 <- GSLeagueTable.NewElement;
GSLeagueTable.NewElement <- function(table, rating, company, text, score, type, target) { return GSLeagueTable.NewElementCompat14(table, rating, company, GSCompat14.Text(text), GSCompat14.Text(score), type, target); }
GSLeagueTable.UpdateElementDataCompat14 <- GSLeagueTable.UpdateElementData;
GSLeagueTable.UpdateElementData <- function(element, company, text, type, target) { return GSLeagueTable.UpdateElementDataCompat14(element, company, GSCompat14.Text(text), type, target); }
GSLeagueTable.UpdateElementScoreCompat14 <- GSLeagueTable.UpdateElementScore;
GSLeagueTable.UpdateElementScore <- function(element, rating, score) { return GSLeagueTable.UpdateElementScoreCompat14(element, rating, GSCompat14.Text(score)); }
GSNews.CreateCompat14 <- GSNews.Create;
GSNews.Create <- function(type, text, company, ref_type, ref) { return GSNews.CreateCompat14(type, GSCompat14.Text(text), company, ref_type, ref); }
GSSign.BuildSignCompat14 <- GSSign.BuildSign;
GSSign.BuildSign <- function(id, name) { return GSSign.BuildSignCompat14(id, GSCompat14.Text(name)); }
GSStoryPage.NewCompat14 <- GSStoryPage.New;
GSStoryPage.New <- function(company, title) { return GSStoryPage.NewCompat14(company, GSCompat14.Text(title)); }
GSStoryPage.NewElementCompat14 <- GSStoryPage.NewElement;
GSStoryPage.NewElement <- function(page, type, ref, text) { return GSStoryPage.NewElementCompat14(page, type, ref, GSCompat14.Text(text)); }
GSStoryPage.UpdateElementCompat14 <- GSStoryPage.UpdateElement;
GSStoryPage.UpdateElement <- function(id, ref, text) { return GSStoryPage.UpdateElementCompat14(id, ref, GSCompat14.Text(text)); }
GSStoryPage.SetTitleCompat14 <- GSStoryPage.SetTitle;
GSStoryPage.SetTitle <- function(page, tile) { return GSStoryPage.SetTitleCompat14(page, GSCompat14.Text(title)); }
GSTown.SetNameCompat14 <- GSTown.SetName;
GSTown.SetName <- function(id, name) { return GSTown.SetNameCompat14(id, GSCompat14.Text(name)); }
GSTown.SetTextCompat14 <- GSTown.SetText;
GSTown.SetText <- function(id, text) { return GSTown.SetTextCompat14(id, GSCompat14.Text(text)); }
GSTown.FoundTownCompat14 <- GSTown.FoundTown;
GSTown.FoundTown <- function(tile, size, city, layout, name) { return GSTown.FoundTownCompat14(tile, size, city, layout, GSCompat14.Text(name)); }
GSVehicle.SetNameCompat14 <- GSVehicle.SetName;
GSVehicle.SetName <- function(id, name) { return GSVehicle.SetNameCompat14(id, GSCompat14.Text(name)); }
GSObject.constructorCompat14 <- GSObject.constructor;
foreach(name, object in CompatScriptRootTable) {
if (type(object) != "class") continue;
if (!object.rawin("constructor")) continue;
if (object.constructor != GSObject.constructorCompat14) continue;
object.constructor <- function() : (name) { GSLog.Error("'" + name + "' is not instantiable"); }
}

File diff suppressed because it is too large Load Diff

View File

@@ -10,7 +10,6 @@ macro(compile_flags)
if(NOT CMAKE_CXX_COMPILER_ID STREQUAL "Clang")
add_compile_options(
/Zc:preprocessor # Needed for __VA_OPT__() in macros.
/MP # Enable multi-threaded compilation.
/FC # Display the full path of source code files passed to the compiler in diagnostics.
)
@@ -56,11 +55,6 @@ macro(compile_flags)
# This flag disables the broken optimisation to work around the bug
add_compile_options(/d2ssa-rse-)
endif()
if(CMAKE_CXX_COMPILER_ID STREQUAL "Clang")
add_compile_options(
-Wno-multichar
)
endif()
elseif(CMAKE_CXX_COMPILER_ID STREQUAL "GNU" OR CMAKE_CXX_COMPILER_ID STREQUAL "Clang" OR CMAKE_CXX_COMPILER_ID STREQUAL "AppleClang")
add_compile_options(
-W
@@ -81,9 +75,11 @@ macro(compile_flags)
# We use 'ABCD' multichar for SaveLoad chunks identifiers
-Wno-multichar
# Prevent optimisation supposing enums are in a range specified by the standard
# For details, see http://gcc.gnu.org/PR43680 and PR#5246.
-fno-strict-enums
# Compilers complains about that we break strict-aliasing.
# On most places we don't see how to fix it, and it doesn't
# break anything. So disable strict-aliasing to make the
# compiler all happy.
-fno-strict-aliasing
)
# Ninja processes the output so the output from the compiler
@@ -110,6 +106,10 @@ macro(compile_flags)
# about its own optimized code in some places.
"-fno-strict-overflow"
# Prevent optimisation supposing enums are in a range specified by the standard
# For details, see http://gcc.gnu.org/PR43680
"-fno-tree-vrp"
# -flifetime-dse=2 (default since GCC 6) doesn't play
# well with our custom pool item allocator
"$<$<BOOL:${LIFETIME_DSE_FOUND}>:-flifetime-dse=1>"

14
cmake/Endian.cmake Normal file
View File

@@ -0,0 +1,14 @@
# Add the definitions to indicate which endian we are building for.
#
# add_endian_definition()
#
function(add_endian_definition)
include(TestBigEndian)
TEST_BIG_ENDIAN(IS_BIG_ENDIAN)
if(IS_BIG_ENDIAN)
add_definitions(-DTTD_ENDIAN=TTD_BIG_ENDIAN)
else()
add_definitions(-DTTD_ENDIAN=TTD_LITTLE_ENDIAN)
endif()
endfunction()

View File

@@ -43,8 +43,29 @@ find_library(LZO_LIBRARY
PATHS ${PC_LZO_LIBRARY_DIRS}
)
include(FixVcpkgLibrary)
FixVcpkgLibrary(LZO)
# With vcpkg, the library path should contain both 'debug' and 'optimized'
# entries (see target_link_libraries() documentation for more information)
#
# NOTE: we only patch up when using vcpkg; the same issue might happen
# when not using vcpkg, but this is non-trivial to fix, as we have no idea
# what the paths are. With vcpkg we do. And we only official support vcpkg
# with Windows.
#
# NOTE: this is based on the assumption that the debug file has the same
# name as the optimized file. This is not always the case, but so far
# experiences has shown that in those case vcpkg CMake files do the right
# thing.
if(VCPKG_TOOLCHAIN AND LZO_LIBRARY AND LZO_LIBRARY MATCHES "${VCPKG_INSTALLED_DIR}")
if(LZO_LIBRARY MATCHES "/debug/")
set(LZO_LIBRARY_DEBUG ${LZO_LIBRARY})
string(REPLACE "/debug/lib/" "/lib/" LZO_LIBRARY_RELEASE ${LZO_LIBRARY})
else()
set(LZO_LIBRARY_RELEASE ${LZO_LIBRARY})
string(REPLACE "/lib/" "/debug/lib/" LZO_LIBRARY_DEBUG ${LZO_LIBRARY})
endif()
include(SelectLibraryConfigurations)
select_library_configurations(LZO)
endif()
set(LZO_VERSION ${PC_LZO_VERSION})

View File

@@ -1,41 +0,0 @@
include(FindPackageHandleStandardArgs)
find_library(Ogg_LIBRARY
NAMES ogg
)
include(FixVcpkgLibrary)
FixVcpkgLibrary(Ogg)
set(Ogg_COMPILE_OPTIONS "" CACHE STRING "Extra compile options of ogg")
set(Ogg_LINK_LIBRARIES "" CACHE STRING "Extra link libraries of ogg")
set(Ogg_LINK_FLAGS "" CACHE STRING "Extra link flags of ogg")
find_path(Ogg_INCLUDE_PATH
NAMES ogg.h
PATH_SUFFIXES ogg
)
find_package_handle_standard_args(Ogg
REQUIRED_VARS Ogg_LIBRARY Ogg_INCLUDE_PATH
)
if (Ogg_FOUND)
set(Ogg_dirs ${Ogg_INCLUDE_PATH})
if(EXISTS "${Ogg_INCLUDE_PATH}/ogg")
list(APPEND Ogg_dirs "${Ogg_INCLUDE_PATH}/ogg")
endif()
if (NOT TARGET Ogg::ogg)
add_library(Ogg::ogg UNKNOWN IMPORTED)
set_target_properties(Ogg::ogg PROPERTIES
IMPORTED_LOCATION "${Ogg_LIBRARY}"
INTERFACE_INCLUDE_DIRECTORIES "${Ogg_dirs}"
INTERFACE_COMPILE_OPTIONS "${Ogg_COMPILE_OPTIONS}"
INTERFACE_LINK_LIBRARIES "${Ogg_LINK_LIBRARIES}"
INTERFACE_LINK_FLAGS "${Ogg_LINK_FLAGS}"
)
FixVcpkgTarget(Ogg Ogg::ogg)
endif()
endif()

View File

@@ -1,41 +0,0 @@
include(FindPackageHandleStandardArgs)
find_library(Opus_LIBRARY
NAMES opus
)
include(FixVcpkgLibrary)
FixVcpkgLibrary(Opus)
set(Opus_COMPILE_OPTIONS "" CACHE STRING "Extra compile options of opus")
set(Opus_LINK_LIBRARIES "" CACHE STRING "Extra link libraries of opus")
set(Opus_LINK_FLAGS "" CACHE STRING "Extra link flags of opus")
find_path(Opus_INCLUDE_PATH
NAMES opus.h
PATH_SUFFIXES opus
)
find_package_handle_standard_args(Opus
REQUIRED_VARS Opus_LIBRARY Opus_INCLUDE_PATH
)
if (Opus_FOUND)
set(Opus_dirs ${Opus_INCLUDE_PATH})
if(EXISTS "${Opus_INCLUDE_PATH}/opus")
list(APPEND Opus_dirs "${Opus_INCLUDE_PATH}/opus")
endif()
if (NOT TARGET Opus::opus)
add_library(Opus::opus UNKNOWN IMPORTED)
set_target_properties(Opus::opus PROPERTIES
IMPORTED_LOCATION "${Opus_LIBRARY}"
INTERFACE_INCLUDE_DIRECTORIES "${Opus_dirs}"
INTERFACE_COMPILE_OPTIONS "${Opus_COMPILE_OPTIONS}"
INTERFACE_LINK_LIBRARIES "${Opus_LINK_LIBRARIES}"
INTERFACE_LINK_FLAGS "${Opus_LINK_FLAGS}"
)
FixVcpkgTarget(Opus Opus::opus)
endif()
endif()

View File

@@ -1,44 +0,0 @@
include(FindPackageHandleStandardArgs)
find_library(OpusFile_LIBRARY
NAMES opusfile
)
include(FixVcpkgLibrary)
FixVcpkgLibrary(OpusFile)
set(OpusFile_COMPILE_OPTIONS "" CACHE STRING "Extra compile options of opusfile")
set(OpusFile_LINK_LIBRARIES "" CACHE STRING "Extra link libraries of opusfile")
set(OpusFile_LINK_FLAGS "" CACHE STRING "Extra link flags of opusfile")
find_path(OpusFile_INCLUDE_PATH
NAMES opusfile.h
PATH_SUFFIXES opus
)
find_package_handle_standard_args(OpusFile
REQUIRED_VARS OpusFile_LIBRARY OpusFile_INCLUDE_PATH
)
find_package(Ogg)
find_package(Opus)
if (OpusFile_FOUND)
set(OpusFile_dirs ${OpusFile_INCLUDE_PATH})
if(EXISTS "${OpusFile_INCLUDE_PATH}/opus")
list(APPEND OpusFile_dirs "${OpusFile_INCLUDE_PATH}/opus")
endif()
if (NOT TARGET OpusFile::opusfile)
add_library(OpusFile::opusfile UNKNOWN IMPORTED)
set_target_properties(OpusFile::opusfile PROPERTIES
IMPORTED_LOCATION "${OpusFile_LIBRARY}"
INTERFACE_INCLUDE_DIRECTORIES "${OpusFile_dirs}"
INTERFACE_COMPILE_OPTIONS "${OpusFile_COMPILE_OPTIONS}"
INTERFACE_LINK_LIBRARIES "Ogg::ogg;Opus::opus;${OpusFile_LINK_LIBRARIES}"
INTERFACE_LINK_FLAGS "${OpusFile_LINK_FLAGS}"
)
FixVcpkgTarget(OpusFile OpusFile::opusfile)
endif()
endif()

View File

@@ -2,7 +2,6 @@
# SSE version (SSE 2.0, SSSE 3.0).
include(CheckCXXSourceCompiles)
set(OLD_CMAKE_REQUIRED_FLAGS ${CMAKE_REQUIRED_FLAGS})
set(CMAKE_REQUIRED_FLAGS "")
if(CMAKE_CXX_COMPILER_ID STREQUAL "GNU" OR CMAKE_CXX_COMPILER_ID STREQUAL "Clang" OR CMAKE_CXX_COMPILER_ID STREQUAL "AppleClang")
@@ -16,5 +15,3 @@ check_cxx_source_compiles("
int main() { return 0; }"
SSE_FOUND
)
set(CMAKE_REQUIRED_FLAGS ${OLD_CMAKE_REQUIRED_FLAGS})

View File

@@ -1,7 +1,6 @@
# Autodetect if xaudio2 can be used.
include(CheckCXXSourceCompiles)
set(OLD_CMAKE_REQUIRED_FLAGS ${CMAKE_REQUIRED_FLAGS})
set(CMAKE_REQUIRED_FLAGS "")
check_cxx_source_compiles("
@@ -18,5 +17,3 @@ check_cxx_source_compiles("
int main() { printf(\"%s\\\\n\", XAUDIO2_DLL_A); return 0; }"
XAUDIO2_FOUND
)
set(CMAKE_REQUIRED_FLAGS ${OLD_CMAKE_REQUIRED_FLAGS})

View File

@@ -1,40 +0,0 @@
macro(FixVcpkgLibrary NAME)
# With vcpkg, the library path should contain both 'debug' and 'optimized'
# entries (see target_link_libraries() documentation for more information)
#
# NOTE: we only patch up when using vcpkg; the same issue might happen
# when not using vcpkg, but this is non-trivial to fix, as we have no idea
# what the paths are. With vcpkg we do. And we only official support vcpkg
# with Windows.
#
# NOTE: this is based on the assumption that the debug file has the same
# name as the optimized file. This is not always the case, but so far
# experiences has shown that in those case vcpkg CMake files do the right
# thing.
if(VCPKG_TOOLCHAIN AND ${NAME}_LIBRARY AND ${NAME}_LIBRARY MATCHES "${VCPKG_INSTALLED_DIR}")
if(${NAME}_LIBRARY MATCHES "/debug/")
set(${NAME}_LIBRARY_DEBUG ${${NAME}_LIBRARY})
string(REPLACE "/debug/lib/" "/lib/" ${NAME}_LIBRARY_RELEASE ${${NAME}_LIBRARY})
else()
set(${NAME}_LIBRARY_RELEASE ${${NAME}_LIBRARY})
string(REPLACE "/lib/" "/debug/lib/" ${NAME}_LIBRARY_DEBUG ${${NAME}_LIBRARY})
endif()
include(SelectLibraryConfigurations)
select_library_configurations(${NAME})
endif()
endmacro()
function(FixVcpkgTarget NAME TARGET)
if(EXISTS "${${NAME}_LIBRARY_RELEASE}")
set_property(TARGET ${TARGET} APPEND PROPERTY
IMPORTED_CONFIGURATIONS RELEASE)
set_target_properties(${TARGET} PROPERTIES
IMPORTED_LOCATION_RELEASE "${${NAME}_LIBRARY_RELEASE}")
endif()
if(EXISTS "${${NAME}_LIBRARY_DEBUG}")
set_property(TARGET ${TARGET} APPEND PROPERTY
IMPORTED_CONFIGURATIONS DEBUG)
set_target_properties(${TARGET} PROPERTIES
IMPORTED_LOCATION_DEBUG "${${NAME}_LIBRARY_DEBUG}")
endif()
endfunction()

View File

@@ -51,8 +51,8 @@ install(FILES
${CMAKE_SOURCE_DIR}/README.md
${CMAKE_SOURCE_DIR}/CREDITS.md
${CMAKE_SOURCE_DIR}/CONTRIBUTING.md
${CMAKE_SOURCE_DIR}/changelog.md
${CMAKE_SOURCE_DIR}/known-bugs.md
${CMAKE_SOURCE_DIR}/changelog.txt
${CMAKE_SOURCE_DIR}/known-bugs.txt
DESTINATION ${DOCS_DESTINATION_DIR}
COMPONENT docs)
@@ -62,7 +62,6 @@ install(FILES
${CMAKE_SOURCE_DIR}/docs/desync.md
${CMAKE_SOURCE_DIR}/docs/directory_structure.md
${CMAKE_SOURCE_DIR}/docs/eints.md
${CMAKE_SOURCE_DIR}/docs/fonts.md
${CMAKE_SOURCE_DIR}/docs/game_coordinator.md
${CMAKE_SOURCE_DIR}/docs/linkgraph.md
${CMAKE_SOURCE_DIR}/docs/logging_and_performance_metrics.md

View File

@@ -56,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)
option(OPTION_USE_NSIS "Use NSIS to create windows installer; enable only for stable releases" OFF)
option(OPTION_TOOLS_ONLY "Build only tools target" OFF)
option(OPTION_DOCS_ONLY "Build only docs target" OFF)

View File

@@ -4,7 +4,6 @@ set(CPACK_BUNDLE_NAME "OpenTTD")
set(CPACK_BUNDLE_ICON "${CMAKE_SOURCE_DIR}/os/macosx/openttd.icns")
set(CPACK_BUNDLE_PLIST "${CMAKE_CURRENT_BINARY_DIR}/Info.plist")
set(CPACK_DMG_BACKGROUND_IMAGE "${CMAKE_SOURCE_DIR}/os/macosx/splash.png")
set(CPACK_BUNDLE_APPLE_ENTITLEMENTS "${CMAKE_SOURCE_DIR}/os/macosx/openttd.entitlements")
set(CPACK_DMG_FORMAT "UDBZ")
# Create a temporary Info.plist.in, where we will fill in the version via

View File

@@ -46,3 +46,44 @@ endfunction()
function(add_test_files)
_add_files_tgt(openttd_test ${ARGV})
endfunction()
# This function works around an 'issue' with CMake, where
# set_source_files_properties() only works in the scope of the file. We want
# to set properties for the source file on a more global level. To solve this,
# this function records the flags you want, and a macro adds them in the root
# CMakeLists.txt.
# See this URL for more information on the issue:
# http://cmake.3232098.n2.nabble.com/scope-of-set-source-files-properties-td4766111.html
#
# set_compile_flags([file1 ...] COMPILE_FLAGS cflag [cflag ...])
#
function(set_compile_flags)
cmake_parse_arguments(PARAM "" "" "COMPILE_FLAGS" ${ARGN})
set(PARAM_FILES "${PARAM_UNPARSED_ARGUMENTS}")
get_property(SOURCE_PROPERTIES GLOBAL PROPERTY source_properties)
foreach(FILE IN LISTS PARAM_FILES)
list(APPEND SOURCE_PROPERTIES "${CMAKE_CURRENT_SOURCE_DIR}/${FILE}::${PARAM_COMPILE_FLAGS}")
endforeach()
set_property(GLOBAL PROPERTY source_properties "${SOURCE_PROPERTIES}")
endfunction()
# Call this macro in the same CMakeLists.txt and after add_executable().
# This makes sure all the COMPILE_FLAGS of set_compile_flags() are set
# correctly.
#
# process_compile_flags()
#
function(process_compile_flags)
get_property(SOURCE_PROPERTIES GLOBAL PROPERTY source_properties)
foreach(ENTRY ${SOURCE_PROPERTIES})
string(REPLACE "::" ";" ENTRY "${ENTRY}")
list(GET ENTRY 0 FILE)
list(GET ENTRY 1 PROPERTIES)
set_source_files_properties(${FILE} PROPERTIES COMPILE_FLAGS ${PROPERTIES})
endforeach()
endfunction()

View File

@@ -1,4 +1,4 @@
cmake_minimum_required(VERSION 3.17)
cmake_minimum_required(VERSION 3.5)
#
# Create a single baseset meta file with the correct translations.

View File

@@ -1,4 +1,4 @@
cmake_minimum_required(VERSION 3.17)
cmake_minimum_required(VERSION 3.5)
#
# Create a single GRF file based on sprites/<grfname>.nfo and sprites/*.png

View File

@@ -1,4 +1,4 @@
cmake_minimum_required(VERSION 3.17)
cmake_minimum_required(VERSION 3.5)
#
# Create a desktop file with the correct translations.

View File

@@ -1,4 +1,4 @@
cmake_minimum_required(VERSION 3.17)
cmake_minimum_required(VERSION 3.5)
if(NOT REV_MAJOR)
set(REV_MAJOR 0)
@@ -49,14 +49,14 @@ if(GIT_FOUND AND EXISTS "${CMAKE_SOURCE_DIR}/.git")
string(SUBSTRING "${FULLHASH}" 0 10 SHORTHASH)
# Get the last commit date
set(ENV{TZ} "UTC0")
execute_process(COMMAND ${GIT_EXECUTABLE} show -s --date=iso-local --pretty=format:%cd HEAD
execute_process(COMMAND ${GIT_EXECUTABLE} show -s --pretty=format:%ci HEAD
OUTPUT_VARIABLE COMMITDATE
OUTPUT_STRIP_TRAILING_WHITESPACE
WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}
)
string(REGEX REPLACE "([0-9]+)-([0-9]+)-([0-9]+).*" "\\1\\2\\3" COMMITDATE "${COMMITDATE}")
set(REV_ISODATE "${COMMITDATE}")
string(SUBSTRING "${REV_ISODATE}" 0 4 REV_YEAR)
# Get the branch
execute_process(COMMAND ${GIT_EXECUTABLE} symbolic-ref -q HEAD
@@ -113,6 +113,7 @@ elseif(EXISTS "${CMAKE_SOURCE_DIR}/.ottdrev")
list(GET OTTDREV 3 REV_HASH)
list(GET OTTDREV 4 REV_ISTAG)
list(GET OTTDREV 5 REV_ISSTABLETAG)
list(GET OTTDREV 6 REV_YEAR)
else()
message(WARNING "No version detected; this build will NOT be network compatible")
set(REV_VERSION "norev0000")
@@ -121,19 +122,14 @@ else()
set(REV_HASH "unknown")
set(REV_ISTAG 0)
set(REV_ISSTABLETAG 0)
set(REV_YEAR "1970")
endif()
# Extract REV_YEAR and REV_DATE from REV_ISODATE
string(SUBSTRING "${REV_ISODATE}" 0 4 REV_YEAR)
string(SUBSTRING "${REV_ISODATE}" 4 4 REV_DATE)
# Drop leading 0 in REV_DATE if any
string(REGEX REPLACE "^0?([0-9]+)" "\\1" REV_DATE "${REV_DATE}")
message(STATUS "Version string: ${REV_VERSION}")
if(GENERATE_OTTDREV)
message(STATUS "Generating .ottdrev")
file(WRITE ${CMAKE_SOURCE_DIR}/.ottdrev "${REV_VERSION}\t${REV_ISODATE}\t${REV_MODIFIED}\t${REV_HASH}\t${REV_ISTAG}\t${REV_ISSTABLETAG}\n")
file(WRITE ${CMAKE_SOURCE_DIR}/.ottdrev "${REV_VERSION}\t${REV_ISODATE}\t${REV_MODIFIED}\t${REV_HASH}\t${REV_ISTAG}\t${REV_ISSTABLETAG}\t${REV_YEAR}\n")
else()
message(STATUS "Generating rev.cpp")
configure_file("${CMAKE_SOURCE_DIR}/src/rev.cpp.in"

View File

@@ -1,4 +1,4 @@
cmake_minimum_required(VERSION 3.17)
cmake_minimum_required(VERSION 3.5)
#
# CMake script to automatically generate the enums in script_window.hpp

View File

@@ -1,4 +1,4 @@
cmake_minimum_required(VERSION 3.17)
cmake_minimum_required(VERSION 3.5)
#
# Runs a single regressoion test
@@ -87,7 +87,12 @@ set(ERROR NO)
list(LENGTH REGRESSION_EXPECTED REGRESSION_EXPECTED_LENGTH)
# Compare the output
foreach(RESULT EXPECTED IN ZIP_LISTS REGRESSION_RESULT REGRESSION_EXPECTED)
foreach(RESULT IN LISTS REGRESSION_RESULT)
unset(EXPECTED)
if(ARGC LESS REGRESSION_EXPECTED_LENGTH)
list(GET REGRESSION_EXPECTED ${ARGC} EXPECTED)
endif()
math(EXPR ARGC "${ARGC} + 1")
if(NOT RESULT STREQUAL EXPECTED)

View File

@@ -1,4 +1,4 @@
cmake_minimum_required(VERSION 3.17)
cmake_minimum_required(VERSION 3.5)
if(NOT SCRIPT_API_SOURCE_FILE)
message(FATAL_ERROR "Script needs SCRIPT_API_SOURCE_FILE defined")
@@ -17,48 +17,38 @@ if(NOT APILC)
endif()
macro(dump_fileheader)
get_filename_component(SCRIPT_API_FILE_NAME "${SCRIPT_API_FILE}" NAME_WE)
string(APPEND SQUIRREL_EXPORT "\n#include \"../${SCRIPT_API_FILE_NAME}.hpp\"")
get_filename_component(SCRIPT_API_FILE_NAME "${SCRIPT_API_FILE}" NAME)
string(APPEND SQUIRREL_EXPORT "\n#include \"../${SCRIPT_API_FILE_NAME}\"")
if(NOT "${APIUC}" STREQUAL "Template")
string(REPLACE "script_" "template_" SCRIPT_API_FILE_NAME "${SCRIPT_API_FILE_NAME}")
string(APPEND SQUIRREL_EXPORT "\n#include \"../template/${SCRIPT_API_FILE_NAME}.sq.hpp\"")
endif()
endmacro()
macro(open_namespace)
if(NOT NAMESPACE_OPENED)
string(APPEND SQUIRREL_EXPORT "\nnamespace SQConvert {")
set(NAMESPACE_OPENED TRUE)
string(APPEND SQUIRREL_EXPORT "\n#include \"../template/${SCRIPT_API_FILE_NAME}.sq\"")
endif()
endmacro()
macro(dump_class_templates NAME)
string(REGEX REPLACE "^Script" "" REALNAME ${NAME})
string(APPEND SQUIRREL_EXPORT "\n\ttemplate <> struct Param<${NAME} *> { static inline ${NAME} *Get(HSQUIRRELVM vm, int index) { return static_cast<${NAME} *>(Squirrel::GetRealInstance(vm, index, \"${REALNAME}\")); } };")
string(APPEND SQUIRREL_EXPORT "\n\ttemplate <> struct Param<${NAME} &> { static inline ${NAME} &Get(HSQUIRRELVM vm, int index) { return *static_cast<${NAME} *>(Squirrel::GetRealInstance(vm, index, \"${REALNAME}\")); } };")
string(APPEND SQUIRREL_EXPORT "\n\ttemplate <> struct Param<const ${NAME} *> { static inline const ${NAME} *Get(HSQUIRRELVM vm, int index) { return static_cast<${NAME} *>(Squirrel::GetRealInstance(vm, index, \"${REALNAME}\")); } };")
string(APPEND SQUIRREL_EXPORT "\n\ttemplate <> struct Param<const ${NAME} &> { static inline const ${NAME} &Get(HSQUIRRELVM vm, int index) { return *static_cast<${NAME} *>(Squirrel::GetRealInstance(vm, index, \"${REALNAME}\")); } };")
string(APPEND SQUIRREL_EXPORT "\n template <> struct Param<${NAME} *> { static inline ${NAME} *Get(HSQUIRRELVM vm, int index) { SQUserPointer instance; sq_getinstanceup(vm, index, &instance, nullptr); return (${NAME} *)instance; } };")
string(APPEND SQUIRREL_EXPORT "\n template <> struct Param<${NAME} &> { static inline ${NAME} &Get(HSQUIRRELVM vm, int index) { SQUserPointer instance; sq_getinstanceup(vm, index, &instance, nullptr); return *(${NAME} *)instance; } };")
string(APPEND SQUIRREL_EXPORT "\n template <> struct Param<const ${NAME} *> { static inline const ${NAME} *Get(HSQUIRRELVM vm, int index) { SQUserPointer instance; sq_getinstanceup(vm, index, &instance, nullptr); return (${NAME} *)instance; } };")
string(APPEND SQUIRREL_EXPORT "\n template <> struct Param<const ${NAME} &> { static inline const ${NAME} &Get(HSQUIRRELVM vm, int index) { SQUserPointer instance; sq_getinstanceup(vm, index, &instance, nullptr); return *(${NAME} *)instance; } };")
if("${NAME}" STREQUAL "ScriptEvent")
string(APPEND SQUIRREL_EXPORT "\n\ttemplate <> struct Return<${NAME} *> { static inline int Set(HSQUIRRELVM vm, ${NAME} *res) { if (res == nullptr) { sq_pushnull(vm); return 1; } Squirrel::CreateClassInstanceVM(vm, \"${REALNAME}\", res, nullptr, DefSQDestructorCallback<${NAME}>, true); return 1; } };")
string(APPEND SQUIRREL_EXPORT "\n template <> struct Return<${NAME} *> { static inline int Set(HSQUIRRELVM vm, ${NAME} *res) { if (res == nullptr) { sq_pushnull(vm); return 1; } Squirrel::CreateClassInstanceVM(vm, \"${REALNAME}\", res, nullptr, DefSQDestructorCallback<${NAME}>, true); return 1; } };")
elseif("${NAME}" STREQUAL "ScriptText")
string(APPEND SQUIRREL_EXPORT "\n")
string(APPEND SQUIRREL_EXPORT "\n\ttemplate <> struct Param<Text *> {")
string(APPEND SQUIRREL_EXPORT "\n\t\tstatic inline Text *Get(HSQUIRRELVM vm, int index) {")
string(APPEND SQUIRREL_EXPORT "\n\t\t\tif (sq_gettype(vm, index) == OT_INSTANCE) {")
string(APPEND SQUIRREL_EXPORT "\n\t\t\t\treturn Param<ScriptText *>::Get(vm, index);")
string(APPEND SQUIRREL_EXPORT "\n\t\t\t}")
string(APPEND SQUIRREL_EXPORT "\n\t\t\tif (sq_gettype(vm, index) == OT_STRING) {")
string(APPEND SQUIRREL_EXPORT "\n\t\t\t\treturn new RawText(Param<const std::string &>::Get(vm, index));")
string(APPEND SQUIRREL_EXPORT "\n\t\t\t}")
string(APPEND SQUIRREL_EXPORT "\n\t\t\tif (sq_gettype(vm, index) == OT_NULL) {")
string(APPEND SQUIRREL_EXPORT "\n\t\t\t\treturn nullptr;")
string(APPEND SQUIRREL_EXPORT "\n\t\t\t}")
string(APPEND SQUIRREL_EXPORT "\n\t\t\tthrow sq_throwerror(vm, fmt::format(\"parameter {} has an invalid type ; expected: 'Text'\", index - 1));")
string(APPEND SQUIRREL_EXPORT "\n\t\t}")
string(APPEND SQUIRREL_EXPORT "\n\t};")
string(APPEND SQUIRREL_EXPORT "\n template <> struct Param<Text *> {")
string(APPEND SQUIRREL_EXPORT "\n static inline Text *Get(HSQUIRRELVM vm, int index) {")
string(APPEND SQUIRREL_EXPORT "\n if (sq_gettype(vm, index) == OT_INSTANCE) {")
string(APPEND SQUIRREL_EXPORT "\n return Param<ScriptText *>::Get(vm, index);")
string(APPEND SQUIRREL_EXPORT "\n }")
string(APPEND SQUIRREL_EXPORT "\n if (sq_gettype(vm, index) == OT_STRING) {")
string(APPEND SQUIRREL_EXPORT "\n return new RawText(Param<const std::string &>::Get(vm, index));")
string(APPEND SQUIRREL_EXPORT "\n }")
string(APPEND SQUIRREL_EXPORT "\n return nullptr;")
string(APPEND SQUIRREL_EXPORT "\n }")
string(APPEND SQUIRREL_EXPORT "\n };")
else()
string(APPEND SQUIRREL_EXPORT "\n\ttemplate <> struct Return<${NAME} *> { static inline int Set(HSQUIRRELVM vm, ${NAME} *res) { if (res == nullptr) { sq_pushnull(vm); return 1; } res->AddRef(); Squirrel::CreateClassInstanceVM(vm, \"${REALNAME}\", res, nullptr, DefSQDestructorCallback<${NAME}>, true); return 1; } };")
string(APPEND SQUIRREL_EXPORT "\n template <> struct Return<${NAME} *> { static inline int Set(HSQUIRRELVM vm, ${NAME} *res) { if (res == nullptr) { sq_pushnull(vm); return 1; } res->AddRef(); Squirrel::CreateClassInstanceVM(vm, \"${REALNAME}\", res, nullptr, DefSQDestructorCallback<${NAME}>, true); return 1; } };")
endif()
endmacro()
@@ -73,6 +63,7 @@ macro(reset_reader)
unset(STATIC_METHODS)
unset(CLS)
unset(START_SQUIRREL_DEFINE_ON_NEXT_LINE)
set(CLS_LEVEL 0)
unset(CLS_IN_API)
endmacro()
@@ -81,9 +72,6 @@ reset_reader()
file(STRINGS "${SCRIPT_API_FILE}" SOURCE_LINES)
set(NUM_LINE 0)
set(CLS_LEVEL 0)
set(BRACE_LEVEL 0)
macro(doxygen_check)
if(NOT "${DOXYGEN_SKIP}" STREQUAL "")
message(FATAL_ERROR "${SCRIPT_API_FILE}:${NUM_LINE}: a DOXYGEN_API block was not properly closed")
@@ -119,7 +107,7 @@ foreach(LINE IN LISTS SOURCE_LINES)
continue()
endif()
if("${LINE}" MATCHES "^([\t ]*)\\* @api (.*)$")
if("${LINE}" MATCHES "^([ ]*)\\* @api (.*)$")
set(LINE ${CMAKE_MATCH_2})
# By default, classes are not selected
if(NOT CLS_LEVEL)
@@ -157,28 +145,22 @@ foreach(LINE IN LISTS SOURCE_LINES)
continue()
endif()
# Count braces to skip function bodies
string(REGEX REPLACE "[^{]" "" OPENING_BRACES "${LINE}")
string(LENGTH "${OPENING_BRACES}" OPENING_BRACES)
string(REGEX REPLACE "[^}]" "" CLOSING_BRACES "${LINE}")
string(LENGTH "${CLOSING_BRACES}" CLOSING_BRACES)
math(EXPR BRACE_LEVEL "${BRACE_LEVEL} + ${OPENING_BRACES} - ${CLOSING_BRACES}")
# Ignore forward declarations of classes
if("${LINE}" MATCHES "^(\t*)class(.*);")
if("${LINE}" MATCHES "^( *)class(.*);")
continue()
endif()
# We only want to have public functions exported for now
if("${LINE}" MATCHES "^(\t*)class (.*) (: public|: protected|: private|:) ([^ ]*)")
if("${LINE}" MATCHES "^( *)class (.*) (: public|: protected|: private|:) ([^ ]*)")
if(NOT CLS_LEVEL)
if(NOT DEFINED API_SELECTED)
message(WARNING "${SCRIPT_API_FILE}:${NUM_LINE}: Class '${CMAKE_MATCH_2}' has no @api. It won't be published to any API.")
message(WARNING "Class '${CMAKE_MATCH_2}' has no @api. It won't be published to any API.")
set(API_SELECTED FALSE)
endif()
unset(IS_PUBLIC)
unset(CLS_PARAMS)
set(CLS_TYPES "x")
unset(CLS_PARAM_0)
set(CLS_PARAM_1 1)
set(CLS_PARAM_2 "x")
set(CLS_IN_API ${API_SELECTED})
unset(API_SELECTED)
set(CLS "${CMAKE_MATCH_2}")
@@ -196,19 +178,19 @@ foreach(LINE IN LISTS SOURCE_LINES)
math(EXPR CLS_LEVEL "${CLS_LEVEL} + 1")
continue()
endif()
if("${LINE}" MATCHES "^(\t*)public")
if("${LINE}" MATCHES "^( *)public")
if(CLS_LEVEL EQUAL 1)
set(IS_PUBLIC TRUE)
endif()
continue()
endif()
if("${LINE}" MATCHES "^(\t*)protected")
if("${LINE}" MATCHES "^( *)protected")
if(CLS_LEVEL EQUAL 1)
unset(IS_PUBLIC)
endif()
continue()
endif()
if("${LINE}" MATCHES "^(\t*)private")
if("${LINE}" MATCHES "^( *)private")
if(CLS_LEVEL EQUAL 1)
unset(IS_PUBLIC)
endif()
@@ -236,7 +218,7 @@ foreach(LINE IN LISTS SOURCE_LINES)
endif()
# We need to make specialized conversions for structs
if("${LINE}" MATCHES "^(\t*)struct ([^ ]*)")
if("${LINE}" MATCHES "^( *)struct ([^ ]*)")
math(EXPR CLS_LEVEL "${CLS_LEVEL} + 1")
# Check if we want to publish this struct
@@ -258,7 +240,7 @@ foreach(LINE IN LISTS SOURCE_LINES)
endif()
# We need to make specialized conversions for enums
if("${LINE}" MATCHES "^(\t*)enum ([^ ]*)")
if("${LINE}" MATCHES "^( *)enum ([^ ]*)")
math(EXPR CLS_LEVEL "${CLS_LEVEL} + 1")
# Check if we want to publish this enum
@@ -281,7 +263,7 @@ foreach(LINE IN LISTS SOURCE_LINES)
endif()
# Maybe the end of the class, if so we can start with the Squirrel export pretty soon
if(BRACE_LEVEL LESS CLS_LEVEL)
if("${LINE}" MATCHES "};")
math(EXPR CLS_LEVEL "${CLS_LEVEL} - 1")
if(CLS_LEVEL)
unset(IN_ENUM)
@@ -295,7 +277,7 @@ foreach(LINE IN LISTS SOURCE_LINES)
endif()
# Empty/white lines. When we may do the Squirrel export, do that export.
if("${LINE}" MATCHES "^([ \t]*)$")
if("${LINE}" MATCHES "^([ ]*)$")
if(NOT START_SQUIRREL_DEFINE_ON_NEXT_LINE)
continue()
endif()
@@ -319,17 +301,38 @@ foreach(LINE IN LISTS SOURCE_LINES)
string(APPEND SQUIRREL_EXPORT "\n")
if("${APIUC}" STREQUAL "Template")
# First check whether we have enums to print
if(DEFINED ENUMS)
if(NOT NAMESPACE_OPENED)
string(APPEND SQUIRREL_EXPORT "\nnamespace SQConvert {")
set(NAMESPACE_OPENED TRUE)
endif()
string(APPEND SQUIRREL_EXPORT "\n /* Allow enums to be used as Squirrel parameters */")
foreach(ENUM IN LISTS ENUMS)
string(APPEND SQUIRREL_EXPORT "\n template <> struct Param<${ENUM}> { static inline ${ENUM} Get(HSQUIRRELVM vm, int index) { SQInteger tmp; sq_getinteger(vm, index, &tmp); return (${ENUM})tmp; } };")
string(APPEND SQUIRREL_EXPORT "\n template <> struct Return<${ENUM}> { static inline int Set(HSQUIRRELVM vm, ${ENUM} res) { sq_pushinteger(vm, res); return 1; } };")
endforeach()
endif()
# Then check whether we have structs/classes to print
if(DEFINED STRUCTS)
open_namespace()
string(APPEND SQUIRREL_EXPORT "\n\t/* Allow inner classes/structs to be used as Squirrel parameters */")
if(NOT NAMESPACE_OPENED)
string(APPEND SQUIRREL_EXPORT "\nnamespace SQConvert {")
set(NAMESPACE_OPENED TRUE)
endif()
string(APPEND SQUIRREL_EXPORT "\n /* Allow inner classes/structs to be used as Squirrel parameters */")
foreach(STRUCT IN LISTS STRUCTS)
dump_class_templates(${STRUCT})
endforeach()
endif()
open_namespace()
string(APPEND SQUIRREL_EXPORT "\n\t/* Allow ${CLS} to be used as Squirrel parameter */")
if(NOT NAMESPACE_OPENED)
string(APPEND SQUIRREL_EXPORT "\nnamespace SQConvert {")
set(NAMESPACE_OPENED TRUE)
else()
string(APPEND SQUIRREL_EXPORT "\n")
endif()
string(APPEND SQUIRREL_EXPORT "\n /* Allow ${CLS} to be used as Squirrel parameter */")
dump_class_templates(${CLS})
string(APPEND SQUIRREL_EXPORT "\n} // namespace SQConvert")
@@ -339,23 +342,23 @@ foreach(LINE IN LISTS SOURCE_LINES)
endif()
string(APPEND SQUIRREL_EXPORT "\n")
string(APPEND SQUIRREL_EXPORT "\ntemplate <> SQInteger PushClassName<${CLS}, ScriptType::${APIUC}>(HSQUIRRELVM vm) { sq_pushstring(vm, \"${API_CLS}\"); return 1; }")
string(APPEND SQUIRREL_EXPORT "\ntemplate <> const char *GetClassName<${CLS}, ScriptType::${APIUC}>() { return \"${API_CLS}\"; }")
string(APPEND SQUIRREL_EXPORT "\n")
# Then do the registration functions of the class.
string(APPEND SQUIRREL_EXPORT "\nvoid SQ${API_CLS}_Register(Squirrel &engine)")
string(APPEND SQUIRREL_EXPORT "\nvoid SQ${API_CLS}_Register(Squirrel *engine)")
string(APPEND SQUIRREL_EXPORT "\n{")
string(APPEND SQUIRREL_EXPORT "\n\tDefSQClass<${CLS}, ScriptType::${APIUC}> SQ${API_CLS}(\"${API_CLS}\");")
if("${SUPER_CLS}" STREQUAL "Text")
string(APPEND SQUIRREL_EXPORT "\n\tSQ${API_CLS}.PreRegister(engine);")
string(APPEND SQUIRREL_EXPORT "\n DefSQClass<${CLS}, ScriptType::${APIUC}> SQ${API_CLS}(\"${API_CLS}\");")
if("${SUPER_CLS}" STREQUAL "Text" OR "${SUPER_CLS}" STREQUAL "ScriptObject" OR "${SUPER_CLS}" STREQUAL "AIAbstractiveList::Valuator")
string(APPEND SQUIRREL_EXPORT "\n SQ${API_CLS}.PreRegister(engine);")
else()
string(APPEND SQUIRREL_EXPORT "\n\tSQ${API_CLS}.PreRegister(engine, \"${API_SUPER_CLS}\");")
string(APPEND SQUIRREL_EXPORT "\n SQ${API_CLS}.PreRegister(engine, \"${API_SUPER_CLS}\");")
endif()
if((DEFINED CLS_PARAMS OR DEFINED METHODS) AND NOT "${SUPER_CLS}" MATCHES "^ScriptEvent" AND NOT "${CLS}" STREQUAL "ScriptEvent")
if("${CLS_TYPES}" STREQUAL "v")
string(APPEND SQUIRREL_EXPORT "\n\tSQ${API_CLS}.AddSQAdvancedConstructor(engine);")
if(NOT "${SUPER_CLS}" MATCHES "^ScriptEvent")
if("${CLS_PARAM_2}" STREQUAL "v")
string(APPEND SQUIRREL_EXPORT "\n SQ${API_CLS}.AddSQAdvancedConstructor(engine);")
else()
string(APPEND SQUIRREL_EXPORT "\n\tSQ${API_CLS}.AddConstructor<void (${CLS}::*)(${CLS_PARAMS})>(engine, \"${CLS_TYPES}\");")
string(APPEND SQUIRREL_EXPORT "\n SQ${API_CLS}.AddConstructor<void (${CLS}::*)(${CLS_PARAM_0}), ${CLS_PARAM_1}>(engine, \"${CLS_PARAM_2}\");")
endif()
endif()
string(APPEND SQUIRREL_EXPORT "\n")
@@ -375,7 +378,7 @@ foreach(LINE IN LISTS SOURCE_LINES)
foreach(i RANGE ${LEN})
string(APPEND SPACES " ")
endforeach()
string(APPEND SQUIRREL_EXPORT "\n\tSQ${API_CLS}.DefSQConst(engine, ${CLS}::${ENUM_VALUE},${SPACES}\"${ENUM_VALUE}\");")
string(APPEND SQUIRREL_EXPORT "\n SQ${API_CLS}.DefSQConst(engine, ${CLS}::${ENUM_VALUE},${SPACES}\"${ENUM_VALUE}\");")
endforeach()
if(MLEN)
string(APPEND SQUIRREL_EXPORT "\n")
@@ -396,7 +399,7 @@ foreach(LINE IN LISTS SOURCE_LINES)
foreach(i RANGE ${LEN})
string(APPEND SPACES " ")
endforeach()
string(APPEND SQUIRREL_EXPORT "\n\tSQ${API_CLS}.DefSQConst(engine, ${CLS}::${CONST_VALUE},${SPACES}\"${CONST_VALUE}\");")
string(APPEND SQUIRREL_EXPORT "\n SQ${API_CLS}.DefSQConst(engine, ${CLS}::${CONST_VALUE},${SPACES}\"${CONST_VALUE}\");")
endforeach()
if(MLEN)
string(APPEND SQUIRREL_EXPORT "\n")
@@ -422,7 +425,7 @@ foreach(LINE IN LISTS SOURCE_LINES)
foreach(i RANGE ${LEN})
string(APPEND SPACES " ")
endforeach()
string(APPEND SQUIRREL_EXPORT "\n\tScriptError::RegisterErrorMap(${ENUM_STRING},${SPACES}${CLS}::${ENUM_ERROR});")
string(APPEND SQUIRREL_EXPORT "\n ScriptError::RegisterErrorMap(${ENUM_STRING},${SPACES}${CLS}::${ENUM_ERROR});")
endforeach()
if(MLEN)
string(APPEND SQUIRREL_EXPORT "\n")
@@ -443,7 +446,7 @@ foreach(LINE IN LISTS SOURCE_LINES)
foreach(i RANGE ${LEN})
string(APPEND SPACES " ")
endforeach()
string(APPEND SQUIRREL_EXPORT "\n\tScriptError::RegisterErrorMapString(${CLS}::${ENUM_ERROR_TO_STRING},${SPACES}\"${ENUM_ERROR_TO_STRING}\");")
string(APPEND SQUIRREL_EXPORT "\n ScriptError::RegisterErrorMapString(${CLS}::${ENUM_ERROR_TO_STRING},${SPACES}\"${ENUM_ERROR_TO_STRING}\");")
endforeach()
if(MLEN)
string(APPEND SQUIRREL_EXPORT "\n")
@@ -462,7 +465,8 @@ foreach(LINE IN LISTS SOURCE_LINES)
foreach(STATIC_METHOD IN LISTS STATIC_METHODS)
string(REPLACE ":" ";" STATIC_METHOD "${STATIC_METHOD}")
list(GET STATIC_METHOD 0 FUNCNAME)
list(GET STATIC_METHOD 1 TYPES)
list(GET STATIC_METHOD 1 ARGC)
list(GET STATIC_METHOD 2 TYPES)
string(LENGTH "${FUNCNAME}" LEN)
math(EXPR LEN "${MLEN} - ${LEN}")
if("${TYPES}" STREQUAL "v")
@@ -477,9 +481,9 @@ foreach(LINE IN LISTS SOURCE_LINES)
string(APPEND SPACES " ")
endforeach()
if("${TYPES}" STREQUAL "v")
string(APPEND SQUIRREL_EXPORT "\n\tSQ${API_CLS}.DefSQAdvancedStaticMethod(engine, &${CLS}::${FUNCNAME},${SPACES}\"${FUNCNAME}\");")
string(APPEND SQUIRREL_EXPORT "\n SQ${API_CLS}.DefSQAdvancedStaticMethod(engine, &${CLS}::${FUNCNAME},${SPACES}\"${FUNCNAME}\");")
else()
string(APPEND SQUIRREL_EXPORT "\n\tSQ${API_CLS}.DefSQStaticMethod(engine, &${CLS}::${FUNCNAME},${SPACES}\"${FUNCNAME}\",${SPACES}\"${TYPES}\");")
string(APPEND SQUIRREL_EXPORT "\n SQ${API_CLS}.DefSQStaticMethod(engine, &${CLS}::${FUNCNAME},${SPACES}\"${FUNCNAME}\",${SPACES}${ARGC}, \"${TYPES}\");")
endif()
endforeach()
if(MLEN)
@@ -499,7 +503,8 @@ foreach(LINE IN LISTS SOURCE_LINES)
foreach(METHOD IN LISTS METHODS)
string(REPLACE ":" ";" METHOD "${METHOD}")
list(GET METHOD 0 FUNCNAME)
list(GET METHOD 1 TYPES)
list(GET METHOD 1 ARGC)
list(GET METHOD 2 TYPES)
string(LENGTH "${FUNCNAME}" LEN)
math(EXPR LEN "${MLEN} - ${LEN}")
if("${TYPES}" STREQUAL "v")
@@ -514,16 +519,16 @@ foreach(LINE IN LISTS SOURCE_LINES)
string(APPEND SPACES " ")
endforeach()
if("${TYPES}" STREQUAL "v")
string(APPEND SQUIRREL_EXPORT "\n\tSQ${API_CLS}.DefSQAdvancedMethod(engine, &${CLS}::${FUNCNAME},${SPACES}\"${FUNCNAME}\");")
string(APPEND SQUIRREL_EXPORT "\n SQ${API_CLS}.DefSQAdvancedMethod(engine, &${CLS}::${FUNCNAME},${SPACES}\"${FUNCNAME}\");")
else()
string(APPEND SQUIRREL_EXPORT "\n\tSQ${API_CLS}.DefSQMethod(engine, &${CLS}::${FUNCNAME},${SPACES}\"${FUNCNAME}\",${SPACES}\"${TYPES}\");")
string(APPEND SQUIRREL_EXPORT "\n SQ${API_CLS}.DefSQMethod(engine, &${CLS}::${FUNCNAME},${SPACES}\"${FUNCNAME}\",${SPACES}${ARGC}, \"${TYPES}\");")
endif()
endforeach()
if(MLEN)
string(APPEND SQUIRREL_EXPORT "\n")
endif()
string(APPEND SQUIRREL_EXPORT "\n\tSQ${API_CLS}.PostRegister(engine);")
string(APPEND SQUIRREL_EXPORT "\n SQ${API_CLS}.PostRegister(engine);")
string(APPEND SQUIRREL_EXPORT "\n}")
reset_reader()
@@ -536,13 +541,9 @@ foreach(LINE IN LISTS SOURCE_LINES)
continue()
endif()
if(NOT BRACE_LEVEL EQUAL CLS_LEVEL)
continue()
endif()
# Add enums
if(IN_ENUM)
string(REGEX MATCH "([^,\t ]+)" ENUM_VALUE "${LINE}")
string(REGEX MATCH "([^, ]+)" ENUM_VALUE "${LINE}")
list(APPEND ENUM_VALUES "${ENUM_VALUE}")
# Check if this a special error enum
@@ -550,12 +551,12 @@ foreach(LINE IN LISTS SOURCE_LINES)
if("${ENUM}" MATCHES ".*::ErrorMessages")
# syntax:
# enum ErrorMessages {
#\tERR_SOME_ERROR,\t// [STR_ITEM1, STR_ITEM2, ...]
# ERR_SOME_ERROR, // [STR_ITEM1, STR_ITEM2, ...]
# }
# Set the mappings
if("${LINE}" MATCHES "\\[(.*)\\]")
string(REGEX REPLACE "[ \t]" "" MAPPINGS "${CMAKE_MATCH_1}")
string(REGEX REPLACE "[ ]" "" MAPPINGS "${CMAKE_MATCH_1}")
string(REPLACE "," ";" MAPPINGS "${MAPPINGS}")
foreach(MAPPING IN LISTS MAPPINGS)
@@ -569,11 +570,7 @@ foreach(LINE IN LISTS SOURCE_LINES)
endif()
# Add a const (non-enum) value
if("${LINE}" MATCHES "^[ \t]*static const [^ ]+ ([^ ]+) = -?\\(?[^ ]*\\)?[^ ]+;")
list(APPEND CONST_VALUES "${CMAKE_MATCH_1}")
continue()
endif()
if("${LINE}" MATCHES "^[ \t]*static constexpr [^ ]+ ([^ ]+) = -?\\(?[^ ]*\\)?[^ ]+;")
if("${LINE}" MATCHES "^[ ]*static const [^ ]+ ([^ ]+) = -?\\(?[^ ]*\\)?[^ ]+;")
list(APPEND CONST_VALUES "${CMAKE_MATCH_1}")
continue()
endif()
@@ -585,43 +582,41 @@ foreach(LINE IN LISTS SOURCE_LINES)
endif()
if("${LINE}" MATCHES "~")
if(DEFINED API_SELECTED)
message(WARNING "${SCRIPT_API_FILE}:${NUM_LINE}: Destructor for '${CLS}' has @api. Tag ignored.")
message(WARNING "Destructor for '${CLS}' has @api. Tag ignored.")
unset(API_SELECTED)
endif()
continue()
endif()
unset(IS_STATIC)
if("${LINE}" MATCHES "static ")
if("${LINE}" MATCHES "static")
set(IS_STATIC TRUE)
endif()
string(REGEX REPLACE "(virtual|static|const)[ \t]+" "" LINE "${LINE}")
string(REGEX REPLACE "(virtual|static|const)[ ]+" "" LINE "${LINE}")
string(REGEX REPLACE "{.*" "" LINE "${LINE}")
set(PARAM_S "${LINE}")
string(REGEX REPLACE "\\*" "" LINE "${LINE}")
string(REGEX REPLACE "\\(.*" "" LINE "${LINE}")
# Parameters start at first "(". Further "(" will appear in ctor lists.
string(REGEX MATCH "\\(.*" PARAM_S "${PARAM_S}")
string(REGEX REPLACE ".*\\(" "" PARAM_S "${PARAM_S}")
string(REGEX REPLACE "\\).*" "" PARAM_S "${PARAM_S}")
string(REGEX REPLACE "^\\(" "" PARAM_S "${PARAM_S}")
string(REGEX MATCH "([^ \t]+)( ([^ ]+))?" RESULT "${LINE}")
string(REGEX MATCH "([^ ]+)( ([^ ]+))?" RESULT "${LINE}")
set(FUNCTYPE "${CMAKE_MATCH_1}")
set(FUNCNAME "${CMAKE_MATCH_3}")
if("${FUNCTYPE}" STREQUAL "${CLS}" AND NOT FUNCNAME)
if(DEFINED API_SELECTED)
message(WARNING "${SCRIPT_API_FILE}:${NUM_LINE}: Constructor for '${CLS}' has @api. Tag ignored.")
message(WARNING "Constructor for '${CLS}' has @api. Tag ignored.")
unset(API_SELECTED)
endif()
set(CLS_PARAMS "${PARAM_S}")
set(CLS_PARAM_0 "${PARAM_S}")
if(NOT PARAM_S)
continue()
endif()
elseif(NOT FUNCNAME)
continue()
endif()
endif()
string(REPLACE "," ";" PARAMS "${PARAM_S}")
if(IS_STATIC)
@@ -630,7 +625,9 @@ foreach(LINE IN LISTS SOURCE_LINES)
set(TYPES "x")
endif()
set(LEN 1)
foreach(PARAM IN LISTS PARAMS)
math(EXPR LEN "${LEN} + 1")
string(STRIP "${PARAM}" PARAM)
if("${PARAM}" MATCHES "\\*|&")
if("${PARAM}" MATCHES "^char")
@@ -669,12 +666,13 @@ foreach(LINE IN LISTS SOURCE_LINES)
unset(API_SELECTED)
if("${FUNCTYPE}" STREQUAL "${CLS}" AND NOT FUNCNAME)
set(CLS_TYPES "${TYPES}")
set(CLS_PARAM_1 ${LEN})
set(CLS_PARAM_2 "${TYPES}")
elseif("${FUNCNAME}" MATCHES "^_" AND NOT "${TYPES}" STREQUAL "v")
elseif(IS_STATIC)
list(APPEND STATIC_METHODS "${FUNCNAME}:${TYPES}")
list(APPEND STATIC_METHODS "${FUNCNAME}:${LEN}:${TYPES}")
else()
list(APPEND METHODS "${FUNCNAME}:${TYPES}")
list(APPEND METHODS "${FUNCNAME}:${LEN}:${TYPES}")
endif()
continue()
endif()

View File

@@ -1,4 +1,4 @@
cmake_minimum_required(VERSION 3.17)
cmake_minimum_required(VERSION 3.5)
if(NOT INCLUDES_SOURCE_FILE)
message(FATAL_ERROR "Script needs INCLUDES_SOURCE_FILE defined")
@@ -19,7 +19,7 @@ endif()
file(READ "${API_FILES}" SCRIPT_API_BINARY_FILES)
foreach(FILE IN LISTS SCRIPT_API_BINARY_FILES)
file(STRINGS "${FILE}" LINES REGEX "^void SQ${APIUC}.*_Register\\(Squirrel &engine\\)$")
file(STRINGS "${FILE}" LINES REGEX "^void SQ${APIUC}.*_Register\\(Squirrel \\*engine\\)$")
if(LINES)
string(REGEX REPLACE ".*api/${APILC}/(.*)" "#include \"\\1\"" FILE "${FILE}")
list(APPEND SQUIRREL_INCLUDES "${FILE}")
@@ -28,7 +28,7 @@ foreach(FILE IN LISTS SCRIPT_API_BINARY_FILES)
continue()
endif()
string(REGEX REPLACE "^.*void " " " LINE "${LINE}")
string(REGEX REPLACE "Squirrel &" "" LINE "${LINE}")
string(REGEX REPLACE "Squirrel \\*" "" LINE "${LINE}")
list(APPEND SQUIRREL_REGISTER "${LINE}")
endforeach()
endif()

View File

@@ -1,6 +1,6 @@
# OpenTTD's admin network
Last updated: 2024-03-26
Last updated: 2011-01-20
## Table of contents
@@ -49,29 +49,10 @@ Last updated: 2024-03-26
Create a TCP connection to the server on port 3977. The application is
expected to authenticate within 10 seconds.
To authenticate send either an `ADMIN_PACKET_ADMIN_JOIN` or an
`ADMIN_PACKET_ADMIN_JOIN_SECURE` packet.
To authenticate send a `ADMIN_PACKET_ADMIN_JOIN` packet.
The `ADMIN_PACKET_ADMIN_JOIN` packet sends the password without any
encryption or safeguards over the connection, and as such has been disabled
by default.
The `ADMIN_PACKET_ADMIN_JOIN_SECURE` packet initiates a key exchange
authentication schema which tells te server which methods the client
supports and the server makes a choice. The server will then send an
`ADMIN_PACKET_SERVER_AUTH_REQUEST` packet to which the client has to respond
with an `ADMIN_PACKET_ADMIN_AUTH_RESPONSE` packet.
The current choices for secure authentication are authorized keys, where
the client has a private key and the server a list of authorized public
keys, and a so-called password-authenticated key exchange which allows to
authenticate using a password without actually sending the password.
The server falls back to password authentication when the client's key is
not in the list of authorized keys.
When authentication has succeeded for either of the `JOIN` schemas, the
server will reply with `ADMIN_PACKET_SERVER_PROTOCOL` followed directly
by `ADMIN_PACKET_SERVER_WELCOME`.
The server will reply with `ADMIN_PACKET_SERVER_PROTOCOL` followed directly by
`ADMIN_PACKET_SERVER_WELCOME`.
`ADMIN_PACKET_SERVER_PROTOCOL` contains details about the protocol version.
It is the job of your application to check this number and decide whether
@@ -223,7 +204,7 @@ Last updated: 2024-03-26
## 5.1) Receiving chat
Register `ADMIN_UPDATE_CHAT` at `AdminUpdateFrequency::Automatic` to receive chat.
Register `ADMIN_UPDATE_CHAT` at `ADMIN_FREQUENCY_AUTOMATIC` to receive chat.
The application will be able to receive all chat the server can see.
The configuration option `network.server_admin_chat` specifies whether

View File

@@ -1,62 +0,0 @@
# Fonts for OpenTTD
OpenTTD uses four different fonts:
- a medium font (used for most texts in the game)
- a small font (used for the smallmap legend etc)
- a large font (used for news headlines etc)
- a monospace font (used for text files such as NewGRF readmes).
You can use the following types of fonts with OpenTTD:
## OpenTTD's default fonts
These fonts are OpenTTD Sans (small and medium), OpenTTD Serif (large) and OpenTTD Mono (monospace). They are distributed as part of OpenTTD since version 14. The font files are included in the baseset directory of OpenTTD.
These fonts are active by default and support the Latin, Greek and Cyrillic scripts at present.
## Traditional sprite fonts
These are the classic bitmap fonts included as part of the base graphics. They support only the Latin script.
These fonts can be activated in the Graphics section of the Game options window, by enabling the option "Use traditional sprite fonts".
## System fonts
These are fonts installed on your computer. OpenTTD tries to automatically detect and activate a suitable system font in case you have selected a language not supported by the default fonts. However, if this fails, you may have to set a font manually.
There are two ways to manually set system fonts, using the `font` console command or editing the openttd.cfg file.
### Using the console
Open the console. On most keyboards, this is done by pressing the key to the left of 1 (\` on most English keyboards).
The command to change a font is `font [medium|small|large|mono] [<font name>] [<size>]`.
For example, `font large "Times New Roman" 16`.
The font name should be enclosed in double quotes if it contains spaces. Note that the size provided is multiplied by the interface scaling factor.
You can reset the font and size to the defaults by providing the font name "" (a blank font name). This will result in the OpenTTD default font or sprite font (depending on the setting) if you are using a supported language, or a default font determined by your OS otherwise.
You can view the current font configuration by running the command `font` without any arguments.
For more information, run the command `help font`.
### Using openttd.cfg
In openttd.cfg, the following settings under the `[misc]` section determine the font (this is just an example):
```
small_font =
medium_font = Arial Bold
large_font = Times New Roman
mono_font =
small_size = 6
medium_size = 10
large_size = 18
mono_size = 10
```
If these settings are not present, you can add them under the `[misc]` section.
If any font names are left blank, the default font and size are used.
If you cannot find the openttd.cfg file, see [the directory structure guide](./directory_structure.md).

View File

@@ -1,97 +0,0 @@
# Importing Town Data into OpenTTD
To aid players in scenario creation, OpenTTD's Scenario Editor can import town data from external JSON files. This enables players to use an image editing program to align town coordinates with a real-world heightmap using a map underlay, instead of guessing at the correct locations in Scenario Editor itself.
This town data consists of a JSON file storing an array of town data objects, each containing a name, location, target OpenTTD population, and whether it is marked as a city in the game.
This document describes the standard format for this JSON file and outlines a workflow for creating this data effectively.
## Table of contents
- Why load external data?
- How to use this feature
- Creating geodata
- Town data format standards
- Town data values
- Loading geodata into OpenTTD
- Tutorial: Creating town data
## Why load external data?
There are three benefits to using an image editing program to create towns instead of the OpenTTD Scenario Editor.
1. Placing towns accurately is much easier using a map underlay such as OpenStreetMap to match town locations with the corresponding heightmap.
2. Storing town data in a JSON file instead of as an OpenTTD Scenario (.scn) doesn't require choosing your NewGRF house set before placing towns.
3. Town coordinates are scaled by the map size, so you can load the data onto whatever size map you like.
## How to use this feature
### Creating geodata
Town data is a text file in the JSON format, with a list of towns, each containing a coordinate location and properties: name, population, and whether or not it should be a city in OpenTTD.
The format of this file is standardized for importing into OpenTTD and must be followed for OpenTTD to properly parse the data.
For use in OpenTTD, you will also need a matching heightmap of the terrain features, as a PNG.
#### Town data format standards
The following code sample is complete and can be used in OpenTTD.
- The list of towns is enclosed in an array marked with square brackets `[]`
- Each town is enclosed in curly braces `{}`, with a comma after each town except for the last in the list.
- The properties separated by commas except for the last.
- Property names are enclosed in double quotes `""` with a colon `:` separating it from the property value.
- The name property value is enclosed in double quotes `"London"`, while all other property values `44910`, `true`, etc., are not.
```
[
{
"name": "London",
"population": 44910,
"city": true,
"x": 0.7998046875,
"y": 0.708984375
},
{
"name": "Canterbury",
"population": 217.16,
"city": false,
"x": 0.83251953125,
"y": 0.828125
}
]
```
#### Town data values
- Population is scaled down for use in OpenTTD. It is possible to generate huge cities by using a large number, but there is a practical limit to town size. The larger the town, the longer it will take to import town data, since towns are placed at a relatively small size and then expanded until the population is greater than the player-defined target.
- X and Y coordinates are a proportion of the total map dimension, between 0 and 1. Just take the pixel coordinates of the town's location in the corresponding heightmap (more detail in the tutorial below) and divide each by the maximum value.
- For example, London is at `726, 1638` in a 1024 px by 2048 px heightmap, so `726 / 1024 = 0.7998046875` and `1638 / 2048 = 0.708984375` gives the correct coordinates for OpenTTD.
- The reason for these proportional coordinates is so the data can be used for any map size.
- 0,0 is (approximately) the very top tile in OpenTTD. You can see tile coordinates in-game with the Land Info Tool.
- In most image editing programs, 0,0 is the top-left corner of the image. You can rotate the image however you want relative to compass north to orient the map to your liking. Make sure you crop and resize the image before recording town locations.
- In OpenTTD, X and Y axis are swapped compared to most image editing programs and the standard Cartesian coordinate system. From the 0,0 origin at top left, X is the axis along the left side and Y is the axis along the right side. You can still measure X and Y coordinates in your image editing program, just swap them before importing into OpenTTD or towns won't line up with your heightmap.
### Loading geodata into OpenTTD
Using geodata to create a real-world location in OpenTTD is done in the Scenario Editor.
1. Choose the NewGRFs you want to use in the game.
2. Load the heightmap which you created in the geodata workflow. Either rotation will work, but the clockwise rotation is considered "correct" and the coordinates in the Land Info Tool will match your data; counter clockwise maps will align properly but the coordinates won't match your data.
3. In the Town Generation window, click `Load from file` and choose the .json file containing town data. The default directory to search for town data is `OpenTTD\scenario\heightmap`.
4. (Optional) Manually add industries, rivers, trees, and objects.
5. Save the game as a Scenario and exit to the main menu.
6. Load the game with Play Scenario and enjoy.
Sometimes it's not possible to place a town, such as when the heightmap is very rough and a flat tile can't be found with a 16-tile radius of the target tile. In such cases, a sign will be placed on the target tile with the name of the town. The player can then place the town manually or change the heightmap settings and try again. This fallback also helps debug errors with data creation, such as if towns end up in the ocean.
## Tutorial: Creating town data
1. Load both your heightmap and a labeled map like OpenStreetMap as layers in an image editing program. You can use a free/open-source program like QGIS to acquire, align, and export these map images, if you like.
2. Crop the image to your desired bounds, ensuring the aspect ratio is supported in OpenTTD (1:1, 1:2, 1:4, etc.).
3. Resize the image to one of OpenTTD's supported map sizes, such as 512 px by 1024 px. Some image editors let you do this part of step 2. You can always load heightmaps and town data at a reduced size, so you may want to make this larger than your intended use in case you want it later.
4. Use the labeled map layer to find the pixel coordinates of each town you'd like to include in your map. In GIMP this is displayed in the bottom left corner of the image window, and in Photoshop you need to enable the Info panel (F8) and switch to pixel units of measurement if not already.
5. Some spreadsheets including Google Sheets can export data as JSON, so you may want to record it there, to export after step 8. Or you can build the JSON file manually.
6. Adjust population numbers for OpenTTD.
7. Change coordinates from pixels to proportion (0-1) of the total dimension: `x / maximum_x` and `y / maximum_y`, as described in "Town data values" above.
8. Swap X and Y coordinates before importing to OpenTTD, since OpenTTD uses a reverse X and Y system than most image editors.
9. Save the heightmap and town data files in your `OpenTTD\scenario\heightmap` folder.

View File

@@ -64,7 +64,7 @@
<tr bgcolor="#CCCCCC"><td colspan="2">Only meaningful in tropic climate. It contains the definition of the available zones</td></tr>
<tr><td style="width: 5em;"><tt>00</tt></td><td>normal</td></tr>
<tr><td><tt>01</tt></td><td>desert</td></tr>
<tr><td><tt>02</tt></td><td>rainforest</td></tr>
<tr><td><tt>02</tt></td><td>rain forest</td></tr>
</table>
In any other climate these 2 bits are theoretically free of use, however using them does not seem useful.
</li>
@@ -721,10 +721,10 @@
</ul>
</li>
</ul>
<li>m3 bit 6 : free</li>
<li>m3 bit 5 : The house is protected from the town upgrading it</li>
<li>m3 bit 6 : bit 8 of house type (m4), allowing 512 different types.</li>
<li>m3 bit 5 : free</li>
<li>m3 bits 4..0 : triggers activated <a href="#newhouses">(newhouses)</a></li>
<li>m4 : free</li>
<li>m4 : <a href="landscape_externals.html">town building type</a> (with m3[6] bit)</li>
<li>m5 : see m3 bit 7</li>
<li>m6 :
<ul>
@@ -740,7 +740,6 @@
</li>
</ul>
</li>
<li>m6: bits 1..0: animated tile state</li>
<li>m7 :
<ul>
<li>If <a href="#newhouses">newhouses</a> is activated
@@ -760,12 +759,10 @@
</li>
</ul>
</li>
<li>m8 bits 15..12 : free</li>
<li>m8 bits 11..0 : <a href="landscape_externals.html">town building type</a></li>
</ul>
<small><a name="newhouses"></a>Newhouses is the name englobing a newGRF feature developed by TTDPatch devs (mainly Csaboka).<br>
It allows the replacement of the properties as well as the graphics of houses in the game.<br>
To distinguish between the standard behaviour and the newGRF one, HouseID is tested for anything above 110.<br>
To distinguish between the standard behaviour and the newGRF one, HouseID (m4 + m3[6]) is tested for anything above 110.<br>
110 is the count of standard houses. So above 110 means there is a new definition of at least one house</small>
</td>
</tr>
@@ -879,25 +876,6 @@
<li>m2: index into the array of stations</li>
<li>m3 bits 7..4: persistent random data for railway stations/waypoints and airports)</li>
<li>m3 bits 7..4: <a href="#OwnershipInfo">owner</a> of tram tracks (road stop)</li>
<li>m3 bits 3..2: ground type (road waypoints)
<table>
<tr>
<td><tt>0</tt>&nbsp; </td>
<td>on bare land</td>
</tr>
<tr>
<td><tt>1</tt>&nbsp; </td>
<td>on grass</td>
</tr>
<tr>
<td><tt>2</tt>&nbsp; </td>
<td>paved</td>
</tr>
</table>
</li>
<li>m3 bit 2: rail station / waypoint may have catenary pylons</li>
<li>m3 bit 1: rail station / waypoint may have catenary wires</li>
<li>m3 bit 0: rail station / waypoint is blocked</li>
<li>m4: custom station id; 0 means standard graphics</li>
<li>m4: <a href="#RoadType">Roadtype</a> for road stops</li>
<li>m5: graphics index (range from 0..255 for each station type):
@@ -978,22 +956,6 @@
</td>
</tr>
<tr>
<td nowrap valign=top><tt>04</tt>..<tt>05</tt>&nbsp; </td>
<td align=left>road waypoints
<table>
<tr>
<td><tt>04</tt>&nbsp; </td>
<td align=left>drive through X</td>
</tr>
<tr>
<td><tt>05</tt>&nbsp; </td>
<td align=left>drive through Y</td>
</tr>
</table>
</td>
</tr>
<tr>
<td nowrap valign=top><tt>00</tt>..<tt>05</tt>&nbsp; </td>
<td align=left>ship dock
@@ -1027,16 +989,17 @@
</tr>
</table>
</li>
<li>m6 bits 6..3: the station type (rail, airport, truck, bus, oilrig, dock, buoy, waypoint, road waypoint)</li>
<li>m6 bit 7: rail station / waypoint may have catenary pylons</li>
<li>m6 bit 6: rail station / waypoint may have catenary wires</li>
<li>m6 bits 5..3: the station type (rail, airport, truck, bus, oilrig, dock, buoy, waypoint)</li>
<li>m6 bit 2: pbs reservation state for railway stations/waypoints</li>
<li>m6 bits 1..0: animated tile state</li>
<li>m6 bit 0: rail station / waypoint is blocked</li>
<li>m7 bits 4..0: <a href="#OwnershipInfo">owner</a> of road (road stops)</li>
<li>m7: animation frame (railway stations/waypoints, airports)</li>
<li>m8 bit 15: Snow or desert present (road waypoints)</li>
<li>m8 bits 11..6: <a href="#TramType">Tramtype</a></li>
<li>m8 bits 5..0: <a href="#TrackType">track type</a> for railway stations/waypoints</li>
<li>m8 bits 5..0: custom road stop/waypoint id; 0 means standard graphics</li>
<li>m8 bits 5..0: custom road stop id; 0 means standard graphics</li>
</ul>
</td>
</tr>
@@ -1053,94 +1016,99 @@
<li>m1 bits 6..5 : Water class (sea, canal or river)
<li>m1 bits 4..0: <a href="#OwnershipInfo">owner</a> (for sea, rivers, and coasts normally <tt>11</tt>)</li>
<li>m2: Depot index (for depots only)</li>
<li>m3 bit 0: Non-flooding state</li>
<li>m4: Random data for canal or river tiles</li>
<li>m5 bits 7..4: Water tile type:
<li>m5: tile type:
<table>
<tr>
<td><tt>0</tt>&nbsp; </td>
<td>water, canal or river</td>
</tr>
<tr>
<td><tt>1</tt>&nbsp; </td>
<td>coast or riverbank</td>
</tr>
<tr>
<td nowrap valign=top><tt>2</tt>&nbsp; </td>
<td>canal lock<br>
<ul>
<li>m5 bits 3..2: Lock part
<table>
<tr>
<td><tt>0</tt>&nbsp; </td>
<td>Middle part</td>
</tr>
<tr>
<td><tt>1</tt>&nbsp; </td>
<td>Lower part</td>
</tr>
<tr>
<td><tt>2</tt>&nbsp; </td>
<td>Upper part</td>
</tr>
</table>
</li>
<li>m5 bits 1..0: Lock direction
<table>
<tr>
<td><tt>0</tt>&nbsp; </td>
<td>NE raised</td>
</tr>
<tr>
<td><tt>1</tt>&nbsp; </td>
<td>SE raised</td>
</tr>
<tr>
<td><tt>2</tt>&nbsp; </td>
<td>SW raised</td>
</tr>
<tr>
<td><tt>3</tt>&nbsp; </td>
<td>NW raised</td>
</tr>
</table>
</li>
</ul>
</td>
</tr>
<tr>
<td nowrap valign=top><tt>3</tt>&nbsp; </td>
<td>depot<br>
<ul>
<li>m5 bit 1: Depot axis
<table>
<tr>
<td><tt>0</tt>&nbsp; </td>
<td>X direction (NE-SW)</td>
</tr>
<tr>
<td><tt>1</tt>&nbsp; </td>
<td>Y direction (NW-SE)</td>
</tr>
</table>
</li>
<li>m5 bit 0: Depot part
<table>
<tr>
<td><tt>0</tt>&nbsp; </td>
<td>North part</td>
</tr>
<tr>
<td><tt>1</tt>&nbsp; </td>
<td>South part</td>
</tr>
</table>
</li>
</ul>
</td>
</tr>
</table>
</li>
<tr>
<td nowrap valign=top><tt>00</tt>&nbsp; </td>
<td align=left>water, canal or river</td>
</tr>
<tr>
<td nowrap valign=top><tt>01</tt>&nbsp; </td>
<td align=left>coast or riverbank</td>
</tr>
<tr>
<td nowrap valign=top><tt>10</tt>..<tt>1B</tt>&nbsp; </td>
<td align=left>canal locks
<table>
<tr>
<td nowrap valign=top><tt>10</tt>&nbsp; </td>
<td align=left>middle part, (SW-NE direction)</td>
</tr>
<tr>
<td nowrap valign=top><tt>11</tt>&nbsp; </td>
<td align=left>middle part, (NW-SE direction)</td>
</tr>
<tr>
<td nowrap valign=top><tt>12</tt>&nbsp; </td>
<td align=left>middle part, (NE-SW direction)</td>
</tr>
<tr>
<td nowrap valign=top><tt>13</tt>&nbsp; </td>
<td align=left>middle part, (SE-NW direction)</td>
</tr>
<tr>
<td nowrap valign=top><tt>14</tt>&nbsp; </td>
<td align=left>lower part, (SW-NE direction)</td>
</tr>
<tr>
<td nowrap valign=top><tt>15</tt>&nbsp; </td>
<td align=left>lower part, (NW-SE direction)</td>
</tr>
<tr>
<td nowrap valign=top><tt>16</tt>&nbsp; </td>
<td align=left>lower part, (NE-SW direction)</td>
</tr>
<tr>
<td nowrap valign=top><tt>17</tt>&nbsp; </td>
<td align=left>lower part, (SE-NW direction)</td>
</tr>
<tr>
<td nowrap valign=top><tt>18</tt>&nbsp; </td>
<td align=left>upper part, (SW-NE direction)</td>
</tr>
<tr>
<td nowrap valign=top><tt>19</tt>&nbsp; </td>
<td align=left>upper part, (NW-SE direction)</td>
</tr>
<tr>
<td nowrap valign=top><tt>1A</tt>&nbsp; </td>
<td align=left>upper part, (NE-SW direction)</td>
</tr>
<tr>
<td nowrap valign=top><tt>1B</tt>&nbsp; </td>
<td align=left>upper part, (SE-NW direction)</td>
</tr>
</table>
</td>
</tr>
<tr>
<td nowrap valign=top><tt>80</tt>..<tt>83</tt>&nbsp; </td>
<td align=left>ship depots
<table>
<tr>
<td nowrap valign=top><tt>80</tt>&nbsp; </td>
<td align=left>ship depot, NE part (X direction)</td>
</tr>
<tr>
<td nowrap valign=top><tt>81</tt>&nbsp; </td>
<td align=left>ship depot, SW part (X direction)</td>
</tr>
<tr>
<td nowrap valign=top><tt>82</tt>&nbsp; </td>
<td align=left>ship depot, NW part (Y direction)</td>
</tr>
<tr>
<td nowrap valign=top><tt>83</tt>&nbsp; </td>
<td align=left>ship depot, SE part (Y direction)</td>
</tr>
</table>
</td>
</tr>
</table>
</li>
</ul>
</td>
@@ -1483,7 +1451,6 @@
</li>
<li>m6 bits 5..3: random triggers (NewGRF)</li>
<li>m6 bit 2: bit 8 of type (see m5)</li>
<li>m6 bits 1..0: animated tile state</li>
<li>m7: animation frame</li>
</ul>
</td>
@@ -1656,7 +1623,6 @@
<li>m2: index into the array of objects, bits 0 to 15 (upper bits in m5)</li>
<li>m3: random bits</li>
<li>m5: index into the array of objects, bits 16 to 23 (lower bits in m2)</li>
<li>m6 bits 1..0: animated tile state</li>
<li>m7: animation counter</li>
</ul>
</td>

View File

@@ -79,8 +79,8 @@ 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" rowspan=29><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 meaningful in tropic climate. It contains the definition of the available zones">XX</span></td>
<td class="bits" rowspan=29><span class="used" title="Tile height">XXXX XXXX</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 meaningful 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>
@@ -130,7 +130,7 @@ the array so you can quickly see what is used and what is not.
<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><span class="free">OO OOOO</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>
@@ -156,17 +156,17 @@ the array so you can quickly see what is used and what is not.
<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="free">O</span><span class="used" title="The house is protected from the town upgrading it.">X</span><span class="usable" title="Activated triggers (bits 2..4 don't have a meaning)">X XX</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="free">OOOO OOOO</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="used" title="Animated tile state">XX</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</span> <span class="used" title="House type">XXXX XXXX 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="used" title="The house is protected from the town upgrading it.">X</span><span class="usable" title="Activated triggers (bits 2..4 don't have a meaning)">X XX</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">X X</span><span class="used" title="Construction counter">XXX</span></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>
@@ -181,14 +181,14 @@ the array so you can quickly see what is used and what is not.
<td class="bits"><span class="free">OOOO OOOO OOOO OOOO</span></td>
</tr>
<tr>
<td rowspan=8>5</td>
<td rowspan=7>5</td>
<td class="caption">rail station</td>
<td class="bits" rowspan=8><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=8><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">O</span><span class="used" title="May have pylons">X</span><span class="used" title="May have wires">X</span><span class="used" title="Tile is blocked">X</span></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">O</span><span class="used" title="Station type">XXX X</span><span class="used" title="Reserved track">X</span><span class="used" title="Animated tile state">XX</span></td>
<td class="bits" rowspan=2><span class="used" title="May have pylons">X</span><span class="used" title="May have wires">X</span><span class="used" title="Station type">XXX</span> <span class="used" title="Reserved track">X</span><span class="free">O</span><span class="used" title="Tile is blocked">X</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>
@@ -199,17 +199,12 @@ the array so you can quickly see what is used and what is not.
<tr>
<td class="caption">road stop</td>
<td class="bits"><span class="used" title="Owner of tram">XXXX</span> <span class="free">OOOO</span></td>
<td class="bits" rowspan=2><span class="free">OO</span><span class="used" title="Roadtype for road stop">XX XXXX</span></td>
<td class="bits" rowspan=2><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=6><span class="free">O</span><span class="used" title="Station type">XXX X</span><span class="free">O</span><span class="used" title="Animated tile state">XX</span></td>
<td class="bits" rowspan=2><span class="free">OOO</span><span class="used" title="Owner of road">X XXXX</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> <span class="used" title="Custom road stops specifications ID">XXXXXX</span></td>
</tr>
<tr>
<td class="caption">road waypoint</td>
<td class="bits"><span class="used" title="Owner of tram">XXXX</span> <span class="used" title="Pavement type">XX</span><span class="free">OO</span></td>
<td class="bits"><span class="used" title="Snow/desert present">X</span><span class="free">OOO</span> <span class="used" title="Tram type">XXXX XX</span> <span class="used" title="Custom road stops specifications ID">XXXXXX</span></td>
</tr>
<tr>
<td class="caption">airport</td>
<td class="bits"><span class="used" title="Random bits">XXXX</span> <span class="free">OOOO</span></td>
@@ -240,37 +235,32 @@ the array so you can quickly see what is used and what is not.
<td class="bits"><span class="free">OOOO OOOO</span></td>
</tr>
<tr>
<td rowspan=5>6</td>
<td class="caption">sea</td>
<td class="bits" rowspan=5><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=4><span class="free">OOOO OOOO OOOO OOOO</span></td>
<td class="bits" rowspan=5><span class="free">OOOO OOO</span><span class="used" title="Non-flooding state">X</span></td>
<td rowspan=4>6</td>
<td class="caption">sea, shore</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="used" title="Water tile type: coast, clear, lock, depot">0000</span> <span class="free">OOO0</span></td>
<td class="bits" rowspan=5><span class="free">OOOO OOOO</span></td>
<td class="bits" rowspan=5><span class="free">OOOO OOOO</span></td>
<td class="bits" rowspan=5><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"><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">0000</span> <span class="free">OOOO</span></td>
</tr>
<tr>
<td class="caption">shore</td>
<td class="bits"><span class="free">OOOO OOOO</span></td>
<td class="bits"><span class="used" title="Water tile type: coast, clear, lock, depot">0001</span> <span class="free">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">OOOO</span></td>
</tr>
<tr>
<td class="caption">lock</td>
<td class="bits"><span class="free">OOOO OOOO</span></td>
<td class="bits"><span class="used" title="Water tile type: coast, clear, lock, depot">0010</span> <span class="used" title="Lock part">XX</span><span class="used" title="Lock orientation m5[1..0]">XX</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"><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="used" title="Water tile type: coast, clear, lock, depot">0011</span> <span class="free">OO</span><span class="used" title="Depot axis">X</span><span class="used" title="Depot part">X</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 rowspan=2>8</td>
@@ -280,7 +270,7 @@ the array so you can quickly see what is used and what is not.
<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="used" title="Animated tile state">XX</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>
@@ -313,7 +303,7 @@ the array so you can quickly see what is used and what is not.
<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"><span class="pool" title="Object index on pool (m2 + m5)">XXXX XXXX</span></td>
<td class="bits"><span class="free">OOOO OO</span><span class="used" title="Animated tile state">XX</span></td>
<td class="bits"><span class="free">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>

View File

@@ -16,11 +16,8 @@
; - `openttd -I <name>` starts OpenTTD with the given set (case sensitive)
; - adding `graphicsset = <name>` to the misc section of openttd.cfg makes
; OpenTTD start with that graphics set by default
; - `grfid -m` can give the GRF file MD5 checksums that you need
; - The `--md5` output option for `nmlc` can also give the MD5 if you are
; encoding from an nml source
; - Simple file MD5 checksums, eg. using `md5sum` are not correct for grf
; container versions other than 1
; - there is a command line tool for all platforms called md5sum that can
; create the MD5 checksum you need.
; - all files specified in this file are search relatively to the path where
; this file is found, i.e. if the graphics files are in a subdir you have
; to add that subdir to the names in this file to! It will NOT search for
@@ -47,8 +44,6 @@ description.en_US = howdie
palette = DOS
; preferred blitter, optional; either 8bpp (default) or 32bpp.
blitter = 8bpp
; url, optional
url = https://github.com/my/baseset
; The files section lists the files that replace sprites.
; The file names are case sensitive.

View File

@@ -20,6 +20,7 @@
.Op Fl M Ar musicset
.Op Fl n Ar host Ns Oo : Ns Ar port Oc Ns Op # Ns Ar company
.Op Fl p Ar password
.Op Fl P Ar password
.Op Fl q Ar savegame
.Op Fl r Ar width Ns x Ns Ar height
.Op Fl s Ar driver
@@ -99,6 +100,10 @@ play as.
Password used to join server.
Only useful with
.Fl n .
.It Fl P Ar password
Password used to join company.
Only useful with
.Fl n .
.It Fl q Ar savegame
Write some information about the specified savegame and exit.
.It Fl Q

View File

@@ -7,20 +7,18 @@ This guide is for OpenTTD developers/maintainers, to release a new version of Op
* If this is a beta version release, skip this step.
* If this is an RC1 (first Release Candidate) build, create a new branch `release/nn` where `nn` is the major version number, then apply changes similar to [PR#9573](https://github.com/OpenTTD/OpenTTD/pull/9573). You also need to forwardport the changelog, as in [PR#10113](https://github.com/OpenTTD/OpenTTD/pull/10113).
* Update the version in `CMakeLists.txt` in the master branch, heading for the next major release, e.g. from 14.0 to 15.0.
* Add the new version to `ApiVersions` in `src/ai/ai_info.hpp` and `src/game/game_info.hpp`.
* Add the new version to `src/script/api/ai_changelog.hpp` and `src/script/api/game_changelog.hpp`.
* Update the version of regression in `bin/ai/regression/regression_info.nut`.
* Add a new (empty) AI compatibility script in `bin/ai/` and `bin/game/` for the version of the branch.
* Add a note to `src/saveload/saveload.h` about which savegame version is used in the branch.
* Update CMakeLists.txt
* Add a new (empty) AI compatibility script in bin/ai/
* Add the new version to CheckAPIVersion in src/ai/ai_info.cpp + src/game/game_info.cpp
* Add the new version to src/script/api/ai_changelog.hpp + src/script/api/game_changelog.hpp
* Update the version of regression in bin/ai/regression/regression_info.nut
* Add a note to src/saveload/saveload.h about which savegame version is used in the branch.
* If this is a later RC or release build and the release branch already exists, you'll need to backport fixes and language from master to this branch, which were merged after the branch diverged from master. You can use these two helper scripts: https://github.com/OpenTTD/scripts/tree/main/backport
* If this is a maintenance release, update the version in `CMakeLists.txt` in the release branch, e.g. from 14.0 to 14.1.
## Step 1: Prepare changelog documentation
1. Update the [changelog](../changelog.md) with new changes since the last release.
1. Update the [changelog](../changelog.txt) with new changes since the last release.
* Changelog entries are typically PR titles, but can be edited to be more helpful without context.
* Don't include fixes to things which haven't previously been released (like fixes to features which are in the same changelog).
* Order the entries by importance: `Feature > Add > Change > Fix`, then numerically by PR number.
@@ -31,26 +29,20 @@ This guide is for OpenTTD developers/maintainers, to release a new version of Op
1. Go to https://github.com/OpenTTD/website/new/main/_posts and write a new announcement post. See a [previous example](https://github.com/OpenTTD/website/pull/238) for a template.
2. Create a new branch for this post and open a PR for it.
3. Write announcement text for the store pages and socials like TT-Forums / Discord / Twitter / Reddit / Fosstodon / etc., and include it in the PR.
3. Write announcement text for socials like Forum/Discord/Twitter/Reddit and include it in the PR.
4. Create a Steam news image for that post and include it in the PR.
5. Check the website post ("View Deployment" link) and make corrections. We usually just use the GitHub web interface for this and squash the result later.
5. Check the website post (preview link via checks page) and make corrections. We usually just use the GitHub web interface for this and squash the result later.
6. Get this PR approved, but do not merge yet.
## Step 3: Make the actual OpenTTD release
1. Confirm that the version in `CMakeLists.txt` matches the intended release version.
2. Go to https://github.com/OpenTTD/OpenTTD/releases/new and create a new tag matching the release number. For the body of the release, copy in the changelog. "Set as a pre-release" for a beta or RC.
3. Wait for the OpenTTD release workflow to be complete.
4. If this is a full release:
* for `Steam`: under Steamworks -> SteamPipe -> Builds, set the "testing" branch live on the "default" branch. This will request 2FA validation.
* for `GOG`: under Builds, "Publish" the freshly uploaded builds to `Master`, `GOG-use only` and `Testing`.
* for `Microsoft Store`: ask orudge to publish the new release.
Access to `Steam`, `GOG` and/or `Microsoft Store` requires a developer account on that platform.
You will need access to the shared keystore in order to create such an account.
For help and/or access to either or both, please contact TrueBrain.
1. Go to https://github.com/OpenTTD/OpenTTD/releases/new and create a new tag matching the release number. For the body of the release, see any older release. "Set as a pre-release" for a beta or RC, set as latest for a real release.
2. Merge website PR.
3. Wait for the OpenTTD release checks to be complete.
4. Check that website links to the new release are working and correct, using the [staging website](https://www-staging.openttd.org/).
5. If this is a full release, ask orudge to update the Microsoft Store and TrueBrain to move the release from the "testing" to "default" branch on Steam.
## Step 4: Tell the world
1. Merge the website PR. This will publish the release post.
2. Make announcements on social media and store pages. You may need to coordinate with other developers who can make posts on TT-Forums, Twitter, Reddit, Fosstodon, Discord, Steam, GOG, Microsoft Store, etc.
1. Tag and create a website release to trigger the actions that update the website.
2. After the website is live, make announcements on social media. You may need to coordinate with other developers who can make posts on Twitter, Reddit, Steam, and GOG.

View File

@@ -1,426 +0,0 @@
# OpenTTD's known bugs
## Table of contents
- 1.0) [About](#10-about)
- 2.0) [Known bugs](#20-known-bugs)
## 1.0) About
All bugs listed below are marked as known. Please do not submit any bugs
that are the same as these. If you do, do not act surprised, because
we WILL flame you!
The current list of known bugs that we intend to fix can be found in our
bug tracking system at [https://github.com/OpenTTD/OpenTTD/issues](https://github.com/OpenTTD/OpenTTD/issues)
Also check the closed bugs when searching for your bug in this system as we
might have fixed the bug in the mean time.
## 2.0) Known bugs
This section lists all known bugs that we do not intend to fix and the
reasons why we think that fixing them is infeasible. We might make some
minor improvements that reduce the scope of these bugs, but we will not
be able to completely fix them.
### No suitable AI can be found:
If you have no AIs and an AI is started the so-called 'dummy' AI will
be loaded. This AI does nothing but writing a message on the AI debug
window and showing a red warning. There are basically two solutions
for this problem: Either you set the number of AI players to 0 so that
no AI is started. You find that setting at the top of the window in the
"AI / Game Scripts Settings" window.
The other solution is acquiring (downloading) some AI. The easiest way
to do this is via the "Check Online Content" button in the main (intro)
menu or directly in the "AI / Game Scripts Settings" dialogue via the
"Check Online Content" button.
### After a while of playing, colours get corrupted:
In Windows 7 the background slideshow corrupts the colour mapping
of OpenTTD's 8bpp screen modes. Workarounds for this are:
* Switching to windowed mode, instead of fullscreen
* Switching off background slideshow
* Setting up the `32bpp-anim` or `32bpp-optimized` blitter
### Custom vehicle type name is incorrectly aligned:
Some NewGRFs use sprites that are bigger than normal in the "buy
vehicle" window. Due to this they have to encode an offset for
the vehicle type name. Upon renaming the vehicle type this encoded
offset is stripped from the name because the "edit box" cannot show
this encoding. As a result the custom vehicle type names will get
the default alignment. The only way to (partially) fix this is by
adding spaces to the custom name.
### Clipping problems [#119]:
In some cases sprites are not drawn as one would expect. Examples of
this are aircraft that might be hidden below the runway or trees that
in some cases are rendered over vehicles.
The primary cause of this problem is that OpenTTD does not have enough
data (like a 3D model) to properly determine what needs to be drawn in
front of what. OpenTTD has bounding boxes but in lots of cases they
are either too big or too small and then cause problems with what
needs to be drawn in front of what. Also some visual tricks are used.
For example trains at 8 pixels high, the catenary needs to be drawn
above that. When you want to draw bridges on top of that, which are
only one height level (= 8 pixels) higher, you are getting into some
big problems.
We can not change the height levels; it would require us to either
redraw all vehicle or all landscape graphics. Doing so would mean we
leave the Transport Tycoon graphics, which in effect means OpenTTD
will not be a Transport Tycoon clone anymore.
### Mouse scrolling not possible at the edges of the screen [#383] [#3966]:
Scrolling the viewport with the mouse cursor at the edges of the screen
in the same direction of the edge will fail. If the cursor is near the
edge the scrolling will be very slow.
OpenTTD only receives cursor position updates when the cursor is inside
OpenTTD's window. It is not told how far you have moved the cursor
outside of OpenTTD's window.
### Lost trains ignore (block) exit signals [#1473]:
If trains are lost they ignore block exit signals, blocking junctions
with presignals. This is caused because the path finders cannot tell
where the train needs to go. As such a random direction is chosen at
each junction. This causes the trains to occasionally to make choices
that are unwanted from a player's point of view.
This will not be fixed because lost trains are in almost all cases a
network problem, e.g. a train can never reach a specific place. This
makes the impact of fixing the bug enormously small against the amount
of work needed to write a system that prevents the lost trains from
taking the wrong direction.
### Vehicle owner of last transfer leg gets paid for all [#2427]:
When you make a transfer system that switches vehicle owners. This
is only possible with 'industry stations', e.g. the oil rig station
the owner of the vehicle that does the final delivery gets paid for
the whole trip. It is not shared amongst the different vehicle
owners that have participated in transporting the cargo.
This sharing is not done because it would enormously increase the
memory and CPU usage in big games for something that is happening
in only one corner case. We think it is not worth the effort until
sharing of stations is an official feature.
### Forbid 90 degree turns does not work for crossing PBS paths [#2737]:
When you run a train through itself on a X junction with PBS turned on
the train will not obey the 'forbid 90 degree turns' setting. This is
due to the fact that we can not be sure that the setting was turned
off when the track was reserved, which means that we assume it was
turned on and that the setting does not hold at the time. We made it
this way to allow one to change the setting in-game, but it breaks
slightly when you are running your train through itself. Running a
train through means that your network is broken and is thus a user
error which OpenTTD tries to graciously handle.
Fixing this bug means that we need to record whether this particular
setting was turned on or off at the time the reservation was made. This
means adding quite a bit of data to the savegame for solving an issue
that is basically an user error. We think it is not worth the effort.
### Duplicate (station) names after renaming [#3204]:
After renaming stations one can create duplicate station names. This
is done giving a station the same custom name as another station with
an automatically generated name.
The major part of this problem is that station names are translatable.
Meaning that a station is called e.g. '<TOWN> Central' in English and
'<TOWN> Centraal' in Dutch. This means that in network games the
renaming of a town could cause the rename to succeed on some clients
and fail at others. This creates an inconsistent game state that will
be seen as a 'desync'. Secondly the custom names are intended to fall
completely outside of the '<TOWN> <name>' naming of stations, so when
you rename a town all station names are updated accordingly.
As a result the decision has been made that all custom names are only
compared to the other custom names in the same class and not compared
to the automatically generated names.
### Extreme CPU usage/hangs when using SDL and PulseAudio [#3294], OpenTTD hangs/freezes when closing, OpenTTD is slow, OpenTTD uses a lot of CPU:
OpenTTD can be extremely slow/use a lot of CPU when the sound is
played via SDL and then through PulseAudio's ALSA wrapper. Under the
same configuration OpenTTD, or rather SDL, might hang when exiting
the game. This problem is seen most in Ubuntu 9.04 and higher.
This is because recent versions of the PulseAudio sound server
are configured to use timer-based audio scheduling rather than
interrupt-based audio scheduling. Configuring PulseAudio to force
use of interrupt-based scheduling may resolve sound problems for
some users. Under recent versions of Ubuntu Linux (9.04 and higher)
this can be accomplished by changing the following line in the
`/etc/pulse/default.pa` file:
`load-module module-udev-detect`
to
`load-module module-udev-detect tsched=0`
Note that PulseAudio must be restarted for changes to take effect. Older
versions of PulseAudio may use the module-hal-detect module instead.
Adding tsched=0 to the end of that line will have a similar effect.
Another possible solution is selecting the "pulse" backend of SDL
by either using `SDL_AUDIODRIVER=pulse openttd` at the command
prompt or installing the `libsdl1.2debian-pulseaudio` package from
Ubuntu's Universe repository. For other distributions a similar
package needs to be installed.
### OpenTTD not properly resizing with SDL on X [#3305]:
Under some X window managers OpenTTD's window does not properly
resize. You will either end up with a black bar at the right/bottom
side of the window or you cannot see the right/bottom of the window,
e.g. you cannot see the status bar. The problem is that OpenTTD does
not always receive a resize event from SDL making it impossible for
OpenTTD to know that the window was resized; sometimes moving the
window will solve the problem.
Window managers that are known to exhibit this behaviour are GNOME's
and KDE's. With the XFCE's and LXDE's window managers the resize
event is sent when the user releases the mouse.
### Incorrect colours, crashes upon exit, debug warnings and smears upon window resizing with SDL on macOS [#3447]:
Video handling with (lib)SDL under macOS is known to fail on some
versions of macOS with some hardware configurations. Some of
the problems happen only under some circumstances whereas others
are always present.
We suggest that the SDL video/sound backend is not used for OpenTTD
in combinations with macOS.
### Train crashes entering same junction from block and path signals [#3928]:
When a train has reserved a path from a path signal to a two way
block signal and the reservation passes a path signal through the
back another train can enter the reserved path (only) via that
same two way block signal.
The reason for this has to do with optimisation; to fix this issue
the signal update has to pass all path signals until it finds either
a train or a backwards facing signal. This is a very expensive task.
The (signal) setups that allow these crashes can furthermore be
considered incorrectly signalled; one extra safe waiting point for
the train entering from path signal just after the backwards facing
signal (from the path signal train) resolves the issue.
### Crashes when run in a VM using Parallels Desktop [#4003]:
When the Windows version of OpenTTD is executed in a VM under
Parallels Desktop a privileged instruction exception may be thrown.
As OpenTTD works natively on macOS as well as natively on Windows and
these native builds both don't exhibit this behaviour this crash is
most likely due to a bug in the virtual machine, something out of
the scope of OpenTTD. Most likely this is due to Parallels Desktop
lacking support for RDTSC calls. The problem can be avoided by using
other VM-software, Wine, or running natively on macOS.
### Entry- and exit signals are not dragged [#4378]:
Unlike all other signal types, the entry- and exit signals are not
dragged but instead normal signals are placed on subsequent track
sections. This is done on purpose as this is the usually more
convenient solution. There are little to no occasions where more
than one entry or exit signal in a row are useful. This is different
for all other signal types where several in a row can serve one
purpose or another.
### (Temporary) wrong colours when switching to full screen [#4511]:
On Windows it can happen that you temporarily see wrong colours
when switching to full screen OpenTTD, either by starting
OpenTTD in full screen mode, changing to full screen mode or by
ALT-TAB-ing into a full screen OpenTTD. This is caused by the
fact that OpenTTD, by default, uses 8bpp paletted output. The
wrong colours you are seeing is a temporary effect of the video
driver switching to 8bpp palette mode.
This issue can be worked around in two ways:
* Setting fullscreen_bpp to 32
* Setting up the 32bpp-anim or 32bpp-optimized blitter
### Can't run OpenTTD with the -d option from a MSYS console [#4587]:
The MSYS console does not allow OpenTTD to open an extra console for
debugging output. Compiling OpenTTD with the --enable-console
configure option prevents this issue and allows the -d option to use
the MSYS console for its output.
### Unreadable characters for non-latin locales [#4607]:
OpenTTD does not ship a non-latin font in its graphics files. As a
result OpenTTD needs to acquire the font from somewhere else. What
OpenTTD does is ask the operating system, or a system library, for
the best font for a given language if the currently loaded font
does not provide all characters of the chosen translation. This
means that OpenTTD has no influence over the quality of the chosen
font; it just does the best it can do.
If the text is unreadable there are several steps that you can take
to improve this. The first step is finding a good font and configure
this in the configuration file. See section 9.0 of README.md for
more information. You can also increase the font size to make the
characters bigger and possible better readable.
If the problem is with the clarity of the font you might want to
enable anti-aliasing by setting the small_aa/medium_aa/large_aa
settings to "true". However, anti-aliasing only works when a 32-bit
blitter has been selected, e.g. `blitter = "32bpp-anim"`, as with the
8 bits blitter there are not enough colours to properly perform the
anti-aliasing.
### Train does not crash with itself [#4635]:
When a train drives in a circle the front engine passes through
wagons of the same train without crashing. This is intentional.
Signals are only aware of tracks, they do not consider the train
length and whether there would be enough room for a train in some
circle it might drive on. Also the path a train might take is not
necessarily known when passing a signal.
Checking all circumstances would take a lot of additional
computational power for signals, which is not considered worth
the effort, as it does not add anything to gameplay.
Nevertheless trains shall not crash in normal operation, so making
a train not crash with itself is the best solution for everyone.
### Aircraft coming through wall in rotated airports [#4705]:
With rotated airports, specifically hangars, you will see that the
aircraft will show a part through the back wall of the hangar.
This can be solved by only drawing a part of the plane when being
at the back of the hangar, however then with transparency turned on
the aircraft would be shown partially which would be even weirder.
As such the current behaviour is deemed the least bad.
The same applies to overly long ships and their depots.
### Vehicles not keeping their "maximum" speed [#4815]:
Vehicles that have not enough power to reach and maintain their
advertised maximum speed might be constantly jumping between two
speeds. This is due to the fact that speed and its calculations
are done with integral numbers instead of floating point numbers.
As a result of this a vehicle will never reach its equilibrium
between the drag/friction and propulsion. So in effect it will be
in a vicious circle of speeding up and slowing down due to being
just at the other side of the equilibrium.
Not speeding up when near the equilibrium will cause the vehicle to
never come in the neighbourhood of the equilibrium and not slowing
down when near the equilibrium will cause the vehicle to never slow
down towards the equilibrium once it has come down a hill.
It is possible to calculate whether the equilibrium will be passed,
but then all acceleration calculations need to be done twice.
### Settings not saved when OpenTTD crashes [#4846]:
The settings are not saved when OpenTTD crashes for several reasons.
The most important is that the game state is broken and as such the
settings might contain invalid values, or the settings have not even
been loaded yet. This would cause invalid or totally wrong settings
to be written to the configuration file.
A solution to that would be saving the settings whenever one changes,
however due to the way the configuration file is saved this requires
a flush of the file to the disk and OpenTTD needs to wait till that
is finished. On some file system implementations this causes the
flush of all 'write-dirty' caches, which can be a significant amount
of data to be written. This can further be aggravated by spinning
down disks to conserve power, in which case this disk needs to be
spun up first. This means that many seconds may pass before the
configuration file is actually written, and all that time OpenTTD
will not be able to show any progress. Changing the way the
configuration file is saved is not an option as that leaves us more
vulnerable to corrupt configuration files.
Finally, crashes should not be happening. If they happen they should
be reported and fixed, so essentially fixing this is fixing the wrong
thing. If you really need the configuration changes to be saved,
and you need to run a version that crashes regularly, then you can
use the `saveconfig` command in the console to save the settings.
### Not all NewGRFs, AIs, game scripts are found [#4887]:
Under certain situations, where the path for the content within a
tar file is the same as other content on the file system or in another
tar file, it is possible that content is not found. A more thorough
explanation and solutions are described in section 4.4 of README.md.
### Mouse cursor going missing with SDL [#4997]:
Under certain circumstances SDL does not notify OpenTTD of changes with
respect to the mouse pointer, specifically whether the mouse pointer
is within the bounds of OpenTTD or not. For example, if you "Alt-Tab"
to another application the mouse cursor will still be shown in OpenTTD,
and when you move the mouse outside of the OpenTTD window so the cursor
gets hidden, open/move another application on top of the OpenTTD window
and then Alt-tab back into OpenTTD the cursor will not be shown.
We cannot fix this problem as SDL simply does not provide the required
information in these corner cases. This is a bug in SDL and as such
there is little that we can do about it.
### Trains might not stop at platforms that are currently being changed [#5553]:
If you add tiles to or remove tiles from a platform while a train is
approaching to stop at the same platform, that train can miss the place
where it's supposed to stop and pass the station without stopping.
This is caused by the fact that the train is considered to already
have stopped if it's beyond its assigned stopping location. We can't
let the train stop just anywhere in the station because then it would
never leave the station if you have the same station in the order
list multiple times in a row or if there is only one station
in theorder list (see #5684).
### 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
do not (completely) separate the ground from the building.
This is a bug of the original graphics, and unfortunately cannot be
fixed with OpenGFX for the sake of maintaining compatibility with
the original graphics.
### Involuntary cargo exchange with cargodist via neutral station [#6114]:
When two players serve a neutral station at an industry, a cross-company
chain for cargo flow can and will be established which can only be
interrupted if one of the players stops competing for the resources of
that industry. There is an easy fix for this: If you are loading at the
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.

389
known-bugs.txt Normal file
View File

@@ -0,0 +1,389 @@
OpenTTD's known bugs
------------------------------------------------------------------------
Table of contents
-----------------
1.0) About
2.0) Known bugs
1.0) About
---- -----
All bugs listed below are marked as known. Please do not submit any bugs
that are the same as these. If you do, do not act surprised, because
we WILL flame you!
The current list of known bugs that we intend to fix can be found in our
bug tracking system at https://github.com/OpenTTD/OpenTTD/issues
Also check the closed bugs when searching for your bug in this system as we
might have fixed the bug in the mean time.
2.0) Known bugs
---- ----------------------------------
This section lists all known bugs that we do not intend to fix and the
reasons why we think that fixing them is infeasible. We might make some
minor improvements that reduce the scope of these bugs, but we will not
be able to completely fix them.
No suitable AI can be found:
If you have no AIs and an AI is started the so-called 'dummy' AI will
be loaded. This AI does nothing but writing a message on the AI debug
window and showing a red warning. There are basically two solutions
for this problem: Either you set the number of AI players to 0 so that
no AI is started. You find that setting at the top of the window in the
"AI / Game Scripts Settings" window.
The other solution is acquiring (downloading) some AI. The easiest way
to do this is via the "Check Online Content" button in the main (intro)
menu or directly in the "AI / Game Scripts Settings" dialogue via the
"Check Online Content" button.
After a while of playing, colours get corrupted:
In Windows 7 the background slideshow corrupts the colour mapping
of OpenTTD's 8bpp screen modes. Workarounds for this are:
a) Switching to windowed mode, instead of fullscreen
b) Switching off background slideshow
c) Setting up the 32bpp-anim or 32bpp-optimized blitter
Custom vehicle type name is incorrectly aligned:
Some NewGRFs use sprites that are bigger than normal in the "buy
vehicle" window. Due to this they have to encode an offset for
the vehicle type name. Upon renaming the vehicle type this encoded
offset is stripped from the name because the "edit box" cannot show
this encoding. As a result the custom vehicle type names will get
the default alignment. The only way to (partially) fix this is by
adding spaces to the custom name.
Clipping problems [#119]:
In some cases sprites are not drawn as one would expect. Examples of
this are aircraft that might be hidden below the runway or trees that
in some cases are rendered over vehicles.
The primary cause of this problem is that OpenTTD does not have enough
data (like a 3D model) to properly determine what needs to be drawn in
front of what. OpenTTD has bounding boxes but in lots of cases they
are either too big or too small and then cause problems with what
needs to be drawn in front of what. Also some visual tricks are used.
For example trains at 8 pixels high, the catenary needs to be drawn
above that. When you want to draw bridges on top of that, which are
only one height level (= 8 pixels) higher, you are getting into some
big problems.
We can not change the height levels; it would require us to either
redraw all vehicle or all landscape graphics. Doing so would mean we
leave the Transport Tycoon graphics, which in effect means OpenTTD
will not be a Transport Tycoon clone anymore.
Mouse scrolling not possible at the edges of the screen [#383] [#3966]:
Scrolling the viewport with the mouse cursor at the edges of the screen
in the same direction of the edge will fail. If the cursor is near the
edge the scrolling will be very slow.
OpenTTD only receives cursor position updates when the cursor is inside
OpenTTD's window. It is not told how far you have moved the cursor
outside of OpenTTD's window.
Lost trains ignore (block) exit signals [#1473]:
If trains are lost they ignore block exit signals, blocking junctions
with presignals. This is caused because the path finders cannot tell
where the train needs to go. As such a random direction is chosen at
each junction. This causes the trains to occasionally to make choices
that are unwanted from a player's point of view.
This will not be fixed because lost trains are in almost all cases a
network problem, e.g. a train can never reach a specific place. This
makes the impact of fixing the bug enormously small against the amount
of work needed to write a system that prevents the lost trains from
taking the wrong direction.
Vehicle owner of last transfer leg gets paid for all [#2427]:
When you make a transfer system that switches vehicle owners. This
is only possible with 'industry stations', e.g. the oil rig station
the owner of the vehicle that does the final delivery gets paid for
the whole trip. It is not shared amongst the different vehicle
owners that have participated in transporting the cargo.
This sharing is not done because it would enormously increase the
memory and CPU usage in big games for something that is happening
in only one corner case. We think it is not worth the effort until
sharing of stations is an official feature.
Forbid 90 degree turns does not work for crossing PBS paths [#2737]:
When you run a train through itself on a X junction with PBS turned on
the train will not obey the 'forbid 90 degree turns' setting. This is
due to the fact that we can not be sure that the setting was turned
off when the track was reserved, which means that we assume it was
turned on and that the setting does not hold at the time. We made it
this way to allow one to change the setting in-game, but it breaks
slightly when you are running your train through itself. Running a
train through means that your network is broken and is thus a user
error which OpenTTD tries to graciously handle.
Fixing this bug means that we need to record whether this particular
setting was turned on or off at the time the reservation was made. This
means adding quite a bit of data to the savegame for solving an issue
that is basically an user error. We think it is not worth the effort.
Duplicate (station) names after renaming [#3204]:
After renaming stations one can create duplicate station names. This
is done giving a station the same custom name as another station with
an automatically generated name.
The major part of this problem is that station names are translatable.
Meaning that a station is called e.g. '<TOWN> Central' in English and
'<TOWN> Centraal' in Dutch. This means that in network games the
renaming of a town could cause the rename to succeed on some clients
and fail at others. This creates an inconsistent game state that will
be seen as a 'desync'. Secondly the custom names are intended to fall
completely outside of the '<TOWN> <name>' naming of stations, so when
you rename a town all station names are updated accordingly.
As a result the decision has been made that all custom names are only
compared to the other custom names in the same class and not compared
to the automatically generated names.
Extreme CPU usage/hangs when using SDL and PulseAudio [#3294],
OpenTTD hangs/freezes when closing, OpenTTD is slow, OpenTTD uses a lot of CPU:
OpenTTD can be extremely slow/use a lot of CPU when the sound is
played via SDL and then through PulseAudio's ALSA wrapper. Under the
same configuration OpenTTD, or rather SDL, might hang when exiting
the game. This problem is seen most in Ubuntu 9.04 and higher.
This is because recent versions of the PulseAudio sound server
are configured to use timer-based audio scheduling rather than
interrupt-based audio scheduling. Configuring PulseAudio to force
use of interrupt-based scheduling may resolve sound problems for
some users. Under recent versions of Ubuntu Linux (9.04 and higher)
this can be accomplished by changing the following line in the
/etc/pulse/default.pa file:
load-module module-udev-detect
to
load-module module-udev-detect tsched=0
Note that PulseAudio must be restarted for changes to take effect. Older
versions of PulseAudio may use the module-hal-detect module instead.
Adding tsched=0 to the end of that line will have a similar effect.
Another possible solution is selecting the "pulse" backend of SDL
by either using "SDL_AUDIODRIVER=pulse openttd" at the command
prompt or installing the 'libsdl1.2debian-pulseaudio' package from
Ubuntu's Universe repository. For other distributions a similar
package needs to be installed.
OpenTTD not properly resizing with SDL on X [#3305]:
Under some X window managers OpenTTD's window does not properly
resize. You will either end up with a black bar at the right/bottom
side of the window or you cannot see the right/bottom of the window,
e.g. you cannot see the status bar. The problem is that OpenTTD does
not always receive a resize event from SDL making it impossible for
OpenTTD to know that the window was resized; sometimes moving the
window will solve the problem.
Window managers that are known to exhibit this behaviour are GNOME's
and KDE's. With the XFCE's and LXDE's window managers the resize
event is sent when the user releases the mouse.
Incorrect colours, crashes upon exit, debug warnings and smears upon
window resizing with SDL on macOS [#3447]:
Video handling with (lib)SDL under macOS is known to fail on some
versions of macOS with some hardware configurations. Some of
the problems happen only under some circumstances whereas others
are always present.
We suggest that the SDL video/sound backend is not used for OpenTTD
in combinations with macOS.
Train crashes entering same junction from block and path signals [#3928]:
When a train has reserved a path from a path signal to a two way
block signal and the reservation passes a path signal through the
back another train can enter the reserved path (only) via that
same two way block signal.
The reason for this has to do with optimisation; to fix this issue
the signal update has to pass all path signals until it finds either
a train or a backwards facing signal. This is a very expensive task.
The (signal) setups that allow these crashes can furthermore be
considered incorrectly signalled; one extra safe waiting point for
the train entering from path signal just after the backwards facing
signal (from the path signal train) resolves the issue.
Crashes when run in a VM using Parallels Desktop [#4003]:
When the Windows version of OpenTTD is executed in a VM under
Parallels Desktop a privileged instruction exception may be thrown.
As OpenTTD works natively on macOS as well as natively on Windows and
these native builds both don't exhibit this behaviour this crash is
most likely due to a bug in the virtual machine, something out of
the scope of OpenTTD. Most likely this is due to Parallels Desktop
lacking support for RDTSC calls. The problem can be avoided by using
other VM-software, Wine, or running natively on macOS.
Entry- and exit signals are not dragged [#4378]:
Unlike all other signal types, the entry- and exit signals are not
dragged but instead normal signals are placed on subsequent track
sections. This is done on purpose as this is the usually more
convenient solution. There are little to no occasions where more
than one entry or exit signal in a row are useful. This is different
for all other signal types where several in a row can serve one
purpose or another.
Station build date is incorrect [#4415]:
The tile query tool will show the date of the last (re)construction
at the station and not the date of the first construction. This is
due to compatibility reasons with NewGRFs and the fact that it is
wrong to say that the station is built in a particular year when it
was completely destroyed/rebuilt later on.
The tile query tool can be fixed by changing the "Build date" text
to "Date at which the last (re)construction took place" but this is
deemed too specific and long for that window.
(Temporary) wrong colours when switching to full screen [#4511]:
On Windows it can happen that you temporarily see wrong colours
when switching to full screen OpenTTD, either by starting
OpenTTD in full screen mode, changing to full screen mode or by
ALT-TAB-ing into a full screen OpenTTD. This is caused by the
fact that OpenTTD, by default, uses 8bpp paletted output. The
wrong colours you are seeing is a temporary effect of the video
driver switching to 8bpp palette mode.
This issue can be worked around in two ways:
a) Setting fullscreen_bpp to 32
b) Setting up the 32bpp-anim or 32bpp-optimized blitter
Can't run OpenTTD with the -d option from a MSYS console [#4587]:
The MSYS console does not allow OpenTTD to open an extra console for
debugging output. Compiling OpenTTD with the --enable-console
configure option prevents this issue and allows the -d option to use
the MSYS console for its output.
Unreadable characters for non-latin locales [#4607]:
OpenTTD does not ship a non-latin font in its graphics files. As a
result OpenTTD needs to acquire the font from somewhere else. What
OpenTTD does is ask the operating system, or a system library, for
the best font for a given language if the currently loaded font
does not provide all characters of the chosen translation. This
means that OpenTTD has no influence over the quality of the chosen
font; it just does the best it can do.
If the text is unreadable there are several steps that you can take
to improve this. The first step is finding a good font and configure
this in the configuration file. See section 9.0 of README.md for
more information. You can also increase the font size to make the
characters bigger and possible better readable.
If the problem is with the clarity of the font you might want to
enable anti-aliasing by setting the small_aa/medium_aa/large_aa
settings to "true". However, anti-aliasing only works when a 32-bit
blitter has been selected, e.g. blitter = "32bpp-anim", as with the
8 bits blitter there are not enough colours to properly perform the
anti-aliasing.
Train does not crash with itself [#4635]:
When a train drives in a circle the front engine passes through
wagons of the same train without crashing. This is intentional.
Signals are only aware of tracks, they do not consider the train
length and whether there would be enough room for a train in some
circle it might drive on. Also the path a train might take is not
necessarily known when passing a signal.
Checking all circumstances would take a lot of additional
computational power for signals, which is not considered worth
the effort, as it does not add anything to gameplay.
Nevertheless trains shall not crash in normal operation, so making
a train not crash with itself is the best solution for everyone.
Aircraft coming through wall in rotated airports [#4705]:
With rotated airports, specifically hangars, you will see that the
aircraft will show a part through the back wall of the hangar.
This can be solved by only drawing a part of the plane when being
at the back of the hangar, however then with transparency turned on
the aircraft would be shown partially which would be even weirder.
As such the current behaviour is deemed the least bad.
The same applies to overly long ships and their depots.
Vehicles not keeping their "maximum" speed [#4815]:
Vehicles that have not enough power to reach and maintain their
advertised maximum speed might be constantly jumping between two
speeds. This is due to the fact that speed and its calculations
are done with integral numbers instead of floating point numbers.
As a result of this a vehicle will never reach its equilibrium
between the drag/friction and propulsion. So in effect it will be
in a vicious circle of speeding up and slowing down due to being
just at the other side of the equilibrium.
Not speeding up when near the equilibrium will cause the vehicle to
never come in the neighbourhood of the equilibrium and not slowing
down when near the equilibrium will cause the vehicle to never slow
down towards the equilibrium once it has come down a hill.
It is possible to calculate whether the equilibrium will be passed,
but then all acceleration calculations need to be done twice.
Settings not saved when OpenTTD crashes [#4846]:
The settings are not saved when OpenTTD crashes for several reasons.
The most important is that the game state is broken and as such the
settings might contain invalid values, or the settings have not even
been loaded yet. This would cause invalid or totally wrong settings
to be written to the configuration file.
A solution to that would be saving the settings whenever one changes,
however due to the way the configuration file is saved this requires
a flush of the file to the disk and OpenTTD needs to wait till that
is finished. On some file system implementations this causes the
flush of all 'write-dirty' caches, which can be a significant amount
of data to be written. This can further be aggravated by spinning
down disks to conserve power, in which case this disk needs to be
spun up first. This means that many seconds may pass before the
configuration file is actually written, and all that time OpenTTD
will not be able to show any progress. Changing the way the
configuration file is saved is not an option as that leaves us more
vulnerable to corrupt configuration files.
Finally, crashes should not be happening. If they happen they should
be reported and fixed, so essentially fixing this is fixing the wrong
thing. If you really need the configuration changes to be saved,
and you need to run a version that crashes regularly, then you can
use the 'saveconfig' command in the console to save the settings.
Not all NewGRFs, AIs, game scripts are found [#4887]:
Under certain situations, where the path for the content within a
tar file is the same as other content on the file system or in another
tar file, it is possible that content is not found. A more thorough
explanation and solutions are described in section 4.4 of README.md.
Mouse cursor going missing with SDL [#4997]:
Under certain circumstances SDL does not notify OpenTTD of changes with
respect to the mouse pointer, specifically whether the mouse pointer
is within the bounds of OpenTTD or not. For example, if you "Alt-Tab"
to another application the mouse cursor will still be shown in OpenTTD,
and when you move the mouse outside of the OpenTTD window so the cursor
gets hidden, open/move another application on top of the OpenTTD window
and then Alt-tab back into OpenTTD the cursor will not be shown.
We cannot fix this problem as SDL simply does not provide the required
information in these corner cases. This is a bug in SDL and as such
there is little that we can do about it.
Trains might not stop at platforms that are currently being changed [#5553]:
If you add tiles to or remove tiles from a platform while a train is
approaching to stop at the same platform, that train can miss the place
where it's supposed to stop and pass the station without stopping.
This is caused by the fact that the train is considered to already
have stopped if it's beyond its assigned stopping location. We can't
let the train stop just anywhere in the station because then it would
never leave the station if you have the same station in the order
list multiple times in a row or if there is only one station
in theorder list (see #5684).
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
do not (completely) separate the ground from the building.
This is a bug of the original graphics, and unfortunately cannot be
fixed with OpenGFX for the sake of maintaining compatibility with
the original graphics.
Involuntary cargo exchange with cargodist via neutral station [#6114]:
When two players serve a neutral station at an industry, a cross-company
chain for cargo flow can and will be established which can only be
interrupted if one of the players stops competing for the resources of
that industry. There is an easy fix for this: If you are loading at the
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.

Binary file not shown.

View File

@@ -1,6 +1,6 @@
# OpenTTD TrueType font
The OpenTTD TrueType font was created by Zephyris and is maintained on [Github](https://github.com/OpenTTD/OpenTTD-TTF).
The OpenTTD TrueType font was created by Zephyris and is maintained on [Github](https://github.com/zephyris/openttd-ttf).
It is licensed under GPL-2.0.
The currently included files correspond to release v0.7.
The currently included files correspond to release v0.6.

Binary file not shown.

View File

@@ -1 +1 @@
a4a727b03a7cd07ee0499231f7f233f4
4f03553f614a06d86dc06376db3353c7

View File

@@ -18,10 +18,8 @@ if(GRFCODEC_FOUND)
${CMAKE_CURRENT_SOURCE_DIR}/oneway.nfo
${CMAKE_CURRENT_SOURCE_DIR}/openttd.nfo
${CMAKE_CURRENT_SOURCE_DIR}/openttdgui.nfo
${CMAKE_CURRENT_SOURCE_DIR}/overlay_rocks.nfo
${CMAKE_CURRENT_SOURCE_DIR}/palette.nfo
${CMAKE_CURRENT_SOURCE_DIR}/roadstops.nfo
${CMAKE_CURRENT_SOURCE_DIR}/road_waypoints.nfo
${CMAKE_CURRENT_SOURCE_DIR}/signals.nfo
${CMAKE_CURRENT_SOURCE_DIR}/sloped_tracks.nfo
${CMAKE_CURRENT_SOURCE_DIR}/tramtracks.nfo
@@ -43,13 +41,7 @@ if(GRFCODEC_FOUND)
${CMAKE_CURRENT_SOURCE_DIR}/openttdgui_convert_road.png
${CMAKE_CURRENT_SOURCE_DIR}/openttdgui_convert_tram.png
${CMAKE_CURRENT_SOURCE_DIR}/openttdgui_group_livery.png
${CMAKE_CURRENT_SOURCE_DIR}/overlay_rocks.png
${CMAKE_CURRENT_SOURCE_DIR}/overlay_snowy_rocks_1.png
${CMAKE_CURRENT_SOURCE_DIR}/overlay_snowy_rocks_2.png
${CMAKE_CURRENT_SOURCE_DIR}/overlay_snowy_rocks_3.png
${CMAKE_CURRENT_SOURCE_DIR}/overlay_snowy_rocks_4.png
${CMAKE_CURRENT_SOURCE_DIR}/roadstops.png
${CMAKE_CURRENT_SOURCE_DIR}/road_waypoints.png
${CMAKE_CURRENT_SOURCE_DIR}/signals.png
${CMAKE_CURRENT_SOURCE_DIR}/sloped_tracks.png
${CMAKE_CURRENT_SOURCE_DIR}/tramtracks.png

View File

@@ -671,9 +671,9 @@
// U+2026: Horizontal Ellipsis
-1 * 18 12 04 00 01 26 20 01 01 26 20 02 01 26 20 03 01 26 20
-1 sprites/chars.png 8bpp 560 370 9 12 0 -1 normal
-1 sprites/chars.png 8bpp 560 370 11 12 0 -1 normal
-1 sprites/chars.png 8bpp 560 390 5 7 0 0 normal
-1 sprites/chars.png 8bpp 560 400 14 21 0 -2 normal
-1 sprites/chars.png 8bpp 560 400 15 21 0 -2 normal
-1 sprites/mono.png 8bpp 265 270 7 13 0 0 normal
// U+2039: Single Left-Pointing Angle Quotation Mark
@@ -840,7 +840,3 @@
-1 sprites/chars.png 8bpp 630 400 6 21 0 -2 normal
-1 sprites/mono.png 8bpp 325 270 7 13 0 0 normal
-1 sprites/mono.png 8bpp 340 270 7 13 0 0 normal
// U+E29D: Small left arrow
-1 * 6 12 01 01 01 9D E2
-1 sprites/chars.png 8bpp 10 430 5 5 0 1 normal

Binary file not shown.

Before

Width:  |  Height:  |  Size: 17 KiB

After

Width:  |  Height:  |  Size: 17 KiB

View File

@@ -98,5 +98,3 @@
#include "mono.nfo"
#include "tunnel_portals.nfo"
#include "palette.nfo"
#include "road_waypoints.nfo"
#include "overlay_rocks.nfo"

View File

@@ -4,7 +4,7 @@
// 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/>.
//
-1 * 0 0C "OpenTTD GUI graphics"
-1 * 3 05 15 \b 192 // OPENTTD_SPRITE_COUNT
-1 * 3 05 15 \b 191 // OPENTTD_SPRITE_COUNT
-1 sprites/openttdgui.png 8bpp 66 8 64 31 -31 7 normal
-1 sprites/openttdgui.png 8bpp 146 8 64 31 -31 7 normal
-1 sprites/openttdgui.png 8bpp 226 8 64 31 -31 7 normal
@@ -196,4 +196,3 @@
-1 sprites/openttdgui.png 8bpp 567 440 12 10 0 0 normal
-1 sprites/openttdgui.png 8bpp 581 440 10 10 0 0 normal
-1 sprites/openttdgui.png 8bpp 593 440 10 10 0 0 normal
-1 sprites/openttdgui.png 8bpp 605 440 8 10 0 0 normal

Binary file not shown.

Before

Width:  |  Height:  |  Size: 26 KiB

After

Width:  |  Height:  |  Size: 44 KiB

View File

@@ -1,112 +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/>.
//
-1 * 0 0C "Overlay rocks"
-1 * 3 05 1A 5F
// Plain overlay rocks (unused...)
-1 sprites/overlay_rocks.png 8bpp 1 1 64 31 -31 0 normal
-1 sprites/overlay_rocks.png 8bpp 81 1 64 31 -31 0 normal
-1 sprites/overlay_rocks.png 8bpp 161 1 64 23 -31 0 normal
-1 sprites/overlay_rocks.png 8bpp 241 1 64 23 -31 0 normal
-1 sprites/overlay_rocks.png 8bpp 321 1 64 31 -31 0 normal
-1 sprites/overlay_rocks.png 8bpp 401 1 64 31 -31 0 normal
-1 sprites/overlay_rocks.png 8bpp 481 1 64 23 -31 0 normal
-1 sprites/overlay_rocks.png 8bpp 561 1 64 23 -31 0 normal
-1 sprites/overlay_rocks.png 8bpp 641 1 64 39 -31 -8 normal
-1 sprites/overlay_rocks.png 8bpp 721 1 64 39 -31 -8 normal
-1 sprites/overlay_rocks.png 8bpp 801 1 64 31 -31 -8 normal
-1 sprites/overlay_rocks.png 8bpp 881 1 64 31 -31 -8 normal
-1 sprites/overlay_rocks.png 8bpp 961 1 64 39 -31 -8 normal
-1 sprites/overlay_rocks.png 8bpp 1041 1 64 39 -31 -8 normal
-1 sprites/overlay_rocks.png 8bpp 1121 1 64 31 -31 -8 normal
-1 sprites/overlay_rocks.png 8bpp 1201 1 64 47 -31 -16 normal
-1 sprites/overlay_rocks.png 8bpp 1281 1 64 15 -31 0 normal
-1 sprites/overlay_rocks.png 8bpp 1361 1 64 31 -31 -8 normal
-1 sprites/overlay_rocks.png 8bpp 1441 1 64 31 -31 -8 normal
// Snowy rocks level 0
-1 sprites/overlay_snowy_rocks_1.png 8bpp 1 1 64 31 -31 0 normal
-1 sprites/overlay_snowy_rocks_1.png 8bpp 81 1 64 31 -31 0 normal
-1 sprites/overlay_snowy_rocks_1.png 8bpp 161 1 64 23 -31 0 normal
-1 sprites/overlay_snowy_rocks_1.png 8bpp 241 1 64 23 -31 0 normal
-1 sprites/overlay_snowy_rocks_1.png 8bpp 321 1 64 31 -31 0 normal
-1 sprites/overlay_snowy_rocks_1.png 8bpp 401 1 64 31 -31 0 normal
-1 sprites/overlay_snowy_rocks_1.png 8bpp 481 1 64 23 -31 0 normal
-1 sprites/overlay_snowy_rocks_1.png 8bpp 561 1 64 23 -31 0 normal
-1 sprites/overlay_snowy_rocks_1.png 8bpp 641 1 64 39 -31 -8 normal
-1 sprites/overlay_snowy_rocks_1.png 8bpp 721 1 64 39 -31 -8 normal
-1 sprites/overlay_snowy_rocks_1.png 8bpp 801 1 64 31 -31 -8 normal
-1 sprites/overlay_snowy_rocks_1.png 8bpp 881 1 64 31 -31 -8 normal
-1 sprites/overlay_snowy_rocks_1.png 8bpp 961 1 64 39 -31 -8 normal
-1 sprites/overlay_snowy_rocks_1.png 8bpp 1041 1 64 39 -31 -8 normal
-1 sprites/overlay_snowy_rocks_1.png 8bpp 1121 1 64 31 -31 -8 normal
-1 sprites/overlay_snowy_rocks_1.png 8bpp 1201 1 64 47 -31 -16 normal
-1 sprites/overlay_snowy_rocks_1.png 8bpp 1281 1 64 15 -31 0 normal
-1 sprites/overlay_snowy_rocks_1.png 8bpp 1361 1 64 31 -31 -8 normal
-1 sprites/overlay_snowy_rocks_1.png 8bpp 1441 1 64 31 -31 -8 normal
// Snowy rocks level 1
-1 sprites/overlay_snowy_rocks_2.png 8bpp 1 1 64 31 -31 0 normal
-1 sprites/overlay_snowy_rocks_2.png 8bpp 81 1 64 31 -31 0 normal
-1 sprites/overlay_snowy_rocks_2.png 8bpp 161 1 64 23 -31 0 normal
-1 sprites/overlay_snowy_rocks_2.png 8bpp 241 1 64 23 -31 0 normal
-1 sprites/overlay_snowy_rocks_2.png 8bpp 321 1 64 31 -31 0 normal
-1 sprites/overlay_snowy_rocks_2.png 8bpp 401 1 64 31 -31 0 normal
-1 sprites/overlay_snowy_rocks_2.png 8bpp 481 1 64 23 -31 0 normal
-1 sprites/overlay_snowy_rocks_2.png 8bpp 561 1 64 23 -31 0 normal
-1 sprites/overlay_snowy_rocks_2.png 8bpp 641 1 64 39 -31 -8 normal
-1 sprites/overlay_snowy_rocks_2.png 8bpp 721 1 64 39 -31 -8 normal
-1 sprites/overlay_snowy_rocks_2.png 8bpp 801 1 64 31 -31 -8 normal
-1 sprites/overlay_snowy_rocks_2.png 8bpp 881 1 64 31 -31 -8 normal
-1 sprites/overlay_snowy_rocks_2.png 8bpp 961 1 64 39 -31 -8 normal
-1 sprites/overlay_snowy_rocks_2.png 8bpp 1041 1 64 39 -31 -8 normal
-1 sprites/overlay_snowy_rocks_2.png 8bpp 1121 1 64 31 -31 -8 normal
-1 sprites/overlay_snowy_rocks_2.png 8bpp 1201 1 64 47 -31 -16 normal
-1 sprites/overlay_snowy_rocks_2.png 8bpp 1281 1 64 15 -31 0 normal
-1 sprites/overlay_snowy_rocks_2.png 8bpp 1361 1 64 31 -31 -8 normal
-1 sprites/overlay_snowy_rocks_2.png 8bpp 1441 1 64 31 -31 -8 normal
// Snowy rocks level 2
-1 sprites/overlay_snowy_rocks_3.png 8bpp 1 1 64 31 -31 0 normal
-1 sprites/overlay_snowy_rocks_3.png 8bpp 81 1 64 31 -31 0 normal
-1 sprites/overlay_snowy_rocks_3.png 8bpp 161 1 64 23 -31 0 normal
-1 sprites/overlay_snowy_rocks_3.png 8bpp 241 1 64 23 -31 0 normal
-1 sprites/overlay_snowy_rocks_3.png 8bpp 321 1 64 31 -31 0 normal
-1 sprites/overlay_snowy_rocks_3.png 8bpp 401 1 64 31 -31 0 normal
-1 sprites/overlay_snowy_rocks_3.png 8bpp 481 1 64 23 -31 0 normal
-1 sprites/overlay_snowy_rocks_3.png 8bpp 561 1 64 23 -31 0 normal
-1 sprites/overlay_snowy_rocks_3.png 8bpp 641 1 64 39 -31 -8 normal
-1 sprites/overlay_snowy_rocks_3.png 8bpp 721 1 64 39 -31 -8 normal
-1 sprites/overlay_snowy_rocks_3.png 8bpp 801 1 64 31 -31 -8 normal
-1 sprites/overlay_snowy_rocks_3.png 8bpp 881 1 64 31 -31 -8 normal
-1 sprites/overlay_snowy_rocks_3.png 8bpp 961 1 64 39 -31 -8 normal
-1 sprites/overlay_snowy_rocks_3.png 8bpp 1041 1 64 39 -31 -8 normal
-1 sprites/overlay_snowy_rocks_3.png 8bpp 1121 1 64 31 -31 -8 normal
-1 sprites/overlay_snowy_rocks_3.png 8bpp 1201 1 64 47 -31 -16 normal
-1 sprites/overlay_snowy_rocks_3.png 8bpp 1281 1 64 15 -31 0 normal
-1 sprites/overlay_snowy_rocks_3.png 8bpp 1361 1 64 31 -31 -8 normal
-1 sprites/overlay_snowy_rocks_3.png 8bpp 1441 1 64 31 -31 -8 normal
// Snowy rocks level 4
-1 sprites/overlay_snowy_rocks_4.png 8bpp 1 1 64 31 -31 0 normal
-1 sprites/overlay_snowy_rocks_4.png 8bpp 81 1 64 31 -31 0 normal
-1 sprites/overlay_snowy_rocks_4.png 8bpp 161 1 64 23 -31 0 normal
-1 sprites/overlay_snowy_rocks_4.png 8bpp 241 1 64 23 -31 0 normal
-1 sprites/overlay_snowy_rocks_4.png 8bpp 321 1 64 31 -31 0 normal
-1 sprites/overlay_snowy_rocks_4.png 8bpp 401 1 64 31 -31 0 normal
-1 sprites/overlay_snowy_rocks_4.png 8bpp 481 1 64 23 -31 0 normal
-1 sprites/overlay_snowy_rocks_4.png 8bpp 561 1 64 23 -31 0 normal
-1 sprites/overlay_snowy_rocks_4.png 8bpp 641 1 64 39 -31 -8 normal
-1 sprites/overlay_snowy_rocks_4.png 8bpp 721 1 64 39 -31 -8 normal
-1 sprites/overlay_snowy_rocks_4.png 8bpp 801 1 64 31 -31 -8 normal
-1 sprites/overlay_snowy_rocks_4.png 8bpp 881 1 64 31 -31 -8 normal
-1 sprites/overlay_snowy_rocks_4.png 8bpp 961 1 64 39 -31 -8 normal
-1 sprites/overlay_snowy_rocks_4.png 8bpp 1041 1 64 39 -31 -8 normal
-1 sprites/overlay_snowy_rocks_4.png 8bpp 1121 1 64 31 -31 -8 normal
-1 sprites/overlay_snowy_rocks_4.png 8bpp 1201 1 64 47 -31 -16 normal
-1 sprites/overlay_snowy_rocks_4.png 8bpp 1281 1 64 15 -31 0 normal
-1 sprites/overlay_snowy_rocks_4.png 8bpp 1361 1 64 31 -31 -8 normal
-1 sprites/overlay_snowy_rocks_4.png 8bpp 1441 1 64 31 -31 -8 normal

Binary file not shown.

Before

Width:  |  Height:  |  Size: 9.2 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 9.7 KiB

Some files were not shown because too many files have changed in this diff Show More