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

Compare commits

..

2254 Commits

Author SHA1 Message Date
rubidium42
369983846a Update: Changelog for 15.0-beta2 (#13738)
Co-authored-by: Michael Lutz <michi@icosahedron.de>
2025-04-13 17:45:41 +02:00
frosch
7157e96664 Remove: Drop support for UCS2/UTF-16 encoded scripts. (#13992) 2025-04-13 15:52:01 +02:00
frosch
7f82b181da Add #12939: [NewGRF] Add road-/tram-/rail-type variable 0x45 to get mutual road-/tram-/rail-type on same tile. (#13934) 2025-04-13 13:23:10 +02:00
translators
04c41bf731 Update: Translations from eints
galician: 63 changes by pvillaverde
2025-04-13 05:04:53 +00:00
Richard Wheeler
a93087ec5c Fix #13980: Allow diagonal selection for road convert (#13983)
Fixes #13980
2025-04-12 18:50:11 +01:00
Kuhnovic
319a657454 Fix 42fbcec76f: Fixed accidental changes to autorail/road AI behavior (#13968)
* Revert 4bd72e4a78, Fix #11528: Starting autorail dragging from existing track tiles resulted in adding non-continuous tracks.

* Fix 4bd72e4a78: Fixed accidental changes to autorail/road AI behavior
2025-04-12 16:09:10 +02:00
34b1f7a992 Fix: Make GrfMsg() behave like Debug() when not loading NewGRFs. (#13991)
GrfMsg() outputs the currently loading NewGRF and current line/sprite number. This is invalid when not NewGRFs are not actually being loaded.
2025-04-12 13:05:33 +01:00
1744156149 Change: Queue content ID information requests. (#13990)
Instead of requesting content one ID at a time, queue them up to be requested in one go.

* Avoids sending many small requests.
* Avoids sending requests for content which is likely to be arriving anyway.
2025-04-12 12:50:36 +01:00
translators
c29ef5cfc2 Update: Translations from eints
english (us): 1 change by 2TallTyler
2025-04-12 04:44:34 +00:00
3347919fb2 Codechange: Remove empty destructor and use member init for ClientNetworkContentSocketHandler. 2025-04-11 23:08:59 +01:00
20d83677eb Codechange: Use unique_ptr to manage ContentInfo lifetime.
Removes manually managed new/delete.
2025-04-11 23:08:59 +01:00
7b31f26611 Codechange: Pass ContentInfo by reference.
Many functions take a ContentInfo pointer, but do not check for nullptr.
Pass by reference instead to assure it is present.
2025-04-11 23:08:59 +01:00
frosch
1cfad1474a Codechange: Rename _cur to _cur_gps. 2025-04-11 22:11:28 +02:00
frosch
e89be12ebb Codechange: Rename _library to _ft_library. 2025-04-11 22:11:28 +02:00
frosch
b0d678e375 Codechange: Rename _ignore_restrictions to _ignore_industry_restrictions. 2025-04-11 22:11:28 +02:00
frosch
c9c9973884 Codechange: Rename _circle_size to _setting_circle_size. 2025-04-11 22:11:28 +02:00
frosch
35cd05b27d Codechange: Rename _current_data to _current_gamestrings_data. 2025-04-11 22:11:28 +02:00
frosch
ae51308615 Codechange: Remove unused extern declarations. 2025-04-11 22:11:28 +02:00
frosch
e2ebf3a0f3 Codechange: Move global strgen state into a single struct. 2025-04-11 22:11:28 +02:00
786893a844 Fix: NewGRF Global variables 0D, 0E and 1E refer to wrong GRFFile. (#13986)
These variables used GrfProcessingState, which is only valid while loading GRFs, after which they always point to the last loaded GRFFile.
2025-04-11 19:53:05 +02:00
translators
eaa2afda5e Update: Translations from eints
dutch: 1 change by Afoklala
2025-04-11 13:06:07 +00:00
translators
cbbbf6cccc Update: Translations from eints
french: 7 changes by Athozus
2025-04-11 04:46:01 +00:00
413087df9d Codechange: Use small function to get check handler for content type. (#13988)
This reduces a long switch block with (multiple) breaks with the power of early return.
2025-04-10 20:45:43 +00:00
936d78fefc Codefix: Avoid uppercase characters in variable names. (#13985) 2025-04-10 07:19:27 +01:00
translators
59aceee887 Update: Translations from eints
chinese (simplified): 6 changes by WenSimEHRP
catalan: 1 change by J0anJosep
portuguese: 2 changes by azulcosta
2025-04-10 04:47:16 +00:00
c982816c0e Codechange: Manage window viewport via unique_ptr. 2025-04-09 22:03:23 +01:00
8275bbfb87 Codechange: Pass Viewport by reference.
This means we do not have to care what type of pointer is used.
2025-04-09 22:03:23 +01:00
70b4beb8e7 Codechange: Return screenshot viewport instead of using out parameter. 2025-04-09 22:03:23 +01:00
f57065dd41 Codefix: Avoid using override keyword as variable names.
Rename variables named `override`.
2025-04-09 22:02:35 +01:00
91ab7f10cd Codefix: Avoid using override keyword as member name.
Rename `GRFFileProps` `override` member to `override_id`.
2025-04-09 22:02:35 +01:00
frosch
294f826364 Codechange: Replace last usage of Utf8CharLen with Utf8View. 2025-04-09 17:19:11 +02:00
frosch
9229956f04 Codechange: Replace strcasestr with StrContainsIgnoreCase. 2025-04-09 17:19:11 +02:00
frosch
14bab7d76b Codechange: Remove unused Utf8TrimString, Utf8PrevChar. 2025-04-09 17:19:11 +02:00
translators
b1582b815c Update: Translations from eints
english (au): 1 change by krysclarke
chinese (simplified): 1 change by WenSimEHRP
greek: 1 change by gh658804
russian: 1 change by Ln-Wolf
finnish: 1 change by hpiirai
portuguese (brazilian): 1 change by pasantoro
polish: 4 changes by pAter-exe
2025-04-09 04:46:50 +00:00
frosch
9dc751ed8a Codechange: Remove now unused Utf8Encode. 2025-04-08 23:10:58 +02:00
frosch
fa284af263 Codechange: Replace remaining Utf8Encode usages with StringBuilder. 2025-04-08 23:10:58 +02:00
frosch
5878db1d02 Codechange: Replace strgen Buffer with StringBuilder. 2025-04-08 23:10:58 +02:00
frosch
9b87f306ca Fix: StringFilter included quotes in the search and failed. 2025-04-08 23:10:58 +02:00
frosch
1d879f3043 Codechange: Use StringBuilder to create the gender-scan-string. 2025-04-08 23:10:58 +02:00
frosch
dd073eb38d Codechange: Use StringBuilder to create encoded strings. 2025-04-08 23:10:58 +02:00
frosch
128e0fcde2 Codechange: Use StringBuilder in TranslateTTDPatchCodes. 2025-04-08 23:10:58 +02:00
frosch
ad8e9634ec Codechange: Generalize StringBuilder. 2025-04-08 23:10:58 +02:00
frosch
f306f9726c Codechange: If modifying already written data in a StringBuilder, do this via the underlying std::string. 2025-04-08 23:10:58 +02:00
frosch
c5a43e705c Codechange: Simplify Original English townname generator. 2025-04-08 23:10:58 +02:00
frosch
04246c530f Codechange: Use fmt::format instead of stringstream with iomanip flags. (#13964) 2025-04-08 20:57:50 +00:00
5b9d171e63 Codechange: Use EnumBitSet for StringValidationSettings. (#13974) 2025-04-08 21:19:17 +01:00
Richard Wheeler
4e4f413913 Fix: Capitalise "Disabled" for the "maximum non-sticky open windows" setting. (#13975) 2025-04-07 19:33:09 +02:00
frosch
3f2b58d6e1 Fix: Validate raw strings from game-scripts, and strip invalid and control characters. (#13976) 2025-04-07 19:30:36 +02:00
frosch
2cdf2bedfa Codechange: Add a std::string overload for StrMakeValidInPlace() and a moving std::string&& overload for StrMakeValid(). (#13962) 2025-04-07 18:22:47 +02:00
981b2a94db Codechange: Store loaded GRFFiles in vector directly. (#13940)
Removes pointer management.
2025-04-06 20:16:57 +01:00
Loïc Guilloux
49ce7fe169 Fix 8846f347f2: Check bridge/tunnel transport type before querying road type (#13969) 2025-04-06 15:01:23 +02:00
translators
bc78efeec1 Update: Translations from eints
catalan: 9 changes by J0anJosep
2025-04-06 04:48:09 +00:00
2a47afad89 Fix d94d421772: Frame widget with label had incorrect spacing. (#13967)
Caused by the frame widget not testing GetStringForWidget properly.
2025-04-05 19:12:42 +01:00
translators
5e1dc081ee Update: Translations from eints
chinese (simplified): 3 changes by WenSimEHRP
hindi: 1 change by NisheshTyagi
2025-04-05 04:43:45 +00:00
68fd949a52 Fix 44984f8410: Changing ownership of a tunnel/bridge did not check for road transport type. (#13963)
Changing ownership changed ownership of road components without checking if the tunnel/bridge is actually a road tunnel/bridge.
2025-04-04 17:11:19 +00:00
SamuXarick
4310d7c7f5 Fix: [Script] Only run the Game::GameLoop() in-game (#13896) 2025-04-04 17:29:48 +02:00
Kuhnovic
4bd72e4a78 Fix #11528: Starting autorail dragging from existing track tiles resulted in adding non-continuous tracks. (#13885) 2025-04-04 15:21:04 +00:00
Loïc Guilloux
f35fa6679b Change: [Script] Start GS (but don't run it) when generating world in scenario editor (#13961) 2025-04-04 12:52:02 +02:00
frosch
8846f347f2 Fix: MayHaveRoad claimed rail station tiles had road, so the custom stationspec index would be read as roadtype. (#13949) 2025-04-04 11:49:10 +02:00
frosch
cedc511324 Fix: Numbers were left-aligned for RTL languages in several windows. (#13959) 2025-04-04 11:48:50 +02:00
frosch
44984f8410 Codechange: Remove broken and unused StrMakeValidInPlace overload. (#13960)
If an otherwise valid string without NUL termination was passed, a NUL was appended out of bounds.
2025-04-04 11:48:32 +02:00
translators
1befa1ccb0 Update: Translations from eints
chinese (simplified): 119 changes by WenSimEHRP
2025-04-04 04:46:26 +00:00
John Taylor
7c1649d524 Fix #13955: Make graphs respect RTL (#13957)
Co-authored-by: John Taylor <gitea@johntaylor.hu>
Co-authored-by: frosch <frosch@openttd.org>
2025-04-03 21:17:34 +02:00
Loïc Guilloux
b25daba561 Fix: [Script] Reset instance when changing running scripts in scenario editor (#13906) 2025-04-03 21:14:45 +02:00
frosch
20805ba84b Codechange: Use EncodeUtf8 and DecodeUtf8 directly, when dealing with a single character. 2025-04-03 18:43:41 +02:00
frosch
f640daee4c Codechange: No need for Utf8Consume and Utf8Encode, if only ASCII characters are checked. 2025-04-03 18:43:41 +02:00
frosch
f06bfc0dad Codechange: Use Utf8View to const-iterate over strings, if no particular error handling is needed. 2025-04-03 18:43:41 +02:00
frosch
22ab0244d8 Codechange: Use Utf8View in Textbuf. 2025-04-03 18:43:41 +02:00
frosch
f19e75b606 Codechange: Use Utf8View in Utf8StringLength. 2025-04-03 18:43:41 +02:00
frosch
83401ad5e2 Codechange: Use Utf8View::iterator in StringIterator. 2025-04-03 18:43:41 +02:00
frosch
b19e43ae99 Add: Utf8View and iterator. 2025-04-03 18:43:41 +02:00
frosch
e6a0cf75a9 Codechange: Shift suffixes between _name_czech_adj and _name_czech_patmod to simplify code. 2025-04-03 13:58:07 +02:00
frosch
d8333fe3d7 Codechange: Czech town names unconditionally removed the last codepoint in _name_czech_adj; already do this in the source table. 2025-04-03 13:58:07 +02:00
frosch
86bb30acbe Codefix dccc6185: Incorrect encoding of empty parameters in ScriptText. (#13951) 2025-04-03 13:57:30 +02:00
frosch
061b5630ee Codefix: Conversion from char to char32_t requires cast to unsigned first. (#13950) 2025-04-03 13:56:50 +02:00
stormcone
ced8fd9936 Fix: Reference to the correct section of the README, if a graphics or a sound set is incomplete. (#13946) 2025-04-03 13:40:16 +02:00
Loïc Guilloux
bd7cda8271 Revert f719fa678f: [CI] The fix is now implemented at vcpkg level (#13942) 2025-04-03 12:54:56 +02:00
33a8c1c6fc Codechange: Use default operator<=> to compare Linkgraph Hop. (#13944) 2025-04-02 23:00:06 +01:00
John Taylor
2f36e3e3a1 Fix #13075, #13893: Reversed all x-axis labels for company related and industry production graphs in wallclock mode. (#13894) 2025-04-02 19:04:49 +02:00
Loïc Guilloux
827b03a32c Fix: [Script] Prevent cloning of API instances (#13947) 2025-04-02 12:30:57 +02:00
2ae84f3c9e Codechange: CargoSpec::Iterate already tests cargo validity. (#13941) 2025-04-01 18:23:26 +01:00
stormcone
8d0ba5649a Fix 667d0137: NewGRF details view does not show the "No information available", if the NewGRF sets an empty description. (#13939) 2025-04-01 16:10:59 +02:00
stormcone
f8f76eb9f3 Fix 089c7a2: SDL2 application name hint was not effective. (#13926) 2025-04-01 16:07:38 +02:00
Rubidium
3c15e0c889 Codefix: return right type to prevent casting 2025-03-31 21:44:53 +02:00
Rubidium
023bf38338 Codefix: std::string_view does not accept nullptr 2025-03-31 21:44:44 +02:00
e200e9b401 Codechange: Use EnumBitSet for Linkgraph RefreshFlags. (#13930) 2025-03-31 20:33:32 +01:00
047497734b Cleanup: Remove redundant NewGRF clean up functions. (#13927)
These functions no longer clean up manually managed memory, they simply clear GRFFile's vectors of unique_ptrs. This will happen anyway when the GRFFile is deleted.
2025-03-31 20:33:09 +01:00
6a3d17923b Codechange: Use range filter to simplify picking a random AI. (#13897) 2025-03-31 20:32:16 +01:00
Patric Stout
f719fa678f Fix: [CI] force a CMake minimum version of 3.5 for all dependencies (#13936)
With CMake 4.0.0, any project < 3.5 is no longer supported. Yet,
some projects indicate 3.0 or 3.1 (while fully compatible with
3.5+). But CMake doesn't know, so it bails.
2025-03-31 18:48:39 +00:00
frosch
dc956a758d Fix: Draw the bevel around the music track name as inset. (#13935) 2025-03-31 18:54:02 +02:00
frosch
fe50f061a9 Fix #13923: Padding in music GUI was asymmetric, so it looked different for LTR and RTL languages. (#13933) 2025-03-31 18:53:51 +02:00
Patric Stout
696fca1459 Change: make GOG more like MSStore/Steam for OpenGFX (#13920)
OpenGFX for the other platforms is untar'd. There is no real need
to do this, but there is also no hurt in not doing it. And doing
the same for all three has more benefits than having one being
different.
2025-03-31 18:41:30 +02:00
frosch
6c569f36e6 Fix #13925, 667d0137: Ancient NewGRF have empty name and description, show the filename instead. (#13932) 2025-03-31 14:25:47 +02:00
translators
0055e168f0 Update: Translations from eints
chinese (traditional): 7 changes by KogentaSan
vietnamese: 1 change by KhoiCanDev
2025-03-31 04:46:08 +00:00
Loïc Guilloux
dc3e8a07e6 Fix #13928, 35e58f6: BuildOilRig did not properly set airport rotation (#13929) 2025-03-30 22:33:01 +00:00
99c6e85356 Codefix: Timetable display rows are not related to OrderID. (#13909) 2025-03-30 20:25:55 +01:00
Michael Lutz
68ff7e5209 Fix #13921, d95422561b: [Win32] Don't try close an already closed event handle during destruction. 2025-03-30 19:01:45 +02:00
Michael Lutz
56af0b29f5 Fix #13921, a908c7bed0: Don't reject MIDI files with a valid file magic value. 2025-03-30 19:01:45 +02:00
Patric Stout
5ff1632fc1 Fix: [CI] Bump Fluidsynth to 2.4.4, fixing a compile error (#13919)
CMake 3.1 is no longer supported; recently Fluidsynth made the jump
to 3.5, which is supported.
2025-03-30 09:02:58 +00:00
Richard Wheeler
993e4a457b Codefix: Update OpenTTD-TTF Github URL (#13917) 2025-03-29 23:07:17 +00:00
translators
cc18f586f9 Update: Translations from eints
chinese (traditional): 1 change by KogentaSan
vietnamese: 11 changes by KhoiCanDev
chinese (simplified): 10 changes by WenSimEHRP
french: 2 changes by ottdfevr
2025-03-29 04:46:36 +00:00
319caef58f Fix #13912: Multitile buildings break apart in house picker. (#13914)
As this is drawing sprites, use sprite-based scaling instead of interface-based scaling.
2025-03-28 20:30:52 +00:00
0829604b4f Fix #13908: Require double click on order to change stop location. (#13913) 2025-03-28 20:23:18 +00:00
e49150f9ca Fix #13910: Invalidate content of house picker window if language is changed. (#13911) 2025-03-28 19:57:43 +00:00
a361841848 Codechange: Store GameStrings as shared_ptr. (#13905)
Uses shared_ptr/weak_ptr as LanguageScanner needs access without ownership.
2025-03-28 17:44:43 +00:00
d95422561b Codechange: Use unique_ptr to manage drivers. 2025-03-28 17:44:07 +00:00
translators
c3457cd4c0 Update: Translations from eints
hungarian: 3 changes by vargaviktor
ukrainian: 10 changes by imlystyi
2025-03-28 04:44:47 +00:00
529fb88325 Codechange: Use template specialisation and instantiation for BaseMedia methods.
Specialisations seem to be the correct way to specialise, rather than redefining the base template.

This removes a macro which instantiated methods individually.
2025-03-27 18:57:53 +00:00
3375dc3095 Codechange: Use traits to define BaseSet parameters. 2025-03-27 18:57:53 +00:00
6914d99778 Codechange: Split baseset type definitions into separate files. 2025-03-27 18:57:53 +00:00
9feaa6b7bc Codechange: Use vector/unique_ptr to manage network game information. (#13902)
Replaces linked list with manual memory management.
2025-03-27 18:48:41 +00:00
0b3619ea35 Codechange: Use unique_ptr to manage blitters. (#13904) 2025-03-27 08:38:58 +00:00
translators
65cabf4c87 Update: Translations from eints
ukrainian: 39 changes by imlystyi
2025-03-27 04:46:01 +00:00
Loïc Guilloux
6bf405eb18 Codechange: Remove Game::GetGameInstance() (duplicate of Game::GetInstance()) (#13901) 2025-03-26 22:41:41 +00:00
ff08a22aa4 Codechange: Simplify AI/GameConfig::GetConfig. (#13900)
Reorganise these methods to reduce nesting and remove a raw pointer to a unique_ptr.
2025-03-26 21:53:05 +00:00
325f7f9767 Codechange: Use EnumBitSet for GoodsEntry status. (#13899) 2025-03-26 21:22:33 +00:00
5331389765 Codechange: Pass NewsItem by reference. (#13898) 2025-03-26 18:56:33 +00:00
422ff9dbd8 Codechange: Use std::unique_ptr for ai/game config. 2025-03-26 10:54:11 +00:00
7f3820fa7e Codechange: Load check data is only interested in landscape and starting_year. 2025-03-26 10:54:11 +00:00
translators
df750d44fd Update: Translations from eints
latvian: 53 changes by lexuslatvia
2025-03-26 04:44:20 +00:00
Björn Wärmedal
d009bfc47b Codechange: Add vehicle owner to crash event (#13878)
Co-authored-by: Björn Wärmedal <bjorn.warmedal@lumera.com>
2025-03-25 22:53:44 +01:00
fb008436b8 Codechange: Use std::unique_ptr for script info/library instances. (#13892) 2025-03-25 21:07:02 +00:00
47d078c033 Codechange: Use EnumBitSet for RailTypes. 2025-03-25 20:15:48 +00:00
732109e444 Codechange: Use EnumBitSet for RoadTypes. 2025-03-25 20:15:48 +00:00
819e097d6e Codechange: Use separate RoadTypes mask to list road or tram roadtypes.
This simplifies logic reduces ambiguity.
2025-03-25 20:15:48 +00:00
frosch
c105adcd96 Codechange: Encode case/gender/plural choice lists without null termination, only length prefix. (#13876) 2025-03-25 20:32:40 +01:00
frosch
25005cff16 Codefix: std::string_view::data() is not necessarily null terminated. (#13891) 2025-03-25 20:32:19 +01:00
93016b9a92 Fix #13842: Close industry production graph if industry is removed. (#13890) 2025-03-25 17:58:59 +00:00
9f94cadd68 Codefix: GRF-local cargo id is not a CargoType. (#13888) 2025-03-25 17:12:43 +00:00
adb20f99ea Fix: Autoreplace rail/road list only listed buildable types. (#13887)
Instead list all possible types which includes hidden types compatible with buildable types.
2025-03-25 08:22:30 +00:00
translators
1fb4c44bc7 Update: Translations from eints
chinese (traditional): 20 changes by KogentaSan
hungarian: 61 changes by vargaviktor
2025-03-25 04:47:17 +00:00
79ef4e98fe Codechange: Use std::swap() instead of Swap() (#13883) 2025-03-24 23:47:34 +00:00
8a53ccf8f1 Fix: Not enough parameters supplied for Autoreplace window caption. (#13886) 2025-03-24 23:01:04 +00:00
frosch
488cda728d Codechange: Use std::string and std::string_view instead of C strings. 2025-03-24 23:10:13 +01:00
frosch
d7768f5f51 Codechange: Use more specific integer types than 'int'. 2025-03-24 23:10:13 +01:00
frosch
b10433715d Codechange: Turn out parameters into return values. 2025-03-24 23:10:13 +01:00
frosch
77af1c89c8 Codechange: Split _show_todos into individual bool flags. 2025-03-24 23:10:13 +01:00
frosch
f8292a8d11 Codechange: Remove unused/obscure strgen feature for relative offsets in plural/gender choice lists. 2025-03-24 23:10:13 +01:00
frosch
4fc0900865 Codechange: Reorder functions in strgen and reduce external symbols. 2025-03-24 23:10:13 +01:00
b96b26ef15 Codechange: Rename short CargoType parameters cargo. (#13848)
Rename CargoType variables and parameters using short or meaningless names.
2025-03-24 18:18:21 +00:00
Loïc Guilloux
bdea29c414 Fix #13875: [Script] be less strict about empty constructor format for doxygen (#13882) 2025-03-24 13:38:10 +01:00
translators
997f8abaec Update: Translations from eints
chinese (traditional): 23 changes by KogentaSan
2025-03-24 04:46:50 +00:00
fc7b6c6cbb Codechange: Use .fill() to clear an array instead of assigning a new array. (#13880)
Avoids allocating a temporary on the stack.
2025-03-23 22:09:45 +00:00
frosch
ca801d55d5 Fix: [NewGRF] Display an error, if NewGRF reference out-of-bounds string parameters in gender/plural choices. (#13881) 2025-03-23 20:43:12 +01:00
42eb513897 Codechange: Make use of emplace_back's return value. (#13879) 2025-03-23 18:34:04 +00:00
frosch
5aa4ad5135 Codechange: Pass unformatted strings from GetStringPtr as std::string_view. (#13871) 2025-03-23 19:23:31 +01:00
234c9fb3bd Codechange: Use EnumBitSet for SpriteFlags. 2025-03-23 18:01:02 +00:00
5abe7c1386 Codechange: Use default initialisation for 32bpp_sse2's SpriteData.
Avoids using memset.
2025-03-23 18:01:02 +00:00
828e808444 Codechange: Split NewGRF loader into separate Action handlers. 2025-03-23 16:59:36 +00:00
0b7fa11a5b Codechange: Move NewGRF string mapping to own file. 2025-03-23 16:59:36 +00:00
2cb389946d Codechange: Move GrfProcessingState to separate file.
Allows reuse by other files.
2025-03-23 16:59:36 +00:00
fe9dfa2b08 Codechange: Move NewGRF ByteReader to own file. 2025-03-23 16:59:36 +00:00
frosch
84f785b06b Codechange: Pass GRF name as std::string to UpdateNewGRFScanStatus. (#13870) 2025-03-23 16:58:43 +01:00
8b4114d709 Fix #13849: Settings in old saves could be overridden by defaults. (#13874)
Resolved by resetting settings to default values before the OPTS and PATS chunks are loaded.
2025-03-23 15:55:55 +00:00
21d2a94809 Codechange: Use EnumBitSet for GrfMiscBits. (#13873) 2025-03-22 21:07:59 +00:00
frosch
af49320637 Fix: [NewGRF] Plurals and genders did not work in strings with cases. (#13853) 2025-03-22 21:41:27 +01:00
frosch
d4ae0f70da Codechange: StringFilter now uses std::string_view entirely (#13869) 2025-03-22 20:35:31 +01:00
frosch
667d013726 Codechange: Return name, description and URL as std::string from GRFConfig. (#13868) 2025-03-22 20:30:40 +01:00
John Taylor
ae2d7947d7 Fix #13562: Removed cost estimation message from money cheat 2025-03-22 20:28:55 +01:00
Jonathan G Rennison
be79099a6f Codechange: Use a std::span as input for GfxFillPolygon (#13866)
Instead of a std::vector const reference.
2025-03-22 15:16:14 +00:00
frosch
5764eaaacf Fix: [NewGRF] Plurals and genders did not work in NewGRF substrings, and cases in substrings could mess up cases in the parent string. (#13852) 2025-03-22 13:40:43 +01:00
translators
7abca5bb25 Update: Translations from eints
hungarian: 77 changes by vargaviktor
2025-03-22 04:46:31 +00:00
e47082bf7b Codefix: Don't look up NewGRF Action 6-modified data twice. (#13863) 2025-03-21 18:13:31 +00:00
frosch
a4f3ddae5f Fix: [NewGRF] String parameter stack and case selection were not processed for control code 0x81. (#13851) 2025-03-21 18:13:08 +01:00
a4f9977d18 Codechange: Don't reimplement DistanceManhattan. (#13850) 2025-03-21 17:06:39 +00:00
6297b49a00 Codechange: Remove table/strings include from header files.
This was accidentally providing coverage to basically all source files...
2025-03-21 12:53:40 +00:00
3503082f19 Codechange: Move template class implementation includes.
These are now placed at the bottom of the including files include list.
2025-03-21 12:53:40 +00:00
2909a14374 Codechange: Include table/strings.h in files that use StringIDs.
Be consistent with how and where the file is incldued.
2025-03-21 12:53:40 +00:00
edb101d12f Codechange: Use free function get BaseSet list label.
This avoids using StringIDs in a header file.
2025-03-21 12:53:40 +00:00
762e2f76a3 Codechange: Avoid STR_NULL in header file. 2025-03-21 12:53:40 +00:00
4ffbf97770 Codechange: Move RawText::GetEncodedText() out of header.
This allows it to use StringID without polluting includes.
2025-03-21 12:53:40 +00:00
frosch
3b178bf58d Fix: NewGRF string interpolation did not process all string parameters, if certain string control codes were present.
String control codes with inline data may contain null characters, in particular plural/gender/case choice lists.
2025-03-21 11:03:24 +01:00
frosch
5d291317e7 Codechange: Two very different functions were named RemapNewGRFStringControlCode. 2025-03-21 11:03:24 +01:00
translators
a678bb263d Update: Translations from eints
hungarian: 32 changes by vargaviktor
2025-03-21 04:45:21 +00:00
89948b941b Codechange: Use emplace_back instead of push_back. (#13855) 2025-03-20 17:39:10 +00:00
b98a7ff303 Fix f214c81e97: Signed overflow in collision test on large map when road vehicles are at just the right coordinates. (#13847)
If road vehicles are -32768 subtiles apart, the distance check will break.
2025-03-18 22:53:01 +00:00
Richard Wheeler
8e2ce35143 Fix: i circumflex width in TrueType small font (#13836)
Updates OpenTTD TTF fonts to v0.7. Fixes i circumflex alignments and right bearings and similar problems with other i and I diacritics.
2025-03-18 21:07:26 +00:00
Richard Wheeler
4ba69765be Update: Developer credits (#13846)
<3
2025-03-18 20:57:25 +00:00
Rubidium
a908c7bed0 Codechange: remove uses of MemCmpT (and MemMoveT) 2025-03-18 21:18:37 +01:00
Loïc Guilloux
e55f54ce08 Fix #13843, 015c081c: Don't discard GetString() result (#13844) 2025-03-18 17:15:40 +00:00
17f7d0950e Fix #13838: Formatted error message of sub-errors may be lost. (#13840) 2025-03-18 08:39:40 +00:00
5255aabe4d Fix #13839: Incorrect colour of first company legend in smallmap window. (#13841)
Use the proper command to set the initial company colour.
2025-03-17 20:28:02 +00:00
translators
ff275b805b Update: Translations from eints
welsh: 144 changes by Ansbaradigeidfran
catalan: 6 changes by J0anJosep
2025-03-17 04:46:50 +00:00
Rubidium
5ea5855677 Codechange: use std::move over copying where applicable 2025-03-16 17:33:06 +01:00
Rubidium
f214c81e97 Codechange: simplify some complicated logic 2025-03-16 15:12:02 +01:00
Rubidium
d6a1a0b058 Codechange: simplify logic and prevent invalid bit 2025-03-16 14:14:21 +01:00
Rubidium
b4e5b12047 Codechange: remove unneeded locking from SmallStack 2025-03-16 14:13:51 +01:00
Patric Stout
b28b35c239 Fix: [CI] Disable CodeQL TRAP Cache, as it trashes our cache (#13832)
Each cache is ~1GB. And you can only have 10GB of cache. So after
10 runs, our cache is full of trap caches.

The kicker? We don't actually benefit from this cache. It is only
used if you re-run CodeQL over the exact same codebase (without
changes), to quickly re-evaluate the latest CodeQL set. We are
way to active to have any benefit from that, and we don't run
CodeQL on a schedule to ever pick up on the cache.
2025-03-16 11:48:41 +00:00
Rubidium
ec647975ad Cleanup: remove ancient FIXME comments 2025-03-16 05:42:29 +01:00
Rubidium
2b9c94f55a Fix: don't show owner of non-existent road 2025-03-16 05:42:29 +01:00
3b004c57bc Codechange: Use EnumBitSet for AdminUpdateFrequency. (#13819) 2025-03-15 21:18:20 +00:00
Koen Bussemaker
8d4639e525 Fix: Error message window timeout doesn't match setting 2025-03-15 22:08:19 +01:00
Rubidium
ccca7fc2b4 Codechange: remove unused INVALID_TRACK_BIT 2025-03-15 22:03:17 +01:00
enveeed
b0cc56a8b5 Fix: NewGRF vehicles display loading sprites when not actually loading or unloading (#13554) 2025-03-15 16:58:47 -04:00
rubidium42
2fed4b0059 Codechange: simplify code (#13822) 2025-03-15 21:49:07 +01:00
Rubidium
c13226cdf8 Codefix: do not leave pointers to stack allocations in globals 2025-03-15 21:46:43 +01:00
Rubidium
dae788e2e3 Codefix: do not trust allocation sizes coming from a file 2025-03-15 21:44:40 +01:00
Rubidium
f794ee028b Codefix: potential division by zero in midi reader 2025-03-15 21:44:18 +01:00
Rubidium
6d0ba270d2 Codefix: do not use an invalid iterator 2025-03-15 21:43:56 +01:00
Rubidium
24f79d2ab7 Codefix: wrong type for choice list mapping 2025-03-15 21:43:18 +01:00
Rubidium
cf96a97e95 Codefix: remove unneeded looping logic 2025-03-15 21:42:28 +01:00
62b8b93476 Codechange: Add default initialisation for Rect to remove MemSetT. 2025-03-15 20:09:38 +00:00
c905472650 Codechange: Use std::array for vehicle sorting/grouping options to remove MemSetT. 2025-03-15 20:09:38 +00:00
653e886d26 Codechange: Use std::array in OpenGLSprite to remove MemSetT. 2025-03-15 20:09:38 +00:00
a87b804386 Fix #13760: Store encoded error message inside CommandCost. (#13764)
Encoded error message was previously static to avoid memmory allocation, however this causes complications.
2025-03-15 20:09:11 +00:00
frosch
0cd87bc8c1 Fix: Don't add chars with unspecified signedness to pointers. (#13828) 2025-03-15 18:48:26 +01:00
frosch
4f63340f8d Codechange: Replace a raw pointer with std::optional. (#13809) 2025-03-15 16:52:12 +01:00
SamuXarick
f6b0f7848b Add: [Script] Newer Cargo Classes (#13779) 2025-03-15 16:51:56 +01:00
Loïc Guilloux
c5ec8fb05f Fix #13814, 2824e790: A Set() became Reset() preventing initial sorting of lists (#13816) 2025-03-14 21:15:42 +01:00
Rubidium
ac2087a3eb Codefix: remove some logically dead code 2025-03-14 16:26:21 +01:00
frosch
dbea968f4f Codefix 20e57a02a2: String parameters were off by one. (#13810) 2025-03-14 15:22:30 +01:00
bd5d47836d Codechange: Use EnumBitSet for EdgeUpdateMode. (#13808) 2025-03-14 09:01:10 +00:00
translators
8191f39649 Update: Translations from eints
chinese (traditional): 11 changes by KogentaSan
spanish (mexican): 5 changes by absay
2025-03-14 04:43:31 +00:00
Charles Pigott
bcabc3b780 Codechange: Upgrade fmt to 11.1.4 (#13807) 2025-03-13 21:52:47 +00:00
Rubidium
18e1440947 Codefix: move or pass by reference instead of copy 2025-03-13 21:16:16 +01:00
Rubidium
754311a779 Codechange: use std::move when appropriate 2025-03-13 13:00:24 +01:00
SamuXarick
05ce0828c0 Change: Use max of calculated and minimal heights in ScriptLeagueWindow (#13720) 2025-03-13 08:39:26 +00:00
8b39b23d2b Codechange: Use EnumBitSet for VehicleFlags. (#13793) 2025-03-13 08:38:54 +00:00
Björn Wärmedal
dc343ca141 Fix: GenerateCompanyName sends incorrect renaming event (#13794) 2025-03-13 08:24:35 +00:00
translators
70c2a666bc Update: Translations from eints
spanish (mexican): 7 changes by absay
czech: 39 changes by adamek0202
2025-03-13 04:45:10 +00:00
Rubidium
2b88f58384 Codefix: add move operators to SQObjectPtr 2025-03-12 22:05:02 +01:00
Rubidium
35ef197be4 Codefix: potential integer overflow before widening integer 2025-03-12 22:00:44 +01:00
Rubidium
02f1bc0880 Codefix: remove some logically dead code 2025-03-12 22:00:33 +01:00
Rubidium
8f3bfb61bd Codefix: remove structurally dead code 2025-03-12 21:03:55 +01:00
Rubidium
d96f359b3c Codefix: potential dangling pointer in strgen 2025-03-12 20:59:47 +01:00
Rubidium
0fde979b21 Codefix: check for errors in the function getting the socket error 2025-03-12 17:55:34 +01:00
Rubidium
486ad7d416 Codefix: check curl_easy_setopt executes properly, or show a debug message 2025-03-12 17:55:34 +01:00
Rubidium
32b2de36ef Codefix: check the table header is actually being read 2025-03-12 17:55:34 +01:00
Rubidium
649ed702cc Codefix: potential unintended sign extension 2025-03-12 17:03:35 +01:00
translators
cdcc6b491d Update: Translations from eints
spanish (mexican): 9 changes by absay
2025-03-12 04:46:00 +00:00
3336f13a63 Fix #13795: size_t mayn't be the same size as uint64_t. (#13796) 2025-03-11 17:55:33 +00:00
translators
40ddc03423 Update: Translations from eints
spanish (mexican): 62 changes by absay
2025-03-11 04:44:39 +00:00
3eb89f04b5 Codechange: Use EnumBitSet for QueryStringFlags. (#13792) 2025-03-10 18:59:35 +00:00
1a53b48422 Codechange: Use EnumBitSet for PartsOfSubsidy. (#13791) 2025-03-10 18:59:21 +00:00
8ba86c54b1 Add: Show hyperlink destination tooltips in text window. (#13742) 2025-03-10 18:12:42 +00:00
Loïc Guilloux
c6cd1a4bca Fix #13740: [Script] Handle implicit orders for jump orders (#13753) 2025-03-10 15:12:26 +01:00
Loïc Guilloux
59904e5f9b Fix #13749: Apply callback when automatically changing timekeeping unit (#13751) 2025-03-10 14:55:19 +01:00
Rubidium
5721030bd2 Codefix: use Pool::Get if you know it's valid, especially if you don't check GetIfValid for nullptr 2025-03-10 12:46:29 +01:00
Rubidium
3c7506e07d Codefix: TrackdirCrossesTrackdirs does not work for turning RV TrackDirs 2025-03-10 12:46:03 +01:00
Rubidium
0d902c9f5c Codefix: possible out-of-bounds array indexing 2025-03-10 07:09:49 +01:00
translators
cb3d3878fa Update: Translations from eints
swedish: 6 changes by joeax910
spanish (mexican): 5 changes by absay
greek: 17 changes by gh658804
2025-03-10 04:40:22 +00:00
Rubidium
2926dd2c2f Codefix: do not dereference the std::end() iterator 2025-03-09 23:33:25 +01:00
Rubidium
afe66c7df4 Codefix: std::move string leaves the old one in an undefined state 2025-03-09 22:19:54 +01:00
7c97460080 Codechange: Use EnumBitSet for ConsistChangeFlags. (#13788) 2025-03-09 21:13:57 +00:00
de45f5418b Fix 0de7fd3c24: widget_lookup may contain non-NWidgetCore widgets. (#13787) 2025-03-09 19:49:26 +00:00
Rubidium
2000cea235 Codechange: initialise instance members 2025-03-09 20:41:03 +01:00
Rubidium
0de7fd3c24 Codefix: check the result of dynamic_cast for nullptr 2025-03-09 19:35:14 +01:00
Rubidium
d07d75229b Codefix: data race in case of a spurious wake up 2025-03-09 19:34:47 +01:00
Richard Wheeler
1eddd7fed0 Fix: Improve manager face randomisation 2025-03-09 19:22:25 +01:00
Rubidium
ee45c8ec1d Codefix: do not pass invalid file descriptor to fdatasync 2025-03-09 19:10:33 +01:00
Jonathan G Rennison
61e8dcfca7 Cleanup: Remove unused DepotCommandFlag::LocateHangar flag (#13775) 2025-03-09 18:07:47 +00:00
52bada216c Codechange: Use std::array for vehicle hashes.
This allows initialisation without memset.
2025-03-09 18:03:50 +00:00
ec71f7a216 Codechange: Use std::array for temporary NewGRF loading data.
This allows initialisation without memset.
2025-03-09 18:03:50 +00:00
761c587940 Codechange: Use std::array to store most-used railtype.
This allows initialisation without memset.
2025-03-09 18:03:50 +00:00
61aa45071a Codechange: Use EnumBitSet for SigFlags. (#13784) 2025-03-09 18:01:52 +00:00
572f2801ac Codechange: Use emplace_back instead of back_inserter. (#13781)
This silences a warning produced by gcc.
2025-03-09 17:42:00 +00:00
translators
62a571c892 Update: Translations from eints
swedish: 89 changes by joeax910
norwegian (bokmal): 51 changes by eriksorngard
chinese (traditional): 1 change by KogentaSan
spanish (mexican): 195 changes by absay
chinese (simplified): 1 change by WenSimEHRP
finnish: 1 change by hpiirai
2025-03-09 04:38:41 +00:00
Rubidium
a23dda7ffe Codechange: use const auto & instead of making a copy 2025-03-08 21:33:17 +01:00
91d22f7617 Codechange: Use EnumBitSet for VehStates. (#13755)
Renamed from VehStatus because pluralising that is weird.
2025-03-08 18:24:21 +00:00
Rubidium
0b102db421 Codefix: initialise a few uninitialised variables 2025-03-08 18:01:25 +01:00
Rubidium
8a243f7391 Fix: [Script] Getting expiry date could cause out of bounds access 2025-03-08 16:14:18 +01:00
Rubidium
cfa31849be Fix: company livery window's instance variables were not set 2025-03-08 16:14:08 +01:00
f8478cdee4 Fix 51fd2853cb: Different news widget layouts require different font sizes. (#13752) 2025-03-08 12:00:56 +00:00
translators
a154df6549 Update: Translations from eints
norwegian (bokmal): 18 changes by eriksorngard
spanish (mexican): 48 changes by absay
czech: 1 change by LubosKolouch
danish: 15 changes by bscargo
dutch: 22 changes by Afoklala
portuguese: 1 change by azulcosta
2025-03-08 04:38:53 +00:00
794317e870 Fix #13758: Owned by error message consumed too many parameters. (#13762) 2025-03-07 23:36:18 +00:00
2c211630cb Fix #13759: Really don't set error owner to OWNER_TOWN. (#13761) 2025-03-07 23:35:28 +00:00
translators
49c760a472 Update: Translations from eints
spanish (mexican): 41 changes by absay
korean: 21 changes by telk5093
italian: 1 change by quasimagia
latvian: 11 changes by lexuslatvia
2025-03-07 04:44:48 +00:00
3fde611012 Codechange: Use EnumBitSet for AirportMovingDataFlags. (#13754) 2025-03-06 19:03:41 +00:00
translators
84f093fc72 Update: Translations from eints
english (au): 8 changes by krysclarke
chinese (traditional): 5 changes by KogentaSan
spanish (mexican): 14 changes by absay
english (us): 2 changes by 2TallTyler
chinese (simplified): 4 changes by WenSimEHRP
greek: 2 changes by gh658804
russian: 14 changes by Ln-Wolf
finnish: 2 changes by hpiirai
portuguese: 2 changes by azulcosta
portuguese (brazilian): 2 changes by pasantoro
polish: 2 changes by pAter-exe
2025-03-06 04:44:52 +00:00
274b7a0195 Fix #13645: "Follow vehicle" button not raised when following stopped. (#13746) 2025-03-06 00:00:57 +00:00
47ae285c9d Fix 2d7d085e8e: Autorenew failed error string consumed too many parameters. (#13750) 2025-03-05 22:50:33 +00:00
frosch
72ddac02bd Codechange: Add plural genders by duplicating the singular ones 2025-03-05 20:49:27 +01:00
frosch
4b93a5240b Codechange: Example usage of plural genders 2025-03-05 20:49:27 +01:00
frosch
273bcf008b Codechange #13709: Update gender definitions for Spanish (es_ES and es_MX) 2025-03-05 20:49:27 +01:00
6d631d7a13 Fix f8b1e30: Fix recent savegames may have incorrect EngineFlags saved. (#13745)
Detect and update engines saved with invalid EngineFlags.
2025-03-05 17:58:03 +00:00
Loïc Guilloux
0ade7638df Fix #13668, fd2949d: Include the \0 in TextBuf max_chars cropping (#13672) 2025-03-05 12:05:19 +01:00
Loïc Guilloux
7723625823 Fix #13729, f8b1e30: Incorrect conversion of EngineFlags to EngineFlag (#13743) 2025-03-05 09:12:06 +00:00
translators
0cfcc07ee6 Update: Translations from eints
chinese (traditional): 8 changes by KogentaSan
spanish (mexican): 36 changes by absay
english (us): 19 changes by 2TallTyler
chinese (simplified): 5 changes by WenSimEHRP
greek: 6 changes by gh658804
finnish: 6 changes by hpiirai
french: 63 changes by glx22
portuguese: 5 changes by azulcosta
portuguese (brazilian): 6 changes by pasantoro
polish: 6 changes by pAter-exe
2025-03-05 04:44:13 +00:00
51fd2853cb Fix 6e10584b91: Keep custom news from game scripts in encoded form. (#13741)
This allows the news message to translated as appropriate.
2025-03-04 23:15:50 +00:00
b979f0414c Codechange: Prevent nested encoded strings. 2025-03-04 21:40:39 +00:00
b55af05626 Codechange: Pass encoded script strings as EncodedString.
This removes the ambiguity of having std::strings that may or may not be encoded.
2025-03-04 21:40:39 +00:00
2a05a845df Feature: Snow-covered rocks are now visible. 2025-03-04 20:39:08 +00:00
28a1267e57 Change: Adjust costs for clearing snowy landscape tiles.
Rocks with snow is no longer cheaper to clear than rocks without snow.
2025-03-04 20:39:08 +00:00
Tyler Trahan
6acbc775e5 Fix #13725: Use proper query strings for changing timetable values (#13737) 2025-03-04 11:58:28 -05:00
8a09bb8127 Fix #11226: Don't draw story page elements that won't be visible. (#13736)
When drawing the story page elements, all of them were drawn even if they are not visible. This can be a significant performance hit for long strings.
2025-03-04 13:38:37 +00:00
27761ae431 Cleanup: Remove global string parameters.
Global parameters, and functions for dealing with them, are now gone.
2025-03-04 08:48:35 +00:00
e818fcbf19 Codechange: Allow encoded strings to use as many parameters as necessary. 2025-03-04 08:48:35 +00:00
37b276b4b5 Cleanup: Remove STR_JUST_STRING2/4. 2025-03-04 08:23:28 +00:00
a1bcfb836a Codechange: Remove leftover SetStringTips. 2025-03-04 08:23:28 +00:00
e10e96b9d5 Codechange: Drop default widget strings for autoreplace window. 2025-03-04 08:23:28 +00:00
3d95a7813f Codechange: Drop default widget strings for AI config window. 2025-03-04 08:23:28 +00:00
ab0d6e8b95 Codechange: Drop default widget strings for network windows. 2025-03-04 08:23:28 +00:00
d7963f6eb7 Codechange: Drop default widget strings for NewGRF debug window. 2025-03-04 08:23:28 +00:00
translators
72a6d27252 Update: Translations from eints
english (au): 13 changes by krysclarke
chinese (traditional): 15 changes by KogentaSan
spanish (mexican): 2 changes by absay
chinese (simplified): 2 changes by WenSimEHRP
greek: 13 changes by gh658804
finnish: 2 changes by hpiirai
portuguese: 31 changes by jcteotonio, 2 changes by azulcosta
portuguese (brazilian): 1 change by pasantoro
polish: 5 changes by pAter-exe
2025-03-04 04:44:36 +00:00
4e485cd083 Fix: Network relay question used string parameters unconventionally. (#13734) 2025-03-04 00:25:15 +00:00
ed65fea7dd Codechange: Move to GetWidgetString for help window. (#13733) 2025-03-03 23:32:08 +00:00
Rubidium
c9624cef7c Codechange: remove MallocT, CallocT and ReallocT 2025-03-04 00:10:01 +01:00
Loïc Guilloux
0d4346c8dc Fix #13727, bdd1406: Incorrect ls.vehicle_names size for TTO saves (#13732) 2025-03-03 22:59:57 +00:00
aec1046d19 Codechange: Drop default widget strings for goal window. 2025-03-03 22:47:07 +00:00
3757d8affe Codechange: Drop default widget strings for league window. 2025-03-03 22:47:07 +00:00
d587426912 Codechange: Drop default widget strings for story window. 2025-03-03 22:47:07 +00:00
c7d6934816 Codechange: Move to GetWidgetString for town windows. 2025-03-03 22:34:22 +00:00
92e4ef7e77 Codechange: Move to GetWidgetString for toolbar windows. 2025-03-03 22:34:22 +00:00
e81884ab31 Codechange: Move to GetWidgetString for timetable window. 2025-03-03 22:34:22 +00:00
Rubidium
3880cc1b57 Codechange: swap x/y axes for dirty blocks around 2025-03-03 23:25:24 +01:00
Rubidium
ec1b9e53f4 Codechange: use std::vector over ReallocT for dirty blocks 2025-03-03 23:25:24 +01:00
92b723cb4e Fix #13723: Invalid string parameters for build airport window. (#13724) 2025-03-03 22:17:54 +00:00
94c6221dff Fix edf9f597ec: Screenshot with non-wallclock date saved with wrong filename. (#13721) 2025-03-03 21:44:48 +00:00
deb3755acb Codechange: Move to GetWidgetString for waypoint window. 2025-03-03 21:24:18 +00:00
a65db3be0d Codechange: Move to GetWidgetString for viewport window. 2025-03-03 21:24:18 +00:00
e1f9159b51 Codechange: Move to GetWidgetString for vehicle windows. 2025-03-03 21:24:18 +00:00
d58eb15a0f Fix #13706, Fix #13717: Replace single new line with double new line in precomposed errors. 2025-03-03 21:23:45 +00:00
92fa1b4444 Codechange: Move to GetWidgetString for station windows. 2025-03-03 21:23:13 +00:00
09806d6f9b Codechange: Move to GetWidgetString for smallmap window. 2025-03-03 21:23:13 +00:00
8f62e40bc7 Codechange: Move to GetWidgetString for sign windows. 2025-03-03 21:23:13 +00:00
3d253a9702 Codechange: Move to GetWidgetString for settings windows. 2025-03-03 21:23:13 +00:00
7a9a3ef94a Codechange: Move to GetWidgetString for script windows. 2025-03-03 21:23:13 +00:00
c7846f4629 Codechange: Move to GetWidgetString for road windows. 2025-03-03 21:20:14 +00:00
039b5a2662 Codechange: Move to GetWidgetString for rail windows. 2025-03-03 21:20:14 +00:00
ee07790a87 Codechange: Move to GetWidgetString for osk window. 2025-03-03 21:19:44 +00:00
06b2751b11 Codechange: Move to GetWidgetString for orders window. 2025-03-03 21:19:44 +00:00
6e0e46fd69 Codechange: Move to GetWidgetString for object window. 2025-03-03 21:19:44 +00:00
f6bc85aeb2 Codechange: Move to GetWidgetString for news windows. 2025-03-03 21:19:44 +00:00
3fbd6f776c Codechange: Move to GetWidgetString for newgrf windows. 2025-03-03 21:19:44 +00:00
6d1d320a7d Codechange: Move to GetWidgetString for music window. 2025-03-03 20:54:48 +00:00
7e43106a92 Codechange: Move to GetWidgetString for misc windows. 2025-03-03 20:54:48 +00:00
997b013e6b Codechange: Move to GetWidgetString for industry window. 2025-03-03 20:54:48 +00:00
a22b150c98 Codechange: Move to GetWidgetString for group window. 2025-03-03 20:54:09 +00:00
015c081cea Codechange: Move to GetWidgetString for graph window. 2025-03-03 20:54:09 +00:00
e959dcd49d Codechange: Move to GetWidgetString for world gen windows. 2025-03-03 20:54:09 +00:00
cd742aa97b Codechange: Drop STR_JUST_STRING for goal window. (#13710)
Missed from previous changes.
2025-03-03 18:35:00 +00:00
Rubidium
bb2b890c88 Codechange: manage the ParagraphLayouter's buffer with std::unique_ptr 2025-03-03 16:42:48 +01:00
Rubidium
3790f29156 Codechange: use std::allocator over malloc/free for Squirrel memory management 2025-03-03 16:42:17 +01:00
Loïc Guilloux
c5e01c1907 Fix: More AI than max_no_competitors could start with competitors_interval=0 (#13670) 2025-03-03 13:39:31 +01:00
bb91113186 Codechange: Move to GetWidgetString for framerate window. 2025-03-03 08:53:14 +00:00
d7ccd6a413 Codechange: Move to GetWidgetString for error window. 2025-03-03 08:53:14 +00:00
16d985efe0 Codechange: Move to GetWidgetString for depot window. 2025-03-03 08:53:14 +00:00
d061c1293b Codechange: Move to GetWidgetString for date window. 2025-03-03 08:53:14 +00:00
72832894e4 Codechange: Drop SetToolTip for window caption. (#13708)
This is set by default so isn't needed.
2025-03-03 08:52:53 +00:00
translators
e43c4e375c Update: Translations from eints
chinese (traditional): 61 changes by KogentaSan
spanish (mexican): 35 changes by absay
chinese (simplified): 16 changes by WenSimEHRP
russian: 13 changes by Ln-Wolf
finnish: 13 changes by hpiirai
catalan: 9 changes by J0anJosep
portuguese: 10 changes by azulcosta, 3 changes by jcteotonio
portuguese (brazilian): 13 changes by pasantoro
polish: 13 changes by pAter-exe
2025-03-03 04:45:18 +00:00
a2accbccc3 Fix #13703: Don't set error owner for town-originated errors. (#13705) 2025-03-02 21:59:55 +00:00
712ed867b2 Codechange: Move to GetWidgetString for company windows. (#13704) 2025-03-02 21:45:17 +00:00
4ee57ed492 Codechange: Move to GetWidgetString for build vehicle window. (#13702) 2025-03-02 21:26:44 +00:00
Rubidium
7f674b09a4 Codefix: std::optional<const std::string> is weird; why is modifying the string copy not allowed? 2025-03-02 20:16:25 +01:00
e9609e4558 Codechange: Use GetWidgetString for network windows. (#13699) 2025-03-02 18:51:54 +00:00
2f75f3d147 Codechange: Use GetWidgetString for goal, league and story windows. (#13700) 2025-03-02 18:33:11 +00:00
913eadd6b0 Codechange: Use GetWidgetString for NewGRF debug window. (#13697) 2025-03-02 12:46:01 +00:00
glx22
a6f558ce2a Add: [Script] Saving/loading ScriptList 2025-03-02 13:41:12 +01:00
glx22
d6a261439b Add: [Script] Framework for loading/saving selected ScriptObject 2025-03-02 13:41:12 +01:00
Rubidium
8d63aea929 Codechange: replace SetStringParameters with GetWidgetString for AI, airport and autoreplace windows 2025-03-02 11:04:15 +01:00
Rubidium
d94d421772 Codechange: prepare for replacement of SetStringParameter by GetWidgetString 2025-03-02 11:04:15 +01:00
321debf7b1 Fix 4389321623: Invalid string parameters in cheat window. (#13696)
Strings unnecessarily consumed an extra parameter, and change company use unformatted string.
2025-03-02 09:02:14 +00:00
edf9f597ec Codechange: Use parameterised GetString() for remaining windows. 2025-03-02 07:29:25 +00:00
4889e4d7f1 Codechange: Use parameterised GetString() for statusbar. 2025-03-02 07:29:25 +00:00
3fda5a8a58 Codechange: Use parameterised GetString() for jukebox window. 2025-03-02 07:29:25 +00:00
5f073670d7 Codechange: Use parameterised GetString() for news window. 2025-03-02 07:29:25 +00:00
937fb12d9a Codechange: Use parameterised GetString() for file windows. 2025-03-02 07:29:25 +00:00
4389321623 Codechange: Use parameterised GetString() for cheat window. 2025-03-02 07:29:25 +00:00
382d30dbb2 Codechange: Use parameterised GetString() for settings window. (#13695) 2025-03-02 07:29:00 +00:00
translators
f360913ebf Update: Translations from eints
spanish (mexican): 6 changes by absay
korean: 45 changes by telk5093
2025-03-02 04:43:20 +00:00
9d7d24465d Codechange: Use parameterised GetString() for group window. (#13693) 2025-03-01 23:42:01 +00:00
78aebfc693 Codechange: Use parameterised GetString() for station view. (#13692) 2025-03-01 23:04:51 +00:00
600450f8a4 Codechange: Use parameterised GetString() for depot window. (#13691) 2025-03-01 22:27:40 +00:00
2aa99a70ff Codechange: Use parameterised GetString() for company windows. (#13690) 2025-03-01 22:25:11 +00:00
8216938276 Codechange: Use parameterised GetString() for world generation window. (#13689) 2025-03-01 22:18:36 +00:00
5d026ef118 Codechange: Use parameterised GetString() for framerate window. (#13688) 2025-03-01 22:17:48 +00:00
Loïc Guilloux
a772df4a99 Fix: [Script] "type" std function might be redefined by scripts (#13686) 2025-03-01 23:01:13 +01:00
170002ff7e Codechange: Use parameterised GetString() for industry window. (#13685) 2025-03-01 19:59:43 +00:00
b92172e3d2 Codechange: Use parameterised GetString() for smallmap window. (#13684) 2025-03-01 18:24:14 +00:00
1bd841b896 Codechange: Use parameterised GetString() for graph windows. (#13683) 2025-03-01 17:22:18 +00:00
e0e845fc4d Fix #13681: Missing unused string parameter for NewGRF parameter string. (#13682) 2025-03-01 16:12:52 +00:00
Loïc Guilloux
e02474fc3e Fix: [Script] Make compat layers fool proof (#13680) 2025-03-01 17:05:47 +01:00
c81d9b43ea Codechange: Use parameterised GetString() for town windows. (#13679) 2025-03-01 13:20:05 +00:00
226a44bf86 Fix: NewGRF text with colour codes affects text in error window. (#13678)
Wrap text with push and pop colour commands so that the correct colour is used for the remainder of the string.
2025-03-01 12:51:50 +00:00
Rubidium
af1b1a31d1 Codechange: update string parameter numbers in translations 2025-03-01 12:42:55 +01:00
Rubidium
8886503ba9 Codechange: Use parameterised GetString for NetworkTextMessage 2025-03-01 12:42:55 +01:00
6d2f17b92f Codechange: Use parameterised GetString() for various build windows. (#13676) 2025-03-01 11:08:46 +00:00
63812a45bb Codechange: Pass single rect to DrawString calls instead of separate parameters. (#13675) 2025-03-01 10:12:43 +00:00
translators
6afde67872 Update: Translations from eints
spanish (mexican): 6 changes by absay
chinese (simplified): 34 changes by WenSimEHRP
dutch: 46 changes by Afoklala
2025-03-01 04:42:34 +00:00
57f0ed716e Codechange: Use parameterised GetString() for drawing NewGRF info. (#13674) 2025-02-28 21:05:12 +00:00
Rubidium
09716dba75 Codechange: do not use MallocT for the pool
Needed to make the placement new operator use Tindex over size_t because of
ambiguity for the delete operator variant that also has the size.
2025-02-28 20:15:42 +01:00
Rubidium
426b03b31a Codechange: do not zero pool item upon allocation any more 2025-02-28 20:15:42 +01:00
Rubidium
15dcf56dad Codechange: remove ZeroedMemoryAllocator 2025-02-28 20:12:44 +01:00
Rubidium
adb0858c05 Codechange: remove ZeroedMemoryAllocator from Window 2025-02-28 20:12:44 +01:00
94783fe2ed Codechange: Use EnumBitSet for ScriptConfigFlags. (#13669) 2025-02-28 18:57:40 +00:00
translators
e70f20a781 Update: Translations from eints
russian: 3 changes by Ln-Wolf
2025-02-28 04:44:13 +00:00
ddb502d097 Codechange: Use parameterised GetString() for script-related windows. (#13671) 2025-02-27 23:53:04 +00:00
e2c1b9f03e Codechange: Use only raw strings in drop down lists. (#13667)
Strings with parameters are now pre-formatted, avoiding global parameters.

Helper functions still allow StringID.
2025-02-27 21:11:16 +00:00
Rubidium
fd8c33d051 Codechange: explicitly initialise member variables of Windows 2025-02-27 21:19:28 +01:00
8813a798e7 Codechange: Always pass raw strings to TextFilter's AddLine(). (#13666)
Remove StringID overload, so callers have to preformat the string.
2025-02-27 19:21:43 +00:00
Rubidium
b376e2655a Codechange: explicitly initialise member variables of Windows 2025-02-27 20:06:06 +01:00
Rubidium
c540c2bcf7 Codechange: explicitly initialise member variables of Windows 2025-02-27 19:58:31 +01:00
SamuXarick
af32ce3710 Cleanup: Remove unused member in ScriptDebugWindow (#13664) 2025-02-27 14:17:31 +01:00
Rubidium
f69968f2bc Codechange: explicitly initialise member variables of Windows 2025-02-27 12:21:06 +01:00
translators
566a5196f2 Update: Translations from eints
english (au): 3 changes by krysclarke
chinese (traditional): 6 changes by KogentaSan
spanish (mexican): 73 changes by absay
english (us): 43 changes by 2TallTyler
chinese (simplified): 3 changes by WenSimEHRP
greek: 3 changes by gh658804
finnish: 6 changes by hpiirai
portuguese: 3 changes by azulcosta
portuguese (brazilian): 3 changes by pasantoro
polish: 6 changes by pAter-exe
2025-02-27 04:45:11 +00:00
Loïc Guilloux
e769c0392e Cleanup: [Script] Remove some dead code (#13660) 2025-02-26 21:37:07 +01:00
f10ece41f8 Codechange: Split SettingEntry-related code to own file. (#13663) 2025-02-26 19:50:02 +00:00
translators
dddad0dcc5 Update: Translations from eints
chinese (traditional): 37 changes by KogentaSan
spanish (mexican): 1 change by absay
chinese (simplified): 3 changes by WenSimEHRP
catalan: 38 changes by J0anJosep
portuguese: 42 changes by azulcosta
polish: 4 changes by pAter-exe
2025-02-26 04:46:09 +00:00
31bd85b743 Codechange: Use parameterised GetString() for goal, league and story windows. (#13662) 2025-02-25 22:55:06 +00:00
a8f56fe7b3 Add: Variable to test how many vehicles in a chain contain a specific badge. (#13594) 2025-02-25 20:55:11 +00:00
Loïc Guilloux
ae72e15951 Codefix b2c5712: [Script] Squirrel::GetRealInstance doesn't work with negative index (#13658) 2025-02-25 13:13:31 +01:00
f1b683b372 Change: Show the type of land covered by snow. 2025-02-25 08:22:46 +00:00
3cf9b15959 Codechange: Handle SnowTile state separately from ClearGround.
This removes the need for ClearGround to pretend that CLEAR_SNOW exists.
2025-02-25 08:22:46 +00:00
translators
02a1f59a6c Update: Translations from eints
english (au): 39 changes by krysclarke
chinese (traditional): 66 changes by KogentaSan
spanish (mexican): 65 changes by absay
chinese (simplified): 97 changes by WenSimEHRP
greek: 39 changes by gh658804
russian: 42 changes by Ln-Wolf
finnish: 39 changes by hpiirai
portuguese (brazilian): 39 changes by pasantoro
polish: 52 changes by pAter-exe
2025-02-25 04:43:08 +00:00
Loïc Guilloux
c06f5cff09 Codefix b2c5712: [Script] Properly check sq_instanceof return value (#13657) 2025-02-24 21:09:04 +00:00
Rubidium
02f040b22a Codechange: remove unused alloc_func.hpp includes 2025-02-24 20:00:19 +01:00
Rubidium
f6ce8d1b10 Codechange: replace C-style memory management in MacOS code 2025-02-24 16:04:22 +01:00
translators
416f6d54d2 Update: Translations from eints
spanish (mexican): 5 changes by absay
french: 6 changes by ottdfevr
portuguese: 1 change by azulcosta
polish: 6 changes by pAter-exe
2025-02-24 04:43:16 +00:00
96f260e718 Codechange: Pass TileDesc by reference. 2025-02-23 23:00:51 +00:00
012daaa3d9 Codechange: Use member initialisation for TileDesc members. 2025-02-23 23:00:51 +00:00
6e10584b91 Codechange: Use EncodedStrings for News messages. (#13654) 2025-02-23 20:24:02 +00:00
Rubidium
0afae7c546 Codechange: explicitly initialise member variables of Windows 2025-02-23 14:53:42 +01:00
1b6a77a190 Codechange: Update translations for parameter changes. 2025-02-23 13:52:13 +00:00
7fd0e6c27d Codechange: Use local string parameters for order and timetable windows.
Order display is now composed of concatenated strings instead of a complex 10-parameter format string, which simplifies things and fixes duplicate spaces.
2025-02-23 13:52:13 +00:00
Rubidium
23ba18ada7 Codechange: remove SimpleSpriteAllocator 2025-02-23 14:44:11 +01:00
Rubidium
b50cf8f252 Codechange: rework OpenGL backend to not need emplacement new and manual deconstructor calls 2025-02-23 14:44:11 +01:00
SamuXarick
718a45b845 Fix 11a8b71: Set direction and rotation of ships upon building (#13625) 2025-02-22 23:33:25 +00:00
b28dca2222 Codechange: Preprocess text ref stack parameters. (#13642)
NewGRF text ref stack is now processed in advance, creating parameters as necessary, and then encoding this into an EncodedString.
2025-02-22 22:03:38 +00:00
4ac81656ee Codechange: Simplify some calls to DrawStringMultiLine(). (#13643)
Sometimes the bottom is passed as UINT16_MAX for no reason. In this case just pass the rect.

Other times it's to extend the window height; in that case just extend the rect itself.
2025-02-22 20:41:40 +00:00
Rubidium
b264a4864b Codechange: make statistics from CompanyEconomyEntry use C++ constructs 2025-02-22 16:33:05 +01:00
Rubidium
24a7cde9cc Codechange: explicitly initialise Company member variables 2025-02-22 16:33:05 +01:00
Rubidium
8b7c92dfe3 Codechange: explicitly initialise NewGRF-pool-object member variables 2025-02-22 15:34:44 +01:00
Rubidium
b64e8c0aea Codechange: use std::vector/std::span over MallocT for NewGRF bridge sprites 2025-02-22 15:34:32 +01:00
Rubidium
7121bc9f31 Codechange: remove ZeroedMemoryAllocator from OpenGLBackend 2025-02-22 15:22:44 +01:00
Rubidium
3e511f2ce7 Codechange: remove ZeroedMemoryAllocator from GRFFile 2025-02-22 14:58:26 +01:00
Rubidium
5cee804f98 Codechange: remove ZeroedMemoryAllocator from NWidgetBase 2025-02-22 14:38:33 +01:00
bb4ac915ff Fix 8f14894024: Badge widths were not updated on interface scale change. (#13630)
Prepare GUI badge class lists in OnInit() method of Windows, so that they handle scaling changes.
2025-02-22 13:29:52 +00:00
Jonathan G Rennison
8566030c53 Cleanup: Adjustments to comments to match code changes (#13636) 2025-02-22 13:28:35 +00:00
2b80812922 Codechange: Use parameterised GetString() in network-related windows. (#13635) 2025-02-22 13:16:47 +00:00
SamuXarick
847fbe3348 Fix: [Script] Set DummyAI Api version to last available (#13610) 2025-02-22 12:58:29 +01:00
b13922fb48 Codechange: Update translations for parameter position changes. 2025-02-22 10:33:22 +00:00
24d327a30b Codechange: Use parameterised-GetString for vehicle related windows. 2025-02-22 10:33:22 +00:00
0428f8c667 Codechange: Add AppendStringWithArgsInPlace() function. 2025-02-22 10:33:22 +00:00
04a16a6b68 Codechange: Add GetParamMaxDigits/Value() functions.
Similar to SetDParamMaxDigits/Value(), except the value is returned instead of being set into a parameter.
2025-02-22 10:33:22 +00:00
4c99b5b368 Codechange: Return pair from GetBroadestDigit instead of out parameters. 2025-02-22 10:33:22 +00:00
translators
9a8d9e4e48 Update: Translations from eints
spanish (mexican): 9 changes by absay
galician: 30 changes by pvillaverde
chinese (simplified): 1 change by WenSimEHRP
catalan: 1 change by J0anJosep
latvian: 30 changes by lexuslatvia
dutch: 4 changes by Afoklala
2025-02-22 04:44:59 +00:00
translators
cc93699459 Update: Translations from eints
english (au): 1 change by krysclarke
chinese (traditional): 1 change by KogentaSan
spanish (mexican): 3 changes by absay
greek: 1 change by gh658804
russian: 1 change by Ln-Wolf
finnish: 1 change by hpiirai
portuguese: 1 change by azulcosta
portuguese (brazilian): 1 change by pasantoro
polish: 1 change by pAter-exe
2025-02-21 04:45:52 +00:00
f4b1bd30f2 Codechange: Codestyle changes for Script League table window. 2025-02-20 22:41:50 +00:00
17a4fcefde Fix: League table window ignored the minimal size in its widget description. 2025-02-20 22:41:50 +00:00
9b65786055 Fix: Incorrect snow density when making rocks snowy. (#13626)
Rocks do not use density, but snowy rocks use snow density. Therefore it should start at zero like non-rocky land.
2025-02-20 18:57:17 +00:00
Rubidium
d0ba6ed1f4 Codechange: explicitly initialise network pool item related member variables 2025-02-20 16:58:51 +01:00
translators
f89924a727 Update: Translations from eints
spanish (mexican): 12 changes by absay
2025-02-20 04:42:49 +00:00
2f8be54567 Fix cb23bc5e2a: Cargo types not initialised for house picker produced display. (#13624)
Instead of using a CargoArray and passing to BuildCargoAcceptanceString, use the simpler CargoTypes with {CARGO_LIST}.
2025-02-19 19:01:03 +00:00
glx22
b8348d7e17 Fix be01c2cd2a: [Scripts] Broken ScriptGroup::SetName compat wrapper 2025-02-19 19:21:50 +01:00
glx22
a577229e95 Revert d7bd67cda3: [Scripts] "_typeof" metamethod negatively affects old scripts 2025-02-19 19:21:50 +01:00
3d5083218d Fix #13621: Incorrect Owner text in land area info. (#13622)
An if-condition was accidentally inverted in 2d7d085e8e, and an empty parameter is required.
2025-02-19 09:14:03 +00:00
translators
f4b75213d8 Update: Translations from eints
spanish (mexican): 76 changes by absay
korean: 4 changes by telk5093
catalan: 4 changes by J0anJosep
2025-02-19 04:45:02 +00:00
9de913dd21 Codechange: Use helper to set grf_prop's grffile and grfid together. (#13612) 2025-02-18 22:33:13 +00:00
Rubidium
37d549d395 Codefix 35e58f68e4: afterload did not properly set airport rotation 2025-02-18 23:09:02 +01:00
Rubidium
704f5e2500 Codechange: explicitly initialise Sign member variables 2025-02-18 22:41:20 +01:00
Rubidium
11a8b71504 Codechange: explicitly initialise Vehicle related member variables 2025-02-18 22:11:04 +01:00
Rubidium
6327fa4623 Codechange: explicitly initialise StoryPage and StoryPageElement member variables 2025-02-18 22:10:43 +01:00
Rubidium
8a4493f990 Codechange: explicitly initialise Town member variables 2025-02-18 22:10:31 +01:00
Rubidium
ce2ae07233 Codechange: explicitly initialise Subsidy member variables 2025-02-18 22:10:10 +01:00
glx22
be01c2cd2a Fix b2c5712319: Old scripts need compatibility layer 2025-02-18 21:19:15 +01:00
glx22
d7bd67cda3 Add: [Scripts] "_typeof" metamethod 2025-02-18 21:19:15 +01:00
Rubidium
35e58f68e4 Codechange: explicitly initialise (Base)Station related member variables 2025-02-18 20:02:23 +01:00
Rubidium
5ccbaa6990 Codechange: explicitly initialise OrderBackup and OrderList member variables 2025-02-18 20:02:09 +01:00
Rubidium
0a285e1a86 Codechange: explicitly initialise Goal member variables 2025-02-18 20:01:58 +01:00
Rubidium
8682f39966 Codechange: explicitly initialise Object member variables 2025-02-18 18:51:44 +01:00
Rubidium
6eb2dec338 Codechange: explicitly initialise LinkGraph and LinkGraphJob member variables 2025-02-18 18:41:31 +01:00
Rubidium
35e7255a5a Codechange: explicitly initialise LeaugeTable and LeagueTableElement member variables 2025-02-18 18:41:14 +01:00
Rubidium
7e471bf04d Codechange: explicitly initialise Industry member variables 2025-02-18 18:18:14 +01:00
Rubidium
63e99871c1 Codechange: explicitly initialise Group member variables 2025-02-18 18:17:56 +01:00
Rubidium
b4a4ca83ff Codechange: explicitly initialise EngineRenew member variables 2025-02-18 07:21:11 +01:00
Rubidium
0449dc48c8 Codechange: explicitly initialise Depot member variables 2025-02-18 07:21:04 +01:00
Rubidium
1f3198a395 Codechange: explicitly initialise Engine member variables 2025-02-18 07:20:58 +01:00
Rubidium
bb81139c1f Codechange: explicitly initialise CargoPayment member variables 2025-02-18 07:20:49 +01:00
translators
53dd1258a7 Update: Translations from eints
english (au): 3 changes by krysclarke
norwegian (bokmal): 4 changes by eriksorngard
chinese (traditional): 4 changes by KogentaSan
spanish (mexican): 67 changes by absay
english (us): 4 changes by 2TallTyler
chinese (simplified): 54 changes by WenSimEHRP
arabic (egypt): 77 changes by ImMorrow
greek: 3 changes by gh658804
russian: 3 changes by Ln-Wolf
finnish: 3 changes by hpiirai
portuguese: 3 changes by azulcosta
portuguese (brazilian): 3 changes by pasantoro
polish: 3 changes by pAter-exe
2025-02-18 04:43:06 +00:00
370c702549 Add: Show badges in NewGRF debug window. (#13597) 2025-02-17 22:15:45 +00:00
7a23bfa747 Add: Filter purchase lists by badge text. (#13588) 2025-02-17 17:28:26 +00:00
5e43aaff35 Add: Also show badges in fund industry list. (#13590) 2025-02-17 17:27:57 +00:00
af7054dcb6 Fix 8f14894024: Badge name list did not use translatable separator. (#13591) 2025-02-17 17:27:22 +00:00
translators
2f66f74035 Update: Translations from eints
english (au): 1 change by krysclarke
chinese (traditional): 1 change by KogentaSan
spanish (mexican): 264 changes by absay
greek: 1 change by gh658804
russian: 2 changes by Ln-Wolf
finnish: 1 change by hpiirai
portuguese: 1 change by jcteotonio
portuguese (brazilian): 1 change by pasantoro
polish: 4 changes by pAter-exe
2025-02-17 04:43:27 +00:00
ed57b9c297 Fix faa845398f: Crash when loading tile layout with no building sprites. (#13589)
Tile layouts are permitted to have no building sprites, therefore the test for an empty sequence of sprites is not valid.
2025-02-16 22:29:56 -05:00
13944222f3 Fix d13b0e0813: "New vehicle now available!" message is wrong colour. (#13586) 2025-02-16 23:00:24 +00:00
8f14894024 Add: NewGRF Badges. 2025-02-16 22:24:25 +00:00
ca3b5ed6c1 Codechange: Allow iterating a BaseBitSet. 2025-02-16 22:24:25 +00:00
0af5d5a9e6 Codechange: Make non-generic GRF string ids unique per feature.
This prevents engine name strings conflicting with generic strings if more than 53,248 engines are defined.
2025-02-16 22:24:25 +00:00
154896ce55 Codechange: Use GetString() with local parameters in script functions. (#13585) 2025-02-16 21:27:25 +00:00
Rubidium
fd4adc55e3 Codechange: replace INVALID_X with XID::Invalid() for PoolIDs 2025-02-16 20:23:00 +01:00
d13b0e0813 Codechange: Build engine preview strings from separate strings. (#13579)
This replaces stuffing substrings and parameters in various global parameters and uses local parameters instead.
2025-02-16 19:02:02 +00:00
Rubidium
af00b835a1 Codechange: remove transitional supports from the pool 2025-02-16 19:31:37 +01:00
Rubidium
576a96c685 Codechange: let the ReusableBuffer use std::vector as storage 2025-02-16 19:31:13 +01:00
Rubidium
59df0ff496 Codechange: strongly type StationID 2025-02-16 18:25:51 +01:00
Patric Stout
155aaa5967 Fix fd2949d: use std::prev() to walk back from a possible string::end() 2025-02-16 16:36:25 +01:00
Patric Stout
2eb32ece6d Fix fd2949d: std::string can reallocate on insert() 2025-02-16 16:36:25 +01:00
3ade64954c Change: Restore wider spacers in main toolbars. (#12039)
Width for all spacers was included only due to an off-by-one from counting buttons and not excluding the normally hidden switcher button.

Spacer width of quarter the button width is now included explicitly,
2025-02-16 14:51:07 +00:00
Rubidium
70c9f3963c Codechange: strongly type VehicleID 2025-02-16 14:50:15 +01:00
Rubidium
1003967267 Codechange: strongly type TownID 2025-02-16 14:50:15 +01:00
Rubidium
d3408a4542 Codechange: strongly type IndustryID 2025-02-16 14:50:15 +01:00
Rubidium
7e04651220 Codechange: strongly type EngineID 2025-02-16 14:50:15 +01:00
Rubidium
17b97e5d1b Codechange: introduce ConvertibleThroughBase helper 2025-02-16 14:50:15 +01:00
Rubidium
380e7b48ce Codechange: use std::variant instead of a custom version for news references 2025-02-16 14:50:15 +01:00
Rubidium
2cb59b1856 Codechange: make VehicleID an enum 2025-02-16 14:50:15 +01:00
Rubidium
c25c3e8710 Codechange: make IndustryID an enum 2025-02-16 14:50:15 +01:00
Rubidium
9015c3651f Codechange: make EngineID an enum 2025-02-16 14:50:15 +01:00
Rubidium
ab8177ea77 Codechange: strongly type CompanyID 2025-02-16 14:02:18 +01:00
Rubidium
5401ab1f7b Codechange: use ReferenceThroughBaseContainer for containers that are index by CompanyID 2025-02-16 14:02:18 +01:00
Rubidium
1ffc950e22 Codechange: use prefix operator++ for CompanyID iterations 2025-02-16 14:02:18 +01:00
Rubidium
b0eb8fe4db Codechange: introduce ConvertibleThroughBase helpers 2025-02-16 14:02:18 +01:00
Rubidium
bdd14063a0 Codechange: move vehicle name to LoadgameState and change to std::vector 2025-02-16 13:45:07 +01:00
Rubidium
11d48aa47c Codechange: do not use ZeroedMemoryAllocator for NewGRFSpriteLayout 2025-02-16 13:44:46 +01:00
Rubidium
2d30df8110 Codefix: 'Declaration hides variable' 2025-02-16 13:44:37 +01:00
443d7ece29 Codefix 75387b9e2b: Prefer using EnumBitSet.base() instead of shifting StationFacility. (#13575) 2025-02-16 11:52:40 +00:00
Rubidium
e8beb0eff3 Codechange: add support for std::variant in EndianBuffer 2025-02-16 12:44:10 +01:00
Rubidium
a50c953854 Codefix: Clone should make a clone, not copy some data to another instance 2025-02-16 12:31:25 +01:00
Rubidium
faa845398f Codechange: use std::vector for NewGRFSpriteLayout registers 2025-02-16 12:31:25 +01:00
Rubidium
e7595c6c85 Codechange: pass oldloader LoadgameState by reference instead of pointer 2025-02-16 12:31:14 +01:00
Rubidium
44506ebc86 Codechange: use span size over terminator object 2025-02-16 11:19:12 +01:00
2d7d085e8e Codechange: Use EncodedString for error messages. (#13569) 2025-02-16 10:04:32 +00:00
43c7865ca2 Fix #13570: Query window's caption was no longer visible. (#13572) 2025-02-16 10:00:50 +00:00
translators
6283631155 Update: Translations from eints
spanish (mexican): 24 changes by absay
vietnamese: 2 changes by KhoiCanDev
french: 14 changes by glx22
2025-02-16 04:42:07 +00:00
Rubidium
8b7460759a Codechange: rework StringFilter to not need MallocT anymore 2025-02-15 23:43:57 +01:00
Jonathan G Rennison
ff6ae5b87b Codechange: Use ZIP_LISTS for regression output line iteration 2025-02-15 22:19:41 +00:00
Jonathan G Rennison
2c58494920 Codechange: Update minimum CMake version to 3.17 for all parts
This is to allow the use of ZIP_LISTS
2025-02-15 22:19:41 +00:00
Su
4a37b6448f Change: Make tree placement at world generation look more organic (#13515)
Trees are now placed in irregular blob shapes instead of repetitive diamond shapes.

---------

Co-authored-by: Susan <su+git@angel-island.zone>
Co-authored-by: Peter Nelson <peter1138@openttd.org>
2025-02-15 20:54:02 +00:00
Rubidium
fd2949d559 Codechange: use std::string as backing for textbuf 2025-02-15 21:52:55 +01:00
Rubidium
ad8f394835 Codechange: introduce string::iterator aware Utf8Decode, Utf8Encode and Utf8PrevChar 2025-02-15 21:52:55 +01:00
Rubidium
672c5f0d98 Codefix: 'Short global name' 2025-02-15 21:06:28 +01:00
cb23bc5e2a Add: Show cargo types produced by building in house picker. (#13561) 2025-02-15 15:06:58 +00:00
04708736d9 Codechange: Use EnumBitSet for CommandFlags. (#13560) 2025-02-15 09:36:20 +00:00
translators
f620ba9d05 Update: Translations from eints
dutch: 25 changes by Afoklala
2025-02-15 04:44:38 +00:00
ff7eb996e6 Codechange: Use variable storage for GrfProps with cargo-type groups. (#13557)
Slots are only allocated when used instead of being reserved.

Array-based GrfProps are still used when the number of options is more limited.
2025-02-14 18:30:17 +00:00
Rubidium
4fe3f0ccdd Codechange: simplify management of temporary Engine in saveload 2025-02-14 18:35:12 +01:00
Rubidium
069ff846e4 Codechange: use std::vector/std::span for DrawTileSprites over malloc-ed table 2025-02-14 16:01:45 +01:00
6cf7a899e9 Codechange: Use EnumBitSet for PauseMode. (#13553) 2025-02-14 08:30:04 +00:00
translators
3518d7e0f1 Update: Translations from eints
chinese (traditional): 4 changes by KogentaSan
2025-02-14 04:42:55 +00:00
merni-ns
b678e5ddd1 Fix #12925: Prevent cost estimates for settings changes 2025-02-14 04:36:24 +01:00
20e57a02a2 Codechange: Use GetString() with argument parameters in simple cases. (#13551)
Avoids using global string parameters.
2025-02-14 00:10:56 +00:00
Rubidium
c3d5e6d2a0 Codechange: Use EnumBitSet for DoCommandFlags 2025-02-14 00:28:57 +01:00
f309b90a1d Codechange: Use EnumBitSet for Airport blocks. 2025-02-13 22:02:02 +00:00
9049710051 Codechange: Allow (Re)setting a range of values in a BaseBitSet. 2025-02-13 22:02:02 +00:00
f0777737af Fix #13459, Fix #13546: Crash when changing NewGRFs in game with picker window open. 2025-02-13 21:07:37 +00:00
71dafdb21e Codechange: Use EnumBitSet for picker window invalidation flags. 2025-02-13 21:07:37 +00:00
75387b9e2b Codechange: Use EnumBitSet for StationFacility. 2025-02-13 18:03:13 +00:00
8d38308ebb Codechange: Allow ConvertibleThroughBase to be used as One/ManyOfManySetting. 2025-02-13 18:03:13 +00:00
7975145080 Codechange: Use EnumBitSet for TownActions. (#13542) 2025-02-13 18:02:39 +00:00
Loïc Guilloux
b2c5712319 Fix: [Script] Improve type checking of parameters (#13522) 2025-02-13 13:46:21 +01:00
Loïc Guilloux
dc311d7c38 Fix: [Script] Report errors happening during 'Load()' (#13537) 2025-02-13 12:41:39 +01:00
translators
47fca6d8e6 Update: Translations from eints
spanish (mexican): 1 change by absay
2025-02-13 04:44:12 +00:00
Jonathan G Rennison
d06b371254 Cleanup: Fix various spelling errors 2025-02-12 22:44:51 +01:00
Jonathan G Rennison
4d0682d034 Fix 1d04d402: Inverted visibility state in SettingsPage::UpdateFilterState (#13543) 2025-02-12 21:34:59 +00:00
Loïc Guilloux
ad24779661 Codefix: [CMake] Debug libs of Ogg, Opus and OpusFile were used for release with multi-config generators (#13539) 2025-02-12 18:51:29 +01:00
translators
3bbc80f1d9 Update: Translations from eints
norwegian (bokmal): 23 changes by eriksorngard
spanish (mexican): 1 change by absay
korean: 14 changes by telk5093
catalan: 13 changes by J0anJosep
2025-02-12 04:43:37 +00:00
1d04d4027a Codechange: Use EnumBitSet for SettingEntryFlags. (#13534) 2025-02-11 22:18:06 +00:00
0d5708ba86 Codechange: Use EnumBitSet for AirportFTAClass::Flags (#13535) 2025-02-11 21:49:18 +00:00
9cdf740097 Codechange: Use ProviderManager to define screenshot generators. (#13526) 2025-02-11 21:38:20 +00:00
Jonathan G Rennison
23dc393822 Codechange: Compile fmt internals in a separate translation unit (#13527)
Instead of defining FMT_HEADER_ONLY to include fmt internals
in the headers included by all fmt-using translation units.
2025-02-11 20:11:50 +01:00
Rubidium
cf05b6c2f8 Codefix: remove unused set/process_compile_flags from CMake system 2025-02-11 20:01:01 +01:00
984da2455b Codechange: Use EncodedString for Query window. (#13528)
This removes the need to separately capture and store global parameters.
2025-02-11 17:30:16 +00:00
translators
08e451e6d9 Update: Translations from eints
english (au): 14 changes by krysclarke
chinese (traditional): 14 changes by KogentaSan
english (us): 14 changes by 2TallTyler
vietnamese: 3 changes by KhoiCanDev
greek: 14 changes by gh658804
russian: 16 changes by Ln-Wolf
finnish: 14 changes by hpiirai
portuguese: 14 changes by azulcosta
portuguese (brazilian): 15 changes by pasantoro
polish: 12 changes by pAter-exe
2025-02-11 04:43:06 +00:00
7c1898eaf1 Codechange: Store EncodedString for text effects.
This replaces capturing and storing string parameters.
2025-02-10 22:49:14 +00:00
2cb9f55183 Codechange: Store EncodedString for tooltip text.
This replaces capturing and storing string parameters.
2025-02-10 22:49:14 +00:00
1f21e9dc74 Codechange: String parameter encoding for regular strings.
This allows a string and its parameters to be encoded and stored as just one string, instead of juggling with capturing and restoring string parameters.

The advantage of EncodedStrings over raw strings is they use current language and parameter values at the point of decoding.
2025-02-10 22:49:14 +00:00
4010313180 Codechange: String parameters can now be explicitly not initialised.
As the visitor is now more complex this requires an unspecialised GetNextParameter() to avoid it being repeated for each return type.
2025-02-10 22:49:14 +00:00
0c0e7606d9 Codechange: Use unique_ptr for UDP client/server sockets handlers. (#13524) 2025-02-10 22:41:56 +00:00
e80992fc47 Codefix: Change method to take const pointer instead of using const_cast. (#13525) 2025-02-10 22:10:36 +00:00
Loïc Guilloux
7fbfaa1b54 Fix #13520: [Script] doxygen ignored 'constexpr' constants (#13523) 2025-02-10 23:05:31 +01:00
687829fa14 Codechange: Use std::unique_ptr for ScriptList::sorter. (#13517)
Avoids manual pointer management.
2025-02-10 19:20:52 +00:00
translators
faadf00a6a Update: Translations from eints
czech: 25 changes by JakMel
2025-02-10 04:45:03 +00:00
Rubidium
77bf3084da Codefix f60b3d7f79: compilation failure using GCC-12 2025-02-09 22:51:02 +01:00
Rubidium
37c215f1fd Fix #13513, ec492cb267: std::numeric_limits<CompanyMask> not working causes no vehicles to exist
std::numeric_limits<T>::max() returns 0 instead of an error when the type is unknown.
Solve it by implementing and using Set() and All() in BaseBitSet in same way as std::bitset.
2025-02-09 22:50:55 +01:00
Tyler Trahan
521b860394 Feature: Prevent towns from upgrading individually-placed houses (#13270) 2025-02-09 20:37:06 +00:00
1ed685b5c1 Codechange: Use EnumBitSet.Any(). (#13512) 2025-02-09 20:16:16 +00:00
Patric Stout
86841ba1f0 Codechange: no longer add "src" to the include-path (#13511) 2025-02-09 19:43:15 +00:00
588597805d Feature: Place rocks on "too steep" tiles when fixing slopes. (#13462)
When generating maps or loading heightmaps, the terrain height is altered to prevent slopes that can't be represented.

During this, there is now a chance of these tiles being turned into a rocky tile.

Chance of placing rocks is based on the height. This gives a rocky mountain appearance without affecting all peaks.
2025-02-09 18:37:25 +00:00
ba20ea5d18 Codechange: Use EnumBitSet for SpriteComponent. (#13509) 2025-02-09 18:37:01 +00:00
Tyler Trahan
b2f5a4901b Add: Setting to allow placing houses manually in-game (#13266) 2025-02-09 18:34:31 +00:00
Rubidium
01b639bb23 Codechange: replace instance of raw uint16_t with CompanyMask 2025-02-09 19:24:51 +01:00
Rubidium
ec492cb267 Codechange: make CompanyMask a BaseBitSet implementation 2025-02-09 19:24:51 +01:00
Rubidium
e972033e11 Codechange: introduce BaseBitSet as base for EnumBitSet 2025-02-09 19:24:51 +01:00
Rubidium
b9777269ce Codechange: strongly type SignID 2025-02-09 18:05:01 +01:00
Rubidium
42d6a12874 Codechange: replace union with std::variant for ViewportSignKdtreeItem::id 2025-02-09 18:05:01 +01:00
Rubidium
cd4482b5df Codechange: make TownID an enum 2025-02-09 18:05:01 +01:00
Rubidium
cda9c2759e Codechange: make SignID an enum 2025-02-09 18:05:01 +01:00
Rubidium
1e24b41f22 Codechange: strongly type GroupID 2025-02-09 16:52:21 +01:00
Rubidium
798e9f229c Codechange: strongly type DepotID 2025-02-09 16:52:21 +01:00
Rubidium
d55b9cff9d Codechange: strongly type ClientPoolID
Also remove some of the artifical documented limits as they are not true; the
ClientPoolID was not sent over the network, so its size isn't of concern.
2025-02-09 16:52:21 +01:00
Rubidium
47721edb1d Codechange: strongly type AdminID 2025-02-09 16:52:21 +01:00
Rubidium
6535fc1f80 Codechange: add helpers to VehicleListIdentifier for ConvertibleThroughBase 2025-02-09 16:52:21 +01:00
Patric Stout
f60b3d7f79 Codechange: [Script] rework how compat-scripts work and are loaded (#13504)
- compat_NNN.nut files now only defines what is needed to downgrade from API NNN + 1 to NNN.
- Automatically load all required compatibility files based on the API version of the script, starting with the latest.
2025-02-09 15:04:04 +00:00
2824e790ec Codechange: Use EnumBitSet for SortListFlags. (#13506) 2025-02-09 14:38:35 +00:00
Maxim Leshchenko
5dc02a686f Change: [MacOS] Put the icon in a rounded rectangle (#13446) 2025-02-09 14:33:04 +00:00
kg
1786e1b80e Add: Press Ctrl to build diagonal canals in game mode (#13432) 2025-02-09 15:30:00 +01:00
Rubidium
155d7de132 Codechange: change Source into a class with conversion helpers
A Source is either a CompanyID (Headquarters), IndustryID or TownID.
When making those types stronger a lot of casts would be needed, but
with these simple helpers the intent is shown more clearly.
2025-02-09 15:28:35 +01:00
Rubidium
2929411130 Codechange: introduce ReferenceThroughBaseContainer
This provides support for ConvertibleThroughBase positions passed to the
functions of a container that return a reference, specifically 'at(pos)'
and 'operator[](pos)'.
2025-02-09 15:28:03 +01:00
Rubidium
44a979559a Codechange: strongly type Subsidy 2025-02-09 15:07:29 +01:00
Rubidium
3aa60fd479 Codechange: strongly type StoryPageID and StoryPageElementID 2025-02-09 15:07:29 +01:00
Rubidium
5ca5790ac8 Codechange: strongly type SpriteGroupID 2025-02-09 15:07:29 +01:00
Rubidium
f9f19de8c2 Codechange: strongly type RoadStopID 2025-02-09 15:07:29 +01:00
Rubidium
d10499f2f1 Codechange: strongly type PersistentStorageID 2025-02-09 15:07:29 +01:00
Rubidium
9ab36b594d Codechange: strongly type OrderID and OrderListID 2025-02-09 15:07:29 +01:00
Rubidium
d61d643906 Codechange: strongly type OrderBackupID 2025-02-09 15:07:29 +01:00
Rubidium
cb3db3cedd Codechange: strongly type ObjectID 2025-02-09 15:07:29 +01:00
Rubidium
c311e6e4a9 Codechange: strongly type LinkGraphID and LinkGraphJobID 2025-02-09 15:07:29 +01:00
Rubidium
6c8915fdbc Codechange: strongly type LeagueTableID and LeagueTableElementID 2025-02-09 15:07:29 +01:00
Rubidium
6aada55e96 Codechange: strongly type GoalID 2025-02-09 15:07:29 +01:00
Rubidium
7cc194e745 Codechange: strongly type EngineRenew 2025-02-09 15:07:29 +01:00
Rubidium
b575d5b8e4 Codechange: strongly type CargoPacket 2025-02-09 15:07:29 +01:00
Rubidium
4803ca7462 Codechange: strongly type CargoPayment 2025-02-09 15:07:29 +01:00
Rubidium
07dd5bf01d Codechange: support strongly typed pool element IDs in squirrel/saveload 2025-02-09 15:07:29 +01:00
Rubidium
30127dfe90 Codechange: prepare the pool for strongly typed pool element IDs 2025-02-09 15:07:29 +01:00
Patric Stout
82c5e37b46 Change: have a better title for the Online Content window (#13505) 2025-02-09 13:55:16 +00:00
Rubidium
0f5f5714b3 Codechange: add unit test against over optimisation of enum-bitmasks 2025-02-09 14:44:23 +01:00
Rubidium
90f5a9440c Codechange: add automation for (re)setting the 'work: needs rebase' label on PRs 2025-02-09 14:44:13 +01:00
Rubidium
ce07ea00b8 Codechange: add and use GetDepotDestinationIndex map accessor 2025-02-09 14:27:51 +01:00
dccc6185b9 Codechange: Change internal format of encoded strings to improve robustness and allow expansion. (#13499) 2025-02-09 12:45:50 +00:00
Rubidium
1193852007 Codechange: do not use ScriptCompany::CompanyID outside of the script API 2025-02-09 12:04:42 +01:00
translators
30ddbeed8d Update: Translations from eints
french: 21 changes by glx22
2025-02-09 04:40:46 +00:00
Rubidium
4cda9f900d Codechange: [Script] Use helper function over direct casting CompanyID
In the script's API `COMPANY_INVALID` has a value of -1, whereas the internal
game's `INVALID_COMPANY` has a value of 255. Since the script's API also has
a `COMPANY_SPECTATOR` with a value of 255, these enumerations cannot be easily
reconciled by casting. As such, replace all casts in the script API with
either ScriptCompany::FromScriptCompanyID or ScriptCompany::ToScriptCompanyID.

Also make clear whether CompanyID is ::CompanyID or ScriptCompany::CompanyID
by using either one of those over CompanyID in the script's API.
2025-02-08 23:42:19 +01:00
Loïc Guilloux
8ab3e9f0a3 Fix 3effb89: [Script] Don't set CommandCallback for asynchronous commands (#13501) 2025-02-08 22:14:37 +00:00
Loïc Guilloux
edf90f5e4b Codefix 043d1ac: [Win32] Restore virtual destructor of StreamingVoiceContext (#13496) 2025-02-08 17:43:34 +01:00
Rubidium
ac54ff368c Codechange: set VLI.index through accessor function 2025-02-08 10:09:02 +01:00
Rubidium
4e84d032b8 Codechange: read VLI.index through wrapper to get the right type 2025-02-08 10:09:02 +01:00
d61b376998 Codechange: Use EnumBitSet for CargoClasses. (#13491) 2025-02-08 08:46:38 +00:00
Rubidium
04d53ed6f5 Codechange: remove operator!=s that are synthesized 2025-02-08 06:37:36 +01:00
Rubidium
760b8f74b7 Codechange: implement operator<=> and remove operators that are synthesized 2025-02-08 06:37:36 +01:00
Rubidium
8fbba84473 Codechange: move operator== inside MultiMap class and leave out ones that will be synthesized 2025-02-08 06:37:36 +01:00
Rubidium
5f41bc0279 Codechange: put SourceType and SourceID into Source struct 2025-02-08 06:37:23 +01:00
translators
95bfd68341 Update: Translations from eints
korean: 11 changes by telk5093
2025-02-08 04:41:07 +00:00
11bfd5bb9e Codechange: Use EnumBitSet for EndSegmentReasons. (#13490) 2025-02-07 23:53:23 +00:00
50b384032d Codechange: Use EnumBitSet for IndustryControlFlags. 2025-02-07 22:01:59 +00:00
965a45812a Codechange: Allow masking invalid values passed to EnumBitSet. 2025-02-07 22:01:59 +00:00
bb43d60064 Codechange: Allow EnumBitSet to work with 64 bit underlying type. 2025-02-07 22:01:59 +00:00
Rubidium
87e228b8b5 Codechange: remove unneeded dereference chunk type flag 2025-02-07 22:49:17 +01:00
Rubidium
266b733095 Codechange: use unique_ptr instead of manual memory allocation to store strings 2025-02-07 22:49:17 +01:00
Rubidium
83479a4e12 Codechange: add method for reading a string from a savegame given a length 2025-02-07 22:49:17 +01:00
Rubidium
f90fa2a4d1 Codechange: use C++ constructs over MallocT/free 2025-02-07 22:49:03 +01:00
d9bb002cac Codechange: Use local parameters for formatting settings values. (#13487) 2025-02-07 20:18:03 +00:00
9a6fc4eb76 Codechange: Use enum class for NewsReferenceType. 2025-02-07 19:36:52 +00:00
ca75a8ce19 Codechange: Use enum class for NewsType. 2025-02-07 19:36:52 +00:00
4fd1929bf7 Codechange: Use EnumBitSet for NewsFlags. 2025-02-07 19:36:52 +00:00
52094c1fc1 Codechange: Detemplatise uint64_t version of GetNextParameters(). (#13488)
This ensures the visitor is not duplicated for the different types pass to GetNextParamters<T>(), which now is only concerned with casting the result.
2025-02-07 18:54:40 +00:00
Rubidium
9189c3ab6f Codechange: use TownID instead of uint 2025-02-07 19:41:19 +01:00
Rubidium
6e0378f7c1 Codechange: use IndustryID instead of int 2025-02-07 19:26:34 +01:00
99a32207b8 Codechange: Use preformatted strings for slider marks. (#13484) 2025-02-07 18:14:53 +00:00
c3643e3ee0 Codechange: Pass raw string to editable query window. (#13481)
This avoids separating string id and parameters. EncodedString is not needed as it is the raw text that is editable.
2025-02-07 17:03:53 +00:00
8c48f9fc49 Codechange: Pass preformatted string when updating sign positions. (#13480)
This forces the strings to be formatted in advance and avoids using global string parameters.
2025-02-07 13:19:00 +00:00
eaa765d615 Codechange: Disentangle news window style from news flags. (#13482)
This avoids NewsFlags being used as both bitmask and bitstuffed data.
2025-02-07 13:10:39 +00:00
ccd3d3a547 Codechange: Add version of GetString() that takes parameters directly.
This allows parameters to be passed to GetString() bypassing the global parameter system.
2025-02-07 12:30:34 +00:00
be00fd4447 Codechange: Use std::array as simple string parameter container.
ArrayStringParameters contains extra state that is used when formatting strings which isn't needed when creating parameter lists.

MakeParameters() now returns a std::array which contains only the parameter data. This simpler container is more widely available than before.
2025-02-07 12:30:34 +00:00
fb70a7fe7e Codechange: Use EnumBitSet for IndustryTileSpecialFlags. 2025-02-07 12:30:06 +00:00
1916454776 Codechange: Use EnumBitSet for IndustryLifeTypes. 2025-02-07 12:30:06 +00:00
2bb3f368e3 Codechange: Use EnumBitSet for IndustryBehaviours. 2025-02-07 12:30:06 +00:00
translators
9d451d6350 Update: Translations from eints
english (au): 2 changes by krysclarke
spanish (mexican): 6 changes by absay
english (us): 12 changes by 2TallTyler
polish: 1 change by pAter-exe
2025-02-07 04:44:22 +00:00
Rubidium
e937c4dcfd Codechange: change DestinationID into class with conversion helpers
A DestinationID is either a DepotID or StationID, where the aircraft hangar
being conceptually a depot is actually a StationID. When making those types
stronger, a lot of casts would need to be added, but this shows the intent
much better.
2025-02-06 21:03:24 +01:00
Rubidium
8ca03a3766 Codechange: make network crypto enum classes 2025-02-06 21:03:12 +01:00
Rubidium
fef2baf041 Codechange: make NetworkAuthenticationMethodMask an EnumBitSet 2025-02-06 21:03:12 +01:00
693a5f42b9 Codechange: Use EnumBitSet for NWidgetDisplayFlags. 2025-02-06 19:43:35 +00:00
28eb5e05c8 Codechange: Use EnumBitSet for NWidContainerFlags. 2025-02-06 19:43:35 +00:00
translators
6089ed8059 Update: Translations from eints
english (au): 6 changes by krysclarke
chinese (traditional): 8 changes by KogentaSan
spanish (mexican): 3 changes by absay
greek: 12 changes by gh658804
russian: 12 changes by Ln-Wolf
finnish: 8 changes by hpiirai
catalan: 8 changes by J0anJosep
portuguese: 9 changes by azulcosta
portuguese (brazilian): 8 changes by pasantoro
polish: 14 changes by pAter-exe
2025-02-06 04:45:30 +00:00
fe31538a27 Codechange: Use EnumBitSet for Scanner::Modes. (#13471) 2025-02-05 20:08:12 +00:00
Krys Clarke
11bbf0b6dd Fix: Spelling mistakes in STR_ERROR_CAN_T_SELL_ALL_SHIP/AIRCRAFT 2025-02-05 18:03:06 +01:00
Rubidium
2f1d0acec9 Codechange: use the appropriate type for OldWaypoint indices 2025-02-05 16:16:40 +01:00
translators
fd85ab1e2c Update: Translations from eints 2025-02-05 04:43:17 +00:00
ffb5e71a28 Fix: Missing error messages with sell- and autoreplace-all commands. (#13469)
If these commands failed then then the error message part was blank.
2025-02-04 22:30:42 +00:00
603630c1ae Codechange: Allow ConvertibleThroughBase types to be used as settings. (#13466) 2025-02-04 19:06:37 +00:00
SamuXarick
adc79aca09 Codechange: Refactor AllocHeightMap to return void since it always returns true (#13379) 2025-02-04 18:52:52 +00:00
c31494a413 Codechange: Use EnumBitSet for RoadStopDrawModes. 2025-02-04 18:52:08 +00:00
17f6da413d Codechange: Use EnumBitSet for RoadStopSpecFlags. 2025-02-04 18:52:08 +00:00
1a6e7f2162 Codechange: Use EnumBitSet for StationSpecFlags. 2025-02-04 18:52:08 +00:00
translators
1f7760dc7a Update: Translations from eints
english (au): 1 change by krysclarke
chinese (traditional): 2 changes by KogentaSan
spanish (mexican): 1 change by absay
russian: 2 changes by Ln-Wolf
catalan: 3 changes by J0anJosep
2025-02-04 04:42:40 +00:00
e2b59449bb Codechange: Make Squirrel handle ConvertibleThroughBase. (#13453)
This removes the need for a Money specialisation.

TileIndex specialisation remains due to unsigned/signed connivance.
2025-02-04 01:15:58 +00:00
08ed68bc85 Fix: Too many trees when generating trees at same height. (#13460)
Multiplying by tile height caused far too many trees to be generated when using maps higher than the original limit.
2025-02-03 19:35:05 +00:00
64724b8893 Codechange: Make OverflowSafeInt ConvertibleThroughBase. (#13449) 2025-02-03 12:53:45 +00:00
Jonathan G Rennison
5f4f78574f Codefix: Town index used in CMD_BUILD_ROAD test call in IsRoadAllowedHere (#13451) 2025-02-03 13:51:06 +01:00
SamuXarick
f5d43ffdf8 Change: [Script] GetWaypointID to return the StationID of any waypoint
Modified ScriptWaypoint::GetWaypointID to also return the StationID of any waypoint (including road waypoint).
2025-02-03 08:41:59 +01:00
Jonathan G Rennison
3ea4d1d4fc Fix #12912: CompanyProperties::inaugurated_year_calendar not saved 2025-02-03 08:09:45 +01:00
translators
8962ea8bcc Update: Translations from eints
english (au): 1 change by krysclarke
chinese (traditional): 3 changes by KogentaSan
chinese (simplified): 3 changes by WenSimEHRP
greek: 1 change by gh658804
russian: 1 change by Ln-Wolf
finnish: 1 change by hpiirai
portuguese: 1 change by azulcosta
portuguese (brazilian): 1 change by pasantoro
polish: 3 changes by pAter-exe
2025-02-03 04:44:07 +00:00
e114ed357d Codechange: Use EnumBitSet for ObjectFlags. (#13441) 2025-02-02 21:15:03 +00:00
Rubidium
6f8b9fc737 Codechange: remove unneeded casts 2025-02-02 19:45:17 +01:00
Rubidium
9bfddcdbbe Codechange: make WindowNumber accept ConvertibleThroughBase types 2025-02-02 19:45:17 +01:00
fb55ab0742 Codechange: Pass rect to DrawStationCoverageAreaText. (#13442)
This moves the overflow behaviour to the callers, making it clearer why that is desired.
2025-02-02 17:15:47 +00:00
Rubidium
5ffaf6cdb9 Fix: [Script] Wrong return value for failed preconditions Vehicle::CloneVehicle 2025-02-02 18:01:08 +01:00
Tyler Trahan
3ae715722c Doc: Rainforest is one word 2025-02-02 10:58:23 -05:00
Tyler Trahan
cc475b6acb Change: Rainforest is one word 2025-02-02 10:58:23 -05:00
Rubidium
5a78bb8fac Codechange: ToWindowNumber describes better what is the intent than Pack 2025-02-02 15:57:18 +01:00
Rubidium
6b7cb4ede3 Codechange: remove unused Unpack from VehicleListIdentifier 2025-02-02 15:57:18 +01:00
Rubidium
e36a9ceaf0 Codechange: allow passing extra constructor arguments via AllocateWindowDescFront 2025-02-02 15:57:18 +01:00
Rubidium
8f72a478f0 Codechange: change 'return existing window' to a template parameter
This change is made to make it possible to pass arbitrary other parameters
to the constructor of the window instances.
2025-02-02 15:57:18 +01:00
Loïc Guilloux
9238cb7270 Codefix 3e747397f0: Also upgrade preview workflow (#13438) 2025-02-02 13:39:33 +01:00
Loïc Guilloux
7a49691954 Cleanup: [Script] Remove unneeded squirrel exports since #13389 (#13437) 2025-02-02 13:30:45 +01:00
6f52a977a8 Codechange: Use EnumBitSet for GRFConfigFlags.
This is renamed from `GCF_Flag` didn't match convention.
2025-02-02 10:49:45 +00:00
877fa54f66 Codechange: Use EnumBitSet for GRFBug enum. 2025-02-02 10:49:45 +00:00
Rubidium
292f4baf46 Doc: cross-reference Emscripten version number locations 2025-02-02 09:26:12 +01:00
translators
52ded73b21 Update: Translations from eints
english (au): 2 changes by krysclarke
norwegian (bokmal): 2 changes by eriksorngard
spanish (mexican): 9 changes by absay
greek: 2 changes by gh658804
russian: 2 changes by Ln-Wolf
finnish: 2 changes by hpiirai
portuguese: 2 changes by azulcosta
portuguese (brazilian): 2 changes by pasantoro
polish: 2 changes by pAter-exe
2025-02-02 04:40:46 +00:00
59354576d4 Codechange: Use EnumBitSet for LandscapeTypes and remove LandscapeID. (#13436) 2025-02-01 23:09:18 +00:00
merni-ns
9ff485b329 Fix #13304: Refer to font document in font error message
Instead of referring to readme which doesn't say anything about this anymore
2025-02-01 23:51:26 +01:00
merni-ns
2ab714b32e Change: Add fonts document to help window 2025-02-01 23:51:26 +01:00
merni-ns
20d1420d66 Doc: Add documentation on fonts
See <https://wiki.openttd.org/en/Manual/Fonts>
2025-02-01 23:51:26 +01:00
Rubidium
a49963ac39 Codechange: remove unused Pack from Order 2025-02-01 22:08:20 +01:00
Tyler Trahan
2d5565129a Fix #13140: Scale initial industry production estimate by cargo scale (#13427) 2025-02-01 14:08:49 -05:00
Rubidium
b6a092f3e0 Codechange: make EnumBitSet ConvertibleThroughBase 2025-02-01 19:22:02 +01:00
Rubidium
55588b052e Codechange: add concept of ConvertibleThroughBase for strong types
This makes it possible to write templated alternatives for ConvertibleThroughBase
which are then available for any (strong) type that implements a base() function
In the end making adding new ConvertibleThroughBase types less awkward.
2025-02-01 19:22:02 +01:00
Rubidium
3e747397f0 Codechange: use GCC 12 for building tools for Emscripten 2025-02-01 19:22:02 +01:00
Rubidium
ac6f3542a8 Codefix: narrowing conversion warning for MSVC x86 2025-02-01 17:54:14 +01:00
Rubidium
89d0a688a9 Codechange: Use EnumBitSet for pool types 2025-02-01 17:04:04 +01:00
c4c5028862 Codechange: Use EnumBitSet for SettingFlags. (#13429) 2025-02-01 15:46:51 +00:00
1d25c526b4 Codechange: Use EnumBitSet for strgen's CmdFlags. (#13428) 2025-02-01 15:45:55 +00:00
95bd53ddf1 Codechange: Use EnumBitSet for BuildingFlags. 2025-02-01 14:16:25 +00:00
113205c540 Codechange: Use EnumBitSet for HouseExtraFlags. 2025-02-01 14:16:25 +00:00
Rubidium
2c7b3bb55d Codechange: rename ClientIndex to ClientPoolID 2025-02-01 11:15:51 +01:00
Rubidium
50e581cd31 Codechange: rename AdminIndex to AdminID 2025-02-01 11:15:51 +01:00
Rubidium
f3e32b2f6a Codechange: use Pool's counter instead of maintaining our own 2025-02-01 11:15:51 +01:00
translators
23dcb4f4a7 Update: Translations from eints
korean: 1 change by telk5093
russian: 2 changes by Ln-Wolf
dutch: 1 change by Afoklala
2025-02-01 04:41:55 +00:00
Rubidium
b6bdb97bed Codechange: [Script] replace some enums with constexpr values of the internal type 2025-02-01 02:38:37 +01:00
Rubidium
b4e3425a5f Codefix: access pool via PoolItem, not the pool itself 2025-02-01 02:38:27 +01:00
Rubidium
4ca1fe6c32 Codechange: replace MAX_UVALUE with std::numeric_limits::max 2025-02-01 01:29:02 +01:00
f67589d96e Fix 5664b1e2f6: Missing sprite detection used the wrong filename. (#13421)
This caused the missing sprite count to be incorrect.
2025-01-31 22:28:38 +00:00
Sam James
4e82091f92 Codechange: use -fno-strict-enums instead of -fno-tree-vrp (#13369)
-fno-tree-vrp is essentially a GCC implementation detail which controls
a powerful source of optimisation information. The linked GCC bug from 2010(!)
shows that -fno-strict-enums was added in response to the bug report, and
we can use that instead. Clang supports it too. Use that instead for both
GCC and (newly) Clang.
2025-01-31 19:45:14 +00:00
Binraptor
1cba62faaf Add: Ukrainian Hryvnia currency (#12877) 2025-01-31 19:37:58 +00:00
Tyler Trahan
a0fb98df53 Change: When player joins network company, use its name instead of number in chat (#13263) 2025-01-31 14:02:17 -05:00
f8b1e3033f Codechange: Use EnumBitSet for EngineFlags. 2025-01-31 18:55:31 +00:00
6c4ddb242a Codechange: Use EnumBitSet for EngineMiscFlags. 2025-01-31 18:55:31 +00:00
5664b1e2f6 Codechange: Use std::vector for GRFConfig lists. (#10835)
This replaces the C-style custom managed linked-list and allows use of iterators etc.
2025-01-31 17:09:09 +00:00
40aeedeade Codechange: Use EnumBitSet for callback masks. 2025-01-31 17:08:24 +00:00
1dd4adc50c Add: EnumBitSet function to test if All or Any enum values are set.
This allows multiple values to be tested in one operation.
2025-01-31 17:08:24 +00:00
b9ae833e96 Codechange: Use std::array for water features.
Replaces a memset() with fill().
2025-01-31 17:08:24 +00:00
translators
ebc57634e4 Update: Translations from eints
chinese (traditional): 1 change by KogentaSan
chinese (simplified): 3 changes by WenSimEHRP
catalan: 1 change by J0anJosep
polish: 1 change by pAter-exe
2025-01-31 04:41:56 +00:00
84b219ac64 Codefix: EngineNameContext uses enum class naming but wasn't. (#13417)
This could have caused namespace conflicts with its values.
2025-01-30 22:14:45 +00:00
Jonathan G Rennison
2fa81c89ce Codechange: Remove unused GenWorldStatus::next_update (#13414) 2025-01-30 22:09:24 +00:00
917d5cc75d Codechange: Use EnumBitSet for RoadTypeFlags and RailTypeFlags. (#13415) 2025-01-30 22:08:51 +00:00
SamuXarick
a4d23c072d Fix 95df7ea: Incorrect WindowClasses for deduplicated window descs. (#13412) 2025-01-30 18:51:09 +00:00
a252ba3146 Codechange: Modernise NewGRF debug helper definitions. (#13410)
* Replace pointers and null-terminated lists with spans.
* Replace raw (undeleted) pointer with unique_ptr.
* Replace const char * with string_view.
2025-01-30 18:50:53 +00:00
56b1e9df1f Codechange: Use EnumBitSet for FrameFlags. 2025-01-30 08:40:42 +00:00
d30e8dd1c1 Codechange: Use EnumBitSet for WindowDefaultFlags. 2025-01-30 08:40:42 +00:00
efb05396a7 Codechange: Use EnumBitSet for WindowFlags. 2025-01-30 08:40:42 +00:00
translators
248f369e86 Update: Translations from eints
english (au): 1 change by krysclarke
norwegian (bokmal): 1 change by eriksorngard
english (us): 1 change by 2TallTyler
greek: 1 change by gh658804
finnish: 1 change by hpiirai
portuguese: 1 change by jcteotonio
portuguese (brazilian): 1 change by pasantoro
2025-01-30 04:43:04 +00:00
f51627c76f Codechange: Use EnumBitSet for DepotCommand(Flag)s. 2025-01-29 21:46:39 +00:00
2560339472 Codechange: Use EnumBitSet for Border(Flag)s. 2025-01-29 21:46:39 +00:00
473728f181 Codechange: Use EnumBitSet for ExtraEngineFlags. 2025-01-29 21:46:39 +00:00
cea62a8399 Codechange: Use EnumBitSet for AspectFlags. 2025-01-29 21:46:39 +00:00
5ef495da78 Codechange: Use EnumBitSet for GroupFlags. 2025-01-29 21:46:39 +00:00
4b573b2703 Codechange: Use EnumBitSet for ViewportStringFlags. 2025-01-29 21:46:39 +00:00
05ac1dd888 Codechange: Use EnumBitSet for TileFlags. 2025-01-29 21:46:39 +00:00
3c2706f859 Codechange: Use EnumBitSet for EngineDisplayFlags. 2025-01-29 21:46:39 +00:00
6d1f56ce6b Codechange: Allow using EnumBitSet over network commands. 2025-01-29 21:46:39 +00:00
fdb3555147 Add: EnumBitSet class to safely use enum class values as a bitset.
This maintains type-safe enum values and type-safe masks, and avoids using undefined enum values.
2025-01-29 21:46:39 +00:00
bf6293a13f Fix: Rail/road type conversion data is not populated on new game. (#13403)
This means that the rail/road type conversion that happens if NewGRFs are changed does not work the first time for a new game, only with a savegame.
2025-01-29 21:45:16 +00:00
translators
402aaf3d11 Update: Translations from eints
persian: 32 changes by CptMcWill
2025-01-29 04:42:38 +00:00
afc0745aa2 Codechange: Specify underlying type for all enums excluding those exposed to scripts. (#13383) 2025-01-28 22:17:34 +00:00
6fda85c569 Cleanup: Remove CMake endian detection. 2025-01-28 19:37:34 +00:00
fb6781015a Codechange: Use std::endian instead of TTD_ENDIAN defines. 2025-01-28 19:37:34 +00:00
b70438b76a Fix #13392: Signs of removed stations are no longer visible. (#13395)
Add "Ghost" option for station sign visibility.
2025-01-28 19:10:32 +00:00
77f4d776c4 Codechange: Remove ZeroedMemoryAllocator from network socket handlers. (#13377)
Prefer member default initialisation instead.
2025-01-28 19:10:00 +00:00
Rubidium
4099acb946 Codechange: replace BSWAP32/BSWAP16 with std::byteswap 2025-01-28 19:22:12 +01:00
Rubidium
2481f2e085 Codechange: introduce own std::byteswap implementation
This is only available from C++23, but the implementation is fairly trivial
and the old variants of BSWAP32/BSWAP16 were not constexpr on MSVC. This was
due to all kinds of intrinsics that were added to get better code. However,
recent compilers with reasonable optimisation settings see the naive code and
will inject the appropriate optimised code (bswap op on x86-64).

For x86-64 recent is: Clang 6+ -O1, GCC 6+ -O2, MSVC 19.34+ /O1.
2025-01-28 19:22:12 +01:00
Rubidium
37a2d97c64 Doc: [Script] some IDs were not mentioned in script_types.hpp 2025-01-28 18:57:40 +01:00
Rubidium
1543b909dd Codechange: use 'using' over 'typedef' 2025-01-28 18:57:40 +01:00
Rubidium
9a21ca31f8 Codechange: [Script] do not redefine types in the script API
Also move includes to the locations where they are actually used
2025-01-28 18:57:40 +01:00
Rubidium
45444f9666 Codechange: rename DECLARE_POSTFIX_INCREMENT to DECLARE_INCREMENT_DECREMENT_OPERATORS 2025-01-28 18:56:58 +01:00
Rubidium
0207f91b8d Codechange: use traits to add increment/decrement operators to enums when requested 2025-01-28 18:56:58 +01:00
4b2b113292 Codechange: Remove TTD_ENDIAN from Colour union. (#13396)
`TTD_ENDIAN` is used to change the order of the r,g,b,a members of `Colour` to suit the architecture.

This kind of conditional is not supported by C++/`std::endian`, so instead three separate Colour unions are defined, `ColourRGBA`, `ColourARGB` and `ColourBGRA`. The correct union is then aliased to `Colour` using `std::conditional`.
2025-01-28 17:51:04 +00:00
Rubidium
d1e001f1c8 Codechange: make script and internal NEW_STATION have the same value 2025-01-28 18:17:05 +01:00
Richard Wheeler
b32e638e94 Change: Draw company manager face jacket after collar
Change the sprite drawing order defined by the enum and table to draw the (shirt) collar first, under the jacket. Simplifies new graphics development, allowing the shirt collar sprite to be a full shirt.
2025-01-27 21:31:29 +01:00
Charles Pigott
98d5dde094 Fix #13359: [CMake] Only search for Xaudio2 on Windows (#13372) 2025-01-27 20:24:57 +00:00
Patric Stout
119470f43e Fix: [CMake] restore CMAKE_REQUIRED_FLAGS if you change it (#13393) 2025-01-27 19:41:51 +00:00
Jonathan G Rennison
a7deb16e81 Fix #13384: Crash when remove bus/truck stop tool used on road waypoints
Or vice versa
2025-01-27 20:21:01 +01:00
Koen Bussemaker
3dc12e3d65 Change: Don't distinguish between bus and truck stops when removing them 2025-01-27 19:00:39 +01:00
Rubidium
f34e04ee48 Codechange: allow mapping enums as parameter and return type from scripts 2025-01-27 06:13:45 +01:00
translators
e39f974d7d Update: Translations from eints
chinese (simplified): 1 change by WenSimEHRP
2025-01-27 04:43:45 +00:00
9b947a37b8 Codechange: Pass GRFConfig by reference where feasible. (#13388)
In places where a GRFConfig is passed by pointer and not checked for nullptr, use a reference instead.
2025-01-26 22:41:08 +00:00
Rubidium
e894a5880c Codechange: rename CargoID to CargoType and amend related variables/comments 2025-01-26 18:07:10 +01:00
Rubidium
d05cc2ef92 Codefix: do not consider TTD/TTO engine IDs actual EngineIDs 2025-01-26 18:02:12 +01:00
Rubidium
e7e9a12817 Codefix: Engine constructor's base parameter isn't an actual EngineID 2025-01-26 18:02:12 +01:00
Rubidium
40ab4e306b Codechange: use std::vector to store SpriteCache instances in 2025-01-26 18:00:07 +01:00
Rubidium
c6fc280ff1 Codechange: use std::vector over CallocT/free 2025-01-26 17:59:56 +01:00
Rubidium
043d1ac111 Codechange: use std::vector/std::unique_ptr over new/malloc 2025-01-26 17:59:56 +01:00
Rubidium
8016cfc0ef Codechange: use std::unique_ptr over malloc 2025-01-26 17:59:56 +01:00
Rubidium
f8566c3ff1 Codechange: use std::unique_ptr over calloc 2025-01-26 17:59:56 +01:00
b7a82819de Codechange: Remove ZeroedMemoryAllocator from WindowDesc.
All members which are not intended to be changed are now const to ensure they are set
2025-01-26 16:42:05 +00:00
95df7ea483 Change: Use separate WindowDescs instead of changing static data.
When opening vehicle lists a static WindowDesc is modified to change the class depending on the vehicle type.

Theses makes for inconsistencies and preferred window state, and prevents WindowDesc members being made const.
2025-01-26 16:42:05 +00:00
6c9b3f17b7 Fix 4c8f1b0f81: First entry of station cargo filter list was broken. (#13382)
Additional indent parameter was missing.
2025-01-26 10:09:18 +00:00
translators
492a5284ea Update: Translations from eints
latvian: 8 changes by lexuslatvia
2025-01-26 04:41:56 +00:00
1e14fd6a0d Codechange: Use enum class for PaletteAnimation. 2025-01-25 21:42:21 +00:00
161b02efda Codechange: Use enum class for BlitterMode. 2025-01-25 21:42:21 +00:00
Michael Ostapenko
c4494faf10 Fix #12968, d20df82: Added back ability to create unremovable houses 2025-01-25 14:40:51 +01:00
Rubidium
5b4c5632ba Codechange: add unit test against enum over optimisation 2025-01-25 10:49:13 +01:00
translators
5839ee3be3 Update: Translations from eints
galician: 8 changes by pvillaverde
2025-01-25 04:42:46 +00:00
Charles Pigott
39784240e9 Codechange: [CMake] Hide errors when breakpad is not found (#13371) 2025-01-24 13:12:38 +00:00
Rubidium
184621e64a Fix b1ab1b9f06: [Script] Don't use AI types for GS compat scripts 2025-01-23 13:32:38 +01:00
Rubidium
f7aaf8ea24 Codechange: use StrEmpty instead of number of bytes in string to check for empty 2025-01-23 10:11:22 +01:00
Rubidium
c5dac6e619 Codechange: use correct type for variable to prevent casts later on 2025-01-23 07:05:02 +01:00
f6ab2b69c6 Codechange: Define GRFConfigList alias and pass by reference. (#13358)
This adds the distinction between a single GRFConfig and a GRFConfig list, and simplifies how GRFConfig lists are passed to various functions.
2025-01-22 22:30:32 +00:00
Rubidium
b1ab1b9f06 Change: [Script] rename BridgeID to BridgeType in the script API 2025-01-22 22:23:38 +01:00
183779c4a2 Codefix: Incorrect NWidgetPart type for NWID_LAYER. (#13357)
Due to function overloads and default parameters, the wrong `NWidget()` function was called, resulting resulting in the wrong `NWidgetPart` being created.
2025-01-22 20:43:54 +00:00
Rubidium
a40d6cd193 Cleanup: remove unused IsValidCargoType 2025-01-22 18:58:34 +01:00
Loïc Guilloux
b91685e4b6 Fix ef826a048a: [MinGW] "_WIN32_WINNT_WIN7" is not defined (#13354) 2025-01-22 18:44:54 +01:00
3a50b24a8d Codechange: Replace macros in TGP. (#13346)
Remove use of Amplitude as a percentage.
2025-01-22 07:27:41 +00:00
73daacde3a Cleanup: Remove two unused PaletteType values. (#13341) 2025-01-21 18:20:38 +00:00
SamuXarick
05b9b8765c Codefix 60d0d7b: Incorrect variable in TGP noise calculation (#13350) 2025-01-21 16:41:38 +00:00
Loïc Guilloux
ef826a048a Codechange: [WIN32] Use language isocode for fallback font detection (#13310) 2025-01-21 15:57:09 +01:00
90e8dd9f10 Fix 7b091000b0: Missing 32bpp-to-8bpp sprites due to ZOOM_LVL_NORMAL changes. (#13349)
ZOOM_LVL_NORMAL was change from 4x zoomed in to 1x zoom, loop should be using ZOOM_LVL_BEGIN.
2025-01-21 08:58:51 +00:00
translators
b5b4531b7a Update: Translations from eints
english (us): 5 changes by 2TallTyler
2025-01-21 04:42:57 +00:00
Rubidium
c74e385145 Codechange: use StoryPageID instead of uint16_t 2025-01-21 01:57:05 +01:00
7b091000b0 Feature: Support converting 32bpp-only sprites to indexed 8bpp.
This uses nearest colour lookup to convert 32bpp-only sprites to indexed 8bpp on the fly. This provides a reasonable usable sprite instead of being incompatible.
2025-01-21 00:45:31 +00:00
c5d3ac7a71 Codechange: Move colour brightness methods to palette code.
This allows reuse outside of blitters.
2025-01-21 00:45:31 +00:00
83e9ee00f0 Change: Let sprite loader know what sprites are available in both 8bpp and 32bpp depths. 2025-01-21 00:45:31 +00:00
SamuXarick
60d0d7b8b2 Codechange: Lowercase variable names and use _ separator 2025-01-20 21:41:03 +01:00
SamuXarick
62002c6eae Doc: Standardize map size notation and multiply operator 2025-01-20 21:40:49 +01:00
SamuXarick
9bf882b3f7 Doc: Change MapSize to Map::Size 2025-01-20 21:40:49 +01:00
translators
7da21379f0 Update: Translations from eints
swedish: 4 changes by joeax910
2025-01-20 04:42:31 +00:00
SamuXarick
9a3b656a62 Codechange: Capitalise static consts (#13342) 2025-01-19 23:58:21 +00:00
Iris-Persephone
a589793e27 Fix #12987: Historical houses now always spawn completed (#13332)
Co-authored-by: Anonymous <anonymous@openttd.org>
2025-01-19 23:58:05 +00:00
40efc6be00 Codechange: Use member initialisation for GRFConfig instead of ZeroedMemoryAllocator. (#13343) 2025-01-19 23:31:15 +00:00
Rubidium
51529b83b1 Codechange: replace custom deque with actual deque when loading network games 2025-01-19 23:01:55 +01:00
Rubidium
4b2051a1c1 Codechange: use Textbuf::GetText() to access the buffer / hide Textbuf::buf 2025-01-19 23:01:35 +01:00
Rubidium
55fa14cb06 Codechange: use Textbuf::DeleteAll instead of a duplicate implementation 2025-01-19 23:01:35 +01:00
Rubidium
ff0b2e1064 Codechange: use std::vector instead of ReallocT-ed memory 2025-01-19 22:49:06 +01:00
5f0e4cd646 Codechange: Make RoadStopType an enum class. (#13340) 2025-01-19 21:43:17 +00:00
65665ccb78 Fix bb8a0c7641: Strip control codes before sorting NewGRF names. (#13034)
Now that SkipGarbage doesn't skip all multi-byte utf-8 characters, string control codes are not skipped either. This gave unintended sorting when NewGRF names start with colour codes.

Use StrMakeValid() before comparing. This has to make a copy of the string for each sort step, so there is likely a performance penalty.
2025-01-19 21:39:44 +00:00
SamuXarick
40a29a71fb Cleanup: Remove pointless DiagDirection array (#13338) 2025-01-19 21:38:32 +00:00
4397aa3909 Codechange: Make StationType an enum class. (#13339) 2025-01-19 20:53:08 +00:00
SamuXarick
b0ec3d6959 Cleanup: Missing TileDiffXY conversion in GenerateTerrain 2025-01-19 19:14:44 +01:00
Rubidium
b71a5158cf Codechange: use INVALID_VEHICLE where that's more appropriate than e.g. vehicle 0 2025-01-19 17:10:21 +01:00
Rubidium
ff8c748bf5 Codefix: VEH_INVALID is not INVALID_VEHICLE 2025-01-19 17:10:21 +01:00
d22fd78b1c Codefix: Sprite offsets and counts are not SpriteIDs. (#13336) 2025-01-19 15:58:13 +00:00
Rubidium
0aa9faf187 Codechange: use INVALID_TOWN instead of 0 to denote 'not applicable' 2025-01-19 16:54:42 +01:00
translators
00367aa391 Update: Translations from eints
catalan: 5 changes by J0anJosep
portuguese: 5 changes by jcteotonio
2025-01-19 04:41:07 +00:00
translators
642874923d Update: Translations from eints
chinese (traditional): 38 changes by KogentaSan
dutch: 5 changes by Afoklala
2025-01-18 04:40:32 +00:00
6c88169d7b Codechange: Use std::variant instead of type and union to evaluate Action 14. (#13328)
AllowedSubtags are now passed by span, so no terminator is required, and are now static constexpr.
2025-01-17 20:53:19 +00:00
2f0b52d5b3 Codechange: Use sorted vector for NewGRF parameter value names. (#13326)
This replaces use of a std::map per GRF-parameter.
2025-01-17 19:33:11 +00:00
SamuXarick
610026ef17 Fix: Missing water region invalidation after flooding a half tile with rail in the highest corner
Invalidate water region when any flood occurs.
Convert a few magic numbers to their names.
2025-01-17 18:13:51 +01:00
translators
097937ecdf Update: Translations from eints
english (au): 5 changes by krysclarke
norwegian (bokmal): 8 changes by eriksorngard
chinese (simplified): 5 changes by WenSimEHRP
korean: 5 changes by telk5093
greek: 5 changes by gh658804
russian: 5 changes by Ln-Wolf
finnish: 5 changes by hpiirai
portuguese (brazilian): 5 changes by pasantoro
polish: 5 changes by pAter-exe
2025-01-17 04:44:41 +00:00
translators
5fea35ba07 Update: Translations from eints
korean: 1 change by telk5093
portuguese: 1 change by azulcosta
2025-01-16 04:41:51 +00:00
Rubidium
8f7468483a Codechange: use std::unique_ptr over manual memory management 2025-01-15 21:52:21 +01:00
8942ac1e3e Fix 4c8f1b0f8: Remove unnecessary icon from settings drop down list. (#13322) 2025-01-15 14:12:27 +00:00
SamuXarick
4018179d7b Cleanup: Remove unused includes and function (#13321) 2025-01-15 14:50:14 +01:00
translators
71efd6497a Update: Translations from eints
danish: 68 changes by Lerura-DK
2025-01-15 04:41:43 +00:00
4c8f1b0f81 Add: Ability to toggle visibility of station signs by facility. (#13207) 2025-01-14 21:23:35 +00:00
74bd064d10 Codechange: Pass first and last ID range instead of first and count. (#13319)
This allows range checks and loops to be slightly simplified.
2025-01-14 21:22:52 +00:00
3edf19a2c5 Add: Sandbox settings to Sandbox Options window. (#13268) 2025-01-14 21:22:19 +00:00
Rubidium
e2b0ea1509 Codechange: use std::unique_ptr over MallocT/free for dedicated video memory 2025-01-14 21:43:37 +01:00
84e049e23c Codechange: Use ranges to get select server list position. (#13316)
Replaces a raw loop that uses array indexes.
2025-01-14 19:16:46 +00:00
95f8fc983b Codechange: Make GroupFlags an enum class. (#13312)
GF_END is 'reserved' in some Windows APIs. Instead of working around it, make GroupFlags an enum class.
2025-01-14 11:33:26 +00:00
Rubidium
29129e12fd Add: [Script] Event for when a company's president name changes 2025-01-14 11:35:35 +01:00
Björn Wärmedal
9ab936f76b Add: [Script] ScriptEventCompanyRename (#12878) 2025-01-14 09:24:28 +00:00
Rubidium
3a7cfafe51 Codechange: use std::unique_ptr over CallocT for tiles 2025-01-13 23:13:53 +01:00
Rubidium
3541ba4d0c Codechange: use unique_ptr over CallocT and avoid copying table 2025-01-13 23:13:28 +01:00
41c9f2d82c Codefix: Pass cargo as CargoID. (#13311) 2025-01-13 19:23:26 +00:00
Loïc Guilloux
4670a62342 Fix: [Win32] Font detection didn't work for locales not supporting code pages (#13306) 2025-01-12 17:23:41 +01:00
11529d865b Codefix: [NewGRF] Don't read an extended byte into uint8_t. (#13302) 2025-01-11 15:53:24 +00:00
translators
8b664a42b0 Update: Translations from eints
dutch: 3 changes by Afoklala
2025-01-11 04:41:49 +00:00
Loïc Guilloux
fdc51fd635 Codefix c0edbe0d37: [CI] Invalid needs in ci-nightly (#13301) 2025-01-10 22:38:39 +01:00
SamuXarick
d74255a3ec Codechange: Optimize FlowsDown (#13262) 2025-01-10 11:18:54 -05:00
translators
4f33819fc2 Update: Translations from eints
english (us): 3 changes by 2TallTyler
2025-01-10 04:42:20 +00:00
Loïc Guilloux
46f181c8a6 Fix #13299: Merge IT_INVALID and INVALID_INDUSTRYTYPE (#13300)
* Fix #13299: Merge IT_INVALID and INVALID_INDUSTRYTYPE

* Codefix: Use NUM_INDUSTRYTILES where it's intended
2025-01-10 01:17:11 +01:00
c0edbe0d37 Change: Remove support for SDL1.2. (#13298)
Our SDL2 driver is now 5 years old.
2025-01-09 20:43:52 +00:00
4db0af99a7 Codechange: Use separate function for planting an individual tree. (#13296)
This allows early return and removes use of assignment inside if-conditions.
2025-01-08 20:36:38 +00:00
f404f3154e Fix #13293: Incorrect GRFStringID used for industry cargo suffix text. (#13294)
Industry cargo suffix string should be mapped to 0xD000-0xD400 when the callback result is between 0x800-0xC00,
2025-01-08 19:37:38 +00:00
ce4012b7c7 Codechange: Use enum class for Borders values. (#13290)
This makes water border settings type-safe, and avoids mixing bit numbers with masks.
2025-01-08 17:55:53 +00:00
Valeri
d79ae73c14 Add: 2D map scrolling on win32 (#13172) 2025-01-08 11:09:39 -05:00
translators
87acf1788b Update: Translations from eints
vietnamese: 3 changes by KhoiCanDev
portuguese: 12 changes by jcteotonio
2025-01-08 04:42:08 +00:00
Rubidium
08d84b2f4a Codechange: use AdviceType over StringID to remove vehicle advice news 2025-01-08 02:03:55 +01:00
translators
0437701ebe Update: Translations from eints
swedish: 3 changes by joeax910
hebrew: 124 changes by yair-bn
spanish: 3 changes by MontyMontana
polish: 1 change by pAter-exe
2025-01-07 04:41:39 +00:00
translators
1bf45cd6ef Update: Translations from eints
korean: 3 changes by telk5093
2025-01-06 04:43:13 +00:00
glx22
b88df0b2d7 Fix: Restore ability to disable service interval 2025-01-05 23:31:50 +01:00
glx22
7493b2d0c1 Codechange: Add callback to IntSettingDesc to support dynamic min/max 2025-01-05 23:31:50 +01:00
SamuXarick
bf02cb014b Codefix: Replace C style cast with C++ style static_cast for type safety 2025-01-05 15:17:40 +01:00
translators
a97d220f0b Update: Translations from eints
chinese (traditional): 161 changes by KogentaSan
chinese (simplified): 4 changes by WenSimEHRP
russian: 3 changes by Ln-Wolf
2025-01-05 04:41:44 +00:00
Rubidium
fe4ca52059 Codechange: replace magic numbers with named constants 2025-01-04 23:20:33 +01:00
Michael Lutz
681b0370b0 Feature: [Win32] Draw window title bar according to current Windows light/dark theme (#13196) 2025-01-04 22:03:33 +01:00
Rubidium
532f7de1f8 Codechange: make direct access to tooltip/widget_data protected 2025-01-04 21:55:43 +01:00
SamuXarick
e543768570 Cleanup: Tidy up variables in River_FoundEndNode (#13276) 2025-01-04 21:39:07 +01:00
Rubidium
76cc3438bf Codechange: make GetSpecialNameString less magic-number heavy 2025-01-04 21:06:07 +01:00
Rubidium
1e383d576b Codechange: change SPECSTR_ to StringID and remove unused enumeration 2025-01-04 21:06:07 +01:00
Rubidium
ed36305d29 Codechange: prefer SPECSTR_TOWNNAME_START over _ENGLISH 2025-01-04 21:06:07 +01:00
Rubidium
65731bb964 Codechange: use SPECSTR_..._END over _LAST, to prevent + 1 everywhere 2025-01-04 21:06:07 +01:00
Rubidium
bfc8ae6c52 Codechange: use accessor for (scrollbar_)index as they are read only 2025-01-04 20:51:47 +01:00
b653f875b0 Codechange: Space between template and < (#13278)
Make it all consistent so it matches CODINGSTYLE.
2025-01-04 17:56:14 +00:00
Michael Lutz
80be5115fe Doc: Clarify "const" coding style. (#13277) 2025-01-04 17:25:22 +00:00
Loïc Guilloux
1364b9f641 Fix: Hide company settings from console commands (#13269) 2025-01-04 15:13:08 +01:00
Rubidium
6d9f30c343 Codefix: prevent matrix overflows on high resolution monitors 2025-01-04 12:18:37 +01:00
Rubidium
99d790c4bb Codechange: split widget_data into its actual components 2025-01-04 11:33:24 +01:00
translators
df6e2d7aa4 Update: Translations from eints
english (au): 3 changes by krysclarke
spanish (mexican): 6 changes by absay
greek: 3 changes by gh658804
hebrew: 127 changes by yair-bn
finnish: 3 changes by hpiirai
catalan: 3 changes by J0anJosep
portuguese: 3 changes by azulcosta
portuguese (brazilian): 3 changes by pasantoro
polish: 3 changes by pAter-exe
2025-01-04 04:41:16 +00:00
Loïc Guilloux
a52923b3b9 Codechange: Make GetDefaultValueCallback() more similar to other setting override callbacks (#13259) 2025-01-04 00:17:47 +01:00
d38ecd6525 Change: Log changes to sandbox settings. (#13267)
One of the features of cheats is that there is a record of a cheat being used.

As cheats are slowly ending up in settings instead, add a flag so that changes to these sandbox settings are logged.
2025-01-03 23:12:49 +00:00
Rubidium
ef87acc1ff Codechange: make STR_NULL the default for all widget construction functions 2025-01-03 23:25:27 +01:00
Rubidium
60b9eb5cc6 Codechange: replace last usage of SetDataTip with specific variant 2025-01-03 23:25:07 +01:00
Loïc Guilloux
cb18cb5832 Change: Disable service interval widgets for non-owned vehicles (#13260) 2025-01-03 18:38:45 +00:00
SamuXarick
59a45cc852 Codefix 6222ced: Rename variables to adhere to codestyle (#13255) 2025-01-03 12:20:09 -05:00
SamuXarick
b91f8c13b8 Codechange: Remove macros and use direct methods instead (#13257) 2025-01-03 17:13:41 +00:00
Loïc Guilloux
b3660bf24a Fix: IntSettingDesc may have a callback for default value (#13240) 2025-01-03 15:05:56 +01:00
Rubidium
c972a9ae1f Codechange: remove (unused) tooltip from function to set matrix dimensions 2025-01-03 15:05:10 +01:00
Rubidium
3ecd1187ba Codechange: set sprite once for group UI 2025-01-03 14:19:35 +01:00
Rubidium
7c1ddd74d5 Codefix: use SetToolTip(..) instead of SetStringTip(STR_NULL, ..) 2025-01-03 14:18:59 +01:00
Rubidium
88c08561b3 Codefix: SetToolTip(STR_NULL) is a pointless 2025-01-03 14:15:50 +01:00
SamuXarick
6222cedcc1 Codefix: Rename variables to adhere codestyle 2025-01-03 13:54:46 +01:00
Rubidium
b60101853c Codechange: add and use SetString over directly accessing widget_data 2025-01-03 12:14:55 +01:00
Rubidium
fb06ddafba Codechange: add and use SetSprite over directly accessing widget_data 2025-01-03 11:13:16 +01:00
Rubidium
9ac1bad480 Codechange: add and use GetString over directly accessing widget_data 2025-01-03 11:11:01 +01:00
Rubidium
56d4d3cc7a Codechange: add and use GetToolTip instead of direct access 2025-01-03 11:10:05 +01:00
Rubidium
f0a74fcabb Codechange: use SetToolTip instead of accessing tool_tip directly 2025-01-03 11:09:49 +01:00
Rubidium
3dd0b93698 Codechange: use SetStringTip instead of accessing widget_data and tool_tip directly 2025-01-03 11:09:49 +01:00
Rubidium
3196e0709d Codechange: replace internal SetDataTips with appropriate variants 2025-01-03 11:09:49 +01:00
Rubidium
176eabf9b2 Codefix: replace 0 with STR_NULL 2025-01-03 08:44:53 +01:00
translators
3852a2a0b4 Update: Translations from eints
spanish (mexican): 17 changes by absay
2025-01-03 04:43:20 +00:00
Rubidium
08f3fa54d1 Codechange: manual conversions to remove the global SetDataTip 2025-01-02 23:28:43 +01:00
Rubidium
7c2668d10f Codechange: replace SetDataTip(0x0, with SetTooltip( 2025-01-02 23:28:43 +01:00
Rubidium
ee3ea57a85 Codechange: replace SetDataTip(RWV_ with SetResizeWidgetTypeTip(RWV_ 2025-01-02 23:28:43 +01:00
Rubidium
e3a5f9b040 Codechange: replace SetDataTip(AWV_ with SetArrowWidgetTypeTip(AWV_ 2025-01-02 23:28:43 +01:00
Rubidium
d8d03212b8 Codechange: replace SetDataTip(SPR_ with SetSpriteTip(STR_ 2025-01-02 23:28:43 +01:00
Rubidium
4bf36e3fa6 Codechange: replace SetDataTip(STR_ with SetStringTip(STR_ 2025-01-02 23:28:43 +01:00
Rubidium
7d8bbd4669 Codechange: add specific variants of SetDataTip 2025-01-02 23:28:43 +01:00
810e442203 Codechange: Split GoodsEntry cargo and flows data to unique_ptr. (#13058)
This allows cargo packets and cargo flow data to be empty if not in use, which is the case for the majority of station goods entries, and data is allocated when needed.

This reduces the initial size of a Station from 9192 bytes to 2024 bytes (on 64 bit platforms), although an allocation of 120 bytes is made for each active cargo type at a station.

Based on similar changes in JGRPP.
2025-01-02 20:48:23 +00:00
810dc23215 Codechange: Replace viewport StringID specialisation with flags. (#13237)
When drawing viewport strings, the StringID is used to determine how to draw the sign. Instead, allow the behaviour to be set by the caller with flags. This means that some of the viewport-specific strings are no longer necessary.

ViewportAddString() now returns a pointer to a string as it may not actually add the string, in which case preparing the string parameters in advance is a waste of time.
2025-01-02 20:47:12 +00:00
Rubidium
fd7a883cbd Codechange: make the StringIndex (within a StringTab) a strong type 2025-01-02 21:19:00 +01:00
2d372fa516 Codechange: NewGRF strings are not StringIDs.
Add GRFStringID type and use it when dealing with GRF-local string IDs.
2025-01-02 20:03:40 +00:00
Rubidium
a59cd8b2c0 Codefix: narrowing warnings with MSVC when base type is smaller than int 2025-01-02 20:03:40 +00:00
Rubidium
fedfacf472 Codechange: always do StringID + offset, instead of offset + StringID 2025-01-02 17:09:31 +01:00
4edde7d6de Change: [NewGRF] Use deferred string mapping for bridge and currency names. (#13230)
This means that the strings can now be defined after the properties using them, as is the case with all other features.
2025-01-02 09:35:15 +00:00
Rubidium
666f7bfe23 Doc: mention that frozen production can yield varying production per period 2025-01-02 06:01:37 +01:00
translators
8eb6e7116d Update: Translations from eints
spanish (mexican): 1 change by absay
chinese (simplified): 11 changes by WenSimEHRP
2025-01-02 04:42:37 +00:00
0464e6bd13 Codefix: Remove obsolete industry string mapping. (#13229)
These strings are already correctly mapped by the deferred AddStringForMapping() system.
2025-01-01 22:37:43 +00:00
d7235dc765 Codefix: Script's last_error is not a StringID. (#13227) 2025-01-01 21:35:41 +00:00
8dfab2a607 Fix #13225: Cargo payment graph key toggled wrong data sets. (#13226)
Cargo payment graph should now be filtered only by CargoID instead of sorted position.
2025-01-01 20:34:55 +00:00
Rubidium
c0df898ac5 Codechange: do not implicitly convert during assignment to StrongType 2025-01-01 21:32:51 +01:00
448d6ede4a Codechange: Use STR_NULL (or {}) instead of literal 0. (#13222) 2025-01-01 20:17:20 +00:00
e9e603b4fd Codefix: Company name is a StringID. (#13224)
StringID was passed to Company's constructor as a uint16_t.
2025-01-01 20:16:59 +00:00
31fd71e1ac Codefix: Use this->tile for member variable of Tile. (#13221) 2025-01-01 16:41:13 +00:00
Rubidium
a22e357911 Codechange: make strongtype constructor explicit 2025-01-01 17:40:00 +01:00
98e980c478 Codechange: WWT_TEXT, WWT_LABEL and WWT_EMPTY don't use colour. (#13218)
Set colour for these widget types to INVALID_COLOUR to avoid giving the impression that the colour has a purpose.

A runtime exception is added to catch this the existing widget unit test.
2025-01-01 15:38:19 +00:00
b1cac3c1a9 Codechange: Use _TOOLTIP suffix for another tooltip StringID. (#13219) 2025-01-01 15:38:02 +00:00
Rubidium
3956ed086a Codechange: use Date/Year constructor explicitly 2025-01-01 16:25:32 +01:00
Rubidium
f55ba40b13 Codechange: use TileIndex constructor explicitly 2025-01-01 16:25:23 +01:00
Rubidium
fd5f6caed4 Codechange: use explicit TileIndex constructor for tile 0 2025-01-01 08:26:54 +01:00
Rubidium
562ec74812 Codechange: use explicit TileIndex constructor for converting from window number 2025-01-01 08:26:54 +01:00
translators
91f8f8b7e1 Update: Translations from eints
spanish (mexican): 280 changes by absay
polish: 3 changes by pAter-exe
2025-01-01 04:43:09 +00:00
74087e6a2e Codechange: Use _TOOLTIP suffix for other tooltip StringIDs. 2025-01-01 02:28:08 +00:00
1ba0598a2c Codechange: Use _TOOLTIP suffix for scenario editor toolbar tooltip StringIDs. 2025-01-01 02:28:08 +00:00
ad26b1e8b1 Codechange: Use _TOOLTIP suffix for custom face tooltip StringIDs. 2025-01-01 02:28:08 +00:00
dba02edfa3 Codechange: Use _TOOLTIP suffix for depot tooltip StringIDs. 2025-01-01 02:28:08 +00:00
806831af46 Codechange: Use _TOOLTIP suffix for genworld tooltip StringIDs. 2025-01-01 02:28:08 +00:00
0e1002bca6 Codechange: Use _TOOLTIP instead of _TT suffix for tooltip StringIDs. 2025-01-01 02:28:08 +00:00
6b931667c9 Codechange: Use _TOOLTIP suffix fot replace vehicle tooltip StringIDs. 2025-01-01 02:28:08 +00:00
ab1f2683bc Codechange: Simplify initialisation of default CargoLabels. (#13214) 2025-01-01 00:23:28 +00:00
Rubidium
921980d5e2 Codechange: use explicit Year constructor call in data tables 2025-01-01 00:38:35 +01:00
Rubidium
5a4f802c2f Codechange: use RandomTile over Random() when looking for (part of) a random tile 2025-01-01 00:15:22 +01:00
Rubidium
9b3f4dff4c Codechange: swap int + year to year + int
This way the operator+ without implicit constructor call is used
2025-01-01 00:10:35 +01:00
Rubidium
58ba8c122b Codechange: use constructor instead of assignment for date/year constants 2025-01-01 00:10:35 +01:00
translators
41f7d54b4f Update: Translations from eints
czech: 75 changes by adamek0202
polish: 9 changes by pAter-exe
2024-12-31 04:42:20 +00:00
translators
3a05978cc4 Update: Translations from eints
chinese (simplified): 1 change by WenSimEHRP
luxembourgish: 5 changes by phreeze83
polish: 45 changes by pAter-exe
2024-12-30 04:43:05 +00:00
translators
f077dd7ce2 Update: Translations from eints
polish: 1 change by pAter-exe
2024-12-29 04:41:41 +00:00
Loïc Guilloux
d840152cb7 Codefix: [Script] incorrect end of class detection for doxygen (#13204) 2024-12-28 18:15:09 +00:00
translators
be33f29984 Update: Translations from eints
chinese (simplified): 2 changes by WenSimEHRP
luxembourgish: 10 changes by phreeze83
polish: 26 changes by pAter-exe
2024-12-28 04:41:43 +00:00
dd87bf9333 Fix: Rail station tile flags were not set early enough. (#13203)
Rail station tile flags now use bits that were (long ago) used to store railtype.

During Afterload, there are some calls that need the state of station tile flags to be correct which were executed before the station tile flags were set.
2024-12-27 14:27:55 +00:00
translators
e76cc89255 Update: Translations from eints
spanish: 124 changes by MontyMontana
2024-12-27 04:42:38 +00:00
1faf60ae13 Fix #13199: -f command line parameter does not need a value. (#13200) 2024-12-27 00:16:34 +00:00
Patric Stout
ae7bd04de8 Fix: [CI] also generate a changelog for nightlies (#13197) 2024-12-26 10:19:45 +00:00
translators
c5ec55b4ed Update: Translations from eints
luxembourgish: 2 changes by phreeze83
turkish: 33 changes by BeratSJ
2024-12-26 04:42:27 +00:00
merni-ns
f398a01c3c Fix: Changelog script was broken on markdown changelogs (#13195) 2024-12-25 14:02:34 +00:00
SamuXarick
ee860a5c8e Doc: Update some yapf inline comments 2024-12-24 20:43:46 +01:00
Rubidium
cd0e1fc47d Doc: update changelog 2024-12-24 13:12:02 +01:00
translators
f74b0cf984 Update: Translations from eints
chinese (simplified): 2 changes by WenSimEHRP
2024-12-24 04:44:12 +00:00
b35284d3dd Fix 6a07f28103: Clearing animated tiles may lead to invalid state. (#13192) 2024-12-23 22:35:43 +01:00
1cf3a2a726 Codechange: No need to call DeleteAnimatedTile and DoClearSquare. (#13191)
DoClearSquare calls DeleteAnimatedTile itself so this is effectively a duplicate call.
2024-12-23 19:08:03 +00:00
SamuXarick
90a8d7a953 Doc: Missing closing span tags in landscape_grid (#13056) 2024-12-23 17:39:55 +01:00
Rubidium
71ad0a7343 Doc: add missing '- ' for lists and merge release/14's changes 2024-12-23 17:27:46 +01:00
Michael Lutz
f79d03ec48 Doc 4f9c10d35f: Misaligned type/height columns in landscape_grid. (#13185) 2024-12-23 14:33:55 +01:00
c72542431a Change: Increase house type limit from 512 to 4096. (#12288)
This moves HouseType from m4+m3[6] to m8 making it 'easier' to access.
2024-12-22 18:14:06 +00:00
SamuXarick
8e948af3bc Codefix: Ensure assertions are properly encapsulated within WITH_ASSERT directive 2024-12-22 14:02:13 +01:00
SamuXarick
de908e08b2 Codefix: Remove duplicated include 2024-12-22 14:01:40 +01:00
Rubidium
54d58a08f3 Codechange: use (better) named constants for the bridge sprite table 2024-12-22 13:59:18 +01:00
2176d49a39 Revert: "Codechange: remove parameter which value can always be deduced" (#13183)
This reverts commit dfb74e25f7.
2024-12-21 19:49:02 +00:00
2c740cf7e7 Change: Hide buttons in Found Town window that can't be used. (#13182)
When allowed to found towns in game, some buttons are disabled as they are only available in the scenario editor.

Instead of disabling these buttons, completely hide them when in game.
2024-12-21 18:31:21 +00:00
59680867c3 Codechange: Use structured bindings when iterating font_mapping. 2024-12-20 19:05:08 +00:00
c78e309b16 Codefix: Use snake_case instead of camelCase in layouters. 2024-12-20 19:05:08 +00:00
Rubidium
d623aa0dfb Fix: no need to guard free() 2024-12-20 19:08:10 +01:00
Loïc Guilloux
fefa18fb03 Fix c91d4104f8: \u200B is not allowed in translations (#13179) 2024-12-20 17:07:55 +00:00
Yakov Lipkovich
be02b54744 Doc: fix typo in script_vehicle.hpp (#13177) 2024-12-20 08:42:57 -05:00
translators
c91d4104f8 Update: Translations from eints
danish: 25 changes by bscargo
2024-12-20 04:44:17 +00:00
Loïc Guilloux
9d0939199a Update: vcpkg baseline (#13178) 2024-12-20 00:04:03 +01:00
translators
07fb13cd29 Update: Translations from eints
chinese (simplified): 154 changes by WenSimEHRP
2024-12-19 04:44:42 +00:00
c4424aa894 Codechange: Use correct char type in RemapNewGRFStringControlCode. (#13173) 2024-12-18 12:58:23 +00:00
Jonathan G Rennison
e3e3cb13c6 Change: Include new cargo classes in dump cargo types console command 2024-12-18 07:50:33 +01:00
translators
e78cd7d6e9 Update: Translations from eints
swedish: 1 change by joeax910
chinese (simplified): 13 changes by tinygrox
polish: 2 changes by pAter-exe
2024-12-18 04:44:43 +00:00
translators
07fb7d20db Update: Translations from eints
russian: 1 change by Ln-Wolf
polish: 13 changes by pAter-exe
2024-12-17 04:46:40 +00:00
translators
6ba6ae5e6f Update: Translations from eints
vietnamese: 9 changes by KhoiCanDev
chinese (simplified): 18 changes by tinygrox
2024-12-16 04:45:51 +00:00
translators
8bf2ab62d9 Update: Translations from eints
norwegian (bokmal): 1 change by eriksorngard
chinese (simplified): 9 changes by tinygrox
2024-12-15 04:43:59 +00:00
Eri the Switch
69ee8a8480 Add: Implement 2D map scrolling under SDL2 (#13167)
Use a base multiplier to keep the existing option range (1-15).

SDL2 >= 2.18 allows for considerably smoother scrolling, but
basic support for earlier versions is included.
2024-12-14 15:43:31 +00:00
Eri the Switch
32dfb37b9d Change: Use floats for tracking 2D scrolling
This ensures the smoothest experience possible when dragging map
around with 2D scrolling.
2024-12-14 15:43:31 +00:00
translators
25cf382971 Update: Translations from eints
english (us): 12 changes by 2TallTyler
dutch: 1 change by Afoklala
polish: 10 changes by pAter-exe
2024-12-14 04:44:40 +00:00
Valeri
5d8e98207d Codechange: Use lowercase name for winnls.h (#13170)
Fixes cross-compilation under MXE.
2024-12-13 19:55:53 +01:00
translators
15059bc253 Update: Translations from eints
swedish: 8 changes by joeax910
2024-12-13 04:45:31 +00:00
eacec144b0 Fix 56510b5d7b: CargoArray does need to be initialised... (#13168) 2024-12-12 19:33:55 +00:00
e30c5e6b9e Codechange: Return pair from instead of optional out parameter. (#13166)
GetVehicleDefaultCapacity() has a pointer as an optional out parameter, but it is always used.

Return a std::pair instead.
2024-12-12 08:57:30 +00:00
56510b5d7b Codechange: Use CargoArray for linkgraph refresher. (#13165)
`uint capacities[NUM_CARGO]` looks a lot like CargoArray.
2024-12-11 19:24:58 +00:00
translators
677bd52c65 Update: Translations from eints
polish: 67 changes by pAter-exe
2024-12-11 04:45:53 +00:00
SamuXarick
1e259b7f47 Codefix: Missing this-> in Kdtree (#13095) 2024-12-10 17:30:55 +00:00
aa461fca68 Codechange: A transparent FrameRect doesn't care about colours. (#13162) 2024-12-10 05:00:46 +00:00
translators
ad7738cff8 Update: Translations from eints
catalan: 12 changes by J0anJosep
latvian: 9 changes by lexuslatvia
2024-12-10 04:45:45 +00:00
f8e9ee6fec Codefix: Scenario climate selection buttons shouldn't include size of (unset) integer. (#13161) 2024-12-09 23:42:14 +00:00
translators
95d22bac89 Update: Translations from eints
chinese (traditional): 10 changes by KogentaSan
galician: 9 changes by pvillaverde
korean: 9 changes by telk5093
russian: 10 changes by Ln-Wolf
polish: 1 change by pAter-exe
2024-12-09 04:46:17 +00:00
1e77fd0b61 Codechange: Remove unnecessary 'return_cmd_error` macro. (#13160)
This macro is a leftover from when errors used to be packed into a single int32_t.

`return CommandCost` is clearer, and doesn't need a macro.
2024-12-08 18:02:30 +00:00
369e8a6fe9 Cleanup: Remove unused-strings hack for _TINY string variants. 2024-12-08 10:23:52 +00:00
5575c0ba5a Codechange: Deduplicate text effect strings.
Small viewport signs are drawn with FS_SMALL, so there is no need to duplicate text effect strings for both normal and small versions.

This also avoids an extra string format when text effect positions are updated.
2024-12-08 10:23:52 +00:00
translators
d0d5a18120 Update: Translations from eints
english (au): 1 change by krysclarke
norwegian (bokmal): 8 changes by eriksorngard
chinese (simplified): 1 change by WenSimEHRP
greek: 1 change by gh658804
russian: 52 changes by Ln-Wolf
finnish: 1 change by hpiirai
french: 1 change by glx22
portuguese: 1 change by azulcosta
portuguese (brazilian): 1 change by pasantoro
2024-12-08 04:44:40 +00:00
7af16bff11 Codechange: Use vector for GRFFile parameters instead of array. (#13157)
This simplifies assigning default parameters and removes the param_end member.
2024-12-07 22:08:59 +00:00
3d73c95080 Fix: Potential out-of-bounds reads due to uninitialised string parameters. (#13153)
If string parameters are not set correctly, FormatString can read out of bounds and crash the game.

This does not fix the root cause, just a nasty symptom.
2024-12-07 15:48:49 +00:00
f5d78f9eba Change: [NewGRF] Install translation tables into overridden NewGRF. (#12879)
When a NewGRF overrides another, any translation table that the overriding NewGRF installs will also be installed in the target file.

This allows the overridden NewGRF to make use of a cargo or rail/road type translation table without directly modifying the original file.
2024-12-07 11:26:53 +00:00
caead883a5 Fix 560ee2442d: MinGW package is -libogg, not -ogg. (#13152) 2024-12-07 11:03:29 +00:00
translators
04621d1be3 Update: Translations from eints
chinese (simplified): 8 changes by WenSimEHRP
dutch: 8 changes by Afoklala
portuguese: 8 changes by azulcosta
polish: 3 changes by pAter-exe
2024-12-07 04:45:11 +00:00
560ee2442d Add: Support sound effects in Ogg Opus format. 2024-12-06 18:41:35 +00:00
8b00661b22 Change: Add sound memory usage to framerate window. 2024-12-06 18:41:35 +00:00
ce5279a8dc Codechange: Implement SoundLoader interface and cache loaded sounds in memory.
Sounds are loaded into memory on first use, using the SoundLoader interface to support format conversion. Sounds are retained in memory to avoid reloading every time a sound is played.

This deduplicates WAV header parsing between NewGRF and baseset sounds, and will allow different audio formats to be supported.
2024-12-06 18:41:35 +00:00
7e8bcf44f7 Codechange: ProviderManager class to support self-registration of providers.
This is based loosely on TimerManager.
2024-12-06 18:41:35 +00:00
bccf5343f4 Codechange: Use a type alias for mixer channel masking. 2024-12-06 18:41:35 +00:00
cba329d9e2 Add: Translatable list separator. (#13149)
Some languages should use a separator other than ", " to separate list items, so it is now a translatable string.
2024-12-06 12:32:36 +00:00
rubidium42
ef76f0e758 Codechange: use default virtual destructors over empty destructors 2024-12-06 22:30:19 +10:00
Koen Bussemaker
701cb2e9d7 Codechange: Move two way signal EOL to a more logical place 2024-12-06 09:27:32 +01:00
translators
ca148022f7 Update: Translations from eints
english (au): 8 changes by krysclarke
greek: 8 changes by gh658804
russian: 8 changes by Ln-Wolf
finnish: 8 changes by hpiirai
french: 11 changes by glx22
portuguese (brazilian): 8 changes by pasantoro
polish: 8 changes by pAter-exe
2024-12-06 04:45:53 +00:00
SamuXarick
005c47c322 Codechange: Use Map::Iterate() on CreateDesertOrRainForest routine 2024-12-06 10:33:11 +10:00
SamuXarick
913d6eceb0 Codechange: Use Map::Iterate() on waypoint conversion
Still maintains the same logic as before when determining valid and invalid waypoints.
2024-12-06 10:33:11 +10:00
SamuXarick
7d0b1cd002 Codechange: Replace while loop with Map::Iterate() 2024-12-06 10:33:11 +10:00
SamuXarick
10e2d1ca36 Codechange: Use Map::Iterate() to iterate tiles 2024-12-06 10:33:11 +10:00
cfb995b6e9 Codechange: Reimplement engine sort order with std::rotate. (#13124) 2024-12-05 22:17:40 +00:00
f56b6756f1 Codechange: Sort EngineOverrideManager for fast lookups.
Allows quickly finding the EngineID given the type, grfid and local id of an engine, instead a linear scan.

This can reduce loading time when lots of engines are present and also affects performance in-game.
Lookup can be on the order of 10000 times faster.
2024-12-05 18:17:58 +00:00
01d1ea6264 Codechange: Add Slide container helper function.
This function will move the selected range between first and last to position, rotating elements as necessary.

Returns iterators to the new positions.
2024-12-05 18:17:58 +00:00
bc2513975f Codechange: Don't inherit EngineOverrideManager from std::vector.
Inheriting from std::vector means some operations are needlessly complex, and shouldn't really be done anyway.
2024-12-05 18:17:58 +00:00
e73d6fcaac Codechange: Store grfid with entity grfprops.
This allows using the grfid without having to dereference the grffile pointer.

Uses no extra storage as it fits within otherwise wasted padding space.
2024-12-05 18:17:58 +00:00
e750d10cee Codechange: Use std::array for per-NewGRF rail/road type maps. (#13142)
This allows initialisation to be simplified.
2024-12-05 18:17:25 +00:00
translators
7469858f1f Update: Translations from eints
norwegian (bokmal): 3 changes by eriksorngard
latvian: 3 changes by lexuslatvia
2024-12-05 04:46:10 +00:00
62da507aba Codechange: Update minimum CMake version to 3.16 for all parts. (#13141)
The main CMakeList requires 3.16, so bump all other files to match.
2024-12-04 14:12:57 +00:00
6f8e30c55d Codechange: Use unique_ptr throughout instead of new raw pointer for company news data. (#13148)
The pointer was already captured and converted to a unqiue_ptr, but hidden within the call stack.

This now makes it clearer that the object passed to Add.*NewsItem will become owned by the news item.
2024-12-04 12:18:34 +00:00
2ff18a4f05 Fix: String parameter not set when determining width of smallmap contour labels. (#13145) 2024-12-04 12:18:17 +00:00
efcafe49f7 Fix: [NewGRF] New engines did not have a default cargo type set. (#13146)
Engines defined outside the original range did not have their cargo type/cargo label fields initialised properly.
If these engines are also not assigned a cargo type, they would therefore use the cargo in slot 0 instead of falling back to first refittable.
2024-12-03 21:59:22 +00:00
9e182871c7 Add: Show house information in house placer. 2024-12-02 00:48:46 +00:00
041b9181f9 Codechange: Extract code to build cargo acceptance string for re-use. 2024-12-02 00:48:46 +00:00
2ede94bc40 Codechange: Adapt functions to get accepted cargo of prototype house. 2024-12-02 00:48:46 +00:00
3a158c7609 Change: Call custom house name callback in House Picker. 2024-12-02 00:48:46 +00:00
6a07f28103 Codechange: Store animated tile state in map to improve performance.
This allows animated tiles to be added and removed without searching in the animated tile list, providing a performance improvement when there are lots of animated tiles.

Save game version is bumped so that animated tile state can be converted.
2024-12-01 21:19:28 +00:00
44de8d77bf Codechange: Move station tile flag cached bits from m6 to m3.
This frees up bits 0..1 of m6 for all tile types.

No savegame bump is needed as these bits are always reset on load.
2024-12-01 21:19:28 +00:00
be505ec459 Add: Accessor to test if a tile may be animated. 2024-12-01 21:19:28 +00:00
3a310f1802 Codechange: Store GRFConfig parameters in a vector. (#13137)
All GRFConfigs have space allocated for parameters, but only configured GRFConfigs need them.

Using a vector instead means that space is only used when parameters are used.
2024-12-01 15:15:21 +00:00
e28617fda6 Codefix: Avoiding passing new raw pointer into a smart pointer. (#13138)
Use `std::make_shared` or `std::make_unique` instead of `reset(new ...)`.
2024-12-01 14:22:41 +00:00
46176a81e3 Add #12975: Cargo class bits 13 and 14 now define potable and non-potable. (#12979) 2024-12-01 13:48:18 +00:00
910dd65710 Change: Improve news window layouts.
* Use appropriate container widget nesting with padding, instead of single-sided padding.
* Use layer widget to allow main news message to overlay close box and date widgets, to more closely match the old fixed-pixel layout.
2024-12-01 09:44:11 +00:00
60f1618cc7 Add: Widget layer container widget type, NWID_LAYER.
This widget allows child widgets to be overlaid on top of each other.

Very similar to NWID_SELECTION except all layers are always visible.
2024-12-01 09:44:11 +00:00
translators
1885bd7166 Update: Translations from eints
portuguese: 5 changes by azulcosta
2024-12-01 04:47:46 +00:00
30bda88e97 Codefix: NWidgetStacked::AdjustPaddingForZoom duplicates inherited method. (#13135) 2024-11-30 23:15:17 +00:00
568bb1f5da Change: [UI] Improve visual padding of vehicle news items. (#13134) 2024-11-30 15:29:36 +00:00
61cbdef92d Codechange: Make AyStarStatus an enum class. (#13129)
This enforces type-safety.
2024-11-30 14:23:32 +00:00
translators
8d394c697c Update: Translations from eints
dutch: 2 changes by Afoklala
polish: 2 changes by pAter-exe
2024-11-30 04:46:18 +00:00
b6aece5b88 Fix 51bd344f10: Incorrect translation table used for older NewGRFs. (#13131)
Incorrect logic was used to select the default translation table for older GRFs.
2024-11-29 07:46:08 +00:00
fe0afef36f Codechange: Use unique_ptr instead of raw pointer for string layouts. (#13128) 2024-11-27 23:38:57 +00:00
SamuXarick
cf7710fb61 Codechange 8e9603b: Replace int32_t with AyStarStatus (#13127) 2024-11-27 23:26:07 +00:00
9bc64b553b Codechange: Cache callback spritegroups. (#13111)
Each callback result requires a pool memory allocation, each of which is 24 bytes.

Build a cache of results so that if the same result is used later it refers to the same group.
2024-11-27 23:25:35 +00:00
Jonathan G Rennison
f5a6a31e4a Codefix: Avoid divide by 0 in div/mod type varaction2 adjusts (#13123) 2024-11-27 23:24:46 +00:00
23e252ad40 Codechange: Replace FontMap's std::map with std::vector. (#13126) 2024-11-27 12:36:56 +00:00
8b8cd9ae2d Codechange: Use vector for town PSA storage. 2024-11-27 12:35:27 +00:00
177e2ebf80 Codechange: Support saveload of reference vectors.
This uses the same data format as reference lists, but for vectors, so allows data structures to be changed without affecting savegame format.
2024-11-27 12:35:27 +00:00
translators
e7c63de55d Update: Translations from eints
korean: 2 changes by telk5093
ukrainian: 7 changes by CodyMaster3
2024-11-27 04:49:29 +00:00
SamuXarick
8e9603bd33 Codechange: Rename and return AyStarStatus instead of int (#13125)
- Rename enum AystarStatus to AyStarStatus.
- Return AyStarStatus instead of int for AyStar::Main and AyStar::Loop functions.
2024-11-27 00:10:06 +01:00
translators
7c3b0e5c9c Update: Translations from eints
polish: 1 change by pAter-exe
2024-11-26 04:49:08 +00:00
a3437df7b7 Fix #13121: Crash when clicking on scrollbar if contents don't need scrolling. (#13122) 2024-11-25 08:20:20 +00:00
translators
5b02f51e17 Update: Translations from eints
galician: 7 changes by pvillaverde
vietnamese: 3 changes by KhoiCanDev
polish: 12 changes by pAter-exe
2024-11-25 04:48:28 +00:00
0446123194 Change: Show company finances column if it has any values in it. (#13112)
This solves finances not being show if the company inauguration date is in the future.

Current period is now always shown in the same position instead of moving for the first 2 years.
2024-11-24 11:59:30 +00:00
0c04966dc3 Fix #13022: Ensure minimum size of scrollbar slider. (#13119)
When there are many more items than fit in a list, the scrollbar slider scales to fit but there is no minimum size. It becomes too small to click on and use.

Ensure scrollbar slider is at least the same size as the buttons either end.
2024-11-24 11:50:04 +00:00
0b0b4f50c4 Fix: Crash when exiting game with highscore window open. (#13118) 2024-11-24 10:36:21 +00:00
fa1849b855 Codechange: Use std::range::find_if where possible. 2024-11-24 10:36:03 +00:00
059a4b22f7 Codechange: Use projection-based std::range::find where possible.
This simplifies matching by class members and avoids wordy lambdas.
2024-11-24 10:36:03 +00:00
876d53282e Codechange: Use std::ranges::count(_if). 2024-11-24 10:36:03 +00:00
3be0166801 Codechange: Use std::ranges::find where possible.
Replace `std::find(range.begin(), range.end(), ...)` with `std::ranges::find(range, ...)`.
2024-11-24 10:36:03 +00:00
1f18894408 Change: Determine industry directory width only on visible rows. (#13097)
When rebuilding the industry directory list, the width of every item in the list is obtained to get the maximum width required for the horizontal scrollbar. This can take considerable time if there are a lot of industries.

Instead, calculate only for the visible rows, and grow as needed.
2024-11-24 06:51:58 +00:00
translators
9399a92a4f Update: Translations from eints
english (au): 2 changes by krysclarke
swedish: 4 changes by joeax910
chinese (traditional): 2 changes by KogentaSan
chinese (simplified): 3 changes by WenSimEHRP
greek: 4 changes by gh658804
russian: 3 changes by Ln-Wolf
finnish: 4 changes by hpiirai
portuguese (brazilian): 3 changes by pasantoro
polish: 46 changes by pAter-exe
2024-11-24 04:46:32 +00:00
Loïc Guilloux
681b1928b4 Fix #13110: [Script] convert table keys to string when generating JSON (#13113) 2024-11-23 13:46:33 +01:00
b890dab2b4 Change: Treat recolour sprites as regular sprites in the SpriteCache. (#13107)
Recolour sprites are loaded when seen, instead of being loaded when needed. This could result in the sprite cache being filled up with recolour sprites, and also mean that replacing recolour sprites didn't release the previously allocated memory.

Instead, allow recolour sprites to be loaded as needed and freed when unneeded, like regular sprites.
2024-11-23 12:14:46 +00:00
00ae20fa02 Codechange: Tidy up GRFParameterInfo. (#13114)
Use member-initialisation, reorder members to reduce space, and prefer references.

SetValue/GetValue are moved to GRFConfig as they set the config's parameter values.
2024-11-23 12:13:52 +00:00
Jonathan G Rennison
b84a164590 Codechange: Avoid unnecessary re-reads/seeks in RandomAccessFile::ReadBlock 2024-11-23 21:48:22 +10:00
653e5e8b63 Codechange: Use std::visit for formatting script strings. 2024-11-23 10:55:41 +00:00
43da3e7693 Codechange: Use std::visit for ScriptDataVariant. 2024-11-23 10:55:41 +00:00
d875ac8947 Add: const operator->() for ScirptObjectRef. 2024-11-23 10:55:41 +00:00
translators
26ae50baf9 Update: Translations from eints
english (au): 1 change by krysclarke
chinese (traditional): 1 change by KogentaSan
korean: 5 changes by telk5093
greek: 1 change by gh658804
dutch: 1 change by KevinHeijsteeg2
2024-11-23 04:47:22 +00:00
a4b4095232 Codechange: Shuffle Engine members around to reduce size. (#13115)
Reduces overall size of Engine from 752 to 720 bytes.
2024-11-22 23:58:13 +00:00
16038879e4 Codechange: Speed up industry generation using industry-type checks. (#13094)
Store a list of industries per industry type. This allows industry generation checks which only consider a specific industry type to check a reduced set of industries, leading to a potential performance increase.

This also removes the need to track industry type counts as well.
2024-11-22 23:17:24 +00:00
a951896364 Add: Add cargo transported to industry production graph. 2024-11-22 20:47:51 +00:00
22035a4f2a Add: Ability to show and filter different datasets on the same graph. 2024-11-22 20:47:51 +00:00
598fdf04a4 Codechange: Use vector instead of fixed array for graph data. 2024-11-22 20:47:51 +00:00
felixprigge
67a0fccfad Fix: [Timetable] Use days as precision in day mode for accurate timetable syncing (#12683)
Co-authored-by: flowprint <61750128+flowprint@users.noreply.github.com>
2024-11-21 22:27:07 +00:00
6d3adc6169 Codechange: Remove ZeroedMemoryAllocator from ScriptText. (#13108)
ScriptText is much simplified from its original design. Use member initialisation instead.
2024-11-20 22:16:14 +00:00
13da98dab8 Fix: Error message not set when unable load an old save. (#13106) 2024-11-20 18:24:07 +00:00
translators
1b6a6f1cd2 Update: Translations from eints
chinese (simplified): 4 changes by WenSimEHRP
danish: 19 changes by bscargo
2024-11-20 04:46:40 +00:00
b730f8783e Fix d450d4743: Division by zero when larger_towns is set to 0. (#13104)
Universe ended.
2024-11-20 00:09:02 +00:00
9b6b6d50c3 Fix: Network clients incorrectly truncated all strings to NETWORK_COMPANY_NAME_LENGTH. (#13102)
This should no longer be necessary since we used std::strings.
2024-11-19 23:44:54 +00:00
SamuXarick
85e9f5745a Codefix: Replace magic number in Kdtree (#13098) 2024-11-19 20:34:25 +00:00
6c09dcdd66 Codechange: Use reference for non-optional StationList parameter. (#13092) 2024-11-19 20:33:32 +00:00
640a270ed6 Codefix: Use correct type for IndustryType in several industry functions. (#13096) 2024-11-19 20:32:06 +00:00
fcac5479f1 Codechange: Use std::visit for SetupCargoForClimate. (#13103) 2024-11-19 20:30:16 +00:00
fc8685d618 Codechange: Use functor for Kdtree's XYFunc. (#13074)
Kdtree uses a function pointer and incorrectly calls it a functor. The function pointer needs to be passed on instantiaton.

Instead, use an actual functor. This simplifies instantiation.
2024-11-19 20:29:56 +00:00
Koen Bussemaker
369ea29e1e Codechange: Remove redundant checks in FindClosestTrainDepot 2024-11-19 20:42:43 +01:00
f9b5f78b8a Codechange: Use std::visit for GetActiveCargoLabel. 2024-11-19 18:27:19 +00:00
25c5a64d39 Codechange: Use std::visit instead of std::get_if for string parameters. (#13100)
It's tidier and ensures all cases are handled, and doesn't use pointers.
2024-11-19 18:17:41 +00:00
SamuXarick
60ae50e016 Codechange: Make kdtree member functions const for const-correctness (#13099) 2024-11-19 12:36:56 +00:00
Michael Lutz
d2496b6ec4 Add: [NewGRF] Callback for custom refit mask for engines/vehicles. 2024-11-18 22:10:38 +01:00
Michael Lutz
a3ee05737f Add: [NewGRF] Vehicle prop that allows refittability based on cargo class intersection. 2024-11-18 22:10:38 +01:00
c39810ff6a Codechange: Replace path cache queues with vectors.
Ship and RoadVehicle path caches use a std::deque, which is quite memory hungry, especially for RoadVehicle which has two.
std::deque was used to be able to push/pop from either end.

Change to use a single std::vector each, which is now push/popped from the back.
2024-11-18 08:59:41 +00:00
d4f8453c22 Codefix: Clear and reserve storage when loading vectors from savegames. 2024-11-18 08:59:41 +00:00
translators
b8f3d0dd68 Update: Translations from eints
norwegian (bokmal): 4 changes by eriksorngard
2024-11-18 04:49:46 +00:00
d903806e59 Codechange: Add VectorSaveLoadHandler to simplify handlers for vectors. (#13093)
This reduces the duplication needed for each saved complex vector.
2024-11-17 23:46:32 +00:00
translators
a6c526cfa0 Update: Translations from eints
bulgarian: 4 changes by Alexandar83
2024-11-17 04:46:16 +00:00
04b6dfae48 Cleanup: Remove now-unneeded includes from yapf. (#13088) 2024-11-16 23:23:06 +00:00
ec1dc434ac Codechange: Shuffle CommandCost members to reduce size. (#13087)
Prefer member initialisation as well.
2024-11-16 21:49:49 +00:00
Jonathan G Rennison
71ea58c6de Codechange: Remove unused CYapfDestinationTileT (#13086) 2024-11-16 16:12:18 +00:00
57ac1cbe0c Fix: Don't allow right-click to close world generation progress window. (#13084) 2024-11-16 13:54:47 +00:00
translators
8c395ed67c Update: Translations from eints
vietnamese: 4 changes by KhoiCanDev
2024-11-16 04:48:13 +00:00
14e2839087 Codechange: Let's use this new emplace_back() thing. (#13081) 2024-11-15 20:28:17 +00:00
98c8445519 Codechange: Limit house default cargo label lists to original slot counts. (#13079)
Same as for IndustrySpec and IndustryTileSpec.
2024-11-15 08:07:02 +00:00
translators
d6c2f9edf1 Update: Translations from eints
polish: 5 changes by pAter-exe
2024-11-15 04:48:47 +00:00
61aff3fa49 Codechange: Limit industry default cargo label lists to original slot counts. (#13072)
IndustrySpec and IndustryTileSpec cargo label lists are only used for original industries. Original industries can only have up to 2 inputs and 3 outputs. Therefore having space for 16 input/outputs slots is unnecessary

This saves 216 bytes per industry type, and 164 bytes per industry tile type.
2024-11-14 19:05:18 +00:00
translators
9742038b68 Update: Translations from eints
chinese (simplified): 2 changes by WenSimEHRP
2024-11-13 04:45:59 +00:00
Koen Bussemaker
6faf4fa70a Codechange: Simplified YAPF ship region node 2024-11-12 23:17:56 +01:00
Koen Bussemaker
3e195df3c7 Codechange: Cleaned up and renamed NodeList 2024-11-12 21:06:17 +01:00
bbc1f7b3dc Add: Show and toggle follow vehicle state in vehicle view window. (#13076)
* After double-clicking on a location button to follow a vehicle, show that state by drawing the location button in a lowered state.
* Allow cancelling the follow state by clicking on the location button again.
2024-11-12 17:36:24 +00:00
Jonathan G Rennison
78258f13bc Doc: Fix documentation of water tile non-flooding bit in landscape.html (#13071) 2024-11-12 10:17:58 -05:00
translators
ce64d5f5d9 Update: Translations from eints
japanese: 56 changes by akaregi
2024-11-11 04:45:41 +00:00
translators
66198dea46 Update: Translations from eints
japanese: 50 changes by akaregi
german: 4 changes by SecretIdetity
french: 4 changes by ottdfevr
2024-11-10 04:45:21 +00:00
translators
5e4f8db7d6 Update: Translations from eints
latvian: 4 changes by lexuslatvia
2024-11-09 04:45:00 +00:00
Loïc Guilloux
e5edfbadcf Codefix: Silence clang-cl warnings (#13066)
* Codefix ad5da0c: clang-cl doesn't need /Zc:preprocessor

* Codefix: use -Wno-multichar with clang-cl
2024-11-08 14:42:12 +01:00
translators
80f628063a Update: Translations from eints
tamil: 7 changes by merni-ns
2024-11-08 04:45:16 +00:00
Thomas Winwood
b1bba967a1 Add: Improving town-owned bridges increases company rating (#13036) 2024-11-07 08:14:04 -05:00
Jonathan G Rennison
7b3525954c Fix: x-axis direction of industry production graph (#13062) 2024-11-07 08:13:21 -05:00
translators
c9bd21d579 Update: Translations from eints
chinese (traditional): 4 changes by KogentaSan
2024-11-07 04:45:57 +00:00
d54341318e Fix: VF_LOADING_FINISHED and VF_STOP_LOADING flags tested on wrong vehicle part. (#13063)
These flags are only set on the front part of a vehicle as they apply to the whole consist.
2024-11-07 00:25:05 +00:00
Charles Pigott
884b93c4c0 Add: Set application name for SDL2 (#13061) 2024-11-06 19:51:03 +00:00
465df3bab1 Change: Don't try to flood buoys or dock tiles.
This reduces the active flooding water tiles a little more.
2024-11-06 19:44:14 +00:00
8f9836793f Change: Store water tile flooding state in the map.
This allows water tiles which cannot flood any further to not even try to flood.

On a large map with lots of water tiles this can noticeably reduce game loop processing time.

Mostly ported from JGRPP.
2024-11-06 19:44:14 +00:00
Tyler Trahan
4cd46e54aa Fix #12940: Use specific error when overbuilding station on signals (#12943) 2024-11-06 14:13:04 -05:00
Tyler Trahan
c3bb512bd9 Remove: Hidden setting for adjacent stations (#12862) 2024-11-06 14:11:07 -05:00
Joan Josep
5d7a7b2955 Codechange: Simplify IsCompanyBuildableVehicleType. (#12868) 2024-11-06 19:09:09 +00:00
3b6d3080f2 Add: Apply rail/road type conversion when NewGRFs are updated mid-game.
This will update the rail/road type of tiles on the map, taking account of tram state, if types are moved around.
2024-11-06 19:04:44 +00:00
8bb6572943 Add: Implement missing road type label conversion.
This was implemented for rail types but missed for road types.

This lets road type labels to be reordered, allowing for upgrades of NewGRF.
2024-11-06 19:04:44 +00:00
157d028915 Codechange: Simplify testing for railtype map conversion.
Build the list of railtype conversions at the same time as testing if conversion is needed.

This avoids having two similar loops which need to compare the same things.
2024-11-06 19:04:44 +00:00
Jonathan G Rennison
36c735ebfa Codefix: Nullptr dereference in industry var 0xB4 when no cargoes accepted (#13060) 2024-11-06 18:53:48 +00:00
Jonathan G Rennison
59c399c795 Codefix: Documentation comment in IndustryDirectoryWindow (#13059) 2024-11-06 18:52:30 +00:00
translators
29df467d27 Update: Translations from eints
swedish: 4 changes by joeax910
2024-11-06 04:47:50 +00:00
fundawang
14fac2ad37 Fix: build with icu >= 76 where icu-i18n and icu-uc become separated (#13048) 2024-11-05 11:12:34 +00:00
translators
9da6cd4817 Update: Translations from eints
catalan: 4 changes by J0anJosep
2024-11-05 04:45:21 +00:00
translators
362db76e13 Update: Translations from eints
norwegian (nynorsk): 32 changes by Abaksle
2024-11-04 04:47:31 +00:00
f0f62961e1 Codechange: Make two water functions static. (#13057) 2024-11-03 23:25:51 +00:00
a91d889646 Fix #13053: Payment transfers incorrect for non-passenger cargos. (#13054)
CargoPayment required cargo type to be set as state via SetCargo(). This was error prone as CargoPayment is per consist but cargo type can vary per vehicle part. Additionally if SetCargo was not called then the default "uninitialised" state was cargo slot 0, passengers.

Instead of trying to make sure it is set correctly, remove cargo type from CargoPayment and always pass it explicitly to the PayTransfer/PayFinalDelivery methods.
2024-11-03 18:53:01 +00:00
translators
cbde825785 Update: Translations from eints
korean: 5 changes by telk5093
finnish: 4 changes by hpiirai
2024-11-03 04:45:28 +00:00
a1233ee8a1 Codechange: Use span instead of marker terminated array for indexed sprite loading. (#13050) 2024-11-02 14:47:49 +00:00
translators
9193d69e0b Update: Translations from eints
english (au): 4 changes by krysclarke
english (us): 4 changes by 2TallTyler
chinese (simplified): 4 changes by WenSimEHRP
greek: 4 changes by gh658804
russian: 4 changes by Ln-Wolf
dutch: 4 changes by Afoklala
portuguese: 4 changes by jcteotonio
portuguese (brazilian): 4 changes by pasantoro
2024-11-02 04:47:18 +00:00
translators
3a76af0909 Update: Translations from eints 2024-11-01 04:46:43 +00:00
Anatoly Eltsov
3fca0cf3ee Feature: Industry production graph (#10541) 2024-10-31 22:35:04 +00:00
db1a1c5dd9 Change: Invalidate build toolbars when NewGRFs are changed.
If NewGRFs are changed while a rail or road toolbar is open, the toolbar could refer to an invalid rail/road type. If so, close it.
2024-10-31 09:10:01 +00:00
6d2b93d3b3 Codechange: Set up rail/road toolbar buttons during window's OnInit event.
This ensures the buttons are configured without extra initialisation methods.
2024-10-31 09:10:01 +00:00
0e3fdfb1b5 Codechange: Don't store pointer to RoadTypeInfo in road toolbar.
Always look up via stored RoadType instead. This matches out the rail toolbar behaves, and avoids keeping an non-owned pointer lying around.
2024-10-31 09:10:01 +00:00
552cf72b98 Codefix: Immediately return invalid rail/road type when looking for label 0. (#13045)
Looking for label 0 would incorrectly return the first undefined type instead of INVALID_RAIL/ROADTYPE, which could potentially cause incorrect behaviour.
2024-10-31 00:11:16 +00:00
Loïc Guilloux
9dae626237 Codefix: restore _generating_world and nearest town cache when failing to fund a random town (#13042) 2024-10-29 19:56:15 +01:00
Jonathan G Rennison
883be19865 Codefix a6f412c6: Missing this-> in YAPF 2024-10-29 19:07:14 +01:00
Jonathan G Rennison
07e8547eb5 Fix: Terraform of road waypoint tiles (#13040) 2024-10-29 14:08:15 +01:00
Koen Bussemaker
0200bc3720 Codechange: Renamed CHashTableT to HashTable and corrected code style 2024-10-29 08:35:47 +01:00
0e13a7d124 Fix 3f81124: Invalid data used for height map curves after first run. (#13039)
Static variable depended on other non-static variables.
2024-10-28 23:18:05 +00:00
SamuXarick
a96a83e330 Codechange: Code style issues in water regions (#13019) 2024-10-28 10:29:26 -04:00
translators
abd89b0748 Update: Translations from eints
german: 19 changes by Wuzzy2
2024-10-28 04:47:39 +00:00
e076aaf740 Codefix: Use SpriteID when passing sprite IDs. (#13037) 2024-10-27 18:54:49 +00:00
e1697a6ad1 Codechange: Don't use enums for non-enumerated values. (#13031)
In the past we have used enums to hold an arbitrary values. These values
are not enumerated types, so make them constants instead.
2024-10-27 18:02:49 +00:00
SamuXarick
a86f9dba0f Codefix: Correct handling of GetDepotOrderType() comparison (#13023)
In the function where we check the depot order type, using `!=` with GetDepotOrderType() is not ideal because the function can return flag bits.
2024-10-27 18:47:22 +01:00
9cf47e69d6 Fix bb8a0c7641: Skip control codes when sorting strings. (#13035)
Now that SkipGarbage doesn't skip all multi-byte utf-8 characters, string control codes are not skipped either. This gave unintended sorting when NewGRF names start with colour codes.

Make SkipGarbage UTF-8 aware so that it is able to skip some unicode ranges as well.
2024-10-27 15:49:09 +00:00
translators
233ee16c44 Update: Translations from eints
bulgarian: 18 changes by Alexandar83
2024-10-27 04:47:27 +00:00
bb8a0c7641 Fix: SkipGarbage() skipped all multi-byte utf-8 characters. (#13032)
`char` is signed so `str[0] < '0'` applies to all characters higher than 127.
2024-10-26 21:01:33 +01:00
1191efa581 Fix #12914: Fix use of invalidated pointer in viewport drawer. (#12918)
Use index of last child instead of pointer to update next_child element.

In case there is no child sprite yet, the most recent parent sprite's first_child is updated instead.
2024-10-26 15:24:41 +01:00
4f9c10d35f Codechange: Simplify storage of WaterTileType in map. (#13030) 2024-10-26 10:17:44 +01:00
e50c1774fc Codechange: Remove some unnecessary local variables. 2024-10-25 19:01:39 +01:00
c39554a210 Codechange: Simplify selection between pathfinder functions. 2024-10-25 19:01:39 +01:00
1403a55e5d Codechange: Use uppercase naming for YAPF cost constant. 2024-10-25 19:01:39 +01:00
a171939ec3 Codechange: Remove m_ prefix from pathfinders. 2024-10-25 19:01:39 +01:00
a496e9397c Codechange: Prefer member-initialization. 2024-10-25 19:01:39 +01:00
a6f412c615 Codechange: Add this-> to YAPF. 2024-10-25 19:01:39 +01:00
5b73654f94 Codechange: Add includes to YAPF .hpp files. 2024-10-25 19:01:39 +01:00
009e57ee03 Codechange: Use member initializer list. 2024-10-25 19:01:39 +01:00
Rubidium
ea6aa4653a Codechange: replace magic numbers with enumeration 2024-10-25 18:37:11 +02:00
Rubidium
4a4c77ff04 Codechange: use functions described in documentation, instead of related other functions 2024-10-25 18:37:11 +02:00
Jonathan G Rennison
8ed983b3cd Codechange: Re-order load update for SLV_139
It is no longer required to be performed before the first phase
of vehicle updates
2024-10-25 17:05:59 +02:00
Jonathan G Rennison
f19829d029 Fix #12831: Delay vehicle cache init to after map upgrades in load
Split AfterLoadVehicles into two functions.
Vehicle cache init and other functionality requiring an upgraded and
valid map is now performed later in the load process.
2024-10-25 17:05:59 +02:00
Rubidium
dfb74e25f7 Codechange: remove parameter which value can always be deduced 2024-10-24 22:02:50 +02:00
SamuXarick
d5a13fb9f4 Codechange: Use TileOffsByAxis(...) in more places (#13026) 2024-10-24 15:58:15 -04:00
Rubidium
c9819f8957 Codechange: split GetRoadDir as bays have DiagDir and drive throughs have Axis 2024-10-24 20:40:32 +02:00
Da-W1nn3r
d6aa09f96a Fix #12973: Don't exclude high score after using sandbox 2024-10-24 08:38:16 +02:00
Rubidium
ce641af6a9 Codechange: use StationGfx over RoadStopDir + optional offset for drive through stop 2024-10-23 18:19:32 +02:00
Rubidium
38c9eb76a0 Codechange: add and use TileOffsByAxis(...) over TileOffsByDir(DiagDirToAxis(...)) 2024-10-23 18:19:17 +02:00
7a71df2952 Codechange: Use fmt::format to convert value to binary string representation. (#13016)
Avoids manually iterating bits into an array.
2024-10-22 13:59:08 +01:00
translators
51ffb2a1a3 Update: Translations from eints
arabic (egypt): 3 changes by Alaadel
2024-10-22 04:47:27 +00:00
01807fa753 Change: Use Markdown for changelog.
Includes minor changes to how version changes are limited for display.
2024-10-22 00:34:16 +01:00
e98407973f Fix #12993: Replace known-bugs text with markdown version.
This allows a little bit better formatting/display in game.

(No attempt to check if these are still valid known-bugs...)
2024-10-22 00:34:16 +01:00
e3bfe2b668 Fix: Don't invalidate water regions on the other side of the map. (#13012)
When invalidating water regions with a tile at the very edge of the map, the region on the opposite side of the map would also be invalidated.
2024-10-22 00:33:29 +01:00
3eb7901ad9 Codechange: Use template parameter of SetBitIterator instead of casting later. (#13015)
This removes some manual casting.
2024-10-21 17:54:54 +01:00
Jonathan G Rennison
6ca9ddcffa Codefix: [Win32] String handling in OTTDStringCompare, Win32StringContains
Avoid truncation if CompareStringEx is missing
Fix handling of zero length inputs
2024-10-21 17:34:30 +02:00
Jonathan G Rennison
d7a2efd623 Codefix: [Win32] Truncated stack trace symbols were not null-terminated
SymGetSymFromAddr64/IMAGEHLP_SYMBOL64 do not null-terminate
symbols with lengths >= the name buffer size
2024-10-21 17:34:03 +02:00
Rubidium
18e8a34081 Codechange: replace "magic" trick with simpler straight forward code 2024-10-20 15:49:32 +02:00
Rubidium
392bcf5c9a Codechange: simplify ToTileIndexDiff by just calling TileDiffXY 2024-10-20 15:49:32 +02:00
Rubidium
1998e94ae7 Codechange: create the TileIndexDiff of the whole translation we want to execute 2024-10-20 15:49:32 +02:00
Rubidium
a6b7593a52 Codechange: use TileDiffXY(0, 0) over magic 0 2024-10-20 15:49:32 +02:00
Rubidium
3b0fcf442f Codefix: use actual type instead of int for TileIndexDiff 2024-10-20 15:49:32 +02:00
Jonathan G Rennison
3105f6391c Fix #13002: Crash due to use of dangling types in picker GUI used/saved lists (#13008) 2024-10-20 09:37:17 +01:00
translators
582f37dc15 Update: Translations from eints
luxembourgish: 84 changes by phreeze83
2024-10-20 04:46:58 +00:00
Rubidium
4a359a4aed Fix 8ca417b: drying of (edge) tiles should consider MP_VOID tiles 2024-10-19 23:32:34 +02:00
147ac56f11 Fix: ScriptTile::PlantTreeRectangle does not check that the end tile is in bounds. (#13004)
If the starting tile is near the edge of the map, the width and height could overflow the map boundary.

In some cases this might result in a different area being planted than expected.
2024-10-19 20:52:02 +01:00
Rubidium
9d2e07b1f6 Codechange: simplify terraform recursion logic 2024-10-19 15:40:36 +02:00
Rubidium
8ca417baa9 Codefix: do not wrap-around the map when flooding tiles 2024-10-19 09:00:21 +02:00
translators
5e8da0479a Update: Translations from eints
luxembourgish: 23 changes by phreeze83
2024-10-19 04:45:07 +00:00
Jonathan G Rennison
ffcc594ea3 Codefix: Incorrect documentation comments in StringBuilder 2024-10-18 22:29:28 +02:00
Rubidium
b074a4d3ce Codefix: remove duplicate typedef 2024-10-18 16:43:17 +02:00
translators
35d37d4768 Update: Translations from eints
norwegian (nynorsk): 2 changes by Abaksle
luxembourgish: 33 changes by phreeze83
2024-10-18 04:47:11 +00:00
2fda7d8297 Codechange: Simplify Station::train_station iteration when marking tiles dirty. (#13003) 2024-10-17 23:01:04 +01:00
translators
ae4a723889 Update: Translations from eints
norwegian (nynorsk): 8 changes by Abaksle
2024-10-17 04:47:13 +00:00
bacd3e83c6 Codechange: Use ScriptObjectRef to handle Event reference counting.
This removes manual reference counting.
2024-10-16 21:52:00 +01:00
8360fab18a Codechange: Remove CCountedPtr.
This was originally generic and used by YAPF, but now it is used only by script objects.

CCountedPtr provided much more (untested) functionality than used.

ScriptObjectRef already exists for script objects and does the same thing, so use this instead.
2024-10-16 21:52:00 +01:00
Koen Bussemaker
d8029b1d84 Fix: CHashTableT's Clear function doesn't set number of items back to zero 2024-10-16 22:36:26 +02:00
d5b57a56f4 Codechange: Use std::unique_ptr for link graph schedule handlers. (#12988)
This removes manual memory management.
2024-10-15 02:11:06 +01:00
Rubidium
4a6ac52d8c Cleanup: remove some unused #defines 2024-10-14 21:37:00 +02:00
translators
c2d58bb88f Update: Translations from eints
vietnamese: 43 changes by KhoiCanDev
italian: 4 changes by Boh132Boh
2024-10-14 04:46:49 +00:00
glx22
45aef2c0b9 Change: [CI] Temporarily force ubuntu-24.04 runner for linux workflow
While ubuntu-latest is transitioning from ubuntu-22.04 to ubuntu-24.04, the one we actually run on is random.
But our workflow can work only with 22.04 (using clang15) or 24.04 (using clang) so just force 24.04 for now.
2024-10-14 00:53:47 +02:00
glx22
1a1cd2d495 Cleanup: [CI] Remove 'os' input for windows workflow 2024-10-14 00:53:47 +02:00
glx22
99e8534d76 Change: [CI] Use xxx-latest runners for all workflows 2024-10-14 00:53:47 +02:00
translators
79c8eac2ee Update: Translations from eints
vietnamese: 106 changes by KhoiCanDev
polish: 1 change by translators
2024-10-13 04:46:13 +00:00
translators
c813b2b42d Update: Translations from eints
swedish: 19 changes by joeax910
french: 6 changes by ottdfevr
2024-10-10 04:45:29 +00:00
446db2c826 Codechange: Remove redundant NewsStringData data. (#12983)
Since SetDParamStr() always owns a copy of the string, there is no need to make another copy of it to keep it around while the news item exists.

This also fixes a leak in `CmdIndustrySetProduction` as the allocated data wasn't passed to AddIndustryNewsItem.
2024-10-08 19:48:55 +01:00
Jonathan G Rennison
d53b681cf7 Codefix f481c9fc: Incorrect references to previous items in DumpTarget 2024-10-08 20:23:08 +02:00
14b986609b Add: AppendStringInPlace() to append translated string ID into an existing string. (#12969)
This allows avoiding a string copy when building strings.
2024-10-07 19:05:38 +01:00
3cd1200668 Fix #12976: Incorrect widget rect scrolling for RTL languages. (#12978)
Industry directory, AS/GS and Textfile window did not consider RTL when applying horizontal scrolling.
2024-10-05 08:02:59 +01:00
translators
114c28e69c Update: Translations from eints
korean: 1 change by telk5093
latvian: 6 changes by lexuslatvia
2024-10-05 04:45:35 +00:00
translators
26c2255897 Update: Translations from eints
norwegian (bokmal): 15 changes by eriksorngard
french: 1 change by FiglidiGP
2024-10-03 04:47:03 +00:00
Jonathan G Rennison
22b4a77e37 Codefix: Debug fmt strings in ItemizeBidi (ICU layout) (#12965) 2024-10-01 14:28:40 +01:00
ccced859f5 Codechange: Mark some water region functions static. (#12964)
These functions are not used elsewhere. This may affect how compilers generate code.
2024-10-01 14:28:16 +01:00
Jonathan G Rennison
386dbb7c80 Codefix: First format argument of IConsolePrint not passed by reference (#12966) 2024-10-01 14:12:19 +01:00
translators
7a0e50002b Update: Translations from eints
galician: 5 changes by pvillaverde
2024-09-30 04:47:06 +00:00
translators
3ed2afa68e Update: Translations from eints
catalan: 5 changes by J0anJosep
2024-09-29 04:45:28 +00:00
translators
b4f96f54df Update: Translations from eints
danish: 14 changes by bscargo
dutch: 5 changes by Afoklala
2024-09-28 04:44:33 +00:00
translators
b42c4fa7ca Update: Translations from eints
chinese (traditional): 4 changes by KogentaSan
english (us): 5 changes by 2TallTyler
korean: 6 changes by telk5093
italian: 16 changes by ciampix
2024-09-26 04:45:59 +00:00
translators
1251638508 Update: Translations from eints
chinese (simplified): 8 changes by WenSimEHRP
portuguese: 5 changes by azulcosta
polish: 13 changes by pAter-exe
2024-09-25 04:45:43 +00:00
translators
528f047242 Update: Translations from eints
english (au): 4 changes by krysclarke
chinese (traditional): 18 changes by KogentaSan
greek: 4 changes by gh658804
italian: 11 changes by Boh132Boh
russian: 4 changes by Ln-Wolf
finnish: 5 changes by hpiirai
portuguese (brazilian): 4 changes by pasantoro
polish: 78 changes by pAter-exe
2024-09-24 04:45:19 +00:00
51bd344f10 Change: Use default NewGRF cargo translation table. (#12646)
Instead of falling back to bitnum lookup or climate-dependent cargo types, install a default cargo translation table that performs either of these functions instead.

This allows better mapping of climate-dependent or bitnum cargo slots, falling back to INVALID_CARGO if they are not defined, and reduces special-casing.
2024-09-23 23:48:03 +01:00
e60c5f30a3 Fix ddf1510a23: House animation random data flag ignored. (#12963)
In the refactor to unified tile animation code, the test for `CALLBACK_1A_RANDOM_BITS` incorrectly got changed to a `HasBit()` test preventing it from working.

Use `HasFlag()` instead.
2024-09-23 17:18:28 +00:00
f149d84d4c Fix: Crash when exiting game with end game window open. (#12962)
Caused by the end game window opening the highscore window on close, which `UnInitWindowSystem()` does not expect.
2024-09-23 17:58:44 +01:00
translators
856ee2aaca Update: Translations from eints
english (au): 1 change by krysclarke
chinese (simplified): 1 change by WenSimEHRP
greek: 1 change by gh658804
russian: 1 change by Ln-Wolf
portuguese (brazilian): 1 change by pasantoro
2024-09-23 04:45:32 +00:00
Jonathan G Rennison
c1db57840e Fix: DepotWindow::GetVehicleFromDepotWndPt not refreshing vehicle list (#12907) 2024-09-22 18:13:43 +01:00
eafee92476 Fix 3d4b98845a: TC_FORCED no longer working. (#12961)
Since initial colour is no longer passed to the text layout, TC_FORCED flag is not seen by the layouter, so it had no effect.

Instead, check for TC_FORCED when drawing and avoid using the string's colours if set.
2024-09-22 18:08:22 +01:00
0340e19e04 Codechange: Add to_underlying() to convert enum to underlying type. (#12958)
This simplifies and replaces static_cast and C-style casts doing the same.

`std::to_underlying()` exists in C++23 but not C++20.
2024-09-22 18:07:42 +01:00
376e882a14 Codechange: Add HasFlag() to test if a value is present in a bitset enum type. (#12959)
This simplifies tests for `(x & y) != y` with enum classes by reducing repetition, similar to HasBit(), and also makes the intent of the expression clearer.
2024-09-22 14:51:37 +01:00
d450d4743e Fix #12957: 1-in-X proportion of towns being cities is unnecessarily random. (#12960)
Using an actual random chance to generate cities means that there may be far less or far more than 'expected' towns being made as cities.

While this is the point of randomness, the wording of the setting is "Proporation of towns that will become cities: 1 in X" and does not mention randomness at all.
2024-09-22 14:42:01 +01:00
e45e8a39c8 Add: Overlay cargo icon in vehicle/depot list when holding shift+ctrl. (#12938) 2024-09-22 10:33:44 +01:00
translators
9404a03663 Update: Translations from eints
chinese (simplified): 1 change by WenSimEHRP
polish: 8 changes by pAter-exe
2024-09-22 04:47:22 +00:00
Jonathan G Rennison
a7d405b02d Fix: ICUParagraphLayout line wrapping (#12956)
In the case where the overflow run is not the start run,
and the start run had a partial offset
2024-09-21 22:14:41 +01:00
16b4e737a3 Fix 3d8d0e0d26: Don't assume plural parameter is valid. (#12954)
A crash can occur if the parameter used for a plural isn't a numeric value.
2024-09-21 15:04:35 +01:00
Jeremy Gao
2eac527439 Fix: server menu tooltip shouldn't show language info (#12955) 2024-09-21 15:04:13 +01:00
Jonathan G Rennison
78c7dd1303 Fix #12945: Relative paths passed to -c were not made absolute (#12946) 2024-09-21 13:58:28 +01:00
translators
6175a6b78a Update: Translations from eints
dutch: 9 changes by Afoklala
2024-09-21 04:44:57 +00:00
translators
96000fc4ea Update: Translations from eints
english (au): 1 change by krysclarke
english (us): 9 changes by 2TallTyler
galician: 13 changes by pvillaverde
korean: 9 changes by telk5093
greek: 1 change by gh658804
finnish: 1 change by hpiirai
lithuanian: 6 changes by isigitas
portuguese: 1 change by azulcosta
portuguese (brazilian): 1 change by pasantoro
polish: 1 change by aefoes
2024-09-20 04:45:13 +00:00
6e940af08d Fix #12952: Incorrect string parameters passed for social plugin titles.
When no option is selected (i.e. during SetupSmallestSize), a different string parameter layout was used that did not match the visible layout.
2024-09-19 18:44:23 +01:00
719d063bd4 Fix d1463f415f: Wrong type of exception thrown by invalid string parameters.
`FormatString()` only catches `std::out_of_range`, but `GetNextParameter()` threw `std::runtime_error`.
2024-09-19 18:44:23 +01:00
3bfd9de68d Fix: Highscore/Endgame window can disappear offscreen if game window is resized. (#12951) 2024-09-19 09:18:25 +01:00
translators
df0233f4c2 Update: Translations from eints
chinese (simplified): 9 changes by WenSimEHRP
catalan: 9 changes by J0anJosep
latvian: 1 change by lexuslatvia
french: 13 changes by glx22
portuguese: 9 changes by azulcosta
2024-09-19 04:45:53 +00:00
Jonathan G Rennison
1e3855c9c3 Fix: Crash when pressing arrow keys in bootstrap mode (#12948) 2024-09-18 16:41:54 -04:00
fe49dec527 Fix 33a7e9e512: Linker failure with release build. (#12949) 2024-09-18 20:18:49 +00:00
25a8abcd8e Fix fcf8693c4f: Remove 100 byte limit for parsing string command parameters. (#12950)
This allows longer parameters to be used in plural and gender commands.

Each individual word list parameter is now limited to 253 bytes, allowing for a trailing NUL and leaving 0xFF reserved.
2024-09-18 20:55:36 +01:00
Heikki Piirainen
66c5a21d8f Fix: erroneous error message 2024-09-18 06:50:06 +02:00
Jonathan G Rennison
9f1bb055b7 Change: Exclude parent item from directory sort in FiosGetFileList 2024-09-18 06:49:30 +02:00
translators
fcf8693c4f Update: Translations from eints
english (au): 9 changes by krysclarke
greek: 9 changes by gh658804
russian: 9 changes by Ln-Wolf
finnish: 9 changes by hpiirai
latvian: 8 changes by lexuslatvia
portuguese (brazilian): 9 changes by pasantoro
2024-09-18 04:45:22 +00:00
a241ef8da0 Fix #12917: Write to negative array index for some string patterns.
Don't popped closed pair from the parenthesis stack a second time.
2024-09-17 11:06:17 +01:00
33a7e9e512 Add: Unit test for ICU ScriptRun.
This is based on srtest from the ICU codebase.
2024-09-17 11:06:17 +01:00
translators
9ab0a47812 Update: Translations from eints
norwegian (bokmal): 4 changes by eriksorngard
2024-09-17 04:41:16 +00:00
4be3361aa3 Fix ad020759: Update town data loader for FileHandle change. (#12942)
A non-conflicting merge conflict...
2024-09-16 17:52:24 +01:00
74910d3d14 Fix 908ee729: Inverted condition prevented actually writing data to files. (#12941) 2024-09-16 13:45:23 +00:00
Tyler Trahan
ad020759c7 Feature: Import town data from JSON file (#10409) 2024-09-16 09:29:10 -04:00
908ee7292b Codechange: Replace all FILE * with FileHandle RAII class. (#12718)
This removes the need to manually ensure all files are closed.
2024-09-16 08:45:26 +01:00
translators
3784a3d3d6 Update: Translations from eints
latvian: 5 changes by lexuslatvia
portuguese: 4 changes by azulcosta
2024-09-15 04:44:28 +00:00
9623c28f4d Change: [NewGRF] Place all 8 bits of station tile layout in var 40/41. (#12890) 2024-09-14 21:37:40 +01:00
Jonathan G Rennison
2a5a0b0990 Codechange: No longer allow saving of incorrect string container table fields
See: 1250ce8f
2024-09-14 15:32:48 +01:00
Jonathan G Rennison
c277ff121e Fix #12901: Savegame format of company allow lists 2024-09-14 15:32:48 +01:00
d1463f415f Codechange: Treat reading incorrect parameter type as a string error.
Previously reading a string as a number would return 0 instead.
2024-09-14 15:31:05 +01:00
3d8d0e0d26 Codechange: Use std::variant to store string parameter data.
This avoids storing two separate values and makes the test for which type is held clearer.

This replaces use of unique_ptr for conditionally storing a string, and is also used in place of StringParameterBackup.
2024-09-14 15:31:05 +01:00
b449839538 Codechange: Pass span instead of vector to HaveDParamChanged. 2024-09-14 15:31:05 +01:00
9eb28def57 Codechange: Return reference from GetNextParameterPointer.
GetNextParameterPointer can no longer return nullptr, and the callers do not check for nullptr, so return a reference instead.
2024-09-14 15:31:05 +01:00
translators
59b18560d4 Update: Translations from eints
english (us): 4 changes by 2TallTyler
dutch: 4 changes by Afoklala
2024-09-14 04:44:59 +00:00
translators
45a5868bb8 Update: Translations from eints
chinese (simplified): 4 changes by WenSimEHRP
korean: 4 changes by telk5093
italian: 9 changes by dominiccoletti
catalan: 4 changes by J0anJosep
2024-09-13 04:44:38 +00:00
ad5da0c924 Codechange: Use __VA_OPT__(,) instead of , ## (#12921)
`__VA_OPT__` is a C++20 standard, `##` is, apparently, a GNU extension.

MSVC needs /Zc:preprocessor adding for whatever reason.
2024-09-12 07:06:15 +01:00
7f5a3eaf83 Codefix: Avoid type-casting function pointer with incorrect type. (#12929)
Make `AutolengthProc` take `int` instead of `void *`, avoiding pointer parameters.
2024-09-12 06:49:45 +01:00
9631c68ce6 Codefix: Implement explicit ByteReader::PeekDWord() instead of type-punning pointer. (#12928) 2024-09-12 06:49:20 +01:00
6deee5e5e2 Fix: Train curve detection did not take shortened parts into account. (#12910)
Only the number of parts between curves was counted, which with shortened parts would be higher than full length parts and fail to limit as expected.
2024-09-12 06:47:54 +01:00
translators
bed2a060ce Update: Translations from eints
english (au): 4 changes by krysclarke
greek: 4 changes by gh658804
russian: 4 changes by Ln-Wolf
finnish: 4 changes by hpiirai
polish: 4 changes by pAter-exe
2024-09-12 04:46:09 +00:00
2d51659ed2 Fix d8c36536: \u200B is not allowed in translations. (#12935) 2024-09-10 14:25:36 +01:00
Jonathan G Rennison
e477706bf5 Codechange: Add AssignBit function to assign the value of a single bit (#12934)
* Codechange: Add AssignBit function to assign the value of a single bit

* Codechange: Replace various uses of SB with AssignBit

* Codechange: Replace various uses of SB with a constant with SetBit
2024-09-10 08:36:58 -04:00
Tyler Trahan
27efa57b7b Change: Standardize filter button strings (#12847) 2024-09-10 08:33:06 -04:00
Jonathan G Rennison
d0b3e0c47e Fix: Crash in GetGameStringPtr when there are no GS strings (#12933) 2024-09-10 13:20:38 +01:00
translators
d8c36536be Update: Translations from eints
danish: 20 changes by bscargo
2024-09-10 04:44:28 +00:00
Jonathan G Rennison
81b684aa42 Codefix: StationUsesDefaultType always returned false for rail waypoints 2024-09-07 14:58:28 +01:00
Jonathan G Rennison
cb2f4f319c Fix: Picker window 'used' filter for rail waypoints
The first two field of struct PickerItem were not populated.
These are required for set operations.
2024-09-07 14:58:28 +01:00
29ff3d7b90 Fix: DupSprite did not copy the control_flags field (#12906)
Co-authored-by: Jonathan G Rennison <j.g.rennison@gmail.com>
2024-09-07 14:57:44 +01:00
Jonathan G Rennison
69aa6f66ec Doc: Add missing road waypoint map bits to landscape documents (#12922) 2024-09-07 14:57:29 +01:00
Jonathan G Rennison
5c243ee8f0 Fix: Road stop availability callback (#12931) 2024-09-07 14:57:04 +01:00
Jonathan G Rennison
d5ff6b4156 Fix 8d62a8f0: Road stop variable 6B crashing for road stop preview in GUI (#12930) 2024-09-06 11:14:34 +01:00
translators
92cbf7ae43 Update: Translations from eints
french: 6 changes by glx22
2024-09-06 04:44:06 +00:00
translators
c1f8569587 Update: Translations from eints
galician: 1 change by pvillaverde
vietnamese: 1 change by myquartz
french: 1 change by FiglidiGP
2024-09-05 04:44:59 +00:00
translators
1d907611d1 Update: Translations from eints
polish: 1 change by pAter-exe
2024-09-04 04:44:39 +00:00
translators
34c09b3596 Update: Translations from eints
bulgarian: 3 changes by Alexandar83
2024-09-03 04:44:13 +00:00
Rubidium
f2a8e18792 Fix 208952f: incorrect truncation in string setting validation 2024-09-02 22:16:26 +02:00
translators
b80f205967 Update: Translations from eints
italian: 4 changes by Boh132Boh
bulgarian: 505 changes by Alexandar83
2024-09-02 04:45:08 +00:00
translators
ef7ad2606c Update: Translations from eints
bulgarian: 161 changes by Alexandar83
2024-09-01 04:45:11 +00:00
translators
2eb3e77207 Update: Translations from eints
chinese (simplified): 2 changes by WenSimEHRP
bulgarian: 116 changes by Alexandar83
2024-08-31 04:44:42 +00:00
translators
bb770b7b56 Update: Translations from eints
norwegian (bokmal): 1 change by eriksorngard
2024-08-29 04:44:23 +00:00
translators
9eaa00cd89 Update: Translations from eints
czech: 1 change by JsSusenka
2024-08-26 04:45:38 +00:00
cb23651f43 Codechange: Replace BmpBuffer with RandomAccessFile. 2024-08-24 22:11:04 +01:00
719763dfcb Codechange: Store start and end position in RandomAccessFile.
This allows callers to do more bounds checking.
2024-08-24 22:11:04 +01:00
b5264a72ae Codechange: [NewGRF] Use reference to unique_ptr instead of .get() (#12919)
This allows assignment to reference when creating a new spec instead of setting and refetching.
2024-08-24 22:10:39 +01:00
Jonathan G Rennison
4070cf9968 Codefix: LinkGraphOverlay::dirty was never initialised 2024-08-24 21:06:33 +02:00
translators
3be96c6816 Update: Translations from eints
english (us): 1 change by 2TallTyler
2024-08-24 04:43:57 +00:00
translators
d3252315d3 Update: Translations from eints
bulgarian: 28 changes by DeyanVNikolov
spanish: 1 change by SeveralCircles
2024-08-23 04:43:15 +00:00
2327b7030d Codechange: Use std::string to load ini file comments. (#12909)
This removes realloc/free and some funky old manual memory management.
2024-08-21 22:09:51 +01:00
4224d08e72 Codechange: Replace malloc/free with vector for TGP heightmap processing. 2024-08-20 22:15:30 +01:00
c4a638dfe1 Codechange: Replace malloc/free with vector for screenshot buffers. 2024-08-20 22:15:30 +01:00
059462814e Codechange: Replace malloc/free with vector when loading heightmap data. 2024-08-20 22:15:30 +01:00
9a037fe5ae Codechange: Replace malloc/free with vector when padding sprites. 2024-08-20 22:15:30 +01:00
0f0f3d74ca Codefix: Delete PersistentStorage when a town is deleted. (#12903) 2024-08-19 08:18:01 +01:00
translators
e4c04e86c0 Update: Translations from eints
catalan: 1 change by J0anJosep
french: 1 change by ottdfevr
portuguese: 1 change by azulcosta
2024-08-18 04:42:47 +00:00
translators
4e11a9c49e Update: Translations from eints
korean: 2 changes by telk5093
dutch: 1 change by Afoklala
2024-08-17 04:43:01 +00:00
translators
73cb7cd7df Update: Translations from eints
swedish: 1 change by joeax910
chinese (traditional): 1 change by KogentaSan
chinese (simplified): 1 change by WenSimEHRP
2024-08-16 04:42:51 +00:00
translators
f14c152c72 Update: Translations from eints
english (au): 1 change by krysclarke
greek: 1 change by gh658804
russian: 1 change by Ln-Wolf
finnish: 1 change by hpiirai
portuguese (brazilian): 1 change by pasantoro
2024-08-15 04:43:54 +00:00
ff972ec4ff Codechange: Store custom station layouts in a map instead of nested vectors. (#12898)
The map key is the platforms and length combined. This simplifies allocation and searching for layouts.
2024-08-14 19:58:56 +01:00
Jonathan G Rennison
39465d7f5c Codefix: Move saveload of road stop tile data (#12883)
So that road stop tile data is also saved/loaded for road waypoints
2024-08-13 19:49:53 +00:00
1ff35cb6f9 Codechange: Don't mark animated tiles dirty if frame is not changed.
If animation is continued but the animation frame has not changed then there is no need to mark the tile for refresh.

Loosely backport from JGRPP.
2024-08-13 20:04:44 +01:00
8754846901 Codechange: Allow adding to animated tile list without marking dirty.
This avoids redundant tile refreshes when the caller has already marked a tile dirty, or knows it does not need refreshing.

Loosely backported from JGRPP.
2024-08-13 20:04:44 +01:00
79369a886a Codechange: Don't mark tiles dirty when deleting from animated tile list.
The callers of DeleteAnimatedTile already know if the tile needs refreshing, so it is redundant for DeleteAnimatedTile to do so.

Loosely backported from JGRPP.
2024-08-13 20:04:44 +01:00
Jonathan G Rennison
88110e9b2e Fix: Train unit ID allocation when moving engine to new train at train limit (#12887) 2024-08-13 14:53:10 -04:00
Ivan Pravdin
4cddb3a38d Fix 12860, 2bada59: Timetable does not show vehicles as early
Timetable does not show vehicles as early, only as on time.
Fix this by changing 'VehicleIsAboveLatenessThreshold()' to
accept number of ticks the vehicle is late. This allows to
use it with absolute value.

Codefix #12860: Update comments

Co-authored-by: Tyler Trahan <tyler@tylertrahan.com>
2024-08-13 20:16:57 +02:00
Kaiden Joy
7a698c7f1c Fix #12365: Company Window now displays proper inauguration year and period while in wallclock mode. 2024-08-13 20:13:51 +02:00
Jonathan G Rennison
55ca1c77be Codefix: Remove dead code for WID_SIL_FILTER_ENTER_BTN in sign window (#12897) 2024-08-13 08:37:31 +01:00
translators
bdd16ee97f Update: Translations from eints
bulgarian: 77 changes by Alexandar83
2024-08-13 04:43:19 +00:00
367e508984 Codefix: Resolve CodeQL warnings by converting to size_t. 2024-08-12 13:33:58 +01:00
d0d5c5c400 Codechange: Pass BmpInfo and BmpData as references.
Avoids needing to check for nullptr.
2024-08-12 13:33:58 +01:00
f829b1d74a Codechange: Replace BmpData palette and bitmap with vectors.
BmpInfo width and height members are now size_t to avoid multiplication warnings.

This avoids manual memory management and allows BmpData to clean up after itself.
2024-08-12 13:33:58 +01:00
translators
0633b94e8f Update: Translations from eints
bulgarian: 76 changes by Alexandar83
2024-08-12 04:43:14 +00:00
translators
574ec4ede4 Update: Translations from eints
chinese (simplified): 33 changes by WenSimEHRP
bulgarian: 195 changes by Alexandar83
2024-08-11 04:43:19 +00:00
translators
0c4dcd562c Update: Translations from eints
vietnamese: 28 changes by KhoiCanDev
bulgarian: 63 changes by Alexandar83
romanian: 10 changes by The-Bober
ukrainian: 147 changes by Quantom2
2024-08-10 04:45:34 +00:00
translators
c69e236f9c Update: Translations from eints
bulgarian: 10 changes by Alexandar83
2024-08-09 04:43:18 +00:00
Jonathan G Rennison
daa4981922 Fix 77f27e08: Crash due to incorrect use of AirportSpec::GetIndex 2024-08-08 23:05:33 +02:00
translators
cfeab64aaf Update: Translations from eints
bulgarian: 131 changes by Alexandar83
romanian: 43 changes by The-Bober
2024-08-08 04:44:03 +00:00
Jonathan G Rennison
e1b9a3e2e7 Fix: Excessively fast ships on aqueducts fail to move at correct speed 2024-08-07 20:59:44 +02:00
translators
19cf605765 Update: Translations from eints
chinese (traditional): 1 change by KogentaSan
bulgarian: 329 changes by Alexandar83
romanian: 24 changes by The-Bober
2024-08-07 04:43:44 +00:00
translators
0c7faa4730 Update: Translations from eints
vietnamese: 7 changes by KhoiCanDev
bulgarian: 58 changes by Alexandar83
2024-08-06 04:43:59 +00:00
translators
4c06769ff2 Update: Translations from eints
bulgarian: 127 changes by Alexandar83
2024-08-05 04:42:47 +00:00
translators
6430b5a0ac Update: Translations from eints
chinese (simplified): 31 changes by WenSimEHRP
hungarian: 24 changes by PstasDev
bulgarian: 15 changes by Alexandar83
2024-08-04 04:43:59 +00:00
a03ddb3ccb Add: [NewGRF] Station property 1E, extended station tile flags.
Properties 11, 14 and 15 to set pylons/nowires/blocked intrinsically only support 8 station tiles.

Add new property to define all three flags for each station tile layout.
2024-08-03 14:57:34 +01:00
6e553410d3 Feature: [NewGRF] Allow fixed layout up to 256 tiles per NewGRF rail station.
Allow using up to 256 tile layouts in property 0E or callback 24, which defines the layout to be saved into the map.

This was originally limited to 8, because station graphics above 8 referred to other station types but that was changed in 2007.

1) More efficient than using callback 14, as that needs to be checked every time a station tile is rendered.
2) The layout does not get changed when the station is changed (this may or may not be desirable!)

Using more than 256 layouts still requires callback 14.
2024-08-03 14:57:34 +01:00
d08636c841 Codechange: Store station layout tiles as std::span.
Using std::span provides both the start and end of the list, which allows validating that the requested layout is in range.
2024-08-03 14:57:34 +01:00
70a2ed062d Codechange: Rename CBID_STATION_SPRITE_LAYOUT and CBID_STATION_TILE_LAYOUT.
These callbacks both select rail station tile layouts, the difference is one happens when drawing, the other happens when building. Change the names to make this clearer.
2024-08-03 14:57:34 +01:00
translators
ba46128bdd Update: Translations from eints
chinese (traditional): 45 changes by KogentaSan
hungarian: 3 changes by PstasDev
bulgarian: 193 changes by Alexandar83
2024-08-03 04:42:16 +00:00
translators
57afa6002a Update: Translations from eints
chinese (traditional): 15 changes by KogentaSan, 1 change by Bowen951209
bulgarian: 87 changes by Alexandar83
2024-08-02 04:43:42 +00:00
translators
8ba4f8c872 Update: Translations from eints
chinese (traditional): 49 changes by KogentaSan
chinese (simplified): 45 changes by WenSimEHRP
bulgarian: 50 changes by Alexandar83
2024-08-01 04:42:33 +00:00
translators
ae2f76e066 Update: Translations from eints
bulgarian: 78 changes by Alexandar83
2024-07-31 04:40:41 +00:00
translators
89fc7e9af6 Update: Translations from eints
chinese (traditional): 8 changes by KogentaSan
bulgarian: 76 changes by Alexandar83
2024-07-30 06:36:33 +00:00
3176de3f1d Codefix: cargo_(dis)allowed for default refit masks are cargo classes, not CargoTypes. (#12884)
Use an alias for CargoClasses to avoid ambiguity.
2024-07-29 20:58:53 +01:00
Patric Stout
bec37ee704 Fix: remove the invalid UTF-8 character (U+200B) from the traditional chinese translation (#12882)
Eints should be fixed to not allow this character in the first place,
but this unblocks building the source again.
2024-07-29 09:23:05 +02:00
translators
39688a4ccf Update: Translations from eints
welsh: 55 changes by Ansbaradigeidfran
2024-07-29 04:42:38 +00:00
translators
22e525dafe Update: Translations from eints
chinese (traditional): 140 changes by KogentaSan
2024-07-27 04:42:11 +00:00
Michael Lutz
ddf6f33a8a Change: Path signals now show green on junction-less tracks by default (#12857) 2024-07-26 23:51:49 +02:00
translators
9965cd9151 Update: Translations from eints
chinese (traditional): 46 changes by KogentaSan
2024-07-26 04:44:30 +00:00
translators
44b748a766 Update: Translations from eints
hungarian: 33 changes by peti2000
2024-07-25 04:44:39 +00:00
translators
1a6655bd1b Update: Translations from eints
chinese (traditional): 28 changes by KogentaSan
2024-07-24 04:42:02 +00:00
translators
f4e5f1b34d Update: Translations from eints
chinese (traditional): 35 changes by KogentaSan
2024-07-23 04:42:05 +00:00
David Seifert
db36e61807 Codefix: Compilation with GCC 15 due to missing CRTP usage (#12876) 2024-07-22 20:42:23 +02:00
translators
b2faa14ab5 Update: Translations from eints
chinese (traditional): 57 changes by KogentaSan
galician: 1 change by pvillaverde
latvian: 17 changes by osprinkis
lithuanian: 8 changes by Br0l15
2024-07-22 04:43:29 +00:00
Ivan Pravdin
da00a62d59 Fix #12856, e17c82e: Updating network settings does not invalidate data (#12858) 2024-07-21 16:59:48 -04:00
4ee45db51b Change: [UI] Use scaled sprite sizes and correct matrix padding for content list. (#12875) 2024-07-21 14:01:29 +01:00
8b644f6ee6 Codechange: Use GetVisibleRangeIterators to draw script settings. (#12871) 2024-07-21 13:40:54 +01:00
ba2b14b075 Change: [UI] Use proper matrix padding for server list test.
Text was only positioned correctly at 1x scale due to old pixel-based positioning method.
2024-07-21 10:07:50 +01:00
d85f4b3ebf Change: [UI] Use interface scaled sizes for server list.
Avoid hardcoded values and use WidgetDimensions to set icon positions.

This fits better with non-power-of-2 interface scale.
2024-07-21 10:07:50 +01:00
4b6e3f86c2 Cleanup: Remove write-only flag_offset member from server list. (#12872)
A remnant of language flags, removed from the server list long ago.
2024-07-21 08:18:09 +01:00
translators
31e2f5a8a0 Update: Translations from eints
swedish: 3 changes by sereneavatar
chinese (traditional): 22 changes by KogentaSan
2024-07-21 04:42:17 +00:00
333e8e590e Codefix: Don't assume 9 is the widest digit (#12870)
Use `SetDParamMaxDigit()` instead of `SetDParam()` with a large number.
2024-07-19 19:00:21 +01:00
translators
97479eb953 Update: Translations from eints
chinese (traditional): 97 changes by KogentaSan
2024-07-19 04:43:26 +00:00
translators
8ed854be58 Update: Translations from eints
chinese (traditional): 28 changes by KogentaSan
2024-07-18 04:43:42 +00:00
cd739c2c33 Codechange: Replace dropdown's magic 2 with appropriate WidgetDimension. (#12869) 2024-07-17 22:20:38 +01:00
7fb3d1a197 Codechange: Use range-for to iterate airport specs to find first available. 2024-07-17 20:57:33 +01:00
2199543fbc Codechange: Use GetVisibleRangeIterators when drawing airport specs. 2024-07-17 20:57:33 +01:00
b9c44b29be Codechange: Pass AirportSpec instead of index to airport resolver object. (#12866)
This avoids retrieving AirportSpec again when it is already available.
2024-07-17 18:16:22 +01:00
e69c065d6e Codechange: Use find_if to find waypoint StationSpec when converting old savegames. (#12865)
This simplifies an indexed loop.
2024-07-17 11:40:17 +01:00
Joan Josep
891e53c72e Codechange: move large switch case to separate function (#12863) 2024-07-16 19:41:04 +00:00
Loïc Guilloux
d67963e616 Add: [Script] Include number of victims in ScriptEventVehicleCrashed (#12861) 2024-07-16 21:28:29 +02:00
translators
eeed824329 Update: Translations from eints
norwegian (bokmal): 1 change by eriksorngard
chinese (simplified): 1 change by WenSimEHRP
german: 13 changes by Wuzzy2
2024-07-16 04:43:38 +00:00
translators
1fe11b7b57 Update: Translations from eints
chinese (simplified): 2 changes by WenSimEHRP
2024-07-15 04:43:37 +00:00
Jonathan G Rennison
65c666cb57 Codechange: Remove unused size field from struct SaveLoad (#12859) 2024-07-14 14:30:35 -04:00
translators
6006e832f2 Update: Translations from eints
finnish: 6 changes by hpiirai
2024-07-12 04:42:38 +00:00
translators
58e4643196 Update: Translations from eints
vietnamese: 4 changes by KhoiCanDev
2024-07-11 04:43:17 +00:00
e2a796dbcd Codefix: Potential unterminated string returned from convert_to_fs.
Converting from UTF-8 to UTF-16 could have resulted in a buffer overflow if the buffer size was exactly the length of the converted string.

Pass string_view/span to convert_from/to_fs instead, and ensure the buffer is terminated. This replaces passing a pointer to the buffer and the buffer size as separate parameters, allowing the compiler to pass both in one parameter.

Removes use of `lengthof()`.
2024-07-10 20:57:02 +01:00
b37954722b Codefix: Don't copy path string to itself.
When determining base paths on Windows the path is converted to UCS-16, and then copied into the same buffer.
2024-07-10 20:57:02 +01:00
e22eb89b92 Codechange: Call BSWAP32() in the default_grf_overrides initializer.
This causes the BSWAP32 calls to happen only on first initialisation (BSWAP32 is not constexpr), instead of every time GRFs are reloaded.
2024-07-10 20:56:35 +01:00
b090c8e9bd Codechange: Replace default overrides arrays with std::pair and use range-for.
This avoids indexed array access and use of lengthof.
2024-07-10 20:56:35 +01:00
70d63f87b8 Codechange: Re-order ResultSpriteGroup to reduce its size. 2024-07-10 13:22:22 +01:00
db0ae42d45 Codechange: Set base type of spritegroup related enums.
This has a small impact on SpriteGroup object sizes.
2024-07-10 13:22:22 +01:00
55acc1b36d Codechange: Don't format strings passed to GrfMsg unless the message will be used.
This makes GrfMsg() behave more like Debug().
2024-07-10 12:53:23 +01:00
ba0acb87eb Fix #12832: Sanitise strings from NewGRF before logging them in Debug output.
NewGRF strings may not be UTF-8 encoded, which causes issues on Windows.
2024-07-10 12:53:23 +01:00
93eb27d8df Codechange: Use reference for always_accepted output parameter of AddAcceptedCargo. (#12854)
This parameter should always present (see tile_cmd.h:186), so use a reference to ensure it is.
2024-07-10 12:30:14 +01:00
60c3913a99 Codechange: Use range-for and std::size with _plural_forms. (#12852)
This removes indexed array access and use of `lengthof()` macro.
2024-07-10 09:41:28 +00:00
b4bcb330c7 Codechange: Replace GetSavegameFormat's compression output pointer with std::pair return. (#12850)
This avoids using an unchecked pointer as an out-parameter.
2024-07-09 18:57:47 +01:00
100dd7b6d1 Codechange: Use find_if to get default writeable saveload format. (#12849)
* Codechange: Use find_if to get default writeable savegame format.

This removes the last of lastof, and so the lastof macro is removed.
2024-07-09 17:07:40 +01:00
56b0eac2e9 Codechange: Use std::span/std::string_view for strecpy. (#12848)
This avoids needing to manually pass the last character of the destination buffer, and allows use of standard library functions.
2024-07-09 00:05:42 +01:00
J0anJosep
86e32631d7 Doc: Amend landscape grid after #12572. 2024-07-08 21:15:07 +02:00
aee04e7bc6 Codechange: Pass span to StrValid instead of first and last - 1. (#12846)
`std::span` is used instead of `std::string_view` as this is only used for fixed-length buffers.

This removes some callers of `lastof()`
2024-07-08 08:36:57 +01:00
translators
23bcd592a4 Update: Translations from eints
chinese (simplified): 27 changes by WenSimEHRP
italian: 9 changes by ciampix
esperanto: 7 changes by ciampix
2024-07-08 04:43:44 +00:00
6120165433 Fix #12839: Truncated help text dialog on Windows. (#12844)
Replace fixed-length buffer message conversion with std::string.
2024-07-07 18:05:53 +01:00
translators
f59ab67672 Update: Translations from eints
english (us): 2 changes by 2TallTyler
dutch: 1 change by Afoklala
french: 2 changes by ottdfevr
2024-07-06 04:42:37 +00:00
translators
5395d5731e Update: Translations from eints
latvian: 3 changes by lexuslatvia
2024-07-05 04:43:57 +00:00
4976a0140e Codefix: [UI] Incorrect initialisation order for rail/road toolbars. (#12843)
The toolbar state was set after the widget tree is created, during which toolbar state is needed.
2024-07-04 22:04:41 +01:00
Edmond Chui
2dc0a33eb7 Fix #12840, ff3be45: "Show industry names" blank panel not initialized properly 2024-07-04 22:51:06 +02:00
translators
794af62286 Update: Translations from eints
english (au): 1 change by krysclarke
swedish: 7 changes by joeax910
chinese (simplified): 2 changes by WenSimEHRP
korean: 1 change by telk5093
french: 2 changes by ottdfevr
2024-07-04 04:43:03 +00:00
translators
cd4233bedc Update: Translations from eints
english (au): 1 change by krysclarke
chinese (simplified): 2 changes by WenSimEHRP
greek: 1 change by gh658804
russian: 2 changes by Ln-Wolf
finnish: 1 change by hpiirai
catalan: 2 changes by J0anJosep
portuguese: 1 change by azulcosta
portuguese (brazilian): 1 change by pasantoro
polish: 1 change by pAter-exe
2024-07-03 04:42:36 +00:00
Loïc Guilloux
8ef3a3d463 Codefix: "maybe uninitialized" warnings for linux generic release build (#12838) 2024-07-02 11:04:07 +02:00
translators
b27527ec0c Update: Translations from eints
chinese (simplified): 4 changes by WenSimEHRP
catalan: 2 changes by J0anJosep
2024-07-02 04:42:53 +00:00
dP
f98b90ac2e Codechange: Use constants for tree growth stages and tile update frequency (#12833) 2024-07-01 15:39:25 -04:00
J0anJosep
1e0004bcd6 Codechange: Slightly simplify code in clear_cmd.cpp. 2024-07-01 17:54:56 +02:00
Rubidium
4e026e448c Feature: encrypt admin connection when using secure join 2024-07-01 17:16:55 +02:00
Rubidium
d3e37a251f Doc: update main admin protocol documentation 2024-07-01 17:16:55 +02:00
Rubidium
da6900f606 Change: disable the insecure admin login by default 2024-07-01 17:16:55 +02:00
Rubidium
3094b0ce1d Feature: admin support for password authentication without sending password
Using either password authenticated key exchange (PAKE) or authorized keys
2024-07-01 17:16:55 +02:00
Rubidium
b03ae8ad75 Codechange: add Authenticate status to the AdminStatus enum 2024-07-01 17:16:55 +02:00
Joan Josep
e7982e8082 Fix: typo in picker mode tooltip. (#12834) 2024-07-01 13:24:05 +00:00
Michal Charemza
c4b1596c97 Add: [Console] schedule command to execute a script file next in-game month (#12761) 2024-07-01 11:33:42 +02:00
Koen Bussemaker
a0845bba2c Codechange: Reduced size of water region by not storing tile area 2024-07-01 11:10:20 +02:00
translators
8c7cf3bc75 Update: Translations from eints
chinese (simplified): 1 change by WenSimEHRP
french: 5 changes by ottdfevr, 1 change by ben20471
2024-07-01 04:42:17 +00:00
steve-goldman
f5f488e778 Change: improve when to stops following vehicle (#12808)
- Changing zoom no longer stops following vehicle
- Key scrolling while following a vehicle stops following
- Autoscrolling while following a vehicle stops following
- Main viewport can begin following a vehicle at any zoom
2024-07-01 01:13:47 +02:00
Jeremy Gao
9e14f989f9 Fix: Wrong punctuation in Simplified Chinese (#12717) 2024-06-30 22:54:02 +00:00
translators
b5f2004c26 Update: Translations from eints
norwegian (bokmal): 5 changes by eriksorngard
lithuanian: 3 changes by khamper
french: 3 changes by ben20471
2024-06-30 04:41:28 +00:00
Rubidium
14200212b7 Codechange: use std::optional<std::string> over char * for text query results 2024-06-29 16:33:16 +02:00
translators
3819ab25bf Update: Translations from eints
norwegian (bokmal): 5 changes by eriksorngard
galician: 12 changes by pvillaverde
korean: 31 changes by telk5093
dutch: 14 changes by Afoklala
portuguese: 19 changes by azulcosta
2024-06-29 04:42:54 +00:00
Jonathan G Rennison
dc258ecbe0 Fix #12825: Crash when opening road toolbar in scenario editor
Due to attempt to access missing road waypoint button
2024-06-28 21:30:38 +02:00
translators
95f2bec9a9 Update: Translations from eints
greek: 14 changes by gh658804
polish: 36 changes by pAter-exe
2024-06-28 04:42:00 +00:00
a288644e20 Fix #12815, 7e914a0568: Fallback detection failed with sprite font. (#12816)
How missing glyphs were detected was changed, but the sprite font still substituted `?`, which to missing glyph looked like all characters are present.
2024-06-27 07:34:01 +01:00
translators
da4b3bebee Update: Translations from eints
english (au): 2 changes by krysclarke
english (us): 2 changes by 2TallTyler
chinese (simplified): 2 changes by WenSimEHRP
russian: 2 changes by Ln-Wolf
finnish: 25 changes by hpiirai
portuguese (brazilian): 2 changes by pasantoro
2024-06-27 04:44:27 +00:00
glx22
564397645f Codefix: [CI] dubious ownership for emscripten 2024-06-26 23:02:27 +02:00
glx22
b52f778f20 Codefix: [Win32] Use correct range for version in rc file 2024-06-26 23:02:27 +02:00
Tyler Trahan
5ed2fcfb53 Change: Don't use house construction states in Scenario Editor 2024-06-26 16:27:02 -04:00
Tyler Trahan
06bd47af4f Revert d8771b3: Construction stage wrong for all houses 2024-06-26 16:27:02 -04:00
Patric Stout
21813fbe8b Fix #12818: during Hostile Takeover, profit was calculated wrongly (#12819) 2024-06-26 14:19:53 +00:00
209b0320d5 Fix #12735: Default fonts should use default font size as-is. (#12814)
Minimum readable font size should only apply to fallback and configured fonts.
2024-06-26 12:45:39 +01:00
translators
88e53dbdc8 Update: Translations from eints
english (au): 10 changes by krysclarke
swedish: 13 changes by joeax910
english (us): 10 changes by 2TallTyler
chinese (simplified): 14 changes by WenSimEHRP
russian: 6 changes by Ln-Wolf
catalan: 14 changes by J0anJosep
latvian: 15 changes by lexuslatvia
portuguese (brazilian): 12 changes by pasantoro
2024-06-26 04:44:08 +00:00
Joan Josep
a873a952aa Codefix: Reorder comments of HasPowerOnRoad/Rail and IsCompatibleRail. (#12813) 2024-06-25 17:22:53 -04:00
rubidium42
d3c7b1015c Codefix cff48c0f6: unused variable remained after refactor 2024-06-25 22:26:37 +02:00
Steve Goldman
705207e2ce Add: Town window zoom with mouse wheel 2024-06-25 20:48:20 +02:00
Steve Goldman
a23ff227e7 Add: Industry window zoom with mouse wheel 2024-06-25 20:48:07 +02:00
Edmond Chui
ff3be45c23 Add: Toggle for showing industry names in small map 2024-06-25 20:43:28 +02:00
translators
a1e94ccddb Update: Translations from eints
english (au): 2 changes by krysclarke
norwegian (bokmal): 2 changes by eriksorngard
english (us): 2 changes by 2TallTyler
russian: 2 changes by Ln-Wolf
finnish: 2 changes by hpiirai
french: 2 changes by ottdfevr
portuguese (brazilian): 2 changes by pasantoro
polish: 2 changes by pAter-exe
2024-06-25 04:41:42 +00:00
Tyler Trahan
9936b3728a Change: Don't explain what "toggle" means in tooltips (#12805) 2024-06-24 16:28:58 -04:00
Jonathan G Rennison
a43dacd988 Add: NewGRF custom road waypoint support 2024-06-24 22:12:08 +02:00
Jonathan G Rennison
c35a5e5cb1 Change: Add variable ground types for road waypoints 2024-06-24 22:12:08 +02:00
Jonathan G Rennison
eebd5e47db Add: Road waypoint default graphics 2024-06-24 22:12:08 +02:00
Jonathan G Rennison
9c84e5df3f Add: Road waypoint functionality 2024-06-24 22:12:08 +02:00
Jonathan G Rennison
c6387c7784 Codechange: Use filter template struct for nearby station type filtering 2024-06-24 22:12:08 +02:00
Jonathan G Rennison
05b65703d3 Codechange: Increase size of StationType field in map array
Move can station have wires bit to make room
2024-06-24 22:12:08 +02:00
Steve Goldman
72276e2d3c Add: Vehicle window zoom with mouse wheel 2024-06-24 21:56:26 +02:00
Steve Goldman
c3a051a213 Codechange: Referencing enum for 'scroll_mode' setting in gui_settings.ini 2024-06-24 21:56:26 +02:00
Steve Goldman
c53ed9fad6 Codechange: Creating enum for 'scrollwheel_scrolling' setting 2024-06-24 21:56:26 +02:00
translators
e8be933ee6 Update: Translations from eints 2024-06-24 04:42:12 +00:00
e802c1a97f Add: Show count of towns and industries in their directory window captions. (#12800)
These windows now show "(<visible> of <total>)" in the caption.
2024-06-23 17:55:37 +01:00
7116f143d5 Codefix: Hole in vehicle list window if dimensions are not as expected. (#12803)
The layouts for these windows assume that push buttons and dropdowns are the same height.
2024-06-23 08:14:06 +01:00
translators
97e9442d5e Update: Translations from eints
norwegian (bokmal): 32 changes by eriksorngard
galician: 2 changes by pvillaverde
2024-06-23 04:42:04 +00:00
91fd082e93 Fix: Apply widget's internal padding to scrollbar capacity/position. (#12801)
For non-WWT_MATRIX widgets, scrollbars need to take account of the internal padding used for the widget.

This is not normally noticeable as framerect padding is only 2 extra pixels
2024-06-22 15:42:13 +00:00
Björn Wärmedal
e0bcb54a4b Change: Allow bribing local authority when other company has exclusive rights (#12763) 2024-06-22 07:51:03 -04:00
translators
49d47b3b74 Update: Translations from eints
greek: 2 changes by gh658804
dutch: 2 changes by Afoklala
lithuanian: 4 changes by khamper
french: 9 changes by Lishouuu
2024-06-22 04:40:41 +00:00
translators
64781df29f Update: Translations from eints
english (us): 2 changes by 2TallTyler
2024-06-21 04:43:18 +00:00
translators
e3e215b249 Update: Translations from eints
german: 3 changes by Wuzzy2
portuguese (brazilian): 4 changes by pasantoro
2024-06-20 04:41:06 +00:00
translators
2dab9ac7a5 Update: Translations from eints
swedish: 4 changes by joeax910
catalan: 2 changes by J0anJosep
2024-06-19 04:42:11 +00:00
b56775f576 Codechange: Avoid making copies of intermediate layout runs. (#12796)
The vector of runs is not used after it is passed to the ParagraphLayout class, so pass with std::move to avoid an unnecessary copy.
2024-06-17 22:58:52 +01:00
731c56d116 Codefix: Add missing const inside script functions. (#12794)
Scripts do not modify items directly, marking them const enforces this.
2024-06-17 07:19:56 +01:00
translators
7db70f9c3f Update: Translations from eints
english (au): 2 changes by krysclarke
norwegian (bokmal): 6 changes by eriksorngard
korean: 3 changes by telk5093
russian: 2 changes by Ln-Wolf
finnish: 3 changes by hpiirai
portuguese: 2 changes by azulcosta
portuguese (brazilian): 2 changes by pasantoro
polish: 5 changes by pAter-exe
2024-06-17 04:43:34 +00:00
Tyler Trahan
e3156546fa Codefix: Don't claim to allocate new waypoint when just checking (#12792) 2024-06-16 16:07:57 -04:00
2f54904bab Codefix: Incorrect indentation of NWidgetParts in load/save windows. (#12791)
Fix to use the "standard" layout of 1 tab for nesting widgets and 2 tabs for attributes that wrap on to the next line.
2024-06-16 18:54:19 +01:00
ladysadie
2bc3cc5b67 Codechange: Compiler check for _fios_colours/DetailedFileType (#12781) 2024-06-16 08:54:41 +02:00
translators
0e7916a51b Update: Translations from eints
greek: 2 changes by gh658804
lithuanian: 1 change by khamper
2024-06-16 04:41:19 +00:00
Rubidium
b18d8d6574 Fix: ensure revision mismatch also considers random debugging status 2024-06-15 23:14:45 +02:00
merni-ns
0409577277 Add: Setting to disable warning for old vehicles (#12714) 2024-06-15 17:14:29 -04:00
ladysadie
45d1f9aa80 Doc: Explain comment alignment in CODINGSTYLE.md 2024-06-15 17:13:42 -04:00
Tyler Trahan
d8771b3f68 Change: Don't use house construction states in Scenario Editor (#12730) 2024-06-15 17:11:00 -04:00
Tyler Trahan
4cbaac6dac Fix #10239: Use elevated snow height for roads on flat foundations (#12776) 2024-06-15 17:10:39 -04:00
Loïc Guilloux
d7137651f2 Fix #12787: boostrap doesn't have main vindow (#12788) 2024-06-15 20:39:15 +00:00
b991a399ef Codechange: Split MakeNWidget to improve readability. (#12785)
Split MakeNWidget() into two stages, widget-creation and attribute-applying, to reduce function size and make it clearer.
2024-06-15 20:10:52 +01:00
22d70f9334 Codechange: Pass NewGRF ByteReader by reference. (#12786)
ByteReader must be present and not null, so don't use a pointer.
2024-06-15 10:55:26 +01:00
b68172c225 Codechange: Use std::endian instead of TTD_ENDIAN where trivial. (#12778) 2024-06-15 10:24:17 +01:00
f9f07e9001 Fix #12775: Text truncated incorrectly on Windows. (#12782)
Caused by a -1 in the wrong place, which moved glyphs left one pixel.
2024-06-14 16:32:31 +01:00
7b7e00123e Codechange: Shuffle RoadStop members to reduce size.
Size is reduced from 40 bytes to 32 bytes on 64 bit platforms.
2024-06-14 13:32:08 +01:00
77f62e0c90 Codechange: Shuffle OrderList members to reduce size.
Size is reduced from 40 bytes to 32 bytes on 64 bit platforms.
2024-06-14 13:32:08 +01:00
translators
219995c643 Update: Translations from eints
polish: 1 change by pAter-exe
2024-06-13 04:42:16 +00:00
55314513ce Codechange: Pass NWidgetParts as span instead of begin/end pointers. (#12779) 2024-06-12 23:08:35 +01:00
translators
81b5a7c7c6 Update: Translations from eints
german: 62 changes by Wuzzy2
2024-06-12 04:42:02 +00:00
Tyler Trahan
68f7d585b4 Doc: Remove resolved issue #4415 from known-bugs.txt (#12773) 2024-06-11 11:35:10 -04:00
4cf6d1dd79 Codechange: Pass WindowDesc by reference instead of pointer. (#12771)
WindowDesc as passed to Windows is not optional so don't allow to it to be nullptr.
2024-06-11 08:58:03 +01:00
translators
18bce69623 Update: Translations from eints
galician: 3 changes by pvillaverde
danish: 1 change by bscargo
polish: 5 changes by pAter-exe
2024-06-10 04:43:42 +00:00
Steve Goldman
7db756e602 Change: Do not automatically connect double depots with track 2024-06-09 14:50:59 +02:00
Jonathan G Rennison
fa82dd6096 Fix #12030: Water infrastructure totals when using DC_FORCE_CLEAR_TILE
To remove objects on water
2024-06-09 14:49:09 +02:00
b4b2fad8e0 Fix #12648: Ensure all uses of std::filesystem::path use native encoding. (#12650)
std::filesystem::path does not expect UTF-8 strings, so they must be converted to native format first (and back to utf-8 after.)
2024-06-09 10:23:47 +01:00
fce9361bf2 Change: Position caret on left or right of glyph depending on language direction. 2024-06-09 09:57:20 +01:00
5cd81a980e Codechange: Store both left and right glyph positions in a run.
This also allows the end of a run to be known without using an extra position entry.
2024-06-09 09:57:20 +01:00
80ddcb9d7d Codechange: Move GetCharPosInString/GetCharAtPosition to gfx_layout.
These functions are related more to layouting than graphics.
2024-06-09 09:57:20 +01:00
bbbf2b5282 Codechange: Return read-only span instead of vector from layout run functions. 2024-06-09 09:57:20 +01:00
translators
6bf214af6e Update: Translations from eints
vietnamese: 3 changes by KhoiCanDev
polish: 13 changes by pAter-exe
2024-06-09 04:41:27 +00:00
79c1492a73 Codechange: Use unique_ptr in MemoryDumper. (#12766)
This replaces C-style manual memory management.
2024-06-08 21:59:56 +01:00
Jonathan G Rennison
af7ad964dd Codechange: Avoid unnecessary allocation of temporaries in layout line cache (#12737) 2024-06-08 21:21:02 +01:00
translators
d7eb29d292 Update: Translations from eints
dutch: 2 changes by Afoklala
2024-06-08 04:42:12 +00:00
df1b6a933b Fix #12764: Crash when opening Detailed performance rating window with no companies. (#12765) 2024-06-07 21:57:18 +01:00
translators
79b573704b Update: Translations from eints
french: 1 change by ottdfevr
portuguese: 2 changes by azulcosta
polish: 33 changes by pAter-exe
2024-06-07 04:43:07 +00:00
66044472d7 Codechange: Use std::unordered_map for NewGRF language_map.
NewGRFs only use a small subset of the available language IDs. Using an unordered_map allows only the reference languages to have space allocated.

This avoids manual new/delete of array.
2024-06-06 19:53:10 +01:00
fee73f3253 Codechange: Split types out of newgrf_text.h 2024-06-06 19:53:10 +01:00
translators
fa24a3ec6b Update: Translations from eints
korean: 1 change by telk5093
2024-06-06 04:41:41 +00:00
translators
1f636d94d4 Update: Translations from eints
finnish: 2 changes by hpiirai
2024-06-05 04:43:21 +00:00
57186d4650 Fix: Editbox behaved improperly with RTL languages. (#12746)
Text in the editbox was always left-aligned and did not scroll with the caret position.
2024-06-04 23:05:51 +01:00
579ce8eae0 Codefix: Find GRF override entries properly. (#12743)
My naive code from 16 years ago tested for GRF overrides in a way that will create empty 0 entries for each source GRF tested.
2024-06-04 18:06:19 +01:00
translators
342a7cebd6 Update: Translations from eints
english (au): 2 changes by krysclarke
chinese (simplified): 2 changes by WenSimEHRP
urdu: 6 changes by haidermazhar
russian: 2 changes by Ln-Wolf
catalan: 3 changes by J0anJosep
latvian: 2 changes by lexuslatvia
portuguese (brazilian): 2 changes by pasantoro
2024-06-04 04:41:49 +00:00
5fd23a2d70 Codechange: Pre-reserve vectors during NewGRF loading. (#12748)
Call reserve when we are given the number of elements up front. This reduces the number of reallocations and over-allocations done during loading.
2024-06-03 18:40:27 +01:00
dependabot[bot]
1c738e5084 Upgrade: [CI] Bump Apple-Actions/import-codesign-certs in the actions group (#12745)
Bumps the actions group with 1 update: [Apple-Actions/import-codesign-certs](https://github.com/apple-actions/import-codesign-certs).


Updates `Apple-Actions/import-codesign-certs` from 2 to 3
- [Release notes](https://github.com/apple-actions/import-codesign-certs/releases)
- [Commits](https://github.com/apple-actions/import-codesign-certs/compare/v2...v3)

---
updated-dependencies:
- dependency-name: Apple-Actions/import-codesign-certs
  dependency-type: direct:production
  update-type: version-update:semver-major
  dependency-group: actions
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-06-03 15:45:02 +02:00
translators
01c75fc578 Update: Translations from eints
urdu: 24 changes by haidermazhar
2024-06-03 04:42:34 +00:00
1ab280a27a Change: Use UK OSK layout for English (UK) (#12720) 2024-06-02 15:28:51 +01:00
translators
0d10c5e93c Update: Translations from eints
greek: 1 change by gh658804
2024-06-02 04:41:25 +00:00
6d2424c0ef Codechange: Update each town label dimensions once during map gen. (#12742)
This avoids re-layouting the label for each change in population as the town is grown.
2024-06-01 16:57:17 +01:00
96fc367bcf Change: [NewGRF] Treat house max year 0xFFFF as MAX_YEAR. (#12740) 2024-06-01 12:54:49 +01:00
translators
3827229c74 Update: Translations from eints
english (us): 1 change by 2TallTyler
finnish: 1 change by hpiirai
dutch: 1 change by Afoklala
2024-06-01 04:41:17 +00:00
7e914a0568 Fix #12738, de16655f: Fallback font searcher failure since ? substitution removed.
Fallback font searcher looked for the substituted ? glyph, which was removed by #12736.

Instead of comparing against a sprite, test against the font returning a missing glyph.

This should also improve performance of fallback font searching, as previously glyphs were actually rendered while searching.
2024-05-31 21:47:47 +01:00
translators
5bca185923 Update: Translations from eints
english (au): 1 change by krysclarke
chinese (simplified): 1 change by WenSimEHRP
russian: 1 change by Ln-Wolf
slovak: 20 changes by Kukoluk
latvian: 1 change by lexuslatvia
portuguese: 1 change by azulcosta
portuguese (brazilian): 1 change by pasantoro
2024-05-31 04:43:36 +00:00
Rubidium
31085230a6 Codechange: use std::vector for the available neighbours 2024-05-30 23:15:38 +02:00
Rubidium
2864f3b3eb Cleanup: remove C-style hash, binary heap and priority queue 2024-05-30 23:15:38 +02:00
Rubidium
0e75dfd49f Codechange: migrate aystar to use YAPF's nodelist infrastructure 2024-05-30 23:15:38 +02:00
48539992e8 Codechange: Use std::unordered_map for storing TrueTypeFontCache's GlyphEntry. 2024-05-30 20:16:28 +01:00
7b717fcccb Codechange: Replace AllocatorProc with SpriteAllocator class.
This allows for state to be passed to or maintained by the allocator.
2024-05-30 20:16:28 +01:00
de16655f76 Change: [UI] Remove substitution of missing glyph with '?' glyph. (#12736)
When a glyph does not exist, we substitute it with the '?' glyph instead, but layouters are not aware of this substitution.
2024-05-30 18:33:58 +01:00
9c19cf06e4 Change: [UI] Use SetMinimalTextLines to set label height correctly. (#12734)
SetMinimalSize does not know about font size, so these labels were incorrectly sized if the font height is different from normal.
2024-05-30 12:31:21 +01:00
0f230244fe Codechange: [UI] Remove redundant SetMinimalSize for WWT_EDITBOX widgets. (#12733) 2024-05-30 08:34:26 +01:00
Tyler Trahan
deb77463b0 Fix #12492: Clarify helptext for "minutes per year" setting (#12726) 2024-05-29 14:58:36 -04:00
Jonathan G Rennison
85918fc23e Fix: Water infrastructure total when changing owner of object on water 2024-05-29 20:11:43 +02:00
2e7819927f Fix: Invalidate game options window after changing base sounds set. (#12731) 2024-05-29 17:05:04 +01:00
translators
51e170a8d0 Update: Translations from eints
swedish: 12 changes by sereneavatar
2024-05-29 04:42:57 +00:00
f220ed179d Codechange: Use std::unordered_map for SpriteFontCache's glyph map. (#12724)
Replaces a C-style malloc'd array and malloc'd contents, and no manual memory clean up is necessary.
2024-05-28 19:34:03 +01:00
3d4b98845a Codechange: Remove initial colour from layouter cache. (#12728)
Initial colour is now always TC_INVALID, which is substituted with the desired colour when drawing the layout line.

This allows strings which differ only by initial colour to use the same layout cache entry, increasing the efficacy of the cache.
2024-05-28 19:33:44 +01:00
translators
605dff4920 Update: Translations from eints
swedish: 9 changes by joeax910
english (us): 2 changes by 2TallTyler
luxembourgish: 4 changes by phreeze83
catalan: 2 changes by J0anJosep
latvian: 27 changes by lexuslatvia
2024-05-28 04:45:37 +00:00
Tyler Trahan
37f68a65ee Fix #12283: Vehicle group dropdown shouldn't have default action (#12727) 2024-05-27 16:26:07 -04:00
f6c5da4cad Fix: Incorrect dump_info output with labels outside of ascii range. (#12723)
An unspecified cargo label is 0x00000000, which terminates C-strings.
2024-05-27 12:44:49 +01:00
4b81b62b72 Change: Don't reinitialise font caches when setting initial interface scale. (#12722) 2024-05-27 12:44:34 +01:00
translators
692943669d Update: Translations from eints
galician: 34 changes by pvillaverde
greek: 3 changes by gh658804
2024-05-27 04:41:33 +00:00
517dab35b1 Codechange: Use range-for to iterate base media files. (#12721) 2024-05-26 16:46:18 +01:00
3c42f701d7 Fix: Allow changing size of default OpenTTD font. (#12641)
* Fix: Allow changing size of default OpenTTD font.

Size configuration for default font was ignored as a different code path to load the font was followed.

Resolved by removing this additional path and conditionally selecting the default font.
2024-05-26 15:59:25 +01:00
2c70ccb137 Add: [NewGRF] Extended custom waypoint classes. (#12653)
This allows waypoints to be split into categories just like stations, instead of all being lumped together.

Station class labels with the first byte set to 0xFF will be treated in the same way as the 'WAYP' class.
2024-05-26 09:53:33 +01:00
translators
d11823df36 Update: Translations from eints
korean: 2 changes by telk5093
2024-05-26 04:42:20 +00:00
Koen Bussemaker
6efc1fa250 Codechange: Removed unused yapf PfNodeCachFlush function 2024-05-25 21:49:12 +02:00
Gloria
d72917b285 Add: Use macOS Game Mode identification (#12700) 2024-05-25 09:19:41 -04:00
translators
c325a2ebd4 Update: Translations from eints
estonian: 3 changes by siimsoni
dutch: 2 changes by Afoklala
french: 2 changes by ben20471
portuguese: 2 changes by azulcosta
2024-05-25 04:42:07 +00:00
676d64037d Fix d6ccfdb: GetCharPosition failed for RTL text. (#12710)
Changes in d6ccfdb assumed that character indexes only incremented, which is not true for RTL text.
2024-05-24 15:33:30 +01:00
translators
d9cadb49b0 Update: Translations from eints
english (au): 2 changes by krysclarke
chinese (simplified): 7 changes by WenSimEHRP
korean: 4 changes by telk5093
russian: 2 changes by Ln-Wolf
finnish: 2 changes by hpiirai
portuguese (brazilian): 2 changes by pasantoro
2024-05-24 04:43:08 +00:00
5fefe0b61f Fix: Reverse left/right keypress when editing RTL text. (#12711)
When editing RTL text, pressing left should increment instead of decrement the character position to move left, and vice versa.
2024-05-23 21:34:05 +01:00
f87c6990b0 Fix: Memory leak in CoreTextFontCache. (#12662)
Temporary buffer for rendering glyphs was not freed after use. Instead let CGBitmapContextCreate() handle the buffer.

> data may be a pointer to pixels. If you pass NULL, the context will create its own buffer and free that buffer itself later. If you pass your own buffer, the context will not free it; it remains your buffer that you must free after you release the context, hopefully for the last time.
2024-05-23 21:07:11 +01:00
yeah-its-gloria
071796660d Fix: Implement support for secure state coding on macOS
Fixes a warning when running on macOS 14 and newer about not officially supporting secure state coding.
2024-05-23 19:32:29 +02:00
yeah-its-gloria
c2daabc010 Fix: Add entitlements needed for plugins on macOS
Fixes social plugin loading on macOS, particularly for Steam.
2024-05-23 19:32:10 +02:00
Jonathan G Rennison
b2572c7ca8 Fix #12563: Race condition setting finish flag in WinHTTP 2024-05-23 19:31:45 +02:00
translators
9f13d3ff2b Update: Translations from eints
chinese (simplified): 2 changes by WenSimEHRP
greek: 11 changes by gh658804
2024-05-23 04:40:46 +00:00
Tyler Trahan
8f6e21617f Fix #12591: Give descriptive error when station construction fails due to wrong layout (#12678) 2024-05-22 17:56:03 -04:00
Rubidium
b2f1a06def Change: support listing/updating authorized keys of companies by the admin in the console 2024-05-22 22:20:10 +02:00
Rubidium
fea9ffa808 Codechange: also allow removing clients from the company allow lists 2024-05-22 22:20:10 +02:00
8a6745b26f Codechange: Use PIP instead of spacer widgets for OSK spacing. (#12709)
This (slightly) simplifies the OSK widget layout.
2024-05-22 19:06:52 +01:00
766350bfd2 Fix: Hide empty house 'classes' in house picker. (#12694)
Picker class list should not list classes with no items. The house picker could break this 'rule' with NewGRFs loaded.
2024-05-22 18:06:59 +01:00
7e12b5ff0f Fix: Crash if interface scale or font size changes with chat box present. (#12705)
Caused by the chat box being undrawn with the new dimensions, leading to out-of-bounding memory access.
2024-05-22 18:06:34 +01:00
Jonathan G Rennison
42fc32243d Fix #12681: Abstract filetype not set for network client join savegames (#12701) 2024-05-22 09:43:01 +01:00
19ca4089a1 Codechange: Use std::filesystem::exists instead of access. (#12702) 2024-05-22 09:23:01 +01:00
translators
5bc3723bcc Update: Translations from eints
czech: 11 changes by vladoschreiner
2024-05-22 04:42:40 +00:00
5442b0dd2d Fix: Make progress bars obey language direction. (#12704)
With RTL languages, progress bars should start from the right.
2024-05-21 00:40:08 +01:00
28e814f62a Codechange: Use L"" instead of _T("") (#12703) 2024-05-20 17:34:22 +00:00
translators
fb4a370d3f Update: Translations from eints
vietnamese: 13 changes by KhoiCanDev
chinese (simplified): 1 change by WenSimEHRP
finnish: 11 changes by hpiirai
french: 29 changes by ottdfevr
polish: 1 change by aefoes
2024-05-20 04:43:22 +00:00
translators
46d7586ab1 Update: Translations from eints
estonian: 8 changes by siimsoni
chinese (simplified): 4 changes by ahyangyi
korean: 13 changes by telk5093
2024-05-19 04:43:16 +00:00
Loïc Guilloux
29ce013eda Codechange: Pass avail(able) as reference instead of pointer since they are never nullptr (#12696) 2024-05-18 17:04:16 +02:00
ba47d1ca2b Fix: Allow resolving house parent scope (town) of unbuilt houses. (#12695)
Return unavailable variable result, instead of nullptr dereference.
2024-05-18 12:33:50 +01:00
3f5a354f37 Codechange: Use emplace with ICURun and UniscribeRun. (#12693) 2024-05-18 09:17:38 +01:00
856ec901ca Fix #12685: nullptr dereference when checking for equal loaded/loading groups. (#12686)
Always treat empty groups as non-equal. Given that the case of both being empty is handled earlier, they cannot both be equal and empty.

Additionally if a loaded or loading set are all the same, only add one reference.
2024-05-18 09:17:06 +01:00
translators
7fd2487c46 Update: Translations from eints
swedish: 6 changes by joeax910
chinese (simplified): 2 changes by WenSimEHRP
dutch: 27 changes by Afoklala
2024-05-18 04:40:26 +00:00
8d26d032e1 Fix #12497: [NewGRF] Increase vehicle motion counter for all parts. (#12561)
NewGRFs relied on the incorrectly motion counter that was 'fixed' in #12229, so always update v->motion_counter for all vehicle parts.
2024-05-17 20:50:04 +01:00
c85481564f Codechange: Use reusable temporary buffer in Win32FontCache. (#12666)
This avoids allocating and deleting a temporary buffer for every glyph that is rendered into a sprite.
2024-05-17 08:50:59 +01:00
4940b6ff0b Codefix: Compile warning with newer C++ compiler on MinGW. (#12689)
> template-id not allowed for constructor in C++20
2024-05-16 12:09:19 +01:00
translators
26113e3622 Update: Translations from eints
english (au): 11 changes by krysclarke
swedish: 7 changes by joeax910
english (us): 11 changes by 2TallTyler
chinese (simplified): 11 changes by WenSimEHRP
russian: 11 changes by Ln-Wolf
catalan: 11 changes by J0anJosep
portuguese: 13 changes by azulcosta
portuguese (brazilian): 11 changes by pasantoro
2024-05-16 04:41:07 +00:00
ca52da6c95 Fix: Unable to choose a font containing hyphen. (#12684)
FcNameParse may require some characters be escaped. Instead, pass name as FC_FAMILY.
2024-05-16 00:38:23 +01:00
d1b7619822 Change: Ignore min/max years for manual house placer. (#12687) 2024-05-15 23:17:58 +01:00
translators
56ea002283 Update: Translations from eints
catalan: 16 changes by J0anJosep
latvian: 2 changes by lexuslatvia
2024-05-15 04:41:37 +00:00
980dcaac6e Cleanup: Remove GetFontTable from FontCache. (#12677)
This interface is no longer used, so does not need to be implemented.

Removes manual memory management with malloc/free.
2024-05-14 21:13:26 +01:00
ed67aedabf Feature: Allow manually placing town buildings in scenario editor.
House picker is accessed from the Landscaping toolbar as there is no town toolbar.

Once placed these houses behave like any other and can be removed by players and towns.

Uses the unified picker system, so also supports used/saved favourites. As town building don't have class labels, town zones are use to imitate them.
2024-05-14 21:11:48 +01:00
874cfe000b Codechange: Set underlying type for HouseSpec enums. 2024-05-14 21:11:48 +01:00
b731ab0632 Change: Allow sprite resolver to evaluate non-existent houses.
This could previous be done but only with a town and tile in mind, but for drawing in the UI, neither of those exist yet.
2024-05-14 21:11:48 +01:00
d99c1337a2 Add: Command to build an individual house on a specific tile. 2024-05-14 21:11:48 +01:00
f901722066 Codechange: Rename BuildTownHouse to TryBuildTownHouse. 2024-05-14 21:11:48 +01:00
Tyler Trahan
bb77d16e40 Add: Shade button to waypoint picker (#12682) 2024-05-14 14:43:56 -04:00
Muxy
486af1a6fc Fix: [Admin] #12411 Send Network Welcome Packet to admin port after game creation completed
WelcomeAll moved into NetworkOnGameStart

Signed-off-by: Muxy <muxy@goulp.net>
2024-05-14 19:24:31 +02:00
460fab920c Fix #12418, 338def1b06: Filename extension taken from wrong string. (#12680) 2024-05-14 18:18:30 +01:00
Rubidium
00c4b232b3 Fix #12550: files were not saved in the right location when binary and configuration are in the same folder 2024-05-14 17:01:28 +02:00
translators
3f06aa441b Update: Translations from eints
english (us): 17 changes by 2TallTyler
greek: 147 changes by KyriakosMich
2024-05-14 04:40:19 +00:00
Tyler Trahan
9f63b9f65d Fix #12594: Give descriptive error when company takeover fails due to vehicle limit (#12676) 2024-05-13 10:10:03 -04:00
translators
870149406a Update: Translations from eints
chinese (simplified): 23 changes by WenSimEHRP
russian: 17 changes by Ln-Wolf
portuguese (brazilian): 8 changes by pasantoro
2024-05-13 04:41:24 +00:00
18e56df5e1 Fix #12674: Non-NewGRF Build Station widgets may not fill window properly. (#12675)
Allow labels in Build Station window to fill width as needed.
2024-05-13 00:18:07 +00:00
f2f7573c3f Fix #12668: Crash opening picker window with filter when no results available. (#12669)
When first opening the picker window, we attempt to find a valid class and type to select. If the picker window was closed with filters enabled, there may not be anything list that is usable.

Resolve this by using callbacks to find the first usable type when no types are listed.
2024-05-12 20:14:29 +01:00
Rubidium
77c188e6da Codechange: use std::vector instead of malloced array 2024-05-12 12:55:52 +02:00
Rubidium
6cea49c117 Codechange: replace uint with size_t in binary heap 2024-05-12 12:55:52 +02:00
Rubidium
8349203038 Cleanup: remove unused Aystar variables 2024-05-12 10:46:03 +02:00
77a7113ba6 Cleanup: Remove unused parameters from FreeTypeFontCache::SetFontSize. (#12663) 2024-05-12 08:39:40 +01:00
Rubidium
f939e81bf0 Fix #12655, 4f6d75f: inconsistent state in client list and potential crash after client leaves 2024-05-12 07:23:40 +02:00
translators
95a89e43b2 Update: Translations from eints
english (au): 16 changes by krysclarke
chinese (simplified): 16 changes by XiaoJi-Game
korean: 19 changes by telk5093
russian: 1 change by Ln-Wolf
finnish: 16 changes by hpiirai
lithuanian: 1 change by khamper
portuguese: 17 changes by azulcosta
portuguese (brazilian): 16 changes by pasantoro
2024-05-12 04:41:31 +00:00
34da94ffc8 Fix: Use widget resize step instead of window resize step. (#12659)
Build Picker class list filter could be drawn incorrectly depending on how the window can be resized.
2024-05-11 20:51:44 +01:00
d78f39a9df Cleanup: Remove GetUnitsPerEM and units_per_em. (#12656)
GetUnitsPerEM is never called.
2024-05-11 14:50:34 +01:00
translators
721cd2b8ad Update: Translations from eints
ukrainian: 1 change by Quantom2
dutch: 5 changes by Afoklala
lithuanian: 1 change by khamper
2024-05-11 04:41:26 +00:00
b30fe0d7da Feature: Ctrl-click to toggle favourites in build-pickers.
This allows ctrl-click on a type in a build-picker window to remember it
as a favourite. An new filter button to show only favourites makes it
simpler to use these types.

Favourite types are saved locally in favs.cfg, so are remembered between
games.
2024-05-11 02:12:41 +01:00
fde3b35a24 Feature: New filter to show only used types in build-pickers.
This filters the build-picker type lists to only show types that have
already been placed in the current game, making it simpler to get to
build matching features.
2024-05-11 02:12:41 +01:00
b76517816e Feature: Add "All" filter to build-picker show types from all classes.
Toggling the "All" filter causes the class selection to be ignored, so
that items from all classes can be displayed together. The class text
filter is still applied.

This makes it easier to search amongst types for a feature.
2024-05-11 02:12:41 +01:00
cdc356e7bf Change: Unify station/waypoint/roadstop/object build-picker window code.
These windows now share a common code base for choosing and display class and types.

An additional text filter is added to search types by name instead of just classes.
2024-05-11 02:12:41 +01:00
d2c8b476b5 Codechange: Add functions to test if a station/roadstop class is a waypoint.
This is now checked by class label instead of by index.
2024-05-11 02:12:41 +01:00
9f8c9724be Codechange: Add station/roadstop class labels for DFLT/WAYP.
This avoids repeating the same multichar literal value.
2024-05-11 02:12:41 +01:00
d5671030b1 Codechange: Add NewGRFSpecsBase class to hold class/index information.
Standardises how the class index is stored in the spec, instead of relying ot the Spec structs having the same members.

This allows retrieving class_index and index without searching or using pointer arithmetic.

'cls_id' is renamed to 'class_index' to make it clearer that it is an index rather than the multichar label of the class.
2024-05-11 02:12:41 +01:00
733284cc16 Codechange: Return std::vector from GetMusicCatEntryData.
Return std::vector instead of pointer to array with manual memory management.
2024-05-11 02:10:41 +01:00
31c306c6cd Codechange: Return std::string from GetMusicCatEntryName.
Return std::string instead of pointer to C-string with manual memory management.
2024-05-11 02:10:41 +01:00
frosch
dc22edc556 Doc: [Script] Extend API documentation on calendar- vs economy-time 2024-05-10 13:17:19 +01:00
frosch
04cc0c8125 Codechange: [Script] Document relation between ScriptErrorType and ErrorMessages enums 2024-05-10 13:17:19 +01:00
frosch
40e6230900 Codechange: Add main page to script API documentation 2024-05-10 13:17:19 +01:00
frosch
dfa2622153 Codechange: Unify naming of squirrel built-in types in Script API docs 2024-05-10 13:17:19 +01:00
frosch
e436e2ef40 Codefix: broken links and syntax issues in script API documentation 2024-05-10 13:17:19 +01:00
frosch
64e1f1d4d9 Codefix: Script API documentation about IDs was incomplete 2024-05-10 13:17:19 +01:00
frosch
4bf2dc3148 Codefix: Script API did not link simple types correctly 2024-05-10 13:17:19 +01:00
frosch
c1375cecf8 Codefix: [Script] script_types was excluded from API documentation 2024-05-10 13:17:19 +01:00
frosch
ffe76a0133 Update: Doxyfiles to doxygen 1.9.4 2024-05-10 13:17:19 +01:00
merni-ns
c3ee5e58a3 Cleanup: Move remaining NPF files into pathfinder directory 2024-05-10 10:38:44 +02:00
merni-ns
798ec4184b Cleanup: Remove unused function InvalidateShipPathCache
This was only used in the callback when changing the ship pathfinder setting.
2024-05-10 10:38:44 +02:00
merni-ns
55a7c59d13 Remove: NPF and pathfinder change settings 2024-05-10 10:38:44 +02:00
translators
a5c2543efc Update: Translations from eints
chinese (simplified): 7 changes by WenSimEHRP, 4 changes by ahyangyi
2024-05-10 04:40:29 +00:00
Rubidium
cef9417c9f Fix: always allow setting company settings, company/president name/face
There is a nice feature that synchronises the client settings upon setting up the company. Before
this, those commands would not be executed when no-actions-while-paused is set. This means that,
silently and depending on the server configuration, your wished for configuration might not be
there.

Similarly there is the president's face that's being set while creating a new company and setting
of the president/company name upon creation, when no-actions-while-paused is set.

So, just allow these operations also while paused to get a uniform experience when joining. To
keep the UI somewhat consistent, apply this "freedom" also to the other bits set from the company
UI; specifically company name and company colour.
2024-05-09 21:51:26 +02:00
Rubidium
a313676189 Doc: reason for using ::SendNet over ::Post in few cases 2024-05-09 21:51:26 +02:00
Rubidium
ed888c617b Codechange: just use ::Post over ::SendNet for creating new companies 2024-05-09 21:51:26 +02:00
Koen Bussemaker
59ac27f385 Fix #12643: _is_water_region_valid is not cleared/reset in AllocateWaterRegions 2024-05-09 20:18:04 +02:00
ec61951512 Cleanup: Remove Windows 9x font locale workaround. (#12644) 2024-05-09 07:03:02 +01:00
5b35fbd6f5 Change: Use button aspect ratio for buttons that show vehicle icons. (#12636) 2024-05-09 07:01:56 +01:00
translators
132e226b27 Update: Translations from eints
greek: 169 changes by KyriakosMich
lithuanian: 21 changes by khamper
polish: 1 change by pAter-exe
2024-05-09 04:42:47 +00:00
ladysadie
00cfd572ff Cleanup: Remove unneeded CheckMissingGlyphs call (#12640) 2024-05-08 21:42:02 +02:00
translators
cb3f99859c Update: Translations from eints
english (au): 1 change by krysclarke
estonian: 25 changes by siimsoni
korean: 3 changes by telk5093
russian: 1 change by Ln-Wolf
finnish: 1 change by hpiirai
catalan: 5 changes by J0anJosep
latvian: 30 changes by lexuslatvia
lithuanian: 140 changes by khamper
portuguese: 1 change by azulcosta
portuguese (brazilian): 3 changes by pasantoro
2024-05-08 04:40:34 +00:00
b74a7e749b Fix: Console command scrolling did not take account of padding and cursor width. (#12642) 2024-05-08 01:52:30 +01:00
731d46beb5 Change: Don't include midi file processing in dedicated server build. (#12632) 2024-05-08 00:57:52 +01:00
9008d793ab Change: Use per-company group numbers. (#12297)
This is used by the default group name, replacing the use of group index.
2024-05-07 19:01:28 +00:00
Jonathan G Rennison
8710e9b8c8 Fix #12608: SDL keycode to vkey mapping 2024-05-07 18:33:29 +02:00
Tyler Trahan
019f93a65f Doc: Clarify how to update version numbers in release guide (#12634) 2024-05-07 11:58:03 -04:00
translators
ab7e2a1883 Update: Translations from eints
english (au): 2 changes by krysclarke
english (us): 2 changes by 2TallTyler
greek: 4 changes by gh658804
russian: 2 changes by Ln-Wolf
finnish: 4 changes by hpiirai
danish: 2 changes by bscargo
lithuanian: 170 changes by khamper
french: 1 change by ben20471
portuguese: 2 changes by azulcosta
portuguese (brazilian): 2 changes by pasantoro
polish: 2 changes by pAter-exe
2024-05-07 04:41:01 +00:00
Rubidium
1a3cbaec56 Cleanup: remove warning about server administrators being able to read passwords 2024-05-07 00:03:15 +02:00
Rubidium
849d1fa1b3 Cleanup: remove UI for asking user for company password 2024-05-07 00:03:15 +02:00
Rubidium
457d51fc49 Cleanup: remove company password hashing and anything related to it 2024-05-07 00:03:15 +02:00
Rubidium
a9318cf653 Cleanup: remove UI for changing the password 2024-05-07 00:03:15 +02:00
Rubidium
9dc1fdc385 Cleanup: remove client side password checks when moving to a different company 2024-05-07 00:03:15 +02:00
Rubidium
16639939e9 Cleanup: remove command line option for company password 2024-05-07 00:03:15 +02:00
Rubidium
ca4bef1504 Cleanup: remove company password related network packets 2024-05-07 00:03:15 +02:00
Rubidium
71fc907584 Change: remove company passwords over client allow lists 2024-05-07 00:03:15 +02:00
Rubidium
a002803d1c Remove: autoclean_unprotected settings; all companies will be protected 2024-05-07 00:03:15 +02:00
Rubidium
4f3db8eeaf Feature: authorize specific clients to join network company without password 2024-05-07 00:03:15 +02:00
Rubidium
66354ab9eb Codechange: introduce allow list infrastructure for companies 2024-05-07 00:03:15 +02:00
Rubidium
1250ce8fdc Codechange: support storing std::string vectors/deques in the savegame 2024-05-07 00:03:15 +02:00
translators
4e9a280ef8 Update: Translations from eints
swedish: 2 changes by sereneavatar
norwegian (bokmal): 2 changes by eriksorngard
welsh: 19 changes by Ansbaradigeidfran
english (us): 2 changes by 2TallTyler
czech: 1 change by JsSusenka
lithuanian: 97 changes by khamper
french: 2 changes by Lishouuu
portuguese (brazilian): 1 change by pasantoro
polish: 2 changes by pAter-exe
2024-05-06 04:41:07 +00:00
Rubidium
b9c894b717 Fix: for GUI network servers, name the first company the same as any other company 2024-05-05 22:57:50 +02:00
Rubidium
455e202e03 Fix: server's client is shown incorrectly in some cases 2024-05-05 22:57:50 +02:00
4740eeaa43 Add: 'Get Content' buttons next to base set dropdowns in Game Options. (#12627)
This allows base set content to be downloaded more easily, filtered by type and next to where it is set up.
2024-05-05 16:15:35 +01:00
Koen Bussemaker
d2f98440bb Codechange: Make assert in follow_track easier to understand and debug 2024-05-05 16:30:44 +02:00
84ebae0bf5 Codechange: Tweak layout of network client list. (#12624)
Use PIP spacing instead of spacers and more used of standard WidgetDimensions.
2024-05-05 14:57:17 +01:00
cf94bd321d Codechange: Remove redundant SetMinimalSize of preview buttons. (#12622)
These widgets are also sized in UpdateWidgetSize where the current bevel width is accounted for as well.
2024-05-05 12:38:00 +01:00
72b2840a97 Codechange: Use PIP spacing instead of spacers in tree picker window. (#12623) 2024-05-05 12:37:45 +01:00
translators
99f497cb08 Update: Translations from eints
english (au): 2 changes by krysclarke
korean: 2 changes by telk5093
russian: 2 changes by Ln-Wolf
finnish: 2 changes by hpiirai
danish: 2 changes by bscargo
lithuanian: 4 changes by dziugas1959
portuguese: 2 changes by azulcosta
portuguese (brazilian): 4 changes by pasantoro
2024-05-05 04:40:50 +00:00
Rubidium
9fe9e4d398 Codechange: use vector instead of manual memory management for decompressing text files 2024-05-04 17:43:02 +02:00
d074ab909c Codechange: Replace Array/FixedSizeArray with std::deque. (#12409)
Array/FixedSizeArray is actually a resizeable container that allocates space in chunks and allows resizing without invalidating pointers.

This is also a behaviour of std::deque, so use that instead.
2024-05-04 10:55:16 +01:00
Tyler Trahan
cb26b0e92d Doc: Re-order release instructions to not tell the world prematurely (#12620) 2024-05-04 05:38:59 -04:00
f629d3c921 Codechange: Use vectors instead of CallocT/free for cache checks. (#12619)
Vectors are reused for each vehicle chain to save on reallocations.
2024-05-04 09:42:20 +01:00
115ac2629b Cleanup: Remove TileMatrix that hasn't been used for 4+ years. (#12621)
This 'nice' structure was left around from #8258 just in case it might be used again.

Spoiler alert: it hasn't.

This removes manual memory management. And otherwise unused and untested code.
2024-05-04 09:41:58 +01:00
translators
60cf37e0d1 Update: Translations from eints 2024-05-04 04:41:06 +00:00
9a7c30a109 Codechange: Let ClickSliderWidget handle rounding to nearest mark. 2024-05-03 11:48:36 +01:00
9d2efd4c96 Codechange: Use callback function to set labels of slider widget marks.
Slider widgets can only use a predefined list of values and strings to draw labels. This makes it difficult to vary the display by context.

Instead of providing a predefined list as a std::map, use a callback function instead. This function can decide what text to display, and can call SetDParam to dynamically set up strings.
2024-05-03 11:48:36 +01:00
Rubidium
8b6661d486 Codefix 90029be: build failure for SDL 1.2 2024-05-03 10:45:34 +02:00
Rubidium
0b50834f81 Fix 2955ff3: CMake atomic check fails due to chosen compiler 2024-05-03 07:32:32 +02:00
translators
e0048d798f Update: Translations from eints
hungarian: 5 changes by egri-nagy
2024-05-03 04:41:54 +00:00
90029beb49 Codechange: Ensure SDLK mappings stay in the expected order. (#12608)
Add a constexpr constructor that ensures at compile-time that the source SDLK range matches the target range.
2024-05-02 23:19:08 +01:00
James Addison
c17fa6032b Doc: Add Apache 2.0 licensing info for CheckAtomic.cmake (#12603) 2024-05-02 15:13:00 +02:00
Koen Bussemaker
ef99aa81a3 Codechange: Store validity of water regions in separate vector 2024-05-02 15:03:48 +02:00
cf96d49ced Codechange: Use vector for airport tile layouts. (#12607)
Simplify AirportSpec data by storing layout information together in a vector, instead of separate arrays.

This removes manual memory management and separate count members.

The default layouts will be copied instead of always referring to the originals.
2024-05-02 11:37:54 +00:00
translators
65c9df49d9 Update: Translations from eints
chinese (simplified): 8 changes by XiaoJi-Game
catalan: 3 changes by J0anJosep
2024-05-02 04:41:51 +00:00
Fen
2559bdfa6f Fix 2d27e8e: Update numpad keycodes for SDL2, making it usable (#12596)
* Fix 2d27e8e: Update numpad keycodes for SDL2, making it usable

* Cleanup: List sdl2 numpad mappings individually
2024-05-01 23:10:01 +02:00
Jonathan G Rennison
9647fe1d05 Change: [Linkgraph] Improve distance scaling algorithm in demand scaler
Improve scaling at values other than 0% and 100%
Fix erratic scaling and increase effect size at large setting values
2024-05-01 22:40:17 +02:00
f146680121 Codechange: Use vector for industry random sounds. (#12606)
Use a vector to store the list of random sounds played for an industry.

The removes manual memory allocation, flags to control memory management, a separate count member, and a try/catch block.
2024-05-01 19:55:00 +00:00
7147fe9e7a Codechange: Use range-for when loading NewGRF deterministic sprite groups. (#12605) 2024-05-01 18:59:46 +00:00
532ce1a907 Codechange: Use Recv/Send_bytes for md5sum. (#12602)
Use existing functions to handle serialisation of arrays instead of indexed for-loop.
2024-05-01 18:55:54 +01:00
1424a184d8 Codechange: Use vector/span when loading wagon overrides. (#12604)
Replaces manual memory allocation and passing pointer with size.
2024-05-01 18:23:27 +01:00
translators
96d82b4363 Update: Translations from eints
chinese (simplified): 1 change by WenSimEHRP
greek: 52 changes by KyriakosMich
german: 3 changes by Wuzzy2
basque: 36 changes by Porrumentzio
danish: 3 changes by bscargo
2024-05-01 04:41:08 +00:00
translators
4df44fea38 Update: Translations from eints
swedish: 3 changes by joeax910
galician: 63 changes by pvillaverde
2024-04-30 04:40:35 +00:00
cc6e4768a9 Fix: Out-of-order window set up due to deferred window resize. (#12592)
Deferred window resize was being applied to the initial window resize event, resulting in some window state (e.g. scroll bar capacity) not being initialised when expected.
2024-04-29 17:05:35 +01:00
translators
b852a3f408 Update: Translations from eints
english (us): 3 changes by 2TallTyler
korean: 3 changes by telk5093
hungarian: 2 changes by meskobalazs
2024-04-29 04:40:19 +00:00
rubidium42
fd4cf699e5 Codefix 37a03b5: the return value of maxdim should always be assigned (#12590) 2024-04-28 17:42:58 +00:00
Rubidium
98d37338df Codechange: use ranged for loop instead of one with lengthof 2024-04-28 19:42:44 +02:00
Rubidium
24b6ec80a9 Codechange: use ranged for loop and vector to determine the disaster to deploy 2024-04-28 19:42:44 +02:00
Rubidium
87dbd4a833 Codechange: use ranged for loop to determine widest title 2024-04-28 19:42:44 +02:00
Rubidium
d183d8e587 Codechange: remove INVALID_STRING_ID now drop down uses spans 2024-04-28 18:47:31 +02:00
Rubidium
37a03b513f Codechange: refactor string list dimension finding into a separate function 2024-04-28 18:47:31 +02:00
Rubidium
546a996d95 Codechange: pass options to ShowDropDownMenu using a span 2024-04-28 18:47:31 +02:00
Rubidium
ad50c4f298 Codechange: inline sorter name definitions and use proper static accessor instead of (implying) this-> 2024-04-28 18:47:31 +02:00
ef55cc7979 Codechange: Remove support for links in tar files. (#12571)
This was a feature to support the original 32bpp sprite system and is no longer relevant.
2024-04-28 15:18:24 +01:00
Loïc Guilloux
99b74c1064 Fix #12584: Improved error handling during tar scan (#12586) 2024-04-28 16:08:32 +02:00
Rubidium
826deaee57 Codechange: refactor CalcHeightdiff to remove some magic numbers 2024-04-28 16:05:21 +02:00
Rubidium
97a34bf06e Codechange: use C++ containers for the colour schemes 2024-04-28 16:04:54 +02:00
translators
ee9895a970 Update: Translations from eints
norwegian (bokmal): 3 changes by eriksorngard
french: 3 changes by ottdfevr
portuguese: 3 changes by azulcosta
2024-04-28 04:41:11 +00:00
440a633fcc Codechange: Remove shrink_to_fit for more lists.
A comment about "will actually do nothing" is out of date as that is not the case with std::vector.

These lists are always short lived (either within a command handler or in a window) so don't shrink_to_fit.
2024-04-27 19:25:34 +01:00
33aedc43a5 Codechange: Shrink GUIList vectors less often, reserve before use.
After sorting and filter lists for GUI, we often shirnk them to reduce size. However this has very little benefit:

1) The memory has already been allocated, so it doesn't prevent that memory being required.
2) It causes a new allocation and copy when the vector is shrunk, actually using more memory.
3) The list is in window state, so the lifetime is only while the window is open.
4) When a filter is clearer, the original size will be needed again, which will cause another allocation.

In fact it is beneficial to reserve to the known maximum in most cases, so do that instead.
2024-04-27 19:25:34 +01:00
translators
8308998388 Update: Translations from eints
english (au): 3 changes by krysclarke
russian: 3 changes by Ln-Wolf
finnish: 6 changes by hpiirai
dutch: 6 changes by Afoklala
portuguese (brazilian): 4 changes by pasantoro
polish: 3 changes by pAter-exe
2024-04-27 04:40:44 +00:00
bf8de188ec Codechange: Use member initialization of GRFFilePropsBase. (#12581)
Don't blame compilers for our sloppy initialisation.

Removes memset, and lengthof.
2024-04-26 22:58:54 +01:00
72c55128d2 Codechange: Remove write-only spec_id from RoadStopSpec. (#12582)
Comment is incorrect about its value too.
2024-04-26 21:56:30 +01:00
a6d401debf Fix: Properly test for presence of waypoint in NewGRF resolver. (#12579)
Test whether the BaseStation itself a Station or Waypoint, instead of by the station class ID assigned to it.
2024-04-26 17:47:53 +01:00
translators
a60a81f34e Update: Translations from eints
swedish: 7 changes by joeax910
vietnamese: 15 changes by anmatngu
greek: 31 changes by gh658804, 2 changes by KyriakosMich
hungarian: 2 changes by egri-nagy
portuguese (brazilian): 2 changes by pasantoro
2024-04-26 04:41:25 +00:00
Rubidium
0fdabca605 Codechange: use std::span instead of custom span in TGP 2024-04-26 06:15:29 +02:00
f44d8fa2e4 Codechange: Remove CDECL from filter functions. (#12578)
These functions are not passed to qsort()...
2024-04-25 22:13:23 +01:00
0075a95278 Codefix: Make three _filter_funcs definitions distinct. (#12573)
Rename the GUIList function lists defined as the same symbol.
2024-04-25 21:01:15 +01:00
5bc9854be2 Codechange: Make sort list function lists safer. (#12574)
GUIList has a pointer only to the start of each sort/filter func list, which has the potential for UB as it is unable to validate that the selected sort or filter type is in range.

Use a std::span instead and check if the selected type is in range before using it.
2024-04-25 21:00:49 +01:00
Jonathan G Rennison
9b747a173d Fix #12509: Maintain timer sort invariants when changing period 2024-04-25 20:08:24 +02:00
Jonathan G Rennison
11ec156b64 Codechange: Add a priority field to TimerGameTick::TPeriod
Use this as the primary sort key for TimerGameTick::TPeriod,
to avoid container sort order changes on timer period saveload.
See: #12509
2024-04-25 20:08:24 +02:00
André Cheng
57f5d27427 Doc: Fix documentation of GetDefaultValueCallback 2024-04-25 20:07:54 +02:00
André Cheng
ceb0053dd9 Codechange: Correct return type of GetDefaultValueCallback 2024-04-25 20:07:54 +02:00
André Cheng
339b0ea0ff Change: Show correct default value and unit for vehicle service interval setting 2024-04-25 20:07:54 +02:00
André Cheng
fd80a1ec66 Fix #11345: Use correct default button value for vehicle service interval setting 2024-04-25 20:07:54 +02:00
André Cheng
a4071b78d7 Codechange: Add callback to IntSettingDesc to support more default values 2024-04-25 20:07:54 +02:00
translators
e8d25d68b9 Update: Translations from eints
russian: 2 changes by George-VB
2024-04-25 04:42:18 +00:00
e8249e9075 Codechange: Pass buffers for TarFile's ExtractString as span. (#12567)
ExtractString does not need to find a string terminator as StrMakeValid already does this, so simply pass the full bounds of the buffer.

Removes lengthof, array indices, and needs only the buffer as a parameter.
2024-04-24 21:34:21 +01:00
5159aa81d4 Codechange: Use iterators when enabling industries. (#12569)
Removes lengthof and array indices.
2024-04-24 21:33:49 +01:00
26bb87ebf1 Codechange: Replace SaveLoad var length arrays with switch block and sizeof. (#12570)
SlCalcConvMemLen(), SlCalcConfFileLen() and CalcOldVarLen() follow a pattern of looking up part of a value in an array.

These function returns the size of bytes of a variable type, but is not very clear. Replace with a switch block instead.

Removes lengthof, array indices, and magic numbers.
2024-04-24 21:33:29 +01:00
1dc94d0670 Codechange: Construct string_view with first+last. (#12568)
Avoids needing to calculate size when we already have last.
2024-04-24 21:29:33 +01:00
6a3f50aa72 Codechange: Replace separate EffectVehicle arrays. (#12565)
Combine 3 separate arrays into a single struct. This keeps related data together, and avoids needing to check that each array is same length.

Use of constexpr construct ensures data in the array is not default-initialised.

Removes lengthof.
2024-04-24 21:29:12 +01:00
e20f48799e Codechange: Make StringToContentType() clearer. (#12566)
Decouples string to ContentType mapping from position within enum.

Slightly less efficient, but removes lengthof, array indices, and casting.
2024-04-24 21:26:31 +01:00
5e689ce25e Codechange: Store cursor sprites in vector. (#12564)
Combine two separate fixed length arrays to allow simpler iteration.

No need to check that arrays are all the same length.
No need to separately store the number of sprites to draw.
Removes the upper limit of the number of sprites that can be drawn.

Removes lengthof and array indices.
2024-04-24 21:26:07 +01:00
translators
9121770582 Update: Translations from eints
korean: 3 changes by telk5093
catalan: 3 changes by J0anJosep
french: 7 changes by ottdfevr
polish: 7 changes by pAter-exe
2024-04-24 04:40:54 +00:00
ac6a945e26 Revert 2408a68910: Remove work around for an MSVC bug from 17 years ago. (#12557) 2024-04-23 17:05:08 +01:00
Koen Bussemaker
bef11941c6 Change: Allow rail and road depot overbuilding in current orientation in order to connect to rail or road 2024-04-23 13:11:31 +02:00
translators
95de90dd4e Update: Translations from eints
norwegian (bokmal): 7 changes by eriksorngard
danish: 7 changes by bscargo
portuguese (brazilian): 4 changes by pasantoro
2024-04-23 04:40:32 +00:00
3814adaba8 Codechange: Simplify GetScrolledItemFromWidget() (#12556)
Return `auto`, which allows working with const containers, and use std::next instead of std::advance.
2024-04-22 19:00:14 +00:00
translators
c82a2575d7 Update: Translations from eints
english (au): 3 changes by krysclarke
english (us): 3 changes by 2TallTyler
greek: 3 changes by gh658804
russian: 3 changes by Ln-Wolf
finnish: 5 changes by hpiirai
turkish: 7 changes by BeratSJ
portuguese: 3 changes by azulcosta
portuguese (brazilian): 3 changes by pasantoro
2024-04-22 04:40:33 +00:00
Rubidium
ded4d63db2 Codechange: simplify access to the current screenshot format 2024-04-21 21:07:05 +02:00
d465257dd0 Fix 952d111: Houses and industry tiles could accept incorrect cargo. (#12547)
Default cargo label was not cleared (set to CT_INVALID) when using older 3-slot acceptance properties for house and industry tiles.

Missed in #12053 and #12062.
2024-04-21 19:46:05 +01:00
3b01d31280 Fix 8746be8: Reinstate current order test when removing road stop. (#12552)
#12144 replaced pool iteration with FindVehiclesWithOrder, however the test for current_order being OT_GOTO_STATION was erroneously removed.
2024-04-21 19:41:25 +01:00
translators
c073165e34 Update: Translations from eints
greek: 5 changes by gh658804
finnish: 2 changes by hpiirai
catalan: 4 changes by J0anJosep
2024-04-21 04:42:00 +00:00
Rubidium
aa895535e6 Fix 5008706: improved scenario editor tooltips in map generation stages are out of place 2024-04-20 21:56:27 +02:00
959ced71bb Codechange: Add constants for original input/output cargo counts. (#12548)
This replaces some magic 3s and 2s.
2024-04-20 20:50:48 +01:00
b4e00fa738 Codechange: Replace C-casts in pool functions. (#12541) 2024-04-20 16:50:13 +01:00
Loïc Guilloux
c5ef47ee09 Codechange: [Script] Use std::unique_ptr for Company::ai_instance (#12544) 2024-04-20 16:58:46 +02:00
Rubidium
1dfd0c19f4 Fix: allow only 255 league tables, as 255 is the invalid id sentinel 2024-04-20 16:53:04 +02:00
Rubidium
c377c4740d Codechange: replace cpp_lengthof with safe alternatives 2024-04-20 13:36:19 +02:00
a1a01e21cf Change: Use std::make_unique instead of passing new() (#12539) 2024-04-20 11:20:49 +01:00
Rubidium
fc7f184dbd Codechange: move knowledge about 'packed' orders to the saveload code 2024-04-20 11:58:07 +02:00
Rubidium
1691b41b54 Codechange: use C++ containers for parsing the settings int lists 2024-04-20 11:57:45 +02:00
Rubidium
434c49a1f8 Codechange: remove now unused endof macro 2024-04-20 11:30:46 +02:00
Rubidium
8fe5fdf122 Codechange: use std::none_of to express clearer what the code does 2024-04-20 11:30:46 +02:00
Rubidium
8986fb0385 Codechange: replace C-style array-pointer methods with the appropriate C++ methods 2024-04-20 11:30:46 +02:00
2114888485 Change: De-template BaseSetTextfileWindow. (#12536)
The BaseSet type is not needed after the window is constructed, only the filename and name are required, which can be passed as parameters from `ShowBaseSetTextfileWindow()` instead.

This avoids compiling three instances of `BaseSetTextfileWindow`.
2024-04-20 10:30:29 +01:00
Rubidium
e441033d68 Codechange: use std::array instead of C-style array for produced/accepts cargo 2024-04-20 11:29:55 +02:00
40fa45a76a Codechange: Emplace std::pair into vectors.
This creates the pair in the vector, instead of creating it then copying it in.
2024-04-20 10:25:20 +01:00
ed2db80990 Codechange: Use map.emplace() instead of map.insert(std::pair).
This avoids a copy of the pair into the map.
2024-04-20 10:25:20 +01:00
57d7359b1a Codechange: Remove old group liveries savegame conversion. (#12537)
Conversion to set default group livery is in the wrong place (not in `AfterLoadGame()`), however it is not necessary any more as `AfterLoadGame()` always calls the function `UpdateCompanyLiveries()` which will do the same thing.
2024-04-20 10:25:04 +01:00
699c7e4c9d Fix 3de8853e29: Industries accept/produce no cargo for pre-SLV_78 saves. (#12508)
Industry accepted/produced was trimmed too early for original and pre-SLV_78 saves, as cargo type was not stored per slot so all slots look invalid to the trim function.
2024-04-20 10:24:35 +01:00
1c31e4b68c Change: Disallow using Action A to load sprites above the baseset unless reserved. (#12435)
Using Action A above the baseset is error prone as the sprites are not fixed and can be moved around.

Any NewGRF doing so is likely to break in the future, so force it to break instead.
2024-04-20 10:23:36 +01:00
e028c15555 Codechange: Use std::accumulate to get infrastructure total rail/road pieces. (#12442) 2024-04-20 10:22:19 +01:00
translators
08140fdca3 Update: Translations from eints
dutch: 4 changes by Afoklala
2024-04-20 04:41:21 +00:00
6cbb8d02cf Change: Use aspect ratio for shared order list button. 2024-04-19 22:11:16 +01:00
5df5e3f45c Change: Use aspect ratio for file home button. 2024-04-19 22:11:16 +01:00
2a833a8968 Change: Use aspect ratio for rail station platforms/tracks buttons. 2024-04-19 22:11:16 +01:00
7e049aa2b1 Change: Use aspect ratio for common left/right buttons. 2024-04-19 22:11:16 +01:00
16eb17418b Change: Use aspect ratios for some common widgets. 2024-04-19 22:11:16 +01:00
61c6ebaacc Change: Automatically set aspect ratio of common window decorations. 2024-04-19 22:11:16 +01:00
d43ff8dc49 Change: Ability to set aspect ratio of a widget.
This allows setting the shape of a widget without dealing with absolute pixel sizes.
2024-04-19 22:11:16 +01:00
f267b37a33 Codechange: Use std::initializer_list/array in framerate window. (#12441) 2024-04-19 22:07:56 +01:00
a28ab8cac2 Codechange: Replace C-style casts to size_t with static_cast. (#12455)
* Codechange: Replace C-style casts to size_t with static_cast.

This touches only simple value-type casts.

* Codechange: Replace static_cast<size_t>(-1) with SIZE_MAX

Co-authored-by: Rubidium <rubidium@openttd.org>
2024-04-19 20:34:36 +01:00
6ee31a2a22 Codechange: Use string_view in IniItem/IniGroup/IniFile. (#12535)
This avoids making extra copies of strings.
2024-04-19 13:54:22 +01:00
3b80a8255f Fix #12433: Width of unit number display was too narrow. (#12534)
Digit width was counted, but ignored the thousands separator.
2024-04-19 08:19:31 +01:00
translators
7848e80f71 Update: Translations from eints
english (us): 4 changes by 2TallTyler
korean: 11 changes by telk5093
2024-04-19 04:40:34 +00:00
dP
0d1fc47edb Cleanup: Remove redundant break statement (#12527) 2024-04-18 20:54:20 -04:00
774f811217 Codechange: Use std::optional for town parent scope resolver. (#12530)
When resolving NewGRF, the parent town_scope is lazily initialised as it does not always need to be used.

Replace the manually managed pointer with std::optional to simplify. Using std::optional avoids extra memory allocation.
2024-04-18 22:14:16 +01:00
3b75d8bbf8 Fix: Use modern comparisons instead of memcmp in cache check.
This uses C++20 default operator<=> to provide comparisons of some objects.

This works properly with caches that containers.
2024-04-18 22:13:55 +01:00
21d11ee361 Codechange: Move cache check function to own file. 2024-04-18 22:13:55 +01:00
db56499c01 Codechange: Use std::array for company infrastructure arrays. 2024-04-18 22:13:55 +01:00
fe7bd3a266 Codechange: Use std::array for cached town zone radius. 2024-04-18 22:13:55 +01:00
d57bf84196 Codechange: Remove some unnecessary c_str() when passing std::strings. (#12532)
Functions have been updated from `char *` to `std::string` since without removing `c_str()`.
2024-04-18 22:13:13 +01:00
45886e50b2 Codechange: Unify where rail station tile flags are set. (#12531)
This avoids repeating the logic in three places.
2024-04-18 18:54:10 +01:00
Patric Stout
04a3bf76e8 Codechange: upgrade Emscripten to 3.1.57 (#12526)
This also upgrades liblzma to 5.4.6, and uses the new ports.contrib
system Emscripten 3.1.56 introduced.
2024-04-18 19:37:33 +02:00
Patric Stout
08d05bf4c0 Doc: update release documentation with the latest (#12525) 2024-04-18 17:12:52 +00:00
4170c9923a Fix: Inconsistent space between console history and current line. (#12528) 2024-04-18 17:45:41 +01:00
Tyler Trahan
78b83190cc Fix: Mark vehicle status bars dirty when a vehicle leaves unbunching depot (#12516) 2024-04-18 12:45:00 -04:00
Patric Stout
715f8c0218 Codefix: cast to "CommandCallback *" in a way cast-function-type-mismatch doesn't mind (#12529) 2024-04-18 16:41:36 +00:00
translators
c355e98c58 Update: Translations from eints
english (au): 4 changes by krysclarke
russian: 4 changes by Ln-Wolf
finnish: 7 changes by hpiirai
portuguese: 4 changes by azulcosta
portuguese (brazilian): 5 changes by pasantoro
polish: 4 changes by pAter-exe
2024-04-18 04:40:27 +00:00
63ce81570c Remove: Custom opendir implementation for Windows no longer needed.
std::filesystem::directory_iterator is now used instead.
2024-04-18 01:41:14 +01:00
42523379d9 Codechange: Use directory_iterator in ScanPath.
Replaces use of custom ttd_opendir.
2024-04-18 01:41:14 +01:00
d7c547d0db Codechange: Use directory_iterator to list directories in file list windows.
This replaces use of custom ttd_opendir. Files are listed separately using ScanPath as that handles downloaded content.
2024-04-18 01:41:14 +01:00
5a523cf212 Codechange: Simplify FioCreateDirectory.
`std::filesystem` provides `create_directories()` as a cross-platform way to create a directory tree.
2024-04-18 01:41:14 +01:00
6458980413 Change: Draw group hierarchy tree lines. (#12522) 2024-04-17 21:55:19 +01:00
Jonathan G Rennison
83d99ec11d Fix #12506: Update station/industry nearby lists in BuildOilRig (#12511) 2024-04-17 22:38:11 +02:00
Patric Stout
f7bd080015 Codechange: improve desync documentation (#12521) 2024-04-17 20:36:08 +00:00
Patric Stout
07b162ffc4 Codechange: skip all commands of the past during desync replay (#12520) 2024-04-17 20:05:45 +00:00
Patric Stout
a0636d8200 Codechange: use infinite-fast-forward when rerunning command-log (#12519) 2024-04-17 20:01:58 +00:00
Patric Stout
a09749f6a6 Codefix: don't send desync=0 log messages to commands.log (#12517)
They are only used during replay, and you want to see those in
the console; not in the log.
2024-04-17 19:51:36 +00:00
Patric Stout
1005c86c62 Codechange: record cache warnings with a "warning" prefix (#12518) 2024-04-17 19:49:55 +00:00
Tyler Trahan
a02da5476e Fix: Don't show train waiting for unbunching as waiting for free path (#12515) 2024-04-17 15:04:16 -04:00
Tyler Trahan
5878d09ef2 Fix: Smooth outliers in unbunching round trip calculations (#12513) 2024-04-17 15:03:53 -04:00
Tyler Trahan
824687d1f0 Codefix: Don't mix signed and unsigned ints in unbunching calculations (#12514) 2024-04-17 14:42:49 -04:00
Jonathan G Rennison
0b9029b69c Fix: Station/industry nearby list checks in CheckCaches 2024-04-17 20:33:49 +02:00
ef8eb66a2b Fix c38df2d58: Use VehicleID instead of pointer in map of vehicles to replace. (#12512)
This affects the sort order, VehicleID is deterministic, Vehicle * is not.
2024-04-17 18:54:50 +01:00
Paco Esteban
b477a8458c Codechange: Use arc4random_buf on random_func.cpp for OpenBSD 2024-04-17 19:29:26 +02:00
translators
018326321c Update: Translations from eints
english (us): 5 changes by 2TallTyler
latvian: 1 change by lexuslatvia
2024-04-17 04:40:56 +00:00
Koen Bussemaker
257d312a58 Fix #12228, Fix #12231: CheckShipReverse only restricts path when it has to 2024-04-16 20:21:18 +02:00
Rubidium
b2218e75d4 Codefix: missing space between close parenthesis and open curly brace 2024-04-16 19:28:09 +02:00
48eb9b8bc9 Add: Check that towns can build roads before generating map. (#12503) 2024-04-16 15:25:07 +00:00
translators
8e2ccddd77 Update: Translations from eints
portuguese (brazilian): 2 changes by pasantoro
2024-04-16 04:40:57 +00:00
3ad143c43a Codechange: Use x = y instead of x{y} for value-type member initialisation. (#12501)
This is easier to read and less likely to look like an array definition.
2024-04-15 23:07:36 +01:00
Koen Bussemaker
672aa014d8 Doc: Updated Visual Studio, cpp standard and Cmake version 2024-04-15 23:06:23 +02:00
ladysadie
727392e0b3 Codechange: Remove per font AA settings. (#12413)
OpenTTD will use the global AA font setting for all fonts from now on.
2024-04-15 21:44:33 +02:00
a1b03ee69e Codechange: Replace platform-specific calls with std::filesystem::last_write_time. (#12487) 2024-04-15 18:10:19 +00:00
dP
f5a50a874f Codechange: Update doxygen comment to reflect removed parameter (#12499) 2024-04-15 12:40:50 +02:00
translators
cd108fd9e4 Update: Translations from eints
greek: 10 changes by gh658804
2024-04-15 04:44:34 +00:00
839f486074 Codechange: Use directory_iterator to find language files. (#12495)
This avoids using custom ttd_opendir, along with C-style string comparisons against file names.
2024-04-14 23:57:26 +01:00
4eaeccdaeb Codechange: Introduce FioRemove() to remove files. (#12491)
New function FioRemove() handles OTTD2FS conversion, and uses std::filesystem::remove instead of unlink, all in one location.
2024-04-14 23:43:50 +01:00
translators
29e932e087 Update: Translations from eints
ukrainian: 13 changes by imlystyi
lithuanian: 19 changes by dziugas1959
french: 7 changes by ottdfevr
portuguese (brazilian): 14 changes by pasantoro
2024-04-14 05:02:47 +00:00
translators
090c3b3abf Update: Translations from eints
danish: 5 changes by bscargo
dutch: 5 changes by Afoklala
portuguese (brazilian): 7 changes by pasantoro
2024-04-13 04:40:27 +00:00
e83e2df023 Fix: Build industry window did not take width of count into account. (#12476) 2024-04-12 23:07:31 +01:00
12125bad82 Fix 3de8853e: Industry cargo types callback no longer functioned due to container change. (#12489)
Use defined INDUSTRY_NUM_INPUTS/INDUSTRY_NUM_OUTPUTS values instead of container size, which is now empty at this point.
2024-04-12 23:07:07 +01:00
c1520cf682 Fix 25aeb1c: Driver parameter documentation was not updated. (#12486) 2024-04-12 17:01:40 +00:00
ca73f03334 Codechange: Use std::filesystem::remove/rename in settingsgen. (#12483) 2024-04-12 14:32:35 +01:00
44b8210037 Codechange: settingsgen's CopyFile actually appends. (#12485) 2024-04-12 13:01:16 +01:00
003906becb Codechange: std::filesystem::rename does not need remove first. (#12484) 2024-04-12 12:51:42 +01:00
translators
bb9b8b90c7 Update: Translations from eints
swedish: 6 changes by sereneavatar
portuguese (brazilian): 11 changes by pasantoro
2024-04-12 04:41:30 +00:00
9915c1f032 Fix #12477: Use std::filesystem::rename instead of Windows Shell API call. (#12478) 2024-04-11 21:35:40 +01:00
Rubidium
eda10abc8c Codechange: pass command line arguments as std::span to openttd_main 2024-04-11 21:57:53 +02:00
3316b27496 Fix: Signature validation did not close its file. (#12479) 2024-04-11 13:37:29 +00:00
Rubidium
afd7878de0 Codechange: internally use a span of arguments for GetOptData 2024-04-11 12:00:36 +02:00
Rubidium
5592b4409b Codechange: use ranged for loop and separate function instead of goto 2024-04-11 12:00:36 +02:00
Rubidium
e8a56db21d Codechange: use designated initializers for OptionData and pass as span 2024-04-11 12:00:36 +02:00
Rubidium
4f2412a272 Codechange: range based for loops instead of C-style for loops 2024-04-11 07:05:04 +02:00
Rubidium
2587a21400 Codechange: use zero-initialization instead of C-style loop 2024-04-11 07:05:04 +02:00
Rubidium
ff27b9e76a Codechange: use std::any_of instead of custom loop 2024-04-11 07:05:04 +02:00
translators
6cade18053 Update: Translations from eints
portuguese (brazilian): 1 change by pasantoro
polish: 1 change by pAter-exe
2024-04-11 04:41:57 +00:00
rubidium42
442daf58da Codechange: replace lengthof with std::size in Windows specific code 2024-04-10 23:17:13 +02:00
6bc4a62c27 Codechange: Pass std::string_view from blitters instead of char *. 2024-04-10 22:02:04 +01:00
332cbca36e Codechange: Pass std::string_view from drivers instead of char *. 2024-04-10 22:02:04 +01:00
a42aa1a086 Codechange: Remove cargo_suffix C-array from GetIndustryString. (#12472)
The information is pushed onto a vector, so string ownership can be moved there instead of using a pointer into to the CargoSuffix array.
2024-04-10 21:32:21 +01:00
144bcbbaf1 Fix: Use clear() to clear std::string. (#12471) 2024-04-10 17:27:30 +00:00
Rubidium
21b640b5ff Codechange: simplify president name generation 2024-04-10 18:57:53 +02:00
Patric Stout
1b4bb1d38a Codefix: [CMake] use the UTC0 date for our ISODATE (#12470) 2024-04-10 08:50:44 +00:00
translators
f0f97c698b Update: Translations from eints
norwegian (bokmal): 11 changes by eriksorngard
russian: 5 changes by Ln-Wolf
spanish: 5 changes by MontyMontana
portuguese (brazilian): 7 changes by pasantoro
2024-04-10 04:40:30 +00:00
1773c5b810 Change: Increase object/station/roadstop class limit. (#12094)
The class limit is arbitrary and not stored in game state.

This change prevents all entities in classes after the 255th class from being dumped into the first class.
2024-04-09 23:16:20 +01:00
Rubidium
df8eeb1b10 Codechange: use C++ algorithms to determine the SaveLoadFormat 2024-04-09 23:36:39 +02:00
77f27e0804 Change: Expose NewGRF classes and specs as spans and simplify iteration.
This replaces some index-based loops with range loops.
2024-04-09 21:46:59 +01:00
052f421327 Change: Use vector/iterators/algorithms instead of C-array/loops for NewGRF classes. 2024-04-09 21:46:59 +01:00
34758d0921 Change: Allow string mapping by function instead of pointer.
This allows mapping of strings to objects that may be moved between loading stages.
2024-04-09 21:46:59 +01:00
90ca3515da Fix #12459, f6a88e4: Crashes when deleting news messages. (#12460)
The updated logic in f6a88e4 for deleting news messages did things in the wrong order.
2024-04-09 21:46:29 +01:00
2976a46d06 Fix 54be756: Terminating NUL byte was not skipped in ReadString(). (#12462) 2024-04-09 15:15:09 +01:00
Rubidium
883d3e7a9f Codechange: use std::span instead of pointer + length 2024-04-09 10:11:50 +02:00
54be756aae Codechange: Pass NewGRF strings as std::string_view instead of char *. (#12461) 2024-04-09 08:40:27 +01:00
dc7c2bb30d Fix: Draw continuation lines for engine variant hierarchy tree. (#12434) 2024-04-09 08:35:12 +01:00
de4e00c93f Codechange: Pass by reference to UpdateWidgetSize. (#12457)
These parameters are always provided and not optional.
2024-04-09 08:34:45 +01:00
translators
b5ad28022d Update: Translations from eints
english (au): 5 changes by krysclarke
chinese (simplified): 1 change by WenSimEHRP
catalan: 7 changes by J0anJosep
portuguese (brazilian): 27 changes by pasantoro
2024-04-09 04:40:33 +00:00
1b127628cb Codechange: Use dynamic_cast with FindWindowById. (#12458)
Missed from 74e09ab.
2024-04-08 22:32:57 +01:00
7e28605830 Fix: Use reinterpret_cast instead of C-style cast to align pointers. 2024-04-08 18:21:42 +01:00
4daf95b878 Fix: Use static_cast instead of C-cast to avoid hidden errors. 2024-04-08 18:21:42 +01:00
cdfffb551c Fix: sym->sym accidentally changed to sym prevented keys working with SDL. 2024-04-08 18:21:42 +01:00
74e09abf76 Codechange: Use dynamic_cast instead of C-cast after FindWindowById. (#12448)
dynamic_cast was used in most places, but not all.
2024-04-08 13:26:19 +01:00
Rubidium
4e6d4fcf32 Codechange: replace for loops with endof with range-based for loops 2024-04-08 07:00:55 +02:00
translators
095bdf32fe Update: Translations from eints
greek: 5 changes by gh658804
finnish: 7 changes by hpiirai
ukrainian: 56 changes by Quantom2, 14 changes by imlystyi
latvian: 14 changes by lexuslatvia
portuguese: 14 changes by azulcosta
portuguese (brazilian): 10 changes by pasantoro
polish: 5 changes by pAter-exe
2024-04-08 04:41:24 +00:00
Rubidium
62f5c595f3 Codechange: use range-based for loops and let count be correct count 2024-04-07 23:08:33 +02:00
rubidium42
4718971ccc Codechange: use std::size instead of lengthof for town names 2024-04-07 23:08:07 +02:00
995fca58a2 Codechange: Use begin/end instead of endof for some industry arrays. (#12447) 2024-04-07 22:01:46 +01:00
Rubidium
d7fa614a9d Codechange: use range-based for loop for debug levels and fix global variable naming 2024-04-07 22:17:57 +02:00
Rubidium
1fcf1a136d Codechange: use single function returning std::span over two functions that return size and begin 2024-04-07 22:02:16 +02:00
translators
0f6bf90731 Update: Translations from eints 2024-04-07 04:41:19 +00:00
eb094a953c Codefix: Social Plugins widget parts were not constexpr. (#12443)
Widget lists were made constexpr except these.
2024-04-06 22:32:26 +00:00
34ba969c74 Change: Display more useful information in sprite aligner than sprite ID. (#12439)
Sprite IDs are not useful information given they change don't refer to anything outside the loaded game.

Instead, include the filename and nfo line at minimum, and include action A or action 5 sprite replacement information if applicable.
2024-04-06 21:16:02 +01:00
fbdf26800b Codechange: Use std::initializer_list and range-for for credits window. (#12431)
Replaces C-style array, indexed looping, and char * strings.
2024-04-06 19:30:23 +01:00
a4c2f0778a Codechange: Use range-for to iterate keycode-to-name lookups. (#12429)
Replaces C-style looping.
2024-04-06 19:30:01 +01:00
b905209421 Fix: Viewport signs assume small font is smaller than normal font. (#12422)
If the small font is set to a larger size than the normal font for some reason, viewport signs would be drawn incorrect as the area marked dirty only considered the normal size font.
2024-04-06 19:29:41 +01:00
830c9e2de8 Codechange: Simplify iteration of framerate performance elements. 2024-04-06 19:28:51 +01:00
Rubidium
97bea563d7 Codechange: let lengthof fail when anything that isn't a C-style array is passed 2024-04-06 07:21:31 +02:00
Rubidium
c544a2be0a Fix: do not use lengthof() for non C-style arrays 2024-04-06 07:21:31 +02:00
translators
eaafc57de6 Update: Translations from eints
swedish: 6 changes by joeax910
norwegian (bokmal): 2 changes by eriksorngard
chinese (simplified): 2 changes by WenSimEHRP
dutch: 2 changes by Afoklala
2024-04-06 04:41:24 +00:00
8e881471c1 Codechange: Pass replacement blitter name as string_view instead char *. 2024-04-05 23:23:33 +01:00
6771dbe62b Codechange: Use range-for to find replacement blitter. 2024-04-05 23:23:33 +01:00
a866166673 Codechange: Use initializer_list and range-for for OpenTTD title. (#12430)
Replaces C-style array and looping.
2024-04-05 21:52:50 +01:00
2cc700d606 Codechange: Replace colour_dropdown array with StringID arithmetic. (#12426)
This assumes that the string colours are in order, but that is already assumed elsewhere.

Removes old C-style array access.
2024-04-05 21:51:36 +01:00
83da886093 Fix: Aircraft crash counter was too low to reach ground. (#12425)
Aircraft can float above the ground when crashed as the counter limit to reach the ground is too low.

Instead reset the counter until the aircraft reaches the ground, then continue the timer.
2024-04-05 19:16:22 +01:00
e8c78df39e Fix #12233: Mini order list overlaps vehicle group name. (#12423)
Move mini order list down one line to make room.
2024-04-05 08:18:12 +01:00
d11622b9a0 Fix #12114: Viewport coords of crashed aircraft not updated when falling. (#12424)
This results in the aircraft glitching as the wrong viewport area is drawn.
2024-04-05 08:17:42 +01:00
translators
df3e5ade11 Update: Translations from eints
korean: 2 changes by telk5093
portuguese (brazilian): 1 change by pasantoro
2024-04-05 04:43:25 +00:00
7572cfd103 Codechange: Redefine ZOOM_LVL so that ZOOM_LVL_NORMAL is 1x zoom.
This matches expectations of what normal zoom means.
2024-04-04 22:27:03 +01:00
9854553e10 Codechange: ZOOM_LVL_SHIFT/BASE are not actually ZOOM_LVLs.
Rename to ZOOM_BASE_SHIFT and ZOOM_BASE respectively, and derive from ZOOM_LVL instead of numeric value.
2024-04-04 22:27:03 +01:00
3c94e81665 Codechange: Use ZOOM_LVL_MIN to refer to first zoom level.
Many uses of ZOOM_LVL_NORMAL actually just want the first zoom level slot, so use ZOOM_LVL_MIN to make this clearer.
2024-04-04 22:27:03 +01:00
7c322ebcf1 Codechange: Define a ZOOM_LVL for minimum text effect visibility. 2024-04-04 22:27:03 +01:00
197fb00d31 Fix #12395: Ensure president name widget is tall enough. (#12419) 2024-04-04 17:56:16 +01:00
338def1b06 Fix: Segfault when using -q without providing a . character. (#12418)
Use std::filesystem::path to find extension instead of strrchr.
2024-04-04 14:39:15 +01:00
f6a88e40a4 Codechange: Use std::list for News Items. (#12338) 2024-04-04 07:53:14 +01:00
translators
08cf106fc6 Update: Translations from eints
english (us): 2 changes by 2TallTyler
finnish: 2 changes by hpiirai
ukrainian: 2 changes by Quantom2
danish: 2 changes by beruic
portuguese (brazilian): 22 changes by pasantoro
2024-04-04 04:41:30 +00:00
Loïc Guilloux
243c6bead3 Fix #12415, 9c49a61, df400ef: Aircraft::tile is valid only for front vehicle (#12416) 2024-04-03 23:16:36 +02:00
translators
931aa39018 Update: Translations from eints
english (au): 2 changes by krysclarke
swedish: 2 changes by joeax910
greek: 2 changes by gh658804
russian: 3 changes by its5Q
catalan: 2 changes by J0anJosep
spanish: 2 changes by MontyMontana
portuguese: 2 changes by azulcosta
portuguese (brazilian): 27 changes by pasantoro
polish: 2 changes by pAter-exe
2024-04-03 04:40:31 +00:00
9750826590 Fix a29766d: Wrong scrolling dropdown list position with RTL. (#12412) 2024-04-02 13:29:15 +01:00
translators
72b5c6a591 Update: Translations from eints
vietnamese: 1 change by KhoiCanDev
greek: 83 changes by gh658804
german: 3 changes by Wuzzy2
ukrainian: 54 changes by Quantom2
spanish: 4 changes by MontyMontana
portuguese (brazilian): 2 changes by pasantoro
2024-04-02 04:41:36 +00:00
2047c27445 Codechange: Move drop down list item definitions to separate header.
This reduces the scope of the definitions which are no longer needed to create the common lists.
2024-04-01 22:33:16 +01:00
56cac21086 Codechange: Use functions to create common drop down list items. 2024-04-01 22:33:16 +01:00
Loïc Guilloux
11aa3694fa Fix: [Win32] Force font mapper to only use TrueType fonts (#12406) 2024-04-01 22:59:13 +02:00
3de8853e29 Codechange: Store accepted and produced cargo in vector instead of array.
Most industries do not use the full 16 slots, so this can save a little memory and iteration time.
2024-04-01 21:35:20 +01:00
00e0021e3a Codechange: Don't assume accepted/produced slot exists. 2024-04-01 21:35:20 +01:00
295508fc53 Codechange: Avoid lengthof() on std::array. 2024-04-01 21:35:20 +01:00
f79ec7955a Codechange: Explicitly reset old industry data before loading games. 2024-04-01 21:35:20 +01:00
bd2a92331b Codechange: Use inline and std::array for old industry structures.
This avoids separate declaration/definition, and less C-style arrays.
2024-04-01 21:35:20 +01:00
f6b38e8e06 Codechange: Remove optional MakeCargo() parameters that are never changed.
Default values are always used, so don't need to be parameters.
2024-04-01 18:46:29 +01:00
e4fc8ef595 Codechange: Use std::span for industry cargo window instead of pointer + length. 2024-04-01 18:46:29 +01:00
merni-ns
6f36f3d714 Fix #11055: Make saveload failure error messages consistent with others (#12247)
The save/load error messages were combined using string parameters, rather than using the built-in functionality of error dialogs.
2024-04-01 17:57:03 +01:00
merni-ns
92a171c3e0 Doc: Improve the output and documentation of the font command. (#12392)
Now that the default font =/= sprite font, there is a different way to invoke the sprite font, and default size applies to default (not sprite).
Also, interface scaling now affects the font size.
2024-04-01 17:55:44 +01:00
d68e5159e1 Feature: Allow base sounds set to be changed mid-game. (#12399) 2024-04-01 17:54:42 +01:00
translators
3d2a8fb60c Update: Translations from eints
welsh: 5 changes by Ansbaradigeidfran
ukrainian: 11 changes by StepanIvasyn
catalan: 1 change by J0anJosep
portuguese (brazilian): 69 changes by pasantoro
2024-04-01 04:40:15 +00:00
d683ec0183 Codechange: Move dropdown and slider out of widgets directory. (#12403)
Also shuffle headers to place widget includes near end.

This leaves the widgets directory solely for defining Widget IDs.
2024-03-31 19:37:16 +01:00
Rubidium
d5e28a904d Fix fb9d4af: use different nonces for key exchange and stream encryption 2024-03-31 15:14:16 +02:00
translators
9954187680 Update: Translations from eints
greek: 172 changes by gh658804
ukrainian: 18 changes by StepanIvasyn
portuguese (brazilian): 9 changes by pasantoro
2024-03-31 04:41:01 +00:00
Patric Stout
77f02faf15 Codefix 977aba73be: also update comment about removal of is_random (#12400) 2024-03-30 13:29:51 +01:00
translators
340c2802da Update: Translations from eints
ukrainian: 14 changes by StepanIvasyn
dutch: 3 changes by Afoklala
portuguese (brazilian): 34 changes by pasantoro
2024-03-30 04:40:28 +00:00
Patric Stout
e866ca8adc Cleanup 69d5b9d3: actually clean up all remnants of "no-thread" builds (#12398) 2024-03-29 23:26:32 +01:00
Patric Stout
c0308acb03 Fix: "-q" displays NewGRF IDs in the wrong byte-order (#12397) 2024-03-29 23:26:24 +01:00
8d312b305b Codechange: Replace currency macros with functions. (#12396) 2024-03-29 14:49:48 +00:00
translators
e21c12afeb Update: Translations from eints
finnish: 39 changes by hpiirai
ukrainian: 23 changes by StepanIvasyn
danish: 1 change by bscargo
french: 1 change by Lishouuu
portuguese: 1 change by azulcosta
portuguese (brazilian): 100 changes by pasantoro
2024-03-29 04:41:18 +00:00
e16b982b6a Codechange: Use iteration when dealing with all HouseSpecs. 2024-03-28 23:23:00 +01:00
3e83dcedfd Codechange: Allocate houses dynamically instead of from a fixed array.
This uses vectors for HouseSpecs and global/town building counts.
2024-03-28 23:23:00 +01:00
8746be8bf2 Codechange: Use FindVehiclesWithOrder when removing a road stop. (#12144) 2024-03-28 23:22:37 +01:00
frosch
907cb4fc53 Fix: [Script] ScriptSubsidy::GetExpireDate should return an economy-date (#12372) 2024-03-28 23:21:20 +01:00
Michael Lutz
8fb7d74dfe Fix eabb9db: Drag building of road stops should not allow mixing z levels. 2024-03-28 22:28:48 +01:00
Michael Lutz
69acc132ca Fix #12387, eabb9db: [NewGRF] Wrong tile offset passed to rail station CB 149 (slope check) 2024-03-28 22:28:48 +01:00
Loïc Guilloux
71087bb6d3 Change: [CI] Always use latest stable Xcode (#12390) 2024-03-28 21:22:20 +01:00
translators
ca53e134be Update: Translations from eints
swedish: 14 changes by sereneavatar
finnish: 2 changes by hpiirai
ukrainian: 18 changes by StepanIvasyn
latvian: 4 changes by lexuslatvia
portuguese (brazilian): 13 changes by pasantoro
2024-03-28 04:40:56 +00:00
Jonathan G Rennison
433484cda3 Fix #12388: Vehicle::CopyVehicleConfigAndStatistics not releasing unit number (#12389) 2024-03-27 21:20:27 +01:00
translators
b8b01818ca Update: Translations from eints
english (au): 1 change by krysclarke
norwegian (bokmal): 1 change by eriksorngard
spanish (mexican): 32 changes by rgonzalez-py
english (us): 3 changes by 2TallTyler
russian: 3 changes by Ln-Wolf
ukrainian: 18 changes by StepanIvasyn
lithuanian: 6 changes by dziugas1959
portuguese (brazilian): 11 changes by pasantoro
2024-03-27 04:43:49 +00:00
translators
575336ef43 Update: Translations from eints
swedish: 20 changes by joeax910
greek: 182 changes by gh658804
ukrainian: 11 changes by StepanIvasyn
slovak: 45 changes by puco
lithuanian: 14 changes by dziugas1959
portuguese (brazilian): 11 changes by pasantoro
2024-03-26 04:40:35 +00:00
Rubidium
8e12bd35ae Fix: server shutdown and newgame packets should be stable
The server sends shutdown and newgame (reboot) packets to any connected client.
This can be useful, so you can tell clients that are trying to join that the
server is restarting. However, that means that packets can be sent before a
version check has been done.
So, these packets should be in the stable packet range instead of the one that
is unstable and guarded by a version check.
2024-03-25 22:50:05 +01:00
4751179dc5 Codefix: Remove unused class member and extraneous spaces. (#12378) 2024-03-25 21:35:31 +00:00
Rubidium
9aa6669266 Fix: inconsistent check for client authorized status 2024-03-25 22:32:23 +01:00
Rubidium
84bbe235e4 Fix: do not send chat to clients that have not authorized yet 2024-03-25 22:32:23 +01:00
Tyler Trahan
f71ada4f30 Fix #12268: Capitalize "Wait to unbunch" order string (#12375) 2024-03-25 13:46:03 -04:00
SamuXarick
f845b4bbc3 Fix: Changing NPF max search nodes while in-game had no effect (#12194) 2024-03-25 17:28:16 +01:00
translators
40a75e0b8d Update: Translations from eints
swedish: 19 changes by joeax910
norwegian (bokmal): 2 changes by eriksorngard
ukrainian: 6 changes by StepanIvasyn
french: 3 changes by ottdfevr
portuguese (brazilian): 23 changes by pasantoro
polish: 1 change by pAter-exe
2024-03-25 04:40:35 +00:00
97c1738541 Fix #12368: Incorrect offset for click position within industry chain window. (#12370) 2024-03-24 18:35:33 +00:00
eebfb83aa2 Fix 2fd9096: Label for fruit incorrectly changed to FRUI from FRUT. (#12367) 2024-03-24 15:53:26 +00:00
Tyler Trahan
8928f4979a Change: Add dividers in vehicle group action dropdown (#12284) 2024-03-24 07:44:25 -04:00
Rubidium
caa7c44052 Cleanup: remove checks for old MSVC versions 2024-03-24 10:09:15 +01:00
Rubidium
d09b5aaeba Codechange: use int32_t instead of uint16_t for scroll bar position/size/capacity 2024-03-24 08:30:38 +01:00
Rubidium
c01bf06ee1 Codefix: some minor errors in tcp-game protocol documentation 2024-03-24 06:40:38 +01:00
translators
018944dc20 Update: Translations from eints
english (au): 2 changes by krysclarke
vietnamese: 1 change by KhoiCanDev
chinese (simplified): 9 changes by WenSimEHRP
greek: 152 changes by gh658804
russian: 3 changes by Ln-Wolf
finnish: 2 changes by hpiirai
ukrainian: 9 changes by StepanIvasyn
danish: 2 changes by bscargo
portuguese: 5 changes by azulcosta
portuguese (brazilian): 35 changes by pasantoro
2024-03-24 04:41:07 +00:00
668186ca5b Codechange: Remove macros involved with NewGRFClass. (#12363)
Use direct class instantiation instead.
2024-03-23 21:55:50 +00:00
ff35288ddf Fix: Don't let CT_INVALID map to valid cargo type. (#12364) 2024-03-23 20:18:31 +00:00
glx22
02c00f3e3e Change: [Script] Use economy time for ScriptDate 2024-03-23 21:17:40 +01:00
glx22
704e871a0e Revert bbdbf9a: ScriptTimeMode was not the best solution for economy/calendar support 2024-03-23 21:17:40 +01:00
frosch
603154899a Add: [SDL2] Driver parameter 'no_mouse_capture' to ease interactive debugging (#12336) 2024-03-23 20:48:26 +01:00
Rubidium
0f25eaa271 Fix: crash to desktop when attempting to join a company while not joined (yet) 2024-03-23 13:33:41 +01:00
Jonathan G Rennison
515303b8be Fix #12092: Incorrect x-axis in cargo payment graph window 2024-03-23 13:33:29 +01:00
Tyler Trahan
2732b3d6c6 Change: Show unbunching action in timetable window (#12351) 2024-03-23 08:23:13 -04:00
ea74ca0a76 Fix #12347: Crash attempting to find catchment tiles of a station with no catchment area. (#12348) 2024-03-23 13:03:59 +01:00
Rubidium
f599108c16 Codechange: move 'months_empty' to CompanyProperties 2024-03-23 11:59:34 +01:00
translators
4321cca5fb Update: Translations from eints
vietnamese: 1 change by KhoiCanDev
chinese (simplified): 1 change by WenSimEHRP
ukrainian: 11 changes by StepanIvasyn
catalan: 1 change by J0anJosep
danish: 1 change by bscargo
dutch: 3 changes by Afoklala
portuguese (brazilian): 58 changes by pasantoro
2024-03-23 04:41:01 +00:00
df2ee7b06c Cleanup: Remove old SaveLoad workarounds for MS VS 2017. (#12355) 2024-03-23 00:12:35 +00:00
Rubidium
e904122441 Codefix: follow coding style 2024-03-22 22:24:17 +01:00
merni-ns
7457f8d0ff Codefix: Incorrect pluralisation in last service/service interval texts (#12352) 2024-03-22 19:19:29 +00:00
raddari
5751da7809 Fix #7982: Show existing coverage with unambiguous adjacent station (#12346)
When hovering a tile containing a station, show existing coverage for
that station even when adjacent to a different station.

Co-authored-by: Peter Nelson <peter@fuzzle.org>
2024-03-22 09:33:16 -04:00
translators
e141734e54 Update: Translations from eints
english (au): 1 change by krysclarke
norwegian (bokmal): 1 change by eriksorngard
english (us): 1 change by 2TallTyler
korean: 3 changes by telk5093
german: 1 change by Wuzzy2
finnish: 3 changes by hpiirai
ukrainian: 12 changes by StepanIvasyn
portuguese (brazilian): 81 changes by pasantoro
polish: 1 change by pAter-exe
2024-03-22 04:41:18 +00:00
Jonathan G Rennison
2189607c34 Codechange: Reduce size of class WaterRegion
The tile patch array is 256 bytes and is not needed for the majority
of water regions, change it to be optional via std::unique_ptr
2024-03-21 21:14:30 +01:00
Jonathan G Rennison
e42aec5a89 Fix #12305: Crash with large positive sprite x offset in engine preview window 2024-03-21 21:05:27 +01:00
translators
0eaeeaabb6 Update: Translations from eints
russian: 2 changes by Ln-Wolf
catalan: 2 changes by J0anJosep
portuguese (brazilian): 23 changes by pasantoro
2024-03-21 04:40:53 +00:00
Tyler Trahan
704d3b8a9b Fix #12342: Add missing ellipsis to town generation error string (#12343) 2024-03-20 20:32:38 +00:00
translators
00a09af1fd Update: Translations from eints
english (us): 2 changes by 2TallTyler
vietnamese: 2 changes by KhoiCanDev
german: 2 changes by Wuzzy2
ukrainian: 2 changes by StepanIvasyn
portuguese (brazilian): 9 changes by pasantoro
2024-03-20 04:40:30 +00:00
Owen Rudge
d4a6ee9554 Change: [CI] Use Azure Code Signing for Windows build 2024-03-19 23:12:36 +00:00
translators
3a3d8f3b53 Update: Translations from eints
english (au): 2 changes by krysclarke
norwegian (bokmal): 2 changes by eriksorngard
chinese (simplified): 31 changes by lysinelai
greek: 7 changes by Xertoveizer
ukrainian: 14 changes by StepanIvasyn
danish: 2 changes by bscargo
lithuanian: 15 changes by dziugas1959
spanish: 2 changes by MontyMontana
french: 2 changes by glx22
portuguese (brazilian): 52 changes by pasantoro
polish: 2 changes by pAter-exe
2024-03-19 04:41:12 +00:00
737e3feaf0 Codechange: Don't delete news items or NewGRF window when EffectVehicle is deleted. (#12334)
EffectVehicles never create news and can't be debugged, so searching for news items and windows to delete just wastes time.
2024-03-18 23:39:42 +00:00
Rubidium
7580eac2d5 Codechange: create helper class for useful NetworkAuthorizedKeys functions 2024-03-18 22:56:58 +01:00
2485de9462 Codefix: Widget should be passed as WidgetID type. (#12332) 2024-03-18 20:32:38 +00:00
107c208d87 Codechange: Use single list for hierarchical group lists. (#12330)
Replace both group list implementations (vehicle group list and company colour group list) with a single implementation, using a struct to hold the group and indentation level instead of two separate lists. Parts that were previously duplicated are now shared.
2024-03-18 17:49:51 +00:00
translators
ec3c8d3462 Update: Translations from eints
ukrainian: 12 changes by StepanIvasyn
portuguese (brazilian): 21 changes by pasantoro
polish: 52 changes by pAter-exe
2024-03-18 04:40:36 +00:00
Rubidium
4af089b9be Feature: console command to change authorized keys 2024-03-17 21:21:33 +01:00
Rubidium
b7dfa3eb90 Feature: authorized key authentication for rcon 2024-03-17 20:36:25 +01:00
Rubidium
1cf8799810 Feature: encrypt the connection between game server and client 2024-03-17 19:48:34 +01:00
Rubidium
d26629c15b Codechange: make encoded length of packet size and type more explicit 2024-03-17 19:48:34 +01:00
Rubidium
5706801ea7 Feature: authenticate to the server without sending the password
Either using password-authentication key exchange or via authorized keys
2024-03-17 19:09:22 +01:00
Rubidium
dd532cbc77 Codechange: add setting for authorized/secret/public keys 2024-03-17 19:09:22 +01:00
Rubidium
fb9d4afa5c Codechange: add set of classes providing authentication and encryption 2024-03-17 18:33:53 +01:00
88cf99017a Fix #12302: Allow empty train engines to use an invalid cargo type. (#12325)
The cargo type will be forced to the first available type (usually passengers) instead of the engine being disabled.
2024-03-17 16:23:14 +00:00
322ca6ef54 Codechange: Shuffle members of Vehicle to reduce size.
This reduces space wasted due to member alignment.
2024-03-17 16:22:38 +00:00
3fc7b3b9a0 Codechange: Cache train curve speed limit can be stored in 16 bits.
Cache curve speed modifier and max curve speed are both 16 bit values so can be stored in 16 bit types instead of 32 bit types.
2024-03-17 16:22:38 +00:00
Patric Stout
f08da1d373 Codechange: the "no revision detected" string is with four zeros (norev0000) (#12328) 2024-03-17 13:17:35 +00:00
ab94c8b511 Codechange: Iterate order lists instead of vehicles to find if any vehicle visits a station. (#12315)
This reduces the search time as shared orders are only searched once and non-front vehicles are skipped.
2024-03-17 09:34:28 +00:00
translators
6c5a8f55df Update: Translations from eints
norwegian (bokmal): 58 changes by eriksorngard
vietnamese: 45 changes by KhoiCanDev
greek: 21 changes by Xertoveizer
ukrainian: 5 changes by StepanIvasyn
tamil: 24 changes by merni-ns
lithuanian: 7 changes by dziugas1959
portuguese (brazilian): 61 changes by pasantoro
polish: 21 changes by aefoes
2024-03-17 04:40:30 +00:00
frosch
a886bd9666 Fix #12319, 3a676a5: Some SSE blitters were broken due to ODR violations (#12322) 2024-03-16 23:42:38 +00:00
Patric Stout
a3cfd23cf9 Codechange: rename byte to uint8_t (#12308) 2024-03-16 23:59:32 +01:00
Loïc Guilloux
bd7120bae4 Fix #12316, 268e512: Support for enum storage type in GenerateWidget.cmake (#12321) 2024-03-16 23:43:20 +01:00
merni-ns
af1bd43b30 Codefix 4c0dca1: [CI] Fix typo in workflow file (#12318) 2024-03-16 19:48:12 +00:00
0058ebe472 Codechange: Check cheap station-facility-filter before expensive in-use-filter. (#12317) 2024-03-16 19:37:32 +00:00
Loïc Guilloux
818a57c9af Codechange: Actually use LIT_NONE (#12314) 2024-03-16 16:41:58 +00:00
SamuXarick
d7c5e9e8ab Codechange: Where the ship comes from is already known
This simplifies the handling of variables.

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

`CreateRandomPath` and `GetRandomFollowUpTrackdir` is being fed `src_tile` as it's 2nd parameter. This could be eliminated, as `v` is also being passed to it. Just use `v->tile` in those functions.
2024-03-16 17:02:19 +01:00
Patric Stout
7f49b6f25a Codefix: allow preview label on PRs against release branches too (#12310) 2024-03-16 16:49:03 +01:00
Patric Stout
5f4f9334ce Codefix f1e999ec: use RandomRange(l) instead of _random.Next(l) (#12274) 2024-03-16 14:39:57 +00:00
merni-ns
4c0dca1411 Codechange: [CI] Move Release CI build to MacOS runner (#12309) 2024-03-16 15:11:23 +01:00
Rubidium
fe12d38024 Codechange: split initiating of joining and identification of the client 2024-03-16 13:35:41 +01:00
Rubidium
15d02f51ed Codechange: use span to send bytes to Packet and add span recv function 2024-03-16 12:27:06 +01:00
Rubidium
b6c75dec3a Codechange: explicitly allow only one state in initial handshake/authorization 2024-03-16 11:35:44 +01:00
Rubidium
26d1d5d6e7 Codechange: move decision whether to check NewGRFs to SendNewGRFCheck, just like for sending game/company passwords 2024-03-16 11:35:44 +01:00
Rubidium
6eff879e49 Codechange: pass the socket handler that is going to send the packet into the packet 2024-03-16 10:39:22 +01:00
Rubidium
3c488e1eb8 Codechange: don't check things outside the lock, that could change while waiting on the lock 2024-03-16 10:39:22 +01:00
Rubidium
ec4104ec6c Codechange: do not pass the socket when the receiver already knows it 2024-03-16 10:39:22 +01:00
Patric Stout
3e625b5b1a Add: track savegame size to report with survey (#12304) 2024-03-16 08:58:56 +01:00
translators
b394c20519 Update: Translations from eints
korean: 43 changes by telk5093
persian: 33 changes by CptMcWill
ukrainian: 4 changes by StepanIvasyn
dutch: 26 changes by Afoklala
portuguese (brazilian): 70 changes by pasantoro
2024-03-16 04:41:24 +00:00
SamuXarick
a7625b8ae0 Fix #12280: Allow ships 90 degree turns if only choice
If there is no path found, a random path is created which forbids 90 degrees.
Allow 90 degrees if they're the only choice.
2024-03-15 08:04:08 +01:00
translators
9db285a32b Update: Translations from eints
norwegian (bokmal): 6 changes by eriksorngard
ukrainian: 3 changes by StepanIvasyn
dutch: 5 changes by RogierVC
portuguese (brazilian): 76 changes by pasantoro
2024-03-15 04:41:43 +00:00
translators
2d2191fbb3 Update: Translations from eints
norwegian (bokmal): 11 changes by eriksorngard
chinese (simplified): 1 change by WenSimEHRP
finnish: 23 changes by hpiirai
ukrainian: 21 changes by StepanIvasyn
danish: 32 changes by bscargo
spanish: 6 changes by MontyMontana
portuguese (brazilian): 50 changes by pasantoro
2024-03-14 04:41:11 +00:00
Ivan Fefer
23d733be95 Add: Basic autocompletion on tab for console commands (#12163) 2024-03-13 21:43:08 +01:00
Rubidium
24efdf6ac5 Codefix 363e251: incorrect trace debug message 2024-03-13 20:42:27 +01:00
SamuXarick
14d95ef1c9 Fix #12279: Update random path each step (#12286) 2024-03-13 11:22:52 -04:00
Loïc Guilloux
100c043599 Codechange: [Win32] Disable assert message box when no GUI (#12291) 2024-03-13 15:49:24 +01:00
translators
0cff40dd19 Update: Translations from eints
norwegian (bokmal): 203 changes by eriksorngard
italian: 45 changes by Rivarossi
german: 42 changes by Wuzzy2
ukrainian: 13 changes by StepanIvasyn
turkish: 25 changes by jnmbk
portuguese (brazilian): 25 changes by pasantoro
2024-03-13 04:41:24 +00:00
translators
1addeddc07 Update: Translations from eints
english (au): 45 changes by krysclarke
norwegian (bokmal): 256 changes by eriksorngard
welsh: 41 changes by Ansbaradigeidfran
english (us): 45 changes by 2TallTyler
russian: 11 changes by Ln-Wolf
finnish: 18 changes by hpiirai
ukrainian: 20 changes by StepanIvasyn
catalan: 167 changes by J0anJosep
danish: 11 changes by bscargo
spanish: 35 changes by lrlopez
french: 41 changes by ottdfevr
portuguese: 44 changes by jcteotonio
portuguese (brazilian): 168 changes by pasantoro
2024-03-12 04:41:20 +00:00
Richard Wheeler
8a37f6479a Change: Update OpenTTD TTF fonts to v0.6
Adds missing characters for Chuvash and Serbian translations. Adds support for combining diacritics (needed for for Cyrillic es with accent) and corrects miscoded Cyrillic es with descender.
2024-03-11 22:36:37 +01:00
Rubidium
a06814c173 Codechange: use std::source_location over __FILE__ and __LINE__ for Random 2024-03-11 20:30:33 +01:00
Koen Bussemaker
984202b101 Codechange: Remove outdated YAPF example code 2024-03-11 20:25:48 +01:00
Patric Stout
d7b99cbe26 Codefix: [CI] Store vcpkg outside the repository folder (#12271)
Otherwise tools like CodeQL can pick up on vcpkg files.
2024-03-11 18:53:09 +00:00
Patric Stout
c768f4fc7a Codechange: [CI] build some targets every night, instead of every PR
This mainly as they are not expected to fail, or give more information
than the other targets already would. And this is just hogging up
the CI pipeline. On average, these targets take ~80 CPU-minutes to
finish.
2024-03-11 15:44:30 +01:00
Patric Stout
ee22fa34d7 Codechange: [CI] Split the ci-build into smaller components 2024-03-11 15:44:30 +01:00
Patric Stout
eaf62f3969 Codechange: [CI] manual build CodeQL to improve speed (#12251)
Autobuild also fetches dependencies and other things, while those
are already ready on the system. This seems to cost ~1 minutes,
for no actual good reason.
2024-03-11 15:42:44 +01:00
b9ca3ead8b Change: Use (at least) standard toolbar button size for signal selection buttons. (#12265)
Signal selection buttons could be very narrow, with a very wide spacer, depending on loaded signal types and fonts.
2024-03-11 14:19:01 +00:00
dc6305e8c1 Codechange: Use std::make_unique instead of passing new into a unique_ptr. (#12263)
std::make_unique will also initialise the data so MemSetT is not needed.
2024-03-11 08:09:44 +00:00
translators
95a8fab339 Update: Translations from eints
swedish: 7 changes by joeax910
norwegian (bokmal): 242 changes by eriksorngard
welsh: 609 changes by Ansbaradigeidfran
english (us): 3 changes by 2TallTyler
chinese (simplified): 1 change by WenSimEHRP
ukrainian: 21 changes by StepanIvasyn
latvian: 1 change by lexuslatvia
dutch: 1 change by Jaws3rd
esperanto: 53 changes by legoscia
portuguese (brazilian): 19 changes by pasantoro
2024-03-11 04:42:14 +00:00
8b60fc3d35 Codechange: Use vector for waypoint layout. (#12264)
This replaces manual new/delete of byte array, and matches how it is used for station layouts.
2024-03-10 17:15:34 +00:00
Rubidium
2f0fe22d63 Fix #12255: inconsistent punctuation in English 2024-03-10 16:51:21 +01:00
649c1cf14c Fix: Off-by-one in EnsureVisibleCaption. (#12261)
An off-by-one in EnsureVisibleCaption causes the minimum visible caption height to be 13 scaled pixels and 1 unscaled pixel. At 1x interface scale, this 'happens' to be the complete height of a caption, but at other interface scales it is not.

Instead of using a scaled fixed value, correct the off-by-one and just use the window's actual caption height instead.
2024-03-10 14:53:41 +00:00
Rubidium
ecf534522c Codechange: replace macro with function for TileAdd(XY) 2024-03-10 15:50:24 +01:00
Rubidium
27eadc13ec Codechange: rename TILE_ADD(XY) to TileAdd(XY) 2024-03-10 15:50:24 +01:00
Rubidium
df461b0329 Codechange: simplify TileAdd by using simple asserts 2024-03-10 15:50:24 +01:00
Kuhnovic
005892bfdb Fix #12250: YAPF Trivial rail pathfinding crashes due to #12217 (#12258) 2024-03-10 14:37:56 +00:00
Patric Stout
cca9dcdd57 Codechange: [DorpsGek] announce failures in nightlies to IRC / Discord (#12256) 2024-03-10 13:22:15 +00:00
Patric Stout
9c95fbdb07 Remove: official support for MSVC 2019 (#12254) 2024-03-10 13:26:07 +01:00
Rubidium
86cb184eb4 Codechange: use std::source_location over __FILE__ and __LINE__ for WindowDesc 2024-03-10 10:14:20 +01:00
Rubidium
e4b3f3f495 Codechange: use std::source_location over __FILE__ and __LINE__ for NOT_REACHED 2024-03-10 10:14:20 +01:00
Rubidium
bab5a8a787 Codechange: use std::source_location over __FILE__ and __LINE__ for Backup 2024-03-10 10:14:20 +01:00
Patric Stout
381dee2e01 Codechange: [CI] switch to arm64 for MacOS builds (#12242)
This creates more variety in our CI builds, increasing the odds
of us finding issues.
2024-03-10 09:33:47 +01:00
translators
738624ded4 Update: Translations from eints
english (au): 1 change by krysclarke
norwegian (bokmal): 545 changes by eriksorngard
chinese (traditional): 75 changes by wpi3
galician: 24 changes by pvillaverde
chinese (simplified): 1 change by WenSimEHRP
russian: 1 change by Ln-Wolf
finnish: 4 changes by hpiirai
ukrainian: 16 changes by StepanIvasyn
catalan: 1 change by J0anJosep
danish: 1 change by bscargo
french: 3 changes by ottdfevr
portuguese: 1 change by azulcosta
esperanto: 203 changes by legoscia
portuguese (brazilian): 21 changes by pasantoro
polish: 1 change by pAter-exe
2024-03-10 04:40:37 +00:00
55a328c586 Codechange: Replace type-punning with std::bit_cast in squirrel. (#12224) 2024-03-09 17:13:17 +00:00
de8a840db5 Codefix: Fully initialise MidiFile::DataBlock to avoid gcc warning. (#12240) 2024-03-09 17:01:39 +00:00
Loïc Guilloux
82430a1086 Fix ab315d0: Don't show "insert order" errors in the console (#12245) 2024-03-09 16:33:44 +00:00
rubidium42
e0e0d5f8fb Revert #11606: Don't auto-build past tunnelbridge ends
This reverts commit 59f6c199bf.
2024-03-09 15:54:50 +01:00
Patric Stout
ebd258b404 Change: [CI] switch MacOS to the macos-14 runner (#12237)
This runner contains a newer XCode, with better C++20 support.
2024-03-09 14:41:34 +00:00
Tyler Trahan
32b0fb9f6e Fix #12010: Use economy timer for vehicle stats minimum age, not calendar (#12142) 2024-03-09 09:38:52 -05:00
Patric Stout
04ce1c08ae Codechange: [CI] manually install vcpkg for all targets (#12241)
From macos-14, vcpkg is no longer installed on the runner-image.
It stands to reason that this will also roll out to new images
for other OSes. To be pre-emptive about it, start using our own
cloned vcpkg for all targets.
2024-03-09 14:01:18 +00:00
Tyler Trahan
ab315d0dc9 Fix #12118: When adding an unbunching order, properly check for unsafe conditions (#12136) 2024-03-09 08:28:05 -05:00
Patric Stout
6e0f58f700 Codechange: [CI] use "cargo install --locked" to use pinned dependency versions (#12243)
Normally "cargo install" will use the latest dependencies, but
this causes an issue with "dump_syms". Use "--locked" makes sure
we use the dependency versions as indicated by "dump_syms", instead
of the latest version.
2024-03-09 11:42:09 +00:00
glx22
3a71f36393 Change: [Script] Match FormatString behaviour more closely 2024-03-09 12:15:03 +01:00
glx22
ae27ce12a7 Fix 0858377: [Script] Don't output parameters more than once 2024-03-09 12:15:03 +01:00
translators
ce3d0097f6 Update: Translations from eints
chinese (simplified): 27 changes by WenSimEHRP
korean: 2 changes by telk5093
greek: 42 changes by Xertoveizer
indonesian: 32 changes by tsaqibfs
slovak: 184 changes by ApplePie420
danish: 2 changes by bscargo
latvian: 2 changes by lexuslatvia
dutch: 2 changes by Afoklala
portuguese: 16 changes by jcteotonio
portuguese (brazilian): 77 changes by pasantoro
2024-03-09 04:41:18 +00:00
Kuhnovic
08ff1ab93e Fix #12236: Ship pathfinder causes crash when ship is already at destination (#12238) 2024-03-08 23:46:13 +01:00
Kuhnovic
ab353f8ad5 Update: Developer credits (#12235) (#12235) 2024-03-08 18:31:58 +01:00
Michael Lutz
8b9f59d320 Codechange: Use references for non-optional in/out values of slope functions 2024-03-08 18:08:55 +01:00
Michael Lutz
8dda387f82 Codechange: Use std::tuple for slope functions with two return values 2024-03-08 18:08:55 +01:00
Tyler Trahan
5806c2aba4 Fix #12203: When unbunching at a depot, don't overlook implicit orders (#12220) 2024-03-08 10:19:50 -05:00
SamuXarick
0c432bdc4d Fix 3947453: GetNextDecisionNode ignored go to nearest depot when combined with stop at depot 2024-03-08 14:31:35 +01:00
SamuXarick
ab52f7eecf Fix ccb4c37: Aircraft could route to hangars outside their range when stopping at them 2024-03-08 14:31:35 +01:00
merni-ns
b8b80cb42e Fix #12134: Use correct error messages if clearing drive-through road stops fails (#12139) 2024-03-08 14:29:04 +01:00
rubidium42
aef8a345b2 Codefix #12162, 3105d0b: Textbuf::Assign read beyond std::string_view (#12177) 2024-03-08 14:26:14 +01:00
jcteotonio
63b9284a7e Add: Portuguese Escudo currency (#12108) 2024-03-08 14:25:01 +01:00
a9de766fa6 Fix: Train running sounds should only be produced for engine parts. (#12229) 2024-03-08 14:23:48 +01:00
Kuhnovic
30e1a61c04 Fix: YAPF doesn't check destination for start nodes (#12217) 2024-03-08 14:23:33 +01:00
translators
216905ce1f Update: Translations from eints
chinese (simplified): 2 changes by WenSimEHRP
luxembourgish: 2 changes by phreeze83
hungarian: 2 changes by PstasDev
german: 2 changes by Wuzzy2
ukrainian: 10 changes by StepanIvasyn
slovak: 197 changes by ApplePie420
catalan: 2 changes by J0anJosep
portuguese (brazilian): 35 changes by pasantoro
2024-03-08 04:40:35 +00:00
25aeb1c5a5 Change: Use same audio buffer size (and config parameter) for all sound drivers. (#12227)
Windows drivers used a default buffer size of 8192 instead of 1024, which results in a considerable 186ms latency.
2024-03-07 23:19:59 +00:00
translators
8fb26612c0 Update: Translations from eints
english (au): 2 changes by krysclarke
vietnamese: 1 change by KhoiCanDev
estonian: 4 changes by RM87
russian: 8 changes by Ln-Wolf
ukrainian: 27 changes by StepanIvasyn
slovak: 34 changes by palsoft333
tamil: 41 changes by Aswn
spanish: 4 changes by MontyMontana
portuguese (brazilian): 72 changes by pasantoro
polish: 3 changes by pAter-exe
2024-03-07 04:40:51 +00:00
Loïc Guilloux
ef40c5e240 Fix #12225, 977aba7: [Script] Missing AI:ResetConfig support for running AI config (#12226) 2024-03-06 21:16:07 +01:00
translators
634b67bf13 Update: Translations from eints
estonian: 66 changes by siimsoni
greek: 41 changes by gh658804
ukrainian: 6 changes by StepanIvasyn
slovak: 30 changes by palsoft333
portuguese (brazilian): 41 changes by pasantoro
2024-03-06 04:40:32 +00:00
Kuhnovic
1a2b54498b Change: Show tile index as decimal number in land info window (#12104) 2024-03-05 21:32:29 +01:00
2d48829999 Codechange: Scan station catchment tiles when removing station from nearby towns/industries. (#12129)
Avoid iterating all towns and industries when updating station catchment, and scan a limited portion of the map instead.

This provides a modest performance benefit when many towns/industries exist.
2024-03-05 18:33:58 +00:00
00b442d6f9 Fix: Maximum permitted sound volume from NewGRF is 128. (#12222) 2024-03-05 18:31:04 +00:00
bc3bd642b9 Fix: Relocate main toolbar and statusbar before other windows. (#12218)
When repositioning all windows, the main toolbar and statusbar need to already be in position to ensure that window captions are visible.
2024-03-05 18:30:25 +00:00
Loïc Guilloux
845b894fd8 Remove: [Script] random_deviation from setting description table (#12221) 2024-03-05 12:41:04 +01:00
translators
0fd576bfbc Update: Translations from eints
chinese (simplified): 2 changes by WenSimEHRP
russian: 1 change by Ln-Wolf
ukrainian: 9 changes by StepanIvasyn
portuguese (brazilian): 66 changes by pasantoro
2024-03-04 18:35:39 +00:00
translators
626ee4ab41 Update: Translations from eints
chinese (simplified): 6 changes by WenSimEHRP
serbian: 16 changes by nkrs
ukrainian: 1 change by StepanIvasyn
portuguese (brazilian): 234 changes by pasantoro
2024-03-03 18:34:58 +00:00
8172e25273 Codechange: Use range-for when iterating station speclists. (#12212)
This replaces indexed access.
2024-03-03 16:41:02 +00:00
b2ca6e1ac8 Codefix: Remove no-longer used ship special-case. (#12192)
This special-case has not been triggered since multi-tile docks were introduced.
2024-03-03 09:31:04 +00:00
cff48c0f63 Codechange: Templatise SlStationSpecList to reduce duplication.
SlStationSpecList now handles both StationSpec and RoadStopSpec, and replaces indexed array access with range-for and reserve/emplace_back pattern.
2024-03-02 21:16:15 +00:00
41b3314d76 Codechange: Replace separate Station/RoadStopSpecList with template struct.
Reduces duplication and simplifies reuse.

Additionally naming an item that is used in a list as a ...List was
pretty weird.
2024-03-02 21:16:15 +00:00
278c3a7db1 Codechange: Use reference instead of copy of NewGRF speclist item. 2024-03-02 21:16:15 +00:00
Kuhnovic
c5afc9173c Fix #12176: Ships are circling in one place (#12181) 2024-03-02 21:45:54 +01:00
Jonathan G Rennison
f180262aee Fix #12154: Incorrect calendar day lengths with minutes per year setting (#12158) 2024-03-02 21:45:30 +01:00
translators
d7c485d4b9 Update: Translations from eints
estonian: 166 changes by siimsoni, 22 changes by RM87
chinese (simplified): 6 changes by WenSimEHRP
serbian: 172 changes by nkrs
ukrainian: 11 changes by StepanIvasyn
spanish: 1 change by MontyMontana
portuguese (brazilian): 149 changes by pasantoro
2024-03-02 18:34:44 +00:00
Patric Stout
8f22066b9a Fix #12147: reset all saved settings to their default before loading a game (#12210) 2024-03-02 16:05:43 +01:00
Rubidium
aff09306de Fix #12076: Do not allow 'join' command on dedicated servers 2024-03-02 14:35:26 +01:00
Loïc Guilloux
253ba0d354 Fix #12195: Reset cursor when no Object is selected (#12207) 2024-03-02 13:02:56 +01:00
Loïc Guilloux
b53d79b1d2 Codechange: Don't use NOT_REACHED() when catching unhandled thread exceptions (#12199) 2024-03-02 00:07:43 +01:00
a602845d0a Fix #12202: Race condition when using sprite picker. (#12204)
When using the sprite picker the screen is redrawn so that the sprites under the mouse cursor can be captured. This redraw also caused the sprite aligner window to be redrawn before the OnInvalidateData event that updates its scrollbars with the list count.
2024-03-01 22:08:18 +00:00
Tyler Trahan
3fd5c33ae6 Fix f6dd505: Only reset unbunching departure data in the correct depot (#12155) 2024-03-01 21:29:55 +00:00
Patric Stout
7824ae5b59 Fix #12196: disable "select upgrade" button when filtering 2024-03-01 22:17:33 +01:00
Patric Stout
b307541099 Fix #12196: always show selected content, even when filtering 2024-03-01 22:17:33 +01:00
Tyler Trahan
890040ceea Update: Developer credits (#12173) 2024-03-01 15:47:10 -05:00
translators
667adf7df9 Update: Translations from eints
chinese (simplified): 26 changes by WenSimEHRP
korean: 5 changes by telk5093
dutch: 9 changes by Afoklala
portuguese (brazilian): 25 changes by pasantoro
2024-03-01 18:35:36 +00:00
f0a891c4f7 Cleanup: Remove unused last_num_specs from SlRoadStopTileData. (#12198)
Inadvertently copy & pasted from another Sl handler.
2024-03-01 02:00:13 +00:00
translators
c0b5510a94 Update: Translations from eints
portuguese (brazilian): 157 changes by pasantoro
polish: 5 changes by pAter-exe
2024-02-29 18:35:53 +00:00
translators
c4f9479507 Update: Translations from eints
chinese (simplified): 19 changes by WenSimEHRP
ukrainian: 9 changes by StepanIvasyn
portuguese (brazilian): 43 changes by pasantoro
2024-02-28 18:35:37 +00:00
Loïc Guilloux
fad77261ea Fix f6dd505: Missing savegame conversion for current_order (#12188) 2024-02-27 21:25:49 +01:00
d4f0f0e2c5 Codechange: Use GetVisibleRangeIterators() in more places. (#12190)
This replaces more first/last index calculation, along with indexed array/vector access, with iterator access instead.
2024-02-27 20:10:06 +00:00
translators
529d813496 Update: Translations from eints
hungarian: 96 changes by titanicbobo, 11 changes by pnpBrumi
ukrainian: 19 changes by StepanIvasyn
latvian: 1 change by lexuslatvia
spanish: 9 changes by MontyMontana
portuguese (brazilian): 94 changes by pasantoro
2024-02-27 18:35:58 +00:00
e93d081a4a Codechange: Use range-for instead of indexed loop. (#12191) 2024-02-27 18:18:57 +00:00
59420d57ec Codechange: Use vehicle tile hash to build depot vehicle list. (#12186)
This avoids iterating the entire vehicle pool.
2024-02-27 17:19:17 +00:00
a61311fcb0 Codefix: DrawEngineList does not accept EngineID.
Replace min/max parameters of DrawEngineList with scrollbar reference, and use iterators instead of indices.
2024-02-27 17:18:53 +00:00
bf865dc536 Codechange: Add GetVisibleRangeIterators() to Scrollbar. 2024-02-27 17:18:53 +00:00
Loïc Guilloux
f612bc6ee2 Fix bf4b6696: [Script] Broken ScriptText circular reference detection (#12187) 2024-02-27 18:16:21 +01:00
Kuhnovic
2fb1593550 Fix e38c3c5: Added missing return statement (#12185) 2024-02-27 12:55:42 +01:00
Patric Stout
e775ef2b70 Fix: initialize _switch_mode_time so crash-logs before first game have a realistic time (#12184) 2024-02-27 02:41:59 +01:00
translators
149592e4dd Update: Translations from eints
english (us): 9 changes by 2TallTyler
chinese (simplified): 10 changes by WenSimEHRP
luxembourgish: 21 changes by phreeze83
greek: 11 changes by Xertoveizer
hungarian: 60 changes by titanicbobo
german: 37 changes by frosch123
french: 9 changes by Bulest
portuguese (brazilian): 74 changes by pasantoro
polish: 5 changes by pAter-exe
2024-02-26 18:45:02 +00:00
Patric Stout
e939f59cbb Codechange: replace "byte" with "uint8_t" in settings (#12179) 2024-02-26 07:49:26 -05:00
translators
7b1e3cfeb5 Update: Translations from eints
english (au): 1 change by krysclarke
swedish: 1 change by niklasva
chinese (simplified): 6 changes by WenSimEHRP
korean: 21 changes by telk5093
hungarian: 1 change by PstasDev
italian: 1 change by Rivarossi
belarusian: 7 changes by KorneySan
russian: 7 changes by Ln-Wolf, 3 changes by KorneySan
catalan: 9 changes by J0anJosep
danish: 7 changes by bscargo
french: 7 changes by ottdfevr
portuguese: 1 change by jcteotonio
hindi: 2 changes by michaelsmassey
portuguese (brazilian): 115 changes by pasantoro
polish: 1 change by pAter-exe
2024-02-25 18:35:26 +00:00
86be6d7e0b Codechange: Off-by-one in colour gradient initialisation.
Remap sprites start with a count byte followed by 256 entries, but
SetupColoursAndInitialWindow did not take account of this extra byte and
therefore started at palette index 0xC5 instead of 0xC6. This caused the
first colour of each gradient to be incorrect and all shades were actually
1 step lower in the gradient than indicated.
2024-02-25 12:38:07 +00:00
912d7bd80e Codechange: Give ColourShade values names instead of numbers. 2024-02-25 12:38:07 +00:00
ae3390fe48 Codechange: Add ColourShade enum. 2024-02-25 12:38:07 +00:00
0463d4c198 Codechange: Remove direct access to _colour_gradient.
Access is now through GetColourGradient, which ensures parameters are in range.
2024-02-25 12:38:07 +00:00
56cf89d189 Change: Use bitmap for free unit ID generation. (#12165)
This improves performance of finding the next free unit number for a vehicle.

Based loosely on pool's used slot bitmap.
2024-02-25 12:36:13 +00:00
8afef45d4e Fix d3c673e: Don't defer OnResize() after ReInit() (#12174)
Some windows resize themselves during painting and issue ReInit(). In this case deferred OnResize() causes a visible glitch as the event is handled on the next redraw.
2024-02-25 08:35:57 +00:00
translators
ddb3914074 Update: Translations from eints
english (au): 6 changes by krysclarke
swedish: 19 changes by sereneavatar
estonian: 30 changes by RM87
chinese (simplified): 3 changes by Kevin-mao0721
hungarian: 60 changes by titanicbobo
italian: 6 changes by Rivarossi
russian: 3 changes by Ln-Wolf, 3 changes by KorneySan
finnish: 6 changes by hpiirai
ukrainian: 7 changes by StepanIvasyn
latvian: 6 changes by lexuslatvia
portuguese: 37 changes by azulcosta
portuguese (brazilian): 19 changes by pasantoro
polish: 6 changes by SzyZuu
2024-02-24 18:35:08 +00:00
Tyler Trahan
677ec70b0e Fix fd9e72a: Helptext for timekeeping unit setting erroneously refers to vehicle movement (#12172) 2024-02-24 16:09:16 +00:00
Richard Wheeler
c25d9f5c81 Fix: Make link graph node borders scale with GUI (#12167) 2024-02-23 19:04:34 -05:00
Jonathan G Rennison
222832f1d4 Fix #12166: Crash when opening tram road stop build window (#12168) 2024-02-23 15:02:59 -05:00
translators
7135330819 Update: Translations from eints
vietnamese: 3 changes by KhoiCanDev
chinese (simplified): 5 changes by WenSimEHRP
hungarian: 63 changes by titanicbobo
belarusian: 47 changes by KorneySan
finnish: 2 changes by hpiirai
ukrainian: 25 changes by StepanIvasyn
danish: 38 changes by bscargo
portuguese (brazilian): 158 changes by pasantoro
2024-02-23 18:35:31 +00:00
SamuXarick
b22fb43cea Fix #10490: Allow ships to exit depots if another is not moving at the exit point (#12161) 2024-02-23 08:08:16 -05:00
2b79e7cdf5 Fix b7630b0: Incorrect padding for text purchase list. (#12160)
Restore to original (and more normal) framerect padding.
2024-02-22 22:23:29 +00:00
frosch
bb86023d50 Fix #12127, 555a379: Truncation ellipses rendered shadows even for black font without shadows (#12132) 2024-02-22 22:22:35 +00:00
Rubidium
4c117dd2d8 Revert #11993: new number format system does not and cannot work for CJK languages
There are too many intricacies that I am unaware of that are popping up after
asking whether things are right or not.
I do not want to keep playing whack-a-mole, so just revert the whole thing.

This reverts:
15be383b93
360fe8b0b6
1aa9a5c0ab
59f56941e5
7e2eefb91f
b741b2ba6f
609d0071d5
9f8fd80112
a253205b93
819c6c756e
2024-02-22 20:40:12 +01:00
translators
8015d96a50 Update: Translations from eints
english (au): 2 changes by krysclarke
spanish (mexican): 149 changes by Can202
estonian: 11 changes by RM87
chinese (simplified): 18 changes by WenSimEHRP
hungarian: 2 changes by PstasDev
italian: 195 changes by Rivarossi
serbian: 42 changes by nkrs
german: 2 changes by Wuzzy2
belarusian: 537 changes by KorneySan
russian: 25 changes by KorneySan
ukrainian: 21 changes by StepanIvasyn
turkish: 14 changes by jnmbk
latvian: 2 changes by lexuslatvia
dutch: 1 change by iamthedutchdude
spanish: 15 changes by MontyMontana
french: 2 changes by ottdfevr
portuguese: 2 changes by jcteotonio, 2 changes by azulcosta
portuguese (brazilian): 149 changes by pasantoro
polish: 2 changes by pAter-exe
2024-02-22 18:36:05 +00:00
Rubidium
5d2e6e4efa Fix #12148, fca8166: Do not draw decimals when number of digits is 0 2024-02-21 19:32:53 +01:00
Jonathan G Rennison
ca146c8ddd Fix #12145: Incorrect date handling in date cheat in wallclock time-keeping mode 2024-02-21 18:43:05 +01:00
Jonathan G Rennison
409c073eca Codefix: Off by one in TimerGameEconomy::ConvertDateToYMD wallclock mode 2024-02-21 18:40:02 +01:00
merni-ns
7bab2c1cc3 Fix #12119: Remove red warning text when maximum loan is zero 2024-02-21 18:38:53 +01:00
Jonathan G Rennison
c637d376d0 Fix cb588d8d: Ordering of command per tick limit and pause mode filtering (#12126)
The command per tick limit should be applied after the pause mode filter
2024-02-20 15:51:35 -05:00
merni-ns
ad9080338c Codefix: Correct coding style on fall through (#12140) 2024-02-20 15:50:08 -05:00
translators
bff69e192b Update: Translations from eints
english (us): 24 changes by 2TallTyler
vietnamese: 13 changes by KhoiCanDev
estonian: 7 changes by RM87
german: 16 changes by Wuzzy2
belarusian: 328 changes by KorneySan
russian: 6 changes by KorneySan, 5 changes by Ln-Wolf
ukrainian: 9 changes by StepanIvasyn
catalan: 18 changes by J0anJosep
danish: 61 changes by bscargo
french: 8 changes by ottdfevr
portuguese: 29 changes by jcteotonio, 12 changes by azulcosta
portuguese (brazilian): 185 changes by pasantoro
polish: 1 change by pAter-exe
2024-02-20 18:35:58 +00:00
Loïc Guilloux
25d1238907 Fix #12133: [Script] Don't crash when emergency saving (#12138) 2024-02-20 18:55:18 +01:00
Loïc Guilloux
2d7ad9f717 Fix: [Script] Only show debug script window at the end of savegame loading (#12135) 2024-02-20 16:08:26 +00:00
translators
f1bf39f38b Update: Translations from eints
english (au): 12 changes by krysclarke
chinese (simplified): 84 changes by WenSimEHRP
russian: 13 changes by Ln-Wolf
finnish: 12 changes by hpiirai
ukrainian: 12 changes by StepanIvasyn
latvian: 19 changes by lexuslatvia
french: 1 change by ZarTek-Creole
portuguese (brazilian): 169 changes by pasantoro
polish: 12 changes by pAter-exe
2024-02-19 18:35:28 +00:00
Rubidium
a4d4301a0c Codechange: We are heading to 15 2024-02-18 21:48:54 +01:00
translators
73bed054b8 Update: Translations from eints
english (au): 2 changes by krysclarke
korean: 5 changes by telk5093
russian: 2 changes by Ln-Wolf
tamil: 45 changes by Aswn
portuguese: 1 change by azulcosta
hindi: 85 changes by NisheshTyagi
portuguese (brazilian): 119 changes by pasantoro
2024-02-18 18:35:02 +00:00
Rubidium
15be383b93 Fix a253205: remove (now) unused currency separator 2024-02-18 16:56:52 +01:00
Tyler Trahan
4f1bc39bf7 Change: Show speed before destination in vehicle status bar (#11932) 2024-02-18 10:44:11 -05:00
Tyler Trahan
87a80c7ff2 Change: When adding orders, Ctrl+Click on a depot to unbunch, instead of service if required (#12023) 2024-02-18 10:43:44 -05:00
frosch
555a37930b Fix: Shadows of individual character glyphs could be drawn over other characters (#12115) 2024-02-18 16:30:54 +01:00
Damian Laczak
49c3215751 Fix #10983: [AdminPort] Correct order of messages 2024-02-18 15:11:00 +01:00
f20d241e81 Fix a258833: Don't invalidate station list on vehicle load/unload. (#12112)
a258833 fixed a bug but as a result causes the station list to be rebuilt every time (once per game tick) a vehicle loads/unloads.

Instead just mark the window for redraw.
2024-02-18 12:20:11 +00:00
Koen Bussemaker
8a1cea2ab6 Codechange: Skip non-water water region patches in neigbor search 2024-02-18 11:46:34 +01:00
Rubidium
360fe8b0b6 Fix a253205: division by zero when attempting to format some short currencies 2024-02-17 22:45:48 +01:00
translators
03e3553230 Update: Translations from eints
estonian: 15 changes by RM87
portuguese (brazilian): 42 changes by pasantoro
polish: 30 changes by pAter-exe
2024-02-17 18:35:04 +00:00
2ecc3c90f7 Change: Improve performance of finding free pool slots. (#12055)
Add a bitmap of used pool slots which allows finding a free pool slot without having to check if each index is already used or not.

Loosely based on a JGRPP patch.
2024-02-17 18:29:21 +00:00
Rubidium
1aa9a5c0ab Update: Use proper number formats and abbreviations for Chinese, Japanese, Korean and German 2024-02-17 14:33:16 +01:00
Rubidium
59f56941e5 Update: Number format configuration based on old digitsep and STR_CURRENCY_SHORT_* values 2024-02-17 14:33:16 +01:00
Rubidium
7e2eefb91f Cleanup: Remove digit group separators from strgen and languages 2024-02-17 14:33:16 +01:00
Rubidium
b741b2ba6f Feature: Fully user configurable number format and abbreviations 2024-02-17 14:33:16 +01:00
Rubidium
609d0071d5 Change: Remove saving of digit group and decimal separator configurations from the savegame 2024-02-17 14:33:16 +01:00
Rubidium
e67fc33172 Codechange: Add support for NULL strings in SaveLoadCompat 2024-02-17 14:33:16 +01:00
Rubidium
9f8fd80112 Feature: Fully customisable number abbreviations per translation 2024-02-17 14:33:16 +01:00
Rubidium
a253205b93 Feature: Fully customisable number format per translation 2024-02-17 14:33:16 +01:00
Rubidium
819c6c756e Codechange: Add support for number format and abbreviations pragmas/attributes to strgen 2024-02-17 14:33:16 +01:00
Rubidium
fca8166087 Codechange: Simplify FormatNumber by moving out zero fill and decimal support 2024-02-17 14:33:16 +01:00
Rubidium
a44bd81280 Codechange: Move determining the decimal separator to a separate function 2024-02-17 14:33:16 +01:00
Rubidium
f0c50ad529 Codechange: Add function to get the power of ten for a given number 2024-02-17 14:33:16 +01:00
rubidium42
8bccb5805a Fix 0ca4b4e: Ctrl+Click style inconsistency in base language (#12099) 2024-02-17 06:26:09 +00:00
translators
bb2446c058 Update: Translations from eints
welsh: 5 changes by Ansbaradigeidfran
estonian: 108 changes by siimsoni, 50 changes by RM87
luxembourgish: 276 changes by phreeze83
hungarian: 81 changes by PstasDev
indonesian: 6 changes by tsaqibfs
italian: 191 changes by AlphaJack
bulgarian: 118 changes by lamarin1
ukrainian: 16 changes by StepanIvasyn
tamil: 408 changes by Aswn
turkish: 43 changes by metsysma
esperanto: 103 changes by JadedCtrl
portuguese (brazilian): 57 changes by pasantoro
polish: 61 changes by pAter-exe
2024-02-16 18:35:10 +00:00
adb796a21a Change: Show 6 or 2 orientation buttons in NewGRF road stop picker as appropriate.
This replaces the normal method of masking unusable buttons.
2024-02-15 22:28:58 +00:00
8c22690ce1 Codechange: Update window's widget lookup map when switching displayed plane. 2024-02-15 22:28:58 +00:00
translators
3d591c2094 Update: Translations from eints
swedish: 1 change by SpamixOfficial
welsh: 280 changes by Ansbaradigeidfran
vietnamese: 245 changes by myquartz
estonian: 1 change by siimsoni
czech: 64 changes by LubosKolouch, 29 changes by adamek0202
arabic (egypt): 17 changes by AviationGamerX
luxembourgish: 247 changes by phreeze83
hungarian: 9 changes by nemesbala
indonesian: 21 changes by tsaqibfs, 19 changes by K4smun1
italian: 13 changes by AlphaJack
hebrew: 20 changes by Boltyansky
bulgarian: 107 changes by lamarin1
finnish: 4 changes by lanurmi
ukrainian: 18 changes by StepanIvasyn
catalan: 1 change by arnaullv
turkish: 120 changes by metsysma, 43 changes by EndChapter
danish: 23 changes by mamure, 23 changes by bscargo
dutch: 1 change by Jaws3rd
french: 1 change by Lishouuu
portuguese (brazilian): 362 changes by pasantoro
polish: 60 changes by pAter-exe
2024-02-15 18:34:46 +00:00
SamuXarick
8584d1b5bb Add: [Script] GetAirportNumHelipads (#12085)
Adds a function for Scripts to get the number of helipads of an airport type.
2024-02-14 21:38:32 +01:00
a64ca2e0c5 Cleanup: Remove declaration of non-existent function. (#12091) 2024-02-14 20:28:03 +00:00
4ffe1da540 Fix: NewGRF roadstops were ignored if only in default class. (#12089)
If a NewGRF defines roadstops in the default class and no other classes are defined, they would be ignored and not selectable.
2024-02-14 19:21:13 +00:00
translators
ac5eaecd15 Update: Translations from eints
english (au): 1 change by krysclarke
english (us): 1 change by 2TallTyler
czech: 74 changes by adamek0202
chinese (simplified): 3 changes by WenSimEHRP
luxembourgish: 42 changes by phreeze83
korean: 1 change by telk5093
german: 1 change by Wuzzy2
romanian: 19 changes by ALEX11BR
russian: 1 change by Ln-Wolf
finnish: 6 changes by lanurmi
ukrainian: 13 changes by StepanIvasyn
turkish: 26 changes by metsysma
danish: 18 changes by bscargo
latvian: 3 changes by lexuslatvia
portuguese: 1 change by azulcosta
portuguese (brazilian): 273 changes by pasantoro
2024-02-14 18:37:05 +00:00
1e82d75fa2 Fix f1144de: "knots" missing from settings units list. (#12082)
Knots were added as a setting but not included in the settings list so were saved as a number instead of string.
2024-02-13 20:19:45 +00:00
translators
4cea9a61ce Update: Translations from eints
swedish: 132 changes by sereneavatar
spanish (mexican): 31 changes by absay
english (us): 2 changes by 2TallTyler
czech: 6 changes by Caesar008
arabic (egypt): 76 changes by AviationGamerX
turkish: 91 changes by metsysma
danish: 9 changes by mamure
portuguese: 9 changes by azulcosta
portuguese (brazilian): 253 changes by pasantoro
polish: 14 changes by pAter-exe
2024-02-13 18:37:22 +00:00
Tyler Trahan
f5126cba08 Fix: Accurately describe Ctrl+Clicking on a waypoint in Go To tooltip (#12081) 2024-02-13 11:41:25 -05:00
Florian
02b59920ed Fix #12050: Add default size, shade and pin control buttons to company livery widget. (#12080) 2024-02-13 15:55:13 +00:00
14b31c8fed Add: Show cargo icons on subsidy list window. (#12079) 2024-02-13 07:41:24 +00:00
Patric Stout
15c14a896f Fix: survey-time seconds for clients was calculated wrong (#12078) 2024-02-12 21:56:27 +00:00
Patric Stout
bad31f2d42 Fix #10079: don't render at 1000fps if HW acceleration + vsync is requested but not active (#12067) 2024-02-12 21:39:23 +00:00
Loïc Guilloux
79374bc003 Fix #12074: Don't allow "part" command for dedicated servers (#12075) 2024-02-12 19:28:30 +00:00
translators
a3e6f82150 Update: Translations from eints
english (au): 2 changes by krysclarke
swedish: 307 changes by sereneavatar
galician: 127 changes by pvillaverde
romanian: 165 changes by bnegrut
spanish: 8 changes by MontyMontana
portuguese: 89 changes by azulcosta
portuguese (brazilian): 335 changes by pasantoro
2024-02-12 18:35:10 +00:00
Patric Stout
839f2e025c Fix: visually also disable vsync when not using HW acceleration (#12066) 2024-02-12 03:19:08 +01:00
Jonathan G Rennison
5ab5f4ace7 Codefix df691eb3: Reloading GRFs destructed small UFO targeting road vehicle (#12072) 2024-02-12 00:51:18 +00:00
481fa7dbb5 Change: Show cargo icons on Industry View window. (#12071) 2024-02-12 00:50:58 +00:00
Loïc Guilloux
3ffa176870 Change: [Script] Store randomizers in savegame (#12063) 2024-02-12 01:22:57 +01:00
d6f34a21e8 Codefix: Incorrect storage type in cargo field of industry cargo chains window. (#12051)
`supp_cargoes` and `cust_cargoes` actually contains a column index, however this index is always stored at the indexed position...

Replace with a bitmask instead, which stores if the column indices are linked.
2024-02-11 23:05:29 +00:00
df691eb31e Codechange: Don't scan vehicle pool to find targeting disaster vehicle when deleting any vehicle. (#12064)
* Codechange: Don't scan vehicle pool to find targeting disaster vehicle when deleting any vehicle.

When deleting a vehicle, the vehicle pool is scanned to find a targetting disaster vehicle. With lots of vehicles this can take some time, especially when deleting multiple consecutive vehicles.

Disasters vehicles can actually only target road vehicles. Store the DisasterVehicle index in the road vehicle, so that no pool scan is necessary.

* Change: Small UFOs no longer target a vehicle which is already a target.
2024-02-11 23:04:29 +00:00
Patric Stout
fa6f270f23 Codefix 36e1b32: remove left-over debug statement (#12068) 2024-02-11 21:36:37 +00:00
58ed38be03 Change: Avoid adjacent fence fields.
This restores pre-r23168 behaviour of only a single fence between adjacent fields.
2024-02-11 22:10:46 +01:00
d6c5efd795 Change: Draw north-side farm fences/hedges/walls on tile edge, instead of 1/16th in.
This matches original TTD drawing behaviour, which is what the original baseset sprites are designed for, and avoids alignment issues (which are more problematic with high detail 4x sprites.)
2024-02-11 22:10:46 +01:00
SamuXarick
fa64fff4a5 Fix #10405, a3dd750: [Script] Test engine and vehicle type validity for ScriptGroup::GetNumEngines (#11887) 2024-02-11 22:09:23 +01:00
Patric Stout
5b3bfe4c4c Fix fdfcb09: for content service, fallback to TCP downloads when HTTP stalls (#12056) 2024-02-11 20:24:28 +01:00
Loïc Guilloux
8d9fa0ea89 Change: [Script] Use company randomizer when adding random deviation (#12065) 2024-02-11 18:58:41 +00:00
translators
378dab3750 Update: Translations from eints
galician: 85 changes by pvillaverde
estonian: 1 change by RM87
czech: 7 changes by JakMel
chinese (simplified): 1 change by WenSimEHRP
korean: 10 changes by telk5093
german: 191 changes by Wuzzy2
romanian: 122 changes by bnegrut
russian: 29 changes by Ln-Wolf
catalan: 28 changes by J0anJosep
french: 6 changes by glx22
portuguese (brazilian): 252 changes by pasantoro
2024-02-11 18:34:45 +00:00
Joan Josep
1b33b4058e Fix: Redraw orders when a station feature is added/removed. (#12061) 2024-02-11 12:47:49 -05:00
9ec9c8d8b5 Fix: Industry tiles and houses could accept incorrect cargo types. (#12062)
Ensure the default label is cleared when NewGRFs set industry tile or house acceptance.

This was missed by #12053.
2024-02-11 17:42:04 +00:00
Patric Stout
d02b1547f6 Remove: setting "no_http_content_downloads" (#12058)
As we now use HTTPS, it is very likely this will work on most systems.
For systems that do have HTTPS blocked, it will fail instantly,
and it will fallback to TCP anyway. That makes this setting no longer
very useful.
2024-02-11 14:48:12 +00:00
8db08da148 Fix #12052: NewGRFs clearing industry cargo slots could fallback to default instead of empty. (#12053)
Ensure the default label is cleared when NewGRF sets a produced/accepted cargo slot, so that default fallback isn't used.
2024-02-11 00:43:13 +00:00
Tyler Trahan
7b32d9cff5 Fix #12019: Correctly highlight depot unbunch action in dropdown 2024-02-10 15:11:24 -05:00
Tyler Trahan
771615cb4b Fix #12020: Unbunch and service if needed should be mutually exclusive depot order types 2024-02-10 15:11:24 -05:00
Patric Stout
84e6c7aef3 Doc: Update documentation how to make commit message (#12046)
By writing more in the style we need for the changelog,
we avoid requiring lots of work when making a changelog.
2024-02-10 21:01:34 +01:00
translators
2f35a484fe Update: Translations from eints
swedish: 1 change by SpamixOfficial
english (us): 7 changes by 2TallTyler
galician: 123 changes by pvillaverde
estonian: 5 changes by RM87
czech: 46 changes by justidan4
romanian: 19 changes by ALEX11BR
russian: 13 changes by gisterecis
finnish: 6 changes by rikkerton
catalan: 188 changes by J0anJosep
turkish: 29 changes by densxd
latvian: 7 changes by lexuslatvia
portuguese: 33 changes by azulcosta
portuguese (brazilian): 546 changes by pasantoro
polish: 24 changes by pAter-exe
2024-02-10 18:35:13 +00:00
Loïc Guilloux
b84b68e959 Codechange: Rework regression output filtering (#12049) 2024-02-10 14:16:24 +01:00
Loïc Guilloux
977aba73be Change: Store running AI config inside Company (#12003) 2024-02-09 22:55:49 +01:00
466e6bb524 Fix #12037: Blurry OpenTTD font on Mac OS. (#12047) 2024-02-09 21:36:13 +01:00
Patric Stout
48e7dceb3c Revert: Build signals to the next junction when dragging regardless of the Ctrl state (#12034)
This reverts commit b370ae1212.
2024-02-09 19:34:03 +01:00
Jonathan G Rennison
bed3ef6f6b Cleanup: Incorrect savegame number for SLV_DEPOT_UNBUNCHING constant (#12045) 2024-02-09 17:50:29 +00:00
Kuhnovic
e38c3c59f3 Fix #11840: Ship pathfinder always returns a valid trackdir if one is available (#12031) 2024-02-09 12:31:38 -05:00
Loïc Guilloux
b68d263d5f Fix #12014: Remove water when area clearing ship depot (#12030) 2024-02-09 18:17:08 +01:00
Tyler Trahan
10bcf0172e Fix #12022: Adjust economy date when changing timekeeping units in Scenario Editor (#12042) 2024-02-09 11:45:32 -05:00
Loïc Guilloux
165f92c00b Fix #12041, 0c81579: Tarball extraction failing due to incorrect filename (#12044) 2024-02-09 17:25:56 +01:00
translators
9b323b4ef9 Update: Translations from eints
english (au): 7 changes by krysclarke
galician: 1 change by pvillaverde
chinese (simplified): 3 changes by WenSimEHRP
italian: 29 changes by Giredson
german: 53 changes by MagnumSociety
ukrainian: 37 changes by StepanIvasyn
dutch: 7 changes by rcpaul
spanish: 144 changes by MontyMontana
french: 4 changes by Lishouuu
portuguese: 48 changes by azulcosta
portuguese (brazilian): 156 changes by pasantoro
polish: 22 changes by azabost, 6 changes by pAter-exe
2024-02-08 18:34:34 +00:00
Tyler Trahan
16e6da020d Cleanup: Remove unnecessary Trackdir casts (#12038) 2024-02-08 09:46:55 -05:00
Loïc Guilloux
82470f5c0d Codechange 80ebcc7: OptionMenuEntries prefix is OME not ONE (#12036) 2024-02-08 00:22:01 +00:00
Patric Stout
11f5ac72a9 Fix #12029: don't show Sandbox Options in multiplayer (#12032) 2024-02-08 00:33:24 +01:00
Heikki Piirainen
42a88fc1d6 Fix: Finnish thousands separator (#12028)
In Finnish, the recommended digit group separator is a space rather than a dot.
2024-02-07 13:35:56 -05:00
translators
d2a4f3123d Update: Translations from eints
galician: 25 changes by pvillaverde
czech: 182 changes by justidan4
hungarian: 31 changes by titanicbobo, 13 changes by Norodix
indonesian: 27 changes by tsaqibfs
german: 58 changes by UnsuspiciousGooball
russian: 18 changes by Ln-Wolf
finnish: 6 changes by hpiirai, 5 changes by lanurmi
ukrainian: 39 changes by StepanIvasyn
turkish: 3 changes by metsysma
danish: 55 changes by mamure, 6 changes by bscargo
dutch: 111 changes by Afoklala, 2 changes by robert5800
spanish: 196 changes by MontyMontana
portuguese: 4 changes by azulcosta
portuguese (brazilian): 148 changes by pasantoro
polish: 42 changes by pAter-exe, 16 changes by azabost
2024-02-07 18:34:54 +00:00
2c78146da5 Change: Limit cargo types in station cargo filter, with "More..." option to show all. 2024-02-07 17:13:37 +00:00
e517e55620 Change: Include count of stations per cargo type in station cargo filter.
Cargo types with no stations are shaded to make the list clearer.
2024-02-07 17:13:37 +00:00
46da56b191 Change: Replace long list of cargo filter buttons with a multi-select dropdown list.
As before, hold ctrl while clicking on an item to toggle selections.
2024-02-07 17:13:37 +00:00
0ce30d05c8 Codechange: Add method to replace the content of a dropdown menu.
If necessary the dropdown list window will be resized and scrollbar enabled/disabled.
2024-02-07 17:13:37 +00:00
ac44c001a4 Codechange: Expose FindChildWindow() as a method of Window. 2024-02-07 17:13:37 +00:00
4c44e1eae0 Codechange: Add parameter to persist dropdown menus.
If a dropdown menu is set to persist, it will not close when an item is selected. It will close as normal if the window loses focus.

Closing the list is the responsibility of the caller.
2024-02-07 17:13:37 +00:00
b1c5e03df1 Fix: Don't issue autoreplace failed news message for command test mode. (#12026) 2024-02-07 12:07:00 +00:00
1f8533ebe0 Fix #12024: Autoreplace failed news message for trains must go to lead engine. (#12025) 2024-02-07 08:51:03 +00:00
Patric Stout
b085f610e2 Doc: Prepare for 14.0-beta3 release (#12018)
Co-authored-by: Michael Lutz <michi@icosahedron.de>
2024-02-06 21:48:07 +01:00
Loïc Guilloux
b0f3417025 Add: [Script] ScriptTileList_StationCoverage (#12015) 2024-02-06 20:22:18 +01:00
Loïc Guilloux
0858377e9e Fix: [Script] Don't kill GS misusing GSText (#12009) 2024-02-06 19:58:30 +01:00
merni-ns
34b05465d5 Fix 5a88027: [Script] Avoid overflow in scripts when infinite money is enabled (#12016) 2024-02-06 19:54:38 +01:00
translators
02cdd5ba8b Update: Translations from eints
spanish (mexican): 7 changes by Skinazo
english (us): 4 changes by 2TallTyler
czech: 37 changes by justidan4
chinese (simplified): 1 change by WenSimEHRP
finnish: 50 changes by Finjet-cyber, 22 changes by hpiirai
spanish: 13 changes by MontyMontana
french: 4 changes by ottdfevr
portuguese (brazilian): 141 changes by pasantoro
polish: 68 changes by pAter-exe
2024-02-06 18:35:32 +00:00
e9ea837311 Fix #12012: Crash when opening orders of another company. (#12013)
Orders window changes tooltip depending on vehicle type but did check if widget exists.
2024-02-06 12:53:23 +00:00
dP
e2d36f626b Fix: Focus hotkey in road/tram stop building window (#12008) 2024-02-05 18:14:21 -05:00
ae30ad7802 Fix #12001: Use correct valid cargo check for old-style NewGRF town house 3rd cargo set up. (#12006) 2024-02-05 23:12:56 +00:00
5c630e10b7 Fix 2fd90960: Missing default vehicles and industry acceptance/production. (#12000)
* Fix 2fd90960: Missing default vehicles and industry acceptance/production.

Some default definitions are used across multiple climate types and relied on climate-independent cargo slot even though they specified a climate-dependent cargo type.

Add MixedCargoType that indirectly allows multiple labels to be specified for these.
2024-02-05 23:11:32 +00:00
Tyler Trahan
b2b4cceb49 Fix #11997: Adjust economy date by 1920 when loading TTD/TTO savegames (#12007) 2024-02-05 18:09:29 -05:00
translators
05e23f8fc9 Update: Translations from eints
english (au): 4 changes by krysclarke
chinese (simplified): 21 changes by WenSimEHRP
korean: 4 changes by CoconutKR
finnish: 94 changes by hpiirai
catalan: 20 changes by J0anJosep
danish: 7 changes by bscargo
latvian: 4 changes by lexuslatvia
esperanto: 31 changes by JadedCtrl
portuguese (brazilian): 283 changes by pasantoro
polish: 75 changes by pAter-exe
2024-02-05 18:35:45 +00:00
Rubidium
3534214dfc Codechange: use reference instead of pointer for CommandPacket 2024-02-05 18:57:58 +01:00
Rubidium
cb588d8d3f Codechange: use std::vector for the incoming command queue 2024-02-05 18:57:58 +01:00
Rubidium
b3aa8a9c35 Codechange: use std::vector for the outgoing command "queues" 2024-02-05 18:57:58 +01:00
09a12f230f Fix: Signals were incorrectly shifted by 1 pixel when selected. (#12005)
Most shifting when pressed was removed by 884b9e66.
2024-02-05 17:55:04 +00:00
Rubidium
63708609fb Codechange: define the size of the PacketType enumerations 2024-02-05 17:10:35 +01:00
Rubidium
6f77c2eaa2 Codechange: use size_t for the MTU limits and remove default parameter 2024-02-05 17:10:35 +01:00
Rubidium
72a44b0df6 Codechange: use references for handling received TCP packets 2024-02-05 16:30:49 +01:00
Rubidium
794f12dc24 Codechange: cascade through SendNeedGame/CompanyPassword functions, instead of duplicating logic for determining whether to call these functions 2024-02-05 16:30:49 +01:00
Rubidium
8add0bf8ec Codechange: use references for game info serialization 2024-02-05 16:30:49 +01:00
Rubidium
84623d2123 Codechange: use references for UDP packets 2024-02-05 16:30:49 +01:00
Rubidium
031a9d4e26 Codechange: use std::unique_ptr for the Packets created to send via TCP 2024-02-05 16:30:49 +01:00
Rubidium
36e1b32ccf Codechange: use std::deque of std::unique_ptr to queue packets 2024-02-05 16:30:49 +01:00
Rubidium
c77a45ed86 Codechange: use std::unique_ptr for receiving network packets 2024-02-05 16:30:49 +01:00
Richard Wheeler
4ba62594e5 Change: Update OpenTTD TTF fonts to v0.5 (#11994)
Corrects line height in Windows to the exact intended pixel values, along with change of OpenTTD Sans to use tabular lining numerals and minor bugfixes.
2024-02-05 10:09:18 -05:00
Patric Stout
60b6c6c7ee Doc: Prepare for 14.0-beta2 release (#11988)
Co-authored-by: Charles Pigott <charlespigott@googlemail.com>
Co-authored-by: Michael Lutz <michi@icosahedron.de>
2024-02-04 23:35:16 +01:00
Koen Bussemaker
35c89d57f8 Codechange: Added debug printing for Water Regions 2024-02-04 22:50:04 +01:00
Koen Bussemaker
4b94457bf1 Fix #11802: Made determining water region edge traversability more robust 2024-02-04 22:50:04 +01:00
translators
9cc17230e8 Update: Translations from eints
english (au): 11 changes by krysclarke
english (us): 11 changes by 2TallTyler
galician: 3 changes by pvillaverde
chinese (simplified): 17 changes by WenSimEHRP
korean: 14 changes by telk5093
german: 78 changes by SecretIdetity
russian: 11 changes by Ln-Wolf
catalan: 23 changes by J0anJosep
danish: 2 changes by bscargo
latvian: 229 changes by lexuslatvia
french: 29 changes by glx22
portuguese: 33 changes by azulcosta
portuguese (brazilian): 28 changes by pasantoro
2024-02-04 18:36:20 +00:00
Loïc Guilloux
64611a7d12 Fix #11975, 27a920c: Running AIs also occupy a slot (#11976) 2024-02-04 13:19:35 +01:00
dP
ff618230fe Codechange: Replace magic value with a variable (#11980) 2024-02-04 10:45:24 +00:00
2fd9096070 Change: Decouple and remove landscape-dependent cargo types. (#11719)
Cargo types of default engines, industries and houses are now specified in terms of label.
2024-02-04 10:16:08 +00:00
83d63464db Fix #11966: Scrollbar may be incorrect on first opening of text file window. (#11981)
The scrollbar is set up before the true monospace is loaded, so reinitialise the window after loading.
2024-02-04 10:15:20 +00:00
Loïc Guilloux
75015cdad2 Fix 6f6f099: Signals exist only on plain rail tiles (#11977) 2024-02-04 10:39:06 +01:00
Biswapriyo Nath
0937158499 Fix: [CMake] Link test executable with log library in Android (#11979) 2024-02-04 09:52:05 +01:00
d9461e52af Fix #11972: Incorrect minimum width allocated to graph. (#11974)
Width was based on actual number of data points instead of possible number of data points.
2024-02-04 08:51:19 +00:00
Jonathan G Rennison
cb13ee90ef Fix: Second colour vehicle-type default liveries not being updated
When changing company default second colour
2024-02-04 07:14:39 +01:00
Tyler Trahan
d5e936c9d4 Fix #11968: Always set string parameters to avoid undefined behavior (#11973) 2024-02-04 07:07:47 +01:00
1349 changed files with 112898 additions and 92932 deletions

View File

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

View File

@@ -1,3 +1,13 @@
<!--
Commit message:
- Please use Feature / Add / Change / Fix for player-facing changes. E.g.: "Feature: My cool new feature".
- Please use Feature / Add / Change / Fix followed by "[NewGRF]" or "[Script]" for moddable changes. E.g.: "Feature: [NewGRF] My cool new NewGRF addition".
- Please use Codechange / Codefix for developer-facing changes. E.g.: "Codefix #1234: Validate against nullptr properly".
See https://github.com/OpenTTD/OpenTTD/blob/master/CODINGSTYLE.md#commit-message for more details.
-->
## Motivation / Problem
<!--

36
.github/changelog.py vendored Normal file
View File

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

16
.github/changelog.sh vendored
View File

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

View File

@@ -39,7 +39,6 @@ def read_language_file(filename, strings_found, errors):
skip = SkipType.NONE
length = 0
common_prefix = ""
last_tiny_string = ""
with open(filename) as fp:
for line in fp.readlines():
@@ -114,17 +113,6 @@ def read_language_file(filename, strings_found, errors):
name = line.split(":")[0].strip()
strings_defined.append(name)
# If a string ends on _TINY or _SMALL, it can be the {TINY} variant.
# Check for this by some fuzzy matching.
if name.endswith(("_SMALL", "_TINY")):
last_tiny_string = name
elif last_tiny_string:
matching_name = "_".join(last_tiny_string.split("_")[:-1])
if name == matching_name:
strings_found.add(last_tiny_string)
else:
last_tiny_string = ""
if skip == SkipType.EXTERNAL:
strings_found.add(name)
skip = SkipType.LENGTH

View File

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

75
.github/workflows/ci-emscripten.yml vendored Normal file
View File

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

126
.github/workflows/ci-linux.yml vendored Normal file
View File

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

90
.github/workflows/ci-macos.yml vendored Normal file
View File

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

86
.github/workflows/ci-mingw.yml vendored Normal file
View File

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

60
.github/workflows/ci-nightly.yml vendored Normal file
View File

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

84
.github/workflows/ci-windows.yml vendored Normal file
View File

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

View File

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

View File

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

View File

@@ -7,6 +7,7 @@ on:
- synchronize
branches:
- master
- release/**
concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number }}

19
.github/workflows/rebase-checker.yml vendored Normal file
View File

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

View File

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

View File

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

View File

@@ -17,6 +17,11 @@ jobs:
MACOSX_DEPLOYMENT_TARGET: 10.13
steps:
- name: Setup Xcode version
uses: maxim-lobanov/setup-xcode@v1
with:
xcode-version: latest-stable
- name: Download source
uses: actions/download-artifact@v4
with:
@@ -40,6 +45,11 @@ jobs:
core.exportVariable('ACTIONS_RUNTIME_TOKEN', process.env.ACTIONS_RUNTIME_TOKEN || '');
core.exportVariable('VCPKG_BINARY_SOURCES', 'clear;x-gha,readwrite')
- name: Install vcpkg
run: |
git clone https://github.com/microsoft/vcpkg ${{ runner.temp }}/vcpkg
${{ runner.temp }}/vcpkg/bootstrap-vcpkg.sh -disableMetrics
- name: Install dependencies
env:
HOMEBREW_NO_AUTO_UPDATE: 1
@@ -52,7 +62,7 @@ jobs:
echo "::endgroup::"
echo "::group::Install breakpad dependencies"
cargo install dump_syms
cargo install --locked dump_syms
echo "::endgroup::"
- name: Install GCC problem matcher
@@ -76,7 +86,7 @@ jobs:
echo "::endgroup::"
- name: Import code signing certificates
uses: Apple-Actions/import-codesign-certs@v2
uses: Apple-Actions/import-codesign-certs@v3
with:
# The certificates in a PKCS12 file encoded as a base64 string
p12-file-base64: ${{ secrets.APPLE_DEVELOPER_CERTIFICATE_P12_BASE64 }}
@@ -94,7 +104,7 @@ jobs:
cmake ${GITHUB_WORKSPACE} \
-DCMAKE_OSX_ARCHITECTURES=arm64 \
-DVCPKG_TARGET_TRIPLET=arm64-osx \
-DCMAKE_TOOLCHAIN_FILE=/usr/local/share/vcpkg/scripts/buildsystems/vcpkg.cmake \
-DCMAKE_TOOLCHAIN_FILE=${{ runner.temp }}/vcpkg/scripts/buildsystems/vcpkg.cmake \
-DHOST_BINARY_DIR=${GITHUB_WORKSPACE}/build-host \
-DCMAKE_BUILD_TYPE=RelWithDebInfo \
-DOPTION_SURVEY_KEY=${{ inputs.survey_key }} \
@@ -115,7 +125,7 @@ jobs:
cmake ${GITHUB_WORKSPACE} \
-DCMAKE_OSX_ARCHITECTURES=x86_64 \
-DVCPKG_TARGET_TRIPLET=x64-osx \
-DCMAKE_TOOLCHAIN_FILE=/usr/local/share/vcpkg/scripts/buildsystems/vcpkg.cmake \
-DCMAKE_TOOLCHAIN_FILE=${{ runner.temp }}/vcpkg/scripts/buildsystems/vcpkg.cmake \
-DHOST_BINARY_DIR=${GITHUB_WORKSPACE}/build-host \
-DCMAKE_BUILD_TYPE=RelWithDebInfo \
-DOPTION_SURVEY_KEY=${{ inputs.survey_key }} \

View File

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

View File

@@ -53,6 +53,11 @@ jobs:
core.exportVariable('ACTIONS_RUNTIME_TOKEN', process.env.ACTIONS_RUNTIME_TOKEN || '');
core.exportVariable('VCPKG_BINARY_SOURCES', 'clear;x-gha,readwrite')
- name: Install vcpkg
run: |
git clone https://github.com/microsoft/vcpkg ${{ runner.temp }}\vcpkg
${{ runner.temp }}\vcpkg\bootstrap-vcpkg.bat -disableMetrics
- name: Install dependencies
shell: bash
run: |
@@ -61,7 +66,7 @@ jobs:
echo "::endgroup::"
echo "::group::Install breakpad dependencies"
cargo install dump_syms
cargo install --locked dump_syms
echo "::endgroup::"
- name: Install MSVC problem matcher
@@ -95,21 +100,6 @@ jobs:
with:
arch: ${{ matrix.host }}
- name: Import code signing certificate
shell: powershell
# If this is run on a fork, there may not be a certificate set up - continue in this case
continue-on-error: true
run: |
$tempFile = [System.IO.Path]::GetTempFileName()
$bytes = [System.Convert]::FromBase64String($env:WINDOWS_CERTIFICATE_P12)
[IO.File]::WriteAllBytes($tempFile, $bytes)
$pwd = ConvertTo-SecureString $env:WINDOWS_CERTIFICATE_PASSWORD -AsPlainText -Force
Import-PfxCertificate -FilePath $tempFile -CertStoreLocation Cert:\CurrentUser\My -Password $pwd
Remove-Item $tempFile
env:
WINDOWS_CERTIFICATE_P12: ${{ secrets.WINDOWS_CERTIFICATE_P12 }}
WINDOWS_CERTIFICATE_PASSWORD: ${{ secrets.WINDOWS_CERTIFICATE_PASSWORD }}
- name: Build (with installer)
if: inputs.is_tag == 'true'
shell: bash
@@ -121,12 +111,11 @@ jobs:
cmake ${GITHUB_WORKSPACE} \
-GNinja \
-DVCPKG_TARGET_TRIPLET=${{ matrix.arch }}-windows-static \
-DCMAKE_TOOLCHAIN_FILE="c:\vcpkg\scripts\buildsystems\vcpkg.cmake" \
-DCMAKE_TOOLCHAIN_FILE="${{ runner.temp }}\vcpkg\scripts\buildsystems\vcpkg.cmake" \
-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::"
@@ -134,7 +123,12 @@ jobs:
cmake --build . --target openttd
echo "::endgroup::"
env:
WINDOWS_CERTIFICATE_COMMON_NAME: ${{ secrets.WINDOWS_CERTIFICATE_COMMON_NAME }}
AZURE_TENANT_ID: ${{ secrets.AZURE_TENANT_ID }}
AZURE_CLIENT_ID: ${{ secrets.AZURE_CLIENT_ID }}
AZURE_CLIENT_SECRET: ${{ secrets.AZURE_CLIENT_SECRET }}
AZURE_CODESIGN_ACCOUNT_NAME: ${{ secrets.AZURE_CODESIGN_ACCOUNT_NAME }}
AZURE_CODESIGN_ENDPOINT: ${{ secrets.AZURE_CODESIGN_ENDPOINT }}
AZURE_CODESIGN_PROFILE_NAME: ${{ secrets.AZURE_CODESIGN_PROFILE_NAME }}
- name: Build (without installer)
if: inputs.is_tag != 'true'
@@ -147,11 +141,10 @@ jobs:
cmake ${GITHUB_WORKSPACE} \
-GNinja \
-DVCPKG_TARGET_TRIPLET=${{ matrix.arch }}-windows-static \
-DCMAKE_TOOLCHAIN_FILE="c:\vcpkg\scripts\buildsystems\vcpkg.cmake" \
-DCMAKE_TOOLCHAIN_FILE="${{ runner.temp }}\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::"
@@ -159,7 +152,12 @@ jobs:
cmake --build . --target openttd
echo "::endgroup::"
env:
WINDOWS_CERTIFICATE_COMMON_NAME: ${{ secrets.WINDOWS_CERTIFICATE_COMMON_NAME }}
AZURE_TENANT_ID: ${{ secrets.AZURE_TENANT_ID }}
AZURE_CLIENT_ID: ${{ secrets.AZURE_CLIENT_ID }}
AZURE_CLIENT_SECRET: ${{ secrets.AZURE_CLIENT_SECRET }}
AZURE_CODESIGN_ACCOUNT_NAME: ${{ secrets.AZURE_CODESIGN_ACCOUNT_NAME }}
AZURE_CODESIGN_ENDPOINT: ${{ secrets.AZURE_CODESIGN_ENDPOINT }}
AZURE_CODESIGN_PROFILE_NAME: ${{ secrets.AZURE_CODESIGN_PROFILE_NAME }}
- name: Create breakpad symbols
shell: bash
@@ -193,13 +191,15 @@ jobs:
- name: Sign installer
if: inputs.is_tag == 'true'
shell: bash
# If this is run on a fork, there may not be a certificate set up - continue in this case
continue-on-error: true
run: |
cd ${GITHUB_WORKSPACE}/build/bundles
../../os/windows/sign.bat *.exe "${WINDOWS_CERTIFICATE_COMMON_NAME}"
${GITHUB_WORKSPACE}/os/windows/sign.bat "${GITHUB_WORKSPACE}/build/bundles"
env:
WINDOWS_CERTIFICATE_COMMON_NAME: ${{ secrets.WINDOWS_CERTIFICATE_COMMON_NAME }}
AZURE_TENANT_ID: ${{ secrets.AZURE_TENANT_ID }}
AZURE_CLIENT_ID: ${{ secrets.AZURE_CLIENT_ID }}
AZURE_CLIENT_SECRET: ${{ secrets.AZURE_CLIENT_SECRET }}
AZURE_CODESIGN_ACCOUNT_NAME: ${{ secrets.AZURE_CODESIGN_ACCOUNT_NAME }}
AZURE_CODESIGN_ENDPOINT: ${{ secrets.AZURE_CODESIGN_ENDPOINT }}
AZURE_CODESIGN_PROFILE_NAME: ${{ secrets.AZURE_CODESIGN_PROFILE_NAME }}
- name: Store bundles
uses: actions/upload-artifact@v4

View File

@@ -11,7 +11,7 @@ jobs:
upload:
name: Upload (GOG)
runs-on: ubuntu-20.04
runs-on: ubuntu-latest
steps:
- name: Download source
@@ -62,9 +62,10 @@ jobs:
echo "::group::Unpack OpenGFX"
unzip opengfx-all.zip
tar xf opengfx-*.tar
echo "::endgroup::"
rm -f opengfx-all.zip
rm -f opengfx-all.zip opengfx-*.tar
- name: Install OpenMSX
shell: bash

View File

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

View File

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

View File

@@ -10,6 +10,8 @@ What is simple to some might appear very complicated to others. Documentation he
* Function names use [CamelCase](http://www.wikipedia.org/wiki/Camelcase) without underscores.
* Opening curly bracket **{** for a function starts on the next line.
* Use Foo() instead of Foo(void).
* Prefer using "const" for reference and compound parameters when appropriate.
* If a member function can be a const function, make it so.
```c++
void ThisIsAFunction()
{
@@ -157,7 +159,7 @@ enum SomeEnumeration {
* Use curly braces and put the contained statements on their own lines (e.g., don't put them directly after the **if**).
* Opening curly bracket **{** stays on the first line, closing curly bracket **}** gets a line to itself (except for the **}** preceding an **else**, which should be on the same line as the **else**).
* When only a single statement is contained, the brackets can be omitted. In this case, put the single statement on the same line as the preceding keyword (**if**, **while**, etc.). Note that this is only allowed for if statements without an **else** clause.
* All fall throughs must be documented, using a **FALLTHROUGH** define/macro.
* Non-trivial fall throughs must be documented, using a `[[fallthrough]]` attribute.
* The NOT_REACHED() macro can be used in default constructs that should never be reached.
* Unconditional loops are written with **`for (;;) {`**
@@ -180,7 +182,7 @@ switch (a) {
case 1:
DoSomething();
FALLTHROUGH;
[[fallthrough]];
case 2:
DoMore();
@@ -191,7 +193,7 @@ switch (a) {
int r = 2;
DoEvenMore(a);
FALLTHROUGH;
[[fallthrough]];
}
case 4: {
@@ -248,17 +250,50 @@ Templates are a very powerful C++ tool, but they can easily confuse beginners. T
* Templates are to be documented in a very clear and verbose manner. Never assume anything in the documentation.
* the template keyword and the template layout get a separate line. typenames are either "T" or preceded by a "T", integers get a single capital letter or a descriptive name preceded by "T".
```c++
template <typename T, typename Tsomething, int N, byte Tnumber_of_something>
template <typename T, typename Tsomething, int N, uint8_t Tnumber_of_something>
int Func();
```
* If you are writing one or more template class in the dedicated header file, use file.hpp for its name instead of file.h. This will let others know that it is template library (includes also implementation), not just header with declarations.
### Code Comment Vertical Alignment
When adding code or comments to an existing formatted section, follow the existing style if possible without editing the preexisting lines.
If your addition cannot be aligned with existing code, do not align the comments with anything and use only a single space between the code and the comment.
Good:
```c++
enum Vehicle {
BUS, ///< Take the bus.
+ CAR, ///< Drive your car.
BIKE, ///< Ride your bike
+ TRAIN, ///< Catch the train.
}
```
"Car" is shorter than Bike which allows you to easily align the new comment. "Train" is longer. It is *NOT* desirable to change the vertical comment alignment of this enum.
Bad:
```c++
enum Vehicle {
- BUS, ///< Take the bus.
- BIKE, ///< Ride your bike
+ BUS, ///< Take the bus.
+ CAR, ///< Drive your car.
+ BIKE, ///< Ride your bike
+ TRAIN, ///< Catch the train.
}
```
OpenTTD used to vertically-align inline Doxygen comments as shown above. OpenTTD has since stopped strictly following this rule to keep diffs smaller and reduce pollution to the git blame history for non-functional changes.
### Other important rules
* Put a space before and after binary operators: "a + b", "a == b", "a & b", "a <<= b", etc.. Exceptions are ".", "->" and "[]" (no spaces) and "," (just space after it).
* Put parenthesis where it improves readability: "*(b++)" instead of "*b++", and "if ((a & b) && c == 2)" instead of "if (a & b && c == 2)".
* Do not put external declarations in implementation (i.e. cpp) files.
* Use const where possible.
* Do not typedef enums and structs.
* Don't treat non-flags as flags: use "if (char_pointer != nullptr && *char_pointer != '\0')", not "if (char_pointer && *char_pointer)".
* Use "free(p)" instead of "if (p != nullptr) free(p)". "free(nullptr)" doesn't hurt anyone.
@@ -416,36 +451,57 @@ There is a check-script on the git server (also available for clients, see below
The first line of a message must match:
```
<keyword>( #<issue>| <commit>(, (<keyword> #<issue>|<commit>))*)?: ([<section])? <Details>
<keyword>( #<issue>|<commit>(, (#<issue>|<commit>))*)?: ([<component>])? <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.
Keywords can either be player-facing, NewGRF / Script author-facing, or developer-facing.
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.
For player-facing changes, we have these keywords:
* Feature: Adding a significant new functionality to the game. This can be small in code-size, but is meant for the bigger things from a player perspective.
* Add: Similar to Feature, but for small functionalities.
* Change: Changing existing behaviour to an extent the player needs to know about it.
* Fix: Fixing an issue with the game (as seen by the player).
* Remove: Completely removing a functionality.
* Revert: Reverting an earlier Feature / Add / Change / Fix / Remove.
* Doc: Update to (player-facing) documentation, like in the `docs/` folder etc.
* Update: Translator commits.
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
For NewGRF / Script author-facing changes, we use the same keywords as player-facing changes, followed by `[NewGRF]` / `[Script]` component.
This also means the commit is aimed (and worded) towards the NewGRF / Script authors, rather than players.
Further explanations, general bitching, etc. don't go into the first line. Use a new line for those.
For developer-facing changes, we have these keywords:
* Codechange: Changes to the code the player is not going to notice. Refactors, modernization, etc.
* Cleanup: Similar to Codechange, but when it is more about removing old code, rather than an actual change.
* Codefix: Fixing problems in earlier commits that the player is not actually going to notice. Wrong comments, missing files, CI changes.
If you commit a `Fix` for an [issue](https://github.com/OpenTTD/OpenTTD/issues), add the corresponding issue number in the form of #NNNNN.
In the case of `Fix`es, if you know the hash of the commit in which the bug was introduced (eg regression), please mention that hash (the first 7 characters) as well just after the keyword (or, if present, after the issue number).
Finding the trouble-causing commit is highly encouraged as it makes backporting / branching / releases that much easier.
Do not mention two keywords; if two apply, pick one that best represents the commit (for example, "Fix #123" is mostly always better than "Revert", even if both are true).
The `<details>` part starts with a capital and does not end with a dot.
Try to be descriptive to what the player will notice, not to what is actually being changed in the code.
See `changelog.md` for inspiration.
To further structure the changelog, you can add components. Example are:
* "Network" for network specific changes.
* "NewGRF" for NewGRF additions.
* "Script" for AI / GS additions.
* "YAPF", "NPF", for changes in these features.
* "MacOS", "Linux", "Windows", for OS-specific changes.
* "CI", "CMake", for changes to the (build) infrastructure.
Further explanations, more details, 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.
* `Fix: [YAPF] Infinite loop in pathfinder`
* `Fix #5926: [YAPF] Infinite loop in pathfinder`
* `Codefix 80dffae: Warning about unsigned unary minus`
* `Fix #6673, 99bb3a9: Store the map variety setting in the savegame`
* `Codefix #5922: ClientSizeChanged is only called via WndProcGdi which already has the mutex`
* `Codechange #1264, #2037, #2038, #2110: Rewrite the autoreplace kernel`
## Other tips

View File

@@ -29,7 +29,7 @@ open most older savegames or use the content downloading system.
## Windows
You need Microsoft Visual Studio 2017 or more recent.
You need Microsoft Visual Studio 2022 or more recent.
You can download the free Visual Studio Community Edition from Microsoft at
https://visualstudio.microsoft.com/vs/community/.
@@ -65,7 +65,7 @@ To install both the x64 (64bit) and x86 (32bit) variants (though only one is nec
You can open the folder (as a CMake project). CMake will be detected, and you can compile from there.
If libraries are installed but not found, you need to set VCPKG_TARGET_TRIPLET in CMake parameters.
For Visual Studio 2017 you also need to set CMAKE_TOOLCHAIN_FILE.
For Visual Studio 2022 you also need to set CMAKE_TOOLCHAIN_FILE.
(Typical values are shown in the MSVC project file command line example)
Alternatively, you can create a MSVC project file via CMake. For this
@@ -75,7 +75,7 @@ that comes with vcpkg. After that, you can run something similar to this:
```powershell
mkdir build
cd build
cmake.exe .. -G"Visual Studio 16 2019" -DCMAKE_TOOLCHAIN_FILE="<location of vcpkg>\vcpkg\scripts\buildsystems\vcpkg.cmake" -DVCPKG_TARGET_TRIPLET="x64-windows-static"
cmake.exe .. -G"Visual Studio 17 2022" -DCMAKE_TOOLCHAIN_FILE="<location of vcpkg>\vcpkg\scripts\buildsystems\vcpkg.cmake" -DVCPKG_TARGET_TRIPLET="x64-windows-static"
```
Change `<location of vcpkg>` to where you have installed vcpkg. After this
@@ -83,7 +83,7 @@ in the build folder are MSVC project files. MSVC can rebuild the project
files himself via the `ZERO_CHECK` project.
## All other platforms
Minimum required version of CMake is 3.9.
Minimum required version of CMake is 3.16.
By default this produces a Debug build with assertations enabled.
This is a far slower build than release builds.
@@ -110,17 +110,14 @@ builds.
- `-DOPTION_USE_ASSERTS=OFF`: disable asserts. Use with care, as assert
statements capture early signs of trouble. Release builds have them
disabled by default.
- `-DOPTION_USE_THREADS=OFF`: disable the use of threads. This will block
the interface in many places, and in general gives a worse experience of
the game. Use with care.
- `-DOPTION_TOOLS_ONLY=ON`: only build tools like `strgen`. Does not build
the game itself. Useful for cross-compiling.
## Supported compilers
Every compiler that is supported by CMake and supports C++17, should be
Every compiler that is supported by CMake and supports C++20, should be
able to compile OpenTTD. As the exact list of compilers changes constantly,
we refer to the compiler manual to see if it supports C++17, and to CMake
we refer to the compiler manual to see if it supports C++20, and to CMake
to see if it supports your compiler.
## Compilation of base sets

View File

@@ -3,14 +3,16 @@
- Matthijs Kooijman (blathijs) - Pathfinder-guru, Debian port (since 0.3)
- Christoph Elsenhans (frosch) - General coding (since 0.6)
- Loïc Guilloux (glx) - General / Windows Expert (since 0.4.5)
- Koen Bussemaker (Kuhnovic) - General / Ship pathfinder (since 14)
- Charles Pigott (LordAro) - General / Correctness police (since 1.9)
- Michael Lutz (michi_cc) - General / Path based signals (since 0.7)
- Niels Martin Hansen (nielsm) - Music system, general coding (since 1.9)
- Owen Rudge (orudge) - Forum host, OS/2 port (since 0.1)
- Peter Nelson (peter1138) - Spiritual descendant from newGRF gods (since 0.4.5)
- Peter Nelson (peter1138) - Spiritual descendant from NewGRF gods (since 0.4.5)
- Remko Bijker (Rubidium) - Coder and way more (since 0.4.5)
- Patric Stout (TrueBrain) - NoProgrammer (since 0.3), sys op
- Tyler Trahan (2TallTyler) - General coding (since 13)
- Tyler Trahan (2TallTyler) - General / Time Lord (since 13)
- Richard Wheeler (zephyris) - Precision pixel production (since 15)
### Inactive Developers:

View File

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

View File

@@ -212,6 +212,9 @@ See `src/3rdparty/monocypher/LICENSE.md` for the complete license text.
The OpenTTD Social Integration API in `src/3rdparty/openttd_social_integration_api` is licensed under the MIT license.
See `src/3rdparty/openttd_social_integration_api/LICENSE` for the complete license text.
The atomic datatype support detection in `cmake/3rdparty/llvm/CheckAtomic.cmake` is licensed under the Apache 2.0 license.
See `cmake/3rdparty/llvm/LICENSE.txt` for the complete license text.
## 4.0 Credits
See [CREDITS.md](./CREDITS.md)

View File

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

View File

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

View File

@@ -5,7 +5,7 @@
* See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with OpenTTD. If not, see <http://www.gnu.org/licenses/>.
*/
AILog.Info("1.1 API compatibility in effect.");
/* This file contains code to downgrade the API from 1.2 to 1.1. */
AICompany.GetCompanyValue <- function(company)
{
@@ -54,30 +54,3 @@ AIOrder.AIOF_UNLOAD_FLAGS <- AIOrder.OF_UNLOAD_FLAGS
AIOrder.AIOF_LOAD_FLAGS <- AIOrder.OF_LOAD_FLAGS
AIOrder.AIOF_DEPOT_FLAGS <- AIOrder.OF_DEPOT_FLAGS
AIOrder.AIOF_INVALID <- AIOrder.OF_INVALID
/* 1.9 adds a vehicle type parameter. */
AIBridge._GetName <- AIBridge.GetName;
AIBridge.GetName <- function(bridge_id)
{
return AIBridge._GetName(bridge_id, AIVehicle.VT_RAIL);
}
/* 1.9 adds parent_group_id to CreateGroup function */
AIGroup._CreateGroup <- AIGroup.CreateGroup;
AIGroup.CreateGroup <- function(vehicle_type)
{
return AIGroup._CreateGroup(vehicle_type, AIGroup.GROUP_INVALID);
}
/* 13 really checks RoadType against RoadType */
AIRoad._HasRoadType <- AIRoad.HasRoadType;
AIRoad.HasRoadType <- function(tile, road_type)
{
local list = AIRoadTypeList(AIRoad.GetRoadTramType(road_type));
foreach (rt, _ in list) {
if (AIRoad._HasRoadType(tile, rt)) {
return true;
}
}
return false;
}

View File

@@ -5,17 +5,4 @@
* See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with OpenTTD. If not, see <http://www.gnu.org/licenses/>.
*/
AILog.Info("1.10 API compatibility in effect.");
/* 13 really checks RoadType against RoadType */
AIRoad._HasRoadType <- AIRoad.HasRoadType;
AIRoad.HasRoadType <- function(tile, road_type)
{
local list = AIRoadTypeList(AIRoad.GetRoadTramType(road_type));
foreach (rt, _ in list) {
if (AIRoad._HasRoadType(tile, rt)) {
return true;
}
}
return false;
}
/* This file contains code to downgrade the API from 1.11 to 1.10. */

View File

@@ -5,17 +5,4 @@
* See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with OpenTTD. If not, see <http://www.gnu.org/licenses/>.
*/
AILog.Info("1.11 API compatibility in effect.");
/* 13 really checks RoadType against RoadType */
AIRoad._HasRoadType <- AIRoad.HasRoadType;
AIRoad.HasRoadType <- function(tile, road_type)
{
local list = AIRoadTypeList(AIRoad.GetRoadTramType(road_type));
foreach (rt, _ in list) {
if (AIRoad._HasRoadType(tile, rt)) {
return true;
}
}
return false;
}
/* This file contains code to downgrade the API from 12 to 1.11. */

View File

@@ -5,31 +5,4 @@
* See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with OpenTTD. If not, see <http://www.gnu.org/licenses/>.
*/
AILog.Info("1.2 API compatibility in effect.");
/* 1.9 adds a vehicle type parameter. */
AIBridge._GetName <- AIBridge.GetName;
AIBridge.GetName <- function(bridge_id)
{
return AIBridge._GetName(bridge_id, AIVehicle.VT_RAIL);
}
/* 1.9 adds parent_group_id to CreateGroup function */
AIGroup._CreateGroup <- AIGroup.CreateGroup;
AIGroup.CreateGroup <- function(vehicle_type)
{
return AIGroup._CreateGroup(vehicle_type, AIGroup.GROUP_INVALID);
}
/* 13 really checks RoadType against RoadType */
AIRoad._HasRoadType <- AIRoad.HasRoadType;
AIRoad.HasRoadType <- function(tile, road_type)
{
local list = AIRoadTypeList(AIRoad.GetRoadTramType(road_type));
foreach (rt, _ in list) {
if (AIRoad._HasRoadType(tile, rt)) {
return true;
}
}
return false;
}
/* This file contains code to downgrade the API from 1.3 to 1.2. */

View File

@@ -5,31 +5,4 @@
* See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with OpenTTD. If not, see <http://www.gnu.org/licenses/>.
*/
AILog.Info("1.3 API compatibility in effect.");
/* 1.9 adds a vehicle type parameter. */
AIBridge._GetName <- AIBridge.GetName;
AIBridge.GetName <- function(bridge_id)
{
return AIBridge._GetName(bridge_id, AIVehicle.VT_RAIL);
}
/* 1.9 adds parent_group_id to CreateGroup function */
AIGroup._CreateGroup <- AIGroup.CreateGroup;
AIGroup.CreateGroup <- function(vehicle_type)
{
return AIGroup._CreateGroup(vehicle_type, AIGroup.GROUP_INVALID);
}
/* 13 really checks RoadType against RoadType */
AIRoad._HasRoadType <- AIRoad.HasRoadType;
AIRoad.HasRoadType <- function(tile, road_type)
{
local list = AIRoadTypeList(AIRoad.GetRoadTramType(road_type));
foreach (rt, _ in list) {
if (AIRoad._HasRoadType(tile, rt)) {
return true;
}
}
return false;
}
/* This file contains code to downgrade the API from 1.4 to 1.3. */

View File

@@ -5,31 +5,4 @@
* See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with OpenTTD. If not, see <http://www.gnu.org/licenses/>.
*/
AILog.Info("1.4 API compatibility in effect.");
/* 1.9 adds a vehicle type parameter. */
AIBridge._GetName <- AIBridge.GetName;
AIBridge.GetName <- function(bridge_id)
{
return AIBridge._GetName(bridge_id, AIVehicle.VT_RAIL);
}
/* 1.9 adds parent_group_id to CreateGroup function */
AIGroup._CreateGroup <- AIGroup.CreateGroup;
AIGroup.CreateGroup <- function(vehicle_type)
{
return AIGroup._CreateGroup(vehicle_type, AIGroup.GROUP_INVALID);
}
/* 13 really checks RoadType against RoadType */
AIRoad._HasRoadType <- AIRoad.HasRoadType;
AIRoad.HasRoadType <- function(tile, road_type)
{
local list = AIRoadTypeList(AIRoad.GetRoadTramType(road_type));
foreach (rt, _ in list) {
if (AIRoad._HasRoadType(tile, rt)) {
return true;
}
}
return false;
}
/* This file contains code to downgrade the API from 1.5 to 1.4. */

View File

@@ -5,31 +5,4 @@
* See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with OpenTTD. If not, see <http://www.gnu.org/licenses/>.
*/
AILog.Info("1.5 API compatibility in effect.");
/* 1.9 adds a vehicle type parameter. */
AIBridge._GetName <- AIBridge.GetName;
AIBridge.GetName <- function(bridge_id)
{
return AIBridge._GetName(bridge_id, AIVehicle.VT_RAIL);
}
/* 1.9 adds parent_group_id to CreateGroup function */
AIGroup._CreateGroup <- AIGroup.CreateGroup;
AIGroup.CreateGroup <- function(vehicle_type)
{
return AIGroup._CreateGroup(vehicle_type, AIGroup.GROUP_INVALID);
}
/* 13 really checks RoadType against RoadType */
AIRoad._HasRoadType <- AIRoad.HasRoadType;
AIRoad.HasRoadType <- function(tile, road_type)
{
local list = AIRoadTypeList(AIRoad.GetRoadTramType(road_type));
foreach (rt, _ in list) {
if (AIRoad._HasRoadType(tile, rt)) {
return true;
}
}
return false;
}
/* This file contains code to downgrade the API from 1.6 to 1.5. */

View File

@@ -5,31 +5,4 @@
* See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with OpenTTD. If not, see <http://www.gnu.org/licenses/>.
*/
AILog.Info("1.6 API compatibility in effect.");
/* 1.9 adds a vehicle type parameter. */
AIBridge._GetName <- AIBridge.GetName;
AIBridge.GetName <- function(bridge_id)
{
return AIBridge._GetName(bridge_id, AIVehicle.VT_RAIL);
}
/* 1.9 adds parent_group_id to CreateGroup function */
AIGroup._CreateGroup <- AIGroup.CreateGroup;
AIGroup.CreateGroup <- function(vehicle_type)
{
return AIGroup._CreateGroup(vehicle_type, AIGroup.GROUP_INVALID);
}
/* 13 really checks RoadType against RoadType */
AIRoad._HasRoadType <- AIRoad.HasRoadType;
AIRoad.HasRoadType <- function(tile, road_type)
{
local list = AIRoadTypeList(AIRoad.GetRoadTramType(road_type));
foreach (rt, _ in list) {
if (AIRoad._HasRoadType(tile, rt)) {
return true;
}
}
return false;
}
/* This file contains code to downgrade the API from 1.7 to 1.6. */

View File

@@ -5,31 +5,4 @@
* See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with OpenTTD. If not, see <http://www.gnu.org/licenses/>.
*/
AILog.Info("1.7 API compatibility in effect.");
/* 1.9 adds a vehicle type parameter. */
AIBridge._GetName <- AIBridge.GetName;
AIBridge.GetName <- function(bridge_id)
{
return AIBridge._GetName(bridge_id, AIVehicle.VT_RAIL);
}
/* 1.9 adds parent_group_id to CreateGroup function */
AIGroup._CreateGroup <- AIGroup.CreateGroup;
AIGroup.CreateGroup <- function(vehicle_type)
{
return AIGroup._CreateGroup(vehicle_type, AIGroup.GROUP_INVALID);
}
/* 13 really checks RoadType against RoadType */
AIRoad._HasRoadType <- AIRoad.HasRoadType;
AIRoad.HasRoadType <- function(tile, road_type)
{
local list = AIRoadTypeList(AIRoad.GetRoadTramType(road_type));
foreach (rt, _ in list) {
if (AIRoad._HasRoadType(tile, rt)) {
return true;
}
}
return false;
}
/* This file contains code to downgrade the API from 1.8 to 1.7. */

View File

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

View File

@@ -5,17 +5,4 @@
* See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with OpenTTD. If not, see <http://www.gnu.org/licenses/>.
*/
AILog.Info("1.9 API compatibility in effect.");
/* 13 really checks RoadType against RoadType */
AIRoad._HasRoadType <- AIRoad.HasRoadType;
AIRoad.HasRoadType <- function(tile, road_type)
{
local list = AIRoadTypeList(AIRoad.GetRoadTramType(road_type));
foreach (rt, _ in list) {
if (AIRoad._HasRoadType(tile, rt)) {
return true;
}
}
return false;
}
/* This file contains code to downgrade the API from 1.10 to 1.9. */

View File

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

View File

@@ -5,4 +5,4 @@
* See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with OpenTTD. If not, see <http://www.gnu.org/licenses/>.
*/
AILog.Info("13 API compatibility in effect.");
/* This file contains code to downgrade the API from 14 to 13. */

View File

@@ -4,3 +4,35 @@
* OpenTTD is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
* See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with OpenTTD. If not, see <http://www.gnu.org/licenses/>.
*/
/* This file contains code to downgrade the API from 15 to 14. */
AIBridge.GetBridgeID <- AIBridge.GetBridgeType;
class AICompat14 {
function Text(text)
{
if (typeof text == "string") return text;
return null;
}
}
AIBaseStation.SetNameCompat14 <- AIBaseStation.SetName;
AIBaseStation.SetName <- function(id, name) { return AIBaseStation.SetNameCompat14(id, AICompat14.Text(name)); }
AICompany.SetNameCompat14 <- AICompany.SetName;
AICompany.SetName <- function(name) { return AICompany.SetNameCompat14(AICompat14.Text(name)); }
AICompany.SetPresidentNameCompat14 <- AICompany.SetPresidentName;
AICompany.SetPresidentName <- function(name) { return AICompany.SetPresidentNameCompat14(AICompat14.Text(name)); }
AIGroup.SetNameCompat14 <- AIGroup.SetName;
AIGroup.SetName <- function(id, name) { return AIGroup.SetNameCompat14(id, AICompat14.Text(name)); }
AISign.BuildSignCompat14 <- AISign.BuildSign;
AISign.BuildSign <- function(id, name) { return AISign.BuildSignCompat14(id, AICompat14.Text(name)); }
AITown.FoundTownCompat14 <- AITown.FoundTown;
AITown.FoundTown <- function(tile, size, city, layout, name) { return AITown.FoundTownCompat14(tile, size, city, layout, AICompat14.Text(name)); }
AIVehicle.SetNameCompat14 <- AIVehicle.SetName;
AIVehicle.SetName <- function(id, name) { return AIVehicle.SetNameCompat14(id, AICompat14.Text(name)); }

View File

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

View File

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

View File

@@ -5,46 +5,4 @@
* See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with OpenTTD. If not, see <http://www.gnu.org/licenses/>.
*/
GSLog.Info("1.2 API compatibility in effect.");
GSTown._SetGrowthRate <- GSTown.SetGrowthRate;
GSTown.SetGrowthRate <- function(town_id, days_between_town_growth)
{
/* Growth rate 0 caused resetting the custom growth rate. While this was undocumented, it was used nevertheless (ofc). */
if (days_between_town_growth == 0) days_between_town_growth = GSTown.TOWN_GROWTH_NORMAL;
return GSTown._SetGrowthRate(town_id, days_between_town_growth);
}
/* 1.5 adds a game element reference to the news. */
GSNews._Create <- GSNews.Create;
GSNews.Create <- function(type, text, company)
{
return GSNews._Create(type, text, company, GSNews.NR_NONE, 0);
}
/* 1.9 adds a vehicle type parameter. */
GSBridge._GetName <- GSBridge.GetName;
GSBridge.GetName <- function(bridge_id)
{
return GSBridge._GetName(bridge_id, GSVehicle.VT_RAIL);
}
/* 1.11 adds a tile parameter. */
GSCompany._ChangeBankBalance <- GSCompany.ChangeBankBalance;
GSCompany.ChangeBankBalance <- function(company, delta, expenses_type)
{
return GSCompany._ChangeBankBalance(company, delta, expenses_type, GSMap.TILE_INVALID);
}
/* 13 really checks RoadType against RoadType */
GSRoad._HasRoadType <- GSRoad.HasRoadType;
GSRoad.HasRoadType <- function(tile, road_type)
{
local list = GSRoadTypeList(GSRoad.GetRoadTramType(road_type));
foreach (rt, _ in list) {
if (GSRoad._HasRoadType(tile, rt)) {
return true;
}
}
return false;
}
/* This file contains code to downgrade the API from 1.3 to 1.2. */

View File

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

View File

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

View File

@@ -5,31 +5,4 @@
* See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with OpenTTD. If not, see <http://www.gnu.org/licenses/>.
*/
GSLog.Info("1.5 API compatibility in effect.");
/* 1.9 adds a vehicle type parameter. */
GSBridge._GetName <- GSBridge.GetName;
GSBridge.GetName <- function(bridge_id)
{
return GSBridge._GetName(bridge_id, GSVehicle.VT_RAIL);
}
/* 1.11 adds a tile parameter. */
GSCompany._ChangeBankBalance <- GSCompany.ChangeBankBalance;
GSCompany.ChangeBankBalance <- function(company, delta, expenses_type)
{
return GSCompany._ChangeBankBalance(company, delta, expenses_type, GSMap.TILE_INVALID);
}
/* 13 really checks RoadType against RoadType */
GSRoad._HasRoadType <- GSRoad.HasRoadType;
GSRoad.HasRoadType <- function(tile, road_type)
{
local list = GSRoadTypeList(GSRoad.GetRoadTramType(road_type));
foreach (rt, _ in list) {
if (GSRoad._HasRoadType(tile, rt)) {
return true;
}
}
return false;
}
/* This file contains code to downgrade the API from 1.6 to 1.5. */

View File

@@ -5,31 +5,4 @@
* See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with OpenTTD. If not, see <http://www.gnu.org/licenses/>.
*/
GSLog.Info("1.6 API compatibility in effect.");
/* 1.9 adds a vehicle type parameter. */
GSBridge._GetName <- GSBridge.GetName;
GSBridge.GetName <- function(bridge_id)
{
return GSBridge._GetName(bridge_id, GSVehicle.VT_RAIL);
}
/* 1.11 adds a tile parameter. */
GSCompany._ChangeBankBalance <- GSCompany.ChangeBankBalance;
GSCompany.ChangeBankBalance <- function(company, delta, expenses_type)
{
return GSCompany._ChangeBankBalance(company, delta, expenses_type, GSMap.TILE_INVALID);
}
/* 13 really checks RoadType against RoadType */
GSRoad._HasRoadType <- GSRoad.HasRoadType;
GSRoad.HasRoadType <- function(tile, road_type)
{
local list = GSRoadTypeList(GSRoad.GetRoadTramType(road_type));
foreach (rt, _ in list) {
if (GSRoad._HasRoadType(tile, rt)) {
return true;
}
}
return false;
}
/* This file contains code to downgrade the API from 1.7 to 1.6. */

View File

@@ -5,31 +5,4 @@
* See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with OpenTTD. If not, see <http://www.gnu.org/licenses/>.
*/
GSLog.Info("1.7 API compatibility in effect.");
/* 1.9 adds a vehicle type parameter. */
GSBridge._GetName <- GSBridge.GetName;
GSBridge.GetName <- function(bridge_id)
{
return GSBridge._GetName(bridge_id, GSVehicle.VT_RAIL);
}
/* 1.11 adds a tile parameter. */
GSCompany._ChangeBankBalance <- GSCompany.ChangeBankBalance;
GSCompany.ChangeBankBalance <- function(company, delta, expenses_type)
{
return GSCompany._ChangeBankBalance(company, delta, expenses_type, GSMap.TILE_INVALID);
}
/* 13 really checks RoadType against RoadType */
GSRoad._HasRoadType <- GSRoad.HasRoadType;
GSRoad.HasRoadType <- function(tile, road_type)
{
local list = GSRoadTypeList(GSRoad.GetRoadTramType(road_type));
foreach (rt, _ in list) {
if (GSRoad._HasRoadType(tile, rt)) {
return true;
}
}
return false;
}
/* This file contains code to downgrade the API from 1.8 to 1.7. */

View File

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

View File

@@ -5,24 +5,4 @@
* See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with OpenTTD. If not, see <http://www.gnu.org/licenses/>.
*/
GSLog.Info("1.9 API compatibility in effect.");
/* 1.11 adds a tile parameter. */
GSCompany._ChangeBankBalance <- GSCompany.ChangeBankBalance;
GSCompany.ChangeBankBalance <- function(company, delta, expenses_type)
{
return GSCompany._ChangeBankBalance(company, delta, expenses_type, GSMap.TILE_INVALID);
}
/* 13 really checks RoadType against RoadType */
GSRoad._HasRoadType <- GSRoad.HasRoadType;
GSRoad.HasRoadType <- function(tile, road_type)
{
local list = GSRoadTypeList(GSRoad.GetRoadTramType(road_type));
foreach (rt, _ in list) {
if (GSRoad._HasRoadType(tile, rt)) {
return true;
}
}
return false;
}
/* This file contains code to downgrade the API from 1.10 to 1.9. */

View File

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

View File

@@ -5,4 +5,4 @@
* See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with OpenTTD. If not, see <http://www.gnu.org/licenses/>.
*/
GSLog.Info("13 API compatibility in effect.");
/* This file contains code to downgrade the API from 14 to 13. */

View File

@@ -4,3 +4,77 @@
* OpenTTD is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
* See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with OpenTTD. If not, see <http://www.gnu.org/licenses/>.
*/
/* This file contains code to downgrade the API from 15 to 14. */
GSBridge.GetBridgeID <- GSBridge.GetBridgeType;
class GSCompat14 {
function Text(text)
{
if (typeof text == "string") return text;
if (typeof text == "instance" && text instanceof GSText) return text;
return null;
}
}
GSBaseStation.SetNameCompat14 <- GSBaseStation.SetName;
GSBaseStation.SetName <- function(id, name) { return GSBaseStation.SetNameCompat14(id, GSCompat14.Text(name)); }
GSCompany.SetNameCompat14 <- GSCompany.SetName;
GSCompany.SetName <- function(name) { return GSCompany.SetNameCompat14(GSCompat14.Text(name)); }
GSCompany.SetPresidentNameCompat14 <- GSCompany.SetPresidentName;
GSCompany.SetPresidentName <- function(name) { return GSCompany.SetPresidentNameCompat14(GSCompat14.Text(name)); }
GSGoal.NewCompat14 <- GSGoal.New;
GSGoal.New <- function(company, goal, type, dest) { return GSGoal.NewCompat14(company, GSCompat14.Text(goal), type, dest); }
GSGoal.SetTextCompat14 <- GSGoal.SetText;
GSGoal.SetText <- function(id, goal) { return GSGoal.SetTextCompat14(id, GSCompat14.Text(goal)); }
GSGoal.SetProgressCompat14 <- GSGoal.SetProgress;
GSGoal.SetProgress <- function(id, progress) { return GSGoal.SetProgressCompat14(id, GSCompat14.Text(progress)); }
GSGoal.QuestionCompat14 <- GSGoal.Question;
GSGoal.Question <- function(id, company, question, type, buttons) { return GSGoal.QuestionCompat14(id, company, GSCompat14.Text(question), type, buttons); }
GSGoal.QuestionClientCompat14 <- GSGoal.QuestionClient;
GSGoal.QuestionClient <- function(id, target, is_client, question, type, buttons) { return GSGoal.QuestionClientCompat14(id, target, is_client, GSCompat14.Text(question), type, buttons); }
GSGroup.SetNameCompat14 <- GSGroup.SetName;
GSGroup.SetName <- function(id, name) { return GSGroup.SetNameCompat14(id, GSCompat14.Text(name)); }
GSIndustry.SetTextCompat14 <- GSIndustry.SetText;
GSIndustry.SetText <- function(id, text) { return GSIndustry.SetTextCompat14(id, GSCompat14.Text(text)); }
GSIndustry.SetProductionLevelCompat14 <- GSIndustry.SetProductionLevel;
GSIndustry.SetProductionLevel <- function(id, level, news, text) { return GSIndustry.SetProductionLevelCompat14(id, level, news, GSCompat14.Text(text)); }
GSLeagueTable.NewCompat14 <- GSLeagueTable.New;
GSLeagueTable.New <- function(title, header, footer) { return GSLeagueTable.NewCompat14(GSCompat14.Text(title), GSCompat14.Text(header), GSCompat14.Text(footer)); }
GSLeagueTable.NewElementCompat14 <- GSLeagueTable.NewElement;
GSLeagueTable.NewElement <- function(table, rating, company, text, score, type, target) { return GSLeagueTable.NewElementCompat14(table, rating, company, GSCompat14.Text(text), GSCompat14.Text(score), type, target); }
GSLeagueTable.UpdateElementDataCompat14 <- GSLeagueTable.UpdateElementData;
GSLeagueTable.UpdateElementData <- function(element, company, text, type, target) { return GSLeagueTable.UpdateElementDataCompat14(element, company, GSCompat14.Text(text), type, target); }
GSLeagueTable.UpdateElementScoreCompat14 <- GSLeagueTable.UpdateElementScore;
GSLeagueTable.UpdateElementScore <- function(element, rating, score) { return GSLeagueTable.UpdateElementScoreCompat14(element, rating, GSCompat14.Text(score)); }
GSNews.CreateCompat14 <- GSNews.Create;
GSNews.Create <- function(type, text, company, ref_type, ref) { return GSNews.CreateCompat14(type, GSCompat14.Text(text), company, ref_type, ref); }
GSSign.BuildSignCompat14 <- GSSign.BuildSign;
GSSign.BuildSign <- function(id, name) { return GSSign.BuildSignCompat14(id, GSCompat14.Text(name)); }
GSStoryPage.NewCompat14 <- GSStoryPage.New;
GSStoryPage.New <- function(company, title) { return GSStoryPage.NewCompat14(company, GSCompat14.Text(title)); }
GSStoryPage.NewElementCompat14 <- GSStoryPage.NewElement;
GSStoryPage.NewElement <- function(page, type, ref, text) { return GSStoryPage.NewElementCompat14(page, type, ref, GSCompat14.Text(text)); }
GSStoryPage.UpdateElementCompat14 <- GSStoryPage.UpdateElement;
GSStoryPage.UpdateElement <- function(id, ref, text) { return GSStoryPage.UpdateElementCompat14(id, ref, GSCompat14.Text(text)); }
GSStoryPage.SetTitleCompat14 <- GSStoryPage.SetTitle;
GSStoryPage.SetTitle <- function(page, tile) { return GSStoryPage.SetTitleCompat14(page, GSCompat14.Text(title)); }
GSTown.SetNameCompat14 <- GSTown.SetName;
GSTown.SetName <- function(id, name) { return GSTown.SetNameCompat14(id, GSCompat14.Text(name)); }
GSTown.SetTextCompat14 <- GSTown.SetText;
GSTown.SetText <- function(id, text) { return GSTown.SetTextCompat14(id, GSCompat14.Text(text)); }
GSTown.FoundTownCompat14 <- GSTown.FoundTown;
GSTown.FoundTown <- function(tile, size, city, layout, name) { return GSTown.FoundTownCompat14(tile, size, city, layout, GSCompat14.Text(name)); }
GSVehicle.SetNameCompat14 <- GSVehicle.SetName;
GSVehicle.SetName <- function(id, name) { return GSVehicle.SetNameCompat14(id, GSCompat14.Text(name)); }

File diff suppressed because it is too large Load Diff

View File

@@ -1,3 +1,11 @@
#
# This was originally part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
# See (https://llvm.org/)LICENSE.txt for license information.
# SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
#
# Modifications have been made to suit building OpenTTD.
#
# atomic builtins are required for threading support.
INCLUDE(CheckCXXSourceCompiles)
@@ -48,6 +56,8 @@ else()
check_working_cxx_atomics(HAVE_CXX_ATOMICS_WITHOUT_LIB)
# If not, check if the library exists, and atomics work with it.
if(NOT HAVE_CXX_ATOMICS_WITHOUT_LIB)
# check_library_exists requires the C-compiler as the atomic functions are built-in declared.
enable_language(C)
check_library_exists(atomic __atomic_fetch_add_4 "" HAVE_LIBATOMIC)
if(HAVE_LIBATOMIC)
list(APPEND CMAKE_REQUIRED_LIBRARIES "atomic")
@@ -69,6 +79,8 @@ else()
check_working_cxx_atomics64(HAVE_CXX_ATOMICS64_WITHOUT_LIB)
# If not, check if the library exists, and atomics work with it.
if(NOT HAVE_CXX_ATOMICS64_WITHOUT_LIB)
# check_library_exists requires the C-compiler as the atomic functions are built-in declared.
enable_language(C)
check_library_exists(atomic __atomic_load_8 "" HAVE_CXX_LIBATOMICS64)
if(HAVE_CXX_LIBATOMICS64)
list(APPEND CMAKE_REQUIRED_LIBRARIES "atomic")

279
cmake/3rdparty/llvm/LICENSE.txt vendored Normal file
View File

@@ -0,0 +1,279 @@
==============================================================================
The LLVM Project is under the Apache License v2.0 with LLVM Exceptions:
==============================================================================
Apache License
Version 2.0, January 2004
http://www.apache.org/licenses/
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
1. Definitions.
"License" shall mean the terms and conditions for use, reproduction,
and distribution as defined by Sections 1 through 9 of this document.
"Licensor" shall mean the copyright owner or entity authorized by
the copyright owner that is granting the License.
"Legal Entity" shall mean the union of the acting entity and all
other entities that control, are controlled by, or are under common
control with that entity. For the purposes of this definition,
"control" means (i) the power, direct or indirect, to cause the
direction or management of such entity, whether by contract or
otherwise, or (ii) ownership of fifty percent (50%) or more of the
outstanding shares, or (iii) beneficial ownership of such entity.
"You" (or "Your") shall mean an individual or Legal Entity
exercising permissions granted by this License.
"Source" form shall mean the preferred form for making modifications,
including but not limited to software source code, documentation
source, and configuration files.
"Object" form shall mean any form resulting from mechanical
transformation or translation of a Source form, including but
not limited to compiled object code, generated documentation,
and conversions to other media types.
"Work" shall mean the work of authorship, whether in Source or
Object form, made available under the License, as indicated by a
copyright notice that is included in or attached to the work
(an example is provided in the Appendix below).
"Derivative Works" shall mean any work, whether in Source or Object
form, that is based on (or derived from) the Work and for which the
editorial revisions, annotations, elaborations, or other modifications
represent, as a whole, an original work of authorship. For the purposes
of this License, Derivative Works shall not include works that remain
separable from, or merely link (or bind by name) to the interfaces of,
the Work and Derivative Works thereof.
"Contribution" shall mean any work of authorship, including
the original version of the Work and any modifications or additions
to that Work or Derivative Works thereof, that is intentionally
submitted to Licensor for inclusion in the Work by the copyright owner
or by an individual or Legal Entity authorized to submit on behalf of
the copyright owner. For the purposes of this definition, "submitted"
means any form of electronic, verbal, or written communication sent
to the Licensor or its representatives, including but not limited to
communication on electronic mailing lists, source code control systems,
and issue tracking systems that are managed by, or on behalf of, the
Licensor for the purpose of discussing and improving the Work, but
excluding communication that is conspicuously marked or otherwise
designated in writing by the copyright owner as "Not a Contribution."
"Contributor" shall mean Licensor and any individual or Legal Entity
on behalf of whom a Contribution has been received by Licensor and
subsequently incorporated within the Work.
2. Grant of Copyright License. Subject to the terms and conditions of
this License, each Contributor hereby grants to You a perpetual,
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
copyright license to reproduce, prepare Derivative Works of,
publicly display, publicly perform, sublicense, and distribute the
Work and such Derivative Works in Source or Object form.
3. Grant of Patent License. Subject to the terms and conditions of
this License, each Contributor hereby grants to You a perpetual,
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
(except as stated in this section) patent license to make, have made,
use, offer to sell, sell, import, and otherwise transfer the Work,
where such license applies only to those patent claims licensable
by such Contributor that are necessarily infringed by their
Contribution(s) alone or by combination of their Contribution(s)
with the Work to which such Contribution(s) was submitted. If You
institute patent litigation against any entity (including a
cross-claim or counterclaim in a lawsuit) alleging that the Work
or a Contribution incorporated within the Work constitutes direct
or contributory patent infringement, then any patent licenses
granted to You under this License for that Work shall terminate
as of the date such litigation is filed.
4. Redistribution. You may reproduce and distribute copies of the
Work or Derivative Works thereof in any medium, with or without
modifications, and in Source or Object form, provided that You
meet the following conditions:
(a) You must give any other recipients of the Work or
Derivative Works a copy of this License; and
(b) You must cause any modified files to carry prominent notices
stating that You changed the files; and
(c) You must retain, in the Source form of any Derivative Works
that You distribute, all copyright, patent, trademark, and
attribution notices from the Source form of the Work,
excluding those notices that do not pertain to any part of
the Derivative Works; and
(d) If the Work includes a "NOTICE" text file as part of its
distribution, then any Derivative Works that You distribute must
include a readable copy of the attribution notices contained
within such NOTICE file, excluding those notices that do not
pertain to any part of the Derivative Works, in at least one
of the following places: within a NOTICE text file distributed
as part of the Derivative Works; within the Source form or
documentation, if provided along with the Derivative Works; or,
within a display generated by the Derivative Works, if and
wherever such third-party notices normally appear. The contents
of the NOTICE file are for informational purposes only and
do not modify the License. You may add Your own attribution
notices within Derivative Works that You distribute, alongside
or as an addendum to the NOTICE text from the Work, provided
that such additional attribution notices cannot be construed
as modifying the License.
You may add Your own copyright statement to Your modifications and
may provide additional or different license terms and conditions
for use, reproduction, or distribution of Your modifications, or
for any such Derivative Works as a whole, provided Your use,
reproduction, and distribution of the Work otherwise complies with
the conditions stated in this License.
5. Submission of Contributions. Unless You explicitly state otherwise,
any Contribution intentionally submitted for inclusion in the Work
by You to the Licensor shall be under the terms and conditions of
this License, without any additional terms or conditions.
Notwithstanding the above, nothing herein shall supersede or modify
the terms of any separate license agreement you may have executed
with Licensor regarding such Contributions.
6. Trademarks. This License does not grant permission to use the trade
names, trademarks, service marks, or product names of the Licensor,
except as required for reasonable and customary use in describing the
origin of the Work and reproducing the content of the NOTICE file.
7. Disclaimer of Warranty. Unless required by applicable law or
agreed to in writing, Licensor provides the Work (and each
Contributor provides its Contributions) on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
implied, including, without limitation, any warranties or conditions
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
PARTICULAR PURPOSE. You are solely responsible for determining the
appropriateness of using or redistributing the Work and assume any
risks associated with Your exercise of permissions under this License.
8. Limitation of Liability. In no event and under no legal theory,
whether in tort (including negligence), contract, or otherwise,
unless required by applicable law (such as deliberate and grossly
negligent acts) or agreed to in writing, shall any Contributor be
liable to You for damages, including any direct, indirect, special,
incidental, or consequential damages of any character arising as a
result of this License or out of the use or inability to use the
Work (including but not limited to damages for loss of goodwill,
work stoppage, computer failure or malfunction, or any and all
other commercial damages or losses), even if such Contributor
has been advised of the possibility of such damages.
9. Accepting Warranty or Additional Liability. While redistributing
the Work or Derivative Works thereof, You may choose to offer,
and charge a fee for, acceptance of support, warranty, indemnity,
or other liability obligations and/or rights consistent with this
License. However, in accepting such obligations, You may act only
on Your own behalf and on Your sole responsibility, not on behalf
of any other Contributor, and only if You agree to indemnify,
defend, and hold each Contributor harmless for any liability
incurred by, or claims asserted against, such Contributor by reason
of your accepting any such warranty or additional liability.
END OF TERMS AND CONDITIONS
APPENDIX: How to apply the Apache License to your work.
To apply the Apache License to your work, attach the following
boilerplate notice, with the fields enclosed by brackets "[]"
replaced with your own identifying information. (Don't include
the brackets!) The text should be enclosed in the appropriate
comment syntax for the file format. We also recommend that a
file or class name and description of purpose be included on the
same "printed page" as the copyright notice for easier
identification within third-party archives.
Copyright [yyyy] [name of copyright owner]
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
---- LLVM Exceptions to the Apache 2.0 License ----
As an exception, if, as a result of your compiling your source code, portions
of this Software are embedded into an Object form of such source code, you
may redistribute such embedded portions in such Object form without complying
with the conditions of Sections 4(a), 4(b) and 4(d) of the License.
In addition, if you combine or link compiled forms of this Software with
software that is licensed under the GPLv2 ("Combined Software") and if a
court of competent jurisdiction determines that the patent provision (Section
3), the indemnity provision (Section 9) or other Section of the License
conflicts with the conditions of the GPLv2, you may retroactively and
prospectively choose to deem waived or otherwise exclude such Section(s) of
the License, but only in their entirety and only with respect to the Combined
Software.
==============================================================================
Software from third parties included in the LLVM Project:
==============================================================================
The LLVM Project contains third party software which is under different license
terms. All such code will be identified clearly using at least one of two
mechanisms:
1) It will be in a separate directory tree with its own `LICENSE.txt` or
`LICENSE` file at the top containing the specific license and restrictions
which apply to that software, or
2) It will contain specific license and restriction terms at the top of every
file.
==============================================================================
Legacy LLVM License (https://llvm.org/docs/DeveloperPolicy.html#legacy):
==============================================================================
University of Illinois/NCSA
Open Source License
Copyright (c) 2003-2019 University of Illinois at Urbana-Champaign.
All rights reserved.
Developed by:
LLVM Team
University of Illinois at Urbana-Champaign
http://llvm.org
Permission is hereby granted, free of charge, to any person obtaining a copy of
this software and associated documentation files (the "Software"), to deal with
the Software without restriction, including without limitation the rights to
use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies
of the Software, and to permit persons to whom the Software is furnished to do
so, subject to the following conditions:
* Redistributions of source code must retain the above copyright notice,
this list of conditions and the following disclaimers.
* Redistributions in binary form must reproduce the above copyright notice,
this list of conditions and the following disclaimers in the
documentation and/or other materials provided with the distribution.
* Neither the names of the LLVM Team, University of Illinois at
Urbana-Champaign, nor the names of its contributors may be used to
endorse or promote products derived from this Software without specific
prior written permission.
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 AND NONINFRINGEMENT. IN NO EVENT SHALL THE
CONTRIBUTORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS WITH THE
SOFTWARE.

View File

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

View File

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

View File

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

41
cmake/FindOgg.cmake Normal file
View File

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

41
cmake/FindOpus.cmake Normal file
View File

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

44
cmake/FindOpusFile.cmake Normal file
View File

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

View File

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

View File

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

View File

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

View File

@@ -51,8 +51,8 @@ install(FILES
${CMAKE_SOURCE_DIR}/README.md
${CMAKE_SOURCE_DIR}/CREDITS.md
${CMAKE_SOURCE_DIR}/CONTRIBUTING.md
${CMAKE_SOURCE_DIR}/changelog.txt
${CMAKE_SOURCE_DIR}/known-bugs.txt
${CMAKE_SOURCE_DIR}/changelog.md
${CMAKE_SOURCE_DIR}/known-bugs.md
DESTINATION ${DOCS_DESTINATION_DIR}
COMPONENT docs)
@@ -62,6 +62,7 @@ install(FILES
${CMAKE_SOURCE_DIR}/docs/desync.md
${CMAKE_SOURCE_DIR}/docs/directory_structure.md
${CMAKE_SOURCE_DIR}/docs/eints.md
${CMAKE_SOURCE_DIR}/docs/fonts.md
${CMAKE_SOURCE_DIR}/docs/game_coordinator.md
${CMAKE_SOURCE_DIR}/docs/linkgraph.md
${CMAKE_SOURCE_DIR}/docs/logging_and_performance_metrics.md
@@ -172,10 +173,10 @@ elseif(WIN32)
set(CPACK_PACKAGE_FILE_NAME "openttd-#CPACK_PACKAGE_VERSION#-windows-${CPACK_SYSTEM_NAME}")
if(WINDOWS_CERTIFICATE_COMMON_NAME)
if(DEFINED ENV{AZURE_CODESIGN_PROFILE_NAME})
add_custom_command(TARGET openttd
POST_BUILD
COMMAND "${CMAKE_SOURCE_DIR}/os/windows/sign.bat" "$<TARGET_FILE:openttd>" "${WINDOWS_CERTIFICATE_COMMON_NAME}"
COMMAND "${CMAKE_SOURCE_DIR}/os/windows/sign.bat" "${BINARY_DESTINATION_DIR}"
)
endif()
elseif(UNIX)

View File

@@ -57,13 +57,6 @@ 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)
if(EMSCRIPTEN)
# Although pthreads is supported, it is not in a way yet that is
# useful for us.
option(OPTION_USE_THREADS "Use threads" OFF)
else()
option(OPTION_USE_THREADS "Use threads" ON)
endif()
option(OPTION_USE_NSIS "Use NSIS to create windows installer; enable only for stable releases" OFF)
option(OPTION_TOOLS_ONLY "Build only tools target" OFF)
option(OPTION_DOCS_ONLY "Build only docs target" OFF)
@@ -85,7 +78,6 @@ function(show_options)
message(STATUS "Option Dedicated - ${OPTION_DEDICATED}")
message(STATUS "Option Install FHS - ${OPTION_INSTALL_FHS}")
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)
@@ -109,10 +101,6 @@ function(add_definitions_based_on_options)
add_definitions(-DDEDICATED)
endif()
if(NOT OPTION_USE_THREADS)
add_definitions(-DNO_THREADS)
endif()
if(OPTION_USE_ASSERTS)
add_definitions(-DWITH_ASSERT)
else()

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@@ -1,4 +1,4 @@
cmake_minimum_required(VERSION 3.5)
cmake_minimum_required(VERSION 3.17)
#
# CMake script to automatically generate the enums in script_window.hpp
@@ -56,11 +56,14 @@ foreach(ENUM IN LISTS ENUM_LINES)
endif()
# Check for enum match
if("${LINE}" MATCHES "^ *enum *${ENUM_PATTERN} *\{")
if("${LINE}" MATCHES "^ *enum *${ENUM_PATTERN}( *: *[^ ]*)? *\{")
# REGEX REPLACE does a REGEX MATCHALL and fails if an empty string is matched
string(REGEX MATCH "[^ ]*" RESULT "${LINE}")
string(REPLACE "${RESULT}" "" RM_INDENT "${LINE}")
string(REGEX MATCH " *: *[^ ]*" RESULT "${LINE}")
string(REPLACE "${RESULT}" "" LINE "${LINE}")
set(ACTIVE 1)
if(ACTIVE_COMMENT GREATER 0)
string(APPEND ${PLACE_HOLDER} "\n${COMMENT}")

View File

@@ -1,4 +1,4 @@
cmake_minimum_required(VERSION 3.5)
cmake_minimum_required(VERSION 3.17)
#
# Runs a single regressoion test
@@ -63,11 +63,10 @@ string(REGEX REPLACE "\\\[[0-9-]+ [0-9:]+\\\] " "" REGRESSION_RESULT "${REGRESSI
string(REGEX REPLACE "\\\[script:[0-9]\\\]" "" REGRESSION_RESULT "${REGRESSION_RESULT}")
# Convert the output to a format that is expected (and more readable) by result.txt
string(REPLACE "\ndbg: " "\n" REGRESSION_RESULT "${REGRESSION_RESULT}")
string(REPLACE "\n " "\nERROR: " REGRESSION_RESULT "${REGRESSION_RESULT}")
string(REPLACE "\nERROR: [1] " "\n" REGRESSION_RESULT "${REGRESSION_RESULT}")
string(REPLACE "\n[P] " "\n" REGRESSION_RESULT "${REGRESSION_RESULT}")
string(REPLACE "\n[S] " "\n" REGRESSION_RESULT "${REGRESSION_RESULT}")
string(REPLACE "dbg: " "ERROR: " REGRESSION_RESULT "${REGRESSION_RESULT}")
string(REPLACE "ERROR: [1] " "" REGRESSION_RESULT "${REGRESSION_RESULT}")
string(REPLACE "[P] " "" REGRESSION_RESULT "${REGRESSION_RESULT}")
string(REPLACE "[S] " "" REGRESSION_RESULT "${REGRESSION_RESULT}")
string(REGEX REPLACE "dbg: ([^\n]*)\n?" "" REGRESSION_RESULT "${REGRESSION_RESULT}")
# Remove duplicate script info
@@ -88,12 +87,7 @@ set(ERROR NO)
list(LENGTH REGRESSION_EXPECTED REGRESSION_EXPECTED_LENGTH)
# Compare the output
foreach(RESULT IN LISTS REGRESSION_RESULT)
unset(EXPECTED)
if(ARGC LESS REGRESSION_EXPECTED_LENGTH)
list(GET REGRESSION_EXPECTED ${ARGC} EXPECTED)
endif()
foreach(RESULT EXPECTED IN ZIP_LISTS REGRESSION_RESULT REGRESSION_EXPECTED)
math(EXPR ARGC "${ARGC} + 1")
if(NOT RESULT STREQUAL EXPECTED)

View File

@@ -1,4 +1,4 @@
cmake_minimum_required(VERSION 3.5)
cmake_minimum_required(VERSION 3.17)
if(NOT SCRIPT_API_SOURCE_FILE)
message(FATAL_ERROR "Script needs SCRIPT_API_SOURCE_FILE defined")
@@ -28,10 +28,10 @@ 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 <> struct Param<${NAME} *> { static inline ${NAME} *Get(HSQUIRRELVM vm, int index) { return static_cast<${NAME} *>(Squirrel::GetRealInstance(vm, index, \"${REALNAME}\")); } };")
string(APPEND SQUIRREL_EXPORT "\n template <> struct Param<${NAME} &> { static inline ${NAME} &Get(HSQUIRRELVM vm, int index) { return *static_cast<${NAME} *>(Squirrel::GetRealInstance(vm, index, \"${REALNAME}\")); } };")
string(APPEND SQUIRREL_EXPORT "\n template <> struct Param<const ${NAME} *> { static inline const ${NAME} *Get(HSQUIRRELVM vm, int index) { return static_cast<${NAME} *>(Squirrel::GetRealInstance(vm, index, \"${REALNAME}\")); } };")
string(APPEND SQUIRREL_EXPORT "\n template <> struct Param<const ${NAME} &> { static inline const ${NAME} &Get(HSQUIRRELVM vm, int index) { return *static_cast<${NAME} *>(Squirrel::GetRealInstance(vm, index, \"${REALNAME}\")); } };")
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; } };")
elseif("${NAME}" STREQUAL "ScriptText")
@@ -44,7 +44,10 @@ macro(dump_class_templates NAME)
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 if (sq_gettype(vm, index) == OT_NULL) {")
string(APPEND SQUIRREL_EXPORT "\n return nullptr;")
string(APPEND SQUIRREL_EXPORT "\n }")
string(APPEND SQUIRREL_EXPORT "\n throw sq_throwerror(vm, fmt::format(\"parameter {} has an invalid type ; expected: 'Text'\", index - 1));")
string(APPEND SQUIRREL_EXPORT "\n }")
string(APPEND SQUIRREL_EXPORT "\n };")
else()
@@ -307,11 +310,6 @@ foreach(LINE IN LISTS SOURCE_LINES)
string(APPEND SQUIRREL_EXPORT "\nnamespace SQConvert {")
set(NAMESPACE_OPENED TRUE)
endif()
string(APPEND SQUIRREL_EXPORT "\n /* Allow enums to be used as Squirrel parameters */")
foreach(ENUM IN LISTS ENUMS)
string(APPEND SQUIRREL_EXPORT "\n template <> struct Param<${ENUM}> { static inline ${ENUM} Get(HSQUIRRELVM vm, int index) { SQInteger tmp; sq_getinteger(vm, index, &tmp); return (${ENUM})tmp; } };")
string(APPEND SQUIRREL_EXPORT "\n template <> struct Return<${ENUM}> { static inline int Set(HSQUIRRELVM vm, ${ENUM} res) { sq_pushinteger(vm, res); return 1; } };")
endforeach()
endif()
# Then check whether we have structs/classes to print
@@ -342,14 +340,14 @@ 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 <> SQInteger PushClassName<${CLS}, ScriptType::${APIUC}>(HSQUIRRELVM vm) { sq_pushstring(vm, \"${API_CLS}\", -1); return 1; }")
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}\");")
if("${SUPER_CLS}" STREQUAL "Text" OR "${SUPER_CLS}" STREQUAL "ScriptObject" OR "${SUPER_CLS}" STREQUAL "AIAbstractiveList::Valuator")
if("${SUPER_CLS}" STREQUAL "Text")
string(APPEND SQUIRREL_EXPORT "\n SQ${API_CLS}.PreRegister(engine);")
else()
string(APPEND SQUIRREL_EXPORT "\n SQ${API_CLS}.PreRegister(engine, \"${API_SUPER_CLS}\");")
@@ -574,6 +572,10 @@ foreach(LINE IN LISTS SOURCE_LINES)
list(APPEND CONST_VALUES "${CMAKE_MATCH_1}")
continue()
endif()
if("${LINE}" MATCHES "^[ ]*static constexpr [^ ]+ ([^ ]+) = -?\\(?[^ ]*\\)?[^ ]+;")
list(APPEND CONST_VALUES "${CMAKE_MATCH_1}")
continue()
endif()
# Add a method to the list
if("${LINE}" MATCHES "^.*\\(.*\\).*$")

View File

@@ -1,4 +1,4 @@
cmake_minimum_required(VERSION 3.5)
cmake_minimum_required(VERSION 3.17)
if(NOT INCLUDES_SOURCE_FILE)
message(FATAL_ERROR "Script needs INCLUDES_SOURCE_FILE defined")

View File

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

View File

@@ -195,10 +195,11 @@ Last updated: 2014-02-23
'src/network/network_func.h'.
(DEBUG_FAILED_DUMP_COMMANDS is explained later)
- Put the 'commands-out.log' into the root save folder, and rename
it to 'commands.log'.
- Run 'openttd -D -d desync=3 -g startsavegame.sav'.
This replays the server log and creates new 'commands-out.log'
and 'dmp_cmds_*.sav' in your autosave folder.
it to 'commands.log'. Strip everything and including the "newgame"
entry from the log.
- Run 'openttd -D -d desync=0 -g startsavegame.sav'.
This replays the server log. Use "-d desync=3" to also create a
new 'commands-out.log' and 'dmp_cmds_*.sav' in your autosave folder.
## 3.2) Evaluation of the replay
@@ -226,7 +227,7 @@ Last updated: 2014-02-23
savegames with your own ones from the replay. You can also comment/disable
the 'NOT_REACHED' mentioned above, to get another 'dmp_cmds_*.sav' from
the replay after the mismatch has already been detected.
See Section 3.2 on how to compare savegames.
See Section 3.3 on how to compare savegames.
If the saves differ you have located the Desync between the last dmp_cmds
that match and the first one that does not. The difference of the saves
may point you in the direction of what causes it.
@@ -252,16 +253,14 @@ Last updated: 2014-02-23
are replayed. Their internal state will thus not change in the
replay and will differ.
To compare savegame more semantically, there exist some ugly hackish
tools at:
http://devs.openttd.org/~frosch/texts/zpipe.c
http://devs.openttd.org/~frosch/texts/printhunk.c
To compare savegame more semantically, easiest is to first export them
to a JSON format with for example:
The first one decompresses OpenTTD savegames. The second one creates
a textual representation of an uncompressed savegame, by parsing hunks
and arrays and such. With both tools you need to be a bit careful
since they work on stdin and stdout, which may not deal well with
binary data.
https://github.com/TrueBrain/OpenTTD-savegame-reader
If you have the textual representation of the savegames, you can
compare them with regular diff tools.
By running:
python -m savegame_reader --export-json dmp_cmds_NNN.sav | jq . > NNN.json
Now you can use any (JSON) diff tool to compare the two savegames in a
somewhat human readable way.

62
docs/fonts.md Normal file
View File

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

View File

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

View File

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

View File

@@ -79,8 +79,8 @@ the array so you can quickly see what is used and what is not.
<tr>
<td rowspan="2">0</td>
<td class="caption">ground</td>
<td class="bits" rowspan=27><span class="used" title="Tile type">XXXX</span> <span class="used" title="Presence and direction of bridge above">XX</span> <span class="used" title="Tropic Zone: only meaningful in tropic climate. It contains the definition of the available zones">XX</span></td>
<td class="bits" rowspan=27><span class="used" title="Tile height">XXXX XXXX</span></td>
<td class="bits" rowspan=29><span class="used" title="Tile type">XXXX</span> <span class="used" title="Presence and direction of bridge above">XX</span> <span class="used" title="Tropic Zone: only meaningful in tropic climate. It contains the definition of the available zones">XX</span></td>
<td class="bits" rowspan=29><span class="used" title="Tile height">XXXX XXXX</span></td>
<td class="bits" rowspan=2><span class="free">OOO</span><span class="usable" title="Owner (always OWNER_NONE)">1 OOOO</span></td>
<td class="bits"><span class="free">OOOO OOOO OOOO OOOO</span></td>
<td class="bits"><span class="used" title="Type of hedge on NE border">XXX</span> <span class="used" title="Snow presence">X</span><span class="free">OOOO</span></td>
@@ -130,7 +130,7 @@ the array so you can quickly see what is used and what is not.
<td class="bits"><span class="used" title="Tile type: simple road (00), level crossing (01), road depot (10)">OO</span> <span class="used" title="Disallow vehicles to go a specific direction">XX</span> <span class="used" title="Road pieces">XXXX</span></td>
<td class="bits"><span class="free">OO</span> <span class="used" title="Pavement type">XXX</span><span class="free">OOO</span></td>
<td class="bits"><span class="free">OO</span><span class="used" title="Snow/desert present">X</span> <span class="free">O</span><span class="used" title="Roadworks counter">XXXX</span></td>
<td class="bits" rowspan=1><span class="free">OOOO</span> <span class="used" title="Tram type">XXXX XX<span class="free">OO OOOO</span></td>
<td class="bits" rowspan=1><span class="free">OOOO</span> <span class="used" title="Tram type">XXXX XX</span><span class="free">OO OOOO</span></td>
</tr>
<tr>
<td class="caption">level crossing</td>
@@ -156,17 +156,17 @@ the array so you can quickly see what is used and what is not.
<td class="caption">finished house</td>
<td class="bits" rowspan=2><span class="used" title="House random bits">XXXX XXXX</span></td>
<td class="bits" rowspan=2><span class="pool" title="Town index on pool">XXXX XXXX XXXX XXXX</span></td>
<td class="bits"><span class="used" title="House is complete/in construction (see m5)">1</span> <span class="used" title="House type (m4 + m3[6])">X</span><span class="free">O</span><span class="usable" title="Activated triggers (bits 2..4 don't have a meaning)">XXX</span><span class="used" title="Activated triggers (bits 2..4 don't have a meaning)">XX</span></td>
<td class="bits" rowspan=2><span class="used" title="House type (m4 + m3[6])">XXXX XXXX</span></td>
<td class="bits"><span class="used" title="House is complete/in construction (see m5)">1</span><span class="free">O</span><span class="used" title="The house is protected from the town upgrading it.">X</span><span class="usable" title="Activated triggers (bits 2..4 don't have a meaning)">X XX</span><span class="used" title="Activated triggers (bits 2..4 don't have a meaning)">XX</span></td>
<td class="bits" rowspan=2><span class="free">OOOO OOOO</span></td>
<td class="bits"><span class="used" title="Age in years, clamped at 255">XXXX XXXX</span></td>
<td class="bits" rowspan=2><span class="abuse" title="Newhouses activated: periodic processing time remaining; if not, lift position for houses 04 and 05">XXXX XX</span><span class="free">OO</span></td>
<td class="bits" rowspan=2><span class="abuse" title="Newhouses activated: periodic processing time remaining; if not, lift position for houses 04 and 05">XXXX XX</span><span class="used" title="Animated tile state">XX</span></td>
<td class="bits" rowspan=2><span class="abuse" title="If newhouses active, m7 is the current animation frame">XXXX</span> <span class="abuse" title="If newhouses active, m7 is the current animantion frame; if not, lift behaviour for houses 04 and 05">XXXX</span></td>
<td class="bits" rowspan=2><span class="free">OOOO OOOO OOOO OOOO</span></td>
<td class="bits" rowspan=2><span class="free">OOOO</span> <span class="used" title="House type">XXXX XXXX XXXX</span></td>
</tr>
<tr>
<td class="caption">house under construction</td>
<td class="bits"><span class="used" title="House is complete/in construction (see m5)">O</span> <span class="used" title="House type (m4 + m3[6])">X</span><span class="free">O</span><span class="usable" title="Activated triggers (bits 2..4 don't have a meaning)">XXX</span><span class="used" title="Activated triggers (bits 2..4 don't have a meaning)">XX</span></td>
<td class="bits"><span class="free">OOO</span><span class="used" title="Construction stage">XX</span> <span class="used" title="Construction counter">XXX</span></td>
<td class="bits"><span class="used" title="House is complete/in construction (see m5)">O</span><span class="used" title="House type (m4 + m3[6])">X</span><span class="used" title="The house is protected from the town upgrading it.">X</span><span class="usable" title="Activated triggers (bits 2..4 don't have a meaning)">X XX</span><span class="used" title="Activated triggers (bits 2..4 don't have a meaning)">XX</span></td>
<td class="bits"><span class="free">OOO</span><span class="used" title="Construction stage">X X</span><span class="used" title="Construction counter">XXX</span></td>
</tr>
<tr>
<td>4</td>
@@ -181,14 +181,14 @@ the array so you can quickly see what is used and what is not.
<td class="bits"><span class="free">OOOO OOOO OOOO OOOO</span></td>
</tr>
<tr>
<td rowspan=7>5</td>
<td rowspan=8>5</td>
<td class="caption">rail station</td>
<td class="bits" rowspan=7><span class="free">O</span><span class="used" title="Water class">XX</span> <span class="used" title="Owner">XXXXX</span></td>
<td class="bits" rowspan=7><span class="pool" title="Station index on pool">XXXX XXXX XXXX XXXX</span></td>
<td class="bits" rowspan=2><span class="used" title="Random bits">XXXX</span> <span class="free">OOOO</span></td>
<td class="bits" rowspan=8><span class="free">O</span><span class="used" title="Water class">XX</span> <span class="used" title="Owner">XXXXX</span></td>
<td class="bits" rowspan=8><span class="pool" title="Station index on pool">XXXX XXXX XXXX XXXX</span></td>
<td class="bits" rowspan=2><span class="used" title="Random bits">XXXX</span> <span class="free">O</span><span class="used" title="May have pylons">X</span><span class="used" title="May have wires">X</span><span class="used" title="Tile is blocked">X</span></td>
<td class="bits" rowspan=2><span class="used" title="Custom station specifications ID">XXXX XXXX</span></td>
<td class="bits"><span class="used" title="Graphics index">XXXX XXXX</span></td>
<td class="bits" rowspan=2><span class="used" title="May have pylons">X</span><span class="used" title="May have wires">X</span><span class="used" title="Station type">XXX</span> <span class="used" title="Reserved track">X</span><span class="free">O</span><span class="used" title="Tile is blocked">X</span></td>
<td class="bits" rowspan=2><span class="free">O</span><span class="used" title="Station type">XXX X</span><span class="used" title="Reserved track">X</span><span class="used" title="Animated tile state">XX</span></td>
<td class="bits" rowspan=2><span class="used" title="Animation frame">XXXX XXXX</span></td>
<td class="bits" rowspan=2><span class="free">OOOO OOOO OO</span><span class="used" title="Railway type">XX XXXX</span></td>
</tr>
@@ -199,12 +199,17 @@ the array so you can quickly see what is used and what is not.
<tr>
<td class="caption">road stop</td>
<td class="bits"><span class="used" title="Owner of tram">XXXX</span> <span class="free">OOOO</span></td>
<td class="bits"><span class="free">OO</span><span class="used" title="Roadtype for road stop">XX XXXX</span></td>
<td class="bits"><span class="usable" title="Graphics index">OOOO O</span><span class="used" title="Graphics index: 00 (exit towards NE), 01 (exit towards SE), 02 (exit towards SW), 03 (exit towards NW), 04 (drive through X), 05 (drive through Y)">XXX</span></td>
<td class="bits" rowspan=5><span class="free">OO</span><span class="used" title="Station type">XX X</span><span class="free">OOO</span></td>
<td class="bits"><span class="free">OOO</span><span class="used" title="Owner of road">X XXXX</span></td>
<td class="bits" rowspan=2><span class="free">OO</span><span class="used" title="Roadtype for road stop">XX XXXX</span></td>
<td class="bits" rowspan=2><span class="usable" title="Graphics index">OOOO O</span><span class="used" title="Graphics index: 00 (exit towards NE), 01 (exit towards SE), 02 (exit towards SW), 03 (exit towards NW), 04 (drive through X), 05 (drive through Y)">XXX</span></td>
<td class="bits" rowspan=6><span class="free">O</span><span class="used" title="Station type">XXX X</span><span class="free">O</span><span class="used" title="Animated tile state">XX</span></td>
<td class="bits" rowspan=2><span class="free">OOO</span><span class="used" title="Owner of road">X XXXX</span></td>
<td class="bits"><span class="free">OOOO</span> <span class="used" title="Tram type">XXXX XX</span> <span class="used" title="Custom road stops specifications ID">XXXXXX</span></td>
</tr>
<tr>
<td class="caption">road waypoint</td>
<td class="bits"><span class="used" title="Owner of tram">XXXX</span> <span class="used" title="Pavement type">XX</span><span class="free">OO</span></td>
<td class="bits"><span class="used" title="Snow/desert present">X</span><span class="free">OOO</span> <span class="used" title="Tram type">XXXX XX</span> <span class="used" title="Custom road stops specifications ID">XXXXXX</span></td>
</tr>
<tr>
<td class="caption">airport</td>
<td class="bits"><span class="used" title="Random bits">XXXX</span> <span class="free">OOOO</span></td>
@@ -235,32 +240,37 @@ the array so you can quickly see what is used and what is not.
<td class="bits"><span class="free">OOOO OOOO</span></td>
</tr>
<tr>
<td rowspan=4>6</td>
<td class="caption">sea, shore</td>
<td class="bits" rowspan=4><span class="used" title="Ship docking tile status">X</span> <span class="used" title="Water class">XX</span> <span class="used" title="Owner">XXXXX</span></td>
<td class="bits" rowspan=3><span class="free">OOOO OOOO OOOO OOOO</span></td>
<td class="bits" rowspan=4><span class="free">OOOO OOOO</span></td>
<td class="bits"><span class="free">OOOO OOOO</span></td>
<td class="bits"><span class="used" title="Water tile type: coast, clear, lock, depot">O<span class="usable">OO</span>O</span> <span class="free">OOO</span><span class="used" title="Sea shore flag">X</span></td>
<td class="bits" rowspan=4><span class="free">OOOO OOOO</span></td>
<td class="bits" rowspan=4><span class="free">OOOO OOOO</td>
<td rowspan=5>6</td>
<td class="caption">sea</td>
<td class="bits" rowspan=5><span class="used" title="Ship docking tile status">X</span> <span class="used" title="Water class">XX</span> <span class="used" title="Owner">XXXXX</span></td>
<td class="bits" rowspan=4><span class="free">OOOO OOOO OOOO OOOO</span></td>
<td class="bits" rowspan=5><span class="free">OOOO OOO</span><span class="used" title="Non-flooding state">X</span></td>
<td class="bits"><span class="free">OOOO OOOO</span></td>
<td class="bits"><span class="used" title="Water tile type: coast, clear, lock, depot">0000</span> <span class="free">OOO0</span></td>
<td class="bits" rowspan=5><span class="free">OOOO OOOO</span></td>
<td class="bits" rowspan=5><span class="free">OOOO OOOO</span></td>
<td class="bits" rowspan=5><span class="free">OOOO OOOO OOOO OOOO</span></td>
</tr>
<tr>
<td class="caption">canal, river</td>
<td class="bits"><span class="used" title="Canal/river random bits">XXXX XXXX</span></td>
<td class="bits"><span class="used" title="Water tile type: coast, clear, lock, depot">O<span class="usable">OO</span>O</span> <span class="free">OOOO</span></td>
<td class="bits"><span class="used" title="Water tile type: coast, clear, lock, depot">0000</span> <span class="free">OOOO</span></td>
</tr>
<tr>
<td class="caption">shore</td>
<td class="bits"><span class="free">OOOO OOOO</span></td>
<td class="bits"><span class="used" title="Water tile type: coast, clear, lock, depot">0001</span> <span class="free">OOOO</span></td>
</tr>
<tr>
<td class="caption">lock</td>
<td class="bits"><span class="free">OOOO OOOO</span></td>
<td class="bits"><span class="used" title="Water tile type: coast, clear, lock, depot">O<span class="usable">OO</span>1</span> <span class="used" title="Lock part">XX</span> <span class="used" title="Lock orientation m5[1..0]">XX</span></td>
<td class="bits"><span class="used" title="Water tile type: coast, clear, lock, depot">0010</span> <span class="used" title="Lock part">XX</span><span class="used" title="Lock orientation m5[1..0]">XX</span></td>
</tr>
<tr>
<td class="caption">shipdepot</td>
<td class="bits"><span class="pool" title="Depot index on pool">XXXX XXXX XXXX XXXX</span></td>
<td class="bits"><span class="free">OOOO OOOO</span></td>
<td class="bits"><span class="used" title="Water tile type: coast, clear, lock, depot">1<span class="usable">OOO</span></span> <span class="free">OO</span><span class="used" title="Depot axis">X</span> <span class="used" title="Depot part">X</span></td>
<td class="bits"><span class="used" title="Water tile type: coast, clear, lock, depot">0011</span> <span class="free">OO</span><span class="used" title="Depot axis">X</span><span class="used" title="Depot part">X</span></td>
</tr>
<tr>
<td rowspan=2>8</td>
@@ -270,7 +280,7 @@ the array so you can quickly see what is used and what is not.
<td class="bits" rowspan=2><span class="used" title="Random bits">XXXX XXXX</span></td>
<td class="bits" rowspan=2><span class="used" title="Animation loop">XXXX XXXX</span></td>
<td class="bits" rowspan=2><span class="used" title="Industry graphics ID (m5 + m6[2])">XXXX XXXX</span></td>
<td class="bits" rowspan=2><span class="free">OO</span><span class="used" title="Random triggers (NewGRF)">XXX</span> <span class="used" title="Industry graphics ID (m5 + m6[2])">X</span><span class="free">OO</span></td>
<td class="bits" rowspan=2><span class="free">OO</span><span class="used" title="Random triggers (NewGRF)">XXX</span> <span class="used" title="Industry graphics ID (m5 + m6[2])">X</span><span class="used" title="Animated tile state">XX</span></td>
<td class="bits" rowspan=2><span class="used" title="Animation frame">XXXX XXXX</span></td>
<td class="bits" rowspan=2><span class="free">OOOO OOOO OOOO OOOO</span></td>
</tr>
@@ -303,7 +313,7 @@ the array so you can quickly see what is used and what is not.
<td class="bits"><span class="used" title="Random bits">XXXX XXXX</span></td>
<td class="bits"><span class="free">OOOO OOOO</span></td>
<td class="bits"><span class="pool" title="Object index on pool (m2 + m5)">XXXX XXXX</span></td>
<td class="bits"><span class="free">OOOO OOOO</span></td>
<td class="bits"><span class="free">OOOO OO</span><span class="used" title="Animated tile state">XX</span></td>
<td class="bits"><span class="used" title="Animation counter">XXXX XXXX</span></td>
<td class="bits" rowspan=1><span class="free">OOOO OOOO OOOO OOOO</span></td>
</tr>

View File

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

View File

@@ -7,18 +7,20 @@ This guide is for OpenTTD developers/maintainers, to release a new version of Op
* If this is a beta version release, skip this step.
* If this is an RC1 (first Release Candidate) build, create a new branch `release/nn` where `nn` is the major version number, then apply changes similar to [PR#9573](https://github.com/OpenTTD/OpenTTD/pull/9573). You also need to forwardport the changelog, as in [PR#10113](https://github.com/OpenTTD/OpenTTD/pull/10113).
* Update 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.
* Update the version in `CMakeLists.txt` in the master branch, heading for the next major release, e.g. from 14.0 to 15.0.
* Add the new version to `ApiVersions` in `src/ai/ai_info.hpp` and `src/game/game_info.hpp`.
* Add the new version to `src/script/api/ai_changelog.hpp` and `src/script/api/game_changelog.hpp`.
* Update the version of regression in `bin/ai/regression/regression_info.nut`.
* Add a new (empty) AI compatibility script in `bin/ai/` and `bin/game/` for the version of the branch.
* Add a note to `src/saveload/saveload.h` about which savegame version is used in the branch.
* If this is a later RC or release build and the release branch already exists, you'll need to backport fixes and language from master to this branch, which were merged after the branch diverged from master. You can use these two helper scripts: https://github.com/OpenTTD/scripts/tree/main/backport
* If this is a maintenance release, update the version in `CMakeLists.txt` in the release branch, e.g. from 14.0 to 14.1.
## Step 1: Prepare changelog documentation
1. Update the [changelog](../changelog.txt) with new changes since the last release.
1. Update the [changelog](../changelog.md) 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.
@@ -29,20 +31,26 @@ This guide is for OpenTTD developers/maintainers, to release a new version of Op
1. Go to https://github.com/OpenTTD/website/new/main/_posts and write a new announcement post. See a [previous example](https://github.com/OpenTTD/website/pull/238) for a template.
2. Create a new branch for this post and open a PR for it.
3. Write announcement text for socials like Forum/Discord/Twitter/Reddit and include it in the PR.
3. Write announcement text for the store pages and socials like TT-Forums / Discord / Twitter / Reddit / Fosstodon / etc., 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.
5. Check the website post ("View Deployment" link) and make corrections. We usually just use the GitHub web interface for this and squash the result later.
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.
1. Confirm that the version in `CMakeLists.txt` matches the intended release version.
2. Go to https://github.com/OpenTTD/OpenTTD/releases/new and create a new tag matching the release number. For the body of the release, copy in the changelog. "Set as a pre-release" for a beta or RC.
3. Wait for the OpenTTD release workflow to be complete.
4. If this is a full release:
* for `Steam`: under Steamworks -> SteamPipe -> Builds, set the "testing" branch live on the "default" branch. This will request 2FA validation.
* for `GOG`: under Builds, "Publish" the freshly uploaded builds to `Master`, `GOG-use only` and `Testing`.
* for `Microsoft Store`: ask orudge to publish the new release.
Access to `Steam`, `GOG` and/or `Microsoft Store` requires a developer account on that platform.
You will need access to the shared keystore in order to create such an account.
For help and/or access to either or both, please contact TrueBrain.
## 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.
1. Merge the website PR. This will publish the release post.
2. Make announcements on social media and store pages. You may need to coordinate with other developers who can make posts on TT-Forums, Twitter, Reddit, Fosstodon, Discord, Steam, GOG, Microsoft Store, etc.

View File

@@ -19,7 +19,7 @@ Now simply open up the `crash.dmp`, and start debugging.
The best tool to use is `minidump-stackwalk` as published in the Rust's cargo index:
```bash
cargo install minidump-stackwalk
cargo install --locked minidump-stackwalk
```
For how to install Rust, please see [here](https://doc.rust-lang.org/cargo/getting-started/installation.html).

426
known-bugs.md Normal file
View File

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

View File

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

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

View File

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

Binary file not shown.

View File

@@ -1 +1 @@
4f03553f614a06d86dc06376db3353c7
019dba4830a64ee4345d3d647633e1da

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