1
0
mirror of https://github.com/OpenTTD/OpenTTD.git synced 2025-08-14 01:59:09 +00:00

Compare commits

..

138 Commits

Author SHA1 Message Date
Charles Pigott
d4df692a70 Doc: Changelog for 13.2 (#10981) 2023-06-10 15:50:05 +02:00
Charles Pigott
9580aef49c Update: Backport language changes 2023-06-10 15:49:43 +02:00
4aded39db6 Fix: Don't restore backed up vehicle name if it's no longer unique. (#10979) 2023-06-10 15:49:43 +02:00
merni-ns
ed9895dbb5 Fix #10975: Clear a non-head engine's name (#10976) 2023-06-10 15:49:43 +02:00
ab0924f14e Fix dec7ff6b0c: Dropdowns couldn't be closed by pressing the parent button. (#10954)
Since dropdowns self-close, the detection of re-clicking a dropdown
button no longer worked, as the dropdown is already closed.

Instead set (and then test) a flag on the parent widget to indicate that
the dropdown closed. This method avoids looping windows on every click.
2023-06-10 15:49:43 +02:00
Patric Stout
dea0f7e894 Fix: when syncing width of GUI items, take padding into account (#10915) 2023-06-10 15:49:43 +02:00
4949bd8cd5 Fix dec7ff6b0c: Dropdowns would close if their tooltip appeared. (#10939)
Solution is to not focus any tooltips, so that the dropdown doesn't lose focus. Tooltips don't accept any input so this does not change their behaviour.
2023-06-10 15:49:43 +02:00
Bernard Teo
374a51c766 Doc: Fix spelling error in ScriptTileList::RemoveRectangle (#10937) 2023-06-10 15:49:43 +02:00
Jonathan G Rennison
57946c8507 Fix #10831: Level crossing parts left barred after crossing tile removal (#10874) 2023-06-10 15:49:43 +02:00
Patric Stout
0f81c20ee2 Update: Backport language changes 2023-06-04 22:47:05 +02:00
Patric Stout
46d30aa970 Fix: [Win32] position window in center of workspace of primary display (#10942) 2023-06-04 22:47:05 +02:00
Patric Stout
4a7d93b2a6 Fix: crash with tooltip on low resolution screens (#10933) 2023-06-04 22:47:05 +02:00
Patric Stout
2a0e2f1658 Fix: crash when window can't be placed on low resolution screens. (#10932)
Co-authored-by: Jonathan G Rennison <j.g.rennison@gmail.com>
2023-06-04 22:47:05 +02:00
Patric Stout
83a857afb6 Fix: crash when not even a single row fits for dropdowns on low resolution screens (#10934) 2023-06-04 22:47:05 +02:00
b5a38cb14d Fix #10502: Refit engine before attaching free wagons. (#10926)
Caused by incorrect order of operations when buying a train engine with refit and attaching free wagons.
2023-06-04 22:47:05 +02:00
Patric Stout
00bcda7e33 Fix: disable hardware acceleration when GPU driver crashed the game last attempt (#10928) 2023-06-04 22:47:05 +02:00
Patric Stout
6f7d44c3f4 Add: [Linux] change default scroll mode to non-mouse-lock (#10920)
Wayland doesn't support mouse warping, X11 only for native
systems (so not for remote desktop, WSLg, etc), and emscripten
neither without complications. All these cannot offer a
mouse-lock.
2023-06-04 22:47:05 +02:00
Patric Stout
045e81809a Codechange: remove queue_wrap / last_position from mouse movement
No backend uses it anymore, so also no longer any need to support
it.
2023-06-04 22:47:05 +02:00
Patric Stout
b8d66fc783 Codechange: simplify UpdateCursorPositionRelative
The function is only called with fix_at=true, so don't support
the other cases.
2023-06-04 22:47:05 +02:00
Patric Stout
2ce9f640ef Fix: [SDL] unify the way X11 and Wayland handle mouse events
Basically, we drop RelativeMode completely, and use the same trick
as used by the Windows driver: read all motion events till the last
one, and use that as value.
2023-06-04 22:47:05 +02:00
220b08b868 Change: Include font style in font name for Freetype. 2023-06-04 22:47:05 +02:00
3ae1a80576 Codechange: Return fontcache font name as std::string. 2023-06-04 22:47:05 +02:00
glx22
532007737e Update: Backport language changes 2023-06-04 02:13:42 +02:00
Patric Stout
57a6233754 Fix: Wayland crash on startup due to Pango also using FontConfig (#10916)
Basically, we haven't been a good neighbour. Turns out you shouldn't
actually call FcFini when you are done, as some library might still
want to use FontConfig. And they use a shared instance for their
administration.

The idea is that you call FcInit once, and use FcConfigReference
after that to get an instance, you can release. This entry is
ref-counted, and things happen automatically based on that.

At least, I think.
2023-06-04 02:13:42 +02:00
53709f0bdc Codechange: Close dropdowns by class instead of id. 2023-06-04 02:13:42 +02:00
81e5cd23e0 Codechange: Use window parent association for dropdowns.
This replaces the separate window class and number properties, and
allows the window system to close dropdowns automatically.
2023-06-04 02:13:42 +02:00
2d8d9c49c4 Fix: Make dropdowns self-close when losing focus. 2023-06-04 02:13:42 +02:00
c3815359f1 Fix: Land info window maximum width was not scaled. (#10894) 2023-06-04 02:13:42 +02:00
Loïc Guilloux
89259af2e4 Fix: Check max member count in squirrel classes (#10883)
Manual cherry-pick from 23a0620658
2023-06-04 02:13:42 +02:00
680eb6b516 Fix: Ask FontConfig for the face index when opening fonts. (#10878)
This allows selection of the correct face in truetype fonts containing
multiple faces.
2023-06-04 02:13:42 +02:00
Jonathan G Rennison
a75a90b3af Fix: Rail waypoint selection window not closed
When rail toolbar or rail waypoint build windows closed
2023-06-04 02:13:42 +02:00
Loïc Guilloux
7969907116 Fix #10846: [Squirrel] Ensure sqvector size does not overflow (#10848) 2023-06-04 02:13:42 +02:00
Loïc Guilloux
4cc0c21182 Fix: disable "redundant move" warnings for GCC (#10803)
GCC warns about redundant std::move while clang warns when they are missing, so we silence the less harmful one
2023-06-04 02:13:42 +02:00
Michael Lutz
df417168c6 Fix: [Win32] Text line breaking did not properly handle punctuation characters. (#10775) 2023-06-04 02:13:42 +02:00
Jonathan G Rennison
b8eca7ddb1 Fix #10741: Rail platforms left partially reserved after train crash (#10751) 2023-06-04 02:13:42 +02:00
Patric Stout
0569331f6b Fix: crash in emscripten when saving games (#10758)
Don't allocate 128KB on stack, but rather on the heap.
2023-06-04 02:13:42 +02:00
Michael Lutz
439ecbc759 Fix: [Win32] Wrong multi-line text layout due to incorrect whitespace handling. 2023-06-04 02:13:42 +02:00
Michael Lutz
85d2f80817 Fix: Typo in variable name. 2023-06-04 02:13:42 +02:00
Rubidium
e53caf8f01 Fix: FormatArrayAsHex returns gibberish instead of a hex array 2023-06-04 02:13:42 +02:00
Kuhnovic
b70df6eeda Fix #8177: Ships with max speed overflow to near-zero speed (#10695) 2023-06-04 02:13:42 +02:00
f895d7e43c Fix: Set TC_NO_SHADE only for shaded engine in purchase list.
Additionally use TC_FORCE to prevent additional colours in the shaded text.
2023-06-04 02:13:42 +02:00
28e845dbaf Fix: #10735: {POP_COLOUR} fails if string is drawn with extra flags. 2023-06-04 02:13:42 +02:00
Tyler Trahan
df1ba20403 Fix #10289: Don't silently fail when setting timetable start dates (#10690) 2023-06-04 02:13:42 +02:00
Tyler Trahan
4883d386da Fix #8302: Improve "Maintenance intervals are in percents" helptext (#10686) 2023-06-04 02:13:42 +02:00
aeonofdiscord
e16fcb286a Fix #10665: CheckEngines should ignore wagons when determining available vehicles at the start date. (#10673) 2023-06-04 02:13:42 +02:00
rubidium42
ff7e8c284a Fix: Update some network documentation to match the new command system (#10657) 2023-06-04 02:13:42 +02:00
Jonathan G Rennison
08a5637f98 Fix #10638: Incorrect water infra total when building canal over object
In the case where the object is on an unowned canal tile and
the new canal tile is owned
2023-06-04 02:13:42 +02:00
Tyler Trahan
da20e0f6e6 Fix #10630: Don't allow shifting service date earlier than 0 (#10643) 2023-06-04 02:13:42 +02:00
Jonathan G Rennison
78512af02e Fix #10637: Incorrect water infra total when building multi-tile object
Wrong tile used in ownership checks
2023-06-04 02:13:42 +02:00
f4f35a1f5c Fix: Abort loading savegame if road vehicle is on invalid road type. (#10622)
This can happen if NewGRFs are missing so that engine or road type definitions are wrong.
2023-06-04 02:13:42 +02:00
Tyler Trahan
7f987c8d3a Doc: 13.1 changelog (#10629) 2023-04-10 21:39:24 +02:00
Charles Pigott
090913c655 Update: Backport language changes 2023-04-10 19:02:21 +01:00
15a32faece Fix 8361cf5a73: Missing bounds check for house specs. (#10625) 2023-04-10 19:02:21 +01:00
Alberth289346
353a6d4bfe Fix: Update top toolbar tooltips for added features. (#10616) 2023-04-10 19:02:21 +01:00
808dfc0672 Fix: Check ID for name is within bounds. 2023-04-10 19:02:21 +01:00
67bd6ab0ad Fix: Check station ID is within bounds when copying layouts. 2023-04-10 19:02:21 +01:00
4c756159fd Fix: Check sprite group mapping ID is within bounds of feature. 2023-04-10 19:02:21 +01:00
d510e0baa8 Codechange: Check NewGRF feature is defined before processing any sprite group mapping.
Previously this was checked after loading ids, or repeatedly checked for
each item.
2023-04-10 19:02:21 +01:00
4a1361b044 Fix: Clicking on editbox clear button didn't take account of padding. (#10583) 2023-04-10 19:02:21 +01:00
Rubidium
eaec433028 Update: Backport language changes 2023-03-31 16:43:32 +02:00
Loïc Guilloux
86beadc00b Fix: [Script] Access to enum/consts defined outside of main.nut (#10573) 2023-03-31 16:43:32 +02:00
Rubidium
261d674866 Fix #10568: "can savegame be loaded check" failed in dedicated server
* If loading fails, it usually returns SL_REINIT which doesn't trigger check
 * If savegame has NewGRFs, it complains NewGRFs are not allowed in intro game
2023-03-31 16:43:32 +02:00
f16a1107d2 Fix #10554: Let Scrollbar::SetPosition clamp instead of assert. (#10555) 2023-03-31 16:43:32 +02:00
4b40e93197 Fix: Network server highlight invisible with RTL layout. 2023-03-31 16:43:32 +02:00
dP
330a823c3b Fix: Restore using founder client name as company manager name (#10535) 2023-03-31 16:43:32 +02:00
Eric Long
f1fdcd71f4 Fix: build on platforms without native atomic 2023-03-31 16:43:32 +02:00
SamuXarick
70d5683e53 Fix #10469, 5e14a20: [Script] League Table rating element is a int64 everywhere else 2023-03-31 16:43:32 +02:00
dP
430630e774 Fix: Don't send unused tile field over the network (#10507) 2023-03-31 16:43:32 +02:00
SamuXarick
d78ab6a874 Change: Avoid crashing to the side of a train
When a road vehicle is already running on a multi level crossing, and a train shows up ahead, don't make the road vehicle crash on the side of the train.
2023-03-31 16:43:32 +02:00
SamuXarick
fedb77a56d Add: [Script] Labels for negative values of a setting 2023-03-31 16:43:32 +02:00
SamuXarick
803c523735 Doc: [Script] Update info descriptions 2023-03-31 16:43:32 +02:00
SamuXarick
81b53b36c8 Fix: [Script] Save config item values up to 10 digits + 1 for sign + 1 for termination, enough to fit min and max int 2023-03-31 16:43:32 +02:00
SamuXarick
381f1ac777 Fix #10059: [Script] Let custom values on a config item be up to 10 digits + 1 for sign 2023-03-31 16:43:32 +02:00
SamuXarick
4b7099fa68 Fix #10059: [Script] Clamp config item values to int32
Also prevent random_deviation to be below 0.
2023-03-31 16:43:32 +02:00
addf30ecdf Fix #10477: Not enough space for text due to rounding down (OSX) (#10489) 2023-03-31 16:43:32 +02:00
Loïc Guilloux
0604f571e1 Fix #10486: [Script] Debug window requires AIs to be started before GS (#10487) 2023-03-31 16:43:32 +02:00
Loïc Guilloux
617d794af6 Fix: [Actions] vcpkg needs pkg-config to build zlib on macOS (#10488) 2023-03-31 16:43:32 +02:00
Loïc Guilloux
da9f226f0b Fix #10465: Delay closing of network join progress window (#10466) 2023-03-31 16:43:32 +02:00
glx22
0fb6b3ca07 Fix #10280, 59645c6: Ignore double-click for unavailable town actions 2023-03-31 16:43:32 +02:00
glx22
249141858c Fix #10461, 59645c6: Properly check for _local_company validity 2023-03-31 16:43:32 +02:00
Owen Rudge
144d404f05 Fix: Ensure logo for Windows Store common assets package is named correctly 2023-03-31 16:43:32 +02:00
Michael Lutz
cf546c1917 Feature: [NewGRF] Engine name callback. 2023-03-31 16:43:32 +02:00
Michael Lutz
63d607a316 Add: [NewGRF] Second vehicle property for additional callback flags. 2023-03-31 16:43:32 +02:00
Michael Lutz
80590af1cb Change: [NewGRF] Extend the D8xx (DCxx) string area up to FFFF.
This adds the Exxx and Fxxx blocks to the usable range for NewGRF
local strings. TTDPatch uses these ranges for internal strings, but as
we don't support any of them anyway, it is "free" real estate for us.
2023-03-31 16:43:32 +02:00
Michael Lutz
2a787aa8b8 Doc: Bump release version. 2023-03-26 21:12:22 +02:00
Michael Lutz
ac31c1043e Fix: Disable asserts for release. 2023-03-26 21:12:22 +02:00
Michael Lutz
2ebc601d97 Doc: Update 13.0 changelog. 2023-02-05 14:59:47 +01:00
Michael Lutz
9daec1cb30 Update: Backport language changes 2023-02-05 14:59:21 +01:00
Rubidium
6bd2b9c34f Change: explicitly allow initial loan of 0, however show warning in UI 2023-02-05 14:59:21 +01:00
Rubidium
292ec1ced7 Change #10077: make maximum loan a positive multiple of the loan interval
And set the minimum maximum loan to the value of loan interval, so there is
always an amount of money to lend. Compared to being allowed to set max loan
to 0 and never be allowed to lend any money.
2023-02-05 14:59:21 +01:00
Loïc Guilloux
6b36f07eb8 Fix #10361, fe30f66: Don't try to give saved data to a dead script (#10433) 2023-02-05 14:59:21 +01:00
Jonathan G Rennison
f6170ec782 Fix: Water infrastructure accounting when building docks 2023-02-05 14:59:21 +01:00
Jonathan G Rennison
32d80d1a57 Fix #10419: Water infrastructure accounting when building ship depots 2023-02-05 14:59:21 +01:00
Michael Lutz
8aa4173bce Doc: Update RC2 changelog. 2023-01-28 21:50:32 +01:00
Michael Lutz
ada33a6885 Update: Backport language changes 2023-01-28 21:50:32 +01:00
Patric Stout
64bd824b48 Add: [Actions] upload releases to GOG automatically 2023-01-28 21:50:32 +01:00
Patric Stout
ce9c4fc31f Change: [Actions] release Windows Store files to CDN
Currently they had a name that the rest of our system cannot
deal with correctly. "cert.pfx" is also not very descriptive from
a system as a whole.

As such, we now name it like any other file, so it can be published
safely to the CDN.
2023-01-28 21:50:32 +01:00
Patric Stout
ff07af905a Change: [Actions] split GitHub workflows into several smaller ones 2023-01-28 21:50:32 +01:00
Patric Stout
b5f8fcb280 Remove: [Actions] Ubuntu/Debian release binaries (instead, use the Generic) 2023-01-28 21:50:32 +01:00
Rubidium
bac7ad72b1 Fix #10009: bad overflow protection when taking out loans 2023-01-28 21:50:32 +01:00
0cb3d85a87 Change: Display font status as aa/noaa instead of true/false. (#10352) 2023-01-28 21:50:32 +01:00
Tyler Trahan
05c0295d32 Feature: Set a custom number of industries in map generation window (#10340) 2023-01-28 21:50:32 +01:00
Tyler Trahan
556e9e8434 Feature: Press Ctrl to build a diagonal area of trees (#10342) 2023-01-28 21:50:32 +01:00
Michael Lutz
4fe8d97623 Update: Backport language changes (#10425) 2023-01-28 19:16:14 +00:00
Michael Lutz
c31195509f Doc: Changelog for 13.0-RC2. (#10424) 2023-01-28 16:30:30 +00:00
Michael Lutz
aa4cd1012f Update: Backport language changes 2023-01-28 17:10:46 +01:00
Rubidium
c9948a4517 Fix: scripts are not aware of nullptr, they only know null 2023-01-28 17:10:46 +01:00
Rubidium
d1daf34c91 Fix: missing/duplicate documentation tags for scripts 2023-01-28 17:10:46 +01:00
Rubidium
18c701d274 Fix: warnings about obsolete settings/setting values in Doxygen configurations 2023-01-28 17:10:46 +01:00
Rubidium
3357aff494 Fix: scripts cannot call constructors of ScriptEvents, so remove from the documentation 2023-01-28 17:10:46 +01:00
Rubidium
08ca0746b1 Fix: no ScriptEvent sub class should export constructors to scripts 2023-01-28 17:10:46 +01:00
merni-ns
1cb459de3f Change #10255: Reduce basic thickness of linkgraph GUI lines (#10410)
From 3px to 2px (multiplied by UI scale).
2023-01-28 17:10:46 +01:00
7e61264e3c Fix #10220: Don't select unselectable engine as default. (#10404) 2023-01-28 17:10:46 +01:00
Tyler Trahan
75c37bf7c2 Fix #10395: When loading old saves, don't forcibly bar level crossings (#10400) 2023-01-28 17:10:46 +01:00
Rubidium
f88766c976 Fix #10377, Fix 94167df: bad sorting of rail vehicles when primary variant is missing 2023-01-28 17:10:46 +01:00
SamuXarick
52319891ce Fix 3c047b1: AIGroup.GetProfitLastYear could get values different than those displayed in GUI (#10227)
* Change: Store "all time" and "since minimum age" last year profits on groups

* Fix: Update last year profit for groups when copying vehicle statistics on autoreplace

* Codechange: Refactor profit last year

* Change: Rename some group related items for clarity

* Change: Reorder the fields in GroupStatistics

That way less memory gets wasted.
2023-01-28 17:10:46 +01:00
Francis Herne
0a5dc852bb Fix #10362: NewGRF bridges without speed limits.
For bridges, a max speed of 0xFFFF (i.e. no effective limit)
 is no longer displayed as a limit in the UI.

A max speed of 0 is also considered unlimited, for similarity to the
 roadtype and railtype interface.
2023-01-28 17:10:46 +01:00
5b27cd029f Fix: Switch to OWNER_TOWN prevented OWNER_DEITY test during industry prospecting. (#10360) 2023-01-28 17:10:46 +01:00
Rubidium
2104849fad Fix #10368, Fix 994bf19: server restarting game caused clients to hit assertion
Upon closing the EndGameWindow, triggered from UnInitWindowSystem, the
HighScoreWindow would be opened and _z_windows would not be empty.
2023-01-28 17:10:46 +01:00
Tyler Trahan
25940cdbd1 Fix #10363: CargoDist setting helptext shouldn't suggest symmetric distribution for diamonds in subtropic (#10364)
* Fix #10363: CargoDist setting helptext shouldn't suggest symmetric distribution for diamonds in subtropic

* Fix: Always capitalize the first word of a sentence, even if a quoted setting name
2023-01-28 17:10:46 +01:00
Rubidium
f37b6cb17f Fix #9865: removing files with the console always failed 2023-01-28 17:10:46 +01:00
Rubidium
87d74389fb Fix #10177: company list password padlock showed after switching to single player 2023-01-28 17:10:46 +01:00
Rubidium
557c5a8583 Fix #10057: FallbackParagraphLayout fails to properly wrap
... during the first word after a new run has been started.
2023-01-28 17:10:46 +01:00
Jonathan G Rennison
bd6a95c6b9 Fix #10032: Capacities of articulated vehicles in build window
See also: #9954
2023-01-28 17:10:46 +01:00
Tyler Trahan
6d1331ebcd Fix: Various Wide River issues (#10348) 2023-01-28 17:10:46 +01:00
680fcb8611 Fix: Link variants to parents when finalising engines. (#10346)
This ensures that definition-order of engines within the NewGRF does not matter.
2023-01-28 17:10:46 +01:00
Tyler Trahan
548a9c41d5 Fix #10333, c53f29d: Only show industry prospecting errors to local company (#10338) 2023-01-28 17:10:46 +01:00
4c6b6c9d33 Fix #10335: Set initial scrollbar count for object GUI. (#10336)
This previously happened when the window was resized by itself which was fixed by #10196. Explicitly set the count instead.
2023-01-28 17:10:46 +01:00
c935a58272 Fix #10331: Starting new company during load must happen after AI start. (#10332)
This situation occurs when loading a savegame in single-player which only
has AI companies.
2023-01-28 17:10:46 +01:00
Rubidium
88030d781b Fix #10309: [SDL] Uninitialized width and height when turning off full screen 2023-01-28 17:10:46 +01:00
7ccfc4b143 Fix: Don't assume engclass 2 should be elrail. (#10315)
When disabling/enabling elrail, there is an assumption that `engclass` of 2
means the engine will run on elrail. While this holds for default engines,
NewGRFs can do other things.

To resolve this we store the intended railtype so that toggling elrail will
restore to the correct type.
2023-01-28 17:10:46 +01:00
Rubidium
f5193aeba2 Fix: prevent corrupted GRF files to allocate stupid amounts of memory 2023-01-28 17:10:46 +01:00
Rubidium
ed65594868 Fix: do not allow more palette colours than there are indices for the colours
Or: do not pass unchecked size from BMP file into memory allocation
2023-01-28 17:10:46 +01:00
Loïc Guilloux
b211a88b71 Fix #10304, fe30f66: [Scripts] Don't start GS in intro (#10305) 2023-01-28 17:10:46 +01:00
Michael Lutz
2414cf0e8f Doc: [Script] Outdated API changelog comment. 2023-01-01 23:34:14 +01:00
Michael Lutz
400addf7af Fix: [Script] Copy compat files for version 13 to build output. 2023-01-01 23:34:14 +01:00
Tyler Trahan
4b123394cf Update: Title game for 13.0 release (#10247) 2023-01-01 12:45:13 -05:00
Charles Pigott
8978f11146 Doc: 13.0-RC1 changelog (#10295) 2023-01-01 17:39:43 +00:00
1133 changed files with 50132 additions and 77760 deletions

View File

@@ -8,7 +8,7 @@ notifications:
only:
- master
only-by:
- eints-sync\[bot\]
- DorpsGek
commit-comment:
discussion:
pull-request:

View File

@@ -7,471 +7,3 @@ trim_trailing_whitespace = true
[*.{c,cpp,h,hpp}]
indent_style = tab
charset = utf-8
#indent_size = <integer>
#tab_width = <integer>
#end_of_line = <lf, cf, crlf>
### C++ specific editor config rules ###
## Visual Studio ## https://learn.microsoft.com/en-us/visualstudio/ide/cpp-editorconfig-properties?view=vs-2019 ##
# Indentation #
# Do not indent braces
cpp_indent_braces = false
# When a new line is typed, it's indented relatively to the innermost open parenthesis
cpp_indent_multi_line_relative_to = innermost_parenthesis
# Indent new lines within parenthesis
cpp_indent_within_parentheses = indent
# In existing code, do not use the setting for alignment of new lines within parentheses
cpp_indent_preserve_within_parentheses = true
# Indent case contents
cpp_indent_case_contents = true
# Indent case labels
cpp_indent_case_labels = true
# Do not indent braces following a case statement
cpp_indent_case_contents_when_block = false
# Do not indent braces of lambdas used as parameters
cpp_indent_lambda_braces_when_parameter = false
# No override for "Position of goto labels" (Unspecified)
#cpp_indent_goto_labels
# Move preprocessor directives to the leftmost column
cpp_indent_preprocessor = leftmost_column
# Do not indent access specifiers
cpp_indent_access_specifiers = false
# Indent namespace contents
cpp_indent_namespace_contents = true
# Preserve indentation of comments
cpp_indent_preserve_comments = true
# Newline #
# Keep open braces for namespaces on the same line, but add a space before the brace
cpp_new_line_before_open_brace_namespace = same_line
# Keep open braces for types/classes on the same line, but add a space before the brace
cpp_new_line_before_open_brace_type = same_line
# Move open braces for functions to a new line
cpp_new_line_before_open_brace_function = new_line
# Keep open braces for control blocks on the same line, but add a space before the brace
cpp_new_line_before_open_brace_block = same_line
# Keep open braces for lambdas on the same line, but add a space before the brace
cpp_new_line_before_open_brace_lambda = same_line
# Place scope braces on separate lines
cpp_new_line_scope_braces_on_separate_lines = true
# Do not move closing braces to the same line as opening braces for empty types
cpp_new_line_close_brace_same_line_empty_type = false
# Do not move closing braces to the same line as opening braces for empty function bodies
cpp_new_line_close_brace_same_line_empty_function = false
# Do not place 'catch' and similar keywords on a new line
cpp_new_line_before_catch = false
# Do not place 'else' on a new line
cpp_new_line_before_else = false
# Do not place 'while' in a do-while loop on a new line
cpp_new_line_before_while_in_do_while = false
# Spacing #
# Remove spaces between function names and opening parentheses of argument lists
cpp_space_before_function_open_parenthesis = remove
# Do not insert a space within parentheses of an argument list
cpp_space_within_parameter_list_parentheses = false
# Do not insert a space between parentheses when argument list is empty
cpp_space_between_empty_parameter_list_parentheses = false
# Insert space between keyword and opening parenthesis in control flow statements
cpp_space_after_keywords_in_control_flow_statements = true
# Do not insert a space within parentheses of a control statement
cpp_space_within_control_flow_statement_parentheses = false
# Do not insert a space before opening parenthesis of lambda argument lists
cpp_space_before_lambda_open_parenthesis = false
# Do not insert a space within parentheses of a C-style cast
cpp_space_within_cast_parentheses = false
# Do not insert a space after closing parenthesis of C-style cast
cpp_space_after_cast_close_parenthesis = false
# Do not insert a space within parentheses of a parenthesized expression
cpp_space_within_expression_parentheses = false
# Insert space before opening brace of blocks
cpp_space_before_block_open_brace = true
# Do not insert a space between empty braces
cpp_space_between_empty_braces = false
# Do not insert a space before opening brace of uniform initialization and initializer lists
cpp_space_before_initializer_list_open_brace = false
# No override for "Insert space within braces of uniform initialization and initializer lists" (Spacing for this varies)
#cpp_space_within_initializer_list_braces
# Preserve spaces inside uniform initialization and initializer lists
cpp_space_preserve_in_initializer_list = true
# Do not insert space before opening square brackets
cpp_space_before_open_square_bracket = false
# Do not insert space within square bracket
cpp_space_within_square_brackets = false
# Do not insert space before empty square brackets
cpp_space_before_empty_square_brackets = false
# Do not insert space between empty square brackets
cpp_space_between_empty_square_brackets = false
# Group square brackets for multi-dimensional arrays together
cpp_space_group_square_brackets = true
# Do not insert space within square brackets for lambdas
cpp_space_within_lambda_brackets = false
# Do not insert space between empty lambda brackets
cpp_space_between_empty_lambda_brackets = false
# Do not insert space before commas
cpp_space_before_comma = false
# Insert space after commas
cpp_space_after_comma = true
# Remove spaces before and after member operators
cpp_space_remove_around_member_operators = true
# Insert space before colon for base in type declarations
cpp_space_before_inheritance_colon = true
# Insert space before colon for constructors
cpp_space_before_constructor_colon = true
# Remove space before semicolons
cpp_space_remove_before_semicolon = true
# No override for "Insert space after semicolons" (Depends on if loop is unconditional)
#cpp_space_after_semicolon
# Remove spaces between unary operators and their operands
cpp_space_remove_around_unary_operator = true
# Insert spaces before and after binary operators
cpp_space_around_binary_operator = insert
# Insert spaces around assignment operators
cpp_space_around_assignment_operator = insert
# Align pointer/reference symbol to the right
cpp_space_pointer_reference_alignment = right
# Insert spaces around conditional operators
cpp_space_around_ternary_operator = insert
# Wrapping #
# Always apply New Lines settings for blocks
cpp_wrap_preserve_blocks = never
## Rider & ReSharper ## https://www.jetbrains.com/help/resharper/EditorConfig_CPP_CppBlankLinesPageScheme.html ##
# Blank Lines #
# No override for "Max blank lines in declarations" (Unspecified; Not consistent across source code)
#cpp_keep_blank_lines_in_declarations
# No override for "Max blank lines in rest of source code" (Unspecified; Not consistent across source code)
#cpp_keep_blank_lines_in_code
# No override for "Number of blank lines around class/struct/enum definition" (Unspecified; Not consistent across source code)
#cpp_blank_lines_around_class_definition
# No override for "Number of blank lines around function declarations" (Unspecified; Not consistent across source code)
#cpp_blank_lines_around_function_declaration
# No override for "Number of blank lines around function definitions" (Unspecified; Not consistent across source code)
#cpp_blank_lines_around_function_definition
# No override for "Number of blank lines around single line function definitions" (Unspecified; Not consistent across source code)
#cpp_blank_lines_around_single_line_function_definition
# No override for "Number of blank lines around namespaces" (Unspecified; Not consistent across source code)
#cpp_blank_lines_around_namespace
# No override for "Number of blank lines around other definitions and declarations" (Unspecified; Not consistent across source code)
#cpp_blank_lines_around_other_declaration
# Braces Layout #
# Keep open braces for namespace declarations on the same line, but add a space before the brace
cpp_namespace_declaration_braces = end_of_line
# Keep open braces for linkage declarations on the same line, but add a space before the brace
cpp_linkage_specification_braces = end_of_line
# Keep open braces for types/classes on the same line, but add a space before the brace
cpp_type_declaration_braces = end_of_line
# Keep open braces for namespace definitions on the same line (does not modify spacing before the brace)
cpp_place_namespace_definitions_on_same_line = true
# Move open braces for functions to a new line
cpp_invocable_declaration_braces = next_line
# Keep open braces for lambdas on the same line, but add a space before the brace
cpp_anonymous_method_declaration_braces = end_of_line
# Keep open braces for case blocks on the same line, but add a space before the brace
cpp_case_block_braces = end_of_line
# No override for "Requires expression braces" style (requires expressions are a C++20 feature)
#cpp_requires_expression_braces
# Keep open braces for all other blocks on the same line, but add a space before the brace
cpp_other_braces = end_of_line
# Only indent the insides of multi-line expression braces
cpp_expression_braces = inside
# Place the braces of empty blocks together and on the same line
cpp_empty_block_style = together_same_line
# Force line breaks within simple compound statements
cpp_simple_block_style = line_break
# No override for "Regular expression for macros starting a block" (Marco blocks aren't used)
#cpp_macro_block_begin
# No override for "Regular expression for macros ending a block" (Marco blocks aren't used)
#cpp_macro_block_end
# Tabs and indents #
# Redundant override (Already overriden globally by 'indent_style')
#cpp_indent_style
# Redundant override (Already overriden globally by 'indent_size')
#cpp_indent_size
# Redundant override (Already overriden globally by 'tab_width')
#cpp_tab_width
# Use spaces instead of tabs as indentation for precise alignment
cpp_alignment_tab_fill_style = use_spaces
# Allow alignment even if construct is located too far to the right, more than 2/3 of 'Hard wrap at' limit
cpp_allow_far_alignment = true
# Indentation and Alignment #
# No override for "Continuous line indent" (Varies throughout source code)
#cpp_continuous_line_indent
# Do not use continuous line indent in function declaration and invocation parentheses
cpp_use_continuous_line_indent_in_method_pars = false
# Do not use continuous line indent in initializer lists
cpp_use_continuous_line_indent_in_expression_braces = false
# Indent namespace members (including nested ones)
cpp_namespace_indentation = all
# No override for "Indent linkage specification block members" (Unspecified)
#cpp_linkage_specification_indentation
# Do not indent access specifier from class
cpp_indent_access_specifiers_from_class = false
# Indent class member from access specifier
cpp_indent_class_members_from_access_specifiers = true
# Do not indent if a function definition or declaration is wrapped after the type
cpp_indent_wrapped_function_names = false
# Indent 'case' labels from 'switch'
cpp_indent_switch_labels = true
# No override for "Indent function declarations' parentheses" (Varies throughout source code)
#cpp_indent_method_decl_pars
# No override for "Indent method calls' parentheses" (Varies throughout source code)
#cpp_indent_invocation_pars
# No override for "Indent statement (if, while, for, etc) parentheses" (Varies throughout source code)
#cpp_indent_statement_pars
# Do not change preprocessor directives indenting
cpp_indent_preprocessor_directives = do_not_change
# No override for "Indent C++/CLI generic constraints" (C++/CLI is not used)
#cpp_indent_type_constraints
# Align/indent comments started at the first column
cpp_indent_comment = true
# Comments that comment out code will use the indentation level of the commented code.
cpp_place_comments_at_first_column = false
# Align multiline declarators in declaration
cpp_align_multiple_declaration = true
# Align multiline function parameters
cpp_align_multiline_parameter = true
# Align multiline call arguments
cpp_align_multiline_argument = true
# Do not align first of multiline call arguments with the opening parentheses
cpp_align_first_arg_by_paren = false
# Align multiline initializer list arguments
cpp_align_multiline_expression_brace = true
# No override for "Align multiline template parameters in template declaration" (Unspecified)
#cpp_align_multiline_type_parameter
# No override for "Align multiline template arguments" (Unspecified)
#cpp_align_multiline_type_argument
# Align multiline base classes in class base clause
cpp_align_multiline_extends_list = true
# Align multiline member initializers in member initializer lists
cpp_align_multiline_ctor_init = true
# Outdent commas placed on new line
cpp_outdent_commas = true
# Do not align multiline ?: operator with first line (since alignment is incorrect)
cpp_align_ternary = none
# Do not indent aligned ?: operator (since indentation varies)
cpp_indent_aligned_ternary = false
# No override for "Align multiline chained method calls" (Unspecified)
#cpp_align_multiline_calls_chain
# No override for "Outdent '.' and '->' in chained method calls on new lines" (Unspecified)
#cpp_outdent_dots
# Do not align multiline chained binary expressions
cpp_align_multiline_binary_expressions_chain = false
# Fix column alignment in adjacent lines
cpp_int_align_fix_in_adjacent = true
# Align assignments with adjacent assignments
cpp_int_align_eq = true
# Do not align declaration names with adjacent declaration names
cpp_int_align_declaration_names = false
# Align end-of-line comments with adjacent end-of-line comments
cpp_int_align_comments = true
# Spaces #
# Do not put space before ANY commas
cpp_space_before_comma = false
# Put space after ALL commas
cpp_space_after_comma = true
# Put space before ptr in declaration of variable
cpp_space_before_ptr_in_data_member = true
# Do not put space after ptr in declaration of variable
cpp_space_after_ptr_in_data_member = false
# Put space before ptr in declaration of multiple variables
cpp_space_before_ptr_in_data_members = true
# Do not put space after ptr in declaration of multiple variables
cpp_space_after_ptr_in_data_members = false
# Put space before ptr in return type of function
cpp_space_before_ptr_in_method = true
# Do not put space after ptr in return type of function
cpp_space_after_ptr_in_method = false
# Do not put space before ptr in abstract declaration
cpp_space_before_ptr_in_abstract_decl = false
# Put space before ref in declaration of variable
cpp_space_before_ref_in_data_member = true
# Do not put space after ref in declaration of variable
cpp_space_after_ref_in_data_member = false
# Put space before ref in declaration of multiple variables
cpp_space_before_ref_in_data_members = true
# Do not put space after ref in declaration of multiple variables
cpp_space_after_ref_in_data_members = false
# Do not put space before ref in return type of function
cpp_space_before_ref_in_method = false
# Put space after ref in return type of function
cpp_space_after_ref_in_method = true
# Do not put space before ref in abstract declaration
cpp_space_before_ref_in_abstract_decl = false
# Do not put space before parentheses in function parameters
cpp_space_between_method_declaration_name_and_open_parenthesis = false
# Do not put space before parentheses in lambda parameters
cpp_space_before_lambda_parentheses = false
# Do not put space within parentheses in function parameters
cpp_space_between_method_declaration_parameter_list_parentheses = false
# Do not put space within empty parentheses in function parameters
cpp_space_between_method_declaration_empty_parameter_list_parentheses = false
# Do not put space before angle brackets in template parameters
cpp_space_before_template_params = false
# Do not put space within angle brackets in template parameters
cpp_space_within_template_params = false
# Do not put space within empty angle brackets in template parameters
cpp_space_within_empty_template_params = false
# Do not put space before angle brackets in template arguments
cpp_space_before_template_args = false
# Do not put space within angle brackets in template arguments
cpp_space_within_template_args = false
# Do not put space between closing angle brackets in template arguments
cpp_space_between_closing_angle_brackets_in_template_args = false
# Put space around '=' in alias declaration and namespace alias
cpp_space_around_alias_eq = true
# Do not put space around '->' in trailing return types
cpp_space_around_deref_in_trailing_return_type = false
# Put space before base types list colon
cpp_space_before_colon_in_inheritance_clause = true
# Put space after base types list colon
cpp_space_after_colon_in_inheritance_clause = true
# No override for "Before C++/CLI generic constraint colon" (Unspecified)
#cpp_space_before_type_parameter_constraint_colon
# No override for "After C++/CLI generic constraint colon" (Unspecified)
#cpp_space_after_type_parameter_constraint_colon
# Put space before parentheses of control statements
cpp_space_after_keywords_in_control_flow_statements = true
# Do not put space within parentheses of control statements
cpp_space_between_parentheses_of_control_flow_statements = false
# Do not put space before semicolon in 'for' statements
cpp_space_before_semicolon_in_for_statement = false
# Put space after semicolon in 'for' statements
cpp_space_after_semicolon_in_for_statement = true
# Put space before ':' in range-based for loop
cpp_space_before_for_colon = true
# Put space after ':' in range-based for loop
cpp_space_after_for_colon = true
# Do not put space before colon in switch case or label statement
cpp_space_before_colon_in_case = false
# Put space after colon in switch case or label statement
cpp_space_after_colon_in_case = true
# Put space around binary operator
cpp_space_around_binary_operator = true
# Put space around assignment operator
cpp_space_around_assignment_operator = true
# Do not put space around dot, '->', '.*' and '->.'
cpp_space_around_member_access_operator = false
# Do not put space within any parentheses
cpp_space_within_parentheses = false
# Do not put space before array subscript brackets
cpp_space_before_open_square_brackets = false
# Do not put space within array subscript brackets
cpp_space_between_square_brackets = false
# Do not put space before empty parentheses in function call and initialization
cpp_space_between_method_call_name_and_opening_parenthesis = false
# Do not put space within parentheses in cast expressions
cpp_space_between_typecast_parentheses = false
# Do not put space after parentheses in cast expressions
cpp_space_after_cast = false
# Do not put space within parentheses in function call and initialization
cpp_space_between_method_call_parameter_list_parentheses = false
# Do not put space within empty parentheses in function call and initialization
cpp_space_between_method_call_empty_parameter_list_parentheses = false
# Put space in ternary operator '? :' before '?'
cpp_space_before_ternary_quest = true
# Put space in ternary operator '? :' after '?'
cpp_space_after_ternary_quest = true
# Put space in ternary operator '? :' before ':'
cpp_space_before_ternary_colon = true
# Put space in ternary operator '? :' after ':'
cpp_space_after_ternary_colon = true
# Do not put space before uniform initialization braces
cpp_space_before_initializer_braces = false
# Do not put space within uniform initialization braces
cpp_space_within_initializer_braces = false
# Do not put space within empty uniform initialization braces
cpp_space_within_empty_initializer_braces = false
# Put space before end of line comment
cpp_space_before_trailing_comment = true
# Preserve spaces before end of line comment
cpp_disable_space_changes_before_trailing_comment = true
# Line breaks and Wrapping #
# Redundant override (Already overriden globally by 'insert_final_newline')
#cpp_insert_final_newline
# Redundant override (Already overriden earlier in Visual Studio section)
#cpp_new_line_before_else
# Do not place 'while' in a do-while loop on a new line
cpp_new_line_before_while = false
# Redundant override (Already overriden earlier in Visual Studio section)
#cpp_new_line_before_catch
# Do not change the line breaks of single embedded statements
cpp_simple_embedded_statement_style = do_not_change
# Do not change the line breaks of simple 'case' statement
cpp_simple_case_statement_style = do_not_change
# Put member function definition return type on same line
cpp_function_definition_return_type_style = on_single_line
# Put top-level function definition return type on same line
cpp_toplevel_function_definition_return_type_style = on_single_line
# Put member function declaration return type on same line
cpp_function_declaration_return_type_style = on_single_line
# Put top-level function declaration return type on same line
cpp_toplevel_function_declaration_return_type_style = on_single_line
# Force template<...> of a template declaration on new line
cpp_break_template_declaration = line_break
# No override for "Break line before the requires-clause" (requires-clause is a C++20 feature)
#cpp_line_break_before_requires_clause
# Do not change the line break before the colon in member initializer lists
cpp_member_initializer_list_style = do_not_change
# Do not change the line break after the colon in member initializer lists
cpp_line_break_after_colon_in_member_initializer_lists = do_not_change
# No override for "Break line before comma in member initializer lists" (Varies throughout source code)
#cpp_line_break_before_comma_in_member_initializer_lists
# No override for "Break line after comma in member initializer lists" (Varies throughout source code)
#cpp_line_break_after_comma_in_member_initializer_lists
# No override for "Allow C++/CLI generic constraints on the same line" (C++/CLI is not used)
#cpp_place_type_constraints_on_same_line
# No override for "Keep existing line breaks" (Varies throughout source code; depends on developer preference)
#cpp_keep_user_linebreaks
# No override for "Hard wrap at _ characters" (Unspecified)
#cpp_max_line_length
# Do not prefer wrap before ','
cpp_wrap_before_comma = false
# Do not prefer wrap before ',' in base clause
cpp_wrap_before_comma_in_base_clause = false
# No override for "Wrap ternary expression" (Varies throughout source code)
#cpp_wrap_ternary_expr_style
# No override for "Prefer wrap before '?' and ':' in ternary expressions" (Varies throughout source code)
#cpp_wrap_before_ternary_opsigns
# No override for "Prefer wrap before ':'" (Varies throughout source code)
#cpp_wrap_before_colon
# No override for "Prefer wrap before first C++/CLI generic constraint" (C++/CLI is not used)
#cpp_wrap_before_first_type_parameter_constraint
# No override for "Wrap multiple C++/CLI generic constraints" (C++/CLI is not used)
#cpp_wrap_multiple_type_parameter_constraints_style
# No override for "Wrap enum definition" (Varies throughout source code)
#cpp_wrap_enumeration_style
# No override for "Wrap braced initializer list" (Varies throughout source code)
#cpp_wrap_braced_init_list_style
# No override for "Wrap base classes list" (Varies throughout source code)
#cpp_wrap_base_clause_style
# No override for "Wrap constructor initializer" (Varies throughout source code)
#cpp_wrap_ctor_initializer_style
# No override for "Wrap formal parameters" (Varies throughout source code)
#cpp_wrap_parameters_style
# Do not prefer wrap before '(' in declaration
cpp_wrap_before_declaration_lpar = false
# Prefer wrap after '(' in declaration
cpp_wrap_after_declaration_lpar = true
# Do not prefer wrap before ')' in declaration
cpp_wrap_before_declaration_rpar = false
# No override for "Wrap invocation arguments" (Varies throughout source code)
#cpp_wrap_arguments_style
# Do not prefer wrap before '(' in invocation
cpp_wrap_before_invocation_lpar = false
# Prefer wrap after '(' in invocation
cpp_wrap_after_invocation_lpar = true
# Do not prefer wrap before ')' in invocation
cpp_wrap_before_invocation_rpar = false
# Prefer wrap after '{' in initializer lists
cpp_wrap_after_expression_lbrace = true
# Do not prefer wrap before '}' in initializer lists
cpp_wrap_before_expression_rbrace = false

View File

@@ -42,7 +42,7 @@ Some things are not automated, and forgotten often. This list is a reminder for
* 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.
* ai_changelog.hpp, gs_changelog.hpp need updating.
* The compatibility wrappers (compat_*.nut) need updating.
* This PR affects the NewGRF API? (label 'needs review: NewGRF')
* newgrf_debug_data.h may need updating.

View File

@@ -1,12 +0,0 @@
name: openttd
queries:
- uses: security-and-quality
query-filters:
- exclude:
id:
# Only feasible way is to move away from fopen; fopen_s is optional C11 and not implemented on most platforms.
- cpp/world-writable-file-creation
# Basically OpenTTD's coding style for adding things like ..._INVALID to enumerations
- cpp/irregular-enum-init
# Our GUI code tends to use switches for OnClick handlers, DrawWidget, and UpdateWidgetSize. Sometimes GUIs just don't have many elements, but we want to keep consistency.
- cpp/trivial-switch

View File

@@ -1,71 +0,0 @@
"""
Script to scan the OpenTTD's script API for functions that miss checks for the
function being called from the right mode (deity or company mode).
When a function calls either ScriptObject::Command or ScriptObject::GetCompany
then the function is considered dangerous. When one of the mode enforcement
macros from script_error.hpp, i.e. EnforceDeityMode, EnforceCompanyModeValid or
EnforceDeityOrCompanyModeValid, are called in the function, then we consider
that the function has mode enforcement.
Any dangerous function for which no enforcement is found are emitted as errors.
"""
import glob
import re
import sys
def check_mode_enforcement(path):
errors = []
with open(path, "r") as reader:
mode_enforcement_found = False
dangerous_function = False
for line in reader:
# Line does not start with a tab and have <word>::<word>. That looks like the begin of a function, so reset the state.
if re.match(r"^[^\t].*\w::\w", line):
mode_enforcement_found = False
dangerous_function = False
currentFunction = line
continue
if re.match(
r"\t(EnforceDeityMode|EnforceCompanyModeValid|EnforceCompanyModeValid_Void|EnforceDeityOrCompanyModeValid|EnforceDeityOrCompanyModeValid_Void)\(",
line,
):
# Mode enforcement macro found
mode_enforcement_found = True
continue
if re.match(r".*(ScriptObject::Command|ScriptObject::GetCompany).*", line):
# Dangerous function found
dangerous_function = True
continue
# Line with only a closing bracket. That looks like the end of a function, so check for the dangerous function without mode enforcement
if re.match(r"^}$", line) and dangerous_function and not mode_enforcement_found:
function_name = currentFunction.rstrip("\n").replace("/* static */ ", "")
errors.append(f"{path}: {function_name}")
return errors
def main():
errors = []
for path in sorted(glob.glob("src/script/api/*.cpp")):
# Skip a number of files that yield only false positives
if path.endswith(("script_object.cpp", "script_companymode.cpp", "script_controller.cpp", "script_game.cpp")):
continue
errors.extend(check_mode_enforcement(path))
if errors:
print("Mode enforcement was expected in the following files/functions:")
print("\n".join(errors))
sys.exit(1)
print("OK")
if __name__ == "__main__":
main()

View File

@@ -210,10 +210,11 @@ def main():
errors.append(f"ERROR: {string} is (possibly) no longer needed.")
if errors:
print("\n".join(errors))
for error in errors:
print(error)
sys.exit(1)
print("OK")
else:
print("OK")
if __name__ == "__main__":

View File

@@ -1,50 +0,0 @@
"""
Script to scan the OpenTTD source-tree for ini_key issues in WindowDesc entries.
"""
import glob
import os
import re
import sys
def scan_source_files(path, ini_keys=None):
if ini_keys is None:
ini_keys = set()
errors = []
for new_path in glob.glob(f"{path}/*.cpp"):
if os.path.isdir(new_path):
errors.append(scan_source_files(new_path, ini_keys))
continue
with open(new_path) as fp:
output = fp.read()
for (name, ini_key, widgets) in re.findall(r"^static WindowDesc ([a-zA-Z0-9_]*).*?, (?:\"(.*?)\")?.*?,(?:\s+.*?,){6}\s+[^\s]+\((.*?)\)", output, re.S|re.M):
if ini_key:
if ini_key in ini_keys:
errors.append(f"{new_path}: {name} ini_key is a duplicate")
ini_keys.add(ini_key)
widget = re.findall("static const (?:struct )?NWidgetPart " + widgets + ".*?(?:WWT_(DEFSIZE|STICKY)BOX.*?)?;", output, re.S)[0]
if widget and not ini_key:
errors.append(f"{new_path}: {name} has WWT_DEFSIZEBOX/WWT_STICKYBOX without ini_key")
if ini_key and not widget:
errors.append(f"{new_path}: {name} has ini_key without WWT_DEFSIZEBOX/WWT_STICKYBOX")
return errors
def main():
errors = scan_source_files("src")
if errors:
print("\n".join(errors))
sys.exit(1)
print("OK")
if __name__ == "__main__":
main()

View File

@@ -9,10 +9,6 @@ on:
env:
CTEST_OUTPUT_ON_FAILURE: 1
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: ${{ github.ref != 'refs/heads/master' }}
jobs:
emscripten:
name: Emscripten
@@ -20,7 +16,7 @@ jobs:
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
image: emscripten/emsdk:3.1.28
steps:
- name: Checkout
@@ -30,13 +26,12 @@ jobs:
uses: actions/cache@v3
with:
path: /emsdk/upstream/emscripten/cache
key: 3.1.42-${{ runner.os }}
key: 3.1.28-${{ runner.os }}
- name: Patch Emscripten to support LZMA and nlohmann-json
- name: Patch Emscripten to support LZMA
run: |
cd /emsdk/upstream/emscripten
patch -p1 < ${GITHUB_WORKSPACE}/os/emscripten/emsdk-liblzma.patch
patch -p1 < ${GITHUB_WORKSPACE}/os/emscripten/emsdk-nlohmann-json.patch
- name: Build (host tools)
run: |
@@ -66,33 +61,28 @@ jobs:
echo "::group::Build"
echo "Running on $(nproc) cores"
cmake --build . -j $(nproc) --target openttd
cmake --build . -j $(nproc)
echo "::endgroup::"
linux:
name: Linux
strategy:
fail-fast: false
matrix:
include:
- name: Clang
compiler: clang
- compiler: clang
cxxcompiler: clang++
libraries: libsdl2-dev
- name: GCC - SDL2
compiler: gcc
libsdl: libsdl2-dev
- compiler: gcc
cxxcompiler: g++
libraries: libsdl2-dev
- name: GCC - SDL1.2
compiler: gcc
libsdl: libsdl2-dev
- compiler: gcc
cxxcompiler: g++
libraries: libsdl1.2-dev
- name: GCC - Dedicated
compiler: gcc
libsdl: libsdl1.2-dev
- compiler: gcc
cxxcompiler: g++
extra-cmake-parameters: -DOPTION_DEDICATED=ON -DCMAKE_CXX_FLAGS_INIT="-DRANDOM_DEBUG" -DCMAKE_DISABLE_PRECOMPILE_HEADERS=ON
# Compile without SDL / SDL2, as that should compile fine too.
name: Linux (${{ matrix.name }})
extra-cmake-parameters: -DOPTION_DEDICATED=ON -DCMAKE_CXX_FLAGS_INIT="-DRANDOM_DEBUG"
runs-on: ubuntu-20.04
env:
@@ -112,20 +102,13 @@ jobs:
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 \
nlohmann-json3-dev \
${{ matrix.libraries }} \
${{ matrix.libsdl }} \
zlib1g-dev \
# EOF
sudo vcpkg install \
breakpad \
# EOF
echo "::endgroup::"
env:
DEBIAN_FRONTEND: noninteractive
@@ -154,7 +137,7 @@ jobs:
cd build
echo "::group::CMake"
cmake .. -DCMAKE_TOOLCHAIN_FILE=/usr/local/share/vcpkg/scripts/buildsystems/vcpkg.cmake ${{ matrix.extra-cmake-parameters }}
cmake .. ${{ matrix.extra-cmake-parameters }}
echo "::endgroup::"
echo "::group::Build"
@@ -168,6 +151,8 @@ jobs:
ctest -j $(nproc) --timeout 120
macos:
name: Mac OS
strategy:
fail-fast: false
matrix:
@@ -175,8 +160,6 @@ jobs:
- arch: x64
full_arch: x86_64
name: Mac OS (${{ matrix.arch }})
runs-on: macos-latest
env:
MACOSX_DEPLOYMENT_TARGET: 10.13
@@ -203,26 +186,23 @@ jobs:
uses: actions/cache@v3
with:
path: /usr/local/share/vcpkg/installed
key: ${{ steps.key.outputs.image }}-vcpkg-${{ matrix.arch }}-1 # Increase the number whenever dependencies are modified
key: ${{ steps.key.outputs.image }}-vcpkg-${{ matrix.arch }}-0 # Increase the number whenever dependencies are modified
restore-keys: |
${{ steps.key.outputs.image }}-vcpkg-${{ matrix.arch }}
- name: Prepare vcpkg
run: |
vcpkg install --triplet=${{ matrix.arch }}-osx \
breakpad \
curl \
liblzma \
libpng \
lzo \
nlohmann-json \
zlib \
# EOF
- name: Install OpenGFX
run: |
mkdir -p ~/Documents/OpenTTD/baseset
cd ~/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
@@ -243,7 +223,7 @@ jobs:
cd build
echo "::group::CMake"
cmake .. \
cmake ${GITHUB_WORKSPACE} \
-DCMAKE_OSX_ARCHITECTURES=${{ matrix.full_arch }} \
-DVCPKG_TARGET_TRIPLET=${{ matrix.arch }}-osx \
-DCMAKE_TOOLCHAIN_FILE=/usr/local/share/vcpkg/scripts/buildsystems/vcpkg.cmake \
@@ -261,14 +241,14 @@ jobs:
ctest -j $(sysctl -n hw.logicalcpu) --timeout 120
windows:
name: Windows
strategy:
fail-fast: false
matrix:
os: [windows-latest, windows-2019]
arch: [x86, x64]
name: Windows (${{ matrix.os }} / ${{ matrix.arch }})
runs-on: ${{ matrix.os }}
steps:
@@ -288,7 +268,7 @@ jobs:
uses: actions/cache@v3
with:
path: vcpkg/installed
key: ${{ steps.key.outputs.image }}-vcpkg-${{ matrix.arch }}-1 # Increase the number whenever dependencies are modified
key: ${{ steps.key.outputs.image }}-vcpkg-${{ matrix.arch }}-0 # Increase the number whenever dependencies are modified
restore-keys: |
${{ steps.key.outputs.image }}-vcpkg-${{ matrix.arch }}
@@ -296,11 +276,9 @@ jobs:
shell: bash
run: |
vcpkg install --triplet=${{ matrix.arch }}-windows-static \
breakpad \
liblzma \
libpng \
lzo \
nlohmann-json \
zlib \
# EOF
@@ -330,8 +308,6 @@ jobs:
- 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
@@ -351,11 +327,13 @@ jobs:
- name: Test
shell: bash
run: |
cd build
cd ${GITHUB_WORKSPACE}/build
ctest --timeout 120
msys2:
name: msys2
strategy:
fail-fast: false
matrix:
@@ -365,8 +343,6 @@ jobs:
- msystem: MINGW32
arch: i686
name: MinGW (${{ matrix.arch }})
runs-on: windows-latest
steps:
@@ -385,9 +361,6 @@ jobs:
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
mingw-w64-${{ matrix.arch }}-nlohmann-json
- name: Install OpenGFX
shell: bash
@@ -410,28 +383,24 @@ jobs:
- 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
cmake .. -G"MSYS Makefiles"
echo "::endgroup::"
echo "::group::Build"
cmake --build .
echo "Running on $(nproc) cores"
cmake --build . -j $(nproc)
echo "::endgroup::"
- name: Test
shell: msys2 {0}
run: |
cd build
ctest --timeout 120
ctest -j $(nproc) --timeout 120
check_annotations:
name: Check Annotations

View File

@@ -1,86 +0,0 @@
name: CodeQL
on:
push:
branches:
- master
pull_request:
# The branches below must be a subset of the branches above
branches:
- master
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: ${{ github.ref != 'refs/heads/master' }}
jobs:
analyze:
name: Analyze
runs-on: ubuntu-latest
permissions:
actions: read
contents: read
security-events: write
steps:
- name: Checkout
uses: actions/checkout@v3
- 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 \
libsdl2-dev \
nlohmann-json3-dev \
zlib1g-dev \
# EOF
echo "::endgroup::"
env:
DEBIAN_FRONTEND: noninteractive
- name: Set number of make jobs
run: |
echo "MAKEFLAGS=-j$(nproc)" >> $GITHUB_ENV
- name: Initialize CodeQL
uses: github/codeql-action/init@v2
with:
languages: cpp
config-file: ./.github/codeql/codeql-config.yml
- name: Autobuild
uses: github/codeql-action/autobuild@v2
- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v2
with:
category: /language:cpp
upload: False
output: sarif-results
- name: Filter out table & generated code
uses: advanced-security/filter-sarif@v1
with:
patterns: |
+**/*.*
-**/table/*.*
-**/generated/**/*.*
-**/tests/*.*
input: sarif-results/cpp.sarif
output: sarif-results/cpp.sarif
- name: Upload results
uses: github/codeql-action/upload-sarif@v2
with:
sarif_file: sarif-results/cpp.sarif

View File

@@ -3,10 +3,6 @@ name: Commit checker
on:
pull_request:
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: ${{ github.ref != 'refs/heads/master' }}
jobs:
commit-checker:
name: Commit checker

View File

@@ -1,104 +0,0 @@
name: Preview build
on:
workflow_call:
secrets:
PREVIEW_CLOUDFLARE_API_TOKEN:
description: API token to upload a preview to Cloudflare Pages
required: true
PREVIEW_CLOUDFLARE_ACCOUNT_ID:
description: Account ID to upload a preview to Cloudflare Pages
required: true
jobs:
preview:
name: Build preview
environment:
name: preview
url: https://preview.openttd.org/pr${{ github.event.pull_request.number }}/
runs-on: ubuntu-latest
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@v3
with:
ref: ${{ github.event.pull_request.head.sha }}
- name: Name branch
run: |
git config --global --add safe.directory ${GITHUB_WORKSPACE}
git checkout -b pr${{ github.event.pull_request.number }}
- name: Setup cache
uses: actions/cache@v3
with:
path: /emsdk/upstream/emscripten/cache
key: 3.1.42-${{ runner.os }}
- name: Patch Emscripten to support LZMA and nlohmann_json
run: |
cd /emsdk/upstream/emscripten
patch -p1 < ${GITHUB_WORKSPACE}/os/emscripten/emsdk-liblzma.patch
patch -p1 < ${GITHUB_WORKSPACE}/os/emscripten/emsdk-nlohmann-json.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"
make -j$(nproc) 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 \
-DCMAKE_BUILD_TYPE=Release \
# EOF
echo "::endgroup::"
echo "::group::Build"
echo "Running on $(nproc) cores"
cmake --build . -j $(nproc) --target openttd
echo "::endgroup::"
- name: Prepare preview
run: |
mkdir public
cp build/openttd.data public/
cp build/openttd.html public/
cp build/openttd.js public/
cp build/openttd.wasm public/
# Ensure we use the latest version of npm; the one we get with current
# emscripten doesn't allow running "npx wrangler" as root.
# Current emscripten can't install npm>=10.0.0 because node is too old.
npm install -g npm@9
- name: Publish preview
uses: cloudflare/pages-action@v1
with:
apiToken: ${{ secrets.PREVIEW_CLOUDFLARE_API_TOKEN }}
accountId: ${{ secrets.PREVIEW_CLOUDFLARE_ACCOUNT_ID }}
projectName: ${{ vars.PREVIEW_CLOUDFLARE_PROJECT_NAME }}
directory: public
branch: pr${{ github.event.pull_request.number }}

View File

@@ -1,20 +0,0 @@
name: Preview
on:
pull_request_target:
types:
- labeled
- synchronize
branches:
- master
concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number }}
cancel-in-progress: true
jobs:
preview:
if: ${{ (github.event.action == 'labeled' && github.event.label.name == 'preview') || (github.event.action != 'labeled' && contains(github.event.pull_request.labels.*.name, 'preview')) }}
name: Preview
uses: ./.github/workflows/preview-build.yml
secrets: inherit

133
.github/workflows/preview_build.yml vendored Normal file
View File

@@ -0,0 +1,133 @@
name: Preview build
on:
repository_dispatch:
types:
- Preview*
jobs:
preview:
name: Build preview
runs-on: ubuntu-20.04
container:
# If you change this version, change the number in the cache step too.
image: emscripten/emsdk:3.1.28
steps:
- name: Update deployment status to in progress
uses: octokit/request-action@v2.x
with:
route: POST /repos/{owner}/{repo}/deployments/{deployment_id}/statuses
mediaType: |
previews:
- ant-man
- flash
owner: ${{ github.event.repository.owner.login }}
repo: ${{ github.event.repository.name }}
deployment_id: ${{ github.event.client_payload.deployment_id }}
state: in_progress
env:
GITHUB_TOKEN: ${{ secrets.PREVIEW_GITHUB_TOKEN }}
- name: Checkout
uses: actions/checkout@v3
with:
ref: ${{ github.event.client_payload.sha }}
- name: Name branch
run: |
name=$(echo "${{ github.event.client_payload.folder }}")
git checkout -b ${name}
- name: Setup cache
uses: actions/cache@v3
with:
path: /emsdk/upstream/emscripten/cache
key: 3.1.28-${{ 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"
make -j$(nproc) 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 \
-DCMAKE_BUILD_TYPE=Release \
# EOF
echo "::endgroup::"
echo "::group::Build"
echo "Running on $(nproc) cores"
emmake make -j$(nproc)
echo "::endgroup::"
- name: Publish preview
run: |
pip3 install awscli
aws s3 cp --only-show-errors build/openttd.data s3://${{ secrets.PREVIEW_S3_BUCKET }}/${{ github.event.client_payload.folder }}/
aws s3 cp --only-show-errors build/openttd.html s3://${{ secrets.PREVIEW_S3_BUCKET }}/${{ github.event.client_payload.folder }}/
aws s3 cp --only-show-errors build/openttd.js s3://${{ secrets.PREVIEW_S3_BUCKET }}/${{ github.event.client_payload.folder }}/
aws s3 cp --only-show-errors build/openttd.wasm s3://${{ secrets.PREVIEW_S3_BUCKET }}/${{ github.event.client_payload.folder }}/
# Invalidate the cache of the CloudFront distribution
aws cloudfront create-invalidation --distribution-id ${{ secrets.PREVIEW_CF_DISTRIBUTION_ID }} --paths "/${{ github.event.client_payload.folder }}/*"
env:
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
- name: Update deployment status to success
uses: octokit/request-action@v2.x
with:
route: POST /repos/{owner}/{repo}/deployments/{deployment_id}/statuses
mediaType: |
previews:
- ant-man
- flash
owner: ${{ github.event.repository.owner.login }}
repo: ${{ github.event.repository.name }}
deployment_id: ${{ github.event.client_payload.deployment_id }}
state: success
environment_url: https://preview.openttd.org/${{ github.event.client_payload.folder }}/
env:
GITHUB_TOKEN: ${{ secrets.PREVIEW_GITHUB_TOKEN }}
- if: failure()
name: Update deployment status to failure
uses: octokit/request-action@v2.x
with:
route: POST /repos/{owner}/{repo}/deployments/{deployment_id}/statuses
mediaType: |
previews:
- ant-man
- flash
owner: ${{ github.event.repository.owner.login }}
repo: ${{ github.event.repository.name }}
deployment_id: ${{ github.event.client_payload.deployment_id }}
state: failure
env:
GITHUB_TOKEN: ${{ secrets.PREVIEW_GITHUB_TOKEN }}

66
.github/workflows/preview_label.yml vendored Normal file
View File

@@ -0,0 +1,66 @@
name: Preview label
on:
pull_request_target:
types:
- labeled
env:
TEAM_CORE_DEVELOPER: core-developers
jobs:
check_preview_label:
name: Check for preview label
if: github.event.action == 'labeled' && github.event.label.name == 'preview'
runs-on: ubuntu-20.04
steps:
- name: Check if label was added by core developer
id: core_developer
continue-on-error: true
uses: octokit/request-action@v2.x
with:
route: GET /orgs/OpenTTD/teams/${{ env.TEAM_CORE_DEVELOPER }}/memberships/${{ github.event.sender.login }}
env:
GITHUB_TOKEN: ${{ secrets.PREVIEW_GITHUB_TOKEN }}
- if: steps.core_developer.outcome == 'failure'
name: Remove preview label if not core developer
uses: octokit/request-action@v2.x
with:
route: DELETE /repos/{owner}/{repo}/issues/{issue_number}/labels/preview
owner: ${{ github.event.repository.owner.login }}
repo: ${{ github.event.repository.name }}
issue_number: ${{ github.event.number }}
env:
GITHUB_TOKEN: ${{ secrets.PREVIEW_GITHUB_TOKEN }}
- if: steps.core_developer.outcome == 'success'
name: Create deployment
id: deployment
uses: octokit/request-action@v2.x
with:
route: POST /repos/{owner}/{repo}/deployments
mediaType: |
previews:
- ant-man
- flash
owner: ${{ github.event.repository.owner.login }}
repo: ${{ github.event.repository.name }}
ref: ${{ github.event.pull_request.head.sha }}
task: deploy:preview
auto_merge: false
required_contexts: "[]"
environment: preview-pr-${{ github.event.number }}
description: "Preview for Pull Request #${{ github.event.number }}"
env:
GITHUB_TOKEN: ${{ secrets.PREVIEW_GITHUB_TOKEN }}
- if: steps.core_developer.outcome == 'success'
name: Trigger 'preview build'
uses: peter-evans/repository-dispatch@v2
with:
token: ${{ secrets.PREVIEW_GITHUB_TOKEN }}
event-type: "Preview build #${{ github.event.number }}"
client-payload: '{"folder": "pr${{ github.event.number }}", "sha": "${{ github.event.pull_request.head.sha }}", "deployment_id": "${{ fromJson(steps.deployment.outputs.data).id }}"}'

66
.github/workflows/preview_push.yml vendored Normal file
View File

@@ -0,0 +1,66 @@
name: Preview push
on:
pull_request_target:
types:
- synchronize
jobs:
check_new_preview:
name: Check preview needs update
runs-on: ubuntu-20.04
steps:
- name: Check if earlier preview exists
id: earlier_preview
uses: octokit/request-action@v2.x
with:
route: GET /repos/{owner}/{repo}/deployments
owner: ${{ github.event.repository.owner.login }}
repo: ${{ github.event.repository.name }}
environment: preview-pr-${{ github.event.number }}
per_page: 1
env:
GITHUB_TOKEN: ${{ secrets.PREVIEW_GITHUB_TOKEN }}
- if: toJson(fromJson(steps.earlier_preview.outputs.data)) != '[]'
name: Check for preview label
id: preview_label
uses: octokit/request-action@v2.x
with:
route: GET /repos/{owner}/{repo}/issues/{issue_number}/labels
owner: ${{ github.event.repository.owner.login }}
repo: ${{ github.event.repository.name }}
issue_number: ${{ github.event.number }}
env:
GITHUB_TOKEN: ${{ secrets.PREVIEW_GITHUB_TOKEN }}
- if: toJson(fromJson(steps.earlier_preview.outputs.data)) != '[]' && contains(fromJson(steps.preview_label.outputs.data).*.name, 'preview')
name: Create deployment
id: deployment
uses: octokit/request-action@v2.x
with:
route: POST /repos/{owner}/{repo}/deployments
mediaType: |
previews:
- ant-man
- flash
owner: ${{ github.event.repository.owner.login }}
repo: ${{ github.event.repository.name }}
ref: ${{ github.event.pull_request.head.sha }}
task: deploy:preview
auto_merge: false
required_contexts: "[]"
environment: preview-pr-${{ github.event.number }}
description: "Preview for Pull Request #${{ github.event.number }}"
env:
GITHUB_TOKEN: ${{ secrets.PREVIEW_GITHUB_TOKEN }}
- if: toJson(fromJson(steps.earlier_preview.outputs.data)) != '[]' && contains(fromJson(steps.preview_label.outputs.data).*.name, 'preview')
name: Trigger 'preview build'
uses: peter-evans/repository-dispatch@v2
with:
token: ${{ secrets.PREVIEW_GITHUB_TOKEN }}
event-type: "Preview build #${{ github.event.number }}"
client-payload: '{"folder": "pr${{ github.event.number }}", "sha": "${{ github.event.pull_request.head.sha }}", "deployment_id": "${{ fromJson(steps.deployment.outputs.data).id }}"}'

View File

@@ -2,11 +2,6 @@ name: Release (Linux)
on:
workflow_call:
inputs:
survey_key:
required: false
type: string
default: ""
jobs:
linux:
@@ -28,59 +23,34 @@ jobs:
run: |
tar -xf source.tar.gz --strip-components=1
# dtolnay/rust-toolchain uses a curl argument (--retry-connrefused) that the curl shipped with our container doesn't support.
# So we need to do one part ourselves; the action takes over the rest and prepares the setup further.
- name: Prepare Rust toolchain
run: |
curl --proto '=https' --tlsv1.2 --retry 10 --location --silent --show-error --fail "https://sh.rustup.rs" | sh -s -- --default-toolchain none -y
echo "${CARGO_HOME:-$HOME/.cargo}/bin" >> $GITHUB_PATH
- name: Install Rust toolchain
uses: dtolnay/rust-toolchain@stable
- name: Enable Rust cache
uses: Swatinem/rust-cache@v2
- name: Enable vcpkg cache
uses: actions/cache@v3
with:
path: /vcpkg/installed
key: ubuntu-20.04-vcpkg-release-1 # Increase the number whenever dependencies are modified
restore-keys: |
ubuntu-20.04-vcpkg-release
- name: Install dependencies
run: |
echo "::group::Install system dependencies"
# perl-IPC-Cmd, wget, and zip are needed to run vcpkg.
# autoconf-archive is needed to build ICU.
echo "::group::Install dependencies"
yum install -y \
autoconf-archive \
perl-IPC-Cmd \
fontconfig-devel \
freetype-devel \
libicu-devel \
libpng-devel \
lzo-devel \
SDL2-devel \
wget \
zip \
xz-devel \
zlib-devel \
# EOF
# aclocal looks first in /usr/local/share/aclocal, and if that doesn't
# exist only looks in /usr/share/aclocal. We have files in both that
# are important. So copy the latter to the first, and we are good to
# go.
cp /usr/share/aclocal/* /usr/local/share/aclocal/
echo "::endgroup::"
# The yum variant of fluidsynth depends on all possible audio drivers,
# like jack, ALSA, pulseaudio, etc. This is not really useful for us,
# as we route the output of fluidsynth back via our sound driver, and
# as such do not use these audio driver outputs at all.
# The vcpkg variant of fluidsynth depends on ALSA. Similar issue here.
# So instead, we compile fluidsynth ourselves, with as few
# dependencies as possible. We do it before anything else is installed,
# to make sure it doesn't pick up on any of the drivers.
# as such do not use these audio driver outputs at all. So instead,
# we compile fluidsynth ourselves, with as little dependencies as
# possible. This currently means it picks up SDL2, but this is fine,
# as we need SDL2 anyway.
echo "::group::Install fluidsynth"
wget https://github.com/FluidSynth/fluidsynth/archive/v2.3.3.tar.gz
tar xf v2.3.3.tar.gz
wget https://github.com/FluidSynth/fluidsynth/archive/v2.1.6.tar.gz
tar xf v2.1.6.tar.gz
(
cd fluidsynth-2.3.3
cd fluidsynth-2.1.6
mkdir build
cd build
cmake .. -DCMAKE_BUILD_TYPE=RelWithDebInfo -DCMAKE_INSTALL_PREFIX=/usr
@@ -89,58 +59,6 @@ jobs:
)
echo "::endgroup::"
echo "::group::Install audio drivers"
# These audio libs are to make sure the SDL version of vcpkg adds
# sound-support; these libraries are not added to the resulting
# binary, but the headers are used to enable them in SDL.
yum install -y \
alsa-lib-devel \
jack-audio-connection-kit-devel \
pulseaudio-libs-devel \
# EOF
echo "::endgroup::"
# We use vcpkg for our dependencies, to get more up-to-date version.
echo "::group::Install vcpkg and dependencies"
# We do a little dance to make sure we copy the cached install folder
# into our new clone.
git clone --depth=1 https://github.com/microsoft/vcpkg /vcpkg-clone
if [ -e /vcpkg/installed ]; then
mv /vcpkg/installed /vcpkg-clone/
rm -rf /vcpkg
fi
mv /vcpkg-clone /vcpkg
(
cd /vcpkg
./bootstrap-vcpkg.sh -disableMetrics
# Make Python3 available for other packages.
./vcpkg install python3
ln -sf $(pwd)/installed/x64-linux/tools/python3/python3.[0-9][0-9] /usr/bin/python3
./vcpkg install \
breakpad \
curl[http2] \
fontconfig \
freetype \
harfbuzz \
icu \
liblzma \
libpng \
lzo \
nlohmann-json \
sdl2 \
zlib \
# EOF
)
echo "::endgroup::"
echo "::group::Install breakpad dependencies"
cargo install dump_syms
echo "::endgroup::"
- name: Install GCC problem matcher
uses: ammaraskar/gcc-problem-matcher@master
@@ -151,23 +69,16 @@ jobs:
echo "::group::CMake"
cmake ${GITHUB_WORKSPACE} \
-DCMAKE_TOOLCHAIN_FILE=/vcpkg/scripts/buildsystems/vcpkg.cmake \
-DCMAKE_BUILD_TYPE=RelWithDebInfo \
-DOPTION_SURVEY_KEY=${{ inputs.survey_key }} \
-DOPTION_PACKAGE_DEPENDENCIES=ON \
# EOF
echo "::endgroup::"
echo "::group::Build"
echo "Running on $(nproc) cores"
cmake --build . -j $(nproc) --target openttd
cmake --build . -j $(nproc)
echo "::endgroup::"
- name: Create breakpad symbols
run: |
cd build
dump_syms ./openttd --inlines --store symbols
- name: Create bundles
run: |
cd ${GITHUB_WORKSPACE}/build
@@ -187,10 +98,3 @@ jobs:
name: openttd-linux-generic
path: build/bundles
retention-days: 5
- name: Store symbols
uses: actions/upload-artifact@v3
with:
name: symbols-linux-generic
path: build/symbols
retention-days: 5

View File

@@ -2,11 +2,6 @@ name: Release (MacOS)
on:
workflow_call:
inputs:
survey_key:
required: false
type: string
default: ""
jobs:
macos:
@@ -26,27 +21,15 @@ jobs:
run: |
tar -xf source.tar.gz --strip-components=1
- name: Install Rust toolchain
uses: dtolnay/rust-toolchain@stable
- name: Enable Rust cache
uses: Swatinem/rust-cache@v2
- name: Install dependencies
env:
HOMEBREW_NO_AUTO_UPDATE: 1
HOMEBREW_NO_INSTALL_CLEANUP: 1
run: |
echo "::group::Install brew dependencies"
brew install \
pandoc \
pkg-config \
# EOF
echo "::endgroup::"
echo "::group::Install breakpad dependencies"
cargo install dump_syms
echo "::endgroup::"
- name: Prepare cache key
id: key
@@ -57,7 +40,7 @@ jobs:
uses: actions/cache@v3
with:
path: /usr/local/share/vcpkg/installed
key: ${{ steps.key.outputs.image }}-vcpkg-release-1 # Increase the number whenever dependencies are modified
key: ${{ steps.key.outputs.image }}-vcpkg-release-0 # Increase the number whenever dependencies are modified
restore-keys: |
${{ steps.key.outputs.image }}-vcpkg-release
${{ steps.key.outputs.image }}-vcpkg-x64
@@ -65,18 +48,12 @@ jobs:
- name: Prepare vcpkg
run: |
vcpkg install \
breakpad:x64-osx \
breakpad:arm64-osx \
curl:x64-osx \
curl:arm64-osx \
liblzma:x64-osx \
liblzma:arm64-osx \
libpng:x64-osx \
libpng:arm64-osx \
lzo:x64-osx \
lzo:arm64-osx \
nlohmann-json:x64-osx \
nlohmann-json:arm64-osx \
zlib:x64-osx \
zlib:arm64-osx \
# EOF
@@ -102,7 +79,7 @@ jobs:
echo "::endgroup::"
- name: Import code signing certificates
uses: Apple-Actions/import-codesign-certs@v2
uses: Apple-Actions/import-codesign-certs@v1
with:
# The certificates in a PKCS12 file encoded as a base64 string
p12-file-base64: ${{ secrets.APPLE_DEVELOPER_CERTIFICATE_P12_BASE64 }}
@@ -123,13 +100,12 @@ jobs:
-DCMAKE_TOOLCHAIN_FILE=/usr/local/share/vcpkg/scripts/buildsystems/vcpkg.cmake \
-DHOST_BINARY_DIR=${GITHUB_WORKSPACE}/build-host \
-DCMAKE_BUILD_TYPE=RelWithDebInfo \
-DOPTION_SURVEY_KEY=${{ inputs.survey_key }} \
# EOF
echo "::endgroup::"
echo "::group::Build"
echo "Running on $(sysctl -n hw.logicalcpu) cores"
cmake --build . -j $(sysctl -n hw.logicalcpu) --target openttd
cmake --build . -j $(sysctl -n hw.logicalcpu)
echo "::endgroup::"
- name: Build x64
@@ -144,7 +120,6 @@ jobs:
-DCMAKE_TOOLCHAIN_FILE=/usr/local/share/vcpkg/scripts/buildsystems/vcpkg.cmake \
-DHOST_BINARY_DIR=${GITHUB_WORKSPACE}/build-host \
-DCMAKE_BUILD_TYPE=RelWithDebInfo \
-DOPTION_SURVEY_KEY=${{ inputs.survey_key }} \
-DCPACK_BUNDLE_APPLE_CERT_APP=${{ secrets.APPLE_DEVELOPER_CERTIFICATE_ID }} \
"-DCPACK_BUNDLE_APPLE_CODESIGN_PARAMETER=--deep -f --options runtime" \
-DAPPLE_UNIVERSAL_PACKAGE=1 \
@@ -153,21 +128,9 @@ jobs:
echo "::group::Build"
echo "Running on $(sysctl -n hw.logicalcpu) cores"
cmake --build . -j $(sysctl -n hw.logicalcpu) --target openttd
cmake --build . -j $(sysctl -n hw.logicalcpu)
echo "::endgroup::"
- name: Create breakpad symbols
run: |
cd build-x64
mkdir dSYM
dsymutil ./openttd -o dSYM/openttd
dump_syms ./dSYM/openttd --inlines --store symbols
cd ../build-arm64
mkdir dSYM
dsymutil ./openttd -o dSYM/openttd
dump_syms ./dSYM/openttd --inlines --store ../build-x64/symbols
- name: Create bundles
run: |
cd build-x64
@@ -188,19 +151,19 @@ jobs:
rm -f bundles/*.sha256
echo "::endgroup::"
- name: Install gon
env:
HOMEBREW_NO_AUTO_UPDATE: 1
HOMEBREW_NO_INSTALL_CLEANUP: 1
run: |
brew tap mitchellh/gon
brew install mitchellh/gon/gon
- name: Notarize
env:
AC_USERNAME: ${{ secrets.APPLE_DEVELOPER_APP_USERNAME }}
AC_PASSWORD: ${{ secrets.APPLE_DEVELOPER_APP_PASSWORD }}
AC_TEAM_ID: ${{ secrets.APPLE_DEVELOPER_TEAM_ID }}
run: |
if [ -z "${AC_USERNAME}" ]; then
# We may be running on a fork that doesn't have notarization secrets set up; skip this step
echo No notarization secrets set up, skipping.
exit 0
fi
xcrun notarytool store-credentials --apple-id "${AC_USERNAME}" --password "${AC_PASSWORD}" --team-id "${AC_TEAM_ID}" openttd
cd build-x64
../os/macosx/notarize.sh
@@ -233,10 +196,3 @@ jobs:
name: openttd-macos-universal
path: build-x64/bundles
retention-days: 5
- name: Store symbols
uses: actions/upload-artifact@v3
with:
name: symbols-macos-universal
path: build-x64/symbols
retention-days: 5

View File

@@ -11,8 +11,6 @@ on:
value: ${{ jobs.source.outputs.trigger_type }}
folder:
value: ${{ jobs.source.outputs.folder }}
survey_key:
value: ${{ jobs.source.outputs.survey_key }}
jobs:
source:
@@ -25,7 +23,6 @@ jobs:
is_tag: ${{ steps.metadata.outputs.is_tag }}
trigger_type: ${{ steps.metadata.outputs.trigger_type }}
folder: ${{ steps.metadata.outputs.folder }}
survey_key: ${{ steps.survey_key.outputs.survey_key }}
steps:
- name: Checkout (Release)
@@ -149,24 +146,6 @@ jobs:
FOLDER_NIGHTLIES: openttd-nightlies
FOLDER_BRANCHES: openttd-branches
- name: Generate survey key
id: survey_key
run: |
if [ -z "${{ vars.SURVEY_TYPE }}" ]; then
echo "SURVEY_TYPE variable not found; most likely running in a fork. Skipping step."
SURVEY_KEY=""
else
PAYLOAD='{"version":"${{ steps.metadata.outputs.version }}","type":"${{ vars.SURVEY_TYPE }}"}'
echo "${{ secrets.SURVEY_SIGNING_KEY }}" > survey_signing_key.pem
SIGNATURE=$(echo -n "${PAYLOAD}" | openssl dgst -sha256 -sign survey_signing_key.pem | base64 -w0)
rm -f survey_signing_key.pem
SURVEY_KEY=$(curl -f -s -X POST -d "${PAYLOAD}" -H "Content-Type: application/json" -H "X-Signature: ${SIGNATURE}" https://survey-participate.openttd.org/create-survey-key/${{ vars.SURVEY_TYPE }})
fi
echo "survey_key=${SURVEY_KEY}" >> $GITHUB_OUTPUT
- name: Remove VCS information
run: |
rm -rf .git

View File

@@ -3,16 +3,14 @@ name: Release (Windows)
on:
workflow_call:
inputs:
survey_key:
required: false
type: string
default: ""
is_tag:
required: true
type: string
jobs:
windows:
name: Windows
strategy:
fail-fast: false
matrix:
@@ -24,8 +22,6 @@ jobs:
- arch: arm64
host: x64_arm64
name: Windows (${{ matrix.arch }})
runs-on: windows-latest
steps:
@@ -39,22 +35,10 @@ jobs:
run: |
tar -xf source.tar.gz --strip-components=1
- name: Install Rust toolchain
uses: dtolnay/rust-toolchain@stable
- name: Enable Rust cache
uses: Swatinem/rust-cache@v2
- name: Install dependencies
shell: bash
run: |
echo "::group::Install choco dependencies"
choco install pandoc
echo "::endgroup::"
echo "::group::Install breakpad dependencies"
cargo install dump_syms
echo "::endgroup::"
- name: Prepare cache key
id: key
@@ -69,7 +53,7 @@ jobs:
uses: actions/cache@v3
with:
path: vcpkg/installed
key: ${{ steps.key.outputs.image }}-vcpkg-${{ matrix.arch }}-1 # Increase the number whenever dependencies are modified
key: ${{ steps.key.outputs.image }}-vcpkg-${{ matrix.arch }}-0 # Increase the number whenever dependencies are modified
restore-keys: |
${{ steps.key.outputs.image }}-vcpkg-${{ matrix.arch }}
@@ -80,17 +64,9 @@ jobs:
liblzma \
libpng \
lzo \
nlohmann-json \
zlib \
# EOF
# arm64-windows-static is not (yet) supported for breakpad.
if [ "${{ matrix.arch }}" != "arm64" ]; then
vcpkg install --triplet=${{ matrix.arch }}-windows-static \
breakpad \
# EOF
fi
- name: Install MSVC problem matcher
uses: ammaraskar/msvc-problem-matcher@master
@@ -152,13 +128,12 @@ jobs:
-DOPTION_USE_NSIS=ON \
-DHOST_BINARY_DIR=${GITHUB_WORKSPACE}/build-host \
-DCMAKE_BUILD_TYPE=RelWithDebInfo \
-DOPTION_SURVEY_KEY=${{ inputs.survey_key }} \
-DWINDOWS_CERTIFICATE_COMMON_NAME="${WINDOWS_CERTIFICATE_COMMON_NAME}" \
# EOF
echo "::endgroup::"
echo "::group::Build"
cmake --build . --target openttd
cmake --build .
echo "::endgroup::"
env:
WINDOWS_CERTIFICATE_COMMON_NAME: ${{ secrets.WINDOWS_CERTIFICATE_COMMON_NAME }}
@@ -177,23 +152,16 @@ jobs:
-DCMAKE_TOOLCHAIN_FILE="c:\vcpkg\scripts\buildsystems\vcpkg.cmake" \
-DHOST_BINARY_DIR=${GITHUB_WORKSPACE}/build-host \
-DCMAKE_BUILD_TYPE=RelWithDebInfo \
-DOPTION_SURVEY_KEY=${{ inputs.survey_key }} \
-DWINDOWS_CERTIFICATE_COMMON_NAME="${WINDOWS_CERTIFICATE_COMMON_NAME}" \
# EOF
echo "::endgroup::"
echo "::group::Build"
cmake --build . --target openttd
cmake --build .
echo "::endgroup::"
env:
WINDOWS_CERTIFICATE_COMMON_NAME: ${{ secrets.WINDOWS_CERTIFICATE_COMMON_NAME }}
- name: Create breakpad symbols
shell: bash
run: |
cd build
dump_syms openttd.pdb --inlines --store symbols
- name: Create bundles
shell: bash
run: |
@@ -202,13 +170,10 @@ jobs:
cpack
echo "::endgroup::"
echo "::group::Move PDB and exe to symbols"
PDB_FOLDER=$(find symbols -mindepth 2 -type d)
cp openttd.pdb ${PDB_FOLDER}/
EXE_FOLDER=symbols/openttd.exe/$(grep "INFO CODE_ID" symbols/*/*/openttd.sym | cut -d\ -f3)
mkdir -p ${EXE_FOLDER}
cp openttd.exe ${EXE_FOLDER}/
echo "::group::Prepare PDB to be bundled"
PDB=$(ls bundles/*.zip | cut -d/ -f2 | sed 's/.zip$/.pdb/')
cp openttd.pdb bundles/${PDB}
xz -9 bundles/${PDB}
echo "::endgroup::"
echo "::group::Cleanup"
@@ -234,10 +199,3 @@ jobs:
name: openttd-windows-${{ matrix.arch }}
path: build/bundles
retention-days: 5
- name: Store symbols
uses: actions/upload-artifact@v3
with:
name: symbols-windows-${{ matrix.arch }}
path: build/symbols
retention-days: 5

View File

@@ -38,9 +38,6 @@ jobs:
uses: ./.github/workflows/release-linux.yml
secrets: inherit
with:
survey_key: ${{ needs.source.outputs.survey_key }}
macos:
name: MacOS
needs: source
@@ -48,9 +45,6 @@ jobs:
uses: ./.github/workflows/release-macos.yml
secrets: inherit
with:
survey_key: ${{ needs.source.outputs.survey_key }}
windows:
name: Windows
needs: source
@@ -60,7 +54,6 @@ jobs:
with:
is_tag: ${{ needs.source.outputs.is_tag }}
survey_key: ${{ needs.source.outputs.survey_key }}
windows-store:
name: Windows Store
@@ -76,8 +69,8 @@ jobs:
with:
version: ${{ needs.source.outputs.version }}
upload-cdn:
name: Upload (CDN)
upload-aws:
name: Upload (AWS)
needs:
- source
- docs
@@ -90,7 +83,7 @@ jobs:
# The always() makes sure the rest is always evaluated.
if: always() && needs.source.result == 'success' && needs.docs.result == 'success' && needs.linux.result == 'success' && needs.macos.result == 'success' && needs.windows.result == 'success' && (needs.windows-store.result == 'success' || needs.windows-store.result == 'skipped')
uses: ./.github/workflows/upload-cdn.yml
uses: ./.github/workflows/upload-aws.yml
secrets: inherit
with:

View File

@@ -1,22 +0,0 @@
name: Script missing mode enforcement
on:
pull_request:
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: ${{ github.ref != 'refs/heads/master' }}
jobs:
script-missing-mode-enforcement:
name: Script missing mode enforcement
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Check for finding script functions that require company/deity mode enforcement/checks
run: |
set -ex
python3 .github/script-missing-mode-enforcement.py

View File

@@ -3,10 +3,6 @@ name: Unused strings
on:
pull_request:
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: ${{ github.ref != 'refs/heads/master' }}
jobs:
unused-strings:
name: Unused strings

76
.github/workflows/upload-aws.yml vendored Normal file
View File

@@ -0,0 +1,76 @@
name: Upload (AWS)
on:
workflow_call:
inputs:
version:
required: true
type: string
folder:
required: true
type: string
trigger_type:
required: true
type: string
jobs:
upload:
name: Upload (AWS)
runs-on: ubuntu-20.04
steps:
- name: Download all bundles
uses: actions/download-artifact@v3
- name: Calculate checksums
run: |
echo "::group::Move bundles to a single folder"
mkdir bundles
mv openttd-*/* bundles/
echo "::endgroup::"
cd bundles
for i in $(ls openttd-*); do
echo "::group::Calculating checksums for ${i}"
openssl dgst -r -md5 -hex $i > $i.md5sum
openssl dgst -r -sha1 -hex $i > $i.sha1sum
openssl dgst -r -sha256 -hex $i > $i.sha256sum
echo "::endgroup::"
done
# Some targets generate files that are meant for our-eyes-only.
# They are stored in the "internal" folder, and contains bundles
# for targets like Windows Store. No user has a benefit of knowing
# they exist, hence: internal.
if [ -e internal ]; then
cd internal
for i in $(ls openttd-*); do
echo "::group::Calculating checksums for ${i}"
openssl dgst -r -md5 -hex $i > $i.md5sum
openssl dgst -r -sha1 -hex $i > $i.sha1sum
openssl dgst -r -sha256 -hex $i > $i.sha256sum
echo "::endgroup::"
done
fi
- name: Upload bundles to AWS
run: |
aws s3 cp --recursive --only-show-errors bundles/ s3://${{ secrets.CDN_S3_BUCKET }}/${{ inputs.folder }}/${{ inputs.version }}/
# We do not invalidate the CloudFront distribution here. The trigger
# for "New OpenTTD release" first updated the manifest files and
# creates an index.html. We invalidate after that, so everything
# becomes visible at once.
env:
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
AWS_DEFAULT_REGION: ${{ secrets.AWS_REGION }}
- name: Trigger 'New OpenTTD release'
uses: peter-evans/repository-dispatch@v2
with:
token: ${{ secrets.DEPLOYMENT_TOKEN }}
repository: OpenTTD/workflows
event-type: ${{ inputs.trigger_type }}
client-payload: '{"version": "${{ inputs.version }}", "folder": "${{ inputs.folder }}"}'

View File

@@ -1,137 +0,0 @@
name: Upload (CDN)
on:
workflow_call:
inputs:
version:
required: true
type: string
folder:
required: true
type: string
trigger_type:
required: true
type: string
jobs:
prepare:
name: Prepare
runs-on: ubuntu-latest
steps:
- name: Download all bundles
uses: actions/download-artifact@v3
- name: Calculate checksums
run: |
echo "::group::Move bundles to a single folder"
mkdir bundles
mv openttd-*/* bundles/
echo "::endgroup::"
cd bundles
for i in $(ls openttd-*); do
echo "::group::Calculating checksums for ${i}"
openssl dgst -r -md5 -hex $i > $i.md5sum
openssl dgst -r -sha1 -hex $i > $i.sha1sum
openssl dgst -r -sha256 -hex $i > $i.sha256sum
echo "::endgroup::"
done
# Some targets generate files that are meant for our-eyes-only.
# They are stored in the "internal" folder, and contains bundles
# for targets like Windows Store. No user has a benefit of knowing
# they exist, hence: internal.
if [ -e internal ]; then
cd internal
for i in $(ls openttd-*); do
echo "::group::Calculating checksums for ${i}"
openssl dgst -r -md5 -hex $i > $i.md5sum
openssl dgst -r -sha1 -hex $i > $i.sha1sum
openssl dgst -r -sha256 -hex $i > $i.sha256sum
echo "::endgroup::"
done
fi
- name: Merge symbols
run: |
mkdir symbols
cp -R symbols-*/* symbols/
# Compress all files as gzip, to reduce cost of storage on the CDN.
for i in $(find symbols -mindepth 2 -type f); do
gzip ${i}
done
# Leave a mark in each folder what version actually created the symbol file.
for i in $(find symbols -mindepth 2 -type d); do
touch ${i}/.${{ inputs.version }}.txt
done
- name: Store bundles
uses: actions/upload-artifact@v3
with:
name: cdn-bundles
path: bundles/*
retention-days: 5
- name: Store breakpad symbols
uses: actions/upload-artifact@v3
with:
name: cdn-symbols
path: symbols/*
retention-days: 5
publish-bundles:
needs:
- prepare
name: Publish bundles
uses: OpenTTD/actions/.github/workflows/rw-cdn-upload.yml@v4
secrets:
CDN_SIGNING_KEY: ${{ secrets.CDN_SIGNING_KEY }}
DEPLOYMENT_APP_ID: ${{ secrets.DEPLOYMENT_APP_ID }}
DEPLOYMENT_APP_PRIVATE_KEY: ${{ secrets.DEPLOYMENT_APP_PRIVATE_KEY }}
with:
artifact-name: cdn-bundles
folder: ${{ inputs.folder }}
version: ${{ inputs.version }}
publish-symbols:
needs:
- prepare
name: Publish symbols
uses: OpenTTD/actions/.github/workflows/rw-symbols-upload.yml@v4
secrets:
SYMBOLS_SIGNING_KEY: ${{ secrets.SYMBOLS_SIGNING_KEY }}
with:
artifact-name: cdn-symbols
repository: OpenTTD
docs:
if: ${{ inputs.trigger_type == 'new-master' }}
needs:
- publish-bundles
name: Publish docs
runs-on: ubuntu-latest
steps:
- name: Generate access token
id: generate_token
uses: tibdex/github-app-token@v1
with:
app_id: ${{ secrets.DEPLOYMENT_APP_ID }}
private_key: ${{ secrets.DEPLOYMENT_APP_PRIVATE_KEY }}
repository: OpenTTD/workflows
- name: Trigger 'Publish Docs'
uses: peter-evans/repository-dispatch@v2
with:
token: ${{ steps.generate_token.outputs.token }}
repository: OpenTTD/workflows
event-type: publish-docs
client-payload: '{"version": "${{ inputs.version }}", "folder": "${{ inputs.folder }}"}'

View File

@@ -14,35 +14,8 @@ jobs:
runs-on: ubuntu-20.04
steps:
- name: Download source
- name: Download all bundles
uses: actions/download-artifact@v3
with:
name: internal-source
path: internal-source
- name: Download bundle (Windows x86)
uses: actions/download-artifact@v3
with:
name: openttd-windows-x86
path: openttd-windows-x86
- name: Download bundle (Windows x64)
uses: actions/download-artifact@v3
with:
name: openttd-windows-x64
path: openttd-windows-x64
- name: Download bundle (MacOS)
uses: actions/download-artifact@v3
with:
name: openttd-macos-universal
path: openttd-macos-universal
- name: Download bundle (Linux)
uses: actions/download-artifact@v3
with:
name: openttd-linux-generic
path: openttd-linux-generic
- name: Install GOG Galaxy Build Creator
run: |

View File

@@ -17,35 +17,8 @@ jobs:
runs-on: ubuntu-20.04
steps:
- name: Download source
- name: Download all bundles
uses: actions/download-artifact@v3
with:
name: internal-source
path: internal-source
- name: Download bundle (Windows x86)
uses: actions/download-artifact@v3
with:
name: openttd-windows-x86
path: openttd-windows-x86
- name: Download bundle (Windows x64)
uses: actions/download-artifact@v3
with:
name: openttd-windows-x64
path: openttd-windows-x64
- name: Download bundle (MacOS)
uses: actions/download-artifact@v3
with:
name: openttd-macos-universal
path: openttd-macos-universal
- name: Download bundle (Linux)
uses: actions/download-artifact@v3
with:
name: openttd-linux-generic
path: openttd-linux-generic
- name: Setup steamcmd
uses: CyberAndrii/setup-steamcmd@v1

View File

@@ -1,24 +0,0 @@
name: WindowDesc ini_key
on:
pull_request:
branches:
- master
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: ${{ github.ref != 'refs/heads/master' }}
jobs:
windowdesc-ini-key:
name: WindowDesc ini_key issues
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Check for ini_key issues in WindowDesc entries
shell: bash
run: |
python3 .github/windowdesc-ini-key.py

View File

@@ -1,12 +1,11 @@
cmake_minimum_required(VERSION 3.16)
cmake_minimum_required(VERSION 3.9)
if(NOT BINARY_NAME)
set(BINARY_NAME openttd)
endif()
project(${BINARY_NAME}
VERSION 14.0
LANGUAGES CXX
VERSION 13.1
)
if(CMAKE_SOURCE_DIR STREQUAL CMAKE_BINARY_DIR)
@@ -23,7 +22,7 @@ if (EMSCRIPTEN)
endif()
set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${CMAKE_SOURCE_DIR}/cmake")
set(CMAKE_OSX_DEPLOYMENT_TARGET 10.15)
set(CMAKE_OSX_DEPLOYMENT_TARGET 10.13)
# Use GNUInstallDirs to allow customisation
# but set our own default data and bin dir
@@ -119,27 +118,12 @@ endif()
set(CMAKE_THREAD_PREFER_PTHREAD YES)
# Make sure we have Threads available.
find_package(Threads REQUIRED)
# nlohmann is used for all our JSON needs.
find_package(nlohmann_json REQUIRED)
find_package(ZLIB)
find_package(LibLZMA)
find_package(LZO)
find_package(PNG)
if(WIN32 OR EMSCRIPTEN)
# Windows uses WinHttp for HTTP requests.
# Emscripten uses Javascript for HTTP requests.
else()
# All other targets use libcurl.
find_package(CURL)
endif()
# Breakpad doesn't support emscripten.
if(NOT EMSCRIPTEN)
find_package(unofficial-breakpad)
endif()
if(NOT OPTION_DEDICATED)
if(NOT WIN32)
find_package(Allegro)
@@ -150,17 +134,12 @@ if(NOT OPTION_DEDICATED)
find_package(SDL)
endif()
find_package(Fluidsynth)
if(Freetype_FOUND)
find_package(Fontconfig)
endif()
find_package(Harfbuzz)
find_package(ICU OPTIONAL_COMPONENTS i18n)
find_package(Fontconfig)
find_package(ICU OPTIONAL_COMPONENTS i18n lx)
endif()
endif()
endif()
if(APPLE)
enable_language(OBJCXX)
find_package(Iconv)
find_library(AUDIOTOOLBOX_LIBRARY AudioToolbox)
@@ -191,12 +170,6 @@ if(UNIX AND NOT APPLE AND NOT OPTION_DEDICATED)
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")
endif()
if(NOT HARFBUZZ_FOUND)
message(WARNING "Without HarfBuzz and ICU i18n the game will not be able to render right-to-left languages correctly")
endif()
endif()
if(APPLE)
if(NOT AUDIOTOOLBOX_LIBRARY)
@@ -234,7 +207,6 @@ if(OPTION_PACKAGE_DEPENDENCIES)
set(CMAKE_BUILD_WITH_INSTALL_RPATH ON)
endif()
include(CTest)
include(SourceList)
# Needed by rev.cpp
@@ -244,31 +216,15 @@ include_directories(${CMAKE_SOURCE_DIR}/src/3rdparty/squirrel/include)
include(MSVCFilters)
add_library(openttd_lib OBJECT ${GENERATED_SOURCE_FILES})
add_executable(openttd WIN32)
add_executable(openttd_test)
add_executable(openttd WIN32 ${GENERATED_SOURCE_FILES})
set_target_properties(openttd PROPERTIES OUTPUT_NAME "${BINARY_NAME}")
# All other files are added via target_sources()
if(MSVC)
# Add DPI manifest to project; other WIN32 targets get this via ottdres.rc
target_sources(openttd PRIVATE "${CMAKE_SOURCE_DIR}/os/windows/openttd.manifest")
# If target -static is used, switch our project to static (/MT) too.
# If the target ends on -static-md, it will remain dynamic (/MD).
if(VCPKG_TARGET_TRIPLET MATCHES "-static" AND NOT VCPKG_TARGET_TRIPLET MATCHES "-md")
set_property(TARGET openttd_lib PROPERTY MSVC_RUNTIME_LIBRARY "MultiThreaded$<$<CONFIG:Debug>:Debug>")
set_property(TARGET openttd PROPERTY MSVC_RUNTIME_LIBRARY "MultiThreaded$<$<CONFIG:Debug>:Debug>")
set_property(TARGET openttd_test PROPERTY MSVC_RUNTIME_LIBRARY "MultiThreaded$<$<CONFIG:Debug>:Debug>")
endif()
endif()
target_precompile_headers(openttd_lib
PRIVATE
src/stdafx.h
src/core/format.hpp
)
add_subdirectory(${CMAKE_SOURCE_DIR}/bin)
add_subdirectory(${CMAKE_SOURCE_DIR}/src)
add_subdirectory(${CMAKE_SOURCE_DIR}/media)
@@ -276,25 +232,17 @@ add_subdirectory(${CMAKE_SOURCE_DIR}/media)
add_dependencies(openttd
find_version)
target_link_libraries(openttd_lib
target_link_libraries(openttd
openttd::languages
openttd::settings
openttd::media
openttd::basesets
openttd::script_api
Threads::Threads
)
target_link_libraries(openttd
openttd_lib
openttd::media
openttd::basesets
)
target_link_libraries(openttd_test PRIVATE openttd_lib)
include(Catch)
catch_discover_tests(openttd_test)
if(HAIKU)
target_link_libraries(openttd_lib "be" "network" "midi")
target_link_libraries(openttd "be" "network" "midi")
endif()
if(IPO_FOUND)
@@ -310,15 +258,6 @@ link_package(PNG TARGET PNG::PNG ENCOURAGED)
link_package(ZLIB TARGET ZLIB::ZLIB ENCOURAGED)
link_package(LIBLZMA TARGET LibLZMA::LibLZMA ENCOURAGED)
link_package(LZO)
link_package(nlohmann_json)
if(NOT WIN32 AND NOT EMSCRIPTEN)
link_package(CURL ENCOURAGED)
endif()
if(NOT EMSCRIPTEN)
link_package(unofficial-breakpad TARGET unofficial::breakpad::libbreakpad_client ENCOURAGED)
endif()
if(NOT OPTION_DEDICATED)
link_package(Fluidsynth)
@@ -327,7 +266,7 @@ if(NOT OPTION_DEDICATED)
link_package(Allegro)
link_package(FREETYPE TARGET Freetype::Freetype)
link_package(Fontconfig TARGET Fontconfig::Fontconfig)
link_package(Harfbuzz TARGET harfbuzz::harfbuzz)
link_package(ICU_lx)
link_package(ICU_i18n)
if(SDL2_FOUND AND OPENGL_FOUND AND UNIX)
@@ -346,7 +285,7 @@ include(CheckAtomic)
if(APPLE)
link_package(Iconv TARGET Iconv::Iconv)
target_link_libraries(openttd_lib
target_link_libraries(openttd
${AUDIOTOOLBOX_LIBRARY}
${AUDIOUNIT_LIBRARY}
${COCOA_LIBRARY}
@@ -365,7 +304,6 @@ if(EMSCRIPTEN)
target_link_libraries(WASM::WASM INTERFACE "-s ALLOW_MEMORY_GROWTH=1")
target_link_libraries(WASM::WASM INTERFACE "-s INITIAL_MEMORY=33554432")
target_link_libraries(WASM::WASM INTERFACE "-s DISABLE_EXCEPTION_CATCHING=0")
target_link_libraries(WASM::WASM INTERFACE "-s WASM_BIGINT")
add_definitions(-s DISABLE_EXCEPTION_CATCHING=0)
# Export functions to Javascript.
@@ -426,13 +364,12 @@ if(WIN32)
-DPSAPI_VERSION=1
)
target_link_libraries(openttd_lib
target_link_libraries(openttd
ws2_32
winmm
imm32
usp10
psapi
winhttp
)
endif()

View File

@@ -1,488 +0,0 @@
**Why a set coding style is important** <br>
This project is an open source project. To get open source working as intended, many people should be able to comprehend the code. This implies that there is a well documented and uniform flow of code.
That does not necessarily mean that a contributor should not write optimised yet cryptic code - one should always care about performance. However, other developers need to understand the code which means complicated parts of code **must** have good documentation.
**Why we require that EVERYTHING is documented**<br>
What is simple to some might appear very complicated to others. Documentation helps these others. Anyone should be able to improve the code. But the main reason is, that when patch contributors want their patches added to the common codebase, the code needs to be reviewed by one or more developers. Documentation makes reviewing much easier.
## Coding style for OpenTTD
### Functions
* 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).
```c++
void ThisIsAFunction()
{
}
```
### Variables
* Variable names are all lowercase, and use "_" as separator.
* Global variables are preceded by an underscore. ("_") Use descriptive names because leading underscores are often used for system / compiler variables.
* Own members of classes should always be referenced using "this->"
* Pointers and references should have their reference symbol next to the name (compatibility with current code).
* Variables that are declared below one another should have their type, name or reference operator, and assignment operator aligned by spaces.
* There are set names for many variables. Those are (but not limited to): Vehicle *u, *v, *w; Station *st; Town *t; Window *w; Engine *e.
* For multiple instances, use numbers "*t1, *t2" or postfixes "*st_from, *st_to".
* Declare variables upon first usage.
* Declare iterators in their loop.
* There is a space between '*' and 'const' in "const pointers"
```c++
int number = 10;
Vehicle *u_first_wagon = v->next;
int value = v->value;
uint32 _global_variable = 3750;
static const char * const _global_array[] = {
"first string",
"second string",
"another string",
"last string followed by comma",
};
protected:
char protected_array[10];
for (int i = 0;;);
```
* Give the variables expedient names, this increases the readability of the code
```c++
bool is_maglev_train = true;
if (!is_maglev_train) DoSomething();
```
* Some people like to introduce copies of variables to increase readability, which can waste memory. However, in some cases, especially in code pieces which are often called, it makes sense to cache some calculated variables.
```c++
/* Unoptimized code:
* foo is not touched inside the loop!
*/
for (uint8 i = 0; i < 100000; i++) {
/* Do something */
if (value_to_check == (foo * 4) % 5 + 6) DoSomething();
/* Do something else */
}
/* Better:
* The used value of foo is calculated outside the loop.
*/
const uint32 bar = (foo * 4) % 5 + 6;
for (uint8 i = 0; i < 100000; i++) {
/* Do something */
if (value_to_check == bar) DoSomething();
/* Do something else */
}
```
### Enumerations / static consts
* Enumerations store integers that belong logically together (railtypes, string IDs, etc.).
* Enumeration names also use CamelCase.
* Unscoped enumerators are all caps with "_" between the words.
* Scoped enumerators are use CamelCase.
* Enums are not used to store single numbers.
* Enums have consecutive numbers OR
* Enums have consecutive powers of two. Powers of two (bits) are written in hex or with the shift operator.
* Enums may have special enumerators: "_BEGIN", "\_END", and "INVALID\_"). See example.
* The invalid always has 0xFF, 0xFFFF, 0xFFFFFFFF as a value.
* Other special values are consecutively less than the invalid.
* Variables that hold enumerators should have the type of the enumeration.
```c++
enum DiagDirection {
DIAGDIR_BEGIN = 0,
DIAGDIR_NE = 0,
DIAGDIR_SE = 1,
DIAGDIR_SW = 2,
DIAGDIR_NW = 3,
DIAGDIR_END,
INVALID_DIAGDIR = 0xFF,
BROKEN_DIAGDIR = 0xFE,
};
enum {
DEPOT_SERVICE = (1 << 0),
DEPOT_MASS_SEND = (1 << 1),
DEPOT_DONT_CANCEL = (1 << 2),
DEPOT_LOCATE_HANGAR = (1 << 3),
};
DiagDirection enterdir = DIAGDIR_NE;
```
* Numbers that store single or uncorrelated data are static consts. Those may use the naming conventions of enums.
Example:
```c++
static const int MAXIMUM_STATIONS = 42;
```
* Enums are useful in GUI code: When widgets are enumerated, they are easier to access during many operations. Additionally changes caused by modified widget sequences require less code adapting. If a widget is used like this, its enum name should be present in a comment behind the corresponding widget definition.
```c++
/** Enum referring to the widgets of the build rail depot window */
enum BuildRailDepotWidgets {
BRDW_CLOSEBOX = 0,
BRDW_CAPTION,
BRDW_BACKGROUND,
BRDW_DEPOT_NE,
BRDW_DEPOT_SE,
BRDW_DEPOT_SW,
BRDW_DEPOT_NW,
};
/* ... */
/** Widget definition of the build rail depot window */
static const Widget _build_depot_widgets[] = {
{ WWT_CLOSEBOX, RESIZE_NONE, 7, 0, 10, 0, 13, STR_00C5, STR_..}, // BRDW_CLOSEBOX
{ WWT_CAPTION, RESIZE_NONE, 7, 11, 139, 0, 13, STR_..., STR_...}, // BRDW_CAPTION
{ WWT_PANEL, RESIZE_NONE, 7, 0, 139, 14, 121, 0x0, STR_NULL}, // BRDW_BACKGROUND
{ WWT_PANEL, RESIZE_NONE, 14, 71, 136, 17, 66, 0x0, STR_..}, // BRDW_DEPOT_NE
{ WWT_PANEL, RESIZE_NONE, 14, 71, 136, 69, 118, 0x0, STR_..}, // BRDW_DEPOT_SE
{ WWT_PANEL, RESIZE_NONE, 14, 3, 68, 69, 118, 0x0, STR_..}, // BRDW_DEPOT_SW
{ WWT_PANEL, RESIZE_NONE, 14, 3, 68, 17, 66, 0x0, STR_..}, // BRDW_DEPOT_NW
{ WIDGETS_END},
};
```
* Comments on the enum values should start with "///<" to enable doxygen documentation
```c++
enum SomeEnumeration {
SE_BEGIN = 0, ///< Begin of the enumeration, used for iterations
SE_FOO = 0, ///< Used for xy
SE_BAR, ///< Another value of the enumeration
SE_SUB, ///< Special case for z
SE_END, ///< End of the enumeration, used for iterations
};
```
### Control flow
* Put a space before the parentheses in **if**, **switch**, **for** and **while** statements.
* 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.
* 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 (;;) {`**
```c++
if (a == b) {
Foo();
} else {
Bar();
}
if (very_large_checks &&
spread_over_two_lines) {
Foo();
}
if (a == b) Foo();
switch (a) {
case 0: DoSomethingShort(); break;
case 1:
DoSomething();
FALLTHROUGH;
case 2:
DoMore();
b = a;
break;
case 3: {
int r = 2;
DoEvenMore(a);
FALLTHROUGH;
}
case 4: {
int q = 345;
DoIt();
break;
}
default:
NOT_REACHED();
}
for (int i = 0; i < 10; i++) {
Foo();
Bar();
}
```
### Classes
* Classes names also use CamelCase.
* Classes should have "public", "protected", and "private" sections.
* Within these section the order is: types, static const members, static members, members, constructors / destructors, static methods, methods.
* Deviations from above order are allowed when the code dictates it (e.g. a static const is needed for a typedef)
* Methods and members ought to be grouped logically.
* All those sorting rules sometimes conflict which one another. Please use common sense what increases legibility of the code in such a case.
* The method implementation should indicate if it is virtual or similar by using a comment.
* Very short methods can have one-line definition (if defined in the class scope).
```c++
class ThisIsAClass {
public:
typedef Titem_ *ItemPtr;
private:
static const int MAX_SIZE = 500;
int size;
ItemPtr *items;
public:
explicit ThisIsAClass();
~ThisIsAClass();
int GetSize() { return this->size; }
virtual void Method();
};
/*virtual*/ void Class::Method()
{
this->size *= 2;
}
```
### Templates
Templates are a very powerful C++ tool, but they can easily confuse beginners. Thus:
* 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, 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.
### 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.
* No trailing whitespace. The Github workflows will not allow tabs or space on the end of lines.
* Only use tabs to indent from the start of the line.
* Line length is unlimited. In practice it may be useful to split a long line. When splitting, add two tabs in front of the second part.
* The '#' of preprocessor instructions goes into the first column of a line. Indenting is done after the '#' (using tabs again).
* Use /* */ for single line comments.
* Use // at the end of a command line to indicate comments.
** However, use /* */ after # preprocessor statements as // causes warnings in some compilers and/or might have unwanted side effects.
* C++ is defined using the ASCII character set. Do not use other character sets, not even in comments.
* OpenTTD includes some Objective-C sources (*.mm, used by OSX), which has a special object method invocation syntax: "[ obj doStuff:foo ]". Please use spaces on the inside of the brackets to differentiate from the C array syntax.
## Documentation
We use [Doxygen](http://doxygen.org/) to automatically generate documentation from the source code. It scans the source files for *recognizable* comments.
* **Make your comments recognizable.**
Doxygen only comments starting with the following style:
```c++
/**
///<
```
Use /** for multi-line comment blocks. Use ///< for single line comments for variables. Use //!< for single-line comments in the NoAI .hpp files.
For comments blocks inside a function always use /* */ or //. Use // only if the comment is on the same line as an instruction, otherwise use /* */.
### Files
* Put a @file command in a JavaDoc style comment at the start of the file, followed by a description.
```c++
/**
* @file
* This is the brief description.
* This is the detailed description here and on the following lines.
*/
```
> ### Warning
> If a file lacks a **file comment block** then NO entities in that file will be documented by Doxygen!
### Functions
* The documentation should be as close to the actual code as possible to maximise the chance of staying in sync.
* Comments for functions go in the .cpp file.
* Comments for inlines go in the .h/.hpp file.
* Small inlines can have a short 3 or 4 line JavaDoc style comment.
* Completely document larger functions.
* Document obvious parameters and return values too!
```c++
/**
* A brief explanation of what the function does and/or what purpose it serves.
* Then follows a more detailed explanation of the function that can span multiple lines.
*
* @param foo Explanation of the foo parameter
* @param bar Explanation of the bar parameter
* @return The sum of foo and bar (@return can be omitted if the return type is void)
*
* @see SomeOtherFunc()
* @see SOME_ENUM
*
* @bug Some bug description
* @bug Another bug description which continues in the next line
* and ends with the following blank line
*
* @todo Some to-do entry
*/
static int FooBar(int foo, int bar)
{
return foo + bar;
}
```
### Classes
* Document structs similarly to functions:
```c++
/**
* A short description of the struct.
* More detailed description of the its usage.
*
* @see [link to anything of interest]
*/
struct foo {
}
```
### JavaDoc structural commands
This table shows the commands you should use with OpenTTD. The full list is [here](http://www.stack.nl/~dimitri/doxygen/commands.html).
| Command | Action | Example |
| ------- | -------- | ------- |
| **@attention** | Starts a paragraph where a message that needs attention may be entered. The paragraph will be indented. | @attention Whales crossing! |
| **@brief** | Starts a paragraph that serves as a brief description. For classes and files the brief description will be used in lists and at the start of the documentation page. For class and file members, the brief description will be placed at the declaration of the member and prepended to the detailed description. A brief description may span several lines (although it is advised to keep it brief!). | @brief This is the brief description. |
| **@bug** | Starts a paragraph where one or more bugs may be reported. The paragraph will be indented. Multiple adjacent @bug commands will be joined into a single paragraph. Each bug description will start on a new line. Alternatively, one @bug command may mention several bugs. | @bug Memory leak in here? |
| **@note** | Starts a paragraph where a note can be entered. The paragraph will be indented. | @note Might be slow |
| **@todo** | Starts a paragraph where a TODO item is described. The description will also add an item to a separate TODO list. The two instances of the description will be cross-referenced. Each item in the TODO list will be preceded by a header that indicates the origin of the item. | @todo Better error checking |
| **@warning** | Starts a paragraph where one or more warning messages may be entered. The paragraph will be indented. | @warning Not thread safe! |
| | <small>**Function related commands**</small> | |
| **@return** | Starts a return value description for a function. | @return a character pointer |
| **@param** | Starts a parameter description for a function parameter with name <parameter-name>. Followed by a description of the parameter. The existence of the parameter is checked and a warning is given if the documentation of this (or any other) parameter is missing or not present in the function declaration or definition.<br><br>The @param command has an optional attribute specifying the direction of the attribute. Possible values are "in" and "out". | @param n The number of bytes to copy<br>@param[out] dest The memory area to copy to.<br>@param[in] src The memory area to copy from. |
| **@see** | Starts a paragraph where one or more cross-references to classes, functions, methods, variables, files or URL may be specified. Two names joined by either :: or # are understood as referring to a class and one of its members. One of several overloaded methods or constructors may be selected by including a parenthesized list of argument types after the method name. [Here](http://www.stack.nl/~dimitri/doxygen/autolink.html) you can find detailed information about this feature. | @see OtherFunc() |
| **@b** | Displays the following word using a bold font. Equivalent to &lt;b&gt;word&lt;/b&gt;. To put multiple words in bold use &lt;b&gt;multiple words&lt;/b&gt;.| ...@b this and @b that... |
| **@c / @p** | Displays the parameter <word> using a typewriter font. You can use this command to refer to member function parameters in the running text. To have multiple words in typewriter font use &lt;tt&gt;multiple words&lt;/tt&gt;. | ... the @p x and @p y coordinates are used to... |
| **@arg / @li** | This command has one argument that continues until the first blank line or until another @arg / @li is encountered. The command can be used to generate a simple, not nested list of arguments. Each argument should start with an @arg / @li command. | @arg @c AlignLeft left alignment.<br>@arg @c AlignCenter center alignment.<br>@arg @c AlignRight right alignment |
| **@n** | Forces a new line. Equivalent to and inspired by the printf function. |@n |
### More on Doxygen and JavaDoc
Doxygen knows two different kinds of comments:
* *Brief descriptions*: one-liners that describe the function roughly ([example](http://docs.openttd.org/annotated.html))
* *Detailed descriptions*: as the name suggests, these contain the detailed function/purpose of the entity they describe ([example](http://docs.openttd.org/structBridge.html))
You can omit either one or put them into different places but there's only one brief and one detailed description allowed for the same entity.
Doxygen knows three modes for documenting an entity:
* Before the entity
* After the entity
* In a different file
The latter is a little harder to maintain since the prototype of the entity it describes then is stored in several places (e.g. the .h file and the file with the descriptions). Also while it makes the code easier to read it also makes it easier to omit the important step of updating the description of an entity if it was changed - and we all know why that shouldn't happen ;)<br>
Because of those reasons, we will only use the first two documentation schemes.
Doxygen supports both Qt and JavaDoc comment styles:
* Qt style example: **int i; //!< The counter for the main loop**
* JavaDoc style example: **int i; /*\*< The counter for the main loop \*/**
It also supports more comment styles but those two are the ones which are standardized. For OTTD we'll be using the JavaDoc style. One of the reasons is that it has a feature that the Qt style doesn't offer: JavaDoc style comment blocks will automatically start a brief description which ends at the first dot followed by a space or new line. Everything after that will also be part of the detailed description.
The general structure of a JavaDoc style comment is
```c++
/**
* This is the brief description. And this sentence contains some further explanations that will appear in the detailed description only.
*/
```
and the resulting descriptions of that block would be:
* *Brief description*: This is the brief description.
* *Detailed description*: This is the brief description. And this sentence contains some further explanations that will appear in the detailed description only.
The distinction between the brief and detailed descriptions is made by the dot followed by a space/newline, so if you want to use that inside the brief description you need to escape the space/newline:
```c++
/**
* This is a brief description (e.g.\ using only a few words). Details go here.
*/
```
If you're doing a one-line comment, use:
```c++
int i; ///< This is the description.
```
Also in the comment block you can include so-called structural commands which tell Doxygen what follows. In general, their area of effect begins after the command word and ends when a blank line or some other command is encountered. Also, multiple occurrences of the same structural command within a comment block or the referring entity will be joined in the documentation output usually.
## Commit message
To achieve a coherent whole and to make changelog writing easier, here are some guidelines for commit messages.
There is a check-script on the git server (also available for clients, see below) to make sure we all follow those rules.
The first line of a message must match:
```
<keyword>( #<issue>| <commit>(, (<keyword> #<issue>|<commit>))*)?: ([<section])? <Details>
```
Keywords are:
* Add, Feature: Adding new stuff. Difference between "Feature" and "Add" is somewhat subjective. "Feature" for user-point-of-view stuff, "Add" for other.
* Change: Changing behaviour from user-point-of-view.
* Remove: Removing something from user-point-of-view.
* Codechange, Cleanup: Changes without intentional change of behaviour from user-point-of-view. Difference between "Codechange" and "Cleanup" is somewhat subjective.
* Fix, Revert: Fixing stuff.
* Doc, Update: Documentation changes, version increments, translator commits.
* Prepare: Preparation for bigger changes. Rarely used.
If you commit a fix for an [issue](https://github.com/OpenTTD/OpenTTD/issues), add the corresponding issue number in the form of #NNNN. Do it as well if you implement a feature with a matching entry.
In the case of bugfixes, if you know what revision the bug was introduced (eg regression), please mention that revision as well just after the prefix. Finding the trouble-causing revision is highly encouraged as it makes backporting/branching/releases that much easier.
To further structure the changelog, you can add sections. Example are:
* "Network" for network specific changes
* "NewGRF" for NewGRF additions
* "YAPP", "NPF", for changes in these features
* "OSX", "Debian", "win32", for OS-specific packaging changes
Further explanations, general bitching, etc. don't go into the first line. Use a new line for those.
Complete examples:
* Fix: [YAPF] Infinite loop in pathfinder.
* Fix #5926: [YAPF] Infinite loop in pathfinder.
* Fix 80dffae130: Warning about unsigned unary minus.
* Fix #6673, 99bb3a95b4: Store the map variety setting in the samegame.
* Revert d9065fbfbe, Fix #5922: ClientSizeChanged is only called via WndProcGdi which already has the mutex.
* Fix #1264, Fix #2037, Fix #2038, Fix #2110: Rewrite the autoreplace kernel.
## Other tips
### Remove trailing whitespace
To find out if/where you have trailing whitespace, you can use the following (unix/bash) command:
```
grep -n -R --include "*.[ch]" '[ ]$' * | grep --invert-match ".diff" | grep --invert-match ".patch"
```
Automatically removing whitespace is also possible with the following shell script (Note that it only checks .c, .cpp, .h, .hpp and .mm files):
```
#!/bin/sh
IFS='
'
for i in Makefile `find . -name \*.c -o -name \*.cpp -o -name \*.h -o -name \*.hpp -o -name \*.mm`
do
(
echo '%s/[ ]\{1,\}$/'
echo w
echo q
) | ed $i 2> /dev/null > /dev/null
done
```
### Install the client-side git commit hooks
The client-side hooks perform various checks when you commit changes locally.
* Whitespace and indentation checks.
* **Coding style** checks.
Get the hooks:
```
git clone https://github.com/OpenTTD/OpenTTD-git-hooks.git openttd_hooks
```
Install the hooks, assuming "openttd" is your work tree folder:
```
cd openttd/.git/hooks
ln -s -t . ../../../openttd_hooks/hooks/*
```

View File

@@ -4,26 +4,20 @@
OpenTTD makes use of the following external libraries:
- (required) nlohmann-json: JSON handling
- (encouraged) breakpad: creates minidumps on crash
- (encouraged) zlib: (de)compressing of old (0.3.0-1.0.5) savegames, content downloads,
heightmaps
- (encouraged) liblzma: (de)compressing of savegames (1.1.0 and later)
- (encouraged) libpng: making screenshots and loading heightmaps
- (optional) liblzo2: (de)compressing of old (pre 0.3.0) savegames
For Linux, the following additional libraries are used:
For Linux, the following additional libraries are used (for non-dedicated only):
- (encouraged) libcurl: content downloads
- libSDL2: hardware access (video, sound, mouse)
- libfreetype: loading generic fonts and rendering them
- libfontconfig: searching for fonts, resolving font names to actual fonts
- harfbuzz: handling of right-to-left scripts (e.g. Arabic and Persian) (required libicu)
- libicu: handling of right-to-left scripts (e.g. Arabic and Persian) and
natural sorting of strings
If you are building a dedicated-server only, you don't need the last four.
OpenTTD does not require any of the libraries to be present, but without
liblzma you cannot open most recent savegames and without zlib you cannot
open most older savegames or use the content downloading system.
@@ -51,18 +45,16 @@ by following the `Quick Start` instructions of their
After this, you can install the dependencies OpenTTD needs. We advise to use
the `static` versions, and OpenTTD currently needs the following dependencies:
- breakpad
- liblzma
- libpng
- lzo
- nlohmann-json
- zlib
To install both the x64 (64bit) and x86 (32bit) variants (though only one is necessary), you can use:
```ps
.\vcpkg install breakpad:x64-windows-static liblzma:x64-windows-static libpng:x64-windows-static lzo:x64-windows-static nlohmann-json:x64-windows-static zlib:x64-windows-static
.\vcpkg install breakpad:x86-windows-static liblzma:x86-windows-static libpng:x86-windows-static lzo:x86-windows-static nlohmann-json:x86-windows-static zlib:x86-windows-static
.\vcpkg install liblzma:x64-windows-static libpng:x64-windows-static lzo:x64-windows-static zlib:x64-windows-static
.\vcpkg install liblzma:x86-windows-static libpng:x86-windows-static lzo:x86-windows-static zlib:x86-windows-static
```
You can open the folder (as a CMake project). CMake will be detected, and you can compile from there.
@@ -105,7 +97,7 @@ Via CMake, several options can be influenced to get different types of
builds.
- `-DCMAKE_BUILD_TYPE=RelWithDebInfo`: build a release build. This is
significantly faster than a debug build, but has far less useful information
significant faster than a debug build, but has far less useful information
in case of a crash.
- `-DOPTION_DEDICATED=ON`: build OpenTTD without a GUI. Useful if you are
running a headless server, as it requires less libraries to operate.

View File

@@ -14,7 +14,7 @@ In return, they should reciprocate that respect in addressing your issue or asse
The [issue tracker](https://github.com/OpenTTD/OpenTTD/issues) is the preferred channel for [bug reports](#bug-reports), but please respect the following restrictions:
* Please **do not** use the issue tracker for help playing or using OpenTTD.
Please try [irc](https://wiki.openttd.org/en/Development/IRC%20channel), [Discord](https://discord.gg/openttd), or the [forums](https://www.tt-forums.net/)
Please try [irc](https://wiki.openttd.org/en/Development/IRC%20channel), or the [forums](https://www.tt-forums.net/)
* Please **do not** derail or troll issues. Keep the discussion on topic and respect the opinions of others.
@@ -23,7 +23,7 @@ Use [GitHub's "reactions" feature](https://github.com/blog/2119-add-reactions-to
We reserve the right to delete comments which violate this rule.
* Please **do not** open issues or pull requests regarding add-on content in NewGRF, GameScripts, AIs, etc.
These are created by third-parties. Please try [irc](https://wiki.openttd.org/en/Development/IRC%20channel), [Discord](https://discord.gg/openttd), or the [forums](https://www.tt-forums.net/) to discuss these.
These are created by third-parties. Please try [irc](https://wiki.openttd.org/en/Development/IRC%20channel) or the [forums](https://www.tt-forums.net/) to discuss these.
* Please use [the web translator](https://translator.openttd.org/) to submit corrections and improvements to translations of the game.
@@ -108,7 +108,7 @@ Pull requests should fit with the [goals of the project](./CONTRIBUTING.md#proje
Every pull request should have a clear scope, with no unrelated commits.
[Code style](./CODINGSTYLE.md) must be complied with for pull requests to be accepted; this also includes [commit message format](./CODINGSTYLE.md#commit-message).
[Code style](https://wiki.openttd.org/en/Development/Coding%20style) must be complied with for pull requests to be accepted; this also includes [commit message format](https://wiki.openttd.org/en/Development/Coding%20style#commit-message).
Adhering to the following process is the best way to get your work included in the project:
@@ -136,7 +136,7 @@ contain your feature, change, or fix:
git checkout upstream/master -b <topic-branch-name>
```
4. Commit your changes in logical chunks. Please adhere to these [git commit message guidelines](./CODINGSTYLE.md#commit-message) or your code is unlikely to be merged into the main project.
4. Commit your changes in logical chunks. Please adhere to these [git commit message guidelines](https://wiki.openttd.org/en/Development/Coding%20style#commit-message) or your code is unlikely to be merged into the main project.
Use Git's [interactive rebase](https://docs.github.com/en/get-started/using-git/about-git-rebase) feature to tidy up your commits before making them public.
5. Locally rebase the upstream development branch into your topic branch:
@@ -172,7 +172,7 @@ The results of the CI tests will show on your pull request.
By clicking on Details you can further zoom in; in case of a failure it will show you why it failed.
In case of success it will report how awesome you were.
Tip: [commit message format](./CODINGSTYLE.md#commit-message) is a common reason for pull requests to fail validation.
Tip: [commit message format](https://wiki.openttd.org/en/Development/Coding%20style#commit-message) is a common reason for pull requests to fail validation.
### Are there any development docs?

View File

@@ -292,8 +292,8 @@ PREDEFINED = WITH_ZLIB \
WITH_PNG \
WITH_FONTCONFIG \
WITH_FREETYPE \
WITH_HARFBUZZ \
WITH_ICU_I18N \
WITH_ICU_LX \
UNICODE \
_UNICODE \
_GNU_SOURCE \

View File

@@ -174,14 +174,12 @@ See `src/3rdparty/squirrel/COPYRIGHT` for the complete license text.
The md5 implementation in `src/3rdparty/md5` is licensed under the Zlib license.
See the comments in the source files in `src/3rdparty/md5` for the complete license text.
The implementations of Posix `getaddrinfo` and `getnameinfo` for OS/2 in `src/3rdparty/os2` are distributed partly under the GNU Lesser General Public License 2.1, and partly under the (3-clause) BSD license.
The exact licensing terms can be found in `src/3rdparty/os2/getaddrinfo.c` resp. `src/3rdparty/os2/getnameinfo.c`.
The fmt implementation in `src/3rdparty/fmt` is licensed under the MIT license.
See `src/3rdparty/fmt/LICENSE.rst` for the complete license text.
The catch2 implementation in `src/3rdparty/catch2` is licensed under the Boost Software License, Version 1.0.
See `src/3rdparty/catch2/LICENSE.txt` for the complete license text.
The icu scriptrun implementation in `src/3rdparty/icu` is licensed under the Unicode license.
See `src/3rdparty/icu/LICENSE` for the complete license text.
## 4.0 Credits

View File

@@ -14,7 +14,6 @@ set(AI_COMPAT_SOURCE_FILES
${CMAKE_CURRENT_SOURCE_DIR}/compat_1.11.nut
${CMAKE_CURRENT_SOURCE_DIR}/compat_12.nut
${CMAKE_CURRENT_SOURCE_DIR}/compat_13.nut
${CMAKE_CURRENT_SOURCE_DIR}/compat_14.nut
)
foreach(AI_COMPAT_SOURCE_FILE IN LISTS AI_COMPAT_SOURCE_FILES)

View File

@@ -4,5 +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/>.
*/
AILog.Info("13 API compatibility in effect.");

View File

@@ -1,6 +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/>.
*/

View File

@@ -11,7 +11,6 @@ set(GS_COMPAT_SOURCE_FILES
${CMAKE_CURRENT_SOURCE_DIR}/compat_1.11.nut
${CMAKE_CURRENT_SOURCE_DIR}/compat_12.nut
${CMAKE_CURRENT_SOURCE_DIR}/compat_13.nut
${CMAKE_CURRENT_SOURCE_DIR}/compat_14.nut
)
foreach(GS_COMPAT_SOURCE_FILE IN LISTS GS_COMPAT_SOURCE_FILES)

View File

@@ -4,5 +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/>.
*/
GSLog.Info("13 API compatibility in effect.");

View File

@@ -1,6 +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/>.
*/

View File

@@ -1,3 +1,145 @@
13.2 (2023-06-10)
------------------------------------------------------------------------
Change: [Win32] position window in center of workspace of primary display (#10942)
Change: Automatically disable hardware acceleration when GPU driver crashed the game last attempt (#10928)
Change: [Linux] Default scroll mode to non-mouse-lock (#10920)
Change: Include font style in font name for Freetype (#10879)
Fix: Don't restore backed up vehicle name if it's no longer unique (#10979)
Fix #10975: Train name wrongly marked as unique when joining trains (#10976)
Fix: Crash when not even a single row fits for dropdowns on low resolution screens (#10934)
Fix: Crash with tooltip on low resolution screens (#10933)
Fix: Crash when window can't be placed on low resolution screens (#10932)
Fix #10502: Apply engine refit before attaching free wagons (#10926)
Fix: Wayland crash on startup due to Pango also using FontConfig (#10916)
Fix: When syncing width of GUI items, take padding into account (#10915)
Fix: Make dropdowns self-close when losing focus (#10912)
Fix: Land info window maximum width was not scaled (#10894)
Fix: Check max member count in squirrel classes (#10883)
Fix: Ask FontConfig for the face index when opening fonts (#10878)
Fix #10831: Level crossing parts left barred after crossing tile removal (#10874)
Fix: Rail waypoint selection window not closed when parent windows closed (#10873)
Fix #10846: [Script] Crash on trying to allocate an excessively large array (#10848)
Fix: [Win32] Text line breaking did not properly handle punctuation characters (#10775)
Fix: [Emscripten] Crash when saving games (#10758)
Fix: [Win32] Wrong multi-line text layout due to incorrect whitespace handling (#10752)
Fix #10741: Rail platforms left partially reserved after train crash (#10751)
Fix: Shaded engines in purchase list incorrectly shaded (#10736)
Fix #10735: [NewGRF] {POP_COLOUR} fails if string is drawn with extra flags (#10736)
Fix #8177: Ships with max speed overflow to near-zero speed (#10695)
Fix #10289: Don't silently fail when setting timetable start dates (#10690)
Fix #8302: Improve "Maintenance intervals are in percents" helptext (#10686)
Fix #10665: "No vehicles are available yet" message did not appear correctly on non-temperate climates (#10673)
Fix #10630: Don't allow shifting service date earlier than year 0 (#10643)
Fix #10637, #10638: Incorrect water infrastructure totals when building certain object types (#10639, #10640)
Fix: Abort loading savegame if road vehicle is on invalid road type (#10622)
13.1 (2023-04-10)
------------------------------------------------------------------------
Add: [NewGRF] Engine name callback for nested variants. (#10399)
Fix: Improve main toolbar tooltips (#10616)
Fix: [NewGRF] Additional validation for Action3 (+others) (#10601)
Fix: Clear button for editbox didn't take account of padding (#10583)
Fix: [Script] Access to enum/consts defined outside of main.nut (#10573)
Fix #10568: Bogus warning when loading a save with a NewGRFs on dedicated servers (#10572)
Fix #10554: Crash when scrolling in the autoreplace window with collapsed variants (#10555)
Fix: Network server highlight invisible with RTL languages. (#10551)
Fix: Client name was not being used as company manager name (#10535)
Fix: Prevent road vehicles on crossing from crashing into the side of a train (#10496)
Fix #10477: [macOS] Calculation for window sizes when using custom fonts was being rounded incorrectly (#10489)
Fix #10486: Crash in debug window when GS started before AIs (#10487)
Fix #10469: [Script] Negative numbers in League Table window were sorted incorrectly (#10471)
Fix #10465: Crash on timeout if user never enters a password for server (#10466)
Fix #10280, #10461: Crash on opening town windows as a spectator (#10462)
Fix #10059: Script config values stored in the config file could cause crashes (#10444)
13.0 (2023-02-05)
------------------------------------------------------------------------
Change #10077: Make maximum loan a positive multiple of the loan interval (#10355)
Fix #10361: [Script] Don't try to give saved data to a dead script (#10433)
Fix #10419: Water infrastructure accounting when building ship depots and docks (#10432)
13.0-RC2 (2023-01-28)
------------------------------------------------------------------------
Feature: Press Ctrl to build a diagonal area of trees (#10342)
Feature: Set a custom number of industries in map generation window (#10340)
Change: Display font status as aa/noaa instead of true/false (#10352)
Fix: [Script] Improved API documentation for scripts (#10413, #10412)
Fix #10255: Reduce basic thickness of linkgraph GUI lines (#10410)
Fix #10220: Don't select unselectable engine as default (#10404)
Fix #10395: When loading old saves, don't forcibly bar level crossings (#10400)
Fix #10377: Bad sorting of rail vehicles when primary variant is missing (#10378)
Fix #10368: Server restarting game caused clients to hit assertion (#10369)
Fix #10362: NewGRF bridges without speed limits (#10365)
Fix #10363: CargoDist setting helptext shouldn't suggest symmetric distribution for diamonds in subtropic (#10364)
Fix: [Script] Switch to OWNER_TOWN prevented OWNER_DEITY test during industry prospecting (#10360)
Fix #10009: Bad overflow protection when taking out loans (#10359)
Fix #9865: Removing files with the console always failed (#10357)
Fix #10057: FallbackParagraphLayout fails to properly wrap (#10356)
Fix #10177: Company list password padlock showed after switching to single player (#10354)
Fix: Various Wide River issues (#10348)
Fix: Link variants to parents when finalising engines (#10346)
Fix #10333: Only show industry prospecting errors to local company (#10338)
Fix #10335: Set initial scrollbar count for object GUI (#10336)
Fix #10331: Starting new company during load must happen after AI start (#10332)
Fix #10309: [SDL] Uninitialized width and height when turning off full screen (#10328)
Fix #10032: Capacities of articulated vehicles in build window (#10326)
Fix: Improve handling of corrupt NewGRF or image files (#10321, #10316)
Fix: [NewGRF] Don't assume engclass 2 should be elrail (#10315)
Fix: [Script] AIGroup.GetProfitLastYear could get values different than those displayed in GUI (#10227)
Fix #10304: [Scripts] Don't start GS in intro game (#10305)
Fix: [Script] Copy compat files for version 13 (#10303)
13.0-RC1 (2023-01-01)
------------------------------------------------------------------------
Feature: 'font' console command to configure fonts within game (#10278)
Feature: Ctrl-click to bulk edit timetable speeds/waiting times (#10265)
Feature: [NewGRF] Vehicle variants in expandable purchase list (#10220)
Feature: Expand all towns in the scenario editor (#10215)
Add: [NewGRF] Slope-aware and roadtype-specific one-way sprites (#10282)
Change: Display text files in black (#10291)
Change: Make vehicle list dropdown buttons resize to fit strings (#10286)
Change: [NewGRF] Support flipping shorter engines without explicit support (#10262)
Change: Separate ground sprite from foundation sprite offsets (#10256)
Change: Vertically centre sprite font relative to TrueType font (#10254)
Change: [macOS] Set minimum macOS version to 10.13 (#10253)
Change: Use lowered not disabled widget for current vehicle details tab (#10252)
Change: Various improvements to NewGRF sprite aligner (#10249)
Change: reset_engines console command now rerandomises introduction dates and reliability (#10220)
Change: Show error message on failed industry prospecting (#10202)
Fix: Local authority window rating list height ignored icon sizes (#10285)
Fix #10150: Town signs could be truncated when using custom fonts (#10283)
Fix #8971: Resize QueryStrings with interface scale change (#10281)
Fix #10274: Crash when rescanning scripts with GS selected (#10276)
Fix #10151: Use smaller padding for signs (#10272)
Fix #10263: [Script] Restore tile validation for commands (#10269)
Fix: Missing scrollbar for rail/roadtype dropdowns (#10264)
Fix #10260: Incorrect rect height drawing image in vehicle details (#10261)
Fix #10257: Incorrect catenary position on sloped bridge heads (#10258)
Fix: Vertically centre chat prompt (#10250)
Fix #10214: League and graph buttons in toolbar did not have a default action (#10246)
Fix #10242: Allow a space for text shadow when clipping text (#10243)
Fix #10206: Fully disable scripts in intro game (#10241)
Fix #10218: Don't try to create river tiles along incorrect slopes (#10235)
Fix #10208: [NewGRF] Allow using a specific underlay for road/tram tunnels (#10233)
Fix #10224: Don't change fast-forward mode while saving (#10230)
Fix #10147: Sound effect volume slider no longer set volume (#10228)
Fix #10223: Crash when vehicle cloning fails on order cloning (#10225)
Fix: Maximum space for engine preview image was never scaled (#10219)
Fix #10216: Crash when upgrading savegame with crashed vehicles (#10217)
Fix #10212: [Script] Nested ScriptAccounting scopes not restored properly (#10213)
Fix #10114: Incorrect drag-highlight position with non-power-of-2 scaling (#10211)
Fix #10198: Rearrange Intro GUI to make button rows narrower (#10203)
Fix: Missing extra padding when drawing tooltip text (#10201)
Fix: Bad alignment of button icons when using the original baseset (#10200)
Fix: Signal icons incorrectly positioned in UI (#10199)
Fix #10021: Object GUI resized when switching between different objects (#10196)
Fix #9720: Delay start of GS/AI to after loading of savegame (#9745)
13.0-beta2 (2022-11-27)
------------------------------------------------------------------------
Feature: Allow AI/GS to be fully modified in scenario editor (#10152)

View File

@@ -1,206 +0,0 @@
# Distributed under the OSI-approved BSD 3-Clause License. See accompanying
# file Copyright.txt or https://cmake.org/licensing for details.
#[=======================================================================[.rst:
Catch
-----
This module defines a function to help use the Catch test framework.
The :command:`catch_discover_tests` discovers tests by asking the compiled test
executable to enumerate its tests. This does not require CMake to be re-run
when tests change. However, it may not work in a cross-compiling environment,
and setting test properties is less convenient.
This command is intended to replace use of :command:`add_test` to register
tests, and will create a separate CTest test for each Catch test case. Note
that this is in some cases less efficient, as common set-up and tear-down logic
cannot be shared by multiple test cases executing in the same instance.
However, it provides more fine-grained pass/fail information to CTest, which is
usually considered as more beneficial. By default, the CTest test name is the
same as the Catch name; see also ``TEST_PREFIX`` and ``TEST_SUFFIX``.
.. command:: catch_discover_tests
Automatically add tests with CTest by querying the compiled test executable
for available tests::
catch_discover_tests(target
[TEST_SPEC arg1...]
[EXTRA_ARGS arg1...]
[WORKING_DIRECTORY dir]
[TEST_PREFIX prefix]
[TEST_SUFFIX suffix]
[PROPERTIES name1 value1...]
[TEST_LIST var]
[REPORTER reporter]
[OUTPUT_DIR dir]
[OUTPUT_PREFIX prefix}
[OUTPUT_SUFFIX suffix]
)
``catch_discover_tests`` sets up a post-build command on the test executable
that generates the list of tests by parsing the output from running the test
with the ``--list-test-names-only`` argument. This ensures that the full
list of tests is obtained. Since test discovery occurs at build time, it is
not necessary to re-run CMake when the list of tests changes.
However, it requires that :prop_tgt:`CROSSCOMPILING_EMULATOR` is properly set
in order to function in a cross-compiling environment.
Additionally, setting properties on tests is somewhat less convenient, since
the tests are not available at CMake time. Additional test properties may be
assigned to the set of tests as a whole using the ``PROPERTIES`` option. If
more fine-grained test control is needed, custom content may be provided
through an external CTest script using the :prop_dir:`TEST_INCLUDE_FILES`
directory property. The set of discovered tests is made accessible to such a
script via the ``<target>_TESTS`` variable.
The options are:
``target``
Specifies the Catch executable, which must be a known CMake executable
target. CMake will substitute the location of the built executable when
running the test.
``TEST_SPEC arg1...``
Specifies test cases, wildcarded test cases, tags and tag expressions to
pass to the Catch executable with the ``--list-test-names-only`` argument.
``EXTRA_ARGS arg1...``
Any extra arguments to pass on the command line to each test case.
``WORKING_DIRECTORY dir``
Specifies the directory in which to run the discovered test cases. If this
option is not provided, the current binary directory is used.
``TEST_PREFIX prefix``
Specifies a ``prefix`` to be prepended to the name of each discovered test
case. This can be useful when the same test executable is being used in
multiple calls to ``catch_discover_tests()`` but with different
``TEST_SPEC`` or ``EXTRA_ARGS``.
``TEST_SUFFIX suffix``
Similar to ``TEST_PREFIX`` except the ``suffix`` is appended to the name of
every discovered test case. Both ``TEST_PREFIX`` and ``TEST_SUFFIX`` may
be specified.
``PROPERTIES name1 value1...``
Specifies additional properties to be set on all tests discovered by this
invocation of ``catch_discover_tests``.
``TEST_LIST var``
Make the list of tests available in the variable ``var``, rather than the
default ``<target>_TESTS``. This can be useful when the same test
executable is being used in multiple calls to ``catch_discover_tests()``.
Note that this variable is only available in CTest.
``REPORTER reporter``
Use the specified reporter when running the test case. The reporter will
be passed to the Catch executable as ``--reporter reporter``.
``OUTPUT_DIR dir``
If specified, the parameter is passed along as
``--out dir/<test_name>`` to Catch executable. The actual file name is the
same as the test name. This should be used instead of
``EXTRA_ARGS --out foo`` to avoid race conditions writing the result output
when using parallel test execution.
``OUTPUT_PREFIX prefix``
May be used in conjunction with ``OUTPUT_DIR``.
If specified, ``prefix`` is added to each output file name, like so
``--out dir/prefix<test_name>``.
``OUTPUT_SUFFIX suffix``
May be used in conjunction with ``OUTPUT_DIR``.
If specified, ``suffix`` is added to each output file name, like so
``--out dir/<test_name>suffix``. This can be used to add a file extension to
the output e.g. ".xml".
#]=======================================================================]
#------------------------------------------------------------------------------
function(catch_discover_tests TARGET)
cmake_parse_arguments(
""
""
"TEST_PREFIX;TEST_SUFFIX;WORKING_DIRECTORY;TEST_LIST;REPORTER;OUTPUT_DIR;OUTPUT_PREFIX;OUTPUT_SUFFIX"
"TEST_SPEC;EXTRA_ARGS;PROPERTIES"
${ARGN}
)
if(NOT _WORKING_DIRECTORY)
set(_WORKING_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}")
endif()
if(NOT _TEST_LIST)
set(_TEST_LIST ${TARGET}_TESTS)
endif()
## Generate a unique name based on the extra arguments
string(SHA1 args_hash "${_TEST_SPEC} ${_EXTRA_ARGS} ${_REPORTER} ${_OUTPUT_DIR} ${_OUTPUT_PREFIX} ${_OUTPUT_SUFFIX}")
string(SUBSTRING ${args_hash} 0 7 args_hash)
# Define rule to generate test list for aforementioned test executable
set(ctest_include_file "${CMAKE_CURRENT_BINARY_DIR}/${TARGET}_include-${args_hash}.cmake")
set(ctest_tests_file "${CMAKE_CURRENT_BINARY_DIR}/${TARGET}_tests-${args_hash}.cmake")
get_property(crosscompiling_emulator
TARGET ${TARGET}
PROPERTY CROSSCOMPILING_EMULATOR
)
add_custom_command(
TARGET ${TARGET} POST_BUILD
BYPRODUCTS "${ctest_tests_file}"
COMMAND "${CMAKE_COMMAND}"
-D "TEST_TARGET=${TARGET}"
-D "TEST_EXECUTABLE=$<TARGET_FILE:${TARGET}>"
-D "TEST_EXECUTOR=${crosscompiling_emulator}"
-D "TEST_WORKING_DIR=${_WORKING_DIRECTORY}"
-D "TEST_SPEC=${_TEST_SPEC}"
-D "TEST_EXTRA_ARGS=${_EXTRA_ARGS}"
-D "TEST_PROPERTIES=${_PROPERTIES}"
-D "TEST_PREFIX=${_TEST_PREFIX}"
-D "TEST_SUFFIX=${_TEST_SUFFIX}"
-D "TEST_LIST=${_TEST_LIST}"
-D "TEST_REPORTER=${_REPORTER}"
-D "TEST_OUTPUT_DIR=${_OUTPUT_DIR}"
-D "TEST_OUTPUT_PREFIX=${_OUTPUT_PREFIX}"
-D "TEST_OUTPUT_SUFFIX=${_OUTPUT_SUFFIX}"
-D "CTEST_FILE=${ctest_tests_file}"
-P "${_CATCH_DISCOVER_TESTS_SCRIPT}"
VERBATIM
)
file(WRITE "${ctest_include_file}"
"if(EXISTS \"${ctest_tests_file}\")\n"
" include(\"${ctest_tests_file}\")\n"
"else()\n"
" add_test(${TARGET}_NOT_BUILT-${args_hash} ${TARGET}_NOT_BUILT-${args_hash})\n"
"endif()\n"
)
if(NOT ${CMAKE_VERSION} VERSION_LESS "3.10.0")
# Add discovered tests to directory TEST_INCLUDE_FILES
set_property(DIRECTORY
APPEND PROPERTY TEST_INCLUDE_FILES "${ctest_include_file}"
)
else()
# Add discovered tests as directory TEST_INCLUDE_FILE if possible
get_property(test_include_file_set DIRECTORY PROPERTY TEST_INCLUDE_FILE SET)
if (NOT ${test_include_file_set})
set_property(DIRECTORY
PROPERTY TEST_INCLUDE_FILE "${ctest_include_file}"
)
else()
message(FATAL_ERROR
"Cannot set more than one TEST_INCLUDE_FILE"
)
endif()
endif()
endfunction()
###############################################################################
set(_CATCH_DISCOVER_TESTS_SCRIPT
${CMAKE_CURRENT_LIST_DIR}/CatchAddTests.cmake
CACHE INTERNAL "Catch2 full path to CatchAddTests.cmake helper file"
)

View File

@@ -1,135 +0,0 @@
# Distributed under the OSI-approved BSD 3-Clause License. See accompanying
# file Copyright.txt or https://cmake.org/licensing for details.
set(prefix "${TEST_PREFIX}")
set(suffix "${TEST_SUFFIX}")
set(spec ${TEST_SPEC})
set(extra_args ${TEST_EXTRA_ARGS})
set(properties ${TEST_PROPERTIES})
set(reporter ${TEST_REPORTER})
set(output_dir ${TEST_OUTPUT_DIR})
set(output_prefix ${TEST_OUTPUT_PREFIX})
set(output_suffix ${TEST_OUTPUT_SUFFIX})
set(script)
set(suite)
set(tests)
function(add_command NAME)
set(_args "")
# use ARGV* instead of ARGN, because ARGN splits arrays into multiple arguments
math(EXPR _last_arg ${ARGC}-1)
foreach(_n RANGE 1 ${_last_arg})
set(_arg "${ARGV${_n}}")
if(_arg MATCHES "[^-./:a-zA-Z0-9_]")
set(_args "${_args} [==[${_arg}]==]") # form a bracket_argument
else()
set(_args "${_args} ${_arg}")
endif()
endforeach()
set(script "${script}${NAME}(${_args})\n" PARENT_SCOPE)
endfunction()
# Run test executable to get list of available tests
if(NOT EXISTS "${TEST_EXECUTABLE}")
message(FATAL_ERROR
"Specified test executable '${TEST_EXECUTABLE}' does not exist"
)
endif()
execute_process(
COMMAND ${TEST_EXECUTOR} "${TEST_EXECUTABLE}" ${spec} --list-test-names-only
OUTPUT_VARIABLE output
RESULT_VARIABLE result
WORKING_DIRECTORY "${TEST_WORKING_DIR}"
)
# Catch --list-test-names-only reports the number of tests, so 0 is... surprising
if(${result} EQUAL 0)
message(WARNING
"Test executable '${TEST_EXECUTABLE}' contains no tests!\n"
)
elseif(${result} LESS 0)
message(FATAL_ERROR
"Error running test executable '${TEST_EXECUTABLE}':\n"
" Result: ${result}\n"
" Output: ${output}\n"
)
endif()
string(REPLACE "\n" ";" output "${output}")
# Run test executable to get list of available reporters
execute_process(
COMMAND ${TEST_EXECUTOR} "${TEST_EXECUTABLE}" ${spec} --list-reporters
OUTPUT_VARIABLE reporters_output
RESULT_VARIABLE reporters_result
WORKING_DIRECTORY "${TEST_WORKING_DIR}"
)
if(${reporters_result} EQUAL 0)
message(WARNING
"Test executable '${TEST_EXECUTABLE}' contains no reporters!\n"
)
elseif(${reporters_result} LESS 0)
message(FATAL_ERROR
"Error running test executable '${TEST_EXECUTABLE}':\n"
" Result: ${reporters_result}\n"
" Output: ${reporters_output}\n"
)
endif()
string(FIND "${reporters_output}" "${reporter}" reporter_is_valid)
if(reporter AND ${reporter_is_valid} EQUAL -1)
message(FATAL_ERROR
"\"${reporter}\" is not a valid reporter!\n"
)
endif()
# Prepare reporter
if(reporter)
set(reporter_arg "--reporter ${reporter}")
endif()
# Prepare output dir
if(output_dir AND NOT IS_ABSOLUTE ${output_dir})
set(output_dir "${TEST_WORKING_DIR}/${output_dir}")
if(NOT EXISTS ${output_dir})
file(MAKE_DIRECTORY ${output_dir})
endif()
endif()
# Parse output
foreach(line ${output})
set(test ${line})
# Escape characters in test case names that would be parsed by Catch2
set(test_name ${test})
foreach(char , [ ])
string(REPLACE ${char} "\\${char}" test_name ${test_name})
endforeach(char)
# ...add output dir
if(output_dir)
string(REGEX REPLACE "[^A-Za-z0-9_]" "_" test_name_clean ${test_name})
set(output_dir_arg "--out ${output_dir}/${output_prefix}${test_name_clean}${output_suffix}")
endif()
# ...and add to script
add_command(add_test
"${prefix}${test}${suffix}"
${TEST_EXECUTOR}
"${TEST_EXECUTABLE}"
"${test_name}"
${extra_args}
"${reporter_arg}"
"${output_dir_arg}"
)
add_command(set_tests_properties
"${prefix}${test}${suffix}"
PROPERTIES
WORKING_DIRECTORY "${TEST_WORKING_DIR}"
${properties}
)
list(APPEND tests "${prefix}${test}${suffix}")
endforeach()
# Create a list of all discovered tests, which users may use to e.g. set
# properties on the tests
add_command(set ${TEST_LIST} ${tests})
# Write CTest script
file(WRITE "${CTEST_FILE}" "${script}")

View File

@@ -83,5 +83,5 @@ else()
endif()
if(HAVE_CXX_ATOMICS_WITH_LIB OR HAVE_CXX_ATOMICS64_WITH_LIB)
target_link_libraries(openttd_lib atomic)
target_link_libraries(openttd atomic)
endif()

View File

@@ -4,6 +4,23 @@
#
macro(compile_flags)
if(MSVC)
if(VCPKG_TARGET_TRIPLET MATCHES "-static" AND NOT VCPKG_TARGET_TRIPLET MATCHES "-md")
# Switch to MT (static) instead of MD (dynamic) binary
# For MSVC two generators are available
# - a command line generator (Ninja) using CMAKE_BUILD_TYPE to specify the
# configuration of the build tree
# - an IDE generator (Visual Studio) using CMAKE_CONFIGURATION_TYPES to
# specify all configurations that will be available in the generated solution
list(APPEND MSVC_CONFIGS "${CMAKE_BUILD_TYPE}" "${CMAKE_CONFIGURATION_TYPES}")
# Set usage of static runtime for all configurations
foreach(MSVC_CONFIG ${MSVC_CONFIGS})
string(TOUPPER "CMAKE_CXX_FLAGS_${MSVC_CONFIG}" MSVC_FLAGS)
string(REPLACE "/MD" "/MT" ${MSVC_FLAGS} "${${MSVC_FLAGS}}")
endforeach()
endif()
# "If /Zc:rvalueCast is specified, the compiler follows section 5.4 of the
# C++11 standard". We need C++11 for the way we use threads.
add_compile_options(/Zc:rvalueCast)
@@ -39,8 +56,8 @@ macro(compile_flags)
if(MSVC)
add_compile_options(/W3)
if(MSVC_VERSION GREATER 1929 AND MSVC_VERSION LESS 1937 AND CMAKE_CXX_COMPILER_ID STREQUAL "MSVC")
# Starting with version 19.30 (fixed in version 19.37), there is an optimisation bug, see #9966 for details
if(MSVC_VERSION GREATER 1929 AND CMAKE_CXX_COMPILER_ID STREQUAL "MSVC")
# Starting with version 19.30, there is an optimisation bug, see #9966 for details
# This flag disables the broken optimisation to work around the bug
add_compile_options(/d2ssa-rse-)
endif()

View File

@@ -1,65 +0,0 @@
#[=======================================================================[.rst:
FindHarfBuzz
-------
Finds the harfbuzz library.
Result Variables
^^^^^^^^^^^^^^^^
This will define the following variables:
``Harfbuzz_FOUND``
True if the system has the harfbuzz library.
``Harfbuzz_INCLUDE_DIRS``
Include directories needed to use harfbuzz.
``Harfbuzz_LIBRARIES``
Libraries needed to link to harfbuzz.
``Harfbuzz_VERSION``
The version of the harfbuzz library which was found.
Cache Variables
^^^^^^^^^^^^^^^
The following cache variables may also be set:
``Harfbuzz_INCLUDE_DIR``
The directory containing ``hb.h``.
``Harfbuzz_LIBRARY``
The path to the harfbuzz library.
#]=======================================================================]
find_package(PkgConfig QUIET)
pkg_check_modules(PC_Harfbuzz QUIET harfbuzz)
find_path(Harfbuzz_INCLUDE_DIR
NAMES hb.h
PATHS ${PC_Harfbuzz_INCLUDE_DIRS}
)
find_library(Harfbuzz_LIBRARY
NAMES harfbuzz
PATHS ${PC_Harfbuzz_LIBRARY_DIRS}
)
set(Harfbuzz_VERSION ${PC_Harfbuzz_VERSION})
include(FindPackageHandleStandardArgs)
find_package_handle_standard_args(Harfbuzz
FOUND_VAR Harfbuzz_FOUND
REQUIRED_VARS
Harfbuzz_LIBRARY
Harfbuzz_INCLUDE_DIR
VERSION_VAR Harfbuzz_VERSION
)
if(Harfbuzz_FOUND)
set(Harfbuzz_LIBRARIES ${Harfbuzz_LIBRARY})
set(Harfbuzz_INCLUDE_DIRS ${Harfbuzz_INCLUDE_DIR})
endif()
mark_as_advanced(
Harfbuzz_INCLUDE_DIR
Harfbuzz_LIBRARY
)

View File

@@ -9,7 +9,7 @@ FindICU
Finds components of the ICU library.
Accepted components are: uc, i18n, le, lx, io, data
Accepted components are: uc, i18n, le, lx, io
Result Variables
^^^^^^^^^^^^^^^^
@@ -31,7 +31,7 @@ This will define the following variables:
find_package(PkgConfig QUIET)
set(ICU_KNOWN_COMPONENTS "uc" "i18n" "le" "lx" "io" "data")
set(ICU_KNOWN_COMPONENTS "uc" "i18n" "le" "lx" "io")
foreach(MOD_NAME IN LISTS ICU_FIND_COMPONENTS)
if(NOT MOD_NAME IN_LIST ICU_KNOWN_COMPONENTS)

View File

@@ -55,7 +55,7 @@ find_library(LZO_LIBRARY
# 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(VCPKG_TOOLCHAIN AND LZO_LIBRARY)
if(LZO_LIBRARY MATCHES "/debug/")
set(LZO_LIBRARY_DEBUG ${LZO_LIBRARY})
string(REPLACE "/debug/lib/" "/lib/" LZO_LIBRARY_RELEASE ${LZO_LIBRARY})

View File

@@ -173,10 +173,6 @@ elseif(UNIX)
set(CPACK_GENERATOR "DEB")
include(PackageDeb)
elseif(LSB_RELEASE_ID STREQUAL "Fedora")
set(PLATFORM "fedora")
set(CPACK_GENERATOR "RPM")
include(PackageRPM)
else()
set(UNSUPPORTED_PLATFORM_NAME "LSB-based Linux distribution '${LSB_RELEASE_ID}'")
endif()

View File

@@ -3,21 +3,18 @@ function(link_package NAME)
if(${NAME}_FOUND)
string(TOUPPER "${NAME}" UCNAME)
# Some libraries have a dash, which is not allowed in a preprocessor macro.
string(REPLACE "-" "_" UCNAME "${UCNAME}")
add_definitions(-DWITH_${UCNAME})
# Some libraries' cmake packages (looking at you, SDL2) leave trailing whitespace in the link commands,
# which (later) cmake considers to be an error. Work around this with by stripping the incoming string.
if(LP_TARGET AND TARGET ${LP_TARGET})
string(STRIP "${LP_TARGET}" LP_TARGET)
target_link_libraries(openttd_lib ${LP_TARGET})
target_link_libraries(openttd ${LP_TARGET})
message(STATUS "${NAME} found -- -DWITH_${UCNAME} -- ${LP_TARGET}")
else()
string(STRIP "${${NAME}_LIBRARY}" ${NAME}_LIBRARY)
string(STRIP "${${NAME}_LIBRARIES}" ${NAME}_LIBRARIES)
include_directories(${${NAME}_INCLUDE_DIRS} ${${NAME}_INCLUDE_DIR})
target_link_libraries(openttd_lib ${${NAME}_LIBRARIES} ${${NAME}_LIBRARY})
target_link_libraries(openttd ${${NAME}_LIBRARIES} ${${NAME}_LIBRARY})
message(STATUS "${NAME} found -- -DWITH_${UCNAME} -- ${${NAME}_INCLUDE_DIRS} ${${NAME}_INCLUDE_DIR} -- ${${NAME}_LIBRARIES} ${${NAME}_LIBRARY}")
endif()
elseif(LP_ENCOURAGED)

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)
if(EMSCRIPTEN)
# Although pthreads is supported, it is not in a way yet that is
# useful for us.
@@ -71,8 +71,6 @@ function(set_options)
if (OPTION_DOCS_ONLY)
set(OPTION_TOOLS_ONLY ON PARENT_SCOPE)
endif()
option(OPTION_SURVEY_KEY "Survey-key to use for the opt-in survey (empty if you have none)" "")
endfunction()
# Show the values of the generic options.
@@ -86,12 +84,6 @@ function(show_options)
message(STATUS "Option Use assert - ${OPTION_USE_ASSERTS}")
message(STATUS "Option Use threads - ${OPTION_USE_THREADS}")
message(STATUS "Option Use NSIS - ${OPTION_USE_NSIS}")
if(OPTION_SURVEY_KEY)
message(STATUS "Option Survey Key - USED")
else()
message(STATUS "Option Survey Key - NOT USED")
endif()
endfunction()
# Add the definitions for the options that are selected.
@@ -112,8 +104,4 @@ function(add_definitions_based_on_options)
else()
add_definitions(-DNDEBUG)
endif()
if(OPTION_SURVEY_KEY)
add_definitions(-DSURVEY_KEY="${OPTION_SURVEY_KEY}")
endif()
endfunction()

View File

@@ -1,4 +1,12 @@
function(_add_files_tgt tgt)
# Add a file to be compiled.
#
# add_files([file1 ...] CONDITION condition [condition ...])
#
# CONDITION is a complete statement that can be evaluated with if().
# If it evaluates true, the source files will be added; otherwise not.
# For example: ADD_IF SDL_FOUND AND Allegro_FOUND
#
function(add_files)
cmake_parse_arguments(PARAM "" "" "CONDITION" ${ARGN})
set(PARAM_FILES "${PARAM_UNPARSED_ARGUMENTS}")
@@ -9,44 +17,10 @@ function(_add_files_tgt tgt)
endif()
foreach(FILE IN LISTS PARAM_FILES)
# Some IDEs are not happy with duplicated filenames, so we detect that before adding the file.
get_target_property(${tgt}_FILES ${tgt} SOURCES)
if(${tgt}_FILES MATCHES "/${FILE}(;|$)")
string(REGEX REPLACE "(^|.+;)([^;]+/${FILE})(;.+|$)" "\\2" RES "${${tgt}_FILES}")
# Ignore header files duplicates in 3rdparty.
if(NOT (${FILE} MATCHES "\.h" AND (${RES} MATCHES "3rdparty" OR ${CMAKE_CURRENT_SOURCE_DIR} MATCHES "3rdparty")))
message(FATAL_ERROR "${tgt}: ${CMAKE_CURRENT_SOURCE_DIR}/${FILE} filename is a duplicate of ${RES}")
endif()
endif()
target_sources(${tgt} PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/${FILE})
target_sources(openttd PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/${FILE})
endforeach()
endfunction()
# Add a file to be compiled.
#
# add_files([file1 ...] CONDITION condition [condition ...])
#
# CONDITION is a complete statement that can be evaluated with if().
# If it evaluates true, the source files will be added; otherwise not.
# For example: ADD_IF SDL_FOUND AND Allegro_FOUND
#
function(add_files)
_add_files_tgt(openttd_lib ${ARGV})
endfunction()
# Add a test file to be compiled.
#
# add_test_files([file1 ...] CONDITION condition [condition ...])
#
# CONDITION is a complete statement that can be evaluated with if().
# If it evaluates true, the source files will be added; otherwise not.
# For example: ADD_IF SDL_FOUND AND Allegro_FOUND
#
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,

View File

@@ -28,27 +28,25 @@ endmacro()
macro(dump_class_templates NAME)
string(REGEX REPLACE "^Script" "" REALNAME ${NAME})
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; } };")
string(APPEND SQUIRREL_EXPORT "\n template <> inline ${NAME} *GetParam(ForceType<${NAME} *>, HSQUIRRELVM vm, int index, SQAutoFreePointers *ptr) { SQUserPointer instance; sq_getinstanceup(vm, index, &instance, nullptr); return (${NAME} *)instance; }")
string(APPEND SQUIRREL_EXPORT "\n template <> inline ${NAME} &GetParam(ForceType<${NAME} &>, HSQUIRRELVM vm, int index, SQAutoFreePointers *ptr) { SQUserPointer instance; sq_getinstanceup(vm, index, &instance, nullptr); return *(${NAME} *)instance; }")
string(APPEND SQUIRREL_EXPORT "\n template <> inline const ${NAME} *GetParam(ForceType<const ${NAME} *>, HSQUIRRELVM vm, int index, SQAutoFreePointers *ptr) { SQUserPointer instance; sq_getinstanceup(vm, index, &instance, nullptr); return (${NAME} *)instance; }")
string(APPEND SQUIRREL_EXPORT "\n template <> inline const ${NAME} &GetParam(ForceType<const ${NAME} &>, HSQUIRRELVM vm, int index, SQAutoFreePointers *ptr) { SQUserPointer instance; sq_getinstanceup(vm, index, &instance, nullptr); return *(${NAME} *)instance; }")
if("${NAME}" STREQUAL "ScriptEvent")
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; } };")
string(APPEND SQUIRREL_EXPORT "\n template <> inline int Return<${NAME} *>(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 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 template <> inline Text *GetParam(ForceType<Text *>, HSQUIRRELVM vm, int index, SQAutoFreePointers *ptr) {")
string(APPEND SQUIRREL_EXPORT "\n if (sq_gettype(vm, index) == OT_INSTANCE) {")
string(APPEND SQUIRREL_EXPORT "\n return GetParam(ForceType<ScriptText *>(), vm, index, ptr);")
string(APPEND SQUIRREL_EXPORT "\n }")
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(GetParam(ForceType<const char *>(), vm, index, ptr));")
string(APPEND SQUIRREL_EXPORT "\n }")
string(APPEND SQUIRREL_EXPORT "\n return nullptr;")
string(APPEND SQUIRREL_EXPORT "\n }")
else()
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; } };")
string(APPEND SQUIRREL_EXPORT "\n template <> inline int Return<${NAME} *>(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()
@@ -299,8 +297,8 @@ foreach(LINE IN LISTS SOURCE_LINES)
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; } };")
string(APPEND SQUIRREL_EXPORT "\n template <> inline ${ENUM} GetParam(ForceType<${ENUM}>, HSQUIRRELVM vm, int index, SQAutoFreePointers *ptr) { SQInteger tmp; sq_getinteger(vm, index, &tmp); return (${ENUM})tmp; }")
string(APPEND SQUIRREL_EXPORT "\n template <> inline int Return<${ENUM}>(HSQUIRRELVM vm, ${ENUM} res) { sq_pushinteger(vm, (int32)res); return 1; }")
endforeach()
endif()
@@ -332,13 +330,13 @@ foreach(LINE IN LISTS SOURCE_LINES)
endif()
string(APPEND SQUIRREL_EXPORT "\n")
string(APPEND SQUIRREL_EXPORT "\ntemplate <> const char *GetClassName<${CLS}, ScriptType::${APIUC}>() { return \"${API_CLS}\"; }")
string(APPEND SQUIRREL_EXPORT "\ntemplate <> const char *GetClassName<${CLS}, ST_${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 "\n{")
string(APPEND SQUIRREL_EXPORT "\n DefSQClass<${CLS}, ScriptType::${APIUC}> SQ${API_CLS}(\"${API_CLS}\");")
string(APPEND SQUIRREL_EXPORT "\n DefSQClass<${CLS}, ST_${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()
@@ -627,12 +625,10 @@ foreach(LINE IN LISTS SOURCE_LINES)
string(APPEND TYPES "p")
elseif("${PARAM}" MATCHES "^Array")
string(APPEND TYPES "a")
elseif("${PARAM}" MATCHES "^const Array")
elseif("${PARAM}" MATCHES "^struct Array")
string(APPEND TYPES "a")
elseif("${PARAM}" MATCHES "^Text")
string(APPEND TYPES ".")
elseif("${PARAM}" MATCHES "^std::string")
string(APPEND TYPES ".")
else()
string(APPEND TYPES "x")
endif()

View File

@@ -19,14 +19,14 @@ your operating system:
- Windows:
- `C:\My Documents\OpenTTD` (95, 98, ME)
- `C:\Documents and Settings\<username>\My Documents\OpenTTD` (2000, XP)
- `C:\Users\<username>\Documents\OpenTTD` (Vista, 7, 8.1, 10, 11)
- `C:\Users\<username>\Documents\OpenTTD` (Vista, 7, 8.1, 10)
- macOS: `~/Documents/OpenTTD`
- Linux: `$XDG_DATA_HOME/openttd` which is usually `~/.local/share/openttd`
when built with XDG base directory support, otherwise `~/.openttd`
3. The shared directory
- Windows:
- `C:\Documents and Settings\All Users\Shared Documents\OpenTTD` (2000, XP)
- `C:\Users\Public\Documents\OpenTTD` (Vista, 7, 8.1, 10, 11)
- `C:\Users\Public\Documents\OpenTTD` (Vista, 7, 8.1, 10)
- macOS: `/Library/Application Support/OpenTTD`
- Linux: not available
4. The binary directory (where the OpenTTD executable is)

View File

@@ -807,6 +807,8 @@
</table>
</li>
<li>m2 bits 5..4: ground density</li>
<li>m2 bits 3..0: update counter, incremented on every periodic processing.<br>
on wraparound the growth status is updated (or, if it's <tt>3</tt>, a random action is taken)</li>
<li>m3 bits 7..0: type of trees:
<table>
<tr>
@@ -996,7 +998,6 @@
<li>m7: animation frame (railway stations/waypoints, airports)</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 id; 0 means standard graphics</li>
</ul>
</td>
</tr>

View File

@@ -203,7 +203,7 @@ the array so you can quickly see what is used and what is not.
<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>
<td class="bits"><span class="free">OOOO</span> <span class="used" title="Tram type">XXXX XX<span class="free">OO OOOO</span></td>
</tr>
<tr>
<td class="caption">airport</td>

View File

@@ -1,6 +1,6 @@
.\" Hey, EMACS: -*- nroff -*-
.\" Please adjust this date whenever revising the manpage.
.Dd August 12, 2023
.Dd October 13, 2014
.Dt OPENTTD 6
.Os
.Sh NAME
@@ -8,7 +8,7 @@
.Nd open source clone of the Microprose game \(lqTransport Tycoon Deluxe\(rq
.Sh SYNOPSIS
.Nm
.Op Fl efhQxX
.Op Fl efhx
.Op Fl b Ar blitter
.Op Fl c Ar config_file
.Op Fl d Op Ar level | Ar cat Ns = Ns Ar lvl Ns Op , Ns Ar ...
@@ -19,7 +19,7 @@
.Op Fl l Ar host Ns Op : Ns Ar port
.Op Fl m Ar driver
.Op Fl M Ar musicset
.Op Fl n Ar host Ns Oo : Ns Ar port Oc Ns Op # Ns Ar company
.Op Fl n Ar host Ns Oo : Ns Ar port Oc Ns Op # Ns Ar player
.Op Fl p Ar password
.Op Fl P Ar password
.Op Fl q Ar savegame
@@ -29,7 +29,7 @@
.Op Fl t Ar year
.Op Fl v Ar driver
.Sh OPTIONS
.Bl -tag -width "-n host[:port][#company]"
.Bl -tag -width "-n host[:port][#player]"
.It Fl b Ar blitter
Select the blitter
.Ar blitter ;
@@ -83,8 +83,10 @@ see
.Fl h
for a full list.
.It Fl l Ar host Ns Op : Ns Ar port
Redirect debug output; see
.Fl d .
Redirect
.Fn DEBUG
output; see
.Fl D .
.It Fl m Ar driver
Select the music driver
.Ar driver ;
@@ -97,8 +99,8 @@ Select the music set
see
.Fl h
for a full list.
.It Fl n Ar host Ns Oo : Ns Ar port Oc Ns Op # Ns Ar company
Join a network game, optionally specifying a port to connect to and company to
.It Fl n Ar host Ns Oo : Ns Ar port Oc Ns Op # Ns Ar player
Join a network game, optionally specifying a port to connect to and player to
play as.
.It Fl p Ar password
Password used to join server.
@@ -110,14 +112,6 @@ Only useful with
.Fl n .
.It Fl q Ar savegame
Write some information about the specified savegame and exit.
.It Fl Q
Don't scan for/load NewGRF files on startup.
.Pp
Passing
.Fl Q
twice (so,
.Fl QQ
) will disable NewGRF scanning/loading entirely.
.It Fl r Ar width Ns x Ns Ar height
Set the resolution to
.Ar width
@@ -147,8 +141,6 @@ see
for a full list.
.It Fl x
Do not automatically save to config file on exit.
.It Fl X
Do not use global folders to search for files.
.El
.Sh SEE ALSO
.Lk https://wiki.openttd.org "Wiki"

View File

@@ -1,48 +0,0 @@
# Releasing OpenTTD
This guide is for OpenTTD developers/maintainers, to release a new version of OpenTTD.
## Step 0: Branch or Backport
* 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 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
## Step 1: Prepare changelog documentation
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.
2. Create a changelog PR, get approval, and merge.
* For beta releases, target master, otherwise target the release branch.
## Step 2: Prepare website release announcement
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 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 (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. 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. 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,34 +0,0 @@
# OpenTTD's Symbol Server
For all official releases, OpenTTD collects the Breakpad Symbols (SYM-files) and Microsoft's Symbols (PDB-files), and publishes them on our own Symbol Server (https://symbols.openttd.org).
These symbol files are needed to analyze `crash.dmp` files as attached to issues by users.
A `crash.dmp` is created on Windows, Linux, and MacOS when a crash happens.
This combined with the `crash.log` should give a pretty good indication what was going on at the moment the game crashed.
## Analyzing a crash.dmp
### MSVC
In MSVC you can add the above URL as Symbol Server (and please enable MSVC's for all other libraries), allowing you to analyze `crash.dmp`.
Now simply open up the `crash.dmp`, and start debugging.
### All other platforms
The best tool to use is `minidump-stackwalk` as published in the Rust's cargo index:
```bash
cargo install minidump-stackwalk
```
For how to install Rust, please see [here](https://doc.rust-lang.org/cargo/getting-started/installation.html).
Now run the tool like:
```bash
minidump-stackwalk <crash.dmp> --symbols-url https://symbols.openttd.org
```
For convenience, the above Symbol Server also check with Mozilla's Symbol Server in case any other library but OpenTTD is requested.
This means files like `libc`, `kernel32.dll`, etc are all available on the above mentioned Symbol Server.

Binary file not shown.

View File

@@ -5,233 +5,233 @@
//
-1 * 0 0C "Monospaced characters (Liberation Mono)"
-1 * 0 12 01 03 60 20 00
-1 sprites/mono.png 8bpp 10 30 7 13 0 -2 normal
-1 sprites/mono.png 8bpp 25 30 7 13 0 -2 normal
-1 sprites/mono.png 8bpp 40 30 7 13 0 -2 normal
-1 sprites/mono.png 8bpp 55 30 7 13 0 -2 normal
-1 sprites/mono.png 8bpp 70 30 7 13 0 -2 normal
-1 sprites/mono.png 8bpp 85 30 7 13 0 -2 normal
-1 sprites/mono.png 8bpp 100 30 7 13 0 -2 normal
-1 sprites/mono.png 8bpp 115 30 7 13 0 -2 normal
-1 sprites/mono.png 8bpp 130 30 7 13 0 -2 normal
-1 sprites/mono.png 8bpp 145 30 7 13 0 -2 normal
-1 sprites/mono.png 8bpp 160 30 7 13 0 -2 normal
-1 sprites/mono.png 8bpp 175 30 7 13 0 -2 normal
-1 sprites/mono.png 8bpp 190 30 7 13 0 -2 normal
-1 sprites/mono.png 8bpp 205 30 7 13 0 -2 normal
-1 sprites/mono.png 8bpp 220 30 7 13 0 -2 normal
-1 sprites/mono.png 8bpp 235 30 7 13 0 -2 normal
-1 sprites/mono.png 8bpp 250 30 7 13 0 -2 normal
-1 sprites/mono.png 8bpp 265 30 7 13 0 -2 normal
-1 sprites/mono.png 8bpp 280 30 7 13 0 -2 normal
-1 sprites/mono.png 8bpp 295 30 7 13 0 -2 normal
-1 sprites/mono.png 8bpp 310 30 7 13 0 -2 normal
-1 sprites/mono.png 8bpp 325 30 7 13 0 -2 normal
-1 sprites/mono.png 8bpp 340 30 7 13 0 -2 normal
-1 sprites/mono.png 8bpp 355 30 7 13 0 -2 normal
-1 sprites/mono.png 8bpp 370 30 7 13 0 -2 normal
-1 sprites/mono.png 8bpp 385 30 7 13 0 -2 normal
-1 sprites/mono.png 8bpp 400 30 7 13 0 -2 normal
-1 sprites/mono.png 8bpp 415 30 7 13 0 -2 normal
-1 sprites/mono.png 8bpp 430 30 7 13 0 -2 normal
-1 sprites/mono.png 8bpp 445 30 7 13 0 -2 normal
-1 sprites/mono.png 8bpp 460 30 7 13 0 -2 normal
-1 sprites/mono.png 8bpp 475 30 7 13 0 -2 normal
-1 sprites/mono.png 8bpp 10 50 7 13 0 -2 normal
-1 sprites/mono.png 8bpp 25 50 7 13 0 -2 normal
-1 sprites/mono.png 8bpp 40 50 7 13 0 -2 normal
-1 sprites/mono.png 8bpp 55 50 7 13 0 -2 normal
-1 sprites/mono.png 8bpp 70 50 7 13 0 -2 normal
-1 sprites/mono.png 8bpp 85 50 7 13 0 -2 normal
-1 sprites/mono.png 8bpp 100 50 7 13 0 -2 normal
-1 sprites/mono.png 8bpp 115 50 7 13 0 -2 normal
-1 sprites/mono.png 8bpp 130 50 7 13 0 -2 normal
-1 sprites/mono.png 8bpp 145 50 7 13 0 -2 normal
-1 sprites/mono.png 8bpp 160 50 7 13 0 -2 normal
-1 sprites/mono.png 8bpp 175 50 7 13 0 -2 normal
-1 sprites/mono.png 8bpp 190 50 7 13 0 -2 normal
-1 sprites/mono.png 8bpp 205 50 7 13 0 -2 normal
-1 sprites/mono.png 8bpp 220 50 7 13 0 -2 normal
-1 sprites/mono.png 8bpp 235 50 7 13 0 -2 normal
-1 sprites/mono.png 8bpp 250 50 7 13 0 -2 normal
-1 sprites/mono.png 8bpp 265 50 7 13 0 -2 normal
-1 sprites/mono.png 8bpp 280 50 7 13 0 -2 normal
-1 sprites/mono.png 8bpp 295 50 7 13 0 -2 normal
-1 sprites/mono.png 8bpp 310 50 7 13 0 -2 normal
-1 sprites/mono.png 8bpp 325 50 7 13 0 -2 normal
-1 sprites/mono.png 8bpp 340 50 7 13 0 -2 normal
-1 sprites/mono.png 8bpp 355 50 7 13 0 -2 normal
-1 sprites/mono.png 8bpp 370 50 7 13 0 -2 normal
-1 sprites/mono.png 8bpp 385 50 7 13 0 -2 normal
-1 sprites/mono.png 8bpp 400 50 7 13 0 -2 normal
-1 sprites/mono.png 8bpp 415 50 7 13 0 -2 normal
-1 sprites/mono.png 8bpp 430 50 7 13 0 -2 normal
-1 sprites/mono.png 8bpp 445 50 7 13 0 -2 normal
-1 sprites/mono.png 8bpp 460 50 7 13 0 -2 normal
-1 sprites/mono.png 8bpp 475 50 7 13 0 -2 normal
-1 sprites/mono.png 8bpp 10 70 7 13 0 -2 normal
-1 sprites/mono.png 8bpp 25 70 7 13 0 -2 normal
-1 sprites/mono.png 8bpp 40 70 7 13 0 -2 normal
-1 sprites/mono.png 8bpp 55 70 7 13 0 -2 normal
-1 sprites/mono.png 8bpp 70 70 7 13 0 -2 normal
-1 sprites/mono.png 8bpp 85 70 7 13 0 -2 normal
-1 sprites/mono.png 8bpp 100 70 7 13 0 -2 normal
-1 sprites/mono.png 8bpp 115 70 7 13 0 -2 normal
-1 sprites/mono.png 8bpp 130 70 7 13 0 -2 normal
-1 sprites/mono.png 8bpp 145 70 7 13 0 -2 normal
-1 sprites/mono.png 8bpp 160 70 7 13 0 -2 normal
-1 sprites/mono.png 8bpp 175 70 7 13 0 -2 normal
-1 sprites/mono.png 8bpp 190 70 7 13 0 -2 normal
-1 sprites/mono.png 8bpp 205 70 7 13 0 -2 normal
-1 sprites/mono.png 8bpp 220 70 7 13 0 -2 normal
-1 sprites/mono.png 8bpp 235 70 7 13 0 -2 normal
-1 sprites/mono.png 8bpp 250 70 7 13 0 -2 normal
-1 sprites/mono.png 8bpp 265 70 7 13 0 -2 normal
-1 sprites/mono.png 8bpp 280 70 7 13 0 -2 normal
-1 sprites/mono.png 8bpp 295 70 7 13 0 -2 normal
-1 sprites/mono.png 8bpp 310 70 7 13 0 -2 normal
-1 sprites/mono.png 8bpp 325 70 7 13 0 -2 normal
-1 sprites/mono.png 8bpp 340 70 7 13 0 -2 normal
-1 sprites/mono.png 8bpp 355 70 7 13 0 -2 normal
-1 sprites/mono.png 8bpp 370 70 7 13 0 -2 normal
-1 sprites/mono.png 8bpp 385 70 7 13 0 -2 normal
-1 sprites/mono.png 8bpp 400 70 7 13 0 -2 normal
-1 sprites/mono.png 8bpp 415 70 7 13 0 -2 normal
-1 sprites/mono.png 8bpp 430 70 7 13 0 -2 normal
-1 sprites/mono.png 8bpp 445 70 7 13 0 -2 normal
-1 sprites/mono.png 8bpp 460 70 7 13 0 -2 normal
-1 sprites/mono.png 8bpp 475 70 7 13 0 -2 normal
-1 sprites/mono.png 8bpp 10 30 7 13 0 0 normal
-1 sprites/mono.png 8bpp 25 30 7 13 0 0 normal
-1 sprites/mono.png 8bpp 40 30 7 13 0 0 normal
-1 sprites/mono.png 8bpp 55 30 7 13 0 0 normal
-1 sprites/mono.png 8bpp 70 30 7 13 0 0 normal
-1 sprites/mono.png 8bpp 85 30 7 13 0 0 normal
-1 sprites/mono.png 8bpp 100 30 7 13 0 0 normal
-1 sprites/mono.png 8bpp 115 30 7 13 0 0 normal
-1 sprites/mono.png 8bpp 130 30 7 13 0 0 normal
-1 sprites/mono.png 8bpp 145 30 7 13 0 0 normal
-1 sprites/mono.png 8bpp 160 30 7 13 0 0 normal
-1 sprites/mono.png 8bpp 175 30 7 13 0 0 normal
-1 sprites/mono.png 8bpp 190 30 7 13 0 0 normal
-1 sprites/mono.png 8bpp 205 30 7 13 0 0 normal
-1 sprites/mono.png 8bpp 220 30 7 13 0 0 normal
-1 sprites/mono.png 8bpp 235 30 7 13 0 0 normal
-1 sprites/mono.png 8bpp 250 30 7 13 0 0 normal
-1 sprites/mono.png 8bpp 265 30 7 13 0 0 normal
-1 sprites/mono.png 8bpp 280 30 7 13 0 0 normal
-1 sprites/mono.png 8bpp 295 30 7 13 0 0 normal
-1 sprites/mono.png 8bpp 310 30 7 13 0 0 normal
-1 sprites/mono.png 8bpp 325 30 7 13 0 0 normal
-1 sprites/mono.png 8bpp 340 30 7 13 0 0 normal
-1 sprites/mono.png 8bpp 355 30 7 13 0 0 normal
-1 sprites/mono.png 8bpp 370 30 7 13 0 0 normal
-1 sprites/mono.png 8bpp 385 30 7 13 0 0 normal
-1 sprites/mono.png 8bpp 400 30 7 13 0 0 normal
-1 sprites/mono.png 8bpp 415 30 7 13 0 0 normal
-1 sprites/mono.png 8bpp 430 30 7 13 0 0 normal
-1 sprites/mono.png 8bpp 445 30 7 13 0 0 normal
-1 sprites/mono.png 8bpp 460 30 7 13 0 0 normal
-1 sprites/mono.png 8bpp 475 30 7 13 0 0 normal
-1 sprites/mono.png 8bpp 10 50 7 13 0 0 normal
-1 sprites/mono.png 8bpp 25 50 7 13 0 0 normal
-1 sprites/mono.png 8bpp 40 50 7 13 0 0 normal
-1 sprites/mono.png 8bpp 55 50 7 13 0 0 normal
-1 sprites/mono.png 8bpp 70 50 7 13 0 0 normal
-1 sprites/mono.png 8bpp 85 50 7 13 0 0 normal
-1 sprites/mono.png 8bpp 100 50 7 13 0 0 normal
-1 sprites/mono.png 8bpp 115 50 7 13 0 0 normal
-1 sprites/mono.png 8bpp 130 50 7 13 0 0 normal
-1 sprites/mono.png 8bpp 145 50 7 13 0 0 normal
-1 sprites/mono.png 8bpp 160 50 7 13 0 0 normal
-1 sprites/mono.png 8bpp 175 50 7 13 0 0 normal
-1 sprites/mono.png 8bpp 190 50 7 13 0 0 normal
-1 sprites/mono.png 8bpp 205 50 7 13 0 0 normal
-1 sprites/mono.png 8bpp 220 50 7 13 0 0 normal
-1 sprites/mono.png 8bpp 235 50 7 13 0 0 normal
-1 sprites/mono.png 8bpp 250 50 7 13 0 0 normal
-1 sprites/mono.png 8bpp 265 50 7 13 0 0 normal
-1 sprites/mono.png 8bpp 280 50 7 13 0 0 normal
-1 sprites/mono.png 8bpp 295 50 7 13 0 0 normal
-1 sprites/mono.png 8bpp 310 50 7 13 0 0 normal
-1 sprites/mono.png 8bpp 325 50 7 13 0 0 normal
-1 sprites/mono.png 8bpp 340 50 7 13 0 0 normal
-1 sprites/mono.png 8bpp 355 50 7 13 0 0 normal
-1 sprites/mono.png 8bpp 370 50 7 13 0 0 normal
-1 sprites/mono.png 8bpp 385 50 7 13 0 0 normal
-1 sprites/mono.png 8bpp 400 50 7 13 0 0 normal
-1 sprites/mono.png 8bpp 415 50 7 13 0 0 normal
-1 sprites/mono.png 8bpp 430 50 7 13 0 0 normal
-1 sprites/mono.png 8bpp 445 50 7 13 0 0 normal
-1 sprites/mono.png 8bpp 460 50 7 13 0 0 normal
-1 sprites/mono.png 8bpp 475 50 7 13 0 0 normal
-1 sprites/mono.png 8bpp 10 70 7 13 0 0 normal
-1 sprites/mono.png 8bpp 25 70 7 13 0 0 normal
-1 sprites/mono.png 8bpp 40 70 7 13 0 0 normal
-1 sprites/mono.png 8bpp 55 70 7 13 0 0 normal
-1 sprites/mono.png 8bpp 70 70 7 13 0 0 normal
-1 sprites/mono.png 8bpp 85 70 7 13 0 0 normal
-1 sprites/mono.png 8bpp 100 70 7 13 0 0 normal
-1 sprites/mono.png 8bpp 115 70 7 13 0 0 normal
-1 sprites/mono.png 8bpp 130 70 7 13 0 0 normal
-1 sprites/mono.png 8bpp 145 70 7 13 0 0 normal
-1 sprites/mono.png 8bpp 160 70 7 13 0 0 normal
-1 sprites/mono.png 8bpp 175 70 7 13 0 0 normal
-1 sprites/mono.png 8bpp 190 70 7 13 0 0 normal
-1 sprites/mono.png 8bpp 205 70 7 13 0 0 normal
-1 sprites/mono.png 8bpp 220 70 7 13 0 0 normal
-1 sprites/mono.png 8bpp 235 70 7 13 0 0 normal
-1 sprites/mono.png 8bpp 250 70 7 13 0 0 normal
-1 sprites/mono.png 8bpp 265 70 7 13 0 0 normal
-1 sprites/mono.png 8bpp 280 70 7 13 0 0 normal
-1 sprites/mono.png 8bpp 295 70 7 13 0 0 normal
-1 sprites/mono.png 8bpp 310 70 7 13 0 0 normal
-1 sprites/mono.png 8bpp 325 70 7 13 0 0 normal
-1 sprites/mono.png 8bpp 340 70 7 13 0 0 normal
-1 sprites/mono.png 8bpp 355 70 7 13 0 0 normal
-1 sprites/mono.png 8bpp 370 70 7 13 0 0 normal
-1 sprites/mono.png 8bpp 385 70 7 13 0 0 normal
-1 sprites/mono.png 8bpp 400 70 7 13 0 0 normal
-1 sprites/mono.png 8bpp 415 70 7 13 0 0 normal
-1 sprites/mono.png 8bpp 430 70 7 13 0 0 normal
-1 sprites/mono.png 8bpp 445 70 7 13 0 0 normal
-1 sprites/mono.png 8bpp 460 70 7 13 0 0 normal
-1 sprites/mono.png 8bpp 475 70 7 13 0 0 normal
-1 * 0 12 01 03 80 80 00
-1 sprites/mono.png 8bpp 10 90 7 13 0 -2 normal
-1 sprites/mono.png 8bpp 25 90 7 13 0 -2 normal
-1 sprites/mono.png 8bpp 40 90 7 13 0 -2 normal
-1 sprites/mono.png 8bpp 55 90 7 13 0 -2 normal
-1 sprites/mono.png 8bpp 70 90 7 13 0 -2 normal
-1 sprites/mono.png 8bpp 85 90 7 13 0 -2 normal
-1 sprites/mono.png 8bpp 100 90 7 13 0 -2 normal
-1 sprites/mono.png 8bpp 115 90 7 13 0 -2 normal
-1 sprites/mono.png 8bpp 130 90 7 13 0 -2 normal
-1 sprites/mono.png 8bpp 145 90 7 13 0 -2 normal
-1 sprites/mono.png 8bpp 160 90 7 13 0 -2 normal
-1 sprites/mono.png 8bpp 175 90 7 13 0 -2 normal
-1 sprites/mono.png 8bpp 190 90 7 13 0 -2 normal
-1 sprites/mono.png 8bpp 205 90 7 13 0 -2 normal
-1 sprites/mono.png 8bpp 220 90 7 13 0 -2 normal
-1 sprites/mono.png 8bpp 235 90 7 13 0 -2 normal
-1 sprites/mono.png 8bpp 250 90 7 13 0 -2 normal
-1 sprites/mono.png 8bpp 265 90 7 13 0 -2 normal
-1 sprites/mono.png 8bpp 280 90 7 13 0 -2 normal
-1 sprites/mono.png 8bpp 295 90 7 13 0 -2 normal
-1 sprites/mono.png 8bpp 310 90 7 13 0 -2 normal
-1 sprites/mono.png 8bpp 325 90 7 13 0 -2 normal
-1 sprites/mono.png 8bpp 340 90 7 13 0 -2 normal
-1 sprites/mono.png 8bpp 355 90 7 13 0 -2 normal
-1 sprites/mono.png 8bpp 370 90 7 13 0 -2 normal
-1 sprites/mono.png 8bpp 385 90 7 13 0 -2 normal
-1 sprites/mono.png 8bpp 400 90 7 13 0 -2 normal
-1 sprites/mono.png 8bpp 415 90 7 13 0 -2 normal
-1 sprites/mono.png 8bpp 430 90 7 13 0 -2 normal
-1 sprites/mono.png 8bpp 445 90 7 13 0 -2 normal
-1 sprites/mono.png 8bpp 460 90 7 13 0 -2 normal
-1 sprites/mono.png 8bpp 475 90 7 13 0 -2 normal
-1 sprites/mono.png 8bpp 10 110 7 13 0 -2 normal
-1 sprites/mono.png 8bpp 25 110 7 13 0 -2 normal
-1 sprites/mono.png 8bpp 40 110 7 13 0 -2 normal
-1 sprites/mono.png 8bpp 55 110 7 13 0 -2 normal
-1 sprites/mono.png 8bpp 70 110 7 13 0 -2 normal
-1 sprites/mono.png 8bpp 85 110 7 13 0 -2 normal
-1 sprites/mono.png 8bpp 100 110 7 13 0 -2 normal
-1 sprites/mono.png 8bpp 115 110 7 13 0 -2 normal
-1 sprites/mono.png 8bpp 130 110 7 13 0 -2 normal
-1 sprites/mono.png 8bpp 145 110 7 13 0 -2 normal
-1 sprites/mono.png 8bpp 160 110 7 13 0 -2 normal
-1 sprites/mono.png 8bpp 175 110 7 13 0 -2 normal
-1 sprites/mono.png 8bpp 190 110 7 13 0 -2 normal
-1 sprites/mono.png 8bpp 205 110 7 13 0 -2 normal
-1 sprites/mono.png 8bpp 220 110 7 13 0 -2 normal
-1 sprites/mono.png 8bpp 235 110 7 13 0 -2 normal
-1 sprites/mono.png 8bpp 250 110 7 13 0 -2 normal
-1 sprites/mono.png 8bpp 265 110 7 13 0 -2 normal
-1 sprites/mono.png 8bpp 280 110 7 13 0 -2 normal
-1 sprites/mono.png 8bpp 295 110 7 13 0 -2 normal
-1 sprites/mono.png 8bpp 310 110 7 13 0 -2 normal
-1 sprites/mono.png 8bpp 325 110 7 13 0 -2 normal
-1 sprites/mono.png 8bpp 340 110 7 13 0 -2 normal
-1 sprites/mono.png 8bpp 355 110 7 13 0 -2 normal
-1 sprites/mono.png 8bpp 370 110 7 13 0 -2 normal
-1 sprites/mono.png 8bpp 385 110 7 13 0 -2 normal
-1 sprites/mono.png 8bpp 400 110 7 13 0 -2 normal
-1 sprites/mono.png 8bpp 415 110 7 13 0 -2 normal
-1 sprites/mono.png 8bpp 430 110 7 13 0 -2 normal
-1 sprites/mono.png 8bpp 445 110 7 13 0 -2 normal
-1 sprites/mono.png 8bpp 460 110 7 13 0 -2 normal
-1 sprites/mono.png 8bpp 475 110 7 13 0 -2 normal
-1 sprites/mono.png 8bpp 10 130 7 13 0 -2 normal
-1 sprites/mono.png 8bpp 25 130 7 13 0 -2 normal
-1 sprites/mono.png 8bpp 40 130 7 13 0 -2 normal
-1 sprites/mono.png 8bpp 55 130 7 13 0 -2 normal
-1 sprites/mono.png 8bpp 70 130 7 13 0 -2 normal
-1 sprites/mono.png 8bpp 85 130 7 13 0 -2 normal
-1 sprites/mono.png 8bpp 100 130 7 13 0 -2 normal
-1 sprites/mono.png 8bpp 115 130 7 13 0 -2 normal
-1 sprites/mono.png 8bpp 130 130 7 13 0 -2 normal
-1 sprites/mono.png 8bpp 145 130 7 13 0 -2 normal
-1 sprites/mono.png 8bpp 160 130 7 13 0 -2 normal
-1 sprites/mono.png 8bpp 175 130 7 13 0 -2 normal
-1 sprites/mono.png 8bpp 190 130 7 13 0 -2 normal
-1 sprites/mono.png 8bpp 205 130 7 13 0 -2 normal
-1 sprites/mono.png 8bpp 220 130 7 13 0 -2 normal
-1 sprites/mono.png 8bpp 235 130 7 13 0 -2 normal
-1 sprites/mono.png 8bpp 250 130 7 13 0 -2 normal
-1 sprites/mono.png 8bpp 265 130 7 13 0 -2 normal
-1 sprites/mono.png 8bpp 280 130 7 13 0 -2 normal
-1 sprites/mono.png 8bpp 295 130 7 13 0 -2 normal
-1 sprites/mono.png 8bpp 310 130 7 13 0 -2 normal
-1 sprites/mono.png 8bpp 325 130 7 13 0 -2 normal
-1 sprites/mono.png 8bpp 340 130 7 13 0 -2 normal
-1 sprites/mono.png 8bpp 355 130 7 13 0 -2 normal
-1 sprites/mono.png 8bpp 370 130 7 13 0 -2 normal
-1 sprites/mono.png 8bpp 385 130 7 13 0 -2 normal
-1 sprites/mono.png 8bpp 400 130 7 13 0 -2 normal
-1 sprites/mono.png 8bpp 415 130 7 13 0 -2 normal
-1 sprites/mono.png 8bpp 430 130 7 13 0 -2 normal
-1 sprites/mono.png 8bpp 445 130 7 13 0 -2 normal
-1 sprites/mono.png 8bpp 460 130 7 13 0 -2 normal
-1 sprites/mono.png 8bpp 475 130 7 13 0 -2 normal
-1 sprites/mono.png 8bpp 10 150 7 13 0 -2 normal
-1 sprites/mono.png 8bpp 25 150 7 13 0 -2 normal
-1 sprites/mono.png 8bpp 40 150 7 13 0 -2 normal
-1 sprites/mono.png 8bpp 55 150 7 13 0 -2 normal
-1 sprites/mono.png 8bpp 70 150 7 13 0 -2 normal
-1 sprites/mono.png 8bpp 85 150 7 13 0 -2 normal
-1 sprites/mono.png 8bpp 100 150 7 13 0 -2 normal
-1 sprites/mono.png 8bpp 115 150 7 13 0 -2 normal
-1 sprites/mono.png 8bpp 130 150 7 13 0 -2 normal
-1 sprites/mono.png 8bpp 145 150 7 13 0 -2 normal
-1 sprites/mono.png 8bpp 160 150 7 13 0 -2 normal
-1 sprites/mono.png 8bpp 175 150 7 13 0 -2 normal
-1 sprites/mono.png 8bpp 190 150 7 13 0 -2 normal
-1 sprites/mono.png 8bpp 205 150 7 13 0 -2 normal
-1 sprites/mono.png 8bpp 220 150 7 13 0 -2 normal
-1 sprites/mono.png 8bpp 235 150 7 13 0 -2 normal
-1 sprites/mono.png 8bpp 250 150 7 13 0 -2 normal
-1 sprites/mono.png 8bpp 265 150 7 13 0 -2 normal
-1 sprites/mono.png 8bpp 280 150 7 13 0 -2 normal
-1 sprites/mono.png 8bpp 295 150 7 13 0 -2 normal
-1 sprites/mono.png 8bpp 310 150 7 13 0 -2 normal
-1 sprites/mono.png 8bpp 325 150 7 13 0 -2 normal
-1 sprites/mono.png 8bpp 340 150 7 13 0 -2 normal
-1 sprites/mono.png 8bpp 355 150 7 13 0 -2 normal
-1 sprites/mono.png 8bpp 370 150 7 13 0 -2 normal
-1 sprites/mono.png 8bpp 385 150 7 13 0 -2 normal
-1 sprites/mono.png 8bpp 400 150 7 13 0 -2 normal
-1 sprites/mono.png 8bpp 415 150 7 13 0 -2 normal
-1 sprites/mono.png 8bpp 430 150 7 13 0 -2 normal
-1 sprites/mono.png 8bpp 445 150 7 13 0 -2 normal
-1 sprites/mono.png 8bpp 460 150 7 13 0 -2 normal
-1 sprites/mono.png 8bpp 475 150 7 13 0 -2 normal
-1 sprites/mono.png 8bpp 10 90 7 13 0 0 normal
-1 sprites/mono.png 8bpp 25 90 7 13 0 0 normal
-1 sprites/mono.png 8bpp 40 90 7 13 0 0 normal
-1 sprites/mono.png 8bpp 55 90 7 13 0 0 normal
-1 sprites/mono.png 8bpp 70 90 7 13 0 0 normal
-1 sprites/mono.png 8bpp 85 90 7 13 0 0 normal
-1 sprites/mono.png 8bpp 100 90 7 13 0 0 normal
-1 sprites/mono.png 8bpp 115 90 7 13 0 0 normal
-1 sprites/mono.png 8bpp 130 90 7 13 0 0 normal
-1 sprites/mono.png 8bpp 145 90 7 13 0 0 normal
-1 sprites/mono.png 8bpp 160 90 7 13 0 0 normal
-1 sprites/mono.png 8bpp 175 90 7 13 0 0 normal
-1 sprites/mono.png 8bpp 190 90 7 13 0 0 normal
-1 sprites/mono.png 8bpp 205 90 7 13 0 0 normal
-1 sprites/mono.png 8bpp 220 90 7 13 0 0 normal
-1 sprites/mono.png 8bpp 235 90 7 13 0 0 normal
-1 sprites/mono.png 8bpp 250 90 7 13 0 0 normal
-1 sprites/mono.png 8bpp 265 90 7 13 0 0 normal
-1 sprites/mono.png 8bpp 280 90 7 13 0 0 normal
-1 sprites/mono.png 8bpp 295 90 7 13 0 0 normal
-1 sprites/mono.png 8bpp 310 90 7 13 0 0 normal
-1 sprites/mono.png 8bpp 325 90 7 13 0 0 normal
-1 sprites/mono.png 8bpp 340 90 7 13 0 0 normal
-1 sprites/mono.png 8bpp 355 90 7 13 0 0 normal
-1 sprites/mono.png 8bpp 370 90 7 13 0 0 normal
-1 sprites/mono.png 8bpp 385 90 7 13 0 0 normal
-1 sprites/mono.png 8bpp 400 90 7 13 0 0 normal
-1 sprites/mono.png 8bpp 415 90 7 13 0 0 normal
-1 sprites/mono.png 8bpp 430 90 7 13 0 0 normal
-1 sprites/mono.png 8bpp 445 90 7 13 0 0 normal
-1 sprites/mono.png 8bpp 460 90 7 13 0 0 normal
-1 sprites/mono.png 8bpp 475 90 7 13 0 0 normal
-1 sprites/mono.png 8bpp 10 110 7 13 0 0 normal
-1 sprites/mono.png 8bpp 25 110 7 13 0 0 normal
-1 sprites/mono.png 8bpp 40 110 7 13 0 0 normal
-1 sprites/mono.png 8bpp 55 110 7 13 0 0 normal
-1 sprites/mono.png 8bpp 70 110 7 13 0 0 normal
-1 sprites/mono.png 8bpp 85 110 7 13 0 0 normal
-1 sprites/mono.png 8bpp 100 110 7 13 0 0 normal
-1 sprites/mono.png 8bpp 115 110 7 13 0 0 normal
-1 sprites/mono.png 8bpp 130 110 7 13 0 0 normal
-1 sprites/mono.png 8bpp 145 110 7 13 0 0 normal
-1 sprites/mono.png 8bpp 160 110 7 13 0 0 normal
-1 sprites/mono.png 8bpp 175 110 7 13 0 0 normal
-1 sprites/mono.png 8bpp 190 110 7 13 0 0 normal
-1 sprites/mono.png 8bpp 205 110 7 13 0 0 normal
-1 sprites/mono.png 8bpp 220 110 7 13 0 0 normal
-1 sprites/mono.png 8bpp 235 110 7 13 0 0 normal
-1 sprites/mono.png 8bpp 250 110 7 13 0 0 normal
-1 sprites/mono.png 8bpp 265 110 7 13 0 0 normal
-1 sprites/mono.png 8bpp 280 110 7 13 0 0 normal
-1 sprites/mono.png 8bpp 295 110 7 13 0 0 normal
-1 sprites/mono.png 8bpp 310 110 7 13 0 0 normal
-1 sprites/mono.png 8bpp 325 110 7 13 0 0 normal
-1 sprites/mono.png 8bpp 340 110 7 13 0 0 normal
-1 sprites/mono.png 8bpp 355 110 7 13 0 0 normal
-1 sprites/mono.png 8bpp 370 110 7 13 0 0 normal
-1 sprites/mono.png 8bpp 385 110 7 13 0 0 normal
-1 sprites/mono.png 8bpp 400 110 7 13 0 0 normal
-1 sprites/mono.png 8bpp 415 110 7 13 0 0 normal
-1 sprites/mono.png 8bpp 430 110 7 13 0 0 normal
-1 sprites/mono.png 8bpp 445 110 7 13 0 0 normal
-1 sprites/mono.png 8bpp 460 110 7 13 0 0 normal
-1 sprites/mono.png 8bpp 475 110 7 13 0 0 normal
-1 sprites/mono.png 8bpp 10 130 7 13 0 0 normal
-1 sprites/mono.png 8bpp 25 130 7 13 0 0 normal
-1 sprites/mono.png 8bpp 40 130 7 13 0 0 normal
-1 sprites/mono.png 8bpp 55 130 7 13 0 0 normal
-1 sprites/mono.png 8bpp 70 130 7 13 0 0 normal
-1 sprites/mono.png 8bpp 85 130 7 13 0 0 normal
-1 sprites/mono.png 8bpp 100 130 7 13 0 0 normal
-1 sprites/mono.png 8bpp 115 130 7 13 0 0 normal
-1 sprites/mono.png 8bpp 130 130 7 13 0 0 normal
-1 sprites/mono.png 8bpp 145 130 7 13 0 0 normal
-1 sprites/mono.png 8bpp 160 130 7 13 0 0 normal
-1 sprites/mono.png 8bpp 175 130 7 13 0 0 normal
-1 sprites/mono.png 8bpp 190 130 7 13 0 0 normal
-1 sprites/mono.png 8bpp 205 130 7 13 0 0 normal
-1 sprites/mono.png 8bpp 220 130 7 13 0 0 normal
-1 sprites/mono.png 8bpp 235 130 7 13 0 0 normal
-1 sprites/mono.png 8bpp 250 130 7 13 0 0 normal
-1 sprites/mono.png 8bpp 265 130 7 13 0 0 normal
-1 sprites/mono.png 8bpp 280 130 7 13 0 0 normal
-1 sprites/mono.png 8bpp 295 130 7 13 0 0 normal
-1 sprites/mono.png 8bpp 310 130 7 13 0 0 normal
-1 sprites/mono.png 8bpp 325 130 7 13 0 0 normal
-1 sprites/mono.png 8bpp 340 130 7 13 0 0 normal
-1 sprites/mono.png 8bpp 355 130 7 13 0 0 normal
-1 sprites/mono.png 8bpp 370 130 7 13 0 0 normal
-1 sprites/mono.png 8bpp 385 130 7 13 0 0 normal
-1 sprites/mono.png 8bpp 400 130 7 13 0 0 normal
-1 sprites/mono.png 8bpp 415 130 7 13 0 0 normal
-1 sprites/mono.png 8bpp 430 130 7 13 0 0 normal
-1 sprites/mono.png 8bpp 445 130 7 13 0 0 normal
-1 sprites/mono.png 8bpp 460 130 7 13 0 0 normal
-1 sprites/mono.png 8bpp 475 130 7 13 0 0 normal
-1 sprites/mono.png 8bpp 10 150 7 13 0 0 normal
-1 sprites/mono.png 8bpp 25 150 7 13 0 0 normal
-1 sprites/mono.png 8bpp 40 150 7 13 0 0 normal
-1 sprites/mono.png 8bpp 55 150 7 13 0 0 normal
-1 sprites/mono.png 8bpp 70 150 7 13 0 0 normal
-1 sprites/mono.png 8bpp 85 150 7 13 0 0 normal
-1 sprites/mono.png 8bpp 100 150 7 13 0 0 normal
-1 sprites/mono.png 8bpp 115 150 7 13 0 0 normal
-1 sprites/mono.png 8bpp 130 150 7 13 0 0 normal
-1 sprites/mono.png 8bpp 145 150 7 13 0 0 normal
-1 sprites/mono.png 8bpp 160 150 7 13 0 0 normal
-1 sprites/mono.png 8bpp 175 150 7 13 0 0 normal
-1 sprites/mono.png 8bpp 190 150 7 13 0 0 normal
-1 sprites/mono.png 8bpp 205 150 7 13 0 0 normal
-1 sprites/mono.png 8bpp 220 150 7 13 0 0 normal
-1 sprites/mono.png 8bpp 235 150 7 13 0 0 normal
-1 sprites/mono.png 8bpp 250 150 7 13 0 0 normal
-1 sprites/mono.png 8bpp 265 150 7 13 0 0 normal
-1 sprites/mono.png 8bpp 280 150 7 13 0 0 normal
-1 sprites/mono.png 8bpp 295 150 7 13 0 0 normal
-1 sprites/mono.png 8bpp 310 150 7 13 0 0 normal
-1 sprites/mono.png 8bpp 325 150 7 13 0 0 normal
-1 sprites/mono.png 8bpp 340 150 7 13 0 0 normal
-1 sprites/mono.png 8bpp 355 150 7 13 0 0 normal
-1 sprites/mono.png 8bpp 370 150 7 13 0 0 normal
-1 sprites/mono.png 8bpp 385 150 7 13 0 0 normal
-1 sprites/mono.png 8bpp 400 150 7 13 0 0 normal
-1 sprites/mono.png 8bpp 415 150 7 13 0 0 normal
-1 sprites/mono.png 8bpp 430 150 7 13 0 0 normal
-1 sprites/mono.png 8bpp 445 150 7 13 0 0 normal
-1 sprites/mono.png 8bpp 460 150 7 13 0 0 normal
-1 sprites/mono.png 8bpp 475 150 7 13 0 0 normal
//U+0178 Latin Capital Letter Y With Diaeresis (only needed for mono as it is in the base set, but relocated by some code)
-1 * 0 12 01 03 01 78 01
-1 sprites/mono.png 8bpp 370 230 7 13 0 -2 normal
-1 sprites/mono.png 8bpp 370 230 7 13 0 0 normal

Binary file not shown.

View File

@@ -1,7 +1,4 @@
FROM emscripten/emsdk:3.1.42
FROM emscripten/emsdk:3.1.28
COPY emsdk-liblzma.patch /
RUN cd /emsdk/upstream/emscripten && patch -p1 < /emsdk-liblzma.patch
COPY emsdk-nlohmann-json.patch /
RUN cd /emsdk/upstream/emscripten && patch -p1 < /emsdk-nlohmann-json.patch

View File

@@ -4,11 +4,10 @@ Please use docker with the supplied `Dockerfile` to build for emscripten.
It takes care of a few things:
- Use a version of emscripten we know works
- Patch in LibLZMA support (as this is not supported by upstream)
- Patch in nlohmann-json support (as this is not supported by upstream)
First, build the docker image by navigating in the folder this `README.md` is in, and executing:
```
docker build -t emsdk-openttd .
docker build -t emsdk-lzma .
```
Next, navigate back to the root folder of this project.
@@ -16,15 +15,15 @@ Next, navigate back to the root folder of this project.
Now we build the host tools first:
```
mkdir build-host
docker run -it --rm -v $(pwd):$(pwd) -u $(id -u):$(id -g) --workdir $(pwd)/build-host emsdk-openttd cmake .. -DOPTION_TOOLS_ONLY=ON
docker run -it --rm -v $(pwd):$(pwd) -u $(id -u):$(id -g) --workdir $(pwd)/build-host emsdk-openttd make -j$(nproc) tools
docker run -it --rm -v $(pwd):$(pwd) -u $(id -u):$(id -g) --workdir $(pwd)/build-host emsdk-lzma cmake .. -DOPTION_TOOLS_ONLY=ON
docker run -it --rm -v $(pwd):$(pwd) -u $(id -u):$(id -g) --workdir $(pwd)/build-host emsdk-lzma make -j$(nproc) tools
```
Finally, we build the actual game:
```
mkdir build
docker run -it --rm -v $(pwd):$(pwd) -u $(id -u):$(id -g) --workdir $(pwd)/build emsdk-openttd emcmake cmake .. -DHOST_BINARY_DIR=../build-host -DCMAKE_BUILD_TYPE=Release -DOPTION_USE_ASSERTS=OFF
docker run -it --rm -v $(pwd):$(pwd) -u $(id -u):$(id -g) --workdir $(pwd)/build emsdk-openttd emmake make -j$(nproc)
docker run -it --rm -v $(pwd):$(pwd) -u $(id -u):$(id -g) --workdir $(pwd)/build emsdk-lzma emcmake cmake .. -DHOST_BINARY_DIR=../build-host -DCMAKE_BUILD_TYPE=Release -DOPTION_USE_ASSERTS=OFF
docker run -it --rm -v $(pwd):$(pwd) -u $(id -u):$(id -g) --workdir $(pwd)/build emsdk-lzma emmake make -j$(nproc)
```
In the `build` folder you will now see `openttd.html`.

View File

@@ -1,5 +1,5 @@
# LibLZMA is a custom addition to the emscripten SDK, so it is possible
# someone patched their SDK. Test out if the SDK supports LibLZMA.
# LibLZMA is a recent addition to the emscripten SDK, so it is possible
# someone hasn't updated their SDK yet. Test out if the SDK supports LibLZMA.
include(CheckCXXSourceCompiles)
set(CMAKE_REQUIRED_FLAGS "-sUSE_LIBLZMA=1")

View File

@@ -1,21 +0,0 @@
# nlohmann-json is a custom addition to the emscripten SDK, so it is possible
# someone patched their SDK. Test out if the SDK supports nlohmann-json.
include(CheckCXXSourceCompiles)
set(CMAKE_REQUIRED_FLAGS "-sUSE_NLOHMANN_JSON=1")
check_cxx_source_compiles("
#include <nlohmann/json.hpp>
int main() { return 0; }"
nlohmann_json_FOUND
)
if (nlohmann_json_FOUND)
add_library(nlohmann_json INTERFACE IMPORTED)
set_target_properties(nlohmann_json PROPERTIES
INTERFACE_COMPILE_OPTIONS "-sUSE_NLOHMANN_JSON=1"
INTERFACE_LINK_LIBRARIES "-sUSE_NLOHMANN_JSON=1"
)
set(nlohmann_json_LIBRARY "nlohmann_json")
else()
message(WARNING "You are using an emscripten SDK without nlohmann-json support. Please apply 'emsdk-nlohmann_json.patch' to your local emsdk installation.")
endif()

View File

@@ -1,20 +1,30 @@
From 84d0e9112d5c87a714abd21ec8547921f46f37b5 Mon Sep 17 00:00:00 2001
From 90dd4d4c6b1cedec338ff5b375fffca93700f7bc Mon Sep 17 00:00:00 2001
From: milek7 <me@milek7.pl>
Date: Tue, 8 Dec 2020 01:03:31 +0100
Subject: [PATCH] Add liblzma port
---
src/settings.js | 4 ++
tools/ports/liblzma.py | 151 +++++++++++++++++++++++++++++++++++++++++
tools/settings.py | 1 +
3 files changed, 156 insertions(+)
create mode 100644 tools/ports/liblzma.py
Source: https://github.com/emscripten-core/emscripten/pull/12990
Modifed by OpenTTD to have the bare minimum needed to work. Otherwise there
are constantly conflicts when trying to apply this patch to different versions
of emsdk.
diff --git a/tools/settings.py b/tools/settings.py
--- a/tools/settings.py
+++ b/tools/settings.py
@@ -40,6 +40,7 @@ PORTS_SETTINGS = {
'USE_SDL_NET',
'USE_SDL_GFX',
'USE_LIBJPEG',
+ 'USE_LIBLZMA',
'USE_OGG',
'USE_REGAL',
'USE_BOOST_HEADERS',
diff --git a/src/settings.js b/src/settings.js
index f93140d..7b6bec9 100644
--- a/src/settings.js
+++ b/src/settings.js
@@ -1451,6 +1451,10 @@ var USE_GIFLIB = false;
@@ -1450,6 +1450,10 @@ var USE_GIFLIB = false;
// [compile+link]
var USE_LIBJPEG = false;
@@ -25,9 +35,9 @@ index f93140d..7b6bec9 100644
// 1 = use libpng from emscripten-ports
// [compile+link]
var USE_LIBPNG = false;
diff --git a/tools/ports/liblzma.py b/tools/ports/liblzma.py
new file mode 100644
index 0000000..6872a8b
--- /dev/null
+++ b/tools/ports/liblzma.py
@@ -0,0 +1,151 @@
@@ -41,8 +51,8 @@ index 0000000..6872a8b
+import logging
+from pathlib import Path
+
+VERSION = '5.4.2'
+HASH = '149f980338bea3d66de1ff5994b2b236ae1773135eda68b62b009df0c9dcdf5467f8cb2c06da95a71b6556d60bd3d21f475feced34d5dfdb80ee95416a2f9737'
+VERSION = '5.4.0'
+HASH = '29b2cd25bb5b234b329ffe9547692d2c29be393db9d8d4ce70a66dfdaebd54433e79a89d80c57e58cd4559c3c68b9845507d5fedf3eec1c528a81e3d9ddbd811'
+
+
+def needed(settings):
@@ -182,17 +192,3 @@ index 0000000..6872a8b
+#endif
+#define VERSION "5.4.0"
+'''
diff --git a/tools/settings.py b/tools/settings.py
index 10d6ca0..827e4a9 100644
--- a/tools/settings.py
+++ b/tools/settings.py
@@ -40,6 +40,7 @@ PORTS_SETTINGS = {
'USE_SDL_NET',
'USE_SDL_GFX',
'USE_LIBJPEG',
+ 'USE_LIBLZMA',
'USE_OGG',
'USE_REGAL',
'USE_BOOST_HEADERS',
--
2.34.1

View File

@@ -1,93 +0,0 @@
From 0edcedbea375e59f41df10acaee0c483d245751f Mon Sep 17 00:00:00 2001
From: Patric Stout <truebrain@openttd.org>
Date: Tue, 2 May 2023 21:48:08 +0200
Subject: [PATCH] Add nlohmmann-json port
---
src/settings.js | 4 ++++
tools/ports/nlohmann_json.py | 46 ++++++++++++++++++++++++++++++++++++
tools/settings.py | 1 +
3 files changed, 51 insertions(+)
create mode 100644 tools/ports/nlohmann_json.py
diff --git a/src/settings.js b/src/settings.js
index f93140d..39f4366 100644
--- a/src/settings.js
+++ b/src/settings.js
@@ -1483,6 +1483,10 @@ var USE_MPG123 = false;
// [compile+link]
var USE_FREETYPE = false;
+// 1 = use nlohmann-json from emscripten-ports
+// [compile+link]
+var USE_NLOHMANN_JSON = false;
+
// Specify the SDL_mixer version that is being linked against.
// Doesn't *have* to match USE_SDL, but a good idea.
// [compile+link]
diff --git a/tools/ports/nlohmann_json.py b/tools/ports/nlohmann_json.py
new file mode 100644
index 0000000..9e44297
--- /dev/null
+++ b/tools/ports/nlohmann_json.py
@@ -0,0 +1,46 @@
+# Copyright 2023 The Emscripten Authors. All rights reserved.
+# Emscripten is available under two separate licenses, the MIT license and the
+# University of Illinois/NCSA Open Source License. Both these licenses can be
+# found in the LICENSE file.
+
+import os
+
+TAG = '3.11.2'
+HASH = '99d9e6d588cabe8913a37437f86acb5d4b8b98bce12423e633c11c13b61e6c7f92ef8f9a4e991baa590329ee2b5c09ca9db9894bee1e54bdd68e8d09d83cc245'
+
+
+def needed(settings):
+ return settings.USE_NLOHMANN_JSON
+
+
+def get(ports, settings, shared):
+ ports.fetch_project('nlohmann_json',
+ f'https://github.com/nlohmann/json/releases/download/v{TAG}/include.zip',
+ sha512hash=HASH)
+
+ def create(final):
+ source_path = os.path.join(ports.get_dir(), 'nlohmann_json')
+ source_path_include = os.path.join(source_path, 'include', 'nlohmann')
+ ports.install_header_dir(source_path_include, 'nlohmann')
+
+ # write out a dummy cpp file, to create an empty library
+ # this is needed as emscripten ports expect this, even if it is not used
+ dummy_file = os.path.join(source_path, 'dummy.cpp')
+ shared.safe_ensure_dirs(os.path.dirname(dummy_file))
+ ports.write_file(dummy_file, 'static void dummy() {}')
+
+ ports.build_port(source_path, final, 'nlohmann_json', srcs=['dummy.cpp'])
+
+ return [shared.cache.get_lib('libnlohmann_json.a', create, what='port')]
+
+
+def clear(ports, settings, shared):
+ shared.cache.erase_lib('libnlohmann_json.a')
+
+
+def process_args(ports):
+ return []
+
+
+def show():
+ return 'nlohmann-json'
diff --git a/tools/settings.py b/tools/settings.py
index 10d6ca0..8536092 100644
--- a/tools/settings.py
+++ b/tools/settings.py
@@ -47,6 +47,7 @@ PORTS_SETTINGS = {
'USE_MPG123',
'USE_GIFLIB',
'USE_FREETYPE',
+ 'USE_NLOHMANN_JSON',
'SDL2_MIXER_FORMATS',
'SDL2_IMAGE_FORMATS',
'USE_SQLITE3',
--
2.34.1

View File

@@ -1,8 +1,8 @@
Module.arguments.push('-mnull', '-snull', '-vsdl');
Module.arguments.push('-mnull', '-snull', '-vsdl:relative_mode');
Module['websocket'] = { url: function(host, port, proto) {
/* openttd.org hosts a WebSocket proxy for the content service. */
if (host == "content.openttd.org" && port == 3978 && proto == "tcp") {
return "wss://bananas-server.openttd.org/";
return "wss://content.openttd.org/";
}
/* Everything else just tries to make a default WebSocket connection.
@@ -30,47 +30,46 @@ Module.preRun.push(function() {
Module.addRunDependency('syncfs');
FS.syncfs(true, function (err) {
/* FS.mkdir() tends to fail if parent folders do not exist. */
if (!FS.analyzePath(content_download_dir).exists) {
FS.mkdir(content_download_dir);
}
if (!FS.analyzePath(content_download_dir + '/baseset').exists) {
FS.mkdir(content_download_dir + '/baseset');
}
/* Check if the OpenGFX baseset is already downloaded. */
if (!FS.analyzePath(content_download_dir + '/baseset/opengfx-0.6.0.tar').exists) {
window.openttd_downloaded_opengfx = true;
FS.createPreloadedFile(content_download_dir + '/baseset', 'opengfx-0.6.0.tar', 'https://installer.cdn.openttd.org/emscripten/opengfx-0.6.0.tar', true, true);
} else {
/* Fake dependency increase, so the counter is stable. */
Module.addRunDependency('opengfx');
Module.removeRunDependency('opengfx');
}
Module.removeRunDependency('syncfs');
});
window.openttd_syncfs_shown_warning = false;
window.openttd_syncfs = function(callback) {
window.openttd_syncfs = function() {
/* Copy the virtual FS to the persistent storage. */
FS.syncfs(false, function (err) {
/* On first time, warn the user about the volatile behaviour of
* persistent storage. */
if (!window.openttd_syncfs_shown_warning) {
window.openttd_syncfs_shown_warning = true;
Module.onWarningFs();
}
FS.syncfs(false, function (err) { });
if (callback) callback();
});
/* On first time, warn the user about the volatile behaviour of
* persistent storage. */
if (!window.openttd_syncfs_shown_warning) {
window.openttd_syncfs_shown_warning = true;
Module.onWarningFs();
}
}
window.openttd_exit = function() {
window.openttd_syncfs(Module.onExit);
Module.onExit();
}
window.openttd_abort = function() {
window.openttd_syncfs(Module.onAbort);
}
window.openttd_bootstrap = function(current, total) {
Module.onBootstrap(current, total);
}
window.openttd_bootstrap_failed = function() {
Module.onBootstrapFailed();
}
window.openttd_bootstrap_reload = function() {
window.openttd_syncfs(function() {
Module.onBootstrapReload();
setTimeout(function() {
location.reload();
}, 1000);
});
Module.onAbort();
}
window.openttd_server_list = function() {
@@ -124,3 +123,11 @@ Module.preRun.push(function() {
return ret;
}
});
Module.postRun.push(function() {
/* Check if we downloaded OpenGFX; if so, sync the virtual FS back to the
* IDBFS so OpenGFX is stored persistent. */
if (window['openttd_downloaded_opengfx']) {
FS.syncfs(false, function (err) { });
}
});

View File

@@ -75,6 +75,7 @@
}
#message {
color: #101010;
height: 54px;
padding: 4px 4px;
}
@@ -143,8 +144,6 @@
})(),
setStatus: function(text) {
if (document.getElementById("canvas").style.display == "none") return;
var m = text.match(/^([^(]+)\((\d+(\.\d+)?)\/(\d+)\)$/);
if (m) {
@@ -172,27 +171,6 @@
document.getElementById("message").innerHTML = "Preparing game ...";
},
onBootstrap: function(current, total) {
document.getElementById("canvas").style.display = "none";
document.getElementById("title").innerHTML = "Missing base graphics";
document.getElementById("message").innerHTML = "OpenTTD is downloading base graphics.<br/><br/>" + current + " / " + total + " bytes downloaded.";
},
onBootstrapFailed: function(current, total) {
document.getElementById("canvas").style.display = "none";
document.getElementById("title").innerHTML = "Missing base graphics";
document.getElementById("message").innerHTML = "Failed to download base graphics.<br/>The game cannot start without base graphics.<br/><br/>Please check your Internet connection and/or the console log.<br/>Reload your browser to try again.";
},
onBootstrapReload: function() {
document.getElementById("canvas").style.display = "none";
document.getElementById("title").innerHTML = "Missing base graphics";
document.getElementById("message").innerHTML = "Downloading base graphics done.<br/><br/>Your browser will reload to start the game.";
},
onExit: function() {
document.getElementById("canvas").style.display = "none";

View File

@@ -5,8 +5,11 @@ set -e
# If you are building an unofficial branch of OpenTTD, please change the bundle
# ID in Info.plist and below.
#
# This uses the Xcode notarytool to perform notarization. You must set up a keychain
# profile called "openttd" using the "store-credentials" notarytool command beforehand.
# This uses `gon' to perform notarization:
#
# https://github.com/mitchellh/gon
#
# Follow the setup instructions on the gon site to install.
#
# Before executing this script, you must first configure CMake with at least the following
# parameters:
@@ -19,11 +22,19 @@ set -e
# This will sign the application with your signing certificate, and will enable
# the hardened runtime.
#
# You also need to set your Apple Developer username and password (app-specific password
# is recommended) in the AC_USERNAME and AC_PASSWORD environment variables.
#
# Then, ensuring you're in your build directory and that the "bundles" directory
# exists with a .dmg in it (clear out any old DMGs first), run:
#
# ../os/macosx/notarize.sh
if [ -z "${AC_USERNAME}" ]; then
echo AC_USERNAME not set, skipping notarization.
exit 0
fi;
dmg_filename=(bundles/*.dmg)
if [ "${dmg_filename}" = "bundles/*.dmg" ]; then
@@ -32,15 +43,24 @@ if [ "${dmg_filename}" = "bundles/*.dmg" ]; then
exit 1
fi;
xcrun notarytool submit ${dmg_filename[0]} --keychain-profile "openttd" --wait
cat <<EOF > notarize.json
{
"notarize": [
{
"path": "${dmg_filename[0]}",
"bundle_id": "org.openttd.openttd",
"staple": true
}
]
}
EOF
# Staple the ticket to the .dmg
xcrun stapler staple "${dmg_filename[0]}"
gon notarize.json
app_filename=(_CPack_Packages/*/Bundle/openttd-*/OpenTTD.app)
if [ "${app_filename}" = "_CPack_Packages/*/Bundle/openttd-*/OpenTTD.app" ]; then
echo "No .app found in the _CPack_Packages directory, skipping app stapling."
echo "No .app found in the _CPack_Packages directory, skipping stapling."
exit 0
fi;

8
os/os2/build_lang.cmd Normal file
View File

@@ -0,0 +1,8 @@
rem
rem Building language files...
rem
cd ..
strgen\strgen
for %%f in (lang\*.txt) do strgen\strgen %%f
cd strgen

1
os/os2/dedicated.cmd Normal file
View File

@@ -0,0 +1 @@
start /n /win openttd.exe -D %1 %2 %3 %4 %5 %6 %7 %8 %9

View File

@@ -0,0 +1,21 @@
@echo off
if "%1" == "" goto err
if "%2" == "" goto err
echo Downloading NoSound...
%1\wget http://binaries.openttd.org/installer/nosound-NOSOUND_VERSION.7z -O %2/baseset/nosound.7z
echo Extracting NoSound...
%1\7za x -y -O%2/baseset %2/baseset/nosound.7z
del %1\baseset\nosound.7z /n
echo NoSound has been installed.
goto end
:err
echo This batch file is only intended for use by the OpenTTD installer.
echo Please visit www.openttd.org for details on downloading NoSound.
:end

View File

@@ -0,0 +1,21 @@
@echo off
if "%1" == "" goto err
if "%2" == "" goto err
echo Downloading OpenGFX...
%1\wget http://binaries.openttd.org/installer/opengfx-OPENGFX_VERSION.7z -O %2/baseset/opengfx.7z
echo Extracting OpenGFX...
%1\7za x -y -O%2/baseset %2/baseset/opengfx.7z
del %1\baseset\opengfx.7z /n
echo OpenGFX has been installed.
goto end
:err
echo This batch file is only intended for use by the OpenTTD installer.
echo Please visit www.openttd.org for details on downloading OpenGFX.
:end

View File

@@ -0,0 +1,21 @@
@echo off
if "%1" == "" goto err
if "%2" == "" goto err
echo Downloading OpenSFX...
%1\wget http://binaries.openttd.org/installer/opensfx-OPENSFX_VERSION.7z -O %2/baseset/opensfx.7z
echo Extracting OpenSFX...
%1\7za x -y -O%2/baseset %2/baseset/opensfx.7z
del %1\baseset\opensfx.7z /n
echo OpenSFX has been installed.
goto end
:err
echo This batch file is only intended for use by the OpenTTD installer.
echo Please visit www.openttd.org for details on downloading OpenSFX.
:end

View File

@@ -0,0 +1,85 @@
@echo off
set OPENTTD_VERSION=1.11.0
set OPENSFX_VERSION=0.8.0
set NOSOUND_VERSION=0.8.0
set OPENGFX_VERSION=1.2.0
echo To make the installer, you must have the WarpIN compiler (wic) installed and in
echo your path, as well as wget and unzip. This file will download the various DLLs
echo to be distributed with the installer. If you do not want to continue, please
echo press CTRL-C now.
echo.
pause
cd ..\..\..\bundle
if not exist SDL12.dll goto getsdl
if not exist FSLib.dll goto getsdl
goto libc
:getsdl
wget http://www.os2site.com/sw/dev/sdl/sdl-1.2.10-bin-20080804.zip -O dl.zip
unzip -j dl.zip SDL/FSLib.dll SDL/SDL12.dll
del dl.zip
:libc
if exist libc063.dll goto gcc
wget ftp://ftp.netlabs.org/pub/gcc/libc-0.6.3-csd3.zip -O dl.zip
unzip -j dl.zip libc063.dll
del dl.zip
:gcc
if exist gcc442.dll goto tools
wget http://www.owenrudge.net/various/gcc442.zip -O dl.zip
unzip -j dl.zip gcc442.dll
del dl.zip
:tools
cd ..\os\os2\installer
if exist tools goto opengfx
mkdir tools
cd tools
wget http://download.smedley.info/wget-1.11.4-os2-20090315.zip -O dl.zip
unzip -j dl.zip wget/bin/wget.exe
del dl.zip
wget ftp://ftp.os4.su/moveton/p7zip-9.04-bin-os2.zip -O dl.zip
unzip -j dl.zip bin/7za.exe dll/ilibca.dll
del dl.zip
cd ..
:opengfx
if exist opengfx goto opensfx
mkdir opengfx
sed s/OPENGFX_VERSION/%OPENGFX_VERSION%/ < download_opengfx.cmd > opengfx\download_opengfx.cmd
copy remove_opengfx.cmd opengfx
:opensfx
if exist opensfx goto nosound
mkdir opensfx
sed s/OPENSFX_VERSION/%OPENSFX_VERSION%/ < download_opensfx.cmd > opensfx\download_opensfx.cmd
copy remove_opensfx.cmd opensfx
:nosound
mkdir nosound
sed s/NOSOUND_VERSION/%NOSOUND_VERSION%/ < download_nosound.cmd > nosound\download_nosound.cmd
copy remove_nosound.cmd nosound
:end
if exist openttd-%OPENTTD_VERSION%-os2.exe del openttd-%OPENTTD_VERSION%-os2.exe
wic -a openttd-%OPENTTD_VERSION%-os2.exe 1 -c../../../bundle -r * 2 -ctools -r * 3 -copengfx -r * 4 -copensfx -r * 5 -cnosound -r * -U -s openttd.wis

View File

@@ -0,0 +1,106 @@
<WARPIN>
<HEAD>
<TITLE>OpenTTD</TITLE>
<!-- Please remember to increment the build number for each package
when releasing a new stable version, particularly if there are
also release candidates sharing the major/minor versions:
e.g., 0\7\1\16279 for 0.7.1-RC1,
0\7\1\16365 for 0.7.1-RC2,
0\7\1\16540 for 0.7.1 final
-->
<PCK INDEX="1"
PACKAGEID="OpenTTD\OpenTTD\OpenTTD\1\0\0\18862"
TARGET="$(WARPIN_DEFAULTAPPSPATH)\OpenTTD"
SELECT
TITLE="OpenTTD"
LONGFILENAMES
BASE
>OpenTTD is an open source transport simulation game</PCK>
<PCK INDEX="2"
PACKAGEID="OpenTTD\OpenTTD\Downloader\1\0\0\18862"
TARGET="$(WARPIN_DEFAULTAPPSPATH)\OpenTTD"
SELECT
TITLE="Download tools"
REQUIRES=1
FIXED
>Tools required for downloading the OpenGFX/SFX packs</PCK>
<PCK INDEX="3"
PACKAGEID="OpenTTD\OpenTTD\OpenGFX\1\0\0\18862"
TARGET="$(WARPIN_DEFAULTAPPSPATH)\OpenTTD"
SELECT
TITLE="OpenGFX"
LONGFILENAMES
REQUIRES=2
EXECUTE="$(3)\download_opengfx.cmd | $(1) $(/1)"
DEEXECUTE="$(3)\remove_opengfx.cmd | $(1) $(/1)"
FIXED
>Downloads the OpenGFX graphics pack for OpenTTD</PCK>
<PCK INDEX="4"
PACKAGEID="OpenTTD\OpenTTD\OpenSFX\1\0\0\18862"
TARGET="$(WARPIN_DEFAULTAPPSPATH)\OpenTTD"
SELECT
TITLE="OpenSFX"
LONGFILENAMES
REQUIRES=2
EXECUTE="$(4)\download_opensfx.cmd | $(1) $(/1)"
DEEXECUTE="$(4)\remove_opensfx.cmd | $(1) $(/1)"
FIXED
>Downloads the OpenSFX sound effects pack for OpenTTD</PCK>
<PCK INDEX="5"
PACKAGEID="OpenTTD\OpenTTD\NoSound\1\0\0\18862"
TARGET="$(WARPIN_DEFAULTAPPSPATH)\OpenTTD"
SELECT
TITLE="NoSound"
LONGFILENAMES
REQUIRES=2
EXECUTE="$(5)\download_nosound.cmd | $(1) $(/1)"
DEEXECUTE="$(5)\remove_nosound.cmd | $(1) $(/1)"
FIXED
>Downloads the NoSound pack for OpenTTD, to disable sound effects</PCK>
</HEAD>
<BODY>
<!-- page 1: introductory page -->
<PAGE INDEX="1" TYPE="README">
<NEXTBUTTON TARGET=2>~Next</NEXTBUTTON>
<README EXTRACTFROMPCK="1">README.md</README>
<TEXT>Welcome to the OpenTTD installer. This program will install OpenTTD 1.0 on your system. Before we begin the installation process, please take a moment to read the following document.
Select "Next" to continue, or "Cancel" to abort installation.</TEXT>
</PAGE>
<!-- page 2: licence page -->
<PAGE INDEX="2" TYPE="README">
<NEXTBUTTON TARGET=3>~Next</NEXTBUTTON>
<README EXTRACTFROMPCK="1">COPYING.md</README>
<TEXT>OpenTTD is licenced under the GNU General Public License. The text of the licence is below.
Select "Next" if you agree to this licence.
Select "Cancel" to abort installation.</TEXT>
</PAGE>
<!-- The TYPE=CONTAINER will list the packages which can be installed. -->
<PAGE INDEX="3" TYPE="CONTAINER">
<NEXTBUTTON TARGET="4">~Next</NEXTBUTTON>
<TEXT>On this page, you may choose which components to install. If you don't own Transport Tycoon Deluxe, you will need to download OpenGFX (3MiB) and OpenSFX (10MiB).</TEXT>
</PAGE>
<!-- Display another TEXT page to inform the user
that installation will begin. We use the TARGET=0
with the NEXTBUTTON tag which starts installation. -->
<PAGE INDEX="4" TYPE="TEXT">
<NEXTBUTTON TARGET="0">I~nstall</NEXTBUTTON>
<TEXT>
Press "Install" to begin installing OpenTTD.</TEXT>
</PAGE>
</BODY>
</WARPIN>

View File

@@ -0,0 +1,15 @@
@echo off
if "%1" == "" goto err
echo Removing NoSound...
del %1\baseset\nosound\*.* /n
rmdir %1\baseset\nosound
echo NoSound has been removed.
goto end
:err
echo This batch file is only intended for use by the OpenTTD installer.
:end

View File

@@ -0,0 +1,15 @@
@echo off
if "%1" == "" goto err
echo Removing OpenGFX...
del %1\baseset\opengfx\*.* /n
rmdir %1\baseset\opengfx
echo OpenGFX has been removed.
goto end
:err
echo This batch file is only intended for use by the OpenTTD installer.
:end

View File

@@ -0,0 +1,15 @@
@echo off
if "%1" == "" goto err
echo Removing OpenSFX...
del %1\baseset\opensfx\*.* /n
rmdir %1\baseset\opensfx
echo OpenSFX has been removed.
goto end
:err
echo This batch file is only intended for use by the OpenTTD installer.
:end

64
os/os2/openttd.wpj Normal file
View File

@@ -0,0 +1,64 @@
40
projectIdent
0
VpeMain
1
WRect
0
0
10304
10020
2
MProject
3
MCommand
15
svn_version.cmd
4
MCommand
0
2
5
WFileName
17
..\..\openttd.tgt
6
WFileName
23
..\..\strgen\strgen.tgt
7
WVList
2
8
VComponent
9
WRect
0
0
5696
4240
0
0
10
WFileName
17
..\..\openttd.tgt
0
0
11
VComponent
12
WRect
688
680
5696
4240
0
0
13
WFileName
23
..\..\strgen\strgen.tgt
0
1
8

30
os/os2/svn_version.cmd Normal file
View File

@@ -0,0 +1,30 @@
@echo off
echo Running SVN version detection script...
rem
rem Requires subversion (`svnversion') to be installed
rem
cd ..\..
if not "%RELEASE%"=="" goto forcerelease
if not exist .svn goto nosvn
svnversion -n . > os\os2\svnver.tmp
if not "%ERRORLEVEL%"=="0" goto nosvn
copy os\os2\svnver1.c+os\os2\svnver.tmp+os\os2\svnver2.c rev.c /a /y > nul 2> nul
goto end
:forcerelease
echo Forcing release string "%RELEASE%"...
echo const char _openttd_revision[] = "%RELEASE%"; > rev.c
echo const int _revision_number = 0; >> rev.c
goto end
:nosvn
echo Error executing `svnversion' or no SVN data detected
echo const char _openttd_revision[] = "norev000"; > rev.c
echo const int _revision_number = 0; >> rev.c
goto end
:end
cd os\os2
del svnver.tmp > nul 2> nul
rem end

3
os/os2/svnver1.c Normal file
View File

@@ -0,0 +1,3 @@
/* rev.c part #1 for OS/2 - ensure no newline at end of file! */
const char _openttd_revision[] = "r

4
os/os2/svnver2.c Normal file
View File

@@ -0,0 +1,4 @@
";
const int _revision_number = 0;
/* rev.c part 2 for OS/2 - ensure no newline at start of file! */

View File

@@ -4,7 +4,7 @@ class Regression extends AIInfo {
function GetShortName() { return "REGR"; }
function GetDescription() { return "This runs regression-tests on some commands. On the same map the result should always be the same."; }
function GetVersion() { return 1; }
function GetAPIVersion() { return "14"; }
function GetAPIVersion() { return "13"; }
function GetDate() { return "2007-03-18"; }
function CreateInstance() { return "Regression"; }
function UseAsRandomAI() { return false; }

View File

@@ -1107,7 +1107,6 @@ function Regression::Rail()
print(" IsRailTile(): " + AIRail.IsRailTile(33411));
print(" BuildRailDepot(): " + AIRail.BuildRailDepot(0, 1));
print(" BuildRailDepot(): " + AIRail.BuildRailDepot(33411, 33411));
print(" BuildRailDepot(): " + AIRail.BuildRailDepot(33411, 33410));
print(" BuildRailDepot(): " + AIRail.BuildRailDepot(33411, 33414));
print(" BuildRailDepot(): " + AIRail.BuildRailDepot(33411, 33412));
print(" GetRailDepotFrontTile(): " + AIRail.GetRailDepotFrontTile(33411));
@@ -1204,7 +1203,6 @@ function Regression::Road()
print(" IsRoadTile(): " + AIRoad.IsRoadTile(33411));
print(" BuildRoadDepot(): " + AIRoad.BuildRoadDepot(0, 1));
print(" BuildRoadDepot(): " + AIRoad.BuildRoadDepot(33411, 33411));
print(" BuildRoadDepot(): " + AIRoad.BuildRoadDepot(33411, 33410));
print(" BuildRoadDepot(): " + AIRoad.BuildRoadDepot(33411, 33414));
print(" BuildRoadDepot(): " + AIRoad.BuildRoadDepot(33411, 33412));
print(" HasRoadType(Road): " + AIRoad.HasRoadType(33411, AIRoad.ROADTYPE_ROAD));

View File

@@ -88,21 +88,21 @@
abs( 21): 21
--AIBase--
Rand(): 2113409458
Rand(): 2000129769
Rand(): 1788051963
Rand(): -54346916
Rand(): -937374575
Rand(): 823953997
RandRange(0): 0
RandRange(0): 0
RandRange(0): 0
RandRange(1): 0
RandRange(1): 0
RandRange(1): 0
RandRange(2): 0
RandRange(2): 0
RandRange(2): 1
RandRange(1000000): 338687
RandRange(1000000): 274895
RandRange(1000000): 217539
RandRange(2): 1
RandRange(2): 1
RandRange(1000000): 966676
RandRange(1000000): 289525
RandRange(1000000): 170283
Chance(1, 2): false
Chance(1, 2): true
Chance(1, 2): false
@@ -420,144 +420,144 @@
1098 => 46116
1099 => 46158
Randomize ListDump:
1 => 1667006376
2 => 814756458
1000 => 2792131700
1001 => 3417650573
1002 => 1856129988
1003 => 1800973341
1004 => 4197962148
1005 => 2463509731
1006 => 2312121797
1007 => 1357932132
1008 => 1603755907
1009 => 1718096015
1010 => 3850074449
1011 => 2711130211
1012 => 2371249199
1013 => 881020769
1014 => 3366660077
1015 => 808768948
1016 => 3035331984
1017 => 2813590961
1018 => 2745021820
1019 => 3075151719
1020 => 2553774560
1021 => 4267762096
1022 => 3863175846
1023 => 4198397908
1024 => 817599906
1025 => 3149240362
1026 => 3003005979
1027 => 1214815375
1028 => 3784363817
1029 => 3181864540
1030 => 325341059
1031 => 1011889231
1032 => 3142617173
1033 => 1197220206
1034 => 4060510885
1035 => 3596342467
1036 => 219406671
1037 => 3695508783
1038 => 2823603997
1039 => 2625659720
1040 => 4113498476
1041 => 1125297786
1042 => 671905104
1043 => 1231077134
1044 => 892292375
1045 => 2441486929
1046 => 1804593432
1047 => 2536560053
1048 => 1896826021
1049 => 1672512966
1051 => 977884299
1052 => 681948608
1053 => 3853505792
1054 => 4118706553
1055 => 3581698138
1056 => 3073782502
1057 => 1084753140
1058 => 2266056077
1059 => 1239805090
1060 => 1183528423
1061 => 501361238
1062 => 66542127
1063 => 775638990
1064 => 1111474321
1065 => 3465462871
1066 => 2317535037
1067 => 878310882
1068 => 2231368582
1069 => 2353633007
1070 => 179259867
1071 => 1322707275
1072 => 1474105363
1073 => 619989187
1074 => 3221603092
1075 => 2400416540
1076 => 3926392705
1077 => 1122978123
1078 => 3266139701
1079 => 2948697341
1080 => 3262493501
1081 => 2200252596
1082 => 4091101485
1083 => 2797438343
1084 => 2608201933
1085 => 2577605442
1086 => 1178956760
1087 => 3047709109
1088 => 1065186815
1089 => 841440515
1090 => 842182476
1091 => 289059855
1092 => 2114106829
1093 => 436435334
1094 => 111052607
1095 => 81827083
1096 => 1961213887
1097 => 1374385392
1098 => 3255118186
1099 => 2245402931
1 => -200078348
2 => -29799264
1000 => 1630721656
1001 => 959306175
1002 => 1527421791
1003 => 1259692483
1004 => -1289244298
1005 => -1572996668
1006 => -2069479746
1007 => -1819131606
1008 => -1007163964
1009 => -1185394870
1010 => -1471365065
1011 => 364354366
1012 => -1478084253
1013 => 405281367
1014 => -11170062
1015 => 156767750
1016 => 1288924796
1017 => 1796884876
1018 => -1947073702
1019 => -1999614238
1020 => -231292809
1021 => 966621566
1022 => -606766557
1023 => -1138727825
1024 => -749544262
1025 => 2004771271
1026 => 686734186
1027 => 923274744
1028 => -1672035149
1029 => -1642064950
1030 => 1363389551
1031 => -559500928
1032 => 1656196991
1033 => 1655354425
1034 => -1027156689
1035 => 1952644328
1036 => 1217870217
1037 => 242274100
1038 => 201816080
1039 => 2127464758
1040 => 446043650
1041 => -319728455
1042 => 204701002
1043 => -571265398
1044 => -1422217131
1045 => -391208397
1046 => -1822628371
1047 => -1499755350
1048 => -1422137641
1049 => 1621693134
1051 => -1428728134
1052 => -147587573
1053 => 681719500
1054 => 1172011190
1055 => -1834344882
1056 => 1157634586
1057 => 1902133676
1058 => -1967780161
1059 => -1618025531
1060 => -810220453
1061 => 1582854921
1062 => -410004643
1063 => 1159917159
1064 => -1377804984
1065 => -738843914
1066 => -1578756103
1067 => -464090986
1068 => 1711504679
1069 => 545330655
1070 => 379462570
1071 => 514511099
1072 => -1813251176
1073 => 1424958266
1074 => -825255131
1075 => 539054595
1076 => -1764192010
1077 => -1243277769
1078 => 2017874281
1079 => -1972353607
1080 => 1879761467
1081 => 1638986560
1082 => -1832287507
1083 => -492411882
1084 => 658940812
1085 => -1044199400
1086 => 1586504918
1087 => -125492611
1088 => -1562883174
1089 => -1013778441
1090 => 1560228607
1091 => -550265689
1092 => 524767105
1093 => -713387661
1094 => 1425927738
1095 => 942653932
1096 => 1233220698
1097 => 1313602368
1098 => -140318584
1099 => 1199179892
KeepTop(10):
1 => 1667006376
2 => 814756458
1000 => 2792131700
1001 => 3417650573
1002 => 1856129988
1003 => 1800973341
1004 => 4197962148
1005 => 2463509731
1006 => 2312121797
1007 => 1357932132
1 => -200078348
2 => -29799264
1000 => 1630721656
1001 => 959306175
1002 => 1527421791
1003 => 1259692483
1004 => -1289244298
1005 => -1572996668
1006 => -2069479746
1007 => -1819131606
KeepBottom(8):
1000 => 2792131700
1001 => 3417650573
1002 => 1856129988
1003 => 1800973341
1004 => 4197962148
1005 => 2463509731
1006 => 2312121797
1007 => 1357932132
1000 => 1630721656
1001 => 959306175
1002 => 1527421791
1003 => 1259692483
1004 => -1289244298
1005 => -1572996668
1006 => -2069479746
1007 => -1819131606
RemoveBottom(2):
1000 => 2792131700
1001 => 3417650573
1002 => 1856129988
1003 => 1800973341
1004 => 4197962148
1005 => 2463509731
1000 => 1630721656
1001 => 959306175
1002 => 1527421791
1003 => 1259692483
1004 => -1289244298
1005 => -1572996668
RemoveTop(2):
1002 => 1856129988
1003 => 1800973341
1004 => 4197962148
1005 => 2463509731
1002 => 1527421791
1003 => 1259692483
1004 => -1289244298
1005 => -1572996668
RemoveList({1003, 1004}):
1002 => 1856129988
1005 => 2463509731
1002 => 1527421791
1005 => -1572996668
KeepList({1003, 1004, 1005}):
1005 => 2463509731
1005 => -1572996668
AddList({1005, 4000, 4001, 4002}):
1005 => 1005
4000 => 8000
@@ -588,7 +588,7 @@ ERROR: IsEnd() is invalid as Begin() is never called
SetName(): false
GetLastErrorString(): ERR_NAME_IS_NOT_UNIQUE
GetName(): Regression
GetPresidentName(): F. Gribble
GetPresidentName(): E. McAlpine
SetPresidentName(): true
GetPresidentName(): Regression AI
GetBankBalance(): 100000
@@ -1388,7 +1388,7 @@ ERROR: IsEnd() is invalid as Begin() is never called
GetReliability(): 75
GetMaxSpeed(): 64
GetPrice(): 8203
GetMaxAge(): 5479
GetMaxAge(): 5490
GetRunningCost(): 820
GetPower(): 300
GetWeight(): 47
@@ -1532,7 +1532,7 @@ ERROR: IsEnd() is invalid as Begin() is never called
GetReliability(): 80
GetMaxSpeed(): 112
GetPrice(): 15234
GetMaxAge(): 7671
GetMaxAge(): 7686
GetRunningCost(): 1968
GetPower(): 1000
GetWeight(): 131
@@ -1550,7 +1550,7 @@ ERROR: IsEnd() is invalid as Begin() is never called
GetReliability(): 84
GetMaxSpeed(): 128
GetPrice(): 22265
GetMaxAge(): 7305
GetMaxAge(): 7320
GetRunningCost(): 2296
GetPower(): 1200
GetWeight(): 162
@@ -3476,7 +3476,7 @@ ERROR: IsEnd() is invalid as Begin() is never called
GetReliability(): 78
GetMaxSpeed(): 56
GetPrice(): 4921
GetMaxAge(): 4383
GetMaxAge(): 4392
GetRunningCost(): 426
GetPower(): 90
GetWeight(): 10
@@ -3602,7 +3602,7 @@ ERROR: IsEnd() is invalid as Begin() is never called
GetReliability(): 77
GetMaxSpeed(): 48
GetPrice(): 4429
GetMaxAge(): 5479
GetMaxAge(): 5490
GetRunningCost(): 421
GetPower(): 120
GetWeight(): 9
@@ -3656,7 +3656,7 @@ ERROR: IsEnd() is invalid as Begin() is never called
GetReliability(): 92
GetMaxSpeed(): 48
GetPrice(): 4716
GetMaxAge(): 5479
GetMaxAge(): 5490
GetRunningCost(): 421
GetPower(): 120
GetWeight(): 9
@@ -3764,7 +3764,7 @@ ERROR: IsEnd() is invalid as Begin() is never called
GetReliability(): 98
GetMaxSpeed(): 48
GetPrice(): 4511
GetMaxAge(): 5479
GetMaxAge(): 5490
GetRunningCost(): 421
GetPower(): 120
GetWeight(): 9
@@ -3818,7 +3818,7 @@ ERROR: IsEnd() is invalid as Begin() is never called
GetReliability(): 97
GetMaxSpeed(): 48
GetPrice(): 4306
GetMaxAge(): 5479
GetMaxAge(): 5490
GetRunningCost(): 421
GetPower(): 120
GetWeight(): 9
@@ -3872,7 +3872,7 @@ ERROR: IsEnd() is invalid as Begin() is never called
GetReliability(): 87
GetMaxSpeed(): 48
GetPrice(): 4388
GetMaxAge(): 5479
GetMaxAge(): 5490
GetRunningCost(): 421
GetPower(): 120
GetWeight(): 9
@@ -3926,7 +3926,7 @@ ERROR: IsEnd() is invalid as Begin() is never called
GetReliability(): 97
GetMaxSpeed(): 48
GetPrice(): 4675
GetMaxAge(): 5479
GetMaxAge(): 5490
GetRunningCost(): 421
GetPower(): 120
GetWeight(): 9
@@ -3980,7 +3980,7 @@ ERROR: IsEnd() is invalid as Begin() is never called
GetReliability(): 98
GetMaxSpeed(): 48
GetPrice(): 4839
GetMaxAge(): 5479
GetMaxAge(): 5490
GetRunningCost(): 421
GetPower(): 120
GetWeight(): 9
@@ -4034,7 +4034,7 @@ ERROR: IsEnd() is invalid as Begin() is never called
GetReliability(): 97
GetMaxSpeed(): 48
GetPrice(): 4962
GetMaxAge(): 5479
GetMaxAge(): 5490
GetRunningCost(): 421
GetPower(): 120
GetWeight(): 9
@@ -4088,7 +4088,7 @@ ERROR: IsEnd() is invalid as Begin() is never called
GetReliability(): 82
GetMaxSpeed(): 48
GetPrice(): 4593
GetMaxAge(): 5479
GetMaxAge(): 5490
GetRunningCost(): 421
GetPower(): 120
GetWeight(): 9
@@ -4142,7 +4142,7 @@ ERROR: IsEnd() is invalid as Begin() is never called
GetReliability(): 76
GetMaxSpeed(): 48
GetPrice(): 5947
GetMaxAge(): 5479
GetMaxAge(): 5490
GetRunningCost(): 421
GetPower(): 120
GetWeight(): 9
@@ -5060,7 +5060,7 @@ ERROR: IsEnd() is invalid as Begin() is never called
GetReliability(): 99
GetMaxSpeed(): 24
GetPrice(): 30468
GetMaxAge(): 10958
GetMaxAge(): 10980
GetRunningCost(): 2296
GetPower(): -1
GetWeight(): -1
@@ -5096,7 +5096,7 @@ ERROR: IsEnd() is invalid as Begin() is never called
GetReliability(): 88
GetMaxSpeed(): 32
GetPrice(): 18281
GetMaxAge(): 10958
GetMaxAge(): 10980
GetRunningCost(): 1476
GetPower(): -1
GetWeight(): -1
@@ -5186,7 +5186,7 @@ ERROR: IsEnd() is invalid as Begin() is never called
GetReliability(): 81
GetMaxSpeed(): 24
GetPrice(): 24375
GetMaxAge(): 10958
GetMaxAge(): 10980
GetRunningCost(): 2460
GetPower(): -1
GetWeight(): -1
@@ -5258,7 +5258,7 @@ ERROR: IsEnd() is invalid as Begin() is never called
GetReliability(): 58
GetMaxSpeed(): 236
GetPrice(): 28710
GetMaxAge(): 7305
GetMaxAge(): 7320
GetRunningCost(): 2390
GetPower(): -1
GetWeight(): -1
@@ -5276,7 +5276,7 @@ ERROR: IsEnd() is invalid as Begin() is never called
GetReliability(): 95
GetMaxSpeed(): 236
GetPrice(): 30761
GetMaxAge(): 8766
GetMaxAge(): 8784
GetRunningCost(): 2812
GetPower(): -1
GetWeight(): -1
@@ -5330,7 +5330,7 @@ ERROR: IsEnd() is invalid as Begin() is never called
GetReliability(): 77
GetMaxSpeed(): 236
GetPrice(): 30761
GetMaxAge(): 10958
GetMaxAge(): 10980
GetRunningCost(): 2756
GetPower(): -1
GetWeight(): -1
@@ -7498,7 +7498,6 @@ ERROR: IsEnd() is invalid as Begin() is never called
BuildRailDepot(): false
BuildRailDepot(): false
BuildRailDepot(): true
BuildRailDepot(): true
BuildRailDepot(): false
GetRailDepotFrontTile(): 33412
IsBuildable(): false
@@ -7592,12 +7591,11 @@ ERROR: IsEnd() is invalid as Begin() is never called
BuildRoadDepot(): false
BuildRoadDepot(): false
BuildRoadDepot(): true
BuildRoadDepot(): true
BuildRoadDepot(): false
HasRoadType(Road): true
HasRoadType(Tram): false
GetLastError(): 259
GetLastErrorString(): ERR_ALREADY_BUILT
GetLastError(): 260
GetLastErrorString(): ERR_AREA_NOT_CLEAR
GetErrorCategory(): 1
IsRoadTile(): false
GetRoadDepotFrontTile(): 33412
@@ -9313,7 +9311,7 @@ ERROR: IsEnd() is invalid as Begin() is never called
IsStoppedInDepot(): false
--Accounting--
GetCosts(): -5947
Should be: -5946
Should be: -5947
GetName(): Road Vehicle #1
SetName(): true
GetName(): MyVehicleName
@@ -9322,12 +9320,12 @@ ERROR: IsEnd() is invalid as Begin() is never called
GetLocation(): 33417
GetEngineType(): 153
GetUnitNumber(): 1
GetAge(): 1
GetMaxAge(): 5479
GetAgeLeft(): 5478
GetAge(): 0
GetMaxAge(): 5490
GetAgeLeft(): 5490
GetCurrentSpeed(): 7
GetRunningCost(): 421
GetProfitThisYear(): -1
GetProfitThisYear(): 0
GetProfitLastYear(): 0
GetCurrentValue(): 5947
GetVehicleType(): 1
@@ -9337,7 +9335,7 @@ ERROR: IsEnd() is invalid as Begin() is never called
IsInDepot(): false
GetNumWagons(): 1
GetWagonEngineType(): 153
GetWagonAge(): 1
GetWagonAge(): 0
GetLength(): 8
GetOwner(): 1
BuildVehicle(): 14
@@ -9410,23 +9408,23 @@ ERROR: IsEnd() is invalid as Begin() is never called
14 => 1
12 => 1
Age ListDump:
17 => 1
16 => 1
14 => 1
13 => 1
12 => 1
17 => 0
16 => 0
14 => 0
13 => 0
MaxAge ListDump:
16 => 10958
14 => 10958
17 => 7305
13 => 5479
12 => 5479
16 => 10980
14 => 10980
17 => 7320
13 => 5490
12 => 5490
AgeLeft ListDump:
16 => 10958
14 => 10958
17 => 7305
13 => 5479
12 => 5478
16 => 10979
14 => 10979
17 => 7319
13 => 5489
12 => 5489
CurrentSpeed ListDump:
12 => 27
17 => 0

Binary file not shown.

View File

@@ -4,7 +4,7 @@ class StationList extends AIInfo {
function GetShortName() { return "REGS"; }
function GetDescription() { return "This runs stationlist-tests on some commands. On the same map the result should always be the same."; }
function GetVersion() { return 1; }
function GetAPIVersion() { return "14"; }
function GetAPIVersion() { return "13"; }
function GetDate() { return "2007-03-18"; }
function CreateInstance() { return "StationList"; }
function UseAsRandomAI() { return false; }

View File

@@ -1,6 +1,5 @@
add_subdirectory(catch2)
add_subdirectory(fmt)
add_subdirectory(icu)
add_subdirectory(md5)
add_subdirectory(squirrel)
add_subdirectory(opengl)
add_subdirectory(os2)

View File

@@ -1,3 +1,3 @@
The files in this directory are not licensed under the same terms as the
rest of OpenTTD. Licensing details can be found in OpenTTD's README.md
rest of OpenTTD. Licensing details can be found in OpenTTD's readme.txt
and in this directory or subdirectories as well.

View File

@@ -1,3 +0,0 @@
add_files(
catch.hpp
)

View File

@@ -1,23 +0,0 @@
Boost Software License - Version 1.0 - August 17th, 2003
Permission is hereby granted, free of charge, to any person or organization
obtaining a copy of the software and accompanying documentation covered by
this license (the "Software") to use, reproduce, display, distribute,
execute, and transmit the Software, and to prepare derivative works of the
Software, and to permit third-parties to whom the Software is furnished to
do so, all subject to the following:
The copyright notices in the Software and this entire statement, including
the above license grant, this restriction and the following disclaimer,
must be included in all copies of the Software, in whole or in part, and
all derivative works of the Software, unless such copies or derivative
works are solely in the form of machine-executable object code generated by
a source language processor.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE, TITLE AND NON-INFRINGEMENT. IN NO EVENT
SHALL THE COPYRIGHT HOLDERS OR ANYONE DISTRIBUTING THE SOFTWARE BE LIABLE
FOR ANY DAMAGES OR OTHER LIABILITY, WHETHER IN CONTRACT, TORT OR OTHERWISE,
ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
DEALINGS IN THE SOFTWARE.

File diff suppressed because it is too large Load Diff

View File

@@ -1,9 +1,5 @@
add_files(
chrono.h
core.h
format.h
format-inl.h
ostream.h
ranges.h
std.h
)

View File

@@ -1,4 +1,4 @@
Copyright (c) 2012 - present, Victor Zverovich and {fmt} contributors
Copyright (c) 2012 - present, Victor Zverovich
Permission is hereby granted, free of charge, to any person obtaining
a copy of this software and associated documentation files (the

File diff suppressed because it is too large Load Diff

3363
src/3rdparty/fmt/core.h vendored

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

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